/** 
 * Kendo UI v2016.3.1118 (http://www.telerik.com/kendo-ui)                                                                                                                                              
 * Copyright 2016 Telerik AD. All rights reserved.                                                                                                                                                      
 *                                                                                                                                                                                                      
 * Kendo UI commercial licenses may be obtained at                                                                                                                                                      
 * http://www.telerik.com/purchase/license-agreement/kendo-ui-complete                                                                                                                                  
 * If you do not own a commercial license, this file shall be governed by the trial license terms.                                                                                                      
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       

*/
!function(e,define){define("kendo.scheduler.dayview.min",["kendo.scheduler.view.min"],e)}(function(){return function(e,t){function a(e){var t=new Date(1980,1,1,0,0,0);return d(t,k(e)),t}function i(e,t,a){return e>=t&&e<=a}function s(e,t,a,i){return i=i?e<=a:e<a,e>t&&i}function n(e,t,a,i){var s,n=e._continuousEvents,o=n[n.length-1],l=m(t.start.startDate()).getTime();if(i&&o&&m(o.start.startDate()).getTime()==l){for(s=n.length-1;s>-1&&!(n[s].isAllDay||m(n[s].start.startDate()).getTime()<l);s--);n.splice(s+1,0,{element:a,isAllDay:!0,uid:a.attr(r.attr("uid")),start:t.start,end:t.end})}else n.push({element:a,isAllDay:i,uid:a.attr(r.attr("uid")),start:t.start,end:t.end})}function o(e){var t=[],a=e.workWeekStart;for(t.push(a);e.workWeekEnd!=a;)a>6?a-=7:a++,t.push(a);return t}var r=window.kendo,l=r.ui,d=r.date.setTime,h=l.SchedulerView,u=r._outerWidth,c=r._outerHeight,p=e.extend,f=e.proxy,m=r.date.getDate,_=r.date.MS_PER_MINUTE,g=r.date.MS_PER_DAY,v="k-current-time",D="k-current-time-arrow",y=.8666,k=r.date.getMilliseconds,T=".kendoMultiDayView",w=r.template('<div title="(#=kendo.format("{0:t} - {1:t}", start, end)#): #=title.replace(/"/g,"&\\#34;")#"><div class="k-event-template k-event-time">#:kendo.format("{0:t} - {1:t}", start, end)#</div><div class="k-event-template">${title}</div></div>'),S=r.template('<div title="(#=kendo.format("{0:t}", start)#): #=title.replace(/"/g,"&\\#34;")#"><div class="k-event-template">${title}</div></div>'),C=r.template("<span class='k-link k-nav-day'>#=kendo.toString(date, 'ddd M/dd')#</span>"),x='<div role="gridcell" aria-selected="false" data-#=ns#uid="#=uid#"#if (resources[0]) { #style="background-color:#=resources[0].color#; border-color: #=resources[0].color#"class="k-event#=inverseColor ? " k-event-inverse" : ""#" #} else {#class="k-event"#}#><span class="k-event-actions"># if(data.tail || data.middle) {#<span class="k-icon k-i-arrow-w"></span>#}## if(data.isException()) {#<span class="k-icon k-i-exception"></span># } else if(data.isRecurring()) {#<span class="k-icon k-i-refresh"></span># } #</span>{0}<span class="k-event-actions">#if (showDelete) {#<a href="\\#" class="k-link k-event-delete"><span class="k-icon k-si-close"></span></a>#}## if(data.head || data.middle) {#<span class="k-icon k-i-arrow-e"></span>#}#</span>#if(resizable && !singleDay && !data.tail && !data.middle){#<span class="k-resize-handle k-resize-w"></span>#}##if(resizable && !singleDay && !data.head && !data.middle){#<span class="k-resize-handle k-resize-e"></span>#}#</div>',H='<div role="gridcell" aria-selected="false" data-#=ns#uid="#=uid#" #if (resources[0]) { #style="background-color:#=resources[0].color #; border-color: #=resources[0].color#"class="k-event#=inverseColor ? " k-event-inverse" : ""#"#} else {#class="k-event"#}#><span class="k-event-actions"># if(data.isException()) {#<span class="k-icon k-i-exception"></span># } else if(data.isRecurring()) {#<span class="k-icon k-i-refresh"></span># } #</span>{0}<span class="k-event-actions">#if (showDelete) {#<a href="\\#" class="k-link k-event-delete"><span class="k-icon k-si-close"></span></a>#}#</span><span class="k-event-top-actions"># if(data.tail || data.middle) {#<span class="k-icon k-i-arrow-n"></span># } #</span><span class="k-event-bottom-actions"># if(data.head || data.middle) {#<span class="k-icon k-i-arrow-s"></span># } #</span># if(resizable && !data.tail && !data.middle) {#<span class="k-resize-handle k-resize-n"></span># } ## if(resizable && !data.head && !data.middle) {#<span class="k-resize-handle k-resize-s"></span># } #</div>',E=h.extend({init:function(e,t){var a=this;h.fn.init.call(a,e,t),a.title=a.options.title||a.options.name,a._workDays=o(a.options),a._templates(),a._editable(),a.calculateDateRange(),a._groups(),a._currentTime(!0)},_currentTimeMarkerUpdater:function(){this._updateCurrentTimeMarker(new Date)},_updateCurrentTimeMarker:function(t){var a,i,s,n,o,l,d,h,p,f,m,_,g,k,T,w=this.options;for(w.currentTimeMarker.useLocalTimezone===!1&&(a=w.dataSource.options.schema.timezone,w.dataSource&&a&&(i=r.timezone.offset(t,a),t=r.timezone.convert(t,t.getTimezoneOffset(),i))),this.times.find("."+v).remove(),this.content.find("."+v).remove(),s=w.group&&"horizontal"!=w.group.orientation?this.groups.length:1,n=this.times.find("tr:first th:first"),o=this.times.find("tr:first th:last"),l=0;l<s;l++){if(d=this.groups[l],!d)return;if(h=r.date.toUtcTime(t),p=d.timeSlotRanges(h,h+1),0===p.length)return;f=p[0].collection,m=f.slotByStartDate(t),m&&(_="<div class='"+v+"'></div>",g=e(_).prependTo(this.times),k=Math.round(p[0].innerRect(t,new Date(t.getTime()+1),!1).top),T={},this._isRtl?(T.right=n.position().left+c(n)-c(o),g.addClass(D+"-left")):(T.left=o.position().left,g.addClass(D+"-right")),T.top=k-u(g)*y/2,g.css(T),e(_).prependTo(this.content).css({top:k,height:"1px",right:"1px",width:this.content[0].scrollWidth,left:0}))}},_currentTime:function(e){var a=this,i=a.options.currentTimeMarker;i!==!1&&i.updateInterval!==t&&(a._currentTimeMarkerUpdater(),e&&(a._currentTimeUpdateTimer=setInterval(f(this._currentTimeMarkerUpdater,a),i.updateInterval)))},_updateResizeHint:function(e,t,a,i){var s,n,o,l,d,u,c,p,f,m,_,g,v=e.isMultiDay(),D=this.groups[t],y=D.ranges(a,i,v,e.isAllDay);for(this._removeResizeHint(),d=0;d<y.length;d++)if(u=y[d],c=u.startSlot(),this._isGroupedByDate()&&v)for(p=c.index;p<=u.end.index;p++)f=u.collection._slots[p],s=f.offsetWidth,n=f.clientHeight,o=f.offsetTop,l=h.fn._createResizeHint.call(this,f.offsetLeft,o,s,n),this._resizeHint=this._resizeHint.add(l);else s=c.offsetWidth,n=c.clientHeight,o=c.offsetTop,v?s=u.innerWidth():(m=u.outerRect(a,i,this.options.snap),o=m.top,n=m.bottom-m.top),l=h.fn._createResizeHint.call(this,c.offsetLeft,o,s,n),this._resizeHint=this._resizeHint.add(l);_="t",g=this.content,v&&(_="M/dd",g=this.element.find(".k-scheduler-header-wrap:has(.k-scheduler-header-all-day) > div"),g.length||(g=this.content)),this._resizeHint.appendTo(g),this._resizeHint.find(".k-label-top,.k-label-bottom").text(""),this._resizeHint.first().addClass("k-first").find(".k-label-top").text(r.toString(r.timezone.toLocalDate(a),_)),this._resizeHint.last().addClass("k-last").find(".k-label-bottom").text(r.toString(r.timezone.toLocalDate(i),_))},_updateMoveHint:function(e,t,a){var i,s,n,o,l,d,h,u,c,p=e.isMultiDay(),f=this.groups[t],m=r.date.toUtcTime(e.start)+a,_=m+e.duration(),g=f.ranges(m,_,p,e.isAllDay);for(m=r.timezone.toLocalDate(m),_=r.timezone.toLocalDate(_),this._removeMoveHint(),!p&&(0===k(_)||k(_)<k(this.startTime()))&&g.length>1&&g.pop(),i=0;i<g.length;i++)if(s=g[i],n=s.start,l={left:n.offsetLeft+2,top:n.offsetTop},this._isGroupedByDate()&&p)for(d=n.index;d<=s.end.index;d++)h=s.collection._slots[d],l.left=this._isRtl?.1*h.clientWidth+h.offsetLeft+2:h.offsetLeft+2,l.height=h.offsetHeight,l.width=.9*h.clientWidth-4,o=this._createEventElement(e.clone({start:m,end:_}),!p),this._appendMoveHint(o,l);else this._isRtl&&(l.left=.1*n.clientWidth+n.offsetLeft+2),p?l.width=s.innerWidth()-4:(u=s.outerRect(m,_,this.options.snap),l.top=u.top,l.height=u.bottom-u.top,l.width=.9*n.clientWidth-4),o=this._createEventElement(e.clone({start:m,end:_}),!p),this._appendMoveHint(o,l);c=this.content,p&&(c=this.element.find(".k-scheduler-header-wrap:has(.k-scheduler-header-all-day) > div"),c.length||(c=this.content)),this._moveHint.appendTo(c)},_appendMoveHint:function(e,t){e.addClass("k-event-drag-hint"),e.css(t),this._moveHint=this._moveHint.add(e)},_slotByPosition:function(e,t){var a,i,s,n;for(this._isVerticallyGrouped()?(i=this.content.offset(),t+=this.content[0].scrollTop,e+=this.content[0].scrollLeft):i=this.element.find(".k-scheduler-header-wrap:has(.k-scheduler-header-all-day)").find(">div").offset(),i&&(e-=i.left,t-=i.top),e=Math.ceil(e),t=Math.ceil(t),n=0;n<this.groups.length;n++)if(s=this.groups[n],a=s.daySlotByPosition(e,t,this._isGroupedByDate()))return a;for(i&&(e+=i.left,t+=i.top),i=this.content.offset(),e-=i.left,t-=i.top,this._isVerticallyGrouped()||(t+=this.content[0].scrollTop,e+=this.content[0].scrollLeft),e=Math.ceil(e),t=Math.ceil(t),n=0;n<this.groups.length;n++)if(s=this.groups[n],a=s.timeSlotByPosition(e,t))return a;return null},_groupCount:function(){var e=this.groupedResources,t=this._isGroupedByDate();return e.length?"vertical"===this._groupOrientation()?t?this._columnCountForLevel(e.length-1):this._rowCountForLevel(e.length-1):t?this._columnCountForLevel(e.length)/this._columnCountForLevel(0):this._columnCountForLevel(e.length)/this._columnOffsetForResource(e.length):1},_columnCountInResourceView:function(){var e=this.groupedResources,t=this._isGroupedByDate();return!e.length||this._isVerticallyGrouped()?t?this._rowCountForLevel(0):this._columnCountForLevel(0):t?this._columnCountForLevel(0):this._columnOffsetForResource(e.length)},_timeSlotGroups:function(e,t){var a,i,s,n,o,r,l,d,h,u,c=this._timeSlotInterval(),p=e,f=this._isGroupedByDate(),m=this.content.find("tr:not(.k-scheduler-header-all-day)");for(m.attr("role","row"),o=m.length,this._isVerticallyGrouped()&&(f&&(p=t),o=Math.floor(o/p)),r=0;r<p;r++)for(l=0,d=0,this._isVerticallyGrouped()?l=r:d=r,s=l*o;s<(l+1)*o;){if(h=m[s].children,s%o===0&&(i=k(new Date((+this.startTime())))),u=0,f)if(this._isVerticallyGrouped())for(n=0;n<e;n++)a=this.groups[n],this._addTimeSlotGroup(a,h,n,i,c,r);else for(a=this.groups[r],n=d;n<e*t;n+=e)this._addTimeSlotGroup(a,h,n,i,c,u),u++;else for(a=this.groups[r],n=d*t;n<(d+1)*t;n++)this._addTimeSlotGroup(a,h,n,i,c,u),u++;i+=c,s++}},_addTimeSlotGroup:function(e,t,a,i,s,n){var o=t[a],r=e.getTimeSlotCollection(n),l=this._dates[n],d=Date.UTC(l.getFullYear(),l.getMonth(),l.getDate()),h=d+i,u=h+s;o.setAttribute("role","gridcell"),o.setAttribute("aria-selected",!1),r.addTimeSlot(o,h,u)},_addDaySlotGroup:function(e,t,a,i,s){var n=t[a],o=this._dates[s],l=Date.UTC(o.getFullYear(),o.getMonth(),o.getDate());n.setAttribute("role","gridcell"),n.setAttribute("aria-selected",!1),e.addDaySlot(n,l,l+r.date.MS_PER_DAY)},_daySlotGroups:function(e,t){var a,i,s,n,o,r,l,d,h,u=e,c=this._isGroupedByDate();for(this._isVerticallyGrouped()?(c&&(u=t),a=this.element.find(".k-scheduler-header-all-day")):a=this.element.find(".k-scheduler-header-all-day tr"),a.attr("role","row"),s=0;s<u;s++)if(n=0,this._isVerticallyGrouped()&&(n=s),l=a[n].children,d=0,this._isVerticallyGrouped()||(d=s),h=0,c)if(this._isVerticallyGrouped())for(i=0;i<e;i++)o=this.groups[i],r=o.getDaySlotCollection(0),this._addDaySlotGroup(r,l,i,t,s);else for(o=this.groups[s],r=o.getDaySlotCollection(0),i=d;i<e*t;i+=e)this._addDaySlotGroup(r,l,i,t,h),h++;else for(o=this.groups[s],r=o.getDaySlotCollection(0),i=d*t;i<(d+1)*t;i++)this._addDaySlotGroup(r,l,i,t,h),h++},_groups:function(){var e,t,a,i=this._groupCount(),s=this._columnCountInResourceView();for(this.groups=[],e=0;e<i;e++){for(t=this._addResourceView(e),a=0;a<s;a++)t.addTimeSlotCollection(this._dates[a],r.date.addDays(this._dates[a],1));this.options.allDaySlot&&t.addDaySlotCollection(this._dates[0],r.date.addDays(this._dates[this._dates.length-1],1))}this._timeSlotGroups(i,s),this.options.allDaySlot&&this._daySlotGroups(i,s)},options:{name:"MultiDayView",selectedDateFormat:"{0:D}",selectedShortDateFormat:"{0:d}",allDaySlot:!0,showWorkHours:!1,title:"",startTime:r.date.today(),endTime:r.date.today(),minorTickCount:2,majorTick:60,majorTimeHeaderTemplate:"#=kendo.toString(date, 't')#",minorTimeHeaderTemplate:"&nbsp;",groupHeaderTemplate:"#=text#",slotTemplate:"&nbsp;",allDaySlotTemplate:"&nbsp;",eventTemplate:w,allDayEventTemplate:S,dateHeaderTemplate:C,editable:!0,workDayStart:new Date(1980,1,1,8,0,0),workDayEnd:new Date(1980,1,1,17,0,0),workWeekStart:1,workWeekEnd:5,footer:{command:"workDay"},messages:{allDay:"all day",showFullDay:"Show full day",showWorkDay:"Show business hours"},currentTimeMarker:{updateInterval:1e4,useLocalTimezone:!0}},events:["remove","add","edit"],_templates:function(){var e=this.options,t=p({},r.Template,e.templateSettings);this.eventTemplate=this._eventTmpl(e.eventTemplate,H),this.allDayEventTemplate=this._eventTmpl(e.allDayEventTemplate,x),this.majorTimeHeaderTemplate=r.template(e.majorTimeHeaderTemplate,t),this.minorTimeHeaderTemplate=r.template(e.minorTimeHeaderTemplate,t),this.dateHeaderTemplate=r.template(e.dateHeaderTemplate,t),this.slotTemplate=r.template(e.slotTemplate,t),this.allDaySlotTemplate=r.template(e.allDaySlotTemplate,t),this.groupHeaderTemplate=r.template(e.groupHeaderTemplate,t)},_editable:function(){this.options.editable&&(this._isMobile()?this._touchEditable():this._mouseEditable())},_mouseEditable:function(){var t=this;t.element.on("click"+T,".k-event a:has(.k-si-close)",function(a){t.trigger("remove",{uid:e(this).closest(".k-event").attr(r.attr("uid"))}),a.preventDefault()}),t.options.editable.create!==!1&&t.element.on("dblclick"+T,".k-scheduler-content td",function(a){var i,s;e(this).parent().hasClass("k-scheduler-header-all-day")||(i=t._slotByPosition(a.pageX,a.pageY),i&&(s=t._resourceBySlot(i),t.trigger("add",{eventInfo:p({start:i.startDate(),end:i.endDate()},s)})),a.preventDefault())}).on("dblclick"+T,".k-scheduler-header-all-day td",function(e){var a,i=t._slotByPosition(e.pageX,e.pageY);i&&(a=t._resourceBySlot(i),t.trigger("add",{eventInfo:p({},{isAllDay:!0,start:r.date.getDate(i.startDate()),end:r.date.getDate(i.startDate())},a)})),e.preventDefault()}),t.options.editable.update!==!1&&t.element.on("dblclick"+T,".k-event",function(a){t.trigger("edit",{uid:e(this).closest(".k-event").attr(r.attr("uid"))}),a.preventDefault()})},_touchEditable:function(){var a=this,i=0;r.support.mobileOS.android&&(i=5),a.options.editable.create!==!1&&(a._addUserEvents=new r.UserEvents(a.element,{threshold:i,filter:".k-scheduler-content td",tap:function(i){var s,n,o,r;e(i.target).parent().hasClass("k-scheduler-header-all-day")||(s=i.x.location!==t?i.x.location:i.x,n=i.y.location!==t?i.y.location:i.y,o=a._slotByPosition(s,n),o&&(r=a._resourceBySlot(o),a.trigger("add",{eventInfo:p({start:o.startDate(),end:o.endDate()},r)})),i.preventDefault())}}),a._allDayUserEvents=new r.UserEvents(a.element,{threshold:i,filter:".k-scheduler-header-all-day td",tap:function(e){var i,s=e.x.location!==t?e.x.location:e.x,n=e.y.location!==t?e.y.location:e.y,o=a._slotByPosition(s,n);o&&(i=a._resourceBySlot(o),a.trigger("add",{eventInfo:p({},{isAllDay:!0,start:r.date.getDate(o.startDate()),end:r.date.getDate(o.startDate())},i)})),e.preventDefault()}})),a.options.editable.update!==!1&&(a._editUserEvents=new r.UserEvents(a.element,{threshold:i,filter:".k-event",tap:function(t){var i=e(t.target).closest(".k-event");i.hasClass("k-event-active")||a.trigger("edit",{uid:i.attr(r.attr("uid"))}),t.preventDefault()}}))},_layout:function(e){var t,a,i,s=[],n=[],o=this.options,l=this,d=l._isGroupedByDate();for(t=0;t<e.length;t++)a={},a.text=l.dateHeaderTemplate({date:e[t]}),r.date.isToday(e[t])&&(a.className="k-today"),s.push(a);return i=this.groupedResources,o.allDaySlot&&n.push({text:o.messages.allDay,allDay:!0,cellContent:function(t){var a=t;return t=i.length&&"vertical"!==l._groupOrientation()?t%e.length:t,l.allDaySlotTemplate({date:e[t],resources:function(){return l._resourceBySlot({groupIndex:a})}})}}),this._forTimeRange(this.startTime(),this.endTime(),function(e,t,a,i){var s=t?l.majorTimeHeaderTemplate:l.minorTimeHeaderTemplate,o={text:s({date:e}),className:i?"k-slot-cell":""};n.push(o)}),i.length&&("vertical"===this._groupOrientation()?d?(n=this._createDateLayout(s,n),s=this._createColumnsLayout(i,null,this.groupHeaderTemplate)):n=this._createRowsLayout(i,n,this.groupHeaderTemplate):s=d?this._createColumnsLayout(i,s,this.groupHeaderTemplate,s):this._createColumnsLayout(i,s,this.groupHeaderTemplate)),{columns:s,rows:n}},_footer:function(){var t,a,i,s=this.options;s.footer!==!1&&(t='<div class="k-header k-scheduler-footer">',a=s.footer.command,a&&"workDay"===a?(t+='<ul class="k-reset k-header">',t+='<li class="k-state-default k-scheduler-fullday"><a href="#" class="k-link"><span class="k-icon k-i-clock"></span>',t+=(s.showWorkHours?s.messages.showFullDay:s.messages.showWorkDay)+"</a></li>",t+="</ul>"):t+="&nbsp;",t+="</div>",this.footer=e(t).appendTo(this.element),i=this,this.footer.on("click"+T,".k-scheduler-fullday",function(e){e.preventDefault(),i.trigger("navigate",{view:i.name||s.name,date:i.startDate(),isWorkDay:!s.showWorkHours})}))},_forTimeRange:function(e,t,i,s){var n,o,r,l,h,u,c,p,f,m,v,D,y,T,w,S;for(e=a(e),t=a(t),n=this,o=k(e),r=k(t),l=n.options.minorTickCount,h=n.options.majorTick*_,u=h/l||1,c=new Date((+e)),p=c.getDate(),m=0,D="",v=g/u,o!=r&&(o>r&&(r+=g),v=(r-o)/u),v=Math.round(v);m<v;m++)y=m%(h/u),T=0===y,w=y<l-1,S=y===l-1,D+=i(c,T,w,S),d(c,u,!1);return r&&(f=k(c),p<c.getDate()&&(f+=g),f>r&&(c=new Date((+t)))),s&&(D+=s(c)),D},_content:function(e){var t,a,i,s=this,n=s.options,o=s.startTime(),r=this.endTime(),l=1,d=1,h=e.length,u="",c=this.groupedResources,p=this.allDaySlotTemplate,f=!1,m=s._isGroupedByDate(),_=0;for(c.length&&(f="vertical"===s._groupOrientation(),f?(d=this._rowCountForLevel(this.rowLevels.length-2),m&&(l=this._columnCountForLevel(this.columnLevels.length-1)),n.allDaySlot&&(t=function(t){var a,i='<tr class="k-scheduler-header-all-day">',n=m?0:t,o=function(){return s._resourceBySlot({groupIndex:n})};if(m)for(;n<l;n++)i+="<td>"+p({date:e[_],resources:o})+"</td>";else for(a=0;a<e.length;a++)i+="<td>"+p({date:e[a],resources:o})+"</td>";return i+"</tr>"})):l=m?this._columnCountForLevel(this.columnLevels.length-1)/this._columnCountForLevel(0):this._columnCountForLevel(this.columnLevels.length-2)),u+="<tbody>",a=function(t,a){var n,o,r,d="",u=0;if(d="<tr"+(a?' class="k-middle-row"':"")+">",m)for(n=0,o=h;n<o;n++){for(u=0;u<l;u++)r=n,f&&(r=_),d=s._addCellsToContent(d,e,t,r,u,i);if(f)break}else for(;u<l;u++)for(n=0,o=h;n<o;n++)d=s._addCellsToContent(d,e,t,n,u,i);return d+="</tr>"},i=0;i<d;i++)u+=t?t(i):"",u+=this._forTimeRange(o,r,a),f&&_++;u+="</tbody>",this.content.find("table").append(u)},_addCellsToContent:function(e,t,a,i,s,n){var o,l=this,d="",h=this.slotTemplate,u="vertical"===this._groupOrientation(),c=function(e){return function(){return l._resourceBySlot({groupIndex:e})}};return r.date.isToday(t[i])&&(d+="k-today"),(r.date.getMilliseconds(a)<r.date.getMilliseconds(this.options.workDayStart)||r.date.getMilliseconds(a)>=r.date.getMilliseconds(this.options.workDayEnd)||!this._isWorkDay(t[i]))&&(d+=" k-nonwork-hour"),e+="<td"+(""!==d?' class="'+d+'"':"")+">",o=r.date.getDate(t[i]),r.date.setTime(o,r.date.getMilliseconds(a)),e+=h({date:o,resources:c(u&&!l._isGroupedByDate()?n:s)}),e+="</td>"},_isWorkDay:function(e){var t,a=e.getDay(),i=this._workDays;for(t=0;t<i.length;t++)if(i[t]===a)return!0;return!1},_render:function(t){var a,i=this;t=t||[],this._dates=t,this._startDate=t[0],this._endDate=t[t.length-1||0],this.createLayout(this._layout(t)),this._content(t),this._footer(),this.refreshLayout(),a=this.element.find(".k-scheduler-header-all-day td"),a.length&&(this._allDayHeaderHeight=a.first()[0].clientHeight),i.element.on("click"+T,".k-nav-day",function(t){var a,s=e(t.currentTarget).closest("th"),n=s.offset(),o=0,r=c(s);i._isGroupedByDate()&&(i._isVerticallyGrouped()?(o=u(i.times),r=0):r=c(i.datesHeader)),a=i._slotByPosition(n.left+o,n.top+r),i.trigger("navigate",{view:"day",date:a.startDate()})})},startTime:function(){var e=this.options;return e.showWorkHours?e.workDayStart:e.startTime},endTime:function(){var e=this.options;return e.showWorkHours?e.workDayEnd:e.endTime},startDate:function(){return this._startDate},endDate:function(){return this._endDate},_end:function(e){var t=k(this.endTime())||g;return e&&(t=0),new Date(this._endDate.getTime()+t)},nextDate:function(){return r.date.nextDay(this.endDate())},previousDate:function(){return r.date.previousDay(this.startDate())},calculateDateRange:function(){this._render([this.options.date])},destroy:function(){var e=this;e._currentTimeUpdateTimer&&clearInterval(e._currentTimeUpdateTimer),e.datesHeader&&e.datesHeader.off(T),e.element&&e.element.off(T),e.footer&&e.footer.remove(),h.fn.destroy.call(this),this._isMobile()&&e.options.editable&&(e.options.editable.create!==!1&&(e._addUserEvents.destroy(),e._allDayUserEvents.destroy()),e.options.editable.update!==!1&&e._editUserEvents.destroy())},inRange:function(e){var t,a,i,s,n=h.fn.inRange.call(this,e);return e.isAllDay?n:(t=k(this.startTime()),a=k(this.endTime())||r.date.MS_PER_DAY,i=k(e.start),s=k(e.end)||r.date.MS_PER_DAY,n&&t<=i&&s<=a)},selectionByElement:function(e){var t=e.offset();return this._slotByPosition(t.left,t.top)},_timeSlotInterval:function(){var e=this.options;return e.majorTick/e.minorTickCount*_},_timeSlotIndex:function(e){var t=this.options,a=k(e),i=k(this.startTime()),s=t.majorTick/t.minorTickCount*_;return(a-i)/s},_slotIndex:function(e,t){return t?this._dateSlotIndex(e):this._timeSlotIndex(e)},_dateSlotIndex:function(e,t){var a,s,n,o,l=this._dates||[],d=1;for(a=0,s=l.length;a<s;a++)if(n=r.date.getDate(l[a]),o=new Date(r.date.getDate(l[a]).getTime()+g-(t?0:1)),i(e,n,o))return a*d;return-1},_positionAllDayEvent:function(t,a){var i,s,n,o,r,l,d,u=a.innerWidth(),c=a.start.index,p=a.end.index,f=h.collidingEvents(a.events(),c,p),m=this._headerColumnCount||0,_=2,g=c!==p?5:4,v=this._allDayHeaderHeight,D=a.startSlot();for(t.css({left:D.offsetLeft+_,width:u-g}),a.addEvent({slotIndex:c,start:c,end:p,element:t}),f.push({slotIndex:c,start:c,end:p,element:t}),i=h.createRows(f),i.length&&i.length>m&&(this._headerColumnCount=i.length),s=a.start.offsetTop,n=0,o=i.length;n<o;n++)for(r=i[n].events,l=0,d=r.length;l<d;l++)e(r[l].element).css({top:s+n*v})},_arrangeColumns:function(e,t,a,i){var s,n,o,r,l,d,u,c,p,f,m,_=i.start;for(e={element:e,slotIndex:_.index,start:t,end:t+a},n=_.clientWidth,o=.1*n,l=i.events(),d=h.collidingEvents(l,e.start,e.end),i.addEvent(e),d.push(e),s=h.createColumns(d),u=(n-o)/s.length,c=0,p=s.length;c<p;c++)for(r=s[c].events,f=0,m=r.length;f<m;f++)r[f].element[0].style.width=u-4+"px",r[f].element[0].style.left=(this._isRtl?o:0)+_.offsetLeft+c*u+2+"px"},_positionEvent:function(e,t,a){var i=e._startTime||e.start,s=e._endTime||e.end,n=a.innerRect(i,s,!1),o=n.bottom-n.top-2;o<0&&(o=0),t.css({top:n.top,height:o}),this._arrangeColumns(t,n.top,t[0].clientHeight,a)},_createEventElement:function(t,a,s,n){var o,l,d,h,u,c,f=a?this.eventTemplate:this.allDayEventTemplate,_=this.options,v=_.editable,D=this._isMobile(),y=v&&v.destroy!==!1&&!D,T=v&&v.resize!==!1,w=m(this.startDate()),S=m(this.endDate()),C=k(this.startTime()),x=k(this.endTime()),H=t._time("start"),E=t._time("end");return C>=x&&(x=k(new Date(this.endTime().getTime()+g-1))),a||t.isAllDay||(S=new Date(S.getTime()+g)),l=t.start,d=t.end,t.isAllDay&&(d=m(t.end)),!i(m(l),w,S)&&!i(d,w,S)||a&&H<C&&E>x?o=!0:m(l)<w||a&&H<C?n=!0:(d>S&&!a||a&&E>x)&&(s=!0),h=this.eventResources(t),t._startTime&&H!==r.date.getMilliseconds(t.start)&&(l=new Date(H),l=r.timezone.apply(l,"Etc/UTC")),t._endTime&&E!==r.date.getMilliseconds(t.end)&&(d=new Date(E),d=r.timezone.apply(d,"Etc/UTC")),u=p({},{ns:r.ns,resizable:T,showDelete:y,middle:o,head:s,tail:n,singleDay:1==this._dates.length,resources:h,inverseColor:!(!h||!h[0])&&this._shouldInverseResourceColor(h[0])},t,{start:l,end:d}),c=e(f(u)),this.angular("compile",function(){return{elements:c,data:[{dataItem:u}]}}),c},_isInTimeSlot:function(e){var t,a=this.startTime(),i=this.endTime(),n=e._startTime||e.start,o=e._endTime||e.end;return k(i)===k(r.date.getDate(i))&&(i=r.date.getDate(i),d(i,g-1)),e._date("end")>e._date("start")&&(o=+e._date("end")+(g-1)),o-=e._date("end"),n-=e._date("start"),i=k(i),a=k(a),a===n&&n===o||(t=n!==i,s(n,a,i,t)||s(o,a,i,t)||s(a,n,o)||s(i,n,o))},_isInDateSlot:function(e){var t=this.groups[0],a=t.firstSlot().start,s=t.lastSlot().end-1,n=r.date.toUtcTime(e.start),o=r.date.toUtcTime(e.end);return(i(n,a,s)||i(o,a,s)||i(a,n,o)||i(s,n,o))&&(!i(o,a,a)||i(o,n,n)||e.isAllDay)},_updateAllDayHeaderHeight:function(e){var t,a;if(this._height!==e&&(this._height=e,t=this.element.find(".k-scheduler-header-all-day td"),t.length))for(t.parent().add(this.element.find(".k-scheduler-times-all-day").parent()).height(e),a=0;a<this.groups.length;a++)this.groups[a].refresh()},_renderEvents:function(e,t){var a,i,s,o,r,l,d,h,u,c,p,f,m,_,v,D,y,k,T,w,S,C=this.datesHeader.find(".k-scheduler-header-wrap > div"),x=this._isGroupedByDate();for(i=0,s=e.length;i<s;i++)if(a=e[i],this._isInDateSlot(a))if(o=a.isAllDay||a.end.getTime()-a.start.getTime()>=g,r=o&&!this._isVerticallyGrouped()?C:this.content,o){if(this.options.allDaySlot&&(p=this.groups[t],p._continuousEvents||(p._continuousEvents=[]),d=p.slotRanges(a),d.length))if(h=d[0],D=h.start.index,y=h.end.index,x&&D!==y)for(u=h.start.start,c=h.end.end,k=new Date(u),T=new Date(u),w=h.start.index;w<=h.end.index;w++)l=this._createEventElement(a,!o,w!==y,w!==D),S=p.daySlotRanges(k,T,!0)[0],T.setDate(T.getDate()+1),k.setDate(k.getDate()+1),this._positionAllDayEvent(l,S),n(p,S,l,!0),l.appendTo(r);else l=this._createEventElement(a,!o),this._positionAllDayEvent(l,d[0]),n(p,d[0],l,!0),l.appendTo(r)}else if(this._isInTimeSlot(a))for(p=this.groups[t],p._continuousEvents||(p._continuousEvents=[]),d=p.slotRanges(a),f=d.length,m=0;m<f;m++)h=d[m],u=a.start,c=a.end,f>1&&(0===m?c=h.end.endDate():m==f-1?u=h.start.startDate():(u=h.start.startDate(),c=h.end.endDate())),_=a.clone({start:u,end:c,_startTime:a._startTime,_endTime:a.endTime}),this._isInTimeSlot(_)&&(v=h.head,l=this._createEventElement(a,!o,v,h.tail),l.appendTo(r),this._positionEvent(_,l,h),n(p,h,l,!1))},render:function(t){var a,s,n,o;for(this._headerColumnCount=0,this._groups(),this.element.find(".k-event").remove(),t=new r.data.Query(t).sort([{field:"start",dir:"asc"},{field:"end",dir:"desc"}]).toArray(),a=[],this._eventsByResource(t,this.groupedResources,a),s=e.map(this._dates,function(t){return Math.max.apply(null,e.map(a,function(a){return e.grep(a,function(e){return e.isMultiDay()&&i(t,m(e.start),m(e.end))}).length}))}),n=Math.max.apply(null,s),this._updateAllDayHeaderHeight((n+1)*this._allDayHeaderHeight),o=0;o<a.length;o++)this._renderEvents(a[o],o);this.refreshLayout(),this._currentTime(!1),this.trigger("activate")},_eventsByResource:function(e,t,a){var i,s,n,o,l=t[0];if(l)for(i=l.dataSource.view(),s=0;s<i.length;s++)n=this._resourceValue(l,i[s]),o=new r.data.Query(e).filter({field:l.field,operator:h.groupEqFilter(n)}).toArray(),t.length>1?this._eventsByResource(o,t.slice(1),a):a.push(o);else a.push(e)},_columnOffsetForResource:function(e){return this._columnCountForLevel(e)/this._columnCountForLevel(e-1)},_columnCountForLevel:function(e){var t=this.columnLevels[e];return t?t.length:0},_rowCountForLevel:function(e){var t=this.rowLevels[e];return t?t.length:0},clearSelection:function(){this.content.add(this.datesHeader).find(".k-state-selected").removeAttr("id").attr("aria-selected",!1).removeClass("k-state-selected")},_updateDirection:function(e,t,a,i,s){var n=e.isAllDay,o=t[0].start,r=t[t.length-1].end;a&&(s?n||o.index!==r.index||o.collectionIndex!==r.collectionIndex||(e.backward=i):(n&&o.index===r.index||!n&&o.collectionIndex===r.collectionIndex)&&(e.backward=i))},_changeViewPeriod:function(e,t,a){var i,s,n,o,r,l,h,u,c,p,f;if(!a)return i=t?this.previousDate():this.nextDate(),s=e.start,n=e.end,o=this._isGroupedByDate()&&this._isVerticallyGrouped(),r=this.groups[e.groupIndex],l=t?r._timeSlotCollections:r._getCollections(r.daySlotCollectionCount()),h=l[l.length-1]._slots,u=t||r.daySlotCollectionCount()?h.length-1:0,e.start=new Date(i),e.end=new Date(i),o?(p=new Date(h[u].startDate()),f=new Date(h[u].endDate()),c=k(f)?k(f):g,d(e.start,k(p)),d(e.end,c),r.daySlotCollectionCount()&&(e.isAllDay=!e.isAllDay)):(c=e.isAllDay||!k(n)?g:k(n),d(e.start,k(s)),d(e.end,c)),this._isVerticallyGrouped()||(e.groupIndex=t?this.groups.length-1:0),e.events=[],!0}});p(!0,l,{MultiDayView:E,DayView:E.extend({options:{name:"DayView",title:"Day"},name:"day"}),WeekView:E.extend({options:{name:"WeekView",title:"Week",selectedDateFormat:"{0:D} - {1:D}",selectedShortDateFormat:"{0:d} - {1:d}"},name:"week",calculateDateRange:function(){var e,t,a=this.options.date,i=r.date.dayOfWeek(a,this.calendarInfo().firstDay,-1),s=[];for(e=0,t=7;e<t;e++)s.push(i),i=r.date.nextDay(i);this._render(s)}}),WorkWeekView:E.extend({options:{name:"WorkWeekView",title:"Work Week",selectedDateFormat:"{0:D} - {1:D}",selectedShortDateFormat:"{0:d} - {1:d}"},name:"workWeek",nextDate:function(){var e=r.date.dayOfWeek(r.date.nextDay(this.startDate()),this.calendarInfo().firstDay,1);return r.date.addDays(e,this._workDays[0])},previousDate:function(){var e=r.date.dayOfWeek(this.startDate(),this.calendarInfo().firstDay,-1),t=this._workDays;return r.date.addDays(e,t[t.length-1]-7)},calculateDateRange:function(){for(var e=this.options.date,t=r.date.dayOfWeek,a=t(e,this.calendarInfo().firstDay,-1),i=t(a,this.options.workWeekStart,1),s=t(i,this.options.workWeekEnd,1),n=[];i<=s;)n.push(i),i=r.date.nextDay(i);this._render(n)}})})}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,a){(a||t)()});
//# sourceMappingURL=kendo.scheduler.dayview.min.js.map
