/** @license DayPilot Pro Copyright (c) 2005 - 2017 Annpoint s.r.o. http://www.daypilot.org/ Use of this software is subject to license terms. Version: 2709 */ if("undefined"==typeof DayPilot)var DayPilot={};if("undefined"==typeof DayPilot.Global&&(DayPilot.Global={}),function(){function e(e){var t=DayPilot.Date.Cache.Ticks;if(t[e])return DayPilot.Stats.cacheHitsTicks+=1,t[e];var i,n=new Date(e),a=n.getUTCMilliseconds();i=0===a?"":a<10?".00"+a:a<100?".0"+a:"."+a;var o=n.getUTCSeconds();o<10&&(o="0"+o);var r=n.getUTCMinutes();r<10&&(r="0"+r);var s=n.getUTCHours();s<10&&(s="0"+s);var l=n.getUTCDate();l<10&&(l="0"+l);var d=n.getUTCMonth()+1;d<10&&(d="0"+d);var c=n.getUTCFullYear();if(c<=0)throw"The minimum year supported is 1.";c<10?c="000"+c:c<100?c="00"+c:c<1e3&&(c="0"+c);var h=c+"-"+d+"-"+l+"T"+s+":"+r+":"+o+i;return t[e]=h,h}function t(e,t){return!DayPilot.Util.isNullOrUndefined(e)&&(!DayPilot.Util.isNullOrUndefined(t)&&e.toLocaleLowerCase()===t.toLocaleLowerCase())}if("undefined"==typeof DayPilot.$){DayPilot.$=function(e){return document.getElementById(e)},DayPilot.isKhtml=navigator&&navigator.userAgent&&navigator.userAgent.indexOf("KHTML")!==-1,DayPilot.isIE=navigator&&navigator.userAgent&&(navigator.userAgent.indexOf("MSIE")!==-1||navigator.userAgent.indexOf("Trident")!==-1),DayPilot.isIEQuirks=DayPilot.isIE&&document.compatMode&&"BackCompat"===document.compatMode,DayPilot.browser={},DayPilot.browser.ie8=function(){var e=document.createElement("div");return e.innerHTML="",1===e.getElementsByTagName("i").length}(),DayPilot.browser.ie9=function(){var e=document.createElement("div");return e.innerHTML="",1===e.getElementsByTagName("i").length}(),DayPilot.browser.ielt9=function(){var e=document.createElement("div");return e.innerHTML="",1===e.getElementsByTagName("i").length}(),DayPilot.browser.ff=navigator&&navigator.userAgent&&navigator.userAgent.indexOf("Firefox")!==-1,DayPilot.browser.chrome=navigator&&navigator.userAgent&&navigator.userAgent.indexOf("Chrome")!==-1,DayPilot.browser.ie=DayPilot.isIE,DayPilot.browser.webkit=navigator&&navigator.userAgent&&navigator.userAgent.indexOf("WebKit")!==-1,DayPilot.browser.passiveEvents=!1,function(){try{window.addEventListener("test",null,Object.defineProperty({},"passive",{"get":function(){DayPilot.browser.passiveEvents=!0}}))}catch(e){}}(),DayPilot.libs={},DayPilot.libs.angularjs="object"==typeof angularjs,DayPilot.touch={},DayPilot.touch.start=window.navigator.msPointerEnabled?"MSPointerDown":"touchstart",DayPilot.touch.move=window.navigator.msPointerEnabled?"MSPointerMove":"touchmove",DayPilot.touch.end=window.navigator.msPointerEnabled?"MSPointerUp":"touchend",DayPilot.mo2=function(e,t){if(t=t||window.event,"undefined"!=typeof t.offsetX){var i={x:t.offsetX+1,y:t.offsetY+1};if(!e)return i;for(var n=t.srcElement;n&&n!==e;)"SPAN"!==n.tagName&&(i.x+=n.offsetLeft,n.offsetTop>0&&(i.y+=n.offsetTop-n.scrollTop)),n=n.offsetParent;return n?i:null}if("undefined"!=typeof t.layerX){var i={x:t.layerX,y:t.layerY,src:t.target};if(!e)return i;for(var n=t.target;n&&"absolute"!==n.style.position&&"relative"!==n.style.position;)n=n.parentNode,DayPilot.isKhtml&&(i.y+=n.scrollTop);for(;n&&n!==e;)i.x+=n.offsetLeft,i.y+=n.offsetTop-n.scrollTop,n=n.offsetParent;return n?i:null}return null},DayPilot.mo3=function(e,t){t=t||window.event;var i,n=DayPilot.page(t);if(n){var a=DayPilot.abs(e);i={x:n.x-a.x,y:n.y-a.y}}else i=DayPilot.mo2(e,t);return i.shift=t.shiftKey,i.meta=t.metaKey,i.ctrl=t.ctrlKey,i.alt=t.altKey,i},DayPilot.mc=function(e){return e.pageX||e.pageY?{x:e.pageX,y:e.pageY}:{x:e.clientX+document.documentElement.scrollLeft,y:e.clientY+document.documentElement.scrollTop}},DayPilot.Stats={},DayPilot.Stats.eventObjects=0,DayPilot.Stats.dateObjects=0,DayPilot.Stats.cacheHitsCtor=0,DayPilot.Stats.cacheHitsParsing=0,DayPilot.Stats.cacheHitsTicks=0,DayPilot.Stats.print=function(){console.log("DayPilot.Stats.eventObjects: "+DayPilot.Stats.eventObjects),console.log("DayPilot.Stats.dateObjects: "+DayPilot.Stats.dateObjects),console.log("DayPilot.Stats.cacheHitsCtor: "+DayPilot.Stats.cacheHitsCtor),console.log("DayPilot.Stats.cacheHitsParsing: "+DayPilot.Stats.cacheHitsParsing),console.log("DayPilot.Stats.cacheHitsTicks: "+DayPilot.Stats.cacheHitsTicks),console.log("DayPilot.Date.Cache.Ctor keys: "+Object.keys(DayPilot.Date.Cache.Ctor).length),console.log("DayPilot.Date.Cache.Parsing keys: "+Object.keys(DayPilot.Date.Cache.Parsing).length)},DayPilot.list=function(e,t){if(e&&e.isDayPilotList&&!t)return e;var i=DayPilot.isArray(e)||"[object NodeList]"===Object.prototype.toString.call(e),n=!i&&!DayPilot.Util.isNullOrUndefined(e),a=[];if(a.isDayPilotList=!0,a.clone=function(){var e=DayPilot.list();return a.each(function(t){e.push(t)}),e},a.each=function(e){if(e){if(a.forEach)return void a.forEach(e);for(var t=0;to.y&&(l-=180);var g=document.createElement("div");g.style.borderColor="transparent black transparent transparent",g.style.borderWidth="6px",g.style.borderStyle="solid",g.style.position="absolute",g.style.left=p+"px",g.style.top=v+"px",g.style.transform="rotate("+l+"deg)",f.appendChild(g)}return f},DayPilot.deg=function(e,t,i,n){var a,o=Math.abs(e-i),r=Math.abs(t-n),s=(e+i)/2,l=(t+n)/2,d=Math.sqrt(o*o+r*r),c=s-d/2,h=l;o=d/2,a=Math.abs(s-c),r=Math.sqrt(Math.abs(e-c)*Math.abs(e-c)+Math.abs(t-h)*Math.abs(t-h));var u=(r*r-o*o-a*a)/(2*o*a);return 180*Math.acos(u)/Math.PI},DayPilot.complete=function(e){return"complete"===document.readyState?void e():(DayPilot.complete.list||(DayPilot.complete.list=[],DayPilot.re(document,"readystatechange",function(){if("complete"===document.readyState){for(var e=0;e0&&i.x+i.w>e.clientWidth&&(i.w-=i.x+i.w-e.clientWidth),e.scrollTop&&i.y+i.h>e.clientHeight&&(i.h-=i.y+i.h-e.clientHeight)),i.x+=e.offsetLeft,i.y+=e.offsetTop;var n=DayPilot.pageOffset();return i.x+=n.x,i.y+=n.y,i},DayPilot.wd=function(){var e=DayPilot.isIEQuirks,t=document.documentElement.clientHeight;e&&(t=document.body.clientHeight);var i=document.documentElement.clientWidth;e&&(i=document.body.clientWidth);var n=document.documentElement&&document.documentElement.scrollTop||document.body.scrollTop,a=document.documentElement&&document.documentElement.scrollLeft||document.body.scrollLeft,o={};return o.width=i,o.height=t,o.scrollTop=n,o.scrollLeft=a,o},DayPilot.op=function(e){try{return e.offsetParent}catch(e){return document.body}},DayPilot.distance=function(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))},DayPilot.doc=function(){var e=document.documentElement;return e&&e.clientHeight?e:document.body},DayPilot.pageOffset=function(){if("undefined"!=typeof pageXOffset)return{x:pageXOffset,y:pageYOffset};var e=DayPilot.doc();return{x:e.scrollLeft,y:e.scrollTop}},DayPilot.ac=function(e,t){if(!t)var t=[];for(var i=0;e.children&&i/g,">"),t=t.replace(/"/g,""")},DayPilot.he2=function(e){var t=document.createTextNode(e),i=document.createElement("div");return i.appendChild(t),i.innerHTML},DayPilot.us=function(e){if(e){e.setAttribute("unselectable","on"),e.style.userSelect="none",e.style.MozUserSelect="none",e.style.KhtmlUserSelect="none",e.style.webkitUserSelect="none";for(var t=0;t0,o=t<0;if(0!==t){if(a?e.status="in":o&&(e.status="out"),a&&!n)e.target=parseFloat(e.style.opacity),e.opacity=0,e.style.opacity=0,e.style.filter="alpha(opacity=0)",e.style.display="";else if(o&&!e.target)e.target=e.style.opacity;else{var r=e.opacity,s=Math.floor(10*(r+t))/10;a&&s>e.target&&(s=e.target),o&&s<0&&(s=0);var l=100*s;e.opacity=s,e.style.opacity=s,e.style.filter="alpha(opacity="+l+")"}if(a&&(e.opacity>=e.target||e.opacity>=1)||o&&e.opacity<=0){if(e.target=null,o){e.style.opacity=e.target,e.opacity=e.target;var d=e.target?"alpha(opacity="+100*e.target+")":null;e.style.filter=d,e.style.display="none"}i&&"function"==typeof i&&(e.status=null,i())}else e.messageTimeout=setTimeout(function(){DayPilot.fade(e,t,i)},50)}}},DayPilot.sw=function(e){return e?e.offsetWidth-e.clientWidth:0},DayPilot.swa=function(){var e=document.createElement("div");e.style.position="absolute",e.style.top="-2000px",e.style.left="-2000px",e.style.width="200px",e.style.height="100px",e.style.overflow="auto";var t=document.createElement("div");t.style.width="300px",t.style.height="300px",e.appendChild(t),document.body.appendChild(e);var i=DayPilot.sw(e);return document.body.removeChild(e),i},DayPilot.sh=function(e){return e?e.offsetHeight-e.clientHeight:0},DayPilot.guid=function(){var e=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};return""+e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()},DayPilot.ua=function(e){if("string"==typeof e||"number"==typeof e)return[e];for(var t={},i=[],n=0,a=e.length;n.8;n-=i)e.push(n),t=n;for(var n=t;n<=1;n+=i)e.push(n),t=n;return e},i=function(){var e=[];e.time=10;var t,i=.04;t=.1;for(var n=t;n<=1;n+=i)e.push(n),t=n;return e},n=function(){var e=[];e.time=10;var t,i=.08;t=.1;for(var n=t;n<=1;n+=i)e.push(n),t=n;return e},a={"fast":n,"slow":i,"jump":t};return a[e]||(e="fast"),a[e]()}function i(e){var t,n=e.div,a=e[e.i],o=a*e.target.h;switch(e.config.vertical){case"center":t=e.target.y-(o-e.target.h)/2;break;case"top":t=e.target.y;break;case"bottom":t=e.target.y-(o-e.target.h);break;default:throw"Unexpected 'vertical' value."}var r,s=a*e.target.w;switch(e.config.horizontal){case"left":r=e.target.x;break;case"center":r=e.target.x-(s-e.target.w)/2;break;case"right":r=e.target.x-(s-e.target.w);break;default:throw"Unexpected 'horizontal' value."}var l=DayPilot.wd(),d=l.height+l.scrollTop-(t+o);d<0&&(t+=d);var c=l.width-(r+s);c<0&&(r+=c),n.style.height=o+"px",n.style.top=t+"px",n.style.width=s+"px",n.style.left=r+"px",n.style.visibility="visible",e.i++,e.i=n)},DayPilot.Util.isMouseEvent=function(e){return!!navigator.msPointerEnabled&&(!!e.pointerType&&("mouse"===e.pointerType||4===e.pointerType))},DayPilot.Util.mouseButton=function(e){var t={};if(e=e||window.event,"undefined"==typeof e.which)switch(e.button){case 1:t.left=!0;break;case 4:t.middle=!0;break;case 2:t.right=!0;break;case 0:t.unknown=!0}else switch(e.which){case 1:t.left=!0;break;case 2:t.middle=!0;break;case 3:t.right=!0}return t},DayPilot.Util.membersPlain=function(e){var t=DayPilot.Util.members(e,2),i=function(e){for(var t=0;t=0)&&!(t.indexOf("after")>=0)},DayPilot.Util.safeApply=function(e,t){var i=e["$root"]["$$phase"];"$apply"===i||"$digest"===i?e["$eval"](t):e["$apply"](t)},DayPilot.Util.members=function(e,t){var i=DayPilot.list(),n=DayPilot.list(),a=DayPilot.list(),o=e&&e.members?e.members.obsolete:[],r=e&&e.members?e.members.noCssOnly:[],s=e&&e.members?e.members.ignore:[],l=e&&e.members&&e.members.ignoreFilter?e.members.ignoreFilter:function(){return!1};for(var d in e)if(0!==d.indexOf("$")&&0!==d.indexOf("_")&&0!==d.indexOf("number")&&0!==d.indexOf("is")&&"v"!==d&&!DayPilot.contains(s,d)&&!l(d))if(0!==d.indexOf("on"))if("function"!=typeof e[d])if("object"!=typeof e[d])a.push(d);else{var c=e[d];if(0===t){a.push(d);continue}if(c&&c.nodeType>0){a.push(d);continue}if(c instanceof DayPilot.Bubble){a.push(d);continue}if(c instanceof DayPilot.Date){a.push(d);continue}if(c instanceof DayPilot.Menu){a.push(d);continue}if(c instanceof DayPilot.Scheduler){a.push(d);continue}if(DayPilot.isArray(c)){a.push(d);continue}null===c&&a.push(d);var h=null;"number"==typeof t&&(h=t-1);for(var u=DayPilot.Util.members(c,h),f=0;f0)for(var o=0;o0))){e.areas=[];for(var o=0;o0){for(;e>=12;)e-=12,i++;e>12-n?(i++,n=e-(12-n)):n+=e}else{for(;e<=-12;)e+=12,i--;n+e<=0?(i--,n=12+n+e):n+=e}var a=new Date(t.getTime());a.setUTCDate(1),a.setUTCFullYear(i),a.setUTCMonth(n-1);var o=new DayPilot.Date(a).daysInMonth();return a.setUTCDate(Math.min(o,t.getUTCDate())),new DayPilot.Date(a)},DayPilot.Date.prototype.addSeconds=function(e){return this.addTime(1e3*e)},DayPilot.Date.prototype.addTime=function(e){return e instanceof DayPilot.Duration&&(e=e.ticks),new DayPilot.Date(this.ticks+e)},DayPilot.Date.prototype.addYears=function(e){var t=new Date(this.ticks),i=new Date(this.ticks),n=this.getYear()+e,a=this.getMonth();i.setUTCDate(1),i.setUTCFullYear(n),i.setUTCMonth(a);var o=new DayPilot.Date(i).daysInMonth();return i.setUTCDate(Math.min(o,t.getUTCDate())),new DayPilot.Date(i)},DayPilot.Date.prototype.dayOfWeek=function(){return new Date(this.ticks).getUTCDay()},DayPilot.Date.prototype.getDayOfWeek=function(){return new Date(this.ticks).getUTCDay()},DayPilot.Date.prototype.daysInMonth=function(){var e=new Date(this.ticks),t=e.getUTCMonth()+1,i=e.getUTCFullYear(),n=[31,28,31,30,31,30,31,31,30,31,30,31];return 2!==t?n[t-1]:i%4!==0?n[1]:i%100===0&&i%400!==0?n[1]:n[1]+1},DayPilot.Date.prototype.daysInYear=function(){var e=this.getYear();return e%4!==0?365:e%100===0&&e%400!==0?365:366},DayPilot.Date.prototype.dayOfYear=function(){return Math.ceil((this.getDatePart().getTime()-this.firstDayOfYear().getTime())/864e5)+1},DayPilot.Date.prototype.equals=function(e){if(null===e)return!1;if(e instanceof DayPilot.Date)return this===e;throw"The parameter must be a DayPilot.Date object (DayPilot.Date.equals())"},DayPilot.Date.prototype.firstDayOfMonth=function(){var e=new Date;return e.setUTCFullYear(this.getYear(),this.getMonth(),1),e.setUTCHours(0),e.setUTCMinutes(0),e.setUTCSeconds(0),e.setUTCMilliseconds(0),new DayPilot.Date(e)},DayPilot.Date.prototype.firstDayOfYear=function(){var e=this.getYear(),t=new Date;return t.setUTCFullYear(e,0,1),t.setUTCHours(0),t.setUTCMinutes(0),t.setUTCSeconds(0),t.setUTCMilliseconds(0),new DayPilot.Date(t)},DayPilot.Date.prototype.firstDayOfWeek=function(e){for(var t=this,e=e||0,i=t.dayOfWeek();i!==e;)t=t.addDays(-1),i=t.dayOfWeek();return new DayPilot.Date(t)},DayPilot.Date.prototype.getDay=function(){return new Date(this.ticks).getUTCDate()},DayPilot.Date.prototype.getDatePart=function(){var e=new Date(this.ticks);return e.setUTCHours(0),e.setUTCMinutes(0),e.setUTCSeconds(0),e.setUTCMilliseconds(0),new DayPilot.Date(e)},DayPilot.Date.prototype.getYear=function(){return new Date(this.ticks).getUTCFullYear()},DayPilot.Date.prototype.getHours=function(){return new Date(this.ticks).getUTCHours()},DayPilot.Date.prototype.getMilliseconds=function(){return new Date(this.ticks).getUTCMilliseconds()},DayPilot.Date.prototype.getMinutes=function(){return new Date(this.ticks).getUTCMinutes()},DayPilot.Date.prototype.getMonth=function(){return new Date(this.ticks).getUTCMonth()},DayPilot.Date.prototype.getSeconds=function(){return new Date(this.ticks).getUTCSeconds()},DayPilot.Date.prototype.getTotalTicks=function(){return this.getTime()},DayPilot.Date.prototype.getTime=function(){return this.ticks},DayPilot.Date.prototype.getTimePart=function(){var e=this.getDatePart();return DayPilot.DateUtil.diff(this,e)},DayPilot.Date.prototype.lastDayOfMonth=function(){var e=new Date(this.firstDayOfMonth().getTime()),t=this.daysInMonth();return e.setUTCDate(t),new DayPilot.Date(e)},DayPilot.Date.prototype.weekNumber=function(){var e=this.firstDayOfYear(),t=(this.getTime()-e.getTime())/864e5;return Math.ceil((t+e.dayOfWeek()+1)/7)},DayPilot.Date.prototype.weekNumberISO=function(){var e=!1,t=this.dayOfYear(),i=this.firstDayOfYear().dayOfWeek(),n=this.firstDayOfYear().addYears(1).addDays(-1).dayOfWeek();0===i&&(i=7),0===n&&(n=7);var a=8-i;4!==i&&4!==n||(e=!0);var o=Math.ceil((t-a)/7),r=o;return a>=4&&(r+=1),r>52&&!e&&(r=1),0===r&&(r=this.firstDayOfYear().addDays(-1).weekNumberISO()),r},DayPilot.Date.prototype.toDateLocal=function(){var e=new Date(this.ticks),t=new Date;return t.setFullYear(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()),t.setHours(e.getUTCHours()),t.setMinutes(e.getUTCMinutes()),t.setSeconds(e.getUTCSeconds()),t.setMilliseconds(e.getUTCMilliseconds()),t},DayPilot.Date.prototype.toDate=function(){return new Date(this.ticks)},DayPilot.Date.prototype.toJSON=function(){return this.value},DayPilot.Date.prototype.toString=function(e,t){return"undefined"==typeof e?this.toStringSortable():new a(e,t).print(this)},DayPilot.Date.prototype.toStringSortable=function(){return e(this.ticks)},DayPilot.Date.parse=function(e,t,i){return new a(t,i).parse(e)};var n=0;DayPilot.Date.today=function(){return new DayPilot.Date(DayPilot.DateUtil.localToday())},DayPilot.Date.fromYearMonthDay=function(e,t,i){t=t||1,i=i||1;var n=new Date(0);return n.setUTCFullYear(e),n.setUTCMonth(t-1),n.setUTCDate(i),new DayPilot.Date(n)},DayPilot.DateUtil={},DayPilot.DateUtil.fromStringSortable=function(e,t){if(!e)throw"Can't create DayPilot.Date from an empty string";var i=e.length,n=10===i,a=19===i,o=i>19;if(!n&&!a&&!o)throw"Invalid string format (use '2010-01-01' or '2010-01-01T00:00:00'): "+e;if(DayPilot.Date.Cache.Parsing[e]&&!t)return DayPilot.Stats.cacheHitsParsing+=1,DayPilot.Date.Cache.Parsing[e];var r=e.substring(0,4),s=e.substring(5,7),l=e.substring(8,10),d=new Date(0);if(d.setUTCFullYear(r,s-1,l),n)return DayPilot.Date.Cache.Parsing[e]=d,d;var c=e.substring(11,13),h=e.substring(14,16),u=e.substring(17,19);if(d.setUTCHours(c),d.setUTCMinutes(h),d.setUTCSeconds(u),a)return DayPilot.Date.Cache.Parsing[e]=d,d;var f=e[19],v=0;if("."===f){var p=parseInt(e.substring(20,23));d.setUTCMilliseconds(p),v=DayPilot.DateUtil.getTzOffsetMinutes(e.substring(23))}else v=DayPilot.DateUtil.getTzOffsetMinutes(e.substring(19));var g=new DayPilot.Date(d);return t||(g=g.addMinutes(-v)),d=g.toDate(),DayPilot.Date.Cache.Parsing[e]=d,d},DayPilot.DateUtil.getTzOffsetMinutes=function(e){if(DayPilot.Util.isNullOrUndefined(e)||""===e)return 0;if("Z"===e)return 0;var t=e[0],i=parseInt(e.substring(1,3)),n=parseInt(e.substring(4)),a=60*i+n;if("-"===t)return-a;if("+"===t)return a;throw"Invalid timezone spec: "+e},DayPilot.DateUtil.hasTzSpec=function(e){return!!e.indexOf("+")||!!e.indexOf("-")},DayPilot.DateUtil.daysDiff=function(e,t){if(e&&t||function(){throw"two parameters required"}(),e=new DayPilot.Date(e),t=new DayPilot.Date(t),e.getTime()>t.getTime())return null;for(var i=0,n=e.getDatePart(),a=t.getDatePart();nt.getTime()?e:t},DayPilot.DateUtil.min=function(e,t){return e.getTime()0){var d=l[0],c=i(d);c?r.push(c):r.push(d),o+=d.length,a=e.length<=o}else a=!0}for(var h=0;h12||i<1)return null;var n=this.day.findValue(e),a=DayPilot.Date.fromYearMonthDay(t,i).daysInMonth();if(n<1||n>a)return null;var o=this.hours?this.hours.findValue(e):0,r=this.minutes?this.minutes.findValue(e):0,s=this.seconds?this.seconds.findValue(e):0,l=this.ampm?this.ampm.findValue(e):null;if(this.ampm&&this.hours12){var d=this.hours12.findValue(e);if(d<1||d>12)return null;o="PM"===l?12===d?12:d+12:12===d?0:d}if(o<0||o>23)return null;if(r<0||r>59)return null;if(s<0||s>59)return null;var c=new Date;return c.setUTCFullYear(t,i-1,n),c.setUTCHours(o),c.setUTCMinutes(r),c.setUTCSeconds(s),c.setUTCMilliseconds(0),new DayPilot.Date(c)},this.init()};DayPilot.Canvas=function(e,t,i,n,a){var n=n||1,o=document.createElement("canvas");o.width=e*n,o.height=t*n;var r=o.getContext("2d");r.scale(n,n),this.defaultFileName="image.png","image/jpeg"===i&&(this.defaultFileName="image.jpg",a=a||.92),this.fillRect=function(e,t){r.save(),r.strokeStyle="rgb(0,0,0,0)",r.fillStyle=t,r.fillRect(e.x+.5,e.y+.5,e.w-.5,e.h-.5),r.restore()},this.rect=function(e,t){r.save(),r.strokeStyle=t,r.beginPath(),r.rect(e.x+.5,e.y+.5,e.w-1,e.h-1),r.stroke(),r.restore()},this.text=function(e,t,i,n,a,o){if("number"==typeof t&&(t=""+t),"string"!=typeof t)throw"String expected";a=a||"left",o=o||0,n=n||"#000",r.save();var s=parseInt(i.size),l=DayPilot.browser.ff?3:0;l+=.2*s,l+=DayPilot.browser.chrome?1:0,l+=DayPilot.browser.ie?1:0,r.rect(e.x+.5+o,e.y+.5+o,e.w-1-o,e.h-1-o),r.clip(),r.fillStyle=n,r.font=i.style+" "+i.size+" "+i.family,r.textBaseline="top",r.textAlign=a;var d=e.x;switch(a){case"center":d+=e.w/2;break;case"right":d+=e.w}var c=0;d+=c;for(var h=1.2*parseInt(i.size),u=t.split("\n"),f=e.y+c+o+l,v=0;v"},this.getDataUri=function(){return o.toDataURL(i,a)},this.getDefaultFileName=function(){return this.defaultFileName},this.getBlob=function(){return o.msToBlob?o.msToBlob():DayPilot.Util.dataUriToBlob(this.getDataUri())}},DayPilot.Svg=function(e,t){function i(e,t){var i=null;if(e){if("string"==typeof e){if(0===e.indexOf("data:")){var n={};n.dataUri=e,t(n)}i=e}else i=e.src;var e=document.createElement("img");e.onload=function(){var e=document.createElement("canvas");e.width=this.naturalWidth,e.height=this.naturalHeight,e.getContext("2d").drawImage(this,0,0);var i={};i.dataUri=e.toDataURL("image/png"),t(i)},e.src=i}}var n="http://www.w3.org/2000/svg",a=document.createElementNS(n,"svg");a.outerHTML&&a.setAttribute("xmlns",n),a.setAttribute("viewBox","0 0 "+e+" "+t),this.defaultFileName="image.svg",this.fillRect=function(e,t){var i=document.createElementNS(n,"rect");i.setAttribute("x",e.x+.5),i.setAttribute("y",e.y+.5),i.setAttribute("width",e.w-1),i.setAttribute("height",e.h-1),i.setAttribute("fill",t),a.appendChild(i)},this.rect=function(e,t){var i=document.createElementNS(n,"rect");i.setAttribute("x",e.x+.5),i.setAttribute("y",e.y+.5),i.setAttribute("width",e.w-1),i.setAttribute("height",e.h-1),i.setAttribute("stroke",t),i.setAttribute("stroke-width","1"), i.setAttribute("fill","transparent"),a.appendChild(i)},this.text=function(e,t,i,o,r,s){function l(e,t,r){var s=document.createElementNS(n,"text");s.setAttribute("fill",o),s.setAttribute("font-family",i.family),s.setAttribute("font-size",i.size),s.setAttribute("font-style",i.style),s.setAttribute("x",t),s.setAttribute("y",r),s.setAttribute("dy","1em"),s.setAttribute("text-anchor",h),s.setAttribute("clip-path","url(#"+u.id+")");var l=document.createTextNode(e);s.appendChild(l),a.appendChild(s)}if("number"==typeof t&&(t=""+t),"string"!=typeof t)throw"String expected";var r=r||"left",s=s||0,d=3,c=e.x,h="start";switch(r){case"center":c+=e.w/2,h="middle";break;case"right":c+=e.w,h="end"}var u=document.createElementNS(n,"clipPath");u.id="clip"+DayPilot.guid();var f=document.createElementNS(n,"rect");f.setAttribute("x",e.x),f.setAttribute("y",e.y),f.setAttribute("width",e.w),f.setAttribute("height",e.h),u.appendChild(f),a.appendChild(u);for(var v=1.2*parseInt(i.size),p=t.split("\n"),g=e.y+s+d,m=0;m'+(new XMLSerializer).serializeToString(t)},this.getDataUri=function(){return"data:application/vnd.ms-excel,"+encodeURIComponent(this.getSource())},this.getElement=function(){return t},this.getDefaultFileName=function(){return"spreadsheet.xls"},this.getBlob=function(){return new Blob([this.getSource()])};var o=function(e){var i=t.createElement("Table");e.appendChild(i);var n=t.createElement("x:WorksheetOptions");e.appendChild(n),this.rows=[],this.setName=function(t){e.setAttribute("ss:Name",t)},this.cell=function(e,n){for(;n>=this.rows.length;){var o=t.createElement("Row");i.appendChild(o),this.rows.push(new a(o))}return this.rows[n].cell(e)},this.enableGridlines=function(e){var i=DayPilot.list(n.childNodes).find(function(e){return"x:DoNotDisplayGridlines"===e.tagName});if(!i&&!e){var a=t.createElement("x:DoNotDisplayGridlines");n.appendChild(a)}i&&e&&n.removeChild(i)};var a=function(e){this.cells=[],this.getElement=function(){return e},this.cell=function(n){for(;n>=this.cells.length;){var a=t.createElement("Cell");e.appendChild(a),this.cells.push(new i(a))}return this.cells[n]};var i=function(e){this.setText=function(i){var n=t.createElement("Data");n.setAttribute("ss:Type","String");var a=t.createTextNode(i);for(n.appendChild(a);e.firstChild;)e.removeChild(e.firstChild);return e.appendChild(n),this},this.setColspan=function(t){return t>1?e.setAttribute("ss:MergeAcross",t-1):e.removeAttribute("ss:MergeAcross"),this},this.setRowspan=function(t){return t>1?e.setAttribute("ss:MergeDown",t-1):e.removeAttribute("ss:MergeDown"),this},this.setStyle=function(t){if(!(t instanceof r))throw"Invalid argument, Style expected";return e.setAttribute("ss:StyleID",t.getId()),this}}}},r=function(e){var i=DayPilot.guid();e.setAttribute("ss:ID",i);var n=t.createElement("ss:Alignment");e.appendChild(n);var a=t.createElement("ss:Interior");e.appendChild(a);var o=t.createElement("ss:Borders");e.appendChild(o),this.setHorizontalAlignment=function(e){n.setAttribute("ss:Horizontal",e)},this.setVerticalAlignment=function(e){n.setAttribute("ss:Vertical",e)},this.setBackColor=function(e){var t=DayPilot.Util.normalizeColor(e);a.setAttribute("ss:Color",t),a.setAttribute("ss:Pattern","Solid")},this.setBorderColor=function(e){function i(e,i){var n=t.createElement("ss:Border");return n.setAttribute("ss:Position",e),n.setAttribute("ss:LineStyle","Continuous"),n.setAttribute("ss:Color",DayPilot.Util.normalizeColor(i)),n}this.clearBorders();var n=i("Left",e);o.appendChild(n);var a=i("Right",e);o.appendChild(a);var r=i("Top",e);o.appendChild(r);var s=i("Bottom",e);o.appendChild(s)},this.clearBorders=function(){for(;o.firstChild;)o.removeChild(o.firstChild)},this.getId=function(){return i},this.setId=function(t){i=t,e.setAttribute("ss:ID",i)},this.setName=function(t){e.setAttribute("ss:Name",t)}};this.init()},DayPilot.Export=function(e){this.toElement=function(){return e.getElement()},this.dimensions=function(){return{"width":e.getWidth(),"height":e.getHeight()}},this.toHtml=function(){return e.getSource()},this.toDataUri=function(){return e.getDataUri()},this.toBlob=function(){return e.getBlob()},this.print=function(){var t=document.createElement("iframe");t.setAttribute("width",0),t.setAttribute("height",0),t.setAttribute("frameborder",0),t.setAttribute("src","about:blank"),document.body.appendChild(t);var i=t.contentWindow.document;("BackCompat"===i.compatMode?i.body:i.documentElement).innerHTML=e.getSource(),t.contentWindow.document.execCommand("print",!1,null)||(t.contentWindow.focus(),t.contentWindow.print()),document.body.removeChild(t)},this.download=function(t){var t=t||e.getDefaultFileName(),i=e.getBlob();DayPilot.Util.downloadBlob(i,t)}},DayPilot.Exception=function(e){this.message=e},DayPilot.Locale=function(e,t){if(this.id=e,this.dayNames=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],this.dayNamesShort=["Su","Mo","Tu","We","Th","Fr","Sa"],this.monthNames=["January","February","March","April","May","June","July","August","September","October","November","December"],this.monthNamesShort=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],this.datePattern="M/d/yyyy",this.timePattern="H:mm",this.dateTimePattern="M/d/yyyy H:mm",this.timeFormat="Clock12Hours",this.weekStarts=0,t)for(var i in t)this[i]=t[i]},DayPilot.Locale.all={},DayPilot.Locale.find=function(e){if(!e)return null;var t=e.toLowerCase();return t.length>2&&(t=DayPilot.Util.replaceCharAt(t,2,"-")),DayPilot.Locale.all[t]},DayPilot.Locale.register=function(e){DayPilot.Locale.all[e.id]=e},DayPilot.Locale.register(new DayPilot.Locale("ca-es",{"dayNames":["diumenge","dilluns","dimarts","dimecres","dijous","divendres","dissabte"],"dayNamesShort":["dg","dl","dt","dc","dj","dv","ds"],"monthNames":["gener","febrer","març","abril","maig","juny","juliol","agost","setembre","octubre","novembre","desembre",""],"monthNamesShort":["gen.","febr.","març","abr.","maig","juny","jul.","ag.","set.","oct.","nov.","des.",""],"timePattern":"H:mm","datePattern":"dd/MM/yyyy","dateTimePattern":"dd/MM/yyyy H:mm","timeFormat":"Clock24Hours","weekStarts":1})),DayPilot.Locale.register(new DayPilot.Locale("cs-cz",{"dayNames":["neděle","pondělí","úterý","středa","čtvrtek","pátek","sobota"],"dayNamesShort":["ne","po","út","st","čt","pá","so"],"monthNames":["leden","únor","březen","duben","květen","červen","červenec","srpen","září","říjen","listopad","prosinec",""],"monthNamesShort":["I","II","III","IV","V","VI","VII","VIII","IX","X","XI","XII",""],"timePattern":"H:mm","datePattern":"d. M. yyyy","dateTimePattern":"d. M. yyyy H:mm","timeFormat":"Clock24Hours","weekStarts":1})),DayPilot.Locale.register(new DayPilot.Locale("da-dk",{"dayNames":["søndag","mandag","tirsdag","onsdag","torsdag","fredag","lørdag"],"dayNamesShort":["sø","ma","ti","on","to","fr","lø"],"monthNames":["januar","februar","marts","april","maj","juni","juli","august","september","oktober","november","december",""],"monthNamesShort":["jan","feb","mar","apr","maj","jun","jul","aug","sep","okt","nov","dec",""],"timePattern":"HH:mm","datePattern":"dd-MM-yyyy","dateTimePattern":"dd-MM-yyyy HH:mm","timeFormat":"Clock24Hours","weekStarts":1})),DayPilot.Locale.register(new DayPilot.Locale("de-at",{"dayNames":["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],"dayNamesShort":["So","Mo","Di","Mi","Do","Fr","Sa"],"monthNames":["Jänner","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember",""],"monthNamesShort":["Jän","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez",""],"timePattern":"HH:mm","datePattern":"dd.MM.yyyy","dateTimePattern":"dd.MM.yyyy HH:mm","timeFormat":"Clock24Hours","weekStarts":1})),DayPilot.Locale.register(new DayPilot.Locale("de-ch",{"dayNames":["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],"dayNamesShort":["So","Mo","Di","Mi","Do","Fr","Sa"],"monthNames":["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember",""],"monthNamesShort":["Jan","Feb","Mrz","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez",""],"timePattern":"HH:mm","datePattern":"dd.MM.yyyy","dateTimePattern":"dd.MM.yyyy HH:mm","timeFormat":"Clock24Hours","weekStarts":1})),DayPilot.Locale.register(new DayPilot.Locale("de-de",{"dayNames":["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],"dayNamesShort":["So","Mo","Di","Mi","Do","Fr","Sa"],"monthNames":["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember",""],"monthNamesShort":["Jan","Feb","Mrz","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez",""],"timePattern":"HH:mm","datePattern":"dd.MM.yyyy","dateTimePattern":"dd.MM.yyyy HH:mm","timeFormat":"Clock24Hours","weekStarts":1})),DayPilot.Locale.register(new DayPilot.Locale("de-lu",{"dayNames":["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],"dayNamesShort":["So","Mo","Di","Mi","Do","Fr","Sa"],"monthNames":["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember",""],"monthNamesShort":["Jan","Feb","Mrz","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez",""],"timePattern":"HH:mm","datePattern":"dd.MM.yyyy","dateTimePattern":"dd.MM.yyyy HH:mm","timeFormat":"Clock24Hours","weekStarts":1})),DayPilot.Locale.register(new DayPilot.Locale("en-au",{"dayNames":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],"dayNamesShort":["Su","Mo","Tu","We","Th","Fr","Sa"],"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",""],"timePattern":"h:mm tt","datePattern":"d/MM/yyyy","dateTimePattern":"d/MM/yyyy h:mm tt","timeFormat":"Clock12Hours","weekStarts":1})),DayPilot.Locale.register(new DayPilot.Locale("en-ca",{"dayNames":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],"dayNamesShort":["Su","Mo","Tu","We","Th","Fr","Sa"],"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",""],"timePattern":"h:mm tt","datePattern":"yyyy-MM-dd","dateTimePattern":"yyyy-MM-dd h:mm tt","timeFormat":"Clock12Hours","weekStarts":0})),DayPilot.Locale.register(new DayPilot.Locale("en-gb",{"dayNames":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],"dayNamesShort":["Su","Mo","Tu","We","Th","Fr","Sa"],"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",""],"timePattern":"HH:mm","datePattern":"dd/MM/yyyy","dateTimePattern":"dd/MM/yyyy HH:mm","timeFormat":"Clock24Hours","weekStarts":1})),DayPilot.Locale.register(new DayPilot.Locale("en-us",{"dayNames":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],"dayNamesShort":["Su","Mo","Tu","We","Th","Fr","Sa"],"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",""],"timePattern":"h:mm tt","datePattern":"M/d/yyyy","dateTimePattern":"M/d/yyyy h:mm tt","timeFormat":"Clock12Hours","weekStarts":0})),DayPilot.Locale.register(new DayPilot.Locale("es-es",{"dayNames":["domingo","lunes","martes","miércoles","jueves","viernes","sábado"],"dayNamesShort":["D","L","M","X","J","V","S"],"monthNames":["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre",""],"monthNamesShort":["ene.","feb.","mar.","abr.","may.","jun.","jul.","ago.","sep.","oct.","nov.","dic.",""],"timePattern":"H:mm","datePattern":"dd/MM/yyyy","dateTimePattern":"dd/MM/yyyy H:mm","timeFormat":"Clock24Hours","weekStarts":1})),DayPilot.Locale.register(new DayPilot.Locale("es-mx",{"dayNames":["domingo","lunes","martes","miércoles","jueves","viernes","sábado"],"dayNamesShort":["do.","lu.","ma.","mi.","ju.","vi.","sá."],"monthNames":["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre",""],"monthNamesShort":["ene.","feb.","mar.","abr.","may.","jun.","jul.","ago.","sep.","oct.","nov.","dic.",""],"timePattern":"hh:mm tt","datePattern":"dd/MM/yyyy","dateTimePattern":"dd/MM/yyyy hh:mm tt","timeFormat":"Clock12Hours","weekStarts":0})),DayPilot.Locale.register(new DayPilot.Locale("eu-es",{"dayNames":["igandea","astelehena","asteartea","asteazkena","osteguna","ostirala","larunbata"],"dayNamesShort":["ig","al","as","az","og","or","lr"],"monthNames":["urtarrila","otsaila","martxoa","apirila","maiatza","ekaina","uztaila","abuztua","iraila","urria","azaroa","abendua",""],"monthNamesShort":["urt.","ots.","mar.","api.","mai.","eka.","uzt.","abu.","ira.","urr.","aza.","abe.",""],"timePattern":"H:mm","datePattern":"yyyy/MM/dd","dateTimePattern":"yyyy/MM/dd H:mm","timeFormat":"Clock24Hours","weekStarts":1})),DayPilot.Locale.register(new DayPilot.Locale("fi-fi",{"dayNames":["sunnuntai","maanantai","tiistai","keskiviikko","torstai","perjantai","lauantai"],"dayNamesShort":["su","ma","ti","ke","to","pe","la"],"monthNames":["tammikuu","helmikuu","maaliskuu","huhtikuu","toukokuu","kesäkuu","heinäkuu","elokuu","syyskuu","lokakuu","marraskuu","joulukuu",""],"monthNamesShort":["tammi","helmi","maalis","huhti","touko","kesä","heinä","elo","syys","loka","marras","joulu",""],"timePattern":"H:mm","datePattern":"d.M.yyyy","dateTimePattern":"d.M.yyyy H:mm","timeFormat":"Clock24Hours","weekStarts":1})),DayPilot.Locale.register(new DayPilot.Locale("fr-be",{"dayNames":["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],"dayNamesShort":["di","lu","ma","me","je","ve","sa"],"monthNames":["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre",""],"monthNamesShort":["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc.",""],"timePattern":"HH:mm","datePattern":"dd-MM-yy","dateTimePattern":"dd-MM-yy HH:mm","timeFormat":"Clock24Hours","weekStarts":1})),DayPilot.Locale.register(new DayPilot.Locale("fr-ca",{"dayNames":["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],"dayNamesShort":["di","lu","ma","me","je","ve","sa"],"monthNames":["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre",""],"monthNamesShort":["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc.",""],"timePattern":"HH:mm","datePattern":"yyyy-MM-dd","dateTimePattern":"yyyy-MM-dd HH:mm","timeFormat":"Clock24Hours","weekStarts":0})),DayPilot.Locale.register(new DayPilot.Locale("fr-ch",{"dayNames":["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],"dayNamesShort":["di","lu","ma","me","je","ve","sa"],"monthNames":["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre",""],"monthNamesShort":["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc.",""],"timePattern":"HH:mm","datePattern":"dd.MM.yyyy","dateTimePattern":"dd.MM.yyyy HH:mm","timeFormat":"Clock24Hours","weekStarts":1})),DayPilot.Locale.register(new DayPilot.Locale("fr-fr",{"dayNames":["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],"dayNamesShort":["di","lu","ma","me","je","ve","sa"],"monthNames":["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre",""],"monthNamesShort":["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc.",""],"timePattern":"HH:mm","datePattern":"dd/MM/yyyy","dateTimePattern":"dd/MM/yyyy HH:mm","timeFormat":"Clock24Hours","weekStarts":1})),DayPilot.Locale.register(new DayPilot.Locale("fr-lu",{"dayNames":["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],"dayNamesShort":["di","lu","ma","me","je","ve","sa"],"monthNames":["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre",""],"monthNamesShort":["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc.",""],"timePattern":"HH:mm","datePattern":"dd/MM/yyyy","dateTimePattern":"dd/MM/yyyy HH:mm","timeFormat":"Clock24Hours","weekStarts":1})),DayPilot.Locale.register(new DayPilot.Locale("gl-es",{"dayNames":["domingo","luns","martes","mércores","xoves","venres","sábado"],"dayNamesShort":["do","lu","ma","mé","xo","ve","sá"],"monthNames":["xaneiro","febreiro","marzo","abril","maio","xuño","xullo","agosto","setembro","outubro","novembro","decembro",""],"monthNamesShort":["xan","feb","mar","abr","maio","xuño","xul","ago","set","out","nov","dec",""],"timePattern":"H:mm","datePattern":"dd/MM/yyyy","dateTimePattern":"dd/MM/yyyy H:mm","timeFormat":"Clock24Hours","weekStarts":1})),DayPilot.Locale.register(new DayPilot.Locale("it-it",{"dayNames":["domenica","lunedì","martedì","mercoledì","giovedì","venerdì","sabato"],"dayNamesShort":["do","lu","ma","me","gi","ve","sa"],"monthNames":["gennaio","febbraio","marzo","aprile","maggio","giugno","luglio","agosto","settembre","ottobre","novembre","dicembre",""],"monthNamesShort":["gen","feb","mar","apr","mag","giu","lug","ago","set","ott","nov","dic",""],"timePattern":"HH:mm","datePattern":"dd/MM/yyyy","dateTimePattern":"dd/MM/yyyy HH:mm","timeFormat":"Clock24Hours","weekStarts":1})),DayPilot.Locale.register(new DayPilot.Locale("it-ch",{"dayNames":["domenica","lunedì","martedì","mercoledì","giovedì","venerdì","sabato"],"dayNamesShort":["do","lu","ma","me","gi","ve","sa"],"monthNames":["gennaio","febbraio","marzo","aprile","maggio","giugno","luglio","agosto","settembre","ottobre","novembre","dicembre",""],"monthNamesShort":["gen","feb","mar","apr","mag","giu","lug","ago","set","ott","nov","dic",""],"timePattern":"HH:mm","datePattern":"dd.MM.yyyy","dateTimePattern":"dd.MM.yyyy HH:mm","timeFormat":"Clock24Hours","weekStarts":1})),DayPilot.Locale.register(new DayPilot.Locale("ja-jp",{"dayNames":["日曜日","月曜日","火曜日","水曜日","木曜日","金曜日","土曜日"],"dayNamesShort":["日","月","火","水","木","金","土"],"monthNames":["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月",""],"monthNamesShort":["1","2","3","4","5","6","7","8","9","10","11","12",""],"timePattern":"H:mm","datePattern":"yyyy/MM/dd","dateTimePattern":"yyyy/MM/dd H:mm","timeFormat":"Clock24Hours","weekStarts":0})),DayPilot.Locale.register(new DayPilot.Locale("nb-no",{"dayNames":["søndag","mandag","tirsdag","onsdag","torsdag","fredag","lørdag"],"dayNamesShort":["sø","ma","ti","on","to","fr","lø"],"monthNames":["januar","februar","mars","april","mai","juni","juli","august","september","oktober","november","desember",""],"monthNamesShort":["jan","feb","mar","apr","mai","jun","jul","aug","sep","okt","nov","des",""],"timePattern":"HH:mm","datePattern":"dd.MM.yyyy","dateTimePattern":"dd.MM.yyyy HH:mm","timeFormat":"Clock24Hours","weekStarts":1})),DayPilot.Locale.register(new DayPilot.Locale("nl-nl",{"dayNames":["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag"],"dayNamesShort":["zo","ma","di","wo","do","vr","za"],"monthNames":["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december",""],"monthNamesShort":["jan","feb","mrt","apr","mei","jun","jul","aug","sep","okt","nov","dec",""],"timePattern":"HH:mm","datePattern":"d-M-yyyy","dateTimePattern":"d-M-yyyy HH:mm","timeFormat":"Clock24Hours","weekStarts":1})),DayPilot.Locale.register(new DayPilot.Locale("nl-be",{"dayNames":["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag"],"dayNamesShort":["zo","ma","di","wo","do","vr","za"],"monthNames":["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december",""],"monthNamesShort":["jan","feb","mrt","apr","mei","jun","jul","aug","sep","okt","nov","dec",""],"timePattern":"H:mm","datePattern":"d/MM/yyyy","dateTimePattern":"d/MM/yyyy H:mm","timeFormat":"Clock24Hours","weekStarts":1})),DayPilot.Locale.register(new DayPilot.Locale("nn-no",{"dayNames":["søndag","måndag","tysdag","onsdag","torsdag","fredag","laurdag"],"dayNamesShort":["sø","må","ty","on","to","fr","la"],"monthNames":["januar","februar","mars","april","mai","juni","juli","august","september","oktober","november","desember",""],"monthNamesShort":["jan","feb","mar","apr","mai","jun","jul","aug","sep","okt","nov","des",""],"timePattern":"HH:mm","datePattern":"dd.MM.yyyy","dateTimePattern":"dd.MM.yyyy HH:mm","timeFormat":"Clock24Hours","weekStarts":1})),DayPilot.Locale.register(new DayPilot.Locale("pt-br",{"dayNames":["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"],"dayNamesShort":["D","S","T","Q","Q","S","S"],"monthNames":["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro",""],"monthNamesShort":["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez",""],"timePattern":"HH:mm","datePattern":"dd/MM/yyyy","dateTimePattern":"dd/MM/yyyy HH:mm","timeFormat":"Clock24Hours","weekStarts":0})),DayPilot.Locale.register(new DayPilot.Locale("pl-pl",{"dayNames":["niedziela","poniedziałek","wtorek","środa","czwartek","piątek","sobota"],"dayNamesShort":["N","Pn","Wt","Śr","Cz","Pt","So"],"monthNames":["styczeń","luty","marzec","kwiecień","maj","czerwiec","lipiec","sierpień","wrzesień","październik","listopad","grudzień",""],"monthNamesShort":["sty","lut","mar","kwi","maj","cze","lip","sie","wrz","paź","lis","gru",""],"timePattern":"HH:mm","datePattern":"yyyy-MM-dd","dateTimePattern":"yyyy-MM-dd HH:mm","timeFormat":"Clock24Hours","weekStarts":1})),DayPilot.Locale.register(new DayPilot.Locale("pt-pt",{"dayNames":["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"],"dayNamesShort":["D","S","T","Q","Q","S","S"],"monthNames":["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro",""],"monthNamesShort":["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez",""],"timePattern":"HH:mm","datePattern":"dd/MM/yyyy","dateTimePattern":"dd/MM/yyyy HH:mm","timeFormat":"Clock24Hours","weekStarts":0})),DayPilot.Locale.register(new DayPilot.Locale("ro-ro",{"dayNames":["duminică","luni","marți","miercuri","joi","vineri","sâmbătă"],"dayNamesShort":["D","L","Ma","Mi","J","V","S"],"monthNames":["ianuarie","februarie","martie","aprilie","mai","iunie","iulie","august","septembrie","octombrie","noiembrie","decembrie",""],"monthNamesShort":["ian.","feb.","mar.","apr.","mai.","iun.","iul.","aug.","sep.","oct.","nov.","dec.",""],"timePattern":"H:mm","datePattern":"dd.MM.yyyy","dateTimePattern":"dd.MM.yyyy H:mm","timeFormat":"Clock24Hours","weekStarts":1})),DayPilot.Locale.register(new DayPilot.Locale("ru-ru",{"dayNames":["воскресенье","понедельник","вторник","среда","четверг","пятница","суббота"],"dayNamesShort":["Вс","Пн","Вт","Ср","Чт","Пт","Сб"],"monthNames":["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь",""],"monthNamesShort":["янв","фев","мар","апр","май","июн","июл","авг","сен","окт","ноя","дек",""],"timePattern":"H:mm","datePattern":"dd.MM.yyyy","dateTimePattern":"dd.MM.yyyy H:mm","timeFormat":"Clock24Hours","weekStarts":1})),DayPilot.Locale.register(new DayPilot.Locale("sk-sk",{"dayNames":["nedeľa","pondelok","utorok","streda","štvrtok","piatok","sobota"],"dayNamesShort":["ne","po","ut","st","št","pi","so"],"monthNames":["január","február","marec","apríl","máj","jún","júl","august","september","október","november","december",""],"monthNamesShort":["1","2","3","4","5","6","7","8","9","10","11","12",""],"timePattern":"H:mm","datePattern":"d.M.yyyy","dateTimePattern":"d.M.yyyy H:mm","timeFormat":"Clock24Hours","weekStarts":1})),DayPilot.Locale.register(new DayPilot.Locale("sv-se",{"dayNames":["söndag","måndag","tisdag","onsdag","torsdag","fredag","lördag"],"dayNamesShort":["sö","må","ti","on","to","fr","lö"],"monthNames":["januari","februari","mars","april","maj","juni","juli","augusti","september","oktober","november","december",""],"monthNamesShort":["jan","feb","mar","apr","maj","jun","jul","aug","sep","okt","nov","dec",""],"timePattern":"HH:mm","datePattern":"yyyy-MM-dd","dateTimePattern":"yyyy-MM-dd HH:mm","timeFormat":"Clock24Hours","weekStarts":1})),DayPilot.Locale.register(new DayPilot.Locale("tr-tr",{"dayNames":["Pazar","Pazartesi","Salı","Çarşamba","Perşembe","Cuma","Cumartesi"],"dayNamesShort":["Pz","Pt","Sa","Ça","Pe","Cu","Ct"],"monthNames":["Ocak","Şubat","Mart","Nisan","Mayıs","Haziran","Temmuz","Ağustos","Eylül","Ekim","Kasım","Aralık",""],"monthNamesShort":["Oca","Şub","Mar","Nis","May","Haz","Tem","Ağu","Eyl","Eki","Kas","Ara",""],"timePattern":"HH:mm","datePattern":"d.M.yyyy","dateTimePattern":"d.M.yyyy HH:mm","timeFormat":"Clock24Hours","weekStarts":1})),DayPilot.Locale.register(new DayPilot.Locale("zh-cn",{"dayNames":["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],"dayNamesShort":["日","一","二","三","四","五","六"],"monthNames":["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月",""],"monthNamesShort":["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月",""],"timePattern":"H:mm","datePattern":"yyyy/M/d","dateTimePattern":"yyyy/M/d H:mm","timeFormat":"Clock24Hours","weekStarts":1})),DayPilot.Locale.US=DayPilot.Locale.find("en-us"),DayPilot.Switcher=function(e){function t(e,t,n){var a={};a.start=e,a.end=t,a.day=n,a.target=i.active.control,a.preventDefault=function(){this.preventDefault.value=!0};var o=i.k;o&&o.start===a.start&&o.end===a.end&&o.day===a.day&&o.target===a.target||(i.k=a,"function"==typeof i.onChange&&(i.onChange(a),a.preventDefault.value)||"function"==typeof i.onTimeRangeSelect&&(i.onTimeRangeSelect(a),a.preventDefault.value)||(i.active.sendNavigate(i.day),"function"==typeof i.onChanged&&i.onChanged(a),"function"==typeof i.onTimeRangeSelected&&i.onTimeRangeSelected(a)))}var i=this;this.views=[],this.triggers=[],this.navigator={},this.selectedClass=null,this.active=null,this.day=new DayPilot.Date,this.onChange=null,this.onChanged=null,this.navigator.updateMode=function(e){var t=i.navigator.control;t&&(t.selectMode=e,t.select(i.day))},this.addView=function(e,t){var n;if("string"==typeof e){if(n=document.getElementById(e),!n)throw"Element not found: "+e}else n=e;var a=n,o={};return o.isView=!0,o.id=a.id,o.control=a,o.options=t||{},o.hide=function(){a.hide?a.hide():a.nav&&a.nav.top?a.nav.top.style.display="none":a.style.display="none"},o.sendNavigate=function(e){(function(){return!!a.backendUrl||!("function"!=typeof WebForm_DoCallback||!a.uniqueID)})()?a.commandCallBack&&a.commandCallBack("navigate",{"day":e}):(a.startDate=e,a.update())},o.show=function(){i.c(),a.show?a.show():a.nav&&a.nav.top?a.nav.top.style.display="":a.style.display=""},o.selectMode=function(){if(o.options.navigatorSelectMode)return o.options.navigatorSelectMode;if(a.isCalendar)switch(a.viewType){case"Day":return"day";case"Week":return"week";case"WorkWeek":return"week";default:return"day"}else if(a.isMonth)switch(a.viewType){case"Month":return"month";case"Weeks":return"week";default:return"day"}return"day"},this.views.push(o),o},this.addTrigger=function(e,t){var n;if("string"==typeof e){if(n=document.getElementById(e),!n)throw"Element not found: "+e}else n=e;var a=this.f(t);a||(a=this.addView(t));var o={};return o.isTrigger=!0,o.element=n,o.id=n.id,o.view=a,o.onClick=function(e){i.show(o),i.g(o),e=e||window.event,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},DayPilot.re(n,"click",o.onClick),this.triggers.push(o),o},this.addButton=this.addTrigger,this.select=function(e){var t=this.j(e);t?t.onClick():this.triggers.length>0&&this.triggers[0].onClick()},this.j=function(e){for(var t=0;t';"),e.add(".kanban_default_columnmove_handle","opacity: 0.5; background-repeat: no-repeat; background-position: center center; background-color: #ccc; background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAKCAYAAACT+/8OAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjExR/NCNwAAAClJREFUGFdj+P//P4O9vX2Bg4NDP4gNFgBytgPxebgAMsYuQGMz/jMAAFsTZDPYJlDHAAAAAElFTkSuQmCC); cursor: move;"),e.add(".kanban_default_columnmove_position","background-color: #333;"),e.add(".kanban_default_crosshair_vertical, .kanban_default_crosshair_horizontal, .kanban_default_crosshair_left, .kanban_default_crosshair_top","background-color: gray; opacity: 0.2; filter: alpha(opacity=20)"),e.commit(),DayPilot.Global.defaultCss=!0}}();var o=function(e){var t=this;this.id=e,this.widths=[],this.titles=[],this.height=null,this.splitterWidth=3,this.css={},this.css.title=null,this.css.titleInner=null,this.css.splitter=null,this.blocks=[],this.drag={},this.updated=function(){},this.updating=function(){},this.init=function(){var i;if(!e)throw"error: id not provided";if("string"==typeof e)i=document.getElementById(e);else{if(!e.appendChild)throw"error: invalid object provided";i=e}this.div=i,this.blocks=[];for(var n=0;nh-s+o){this.n.mouse.clientY-(h-s)+o;u=this.n.mouse.y-s-10}else u=this.n.mouse.y+22;if("number"==typeof u&&(r.style.top=Math.max(u,0)+"px"),this.n.mouse.clientX>c-l+o){var f=this.n.mouse.clientX-(c-l)+o;r.style.left=this.n.mouse.x-f+"px"}else r.style.left=this.n.mouse.x+"px"}else if("EventTop"===a){var v=2,u=this.n.mouse.y-s-v,p=d.scrollTop;uc&&(g=c-l-o),r.style.left=g+"px"}if(r.style.display="",t){r.style.display="";var m={};m.color=r.firstChild.style.color,m.overflow=r.style.overflow,r.firstChild.style.color="transparent",r.style.overflow="hidden",this.removeShadow(),DayPilot.pop(r,{"finished":function(){r.firstChild.style.color=m.color,r.style.overflow=m.overflow,i.addShadow()},"vertical":"bottom","horizontal":"left","animation":i.animation})}}},this.delayedHide=function(){e.cancelTimeout(),i.hideAfter>0&&(e.timeout=window.setTimeout(e.hideActive,i.hideAfter))},this.showOnMouseOver=function(t){e.cancelTimeout();var n=function(e){return function(){i.show(e)}};e.timeout=window.setTimeout(n(t),this.showAfter)},this.hideOnMouseOut=function(){this.delayedHide()},this.q=function(e){return!!e.calendar.backendUrl||!("function"!=typeof WebForm_DoCallback||!this.uniqueID)},this.addShadow=function(){if(this.useShadow&&!this.cssOnly&&n.div){var e=n.div;this.shadows&&this.shadows.length>0&&this.removeShadow(),this.shadows=[];for(var t=0;t<5;t++){var i=document.createElement("div");i.setAttribute("unselectable","on"),i.style.position="absolute",i.style.width=e.offsetWidth+"px",i.style.height=e.offsetHeight+"px",i.style.top=e.offsetTop+t+"px",i.style.left=e.offsetLeft+t+"px",i.style.zIndex=this.zIndex,i.style.filter="alpha(opacity:10)",i.style.opacity=.1,i.style.backgroundColor="#000000",this.rounded()&&(i.style.MozBorderRadius="5px",i.style.webkitBorderRadius="5px",i.style.borderRadius="5px"),document.body.appendChild(i),this.shadows.push(i)}}},this.removeShadow=function(){if(this.shadows){for(var e=0;e=10.5}return!1}(),this.B.webkit522=function(){if(/AppleWebKit[\/\s](\d+\.\d+)/.test(navigator.userAgent)){return new Number(RegExp.$1)>=522}return!1}(),this.clearSelection=function(){return this.selectedCells?(this.C(),void(this.selectedCells=[])):void(this.selectedCells=[])},this.C=function(){if(this.selectedCells)for(var e=0;ethis.businessEndsHour?24-this.businessBeginsHour+this.businessEndsHour:this.businessEndsHour-this.businessBeginsHour},this.ya=function(){return this.dayBeginsHour>=this.dayEndsHour?24-this.dayBeginsHour+this.dayEndsHour:this.dayEndsHour-this.dayBeginsHour},this.wa=function(e){var t=0;if("BusinessHoursNoScroll"===this.heightSpec)t=this.xa();else if(this.hideFreeCells&&!e){var i=(this.za-1)*this.cellDuration/this.cellHeight,n=Math.ceil(i/60),a=this.businessBeginsHour>this.businessEndsHour?this.businessEndsHour+24:this.businessEndsHour;t=Math.max(this.dayBeginsHour+n,a)-this.Aa()}else t=this.ya();return 60*t*60*1e3},this.message=function(e,t,i,n){if(e){var o,t=t||this.messageHideAfter||2e3,i=i||"#ffffff",n=n||"#000000",r=.8,s=this.Ba(),l=this.showHours?this.hourWidth:0,d=DayPilot.sw(a.Ca());if(this.cssOnly||(s+=1,l+=2,d-=2),a.rtl){var c=l;l=d,d=c}if(this.nav.message)o=a.nav.message,this.nav.message.style.top=s+"px";else{o=document.createElement("div"),o.style.position="absolute",o.style.left=l+"px",o.style.top=s+"px",o.style.right="0px",o.style.display="none",o.onmousemove=function(){o.messageTimeout&&!o.status&&clearTimeout(o.messageTimeout)},o.onmouseout=function(){"none"!==a.nav.message.style.display&&(o.messageTimeout=setTimeout(a.Da,500))};var h=document.createElement("div");h.onclick=function(){a.nav.message.style.display="none"},this.cssOnly?h.className=this.p("_message"):(h.style.padding="5px",h.style.opacity=r,h.style.filter="alpha(opacity=80)"),o.appendChild(h);var u=document.createElement("div");u.style.position="absolute",this.cssOnly?u.className=this.p("_message_close"):(u.style.top="5px",u.style.right=DayPilot.sw(a.Ca())+5+"px",u.style.color=i,u.style.lineHeight="100%",u.style.cursor="pointer",u.style.fontWeight="bold",u.innerHTML="X"),u.onclick=function(){a.nav.message.style.display="none"},o.appendChild(u),this.nav.top.insertBefore(o,this.nav.loading),this.nav.message=o,this.nav.messageClose=u}this.nav.cornerRight?this.nav.message.style.right=d+"px":this.nav.message.style.right="0px";var f=function(){if(a.nav.message){var s=a.nav.message.firstChild;a.cssOnly||(s.style.padding="5px",s.style.opacity=r,s.style.backgroundColor=n,s.style.color=i),s.innerHTML=e;var l=function(){o.messageTimeout=setTimeout(a.Da,t)};DayPilot.fade(a.nav.message,.2,l)}};clearTimeout(o.messageTimeout),"none"!==this.nav.message.style.display?DayPilot.fade(a.nav.message,-.2,f):f()}},this.message.show=function(e){a.message(e)},this.message.hide=function(){a.Da()},this.Da=function(){var e=function(){a.nav.message.style.display="none"};DayPilot.fade(a.nav.message,-.2,e)},this.fa=function(){this.nav.message&&(this.nav.message.style.top=this.Ba()+"px")},this.Ea=function(){return this.wa()/(6e4*this.cellDuration)},this.eventClickPostBack=function(e,t){this.D("EventClick",t,e)},this.eventClickCallBack=function(e,t){this.F("EventClick",e,t)},this.Fa=function(e){var t=this,e=e||window.event,i=e.ctrlKey,n=e.metaKey;if("undefined"!=typeof DayPilot.Bubble&&DayPilot.Bubble.hideActive(),"Disabled"===a.eventDoubleClickHandling)return void a.Ga(t,i,n);if(a.timeouts){for(var o in a.timeouts)window.clearTimeout(a.timeouts[o]);a.timeouts=[]}else a.timeouts=[];var r=function(e,t,i){return function(){a.Ga(e,t,i)}};a.timeouts.push(window.setTimeout(r(this,i,n),a.doubleClickTimeout))},this.Ga=function(e,t,i){var n=e.event;if(n.client.clickEnabled())if(a.ra()){var o={};if(o.e=n,o.ctrl=t,o.meta=i,o.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof a.onEventClick&&(a.onEventClick(o),o.preventDefault.value))return;switch(a.eventClickHandling){case"PostBack":a.eventClickPostBack(n);break;case"CallBack":a.eventClickCallBack(n);break;case"Edit":a.Ha(e);break;case"Select":a.Ia(e,n,t,i);break;case"Bubble":a.bubble&&a.bubble.showEvent(n);break;case"ContextMenu":var r=n.client.contextMenu();r?r.show(n):a.contextMenu&&a.contextMenu.show(n)}"function"==typeof a.onEventClicked&&a.onEventClicked(o)}else switch(a.eventClickHandling){case"PostBack":a.eventClickPostBack(n);break;case"CallBack":a.eventClickCallBack(n);break;case"JavaScript":a.onEventClick(n);break;case"Edit":a.Ha(e);break;case"Select":a.Ia(e,n,t,i);break;case"Bubble":a.bubble&&a.bubble.showEvent(n);break;case"ContextMenu":var r=n.client.contextMenu();r?r.show(n):a.contextMenu&&a.contextMenu.show(n)}},this.eventDoubleClickPostBack=function(e,t){this.D("EventDoubleClick",t,e)},this.eventDoubleClickCallBack=function(e,t){this.F("EventDoubleClick",e,t)},this.Ja=function(e){if("undefined"!=typeof DayPilot.Bubble&&DayPilot.Bubble.hideActive(),a.timeouts){for(var t in a.timeouts)window.clearTimeout(a.timeouts[t]);a.timeouts=null}var i=this.event,e=e||window.event;if(a.ra()){var n={};if(n.e=i,n.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof a.onEventDoubleClick&&(a.onEventDoubleClick(n),n.preventDefault.value))return;switch(a.eventDoubleClickHandling){case"PostBack":a.eventDoubleClickPostBack(i);break;case"CallBack":a.eventDoubleClickCallBack(i);break;case"Edit":i.allday()||a.Ha(this);break;case"Select":i.allday()||a.Ia(this,i,e.ctrlKey);break;case"Bubble":a.bubble&&a.bubble.showEvent(i)}"function"==typeof a.onEventDoubleClicked&&a.onEventDoubleClicked(n)}else switch(a.eventDoubleClickHandling){case"PostBack":a.eventDoubleClickPostBack(i);break;case"CallBack":a.eventDoubleClickCallBack(i);break;case"JavaScript":a.onEventDoubleClick(i);break;case"Edit":i.allday()||a.Ha(this);break;case"Select":i.allday()||a.Ia(this,i,e.ctrlKey);break;case"Bubble":a.bubble&&a.bubble.showEvent(i)}},this.eventRightClickPostBack=function(e,t){this.D("EventRightClick",t,e)},this.eventRightClickCallBack=function(e,t){this.F("EventRightClick",e,t)},this.Ka=function(e){var t=this.event;if(!t.client.rightClickEnabled())return!1;if(a.ra()){var i={};if(i.e=t,i.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof a.onEventRightClick&&(a.onEventRightClick(i),i.preventDefault.value))return;switch(a.eventRightClickHandling){case"PostBack":a.eventRightClickPostBack(t);break;case"CallBack":a.eventRightClickCallBack(t);break;case"ContextMenu":var n=t.client.contextMenu();n?n.show(t):a.contextMenu&&a.contextMenu.show(this.event);break;case"Bubble":a.bubble&&a.bubble.showEvent(t)}"function"==typeof a.onEventRightClicked&&a.onEventRightClicked(i)}else switch(a.eventRightClickHandling){case"PostBack":a.eventRightClickPostBack(t);break;case"CallBack":a.eventRightClickCallBack(t);break;case"JavaScript":a.onEventRightClick(t);break;case"ContextMenu":var n=t.client.contextMenu();n?n.show(t):a.contextMenu&&a.contextMenu.show(this.event);break;case"Bubble":a.bubble&&a.bubble.showEvent(t)}return e.preventDefault&&e.preventDefault(),!1},this.headerClickPostBack=function(e,t){this.D("HeaderClick",t,e)},this.headerClickCallBack=function(e,t){this.F("HeaderClick",e,t)},this.La=function(t){var i=this.data,n=new e.Column(i.id,i.name,i.start);if(a.ra()){var o={};if(o.header={},o.header.id=i.id,o.header.name=i.name,o.header.start=i.start,o.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof a.onHeaderClick&&(a.onHeaderClick(o),o.preventDefault.value))return;switch(a.headerClickHandling){case"PostBack":a.headerClickPostBack(n);break;case"CallBack":a.headerClickCallBack(n)}"function"==typeof a.onHeaderClicked&&a.onHeaderClicked(o)}else switch(a.headerClickHandling){case"PostBack":a.headerClickPostBack(n);break;case"CallBack":a.headerClickCallBack(n);break;case"JavaScript":a.onHeaderClick(n)}},this.Ma=function(){if("undefined"!=typeof DayPilot.Bubble&&a.columnBubble)if("Resources"===a.viewType){var t={};t.calendar=a,t.id=this.data.id,t.toJSON=function(){var e={};return e.id=this.id,e},a.columnBubble.showResource(t)}else{var i=new DayPilot.Date(this.data.start),n=i.addDays(1),o={};o.calendar=a,o.start=i,o.end=n,o.toJSON=function(){var e={};return e.start=this.start,e.end=this.end,e},a.columnBubble.showTime(o)}var r=this,s=r.firstChild;if(!s.active){var l=r.data,d=new e.Column(l.id,l.name,l.start);d.areas=r.data.areas,DayPilot.Areas.showAreas(s,d)}},this.Na=function(e){"undefined"!=typeof DayPilot.Bubble&&a.columnBubble&&a.columnBubble.hideOnMouseOut(),DayPilot.Areas.hideAreas(this.firstChild,e)},this.eventDeletePostBack=function(e,t){this.D("EventDelete",t,e)},this.eventDeleteCallBack=function(e,t){this.F("EventDelete",e,t)},this.Oa=function(e){var t;if(t=e&&e.isEvent?e:e.parentNode.parentNode.event,a.ra()){var i={};if(i.e=t,i.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof a.onEventDelete&&(a.onEventDelete(i),i.preventDefault.value))return;switch(a.eventDeleteHandling){case"PostBack":a.eventDeletePostBack(t);break;case"CallBack":a.eventDeleteCallBack(t);break;case"Update":a.events.remove(t)}"function"==typeof a.onEventDeleted&&a.onEventDeleted(i)}else switch(a.eventDeleteHandling){case"PostBack":a.eventDeletePostBack(t);break;case"CallBack":a.eventDeleteCallBack(t);break;case"JavaScript":a.onEventDelete(t)}},this.eventResizePostBack=function(e,t,i,n){if(!t)throw"newStart is null";if(!i)throw"newEnd is null";var a={};a.e=e,a.newStart=t,a.newEnd=i,this.D("EventResize",n,a)},this.eventResizeCallBack=function(e,t,i,n){if(!t)throw"newStart is null";if(!i)throw"newEnd is null";var a={};a.e=e,a.newStart=t,a.newEnd=i,this.F("EventResize",a,n)},this.Pa=function(e,t,i,n){if("PostBack"===e)a.postBack2(t,i,n);else if("CallBack"===e)a.F(t,i,n,"CallBack");else if("Immediate"===e)a.F(t,i,n,"Notify");else if("Queue"===e)a.queue.add(new DayPilot.Action(this,t,i,n));else{if("Notify"!==e)throw"Invalid event invocation type";"Notify"===s.notifyType()?a.F(t,i,n,"Notify"):a.queue.add(new DayPilot.Action(a,t,i,n))}},this.Aa=function(e){if("BusinessHoursNoScroll"===this.heightSpec)return this.businessBeginsHour;if(this.hideFreeCells&&!e){var t=this.Qa*this.cellDuration/this.cellHeight,i=Math.floor(t/60);return i=Math.max(0,i),Math.min(this.dayBeginsHour+i,this.businessBeginsHour)}return this.dayBeginsHour},this.visibleStart=function(){return this.ta[0].start},this.visibleEnd=function(){var e=this.ta;return e[e.length-1].start.addDays(1)},this.ra=function(){return 2===a.api},this.Ra=function(e,t,i,n){if("Disabled"!==this.eventResizeHandling){var o=0,r=new Date,s=new Date,l=e.start(),d=(e.end(),a.cellDuration),c=a.ta[e.part.dayIndex].start;if("top"===n){var c=l.getDatePart(),h=Math.floor((i-o)/a.cellHeight),u=h*d,f=60*u*1e3,v=60*a.Aa()*60*1e3;r=c.addTime(f+v),s=e.end()}else if("bottom"===n){var h=Math.floor((i+t-o)/a.cellHeight),u=h*d,f=60*u*1e3,v=60*a.Aa()*60*1e3;r=l,s=c.addTime(f+v)}if(a.ra()){var p={};if(p.e=e,p.newStart=r,p.newEnd=s,p.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof a.onEventResize&&(a.onEventResize(p),p.preventDefault.value))return;switch(a.eventResizeHandling){case"PostBack":a.eventResizePostBack(e,r,s);break;case"CallBack":a.eventResizeCallBack(e,r,s);break;case"Notify":a.eventResizeNotify(e,r,s);break;case"Update":e.start(r),e.end(s),a.events.update(e)}"function"==typeof a.onEventResized&&a.onEventResized(p)}else switch(a.eventResizeHandling){case"PostBack":a.eventResizePostBack(e,r,s); break;case"CallBack":a.eventResizeCallBack(e,r,s);break;case"JavaScript":a.onEventResize(e,r,s);break;case"Notify":a.eventResizeNotify(e,r,s)}}};this.eventResizeNotify=function(e,t,i,n){var o=new DayPilot.Event(e.copy(),this);e.start(t),e.end(i),e.commit(),a.update(),this.Sa("Notify",o,t,i,n)};this.Sa=function(e,t,i,n,a){var o={};o.e=t,o.newStart=i,o.newEnd=n,this.Pa(e,"EventResize",o,a)},this.eventMovePostBack=function(e,t,i,n,a){if(!t)throw"newStart is null";if(!i)throw"newEnd is null";var o={};o.e=e,o.newStart=t,o.newEnd=i,o.newResource=n,this.D("EventMove",a,o)},this.eventMoveCallBack=function(e,t,i,n,a){if(!t)throw"newStart is null";if(!i)throw"newEnd is null";var o={};o.e=e,o.newStart=t,o.newEnd=i,o.newResource=n,this.F("EventMove",o,a)},this.Ta=function(e,t,i,n,o){if("Disabled"!==a.eventMoveHandling){var r=0,s=Math.floor((i-r)/a.cellHeight),l=a.cellDuration,d=s*l*60*1e3,c=e.start(),h=e.end(),u=new Date;c instanceof DayPilot.Date&&(c=c.toDate()),u.setTime(Date.UTC(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()));var f="Never"!==a.useEventBoxes?c.getTime()-(u.getTime()+3600*c.getUTCHours()*1e3+Math.floor(c.getUTCMinutes()/l)*l*60*1e3):0,v=h.getTime()-c.getTime(),p=3600*a.Aa()*1e3;"undefined"==typeof t&&(t=e.part.dayIndex);var g=this.ta[t],m=g.start.getTime(),y=new Date;y.setTime(m+d+f+p);var b=new DayPilot.Date(y),w=b.addTime(v),D=!!o,k=g.id;if(a.ra()){var x={};if(x.e=e,x.newStart=b,x.newEnd=w,x.newResource=k,x.external=D,x.ctrl=!1,n&&(x.ctrl=n.ctrlKey),x.shift=!1,n&&(x.shift=n.shiftKey),x.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof a.onEventMove&&(a.onEventMove(x),x.preventDefault.value))return;switch(a.eventMoveHandling){case"PostBack":a.eventMovePostBack(e,b,w,k);break;case"CallBack":a.eventMoveCallBack(e,b,w,k);break;case"Notify":a.eventMoveNotify(e,b,w,k);break;case"Update":e.start(b),e.end(w),e.resource(k),D?(e.commit(),a.events.add(e)):a.events.update(e),a.Ua()}"function"==typeof a.onEventMoved&&a.onEventMoved(x)}else switch(a.eventMoveHandling){case"PostBack":a.eventMovePostBack(e,b,w,k);break;case"CallBack":a.eventMoveCallBack(e,b,w,k);break;case"JavaScript":a.onEventMove(e,b,w,k,D,!!n&&n.ctrlKey,!!n&&n.shiftKey);break;case"Notify":a.eventMoveNotify(e,b,w,k,null)}}},this.eventMoveNotify=function(e,t,i,n,o){var r=new DayPilot.Event(e.copy(),this);e.start(t),e.end(i),e.resource(n),e.commit(),a.update(),this.Va("Notify",r,t,i,n,o)},this.Va=function(e,t,i,n,a,o){var r={};r.e=t,r.newStart=i,r.newEnd=n,r.newResource=a,this.Pa(e,"EventMove",r,o)},this.Ua=function(){if(a.todo&&a.todo.del){var e=a.todo.del;e.parentNode.removeChild(e),a.todo.del=null}},this.Wa=function(e,t){var i=a.Xa(t),n={};n.args=e,n.guid=i,a.F("Bubble",n)},this.Xa=function(e){var t=DayPilot.guid();return this.bubbles||(this.bubbles=[]),this.bubbles[t]=e,t},this.eventMenuClickPostBack=function(e,t,i){var n={};n.e=e,n.command=t,this.D("EventMenuClick",i,n)},this.eventMenuClickCallBack=function(e,t,i){var n={};n.e=e,n.command=t,this.F("EventMenuClick",n,i)},this.Ya=function(e,t,i){switch(i){case"PostBack":a.eventMenuClickPostBack(t,e);break;case"CallBack":a.eventMenuClickCallBack(t,e)}},this.timeRangeMenuClickPostBack=function(e,t,i){var n={};n.selection=e,n.command=t,this.D("TimeRangeMenuClick",i,n)},this.timeRangeMenuClickCallBack=function(e,t,i){var n={};n.selection=e,n.command=t,this.F("TimeRangeMenuClick",n,i)},this.Za=function(e,t,i){switch(i){case"PostBack":a.timeRangeMenuClickPostBack(t,e);break;case"CallBack":a.timeRangeMenuClickCallBack(t,e)}},this.timeRangeSelectedPostBack=function(e,t,i,n){var a={};a.start=e,a.end=t,a.resource=i,this.D("TimeRangeSelected",n,a)},this.timeRangeSelectedCallBack=function(e,t,i,n){var a={};a.start=e,a.end=t,a.resource=i,this.F("TimeRangeSelected",a,n)},this.$a=function(e,t,i){e=new DayPilot.Date(e),t=new DayPilot.Date(t);var n=i;if(a.ra()){var o={};if(o.start=e,o.end=t,o.resource=n,o.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof a.onTimeRangeSelect&&(a.onTimeRangeSelect(o),o.preventDefault.value))return;switch(a.timeRangeSelectedHandling){case"PostBack":a.timeRangeSelectedPostBack(e,t,n);break;case"CallBack":a.timeRangeSelectedCallBack(e,t,n)}"function"==typeof a.onTimeRangeSelected&&a.onTimeRangeSelected(o)}else switch(a.timeRangeSelectedHandling){case"PostBack":a.timeRangeSelectedPostBack(e,t,i);break;case"CallBack":a.timeRangeSelectedCallBack(e,t,i);break;case"JavaScript":a.onTimeRangeSelected(e,t,i)}},this.timeRangeDoubleClickPostBack=function(e,t,i,n){var a={};a.start=e,a.end=t,a.resource=i,this.D("TimeRangeDoubleClick",n,a)},this.timeRangeDoubleClickCallBack=function(e,t,i,n){var a={};a.start=e,a.end=t,a.resource=i,this.F("TimeRangeDoubleClick",a,n)},this._a=function(e,t,i){if(a.ra()){var n=i,o={};if(o.start=e,o.end=t,o.resource=n,o.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof a.onTimeRangeDoubleClick&&(a.onTimeRangeDoubleClick(o),o.preventDefault.value))return;switch(a.timeRangeDoubleClickHandling){case"PostBack":a.timeRangeDoubleClickPostBack(e,t,n);break;case"CallBack":a.timeRangeDoubleClickCallBack(e,t,n)}"function"==typeof a.onTimeRangeDoubleClicked&&a.onTimeRangeDoubleClicked(o)}else switch(a.timeRangeDoubleClickHandling){case"PostBack":a.timeRangeDoubleClickPostBack(e,t,i);break;case"CallBack":a.timeRangeDoubleClickCallBack(e,t,i);break;case"JavaScript":a.onTimeRangeDoubleClick(e,t,i)}},this.eventEditPostBack=function(e,t,i){var n={};n.e=e,n.newText=t,this.D("EventEdit",i,n)},this.eventEditCallBack=function(e,t,i){var n={};n.e=e,n.newText=t,this.F("EventEdit",n,i)},this.ab=function(e,t){if(a.ra()){var i={};if(i.e=e,i.newText=t,i.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof a.onEventEdit&&(a.onEventEdit(i),i.preventDefault.value))return;switch(a.eventEditHandling){case"PostBack":a.eventEditPostBack(e,t);break;case"CallBack":a.eventEditCallBack(e,t);break;case"Update":e.text(t),a.events.update(e)}if("function"==typeof a.onEventEdited&&(a.onEventEdited(i),i.preventDefault.value))return}else switch(a.eventEditHandling){case"PostBack":a.eventEditPostBack(e,t);break;case"CallBack":a.eventEditCallBack(e,t);break;case"JavaScript":a.onEventEdit(e,t)}},this.eventSelectPostBack=function(e,t,i){var n={};n.e=e,n.change=t,this.D("EventSelect",i,n)},this.eventSelectCallBack=function(e,t,i){var n={};n.e=e,n.change=t,this.F("EventSelect",n,i)},this.bb=function(e,t,i,n){var o=a.multiselect,r=o.isSelected(t);if(i||n||!r||1!==o.cb.length)if(a.ra()){o.previous=o.events();var s={};if(s.e=t,s.selected=o.isSelected(t),s.ctrl=i,s.meta=n,s.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof a.onEventSelect&&(a.onEventSelect(s),s.preventDefault.value))return;switch(a.eventSelectHandling){case"PostBack":a.eventSelectPostBack(t,l);break;case"CallBack":"undefined"!=typeof WebForm_InitCallback&&(window.db="",window.eb=[],WebForm_InitCallback()),a.eventSelectCallBack(t,l);break;case"Update":o.fb(e,i)}"function"==typeof a.onEventSelected&&(s.change=o.isSelected(t)?"selected":"deselected",s.selected=o.isSelected(t),a.onEventSelected(s))}else{o.previous=o.events(),o.fb(e,i);var l=o.isSelected(t)?"selected":"deselected";switch(a.eventSelectHandling){case"PostBack":a.eventSelectPostBack(t,l);break;case"CallBack":"undefined"!=typeof WebForm_InitCallback&&(window.db="",window.eb=[],WebForm_InitCallback()),a.eventSelectCallBack(t,l);break;case"JavaScript":a.onEventSelect(t,l)}}},this.commandCallBack=function(e,t){this.K();var i={};i.command=e,this.F("Command",i,t)},this.gb=function(t){if(!r.active&&!r.using&&(clearTimeout(e.selectedTimeout),!e.selecting)){if(e.editing)return void e.editing.blur();if(a.selectedCells&&"Disabled"!==a.timeRangeDoubleClickHandling)for(var i=0;i0&&this.nav.main.rows[0].cells.length>0){for(var e=(this.ta,this.showHours?this.hourWidth:0),t=this.nav.main.rows[0].cells[0].clientWidth,i=1,n=0;n=a.hourWidth?(d.style.top=this.Ba()+"px",d.style.display=""):d.style.display="none",u>=a.scrollPos+a.ob&&parseInt(c.style.left)>=a.hourWidth?(c.style.top=this.Ba()+this.ob-10+"px",c.style.display=""):c.style.display="none")}}}},this.rb=function(e){var t=e.parentNode,i=0,n=e.offsetTop,a=e.parentNode.offsetWidth,o=e.offsetHeight;e.event.allday()&&(i=e.offsetLeft,a=e.offsetWidth);var r=document.createElement("textarea");r.style.boxSizing="border-box",r.style.position="absolute",r.style.width=a+"px",r.style.height=o+"px";var s=DayPilot.gs(e,"fontFamily");s||(s=DayPilot.gs(e,"font-family")),r.style.fontFamily=s;var l=DayPilot.gs(e,"fontSize");return l||(l=DayPilot.gs(e,"font-size")),r.style.fontSize=l,r.style.left=i+"px",r.style.top=n+"px",r.style.border="1px solid black",r.style.padding="0px",r.style.marginTop="0px",r.style.backgroundColor="white",r.value=DayPilot.tr(e.event.text()),r.event=e.event,t.appendChild(r),r},this.Ia=function(e,t,i,n){a.bb(e,t,i,n)},this.multiselect={},this.multiselect.Y=[],this.multiselect.cb=[],this.multiselect.sb=[],this.multiselect.tb=[],this.multiselect.ub=function(){var e=a.multiselect;return DayPilot.JSON.stringify(e.events())},this.multiselect.events=function(){var e=a.multiselect,t=[];t.ignoreToJSON=!0;for(var i=0;i1&&i.add(e.event,!0)}else i.clear(!0);else a.allowMultiSelect&&t?i.add(e.event,!0):(i.clear(!0),i.add(e.event,!0));i.redraw(),i.vb()},this.multiselect.wb=function(e){var t=a.multiselect;return t.xb(e,t.Y)},this.multiselect.yb=function(){for(var e=a.multiselect,t=[],i=0;ithis.max-1)},i.putIntoLine=function(e){for(var t=0;to.part.top+o.part.height-1))return!1}return!0},i.push(e),this.lines.push(i),this.lines.length-1},i.events.push(e),i.min=e.part.top,i.max=e.part.top+e.part.height,this.blocks.push(i),this.blocks.length-1},t.putIntoLine=function(e){for(var t=0;to.part.top+o.part.height-1))return!1}return!0},i.push(e),this.lines.push(i),this.lines.length-1},e.children&&(t.children=this.Ib(e.children)),t},this.Ib=function(e){var t=DayPilot.list();return DayPilot.list(e).each(function(e){var i=a.Lb(e);t.push(i)}),t},this.Jb=function(e,t){for(var i=this.Gb()?this.ta:this.T,n=[],a=0;a0&&(i=i.concat(n)),DayPilot.Areas.showAreas(t,t.event,null,i),a.cssOnly&&DayPilot.Util.addClass(t,a.p("_alldayevent_hover"))}"undefined"!=typeof DayPilot.Bubble&&a.bubble&&"Disabled"!==a.eventHoverHandling&&a.bubble.showEvent(this.event)},l.onmouseout=function(e){var t=this;a.cssOnly&&DayPilot.Util.removeClass(t,a.p("_alldayevent_hover")),DayPilot.Areas.hideAreas(this,e),a.bubble&&a.bubble.hideOnMouseOut()},this.showToolTip&&!this.bubble&&l.setAttribute("title",r.client.toolTip());var d=r.start().getTime()===r.part.start.getTime(),c=r.end().getTime()===r.part.end.getTime(),h=r.data.backColor;if(this.cssOnly){var u=document.createElement("div");u.setAttribute("unselectable","on"),u.className=this.p("_alldayevent_inner"),h&&(u.style.background=h),a.rtl?(d||DayPilot.Util.addClass(l,this.p("_alldayevent_continueright")),c||DayPilot.Util.addClass(l,this.p("_alldayevent_continueleft"))):(d||DayPilot.Util.addClass(l,this.p("_alldayevent_continueleft")),c||DayPilot.Util.addClass(l,this.p("_alldayevent_continueright"))),r.client.innerHTML()?u.innerHTML=r.client.innerHTML():u.innerHTML=r.text(),l.appendChild(u)}else{var u=document.createElement("div");u.setAttribute("unselectable","on"),u.style.marginLeft="2px",u.style.marginRight="3px",u.style.paddingLeft="2px",u.style.height=s.allDayEventHeight()-2+"px",u.style.border="1px solid "+this.allDayEventBorderColor,u.style.overflow="hidden",u.style.position="relative",u.style.backgroundColor=h,u.className=this.p("alldayevent"),this.roundedCorners&&(u.style.MozBorderRadius="5px",u.style.webkitBorderRadius="5px",u.style.borderRadius="5px");var f=[],v=this.showAllDayEventStartEnd,p=this.showAllDayEventStartEnd;v&&(f.push("
"),d?r.start().getDatePart().getTime()!==r.start().getTime()&&f.push(DayPilot.DateUtil.hours(r.start(),"Clock12Hours"===this.Nb.timeFormat())):f.push("~"),f.push("
")),p&&(f.push("
"),c?r.end().getDatePart().getTime()!==r.end().getTime()&&f.push(DayPilot.DateUtil.hours(r.end(),"Clock12Hours"===this.Nb.timeFormat())):f.push("~"),f.push("
"));f.push("
"),f.push(""),r.client.innerHTML()?f.push(r.client.innerHTML()):f.push(r.text()),f.push(""),f.push("
"),u.innerHTML=f.join(""),l.appendChild(u)}if(a.ra()){if("function"==typeof a.onAfterEventRender){var g={};g.e=l.event,g.div=l,a.onAfterEventRender(g)}}else a.afterEventRender&&a.afterEventRender(l.event,l);this.nav.allday.appendChild(l),this.elements.events.push(l)}e.style.display=""}}},this.L=function(e){if(a.multiselect.Eb(),this.elements.events)for(var t=0;ta.nb().clientWidth&&(i=DayPilot.sw(a.nav.bottomRight)),a.nav.headerParent&&(a.nav.headerParent.style.width=n+i+"px"),a.nav.main.style.width=n+"px",a.nav.events.style.width=n+"px",a.nav.crosshair.style.width=n+"px"}else a.nav.headerParent&&(a.nav.headerParent.style.width="100%"),a.nav.main.style.width="100%",a.nav.events.style.width="100%",a.nav.crosshair.style.width="100%";this.$b()},this.ha=function(){this.t?this._b():DayPilot.pu(this.nav.hourTable),this.nav.hoursPlaceholder&&(this.nav.hoursPlaceholder.innerHTML="",this.nav.hourTable=this.bc(),this.nav.hoursPlaceholder.appendChild(this.nav.hourTable))},this._b=function(){if(this.nav.hourTable)for(var e=0;ethis.headerHeight&&(this.s.headerHeight=e,this.ba(),this.ca())}},this.mb=!0,this.nc=function(){var e=this.mb?a.nav.bottomRight:a.nav.scroll;return this.cssOnly?DayPilot.sw(e)>0:DayPilot.sw(e)>2},this.Yb=function(){var e=document.createElement("div");this.cssOnly||(e.style.borderLeft="1px solid "+this.borderColor,e.style.borderRight="1px solid "+this.borderColor);var t="Fixed"===this.columnWidthSpec;t||(e.style.overflow="auto"),e.style.position="absolute",e.style.left="0px",e.style.right="0px";var i=document.createElement("div");i.style.position="relative",i.style.zoom="1";var n=null,t="Fixed"===this.columnWidthSpec;if(t||this.mb){var a=document.createElement("div");if(a.style.cssFloat="left",a.style.styleFloat="left",a.style.width=this.hourWidth+"px",this.showHours){var o=this.oc();this.nav.corner=o,a.appendChild(o),i.appendChild(a),this.nav.upperLeft=a}var r=document.createElement("div");this.showHours&&(r.style.marginLeft=this.hourWidth+"px"),r.style.position="relative",r.style.overflow="hidden",r.style.height=this.Ba()+"px",i.appendChild(r),this.nav.upperRight=r,n=document.createElement("div"),n.style.position="relative",r.appendChild(n)}else{var s=document.createElement("table");s.cellPadding="0",s.cellSpacing="0",s.border="0",s.style.width="100%",s.style.borderCollapse="separate",s.style.border="0px none";var l=s.insertRow(-1);if(this.nav.fullHeader=s,this.showHours){var d=l.insertCell(-1);d.style.padding="0px",d.style.border="0px none";var o=this.oc();d.appendChild(o),this.nav.corner=o}d=l.insertCell(-1),d.style.width="100%",this.cssOnly||(d.style.backgroundColor=this.hourNameBackColor),d.valign="top",d.style.position="relative",d.style.padding="0px",d.style.border="0px none",n=document.createElement("div"),n.style.position="relative",n.style.height=this.Ba()+"px",n.style.overflow="hidden",d.appendChild(n),this.nav.mid=n,i.appendChild(s)}this.nav.headerParent=n,this.pc();var c=this.nc(),t="Fixed"===this.columnWidthSpec;return c&&!t&&this.qc(),e.appendChild(i),e},this.pc=function(){this.nav.unifiedCornerRight=null,this.nav.header=document.createElement("table"),this.nav.header.cellPadding="0",this.nav.header.cellSpacing="0";var e="Fixed"===this.columnWidthSpec;e||(this.nav.header.width="100%"),this.nav.header.style.tableLayout="fixed",this.cssOnly||(this.nav.header.style.borderBottom="0px none #000000",this.nav.header.style.borderLeft="1px solid "+this.borderColor,this.nav.header.style.borderTop="1px solid "+this.borderColor),this.nav.header.oncontextmenu=function(){return!1};var t=this.nc();if(this.cssOnly||t&&(this.nav.header.style.borderRight="1px solid "+this.borderColor),this.nav.headerParent.appendChild(this.nav.header),this.nav.allday&&DayPilot.de(this.nav.allday),this.showAllDayEvents){var i=document.createElement("div");i.style.position="absolute",i.style.top="0px",i.style.height="0px";var e="Fixed"===this.columnWidthSpec;e?i.style.width=this.ta.length*this.columnWidth+"px":(i.style.left="0px",i.style.right="0px"),this.nav.allday=i,this.nav.headerParent.appendChild(i)}},this.qc=function(){if(this.nav.fullHeader){var e=this.nav.fullHeader.rows[0],t=e.insertCell(-1);this.cssOnly||(t.className=this.p("cornerright"),t.style.backgroundColor=this.hourNameBackColor,t.style.borderBottom="0px none",t.style.borderLeft="1px solid "+this.borderColor,t.style.borderRight="0px none"),t.style.padding="0px",t.style.verticalAlign="top",t.setAttribute("unselectable","on");var i=document.createElement("div");i.setAttribute("unselectable","on"),this.cssOnly&&(i.className=this.p("_cornerright")),i.style.overflow="hidden",i.style.position="relative",i.style.width="16px",i.style.height=this.Ba()+"px";var n=document.createElement("div");this.cssOnly?n.className=this.p("_cornerright_inner"):n.style.borderTop="1px solid "+this.borderColor,i.appendChild(n),t.appendChild(i),this.nav.cornerRight=i}},this.oc=function(){var e=document.createElement("div");e.style.position="relative",this.cssOnly?e.className=this.p("_corner"):(e.style.backgroundColor=this.cornerBackColor,e.style.fontFamily=this.headerFontFamily,e.style.fontSize=this.headerFontSize,e.style.color=this.headerFontColor,e.className=this.p("corner")),e.style.width=this.hourWidth+"px",e.style.height=this.Ba()+"px",e.style.overflow="hidden",e.oncontextmenu=function(){return!1};var t=document.createElement("div");this.cssOnly?t.className=this.p("_corner_inner"):t.style.borderTop="1px solid "+this.borderColor,t.setAttribute("unselectable","on");var i=this.cornerHTML||this.cornerHtml;t.innerHTML=i?i:"",e.appendChild(t);var n=document.createElement("div");return n.style.position="absolute",n.style.padding="2px",n.style.top="0px",n.style.left="1px",n.style.backgroundColor="#FF6600",n.style.color="white",n.innerHTML="\u0044\u0045\u004D\u004F",n.setAttribute("unselectable","on"),DayPilot.Util.isNullOrUndefined(undefined)&&e.appendChild(n),e},this.M=function(){var e=this.nav.main;e.root=null,e.onmouseup=null;for(var t=0;t0;)this.t||DayPilot.pu(t.rows[0]),t.deleteRow(0);if(this.sc=!0,this.scrollLabelsVisible)for(var r=this.ta,d=this.showHours?this.hourWidth:0,c=(this.nav.scroll.clientWidth-d)/r.length,h=0;h0;)this.t||DayPilot.pu(g.rows[0]),g.deleteRow(0);for(var m=g.insertRow(-1),y=0;y0?(""!==a.hourHalfBorderColor&&(M.style.borderBottom="1px solid "+a.hourHalfBorderColor),M.className=a.p("hourhalfcellborder")):(""!==a.hourBorderColor&&(M.style.borderBottom="1px solid "+a.hourBorderColor),M.className=a.p("hourcellborder"))}b.onmousedown=this.gb,b.onmousemove=this.jb,b.onmouseout=this.ib,DayPilot.re(b,DayPilot.touch.end,this.Sb.onCellTouchEnd),b.onmouseup=function(){return!1},b.onclick=function(){return!1},b.ondblclick=function(){if(e.firstMousePos=null,a.hb(),clearTimeout(e.selectedTimeout),"Disabled"!==a.timeRangeDoubleClickHandling){var t=a.getSelection();a._a(t.start,t.end,t.resource)}},b.oncontextmenu=function(){if(this.selected||(a.clearSelection(),e.column=e.getColumn(this),a.selectedCells.push(this),e.firstSelected=this,e.topSelectedCell=this,e.bottomSelectedCell=this,a.hb()),"Disabled"===a.timeRangeRightClickHandling)return!1;var t=a.getSelection(),i={};return i.start=t.start,i.end=t.end,i.resource=t.resource,i.preventDefault=function(){this.preventDefault.value=!0},("function"!=typeof a.onTimeRangeRightClick||(a.onTimeRangeRightClick(i),!i.preventDefault.value))&&("ContextMenu"===a.timeRangeRightClickHandling&&a.contextMenuSelection&&a.contextMenuSelection.show(a.getSelection()),"function"==typeof a.onTimeRangeRightClicked&&a.onTimeRangeRightClicked(i),!1)};var E=a.vc(y,D);A=b.firstChild;var w="Fixed"===this.columnWidthSpec;w&&(k.width?A.style.width=k.width+"px":A.style.width=this.columnWidth+"px"),E&&(this.cssOnly?A.firstChild.style.background=E:A.style.background=E);(S?S.business:this.tc(b.start,b.end))&&this.cssOnly&&DayPilot.Util.addClass(A,a.p("_cell_business"));var H=this.cssOnly?A.firstChild:A;H&&(H.innerHTML=""),A.style.backgroundImage="",A.style.backgroundRepeat="",S&&(S.html&&(H.innerHTML=S.html),S.cssClass&&(this.cssOnly?DayPilot.Util.addClass(A,S.cssClass):DayPilot.Util.addClass(b,a.p(S.cssClass))),S.backImage&&(A.style.backgroundImage="url('"+S.backImage+"')"),S.backRepeat&&(A.style.backgroundRepeat=S.backRepeat)),this.cssOnly||DayPilot.Util.addClass(b,a.p("cellbackground"))}}t.onmouseup=this.kb,t.root=this,a.nav.scrollable.style.display="",a.nb().scrollTop=s},this.tc=function(e,t){return this.businessBeginsHour=this.businessEndsHour||6===e.getDayOfWeek()||0===e.getDayOfWeek()):e.getHours()>=this.businessBeginsHour||e.getHours()s))return;e.movingShadow=a.sa(DayPilot.Global.moving,!a.B.ie,a.shadow),e.movingShadow.style.width=e.movingShadow.parentNode.offsetWidth+1+"px"}if(!a.coords)return;var l=a.cellHeight,d=0,c=e.moveOffsetY;c||(c=l/2),"Top"===this.moveBy&&(c=0);var h=Math.floor((a.coords.y-c-d+l/2)/l)*l+d;hf&&(h=f-v),e.movingShadow.style.top=h+"px";var p=u.clientWidth/u.rows[0].cells.length,g=Math.floor(a.coords.x/p);g<0&&(g=0),a.rtl&&(g=a.ta.length-g-1);var m=a.nav.events;g=0&&e.movingShadow.column!==g&&(e.movingShadow.column=g,e.moveShadow(m.rows[0].cells[g]))}if(e.drag){if(e.gShadow&&document.body.removeChild(e.gShadow),e.gShadow=null,!e.movingShadow&&a.coords){var y=a.sa(e.drag,!1,e.drag.shadowType);if(y){e.movingShadow=y;var b=DayPilot.Date.today(),t={"value":e.drag.id,"start":b,"end":b.addSeconds(e.drag.duration),"text":e.drag.text},w=new DayPilot.Event(t,a);w.external=!0,DayPilot.Global.moving={},DayPilot.Global.moving.event=w,DayPilot.Global.moving.helper={}}}t.cancelBubble=!0}},this.yc=function(t){e.movingShadow.offsetTop,DayPilot.Global.moving.event,e.movingShadow.column},this.xc=function(t){if(!DayPilot.Global.resizing.event)return DayPilot.Global.resizing=null,DayPilot.de(e.resizingShadow),void(e.resizingShadow=null);e.resizingShadow||(e.resizingShadow=a.sa(DayPilot.Global.resizing,!1,a.shadow));var i=DayPilot.Global.resizing.event.calendar.cellHeight,n=0,o=t.y-e.originalMouse.y;if(console.log(DayPilot.Global.resizing.dpBorder),"bottom"===DayPilot.Global.resizing.dpBorder){var r=Math.floor((e.originalHeight+e.originalTop+o+i/2)/i)*i-e.originalTop+n;rs&&(r=s-e.originalTop),e.resizingShadow.style.height=r+"px"}else if("top"===DayPilot.Global.resizing.dpBorder){var l=Math.floor((e.originalTop+o-n+i/2)/i)*i+n;le.originalTop+e.originalHeight-i&&(l=e.originalTop+e.originalHeight-i);var r=e.originalHeight-(l-e.originalTop);ro.left;)n+=1,o=this.col(t,n);e.x=n-1;var r=0,s=Math.floor((a.coords.y-r)/a.cellHeight);return e.y=s,e.x<0?null:e},this.Ac.col=function(e,t){var i={};if(i.left=0,i.width=0,!e)return null;if(!e.rows)return null;if(0===e.rows.length)return null;if(0==e.rows[0].cells.length)return null;var n=e.rows[0].cells[t];if(!n)return null;var a=DayPilot.abs(e),o=DayPilot.abs(n);return i.left=o.x-a.x,i.width=n.offsetWidth,i},this.wc=function(){this.S(),this.elements.crosshair||(this.elements.crosshair=[]);var e=this.Ac.getCellCoords();if(e){var t=e.x,i=Math.floor(e.y/(60/a.cellDuration)*(60/a.timeHeaderCellDuration));if(!(i<0)){if(this.nav.hourTable){if(i>=this.nav.hourTable.rows.length)return;var n=document.createElement("div");n.style.position="absolute",n.style.left="0px",n.style.right="0px",n.style.top="0px",n.style.bottom="0px",n.style.opacity=.5,n.style.backgroundColor=this.crosshairColor,n.style.opacity=this.crosshairOpacity/100,n.style.filter="alpha(opacity="+this.crosshairOpacity+")",this.nav.hourTable.rows[i].cells[0].firstChild.appendChild(n),this.elements.crosshair.push(n)}if(this.nav.header){var o=document.createElement("div");o.style.position="absolute",o.style.left="0px",o.style.right="0px",o.style.top="0px",o.style.bottom="0px",o.style.opacity=.5,o.style.backgroundColor=this.crosshairColor,o.style.opacity=this.crosshairOpacity/100,o.style.filter="alpha(opacity="+this.crosshairOpacity+")";var r=this.nav.header.rows[this.headerLevels-1];r.cells[t]&&(r.cells[t].firstChild.appendChild(o),this.elements.crosshair.push(o))}if("Header"!==this.crosshairType){var s=this.nav.crosshair,l=0,d=Math.floor((a.coords.y-l)/a.cellHeight)*a.cellHeight+l,c=a.cellHeight,h=document.createElement("div");h.style.position="absolute",h.style.left="0px",h.style.right="0px",h.style.top=d+"px",h.style.height=c+"px",h.style.backgroundColor=this.crosshairColor,h.style.opacity=this.crosshairOpacity/100,h.style.filter="alpha(opacity="+this.crosshairOpacity+")",h.onmousedown=this.Bc,s.appendChild(h),this.elements.crosshair.push(h);var u=this.Ac.col(this.nav.main,t);if(c=this.nav.main.clientHeight,u){var f=document.createElement("div");f.style.position="absolute",f.style.left=u.left+"px",f.style.width=u.width+"px",f.style.top="0px",f.style.height=c+"px",f.style.backgroundColor=this.crosshairColor,f.style.opacity=this.crosshairOpacity/100,f.style.filter="alpha(opacity="+this.crosshairOpacity+")",f.onmousedown=this.Bc,s.appendChild(f),this.elements.crosshair.push(f)}}}}},this.Bc=function(e){a.S();var t=a.Ac.getCellCoords(),i=0,n=a.nav.main.rows[t.y+i].cells[t.x];a.gb.apply(n,[e])},this.S=function(){if(this.elements.crosshair&&0!==this.elements.crosshair.length){for(var e=0;e0;)this.t||DayPilot.pu(e.rows[0]),e.deleteRow(0);this.Fc=!0;var o=a.cornerHTML||a.cornerHtml,r=a.nav.corner;r&&(this.t||DayPilot.pu(r.firstChild),r.firstChild.innerHTML=o?o:"");for(var l=0;l0&&e.offsetHeight>0},this.Ic=function(){var e=a.Hc;e()||(a.Jc=setInterval(function(){e()&&(a.rc(),a.ja(),clearInterval(a.Jc))},100))},this.scrollToY=function(e){this.nb().scrollTop=e},this.scrollToHour=function(e){var t=this.nb(),i=e*(60/a.cellDuration)*a.cellHeight;t.scrollTop=i-this.qb()},this.nb=function(){return"Fixed"===this.columnWidthSpec||this.mb?this.nav.bottomRight:this.nav.scroll},this.onCallbackError=function(e,t){alert("Error!\r\nResult: "+e+"\r\nContext:"+t)},this.ja=function(){if(a.showHeader){var e=this.nc(),t=!!this.nav.cornerRight;if(this.mb){this.nav.unifiedCornerRight&&DayPilot.de(this.nav.unifiedCornerRight);var i=this.fc();if("100%"!=i&&parseInt(i)=3&&(l.style.width=n-3+"px"),n}}},this.qa=function(e){if(e&&(this.autoRefreshEnabled=!0),this.autoRefreshEnabled&&!(this.A>=this.autoRefreshMaxCount)){this.K();var t=this.autoRefreshInterval;if(!t||t<10)throw"The minimum autoRefreshInterval is 10 seconds";this.autoRefreshTimeout=window.setTimeout(function(){a.Kc()},1e3*this.autoRefreshInterval)}},this.K=function(){this.autoRefreshTimeout&&window.clearTimeout(this.autoRefreshTimeout)},this.Kc=function(){if(!(DayPilot.Global.resizing||DayPilot.Global.moving||e.drag||e.selecting)){var t=!1;if("function"==typeof this.onAutoRefresh){var i={};i.i=this.A,i.preventDefault=function(){this.preventDefault.value=!0},a.onAutoRefresh(i),i.preventDefault.value&&(t=!0)}!t&&this.q()&&this.commandCallBack(this.autoRefreshCommand),this.A++}this.A1)){r.using=!0;var t=r.getCellCoords(e);r.startCoords=t;var i=a.tapAndHoldTimeout;r.timeout=window.setTimeout(function(){switch(e.preventDefault(),r.active=!0,a.timeRangeTapAndHoldHandling){case"Select":r.startSelecting(t);break;case"ContextMenu":r.startSelecting(t),r.active=!1,a.contextMenuSelection&&a.contextMenuSelection.show(a.getSelection())}},i)}},this.Sb.onCellTouchMove=function(e){},this.Sb.onCellTouchEnd=function(e){if(!r.active)return void window.clearTimeout(r.timeout);e.preventDefault(),r.startcell=null;var t=a.getSelection();t.toString=function(){return"start: "+this.start+"\nend: "+this.end},a.$a(t.start,t.end,t.resource),window.setTimeout(function(){r.active=!1},500)},this.Sb.startMoving=function(t,i){DayPilot.Global.moving=t,(DayPilot.Global.moving.helper={}).oldColumn=a.ta[t.event.part.dayIndex].id,e.originalMouse=i,e.originalTop=this.offsetTop;var n=DayPilot.abs(t);e.moveOffsetY=i.y-n.y,e.movingShadow||(e.movingShadow=a.sa(DayPilot.Global.moving,!a.B.ie,a.shadow),e.movingShadow.style.width=e.movingShadow.parentNode.offsetWidth+1+"px")},this.Sb.startResizing=function(t,i,n){DayPilot.Global.resizing=t,t.dpBorder=i,e.originalMouse=n,e.originalHeight=t.offsetHeight,e.originalTop=t.offsetTop},this.Sb.updateResizing=function(e){a.xc(e)},this.Sb.updateMoving=function(){var t=a.coords,i=a.cellHeight,n=0,o=e.moveOffsetY;o||(o=i/2);var r=Math.floor((t.y-o-n+i/2)/i)*i+n;rl&&(r=l-d),e.movingShadow.style.top=r+"px";var c=s.clientWidth/s.rows[0].cells.length,h=Math.floor(t.x/c);h<0&&(h=0);var u=a.nav.events;h=0&&e.movingShadow.column!==h&&(e.movingShadow.column=h,e.moveShadow(u.rows[0].cells[h]))},this.Sb.onEventTouchStart=function(e){if(!r.active&&!DayPilot.Util.isMouseEvent(e)){e.stopPropagation(),r.preventEventTap=!1,r.using=!0,r.startCoords=r.getCellCoords(e);var t=this,i=e.touches?e.touches[0].pageX:e.pageX,n=e.touches?e.touches[0].pageY:e.pageY,o={x:i,y:n,div:this};a.coords=r.relativeCoords(e);var s=a.tapAndHoldTimeout;r.timeout=window.setTimeout(function(){var i=t.event;switch(r.active=!0,a.eventTapAndHoldHandling){case"Move":i.client.moveEnabled()&&r.startMoving(t,o);break;case"ContextMenu":var n=i.client.contextMenu();DayPilot.Menu&&DayPilot.Menu.touchPosition(e),n?n.show(i):a.contextMenu&&a.contextMenu.show(i)}},s)}},this.Sb.onMainTouchMove=function(t){if(!DayPilot.Util.isMouseEvent(t)){if(r.timeout){var i=r.getCellCoords(t);i&&r.startCoords&&(i.pageX===r.startCoords.pageX&&i.pageY===r.startCoords.pageY||window.clearTimeout(a.Sb.timeout))}if(DayPilot.Global.moving&&e.movingShadow)return t.preventDefault(),a.coords=r.relativeCoords(t),void r.updateMoving();if(DayPilot.Global.resizing){t.preventDefault();var n=t.touches?t.touches[0]:t,i={x:n.pageX,y:n.pageY};return void r.updateResizing(i)}if(r.startcell){if(t.preventDefault(),!r.active)return void window.clearTimeout(r.timeout);var i=r.getCellCoords(t);r.extendSelection(i)}r.preventEventTap=!0}},this.Sb.relativeCoords=function(e){var t=a.nav.main,i=e.touches?e.touches[0].pageX:e.pageX,n=e.touches?e.touches[0].pageY:e.pageY,o=DayPilot.abs(t);return{x:i-o.x,y:n-o.y,"toString":function(){return"x: "+this.x+", y:"+this.y}}},this.Sb.onMainTouchEnd=function(t){if(!DayPilot.Util.isMouseEvent(t))if(DayPilot.Global.moving){r.active=!1,t.preventDefault(),t.stopPropagation();var i=e.movingShadow.offsetTop;e.deleteShadow(e.movingShadow);var n=DayPilot.Global.moving.event,o=e.movingShadow.column;DayPilot.Global.moving=null,e.movingShadow=null,n.calendar.Ta(n,o,i,t,e.drag)}else if(r.startcell){if(!r.active)return void window.clearTimeout(r.timeout);t.preventDefault(),r.startcell=null;var s=a.getSelection();s.toString=function(){return"start: "+this.start+"\nend: "+this.end},a.$a(s.start,s.end,s.resource),window.setTimeout(function(){r.active=!1},500)}},this.Sb.onEventTouchMove=function(e){r.preventEventTap=!0},this.Sb.onEventTouchEnd=function(e){if(!DayPilot.Util.isMouseEvent(e)){if(!r.active){if(r.preventEventTap)return;return e.preventDefault(),window.clearTimeout(r.timeout),void a.Ga(this,!1)}return r.active=!1,r.timeout?void window.clearTimeout(r.timeout):void e.preventDefault()}},this.Pb=function(t){var i=5,n=Math.max(a.durationBarWidth,10),o="Top"===a.moveBy;if("undefined"!=typeof e){var r=DayPilot.mo3(this,t);if(r){var s=this;if(!s.active){var l=[];s.event.client.deleteEnabled()&&l.push({"action":"JavaScript","v":"Hover","w":17,"h":17,"top":2,"right":2,"css":a.p("_event_delete"),"js":function(e){a.Oa(e)}});var d=s.event.cache?s.event.cache.areas:s.event.data.areas;d&&d.length>0&&(l=l.concat(d)),DayPilot.Areas.showAreas(s,s.event,null,l),a.cssOnly&&DayPilot.Util.addClass(s,a.p("_event_hover"))}if(!DayPilot.Global.resizing&&!DayPilot.Global.moving){var c=this.isFirst,h=this.isLast;if("Disabled"!==a.moveBy&&"None"!==a.moveBy&&(!o&&r.x<=n&&this.event.client.moveEnabled()?c?this.style.cursor="move":this.style.cursor="not-allowed":!o&&r.y<=i&&this.event.client.resizeEnabled()?c?(this.style.cursor="n-resize",this.dpBorder="top"):this.style.cursor="not-allowed":o&&r.y<=n&&this.event.client.moveEnabled()?this.style.cursor="move":this.offsetHeight-r.y<=i&&this.event.client.resizeEnabled()?h?(this.style.cursor="s-resize",this.dpBorder="bottom"):this.style.cursor="not-allowed":DayPilot.Global.resizing||DayPilot.Global.moving||(this.event.client.clickEnabled()?this.style.cursor="pointer":this.style.cursor="default"),"undefined"!=typeof DayPilot.Bubble&&a.bubble&&"Disabled"!==a.eventHoverHandling&&("default"===this.style.cursor||"pointer"===this.style.cursor))){this.Nc&&r.x===this.Nc.x&&r.y===this.Nc.y||(this.Nc=r,a.bubble.showEvent(this.event))}}}}},this.Qb=function(e){a.cssOnly&&DayPilot.Util.removeClass(this,a.p("_event_hover")),a.bubble&&a.bubble.hideOnMouseOut(),DayPilot.Areas.hideAreas(this,e)},this.Oc=null,this.la=function(){if(this.showCurrentTime){this.Pc();var e=(new DayPilot.Date).addMinutes(a.showCurrentTimeOffset);if("Full"===a.showCurrentTimeMode)this.Qc(e);else{if("Day"!==a.showCurrentTimeMode)throw"Invalid DayPilot.Calendar.showCurrentTimeMode value: "+a.showCurrentTimeMode;this.Rc(e)}if(this.nav.events&&!this.Oc){this.Oc=setTimeout(function(){a.Oc=null,a.la()},3e4)}}},this.Pc=function(){DayPilot.de(a.elements.separators),a.elements.separators=[]},this.Rc=function(e){var t=e.getTime(),i=a.nav.events;if(i)for(var n=0;n=h.getTime()):"Date"===a.allDayEnd?!(x=h.getTime()):!(x<=c.getTime()||k>=h.getTime()),l&&(C=C&&(r.resource===f.id||"*"===f.id)),C){var P=new DayPilot.Event(r,this);if(P.part.start=c.getTime()x?D:h,P.part.colStart=DayPilot.DateUtil.daysDiff(c,P.part.start),P.part.colWidth=DayPilot.DateUtil.daysSpan(P.part.start,P.part.end)+1,l&&(P.part.colStart=o,P.part.colWidth=1),"function"==typeof a.onEventFilter&&a.events.Tc){var S={};if(S.filter=a.events.Tc,S.visible=!0,S.e=P,a.onEventFilter(S),!S.visible)continue}this.Mb.events.push(P),("function"==typeof this.onBeforeEventRender||a.showEventStartEnd)&&(P.cache=this.s.events[y]),n[y]=!0,!l||P.part.start.getTime()===k&&P.part.end.getTime()===x||(n[y]=!1)}}else{var b=null;if("function"==typeof a.onBeforeEventRender&&(b=a.s.events[y]),b){if(b.hidden)continue}else if(r.hidden)continue;var C=!1;if(C=l?f.id===r.resource&&!(x<=p||k>=m):!(x<=p||k>=m)||x===k&&k===p){var P=new DayPilot.Event(r,a);P.part.dayIndex=o,P.part.start=px?D:g;var A=this.Sc(P.part.start,f.start),T=this.Sc(P.part.end,f.start),M=A.top,E=T.top;if(M===E&&(A.cut||T.cut))continue;P.part.box=s.useBox(x-k);var H=0;if(P.part.box){var _=T.boxBottom;P.part.top=Math.floor(M/this.cellHeight)*this.cellHeight+H,P.part.height=Math.max(Math.ceil(_/this.cellHeight)*this.cellHeight-P.part.top,this.cellHeight-1),P.part.barTop=Math.max(M-P.part.top-1,0),P.part.barHeight=Math.max(E-M-2,1)}else P.part.top=M+H,P.part.height=Math.max(E-M,0),P.part.barTop=0,P.part.barHeight=Math.max(E-M-2,1);if("function"==typeof a.onEventFilter&&a.events.Tc){var S={};if(S.filter=a.events.Tc,S.visible=!0,S.e=P,a.onEventFilter(S),!S.visible)continue}var w=P.part.top,D=P.part.top+P.part.height;w>u.maxStart&&(u.maxStart=w),Dthis.za&&(this.za=D),f.events.push(P),("function"==typeof this.onBeforeEventRender||a.showEventStartEnd)&&(P.cache=this.s.events[y]),P.part.start.getTime()===k&&P.part.end.getTime()===x&&(n[y]=!0)}}}}for(var o=0;oo.part.colStart+o.part.colWidth-1))return!1}return!0},i.push(e),this.lines.push(i),this.lines.length-1};for(var o=0;o0&&(this.nav.scroll.style.height=e+"px",this.ob=a.nav.scroll.clientHeight,this.nav.bottomLeft&&(this.nav.bottomLeft.style.height=e+"px"),this.nav.bottomRight&&(this.nav.bottomRight.style.height=e+"px")),"Parent100Pct"===this.heightSpec?this.nav.top.style.height="100%":this.nav.top.style.height=this.Vb()+"px"},this.setHeight=function(e){"Parent100Pct"!==this.heightSpec&&(this.heightSpec="Fixed"),this.cssOnly?this.height=e-this.Ba():this.height=e-(this.Ba()+3),this.ia()},this.ad=function(e){var t=document.createElement("div");t.style.position="absolute",t.style.top="-2000px",t.style.left="-2000px",t.className=this.p(e),document.body.appendChild(t);var i=t.offsetHeight,n=t.offsetWidth;document.body.removeChild(t);var a={};return a.height=i,a.width=n,a},this.Nb={};var s=this.Nb;s.locale=function(){return DayPilot.Locale.find(a.locale)},s.weekStarts=function(){return"number"==typeof a.weekStarts?a.weekStarts:s.locale().weekStarts},s.timeFormat=function(){return"Auto"!==a.timeFormat?a.timeFormat:this.locale().timeFormat},s.useBox=function(e){return"Always"===a.useEventBoxes||"Never"!==a.useEventBoxes&&e<60*a.cellDuration*1e3},s.notifyType=function(){var e;if("Immediate"===a.notifyCommit)e="Notify";else{if("Queue"!==a.notifyCommit)throw"Invalid notifyCommit value: "+a.notifyCommit;e="Queue"}return e},s.clearCache=function(){delete a.s.allDayEventHeight,delete a.s.allDayHeaderHeight,delete a.s.headerHeight},s.allDayEventHeight=function(){if(a.s.allDayEventHeight)return a.s.allDayEventHeight;var e=a.ad("_alldayevent_height").height;return e||(e=a.allDayEventHeight),a.s.allDayEventHeight=e,e},s.allDayHeaderHeight=function(){if(a.s.allDayHeaderHeight)return a.s.allDayHeaderHeight;var e=a._c;return a.s.allDayHeaderHeight=e,e},s.headerHeight=function(){if(a.s.headerHeight)return a.s.headerHeight;var e=a.ad("_header_height").height;return e||(e=a.headerHeight),a.s.headerHeight=e,e},this.exportAs=function(e,t){var i=o.generate(e,t);return new DayPilot.Export(i)},this.zc={};var o=this.zc;o.bd=null,o.cd=null,o.generate=function(e,t){"object"==typeof e&&(t=e,e=null);var t=t||{},e=e||t.format||"svg",i=t.scale||1;if("config"!==e){"jpg"===e.toLowerCase()&&(e="jpeg");var n=t.area||"viewport";o.bd=t,o.cd=n;var a,r=o.getWidth(),s=o.getHeight();switch(e.toLowerCase()){case"svg":a=new DayPilot.Svg(r,s);break;case"png":a=new DayPilot.Canvas(r,s,"image/png",i);break;case"jpeg":a=new DayPilot.Canvas(r,s,"image/jpeg",i,t.quality);break;default:throw"Export format not supported: "+e}return a.rect(rectangles.main,borderColor),a.line(rectangles.grid.x,0,rectangles.grid.x,rectangles.main.h,dividerColor),a.line(0,rectangles.grid.y,rectangles.main.w,rectangles.grid.y,dividerColor),a}},o.getWidth=function(){var e=o.cd;switch(e){case"full":return"Fixed"===this.columnWidthSpec?a.hourWidth+a.nb().clientWidth:a.nav.top.clientWidth;default:throw"Unsupported export mode: "+e}},o.getHeight=function(){var e=o.cd;switch(e){case"full":return a.dd()+a.ed()-DayPilot.sh(a.nav.scroll);default:throw"Unsupported export mode: "+e}},this.fd=function(){return!!this.backendUrl&&("undefined"==typeof a.events.list||!a.events.list)},this.gd=function(){if(this.id&&this.id.tagName)this.nav.top=this.id;else{if("string"!=typeof this.id)throw"DayPilot.Calendar() constructor requires the target element or its ID as a parameter";if(this.nav.top=document.getElementById(this.id),!this.nav.top)throw"DayPilot.Calendar: The placeholder element not found: '"+t+"'."}},this.hd=function(){this.gd(),this.Zc(),this.Z(),this.Xb(),this.ca(),this.da(),this.ga(),this.ja(),this.rc(),this.Lc(),this.P(),this.ka(),e.register(this),this.O(),this.la(),this.Ic(),this.qa(),this.F("Init")},this.init=function(){if(this.gd(),!this.nav.top.dp){var t=this.fd();if(a.cssOnly||(a.cssOnly=!0,DayPilot.Util.log("DayPilot: cssOnly = false mode is not supported since DayPilot Pro 8.0.")),t)return this.hd(),void(this.z=!0);this.Zc(),this.Z(),this._(),this.events.list||(this.events.list=[]),this.aa(),this.Xb(),this.ca(),this.da(),this.ga(),this.ma(),this.ka(),this.ja(),this.rc(),this.Lc(),this.P(),e.register(this),this.ba(),this.na(),this.oa(),this.O(),this.messageHTML&&this.message(this.messageHTML),this.la(),this.X(null,!1),this.Ic(),this.qa(),this.z=!0,this.jd()}},this.kd=null,this.ld=function(e){var t={"events":{"preInit":function(){var e=this.data;e&&(DayPilot.isArray(e.list)?a.events.list=e.list:a.events.list=e)}},"scrollToHour":{"postInit":function(){"undefined"!=typeof this.data&&a.scrollToHour(this.data)}}};this.kd=t;for(var i in e)if(t[i]){var n=t[i];n.data=e[i],n.preInit&&n.preInit()}else a[i]=e[i]},this.jd=function(){var e=this.kd;for(var t in e){var i=e[t];i.postInit&&i.postInit()}},this.internal={},this.internal.initialized=function(){return a.z},this.internal.invokeEvent=this.Pa,this.internal.eventMenuClick=this.Ya,this.internal.timeRangeMenuClick=this.Za,this.internal.bubbleCallBack=this.Wa,this.internal.findEventDiv=this.Xc,this.internal.eventDeleteDispatch=this.Oa,this.internal.touch=this.Sb,this.Init=this.init,this.ld(i)};var e={};e.topSelectedCell=null,e.bottomSelectedCell=null,e.selecting=!1,e.column=null,e.firstSelected=null,e.firstMousePos=null,e.originalMouse=null,e.originalHeight=null,e.originalTop=null,e.globalHandlers=!1,e.editing=!1,e.originalText=null,e.register=function(t){e.registered||(e.registered=[]);for(var i=e.registered,n=0;n","compile":function(t,i){return t.replaceWith(this["template"].replace("{{id}}",i["id"])),function(t,i,n){var a=new DayPilot.Calendar(i[0]);a.Gc.scope=t,a.init();var o=n["id"];o&&(t[o]=a);var r=n["publishAs"];if(r){(0,e(r).assign)(t,a)}for(var s in n)if(0===s.indexOf("on")){var l=DayPilot.Util.shouldApply(s);l?!function(i){a[i]=function(a){var o=e(n[i]);t["$apply"](function(){o(t,{"args":a})})}}(s):!function(i){a[i]=function(a){e(n[i])(t,{"args":a})}}(s)}var d=t["$watch"],c=n["config"]||n["daypilotConfig"],h=n["events"]||n["daypilotEvents"];d.call(t,c,function(e,t){for(var i in e)a[i]=e[i];a.update()},!0),d.call(t,h,function(e){a.events.list=e,a.Yc({"eventsOnly":!0})},!0)}}}}])}(),"undefined"!=typeof Sys&&Sys.Application&&Sys.Application.notifyScriptLoaded&&Sys.Application.notifyScriptLoaded()}}(),"undefined"==typeof DayPilot)var DayPilot={};if("undefined"==typeof DayPilot.Global&&(DayPilot.Global={}),function(){"undefined"==typeof DayPilot.DatePicker&&(DayPilot.DatePicker=function(e){this.v="2709";var t="navigator_"+(new Date).getTime(),i=this;this.onShow=null,this.onTimeRangeSelect=null,this.onTimeRangeSelected=null,this.prepare=function(){if(this.locale="en-us",this.target=null,this.resetTarget=!0,this.pattern=this.Nb.locale().datePattern,this.theme=null,this.patterns=[],e)for(var t in e)this[t]=e[t];this.init()},this.init=function(){this.date=new DayPilot.Date(this.date);var e=this.md();this.resetTarget&&!e&&this.nd(this.date),DayPilot.re(document,"mousedown",function(){i.close()})},this.close=function(){this.Hc&&(this.navigator&&this.navigator.dispose(),this.div.innerHTML="",this.div&&this.div.parentNode===document.body&&document.body.removeChild(this.div))},this.md=function(){var e=this.od();if(!e)return this.date;var t=null;if(t="INPUT"===e.tagName?e.value:e.innerText,!t)return null;for(var n=DayPilot.Date.parse(t,i.pattern),a=0;ao)&&(o=t.getTime())}i&&o?(e=new DayPilot.Date(i).getDatePart(),t=new DayPilot.Date(o).getDatePart().addDays(1),a.startDate=n.startDate||e,a.days=n.days||DayPilot.DateUtil.daysDiff(e,t)):(a.startDate=e,a.days=30)}},this.commandCallBack=function(e,t){s.translate(),a.commandCallBack(e,t)},this.message=function(e,t,i,n){a.message(e,t,i,n)},this.setHeight=function(e){a.setHeight(e)},this.fd=function(){return!!this.backendUrl&&(!DayPilot.isArray(n.tasks.list)||0==n.tasks.list.length)},this.init=function(){s.translate(),s.rd(),s.sd(),this.ud(),a.init(),this.z=!0,this.jd()},this.update=function(){s.translate(),s.rd(),s.sd(),n.ud(),a.update()},this.scrollTo=function(e){a.scrollTo(e)},this.scrollToTask=function(e){a.scrollToResource(e)},this.vd={};var r=this.vd;r.cache={},r.clearCache=function(){r.cache={}},r.addToCache=function(e,t){var i=e.id;if(i){var n={};if(n.isTaskWrapper=!0,n.data=e,n.parent=t,r.cache[i])throw"Duplicate task id detected";r.cache[i]=n}},r.findInCache=function(e){return e?r.cache[e.toString()]:null},r.getProperty=function(e,t){return e.tags&&e.tags[t]?e.tags[t]:e[t]},r.findParentArray=function(e){return r.findInArray(n.tasks.list,e)},r.findInArray=function(e,t){if(DayPilot.indexOf(e,t)!==-1)return e;for(var i=0;i0){var a=r.findInArray(n.children,t);if(a)return a}}return null},this.xd={};var s=this.xd;s.translate=function(){if(a.durationBarMode="PercentComplete",a.timeRangeSelectedHandling="Disabled",a.treeEnabled=!0,a.rowCreateHtml="",a.autoRefreshCommand=n.autoRefreshCommand,a.autoRefreshEnabled=n.autoRefreshEnabled,a.autoRefreshInterval=n.autoRefreshInterval,a.autoRefreshMaxCount=n.autoRefreshMaxCount,a.autoScroll=n.autoScroll,a.backendUrl=n.backendUrl,a.crosshairColor=n.crosshairColor,a.crosshairOpacity=n.crosshairOpacity,a.crosshairType=n.crosshairType,a.doubleClickTimeout=n.doubleClickTimeout,a.durationBarVisible=n.completeBarVisible,a.durationBarHeight=n.completeBarHeight,a.dynamicEventRendering=n.progressiveTaskRendering?"Progressive":"Disabled",a.dynamicEventRenderingMargin=n.progressiveTaskRenderingMargin,a.dynamicEventRenderingCacheSweeping=n.progressiveTaskRenderingCacheSweeping,a.dynamicEventRenderingCacheSize=n.progressiveTaskRenderingCacheSize,a.startDate=new DayPilot.Date(n.startDate),a.days=n.days,a.cellDuration=n.cellDuration,a.cellGroupBy=n.cellGroupBy,a.cellWidth=n.cellWidth,a.cellWidthSpec=n.cellWidthSpec,a.cornerHtml=n.cornerHtml,a.eventHeight=n.taskHeight,a.eventResizeMargin=n.taskResizeMargin,a.floatingEvents=n.floatingTasks,a.floatingTimeHeaders=n.floatingTimeHeaders,a.headerHeight=n.headerHeight,a.heightSpec=n.heightSpec,a.height=n.height,a.linkBottomMargin=n.linkBottomMargin,a.linkPointSize=n.linkPointSize,a.loadingLabelVisible=n.loadingLabelVisible,a.loadingLabelText=n.loadingLabelText,a.locale=n.locale,a.messageBarPosition=n.messageBarPosition,a.messageHideAfter=n.messageHideAfter,a.rowCreateHandling=n.rowCreateHandling,a.progressiveRowRendering=n.progressiveRowRendering,a.progressiveRowRenderingPreload=n.progressiveRowRenderingPreload,a.scale=n.scale,a.scrollDelayEvents=n.scrollDelayTasks,a.scrollDelayCells=n.scrollDelayCells,a.scrollDelayFloats=n.scrollDelayFloats,a.scrollX=n.scrollX,a.scrollY=n.scrollY,n.scrollToTaskId&&(a.scrollToResourceId=n.scrollToTaskId),a.separators=n.separators,a.tapAndHoldTimeout=n.tapAndHoldTimeout,a.eventMovingStartEndEnabled=n.taskMovingStartEndEnabled,a.eventMovingStartEndFormat=n.taskMovingStartEndFormat,a.eventResizingStartEndEnabled=n.taskResizingStartEndEnabled,a.eventResizingStartEndFormat=n.taskResizingStartEndFormat,a.hideUntilInit=n.hideUntilInit,a.treeIndent=n.treeIndent,a.treeAutoExpand=n.treeAutoExpand,a.treeImageMarginLeft=n.treeImageMarginLeft,a.treeImageMarginTop=n.treeImageMarginTop,a.timeHeaders=n.timeHeaders,a.rowHeaderHideIconEnabled=n.rowHeaderHideIconEnabled,a.rowHeaderScrolling=n.rowHeaderScrolling,a.rowHeaderSplitterWidth=n.rowHeaderSplitterWidth,a.rowHeaderWidth=n.rowHeaderWidth,a.rowHeaderWidthAutoFit=n.rowHeaderWidthAutoFit,a.rowMarginBottom=n.rowMarginBottom,a.rowMinHeight=n.rowMinHeight,a.selectedRows=n.selectedRows,a.theme=n.theme,a.useEventBoxes=n.useEventBoxes,a.snapToGrid=n.snapToGrid,a.uniqueID=n.uniqueID,a.bubble=n.bubbleTask,a.cellBubble=n.bubbleCell,a.resourceBubble=n.bubbleRow,a.contextMenu=n.contextMenuTask,a.contextMenuResource=n.contextMenuRow,a.contextMenuLink=n.contextMenuLink,a.syncResourceTree=n.syncTasks,a.syncLinks=n.syncLinks,a.timeline=n.timeline,a.visible=n.visible,a.eventMoveHandling=n.taskMoveHandling,a.eventClickHandling=n.taskClickHandling,a.eventResizeHandling=n.taskResizeHandling,a.linkCreateHandling=n.linkCreateHandling,a.eventRightClickHandling=n.taskRightClickHandling,a.eventDoubleClickHandling=n.taskDoubleClickHandling,a.rowMoveHandling=n.rowMoveHandling,a.rowClickHandling=n.rowClickHandling,a.rowDoubleClickHandling=n.rowDoubleClickHandling,a.rowEditHandling=n.rowEditHandling,a.rowSelectHandling=n.rowSelectHandling,a.eventVersionsEnabled=n.taskVersionsEnabled,a.eventVersionHeight=n.taskVersionHeight,a.eventVersionMargin=n.taskVersionMargin,DayPilot.isArray(n.columns)){a.rowHeaderColumns=[];for(var e=0;ei.getTime())&&(i=a.end)}return{"start":t,"end":i}},this.rows={},this.rows.expand=function(e){a.rows.expand(e)},this.rows.expandAll=function(){a.rows.expandAll()},this.rows.selection={},this.rows.selection.add=function(e){a.rows.find(e.data.id)},this.rows.selection.clear=function(){a.rows.selection.clear()},this.rows.selection.get=function(){return a.rows.selection.get().map(function(e){return new DayPilot.Task(e.$.row.task,n)})},this.kd=null,this.ld=function(e){var t={"tasks":{"preInit":function(){var e=this.data;e&&(DayPilot.isArray(e.list)?n.tasks.list=e.list:n.tasks.list=e)}},"links":{"preInit":function(){var e=this.data;e&&(DayPilot.isArray(e.list)?n.links.list=e.list:n.links.list=e)}},"scrollTo":{"postInit":function(){this.data&&n.scrollTo(this.data)}},"scrollToTask":{"postInit":function(){this.data&&n.scrollToTask(this.data)}}};this.kd=t;for(var i in e)if(t[i]){var a=t[i];a.data=e[i],a.preInit&&a.preInit()}else n[i]=e[i]},this.jd=function(){var e=this.kd;for(var t in e){var i=e[t];i.postInit&&i.postInit()}},this.internal={},this.internal.initialized=function(){return n.z},this.internal.rowObjectForTaskData=s.Bd,this.internal.loadOptions=n.ld,this.Gc={},this.Gc.scope=null,this.Gc.notify=function(){n.Gc.scope&&n.Gc.scope["$apply"]()},this.ld(i)},"undefined"!=typeof jQuery&&!function(e){e.fn.daypilotGantt=function(e){var t=null,i=this.each(function(){if(!this.daypilot){var i=new DayPilot.Gantt(this.id,e);i.init(),this.daypilot=i,t||(t=i)}});return 1===this.length?t:i}}(jQuery),function(){var e=DayPilot.am();e&&e.directive("daypilotGantt",["$parse",function(e){return{"restrict":"E","template":"
","compile":function(t,i){return t.replaceWith(this["template"].replace("{{id}}",i["id"])),function(t,i,n){var a=new DayPilot.Gantt(i[0]);a.Gc.scope=t,a.init();var o=n["id"];o&&(t[o]=a);var r=n["publishAs"];if(r){(0,e(r).assign)(t,a)}for(var s in n)if(0===s.indexOf("on")){var l=DayPilot.Util.shouldApply(s);l?!function(i){a[i]=function(a){var o=e(n[i]);t["$apply"](function(){o(t,{"args":a})})}}(s):!function(i){a[i]=function(a){e(n[i])(t,{"args":a})}}(s)}var d=t["$watch"],c=n["config"]||n["daypilotConfig"];d.call(t,c,function(e,t){a.ld(e),a.update()},!0)}}}}])}(),"undefined"!=typeof Sys&&Sys.Application&&Sys.Application.notifyScriptLoaded&&Sys.Application.notifyScriptLoaded()}}(),"undefined"==typeof DayPilot)var DayPilot={};if("undefined"==typeof DayPilot.Global&&(DayPilot.Global={}),function(){"undefined"==typeof DayPilot.Kanban&&(DayPilot.Kanban=function(e,t){this.v="2709";var i=this;this.barWidth=5,this.cardAutoHeight=!0,this.cardHeight=60,this.cardMarginLeft=5,this.cardMarginRight=5,this.cardMarginBottom=5,this.columnHeaderHeight=20, this.crosshairColor="gray",this.height=300,this.heightSpec="Auto",this.theme="kanban_default",this.cellMarginBottom=4,this.cellMarginTop=5,this.rowMinHeight=0,this.swimlaneCollapsingEnabled=!1,this.swimlaneHeaderWidth=80,this.visible=!0,this.swimlanes={},this.swimlanes.list=[],this.columns={},this.columns.list=[],this.cards={},this.cards.list=[],this.cardDeleteHandling="Disabled",this.cardMoveHandling="Update",this.columnMoveHandling="Disabled",this.swimlaneMoveHandling="Disabled",this.onBeforeCellRender=null,this.onCardClick=null,this.onCardClicked=null,this.onCardDelete=null,this.onCardDeleted=null,this.onCardMove=null,this.onCardMoved=null,this.onColumnMove=null,this.onColumnMoved=null,this.onHeightChanged=null,this.onSwimlaneMove=null,this.onSwimlaneMoved=null;var n=new DayPilot.Scheduler(e);this.scheduler=n;var a={},o=15;a.translate=function(){var e=n;e.startDate="2000-01-01",e.scale="Day",e.timeHeaders=[{groupBy:"Cell",format:"d"}],e.heightSpec=i.heightSpec,e.cellWidthSpec="Auto",e.cellsMarkBusiness=!1,e.crosshairColor=i.crosshairColor,e.dynamicEventRendering="Disabled",e.floatingEvents=!1,e.floatingTimeHeaders=!1,e.rowMinHeight=i.rowMinHeight,e.rowMarginTop=i.cellMarginTop,e.rowMarginBottom=i.cellMarginBottom,e.eventMoveToPosition=!0,e.headerHeight=i.columnHeaderHeight,e.eventResizeHandling="Disabled",e.timeRangeSelectedHandling="Disabled",e.eventHeight=i.cardHeight,e.eventMarginLeft=i.cardMarginLeft,e.eventMarginRight=i.cardMarginRight,e.eventMarginBottom=i.cardMarginBottom,e.eventTextWrappingEnabled=!0,e.cellStacking=!0,e.cellStackingAutoHeight=i.cardAutoHeight,e.durationBarVisible=!1,e.theme=i.theme,e.visible=i.visible,e.rowHeaderWidth=i.swimlaneHeaderWidth,e.eventDeleteHandling=i.cardDeleteHandling,e.eventMoveHandling=i.cardMoveHandling,e.rowMoveHandling=DayPilot.list(i.swimlanes.list).isEmpty()?"Disabled":i.swimlaneMoveHandling,e.onHeightChanged=i.onHeightChanged,e.internal.cssNames.timeheadercol="_colheadercell",e.internal.cssNames.timeheadercolInner="_colheadercell_inner",e.internal.cssNames.resourcedivider="_rowheaderdivider",e.internal.cssNames.event="_card",e.internal.cssNames.eventInner="_card_inner",e.internal.cssNames.eventDelete="_card_delete",e.internal.cssNames.eventMovingSource="_card_moving_source",i.swimlaneCollapsingEnabled&&(e.rowHeaderWidthMarginRight=15),e.onBeforeTimeHeaderRender=function(e){var t=i.Fd(e.header.start);if(e.header.html=t.name,e.header.toolTip=t.toolTip||"",e.header.areas=DayPilot.list(t.areas).map(function(e){var t=[];return DayPilot.Util.copyProps(e,t),t}),DayPilot.list(e.header.areas).each(function(e){e.target=new DayPilot.Column(t,i)}),"Disabled"!==i.columnMoveHandling){var n=i.theme+"_columnmove_handle";e.header.areas.push({"left":0,"top":0,"width":20,"height":20,"css":n,"mousedown":i.Gd,"action":"None"})}},e.onBeforeCellRender=function(t){var n={};n.cell={},n.cell.column=new DayPilot.Column(i.Fd(t.cell.start),i),n.cell.swimlane=null;var a=i.Hd(t.cell.resource);a&&(n.cell.swimlane=new DayPilot.Swimlane(a,i)),n.cell.areas=[],n.cell.cssClass=null,n.cell.html=null,n.cell.backImage=null,n.cell.backRepeat=null,n.cell.backColor=null,"function"==typeof i.onBeforeCellRender&&(i.onBeforeCellRender(n),DayPilot.Util.copyProps(n.cell,t.cell,["areas","cssClass","html","backImage","backRepeat","backColor"]),DayPilot.list(t.cell.areas).each(function(e){e.target={"swimlane":n.cell.swimlane,"column":n.cell.column}}));var o=e.rows.find(t.cell.resource);e.resources[o.index].collapsed&&(t.cell.cssClass||(t.cell.cssClass=""),t.cell.cssClass+=" "+i.theme+"_collapsed")},e.onEventClick=function(e){var t=new DayPilot.Args(e);t.card=new DayPilot.Card(e.e.data.card,i),"function"==typeof i.onCardClick&&i.onCardClick(t),e.wrapped=t},e.onEventClicked=function(e){var t=e.wrapped;"function"==typeof i.onCardClicked&&i.onCardClicked(t)},e.onEventDelete=function(e){var t=new DayPilot.Args(e);t.card=new DayPilot.Card(e.e.data.card,i),"function"==typeof i.onCardDelete&&i.onCardDelete(t),e.wrapped=t},e.onEventDeleted=function(e){DayPilot.rfa(i.cards.list,e.e.data.card);var t=e.wrapped;"function"==typeof i.onCardDeleted&&i.onCardDeleted(t)},e.onEventMove=function(e){var t=new DayPilot.Args(e);t.card=new DayPilot.Card(e.e.data.card,i),t.column=new DayPilot.Column(i.Fd(e.newStart)),t.position=e.position,"*"!==e.newResource?t.swimlane=new DayPilot.Swimlane(i.Hd(e.newResource),i):t.swimlane=null;for(var o=n.cells.find(e.newStart,e.newResource)[0].events(),r=e.position,s=null,l=r-1;o[l];){if(o[l].data!==e.e.data){s=new DayPilot.Card(o[l]);break}l-=1}for(var d=null,c=r;o[c];){if(o[c].data!==e.e.data){d=new DayPilot.Card(o[c]);break}c+=1}if(t.previous=s,t.next=d,"function"==typeof i.onCardMove&&i.onCardMove(t),e.wrapped=t,!e.preventDefault.value){var h=0;d?h=d.wrapped.data.sort[0]:s&&(h=s.wrapped.data.sort[0]),e.e.data.sort=[h,(new DayPilot.Date).toString()],DayPilot.rfa(i.cards.list,e.e.data.card);var u=0;d?u=DayPilot.indexOf(i.cards.list,d.data):s&&(u=DayPilot.indexOf(i.cards.list,s.data)+1),i.cards.list.splice(u,0,e.e.data.card),a.updateSort()}},e.onEventMoved=function(e){var t=e.wrapped,n=DayPilot.list(i.cards.list).find(function(t){return e.e.data.card===t});n.swimlane=t.swimlane?t.swimlane.data.id:null,n.column=t.column.data.id,"function"==typeof i.onCardMoved&&i.onCardMoved(t)},e.onBeforeResHeaderRender=function(e){if(i.swimlaneCollapsingEnabled&&!DayPilot.list(i.swimlanes.list).isEmpty()){var t=i.theme+"_swimlane_collapse";e.resource.collapsed&&(t=i.theme+"_swimlane_expand"),e.resource.areas=[{"right":0,"top":0,"height":15,"width":o,"action":"JavaScript","css":t,"js":function(){i.Id(e.resource.index)}}]}},e.onRowMove=function(e){var t=new DayPilot.Args(e);e.wrapped=t,t.swimlane=new DayPilot.Swimlane(e.source.$.row.swimlane);var a=0;switch(e.position){case"before":a=e.target.index;break;case"after":a=e.target.index+1;break;default:throw"Unexpected target swimlane position: "+e.position}t.position=a,t.previous=null;for(var o=a-1;n.rowlist[o]&&n.rowlist[o].swimlane!==t.swimlane.data;)t.previous=new DayPilot.Swimlane(n.rowlist[o].swimlane),o-=1;t.next=null;for(var r=a;n.rowlist[r]&&n.rowlist[r].swimlane!==t.swimlane.data;)t.next=new DayPilot.Swimlane(n.rowlist[r].swimlane),r+=1;"function"==typeof i.onSwimlaneMove&&i.onSwimlaneMove(t)},e.onRowMoved=function(e){var t=e.wrapped;DayPilot.rfa(i.swimlanes.list,t.swimlane.data);var n=0;t.next?n=DayPilot.indexOf(i.swimlanes.list,t.next.data):t.previous&&(n=DayPilot.indexOf(i.swimlanes.list,t.previous.data)+1),i.swimlanes.list.splice(n,0,t.swimlane.data),"function"==typeof i.onSwimlaneMoved&&i.onSwimlaneMoved(t)},e.treePreventParentUsage=!0},a.loadCards=function(){var e=new DayPilot.Date("2000-01-01"),t=i.theme+"_card_header",a=i.theme+"_card_body",o=(new DayPilot.Date).toString();n.sortDirections=["asc","desc"],n.events.list=DayPilot.list(i.cards.list).map(function(n,r){var s=n.html||n.text||"",l=n.name||"",d={};return d.id=n.id,d.text=n.text,d.html="
"+l+"
"+s+"
",d.resource=n.swimlane,d.start=e.addDays(DayPilot.list(i.columns.list).findIndex(function(e){return n.column===e.id})),d.end=d.start.addDays(1),d.card=n,d.height=n.height,d.cssClass=n.cssClass,d.sort=[r,o],d.areas=DayPilot.list(n.areas).map(function(e){var t={};return DayPilot.Util.copyProps(e,t),e.js&&(t.js=function(t){e.js(new DayPilot.Card(t.data.card,i))}),t}),d.areas.push({"left":0,"width":5,"top":0,"bottom":0,"backColor":n.barColor,"cssClass":i.theme+"_card_bar"}),d})},a.updateSort=function(){var e=(new DayPilot.Date).toString();DayPilot.list(i.cards.list).each(function(t,i){var n=a.findSchedulerEventData(t);n&&(n.sort=[i,e])})},a.findSchedulerEventData=function(e){return DayPilot.list(n.events.list).find(function(t){return t.card===e})},a.loadSwimlanes=function(){var e=DayPilot.list(i.swimlanes.list);n.resources=e.map(function(e){var t={};return t.name=e.name,t.id=e.id,t.swimlane=e,e.collapsed&&(t.collapsed=!0,t.eventHeight=20,t.hideEvents=!0),t}),e.isEmpty()&&(n.resources=[{name:"",id:"*"}])},a.loadColumns=function(){var e=DayPilot.list(i.columns.list);n.days=e.length};var r={};r.active=null,r.div=null,r.update=function(){r.clear();var e=r.findPosition();r.draw(e)},r.clear=function(){DayPilot.de(r.div),r.div=null},r.draw=function(e){var t=0;if(e>=n.itline.length){var a=n.itline[n.itline.length-1];t=a.left+a.width-3}else t=n.itline[e].left;var o=document.createElement("div");o.style.position="absolute",o.style.left=t+"px",o.style.width="3px",o.style.top=0,o.style.height=n.headerHeight+"px",o.className=i.theme+"_columnmove_position",r.div=o,n.nav.timeHeader.appendChild(o)},r.findPosition=function(){if(i.coords.x<0)return 0;var e=DayPilot.list(n.itline).findIndex(function(e){var t=e.left+n.rowHeaderWidth,a=e.width;return i.coords.x0&&e.offsetHeight>0)},this.Ic=function(){var e=i,t=e.Hc;t()||(e.Jc=setInterval(function(){t()&&(e.update(),clearInterval(e.Jc))},100))},this.Kd=function(e){i.coords=DayPilot.mo3(n.nav.top,e),r.active&&r.update()},this.Jd=function(e){if(r.active){var t=r.active.source,n=r.findPosition(),a=i.Fd(t.start),o=new DayPilot.Args;o.column=new DayPilot.Column(a,i),o.position=n,o.previous=null,o.next=null;for(var s=null,l=o.position;0!==l&&!s;)a!==i.columns.list[l-1]&&(s=i.columns.list[l-1]),l-=1;s&&(o.previous=new DayPilot.Column(s,i));var d=null;for(l=o.position;l","compile":function(t,i){return t.replaceWith(this["template"].replace("{{id}}",i["id"])),function(t,i,n){var a=new DayPilot.Kanban(i[0]);a.Gc.scope=t,a.init();var o=n["id"];o&&(t[o]=a);var r=n["publishAs"];if(r){(0,e(r).assign)(t,a)}for(var s in n)if(0===s.indexOf("on")){var l=DayPilot.Util.shouldApply(s);l?!function(i){a[i]=function(a){var o=e(n[i]);t["$apply"](function(){o(t,{"args":a})})}}(s):!function(i){a[i]=function(a){e(n[i])(t,{"args":a})}}(s)}var d=t["$watch"],c=n["config"]||n["daypilotConfig"];d.call(t,c,function(e,t){a.ld(e),a.update()},!0)}}}}])}())}(),"undefined"==typeof DayPilot)var DayPilot={};if("undefined"==typeof DayPilot.Global&&(DayPilot.Global={}),function(){if("undefined"==typeof DayPilot.Menu){var e=function(){},t={};t.mouse=null,t.menu=null,t.handlersRegistered=!1,t.hideTimeout=null,t.waitingSubmenu=null,DayPilot.Menu=function(i){var n=this,a=null;this.v="2709",this.zIndex=10,this.cssClassPrefix="menu_default",this.cssOnly=!0,this.menuTitle=null,this.showMenuTitle=!1,this.hideOnMouseOut=!1,this.theme=null,this.onShow=null,this.n=function(){},i&&DayPilot.isArray(i)&&(this.items=i),this.show=function(i,o){var o=o||{},r=null;if(i?"string"==typeof i.id||"number"==typeof i.id?r=i.id:"function"==typeof i.id?r=i.id():"function"==typeof i.value&&(r=i.value()):r=null,"undefined"!=typeof DayPilot.Bubble&&DayPilot.Bubble.hideActive(),o.submenu||t.menuClean(),this.n.submenu=null,null!==t.mouse){n.cssOnly||(n.cssOnly=!0,DayPilot.Util.log("DayPilot: cssOnly = false mode is not supported since DayPilot Pro 8.0."));var s=null;if(i&&i.isRow&&i.$.row.task?(s=new DayPilot.Task(i.$.row.task,i.calendar),s.menuType="resource"):s=i&&i.isEvent&&i.data.task?new DayPilot.Task(i,i.calendar):i,"function"==typeof n.onShow){var l={};if(l.source=s,l.menu=n,l.preventDefault=function(){l.preventDefault.value=!0},n.onShow(l),l.preventDefault.value)return}var d=document.createElement("div");if(d.style.position="absolute",d.style.top="0px",d.style.left="0px",d.style.display="none",d.style.overflow="hidden",d.style.zIndex=this.zIndex+1,d.className=this.applyCssClass("main"),d.onclick=function(e){e.cancelBubble=!0,this.parentNode.removeChild(this)},this.hideOnMouseOut&&(d.onmousemove=function(e){clearTimeout(t.hideTimeout)},d.onmouseout=function(e){n.delayedHide()}),!this.items||0===this.items.length)throw"No menu items defined.";if(this.showMenuTitle){var c=document.createElement("div");c.innerHTML=this.menuTitle,c.className=this.applyCssClass("title"),d.appendChild(c)}for(var h=0;hS-C&&0!==S){var n=t.mouse.clientY-(S-C)+5;d.style.top=i-n+"px"}else d.style.top=i+"px";if(t.mouse.clientX>A-P&&0!==A){var a=t.mouse.clientX-(A-P)+5;d.style.left=e-a+"px"}else d.style.left=e+"px"}(),o.parentLink){var T=o.parentLink,M=parseInt(new DayPilot.StyleReader(d).get("border-top-width")),E=DayPilot.abs(o.parentLink.parentNode),H=E.x+T.offsetWidth,_=E.y-M;H+P>A&&(H=Math.max(0,E.x-P));var R=document.body.scrollTop+document.documentElement.scrollTop;_+C-R>S&&(_=Math.max(0,S-C+R)),d.style.left=H+"px",d.style.top=_+"px"}d.style.display="",this.addShadow(d),this.n.div=d,o.submenu||(DayPilot.Menu.active=this),function(){var e=o.initiator;if(e){var t=e.div,i=e.e,n=e.area,r=DayPilot.Areas.createArea(t,i,n);t.appendChild(r),a=r}}()}},this.applyCssClass=function(e){var t=this.theme||this.cssClassPrefix,i=this.cssOnly?"_":"";return t?t+i+e:""},this.cloneOptions=function(){for(var e={},t=["cssOnly","cssClassPrefix","useShadow","zIndex"],i=0;i0){var e=this.list.pop();e&&e.hide()}},DayPilot.ModalStatic.remove=function(e){for(var t=DayPilot.ModalStatic.list,i=0;i0&&(t[t.length-1].result=e)},DayPilot.ModalStatic.displayed=function(e){for(var t=DayPilot.ModalStatic.list,i=0;i0){var e=this.list[this.list.length-1];e&&e.stretch()}},DayPilot.ModalStatic.last=function(){var e=DayPilot.ModalStatic.list;return e.length>0?e[e.length-1]:null};var e=function(){var e=document.createElement("style");e.setAttribute("type","text/css"),e.styleSheet||e.appendChild(document.createTextNode("")),(document.head||document.getElementsByTagName("head")[0]).appendChild(e);var t=!!e.styleSheet,i={};return i.rules=[],i.commit=function(){try{t&&(e.styleSheet.cssText=this.rules.join("\n"))}catch(e){}},i.add=function(i,n,a){if(t)return void this.rules.push(i+"{"+n+"}");if(e.sheet.insertRule)"undefined"==typeof a&&(a=e.sheet.cssRules.length),e.sheet.insertRule(i+"{"+n+"}",a);else{if(!e.sheet.addRule)throw"No CSS registration method found";e.sheet.addRule(i,n,a)}},i},t=new e;t.add(".modal_default_main","border: 10px solid #ccc;"),t.add(".modal_default_inner","padding: 10px;"),t.add(".modal_default_input","padding: 10px 0px;"),t.add(".modal_default_buttons","padding: 10px 0px;"),t.add(".modal_default_background","opacity: 0.3; background-color: #000;"),t.add(".modal_min_main","border: 1px solid #ccc;"),t.add(".modal_min_background","opacity: 0.3; background-color: #000;"),t.commit(),DayPilot.Modal=function(e){this.autoStretch=!0,this.autoStretchFirstLoadOnly=!1,this.className=null,this.theme="modal_default",this.disposeOnClose=!0,this.dragDrop=!0,this.loadingHtml=null,this.maxHeight=null,this.scrollWithPage=!0,this.useIframe=!0,this.zIndex=null,this.left=null,this.width=500,this.top=20,this.height=200,this.closed=null,this.onClosed=null,this.onShow=null;var t=this;this.id="_"+(new Date).getTime()+"n"+10*Math.random(),this.Qd=!1,this.Rd=null,this.Sd=null,this.showHtml=function(e){if(DayPilot.ModalStatic.displayed(this))throw"This modal dialog is already displayed.";if(this.div||this.Td(),this.Yc(),this.useIframe){var t=function(e,t){return function(){e.setInnerHTML(e.id+"iframe",t)}};window.setTimeout(t(this,e),0)}else e.nodeType?this.div.appendChild(e):this.div.innerHTML=e;this.Yc(),this.Ud(),this.Vd()},this.Wd=function(){return this.corners&&"rounded"===this.corners.toLowerCase()},this.showUrl=function(e){if(DayPilot.ModalStatic.displayed(this))throw"This modal dialog is already displayed.";if(this.useIframe){this.div||this.Td();var i=this.loadingHtml;i&&(this.iframe.src="about:blank",this.setInnerHTML(this.id+"iframe",i)),this.re(this.iframe,"load",this.Xd),this.iframe.src=e,this.Yc(),this.Ud(),this.Vd()}else t.Yd({"url":e,"success":function(e){var i=e.request.responseText;t.showHtml(i)},"error":function(e){t.showHtml("Error loading the modal dialog")}})},this.Vd=function(){if("function"==typeof t.onShow){var e={};e.root=t.Zd(),t.onShow(e)}},this.Zd=function(){return t.iframe?t.iframe.contentWindow.document:t.div},this.Yd=function(e){var t=new XMLHttpRequest;if(t){var i=e.method||"GET",n=e.success||function(){},a=e.error||function(){},o=e.data,r=e.url;t.open(i,r,!0),t.setRequestHeader("Content-type","text/plain"),t.onreadystatechange=function(){if(4===t.readyState)if(200===t.status||304===t.status){var e={};e.request=t,n(e)}else if(a){var e={};e.request=t,a(e)}else window.console&&console.log("HTTP error "+t.status)},4!==t.readyState&&("object"==typeof o&&(o=JSON.stringify(o)),t.send(o))}},this.Yc=function(){var e=window,i=document,n=e.pageYOffset?e.pageYOffset:i.documentElement&&i.documentElement.scrollTop?i.documentElement.scrollTop:i.body.scrollTop;this.theme&&(this.hideDiv.className=this.theme+"_background"),this.zIndex&&(this.hideDiv.style.zIndex=this.zIndex),this.hideDiv.style.display="",window.setTimeout(function(){t.hideDiv.onclick=function(){t.hide({"backgroundClick":!0})}},500),this.theme?this.div.className=this.theme+"_main":this.div.className="",this.className&&(this.div.className+=" "+this.className),this.left?this.div.style.left=this.left+"px":this.div.style.marginLeft="-"+Math.floor(this.width/2)+"px",this.div.style.position="absolute",this.div.style.boxSizing="content-box",this.div.style.top=n+this.top+"px",this.div.style.width=this.width+"px",this.zIndex&&(this.div.style.zIndex=this.zIndex),this.height&&(this.useIframe||!this.autoStretch?this.div.style.height=this.height+"px":this.div.style.height=""),this.useIframe&&this.height&&(this.iframe.style.height=this.height+"px"),this.div.style.display="",DayPilot.ModalStatic.list.push(this)},this.Xd=function(){t.iframe.contentWindow.modal=t,t.autoStretch&&t.stretch()},this.stretch=function(){var e=function(){return t.$d().y},i=function(){return t.$d().x};if(this.useIframe){for(var n=i()-40,a=this.width;at.clientWidth},this.ae=function(){for(var e=this.iframe.contentWindow.document,t="BackCompat"===e.compatMode?e.body:e.documentElement,i=t.scrollHeight,n=e.body.children,a=0;at.clientHeight},this.$d=function(){var e=document;if("CSS1Compat"===e.compatMode&&e.documentElement&&e.documentElement.clientWidth){var t=e.documentElement.clientWidth,i=e.documentElement.clientHeight;return{x:t,y:i}}var t=e.body.clientWidth,i=e.body.clientHeight;return{x:t,y:i}},this.Ud=function(){this.Qd||(this.re(window,"resize",this.be),this.re(window,"scroll",this.ce),this.dragDrop&&(this.re(document,"mousemove",this.ee),this.re(document,"mouseup",this.fe)),this.Qd=!0)},this.ge=function(e){e.target===t.div&&(t.div.style.cursor="move",t.je(),t.Sd=t.mc(e||window.event),t.Rd={x:t.div.offsetLeft,y:t.div.offsetTop})},this.ee=function(e){if(t.Sd){var e=e||window.event,i=t.mc(e),n=i.x-t.Sd.x,a=i.y-t.Sd.y;t.div.style.marginLeft="0px",t.div.style.top=t.Rd.y+a+"px",t.div.style.left=t.Rd.x+n+"px"}},this.fe=function(e){t.Sd&&(t.ke(),t.div.style.cursor=null,t.Sd=null)},this.je=function(){if(this.useIframe){var e=document.createElement("div");e.style.backgroundColor="#ffffff",e.style.filter="alpha(opacity=80)",e.style.opacity="0.80",e.style.width="100%",e.style.height=this.height+"px",e.style.position="absolute",e.style.left="0px",e.style.top="0px",this.div.appendChild(e),this.mask=e}},this.ke=function(){this.useIframe&&(this.div.removeChild(this.mask),this.mask=null)},this.be=function(){t.le},this.ce=function(){t.le},this.le=function(){if(t.hideDiv&&t.div&&"none"!==t.hideDiv.style.display&&"none"!==t.div.style.display){var e=window.pageYOffset?window.pageYOffset:document.documentElement&&document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop;t.scrollWithPage||(t.div.style.top=e+t.top+"px")}},this.re=function(e,t,i){e.addEventListener?e.addEventListener(t,i,!1):e.attachEvent&&e.attachEvent("on"+t,i)},this.ue=function(e,t,i){e.removeEventListener?e.removeEventListener(t,i,!1):e.detachEvent&&e.detachEvent("on"+t,i)},this.mc=function(e){return e.pageX||e.pageY?{x:e.pageX,y:e.pageY}:{x:e.clientX+document.documentElement.scrollLeft,y:e.clientY+document.documentElement.scrollTop}},this.abs=function(e){for(var t={x:e.offsetLeft,y:e.offsetTop};e.offsetParent;)e=e.offsetParent,t.x+=e.offsetLeft,t.y+=e.offsetTop;return t},this.Td=function(){var e=document.createElement("div");e.id=this.id+"hide",e.style.position="fixed",e.style.left="0px",e.style.top="0px",e.style.right="0px", e.style.bottom="0px",e.oncontextmenu=function(){return!1},e.onmousedown=function(){return!1},document.body.appendChild(e);var t=document.createElement("div");t.id=this.id+"popup",t.style.position="fixed",t.style.left="50%",t.style.top="0px",t.style.backgroundColor="white",t.style.width="50px",t.style.height="50px",this.dragDrop&&(t.onmousedown=this.ge);var i=null;this.useIframe&&(i=document.createElement("iframe"),i.id=this.id+"iframe",i.name=this.id+"iframe",i.frameBorder="0",i.style.width="100%",i.style.height="50px",t.appendChild(i)),document.body.appendChild(t),this.div=t,this.iframe=i,this.hideDiv=e},this.setInnerHTML=function(e,i){var n=window.frames[e],a=n.contentWindow||n.document||n.contentDocument;a.document&&(a=a.document),null==a.body&&a.write(""),i.nodeType?a.body.appendChild(i):a.body.innerHTML=i,t.autoStretch&&(t.autoStretchFirstLoadOnly&&t.me||(t.stretch(),t.me=!0))},this.close=function(e){this.result=e,this.hide()},this.hide=function(e){e=e||{};var i={};if(i.backgroundClick=!!e.backgroundClick,i.result=this.result,i.preventDefault=function(){this.preventDefault.value=!0},("function"!=typeof this.onClose||(this.onClose(i),!i.preventDefault.value))&&(this.div&&(this.div.style.display="none",this.hideDiv.style.display="none",this.useIframe||(this.div.innerHTML=null)),window.focus(),DayPilot.ModalStatic.remove(this),"function"==typeof this.onClosed?this.onClosed(i):this.closed&&this.closed(),this.result=null,this.disposeOnClose&&t.div)){t.div.parentNode.removeChild(t.div),t.div=null}},this.ne=function(){if(e)for(var t in e)this[t]=e[t]},this.ne()},DayPilot.Modal.alert=function(e,t){t=t||{},t.height=t.height||40,t.useIframe=!1;var i=t.okText||"OK";t.cancelText||"Cancel";return DayPilot.getPromise(function(n,a){t.onClosed=function(e){n(e)};var o=new DayPilot.Modal(t),r=document.createElement("div");r.className=o.theme+"_inner";var s=document.createElement("div");s.className=o.theme+"_content",s.innerHTML=e;var l=document.createElement("div");l.className=o.theme+"_buttons";var d=document.createElement("button");d.innerText=i,d.className=o.theme+"_ok",d.onclick=function(e){parent.DayPilot.ModalStatic.close("OK")},l.appendChild(d),r.appendChild(s),r.appendChild(l),o.showHtml(r),d.focus()})},DayPilot.Modal.confirm=function(e,t){t=t||{},t.height=t.height||40,t.useIframe=!1;var i=t.okText||"OK",n=t.cancelText||"Cancel";return DayPilot.getPromise(function(a,o){t.onClosed=function(e){a(e)};var r=new DayPilot.Modal(t),s=document.createElement("div");s.className=r.theme+"_inner";var l=document.createElement("div");l.className=r.theme+"_content",l.innerHTML=e;var d=document.createElement("div");d.className=r.theme+"_buttons";var c=document.createElement("button");c.innerText=i,c.className=r.theme+"_ok",c.onclick=function(e){parent.DayPilot.ModalStatic.close("OK")};var h=document.createTextNode(" "),u=document.createElement("button");u.innerText=n,u.className=r.theme+"_cancel",u.onclick=function(e){parent.DayPilot.ModalStatic.close()},d.appendChild(c),d.appendChild(h),d.appendChild(u),s.appendChild(l),s.appendChild(d),r.showHtml(s),c.focus()})},DayPilot.Modal.prompt=function(e,t,i){"object"==typeof t&&(i=t),i=i||{},i.height=i.height||40,i.useIframe=!1;var n=i.okText||"OK",a=i.cancelText||"Cancel";return DayPilot.getPromise(function(t,o){i.onClosed=function(e){t(e)};var r=new DayPilot.Modal(i),s=document.createElement("div");s.className=r.theme+"_inner";var l=document.createElement("div");l.className=r.theme+"_content",l.innerHTML=e;var d=document.createElement("div");d.className=r.theme+"_input";var c=document.createElement("input");c.innerText=c.style.width="100%",c.onkeydown=function(e){switch(e.keyCode){case 13:parent.DayPilot.ModalStatic.close(this.value);break;case 27:parent.DayPilot.ModalStatic.close()}},d.appendChild(c);var h=document.createElement("div");h.className=r.theme+"_buttons";var u=document.createElement("button");u.innerText=n,u.className=r.theme+"_ok",u.onclick=function(e){parent.DayPilot.ModalStatic.close(c.value)};var f=document.createTextNode(" "),v=document.createElement("button");v.innerText=a,v.className=r.theme+"_cancel",v.onclick=function(e){parent.DayPilot.ModalStatic.close()},h.appendChild(u),h.appendChild(f),h.appendChild(v),s.appendChild(l),s.appendChild(d),s.appendChild(h),r.showHtml(s),c.focus()})},DayPilot.Modal.close=function(e){if(!(parent&&parent.DayPilot&&parent.DayPilot.ModalStatic))throw"Unable to close DayPilot.Modal dialog.";parent.DayPilot.ModalStatic.close(e)},DayPilot.Modal.closeSerialized=function(){for(var e=DayPilot.Modal.opener()||DayPilot.ModalStatic.last(),t=e.Zd(),i=t.querySelectorAll("input, textarea, select"),n={},a=0;ao.getTime()))for(var r=0;rd.getTime()))for(var e=0;e=i.start.getTime()&&l.getTime()=7;)i--,d-=7;if(d>e){d>e+(7-this.xe())?(i--,e=e+7-d):(s=s-d+e,e=0)}else e-=d;i<0&&(i=0,e=0);var c=null;for(t.resizingEvent?c="w-resize":t.movingEvent&&(c="move"),this.nav.top.style.cursor=c;s>0&&i0&&(t=t.concat(r)),DayPilot.Areas.showAreas(e,e.event,null,t)}}(),a.cssOnly&&a.Je(i.event).each(function(e){DayPilot.Util.addClass(e,a.p("_event_hover"))});var r=6;if(!a.cellMode&&o.x<=r&&n.client.resizeEnabled()?n.part.startsHere?(i.style.cursor="w-resize",i.dpBorder="left"):i.style.cursor="not-allowed":!a.cellMode&&i.clientWidth-o.x<=r&&n.client.resizeEnabled()?n.part.endsHere?(i.style.cursor="e-resize",i.dpBorder="right"):i.style.cursor="not-allowed":i.style.cursor="default","undefined"!=typeof DayPilot.Bubble&&a.bubble&&"Disabled"!==a.eventHoverHandling)if(t.movingEvent||t.resizingEvent)DayPilot.Bubble.hideActive();else{var s=this.Nc&&o.x===this.Nc.x&&o.y===this.Nc.y;s||(this.Nc=o,a.bubble.showEvent(i.event))}}}},this.Qb=function(e){var t=this;"undefined"!=typeof DayPilot.Bubble&&a.bubble&&a.bubble.hideOnMouseOut(),t.style.cursor="",a.cssOnly&&a.Je(t.event).each(function(e){DayPilot.Util.removeClass(e,a.p("_event_hover"))}),DayPilot.Areas.hideAreas(t,e)},this.Ie=function(){var e=this;return a.Ka(e.event),!1},this.Rb=function(e){if(!o.start){var i=this,n=i.event,r=n.part.row,s=n.part.colStart,l=n.part.line,d=n.part.colWidth;e=e||window.event;var c=DayPilot.Util.mouseButton(e);if(e.cancelBubble=!0,e.stopPropagation&&e.stopPropagation(),c.left)if("undefined"!=typeof DayPilot.Bubble&&a.bubble&&DayPilot.Bubble.hideActive(),t.movingEvent=null,"w-resize"===this.style.cursor||"e-resize"===this.style.cursor){var h={};h.start={},h.start.x=s,h.start.y=r,h.event=i.event,h.width=DayPilot.DateUtil.daysSpan(h.event.start(),h.event.end())+1,h.direction=this.style.cursor,t.resizingEvent=h}else if("move"===this.style.cursor||n.client.moveEnabled()){a.Ee();var u=DayPilot.mo3(a.nav.events,e);if(!u)return;var f=a.Ke(u.x,u.y);if(!f)return;var v=DayPilot.DateUtil.daysDiff(n.start(),a.rows[r].start),p=7*f.y+f.x-(7*r+s);v&&(p+=v);var g={};g.start={},g.start.x=s,g.start.y=r,g.start.line=l,g.offset=a.eventMoveToPosition?0:p,g.colWidth=d,g.event=i.event,g.coords=u,t.movingEvent=g}}},this.temp={},this.temp.getPosition=function(){if(!a.coords)return null;var e=a.Ke(a.coords.x,a.coords.y);if(!e)return null;var t=new DayPilot.Date(a.Fe(e.x,e.y)),e={};return e.start=t,e.end=t.addDays(1),e},this.Sb={};var o=a.Sb;o.active=!1,o.start=!1,o.timeouts=[],o.onEventTouchStart=function(e){if(!o.active&&!o.start){o.clearTimeouts(),o.start=!0,o.active=!1;var t=this;if(t.event.client.moveEnabled()){var i=a.tapAndHoldTimeout;o.timeouts.push(window.setTimeout(function(){o.active=!0,o.start=!1;var i=o.relativeCoords(e);o.startMoving(t,i),e.preventDefault()},i))}e.stopPropagation()}},o.onEventTouchMove=function(e){o.clearTimeouts(),o.start=!1},o.onEventTouchEnd=function(e){o.clearTimeouts(),o.start&&a.Ga(this,e),window.setTimeout(function(){o.start=!1,o.active=!1},500)},o.onMainTouchStart=function(e){if(!o.active&&!o.start){o.clearTimeouts(),o.start=!0,o.active=!1;var t=a.tapAndHoldTimeout;o.timeouts.push(window.setTimeout(function(){o.active=!0,o.start=!1,e.preventDefault();var t=o.relativeCoords(e);o.startRange(t)},t))}},o.onMainTouchMove=function(e){if(o.clearTimeouts(),o.start=!1,o.active){e.preventDefault();var t=o.relativeCoords(e);if(o.moving)return void o.updateMoving(t);o.range&&o.updateRange(t)}},o.onMainTouchEnd=function(e){if(o.clearTimeouts(),o.active){if(o.moving){var t=(o.moving,o.moving.event),i=a.shadow.start,n=a.shadow.position,r=o.moving.offset;a.Ee(),o.moving=null,a.Ta(t,i.x,i.y,r,e,n)}if(o.range){var s=o.range,i=new DayPilot.Date(a.Fe(s.from.x,s.from.y)),l=i.addDays(s.width);o.range=null,a.$a(i,l)}}window.setTimeout(function(){o.start=!1,o.active=!1},500)},o.clearTimeouts=function(){for(var e=0;e=this.end.getTime())},l.getPartStart=function(e){return DayPilot.DateUtil.max(this.start,e.start())},l.getPartEnd=function(e){return DayPilot.DateUtil.min(this.end,e.rawend())},l.getStartColumn=function(e){var t=this.getPartStart(e);return DayPilot.DateUtil.daysDiff(this.start,t)},l.getWidth=function(e){return DayPilot.DateUtil.daysSpan(this.getPartStart(e),this.getPartEnd(e))+1},l.putIntoLine=function(e,t,i,n){for(var a=this,o=0;oa.part.colStart+a.part.colWidth-1||(i=!1)}return i},r.addEvent=function(e,t,i,n,o){e.part.colStart=t,e.part.colWidth=i,e.part.row=n,e.part.line=o,e.part.startsHere=a.start.getTime()<=e.start().getTime(),e.part.endsHere=a.end.getTime()>=e.end().getTime(),this.push(e)},r.addEvent(e,t,i,n,this.lines.length),this.lines.push(r),this.lines.length-1},l.getStart=function(){for(var e=0,t=0;t=7;)i.y++,t-=7;return i.x=t,i},this.Re=function(){var e=DayPilot.sw(this.nav.scrollable);this.nav.header.style.marginRight=e+"px"};var r=null;this.se=function(){var e=this.nav.header,t=this.nav.events; this.cells=[];for(var i=0;i6&&(o-=7),!n){var n={};n.html=s.locale().dayNames[o],this.cssOnly||(n.backColor=this.headerBackColor)}if("function"==typeof a.onBeforeHeaderRender){var l={};l.header={},l.header.dayOfWeek=o;var d=["html","backColor","cssClass"];DayPilot.Util.copyProps(n,l.header,d),a.onBeforeHeaderRender(l),DayPilot.Util.copyProps(l.header,n,d)}var c=document.createElement("div");c.setAttribute("unselectable","on"),c.style.position="absolute",c.style.left=this.De()*i+"%",c.style.width=this.De()+"%",c.style.top="0px",c.style.height=s.headerHeight()+"px",function(e){c.onclick=function(){a.La(e)}}(o);var h=document.createElement("div");h.setAttribute("unselectable","on"),h.className=this.p("_header_inner"),h.innerHTML=n.html,c.appendChild(h),this.cssOnly?(c.className=this.p("_header"),n&&(n.cssClass&&DayPilot.Util.addClass(c,n.cssClass),n.backColor&&(h.style.background=n.backColor))):(h.style.position="absolute",h.style.top="0px",h.style.bottom="0px",h.style.left="0px",h.style.right="0px",h.style.backgroundColor=n.backColor,h.style.fontFamily=this.headerFontFamily,h.style.fontSize=this.headerFontSize,h.style.color=this.headerFontColor,h.style.textAlign="center",h.style.cursor="default",h.className=this.p("header"),i!==this.xe()-1&&(h.style.borderRight="1px solid "+this.borderColor)),e.appendChild(c);for(var u=0;ul-s)return}"Disabled"!==a.timeRangeSelectedHandling&&(a.Ee(),t.timeRangeSelecting={"root":a,"x":n,"y":o,"from":{x:n,y:o},"width":1})},this.xe=function(){return this.showWeekend?7:5},this.De=function(){return this.showWeekend?14.285:20},this.We=function(e){return 6===e.getUTCDay()||0===e.getUTCDay()?this.nonBusinessBackColor:this.backColor},this.Be=function(e){for(var t=0,i=0;i1&&i.add(e.event,!0)}else i.clear(!0);else a.allowMultiSelect&&t?i.add(e.event,!0):(i.clear(!0),i.add(e.event,!0));i.redraw(),i.vb()},this.multiselect.wb=function(e){var t=a.multiselect;return t.xb(e,t.initList)},this.multiselect.yb=function(){for(var e=a.multiselect,t=[],i=0;i=this.autoRefreshMaxCount)){this.Ye();var t=this.autoRefreshInterval;if(!t||t<10)throw"The minimum autoRefreshInterval is 10 seconds";this.autoRefreshTimeout=window.setTimeout(function(){a.Kc()},1e3*this.autoRefreshInterval)}},this.Ye=function(){this.autoRefreshTimeout&&window.clearTimeout(this.autoRefreshTimeout)},this.Kc=function(){if(!t.eventResizing&&!t.eventMoving&&!t.timeRangeSelecting){var e=!1;if("function"==typeof this.onAutoRefresh){var i={};i.i=this.A,i.preventDefault=function(){this.preventDefault.value=!0},a.onAutoRefresh(i),i.preventDefault.value&&(e=!0)}!e&&this.q()&&this.commandCallBack(this.autoRefreshCommand),this.A++}this.A","compile":function(t,i){return t.replaceWith(this["template"].replace("{{id}}",i["id"])),function(t,i,n){var a=new DayPilot.Month(i[0]);a.Gc.scope=t,a.init();var o=n["id"];o&&(t[o]=a);var r=n["publishAs"];if(r){(0,e(r).assign)(t,a)}for(var s in n)if(0===s.indexOf("on")){var l=DayPilot.Util.shouldApply(s);l?!function(i){a[i]=function(a){var o=e(n[i]);t["$apply"](function(){o(t,{"args":a})})}}(s):!function(i){a[i]=function(a){e(n[i])(t,{"args":a})}}(s)}var d=t["$watch"],c=n["config"]||n["daypilotConfig"],h=n["events"]||n["daypilotEvents"];d.call(t,c,function(e,t){for(var i in e)a[i]=e[i];a.update()},!0),d.call(t,h,function(e){a.events.list=e,a.Yc({"eventsOnly":!0})},!0)}}}}])}(),"undefined"!=typeof Sys&&Sys.Application&&Sys.Application.notifyScriptLoaded&&Sys.Application.notifyScriptLoaded()}}(),"undefined"==typeof DayPilot)var DayPilot={};if("undefined"==typeof DayPilot.Global&&(DayPilot.Global={}),function(){if("undefined"==typeof DayPilot.Navigator){DayPilot.Navigator=function(e,t){this.v="2709";var i=this;this.id=e,this.api=2,this.isNavigator=!0,this.autoFocusOnClick=!0,this.weekStarts="Auto",this.selectMode="day",this.titleHeight=20,this.dayHeaderHeight=20,this.bound=null,this.cellWidth=20,this.cellHeight=20,this.cssOnly=!0,this.cssClassPrefix="navigator_default",this.freeHandSelectionEnabled=!1,this.selectionStart=(new DayPilot.Date).getDatePart(),this.selectionEnd=null,this.selectionDay=null,this.showMonths=1,this.skipMonths=1,this.command="navigate",this.year=(new DayPilot.Date).getYear(),this.month=(new DayPilot.Date).getMonth()+1,this.showWeekNumbers=!1,this.weekNumberAlgorithm="Auto",this.rowsPerMonth="Six",this.orientation="Vertical",this.locale="en-us",this.visible=!0,this.timeRangeSelectedHandling="Bind",this.visibleRangeChangedHandling="Enabled",this.onVisibleRangeChange=null,this.onVisibleRangeChanged=null,this.onTimeRangeSelect=null,this.onTimeRangeSelected=null,this.nav={},this.s={},this.$e=function(){this.root.dp=this,this.cssOnly?this.root.className=this.p("_main"):this.root.className=this.p("main"),"Horizontal"===this.orientation?(this.root.style.width=this.showMonths*(7*o.cellWidth()+this._e())+"px",this.root.style.height=6*this.cellHeight+this.titleHeight+this.dayHeaderHeight+"px"):this.root.style.width=7*o.cellWidth()+this._e()+"px",this.root.style.position="relative",this.visible||(this.root.style.display="none");var e=document.createElement("input");e.type="hidden",e.name=i.id+"_state",e.id=e.name,this.root.appendChild(e),this.state=e,this.startDate?this.startDate=new DayPilot.Date(this.startDate).firstDayOfMonth():this.startDate=DayPilot.Date.fromYearMonthDay(this.year,this.month),this.calendars=[],this.selected=[],this.months=[]},this.ra=function(){return 2===i.api},this.qe=function(){this.root.innerHTML=""},this.p=function(e){var t=this.theme||this.cssClassPrefix;return t?t+e:""},this.af=function(e,t){var i=this.cssOnly?this.p("_"+t):this.p(t);DayPilot.Util.addClass(e,i)},this.bf=function(e,t){var i=this.cssOnly?this.p("_"+t):this.p(t);DayPilot.Util.removeClass(e,i)},this.se=function(e,t){var n={};n.cells=[],n.days=[],n.weeks=[];var a=this.startDate.addMonths(e),r=t.before,s=t.after,l=a.firstDayOfMonth(),d=l.firstDayOfWeek(o.weekStarts()),c=l.addMonths(1),h=DayPilot.DateUtil.daysDiff(d,c),u="Auto"===this.rowsPerMonth?Math.ceil(h/7):6;n.rowCount=u;var f=(new DayPilot.Date).getDatePart(),v=7*o.cellWidth()+this._e();n.width=v;var p=this.cellHeight*u+this.titleHeight+this.dayHeaderHeight;n.height=p;var g=document.createElement("div");if(g.style.width=v+"px",g.style.height=p+"px","Horizontal"===this.orientation)g.style.position="absolute",g.style.left=v*e+"px",g.style.top="0px",n.top=0,n.left=v*e;else{g.style.position="relative";var m=e>0?i.months[e-1].top+i.months[e-1].height:0;n.top=m,n.left=0}this.cssOnly?g.className=this.p("_month"):g.className=this.p("month"),g.style.cursor="default",g.style.MozUserSelect="none",g.style.KhtmlUserSelect="none",g.style.WebkitUserSelect="none",g.month=n,this.root.appendChild(g);var y=this.titleHeight+this.dayHeaderHeight,b=document.createElement("div");b.style.position="absolute",b.style.left="0px",b.style.top="0px",b.style.width=o.cellWidth()+"px",b.style.height=this.titleHeight+"px",b.style.lineHeight=this.titleHeight+"px",b.setAttribute("unselectable","on"),this.cssOnly?b.className=this.p("_titleleft"):b.className=this.p("titleleft"),t.left&&(b.style.cursor="pointer",b.innerHTML="<",b.onclick=this.cf),g.appendChild(b),this.tl=b;var w=document.createElement("div");w.style.position="absolute",w.style.left=o.cellWidth()+"px",w.style.top="0px",w.style.width=5*o.cellWidth()+this._e()+"px",w.style.height=this.titleHeight+"px",w.style.lineHeight=this.titleHeight+"px",w.setAttribute("unselectable","on"),this.cssOnly?w.className=this.p("_title"):w.className=this.p("title"),w.innerHTML=o.locale().monthNames[a.getMonth()]+" "+a.getYear(),g.appendChild(w),this.ti=w;var D=document.createElement("div");D.style.position="absolute",D.style.left=6*o.cellWidth()+this._e()+"px",D.style.top="0px",D.style.width=o.cellWidth()+"px",D.style.height=this.titleHeight+"px",D.style.lineHeight=this.titleHeight+"px",D.setAttribute("unselectable","on"),this.cssOnly?D.className=this.p("_titleright"):D.className=this.p("titleright"),t.right&&(D.style.cursor="pointer",D.innerHTML=">",D.onclick=this.df),g.appendChild(D),this.tr=D;var k=this._e();if(this.showWeekNumbers)for(var x=0;x"+P+"",g.appendChild(S),n.weeks.push(S)}for(var A=0;A<7;A++){n.cells[A]=[];var S=document.createElement("div");S.style.position="absolute",S.style.left=A*o.cellWidth()+k+"px",S.style.top=this.titleHeight+"px",S.style.width=o.cellWidth()+"px",S.style.height=this.dayHeaderHeight+"px",S.style.lineHeight=this.dayHeaderHeight+"px",S.setAttribute("unselectable","on"),this.cssOnly?S.className=this.p("_dayheader"):S.className=this.p("dayheader"),S.innerHTML=""+this.ef(A)+"",g.appendChild(S),n.days.push(S);for(var x=0;x=a.addMonths(1);if("month"===this.hf())T=T&&M;else if("day"===this.hf())T=T&&(M||r&&E||s&&H);else if("week"===this.hf()){var _=C.firstDayOfMonth()===a;T=T&&(_||r&&E||s&&H)}var R=document.createElement("div");n.cells[A][x]=R;var B=i.if(A,x),N=B.x,U=B.y;R.day=C,R.x=A,R.y=x,R.left=N,R.top=U,R.isCurrentMonth=M,R.isNextMonth=H,R.isPrevMonth=E,R.showBefore=r,R.showAfter=s,this.cssOnly?R.className=this.p(M?"_day":"_dayother"):R.className=this.p(M?"day":"dayother"),i.af(R,"cell"),C.getTime()===f.getTime()&&M&&this.af(R,"today"),0!==C.dayOfWeek()&&6!==C.dayOfWeek()||this.af(R,"weekend"),R.style.position="absolute",R.style.left=N+"px",R.style.top=U+"px",R.style.width=o.cellWidth()+"px",R.style.height=this.cellHeight+"px",R.style.lineHeight=this.cellHeight+"px";var z=document.createElement("div");z.style.position="absolute",this.cssOnly?z.className=C.getTime()===f.getTime()&&M?this.p("_todaybox"):this.p("_daybox"):z.className=C.getTime()===f.getTime()&&M?this.p("todaybox"):this.p("daybox"),i.af(z,"cell_box"),z.style.left="0px",z.style.top="0px",z.style.right="0px",z.style.bottom="0px",R.appendChild(z);var O=null;if(this.cells&&this.cells[C.toStringSortable()]&&(O=this.cells[C.toStringSortable()]),"function"==typeof i.onBeforeCellRender){var L={};L.cell=O||{},L.cell.day=C,L.cell.isCurrentMonth=M,L.cell.isToday=C.getTime()===f.getTime()&&M,L.cell.isWeekend=0===C.dayOfWeek()||6===C.dayOfWeek(),O?(L.cell.html=O.html||C.getDay(),L.cell.cssClass=O.css):(L.cell.html=C.getDay(),L.cell.cssClass=null),i.onBeforeCellRender(L),O=L.cell}if(O&&DayPilot.Util.addClass(R,O.cssClass||O.css),M||r&&E||s&&H){var F=document.createElement("div");F.innerHTML=C.getDay(),F.style.position="absolute",F.style.left="0px",F.style.top="0px",F.style.right="0px",F.style.bottom="0px",i.af(F,"cell_text"),R.style.cursor="pointer",R.isClickable=!0,O&&O.html&&(F.innerHTML=O.html),R.appendChild(F)}R.setAttribute("unselectable","on"),R.onclick=this.jf,g.appendChild(R),T&&(i.kf(g,A,x),this.selected.push(R))}}var I=document.createElement("div");I.style.position="absolute",I.style.left="0px",I.style.top=y-2+"px",I.style.width=7*o.cellWidth()+this._e()+"px",I.style.height="1px",I.style.fontSize="1px",I.style.lineHeight="1px",this.cssOnly?I.className=this.p("_line"):I.className=this.p("line"),g.appendChild(I),this.months.push(n)},this.if=function(e,t){var i=this.titleHeight+this.dayHeaderHeight,n=this._e();return{"x":e*o.cellWidth()+n,"y":t*this.cellHeight+i}},this.kf=function(e,t,n){var a=e.month.cells[t][n];i.af(a,"select")},this.lf=function(e,t,n){var a=e.month.cells[t][n];i.bf(a,"select")},this._e=function(){return this.showWeekNumbers?o.cellWidth():0},this.mf=function(){if(this.items)for(var e=0;e=this.qf())&&(s=this.selectionStart.firstDayOfMonth()),s.toStringSortable()!==this.startDate.toStringSortable()&&(r=!0),this.startDate=s}this.of(),this.qe(),this.$e(),this.rf(),this.mf(),this.nf(),!n||a.equals(this.selectionStart)&&o.equals(this.selectionEnd)||this.$a(),r&&this.sf()},this.update=function(){i.cssOnly||(i.cssOnly=!0,DayPilot.Util.log("DayPilot: cssOnly = false mode is not supported since DayPilot Pro 8.0.")),this.qe(),this.$e(),this.of(),this.rf(),this.aa(),this.mf(),this.nf(),this.visible?this.show():this.hide()},this.F=function(e,t,i){var n={};n.action=e,n.parameters=i,n.data=t,n.header=this.E();var a="JSON"+DayPilot.JSON.stringify(n);this.backendUrl?DayPilot.request(this.backendUrl,this.H,a,this.I):WebForm_DoCallback(this.uniqueID,a,this.J,null,this.callbackError,!0)},this.I=function(e){if("function"==typeof i.onAjaxError){var t={};t.request=e,i.onAjaxError(t)}else"function"==typeof i.ajaxError&&i.ajaxError(e)},this.H=function(e){i.J(e.responseText)},this.D=function(e,t,n){var a={};a.action=e,a.parameters=n,a.data=t,a.header=this.E();var o="JSON"+DayPilot.JSON.stringify(a);__doPostBack(i.uniqueID,o)},this.E=function(){var e={};return e.v=this.v,e.startDate=this.startDate,e.selectionStart=this.selectionStart,e.showMonths=this.showMonths,e},this.tf=function(e,t){"refresh"===e&&this.sf()},this.ef=function(e){var t=e+o.weekStarts();return t>6&&(t-=7),o.locale().dayNamesShort[t]},this.gf=function(e){return null!==this.selectionStart&&null!==this.selectionEnd&&(this.selectionStart.getTime()<=e.getTime()&&e.getTime()<=this.selectionEnd.getTime())},this.uf=function(e){for(var t=0;ta&&(n.end=t)}n.end&&(n.clear(),n.draw())}},this.yf={};var n=this.yf;n.start=null,n.drawCell=function(e){var t=i.months[e.month],a=i.if(e.x,e.y),o=t.top+a.y,r=t.left+a.x,s=document.createElement("div");s.style.position="absolute",s.style.left=r+"px",s.style.top=o+"px",s.style.height=i.cellHeight+"px",s.style.width=i.cellWidth+"px",s.style.backgroundColor="#ccc",s.style.opacity=.5,s.style.cursor="default",i.nav.preselection.appendChild(s),n.cells.push(s)},n.clear=function(){if(n.cells){for(var e=0;e0){o.month-=1;var r=i.months[o.month];o.x=6,o.y=r.rowCount-1}for(n.cells=[];!t.is(o);){n.drawCell(t);var s=new a(t).next();if(!s)return;t.month=s.month,t.x=s.x,t.y=s.y}n.drawCell(t)}},n.ordered=function(){var e=n.start,t=n.end,i={};return!t||new a(e).before(t)?(i.start=e,i.end=t):(i.start=t,i.end=e),i};var a=function(e,t,n){if(e instanceof a)return e;if("object"==typeof e){var o=e;this.month=o.month,this.x=o.x,this.y=o.y}else this.month=e,this.x=t,this.y=n;this.is=function(e){return this.month===e.month&&this.x===e.x&&this.y===e.y},this.next=function(){var e=this;if(e.x<6)return{"month":e.month,"x":e.x+1,"y":e.y};var t=i.months[e.month];return e.y0)return{"month":e.month,"x":e.x-1,"y":e.y};i.months[e.month];if(e.y>0)return{"month":e.month,"x":6,"y":e.y-1};if(e.month>0){var t=i.months[e.month-1];return{"month":e.month-1,"x":6,"y":t.rowCount-1}}return null},this.previousVisible=function(){for(var e=this;!e.visible();){var t=e.previous();if(!t)return null;e=new a(t)}return e},this.cell=function(){return i.months[this.month].cells[this.x][this.y]},this.date=function(){return this.cell().day},this.before=function(e){return this.date()=i.qf())return void i.select(r)}var l=n.cells[a][o];i.kf(t,a,o),i.selected.push(l),i.selectionStart=l.day,i.selectionEnd=l.day;break;case"week":if(i.autoFocusOnClick){var s=n.cells[0][o].day,d=n.cells[6][o].day;if(s.firstDayOfMonth()===d.firstDayOfMonth()&&(s=i.qf()))return void i.select(r)}for(var c=0;c<7;c++)i.kf(t,c,o),i.selected.push(n.cells[c][o]);i.selectionStart=n.cells[0][o].day,i.selectionEnd=n.cells[6][o].day;break;case"month":if(i.autoFocusOnClick){var s=r;if(r=i.qf())return void i.select(r)}for(var s=null,d=null,o=0;o<6;o++)for(var a=0;a<7;a++){var l=n.cells[a][o];l&&l.day.getYear()===r.getYear()&&l.day.getMonth()===r.getMonth()&&(i.kf(t,a,o),i.selected.push(l),null===s&&(s=l.day),d=l.day)}i.selectionStart=s,i.selectionEnd=d;break;default:throw"unknown selectMode"}i.nf(),i.$a()}},this.$a=function(e){var t=i.selectionStart,n=i.selectionEnd.addDays(1),a=DayPilot.DateUtil.daysDiff(t,n),o=i.selectionDay;if(e=e||{},i.ra()){var r={};if(r.start=t,r.end=n,r.day=o,r.days=a,r.mode=e.mode||i.selectMode,r.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof i.onTimeRangeSelect&&(i.onTimeRangeSelect(r),r.preventDefault.value))return;switch(i.timeRangeSelectedHandling){case"Bind":var s=DayPilot.Util.evalVariable(i.bound);if(s){var l={};l.start=t,l.end=n,l.days=a,l.day=o,s.commandCallBack(i.command,l)}break;case"None":break;case"PostBack":i.timeRangeSelectedPostBack(t,n,o)}"function"==typeof i.onTimeRangeSelected&&i.onTimeRangeSelected(r)}else switch(i.timeRangeSelectedHandling){case"Bind":var s=DayPilot.Util.evalVariable(i.bound);if(s){var l={};l.start=t,l.end=n,l.days=a,l.day=o,s.commandCallBack(i.command,l)}break;case"JavaScript":i.onTimeRangeSelected(t,n,o);break;case"None":break;case"PostBack":i.timeRangeSelectedPostBack(t,n,o)}},this.timeRangeSelectedPostBack=function(e,t,i,n){var a={};a.start=e,a.end=t,a.day=n,this.D("TimeRangeSelected",i,a)},this.df=function(e){i.zf(i.skipMonths)},this.cf=function(e){i.zf(-i.skipMonths)},this.zf=function(e){this.startDate=this.startDate.addMonths(e),this.qe(),this.$e(),this.rf(),this.nf(),this.sf(),this.mf()},this.pf=function(){return i.startDate.firstDayOfMonth()},this.qf=function(){return i.startDate.firstDayOfMonth().addMonths(this.showMonths)},this.visibleStart=function(){return i.startDate.firstDayOfMonth().firstDayOfWeek(o.weekStarts())},this.visibleEnd=function(){return i.startDate.firstDayOfMonth().addMonths(this.showMonths-1).firstDayOfWeek(o.weekStarts()).addDays(42)},this.sf=function(){var e=this.visibleStart(),t=this.visibleEnd();if(i.ra()){var n={};if(n.start=e,n.end=t,n.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof i.onVisibleRangeChange&&(i.onVisibleRangeChange(n),n.preventDefault.value))return;switch(this.visibleRangeChangedHandling){case"CallBack":this.visibleRangeChangedCallBack(null);break;case"PostBack":this.visibleRangeChangedPostBack(null);break;case"Disabled":}"function"==typeof i.onVisibleRangeChanged&&i.onVisibleRangeChanged(n)}else switch(this.visibleRangeChangedHandling){case"CallBack":this.visibleRangeChangedCallBack(null);break;case"PostBack":this.visibleRangeChangedPostBack(null);break;case"JavaScript":this.onVisibleRangeChanged(e,t);break;case"Disabled":}},this.visibleRangeChangedCallBack=function(e){var t={};this.F("Visible",e,t)},this.visibleRangeChangedPostBack=function(e){var t={};this.D("Visible",e,t)},this.J=function(e,t){var e=DayPilot.Util.parseJSON(e);i.items=e.Items,i.cells=e.Cells,i.cells?i.update():i.mf()},this.rf=function(){for(var e=0;ee&&(e=i.height)}return e}for(var n=0,t=0;t","compile":function(t,i){return t.replaceWith(this["template"].replace("{{id}}",i["id"])),function(t,i,n){var a=new DayPilot.Navigator(i[0]);a.Gc.scope=t,a.init();var o=n["id"];o&&(t[o]=a);var r=n["publishAs"];if(r){(0,e(r).assign)(t,a)}for(var s in n)if(0===s.indexOf("on")){var l=DayPilot.Util.shouldApply(s);l?!function(i){a[i]=function(a){var o=e(n[i]);t["$apply"](function(){o(t,{"args":a})})}}(s):!function(i){a[i]=function(a){e(n[i])(t,{"args":a})}}(s)}var d=t["$watch"],c=n["config"]||n["daypilotConfig"],h=n["events"]||n["daypilotEvents"];d.call(t,c,function(e,t){for(var i in e)a[i]=e[i];a.update()},!0),d.call(t,h,function(e){a.events.list=e,a.aa(),a.mf()},!0)}}}}])}(),"undefined"!=typeof Sys&&Sys.Application&&Sys.Application.notifyScriptLoaded&&Sys.Application.notifyScriptLoaded()}}(),"undefined"==typeof DayPilot)var DayPilot={};if("undefined"==typeof DayPilot.Global&&(DayPilot.Global={}),function(){function e(e){for(var t=e.touches[0].clientX,i=e.touches[0].clientY,n=document.elementFromPoint(t,i);n&&n.parentNode;)if(n=n.parentNode,n.daypilotMainD)return n.calendar;return!1}function t(e){var t=e.touches[0].pageX,i=e.touches[0].pageY,n={};return n.x=t,n.y=i,n}if("undefined"==typeof DayPilot.Scheduler){var i=function(){var e=navigator.userAgent;return e.indexOf("Mozilla/5.0")>-1&&e.indexOf("Android ")>-1&&e.indexOf("AppleWebKit")>-1&&!(e.indexOf("Chrome")>-1)}(),n={},a=function(){},o=!1;DayPilot.Scheduler=function(e,o){function d(e,t){return 1-e/t}this.v="2709";var c=this;this.id=e,this.isScheduler=!0,this.hideUntilInit=!0,this.api=2,this.allowDefaultContextMenu=!1,this.allowEventOverlap=!0,this.allowMultiMove=!1,this.allowMultiRange=!1,this.allowMultiResize=!1,this.allowMultiSelect=!0,this.multiSelectRectangle="Disabled",this.autoRefreshCommand="refresh",this.autoRefreshEnabled=!1,this.autoRefreshInterval=60,this.autoRefreshMaxCount=20,this.autoScroll="Drag",this.blockOnCallBack=!1,this.navigatorBackSync=null,this.beforeCellRenderCaching=!0,this.businessBeginsHour=9,this.businessEndsHour=18,this.businessWeekends=!1,this.cellDuration=60,this.cellGroupBy="Day",this.cellStacking=!1,this.cellStackingAutoHeight=!1,this.cellWidth=40,this.cellWidthMin=1,this.cellWidthSpec="Fixed",this.cellsMarkBusiness=!0,this.eventMarginLeft=0,this.eventMarginRight=0,this.eventMarginBottom=0,this.groupConcurrentEvents=!1,this.groupConcurrentEventsLimit=1,this.Df=!0,this.Ef=!1,this.cellSweeping=!0,this.cellSweepingCacheSize=1e3,this.crosshairColor="Gray",this.crosshairOpacity=20,this.crosshairType="Header",this.Ff=!1,this.doubleClickTimeout=300,this.dragOutAllowed=!1,this.durationBarHeight=3,this.durationBarVisible=!0,this.durationBarMode="Duration",this.durationBarDetached=!1,this.days=1,this.drawBlankCells=!0,this.dynamicEventRendering="Progressive",this.dynamicEventRenderingMargin=50,this.dynamicEventRenderingMarginX=null,this.dynamicEventRenderingMarginY=null,this.dynamicEventRenderingCacheSweeping=!1,this.dynamicEventRenderingCacheSize=200,this.dynamicLoading=!1,this.eventBorderColor="#000000",this.eventBackColor="#FFFFFF",this.eventEditMinWidth=100,this.eventEndSpec="DateTime",this.eventFontFamily="Tahoma, Arial",this.eventFontSize="8pt",this.eventFontColor="#000000",this.eventHeight=25,this.eventMoveMargin=5,this.eventMoveToPosition=!1,this.eventMoveSkipNonBusiness=!1,this.eventResizeMargin=5,this.eventStackingLineHeight=100,this.eventTapAndHoldHandling="Move",this.eventTextWrappingEnabled=!1,this.eventUpdateInplaceOptimization=!1,this.Gf=!1,this.headerFontColor="#000000",this.headerFontFamily="Tahoma, Arial",this.headerFontSize="8pt",this.headerHeight=20,this.heightSpec="Auto",this.height=300,this.hideBorderFor100PctHeight=!1,this.hourFontFamily="Tahoma, Arial",this.hourFontSize="10pt",this.hourNameBackColor="#ECE9D8",this.hourNameBorderColor="#ACA899",this.Hf=10,this.If=30,this.initEventEnabled=!0,this.jointEventsResize=!0,this.jointEventsMove=!0,this.layout="Auto",this.linkCreateHandling="Disabled",this.linkBottomMargin=10,this.linkPointSize=10,this.locale="en-us",this.loadingLabelText="Loading...",this.loadingLabelVisible=!0,this.overrideWheelScrolling=!1,this.messageBarPosition="Top",this.messageHideAfter=5e3,this.messageHideOnMouseOut=!0,this.multiMoveVerticalMode="Disabled",this.moveBy="Full",this.notifyCommit="Immediate",this.progressiveRowRendering=!0,this.progressiveRowRenderingPreload=25,this.tapAndHoldTimeout=300,this.timeHeaders=[{"groupBy":"Default"},{"groupBy":"Cell"}],this.treePreventParentUsage=!1,this.treeAutoExpand=!0,this.rowCreateHeight=null,this.rowCreateHtml="New row...",this.rowHeaderColumnDefaultWidth=80,this.rowHeaderHideIconEnabled=!1,this.rowHeaderWidth=80,this.rowHeaderScrolling=!1,this.rowHeaderSplitterWidth=3,this.rowHeaderWidthAutoFit=!0,this.rowHeaderWidthMarginRight=0,this.rowHeaderCols=null,this.rowMarginBottom=0,this.rowMarginTop=0,this.rowMinHeight=0,this.scale="CellDuration",this.scrollDelayDynamic=500,this.scrollDelayEvents=200,this.scrollDelayCells=0,this.scrollDelayFloats=0,this.scrollStep=null,this.scrollX=0,this.scrollY=0,this.selectedRows=[],this.showBaseTimeHeader=!0,this.showNonBusiness=!0,this.showToolTip=!0,this.snapToGrid=!0,this.startDate=(new DayPilot.Date).getDatePart(),this.syncResourceTree=!1,this.timeHeaderTextWrappingEnabled=!1,this.treeEnabled=!1,this.treeIndent=20,this.treeImageMarginLeft=5,this.treeImageMarginTop=5,this.timeFormat="Auto",this.useEventBoxes="Always",this.viewType="Resources",this.visible=!0,this.watchWidthChanges=!0,this.weekStarts="Auto",this.width=null,this.floatingEvents=!0,this.floatingTimeHeaders=!0,this.eventCorners="Regular",this.separators=[],this.cornerHtml="",this.Jf=-1,this.Kf=-1,this.eventClickHandling="Enabled",this.eventDeleteHandling="Disabled",this.eventHoverHandling="Bubble",this.eventDoubleClickHandling="Disabled",this.eventEditHandling="Update",this.eventMoveHandling="Update",this.eventResizeHandling="Update",this.eventRightClickHandling="ContextMenu",this.eventSelectHandling="Update",this.resourceCollapseHandling="Enabled",this.resourceExpandHandling="Enabled",this.rowClickHandling="Enabled",this.rowDoubleClickHandling="Disabled",this.rowCreateHandling="Disabled",this.rowEditHandling="Update",this.rowHeaderColumnResizedHandling="Update",this.rowSelectHandling="Update",this.rowMoveHandling="Disabled",this.timeRangeClickHandling="Enabled",this.timeRangeDoubleClickHandling="Disabled",this.timeRangeSelectedHandling="Enabled",this.timeRangeRightClickHandling="ContextMenu",this.eventMovingStartEndEnabled=!1,this.eventMovingStartEndFormat="MMMM d, yyyy",this.timeRangeSelectingStartEndEnabled=!1,this.timeRangeSelectingStartEndFormat="MMMM d, yyyy",this.eventResizingStartEndEnabled=!1,this.eventResizingStartEndFormat="MMMM d, yyyy",this.cssOnly=!0, this.cssClassPrefix="scheduler_default",this.eventVersionsEnabled=!1,this.eventVersionHeight=25,this.eventVersionMargin=2,this.backendUrl=null,1===c.api&&(this.onEventMove=function(){},this.onEventResize=function(){},this.onResourceExpand=function(){},this.onResourceCollapse=function(){}),this.onEventClick=null,this.onEventClicked=null,this.onEventMove=null,this.onEventMoved=null,this.onEventMoving=null,this.onEventResize=null,this.onEventResized=null;this.onEventResizing=null;this.onEventRightClick=null,this.onEventRightClicked=null,this.onEventMouseOver=null,this.onEventMouseOut=null,this.onRowClick=null,this.onRowClicked=null,this.onTimeRangeClick=null,this.onTimeRangeClicked=null,this.onTimeRangeDoubleClick=null,this.onTimeRangeDoubleClicked=null,this.onTimeRangeSelect=null,this.onTimeRangeSelected=null,this.onTimeRangeSelecting=null,this.onTimeRangeRightClick=null,this.onTimeRangeRightClicked=null,this.onRowHeaderResized=null,this.onCellMouseOver=null,this.onCellMouseOut=null,this.onGridMouseDown=null,this.onBeforeCellRender=null,this.onBeforeEventRender=null,this.onBeforeTimeHeaderRender=null,this.onBeforeResHeaderRender=null,this.onBeforeRowHeaderRender=null,this.onBeforeCellExport=null,this.onBeforeEventExport=null,this.onBeforeTimeHeaderExport=null,this.onBeforeRowHeaderExport=null,this.onEventFilter=null,this.onRowFilter=null,this.onRectangleEventSelecting=null,this.onRectangleEventSelect=null,this.onRectangleEventSelected=null,this.onDimensionsChanged=null,this.onAfterUpdate=null,this.A=0,this.Lf=-1,this.rowlist=DayPilot.list(),this.itline=DayPilot.list(),this.timeline=null,this.events={},this.cells={},this.elements={},this.elements.events=[],this.elements.bars=[],this.elements.text=[],this.elements.cells=[],this.elements.linesVertical=[],this.elements.separators=[],this.elements.range=[],this.elements.breaks=[],this.elements.links=[],this.elements.linkpoints=[],this.elements.rectangle=[],this.elements.hover=[],this.s={},this.s.cells=[],this.s.linesVertical={},this.s.linesHorizontal={},this.s.timeHeaderGroups=[],this.s.timeHeader={},this.s.pixels=[],this.s.breaks=[],this.s.events=[],this.clientState={},this.members={},this.members.obsolete=["Init","cleanSelection","cssClassPrefix","getHScrollPosition","setHScrollPosition","getVScrollPosition","setVScrollPosition","showBaseTimeHeader"],this.members.ignoreFilter=function(e){return 0===e.indexOf("div")},this.members.ignore=["internal","nav","debug","temp","elements","members","cellProperties","itline","rowlist","timeHeader","timeouts"],this.members.noCssOnly=["eventCorners","eventFontColor","eventFontFamily","eventFontSize","headerFontColor","headerFontFamily","headerFontSize","hourFontFamily","hourFontSize","hourNameBackColor","hourNameBorderColor","loadingLabelBackColor","loadingLabelFontColor","loadingLabelFontFamily","loadingLabelFontSize","shadow","timeBreakColor"],this.nav={},this.J=function(e,t){var e=DayPilot.Util.parseJSON(e);if(c.onScrollCalled=!1,e.CallBackRedirect)return void(document.location.href=e.CallBackRedirect);if("function"==typeof c.onCallBackResult){var i={};if(i.result=e,i.preventDefault=function(){i.preventDefault.value=!0},c.onCallBackResult(i),i.preventDefault.value)return c.Ua(),c.W(),c.qa(),e.Message&&c.message&&c.message(e.Message),c.X(e.CallBackData,!0),c.Mf(),void c.Nf()}if(e.BubbleGuid){var n=e.BubbleGuid,a=this.bubbles[n];return delete this.bubbles[n],c.W(),"undefined"!=typeof e.Result.BubbleHTML&&a&&a.updateView(e.Result.BubbleHTML,a),void c.Mf()}if("undefined"!=typeof DayPilot.Bubble&&DayPilot.Bubble.hideActive(),"undefined"!=typeof e.ClientState&&(null===e.ClientState?c.clientState={}:c.clientState=e.ClientState),"None"===e.UpdateType)return c.W(),c.Mf(),e.Message&&c.message(e.Message),void c.X(e.CallBackData,!0);if(e.VsUpdate){var o=document.createElement("input");o.type="hidden",o.name=c.id+"_vsupdate",o.id=o.name,o.value=e.VsUpdate,c.oe.innerHTML="",c.oe.appendChild(o)}"undefined"!=typeof e.TagFields&&(c.tagFields=e.TagFields),"undefined"!=typeof e.SortDirections&&(c.sortDirections=e.SortDirections),c.s.drawArea=null,"Full"===e.UpdateType&&(c.resources=e.Resources,c.colors=e.Colors,c.palette=e.Palette,c.dirtyColors=e.DirtyColors,c.cellProperties=e.CellProperties,c.cellConfig=e.CellConfig,c.separators=e.Separators,c.timeline=e.Timeline,c.timeHeader=e.TimeHeader,c.timeHeaders=e.TimeHeaders,"undefined"!=typeof e.Links&&(c.links.list=e.Links),"undefined"!=typeof e.RowHeaderColumns&&(c.rowHeaderColumns=e.RowHeaderColumns),c.startDate=e.StartDate?new DayPilot.Date(e.StartDate):c.startDate,c.days=e.Days?e.Days:c.days,c.cellDuration=e.CellDuration?e.CellDuration:c.cellDuration,c.cellGroupBy=e.CellGroupBy?e.CellGroupBy:c.cellGroupBy,c.cellWidth=e.CellWidth?e.CellWidth:c.cellWidth,"undefined"!=typeof e.Scale&&(c.scale=e.Scale),c.viewType=e.ViewType?e.ViewType:c.viewType,c.hourNameBackColor=e.HourNameBackColor?e.HourNameBackColor:c.hourNameBackColor,"undefined"!=typeof e.ShowNonBusiness&&(c.showNonBusiness=e.ShowNonBusiness),c.businessBeginsHour=e.BusinessBeginsHour?e.BusinessBeginsHour:c.businessBeginsHour,c.businessEndsHour=e.BusinessEndsHour?e.BusinessEndsHour:c.businessEndsHour,"undefined"!=typeof e.DynamicLoading&&(c.dynamicLoading=e.DynamicLoading),"undefined"!=typeof e.TreeEnabled&&(c.treeEnabled=e.TreeEnabled),c.backColor=e.BackColor?e.BackColor:c.backColor,c.nonBusinessBackColor=e.NonBusinessBackColor?e.NonBusinessBackColor:c.nonBusinessBackColor,c.locale=e.Locale?e.Locale:c.locale,"undefined"!=typeof e.TimeZone&&(c.timeZone=e.TimeZone),c.timeFormat=e.TimeFormat?e.TimeFormat:c.timeFormat,c.rowHeaderCols=e.RowHeaderCols?e.RowHeaderCols:c.rowHeaderCols,"undefined"!=typeof e.DurationBarMode&&(c.durationBarMode=e.DurationBarMode),c.cornerBackColor=e.CornerBackColor?e.CornerBackColor:c.cornerBackColor,"undefined"!=typeof e.CornerHTML&&(c.cornerHtml=e.CornerHTML),c.hashes=e.Hashes,c.Of(),c.Pf(),c.Qf(),c._()),"Scroll"!==e.Action&&c.aa(e.Events),"Full"===e.UpdateType&&(c.Rf(),c.Sf()),c.Tf(),c.ma(),c.Uf(),c.s.drawArea=null,"Scroll"!==e.Action?(c.Vf(),c.ba(),"Auto"!==c.heightSpec&&"Max"!==c.heightSpec||c.ia(),c.Wf(),c.L(),c.Xf(),c.multiselect.clear(!0),c.multiselect.Yf(e.SelectedEvents),c.Zf(),c.$f(),c.na()):(c.multiselect.clear(!0),c.multiselect.Yf(e.SelectedEvents),c._f(e.Events)),"HoldForever"!==c.timeRangeSelectedHandling&&c.ag(),"Full"===e.UpdateType&&(c.setScroll(e.ScrollX,e.ScrollY),c.nf()),c.bg(),c.Ua(),e.SelectedRows&&c.cg(e.SelectedRows),c.W(),"Full"===e.UpdateType&&navigator.appVersion.indexOf("MSIE 7.")!==-1&&window.setTimeout(function(){c.Rf(),c.ia()},0),c.qa(),e.Message&&c.message&&c.message(e.Message),c.X(e.CallBackData,!0),c.Mf(),c.Nf(),"Full"!==e.UpdateType||"Scroll"===e.Action||c.onScrollCalled||setTimeout(function(){c.dg()},0)},this.Ua=function(){if(c.todo&&c.todo.del){var e=c.todo.del;e.parentNode.removeChild(e),c.todo.del=null}},this.X=function(e,t){var i=function(e,t){return function(){if(c.ra()){if("function"==typeof c.onAfterRender){var i={};i.isCallBack=t,i.isScroll=!1,i.data=e,c.onAfterRender(i)}}else c.afterRender&&c.afterRender(e,t)}};window.setTimeout(i(e,t),0)},this.scrollTo=function(e,t,i){c.eg.enabled?(c.eg.scrollToRequested=e,setTimeout(function(){var e=c.eg.scrollToRequested;e&&c.fg(e,t,i)},0)):c.fg(e,t,i)},this.fg=function(e,t,i){if(e){if("Days"===c.viewType){var n=c.gg(new DayPilot.Date(e));if(!n)return;return void setTimeout(function(){var e=n.top;c.nav.scroll.scrollTop=e},100)}var a;if(e instanceof DayPilot.Date)a=this.getPixels(e).left;else if("string"==typeof e)a=this.getPixels(new DayPilot.Date(e)).left;else{if("number"!=typeof e)throw"Invalid scrollTo() parameter. Accepted parameters: string (ISO date), number (pixels), DayPilot.Date object";a=e}var o=this.hg.clientWidth,r=this.nav.scroll.clientWidth;switch(i=i||"left",i.toLowerCase()){case"left":break;case"middle":a-=r/2;break;case"right":a-=r}if(a<0&&(a=0),a>o-r&&(a=o-r),!t)return void c.ig(a);var s=Math.abs(c.nav.scroll.scrollLeft-a),l=s/o,d=50;if("number"==typeof t)d=t;else if("string"==typeof t)switch(t){case"fast":d=30;break;case"normal":d=50;break;case"slow":d=100;break;case"linear":d=Math.floor(100*l)}l>.6&&(d=Math.min(d,80)),this.jg(a,d)}},this.jg=function(e,t){function i(e){var t=e.next();return"undefined"==typeof t?void(e.finished&&e.finished()):(c.setScrollX(t),window.clearTimeout(c.refreshTimeout),void setTimeout(function(){i(e)},e.delay))}var n={};n.steps=[],n.index=0,n.delay=10,n.next=function(){var e=n.steps[n.index];return n.index+=1,e},n.finished=function(){c.dg()};for(var a=c.getScrollX(),t=t||100,o=e-a,r=0;ri&&(e=i-t.clientWidth),c.divTimeScroll.scrollLeft=e,t.scrollLeft=e},this.setScrollY=function(e){c.eg.enabled?(c.eg.scrollYRequested=e,setTimeout(function(){var e=c.eg.scrollYRequested;"number"==typeof e&&c.ug(e)},0)):c.ug(e)},this.ug=function(e){var t=c.nav.scroll,i=c.Lf;t.clientHeight+e>i&&(e=i-t.clientHeight),c.divResScroll.scrollTop=e,t.scrollTop=e},this.setScroll=function(e,t){c.setScrollX(e),c.setScrollY(t)},this.message=function(e,t){if(null!==e){var i={};"object"==typeof arguments[1]&&(i=arguments[1],t=i.delay);var n,t=t||this.messageHideAfter||2e3,a=this.ed()+1,o=this.vg()+_.splitterWidth(),r=DayPilot.sw(c.nav.scroll)+1,s=DayPilot.sh(c.nav.scroll)+1;if(this.nav.message)n=c.nav.message;else{n=document.createElement("div"),n.style.position="absolute",n.style.left=o+"px",n.style.right=r+"px",n.style.display="none",DayPilot.re(n,DayPilot.touch.start,function(e){c.nav.message.style.display="none",e.preventDefault(),e.stopPropagation()}),n.onmousemove=function(){c.messageHideOnMouseOut&&n.messageTimeout&&!n.status&&clearTimeout(n.messageTimeout)},n.onmouseout=function(){c.messageHideOnMouseOut&&"none"!==c.nav.message.style.display&&(n.messageTimeout=setTimeout(c.Da,500))};var l=document.createElement("div");l.onclick=function(){c.nav.message.style.display="none"},l.className=this.p("_message"),n.appendChild(l);var d=document.createElement("div");d.style.position="absolute",d.className=this.p("_message_close"),d.onclick=function(){c.nav.message.style.display="none"},n.appendChild(d),this.nav.top.appendChild(n),this.nav.message=n}var h=function(){var n=c.nav.message;n.firstChild.className=c.p("_message"),i.cssClass&&DayPilot.Util.addClass(n.firstChild,i.cssClass),c.nav.message.firstChild.innerHTML=e;var o=DayPilot.sw(c.nav.scroll)+1;c.nav.message.style.right=o+"px";var r=c.messageBarPosition||"Top";"Bottom"===r?(c.nav.message.style.bottom=s+"px",c.nav.message.style.top=""):"Top"===r&&(c.nav.message.style.bottom="",c.nav.message.style.top=a+"px");var l=function(){n.messageTimeout=setTimeout(c.Da,t)};DayPilot.fade(c.nav.message,.2,l)};clearTimeout(n.messageTimeout),"none"!==this.nav.message.style.display?DayPilot.fade(c.nav.message,-.2,h):h()}},this.Da=function(){if(c.nav.message){var e=function(){c.nav.message.style.display="none"};DayPilot.fade(c.nav.message,-.2,e)}},this.message.show=function(e){c.message(e)},this.message.hide=function(){c.Da()},this.wg=null,this.ia=function(){if(this.nav.scroll){!function(){var e=c.tg();c.hg.style.height=c.Lf+"px",c.hg.style.width=e+"px","Auto"!==c.cellWidthSpec||c.xg?e>c.nav.scroll.clientWidth?c.nav.scroll.style.overflowX="auto":c.nav.scroll.style.overflowX="hidden":(c.nav.scroll.style.overflowX="hidden",c.nav.scroll.scrollLeft=0)}();var e=1;null!==this.wg&&(this.nav.top.style.border=this.wg,this.wg=null),"Parent100Pct"!==this.heightSpec&&"Max100Pct"!==this.heightSpec||(this.nav.top.style.height="100%",this.hideBorderFor100PctHeight&&(this.wg=this.nav.top.style.border,this.nav.top.style.border="0 none"),this.height=parseInt(this.nav.top.clientHeight,10)-this.ed()-e),this.nav.scroll.style.height="30px";var t=this.Wb(),i=t+this.ed()+e;t>=0&&(this.nav.scroll.style.height=t+"px",this.yg.style.height=t+"px"),this.nav.divider&&((!i||isNaN(i)||i<0)&&(i=0),this.nav.divider.style.height=i+"px"),"Parent100Pct"!==this.heightSpec&&(this.nav.top.style.height=i+"px"),c.nav.resScrollSpace&&(c.nav.resScrollSpace.style.height=t+20+"px");for(var n=0;n0&&i>0){var n=i/t;c.cellWidth=Math.max(n,c.cellWidthMin),c.xg=n0&&(i=-c.getPixels(a).left),c.startDate=c.startDate.addDays(e),c.itline=DayPilot.list(),c.s.pixels=[],c.Ag(),u.updateRowStarts(),e<0&&(i=c.getPixels(n).left),c.timeHeader=[],c.Dg(),c.Sf(),c.cellProperties={},c.Wf(),c.Xf(),c.aa(),c.L(),"undefined"!=typeof t?(c.scrollTo(new DayPilot.Date(t)),c.dg()):c.nav.scroll.scrollLeft+=i,c.na(),u.active=!1},this.Ag=function(){for(var e="Days"!==this.viewType?this.startDate.addDays(this.days):this.startDate.addDays(1),t=this.startDate,i=this.Gg(t),n=!1,a=0;i.ticks<=e.ticks&&i.ticks>t.ticks;){if(this.Hg(t,i)){var o=Math.floor(a+this.cellWidth),r=o-Math.floor(a),s={};s.start=t,s.end=i,s.left=Math.floor(a),s.width=r,s.breakBefore=n,this.itline.push(s),a+=this.cellWidth,n=!1}else n=!0;t=i,i=this.Gg(t)}},this.Cg=function(){if(this.timeHeader)for(var e=0;e0){if("function"==typeof this.onBeforeTimeHeaderRender){var h={};h.start=s.start,h.end=s.end,h.text=s.innerHTML,h.html=s.innerHTML,h.toolTip=s.innerHTML,h.backColor=null,h.level=this.timeHeader.length,h.cssClass=null;var u={};u.header=h,this.onBeforeTimeHeaderRender(u),s.text=s.innerHTML,s.innerHTML=h.html,s.backColor=h.backColor,s.toolTip=h.toolTip,s.areas=h.areas,s.cssClass=h.cssClass}o.push(s)}r=s.end}this.timeHeader.push(o)}},this.Hg=function(e,t){if("function"==typeof this.onIncludeTimeCell){var i={};i.start=e,i.end=t,i.visible=!0;var n={};return n.cell=i,this.onIncludeTimeCell(n),i.visible}return!!this.showNonBusiness||this.isBusiness({"start":e,"end":t})},this.getPixels=function(e){var t=e.ticks,i=this.s.pixels[t];if(i)return i;var n=2218768416e5;if(0===this.itline.length||tn){var a={};a.cut=!0,a.left=l.left,a.boxLeft=a.left,a.boxRight=a.left,a.i=s;break}n=c}if(!a){var u=this.itline[this.itline.length-1],a={};a.cut=!0,a.left=u.left+u.width,a.boxLeft=a.left,a.boxRight=a.left,a.i=null}return this.s.pixels[t]=a,a},this.getDate=function(e,t,i){var n=this.Mg(e,i);if(!n)return null;var a=n.x,o=this.itline[a];if(!o)return null;var r=i&&!t?o.end:o.start;return t?r.addTime(this.Ng(n.cell,n.offset)):r},this.Mg=function(e,t){if(0===this.itline.length)return null;for(var i=0,n=0,a=0;a0?this.itline[i-1]:null,a.current=null,a.next=this.itline[i],a}}var a={};return a.past=!0,a.previous=this.itline[this.itline.length-1],a},this.Lg=function(e){var t=new DayPilot.Date(e),i=0,n=this.itline[0];if(t.ticksr.end.ticks){var a={};return a.past=!0,a.previous=this.itline[this.itline.length-1],a.i=this.itline.length,a}for(var s=function(){for(var e,n=c.itline;i<=o;)if(e=Math.floor((i+o)/2),n[e].start.ticks>t.ticks)o=e-1;else{if(!(n[e].end.ticks0?this.itline[l-1]:null,a.current=null,a.next=this.itline[l],a.i=l,a}}var a={};return a.past=!0,a.previous=this.itline[this.itline.length-1],a.i=this.itline.length,a},this.$c=function(e,t){var i=e.width||this.cellWidth,n=e.end.ticks-e.start.ticks;return Math.floor(i*t/n)},this.Ng=function(e,t){var i=e.end.ticks-e.start.ticks,n=e.width||this.cellWidth;return Math.floor(t/n*i)},this.Ge=function(e){T.start||n.preventEventClick||(A={},c.Fa(this,e))},this.eventClickPostBack=function(e,t){this.D("EventClick",e,t)},this.eventClickCallBack=function(e,t){this.F("EventClick",e,t)},this.Fa=function(e,t){var i=e.event,t=t||window.event;if("undefined"!=typeof DayPilot.Bubble&&DayPilot.Bubble.hideActive(),!i.client.doubleClickEnabled())return void c.Ga(e,t);c.timeouts.click||(c.timeouts.click=[]);var n=function(e,t){return function(){c.Ga(e,t)}};c.timeouts.click.push(window.setTimeout(n(e,t),c.doubleClickTimeout))},this.Qg=function(e){return c.itline[e]},this.Ga=function(e,t){if("boolean"==typeof t)throw"Invalid _eventClickSingle parameters";var i=e.event,n=t.ctrlKey,a=t.metaKey;if(i.client.clickEnabled())if(c.ra()){var o={};if(o.e=i,o.div=e,o.originalEvent=t,o.ctrl=n,o.meta=a,o.shift=t.shiftKey,o.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof c.onEventClick&&(c.onEventClick(o),o.preventDefault.value))return;switch(c.eventClickHandling){case"PostBack":c.eventClickPostBack(i);break;case"CallBack":c.eventClickCallBack(i);break;case"Edit":c.Ha(e);break;case"Select":c.Ia(e,i,n,a);break;case"ContextMenu":var r=i.client.contextMenu();r?r.show(i):c.contextMenu&&c.contextMenu.show(i);break;case"Bubble":c.bubble&&c.bubble.showEvent(i);break;case"RectangleSelect":if("Disabled"!==c.multiSelectRectangle)return E.start(),!1}"function"==typeof c.onEventClicked&&c.onEventClicked(o)}else switch(c.eventClickHandling){case"PostBack":c.eventClickPostBack(i);break;case"CallBack":c.eventClickCallBack(i);break;case"JavaScript":c.onEventClick(i);break;case"Edit":c.Ha(e);break;case"Select":c.Ia(e,i,n,a);break;case"ContextMenu":var r=i.client.contextMenu();r?r.show(i):c.contextMenu&&c.contextMenu.show(i);break;case"Bubble":c.bubble&&c.bubble.showEvent(i);break;case"RectangleSelect":if("Disabled"!==c.multiSelectRectangle)return E.start(),!1}},this.Oa=function(e){if(c.ra()){var t={};if(t.e=e,t.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof c.onEventDelete&&(c.onEventDelete(t),t.preventDefault.value))return;switch(c.eventDeleteHandling){case"PostBack":c.eventDeletePostBack(e);break;case"CallBack":c.eventDeleteCallBack(e);break;case"Update":c.events.remove(e)}"function"==typeof c.onEventDeleted&&c.onEventDeleted(t)}else switch(c.eventDeleteHandling){case"PostBack":c.eventDeletePostBack(e);break;case"CallBack":c.eventDeleteCallBack(e);break;case"JavaScript":c.onEventDelete(e)}},this.eventDeletePostBack=function(e,t){this.D("EventDelete",e,t)},this.eventDeleteCallBack=function(e,t){this.F("EventDelete",e,t)},this.setHScrollPosition=function(e){this.nav.scroll.scrollLeft=e},this.getScrollX=function(){return this.nav.scroll.scrollLeft},this.getHScrollPosition=this.getScrollX,this.getScrollY=function(){return this.nav.scroll.scrollTop},this.Ia=function(e,t,i,n){c.bb(e,t,i,n)},this.eventSelectPostBack=function(e,t,i){var n={};n.e=e,n.change=t,this.D("EventSelect",n,i)},this.eventSelectCallBack=function(e,t,i){var n={};n.e=e,n.change=t,this.F("EventSelect",n,i)},this.bb=function(e,t,i,n){var a=c.multiselect,o=a.isSelected(t);if(i||n||!o||1!==a.list.length)if(c.ra()){a.previous=a.events();var r={};if(r.e=t,r.selected=o,r.ctrl=i,r.meta=n,r.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof c.onEventSelect&&(c.onEventSelect(r),r.preventDefault.value))return;switch(c.eventSelectHandling){case"PostBack":c.eventSelectPostBack(t,s);break;case"CallBack":"undefined"!=typeof WebForm_InitCallback&&(window.db="",window.eb=[],WebForm_InitCallback()),c.eventSelectCallBack(t,s);break;case"Update":a.fb(e,i,n)}"function"==typeof c.onEventSelected&&(r.change=a.isSelected(t)?"selected":"deselected",r.selected=a.isSelected(t),c.onEventSelected(r))}else{a.previous=a.events(),a.fb(e,i,n);var s=a.isSelected(t)?"selected":"deselected";switch(c.eventSelectHandling){case"PostBack":c.eventSelectPostBack(t,s);break;case"CallBack":"undefined"!=typeof WebForm_InitCallback&&(window.db="",window.eb=[],WebForm_InitCallback()),c.eventSelectCallBack(t,s);break;case"JavaScript":c.onEventSelect(t,s)}}},this.eventRightClickPostBack=function(e,t){this.D("EventRightClick",e,t)},this.eventRightClickCallBack=function(e,t){this.F("EventRightClick",e,t)},this.Ka=function(e){var t=this.event;if(e=e||window.event,e.cancelBubble=!0,!this.event.client.rightClickEnabled())return!1;if(c.ra()){var i={};if(i.e=t,i.div=this,i.originalEvent=e,i.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof c.onEventRightClick&&(c.onEventRightClick(i),i.preventDefault.value))return!1;switch(c.eventRightClickHandling){case"PostBack":c.eventRightClickPostBack(t);break;case"CallBack":c.eventRightClickCallBack(t);break;case"ContextMenu":var n=t.client.contextMenu();n?n.show(t):c.contextMenu&&c.contextMenu.show(this.event);break;case"Bubble":c.bubble&&c.bubble.showEvent(t)}"function"==typeof c.onEventRightClicked&&c.onEventRightClicked(i)}else switch(c.eventRightClickHandling){case"PostBack":c.eventRightClickPostBack(t);break;case"CallBack":c.eventRightClickCallBack(t);break;case"JavaScript":c.onEventRightClick(t);break;case"ContextMenu":var n=t.client.contextMenu();n?n.show(t):c.contextMenu&&c.contextMenu.show(this.event);break;case"Bubble":c.bubble&&c.bubble.showEvent(t)}return!1},this.eventDoubleClickPostBack=function(e,t){this.D("EventDoubleClick",e,t)},this.eventDoubleClickCallBack=function(e,t){this.F("EventDoubleClick",e,t)},this.Ja=function(e){if("undefined"!=typeof DayPilot.Bubble&&DayPilot.Bubble.hideActive(),c.timeouts.click){for(var t in c.timeouts.click)window.clearTimeout(c.timeouts.click[t]);c.timeouts.click=null}var e=e||window.event,i=this.event;if(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0,c.ra()){var n={};if(n.e=i,n.originalEvent=e,n.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof c.onEventDoubleClick&&(c.onEventDoubleClick(n),n.preventDefault.value))return;switch(c.eventDoubleClickHandling){case"PostBack":c.eventDoubleClickPostBack(i);break;case"CallBack":c.eventDoubleClickCallBack(i);break;case"Edit":c.Ha(this);break;case"Select":c.Ia(div,i,e.ctrlKey,e.metaKey);break;case"Bubble":c.bubble&&c.bubble.showEvent(i);break;case"ContextMenu":var a=i.client.contextMenu();a?a.show(i):c.contextMenu&&c.contextMenu.show(i)}"function"==typeof c.onEventDoubleClicked&&c.onEventDoubleClicked(n)}else switch(c.eventDoubleClickHandling){case"PostBack":c.eventDoubleClickPostBack(i);break;case"CallBack":c.eventDoubleClickCallBack(i);break;case"JavaScript":c.onEventDoubleClick(i);break;case"Edit":c.Ha(this);break;case"Select":c.Ia(div,i,e.ctrlKey,e.metaKey);break;case"Bubble":c.bubble&&c.bubble.showEvent(i);break;case"ContextMenu":var a=i.client.contextMenu();a?a.show(i):c.contextMenu&&c.contextMenu.show(i)}},this.eventResizePostBack=function(e,t,i,n){this.Sa("PostBack",e,t,i,n)},this.eventResizeCallBack=function(e,t,i,n){this.Sa("CallBack",e,t,i,n)},this.Sa=function(e,t,i,n,a){var o={};o.e=t,o.newStart=i,o.newEnd=n,this.Pa(e,"EventResize",o,a)},this.Ra=function(e,t,i){if("Disabled"!==this.eventResizeHandling)if(i=c.Xe(i),c.ra()){var n={},a=function(){if(P.hide(),!n.preventDefault.value){switch(t=n.newStart,i=n.newEnd,c.eventResizeHandling){case"PostBack":c.eventResizePostBack(e,t,i);break;case"CallBack":c.eventResizeCallBack(e,t,i);break;case"Notify":c.eventResizeNotify(e,t,i);break;case"Update":c.Rg(n)}"function"==typeof c.onEventResized&&c.onEventResized(n)}};n.e=e,n.async=!1,n.loaded=function(){a()},n.newStart=t,n.newEnd=i,n.preventDefault=function(){this.preventDefault.value=!0},n.multiresize=DayPilot.list(b.list);var o={};o.event=e,o.start=t,o.end=i,n.multiresize.splice(0,0,o),"function"==typeof c.onEventResize&&c.onEventResize(n),n.async?c.blockOnCallBack&&P.show():a()}else switch(c.eventResizeHandling){case"PostBack":c.eventResizePostBack(e,t,i);break;case"CallBack":c.eventResizeCallBack(e,t,i);break;case"JavaScript":c.onEventResize(e,t,i);break;case"Notify":c.eventResizeNotify(e,t,i);break;case"Update":c.Rg(n)}},this.eventMovePostBack=function(e,t,i,n,a,o){this.Va("PostBack",e,t,i,n,a,o)},this.eventMoveCallBack=function(e,t,i,n,a,o){this.Va("CallBack",e,t,i,n,a,o)},this.Va=function(e,t,i,n,a,o,r){var s=t&&!!t.preventDefault,l={};if(s){var d=t;l.e=d.e,l.newStart=d.newStart,l.newEnd=d.newEnd,l.newResource=d.newResource,l.position=d.position,l.multimove=[],d.multimove.each(function(e){var t={};if(t.e=e.event,t.newStart=e.start,t.newEnd=e.end,t.newResource=e.event.resource(),t.e===d.e||t.e.data.id==d.e.data.id)t.newResource=d.newResource;else if(w.rowoffset){var i=e.event.part.dayIndex+w.rowoffset;t.newResource=c.rowlist[i].id; }l.multimove.push(t)})}else l.e=t,l.newStart=i,l.newEnd=n,l.newResource=a,l.position=r;this.Pa(e,"EventMove",l,o)},this.Sg=function(e,t,i){var n={};n.start=t.start,n.end=t.end,n.resource=t.resource,n.multirange=[],t.multirange.each(function(e){var t={};t.start=e.start,t.end=e.end,t.resource=e.resource,n.multirange.push(t)}),this.Pa(e,"TimeRangeSelected",n,i)},this.Pa=function(e,t,i,n){if("PostBack"===e)c.D(t,i,n);else if("CallBack"===e)c.F(t,i,n,"CallBack");else if("Immediate"===e)c.F(t,i,n,"Notify");else if("Queue"===e)c.queue.add(new DayPilot.Action(this,t,i,n));else{if("Notify"!==e)throw"Invalid event invocation type";"Notify"===_.notifyType()?c.F(t,i,n,"Notify"):c.queue.add(new DayPilot.Action(c,t,i,n))}},this.eventMoveNotify=function(e,t,i,n,a,o){if(e&&!!e.preventDefault){var r=e;r.old=new DayPilot.Event(r.e.copy(),c),r.multimove.each(function(e){e.old=new DayPilot.Event(e.event.copy(),c)}),c.Rg(r),r.e=r.old,delete r.old,r.multimove.each(function(e){e.event=e.old,delete e.old})}else{e=new DayPilot.Event(e.copy(),c);var s=c.events.Tg(e.data);e.start(t),e.end(i),e.resource(n),e.commit(),s=s.concat(c.events.Ug(e.data)),c.Vg(s),c.Wg(),c.Xg(s)}this.Va("Notify",e,t,i,n,a,o)},this.eventResizeNotify=function(e,t,i,n){var a=new DayPilot.Event(e.copy(),this),o=c.events.Tg(e.data);e.start(t),e.end(i),e.commit(),o=o.concat(c.events.Ug(e.data)),c.Vg(o),c.Wg(),c.Xg(o),this.Sa("Notify",a,t,i,n)},this.multiselect={},this.multiselect.list=[],this.multiselect.divs=[],this.multiselect.previous=[],this.multiselect.Yf=function(e){c.multiselect.list=DayPilot.list(e).map(function(e){return new DayPilot.Event(e,c)})},this.multiselect.ub=function(){var e=c.multiselect;return DayPilot.JSON.stringify(e.events())},this.multiselect.events=function(){var e=c.multiselect,t=DayPilot.list();t.ignoreToJSON=!0;for(var i=0;i1&&n.add(e.event,!0)}else n.clear();else c.allowMultiSelect&&(t||i)?n.add(e.event,!0):(n.clear(),n.add(e.event,!0));n.Yc(e),n.vb()},this.multiselect.wb=function(e){var t=c.multiselect;return t.xb(e,t.initList)},this.multiselect.yb=function(){for(var e=c.multiselect,t=[],i=0;i1)){var a,o,r=c.we(i),s=0;if("Days"===c.viewType){s=c.gg(t).start.getTime()-c.Aa().getTime()}t.getTime()=n&&(i.end.x=n-1),i},this.Oh=function(e){var t={};if(this.itline.length<=0)return t.start=this.startDate,t.end=this.startDate,t;if(!this.itline[e.start.x])throw"Internal error: area.start.x is null.";return t.start=this.itline[e.start.x].start,t.end=this.itline[e.end.x].end,t},this.Ph=function(e){if(!e)var e=this.Nh(this.nav.scroll.scrollLeft,this.nav.scroll.scrollTop);var t=[];t.ignoreToJSON=!0;for(var i=e.start.y;i<=e.end.y;i++){var n=c.rowlist[i];n&&!n.hidden&&t.push(n.id)}return t},this.Sh=function(e){if(!e)var e=this.Nh(this.nav.scroll.scrollLeft,this.nav.scroll.scrollTop);var t={};if(0===c.rowlist.length)return t;var i=c.itline[c.itline.length-1].end.getTime()-c.itline[0].start.getTime();return t.start=c.rowlist[e.start.y]&&c.rowlist[e.start.y].start,t.end=c.rowlist[e.end.y]&&c.rowlist[e.end.y].start.addTime(i),t},this.Q=function(){var e=[];e.ignoreToJSON=!0;for(var t=0;t0||i.isNewRow)){var n=this.U(t);e.push(n)}}return e},this.V=function(e){var t=[];t.ignoreToJSON=!0;for(var i=0;ir.y&&o.xt.y||e.y==t.y&&t.bottom)if(e.xt.x){var d=5,A=t.y-d,x=DayPilot.Util.div(h,e.x,e.y+u-f,n+a,a);x.style.boxSizing="border-box",x.style.borderBottomWidth=a+"px",x.className=c.p("_link_horizontal"),DayPilot.Util.addClass(x,i.cssClass),v(x,"Bottom"),g(x);var C=DayPilot.Util.div(h,e.x+n,e.y+u-f,a,A-(e.y+u-f));C.style.boxSizing="border-box",C.style.borderRightWidth=a+"px",C.className=c.p("_link_vertical"),DayPilot.Util.addClass(C,i.cssClass),v(C,"Right"),g(C);var T=DayPilot.Util.div(h,t.x-n,A,e.x+2*n+a-t.x,a);T.style.boxSizing="border-box",T.style.borderBottomWidth=a+"px",T.className=c.p("_link_horizontal"),DayPilot.Util.addClass(T,i.cssClass),v(T,"Bottom"),g(T);var M=DayPilot.Util.div(h,t.x-n,A,a,t.y-A+u-f);M.style.boxSizing="border-box",M.style.borderRightWidth=a+"px",M.className=c.p("_link_vertical"),DayPilot.Util.addClass(M,i.cssClass),v(M,"Right"),g(M);var E=DayPilot.Util.div(h,t.x-n,t.y+u-f,n,a);E.style.boxSizing="border-box",E.style.borderBottomWidth=a+"px",E.className=c.p("_link_horizontal"),DayPilot.Util.addClass(E,i.cssClass),v(E,"Bottom"),g(E);var P;r?(P=DayPilot.Util.div(h,t.x-6,t.y+u-f-5,0,0),P.style.borderWidth="6px",P.style.borderColor="transparent transparent transparent "+r,P.style.borderStyle="solid"):(P=DayPilot.Util.div(h,t.x-6,t.y+u-f-5,6,6),P.className=c.p("_link_arrow_right"),DayPilot.Util.addClass(P,i.cssClass)),g(P,!0)}else{var b=e.x,w=e.y+u-f,D=t.x+n,k=t.y,x=DayPilot.Util.div(h,b,w,D-e.x,a);x.style.boxSizing="border-box",x.style.borderBottomWidth=a+"px",x.className=c.p("_link_horizontal"),DayPilot.Util.addClass(x,i.cssClass),v(x,"Bottom"),g(x);var C=DayPilot.Util.div(h,D,w,a,k-w);C.style.boxSizing="border-box",C.style.borderRightWidth=a+"px",C.className=c.p("_link_vertical"),DayPilot.Util.addClass(C,i.cssClass),v(C,"Right"),g(C);var P;r?(P=DayPilot.Util.div(h,D-5+Math.floor(a/2),k-5,0,0),e.ythis.rowlist.length-1)throw"Row index too high (DayPilotScheduler._getRowByIndex)";for(var a=0;a<=e;a++){var o=this.rowlist[a];o.hidden||(i+=o.height,n++)}t=i-o.height;var r={};return r.top=t,r.height=o.height,r.bottom=i,r.i=n-1,r.data=o,r},this.fd=function(){return!!this.backendUrl&&("undefined"==typeof c.events.list||!c.events.list)},this.events.find=function(e){if(!c.events.list||"undefined"==typeof c.events.list.length)return null;for(var t=c.events.list.length,i=0;i=0&&c.events.list.splice(a,1),c.Gc.scope)c.Gc.notify();else{c.eg.skip=!0;var o=c.events.Tg(e.data);c.events.gi(o)}return n},this.events.add=function(e,t){e.calendar=c,c.events.list||(c.events.list=[]),DayPilot.list(c.events.list).find(function(t){var i=t instanceof DayPilot.Event?t.data:t;return i===e.data||i.id==e.data.id})||c.events.list.push(e.data);var i=new DayPilot.Action(c,"EventAdd",n,t);if(!c.z)return i;if(c.Gc.scope)c.Gc.notify();else{c.eg.skip=!0;var n={};n.e=e;var a=c.events.Ug(e.data);c.events.gi(a)}return i},this.events.bi={"rows":[]},this.events.hi=null,this.events.ch=function(){clearTimeout(c.events.hi),c.events.bi.rows=[]},this.events.gi=function(e){clearTimeout(c.events.hi);var t=c.events.bi.rows;DayPilot.list(e).each(function(e){t.push(e)}),c.events.bi.rows=DayPilot.ua(t);var i=c.events.immediateRefresh;c.events.hi=setTimeout(i,0)},this.events.immediateRefresh=function(){clearTimeout(c.events.hi);var e=c.events.bi.rows;c.events.bi.rows=[],c.Vg(e),c.Wg(),c.z&&("Gantt"===c.viewType?c.update():(c.Xg(e),c.ia(),c.ii()))},this.eg={},this.eg.enabled=!1,this.eg.skip=!1,this.eg.skipUpdate=function(){return c.eg.skip},this.eg.skipped=function(){c.eg.skip=!1},this.queue={},this.queue.list=[],this.queue.list.ignoreToJSON=!0,this.queue.add=function(e){if(e){if(!e.isAction)throw"DayPilot.Action object required for queue.add()";c.queue.list.push(e)}},this.queue.notify=function(e){var t={};t.actions=c.queue.list,c.F("Notify",t,e,"Notify"),c.queue.list=[]},this.queue.clear=function(){c.queue.list=[]},this.queue.pop=function(){return c.queue.list.pop()},this.cells.find=function(e,t){var i=c.getPixels(new DayPilot.Date(e));if(!i)return g();var n=i.i,a=c.kg(t);if(!a)return g();var o=a.index;return this.findXy(n,o)},this.cells.findByPixels=function(e,t){var i=c.Mg(e);if(!i)return g();var e=i.x,n=c.Th(t);if(!n)return g();var t=n.i;return this.findXy(e,t)},this.cells.all=function(){for(var e=[],t=c.itline.length,i=c.rowlist.length,n=0;n=a.getTime()&&e.getTime()e.ticks;)i=i.addTime(-n);return i}if("Days"===c.viewType){var a=this.ni(e),o=a.getTime()-c.Aa().getTime(),r=this.Og(e.addTime(-o));if(r.current)return r.current.start.addTime(o);if(r.past)return r.previous.end.addTime(o);throw"getBoxStart(): time not found"}var r=this.Og(e);if(r.current)return r.current.start;if(r.past)return r.previous.end;if(r.hidden){var s=r.next.start.getTime()-e.getTime(),l=r.next.end.getTime()-r.next.start.getTime(),d=Math.ceil(s/l)*l;return r.next.start.addTime(-d)}throw"getBoxStart(): time not found"},this.pi=function(e){var t=this.Th(c.coords.y),i=e.event;if("function"!=typeof i.end)throw"e.end function is not defined";if(!i.end())throw"e.end() returns null";var a=DayPilot.DateUtil.diff(i.rawend(),i.start());a=Math.max(a,1);var o=_.useBox(a),r=i.data&&"Milestone"===i.data.type,s=c.eventHeight,l=0,d=c.coords.x;if(r&&(d+=s/2),"Manual"===c.scale){var h=function(){var e=c.getDate(c.coords.x,!0,!0),t=e.addTime(-a),i=c.getPixels(t).boxLeft,n=c.getPixels(e).boxRight,e=Math.min(n,c.coords.x);return e-i}(),u=Math.min(n.moveOffsetX?n.moveOffsetX:0,h);d=c.coords.x-u}var f=0,v="Days"===this.viewType||this.qi();if(v&&!i.part.external&&(f=this.rowlist[i.part.dayIndex].start.getTime()-this.Aa().getTime()),o&&!r){var p=c.Og(i.start()),g=!p.hidden&&!p.past;l=i.start().getTime()-this.oi(i.start().addTime(-f)).addTime(f).getTime(),g&&(l=function(e,t){var i=c.ri(c.Og(e).current),n=c.ri(c.Mg(d).cell);if(i>1.2*n){for(var a=t>0?1:-1,t=Math.abs(t);t>=n;)t-=n;t*=a}return t}(i.start(),l))}var m=n.moving?n.moving.event.calendar:c;m!==c&&m.si()!==c.si()&&(l=0);var y=0;if(n.moveDragStart&&"Manual"!==c.scale&&m===c){if(o){var b=i.start().addTime(-f),w=this.oi(b);if(c.eventMoveSkipNonBusiness){var D=c.ui(w,t.i);if(!D)throw new DayPilot.Exception("No next cell found");D.start>w&&(w=D.start)}if(y=n.moveDragStart.getTime()-w.getTime(),c.eventMoveSkipNonBusiness){var k=c.vi(w,n.moveDragStart);y-=k}var x=60*c.si()*1e3;y=Math.floor(y/x)*x}else if(y=n.moveDragStart.getTime()-i.start().addTime(-f).getTime(),c.eventMoveSkipNonBusiness){var k=c.vi(i.start().addTime(-f),n.moveDragStart);y-=k}if(c.eventMoveSkipNonBusiness){var C=c.getDate(c.coords.x,!0);y=c.wi(C,y,t.i)}}else y=0;this.eventMoveToPosition&&(y=0);var P=this.getDate(d,!0).addTime(-y).addTime(f);n.resizing&&(P=i.start()),this.snapToGrid&&(P=this.oi(P.addTime(-f)).addTime(f)),P=P.addTime(l);var S=P.addTime(a),A=P,T=S;if(v){A=P.addTime(-f),T=A.addTime(a);var M=t.element.data.start.getTime()-this.Aa().getTime();P=A.addTime(M),S=P.addTime(a)}!function(){if(c.eventMoveSkipNonBusiness){var e=t.i,n=c.xi(i),a=n,o=c.ui(A,e);if(!o)throw new DayPilot.Exception("No next cell found");var r=DayPilot.indexOf(c.itline,o);if(o.start>P)P=o.start;else{if(n-=o.end.getTime()-A.getTime(),n<=0)return S=P.addTime(a),void(T=S.addTime(-f));r+=1}A=P.addTime(-f);for(var s=r;s1.2*n){for(var a=t>0?1:-1,t=Math.abs(t);t>=n;)t-=n;t*=a}return t}(i.start(),l))}var m=n.moving?n.moving.event.calendar:c;m!==c&&m.si()!==c.si()&&(l=0);var y=0;if(n.moveDragStart&&"Manual"!==c.scale&&m===c)if(o){var b=i.start().addTime(-f),w=this.oi(b);y=n.moveDragStart.getTime()-w.getTime();var D=60*c.si()*1e3;y=Math.floor(y/D)*D}else y=n.moveDragStart.getTime()-i.start().addTime(-f).getTime();else y=0;this.eventMoveToPosition&&(y=0);var k=this.getDate(d,!0).addTime(-y).addTime(f);n.resizing&&(k=i.start()),this.snapToGrid&&(k=this.oi(k.addTime(-f)).addTime(f)),k=k.addTime(l);var x=k.addTime(a),C=k,P=x;if(v){C=k.addTime(-f),P=C.addTime(a);var S=t.element.data.start.getTime()-this.Aa().getTime();k=C.addTime(S),x=k.addTime(a)}if(n.moveDragStart&&c.eventMoveSkipNonBusiness){var A=t.i,T=n.moveDragStart.addTime(f);this.snapToGrid&&(T=this.oi(T.addTime(-f)).addTime(f));var M=c.yi(i.start(),T,i.part.dayIndex),a=c.xi(i),E=c.getDate(d,!0);c.snapToGrid&&(E=c.getDate(d));var u=c.zi(E,M,A);k=E.addTime(-u).addTime(f),this.snapToGrid&&(k=this.oi(k.addTime(-f)).addTime(f)),l=c.yi(this.oi(i.start().addTime(-f)).addTime(f),i.start(),A),k=k.addTime(l),x=c.Ai(k,a,A),C=k.addTime(-f),P=x.addTime(-f)}var H=this.getPixels(C),R=this.getPixels(P),B=o?H.boxLeft:H.left,N=o?R.boxRight-B:R.left-B;r&&(N=s,B-=N/2);var U={};return U.top=t.top,U.left=B,U.row=t.element,U.rowIndex=t.i,U.width=N,U.start=k,U.end=x,U.relativeY=c.coords.y-t.top,U},this.vi=function(e,t){var i=c.Og(e),n=c.Og(t),a=null,o=0;i.hidden&&(a=e);for(var r=i.i;r<=n.i;r++){var s=c.itline[r];a&&ae);else{if(n-=s.end.getTime()-r.getTime(),n<=0)return e.addTime(t);l+=1}for(var d=l;do?t.getTime()-s.start.addTime(a).getTime():t.getTime()-e.getTime();l+=o>s.start?s.end.getTime()-o.getTime():s.end.getTime()-s.start.getTime(),d+=1}for(var h=d;ho.current.start)return t;n+=e.getTime()-o.current.start.getTime(),a-=e.getTime()-o.current.start.getTime();var r=DayPilot.indexOf(c.itline,o.current);r-=1;for(var s=o.current.start;r>=0;){var o=c.itline[r];s>o.end&&(n+=s.getTime()-o.end.getTime()),s=o.start;var l=o.end.getTime()-o.start.getTime();if(a<=l)return n+=a;n+=l,a-=l,r-=1}throw new DayPilot.Exception("Unable to backward calculate offset in visible timeline")},this.zi=function(e,t,i){var n=0,a=t,o=c.Og(e);if(!o.current)throw new DayPilot.Exception("Current cell not found.");var r=DayPilot.indexOf(c.itline,o.current);if(c.li(r,i).business){if(e.addTime(-t)>=o.current.start)return t}else if(0===t||e.addTime(-t)>=o.current.start)return e.getTime()-c.ui(e,i).start.getTime();n+=e.getTime()-o.current.start.getTime(),a-=e.getTime()-o.current.start.getTime(),r-=1;for(var s=o.current.start;r>=0;){var o=c.itline[r];s>o.end&&(n+=s.getTime()-o.end.getTime()),s=o.start;var l=o.end.getTime()-o.start.getTime();if(c.li(r,i).business){if(a<=l)return n+=a;n+=l,a-=l}else n+=l;r-=1}throw new DayPilot.Exception("Unable to calculate backward offset in visible timeline")},this.ui=function(e,t){var i=c.Og(e),n=0;if(i.past)return null;if(i.current)n=i.i;else{if(!i.next)return null;n=DayPilot.indexOf(c.itline,i.next)}for(var a=n;a0){var e=c.itline[0];return(e.end.getTime()-e.start.getTime())/6e4}return c.cellDuration}throw"can't guess cellDuration value"},this.ri=function(e){return e.end.ticks-e.start.ticks},this.Xh=function(e){return this.treePreventParentUsage&&this.Ci(e)},this.Ci=function(e){var t=this.rowlist[e];return!!t.isParent||!!(this.treeEnabled&&t.children&&t.children.length>0)},this.Di={},this.Ei=function(){if(c.treeAutoExpand){var e=this.Wh(n.moving),t=e.rowIndex,i=this.Ci(t),a=this.Di;if(a.timeout&&a.y!==t&&(clearTimeout(a.timeout),a.timeout=null),i){a.y=t;var o=!c.rowlist[a.y].expanded;!a.timeout&&o&&(a.timeout=setTimeout(function(){!c.rowlist[a.y].expanded&&(c.Fi(a.y),c.Gi()),a.timeout=null},500))}}},this.xc=function(){var e=n.resizingShadow.width,t=n.resizingShadow.left,i=n.resizingEvent,a=n.resizing.dpBorder,o=c.rowlist[i.part.dayIndex],r=0;r=o.start.getTime()-c.Aa().getTime();var s=null,l=null,d=!c.snapToGrid;"left"===a?(s=c.getDate(t,d).addTime(r),l=i.rawend()):"right"===a&&(s=i.start(),l=c.getDate(t+e,d,!0).addTime(r)),n.resizingShadow.start=s,n.resizingShadow.end=l,b.update()},this.exportAs=function(e,t){var i=m.generate(e,t);return new DayPilot.Export(i)},this["export"]=this.exportAs,this.zc={};var m=this.zc;m.getWidth=function(){var e=m.cd;switch(e){case"viewport":return c.nav.top.offsetWidth;case"full":return c.tg()+m.getRowHeaderWidth();case"range":return c.getPixels(m.getRangeEnd()).boxRight-c.getPixels(m.getRangeStart()).boxLeft+m.getRowHeaderWidth();default:throw"Unsupported export mode: "+e}},m.getHeight=function(){var e=m.cd;switch(e){case"viewport":return c.nav.top.offsetHeight-DayPilot.sh(c.nav.scroll)-1;case"full":return c.dd()+c.ed()-DayPilot.sh(c.nav.scroll);case"range":var t=m.getRows();if(0===t.length)return c.ed();var i=t.first(),n=t.last();return n.top-i.top+n.height+c.ed();default:throw"Unsupported export mode: "+e}},m.getRangeStart=function(){return new DayPilot.Date(m.bd.dateFrom)},m.getRangeEnd=function(){return new DayPilot.Date(m.bd.dateTo)},m.getRangeResStart=function(){return m.bd.resourceFrom?c.kg(m.bd.resourceFrom):c.rowlist[0]},m.getRangeResEnd=function(){return m.bd.resourceTo?c.kg(m.bd.resourceTo):c.rowlist.last()},m.getRowHeaderWidth=function(){return c.vg()},m.getTimeHeaderHeight=function(){return c.ed()},m.getCanvas=function(){return m.canvas()},m.getRectangles=function(){var e=m.getRowHeaderWidth(),t=m.getTimeHeaderHeight(),i={};i.main={"x":0,"y":0,"w":m.getWidth(),"h":m.getHeight()},i.corner={"x":0,"y":0,"w":e,"h":t},i.grid={"x":e,"y":t,"w":m.getWidth()-e,"h":m.getHeight()-t};var n=i.grid.w,a=c.itline.last();a&&a.left+a.width0){var t=c.Og(m.getRangeStart()).i,i=c.Og(m.getRangeEnd()).i,n=c.Ii();i=Math.min(i,n-1),t=Math.max(t,0);for(var a=t;a<=i;a++){var o=c.itline[a];e.push(o)}e.offset=t}return e},m.getViewportTimeline=function(){var e=DayPilot.list();if(c.itline&&c.itline.length>0){var t=c.Ji,i=t+c.Ki,n=c.Mg(t).x,a=c.Mg(i,!0).x,o=c.Ii();a=Math.min(a,o),n=Math.max(n,0);for(var r=n;r<=a;r++){var s=c.itline[r];e.push(s)}e.offset=n}return e},m.getTimeHeader=function(e){if("full"===m.cd)return DayPilot.list(c.timeHeader[e]);var t,i,n=DayPilot.list();t=m.getViewportOffsetStart(),i=t+m.getViewportOffsetWidth();var a=c.Li(e,t),o=c.Li(e,i);o||(o={"x":c.timeHeader[e].length-1 });for(var r=a.x;r<=o.x;r++){var s=c.timeHeader[e][r];n.push(s)}return n},m.fakeDurationBar=function(){var e=document.createElement("div");e.style.display="none",e.className=c.p(M.event);var t=document.createElement("div");t.className=c.p(M.eventBar);var i=document.createElement("div");return i.className=c.p(M.eventBarInner),document.body.appendChild(e),t.appendChild(i),e.appendChild(t),e},m.fakeCell=function(){var e=document.createElement("div");e.style.display="none",e.className=c.p("_cell"),e.style.position="absolute",e.style.top="-2000px",e.style.left="-2000px";var t=document.createElement("div");return t.className=c.p("_cell_inner"),e.appendChild(t),c.divCells.appendChild(e),e},m.fakeRowHeader=function(){var e=document.createElement("div");e.style.display="none",e.className=c.p("_rowheader"),e.style.position="absolute",e.style.top="-2000px",e.style.left="-2000px";var t=document.createElement("div");return t.className=c.p("_rowheader_inner"),e.appendChild(t),c.divResScroll.appendChild(e),e},m.fakeExpand=function(){var e=document.createElement("div");return e.style.display="none",e.className=c.p("_tree_image_expand"),document.body.appendChild(e),e},m.extractUrl=function(e){var t=/url\((")?([^"].*[^"])\1\)/.exec(e);return t?t[2]:null},m.getImages=function(){var e={},t=m.fakeExpand();return e.expand=m.extractUrl(new DayPilot.StyleReader(t).get("background-image")),t.className=c.p("_tree_image_collapse"),e.collapse=m.extractUrl(new DayPilot.StyleReader(t).get("background-image")),t.className=c.p("_tree_image_no_children"),e.nochildren=m.extractUrl(new DayPilot.StyleReader(t).get("background-image")),DayPilot.de(t),e},m.getFont=function(e){var t=new DayPilot.StyleReader(e).get("font-style");return{"family":new DayPilot.StyleReader(e).get("font-family"),"size":new DayPilot.StyleReader(e).get("font-size"),"style":t}},m.getViewportOffsetStart=function(){switch(m.cd){case"full":return 0;case"viewport":return c.nav.scroll.scrollLeft;case"range":return c.getPixels(m.getRangeStart()).boxLeft}},m.getViewportOffsetTop=function(){switch(m.cd){case"full":return 0;case"viewport":return c.nav.scroll.scrollTop;case"range":return m.getRangeResStart().top}},m.getViewportOffsetWidth=function(){switch(m.cd){case"full":return c.tg();case"viewport":return c.nav.scroll.offsetWidth;case"range":return c.getPixels(m.getRangeEnd()).boxRight-m.getViewportOffsetStart()}},m.excelBoard=function(){var e=new DayPilot.Excel,t=e.worksheets.create("Scheduler"),i=new DayPilot.StyleReader(c.nav.corner).get("background-color"),n=new DayPilot.StyleReader(c.nav.top).get("border-top-color"),a=DayPilot.list(c.elements.events).map(function(e){return e.firstChild}).last(),o=new DayPilot.StyleReader(a).get("border-right-color");e.styles.getDefault().setBackColor("#ffaaaa");var r=e.styles.create();r.setHorizontalAlignment("Center"),r.setBackColor(i),r.setBorderColor(n);var s=e.styles.create();s.setVerticalAlignment("Top"),s.setBackColor(i),s.setBorderColor(n);var l=e.styles.create();l.setVerticalAlignment("Top"),l.setBackColor("#ff0000"),l.setBorderColor(o),t.enableGridlines(!1),t.cell(0,0).setRowspan(c.timeHeader.length).setStyle(r),t.cell(10,10).setText("hi there"),DayPilot.list(c.timeHeader).each(function(e,i){var n={"x":1,"y":0};m.getTimeHeader(i,"full").each(function(e,a){var o=e.colspan;t.cell(a+n.x,i+n.y).setText(e.innerHTML).setColspan(o).setStyle(r)})}),DayPilot.list(c.rowlist).each(function(e,i){for(var n={"x":0,"y":1},a="",o=0;o0&&a.fillRect(T,u)),DayPilot.list(h.areas).each(function(t){var i=t.left;t.start&&(i=c.getPixels(new DayPilot.Date(t.start)).left-e.part.left);var n=t.width||t.w;t.right?n=e.part.width-t.right-i:t.end&&(n=c.getPixels(new DayPilot.Date(t.end)).left-t.left-e.part.left+1);var o=t.top,s=t.height||t.h;"number"==typeof t.bottom&&(s=e.part.height-t.bottom-o);var d={"x":l+i,"y":r+o,"w":n,"h":s};a.fillRect(d,t.backColor),a.text(d,t.html,{"size":P.fontSize,"family":P.fontFamily,"style":P.fontStyle},t.fontColor||P.fontColor,null,t.padding)})}),a.rect(s.main,u),a.line(s.grid.x,0,s.grid.x,s.main.h,f),a.line(0,s.grid.y,s.main.w,s.grid.y,f),a}},this.Ni=function(e){return"transparent"===e||"rgba(0, 0, 0, 0)"===e},this.Pi={};var y=this.Pi;y.findJointDivs=function(e){var t=e.data.join;return t?DayPilot.list(c.elements.events).filter(function(i){return i.event.data.join===t&&i.event!==e}):DayPilot.list()},this.Qi={};var b=this.Qi;b.divs=[],b.list=[],b.forbidden=!1,b.additional=function(){var e=DayPilot.list(),t=c.multiselect.isSelected(n.resizing.event),i=c.allowMultiResize,e=DayPilot.list();if(t&&i&&(e=DayPilot.list(c.multiselect.divs).filter(function(e){return e!==n.resizing})),c.jointEventsResize){var a=y.findJointDivs(n.resizingEvent);e=e.concat(a)}return e},b.update=function(){b.clear(),b.draw()},b.clear=function(){DayPilot.de(b.divs),b.divs=[]},b.draw=function(){if(n.resizing){var e=n.resizingEvent,t=n.resizingShadow,i=t.start.getTime()-e.start().getTime(),a=t.end.getTime()-e.end().getTime(),o=0;if(b.list=[],b.forbidden=!1,b.invalid=!1,b.rowoffset=o,b.additional().each(function(e){if(e.event){var t=e.event,n=c.rowlist[t.part.dayIndex+o];if(!n)return void(b.invalid=!0);var r=t.part.top+n.top,s=t.part.height,l=t.start().addTime(i),d=t.end().addTime(a),h={};h.event=t,h.start=l,h.end=d,h.overlapping=!1,b.list.push(h);var u=c.getPixels(l),f=c.getPixels(d),v=DayPilot.DateUtil.diff(t.rawend(),t.start());v=Math.max(v,1);var p=_.useBox(v),g=p?u.boxLeft:u.left,m=p?f.boxRight-g:f.left-g,y=document.createElement("div");y.style.position="absolute",y.style.left=g+"px",y.style.top=r+"px",y.style.height=s+"px",y.style.width=m+"px",y.style.zIndex=101,y.style.overflow="hidden",y.className=c.p("_shadow"),y.info=h;var w=document.createElement("div");w.className=c.p("_shadow_inner"),y.appendChild(w),c.hg.appendChild(y),b.divs.push(y)}}),b.invalid){var r=c.p("_shadow_overlap");return void DayPilot.list(b.divs).each(function(e){DayPilot.Util.addClass(e,r)})}DayPilot.list(b.divs).each(function(e){if(e.info){var t=e,i=e.info,a=e.info.event,r=c.rowlist[a.part.dayIndex+o],s=c.getPixels(i.start),l=c.getPixels(i.end),d=s.left,h=l.left-d,u=DayPilot.list(b.list).map(function(e){return e.event.data}).add(n.resizing.event.data);c.Ri(t,r,d,h,u),t.overlapping&&(i.overlapping=!0,b.forbidden=!0)}})}},this.Si={},this.Si.modifiedProps=function(){var e=new DayPilot.Scheduler,t=DayPilot.Util.members(c,2),i=[];return i.push("
"),i.push(""),i.join("\n")},this.Ti={};var w=this.Ti;w.divs=[],w.list=[],w.forbidden=!1,w.verticalAll=function(){return"All"===c.multiMoveVerticalMode},w.additional=function(){var e=DayPilot.list(),t=c.multiselect.isSelected(n.movingEvent),i=c.allowMultiMove,e=DayPilot.list();if(t&&i&&(e=DayPilot.list(c.multiselect.divs).filter(function(e){return e!==n.moving&&e!==A.moving})),c.jointEventsMove){var a=y.findJointDivs(n.movingEvent);e=e.concat(a)}return e},w.update=function(){w.clear(),w.draw()},w.draw=function(){if(n.moving){var e=n.movingEvent,t=n.movingShadow.start,i=t.getTime()-e.start().getTime(),a=e.part.dayIndex,o=DayPilot.indexOf(c.rowlist,n.movingShadow.row),r=o-a;if(w.verticalAll()||(r=0),w.list=[],w.forbidden=!1,w.invalid=!1,w.rowoffset=r,w.additional().each(function(e){if(e.event){var t=e.event,n=c.rowlist[t.part.dayIndex+r];if(!n)return void(w.invalid=!0);var a=t.part.top+n.top,o=t.part.height;r&&(a=n.top,o=n.height);var s=t.start().addTime(i),l=t.end().addTime(i),d={};d.event=t,d.start=s,d.end=l,d.overlapping=!1,w.list.push(d);var h=c.getPixels(s),u=c.getPixels(l),f=DayPilot.DateUtil.diff(t.rawend(),t.start());f=Math.max(f,1);var v=_.useBox(f),p=v?h.boxLeft:h.left,g=v?u.boxRight-p:u.left-p,m=document.createElement("div");m.style.position="absolute",m.style.left=p+"px",m.style.top=a+"px",m.style.height=o+"px",m.style.width=g+"px",m.style.zIndex=101,m.style.overflow="hidden",m.className=c.p("_shadow"),m.info=d;var y=document.createElement("div");y.className=c.p("_shadow_inner"),m.appendChild(y),c.hg.appendChild(m),w.divs.push(m)}}),w.invalid){var s=c.p("_shadow_overlap");return void DayPilot.list(w.divs).each(function(e){DayPilot.Util.addClass(e,s)})}DayPilot.list(w.divs).each(function(e){if(e.info){var t=e,i=e.info,a=e.info.event,o=c.rowlist[a.part.dayIndex+r],s=c.getPixels(i.start),l=c.getPixels(i.end),d=s.left,h=l.left-d,u=DayPilot.list(w.list).map(function(e){return e.event.data}).add(n.movingEvent.data);c.Ri(t,o,d,h,u),t.overlapping&&(i.overlapping=!0,w.forbidden=!0)}})}},w.clear=function(){DayPilot.de(w.divs),w.divs=[]},this.Ui=function(){var e=c.coords,t=n.resizing.dpBorder,i=n.resizing.event,a=i.part.left;"right"==t&&(a+=i.part.width);var o,r,s=n.resizing.event.calendar.cellWidth,l=n.resizing.event.part.width,d=n.resizing.event.part.left,h=0,u=e.x-a;if("right"===t){if(o=d,c.snapToGrid){var f=c.Mg(l+d+u).cell;r=f.left+f.width-d,rv&&(r=v-d),n.resizingShadow.left=d,n.resizingShadow.width=r}else{if("left"!==t)throw"Invalid dpBorder.";c.snapToGrid?(u>=l&&(u=l),o=Math.floor((d+u+0)/s)*s,os.part.height/2&&(o=s.part.top+s.part.height+c.eventMarginBottom/2,a+=1))}else{for(var e=t.relativeY,n=t.row,l=0,d=c.Nb.eventHeight(),h=n.lines.length,u=0;u0&&(o-=3);var r=i.cache&&"undefined"!=typeof i.cache.moveVDisabled?!i.cache.moveVDisabled:!i.data.moveVDisabled,s=i.cache&&"undefined"!=typeof i.cache.moveHDisabled?!i.cache.moveHDisabled:!i.data.moveHDisabled,l=!w.additional().isEmpty();if(l&&"Disabled"===c.multiMoveVerticalMode&&(r=!1),r)if(this.Xh(t.rowIndex)){var d=e.row,h=1;if(!d)return;h=t.rowIndex0?0:f.lines.length-1,e.style.top=t.top+o+"px",e.style.height="3px",e.line=a);break}}}else e.row=t.row,e.style.height=Math.max(t.row.height,0)+"px",e.style.top=t.top+"px",c.eventMoveToPosition&&(e.style.top=t.top+o+"px",e.style.height="3px",e.line=a);else{for(var d=c.rowlist[i.part.dayIndex],v=d.lines.length,u=0;ud.index&&v>0?v*c.Nb.eventHeight()-3:0;e.style.top=d.top+p+"px",e.style.height="3px",e.line=0}}s?(e.style.left=t.left+"px",c.eventMoveToPosition?e.style.width=c.cellWidth+"px":e.style.width=t.width+"px",e.start=t.start,e.end=t.end):(e.style.left=i.part.left+"px",e.start=i.start(),e.end=i.rawend()),function(){var n=e.row,a=i.data,o=t.width,r=t.left,s=DayPilot.list(w.list).map(function(e){return e.event.data}).add(a);c.Ri(e,n,r,o,s)}(),function(){var t=c.oh;if(!t||t.start.getTime()!==e.start.getTime()||t.end.getTime()!==e.end.getTime()||t.resource!==e.row.id){w.update();var r=!!n.drag&&i.part.external,s={};s.start=e.start,s.end=c.Xe(e.end),s.duration=new DayPilot.Duration(s.start,s.end),s.e=i,s.external=r,s.resource=e.row.id,s.html=null,s.row=c.zh(e.row),s.position=e.line,s.overlapping=e.overlapping||w.forbidden,s.allowed=!0,s.left={},s.left.html=s.start.toString(c.eventMovingStartEndFormat,_.locale()),s.left.enabled=c.eventMovingStartEndEnabled,s.left.space=5,s.left.width=null,s.right={},s.right.html=s.end.toString(c.eventMovingStartEndFormat,_.locale()),s.right.enabled=c.eventMovingStartEndEnabled,s.right.space=5,s.right.width=null,s.multimove=DayPilot.list(w.list),s.shift=c.coords.shift,s.ctrl=c.coords.ctrl,s.meta=c.coords.meta,s.alt=c.coords.alt;var l={};l.event=i,l.start=s.start,l.end=s.end,s.multimove.splice(0,0,l),c.oh=s;var d={"start":s.start,"end":s.end,"resource":s.resource};if("function"==typeof c.onEventMoving&&c.onEventMoving(s),e.allowed=s.allowed,s.start!==d.start||s.end!==d.end){var h=s.start,u=c.we(s.end);e.start=h,e.end=u;var f=DayPilot.DateUtil.diff(h,u);f=Math.max(f,1);var v=_.useBox(f),p=v?c.getPixels(h).boxLeft:c.getPixels(h).left,g=v?c.getPixels(u).boxRight:c.getPixels(u).left;e.style.left=p+"px",e.style.width=g-p+"px"}if(s.resource!==d.resource){var m=c.kg(s.resource);m&&(e.row=m,e.style.height=Math.max(m.height,0)+"px",e.style.top=m.top+"px",c.eventMoveToPosition&&(e.style.top=m.top+o+"px",e.style.height="3px",e.line=a))}s.html?e.firstChild.innerHTML=s.html:e.firstChild.innerHTML="",c.Wi(e,s),DayPilot.Util.addClass(n.moving,c.p(M.eventMovingSource)),c.Xi(n.movingShadow,s)}}()}}},this.Ri=function(e,t,i,n,a){if(!c.allowEventOverlap){!function(){e.overlapping=!1;for(var o=0;o0&&(a.style.left=l+"px",a.style.top=i.top-c.nav.scroll.scrollTop+c.ed()+"px",c.nav.top.appendChild(a),c.elements.hover.push(a))}var n=t.right.width||10,d=document.createElement("div");if(d.style.position="absolute",d.style.left=i.right+t.right.space+"px",d.style.top=i.top+"px",d.style.height=c.eventHeight+"px",d.style.overflow="hidden",d.style.boxSizing="border-box",t.right.width?d.style.width=t.right.width+"px":d.style.whiteSpace="nowrap",d.innerHTML=t.right.html,d.className=this.p("_event_move_right"),d.onmousemove=c.Zi,t.right.enabled){c.divHover.appendChild(d);var h=c.nav.scroll.scrollWidth;i.right+t.right.space+d.offsetWidth>=h&&c.divHover.removeChild(d)}},this.Yi=function(){c.divHover.innerHTML="",DayPilot.de(c.elements.hover),c.elements.hover=[]},this._i=function(){var e=c.rowHeaderColumnDefaultWidth;this.rowHeaderColumns&&(this.rowHeaderCols=DayPilot.Util.propArray(this.rowHeaderColumns,"width",e))},this.$i=function(){var e=0;if(this._i(),this.rowHeaderCols)for(var t=0;tthis.rowHeaderCols[o]&&(this.rowHeaderCols[o]=n[o],e=!0),t+=this.rowHeaderCols[o]);else t=this.rowHeaderWidth,this.rowHeaderWidth0?(r.expanded?n.className=c.p("_tree_image_collapse"):n.className=c.p("_tree_image_expand"),n.style.cursor="pointer",n.index=e,n.onclick=function(e){c.Fi(this.index),e=e||window.event,e.cancelBubble=!0}):n.className=c.p("_tree_image_no_children"):(n.className=c.p("_tree_image_expand"),n.style.cursor="pointer",n.index=e,n.onclick=function(e){c.rj(this.index),e=e||window.event,e.cancelBubble=!0}),v.appendChild(n)}var a=document.createElement("div");c.treeEnabled&&(a.style.marginLeft=t+i+"px"),a.innerHTML=h.html,d.textDiv=a,d.cellDiv=f,v.appendChild(a)}(),d.appendChild(f),t.appendChild(d),i.rows[e].cells.push(d),r.columns&&0!==r.columns.length)for(var w=u,D=1;D0?a:1,f.style.width=o+"px"}}},this.oj=function(){var e=this.row;return e.contextMenu&&e.contextMenu.show(c.zh(e)),!1},this.pj=function(e){if(!x.cancelClick){var t=this.row,i=c.zh(t,this.index);return t.isNewRow?void c.Fh.edit(t):void c.Ch(i,e.ctrlKey,e.shiftKey,e.metaKey)}},this.qj=function(e){if(c.timeouts.resClick){for(var t in c.timeouts.resClick)window.clearTimeout(c.timeouts.resClick[t]);c.timeouts.resClick=null}var i=this.row,n=c.zh(i,this.index);if(c.ra()){var a={};if(a.resource=n,a.row=n,a.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof c.onRowDoubleClick&&(c.onRowDoubleClick(a),a.preventDefault.value))return;switch(c.rowDoubleClickHandling){case"PostBack":c.rowDoubleClickPostBack(n);break;case"CallBack":c.rowDoubleClickCallBack(n);break;case"Select":c.Eh(i,e.ctrlKey,e.shiftKey,e.metaKey);break;case"Edit":c.Fh.edit(i)}"function"==typeof c.onRowDoubleClicked&&c.onRowDoubleClicked(a)}else switch(c.rowDoubleClickHandling){case"PostBack":c.rowDoubleClickPostBack(n);break;case"CallBack":c.rowDoubleClickCallBack(n);break;case"JavaScript":c.onRowDoubleClick(n);break;case"Select":c.Eh(i,e.ctrlKey,e.shiftKey,e.metaKey);break;case"Edit":c.Fh.edit(i)}},this.rowDoubleClickPostBack=function(e,t){var i={};i.resource=e,this.D("RowDoubleClick",i,t)},this.rowDoubleClickCallBack=function(e,t){var i={};i.resource=e,this.F("RowDoubleClick",i,t)},this.sj=function(e){var t={};t.start=this.cell.start,t.level=this.cell.level,t.end=this.cell.end,t.end||(t.end=new DayPilot.Date(t.start).addMinutes(c.cellDuration)),c.Gh(t)},this.zh=function(e){return new DayPilot.Row(e,c)},this.Fg=function(e){var t=this.rowlist[e];if(t.events||t.resetEvents(),!t.data){t.data={},t.data.start=new DayPilot.Date(t.start),t.data.startTicks=t.data.start.getTime();var i=this.Ig().getTime()-this.Aa().getTime();t.data.end=_.isResourcesView()?t.data.start.addTime(i):t.data.start.addDays(1),t.data.endTicks=t.data.end.getTime(),t.data.offset=t.start.getTime()-this.Aa().getTime(),t.data.i=e}},this.aa=function(e){if(e?this.events.list=e:this.events.list||(this.events.list=[]),null!=this.events.list&&!DayPilot.isArray(this.events.list))throw"DayPilot.Scheduler.events.list expects an array object";D.prepareRows(!0);for(var t,i=this.events.list,n=i.length,a="function"==typeof this.onBeforeEventRender,o="Resources"===c.viewType,r=0;r=t.data.endTicks)||a===o&&a===t.data.startTicks;break;case"Resources":l=(t.id===e.resource||"*"===t.id||"*"===e.resource)&&(!(o<=t.data.startTicks||a>=t.data.endTicks)||a===o&&a===t.data.startTicks);break;case"Gantt":l=t.id===e.id&&!(o<=t.data.startTicks||a>=t.data.endTicks)}if(!l)return null;var d=new DayPilot.Event(e,c);d.part.dayIndex=t.data.i,d.part.start=t.data.startTickso?n:t.data.end;var h=this.getPixels(d.part.start.addTime(-t.data.offset)),u=this.getPixels(d.part.end.addTime(-t.data.offset));d.part.start===d.part.end&&(u=this.getPixels(d.part.end.addTime(-t.data.offset).addSeconds(1))),r&&r.height?d.part.height=r.height:e.height&&(d.part.height=e.height),d.part.xj=function(){var e=this.height;if(c.eventVersionsEnabled&&!DayPilot.list(d.data.versions).isEmpty()){var t=d.versions.length;e+=t*c.eventVersionHeight,e+=t*c.eventVersionMargin}return e+c.eventMarginBottom};var f=h.left,v=u.left;if(d.part.startPixels=h,d.part.endPixels=u,f===v){if(h.cut||u.cut)return null;var p=(d.part.start.addTime(-t.data.offset).getTime()+d.part.end.addTime(-t.data.offset).getTime())/2;if(c.getPixels(new DayPilot.Date(Math.floor(p))).cut)return null}d.part.box=_.useBox(o-a);var g=c.eventHeight;if("Milestone"===e.type){var m=e.width||g;d.part.end=d.part.start,d.part.left=f-m/2,d.part.width=m,d.part.barLeft=0,d.part.barWidth=m}else if(d.part.box){var y=h.boxLeft,b=u.boxRight;d.part.left=y,d.part.width=b-y,d.part.barLeft=Math.max(f-d.part.left,0),d.part.barWidth=Math.max(v-f,1)}else d.part.left=f,d.part.width=Math.max(v-f,1),d.part.barLeft=0,d.part.barWidth=Math.max(v-f-1,1);if(c.eventVersionsEnabled&&c.yj(d,t),"function"==typeof c.onEventFilter&&c.events.Tc){var w={};if(w.filter=c.events.Tc,w.visible=!0,w.e=d,c.onEventFilter(w),!w.visible)return null}return t.events.push(d),d}},this.yj=function(e,t){e.versions=[];var i=e.data,n=DayPilot.list(i.versions);n.isEmpty()||n.each(function(i){var n=new DayPilot.Date(i.start),a=new DayPilot.Date(i.end),o=c.getPixels(n.addTime(-t.data.offset)),r=c.getPixels(a.addTime(-t.data.offset));n.ticks===a.ticks&&(r=c.getPixels(a.addTime(-t.data.offset).addTime(1)));var s=o.left,l=r.left;if(s===l&&(o.cut||r.cut))return null;var d={};d.left=s,d.continueLeft=nt.data.end,d.width=l-s,e.versions.push(d)})},this.Uc=function(e,t){if(!(e&&t&&e.start&&t.start))return 0;var i=e.start().ticks-t.start().ticks;return 0!==i?i:t.end().ticks-e.end().ticks},this.Vc=function(e,t){if(!e||!t)return 0;if(!(e.data&&t.data&&e.data.sort&&t.data.sort&&0!==e.data.sort.length&&0!==t.data.sort.length))return c.Uc(e,t);for(var i=0,n=0;0===i&&"undefined"!=typeof e.data.sort[n]&&"undefined"!=typeof t.data.sort[n];)i=e.data.sort[n]===t.data.sort[n]?0:"number"==typeof e.data.sort[n]&&"number"==typeof t.data.sort[n]?e.data.sort[n]-t.data.sort[n]:c.Wc(e.data.sort[n],t.data.sort[n],c.sortDirections[n]),n++;return i},this.Wc=function(e,t,i){var n="desc"!==i,a=n?-1:1,o=-a;if(null===e&&null===t)return 0;if(null===t)return o;if(null===e)return a;var r=[];return r[0]=e,r[1]=t,r.sort(),e===r[0]?a:o},this.Eh=function(e,t,i,n){if(c.ra()){var a=DayPilot.indexOf(c.rowlist,e),o=c.zh(e,a),r=DayPilot.indexOf(x.selected,e)!==-1,s=r?"deselected":"selected",l={};if(l.row=o,l.selected=r,l.ctrl=t,l.shift=i,l.meta=n,l.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof c.onRowSelect&&(c.onRowSelect(l),l.preventDefault.value))return;var d=i&&!t&&!n;if(i||(x.zj={"row":e,"index":a}),d){x.fixRowSelectLast();var h=x.zj.index,u=a;x.selectRange(h,u)}switch(c.rowSelectHandling){case"PostBack":c.rowSelectPostBack(o,s);break;case"CallBack":c.rowSelectCallBack(o,s);break;case"Notify":!d&&x.select(e,t,i,n),c.rowSelectNotify(o,s);break;case"Update":!d&&x.select(e,t,i,n)}"function"==typeof c.onRowSelected&&(l.selected=DayPilot.indexOf(x.selected,e)!==-1,c.onRowSelected(l))}else{x.select(e,t,i);var a=DayPilot.indexOf(c.rowlist,e),o=c.zh(e,a),r=DayPilot.indexOf(x.selected,e)!==-1,s=r?"deselected":"selected";switch(c.rowSelectHandling){case"PostBack":c.rowSelectPostBack(o,s);break;case"CallBack":c.rowSelectCallBack(o,s);break;case"Notify":c.rowSelectNotify(o,s);break;case"JavaScript":c.onRowSelect(o,s)}}},this.rowSelectPostBack=function(e,t,i){var n={};n.resource=e,n.change=t,this.D("RowSelect",n,i)},this.rowSelectCallBack=function(e,t,i){var n={};n.resource=e,n.change=t,this.F("RowSelect",n,i)},this.rowSelectNotify=function(e,t,i){var n={};n.resource=e,n.change=t,this.F("RowSelect",n,i,"Notify")},this.rows={},this.rows.selection={};var k=this.rows.selection;k.get=function(){var e=[];return DayPilot.list(x.selected).each(function(t){e.push(c.zh(t))}),e},k.clear=function(){x.clearSelection()},k.add=function(e){if(!e||!e.isRow)throw"DayPilot.Scheduler.rows.selection.add(): DayPilot.Row object expected";DayPilot.list(x.selected).some(function(t){return t===e.$.row})||x.selected.push(e.$.row),x.Aj(),k.Bj()},k.remove=function(e){if(!e||!e.isRow)throw"DayPilot.Scheduler.rows.selection.remove(): DayPilot.Row object expected";k.isSelected(e)&&(x.unselect(e.$.row),DayPilot.rfa(x.selected,e.$.row)),k.Bj()},k.isSelected=function(e){if(!e||!e.isRow)throw"DayPilot.Scheduler.rows.selection.isSelected(): DayPilot.Row object expected";return DayPilot.indexOf(x.selected,e.$.row)!==-1},k.Bj=function(){c.selectedRows=DayPilot.list(x.selected).map(function(e){return e.id})},this.rows.all=function(){for(var e=[],t=0;t0&&t.push(a.index)}if(0!==t.length)if(1===t.length)c.Fi(t[0]);else{for(var n=0;n-1)){var t=c.kg(x.zj.row.id);t?(e=DayPilot.indexOf(c.rowlist,t),x.zj={"row":t,"index":e}):x.rowSelectLastSetDefault()}},x.createOverlay=function(e){var t=c.$i(),i=c.p("_rowmove_source"),n=DayPilot.Util.div(c.divHeader,0,e.top,t,e.height);n.className=i,e.moveOverlay=n},x.deleteOverlay=function(e){DayPilot.de(e.moveOverlay),e.moveOverlay=null},x.Ij=function(e){var t=x.Jj(e),i=t.cells[0];if(i.input)return i.input;DayPilot.Areas.disable(i.firstChild);var n=i.clientWidth;e.isNewRow&&(n=c.vg());var o=document.createElement("textarea");o.style.position="absolute",o.style.top="0px",o.style.left="0px",o.style.width=n+"px",o.style.height=e.height+"px",o.style.border="0px none",o.style.overflow="hidden",o.style.boxSizing="border-box",o.style.resize="none",o.style.paddingLeft=e.level*c.treeIndent+"px";var r=i.textDiv;o.style.fontFamily=DayPilot.gs(r,"fontFamily")||DayPilot.gs(r,"font-family"),o.style.fontSize=DayPilot.gs(r,"fontSize")||DayPilot.gs(r,"font-size"),o.value=e.name||"",i.firstChild.appendChild(o),i.input=o;var s=function(){try{i.input.parentNode.removeChild(i.input)}catch(e){a()}i.input=null};return o.focus(),o.onblur=function(){o.onblur=null;var t=o.value;s(),DayPilot.Areas.enable(i.firstChild),c.Bh(e,t,o.canceled)},o.onkeydown=function(e){var t=window.event?event.keyCode:e.keyCode;return 27===t&&(o.canceled=!0,s()),13!==t||(o.onblur(),!1)},o.setSelectionRange?o.setSelectionRange(0,9999):o.select(),o},x.selected=[],x.select=function(e,t,i,n){var a=DayPilot.indexOf(x.selected,e)!==-1;if(t||n){if(a)return x.unselect(e),void DayPilot.rfa(x.selected,e)}else a=!1,x.clearSelection();x.Kj(e),a||x.selected.push(e),k.Bj()},x.selectRange=function(e,t){x.clearSelection();for(var i=Math.min(e,t),n=Math.max(e,t),a=i;a<=n;a++){var o=c.rowlist[a];x.Kj(o),x.selected.push(o)}k.Bj()},x.Aj=function(){for(var e=0;e0){var a=C.findInArray(n.children,t);if(a)return a}}return null},this.Qf=function(){this.rowlist=DayPilot.list();var e=this.resources,t=this.q();t||("Gantt"===this.viewType?e=this.Lj():"Days"===this.viewType&&(e=this.Mj())),!t||"Days"!==this.viewType||e&&0!==e.length||(e=this.Mj());var i={};if(i.i=0,null!=e&&!DayPilot.isArray(e))throw"DayPilot.Scheduler.resources expects an array object";this.Nj(e,i,0,null,this.treeEnabled,!1),"Disabled"!==c.rowCreateHandling&&this.Oj()},this.Oj=function(){var e={};e.id="NEW",e.isNewRow=!0,e.html="",e.loaded=!0,e.start=this.startDate,e.children=[],e.height=c.eventHeight,e.marginBottom=0,e.marginTop=0,e.getHeight=function(){return c.rowCreateHeight?c.rowCreateHeight:c.eventHeight+c.rowMarginBottom+c.rowMarginTop},e.putIntoLine=function(){},e.resetEvents=function(){},this.rowlist.push(e)},this.Lj=function(){var e=[];if(this.Gf&&this.resources)for(var t=0;t0?this.itline[0].start:this.startDate},this.Ig=function(){if(this.itline&&this.itline.length>0){var e=c.itline[this.itline.length-1].end;return"Days"!==c.viewType?e:e.addDays(c.days-1)}return c.startDate.addDays(c.days)},this.Pj={};this.Pj;this.visibleStart=function(){return this.Aa()},this.visibleEnd=function(){return this.Ig()},this.Fj=function(e,t){var i={};if(i.backColor=e.backColor,i.cssClass=e.cssClass,i.expanded=e.expanded,i.name=e.name,i.html=e.html?e.html:i.name,i.eventHeight="undefined"!=typeof e.eventHeight?e.eventHeight:c.Nb.eventHeight(),i.minHeight="undefined"!=typeof e.minHeight?e.minHeight:c.rowMinHeight,i.marginBottom="undefined"!=typeof e.marginBottom?e.marginBottom:c.rowMarginBottom,i.marginTop="undefined"!=typeof e.marginTop?e.marginTop:c.rowMarginTop,i.eventStackingLineHeight="undefined"!=typeof e.eventStackingLineHeight?e.eventStackingLineHeight:c.eventStackingLineHeight,i.loaded=!e.dynamicChildren,i.id=e.id||e.value,i.toolTip=e.toolTip,i.children=[],i.columns=[],i.start=e.start?new DayPilot.Date(e.start):this.Aa(),i.isParent=e.isParent,i.contextMenu=e.contextMenu?DayPilot.Util.evalVariable(e.contextMenu):this.contextMenuResource,i.areas=e.areas,i.moveDisabled=e.moveDisabled,i.bubbleHtml=e.bubbleHtml,i.tags=e.tags,i.task=e.task,i.swimlane=e.swimlane,i.hideEvents=e.hideEvents,i.height=i.eventHeight,i.resource=e.Qj,i.lines=[],i.blocks=[],i.isRow=!0,i.getHeight=function(){var e=0;if(c.groupConcurrentEvents)for(var t=0;t0){var n=this.lines.length-1,a=this.lines[n],o=a.height||this.eventHeight,r=a.top||0;e=r+o}return 0===e&&(e=this.eventHeight),e>this.minHeight?e:this.minHeight},i.resetEvents=function(){var e=this;e.events=[],e.events.forRange=function(t,i){for(var n=[],a=0;at&&(t=a)}return t},i},n}for(var i=this,n=i.sections=t(),a=0;ai.height&&(i.height=t)},i.isFree=function(e,t,i){for(var n=e+t-1,a=this.length,o=0;or.part.left+r.part.width-1)){if(DayPilot.contains(i,r.data))continue;return!1}}return!0},i.add(e),this.lines.push(i),this.lines.length-1},i.putIntoBlock=function(e){for(var t=0;ti.height&&(i.height=e.part.height)},i.isFree=function(e,t){for(var i=e+t-1,n=this.length,a=0;ao.part.left+o.part.width-1))return!1}return!0},i.add(e),this.lines.push(i)},i.overlapsWith=function(e,t){return!(e+t-1this.max-1)},i.getHeight=function(){if(!this.expanded)return c.eventHeight;if(this.lines.length>0){var e=this.lines.length-1,t=this.lines[e],i=t.height||c.eventHeight;return(t.top||0)+i}return c.eventHeight},i.clear=function(){i.events=[],i.min=null,i.max=null},i.events.push(e),e.part.block=i,i.min=e.part.left,i.max=e.part.left+e.part.width,this.blocks.push(i)},i.Rj=!1,i.Sj=t,i.Tj=function(){this.hidden=!this.Uj(),this.Rj=!1,this.Sj&&this.Sj.Tj()},i.Uj=function(){return!this.Sj||this.Sj.Uj()&&this.Sj.expanded},e.columns)for(var n=0;n0){r.columns=[];for(var i=0;i0){i.columns=[];for(var a=0;a0,v=function(){for(var e=i.i,t=a.level;e>=0;){var n=c.rowlist[e];if(e--,!(t<=n.level)){if(n===s.row)return!0;if(0===n.level)return!1;t=n.level}}return!1}(),p=c.treeEnabled;u=v||i.i===s.row.index?"forbidden":p?f?o1){var r=o.cells[0];t(r,e)}else if(this.rowHeaderCols)for(var s=0,l=0;l0){var i=document.createElement("div");i.style.position="absolute",i.style.top="0px",i.style.left="0px",i.style.right="0px",i.style.bottom=_.headerHeight()+1+"px",e.appendChild(i);var n=document.createElement("div");n.style.position="absolute",n.style.left="0px",n.style.right="0px",n.style.height="1px",n.style.bottom=_.headerHeight()+"px",n.className=this.p("_divider"),e.appendChild(n),i.appendChild(t),this.bk()}else e.appendChild(t);var a=document.createElement("div");a.style.position="absolute",a.style.padding="2px",a.style.top="0px",a.style.left="1px",a.style.backgroundColor="#FF6600",a.style.color="white",a.innerHTML="\u0044\u0045\u004D\u004F",DayPilot.Util.isNullOrUndefined(undefined)&&e.appendChild(a)},this._j=function(){if(this.rowHeaderHideIconEnabled){var e=3,t=this.vg()+_.splitterWidth()-1,i=10,n=20,a=this.ed()+e,o=DayPilot.Util.div(this.nav.top,t,a,i,n);o.style.cursor="pointer",o.className=c.p("_header_icon"),DayPilot.Util.addClass(o,c.p("_header_icon_hide")),o.onclick=function(){c.rows.headerToggle()},this.nav.hideIcon=o}},this.gh=function(){c.nav.hideIcon&&(c.rowlist.length>0?c.nav.hideIcon.style.display="":c.nav.hideIcon.style.display="none")},this.oc=function(){var e=this.vg(),t=document.createElement("div");return c.nav.corner=t,t.style.width=e+"px",t.style.height=this.ed()+"px",t.style.overflow="hidden",t.style.position="relative",t.setAttribute("unselectable","on"),t.onmousemove=function(){c.R()},t.oncontextmenu=function(){return!1},this.fh(),t},this.ed=function(){if(c.timeHeaders){var e=R.timeHeader(c.timeHeaders.length-1);return e.top+e.height}return this.timeHeader?c.timeHeader.length*_.headerHeight():0},this.ck=null,this.dk=function(){return c.scrollStep||c.eventHeight},this.Xj=function(){var e=document.createElement("div");e.style.width=this.vg()+"px",e.style.height=this.Wb()+"px",e.style.overflow="hidden",e.style.position="relative",e.className=c.p("_rowheader_scroll");var t=c.dk(),i=navigator.userAgent.indexOf("Mobile")!==-1;return i&&(e.style.overflowY="auto"),e.onmousemove=function(){c.R()},e.onscroll=function(){if(c.nav.columnScroll&&c.rowHeaderScrolling&&(c.nav.columnScroll.scrollLeft=e.scrollLeft),c.ck&&clearTimeout(c.ck),i){var t=c.dd()-c.nav.scroll.offsetHeight;e.scrollTop=Math.min(e.scrollTop,t),c.nav.scroll.scrollTop=e.scrollTop}else c.ck=setTimeout(function(){c.nav.scroll.scrollTop=e.scrollTop},500)},e.addEventListener("wheel",function(i){var n;n=c.overrideWheelScrolling?i.deltaY>0?t:-t:i.deltaY,c.nav.scroll.scrollTop=e.scrollTop+n,i.preventDefault&&i.preventDefault()},!1),e.oncontextmenu=function(){return!1},e.onmouseenter=function(){c.rowHeaderScrolling&&(e.style.overflowX="auto")},e.onmouseleave=function(){c.rowHeaderScrolling&&(e.style.overflowX="hidden")},this.divResScroll=e,this.yg=e,e},this.ek=function(e){if("TableBased"===_.layout()){var t=parseInt(this.width,10),i=isNaN(t)||this.width.indexOf("%")!==-1,n=(/MSIE/i.test(navigator.userAgent),this.$i());i?this.nav.top&&this.nav.top.offsetWidth>0&&(e.style.width=this.nav.top.offsetWidth-6-n+"px"):e.style.width=t-n+"px"}},this.be=function(e){c.Uf(),c.dg()},this.Uf=function(){"TableBased"===c.Nb.layout()&&(c.ek(c.nav.scroll),c.ek(c.divTimeScroll)),c.ia(),c.ej(),c.fk(),c.s.drawArea=null},this.gk=null,this.hk=null,this.ik=function(){this.watchWidthChanges&&(this.hk||(this.hk=setInterval(function(){c.gk||(c.gk={},c.gk.counter=0,c.gk.changed=!1,c.gk.width=c.nav.top.offsetWidth),c.gk.width!==c.nav.top.offsetWidth&&(c.gk.changed=!0,c.gk.counter=0,c.gk.width=c.nav.top.offsetWidth),c.gk.changed&&(c.gk.counter+=1),c.gk.changed&&c.gk.counter>2&&(c.gk.changed=!1,c.Uf(),c.dg())},20)))},this.fk=function(){var e=c.rangeHold;c.clearSelection(),c.rangeHold=e,c.vh(e,!0)},this.ej=function(){c.z&&"Auto"===c.cellWidthSpec&&(c.Of(),c.Pf(),c.Sf(),c.Wf(),c.Zf(),c.Xf(),c.$f(),c.L(),c.aa(),c.na(),c.ia())},this.Of=function(){if("Auto"===this.cellWidthSpec){var e=this.nav.top.clientWidth,t=this.vg(),i=c.jk(),n=e-t-i;if(this.Ii()){var a=n/this.Ii();this.cellWidth=Math.max(a,c.cellWidthMin),c.xg=ac.height?DayPilot.sw(c.nav.scroll):0}return DayPilot.sw(c.nav.scroll)},this.Bg=function(){var e=this.nav.top.clientWidth,t=this.vg(),i=this.Wb(),n=this.dd(),a="Auto"===c.heightSpec,o=0;return n>i&&!a&&(o=DayPilot.swa()),e-t-2-o},this.Zj=function(){var e=document.createElement("div");e.style.overflow="hidden",e.style.position="absolute",e.style.display="block",e.style.top="0px",e.style.width="100%",e.style.height=this.ed()+"px",e.style.overflow="hidden",e.onmousemove=function(){c.R(),c.cellBubble&&c.cellBubble.delayedHide()},this.ek(e),this.divTimeScroll=e;var t=document.createElement("div");return t.style.width=this.Ii()*this.cellWidth+5e3+"px",this.divNorth=t,e.appendChild(t),e},this.Wb=function(){var e=0,t=c.heightSpec;return"Fixed"===t||"Parent100Pct"===t?this.height?this.height:0:(e=c.dd(),("Max"===t||"Max100Pct"===t)&&e>c.height?c.height:e)},this.kk=null,this.lk=0,this.mk=0,this.nk=0,this.zg=function(){if("function"==typeof c.onHeightChanged||"function"==typeof c.onDimensionsChanged){c.kk&&clearTimeout(c.kk);var e=function(){var e=c.nav.top.offsetHeight,t=c.lk;c.lk=e;var i=c.nav.top.offsetWidth,n=c.mk;c.mk=i;var a=c.vg(),o=c.nk;if(c.nk=a,"function"==typeof c.onHeightChanged&&e!==t){var r={};r.oldHeight=t,r.newHeight=e,c.onHeightChanged(r)}if("function"==typeof c.onDimensionsChanged&&(e!==t||i!==n||a!==o)){var r={};r.oldHeight=t,r.newHeight=e,r.oldWidth=n,r.newWidth=i,r.oldRowHeaderWidth=o,r.newRowHeaderWidth=a,c.onDimensionsChanged(r)}};c.kk=setTimeout(e,100)}},this.dd=function(){var e;return this.Lf!==-1?(e=this.Lf,this.Lf>0&&"auto"===c.nav.scroll.style.overflowX&&(e+=DayPilot.sh(c.nav.scroll))):e=this.rowlist.length*this.Nb.eventHeight(),e},this.R=function(){this.S(),this.ok(),this.pk()},this.$j=function(){var e=document.createElement("div");if(e.style.overflow="auto",e.style.overflowX="auto",e.style.overflowY="auto",e.style.position="absolute",e.style.height=this.Wb()+"px",e.style.top=this.ed()+1+"px",e.style.width="100%",e.className=this.p("_scrollable"),e.oncontextmenu=function(){return!1},this.ek(e),c.overrideWheelScrolling){var t=c.scrollStep;e.onwheel=function(i){var n=i.deltaY>0?t:-t;c.nav.scroll.scrollTop=e.scrollTop+n,i.preventDefault&&i.preventDefault()},e.onmousewheel=function(i){i=i||window.event;var n=i.wheelDelta<0?t:-t;c.nav.scroll.scrollTop=e.scrollTop+n,i.preventDefault&&i.preventDefault(),i.returnValue=!1}}this.nav.scroll=e,this.hg=document.createElement("div"),this.hg.style.MozUserSelect="none",this.hg.style.KhtmlUserSelect="none",this.hg.style.webkitUserSelect="none",this.hg.daypilotMainD=!0,this.hg.calendar=this,i&&(this.hg.style.webkitTransform="translateZ(0px)"),this.hg.style.position="absolute";var n=this.tg();return n>0&&!isNaN(n)&&(this.hg.style.width=n+"px"),this.hg.setAttribute("unselectable","on"),this.hg.onmousedown=this.qk,this.hg.onmousemove=this.Zi,this.hg.onmouseup=this.rk,this.hg.oncontextmenu=this.sk,this.hg.ondblclick=this.tk,this.hg.className=this.p("_matrix"),this.divStretch=document.createElement("div"),this.divStretch.style.position="absolute",this.divStretch.style.height="1px",this.hg.appendChild(this.divStretch),this.divCells=document.createElement("div"),this.divCells.style.position="absolute",this.divCells.oncontextmenu=this.sk,this.hg.appendChild(this.divCells),this.divLines=document.createElement("div"),this.divLines.style.position="absolute",this.divLines.oncontextmenu=this.sk,this.hg.appendChild(this.divLines),this.divBreaks=document.createElement("div"),this.divBreaks.style.position="absolute",this.divBreaks.oncontextmenu=this.sk,this.hg.appendChild(this.divBreaks),this.divSeparators=document.createElement("div"),this.divSeparators.style.position="absolute",this.divSeparators.oncontextmenu=this.sk,this.hg.appendChild(this.divSeparators),this.divLinksBelow=document.createElement("div"),this.divLinksBelow.style.position="absolute",this.hg.appendChild(this.divLinksBelow),this.divCrosshair=document.createElement("div"),this.divCrosshair.style.position="absolute",this.divCrosshair.ondblclick=this.tk,this.hg.appendChild(this.divCrosshair),this.divRange=document.createElement("div"),this.divRange.style.position="absolute",this.divRange.oncontextmenu=this.sk,this.hg.appendChild(this.divRange),this.divEvents=document.createElement("div"),this.divEvents.style.position="absolute",this.hg.appendChild(this.divEvents),this.divSeparatorsAbove=document.createElement("div"),this.divSeparatorsAbove.style.position="absolute",this.divSeparatorsAbove.oncontextmenu=this.sk,this.hg.appendChild(this.divSeparatorsAbove),this.divLinksAbove=document.createElement("div"),this.divLinksAbove.style.position="absolute",this.hg.appendChild(this.divLinksAbove),this.divLinkShadow=document.createElement("div"),this.divLinkShadow.style.position="absolute",this.hg.appendChild(this.divLinkShadow),this.divLinkpoints=document.createElement("div"),this.divLinkpoints.style.position="absolute",this.hg.appendChild(this.divLinkpoints),this.divRectangle=document.createElement("div"),this.divRectangle.style.position="absolute",this.hg.appendChild(this.divRectangle),this.divHover=document.createElement("div"),this.divHover.style.position="absolute",this.hg.appendChild(this.divHover),e.appendChild(this.hg),e},this.uk={};var P=this.uk;P.create=function(){if(!c.nav.overlay){var e=document.createElement("div");e.style.position="absolute",e.style.left="0px",e.style.right="0px",e.style.top="0px",e.style.bottom="0px",e.className=c.p("_block"),c.nav.top.appendChild(e),c.nav.overlay=e}},P.show=function(){P.create(),c.nav.overlay.style.display=""},P.hide=function(){c.nav.overlay&&(c.nav.overlay.style.display="none")},this.G=function(e){c.loadingTimeout&&window.clearTimeout(c.loadingTimeout);var t=e?0:100;c.loadingTimeout=window.setTimeout(function(){c.loadingLabelVisible&&(c.nav.loading.innerHTML=c.loadingLabelText,c.nav.loading.style.display=""),c.blockOnCallBack&&P.show()},t)},this.W=function(){this.loadingTimeout&&window.clearTimeout(this.loadingTimeout),this.nav.loading.style.display="none",this.blockOnCallBack&&P.hide()},this.uiBlock=function(){P.show()},this.uiUnblock=function(){P.hide()},this.Zc=function(){this.startDate=new DayPilot.Date(this.startDate).getDatePart()},this.ad=function(e){var t=document.createElement("div");t.style.position="absolute",t.style.top="-2000px",t.style.left="-2000px",t.className=this.p(e),document.body.appendChild(t);var i=t.offsetHeight,n=t.offsetWidth;document.body.removeChild(t);var a={};return a.height=i,a.width=n,a},this.qa=function(e){if(e&&(this.autoRefreshEnabled=!0),this.autoRefreshEnabled&&!(this.A>=this.autoRefreshMaxCount)){this.K();var t=this.autoRefreshInterval;if(!t||t<10)throw"The minimum autoRefreshInterval is 10 seconds";this.autoRefreshTimeout=window.setTimeout(function(){c.Kc()},1e3*this.autoRefreshInterval)}},this.K=function(){this.autoRefreshTimeout&&(window.clearTimeout(this.autoRefreshTimeout),this.autoRefreshTimeout=null)},this.autoRefreshStart=function(e){c.qa(e)},this.autoRefreshPause=function(){c.K()},this.vk=function(){return!(n.resizing||n.moving||n.drag||n.range)},this.Kc=function(){if(c.vk()){var e=!1;if("function"==typeof this.onAutoRefresh){var t={};t.i=this.A,t.preventDefault=function(){this.preventDefault.value=!0},c.onAutoRefresh(t),t.preventDefault.value&&(e=!0)}!e&&this.q()&&this.commandCallBack(this.autoRefreshCommand),this.A++}this.Aa.height&&(a.height=s),r.part.top=i+e.marginTop,c.eventVersionsEnabled&&!DayPilot.list(r.data.versions).isEmpty()){var l=(r.data.versions.length,r.part.top);DayPilot.list(r.data.versions).each(function(e,t){if(r.versions[t]){var i=t*(c.eventVersionHeight+c.eventVersionMargin);r.versions[t].top=l+i,r.part.top+=c.eventVersionHeight,r.part.top+=c.eventVersionMargin}})}r.part.top+=c.eventMarginBottom,r.part.detachedBarTop=r.part.top-t,r.part.right=r.part.left+r.part.width,r.part.fullTop=this.rowlist[r.part.dayIndex].top+r.part.top,r.part.fullBottom=r.part.fullTop+r.part.height}}i+=(a.height||e.eventHeight)*e.eventStackingLineHeight/100}};var S={};S.loadRow=function(e){e.evColumns=DayPilot.list(c.itline).map(function(e,t){return{"events":DayPilot.list()}}),DayPilot.list(e.events).each(function(t){var i=t.start(),n=c.Og(i);e.evColumns[n.i].events.push(t)})},S.calculateEventPositions=function(){var e=c.cellStackingAutoHeight,t=0;DayPilot.list(c.rowlist).each(function(i){var n=0;i.evColumns.each(function(t,a){var o=c.itline[a],r=c.rowMarginTop;t.events.each(function(t){t.part.left=o.left,t.part.width=o.width,t.part.top=r,t.part.height||(e?t.part.height=S.getEventAutoHeight(t)+c.durationBarHeight:t.part.height=i.eventHeight),r+=t.part.height+c.eventMarginBottom}),t.height=r,t.height>n&&(n=t.height)}),i.maxColumnHeight=n,i.top=t;var a=i.height;i.height=i.getHeight(),n>c.rowMarginTop&&(i.height=n+c.rowMarginBottom),a!==i.height&&(c.jh=!0),t+=i.height}),c.Lf=t},S.getEventAutoHeight=function(e){var t=e.client.html(),i=document.createElement("div");i.style.position="absolute",i.style.top="-2000px",i.style.left="-2000px",i.style.width=e.part.width+"px",i.className=c.p(M.event);var n=document.createElement("div");n.className=c.p(M.eventInner),n.innerHTML=t,n.style.position="static",n.style.overflow="auto",i.appendChild(n);var a=c.divEvents;a.appendChild(i);var o=i.offsetHeight;return a.removeChild(i),o},S.calculateEventPositionsRow=function(e){S.calculateEventPositions()},S.drawEventsWithoutCheckingOverflow=function(){DayPilot.list(c.rowlist).each(function(e){S.drawEventsRow(e)})},S.drawEvents=function(){S.drawEventsWithoutCheckingOverflow(),S.checkOverflow(),c.Vf(),c.ia()},S.checkOverflow=function(){if(c.cellStackingAutoHeight){var e=!1;DayPilot.list(c.elements.events).each(function(t){var i=t.firstChild,n=i.offsetHeight-i.clientHeight+t.offsetHeight-t.clientHeight,a=i.scrollHeight+n,o=t.event.part.height;t.event.part.height=a,o!==a&&(e=!0)}),e&&(c.L(),S.calculateEventPositions(),S.drawEventsWithoutCheckingOverflow(),c.Wf(),c.Zf())}},S.drawEventsRow=function(e){e.evColumns.each(function(e,t){e.events.each(function(e){c.Ob(e)})})},this.na=function(e){if(!c.Ff){if(c.cellStacking)return void S.drawEvents();var t=this.xk.step;this.xk.layers&&(c.divEvents=document.createElement("div"),c.divEvents.style.position="absolute",c.hg.insertBefore(this.divEvents,this.divSeparatorsAbove)),"display"===this.xk.mode?this.divEvents.style.display="none":"visibility"===this.xk.mode&&(this.divEvents.style.visibility="hidden");for(var i="Progressive"===this.dynamicEventRendering,n=this.mg(),a=n.pixels.top,o=n.pixels.bottom,r=0;r=d)){this.Mi(s);for(var h=0;h=0;n--)this.elements.events.splice(i[n],1)}},this.fi=function(e){e.onclick=null,e.oncontextmenu=null,e.onmouseover=null,e.onmouseout=null,e.onmousemove=null,e.onmousedown=null,e.ondblclick=null,e.event&&(e.isBar||(e.event.rendered=null),e.event=null),e.related&&DayPilot.de(e.related),e.parentNode&&e.parentNode.removeChild(e)},this.yk=function(e){e.event&&(e.event.rendered=!1),e.onclick=null,e.onmousedown=null,e.event=null,e.parentNode&&e.parentNode.removeChild(e)},this.zk=function(e){if(e||(e=0),"Progressive"===this.dynamicEventRendering){this.divEvents.style.display="none";for(var t=[],i=0,n=this.elements.events.length,a=n-1;a>=0;a--){var o=this.elements.events[a];this.Ak(o.event)?e>0?(e--,t.unshift(o)):(this.fi(o),i++):t.unshift(o)}this.elements.events=t,this.divEvents.style.display=""}},this.Bk=function(e){for(var t=[],i=0,n=this.mg(),a=this.elements.cells.length,o=a-1;o>=0;o--){var r=this.elements.cells[o];n.xStart0?(e--,t.unshift(r)):(this.ki(r),i++)}},this.ki=function(e){if(e){var t=e.coords.x,i=e.coords.y;DayPilot.rfa(c.elements.cells,e),DayPilot.de(e),c.s.cells[t+"_"+i]=null}},this.Xf=function(){if(this.elements.separators)for(var e=0;e=r))for(var s=0;s=o)},this.Ak=function(e){if(!e.rendered)return!0;var t=this.mg(),i=t.pixels.top,n=t.pixels.bottom,a=t.pixels.left-this.dynamicEventRenderingMargin,o=t.pixels.right+this.dynamicEventRenderingMargin,r=e.part.left,s=e.part.right,l=e.part.fullTop,d=e.part.fullBottom;return o<=r||a>=s||(n<=l||i>=d)},this.wj=DayPilot.list(),this.Ek=function(e){if(e.rendered)return!1;if(e.row.hidden)return!1;var t=e.min,i=e.max-e.min,n=c.eventHeight,a=e.row.top,o=document.createElement("div");o.style.position="absolute",o.style.left=t+"px",o.style.top=a+"px",o.style.width=i+"px",o.style.height=n+"px",o.className=c.p("_event_group"),o.style.cursor="pointer";var r={};r.group={},r.group.count=e.events.length,r.group.html="[+] "+e.events.length+" events","function"==typeof c.onBeforeGroupRender&&c.onBeforeGroupRender(r);var s=document.createElement("div");return s.innerHTML=r.group.html,o.appendChild(s),o.onmousedown=function(e){var e=e||window.event;e.cancelBubble=!0},o.onclick=function(e){var t=o.event;t.expanded=!0,c.yk(o);var i=DayPilot.indexOf(c.elements.events,o);i!==-1&&c.elements.events.splice(i,1);var n=c.wj;DayPilot.list(t.events).each(function(e){n.push(e.id())}),c.Wg(),c.Xg(t.part.dayIndex),c.ia();var e=e||window.event;e.cancelBubble=!0},e.part={},e.part.left=t,e.part.width=i,e.part.height=c.eventHeight,e.part.dayIndex=DayPilot.indexOf(c.rowlist,e.row),e.part.top=0,e.part.isBlock=!0,e.client={},e.client.html=function(){return r.group.html},e.data={},o.event=e,this.elements.events.push(o),this.divEvents.appendChild(o),e.rendered=!0,!0},this.Ob=function(e){if(e.rendered)return!1;if(c.groupConcurrentEvents){var t=e.part.block;if(t.events.length>1&&!t.expanded)return c.Ek(t)}var i="Progressive"===this.dynamicEventRendering,n=this.mg(),a=n.pixels.left-this.dynamicEventRenderingMargin,o=n.pixels.right+this.dynamicEventRenderingMargin,r=e.part.left,s=e.part.left+e.part.width;if(i&&(o<=r||a>=s))return!1;var l=e.part.dayIndex,d=e.part.width,h=e.part.height,u=e.cache||e.data;d=Math.max(0,d),h=Math.max(0,h);var f=this.rowlist[l];if(f.hidden)return!1;var v=f.top,p=this.durationBarDetached,g=document.createElement("div");if(g.related=[],p){var m=e.part.barLeft,y=e.part.barWidth;"PercentComplete"===this.durationBarMode&&(m=0,y=(u.complete||0)/100*d);var b=document.createElement("div");b.style.position="absolute",b.style.left=e.part.left+m+"px",b.style.top=v+e.part.detachedBarTop+"px",b.style.width=y+"px",b.style.height="5px",b.style.backgroundColor="black",b.type="detachedBar",g.related.push(b),this.divEvents.appendChild(b)}if(function(t){c.eventVersionsEnabled&&DayPilot.list(e.data.versions).each(function(i,n){if(i){var a=e.versions[n];if(a){var o=document.createElement("div");o.style.position="absolute",o.style.left=a.left+"px",o.style.top=v+a.top+"px",o.style.width=a.width+"px",o.style.height=c.eventVersionHeight+"px",o.className=c.p(M.event)+" "+c.p("_event_previous")+" "+c.p("_event_version"),i.toolTip&&(o.title=i.toolTip),i.cssClass&&DayPilot.Util.addClass(o,i.cssClass);var r=document.createElement("div");r.setAttribute("unselectable","on"),r.className=c.p(M.eventInner),r.innerHTML=i.html||i.text||"",i.backColor&&(r.style.background=i.backColor,(DayPilot.browser.ie9||DayPilot.browser.ielt9)&&(r.style.filter="")),i.fontColor&&(r.style.color=i.fontColor),i.borderColor&&(r.style.borderColor=i.borderColor),i.backImage&&(r.style.backgroundImage="url("+i.backImage+")",i.backRepeat&&(r.style.backgroundRepeat=i.backRepeat)),o.appendChild(r),a.continueLeft&&DayPilot.Util.addClass(o,c.p("_event_continueleft")),a.continueRight&&DayPilot.Util.addClass(o,c.p("_event_continueright"));var s=c.durationBarVisible&&!i.barHidden,l=a.width;if(s&&l>0){var d=100*a.barLeft/l,h=Math.ceil(100*a.barWidth/l);"PercentComplete"===c.durationBarMode&&(d=0,h=i.complete||0);var u=document.createElement("div");u.setAttribute("unselectable","on"),u.className=c.p(M.eventBar),u.style.position="absolute",i.barBackColor&&(u.style.backgroundColor=i.barBackColor);var f=document.createElement("div");f.setAttribute("unselectable","on"),f.className=c.p(M.eventBarInner),f.style.left=d+"%",00){var m=100*e.part.barLeft/d,y=Math.ceil(100*e.part.barWidth/d);"PercentComplete"===this.durationBarMode&&(m=0,y=u.complete||0);var b=document.createElement("div");b.setAttribute("unselectable","on"),b.className=this.p(M.eventBar),b.style.position="absolute",u.barBackColor&&(b.style.backgroundColor=u.barBackColor);var S=document.createElement("div");S.setAttribute("unselectable","on"),S.className=this.p(M.eventBarInner),S.style.left=m+"%",00&&(n=n.concat(o)),DayPilot.Areas.showAreas(t,t.event,null,n),DayPilot.Util.addClass(t,c.p("_event_hover")),c.Hk(t)}"Disabled"===c.linkCreateHandling||l.source||(v.clearHideTimeout(),v.hideLinkpoints(),c.vk()&&v.showLinkpoint(t)),e.srcElement?e.srcElement.insideEvent=!0:e.insideEvent=!0},this.Jk={};var A=this.Jk;this.Fk=function(e){ if(c.ionicEventClickFix){var t=A.originalMouse;if(t){var i=DayPilot.mc(e);t.x===i.x&&t.y===i.y&&(c.Ge.call(this,e),e.preventDefault(),e.stopPropagation())}}},this.Rb=function(e){if(c.R(),"undefined"!=typeof DayPilot.Bubble&&DayPilot.Bubble.hideActive(),e=e||window.event,DayPilot.Util.mouseButton(e).left){var t=e.shiftKey;if("Disabled"!==c.multiSelectRectangle&&t)return E.start(),!1;"w-resize"===this.style.cursor||"e-resize"===this.style.cursor?(n.preventEventClick=!0,n.resizing=this,n.resizingEvent=this.event,n.originalMouse=DayPilot.mc(e),document.body.style.cursor=this.style.cursor,v.hideLinkpoints()):("move"===this.style.cursor||"Full"===c.moveBy&&this.event.client.moveEnabled())&&(A.start=!0,A.moving=this,A.movingEvent=this.event,A.originalMouse=DayPilot.mc(e),A.moveOffsetX=DayPilot.mo3(this,e).x,A.moveDragStart=c.getDate(c.coords.x,!0),v.hideLinkpoints())}return DayPilot.Menu&&DayPilot.Menu.active&&DayPilot.Menu.active.hide(),e.cancelBubble=!0,!1},this.Sb={};var T=c.Sb;T.active=!1,T.start=!1,T.timeouts=[],T.onEventTouchStart=function(e){if(!T.active&&!T.start){e.stopPropagation(),T.clearTimeouts(),T.start=!0,T.active=!1;var i=this,n=c.tapAndHoldTimeout;T.timeouts.push(window.setTimeout(function(){T.active=!0,T.start=!1,c.coords=T.relativeCoords(e),e.preventDefault();var n=i.event;switch(c.eventTapAndHoldHandling){case"Move":if(n.client.moveEnabled()){var a=t(e);T.startMoving(i,a)}break;case"ContextMenu":DayPilot.Menu&&DayPilot.Menu.touchPosition(e);var o=n.client.contextMenu();o?o.show(n):c.contextMenu&&c.contextMenu.show(n)}},n))}},T.onEventTouchMove=function(e){T.clearTimeouts(),T.start=!1},T.onEventTouchEnd=function(e){if(!DayPilot.Util.isMouseEvent(e)){if(T.clearTimeouts(),T.start){T.start=!1,e.preventDefault(),e.stopPropagation();var t=this;window.setTimeout(function(){c.Ga(t,e)})}window.setTimeout(function(){T.start=!1,T.active=!1},500)}},T.onMainTouchStart=function(e){if(!(T.active||T.start||e.touches.length>1||"Disabled"===c.timeRangeSelectedHandling)){T.clearTimeouts(),T.start=!0,T.active=!1;var t=c.tapAndHoldTimeout;T.timeouts.push(window.setTimeout(function(){T.active=!0,T.start=!1,e.preventDefault(),c.coords=T.relativeCoords(e),T.range=c.Kk()},t));c.coords=T.relativeCoords(e)}},T.onMainTouchMove=function(e){if(T.clearTimeouts(),T.start=!1,n.resizing)return e.preventDefault(),void T.updateResizing();if(T.active){if(e.preventDefault(),c.coords=T.relativeCoords(e),n.moving)return void T.updateMoving();if(T.range){var t=T.range;t.end={x:Math.floor(c.coords.x/c.cellWidth)},c.vh(t)}}},T.onMainTouchEnd=function(e){T.clearTimeouts();if(T.active){if(n.moving){e.preventDefault();var t=n.movingEvent,i=n.movingShadow.start,a=n.movingShadow.end,o="Days"!==c.viewType?n.movingShadow.row.id:null,r=!!n.drag,s=n.movingShadow.overlapping,l=!n.movingShadow.allowed;if(DayPilot.Util.removeClass(n.moving,c.p("_event_moving_source")),DayPilot.de(n.movingShadow),c.Yi(),n.movingShadow.calendar=null,document.body.style.cursor="",n.moving=null,n.movingEvent=null,n.movingShadow=null,c.Ti.clear(),s||l||c.Ti.forbidden||c.Ti.invalid)return;c.Ta(t,i,a,o,r)}if(T.range){var d=T.range;T.range=null;var h=c.elements.range2;h&&h.overlapping?c.clearSelection():c.qh(d)}}else if(T.start){if(c.coords.xi.start.x?i.start.x:i.end.x,r=i.end.x>i.start.x?i.end.x:i.start.x,s=0;s=t.start.getTime()-this.Aa().getTime();var l=this.itline[o].start.addTime(s),d=this.itline[r].end.addTime(s);return new DayPilot.Selection(l,d,a,c)},this.rb=function(e){var t=e.parentNode,i=c.eventEditMinWidth,n=document.createElement("textarea");return n.style.position="absolute",n.style.width=(e.offsetWidth0&&(this.divStretch.style.width=o+"px")}},this.Kg=function(e,t){var i=null,n=this.Nb.locale(),t=t||this.cellGroupBy,a=e.start;e.end;switch(t){case"Hour":i="Clock12Hours"===c.Nb.timeFormat()?a.toString("h tt",n):a.toString("H",n);break;case"Day":i=a.toString(n.datePattern);break;case"Week":i=1===_.weekStarts()?a.weekNumberISO():a.weekNumber();break;case"Month":i=a.toString("MMMM yyyy",n);break;case"Quarter":i="Q"+Math.floor(a.getMonth()/3+1);break;case"Year":i=a.toString("yyyy");break;case"None":i="";break;case"Cell":var o=(e.end.ticks-e.start.ticks)/6e4;i=this.Ok(a,o);break;default:throw"Invalid cellGroupBy value"}return i},this.Ok=function(e,t){var i=this.Nb.locale(),t=t||this.cellDuration;return t<60?e.toString("mm"):t<1440?"Clock12Hours"===c.Nb.timeFormat()?e.toString("h tt",i):e.toString("H",i):t<10080?e.toString("d"):10080===t?1===_.weekStarts()?e.weekNumberISO():e.weekNumber():e.toString("MMMM yyyy",i)},this.Gg=function(e){var t=this.scale;switch(t){case"Cell":throw"Invalid scale: Cell";case"Manual":throw"Internal error (addScaleSize in Manual mode)";case"Minute":return e.addMinutes(1);case"CellDuration":return e.addMinutes(this.cellDuration);default:return this.Jg(e,t)}},this.Jg=function(e,t){var i,n="Days"!==this.viewType?this.days:1,a=this.startDate.addDays(n);"Manual"===c.scale&&(a=c.Ig());var t=t||this.cellGroupBy,o=60;switch(t){case"Hour":e.getHours()+e.getMinutes()+e.getSeconds()+e.getMilliseconds()>0&&(e=e.getDatePart().addHours(e.getHours())),i=e.addHours(1);break;case"Day":i=e.getDatePart().addDays(1);break;case"Week":for(i=e.getDatePart().addDays(1);i.dayOfWeek()!==_.weekStarts();)i=i.addDays(1);break;case"Month":i=e.addMonths(1),i=i.firstDayOfMonth();for(var r=DayPilot.DateUtil.diff(i,e)/6e4%o===0;!r;)i=i.addHours(1),r=DayPilot.DateUtil.diff(i,e)/6e4%o===0;break;case"Quarter":for(i=e.addMonths(1),i=i.firstDayOfMonth();i.getMonth()%3;)i=i.addMonths(1);for(var r=DayPilot.DateUtil.diff(i,e)/6e4%o===0;!r;)i=i.addHours(1),r=DayPilot.DateUtil.diff(i,e)/6e4%o===0;break;case"Year":i=e.addYears(1),i=i.firstDayOfYear();for(var r=DayPilot.DateUtil.diff(i,e)/6e4%o===0;!r;)i=i.addHours(1),r=DayPilot.DateUtil.diff(i,e)/6e4%o===0;break;case"None":i=a;break;case"Cell":var s=this.Og(e);i=s.current?s.current.end:s.past?s.previous.end:s.next.start;break;default:throw"Invalid cellGroupBy value"}return i.getTime()>a.getTime()&&(i=a),i},this.Pk={},this.Pk.timeheadercol="_timeheadercol",this.Pk.timeheadercolInner="_timeheadercol_inner",this.Pk.resourcedivider="_resourcedivider",this.Pk.eventFloat="_event_float",this.Pk.eventFloatInner="_event_float_inner",this.Pk.event="_event",this.Pk.eventInner="_event_inner",this.Pk.eventBar="_event_bar",this.Pk.eventBarInner="_event_bar_inner",this.Pk.eventDelete="_event_delete",this.Pk.eventLine="_event_line",this.Pk.eventMovingSource="_event_moving_source";var M=this.Pk;this.Nk=function(e,t){var i=this.nav.timeHeader,n=this.timeHeader[t][e],a=t=this.Ig().getTime())){var s=this.getPixels(i);if(!s.cut&&!(s.left<0||s.left>this.Ii()*this.cellWidth)){var l=document.createElement("div");l.style.width=a+"px",l.style.height=c.Lf+"px",l.style.position="absolute",l.style.left=s.left-1+"px",l.style.top="0px",l.style.backgroundColor=n,l.style.opacity=r/100,l.style.filter="alpha(opacity="+r+")",o?this.divSeparatorsAbove.appendChild(l):this.divSeparators.appendChild(l),this.elements.separators.push(l)}}},this.tk=function(e){if("Disabled"===c.timeRangeDoubleClickHandling)return!1;n.timeRangeTimeout&&(clearTimeout(n.timeRangeTimeout),n.timeRangeTimeout=null);if(!c.coords){var t=c.hg;c.coords=DayPilot.mo3(t,e)}if(e=e||window.event,e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0,c.Qk(c.coords)){var i=c.rh(c.rangeHold);c._a(i.start,i.end,i.resource)}else if(n.range=c.Kk(),n.range){n.rangeCalendar=c;var i=c.rh(n.range);c._a(i.start,i.end,i.resource),c.rangeHold=n.range}},this.qk=function(e){if(!T.start&&!T.active){if(n.timeRangeTimeout,1,c.Rk(),c.ok(),!c.coords){var t=c.hg;c.coords=DayPilot.mo3(t,e)}if(n.rectangleSelect)return!1;e=e||window.event;var i=DayPilot.Util.mouseButton(e);if(i.middle||i.right&&c.Qk(c.coords))return!1;if(c.Qk(c.coords))return!1;var a=e.ctrlKey,o=e.metaKey,r=e.shiftKey,s=a||o,l={};if(l.action="None","Disabled"!==c.multiSelectRectangle&&r?l.action="RectangleSelect":"Disabled"!==c.timeRangeSelectedHandling&&(l.action="TimeRangeSelect"),l.shift=r,l.ctrl=r,l.meta=o,l.originalEvent=e,l.preventDefault=function(){l.action="None"},"function"==typeof c.onGridMouseDown&&c.onGridMouseDown(l),"None"===l.action)return e.preventDefault(),e.stopPropagation(),!1;if("RectangleSelect"===l.action){var d={};return d.start=c.coords,d.calendar=c,n.rectangleSelect=d,!1}c.allowMultiRange&&!s&&H.clear();var h=c.Th(c.coords.y).i;return!c.rowlist[h].isNewRow&&(n.range=c.Kk(),n.range&&(n.range.ctrl=s,n.rangeCalendar=c),!1)}},this.Kk=function(){var e={},t=this.Mg(c.coords.x).x;return e.start={y:c.Th(c.coords.y).i,x:t},e.end={x:t},this.Xh(c.Th(c.coords.y).i)?null:(e.calendar=c,c.vh(e),e)},this.Vi=function(){c.xc();var e=n.resizingShadow,t=n.resizing;!function(){var i=c.Sk,a={"start":e.start,"end":c.Xe(e.end)};e.original=a;var o=e.original;if(!o||!i||i.start!==o.start||i.end!==c.Xe(o.end)){var r={};r.start=a.start,r.end=a.end,r.duration=new DayPilot.Duration(r.start,r.end),r.e=t.event,r.allowed=!0,r.resizing="left"===n.resizing.dpBorder?"start":"end",r.left={},r.left.html=r.start.toString(c.eventResizingStartEndFormat,_.locale()),r.left.enabled=c.eventResizingStartEndEnabled,r.left.space=5,r.left.width=null,r.right={},r.right.html=r.end.toString(c.eventResizingStartEndFormat,_.locale()),r.right.enabled=c.eventResizingStartEndEnabled,r.right.space=5,r.right.width=null,r.multiresize=DayPilot.list(b.list);var s={};s.event=t,s.start=r.start,s.end=r.end,r.multiresize.splice(0,0,s),c.Sk=a,"function"==typeof c.onEventResizing&&c.onEventResizing(r),e.allowed=r.allowed;var l=r.start,d=c.we(r.end);e.finalStart=l,e.finalEnd=d;var h=DayPilot.DateUtil.diff(l,d);h=Math.max(h,1);var u=_.useBox(h),f=u?c.getPixels(l).boxLeft:c.getPixels(l).left,v=u?c.getPixels(d).boxRight:c.getPixels(d).left;e.style.left=f+"px",e.style.width=v-f+"px",e.left=f,e.width=v-f,c.Wi(n.resizingShadow,r),c.Xi(n.resizingShadow,r)}}()},this.rk=function(e){if(n.rectangleSelect){var e=e||window.event;return e.cancelBubble=!0,e.preventDefault&&e.preventDefault(),n.gMouseUp(e),!1}if(A={},c.rangeHold){if(DayPilot.Util.mouseButton(e).left){var t=c.rangeHold;if(c.Qk(c.coords)){var i=function(e){return function(){n.timeRangeTimeout=null;var t=c.rh(e);if(t){var i={};i.start=t.start,i.end=t.end,i.resource=t.resource,i.preventDefault=function(){i.preventDefault.value=!0},"function"==typeof c.onTimeRangeClick&&c.onTimeRangeClick(i),i.preventDefault.value||"function"==typeof c.onTimeRangeClicked&&c.onTimeRangeClicked(i)}}};"Disabled"!=c.timeRangeClickHandling&&("Disabled"===c.timeRangeDoubleClickHandling?i(t)():(clearTimeout(n.timeRangeTimeout),n.timeRangeTimeout=setTimeout(i(t),c.doubleClickTimeout)))}}}},this.Tk=function(){return n.resizing||n.moving||n.range},this.Zi=function(e){if(!T.active){n.activeCalendar=c,e=e||window.event;var t=DayPilot.mc(e);if(c.coords=DayPilot.mo3(c.hg,e),e.insideMainD=!0,window.event&&window.event.srcElement&&(window.event.srcElement.inside=!0),A.start){DayPilot.distance(A.originalMouse,t)>3&&(DayPilot.Util.copyProps(A,n),document.body.style.cursor="move",A={})}if(n.resizing&&n.resizingEvent.calendar===c)n.resizing.event||(n.resizing.event=n.resizingEvent),c.Uk();else if(n.moving&&(n.movingEvent.calendar===c||n.movingEvent.calendar.dragOutAllowed))n.moving.event||(n.moving.event=n.movingEvent),c.Vk();else if(n.range&&n.range.calendar===c)n.range.moved=!0,c.Wk();else if(l.source){var i=l.source;v.drawShadow(i.coords,c.coords)}else n.rectangleSelect&&(n.rectangleSelect.moved=!0,E.draw());"Disabled"!==c.crosshairType&&c.Xk(),c.Yk();var a=e.insideEvent;if(window.event&&window.event.srcElement&&(a=window.event.srcElement.insideEvent),c.cellBubble&&c.coords&&c.rowlist&&c.rowlist.length>0&&!a){var o=c.Mg(c.coords.x).x,r=c.Th(c.coords.y).i;if(0<=r&&r0){if(!n.moving){n.moving=n.drag.schedulerSourceEvent||{};var h=n.drag.event;if(!h){var f=c.itline[0].start,e={"id":n.drag.id,"start":f,"end":f.addSeconds(n.drag.duration),"text":n.drag.text},p=n.drag.data;if(p){var g=["duration","element","id","text"];for(var m in p)DayPilot.contains(g,m)||(e[m]=p[m])}h=new DayPilot.Event(e),h.calendar=c}h.part.external=!0,n.drag.schedulerSourceEvent&&n.drag.schedulerSourceEvent.event.calendar===c&&(h.part.external=!1),n.moving.event=h,n.movingEvent=h}n.movingShadow=c.sa(n.moving)}e.cancelBubble=!0}if("Always"===c.autoScroll||"Drag"===c.autoScroll&&(n.moving||n.resizing||n.range)){var y=c.nav.scroll,b={x:c.coords.x,y:c.coords.y};b.x-=y.scrollLeft,b.x+=u.shiftX,b.y-=y.scrollTop;var w=y.clientWidth,D=y.clientHeight,k=30,x=b.x0&&c.itline&&c.itline.length>0))return null;if(e=c.Mg(c.coords.x).x,t=c.Th(c.coords.y).i,!(t>=c.rowlist.length)){return c.cells.findXy(e,t)[0]}},this.Yk=function(){var e=this._k();if(this.hover.cell){if(this.hover.cell.x===e.x&&this.hover.cell.y===e.y)return;this.pk()}if(this.hover.cell=e,"function"==typeof this.onCellMouseOver){var t={};t.cell=e,this.onCellMouseOver(t)}},this.pk=function(){if(this.hover.cell){if("function"==typeof this.onCellMouseOut){var e={};e.cell=this.hover.cell,this.onCellMouseOut(e)}this.hover.cell=null}},this.hover={},this.Xk=function(){var e=this._k();this.hover.cell&&this.hover.cell.x===e.x&&this.hover.cell.y===e.y||this.wc()},this.Rk=function(){this.divCrosshair.innerHTML="",this.al=null,this.bl=null},this.S=function(){if(this.Rk(),this.cl&&this.cl.parentNode&&(this.cl.parentNode.removeChild(this.cl),this.cl=null),this.dl){for(var e=0;e0&&(e=c.Mg(c.coords.x).x,t=c.Th(c.coords.y).i,!(t>=c.rowlist.length))){var i=this.crosshairType,n=c.rowlist[t];if("Full"===i){var a=this.itline[e],o=a.left,r=this.al;if(!r){var r=document.createElement("div");r.style.height=c.Lf+"px",r.style.position="absolute",r.style.top="0px",r.className=c.p("_crosshair_vertical"),this.al=r,this.divCrosshair.appendChild(r)}r.style.left=o+"px",r.style.width=a.width+"px";var s=n.top,l=n.height,d=this.tg(),r=this.bl;if(!r){var r=document.createElement("div");r.style.width=d+"px",r.style.height=l+"px",r.style.position="absolute",r.style.top=s+"px",r.style.left="0px",r.className=c.p("_crosshair_horizontal"),this.bl=r,this.divCrosshair.appendChild(r)}r.style.top=s+"px",r.style.height=l+"px"}var h=this.fl(this.coords.x);if(h&&this.Kf!==h.x){this.cl&&this.cl.parentNode&&(this.cl.parentNode.removeChild(this.cl),this.cl=null);var l=R.timeHeader(c.timeHeaders.length-1).height,r=document.createElement("div");r.style.width=h.cell.width+"px",r.style.height=l+"px",r.style.left="0px",r.style.top="0px",r.style.position="absolute",r.className=c.p("_crosshair_top"),this.cl=r;var u=this.divNorth,f=this.timeHeader?this.timeHeader.length-1:1;this.nav.timeHeader?this.s.timeHeader[h.x+"_"+f].appendChild(r):u.firstChild.rows[f].cells[e]&&u.firstChild.rows[f].cells[e].firstChild.appendChild(r)}if(this.Jf!==t){if(this.dl){for(var v=0;v=a.left&&t=a&&e.x<=o&&e.y>=r&&e.y<=s},this.vh=function(e,t){function i(e){var t=e.end.x>e.start.x?e.start.x:e.end.x,i=e.end.x>e.start.x?e.end.x:e.start.x,n=e.start.y,a=(c.rowlist[n],c.itline[t]),o=c.itline[i],r=a.left,s=o.left+o.width,l=s-r,d=c.elements.range2;if(!d){d=document.createElement("div"),d.style.position="absolute",d.setAttribute("unselectable","on"),d.className=c.p("_shadow");var h=document.createElement("div");h.className=c.p("_shadow_inner"),d.appendChild(h),c.divRange.appendChild(d)}return d.style.left=a.left+"px",d.style.top=c.rowlist[n].top+"px",d.style.width=l+"px",d.style.height=c.rowlist[n].height-1+"px",c.elements.range2=d,function(){var e=c.rowlist[n],t=a.left;c.Ri(d,e,t,l,null)}(),d}var e=e||n.range;e&&e.calendar===c&&!function(){var n=e.end.x>e.start.x?e.start.x:e.end.x,a=e.end.x>e.start.x?e.end.x:e.start.x,o=e.start.y,r=c.rowlist[o];if(r){var s=c.itline[n],l=c.itline[a],d=c.gl,h=s.start.addTime(r.data.offset),u=l.end.addTime(r.data.offset);if(t||!d||d.start.getTime()!==h.getTime()||d.end.getTime()!==u.getTime()||d.resource!==c.rowlist[o].id){var f={"start":h,"end":c.Xe(u)},v={};v.start=f.start,v.end=f.end,v.duration=new DayPilot.Duration(f.start,f.end),v.resource=c.rowlist[o].id,v.allowed=!0,v.left={},v.left.html=v.start.toString(c.timeRangeSelectingStartEndFormat,_.locale()),v.left.enabled=c.timeRangeSelectingStartEndEnabled,v.left.space=5,v.left.width=null,v.right={},v.right.html=v.end.toString(c.timeRangeSelectingStartEndFormat,_.locale()),v.right.enabled=c.timeRangeSelectingStartEndEnabled,v.right.space=5,v.right.width=null,c.gl=v,"function"!=typeof c.onTimeRangeSelecting||t||c.onTimeRangeSelecting(v);var p=c.hl(e);c.uh(p,v.start,v.end);var g=i(p);c.Wi(g,v),e.Lk=p,e.disabled=!v.allowed,c.Xi(g,v),v.start=f.start,v.end=f.end}}}()},this.hl=function(e){return{"start":{"x":e.start.x,"y":e.start.y},"end":{"x":e.end.x},"disabled":e.disabled,"calendar":e.calendar}},this.range={},this.range.all=function(){return H.get()},this.il={};var H=this.il;this.il.list=[],this.il.clear=function(){DayPilot.de(DayPilot.list(H.list).map(function(e){return e.div})),H.list=[]},this.il.add=function(e){e.div=c.elements.range2,c.elements.range2=null,c.Yi(),H.list.push(e)},this.il.get=function(){return DayPilot.list(H.list).map(function(e){return c.rh(e)})},this.il.dispatch=function(){if(c.allowMultiRange&&!n.range){var e=DayPilot.list(H.list).last();c.qh(e)}},this.jl=function(e){if("Disabled"===c.timeRangeSelectedHandling)return!1;if(!T.active&&!T.start){e=e||window.event;var t=DayPilot.Util.mouseButton(e);if(!n.range&&!n.rectangleSelect&&!(c.rangeHold&&c.Qk(c.coords)&&(t.right||t.middle)||c.Xh(c.Th(c.coords.y).i))){var i={},a=c.Mg(c.coords.x).x;i.start={y:c.Th(c.coords.y).i,x:a},i.end={x:a},i.calendar=c,c.rangeHold=i,c.qh(i)}}},this.timeouts={},this.timeouts.drawEvents=null,this.timeouts.drawCells=null,this.timeouts.click=null,this.disableOnScroll=!1,this.dg=function(e){if(!c.disableOnScroll){if(c.Nf(),u.isEnabled()&&!u.active&&c.z&&"Auto"!=c.cellWidthSpec&&(c.nav.scroll.scrollLeft0?c.timeouts.drawEvents=setTimeout(c.ll(),c.scrollDelayEvents):c.na(),c.timeouts.drawCells&&(clearTimeout(c.timeouts.drawCells),c.timeouts.drawCells=null),c.scrollDelayCells>0)c.timeouts.drawCells=setTimeout(c.ml(),c.scrollDelayCells);else{c.ml()()}c.timeouts.updateFloats&&(clearTimeout(c.timeouts.updateFloats),c.timeouts.updateFloats=null),c.scrollDelayFloats>0?c.timeouts.updateFloats=setTimeout(function(){c.bg()},c.scrollDelayFloats):c.bg(),c.onScrollCalled=!0}},this.ml=function(){return function(){c.nf(),c.Zf()}},this.ll=function(){var e=c.dynamicEventRenderingCacheSweeping,t=c.dynamicEventRenderingCacheSize;return function(){c.Ck()?window.setTimeout(function(){e&&c.zk(t),window.setTimeout(function(){c.na(!0)},50)},50):c.pg()}},this.Nf=function(){this.s.eventHeight=null,this.s.drawArea=null},this.show=function(){this.visible=!0,c.nav.top.style.display="",this.ma(),this.Uf(),this.ii(),c.dg()},this.hide=function(){this.visible=!1,c.nav.top.style.display="none"},this.nl=function(){},this.kl=function(){var e=c.nav.scroll;c.Ji=e.scrollLeft,c.Hi=e.scrollTop,c.Ki=e.clientWidth,c.divTimeScroll.scrollLeft=c.Ji,c.divResScroll.scrollTop=c.Hi,c.refreshTimeout&&window.clearTimeout(c.refreshTimeout);var t=c.scrollDelayDynamic;c.refreshTimeout=window.setTimeout(c.ol(e.scrollLeft,e.scrollTop),t),c.bg()},this.pl=function(e){for(var t=e.id,i=new DayPilot.Date(e.start).toString(),n=0;n0){if(this.cellSweeping){var e=this.cellSweepingCacheSize;this.Bk(e)}this.rl(),this.vl(),x.Aj()}this.jh=!1}},this.vl=function(){for(var e=this.mg(),t=e.xStart;t0){r=c.Mg(a).x,s=c.Mg(o,!0).x;var l=this.Ii();s=Math.min(s,l),r=Math.max(r,0)}var d=e-n,h=e+this.nav.scroll.offsetHeight+2*n,f=this.Th(d).i,v=this.Th(h).i;return v0&&(n=n.concat(l))}return n},this.Zk=function(e,t){this.ok(),this.yl(e,t)},this.zl=function(e){if(!e)return!1;var t=this.nav.scroll.scrollWidth,i=this.nav.scroll.scrollLeft,n=this.nav.scroll.clientWidth,a=i+n;return!(e<0&&i<=0)&&(!(e>0&&a>=t)&&(this.nav.scroll.scrollLeft+=e,c.coords.x+=e,c.Al(),!0))},this.Bl=function(e){if(!e)return!1;var t=this.nav.scroll.scrollHeight,i=this.nav.scroll.scrollTop,n=this.nav.scroll.clientHeight,a=i+n;return!(e<0&&i<=0)&&(!(e>0&&a>=t)&&(this.nav.scroll.scrollTop+=e,c.coords.y+=e,c.Al(),!0))},this.Al=function(){n.resizing&&n.resizing.event.calendar===c?c.Uk():n.moving&&(n.movingEvent.calendar===c||n.movingEvent.calendar.dragOutAllowed)?(n.moving.event||(n.moving.event=n.movingEvent),c.Vk()):n.range&&n.range.calendar===c&&c.Wk()},this.yl=function(e,t){if(this.zl(e)||this.Bl(t)){var i=function(e,t){return function(){c.yl(e,t)}};this.Cl=window.setTimeout(i(e,t),100)}},this.ok=function(){c.Cl&&(window.clearTimeout(c.Cl),c.Cl=null)},this.Tf=function(){for(var e=0,t=0;t',this.elements.range=[],this.elements.range2=null,this.Yi(),c.rangeHold=null},this.Nb={};var _=this.Nb;_.clearCache=function(){delete c.s.eventHeight,delete c.s.headerHeight},_.locale=function(){return DayPilot.Locale.find(c.locale)},_.timeFormat=function(){return"Auto"!==c.timeFormat?c.timeFormat:_.locale().timeFormat},_.weekStarts=function(){if("Auto"===c.weekStarts){var e=_.locale();return e?e.weekStarts:0}return c.weekStarts||0},_.rounded=function(){return"Rounded"===c.eventCorners},_.layout=function(){var e=/MSIE 6/i.test(navigator.userAgent);return"Auto"===c.layout?e?"TableBased":"DivBased":c.layout},_.notifyType=function(){var e;if("Immediate"===c.notifyCommit)e="Notify";else{if("Queue"!==c.notifyCommit)throw"Invalid notifyCommit value: "+c.notifyCommit;e="Queue"}return e},_.isResourcesView=function(){return"Days"!==c.viewType},_.useBox=function(e){return"Always"===c.useEventBoxes||"Never"!==c.useEventBoxes&&e<60*c.si()*1e3},_.eventHeight=function(){if(c.s.eventHeight)return c.s.eventHeight;var e=c.ad("_event_height").height;return e||(e=c.eventHeight),c.s.eventHeight=e,e},_.headerHeight=function(){if(c.s.headerHeight)return c.s.headerHeight;var e=c.ad("_header_height").height;return e||(e=c.headerHeight),c.s.headerHeight=e,e},_.splitterWidth=function(){return c.rowHeaderScrolling?c.rowHeaderSplitterWidth:1},this.Il={};var R=this.Il;R.timeHeader=function(e){var t={};t.top=0,t.height=0;for(var i=_.headerHeight(),n=0;n<=e;n++){var a=c.timeHeaders[n];t.top+=t.height,t.height=a.height||i}return t},this.vc=function(e,t){var i=e+"_"+t;return this.cellProperties&&this.cellProperties[i]?this.cellProperties[i].backColor:null},this.li=function(e,t){var i=e+"_"+t;if(c.cellConfig)for(var n=0,a=0;a=24)return!0;if(a>=this.businessEndsHour)return!1}return!0},this.ma=function(){"hidden"===this.nav.top.style.visibility&&(this.nav.top.style.visibility="visible")},this.Hc=function(){var e=c.nav.top;return!!e&&(e.offsetWidth>0&&e.offsetHeight>0)},this.Ic=function(){var e=c.Hc;e()||(c.debug.message("Not visible during init, starting visibilityInterval"),c.Jc=setInterval(function(){e()&&(c.debug.message("Made visible, calling .show()"),c.show(),c.cj(),clearInterval(c.Jc))},100))},this.Ll=function(e){"Parent100Pct"!==this.heightSpec&&(this.heightSpec="Fixed"),this.height=e-(this.ed()+2),this.ia()},this.setHeight=this.Ll,this.kg=function(e){return DayPilot.list(D.rowcache[e]).first()},this.gd=function(){if(this.id&&this.id.tagName)this.nav.top=this.id;else{if("string"!=typeof this.id)throw"DayPilot.Scheduler() constructor requires the target element or its ID as a parameter";if(this.nav.top=document.getElementById(this.id),!this.nav.top)throw"DayPilot.Scheduler: The placeholder element not found: '"+e+"'."}},this.Ml=function(){this.Zc(),this.Qf(),this.Uf(),this.Lc(),this.P(),n.register(this),this.X(this.afterRenderData,!1),this.wk(),this.Ic(),this.qa(),this.F("Init")},this.init=function(){this.Nl(),this.Ic(),this.ik()},this.Nl=function(){if(this.gd(),!this.nav.top.dp){this.Wj();if(this.fd())return this.Ml(),this.z=!0,void this.Nf();this.Lc(),this.P(),n.register(this),this.wk(),this.Yc(),this.z=!0,c.scrollToDate?c.scrollTo(c.scrollToDate):c.scrollX||c.scrollY?c.setScroll(c.scrollX,c.scrollY):c.dg(),c.scrollToResourceId&&(c.scrollToResource(c.scrollToResourceId),c.scrollToResourceId=null);var e=function(){c.scrollY&&c.setScroll(c.scrollX,c.scrollY)};window.setTimeout(e,200),this.messageHTML&&window.setTimeout(function(){c.message(c.messageHTML)},0),this.qa(),this.Nf(),this.X(this.afterRenderData,!1),c.initEventEnabled&&setTimeout(function(){c.F("Init")}),this.jd(),this.Vh=!0}},this.kd=null,this.ld=function(e){if(e){var t={"events":{"preInit":function(){var e=this.data;e&&(DayPilot.isArray(e.list)?c.events.list=e.list:c.events.list=e)},"postInit":function(){}},"scrollTo":{"preInit":function(){},"postInit":function(){this.data&&c.scrollTo(this.data,e.scrollToAnimated,e.scrollToPosition)}},"scrollX":{"postInit":function(){this.data&&c.setScrollX(this.data)}},"scrollY":{"postInit":function(){this.data&&c.setScrollY(this.data)}}};c.kd=t,c.eg.scrollToRequested&&(t.scrollTo.data=c.eg.scrollToRequested,c.eg.scrollToRequested=null),c.eg.scrollXRequested&&(t.scrollX.data=c.eg.scrollXRequested,c.eg.scrollXRequested=null),c.eg.scrollYRequested&&(t.scrollY.data=c.eg.scrollYRequested,c.eg.scrollYRequested=null);for(var i in e)if(t[i]){var n=t[i];n.data=e[i],n.preInit&&n.preInit()}else c[i]=e[i]}},this.jd=function(){var e=c.kd;for(var t in e){var i=e[t];i.postInit&&i.postInit()}c.kd={}},this.temp={},this.temp.getPosition=function(){var e=Math.floor(c.coords.x/c.cellWidth),t=c.Th(c.coords.y).i;if(tt.groupConcurrentEventsLimit&&e.push(new o(n))}return DayPilot.list(e)},a.groups.collapsed=function(){for(var e=[],t=0;tt.groupConcurrentEventsLimit){e.expanded=!1;var i=DayPilot.list(e.events).map(function(e){return e.id()});t.wj=t.wj.filter(function(e){return!DayPilot.contains(i,e)})}},this.collapse=function(){this.Ql(),t.Wg(),t.Xg(e.row.index),t.ia()}},r=function(e,t){this.html=function(i){var n=e.calendar.divHeader,a=n.rows[e.index].cells[t],o=a.textDiv;return"undefined"==typeof i?o.innerHTML:void(o.innerHTML=i)}}},n.moving=null,n.movingEvent=null,n.originalMouse=null,n.resizing=null,n.resizingEvent=null,n.preventEventClick=!1,n.globalHandlers=!1,n.timeRangeTimeout=null,n.selectedCells=null,n.dragStart=function(e,t,i,a){DayPilot.us(e);var o=n.drag={};return o.element=e,o.duration=t,o.text=a,o.id=i,o.data={"id":i,"text":a,"duration":t,"externalHtml":a},!1},DayPilot.Scheduler.startDragging=function(e){var e=e||{},t=e.element,i=e.keepElement?null:t;DayPilot.us(t);var a=n.drag={};return a.element=i,a.id=e.id,a.duration=e.duration||60,a.text=e.text||"",a.data=e,!1},DayPilot.Scheduler.makeDraggable=function(e){function t(){var t=n.drag={};t.element=a,t.id=e.id,t.duration=e.duration||60,t.text=e.text||"",t.data=e}e=e||{};var i=e.element,a=e.keepElement?null:e.remove||i;DayPilot.us(i),DayPilot.re(i,"mousedown",function(e){if(DayPilot.Util.mouseButton(e).left){t();var i=e.target||e.srcElement;if(i.tagName){var n=i.tagName.toLowerCase();if("textarea"===n||"select"===n||"input"===n)return!1}return e.preventDefault&&e.preventDefault(),!1}}),i.ontouchstart=function(e){window.setTimeout(function(){t(),n.gTouchMove(e),e.preventDefault()},0),e.preventDefault()}},DayPilot.Scheduler.stopDragging=function(){if(n.dragStop(),n.resizing&&(DayPilot.de(n.resizingShadow),n.resizing=null,n.resizingEvent=null,n.resizingShadow=null),n.moving){var e=n.movingEvent.calendar;DayPilot.Util.removeClass(n.moving,e.p("_event_moving_source")),DayPilot.de(n.movingShadow),n.moving=null,n.movingEvent=null,n.movingShadow=null}if(n.range){var e=n.range.calendar;e.clearSelection(),n.range=null}document.body.style.cursor="",DayPilot.list(n.registered).each(function(e){e.ok(),e.Yi()})},n.dragStop=function(){n.gShadow&&(document.body.removeChild(n.gShadow),n.gShadow=null),n.drag=null},n.register=function(e){n.registered||(n.registered=[]);for(var t=0;t0){if(!n.moving){n.moving={};var r=n.drag.event;if(!r){var s=a.itline[0].start,i={"id":n.drag.id,"start":s,"end":s.addSeconds(n.drag.duration),"text":n.drag.text},l=n.drag.data;if(l){var d=["duration","element","id","text"];for(var c in l)DayPilot.contains(d,c)||(i[c]=l[c])}r=new DayPilot.Event(i),r.calendar=a,r.part.external=!0}n.moving.event=r,n.movingEvent=r}n.movingShadow=a.sa(n.moving)}n.moving&&a.Sb.updateMoving()}else{DayPilot.de(n.movingShadow);var h=n.moving;n.moving=null,n.movingEvent=null,n.movingShadow=null,n.gShadow||(n.gShadow=n.createGShadow(n.drag.data),n.gShadow.source=h);var u=n.gShadow;u.style.left=o.x+"px",u.style.top=o.y+"px"}}},n.gTouchEnd=function(e){n.gMouseUp(e)},n.gMouseMove=function(e){if("undefined"!=typeof n&&(e=e||window.event,!(e.insideMainD||e.srcElement&&e.srcElement.inside))){var t=DayPilot.mc(e);if(n.drag){if(!n.drag.startFired){var i=n.drag.data||{},a=i.onDragStart,o=!1;if("function"==typeof a){var r={};r.data=i,r.preventDefault=function(){r.preventDefault.value=!0},a(r),o=r.preventDefault.value}if(n.drag.startFired=!0,o)return void(n.drag=null)}document.body.style.cursor="move",n.gShadow||(n.gShadow=n.createGShadow(n.drag.data));var s=n.gShadow;if(s.style.left=t.x+"px",s.style.top=t.y+"px",n.moving=null,n.movingEvent=null,n.movingShadow){var l=n.movingShadow.calendar;l&&l.Yi(),n.movingShadow.calendar=null,DayPilot.de(n.movingShadow),n.movingShadow=null}}else if(n.moving&&n.movingEvent&&n.movingEvent.calendar.dragOutAllowed&&!n.drag){var l=n.movingEvent.calendar,e=n.movingEvent;n.moving.target=null,document.body.style.cursor="move",n.gShadow||(n.gShadow=n.createGShadow(e.data),n.gShadow.source=n.moving);var s=n.gShadow;s.style.left=t.x+"px",s.style.top=t.y+"px",n.drag={};var d=n.drag;d.schedulerSourceEvent=n.moving,d.element=null,d.duration=(e.rawend().getTime()-e.start().getTime())/1e3,d.text=e.text(),d.id=e.value(),d.event=e,l.Yi(),DayPilot.de(n.movingShadow),n.movingShadow.calendar=null,n.movingShadow=null}for(var c=0;c","compile":function(t,i){return t.replaceWith(this["template"].replace("{{id}}",i["id"])),function(t,i,n){var a=new DayPilot.Scheduler(i[0]);a.Gc.scope=t,a.init();var o=n["id"];o&&(t[o]=a);var r=n["publishAs"];if(r){(0,e(r).assign)(t,a)}for(var s in n)if(0===s.indexOf("on")){var l=DayPilot.Util.shouldApply(s);l?!function(i){a[i]=function(a){var o=e(n[i]);DayPilot.Util.safeApply(t,function(){o(t,{"args":a})})}}(s):!function(i){a[i]=function(a){e(n[i])(t,{"args":a})}}(s)}var d=t["$watch"],c=n["config"]||n["daypilotConfig"],h=n["events"]||n["daypilotEvents"];d.call(t,c,function(e,t){a.ld(e),a.update(),a.jd()},!0),d.call(t,h,function(e){a.events.list=e,a.Yc({"eventsOnly":!0})},!0)}}}}])}(),"undefined"!=typeof Sys&&Sys.Application&&Sys.Application.notifyScriptLoaded&&Sys.Application.notifyScriptLoaded()}}(),"undefined"==typeof DayPilot)var DayPilot={};"undefined"==typeof DayPilot.Global&&(DayPilot.Global={}),function(){"undefined"==typeof DayPilot.Year&&(DayPilot.Year=function(e,t){this.v="2709";this.startDate=new DayPilot.Date,this.cssOnly=!0,this.cssClassPrefix=null,this.columns=4,this.cellWidth=20,this.showWeekNumbers=!1,this.Sl=[],this.$e=function(){this.root.dp=this,this.Rd=new DayPilot.Date(this.startDate.toString("yyyy-01-01","en-us"))},this.p=function(e){return this.cssClassPrefix?this.cssClassPrefix+e:""; },this._e=function(){return this.showWeekNumbers?this.cellWidth:0},this.Tl=function(){this.Sl=[];var e=this.columns,t=12/e;this.root.className=this.p("_main"),this.root.style.width=e*(7*this.cellWidth+this._e())+"px";for(var i=0;i