!function(t,e){function n(e){t.extend(!0,Ct,e)}function r(n,r,c){function u(t){at?p()&&(S(),M(t)):f()}function f(){ot=r.theme?"ui":"fc",n.addClass("fc"),r.isRTL?n.addClass("fc-rtl"):n.addClass("fc-ltr"),r.theme&&n.addClass("ui-widget"),at=t("<div class='fc-content' style='position:relative'/>").prependTo(n),nt=new a(et,r),rt=nt.render(),rt&&n.prepend(rt),y(r.defaultView),r.handleWindowResize&&t(window).resize(x),m()||v()}function v(){setTimeout(function(){!it.start&&m()&&C()},0)}function h(){it&&(tt("viewDestroy",it,it,it.element),it.triggerEventDestroy()),t(window).unbind("resize",x),nt.destroy(),at.remove(),n.removeClass("fc fc-rtl ui-widget")}function p(){return n.is(":visible")}function m(){return t("body").is(":visible")}function y(t){it&&t==it.name||b(t)}function b(e){ht++,it&&(tt("viewDestroy",it,it,it.element),B(),it.triggerEventDestroy(),G(),it.element.remove(),nt.deactivateButton(it.name)),nt.activateButton(e),it=new St[e](t("<div class='fc-view fc-view-"+e+"' style='position:relative'/>").appendTo(at),et),C(),$(),ht--}function C(t){(!it.start||t||gt<it.start||gt>=it.end)&&p()&&M(t)}function M(t){ht++,it.start&&(tt("viewDestroy",it,it,it.element),B(),N()),G(),it.render(gt,t||0),T(),$(),(it.afterRender||A)(),_(),P(),tt("viewRender",it,it,it.element),it.trigger("viewDisplay",dt),ht--,z()}function E(){p()&&(B(),N(),S(),T(),F())}function S(){lt=r.contentHeight?r.contentHeight:r.height?r.height-(rt?rt.height():0)-R(at):Math.round(at.width()/Math.max(r.aspectRatio,.5))}function T(){lt===e&&S(),ht++,it.setHeight(lt),it.setWidth(at.width()),ht--,st=n.outerWidth()}function x(){if(!ht)if(it.start){var t=++vt;setTimeout(function(){t==vt&&!ht&&p()&&st!=(st=n.outerWidth())&&(ht++,E(),it.trigger("windowResize",dt),ht--)},200)}else v()}function k(){N(),W()}function H(t){N(),F(t)}function F(t){p()&&(it.setEventData(pt),it.renderEvents(pt,t),it.trigger("eventAfterAllRender"))}function N(){it.triggerEventDestroy(),it.clearEvents(),it.clearEventData()}function z(){!r.lazyFetching||ut(it.visStart,it.visEnd)?W():F()}function W(){ft(it.visStart,it.visEnd)}function O(t){pt=t,F()}function L(t){H(t)}function _(){nt.updateTitle(it.title)}function P(){var t=new Date;t>=it.start&&t<it.end?nt.disableButton("today"):nt.enableButton("today")}function Y(t,n,r){it.select(t,n,r===e?!0:r)}function B(){it&&it.unselect()}function j(){C(-1)}function I(){C(1)}function q(){i(gt,-1),C()}function X(){i(gt,1),C()}function J(){gt=new Date,C()}function V(t,e,n){t instanceof Date?gt=d(t):g(gt,t,e,n),C()}function U(t,n,r){t!==e&&i(gt,t),n!==e&&s(gt,n),r!==e&&l(gt,r),C()}function Z(){return d(gt)}function G(){at.css({width:"100%",height:at.height(),overflow:"hidden"})}function $(){at.css({width:"",height:"",overflow:""})}function Q(){return it}function K(t,n){return n===e?r[t]:void(("height"==t||"contentHeight"==t||"aspectRatio"==t)&&(r[t]=n,E()))}function tt(t,e){return r[t]?r[t].apply(e||dt,Array.prototype.slice.call(arguments,2)):void 0}var et=this;et.options=r,et.render=u,et.destroy=h,et.refetchEvents=k,et.reportEvents=O,et.reportEventChange=L,et.rerenderEvents=H,et.changeView=y,et.select=Y,et.unselect=B,et.prev=j,et.next=I,et.prevYear=q,et.nextYear=X,et.today=J,et.gotoDate=V,et.incrementDate=U,et.formatDate=function(t,e){return w(t,e,r)},et.formatDates=function(t,e,n){return D(t,e,n,r)},et.getDate=Z,et.getView=Q,et.option=K,et.trigger=tt,o.call(et,r,c);var nt,rt,at,ot,it,st,lt,ct,ut=et.isFetchNeeded,ft=et.fetchEvents,dt=n[0],vt=0,ht=0,gt=new Date,pt=[];g(gt,r.year,r.month,r.date),r.droppable&&t(document).bind("dragstart",function(e,n){var a=e.target,o=t(a);if(!o.parents(".fc").length){var i=r.dropAccept;(t.isFunction(i)?i.call(a,o):o.is(i))&&(ct=a,it.dragStart(ct,e,n))}}).bind("dragstop",function(t,e){ct&&(it.dragStop(ct,t,e),ct=null)})}function a(e,n){function r(){d=n.theme?"ui":"fc";var e=n.header;return e?v=t("<table class='fc-header' style='width:100%'/>").append(t("<tr/>").append(o("left")).append(o("center")).append(o("right"))):void 0}function a(){v.remove()}function o(r){var a=t("<td class='fc-header-"+r+"'/>"),o=n.header[r];return o&&t.each(o.split(" "),function(r){r>0&&a.append("<span class='fc-header-space'/>");var o;t.each(this.split(","),function(r,i){if("title"==i)a.append("<span class='fc-header-title'><h2> </h2></span>"),o&&o.addClass(d+"-corner-right"),o=null;else{var s;if(e[i]?s=e[i]:St[i]&&(s=function(){u.removeClass(d+"-state-hover"),e.changeView(i)}),s){var l=n.theme?P(n.buttonIcons,i):null,c=P(n.buttonText,i),u=t("<span class='fc-button fc-button-"+i+" "+d+"-state-default'>"+(l?"<span class='fc-icon-wrap'><span class='ui-icon ui-icon-"+l+"'/></span>":c)+"</span>").click(function(){u.hasClass(d+"-state-disabled")||s()}).mousedown(function(){u.not("."+d+"-state-active").not("."+d+"-state-disabled").addClass(d+"-state-down")}).mouseup(function(){u.removeClass(d+"-state-down")}).hover(function(){u.not("."+d+"-state-active").not("."+d+"-state-disabled").addClass(d+"-state-hover")},function(){u.removeClass(d+"-state-hover").removeClass(d+"-state-down")}).appendTo(a);B(u),o||u.addClass(d+"-corner-left"),o=u}}}),o&&o.addClass(d+"-corner-right")}),a}function i(t){v.find("h2").html(t)}function s(t){v.find("span.fc-button-"+t).addClass(d+"-state-active")}function l(t){v.find("span.fc-button-"+t).removeClass(d+"-state-active")}function c(t){v.find("span.fc-button-"+t).addClass(d+"-state-disabled")}function u(t){v.find("span.fc-button-"+t).removeClass(d+"-state-disabled")}var f=this;f.render=r,f.destroy=a,f.updateTitle=i,f.activateButton=s,f.deactivateButton=l,f.disableButton=c,f.enableButton=u;var d,v=t([])}function o(n,r){function a(t,e){return!E||E>t||e>S}function o(t,e){E=t,S=e,W=[];var n=++R,r=F.length;N=r;for(var a=0;r>a;a++)i(F[a],n)}function i(e,r){s(e,function(a){if(r==R){if(a){n.eventDataTransform&&(a=t.map(a,n.eventDataTransform)),e.eventDataTransform&&(a=t.map(a,e.eventDataTransform));for(var o=0;o<a.length;o++)a[o].source=e,w(a[o]);W=W.concat(a)}N--,N||k(W)}})}function s(e,r){var a,o,i=Et.sourceFetchers;for(a=0;a<i.length;a++){if(o=i[a](e,E,S,r),o===!0)return;if("object"==typeof o)return void s(o,r)}var l=e.events;if(l)t.isFunction(l)?(m(),l(d(E),d(S),function(t){r(t),y()})):t.isArray(l)?r(l):r();else{var c=e.url;if(c){var u,f=e.success,v=e.error,h=e.complete;u=t.isFunction(e.data)?e.data():e.data;var g=t.extend({},u||{}),p=X(e.startParam,n.startParam),w=X(e.endParam,n.endParam);p&&(g[p]=Math.round(+E/1e3)),w&&(g[w]=Math.round(+S/1e3)),m(),t.ajax(t.extend({},Tt,e,{data:g,success:function(e){e=e||[];var n=q(f,this,arguments);t.isArray(n)&&(e=n),r(e)},error:function(){q(v,this,arguments),r()},complete:function(){q(h,this,arguments),y()}}))}else r()}}function l(t){t=c(t),t&&(N++,i(t,R))}function c(e){return t.isFunction(e)||t.isArray(e)?e={events:e}:"string"==typeof e&&(e={url:e}),"object"==typeof e?(D(e),F.push(e),e):void 0}function u(e){F=t.grep(F,function(t){return!b(t,e)}),W=t.grep(W,function(t){return!b(t.source,e)}),k(W)}function f(t){var e,n,r=W.length,a=x().defaultEventEnd,o=t.start-t._start,i=t.end?t.end-(t._end||a(t)):0;for(e=0;r>e;e++)n=W[e],n._id==t._id&&n!=t&&(n.start=new Date(+n.start+o),t.end?n.end?n.end=new Date(+n.end+i):n.end=new Date(+a(n)+i):n.end=null,n.title=t.title,n.url=t.url,n.allDay=t.allDay,n.className=t.className,n.editable=t.editable,n.color=t.color,n.backgroundColor=t.backgroundColor,n.borderColor=t.borderColor,n.textColor=t.textColor,w(n));w(t),k(W)}function v(t,e){w(t),t.source||(e&&(H.events.push(t),t.source=H),W.push(t)),k(W)}function h(e){if(e){if(!t.isFunction(e)){var n=e+"";e=function(t){return t._id==n}}W=t.grep(W,e,!0);for(var r=0;r<F.length;r++)t.isArray(F[r].events)&&(F[r].events=t.grep(F[r].events,e,!0))}else{W=[];for(var r=0;r<F.length;r++)t.isArray(F[r].events)&&(F[r].events=[])}k(W)}function g(e){return t.isFunction(e)?t.grep(W,e):e?(e+="",t.grep(W,function(t){return t._id==e})):W}function m(){z++||T("loading",null,!0,x())}function y(){--z||T("loading",null,!1,x())}function w(t){var r=t.source||{},a=X(r.ignoreTimezone,n.ignoreTimezone);t._id=t._id||(t.id===e?"_fc"+xt++:t.id+""),t.date&&(t.start||(t.start=t.date),delete t.date),t._start=d(t.start=p(t.start,a)),t.end=p(t.end,a),t.end&&t.end<=t.start&&(t.end=null),t._end=t.end?d(t.end):null,t.allDay===e&&(t.allDay=X(r.allDayDefault,n.allDayDefault)),t.className?"string"==typeof t.className&&(t.className=t.className.split(/\s+/)):t.className=[]}function D(t){t.className?"string"==typeof t.className&&(t.className=t.className.split(/\s+/)):t.className=[];for(var e=Et.sourceNormalizers,n=0;n<e.length;n++)e[n](t)}function b(t,e){return t&&e&&C(t)==C(e)}function C(t){return("object"==typeof t?t.events||t.url:"")||t}var M=this;M.isFetchNeeded=a,M.fetchEvents=o,M.addEventSource=l,M.removeEventSource=u,M.updateEvent=f,M.renderEvent=v,M.removeEvents=h,M.clientEvents=g,M.normalizeEvent=w;for(var E,S,T=M.trigger,x=M.getView,k=M.reportEvents,H={events:[]},F=[H],R=0,N=0,z=0,W=[],A=0;A<r.length;A++)c(r[A])}function i(t,e,n){return t.setFullYear(t.getFullYear()+e),n||f(t),t}function s(t,e,n){if(+t){var r=t.getMonth()+e,a=d(t);for(a.setDate(1),a.setMonth(r),t.setMonth(r),n||f(t);t.getMonth()!=a.getMonth();)t.setDate(t.getDate()+(a>t?1:-1))}return t}function l(t,e,n){if(+t){var r=t.getDate()+e,a=d(t);a.setHours(9),a.setDate(r),t.setDate(r),n||f(t),c(t,a)}return t}function c(t,e){if(+t)for(;t.getDate()!=e.getDate();)t.setTime(+t+(e>t?1:-1)*Ft)}function u(t,e){return t.setMinutes(t.getMinutes()+e),t}function f(t){return t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),t}function d(t,e){return e?f(new Date(+t)):new Date(+t)}function v(){var t,e=0;do t=new Date(1970,e++,1);while(t.getHours());return t}function h(t,e){return Math.round((d(t,!0)-d(e,!0))/Ht)}function g(t,n,r,a){n!==e&&n!=t.getFullYear()&&(t.setDate(1),t.setMonth(0),t.setFullYear(n)),r!==e&&r!=t.getMonth()&&(t.setDate(1),t.setMonth(r)),a!==e&&t.setDate(a)}function p(t,n){return"object"==typeof t?t:"number"==typeof t?new Date(1e3*t):"string"==typeof t?t.match(/^\d+(\.\d+)?$/)?new Date(1e3*parseFloat(t)):(n===e&&(n=!0),m(t,n)||(t?new Date(t):null)):null}function m(t,e){var n=t.match(/^([0-9]{4})(-([0-9]{2})(-([0-9]{2})([T ]([0-9]{2}):([0-9]{2})(:([0-9]{2})(\.([0-9]+))?)?(Z|(([-+])([0-9]{2})(:?([0-9]{2}))?))?)?)?)?$/);if(!n)return null;var r=new Date(n[1],0,1);if(e||!n[13]){var a=new Date(n[1],0,1,9,0);n[3]&&(r.setMonth(n[3]-1),a.setMonth(n[3]-1)),n[5]&&(r.setDate(n[5]),a.setDate(n[5])),c(r,a),n[7]&&r.setHours(n[7]),n[8]&&r.setMinutes(n[8]),n[10]&&r.setSeconds(n[10]),n[12]&&r.setMilliseconds(1e3*Number("0."+n[12])),c(r,a)}else if(r.setUTCFullYear(n[1],n[3]?n[3]-1:0,n[5]||1),r.setUTCHours(n[7]||0,n[8]||0,n[10]||0,n[12]?1e3*Number("0."+n[12]):0),n[14]){var o=60*Number(n[16])+(n[18]?Number(n[18]):0);o*="-"==n[15]?1:-1,r=new Date(+r+60*o*1e3)}return r}function y(t){if("number"==typeof t)return 60*t;if("object"==typeof t)return 60*t.getHours()+t.getMinutes();var e=t.match(/(\d+)(?::(\d+))?\s*(\w+)?/);if(e){var n=parseInt(e[1],10);return e[3]&&(n%=12,"p"==e[3].toLowerCase().charAt(0)&&(n+=12)),60*n+(e[2]?parseInt(e[2],10):0)}}function w(t,e,n){return D(t,null,e,n)}function D(t,e,n,r){r=r||Ct;var a,o,i,s,l=t,c=e,u=n.length,f="";for(a=0;u>a;a++)if(o=n.charAt(a),"'"==o){for(i=a+1;u>i;i++)if("'"==n.charAt(i)){l&&(f+=i==a+1?"'":n.substring(a+1,i),a=i);break}}else if("("==o){for(i=a+1;u>i;i++)if(")"==n.charAt(i)){var d=w(l,n.substring(a+1,i),r);parseInt(d.replace(/\D/,""),10)&&(f+=d),a=i;break}}else if("["==o){for(i=a+1;u>i;i++)if("]"==n.charAt(i)){var v=n.substring(a+1,i),d=w(l,v,r);d!=w(c,v,r)&&(f+=d),a=i;break}}else if("{"==o)l=e,c=t;else if("}"==o)l=t,c=e;else{for(i=u;i>a;i--)if(s=Nt[n.substring(a,i)]){l&&(f+=s(l,r)),a=i-1;break}i==a&&l&&(f+=o)}return f}function b(t){var e,n=new Date(t.getTime());return n.setDate(n.getDate()+4-(n.getDay()||7)),e=n.getTime(),n.setMonth(0),n.setDate(1),Math.floor(Math.round((e-n)/864e5)/7)+1}function C(t){return t.end?M(t.end,t.allDay):l(d(t.start),1)}function M(t,e){return t=d(t),e||t.getHours()||t.getMinutes()?l(t,1):f(t)}function E(n,r,a){n.unbind("mouseover").mouseover(function(n){for(var o,i,s,l=n.target;l!=this;)o=l,l=l.parentNode;(i=o._fci)!==e&&(o._fci=e,s=r[i],a(s.event,s.element,s),t(n.target).trigger(n)),n.stopPropagation()})}function S(e,n,r){for(var a,o=0;o<e.length;o++)a=t(e[o]),a.width(Math.max(0,n-x(a,r)))}function T(e,n,r){for(var a,o=0;o<e.length;o++)a=t(e[o]),a.height(Math.max(0,n-R(a,r)))}function x(t,e){return k(t)+F(t)+(e?H(t):0)}function k(e){return(parseFloat(t.css(e[0],"paddingLeft",!0))||0)+(parseFloat(t.css(e[0],"paddingRight",!0))||0)}function H(e){return(parseFloat(t.css(e[0],"marginLeft",!0))||0)+(parseFloat(t.css(e[0],"marginRight",!0))||0)}function F(e){return(parseFloat(t.css(e[0],"borderLeftWidth",!0))||0)+(parseFloat(t.css(e[0],"borderRightWidth",!0))||0)}function R(t,e){return N(t)+W(t)+(e?z(t):0)}function N(e){return(parseFloat(t.css(e[0],"paddingTop",!0))||0)+(parseFloat(t.css(e[0],"paddingBottom",!0))||0)}function z(e){return(parseFloat(t.css(e[0],"marginTop",!0))||0)+(parseFloat(t.css(e[0],"marginBottom",!0))||0)}function W(e){return(parseFloat(t.css(e[0],"borderTopWidth",!0))||0)+(parseFloat(t.css(e[0],"borderBottomWidth",!0))||0)}function A(){}function O(t,e){return t-e}function L(t){return Math.max.apply(Math,t)}function _(t){return(10>t?"0":"")+t}function P(t,n){if(t[n]!==e)return t[n];for(var r,a=n.split(/(?=[A-Z])/),o=a.length-1;o>=0;o--)if(r=t[a[o].toLowerCase()],r!==e)return r;return t[""]}function Y(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"").replace(/"/g,'"').replace(/\n/g,"<br />")}function B(t){t.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return!1})}function j(t){t.children().removeClass("fc-first fc-last").filter(":first-child").addClass("fc-first").end().filter(":last-child").addClass("fc-last")}function I(t,e){var n=t.source||{},r=t.color,a=n.color,o=e("eventColor"),i=t.backgroundColor||r||n.backgroundColor||a||e("eventBackgroundColor")||o,s=t.borderColor||r||n.borderColor||a||e("eventBorderColor")||o,l=t.textColor||n.textColor||e("eventTextColor"),c=[];return i&&c.push("background-color:"+i),s&&c.push("border-color:"+s),l&&c.push("color:"+l),c.join(";")}function q(e,n,r){if(t.isFunction(e)&&(e=[e]),e){var a,o;for(a=0;a<e.length;a++)o=e[a].apply(n,r)||o;return o}}function X(){for(var t=0;t<arguments.length;t++)if(arguments[t]!==e)return arguments[t]}function J(t,e){function n(t,e){e&&(s(t,e),t.setDate(1));var n=a("firstDay"),f=d(t,!0);f.setDate(1);var v=s(d(f),1),g=d(f);l(g,-((g.getDay()-n+7)%7)),i(g);var p=d(v);l(p,(7-p.getDay()+n)%7),i(p,-1,!0);var m=c(),y=Math.round(h(p,g)/7);"fixed"==a("weekMode")&&(l(p,7*(6-y)),y=6),r.title=u(f,a("titleFormat")),r.start=f,r.end=v,r.visStart=g,r.visEnd=p,o(y,m,!0)}var r=this;r.render=n,Z.call(r,t,e,"month");var a=r.opt,o=r.renderBasic,i=r.skipHiddenDays,c=r.getCellsPerWeek,u=e.formatDate}function V(t,e){function n(t,e){e&&l(t,7*e);var n=l(d(t),-((t.getDay()-a("firstDay")+7)%7)),u=l(d(n),7),f=d(n);i(f);var v=d(u);i(v,-1,!0);var h=s();r.start=n,r.end=u,r.visStart=f,r.visEnd=v,r.title=c(f,l(d(v),-1),a("titleFormat")),o(1,h,!1)}var r=this;r.render=n,Z.call(r,t,e,"basicWeek");var a=r.opt,o=r.renderBasic,i=r.skipHiddenDays,s=r.getCellsPerWeek,c=e.formatDates}function U(t,e){function n(t,e){e&&l(t,e),i(t,0>e?-1:1);var n=d(t,!0),c=l(d(n),1);r.title=s(t,a("titleFormat")),r.start=r.visStart=n,r.end=r.visEnd=c,o(1,1,!1)}var r=this;r.render=n,Z.call(r,t,e,"basicDay");var a=r.opt,o=r.renderBasic,i=r.skipHiddenDays,s=e.formatDate}function Z(e,n,r){function a(t,e,n){et=t,nt=e,rt=n,o(),I||i(),s()}function o(){lt=ht("theme")?"ui":"fc",ct=ht("columnFormat"),ut=ht("weekNumbers"),dt=ht("weekNumberTitle"),vt="iso"!=ht("weekNumberCalculation")?"w":"W"}function i(){Z=t("<div class='fc-event-container' style='position:absolute;z-index:8;top:0;left:0'/>").appendTo(e)}function s(){var n=c();L&&L.remove(),L=t(n).appendTo(e),_=L.find("thead"),P=_.find(".fc-day-header"),I=L.find("tbody"),q=I.find("tr"),X=I.find(".fc-day"),J=q.find("td:first-child"),V=q.eq(0).find(".fc-day > div"),U=q.eq(0).find(".fc-day-content > div"),j(_.add(_.find("tr"))),j(q),q.eq(0).addClass("fc-first"),q.filter(":last").addClass("fc-last"),X.each(function(e,n){var r=Et(Math.floor(e/nt),e%nt);gt("dayRender",O,r,t(n))}),y(X)}function c(){var t="<table class='fc-border-separate' style='width:100%' cellspacing='0'>"+u()+v()+"</table>";return t}function u(){var t,e,n=lt+"-widget-header",r="";for(r+="<thead><tr>",ut&&(r+="<th class='fc-week-number "+n+"'>"+Y(dt)+"</th>"),t=0;nt>t;t++)e=Et(0,t),r+="<th class='fc-day-header fc-"+kt[e.getDay()]+" "+n+"'>"+Y(xt(e,ct))+"</th>";return r+="</tr></thead>"}function v(){var t,e,n,r=lt+"-widget-content",a="";for(a+="<tbody>",t=0;et>t;t++){for(a+="<tr class='fc-week'>",ut&&(n=Et(t,0),a+="<td class='fc-week-number "+r+"'><div>"+Y(xt(n,vt))+"</div></td>"),e=0;nt>e;e++)n=Et(t,e),a+=h(n);a+="</tr>"}return a+="</tbody>"}function h(t){var e=lt+"-widget-content",n=O.start.getMonth(),r=f(new Date),a="",o=["fc-day","fc-"+kt[t.getDay()],e];return t.getMonth()!=n&&o.push("fc-other-month"),+t==+r?o.push("fc-today",lt+"-state-highlight"):r>t?o.push("fc-past"):o.push("fc-future"),a+="<td class='"+o.join(" ")+"' data-date='"+xt(t,"yyyy-MM-dd")+"'><div>",rt&&(a+="<div class='fc-day-number'>"+t.getDate()+"</div>"),a+="<div class='fc-day-content'><div style='position:relative'> </div></div></div></td>"}function g(e){Q=e;var n,r,a,o=Q-_.height();"variable"==ht("weekMode")?n=r=Math.floor(o/(1==et?2:6)):(n=Math.floor(o/et),r=o-n*(et-1)),J.each(function(e,o){et>e&&(a=t(o),a.find("> div").css("min-height",(e==et-1?r:n)-R(a)))})}function p(t){$=t,it.clear(),st.clear(),tt=0,ut&&(tt=_.find("th.fc-week-number").outerWidth()),K=Math.floor(($-tt)/nt),S(P.slice(0,-1),K)}function y(t){t.click(w).mousedown(Mt)}function w(e){if(!ht("selectable")){var n=m(t(this).data("date"));gt("dayClick",this,n,!0,e)}}function D(t,e,n){n&&at.build();for(var r=Tt(t,e),a=0;a<r.length;a++){var o=r[a];y(b(o.row,o.leftCol,o.row,o.rightCol))}}function b(t,n,r,a){var o=at.rect(t,n,r,a,e);return Dt(o,e)}function C(t,e){return d(t)}function M(t,e,n){D(t,l(d(e),1),!0)}function E(){Ct()}function T(t,e,n){var r=St(t),a=X[r.row*nt+r.col];gt("dayClick",a,t,e,n)}function x(t,e,n){ot.start(function(t){Ct(),t&&b(t.row,t.col,t.row,t.col)},e)}function k(t,e,n){var r=ot.stop();if(Ct(),r){var a=Et(r);gt("drop",t,a,!0,e,n)}}function H(t){return d(t.start)}function F(t){return it.left(t)}function N(t){return it.right(t)}function z(t){return st.left(t)}function W(t){return st.right(t)}function A(t){return q.eq(t)}var O=this;O.renderBasic=a,O.setHeight=g,O.setWidth=p,O.renderDayOverlay=D,O.defaultSelectionEnd=C,O.renderSelection=M,O.clearSelection=E,O.reportDayClick=T,O.dragStart=x,O.dragStop=k,O.defaultEventEnd=H,O.getHoverListener=function(){return ot},O.colLeft=F,O.colRight=N,O.colContentLeft=z,O.colContentRight=W,O.getIsCellAllDay=function(){return!0},O.allDayRow=A,O.getRowCnt=function(){return et},O.getColCnt=function(){return nt},O.getColWidth=function(){return K},O.getDaySegmentContainer=function(){return Z},ft.call(O,e,n,r),mt.call(O),pt.call(O),G.call(O);var L,_,P,I,q,X,J,V,U,Z,$,Q,K,tt,et,nt,rt,at,ot,it,st,lt,ct,ut,dt,vt,ht=O.opt,gt=O.trigger,Dt=O.renderOverlay,Ct=O.clearOverlays,Mt=O.daySelectionMousedown,Et=O.cellToDate,St=O.dateToCell,Tt=O.rangeToSegments,xt=n.formatDate;B(e.addClass("fc-grid")),at=new yt(function(e,n){var r,a,o;P.each(function(e,i){r=t(i),a=r.offset().left,e&&(o[1]=a),o=[a],n[e]=o}),o[1]=a+r.outerWidth(),q.each(function(n,i){et>n&&(r=t(i),a=r.offset().top,n&&(o[1]=a),o=[a],e[n]=o)}),o[1]=a+r.outerHeight()}),ot=new wt(at),it=new bt(function(t){return V.eq(t)}),st=new bt(function(t){return U.eq(t)})}function G(){function t(t,e){n.renderDayEvents(t,e)}function e(){n.getDaySegmentContainer().empty()}var n=this;n.renderEvents=t,n.clearEvents=e,dt.call(n)}function $(t,e){function n(t,e){e&&l(t,7*e);var n=l(d(t),-((t.getDay()-a("firstDay")+7)%7)),u=l(d(n),7),f=d(n);i(f);var v=d(u);i(v,-1,!0);var h=s();r.title=c(f,l(d(v),-1),a("titleFormat")),r.start=n,r.end=u,r.visStart=f,r.visEnd=v,o(h)}var r=this;r.render=n,K.call(r,t,e,"agendaWeek");var a=r.opt,o=r.renderAgenda,i=r.skipHiddenDays,s=r.getCellsPerWeek,c=e.formatDates}function Q(t,e){function n(t,e){e&&l(t,e),i(t,0>e?-1:1);var n=d(t,!0),c=l(d(n),1);r.title=s(t,a("titleFormat")),r.start=r.visStart=n,r.end=r.visEnd=c,o(1)}var r=this;r.render=n,K.call(r,t,e,"agendaDay");var a=r.opt,o=r.renderAgenda,i=r.skipHiddenDays,s=e.formatDate}function K(n,r,a){function o(t){Wt=t,i(),K?c():s()}function i(){Yt=Ut("theme")?"ui":"fc",Bt=Ut("isRTL"),jt=y(Ut("minTime")),It=y(Ut("maxTime")),qt=Ut("columnFormat"),Xt=Ut("weekNumbers"),Jt=Ut("weekNumberTitle"),Vt="iso"!=Ut("weekNumberCalculation")?"w":"W",Rt=Ut("snapMinutes")||Ut("slotMinutes")}function s(){var e,r,a,o,i,s=Yt+"-widget-header",l=Yt+"-widget-content",f=Ut("slotMinutes")%15==0;for(c(),ct=t("<div style='position:absolute;z-index:2;left:0;width:100%'/>").appendTo(n),Ut("allDaySlot")?(ut=t("<div class='fc-event-container' style='position:absolute;z-index:8;top:0;left:0'/>").appendTo(ct),e="<table style='width:100%' class='fc-agenda-allday' cellspacing='0'><tr><th class='"+s+" fc-agenda-axis'>"+Ut("allDayText")+"</th><td><div class='fc-day-content'><div style='position:relative'/></div></td><th class='"+s+" fc-agenda-gutter'> </th></tr></table>",dt=t(e).appendTo(ct),vt=dt.find("tr"),C(vt.find("td")),ct.append("<div class='fc-agenda-divider "+s+"'><div class='fc-agenda-divider-inner'/></div>")):ut=t([]),ht=t("<div style='position:absolute;width:100%;overflow-x:hidden;overflow-y:auto'/>").appendTo(ct),gt=t("<div style='position:relative;width:100%;overflow:hidden'/>").appendTo(ht),Dt=t("<div class='fc-event-container' style='position:absolute;z-index:8;top:0;left:0'/>").appendTo(gt),e="<table class='fc-agenda-slots' style='width:100%' cellspacing='0'><tbody>",r=v(),o=u(d(r),It),u(r,jt),At=0,a=0;o>r;a++)i=r.getMinutes(),e+="<tr class='fc-slot"+a+" "+(i?"fc-minor":"")+"'><th class='fc-agenda-axis "+s+"'>"+(f&&i?" ":oe(r,Ut("axisFormat")))+"</th><td class='"+l+"'><div style='position:relative'> </div></td></tr>",u(r,Ut("slotMinutes")),At++;e+="</tbody></table>",Ct=t(e).appendTo(gt),M(Ct.find("td"))}function c(){var e=h();K&&K.remove(),K=t(e).appendTo(n),et=K.find("thead"),nt=et.find("th").slice(1,-1),rt=K.find("tbody"),at=rt.find("td").slice(0,-1),ot=at.find("> div"),it=at.find(".fc-day-content > div"),st=at.eq(0),lt=ot.eq(0),j(et.add(et.find("tr"))),j(rt.add(rt.find("tr")))}function h(){var t="<table style='width:100%' class='fc-agenda-days fc-border-separate' cellspacing='0'>"+g()+p()+"</table>";return t}function g(){var t,e,n,r=Yt+"-widget-header",a="";for(a+="<thead><tr>",Xt?(t=ne(0,0),e=oe(t,Vt),Bt?e+=Jt:e=Jt+e,a+="<th class='fc-agenda-axis fc-week-number "+r+"'>"+Y(e)+"</th>"):a+="<th class='fc-agenda-axis "+r+"'> </th>",n=0;Wt>n;n++)t=ne(0,n),a+="<th class='fc-"+kt[t.getDay()]+" fc-col"+n+" "+r+"'>"+Y(oe(t,qt))+"</th>";return a+="<th class='fc-agenda-gutter "+r+"'> </th></tr></thead>"}function p(){var t,e,n,r,a,o=Yt+"-widget-header",i=Yt+"-widget-content",s=f(new Date),l="";for(l+="<tbody><tr><th class='fc-agenda-axis "+o+"'> </th>",n="",e=0;Wt>e;e++)t=ne(0,e),a=["fc-col"+e,"fc-"+kt[t.getDay()],i],+t==+s?a.push(Yt+"-state-highlight","fc-today"):s>t?a.push("fc-past"):a.push("fc-future"),r="<td class='"+a.join(" ")+"'><div><div class='fc-day-content'><div style='position:relative'> </div></div></div></td>",n+=r;return l+=n,l+="<td class='fc-agenda-gutter "+i+"'> </td></tr></tbody>"}function m(t){t===e&&(t=St),St=t,ie={};var n=rt.position().top,r=ht.position().top,a=Math.min(t-n,Ct.height()+r+1);lt.height(a-R(st)),ct.css("top",n),ht.height(a-r-1),Ft=Ct.find("tr:first").height()+1,Nt=Ut("slotMinutes")/Rt,zt=Ft/Nt}function w(e){Et=e,_t.clear(),Pt.clear();var n=et.find("th:first");dt&&(n=n.add(dt.find("th:first"))),n=n.add(Ct.find("th:first")),Tt=0,S(n.width("").each(function(e,n){Tt=Math.max(Tt,t(n).outerWidth())}),Tt);var r=K.find(".fc-agenda-gutter");dt&&(r=r.add(dt.find("th.fc-agenda-gutter")));var a=ht[0].clientWidth;Ht=ht.width()-a,Ht?(S(r,Ht),r.show().prev().removeClass("fc-last")):r.hide().prev().addClass("fc-last"),xt=Math.floor((a-Tt)/Wt),S(nt.slice(0,-1),xt)}function D(){function t(){ht.scrollTop(r)}var e=v(),n=d(e);n.setHours(Ut("firstHour"));var r=_(e,n)+1;t(),setTimeout(t,0)}function b(){D()}function C(t){t.click(E).mousedown(te)}function M(t){t.click(E).mousedown(U)}function E(t){if(!Ut("selectable")){var e=Math.min(Wt-1,Math.floor((t.pageX-K.offset().left-Tt)/xt)),n=ne(0,e),r=this.parentNode.className.match(/fc-slot(\d+)/);if(r){var a=parseInt(r[1])*Ut("slotMinutes"),o=Math.floor(a/60);n.setHours(o),n.setMinutes(a%60+jt),Zt("dayClick",at[e],n,!1,t)}else Zt("dayClick",at[e],n,!0,t)}}function x(t,e,n){n&&Ot.build();for(var r=ae(t,e),a=0;a<r.length;a++){var o=r[a];C(k(o.row,o.leftCol,o.row,o.rightCol))}}function k(t,e,n,r){var a=Ot.rect(t,e,n,r,ct);return Gt(a,ct)}function H(t,e){for(var n=0;Wt>n;n++){var r=ne(0,n),a=l(d(r),1),o=new Date(Math.max(r,t)),i=new Date(Math.min(a,e));if(i>o){var s=Ot.rect(0,n,0,n,gt),c=_(r,o),u=_(r,i);s.top=c,s.height=u-c,M(Gt(s,gt))}}}function F(t){return _t.left(t)}function N(t){return Pt.left(t)}function z(t){return _t.right(t)}function W(t){return Pt.right(t)}function A(t){return Ut("allDaySlot")&&!t.row}function L(t){var e=ne(0,t.col),n=t.row;return Ut("allDaySlot")&&n--,n>=0&&u(e,jt+n*Rt),e}function _(t,n){if(t=d(t,!0),n<u(d(t),jt))return 0;if(n>=u(d(t),It))return Ct.height();var r=Ut("slotMinutes"),a=60*n.getHours()+n.getMinutes()-jt,o=Math.floor(a/r),i=ie[o];return i===e&&(i=ie[o]=Ct.find("tr").eq(o).find("td div")[0].offsetTop),Math.max(0,Math.round(i-1+Ft*(a%r/r)))}function P(t){return vt}function I(t){var e=d(t.start);return t.allDay?e:u(e,Ut("defaultEventMinutes"))}function q(t,e){return e?d(t):u(d(t),Ut("slotMinutes"))}function X(t,e,n){n?Ut("allDaySlot")&&x(t,l(d(e),1),!0):J(t,e)}function J(e,n){var r=Ut("selectHelper");if(Ot.build(),r){var a=re(e).col;if(a>=0&&Wt>a){var o=Ot.rect(0,a,0,a,gt),i=_(e,e),s=_(e,n);if(s>i){if(o.top=i,o.height=s-i,o.left+=2,o.width-=5,t.isFunction(r)){var l=r(e,n);l&&(o.position="absolute",Mt=t(l).css(o).appendTo(gt))}else o.isStart=!0,o.isEnd=!0,Mt=t(ee({title:"",start:e,end:n,className:["fc-select-helper"],editable:!1},o)),Mt.css("opacity",Ut("dragOpacity"));Mt&&(M(Mt),gt.append(Mt),S(Mt,o.width,!0),T(Mt,o.height,!0))}}}else H(e,n)}function V(){$t(),Mt&&(Mt.remove(),Mt=null)}function U(e){if(1==e.which&&Ut("selectable")){Kt(e);var n;Lt.start(function(t,e){if(V(),t&&t.col==e.col&&!A(t)){var r=L(e),a=L(t);n=[r,u(d(r),Rt),a,u(d(a),Rt)].sort(O),J(n[0],n[3])}else n=null},e),t(document).one("mouseup",function(t){Lt.stop(),n&&(+n[0]==+n[1]&&Z(n[0],!1,t),Qt(n[0],n[3],!1,t))})}}function Z(t,e,n){Zt("dayClick",at[re(t).col],t,e,n)}function G(t,e,n){Lt.start(function(t){if($t(),t)if(A(t))k(t.row,t.col,t.row,t.col);else{var e=L(t),n=u(d(e),Ut("defaultEventMinutes"));H(e,n)}},e)}function $(t,e,n){var r=Lt.stop();$t(),r&&Zt("drop",t,L(r),A(r),e,n)}var Q=this;Q.renderAgenda=o,Q.setWidth=w,Q.setHeight=m,Q.afterRender=b,Q.defaultEventEnd=I,Q.timePosition=_,Q.getIsCellAllDay=A,Q.allDayRow=P,Q.getCoordinateGrid=function(){return Ot},Q.getHoverListener=function(){return Lt},Q.colLeft=F,Q.colRight=z,Q.colContentLeft=N,Q.colContentRight=W,Q.getDaySegmentContainer=function(){return ut},Q.getSlotSegmentContainer=function(){return Dt},Q.getMinMinute=function(){return jt},Q.getMaxMinute=function(){return It},Q.getSlotContainer=function(){return gt},Q.getRowCnt=function(){return 1},Q.getColCnt=function(){return Wt},Q.getColWidth=function(){return xt},Q.getSnapHeight=function(){return zt},Q.getSnapMinutes=function(){return Rt},Q.defaultSelectionEnd=q,Q.renderDayOverlay=x,Q.renderSelection=X,Q.clearSelection=V,Q.reportDayClick=Z,Q.dragStart=G,Q.dragStop=$,ft.call(Q,n,r,a),mt.call(Q),pt.call(Q),tt.call(Q);var K,et,nt,rt,at,ot,it,st,lt,ct,ut,dt,vt,ht,gt,Dt,Ct,Mt,Et,St,Tt,xt,Ht,Ft,Rt,Nt,zt,Wt,At,Ot,Lt,_t,Pt,Yt,Bt,jt,It,qt,Xt,Jt,Vt,Ut=Q.opt,Zt=Q.trigger,Gt=Q.renderOverlay,$t=Q.clearOverlays,Qt=Q.reportSelection,Kt=Q.unselect,te=Q.daySelectionMousedown,ee=Q.slotSegHtml,ne=Q.cellToDate,re=Q.dateToCell,ae=Q.rangeToSegments,oe=r.formatDate,ie={};B(n.addClass("fc-agenda")),Ot=new yt(function(e,n){function r(t){return Math.max(l,Math.min(c,t))}var a,o,i;nt.each(function(e,r){a=t(r),o=a.offset().left,e&&(i[1]=o),i=[o],n[e]=i}),i[1]=o+a.outerWidth(),Ut("allDaySlot")&&(a=vt,o=a.offset().top,e[0]=[o,o+a.outerHeight()]);for(var s=gt.offset().top,l=ht.offset().top,c=l+ht.outerHeight(),u=0;At*Nt>u;u++)e.push([r(s+zt*u),r(s+zt*(u+1))])}),Lt=new wt(Ot),_t=new bt(function(t){return ot.eq(t)}),Pt=new bt(function(t){return it.eq(t)})}function tt(){function n(t,e){var n,r=t.length,o=[],i=[];for(n=0;r>n;n++)t[n].allDay?o.push(t[n]):i.push(t[n]);y("allDaySlot")&&(tt(o,e),k()),s(a(i),e)}function r(){H().empty(),F().empty()}function a(e){var n,r,a,s,l,c=B(),f=W(),v=z(),h=t.map(e,i),g=[];for(r=0;c>r;r++)for(n=P(0,r),u(n,f),l=o(e,h,n,u(d(n),v-f)),l=et(l),a=0;a<l.length;a++)s=l[a],s.col=r,g.push(s);return g}function o(t,e,n,r){var a,o,i,s,l,c,u,f,v=[],h=t.length;for(a=0;h>a;a++)o=t[a],i=o.start,s=e[a],s>n&&r>i&&(n>i?(l=d(n),u=!1):(l=i,u=!0),s>r?(c=d(r),f=!1):(c=s,f=!0),v.push({event:o,start:l,end:c,isStart:u,isEnd:f}));return v.sort(ut)}function i(t){return t.end?d(t.end):u(d(t.start),y("defaultEventMinutes"))}function s(n,r){var a,o,i,s,l,u,d,v,h,g,p,m,D,b,C,M,S=n.length,T="",k=F(),H=y("isRTL");for(a=0;S>a;a++)o=n[a],i=o.event,s=A(o.start,o.start),l=A(o.start,o.end),u=L(o.col),d=_(o.col),v=d-u,d-=.025*v,v=d-u,h=v*(o.forwardCoord-o.backwardCoord),y("slotEventOverlap")&&(h=Math.max(2*(h-10),h)),H?(p=d-o.backwardCoord*v,g=p-h):(g=u+o.backwardCoord*v,p=g+h),g=Math.max(g,u),p=Math.min(p,d),h=p-g,o.top=s,o.left=g,o.outerWidth=h,o.outerHeight=l-s,T+=c(i,o);for(k[0].innerHTML=T,m=k.children(),a=0;S>a;a++)o=n[a],i=o.event,D=t(m[a]),b=w("eventRender",i,i,D),b===!1?D.remove():(b&&b!==!0&&(D.remove(),D=t(b).css({position:"absolute",top:o.top,left:o.left}).appendTo(k)),o.element=D,i._id===r?f(i,D,o):D[0]._fci=a,V(i,D));for(E(k,n,f),a=0;S>a;a++)o=n[a],(D=o.element)&&(o.vsides=R(D,!0),o.hsides=x(D,!0),C=D.find(".fc-event-title"),C.length&&(o.contentTop=C[0].offsetTop));for(a=0;S>a;a++)o=n[a],(D=o.element)&&(D[0].style.width=Math.max(0,o.outerWidth-o.hsides)+"px",M=Math.max(0,o.outerHeight-o.vsides),D[0].style.height=M+"px",i=o.event,o.contentTop!==e&&M-o.contentTop<10&&(D.find("div.fc-event-time").text(rt(i.start,y("timeFormat"))+" - "+i.title),D.find("div.fc-event-title").remove()),w("eventAfterRender",i,i,D))}function c(t,e){var n="<",r=t.url,a=I(t,y),o=["fc-event","fc-event-vert"];return D(t)&&o.push("fc-event-draggable"),e.isStart&&o.push("fc-event-start"),e.isEnd&&o.push("fc-event-end"),o=o.concat(t.className),t.source&&(o=o.concat(t.source.className||[])),n+=r?"a href='"+Y(t.url)+"'":"div",n+=" class='"+o.join(" ")+"' style='position:absolute;top:"+e.top+"px;left:"+e.left+"px;"+a+"'><div class='fc-event-inner'><div class='fc-event-time'>"+Y(at(t.start,t.end,y("timeFormat")))+"</div><div class='fc-event-title'>"+Y(t.title||"")+"</div></div><div class='fc-event-bg'></div>",e.isEnd&&b(t)&&(n+="<div class='ui-resizable-handle ui-resizable-s'>=</div>"),n+="</"+(r?"a":"div")+">"}function f(t,e,n){var r=e.find("div.fc-event-time");D(t)&&g(t,e,r),n.isEnd&&b(t)&&p(t,e,r),S(t,e)}function v(t,e,n){function r(){c||(e.width(a).height("").draggable("option","grid",null),c=!0)}var a,o,i,s=n.isStart,c=!0,u=N(),f=j(),v=q(),g=X(),p=W();e.draggable({opacity:y("dragOpacity","month"),revertDuration:y("dragRevertDuration"),start:function(n,p){w("eventDragStart",e,t,n,p),Z(t,e),a=e.width(),u.start(function(n,a){if(K(),n){o=!1;var u=P(0,a.col),p=P(0,n.col);i=h(p,u),n.row?s?c&&(e.width(f-10),T(e,v*Math.round((t.end?(t.end-t.start)/Rt:y("defaultEventMinutes"))/g)),e.draggable("option","grid",[f,1]),c=!1):o=!0:(Q(l(d(t.start),i),l(C(t),i)),r()),o=o||c&&!i;}else r(),o=!0;e.draggable("option","revert",o)},n,"drag")},stop:function(n,a){if(u.stop(),K(),w("eventDragStop",e,t,n,a),o)r(),e.css("filter",""),U(t,e);else{var s=0;c||(s=Math.round((e.offset().top-J().offset().top)/v)*g+p-(60*t.start.getHours()+t.start.getMinutes())),G(this,t,i,s,c,n,a)}}})}function g(t,e,n){function r(){K(),s&&(f?(n.hide(),e.draggable("option","grid",null),Q(l(d(t.start),D),l(C(t),D))):(a(b),n.css("display",""),e.draggable("option","grid",[T,x])))}function a(e){var r,a=u(d(t.start),e);t.end&&(r=u(d(t.end),e)),n.text(at(a,r,y("timeFormat")))}var o,i,s,c,f,v,g,p,D,b,M,E=m.getCoordinateGrid(),S=B(),T=j(),x=q(),k=X();e.draggable({scroll:!1,grid:[T,x],axis:1==S?"y":!1,opacity:y("dragOpacity"),revertDuration:y("dragRevertDuration"),start:function(n,r){w("eventDragStart",e,t,n,r),Z(t,e),E.build(),o=e.position(),i=E.cell(n.pageX,n.pageY),s=c=!0,f=v=O(i),g=p=0,D=0,b=M=0},drag:function(t,n){var a=E.cell(t.pageX,t.pageY);if(s=!!a){if(f=O(a),g=Math.round((n.position.left-o.left)/T),g!=p){var l=P(0,i.col),u=i.col+g;u=Math.max(0,u),u=Math.min(S-1,u);var d=P(0,u);D=h(d,l)}f||(b=Math.round((n.position.top-o.top)/x)*k)}(s!=c||f!=v||g!=p||b!=M)&&(r(),c=s,v=f,p=g,M=b),e.draggable("option","revert",!s)},stop:function(n,a){K(),w("eventDragStop",e,t,n,a),s&&(f||D||b)?G(this,t,D,f?0:b,f,n,a):(s=!0,f=!1,g=0,D=0,b=0,r(),e.css("filter",""),e.css(o),U(t,e))}})}function p(t,e,n){var r,a,o=q(),i=X();e.resizable({handles:{s:".ui-resizable-handle"},grid:o,start:function(n,o){r=a=0,Z(t,e),w("eventResizeStart",this,t,n,o)},resize:function(s,l){r=Math.round((Math.max(o,e.height())-l.originalSize.height)/o),r!=a&&(n.text(at(t.start,r||t.end?u(M(t),i*r):null,y("timeFormat"))),a=r)},stop:function(n,a){w("eventResizeStop",this,t,n,a),r?$(this,t,0,i*r,n,a):U(t,e)}})}var m=this;m.renderEvents=n,m.clearEvents=r,m.slotSegHtml=c,dt.call(m);var y=m.opt,w=m.trigger,D=m.isEventDraggable,b=m.isEventResizable,M=m.eventEnd,S=m.eventElementHandlers,k=m.setHeight,H=m.getDaySegmentContainer,F=m.getSlotSegmentContainer,N=m.getHoverListener,z=m.getMaxMinute,W=m.getMinMinute,A=m.timePosition,O=m.getIsCellAllDay,L=m.colContentLeft,_=m.colContentRight,P=m.cellToDate,B=m.getColCnt,j=m.getColWidth,q=m.getSnapHeight,X=m.getSnapMinutes,J=m.getSlotContainer,V=m.reportEventElement,U=m.showEvents,Z=m.hideEvents,G=m.eventDrop,$=m.eventResize,Q=m.renderDayOverlay,K=m.clearOverlays,tt=m.renderDayEvents,nt=m.calendar,rt=nt.formatDate,at=nt.formatDates;m.draggableDayEvent=v}function et(t){var e,n=nt(t),r=n[0];if(rt(n),r){for(e=0;e<r.length;e++)at(r[e]);for(e=0;e<r.length;e++)ot(r[e],0,0)}return it(n)}function nt(t){var e,n,r,a=[];for(e=0;e<t.length;e++){for(n=t[e],r=0;r<a.length&&st(n,a[r]).length;r++);(a[r]||(a[r]=[])).push(n)}return a}function rt(t){var e,n,r,a,o;for(e=0;e<t.length;e++)for(n=t[e],r=0;r<n.length;r++)for(a=n[r],a.forwardSegs=[],o=e+1;o<t.length;o++)st(a,t[o],a.forwardSegs)}function at(t){var n,r,a=t.forwardSegs,o=0;if(t.forwardPressure===e){for(n=0;n<a.length;n++)r=a[n],at(r),o=Math.max(o,1+r.forwardPressure);t.forwardPressure=o}}function ot(t,n,r){var a,o=t.forwardSegs;if(t.forwardCoord===e)for(o.length?(o.sort(ct),ot(o[0],n+1,r),t.forwardCoord=o[0].backwardCoord):t.forwardCoord=1,t.backwardCoord=t.forwardCoord-(t.forwardCoord-r)/(n+1),a=0;a<o.length;a++)ot(o[a],0,t.forwardCoord)}function it(t){var e,n,r,a=[];for(e=0;e<t.length;e++)for(n=t[e],r=0;r<n.length;r++)a.push(n[r]);return a}function st(t,e,n){n=n||[];for(var r=0;r<e.length;r++)lt(t,e[r])&&n.push(e[r]);return n}function lt(t,e){return t.end>e.start&&t.start<e.end}function ct(t,e){return e.forwardPressure-t.forwardPressure||(t.backwardCoord||0)-(e.backwardCoord||0)||ut(t,e)}function ut(t,e){return t.start-e.start||e.end-e.start-(t.end-t.start)||(t.event.title||"").localeCompare(e.event.title)}function ft(n,r,a){function o(e,n){var r=V[e];return t.isPlainObject(r)?P(r,n||a):r}function i(t,e){return r.trigger.apply(r,[t,e||_].concat(Array.prototype.slice.call(arguments,2),[_]))}function s(t){var e=t.source||{};return X(t.startEditable,e.startEditable,o("eventStartEditable"),t.editable,e.editable,o("editable"))&&!o("disableDragging")}function c(t){var e=t.source||{};return X(t.durationEditable,e.durationEditable,o("eventDurationEditable"),t.editable,e.editable,o("editable"))&&!o("disableResizing")}function f(t){I={};var e,n,r=t.length;for(e=0;r>e;e++)n=t[e],I[n._id]?I[n._id].push(n):I[n._id]=[n]}function v(){I={},q={},J=[]}function g(t){return t.end?d(t.end):Y(t)}function p(t,e){J.push({event:t,element:e}),q[t._id]?q[t._id].push(e):q[t._id]=[e]}function m(){t.each(J,function(t,e){_.trigger("eventDestroy",e.event,e.event,e.element)})}function y(t,e){e.click(function(n){return e.hasClass("ui-draggable-dragging")||e.hasClass("ui-resizable-resizing")?void 0:i("eventClick",this,t,n)}).hover(function(e){i("eventMouseover",this,t,e)},function(e){i("eventMouseout",this,t,e)})}function w(t,e){b(t,e,"show")}function D(t,e){b(t,e,"hide")}function b(t,e,n){var r,a=q[t._id],o=a.length;for(r=0;o>r;r++)e&&a[r][0]==e[0]||a[r][n]()}function C(t,e,n,r,a,o,s){var l=e.allDay,c=e._id;E(I[c],n,r,a),i("eventDrop",t,e,n,r,a,function(){E(I[c],-n,-r,l),j(c)},o,s),j(c)}function M(t,e,n,r,a,o){var s=e._id;S(I[s],n,r),i("eventResize",t,e,n,r,function(){S(I[s],-n,-r),j(s)},a,o),j(s)}function E(t,n,r,a){r=r||0;for(var o,i=t.length,s=0;i>s;s++)o=t[s],a!==e&&(o.allDay=a),u(l(o.start,n,!0),r),o.end&&(o.end=u(l(o.end,n,!0),r)),B(o,V)}function S(t,e,n){n=n||0;for(var r,a=t.length,o=0;a>o;o++)r=t[o],r.end=u(l(g(r),e,!0),n),B(r,V)}function T(t){return"object"==typeof t&&(t=t.getDay()),G[t]}function x(){return U}function k(t,e,n){for(e=e||1;G[(t.getDay()+(n?e:0)+7)%7];)l(t,e)}function H(){var t=F.apply(null,arguments),e=R(t),n=N(e);return n}function F(t,e){var n=_.getColCnt(),r=K?-1:1,a=K?n-1:0;"object"==typeof t&&(e=t.col,t=t.row);var o=t*n+(e*r+a);return o}function R(t){var e=_.visStart.getDay();return t+=$[e],7*Math.floor(t/U)+Q[(t%U+U)%U]-e}function N(t){var e=d(_.visStart);return l(e,t),e}function z(t){var e=W(t),n=A(e),r=O(n);return r}function W(t){return h(t,_.visStart)}function A(t){var e=_.visStart.getDay();return t+=e,Math.floor(t/7)*U+$[(t%7+7)%7]-$[e]}function O(t){var e=_.getColCnt(),n=K?-1:1,r=K?e-1:0,a=Math.floor(t/e),o=(t%e+e)%e*n+r;return{row:a,col:o}}function L(t,e){for(var n=_.getRowCnt(),r=_.getColCnt(),a=[],o=W(t),i=W(e),s=A(o),l=A(i)-1,c=0;n>c;c++){var u=c*r,f=u+r-1,d=Math.max(s,u),v=Math.min(l,f);if(v>=d){var h=O(d),g=O(v),p=[h.col,g.col].sort(),m=R(d)==o,y=R(v)+1==i;a.push({row:c,leftCol:p[0],rightCol:p[1],isStart:m,isEnd:y})}}return a}var _=this;_.element=n,_.calendar=r,_.name=a,_.opt=o,_.trigger=i,_.isEventDraggable=s,_.isEventResizable=c,_.setEventData=f,_.clearEventData=v,_.eventEnd=g,_.reportEventElement=p,_.triggerEventDestroy=m,_.eventElementHandlers=y,_.showEvents=w,_.hideEvents=D,_.eventDrop=C,_.eventResize=M;var Y=_.defaultEventEnd,B=r.normalizeEvent,j=r.reportEventChange,I={},q={},J=[],V=r.options;_.isHiddenDay=T,_.skipHiddenDays=k,_.getCellsPerWeek=x,_.dateToCell=z,_.dateToDayOffset=W,_.dayOffsetToCellOffset=A,_.cellOffsetToCell=O,_.cellToDate=H,_.cellToCellOffset=F,_.cellOffsetToDayOffset=R,_.dayOffsetToDate=N,_.rangeToSegments=L;var U,Z=o("hiddenDays")||[],G=[],$=[],Q=[],K=o("isRTL");!function(){o("weekends")===!1&&Z.push(0,6);for(var e=0,n=0;7>e;e++)$[e]=n,G[e]=-1!=t.inArray(e,Z),G[e]||(Q[n]=e,n++);if(U=n,!U)throw"invalid hiddenDays"}()}function dt(){function e(t,e){var n=r(t,!1,!0);ht(n,function(t,e){N(t.event,e)}),w(n,e),ht(n,function(t,e){k("eventAfterRender",t.event,t.event,e)})}function n(t,e,n){var a=r([t],!0,!1),o=[];return ht(a,function(t,r){t.row===e&&r.css("top",n),o.push(r[0])}),o}function r(e,n,r){var o,l,c=Z(),d=n?t("<div/>"):c,v=a(e);return i(v),o=s(v),d[0].innerHTML=o,l=d.children(),n&&c.append(l),u(v,l),ht(v,function(t,e){t.hsides=x(e,!0)}),ht(v,function(t,e){e.width(Math.max(0,t.outerWidth-t.hsides))}),ht(v,function(t,e){t.outerHeight=e.outerHeight(!0)}),f(v,r),v}function a(t){for(var e=[],n=0;n<t.length;n++){var r=o(t[n]);e.push.apply(e,r)}return e}function o(t){for(var e=t.start,n=C(t),r=et(e,n),a=0;a<r.length;a++)r[a].event=t;return r}function i(t){for(var e=T("isRTL"),n=0;n<t.length;n++){var r=t[n],a=(e?r.isEnd:r.isStart)?V:X,o=(e?r.isStart:r.isEnd)?U:J,i=a(r.leftCol),s=o(r.rightCol);r.left=i,r.outerWidth=s-i}}function s(t){for(var e="",n=0;n<t.length;n++)e+=c(t[n]);return e}function c(t){var e="",n=T("isRTL"),r=t.event,a=r.url,o=["fc-event","fc-event-hori"];H(r)&&o.push("fc-event-draggable"),t.isStart&&o.push("fc-event-start"),t.isEnd&&o.push("fc-event-end"),o=o.concat(r.className),r.source&&(o=o.concat(r.source.className||[]));var i=I(r,T);return e+=a?"<a href='"+Y(a)+"'":"<div",e+=" class='"+o.join(" ")+"' style='position:absolute;left:"+t.left+"px;"+i+"'><div class='fc-event-inner'>",!r.allDay&&t.isStart&&(e+="<span class='fc-event-time'>"+Y(G(r.start,r.end,T("timeFormat")))+"</span>"),e+="<span class='fc-event-title'>"+Y(r.title||"")+"</span></div>",t.isEnd&&F(r)&&(e+="<div class='ui-resizable-handle ui-resizable-"+(n?"w":"e")+"'>   </div>"),e+="</"+(a?"a":"div")+">"}function u(e,n){for(var r=0;r<e.length;r++){var a=e[r],o=a.event,i=n.eq(r),s=k("eventRender",o,o,i);s===!1?i.remove():(s&&s!==!0&&(s=t(s).css({position:"absolute",left:a.left}),i.replaceWith(s),i=s),a.element=i)}}function f(t,e){var n=v(t),r=y(),a=[];if(e)for(var o=0;o<r.length;o++)r[o].height(n[o]);for(var o=0;o<r.length;o++)a.push(r[o].position().top);ht(t,function(t,e){e.css("top",a[t.row]+t.top)})}function v(t){for(var e=P(),n=j(),r=[],a=g(t),o=0;e>o;o++){for(var i=a[o],s=[],l=0;n>l;l++)s.push(0);for(var c=0;c<i.length;c++){var u=i[c];u.top=L(s.slice(u.leftCol,u.rightCol+1));for(var l=u.leftCol;l<=u.rightCol;l++)s[l]=u.top+u.outerHeight}r.push(L(s))}return r}function g(t){var e,n,r,a=P(),o=[];for(e=0;e<t.length;e++)n=t[e],r=n.row,n.element&&(o[r]?o[r].push(n):o[r]=[n]);for(r=0;a>r;r++)o[r]=p(o[r]||[]);return o}function p(t){for(var e=[],n=m(t),r=0;r<n.length;r++)e.push.apply(e,n[r]);return e}function m(t){t.sort(gt);for(var e=[],n=0;n<t.length;n++){for(var r=t[n],a=0;a<e.length&&vt(r,e[a]);a++);e[a]?e[a].push(r):e[a]=[r]}return e}function y(){var t,e=P(),n=[];for(t=0;e>t;t++)n[t]=q(t).find("div.fc-day-content > div");return n}function w(t,e){var n=Z();ht(t,function(t,n,r){var a=t.event;a._id===e?D(a,n,t):n[0]._fci=r}),E(n,t,D)}function D(t,e,n){H(t)&&S.draggableDayEvent(t,e,n),n.isEnd&&F(t)&&S.resizableDayEvent(t,e,n),z(t,e)}function b(t,e){var n,r=tt();e.draggable({delay:50,opacity:T("dragOpacity"),revertDuration:T("dragRevertDuration"),start:function(a,o){k("eventDragStart",e,t,a,o),A(t,e),r.start(function(r,a,o,i){if(e.draggable("option","revert",!r||!o&&!i),Q(),r){var s=nt(a),c=nt(r);n=h(c,s),$(l(d(t.start),n),l(C(t),n))}else n=0},a,"drag")},stop:function(a,o){r.stop(),Q(),k("eventDragStop",e,t,a,o),n?O(this,t,n,0,t.allDay,a,o):(e.css("filter",""),W(t,e))}})}function M(e,r,a){var o=T("isRTL"),i=o?"w":"e",s=r.find(".ui-resizable-"+i),c=!1;B(r),r.mousedown(function(t){t.preventDefault()}).click(function(t){c&&(t.preventDefault(),t.stopImmediatePropagation())}),s.mousedown(function(o){function s(n){k("eventResizeStop",this,e,n),t("body").css("cursor",""),d.stop(),Q(),u&&_(this,e,u,0,n),setTimeout(function(){c=!1},0)}if(1==o.which){c=!0;var u,f,d=tt(),v=(P(),j(),r.css("top")),h=t.extend({},e),g=it(ot(e.start));K(),t("body").css("cursor",i+"-resize").one("mouseup",s),k("eventResizeStart",this,e,o),d.start(function(r,o){if(r){var s=rt(o),c=rt(r);if(c=Math.max(c,g),u=at(c)-at(s)){h.end=l(R(e),u,!0);var d=f;f=n(h,a.row,v),f=t(f),f.find("*").css("cursor",i+"-resize"),d&&d.remove(),A(e)}else f&&(W(e),f.remove(),f=null);Q(),$(e.start,l(C(e),u))}},o)}})}var S=this;S.renderDayEvents=e,S.draggableDayEvent=b,S.resizableDayEvent=M;var T=S.opt,k=S.trigger,H=S.isEventDraggable,F=S.isEventResizable,R=S.eventEnd,N=S.reportEventElement,z=S.eventElementHandlers,W=S.showEvents,A=S.hideEvents,O=S.eventDrop,_=S.eventResize,P=S.getRowCnt,j=S.getColCnt,q=(S.getColWidth,S.allDayRow),X=S.colLeft,J=S.colRight,V=S.colContentLeft,U=S.colContentRight,Z=(S.dateToCell,S.getDaySegmentContainer),G=S.calendar.formatDates,$=S.renderDayOverlay,Q=S.clearOverlays,K=S.clearSelection,tt=S.getHoverListener,et=S.rangeToSegments,nt=S.cellToDate,rt=S.cellToCellOffset,at=S.cellOffsetToDayOffset,ot=S.dateToDayOffset,it=S.dayOffsetToCellOffset}function vt(t,e){for(var n=0;n<e.length;n++){var r=e[n];if(r.leftCol<=t.rightCol&&r.rightCol>=t.leftCol)return!0}return!1}function ht(t,e){for(var n=0;n<t.length;n++){var r=t[n],a=r.element;a&&e(r,a,n)}}function gt(t,e){return e.rightCol-e.leftCol-(t.rightCol-t.leftCol)||e.event.allDay-t.event.allDay||t.event.start-e.event.start||(t.event.title||"").localeCompare(e.event.title)}function pt(){function e(t,e,a){n(),e||(e=l(t,a)),c(t,e,a),r(t,e,a)}function n(t){f&&(f=!1,u(),s("unselect",null,t))}function r(t,e,n,r){f=!0,s("select",null,t,e,n,r)}function a(e){var a=o.cellToDate,s=o.getIsCellAllDay,l=o.getHoverListener(),f=o.reportDayClick;if(1==e.which&&i("selectable")){n(e);var d;l.start(function(t,e){u(),t&&s(t)?(d=[a(e),a(t)].sort(O),c(d[0],d[1],!0)):d=null},e),t(document).one("mouseup",function(t){l.stop(),d&&(+d[0]==+d[1]&&f(d[0],!0,t),r(d[0],d[1],!0,t))})}}var o=this;o.select=e,o.unselect=n,o.reportSelection=r,o.daySelectionMousedown=a;var i=o.opt,s=o.trigger,l=o.defaultSelectionEnd,c=o.renderSelection,u=o.clearSelection,f=!1;i("selectable")&&i("unselectAuto")&&t(document).mousedown(function(e){var r=i("unselectCancel");r&&t(e.target).parents(r).length||n(e)})}function mt(){function e(e,n){var r=o.shift();return r||(r=t("<div class='fc-cell-overlay' style='position:absolute;z-index:3'/>")),r[0].parentNode!=n[0]&&r.appendTo(n),a.push(r.css(e).show()),r}function n(){for(var t;t=a.shift();)o.push(t.hide().unbind())}var r=this;r.renderOverlay=e,r.clearOverlays=n;var a=[],o=[]}function yt(t){var e,n,r=this;r.build=function(){e=[],n=[],t(e,n)},r.cell=function(t,r){var a,o=e.length,i=n.length,s=-1,l=-1;for(a=0;o>a;a++)if(r>=e[a][0]&&r<e[a][1]){s=a;break}for(a=0;i>a;a++)if(t>=n[a][0]&&t<n[a][1]){l=a;break}return s>=0&&l>=0?{row:s,col:l}:null},r.rect=function(t,r,a,o,i){var s=i.offset();return{top:e[t][0]-s.top,left:n[r][0]-s.left,width:n[o][1]-n[r][0],height:e[a][1]-e[t][0]}}}function wt(e){function n(t){Dt(t);var n=e.cell(t.pageX,t.pageY);(!n!=!i||n&&(n.row!=i.row||n.col!=i.col))&&(n?(o||(o=n),a(n,o,n.row-o.row,n.col-o.col)):a(n,o),i=n)}var r,a,o,i,s=this;s.start=function(s,l,c){a=s,o=i=null,e.build(),n(l),r=c||"mousemove",t(document).bind(r,n)},s.stop=function(){return t(document).unbind(r,n),i}}function Dt(t){t.pageX===e&&(t.pageX=t.originalEvent.pageX,t.pageY=t.originalEvent.pageY)}function bt(t){function n(e){return a[e]=a[e]||t(e)}var r=this,a={},o={},i={};r.left=function(t){return o[t]=o[t]===e?n(t).position().left:o[t]},r.right=function(t){return i[t]=i[t]===e?r.left(t)+n(t).width():i[t]},r.clear=function(){a={},o={},i={}}}var Ct={defaultView:"month",aspectRatio:1.35,header:{left:"title",center:"",right:"today prev,next"},weekends:!0,weekNumbers:!1,weekNumberCalculation:"iso",weekNumberTitle:"W",allDayDefault:!0,ignoreTimezone:!0,lazyFetching:!0,startParam:"start",endParam:"end",titleFormat:{month:"MMMM yyyy",week:"MMM d[ yyyy]{ '—'[ MMM] d yyyy}",day:"dddd, MMM d, yyyy"},columnFormat:{month:"ddd",week:"ddd M/d",day:"dddd M/d"},timeFormat:{"":"h(:mm)t"},isRTL:!1,firstDay:0,monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],buttonText:{prev:"<span class='fc-text-arrow'>‹</span>",next:"<span class='fc-text-arrow'>›</span>",prevYear:"<span class='fc-text-arrow'>«</span>",nextYear:"<span class='fc-text-arrow'>»</span>",today:"today",month:"month",week:"week",day:"day"},theme:!1,buttonIcons:{prev:"circle-triangle-w",next:"circle-triangle-e"},unselectAuto:!0,dropAccept:"*",handleWindowResize:!0},Mt={header:{left:"next,prev today",center:"",right:"title"},buttonText:{prev:"<span class='fc-text-arrow'>›</span>",next:"<span class='fc-text-arrow'>‹</span>",prevYear:"<span class='fc-text-arrow'>»</span>",nextYear:"<span class='fc-text-arrow'>«</span>"},buttonIcons:{prev:"circle-triangle-e",next:"circle-triangle-w"}},Et=t.fullCalendar={version:"1.6.4"},St=Et.views={};t.fn.fullCalendar=function(n){if("string"==typeof n){var a,o=Array.prototype.slice.call(arguments,1);return this.each(function(){var r=t.data(this,"fullCalendar");if(r&&t.isFunction(r[n])){var i=r[n].apply(r,o);a===e&&(a=i),"destroy"==n&&t.removeData(this,"fullCalendar")}}),a!==e?a:this}n=n||{};var i=n.eventSources||[];return delete n.eventSources,n.events&&(i.push(n.events),delete n.events),n=t.extend(!0,{},Ct,n.isRTL||n.isRTL===e&&Ct.isRTL?Mt:{},n),this.each(function(e,a){var o=t(a),s=new r(o,n,i);o.data("fullCalendar",s),s.render()}),this},Et.sourceNormalizers=[],Et.sourceFetchers=[];var Tt={dataType:"json",cache:!1},xt=1;Et.addDays=l,Et.cloneDate=d,Et.parseDate=p,Et.parseISO8601=m,Et.parseTime=y,Et.formatDate=w,Et.formatDates=D;var kt=["sun","mon","tue","wed","thu","fri","sat"],Ht=864e5,Ft=36e5,Rt=6e4,Nt={s:function(t){return t.getSeconds()},ss:function(t){return _(t.getSeconds())},m:function(t){return t.getMinutes()},mm:function(t){return _(t.getMinutes())},h:function(t){return t.getHours()%12||12},hh:function(t){return _(t.getHours()%12||12)},H:function(t){return t.getHours()},HH:function(t){return _(t.getHours())},d:function(t){return t.getDate()},dd:function(t){return _(t.getDate())},ddd:function(t,e){return e.dayNamesShort[t.getDay()]},dddd:function(t,e){return e.dayNames[t.getDay()]},M:function(t){return t.getMonth()+1},MM:function(t){return _(t.getMonth()+1)},MMM:function(t,e){return e.monthNamesShort[t.getMonth()]},MMMM:function(t,e){return e.monthNames[t.getMonth()]},yy:function(t){return(t.getFullYear()+"").substring(2)},yyyy:function(t){return t.getFullYear()},t:function(t){return t.getHours()<12?"a":"p"},tt:function(t){return t.getHours()<12?"am":"pm"},T:function(t){return t.getHours()<12?"A":"P"},TT:function(t){return t.getHours()<12?"AM":"PM"},u:function(t){return w(t,"yyyy-MM-dd'T'HH:mm:ss'Z'")},S:function(t){var e=t.getDate();return e>10&&20>e?"th":["st","nd","rd"][e%10-1]||"th"},w:function(t,e){return e.weekNumberCalculation(t)},W:function(t){return b(t)}};Et.dateFormatters=Nt,Et.applyAll=q,St.month=J,St.basicWeek=V,St.basicDay=U,n({weekMode:"fixed"}),St.agendaWeek=$,St.agendaDay=Q,n({allDaySlot:!0,allDayText:"all-day",firstHour:6,slotMinutes:30,defaultEventMinutes:120,axisFormat:"h(:mm)tt",timeFormat:{agenda:"h:mm{ - h:mm}"},dragOpacity:{agenda:.5},minTime:0,maxTime:24,slotEventOverlap:!0})}(jQuery);