(function(){"use strict";u8.Crm.CalendarItem=function(e){$.extend(this,u8.Crm.CalendarItem.defaults,e);if(!this.end||this.end<this.start){this.end=this.start.clone()}this.isAllDay=u8.Crm.CalendarItem.isAllDay(this.start,this.end);if(!this.uid){this.uid={infoAreaId:null,recordId:-1}}this.bind()};u8.Crm.CalendarItem.makeClass({name:"CalendarItem",events:["Changed","Select","Focus"],mixins:[u8.Base.ItemModelMixIn]});u8.Crm.CalendarItem.defaults={id:null,uid:null,providerId:"",start:null,end:null,repId:null,participants:null,type:"",state:"",caption:"",isPrivate:false,isRecurring:false,visible:true,action:""};$.extend(u8.Crm.CalendarItem.prototype,{dispose:function(){this.unbind()},containsDate:function(e){if(e===null){return false}var t=this.start.toDate();if(e<t){return false}var i=this.end.toDate();if(this.start.equals(this.end)||!this.end.equals(i)){i.addDays(1)}i.addMilliseconds(-1);if(e>i){return false}return true},compareTo:function(t){return e(this,t)},execute:function(e){var t=this.uid;if(!t){return}var i=this.action||"A_Edit%%_Calendar";var a=u8.services.schema.getInfoArea(t.infoAreaId);if(a){var n=a.isVirtualInfoArea?a.baseInfoAreaId:t.infoAreaId;i=i.replace(/%%/g,n)}u8.services.actions.execute(i,{arguments:$.extend({source:this,uid:t},e)})}});$.extend(u8.Crm.CalendarItem,{isAllDay:function(e,t){var i=t.diffDays(e);if(i==1&&t.isDate()&&!e.isDate()){i=0}return i>0}});var e=u8._.cmp("start").disjunct(u8._.cmp("id"))})();