//>>built
require({cache:{"url:dojox/calendar/templates/MatrixView.html":'\x3cdiv data-dojo-attach-events\x3d"keydown:_onKeyDown"\x3e\r\n\t\x3cdiv  class\x3d"dojoxCalendarYearColumnHeader" data-dojo-attach-point\x3d"yearColumnHeader"\x3e\r\n\t\t\x3ctable\x3e\x3ctr\x3e\x3ctd\x3e\x3cspan data-dojo-attach-point\x3d"yearColumnHeaderContent"\x3e\x3c/span\x3e\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e\t\t\r\n\t\x3c/div\x3e\t\r\n\t\x3cdiv data-dojo-attach-point\x3d"columnHeader" class\x3d"dojoxCalendarColumnHeader"\x3e\r\n\t\t\x3ctable data-dojo-attach-point\x3d"columnHeaderTable" class\x3d"dojoxCalendarColumnHeaderTable" cellpadding\x3d"0" cellspacing\x3d"0"\x3e\x3c/table\x3e\r\n\t\x3c/div\x3e\t\t\r\n\t\x3cdiv dojoAttachPoint\x3d"rowHeader" class\x3d"dojoxCalendarRowHeader"\x3e\r\n\t\t\x3ctable data-dojo-attach-point\x3d"rowHeaderTable" class\x3d"dojoxCalendarRowHeaderTable" cellpadding\x3d"0" cellspacing\x3d"0"\x3e\x3c/table\x3e\r\n\t\x3c/div\x3e\t\r\n\t\x3cdiv dojoAttachPoint\x3d"grid" class\x3d"dojoxCalendarGrid"\x3e\r\n\t\t\x3ctable data-dojo-attach-point\x3d"gridTable" class\x3d"dojoxCalendarGridTable" cellpadding\x3d"0" cellspacing\x3d"0"\x3e\x3c/table\x3e\r\n\t\x3c/div\x3e\t\r\n\t\x3cdiv data-dojo-attach-point\x3d"itemContainer" class\x3d"dojoxCalendarContainer" data-dojo-attach-event\x3d"mousedown:_onGridMouseDown,mouseup:_onGridMouseUp,ondblclick:_onGridDoubleClick,touchstart:_onGridTouchStart,touchmove:_onGridTouchMove,touchend:_onGridTouchEnd"\x3e\r\n\t\t\x3ctable data-dojo-attach-point\x3d"itemContainerTable" class\x3d"dojoxCalendarContainerTable" cellpadding\x3d"0" cellspacing\x3d"0" style\x3d"width:100%"\x3e\x3c/table\x3e\r\n\t\x3c/div\x3e\t\r\n\x3c/div\x3e\r\n'}});
define("dojox/calendar/MatrixView","dojo/_base/declare dojo/_base/array dojo/_base/event dojo/_base/lang dojo/_base/sniff dojo/_base/fx dojo/_base/html dojo/on dojo/dom dojo/dom-class dojo/dom-style dojo/dom-geometry dojo/dom-construct dojo/query dojo/i18n ./ViewBase dojo/text!./templates/MatrixView.html dijit/_TemplatedMixin".split(" "),function(F,K,G,t,y,B,C,z,L,l,p,x,n,w,E,H,I,J){return F("dojox.calendar.MatrixView",[H,J],{templateString:I,baseClass:"dojoxCalendarMatrixView",_setTabIndexAttr:"domNode",
viewKind:"matrix",renderData:null,startDate:null,refStartTime:null,refEndTime:null,columnCount:7,rowCount:5,horizontalRenderer:null,labelRenderer:null,expandRenderer:null,horizontalDecorationRenderer:null,percentOverlap:0,verticalGap:2,horizontalRendererHeight:17,labelRendererHeight:14,expandRendererHeight:15,cellPaddingTop:16,expandDuration:300,expandEasing:null,layoutDuringResize:!1,roundToDay:!0,showCellLabel:!0,scrollable:!1,resizeCursor:"e-resize",constructor:function(){this.invalidatingProperties=
"columnCount rowCount startDate horizontalRenderer horizontalDecaorationRenderer labelRenderer expandRenderer rowHeaderDatePattern columnHeaderLabelLength cellHeaderShortPattern cellHeaderLongPattern percentOverlap verticalGap horizontalRendererHeight labelRendererHeight expandRendererHeight cellPaddingTop roundToDay itemToRendererKindFunc layoutPriorityFunction formatItemTimeFunc textDir items".split(" ");this._ddRendererList=[];this._ddRendererPool=[];this._rowHeaderHandles=[]},destroy:function(a){this._cleanupRowHeader();
this.inherited(arguments)},postCreate:function(){this.inherited(arguments);this._initialized=!0;this.invalidRendering||this.refreshRendering()},_createRenderData:function(){var a={};a.dateLocaleModule=this.dateLocaleModule;a.dateClassObj=this.dateClassObj;a.dateModule=this.dateModule;a.dates=[];a.columnCount=this.get("columnCount");a.rowCount=this.get("rowCount");a.sheetHeight=this.itemContainer.offsetHeight;this._computeRowsHeight(a);var b=this.get("startDate");null==b&&(b=new a.dateClassObj);this.startDate=
b=this.floorToDay(b,!1,a);for(var c=0;c<a.rowCount;c++){a.dates.push([]);for(var d=0;d<a.columnCount;d++)a.dates[c].push(b),b=this.addAndFloor(b,"day",1)}a.startTime=this.newDate(a.dates[0][0],a);a.endTime=this.newDate(a.dates[a.rowCount-1][a.columnCount-1],a);a.endTime=a.dateModule.add(a.endTime,"day",1);a.endTime=this.floorToDay(a.endTime,!0);this.displayedItemsInvalidated&&!this._isEditing?(this.displayedItemsInvalidated=!1,this._computeVisibleItems(a)):this.renderData&&(a.items=this.renderData.items);
this.displayedDecorationItemsInvalidated?a.decorationItems=this.decorationStoreManager._computeVisibleItems(a):this.renderData&&(a.decorationItems=this.renderData.decorationItems);a.rtl=!this.isLeftToRight();return a},_validateProperties:function(){this.inherited(arguments);if(1>this.columnCount||isNaN(this.columnCount))this.columnCount=1;if(1>this.rowCount||isNaN(this.rowCount))this.rowCount=1;if(isNaN(this.percentOverlap)||0>this.percentOverlap||100<this.percentOverlap)this.percentOverlap=0;if(isNaN(this.verticalGap)||
0>this.verticalGap)this.verticalGap=2;if(isNaN(this.horizontalRendererHeight)||1>this.horizontalRendererHeight)this.horizontalRendererHeight=17;if(isNaN(this.labelRendererHeight)||1>this.labelRendererHeight)this.labelRendererHeight=14;if(isNaN(this.expandRendererHeight)||1>this.expandRendererHeight)this.expandRendererHeight=15},_setStartDateAttr:function(a){this.displayedItemsInvalidated=!0;this._set("startDate",a)},_setColumnCountAttr:function(a){this.displayedItemsInvalidated=!0;this._set("columnCount",
a)},_setRowCountAttr:function(a){this.displayedItemsInvalidated=!0;this._set("rowCount",a)},__fixEvt:function(a){a.sheet="primary";a.source=this;return a},_formatRowHeaderLabel:function(a){return this.rowHeaderDatePattern?this.renderData.dateLocaleModule.format(a,{selector:"date",datePattern:this.rowHeaderDatePattern}):this.getWeekNumberLabel(a)},_formatColumnHeaderLabel:function(a){return this.renderData.dateLocaleModule.getNames("days",this.columnHeaderLabelLength?this.columnHeaderLabelLength:"wide",
"standAlone")[a.getDay()]},cellHeaderShortPattern:null,cellHeaderLongPattern:null,_formatGridCellLabel:function(a,b,c){0==b&&0==c||1==a.getDate()?this.cellHeaderLongPattern?b=this.cellHeaderLongPattern:(b=E.getLocalization("dojo.cldr",this._calendar),b=b["dateFormatItem-MMMd"]):this.cellHeaderShortPattern?b=this.cellHeaderShortPattern:(b=E.getLocalization("dojo.cldr",this._calendar),b=b["dateFormatItem-d"]);return this.renderData.dateLocaleModule.format(a,{selector:"date",datePattern:b})},refreshRendering:function(){this.inherited(arguments);
if(this.domNode){this._validateProperties();var a=this.renderData,b=this.renderData=this._createRenderData();this._createRendering(b,a);this._layoutDecorationRenderers(b);this._layoutRenderers(b)}},_createRendering:function(a,b){if(0>=a.rowHeight)a.columnCount=1,a.rowCount=1,a.invalidRowHeight=!0;else{if(b&&this.itemContainerTable){var c=w(".dojoxCalendarItemContainerRow",this.itemContainerTable);b.rowCount=c.length}this._buildColumnHeader(a,b);this._buildRowHeader(a,b);this._buildGrid(a,b);this._buildItemContainer(a,
b);this.buttonContainer&&null!=this.owner&&this.owner.currentView==this&&p.set(this.buttonContainer,{right:0,left:0})}},_buildColumnHeader:function(a,b){var c=this.columnHeaderTable;if(c){var d=a.columnCount-(b?b.columnCount:0);8==y("ie")&&(null==this._colTableSave?this._colTableSave=t.clone(c):0>d&&(this.columnHeader.removeChild(c),n.destroy(c),this.columnHeaderTable=c=t.clone(this._colTableSave),this.columnHeader.appendChild(c),d=a.columnCount));var e=w("tbody",c),f=w("tr",c),e=1==e.length?e[0]:
C.create("tbody",null,c),f=1==f.length?f[0]:n.create("tr",null,e);if(0<d)for(e=0;e<d;e++)n.create("td",null,f);else for(d=-d,e=0;e<d;e++)f.removeChild(f.lastChild);w("td",c).forEach(function(b,c){b.className="";var d=a.dates[0][c];this._setText(b,this._formatColumnHeaderLabel(d));0==c?l.add(b,"first-child"):c==this.renderData.columnCount-1&&l.add(b,"last-child");this.styleColumnHeaderCell(b,d,a)},this);this.yearColumnHeaderContent&&this._setText(this.yearColumnHeaderContent,a.dateLocaleModule.format(a.dates[0][0],
{selector:"date",datePattern:"yyyy"}))}},styleColumnHeaderCell:function(a,b,c){l.add(a,this._cssDays[b.getDay()]);this.isWeekEnd(b)&&l.add(a,"dojoxCalendarWeekend")},_rowHeaderHandles:null,_cleanupRowHeader:function(){for(;0<this._rowHeaderHandles.length;)for(var a=this._rowHeaderHandles.pop();0<a.length;)a.pop().remove()},_rowHeaderClick:function(a){var b=w("td",this.rowHeaderTable).indexOf(a.currentTarget);this._onRowHeaderClick({index:b,date:this.renderData.dates[b][0],triggerEvent:a})},_buildRowHeader:function(a,
b){var c=this.rowHeaderTable;if(c){var d=w("tbody",c),e,d=1==d.length?d[0]:n.create("tbody",null,c),f=a.rowCount-(b?b.rowCount:0);if(0<f)for(var g=0;g<f;g++){e=n.create("tr",null,d);e=n.create("td",null,e);var h=[];h.push(z(e,"click",t.hitch(this,this._rowHeaderClick)));y("touch")||(h.push(z(e,"mousedown",function(a){l.add(a.currentTarget,"Active")})),h.push(z(e,"mouseup",function(a){l.remove(a.currentTarget,"Active")})),h.push(z(e,"mouseover",function(a){l.add(a.currentTarget,"Hover")})),h.push(z(e,
"mouseout",function(a){l.remove(a.currentTarget,"Hover")})));this._rowHeaderHandles.push(h)}else for(f=-f,g=0;g<f;g++)for(d.removeChild(d.lastChild),e=this._rowHeaderHandles.pop();0<e.length;)e.pop().remove();w("tr",c).forEach(function(b,c){p.set(b,"height",this._getRowHeight(c)+"px");var d=a.dates[c][0],e=w("td",b)[0];e.className="";0==c&&l.add(e,"first-child");c==this.renderData.rowCount-1&&l.add(e,"last-child");this.styleRowHeaderCell(e,d,a);this._setText(e,this._formatRowHeaderLabel(d))},this)}},
styleRowHeaderCell:function(a,b,c){},_buildGrid:function(a,b){var c=this.gridTable;if(c){var d=w("tr",c),e=a.rowCount-d.length,f=0<e,g=a.columnCount-(d?w("td",d[0]).length:0);8==y("ie")&&(null==this._gridTableSave?this._gridTableSave=t.clone(c):0>g&&(this.grid.removeChild(c),n.destroy(c),this.gridTable=c=t.clone(this._gridTableSave),this.grid.appendChild(c),g=a.columnCount,e=a.rowCount,f=!0));d=w("tbody",c);d=1==d.length?d[0]:n.create("tbody",null,c);if(f)for(var h=0;h<e;h++)n.create("tr",null,d);
else for(e=-e,h=0;h<e;h++)d.removeChild(d.lastChild);var q=a.rowCount-e,m=f||0<g,g=m?g:-g;w("tr",c).forEach(function(b,c){if(m){var d=c>=q?a.columnCount:g;for(c=0;c<d;c++){var e=n.create("td",null,b);n.create("span",null,e)}}else for(c=0;c<g;c++)b.removeChild(b.lastChild)});w("tr",c).forEach(function(b,c){p.set(b,"height",this._getRowHeight(c)+"px");b.className="";0==c&&l.add(b,"first-child");c==a.rowCount-1&&l.add(b,"last-child");w("td",b).forEach(function(b,d){b.className="";0==d&&l.add(b,"first-child");
d==a.columnCount-1&&l.add(b,"last-child");var e=a.dates[c][d],f=w("span",b)[0];this._setText(f,this.showCellLabel?this._formatGridCellLabel(e,c,d):null);this.styleGridCell(b,e,a)},this)},this)}},styleGridCellFunc:null,defaultStyleGridCell:function(a,b,c){l.add(a,this._cssDays[b.getDay()]);c=this.dateModule;this.isToday(b)?l.add(a,"dojoxCalendarToday"):null!=this.refStartTime&&null!=this.refEndTime&&(0<=c.compare(b,this.refEndTime)||0>=c.compare(c.add(b,"day",1),this.refStartTime))?l.add(a,"dojoxCalendarDayDisabled"):
this.isWeekEnd(b)&&l.add(a,"dojoxCalendarWeekend")},styleGridCell:function(a,b,c){this.styleGridCellFunc?this.styleGridCellFunc(a,b,c):this.defaultStyleGridCell(a,b,c)},_buildItemContainer:function(a,b){var c=this.itemContainerTable;if(c){var d=[],e=a.rowCount-(b?b.rowCount:0);8==y("ie")&&(null==this._itemTableSave?this._itemTableSave=t.clone(c):0>e&&(this.itemContainer.removeChild(c),this._recycleItemRenderers(!0),this._recycleExpandRenderers(!0),n.destroy(c),this.itemContainerTable=c=t.clone(this._itemTableSave),
this.itemContainer.appendChild(c),e=a.columnCount));var f=w("tbody",c),g,f=1==f.length?f[0]:n.create("tbody",null,c);if(0<e)for(var h=0;h<e;h++)g=n.create("tr",null,f),l.add(g,"dojoxCalendarItemContainerRow"),g=n.create("td",null,g),g=n.create("div",null,g),l.add(g,"dojoxCalendarContainerRow");else for(e=-e,h=0;h<e;h++)f.removeChild(f.lastChild);w(".dojoxCalendarItemContainerRow",c).forEach(function(a,b){p.set(a,"height",this._getRowHeight(b)+"px");d.push(a.childNodes[0].childNodes[0])},this);a.cells=
d}},resize:function(a){this.inherited(arguments);this._resizeHandler(null,!1)},_resizeHandler:function(a,b){var c=this.renderData;if(null==c)this.refreshRendering();else{if(c.sheetHeight!=this.itemContainer.offsetHeight&&(c.sheetHeight=this.itemContainer.offsetHeight,-1==this.getExpandedRowIndex()?(this._computeRowsHeight(),this._resizeRows()):this.expandRow(c.expandedRow,c.expandedRowCol,0,null,!0),c.invalidRowHeight)){delete c.invalidRowHeight;this.renderData=null;this.displayedItemsInvalidated=
!0;this.refreshRendering();return}this.layoutDuringResize||b?setTimeout(t.hitch(this,function(){this._layoutRenderers(this.renderData);this._layoutDecorationRenderers(this.renderData)}),20):(p.set(this.itemContainer,"opacity",0),this._recycleItemRenderers(),this._recycleExpandRenderers(),void 0!=this._resizeTimer&&clearTimeout(this._resizeTimer),this._resizeTimer=setTimeout(t.hitch(this,function(){delete this._resizeTimer;this._resizeRowsImpl(this.itemContainer,"tr");this._layoutRenderers(this.renderData);
this._layoutDecorationRenderers(this.renderData);0==this.resizeAnimationDuration?p.set(this.itemContainer,"opacity",1):B.fadeIn({node:this.itemContainer,curve:[0,1]}).play(this.resizeAnimationDuration)}),200))}},resizeAnimationDuration:0,getExpandedRowIndex:function(){return null==this.renderData.expandedRow?-1:this.renderData.expandedRow},collapseRow:function(a,b,c){var d=this.renderData;void 0==c&&(c=!0);void 0==a&&(a=this.expandDuration);if(d&&null!=d.expandedRow&&-1!=d.expandedRow)if(c&&a){c=
d.expandedRow;var e=d.expandedRowHeight;delete d.expandedRow;this._computeRowsHeight(d);var f=this._getRowHeight(c);d.expandedRow=c;this._recycleExpandRenderers();this._recycleItemRenderers();p.set(this.itemContainer,"display","none");this._expandAnimation=new B.Animation({curve:[e,f],duration:a,easing:b,onAnimate:t.hitch(this,function(a){this._expandRowImpl(Math.floor(a))}),onEnd:t.hitch(this,function(a){this._expandAnimation=null;this._collapseRowImpl(!1);this._resizeRows();p.set(this.itemContainer,
"display","block");setTimeout(t.hitch(this,function(){this._layoutRenderers(d)}),100);this.onExpandAnimationEnd(!1)})});this._expandAnimation.play()}else this._collapseRowImpl(c)},_collapseRowImpl:function(a){var b=this.renderData;delete b.expandedRow;delete b.expandedRowHeight;this._computeRowsHeight(b);if(void 0==a||a)this._resizeRows(),this._layoutRenderers(b)},expandRow:function(a,b,c,d,e){var f=this.renderData;if(!f||0>a||a>=f.rowCount)return-1;if(void 0==b||0>b||b>=f.columnCount)b=-1;void 0==
e&&(e=!0);void 0==c&&(c=this.expandDuration);void 0==d&&(d=this.expandEasing);var g=this._getRowHeight(a),h=f.sheetHeight-Math.ceil(this.cellPaddingTop*(f.rowCount-1));f.expandedRow=a;f.expandedRowCol=b;f.expandedRowHeight=h;e&&(c?(this._recycleExpandRenderers(),this._recycleItemRenderers(),p.set(this.itemContainer,"display","none"),this._expandAnimation=new B.Animation({curve:[g,h],duration:c,delay:50,easing:d,onAnimate:t.hitch(this,function(a){this._expandRowImpl(Math.floor(a))}),onEnd:t.hitch(this,
function(){this._expandAnimation=null;p.set(this.itemContainer,"display","block");setTimeout(t.hitch(this,function(){this._expandRowImpl(h,!0)}),100);this.onExpandAnimationEnd(!0)})}),this._expandAnimation.play()):this._expandRowImpl(h,!0))},_expandRowImpl:function(a,b){var c=this.renderData;c.expandedRowHeight=a;this._computeRowsHeight(c,c.sheetHeight-a);this._resizeRows();b&&this._layoutRenderers(c)},onExpandAnimationEnd:function(a){},_resizeRows:function(){0>=this._getRowHeight(0)||(this.rowHeaderTable&&
this._resizeRowsImpl(this.rowHeaderTable,"tr"),this.gridTable&&this._resizeRowsImpl(this.gridTable,"tr"),this.itemContainerTable&&this._resizeRowsImpl(this.itemContainerTable,"tr"))},_computeRowsHeight:function(a,b){var c=null==a?this.renderData:a;b=b||c.sheetHeight;b--;7==y("ie")&&(b-=c.rowCount);if(1==c.rowCount)c.rowHeight=b,c.rowHeightFirst=b,c.rowHeightLast=b;else{var d=null==c.expandedRow?c.rowCount:c.rowCount-1,e=b/d,f;f=b-Math.floor(e)*d;var g=Math.abs(b-Math.ceil(e)*d),d=1;f<g?(e=Math.floor(e),
g=f):(d=-1,e=Math.ceil(e));f=e+d*Math.floor(g/2);c.rowHeight=e;c.rowHeightFirst=f;c.rowHeightLast=f+g%2*d}},_getRowHeight:function(a){var b=this.renderData;return a==b.expandedRow?b.expandedRowHeight:0==b.expandedRow&&1==a||0==a?b.rowHeightFirst:b.expandedRow==this.renderData.rowCount-1&&a==this.renderData.rowCount-2||a==this.renderData.rowCount-1?b.rowHeightLast:b.rowHeight},_resizeRowsImpl:function(a,b){dojo.query(b,a).forEach(function(a,b){p.set(a,"height",this._getRowHeight(b)+"px")},this)},_setHorizontalRendererAttr:function(a){this._destroyRenderersByKind("horizontal");
this._set("horizontalRenderer",a)},_setLabelRendererAttr:function(a){this._destroyRenderersByKind("label");this._set("labelRenderer",a)},_destroyExpandRenderer:function(a){a.destroyRecursive&&a.destroyRecursive();C.destroy(a.domNode)},_setExpandRendererAttr:function(a){for(;0<this._ddRendererList.length;)this._destroyExpandRenderer(this._ddRendererList.pop());var b=this._ddRendererPool;if(b)for(;0<b.length;)this._destroyExpandRenderer(b.pop());this._set("expandRenderer",a)},_ddRendererList:null,_ddRendererPool:null,
_getExpandRenderer:function(a,b,c,d,e){if(null==this.expandRenderer)return null;var f=this._ddRendererPool.pop();null==f&&(f=new this.expandRenderer);this._ddRendererList.push(f);f.set("owner",this);f.set("date",a);f.set("items",b);f.set("rowIndex",c);f.set("columnIndex",d);f.set("expanded",e);return f},_recycleExpandRenderers:function(a){for(var b=0;b<this._ddRendererList.length;b++){var c=this._ddRendererList[b];c.set("Up",!1);c.set("Down",!1);a&&c.domNode.parentNode.removeChild(c.domNode);p.set(c.domNode,
"display","none")}this._ddRendererPool=this._ddRendererPool.concat(this._ddRendererList);this._ddRendererList=[]},_defaultItemToRendererKindFunc:function(a){return 1440<=Math.abs(this.renderData.dateModule.difference(a.startTime,a.endTime,"minute"))?"horizontal":"label"},naturalRowsHeight:null,_roundItemToDay:function(a){var b=a.startTime;a=a.endTime;this.isStartOfDay(b)||(b=this.floorToDay(b,!1,this.renderData));this.isStartOfDay(a)||(a=this.renderData.dateModule.add(a,"day",1),a=this.floorToDay(a,
!0));return{startTime:b,endTime:a}},_sortItemsFunction:function(a,b){this.roundToDay&&(a=this._roundItemToDay(a),b=this._roundItemToDay(b));var c=this.dateModule.compare(a.startTime,b.startTime);0==c&&(c=-1*this.dateModule.compare(a.endTime,b.endTime));return c},_overlapLayoutPass3:function(a){for(var b=0,c=0,d=[],e=x.position(this.gridTable).x,f=0;f<this.renderData.columnCount;f++){for(var g=!1,c=x.position(this._getCellAt(0,f)),b=c.x-e,c=b+c.w,h=a.length-1;0<=h&&!g;h--)for(var q=0;q<a[h].length;q++)if(g=
a[h][q],g=g.start<c&&b<g.end){d[f]=h+1;break}g||(d[f]=0)}return d},applyRendererZIndex:function(a,b,c,d,e,f){p.set(b.container,{zIndex:e||d?b.renderer.mobile?100:0:void 0==a.lane?1:a.lane+1})},_layoutDecorationRenderers:function(a){null==a||null==a.decorationItems||0>=a.rowHeight||(this.gridTable&&null==this._expandAnimation&&null!=this.horizontalDecorationRenderer?(this._layoutStep=a.columnCount,this.renderData.gridTablePosX=x.position(this.gridTable).x,this.inherited(arguments)):this.decorationRendererManager.recycleItemRenderers())},
_layoutRenderers:function(a){null==a||null==a.items||0>=a.rowHeight||(!this.gridTable||null!=this._expandAnimation||null==this.horizontalRenderer&&null==this.labelRenderer?this._recycleItemRenderers():(this.renderData.gridTablePosX=x.position(this.gridTable).x,this._layoutStep=a.columnCount,this._recycleExpandRenderers(),this._hiddenItems=[],this._offsets=[],this.naturalRowsHeight=[],this.inherited(arguments)))},_offsets:null,_layoutInterval:function(a,b,c,d,e,f){if(null!=this.renderData.cells)if("dataItems"===
f){var g=[];a=[];for(var h=0;h<e.length;h++){var q=e[h],m=this._itemToRendererKind(q);"horizontal"==m?g.push(q):"label"==m&&a.push(q)}e=this.getExpandedRowIndex();if(-1==e||e==b){e=[];h=null;q=[];if(0<g.length&&this.horizontalRenderer)var h=this._createHorizontalLayoutItems(b,c,d,g,f),k=this._computeHorizontalOverlapLayout(h,q);var r,g=[];0<a.length&&this.labelRenderer&&(r=this._createLabelLayoutItems(b,c,d,a),this._computeLabelOffsets(r,g));c=this._computeColHasHiddenItems(b,q,g);null!=h&&this._layoutHorizontalItemsImpl(b,
h,k,c,e,f);null!=r&&this._layoutLabelItemsImpl(b,r,c,e,q,f);this._layoutExpandRenderers(b,c,e);this._hiddenItems[b]=e}}else this.horizontalDecorationRenderer&&(h=this._createHorizontalLayoutItems(b,c,d,e,f),null!=h&&this._layoutHorizontalItemsImpl(b,h,null,!1,null,f))},_createHorizontalLayoutItems:function(a,b,c,d,e){var f=this.renderData,g=f.dateModule,h=f.rtl?-1:1,q=[];e="decorationItems"===e;for(var m=0;m<d.length;m++){var k=d[m],r=this.computeRangeOverlap(f,k.startTime,k.endTime,b,c),D=g.difference(b,
this.floorToDay(r[0],!1,f),"day"),l=f.dates[a][D],u=x.position(this._getCellAt(a,D,!1)),p=u.x-f.gridTablePosX;f.rtl&&(p+=u.w);if(e&&!k.isAllDay||!e&&!this.roundToDay&&!k.allDay)p+=h*this.computeProjectionOnDate(f,l,r[0],u.w);var p=Math.ceil(p),n=g.difference(b,this.floorToDay(r[1],!1,f),"day"),v;n>f.columnCount-1?(u=x.position(this._getCellAt(a,f.columnCount-1,!1)),v=f.rtl?u.x-f.gridTablePosX:u.x-f.gridTablePosX+u.w):(l=f.dates[a][n],u=x.position(this._getCellAt(a,n,!1)),v=u.x-f.gridTablePosX,f.rtl&&
(v+=u.w),!e&&this.roundToDay?this.isStartOfDay(r[1])||(v+=h*u.w):v+=h*this.computeProjectionOnDate(f,l,r[1],u.w));v=Math.floor(v);f.rtl&&(l=v,v=p,p=l);v>p&&(k=t.mixin({start:p,end:v,range:r,item:k,startOffset:D,endOffset:n},k),q.push(k))}return q},_computeHorizontalOverlapLayout:function(a,b){for(var c=this.renderData,d=this.horizontalRendererHeight,e=this.computeOverlapping(a,this._overlapLayoutPass3),f=this.percentOverlap/100,g=0;g<c.columnCount;g++){var h=e.addedPassRes[g],q=c.rtl?c.columnCount-
g-1:g;b[q]=0==f?0==h?0:1==h?d:d+(h-1)*(d+this.verticalGap):0==h?0:h*d-(h-1)*f*d+this.verticalGap;b[q]+=this.cellPaddingTop}return e},_createLabelLayoutItems:function(a,b,c,d){if(null!=this.labelRenderer){for(var e=this.renderData,f=e.dateModule,g=[],h=0;h<d.length;h++){var q=d[h];a=this.floorToDay(q.startTime,!1,e);for(var m=this.dateModule.compare;-1==m(a,q.endTime)&&-1==m(a,c);){var k=f.add(a,"day",1),k=this.floorToDay(k,!0),k=this.computeRangeOverlap(e,q.startTime,q.endTime,a,k),r=f.difference(b,
this.floorToDay(k[0],!1,e),"day");if(r>=this.columnCount)break;if(0<=r){var p=g[r];null==p&&(p=[],g[r]=p);p.push(t.mixin({startOffset:r,range:k,item:q},q))}a=f.add(a,"day",1);this.floorToDay(a,!0)}}return g}},_computeLabelOffsets:function(a,b){for(var c=0;c<this.renderData.columnCount;c++)b[c]=null==a[c]?0:a[c].length*(this.labelRendererHeight+this.verticalGap)},_computeColHasHiddenItems:function(a,b,c){for(var d=[],e=this._getRowHeight(a),f,g=0,h=0;h<this.renderData.columnCount;h++)f=null==b||null==
b[h]?this.cellPaddingTop:b[h],f+=null==c||null==c[h]?0:c[h],f>g&&(g=f),d[h]=f>e;this.naturalRowsHeight[a]=g;return d},_layoutHorizontalItemsImpl:function(a,b,c,d,e,f){c=this.renderData.cells[a];a=this._getRowHeight(a);for(var g=this.horizontalRendererHeight,h=this.percentOverlap/100,q=0;q<b.length;q++){var m=b[q],k=m.lane;if("dataItems"===f){var r=this.cellPaddingTop,r=0==h?r+k*(g+this.verticalGap):r+k*(g-h*g),k=!1,l=a;if(this.expandRenderer){for(l=m.startOffset;l<=m.endOffset;l++)if(d[l]){k=!0;break}l=
k?a-this.expandRendererHeight:a}if(r+g<=l){var k=this._createRenderer(m,"horizontal",this.horizontalRenderer,"dojoxCalendarHorizontal"),t=(l=this.isItemBeingEdited(m)&&!this.liveLayout&&this._isEditing)?a-this.cellPaddingTop:g,u=m.end-m.start;9<=y("ie")&&m.start+u<this.itemContainer.offsetWidth&&u++;p.set(k.container,{top:(l?this.cellPaddingTop:r)+"px",left:m.start+"px",width:u+"px",height:t+"px"});this._applyRendererLayout(m,k,c,u,t,"horizontal")}else for(r=m.startOffset;r<m.endOffset;r++)null==
e[r]?e[r]=[m.item]:e[r].push(m.item)}else k=this.decorationRendererManager.createRenderer(m,"horizontal",this.horizontalDecorationRenderer,"dojoxCalendarDecoration"),t=a,u=m.end-m.start,9<=y("ie")&&m.start+u<this.itemContainer.offsetWidth&&u++,p.set(k.container,{top:"0",left:m.start+"px",width:u+"px",height:t+"px"}),n.place(k.container,c),p.set(k.container,"display","block")}},_layoutLabelItemsImpl:function(a,b,c,d,e){for(var f,g,h=this.renderData,q=h.cells[a],m=this._getRowHeight(a),k=this.labelRendererHeight,
l=x.getMarginBox(this.itemContainer).w,n=0;n<b.length;n++)if(f=b[n],null!=f){f.sort(t.hitch(this,function(a,b){return this.dateModule.compare(a.range[0],b.range[0])}));var w=this.expandRenderer?c[n]?m-this.expandRendererHeight:m:m;g=null==e||null==e[n]?this.cellPaddingTop:e[n]+this.verticalGap;for(var u=x.position(this._getCellAt(a,n)),y=u.x-h.gridTablePosX,A=0;A<f.length;A++){if(g+k+this.verticalGap<=w){var v=f[A];t.mixin(v,{start:y,end:y+u.w});var z=this._createRenderer(v,"label",this.labelRenderer,
"dojoxCalendarLabel"),B=this.isItemBeingEdited(v)&&!this.liveLayout&&this._isEditing,C=B?this._getRowHeight(a)-this.cellPaddingTop:k;h.rtl&&(v.start=l-v.end,v.end=v.start+u.w);p.set(z.container,{top:(B?this.cellPaddingTop:g)+"px",left:v.start+"px",width:u.w+"px",height:C+"px"});this._applyRendererLayout(v,z,q,u.w,C,"label")}else break;g+=k+this.verticalGap}for(;A<f.length;A++)null==d[n]?d[n]=[f[A]]:d[n].push(f[A])}},_applyRendererLayout:function(a,b,c,d,e,f){var g=this.isItemBeingEdited(a),h=this.isItemSelected(a),
l=this.isItemHovered(a),m=this.isItemFocused(a),k=b.renderer;k.set("hovered",l);k.set("selected",h);k.set("edited",g);k.set("focused",this.showFocus?m:!1);k.set("moveEnabled",this.isItemMoveEnabled(a._item,f));k.set("storeState",this.getItemStoreState(a));"label"!=f&&k.set("resizeEnabled",this.isItemResizeEnabled(a,f));this.applyRendererZIndex(a,b,l,h,g,m);k.updateRendering&&k.updateRendering(d,e);n.place(b.container,c);p.set(b.container,"display","block")},_getCellAt:function(a,b,c){void 0!=c&&1!=
c||this.isLeftToRight()||(b=this.renderData.columnCount-1-b);return this.gridTable.childNodes[0].childNodes[a].childNodes[b]},_layoutExpandRenderers:function(a,b,c){if(this.expandRenderer){var d=this.renderData;if(d.expandedRow==a)null!=d.expandedRowCol&&-1!=d.expandedRowCol&&this._layoutExpandRendererImpl(d.expandedRow,d.expandedRowCol,null,!0);else if(null==d.expandedRow)for(var e=0;e<d.columnCount;e++)b[e]&&this._layoutExpandRendererImpl(a,d.rtl?d.columnCount-1-e:e,c[e],!1)}},_layoutExpandRendererImpl:function(a,
b,c,d){var e=this.renderData,f=t.clone(e.dates[a][b]),g=null,h=e.cells[a],g=this._getExpandRenderer(f,c,a,b,d);a=x.position(this._getCellAt(a,b));a.x-=e.gridTablePosX;this.layoutExpandRenderer(g,f,c,a,this.expandRendererHeight);n.place(g.domNode,h);p.set(g.domNode,"display","block")},layoutExpandRenderer:function(a,b,c,d,e){p.set(a.domNode,{left:d.x+"px",width:d.w+"px",height:e+"px",top:d.h-e-1+"px"})},_onItemEditBeginGesture:function(a){var b=this._edProps,c=b.editedItem,d=a.dates,e=this.newDate("resizeEnd"==
b.editKind?c.endTime:c.startTime);"label"!=b.rendererKind&&"move"==a.editKind&&(c.allDay||this.roundToDay)&&(b.dayOffset=this.renderData.dateModule.difference(this.floorToDay(d[0],!1,this.renderData),e,"day"));this.inherited(arguments)},_computeItemEditingTimes:function(a,b,c,d,e){var f=this.renderData.dateModule,g=this._edProps;if("label"!=c)if(a.allDay||this.roundToDay){var h=this.isStartOfDay(d[0]);switch(b){case "resizeEnd":!h&&a.allDay&&(d[0]=f.add(d[0],"day",1));case "resizeStart":h||(d[0]=
this.floorToDay(d[0],!0));break;case "move":d[0]=f.add(d[0],"day",g.dayOffset);break;case "resizeBoth":h||(d[0]=this.floorToDay(d[0],!0)),this.isStartOfDay(d[1])||(d[1]=this.floorToDay(f.add(d[1],"day",1),!0))}}else d=this.inherited(arguments);return d},getTime:function(a,b,c,d){var e=this.renderData;null!=a&&(c=x.position(this.itemContainer,!0),a.touches?(d=void 0==d?0:d,b=a.touches[d].pageX-c.x,c=a.touches[d].pageY-c.y):(b=a.pageX-c.x,c=a.pageY-c.y));d=x.getContentBox(this.itemContainer);0>b?b=
0:b>d.w&&(b=d.w-1);0>c?c=0:c>d.h&&(c=d.h-1);a=x.getMarginBox(this.itemContainer).w/e.columnCount;c=null==e.expandedRow?Math.floor(c/(x.getMarginBox(this.itemContainer).h/e.rowCount)):e.expandedRow;d=x.getContentBox(this.itemContainer);e.rtl&&(b=d.w-b);d=Math.floor(b/a);b=Math.floor(1440*(b-d*a)/a);a=null;c<e.dates.length&&d<this.renderData.dates[c].length&&(a=this.newDate(this.renderData.dates[c][d]),a=this.renderData.dateModule.add(a,"minute",b));return a},_onGridMouseUp:function(a){this.inherited(arguments);
this._gridMouseDown&&(this._gridMouseDown=!1,this._onGridClick({date:this.getTime(a),triggerEvent:a}))},_onGridTouchEnd:function(a){this.inherited(arguments);var b=this._gridProps;b&&(this._isEditing||(b.fromItem||b.editingOnStart||this.selectFromEvent(a,null,null,!0),b.fromItem||(this._pendingDoubleTap&&this._pendingDoubleTap.grid?(this._onGridDoubleClick({date:this.getTime(this._gridProps.event),triggerEvent:this._gridProps.event}),clearTimeout(this._pendingDoubleTap.timer),delete this._pendingDoubleTap):
(this._onGridClick({date:this.getTime(this._gridProps.event),triggerEvent:this._gridProps.event}),this._pendingDoubleTap={grid:!0,timer:setTimeout(t.hitch(this,function(){delete this._pendingDoubleTap}),this.doubleTapDelay)}))),this._gridProps=null)},_onRowHeaderClick:function(a){this._dispatchCalendarEvt(a,"onRowHeaderClick")},onRowHeaderClick:function(a){},expandRendererClickHandler:function(a,b){G.stop(a);var c=b.get("rowIndex"),d=b.get("columnIndex");this._onExpandRendererClick(t.mixin(this._createItemEditEvent(),
{rowIndex:c,columnIndex:d,renderer:b,triggerEvent:a,date:this.renderData.dates[c][d]}))},onExpandRendererClick:function(a){},_onExpandRendererClick:function(a){this._dispatchCalendarEvt(a,"onExpandRendererClick");a.isDefaultPrevented()||(-1!=this.getExpandedRowIndex()?this.collapseRow():this.expandRow(a.rowIndex,a.columnIndex))},snapUnit:"minute",snapSteps:15,minDurationUnit:"minute",minDurationSteps:15,triggerExtent:3,liveLayout:!1,stayInView:!0,allowStartEndSwap:!0,allowResizeLessThan24H:!1})});