3
0
Fork 0
web_techsystech/web_view_calendar_column/static/lib/scheduler.min.js

9 lines
95 KiB
JavaScript

/*!
FullCalendar Scheduler v1.4.0
Docs & License: http://fullcalendar.io/scheduler/
(c) 2016 Adam Shaw
*/
!function(t){"function"==typeof define&&define.amd?define(["jquery","moment","fullcalendar"],t):"object"==typeof exports?module.exports=t(require("jquery"),require("moment"),require("fullcalendar")):t(jQuery,moment)}(function(t,e){var r,o,s,i,n,l,u,h,a,c,p,d,f,g,y,v,w,m,S,R,b,C,E,H,T,_,I,D,x,B,F,G,M,W,L,z,k,V,P,A,O,q,N,j,Y,U,X,$,K,Q,J,Z,tt,et,rt,ot,st,it,nt,lt,ut,ht,at,ct,pt,dt,ft,gt,yt,vt,wt,mt,St,Rt,bt,Ct,Et,Ht,Tt,_t,It,Dt,xt,Bt,Ft,Gt,Mt,Wt,Lt,zt,kt,Vt,Pt,At,Ot=function(t,e){function r(){this.constructor=t}for(var o in e)qt.call(e,o)&&(t[o]=e[o]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},qt={}.hasOwnProperty,Nt=[].indexOf||function(t){for(var e=0,r=this.length;e<r;e++)if(e in this&&this[e]===t)return e;return-1},jt=[].slice;return d=t.fullCalendar,d.schedulerVersion="1.4.0",6!==d.internalApiVersion?void d.warn("v"+d.schedulerVersion+" of FullCalendar Scheduler is incompatible with v"+d.version+" of the core.\nPlease see http://fullcalendar.io/support/ for more information."):(o=d.Calendar,i=d.Class,X=d.View,f=d.Grid,vt=d.intersectRanges,ot=d.debounce,St=d.isInt,ft=d.getScrollbarWidths,h=d.DragListener,yt=d.htmlEscape,J=d.computeIntervalUnit,Mt=d.proxy,K=d.capitaliseFirstLetter,$=d.applyAll,a=d.EmitterMixin,v=d.ListenerMixin,lt=d.durationHasTime,nt=d.divideRangeByDuration,it=d.divideDurationByDuration,Ct=d.multiplyDuration,Ft=d.parseFieldSpecs,Q=d.compareByFieldSpecs,ut=d.flexibleCompare,wt=d.intersectRects,l=d.CoordCache,ht=d.getContentRect,at=d.getOuterRect,ct=function(t){return t.find("> td").filter(function(t,e){return e.rowSpan<=1})},Lt=function(e,r,o){return e&&e.then&&"resolved"!==e.state()?"rejected"===e.state()?(o&&o(),t.Deferred().reject().promise()):e.then(r,o):r?t.when(r()):t.when()},c=function(e){function r(){r.__super__.constructor.apply(this,arguments),this.requestMovingEnd=ot(this.reportMovingEnd,500)}var o,s;return Ot(r,e),r.mixin(a),r.mixin(v),r.prototype.canvas=null,r.prototype.isScrolling=!1,r.prototype.isTouching=!1,r.prototype.isMoving=!1,r.prototype.isTouchScrollEnabled=!0,r.prototype.preventTouchScrollHandler=null,r.prototype.render=function(){return r.__super__.render.apply(this,arguments),this.canvas&&(this.canvas.render(),this.canvas.el.appendTo(this.scrollEl)),this.bindHandlers()},r.prototype.destroy=function(){return r.__super__.destroy.apply(this,arguments),this.unbindHandlers()},r.prototype.disableTouchScroll=function(){return this.isTouchScrollEnabled=!1,this.bindPreventTouchScroll()},r.prototype.enableTouchScroll=function(){if(this.isTouchScrollEnabled=!0,!this.isTouching)return this.unbindPreventTouchScroll()},r.prototype.bindPreventTouchScroll=function(){if(!this.preventTouchScrollHandler)return this.scrollEl.on("touchmove",this.preventTouchScrollHandler=d.preventDefault)},r.prototype.unbindPreventTouchScroll=function(){if(this.preventTouchScrollHandler)return this.scrollEl.off("touchmove",this.preventTouchScrollHandler),this.preventTouchScrollHandler=null},r.prototype.bindHandlers=function(){return this.listenTo(this.scrollEl,{scroll:this.reportScroll,touchstart:this.reportTouchStart,touchend:this.reportTouchEnd})},r.prototype.unbindHandlers=function(){return this.stopListeningTo(this.scrollEl)},r.prototype.reportScroll=function(){return this.isScrolling||this.reportScrollStart(),this.trigger("scroll"),this.isMoving=!0,this.requestMovingEnd()},r.prototype.reportScrollStart=function(){if(!this.isScrolling)return this.isScrolling=!0,this.trigger("scrollStart",this.isTouching)},r.prototype.requestMovingEnd=null,r.prototype.reportMovingEnd=function(){if(this.isMoving=!1,!this.isTouching)return this.reportScrollEnd()},r.prototype.reportScrollEnd=function(){if(this.isScrolling)return this.trigger("scrollEnd"),this.isScrolling=!1},r.prototype.reportTouchStart=function(){return this.isTouching=!0},r.prototype.reportTouchEnd=function(){if(this.isTouching&&(this.isTouching=!1,this.isTouchScrollEnabled&&this.unbindPreventTouchScroll(),!this.isMoving))return this.reportScrollEnd()},r.prototype.getScrollLeft=function(){var t,e,r;if(t=this.scrollEl.css("direction"),e=this.scrollEl[0],r=e.scrollLeft,"rtl"===t)switch(s){case"positive":r=r+e.clientWidth-e.scrollWidth;break;case"reverse":r=-r}return r},r.prototype.setScrollLeft=function(t){var e,r;if(e=this.scrollEl.css("direction"),r=this.scrollEl[0],"rtl"===e)switch(s){case"positive":t=t-r.clientWidth+r.scrollWidth;break;case"reverse":t=-t}return r.scrollLeft=t},r.prototype.getScrollFromLeft=function(){var t,e,r;if(t=this.scrollEl.css("direction"),e=this.scrollEl[0],r=e.scrollLeft,"rtl"===t)switch(s){case"negative":r=r-e.clientWidth+e.scrollWidth;break;case"reverse":r=-r-e.clientWidth+e.scrollWidth}return r},r.prototype.getNativeScrollLeft=function(){return this.scrollEl[0].scrollLeft},r.prototype.setNativeScrollLeft=function(t){return this.scrollEl[0].scrollLeft=t},s=null,o=function(){var e,r,o;return e=t('<div style=" position: absolute top: -1000px; width: 1px; height: 1px; overflow: scroll; direction: rtl; font-size: 14px; ">A</div>').appendTo("body"),r=e[0],o=r.scrollLeft>0?"positive":(r.scrollLeft=1,e.scrollLeft>0?"reverse":"negative"),e.remove(),o},t(function(){return s=o()}),r}(d.Scroller),n=function(e){function r(){r.__super__.constructor.apply(this,arguments),"clipped-scroll"===this.overflowX&&(this.overflowX="scroll",this.isHScrollbarsClipped=!0),"clipped-scroll"===this.overflowY&&(this.overflowY="scroll",this.isVScrollbarsClipped=!0)}return Ot(r,e),r.prototype.isHScrollbarsClipped=!1,r.prototype.isVScrollbarsClipped=!1,r.prototype.renderEl=function(){var e;return e=r.__super__.renderEl.apply(this,arguments),t('<div class="fc-scroller-clip" />').append(e)},r.prototype.updateSize=function(){var t,e,r;return e=this.scrollEl,r=ft(e),t={marginLeft:0,marginRight:0,marginTop:0,marginBottom:0},this.isHScrollbarsClipped&&(t.marginTop=-r.top,t.marginBottom=-r.bottom),this.isVScrollbarsClipped&&(t.marginLeft=-r.left,t.marginRight=-r.right),e.css(t),e.toggleClass("fc-no-scrollbars",(this.isHScrollbarsClipped||"hidden"===this.overflowX)&&(this.isVScrollbarsClipped||"hidden"===this.overflowY)&&!(r.top||r.bottom||r.left||r.right))},r.prototype.getScrollbarWidths=function(){var t;return t=ft(this.scrollEl),this.isHScrollbarsClipped&&(t.top=0,t.bottom=0),this.isVScrollbarsClipped&&(t.left=0,t.right=0),t},r}(c),O=function(){function e(){this.gutters={}}return e.prototype.el=null,e.prototype.contentEl=null,e.prototype.bgEl=null,e.prototype.gutters=null,e.prototype.width=null,e.prototype.minWidth=null,e.prototype.render=function(){return this.el=t('<div class="fc-scroller-canvas"> <div class="fc-content"></div> <div class="fc-bg"></div> </div>'),this.contentEl=this.el.find(".fc-content"),this.bgEl=this.el.find(".fc-bg")},e.prototype.setGutters=function(e){return e?t.extend(this.gutters,e):this.gutters={},this.updateSize()},e.prototype.setWidth=function(t){return this.width=t,this.updateSize()},e.prototype.setMinWidth=function(t){return this.minWidth=t,this.updateSize()},e.prototype.clearWidth=function(){return this.width=null,this.minWidth=null,this.updateSize()},e.prototype.updateSize=function(){var t;return t=this.gutters,this.el.toggleClass("fc-gutter-left",Boolean(t.left)).toggleClass("fc-gutter-right",Boolean(t.right)).toggleClass("fc-gutter-top",Boolean(t.top)).toggleClass("fc-gutter-bottom",Boolean(t.bottom)).css({paddingLeft:t.left||"",paddingRight:t.right||"",paddingTop:t.top||"",paddingBottom:t.bottom||"",width:null!=this.width?this.width+(t.left||0)+(t.right||0):"",minWidth:null!=this.minWidth?this.minWidth+(t.left||0)+(t.right||0):""}),this.bgEl.css({left:t.left||"",right:t.right||"",top:t.top||"",bottom:t.bottom||""})},e}(),A=function(){function t(t,e){var r,o,s,i;for(this.axis=t,this.scrollers=e,s=this.scrollers,r=0,o=s.length;r<o;r++)i=s[r],this.initScroller(i)}return t.prototype.axis=null,t.prototype.scrollers=null,t.prototype.masterScroller=null,t.prototype.initScroller=function(t){return t.scrollEl.on("wheel mousewheel DomMouseScroll MozMousePixelScroll",function(e){return function(){e.assignMasterScroller(t)}}(this)),t.on("scrollStart",function(e){return function(){if(!e.masterScroller)return e.assignMasterScroller(t)}}(this)).on("scroll",function(e){return function(){var r,o,s,i,n;if(t===e.masterScroller){for(i=e.scrollers,n=[],r=0,o=i.length;r<o;r++)if(s=i[r],s!==t)switch(e.axis){case"horizontal":n.push(s.setNativeScrollLeft(t.getNativeScrollLeft()));break;case"vertical":n.push(s.setScrollTop(t.getScrollTop()));break;default:n.push(void 0)}else n.push(void 0);return n}}}(this)).on("scrollEnd",function(e){return function(){if(t===e.masterScroller)return e.unassignMasterScroller()}}(this))},t.prototype.assignMasterScroller=function(t){var e,r,o,s;for(this.unassignMasterScroller(),this.masterScroller=t,s=this.scrollers,e=0,r=s.length;e<r;e++)o=s[e],o!==t&&o.disableTouchScroll()},t.prototype.unassignMasterScroller=function(){var t,e,r,o;if(this.masterScroller){for(o=this.scrollers,t=0,e=o.length;t<e;t++)r=o[t],r.enableTouchScroll();this.masterScroller=null}},t.prototype.update=function(){var t,e,r,o,s,i,n,l,u,h,a,c,p;for(t=function(){var t,e,r,o;for(r=this.scrollers,o=[],t=0,e=r.length;t<e;t++)c=r[t],o.push(c.getScrollbarWidths());return o}.call(this),l=u=h=n=0,r=0,s=t.length;r<s;r++)p=t[r],l=Math.max(l,p.left),u=Math.max(u,p.right),h=Math.max(h,p.top),n=Math.max(n,p.bottom);for(a=this.scrollers,e=o=0,i=a.length;o<i;e=++o)c=a[e],p=t[e],c.canvas.setGutters("horizontal"===this.axis?{left:l-p.left,right:u-p.right}:{top:h-p.top,bottom:n-p.bottom})},t}(),V=function(){function e(t,e){this.isTouch=e,this.scroller=t,this.sprites=[],this.isTouch&&(this.isForcedRelative=!0),t.on(this.isTouch?"scrollEnd":"scroll",function(t){return function(){return t.handleScroll()}}(this))}return e.prototype.scroller=null,e.prototype.scrollbarWidths=null,e.prototype.sprites=null,e.prototype.viewportRect=null,e.prototype.contentOffset=null,e.prototype.isHFollowing=!0,e.prototype.isVFollowing=!1,e.prototype.containOnNaturalLeft=!1,e.prototype.containOnNaturalRight=!1,e.prototype.minTravel=0,e.prototype.isTouch=!1,e.prototype.isForcedRelative=!1,e.prototype.setSprites=function(e){var r,o,s;if(this.clearSprites(),e instanceof t)return this.sprites=function(){var r,o,i;for(i=[],r=0,o=e.length;r<o;r++)s=e[r],i.push(new P(t(s),this));return i}.call(this);for(r=0,o=e.length;r<o;r++)s=e[r],s.follower=this;return this.sprites=e},e.prototype.clearSprites=function(){var t,e,r,o;for(r=this.sprites,t=0,e=r.length;t<e;t++)o=r[t],o.clear();return this.sprites=[]},e.prototype.handleScroll=function(){return this.updateViewport(),this.updatePositions()},e.prototype.cacheDimensions=function(){var t,e,r,o;for(this.updateViewport(),this.scrollbarWidths=this.scroller.getScrollbarWidths(),this.contentOffset=this.scroller.canvas.el.offset(),r=this.sprites,t=0,e=r.length;t<e;t++)o=r[t],o.cacheDimensions()},e.prototype.updateViewport=function(){var t,e,r;return e=this.scroller,t=e.getScrollFromLeft(),r=e.getScrollTop(),this.viewportRect={left:t,right:t+e.getClientWidth(),top:r,bottom:r+e.getClientHeight()}},e.prototype.forceRelative=function(){var t,e,r,o,s;if(!this.isForcedRelative){for(this.isForcedRelative=!0,r=this.sprites,o=[],t=0,e=r.length;t<e;t++)s=r[t],s.doAbsolute?o.push(s.assignPosition()):o.push(void 0);return o}},e.prototype.clearForce=function(){var t,e,r,o,s;if(this.isForcedRelative&&!this.isTouch){for(this.isForcedRelative=!1,r=this.sprites,o=[],t=0,e=r.length;t<e;t++)s=r[t],o.push(s.assignPosition());return o}},e.prototype.update=function(){return this.cacheDimensions(),this.updatePositions()},e.prototype.updatePositions=function(){var t,e,r,o;for(r=this.sprites,t=0,e=r.length;t<e;t++)o=r[t],o.updatePosition()},e.prototype.getContentRect=function(t){return ht(t,this.contentOffset)},e.prototype.getBoundingRect=function(t){return at(t,this.contentOffset)},e}(),P=function(){function t(t,e){this.el=t,this.follower=null!=e?e:null,this.isBlock="block"===this.el.css("display"),this.el.css("position","relative")}return t.prototype.follower=null,t.prototype.el=null,t.prototype.absoluteEl=null,t.prototype.naturalRect=null,t.prototype.parentRect=null,t.prototype.containerRect=null,t.prototype.isEnabled=!0,t.prototype.isHFollowing=!1,t.prototype.isVFollowing=!1,t.prototype.doAbsolute=!1,t.prototype.isAbsolute=!1,t.prototype.isCentered=!1,t.prototype.rect=null,t.prototype.isBlock=!1,t.prototype.naturalWidth=null,t.prototype.disable=function(){if(this.isEnabled)return this.isEnabled=!1,this.resetPosition(),this.unabsolutize()},t.prototype.enable=function(){if(!this.isEnabled)return this.isEnabled=!0,this.assignPosition()},t.prototype.clear=function(){return this.disable(),this.follower=null,this.absoluteEl=null},t.prototype.cacheDimensions=function(){var t,e,r,o,s,i,n,l;return o=!1,s=!1,r=!1,this.naturalWidth=this.el.width(),this.resetPosition(),e=this.follower,n=this.naturalRect=e.getBoundingRect(this.el),l=this.el.parent(),this.parentRect=e.getBoundingRect(l),t=this.containerRect=bt(e.getContentRect(l),n),i=e.minTravel,e.containOnNaturalLeft&&(t.left=n.left),e.containOnNaturalRight&&(t.right=n.right),e.isHFollowing&&dt(t)-dt(n)>=i&&(r="center"===this.el.css("text-align"),o=!0),e.isVFollowing&&pt(t)-pt(n)>=i&&(s=!0),this.isHFollowing=o,this.isVFollowing=s,this.isCentered=r},t.prototype.updatePosition=function(){return this.computePosition(),this.assignPosition()},t.prototype.resetPosition=function(){return this.el.css({top:"",left:""})},t.prototype.computePosition=function(){var t,e,r,o,s,i,n,l;return n=this.follower.viewportRect,r=this.parentRect,t=this.containerRect,l=wt(n,r),o=null,e=!1,l&&(o=et(this.naturalRect),i=wt(o,r),(this.isCentered&&!zt(n,r)||i&&!zt(n,i))&&(e=!0,this.isHFollowing&&(this.isCentered?(s=dt(o),o.left=(l.left+l.right)/2-s/2,o.right=o.left+s):gt(o,n)||(e=!1),gt(o,t)&&(e=!1)),this.isVFollowing&&(At(o,n)||(e=!1),At(o,t)&&(e=!1)),zt(n,o)||(e=!1))),this.rect=o,this.doAbsolute=e},t.prototype.assignPosition=function(){var t,e;if(this.isEnabled)return this.rect?this.doAbsolute&&!this.follower.isForcedRelative?(this.absolutize(),this.absoluteEl.css({top:this.rect.top-this.follower.viewportRect.top+this.follower.scrollbarWidths.top,left:this.rect.left-this.follower.viewportRect.left+this.follower.scrollbarWidths.left,width:this.isBlock?this.naturalWidth:""})):(e=this.rect.top-this.naturalRect.top,t=this.rect.left-this.naturalRect.left,this.unabsolutize(),this.el.toggleClass("fc-following",Boolean(e||t)).css({top:e,left:t})):this.unabsolutize()},t.prototype.absolutize=function(){if(!this.isAbsolute)return this.absoluteEl||(this.absoluteEl=this.buildAbsoluteEl()),this.absoluteEl.appendTo(this.follower.scroller.el),this.el.css("visibility","hidden"),this.isAbsolute=!0},t.prototype.unabsolutize=function(){if(this.isAbsolute)return this.absoluteEl.detach(),this.el.css("visibility",""),this.isAbsolute=!1},t.prototype.buildAbsoluteEl=function(){return this.el.clone().addClass("fc-following").css({position:"absolute","z-index":1e3,"font-weight":this.el.css("font-weight"),"font-size":this.el.css("font-size"),"font-family":this.el.css("font-family"),color:this.el.css("color"),"padding-top":this.el.css("padding-top"),"padding-bottom":this.el.css("padding-bottom"),"padding-left":this.el.css("padding-left"),"padding-right":this.el.css("padding-right"),"pointer-events":"none"})},t}(),et=function(t){return{left:t.left,right:t.right,top:t.top,bottom:t.bottom}},dt=function(t){return t.right-t.left},pt=function(t){return t.bottom-t.top},zt=function(t,e){return kt(t,e)&&Vt(t,e)},kt=function(t,e){return e.left>=t.left&&e.right<=t.right},Vt=function(t,e){return e.top>=t.top&&e.bottom<=t.bottom},gt=function(t,e){return t.left<e.left?(t.right=e.left+dt(t),t.left=e.left,!0):t.right>e.right&&(t.left=e.right-dt(t),t.right=e.right,!0)},At=function(t,e){return t.top<e.top?(t.bottom=e.top+pt(t),t.top=e.top,!0):t.bottom>e.bottom&&(t.top=e.bottom-pt(t),t.bottom=e.bottom,!0)},bt=function(t,e){return{left:Math.min(t.left,e.left),right:Math.max(t.right,e.right),top:Math.min(t.top,e.top),bottom:Math.max(t.bottom,e.bottom)}},s=function(e){function r(){return r.__super__.constructor.apply(this,arguments)}return Ot(r,e),r.prototype.resourceManager=null,r.prototype.initialize=function(){return this.resourceManager=new D(this)},r.prototype.instantiateView=function(t){var e,r;return e=this.getViewSpec(t),r=e["class"],this.options.resources&&e.options.resources!==!1&&(e.queryResourceClass?r=e.queryResourceClass(e)||r:e.resourceClass&&(r=e.resourceClass)),new r(this,t,e.options,e.duration)},r.prototype.getResources=function(){return Array.prototype.slice.call(this.resourceManager.topLevelResources)},r.prototype.addResource=function(t,e){var r;null==e&&(e=!1),r=this.resourceManager.addResource(t),e&&this.view.scrollToResource&&r.done(function(t){return function(e){return t.view.scrollToResource(e)}}(this))},r.prototype.removeResource=function(t){return this.resourceManager.removeResource(t)},r.prototype.refetchResources=function(){this.resourceManager.fetchResources()},r.prototype.rerenderResources=function(){this.resourceManager.resetResources()},r.prototype.isSpanAllowed=function(t,e){var o,s;return!("object"==typeof e&&(o=this.getEventResourceIds(e),o.length&&!(t.resourceId&&(s=t.resourceId,Nt.call(o,s)>=0))))&&r.__super__.isSpanAllowed.apply(this,arguments)},r.prototype.getPeerEvents=function(t,e){var o,s,i,n,l,u,h,a,c,p,d,f,g,y;for(f=r.__super__.getPeerEvents.apply(this,arguments),p=t.resourceId?[t.resourceId]:e?this.getEventResourceIds(e):[],o=[],i=0,u=f.length;i<u;i++){if(d=f[i],s=!1,y=this.getEventResourceIds(d),y.length&&p.length){for(n=0,h=y.length;n<h;n++)for(g=y[n],l=0,a=p.length;l<a;l++)if(c=p[l],c===g){s=!0;break}}else s=!0;s&&o.push(d)}return o},r.prototype.spanContainsSpan=function(t,e){return(!t.resourceId||t.resourceId===e.resourceId)&&r.__super__.spanContainsSpan.apply(this,arguments)},r.prototype.getCurrentBusinessHourEvents=function(t){var e,o,s,i,n,l,u,h,a,c,p,d;for(n=this.resourceManager.getFlatResources(),o=!1,l=0,a=n.length;l<a;l++)d=n[l],d.businessHours&&(o=!0);if(o){for(e=[],u=0,c=n.length;u<c;u++)for(d=n[u],i=this.computeBusinessHourEvents(t,d.businessHours||this.options.businessHours),h=0,p=i.length;h<p;h++)s=i[h],s.resourceId=d.id,e.push(s);return e}return r.__super__.getCurrentBusinessHourEvents.apply(this,arguments)},r.prototype.buildSelectSpan=function(t,e,o){var s;return s=r.__super__.buildSelectSpan.apply(this,arguments),o&&(s.resourceId=o),s},r.prototype.getResourceById=function(t){return this.resourceManager.getResourceById(t)},r.prototype.normalizeEvent=function(t){return r.__super__.normalizeEvent.apply(this,arguments),null==t.resourceId&&(t.resourceId=null),null!=t.resourceIds?t.resourceIds:t.resourceIds=null},r.prototype.getEventResourceId=function(t){return this.getEventResourceIds(t)[0]},r.prototype.getEventResourceIds=function(t){var e,r,o,s,i,n,l,u;if(u=String(null!=(i=null!=(n=t[this.getEventResourceField()])?n:t.resourceId)?i:""))return[u];if(t.resourceIds){for(s=[],l=t.resourceIds,e=0,r=l.length;e<r;e++)u=l[e],o=String(null!=u?u:""),o&&s.push(o);return s}return[]},r.prototype.setEventResourceId=function(t,e){return t[this.getEventResourceField()]=String(null!=e?e:"")},r.prototype.getEventResourceField=function(){return this.options.eventResourceField||"resourceId"},r.prototype.getResourceEvents=function(e){var r;return r="object"==typeof e?e:this.getResourceById(e),r?this.clientEvents(function(e){return function(o){return t.inArray(r.id,e.getEventResourceIds(o))!==-1}}(this)):[]},r.prototype.getEventResource=function(t){return this.getEventResources(t)[0]},r.prototype.getEventResources=function(t){var e,r,o,s,i,n,l;if(e="object"==typeof t?t:this.clientEvents(t)[0],l=[],e)for(s=this.getEventResourceIds(e),r=0,o=s.length;r<o;r++)n=s[r],i=this.getResourceById(n),i&&l.push(i);return l},r}(o),o.prototype=s.prototype,Ht=X.prototype.displayView,xt=X.prototype.renderSkeleton,Bt=X.prototype.unrenderSkeleton,Et=X.prototype.displayEvents,X.prototype.isResourcesBound=!1,X.prototype.settingResources=null,X.prototype.displayView=function(){return Ht.apply(this,arguments),Gt(this.calendar.options.schedulerLicenseKey,this.el),this.bindResources(),this.whenResources()},X.prototype.unrenderSkeleton=function(){return Bt.apply(this,arguments),this.unbindResources(!0)},X.prototype.displayEvents=function(t){return this.whenResources(function(e){return function(){return Et.call(e,t)}}(this))},X.prototype.bindResources=function(){var e;if(!this.isResourcesBound)return this.isResourcesBound=!0,this.settingResources=t.Deferred(),e=function(t){return function(e){return t.setResources(e),t.settingResources.resolve()}}(this),this.listenTo(this.calendar.resourceManager,{set:e,unset:this.unsetResources,reset:this.resetResources,add:this.addResource,remove:this.removeResource}),this.calendar.resourceManager.hasFetched()?e(this.calendar.resourceManager.topLevelResources):this.calendar.resourceManager.getResources()},X.prototype.unbindResources=function(t){if(this.isResourcesBound)return this.stopListeningTo(this.calendar.resourceManager),"resolved"===this.settingResources.state()&&this.unsetResources(t),this.settingResources=null,this.isResourcesBound=!1},X.prototype.whenResources=function(t){return Lt(this.settingResources,t)},X.prototype.setResources=function(t){},X.prototype.unsetResources=function(){},X.prototype.resetResources=function(t){return this.calendar.rerenderEvents()},X.prototype.addResource=function(t){return this.resetResources(this.calendar.resourceManager.topLevelResources)},X.prototype.removeResource=function(t){return this.resetResources(this.calendar.resourceManager.topLevelResources)},Tt=f.prototype.getSegCustomClasses,_t=f.prototype.getSegDefaultBackgroundColor,It=f.prototype.getSegDefaultBorderColor,Dt=f.prototype.getSegDefaultTextColor,f.prototype.getSegCustomClasses=function(t){var e,r,o,s,i;for(e=Tt.apply(this,arguments),s=this.getSegResources(t),r=0,o=s.length;r<o;r++)i=s[r],e=e.concat(i.eventClassName||[]);return e},f.prototype.getSegDefaultBackgroundColor=function(t){var e,r,o,s,i;for(s=this.getSegResources(t),r=0,o=s.length;r<o;r++)for(e=s[r];e;){if(i=e.eventBackgroundColor||e.eventColor)return i;e=e._parent}return _t.apply(this,arguments)},f.prototype.getSegDefaultBorderColor=function(t){var e,r,o,s,i;for(s=this.getSegResources(t),r=0,o=s.length;r<o;r++)for(e=s[r];e;){if(i=e.eventBorderColor||e.eventColor)return i;e=e._parent}return It.apply(this,arguments)},f.prototype.getSegDefaultTextColor=function(t){var e,r,o,s,i;for(s=this.getSegResources(t),r=0,o=s.length;r<o;r++)for(e=s[r];e;){if(i=e.eventTextColor)return i;e=e._parent}return Dt.apply(this,arguments)},f.prototype.getSegResources=function(t){return t.resource?[t.resource]:this.view.calendar.getEventResources(t.event)},D=function(e){function r(t){this.calendar=t,this.initializeCache()}return Ot(r,e),r.mixin(a),r.resourceGuid=1,r.ajaxDefaults={dataType:"json",cache:!1},r.prototype.calendar=null,r.prototype.topLevelResources=null,r.prototype.resourcesById=null,r.prototype.fetching=null,r.prototype.hasFetched=function(){return this.fetching&&"resolved"===this.fetching.state()},r.prototype.getResources=function(){var e;return this.fetching?t.Deferred().resolve(this.topLevelResources).promise():(e=t.Deferred(),Lt(this.fetchResources(),function(){return e.resolve(this.topLevelResources)},function(){return e.resolve([])}),e.promise())},r.prototype.fetchResources=function(){var e;return e=this.fetching,Lt(e,function(r){return function(){return r.fetching=t.Deferred(),r.fetchResourceInputs(function(t){return r.setResources(t,Boolean(e)),r.fetching.resolve(r.topLevelResources)}),r.fetching.promise()}}(this))},r.prototype.fetchResourceInputs=function(e){var o;switch(o=this.calendar.options.resources,"string"===t.type(o)&&(o={url:o}),t.type(o)){case"function":return this.calendar.pushLoading(),o(function(t){return function(r){return t.calendar.popLoading(),e(r)}}(this));case"object":return this.calendar.pushLoading(),t.ajax(t.extend({},r.ajaxDefaults,o)).done(function(t){return function(r){return t.calendar.popLoading(),e(r)}}(this));case"array":return e(o);default:return e([])}},r.prototype.resetResources=function(){return Lt(this.getResources(),function(t){return function(){return t.trigger("reset",t.topLevelResources)}}(this))},r.prototype.getResourceById=function(t){return this.resourcesById[t]},r.prototype.getFlatResources=function(){var t,e;e=[];for(t in this.resourcesById)e.push(this.resourcesById[t]);return e},r.prototype.initializeCache=function(){return this.topLevelResources=[],this.resourcesById={}},r.prototype.setResources=function(t,e){var r,o,s,i,n,l;for(this.initializeCache(),n=function(){var e,r,o;for(o=[],e=0,r=t.length;e<r;e++)i=t[e],o.push(this.buildResource(i));return o}.call(this),l=function(){var t,e,r;for(r=[],t=0,e=n.length;t<e;t++)s=n[t],this.addResourceToIndex(s)&&r.push(s);return r}.call(this),r=0,o=l.length;r<o;r++)s=l[r],this.addResourceToTree(s);return e?this.trigger("reset",this.topLevelResources):this.trigger("set",this.topLevelResources),this.calendar.trigger("resourcesSet",null,this.topLevelResources)},r.prototype.addResource=function(t){return Lt(this.fetching,function(e){return function(){var r;return r=e.buildResource(t),!!e.addResourceToIndex(r)&&(e.addResourceToTree(r),e.trigger("add",r),r)}}(this))},r.prototype.addResourceToIndex=function(t){var e,r,o,s;if(this.resourcesById[t.id])return!1;for(this.resourcesById[t.id]=t,s=t.children,r=0,o=s.length;r<o;r++)e=s[r],this.addResourceToIndex(e);return!0},r.prototype.addResourceToTree=function(t){var e,r,o,s;if(!t.parent){if(r=String(null!=(o=t.parentId)?o:"")){if(e=this.resourcesById[r],!e)return!1;t.parent=e,s=e.children}else s=this.topLevelResources;s.push(t)}return!0},r.prototype.removeResource=function(t){var e;return e="object"==typeof t?t.id:t,Lt(this.fetching,function(t){return function(){var r;return r=t.removeResourceFromIndex(e),r&&(t.removeResourceFromTree(r),t.trigger("remove",r)),r}}(this))},r.prototype.removeResourceFromIndex=function(t){var e,r,o,s,i;if(i=this.resourcesById[t]){for(delete this.resourcesById[t],s=i.children,r=0,o=s.length;r<o;r++)e=s[r],this.removeResourceFromIndex(e.id);return i}return!1},r.prototype.removeResourceFromTree=function(t,e){var r,o,s,i;for(null==e&&(e=this.topLevelResources),r=o=0,s=e.length;o<s;r=++o){if(i=e[r],i===t)return t.parent=null,e.splice(r,1),!0;if(this.removeResourceFromTree(t,i.children))return!0}return!1},r.prototype.buildResource=function(e){var o,s,i,n,l;return l=t.extend({},e),l.id=String(null!=(n=e.id)?n:"_fc"+r.resourceGuid++),i=e.eventClassName,l.eventClassName=function(){switch(t.type(i)){case"string":return i.split(/\s+/);case"array":return i;default:return[]}}(),l.children=function(){var t,r,i,n,u;for(n=null!=(i=e.children)?i:[],u=[],t=0,r=n.length;t<r;t++)s=n[t],o=this.buildResource(s),o.parent=l,u.push(o);return u}.call(this),l},r}(i),W={resourceTextFunc:null,unsetResources:function(){return this.clearEvents()},resetResources:function(t){var e;return e=this.queryScroll(),this.unsetResources(),this.setResources(t),this.setScroll(e),this.calendar.rerenderEvents()},isEventDraggable:function(t){return this.isEventResourceEditable(t)||X.prototype.isEventDraggable.call(this,t)},isEventResourceEditable:function(t){var e,r,o;return null!=(e=null!=(r=null!=(o=t.resourceEditable)?o:(t.source||{}).resourceEditable)?r:this.opt("eventResourceEditable"))?e:this.isEventGenerallyEditable(t)},getResourceText:function(t){return this.getResourceTextFunc()(t)},getResourceTextFunc:function(){var t;return this.resourceTextFunc?this.resourceTextFunc:(t=this.opt("resourceText"),"function"!=typeof t&&(t=function(t){return t.title||t.id}),this.resourceTextFunc=t)},triggerDayClick:function(t,e,r){var o;return o=this.calendar.resourceManager,this.trigger("dayClick",e,this.calendar.applyTimezone(t.start),r,this,o.getResourceById(t.resourceId))},triggerSelect:function(t,e){var r;return r=this.calendar.resourceManager,this.trigger("select",null,this.calendar.applyTimezone(t.start),this.calendar.applyTimezone(t.end),e,this,r.getResourceById(t.resourceId))},triggerExternalDrop:function(t,e,r,o,s){if(this.trigger("drop",r[0],e.start,o,s,e.resourceId),t)return this.trigger("eventReceive",null,t)},reportEventDrop:function(){var t,e,r,o;return e=arguments[0],t=arguments[1],r=3<=arguments.length?jt.call(arguments,2):[],t=this.normalizeDropLocation(t),t.resourceId&&e.resourceIds&&(t.resourceIds=null),(o=X.prototype.reportEventDrop).call.apply(o,[this,e,t].concat(jt.call(r)))},reportExternalDrop:function(){var t,e,r,o;return e=arguments[0],t=arguments[1],r=3<=arguments.length?jt.call(arguments,2):[],t=this.normalizeDropLocation(t),(o=X.prototype.reportExternalDrop).call.apply(o,[this,e,t].concat(jt.call(r)))},normalizeDropLocation:function(e){var r;return r=t.extend({},e),delete r.resourceId,this.calendar.setEventResourceId(r,e.resourceId),r}},I={allowCrossResource:!0,eventRangeToSpans:function(e,r){var o,s,i,n,l;if(n=this.view.calendar.getEventResourceIds(r),n.length){for(l=[],o=0,s=n.length;o<s;o++)i=n[o],l.push(t.extend({},e,{resourceId:i}));return l}return d.isBgEvent(r)?f.prototype.eventRangeToSpans.apply(this,arguments):[]},fabricateHelperEvent:function(t,e){var r;return r=f.prototype.fabricateHelperEvent.apply(this,arguments),this.view.calendar.setEventResourceId(r,t.resourceId),r},computeEventDrop:function(t,e,r){var o;return o=this.view.isEventStartEditable(r)?f.prototype.computeEventDrop.apply(this,arguments):d.pluckEventDateProps(r),o&&(this.view.isEventResourceEditable(r)?o.resourceId=e.resourceId:o.resourceId=t.resourceId),o},computeExternalDrop:function(t,e){var r;return r=f.prototype.computeExternalDrop.apply(this,arguments),r&&(r.resourceId=t.resourceId),r},computeEventResize:function(t,e,r,o){var s;if(this.allowCrossResource||e.resourceId===r.resourceId)return s=f.prototype.computeEventResize.apply(this,arguments),s&&(s.resourceId=e.resourceId),s},computeSelectionSpan:function(t,e){var r;if(this.allowCrossResource||t.resourceId===e.resourceId)return r=f.prototype.computeSelectionSpan.apply(this,arguments),r&&(r.resourceId=t.resourceId),r}},_={flattenedResources:null,resourceCnt:0,datesAboveResources:!1,allowCrossResource:!1,setResources:function(t){return this.flattenedResources=this.flattenResources(t),this.resourceCnt=this.flattenedResources.length,this.updateDayTableCols()},unsetResources:function(){return this.flattenedResources=null,this.resourceCnt=0,this.updateDayTableCols()},flattenResources:function(t){var e,r,o,s;return r=this.view.opt("resourceOrder"),r?(e=Ft(r),s=function(t,r){return Q(t,r,e)}):s=null,o=[],this.accumulateResources(t,s,o),o},accumulateResources:function(t,e,r){var o,s,i,n,l;for(e?(l=t.slice(0),l.sort(e)):l=t,n=[],o=0,s=l.length;o<s;o++)i=l[o],r.push(i),n.push(this.accumulateResources(i.children,e,r));return n},updateDayTableCols:function(){return this.datesAboveResources=this.view.opt("groupByDateAndResource"),d.DayTableMixin.updateDayTableCols.call(this)},computeColCnt:function(){return(this.resourceCnt||1)*this.daysPerRow},getColDayIndex:function(t){return this.isRTL&&(t=this.colCnt-1-t),this.datesAboveResources?Math.floor(t/(this.resourceCnt||1)):t%this.daysPerRow},getColResource:function(t){return this.flattenedResources[this.getColResourceIndex(t)]},getColResourceIndex:function(t){return this.isRTL&&(t=this.colCnt-1-t),this.datesAboveResources?t%(this.resourceCnt||1):Math.floor(t/this.daysPerRow)},indicesToCol:function(t,e){var r;return r=this.datesAboveResources?e*(this.resourceCnt||1)+t:t*this.daysPerRow+e,this.isRTL&&(r=this.colCnt-1-r),r},renderHeadTrHtml:function(){return this.resourceCnt?this.daysPerRow>1?this.datesAboveResources?this.renderHeadDateAndResourceHtml():this.renderHeadResourceAndDateHtml():this.renderHeadResourceHtml():d.DayTableMixin.renderHeadTrHtml.call(this)},renderHeadResourceHtml:function(){var t,e,r,o,s;for(s=[],r=this.flattenedResources,t=0,e=r.length;t<e;t++)o=r[t],
s.push(this.renderHeadResourceCellHtml(o));return this.wrapTr(s,"renderHeadIntroHtml")},renderHeadResourceAndDateHtml:function(){var t,e,r,o,s,i,n,l,u,h;for(h=[],e=[],n=this.flattenedResources,o=0,i=n.length;o<i;o++)for(u=n[o],h.push(this.renderHeadResourceCellHtml(u,null,this.daysPerRow)),r=s=0,l=this.daysPerRow;s<l;r=s+=1)t=this.dayDates[r].clone(),e.push(this.renderHeadResourceDateCellHtml(t,u));return this.wrapTr(h,"renderHeadIntroHtml")+this.wrapTr(e,"renderHeadIntroHtml")},renderHeadDateAndResourceHtml:function(){var t,e,r,o,s,i,n,l,u,h;for(e=[],h=[],r=o=0,n=this.daysPerRow;o<n;r=o+=1)for(t=this.dayDates[r].clone(),e.push(this.renderHeadDateCellHtml(t,this.resourceCnt)),l=this.flattenedResources,s=0,i=l.length;s<i;s++)u=l[s],h.push(this.renderHeadResourceCellHtml(u,t));return this.wrapTr(e,"renderHeadIntroHtml")+this.wrapTr(h,"renderHeadIntroHtml")},renderHeadResourceCellHtml:function(t,e,r){return'<th class="fc-resource-cell" data-resource-id="'+t.id+'"'+(e?' data-date="'+e.format("YYYY-MM-DD")+'"':"")+(r>1?' colspan="'+r+'"':"")+">"+yt(this.view.getResourceText(t))+"</th>"},renderHeadResourceDateCellHtml:function(t,e,r){return this.renderHeadDateCellHtml(t,r,'data-resource-id="'+e.id+'"')},processHeadResourceEls:function(e){return e.find(".fc-resource-cell").each(function(e){return function(r,o){var s;return s=e.datesAboveResources?e.getColResource(r):e.flattenedResources[e.isRTL?e.flattenedResources.length-1-r:r],e.view.trigger("resourceRender",s,s,t(o),t())}}(this))},renderBgCellsHtml:function(t){var e,r,o,s,i,n;if(this.resourceCnt){for(o=[],e=s=0,i=this.colCnt;s<i;e=s+=1)r=this.getCellDate(t,e),n=this.getColResource(e),o.push(this.renderResourceBgCellHtml(r,n));return o.join("")}return d.DayTableMixin.renderBgCellsHtml.call(this,t)},renderResourceBgCellHtml:function(t,e){return this.renderBgCellHtml(t,'data-resource-id="'+e.id+'"')},wrapTr:function(t,e){return this.isRTL?(t.reverse(),"<tr>"+t.join("")+this[e]()+"</tr>"):"<tr>"+this[e]()+t.join("")+"</tr>"},computePerResourceBusinessHourSegs:function(t){var e,r,o,s,i,n,l,u,h,a,c,p,d,f,g;if(this.flattenedResources){for(r=!1,p=this.flattenedResources,n=0,h=p.length;n<h;n++)f=p[n],f.businessHours&&(r=!0);if(r){for(e=[],d=this.flattenedResources,l=0,a=d.length;l<a;l++){for(f=d[l],o=f.businessHours||this.view.opt("businessHours"),i=this.view.calendar.computeBusinessHourEvents(t,o),u=0,c=i.length;u<c;u++)s=i[u],s.resourceId=f.id;g=this.eventsToSegs(i),e.push.apply(e,g)}return e}}return null}},T=function(e){function r(){return r.__super__.constructor.apply(this,arguments)}return Ot(r,e),r.mixin(I),r.mixin(_),r.prototype.getHitSpan=function(t){var e;return e=r.__super__.getHitSpan.apply(this,arguments),this.resourceCnt&&(e.resourceId=this.getColResource(t.col).id),e},r.prototype.spanToSegs=function(e){var r,o,s,i,n,l,u,h,a,c,p,d,f;if(a=this.resourceCnt,o=this.datesAboveResources?this.sliceRangeByDay(e):this.sliceRangeByRow(e),a){for(d=[],i=0,u=o.length;i<u;i++)for(f=o[i],c=n=0,h=a;n<h;c=n+=1)p=this.flattenedResources[c],e.resourceId&&e.resourceId!==p.id||(r=t.extend({},f),r.resource=p,this.isRTL?(r.leftCol=this.indicesToCol(c,f.lastRowDayIndex),r.rightCol=this.indicesToCol(c,f.firstRowDayIndex)):(r.leftCol=this.indicesToCol(c,f.firstRowDayIndex),r.rightCol=this.indicesToCol(c,f.lastRowDayIndex)),d.push(r));return d}for(s=0,l=o.length;s<l;s++)f=o[s],this.isRTL?(f.leftCol=f.lastRowDayIndex,f.rightCol=f.firstRowDayIndex):(f.leftCol=f.firstRowDayIndex,f.rightCol=f.lastRowDayIndex);return o},r.prototype.renderBusinessHours=function(){var t;return t=this.computePerResourceBusinessHourSegs(!0),t?this.renderFill("businessHours",t,"bgevent"):r.__super__.renderBusinessHours.apply(this,arguments)},r}(d.DayGrid),F=function(e){function r(){return r.__super__.constructor.apply(this,arguments)}return Ot(r,e),r.mixin(I),r.mixin(_),r.prototype.getHitSpan=function(t){var e;return e=r.__super__.getHitSpan.apply(this,arguments),this.resourceCnt&&(e.resourceId=this.getColResource(t.col).id),e},r.prototype.spanToSegs=function(e){var r,o,s,i,n,l,u,h,a,c,p,d,f;if(a=this.resourceCnt,o=this.sliceRangeByTimes(e),a){for(d=[],i=0,u=o.length;i<u;i++)for(f=o[i],c=n=0,h=a;n<h;c=n+=1)p=this.flattenedResources[c],e.resourceId&&e.resourceId!==p.id||(r=t.extend({},f),r.resource=p,r.col=this.indicesToCol(c,f.dayIndex),d.push(r));return d}for(s=0,l=o.length;s<l;s++)f=o[s],f.col=f.dayIndex;return o},r.prototype.renderBusinessHours=function(){var t;return t=this.computePerResourceBusinessHourSegs(!1),t?this.renderBusinessSegs(t):r.__super__.renderBusinessHours.apply(this,arguments)},r}(d.TimeGrid),j=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return Ot(e,t),e.prototype.timeGrid=null,e.prototype.isScrolled=!1,e.prototype.initialize=function(){return this.timeGrid=this.instantiateGrid(),this.intervalDuration=this.timeGrid.duration},e.prototype.instantiateGrid=function(){return new N(this)},e.prototype.setRange=function(t){return e.__super__.setRange.apply(this,arguments),this.timeGrid.setRange(t)},e.prototype.renderSkeleton=function(){return this.el.addClass("fc-timeline"),this.opt("eventOverlap")===!1&&this.el.addClass("fc-no-overlap"),this.el.html(this.renderSkeletonHtml()),this.renderTimeGridSkeleton()},e.prototype.renderSkeletonHtml=function(){return'<table> <thead class="fc-head"> <tr> <td class="fc-time-area '+this.widgetHeaderClass+'"></td> </tr> </thead> <tbody class="fc-body"> <tr> <td class="fc-time-area '+this.widgetContentClass+'"></td> </tr> </tbody> </table>'},e.prototype.renderTimeGridSkeleton=function(){return this.timeGrid.setElement(this.el.find("tbody .fc-time-area")),this.timeGrid.headEl=this.el.find("thead .fc-time-area"),this.timeGrid.renderSkeleton(),this.isScrolled=!1,this.timeGrid.bodyScroller.on("scroll",Mt(this,"handleBodyScroll"))},e.prototype.handleBodyScroll=function(t,e){if(t){if(!this.isScrolled)return this.isScrolled=!0,this.el.addClass("fc-scrolled")}else if(this.isScrolled)return this.isScrolled=!1,this.el.removeClass("fc-scrolled")},e.prototype.unrenderSkeleton=function(){return this.timeGrid.removeElement(),this.handleBodyScroll(0),e.__super__.unrenderSkeleton.apply(this,arguments)},e.prototype.renderDates=function(){return this.timeGrid.renderDates()},e.prototype.unrenderDates=function(){return this.timeGrid.unrenderDates()},e.prototype.renderBusinessHours=function(){return this.timeGrid.renderBusinessHours()},e.prototype.unrenderBusinessHours=function(){return this.timeGrid.unrenderBusinessHours()},e.prototype.getNowIndicatorUnit=function(){return this.timeGrid.getNowIndicatorUnit()},e.prototype.renderNowIndicator=function(t){return this.timeGrid.renderNowIndicator(t)},e.prototype.unrenderNowIndicator=function(){return this.timeGrid.unrenderNowIndicator()},e.prototype.prepareHits=function(){return this.timeGrid.prepareHits()},e.prototype.releaseHits=function(){return this.timeGrid.releaseHits()},e.prototype.queryHit=function(t,e){return this.timeGrid.queryHit(t,e)},e.prototype.getHitSpan=function(t){return this.timeGrid.getHitSpan(t)},e.prototype.getHitEl=function(t){return this.timeGrid.getHitEl(t)},e.prototype.updateWidth=function(){return this.timeGrid.updateWidth()},e.prototype.setHeight=function(t,e){var r;return r=e?"auto":t-this.timeGrid.headHeight()-this.queryMiscHeight(),this.timeGrid.bodyScroller.setHeight(r)},e.prototype.queryMiscHeight=function(){return this.el.outerHeight()-this.timeGrid.headScroller.el.outerHeight()-this.timeGrid.bodyScroller.el.outerHeight()},e.prototype.computeInitialScroll=function(t){return this.timeGrid.computeInitialScroll(t)},e.prototype.queryScroll=function(){return this.timeGrid.queryScroll()},e.prototype.setScroll=function(t){return this.timeGrid.setScroll(t)},e.prototype.renderEvents=function(t){return this.timeGrid.renderEvents(t),this.updateWidth()},e.prototype.unrenderEvents=function(){return this.timeGrid.unrenderEvents(),this.updateWidth()},e.prototype.renderDrag=function(t,e){return this.timeGrid.renderDrag(t,e)},e.prototype.unrenderDrag=function(){return this.timeGrid.unrenderDrag()},e.prototype.getEventSegs=function(){return this.timeGrid.getEventSegs()},e.prototype.renderSelection=function(t){return this.timeGrid.renderSelection(t)},e.prototype.unrenderSelection=function(){return this.timeGrid.unrenderSelection()},e}(X),rt=d.cssToStr,N=function(r){function o(){var t;o.__super__.constructor.apply(this,arguments),this.initScaleProps(),this.minTime=e.duration(this.opt("minTime")||"00:00"),this.maxTime=e.duration(this.opt("maxTime")||"24:00"),this.timeWindowMs=this.maxTime-this.minTime,this.snapDuration=(t=this.opt("snapDuration"))?e.duration(t):this.slotDuration,this.minResizeDuration=this.snapDuration,this.snapsPerSlot=it(this.slotDuration,this.snapDuration),this.slotWidth=this.opt("slotWidth")}return Ot(o,r),o.prototype.slotDates=null,o.prototype.slotCnt=null,o.prototype.snapCnt=null,o.prototype.snapsPerSlot=null,o.prototype.snapDiffToIndex=null,o.prototype.snapIndexToDiff=null,o.prototype.headEl=null,o.prototype.slatContainerEl=null,o.prototype.slatEls=null,o.prototype.containerCoordCache=null,o.prototype.slatCoordCache=null,o.prototype.slatInnerCoordCache=null,o.prototype.headScroller=null,o.prototype.bodyScroller=null,o.prototype.joiner=null,o.prototype.follower=null,o.prototype.eventTitleFollower=null,o.prototype.minTime=null,o.prototype.maxTime=null,o.prototype.timeWindowMs=null,o.prototype.slotDuration=null,o.prototype.snapDuration=null,o.prototype.duration=null,o.prototype.labelInterval=null,o.prototype.headerFormats=null,o.prototype.isTimeScale=null,o.prototype.largeUnit=null,o.prototype.emphasizeWeeks=!1,o.prototype.titleFollower=null,o.prototype.segContainerEl=null,o.prototype.segContainerHeight=null,o.prototype.bgSegContainerEl=null,o.prototype.helperEls=null,o.prototype.innerEl=null,o.prototype.opt=function(t){return this.view.opt(t)},o.prototype.isValidDate=function(t){var e;return!this.view.isHiddenDay(t)&&(!this.isTimeScale||(e=t.time()-this.minTime,e=(e%864e5+864e5)%864e5,e<this.timeWindowMs))},o.prototype.computeDisplayEventTime=function(){return!this.isTimeScale},o.prototype.computeDisplayEventEnd=function(){return!1},o.prototype.computeEventTimeFormat=function(){return this.opt("extraSmallTimeFormat")},o.prototype.normalizeGridDate=function(t){var e;return this.isTimeScale?(e=t.clone(),e.hasTime()||e.time(0)):(e=t.clone().stripTime(),this.largeUnit&&e.startOf(this.largeUnit)),e},o.prototype.normalizeGridRange=function(t){var e,r;return this.isTimeScale?r={start:this.normalizeGridDate(t.start),end:this.normalizeGridDate(t.end)}:(r=this.view.computeDayRange(t),this.largeUnit&&(r.start.startOf(this.largeUnit),e=r.end.clone().startOf(this.largeUnit),e.isSame(r.end)&&e.isAfter(r.start)||e.add(this.slotDuration),r.end=e)),r},o.prototype.rangeUpdated=function(){var t,e;for(this.start=this.normalizeGridDate(this.start),this.end=this.normalizeGridDate(this.end),this.isTimeScale&&(this.start.add(this.minTime),this.end.subtract(1,"day").add(this.maxTime)),e=[],t=this.start.clone();t<this.end;)this.isValidDate(t)&&e.push(t.clone()),t.add(this.slotDuration);return this.slotDates=e,this.updateGridDates()},o.prototype.updateGridDates=function(){var t,e,r,o,s;for(o=-1,e=0,r=[],s=[],t=this.start.clone();t<this.end;)this.isValidDate(t)?(o++,r.push(o),s.push(e)):r.push(o+.5),t.add(this.snapDuration),e++;return this.snapDiffToIndex=r,this.snapIndexToDiff=s,this.snapCnt=o+1,this.slotCnt=this.snapCnt/this.snapsPerSlot},o.prototype.spanToSegs=function(t){var e,r;return e=this.normalizeGridRange(t),this.computeDateSnapCoverage(t.start)<this.computeDateSnapCoverage(t.end)&&(r=vt(e,this))?(r.isStart&&!this.isValidDate(r.start)&&(r.isStart=!1),r.isEnd&&r.end&&!this.isValidDate(r.end.clone().subtract(1))&&(r.isEnd=!1),[r]):[]},o.prototype.prepareHits=function(){return this.buildCoords()},o.prototype.queryHit=function(t,e){var r,o,s,i,n,l,u,h,a,c,p,d;if(d=this.snapsPerSlot,i=this.slatCoordCache,r=this.containerCoordCache,r.isTopInBounds(e)&&(n=i.getHorizontalIndex(t),null!=n))return h=i.getWidth(n),this.isRTL?(u=i.getRightOffset(n),s=(u-t)/h,o=Math.floor(s*d),a=n*d+o,p=u-o/d*h,c=p-(o+1)/d*h):(l=i.getLeftOffset(n),s=(t-l)/h,o=Math.floor(s*d),a=n*d+o,c=l+o/d*h,p=l+(o+1)/d*h),{snap:a,component:this,left:c,right:p,top:r.getTopOffset(0),bottom:r.getBottomOffset(0)}},o.prototype.getHitSpan=function(t){return this.getSnapRange(t.snap)},o.prototype.getHitEl=function(t){return this.getSnapEl(t.snap)},o.prototype.getSnapRange=function(t){var e,r;return r=this.start.clone(),r.add(Ct(this.snapDuration,this.snapIndexToDiff[t])),e=r.clone().add(this.snapDuration),{start:r,end:e}},o.prototype.getSnapEl=function(t){return this.slatEls.eq(Math.floor(t/this.snapsPerSlot))},o.prototype.renderSkeleton=function(){return this.headScroller=new n({overflowX:"clipped-scroll",overflowY:"hidden"}),this.headScroller.canvas=new O,this.headScroller.render(),this.headEl.append(this.headScroller.el),this.bodyScroller=new n,this.bodyScroller.canvas=new O,this.bodyScroller.render(),this.el.append(this.bodyScroller.el),this.innerEl=this.bodyScroller.canvas.contentEl,this.slatContainerEl=t('<div class="fc-slats"/>').appendTo(this.bodyScroller.canvas.bgEl),this.segContainerEl=t('<div class="fc-event-container"/>').appendTo(this.bodyScroller.canvas.contentEl),this.bgSegContainerEl=this.bodyScroller.canvas.bgEl,this.containerCoordCache=new l({els:this.bodyScroller.canvas.el,isHorizontal:!0,isVertical:!0}),this.joiner=new A("horizontal",[this.headScroller,this.bodyScroller]),this.follower=new V(this.headScroller,this.view.calendar.isTouch),this.eventTitleFollower=new V(this.bodyScroller,this.view.calendar.isTouch),this.eventTitleFollower.minTravel=50,this.isRTL?this.eventTitleFollower.containOnNaturalRight=!0:this.eventTitleFollower.containOnNaturalLeft=!0,o.__super__.renderSkeleton.apply(this,arguments)},o.prototype.headColEls=null,o.prototype.slatColEls=null,o.prototype.renderDates=function(){var t,e,r,o,s;for(this.headScroller.canvas.contentEl.html(this.renderHeadHtml()),this.headColEls=this.headScroller.canvas.contentEl.find("col"),this.slatContainerEl.html(this.renderSlatHtml()),this.slatColEls=this.slatContainerEl.find("col"),this.slatEls=this.slatContainerEl.find("td"),this.slatCoordCache=new l({els:this.slatEls,isHorizontal:!0}),this.slatInnerCoordCache=new l({els:this.slatEls.find("> div"),isHorizontal:!0,offsetParent:this.bodyScroller.canvas.el}),s=this.slotDates,e=r=0,o=s.length;r<o;e=++r)t=s[e],this.view.trigger("dayRender",null,t,this.slatEls.eq(e));if(this.follower)return this.follower.setSprites(this.headEl.find("tr:not(:last-child) span"))},o.prototype.unrenderDates=function(){return this.follower&&this.follower.clearSprites(),this.headScroller.canvas.contentEl.empty(),this.slatContainerEl.empty(),this.headScroller.canvas.clearWidth(),this.bodyScroller.canvas.clearWidth()},o.prototype.renderHeadHtml=function(){var t,e,r,o,s,i,n,l,u,h,a,c,p,d,f,g,y,v,w,m,S,R,b,C,E,H,T,_,I,D,x,B,F,G,M,W,L;for(g=this.labelInterval,i=this.headerFormats,e=function(){var t,e,r;for(r=[],t=0,e=i.length;t<e;t++)s=i[t],r.push([]);return r}(),y=null,I=null,M=this.slotDates,G=[],p=0,v=M.length;p<v;p++){for(r=M[p],L=r.week(),c=this.emphasizeWeeks&&null!==I&&I!==L,x=d=0,w=i.length;d<w;x=++d)s=i[x],B=e[x],y=B[B.length-1],a=i.length>1&&x<i.length-1,T=null,a?(W=r.format(s),o=r.format(),y&&y.text===W?y.colspan+=1:T={text:W,dateData:o,colspan:1}):!y||St(nt(this.start,r,g))?(W=r.format(s),o=r.format(),T={text:W,dateData:o,colspan:1}):y.colspan+=1,T&&(T.weekStart=c,B.push(T));G.push({weekStart:c}),I=L}for(u=g>this.slotDuration,n="<table>",n+="<colgroup>",f=0,m=M.length;f<m;f++)r=M[f],n+="<col/>";for(n+="</colgroup>",n+="<tbody>",l=E=0,S=e.length;E<S;l=++E){for(B=e[l],h=l===e.length-1,n+="<tr"+(u&&h?' class="fc-chrono"':"")+">",H=0,R=B.length;H<R;H++)t=B[H],n+='<th class="'+this.view.widgetHeaderClass+" "+(t.weekStart?"fc-em-cell":"")+'" data-date="'+t.dateData+'"'+(t.colspan>1?' colspan="'+t.colspan+'"':"")+'><div class="fc-cell-content"><span class="fc-cell-text">'+yt(t.text)+"</span></div></th>";n+="</tr>"}for(n+="</tbody></table>",F="<table>",F+="<colgroup>",_=0,b=G.length;_<b;_++)t=G[_],F+="<col/>";for(F+="</colgroup>",F+="<tbody><tr>",l=D=0,C=G.length;D<C;l=++D)t=G[l],r=M[l],F+=this.slatCellHtml(r,t.weekStart);return F+="</tr></tbody></table>",this._slatHtml=F,n},o.prototype.renderSlatHtml=function(){return this._slatHtml},o.prototype.slatCellHtml=function(t,e){var r;return this.isTimeScale?(r=[],r.push(St(nt(this.start,t,this.labelInterval))?"fc-major":"fc-minor")):(r=this.getDayClasses(t),r.push("fc-day")),r.unshift(this.view.widgetContentClass),e&&r.push("fc-em-cell"),'<td class="'+r.join(" ")+'" data-date="'+t.format()+'"><div /></td>'},o.prototype.businessHourSegs=null,o.prototype.renderBusinessHours=function(){var t;if(!this.largeUnit)return t=this.businessHourSegs=this.buildBusinessHourSegs(!this.isTimeScale),this.renderFill("businessHours",t,"bgevent")},o.prototype.unrenderBusinessHours=function(){return this.unrenderFill("businessHours")},o.prototype.nowIndicatorEls=null,o.prototype.getNowIndicatorUnit=function(){if(this.isTimeScale)return J(this.slotDuration)},o.prototype.renderNowIndicator=function(e){var r,o,s;return s=[],e=this.normalizeGridDate(e),e>=this.start&&e<this.end&&(r=this.dateToCoord(e),o=this.isRTL?{right:-r}:{left:r},s.push(t("<div class='fc-now-indicator fc-now-indicator-arrow'></div>").css(o).appendTo(this.headScroller.canvas.el)[0]),s.push(t("<div class='fc-now-indicator fc-now-indicator-line'></div>").css(o).appendTo(this.bodyScroller.canvas.el)[0])),this.nowIndicatorEls=t(s)},o.prototype.unrenderNowIndicator=function(){if(this.nowIndicatorEls)return this.nowIndicatorEls.remove(),this.nowIndicatorEls=null},o.prototype.explicitSlotWidth=null,o.prototype.defaultSlotWidth=null,o.prototype.updateWidth=function(){var t,e,r,o,s;if(s=Math.round(this.slotWidth||(this.slotWidth=this.computeSlotWidth())),r=s*this.slotDates.length,e="",o=s,t=this.bodyScroller.getClientWidth(),t>r&&(e=t,r="",o=Math.floor(t/this.slotDates.length)),this.headScroller.canvas.setWidth(r),this.headScroller.canvas.setMinWidth(e),this.bodyScroller.canvas.setWidth(r),this.bodyScroller.canvas.setMinWidth(e),this.headColEls.slice(0,-1).add(this.slatColEls.slice(0,-1)).width(o),this.headScroller.updateSize(),this.bodyScroller.updateSize(),this.joiner.update(),this.buildCoords(),this.updateSegPositions(),this.view.updateNowIndicator(),this.follower&&this.follower.update(),this.eventTitleFollower)return this.eventTitleFollower.update()},o.prototype.computeSlotWidth=function(){var e,r,o,s,i,n;return o=0,r=this.headEl.find("tr:last-child th span"),r.each(function(e,r){var s;return s=t(r).outerWidth(),o=Math.max(o,s)}),e=o+1,n=it(this.labelInterval,this.slotDuration),i=Math.ceil(e/n),s=this.headColEls.eq(0).css("min-width"),s&&(s=parseInt(s,10),s&&(i=Math.max(i,s))),i},o.prototype.buildCoords=function(){return this.containerCoordCache.build(),this.slatCoordCache.build(),this.slatInnerCoordCache.build()},o.prototype.computeDateSnapCoverage=function(t){var e,r,o;return r=nt(this.start,t,this.snapDuration),r<0?0:r>=this.snapDiffToIndex.length?this.snapCnt:(o=Math.floor(r),e=this.snapDiffToIndex[o],St(e)?e+=r-o:e=Math.ceil(e),e)},o.prototype.dateToCoord=function(t){var e,r,o,s,i;return i=this.computeDateSnapCoverage(t),o=i/this.snapsPerSlot,s=Math.floor(o),s=Math.min(s,this.slotCnt-1),r=o-s,e=this.slatInnerCoordCache,this.isRTL?e.getRightPosition(s)-e.getWidth(s)*r-this.containerCoordCache.getWidth(0):e.getLeftPosition(s)+e.getWidth(s)*r},o.prototype.rangeToCoords=function(t){return this.isRTL?{right:this.dateToCoord(t.start),left:this.dateToCoord(t.end)}:{left:this.dateToCoord(t.start),right:this.dateToCoord(t.end)}},o.prototype.headHeight=function(){var t;return t=this.headScroller.canvas.contentEl.find("table"),t.height.apply(t,arguments)},o.prototype.updateSegPositions=function(){var t,e,r,o,s;for(s=(this.segs||[]).concat(this.businessHourSegs||[]),e=0,r=s.length;e<r;e++)o=s[e],t=this.rangeToCoords(o),o.el.css({left:o.left=t.left,right:-(o.right=t.right)})},o.prototype.computeInitialScroll=function(t){var r,o;return r=0,this.isTimeScale&&(o=this.opt("scrollTime"),o&&(o=e.duration(o),r=this.dateToCoord(this.start.clone().time(o)))),{left:r,top:0}},o.prototype.queryScroll=function(){return{left:this.bodyScroller.getScrollLeft(),top:this.bodyScroller.getScrollTop()}},o.prototype.setScroll=function(t){return this.headScroller.setScrollLeft(t.left),this.headScroller.setScrollLeft(t.left),this.bodyScroller.setScrollTop(t.top)},o.prototype.renderFgSegs=function(t){return t=this.renderFgSegEls(t),this.renderFgSegsInContainers([[this,t]]),this.updateSegFollowers(t),t},o.prototype.unrenderFgSegs=function(){return this.clearSegFollowers(),this.unrenderFgContainers([this])},o.prototype.renderFgSegsInContainers=function(t){var e,r,o,s,i,n,l,u,h,a,c,p,d,f,g,y,v,w,m,S,R,b,C,E,H;for(o=0,n=t.length;o<n;o++)for(m=t[o],e=m[0],H=m[1],s=0,l=H.length;s<l;s++)E=H[s],r=this.rangeToCoords(E),E.el.css({left:E.left=r.left,right:-(E.right=r.right)});for(i=0,u=t.length;i<u;i++)for(S=t[i],e=S[0],H=S[1],f=0,h=H.length;f<h;f++)E=H[f],E.el.appendTo(e.segContainerEl);for(g=0,a=t.length;g<a;g++){for(R=t[g],e=R[0],H=R[1],y=0,c=H.length;y<c;y++)E=H[y],E.height=E.el.outerHeight(!0);this.buildSegLevels(H),e.segContainerHeight=tt(H)}for(C=[],v=0,p=t.length;v<p;v++){for(b=t[v],e=b[0],H=b[1],w=0,d=H.length;w<d;w++)E=H[w],E.el.css("top",E.top);C.push(e.segContainerEl.height(e.segContainerHeight))}return C},o.prototype.buildSegLevels=function(t){var e,r,o,s,i,n,l,u,h,a,c,p,d,f;for(d=[],this.sortEventSegs(t),o=0,n=t.length;o<n;o++){for(f=t[o],f.above=[],h=0;h<d.length;){for(r=!1,c=d[h],s=0,l=c.length;s<l;s++)a=c[s],Pt(f,a)&&(f.above.push(a),r=!0);if(!r)break;h+=1}for((d[h]||(d[h]=[])).push(f),h+=1;h<d.length;){for(p=d[h],i=0,u=p.length;i<u;i++)e=p[i],Pt(f,e)&&e.above.push(f);h+=1}}return d},o.prototype.unrenderFgContainers=function(t){var e,r,o,s;for(s=[],r=0,o=t.length;r<o;r++)e=t[r],e.segContainerEl.empty(),e.segContainerEl.height(""),s.push(e.segContainerHeight=null);return s},o.prototype.fgSegHtml=function(t,e){var r,o,s,i,n,l;return o=t.event,s=this.view.isEventDraggable(o),n=t.isStart&&this.view.isEventResizableFromStart(o),i=t.isEnd&&this.view.isEventResizableFromEnd(o),r=this.getSegClasses(t,s,n||i),r.unshift("fc-timeline-event","fc-h-event"),l=this.getEventTimeText(o),'<a class="'+r.join(" ")+'" style="'+rt(this.getSegSkinCss(t))+'"'+(o.url?' href="'+yt(o.url)+'"':"")+'><div class="fc-content">'+(l?'<span class="fc-time">'+yt(l)+"</span>":"")+'<span class="fc-title">'+(o.title?yt(o.title):"&nbsp;")+'</span></div><div class="fc-bg" />'+(n?'<div class="fc-resizer fc-start-resizer"></div>':"")+(i?'<div class="fc-resizer fc-end-resizer"></div>':"")+"</a>"},o.prototype.updateSegFollowers=function(t){var e,r,o,s,i;if(this.eventTitleFollower){for(s=[],e=0,r=t.length;e<r;e++)o=t[e],i=o.el.find(".fc-title"),i.length&&s.push(new P(i));return this.eventTitleFollower.setSprites(s)}},o.prototype.clearSegFollowers=function(){if(this.eventTitleFollower)return this.eventTitleFollower.clearSprites()},o.prototype.segDragStart=function(){if(o.__super__.segDragStart.apply(this,arguments),this.eventTitleFollower)return this.eventTitleFollower.forceRelative()},o.prototype.segDragEnd=function(){if(o.__super__.segDragEnd.apply(this,arguments),this.eventTitleFollower)return this.eventTitleFollower.clearForce()},o.prototype.segResizeStart=function(){if(o.__super__.segResizeStart.apply(this,arguments),this.eventTitleFollower)return this.eventTitleFollower.forceRelative()},o.prototype.segResizeEnd=function(){if(o.__super__.segResizeEnd.apply(this,arguments),this.eventTitleFollower)return this.eventTitleFollower.clearForce()},o.prototype.renderHelper=function(t,e){var r;return r=this.eventToSegs(t),r=this.renderFgSegEls(r),this.renderHelperSegsInContainers([[this,r]],e)},o.prototype.renderHelperSegsInContainers=function(e,r){var o,s,i,n,l,u,h,a,c,p,d,f,g,y,v,w,m,S;for(n=[],m=[],l=0,a=e.length;l<a;l++)for(g=e[l],o=g[0],S=g[1],u=0,c=S.length;u<c;u++)w=S[u],s=this.rangeToCoords(w),w.el.css({left:w.left=s.left,right:-(w.right=s.right)}),r&&r.resourceId===(null!=(y=o.resource)?y.id:void 0)?w.el.css("top",r.el.css("top")):w.el.css("top",0);for(h=0,p=e.length;h<p;h++)for(v=e[h],o=v[0],S=v[1],i=t('<div class="fc-event-container fc-helper-container"/>').appendTo(o.innerEl),n.push(i[0]),f=0,d=S.length;f<d;f++)w=S[f],i.append(w.el),m.push(w.el[0]);return this.helperEls?this.helperEls=this.helperEls.add(t(n)):this.helperEls=t(n),t(m)},o.prototype.unrenderHelper=function(){if(this.helperEls)return this.helperEls.remove(),this.helperEls=null},o.prototype.renderEventResize=function(t,e){return this.renderHighlight(this.eventToSpan(t)),this.renderEventLocationHelper(t,e)},o.prototype.unrenderEventResize=function(){return this.unrenderHighlight(),this.unrenderHelper()},o.prototype.renderFill=function(t,e,r){return e=this.renderFillSegEls(t,e),this.renderFillInContainers(t,[[this,e]],r),e},o.prototype.renderFillInContainers=function(t,e,r){var o,s,i,n,l,u;for(l=[],s=0,i=e.length;s<i;s++)n=e[s],o=n[0],u=n[1],l.push(this.renderFillInContainer(t,o,u,r));return l},o.prototype.renderFillInContainer=function(e,r,o,s){var i,n,l,u,h;if(o.length){for(s||(s=e.toLowerCase()),i=t('<div class="fc-'+s+'-container" />').appendTo(r.bgSegContainerEl),l=0,u=o.length;l<u;l++)h=o[l],n=this.rangeToCoords(h),h.el.css({left:h.left=n.left,right:-(h.right=n.right)}),h.el.appendTo(i);return this.elsByFill[e]?this.elsByFill[e]=this.elsByFill[e].add(i):this.elsByFill[e]=i}},o.prototype.renderDrag=function(t,e){return e?this.renderEventLocationHelper(t,e):(this.renderHighlight(this.eventToSpan(t)),null)},o.prototype.unrenderDrag=function(){return this.unrenderHelper(),this.unrenderHighlight()},o}(f),tt=function(t){var e,r,o,s;for(o=0,e=0,r=t.length;e<r;e++)s=t[e],o=Math.max(o,Z(s));return o},Z=function(t){return null==t.top&&(t.top=tt(t.above)),t.top+t.height},Pt=function(t,e){return t.left<e.right&&t.right>e.left},R=18,m=6,w=200,S=1e3,u={months:1},k=[{years:1},{months:1},{days:1},{hours:1},{minutes:30},{minutes:15},{minutes:10},{minutes:5},{minutes:1},{seconds:30},{seconds:15},{seconds:10},{seconds:5},{seconds:1},{milliseconds:500},{milliseconds:100},{milliseconds:10},{milliseconds:1}],N.prototype.initScaleProps=function(){var e,r,o;return this.labelInterval=this.queryDurationOption("slotLabelInterval"),this.slotDuration=this.queryDurationOption("slotDuration"),this.ensureGridDuration(),this.validateLabelAndSlot(),this.ensureLabelInterval(),this.ensureSlotDuration(),e=this.opt("slotLabelFormat"),o=t.type(e),this.headerFormats="array"===o?e:"string"===o?[e]:this.computeHeaderFormats(),this.isTimeScale=lt(this.slotDuration),this.largeUnit=this.isTimeScale?void 0:(r=J(this.slotDuration),/year|month|week/.test(r)?r:void 0),this.emphasizeWeeks=1===this.slotDuration.as("days")&&this.duration.as("weeks")>=2&&!this.opt("businessHours")},N.prototype.queryDurationOption=function(t){var r,o;if(o=this.opt(t),null!=o&&(r=e.duration(o),+r))return r},N.prototype.validateLabelAndSlot=function(){var t,e,r;if(this.labelInterval&&(t=it(this.duration,this.labelInterval),t>S&&(d.warn("slotLabelInterval results in too many cells"),this.labelInterval=null)),this.slotDuration&&(e=it(this.duration,this.slotDuration),e>S&&(d.warn("slotDuration results in too many cells"),this.slotDuration=null)),this.labelInterval&&this.slotDuration&&(r=it(this.labelInterval,this.slotDuration),!St(r)||r<1))return d.warn("slotLabelInterval must be a multiple of slotDuration"),this.slotDuration=null},N.prototype.ensureGridDuration=function(){var t,r,o,s,i;if(t=this.duration,!t){if(t=this.view.intervalDuration,!t)if(this.labelInterval||this.slotDuration)for(i=this.ensureLabelInterval(),o=k.length-1;o>=0&&(r=k[o],t=e.duration(r),s=it(t,i),!(s>=R));o+=-1);else t=e.duration(u);this.duration=t}return t},N.prototype.ensureLabelInterval=function(){var t,r,o,s,i,n,l,u,h;if(i=this.labelInterval,!i){if(this.duration||this.slotDuration||this.ensureGridDuration(),this.slotDuration){for(r=0,n=k.length;r<n;r++)if(t=k[r],h=e.duration(t),u=it(h,this.slotDuration),St(u)&&u<=m){i=h;break}i||(i=this.slotDuration)}else for(o=0,l=k.length;o<l&&(t=k[o],i=e.duration(t),s=it(this.duration,i),!(s>=R));o++);this.labelInterval=i}return i},N.prototype.ensureSlotDuration=function(){var t,r,o,s,i,n,l,u;if(n=this.slotDuration,!n){for(o=this.ensureLabelInterval(),r=0,s=k.length;r<s;r++)if(t=k[r],u=e.duration(t),l=it(o,u),St(l)&&l>1&&l<=m){n=u;break}n&&this.duration&&(i=it(this.duration,n),i>w&&(n=null)),n||(n=o),this.slotDuration=n}return n},N.prototype.computeHeaderFormats=function(){var t,e,r,o,s,i,n,l;switch(n=this.view,o=this.duration,s=this.labelInterval,i=J(s),l=this.opt("weekNumbers"),t=e=r=null,"week"!==i||l||(i="day"),i){case"year":t="YYYY";break;case"month":o.asYears()>1&&(t="YYYY"),e="MMM";break;case"week":o.asYears()>1&&(t="YYYY"),e=this.opt("shortWeekFormat");break;case"day":o.asYears()>1?t=this.opt("monthYearFormat"):o.asMonths()>1&&(t="MMMM"),l&&(e=this.opt("weekFormat")),r="dd D";break;case"hour":l&&(t=this.opt("weekFormat")),o.asDays()>1&&(e=this.opt("dayOfMonthFormat")),r=this.opt("smallTimeFormat");break;case"minute":s.asMinutes()/60>=m?(t=this.opt("hourFormat"),e="[:]mm"):t=this.opt("mediumTimeFormat");break;case"second":s.asSeconds()/60>=m?(t="LT",e="[:]ss"):t="LTS";break;case"millisecond":t="LTS",e="[.]SSS"}return[].concat(t||[],e||[],r||[])},d.views.timeline={"class":j,defaults:{eventResizableFromStart:!0}},d.views.timelineDay={type:"timeline",duration:{days:1}},d.views.timelineWeek={type:"timeline",duration:{weeks:1}},d.views.timelineMonth={type:"timeline",duration:{months:1}},d.views.timelineYear={type:"timeline",duration:{years:1}},M=function(e){function r(){return r.__super__.constructor.apply(this,arguments)}return Ot(r,e),r.mixin(W),r.prototype.resourceGrid=null,r.prototype.tbodyHash=null,r.prototype.joiner=null,r.prototype.dividerEls=null,r.prototype.superHeaderText=null,r.prototype.isVGrouping=null,r.prototype.isHGrouping=null,r.prototype.groupSpecs=null,r.prototype.colSpecs=null,r.prototype.orderSpecs=null,r.prototype.rowHierarchy=null,r.prototype.resourceRowHash=null,r.prototype.nestingCnt=0,r.prototype.isNesting=null,r.prototype.dividerWidth=null,r.prototype.initialize=function(){return r.__super__.initialize.apply(this,arguments),this.processResourceOptions(),this.resourceGrid=new q(this),this.rowHierarchy=new z(this),this.resourceRowHash={}},r.prototype.instantiateGrid=function(){return new G(this)},r.prototype.processResourceOptions=function(){var t,e,r,o,s,i,n,l,u,h,a,c,p,d,f,g,y,v,w,m,S,R;for(t=this.opt("resourceColumns")||[],f=this.opt("resourceLabelText"),o="Resources",R=null,t.length?R=f:t.push({labelText:f||o,text:this.getResourceTextFunc()}),m=[],s=[],n=[],a=!1,h=!1,c=0,g=t.length;c<g;c++)r=t[c],r.group?s.push(r):m.push(r);for(m[0].isMain=!0,s.length?(n=s,a=!0):(l=this.opt("resourceGroupField"),l&&(h=!0,n.push({field:l,text:this.opt("resourceGroupText"),render:this.opt("resourceGroupRender")}))),e=Ft(this.opt("resourceOrder")),S=[],p=0,y=e.length;p<y;p++){for(w=e[p],u=!1,d=0,v=n.length;d<v;d++)if(i=n[d],i.field===w.field){i.order=w.order,u=!0;break}u||S.push(w)}return this.superHeaderText=R,this.isVGrouping=a,this.isHGrouping=h,this.groupSpecs=n,this.colSpecs=s.concat(m),this.orderSpecs=S},r.prototype.renderSkeleton=function(){return r.__super__.renderSkeleton.apply(this,arguments),this.renderResourceGridSkeleton(),this.tbodyHash={spreadsheet:this.resourceGrid.tbodyEl,event:this.timeGrid.tbodyEl},this.joiner=new A("vertical",[this.resourceGrid.bodyScroller,this.timeGrid.bodyScroller]),this.initDividerMoving()},r.prototype.renderSkeletonHtml=function(){return'<table> <thead class="fc-head"> <tr> <td class="fc-resource-area '+this.widgetHeaderClass+'"></td> <td class="fc-divider fc-col-resizer '+this.widgetHeaderClass+'"></td> <td class="fc-time-area '+this.widgetHeaderClass+'"></td> </tr> </thead> <tbody class="fc-body"> <tr> <td class="fc-resource-area '+this.widgetContentClass+'"></td> <td class="fc-divider fc-col-resizer '+this.widgetHeaderClass+'"></td> <td class="fc-time-area '+this.widgetContentClass+'"></td> </tr> </tbody> </table>';
},r.prototype.renderResourceGridSkeleton=function(){return this.resourceGrid.el=this.el.find("tbody .fc-resource-area"),this.resourceGrid.headEl=this.el.find("thead .fc-resource-area"),this.resourceGrid.renderSkeleton()},r.prototype.initDividerMoving=function(){var t;return this.dividerEls=this.el.find(".fc-divider"),this.dividerWidth=null!=(t=this.opt("resourceAreaWidth"))?t:this.resourceGrid.tableWidth,null!=this.dividerWidth&&this.positionDivider(this.dividerWidth),this.dividerEls.on("mousedown",function(t){return function(e){return t.dividerMousedown(e)}}(this))},r.prototype.dividerMousedown=function(t){var e,r,o,s,i;return r=this.opt("isRTL"),s=30,o=this.el.width()-30,i=this.getNaturalDividerWidth(),e=new h({dragStart:function(t){return function(){return t.dividerEls.addClass("fc-active")}}(this),drag:function(t){return function(e,n){var l;return l=r?i-e:i+e,l=Math.max(l,s),l=Math.min(l,o),t.dividerWidth=l,t.positionDivider(l),t.updateWidth()}}(this),dragEnd:function(t){return function(){return t.dividerEls.removeClass("fc-active")}}(this)}),e.startInteraction(t)},r.prototype.getNaturalDividerWidth=function(){return this.el.find(".fc-resource-area").width()},r.prototype.positionDivider=function(t){return this.el.find(".fc-resource-area").width(t)},r.prototype.renderEvents=function(t){return this.timeGrid.renderEvents(t),this.syncRowHeights(),this.updateWidth()},r.prototype.unrenderEvents=function(){return this.timeGrid.unrenderEvents(),this.syncRowHeights(),this.updateWidth()},r.prototype.updateWidth=function(){if(r.__super__.updateWidth.apply(this,arguments),this.resourceGrid.updateWidth(),this.joiner.update(),this.cellFollower)return this.cellFollower.update()},r.prototype.updateHeight=function(t){if(r.__super__.updateHeight.apply(this,arguments),t)return this.syncRowHeights()},r.prototype.setHeight=function(t,e){var r,o;return o=this.syncHeadHeights(),r=e?"auto":t-o-this.queryMiscHeight(),this.timeGrid.bodyScroller.setHeight(r),this.resourceGrid.bodyScroller.setHeight(r)},r.prototype.queryMiscHeight=function(){return this.el.outerHeight()-Math.max(this.resourceGrid.headScroller.el.outerHeight(),this.timeGrid.headScroller.el.outerHeight())-Math.max(this.resourceGrid.bodyScroller.el.outerHeight(),this.timeGrid.bodyScroller.el.outerHeight())},r.prototype.syncHeadHeights=function(){var t;return this.resourceGrid.headHeight("auto"),this.timeGrid.headHeight("auto"),t=Math.max(this.resourceGrid.headHeight(),this.timeGrid.headHeight()),this.resourceGrid.headHeight(t),this.timeGrid.headHeight(t),t},r.prototype.scrollToResource=function(t){return this.timeGrid.scrollToResource(t)},r.prototype.setResources=function(t){var e,r,o;for(this.batchRows(),e=0,r=t.length;e<r;e++)o=t[e],this.insertResource(o);return this.rowHierarchy.show(),this.unbatchRows(),this.reinitializeCellFollowers()},r.prototype.unsetResources=function(){return this.clearEvents(),this.batchRows(),this.rowHierarchy.removeChildren(),this.unbatchRows(),this.reinitializeCellFollowers()},r.prototype.addResource=function(t){return this.insertResource(t),this.reinitializeCellFollowers()},r.prototype.removeResource=function(t){var e;if(e=this.getResourceRow(t.id))return this.batchRows(),e.remove(),this.unbatchRows(),this.reinitializeCellFollowers()},r.prototype.cellFollower=null,r.prototype.reinitializeCellFollowers=function(){var e,r,o,s,i,n;for(this.cellFollower&&this.cellFollower.clearSprites(),this.cellFollower=new V(this.resourceGrid.bodyScroller,this.calendar.isTouch),this.cellFollower.isHFollowing=!1,this.cellFollower.isVFollowing=!0,s=[],i=this.rowHierarchy.getNodes(),r=0,o=i.length;r<o;r++)n=i[r],n instanceof U&&n.groupTd&&(e=n.groupTd.find(".fc-cell-content"),e.length&&s.push(e[0]));return this.cellFollower.setSprites(t(s))},r.prototype.insertResource=function(t,e){var r,o,s,i,n,l,u;for(u=new B(this,t),null==e&&(i=t.parentId,i&&(e=this.getResourceRow(i))),e?this.insertRowAsChild(u,e):this.insertRow(u),n=t.children,l=[],o=0,s=n.length;o<s;o++)r=n[o],l.push(this.insertResource(r,u));return l},r.prototype.insertRow=function(t,e,r){var o;return null==e&&(e=this.rowHierarchy),null==r&&(r=this.groupSpecs),r.length?(o=this.ensureResourceGroup(t,e,r[0]),o instanceof g?this.insertRowAsChild(t,o):this.insertRow(t,o,r.slice(1))):this.insertRowAsChild(t,e)},r.prototype.insertRowAsChild=function(t,e){return e.addChild(t,this.computeChildRowPosition(t,e))},r.prototype.computeChildRowPosition=function(t,e){var r,o,s,i,n,l;if(this.orderSpecs.length)for(n=e.children,o=s=0,i=n.length;s<i;o=++s)if(l=n[o],r=this.compareResources(l.resource||{},t.resource||{}),r>0)return o;return null},r.prototype.compareResources=function(t,e){return Q(t,e,this.orderSpecs)},r.prototype.ensureResourceGroup=function(t,e,r){var o,s,i,n,l,u,h,a,c,p,d;if(i=(t.resource||{})[r.field],s=null,r.order)for(c=e.children,n=l=0,h=c.length;l<h;n=++l){if(d=c[n],o=ut(d.groupValue,i)*r.order,0===o){s=d;break}if(o>0)break}else for(p=e.children,n=u=0,a=p.length;u<a;n=++u)if(d=p[n],d.groupValue===i){s=d;break}return s||(s=this.isVGrouping?new U(this,r,i):new g(this,r,i),e.addChild(s,n)),s},r.prototype.pairSegsWithRows=function(t){var e,r,o,s,i,n,l,u;for(s=[],i={},e=0,r=t.length;e<r;e++)u=t[e],n=u.resourceId,n&&(l=this.getResourceRow(n),l&&(o=i[n],o||(o=[l,[]],s.push(o),i[n]=o),o[1].push(u)));return s},r.prototype.rowAdded=function(t){var e,r;return t instanceof B&&(this.resourceRowHash[t.resource.id]=t,this.timeGrid.assignRowBusinessHourSegs(t)),r=this.isNesting,e=Boolean(this.nestingCnt+=t.depth?1:0),r!==e&&(this.el.toggleClass("fc-nested",e),this.el.toggleClass("fc-flat",!e)),this.isNesting=e},r.prototype.rowRemoved=function(t){var e,r;return t instanceof B&&(delete this.resourceRowHash[t.resource.id],this.timeGrid.destroyRowBusinessHourSegs(t)),r=this.isNesting,e=Boolean(this.nestingCnt-=t.depth?1:0),r!==e&&(this.el.toggleClass("fc-nested",e),this.el.toggleClass("fc-flat",!e)),this.isNesting=e},r.prototype.batchRowDepth=0,r.prototype.shownRowBatch=null,r.prototype.hiddenRowBatch=null,r.prototype.batchRows=function(){if(!this.batchRowDepth++)return this.shownRowBatch=[],this.hiddenRowBatch=[]},r.prototype.unbatchRows=function(){if(!--this.batchRowDepth)return this.hiddenRowBatch.length&&this.rowsHidden(this.hiddenRowBatch),this.shownRowBatch.length&&this.rowsShown(this.shownRowBatch),this.hiddenRowBatch=null,this.shownRowBatch=null},r.prototype.rowShown=function(t){return this.shownRowBatch?this.shownRowBatch.push(t):this.rowsShown([t])},r.prototype.rowHidden=function(t){return this.hiddenRowBatch?this.hiddenRowBatch.push(t):this.rowsHidden([t])},r.prototype.rowsShown=function(t){return this.syncRowHeights(t),this.updateWidth()},r.prototype.rowsHidden=function(t){return this.updateWidth()},r.prototype.syncRowHeights=function(t,e){var r,o,s,i,n,l,u,h,a,c;for(null==e&&(e=!1),null==t&&(t=this.getVisibleRows()),l=0,h=t.length;l<h;l++)c=t[l],c.setTrInnerHeight("");for(n=function(){var o,s,i;for(i=[],o=0,s=t.length;o<s;o++)c=t[o],r=c.getMaxTrInnerHeight(),e&&(r+=r%2),i.push(r);return i}(),i=u=0,a=t.length;u<a;i=++u)c=t[i],c.setTrInnerHeight(n[i]);if(!e&&(o=this.resourceGrid.tbodyEl.height(),s=this.timeGrid.tbodyEl.height(),Math.abs(o-s)>1))return this.syncRowHeights(t,!0)},r.prototype.getVisibleRows=function(){var t,e,r,o,s;for(r=this.rowHierarchy.getRows(),o=[],t=0,e=r.length;t<e;t++)s=r[t],s.isShown&&o.push(s);return o},r.prototype.getEventRows=function(){var t,e,r,o,s;for(r=this.rowHierarchy.getRows(),o=[],t=0,e=r.length;t<e;t++)s=r[t],s instanceof p&&o.push(s);return o},r.prototype.getResourceRow=function(t){return this.resourceRowHash[t]},r.prototype.setScroll=function(t){return r.__super__.setScroll.apply(this,arguments),this.resourceGrid.bodyScroller.setScrollTop(t.top)},r}(j),G=function(e){function r(){return r.__super__.constructor.apply(this,arguments)}return Ot(r,e),r.mixin(I),r.prototype.eventRows=null,r.prototype.shownEventRows=null,r.prototype.tbodyEl=null,r.prototype.rowCoordCache=null,r.prototype.spanToSegs=function(t){var e,o,s,i,n,l;if(l=r.__super__.spanToSegs.apply(this,arguments),e=this.view.calendar,i=t.resourceId)for(o=0,s=l.length;o<s;o++)n=l[o],n.resource=e.getResourceById(i),n.resourceId=i;return l},r.prototype.prepareHits=function(){var t,e;return r.__super__.prepareHits.apply(this,arguments),this.eventRows=this.view.getEventRows(),this.shownEventRows=function(){var e,r,o,s;for(o=this.eventRows,s=[],e=0,r=o.length;e<r;e++)t=o[e],t.isShown&&s.push(t);return s}.call(this),e=function(){var e,r,o,s;for(o=this.shownEventRows,s=[],e=0,r=o.length;e<r;e++)t=o[e],s.push(t.getTr("event")[0]);return s}.call(this),this.rowCoordCache=new l({els:e,isVertical:!0}),this.rowCoordCache.build()},r.prototype.releaseHits=function(){return r.__super__.releaseHits.apply(this,arguments),this.eventRows=null,this.shownEventRows=null,this.rowCoordCache.clear()},r.prototype.queryHit=function(t,e){var o,s;if(s=r.__super__.queryHit.apply(this,arguments),s&&(o=this.rowCoordCache.getVerticalIndex(e),null!=o))return{resourceId:this.shownEventRows[o].resource.id,snap:s.snap,component:this,left:s.left,right:s.right,top:this.rowCoordCache.getTopOffset(o),bottom:this.rowCoordCache.getBottomOffset(o)}},r.prototype.getHitSpan=function(t){var e;return e=this.getSnapRange(t.snap),e.resourceId=t.resourceId,e},r.prototype.getHitEl=function(t){return this.getSnapEl(t.snap)},r.prototype.renderSkeleton=function(){var e;return r.__super__.renderSkeleton.apply(this,arguments),this.segContainerEl.remove(),this.segContainerEl=null,e=t('<div class="fc-rows"><table><tbody/></table></div>').appendTo(this.bodyScroller.canvas.contentEl),this.tbodyEl=e.find("tbody")},r.prototype.renderFgSegs=function(t){var e,r,o,s,i,n,l;for(t=this.renderFgSegEls(t),n=this.view.pairSegsWithRows(t),l=[],o=0,s=n.length;o<s;o++)i=n[o],e=i[0],r=i[1],e.fgSegs=r,e.isShown&&(e.isSegsRendered=!0,l.push(i));return this.renderFgSegsInContainers(l),this.updateSegFollowers(t),t},r.prototype.unrenderFgSegs=function(){var t,e,r,o;for(this.clearSegFollowers(),e=this.view.getEventRows(),r=0,o=e.length;r<o;r++)t=e[r],t.fgSegs=null,t.isSegsRendered=!1;return this.unrenderFgContainers(e)},r.prototype.rowCntWithCustomBusinessHours=0,r.prototype.renderBusinessHours=function(){return this.rowCntWithCustomBusinessHours?this.ensureIndividualBusinessHours():r.__super__.renderBusinessHours.apply(this,arguments)},r.prototype.unrenderBusinessHours=function(){return this.rowCntWithCustomBusinessHours?this.clearIndividualBusinessHours():r.__super__.unrenderBusinessHours.apply(this,arguments)},r.prototype.ensureIndividualBusinessHours=function(){var t,e,r,o,s;for(r=this.view.getEventRows(),o=[],t=0,e=r.length;t<e;t++)s=r[t],s.businessHourSegs||this.populateRowBusinessHoursSegs(s),s.isShown?o.push(s.ensureBusinessHourSegsRendered()):o.push(void 0);return o},r.prototype.clearIndividualBusinessHours=function(){var t,e,r,o,s;for(r=this.view.getEventRows(),o=[],t=0,e=r.length;t<e;t++)s=r[t],o.push(s.clearBusinessHourSegs());return o},r.prototype.assignRowBusinessHourSegs=function(t){if(t.resource.businessHours&&(this.rowCntWithCustomBusinessHours||(N.prototype.unrenderBusinessHours.call(this),this.ensureIndividualBusinessHours()),this.rowCntWithCustomBusinessHours+=1),this.rowCntWithCustomBusinessHours)return this.populateRowBusinessHoursSegs(t)},r.prototype.destroyRowBusinessHourSegs=function(t){if(t.clearBusinessHourSegs(),t.resource.businessHours&&(this.rowCntWithCustomBusinessHours-=1,!this.rowCntWithCustomBusinessHours))return this.clearIndividualBusinessHours(),N.prototype.renderBusinessHours.call(this)},r.prototype.populateRowBusinessHoursSegs=function(t){var e,r,o;r=t.resource.businessHours||this.view.opt("businessHours"),o=this.view.calendar.computeBusinessHourEvents(!this.isTimeScale,r),e=this.eventsToSegs(o),e=this.renderFillSegEls("businessHours",e),t.businessHourSegs=e},r.prototype.renderFill=function(t,e,r){var o,s,i,n,l,u,h,a,c,p,d,f;for(e=this.renderFillSegEls(t,e),a=[],l=[],o=0,i=e.length;o<i;o++)d=e[o],d.resourceId?a.push(d):l.push(d);for(h=this.view.pairSegsWithRows(a),f=[],s=0,n=h.length;s<n;s++)u=h[s],c=u[0],p=u[1],"bgEvent"===t&&(c.bgSegs=p),c.isShown&&f.push(u);return l.length&&f.unshift([this,l]),this.renderFillInContainers(t,f,r),e},r.prototype.renderHelper=function(t,e){var r,o;return o=this.eventToSegs(t),o=this.renderFgSegEls(o),r=this.view.pairSegsWithRows(o),this.renderHelperSegsInContainers(r,e)},r.prototype.computeInitialScroll=function(t){var e;return e=r.__super__.computeInitialScroll.apply(this,arguments),t&&(e.resourceId=t.resourceId,e.bottom=t.bottom),e},r.prototype.queryScroll=function(){var t,e,o,s,i,n,l,u;for(u=r.__super__.queryScroll.apply(this,arguments),l=this.bodyScroller.scrollEl.offset().top,i=this.view.getVisibleRows(),o=0,s=i.length;o<s;o++)if(n=i[o],n.resource&&(t=n.getTr("event"),e=t.offset().top+t.outerHeight(),e>l)){u.resourceId=n.resource.id,u.bottom=e-l;break}return u},r.prototype.setScroll=function(t){var e,o,s,i;return t.resourceId&&(i=this.view.getResourceRow(t.resourceId),i&&(e=i.getTr("event"),e&&(s=this.bodyScroller.canvas.el.offset().top,o=e.offset().top+e.outerHeight(),t.top=o-t.bottom-s))),r.__super__.setScroll.call(this,t)},r.prototype.scrollToResource=function(t){var e,r,o,s;if(o=this.view.getResourceRow(t.id),o&&(e=o.getTr("event")))return r=this.bodyScroller.canvas.el.offset().top,s=e.offset().top-r,this.bodyScroller.scrollEl.scrollTop(s)},r}(N),r=30,q=function(){function e(t){var e;this.view=t,this.isRTL=this.view.opt("isRTL"),this.givenColWidths=this.colWidths=function(){var t,r,o,s;for(o=this.view.colSpecs,s=[],t=0,r=o.length;t<r;t++)e=o[t],s.push(e.width);return s}.call(this)}return e.prototype.view=null,e.prototype.headEl=null,e.prototype.el=null,e.prototype.tbodyEl=null,e.prototype.headScroller=null,e.prototype.bodyScroller=null,e.prototype.joiner=null,e.prototype.colGroupHtml="",e.prototype.headTable=null,e.prototype.headColEls=null,e.prototype.headCellEls=null,e.prototype.bodyColEls=null,e.prototype.bodyTable=null,e.prototype.renderSkeleton=function(){return this.headScroller=new n({overflowX:"clipped-scroll",overflowY:"hidden"}),this.headScroller.canvas=new O,this.headScroller.render(),this.headScroller.canvas.contentEl.html(this.renderHeadHtml()),this.headEl.append(this.headScroller.el),this.bodyScroller=new n({overflowY:"clipped-scroll"}),this.bodyScroller.canvas=new O,this.bodyScroller.render(),this.bodyScroller.canvas.contentEl.html("<table>"+this.colGroupHtml+"<tbody/></table>"),this.tbodyEl=this.bodyScroller.canvas.contentEl.find("tbody"),this.el.append(this.bodyScroller.el),this.joiner=new A("horizontal",[this.headScroller,this.bodyScroller]),this.headTable=this.headEl.find("table"),this.headColEls=this.headEl.find("col"),this.headCellEls=this.headScroller.canvas.contentEl.find("tr:last-child th"),this.bodyColEls=this.el.find("col"),this.bodyTable=this.el.find("table"),this.colMinWidths=this.computeColMinWidths(),this.applyColWidths(),this.initColResizing()},e.prototype.renderHeadHtml=function(){var t,e,r,o,s,i,n,l,u,h,a;for(e=this.view.colSpecs,r="<table>",t="<colgroup>",n=0,u=e.length;n<u;n++)a=e[n],t+=a.isMain?'<col class="fc-main-col"/>':"<col/>";for(t+="</colgroup>",this.colGroupHtml=t,r+=t,r+="<tbody>",this.view.superHeaderText&&(r+='<tr class="fc-super"><th class="'+this.view.widgetHeaderClass+'" colspan="'+e.length+'"><div class="fc-cell-content"><span class="fc-cell-text">'+yt(this.view.superHeaderText)+"</span></div></th></tr>"),r+="<tr>",i=!0,o=l=0,h=e.length;l<h;o=++l)a=e[o],s=o===e.length-1,r+='<th class="'+this.view.widgetHeaderClass+'"><div><div class="fc-cell-content">'+(a.isMain?'<span class="fc-expander-space"><span class="fc-icon"></span></span>':"")+'<span class="fc-cell-text">'+yt(a.labelText||"")+"</span></div>"+(s?"":'<div class="fc-col-resizer"></div>')+"</div></th>";return r+="</tr>",r+="</tbody></table>"},e.prototype.givenColWidths=null,e.prototype.colWidths=null,e.prototype.colMinWidths=null,e.prototype.tableWidth=null,e.prototype.tableMinWidth=null,e.prototype.initColResizing=function(){return this.headEl.find("th .fc-col-resizer").each(function(e){return function(r,o){return o=t(o),o.on("mousedown",function(t){return e.colResizeMousedown(r,t,o)})}}(this))},e.prototype.colResizeMousedown=function(t,e,o){var s,i,n,l;return s=this.colWidths=this.queryColWidths(),s.pop(),s.push(null),l=s[t],n=Math.min(this.colMinWidths[t],r),i=new h({dragStart:function(t){return function(){return o.addClass("fc-active")}}(this),drag:function(e){return function(r,o){var i;return i=l+(e.isRTL?-r:r),i=Math.max(i,n),s[t]=i,e.applyColWidths()}}(this),dragEnd:function(t){return function(){return o.removeClass("fc-active")}}(this)}),i.startInteraction(e)},e.prototype.applyColWidths=function(){var t,e,r,o,s,i,n,l,u,h,a,c,p,d,f,g,y;for(r=this.colMinWidths,s=this.colWidths,t=!0,e=!1,y=0,h=0,p=s.length;h<p;h++)o=s[h],"number"==typeof o?y+=o:(t=!1,o&&(e=!0));for(l=e&&!this.view.isHGrouping?"auto":"",n=function(){var t,e,r;for(r=[],u=t=0,e=s.length;t<e;u=++t)o=s[u],r.push(null!=o?o:l);return r}(),g=0,u=a=0,d=n.length;a<d;u=++a)i=n[u],g+="number"==typeof i?i:r[u];for(u=c=0,f=n.length;c<f;u=++c)i=n[u],this.headColEls.eq(u).width(i),this.bodyColEls.eq(u).width(i);return this.headScroller.canvas.setMinWidth(g),this.bodyScroller.canvas.setMinWidth(g),this.tableMinWidth=g,this.tableWidth=t?y:void 0},e.prototype.computeColMinWidths=function(){var t,e,o,s,i,n;for(s=this.givenColWidths,i=[],t=e=0,o=s.length;e<o;t=++e)n=s[t],"number"==typeof n?i.push(n):i.push(parseInt(this.headColEls.eq(t).css("min-width"))||r);return i},e.prototype.queryColWidths=function(){var e,r,o,s,i;for(s=this.headCellEls,i=[],e=0,r=s.length;e<r;e++)o=s[e],i.push(t(o).outerWidth());return i},e.prototype.updateWidth=function(){if(this.headScroller.updateSize(),this.bodyScroller.updateSize(),this.joiner.update(),this.follower)return this.follower.update()},e.prototype.headHeight=function(){var t;return t=this.headScroller.canvas.contentEl.find("table"),t.height.apply(t,arguments)},e}(),z=function(){function e(e){this.view=e,this.children=[],this.trHash={},this.trs=t()}return e.prototype.view=null,e.prototype.parent=null,e.prototype.prevSibling=null,e.prototype.children=null,e.prototype.depth=0,e.prototype.hasOwnRow=!1,e.prototype.trHash=null,e.prototype.trs=null,e.prototype.isRendered=!1,e.prototype.isExpanded=!0,e.prototype.isShown=!1,e.prototype.addChild=function(t,e){var r,o,s,i,n;for(t.remove(),r=this.children,null!=e?r.splice(e,0,t):(e=r.length,r.push(t)),t.prevSibling=e>0?r[e-1]:null,e<r.length-1&&(r[e+1].prevSibling=t),t.parent=this,t.depth=this.depth+(this.hasOwnRow?1:0),n=t.getNodes(),o=0,s=n.length;o<s;o++)i=n[o],i.added();if(this.isShown&&this.isExpanded)return t.show()},e.prototype.removeChild=function(t){var e,r,o,s,i,n,l,u,h,a;for(e=this.children,o=!1,r=s=0,n=e.length;s<n;r=++s)if(a=e[r],a===t){o=!0;break}if(o){for(r<e.length-1&&(e[r+1].prevSibling=t.prevSibling),e.splice(r,1),t.recursivelyUnrender(),u=t.getNodes(),i=0,l=u.length;i<l;i++)h=u[i],h.removed();return t.parent=null,t.prevSibling=null,t}return!1},e.prototype.removeChildren=function(){var t,e,r,o,s,i,n;for(i=this.children,e=0,o=i.length;e<o;e++)t=i[e],t.recursivelyUnrender();for(n=this.getDescendants(),r=0,s=n.length;r<s;r++)t=n[r],t.removed();return this.children=[]},e.prototype.remove=function(){if(this.parent)return this.parent.removeChild(this)},e.prototype.getLastChild=function(){var t;return t=this.children,t[t.length-1]},e.prototype.getPrevRow=function(){var t,e;for(e=this;e;){if(e.prevSibling)for(e=e.prevSibling;t=e.getLastChild();)e=t;else e=e.parent;if(e&&e.hasOwnRow&&e.isShown)return e}return null},e.prototype.getLeadingRow=function(){return this.hasOwnRow?this:this.isExpanded&&this.children.length?this.children[0].getLeadingRow():void 0},e.prototype.getRows=function(t){var e,r,o,s;for(null==t&&(t=[]),this.hasOwnRow&&t.push(this),s=this.children,r=0,o=s.length;r<o;r++)e=s[r],e.getRows(t);return t},e.prototype.getNodes=function(t){var e,r,o,s;for(null==t&&(t=[]),t.push(this),s=this.children,r=0,o=s.length;r<o;r++)e=s[r],e.getNodes(t);return t},e.prototype.getDescendants=function(){var t,e,r,o,s;for(t=[],s=this.children,r=0,o=s.length;r<o;r++)e=s[r],e.getNodes(t);return t},e.prototype.render=function(){var e,r,o,s,i,n,l;if(this.trHash={},n=[],this.hasOwnRow){e=this.getPrevRow(),r=this.view.tbodyHash;for(l in r)s=r[l],i=t("<tr/>"),this.trHash[l]=i,n.push(i[0]),o="render"+K(l)+"Content",this[o]&&this[o](i),e?e.trHash[l].after(i):s.prepend(i)}return this.trs=t(n).on("click",".fc-expander",Mt(this,"toggleExpanded")),this.isRendered=!0},e.prototype.unrender=function(){var e,r,o,s;if(this.isRendered){e=this.trHash;for(o in e)r=e[o],s="unrender"+K(o)+"Content",this[s]&&this[s](r);return this.trHash={},this.trs.remove(),this.trs=t(),this.isRendered=!1,this.isShown=!1,this.hidden()}},e.prototype.recursivelyUnrender=function(){var t,e,r,o,s;for(this.unrender(),o=this.children,s=[],e=0,r=o.length;e<r;e++)t=o[e],s.push(t.recursivelyUnrender());return s},e.prototype.getTr=function(t){return this.trHash[t]},e.prototype.show=function(){var t,e,r,o,s;if(!this.isShown&&(this.isRendered?this.trs.css("display",""):this.render(),this.ensureSegsRendered&&this.ensureSegsRendered(),this.isExpanded?this.indicateExpanded():this.indicateCollapsed(),this.isShown=!0,this.shown(),this.isExpanded)){for(o=this.children,s=[],e=0,r=o.length;e<r;e++)t=o[e],s.push(t.show());return s}},e.prototype.hide=function(){var t,e,r,o,s;if(this.isShown&&(this.isRendered&&this.trs.hide(),this.isShown=!1,this.hidden(),this.isExpanded)){for(o=this.children,s=[],e=0,r=o.length;e<r;e++)t=o[e],s.push(t.hide());return s}},e.prototype.expand=function(){var t,e,r,o;if(!this.isExpanded){for(this.isExpanded=!0,this.indicateExpanded(),this.view.batchRows(),o=this.children,e=0,r=o.length;e<r;e++)t=o[e],t.show();return this.view.unbatchRows(),this.animateExpand()}},e.prototype.collapse=function(){var t,e,r,o;if(this.isExpanded){for(this.isExpanded=!1,this.indicateCollapsed(),this.view.batchRows(),o=this.children,e=0,r=o.length;e<r;e++)t=o[e],t.hide();return this.view.unbatchRows()}},e.prototype.toggleExpanded=function(){return this.isExpanded?this.collapse():this.expand()},e.prototype.indicateExpanded=function(){return this.trs.find(".fc-expander .fc-icon").removeClass(this.getCollapsedIcon()).addClass(this.getExpandedIcon())},e.prototype.indicateCollapsed=function(){return this.trs.find(".fc-expander .fc-icon").removeClass(this.getExpandedIcon()).addClass(this.getCollapsedIcon())},e.prototype.enableExpanding=function(){return this.trs.find(".fc-expander-space").addClass("fc-expander")},e.prototype.disableExpanding=function(){return this.trs.find(".fc-expander-space").removeClass("fc-expander").find(".fc-icon").removeClass(this.getExpandedIcon()).removeClass(this.getCollapsedIcon())},e.prototype.getExpandedIcon=function(){return"fc-icon-down-triangle"},e.prototype.getCollapsedIcon=function(){var t;return t=this.view.isRTL?"left":"right","fc-icon-"+t+"-triangle"},e.prototype.animateExpand=function(){var t,e,r;if(r=null!=(t=this.children[0])&&null!=(e=t.getLeadingRow())?e.trs:void 0)return r.addClass("fc-collapsed"),setTimeout(function(){return r.addClass("fc-transitioning"),r.removeClass("fc-collapsed")}),r.one("webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend",function(){return r.removeClass("fc-transitioning")})},e.prototype.getMaxTrInnerHeight=function(){var e;return e=0,t.each(this.trHash,function(t){return function(t,r){var o;return o=ct(r).find("> div:not(.fc-cell-content):first"),e=Math.max(o.height(),e)}}(this)),e},e.prototype.setTrInnerHeight=function(e){return t.each(this.trHash,function(t){return function(t,r){return ct(r).find("> div:not(.fc-cell-content):first").height(e)}}(this))},e.prototype.shown=function(){if(this.hasOwnRow)return this.rowShown(this)},e.prototype.hidden=function(){if(this.hasOwnRow)return this.rowHidden(this)},e.prototype.rowShown=function(t){return(this.parent||this.view).rowShown(t)},e.prototype.rowHidden=function(t){return(this.parent||this.view).rowHidden(t)},e.prototype.added=function(){if(this.hasOwnRow)return this.rowAdded(this)},e.prototype.removed=function(){if(this.hasOwnRow)return this.rowRemoved(this)},e.prototype.rowAdded=function(t){return(this.parent||this.view).rowAdded(t)},e.prototype.rowRemoved=function(t){return(this.parent||this.view).rowRemoved(t)},e}(),L=function(e){function r(t,e,o){this.groupSpec=e,this.groupValue=o,r.__super__.constructor.apply(this,arguments)}return Ot(r,e),r.prototype.groupSpec=null,r.prototype.groupValue=null,r.prototype.rowRemoved=function(t){if(r.__super__.rowRemoved.apply(this,arguments),t!==this&&!this.children.length)return this.remove()},r.prototype.renderGroupContentEl=function(){var e,r;return e=t('<div class="fc-cell-content" />').append(this.renderGroupTextEl()),r=this.groupSpec.render,"function"==typeof r&&(e=r(e,this.groupValue)||e),e},r.prototype.renderGroupTextEl=function(){var e,r;return r=this.groupValue||"",e=this.groupSpec.text,"function"==typeof e&&(r=e(r)||r),t('<span class="fc-cell-text" />').text(r)},r}(z),g=function(e){function r(){return r.__super__.constructor.apply(this,arguments)}return Ot(r,e),r.prototype.hasOwnRow=!0,r.prototype.renderSpreadsheetContent=function(e){var r;return r=this.renderGroupContentEl(),r.prepend('<span class="fc-expander"><span class="fc-icon"></span></span>'),t('<td class="fc-divider" />').attr("colspan",this.view.colSpecs.length).append(t("<div/>").append(r)).appendTo(e)},r.prototype.renderEventContent=function(t){return t.append('<td class="fc-divider"> <div/> </td>')},r}(L),U=function(e){function r(){return r.__super__.constructor.apply(this,arguments)}return Ot(r,e),r.prototype.rowspan=0,r.prototype.leadingTr=null,r.prototype.groupTd=null,r.prototype.rowShown=function(t){return this.rowspan+=1,this.renderRowspan(),r.__super__.rowShown.apply(this,arguments)},r.prototype.rowHidden=function(t){return this.rowspan-=1,this.renderRowspan(),r.__super__.rowHidden.apply(this,arguments)},r.prototype.renderRowspan=function(){var e;return this.rowspan?(this.groupTd||(this.groupTd=t('<td class="'+this.view.widgetContentClass+'"/>').append(this.renderGroupContentEl())),this.groupTd.attr("rowspan",this.rowspan),e=this.getLeadingRow().getTr("spreadsheet"),e!==this.leadingTr?(e&&e.prepend(this.groupTd),this.leadingTr=e):void 0):(this.groupTd&&(this.groupTd.remove(),this.groupTd=null),this.leadingTr=null)},r}(L),p=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return Ot(e,t),e.prototype.hasOwnRow=!0,e.prototype.segContainerEl=null,e.prototype.segContainerHeight=null,e.prototype.innerEl=null,e.prototype.bgSegContainerEl=null,e.prototype.isSegsRendered=!1,e.prototype.isBusinessHourSegsRendered=!1,e.prototype.businessHourSegs=null,e.prototype.bgSegs=null,e.prototype.fgSegs=null,e.prototype.renderEventContent=function(t){return t.html('<td class="'+this.view.widgetContentClass+'"> <div> <div class="fc-event-container" /> </div> </td>'),this.segContainerEl=t.find(".fc-event-container"),this.innerEl=this.bgSegContainerEl=t.find("td > div"),this.ensureSegsRendered()},e.prototype.ensureSegsRendered=function(){if(!this.isSegsRendered)return this.ensureBusinessHourSegsRendered(),this.bgSegs&&this.view.timeGrid.renderFillInContainer("bgEvent",this,this.bgSegs),this.fgSegs&&this.view.timeGrid.renderFgSegsInContainers([[this,this.fgSegs]]),this.isSegsRendered=!0},e.prototype.ensureBusinessHourSegsRendered=function(){if(this.businessHourSegs&&!this.isBusinessHourSegsRendered)return this.view.timeGrid.renderFillInContainer("businessHours",this,this.businessHourSegs,"bgevent"),this.isBusinessHourSegsRendered=!0},e.prototype.unrenderEventContent=function(){return this.clearBusinessHourSegs(),this.bgSegs=null,this.fgSegs=null,this.isSegsRendered=!1},e.prototype.clearBusinessHourSegs=function(){var t,e,r,o;if(this.businessHourSegs){for(r=this.businessHourSegs,t=0,e=r.length;t<e;t++)o=r[t],o.el&&o.el.remove();this.businessHourSegs=null}return this.isBusinessHourSegsRendered=!1},e}(z),B=function(e){function r(t,e){this.resource=e,r.__super__.constructor.apply(this,arguments)}return Ot(r,e),r.prototype.resource=null,r.prototype.rowAdded=function(t){if(r.__super__.rowAdded.apply(this,arguments),t!==this&&this.isRendered&&1===this.children.length)return this.enableExpanding(),this.isExpanded?this.indicateExpanded():this.indicateCollapsed()},r.prototype.rowRemoved=function(t){if(r.__super__.rowRemoved.apply(this,arguments),t!==this&&this.isRendered&&!this.children.length)return this.disableExpanding()},r.prototype.render=function(){return r.__super__.render.apply(this,arguments),this.children.length>0?this.enableExpanding():this.disableExpanding(),this.view.trigger("resourceRender",this.resource,this.resource,this.getTr("spreadsheet").find("> td"),this.getTr("event").find("> td"))},r.prototype.renderEventContent=function(t){return r.__super__.renderEventContent.apply(this,arguments),t.attr("data-resource-id",this.resource.id)},r.prototype.renderSpreadsheetContent=function(e){var r,o,s,i,n,l,u,h,a;for(u=this.resource,l=this.view.colSpecs,i=0,n=l.length;i<n;i++)r=l[i],r.group||(s=r.field?u[r.field]||null:u,a="function"==typeof r.text?r.text(u,s):s,o=t('<div class="fc-cell-content">'+(r.isMain?this.renderGutterHtml():"")+'<span class="fc-cell-text">'+(a?yt(a):"&nbsp;")+"</span></div>"),"function"==typeof r.render&&(o=r.render(u,o,s)||o),h=t('<td class="'+this.view.widgetContentClass+'"/>').append(o),r.isMain&&h.wrapInner("<div/>"),e.append(h));return e.attr("data-resource-id",u.id)},r.prototype.renderGutterHtml=function(){var t,e,r,o;for(t="",e=r=0,o=this.depth;r<o;e=r+=1)t+='<span class="fc-icon"/>';return t+='<span class="fc-expander-space"><span class="fc-icon"></span></span>'},r}(p),d.views.timeline.resourceClass=M,E=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return Ot(e,t),e.mixin(W),e.prototype.timeGridClass=F,e.prototype.dayGridClass=T,e.prototype.renderHead=function(){return e.__super__.renderHead.apply(this,arguments),this.timeGrid.processHeadResourceEls(this.headContainerEl)},e.prototype.setResources=function(t){return this.timeGrid.setResources(t),this.dayGrid&&this.dayGrid.setResources(t),this.clearView(),this.displayView()},e.prototype.unsetResources=function(t){if(this.clearEvents(),this.timeGrid.unsetResources(),this.dayGrid&&this.dayGrid.unsetResources(),!t)return this.clearView(),this.displayView()},e}(d.AgendaView),d.views.agenda.queryResourceClass=function(t){var e;if(null!=(e=t.options.groupByResource||t.options.groupByDateAndResource)?e:1===t.duration.as("days"))return E},H=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return Ot(e,t),e.mixin(W),e.prototype.dayGridClass=T,e.prototype.renderHead=function(){return e.__super__.renderHead.apply(this,arguments),this.dayGrid.processHeadResourceEls(this.headContainerEl)},e.prototype.setResources=function(t){return this.dayGrid.setResources(t),this.clearView(),this.displayView()},e.prototype.unsetResources=function(t){if(this.clearEvents(),this.dayGrid.unsetResources(),!t)return this.clearView(),this.displayView()},e}(d.BasicView),x=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return Ot(e,t),e.mixin(W),e.prototype.dayGridClass=T,e.prototype.renderHead=function(){return e.__super__.renderHead.apply(this,arguments),this.dayGrid.processHeadResourceEls(this.headContainerEl)},e.prototype.setResources=function(t){return this.dayGrid.setResources(t),this.clearView(),this.displayView()},e.prototype.unsetResources=function(){return this.clearEvents(),this.dayGrid.unsetResources(),this.clearView(),this.displayView()},e}(d.MonthView),d.views.basic.queryResourceClass=function(t){var e;if(null!=(e=t.options.groupByResource||t.options.groupByDateAndResource)?e:1===t.duration.as("days"))return H},d.views.month.queryResourceClass=function(t){if(t.options.groupByResource||t.options.groupByDateAndResource)return x;
},C="2016-09-04",Y={years:1,weeks:1},y="http://fullcalendar.io/scheduler/license/",b=["GPL-My-Project-Is-Open-Source","CC-Attribution-NonCommercial-NoDerivatives"],Gt=function(t,e){if(!mt(window.location.href)&&!Rt(t)&&!st(e))return Wt('Please use a valid license key. <a href="'+y+'">More Info</a>',e)},Rt=function(r){var o,s,i,n;return t.inArray(r,b)!==-1||(s=(r||"").match(/^(\d+)\-fcs\-(\d+)$/),!!(s&&10===s[1].length&&(i=e.utc(1e3*parseInt(s[2])),n=e.utc(d.mockSchedulerReleaseDate||C),n.isValid()&&(o=n.clone().subtract(Y),i.isAfter(o)))))},mt=function(t){return Boolean(t.match(/\w+\:\/\/fullcalendar\.io\/|\/demos\/[\w-]+\.html$/))},Wt=function(e,r){return r.append(t('<div class="fc-license-message" />').html(e))},void(st=function(t){return t.find(".fc-license-message").length>=1}))});