
/*

  SmartClient Ajax RIA system
  Version v9.1p_2021-05-18/LGPL Development Only (2021-05-18)

  Copyright 2000 and beyond Isomorphic Software, Inc. All rights reserved.
  "SmartClient" is a trademark of Isomorphic Software, Inc.

  LICENSE NOTICE
     INSTALLATION OR USE OF THIS SOFTWARE INDICATES YOUR ACCEPTANCE OF
     ISOMORPHIC SOFTWARE LICENSE TERMS. If you have received this file
     without an accompanying Isomorphic Software license file, please
     contact licensing@isomorphic.com for details. Unauthorized copying and
     use of this software is a violation of international copyright law.

  DEVELOPMENT ONLY - DO NOT DEPLOY
     This software is provided for evaluation, training, and development
     purposes only. It may include supplementary components that are not
     licensed for deployment. The separate DEPLOY package for this release
     contains SmartClient components that are licensed for deployment.

  PROPRIETARY & PROTECTED MATERIAL
     This software contains proprietary materials that are protected by
     contract and intellectual property law. You are expressly prohibited
     from attempting to reverse engineer this software or modify this
     software for human readability.

  CONTACT ISOMORPHIC
     For more information regarding license rights and restrictions, or to
     report possible license violations, please contact Isomorphic Software
     by email (licensing@isomorphic.com) or web (www.isomorphic.com).

*/

if(window.isc&&window.isc.module_Core&&!window.isc.module_Calendar){isc.module_Calendar=1;isc._moduleStart=isc._Calendar_start=(isc.timestamp?isc.timestamp():new Date().getTime());if(isc._moduleEnd&&(!isc.Log||(isc.Log&&isc.Log.logIsDebugEnabled('loadTime')))){isc._pTM={message:'Calendar load/parse time: '+(isc._moduleStart-isc._moduleEnd)+'ms',category:'loadTime'};if(isc.Log&&isc.Log.logDebug)isc.Log.logDebug(isc._pTM.message,'loadTime');else if(isc._preLog)isc._preLog[isc._preLog.length]=isc._pTM;else isc._preLog=[isc._pTM]}isc.definingFramework=true;if(window.isc&&isc.version!="v9.1p_2021-05-18/LGPL Development Only"){isc.logWarn("SmartClient module version mismatch detected: This application is loading the core module from SmartClient version '"+isc.version+"' and additional modules from 'v9.1p_2021-05-18/LGPL Development Only'. Mixing resources from different SmartClient packages is not supported and may lead to unpredictable behavior. If you are deploying resources from a single package you may need to clear your browser cache, or restart your browser."+(isc.Browser.isSGWT?" SmartGWT developers may also need to clear the gwt-unitCache and run a GWT Compile.":""))}
isc.ClassFactory.defineClass("Calendar","Canvas","DataBoundComponent");isc.A=isc.Calendar.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.defaultWidth="100%";isc.A.defaultHeight="100%";isc.A.year=new Date().getFullYear();isc.A.month=new Date().getMonth();isc.A.baseStyle="calendar";isc.A.dayHeaderBaseStyle="calMonthDayHeader";isc.A.dayBodyBaseStyle="calMonthDayBody";isc.A.otherDayHeaderBaseStyle="calMonthOtherDayHeader";isc.A.otherDayBodyBaseStyle="calMonthOtherDayBody";isc.A.otherDayBlankStyle="calMonthOtherDayBlank";isc.A.minimumDayHeight=80;isc.A.selectedCellStyle="calendarCellSelected";isc.A.eventWindowStyle="eventWindow";isc.A.calMonthEventLinkStyle="calMonthEventLink";isc.A.workdayBaseStyle="calendarWorkday";isc.A.workdayStart="9:00am";isc.A.workdayEnd="5:00pm";isc.A.showWorkday=false;isc.A.workdays=[1,2,3,4,5];isc.A.scrollToWorkday=false;isc.A.minutesPerRow=30;isc.A.nameField="name";isc.A.descriptionField="description";isc.A.startDateField="startDate";isc.A.endDateField="endDate";isc.A.leadingDateField="leadingDate";isc.A.trailingDateField="trailingDate";isc.A.labelColumnWidth=60;isc.A.timelineEventPadding=0;isc.A.eventDragGap=10;isc.A.laneNameField="lane";isc.A.eventWindowStyleField="eventWindowStyle";isc.A.canEditField="canEdit";isc.A.canEditLaneField="canEditLane";isc.A.canRemoveField="canRemove";isc.A.canDragEventField="canDrag";isc.A.weekEventBorderOverlap=false;isc.A.eventSnapGap=20;isc.A.showQuickEventDialog=true;isc.A.canCreateEvents=true;isc.A.canEditEvents=true;isc.A.canRemoveEvents=true;isc.A.canDragEvents=true;isc.A.showDateChooser=false;isc.A.disableWeekends=true;isc.A.showWeekends=true;isc.A.showDayHeaders=true;isc.A.showOtherDays=true;isc.A.eventAutoArrange=true;isc.A.eventOverlap=true;isc.A.eventOverlapPercent=10;isc.A.alternateLaneFrequency=1;isc.A.showTimelineView=false;isc.A.renderEventsOnDemand=true;isc.A.timelineGranularity="day";isc.A.timelineUnitsPerColumn=1;isc.A.canResizeTimelineEvents=false;isc.A.defaultTimelineColumnSpan=20;isc.A.weekPrefix="Week";isc.A.showEventDescriptions=true;isc.A.allowEventOverlap=true;isc.A.sizeEventsToGrid=true;isc.A.dayViewTitle="Day";isc.A.weekViewTitle="Week";isc.A.monthViewTitle="Month";isc.A.timelineViewTitle="Timeline";isc.A.eventNameFieldTitle="Event Name";isc.A.eventStartDateFieldTitle="From";isc.A.eventEndDateFieldTitle="To";isc.A.eventDescriptionFieldTitle="Description";isc.A.eventLaneFieldTitle="Lane";isc.A.saveButtonTitle="Save Event";isc.A.detailsButtonTitle="Edit Details";isc.A.cancelButtonTitle="Cancel";isc.A.previousButtonHoverText="Previous";isc.A.nextButtonHoverText="Next";isc.A.addEventButtonHoverText="Add an event";isc.A.datePickerHoverText="Choose a date";isc.A.invalidDateMessage="From must be before To";isc.A.monthMoreEventsLinkTitle="+ \${eventCount} more...";isc.A.dayViewConstructor="DaySchedule";isc.A.weekViewConstructor="WeekSchedule";isc.A.monthViewConstructor="MonthSchedule";isc.A.timelineViewConstructor="TimelineView";isc.A.mainViewDefaults={_constructor:isc.TabSet,defaultWidth:"80%",defaultHeight:"100%",tabBarAlign:"right",selectedTab:1};isc.A.dateChooserConstructor="DateChooser";isc.A.eventDialogConstructor="Window";isc.A.eventDialogDefaults={showHeaderIcon:false,showMinimizeButton:false,showMaximumButton:false,canDragReposition:true,overflow:"visible",bodyProperties:{overflow:"visible"},width:400,height:100};isc.A.eventEditorLayoutConstructor="Window";isc.A.eventEditorLayoutDefaults={showHeaderIcon:false,showShadow:false,showMinimizeButton:false,showMaximumButton:false,canDragReposition:false};isc.A.eventEditorConstructor="DynamicForm";isc.A.eventEditorDefaults={padding:4,numCols:4,showInlineErrors:false,width:460,titleWidth:60};isc.A.addEventButtonConstructor="ImgButton";isc.A.addEventButtonDefaults={title:"",src:"[SKINIMG]actions/add.png",showRollOver:false,showDown:false,showFocused:false,width:16,height:16};isc.A.datePickerButtonConstructor="ImgButton";isc.A.datePickerButtonDefaults={title:"",src:"[SKIN]/controls/date_control.gif",width:16,height:16,showRollOver:false,showFocused:false};isc.A.showControlsBar=true;isc.A.controlsBarConstructor="HLayout";isc.A.controlsBarDefaults={defaultLayoutAlign:"center",height:25,membersMargin:5};isc.A.previousButtonConstructor="ImgButton";isc.A.previousButtonDefaults={title:"",src:"[SKINIMG]actions/back.png",showFocused:false,width:16,height:16,click:function(){this.creator.previous()},showRollOver:false,showDown:false};isc.A.nextButtonConstructor="ImgButton";isc.A.nextButtonDefaults={title:"",src:"[SKINIMG]actions/forward.png",showFocused:false,width:16,height:16,click:function(){this.creator.next()},showRollOver:false,showDown:false};isc.A.dateLabelConstructor="Label";isc.A.dateLabelDefaults={wrap:false,width:5,contents:"-"};isc.A.DAY="day";isc.A.WEEK="week";isc.A.MONTH="month";isc.A.TIMELINE="timeline";isc.A.rowHeight=isc.ListGrid.getInstanceProperty("cellHeight");isc.A.dateFormatter=null;isc.A.timeFormatter="toShortPaddedTime";isc.A.eventCanvasConstructor="EventWindow";isc.A.eventsOverlapGridLines=true;isc.A.$81i=/^\d{4}.\d\d?.\d\d?$/;isc.A.$81j=/^\d\d?.\d\d.\d{4}?$/;isc.A.newEventEditorWindowTitle="New Event";isc.A.monthMoreEventsMenuDefaults={_constructor:"Menu",autoDraw:false,visibility:"hidden"};isc.A.viewProps={getCalendar:function(){return this.creator},isSelectedView:function(){return this.calendar.getSelectedViewName()==this.viewName},isTimelineView:function(){return this.viewName=="timeline"},isDayView:function(){return this.viewName=="day"},isWeekView:function(){return this.viewName=="week"},isMonthView:function(){return this.viewName=="month"}};isc.A.gridProps={getPrintHTML:function(_1,_2){if(this.isMonthView())return this.Super("getPrintHTML",arguments);_1=isc.addProperties({},_1);this.body.printChildrenAbsolutelyPositioned=true;var _3=this.creator,_4=this.isTimelineView(),_5=this.isWeekView(),_6=this.isDayView(),_7=this.isMonthView();if(_7)return;var _8=this.getFields(),_9=this.getData(),_10=isc.StringBuffer.create(),_11=0,_12=[];for(var i=0;i<_8.length;i++){var _14=_8[i];var _15=this.getFieldHeaderButton(_14.masterIndex);var _16=_15?_15.width||_15.getVisibleWidth():null;if(_16==null)_16=this.getFieldWidth(_14);_12.add(_16)}
_11=_12.sum();var _17="<TR",_18="</TR>",_19=">",_20=" HEIGHT=",_21=" VALIGN=";var _22=40;_10.append("<TABLE cellspacing='0' WIDTH=",_11," style='position: absolute; top:",_22,"px; border: 1px solid grey;'>");if(this.showHeader){_10.append(this.getPrintHeaders(0,this.fields.length,_12))}
_22+=this.getHeaderHeight();_10.append("<TABLE WIDTH=",_11," role='presentation' border='' class='",this.baseStyle,"' ","style='borderSpacing:0px; position: absolute; top:",_22,"px; z-index: -1;' "," cellpadding='0' cellspacing='0'",">");for(var i=0;i<_9.length;i++){_10.append(_17,_20,this.getRowHeight(_9[i]),_19);for(var j=0;j<_8.length;j++){var _24=this.getCellValue(_9[i],i,j);_10.append("<TD padding=0 class='",this.getCellStyle(_9[i],i,j),"' ","style='margin: 0px; padding: 0px; ","width:",_12[j]+"px; ","border-width: 0px 1px 1px 0px; ","border-bottom: 1px solid #ABABAB; border-right: 1px solid #ABABAB; ","border-top: none; border-left: none;'>");_10.append(this.getCellValue(_9[i],i,j)||"&nbsp;");_10.append("</TD>")}
_10.append(_18)}
var _25=this.body.children;for(var i=0;i<_25.length;i++){var _26=_25[i],_27=_26.isEventCanvas||_26.isZoneCanvas||_26.isIndicatorCanvas;if(!_27)continue;if(!_26.isDrawn())continue;_10.append(_26.getPrintHTML(_1,_2))}
_10.append("</TR>");_10.append("</TABLE>");_10.append("</TABLE>");var _16=_10.release();return _16},getPrintHeaders:function(_1,_2,_3){var _4=(this.isRTL()?isc.Canvas.LEFT:isc.Canvas.RIGHT),_5=this.headerBaseStyle,_6;if(this.headerSpans){var _7=[],_8=1;for(var i=_1;i<_2;i++){var _10=this.getField(i);_7[i]=[_10];var _11=this.spanMap[_10.name];while(_11!=null){_7[i].add(_11);_11=_11.parentSpan}
_8=Math.max(_7[i].length,_8)}
_6=[];for(var i=_8-1;i>=0;i--){_6[_6.length]="<TR HEIGHT=22>";var _12=null,_13=null;for(var _14=_1;_14<_2;_14++){var _15=1,_16=1;var _17=(i==0);var _18=_7[_14][i];if(_18=="spanned"){continue}
var _19,_20=_14,_21=[];_16=0;while(_20<_2){var _22=null,_23=false;for(var _24=0;(i-_24)>=0;_24++){_22=_7[_20][i-_24];if(_22!=null){if(_18==null){_18=_22;_19=_24;if(i-_24==0){_17=true}}
if(_18==_22){_21[_16]=_24;_19=Math.min(_24,_19)}else{_23=true}
break}}
if(_23){break}
_20++;_16++}
if(_19!=null){_15=_19+1}
for(var _25=0;_25<_21.length;_25++)
{var _26=_7[_25+_14],_24=_21[_25];for(var _27=0;_27<=_24;_27++){if(_25==0&&_27==0){_26[i-_27]=_18}else if(_27<=_19){_26[i-_27]="spanned"}else{_26[i-_27]=null}}}
if(_18==null){this.logWarn("Error in getPrintHeaders() - unable to generate print header HTML from this component's specified headerSpans")}
var _28="center",_29=null;if(_17){_28=_18.align||_4;_29=this.getHeaderButtonTitle(_18.masterIndex)}else{_29=_18.title}
var _30=_6.length;_6[_6.length]="<TD class='";_6[_6.length]=_5;_6[_6.length]="' align='";_6[_6.length]="center";_6[_6.length]="' rowSpan='";_6[_6.length]=_15;_6[_6.length]="' colSpan='";_6[_6.length]=_16;_6[_6.length]="' ";_6[_6.length]="style='margin: 0px; padding: 0px; width:"+_3[_18.masterIndex]+"px; border-width: 0px 1px 1px 0px;' ";_6[_6.length]=">";_6[_6.length]=_29;_6[_6.length]="</TD>"}
_6[_6.length]="</TR>"}}else{_6=["<TR>"];var _31=["<TD CLASS='",_5,"' ALIGN="].join(""),_32=this.frozenBody?this.frozenBody.fields.length:0;if(this.frozenBody){for(var _33=0;_33<_32;_33++){var _10=this.frozenBody.fields[_33];if(!_10)continue;var _28=_10.align||_4;var _34=_3[_33];_6.addList([_31,_28," style='width:"+_34+"px; padding:0px; margin:0px;'>",this.getHeaderButtonTitle(_10.masterIndex),"</TD>"])}}
for(var _33=0;_33<(_2-_32);_33++){var _10=this.body.fields[_33];if(!_10)continue;var _28=_10.align||_4;var _34=_3[_33+_32];_6.addList([_31,_28,"  style='width:"+_34+"px;'>",this.getHeaderButtonTitle(_10.masterIndex),"</TD>"])}
_6[_6.length]="</TR>"}
return _6.join(isc.emptyString)},eventDragTargetDefaults:{_constructor:"Canvas",border:"1px dashed red",width:1,height:1,dragAppearance:"target",dragTarget:this,visibility:"hidden",keepInParentRect:true,setView:function(_1){this.view=_1},getEventPadding:function(){var _1=this.eventWin.calendar;if(this.view.isTimelineView())return _1.timelineEventPadding;return 0},getDragProps:function(){var _1=this.eventWin,_2=_1.calendar,_3=this.view,_4=_3.isTimelineView(),_5=_3.body,_6=_5.getEventRow(),_7=_5.getRowTop(_6),_8=_5.getRowHeight(_6),_9=_3.getEventLeft(_1.event)+1,_10=_5.getEventColumn(_9),_11=_5.getColumnLeft(_10),_12=_5.getColumnWidth(_10),_13=_5.getOffsetX()-_1.getLeft(),_14=_5.getOffsetY()-_1.getTop();return{top:_4?_7:_1.getTop(),bottom:_4?_7+_8:_1.getTop()+_1.getVisibleHeight(),left:_4?_1.getLeft():_11,right:_4?_1.getLeft()+_1.getVisibleWidth():_11+_12,startOffsetX:_13,startOffsetY:_14,getWidth:function(){return this.right-this.left},getHeight:function(){return this.bottom-this.top}}},fillOverlapSlots:true,positionToEventWin:function(_1){var _2=this.eventWin,_3=_2.calendar,_4=this.view,_5=_4.getEventLeft(_2.event)+this.getEventPadding(),_6=_2.getTop(),_7=_2.getVisibleWidth(),_8=_2.getVisibleHeight();if(this.fillOverlapSlots){if(_4.isTimelineView()){var _9=_4.getEventRow(_6);_6=_4.getRowTop(_9);_8=_4.getRowHeight(_9)}else{var _10=_4.body.getEventColumn(_5);_5=_4.body.getColumnLeft(_10);_7=_4.body.getColumnWidth(_10)}}
if(this.$1244){if(_4.isTimelineView()){_6=_4.body.getRowTop(_2.$1245.$8l)}else{_5=_4.body.getColumnLeft(_2.$1245.$644)}}
if(_5<0)_5=0;this.moveTo(_5,_6);this.resizeTo(_7,_8);if(_1){if(!this.isDrawn())this.draw();this.show();this.bringToFront()}},dragRepositionStart:function(){var _1=this.eventWin,_2=_1.calendar,_3=this.view,_4=_3.body;if(!_2.canEditEvent(_1.event))return false;this.$1246=true;var _5=_4.getEventRow(),_6=_4.getRowTop(_5),_7=_4.getRowHeight(_5),_8=_3.getEventLeft(_1.event)+1,_9=_4.getEventColumn(_8),_10=_4.getColumnLeft(_9),_11=_4.getColumnWidth(_9),_12=_4.getOffsetX()-_1.getLeft(),_13=_4.getOffsetY()-_1.getTop();var _14=_3.isTimelineView();var _15=_1.$1245={};_15.$126l=!_14;_15.$126m=true;_15.$126n=true;_15.$8l=_5;_15.$644=_9;_15.$1249=_7;_15.$1248=_11;_15.$117y=_14?_1.getVisibleWidth():_15.$1248;_15.$126o=_14?_15.$1249:_1.getVisibleHeight();_15.$962=_1.getTop()-_6;_15.$936=_5;_15.$937=_9;_15.$116y=_12;_15.$1247=_13;_15.$126p=Math.round(_15.$126o/_15.$1249);_15.$126q=_3.data.length-_15.$126p;_15.$126r=_3.getRowTop(_15.$126q);_15.$126s=_14?_4.getScrollWidth()-_15.$117y:_4.getColumnLeft(_4.fields.length-1);_15.$126t=_14?_4.getEventColumn(_15.$126s):_4.fields.length-1;this.positionToEventWin(true);return isc.EH.STOP_BUBBLING},dragRepositionMove:function(){var _1=this.eventWin,_2=_1.$1245,_3=_1.event,_4=_1.calendar,_5=this.view,_6=_5.isTimelineView(),_7=_5.body,_8=_7.getEventRow(),_9=Math.min(_2.$126q,_8<0?(_8==-1?0:_2.$126q):_8),_10=_7.getRowTop(_9),_11=Math.min(_2.$126t,_7.getEventColumn()),_12=_7.getColumnLeft(_11),_13=_7.getOffsetY(),_14=(Math.floor((_13-_10)/_4.eventSnapGap)*_4.eventSnapGap);var _15=(_7.getOffsetX()-_2.$116y),_16=_15-((_15-_12)%_4.eventSnapGap)+1,_17=_6?_10:Math.max(0,Math.min(_2.$126r,_10+_14)),_18=_5.getDateFromPoint(_16,_17,null,true),_19=Math.min(_2.$126s,(_6?_4.getDateLeftOffset(_18,_5)+_4.timelineEventPadding:_12)),_20=_19+_1.getVisibleWidth();var _21=_7.getEventColumn(_20);if(_21<0){this.moveTo(_2.$117z,_17);return isc.EH.STOP_BUBBLING}
if(_9!=_2.$936){if(_5.isTimelineView()){if(!_4.canEditEventLane(_3,_5)){_9=_2.$936;_10=_7.getRowTop(_9);_17=(_7.getTop()+_10+_2.$962)}}else{if(_9<0){_9=0;_17=0}else{var _22=_10+_2.$126o;var _23=_7.getEventRow(_10+_2.$126o-_2.$1249);if(_23<0){_9=_2.$936;_17=_7.getRowTop(_9)}else{_2.$936=_9}}}}
_2.$936=_9;if(_11!=_2.$937){if(_5.isDayView()||_5.isWeekView()){if(_5.isDayView()&&_4.showDayLanes&&!_4.canEditEventLane(_3,_5)){_11=_2.$937;_19=_2.$117z}else{if(_11==-1)_2.$937=0;else if(_11==-2)_2.$937=_2.$937;else _2.$937=_11;_19=_7.getColumnLeft(_2.$937)}}else{_2.$937=Math.max(1,_11)}}
if(_17<0)_17=0;_2.$125a=_17;if(_19<0)_19=0;_2.$117z=_19;this.moveTo(_19,_17);return isc.EH.STOP_BUBBLING},dragRepositionStop:function(){var _1=this.eventWin,_2=_1.$1245,_3=_1.calendar,_4=this.view,_5=_4.body,_6=_1.event;_1.parentElement.HSnapOrigin=0;var _7=_3.canEditEventLane(_6),_8=_2.$936,_9=_2.$125a,_10=(_4.isDayView()&&_7?_4.body.getEventColumn():_5.getEventColumn(_2.$117z+1)),_11;this.hide();if(_4.isTimelineView()){if(_8!=_2.$8l&&_8>=0){if(_7){var _12=_3.lanes?_3.lanes.get(_8):null;var _13=_12?_12.name||_12[_3.laneNameField]:null;_11=_13}else{_1.showLines();return false}}}else if(_4.isDayView()&&_3.showDayLanes){if(_10!=_2.$644&&_10>=0){if(_7){var _12=_3.lanes?_3.lanes.get(_10):null;var _13=_12?_12.name||_12[_3.laneNameField]:null;_11=_13}else{return false}}}
var _14=[_6[_3.startDateField].duplicate(),_6[_3.endDateField].duplicate()];if(_4.isTimelineView()){if(_6[_3.leadingDateField]&&_6[_3.trailingDateField]){_14.add(_6[_3.leadingDateField].duplicate());_14.add(_6[_3.trailingDateField].duplicate())}}
var _15=_1.ns.EH;var _16=_2.$117z;var _17=_9;var _18=_3.getDateFromPoint(_16+1,_17+1,true,_4);var _19=_18.duplicate();_19.setMinutes(_19.getMinutes()+_1.getEventLength());_14[0]=_18;_14[1]=_19;var _20=Math.floor((_18.getTime()-_6[_3.startDateField].getTime())/(1000*60));if(_6[_3.leadingDateField])_14[2].setMinutes(_14[2].getMinutes()+_20);if(_6[_3.trailingDateField])_14[3].setMinutes(_14[3].getMinutes()+_20);var _21={};if(_11)_21[_3.laneNameField]=_11;if(_6[_3.leadingDateField]&&_6[_3.trailingDateField]){_21[_3.leadingDateField]=_14[2];_21[_3.trailingDateField]=_14[3]}
if(_11==null)_11=_6[_3.laneNameField];if(_3.adjustEventTimes){var _22=_3.adjustEventTimes(_6,_1,_14[0],_14[1],_11);if(_22){_14[0]=_22[0].duplicate();_14[1]=_22[1].duplicate()}}
var _23=_3.checkForOverlap(_4,_1,_6,_14[0],_14[1],_11);if(_6.$646&&_6.$646.slotNum>0&&_23!=true){_6.$646.slotNum=_6.$126u=1;_6.$646.totalSlots=1}
if(_3.allowEventOverlap==false){if(_23==true){if(_3.timelineEventOverlap){_3.timelineEventOverlap(false,_6,_1,_14[0],_14[1],_11)}
return false}else if(isc.isAn.Array(_23)){_14[0]=_23[0].duplicate();_14[1]=_23[1].duplicate();if(_3.timelineEventOverlap){_3.timelineEventOverlap(true,_6,_1,_14[0],_14[1],_11)}}}
if(_4.isTimelineView()){if(_3.timelineEventMoved(_6,_14[0],_14[1],_11)==false)return false}else{if(_3.eventMoved(_14[0],_6,_11)==false)return false}
_3.updateEvent(_6,_14[0],_14[1],_6[_3.nameField],_6[_3.descriptionField],_21,true,_11);this.$1246=false;delete _1.$1245;return isc.EH.STOP_BUBBLING},dragResizeStart:function(){var _1=this.eventWin,_2=_1.calendar,_3=this.view,_4=_3.body;if(!_2.canEditEvent(_1.event))return false;this.$1244=true;var _5=_4.getEventRow(),_6=_4.getRowTop(_5),_7=_4.getRowHeight(_5),_8=_4.getEventColumn(),_9=_3.getEventLeft(_1.event)+1,_10=_4.getColumnWidth(_8),_11=_4.getOffsetX()-_1.getLeft(),_12=_4.getOffsetY()-_1.getTop(),_13=_1.getVisibleWidth();var _14=(_11<_13/2);_1.$1245={$8l:_5,$962:_3.$1246?_1.getTop()-_6:0,$644:_8,$937:_8,$936:_5,$116y:_11,$1247:_12,$117y:_13,$1170:_11+_13,$1248:_10,$1249:_7,$117z:_1.getLeft(),$1171:_1.getLeft()+_13,$125a:_3.isTimelineView()?_6:_1.getTop(),$125b:(_3.isTimelineView()?_7:_1.getVisibleHeight()),$1172:_14};this.positionToEventWin(true);return isc.EH.STOP_BUBBLING},dragResizeMove:function(){var _1=this.eventWin,_2=_1.$1245,_3=_1.event,_4=_1.calendar,_5=this.view,_6=this.view.body,_7=_6.getEventRow(),_8=_6.getRowTop(_7),_9=this.fillOverlapSlots?_8:(_6.getTop()+_8+_2.$962),_10=Math.max(0,_6.getEventColumn(_6.getOffsetX()-_2.$116y)),_11=_6.getColumnLeft(_10),_12=(_6.getOffsetX()-_2.$116y),_13=_12-((_12-_11)%_4.eventSnapGap)+1,_14=_5.getDateFromPoint(_13,_9,null,true),_15=(_5.isTimelineView()?_4.getDateLeftOffset(_14,_5)+_4.timelineEventPadding:_11),_16=_5.isTimelineView(),_17=_6.getOffsetY(),_18=(Math.floor((_17-_8)/_4.eventSnapGap)*_4.eventSnapGap);var _19,_20,_21,_22,_23,_24;if(_16){_19=_2.$125a;_24=_2.$125b;if(_2.$1172){_22=_2.$1171;_20=_6.getOffsetX()-(_6.getOffsetX()%_4.eventSnapGap)+_4.eventSnapGap;if(_20<0){this.setLeft(_2.$117z);this.setWidth(_2.$1171-_2.$117z);return isc.EH.STOP_BUBBLING}else if(_20>_22-_4.eventSnapGap){return isc.EH.STOP_BUBBLING}}else{_20=_2.$117z;_22=_6.getOffsetX()-(_6.getOffsetX()%_4.eventSnapGap)+_4.eventSnapGap;if(_22<_20+_4.eventSnapGap)_22=_20+_4.eventSnapGap;var _25=_6.getEventColumn(_22);if(_25<0){this.resizeTo(_2.$1171-_2.$117z);return isc.EH.STOP_BUBBLING}}
_23=_22-_20;this.setLeft(_20);this.setWidth(_23)}else{_19=_2.$125a;_20=_2.$117z;_22=_2.$1171;_17=_6.getOffsetY();_18=(Math.floor((_17-_8)/_4.eventSnapGap)*_4.eventSnapGap);_21=_6.getOffsetY()-(_6.getOffsetY()%_2.$1249)+_18;_21=Math.min(_6.getScrollHeight(),_21);_24=_21-_19;_23=_22-_20;this.setHeight(_24);this.setTop(_19)}
if(_5.isTimelineView()){if(_2.$1172)_2.$117z=_20;else _2.$1171=_22}else{_2.$125b=_24}
isc.logWarn("moving drag window to "+[_19,_20,_23,_24]);return isc.EH.STOP_BUBBLING},dragResizeStop:function(){var _1=this.eventWin,_2=_1.$1245,_3=_1.calendar,_4=this.view,_5=_1.event,_6,_7,_8=this.ns.EH,_9,_10=_8.dragMoveTarget;if(_4.isTimelineView()){var _11=_10.getLeft();var _12=this.eventWin.getLeft();if([_12,_12+1].contains(_11)){_6=_5[_3.startDateField].duplicate();var _13=_2.$1171;_7=_4.getDateFromPoint(_13,null,null,true)}else{_6=_4.getDateFromPoint(_11,null,null,true);_7=_5[_3.endDateField].duplicate()}}else{var _14=_2.$125a+_2.$125b;_6=_5[_3.startDateField].duplicate();_7=_4.getDateFromPoint(_1.$1245.$117z+2,_14,null,true)}
this.hide();this.$1244=false;delete _1.$1245;if(_4.isTimelineView()){if(_3.timelineEventResized(_5,_6,_7)==false)return false}else{if(_3.eventResized(_7,_5)==false)return false}
_3.updateEvent(_5,_6,_7,_5[_3.nameField],_5[_3.descriptionField],null,true,_5[_3.laneNameField]);return isc.EH.STOP_BUBBLING}},scrolled:function(){if(this.renderEventsOnDemand&&this.refreshVisibleEvents){var _1=this,_2=this.data;if(this.$57s)isc.Timer.clear(this.$57s);this.$57s=isc.Timer.setTimeout(function(){_1.refreshVisibleEvents()})}},resized:function(){this.Super('resized',arguments);if(this.renderEventsOnDemand&&this.isDrawn()&&this.getCalendar().hasData()){this.refreshVisibleEvents()}},forceDataSort:function(_1){var _2=this.getCalendar(),_3=[];if(this.isTimelineView()||(this.isDayView()&&_2.showDayLanes)){_3.add({property:_2.laneNameField,direction:"ascending"})}
if(_2.overlapSortSpecifiers){_3.addList(_2.overlapSortSpecifiers)}else{_3.add({property:_2.startDateField,direction:"ascending"})}
if(!_1){_1=_2.data;_2.$53e=true}
_1.setSort(_3)},findEventsInRange:function(_1,_2,_3,_4){var _5=this.getCalendar(),_6={},_7=_3!=null&&(this.isTimelineView()||(this.isDayView()&&_5.showDayLanes));_6[_5.startDateField]=_1;_6[_5.endDateField]=_2;if(_7)_6[_5.laneNameField]=_3;var _8=this.findOverlappingEvents(_6,_6,false,_7,_4);return _8},findOverlappingEvents:function(_1,_2,_3,_4,_5){var _6=this.getCalendar(),_7=_5!=null;var _8=_7?_5:_6.data;if(!_7)this.forceDataSort(_8);var _9=[],_10=_8.getLength(),_11=isc.DateUtil.getEndOf(_2[_6.startDateField],"d"),_12=isc.DateUtil.getStartOf(_2[_6.startDateField],"d");var _13={};var _14=_4?_1[_6.laneNameField]:null,_15=0;if(_14)_15=_8.findIndex(_6.laneNameField,_14);if(_15<0)return _9;for(var i=_15;i<_10;i++){var _17=_8.get(i);if(!_17){isc.logWarn('findOverlappingEvents: potentially invalid index: '+i);break}
if(_4&&_17[_6.laneNameField]!=_14)break;if(!_3&&_6.eventsAreSame(_17,_1)){continue}
if(this.isTimelineView()){if(_17[_6.leadingDateField]&&_17[_6.trailingDateField]){_13[_6.leadingDateField]=_2[_6.leadingDateField];_13[_6.trailingDateField]=_2[_6.trailingDateField];if(_13[_6.trailingDateField].getTime()>this.endDate.getTime()){_13[_6.trailingDateField].setTime(this.endDate.getTime()-1)}}else{_13[_6.startDateField]=_2[_6.startDateField];_13[_6.endDateField]=_2[_6.endDateField];if(_13[_6.endDateField].getTime()>this.endDate.getTime()){_13[_6.endDateField].setTime(this.endDate.getTime()-1)}}}else{if(_17[_6.startDateField].getTime()>_11.getTime())continue;if(_17[_6.endDateField].getTime()<_12.getTime())continue;_13[_6.startDateField]=_2[_6.startDateField];_13[_6.endDateField]=_2[_6.endDateField];if(_13[_6.endDateField].getTime()>_2[_6.endDateField].getTime()){_13[_6.endDateField].setTime(_2[_6.endDateField].getTime())}}
_13[_6.laneNameField]=_17[_6.laneNameField];if(this.eventsOverlap(_13,_17,_4)){_9.add(_17)}}
return _9},eventsOverlap:function(_1,_2,_3){var a=_1,b=_2,_6=this.getCalendar(),_7=_6.startDateField,_8=_6.endDateField;if(_3&&a[_6.laneNameField]!=b[_6.laneNameField])return false;if(this.isTimelineView()){if(a[_6.leadingDateField]&&b[_6.leadingDateField])_7=_6.leadingDateField;if(a[_6.trailingDateField]&&b[_6.trailingDateField])_8=_6.trailingDateField}
if(!a[_7]||!b[_7])return false;var _9=a[_7].getTime(),_10=a[_8].getTime(),_11=b[_7].getTime(),_12=b[_8].getTime();if(_6.equalDatesOverlap&&_6.allowEventOverlap){if((_9<_11&&_10>=_11&&_10<=_12)||(_9<=_12&&_10>_12)||(_9<=_11&&_10>=_12)||(_9>=_11&&_10<=_12)){return true}else{return false}}else{if(_11==_10||_12==_9){return!!_6.equalDatesOverlap}
if(_11<=_10&&_12>=_9)return true;return false}},updateEventRange:function(_1,_2){if(!isc.isAn.Object(_2))_2=this.overlapRanges.ranges[_2];var _3=_2.events;_3.remove(_1);this.updateOverlapRanges(_3)},updateOverlapRanges:function(_1){var _2=this.getCalendar(),_3=_1||_2.data,_4=this.overlapRanges||[],_5=_3.getLength(),_6=this.isTimelineView()||(this.isDayView()&&_2.showDayLanes),_7=!this.isTimelineView(),_8=[],_9=this.startDate,_10=this.endDate;if(isc.isA.ResultSet(_3)){_3=_3.allRows}
_3.setProperty("$122k",false);_3.setProperty("$646",null);_3.setProperty("$126u",null);var _11=_6&&_2.lanes?isc.getKeys(_2.getLaneMap()):[];for(var i=0;i<_5;i++){var _13=_3.get(i);if(_13.$122k)continue;if(_6&&!_11.contains(_13[_2.laneNameField])){continue}
_13.$122k=true;_13.$646={};var _14=false,_15={};_15[_2.startDateField]=_13[_2.startDateField];_15[_2.endDateField]=_13[_2.endDateField];if(_6)_15[_2.laneNameField]=_15.lane=_13[_2.laneNameField];_15.events=[];var _16=this.findOverlappingEvents(_13,_13,true,_6,_3);if(_16&&_16.length>0){_15.totalSlots=_16.length;var _17=_15.totalSlots;var _18=1;for(var j=0;j<_16.length;j++){var _20=_16[j];if(_20[_2.startDateField]<_15[_2.startDateField])
_15[_2.startDateField]=_20[_2.startDateField];if(_20[_2.endDateField]>_15[_2.endDateField])
_15[_2.endDateField]=_20[_2.endDateField];var _21=_20!=_13?this.findOverlappingEvents(_20,_20,true,_6,_3):[];if(_21&&_21.length>0){var _22=[];_21.map(function(_26){if(_26.$646)_22.add(_26.$646.totalSlots)});if(_22.max()!=_17){_17=Math.min(_22.max(),_17);_18++}}
var _23=_18;if(!_20.$646){_20.$122k=true;_20.$646={slotNum:_23,totalSlots:_18}}else{_20.$646.totalSlots=Math.max(_18,_20.$646.totalSlots);_20.$122l=true}}
_15.totalSlots=_18;_16.map(function(_26){if(_26.$122l)delete _26.$122l;else _26.$646.totalSlots=_18});_13.$646.totalSlots=_15.totalSlots;_15.events=_16;_14=true;for(var k=0;k<_4.length;k++){if(_15[_2.laneNameField]!=_4[k][_2.laneNameField])continue;var _25=this.eventsOverlap(_15,_4[k],true);if(_25){if(_15.totalSlots>_4[k].totalSlots){_13.$646.totalSlots=_15.totalSlots;_13.$646.slotCount=_15.totalSlots-_13.$646.slotNum}
this.mergeOverlapRanges(_15,_4[k]);if(!_8.contains(_4[k]))_8.add(_4[k]);_14=false}
if(!_14)break}}
if(_14){_4.add(_15);if(!_8.contains(_15))_8.add(_15)}}
for(i=0;i<_4.length;i++){var _15=_4[i];_15.events.setProperty("overlapRangeId",_4.length+i);if(!this.isTimelineView())_15.colNum=this.getColFromDate(_15[_2.startDateField])}
this.overlapRanges=_4;return _8},getTouchedOverlapRanges:function(_1,_2,_3){if(!this.overlapRanges)this.overlapRanges=[];var _4=true,_5=this.getCalendar(),_6=this.overlapRanges,r={},_8=[];r[_5.startDateField]=_1;r[_5.endDateField]=_2;r[_5.laneNameField]=_3;for(var k=0;k<_6.length;k++){var _10=_6[k];if(_3!=null&&_10[_5.laneNameField]!=_3)continue;var _11=this.eventsOverlap(r,_10,true);if(_11){_8.add(_10)}}
return _8},mergeOverlapRanges:function(_1,_2){if(!isc.isAn.Array(_1))_1=[_1];var _3=this.getCalendar(),_4=_3.startDateField,_5=_3.endDateField,b=_2;for(var i=0;i<_1.length;i++){var a=_1[i];if(a[_4]<b[_4])b[_4]=a[_4];if(a[_5]>b[_5])b[_5]=a[_5];if(a.totalSlots>b.totalSlots)b.totalSlots=a.totalSlots;b.events.addList(a.events);b.events=b.events.getUniqueItems()}},getEventLaneIndex:function(_1){return this.getLaneIndex(_1[this.getCalendar().laneNameField])},getEventLane:function(_1){return this.getLane(_1[this.getCalendar().laneNameField])},hasOverlapRanges:function(){return this.overlapRanges!=null&&this.overlapRanges.length>0},getLaneOverlapRanges:function(_1){if(!this.hasOverlapRanges())return;var _2=this.getCalendar(),_3=[];this.overlapRanges.map(function(_4){if(_4[_2.laneNameField]==_1)_3.add(_4)});return _3},getDayOverlapRanges:function(_1){if(!this.hasOverlapRanges())return;var _2=this.getColFromDate(_1);if(_2>=0)return this.getColOverlapRanges(_2)},getColOverlapRanges:function(_1){if(!this.hasOverlapRanges())return;var _2=this.overlapRanges.findAll("colNum",_1);return _2},removeOverlapRanges:function(_1){if(!this.hasOverlapRanges()||!_1)return;_1.map(function(_2){_2.events.setProperty("overlapRangeId",null)});this.overlapRanges.removeList(_1)},getEventOverlapRange:function(_1){if(!this.hasOverlapRanges())return;return this.overlapRanges[_1.overlapRangeId]},getDateOverlapRange:function(_1,_2){if(!this.hasOverlapRanges())return;var _3=this.getCalendar(),_4=_1.getTime();var _5=this.overlapRanges.map(function(_6){if(_4>=_6[_3.startDateField].getTime()&&_4<=_6[_3.endDateField].getTime()&&(!_2||_2==_6[_3.laneNameField]))
{return _6}});if(_5)_5.removeEmpty();return _5&&_5.length&&_5[0]?_5[0]:null},retagLaneEvents:function(_1){var _2=this.isTimelineView(),_3;if(!(_2||(this.isDayView()&&this.getCalendar().showDayLanes)))return;if(_2){_3=this.getLane(_1);this.retagRowEvents(_3,true)}else{_3=this.getLane(_1);this.retagColumnEvents(_3,true)}},retagDayEvents:function(_1){if(this.isTimelineView())return;var _2=this.getColFromDate(_1);this.retagColumnEvents(_2,false)},retagColumnEvents:function(_1,_2){if(this.isTimelineView())return;var _3;if(isc.isA.Number(_1)){_3=this.body.getField(_1)}else{_3=_1;_1=this.body.getFieldNum(_3)}
this.removeOverlapRanges(this.getColOverlapRanges(_1));var _4=this.getDateFromCol(_1);if(!_4)return;var _5=_4,_6=isc.DateUtil.getEndOf(_4,"d");var _7=this.findEventsInRange(_5,_6,(_2?_3.name:null));this.renderEvents(_7,_2)},retagRowEvents:function(_1){if(!this.isTimelineView())return;var _2=this.getCalendar(),_3;if(isc.isA.Number(_1)){_3=this.getRecord(_1)}else{_3=_1;_1=this.getRecordIndex(_3)}
var _4=_3[_2.laneNameField];this.removeOverlapRanges(this.getLaneOverlapRanges(_4));var _5=this.startDate,_6=this.endDate;var _7=this.findEventsInRange(_5,_6,_4);this.renderEvents(_7,true)},retagOverlapRange:function(_1,_2,_3){var _4=this.getCalendar(),_5=this.getTouchedOverlapRanges(_1,_2,_3),_6=_5?_5[0]:null,_7=_1.duplicate(),_8=_2.duplicate();if(_6){_5.removeAt(0);this.mergeOverlapRanges(_5,_6);_7=_6[_4.startDateField];_8=_6[_4.endDateField];this.removeOverlapRanges(_5);this.removeOverlapRanges([_6]);var _9=this.findEventsInRange(_7,_8,_3,_6.events);this.renderEvents(_6.events,(_3!=null))}else{var _9=this.findEventsInRange(_7,_8,_3,_4.data);this.renderEvents(_9,(_3!=null))}},sortForRender:function(_1){var _2=this.getCalendar(),_3=[];if(this.isTimelineView()||(this.isDayView()&&_2.showDayLanes)){_3.add({property:_2.laneNameField,direction:"ascending"})}
if(_2.overlapSortSpecifiers){_3.addList(_2.overlapSortSpecifiers)}else{_3.addList([{property:"$126u",direction:"ascending"},{property:_2.startDateField,direction:"ascending"}])}
_1.setSort(_3)},renderEvents:function(_1,_2){this.tagDataForOverlap(_1,_2);this.sortForRender(_1);var _3=this.getCalendar(),_4=this.body.getVisibleColumns(),_5=this;for(var i=0;i<_1.length;i++){var _7=_1.get(i),_8=_7.$646,_9=_2?_5.getLaneIndex(_7[_3.laneNameField]):null;if(!_2||(_9>=_4[0]&&_9<=_4[1])){var _10=_3.$64i(_7,_5);if(_10){_10.event=_7;_5.sizeEventWindow(_10,_5)}}}},sizeEventWindow:function(_1,_2){var _3=this.getCalendar(),_4=_1.event,_5=this.isTimelineView(),_6=_5||(this.isDayView()&&_3.showDayLanes);if(!_4||Array.isLoading(_4))return;var _7,_8,_9,_10;_12=this.getLaneIndex(_4[this.laneNameField]);if(_5){if(_12<0)_12=this.data.findIndex(this.laneNameField,_4[this.laneNameField]);_10=this.getLaneHeight(_12);_9=this.$732(_1);_8=this.getEventLeft(_4)}else{var _11;if(this.isDayView()&&_3.showDayLanes){var _12=_3.lanes.findIndex("name",_4[_3.laneNameField]);if(_12<0)_12=_3.lanes.findIndex(_3.laneNameField,_4[_3.laneNameField]);_11=_12}else{if(this.isDayView())_11=0;else _11=this.getColFromDate(_4[_3.startDateField])}
_8=this.body.getColumnLeft(_11);_9=this.body.getColumnWidth(_11);var _13=this.body.getRowHeight(1),_14=_4[_3.startDateField],_15=_4[_3.endDateField],_16=_15.getHours()==0&&_15.getDate()!=_14.getDate()?24:_15.getHours(),_17=false,_18=_3.getMinutesPerRow(this),_19=_3.getRowsPerHour(this);if(_4[_3.endDateField].getDate()>_4[_3.startDateField].getDate()){_17=true;_16=24}
_7=_4[_3.startDateField].getHours()*(_13*_19);_10=(_16-_4[_3.startDateField].getHours())*(_13*_19);_10-=1;if(_3.weekEventBorderOverlap&&this.isWeekView())_9+=1;if(_4[_3.startDateField].getMinutes()>0){_10-=_3.getMinutePixels(_4[_3.startDateField].getMinutes(),_13,this);_7+=_3.getMinutePixels(_4[_3.startDateField].getMinutes(),_13,this)}
if(_4[_3.endDateField].getMinutes()>0&&!_17){_10+=_3.getMinutePixels(_4[_3.endDateField].getMinutes(),_13,this)}
if(_3.weekEventBorderOverlap&&this.isWeekView())_9+=1;if(_3.eventsOverlapGridLines){_8-=1;_9+=1;_7-=1;_10+=1}}
var _20=_3.getEventTitle(_4,this),_21="";if(_4.headerBackgroundColor)_21+="backgroundColor: "+_4.headerBackgroundColor+";";if(_4.headerTextColor)_21+="backgroundColor: "+_4.headerTextColor+";";if(_21!="")_20="<span style='"+_21+"'>"+_20+"<span>";_1.setTitle(_20);if(_2)_1.hide();if(_5){_7=this.getRowTop(_12);if(this.timelineEventPadding>0){_7+=this.timelineEventPadding;_8+=this.timelineEventPadding;_9-=(this.timelineEventPadding*2);_10-=(this.timelineEventPadding*2)}
if(_3.eventsOverlapGridLines){if(_8>0)_8-=1;_9+=1;_7-=1;_10+=1}
if(this.eventDragGap>0){_9-=this.eventDragGap}}
this.adjustDimensionsForOverlap(_1,_8,_7,_9,_10);if(_3.showEventDescriptions!=false){_1.setDescriptionText(_4[_3.descriptionField])}else{_1.setDescriptionText(_4[_3.nameField])}
if(_5){if(_4[_3.leadingDateField]&&_4[_3.trailingDateField]){if(_1.$645)this.addLeadingAndTrailingLines(_1);else this.delayCall("addLeadingAndTrailingLines",[_1])}}},adjustDimensionsForOverlap:function(_1,_2,_3,_4,_5){var _6=this.getCalendar(),_7=_1.event.$646,_8=this.isTimelineView();if(_7&&_7.totalSlots>0){var _9=_8?Math.floor(_5/_7.totalSlots):Math.floor(_4/_7.totalSlots);if(_8){_5=_9;if(_7.slotCount)_5*=_7.slotCount;if(_7.totalSlots>1){_5-=Math.floor(this.timelineEventPadding/(_7.totalSlots))}
_3=_3+Math.floor((_9*(_7.slotNum-1)));if(_7.slotNum>1)_3+=(this.timelineEventPadding*(_7.slotNum-1))}else{_4=_9;if(_7.slotCount)Math.floor(_4*=_7.slotCount);_2=_2+Math.floor((_9*(_7.slotNum-1)));if(_6.eventOverlap&&_7.$64m!=false){if(_7.slotNum>1){_2-=Math.floor(_9*(_6.eventOverlapPercent/100));_4+=Math.floor(_9*(_6.eventOverlapPercent/100))}}
var _10=!_7?true:(_7.slotNum==_7.totalSlots||(_7.slotNum+_7.slotCount)-1==_7.totalSlots);if(_10){_4-=_6.eventDragGap}}
if(_7.totalSlots>1&&_6.eventsOverlapGridLines)_5+=1}
_1.renderEvent(_3,_2,_4,_5)},tagDataForOverlap:function(_1,_2){if(_1.getLength()==0)return;var _3=this.getCalendar(),_4=[],_5=0,_6=0,_7=0,_8=this.isTimelineView();if(_3.eventAutoArrange==false)return;this.forceDataSort(_1);var _9=_1.get(0),_10=_9[_3.laneNameField];var _11=[];_1.setProperty("$646",null);_1.setProperty("$126u",null);var _12=this.isTimelineView()||(this.isDayView()&&_3.showDayLanes);var _13=this.updateOverlapRanges(_1);var _14=[];if(_8||(this.isDayView()&&_3.showDayLanes)){_14.add({property:_3.laneNameField,direction:"ascending"})}
if(_3.overlapSortSpecifiers){_14.addList(_3.overlapSortSpecifiers)}else{_14.add({property:_3.startDateField,direction:"ascending"});_14.add({property:"eventLength",direction:"descending"})}
for(var j=0;j<_13.length;j++){var _16=_13[j];var _17=_16.events;_17.setSort(_14);var _18=[];var _19=1;for(var i=0;i<_17.getLength();i++){var _21=_17.get(i);_2=_21[_3.laneNameField];_21.$646={};var _22=null;var _23=1;if(_18.length>0){var _24=[],_25=false,_26=1,_27=1,_28=1;for(var k=0;k<_18.length;k++){var _30=_18[k],r=isc.addProperties({},_21),_32=_30.$646;if(this.eventsOverlap(r,_30,_12)){if(_3.eventOverlap){if(!_3.eventOverlapIdenticalStartTimes){var _33=(r[_3.startDateField].getTime()==_30[_3.startDateField].getTime());if(_33){_22=_32.slotNum}}else{_21.$646.$64m=true}}
if(!_25){_25=true;if(_32.slotNum>=_23){if(_32.slotNum==_23+1){_21.$646.endSlotNum=_32.slotNum;_21.$646.slotCount=_32.slotNum-_23;break}else if(_32.slotNum==_23){_23++;_32.endSlotNum=_23;_32.slotCount=_23-_32.slotNum}
continue}}
if(_32.slotNum==_21.$646.endSlotNum){_21.$646.slotCount=_21.$646.endSlotNum-_23;break}
if(_32.slotNum==_23){var _34=_32.slotCount;if(_34==null)_34=1;_23=_32.slotNum+1}else if(_32.slotNum>_23){_21.$646.slotCount=_32.slotNum-_23;break}
if(_32.slotCount==null){_24.add(_30)}}}
if(_24.length){for(var k=0;k<_24.length;k++){var _35=_24[k];_35.$646.slotCount=_23-_35.$646.slotNum}}}
_21.$646.slotNum=_21.$126u=_23;if(_22!=null&&_22<_23)
_21.$646.$64m=false;if(_23>_19){_19=_23}
_18.add(_21)}
_17.map(function(_36){if(!_36.$646.slotCount){_36.$646.slotCount=(_19-_36.$646.slotNum)+1}
_36.$646.totalSlots=_19})}
return _11},getVisibleDateRange:function(){var _1=this.getCalendar();if(!this.renderEventsOnDemand){if(this.isTimelineView()){return[this.startDate.duplicate(),this.endDate.duplicate()]}else if(this.isWeekView()){return[_1.chosenWeekStart,_1.chosenWeekEnd]}else if(this.isDayView()){return[isc.DateUtil.getStartOf(_1.chosenDate,"D"),isc.DateUtil.getEndOf(_1.chosenDate,"D")]}else if(this.isMonthView()){return[isc.DateUtil.getStartOf(_1.chosenDate,"M"),isc.DateUtil.getEndOf(_1.chosenDate,"M")]}}
var _2=this.body.getScrollLeft(),_3=_2+this.body.getVisibleWidth(),_4=this.body.getEventColumn(_2+1),_5=this.body.getEventColumn(_3),_6=this.body.getScrollTop(),_7=_6+this.body.getVisibleHeight(),_8=this.body.getEventRow(_6+1),_9=this.body.getEventRow(_7);if(_9<0)_9=this.data.getLength()-1;if(_5<0)_5=this.body.fields.length-1;var _10=this.getCellDate(_8,_4),_11=this.getCellDate(_9,_5);return[_10,_11]},getVisibleRowRange:function(){if(!this.renderEventsOnDemand){return[0,this.data.getLength()]}
return this.getVisibleRows()},getVisibleColumnRange:function(){if(!this.renderEventsOnDemand){return[0,this.data.getLength()]}
return this.body.getVisibleColumns()},refreshVisibleEvents:function(_1){if(!this.isDrawn()||!this.body||!this.body.isDrawn())return;if(!this.$128q){this.refreshEvents();return}
_1=_1||this.getVisibleEvents();if(_1&&_1.length>0){this.sortForRender(_1)}
var _2=_1.getLength();this.logDebug('refreshing visible events','calendar');var _3=this.poolEventWindows?this.$128q.duplicate():[],_4=[];for(var i=0;i<_2;i++){var _6=_1.get(i),_7=this.$128q.contains(_6);if(_7){_3.remove(_6);var _8=this.getCurrentEventCanvas(_6);this.sizeEventWindow(_8,true);continue}
_4.add(_6)}
if(this.poolEventWindows&&_3.length>0){for(var i=0;i<_3.length;i++){var _8=this.getCurrentEventCanvas(_3[i]);if(_8)this.clearEventCanvas(_8)}}
if(_4.length>0){var _9=_4.length;for(var i=0;i<_9;i++){var _6=_4[i];if(!this.$128q.contains(_6))this.$128q.add(_6);this.addEvent(_6,false)}}
var _10=this.getCalendar();if(_10.eventsRendered&&isc.isA.Function(_10.eventsRendered))
_10.eventsRendered()},getVisibleEvents:function(){var _1=this.getCalendar(),_2=this.isTimelineView(),_3=_1.showDayLanes&&this.isDayView(),_4=this.getVisibleDateRange(),_5=(_2||_3),_6=_5?(_2?this.getVisibleRowRange():this.getVisibleColumnRange()):null;if(!this.renderEventsOnDemand)return _1.data;var _7=_1.data,_8=_4[0].getTime(),_9=_4[1].getTime(),_10=_7.getLength(),_11=[];for(var i=0;i<_10;i++){var _13=_7.get(i);if(isc.isA.String(_13))return[];if(!_13){isc.logWarn('getVisibleEvents: potentially invalid index: '+i);break}
var _14={};if(_5){var _15=this.getEventLaneIndex(_13);if(_15==null||_15<_6[0]||_15>_6[1])
continue;_14[_1.laneNameField]=_13[_1.laneNameField]}
if(_2){if(_13[_1.leadingDateField]&&_13[_1.trailingDateField]){_14[_1.leadingDateField]=_4[0];_14[_1.trailingDateField]=_4[1]}else{_14[_1.startDateField]=_4[0];_14[_1.endDateField]=_4[1]}}else{_14[_1.startDateField]=_4[0];_14[_1.endDateField]=_4[1]}
if(this.eventsOverlap(_14,_13,_5)){_11.add(_13)}}
return _11},removeEvent:function(_1){var _2=this.getCurrentEventCanvas(_1);if(_2){this.clearEventCanvas(_2,!this.poolEventWindows);return true}else{return false}},getCurrentEventCanvas:function(_1){var _2=this.getCalendar().getEventCanvasID(this,_1);var _3=window[_2];return _3},poolEventCanvas:function(_1){if(!this.$128h)this.$128h=[];if(this.body){if(_1.event){this.getCalendar().setEventCanvasID(this,_1.event,null);_1.event=null}
_1.$128k=true;if(this.$129c)this.$129c.remove(_1);if(!this.$128h.contains(_1))this.$128h.add(_1);return true}else return false},getPooledEventCanvas:function(_1){if(!this.$128h)this.$128h=[];if(!this.body)return;var _2=this.$128h,_3=this.getCalendar(),_4;if(_2.length>0){var _5=_2.findIndex("$128k",true);if(_5<0)return null;_4=_2[_5];_4.$128k=false;_3.setEventCanvasID(this,_1,_4.ID);_2.remove(_4)}
return _4},clearEventCanvas:function(_1,_2){if(_1){if(!isc.isAn.Array(_1))_1=[_1];var _3=_1.length;while(--_3>=0){var _4=_1[_3];if(_4.hide)_4.hide();if(_4.clear)_4.clear();if(this.$129c)this.$129c.remove(_4);if(this.$128q)this.$128q.remove(_4.event);if(this.poolEventWindows&&!_2){this.poolEventCanvas(_4)}else{_4.destroy();_4=null}}}},clearEvents:function(_1,_2){var _3=this.$128h;if(!this.body||!this.body.children||!_3)return;if(!_1)_1=0;if(_2==null)_2=!this.poolEventWindows;var _4=this.$129c,_5=_4.length;while(--_5>=0){if(_4[_5]){if(_4[_5].$128k){this.clearEventCanvas(_4[_5],_2)}}}
_4.removeEmpty()}};isc.B.push(isc.A.getEventTitle=function isc_Calendar_getEventTitle(_1,_2){var _3=_2.isTimelineView()?null:isc.Time.toTime(_1[this.startDateField],this.timeFormatter,true),_4=(_3?_3+" ":"")+_1[this.nameField];return _4});isc.evalBoundary;isc.B.push(isc.A.getMinutesPerRow=function isc_Calendar_getMinutesPerRow(_1){_1=_1||this.getSelectedView();return this.minutesPerRow},isc.A.getMinutesPerCol=function isc_Calendar_getMinutesPerCol(_1){return isc.DateUtil.convertPeriodUnit(1,this.timelineGranularity,"mn")},isc.A.getSnapGapMinutes=function isc_Calendar_getSnapGapMinutes(_1,_2,_3){_1=_1||this.getSelectedView();if(_2==null)_2=0;if(_3==null)_3=0;var _4=_1.isTimelineView(),_5=_4?_1.body.getColumnWidth(_3):_1.getRowHeight(_2),_6=_4?this.getMinutesPerCol(_1):this.getMinutesPerRow(_1),_7=Math.floor(_6/(_5/this.eventSnapGap));return _7},isc.A.addSnapGapsToDate=function isc_Calendar_addSnapGapsToDate(_1,_2,_3){if(!_1)return null;_2=_2||this.getSelectedView();if(!_3)_3=1;var _4=this.getSnapGapMinutes(_2);var _5=_1.duplicate();_5.setMinutes(_5.getMinutes()+(_4*_3));return _5},isc.A.getRowsPerHour=function isc_Calendar_getRowsPerHour(_1){return Math.floor(60/this.getMinutesPerRow())},isc.A.getMinutePixels=function isc_Calendar_getMinutePixels(_1,_2,_3){_3=_3||this.getSelectedView();if(_3.isTimelineView()){var _4=_2!=null?_2:_3.columnWidth;return Math.round((_4/60)*_1)}else if(_3.isDayView()||_3.isWeekView()){var _5=(_2!=null?_2:_3.getRowHeight(0))*
this.getRowsPerHour(_3);return Math.round((_5/60)*_1)}},isc.A.getRowFromDate=function isc_Calendar_getRowFromDate(_1,_2){var _3=this.getMinutesPerRow(_1),_4=this.getRowsPerHour(_1),_5=Math.floor(_2.getMinutes()/_3),_6=(_2.getMinutes()%_3==0?0:1),_7=(_2.getHours()*_4)+_5+_6;return _7},isc.A.scrollToTime=function isc_Calendar_scrollToTime(_1){var _2=this.getSelectedView();_1=isc.Time.parseInput(_1);if(isc.isA.Date(_1)){var _3=this.getRowFromDate(_2,_1);var _4=_2.getRowHeight(null,0)*_3;_2.body.scrollTo(0,_4);_2.redraw()}},isc.A.setHeaderLevels=function isc_Calendar_setHeaderLevels(_1){this.headerLevels=_1;if(this.timelineView)this.timelineView.rebuild(true)},isc.A.getWorkdayStart=function isc_Calendar_getWorkdayStart(_1,_2){return this.workdayStart},isc.A.getWorkdayEnd=function isc_Calendar_getWorkdayEnd(_1,_2){return this.workdayEnd},isc.A.getVisibleStartDate=function isc_Calendar_getVisibleStartDate(_1){_1=_1||this.getSelectedView();if(!_1||isc.isAn.emptyString(_1))return null;return!_1.body?_1.startDate:_1.getCellDate(0,0)},isc.A.getVisibleEndDate=function isc_Calendar_getVisibleEndDate(_1){_1=_1||this.getSelectedView();if(!_1||isc.isAn.emptyString(_1))return null;if(!_1.body)return _1.endDate;var _2=_1.getData().length-1,_3=_1.body.fields.length-1;if(_1.getCellEndDate)return _1.getCellEndDate(_2,_3);return _1.getCellDate(_2,_3)},isc.A.getPeriodStartDate=function isc_Calendar_getPeriodStartDate(){var _1=this.getSelectedView(),_2=this.chosenDate;if(_1.isDayView()){return _2}else if(_1.isWeekView()){return isc.DateUtil.getStartOf(_2,isc.DateUtil.getTimeUnitKey("week"))}else if(_1.isMonthView()){return isc.DateUtil.getStartOf(_2,isc.DateUtil.getTimeUnitKey("month"))}},isc.A.getPeriodEndDate=function isc_Calendar_getPeriodEndDate(){var _1=this.getSelectedView(),_2=this.chosenDate;if(_1.isDayView()){return _2}else if(_1.isWeekView()){return isc.DateUtil.getEndOf(_2,isc.DateUtil.getTimeUnitKey("week"))}else if(_1.isMonthView()){return isc.DateUtil.getEndOf(_2,isc.DateUtil.getTimeUnitKey("month"))}},isc.A.setLanes=function isc_Calendar_setLanes(_1){if(!_1){return}
this.lanes=_1;if(this.timelineView){this.timelineView.setLanes(this.lanes)}
if(this.showDayLanes&&this.dayView){this.dayView.setLanes(this.lanes)}},isc.A.addLane=function isc_Calendar_addLane(_1,_2){var _3;if(this.timelineViewSelected()){_3=this.timelineView}
else if(this.dayViewSelected()&&this.showDayLanes){_3=this.dayView}
if(!_3){return}
if(!this.lanes)this.lanes=[];if(_2==null)_2=this.lanes.length;this.lanes.add(_1,_2);_3.setLanes(this.lanes)},isc.A.removeLane=function isc_Calendar_removeLane(_1){var _2;if(this.timelineViewSelected())_2=this.timelineView;else if(this.dayViewSelected()&&this.showDayLanes)_2=this.dayView;if(!_2||!this.lanes)return;if(isc.isA.String(_1))_1=this.lanes.find("name",_1);if(_1){this.lanes.remove(_1);_2.setLanes(this.lanes)}},isc.A.setShowDayLanes=function isc_Calendar_setShowDayLanes(_1){if(this.showDayLanes==_1)return;this.showDayLanes=_1;if(this.dayView){this.dayView.$123r=this.dayView.body.getScrollTop();this.dayView.rebuildFields();if(this.dayViewSelected()){this.dayView.refreshEvents()}else{this.dayView.$123s=true}}},isc.A.initWidget=function isc_Calendar_initWidget(){if(!this.chosenDate){if(this.startDate)this.chosenDate=this.startDate.duplicate();else this.chosenDate=new Date()}
this.year=this.chosenDate.getFullYear();this.month=this.chosenDate.getMonth();if(this.firstDayOfWeek==null)
this.firstDayOfWeek=Number(isc.DateChooser.getInstanceProperty("firstDayOfWeek"));if(this.timelineSnapGap!=null){this.snapGap=this.timelineSnapGap;delete this.timelineSnapGap}
if(this.timelineStartDate!=null){this.startDate=this.timelineStartDate.duplicate();delete this.timelineStartDate}
if(this.timelineEndDate!=null){this.endDate=this.timelineEndDate.duplicate();delete this.timelineEndDate}
if(this.timelineLabelFields!=null){this.laneFields=this.timelineLabelFields;this.timelineLabelFields=null}
if(this.eventTypeData!=null){this.lanes=isc.clone(this.eventTypeData);this.eventTypeData=null}
if(this.eventTypeField!=null){this.laneNameField=this.eventTypeField;delete this.eventTypeField}
if(this.showDescription!=null){this.showEventDescriptions=this.showDescription;delete this.showDescription}
if(this.canEditEventType!=null){this.canEditLane=this.canEditEventType;delete this.canEditEventType}
if(this.canDeleteEvents!=null){this.canRemoveEvents=this.canDeleteEvents;delete this.canDeleteEvents}
if(this.overlapSortSpecifiers&&!isc.isAn.Array(this.overlapSortSpecifiers)){this.overlapSortSpecifiers=[this.overlapSortSpecifiers]}
if(!this.data)this.data=this.getDefaultData();this.previousButtonDefaults.prompt=this.previousButtonHoverText;this.nextButtonDefaults.prompt=this.nextButtonHoverText;this.datePickerButtonDefaults.prompt=this.datePickerHoverText;this.addEventButtonDefaults.prompt=this.addEventButtonHoverText;this.$529();this.createChildren();this.$53a();if(!this.initialCriteria&&this.autoFetchData){this.initialCriteria=this.getNewCriteria(null)}
this.setData(null);this.invokeSuper(isc.Calendar,"initWidget");this.createEditors()},isc.A.autoDetectFieldNames=function isc_Calendar_autoDetectFieldNames(){this.dataSource=isc.DS.getDataSource(this.dataSource);var _1=this.dataSource,_2=isc.getValues(_1.getFields()),_3=1024000,_4,_5;if(this.fieldIsMissing(this.nameField,_1)){this.nameField=_1.getTitleField()}
if(this.fieldIsMissing(this.descriptionField,_1)){_2.sortByProperties(["length"],[false]);_4={length:0};for(var i=0;i<_2.length;i++){_5=_2.get(i);if(!_5.type||_5.type=="text"||_5.type=="string"){if(_5.length>255&&_5.length<_3){this.descriptionField=_5.name;break}else if(_5.length&&_5.length<_3&&_5.length>_4.length){_4=_5}else if(!_5.length){if(!_4)_4=_5}}}
if(this.fieldIsMissing(this.descriptionField,_1)&&_4)
this.descriptionField=_4.name}
if(this.fieldIsMissing(this.startDateField,_1)){_4=null;for(var i=0;i<_2.length;i++){_5=_2.get(i);if((_5.type=="date"||_5.type=="datetime")){if(_5.name.toLowerCase().indexOf("start")>=0||_5.name.toLowerCase().indexOf("begin")>=0)
{this.startDateField=_5.name;break}else _4=_5}}
if(this.fieldIsMissing(this.startDateField,_1)&&_4)
this.startDateField=_4.name}
if(this.fieldIsMissing(this.endDateField,_1)){_4=null;for(var i=0;i<_2.length;i++){_5=_2.get(i);if((_5.type=="date"||_5.type=="datetime")){if(_5.name.toLowerCase().indexOf("end")>=0||_5.name.toLowerCase().indexOf("stop")>=0)
{this.endDateField=_5.name;break}else if(_5.name!=this.startDateField)
_4=_5}}
if(this.fieldIsMissing(this.endDateField,_1)&&_4)
this.endDateField=_4.name}},isc.A.fieldIsMissing=function isc_Calendar_fieldIsMissing(_1,_2){return(!_1||_1==""||(_2&&!_2.getField(_1)))},isc.A.getDefaultData=function isc_Calendar_getDefaultData(){return[]},isc.A.setData=function isc_Calendar_setData(_1){if(this.data==_1)return;if(this.data){this.ignore(this.data,"dataChanged");if(this.data.$31k&&isc.isA.Function(this.data.destroy))
this.data.destroy()}
if(_1)this.data=_1;if(!this.data)return;this.observe(this.data,"dataChanged","observer.dataChanged()");if(this.hasData()){this.dataChanged()}},isc.A.getData=function isc_Calendar_getData(){return this.data},isc.A.hasData=function isc_Calendar_hasData(){if(!this.data||(isc.ResultSet&&isc.isA.ResultSet(this.data)&&!this.data.lengthIsKnown()))
{return false}else{return true}},isc.A.dataChanged=function isc_Calendar_dataChanged(){if(this.destroying||this.destroyed)return;if(this.$53e){this.logDebug('dataChanged, ignoring','calendar');this.$53e=false}else{this.logDebug('dataChanged, refreshing','calendar');this.refreshSelectedView()}},isc.A.destroy=function isc_Calendar_destroy(){if(this.data)this.ignore(this.data,"dataChanged");this.Super("destroy",arguments)},isc.A.refreshSelectedView=function isc_Calendar_refreshSelectedView(){if(this.dayViewSelected()){this.dayView.refreshEvents();if(this.monthView)this.monthView.refreshEvents()}else if(this.weekViewSelected()){this.weekView.refreshEvents();if(this.monthView)this.monthView.refreshEvents()}else if(this.monthViewSelected()){this.monthView.refreshEvents()}else if(this.timelineViewSelected()){this.timelineView.refreshEvents()}},isc.A.getSelectedView=function isc_Calendar_getSelectedView(){if(this.dayViewSelected()){return this.dayView}else if(this.weekViewSelected()){return this.weekView}else if(this.monthViewSelected()){return this.monthView}else if(this.timelineViewSelected()){return this.timelineView}},isc.A.setRowHeight=function isc_Calendar_setRowHeight(_1,_2){if(this.eventSnapGap==this.rowHeight){this.eventSnapGap=_1}
this.rowHeight=_1;if(this.dayView){this.dayView.setCellHeight(this.rowHeight);this.dayView.refreshEvents();if(this.scrollToWorkday&&!_2)this.dayView.scrollToWorkdayStart()}
if(this.weekView){this.weekView.setCellHeight(this.rowHeight);this.weekView.refreshEvents();if(this.scrollToWorkday&&!_2)this.weekView.scrollToWorkdayStart()}},isc.A.getCurrentViewName=function isc_Calendar_getCurrentViewName(){var _1=this.getSelectedView();return _1!=null?_1.viewName:null},isc.A.setCurrentViewName=function isc_Calendar_setCurrentViewName(_1){var _2=this.mainView.tabs.findIndex("viewName",_1);if(_2!=null)this.selectTab(_2);return _1},isc.A.getEventPKs=function isc_Calendar_getEventPKs(_1){if(!this.$129u){_1=_1||this.getDataSource();if(_1){this.$129u=_1.getPrimaryKeyFieldNames()}}
return this.$129u||[]},isc.A.getEventCanvasID=function isc_Calendar_getEventCanvasID(_1,_2){if(!_2||!_1||!_1.$128i)return null;var _3=this.getEventPKs();if(_3.length>0){var _4=this.getID()+"_event_";for(var i=0;i<_3.length;i++){_4+=_2[_3[i]];if(i==_3.length)break}
return _1.$128i[_4]}else{return _2.$128i?_2.$128i[this.getID()+"_"+_1.viewName]:null}});isc.evalBoundary;isc.B.push(isc.A.setEventCanvasID=function isc_Calendar_setEventCanvasID(_1,_2,_3){if(!_1.$128i)_1.$128i={};var _4=this.getEventPKs().duplicate();if(_4.length>0){var _5=this.getID()+"_event_";for(var i=0;i<_4.length;i++){_5+=_2[_4[i]];if(i==_4.length)break}
_1.$128i[_5]=_3}else{if(!_2.$128i)_2.$128i={};_2.$128i[this.getID()+"_"+_1.viewName]=_3}},isc.A.clearTimeSelection=function isc_Calendar_clearTimeSelection(){if(this.dayView)this.dayView.clearSelection();if(this.weekView)this.weekView.clearSelection()},isc.A.getDayDiff=function isc_Calendar_getDayDiff(_1,_2,_3){return Math.abs(isc.Date.$1094(_1,_2,_3,false))},isc.A.getEventStartCol=function isc_Calendar_getEventStartCol(_1,_2){var _3=_2?_2.$643:this.getSelectedView(),_4=_2||this.$64i(_1,_3),_5=_3.getEventColumn(_4.getLeft()+1);return _5},isc.A.getEventEndCol=function isc_Calendar_getEventEndCol(_1,_2){var _3=_2?_2.$643:this.getSelectedView(),_4=_2||this.$64i(_1,_3),_5=_3.getEventColumn(_4.getLeft()+_4.getVisibleWidth()+1);return _5},isc.A.getEventLeft=function isc_Calendar_getEventLeft(_1,_2){_2=_2||this.getSelectedView();var _3=_2.body.getColumnWidth(0),_4=0;if(_2.isWeekView()){var _5=this.getDayDiff(_1[this.startDateField],this.chosenWeekStart,(this.showWeekends==false));_4=(_5*_3)}else if(this.showDayLanes){var _6=_2.completeFields.findIndex("name",_1[this.laneNameField]);if(_6){_4=_2.getColumnLeft(_6)}}
if(this.logIsDebugEnabled("calendar")){this.logDebug('calendar.getEventLeft() = '+_4+' for:'+isc.Log.echoFull(_1),'calendar')}
return _4},isc.A.setShowWeekends=function isc_Calendar_setShowWeekends(_1){this.showWeekends=_1;if(isc.isA.TabSet(this.mainView)){var _2=this.mainView.getSelectedTabNumber();this.mainView.removeTabs(this.mainView.tabs);if(this.dayView)this.dayView.destroy();if(this.weekView)this.weekView.destroy();if(this.monthView)this.monthView.destroy();var _3=this.$653();this.mainView.addTabs(_3);this.mainView.selectTab(_2)}else{var _4=this.children[0].members[1];var _5=_4.members[1];var _6=this.$653()[0].pane;_4.removeMember(_5);_5.destroy();_4.addMember(_6)}
this.$53a();this.setDateLabel()},isc.A.canEditEvent=function isc_Calendar_canEditEvent(_1){if(!_1)return false;else if(_1[this.canEditField]!=null)return _1[this.canEditField];else return this.canEditEvents},isc.A.canRemoveEvent=function isc_Calendar_canRemoveEvent(_1){if(!_1)return false;else if(_1[this.canRemoveField]!=null)return _1[this.canRemoveField];else return this.canRemoveEvents&&this.canEditEvent(_1)},isc.A.getDateEditingStyle=function isc_Calendar_getDateEditingStyle(){if(!this.timelineView){return"time"}
var _1=this.dateEditingStyle;if(!_1){if(this.dataSource)_1=this.getDataSource().getField(this.startDateField).type;if(!_1){switch(this.timelineGranularity){case"day":if(!this.timelineView)_1="date";else if(this.eventSnapGap<this.timelineView.columnWidth){_1="datetime"}else{_1="date"}
break;case"hour":_1="datetime";break;case"millisecond":case"second":case"minute":_1="time";break;default:_1="date";break}}}
return _1},isc.A.addLaneEvent=function isc_Calendar_addLaneEvent(_1,_2,_3,_4,_5,_6){this.addEvent(_2,_3,_4,_5,_6,_1)},isc.A.addEvent=function isc_Calendar_addEvent(_1,_2,_3,_4,_5,_6,_7){if(_7==null)_7=true;if(!isc.isAn.Object(_5))_5={};var _8;if(isc.isA.Date(_1)){_8={};_8[this.startDateField]=_1;_8[this.endDateField]=_2;_8[this.nameField]=_3;_8[this.descriptionField]=_4;if(_6||_5[this.laneNameField]){_8[this.laneNameField]=_6||_5[this.laneNameField]}
isc.addProperties(_8,_5)}else if(isc.isAn.Object(_1)){_8=_1}else{isc.logWarn('addEvent error: startDate parameter must be either a Date or an event record (Object)');return}
var _9=this;if(_7)this.$53e=true;if(this.dataSource){isc.DataSource.get(this.dataSource).addData(_8,function(_10,_11,_12){_9.processSaveResponse(_10,_11,_12)},{componentId:this.ID,willHandleError:true});return}else{this.$53e=true;this.data.add(_8);this.processSaveResponse({status:0},[_8],{operationType:"add"})}},isc.A.removeEvent=function isc_Calendar_removeEvent(_1,_2){if(_2==null)_2=true;var _3=_1[this.startDateField],_4=_1[this.endDateField];var _5=this;var _6=function(){if(_5.$53b(_3,_4)){_5.dayView.removeEvent(_1)}
if(_5.$53c(_3,_4)){_5.weekView.removeEvent(_1)}
if(_5.$53d(_3,_4)){_5.monthView.refreshEvents()}
if(_5.$664(_3,_4)){_5.timelineView.refreshEvents()}
if(_5.eventAutoArrange){if(_5.dayView)_5.dayView.refreshEvents();if(_5.weekView)_5.weekView.refreshEvents()}
if(_5.eventRemoved)_5.eventRemoved(_1)};if(_2)this.$53e=true;if(this.dataSource){isc.DataSource.get(this.dataSource).removeData(_1,_6,{componentId:this.ID,oldValues:_1});return}else{this.data.remove(_1);_6()}},isc.A.updateEvent=function isc_Calendar_updateEvent(_1,_2,_3,_4,_5,_6,_7,_8){if(_7==null)_7=true;if(!isc.isAn.Object(_6))_6={};var _9=_1[this.startDateField];var _10=_1[this.endDateField];var _11=this;if(_7)this.$53e=true;if(this.dataSource){var _12,_13=isc.DataSource.get(this.dataSource);var _14={};_14[this.startDateField]=_2.duplicate();_14[this.endDateField]=_3.duplicate();_14[this.descriptionField]=_5;_14[this.nameField]=_4;if(_8)_14[this.laneNameField]=_8;var _15=isc.addProperties({},_1,_14,_6);_13.updateData(_15,function(_17,_18,_19){_11.processSaveResponse(_17,_18,_19,_1)},{oldValues:_1,componentId:this.ID,willHandleError:true});return}else{var _16=isc.addProperties({},_1);_1[this.startDateField]=_2.duplicate();_1[this.endDateField]=_3.duplicate();_1[this.descriptionField]=_5;_1[this.nameField]=_4;if(_8)_1[this.laneNameField]=_8;isc.addProperties(_1,_6);this.processSaveResponse({status:0},[_1],{operationType:"update"},_16)}},isc.A.processSaveResponse=function isc_Calendar_processSaveResponse(_1,_2,_3,_4){var _5=isc.isAn.Array(_2)?_2[0]:_2,_6=_3?_3.operationType:null,_7=_6=="update",_8=_6=="add",_9=this.$1115,_10=this.$1116;delete this.$1115;delete this.$1116;if(_1&&_1.status<0){var _11=_1?_1.errors:null;if(_9){if(_11)this.eventDialog.items[0].setErrors(_11,true);this.eventDialog.show()}else if(_10){this.eventEditorLayout.show();if(_11)this.eventEditor.setErrors(_11,true)}
if(!_11)isc.RPCManager.$a0(_1,_3);return}
if(!_5||isc.isA.String(_5)){if(_8){this.logWarn("Calendar Add operation did not return a record. The operation succeeded but no CalendarViews will be refreshed.")
return}else _5=_4}
var _12=_7&&_4?_4[this.startDateField]:null,_13=_7&&_4?_4[this.endDateField]:null,_14=_7&&_4?_4[this.laneNameField]:null,_15=_5[this.startDateField],_16=_5[this.endDateField],_17=_5[this.laneNameField];if(this.$53b(_15,_16)||(_7&&this.$53b(_12,_13)))
{if(!this.dayViewSelected())this.dayView.$123s=true;else{if(_7){this.dayView.refreshEvents()}else if(_8){this.dayView.addEvent(_5,null,true);this.dayView.refreshVisibleEvents()}}}
if(this.$53c(_15,_16)){if(!this.weekViewSelected())this.weekView.$123s=true;else{if(_7){this.weekView.retagDayEvents(_12);if(isc.Date.compareLogicalDates(_12,_15)!=0)
this.weekView.retagDayEvents(_15)}else if(_8){this.weekView.addEvent(_5,null,true);this.weekView.refreshVisibleEvents()}}}
if(this.$53d(_15,_16)){if(!this.monthViewSelected())this.monthView.$123s=true;else this.monthView.refreshEvents()}
if(this.$664(_15,_16)){if(!this.timelineViewSelected())this.timelineView.$123s=true;else{var _18=this.timelineView;_18.refreshEvents()}}
if(_7&&this.eventChanged)this.eventChanged(_5);if(_8&&this.eventAdded)this.eventAdded(_5)},isc.A.refreshEvent=function isc_Calendar_refreshEvent(_1){var _2=this.getSelectedView();var _3=_2.getCurrentEventCanvas(_1);if(_3){_3.setEvent(_1)}},isc.A.setEventStyle=function isc_Calendar_setEventStyle(_1,_2){_1.eventWindowStyle=_2;var _3=this.getSelectedView().getCurrentEventCanvas(_1);if(_3){_3.setStyleName(_2)}},isc.A.eventsAreSame=function isc_Calendar_eventsAreSame(_1,_2){if(!_1||!_2)return false;if(this.dataSource){var _3=isc.DataSource.get(this.dataSource),_4=this.getEventPKs(_3),_5=true;for(var i=0,_7=_4.length;i<_7;i++){if(_1[_4[i]]!=_2[_4[i]]){_5=false;break}}
return _5}else{return(_1===_2)}},isc.A.createEventObject=function isc_Calendar_createEventObject(_1,_2,_3,_4,_5,_6){var _7=isc.addProperties({},_1);if(_2)_7[this.startDateField]=_2;if(_3)_7[this.endDateField]=_3;if(_4)_7[this.laneNameField]=_4;if(_5)_7[this.nameField]=_5;if(_6)_7[this.descriptionField]=_6;delete _7.eventLength;delete _7.__ref;return _7},isc.A.getEventHoverHTML=function isc_Calendar_getEventHoverHTML(_1,_2){var _3=this;var _4=_1[_3.startDateField],_5=_4.toShortDate(this.dateFormatter,false),_6=isc.Time.toTime(_4,this.timeFormatter,true),_7=_1[_3.endDateField],_8=_7.toShortDate(this.dateFormatter,false),_9=isc.Time.toTime(_7,this.timeFormatter,true),_10=_1[_3.nameField],_11=_1[_3.descriptionField],_12=_5+"&nbsp;"+_6+"&nbsp;-&nbsp;"+_9;if(_2.$643.isTimelineView()){if(_4.getDate()!=_7.getDate()){_12=_5+"&nbsp;"+_6+"&nbsp;-&nbsp;"+_8+"&nbsp;"+_9}}
_12+=(_10||_11?"</br></br>":"")+(_10?_10+"</br></br>":"")+(_11?_11:"");return _12},isc.A.$53b=function isc_Calendar__shouldRefreshDay(_1,_2){if(!this.dayView)return false;var _3=new Date(this.year,this.month,this.chosenDate.getDate(),0,0);var _4=new Date(this.year,this.month,this.chosenDate.getDate(),23,59);if(this.dayView.body&&_3.getTime()<=_1.getTime()&&_4.getTime()>=_1.getTime()){return true}else return false},isc.A.$53c=function isc_Calendar__shouldRefreshWeek(_1,_2){if(!this.weekView)return false;var _3=this.chosenWeekEnd.duplicate();_3.setMinutes(_3.getMinutes()+1);if(this.weekView.body&&this.chosenWeekStart.getTime()<=_1.getTime()&&_3.getTime()>=_2.getTime()){return true}else return false},isc.A.$53d=function isc_Calendar__shouldRefreshMonth(_1,_2){if(!this.monthView)return false;var _3=new Date(this.year,this.month,-7);var _4=new Date(this.year,this.month,37);if(_3.getTime()<=_1.getTime()&&_4.getTime()>=_2.getTime()){return true}else return false},isc.A.$664=function isc_Calendar__shouldRefreshTimelineView(_1,_2){if(this.showTimelineView)return true;else return false},isc.A.$53f=function isc_Calendar__getNewEventWindow(_1,_2,_3){var _4=this.canEditEvent(_1),_5=this.canRemoveEvent(_1),_6=_1[this.eventWindowStyleField]||this.eventWindowStyle,_7=false,_8=false;var _9=isc.addProperties({isEventCanvas:true,autoDraw:false,calendar:this,baseStyle:_6,canDragReposition:_4,canDragResize:_4,_redrawWithParent:false,showCloseButton:_5,event:_1,descriptionText:_1[this.descriptionField],dragTarget:_3.eventDragTarget,headerProps:isc.addProperties({},{dragTarget:_3.eventDragTarget}),footerProperties:{dragTarget:_3.eventDragTarget}},this.eventWindowDefaults,this.eventWindowProperties);var _10=_3.$128h,_11=_3.getCurrentEventCanvas(_1),_8=(_11!=null);if(_8){_3.$128h.remove(_11)}else if(_3.useEventCanvasPool){_11=_3.getPooledEventCanvas(_1);if(_11){_7=true}}
if(_11){_11.event=_1;if(!_8)_11.setProperties(_9);if(_11.setEvent)_11.setEvent(_1,_6);else{_11.event=_1;_11.setEventStyle(_6)}}else{_9=isc.addProperties(_9,{event:_1,baseStyle:_6,styleName:_6});var _12=this.eventCanvasConstructor;_11=this.createAutoChild("eventWindow",_9,_12)}
if(_3.$129c&&!_3.$129c.contains(_11))
_3.$129c.add(_11);if(_3.$128q&&!_3.$128q.contains(_1))
_3.$128q.add(_1);_11.$128k=false;this.setEventCanvasID(_3,_1,_11.ID);return _11},isc.A.$53g=function isc_Calendar__getEventsInRange(_1,_2,_3,_4){var _5=[],_6=Date.getWeekendDays(),_7=this.data.getLength(),_8=[];_3=_3||this.getSelectedView();if(_4){var _9=_3.body.getVisibleColumns();if(_9[0]>=0&&_9[1]>=0){for(var i=_9[0];i<=_9[1];i++){_8.add(_3.body.fields[i][this.laneNameField])}}}
for(var i=0;i<_7;i++){var _11=this.data.get(i);if(_4&&!_8.contains(_11[this.laneNameField]))continue;if(!_11||!_11[this.startDateField])return[];if(_11[this.startDateField].getTime()>=_1.getTime()&&_11[this.startDateField].getTime()<=_2.getTime()&&(this.showWeekends||!_6.contains(_11[this.startDateField].getDay())))
{if(_3&&_3.isWeekView())_5.add(_11);else if(!this.showDayLanes||_8.contains(_11[this.laneNameField]))
_5.add(_11)}}
return _5},isc.A.$64i=function isc_Calendar__findEventWindow(_1,_2){_2=_2||this.getSelectedView();var _3=_2.isWeekView();if(!_2.body||!_2.body.children)return;var _4=_2.body.children;for(var i=0;i<_4.length;i++){var _6=_4[i];if(_6&&_6.isEventCanvas&&_2.areSame(_6.event,_1)&&!!_6.$53i==_3){return _6}}
return false},isc.A.getDayEnd=function isc_Calendar_getDayEnd(_1){return new Date(_1.getFullYear(),_1.getMonth(),_1.getDate(),23,59,59)},isc.A.isTimeline=function isc_Calendar_isTimeline(){var _1=this.getCurrentViewName()=="timeline";return _1},isc.A.$529=function isc_Calendar__setChosenWeek(){var _1=this.chosenWeekStart=new Date(this.year,this.month,this.chosenDate.getDate()
-this.chosenDate.getDay()+this.firstDayOfWeek);if(Date.compareDates(this.chosenDate,_1)==1){this.chosenWeekStart.setDate(this.chosenWeekStart.getDate()-7)}
this.chosenWeekEnd=new Date(_1.getFullYear(),_1.getMonth(),_1.getDate()+6,23,59);if(Date.compareDates(this.chosenDate,this.chosenWeekEnd)==-1){this.chosenWeekStart.setDate(this.chosenWeekStart.getDate()+7);this.chosenWeekEnd.setDate(this.chosenWeekEnd.getDate()+7)}},isc.A.setChosenDate=function isc_Calendar_setChosenDate(_1,_2){var _3=this.getSelectedView();this.year=_1.getFullYear();this.month=_1.getMonth();this.$53h=this.chosenDate.duplicate();this.chosenDate=_1;this.$529();if(this.dayView){var _4={date:isc.Date.createLogicalDate(_1.getFullYear(),_1.getMonth(),_1.getDate()),$654:_1.getDay(),$658:_1.getDate(),$659:_1.getMonth(),$66a:_1.getFullYear()},_5;for(var i=0;i<this.dayView.body.fields.length;i++){_5=this.dayView.body.getField(i);if(_5)isc.addProperties(_5,_4)}
isc.DaySchedule.$129g(this,this.dayView,this.chosenDate)}
if(this.$53h.getFullYear()!=this.year||this.$53h.getMonth()!=this.month){if(this.monthView){if(this.monthViewSelected())this.monthView.refreshEvents();else this.monthView.$123s=true}}
var _7=new Date(this.$53h.getFullYear(),this.$53h.getMonth(),this.$53h.getDate()-this.$53h.getDay());var _8=new Date(_7.getFullYear(),_7.getMonth(),_7.getDate()+6);var _9=this.chosenDate.getTime();if(_9<_7.getTime()||_9>_8.getTime()){if(this.weekView){this.$53a();if(this.weekViewSelected())this.weekView.refreshEvents();else this.weekView.$123s=true}}
if(_9!=this.$53h.getTime()){if(this.dayView){this.dayView.refreshStyle();if(this.dayViewSelected())this.dayView.refreshEvents();else this.dayView.$123s=true}}
if(this.timelineView&&!_2){this.timelineView.setTimelineRange(this.chosenDate,null,null,null,true)}else{if(this.scrollToWorkday&&_3.scrollToWorkdayStart){_3.scrollToWorkdayStart()}else{_3.redraw()}}
this.setDateLabel();this.dateChanged()},isc.A.dateIsWorkday=function isc_Calendar_dateIsWorkday(_1,_2){if(!_1||!this.workdays)return false;return this.workdays.contains(_1.getDay())},isc.A.adjustCriteria=function isc_Calendar_adjustCriteria(_1){return _1},isc.A.getNewCriteria=function isc_Calendar_getNewCriteria(_1){var _2={};_1=_1||this.getSelectedView();if(_1){if(this.fetchMode=="timeline"){var _3={_constructor:"AdvancedCriteria",operator:"and",criteria:[{fieldName:this.startDateField,operator:"lessThan",value:_1.endDate},{fieldName:this.endDateField,operator:"greaterThan",value:_1.startDate}]};_2=this.adjustCriteria(_3)}}
return _2},isc.A.$53a=function isc_Calendar__setWeekTitles(){if(!this.weekView)return;var _1=this.chosenWeekStart.duplicate();var _2=Date.getShortDayNames();var _3=Date.getWeekendDays();isc.DaySchedule.$129g(this,this.weekView,this.chosenWeekStart);for(var i=1;i<8;i++){if(this.weekView.getFieldNum("day"+i)>=0){var _5=_1.toShortDate(this.dateFormatter,false);if(_5.match(this.$81i)!=null)_5=_5.substring(5);else if(_5.match(this.$81j))_5=_5.substring(0,_5.length-5);var _6=_2[_1.getDay()]+" "+_5;var p={title:_6,align:"right",$654:_1.getDay(),$658:_1.getDate(),$659:_1.getMonth(),$66a:_1.getFullYear()};p.date=isc.Date.createLogicalDate(p.$66a,p.$659,p.$658),this.weekView.setFieldProperties("day"+i,p);if(this.weekView.header)this.weekView.header.markForRedraw()}
_1.setDate(_1.getDate()+1)}},isc.A.next=function isc_Calendar_next(){var _1;if(this.dayViewSelected()){_1=new Date(this.year,this.month,this.chosenDate.getDate()+1);if(!this.showWeekends){var _2=Date.getWeekendDays();for(var i=0;i<_2.length;i++){if(_2.contains(_1.getDay()))_1.setDate(_1.getDate()+1)}}}else if(this.weekViewSelected()){_1=new Date(this.year,this.month,this.chosenDate.getDate()+7)}else if(this.monthViewSelected()){_1=new Date(this.year,this.month+1,1)}else if(this.timelineViewSelected()){_1=this.chosenDate.duplicate();this.timelineView.nextOrPrev(true);return}
this.dateChooser.setData(_1);this.setChosenDate(_1)},isc.A.previous=function isc_Calendar_previous(){var _1;if(this.dayViewSelected()){_1=new Date(this.year,this.month,this.chosenDate.getDate()-1);if(!this.showWeekends){var _2=Date.getWeekendDays();for(var i=0;i<_2.length;i++){if(_2.contains(_1.getDay()))_1.setDate(_1.getDate()-1)}}}else if(this.weekViewSelected()){_1=new Date(this.year,this.month,this.chosenDate.getDate()-7)}else if(this.monthViewSelected()){_1=new Date(this.year,this.month-1,1)}else if(this.timelineViewSelected()){_1=this.chosenDate.duplicate();this.timelineView.nextOrPrev(false);return}
this.dateChooser.setData(_1);this.setChosenDate(_1)},isc.A.dataArrived=function isc_Calendar_dataArrived(){return true},isc.A.draw=function isc_Calendar_draw(_1,_2,_3,_4){this.invokeSuper(isc.Calendar,"draw",_1,_2,_3,_4);if(isc.ResultSet&&isc.isA.ResultSet(this.data)&&this.dataSource){this.observe(this.data,"dataArrived","observer.dataArrived(arguments[0], arguments[1])")}
if(this.mainView.isA("TabSet")){if(this.showControlsBar!=false){this.mainView.addChild(this.controlsBar);this.controlsBar.moveAbove(this.mainView.tabBar)}}
if(!isc.isA.TabSet(this.mainView)){this.setChosenDate(this.chosenDate)}else{this.setDateLabel()}},isc.A.$653=function isc_Calendar__getTabs(){var _1=[];if(this.showDayView!=false){this.dayView=this.createAutoChild("dayView",{baseStyle:this.baseStyle,viewName:"day",cellHeight:this.rowHeight});_1.add({title:this.dayViewTitle,pane:this.dayView,viewName:"day"})}
if(this.showWeekView!=false){this.weekView=this.createAutoChild("weekView",{$53i:true,baseStyle:this.baseStyle,viewName:"week",cellHeight:this.rowHeight});_1.add({title:this.weekViewTitle,pane:this.weekView,viewName:"week"})}
if(this.showMonthView!=false){this.monthView=this.createAutoChild("monthView",{baseStyle:this.baseStyle,viewName:"month",bodyConstructor:"MonthScheduleBody"});_1.add({title:this.monthViewTitle,pane:this.monthView,viewName:"month"})}
if(this.showTimelineView!=false){this.timelineView=this.createAutoChild("timelineView",{baseStyle:this.baseStyle,viewName:"timeline"});_1.add({title:this.timelineViewTitle,pane:this.timelineView,viewName:"timeline"})}
return _1},isc.A.$655=function isc_Calendar__createTabSet(_1){if(_1.length>1){this.mainView=this.createAutoChild("mainView",{tabs:_1,tabSelected:function(_3,_4,_5,_6){this.creator.$567=_4.viewName;this.creator.setDateLabel();if(this.creator.getSelectedView().$123s){this.creator.refreshSelectedView()}
this.creator.currentViewChanged(_4.viewName)}});if(this.currentViewName){var _2=_1.find("viewName",this.currentViewName);if(_2)this.mainView.selectTab(_2)}}else{this.mainView=_1[0].pane}},isc.A.getLaneFromPoint=function isc_Calendar_getLaneFromPoint(_1,_2,_3){_3=_3||this.getSelectedView();if(!_3.hasLanes||!_3.hasLanes())return null;if(_3.getLaneFromPoint)return _3.getLaneFromPoint(_1,_2);return null},isc.A.getLaneMap=function isc_Calendar_getLaneMap(){if(!this.isTimeline()&&!this.showDayLanes)return{};var _1=this.showDayLanes?this.lanes:this.timelineView.data,_2={};for(var i=0;i<_1.length;i++){var _4=_1[i].name||_1[i][this.laneNameField],_5=_1[i].title||_4;_2[_4]=_5}
return _2},isc.A.createChildren=function isc_Calendar_createChildren(){var _1=this.$653();this.$655(_1);var _2=20;if(this.showControlsBar!=false){this.dateLabel=this.createAutoChild("dateLabel");this.addEventButton=this.createAutoChild("addEventButton",{click:function(){var _3=this.creator;var _4=_3.getSelectedView();_3.eventDialog.event=null;_3.eventDialog.isNewEvent=true;_3.eventDialog.items[0].createFields();var _5=new Date(),_6=null,_7=_3.chosenDate.duplicate();if(_4.isDayView()){_5=_7}else if(_4.isWeekView()){if(_3.chosenWeekStart.getTime()>_5.getTime()){_5=_3.chosenWeekStart.duplicate()}
if(!this.showWeekends){var _8=Date.getWeekendDays();for(var i=0;i<_8.length;i++){if(_8.contains(_5.getDay()))_5.setDate(_5.getDate()+1)}}
_5.setMinutes(0);if(_5.getHours()>22){_5.setDate(_5.getDate()+1);_5.setHours(0)}
else _5.setHours(_5.getHours()+1)}else if(_4.isMonthView()){_7.setDate(1);if(_7.getTime()>_5.getTime())_5=_7}else if(_3.isTimeline()){var _10=_3.timelineView,_11=_10.getVisibleDateRange();_5=_11[0];_6=_5.duplicate();_6=_10.addUnits(_6,1,_3.timelineGranularity)}
_3.eventDialog.setDate(_5,_6);_3.eventDialog.setPageLeft(_3.getPageLeft());_3.eventDialog.setPageTop(this.getPageTop()+this.getVisibleHeight());_3.eventDialog.show()}});this.datePickerButton=this.createAutoChild("datePickerButton",{click:function(){var _3=this.creator;if(this.$54x){this.$54x.setData(_3.chosenDate);this.$54x.draw()}else{this.$54x=_3.createAutoChild("dateChooser",{calendar:this.creator,autoDraw:false,showCancelButton:true,autoClose:true,disableWeekends:this.creator.disableWeekends,firstDayOfWeek:this.creator.firstDayOfWeek,showWeekends:this.creator.showWeekends,dateClick:function(_17,_18,_19){var _12=new Date(_17,_18,_19);this.setData(_12);this.calendar.dateChooser.dateClick(_17,_18,_19);this.close()}});this.$54x.setData(_3.chosenDate);_3.addChild(this.$54x);this.$54x.placeNextTo(this,"bottom",true)}},destroy:function(){if(this.$54x)this.$54x.markForDestroy();this.Super("destroy",arguments)}});this.previousButton=this.createAutoChild("previousButton",{});this.nextButton=this.createAutoChild("nextButton",{})}
var _13=[];if(this.showPreviousButton!=false)_13.add(this.previousButton);if(this.showDateLabel!=false)_13.add(this.dateLabel);if(this.showDatePickerButton!=false)_13.add(this.datePickerButton);if(this.canCreateEvents&&this.showAddEventButton!=false)_13.add(this.addEventButton);if(this.showNextButton!=false)_13.add(this.nextButton);if(this.showControlsBar!=false){this.controlsBar=this.createAutoChild("controlsBar",{members:_13})}
var _3=this;this.dateChooser=this.createAutoChild("dateChooser",{disableWeekends:this.disableWeekends,showWeekends:this.showWeekends,chosenDate:this.chosenDate,month:this.month,year:this.year,dateClick:function(_17,_18,_19){var _12=new Date(_17,_18,_19);this.setData(_12);this.creator.setChosenDate(_12)},showPrevYear:function(){this.year--;this.dateClick(this.year,this.month,this.chosenDate.getDate())},showNextYear:function(){this.year++;this.dateClick(this.year,this.month,this.chosenDate.getDate())},showPrevMonth:function(){if(--this.month==-1){this.month=11;this.year--}
this.dateClick(this.year,this.month,1)},showNextMonth:function(){if(++this.month==12){this.month=0;this.year++}
this.dateClick(this.year,this.month,1)}});if(!this.children)this.children=[];var _14=[];var _15=[];_15.add(this.dateChooser);if(this.showDateChooser){_14.add(isc.VLayout.create({autoDraw:false,width:"20%",membersMargin:10,layoutTopMargin:10,members:_15}))}
if(this.mainView.isA("TabSet")){_14.add(this.mainView)}else{if(this.showControlsBar!=false){var _16=isc.HLayout.create({autoDraw:false,height:this.controlsBar.getVisibleHeight(),width:"100%"});_16.addMember(isc.LayoutSpacer.create({autoDraw:false,width:"*"}));_16.addMember(this.controlsBar);_16.addMember(isc.LayoutSpacer.create({autoDraw:false,width:"*"}));_14.add(isc.VLayout.create({autoDraw:false,members:[_16,this.mainView]}))}else{_14.add(this.mainView)}}
this.children.add(isc.HLayout.create({autoDraw:false,width:"100%",height:"100%",members:_14}));this.setDateLabel()},isc.A.createEditors=function isc_Calendar_createEditors(){var _1=this;this.eventDialog=this.createAutoChild("eventDialog",{items:[isc.DynamicForm.create({autoDraw:false,padding:4,calendar:this,saveOnEnter:true,useAllDataSourceFields:true,numCols:2,colWidths:[80,"*"],$642:[_1.nameField,_1.laneNameField],getCustomValues:function(){if(!this.calendar.eventDialogFields)return;var _2=this.$642;var _3=this.calendar.eventDialogFields;var _4={};for(var i=0;i<_3.length;i++){var _6=_3[i];if(_6.name&&!_2.contains(_6.name)){_4[_6.name]=this.getValue(_6.name)}}
return _4},setCustomValues:function(_36){if(!this.calendar.eventDialogFields)return;var _2=this.$642;var _3=this.calendar.eventDialogFields;for(var i=0;i<_3.length;i++){var _6=_3[i];if(_6.name&&!_2.contains(_6.name)){this.setValue(_6.name,_36[_6.name])}}},createFields:function(_36){var _1=this.calendar,_7=_1.eventDialog.isNewEvent,_8=!_7?"staticText":"text",_9=!_7?"staticText":"select",_10=_1.isTimeline()||(_1.showDayLanes&&_1.dayViewSelected());var _11=[{name:_1.nameField,title:_1.eventNameFieldTitle,type:_8,width:250},{name:_1.laneNameField,title:_1.eventLaneFieldTitle,type:_9,width:150,valueMap:_1.getLaneMap(),showIf:_10?"true":"false"},{name:"save",title:_1.saveButtonTitle,editorType:"SubmitItem",endRow:false},{name:"details",title:_1.detailsButtonTitle,type:"button",startRow:false,click:function(_32,_37){var _1=_32.calendar,_12=_1.eventDialog.isNewEvent,_13=_1.eventDialog.event||{},_14=_32.getValue(_1.nameField),_15=_32.getValue(_1.laneNameField);if(_12){_13[_1.startDateField]=_1.eventDialog.currentStart;_13[_1.endDateField]=_1.eventDialog.currentEnd;_13[_1.nameField]=_14;_13[_1.descriptionField]="";if(_15)_13[_1.laneNameField]=_15}
_32.calendar.$53j(_13,_12)}}];if(!_7)_11.removeAt(2);var _16=isc.DataSource.create({addGlobalId:false,fields:_11});this.setDataSource(_16);this.setFields(isc.shallowClone(this.calendar.eventDialogFields))},submit:function(){var _1=this.calendar,_7=_1.eventDialog.isNewEvent,_17=_7?_1.eventDialog.event:null,_18=_1.eventDialog.currentStart,_19=_1.eventDialog.currentEnd,_20;if(!this.validate())return;if(_1.isTimeline()||(_1.dayViewSelected()&&_1.showDayLanes)){_20=this.getItem(_1.laneNameField).getValue()}
_1.$1115=true;if(!_7){_1.updateEvent(_17,_18,_19,this.getItem(_1.nameField).getValue(),_17[_1.descriptionField],this.getCustomValues(),true,_20)}else{_1.addEvent(_18,_19,this.getItem(_1.nameField).getValue(),"",this.getCustomValues(),_20,true)}
_1.eventDialog.hide()}})],setDate:function(_36,_37){var _1=this.creator;if(!_37){if(_36.getHours()==23&&_36.getMinutes()==(60-_1.getMinutesPerRow())){_37=new Date(_36.getFullYear(),_36.getMonth(),_36.getDate()+1)}else{_37=new Date(_36.getFullYear(),_36.getMonth(),_36.getDate(),_36.getHours()+1,_36.getMinutes())}}
this.setTitle(_1.$53k(_36,_37));this.currentStart=_36;this.currentEnd=_37;this.items[0].getItem(_1.nameField).setValue("")},setLane:function(_20){var _1=this.creator;if(isc.isA.Number(_20))_20=_1.lanes[_20].name;this.items[0].getItem(_1.laneNameField).setValue(_20)},setEvent:function(_13){this.event=_13;var _21=this.items[0],_1=this.creator;if(_1.eventDialogFields){_21.clearErrors(true);_21.setCustomValues(_13)}
this.setDate(_13[_1.startDateField],_13[_1.endDateField]);_21.setValues(_13)},closeClick:function(){this.Super('closeClick');if(this.creator.dayView)this.creator.dayView.clearSelection();if(this.creator.weekView)this.creator.weekView.clearSelection()},show:function(){if(this.creator.showQuickEventDialog){if(!this.isDrawn())this.draw();this.Super('show');this.items[0].getItem(this.creator.nameField).focusInItem()}else{this.creator.showEventEditor(this.event)}},hide:function(){this.Super('hide');this.moveTo(0,0)}});this.eventEditor=this.createAutoChild("eventEditor",{useAllDataSourceFields:true,titleWidth:80,initWidget:function(){this.invokeSuper(isc.DynamicForm,"initWidget",arguments);this.timeFormat=this.creator.timeFormat;var _11=[],_1=this.creator,_22=_1.getDateEditingStyle();this.$642.addList([_1.nameField,_1.descriptionField,_1.startDateField,_1.endDateField]);if(_1.timelineView||_1.showDayLanes){var _23=_1.getLaneMap(),_24={name:_1.laneNameField,title:_1.eventLaneFieldTitle,type:"select",valueMap:_23,endRow:true,colSpan:"*"};_11.add(_24)}
if(_22=="date"||_22=="datetime"){_11.addList([{name:_1.startDateField,title:_1.eventStartDateFieldTitle,type:_22,endRow:true},{name:_1.endDateField,title:_1.eventEndDateFieldTitle,type:_22,endRow:true},{name:"invalidDate",type:"blurb",colSpan:4,visible:false,defaultValue:_1.invalidDateMessage,cellStyle:this.errorStyle||"formCellError",endRow:true}])}else if(_22=="time"){var _25=40;var _26=this.getTimeValues();for(var _27 in _26){var _28=_1.measureText(_26[_27],40);if(_28>_25)_25=_28}
_25+=30;this.numCols=5;this.setColWidths([this.titleWidth,45,45,_25,"*"]);_11.addList([{name:"startHours",title:_1.eventStartDateFieldTitle,type:"integer",width:"*",editorType:"select",valueMap:this.getTimeValues("hours")},{name:"startMinutes",showTitle:false,type:"integer",width:"*",editorType:"select",valueMap:this.getTimeValues("minutes")},{name:"startAMPM",showTitle:false,type:"select",width:_25,valueMap:this.getTimeValues(),endRow:true},{name:"invalidDate",type:"blurb",colSpan:4,visible:false,defaultValue:_1.invalidDateMessage,cellStyle:this.errorStyle||"formCellError",endRow:true},{name:"endHours",title:_1.eventEndDateFieldTitle,type:"integer",width:"*",editorType:"select",valueMap:this.getTimeValues("hours")},{name:"endMinutes",showTitle:false,type:"integer",width:"*",editorType:"select",valueMap:this.getTimeValues("minutes")},{name:"endAMPM",showTitle:false,type:"select",width:_25,valueMap:this.getTimeValues(),endRow:true}])}
_11.addList([{name:_1.nameField,title:_1.eventNameFieldTitle,type:"text",colSpan:"*",width:"*"},{name:_1.descriptionField,title:_1.eventDescriptionFieldTitle,type:"textArea",colSpan:"*",width:"*",height:50}]);var _29=isc.DataSource.create({addGlobalId:false,fields:_11});this.setDataSource(_29);this.setFields(isc.shallowClone(this.creator.eventEditorFields))},getTimeValues:function(_36,_37){if(!_37)_37=0;var _30={};if(_36=="hours"){for(var i=_37;i<12;i++){_30[(i+1)+""]=(i+1)}}else if(_36=="minutes"){for(var i=0;i<60;i++){var _31=i<10?"0"+i:""+i;_30[i+""]=_31}}else{_30["am"]=isc.Time.AMIndicator;_30["pm"]=isc.Time.PMIndicator}
return _30},$642:["startHours","startMinutes","startAMPM","endHours","endMinutes","endAMPM"],getCustomValues:function(){if(!this.creator.eventEditorFields)return;var _1=this.creator,_2=this.$642;var _3=this.creator.eventEditorFields;var _4={};for(var i=0;i<_3.length;i++){var _6=_3[i];if(_6.name&&!_2.contains(_6.name)){_4[_6.name]=this.getValue(_6.name)}}
return _4},setCustomValues:function(_36){if(!this.creator.eventEditorFields)return;var _2=this.$642;var _3=this.creator.eventEditorFields;for(var i=0;i<_3.length;i++){var _6=_3[i];if(_6.name&&!_2.contains(_6.name)){this.setValue(_6.name,_36[_6.name])}}}});this.eventEditorLayout=this.createAutoChild("eventEditorLayout",{items:[this.eventEditor,isc.HLayout.create({membersMargin:10,layoutMargin:10,autoDraw:false,members:[isc.IButton.create({autoDraw:false,title:this.saveButtonTitle,calendar:this,click:function(){this.calendar.addEventOrUpdateEventFields()}}),isc.IButton.create({autoDraw:false,title:this.cancelButtonTitle,calendar:this,click:function(){this.calendar.eventEditorLayout.hide()}})]})],setDate:function(_36,_37,_38,_20){if(!_38)_38="";if(!_37){_37=new Date(_36.getFullYear(),_36.getMonth(),_36.getDate(),_36.getHours()+1,_36.getMinutes())}
var _1=this.creator;this.setTitle(_1.$53k(_36,_37));this.currentStart=_36;this.currentEnd=_37;var _22=_1.getDateEditingStyle(),_32=this.items[0];if(_22=="date"||_22=="datetime"){_32.getItem(_1.startDateField).setValue(_36.duplicate());_32.getItem(_1.endDateField).setValue(_37.duplicate())}else if(_22=="time"){_32.getItem("startHours").setValue(this.getHours(_36.getHours()));_32.getItem("endHours").setValue(this.getHours(_37.getHours()));_32.getItem("startMinutes").setValue(_36.getMinutes());_32.getItem("endMinutes").setValue(_37.getMinutes());if(!_1.twentyFourHourTime){_32.getItem("startAMPM").setValue(this.getAMPM(_36.getHours()));_32.getItem("endAMPM").setValue(this.getAMPM(_37.getHours()))}}
_32.setValue(_1.nameField,_38);_32.setValue(_1.descriptionField,"");_32.setValue(_1.laneNameField,_20)},getHours:function(_36){if(this.creator.twentyFourHourTime)return _36;else return this.creator.$53n(_36)},getAMPM:function(_36){if(_36<12)return"am";else return"pm"},setEvent:function(_13){var _32=this.items[0],_1=this.creator,_33=this.view,_34=_32.getItem(_1.laneNameField);this.event=_13;if(_1.eventEditorFields){_32.clearErrors(true);_32.setCustomValues(_13)}
this.setDate(_13[_1.startDateField],_13[_1.endDateField]);if(_34){_34.setValueMap(_1.getLaneMap());_34.setValue(_13[_1.laneNameField]);_34.setDisabled(_13[_1.canEditLaneField]==false);var _35=_33.isTimelineView()||(_33.isDayView()&&_1.showDayLanes);if(_35)_34.show();else _34.hide()}
_32.setValue(_1.nameField,_13[_1.nameField]);_32.setValue(_1.descriptionField,_13[_1.descriptionField]);this.originalStart=isc.clone(this.currentStart);this.originalEnd=isc.clone(this.currentEnd)},hide:function(){this.Super('hide');if(this.creator.dayView)this.creator.dayView.clearSelection();if(this.creator.weekView)this.creator.weekView.clearSelection();this.creator.eventEditor.hideItem("invalidDate")},sizeMe:function(){this.setWidth(this.creator.mainView.getVisibleWidth());this.setHeight(this.creator.mainView.getVisibleHeight());this.setLeft(this.creator.mainView.getLeft())}});this.eventEditorLayout.hide()});isc.evalBoundary;isc.B.push(isc.A.measureText=function isc_Calendar_measureText(_1,_2){var _3=isc.Label.create({ID:"$1674",autoDraw:true,backgroundColor:"red",top:-1000,height:20,width:1,wrap:false,autoFit:true});_3.setContents("<span style='overflow:visible;white-space:nowrap;'>"+_1+"</span>")
_3.redraw();_3.show();_3.bringToFront();var _4=_3.getVisibleWidth();_3.hide();_3.destroy();_3=null;return _4},isc.A.addEventOrUpdateEventFields=function isc_Calendar_addEventOrUpdateEventFields(){var _1=this,_2=_1.eventEditorLayout.isNewEvent,_3=_1.eventEditorLayout.event,_4=_1.eventEditor,_5=_1.getDateEditingStyle();if(_5=="date"||_5=="datetime"){var _6=_4.getValue(_1.startDateField),_7=_4.getValue(_1.endDateField),_8;if(_7<_6){_4.showItem("invalidDate");return false}
if(!_4.validate())return false;_1.eventEditorLayout.currentStart=_6;_1.eventEditorLayout.currentEnd=_7;_1.eventEditorLayout.hide();if(_1.isTimeline()||(_1.dayViewSelected()&&_1.showDayLanes)&&_1.canEditLane){_8=_4.getValue(_1.laneNameField)}
_1.$1116=true;if(!_2){_1.updateEvent(_3,_6,_7,_4.getValue(_1.nameField),_4.getValue(_1.descriptionField),_4.getCustomValues(),true,_8)}else{_1.addEvent(_6,_7,_4.getValue(_1.nameField),_4.getValue(_1.descriptionField),_4.getCustomValues(),_8,true)}}else if(_5=="time"){var _9=_4.getValue("startHours"),_10=_4.getValue("endHours"),_11=_4.getValue("startMinutes"),_12=_4.getValue("endMinutes"),_13,_14;if(!_1.twentyFourHourTime){_13=_4.getValue("startAMPM");_14=_4.getValue("endAMPM");_9=_1.$534(_9,_13);_10=_1.$534(_10,_14);if(_10==0)_10=24}
if(!(_9<_10||(_9==_10&&_11<_12))){_4.showItem("invalidDate");return false}
if(!_4.validate())return false;_1.eventEditorLayout.hide();var _15=_1.eventEditorLayout.currentStart,_16=_1.eventEditorLayout.currentEnd;if(_16.getDate()>_15.getDate()){if(_10==24)_10=0;else{_16.setDate(_15.getDate())}}
_15.setHours(_9);_15.setMinutes(_11);_16.setHours(_10);_16.setMinutes(_12);_1.$1116=true;if(!_2){var _17=_1.eventEditorLayout.originalStart,_18=_1.eventEditorLayout.originalEnd;_1.updateEvent(_3,_15,_16,_4.getValue(_1.nameField),_4.getValue(_1.descriptionField),_4.getCustomValues(),true,_4.getValue(_1.laneNameField))}else{_1.addEvent(_15,_16,_4.getValue(_1.nameField),_4.getValue(_1.descriptionField),_4.getCustomValues(),_4.getValue(_1.laneNameField),true)}}
return true},isc.A.setDateLabel=function isc_Calendar_setDateLabel(){if(!this.dateLabel)return;var _1="",_2=this.chosenDate,_3=null,_4=this.getCurrentViewName();if(_4=="day"){}else if(_4=="week"){var _5=this.$656();_2=_5[0];_3=_5[1]}else if(_4=="month"){_2=isc.DateUtil.getStartOf(_2,"M");_3=isc.DateUtil.getEndOf(_2,"M")}else if(_4=="timeline"){var _6=this.timelineView;_2=_6.startDate;_3=_6.endDate}
_1=this.getDateLabelText(_4,_2,_3);this.dateLabel.setContents(_1)},isc.A.getDateLabelText=function isc_Calendar_getDateLabelText(_1,_2,_3){var _4="";if(_1=="day"){_4="<b>"+Date.getFormattedDateRangeString(_2)+"</b>"}else if(_1=="week"){_4="<b>"+Date.getFormattedDateRangeString(_2,_3)+"</b>"}else if(_1=="month"){_4="<b>"+_2.getShortMonthName()+" "+_2.getFullYear()+"</b>"}else if(_1=="timeline"){var _5=this.timelineView;_4="<b>"+_5.formatDateForDisplay(_2)+"</b> through <b>"+_5.formatDateForDisplay(_3)+"</b>"}
return _4},isc.A.$656=function isc_Calendar__getWeekRange(){var _1=this.chosenWeekStart.duplicate();var _2=this.chosenWeekEnd.duplicate();if(!this.showWeekends){var _3=Date.getWeekendDays();var _4=7-_3.length;while(_3.contains(_1.getDay())){_1.setDate(_1.getDate()+1)}
var _5=0,_6=_1.duplicate();for(var i=0;i<_4;i++){if(_3.contains(_6.getDay()))_5++;_6.setDate(_6.getDate()+1)}
_2=_1.duplicate();_2.setDate(_2.getDate()+(_4-1)+_5)}
return[_1,_2]},isc.A.dayViewSelected=function isc_Calendar_dayViewSelected(){if(this.mainView&&!this.mainView.isA("TabSet"))return this.mainView.viewName=="day";else return this.$567=="day"},isc.A.weekViewSelected=function isc_Calendar_weekViewSelected(){if(this.mainView&&!this.mainView.isA("TabSet"))return this.mainView.viewName=="week";else return this.$567=="week"},isc.A.monthViewSelected=function isc_Calendar_monthViewSelected(){if(this.mainView&&!this.mainView.isA("TabSet"))return this.mainView.viewName=="month";else return this.$567=="month"},isc.A.timelineViewSelected=function isc_Calendar_timelineViewSelected(){if(this.mainView&&!this.mainView.isA("TabSet"))return this.mainView.viewName=="timeline";else return this.$567=="timeline"},isc.A.showEventDialog=function isc_Calendar_showEventDialog(_1){if(!_1){this.logWarn("showEventDialog called with no event - returning.");return}
this.$53l(_1,false)},isc.A.showNewEventDialog=function isc_Calendar_showNewEventDialog(_1){_1=_1||{};this.$53l(_1,true)},isc.A.$53l=function isc_Calendar__showEventDialog(_1,_2){var _3=_1[this.startDateField]||new Date();var _4=_1[this.endDateField];var _5=this.getSelectedView(),_6=_5.isMonthView()?null:this.$64i(_1,_5),_7,_8,_9;if(!_6){if(this.eventEditorLayout){this.eventEditorLayout.event=_1;this.eventEditorLayout.isNewEvent=_2}
this.eventDialog.eventWindow=null;this.eventDialog.event=_1;this.eventDialog.isNewEvent=_2;this.eventDialog.items[0].createFields();var _10=_3,_11=_4;_1[this.startDateField]=_10;if(_5.isMonthView()){var _12=new Date();_12=_12.getHours();if(_12>22)_12-=1;_10.setHours(_12);_1[this.startDateField]=_10}
if(_5.isTimelineView()){var _13=this.timelineView;_7=_13.getEventLaneIndex(_1);_8=_13.body.getEventColumn(_13.getDateLeftOffset(_10));_11=_4||this.getDateFromPoint(_13.getDateLeftOffset(_10)+_13.getColumnWidth(_8));this.eventDialog.setLane(_7)}else{if(_5.isMonthView()){_7=_5.getEventRow();_8=_5.getEventColumn();_11=_4||this.getCellDate(_7,_8,_5)}else{_7=_3.getHours()*this.getRowsPerHour(_5);_7+=Math.floor(_3.getMinutes()/this.getMinutesPerRow());if(this.showDayLanes&&_5.isDayView()){_8=_5.getEventLaneIndex(_1)}else{_8=_5.getColFromDate(_3)}
_11=_4||this.getCellDate(_7,_8,_5)}}
_1[this.endDateField]=_11;this.eventDialog.setEvent(_1)}else{if(_5.isTimelineView()){_7=_5.getEventLaneIndex(_1);_8=_5.body.getEventColumn(_5.getDateLeftOffset(_3))}else if(_5.isDayView()||_5.isWeekView()){_7=_3.getHours()*this.getRowsPerHour(_5);_7+=Math.floor(_3.getMinutes()/this.getMinutesPerRow());_8=_5.getColFromDate(_3)}
this.eventDialog.eventWindow=_6;this.eventDialog.isNewEvent=false;this.eventDialog.items[0].createFields();this.eventDialog.setEvent(_6.event);if(this.bringEventsToFront)_6.bringToFront();_9=[_6.getPageLeft(),_6.getPageTop()]}
if(!_9)_9=_5.body.getCellPageRect(_7,_8);this.eventDialog.placeNear(_9[0],_9[1]);this.eventDialog.show();isc.Timer.setTimeout(this.ID+".eventDialog.bringToFront()")},isc.A.showEventEditor=function isc_Calendar_showEventEditor(_1){if(_1)this.$53j(_1);else this.showNewEventEditor(null)},isc.A.showNewEventEditor=function isc_Calendar_showNewEventEditor(_1){this.$53j(_1,true)},isc.A.$53j=function isc_Calendar__showEventEditor(_1,_2){if(!this.eventEditorLayout.isDrawn())this.eventEditorLayout.draw();this.eventEditorLayout.setWidth(this.mainView.getVisibleWidth());this.eventEditorLayout.setHeight(this.mainView.getVisibleHeight());this.eventEditorLayout.setPageLeft(this.mainView.getPageLeft());this.eventEditorLayout.setPageTop(this.getPageTop());this.eventEditorLayout.isNewEvent=_2;this.eventEditorLayout.view=this.getSelectedView();if(_1){this.eventEditorLayout.setEvent(_1)}else{this.eventEditor.clearValues();this.eventEditorLayout.setTitle(this.newEventEditorWindowTitle);if(this.eventDialog&&this.eventDialog.isVisible()){if(this.eventEditorFields){this.eventEditorLayout.items[0].setCustomValues(this.eventDialog.items[0].getCustomValues())}
var _3=this.eventDialog.items[0].getValue(this.nameField);var _4=this.eventDialog.items[0].getItem(this.laneNameField);var _5=_4?_4.getValue():null;var _6=new Date();this.eventEditorLayout.setDate(_6,this.eventDialog.currentEnd,_3,_5)}}
this.eventDialog.hide();this.eventEditorLayout.show()},isc.A.$53k=function isc_Calendar__getEventDialogTitle(_1,_2){var _3=Date.getShortDayNames(),_4=Date.getShortMonthNames(),_5=isc.Time.toTime(_1,this.timeFormatter,true),_6=isc.Time.toTime(_2,this.timeFormatter,true),_7;if(this.isTimeline()){var _8=_1.getDay()!=_2.getDay();if(_8){_7=_3[_1.getDay()]+", "+_4[_1.getMonth()]+" "+_1.getDate()+", "+_5+" - "+_3[_2.getDay()]+", "+_4[_2.getMonth()]+" "+_2.getDate()+", "+_6;return _7}}
var _9=_5+" - "+_6;return _3[_1.getDay()]+", "+_4[_1.getMonth()]+" "+_1.getDate()+", "+_9},isc.A.$53n=function isc_Calendar__to12HrNotation(_1){if(_1==0)return 12;else if(_1<13)return _1;else return _1-12},isc.A.$534=function isc_Calendar__to24HourNotation(_1,_2){_1=parseInt(_1);if(_2.toLowerCase()=="am"&&_1==12){return 0}else if(_2.toLowerCase()=="pm"&&_1<12){return _1+12}else{return _1}},isc.A.$116j=function isc_Calendar__getCellCSSText(_1,_2,_3,_4){var _5=this,_6=_5.getCellDate(_3,_4,_1),_7=_5.getDateCSSText(_6,_3,_4,_1);if(_7)return _7;var _8=isc.Date.compareLogicalDates(_6,new Date());if((_8!==false&&_8==0)&&_5.todayBackgroundColor){return"background-color:"+_5.todayBackgroundColor+";"}
return null},isc.A.getDateCSSText=function isc_Calendar_getDateCSSText(_1,_2,_3,_4){return null},isc.A.getDateStyle=function isc_Calendar_getDateStyle(_1,_2,_3,_4){return null},isc.A.getCellDate=function isc_Calendar_getCellDate(_1,_2,_3){var _4;_3=_3||this.getSelectedView();var _5=_3.frozenFields?_3.frozenFields.length:0;if(_3.isDayView()||_3.isWeekView()||_3.isTimelineView()){var _6=_2-_5;_4=_6>=0?_3.getCellDate(_1,_6):null}else if(_3.isMonthView()){if(_2>=_3.getFields().length)
_2=_3.getFields().length-1;var _7=_3.data.get(_1);var _8=_3.getField(_2).$66b;if(_7&&_7["date"+_8]!=null){_4=_7["date"+_8].duplicate();_4.setHours(0);_4.setMinutes(0);_4.setSeconds(0)}}else{return}
return _4},isc.A.getDateFromPoint=function isc_Calendar_getDateFromPoint(_1,_2,_3,_4){_4=_4||this.getSelectedView();if(_3==null)_3=true;if(_4.getDateFromPoint)return _4.getDateFromPoint(_1,_2,null,_3);if(_1==null&&_2==null){_1=_4.body.getOffsetX();_2=_4.body.getOffsetY()}
var _5=_4.body.getEventColumn(_1),_6=_4.body.getEventRow(_2),_7;if(_4.isMonthView()){_7=this.getCellDate(_6,_5,_4)}else{return}
return _7},isc.A.getDateLeftOffset=function isc_Calendar_getDateLeftOffset(_1,_2){if(_2&&_2.getDateLeftOffset)return _2.getDateLeftOffset(_1)},isc.A.getView=function isc_Calendar_getView(_1){if(_1=="day")return this.dayView;if(_1=="week")return this.weekView;if(_1=="month")return this.monthView;if(_1=="timeline")return this.timelineView},isc.A.monthViewEventClick=function isc_Calendar_monthViewEventClick(_1,_2,_3){var _4=this.monthView.getEvents(_1,_2);var _5=_4[_3];if(this.eventClick(_5,"month"))this.showEventEditor(_5)},isc.A.currentViewChanged=function isc_Calendar_currentViewChanged(_1){},isc.A.getDayBodyHTML=function isc_Calendar_getDayBodyHTML(_1,_2,_3,_4,_5){var _6=_1.getDay();var _7=_2,_8=15,_9=this.monthView.data?this.monthView.data[1]:null,_10=this.monthView.getRowHeight(_9,1);var _11="";for(var i=0;i<_7.length;i++){var _13=isc.Time.toTime(_7[i][this.startDateField],this.timeFormatter,true)+" ";if(this.canEditEvent(_7[i])){var _14="<a href='javascript:"+this.ID+".monthViewEventClick("+_4+","+_5+","+i+");' class='"+this.calMonthEventLinkStyle+"'>";_11+=_14+_13+_7[i][this.nameField]+"</a><br/>"}else{_11+=_13+_7[i][this.nameField]+"<br/>"}
if((i+3)*_8>_10)break}
if(i<_7.length-1){var _15="<a href='javascript:"+this.ID+".monthMoreEventsLinkClick("+_4+","+_5+","+i+");' class='"+this.calMonthEventLinkStyle+"'>",_16=this.monthMoreEventsLinkTitle,_17=_16.evalDynamicString(this,{eventCount:(_7.length-1-i)});_11+=_15+_17+"</a><br/>"}
return _11},isc.A.monthViewEventClick=function isc_Calendar_monthViewEventClick(_1,_2,_3){var _4=this.monthView.getEvents(_1,_2);var _5=_4[_3];if(this.eventClick(_5,"month"))this.showEventEditor(_5)},isc.A.getMonthMoreEventsMenu=function isc_Calendar_getMonthMoreEventsMenu(){if(!this.monthMoreEventsMenu){this.monthMoreEventsMenu=this.createAutoChild("monthMoreEventsMenu")}
return this.monthMoreEventsMenu},isc.A.monthMoreEventsLinkClick=function isc_Calendar_monthMoreEventsLinkClick(_1,_2,_3){var _4=this,_5=this.monthView,_6=_5&&_5.getEvents(_1,_2)||[],_7=[];for(var i=_3;i<_6.length;i++){var _9=_6[i];_7.add({title:_9[this.nameField],enabled:this.canEditEvent(_9),event:_9,click:function(){_4.showEventEditor(this.event)}})}
var _10=this.getMonthMoreEventsMenu();_10.setItems(_7);_10.placeNear(isc.EH.getX(),isc.EH.getY());_10.draw();_10.show()},isc.A.getMonthViewHoverHTML=function isc_Calendar_getMonthViewHoverHTML(_1,_2){if(_2!=null){var _3="";for(var i=0;i<_2.length;i++){var _5=this.creator||this;var _6=isc.Time.toTime(_2[i][_5.startDateField],_5.timeFormatter,true);_3+=_6+" "+_2[i][_5.nameField]+"<br/>"}
return _3}},isc.A.getDayHeaderHTML=function isc_Calendar_getDayHeaderHTML(_1,_2,_3,_4,_5){return _1.getDate()},isc.A.dayBodyClick=function isc_Calendar_dayBodyClick(_1,_2,_3,_4,_5){return true},isc.A.dayHeaderClick=function isc_Calendar_dayHeaderClick(_1,_2,_3,_4,_5){return true},isc.A.eventClick=function isc_Calendar_eventClick(_1,_2){return true},isc.A.eventRemoveClick=function isc_Calendar_eventRemoveClick(_1,_2){return true},isc.A.eventMoved=function isc_Calendar_eventMoved(_1,_2,_3){return true},isc.A.eventResized=function isc_Calendar_eventResized(_1,_2){return true},isc.A.timelineEventMoved=function isc_Calendar_timelineEventMoved(_1,_2,_3,_4){return true},isc.A.timelineEventResized=function isc_Calendar_timelineEventResized(_1,_2,_3){return true},isc.A.getValidSnapDate=function isc_Calendar_getValidSnapDate(_1,_2){if(this.isTimeline()){}else{var _3=this.eventSnapGap;var _4=((_1.getHours()*60)+_1.getMinutes())%_3;var _5=(_2.getHours()*60)+_2.getMinutes();var _6=Math.round((_5-_4)/_3);var _7=(_6*_3)+_4;var _8=Math.floor(_7/60),_9=_7%60;_2.setHours(_8);_2.setMinutes(_9)}
return _2},isc.A.selectTab=function isc_Calendar_selectTab(_1){if(this.mainView&&this.mainView.isA("TabSet")&&this.mainView.tabs.getLength()>_1){this.mainView.selectTab(_1);this.refreshSelectedView();return true}else{return false}},isc.A.parentResized=function isc_Calendar_parentResized(){this.Super('parentResized',arguments);if(this.eventEditorLayout.isVisible())this.eventEditorLayout.sizeMe()},isc.A.dateChanged=function isc_Calendar_dateChanged(){return true},isc.A.getActiveDay=function isc_Calendar_getActiveDay(){var _1=this.getActiveTime();if(_1)return _1.getDay()},isc.A.getActiveTime=function isc_Calendar_getActiveTime(){var _1=this.ns.EH,_2=this.getSelectedView();var _3=_2.getEventRow();var _4=_2.getEventColumn();return this.getCellDate(_3,_4,_2)},isc.A.setTimelineRange=function isc_Calendar_setTimelineRange(_1,_2,_3,_4,_5){if(this.timelineView)this.timelineView.setTimelineRange(_1,_2,_3,_4);if(_5)this.fireCallback(_5)},isc.A.getEventLength=function isc_Calendar_getEventLength(_1,_2){var _3=(_2.getTime()-_1.getTime())/(1000*60);return _3},isc.A.canEditEventLane=function isc_Calendar_canEditEventLane(_1,_2){var _3=_1[this.canEditLaneField]!=null?_1[this.canEditLaneField]:this.canEditLane!=false;return _3},isc.A.checkForOverlap=function isc_Calendar_checkForOverlap(_1,_2,_3,_4,_5,_6){var _7={},_8=this.startDateField,_9=this.endDateField;_7[_8]=_4.duplicate();_7[_9]=_5.duplicate();_7[this.laneNameField]=_6;var _10=_6?this.data.findAll(this.laneNameField,_6):this.data;var _11=_1.findOverlappingEvents(_3,_7,false,(_6!=null),_10);if(_11.length==0){return false}else if(_11.length>1){return true}else{var _12=_11[0];if((this.equalDatesOverlap==false?_5>_12[_8]:_5>=_12[_8])&&_4<_12[_8])
{_5=_12[_8].duplicate();_4=_5.duplicate();_4.setMinutes(_4.getMinutes()-_2.getEventLength());return[_4,_5]}else if((this.equalDatesOverlap==false?_4<_12[_9]:_4<=_12[_9])&&_5>_12[_9])
{_4=_12[_9].duplicate();_5=_4.duplicate();_5.setMinutes(_5.getMinutes()+_2.getEventLength());return[_4,_5]}else{return true}}});isc.B._maxIndex=isc.C+132;isc.ClassFactory.defineClass("DaySchedule","ListGrid");isc.DaySchedule.changeDefaults("bodyProperties",{snapToCells:false,suppressVSnapOffset:true});isc.A=isc.DaySchedule.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.autoDraw=false;isc.A.canSort=false;isc.A.canResizeFields=false;isc.A.canReorderFields=false;isc.A.showHeader=false;isc.A.showHeaderContextMenu=false;isc.A.showAllRecords=true;isc.A.fixedRecordHeights=true;isc.A.labelColumnWidth=60;isc.A.labelColumnAlign="right";isc.A.showLabelColumn=true;isc.A.labelColumnPosition="left";isc.A.labelColumnBaseStyle="labelColumn";isc.A.showRollOver=true;isc.A.useCellRollOvers=true;isc.A.hiliteRowOnFocus=false;isc.A.canAutoFitFields=false;isc.A.canSelectCells=true;isc.A.poolEventWindows=true;isc.B.push(isc.A.initWidget=function isc_DaySchedule_initWidget(){this.fields=[];this.addProperties(this.creator.viewProps);this.addProperties(this.creator.gridProps);this.addProperties(this.creator.dayViewProperties);var _1=this.getCalendar();if(_1.showDayLanes&&this.isDayView()&&_1.alternateLaneStyles){this.alternateFieldStyles=true;this.alternateFieldFrequency=_1.alternateFieldFrequency}
if(_1.labelColumnWidth&&_1.labelColumnWidth!=this.labelColumnWidth){this.labelColumnWidth=_1.labelColumnWidth}
this.renderEventsOnDemand=_1.renderEventsOnDemand;this.eventDragGap=_1.eventDragGap;this.fields=[];this.Super("initWidget");this.rebuildFields();this.addAutoChild("eventDragTarget");this.body.addChild(this.eventDragTarget);if(isc.isAn.Array(_1.data)){this.$128r=true}},isc.A.reorderFields=function isc_DaySchedule_reorderFields(_1,_2,_3){this.Super("reorderFields",arguments);this.refreshEvents()},isc.A.rebuildFields=function isc_DaySchedule_rebuildFields(){var _1=this.getCalendar(),_2=[],_3={width:this.labelColumnWidth,name:"label",title:" ",cellAlign:"right",calendar:_1,formatCellValue:function(_19,_20,_21,_22,_23){var _4=_23.creator.getRowsPerHour(_23);if(_21%_4==0){var _5=(_21/_4);var _6=isc.Time.parseInput(_5);return isc.Time.toTime(_6,_23.creator.timeFormatter,true)}
else{return""}}};if(this.showLabelColumn&&this.labelColumnPosition=="left"){_2.add(_3)}
if(_1.showDayLanes&&_1.lanes&&!this.isWeekView()){_2[0].frozen=true;var d=_1.chosenDate.duplicate(),_8=isc.DaySchedule.$126v(_1.getMinutesPerRow(this),d,this,_1),_9=isc.Date.createLogicalDate(d.getFullYear(),d.getMonth(),d.getDate()),_10={date:_9,align:"center",canReorder:_1.canReorderLanes};for(var i=0;i<_1.lanes.length;i++){var _12=_1.lanes[i],_13=_12.name||_12[_1.laneNameField],p=isc.addProperties({},_10,{name:_13});p[_1.laneNameField]=_13;_2.add(isc.addProperties(p,_12));_8.setProperty(_13,"")}
this.setShowHeader(true);if(_1.canReorderLanes)this.canReorderFields=_1.canReorderLanes;if(_1.minLaneWidth!=null)this.minFieldWidth=_1.minLaneWidth;this.data=_8}else{_2[0].frozen=true;_2.add({name:"day1",align:"center",date:_1.chosenDate});if(this.isWeekView()){var _15=8;for(var i=2;i<_15;i++){_2.add({name:"day"+i,align:"center"})}
this.setShowHeader(true);if(!this.creator.showWeekends){var _16=this.showLabelColumn&&this.labelColumnPosition=="left"?1:0;var _17=Date.getWeekendDays();for(var i=_16;i<_2.length;i++){var _18=((i-_16)+_1.firstDayOfWeek)%7;if(_17.contains(_18)){_2[i].showIf="return false;"}}}}else{this.setShowHeader(false)}
this.data=isc.DaySchedule.$126v(_1.getMinutesPerRow(this),null,this,_1)}
if(this.showLabelColumn&&this.labelColumnPosition=="right"){_2.add(_3)}
this.setFields(_2)},isc.A.getDateFromPoint=function isc_DaySchedule_getDateFromPoint(_1,_2,_3,_4){var _5=this.getCalendar();if(_4){}
if(_1==null&&_2==null){_2=this.body.getOffsetY();_1=this.body.getOffsetX()}
var _6=this.body.getEventRow(_2),_7=this.body.getRowHeight(_6),_8=this.body.getRowTop(_6),_9=this.body.getEventColumn(_1),_10=(_9<0);if(_9==-1)_9=0;else if(_9==-2)_9=this.body.fields.length-1;var _11=this.getCellDate(_6,_9),_12=_5.getMinutesPerRow(this),_13=_5.getRowsPerHour(this),_14=_2==null?0-_8:_2-_8,_15=_14-(_14%_5.eventSnapGap),_16=_12/(_7/_5.eventSnapGap),_17=_15/_5.eventSnapGap,_18=_16*_17;_11.setMinutes(_11.getMinutes()+_18);return _11},isc.A.getCellDate=function isc_DaySchedule_getCellDate(_1,_2){if(!(this.body&&this.body.fields))return null;var _3=this.getCalendar(),_4;if(_1==-1)_1=0;if(_1==-2)_1=this.data.getLength()-1;var _5=this.body.fields[_2].date,_6=this.getRecord(_1),_7=_6?isc.Date.getLogicalTimeOnly(_6.time):null;if(_5&&_7){_4=isc.Date.combineLogicalDateAndTime(_5,_7)}
return _4},isc.A.getCellCSSText=function isc_DaySchedule_getCellCSSText(_1,_2,_3){var _4=this.creator.$116j(this,_1,_2,_3);if(_4)return _4;return this.Super("getCellCSSText",arguments)},isc.A.getEventLeft=function isc_DaySchedule_getEventLeft(_1){return this.creator.getEventLeft(_1,this)},isc.A.getDateLeftOffset=function isc_DaySchedule_getDateLeftOffset(_1){for(var i=0;i<this.fields.length;i++){var f=this.fields[i];if(f.$66a!=null&&f.$659!=null&&f.$658!=null){var _4=Date.createLogicalDate(f.$66a,f.$659,f.$658);if(Date.compareLogicalDates(_1,_4)==0){return this.getColumnLeft(this.getFieldNum(f))}}}
return 0},isc.A.setLanes=function isc_DaySchedule_setLanes(_1){this.lanes=_1;this.rebuildFields();this.refreshEvents()},isc.A.getLane=function isc_DaySchedule_getLane(_1){var _2=this.getLaneIndex(_1);if(_2>=0)return this.body.fields[_2]},isc.A.getLaneIndex=function isc_DaySchedule_getLaneIndex(_1){if(!this.hasLanes())return;var _2=this.body.fields.findIndex("name",_1);if(_2<0)
_2=this.body.fields.findIndex(this.creator.laneNameField,_1);return _2},isc.A.hasLanes=function isc_DaySchedule_hasLanes(){return this.isDayView()&&this.creator.showDayLanes},isc.A.getLaneFromPoint=function isc_DaySchedule_getLaneFromPoint(_1,_2){if(!this.hasLanes())return null;if(_1==null)_1=this.body.getOffsetX();var _3=this.body.getEventColumn(_1),_4=this.body.fields[_3];return _4},isc.A.draw=function isc_DaySchedule_draw(_1,_2,_3,_4){this.invokeSuper(isc.DaySchedule,"draw",_1,_2,_3,_4);this.logDebug('draw','calendar');this.body.addChild(this.eventDragTarget);this.eventDragTarget.setView(this);if(this.$128r){delete this.$128r;this.refreshEvents()}
this.setSnapGap();if(this.creator.scrollToWorkday)this.scrollToWorkdayStart()},isc.A.setSnapGap=function isc_DaySchedule_setSnapGap(){var _1=this.creator.eventSnapGap;this.body.snapVGap=Math.round((_1/this.creator.getMinutesPerRow(this))
*this.body.getRowSize(0));this.body.snapHGap=null},isc.A.scrollToWorkdayStart=function isc_DaySchedule_scrollToWorkdayStart(){var _1=this.getCalendar(),_2;if(_1.scrollToWorkday){var _3=this.calcRowHeight();if(_3!=_1.rowHeight){_1.setRowHeight(_3,true)}}
var _4=this.getWorkdayRange();_2=_4.start;var _5=_1.getMinutesPerRow(this),_6=_1.getRowsPerHour(this),_7=_2.getHours()*_6,_8=_2.getMinutes(),_9=_8%_5,_10=Math.floor((_8-_9)/_5);_7+=_10;if(_9>0)_7++;var _11=_1.rowHeight*_7;this.body.delayCall("scrollTo",[0,_11])},isc.A.getWorkdayRange=function isc_DaySchedule_getWorkdayRange(){var _1=this.body.fields,_2={start:isc.Time.parseInput("23:59"),end:isc.Time.parseInput("00:01")},_3=this.getCalendar(),_4=_3.chosenDate,_5;if(this.isWeekView()){for(var i=0;i<_1.length;i++){_4=this.getDateFromCol(i);if(isc.isA.Date(_4)){_5=isc.Time.parseInput(_3.getWorkdayStart(_4));if(isc.Date.compareDates(_2.start,_5)<0){_2.start=_5}
_5=isc.Time.parseInput(_3.getWorkdayEnd(_4));if(isc.Date.compareDates(_2.end,_5)>0){_2.end=_5}}}}else if(_3.showDayLanes){for(var i=0;i<_1.length;i++){var _7=_1[i],_8=_7[_3.laneNameField];if(isc.isA.Date(_4)){_5=isc.Time.parseInput(_3.getWorkdayStart(_4,_8));if(isc.Date.compareDates(_2.start,_5)<0){_2.start=_5}
_5=isc.Time.parseInput(_3.getWorkdayEnd(_4,_8));if(isc.Date.compareDates(_2.end,_5)>0){_2.end=_5}}}}else{_2.start=isc.Time.parseInput(_3.getWorkdayStart(_3.chosenDate));_2.end=isc.Time.parseInput(_3.getWorkdayEnd(_3.chosenDate))}
return _2},isc.A.calcRowHeight=function isc_DaySchedule_calcRowHeight(){var _1=this.getWorkdayRange(),_2=_1.end.getHours()-_1.start.getHours(),_3=this.getCalendar().rowHeight;if(_2<=0)return _3;var _4=Math.floor(this.body.getViewportHeight()/
(_2*this.creator.getRowsPerHour()));return _4<_3?_3:_4},isc.A.getRowHeight=function isc_DaySchedule_getRowHeight(_1,_2){return this.getCalendar().rowHeight},isc.A.getDayFromCol=function isc_DaySchedule_getDayFromCol(_1){if(_1<0)return null;var _2=this.body.fields.get(_1).$654;return _2},isc.A.getDateFromCol=function isc_DaySchedule_getDateFromCol(_1){if(_1<0)return null;var _2=this.body.fields.get(_1);if(_2.$66a==null||_2.$659==null||_2.$658==null)return null;var _3=new Date(_2.$66a,_2.$659,_2.$658);return _3},isc.A.getColFromDate=function isc_DaySchedule_getColFromDate(_1){for(var i=0;i<this.body.fields.length;i++){var _3=this.body.fields.get(i);if(_3.$66a==null||_3.$659==null||_3.$658==null)continue;var _4=new Date(_3.$66a,_3.$659,_3.$658);if(isc.Date.compareLogicalDates(_1,_4)==0)return i}
return null},isc.A.isLabelCol=function isc_DaySchedule_isLabelCol(_1){var _2=this.getField(_1);return _2&&_2.frozen},isc.A.cellDisabled=function isc_DaySchedule_cellDisabled(_1,_2){var _3=this.getFieldBody(_2);if(!_3||_3==this.frozenBody)return false;var _4=this.getLocalFieldNum(_2);var _5=this.isWeekView()?this.getDayFromCol(_4):this.creator.chosenDate.getDay();if(this.creator.disableWeekends&&Date.getWeekendDays().contains(_5)){return true}else{if(this.$142y){var _6=this.$142y;for(var i=0;i<_6.length;i++){if(_6[i].rowNum==_1&&_6[i].colNum==_4){return true}}}
return false}},isc.A.refreshStyle=function isc_DaySchedule_refreshStyle(){if(!this.body)return;if(this.isWeekView()||this.getCalendar().showDayLanes){this.markForRedraw();return}
for(var i=0;i<this.data.length;i++){this.body.refreshCellStyle(i,1)}},isc.A.headerClick=function isc_DaySchedule_headerClick(_1,_2){var _3=this.getCalendar();if(this.isLabelCol(_1))return true;if(_3.showDayLanes&&!this.$53i)return true;var _4=this.getField(_1);_3.dateChooser.dateClick(_4.$66a,_4.$659,_4.$658);_3.selectTab(0);return true},isc.A.getCellAlign=function isc_DaySchedule_getCellAlign(_1,_2,_3){return this.labelColumnAlign},isc.A.cellMouseDown=function isc_DaySchedule_cellMouseDown(_1,_2,_3){if(this.isLabelCol(_3)||this.cellDisabled(_2,_3))return true;var _4=this.getCellDate(this.body.getEventRow(),this.body.getEventColumn());if(this.creator.backgroundMouseDown&&this.creator.backgroundMouseDown(_4)==false)return;if(!this.creator.canCreateEvents)return true;this.clearSelection();this.$53q={};this.$53q.colNum=_3;this.$53q.startRowNum=_2;this.$53q.endRowNum=_2;this.$53r=true;this.refreshCellStyle(_2,_3)},isc.A.cellOver=function isc_DaySchedule_cellOver(_1,_2,_3){if(this.$53r&&this.$53q){var _4;if(this.$53q.startRowNum<this.$53q.endRowNum){if(_2>this.$53q.endRowNum){_4=_2}else{_4=this.$53q.endRowNum}
this.$53q.endRowNum=_2}else{if(_2<this.$53q.endRowNum){_4=_2}else{_4=this.$53q.endRowNum}
this.$53q.endRowNum=_2}
var _5=6,_6=this.$53q.colNum;for(var i=_4-_5;i<_4+_5;i++){if(i>=0&&i<=47)this.refreshCellStyle(i,_6)}}},isc.A.cellMouseUp=function isc_DaySchedule_cellMouseUp(_1,_2,_3){if(!this.$53q)return true;this.$53r=false;var _4,_5,_6;if(this.$53q.startRowNum>this.$53q.endRowNum){_4=this.$53q.endRowNum;_5=this.$53q.startRowNum}else{_5=this.$53q.endRowNum;_4=this.$53q.startRowNum}
_6=_5-_4+1;var _7=this.creator.getCellDate(_4,_3,this);var _8=this.creator.getCellDate(_4+_6,_3,this);if(_6==1&&this.creator.backgroundClick){if(this.creator.backgroundClick(_7,_8)==false){this.clearSelection();return}}
if(this.creator.backgroundMouseUp){if(this.creator.backgroundMouseUp(_7,_8)==false){this.clearSelection();return}}
var _9={};_9[this.creator.startDateField]=_7;_9[this.creator.endDateField]=_8;if(this.creator.showDayLanes&&this.creator.dayViewSelected())
_9[this.creator.laneNameField]=this.getField(_3).name;this.creator.showNewEventDialog(_9)},isc.A.getCellStyle=function isc_DaySchedule_getCellStyle(_1,_2,_3){var _4=this.getCalendar(),_5=this.getBaseStyle(_1,_2,_3);if(this.isLabelCol(_3))return _5;if(this.cellDisabled(_2,_3))return _5+"Disabled";if(this.$53q&&this.$53q.colNum==_3){var _6=this.$53q.startRowNum,_7=this.$53q.endRowNum;if(_2>=_6&&_2<=_7||_2>=_7&&_2<=_6){if(_5==_4.workdayBaseStyle)return _5+"Selected";return _4.selectedCellStyle}}
if(!this.$53i&&this.alternateRecordStyles&&_2%2!=0){if(_5==_4.workdayBaseStyle)return _5;return _5+"Dark"}
if(_4.dayViewSelected()&&_4.showDayLanes&&this.alternateFieldStyles&&_3%2!=0){if(_5==_4.workdayBaseStyle)return _5;return _5+"Dark"}
return _5},isc.A.getBaseStyle=function isc_DaySchedule_getBaseStyle(_1,_2,_3){var _4=this.getCalendar(),_5=_4.getCellDate(_2,_3,this),_6=_5?_4.getDateStyle(_5,_2,_3,this):null,_7=this.isWeekView();if(_6){return _6}
if(this.isLabelCol(_3))return this.labelColumnBaseStyle;if(!_4.showWorkday)return this.baseStyle;var _8=this.getFieldBody(_3),_9=_3;if(_8==this.body)_9=this.getLocalFieldNum(_3);var _10=_7?this.getDayFromCol(_9):_4.chosenDate.getDay();var _11=_7?this.getDateFromCol(_9):_4.chosenDate.duplicate(),_12=_11.duplicate(),_13=_5?_5.duplicate():null,_14=_4.showDayLanes?this.body.getField(_9)[_4.laneNameField]:null;if(_13){var _15=isc.Time.parseInput(_4.getWorkdayStart(_13,_14)),_16=isc.Time.parseInput(_4.getWorkdayEnd(_13,_14));_11.setHours(_15.getHours(),_15.getMinutes(),_15.getSeconds(),0);_12.setHours(_16.getHours(),_16.getMinutes(),_16.getSeconds(),0);var _17=_4.dateIsWorkday(_13,_14);_13=_13.getTime();if(_17&&_11.getTime()<=_13&&_13<_12.getTime()){return _4.workdayBaseStyle}else{return this.baseStyle}}else{return this.baseStyle}},isc.A.clearSelection=function isc_DaySchedule_clearSelection(){if(this.$53q){var _1,_2,_3=this.$53q.colNum;if(this.$53q.startRowNum<this.$53q.endRowNum){_1=this.$53q.startRowNum;_2=this.$53q.endRowNum}else{_1=this.$53q.endRowNum;_2=this.$53q.startRowNum}
this.$53q=null;for(var i=_1;i<_2+1;i++){this.refreshCellStyle(i,_3)}}},isc.A.refreshEvents=function isc_DaySchedule_refreshEvents(){if(!this.$129c)this.$129c=[];if(!this.$128q)this.$128q=[];var _1=this.getCalendar();if(!this.body||!_1.hasData())return;var _2=this.$129c;if(_2.length>0){_2.setProperty("$128k",true);this.clearEvents(0,!this.poolEventWindows)}
this.$128q=[];this.$129c=[];var _3,_4;if(this.isWeekView()){_3=_1.chosenWeekStart;_4=_1.chosenWeekEnd}else{_3=new Date(_1.year,_1.month,_1.chosenDate.getDate(),0,0);_4=new Date(_1.year,_1.month,_1.chosenDate.getDate(),23,59)}
var _5=_3.getTime(),_6=_4.getTime();this.removeOverlapRanges(this.overlapRanges);var _7=isc.isA.Array(_1.data)?_1.data:_1.data.getRange(0,_1.data.getLength());var _8=[];for(var i=0;i<_7.getLength();i++){var _10=_7.get(i);if(!_10)continue;if(!isc.isA.String(_10)){if(!_10[_1.startDateField]){}
var _11=(_10[_1.leadingDateField]||_10[_1.startDateField]).getTime(),_12=(_10[_1.trailingDateField]||_10[_1.endDateField]).getTime();if((_11>=_5&&_11<_6)||(_12>_5&&_12<=_6))
{_10.eventLength=(_12-_11);_8.add(_10)}}};this.logDebug("refreshing "+this.viewName+" - "+_8.length+' events','calendar');var _13=this;this.tagDataForOverlap(_8);this.refreshVisibleEvents();if(this.$123r){this.body.scrollTo(null,this.$123r)}
delete this.$123s;delete this.$123r},isc.A.poolEventWindow=function isc_DaySchedule_poolEventWindow(_1){if(this.body){_1.event=null;_1.$128k=true;if(!this.$128h)this.$128h=[];this.$128h.add(_1);return true}else return false},isc.A.getPooledEventWindow=function isc_DaySchedule_getPooledEventWindow(_1,_2){if(!this.body)return;if(!this.$128h)this.$128h=[];var _3=this.$128h,_4=this.getCalendar(),_5;if(_3.length>0){if(_5&&_5.$128k==false){var _6=_3.indexOf(_5);var _7=_3[_2];_3[_2]=_5;_3[_6]=_7}else{if(_2==null){_2=_3.findIndex("$128k",true)}
_5=_3[_2];if(!_5)return null;_4.setEventCanvasID(this,_1,_5.ID)}
_5.$128k=false}
return _5},isc.A.destroy=function isc_DaySchedule_destroy(){this.destroyEvents(true);if(this.body)this.$128h=null;this.Super("destroy",arguments)},isc.A.destroyEvents=function isc_DaySchedule_destroyEvents(){if(!this.body||!this.body.children)return;for(var i=this.body.children.length-1;i>=0;i--){var _2=this.body.children[i];if(_2&&_2.isEventCanvas){this.body.removeChild(_2);_2.destroy();_2=null}}},isc.A.addEvent=function isc_DaySchedule_addEvent(_1,_2,_3){if(!this.$129c)this.$129c=[];if(!this.$128h)this.$128h=[];this.clearSelection();var _4=this.getCalendar(),_5=_4.$53f(_1,_2,this),_6=false;if(_5.isDrawn())_5.hide();_5.$643=this;_5.$53i=this.$53i;if(this.body)this.body.addChild(_5);if(!this.isWeekView()&&_4.showDayLanes){var _7=_1[_4.laneNameField],_8=_4.lanes.find("name",_7);if(!_8)_6=true}
_5.setCanDragReposition(_4.canDragEvents,this.eventDragTarget);if(!_6&&this.body&&this.body.isDrawn()){if(_3){this.retagOverlapRange(_1[_4.startDateField],_1[_4.endDateField],_1[_4.laneNameField])}else{this.sizeEventWindow(_5)}}},isc.A.removeEvent=function isc_DaySchedule_removeEvent(_1){var _2=this.body.children||[];for(var i=0;i<_2.length;i++){if(_2[i]&&_2[i].isEventCanvas&&_2[i].event===_1){var _4=_2[i];this.clearEventCanvas(_4,!this.poolEventWindows);return true}}
return false},isc.A.updateEventWindow=function isc_DaySchedule_updateEventWindow(_1){if(!this.body||!this.body.children)return;var _2=this.body.children,_3=this.getCalendar();for(var i=0;i<_2.length;i++){if(_2[i]&&_2[i].isEventCanvas&&this.areSame(_2[i].event,_1)){_2[i].event=_1;this.sizeEventWindow(_2[i]);_2[i].setDescriptionText(_1[_3.descriptionField]);return true}}
return false},isc.A.areSame=function isc_DaySchedule_areSame(_1,_2){if(!_1||!_2)return false;var _3=this.getCalendar();if(_3.dataSource){var _4=_3.getEventPKs(),_5=true;for(var i=0,_7=_4.length;i<_7;i++){if(_1[_4[i]]!=_2[_4[i]]){_5=false;break}}
return _5}else{return(_1===_2)}});isc.B._maxIndex=isc.C+42;isc.ClassFactory.defineClass("WeekSchedule","DaySchedule");isc.ClassFactory.defineClass("MonthSchedule","ListGrid");isc.ClassFactory.defineClass("MonthScheduleBody","GridBody");isc.MonthSchedule.changeDefaults("headerButtonProperties",{showRollOver:false,showDown:false,cursor:"default"});isc.MonthSchedule.changeDefaults("bodyProperties",{redrawOnResize:true});isc.A=isc.MonthSchedule.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.autoDraw=false;isc.A.leaveScrollbarGap=false;isc.A.showAllRecords=true;isc.A.fixedRecordHeights=true;isc.A.showHeader=true;isc.A.showHeaderContextMenu=false;isc.A.canSort=false;isc.A.canResizeFields=false;isc.A.canReorderFields=false;isc.A.canAutoFitFields=false;isc.A.canHover=true;isc.A.showHover=true;isc.A.hoverWrap=false;isc.A.showRollOver=true;isc.A.useCellRollOvers=true;isc.A.selectionType="none";isc.A.dayHeaderHeight=20;isc.A.alternateRecordStyles=false;isc.A.cellHeight=1;isc.A.enforceVClipping=true;isc.B.push(isc.A.initWidget=function isc_MonthSchedule_initWidget(){this.addProperties(this.creator.viewProps);var _1=this.getCalendar();if(_1.data)this.data=this.getDayArray();this.fields=[{name:"day1",align:"center"},{name:"day2",align:"center"},{name:"day3",align:"center"},{name:"day4",align:"center"},{name:"day5",align:"center"},{name:"day6",align:"center"},{name:"day7",align:"center"}];this.firstDayOfWeek=_1.firstDayOfWeek;var _2=Date.getShortDayNames();var _3=Date.getWeekendDays();for(var i=0;i<7;i++){var _5=(i+this.firstDayOfWeek)%7;this.fields[i].title=_2[_5];this.fields[i].$654=_5;this.fields[i].$66b=i+1;if(!_1.showWeekends&&_3.contains(_5)){this.fields[i].showIf="return false;"}}
this.minimumDayHeight=_1.minimumDayHeight;this.Super("initWidget")},isc.A.getCurrentEventCanvas=function isc_MonthSchedule_getCurrentEventCanvas(_1){return null},isc.A.getCalendar=function isc_MonthSchedule_getCalendar(){return this.creator},isc.A.getCellCSSText=function isc_MonthSchedule_getCellCSSText(_1,_2,_3){var _4=this.getCalendar();if(!_4)return;var _5=_4.$116j(this,_1,_2,_3);if(_5)return _5;return this.Super("getCellCSSText",arguments)},isc.A.getDayArray=function isc_MonthSchedule_getDayArray(){var _1=this.getCalendar(),_2=[],_3,_4;if(!_1)return;var _5=new Date(_1.year,_1.month,1);while(_5.getDay()!=_1.firstDayOfWeek){this.incrementDate(_5,-1)}
if(!_1.showWeekends){var _6=Date.getWeekendDays();var _7=_5.duplicate();var _8=true;for(var i=0;i<=7-_6.length;i++){if(_7.getMonth()==_1.month){_8=false;break}
this.incrementDate(_7,1)}
if(_8)this.incrementDate(_5,7)}
_4=new Date(_1.year,_1.month,_5.getDate()+40);_3=_1.$53g(_5,_4,this);_3.sortByProperty("name",true,function(_10,_11,_12){return _10[_12.startDateField].getTime()},_1);this.$53t=0;for(var i=0;i<6;i++){if(_1.showDayHeaders)_2.add(this.getHeaderRowObject(_5));_2.add(this.getEventRowObject(_5,_3));this.incrementDate(_5,7);if(_5.getMonth()!=_1.month)break}
return _2},isc.A.getHeaderRowObject=function isc_MonthSchedule_getHeaderRowObject(_1){var _2={};var _3=_1.duplicate();for(var i=0;i<7;i++){_2["day"+(i+1)]=_3.getDate();_2["date"+(i+1)]=_3.duplicate();this.incrementDate(_3,1)}
return _2},isc.A.incrementDate=function isc_MonthSchedule_incrementDate(_1,_2){var _3=_1.getDate();_1.setDate(_3+_2);if(_1.getDate()==(_3+_2)-1){_1.setHours(_1.getHours()+1);_1.setDate(_3+_2)}
return _1},isc.A.getEventRowObject=function isc_MonthSchedule_getEventRowObject(_1,_2){var _3={};var _4=_1.duplicate();for(var i=0;i<7;i++){var _6=[];while(this.$53t<_2.length){var _7=_2[this.$53t];if(_7[this.creator.startDateField].getMonth()!=_4.getMonth()||_7[this.creator.startDateField].getDate()!=_4.getDate()){break}else{_6.add(_7);this.$53t+=1}}
_3["day"+(i+1)]=_4.getDate();_3["date"+(i+1)]=_4.duplicate();_3["event"+(i+1)]=_6;this.incrementDate(_4,1)}
return _3},isc.A.getEvents=function isc_MonthSchedule_getEvents(_1,_2){var _3=this.getFieldBody(_2);if(!_3||_3==this.frozenBody)return false;var _4=this.getLocalFieldNum(_2);var _5=this.getDayFromCol(_4);var _6=this.fields.get(_4).$66b;var _7=this.data[_1]["event"+_6];return _7},isc.A.getEventCell=function isc_MonthSchedule_getEventCell(_1){var _2=this.data;for(var _3=0;_3<this.fields.length;_3++){var _4=this.fields[_3].$66b,_5="event"+_4;for(var _6=0;_6<_2.length;_6++){var _7=_2.get(_6)[_5];if(_7!=null&&_7.contains(_1)){return[_6,_3]}}}},isc.A.getDayFromCol=function isc_MonthSchedule_getDayFromCol(_1){var _2=this.body.fields.get(_1).$654;return _2},isc.A.colDisabled=function isc_MonthSchedule_colDisabled(_1){var _2=this.getFieldBody(_1);if(!_2||_2==this.frozenBody)return false;var _3=this.getLocalFieldNum(_1);if(this.creator.disableWeekends&&Date.getWeekendDays().contains(this.getDayFromCol(_3))){return true}else{return false}},isc.A.refreshEvents=function isc_MonthSchedule_refreshEvents(){var _1=this.getCalendar();if(!_1.hasData())return;this.logDebug('refreshEvents: month','calendar');this.setData(this.getDayArray());if(_1.eventsRendered&&isc.isA.Function(_1.eventsRendered))
_1.eventsRendered()},isc.A.rowIsHeader=function isc_MonthSchedule_rowIsHeader(_1){var _2=this.getCalendar();if(!_2.showDayHeaders||(_2.showDayHeaders&&_1%2==1))return false;else return true},isc.A.formatCellValue=function isc_MonthSchedule_formatCellValue(_1,_2,_3,_4){var _5=this.getCalendar(),_6=this.fields.get(_4).$66b,_7=_2["event"+_6],_8=_2["date"+_6],_9=_8.getMonth()!=_5.chosenDate.getMonth();if(this.rowIsHeader(_3)){if(!_5.showOtherDays&&_9){return""}else{return _5.getDayHeaderHTML(_8,_7,_5,_3,_4)}}else{if(!_5.showOtherDays&&_9){return""}else{return _5.getDayBodyHTML(_8,_7,_5,_3,_4)}}},isc.A.getRowHeight=function isc_MonthSchedule_getRowHeight(_1,_2){var _3=this.getCalendar(),_4=_3.showDayHeaders;if(this.rowIsHeader(_2)){return this.dayHeaderHeight}else{var _5=this.data.length,_6=_5/(_4?2:1),_7=_6*this.dayHeaderHeight,_8=this.body.getVisibleHeight()-_7,_9=_4?this.minimumDayHeight-this.dayHeaderHeight:null,_10=_5-_6;if(_8/_10<=_9){return _9}else{return Math.round(_8/_10)}}},isc.A.getCellAlign=function isc_MonthSchedule_getCellAlign(_1,_2,_3){if(this.rowIsHeader(_2))return"right";else return"left"},isc.A.getCellVAlign=function isc_MonthSchedule_getCellVAlign(_1,_2,_3){if(!this.rowIsHeader(_2))return"top";else return"center"},isc.A.cellHoverHTML=function isc_MonthSchedule_cellHoverHTML(_1,_2,_3){var _4=this.fields.get(_3).$66b;var _5=_1["date"+_4];var _6=_1["event"+_4];if(!this.rowIsHeader(_2)&&_6!=null){var _7=this.getCalendar();return _7.getMonthViewHoverHTML(_5,_6)}},isc.A.getBaseStyle=function isc_MonthSchedule_getBaseStyle(_1,_2,_3){var _4=this.getCalendar(),_5=this.fields.get(_3).$66b;var _6;if(this.rowIsHeader(_2)){if((_2==0&&_1["day"+_5]>7)||(_2==this.data.length-2&&_1["day"+_5]<7)){if(!_4.showOtherDays)return _4.otherDayBlankStyle;else _6=_4.otherDayHeaderBaseStyle}else _6=_4.dayHeaderBaseStyle}else{var _7=this.colDisabled(_3),_8=_4.showDayHeaders?1:0,_9=this.data.length-1;if((_2==_8&&this.data[_8]["day"+_5]>7)||(_2==_9&&this.data[_9]["day"+_5]<7)){if(!_4.showOtherDays)return _4.otherDayBlankStyle;else _6=_7?_4.otherDayBodyBaseStyle+"Disabled":_4.otherDayBodyBaseStyle}else _6=_7?_4.dayBodyBaseStyle+"Disabled":_4.dayBodyBaseStyle}
return _6},isc.A.cellClick=function isc_MonthSchedule_cellClick(_1,_2,_3){var _4=this.getCalendar(),_5,_6,_7=this.fields.get(_3).$66b,_8=_1["date"+_7],_9=_1["event"+_7],_10=_4.chosenDate.getMonth()!=_8.getMonth(),_11=false;if(this.rowIsHeader(_2)){if(!(!this.creator.showOtherDays&&_10)){_11=_4.dayHeaderClick(_8,_9,_4,_2,_3)}
if(_11){if(_2==0&&_1["day"+_7]>7){if(_4.month==0){_5=_4.year-1;_6=11}else{_5=_4.year;_6=_4.month-1}}else if(_2==this.data.length-2&&_1["day"+_7]<7){if(_4.month==11){_5=_4.year+1;_6=0}else{_5=_4.year;_6=_4.month+1}}else{_5=_4.year;_6=_4.month}
_4.dateChooser.dateClick(_5,_6,_1["day"+_7]);_4.selectTab(0)}}else{if(!this.colDisabled(_3)&&!(!_4.showOtherDays&&_10)){_11=_4.dayBodyClick(_8,_9,_4,_2,_3);if(_11&&_4.canCreateEvents){var _12=_4.getCellDate(_2,_3,this),_13=_4.getCellDate(_2,_3+1,this);var _14={};_14[_4.startDateField]=_12;_14[_4.endDateField]=_13;_4.showNewEventDialog(_14)}}}});isc.B._maxIndex=isc.C+21;isc.ClassFactory.defineClass("EventWindow","Window");isc.EventWindow.changeDefaults("resizerDefaults",{overflow:"hidden",height:6,snapTo:"B",canDragResize:true});isc.EventWindow.changeDefaults("headerDefaults",{layoutMargin:0,layoutLeftMargin:3,layoutRightMargin:3});isc.A=isc.EventWindow.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.autoDraw=false;isc.A.minHeight=5;isc.A.minWidth=5;isc.A.showHover=true;isc.A.canHover=true;isc.A.hoverWidth=200;isc.A.canDragResize=true;isc.A.canDragReposition=true;isc.A.resizeFrom=["B"];isc.A.showShadow=false;isc.A.showEdges=false;isc.A.showHeaderBackground=false;isc.A.useBackMask=false;isc.A.keepInParentRect=true;isc.A.headerProperties={height:14};isc.A.closeButtonProperties={height:10,width:10};isc.A.bodyColor=null;isc.A.showHeaderIcon=false;isc.A.showMinimizeButton=false;isc.A.showMaximimumButton=false;isc.A.showFooter=true;isc.A.baseStyle="eventWindow";isc.A.dragAppearance="none";isc.A.$125c={overflow:"hidden",defaultLayoutAlign:"center",height:7};isc.B.push(isc.A.initWidget=function isc_EventWindow_initWidget(){this.footerProperties=isc.addProperties({},this.footerProperties,this.$125c);if(this.bodyConstructor==null)this.bodyConstructor=isc.HTMLFlow;if(this.calendar.showEventDescriptions!=false){this.bodyProperties=isc.addProperties({},this.bodyProperties,{contents:this.descriptionText,valign:"top",overflow:"hidden"})}
if(this.calendar.showEventBody==false){this.showBody=false;this.showTitle=false}
this.Super("initWidget",arguments);if(this.calendar.showEventDescriptions==false){var _1=isc.Label.create({autoDraw:false,border:"0px",padding:3,height:"100%",width:"100%",backgroundColor:this.event.backgroundColor,textColor:this.event.textColor,setContents:function(_2){this.$116k=_2;this.Super("setContents",arguments)},canHover:true,showHover:true,eventWin:this,getHoverHTML:function(){return this.eventWin.getHoverHTML()}});this.addChild(_1);this.header=_1;this.$128l=_1;this.$77n=true}
this.setStyleName(this.baseStyle)},isc.A.setStyleName=function isc_EventWindow_setStyleName(_1){this.bodyStyle=_1+"Body";this.headerStyle=_1+"Header";this.Super("setStyleName",arguments);if(this.header)this.header.setStyleName(this.headerStyle);if(this.headerLabel){this.headerLabel.setStyleName(this.headerStyle)}else{this.headerLabelProperties=isc.addProperties({},this.headerLabelProperties,{styleName:this.headerStyle})}
if(this.body)this.body.setStyleName(this.bodyStyle);if(this.$128l)this.$128l.setStyleName(this.bodyStyle)},isc.A.setEvent=function isc_EventWindow_setEvent(_1){this.event=_1;var _2=_1.eventWindowStyle||this.calendar.eventWindowStyle;this.setEventStyle(_2)},isc.A.setEventStyle=function isc_EventWindow_setEventStyle(_1,_2,_3){_2=_2||this.headerStyle||(_1+"Header");_3=_3||this.bodyStyle||(_1+"Body");this.baseStyle=_1;this.styleName=_1;this.$129w=_3;this.$7m=_2;this.setStyleName(_1)},isc.A.mouseUp=function isc_EventWindow_mouseUp(){return isc.EH.STOP_BUBBLING},isc.A.makeFooter=function isc_EventWindow_makeFooter(){if(!this.showFooter||this.canDragResize==false)return;this.resizer=this.createAutoChild("resizer",{dragTarget:this.dragTarget,styleName:this.baseStyle+"Resizer"});this.addChild(this.resizer);if(this.resizer)this.resizer.bringToFront()},isc.A.setDescriptionText=function isc_EventWindow_setDescriptionText(_1){_1=_1||"";if(this.calendar.getDescriptionText){_1=this.calendar.getDescriptionText(this.event)}
if(this.body){this.descriptionText=_1;this.body.setContents(_1)}else{this.descriptionText=_1;if(this.$734){this.$734.moveTo(0,0);this.$734.setWidth("100%");this.$734.setContents(_1)}else if(this.calendar.showEventDescriptions==false){this.$128l.setContents(_1);this.$128l.redraw()}}},isc.A.click=function isc_EventWindow_click(){if(this.$53u)return;if(this.$67e){this.$67e=null;return}
var _1=this.calendar;if(_1.bringEventsToFront)this.bringToFront();var _2=_1.eventClick(this.event,this.$53i?"week":"day");if(_2!=false){if(!_1.canEditEvent(this.event))return;if(this.$53i)_1.weekView.clearSelection();else if(_1.dayView)_1.dayView.clearSelection();var _3=(this.$53i&&_1.weekView.isLabelCol(0)?1:0);var _4=this.$53i?this.event[_1.startDateField].getDay()-
_1.firstDayOfWeek+_3:_3;if(this.$53i&&_1.showWeekends==false)_4--;var _5=this.event[_1.startDateField].getHours()*_1.getRowsPerHour();_1.showEventDialog(this.event)}},isc.A.mouseDown=function isc_EventWindow_mouseDown(){if(this.dragTarget)this.dragTarget.eventWin=this;this.calendar.eventDialog.hide();return isc.EH.STOP_BUBBLING},isc.A.updateTitle=function isc_EventWindow_updateTitle(){var _1=this.calendar,_2=this.event,_3=isc.Time.toTime(_2[_1.startDateField],this.calendar.timeFormatter,true),_4=_3+" "+_2[_1.nameField],_5="";if(_2.headerTextColor)_5+="color:"+_2.headerTextColor+";";if(_2.headerBackgroundColor){_5+="background-color:"+_2.headerBackgroundColor+";";var _6=this.header.getMember(0);if(_6){_6.setBackgroundColor(_2.headerBackgroundColor)}}
if(_5!="")_4="<span style='"+_5+"'>"+_4+"</span>";this.setTitle(_4)},isc.A.renderEvent=function isc_EventWindow_renderEvent(_1,_2,_3,_4){var _5=this.calendar,_6=this.event;if(isc.isA.Number(_3)&&isc.isA.Number(_4)){this.resizeTo(Math.round(_3),Math.round(_4))}
if(isc.isA.Number(_1)&&isc.isA.Number(_2)){this.moveTo(Math.round(_2),Math.round(_1))}
this.updateColors();if(this.$77n)
this.header.resizeTo(Math.round(_3),Math.round(_4));if(!this.isDrawn())this.draw();this.show();this.bringToFront()},isc.A.updateColors=function isc_EventWindow_updateColors(){var _1=this.calendar,_2=this.event,_3=this.header,_4=_3?_3.getMember?_3.getMember(0):_3:null,_5=_4,_6=_1.getEventTitle(_2,this.$643);if(!_2)return;if(_4&&_4.children&&_4.children[0]){var _7=_4.children[0].members;if(_7&&_7.length>0)_5=_7[0]}
if(_2.backgroundColor){this.setBackgroundColor(_2.backgroundColor);if(this.body)this.body.setBackgroundColor(_2.backgroundColor)}else{this.backgroundColor=null;if(this.isDrawn()&&this.getStyleHandle()){this.getStyleHandle().backgroundColor=null}
if(this.body){this.body.backgroundColor=null;if(this.body.isDrawn()&&this.body.getStyleHandle()){this.body.getStyleHandle().backgroundColor=null}}
if(_5){_5.backgroundColor=null;if(_5.isDrawn()&&_5.getStyleHandle()){_5.getStyleHandle().backgroundColor=null}}}
if(_2.textColor){this.setTextColor(_2.textColor);if(this.body){var _8="color:"+_2.textColor+";"
this.body.setTextColor(_2.textColor);this.body.setContents("<span style='"+_8+"'>"+_2[_1.descriptionField]||"</span>")}}else{if(this.textColor){this.setTextColor(null);if(this.isDrawn()&&this.getStyleHandle()){this.getStyleHandle().color=null}
if(this.body){this.body.setTextColor(null);this.body.setContents(_2[_1.descriptionField])}
if(_5){_5.setTextColor(null);_5.setContents(_6)}
if(this.$128l){this.$128l.setTextColor(null);this.$128l.setContents(_6)}}}
if(this.header){var _9,_10;if(_1.showEventDescriptions==false){_9=_2.backgroundColor;_10=_2.textColor}else{_9=_2.headerBackgroundColor;_10=_2.headerTextColor}
if(_9){this.header.setBackgroundColor(_9);if(_5)_5.setBackgroundColor(_9)}else{this.header.backgroundColor=null;if(this.isDrawn()&&this.header.getStyleHandle()){this.header.getStyleHandle().backgroundColor=null}
if(_5){_5.backgroundColor=null;if(_5.getStyleHandle()){_5.getStyleHandle().backgroundColor=null}}}
if(_10){this.header.setTextColor(_10);var _8="color:"+_10+";",_11=_1.showEventDescriptions==false?this.header.$116k:_6,_12="<span style='"+_8+"'>"+_11+"</span>";if(!_5){if(this.header.setContents)this.header.setContents(_12)}else{_5.setTextColor(_10);_5.setContents(_12)}}else{if(this.header.textColor){this.header.setTextColor(null);if(this.isDrawn()&&this.header.getStyleHandle()){this.header.getStyleHandle().color=null}
if(_5){_5.setTextColor(null);if(_5.isDrawn()&&_5.getStyleHandle()){_5.getStyleHandle().color=null}}}}
this.markForRedraw()}},isc.A.getPrintHTML=function isc_EventWindow_getPrintHTML(_1,_2){var _3=isc.StringBuffer.create(),_4=this.calendar,_5=_4.isTimeline(),_6=this.parentElement,_7=_6.grid,_8=40+_7.getHeaderHeight(),_9=this.getTop(),_10=_6.getPageTop(),_11=(_9)+_8+1,_12=_6.$26a,_13=_7.getLeft()+_6.getLeft()+(_7.getEventLeft?_7.getEventLeft(this.event):_4.getEventLeft(this.event,_7)),_14=this.getVisibleWidth(),_15=this.getVisibleHeight()-2,i=(_1&&_1.i?_1.i:1);var _17=_4.getEventStartCol(this.event,this),_18=_4.getEventEndCol(this.event,this);if(_5){_13+=11;_14-=2}else{_13=_6.getPageLeft()+this.getLeft();_13+=_7.isWeekView()?6:8}
var _19=_5?this.baseStyle:this.body.styleName;_3.append("<div class='",_19,"' ","style='border: 1px solid grey; vertical-align: ",(_4.showEventDescriptions?"top":"middle"),"; ",(_5?"overflow:hidden; ":""),"position: absolute; ","left:",_13,"px; top:",_11,"px; width: ",_14,"px; height: ",_15,"px; ","z-index:",i+2,";'>");if(_4.showEventDescriptions){_3.append(this.title,"<br>",this.event[_4.descriptionField])}else{_3.append(this.title)}
_3.append("</div>");var _20=_3.release();return _20},isc.A.getHoverHTML=function isc_EventWindow_getHoverHTML(){return this.calendar.getEventHoverHTML(this.event,this)},isc.A.closeClick=function isc_EventWindow_closeClick(){var _1=this.calendar;if(_1.eventRemoveClick(this.event)==false){this.$67e=true;return}
this.Super("closeClick",arguments);this.calendar.removeEvent(this.event,true);this.$53u=true;return isc.EH.STOP_BUBBLING},isc.A.parentResized=function isc_EventWindow_parentResized(){this.Super('parentResized',arguments);this.$643.sizeEventWindow(this)},isc.A.getEventLength=function isc_EventWindow_getEventLength(_1,_2){return this.calendar.getEventLength(_1||this.event[this.calendar.startDateField],_2||this.event[this.calendar.endDateField])},isc.A.show=function isc_EventWindow_show(){this.Super("show",arguments)});isc.B._maxIndex=isc.C+18;isc.ClassFactory.defineClass("TimelineWindow","EventWindow");isc.A=isc.TimelineWindow.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.showFooter=false;isc.A.resizeFrom=["L","R"];isc.A.dragAppearance="none";isc.B.push(isc.A.initWidget=function isc_TimelineWindow_initWidget(){if(this.calendar.showEventWindowHeader==false){this.showBody=false;this.showTitle=false}
this.Super("initWidget",arguments)},isc.A.draw=function isc_TimelineWindow_draw(_1,_2,_3,_4){this.invokeSuper(isc.TimelineWindow,"draw",_1,_2,_3,_4);if(this.calendar.showEventWindowHeader==false){var _5=isc.Canvas.create({autoDraw:false,width:"100%",height:0,top:0,contents:(this.descriptionText?this.descriptionText:" "),backgroundColor:this.event.backgroundColor,textColor:this.event.textColor});if(this.body)this.body.addMember(_5);else this.addMember(_5);_5.setHeight("100%");this.$734=_5}},isc.A.click=function isc_TimelineWindow_click(){var _1=this.calendar,_2=_1.timelineView,_3=_1.eventClick(this.event,"timeline");if(_1.bringEventsToFront)this.bringToFront();if(_3!=false){if(!_1.canEditEvent(this.event))return;_1.showEventDialog(this.event)}else return isc.EH.STOP_BUBBLING},isc.A.destroyLines=function isc_TimelineWindow_destroyLines(){if(this.$645){if(this.$645[0])this.$645[0].destroy();if(this.$645[1])this.$645[1].destroy();if(this.$645[2])this.$645[2].destroy();if(this.$645[3])this.$645[3].destroy()}},isc.A.hideLines=function isc_TimelineWindow_hideLines(){if(this.$645){if(this.$645[0])this.$645[0].hide();if(this.$645[1])this.$645[1].hide();if(this.$645[2])this.$645[2].hide();if(this.$645[3])this.$645[3].hide()}},isc.A.showLines=function isc_TimelineWindow_showLines(){if(this.$645){if(this.$645[0])this.$645[0].show();if(this.$645[1])this.$645[1].show();if(this.$645[2])this.$645[2].show();if(this.$645[3])this.$645[3].show()}},isc.A.hide=function isc_TimelineWindow_hide(){this.invokeSuper(isc.TimelineWindow,"hide");this.hideLines()},isc.A.show=function isc_TimelineWindow_show(){this.invokeSuper(isc.TimelineWindow,"show");this.showLines()},isc.A.parentResized=function isc_TimelineWindow_parentResized(){this.invokeSuper(isc.EventWindow,"parentResized")});isc.B._maxIndex=isc.C+9;isc.ClassFactory.defineClass("TimelineView","ListGrid");isc.TimelineView.changeDefaults("bodyProperties",{snapToCells:false,suppressVSnapOffset:true});isc.A=isc.TimelineView.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.canSort=false;isc.A.canResizeFields=false;isc.A.canAutoFitFields=false;isc.A.canReorderFields=false;isc.A.showHeaderContextMenu=false;isc.A.showAllRecords=true;isc.A.alternateRecordStyles=false;isc.A.showRollOver=true;isc.A.useCellRollOvers=true;isc.A.canSelectCells=true;isc.A.laneNameField="lane";isc.A.columnWidth=60;isc.A.laneHeight=60;isc.A.labelColumnWidth=75;isc.A.labelColumnBaseStyle="labelColumn";isc.A.eventPageSize=30;isc.A.trailIconSize=16;isc.A.leadIconSize=16;isc.A.scrollToToday=false;isc.A.lineImage="[SKINIMG]Stretchbar/hsplit_over_stretch.gif";isc.A.trailingEndPointImage="[SKINIMG]actions/prev.png";isc.A.leadingEndPointImage="[SKINIMG]actions/next.png";isc.A.headerSpanHeight=24;isc.A.headerProperties={inherentWidth:false};isc.A.eventCanvasConstructor="TimelineWindow";isc.A.poolEventWindows=true;isc.A.dragSelectCanvasDefaults={_constructor:"Canvas",styleName:"calendarCellSelected",opacity:60,width:1,height:1,disabled:true,autoDraw:false,resizeNow:function(_1){var _2=this.creator,_3=_2.creator,p=isc.addProperties({},this.props,_1);if(p.top==null){p.top=_2.getRowTop(_2.getLaneIndex(p.lane.name))}
if(p.height==null){p.height=_2.getLaneHeight(p.lane[_3.laneNameField])}
var _5=_2.getDateLeftOffset(p.startDate),_6=_2.getDateLeftOffset(p.endDate)-_5;this.props=p;this.moveTo(_5,p.top);this.resizeTo(_6,p.height);if(!this.isDrawn())this.draw();if(!this.isVisible()){this.show()}}};isc.B.push(isc.A.initWidget=function isc_TimelineView_initWidget(){this.fields=[];this.addProperties(this.creator.viewProps);this.addProperties(this.creator.gridProps);this.addProperties(this.creator.timelineViewProperties);var c=this.getCalendar();if(c.alternateLaneStyles){this.alternateRecordStyles=c.alternateLaneStyles}
if(c.canReorderLanes){this.canReorderRecords=c.canReorderLanes}
this.firstDayOfWeek=this.creator.firstDayOfWeek;if(c.laneNameField)this.laneNameField=c.laneNameField;if(c.renderEventsOnDemand)this.renderEventsOnDemand=c.renderEventsOnDemand;if(c.startDate)this.startDate=c.startDate.duplicate();if(c.endDate)this.endDate=c.endDate.duplicate();if(c.labelColumnWidth&&c.labelColumnWidth!=this.labelColumnWidth){this.labelColumnWidth=c.labelColumnWidth}
if(c.timelineEventPadding!=null)this.timelineEventPadding=c.timelineEventPadding;if(c.eventDragGap!=null)this.eventDragGap=c.eventDragGap;if(c.headerLevels)this.headerLevels=isc.shallowClone(c.headerLevels);this.$963=this.headerHeight;this.cellHeight=this.laneHeight;var _2=c.timelineGranularity,_3=isc.DateUtil.getTimeUnitKey(_2);if(!this.startDate){this.startDate=c.startDate=isc.DateUtil.getAbsoluteDate("-0"+_3,c.chosenDate)}
if(!this.endDate){this.endDate=c.endDate=isc.DateUtil.getAbsoluteDate("+"+c.defaultTimelineColumnSpan+_3,this.startDate)}else if(isc.Date.compareDates(this.startDate,this.endDate)==-1){var s=this.startDate;this.startDate=c.startDate=this.endDate;this.endDate=c.endDate=s;this.logWarn("Timeline startDate is later than endDate - switching the values.")}
this.Super("initWidget");this.rebuild(true);this.addAutoChild("eventDragTarget")},isc.A.getDragSelectCanvas=function isc_TimelineView_getDragSelectCanvas(_1){if(!this.body)return null;if(!this.dragSelectCanvas){this.addAutoChild("dragSelectCanvas",{eventProxy:this.body});this.body.addChild(this.dragSelectCanvas)}
return this.dragSelectCanvas},isc.A.cellMouseDown=function isc_TimelineView_cellMouseDown(_1,_2,_3){if(this.isLabelCol(_3)){return true}
var _4=this.creator,_5=this.body.getOffsetX(),_6=this.getDateFromPoint(_5,null,null,true),_7=this.getDateLeftOffset(_6);if(_4.backgroundMouseDown&&_4.backgroundMouseDown(_6)==false)return;if(!_4.canCreateEvents)return true;this.clearSelection();var _8=this.getDragSelectCanvas(),_9=this.getDateFromPoint(_5+_4.eventSnapGap,null,null,true),_10=_1;if(_4.disableWeekends&&!_4.dateIsWorkday(_6,_10.name)){return true}
var p={lane:_10,startDate:_6,endDate:_9,top:null,height:null};_8.resizeNow(p);this.$53r=true;return false},isc.A.cellOver=function isc_TimelineView_cellOver(_1,_2,_3){if(this.$53r){var _4=this.getDragSelectCanvas(),_5=_4.props,_6=this.getDateFromPoint(),_7=this.creator.addSnapGapsToDate(_6,this,1);_5.endDate=_7;_4.resizeNow(_5)}},isc.A.cellMouseUp=function isc_TimelineView_cellMouseUp(_1,_2,_3){if(!this.$53r)return true;this.$53r=false;var _4=this.creator,_5=this.getDragSelectCanvas(),_6=_5.props;var _7=_6.startDate,_8=_6.endDate;if(_4.backgroundClick){if(_4.backgroundClick(_6.startDate,_6.endDate)==false){this.clearSelection();return}}
if(_4.backgroundMouseUp){if(_4.backgroundMouseUp(_6.startDate,_6.endDate)==false){this.clearSelection();return}}
var _9=_6.lane,_10=_4.createEventObject(null,_7,_8,_9&&_9.name);_4.showNewEventDialog(_10);this.clearSelection()},isc.A.mouseMove=function isc_TimelineView_mouseMove(){if(this.$53r){this.cellOver()}},isc.A.clearSelection=function isc_TimelineView_clearSelection(){var _1=this.getDragSelectCanvas();if(_1)_1.hide()},isc.A.getCellDate=function isc_TimelineView_getCellDate(_1,_2){if(!this.body)return null;var _3=this.body.getField(_2);if(!_3||!_3.date)return null;return _3.date},isc.A.recordDrop=function isc_TimelineView_recordDrop(_1,_2,_3,_4){this.Super("recordDrop",arguments);this.$116v();this.markForRedraw()},isc.A.rebuild=function isc_TimelineView_rebuild(_1){this.clearEvents();var _2=this.calcFields();if(this.isDrawn())this.setFields(_2);else this.fields=_2;var _3=this.lanes||this.creator.lanes||[];this.setLanes(_3.duplicate(),true);this.$730();if(_1){this.$116v()}else{this.refreshEvents()}},isc.A.$116v=function isc_TimelineView__refreshData(){var _1=this.getCalendar();if(_1.dataSource&&isc.ResultSet&&isc.isA.ResultSet(_1.data)){_1.data.invalidateCache();_1.fetchData(_1.getNewCriteria(this))}else{_1.dataChanged()}},isc.A.setLanes=function isc_TimelineView_setLanes(_1,_2){var _3=this.creator.laneNameField;this.lanes=_1;_1.map(function(_4){if(!_4[_3])_4[_3]=_4.name});this.setData(_1);if(!_2)this.$116v()},isc.A.getLaneIndex=function isc_TimelineView_getLaneIndex(_1){var _2=this.data.findIndex("name",_1);if(_2<0)
_2=this.data.findIndex(this.creator.laneNameField,_1);return _2},isc.A.getLane=function isc_TimelineView_getLane(_1){var _2=this.getLaneIndex(_1);if(_2>=0)return this.data[_2]},isc.A.hasLanes=function isc_TimelineView_hasLanes(){return true},isc.A.getLaneFromPoint=function isc_TimelineView_getLaneFromPoint(_1,_2){if(_2==null)_2=this.body.getOffsetY();var _3=this.getEventRow(_2),_4=this.getRecord(_3);return _4},isc.A.$730=function isc_TimelineView__scrubDateRange(){var _1=this.creator.timelineGranularity;if(_1=="month"){this.startDate.setDate(1)}else if(_1=="week"){this.startDate=isc.DateUtil.getStartOf(this.startDate,"w",true)}else if(_1=="day"){this.startDate.setHours(0);this.startDate.setMinutes(0);this.startDate.setSeconds(0);this.startDate.setMilliseconds(0)}else if(_1=="hour"){this.startDate.setMinutes(0);this.startDate.setSeconds(0);this.startDate.setMilliseconds(0)}else if(_1=="minute"){this.startDate.setSeconds(0);this.startDate.setMilliseconds(0)}},isc.A.scrollTimelineTo=function isc_TimelineView_scrollTimelineTo(_1){this.bodies[1].scrollTo(_1)},isc.A.setLaneHeight=function isc_TimelineView_setLaneHeight(_1){this.laneHeight=_1;this.setCellHeight(_1);this.refreshEvents()},isc.A.getRowHeight=function isc_TimelineView_getRowHeight(_1,_2){return _1.height||this.Super("getRowHeight",arguments)},isc.A.setInnerColumnWidth=function isc_TimelineView_setInnerColumnWidth(_1){this.columnWidth=_1;this.setFields(this.calcFields());this.refreshEvents()},isc.A.setTimelineRange=function isc_TimelineView_setTimelineRange(_1,_2,_3,_4,_5){var _6=this.getCalendar(),_7=this.$116z||_6.defaultTimelineColumnSpan;this.startDate=_1.duplicate();_6.startDate=_1.duplicate();if(_2){this.endDate=_2.duplicate()}else{var _8=(_3||_6.timelineGranularity).toLowerCase(),_9=isc.DateUtil.getTimeUnitKey(_8);this.endDate=isc.DateUtil.getAbsoluteDate("+"+_7+_9,this.startDate)}
_6.endDate=this.endDate.duplicate();if(_3)_6.timelineGranularity=_3;if(_4)_6.timelineUnitsPerColumn=_4;_6.dateChooser.setData(this.startDate);if(!_5)_6.setChosenDate(this.startDate,true);this.rebuild(true)},isc.A.addUnits=function isc_TimelineView_addUnits(_1,_2,_3){_3=_3||this.getCalendar().timelineGranularity;if(_3=="century"){_1.setFullYear(_1.getFullYear()+(_2*100))}else if(_3=="decade"){_1.setFullYear(_1.getFullYear()+(_2*10))}else if(_3=="year"){_1.setFullYear(_1.getFullYear()+_2)}else if(_3=="quarter"){_1.setMonth(_1.getMonth()+(_2*3))}else if(_3=="month"){_1.setMonth(_1.getMonth()+_2)}else if(_3=="week"){_1.setDate(_1.getDate()+(_2*7))}else if(_3=="day"){_1.setDate(_1.getDate()+_2)}else if(_3=="hour"){_1.setHours(_1.getHours()+_2)}else if(_3=="minute"){_1.setMinutes(_1.getMinutes()+_2)}else if(_3=="second"){_1.setSeconds(_1.getSeconds()+_2)}else if(_3=="millisecond"){_1.setMilliseconds(_1.getMilliseconds()+_2)}
return _1},isc.A.getTimelineEventLeft=function isc_TimelineView_getTimelineEventLeft(_1){var _2=this.getTimelineEventColNum(_1);return this.getColumnLeft(_2)},isc.A.getTimelineEventColNum=function isc_TimelineView_getTimelineEventColNum(_1){var _2=this.getFields(),_3=_1[this.creator.startDateField];for(var i=0;i<_2.length;i++){var _5=_2[i];if(_5.date&&_5.date>_3){return i-1}}
return null},isc.A.getTimelineEventTop=function isc_TimelineView_getTimelineEventTop(_1){var _2=this.getTimelineEventRowNum(_1);return this.getRowTop(_2)},isc.A.getTimelineEventRowNum=function isc_TimelineView_getTimelineEventRowNum(_1){var _2=this.data.find("name",_1[this.creator.laneNameField]);if(!_2)_2=this.data.find(this.creator.laneNameField,_1[this.creator.laneNameField]);return this.getRecordIndex(_2)},isc.A.calcFields=function isc_TimelineView_calcFields(){var _1=[],c=this.creator;if(this.creator.laneFields){var _3=this.creator.laneFields;_3.setProperty("frozen",true);_3.setProperty("isLaneField",true);for(var i=0;i<_3.length;i++){if(_3[i].width==null)_3[i].width=this.labelColumnWidth;_1.add(_3[i])}}else{var _5={width:this.labelColumnWidth,name:"title",title:" ",showTitle:false,frozen:true,isLaneField:true};_1.add(_5)}
if(!c.headerLevels&&!this.headerLevels){c.headerLevels=[{unit:c.timelineGranularity}]}
if(c.headerLevels){this.headerLevels=isc.shallowClone(c.headerLevels)}
if(this.headerLevels){this.fieldHeaderLevel=this.headerLevels[this.headerLevels.length-1];this.headerLevels.remove(this.fieldHeaderLevel);c.timelineGranularity=this.fieldHeaderLevel.unit}
this.adjustTimelineForHeaders();var _6=this.startDate.duplicate(),_7=this.endDate.duplicate(),_8=c.timelineUnitsPerColumn,_9=0,_10=this.fieldHeaderLevel,_11=_10&&_10.titles?_10.titles:[];if(_10.headerWidth)this.columnWidth=_10.headerWidth;while(_6.getTime()<=_7.getTime()){var _12={},_13=this.getInnerFieldTitle(_10,_9,_6);_12=isc.addProperties(_12,{name:"f"+_9,title:_13,width:_10.headerWidth||this.columnWidth,date:_6.duplicate()},this.getFieldProperties(_6));_1.add(_12);_6=this.addUnits(_6,_8);_9++}
this.buildHeaderSpans(_1,this.headerLevels,this.startDate,this.endDate);this.$116z=_9-1;return _1},isc.A.adjustTimelineForHeaders=function isc_TimelineView_adjustTimelineForHeaders(){var _1=this.getCalendar(),_2=this.fieldHeaderLevel?this.fieldHeaderLevel.unit:_1.timelineGranularity,_3=_1.startDate,_4=_1.endDate;var _5=isc.DateUtil.getTimeUnitKey(_2);_1.startDate=this.startDate=isc.DateUtil.getStartOf(_3,_5);_1.endDate=this.endDate=isc.DateUtil.getEndOf(_4,_5)},isc.A.buildHeaderSpans=function isc_TimelineView_buildHeaderSpans(_1,_2,_3,_4){var _5=_3.duplicate(),c=this.creator,_7=[],_8=[];if(_2&&_2.length>0){_8=this.getHeaderSpans(_3,_4,_2,0,_1);this.headerHeight=this.$963+this.headerSpanHeight}
if(_8&&_8.length>0)this.headerSpans=_8},isc.A.getHeaderSpans=function isc_TimelineView_getHeaderSpans(_1,_2,_3,_4,_5){var _6=_1.duplicate(),c=this.creator,_8=_3[_4],_9=_8.unit,_10=_4>0?_3[_4-1].unit:_9,_11=c.timelineUnitsPerColumn,_12=_8.titles||[],_13=[],_14=0;if(_4>0){if(isc.DateUtil.compareTimeUnits(_9,_10)>0){isc.logWarn("The order of the specified HeaderLevels is incorrect - '"+_9+"' is of a larger granularity than '"+_10+"'")}}
var _15=isc.DateUtil;while(_6<=_2){_15.dateAdd(_6,"mn",1,1);var _16=this.addUnits(_6.duplicate(),_11,_9);var _17={unit:_9,startDate:_6,endDate:_16,fields:[]};this.setSpanDates(_17,_6);_16=_17.endDate;var _18=this.getHeaderLevelTitle(_8,_14,_6,_16);_17.title=_18;for(var i=0;i<_5.length;i++){var _20=_5[i];if(_20.isLaneField||_20.date<_17.startDate)continue;if(_20.date>=_17.endDate)break;_17.fields.add(_20.name)}
if(_4<_3.length-1){_17.spans=this.getHeaderSpans(_17.startDate,_17.endDate,_3,_4+1,_5);if(_8.titles&&_8.titles.length!=_17.spans.length){isc.logWarn("The titles array provided for the "+_8.unit+" levelHeader has a length mismatch: expected "+_17.spans.length+" but "+_8.titles.length+" are present.  Some titles  may be auto-generated according to TimeUnit.")}}
_13.add(isc.clone(_17));_6=_16.duplicate();_14++}
return _13},isc.A.getHeaderLevelTitle=function isc_TimelineView_getHeaderLevelTitle(_1,_2,_3,_4){var _5=_1.unit,_6=_1.titles?_1.titles[_2]:null;if(!_6){if(_5=="century"||_5=="decade"){_6=_3.getFullYear()+" - "+_4.getFullYear()}else if(_5=="year"){_6=_3.getFullYear()}else if(_5=="quarter"){_6=_3.getShortMonthName()+" - "+_4.getShortMonthName()}else if(_5=="month"){_6=_3.getShortMonthName()}else if(_5=="week"){_6=this.creator.weekPrefix+" "+_4.getWeek(this.firstDayOfWeek)}else if(_5=="day"){_6=_3.getShortDayName()}else{if(_5=="hour")_6=_3.getHours();if(_5=="minute")_6=_3.getMinutes();if(_5=="second")_6=_3.getSeconds();if(_5=="millisecond")_6=_3.getMilliseconds();if(_5=="hour")_6=_3.getHours()}
if(isc.isA.Function(_1.titleFormatter)){_6=_1.titleFormatter(_1,_3,_4,_6,this.creator)}}
return _6},isc.A.setSpanDates=function isc_TimelineView_setSpanDates(_1,_2){var _3=isc.DateUtil.getTimeUnitKey(_1.unit);_1.startDate=isc.DateUtil.getStartOf(_2,_3,null,this.firstDayOfWeek);_1.endDate=isc.DateUtil.getEndOf(_1.startDate,_3,null,this.firstDayOfWeek)},isc.A.getFieldProperties=function isc_TimelineView_getFieldProperties(_1){return null},isc.A.getInnerFieldTitle=function isc_TimelineView_getInnerFieldTitle(_1,_2,_3,_4){var _5=_1.unit,_6=_1.titles?_1.titles[_2]:null;if(!_6){if(_5=="year"){_6=_3.getFullYear()}else if(_5=="month"){_6=_3.getShortMonthName()}else if(_5=="week"){_6=this.creator.weekPrefix+_3.getWeek(this.firstDayOfWeek)}else if(_5=="day"){_6=(_3.getMonth()+1)+"/"+_3.getDate()}else{var _7=_3.getMinutes().toString();if(_7.length==1)_7="0"+_7;_6=_3.getHours()+":"+_7}
if(isc.isA.Function(_1.titleFormatter)){_6=_1.titleFormatter(_1,_3,_4,_6,this.creator)}}
return _6},isc.A.draw=function isc_TimelineView_draw(_1,_2,_3,_4){this.invokeSuper(isc.TimelineView,"draw",_1,_2,_3,_4);var _5=this.creator.eventSnapGap;if(_5){this.body.snapHGap=Math.round((_5/60)*this.columnWidth)}else{this.body.snapHGap=this.columnWidth}
this.body.snapVGap=this.laneHeight;if(this.scrollToToday!=false){var _6=new Date();_6.setDate(_6.getDate()-this.scrollToToday);var _7=this.creator.getDayDiff(this.startDate,_6);var _8=_7*this.columnWidth;this.bodies[1].scrollTo(_8,0)}
this.logDebug('draw','calendar');this.body.addChild(this.eventDragTarget);this.eventDragTarget.setView(this);this.refreshEvents()},isc.A.getCellCSSText=function isc_TimelineView_getCellCSSText(_1,_2,_3){var _4=this.creator.$116j(this,_1,_2,_3);if(_4)return _4;return this.Super("getCellCSSText",arguments)},isc.A.formatDateForDisplay=function isc_TimelineView_formatDateForDisplay(_1){return _1.getShortMonthName()+" "+_1.getDate()+", "+_1.getFullYear()},isc.A.getLabelColCount=function isc_TimelineView_getLabelColCount(){if(this.creator.laneFields){return this.creator.laneFields.length}else{return 1}},isc.A.isLabelCol=function isc_TimelineView_isLabelCol(_1){return this.getField(_1).frozen==true},isc.A.getCellStyle=function isc_TimelineView_getCellStyle(_1,_2,_3){var _4=this.getBaseStyle(_1,_2,_3);if(this.isLabelCol(_3))return _4;if(this.alternateRecordStyles&&_2%2!=0)return _4+"Dark";return _4},isc.A.getBaseStyle=function isc_TimelineView_getBaseStyle(_1,_2,_3){if(this.isLabelCol(_3))return this.labelColumnBaseStyle;else{return this.baseStyle}},isc.A.slideRange=function isc_TimelineView_slideRange(_1){var c=this.creator,_3=c.timelineGranularity.toLowerCase(),_4=isc.DateUtil.getTimeUnitKey(_3),_5=c.timelineUnitsPerColumn,_6=this.startDate.duplicate(),_7=this.endDate.duplicate(),_8=_1?1:-1,_9=c.columnsPerPage||(this.getFields().length-this.getLabelColCount());_6=isc.DateUtil.dateAdd(_6,_4,_9,_8,false);_6=isc.DateUtil.getStartOf(_6,_4,false);_7=isc.DateUtil.dateAdd(_7,_4,_9,_8,false);_7=isc.DateUtil.getEndOf(_7,_4,false);this.setTimelineRange(_6,_7,_3,_5,false)},isc.A.nextOrPrev=function isc_TimelineView_nextOrPrev(_1){this.slideRange(_1)},isc.A.refreshEvents=function isc_TimelineView_refreshEvents(){if(!this.$129c)this.$129c=[];if(!this.$128q)this.$128q=[];var _1=this.getCalendar();if(!this.body||!_1.hasData())return;var _2=this.startDate,_3=_2.getTime(),_4=this.endDate,_5=_4.getTime();this.removeOverlapRanges(this.overlapRanges);var _6=_1.data.getRange(0,_1.data.getLength());var _7=[];_6.map(function(_12){if(!isc.isA.String(_12)){var _8=_12[_1.startDateField].getTime(),_9=_12[_1.endDateField].getTime();if((_8>=_3&&_8<_5)||(_9>_3&&_9<=_5))
{_12.eventLength=(_9-_8);_7.add(_12)}}});this.logDebug('refreshing '+_7.length+' events','calendar');var _10=isc.getKeys(_1.getLaneMap());var _11=this;this.tagDataForOverlap(_7);this.refreshVisibleEvents()},isc.A.compareDates=function isc_TimelineView_compareDates(_1,_2,_3){if(_1.getFullYear()<_2.getFullYear()){return 1}else if(_1.getFullYear()>_2.getFullYear()){return-1}
if(_1.getMonth()<_2.getMonth()){return 1}else if(_1.getMonth()>_2.getMonth()){return-1}
if(_1.getDate()<_2.getDate()){return 1}else if(_1.getDate()>_2.getDate()){return-1}
return 0},isc.A.getDateFromPoint=function isc_TimelineView_getDateFromPoint(_1,_2,_3,_4){var _5=this.startDate.duplicate();var _6=this.columnWidth;var _7=this.$731();var _8=0;if(_1==null&&_2==null){_1=this.body.getOffsetX();_2=this.body.getOffsetY()}
if(_4==null)_4=true;if(_4){_1-=_1%this.creator.eventSnapGap}
_8+=Math.floor(_1/_6)*_7;if(!_3)_8+=((_1%_6)/_6)*_7;_5.setMinutes(_5.getMinutes()+_8);return _5},isc.A.$731=function isc_TimelineView__getMinsInACell(){var _1=this.creator.timelineUnitsPerColumn;var _2=this.creator.timelineGranularity;var _3=24*60;var _4;var _5=0;if(_2=="month"){_4=_1*(_3*30)}else if(_2=="week"){_4=_1*(_3*7)}else if(_2=="day"){_4=_1*_3}else if(_2=="hour"){_4=_1*60}else if(_2=="minute"){_4=_1}
return _4},isc.A.$732=function isc_TimelineView__getEventBreadth(_1){var _2=this.$731(),_3=_1.event,_4=this.getCalendar(),_5,_6;if(Array.isLoading(_3))return null;if(_3[_4.startDateField].getTime()<this.startDate.getTime()){_5=this.startDate.duplicate()}else{_5=_3[_4.startDateField]}
if(_3[_4.endDateField].getTime()>this.endDate.getTime()){_6=this.endDate.duplicate()}else{_6=_3[_4.endDateField].duplicate()}
var _7=_1.getEventLength(_5,_6);var _8=this.columnWidth;var _9=0;var _10=Math.floor(_7/_2);if(_4.sizeEventsToGrid){var _11=this.getTimelineEventColNum(_3);if(_11){var _12=this.getField(_11),_13=_12.date?_12.date.getTime()==_3[_4.startDateField].getTime():false,r=_7%_2;if(r!=0||!_13)_10+=1}}
var _15=Math.max(0,this.getEventStartCol(_3)+1),_16=false;if(_15+_10>this.body.fields.length){_10--;_16=true}
_9+=Math.max(0,_10)*_8;if(_4.sizeEventsToGrid==false){if(!_16){var _17=Math.floor(((_7%_2)/_2)*_8);_9+=_17}else{var _18=Math.floor(_7%_2);_9+=_18}}
return _9},isc.A.getEventStartCol=function isc_TimelineView_getEventStartCol(_1){var _2=(_1[this.creator.startDateField].getTime()-this.startDate.getTime())/(1000*60);_2=Math.round(_2);var _3=this.$731();return Math.floor(_2/_3)},isc.A.getDateLeftOffset=function isc_TimelineView_getDateLeftOffset(_1,_2){if(!_1)return 0;var _3=_1.duplicate(),_4=this.creator,_5=_4.getVisibleStartDate(this),_6=_4.getVisibleEndDate(this);if(_3.getTime()<=_5.getTime()){_3.setTime(_5.getTime()+1)}
if(_3.getTime()>=_6.getTime()){_3.setTime(_6.getTime()-1)}
var _7=this.body.fields,_8=_7.getLength(),_9=_3.getTime(),_10=Math.floor(_9/60000);for(var i=0;i<_8;i++){var _12=_7[i];if(!this.fieldIsVisible(_12))continue;var _13=_12.date.getTime(),_14=new Date(_13+(this.$731()*60000)),_15=_14.getTime(),_16=Math.floor(_12.date.getTime()/60000),_17=Math.floor(_14.getTime()/60000);if(_10<_17){if(_10>=_16){var _18=this.body.getColumnLeft(i),_19=(_9-_13),_20=_10-_16,_21=_4.getSnapGapMinutes(this),_22=!_21?1:_2?Math.round(_20/_21):Math.floor(_20/_21),_23=_18+(_10==_16?0:(_22*_4.eventSnapGap));return _23}else{return this.body.getColumnLeft(i)}}}
return-1},isc.A.getEventLeft=function isc_TimelineView_getEventLeft(_1){return this.getDateLeftOffset(_1[this.creator.startDateField])},isc.A.getLaneHeight=function isc_TimelineView_getLaneHeight(_1){if(isc.isA.Number(_1))_1=this.getRecord(_1);return _1&&_1.height||this.cellHeight},isc.A.addLeadingAndTrailingLines=function isc_TimelineView_addLeadingAndTrailingLines(_1){var _2,_3,_4,_5;if(_1.$645){_2=_1.$645[0];_3=_1.$645[1];_4=_1.$645[2];_5=_1.$645[3]}else{_2=this.$65r();_3=this.$65s(_1,"lead");_4=this.$65r();_5=this.$65s(_1,"trail")}
var _6=this.$65t(_3,_2);var _7=this.$65t(_5,_4);if(!_1.$645){this.body.addChild(_2);this.body.addChild(_3);this.body.addChild(_4);this.body.addChild(_5);_1.$645=[_2,_3,_4,_5]}},isc.A.$65t=function isc_TimelineView__positionIcon(_1,_2){var _3=this.getCalendar(),_4=_1.$65e,_5=_4.event,_6=_1.type,_7=this.columnWidth,_8=_4.getVisibleHeight(),_9=_4.getTop(),_10=_4.getLeft();var _11,_12,_13=true;if(_6=="trail"){if(this.compareDates(_5[_3.trailingDateField],this.endDate)<0){_11=_3.getDayDiff(this.endDate,_5[_3.startDateField]);if(_11<1)_11=1;_12=_11*_7;_13=false}else{_11=_3.getDayDiff(_5[_3.trailingDateField],_5[_3.startDateField]);_12=(_11*_7)-(Math.round(_7/2))}}else{if(this.compareDates(this.startDate,_5[_3.leadingDateField])<0){_11=_3.getDayDiff(this.startDate,_5[_3.startDateField]);if(_11<1)_11=1;_12=_11*_7;_13=false}else{_11=_3.getDayDiff(_5[_3.leadingDateField],_5[_3.startDateField]);_12=(_11*_7)-(Math.round(_7/2))}}
var _14=(_6=="trail"?_10+_7:_10-_12);_2.moveTo(_14,_9+(Math.round(_8/_3.getRowsPerHour(this))));_2.setWidth(_12);var _15=0;if(_5.$646&&_5.$646.slotNum>0){_15=(_5.$646.slotNum-1)*_8}
var _16=(_6=="trail"?this.trailIconSize:this.leadIconSize);var _17;if(_13==false)_17=-50;else if(_6=="trail")_17=_10+_7+_12-Math.round(_16/2);else _17=_10-_12-Math.round(_16/2);_1.moveTo(_17,_9+Math.round(_8/2)-Math.round(_16/2));_1.$647=Math.round(_8/2)-Math.round(_16/2)+_15;_1.$648=Math.round(_7/2)-Math.round(_16/2);_1.$65f=_3.getDayDiff(_5[_3.startDateField],this.startDate);return _13},isc.A.$65s=function isc_TimelineView__makeIcon(_1,_2){var _3=(_2=="trail"?this.trailIconSize:this.leadIconSize);var _4=isc.Img.create({$65e:_1,type:_2,autoDraw:false,_redrawWithParent:false,src:(_2=="trail"?this.trailingEndPointImage:this.leadingEndPointImage),width:_3,height:_3,canDragReposition:(this.creator.canEditEvents==true),dragRepositionStart:function(){this.$1245.$8l=this.parentElement.getEventRow();this.$1245.$644=this.parentElement.getEventColumn();this.parentElement.VSnapOrigin=this.$647;this.parentElement.HSnapOrigin=this.$648},dragRepositionStop:function(){var _5=this.$65f,_6=this.$1245.$644,_7=this.parentElement.getEventColumn(),_8=_7-_6,_9=this.$65e.event,_10=this.$65e.calendar,_11=this.type=="trail"?_7-_5:_5-_7;if(_11<1)return false;var _12={};var _13=this.type=="trail"?_10.trailingDateField:_10.leadingDateField;var _14=_9[_13].duplicate();_14.setDate(_14.getDate()+_8);_12[_13]=_14;_10.updateEvent(_9,_9[_10.startDateField],_9[_10.endDateField],_9[_10.nameField],_9[_10.descriptionField],_12,true);return true}});return _4},isc.A.$65r=function isc_TimelineView__makeLine(){var _1=isc.Canvas.create({autoDraw:false,_redrawWithParent:false,height:2,overflow:"hidden",styleName:"eventLine"});return _1},isc.A.addEvent=function isc_TimelineView_addEvent(_1,_2){if(!this.$129c)this.$129c=[];if(!this.$128h)this.$128h=[];var _3=false,_4=this.getCalendar(),_5=_4.canEditEvent(_1),_6=(_4.canDragEvents==true&&_1[_4.canDragEventField]!=false),_7=_1[_4.eventWindowStyleField]||_4.eventWindowStyle,_8=this.$128h,_9;_9=this.getCurrentEventCanvas(_1);var _10=(_9!=null);if(_10){this.$128h.remove(_9)}else if(this.poolEventWindows){_9=this.getPooledEventCanvas(_1);if(_9){_3=true}}
if(_9){_9.event=_1;var _11={};if(!_10)_9.setProperties(_11);if(_9.setEvent)_9.setEvent(_1,_7);else{_9.event=_1;_9.setEventStyle(_7)}}else{_9=this.getNewEventWindow(_1);_9.$643=this}
if(this.$129c&&!this.$129c.contains(_9))
this.$129c.add(_9);if(this.$128q&&!this.$128q.contains(_1))
this.$128q.add(_1);_9.$128k=false;if(this.body&&(!_3||_9.parentElement!=this.body)){this.body.addChild(_9)}
_9.canDragResize=_4.canResizeTimelineEvents&&_5;_9.setCanDragReposition(_4.canDragEvents,this.eventDragTarget);this.sizeEventWindow(_9,_3);var _12=false;if(!_12&&this.body&&this.body.isDrawn()){this.sizeEventWindow(_9);if(this.body)this.body.addChild(_9)}},isc.A.getNewEventWindow=function isc_TimelineView_getNewEventWindow(_1){var _2=this.getCalendar(),_3=_1[_2.eventWindowStyleField]||_2.eventWindowStyle,_4=isc.addProperties({},this.bodyProperties,{backgroundColor:_1.backgroundColor,textColor:_1.textColor,styleName:_3+"Body"}),_5=isc.addProperties({dragTarget:this.eventDragTarget},this.headerProperties,{backgroundColor:_1.headerBackgroundColor,textColor:_1.headerTextColor,styleName:_3+"Header"}),_6=true;if(_2.showEventDescriptions==false){_6=false}
var _7=(_2.canDragEvents==true&&_1[_2.canDragEventField]!=false),_8=_2.canEditEvent(_1);if(_6)_5.headerHeight=14;var _9=isc.addProperties({isEventCanvas:true,calendar:_2,_redrawWithParent:false,styleName:_3,baseStyle:_3,canDragReposition:_7&&_8,canDragResize:_2.canResizeTimelineEvents&&_8,edgeMarginSize:10,showCloseButton:false,event:_1,descriptionText:_1[_2.descriptionField]||"",showHeader:_6,showBody:_6,dragTarget:this.eventDragTarget,backgroundColor:_1.backgroundColor,textColor:_1.textColor,headerProperties:_5,bodyProperties:_4,headerStyle:_3+"Header",bodyStyle:_3+"Body"},_2.eventWindowDefaults,_2.eventWindowProperties);if(_1.backgroundColor){_9.backgroundColor=_1.backgroundColor}
var _10=isc.ClassFactory.getClass(this.eventCanvasConstructor||_2.eventCanvasConstructor);var _11=(_10||isc.TimelineWindow).create(_9);_11.$128k=false;_2.setEventCanvasID(this,_1,_11.ID);return _11},isc.A.updateEventWindow=function isc_TimelineView_updateEventWindow(_1){if(!this.body||!this.body.children)return;var _2=this.getCalendar(),_3=_1[_2.laneNameField];var _4=this.tagDataForOverlap(_2.data.getRange(0,_2.data.getLength()),_3);if(this.renderEventsOnDemand){this.refreshVisibleEvents()}else{for(var i=0;i<_4.length;i++){var _6=_4.get(i),_7=this.getCurrentEventCanvas(this,_6);_7.event=_6;this.sizeEventWindow(_7)}}},isc.A.areSame=function isc_TimelineView_areSame(_1,_2){if(!_1||!_2)return false;var _3=this.getCalendar();if(_3.dataSource){var _4=_3.getEventPKs(),_5=true;for(var i=0,_7=_4.length;i<_7;i++){if(_1[_4[i]]!=_2[_4[i]]){_5=false;break}}
return _5}else{return(_1===_2)}});isc.evalBoundary;isc.B.push();isc.B._maxIndex=isc.C+61;isc.Calendar.registerStringMethods({getDayBodyHTML:"date,events,calendar,rowNum,colNum",getDayHeaderHTML:"date,events,calendar,rowNum,colNum",dayBodyClick:"date,events,calendar,rowNum,colNum",dayHeaderClick:"date,events,calendar,rowNum,colNum",eventClick:"event,viewName",eventChanged:"event",eventMoved:"newDate,event",eventResized:"newDate,event",backgroundClick:"startDate,endDate",backgroundMouseDown:"startDate",backgroundMouseUp:"startDate,endDate"});isc.A=isc.DaySchedule;isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.$126v=function isc_c_DaySchedule__getEventScaffolding(_1,_2,_3,_4){var _5=(60/_1)*24,_6=[],_7={label:"",day1:"",day2:"",day3:"",day4:"",day5:"",day6:"",day7:""},_8=_2||new Date(),_9=new Date(_8.getFullYear(),_8.getMonth(),_8.getDate(),0,0,0,0),_10=_3.isDayView();if(_10)isc.DaySchedule.$129g(_4,_3,_9.duplicate());for(var i=0;i<_5;i++){var _12=isc.Date.getLogicalTimeOnly(_9.duplicate());_6.add(isc.addProperties({},_7,{time:_12}));_9=isc.DateUtil.dateAdd(_9,"mn",_1,1)}
return _6},isc.A.$129g=function isc_c_DaySchedule__getCellDates(_1,_2,_3){_3=_3||new Date();var _4=_1.getMinutesPerRow(_2),_5=_3.duplicate(),_6=new Date(_5.getFullYear(),_5.getMonth(),_5.getDate(),0,0,0,0),_7=(60/_4)*24,_8=_2.isDayView()?1:7,_9=[];_2.$142y=null;for(var j=0;j<_8;j++){var _11=_6.duplicate(),_12=_11.duplicate();for(var i=0;i<=_7;i++){if(!_9[i])_9[i]={};_9[i]["day"+(j+1)]=_12;var _14=_4*(i+1);var _15=isc.DateUtil.dateAdd(_11.duplicate(),"mn",_14,1);var _16=isc.Date.getLogicalTimeOnly(_15);var _16=isc.Date.getLogicalTimeOnly(_11);_16.setTime(_16.getTime()+(_14*60000));if((_16.getHours()!=_15.getHours())||(_16.getMinutes()!=_15.getMinutes()))
{if(!_2.$142y)_2.$142y=[];_2.$142y.add({rowNum:i+1,colNum:j})}else{_12=_15.duplicate()}}
_6=isc.DateUtil.dateAdd(_6.duplicate(),"d",1)}
_2.$129f=_9;return _9});isc.B._maxIndex=isc.C+2;isc.AutoTest.customizeCalendar();isc.ClassFactory.defineClass("Timeline","Calendar");isc.A=isc.Timeline.getPrototype();isc.A.showTimelineView=true;isc.A.showDayView=false;isc.A.showWeekView=false;isc.A.showMonthView=false;isc.A.showControlBar=false;isc.A.labelColumnWidth=75;isc.A.sizeEventsToGrid=false;isc.A.eventDragGap=0;isc._nonDebugModules=(isc._nonDebugModules!=null?isc._nonDebugModules:[]);isc._nonDebugModules.push('Calendar');isc.checkForDebugAndNonDebugModules();isc._moduleEnd=isc._Calendar_end=(isc.timestamp?isc.timestamp():new Date().getTime());if(isc.Log&&isc.Log.logIsInfoEnabled('loadTime'))isc.Log.logInfo('Calendar module init time: '+(isc._moduleEnd-isc._moduleStart)+'ms','loadTime');delete isc.definingFramework;}else{if(window.isc&&isc.Log&&isc.Log.logWarn)isc.Log.logWarn("Duplicate load of module 'Calendar'.");}

/*

  SmartClient Ajax RIA system
  Version v9.1p_2021-05-18/LGPL Development Only (2021-05-18)

  Copyright 2000 and beyond Isomorphic Software, Inc. All rights reserved.
  "SmartClient" is a trademark of Isomorphic Software, Inc.

  LICENSE NOTICE
     INSTALLATION OR USE OF THIS SOFTWARE INDICATES YOUR ACCEPTANCE OF
     ISOMORPHIC SOFTWARE LICENSE TERMS. If you have received this file
     without an accompanying Isomorphic Software license file, please
     contact licensing@isomorphic.com for details. Unauthorized copying and
     use of this software is a violation of international copyright law.

  DEVELOPMENT ONLY - DO NOT DEPLOY
     This software is provided for evaluation, training, and development
     purposes only. It may include supplementary components that are not
     licensed for deployment. The separate DEPLOY package for this release
     contains SmartClient components that are licensed for deployment.

  PROPRIETARY & PROTECTED MATERIAL
     This software contains proprietary materials that are protected by
     contract and intellectual property law. You are expressly prohibited
     from attempting to reverse engineer this software or modify this
     software for human readability.

  CONTACT ISOMORPHIC
     For more information regarding license rights and restrictions, or to
     report possible license violations, please contact Isomorphic Software
     by email (licensing@isomorphic.com) or web (www.isomorphic.com).

*/

