ok:l("Delete")}).then(function(){a.$delete().catch(function(b,c){i.alert(l('An error occured while deleting the calendar "%{0}".',a.name),l(b.error))})})}functionw(b,c){functione(b,c,d){functione(a){varb=0===a.type.indexOf("text")||/\.(ics)$/.test(a.name);returnb||f.show({template:["<md-toast>",' <div class="md-toast-content">',' <md-icon class="md-warn md-hue-1">error_outline</md-icon>'," <span>"+l("Select an iCalendar file (.ics).")+"</span>"," </div>","</md-toast>"].join(""),position:"top right",hideDelay:3e3}),b}varh=this;h.uploader=newg({url:ApplicationBaseURL+[d.id,"import"].join("/"),autoUpload:!0,queueLimit:1,filters:[{name:e,fn:e}],onSuccessItem:function(b,d,e,g){varh;c.hide(),0===d.imported?h=l("No event was imported."):(h=l("A total of %{0} events were imported in the calendar.",d.imported),a.$emit("calendars:list")),f.show(f.simple().content(h).position("top right").hideDelay(3e3))},onErrorItem:function(a,b,c,d){f.show({template:["<md-toast>",' <div class="md-toast-content">',' <md-icon class="md-warn md-hue-1">error_outline</md-icon>'," <span>"+l("An error occurred while importing calendar.")+"</span>"," </div>","</md-toast>"].join(""),position:"top right",hideDelay:3e3})}}),h.close=function(){c.hide()}}d.show({parent:angular.element(document.body),targetEvent:b,clickOutsideToClose:!0,escapeToClose:!0,templateUrl:"UIxCalendarImportDialog",controller:e,controllerAs:"$CalendarImportDialogController",locals:{folder:c}}),e.$inject=["scope","$mdDialog","folder"]}functionx(a){_.forEach(m.$findAll(),function(b){a.id==b.id?b.active=1:b.active=0})}functiony(){_.forEach(m.$findAll(),function(a){a.active=1})}functionz(a){functionb(a,b){functionc(){a.hide()}vard=this;d.calendar=b,d.close=c}d.show({parent:angular.element(document.body),clickOutsideToClose:!0,escapeToClose:!0,templateUrl:a.id+"/links",controller:b,controllerAs:"links",locals:{calendar:a}}),b.$inject=["$mdDialog","calendar"]}functionA(a){functionb(a,b,c){functiond(){f.calendar.$save(),c.init(f.calendar.$omit()),b.hide()}functione(){b.cancel()}varf=this;f.calendar=newm(c.$omit()),f.saveProperties=d,f.close=e,a.$watch(function(){returnf.calendar.color},function(){c.color=f.calendar.color})}varc=a.color;d.show({templateUrl:a.id+"/properties",controller:b,controllerAs:"properties",clickOutsideToClose:!0,escapeToClose:!0,locals:{srcCalendar:a}}).catch(function(){a.color=c}),b.$inject=["$scope","$mdDialog","srcCalendar"]}functionB(a){G.calendarName=a.name,G.editMode=a.id,h("calendarName_"+a.id)}functionC(a){a.$reset(),G.editMode=!1}functionD(a){a.$rename().then(function(a){G.editMode=!1})}functionE(a){a.$acl.$users().then(function(){d.show({templateUrl:a.id+"/UIxAclEditor",controller:"AclController",controllerAs:"acl",clickOutsideToClose:!0,escapeToClose:!0,locals:{usersWithACL:a.$acl.users,User:n,folder:a}})})}functionF(a){e.debug("subscribeToFolder "+a.owner+a.name),m.$subscribe(a.owner,a.name).then(function(a){f.show(f.simple().content(l("Successfully subscribed to calendar")).position("top right").hideDelay(3e3))})}varG=this;G.activeUser=j.activeUser,G.service=m,G.newCalendar=t,G.addWebCalendar=u,G.confirmDelete=v,G.editFolder=B,G.revertEditing=C,G.renameFolder=D,G.share=E,G.importCalendar=w,G.showOnly=x,G.showAll=y,G.showLinks=z,G.showProperties=A,G.subscribeToFolder=F,G.filter={name:""},G.sortableMode=!1,G.toggleSortableMode=r,G.resetSort=s,G.sortableCalendars={scrollableContainer:"#sidenav-content",containment:"md-list",orderChanged:q,accept:p},k.ready().then(function(){G.categories=_.map(k.defaults.SOGoCalendarCategories,function(a){return{id:a.asCSSIdentifier(),name:a,color:k.defaults.SOGoCalendarCategoriesColors[a]}})}),b.$watch(function(){return_.union(_.map(m.$calendars,function(a){return_.pick(a,["id","active","color"])}),_.map(m.$subscriptions,function(a){return_.pick(a,["id","active","color"])}),_.map(m.$webcalendars,function(a){return_.pick(a,["id","active","color"])}))},function(b,c){vard,f,g;d=_.intersectionBy(b,c,"id"),f=_.map(_.filter(d,function(a){varb=_.find(c,{id:a.id});return!_.isEqual(a,