mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-18 05:52:15 +00:00
1 line
91 KiB
JavaScript
Executable File
1 line
91 KiB
JavaScript
Executable File
!function(t){"function"==typeof define&&define.amd?define(["jquery","moment"],t):"object"==typeof exports?module.exports=t(require("jquery"),require("moment")):t(jQuery,moment)}(function(z,G){var L=z.fullCalendar={version:"2.3.1"},d=L.views={};z.fn.fullCalendar=function(s){var o=Array.prototype.slice.call(arguments,1),l=this;return this.each(function(t,e){var n,i=z(e),r=i.data("fullCalendar");"string"==typeof s?r&&z.isFunction(r[s])&&(n=r[s].apply(r,o),t||(l=n),"destroy"===s&&i.removeData("fullCalendar")):r||(r=new L.CalendarBase(i,s),i.data("fullCalendar",r),r.render())}),l};var l=["header","buttonText","buttonIcons","themeButtonIcons"];function h(){var t,e,n,i,r,s=Array.prototype.slice.call(arguments),o={};for(t=0;t<l.length;t++){for(e=l[t],n=null,i=0;i<s.length;i++)r=s[i][e],z.isPlainObject(r)?n=z.extend(n||{},r):null!=r&&(n=null);null!==n&&(o[e]=n)}return s.unshift({}),s.push(o),z.extend.apply(z,s)}function r(t,e){e.left&&t.css({"border-left-width":1,"margin-left":e.left-1}),e.right&&t.css({"border-right-width":1,"margin-right":e.right-1})}function s(t){t.css({"margin-left":"","margin-right":"","border-left-width":"","border-right-width":""})}function f(){z("body").addClass("fc-not-allowed")}function g(){z("body").removeClass("fc-not-allowed")}function n(r,t,e){var s=Math.floor(t/r.length),o=Math.floor(t-s*(r.length-1)),l=[],a=[],u=[],c=0;i(r),r.each(function(t,e){var n=t===r.length-1?o:s,i=z(e).outerHeight(!0);i<n?(l.push(e),a.push(i),u.push(z(e).height())):c+=i}),e&&(t-=c,s=Math.floor(t/l.length),o=Math.floor(t-s*(l.length-1))),z(l).each(function(t,e){var n=t===l.length-1?o:s,i=a[t],r=n-(i-u[t]);i<n&&z(e).height(r)})}function i(t){t.height("")}function t(t){var i=0;return t.find("> *").each(function(t,e){var n=z(e).outerWidth();i<n&&(i=n)}),i++,t.width(i),i}function o(t,e){if(t.height(e).addClass("fc-scroller"),t[0].scrollHeight-1>t[0].clientHeight)return 1;a(t)}function a(t){t.height("").removeClass("fc-scroller")}function p(t){var e=t.css("position"),n=t.parents().filter(function(){var t=z(this);return/(auto|scroll)/.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return"fixed"!==e&&n.length?n:z(t[0].ownerDocument||document)}function v(t){var e=t.offset();return{left:e.left,right:e.left+t.outerWidth(),top:e.top,bottom:e.top+t.outerHeight()}}function e(t){var e=t.offset(),n=u(t),i=e.left+m(t,"border-left-width")+n.left,r=e.top+m(t,"border-top-width")+n.top;return{left:i,right:i+t[0].clientWidth,top:r,bottom:r+t[0].clientHeight}}function u(t){var e=t.innerWidth()-t[0].clientWidth,n={left:0,right:0,top:0,bottom:t.innerHeight()-t[0].clientHeight};return!function(){null===c&&(c=function(){var t=z("<div><div/></div>").css({position:"absolute",top:-1e3,left:0,border:0,padding:0,overflow:"scroll",direction:"rtl"}).appendTo("body"),e=t.children().offset().left>t.offset().left;return t.remove(),e}());return c}()||"rtl"!=t.css("direction")?n.right=e:n.left=e,n}L.intersectionToSeg=w,L.applyAll=A,L.debounce=I,L.isInt=B,L.htmlEscape=R,L.cssToStr=F,L.proxy=Y,L.getClientRect=e,L.getContentRect=function(t){var e=t.offset(),n=e.left+m(t,"border-left-width")+m(t,"padding-left"),i=e.top+m(t,"border-top-width")+m(t,"padding-top");return{left:n,right:n+t.width(),top:i,bottom:i+t.height()}},L.getScrollbarWidths=u;var c=null;function m(t,e){return parseFloat(t.css(e))||0}function y(t){return 1==t.which&&!t.ctrlKey}function w(t,e){var n,i,r,s,o=t.start,l=t.end,a=e.start,u=e.end;if(a<l&&o<u)return r=a<=o?(n=o.clone(),!0):(n=a.clone(),!1),s=l<=u?(i=l.clone(),!0):(i=u.clone(),!1),{start:n,end:i,isStart:r,isEnd:s}}L.computeIntervalUnit=b,L.durationHasTime=C;var E=["sun","mon","tue","wed","thu","fri","sat"],S=["year","month","week","day","hour","minute","second","millisecond"];function _(t,e){return G.duration({days:t.clone().stripTime().diff(e.clone().stripTime(),"days"),ms:t.time()-e.time()})}function P(t,e,n){return G.duration(Math.round(t.diff(e,n,!0)),n)}function b(t,e){var n,i,r;for(n=0;n<S.length&&!(1<=(r=D(i=S[n],t,e))&&B(r));n++);return i}function D(t,e,n){return null!=n?n.diff(e,t,!0):G.isDuration(e)?e.as(t):e.end.diff(e.start,t,!0)}function C(t){return Boolean(t.hours()||t.minutes()||t.seconds()||t.milliseconds())}function V(t){return/^\d+\:\d+(?:\:\d+\.?(?:\d{3})?)?$/.test(t)}var T={}.hasOwnProperty;function k(t){function e(){}return e.prototype=t,new e}function H(t,e){for(var n in t)x(t,n)&&(e[n]=t[n])}function x(t,e){return T.call(t,e)}function A(t,e,n){if(z.isFunction(t)&&(t=[t]),t){var i,r;for(i=0;i<t.length;i++)r=t[i].apply(e,n)||r;return r}}function O(){for(var t=0;t<arguments.length;t++)if(void 0!==arguments[t])return arguments[t]}function R(t){return(t+"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,""").replace(/\n/g,"<br />")}function M(t){return t.replace(/&.*?;/g,"")}function F(t){var n=[];return z.each(t,function(t,e){null!=e&&n.push(t+":"+e)}),n.join(";")}function N(t,e){return t-e}function B(t){return t%1==0}function Y(t,e){var n=t[e];return function(){return n.apply(t,arguments)}}function I(e,n){var i,r,s,o,l=function(){var t=new Date-o;t<n&&0<t?i=setTimeout(l,n-t):(i=null,e.apply(s,r),i||(s=r=null))};return function(){s=this,r=arguments,o=+new Date,i=i||setTimeout(l,n)}}var W,Z,j,U=/^\s*\d{4}-\d\d$/,q=/^\s*\d{4}-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?)?$/,$=G.fn,X=z.extend({},$);function K(t,e,n){var i,r,s,o,l,a=t[0],u=1==t.length&&"string"==typeof a;return G.isMoment(a)?J(a,o=G.apply(null,t)):(l=a,"[object Date]"===Object.prototype.toString.call(l)||l instanceof Date||void 0===a?o=G.apply(null,t):(r=i=!1,u?U.test(a)?(t=[a+="-01"],r=i=!0):(s=q.exec(a))&&(i=!s[5],r=!0):z.isArray(a)&&(r=!0),o=e||i?G.utc.apply(G,t):G.apply(null,t),i?(o._ambigTime=!0,o._ambigZone=!0):n&&(r?o._ambigZone=!0:u&&(o.utcOffset?o.utcOffset(a):o.zone(a))))),o._fullCalendar=!0,o}function Q(t,e){var n,i,r=!1,s=!1,o=t.length,l=[];for(n=0;n<o;n++)i=t[n],G.isMoment(i)||(i=L.moment.parseZone(i)),r=r||i._ambigTime,s=s||i._ambigZone,l.push(i);for(n=0;n<o;n++)i=l[n],e||!r||i._ambigTime?s&&!i._ambigZone&&(l[n]=i.clone().stripZone()):l[n]=i.clone().stripTime();return l}function J(t,e){t._ambigTime?e._ambigTime=!0:e._ambigTime&&(e._ambigTime=!1),t._ambigZone?e._ambigZone=!0:e._ambigZone&&(e._ambigZone=!1)}function tt(t,e){t.year(e[0]||0).month(e[1]||0).date(e[2]||0).hours(e[3]||0).minutes(e[4]||0).seconds(e[5]||0).milliseconds(e[6]||0)}function et(t,e){return X.format.call(t,e)}function nt(t,e){var n,i="";for(n=0;n<e.length;n++)i+=rt(t,e[n]);return i}L.moment=function(){return K(arguments)},L.moment.utc=function(){var t=K(arguments,!0);return t.hasTime()&&t.utc(),t},L.moment.parseZone=function(){return K(arguments,!0,!0)},$.clone=function(){var t=X.clone.apply(this,arguments);return J(this,t),this._fullCalendar&&(t._fullCalendar=!0),t},$.week=$.weeks=function(t){var e=(this._locale||this._lang)._fullCalendar_weekCalc;return null==t&&"function"==typeof e?e(this):"ISO"===e?X.isoWeek.apply(this,arguments):X.week.apply(this,arguments)},$.time=function(t){if(!this._fullCalendar)return X.time.apply(this,arguments);if(null==t)return G.duration({hours:this.hours(),minutes:this.minutes(),seconds:this.seconds(),milliseconds:this.milliseconds()});this._ambigTime=!1,G.isDuration(t)||G.isMoment(t)||(t=G.duration(t));var e=0;return G.isDuration(t)&&(e=24*Math.floor(t.asDays())),this.hours(e+t.hours()).minutes(t.minutes()).seconds(t.seconds()).milliseconds(t.milliseconds())},$.stripTime=function(){var t;return this._ambigTime||(t=this.toArray(),this.utc(),Z(this,t.slice(0,3)),this._ambigTime=!0,this._ambigZone=!0),this},$.hasTime=function(){return!this._ambigTime},$.stripZone=function(){var t,e;return this._ambigZone||(t=this.toArray(),e=this._ambigTime,this.utc(),Z(this,t),this._ambigTime=e||!1,this._ambigZone=!0),this},$.hasZone=function(){return!this._ambigZone},$.local=function(){var t=this.toArray(),e=this._ambigZone;return X.local.apply(this,arguments),this._ambigTime=!1,this._ambigZone=!1,e&&j(this,t),this},$.utc=function(){return X.utc.apply(this,arguments),this._ambigTime=!1,this._ambigZone=!1,this},z.each(["zone","utcOffset"],function(t,e){X[e]&&($[e]=function(t){return null!=t&&(this._ambigTime=!1,this._ambigZone=!1),X[e].apply(this,arguments)})}),$.format=function(){return this._fullCalendar&&arguments[0]?nt(this,ut(arguments[0])):this._ambigTime?et(this,"YYYY-MM-DD"):this._ambigZone?et(this,"YYYY-MM-DD[T]HH:mm:ss"):X.format.apply(this,arguments)},$.toISOString=function(){return this._ambigTime?et(this,"YYYY-MM-DD"):this._ambigZone?et(this,"YYYY-MM-DD[T]HH:mm:ss"):X.toISOString.apply(this,arguments)},$.isWithin=function(t,e){var n=Q([this,t,e]);return n[0]>=n[1]&&n[0]<n[2]},$.isSame=function(t,e){var n;return this._fullCalendar?e?(n=Q([this,t],!0),X.isSame.call(n[0],n[1],e)):(t=L.moment.parseZone(t),X.isSame.call(this,t)&&Boolean(this._ambigTime)===Boolean(t._ambigTime)&&Boolean(this._ambigZone)===Boolean(t._ambigZone)):X.isSame.apply(this,arguments)},z.each(["isBefore","isAfter"],function(t,i){$[i]=function(t,e){var n;return this._fullCalendar?(n=Q([this,t]),X[i].call(n[0],n[1],e)):X[i].apply(this,arguments)}}),W="_d"in G()&&"updateOffset"in G,Z=W?function(t,e){t._d.setTime(Date.UTC.apply(Date,e)),G.updateOffset(t,!1)}:tt,j=W?function(t,e){t._d.setTime(+new Date(e[0]||0,e[1]||0,e[2]||0,e[3]||0,e[4]||0,e[5]||0,e[6]||0)),G.updateOffset(t,!1)}:tt;var it={t:function(t){return et(t,"a").charAt(0)},T:function(t){return et(t,"A").charAt(0)}};function rt(t,e){var n,i;return"string"==typeof e?e:(n=e.token)?it[n]?it[n](t):et(t,n):e.maybe&&(i=nt(t,e.maybe)).match(/[1-9]/)?i:""}function st(t,e,n,i,r){return i=i||" - ",function(t,e,n,i,r){var s,o,l,a,u="",c="",d="",h="",f="";for(o=0;o<n.length&&!1!==(s=lt(t,e,n[o]));o++)u+=s;for(l=n.length-1;o<l&&!1!==(s=lt(t,e,n[l]));l--)c=s+c;for(a=o;a<=l;a++)d+=rt(t,n[a]),h+=rt(e,n[a]);(d||h)&&(f=r?h+i+d:d+i+h);return u+f+c}(t=L.moment.parseZone(t),e=L.moment.parseZone(e),ut(n=(t.localeData||t.lang).call(t).longDateFormat(n)||n),i,r)}L.formatRange=st;var ot={Y:"year",M:"month",D:"day",d:"day",A:"second",a:"second",T:"second",t:"second",H:"second",h:"second",m:"second",s:"second"};function lt(t,e,n){var i,r;return"string"==typeof n?n:!!((i=n.token)&&(r=ot[i.charAt(0)])&&t.isSame(e,r))&&et(t,i)}var at={};function ut(t){return t in at?at[t]:at[t]=function t(e){var n=[];var i=/\[([^\]]*)\]|\(([^\)]*)\)|(LTS|LT|(\w)\4*o?)|([^\w\[\(]+)/g;var r;for(;r=i.exec(e);)r[1]?n.push(r[1]):r[2]?n.push({maybe:t(r[2])}):r[3]?n.push({token:r[3]}):r[5]&&n.push(r[5]);return n}(t)}function ct(){}(L.Class=ct).extend=function(t){var e,n=this;return x(t=t||{},"constructor")&&(e=t.constructor),"function"!=typeof e&&(e=t.constructor=function(){n.apply(this,arguments)}),e.prototype=k(n.prototype),H(t,e.prototype),function(t,e){var n,i,r=["constructor","toString","valueOf"];for(n=0;n<r.length;n++)t[i=r[n]]!==Object.prototype[i]&&(e[i]=t[i])}(t,e.prototype),H(n,e),e},ct.mixin=function(t){H(t.prototype||t,this.prototype)};var dt=ct.extend({isHidden:!0,options:null,el:null,documentMousedownProxy:null,margin:10,constructor:function(t){this.options=t||{}},show:function(){this.isHidden&&(this.el||this.render(),this.el.show(),this.position(),this.isHidden=!1,this.trigger("show"))},hide:function(){this.isHidden||(this.el.hide(),this.isHidden=!0,this.trigger("hide"))},render:function(){var t=this,e=this.options;this.el=z('<div class="fc-popover"/>').addClass(e.className||"").css({top:0,left:0}).append(e.content).appendTo(e.parentEl),this.el.on("click",".fc-close",function(){t.hide()}),e.autoHide&&z(document).on("mousedown",this.documentMousedownProxy=Y(this,"documentMousedown"))},documentMousedown:function(t){this.el&&!z(t.target).closest(this.el).length&&this.hide()},destroy:function(){this.hide(),this.el&&(this.el.remove(),this.el=null),z(document).off("mousedown",this.documentMousedownProxy)},position:function(){var t,e,n,i,r,s=this.options,o=this.el.offsetParent().offset(),l=this.el.outerWidth(),a=this.el.outerHeight(),u=z(window),c=p(this.el);i=s.top||0,r=void 0!==s.left?s.left:void 0!==s.right?s.right-l:0,e=c.is(window)||c.is(document)?(c=u,t=0):(t=(n=c.offset()).top,n.left),t+=u.scrollTop(),e+=u.scrollLeft(),!1!==s.viewportConstrain&&(i=Math.min(i,t+c.outerHeight()-a-this.margin),i=Math.max(i,t+this.margin),r=Math.min(r,e+c.outerWidth()-l-this.margin),r=Math.max(r,e+this.margin)),this.el.css({top:i-o.top,left:r-o.left})},trigger:function(t){this.options[t]&&this.options[t].apply(this,Array.prototype.slice.call(arguments,1))}}),ht=ct.extend({grid:null,rowCoords:null,colCoords:null,containerEl:null,bounds:null,constructor:function(t){this.grid=t},build:function(){this.rowCoords=this.grid.computeRowCoords(),this.colCoords=this.grid.computeColCoords(),this.computeBounds()},clear:function(){this.rowCoords=null,this.colCoords=null},getCell:function(t,e){var n,i,r,s=this.rowCoords,o=s.length,l=this.colCoords,a=l.length,u=null,c=null;if(this.inBounds(t,e)){for(n=0;n<o;n++)if(e>=(i=s[n]).top&&e<i.bottom){u=n;break}for(n=0;n<a;n++)if(t>=(i=l[n]).left&&t<i.right){c=n;break}if(null!==u&&null!==c)return(r=this.grid.getCell(u,c)).grid=this.grid,z.extend(r,s[u],l[c]),r}return null},computeBounds:function(){this.bounds=this.containerEl?e(this.containerEl):null},inBounds:function(t,e){var n=this.bounds;return!n||t>=n.left&&t<n.right&&e>=n.top&&e<n.bottom}}),ft=ct.extend({coordMaps:null,constructor:function(t){this.coordMaps=t},build:function(){var t,e=this.coordMaps;for(t=0;t<e.length;t++)e[t].build()},getCell:function(t,e){var n,i=this.coordMaps,r=null;for(n=0;n<i.length&&!r;n++)r=i[n].getCell(t,e);return r},clear:function(){var t,e=this.coordMaps;for(t=0;t<e.length;t++)e[t].clear()}}),gt=L.DragListener=ct.extend({options:null,isListening:!1,isDragging:!1,originX:null,originY:null,mousemoveProxy:null,mouseupProxy:null,subjectEl:null,subjectHref:null,scrollEl:null,scrollBounds:null,scrollTopVel:null,scrollLeftVel:null,scrollIntervalId:null,scrollHandlerProxy:null,scrollSensitivity:30,scrollSpeed:200,scrollIntervalMs:50,constructor:function(t){t=t||{},this.options=t,this.subjectEl=t.subjectEl},mousedown:function(t){y(t)&&(t.preventDefault(),this.startListening(t),this.options.distance||this.startDrag(t))},startListening:function(t){var e;this.isListening||(t&&this.options.scroll&&((e=p(z(t.target))).is(window)||e.is(document)||(this.scrollEl=e,this.scrollHandlerProxy=I(Y(this,"scrollHandler"),100),this.scrollEl.on("scroll",this.scrollHandlerProxy))),z(document).on("mousemove",this.mousemoveProxy=Y(this,"mousemove")).on("mouseup",this.mouseupProxy=Y(this,"mouseup")).on("selectstart",this.preventDefault),t?(this.originX=t.pageX,this.originY=t.pageY):(this.originX=0,this.originY=0),this.isListening=!0,this.listenStart(t))},listenStart:function(t){this.trigger("listenStart",t)},mousemove:function(t){var e,n=t.pageX-this.originX,i=t.pageY-this.originY;this.isDragging||(e=this.options.distance||1)*e<=n*n+i*i&&this.startDrag(t),this.isDragging&&this.drag(n,i,t)},startDrag:function(t){this.isListening||this.startListening(),this.isDragging||(this.isDragging=!0,this.dragStart(t))},dragStart:function(t){var e=this.subjectEl;this.trigger("dragStart",t),(this.subjectHref=e?e.attr("href"):null)&&e.removeAttr("href")},drag:function(t,e,n){this.trigger("drag",t,e,n),this.updateScroll(n)},mouseup:function(t){this.stopListening(t)},stopDrag:function(t){this.isDragging&&(this.stopScrolling(),this.dragStop(t),this.isDragging=!1)},dragStop:function(t){var e=this;this.trigger("dragStop",t),setTimeout(function(){e.subjectHref&&e.subjectEl.attr("href",e.subjectHref)},0)},stopListening:function(t){this.stopDrag(t),this.isListening&&(this.scrollEl&&(this.scrollEl.off("scroll",this.scrollHandlerProxy),this.scrollHandlerProxy=null),z(document).off("mousemove",this.mousemoveProxy).off("mouseup",this.mouseupProxy).off("selectstart",this.preventDefault),this.mousemoveProxy=null,this.mouseupProxy=null,this.isListening=!1,this.listenStop(t))},listenStop:function(t){this.trigger("listenStop",t)},trigger:function(t){this.options[t]&&this.options[t].apply(this,Array.prototype.slice.call(arguments,1))},preventDefault:function(t){t.preventDefault()},computeScrollBounds:function(){var t=this.scrollEl;this.scrollBounds=t?v(t):null},updateScroll:function(t){var e,n,i,r,s=this.scrollSensitivity,o=this.scrollBounds,l=0,a=0;o&&(e=(s-(t.pageY-o.top))/s,n=(s-(o.bottom-t.pageY))/s,i=(s-(t.pageX-o.left))/s,r=(s-(o.right-t.pageX))/s,0<=e&&e<=1?l=e*this.scrollSpeed*-1:0<=n&&n<=1&&(l=n*this.scrollSpeed),0<=i&&i<=1?a=i*this.scrollSpeed*-1:0<=r&&r<=1&&(a=r*this.scrollSpeed)),this.setScrollVel(l,a)},setScrollVel:function(t,e){this.scrollTopVel=t,this.scrollLeftVel=e,this.constrainScrollVel(),!this.scrollTopVel&&!this.scrollLeftVel||this.scrollIntervalId||(this.scrollIntervalId=setInterval(Y(this,"scrollIntervalFunc"),this.scrollIntervalMs))},constrainScrollVel:function(){var t=this.scrollEl;this.scrollTopVel<0?t.scrollTop()<=0&&(this.scrollTopVel=0):0<this.scrollTopVel&&t.scrollTop()+t[0].clientHeight>=t[0].scrollHeight&&(this.scrollTopVel=0),this.scrollLeftVel<0?t.scrollLeft()<=0&&(this.scrollLeftVel=0):0<this.scrollLeftVel&&t.scrollLeft()+t[0].clientWidth>=t[0].scrollWidth&&(this.scrollLeftVel=0)},scrollIntervalFunc:function(){var t=this.scrollEl,e=this.scrollIntervalMs/1e3;this.scrollTopVel&&t.scrollTop(t.scrollTop()+this.scrollTopVel*e),this.scrollLeftVel&&t.scrollLeft(t.scrollLeft()+this.scrollLeftVel*e),this.constrainScrollVel(),this.scrollTopVel||this.scrollLeftVel||this.stopScrolling()},stopScrolling:function(){this.scrollIntervalId&&(clearInterval(this.scrollIntervalId),this.scrollIntervalId=null,this.scrollStop())},scrollHandler:function(){this.scrollIntervalId||this.scrollStop()},scrollStop:function(){}}),pt=gt.extend({coordMap:null,origCell:null,cell:null,coordAdjust:null,constructor:function(t,e){gt.prototype.constructor.call(this,e),this.coordMap=t},listenStart:function(t){var e,n,i,r,s,o,l,a,u,c,d,h=this.subjectEl;gt.prototype.listenStart.apply(this,arguments),this.computeCoords(),t?(i=n={left:t.pageX,top:t.pageY},h&&(e=v(h),c=i,d=e,i={left:Math.min(Math.max(c.left,d.left),d.right),top:Math.min(Math.max(c.top,d.top),d.bottom)}),this.origCell=this.getCell(i.left,i.top),h&&this.options.subjectCenter&&(this.origCell&&(l=this.origCell,a=e,e=(u={left:Math.max(l.left,a.left),right:Math.min(l.right,a.right),top:Math.max(l.top,a.top),bottom:Math.min(l.bottom,a.bottom)}).left<u.right&&u.top<u.bottom?u:e),i={left:((o=e).left+o.right)/2,top:(o.top+o.bottom)/2}),this.coordAdjust=(s=n,{left:(r=i).left-s.left,top:r.top-s.top})):(this.origCell=null,this.coordAdjust=null)},computeCoords:function(){this.coordMap.build(),this.computeScrollBounds()},dragStart:function(t){var e;gt.prototype.dragStart.apply(this,arguments),(e=this.getCell(t.pageX,t.pageY))&&this.cellOver(e)},drag:function(t,e,n){var i;gt.prototype.drag.apply(this,arguments),vt(i=this.getCell(n.pageX,n.pageY),this.cell)||(this.cell&&this.cellOut(),i&&this.cellOver(i))},dragStop:function(){this.cellDone(),gt.prototype.dragStop.apply(this,arguments)},cellOver:function(t){this.cell=t,this.trigger("cellOver",t,vt(t,this.origCell),this.origCell)},cellOut:function(){this.cell&&(this.trigger("cellOut",this.cell),this.cellDone(),this.cell=null)},cellDone:function(){this.cell&&this.trigger("cellDone",this.cell)},listenStop:function(){gt.prototype.listenStop.apply(this,arguments),this.origCell=this.cell=null,this.coordMap.clear()},scrollStop:function(){gt.prototype.scrollStop.apply(this,arguments),this.computeCoords()},getCell:function(t,e){return this.coordAdjust&&(t+=this.coordAdjust.left,e+=this.coordAdjust.top),this.coordMap.getCell(t,e)}});function vt(t,e){return!t&&!e||!(!t||!e)&&(t.grid===e.grid&&t.row===e.row&&t.col===e.col)}var mt=ct.extend({options:null,sourceEl:null,el:null,parentEl:null,top0:null,left0:null,mouseY0:null,mouseX0:null,topDelta:null,leftDelta:null,mousemoveProxy:null,isFollowing:!1,isHidden:!1,isAnimating:!1,constructor:function(t,e){this.options=e=e||{},this.sourceEl=t,this.parentEl=e.parentEl?z(e.parentEl):t.parent()},start:function(t){this.isFollowing||(this.isFollowing=!0,this.mouseY0=t.pageY,this.mouseX0=t.pageX,this.topDelta=0,this.leftDelta=0,this.isHidden||this.updatePosition(),z(document).on("mousemove",this.mousemoveProxy=Y(this,"mousemove")))},stop:function(t,e){var n=this,i=this.options.revertDuration;function r(){this.isAnimating=!1,n.destroyEl(),this.top0=this.left0=null,e&&e()}this.isFollowing&&!this.isAnimating&&(this.isFollowing=!1,z(document).off("mousemove",this.mousemoveProxy),t&&i&&!this.isHidden?(this.isAnimating=!0,this.el.animate({top:this.top0,left:this.left0},{duration:i,complete:r})):r())},getEl:function(){var t=this.el;return t||(this.sourceEl.width(),t=this.el=this.sourceEl.clone().css({position:"absolute",visibility:"",display:this.isHidden?"none":"",margin:0,right:"auto",bottom:"auto",width:this.sourceEl.width(),height:this.sourceEl.height(),opacity:this.options.opacity||"",zIndex:this.options.zIndex}).appendTo(this.parentEl)),t},destroyEl:function(){this.el&&(this.el.remove(),this.el=null)},updatePosition:function(){var t,e;this.getEl(),null===this.top0&&(this.sourceEl.width(),t=this.sourceEl.offset(),e=this.el.offsetParent().offset(),this.top0=t.top-e.top,this.left0=t.left-e.left),this.el.css({top:this.top0+this.topDelta,left:this.left0+this.leftDelta})},mousemove:function(t){this.topDelta=t.pageY-this.mouseY0,this.leftDelta=t.pageX-this.mouseX0,this.isHidden||this.updatePosition()},hide:function(){this.isHidden||(this.isHidden=!0,this.el&&this.el.hide())},show:function(){this.isHidden&&(this.isHidden=!1,this.updatePosition(),this.getEl().show())}}),yt=ct.extend({view:null,isRTL:null,cellHtml:"<td/>",constructor:function(t){this.view=t,this.isRTL=t.opt("isRTL")},rowHtml:function(t,e){var n,i=this.getHtmlRenderer("cell",t),r="";for(e=e||0,n=0;n<this.colCnt;n++)r+=i(this.getCell(e,n));return"<tr>"+(r=this.bookendCells(r,t,e))+"</tr>"},bookendCells:function(t,e,n){var i=this.getHtmlRenderer("intro",e)(n||0),r=this.getHtmlRenderer("outro",e)(n||0),s=this.isRTL?r:i,o=this.isRTL?i:r;return"string"==typeof t?s+t+o:t.prepend(s).append(o)},getHtmlRenderer:function(t,e){var n,i,r,s,o,l=this.view;return n=t+"Html",e&&(i=e+((o=t).charAt(0).toUpperCase()+o.slice(1))+"Html"),i&&(s=l[i])?r=l:i&&(s=this[i])?r=this:(s=l[n])?r=l:(s=this[n])&&(r=this),"function"==typeof s?function(){return s.apply(r,arguments)||""}:function(){return s||""}}}),wt=L.Grid=yt.extend({start:null,end:null,rowCnt:0,colCnt:0,rowData:null,colData:null,el:null,coordMap:null,elsByFill:null,externalDragStartProxy:null,colHeadFormat:null,eventTimeFormat:null,displayEventTime:null,displayEventEnd:null,cellDuration:null,largeUnit:null,constructor:function(){yt.apply(this,arguments),this.coordMap=new ht(this),this.elsByFill={},this.externalDragStartProxy=Y(this,"externalDragStart")},computeColHeadFormat:function(){},computeEventTimeFormat:function(){return this.view.opt("smallTimeFormat")},computeDisplayEventTime:function(){return!0},computeDisplayEventEnd:function(){return!0},setRange:function(t){var e,n,i=this.view;this.start=t.start.clone(),this.end=t.end.clone(),this.rowData=[],this.colData=[],this.updateCells(),this.colHeadFormat=i.opt("columnFormat")||this.computeColHeadFormat(),this.eventTimeFormat=i.opt("eventTimeFormat")||i.opt("timeFormat")||this.computeEventTimeFormat(),null==(e=i.opt("displayEventTime"))&&(e=this.computeDisplayEventTime()),null==(n=i.opt("displayEventEnd"))&&(n=this.computeDisplayEventEnd()),this.displayEventTime=e,this.displayEventEnd=n},updateCells:function(){},rangeToSegs:function(t){},diffDates:function(t,e){return this.largeUnit?P(t,e,this.largeUnit):_(t,e)},getCell:function(t,e){var n;return null==e&&(t="number"==typeof t?(e=t%this.colCnt,Math.floor(t/this.colCnt)):(e=t.col,t.row)),n={row:t,col:e},z.extend(n,this.getRowData(t),this.getColData(e)),z.extend(n,this.computeCellRange(n)),n},computeCellRange:function(t){var e=this.computeCellDate(t);return{start:e,end:e.clone().add(this.cellDuration)}},computeCellDate:function(t){},getRowData:function(t){return this.rowData[t]||{}},getColData:function(t){return this.colData[t]||{}},getRowEl:function(t){},getColEl:function(t){},getCellDayEl:function(t){return this.getColEl(t.col)||this.getRowEl(t.row)},computeRowCoords:function(){var t,e,n,i=[];for(t=0;t<this.rowCnt;t++)n=(e=this.getRowEl(t)).offset().top,i.push({top:n,bottom:n+e.outerHeight()});return i},computeColCoords:function(){var t,e,n,i=[];for(t=0;t<this.colCnt;t++)n=(e=this.getColEl(t)).offset().left,i.push({left:n,right:n+e.outerWidth()});return i},setElement:function(t){var e=this;(this.el=t).on("mousedown",function(t){z(t.target).is(".fc-event-container *, .fc-more")||z(t.target).closest(".fc-popover").length||e.dayMousedown(t)}),this.bindSegHandlers(),this.bindGlobalHandlers()},removeElement:function(){this.unbindGlobalHandlers(),this.el.remove()},renderSkeleton:function(){},renderDates:function(){},destroyDates:function(){},bindGlobalHandlers:function(){z(document).on("dragstart sortstart",this.externalDragStartProxy)},unbindGlobalHandlers:function(){z(document).off("dragstart sortstart",this.externalDragStartProxy)},dayMousedown:function(t){var i,r,s=this,e=this.view,o=e.opt("selectable");new pt(this.coordMap,{scroll:e.opt("dragScroll"),dragStart:function(){e.unselect()},cellOver:function(t,e,n){n&&(i=e?t:null,o&&((r=s.computeSelection(n,t))?s.renderSelection(r):f()))},cellOut:function(t){r=i=null,s.destroySelection(),g()},listenStop:function(t){i&&e.trigger("dayClick",s.getCellDayEl(i),i.start,t),r&&e.reportSelection(r,t),g()}}).mousedown(t)},renderRangeHelper:function(t,e){var n=this.fabricateHelperEvent(t,e);this.renderHelper(n,e)},fabricateHelperEvent:function(t,e){var n=e?k(e.event):{};return n.start=t.start.clone(),n.end=t.end?t.end.clone():null,n.allDay=null,this.view.calendar.normalizeEventRange(n),n.className=(n.className||[]).concat("fc-helper"),e||(n.editable=!1),n},renderHelper:function(t,e){},destroyHelper:function(){},renderSelection:function(t){this.renderHighlight(t)},destroySelection:function(){this.destroyHighlight()},computeSelection:function(t,e){var n,i=[t.start,t.end,e.start,e.end];return i.sort(N),n={start:i[0].clone(),end:i[3].clone()},this.view.calendar.isSelectionRangeAllowed(n)?n:null},renderHighlight:function(t){this.renderFill("highlight",this.rangeToSegs(t))},destroyHighlight:function(){this.destroyFill("highlight")},highlightSegClasses:function(){return["fc-highlight"]},renderFill:function(t,e){},destroyFill:function(t){var e=this.elsByFill[t];e&&(e.remove(),delete this.elsByFill[t])},renderFillSegEls:function(t,r){var e,s=this,o=this[t+"SegEl"],n="",l=[];if(r.length){for(e=0;e<r.length;e++)n+=this.fillSegHtml(t,r[e]);z(n).each(function(t,e){var n=r[t],i=z(e);o&&(i=o.call(s,n,i)),i&&(i=z(i)).is(s.fillSegTag)&&(n.el=i,l.push(n))})}return l},fillSegTag:"div",fillSegHtml:function(t,e){var n=this[t+"SegClasses"],i=this[t+"SegCss"],r=n?n.call(this,e):[],s=F(i?i.call(this,e):{});return"<"+this.fillSegTag+(r.length?' class="'+r.join(" ")+'"':"")+(s?' style="'+s+'"':"")+" />"},headHtml:function(){return'<div class="fc-row '+this.view.widgetHeaderClass+'"><table><thead>'+this.rowHtml("head")+"</thead></table></div>"},headCellHtml:function(t){var e=this.view,n=t.start;return'<th class="fc-day-header '+e.widgetHeaderClass+" fc-"+E[n.day()]+'">'+R(n.format(this.colHeadFormat))+"</th>"},bgCellHtml:function(t){var e=this.view,n=t.start,i=this.getDayClasses(n);return i.unshift("fc-day",e.widgetContentClass),'<td class="'+i.join(" ")+'" data-date="'+n.format("YYYY-MM-DD")+'"></td>'},getDayClasses:function(t){var e=this.view,n=e.calendar.getNow().stripTime(),i=["fc-"+E[t.day()]];return 1==e.intervalDuration.as("months")&&t.month()!=e.intervalStart.month()&&i.push("fc-other-month"),t.isSame(n,"day")?i.push("fc-today",e.highlightStateClass):t<n?i.push("fc-past"):i.push("fc-future"),i}});function Et(t){return O((t.source||{}).rendering,t.rendering)}function St(t,e){return t.eventStartMS-e.eventStartMS}function bt(t,e){return t.eventStartMS-e.eventStartMS||e.eventDurationMS-t.eventDurationMS||e.event.allDay-t.event.allDay||(t.event.title||"").localeCompare(e.event.title)}wt.mixin({mousedOverSeg:null,isDraggingSeg:!1,isResizingSeg:!1,isDraggingExternal:!1,segs:null,renderEvents:function(t){var e,n,i,r,s=this.eventsToSegs(t),o=[],l=[];for(e=0;e<s.length;e++)n=s[e],i=n.event,"background"===(r=Et(i))||"inverse-background"===r?o.push(n):l.push(n);o=this.renderBgSegs(o)||o,l=this.renderFgSegs(l)||l,this.segs=o.concat(l)},destroyEvents:function(){this.triggerSegMouseout(),this.destroyFgSegs(),this.destroyBgSegs(),this.segs=null},getEventSegs:function(){return this.segs||[]},renderFgSegs:function(t){},destroyFgSegs:function(){},renderFgSegEls:function(r,t){var e,s=this.view,n="",o=[];if(r.length){for(e=0;e<r.length;e++)n+=this.fgSegHtml(r[e],t);z(n).each(function(t,e){var n=r[t],i=s.resolveEventEl(n.event,z(e));i&&(i.data("fc-seg",n),n.el=i,o.push(n))})}return o},fgSegHtml:function(t,e){},renderBgSegs:function(t){return this.renderFill("bgEvent",t)},destroyBgSegs:function(){this.destroyFill("bgEvent")},bgEventSegEl:function(t,e){return this.view.resolveEventEl(t.event,e)},bgEventSegClasses:function(t){var e=t.event,n=e.source||{};return["fc-bgevent"].concat(e.className,n.className||[])},bgEventSegCss:function(t){var e=this.view,n=t.event,i=n.source||{};return{"background-color":n.backgroundColor||n.color||i.backgroundColor||i.color||e.opt("eventBackgroundColor")||e.opt("eventColor")}},businessHoursSegClasses:function(t){return["fc-nonbusiness","fc-bgevent"]},bindSegHandlers:function(){var i=this,n=this.view;z.each({mouseenter:function(t,e){i.triggerSegMouseover(t,e)},mouseleave:function(t,e){i.triggerSegMouseout(t,e)},click:function(t,e){return n.trigger("eventClick",this,t.event,e)},mousedown:function(t,e){z(e.target).is(".fc-resizer")&&n.isEventResizable(t.event)?i.segResizeMousedown(t,e,z(e.target).is(".fc-start-resizer")):n.isEventDraggable(t.event)&&i.segDragMousedown(t,e)}},function(t,n){i.el.on(t,".fc-event-container > *",function(t){var e=z(this).data("fc-seg");if(e&&!i.isDraggingSeg&&!i.isResizingSeg)return n.call(this,e,t)})})},triggerSegMouseover:function(t,e){this.mousedOverSeg||(this.mousedOverSeg=t,this.view.trigger("eventMouseover",t.el[0],t.event,e))},triggerSegMouseout:function(t,e){e=e||{},this.mousedOverSeg&&(t=t||this.mousedOverSeg,this.mousedOverSeg=null,this.view.trigger("eventMouseout",t.el[0],t.event,e))},segDragMousedown:function(i,t){var r,s=this,o=this.view,l=o.calendar,e=i.el,a=i.event,u=new mt(i.el,{parentEl:o.el,opacity:o.opt("dragOpacity"),revertDuration:o.opt("dragRevertDuration"),zIndex:2});new pt(o.coordMap,{distance:5,scroll:o.opt("dragScroll"),subjectEl:e,subjectCenter:!0,listenStart:function(t){u.hide(),u.start(t)},dragStart:function(t){s.triggerSegMouseout(i,t),s.segDragStart(i,t),o.hideEvent(a)},cellOver:function(t,e,n){i.cell&&(n=i.cell),(r=s.computeEventDrop(n,t,a))&&!l.isEventRangeAllowed(r,a)&&(f(),r=null),r&&o.renderDrag(r,i)?u.hide():u.show(),e&&(r=null)},cellOut:function(){o.destroyDrag(),u.show(),r=null},cellDone:function(){g()},dragStop:function(t){u.stop(!r,function(){o.destroyDrag(),o.showEvent(a),s.segDragStop(i,t),r&&o.reportEventDrop(a,r,this.largeUnit,e,t)})},listenStop:function(){u.stop()}}).mousedown(t)},segDragStart:function(t,e){this.isDraggingSeg=!0,this.view.trigger("eventDragStart",t.el[0],t.event,e,{})},segDragStop:function(t,e){this.isDraggingSeg=!1,this.view.trigger("eventDragStop",t.el[0],t.event,e,{})},computeEventDrop:function(t,e,n){var i,r,s=this.view.calendar,o=t.start,l=e.start;return o.hasTime()===l.hasTime()?(i=this.diffDates(l,o),n.allDay&&C(i)?(r={start:n.start.clone(),end:s.getEventEnd(n),allDay:!1},s.normalizeEventRangeTimes(r)):r={start:n.start.clone(),end:n.end?n.end.clone():null,allDay:n.allDay},r.start.add(i),r.end&&r.end.add(i)):r={start:l.clone(),end:null,allDay:!l.hasTime()},r},applyDragOpacity:function(t){var n=this.view.opt("dragOpacity");null!=n&&t.each(function(t,e){e.style.opacity=n})},externalDragStart:function(t,e){var n,i,r=this.view;r.opt("droppable")&&(n=z((e?e.item:null)||t.target),i=r.opt("dropAccept"),(z.isFunction(i)?i.call(n[0],n):n.is(i))&&(this.isDraggingExternal||this.listenToExternalDrag(n,t,e)))},listenToExternalDrag:function(t,e,n){var i,r=this,s=function(t){var e,n,i,r,s=L.dataAttrPrefix;s&&(s+="-");(e=t.data(s+"event")||null)&&(e="object"==typeof e?z.extend({},e):{},null==(n=e.start)&&(n=e.time),i=e.duration,r=e.stick,delete e.start,delete e.time,delete e.duration,delete e.stick);null==n&&(n=t.data(s+"start"));null==n&&(n=t.data(s+"time"));null==i&&(i=t.data(s+"duration"));null==r&&(r=t.data(s+"stick"));return n=null!=n?G.duration(n):null,i=null!=i?G.duration(i):null,r=Boolean(r),{eventProps:e,startTime:n,duration:i,stick:r}}(t);new pt(this.coordMap,{listenStart:function(){r.isDraggingExternal=!0},cellOver:function(t){(i=r.computeExternalDrop(t,s))?r.renderDrag(i):f()},cellOut:function(){i=null,r.destroyDrag(),g()},dragStop:function(){r.destroyDrag(),g(),i&&r.view.reportExternalDrop(s,i,t,e,n)},listenStop:function(){r.isDraggingExternal=!1}}).startDrag(e)},computeExternalDrop:function(t,e){var n={start:t.start.clone(),end:null};return e.startTime&&!n.start.hasTime()&&n.start.time(e.startTime),e.duration&&(n.end=n.start.clone().add(e.duration)),this.view.calendar.isExternalDropRangeAllowed(n,e.eventProps)?n:null},renderDrag:function(t,e){},destroyDrag:function(){},segResizeMousedown:function(i,t,r){var s,o=this,l=this.view,a=l.calendar,e=i.el,u=i.event,c=a.getEventEnd(u);new pt(this.coordMap,{distance:5,scroll:l.opt("dragScroll"),subjectEl:e,dragStart:function(t){o.triggerSegMouseout(i,t),o.segResizeStart(i,t)},cellOver:function(t,e,n){(s=r?o.computeEventStartResize(n,t,u):o.computeEventEndResize(n,t,u))&&(a.isEventRangeAllowed(s,u)?s.start.isSame(u.start)&&s.end.isSame(c)&&(s=null):(f(),s=null)),s&&(l.hideEvent(u),o.renderEventResize(s,i))},cellOut:function(){s=null},cellDone:function(){o.destroyEventResize(),l.showEvent(u),g()},dragStop:function(t){o.segResizeStop(i,t),s&&l.reportEventResize(u,s,this.largeUnit,e,t)}}).mousedown(t)},segResizeStart:function(t,e){this.isResizingSeg=!0,this.view.trigger("eventResizeStart",t.el[0],t.event,e,{})},segResizeStop:function(t,e){this.isResizingSeg=!1,this.view.trigger("eventResizeStop",t.el[0],t.event,e,{})},computeEventStartResize:function(t,e,n){return this.computeEventResize("start",t,e,n)},computeEventEndResize:function(t,e,n){return this.computeEventResize("end",t,e,n)},computeEventResize:function(t,e,n,i){var r,s,o=this.view.calendar,l=this.diffDates(n[t],e[t]);return(r={start:i.start.clone(),end:o.getEventEnd(i),allDay:i.allDay}).allDay&&C(l)&&(r.allDay=!1,o.normalizeEventRangeTimes(r)),r[t].add(l),r.start.isBefore(r.end)||(s=i.allDay?o.defaultAllDayEventDuration:o.defaultTimedEventDuration,this.cellDuration&&this.cellDuration<s&&(s=this.cellDuration),"start"==t?r.start=r.end.clone().subtract(s):r.end=r.start.clone().add(s)),r},renderEventResize:function(t,e){},destroyEventResize:function(){},getEventTimeText:function(t,e,n){return null==e&&(e=this.eventTimeFormat),null==n&&(n=this.displayEventEnd),this.displayEventTime&&t.start.hasTime()?n&&t.end?this.view.formatRange(t,e):t.start.format(e):""},getSegClasses:function(t,e,n){var i=t.event,r=["fc-event",t.isStart?"fc-start":"fc-not-start",t.isEnd?"fc-end":"fc-not-end"].concat(i.className,i.source?i.source.className:[]);return e&&r.push("fc-draggable"),n&&r.push("fc-resizable"),r},getEventSkinCss:function(t){var e=this.view,n=t.source||{},i=t.color,r=n.color,s=e.opt("eventColor");return{"background-color":t.backgroundColor||i||n.backgroundColor||r||e.opt("eventBackgroundColor")||s,"border-color":t.borderColor||i||n.borderColor||r||e.opt("eventBorderColor")||s,color:t.textColor||n.textColor||e.opt("eventTextColor")}},eventsToSegs:function(t,e){var n,i=this.eventsToRanges(t),r=[];for(n=0;n<i.length;n++)r.push.apply(r,this.eventRangeToSegs(i[n],e));return r},eventsToRanges:function(t){var n=this,e=function(t){var e,n,i={};for(e=0;e<t.length;e++)n=t[e],(i[n._id]||(i[n._id]=[])).push(n);return i}(t),i=[];return z.each(e,function(t,e){e.length&&i.push.apply(i,"inverse-background"===Et(e[0])?n.eventsToInverseRanges(e):n.eventsToNormalRanges(e))}),i},eventsToNormalRanges:function(t){var e,n,i,r,s=this.view.calendar,o=[];for(e=0;e<t.length;e++)i=(n=t[e]).start.clone().stripZone(),r=s.getEventEnd(n).stripZone(),o.push({event:n,start:i,end:r,eventStartMS:+i,eventDurationMS:r-i});return o},eventsToInverseRanges:function(t){var e,n,i=this.view,r=i.start.clone().stripZone(),s=i.end.clone().stripZone(),o=this.eventsToNormalRanges(t),l=[],a=t[0],u=r;for(o.sort(St),e=0;e<o.length;e++)(n=o[e]).start>u&&l.push({event:a,start:u,end:n.start}),u=n.end;return u<s&&l.push({event:a,start:u,end:s}),l},eventRangeToSegs:function(t,e){var n,i,r;for(n=e?e(t):this.rangeToSegs(t),i=0;i<n.length;i++)(r=n[i]).event=t.event,r.eventStartMS=t.eventStartMS,r.eventDurationMS=t.eventDurationMS;return n}}),L.compareSegs=bt,L.dataAttrPrefix="";var Dt=wt.extend({numbersVisible:!1,bottomCoordPadding:0,breakOnWeeks:null,cellDates:null,dayToCellOffsets:null,rowEls:null,dayEls:null,helperEls:null,constructor:function(){wt.apply(this,arguments),this.cellDuration=G.duration(1,"day")},renderDates:function(t){var e,n,i,r=this.view,s=this.rowCnt,o=s*this.colCnt,l="";for(e=0;e<s;e++)l+=this.dayRowHtml(e,t);for(this.el.html(l),this.rowEls=this.el.find(".fc-row"),this.dayEls=this.el.find(".fc-day"),n=0;n<o;n++)i=this.getCell(n),r.trigger("dayRender",null,i.start,this.dayEls.eq(n))},destroyDates:function(){this.destroySegPopover()},renderBusinessHours:function(){var t=this.view.calendar.getBusinessHoursEvents(!0),e=this.eventsToSegs(t);this.renderFill("businessHours",e,"bgevent")},dayRowHtml:function(t,e){var n=["fc-row","fc-week",this.view.widgetContentClass];return e&&n.push("fc-rigid"),'<div class="'+n.join(" ")+'"><div class="fc-bg"><table>'+this.rowHtml("day",t)+'</table></div><div class="fc-content-skeleton"><table>'+(this.numbersVisible?"<thead>"+this.rowHtml("number",t)+"</thead>":"")+"</table></div></div>"},dayCellHtml:function(t){return this.bgCellHtml(t)},computeColHeadFormat:function(){return 1<this.rowCnt?"ddd":1<this.colCnt?this.view.opt("dayOfMonthFormat"):"dddd"},computeEventTimeFormat:function(){return this.view.opt("extraSmallTimeFormat")},computeDisplayEventEnd:function(){return 1==this.colCnt},updateCells:function(){var t,e,n,i;if(this.updateCellDates(),t=this.cellDates,this.breakOnWeeks){for(e=t[0].day(),i=1;i<t.length&&t[i].day()!=e;i++);n=Math.ceil(t.length/i)}else n=1,i=t.length;this.rowCnt=n,this.colCnt=i},updateCellDates:function(){for(var t=this.view,e=this.start.clone(),n=[],i=-1,r=[];e.isBefore(this.end);)t.isHiddenDay(e)?r.push(i+.5):(i++,r.push(i),n.push(e.clone())),e.add(1,"days");this.cellDates=n,this.dayToCellOffsets=r},computeCellDate:function(t){var e=this.colCnt,n=t.row*e+(this.isRTL?e-t.col-1:t.col);return this.cellDates[n].clone()},getRowEl:function(t){return this.rowEls.eq(t)},getColEl:function(t){return this.dayEls.eq(t)},getCellDayEl:function(t){return this.dayEls.eq(t.row*this.colCnt+t.col)},computeRowCoords:function(){var t=wt.prototype.computeRowCoords.call(this);return t[t.length-1].bottom+=this.bottomCoordPadding,t},rangeToSegs:function(t){var e,n,i,r,s,o,l,a,u,c,d=this.isRTL,h=this.rowCnt,f=this.colCnt,g=[];for(t=this.view.computeDayRange(t),e=this.dateToCellOffset(t.start),n=this.dateToCellOffset(t.end.subtract(1,"days")),i=0;i<h;i++)s=(r=i*f)+f-1,a=Math.max(r,e),u=Math.min(s,n),(a=Math.ceil(a))<=(u=Math.floor(u))&&(o=a===e,l=u===n,a-=r,u-=r,c={row:i,isStart:o,isEnd:l},d?(c.leftCol=f-u-1,c.rightCol=f-a-1):(c.leftCol=a,c.rightCol=u),g.push(c));return g},dateToCellOffset:function(t){var e=this.dayToCellOffsets,n=t.diff(this.start,"days");return n<0?e[0]-1:n>=e.length?e[e.length-1]+1:e[n]},renderDrag:function(t,e){if(this.renderHighlight(this.view.calendar.ensureVisibleEventRange(t)),e&&!e.el.closest(this.el).length)return this.renderRangeHelper(t,e),this.applyDragOpacity(this.helperEls),!0},destroyDrag:function(){this.destroyHighlight(),this.destroyHelper()},renderEventResize:function(t,e){this.renderHighlight(t),this.renderRangeHelper(t,e)},destroyEventResize:function(){this.destroyHighlight(),this.destroyHelper()},renderHelper:function(t,s){var o,l=[],e=this.eventsToSegs([t]);e=this.renderFgSegEls(e),o=this.renderSegRows(e),this.rowEls.each(function(t,e){var n,i=z(e),r=z('<div class="fc-helper-skeleton"><table/></div>');n=s&&s.row===t?s.el.position().top:i.find(".fc-content-skeleton tbody").position().top,r.css("top",n).find("table").append(o[t].tbodyEl),i.append(r),l.push(r[0])}),this.helperEls=z(l)},destroyHelper:function(){this.helperEls&&(this.helperEls.remove(),this.helperEls=null)},fillSegTag:"td",renderFill:function(t,e,n){var i,r,s,o=[];for(e=this.renderFillSegEls(t,e),i=0;i<e.length;i++)r=e[i],s=this.renderFillRow(t,r,n),this.rowEls.eq(r.row).append(s),o.push(s[0]);return this.elsByFill[t]=z(o),e},renderFillRow:function(t,e,n){var i,r,s=this.colCnt,o=e.leftCol,l=e.rightCol+1;return n=n||t.toLowerCase(),r=(i=z('<div class="fc-'+n+'-skeleton"><table><tr/></table></div>')).find("tr"),0<o&&r.append('<td colspan="'+o+'"/>'),r.append(e.el.attr("colspan",l-o)),l<s&&r.append('<td colspan="'+(s-l)+'"/>'),this.bookendCells(r,t),i}});function Ct(t,e){var n,i;for(n=0;n<e.length;n++)if((i=e[n]).leftCol<=t.rightCol&&i.rightCol>=t.leftCol)return 1}function Tt(t,e){return t.leftCol-e.leftCol}Dt.mixin({rowStructs:null,destroyEvents:function(){this.destroySegPopover(),wt.prototype.destroyEvents.apply(this,arguments)},getEventSegs:function(){return wt.prototype.getEventSegs.call(this).concat(this.popoverSegs||[])},renderBgSegs:function(t){var e=z.grep(t,function(t){return t.event.allDay});return wt.prototype.renderBgSegs.call(this,e)},renderFgSegs:function(t){var n;return t=this.renderFgSegEls(t),n=this.rowStructs=this.renderSegRows(t),this.rowEls.each(function(t,e){z(e).find(".fc-content-skeleton > table").append(n[t].tbodyEl)}),t},destroyFgSegs:function(){for(var t,e=this.rowStructs||[];t=e.pop();)t.tbodyEl.remove();this.rowStructs=null},renderSegRows:function(t){var e,n,i=[];for(e=this.groupSegRows(t),n=0;n<e.length;n++)i.push(this.renderSegRow(n,e[n]));return i},fgSegHtml:function(t,e){var n,i,r=this.view,s=t.event,o=r.isEventDraggable(s),l=!e&&s.allDay&&t.isStart&&r.isEventResizableFromStart(s),a=!e&&s.allDay&&t.isEnd&&r.isEventResizableFromEnd(s),u=this.getSegClasses(t,o,l||a),c=F(this.getEventSkinCss(s)),d="";return u.unshift("fc-day-grid-event","fc-h-event"),t.isStart&&(n=this.getEventTimeText(s))&&(d='<span class="fc-time">'+R(n)+"</span>"),i='<span class="fc-title">'+(R(s.title||"")||" ")+"</span>",'<a class="'+u.join(" ")+'"'+(s.url?' href="'+R(s.url)+'"':"")+(c?' style="'+c+'"':"")+'><div class="fc-content">'+(this.isRTL?i+" "+d:d+" "+i)+"</div>"+(l?'<div class="fc-resizer fc-start-resizer" />':"")+(a?'<div class="fc-resizer fc-end-resizer" />':"")+"</a>"},renderSegRow:function(t,e){var n,i,r,s,o,l,a,u=this.colCnt,c=this.buildSegLevels(e),d=Math.max(1,c.length),h=z("<tbody/>"),f=[],g=[],p=[];function v(t){for(;r<t;)(a=(p[n-1]||[])[r])?a.attr("rowspan",parseInt(a.attr("rowspan")||1,10)+1):(a=z("<td/>"),s.append(a)),g[n][r]=a,p[n][r]=a,r++}for(n=0;n<d;n++){if(i=c[n],r=0,s=z("<tr/>"),f.push([]),g.push([]),p.push([]),i)for(o=0;o<i.length;o++){for(v((l=i[o]).leftCol),a=z('<td class="fc-event-container"/>').append(l.el),l.leftCol!=l.rightCol?a.attr("colspan",l.rightCol-l.leftCol+1):p[n][r]=a;r<=l.rightCol;)g[n][r]=a,f[n][r]=l,r++;s.append(a)}v(u),this.bookendCells(s,"eventSkeleton"),h.append(s)}return{row:t,tbodyEl:h,cellMatrix:g,segMatrix:f,segLevels:c,segs:e}},buildSegLevels:function(t){var e,n,i,r=[];for(t.sort(bt),e=0;e<t.length;e++){for(n=t[e],i=0;i<r.length&&Ct(n,r[i]);i++);(r[n.level=i]||(r[i]=[])).push(n)}for(i=0;i<r.length;i++)r[i].sort(Tt);return r},groupSegRows:function(t){var e,n=[];for(e=0;e<this.rowCnt;e++)n.push([]);for(e=0;e<t.length;e++)n[t[e].row].push(t[e]);return n}}),Dt.mixin({segPopover:null,popoverSegs:null,destroySegPopover:function(){this.segPopover&&this.segPopover.hide()},limitRows:function(t){var e,n,i=this.rowStructs||[];for(e=0;e<i.length;e++)this.unlimitRow(e),!1!==(n=!!t&&("number"==typeof t?t:this.computeRowLevelLimit(e)))&&this.limitRow(e,n)},computeRowLevelLimit:function(t){var e,n,i,r=this.rowEls.eq(t).height(),s=this.rowStructs[t].tbodyEl.children();function o(t,e){i=Math.max(i,z(e).outerHeight())}for(e=0;e<s.length;e++)if(n=s.eq(e).removeClass("fc-limited"),i=0,n.find("> td > :first-child").each(o),n.position().top+i>r)return e;return!1},limitRow:function(e,n){var i,t,r,s,o,l,a,u,c,d,h,f,g,p,v,m,y=this,w=this.rowStructs[e],E=[],S=0;function b(t){for(;S<t;)i=y.getCell(e,S),(a=y.getCellSegs(i,n)).length&&(d=r[n-1][S],m=y.renderMoreLink(i,a),v=z("<div/>").append(m),d.append(v),E.push(v[0])),S++}if(n&&n<w.segLevels.length){for(t=w.segLevels[n-1],r=w.cellMatrix,s=w.tbodyEl.children().slice(n).addClass("fc-limited").get(),o=0;o<t.length;o++){for(b((l=t[o]).leftCol),c=[],u=0;S<=l.rightCol;)i=this.getCell(e,S),a=this.getCellSegs(i,n),c.push(a),u+=a.length,S++;if(u){for(h=(d=r[n-1][l.leftCol]).attr("rowspan")||1,f=[],g=0;g<c.length;g++)p=z('<td class="fc-more-cell"/>').attr("rowspan",h),a=c[g],i=this.getCell(e,l.leftCol+g),m=this.renderMoreLink(i,[l].concat(a)),v=z("<div/>").append(m),p.append(v),f.push(p[0]),E.push(p[0]);d.addClass("fc-limited").after(z(f)),s.push(d[0])}}b(this.colCnt),w.moreEls=z(E),w.limitedEls=z(s)}},unlimitRow:function(t){var e=this.rowStructs[t];e.moreEls&&(e.moreEls.remove(),e.moreEls=null),e.limitedEls&&(e.limitedEls.removeClass("fc-limited"),e.limitedEls=null)},renderMoreLink:function(a,u){var c=this,d=this.view;return z('<a class="fc-more"/>').text(this.getMoreLinkText(u.length)).on("click",function(t){var e=d.opt("eventLimitClick"),n=a.start,i=z(this),r=c.getCellDayEl(a),s=c.getCellSegs(a),o=c.resliceDaySegs(s,n),l=c.resliceDaySegs(u,n);"function"==typeof e&&(e=d.trigger("eventLimitClick",null,{date:n,dayEl:r,moreEl:i,segs:o,hiddenSegs:l},t)),"popover"===e?c.showSegPopover(a,i,o):"string"==typeof e&&d.calendar.zoomTo(n,e)})},showSegPopover:function(t,e,n){var i,r,s=this,o=this.view,l=e.parent();i=1==this.rowCnt?o.el:this.rowEls.eq(t.row),r={className:"fc-more-popover",content:this.renderSegPopoverContent(t,n),parentEl:this.el,top:i.offset().top,autoHide:!0,viewportConstrain:o.opt("popoverViewportConstrain"),hide:function(){s.segPopover.destroy(),s.segPopover=null,s.popoverSegs=null}},this.isRTL?r.right=l.offset().left+l.outerWidth()+1:r.left=l.offset().left-1,this.segPopover=new dt(r),this.segPopover.show()},renderSegPopoverContent:function(t,e){var n,i=this.view,r=i.opt("theme"),s=t.start.format(i.opt("dayPopoverFormat")),o=z('<div class="fc-header '+i.widgetHeaderClass+'"><span class="fc-close '+(r?"ui-icon ui-icon-closethick":"fc-icon fc-icon-x")+'"></span><span class="fc-title">'+R(s)+'</span><div class="fc-clear"/></div><div class="fc-body '+i.widgetContentClass+'"><div class="fc-event-container"></div></div>'),l=o.find(".fc-event-container");for(e=this.renderFgSegEls(e,!0),this.popoverSegs=e,n=0;n<e.length;n++)e[n].cell=t,l.append(e[n].el);return o},resliceDaySegs:function(t,e){var n=z.map(t,function(t){return t.event}),i=e.clone().stripTime(),r=i.clone().add(1,"days"),s={start:i,end:r};return(t=this.eventsToSegs(n,function(t){var e=w(t,s);return e?[e]:[]})).sort(bt),t},getMoreLinkText:function(t){var e=this.view.opt("eventLimitText");return"function"==typeof e?e(t):"+"+t+" "+e},getCellSegs:function(t,e){for(var n,i=this.rowStructs[t.row].segMatrix,r=e||0,s=[];r<i.length;)(n=i[r][t.col])&&s.push(n),r++;return s}});var Ht=wt.extend({slotDuration:null,snapDuration:null,minTime:null,maxTime:null,axisFormat:null,dayEls:null,slatEls:null,slatTops:null,helperEl:null,businessHourSegs:null,constructor:function(){wt.apply(this,arguments),this.processOptions()},renderDates:function(){this.el.html(this.renderHtml()),this.dayEls=this.el.find(".fc-day"),this.slatEls=this.el.find(".fc-slats tr")},renderBusinessHours:function(){var t=this.view.calendar.getBusinessHoursEvents();this.businessHourSegs=this.renderFill("businessHours",this.eventsToSegs(t),"bgevent")},renderHtml:function(){return'<div class="fc-bg"><table>'+this.rowHtml("slotBg")+'</table></div><div class="fc-slats"><table>'+this.slatRowHtml()+"</table></div>"},slotBgCellHtml:function(t){return this.bgCellHtml(t)},slatRowHtml:function(){for(var t,e,n,i=this.view,r=this.isRTL,s="",o=this.slotDuration.asMinutes()%15==0,l=G.duration(+this.minTime);l<this.maxTime;)e=(t=this.start.clone().time(l)).minutes(),n='<td class="fc-axis fc-time '+i.widgetContentClass+'" '+i.axisStyleAttr()+">"+(o&&e?"":"<span>"+R(t.format(this.axisFormat))+"</span>")+"</td>",s+="<tr "+(e?'class="fc-minor"':"")+">"+(r?"":n)+'<td class="'+i.widgetContentClass+'"/>'+(r?n:"")+"</tr>",l.add(this.slotDuration);return s},processOptions:function(){var t=this.view,e=t.opt("slotDuration"),n=t.opt("snapDuration");e=G.duration(e),n=n?G.duration(n):e,this.slotDuration=e,this.snapDuration=n,this.cellDuration=n,this.minTime=G.duration(t.opt("minTime")),this.maxTime=G.duration(t.opt("maxTime")),this.axisFormat=t.opt("axisFormat")||t.opt("smallTimeFormat")},computeColHeadFormat:function(){return 1<this.colCnt?this.view.opt("dayOfMonthFormat"):"dddd"},computeEventTimeFormat:function(){return this.view.opt("noMeridiemTimeFormat")},computeDisplayEventEnd:function(){return!0},updateCells:function(){var t,e=this.view,n=[];for(t=this.start.clone();t.isBefore(this.end);)n.push({day:t.clone()}),t.add(1,"day"),t=e.skipHiddenDays(t);this.isRTL&&n.reverse(),this.colData=n,this.colCnt=n.length,this.rowCnt=Math.ceil((this.maxTime-this.minTime)/this.snapDuration)},computeCellDate:function(t){var e=this.computeSnapTime(t.row);return this.view.calendar.rezoneDate(t.day).time(e)},getColEl:function(t){return this.dayEls.eq(t)},computeSnapTime:function(t){return G.duration(this.minTime+this.snapDuration*t)},rangeToSegs:function(t){var e,n,i,r=this.colCnt,s=[];for(t={start:t.start.clone().stripZone(),end:t.end.clone().stripZone()},n=0;n<r;n++)(e=w(t,{start:(i=this.colData[n].day).clone().time(this.minTime),end:i.clone().time(this.maxTime)}))&&(e.col=n,s.push(e));return s},updateSize:function(t){this.computeSlatTops(),t&&this.updateSegVerticals()},computeRowCoords:function(){var t,e,n=this.el.offset().top,i=[];for(t=0;t<this.rowCnt;t++)e={top:n+this.computeTimeTop(this.computeSnapTime(t))},0<t&&(i[t-1].bottom=e.top),i.push(e);return e.bottom=e.top+this.computeTimeTop(this.computeSnapTime(t)),i},computeDateTop:function(t,e){return this.computeTimeTop(G.duration(t.clone().stripZone()-e.clone().stripTime()))},computeTimeTop:function(t){var e,n,i,r=(t-this.minTime)/this.slotDuration;return r=Math.max(0,r),n=(r=Math.min(this.slatEls.length,r))-(e=Math.floor(r)),i=this.slatTops[e],n?i+(this.slatTops[e+1]-i)*n:i},computeSlatTops:function(){var n,i=[];this.slatEls.each(function(t,e){n=z(e).position().top,i.push(n)}),i.push(n+this.slatEls.last().outerHeight()),this.slatTops=i},renderDrag:function(t,e){if(e)return this.renderRangeHelper(t,e),this.applyDragOpacity(this.helperEl),!0;this.renderHighlight(this.view.calendar.ensureVisibleEventRange(t))},destroyDrag:function(){this.destroyHelper(),this.destroyHighlight()},renderEventResize:function(t,e){this.renderRangeHelper(t,e)},destroyEventResize:function(){this.destroyHelper()},renderHelper:function(t,e){var n,i,r,s,o=this.eventsToSegs([t]);for(o=this.renderFgSegEls(o),n=this.renderSegTable(o),i=0;i<o.length;i++)r=o[i],e&&e.col===r.col&&(s=e.el,r.el.css({left:s.css("left"),right:s.css("right"),"margin-left":s.css("margin-left"),"margin-right":s.css("margin-right")}));this.helperEl=z('<div class="fc-helper-skeleton"/>').append(n).appendTo(this.el)},destroyHelper:function(){this.helperEl&&(this.helperEl.remove(),this.helperEl=null)},renderSelection:function(t){this.view.opt("selectHelper")?this.renderRangeHelper(t):this.renderHighlight(t)},destroySelection:function(){this.destroyHelper(),this.destroyHighlight()},renderFill:function(t,e,n){var i,r,s,o,l,a,u,c,d,h;if(e.length){for(e=this.renderFillSegEls(t,e),i=this.groupSegCols(e),n=n||t.toLowerCase(),s=(r=z('<div class="fc-'+n+'-skeleton"><table><tr/></table></div>')).find("tr"),o=0;o<i.length;o++)if(l=i[o],a=z("<td/>").appendTo(s),l.length)for(u=z('<div class="fc-'+n+'-container"/>').appendTo(a),c=this.colData[o].day,d=0;d<l.length;d++)h=l[d],u.append(h.el.css({top:this.computeDateTop(h.start,c),bottom:-this.computeDateTop(h.end,c)}));this.bookendCells(s,t),this.el.append(r),this.elsByFill[t]=r}return e}});function xt(t){var e,n,i;if(t.sort(bt),function(t){var e,n,i,r,s;for(e=0;e<t.length;e++)for(n=t[e],i=0;i<n.length;i++)for((r=n[i]).forwardSegs=[],s=e+1;s<t.length;s++)Mt(r,t[s],r.forwardSegs)}(e=function(t){var e,n,i,r=[];for(e=0;e<t.length;e++){for(n=t[e],i=0;i<r.length&&Mt(n,r[i]).length;i++);n.level=i,(r[i]||(r[i]=[])).push(n)}return r}(t)),n=e[0]){for(i=0;i<n.length;i++)Rt(n[i]);for(i=0;i<n.length;i++)kt(n[i],0,0)}}function Rt(t){var e,n,i=t.forwardSegs,r=0;if(void 0===t.forwardPressure){for(e=0;e<i.length;e++)Rt(n=i[e]),r=Math.max(r,1+n.forwardPressure);t.forwardPressure=r}}function kt(t,e,n){var i,r=t.forwardSegs;if(void 0===t.forwardCoord)for(r.length?(r.sort(Ft),kt(r[0],e+1,n),t.forwardCoord=r[0].backwardCoord):t.forwardCoord=1,t.backwardCoord=t.forwardCoord-(t.forwardCoord-n)/(e+1),i=0;i<r.length;i++)kt(r[i],0,t.forwardCoord)}function Mt(t,e,n){n=n||[];for(var i=0;i<e.length;i++)r=t,s=e[i],r.bottom>s.top&&r.top<s.bottom&&n.push(e[i]);var r,s;return n}function Ft(t,e){return e.forwardPressure-t.forwardPressure||(t.backwardCoord||0)-(e.backwardCoord||0)||bt(t,e)}Ht.mixin({eventSkeletonEl:null,renderFgSegs:function(t){return t=this.renderFgSegEls(t),this.el.append(this.eventSkeletonEl=z('<div class="fc-content-skeleton"/>').append(this.renderSegTable(t))),t},destroyFgSegs:function(t){this.eventSkeletonEl&&(this.eventSkeletonEl.remove(),this.eventSkeletonEl=null)},renderSegTable:function(t){var e,n,i,r,s,o,l=z("<table><tr/></table>"),a=l.find("tr");for(e=this.groupSegCols(t),this.computeSegVerticals(t),r=0;r<e.length;r++){for(xt(s=e[r]),o=z('<div class="fc-event-container"/>'),n=0;n<s.length;n++)(i=s[n]).el.css(this.generateSegPositionCss(i)),i.bottom-i.top<30&&i.el.addClass("fc-short"),o.append(i.el);a.append(z("<td/>").append(o))}return this.bookendCells(a,"eventSkeleton"),l},updateSegVerticals:function(){var t,e=(this.segs||[]).concat(this.businessHourSegs||[]);for(this.computeSegVerticals(e),t=0;t<e.length;t++)e[t].el.css(this.generateSegVerticalCss(e[t]))},computeSegVerticals:function(t){var e,n;for(e=0;e<t.length;e++)(n=t[e]).top=this.computeDateTop(n.start,n.start),n.bottom=this.computeDateTop(n.end,n.start)},fgSegHtml:function(t,e){var n,i,r,s=this.view,o=t.event,l=s.isEventDraggable(o),a=!e&&t.isStart&&s.isEventResizableFromStart(o),u=!e&&t.isEnd&&s.isEventResizableFromEnd(o),c=this.getSegClasses(t,l,a||u),d=F(this.getEventSkinCss(o));return c.unshift("fc-time-grid-event","fc-v-event"),s.isMultiDayEvent(o)?(t.isStart||t.isEnd)&&(n=this.getEventTimeText(t),i=this.getEventTimeText(t,"LT"),r=this.getEventTimeText(t,null,!1)):(n=this.getEventTimeText(o),i=this.getEventTimeText(o,"LT"),r=this.getEventTimeText(o,null,!1)),'<a class="'+c.join(" ")+'"'+(o.url?' href="'+R(o.url)+'"':"")+(d?' style="'+d+'"':"")+'><div class="fc-content">'+(n?'<div class="fc-time" data-start="'+R(r)+'" data-full="'+R(i)+'"><span>'+R(n)+"</span></div>":"")+(o.title?'<div class="fc-title">'+R(o.title)+"</div>":"")+'</div><div class="fc-bg"/>'+(u?'<div class="fc-resizer fc-end-resizer" />':"")+"</a>"},generateSegPositionCss:function(t){var e,n,i=this.view.opt("slotEventOverlap"),r=t.backwardCoord,s=t.forwardCoord,o=this.generateSegVerticalCss(t);return i&&(s=Math.min(1,r+2*(s-r))),n=this.isRTL?(e=1-s,r):(e=r,1-s),o.zIndex=t.level+1,o.left=100*e+"%",o.right=100*n+"%",i&&t.forwardPressure&&(o[this.isRTL?"marginLeft":"marginRight"]=20),o},generateSegVerticalCss:function(t){return{top:t.top,bottom:-t.bottom}},groupSegCols:function(t){var e,n=[];for(e=0;e<this.colCnt;e++)n.push([]);for(e=0;e<t.length;e++)n[t[e].col].push(t[e]);return n}});var zt=L.View=ct.extend({type:null,name:null,title:null,calendar:null,options:null,coordMap:null,el:null,isDisplayed:!1,isSkeletonRendered:!1,isEventsRendered:!1,start:null,end:null,intervalStart:null,intervalEnd:null,intervalDuration:null,intervalUnit:null,isSelected:!1,scrollerEl:null,scrollTop:null,widgetHeaderClass:null,widgetContentClass:null,highlightStateClass:null,nextDayThreshold:null,isHiddenDayHash:null,documentMousedownProxy:null,constructor:function(t,e,n,i){this.calendar=t,this.type=this.name=e,this.options=n,this.intervalDuration=i||G.duration(1,"day"),this.nextDayThreshold=G.duration(this.opt("nextDayThreshold")),this.initThemingProps(),this.initHiddenDays(),this.documentMousedownProxy=Y(this,"documentMousedown"),this.initialize()},initialize:function(){},opt:function(t){return this.options[t]},trigger:function(t,e){var n=this.calendar;return n.trigger.apply(n,[t,e||this].concat(Array.prototype.slice.call(arguments,2),[this]))},setDate:function(t){this.setRange(this.computeRange(t))},setRange:function(t){z.extend(this,t),this.updateTitle()},computeRange:function(t){var e,n,i=b(this.intervalDuration),r=t.clone().startOf(i),s=r.clone().add(this.intervalDuration);return/year|month|week|day/.test(i)?(r.stripTime(),s.stripTime()):(r.hasTime()||(r=this.calendar.rezoneDate(r)),s.hasTime()||(s=this.calendar.rezoneDate(s))),e=r.clone(),e=this.skipHiddenDays(e),n=s.clone(),{intervalUnit:i,intervalStart:r,intervalEnd:s,start:e,end:n=this.skipHiddenDays(n,-1,!0)}},computePrevDate:function(t){return this.massageCurrentDate(t.clone().startOf(this.intervalUnit).subtract(this.intervalDuration),-1)},computeNextDate:function(t){return this.massageCurrentDate(t.clone().startOf(this.intervalUnit).add(this.intervalDuration))},massageCurrentDate:function(t,e){return this.intervalDuration.as("days")<=1&&this.isHiddenDay(t)&&(t=this.skipHiddenDays(t,e)).startOf("day"),t},updateTitle:function(){this.title=this.computeTitle()},computeTitle:function(){return this.formatRange({start:this.intervalStart,end:this.intervalEnd},this.opt("titleFormat")||this.computeTitleFormat(),this.opt("titleRangeSeparator"))},computeTitleFormat:function(){return"year"==this.intervalUnit?"YYYY":"month"==this.intervalUnit?this.opt("monthYearFormat"):1<this.intervalDuration.as("days")?"ll":"LL"},formatRange:function(t,e,n){var i=t.end;return i.hasTime()||(i=i.clone().subtract(1)),st(t.start,i,e,n,this.opt("isRTL"))},setElement:function(t){this.el=t,this.bindGlobalHandlers()},removeElement:function(){this.clear(),this.isSkeletonRendered&&(this.destroySkeleton(),this.isSkeletonRendered=!1),this.unbindGlobalHandlers(),this.el.remove()},display:function(t){var e=null;this.isDisplayed&&(e=this.queryScroll()),this.clear(),this.setDate(t),this.render(),this.updateSize(),this.renderBusinessHours(),this.isDisplayed=!0,e=this.computeInitialScroll(e),this.forceScroll(e),this.triggerRender()},clear:function(){this.isDisplayed&&(this.unselect(),this.clearEvents(),this.triggerDestroy(),this.destroyBusinessHours(),this.destroy(),this.isDisplayed=!1)},render:function(){this.isSkeletonRendered||(this.renderSkeleton(),this.isSkeletonRendered=!0),this.renderDates()},destroy:function(){this.destroyDates()},renderSkeleton:function(){},destroySkeleton:function(){},renderDates:function(){},destroyDates:function(){},renderBusinessHours:function(){},destroyBusinessHours:function(){},triggerRender:function(){this.trigger("viewRender",this,this,this.el)},triggerDestroy:function(){this.trigger("viewDestroy",this,this,this.el)},bindGlobalHandlers:function(){z(document).on("mousedown",this.documentMousedownProxy)},unbindGlobalHandlers:function(){z(document).off("mousedown",this.documentMousedownProxy)},initThemingProps:function(){var t=this.opt("theme")?"ui":"fc";this.widgetHeaderClass=t+"-widget-header",this.widgetContentClass=t+"-widget-content",this.highlightStateClass=t+"-state-highlight"},updateSize:function(t){var e;t&&(e=this.queryScroll()),this.updateHeight(),this.updateWidth(),t&&this.setScroll(e)},updateWidth:function(){},updateHeight:function(){var t=this.calendar;this.setHeight(t.getSuggestedViewHeight(),t.isHeightAuto())},setHeight:function(t,e){},computeScrollerHeight:function(t){var e,n,i=this.scrollerEl;return(e=this.el.add(i)).css({position:"relative",left:-1}),n=this.el.outerHeight()-i.height(),e.css({position:"",left:""}),t-n},computeInitialScroll:function(t){return 0},queryScroll:function(){if(this.scrollerEl)return this.scrollerEl.scrollTop()},setScroll:function(t){if(this.scrollerEl)return this.scrollerEl.scrollTop(t)},forceScroll:function(t){var e=this;this.setScroll(t),setTimeout(function(){e.setScroll(t)},0)},displayEvents:function(t){var e=this.queryScroll();this.clearEvents(),this.renderEvents(t),this.isEventsRendered=!0,this.setScroll(e),this.triggerEventRender()},clearEvents:function(){this.isEventsRendered&&(this.triggerEventDestroy(),this.destroyEvents(),this.isEventsRendered=!1)},renderEvents:function(t){},destroyEvents:function(){},triggerEventRender:function(){this.renderedEventSegEach(function(t){this.trigger("eventAfterRender",t.event,t.event,t.el)}),this.trigger("eventAfterAllRender")},triggerEventDestroy:function(){this.renderedEventSegEach(function(t){this.trigger("eventDestroy",t.event,t.event,t.el)})},resolveEventEl:function(t,e){var n=this.trigger("eventRender",t,t,e);return!1===n?e=null:n&&!0!==n&&(e=z(n)),e},showEvent:function(t){this.renderedEventSegEach(function(t){t.el.css("visibility","")},t)},hideEvent:function(t){this.renderedEventSegEach(function(t){t.el.css("visibility","hidden")},t)},renderedEventSegEach:function(t,e){var n,i=this.getEventSegs();for(n=0;n<i.length;n++)e&&i[n].event._id!==e._id||i[n].el&&t.call(this,i[n])},getEventSegs:function(){return[]},isEventDraggable:function(t){var e=t.source||{};return O(t.startEditable,e.startEditable,this.opt("eventStartEditable"),t.editable,e.editable,this.opt("editable"))},reportEventDrop:function(t,e,n,i,r){var s=this.calendar,o=s.mutateEvent(t,e,n);this.triggerEventDrop(t,o.dateDelta,function(){o.undo(),s.reportEventChange()},i,r),s.reportEventChange()},triggerEventDrop:function(t,e,n,i,r){this.trigger("eventDrop",i[0],t,e,n,r,{})},reportExternalDrop:function(t,e,n,i,r){var s,o,l=t.eventProps;l&&(s=z.extend({},l,e),o=this.calendar.renderEvent(s,t.stick)[0]),this.triggerExternalDrop(o,e,n,i,r)},triggerExternalDrop:function(t,e,n,i,r){this.trigger("drop",n[0],e.start,i,r),t&&this.trigger("eventReceive",null,t)},renderDrag:function(t,e){},destroyDrag:function(){},isEventResizableFromStart:function(t){return this.opt("eventResizableFromStart")&&this.isEventResizable(t)},isEventResizableFromEnd:function(t){return this.isEventResizable(t)},isEventResizable:function(t){var e=t.source||{};return O(t.durationEditable,e.durationEditable,this.opt("eventDurationEditable"),t.editable,e.editable,this.opt("editable"))},reportEventResize:function(t,e,n,i,r){var s=this.calendar,o=s.mutateEvent(t,e,n);this.triggerEventResize(t,o.durationDelta,function(){o.undo(),s.reportEventChange()},i,r),s.reportEventChange()},triggerEventResize:function(t,e,n,i,r){this.trigger("eventResize",i[0],t,e,n,r,{})},select:function(t,e){this.unselect(e),this.renderSelection(t),this.reportSelection(t,e)},renderSelection:function(t){},reportSelection:function(t,e){this.isSelected=!0,this.trigger("select",null,t.start,t.end,e)},unselect:function(t){this.isSelected&&(this.isSelected=!1,this.destroySelection(),this.trigger("unselect",null,t))},destroySelection:function(){},documentMousedown:function(t){var e;this.isSelected&&this.opt("unselectAuto")&&y(t)&&((e=this.opt("unselectCancel"))&&z(t.target).closest(e).length||this.unselect(t))},initHiddenDays:function(){var t,e=this.opt("hiddenDays")||[],n=[],i=0;for(!1===this.opt("weekends")&&e.push(0,6),t=0;t<7;t++)(n[t]=-1!==z.inArray(t,e))||i++;if(!i)throw"invalid hiddenDays";this.isHiddenDayHash=n},isHiddenDay:function(t){return G.isMoment(t)&&(t=t.day()),this.isHiddenDayHash[t]},skipHiddenDays:function(t,e,n){var i=t.clone();for(e=e||1;this.isHiddenDayHash[(i.day()+(n?e:0)+7)%7];)i.add(e,"days");return i},computeDayRange:function(t){var e,n=t.start.clone().stripTime(),i=t.end,r=null;return i&&(r=i.clone().stripTime(),(e=+i.time())&&e>=this.nextDayThreshold&&r.add(1,"days")),(!i||r<=n)&&(r=n.clone().add(1,"days")),{start:n,end:r}},isMultiDayEvent:function(t){var e=this.computeDayRange(t);return 1<e.end.diff(e.start,"days")}}),Gt=L.Calendar=L.CalendarBase=ct.extend({dirDefaults:null,langDefaults:null,overrides:null,options:null,viewSpecCache:null,view:null,header:null,constructor:function(t,e){var i=this;i.initOptions(e||{});var n=this.options;i.render=function(){a?w()&&(b(),E()):function(){n.theme,t.addClass("fc"),n.isRTL?t.addClass("fc-rtl"):t.addClass("fc-ltr");n.theme?t.addClass("ui-widget"):t.addClass("fc-unthemed");a=z("<div class='fc-view-container'/>").prependTo(t),o=i.header=new Nt(i,n),(l=o.render())&&t.prepend(l);E(n.defaultView),n.handleWindowResize&&(d=I(C,n.windowResizeDelay),z(window).resize(d))}()},i.destroy=function(){u&&u.removeElement();o.destroy(),a.remove(),t.removeClass("fc fc-ltr fc-rtl fc-unthemed ui-widget"),d&&z(window).unbind("resize",d)},i.refetchEvents=function(){x(),u.clearEvents(),R(),H()},i.reportEvents=function(t){y=t,T()},i.reportEventChange=function(){T()},i.rerenderEvents=T,i.changeView=E,i.select=function(t,e){t=i.moment(t),e=e?i.moment(e):t.hasTime()?t.clone().add(i.defaultTimedEventDuration):t.clone().add(i.defaultAllDayEventDuration);u.select({start:t,end:e})},i.unselect=function(){u&&u.unselect()},i.prev=function(){h=u.computePrevDate(h),E()},i.next=function(){h=u.computeNextDate(h),E()},i.prevYear=function(){h.add(-1,"years"),E()},i.nextYear=function(){h.add(1,"years"),E()},i.today=function(){h=i.getNow(),E()},i.gotoDate=function(t){h=i.moment(t),E()},i.incrementDate=function(t){h.add(G.duration(t)),E()},i.zoomTo=function(t,e){var n;e=e||"day",n=i.getViewSpec(e)||i.getUnitViewSpec(e),h=t,E(n?n.type:null)},i.getDate=function(){return h.clone()},i.getCalendar=function(){return i},i.getView=function(){return u},i.option=function(t,e){if(void 0===e)return n[t];"height"!=t&&"contentHeight"!=t&&"aspectRatio"!=t||(n[t]=e,S(!0))},i.trigger=function(t,e){if(n[t])return n[t].apply(e||p,Array.prototype.slice.call(arguments,2))};var r=k(Ot(n.lang));n.monthNames&&(r._months=n.monthNames);n.monthNamesShort&&(r._monthsShort=n.monthNamesShort);n.dayNames&&(r._weekdays=n.dayNames);n.dayNamesShort&&(r._weekdaysShort=n.dayNamesShort);if(null!=n.firstDay){var s=k(r._week);s.dow=n.firstDay,r._week=s}r._fullCalendar_weekCalc=function(t){return"function"==typeof t||"local"===t?t:"iso"===t||"ISO"===t?"ISO":void 0}(n.weekNumberCalculation),i.defaultAllDayEventDuration=G.duration(n.defaultAllDayEventDuration),i.defaultTimedEventDuration=G.duration(n.defaultTimedEventDuration),i.moment=function(){var t;return"local"===n.timezone?(t=L.moment.apply(null,arguments)).hasTime()&&t.local():t="UTC"===n.timezone?L.moment.utc.apply(null,arguments):L.moment.parseZone.apply(null,arguments),"_locale"in t?t._locale=r:t._lang=r,t},i.getIsAmbigTimezone=function(){return"local"!==n.timezone&&"UTC"!==n.timezone},i.rezoneDate=function(t){return i.moment(t.toArray())},i.getNow=function(){var t=n.now;return"function"==typeof t&&(t=t()),i.moment(t)},i.getEventEnd=function(t){return t.end?t.end.clone():i.getDefaultEventEnd(t.allDay,t.start)},i.getDefaultEventEnd=function(t,e){var n=e.clone();return t?n.stripTime().add(i.defaultAllDayEventDuration):n.add(i.defaultTimedEventDuration),i.getIsAmbigTimezone()&&n.stripZone(),n},i.humanizeDuration=function(t){return(t.locale||t.lang).call(t,n.lang).humanize()},function(v){var w=this;w.isFetchNeeded=function(t,e){return!m||t.clone().stripZone()<m.clone().stripZone()||e.clone().stripZone()>y.clone().stripZone()},w.fetchEvents=function(t,e){m=t,y=e,c=[];var n=++a,i=s.length;u=i;for(var r=0;r<i;r++)d(s[r],n)},w.addEventSource=function(t){var e=i(t);e&&(s.push(e),u++,d(e,a))},w.removeEventSource=function(e){s=z.grep(s,function(t){return!r(t,e)}),c=z.grep(c,function(t){return!r(t.source,e)}),l(c)},w.updateEvent=function(t){t.start=w.moment(t.start),t.end?t.end=w.moment(t.end):t.end=null;x(t,function(t){var i={};return z.each(t,function(t,e){var n;f(t)&&void 0!==e&&(n=e,/undefined|null|boolean|number|string/.test(z.type(n)))&&(i[t]=e)}),i}(t)),l(c)},w.renderEvent=function(t,e){var n,i,r,s=D(t);if(s){for(n=H(s),i=0;i<n.length;i++)(r=n[i]).source||(e&&(o.events.push(r),r.source=o),c.push(r));return l(c),n}return[]},w.removeEvents=function(t){var e,n;null==t?t=function(){return!0}:z.isFunction(t)||(e=t+"",t=function(t){return t._id==e});for(c=z.grep(c,t,!0),n=0;n<s.length;n++)z.isArray(s[n].events)&&(s[n].events=z.grep(s[n].events,t,!0));l(c)},w.clientEvents=E,w.mutateEvent=x,w.normalizeEventRange=p,w.normalizeEventRangeTimes=C,w.ensureVisibleEventRange=T;var m,y,t=w.trigger,e=w.getView,l=w.reportEvents,o={events:[]},s=[o],a=0,u=0,n=0,c=[];function d(s,o){!function t(e,n){var i;var r=L.sourceFetchers;var s;for(i=0;i<r.length;i++){if(!0===(s=r[i].call(w,e,m.clone(),y.clone(),v.timezone,n)))return;if("object"==typeof s)return void t(s,n)}var o=e.events;if(o)z.isFunction(o)?(S(),o.call(w,m.clone(),y.clone(),v.timezone,function(t){n(t),b()})):z.isArray(o)?n(o):n();else{var l=e.url;if(l){var a,u=e.success,c=e.error,d=e.complete;a=z.isFunction(e.data)?e.data():e.data;var h=z.extend({},a||{}),f=O(e.startParam,v.startParam),g=O(e.endParam,v.endParam),p=O(e.timezoneParam,v.timezoneParam);f&&(h[f]=m.format()),g&&(h[g]=y.format()),v.timezone&&"local"!=v.timezone&&(h[p]=v.timezone),S(),z.ajax(z.extend({},Bt,e,{data:h,success:function(t){t=t||[];var e=A(u,this,arguments);z.isArray(e)&&(t=e),n(t)},error:function(){A(c,this,arguments),n()},complete:function(){A(d,this,arguments),b()}}))}else n()}}(s,function(t){var e,n,i,r=z.isArray(s.events);if(o==a){if(t)for(e=0;e<t.length;e++)n=t[e],(i=r?n:D(n,s))&&c.push.apply(c,H(i));--u||l(c)}})}function i(t){var e,n,i=L.sourceNormalizers;if(z.isFunction(t)||z.isArray(t)?e={events:t}:"string"==typeof t?e={url:t}:"object"==typeof t&&(e=z.extend({},t)),e){for(e.className?"string"==typeof e.className&&(e.className=e.className.split(/\s+/)):e.className=[],z.isArray(e.events)&&(e.origArray=e.events,e.events=z.map(e.events,function(t){return D(t,e)})),n=0;n<i.length;n++)i[n].call(w,e);return e}}function r(t,e){return t&&e&&h(t)==h(e)}function h(t){return("object"==typeof t?t.origArray||t.googleCalendarId||t.url||t.events:null)||t}function f(t){return!/^_|^(id|allDay|start|end)$/.test(t)}function E(e){return z.isFunction(e)?z.grep(c,e):null!=e?(e+="",z.grep(c,function(t){return t._id==e})):c}function S(){n++||t("loading",null,!0,e())}function b(){--n||t("loading",null,!1,e())}function D(t,e){var n,i,r,s={};if(v.eventDataTransform&&(t=v.eventDataTransform(t)),e&&e.eventDataTransform&&(t=e.eventDataTransform(t)),z.extend(s,t),e&&(s.source=e),s._id=t._id||(void 0===t.id?"_fc"+Yt++:t.id+""),t.className?"string"==typeof t.className?s.className=t.className.split(/\s+/):s.className=t.className:s.className=[],n=t.start||t.date,i=t.end,V(n)&&(n=G.duration(n)),V(i)&&(i=G.duration(i)),t.dow||G.isDuration(n)||G.isDuration(i))s.start=n?G.duration(n):null,s.end=i?G.duration(i):null,s._recurring=!0;else{if(n&&!(n=w.moment(n)).isValid())return!1;i&&((i=w.moment(i)).isValid()||(i=null)),void 0===(r=t.allDay)&&(r=O(e?e.allDayDefault:void 0,v.allDayDefault)),g(n,i,r,s)}return s}function g(t,e,n,i){i.start=t,i.end=e,i.allDay=n,p(i),It(i)}function p(t){C(t),t.end&&!t.end.isAfter(t.start)&&(t.end=null),t.end||(v.forceEventDuration?t.end=w.getDefaultEventEnd(t.allDay,t.start):t.end=null)}function C(t){null==t.allDay&&(t.allDay=!(t.start.hasTime()||t.end&&t.end.hasTime())),t.allDay?(t.start.stripTime(),t.end&&t.end.stripTime()):(t.start.hasTime()||(t.start=w.rezoneDate(t.start)),t.end&&!t.end.hasTime()&&(t.end=w.rezoneDate(t.end)))}function T(t){var e;return t.end||(null==(e=t.allDay)&&(e=!t.start.hasTime()),(t=z.extend({},t)).end=w.getDefaultEventEnd(e,t.start)),t}function H(t,e,n){var i,r,s,o,l,a,u,c,d,h=[];if(e=e||m,n=n||y,t)if(t._recurring){if(r=t.dow)for(i={},s=0;s<r.length;s++)i[r[s]]=!0;for(o=e.clone().stripTime();o.isBefore(n);)i&&!i[o.day()]||(l=t.start,a=t.end,u=o.clone(),c=null,l&&(u=u.time(l)),a&&(c=o.clone().time(a)),g(u,c,!l&&!a,d=z.extend({},t)),h.push(d)),o.add(1,"days")}else h.push(t);return h}function x(t,r,s){var e,n,i,o,l={};function a(t,e){return s?P(t,e,s):r.allDay?(n=t,i=e,G.duration({days:n.clone().stripTime().diff(i.clone().stripTime(),"days")})):_(t,e);var n,i}return(r=r||{}).start||(r.start=t.start.clone()),void 0===r.end&&(r.end=t.end?t.end.clone():null),null==r.allDay&&(r.allDay=t.allDay),p(r),p(e={start:t._start.clone(),end:t._end?t._end.clone():w.getDefaultEventEnd(t._allDay,t._start),allDay:r.allDay}),n=null!==t._end&&null===r.end,i=a(r.start,e.start),o=r.end?a(r.end,e.end).subtract(i):null,z.each(r,function(t,e){f(t)&&void 0!==e&&(l[t]=e)}),{dateDelta:i,durationDelta:o,undo:function(t,r,s,o,l,a){var u=w.getIsAmbigTimezone(),c=[];o&&!o.valueOf()&&(o=null);l&&!l.valueOf()&&(l=null);return z.each(t,function(t,e){var n,i;n={start:e.start.clone(),end:e.end?e.end.clone():null,allDay:e.allDay},z.each(a,function(t){n[t]=e[t]}),p(i={start:e._start,end:e._end,allDay:s}),r?i.end=null:l&&!i.end&&(i.end=w.getDefaultEventEnd(i.allDay,i.start)),o&&(i.start.add(o),i.end&&i.end.add(o)),l&&i.end.add(l),u&&!i.allDay&&(o||l)&&(i.start.stripZone(),i.end&&i.end.stripZone()),z.extend(e,a,i),It(e),c.push(function(){z.extend(e,n),It(e)})}),function(){for(var t=0;t<c.length;t++)c[t]()}}(E(t._id),n,r.allDay,i,o,l)}}function R(t){var e,n=v.businessHours,i=w.getView();return n&&(e=z.extend({},{className:"fc-nonbusiness",start:"09:00",end:"17:00",dow:[1,2,3,4,5],rendering:"inverse-background"},"object"==typeof n?n:{})),e?(t&&(e.start=null,e.end=null),H(D(e),i.start,i.end)):[]}function k(t,e){var n=e.source||{},i=O(e.constraint,n.constraint,v.eventConstraint),r=O(e.overlap,n.overlap,v.eventOverlap);return F(t=T(t),i,r,e)}function M(t){return F(t,v.selectConstraint,v.selectOverlap)}function F(t,e,n,i){var r,s,o,l,a,u,c,d,h,f,g,p,v,m,y;if((t=z.extend({},t)).start=t.start.clone().stripZone(),t.end=t.end.clone().stripZone(),null!=e){for(r="businessHours"!==(g=e)?"object"!=typeof g?E(g):H(D(g)):R(),s=!1,l=0;l<r.length;l++)if(c=r[l],d=t,0,h=c.start.clone().stripZone(),f=w.getEventEnd(c).stripZone(),d.start>=h&&d.end<=f){s=!0;break}if(!s)return!1}for(o=w.getPeerEvents(i,t),l=0;l<o.length;l++)if(a=o[l],v=t,0,m=(p=a).start.clone().stripZone(),y=w.getEventEnd(p).stripZone(),v.start<y&&v.end>m){if(!1===n)return!1;if("function"==typeof n&&!n(a,i))return!1;if(i){if(!1===(u=O(a.overlap,(a.source||{}).overlap)))return!1;if("function"==typeof u&&!u(i,a))return!1}}return!0}z.each((v.events?[v.events]:[]).concat(v.eventSources||[]),function(t,e){var n=i(e);n&&s.push(n)}),w.getBusinessHoursEvents=R,w.isEventRangeAllowed=k,w.isSelectionRangeAllowed=M,w.isExternalDropRangeAllowed=function(t,e){var n;return e&&(n=H(D(z.extend({},e,t)))[0]),n?k(t,n):M(t=T(t))},w.getEventCache=function(){return c}}.call(i,n);var o,l,a,u,c,d,h,f=i.isFetchNeeded,g=i.fetchEvents,p=t[0],v={},m=0,y=[];h=null!=n.defaultDate?i.moment(n.defaultDate):i.getNow();function w(){return t.is(":visible")}function E(t){m++,u&&t&&u.type!==t&&(o.deactivateButton(u.type),x(),u.removeElement(),u=i.view=null),!u&&t&&((u=i.view=v[t]||(v[t]=i.instantiateView(t))).setElement(z("<div class='fc-view fc-"+t+"-view' />").appendTo(a)),o.activateButton(t)),u&&(h=u.massageCurrentDate(h),u.isDisplayed&&h.isWithin(u.intervalStart,u.intervalEnd)||w()&&(x(),u.display(h),R(),o.updateTitle(u.title),i.getNow().isWithin(u.intervalStart,u.intervalEnd)?o.disableButton("today"):o.enableButton("today"),(!n.lazyFetching||f(u.start,u.end)?H:T)())),R(),m--}function S(t){return w()&&(t&&D(),m++,u.updateSize(!0),m--,1)}function b(){w()&&D()}function D(){c="number"==typeof n.contentHeight?n.contentHeight:"number"==typeof n.height?n.height-(l?l.outerHeight(!0):0):Math.round(a.width()/Math.max(n.aspectRatio,.5))}function C(t){!m&&t.target===window&&u.start&&S(!0)&&u.trigger("windowResize",p)}function T(){w()&&(x(),u.displayEvents(y),R())}function H(){g(u.start,u.end)}function x(){a.css({width:"100%",height:a.height(),overflow:"hidden"})}function R(){a.css({width:"",height:"",overflow:""})}i.getSuggestedViewHeight=function(){return void 0===c&&b(),c},i.isHeightAuto=function(){return"auto"===n.contentHeight||"auto"===n.height}},initOptions:function(t){var e,n,i,r,s,o;o={views:(r=t).views||{}},z.each(r,function(n,t){"views"!=n&&(z.isPlainObject(t)&&!/(time|duration|interval)$/i.test(n)&&-1==z.inArray(n,l)?(s=null,z.each(t,function(t,e){/^(month|week|day|default|basic(Week|Day)?|agenda(Week|Day)?)$/.test(t)?(o.views[t]||(o.views[t]={}),o.views[t][n]=e):(s=s||{})[t]=e}),s&&(o[n]=s)):o[n]=t)}),e=(t=o).lang,(n=Lt[e])||(e=Gt.defaults.lang,n=Lt[e]||{}),i=O(t.isRTL,n.isRTL,Gt.defaults.isRTL)?Gt.rtlDefaults:{},this.dirDefaults=i,this.langDefaults=n,this.overrides=t,this.options=h(Gt.defaults,i,n,t),At(this.options),this.viewSpecCache={}},getViewSpec:function(t){var e=this.viewSpecCache;return e[t]||(e[t]=this.buildViewSpec(t))},getUnitViewSpec:function(t){var e,n,i;if(-1!=z.inArray(t,S))for(e=this.header.getViewsWithButtons(),z.each(L.views,function(t){e.push(t)}),n=0;n<e.length;n++)if((i=this.getViewSpec(e[n]))&&i.singleUnit==t)return i},buildViewSpec:function(t){for(var e,n,i,r,s,o,l=this.overrides.views||{},a=[],u=[],c=t;c&&!e;)n=d[c]||{},i=l[c]||{},r=r||i.duration||n.duration,c=i.type||n.type,"function"==typeof n?(e=n,a.unshift(e.defaults||{})):a.unshift(n),u.unshift(i);if(e)return o={class:e,type:t},r&&((r=G.duration(r)).valueOf()||(r=null)),r&&(s=b(o.duration=r),1===r.as(s)&&(o.singleUnit=s,u.unshift(l[s]||{}))),o.defaults=h.apply(null,a),o.overrides=h.apply(null,u),this.buildViewSpecOptions(o),this.buildViewSpecButtonText(o,t),o},buildViewSpecOptions:function(t){t.options=h(Gt.defaults,t.defaults,this.dirDefaults,this.langDefaults,this.overrides,t.overrides),At(t.options)},buildViewSpecButtonText:function(n,i){function t(t){var e=t.buttonText||{};return e[i]||(n.singleUnit?e[n.singleUnit]:null)}n.buttonTextOverride=t(this.overrides)||n.overrides.buttonText,n.buttonTextDefault=t(this.langDefaults)||t(this.dirDefaults)||n.defaults.buttonText||t(Gt.defaults)||(n.duration?this.humanizeDuration(n.duration):null)||i},instantiateView:function(t){var e=this.getViewSpec(t);return new e.class(this,t,e.options,e.duration)},isValidViewType:function(t){return Boolean(this.getViewSpec(t))}});Gt.defaults={titleRangeSeparator:" — ",monthYearFormat:"MMMM YYYY",defaultTimedEventDuration:"02:00:00",defaultAllDayEventDuration:{days:1},forceEventDuration:!1,nextDayThreshold:"09:00:00",defaultView:"month",aspectRatio:1.35,header:{left:"title",center:"",right:"today prev,next"},weekends:!0,weekNumbers:!1,weekNumberTitle:"W",weekNumberCalculation:"local",lazyFetching:!0,startParam:"start",endParam:"end",timezoneParam:"timezone",timezone:!1,isRTL:!1,buttonText:{prev:"prev",next:"next",prevYear:"prev year",nextYear:"next year",year:"year",today:"today",month:"month",week:"week",day:"day"},buttonIcons:{prev:"left-single-arrow",next:"right-single-arrow",prevYear:"left-double-arrow",nextYear:"right-double-arrow"},theme:!1,themeButtonIcons:{prev:"circle-triangle-w",next:"circle-triangle-e",prevYear:"seek-prev",nextYear:"seek-next"},dragOpacity:.75,dragRevertDuration:500,dragScroll:!0,unselectAuto:!0,dropAccept:"*",eventLimit:!1,eventLimitText:"more",eventLimitClick:"popover",dayPopoverFormat:"LL",handleWindowResize:!0,windowResizeDelay:200},Gt.englishDefaults={dayPopoverFormat:"dddd, MMMM D"},Gt.rtlDefaults={header:{left:"next,prev today",center:"",right:"title"},buttonIcons:{prev:"right-single-arrow",next:"left-single-arrow",prevYear:"right-double-arrow",nextYear:"left-double-arrow"},themeButtonIcons:{prev:"circle-triangle-e",next:"circle-triangle-w",nextYear:"seek-prev",prevYear:"seek-next"}};var Lt=L.langs={};L.datepickerLang=function(t,e,n){var i=Lt[t]||(Lt[t]={});i.isRTL=n.isRTL,i.weekNumberTitle=n.weekHeader,z.each(_t,function(t,e){i[t]=e(n)}),z.datepicker&&(z.datepicker.regional[e]=z.datepicker.regional[t]=n,z.datepicker.regional.en=z.datepicker.regional[""],z.datepicker.setDefaults(n))},L.lang=function(t,e){var n,i;n=Lt[t]||(Lt[t]={}),e&&(n=Lt[t]=h(n,e)),i=Ot(t),z.each(Pt,function(t,e){null==n[t]&&(n[t]=e(i,n))}),Gt.defaults.lang=t};var _t={buttonText:function(t){return{prev:M(t.prevText),next:M(t.nextText),today:M(t.currentText)}},monthYearFormat:function(t){return t.showMonthAfterYear?"YYYY["+t.yearSuffix+"] MMMM":"MMMM YYYY["+t.yearSuffix+"]"}},Pt={dayOfMonthFormat:function(t,e){var n=t.longDateFormat("l");return n=n.replace(/^Y+[^\w\s]*|[^\w\s]*Y+$/g,""),e.isRTL?n+=" ddd":n="ddd "+n,n},mediumTimeFormat:function(t){return t.longDateFormat("LT").replace(/\s*a$/i,"a")},smallTimeFormat:function(t){return t.longDateFormat("LT").replace(":mm","(:mm)").replace(/(\Wmm)$/,"($1)").replace(/\s*a$/i,"a")},extraSmallTimeFormat:function(t){return t.longDateFormat("LT").replace(":mm","(:mm)").replace(/(\Wmm)$/,"($1)").replace(/\s*a$/i,"t")},hourFormat:function(t){return t.longDateFormat("LT").replace(":mm","").replace(/(\Wmm)$/,"").replace(/\s*a$/i,"a")},noMeridiemTimeFormat:function(t){return t.longDateFormat("LT").replace(/\s*a$/i,"")}},Vt={smallDayDateFormat:function(t){return t.isRTL?"D dd":"dd D"},weekFormat:function(t){return t.isRTL?"w[ "+t.weekNumberTitle+"]":"["+t.weekNumberTitle+" ]w"},smallWeekFormat:function(t){return t.isRTL?"w["+t.weekNumberTitle+"]":"["+t.weekNumberTitle+"]w"}};function At(n){z.each(Vt,function(t,e){null==n[t]&&(n[t]=e(n))})}function Ot(t){var e=G.localeData||G.langData;return e.call(G,t)||e.call(G,"en")}function Nt(h,f){var t=this;t.render=function(){var t=f.header;if(g=f.theme?"ui":"fc",t)return e=z("<div class='fc-toolbar'/>").append(n("left")).append(n("right")).append(n("center")).append('<div class="fc-clear"/>')},t.destroy=function(){e.remove()},t.updateTitle=function(t){e.find("h2").text(t)},t.activateButton=function(t){e.find(".fc-"+t+"-button").addClass(g+"-state-active")},t.deactivateButton=function(t){e.find(".fc-"+t+"-button").removeClass(g+"-state-active")},t.disableButton=function(t){e.find(".fc-"+t+"-button").attr("disabled","disabled").addClass(g+"-state-disabled")},t.enableButton=function(t){e.find(".fc-"+t+"-button").removeAttr("disabled").removeClass(g+"-state-disabled")},t.getViewsWithButtons=function(){return p};var g,e=z(),p=[];function n(t){var n=z('<div class="fc-'+t+'"/>'),e=f.header[t];return e&&z.each(e.split(" "),function(t){var e,c=z(),d=!0;z.each(this.split(","),function(t,e){var n,i,r,s,o,l,a,u;"title"==e?(c=c.add(z("<h2> </h2>")),d=!1):((n=h.getViewSpec(e))?(i=function(){h.changeView(e)},p.push(e),r=n.buttonTextOverride,s=n.buttonTextDefault):h[e]&&(i=function(){h[e]()},r=(h.overrides.buttonText||{})[e],s=f.buttonText[e]),i&&(o=f.themeButtonIcons[e],l=f.buttonIcons[e],a=r?R(r):o&&f.theme?"<span class='ui-icon ui-icon-"+o+"'></span>":l&&!f.theme?"<span class='fc-icon fc-icon-"+l+"'></span>":R(s),u=z('<button type="button" class="'+["fc-"+e+"-button",g+"-button",g+"-state-default"].join(" ")+'">'+a+"</button>").click(function(){u.hasClass(g+"-state-disabled")||(i(),(u.hasClass(g+"-state-active")||u.hasClass(g+"-state-disabled"))&&u.removeClass(g+"-state-hover"))}).mousedown(function(){u.not("."+g+"-state-active").not("."+g+"-state-disabled").addClass(g+"-state-down")}).mouseup(function(){u.removeClass(g+"-state-down")}).hover(function(){u.not("."+g+"-state-active").not("."+g+"-state-disabled").addClass(g+"-state-hover")},function(){u.removeClass(g+"-state-hover").removeClass(g+"-state-down")}),c=c.add(u)))}),d&&c.first().addClass(g+"-corner-left").end().last().addClass(g+"-corner-right").end(),1<c.length?(e=z("<div/>"),d&&e.addClass("fc-button-group"),e.append(c),n.append(e)):n.append(c)}),n}}L.lang("en",Gt.englishDefaults),L.sourceNormalizers=[];var Bt={dataType:"json",cache:!(L.sourceFetchers=[])},Yt=1;function It(t){t._allDay=t.allDay,t._start=t.start.clone(),t._end=t.end?t.end.clone():null}Gt.prototype.getPeerEvents=function(t,e){var n,i,r=this.getEventCache(),s=[];for(n=0;n<r.length;n++)i=r[n],t&&t._id===i._id||s.push(i);return s};var Wt=d.basic=zt.extend({dayGrid:null,dayNumbersVisible:!1,weekNumbersVisible:!1,weekNumberWidth:null,headRowEl:null,initialize:function(){this.dayGrid=new Dt(this),this.coordMap=this.dayGrid.coordMap},setRange:function(t){zt.prototype.setRange.call(this,t),this.dayGrid.breakOnWeeks=/year|month|week/.test(this.intervalUnit),this.dayGrid.setRange(t)},computeRange:function(t){var e=zt.prototype.computeRange.call(this,t);return/year|month/.test(e.intervalUnit)&&(e.start.startOf("week"),e.start=this.skipHiddenDays(e.start),e.end.weekday()&&(e.end.add(1,"week").startOf("week"),e.end=this.skipHiddenDays(e.end,-1,!0))),e},render:function(){this.dayNumbersVisible=1<this.dayGrid.rowCnt,this.weekNumbersVisible=this.opt("weekNumbers"),this.dayGrid.numbersVisible=this.dayNumbersVisible||this.weekNumbersVisible,this.el.addClass("fc-basic-view").html(this.renderHtml()),this.headRowEl=this.el.find("thead .fc-row"),this.scrollerEl=this.el.find(".fc-day-grid-container"),this.dayGrid.coordMap.containerEl=this.scrollerEl,this.dayGrid.setElement(this.el.find(".fc-day-grid")),this.dayGrid.renderDates(this.hasRigidRows())},destroy:function(){this.dayGrid.destroyDates(),this.dayGrid.removeElement()},renderBusinessHours:function(){this.dayGrid.renderBusinessHours()},renderHtml:function(){return'<table><thead class="fc-head"><tr><td class="'+this.widgetHeaderClass+'">'+this.dayGrid.headHtml()+'</td></tr></thead><tbody class="fc-body"><tr><td class="'+this.widgetContentClass+'"><div class="fc-day-grid-container"><div class="fc-day-grid"/></div></td></tr></tbody></table>'},headIntroHtml:function(){if(this.weekNumbersVisible)return'<th class="fc-week-number '+this.widgetHeaderClass+'" '+this.weekNumberStyleAttr()+"><span>"+R(this.opt("weekNumberTitle"))+"</span></th>"},numberIntroHtml:function(t){if(this.weekNumbersVisible)return'<td class="fc-week-number" '+this.weekNumberStyleAttr()+"><span>"+this.dayGrid.getCell(t,0).start.format("w")+"</span></td>"},dayIntroHtml:function(){if(this.weekNumbersVisible)return'<td class="fc-week-number '+this.widgetContentClass+'" '+this.weekNumberStyleAttr()+"></td>"},introHtml:function(){if(this.weekNumbersVisible)return'<td class="fc-week-number" '+this.weekNumberStyleAttr()+"></td>"},numberCellHtml:function(t){var e,n=t.start;return this.dayNumbersVisible?((e=this.dayGrid.getDayClasses(n)).unshift("fc-day-number"),'<td class="'+e.join(" ")+'" data-date="'+n.format()+'">'+n.date()+"</td>"):"<td/>"},weekNumberStyleAttr:function(){return null!==this.weekNumberWidth?'style="width:'+this.weekNumberWidth+'px"':""},hasRigidRows:function(){var t=this.opt("eventLimit");return t&&"number"!=typeof t},updateWidth:function(){this.weekNumbersVisible&&(this.weekNumberWidth=t(this.el.find(".fc-week-number")))},setHeight:function(t,e){var n,i=this.opt("eventLimit");a(this.scrollerEl),s(this.headRowEl),this.dayGrid.destroySegPopover(),i&&"number"==typeof i&&this.dayGrid.limitRows(i),n=this.computeScrollerHeight(t),this.setGridHeight(n,e),i&&"number"!=typeof i&&this.dayGrid.limitRows(i),!e&&o(this.scrollerEl,n)&&(r(this.headRowEl,u(this.scrollerEl)),n=this.computeScrollerHeight(t),this.scrollerEl.height(n))},setGridHeight:function(t,e){e?i(this.dayGrid.rowEls):n(this.dayGrid.rowEls,t,!0)},renderEvents:function(t){this.dayGrid.renderEvents(t),this.updateHeight()},getEventSegs:function(){return this.dayGrid.getEventSegs()},destroyEvents:function(){this.dayGrid.destroyEvents()},renderDrag:function(t,e){return this.dayGrid.renderDrag(t,e)},destroyDrag:function(){this.dayGrid.destroyDrag()},renderSelection:function(t){this.dayGrid.renderSelection(t)},destroySelection:function(){this.dayGrid.destroySelection()}}),Zt=d.month=Wt.extend({computeRange:function(t){var e,n=Wt.prototype.computeRange.call(this,t);return this.isFixedWeeks()&&(e=Math.ceil(n.end.diff(n.start,"weeks",!0)),n.end.add(6-e,"weeks")),n},setGridHeight:function(t,e){(e=e||"variable"===this.opt("weekMode"))&&(t*=this.rowCnt/6),n(this.dayGrid.rowEls,t,!e)},isFixedWeeks:function(){var t=this.opt("weekMode");return t?"fixed"===t:this.opt("fixedWeekCount")}});Zt.duration={months:1},Zt.defaults={fixedWeekCount:!0},d.basicWeek={type:"basic",duration:{weeks:1}},d.basicDay={type:"basic",duration:{days:1}};return(d.agenda=zt.extend({timeGrid:null,dayGrid:null,axisWidth:null,noScrollRowEls:null,bottomRuleEl:null,bottomRuleHeight:null,initialize:function(){this.timeGrid=new Ht(this),this.opt("allDaySlot")?(this.dayGrid=new Dt(this),this.coordMap=new ft([this.dayGrid.coordMap,this.timeGrid.coordMap])):this.coordMap=this.timeGrid.coordMap},setRange:function(t){zt.prototype.setRange.call(this,t),this.timeGrid.setRange(t),this.dayGrid&&this.dayGrid.setRange(t)},render:function(){this.el.addClass("fc-agenda-view").html(this.renderHtml()),this.scrollerEl=this.el.find(".fc-time-grid-container"),this.timeGrid.coordMap.containerEl=this.scrollerEl,this.timeGrid.setElement(this.el.find(".fc-time-grid")),this.timeGrid.renderDates(),this.bottomRuleEl=z('<hr class="fc-divider '+this.widgetHeaderClass+'"/>').appendTo(this.timeGrid.el),this.dayGrid&&(this.dayGrid.setElement(this.el.find(".fc-day-grid")),this.dayGrid.renderDates(),this.dayGrid.bottomCoordPadding=this.dayGrid.el.next("hr").outerHeight()),this.noScrollRowEls=this.el.find(".fc-row:not(.fc-scroller *)")},destroy:function(){this.timeGrid.destroyDates(),this.timeGrid.removeElement(),this.dayGrid&&(this.dayGrid.destroyDates(),this.dayGrid.removeElement())},renderBusinessHours:function(){this.timeGrid.renderBusinessHours(),this.dayGrid&&this.dayGrid.renderBusinessHours()},renderHtml:function(){return'<table><thead class="fc-head"><tr><td class="'+this.widgetHeaderClass+'">'+this.timeGrid.headHtml()+'</td></tr></thead><tbody class="fc-body"><tr><td class="'+this.widgetContentClass+'">'+(this.dayGrid?'<div class="fc-day-grid"/><hr class="fc-divider '+this.widgetHeaderClass+'"/>':"")+'<div class="fc-time-grid-container"><div class="fc-time-grid"/></div></td></tr></tbody></table>'},headIntroHtml:function(){var t;return this.opt("weekNumbers")?(t=this.timeGrid.getCell(0).start.format(this.opt("smallWeekFormat")),'<th class="fc-axis fc-week-number '+this.widgetHeaderClass+'" '+this.axisStyleAttr()+"><span>"+R(t)+"</span></th>"):'<th class="fc-axis '+this.widgetHeaderClass+'" '+this.axisStyleAttr()+"></th>"},dayIntroHtml:function(){return'<td class="fc-axis '+this.widgetContentClass+'" '+this.axisStyleAttr()+"><span>"+(this.opt("allDayHtml")||R(this.opt("allDayText")))+"</span></td>"},slotBgIntroHtml:function(){return'<td class="fc-axis '+this.widgetContentClass+'" '+this.axisStyleAttr()+"></td>"},introHtml:function(){return'<td class="fc-axis" '+this.axisStyleAttr()+"></td>"},axisStyleAttr:function(){return null!==this.axisWidth?'style="width:'+this.axisWidth+'px"':""},updateSize:function(t){this.timeGrid.updateSize(t),zt.prototype.updateSize.call(this,t)},updateWidth:function(){this.axisWidth=t(this.el.find(".fc-axis"))},setHeight:function(t,e){var n,i;null===this.bottomRuleHeight&&(this.bottomRuleHeight=this.bottomRuleEl.outerHeight()),this.bottomRuleEl.hide(),this.scrollerEl.css("overflow",""),a(this.scrollerEl),s(this.noScrollRowEls),this.dayGrid&&(this.dayGrid.destroySegPopover(),(n=this.opt("eventLimit"))&&"number"!=typeof n&&(n=5),n&&this.dayGrid.limitRows(n)),e||(i=this.computeScrollerHeight(t),o(this.scrollerEl,i)?(r(this.noScrollRowEls,u(this.scrollerEl)),i=this.computeScrollerHeight(t),this.scrollerEl.height(i)):(this.scrollerEl.height(i).css("overflow","hidden"),this.bottomRuleEl.show()))},computeInitialScroll:function(){var t=G.duration(this.opt("scrollTime")),e=this.timeGrid.computeTimeTop(t);return(e=Math.ceil(e))&&e++,e},renderEvents:function(t){var e,n=[],i=[];for(e=0;e<t.length;e++)t[e].allDay?n.push(t[e]):i.push(t[e]);this.timeGrid.renderEvents(i),this.dayGrid&&this.dayGrid.renderEvents(n),this.updateHeight()},getEventSegs:function(){return this.timeGrid.getEventSegs().concat(this.dayGrid?this.dayGrid.getEventSegs():[])},destroyEvents:function(){this.timeGrid.destroyEvents(),this.dayGrid&&this.dayGrid.destroyEvents()},renderDrag:function(t,e){return t.start.hasTime()?this.timeGrid.renderDrag(t,e):this.dayGrid?this.dayGrid.renderDrag(t,e):void 0},destroyDrag:function(){this.timeGrid.destroyDrag(),this.dayGrid&&this.dayGrid.destroyDrag()},renderSelection:function(t){t.start.hasTime()||t.end.hasTime()?this.timeGrid.renderSelection(t):this.dayGrid&&this.dayGrid.renderSelection(t)},destroySelection:function(){this.timeGrid.destroySelection(),this.dayGrid&&this.dayGrid.destroySelection()}})).defaults={allDaySlot:!0,allDayText:"all-day",scrollTime:"06:00:00",slotDuration:"00:30:00",minTime:"00:00:00",maxTime:"24:00:00",slotEventOverlap:!0},d.agendaWeek={type:"agenda",duration:{weeks:1}},d.agendaDay={type:"agenda",duration:{days:1}},L}); |