@syncfusion/ej2-schedule 31.1.20 → 31.1.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ej2-schedule.min.js +2 -2
- package/dist/ej2-schedule.umd.min.js +2 -2
- package/dist/ej2-schedule.umd.min.js.map +1 -1
- package/dist/es6/ej2-schedule.es2015.js +6 -2
- package/dist/es6/ej2-schedule.es2015.js.map +1 -1
- package/dist/es6/ej2-schedule.es5.js +5 -1
- package/dist/es6/ej2-schedule.es5.js.map +1 -1
- package/dist/global/ej2-schedule.min.js +2 -2
- package/dist/global/ej2-schedule.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +4 -4
- package/src/schedule/actions/virtual-scroll.js +5 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: ej2-schedule.umd.min.js
|
|
3
|
-
* version : 31.1.
|
|
3
|
+
* version : 31.1.21
|
|
4
4
|
* Copyright Syncfusion Inc. 2001 - 2024. All rights reserved.
|
|
5
5
|
* Use of this code is subject to the terms of our license.
|
|
6
6
|
* A copy of the current license can be obtained at any time by e-mailing
|
|
7
7
|
* licensing@syncfusion.com. Any infringement will be prosecuted under
|
|
8
8
|
* applicable laws.
|
|
9
9
|
*/
|
|
10
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-popups"),require("@syncfusion/ej2-navigations"),require("@syncfusion/ej2-calendars"),require("@syncfusion/ej2-data"),require("@syncfusion/ej2-buttons"),require("@syncfusion/ej2-inputs"),require("@syncfusion/ej2-dropdowns"),require("@syncfusion/ej2-lists"),require("@syncfusion/ej2-excel-export")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-popups","@syncfusion/ej2-navigations","@syncfusion/ej2-calendars","@syncfusion/ej2-data","@syncfusion/ej2-buttons","@syncfusion/ej2-inputs","@syncfusion/ej2-dropdowns","@syncfusion/ej2-lists","@syncfusion/ej2-excel-export"],t):t((e=e||self).ej={},e.ej2Base,e.ej2Popups,e.ej2Navigations,e.ej2Calendars,e.ej2Data,e.ej2Buttons,e.ej2Inputs,e.ej2Dropdowns,e.ej2Lists,e.ej2ExcelExport)}(this,function(e,B,M,k,R,p,H,P,j,N,L){"use strict";var q="cellClick",F="cellDoubleClick",U="moreEventsClick",G="select",X="hover",Q="actionBegin",K="actionComplete",Z="actionFailure",J="navigating",$="renderCell",ee="eventClick",te="eventDoubleClick",ie="eventRendered",ne="dataBinding",re="dataBound",ae="popupOpen",se="popupClose",oe="dragStart",le="drag",pe="dragStop",ce="resizeStart",he="resizing",de="resizeStop",ue="inlineClick",ge="cellSelect",me="virtualScrollStart",ve="virtualScrollStop",fe="noEvents",ye="agendaCells",Te="resourceHeader",we="dateHeader",De="beforePaste",be="beforePrint",Se="excelExport",Ce="tooltipOpen",Oe="print",Ee="data-ready",xe="events-loaded",Ve="content-ready",Ae="scroll",Ie="virtual-scroll",Me="scroll-ui-update",ke="ui-update",Re="document-click",He="document-paste",Pe="cell-mouse-down",W=864e5,je=6e4;function Ne(e,t,i){t=B.createElement("div",{className:t}).cloneNode();return t.style.visibility="hidden",t.style.position="absolute",e.appendChild(t),e=gt(t,i),B.remove(t),e}function Le(e,t,i){t=B.createElement("div",{className:t}).cloneNode();return t.style.visibility="hidden",t.style.position="absolute",e.appendChild(t),e=ut(t,i),B.remove(t),e}function qe(e){e=getComputedStyle(e);return window.WebKitCSSMatrix?new WebKitCSSMatrix(e.webkitTransform).m42:0}function Fe(e){e=getComputedStyle(e);return window.WebKitCSSMatrix?new WebKitCSSMatrix(e.webkitTransform).m41:0}function Ue(e,t){e=new Date(e.getTime());return t=(t-e.getDay()-7)%7,new Date(e.setDate(e.getDate()+(isNaN(t)?0:t)))}function Be(e,t){e=Ue(e,t),t=new Date(e.getFullYear(),e.getMonth(),e.getDate()+6);return new Date(t.getTime())}function We(e){return new Date(e.getFullYear(),e.getMonth(),1)}function ze(e){return new Date(e.getFullYear(),e.getMonth()+1,0)}function Ye(e){var t=new Date(e.getFullYear(),0,1).valueOf(),e=new Date(e.getFullYear(),e.getMonth(),e.getDate()).valueOf();return Math.ceil((e-t+W)/W/7)}function _e(e,t){return new Date(t.valueOf()-(t.valueOf()-e.valueOf())/2)}function Ge(e,t){var i=e.getTimezoneOffset(),t=new Date(e.getTime()+t),i=t.getTimezoneOffset()-i;return e.setTime(t.getTime()+i*je),e}function z(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function Xe(e){var t=new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0).getTimezoneOffset(),t=e.getTimezoneOffset()-t;return e.getTime()-new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0).getTime()-60*t*1e3}function Qe(e,t){return Math.ceil((t.getTime()-e.getTime())/W)}function Y(e,t){return e=new Date(""+e),new Date(e.setDate(e.getDate()+t))}function Ke(e,t){var i=(e=new Date(""+e)).getDate();return e.setDate(1),e.setMonth(e.getMonth()+t),e.setDate(Math.min(i,$e(e))),e}function Ze(e,t){var i=(e=new Date(""+e)).getDate();return e.setDate(1),e.setFullYear(e.getFullYear()+t),e.setDate(Math.min(i,$e(e))),e}function Je(e,t,i){var n=new Date(e.getTime()),t=(n.setHours(t.getHours()),n.setMinutes(t.getMinutes()),n.setSeconds(t.getSeconds()),new Date(e.getTime()));return 0===i.getHours()?t=Y(t,1):(t.setHours(i.getHours()),t.setMinutes(i.getMinutes()),t.setSeconds(i.getSeconds())),{startHour:n,endHour:t}}function $e(e){return ze(e).getDate()}function et(e,t){e=z(new Date(e)),t=z(new Date(t));return Math.round((t.getTime()-e.getTime())/W)}function tt(e){return-1!==e.indexOf("Date")?new Date(parseInt(e.match(/\d+/g).toString(),10)):-1!==e.indexOf("T")?new Date(e):new Date(e.replace(/-/g,"/"))}var it=null,nt=null;function rt(){if(null!==it)return it;null===nt&&(nt=window.devicePixelRatio||window.screen.availWidth/document.documentElement.clientWidth);var e=B.createElement("div"),t=(e.style.cssText="width:100px;height: 100px;overflow: scroll;position: absolute;top: -9999px;",document.body.appendChild(e),devicePixelRatio?"1.10"===devicePixelRatio.toFixed(2)||devicePixelRatio<=1?Math.ceil(devicePixelRatio%1):Math.floor(devicePixelRatio%1):0),t=e.offsetWidth-e.clientWidth-t|0;return document.body.removeChild(e),it=t}function at(){var e=window.devicePixelRatio||window.screen.availWidth/document.documentElement.clientWidth;nt&&nt!==e&&(it=null,nt=e)}function st(e,t,i,n,r){for(var a=0,s=e.length;a<s;a++)if(e[parseInt(a.toString(),10)][""+t]===i){if(!n)return a;var o=r.slice(-2)[0].field;if((n[""+o]instanceof Array?n[""+o]:[n[""+o]]).join(",").includes(e[parseInt(a.toString(),10)][r.slice(-1)[0].groupIDField]))return a}return-1}function ot(e){var t=getComputedStyle(e);return e.offsetHeight+(parseInt(t.marginTop,10)||0)+(parseInt(t.marginBottom,10)||0)}function lt(e){for(var t=0,i=[].slice.call(e.children);t<i.length;t++){var n=i[t];e.removeChild(n)}}function pt(e){var t=new Date(e.getFullYear(),0,1),i=new Date(e.getFullYear(),6,1);return e.getTimezoneOffset()<Math.max(t.getTimezoneOffset(),i.getTimezoneOffset())}function ct(e){var t=e.getFullYear(),i=e.getMonth(),n=e.getDate(),r=e.getHours(),a=e.getMinutes(),s=e.getSeconds(),e=e.getMilliseconds();return Date.UTC(t,i,n,r,a,s,e)}function ht(){return-1<window.navigator.userAgent.toLowerCase().indexOf("mobi")}function dt(){return-1<window.navigator.userAgent.toLowerCase().indexOf("ipad")}function y(e,t){return"multiple"===t?e=e.split(" ").map(function(e){return e.charAt(0).toLocaleUpperCase()+e.substring(1)}).join(" "):"single"===t&&("0"<=e[0]&&e[0]<="9"&&(t=e.match(/[a-zA-Z]/),e=B.isNullOrUndefined(t)?e:e.slice(0,t.index)+e[t.index].toLocaleUpperCase()+e.slice(t.index+1)),e=e[0].toLocaleUpperCase()+e.slice(1)),e}function ut(e,t){return t?e.offsetWidth:e.getBoundingClientRect().width}function gt(e,t){return t?e.offsetHeight:e.getBoundingClientRect().height}function mt(e,t){return t?e.offsetTop:e.getBoundingClientRect().top}var vt="e-schedule",ft="e-rtl",yt="e-device",Tt="e-adaptive",wt="e-multi-drag",Dt="e-icons",bt="e-enable",d="e-disable",St="e-table-container",Ct="e-schedule-table",w="e-all-day-cells",Ot="e-all-day-row",C="e-content-table",O="e-work-cells",Et="e-work-hours",xt="e-popup-open",Vt="e-date-header-wrap",At="e-date-header-container",It="e-header-cells",Mt="e-work-days",E="e-other-month",kt="e-current-day",Rt="e-current-date",Ht="e-current-panel",Pt="e-previous-panel",jt="e-next-panel",Nt="e-translate",Lt="e-left-indent",qt="e-left-indent-wrap",Ft="e-event-table",Ut="e-resource-group-cells",Bt="e-resource-text",Wt="e-resource-column-wrap",zt="e-resource-column-table",Yt="e-child-node",_t="e-parent-node",Gt="e-resource-expand",Xt="e-resource-collapse",Qt="e-resource-tree-icon",Kt="e-resource-cells",Zt="e-time-cells-wrap",Jt="e-time-cells",$t="e-time-slots",ei="e-alternate-cells",ti="e-current-time",ii="e-current-timeline",ni="e-previous-timeline",ri="e-hide-childs",ai="e-scroll-container",si="e-timeline-wrapper",x="e-appointment-wrapper",oi="e-appointment-wrapper-hidden",li="e-day-wrapper",pi="e-schedule-resource-toolbar-container",ci="e-schedule-toolbar",hi="e-schedule-resource-toolbar",di="e-selected-cell",ui="e-week-number-wrapper",gi="e-week-number",mi="e-appointment-wrap",vi="e-wrapper-container",fi="e-appointment-container",V="e-appointment",yi="e-block-appointment",Ti="e-block-indicator",wi="e-appointment-border",Di="e-appointment-details",bi="e-subject-wrap",Si="e-resource-name",Ci="e-time",Oi="e-table-wrap",Ei="e-outer-table",A="e-content-wrap",xi="e-virtual-track",Vi="e-agenda-cells",Ai="e-current-day",Ii="e-active-appointment-agenda",Mi="e-month-header",ki="e-day-date-header",Ri="e-date-column",Hi="e-navigate",Pi="e-date-header",ji="e-day-border",Ni="e-date-time",Li="e-no-event",qi="e-appointment-indicator",Fi="e-indicator",Ui="e-left-icon",Bi="e-right-icon",Wi="e-event-action",zi="e-new-event",Yi="e-schedule-event-clone",_i="e-clone-time-indicator",Gi="e-drag-clone",Xi="e-event-resize",Qi="e-resize-clone",Ki="e-left-handler",Zi="e-right-handler",Ji="e-top-handler",$i="e-bottom-handler",en="e-recurrence-icon",tn="e-recurrence-edit-icon",nn="e-header-row",rn="e-all-day-appointment-wrapper",an="e-all-day-appointment",sn="e-appointment-hide",on="e-row-count-wrapper",ln="e-all-day-appointment-section",pn="e-appointment-expand",cn="e-appointment-collapse",hn="e-more-indicator",dn="e-cell-popup",un="e-event-popup",gn="e-popup-header",mn="e-header-icon-wrapper",vn="e-popup-footer",fn="e-date-time-details",yn="e-event-details",Tn="e-event-create",wn="e-event-edit",Dn="e-event-delete",bn="e-text-ellipsis",Sn="e-more-popup-wrapper",Cn="e-more-event-popup",On="e-more-event-date-header",En="e-header-day",xn="e-header-date",Vn="e-more-event-close",An="e-more-event-content",In="e-more-appointment-wrapper",Mn="e-quick-dialog",kn="e-quick-dialog-occurrence-event",Rn="e-quick-dialog-series-event",Hn="e-quick-dialog-following-events",Pn="e-following-events-dialog",jn="e-quick-dialog-delete",Nn="e-quick-dialog-cancel",Ln="e-quick-alertok",qn="e-quick-alertcancel",Fn="e-quick-alertfollowing",Un="e-quick-dialog-alert-btn",Bn="e-schedule-dialog",Wn="e-schedule-form",zn="e-all-day",Yn="e-time-zone",_n="e-repeat",Gn="e-subject",Xn="e-location",Qn="e-location-details",Kn="e-start",Zn="e-end",Jn="e-description",$n="e-description-details",er="e-time-zone-row",tr="e-start-time-zone",ir="e-end-time-zone",nr="e-save-icon",rr="e-event-cancel",ar="e-event-save",sr="e-title-text",or="e-icon-disable",lr="e-edit",pr="e-edit-icon",cr="e-delete",hr="e-delete-icon",dr="e-close",ur="e-close-icon",gr="e-schedule-error",mr="e-tooltip-hidden",vr="e-animate",fr="e-hidden",yr="e-disable-dates",Tr="e-quick-popup-wrapper",wr="e-resource-menu",Dr="e-icon-menu",br="e-resource-level-title",Sr="e-resource-tree-popup-overlay",Cr="e-resource-tree-popup",Or="e-resource",Er="e-resource-icon",xr="e-resource-details",Vr="e-date-time-icon",Ar="e-virtual-scroll",Ir="e-icon-disable",Mr="e-auto-height",kr="e-ignore-whitespace",Rr="e-read-only",Hr="e-month-header-wrapper",Pr="e-inline-subject",jr="e-inline-appointment",Nr="e-inline-edit",Lr="e-scroll-hidden",qr="e-all-day-scroll",Fr="e-all-day-auto",Ur=function(){return(Ur=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},Br=(t.prototype.addEventListener=function(){this.parent.on(Re,this.closeHeaderPopup,this)},t.prototype.removeEventListener=function(){this.parent.off(Re,this.closeHeaderPopup)},t.prototype.closeHeaderPopup=function(e){var t,i=B.closest(e.event.target,".e-date-range,.e-header-popup,.e-day,.e-selected"),e=B.closest(e.event.target,".e-hor-nav,.e-toolbar-pop"),n=this.parent.element.querySelector("."+A),r=this.parent.element.querySelector(".e-toolbar-pop");this.parent.isAdaptive&&(B.isNullOrUndefined(e)||!e.classList.contains("e-toolbar-pop")&&!e.classList.contains("e-hor-nav")||e.classList.contains("e-hor-nav")&&r&&r.classList.contains(xt)?(B.removeClass([n],Lr),r=this.element.querySelector(".e-toolbar-pop"),B.isNullOrUndefined(r)||!(t=r.ej2_instances[0])||!B.isNullOrUndefined(e)&&e.classList.contains("e-hor-nav")&&r.classList.contains(xt)||t.hide()):B.addClass([n],Lr)),B.isNullOrUndefined(i)&&this.hideHeaderPopup()},t.prototype.hideHeaderPopup=function(){this.headerPopup&&this.headerPopup.hide()},t.prototype.renderHeader=function(){this.element=B.createElement("div",{className:"e-schedule-toolbar-container"});var e=B.createElement("div",{className:ci});this.element.appendChild(e),this.parent.element.insertBefore(this.element,this.parent.element.firstElementChild),this.renderToolbar()},t.prototype.renderToolbar=function(){var t=this,e=this.parent.toolbarItems&&0<this.parent.toolbarItems.length?this.getToolbarItems():this.getItems();this.parent.trigger(Q,{requestType:"toolbarItemRendering",items:e},function(e){t.toolbarObj=new k.Toolbar({items:e.items,overflowMode:"Popup",clicked:t.toolbarClickHandler.bind(t),created:t.toolbarCreateHandler.bind(t),enableRtl:t.parent.enableRtl,enableHtmlSanitizer:t.parent.enableHtmlSanitizer,locale:t.parent.locale}),t.toolbarObj.isStringTemplate=!0,t.toolbarObj.root=t.parent.root||t.parent,t.toolbarObj.appendTo(t.parent.element.querySelector("."+ci)),t.toolbarObj.element.setAttribute("aria-label","Scheduler");e=t.toolbarObj.element.querySelector(".e-prev"),e&&e.firstElementChild.setAttribute("title",t.l10n.getConstant("previous")),e=t.toolbarObj.element.querySelector(".e-next");e&&e.firstElementChild.setAttribute("title",t.l10n.getConstant("next")),t.updateAddIcon(),t.updateActiveView(),t.parent.trigger(K,{requestType:"toolBarItemRendered",items:t.toolbarObj.items})})},t.prototype.updateItems=function(){var e,t=this;this.toolbarObj&&(e=this.getItems(),this.parent.trigger(Q,{requestType:"toolbarItemRendering",items:e},function(e){t.toolbarObj.items=e.items,t.toolbarObj.dataBind(),t.parent.trigger(K,{requestType:"toolBarItemRendered",items:t.toolbarObj.items})}))},t.prototype.getPopUpRelativeElement=function(){return this.parent.isAdaptive?this.toolbarObj.element:this.element.querySelector(".e-date-range")},t.prototype.setDayOfWeek=function(e){this.headerCalendar&&(this.headerCalendar.firstDayOfWeek=e,this.headerCalendar.dataBind())},t.prototype.setCalendarDate=function(e){this.headerCalendar&&(this.headerCalendar.value=e,this.headerCalendar.dataBind())},t.prototype.setCalendarMinMaxDate=function(){this.headerCalendar&&(this.headerCalendar.min=this.parent.minDate,this.headerCalendar.max=this.parent.maxDate,this.headerCalendar.dataBind())},t.prototype.getCalendarView=function(){return-1<["Month","MonthAgenda","TimelineMonth"].indexOf(this.parent.currentView)?"Year":-1<["Year","TimelineYear"].indexOf(this.parent.currentView)?"Decade":"Month"},t.prototype.setCalendarView=function(){var e;this.headerCalendar&&(e=this.getCalendarView(),this.headerCalendar.depth=e,this.headerCalendar.start=e,this.headerCalendar.refresh())},t.prototype.updateActiveView=function(){var e=[].slice.call(this.toolbarObj.element.querySelectorAll(".e-views"));B.removeClass(e,["e-active-view"]),0<e.length&&e[this.parent.viewIndex]&&B.addClass([e[this.parent.viewIndex]],["e-active-view"])},t.prototype.updateDateRange=function(e){var t,i,n,r=this.toolbarObj.element.querySelector(".e-date-range");r&&(r.firstElementChild.setAttribute("aria-haspopup","true"),t=r.querySelector(".e-tbar-btn-text"),this.parent.activeViewOptions.dateRangeTemplate?(t.textContent="",i={startDate:this.parent.activeView.getStartDate(),endDate:this.parent.activeView.getEndDate(),currentView:this.parent.currentView},n=this.parent.activeViewOptions.dateRangeTemplateName,n=this.parent.element.id+"_"+n+"dateRangeTemplate",i=[].slice.call(this.parent.getDateRangeTemplate()(i,this.parent,"dateRangeTemplate",n,!1,void 0,void 0,this.parent.root)),B.append(i,t)):(n=this.parent.activeView.getDateRangeText(e),r.firstElementChild.setAttribute("aria-label",n),t.textContent=n),this.refresh())},t.prototype.refresh=function(){this.toolbarObj&&this.toolbarObj.refreshOverflow()},t.prototype.updateAddIcon=function(){var e=this.toolbarObj.element.querySelector(".e-add");e&&(this.parent.eventSettings.allowAdding?B.removeClass([e],fr):B.addClass([e],fr))},t.prototype.getDateRangeText=function(){return y(this.parent.globalize.formatDate(this.parent.selectedDate,{format:"MMMM y",calendar:this.parent.getCalendarMode()}),"single")},t.prototype.getItemModel=function(e){var t={};return e.id&&(t.id=e.id),e.text&&(t.text=e.text),e.tooltipText&&(t.tooltipText=e.tooltipText),e.prefixIcon&&(t.prefixIcon=e.prefixIcon),e.cssClass&&(t.cssClass=e.cssClass),"Both"!==e.showTextOn&&(t.showTextOn=e.showTextOn),e.template&&(t.template=e.template),e.disabled&&(t.disabled=e.disabled),"auto"!==e.width&&(t.width=e.width),e.suffixIcon&&(t.suffixIcon=e.suffixIcon),"Left"!==e.align&&(t.align=e.align),"None"!==e.overflow&&(t.overflow=e.overflow),e.htmlAttributes&&(t.htmlAttributes=e.htmlAttributes),"Button"!==e.type&&(t.type=e.type),!0!==e.visible&&(t.visible=e.visible),e.showAlwaysInPopup&&(t.showAlwaysInPopup=e.showAlwaysInPopup),-1!==e.tabIndex&&(t.tabIndex=e.tabIndex),t},t.prototype.getToolbarItems=function(){for(var e=[],t=0,i=this.parent.toolbarItems;t<i.length;t++){var n=i[t],r=this.getItemModel(n),a=void 0;if(n.name)switch(n.name){case"Today":(a={showAlwaysInPopup:this.parent.isAdaptive||this.parent.enableAdaptiveUI,prefixIcon:"e-icon-today",text:this.l10n.getConstant("today"),cssClass:"e-today",overflow:"Show"}).align=r.align||n.align,e.push(Ur({},a,r));break;case"Previous":(a={prefixIcon:"e-icon-prev",tooltipText:"Previous",overflow:"Show",cssClass:"e-prev",htmlAttributes:{role:"navigation"}}).align=r.align||n.align,e.push(Ur({},a,r));break;case"Next":(a={prefixIcon:"e-icon-next",tooltipText:"Next",overflow:"Show",cssClass:"e-next",htmlAttributes:{role:"navigation"}}).align=r.align||n.align,e.push(Ur({},a,r));break;case"DateRangeText":(a={text:this.getDateRangeText(),suffixIcon:"e-icon-down-arrow",cssClass:"e-date-range",overflow:"Show",htmlAttributes:{"aria-atomic":"true","aria-live":"assertive",role:"navigation"}}).align=r.align||n.align,e.push(Ur({},a,r));break;case"NewEvent":(a={showAlwaysInPopup:this.parent.isAdaptive||this.parent.enableAdaptiveUI,prefixIcon:"e-icon-add",text:this.l10n.getConstant("newEvent"),cssClass:"e-add",overflow:"Show"}).align=r.align||n.align,e.push(Ur({},a,r));break;case"Views":if(!B.isNullOrUndefined(this.parent.views)&&1<this.parent.views.length)for(var s=0,o=this.parent.views;s<o.length;s++){var l=o[s];(a=this.getItemObject(l)).align=r.align||n.align,e.push(Ur({},a,r))}break;case"Custom":e.push(n)}else e.push(n)}return e},t.prototype.getItems=function(){var e=[];if(e.push({align:"Left",prefixIcon:"e-icon-prev",tooltipText:"Previous",overflow:"Show",cssClass:"e-prev"}),e.push({align:"Left",prefixIcon:"e-icon-next",tooltipText:"Next",overflow:"Show",cssClass:"e-next"}),e.push({align:"Left",text:this.getDateRangeText(),suffixIcon:"e-icon-down-arrow",cssClass:"e-date-range",overflow:"Show",htmlAttributes:{"aria-atomic":"true","aria-live":"assertive"}}),this.parent.isAdaptive||this.parent.enableAdaptiveUI?(e.push({align:"Right",showAlwaysInPopup:this.parent.isAdaptive||this.parent.enableAdaptiveUI,prefixIcon:"e-icon-add",text:this.l10n.getConstant("newEvent"),cssClass:"e-add",overflow:"Show"}),e.push({align:"Right",showAlwaysInPopup:this.parent.isAdaptive||this.parent.enableAdaptiveUI,prefixIcon:"e-icon-today",text:this.l10n.getConstant("today"),cssClass:"e-today",overflow:"Show"})):(e.push({align:"Right",showAlwaysInPopup:this.parent.isAdaptive||this.parent.enableAdaptiveUI,prefixIcon:"e-icon-today",text:this.l10n.getConstant("today"),cssClass:"e-today",overflow:"Show"}),!B.isNullOrUndefined(this.parent.views)&&1<this.parent.views.length&&e.push({align:"Right",type:"Separator",cssClass:"e-schedule-seperator"})),!B.isNullOrUndefined(this.parent.views)&&1<this.parent.views.length)for(var t=0,i=this.parent.views;t<i.length;t++){var n=i[t];e.push(this.getItemObject(n))}return e},t.prototype.getItemObject=function(e){var t,i,n="string"==typeof e?(t=e.toLowerCase(),null):(t=e.option.toLowerCase(),e.displayName),r=this.parent.isAdaptive||this.parent.enableAdaptiveUI;switch(t){case"day":i={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-day",text:n||this.l10n.getConstant("day"),cssClass:"e-views e-day"};break;case"week":i={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-week",text:n||this.l10n.getConstant("week"),cssClass:"e-views e-week"};break;case"workweek":i={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-workweek",text:n||this.l10n.getConstant("workWeek"),cssClass:"e-views e-work-week"};break;case"month":i={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-month",text:n||this.l10n.getConstant("month"),cssClass:"e-views e-month"};break;case"year":i={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-year",text:n||this.l10n.getConstant("year"),cssClass:"e-views e-year"};break;case"agenda":i={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-agenda",text:n||this.l10n.getConstant("agenda"),cssClass:"e-views e-agenda"};break;case"monthagenda":i={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-month-agenda",text:n||this.l10n.getConstant("monthAgenda"),cssClass:"e-views e-month-agenda"};break;case"timelineday":i={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-timeline-day",text:n||this.l10n.getConstant("timelineDay"),cssClass:"e-views e-timeline-day"};break;case"timelineweek":i={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-timeline-week",text:n||this.l10n.getConstant("timelineWeek"),cssClass:"e-views e-timeline-week"};break;case"timelineworkweek":i={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-timeline-workweek",text:n||this.l10n.getConstant("timelineWorkWeek"),cssClass:"e-views e-timeline-work-week"};break;case"timelinemonth":i={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-timeline-month",text:n||this.l10n.getConstant("timelineMonth"),cssClass:"e-views e-timeline-month"};break;case"timelineyear":i={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-timeline-year-"+("Vertical"===e.orientation?"vertical":"horizontal"),text:n||this.l10n.getConstant("timelineYear"),cssClass:"e-views e-timeline-year"}}return i},t.prototype.renderHeaderPopup=function(){var e=B.createElement("div",{className:"e-header-popup"}),t=B.createElement("div",{className:"e-header-calendar"}),e=(e.appendChild(t),this.element.appendChild(e),this.headerPopup=new M.Popup(e,{actionOnScroll:"hide",targetType:"relative",relateTo:this.getPopUpRelativeElement(),position:{X:"left",Y:"bottom"},collision:{X:"fit"},viewPortElement:this.element,enableRtl:this.parent.enableRtl}),this.getCalendarView()),i="Month"===this.parent.currentView&&!B.isNullOrUndefined(this.parent.activeViewOptions.displayDate)&&!this.hasSelectedDate();this.headerCalendar=new R.Calendar({value:i?this.parent.activeViewOptions.displayDate:this.parent.selectedDate,min:this.parent.minDate,max:this.parent.maxDate,firstDayOfWeek:this.parent.activeViewOptions.firstDayOfWeek,weekNumber:this.parent.activeViewOptions.showWeekNumber,enableRtl:this.parent.enableRtl,locale:this.parent.locale,depth:e,start:e,calendarMode:this.parent.calendarMode,change:this.calendarChange.bind(this)}),this.setCalendarTimezone(),this.headerCalendar.appendTo(t),this.headerPopup.hide()},t.prototype.calendarChange=function(e){e.value.getTime()!==this.parent.selectedDate.getTime()&&(e=z(new Date(e.value)),this.parent.changeDate(e)),this.headerPopup.hide()},t.prototype.setCalendarTimezone=function(){this.headerCalendar&&(this.headerCalendar.timezone=this.parent.timezone||this.parent.tzModule.getLocalTimezoneName())},t.prototype.calculateViewIndex=function(e){e=B.closest(e.originalEvent.target,".e-views");return[].slice.call(this.element.querySelectorAll(".e-views")).indexOf(e)},t.prototype.toolbarCreateHandler=function(){this.parent&&this.parent.portals&&this.toolbarObj&&this.toolbarObj.portals&&(this.parent.portals=this.parent.portals.concat(this.toolbarObj.portals),this.parent.renderReactTemplates())},t.prototype.toolbarClickHandler=function(e){if(e.item){var t;switch(e.item.cssClass.replace("e-views ","")){case"e-date-range":this.headerPopup||this.renderHeaderPopup(),this.headerPopup.element.classList.contains(xt)?this.headerPopup.hide():this.headerPopup.show();break;case"e-day":this.parent.changeView("Day",e.originalEvent,void 0,this.calculateViewIndex(e));break;case"e-week":this.parent.changeView("Week",e.originalEvent,void 0,this.calculateViewIndex(e));break;case"e-work-week":this.parent.changeView("WorkWeek",e.originalEvent,void 0,this.calculateViewIndex(e));break;case"e-month":this.parent.changeView("Month",e.originalEvent,void 0,this.calculateViewIndex(e));break;case"e-year":this.parent.changeView("Year",e.originalEvent,void 0,this.calculateViewIndex(e));break;case"e-agenda":this.parent.changeView("Agenda",e.originalEvent,void 0,this.calculateViewIndex(e));break;case"e-month-agenda":this.parent.changeView("MonthAgenda",e.originalEvent,void 0,this.calculateViewIndex(e));break;case"e-timeline-day":this.parent.changeView("TimelineDay",e.originalEvent,void 0,this.calculateViewIndex(e));break;case"e-timeline-week":this.parent.changeView("TimelineWeek",e.originalEvent,void 0,this.calculateViewIndex(e));break;case"e-timeline-work-week":this.parent.changeView("TimelineWorkWeek",e.originalEvent,void 0,this.calculateViewIndex(e));break;case"e-timeline-month":this.parent.changeView("TimelineMonth",e.originalEvent,void 0,this.calculateViewIndex(e));break;case"e-timeline-year":this.parent.changeView("TimelineYear",e.originalEvent,void 0,this.calculateViewIndex(e));break;case"e-today":r=z(this.parent.getCurrentTime()),("Agenda"===this.parent.currentView||"MonthAgenda"===this.parent.currentView||!this.parent.isSelectedDate(r)||"Month"===this.parent.currentView&&this.parent.activeViewOptions.displayDate&&!this.hasSelectedDate()&&z(this.parent.activeViewOptions.displayDate)!==r||"Month"===this.parent.currentView&&0<this.parent.activeViewOptions.numberOfWeeks&&!this.hasSelectedDate()&&z(We(this.parent.selectedDate))!==r)&&this.parent.changeDate(r,e.originalEvent);break;case"e-prev":this.parent.changeDate(this.parent.activeView.getNextPreviousDate("Previous"),e.originalEvent);break;case"e-next":this.parent.changeDate(this.parent.activeView.getNextPreviousDate("Next"),e.originalEvent);break;case"e-add":var i,n,r=this.parent.activeCellsData.startTime.getTime()===this.parent.activeCellsData.endTime.getTime();r=this.parent.activeCellsData&&!r?this.parent.activeCellsData:(r=this.parent.activeViewOptions.timeScale.interval,i=this.parent.activeViewOptions.timeScale.slotCount,r=r*je/i,i=new Date(this.parent.selectedDate.getTime()),n=this.parent.getCurrentTime(),i.setHours(n.getHours(),Math.round(i.getMinutes()/r)*r,0),n=new Date(new Date(i.getTime()).setMilliseconds(i.getMilliseconds()+r)),{startTime:i,endTime:n,isAllDay:!1}),this.parent.eventWindow.openEditor(B.extend(r,{cancel:!1,event:e.originalEvent}),"Add")}B.isNullOrUndefined(this.toolbarObj)||(t=this.toolbarObj.element.querySelector(".e-toolbar-pop"))&&"Input"!==e.item.type&&t.ej2_instances[0].hide({name:"SlideUp",duration:100})}},t.prototype.hasSelectedDate=function(){var e=z(this.parent.selectedDate).getTime();return e>=this.parent.activeView.getStartDate().getTime()&&e<=this.parent.activeView.getEndDate().getTime()},t.prototype.getHeaderElement=function(){return this.toolbarObj.element},t.prototype.updateHeaderItems=function(e){var t=this.toolbarObj.element.querySelector(".e-prev"),i=this.toolbarObj.element.querySelector(".e-next"),n=this.toolbarObj.element.querySelector(".e-date-range");t&&("add"===e?B.addClass([t],fr):B.removeClass([t],fr)),i&&("add"===e?B.addClass([i],fr):B.removeClass([i],fr)),n&&("add"===e?B.addClass([n],bn):B.removeClass([n],bn))},t.prototype.previousNextIconHandler=function(){var e,t="Agenda"===this.parent.currentView?[this.parent.getCurrentViewDates()[0]]:this.parent.getCurrentViewDates(),i=this.toolbarObj.element.querySelector(".e-prev"),n=this.toolbarObj.element.querySelector(".e-next"),r=new Date(t[0].getTime()),t=new Date(t[t.length-1].getTime());"WorkWeek"===this.parent.currentView||"TimelineWorkWeek"===this.parent.currentView?t=Y(r=Ue(z(this.parent.selectedDate),this.parent.activeViewOptions.firstDayOfWeek),7*this.parent.activeViewOptions.interval):"Month"===this.parent.currentView&&(r=(e=!B.isNullOrUndefined(this.parent.activeViewOptions.displayDate)||0<this.parent.activeViewOptions.numberOfWeeks)?this.parent.activeView.getStartDate():We(this.parent.selectedDate),t=e?this.parent.activeView.getEndDate():ze(Ke(r,this.parent.activeViewOptions.interval-1))),B.isNullOrUndefined(i)||this.toolbarObj.enableItems(i,r>z(this.parent.minDate)),B.isNullOrUndefined(n)||this.toolbarObj.enableItems(n,t<z(this.parent.maxDate)),this.setCalendarMinMaxDate()},t.prototype.getModuleName=function(){return"headerbar"},t.prototype.destroy=function(){this.headerPopup&&!this.headerPopup.isDestroyed&&(this.headerPopup.destroy(),this.headerPopup=null),this.headerCalendar&&!this.headerCalendar.isDestroyed&&(this.headerCalendar.destroy(),this.headerCalendar=null),this.toolbarObj&&!this.toolbarObj.isDestroyed&&(this.toolbarObj.destroy(),this.removeEventListener(),B.remove(this.element),this.toolbarObj=null),this.element=null,this.parent=null,this.l10n=null},t);function t(e){this.parent=e,this.l10n=this.parent.localeObj,this.renderHeader(),this.addEventListener()}zr.prototype.getModuleName=function(){return"scroll"},zr.prototype.setWidth=function(){this.parent.element.style.width=B.formatUnit(this.parent.width)},zr.prototype.setHeight=function(){this.parent.element.style.height=B.formatUnit(this.parent.height)},zr.prototype.addEventListener=function(){this.parent.on(Ve,this.setDimensions,this),this.parent.on(ke,this.onPropertyChanged,this)},zr.prototype.removeEventListener=function(){this.parent.off(Ve,this.setDimensions),this.parent.off(ke,this.onPropertyChanged)},zr.prototype.setDimensions=function(){this.setWidth(),this.setHeight();var e={cssProperties:this.parent.getCssProperties(),module:this.getModuleName()};this.parent.notify(Me,e)},zr.prototype.onPropertyChanged=function(){this.setDimensions()},zr.prototype.destroy=function(){this.removeEventListener()};var Wr=zr;function zr(e){this.parent=e,this.addEventListener()}_r.prototype.scrollHandler=function(e){B.isNullOrUndefined(this.parent.eventTooltip)||this.parent.eventTooltip.close();var t,i=!this.parent.isAdaptive&&e.originalEvent&&e.originalEvent.target&&!B.isNullOrUndefined(B.closest(e.originalEvent.target,"."+V));if(this.parent.uiStateValues.isTouchScroll=i&&"touchmove"===e.originalEvent.type&&!this.parent.uiStateValues.action,!i&&"Agenda"!==this.parent.currentView&&!this.parent.uiStateValues.action&&this.parent.allowSwiping&&!this.parent.uiStateValues.isTapHold){if(this.parent.uiStateValues.isSwipeScroll=!0,this.timeStampStart||(this.timeStampStart=Date.now()),this.element.classList.contains(Nt)&&this.onTransitionEnd(),"Left"===e.scrollDirection||"Right"===e.scrollDirection){var i={requestType:"dateNavigate",cancel:!1,event:e.originalEvent};if(this.parent.trigger(Q,i),i.cancel)return;i=this.element.querySelector("."+A);if(i&&i.scrollWidth>i.clientWidth)return;this.isScrollTriggered=!0,e.originalEvent.preventDefault(),e.originalEvent.stopPropagation()}e.scrollDirection===this.touchLeftDirection?(this.nextPanel||(this.renderPanel(jt,"Next"),this.nextPanel={element:this.parent.activeView.getPanel(),selectedDate:new Date(this.parent.selectedDate.getTime()),renderDates:this.parent.activeView.renderDates,colLevels:this.parent.activeView.colLevels},this.setDimensions(this.nextPanel.element)),t=this.parent.enableRtl?e.distanceX:-e.distanceX,this.element.style.transform="translatex("+(this.getTranslateX(this.element)+t)+"px)"):e.scrollDirection===this.touchRightDirection&&(i=0,this.previousPanel||(this.renderPanel(Pt,"Previous"),this.previousPanel={element:this.parent.activeView.getPanel(),selectedDate:new Date(this.parent.selectedDate.getTime()),renderDates:this.parent.activeView.renderDates,colLevels:this.parent.activeView.colLevels},this.setDimensions(this.previousPanel.element),i=this.previousPanel.element.offsetWidth),t=this.parent.enableRtl?i-e.distanceX:-i+e.distanceX,this.element.style.transform="translatex("+(this.getTranslateX(this.element)+t)+"px)")}},_r.prototype.swipeHandler=function(e){var t,i;this.isScrollTriggered&&!this.parent.uiStateValues.action&&this.parent.allowSwiping&&!this.parent.uiStateValues.isTapHold&&(this.isScrollTriggered=!1,t=("Left"===e.swipeDirection?this.parent.activeView.renderDates:this.parent.activeView.renderDates.slice(-1))[0],"Left"===e.swipeDirection&&t<this.parent.maxDate||"Right"===e.swipeDirection&&t>=this.parent.minDate?((t=Date.now()-this.timeStampStart)<(i=e.distanceX*(B.Browser.isDevice?6:1.66))||e.distanceX>this.parent.element.offsetWidth/2?(this.swapPanels(e.swipeDirection),t<i&&e.distanceX>this.parent.element.offsetWidth/2&&(this.element.style.transitionDuration=(B.Browser.isDevice?e.distanceX:i)/t/10+"s"),this.confirmSwipe(e.swipeDirection)):this.cancelSwipe(),i={requestType:"dateNavigate",cancel:!1,event:e.originalEvent},this.parent.trigger(K,i)):this.cancelSwipe(),this.timeStampStart=null)},_r.prototype.tapHoldHandler=function(e){var t=B.closest(e.originalEvent.target,"."+V);B.isNullOrUndefined(t)||(this.parent.uiStateValues.isTapHold=!0,this.parent.isAdaptive?(B.Browser.isIos&&B.EventHandler.add(this.element,"touchend",this.preventEventClick,this),this.parent.quickPopup.tapHoldEventPopup(e.originalEvent),this.triggerResizeStart(e.originalEvent)):["Agenda","MonthAgenda","Year"].indexOf(this.parent.currentView)<0&&(this.parent.selectedElements=[],this.parent.eventBase.getSelectedEventElements(t),this.triggerResizeStart(e.originalEvent)))},_r.prototype.triggerResizeStart=function(e){this.parent.resizeModule&&B.closest(e.target,"."+Xi)&&this.parent.resizeModule.resizeStart(e)},_r.prototype.preventEventClick=function(e){e.preventDefault(),B.EventHandler.remove(this.element,"touchend",this.preventEventClick)},_r.prototype.renderPanel=function(e,t){this.currentPanel?this.parent.setProperties({selectedDate:this.currentPanel.selectedDate},!0):(this.currentPanel={element:this.parent.activeView.getPanel(),selectedDate:new Date(this.parent.selectedDate.getTime()),renderDates:this.parent.activeView.renderDates,colLevels:this.parent.activeView.colLevels},this.setDimensions(this.currentPanel.element)),this.parent.setProperties({selectedDate:this.parent.activeView.getNextPreviousDate(t)},!0),this.parent.headerModule&&this.parent.headerModule.setCalendarDate(this.parent.selectedDate),this.parent.activeView.getRenderDates(),this.parent.activeView.renderLayout(e)},_r.prototype.swapPanels=function(e){var t;e===this.touchLeftDirection?(t=this.nextPanel,this.nextPanel=this.currentPanel):(t=this.previousPanel,this.previousPanel=this.currentPanel),this.currentPanel=t},_r.prototype.confirmSwipe=function(t){var i=this,e={action:"date",cancel:!1,previousDate:(t===this.touchLeftDirection?this.nextPanel:this.previousPanel).selectedDate,currentDate:this.currentPanel.selectedDate};this.parent.trigger(J,e,function(e){e.cancel?(i.swapPanels(t),i.cancelSwipe()):(i.parent.activeView.setPanel(i.currentPanel.element),i.parent.setProperties({selectedDate:i.currentPanel.selectedDate},!0),e=void 0,e=i.parent.enableRtl?t===i.touchLeftDirection?i.previousPanel?i.previousPanel.element.offsetLeft:i.currentPanel.element.offsetWidth:0:t===i.touchLeftDirection?-i.currentPanel.element.offsetLeft:0,i.parent.activeView.renderDates=i.currentPanel.renderDates,i.parent.activeView.colLevels=i.currentPanel.colLevels,B.addClass([i.element],Nt),i.element.style.transform="translatex("+e+"px)",i.parent.headerModule&&i.parent.headerModule.updateDateRange(),i.parent.renderTemplates(),i.parent.crudModule.refreshDataManager())})},_r.prototype.cancelSwipe=function(){var i,n=this,e=(this.parent.activeView.setPanel(this.currentPanel.element),this.parent.setProperties({selectedDate:this.currentPanel.selectedDate},!0),this.parent.activeView.renderDates=this.currentPanel.renderDates,0<this.parent.activeViewOptions.group.resources.length&&0<this.parent.resourceBase.lastResourceLevel.length&&(i=this.parent.resourceBase.resourceCollection[0].workDaysField,this.parent.resourceBase.lastResourceLevel.forEach(function(e){var t;i?(t=e[i],t=Array.isArray(t)&&(!n.parent.showWeekend||"WorkWeek"===n.parent.currentView),e.renderDates=t?n.calculateResourceSpecificDates(e,i):n.currentPanel.renderDates):e.renderDates=n.currentPanel.renderDates})),this.parent.activeView.colLevels=this.currentPanel.colLevels,B.addClass([this.element],Nt),this.previousPanel?this.previousPanel.element.offsetWidth:0);this.element.style.transform="translatex("+(this.parent.enableRtl?e:-this.currentPanel.element.offsetLeft)+"px)"},_r.prototype.calculateResourceSpecificDates=function(e,t){var i=[],n=e[t];return this.currentPanel.renderDates.forEach(function(e){Array.isArray(n)&&-1!==n.indexOf(e.getDay())&&i.push(e)}),i},_r.prototype.onTransitionEnd=function(){(B.isNullOrUndefined(this.element)||this.element.classList.contains(Nt))&&(this.parent.uiStateValues.isSwipeScroll=!1,B.removeClass([this.element],Nt),this.element.style.transitionDuration="",this.element.style.transform="",this.previousPanel&&(B.remove(this.previousPanel.element),this.previousPanel=null,B.removeClass([this.currentPanel.element],Pt),B.addClass([this.currentPanel.element],Ht)),this.nextPanel&&(B.remove(this.nextPanel.element),this.nextPanel=null,B.removeClass([this.currentPanel.element],jt),B.addClass([this.currentPanel.element],Ht)),this.currentPanel=null,this.parent.activeView.getPanel().style.width="")},_r.prototype.getTranslateX=function(e){e=window.getComputedStyle(e);return new WebKitCSSMatrix(e.webkitTransform).m41},_r.prototype.setDimensions=function(e){e.style.width=this.parent.element.clientWidth+"px"},_r.prototype.resetValues=function(){this.currentPanel=null,this.previousPanel=null,this.nextPanel=null,this.timeStampStart=null,this.element.style.transform="",this.element.style.transitionDuration="",lt(this.element),B.removeClass([this.element],Nt)},_r.prototype.destroy=function(){this.touchObj&&(this.touchObj.destroy(),this.touchObj=null),B.EventHandler.remove(this.element,"transitionend",this.onTransitionEnd),this.resetValues()};var Yr=_r;function _r(e){this.parent=e,this.element=this.parent.element.querySelector("."+St),this.touchObj=new B.Touch(this.element,{scroll:this.scrollHandler.bind(this),swipe:this.swipeHandler.bind(this),tapHold:this.tapHoldHandler.bind(this),swipeSettings:{swipeThresholdDistance:1}}),B.EventHandler.add(this.element,"transitionend",this.onTransitionEnd,this),this.touchLeftDirection=this.parent.enableRtl?"Right":"Left",this.touchRightDirection=this.parent.enableRtl?"Left":"Right"}var Gr=function(){return(Gr=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},Xr=(i.prototype.keyActionHandler=function(e){var t=e.target;if(!("home"===e.action&&t&&-1<["INPUT","TEXTAREA","SELECT"].indexOf(t.tagName)&&t.closest(".e-quick-popup-wrapper")))switch(e.action){case"downArrow":case"shiftDownArrow":this.processDown(e,e.shiftKey);break;case"upArrow":case"shiftUpArrow":this.processUp(e,e.shiftKey);break;case"leftArrow":case"shiftLeftArrow":this.processLeft(e,e.shiftKey);break;case"rightArrow":case"shiftRightArrow":this.processRight(e,e.shiftKey);break;case"ctrlLeftArrow":this.parent.changeDate(this.parent.activeView.getNextPreviousDate("Previous"),e),this.parent.headerModule&&this.parent.headerModule.element.querySelector(".e-prev button").focus();break;case"ctrlRightArrow":this.parent.changeDate(this.parent.activeView.getNextPreviousDate("Next"),e),this.parent.headerModule&&this.parent.headerModule.element.querySelector(".e-next button").focus();break;case"altOne":case"altTwo":case"altThree":case"altFour":case"altFive":case"altSix":case"altSeven":case"altEight":case"altNine":this.processViewNavigation(e);break;case"enter":this.processEnter(e);break;case"home":this.focusFirstCell();break;case"tab":case"shiftTab":this.processTab(e,e.shiftKey);break;case"delete":case"backspace":this.processDelete(e);break;case"ctrlShiftUpArrow":case"ctrlShiftDownArrow":case"ctrlShiftLeftArrow":case"ctrlShiftRightArrow":this.processCtrlShiftNavigationArrows(e);break;case"escape":this.processEscape(e);break;case"fTwelve":this.parent.allowInline&&this.parent.inlineModule&&(e.preventDefault(),this.processFTwelve(e));break;case"shiftAltY":this.parent.changeDate(new Date,e);break;case"shiftAltN":"Agenda"!==this.parent.currentView&&"MonthAgenda"!==this.parent.currentView&&"Year"!==this.parent.currentView&&this.processShiftAltN(e);break;case"cut":case"cmdCut":(e.ctrlKey||e.metaKey)&&this.processClipboardAction(!0,void 0,e);break;case"copy":case"cmdCopy":(e.ctrlKey||e.metaKey)&&this.processClipboardAction(!1,void 0,e)}},i.prototype.processShiftAltN=function(e){var t=this.parent.getSelectedCells(),i=e.target,n=B.extend({},null,!0),i=(0<t.length&&(B.closest(i,"."+O)||B.closest(i,"."+w)||B.closest(i,"."+It))?n=this.getSelectedElements(i):B.closest(i,"."+V)&&!B.isNullOrUndefined(this.parent.activeEventData.event)?(t=this.parent.activeEventData.event,n.startTime=t.StartTime,n.endTime=t.EndTime,n.isAllDay=t.IsAllDay):(i=this.parent.getStartEndTime(this.parent.workHours.start),t=this.parent.activeViewOptions.timeScale.interval/this.parent.activeViewOptions.timeScale.slotCount,n.startTime=new Date(this.parent.selectedDate),n.startTime.setHours(i.getHours(),i.getMinutes(),0,0),n.endTime=new Date(n.startTime.getTime()+6e4*t)),B.extend(n,{cancel:!1,event:e}));null!=i&&this.parent.eventWindow.openEditor(i,"Add")},i.prototype.processFTwelve=function(e){var t=e.target;(t.classList.contains(O)||t.classList.contains(w))&&(this.parent.activeCellsData=this.getSelectedElements(t),e={element:(e=B.extend(this.parent.activeCellsData,{cancel:!1,event:e})).element,groupIndex:e.groupIndex,type:"Cell"},this.parent.notify(ue,e)),t.classList.contains(V)&&t.click()},i.prototype.addEventListener=function(){this.parent.on(Pe,this.onCellMouseDown,this),this.parent.allowClipboard&&this.parent.on(He,this.pasteHandler,this)},i.prototype.removeEventListener=function(){this.parent.off(Pe,this.onCellMouseDown),this.parent.off(He,this.pasteHandler)},i.prototype.onCellMouseDown=function(e){e.event.shiftKey||(this.initialTarget=this.getClosestCell(e.event),!this.parent.activeViewOptions.readonly&&"MonthAgenda"!==this.parent.currentView&&this.initialTarget&&(e.event.target.classList.contains(O)&&3!==e.event.which&&(this.parent.removeSelectedClass(),B.EventHandler.add(this.parent.getContentTable(),"mousemove",this.onMouseSelection,this),B.EventHandler.add(this.parent.getContentTable(),"mouseup mouseleave",this.onMoveUp,this)),e.event.target.classList.contains(w))&&3!==e.event.which&&(this.parent.removeSelectedClass(),e=this.parent.getAllDayRow(),B.EventHandler.add(e,"mousemove",this.onMouseSelection,this),B.EventHandler.add(e,"mouseup mouseleave",this.onMoveUp,this)))},i.prototype.onMouseSelection=function(e){var t,i,n=[].slice.call(this.parent.element.querySelectorAll("."+V)),n=(B.addClass(n,"e-allow-select"),this.parent.boundaryValidation(e.pageY,e.pageX)),r=((n.bottom||n.top||n.left||n.right)&&(r=(t=this.parent.element.querySelector("."+A)).offsetHeight<=t.scrollHeight&&0<=t.scrollTop&&t.scrollTop+t.offsetHeight<=t.scrollHeight,i=t.offsetWidth<=t.scrollWidth&&0<=t.scrollLeft&&t.scrollLeft+t.offsetWidth<=t.scrollWidth,r&&(n.top||n.bottom)&&(t.scrollTop+=n.top?-e.target.offsetHeight:e.target.offsetHeight),i)&&(n.left||n.right)&&(t.scrollLeft+=n.left?-e.target.offsetWidth:e.target.offsetWidth),this.getClosestCell(e));r&&this.selectCells(!0,r)},i.prototype.getClosestCell=function(e){return B.closest(e.target,"."+O+",."+w)},i.prototype.onMoveUp=function(t){var i,n=this,e=[].slice.call(this.parent.element.querySelectorAll("."+V));B.removeClass(e,"e-allow-select"),B.EventHandler.remove(this.parent.getContentTable(),"mousemove",this.onMouseSelection),B.EventHandler.remove(this.parent.getContentTable(),"mouseup mouseleave",this.onMoveUp),t.target.classList.contains(w)&&(e=this.parent.getAllDayRow(),B.EventHandler.remove(e,"mousemove",this.onMouseSelection),B.EventHandler.remove(e,"mouseup mouseleave",this.onMoveUp)),this.isPreventAction(t)||(e=B.closest(t.target,".e-work-cells,.e-all-day-cells,.e-header-cells"))&&(0<(i=this.parent.getSelectedCells()).length&&-1===i.indexOf(e)&&(e=i[i.length-1]),"TimelineYear"===this.parent.currentView&&e.classList.contains(E)||(this.parent.activeCellsData=this.getSelectedElements(e),e={},this.parent.eventWindow&&this.parent.eventWindow.convertToEventData(this.parent.activeCellsData,e),e={data:e,element:this.parent.activeCellsData.element,event:t,requestType:ge,showQuickPopup:!1},this.parent.trigger(G,e,function(e){(e.showQuickPopup||n.parent.quickInfoOnSelectionEnd)&&1<i.length&&(e=B.extend(n.parent.activeCellsData,{cancel:!1,event:t,name:"cellClick"}),n.parent.notify(q,e))})))},i.prototype.processEnter=function(e){var t,i,n;this.parent.activeViewOptions.readonly&&!e.target.classList.contains(V)||this.isPreventAction(e)||"TimelineYear"===this.parent.currentView&&e.target.classList.contains(E)||(t=e.target,B.closest(t,"."+Tr)?t.classList.contains(yn)||t.classList.contains(Tn)||t.classList.contains(wn)||t.classList.contains(Dn)||t.classList.contains(dr)?(t.click(),e.preventDefault()):t.classList.contains(Gn)&&(this.parent.element.querySelector("."+Tn).click(),e.preventDefault()):t.classList.contains(Kt)&&t.classList.contains(_t)?(i=t.querySelector("."+Qt))&&i.click():t.classList.contains(O)||t.classList.contains(w)?(this.parent.activeCellsData=this.getSelectedElements(t),i=B.extend(this.parent.activeCellsData,{cancel:!1,event:e}),this.parent.allowInline?(n={element:i.element,groupIndex:i.groupIndex,type:"Cell"},this.parent.notify(ue,n)):"Year"===this.parent.currentView?t.click():this.parent.notify(q,i)):t.classList.contains(Pr)&&this.parent.inlineModule?this.parent.inlineModule.inlineCrudActions(t):t.classList.contains(V)||t.classList.contains(Vn)||t.classList.contains(ln)||t.classList.contains(hn)?t.click():t.classList.contains(xn)&&(this.parent.setProperties({selectedDate:this.parent.getDateFromElement(t)},!0),this.parent.changeView(this.parent.getNavigateView(),e),this.processEscape(e)))},i.prototype.getSelectedElements=function(e){var t,i=1<this.selectedCells.length&&e.classList.contains(di)?(t=this.parent.getCellDetails(this.selectedCells[0]),i=this.parent.getCellDetails(this.selectedCells.slice(-1)[0]),t.endTime=i.endTime,t.element=e,t):this.parent.getCellDetails(e);return i},i.prototype.getCells=function(e,t,i){var n=this.parent.getContentTable(),r="TimelineYear"===this.parent.currentView,a=[].slice.call(n.querySelectorAll(r&&!e?"."+O+":not(."+E+")":"td")),s=n.rows.length,o=n.rows[0].cells.length,n=(t&&t.classList.contains(w)&&(n=this.parent.getAllDayRow(),a=[].slice.call(n.cells),s=1,o=n.cells.length),a.indexOf(t)),l=a.indexOf(i),p=[];if(e){for(var c=0;c<o;c++)for(var h=0;h<s;h++){var d=a[o*h+c];r&&d.classList.contains(E)||p.push(d)}n=p.indexOf(t),l=p.indexOf(i)}return l<n&&(t=n,n=l,l=t),(e?p:a).slice(n,l+1)},i.prototype.focusFirstCell=function(){var e;"Agenda"===this.parent.currentView?((e=this.parent.getContentTable().querySelector("."+Vi)).setAttribute("tabindex","0"),e.focus()):(this.parent.eventBase.removeSelectedAppointmentClass(),this.parent.activeView.isTimelineView()&&"TimelineYear"!==this.parent.currentView?(e=this.parent.element.querySelector("."+C+" tr:not(."+fr+") ."+O+":not(."+Ut+")"),this.selectCells(!1,e)):-1<this.parent.currentView.indexOf("Year")?(e="."+O+":not(."+E+"):not(."+Ut+")",e+="TimelineYear"===this.parent.currentView&&"Vertical"===this.parent.activeViewOptions.orientation?'[data-date="'+this.parent.activeView.startDate().getTime()+'"]':"",this.selectCells(!1,this.parent.element.querySelector(e))):this.selectCells(!1,this.parent.getWorkCellElements()[0]))},i.prototype.isInverseTableSelect=function(){return this.parent.activeView.isInverseTableSelect},i.prototype.selectCells=function(e,t){var p,c,i,h=this,d=(this.parent.removeSelectedClass(),t instanceof Array?t.slice(-1)[0]:t);e?(c=["Day","Week","WorkWeek","TimelineDay","TimelineWeek","TimelineWorkWeek","TimelineMonth","TimelineYear"],i={element:t,requestType:"mousemove",allowMultipleRow:!0},this.parent.inlineModule.removeInlineAppointmentElement(),this.parent.trigger(G,i,function(e){e.allowMultipleRow&&h.parent.allowMultiRowSelection||((e="TimelineYear"===h.parent.currentView)&&"Horizontal"===h.parent.activeViewOptions.orientation||"Month"===h.parent.currentView?(e=e&&0<h.parent.activeViewOptions.group.resources.length,d=e?h.initialTarget:h.initialTarget.parentElement.children[d.cellIndex]):-1<c.indexOf(h.parent.currentView)&&(d=d.parentElement.children[h.initialTarget.cellIndex]));e=h.getCells(h.isInverseTableSelect(),h.initialTarget,d);if(0<h.parent.activeViewOptions.group.resources.length){p=h.initialTarget.getAttribute("data-group-index");for(var t=[],i=0,n=e;i<n.length;i++)(a=n[i]).getAttribute("data-group-index")===p&&t.push(a);e=t}if(h.parent.allowMultiCellSelection||(e=[h.initialTarget]),2<(h.selectedCells=e).length&&!d.classList.contains(w)){var r=h.getAllDayCells(e);if(0<h.parent.activeViewOptions.group.resources.length){for(var a,s=[],o=0,l=r;o<l.length;o++)(a=l[o]).getAttribute("data-group-index")===p&&s.push(a);r=s}e=e.concat(r)}d.getAttribute("data-group-index")!==p&&0<h.parent.activeViewOptions.group.resources.length&&(d=h.selectedCells[h.selectedCells.length-1]),h.parent.addSelectedClass(e,d)})):(i={element:d,requestType:ge},this.parent.trigger(G,i,function(){h.initialTarget=d,h.selectedCells=[d],h.parent.addSelectedClass([d],d)}))},i.prototype.selectAppointment=function(e,t){var i=this.getAppointmentElements();i.length<0||(this.parent.eventBase.removeSelectedAppointmentClass(),(t=t.classList.contains(V)?(t=i.indexOf(t),i[e?t-1:t+1]):e?i[i.length-1]:i[0])&&(this.parent.eventBase.addSelectedAppointments([t],!0),t.focus(),B.addClass([t],Ii)))},i.prototype.selectAppointmentElementFromWorkCell=function(t,e){var i,n,r,a=this;this.parent.eventBase.removeSelectedAppointmentClass(),this.parent.removeSelectedClass(),(e.classList.contains(O)||e.classList.contains(w))&&(i=this.getUniqueAppointmentElements(),n=[],r=this.parent.getDateFromElement(e).getTime(),this.parent.eventsProcessed.filter(function(e){return t?e[a.parent.eventFields.startTime].getTime()<=r:e[a.parent.eventFields.startTime].getTime()>=r}).filter(function(t){i.filter(function(e){JSON.stringify(t.Guid)===JSON.stringify(e.getAttribute("data-guid"))&&n.push(e)})}),0<n.length)&&(e=this.getAppointmentElementsByGuid((t?n[n.length-1]:n[0]).getAttribute("data-guid")),this.parent.eventBase.addSelectedAppointments(e,!0),e[e.length-1].focus())},i.prototype.getAllDayCells=function(e){var t,i,n=this.parent.getAllDayRow();return n&&(t=e[0],e=e[e.length-1],i=this.parent.getCellDetails(t),this.parent.getCellDetails(e).endTime.getTime()-i.startTime.getTime()>=W)?[].slice.call(n.cells).slice(t.cellIndex,e.cellIndex+1):[]},i.prototype.getAppointmentElements=function(){return[].slice.call(this.parent.element.querySelectorAll("."+V))},i.prototype.getAppointmentElementsByGuid=function(e){return[].slice.call(this.parent.element.querySelectorAll('div[data-guid="'+e+'"]'))},i.prototype.getUniqueAppointmentElements=function(){var n=this.getAppointmentElements(),r=[];return n.map(function(e){return e.getAttribute("data-guid")}).filter(function(e,t,i){i.indexOf(e)===t&&r.push(n[parseInt(t.toString(),10)])}),r},i.prototype.getWorkCellFromAppointmentElement=function(e){e=this.parent.eventBase.getEventByGuid(e.getAttribute("data-guid"));return this.parent.eventBase.selectWorkCellByTime([e])},i.prototype.processViewNavigation=function(e){var t,i;B.isNullOrUndefined(e.code)||(t=parseInt(e.code.slice(e.code.length-1),10)-1,!isNaN(t)&&!B.isNullOrUndefined(this.parent.views)&&t<this.parent.views.length&&(i=this.parent.viewCollections[parseInt(t.toString(),10)].option,this.parent.changeView(i,e,void 0,t),this.parent.headerModule)&&this.parent.headerModule.element.querySelector(".e-active-view button").focus())},i.prototype.isCalendarTarget=function(e){e=e.currentTarget||e.target;return!(!e||B.isNullOrUndefined(e.querySelector(".e-header-popup.e-popup-open")))},i.prototype.cancelUpDownAction=function(e){var t=e&&"Vertical"===this.parent.activeViewOptions.orientation,i=0<this.parent.activeViewOptions.group.resources.length;return!!(t&&i||e&&this.initialTarget.classList.contains(E))||!((!this.parent.activeView.isTimelineView()||e)&&"MonthAgenda"!==this.parent.currentView)},i.prototype.processUp=function(e,t){var i="TimelineYear"===this.parent.currentView;if(!(t&&this.cancelUpDownAction(i)||this.isCalendarTarget(e))){var n=e.target,r=this.parent.getSelectedCells(),a=this.parent.eventBase.getSelectedAppointments(),s=this.parent.element.querySelector("."+Sn),o=this.getQuickPopupElement();if(0<r.length&&!e.target.classList.contains(O)&&(n=r[r.length-1]),0<a.length&&!s.classList.contains(xt)&&!o.classList.contains(xt)&&-1!==["Day","Week","WorkWeek","Month"].indexOf(this.parent.currentView)&&(n=this.getWorkCellFromAppointmentElement(a[a.length-1]),this.parent.eventBase.removeSelectedAppointmentClass()),n)if(n.classList.contains(O)&&!this.parent.element.querySelector("."+xt)){r=this.parent.getTableRows(),s=r.indexOf(n.parentElement),o=void 0;if(i&&t&&0===this.parent.activeViewOptions.group.resources.length&&(o=this.isInverseTableSelect()?this.getVerticalUpDownCell(r,n,s,!0):this.getHorizontalUpDownCell(r,n,s,!0)),(0<s||o)&&s<r.length){if(o=o||r[s-1].cells[n.cellIndex],"Year"===this.parent.currentView&&o.classList.contains(E)){if(!(this.parent.activeView.getStartDate().getTime()<+o.getAttribute("data-date")))return;o=this.getYearUpDownCell(r,s-1,n.cellIndex,!0)}e.preventDefault(),this.selectCells(t,o)}}else"Agenda"!==this.parent.currentView&&"MonthAgenda"!==this.parent.currentView||this.selectAppointment(!0,n)}},i.prototype.processDown=function(e,t){var i="TimelineYear"===this.parent.currentView;if(!(t&&this.cancelUpDownAction(i)||this.isCalendarTarget(e))){var n=e.target,r=this.parent.getSelectedCells(),a=this.parent.eventBase.getSelectedAppointments(),s=this.parent.element.querySelector("."+Sn),o=this.getQuickPopupElement(),r=(0<r.length&&!e.target.classList.contains(O)&&(n=r[r.length-1]),0<a.length&&!s.classList.contains(xt)&&!o.classList.contains(xt)&&-1!==["Day","Week","WorkWeek","Month"].indexOf(this.parent.currentView)&&(n=this.getWorkCellFromAppointmentElement(a[a.length-1]),this.parent.eventBase.removeSelectedAppointmentClass()),this.parent.getTableRows());if(n)if(n.classList.contains(O)&&!this.parent.element.querySelector("."+xt)){s=r.indexOf(n.parentElement),o=void 0;if(i&&t&&0===this.parent.activeViewOptions.group.resources.length&&(o=this.isInverseTableSelect()?this.getVerticalUpDownCell(r,n,s,!1):this.getHorizontalUpDownCell(r,n,s,!1)),0<=s&&(s<r.length-1||o)){if(o=o||r[s+1].cells[n.cellIndex],"Year"===this.parent.currentView&&o.classList.contains(E)){if(!(this.parent.activeView.getEndDate().getTime()>+o.getAttribute("data-date")))return;o=this.getYearUpDownCell(r,s+1,n.cellIndex,!1)}e.preventDefault(),this.selectCells(t,o)}}else"Agenda"!==this.parent.currentView&&"MonthAgenda"!==this.parent.currentView||this.selectAppointment(!1,n)}},i.prototype.getYearUpDownCell=function(e,t,i,n){for(;e[parseInt(t.toString(),10)]&&e[parseInt(t.toString(),10)].cells[parseInt(i.toString(),10)].classList.contains(E);)t+=n?-1:1;return e[parseInt(t.toString(),10)].cells[parseInt(i.toString(),10)]},i.prototype.getHorizontalUpDownCell=function(e,t,i,n){e=e[i+(n?-1:1)],i=e?e.cells[t.cellIndex]:t;return i.classList.contains(E)&&(n=e.querySelector("."+O+":not(."+E+")"),t=new Date(+n.getAttribute("data-date")),t='[data-date="'+new Date(t.getFullYear(),t.getMonth()+1,0).getTime()+'"]',i=i.cellIndex<n.cellIndex?n:e.querySelector(t)),i},i.prototype.getVerticalUpDownCell=function(e,t,i,n){var r=n&&0<i||!n&&i<e.length-1?e[i+(n?-1:1)].cells[t.cellIndex]:void 0;if(!r||r.classList.contains(E)){if(e[parseInt(i.toString(),10)].cells[t.cellIndex-(n?1:-1)])return e=+t.getAttribute("data-date")-(n?W:-W),this.parent.getContentTable().querySelector("."+O+'[data-date="'+e+'"]');r=t}return r},i.prototype.processLeftRight=function(e){var t="Year"===this.parent.currentView?e.closest("tbody"):this.parent.getContentTable(),i=e.parentNode.sectionRowIndex;return{element:t,rowIndex:i,columnIndex:e.cellIndex,maxIndex:t.rows[parseInt(i.toString(),10)].cells.length}},i.prototype.getQuickPopupElement=function(){return(this.parent.isAdaptive?document.body:this.parent.element).querySelector("."+Tr)},i.prototype.isCancelLeftRightAction=function(e,t,i){var i="MonthAgenda"===this.parent.currentView||i&&this.initialTarget.classList.contains(E);return!!("Agenda"===this.parent.currentView||t&&i)||!!(this.isPreventAction(e)&&t||(i=this.parent.element.querySelector("."+Sn),e=this.getQuickPopupElement(),i.classList.contains(xt))||e.classList.contains(xt))},i.prototype.processRight=function(e,t){var i,n,r,a,s,o="TimelineYear"===this.parent.currentView;this.isCancelLeftRightAction(e,t,o)||this.isCalendarTarget(e)||(r=this.parent.getSelectedCells(),n=this.parent.eventBase.getSelectedAppointments(),i=e.target,0<r.length&&!i.classList.contains(O)&&!i.classList.contains(w)&&(i=r[r.length-1]),0<n.length&&(i=this.getWorkCellFromAppointmentElement(n[n.length-1]),this.parent.eventBase.removeSelectedAppointmentClass(),!i))||(i.classList.contains(O)&&e.target.classList.contains(O)?(r=this.processLeftRight(i),n=new Date(+i.getAttribute("data-date")),a="Year"===this.parent.currentView&&n.getTime()===ze(n).getTime(),0<=r.columnIndex&&r.columnIndex<r.maxIndex-1&&!a?(s=this.calculateNextPrevDate(i,r.element.rows[r.rowIndex].cells[i.cellIndex+1],"right"),o&&t&&s.classList.contains(E)&&(s=this.getTimelineYearTargetCell(r,i,!0)),B.isNullOrUndefined(s)||this.selectCells(t,s)):r.columnIndex!==r.maxIndex-1&&!a||(!this.isInverseTableSelect()&&r.rowIndex<r.element.rows.length-1&&!a?(s=this.calculateNextPrevDate(i,r.element.rows[r.rowIndex+1].cells[0],"right"),s=o&&t&&s.classList.contains(E)?this.getHorizontalLeftRightCell(r,i,!0):s,B.isNullOrUndefined(s)||this.selectCells(t,s)):t||(a&&n.getTime()!==this.parent.activeView.getEndDate().getTime()?this.selectCells(t,this.parent.element.querySelector(":not(."+E+')[data-date="'+(n.getTime()+W)+'"]')):(o=this.isInverseTableSelect()?r.rowIndex:0,this.parent.changeDate(this.parent.activeView.getNextPreviousDate("Next"),e),s=this.parent.getContentTable(),n=a?s.rows[parseInt(o.toString(),10)].querySelector("."+O+":not(."+E+")"):s.rows[parseInt(o.toString(),10)].cells[0],this.selectCells(!1,n))))):i.classList.contains(w)&&(r=i.cellIndex,s=(a=this.parent.getAllDayRow()).cells.length,0<=r&&r<s-1?this.selectCells(t,a.cells[r+1]):r!==s-1||t||(this.parent.changeDate(this.parent.activeView.getNextPreviousDate("Next"),e),o=this.parent.getAllDayRow(),this.selectCells(!1,o.cells[0]))))},i.prototype.processLeft=function(e,t){var i,n,r,a,s,o="TimelineYear"===this.parent.currentView;this.isCancelLeftRightAction(e,t,o)||this.isCalendarTarget(e)||(i=e.target,0<(a=this.parent.getSelectedCells()).length&&!i.classList.contains(O)&&!i.classList.contains(w)&&(i=a[a.length-1]),0<(a=this.parent.eventBase.getSelectedAppointments()).length&&(i=this.getWorkCellFromAppointmentElement(a[a.length-1]),this.parent.eventBase.removeSelectedAppointmentClass(),!i))||(e.target.classList.contains(O)&&i.classList.contains(O)?(a=this.processLeftRight(i),n=new Date(+i.getAttribute("data-date")),s="Year"===this.parent.currentView&&n.getTime()===We(n).getTime(),0<a.columnIndex&&a.columnIndex<a.maxIndex&&!s?(r=this.calculateNextPrevDate(i,a.element.rows[a.rowIndex].cells[i.cellIndex-1],"left"),o&&t&&r.classList.contains(E)&&(r=this.getTimelineYearTargetCell(a,i,!1)),B.isNullOrUndefined(r)||this.selectCells(t,r)):0!==a.columnIndex&&!s||(!this.isInverseTableSelect()&&0<a.rowIndex?(r=this.calculateNextPrevDate(i,a.element.rows[a.rowIndex-1].cells[a.maxIndex-1],"left"),r=o&&t&&r.classList.contains(E)?this.getHorizontalLeftRightCell(a,i,!1):r,B.isNullOrUndefined(r)||this.selectCells(t,r)):t||(s&&n.getTime()!==this.parent.activeView.getStartDate().getTime()?this.selectCells(t,this.parent.element.querySelector('[data-date="'+(n.getTime()-W)+'"]')):(this.parent.changeDate(this.parent.activeView.getNextPreviousDate("Previous"),e),o=this.parent.getContentTable(),r=this.isInverseTableSelect()?a.rowIndex:o.rows.length-1,n=o.rows[parseInt(r.toString(),10)].cells[a.maxIndex-1],s&&(n=(o=this.parent.element.querySelectorAll("."+C+" tbody")).item(o.length-1).querySelector(":not(."+E+')[data-date="'+this.parent.activeView.getEndDate().getTime()+'"]')),this.selectCells(!1,n))))):i.classList.contains(w)&&(r=i.cellIndex,s=(a=this.parent.getAllDayRow()).cells.length,0<r&&r<s?this.selectCells(t,a.cells[r-1]):0!==r||t||(this.parent.changeDate(this.parent.activeView.getNextPreviousDate("Previous"),e),o=this.parent.getAllDayRow(),this.selectCells(!1,o.cells[s-1]))))},i.prototype.getTimelineYearTargetCell=function(e,t,i){return this.isInverseTableSelect()?this.getVerticalLeftRightCell(t,i):this.getHorizontalLeftRightCell(e,t,i)},i.prototype.getHorizontalLeftRightCell=function(e,t,i){e=e.element.rows[t.parentNode.sectionRowIndex+(i?1:-1)];return e?(i=i?"."+O+":not(."+E+")":'[data-date="'+(+t.getAttribute("data-date")-W)+'"]',e.querySelector(i)):t},i.prototype.getVerticalLeftRightCell=function(e,t){var i=new Date(+e.getAttribute("data-date")),i=new Date(i.getFullYear(),i.getMonth()+(t?1:-1),1),t=this.parent.getContentTable(),n=t.querySelector('[data-date="'+i.getTime()+'"]');return n.parentNode.sectionRowIndex>e.parentNode.sectionRowIndex?n:t.querySelector('[data-date="'+new Date(i.getFullYear(),i.getMonth()+1,0).getTime()+'"]')},i.prototype.calculateNextPrevDate=function(e,t,i){var n=this.initialTarget.getAttribute("data-group-index");return 0<this.parent.activeViewOptions.group.resources.length&&"Month"===this.parent.currentView&&e&&t&&t.getAttribute("data-group-index")!==n&&(e=this.parent.getDateFromElement(e),i="right"===i?new Date(e.setDate(e.getDate()+1)):new Date(e.setDate(e.getDate()-1)),t=[].slice.call(this.parent.element.querySelectorAll('td[data-date="'+i.getTime().toString()+'"][data-group-index="'+n+'"]'))[0]),t},i.prototype.getFocusableElements=function(e){return[].slice.call(e.querySelectorAll('a[href]:not([tabindex="-1"]),input:not([disabled]):not([tabindex="-1"]),textarea:not([disabled]):not([tabindex="-1"]),button:not([disabled]):not([tabindex="-1"]),select:not([disabled]):not([tabindex="-1"]),[tabindex]:not([tabindex="-1"]),[contentEditable=true]:not([tabindex="-1"])'))},i.prototype.processTabOnPopup=function(e,t){var i=this,t=this.getFocusableElements(t),n=(t=t.filter(function(e){var t=i.parent.element.querySelector("."+vn);return t&&t.offsetParent?!(e.classList.contains(lr)||e.classList.contains(cr)):!(e.classList.contains(wn)||e.classList.contains(Dn))}))[0],t=t[t.length-1];B.isNullOrUndefined(t)||document.activeElement!==t||e.shiftKey||(e.preventDefault(),n.focus()),!B.isNullOrUndefined(n)&&document.activeElement===n&&e.shiftKey&&(e.preventDefault(),t.focus())},i.prototype.processTab=function(e,t){var i=e.target;if(i.classList.contains(Pr)&&this.parent.inlineModule&&(i=i.closest(".e-appointment"),this.parent.inlineModule.inlineCrudActions(e.target)),"TimelineYear"===this.parent.currentView&&i.classList.contains(E))i.classList.contains(di)&&this.parent.removeSelectedClass();else{var n=B.closest(i,"."+Tr+",."+Sn);if(n&&n.classList.contains(xt))n.classList.contains(Sn)&&this.parent.eventBase.removeSelectedAppointmentClass(),this.processTabOnPopup(e,n);else if(i.classList.contains(vt))this.parent.eventBase.removeSelectedAppointmentClass();else if(i.classList.contains(Kt)&&this.parent.activeView.isTimelineView()&&0<this.parent.activeViewOptions.group.resources.length)a=parseInt(i.getAttribute("data-group-index"),10),0<(r=[].slice.call(this.parent.element.querySelectorAll("."+V+'[data-group-index="'+(t?a-1:a)+'"]'))).length?(this.parent.eventBase.removeSelectedAppointmentClass(),n=(t?r.slice(-1):r)[0],this.parent.eventBase.addSelectedAppointments([n],!0),n.focus(),e.preventDefault()):a+1===this.parent.resourceBase.lastResourceLevel.length?(this.parent.element.focus(),e.preventDefault()):this.parent.virtualScrollModule?(n=this.parent.element.querySelector("."+xi),n=Math.round(n.offsetHeight/this.parent.resourceBase.expandedResources.length),this.parent.element.querySelector(".e-content-wrap").scrollTop=(t?a-1:a+1)*n,this.parent.virtualScrollModule.virtualScrolling()):this.setScrollPosition(a);else{if(i.classList.contains(V)){var r=[].slice.call(this.parent.element.querySelectorAll("."+V)),n="TimelineYear"===this.parent.currentView;if((this.parent.activeView.isTimelineView()&&!n||n&&"Vertical"===this.parent.activeViewOptions.orientation)&&0<this.parent.activeViewOptions.group.resources.length){var a=parseInt(i.getAttribute("data-group-index"),10),n=(r=[].slice.call(this.parent.element.querySelectorAll("."+V+'[data-group-index="'+a+'"]')),"."+Kt+'[data-group-index="'+(t?a:a+1)+'"]'),n=this.parent.element.querySelector(n);if(n&&(t&&i.getAttribute("data-guid")===r[0].getAttribute("data-guid")||!t&&i.getAttribute("data-guid")===r.slice(-1)[0].getAttribute("data-guid")))return this.parent.eventBase.removeSelectedAppointmentClass(),this.parent.virtualScrollModule?n.focus({preventScroll:!0}):n.focus(),this.parent.activeView.isTimelineView()&&0<this.parent.activeViewOptions.group.resources.length&&B.isNullOrUndefined(this.parent.virtualScrollModule)&&this.setScrollPosition(a),void e.preventDefault()}n=this.parent.eventBase.getSelectedAppointments();return(0<n.length&&(i=n[n.length-1]),this.parent.eventBase.removeSelectedAppointmentClass(),!t&&i.getAttribute("data-guid")===r[r.length-1].getAttribute("data-guid")||t&&i.getAttribute("data-guid")===r[0].getAttribute("data-guid"))?void 0:void("Agenda"!==this.parent.currentView&&"MonthAgenda"!==this.parent.currentView||(this.selectAppointment(t,i),e.preventDefault()))}a=this.parent.getSelectedCells();0<a.length&&!i.classList.contains(V)?(i=a[a.length-1],this.selectAppointmentElementFromWorkCell(t,i),e.preventDefault()):i&&!i.classList.contains(Kt)&&this.parent.activeView.isTimelineView()&&0<this.parent.activeViewOptions.group.resources.length&&this.processTabOnResourceCells(i,t)}}},i.prototype.processDelete=function(e){var t,i=document.activeElement;(i="MonthAgenda"===this.parent.currentView||!B.isNullOrUndefined(i)&&B.closest(i,"."+Tr)?(t=this.parent.eventBase.getSelectedEvents().element)&&B.isNullOrUndefined(t.length)?t:t[0]:i)&&i.classList.contains(V)&&(B.addClass([i],wi),this.parent.activeEventData=this.parent.eventBase.getSelectedEvents(),this.parent.activeViewOptions.readonly||i.classList.contains(Rr)||!this.parent.eventSettings.allowDeleting||this.parent.quickPopup.deleteClick(e))},i.prototype.processCtrlShiftNavigationArrows=function(e){if(0<this.parent.activeViewOptions.group.resources.length&&document.activeElement.classList.contains(V)){for(var t=parseInt(document.activeElement.getAttribute("data-group-index"),10),i=(n=(n="ctrlShiftLeftArrow"===e.action||"ctrlShiftUpArrow"===e.action?t-1:t+1)<0?0:n>this.parent.resourceBase.lastResourceLevel.length?this.parent.resourceBase.lastResourceLevel.length:n,[]);0===i.length&&0<=n&&n<=this.parent.resourceBase.lastResourceLevel.length;)i=[].slice.call(this.parent.element.querySelectorAll("."+V+'[data-group-index="'+n+'"]')),n="ctrlShiftLeftArrow"===e.action||"ctrlShiftUpArrow"===e.action?n-1:n+1;t=i[0];t&&(this.parent.eventBase.removeSelectedAppointmentClass(),this.parent.eventBase.addSelectedAppointments([t],!0),t.focus())}else{var n;0<this.parent.activeViewOptions.group.resources.length&&!document.activeElement.classList.contains(V)&&(n=this.parent.resourceBase.renderedResources[0].groupIndex,0<(t=[].slice.call(this.parent.element.querySelectorAll("."+V+'[data-group-index="'+n+'"]'))).length)&&(this.parent.eventBase.removeSelectedAppointmentClass(),t=t[0],this.parent.eventBase.addSelectedAppointments([t],!0),t.focus(),e.preventDefault())}},i.prototype.processEscape=function(e){this.parent.quickPopup.onClosePopup(e),this.parent.quickPopup.morePopup.hide(),this.parent.headerModule&&this.parent.headerModule.hideHeaderPopup(),this.parent.inlineModule&&this.parent.inlineModule.removeInlineAppointmentElement()},i.prototype.isPreventAction=function(e){e=B.closest(e.target,"."+Ut);return!(!this.parent.activeView.isTimelineView()||B.isNullOrUndefined(e))},i.prototype.processTabOnResourceCells=function(e,t){var i,n=[].slice.call(this.parent.element.querySelectorAll('[tabIndex="0"]')),e=n.indexOf(e),t=t?n[e-1]:n[e+1];t&&t.classList.contains(Kt)&&(n=parseInt(t.getAttribute("data-group-index"),10),this.parent.virtualScrollModule?(i=this.parent.element.querySelector("."+Wt),[].slice.call(this.parent.element.querySelectorAll("."+Kt)).forEach(function(e){e.getBoundingClientRect().top<i.getBoundingClientRect().top&&e.setAttribute("tabindex","-1")})):this.setScrollPosition(n))},i.prototype.setScrollPosition=function(e){e=this.parent.element.querySelector("."+O+'[data-group-index="'+e+'"]');e&&(this.parent.element.querySelector("."+A).scrollTop=e.offsetTop)},i.prototype.createClipboardElement=function(){this.parent.allowClipboard&&(this.clipBoardTextArea=this.parent.createElement("textarea",{className:"e-clipboard",attrs:{tabindex:"-1"}}),this.parent.element.appendChild(this.clipBoardTextArea))},i.prototype.setCopy=function(e,t){var i=this;if(""===window.getSelection().toString()){this.clipBoardTextArea.value="";var n={elements:[],eventDatas:[]};if(e){e=this.filterReadOnlyEvent(e);n.eventDatas=e}else{if(!this.parent||!this.parent.eventBase)return;e=this.parent.eventBase.getSelectedEvents();e.event=e&&e.event?Array.isArray(e.event)?this.filterReadOnlyEvent(e.event):this.filterReadOnlyEvent([e.event]):void 0,e.element&&e.event?n={elements:e.element,eventDatas:e.event}:(n.element=[t.target],n.eventDatas=[this.parent.getEventDetails(t.target)])}this.clipBoardTextArea.value=JSON.stringify(n.eventDatas,void 0,2),/ipad|ipod|iphone/i.test(B.Browser.userAgent)?this.clipBoardTextArea.setSelectionRange(0,this.clipBoardTextArea.value.length):this.clipBoardTextArea.select(),B.isNullOrUndefined(navigator.clipboard)||navigator.clipboard.writeText(this.clipBoardTextArea.value).then(function(){var e;i.clipBoardTextArea.blur(),window.getSelection().removeAllRanges(),t&&(e=t.target.closest("."+V))&&e.focus()}).catch(function(e){throw e})}},i.prototype.filterReadOnlyEvent=function(e){var t=this;return e.filter(function(e){return!e[t.parent.eventFields.isReadonly]})},i.prototype.processClipboardAction=function(e,t,i){this.parent.allowClipboard&&(this.isCutAction=e,this.isCutContentPasted=!1,this.parent.closeQuickInfoPopup(),this.setCopy(t||void 0,i))},i.prototype.pasteHandler=function(t,i){var n=this;if(this.parent.allowClipboard&&!this.isCutContentPasted){var e=0<this.parent.getSelectedCells().length?this.parent.getSelectedCells():i?[i]:[];if(0!==e.length&&!this.parent.eventWindow.dialogObject.visible&&!this.parent.quickPopup.quickPopup.element.classList.contains(xt)){var r,t=(t.clipboardData||t.event.clipboardData||window.clipboardData).getData("text");if("[]"!==t&&""!==t){try{r=JSON.parse(t)}catch(e){r=t}this.parent.trigger(De,{cancel:!1,data:r,element:e},function(e){e.cancel?n.parent.closeQuickInfoPopup():Array.isArray(e.data)&&e.data.every(function(e){return"object"==typeof e})?(n.processPaste(e.data,i),n.isCutAction&&(n.isCutContentPasted=!0)):n.clipBoardTextArea.value=""})}}}},i.prototype.processPaste=function(e,t){var i,n,r,a;this.parent&&this.parent.eventWindow&&this.parent.eventBase&&e&&e.length&&(t=this.getTargetElements(t),a=this.parent.getCellDetails(t),this.parent.eventWindow.convertToEventData(a,i={}),r=this.isAllDayEvent(t),n=this.parent.getResourcesByIndex(a.groupIndex),e=this.processEventData(e,r,a,n),r=this.parent.eventBase.sortByDateTime(e),a=this.prepareEventData(r,i),B.removeClass(t,di),0<a.length)&&(this.isCutAction?this.parent.saveEvent(a):this.parent.addEvent(a))},i.prototype.getTargetElements=function(e){return 0<this.parent.getSelectedCells().length?this.parent.getSelectedCells():e?[e]:[]},i.prototype.isAllDayEvent=function(e){return!e.some(function(e){return e.classList.contains(O)})},i.prototype.processEventData=function(e,i,n,r){var a=this;return e.map(function(e){var t=Gr({},e,((t={})[a.parent.eventFields.startTime]=new Date(e[a.parent.eventFields.startTime]),t[a.parent.eventFields.endTime]=new Date(e[a.parent.eventFields.endTime]),t[a.parent.eventFields.recurrenceID]=null,t[a.parent.eventFields.isAllDay]=i,t));return a.adjustEventTime(t,i,e.IsAllDay,n),r&&r.groupData&&Object.assign(t,r.groupData),t})},i.prototype.adjustEventTime=function(e,t,i,n){var r=this.parent.activeViewOptions.timeScale.enable;-1!==["Day","Week","WorkWeek"].indexOf(this.parent.currentView)&&r?t?(e[this.parent.eventFields.endTime]=new Date(e[this.parent.eventFields.startTime]),e[this.parent.eventFields.endTime].setDate(e[this.parent.eventFields.startTime].getDate()+1)):i&&(e[this.parent.eventFields.startTime]=new Date(e[this.parent.eventFields.startTime].setHours(0,0,0,0)),e[this.parent.eventFields.endTime]=new Date(e[this.parent.eventFields.startTime].getTime()+(n.endTime.getTime()-n.startTime.getTime()))):i&&(e[this.parent.eventFields.isAllDay]=!0,e[this.parent.eventFields.startTime]=new Date(e[this.parent.eventFields.startTime].setHours(0,0,0,0)),e[this.parent.eventFields.endTime]=new Date(e[this.parent.eventFields.startTime].getTime()+(e[this.parent.eventFields.endTime].getTime()-e[this.parent.eventFields.startTime].getTime())))},i.prototype.prepareEventData=function(e,n){var r=this,a=new Date(e[0][this.parent.eventFields.startTime]),s=this.parent.getEventMaxID();return e.map(function(e){var t=r.calculateTotalDuration(e,n,a),i=r.isCutAction?e:Gr({},e);return e[r.parent.eventFields.recurrenceRule]||(i[r.parent.eventFields.startTime]=new Date(new Date(i[r.parent.eventFields.startTime]).setMilliseconds(t)),i[r.parent.eventFields.endTime]=new Date(new Date(i[r.parent.eventFields.endTime]).setMilliseconds(t))),r.isCutAction||(i[r.parent.eventFields.id]=s++),i})},i.prototype.calculateTotalDuration=function(e,t,i){return-1===["Month","TimelineMonth","TimelineYear"].indexOf(this.parent.currentView)&&this.parent.activeViewOptions.timeScale.enable?t[this.parent.eventFields.startTime].getTime()-i.getTime():(e=new Date(e[this.parent.eventFields.startTime]),t[this.parent.eventFields.startTime].getTime()-i.getTime()+(36e5*e.getHours()+6e4*e.getMinutes()+1e3*e.getSeconds()))},i.prototype.getModuleName=function(){return"keyboard"},i.prototype.destroy=function(){this.removeEventListener(),this.selectedCells=[],this.clipBoardTextArea=null,this.keyboardModule.destroy()},i);function i(e){this.selectedCells=[],this.isCutContentPasted=!1,this.isCutAction=!1,this.keyConfigs={downArrow:"downarrow",upArrow:"uparrow",rightArrow:"rightarrow",leftArrow:"leftarrow",shiftDownArrow:"shift+downarrow",shiftUpArrow:"shift+uparrow",shiftRightArrow:"shift+rightarrow",shiftLeftArrow:"shift+leftarrow",ctrlLeftArrow:"ctrl+leftarrow",ctrlRightArrow:"ctrl+rightarrow",altOne:"alt+1",altTwo:"alt+2",altThree:"alt+3",altFour:"alt+4",altFive:"alt+5",altSix:"alt+6",altSeven:"alt+7",altEight:"alt+8",altNine:"alt+9",enter:"enter",escape:"escape",delete:"delete",backspace:"backspace",home:"home",pageUp:"pageup",pageDown:"pagedown",tab:"tab",shiftTab:"shift+tab",ctrlShiftUpArrow:"ctrl+shift+uparrow",ctrlShiftDownArrow:"ctrl+shift+downarrow",ctrlShiftLeftArrow:"ctrl+shift+leftarrow",ctrlShiftRightArrow:"ctrl+shift+rightarrow",shiftAltY:"shift+alt+y",shiftAltN:"shift+alt+n",cut:"ctrl+x",copy:"ctrl+c",cmdCut:"cmd+x",cmdCopy:"cmd+c"},this.parent=e,this.parent.element.tabIndex=-1===this.parent.element.tabIndex?0:this.parent.element.tabIndex,this.keyboardModule=new B.KeyboardEvents(this.parent.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"}),this.addEventListener(),this.createClipboardElement()}Kr.prototype.initDataManager=function(e,t){this.dataManager=e instanceof p.DataManager?e:new p.DataManager(e),this.query=t instanceof p.Query?t:new p.Query},Kr.prototype.generateQuery=function(e,t){var n,i,r,a=this.query.clone();if(this.parent&&e&&t){if(this.parent.activeViewOptions&&this.parent.activeViewOptions.enableLazyLoading&&!B.isNullOrUndefined(this.parent.activeViewOptions.group.resources)&&0<this.parent.activeViewOptions.group.resources.length&&this.parent.resourceBase&&0<this.parent.resourceBase.resourceCollection.length&&0<this.parent.resourceBase.renderedResources.length&&(n=[],this.parent.resourceBase.resourceCollection.forEach(function(){return n.push([])}),this.parent.resourceBase.renderedResources.forEach(function(i){n.forEach(function(e,t){t=i.groupOrder[parseInt(t.toString(),10)];t&&e.indexOf(t)<0&&e.push(t)})}),this.parent.resourceBase.resourceCollection.forEach(function(e,t){a.addParams(e.field,n[parseInt(t.toString(),10)].toString())})),this.parent.timezone&&(e=this.parent.tzModule.remove(new Date(+e.getTime()),this.parent.timezone),t=this.parent.tzModule.remove(new Date(+t.getTime()),this.parent.timezone)),this.parent.eventSettings.includeFiltersInQuery)return i=this.getStartEndQuery(e,t),r=new p.Predicate(this.parent.eventFields.recurrenceRule,"notequal",null).and(new p.Predicate(this.parent.eventFields.recurrenceRule,"notequal","")),a.where(i.or(r));a.addParams("StartDate",e.toISOString()),a.addParams("EndDate",t.toISOString())}return a},Kr.prototype.getStartEndQuery=function(e,t){var i=this.parent.eventFields;return new p.Predicate(i.startTime,"greaterthanorequal",e).and(new p.Predicate(i.endTime,"greaterthanorequal",e)).and(new p.Predicate(i.startTime,"lessthan",t)).or(new p.Predicate(i.startTime,"lessthanorequal",e).and(new p.Predicate(i.endTime,"greaterthan",e)))},Kr.prototype.getData=function(e){return this.dataManager.executeQuery(e)},Kr.prototype.destroy=function(){this.dataManager=null,this.query=null};var Qr=Kr;function Kr(e,t,i){this.parent=e,this.initDataManager(t,i)}Jr.prototype.firstDateOfMonth=function(e){return new Date(e.getFullYear(),e.getMonth())},Jr.prototype.lastDateOfMonth=function(e){return new Date(e.getFullYear(),e.getMonth()+1,0)},Jr.prototype.isMonthStart=function(e){return 1===e.getDate()},Jr.prototype.getLeapYearDaysCount=function(){return 366},Jr.prototype.getYearDaysCount=function(e,t){return(e.getFullYear()+t)%4==0?366:365},Jr.prototype.getDate=function(e){return e.getDate()},Jr.prototype.getMonth=function(e){return e.getMonth()+1},Jr.prototype.getFullYear=function(e){return e.getFullYear()},Jr.prototype.getYearLastDate=function(e,t){return new Date(e.getFullYear()+t,0,0)},Jr.prototype.getMonthDaysCount=function(e){return this.lastDateOfMonth(e).getDate()},Jr.prototype.getMonthStartDate=function(e){return new Date(e.getFullYear(),e.getMonth(),1,e.getHours(),e.getMinutes())},Jr.prototype.getMonthEndDate=function(e){return e.setDate(1),new Date(e.setMonth(e.getMonth()+1))},Jr.prototype.getExpectedDays=function(e,t){return t},Jr.prototype.setDate=function(e,t){e.setDate(t)},Jr.prototype.setValidDate=function(e,t,i,n,r){B.isNullOrUndefined(r)?e.setMonth(e.getMonth()+t,i):e.setMonth((r?n:e.getMonth())+t)},Jr.prototype.setMonth=function(e,t,i){e.setDate(1),e.setFullYear(e.getFullYear()),e.setMonth(t-1);t=new Date(e.getFullYear(),e.getMonth()+1,0).getDate();e.setDate(Math.min(i,t))},Jr.prototype.addYears=function(e,t){e.setFullYear(e.getFullYear()+t)},Jr.prototype.isSameMonth=function(e,t){return e.getMonth()===t.getMonth()},Jr.prototype.checkMonth=function(e,t){return-1===t.indexOf(e.getMonth()+1)},Jr.prototype.compareMonth=function(e,t){return e.getMonth()>t.getMonth()},Jr.prototype.isSameYear=function(e,t){return e.getFullYear()===t.getFullYear()},Jr.prototype.isLastMonth=function(e){return 11===e.getMonth()},Jr.prototype.isLeapYear=function(e,t){return(e+t)%4==0};var Zr=Jr;function Jr(){}ea.prototype.firstDateOfMonth=function(e){e=this.getHijriDate(e);return B.HijriParser.toGregorian(e.year,e.month,1)},ea.prototype.lastDateOfMonth=function(e){var e=this.getHijriDate(e),t=this.getDaysInMonth(e.month,e.year),t=B.HijriParser.toGregorian(e.year,e.month,t),i=new Date(t.getTime()),i=new Date(i.setDate(i.getDate()+1)),n=this.getHijriDate(i);return e.month===n.month?i:(n=this.getHijriDate(t),e.month===n.month?t:new Date(t.setDate(t.getDate()-1)))},ea.prototype.isMonthStart=function(e){return 1===this.getHijriDate(e).date},ea.prototype.getLeapYearDaysCount=function(){return 355},ea.prototype.getYearDaysCount=function(e,t){e=this.getHijriDate(e);return this.isLeapYear(e.year,t)?355:354},ea.prototype.getDate=function(e){return this.getHijriDate(e).date},ea.prototype.getMonth=function(e){return this.getHijriDate(e).month},ea.prototype.getFullYear=function(e){return this.getHijriDate(e).year},ea.prototype.getYearLastDate=function(e,t){e=this.getHijriDate(e);return B.HijriParser.toGregorian(e.year+t,1,0)},ea.prototype.getMonthDaysCount=function(e){e=this.lastDateOfMonth(e);return this.getHijriDate(e).date},ea.prototype.getMonthStartDate=function(e){var t=this.firstDateOfMonth(e);return new Date(t.getFullYear(),t.getMonth(),t.getDate(),e.getHours(),e.getMinutes())},ea.prototype.getMonthEndDate=function(e){e=this.lastDateOfMonth(e);return e.setDate(e.getDate()+1),new Date(e.setMonth(e.getMonth()))},ea.prototype.getExpectedDays=function(e,t){for(var i=this.getHijriDate(e),n=[],r=0;r<t.length;r++){var a=B.HijriParser.toGregorian(i.year,i.month,t[parseInt(r.toString(),10)]);n.push(a.getDate())}return n},ea.prototype.setDate=function(e,t){var i=this.getHijriDate(e),i=B.HijriParser.toGregorian(i.year,i.month,t);this.updateDateObj(e,i)},ea.prototype.setValidDate=function(e,t,i,n,r){r=B.isNullOrUndefined(r)?e:this.firstDateOfMonth(r),r=this.getHijriDate(r),r=B.HijriParser.toGregorian(r.year,r.month+t,i);this.updateDateObj(e,r)},ea.prototype.setMonth=function(e,t,i){var n=this.getHijriDate(e),n=B.HijriParser.toGregorian(n.year,t,i);this.updateDateObj(e,n)},ea.prototype.addYears=function(e,t,i){var n=this.getHijriDate(e),n=B.HijriParser.toGregorian(n.year+t,i,1);this.updateDateObj(e,n)},ea.prototype.isSameMonth=function(e,t){e=this.getHijriDate(e),t=this.getHijriDate(t);return e.month===t.month},ea.prototype.checkMonth=function(e,t){e=this.getHijriDate(e);return-1===t.indexOf(e.month)},ea.prototype.compareMonth=function(e,t){e=this.getHijriDate(e),t=this.getHijriDate(t);return e.month>t.month},ea.prototype.isSameYear=function(e,t){e=this.getHijriDate(e),t=this.getHijriDate(t);return e.year===t.year},ea.prototype.isLastMonth=function(e){return 12===this.getHijriDate(e).month},ea.prototype.updateDateObj=function(e,t){e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate())},ea.prototype.isLeapYear=function(e,t){return(14+11*(e+t))%30<11},ea.prototype.getDaysInMonth=function(e,t){var i=0,i=29+(e+1)%2;return 11===e&&this.isLeapYear(t,0)&&i++,i},ea.prototype.getHijriDate=function(e){return B.HijriParser.getHijriDate(e)};var $r=ea;function ea(){}ia.prototype.offset=function(e,t){var i=e.getTimezoneOffset();try{var n=new Date(e.toLocaleString("en-US",{timeZone:t}));return isNaN(n.getTime())?0:(e.getTime()-n.getTime())/6e4+i}catch(e){return 0}},ia.prototype.convert=function(e,t,i){"string"==typeof t&&(t=this.offset(e,t)),"string"==typeof i&&(i=this.offset(e,i));var n=e.getTimezoneOffset(),t=(e=new Date(e.getTime()+6e4*(t-i))).getTimezoneOffset();return new Date(e.getTime()+6e4*(t-n))},ia.prototype.add=function(e,t){return this.convert(e,e.getTimezoneOffset(),t)},ia.prototype.remove=function(e,t){return this.convert(e,t,e.getTimezoneOffset())},ia.prototype.removeLocalOffset=function(e){return new Date(e.getTime()-6e4*e.getTimezoneOffset())},ia.prototype.getLocalTimezoneName=function(){return window.Intl&&Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"},ia.prototype.getTimezoneData=function(){return na};var ta=ia;function ia(){this.timezoneData=[],this.timezoneData=this.getTimezoneData()}var na=[{Value:"Pacific/Niue",Text:"(UTC-11:00) Niue"},{Value:"Pacific/Pago_Pago",Text:"(UTC-11:00) Pago Pago"},{Value:"Pacific/Honolulu",Text:"(UTC-10:00) Hawaii Time"},{Value:"Pacific/Rarotonga",Text:"(UTC-10:00) Rarotonga"},{Value:"Pacific/Tahiti",Text:"(UTC-10:00) Tahiti"},{Value:"Pacific/Marquesas",Text:"(UTC-09:30) Marquesas"},{Value:"America/Anchorage",Text:"(UTC-09:00) Alaska Time"},{Value:"Pacific/Gambier",Text:"(UTC-09:00) Gambier"},{Value:"America/Los_Angeles",Text:"(UTC-08:00) Pacific Time"},{Value:"America/Tijuana",Text:"(UTC-08:00) Pacific Time - Tijuana"},{Value:"America/Vancouver",Text:"(UTC-08:00) Pacific Time - Vancouver"},{Value:"America/Whitehorse",Text:"(UTC-08:00) Pacific Time - Whitehorse"},{Value:"Pacific/Pitcairn",Text:"(UTC-08:00) Pitcairn"},{Value:"America/Denver",Text:"(UTC-07:00) Mountain Time"},{Value:"America/Phoenix",Text:"(UTC-07:00) Mountain Time - Arizona"},{Value:"America/Mazatlan",Text:"(UTC-07:00) Mountain Time - Chihuahua, Mazatlan"},{Value:"America/Dawson_Creek",Text:"(UTC-07:00) Mountain Time - Dawson Creek"},{Value:"America/Edmonton",Text:"(UTC-07:00) Mountain Time - Edmonton"},{Value:"America/Hermosillo",Text:"(UTC-07:00) Mountain Time - Hermosillo"},{Value:"America/Yellowknife",Text:"(UTC-07:00) Mountain Time - Yellowknife"},{Value:"America/Belize",Text:"(UTC-06:00) Belize"},{Value:"America/Chicago",Text:"(UTC-06:00) Central Time"},{Value:"America/Mexico_City",Text:"(UTC-06:00) Central Time - Mexico City"},{Value:"America/Regina",Text:"(UTC-06:00) Central Time - Regina"},{Value:"America/Tegucigalpa",Text:"(UTC-06:00) Central Time - Tegucigalpa"},{Value:"America/Winnipeg",Text:"(UTC-06:00) Central Time - Winnipeg"},{Value:"America/Costa_Rica",Text:"(UTC-06:00) Costa Rica"},{Value:"America/El_Salvador",Text:"(UTC-06:00) El Salvador"},{Value:"Pacific/Galapagos",Text:"(UTC-06:00) Galapagos"},{Value:"America/Guatemala",Text:"(UTC-06:00) Guatemala"},{Value:"America/Managua",Text:"(UTC-06:00) Managua"},{Value:"America/Cancun",Text:"(UTC-05:00) America Cancun"},{Value:"America/Bogota",Text:"(UTC-05:00) Bogota"},{Value:"Pacific/Easter",Text:"(UTC-05:00) Easter Island"},{Value:"America/New_York",Text:"(UTC-05:00) Eastern Time"},{Value:"America/Iqaluit",Text:"(UTC-05:00) Eastern Time - Iqaluit"},{Value:"America/Toronto",Text:"(UTC-05:00) Eastern Time - Toronto"},{Value:"America/Guayaquil",Text:"(UTC-05:00) Guayaquil"},{Value:"America/Havana",Text:"(UTC-05:00) Havana"},{Value:"America/Jamaica",Text:"(UTC-05:00) Jamaica"},{Value:"America/Lima",Text:"(UTC-05:00) Lima"},{Value:"America/Nassau",Text:"(UTC-05:00) Nassau"},{Value:"America/Panama",Text:"(UTC-05:00) Panama"},{Value:"America/Port-au-Prince",Text:"(UTC-05:00) Port-au-Prince"},{Value:"America/Rio_Branco",Text:"(UTC-05:00) Rio Branco"},{Value:"America/Halifax",Text:"(UTC-04:00) Atlantic Time - Halifax"},{Value:"America/Barbados",Text:"(UTC-04:00) Barbados"},{Value:"Atlantic/Bermuda",Text:"(UTC-04:00) Bermuda"},{Value:"America/Boa_Vista",Text:"(UTC-04:00) Boa Vista"},{Value:"America/Caracas",Text:"(UTC-04:00) Caracas"},{Value:"America/Curacao",Text:"(UTC-04:00) Curacao"},{Value:"America/Grand_Turk",Text:"(UTC-04:00) Grand Turk"},{Value:"America/Guyana",Text:"(UTC-04:00) Guyana"},{Value:"America/La_Paz",Text:"(UTC-04:00) La Paz"},{Value:"America/Manaus",Text:"(UTC-04:00) Manaus"},{Value:"America/Martinique",Text:"(UTC-04:00) Martinique"},{Value:"America/Port_of_Spain",Text:"(UTC-04:00) Port of Spain"},{Value:"America/Porto_Velho",Text:"(UTC-04:00) Porto Velho"},{Value:"America/Puerto_Rico",Text:"(UTC-04:00) Puerto Rico"},{Value:"America/Santo_Domingo",Text:"(UTC-04:00) Santo Domingo"},{Value:"America/Thule",Text:"(UTC-04:00) Thule"},{Value:"America/St_Johns",Text:"(UTC-03:30) Newfoundland Time - St. Johns"},{Value:"America/Araguaina",Text:"(UTC-03:00) Araguaina"},{Value:"America/Asuncion",Text:"(UTC-03:00) Asuncion"},{Value:"America/Belem",Text:"(UTC-03:00) Belem"},{Value:"America/Argentina/Buenos_Aires",Text:"(UTC-03:00) Buenos Aires"},{Value:"America/Campo_Grande",Text:"(UTC-03:00) Campo Grande"},{Value:"America/Cayenne",Text:"(UTC-03:00) Cayenne"},{Value:"America/Cuiaba",Text:"(UTC-03:00) Cuiaba"},{Value:"America/Fortaleza",Text:"(UTC-03:00) Fortaleza"},{Value:"America/Godthab",Text:"(UTC-03:00) Godthab"},{Value:"America/Maceio",Text:"(UTC-03:00) Maceio"},{Value:"America/Miquelon",Text:"(UTC-03:00) Miquelon"},{Value:"America/Montevideo",Text:"(UTC-03:00) Montevideo"},{Value:"Antarctica/Palmer",Text:"(UTC-03:00) Palmer"},{Value:"America/Paramaribo",Text:"(UTC-03:00) Paramaribo"},{Value:"America/Punta_Arenas",Text:"(UTC-03:00) Punta Arenas"},{Value:"America/Recife",Text:"(UTC-03:00) Recife"},{Value:"Antarctica/Rothera",Text:"(UTC-03:00) Rothera"},{Value:"America/Bahia",Text:"(UTC-03:00) Salvador"},{Value:"America/Santiago",Text:"(UTC-03:00) Santiago"},{Value:"Atlantic/Stanley",Text:"(UTC-03:00) Stanley"},{Value:"America/Noronha",Text:"(UTC-02:00) Noronha"},{Value:"America/Sao_Paulo",Text:"(UTC-02:00) Sao Paulo"},{Value:"Atlantic/South_Georgia",Text:"(UTC-02:00) South Georgia"},{Value:"Atlantic/Azores",Text:"(UTC-01:00) Azores"},{Value:"Atlantic/Cape_Verde",Text:"(UTC-01:00) Cape Verde"},{Value:"America/Scoresbysund",Text:"(UTC-01:00) Scoresbysund"},{Value:"Africa/Abidjan",Text:"(UTC+00:00) Abidjan"},{Value:"Africa/Accra",Text:"(UTC+00:00) Accra"},{Value:"Africa/Bissau",Text:"(UTC+00:00) Bissau"},{Value:"Atlantic/Canary",Text:"(UTC+00:00) Canary Islands"},{Value:"Africa/Casablanca",Text:"(UTC+00:00) Casablanca"},{Value:"America/Danmarkshavn",Text:"(UTC+00:00) Danmarkshavn"},{Value:"Europe/Dublin",Text:"(UTC+00:00) Dublin"},{Value:"Africa/El_Aaiun",Text:"(UTC+00:00) El Aaiun"},{Value:"Atlantic/Faroe",Text:"(UTC+00:00) Faeroe"},{Value:"Etc/UTC",Text:"(UTC+00:00) UTC (no daylight saving)"},{Value:"Europe/Lisbon",Text:"(UTC+00:00) Lisbon"},{Value:"Europe/London",Text:"(UTC+00:00) London"},{Value:"Africa/Monrovia",Text:"(UTC+00:00) Monrovia"},{Value:"Atlantic/Reykjavik",Text:"(UTC+00:00) Reykjavik"},{Value:"UTC",Text:"UTC"},{Value:"Africa/Algiers",Text:"(UTC+01:00) Algiers"},{Value:"Europe/Amsterdam",Text:"(UTC+01:00) Amsterdam"},{Value:"Europe/Andorra",Text:"(UTC+01:00) Andorra"},{Value:"Europe/Berlin",Text:"(UTC+01:00) Berlin"},{Value:"Europe/Brussels",Text:"(UTC+01:00) Brussels"},{Value:"Europe/Budapest",Text:"(UTC+01:00) Budapest"},{Value:"Europe/Belgrade",Text:"(UTC+01:00) Central European Time - Belgrade"},{Value:"Europe/Prague",Text:"(UTC+01:00) Central European Time - Prague"},{Value:"Africa/Ceuta",Text:"(UTC+01:00) Ceuta"},{Value:"Europe/Copenhagen",Text:"(UTC+01:00) Copenhagen"},{Value:"Europe/Gibraltar",Text:"(UTC+01:00) Gibraltar"},{Value:"Africa/Lagos",Text:"(UTC+01:00) Lagos"},{Value:"Europe/Luxembourg",Text:"(UTC+01:00) Luxembourg"},{Value:"Europe/Madrid",Text:"(UTC+01:00) Madrid"},{Value:"Europe/Malta",Text:"(UTC+01:00) Malta"},{Value:"Europe/Monaco",Text:"(UTC+01:00) Monaco"},{Value:"Africa/Ndjamena",Text:"(UTC+01:00) Ndjamena"},{Value:"Europe/Oslo",Text:"(UTC+01:00) Oslo"},{Value:"Europe/Paris",Text:"(UTC+01:00) Paris"},{Value:"Europe/Rome",Text:"(UTC+01:00) Rome"},{Value:"Europe/Stockholm",Text:"(UTC+01:00) Stockholm"},{Value:"Europe/Tirane",Text:"(UTC+01:00) Tirane"},{Value:"Africa/Tunis",Text:"(UTC+01:00) Tunis"},{Value:"Europe/Vienna",Text:"(UTC+01:00) Vienna"},{Value:"Europe/Warsaw",Text:"(UTC+01:00) Warsaw"},{Value:"Europe/Zurich",Text:"(UTC+01:00) Zurich"},{Value:"Asia/Amman",Text:"(UTC+02:00) Amman"},{Value:"Europe/Athens",Text:"(UTC+02:00) Athens"},{Value:"Asia/Beirut",Text:"(UTC+02:00) Beirut"},{Value:"Europe/Bucharest",Text:"(UTC+02:00) Bucharest"},{Value:"Africa/Cairo",Text:"(UTC+02:00) Cairo"},{Value:"Europe/Chisinau",Text:"(UTC+02:00) Chisinau"},{Value:"Asia/Damascus",Text:"(UTC+02:00) Damascus"},{Value:"Asia/Gaza",Text:"(UTC+02:00) Gaza"},{Value:"Europe/Helsinki",Text:"(UTC+02:00) Helsinki"},{Value:"Asia/Jerusalem",Text:"(UTC+02:00) Jerusalem"},{Value:"Africa/Johannesburg",Text:"(UTC+02:00) Johannesburg"},{Value:"Africa/Khartoum",Text:"(UTC+02:00) Khartoum"},{Value:"Europe/Kiev",Text:"(UTC+02:00) Kiev"},{Value:"Africa/Maputo",Text:"(UTC+02:00) Maputo"},{Value:"Europe/Kaliningrad",Text:"(UTC+02:00) Moscow-01 - Kaliningrad"},{Value:"Asia/Nicosia",Text:"(UTC+02:00) Nicosia"},{Value:"Europe/Riga",Text:"(UTC+02:00) Riga"},{Value:"Europe/Sofia",Text:"(UTC+02:00) Sofia"},{Value:"Europe/Tallinn",Text:"(UTC+02:00) Tallinn"},{Value:"Africa/Tripoli",Text:"(UTC+02:00) Tripoli"},{Value:"Europe/Vilnius",Text:"(UTC+02:00) Vilnius"},{Value:"Africa/Windhoek",Text:"(UTC+02:00) Windhoek"},{Value:"Asia/Baghdad",Text:"(UTC+03:00) Baghdad"},{Value:"Europe/Istanbul",Text:"(UTC+03:00) Istanbul"},{Value:"Europe/Minsk",Text:"(UTC+03:00) Minsk"},{Value:"Europe/Moscow",Text:"(UTC+03:00) Moscow+00 - Moscow"},{Value:"Africa/Nairobi",Text:"(UTC+03:00) Nairobi"},{Value:"Asia/Qatar",Text:"(UTC+03:00) Qatar"},{Value:"Asia/Riyadh",Text:"(UTC+03:00) Riyadh"},{Value:"Antarctica/Syowa",Text:"(UTC+03:00) Syowa"},{Value:"Asia/Tehran",Text:"(UTC+03:30) Tehran"},{Value:"Asia/Baku",Text:"(UTC+04:00) Baku"},{Value:"Asia/Dubai",Text:"(UTC+04:00) Dubai"},{Value:"Indian/Mahe",Text:"(UTC+04:00) Mahe"},{Value:"Indian/Mauritius",Text:"(UTC+04:00) Mauritius"},{Value:"Europe/Samara",Text:"(UTC+04:00) Moscow+01 - Samara"},{Value:"Indian/Reunion",Text:"(UTC+04:00) Reunion"},{Value:"Asia/Tbilisi",Text:"(UTC+04:00) Tbilisi"},{Value:"Asia/Yerevan",Text:"(UTC+04:00) Yerevan"},{Value:"Asia/Kabul",Text:"(UTC+04:30) Kabul"},{Value:"Asia/Aqtau",Text:"(UTC+05:00) Aqtau"},{Value:"Asia/Aqtobe",Text:"(UTC+05:00) Aqtobe"},{Value:"Asia/Ashgabat",Text:"(UTC+05:00) Ashgabat"},{Value:"Asia/Dushanbe",Text:"(UTC+05:00) Dushanbe"},{Value:"Asia/Karachi",Text:"(UTC+05:00) Karachi"},{Value:"Indian/Kerguelen",Text:"(UTC+05:00) Kerguelen"},{Value:"Indian/Maldives",Text:"(UTC+05:00) Maldives"},{Value:"Antarctica/Mawson",Text:"(UTC+05:00) Mawson"},{Value:"Asia/Yekaterinburg",Text:"(UTC+05:00) Moscow+02 - Yekaterinburg"},{Value:"Asia/Tashkent",Text:"(UTC+05:00) Tashkent"},{Value:"Asia/Colombo",Text:"(UTC+05:30) Colombo"},{Value:"Asia/Kolkata",Text:"(UTC+05:30) India Standard Time"},{Value:"Asia/Katmandu",Text:"(UTC+05:45) Katmandu"},{Value:"Asia/Almaty",Text:"(UTC+06:00) Almaty"},{Value:"Asia/Bishkek",Text:"(UTC+06:00) Bishkek"},{Value:"Indian/Chagos",Text:"(UTC+06:00) Chagos"},{Value:"Asia/Dhaka",Text:"(UTC+06:00) Dhaka"},{Value:"Asia/Omsk",Text:"(UTC+06:00) Moscow+03 - Omsk"},{Value:"Asia/Thimphu",Text:"(UTC+06:00) Thimphu"},{Value:"Antarctica/Vostok",Text:"(UTC+06:00) Vostok"},{Value:"Indian/Cocos",Text:"(UTC+06:30) Cocos"},{Value:"Asia/Yangon",Text:"(UTC+06:30) Rangoon"},{Value:"Asia/Bangkok",Text:"(UTC+07:00) Bangkok"},{Value:"Indian/Christmas",Text:"(UTC+07:00) Christmas"},{Value:"Antarctica/Davis",Text:"(UTC+07:00) Davis"},{Value:"Asia/Saigon",Text:"(UTC+07:00) Hanoi"},{Value:"Asia/Hovd",Text:"(UTC+07:00) Hovd"},{Value:"Asia/Jakarta",Text:"(UTC+07:00) Jakarta"},{Value:"Asia/Krasnoyarsk",Text:"(UTC+07:00) Moscow+04 - Krasnoyarsk"},{Value:"Asia/Brunei",Text:"(UTC+08:00) Brunei"},{Value:"Asia/Shanghai",Text:"(UTC+08:00) China Time - Beijing"},{Value:"Asia/Choibalsan",Text:"(UTC+08:00) Choibalsan"},{Value:"Asia/Hong_Kong",Text:"(UTC+08:00) Hong Kong"},{Value:"Asia/Kuala_Lumpur",Text:"(UTC+08:00) Kuala Lumpur"},{Value:"Asia/Macau",Text:"(UTC+08:00) Macau"},{Value:"Asia/Makassar",Text:"(UTC+08:00) Makassar"},{Value:"Asia/Manila",Text:"(UTC+08:00) Manila"},{Value:"Asia/Irkutsk",Text:"(UTC+08:00) Moscow+05 - Irkutsk"},{Value:"Asia/Singapore",Text:"(UTC+08:00) Singapore"},{Value:"Asia/Taipei",Text:"(UTC+08:00) Taipei"},{Value:"Asia/Ulaanbaatar",Text:"(UTC+08:00) Ulaanbaatar"},{Value:"Australia/Perth",Text:"(UTC+08:00) Western Time - Perth"},{Value:"Asia/Pyongyang",Text:"(UTC+08:30) Pyongyang"},{Value:"Asia/Dili",Text:"(UTC+09:00) Dili"},{Value:"Asia/Jayapura",Text:"(UTC+09:00) Jayapura"},{Value:"Asia/Yakutsk",Text:"(UTC+09:00) Moscow+06 - Yakutsk"},{Value:"Pacific/Palau",Text:"(UTC+09:00) Palau"},{Value:"Asia/Seoul",Text:"(UTC+09:00) Seoul"},{Value:"Asia/Tokyo",Text:"(UTC+09:00) Tokyo"},{Value:"Australia/Darwin",Text:"(UTC+09:30) Central Time - Darwin"},{Value:"Antarctica/DumontDUrville",Text:'(UTC+10:00) Dumont D"Urville'},{Value:"Australia/Brisbane",Text:"(UTC+10:00) Eastern Time - Brisbane"},{Value:"Pacific/Guam",Text:"(UTC+10:00) Guam"},{Value:"Asia/Vladivostok",Text:"(UTC+10:00) Moscow+07 - Vladivostok"},{Value:"Pacific/Port_Moresby",Text:"(UTC+10:00) Port Moresby"},{Value:"Pacific / Chuuk",Text:"(UTC+10:00) Truk"},{Value:"Australia/Adelaide",Text:"(UTC+10:30) Central Time - Adelaide"},{Value:"Antarctica/Casey",Text:"(UTC+11:00) Casey"},{Value:"Australia/Hobart",Text:"(UTC+11:00) Eastern Time - Hobart"},{Value:"Australia/Sydney",Text:"(UTC+11:00) Eastern Time - Melbourne, Sydney"},{Value:"Pacific/Efate",Text:"(UTC+11:00) Efate"},{Value:"Pacific/Guadalcanal",Text:"(UTC+11:00) Guadalcanal"},{Value:"Pacific/Kosrae",Text:"(UTC+11:00) Kosrae"},{Value:"Asia/Magadan",Text:"(UTC+11:00) Moscow+08 - Magadan"},{Value:"Pacific / Norfolk",Text:"(UTC+11:00) Norfolk"},{Value:"Pacific/Noumea",Text:"(UTC+11:00) Noumea"},{Value:"Pacific/Pohnpei",Text:"(UTC+11:00) Ponape"},{Value:"Pacific/Funafuti",Text:"(UTC+12:00) Funafuti"},{Value:"Pacific/Kwajalein",Text:"(UTC+12:00) Kwajalein"},{Value:"Pacific/Majuro",Text:"(UTC+12:00) Majuro"},{Value:"Asia/Kamchatka",Text:"(UTC+12:00) Moscow+09 - Petropavlovsk - Kamchatskiy"},{Value:"Pacific / Nauru",Text:"(UTC+12:00) Nauru"},{Value:"Pacific/Tarawa",Text:"(UTC+12:00) Tarawa"},{Value:"Pacific/Wake",Text:"(UTC+12:00) Wake"},{Value:"Pacific/Wallis",Text:"(UTC+12:00) Wallis"},{Value:"Pacific/Auckland",Text:"(UTC+13:00) Auckland"},{Value:"Pacific/Enderbury",Text:"(UTC+13:00) Enderbury"},{Value:"Pacific/Fakaofo",Text:"(UTC+13:00) Fakaofo"},{Value:"Pacific/Fiji",Text:"(UTC+13:00) Fiji"},{Value:"Pacific/Tongatapu",Text:"(UTC+13:00) Tongatapu"},{Value:"Pacific/Apia",Text:"(UTC+14:00) Apia"},{Value:"Pacific/Kiritimati",Text:"(UTC+14:00) Kiritimati"}];function ra(e,t,i,n){void 0===n&&(n="Gregorian");var r,a,s,o=xa(e),l=t.getConstant("every")+" ",e=n.toLowerCase();switch(a="en"===i||"en-US"===i?(s="days.stand-alone.abbreviated",r=B.getValue("months.stand-alone.abbreviated",B.getDefaultDateObject(e)),B.getValue(s,B.getDefaultDateObject(e))):(s="main."+i+".dates.calendars."+e+".days.stand-alone.abbreviated",r=B.getValue("main."+i+".dates.calendars."+e+".months.stand-alone.abbreviated",B.cldrData),B.getValue(s,B.cldrData)),1<o.interval&&(l+=o.interval+" "),o.freq){case"DAILY":l+=t.getConstant("summaryDay");break;case"WEEKLY":l+=t.getConstant("summaryWeek")+" "+t.getConstant(La)+" ",o.day.forEach(function(e,t){l=(l+=y(B.getValue(qa[""+e],a),"single"))+(o.day.length-1===t?"":", ")});break;case"MONTHLY":l=(l+=t.getConstant("summaryMonth")+" "+t.getConstant(La)+" ")+aa(o,a,t);break;case"YEARLY":l=(l=(l+=t.getConstant("summaryYear")+" "+t.getConstant(La)+" ")+(y(B.getValue(o.month[0].toString(),r),"single")+" "))+aa(o,a,t)}return o.count?l+=", "+o.count+" "+t.getConstant("summaryTimes"):o.until&&(n=o.until,l+=", "+t.getConstant("summaryUntil")+" "+n.getDate()+" "+y(B.getValue((n.getMonth()+1).toString(),r),"single")+" "+n.getFullYear()),l}function aa(e,t,i){var n,r="";return e.monthDay.length?r+=e.monthDay[0]:e.day&&(n=e.setPosition-1,r+=i.getConstant(Na[-1<n?n:Na.length-1])+" "+y(B.getValue(qa[e.day[0]],t),"single")),r}function sa(e,t,i,n,r,a,s,o){void 0===r&&(r=43),void 0===a&&(a=null),void 0===s&&(s="Gregorian"),void 0===o&&(o=null);var l=xa(t),p=(_=Ia(s),[]),c=new Date(e.getTime()),t=(Ma=[],B.isNullOrUndefined(i)?[]:i.split(",")),j=new ta;if(t.forEach(function(e){e=oa(e);o&&(e=j.add(new Date(e.getTime()),o)),Ma.push(new Date(e.getTime()).setHours(0,0,0,0))}),l.recExceptionCount=B.isNullOrUndefined(l.count)?0:Ma.length,Ra=a&&e<a&&!l.count?new Date(new Date(a.getTime()).setHours(0,0,0)):null,!l.until&&Ra&&((s=new Date(Ra.getTime())).setDate(Ra.getDate()+r*l.interval),l.until=s),!(l.until&&e>l.until)){ka=r,n=n||0;for(var N=ja[parseInt(n.toString(),10)];Pa[0]!==N;){h=void 0;d=void 0;var h=Pa;var d=h.shift();h.push(d)}switch(l.until&&(i=z(l.until),l.until=new Date(i.getFullYear(),i.getMonth(),i.getDate(),23,59,59)),l.freq){case"DAILY":for(var u=c,L=l.until,g=p,m=l,v=new Date(u.getTime()),q=m.interval,f=pa(u,m),y=m.day;Ca(v,L)&&!(Aa(v,m)&&(-1<y.indexOf(ja[v.getDay()])||0===y.length)&&(la(g,v.getTime()),f)&&g.length+m.recExceptionCount>=f);)v.setDate(v.getDate()+q),v.getHours()!==u.getHours()&&v.setHours(u.getHours());break;case"WEEKLY":var T=c,w=l.until,D=p,b=l,F=n,S=new Date(T.getTime());b.day.length||b.day.push(ja[T.getDay()]);var C,O=b.interval,E=b.day,x=pa(T,b),U=!0,V=[];if(1<E.length)for(!B.isNullOrUndefined(b.wkst)&&""!==b.wkst||(b.wkst=Pa[0]),C=ja.indexOf(b.wkst);Ca(S,w);){var A=ja.indexOf(ja[S.getDay()])-C,A=Y(S,-(A=-1==A?6:A)),I=Y(A,6),M=new Date(S.getTime());for(I=z(I),M=z(M);M<=I&&(-1<E.indexOf(ja[S.getDay()])&&V.push([S.getTime()]),!(x&&D.length+b.recExceptionCount>=x));)S.setDate(S.getDate()+1),S.getHours()!==T.getHours()&&S.setHours(T.getHours()),M=z(M=new Date(S.getTime()));if(S.setDate(S.getDate()-1),x&&D.length+b.recExceptionCount>=x)break;S.setDate(S.getDate()+1+7*(O-1)),fa(V,0,T,w,D,b),V=[]}else{for(S=Ea(T,b.day),1<O&&Pa.indexOf(b.day[0])<T.getDay()-F&&S.setDate(S.getDate()+7*(O-1));Ca(S,w)&&((U=Aa(S,b))&&-1<E.indexOf(ja[S.getDay()])&&la(D,S.getTime()),!(x&&D.length+b.recExceptionCount>=x));)S.setDate(S.getDate()+7*O);fa(V,0,T,w,D,b),V=[]}break;case"MONTHLY":ca(c,l.until,p,l);break;case"YEARLY":var k=c,R=l.until,H=p,P=l;switch(function(e){{if(e.yearDay.length)return"YEARDAY";if(e.weekNo.length)return"WEEKNO"}return"MONTH"}(P)){case"MONTH":ca(k,R,H,P);break;case"WEEKNO":!function(e,t,i,n){var r,a,s,o,l,p,c=_.getYearLastDate(e,0),h=pa(e,n),d=n.weekNo,u=[],g=n.day;for(;Ca(c,t);){a=Pa.indexOf(ja[c.getDay()]),s=6-a+1;for(var m=0;m<d.length;m++)for(o=d[parseInt(m.toString(),10)],l=1===(o=0<o?o:53+o+1)?s:s+7*(o-1),p=1===o?s-7:s+7*(o-2);p<l;)r=new Date(c.getTime()+W*p),(0===g.length||-1<g.indexOf(ja[r.getDay()]))&&(B.isNullOrUndefined(n.setPosition)?Da(0,e,t,i,n,r.getTime()):u.push([r.getTime()])),p++;if(B.isNullOrUndefined(n.setPosition)||Sa(u,0,e,t,i,n),h&&i.length+n.recExceptionCount>=h)return;c=_.getYearLastDate(r,n.interval),u=[]}}(k,R,H,P);break;case"YEARDAY":!function(e,t,i,n){var r,a,s=_.getYearLastDate(e,0),o=pa(e,n),l=[],p=n.day;for(;Ca(s,t);){for(var c=0;c<n.yearDay.length;c++)a=n.yearDay[parseInt(c.toString(),10)],r=new Date(s.getTime()),a!==_.getLeapYearDaysCount()&&a!==-_.getLeapYearDaysCount()||_.isLeapYear(_.getFullYear(r),1)?(r.setDate(r.getDate()+(a<0?_.getYearDaysCount(r,1)+1+a:a)),(0===p.length||-1<p.indexOf(ja[r.getDay()]))&&(null==n.setPosition?Da(0,e,t,i,n,r.getTime()):l.push([r.getTime()]))):r.setDate(r.getDate()+1);if(B.isNullOrUndefined(n.setPosition)||Sa(l,0,e,t,i,n),o&&i.length+n.recExceptionCount>=o)return;s=_.getYearLastDate(r,n.interval),l=[]}}(k,R,H,P)}}}return p}function oa(e){return new Date(e.substr(0,4)+"-"+e.substr(4,2)+"-"+e.substr(6,5)+":"+e.substr(11,2)+":"+e.substr(13))}function la(e,t){var i=new Date(t).setHours(0,0,0,0);-1===Ma.indexOf(i)&&(!Ra||i>=Ra.getTime())&&e.push(t)}function pa(e,t){var i=ka;return t.count?i=t.count:t.until&&("DAILY"===t.freq||"WEEKLY"===t.freq?i=Math.floor((t.until.getTime()-e.getTime())/W)+1:"MONTHLY"!==t.freq&&"YEARLY"!==t.freq||(i=Math.floor((t.until.getMonth()+12*t.until.getFullYear()-(e.getMonth()+12*e.getFullYear()))/t.interval)+(1<t.day.length?Math.floor((t.until.getTime()-e.getTime())/W)+1:1),"YEARLY"===t.freq&&(i=1<t.month.length?i*t.month.length:i))),i}function ca(e,t,i,n){switch(n.month.length||n.day.length||n.monthDay.length?0<n.month.length&&!n.day.length&&!n.monthDay.length&&n.monthDay.push(e.getDate()):(n.monthDay.push(e.getDate()),"YEARLY"===n.freq&&n.month.push(e.getMonth()+1)),function(e){{if(e.monthDay.length&&!e.day.length)return"date";if(!e.monthDay.length&&e.day.length)return"day"}return"both"}(n)){case"day":switch(n.freq){case"MONTHLY":va(e,t,i,n);break;case"YEARLY":!function(e,t,i,n){var r=n.day,a=r.map(function(e){return Fa.test(e)});if(1<r.length&&-1<a.indexOf(!0)){var s,o,l,p=e,c=t,h=i,d=n,u=d.day,g=pa(p,d),m=new Date(p.getTime()),v=d.interval,f=[],y=[],T=0,w=(m=_.getMonthStartDate(m),[]);for(d.month.length&&_.setMonth(m,d.month[0],1),m=Ea(m,d.day);Ca(m,c);){o=new Date(m.getTime());for(var D=0;D<=d.month.length;D++)for(var b=0;b<=u.length-1;b++){for(m=Ea(m=_.getMonthStartDate(m),d.day),f=[];_.isSameYear(o,m)&&g&&h.length+d.recExceptionCount<=g;)for(;_.isSameYear(o,m);){if(o=new Date(m.getTime()),0===d.month.length||0<d.month.length&&d.month[parseInt(D.toString(),10)]===_.getMonth(o)){var S=u[parseInt(b.toString(),10)].match(Ba),C=parseInt(S[0],10);for(l=new Date(m.getTime());_.isSameYear(l,m)&&_.isSameMonth(l,m);)S[S.length-1]===ja[l.getDay()]&&f.push([l.getTime()]),l.setDate(l.getDate()+1);l.setDate(l.getDate()-1),s=-1<S[0].indexOf("-")?f.length- -1*C:C-1,s=isNaN(s)?0:s}T=ga(m,d,T,void 0,1),m=Ea(m,d.day)}if(m=0===b&&l?new Date(l.getTime()):new Date(o.getTime()),0<f.length&&(B.isNullOrUndefined(d.setPosition)?Sa(f,0,p,c,h,d,s):y=[wa(f,s,w)]),g&&h.length+d.recExceptionCount>=g)return}B.isNullOrUndefined(d.setPosition)||(ba(y,0,p,c,h,d),w=[]),_.isLastMonth(m)?(_.setValidDate(m,1,1),m.setFullYear(m.getFullYear()+v-1)):m.setFullYear(m.getFullYear()+v),m=Ea(m,d.day),d.month.length&&_.setMonth(m,d.month[0],m.getDate())}}else if(n.month.length&&1===r.length&&-1<a.indexOf(!0))va(e,t,i,n);else{var O,E=new Date(e.getTime()),x=pa(e,n),V=n.interval,A=[];for(n.month.length&&_.setMonth(E,n.month[0],E.getDate()),B.isNullOrUndefined(n.setPosition)&&0===n.month.length&&0===n.weekNo.length&&E.setFullYear(e.getFullYear(),0,1),E=Ea(E=_.getMonthStartDate(E),n.day);Ca(E,t);){for(O=new Date(E.getTime());_.isSameYear(O,E)&&x&&i.length+n.recExceptionCount<=x;)for(O=new Date(E.getTime());_.isSameYear(O,E);){if(!(0===n.month.length||0<n.month.length&&!_.checkMonth(E,n.month))){_.setValidDate(E,1,1),E=Ea(E,n.day);break}if(1<r.length){if(_.compareMonth(O,E)){_.setValidDate(E,1,1),E=Ea(E,n.day);break}-1<r.indexOf(ja[O.getDay()])&&A.push([O.getTime()]),O.setDate(O.getDate()+1)}else{if(O.getFullYear()>E.getFullYear()){_.setValidDate(E,1,1),E=Ea(E,n.day);break}var I=Oa(r[0]);ja[O.getDay()]===I&&new Date(O.getFullYear(),O.getMonth(),0)>new Date(e.getFullYear())&&A.push([O.getTime()]),O.setDate(O.getDate()+7)}}if(E.setFullYear(O.getFullYear(),O.getMonth(),O.getDate()),Ta(A,e,t,i,n),_.isLastMonth(E)&&(_.setValidDate(E,1,1),E=Ea(E,n.day)),E.setFullYear(E.getFullYear()+V-1),x&&i.length+n.recExceptionCount>=x)return;E=Ea(E,n.day),A=[]}}}(e,t,i,n)}break;case"both":case"date":switch(n.freq){case"MONTHLY":da(e,t,i,n);break;case"YEARLY":!function(e,t,i,n){if(n.month.length)da(e,t,i,n);else{var r,a=ha(e,n);for(a.tempDate=a.mainDate=_.getMonthStartDate(a.tempDate);Ca(a.tempDate,t);){for(r=new Date(a.tempDate.getTime());_.isSameYear(r,a.tempDate)&&a.expectedCount&&i.length+n.recExceptionCount<=a.expectedCount;){if(!(0===n.month.length||0<n.month.length&&!_.checkMonth(a.tempDate,n.month))){_.setValidDate(a.tempDate,1,1),a.tempDate=Ea(a.tempDate,n.day);break}ua(n,a,t,!1),a.beginDate=new Date(a.tempDate.getTime()),a.monthInit=ga(a.tempDate,n,a.monthInit,a.beginDate)}if(a.tempDate.setFullYear(r.getFullYear(),r.getMonth(),r.getDate()),fa(a.dateCollection,a.state,e,t,i,n),_.isLastMonth(a.tempDate)&&(_.setValidDate(a.tempDate,1,1),a.tempDate=Ea(a.tempDate,n.day)),a.expectedCount&&i.length+n.recExceptionCount>=a.expectedCount)return;a.tempDate.setFullYear(a.tempDate.getFullYear()+n.interval-1),a.tempDate=Ea(a.tempDate,n.day),a.monthInit=ga(a.tempDate,n,a.monthInit,a.beginDate),a.dateCollection=[]}}}(e,t,i,n)}}}function ha(e,t){e={monthCollection:[],index:0,tempDate:new Date(e.getTime()),mainDate:new Date(e.getTime()),expectedCount:pa(e,t),monthInit:0,dateCollection:[]};return t.month.length&&_.setMonth(e.tempDate,t.month[0],e.tempDate.getDate()),e}function da(e,t,i,n){var r=ha(e,n);if(r.tempDate=r.mainDate=_.getMonthStartDate(r.tempDate),!(("MONTHLY"===n.freq&&12===n.interval||"YEARLY"===n.freq)&&_.getMonthDaysCount(e)<n.monthDay[0]))for(;Ca(r.tempDate,t);){if(r.beginDate=new Date(r.tempDate.getTime()),ua(n,r,t,!0,e,i),B.isNullOrUndefined(n.setPosition)||Sa(r.dateCollection,r.state,e,t,i,n),r.expectedCount&&i.length+n.recExceptionCount>=r.expectedCount)return;r.monthInit=ga(r.tempDate,n,r.monthInit,r.beginDate),r.dateCollection=[]}}function ua(e,t,i,n,r,a){for(var s,o,l,p=0;p<e.monthDay.length;p++){t.date=e.monthDay[parseInt(p.toString(),10)],t.tempDate=_.getMonthStartDate(t.tempDate);var c=_.getMonthDaysCount(t.tempDate);if(t.date=0<t.date?t.date:c+t.date+1,c=t.tempDate,s=t.date,o=t.mainDate,l=void 0,l=_.getMonthDaysCount(c),s<=l&&o<=c&&0<t.date){if(_.setDate(t.tempDate,t.date),i&&t.tempDate>i)return;(0===e.day.length||-1<e.day.indexOf(ja[t.tempDate.getDay()]))&&(n&&B.isNullOrUndefined(e.setPosition)&&t.expectedCount&&a.length+e.recExceptionCount<t.expectedCount?Da(t.state,r,i,a,e,t.tempDate.getTime()):t.dateCollection.push([t.tempDate.getTime()]))}}}function ga(e,t,i,n,r){var a=(n=void 0===n?null:n)?n.getMonth():0,s=_.getMonthStartDate(e);return r=B.isNullOrUndefined(r)?t.interval:r,e.setFullYear(s.getFullYear()),e.setMonth(s.getMonth()),e.setDate(s.getDate()),t.month.length?(i++,i%=t.month.length,_.setMonth(e,t.month[parseInt(i.toString(),10)],1),0===i&&_.addYears(e,r,t.month[0])):(n&&n.getFullYear()<e.getFullYear()&&(a=e.getMonth()-1),_.setValidDate(e,r,1,a,n)),i}function ma(e,t,i,n){var r,a=n.day,s=new Date(e.getTime()),o=(s=_.getMonthStartDate(s),[]),l=[],p=[],c=pa(e,n),h=0;for(n.month.length&&_.setMonth(s,n.month[0],1),s=Ea(s,n.day);Ca(s,t)&&c&&i.length+n.recExceptionCount<c;){var d=new Date(s.getTime());if(-1<a.map(function(e){return Fa.test(e)}).indexOf(!0)){for(var u=0;u<=a.length-1;u++){var g=a[parseInt(u.toString(),10)].match(Ba),m=parseInt(g[0],10),s=new Date(s.getTime());for(s=Ea(s=_.getMonthStartDate(s),a),d.setFullYear(s.getFullYear(),s.getMonth(),s.getDate());_.isSameYear(d,s)&&_.isSameMonth(d,s);)g[g.length-1]===ja[d.getDay()]&&o.push([d.getTime()]),d.setDate(d.getDate()+1);if(d.setDate(d.getDate()-1),w=-1<g[0].indexOf("-")?o.length- -1*m:m-1,w=isNaN(w)?0:w,0<o.length&&(B.isNullOrUndefined(n.setPosition)?Sa(o,0,e,t,i,n,w):l=[wa(o,w,p)]),c&&i.length+n.recExceptionCount>=c)return;o=[]}B.isNullOrUndefined(n.setPosition)||(ba(l,0,e,t,i,n),p=[])}else{for(var v=[],f=function(r){var a={};return r.forEach(function(e,t){if(t===r.length-1){for(var i=Pa.indexOf(e),n=i;n%7!==Pa.indexOf(r[0]);)n++;a[""+e]=n-i}else a[""+e]=Pa.indexOf(r[t+1])-Pa.indexOf(e)}),a}(a),y=(d.setFullYear(s.getFullYear(),s.getMonth(),s.getDate()),new Date(s.getTime())),T=new Date(s.getTime());_.isSameMonth(y,s);)v.push(s.getTime()),-1<a.indexOf(ja[s.getDay()])&&(o.push(v),v=[]),s.setDate(s.getDate()+f[ja[s.getDay()]]);if(w=n.setPosition<1?o.length+n.setPosition:n.setPosition-1,B.isNullOrUndefined(n.setPosition)){for(var w=0,D=[],b=0;b<o.length;b++)for(var S=0;S<o[parseInt(b.toString(),10)].length;S++)D.push(o[parseInt(b.toString(),10)][parseInt(S.toString(),10)]);o=[D]}if(0<o.length&&Sa(o,0,e,t,i,n,w),c&&i.length+n.recExceptionCount>=c)return}h=ga(s,n,h,T),s=Ea(s,n.day),o=[]}}function va(e,t,i,n){if(1<n.day.length)ma(e,t,i,n);else{var r=new Date(e.getTime()),a=pa(e,n),s=[],o=0,r=_.getMonthStartDate(r);for(n.month.length&&_.setMonth(r,n.month[0],1),r=Ea(r,n.day);Ca(r,t)&&a&&i.length+n.recExceptionCount<a;){for(var l=new Date(r.getTime()),p=new Date(r.getTime());_.isSameMonth(r,p);)s.push([p.getTime()]),p.setDate(p.getDate()+7);Ta(s,e,t,i,n),o=ga(r,n,o,l),r=Ea(r,n.day),s=[]}}}function fa(e,t,i,n,r,a){var s=a.setPosition<1?e.length+a.setPosition:a.setPosition-1;B.isNullOrUndefined(a.setPosition)&&(s=0,e=ya(e)),0<e.length&&Sa(e,0,i,n,r,a,s)}function ya(e){for(var t=[],i=0;i<e.length;i++)for(var n=0;n<e[parseInt(i.toString(),10)].length;n++)t.push(new Date(e[parseInt(i.toString(),10)][parseInt(n.toString(),10)]).getTime());return e=0<t.length?[t]:[]}function Ta(e,t,i,n,r){var a,s,o,l=r.day,l=(a=e,o={monthCollection:[],index:0},1===(l=l).length&&(p=void 0,1<(l=l[0].match(Ba)).length)?s=(p=parseInt(l[0],10))<1?a.length+p:p-1:(s=0,a=ya(a)),o.monthCollection=a,o.index=s,o),p=(e=l.monthCollection,l.index);null!=r.setPosition?ba([wa(e,p,[])],0,t,i,n,r):0<e.length&&Sa(e,0,t,i,n,r,p)}function wa(e,t,i){for(var n=0;n<e[parseInt(t.toString(),10)].length;n++)i.push(e[parseInt(t.toString(),10)][parseInt(n.toString(),10)]);return i}function Da(e,t,i,n,r,a){var s=pa(t,r),o=new Date(a);e=Aa(o,r),t<=o&&Ca(o,i)&&e&&s&&n.length+r.recExceptionCount<s&&la(n,a)}function ba(e,t,i,n,r,a){if(0<e.length)for(var s=0;s<e.length;s++){e[parseInt(s.toString(),10)].sort();var o=a.day.map(function(e){return Fa.test(e)}),o="YEARLY"===a.freq&&-1<a.validRules.indexOf("BYMONTH")&&!(-1<o.indexOf(!0))?(o=new Date(e[0][0]).getFullYear(),l=e,c=s,h=a,d=void(p=0),p=p||0,d=new Date(o,h.month[0]-1,1),o=new Date(o,h.month[0],0).getDate(),d=(d.getDay()-p+7)%7,p=Math.ceil((d+o)/7)-1,d=l[parseInt(c.toString(),10)][parseInt(p.toString(),10)],Aa(new Date(d),h)?p:p-1):e[parseInt(s.toString(),10)].length+a.setPosition,l=a.setPosition<1?o:a.setPosition-1;Da(0,i,n,r,a,e[parseInt(s.toString(),10)][parseInt(l.toString(),10)])}var p,l,c,h,d}function Sa(e,t,i,n,r,a,s){if(0<e.length){s=B.isNullOrUndefined(s)?a.setPosition<1?e.length+a.setPosition:a.setPosition-1:s,e[parseInt(s.toString(),10)].sort();for(var o=0;o<e[parseInt(s.toString(),10)].length;o++)Da(0,i,n,r,a,e[parseInt(s.toString(),10)][parseInt(o.toString(),10)])}}function Ca(e,t){return!t||e<=t}function Oa(e){return e.replace(Ua,"")}function Ea(e,t){var i,n=new Date(e.getTime());if(0<t.length){for(var r=[],a=0;a<=t.length-1;a++)i=Oa(t[parseInt(a.toString(),10)]),r.push(i);if(-1===r.indexOf(ja[n.getDay()]))for(;n.setDate(n.getDate()+1),-1===r.indexOf(ja[n.getDay()]););}return n}function xa(e){var t,i={freq:null,interval:1,count:null,until:null,day:[],wkst:null,month:[],weekNo:[],monthDay:[],yearDay:[],setPosition:null,validRules:[]},e=e.split(";"),n=[];return e.forEach(function(e){switch((n=e.split("="))[0]){case"UNTIL":t=n[1],i.until=oa(t);break;case"BYDAY":i.day=n[1].split(","),i.validRules.push(n[0]);break;case"BYMONTHDAY":i.monthDay=n[1].split(",").map(Number),i.validRules.push(n[0]);break;case"BYMONTH":i.month=n[1].split(",").map(Number),i.validRules.push(n[0]);break;case"BYYEARDAY":i.yearDay=n[1].split(",").map(Number),i.validRules.push(n[0]);break;case"BYWEEKNO":i.weekNo=n[1].split(",").map(Number),i.validRules.push(n[0]);break;case"INTERVAL":i.interval=parseInt(n[1],10);break;case"COUNT":i.count=parseInt(n[1],10);break;case"BYSETPOS":i.setPosition=4<parseInt(n[1],10)?-1:parseInt(n[1],10);break;case"FREQ":i.freq=n[1];break;case"WKST":i.wkst=n[1]}}),"MONTHLY"===i.freq&&0===i.monthDay.length&&(e=i.validRules.indexOf("BYDAY"),i.validRules.splice(e,1)),i}function Va(e,t){for(var i,n=t.slice(0),r=(t=e,Ha[_.getFullYear(t)]||(Ha[_.getFullYear(t)]=_.getYearLastDate(t,0)),i=Ha[_.getFullYear(t)],t=t.getTime()-i.getTime(),Math.ceil(t/W)),a=n.shift();a;){if((a=a<0?a+_.getYearDaysCount(e,0)+1:a)===r)return;a=n.shift()}return 1}function Aa(n,e){var r=!0,a=e.day,s=e.month,o=_.getExpectedDays(n,e.monthDay),l=e.yearDay;return e.validRules.forEach(function(e){switch(e){case"BYDAY":t=n.getDay(),i=[],a.forEach(function(e){e=e.match(Ba);2===e.length?i.push(e[1]):i.push(e[0])}),-1===i.indexOf(ja[parseInt(t.toString(),10)])&&(r=!1);break;case"BYMONTH":_.checkMonth(n,s)&&(r=!1);break;case"BYMONTHDAY":!function(e,t){for(var i=t.slice(0),n=_.getMonthDaysCount(e),r=i.shift();r;){if((r=r<0?r+n+1:r)===e.getDate())return;r=i.shift()}return 1}(n,o)||(r=!1);break;case"BYYEARDAY":Va(n,l)&&(r=!1)}var t,i}),r}function Ia(e){return new("Islamic"===e?$r:Zr)}var Ma,ka,Ra,_,Ha={},Pa=["SU","MO","TU","WE","TH","FR","SA"],ja=["SU","MO","TU","WE","TH","FR","SA"],Na=["first","second","third","fourth","last"],La="summaryOn",qa={SU:"sun",MO:"mon",TU:"tue",WE:"wed",TH:"thu",FR:"fri",SA:"sat"},Fa=/\d/,Ua=/[^A-Z]+/,Ba=/[a-z]+|[^a-z]+/gi;function Wa(e){return[e.getUTCFullYear(),za(e.getUTCMonth()+1),za(e.getUTCDate()),"T",za(e.getUTCHours()),za(e.getUTCMinutes()),za(e.getUTCSeconds()),"Z"].join("")}function za(e){return("0"+e).slice(-2)}n.prototype.processData=function(e,a,s){for(var o=this,t=this.parent.activeView.startDate(),i=this.parent.activeView.endDate(),l=this.parent.eventFields,p=[],c=1,h=!1,d=this.parent.resourceBase?this.parent.resourceBase.resourceCollection:[],n=(0<e.length&&B.isNullOrUndefined(e[0][l.id])&&(h=!0),function(t){h&&(t[l.id]=c++),t=u.updateEventDateTime(t),a?u.processTimezoneChange(t,s):u.parent.isPrinting||u.parent.uiStateValues.isPreventTimezone||(t=u.processTimezone(t));for(var e=0;e<d.length;e++)null!==t[d[parseInt(e.toString(),10)].field]&&0!==t[d[parseInt(e.toString(),10)].field]||(t[d[parseInt(e.toString(),10)].field]=void 0);if(B.isNullOrUndefined(t[l.recurrenceRule])||""!==t[l.recurrenceRule]||(t[l.recurrenceRule]=null),B.isNullOrUndefined(t[l.recurrenceRule])||!B.isNullOrUndefined(t[l.recurrenceID])||u.parent.crudModule&&u.parent.crudModule.crudObj.isCrudAction)if(u.parent.crudModule&&u.parent.crudModule.crudObj.isCrudAction)if(!B.isNullOrUndefined(t[l.recurrenceRule])&&B.isNullOrUndefined(t[l.recurrenceID]))for(var i=0,n=u.generateOccurrence(t,null,!0);i<n.length;i++)!function(t){var e=u.parent.eventsProcessed.filter(function(e){return e[l.startTime].getTime()-t[l.startTime].getTime()==0&&e[l.id]===t[l.id]});t.Guid=0<e.length?e[0].Guid:u.generateGuid(),p.push(t)}(n[i]);else{var r=u.parent.eventsProcessed.filter(function(e){return e[o.parent.eventFields.id]===t[o.parent.eventFields.id]});t.Guid=0<r.length?r[0].Guid:u.generateGuid(),p.push(t)}else t.Guid=u.generateGuid(),p.push(t);else p=p.concat(u.generateOccurrence(t,null,!0))}),u=this,r=0,g=e;r<g.length;r++)n(g[r]);this.parent.eventsProcessed=[];e=p.filter(function(e){return!e[o.parent.eventFields.isBlock]});if(this.parent.eventsProcessed=this.filterEvents(t,i,e),!this.parent.activeViewOptions.allowOverlap&&0<this.parent.eventsProcessed.length){this.processedData=this.parent.eventsProcessed;for(var m=[],v=this.parent.eventFields,f=0,y=this.parent.eventsProcessed;f<y.length;f++){var T,w=y[f],D=this.findOverlappingData(w,m);D?!this.parent.eventSettings.sortComparer&&(T=new Date(w[v.endTime]).getTime()-new Date(w[v.startTime]).getTime(),new Date(D[v.endTime]).getTime()-new Date(D[v.startTime]).getTime()<T&&w[v.startTime]===D[v.startTime]||!0===w[v.isAllDay])&&(-1!==(T=m.indexOf(D))&&m.splice(T,1),m.push(w)):m.push(w)}this.parent.eventsProcessed=m}for(var t=p.filter(function(e){return e[o.parent.eventFields.isBlock]}),b=0,S=t;b<S.length;b++){var C=S[b];!C[l.isAllDay]||z(new Date(C[l.startTime].getTime()))<z(new Date(C[l.endTime].getTime()))||(C[l.startTime]=z(C[l.startTime]),C[l.endTime]=Y(z(C[l.endTime]),1))}return this.parent.blockProcessed=t,e},n.prototype.findOverlappingData=function(e,t){for(var i=0<this.parent.activeViewOptions.group.resources.length,n=i?this.parent.resourceBase.resourceCollection:[],r=i?n[n.length-1].field:null,a=this.parent.eventFields,s=new Date(e[a.startTime]),o=new Date(e[a.endTime]),l=0,p=t;l<p.length;l++){var c=p[l];if(s<c[a.endTime]&&o>c[a.startTime]&&c[a.id]!==e[a.id]&&(!i||B.isNullOrUndefined(r)||this.compareResourceValues(c[""+r],e[""+r])))return c}},n.prototype.isOverlapRange=function(e,t){for(var i=this,n=(void 0===t&&(t=null),0<this.parent.activeViewOptions.group.resources.length),r=n?this.parent.resourceBase.resourceCollection:[],a=n?r[r.length-1].field:null,r=Array.isArray(e)?e:[e],s=this.parent.eventFields,o=[],l=!1,p=0,c=r;p<c.length;p++)for(var h=c[p],d=0,u=B.isNullOrUndefined(h[s.recurrenceRule])||!B.isNullOrUndefined(h[s.recurrenceID])&&h[s.recurrenceID]!==h[s.id]||!B.isNullOrUndefined(h[s.recurrenceID])&&"EditSeries"!==t?[h]:this.generateOccurrence(h);d<u.length;d++){var g=u[d],m=function(t){return i.processedData.filter(function(e){return t[s.startTime]<e[s.endTime]&&t[s.endTime]>e[s.startTime]&&e[s.id]!==t[s.id]&&(!n||B.isNullOrUndefined(a)||i.compareResourceValues(e[""+a],t[""+a]))})}(g);0<m.length&&o.push.apply(o,m),this.findOverlappingData(g,this.parent.eventsProcessed)&&(l=!0)}return this.parent.overlapAppointments=o,l},n.prototype.compareResourceValues=function(e,t){function i(e){return Array.isArray(e)?e[0]:e}return i(e)===i(t)},n.prototype.checkOverlap=function(e){return!(this.parent.activeViewOptions.allowOverlap||!this.isOverlapRange(e)||(this.parent.quickPopup.openValidationError("overlapAlert",e),0))},n.prototype.updateEventDateTime=function(e){return"string"==typeof e[this.parent.eventFields.startTime]&&(e[this.parent.eventFields.startTime]=tt(e[this.parent.eventFields.startTime])),"string"==typeof e[this.parent.eventFields.endTime]&&(e[this.parent.eventFields.endTime]=tt(e[this.parent.eventFields.endTime])),e},n.prototype.getProcessedEvents=function(e){for(var t=[],i=0,n=e=void 0===e?this.parent.eventsData:e;i<n.length;i++){var r=n[i];!B.isNullOrUndefined(r[this.parent.eventFields.recurrenceRule])&&B.isNullOrUndefined(r[this.parent.eventFields.recurrenceID])?t=t.concat(this.generateOccurrence(r)):t.push(r)}return t},n.prototype.timezonePropertyChange=function(e){var t=this.parent.eventsData.concat(this.parent.blockData),t=this.processData(t,!0,e);this.parent.notify(Ee,{processedData:t})},n.prototype.timezoneConvert=function(e){var t,i,n=this.parent.eventFields;e[n.startTimezone]=e[n.startTimezone]||e[n.endTimezone],e[n.endTimezone]=e[n.endTimezone]||e[n.startTimezone],this.parent.timezone&&(t=e[n.startTimezone],i=e[n.endTimezone],e[n.startTime]=this.parent.tzModule.convert(e[n.startTime],this.parent.timezone,t),e[n.endTime]=this.parent.tzModule.convert(e[n.endTime],this.parent.timezone,i))},n.prototype.processTimezoneChange=function(e,t){var i=this.parent.eventFields;e[i.isAllDay]||(t&&this.parent.timezone?(e[i.startTime]=this.parent.tzModule.convert(e[i.startTime],t,this.parent.timezone),e[i.endTime]=this.parent.tzModule.convert(e[i.endTime],t,this.parent.timezone)):!t&&this.parent.timezone?(e[i.startTime]=this.parent.tzModule.add(e[i.startTime],this.parent.timezone),e[i.endTime]=this.parent.tzModule.add(e[i.endTime],this.parent.timezone)):t&&!this.parent.timezone&&(e[i.startTime]=this.parent.tzModule.remove(e[i.startTime],t),e[i.endTime]=this.parent.tzModule.remove(e[i.endTime],t)))},n.prototype.processTimezone=function(e,t){void 0===t&&(t=!1);var i,n,r=this.parent.eventFields;return e[r.isAllDay]||(e[r.startTimezone]||e[r.endTimezone]?(i=e[r.startTimezone]||e[r.endTimezone],n=e[r.endTimezone]||e[r.startTimezone],t?this.parent.timezone?(e[r.startTime]=this.parent.tzModule.convert(e[r.startTime],i,this.parent.timezone),e[r.endTime]=this.parent.tzModule.convert(e[r.endTime],n,this.parent.timezone),e[r.startTime]=this.parent.tzModule.remove(e[r.startTime],this.parent.timezone),e[r.endTime]=this.parent.tzModule.remove(e[r.endTime],this.parent.timezone)):(e[r.startTime]=this.parent.tzModule.remove(e[r.startTime],i),e[r.endTime]=this.parent.tzModule.remove(e[r.endTime],n)):(e[r.startTime]=this.parent.tzModule.add(e[r.startTime],i),e[r.endTime]=this.parent.tzModule.add(e[r.endTime],n),this.parent.timezone&&(e[r.startTime]=this.parent.tzModule.convert(e[r.startTime],i,this.parent.timezone),e[r.endTime]=this.parent.tzModule.convert(e[r.endTime],n,this.parent.timezone)))):this.parent.timezone&&(t?(e[r.startTime]=this.parent.tzModule.remove(e[r.startTime],this.parent.timezone),e[r.endTime]=this.parent.tzModule.remove(e[r.endTime],this.parent.timezone)):(e[r.startTime]=this.parent.tzModule.add(e[r.startTime],this.parent.timezone),e[r.endTime]=this.parent.tzModule.add(e[r.endTime],this.parent.timezone)))),e},n.prototype.filterBlockEvents=function(e){for(var t,i=this.parent.eventFields,n=e[i.startTime],r=e[i.endTime],e=(0<this.parent.activeViewOptions.group.resources.length&&(e=this.getGroupIndexFromEvent(e),t=this.parent.resourceBase.lastResourceLevel[parseInt(e.toString(),10)]),B.extend([],this.parent.blockProcessed,null,!0)),a=0,s=e;a<s.length;a++){var o=s[a];o[i.isAllDay]&&o[i.endTime].getTime()>z(new Date(o[i.endTime].getTime())).getTime()&&(o[i.startTime]=z(o[i.startTime]),o[i.endTime]=Y(z(o[i.endTime]),1))}return this.filterEvents(n,r,e,t)},n.prototype.filterEvents=function(e,t,i,n){void 0===i&&(i=this.parent.eventsProcessed);e=this.parent.dataModule.getStartEndQuery(e,t),t=new p.DataManager({json:i}).executeLocal((new p.Query).where(e));return n&&(t=this.filterEventsByResource(n,t)),this.sortByTime(t)},n.prototype.filterEventsByRange=function(e,t,i){var n=this,r=[],r=t&&i?this.filterEvents(t,i,e):t&&!i?e.filter(function(e){return e[n.parent.eventFields.startTime]>=t}):!t&&i?e.filter(function(e){return e[n.parent.eventFields.endTime]<=i}):e;return this.sortByTime(r)},n.prototype.filterEventsByResource=function(e,t){void 0===t&&(t=this.parent.eventsProcessed);for(var i={},n=this.parent.resourceBase.resourceCollection,r=0;r<n.length;r++)i[n[parseInt(r.toString(),10)].field]=e.groupOrder[parseInt(r.toString(),10)];var a=Object.keys(i);return t.filter(function(t){return a.every(function(e){return t[""+e]instanceof Array?-1<t[""+e].indexOf(i[""+e]):t[""+e]===i[""+e]})})},n.prototype.sortByTime=function(e){var i;return!this.parent.eventSettings.sortComparer||"function"!=typeof this.parent.eventSettings.sortComparer&&"string"!=typeof this.parent.eventSettings.sortComparer?(i=this.parent.eventFields,e.sort(function(e,t){e=e[i.startTime],t=t[i.startTime];return e.getTime()-t.getTime()})):e=this.customSorting(e),e},n.prototype.sortByDateTime=function(e){var r;return!this.parent.eventSettings.sortComparer||"function"!=typeof this.parent.eventSettings.sortComparer&&"string"!=typeof this.parent.eventSettings.sortComparer?(r=this.parent.eventFields,e.sort(function(e,t){var i=e[r.startTime],n=t[r.startTime],e=e[r.endTime],t=t[r.endTime],e=e.getTime()-i.getTime(),t=t.getTime()-n.getTime();return i.getTime()-n.getTime()||t-e})):e=this.customSorting(e),e},n.prototype.customSorting=function(e){if("function"==typeof this.parent.eventSettings.sortComparer)return this.parent.eventSettings.sortComparer.call(this.parent,e);if("string"==typeof this.parent.eventSettings.sortComparer){var t=this.parent.eventSettings.sortComparer.split("."),i=void 0;if(i=B.isNullOrUndefined(window)?i:window[t[t.length-1]])return i(e)}return e},n.prototype.getSmallestMissingNumber=function(e){for(var t=Math.max.apply(Math,e),i=0;i<t;i++)if(-1===e.indexOf(i))return i;return t+1},n.prototype.splitEventByDay=function(e){var t=this.parent.eventFields,i=[],n=e[t.startTime],r=e[t.endTime];if(z(new Date(n.getTime()))<z(new Date(r.getTime())))for(var a=new Date(n.getTime()),s=Y(z(new Date(n.getTime())),1),o=0===r.getHours()&&0===r.getMinutes()?r:Y(r,1),l=1,p=et(n.getTime(),o.getTime());s<=r&&a.getTime()!==s.getTime();){var c=B.extend({},e);c[t.startTime]=a,c[t.endTime]=s,c.data={index:l,count:p},c.Guid=this.generateGuid(),c.isSpanned=!0,i.push(c),a=s,s=z(new Date(a.getTime())).getTime()===z(new Date(r.getTime())).getTime()&&s.getTime()!==r.getTime()?(s=new Date(a.getTime()),new Date(s.setHours(r.getHours(),r.getMinutes(),r.getSeconds()))):Y(z(new Date(a.getTime())),1),l++}else i.push(e);return i},n.prototype.splitEvent=function(e,t){var i=this.parent.eventFields,n=z(e[i.startTime]).getTime(),r=z(e[i.endTime]).getTime(),a=n,s=r=Xe(e[i.endTime])<=0?(c=Y(z(e[i.endTime]),-1).getTime())<n?n:c:r,o=[];if(n!==r){n<t[0].getTime()&&(n=t[0].getTime()),r>t[t.length-1].getTime()&&(r=t[t.length-1].getTime());for(var l=n,p=0;p<this.slots.length;p++){var c,h=this.slots[parseInt(p.toString(),10)];if("WorkWeek"===this.parent.currentView||"TimelineWorkWeek"===this.parent.currentView||this.parent.activeViewOptions.group.byDate||this.parent.activeViewOptions.showWeekend){for(var d=[],u=0,g=h;u<g.length;u++){var m=g[u];d.push(new Date(m))}var v=this.getRenderedDates(d);if(!B.isNullOrUndefined(v)&&0<v.length)for(var h=[],f=0,y=v;f<y.length;f++){var T=y[f];h.push(T.getTime())}}"number"==typeof h&&(c=h,(h=[]).push(c));v=h[0];if(r<(l=l<=v&&v<=r?v:l)||r<v)break;if(!this.parent.activeViewOptions.group.byDate&&this.parent.activeViewOptions.showWeekend&&"WorkWeek"!==this.parent.currentView&&"TimelineWorkWeek"!==this.parent.currentView){var w=h.indexOf(l);if(-1!==w){var D=h.indexOf(r),b=-1!==D,S=(D=b?D:h.length-1)-w+1,C=h[parseInt(w.toString(),10)]!==a,O=h[parseInt(D.toString(),10)]!==s;if(o.push(this.cloneEventObject(e,h[parseInt(w.toString(),10)],h[parseInt(D.toString(),10)],S,C,O)),b)break}}else if(this.dateInRange(l,h[0],h[h.length-1])){for(var E=[],x=0;x<h.length;x++)this.dateInRange(h[parseInt(x.toString(),10)],a,s)&&E.push(h[parseInt(x.toString(),10)]);if(0<E.length)if(this.parent.activeViewOptions.group.byDate)for(var V=0,A=E;V<A.length;V++){var I=A[V];o.push(this.cloneEventObject(e,I,I,1,I!==a,I!==s))}else{C=E[0]!==a,O=E[E.length-1]!==s;o.push(this.cloneEventObject(e,E[0],E[E.length-1],E.length,C,O))}}}}else o.push(this.cloneEventObject(e,n,r,1,!1,!1));return o},n.prototype.cloneEventObject=function(e,t,i,n,r,a){var s=this.parent.eventFields,o=B.extend({},e,null,!0),n={count:n,isLeft:r,isRight:a};return n[s.startTime]=e[s.startTime],n[s.endTime]=e[s.endTime],o.data=n,o[s.startTime]=new Date(t),o[s.endTime]=new Date(i),o},n.prototype.dateInRange=function(e,t,i){return t<=e&&e<=i},n.prototype.getSelectedEventElements=function(t){if(this.removeSelectedAppointmentClass(),this.parent.selectedElements.length<=0)this.parent.selectedElements.push(t);else if(this.parent.selectedElements.filter(function(e){return e.getAttribute("data-guid")===t.getAttribute("data-guid")}).length<=0)for(var e='div[data-guid="'+t.getAttribute("data-guid")+'"]',i=0,n=[].slice.call(this.parent.element.querySelectorAll(e));i<n.length;i++){var r=n[i];this.parent.selectedElements.push(r)}else{e=this.parent.selectedElements.filter(function(e){return e.getAttribute("data-guid")!==t.getAttribute("data-guid")});this.parent.selectedElements=e}return t&&0<this.parent.selectedElements.length&&this.addSelectedAppointments(this.parent.selectedElements,!1),this.parent.selectedElements},n.prototype.getSelectedEvents=function(){var e=this,i=[],n=[];return[].slice.call(this.parent.element.querySelectorAll("."+wi)).filter(function(t){0===i.filter(function(e){return e.Guid===t.getAttribute("data-guid")}).length&&i.push(e.getEventByGuid(t.getAttribute("data-guid"))),n.push(t)}),{event:1<i.length?i:i[0],element:1<n.length?n:n[0]}},n.prototype.removeSelectedAppointmentClass=function(){var e=this.getSelectedAppointments();B.removeClass(e,wi),"Agenda"!==this.parent.currentView&&"MonthAgenda"!==this.parent.currentView||B.removeClass(e,Ii)},n.prototype.addSelectedAppointments=function(e,t){"MonthAgenda"!==this.parent.currentView&&this.parent.removeSelectedClass(),B.addClass(e,wi),0<e.length&&!t&&e[e.length-1].focus()},n.prototype.getSelectedAppointments=function(){return[].slice.call(this.parent.element.querySelectorAll("."+wi+",."+V+":focus"))},n.prototype.focusElement=function(e){var t,i;this.parent.eventWindow.dialogObject&&this.parent.eventWindow.dialogObject.visible||(i=document.activeElement,0<(t=this.parent.getSelectedCells()).length&&(i&&(this.parent.element.contains(i)||-1!==t.indexOf(i))||e)?this.parent.keyboardInteractionModule&&(i=!B.isNullOrUndefined(this.parent.activeCellsData)&&this.parent.activeCellsData.element||t[t.length-1],this.parent.keyboardInteractionModule.selectCells(i instanceof Array,i)):0<(e=this.getSelectedAppointments()).length&&(this.parent.activeEventData&&this.parent.activeEventData.element&&-1<e.indexOf(this.parent.activeEventData.element)?this.parent.activeEventData.element:e[e.length-1]).focus())},n.prototype.selectWorkCellByTime=function(e){if("Agenda"!==this.parent.currentView&&"MonthAgenda"!==this.parent.currentView&&0<e.length){var e=e[e.length-1],t=e[this.parent.eventFields.startTime],i=void 0,n=this.isAllDayAppointment(e),i="Month"===this.parent.currentView||n||!this.parent.activeViewOptions.timeScale.enable?new Date(+t).setHours(0,0,0,0):this.findNearestSlot(t),t=void 0,t=n&&-1!==["Day","Week","WorkWeek"].indexOf(this.parent.currentView)?this.parent.getAllDayRow():this.parent.getContentTable(),n='[data-date="'+new Date(i).getTime()+'"]';if(!B.isNullOrUndefined(this.parent.activeViewOptions.group.resources)&&0<this.parent.activeViewOptions.group.resources.length&&(n+='[data-group-index="'+this.getGroupIndexFromEvent(e)+'"]'),i=t.querySelector(n))this.parent.activeCellsData=this.parent.getCellDetails(i),this.parent.keyboardInteractionModule&&this.parent.keyboardInteractionModule.selectCells(!1,i)}return i},n.prototype.findNearestSlot=function(n){var i=this.parent.activeViewOptions.timeScale.interval*je/this.parent.activeViewOptions.timeScale.slotCount,e=Math.round(W/i),r=new Date(n);r.setHours(0,0,0,0);e=Array.from({length:e},function(e,t){return new Date(r.getTime()+t*i)}).reduce(function(e,t){var i=Math.abs(n.getTime()-t.getTime());return!e||i<Math.abs(n.getTime()-e.getTime())?t:e},null);return 1e3*Math.trunc(e.getTime()/1e3)},n.prototype.getGroupIndexFromEvent=function(e){for(var i,t,n,r,a=this.parent.resourceBase.resourceCollection.length-1;0<=a;a--){var s=e[this.parent.resourceBase.resourceCollection[parseInt(a.toString(),10)].field];if(!B.isNullOrUndefined(s)){t=this.parent.resourceBase.resourceCollection[parseInt(a.toString(),10)],i=a,n=t.name,r=t.field;break}}B.isNullOrUndefined(n)&&B.isNullOrUndefined(i)&&(n=this.parent.resourceCollection.slice(-1)[0].name,i=this.parent.resourceCollection.length-1,r=this.parent.resourceCollection.slice(-1)[0].field,t=this.parent.resourceCollection.filter(function(e,t){return e.name===n?(i=t,e):null})[0]);var o,l=e[""+r]instanceof Array?e[""+r][0]:e[""+r];return 0<i?(o=this.parent.resourceCollection[i-1].field,this.parent.resourceBase.getIndexFromResourceId(l,n,t,e,o)):this.parent.resourceBase.getIndexFromResourceId(l,n,t)},n.prototype.isAllDayAppointment=function(e){var t=this.parent.eventFields,i=e[t.isAllDay],e=1<=(ct(e[t.endTime])-ct(e[t.startTime]))/W;return!!(i||"TimeSlot"!==this.parent.eventSettings.spannedEventPlacement&&e)},n.prototype.addEventListener=function(){this.parent.on(Re,this.appointmentBorderRemove,this)},n.prototype.removeEventListener=function(){this.parent.off(Re,this.appointmentBorderRemove)},n.prototype.appointmentBorderRemove=function(e){e=e.event.target;B.closest(e,"."+V)?"MonthAgenda"!==this.parent.currentView&&this.parent.removeSelectedClass():B.closest(e,"."+xt)||this.parent.uiStateValues.isTapHold&&B.closest(e,"."+O+",."+w)||(this.parent.uiStateValues.isTapHold=!1,this.removeSelectedAppointmentClass(),this.parent.selectedElements=[])},n.prototype.wireAppointmentEvents=function(e,t,i){void 0===i&&(i=!1);t=!B.isNullOrUndefined(t)&&t[this.parent.eventFields.isReadonly];B.EventHandler.add(e,"click",this.eventClick,this),this.parent.isAdaptive||this.parent.activeViewOptions.readonly||t||(B.EventHandler.add(e,"touchend",this.eventTouchClick,this),B.EventHandler.add(e,"dblclick",this.eventDoubleClick,this)),this.parent.activeViewOptions.readonly||t||i||(this.parent.resizeModule&&this.parent.resizeModule.wireResizeEvent(e),this.parent.dragAndDropModule&&this.parent.dragAndDropModule.wireDragEvent(e))},n.prototype.eventTouchClick=function(e){var t=this;this.parent.uiStateValues.isTouchScroll||this.parent.uiStateValues.isTapHold||this.parent.uiStateValues.action?this.parent.uiStateValues.isTouchScroll=this.parent.uiStateValues.isTapHold=!1:(setTimeout(function(){return t.isDoubleTapped=!1},250),e.preventDefault(),this.isDoubleTapped?this.eventDoubleClick(e):this.isDoubleTapped||(this.isDoubleTapped=!0,this.eventClick(e)))},n.prototype.renderResizeHandler=function(e,t,i){if(this.parent.resizeModule&&this.parent.allowResizing&&!this.parent.activeViewOptions.readonly&&!i)for(var n=0,r=Object.keys(t);n<r.length;n++){var a=r[n],s=B.createElement("div",{className:Xi});switch(a){case"isLeft":t.isLeft||(s.appendChild(B.createElement("div",{className:"e-left-right-resize"})),B.addClass([s],this.parent.enableRtl?Zi:Ki),B.prepend([s],e));break;case"isRight":t.isRight||(s.appendChild(B.createElement("div",{className:"e-left-right-resize"})),B.addClass([s],this.parent.enableRtl?Ki:Zi),B.append([s],e));break;case"isTop":t.isTop||(s.appendChild(B.createElement("div",{className:"e-top-bottom-resize"})),B.addClass([s],Ji),B.prepend([s],e));break;case"isBottom":t.isBottom||(s.appendChild(B.createElement("div",{className:"e-top-bottom-resize"})),B.addClass([s],$i),B.append([s],e))}}},n.prototype.eventClick=function(e){var t,i=this,n=e.target;n.classList.contains(Gi)||n.classList.contains(Qi)||n.classList.contains(Pr)||((e.ctrlKey||e.metaKey)&&1===e.which&&this.parent.keyboardInteractionModule?(this.parent.quickPopup.quickPopup.hide(),this.parent.selectedElements=[].slice.call(this.parent.element.querySelectorAll("."+wi)),n=B.closest(e.target,"."+V),this.getSelectedEventElements(n),this.activeEventData(e,!1),n={data:this.parent.activeEventData.event,element:this.parent.activeEventData.element,event:e,requestType:"eventSelect"},this.parent.trigger(G,n),t=B.extend(this.parent.activeEventData,{cancel:!1,originalEvent:e}),this.parent.trigger(ee,t)):(this.removeSelectedAppointmentClass(),this.activeEventData(e,!0),n={data:this.parent.activeEventData.event,element:this.parent.activeEventData.element,event:e,requestType:"eventSelect"},this.parent.trigger(G,n),t=B.extend(this.parent.activeEventData,{cancel:!1,originalEvent:e}),this.parent.trigger(ee,t,function(e){var t;e.cancel?(i.removeSelectedAppointmentClass(),i.parent.selectedElements=[],i.parent.quickPopup&&i.parent.quickPopup.quickPopupHide()):("Agenda"!==i.parent.currentView&&"MonthAgenda"!==i.parent.currentView||B.addClass([i.parent.activeEventData.element],Ii),i.parent.allowInline?(t={data:e.event,element:e.element,type:"Event"},i.parent.notify(ue,t)):i.parent.notify(ee,e))})))},n.prototype.eventDoubleClick=function(e){var t=this;this.parent.quickPopup&&this.parent.quickPopup.quickPopupHide(!0),"touchend"===e.type&&this.activeEventData(e,!0),this.removeSelectedAppointmentClass(),this.parent.selectedElements=[],this.parent.activeEventData.element.classList.contains(jr)||this.parent.activeEventData.element.querySelector("."+Pr)||(e=B.extend(this.parent.activeEventData,{cancel:!1,originalEvent:e}),this.parent.trigger(te,e,function(e){!e.cancel&&t.parent.eventSettings.allowEditing&&(!B.isNullOrUndefined(t.parent.activeEventData.event)&&B.isNullOrUndefined(t.parent.activeEventData.event[t.parent.eventFields.recurrenceID])?t.parent.eventWindow.openEditor(t.parent.activeEventData.event,"Save"):(t.parent.currentAction="EditOccurrence",t.parent.quickPopup.openRecurrenceAlert()))}))},n.prototype.getEventByGuid=function(t){return this.parent.eventsProcessed.filter(function(e){return e.Guid===t})[0]},n.prototype.getEventById=function(t){var i=this;return this.parent.eventsData.filter(function(e){return e[i.parent.eventFields.id]===t})[0]},n.prototype.generateGuid=function(){return"xyxxxxyx-xxxy-yxxx-xyxx-xxyxxxxyyxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},n.prototype.getEventIDType=function(){return 0!==this.parent.eventsData.length?typeof this.parent.eventsData[0][this.parent.eventFields.id]:0!==this.parent.blockData.length?typeof this.parent.blockData[0][this.parent.eventFields.id]:"string"},n.prototype.getEventMaxID=function(e){var t,i,n=this;return this.parent.eventsData.length<1&&this.parent.blockData.length<1?1:("string"===(t=this.getEventIDType())&&(i=this.generateGuid()),"number"===t&&(t=this.parent.eventsData.concat(this.parent.blockData).map(function(e){return e[n.parent.eventFields.id]}).reduce(function(e,t){return Math.max(e,t)}),i=(t=B.isNullOrUndefined(e)?t:t+e)+1),i)},n.prototype.activeEventData=function(e,t){var i=this,e=B.closest(e.target,"."+V),n=e.getAttribute("data-guid"),r=(t&&(this.addSelectedAppointments([].slice.call(this.parent.element.querySelectorAll('div[data-guid="'+n+'"]')),!0),e.focus()),this.getEventByGuid(n));r&&r.isSpanned&&(r=this.parent.eventsData.filter(function(e){return e[i.parent.eventFields.id]===r[i.parent.eventFields.id]})[0]),this.parent.activeEventData={event:r,element:e}},n.prototype.generateOccurrence=function(t,e,i){for(var n,r=this,a=t[this.parent.eventFields.startTime],s=t[this.parent.eventFields.endTime],o=t[this.parent.eventFields.recurrenceRule],l=s.getTimezoneOffset()-a.getTimezoneOffset(),p=s.getTime()-a.getTime()-6e4*l,s=(e=new Date((e||this.parent.activeView.startDate()).getTime()-p),t[this.parent.eventFields.recurrenceException]),l=("Agenda"!==this.parent.currentView&&i&&(n=Qe(e,this.parent.activeView.endDate())+1),this.parent.timezone||this.parent.tzModule.getLocalTimezoneName()),i=this.parent.activeViewOptions.firstDayOfWeek,c=this.parent.calendarMode,a=sa(a=t[this.parent.eventFields.recurrenceRule]&&this.isDayBasedRecurrence(t)&&this.parent.timezone&&t[this.parent.eventFields.startTimezone]&&t[this.parent.eventFields.endTimezone]?this.parent.tzModule.convert(t[this.parent.eventFields.startTime],this.parent.timezone,t[this.parent.eventFields.startTimezone]):a,o,s,i,n,e,c,l),h=("Agenda"===this.parent.currentView&&-1===o.indexOf("COUNT")&&-1===o.indexOf("UNTIL")&&(B.isNullOrUndefined(t.generatedDates)?t.generatedDates={start:new Date(a[0]),end:new Date(a[a.length-1])}:(a[0]<t.generatedDates.start.getTime()&&(t.generatedDates.start=new Date(a[0])),a[a.length-1]>t.generatedDates.end.getTime()&&(t.generatedDates.end=new Date(a[a.length-1])))),!1),s=[],d=(t[this.parent.eventFields.recurrenceRule]&&this.isDayBasedRecurrence(t)&&this.parent.timezone&&t[this.parent.eventFields.startTimezone]&&t[this.parent.eventFields.endTimezone]&&(h=!0,s.push.apply(s,a.map(function(e){return r.parent.tzModule.convert(new Date(e),t[r.parent.eventFields.startTimezone],r.parent.timezone).getTime()}))),[]),u=0,g=s=0<s.length?s:a;u<g.length;u++){var m=g[u],v=B.extend({},t,null,!0),m=h?m:this.getDSTAdjustedTime(m,v);v[this.parent.eventFields.startTime]=new Date(m),v[this.parent.eventFields.endTime]=new Date(new Date(m).setMilliseconds(p)),v[this.parent.eventFields.recurrenceID]=v[this.parent.eventFields.id],delete v[this.parent.eventFields.recurrenceException],delete v[this.parent.eventFields.followingID],v.Guid=this.generateGuid(),d.push(v)}return d},n.prototype.isDayBasedRecurrence=function(e){return e[this.parent.eventFields.recurrenceRule].includes("BYMONTHDAY")||e[this.parent.eventFields.recurrenceRule].includes("BYDAY")},n.prototype.getDSTAdjustedTime=function(e,t){var i,n=e;return this.parent.timezone&&(t[this.parent.eventFields.startTimezone]||t[this.parent.eventFields.endTimezone])&&(i=this.getDSTDiff(t[this.parent.eventFields.startTime],new Date(e),t[this.parent.eventFields.startTimezone]),t=this.getDSTDiff(t[this.parent.eventFields.startTime],new Date(e),this.parent.timezone),n=new Date(e).getTime()-6e4*(i-t)),n},n.prototype.getDSTDiff=function(e,t,i){return this.parent.tzModule.offset(new Date(e),i)-this.parent.tzModule.offset(new Date(t),i)},n.prototype.getParentEvent=function(e,t){var i,n,r;for(void 0===t&&(t=!1);(e=this.getFollowingEvent(e))&&(i=B.extend({},e,null,!0)),e&&t;);return t&&i&&(r=(n=this.getEventCollections(i)).follow.slice(-1)[0],r=0<n.occurrence.length&&!i[this.parent.eventFields.recurrenceException]?n.occurrence.slice(-1)[0]:r)&&(i[this.parent.eventFields.recurrenceRule]=r[this.parent.eventFields.recurrenceRule]),i},n.prototype.getEventCollections=function(e,t){for(var i=[],n=[],r=e;(r=this.getFollowingEvent(r,!0))&&i.push(r),n=n.concat(this.getOccurrenceEvent(r||e)),r;);var a;return t?(a=this.parent.eventFields,{follow:i.filter(function(e){return e[a.startTime]>=t[a.startTime]}),occurrence:n.filter(function(e){return e[a.startTime]>=t[a.startTime]})}):{follow:i,occurrence:n}},n.prototype.getFollowingEvent=function(e,t){var i=this.parent.eventFields,n=t?e[i.id]:e[i.recurrenceID]||e[i.followingID];return this.parent.eventsData.filter(function(e){return e[t?i.followingID:i.id]===n}).shift()},n.prototype.isFollowingEvent=function(e,t){e=e[this.parent.eventFields.startTime],t=t[this.parent.eventFields.startTime];return e.getHours()===t.getHours()&&e.getMinutes()===t.getMinutes()&&e.getSeconds()===t.getSeconds()},n.prototype.getOccurrenceEvent=function(t,e,i){void 0===i&&(i=!1);var n=(e=void 0===e?!1:e)?"Guid":i?this.parent.eventFields.followingID:this.parent.eventFields.recurrenceID,r=e?"Guid":this.parent.eventFields.id;return(e?this.parent.eventsProcessed:this.parent.eventsData).filter(function(e){return e[""+n]===t[""+r]})},n.prototype.getOccurrencesByID=function(t){for(var i=this.parent.eventFields,e=[],n=0,r=this.parent.eventsData.filter(function(e){return e[i.id]===t});n<r.length;n++){var a=r[n];B.isNullOrUndefined(a[i.recurrenceRule])||(e=e.concat(this.generateOccurrence(a)))}return e},n.prototype.getOccurrencesByRange=function(t,i){for(var n=this.parent.eventFields,e=[],r=0,a=this.parent.eventsData;r<a.length;r++){var s=a[r];B.isNullOrUndefined(s[n.recurrenceRule])||(e=e.concat(this.generateOccurrence(s)))}return e.filter(function(e){return e[n.startTime]>=t&&e[n.endTime]<=i&&!B.isNullOrUndefined(e[n.recurrenceID])})},n.prototype.getDeletedOccurrences=function(a){var s=this.parent.eventFields,o=[],l="string"==typeof a||"number"==typeof a?this.parent.eventsData.filter(function(e){return e[s.id]===a})[0]:B.extend({},a,null,!0);if(l[s.recurrenceException])for(var p=l[s.recurrenceException].split(","),c=this,e=0,t=p.length;e<t;e++)!function(t){var e,i,n,r;0===c.parent.eventsData.filter(function(e){return e[s.recurrenceID]===l[s.id]&&e[s.recurrenceException]===p[parseInt(t.toString(),10)]}).length&&(i=oa(p[parseInt(t.toString(),10)]),(e=B.extend({},a,null,!0))[s.recurrenceID]=l[s.id],delete e[s.followingID],e[s.recurrenceException]=p[parseInt(t.toString(),10)],i=new Date(i.getTime()),n=l[s.endTime].getTime()-l[s.startTime].getTime(),(r=new Date(i.getTime())).setMilliseconds(n),e[s.startTime]=new Date(i.getTime()),e[s.endTime]=new Date(r.getTime()),o.push(e))}(e);return o},n.prototype.applyResourceColor=function(e,t,i,n,r){this.parent.resourceBase&&(t=this.parent.resourceBase.getResourceColor(t,n))&&(e.style[i]=B.isNullOrUndefined(r)?t:(n=r,e=(e=t).replace("#",""),"rgba("+parseInt(e.substring(0,e.length/3),16)+", "+parseInt(e.substring(e.length/3,2*e.length/3),16)+", "+parseInt(e.substring(2*e.length/3,3*e.length/3),16)+", "+n+")"))},n.prototype.createBlockAppointmentElement=function(e,t,i){var n,r=e[this.parent.eventFields.subject]||this.parent.eventSettings.fields.subject.default,a=B.createElement("div",{className:yi,attrs:{"data-id":"Appointment_"+e[this.parent.eventFields.id],"aria-disabled":"true"}});return i=B.isNullOrUndefined(this.parent.activeViewOptions.eventTemplate)?(n=B.createElement("div",{className:Gn}),this.parent.sanitize(r,n),[n]):(r=this.parent.element.id+"_"+this.parent.activeViewOptions.eventTemplateName+"eventTemplate",n=i&&-1===this.parent.currentView.indexOf("Year")?this.parent.getEventTemplateName(t):"eventTemplate",this.parent.getAppointmentTemplate()(e,this.parent,n,r,!1,void 0,void 0,this.parent.root)),B.append(i,a),this.setWrapperAttributes(a,t),a},n.prototype.setWrapperAttributes=function(e,t){B.isNullOrUndefined(this.cssClass)||B.addClass([e],this.cssClass),0<this.parent.activeViewOptions.group.resources.length&&e.setAttribute("data-group-index",t.toString())},n.prototype.getReadonlyAttribute=function(e){return(e[this.parent.eventFields.isReadonly]||this.parent.readonly).toString()},n.prototype.isBlockRange=function(e){for(var e=e instanceof Array?e:[e],t=!1,i=this.parent.eventFields,n=0,r=e;n<r.length;n++){var a=r[n],s=[];B.isNullOrUndefined(a[i.recurrenceRule])||!B.isNullOrUndefined(a[i.recurrenceID])&&a[i.id]!==a[i.recurrenceID]?s.push(a):s=this.generateOccurrence(a);for(var o=0,l=s;o<l.length;o++){var p=l[o];if(0<this.filterBlockEvents(p).length){t=!0;break}}}return this.parent.uiStateValues.isBlock=t},n.prototype.getFilterEventsList=function(e,t){return new p.DataManager(e).executeLocal((new p.Query).where(t))},n.prototype.getSeriesEvents=function(e,t){for(var i,n,r=this.parent.eventFields,a=(t=B.isNullOrUndefined(t)?e[r.startTime]:t,[]),s=e[r.id],o=e[r.followingID],l="EditSeries"===this.parent.currentAction?"greaterthan":"greaterthanorequal";n=new p.Predicate(r.followingID,"equal",s).and(new p.Predicate(r.startTime,l,t)),i=(n=this.getFilterEventsList(this.parent.eventsData,n)).slice(-1)[0],o=B.isNullOrUndefined(i)||i[r.id]===o?null:(a.push(i),s=i[r.id],i[r.followingID]),1===n.length&&!B.isNullOrUndefined(i[r.followingID]););return a},n.prototype.getEditedOccurrences=function(e,t){for(var i=this.parent.eventFields,n=[],r=0,a=e;r<a.length;r++){var s=a[r],s=new p.Predicate(i.recurrenceID,"equal",s[i.id]).or(new p.Predicate(i.recurrenceID,"equal",s[i.followingID]).and(new p.Predicate(i.recurrenceID,"notequal",void 0)).and(new p.Predicate(i.recurrenceID,"notequal",null)));"EditFollowingEvents"!==this.parent.currentAction&&"DeleteFollowingEvents"!==this.parent.currentAction||(s=s.and(new p.Predicate(i.startTime,"greaterthanorequal",t))),s=this.getFilterEventsList(this.parent.eventsData,s),n=n.concat(s)}return n},n.prototype.getRenderedDates=function(t){var e,i=0,n=t.length,r=B.isNullOrUndefined(this.parent.maxDate)?new Date(2099,11,31):this.parent.maxDate,a=B.isNullOrUndefined(this.parent.minDate)?new Date(1900,0,1):this.parent.minDate;if(t[0]<a&&t[t.length-1]>r){for(var s=0;s<t.length;s++)z(t[parseInt(s.toString(),10)]).getTime()===z(new Date(a)).getTime()&&(i=s),z(t[parseInt(s.toString(),10)]).getTime()===z(new Date(r)).getTime()&&(n=s);e=t.filter(function(e){return e>=t[parseInt(i.toString(),10)]&&e<=t[parseInt(n.toString(),10)]})}return e},n.prototype.isValidEvent=function(e,t,i,n){var r=i.getTime()>n.startHour.getTime()&&t.getTime()<n.endHour.getTime(),e=n.startHour.getTime()<=t.getTime()&&e[this.parent.eventFields.startTime].getTime()>=n.startHour.getTime()&&e[this.parent.eventFields.endTime].getTime()<n.endHour.getTime()&&t.getTime()===i.getTime();return r||e},n.prototype.allDayExpandScroll=function(e){var t=0;[].slice.call(this.parent.element.querySelectorAll("."+nn)).forEach(function(e){[].slice.call(e.children).forEach(function(e){e.style.top=t+"px"}),t+=e.offsetHeight}),t=e.offsetHeight-t,this.parent.element.querySelector("."+w).style.height=t/12+"em",this.parent.uiStateValues.expand?B.addClass([e],qr):B.removeClass([e],qr)},n.prototype.updateEventMinimumDuration=function(e,t,i){var n;return(t.getTime()<i.getTime()||t.getTime()===i.getTime()&&e.startHour.getTime()<i.getTime()&&e.endHour.getTime()>t.getTime()&&-1===this.parent.currentView.indexOf("Timeline"))&&(ct(i)-ct(t))/je<this.parent.eventSettings.minimumEventDuration&&((n=new Date(t)).setMinutes(n.getMinutes()+this.parent.eventSettings.minimumEventDuration),(i=n).getTime()>e.endHour.getTime())&&((n=new Date(e.endHour.getTime())).setMinutes(n.getMinutes()-this.parent.eventSettings.minimumEventDuration),t=n,i=e.endHour),{startDate:t,endDate:i}},n.prototype.createEventWrapper=function(e,t){void 0===e&&(e=""),void 0===t&&(t=0);for(var i=B.createElement("tr"),n=this.parent.activeView.colLevels.slice(-1)[0],r=this.parent.isReact&&this.parent.activeViewOptions.eventTemplate?" "+oi:"",a=0,s=n.length;a<s;a++){var o=n[parseInt(a.toString(),10)],l=B.createElement("td",{className:"allDay"===e?rn+r:"timeIndicator"===e?si:li+r,attrs:{"data-date":o.date.getTime().toString()}});B.isNullOrUndefined(o.groupIndex)||l.setAttribute("data-group-index",o.groupIndex.toString()),""===e&&(o=B.createElement("div",{id:x+"-"+t.toString(),className:x}),l.appendChild(o)),i.appendChild(l),t+=1}return i},n.prototype.getPageCoordinates=function(e){var t;return B.isNullOrUndefined(e)?e:(t=e.event)&&t.changedTouches?t.changedTouches[0]:e.changedTouches?e.changedTouches[0]:t||e},n.prototype.renderSpannedIcon=function(e,t){var i,n=B.createElement("div",{className:Fi+" "+Dt});t.isLeft&&(i=n.cloneNode(),B.addClass([i],Ui),B.prepend([i],e)),t.isRight&&(i=n.cloneNode(),B.addClass([i],Bi),B.append([i],e)),t.isTop&&(i=n.cloneNode(),B.addClass([i],"e-up-icon"),B.prepend([i],e)),t.isBottom&&(i=n.cloneNode(),B.addClass([i],"e-down-icon"),B.append([i],e))},n.prototype.addCellHeight=function(e,t,i,n,r,a){if(void 0===a&&(a=!0),this.parent.activeViewOptions.maxEventsPerRow&&!this.parent.rowAutoHeight){for(var s=[].slice.call(this.parent.element.querySelectorAll(e)),o=this.parent.showWeekNumber?[].slice.call(this.parent.element.querySelectorAll("."+ui+" tbody tr")):[],l=0,p=s;l<p.length;l++){var c=p[l],h=this.parent.activeViewOptions.maxEventsPerRow*(t+("Month"===this.parent.currentView?i:2))+n+r;0<o.length&&B.setStyleAttribute(o[s.indexOf(c)].firstElementChild,{height:h+"px"}),B.setStyleAttribute(c.firstElementChild,{height:h+"px"})}this.parent.enablePersistence||this.parent.activeViewOptions.allowVirtualScrolling||!a||this.parent.notify(Ve,{})}},n.prototype.unWireEvents=function(){for(var e=0,t=[].slice.call(this.parent.element.querySelectorAll("."+V));e<t.length;e++){var i=t[e];B.EventHandler.clearEvents(i)}},n.prototype.destroy=function(){this.unWireEvents(),this.parent=null};var Ya=n;function n(e){this.slots=[],this.processedData=[],this.isDoubleTapped=!1,this.parent=e}_a=function(e,t){return(_a=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}_a(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(r,Ga=Ya),r.prototype.renderAppointments=function(){var t=this;if(!B.isNullOrUndefined(this.parent)){this.parent.dragAndDropModule&&this.parent.dragAndDropModule.setDragArea(),this.isResourceEventTemplate=this.parent.isSpecificResourceEvents();for(var e=[].slice.call(this.parent.element.querySelectorAll("."+yi+",."+V+",."+on)),i=!(!this.parent.crudModule||!this.parent.crudModule.crudObj.isCrudAction),n=function(e){t.parent.isReact&&!B.isNullOrUndefined(t.parent.activeViewOptions.eventTemplate)&&(e=B.closest(e,"."+li+",."+rn))&&!e.classList.contains(oi)&&B.addClass([e],oi)},r=0,a=e;r<a.length;r++){var s=a[r];if(!i||s.classList.contains(an)||s.classList.contains(on))n(s),B.remove(s);else for(var o=parseInt(s.getAttribute("data-group-index"),10),l=0,p=this.parent.crudModule.crudObj.sourceEvent.length;l<p;l++)o!==this.parent.crudModule.crudObj.sourceEvent[parseInt(l.toString(),10)].groupIndex&&o!==this.parent.crudModule.crudObj.targetEvent[parseInt(l.toString(),10)].groupIndex||(n(s),B.remove(s))}this.element.querySelector("."+O)&&(this.parent.virtualScrollModule&&this.parent.virtualScrollModule.updateFocusedWorkCell(),this.allDayElement=[].slice.call(this.element.querySelectorAll("."+w)),this.setAllDayRowHeight(0),0===this.parent.eventsProcessed.length&&0===this.parent.blockProcessed.length||(e=this.element.querySelector("."+ln),B.EventHandler.remove(e,"click",this.rowExpandCollapse),B.EventHandler.add(e,"click",this.rowExpandCollapse,this),this.renderedEvents=[],this.renderedAllDayEvents=[],this.initializeValues(),this.processBlockEvents(),this.renderEvents("normalEvents"),0<this.allDayEvents.length&&(this.allDayEvents=this.allDayEvents.filter(function(e,t,i){return t===i.map(function(e){return e.Guid}).indexOf(e.Guid)}),B.removeClass(this.allDayElement,vr),this.slots.push(this.parent.activeView.renderDates.map(function(e){return+e})),this.renderEvents("allDayEvents"),this.animation.animate(this.allDayElement[0])),this.parent.notify(Ve,{}),B.addClass(this.allDayElement,vr),i&&(this.parent.crudModule.crudObj.isCrudAction=!1),this.parent.renderTemplates(function(){var e;t.parent&&t.parent.isReact&&t.parent.activeViewOptions.eventTemplate&&(e=[].slice.call(t.parent.element.querySelectorAll("."+oi)),B.removeClass(e,oi))})))}},r.prototype.initializeValues=function(){if(this.resources=0<this.parent.activeViewOptions.group.resources.length?this.parent.uiStateValues.isGroupAdaptive?[this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex]]:this.parent.resourceBase.lastResourceLevel:[],0<this.resources.length&&this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.virtualScrollModule&&(this.resources=this.parent.resourceBase.renderedResources),this.cellHeight=parseFloat(this.parent.getElementHeight(this.parent.element.querySelector(".e-content-wrap tbody tr")).toFixed(2)),this.dateRender[0]=this.parent.activeView.renderDates,0<this.parent.activeViewOptions.group.resources.length)for(var e=0,t=this.resources.length;e<t;e++)this.dateRender[parseInt(e.toString(),10)]=this.resources[parseInt(e.toString(),10)].renderDates},r.prototype.getHeight=function(e,t){t=(ct(t)-ct(e))/je*(this.cellHeight*this.slotCount)/this.interval;return t<=0?this.cellHeight:t},r.prototype.appendEvent=function(e,t,i,n){var r=this.element.querySelector("."+x+'[id="'+x+"-"+i+'"]'),i=(this.parent.enableRtl?B.setStyleAttribute(t,{right:n}):B.setStyleAttribute(t,{left:n}),t.classList.contains(yi)?"blockEvent":"event"),n={data:B.extend({},e,null,!0),element:t,cancel:!1,type:i};this.parent.trigger(ie,n,function(e){e.cancel||r.appendChild(t)})},r.prototype.processBlockEvents=function(){for(var e=this.getResourceList(),t=this.getStartCount(),i=0,n=e;i<n.length;i++)for(var r=n[i],a=this.dateRender[parseInt(r.toString(),10)],s=0,o=a.length;s<o;s++){for(var l=new Date(a[parseInt(s.toString(),10)].getTime()),p=z(Y(a[parseInt(s.toString(),10)],1)),c=0,h=this.filterEvents(l,p,this.parent.blockProcessed,this.resources[parseInt(r.toString(),10)]);c<h.length;c++){var d=h[c];this.parent.resourceBase&&this.setValues(d,r),this.renderBlockEvents(d,s,r,t),this.cssClass=null,this.groupOrder=null}t+=1}},r.prototype.renderBlockEvents=function(e,t,i,n){var r,a=this.isSpannedEvent(e,t,i),s=a[this.fields.startTime],o=a[this.fields.endTime],l=Je(z(new Date(this.dateRender[parseInt(i.toString(),10)][parseInt(t.toString(),10)].getTime())),this.startHour,this.endHour);s<=o&&this.isValidEvent(e,s,o,l)&&this.isWorkDayAvailable(i,s)&&(r=l=void 0,l=a[this.fields.isAllDay]?(a=this.parent.element.querySelector("."+A+" table"),r=B.formatUnit(a.offsetHeight),B.formatUnit(0)):(r=B.formatUnit(this.getHeight(s,o)),B.formatUnit(this.getTopValue(s))),e.IsBlock&&(r=B.formatUnit(parseInt(r,10)-1)),a=this.createBlockAppointmentElement(e,i,this.isResourceEventTemplate),o=e.IsBlock?"99%":"100%",B.setStyleAttribute(a,{width:o,height:r,top:l}),s=this.getDayIndex(t,i,n),o=e.IsBlock?"0.5px":"0px",this.appendEvent(e,a,s,o))},r.prototype.renderEvents=function(u){B.removeClass(this.allDayElement,vr);for(var g,m="allDayEvents"===u?this.sortByDateTime(this.allDayEvents):void 0,e=this.getResourceList(),v=this.getStartCount(),f="allDayEvents"===u?this.parent.getElementHeightFromClass(this.element.querySelector("."+rn),V):0,y="allDayEvents"===u&&0<this.allDayElement.length?this.allDayElement[0].offsetTop:0,T=this,t=0,i=e;t<i.length;t++)!function(t){g=!0,T.parent.crudModule&&T.parent.crudModule.crudObj.isCrudAction&&"allDayEvents"!==u&&!T.parent.uiStateValues.isGroupAdaptive&&0===T.parent.crudModule.crudObj.sourceEvent.filter(function(e){return e.groupIndex===t}).length&&0===T.parent.crudModule.crudObj.targetEvent.filter(function(e){return e.groupIndex===t}).length&&(g=!1),T.slots=[];var e=T.dateRender[parseInt(t.toString(),10)],i=T.getRenderedDates(e)||e;T.slots.push(e.map(function(e){return+e}));for(var n=0,r=e.length;n<r&&e[parseInt(n.toString(),10)]<=i[i.length-1];n++){T.renderedEvents=[];var a=new Date(e[parseInt(n.toString(),10)].getTime()),s=z(Y(e[parseInt(n.toString(),10)],1)),a=T.filterEvents(a,s,m,T.resources[parseInt(t.toString(),10)]);if(g)for(var o=0,l=a;o<l.length;o++){var p=l[o];if(T.parent.resourceBase&&T.setValues(p,t),"allDayEvents"===u)T.renderAllDayEvents(p,n,t,v,!1,y,f);else if(T.isAllDayAppointment(p))T.allDayEvents.push(B.extend({},p,null,!0));else{if(T.parent.eventSettings.enableMaxHeight&&0<T.getOverlapIndex(p,n,!1,t))continue;T.renderNormalEvents(p,n,t,v)}T.cssClass=null,T.groupOrder=null}else for(var c=0,h=a;c<h.length;c++){var d=h[c];T.isAllDayAppointment(d)&&T.allDayEvents.push(B.extend({},d,null,!0))}v+=1}}(i[t])},r.prototype.getStartCount=function(){return this.parent.virtualScrollModule&&this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.timeScale.enable?parseInt(this.element.querySelector("."+x).getAttribute("id").split("-").slice(-1)[0],10):0},r.prototype.getDayIndex=function(e,t,i){var n=this;if(!this.parent.activeViewOptions.group.byDate)return i;if(this.parent.activeViewOptions.group.byDate&&!this.parent.activeViewOptions.group.hideNonWorkingDays)return i=this.parent.resourceBase.lastResourceLevel[0].renderDates.indexOf(this.dateRender[parseInt(t.toString(),10)][parseInt(e.toString(),10)]),this.resources.length*i+t;for(var r=0,a=this.parent.activeView.colLevels[0],s=this.dateRender[parseInt(t.toString(),10)][parseInt(e.toString(),10)].getTime(),o=[],l=0;l<a.length&&(o=this.parent.resourceBase.resourceDateTree[parseInt(l.toString(),10)],s!==a[parseInt(l.toString(),10)].date.getTime());l++)r+=a[parseInt(l.toString(),10)].colSpan;i=o.findIndex(function(e){return e.groupOrder.toString()===n.resources[parseInt(t.toString(),10)].groupOrder.toString()});return i<0?r:r+i},r.prototype.setValues=function(e,t){0<this.parent.activeViewOptions.group.resources.length?(this.cssClass=this.resources[parseInt(t.toString(),10)].cssClass,this.groupOrder=this.resources[parseInt(t.toString(),10)].groupOrder):this.cssClass=this.parent.resourceBase.getCssClass(e)},r.prototype.getResourceList=function(){return Array.apply(null,{length:0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive?this.resources.length:1}).map(function(e,t){return t})},r.prototype.createAppointmentElement=function(e,t,i,n){var r,a,s=this.parent.eventFields,o=e[s.subject]||this.parent.eventSettings.fields.subject.default||this.parent.localeObj.getConstant("addTitle"),l=B.createElement("div",{className:V,attrs:{"data-id":"Appointment_"+e[s.id],"data-guid":e.Guid,role:"button",tabindex:"0","aria-disabled":this.parent.eventBase.getReadonlyAttribute(e),"aria-label":this.parent.getAnnouncementString(e)}}),p=(e[this.fields.isReadonly]&&B.addClass([l],"e-read-only"),B.createElement("div",{className:Di})),c=(l.appendChild(p),0<this.parent.activeViewOptions.group.resources.length&&(c=this.parent.uiStateValues.isGroupAdaptive?this.parent.uiStateValues.groupIndex:n,l.setAttribute("data-group-index",c.toString())),i);return B.isNullOrUndefined(this.parent.activeViewOptions.eventTemplate)?(i=B.createElement("div",{className:Gn}),this.parent.sanitize(o,i),t?e[s.isAllDay]?r=[i]:(r=[],o=B.createElement("div",{className:Ci+(this.parent.isAdaptive?" "+d:""),innerHTML:this.parent.getTimeString(e[s.startTime])}),a=B.createElement("div",{className:Ci+(this.parent.isAdaptive?" "+d:""),innerHTML:this.parent.getTimeString(e[s.endTime])}),B.addClass([i],"e-text-center"),c.isLeft||r.push(o),r.push(i),c.isRight||r.push(a)):(o=this.parent.getTimeString(e[s.startTime])+" - "+this.parent.getTimeString(e[s.endTime]),a=B.createElement("div",{className:Ci+(this.parent.isAdaptive?" "+d:""),innerHTML:o}),o=B.createElement("div",{className:Xn}),this.parent.sanitize(e[s.location]||this.parent.eventSettings.fields.location.default||"",o),r=[i,a,o])):(i=this.parent.element.id+"_"+this.parent.activeViewOptions.eventTemplateName+"eventTemplate",a=this.parent.uiStateValues.isGroupAdaptive?this.parent.uiStateValues.groupIndex:n,o=this.isResourceEventTemplate?this.parent.getEventTemplateName(a):"eventTemplate",r=this.parent.getAppointmentTemplate()(e,this.parent,o,i,!1,void 0,void 0,this.parent.root)),B.append(r,p),this.parent.isAdaptive||B.isNullOrUndefined(e[s.recurrenceRule])&&B.isNullOrUndefined(e[s.recurrenceID])||(n=e[s.id]===e[s.recurrenceID]?en:tn,a=B.createElement("div",{className:Dt+" "+n}),(t?p:l).appendChild(a)),this.parent.eventBase.renderSpannedIcon(t?p:l,c),B.isNullOrUndefined(this.cssClass)||B.addClass([l],this.cssClass),this.applyResourceColor(l,e,"backgroundColor",this.groupOrder),this.renderResizeHandler(l,c,e[this.fields.isReadonly]),l},r.prototype.createMoreIndicator=function(e,t,i){var i=i+t,t=e[parseInt(i.toString(),10)];t.childElementCount<=0?(e=B.createElement("div",{className:on,id:on+"-"+i.toString()}),i=B.createElement("div",{className:hn,attrs:{tabindex:"0","data-index":i.toString(),"data-count":"1"},innerHTML:"+1 "+(this.parent.isAdaptive?"":this.parent.localeObj.getConstant("more"))}),e.appendChild(i),t.appendChild(e),B.EventHandler.add(i,"click",this.rowExpandCollapse,this)):(e=t.querySelector("."+hn),i=parseInt(e.getAttribute("data-count"),10)+1,e.setAttribute("data-count",i.toString()),e.innerHTML="+"+this.parent.globalize.formatNumber(i)+" "+(this.parent.isAdaptive?"":this.parent.localeObj.getConstant("more")))},r.prototype.isSpannedEvent=function(e,t,i){var n=z(this.dateRender[parseInt(i.toString(),10)][parseInt(t.toString(),10)]),i=this.getRenderedDates(this.dateRender[parseInt(i.toString(),10)])||[n],i=(0===i.filter(function(e){return e.getDay()===t}).length&&(n=z(i[0])),this.parent.eventFields),n=Je(n,this.startHour,this.endHour),r=B.extend({},e,null,!0),e=(r.isSpanned={isBottom:!1,isTop:!1,isSameDuration:r[i.startTime].getTime()===r[i.endTime].getTime()},e[i.startTime].getTime()<n.startHour.getTime()&&(r[i.startTime]=n.startHour,r.isSpanned.isTop=!0),e[i.endTime].getTime()>n.endHour.getTime()&&(r[i.endTime]=n.endHour,r.isSpanned.isBottom=!0),this.updateEventMinimumDuration(n,r[i.startTime],r[i.endTime]));return r[i.startTime]=e.startDate,r[i.endTime]=e.endDate,r},r.prototype.isWorkDayAvailable=function(e,t){return!(this.parent.activeViewOptions.group.hideNonWorkingDays&&0<this.resources.length)||(e=this.resources[parseInt(e.toString(),10)].resourceData[this.resources[parseInt(e.toString(),10)].resource.workDaysField]||this.parent.activeViewOptions.workDays)&&0<=e.indexOf(t.getDay())},r.prototype.renderAllDayEvents=function(n,t,e,i,r,a,s){var o,l,p,c,h,d,u,g,m,v=this,f=this.getRenderedDates(this.dateRender[parseInt(e.toString(),10)])||this.dateRender[parseInt(e.toString(),10)],y=(this.parent.activeViewOptions.group.byDate&&(this.slots[0]=[this.dateRender[parseInt(e.toString(),10)][parseInt(t.toString(),10)].getTime()],f=[this.dateRender[parseInt(e.toString(),10)][parseInt(t.toString(),10)]]),this.splitEvent(n,f)[0]),T=new Date(y[this.parent.eventFields.startTime].getTime()),w=new Date(y[this.parent.eventFields.endTime].getTime());T.getTime()<this.parent.minDate.getTime()||w.getTime()>this.parent.maxDate.getTime()||(l=1,h=f[o=0].getTime()<=T.getTime()&&Y(f.slice(-1)[0],1).getTime()>=T.getTime(),T<=w&&h&&this.isWorkDayAvailable(e,T)&&(w=[],0===(w=this.renderedAllDayEvents[parseInt(e.toString(),10)]&&(w=this.renderedAllDayEvents[parseInt(e.toString(),10)].filter(function(e){return e.Guid===n.Guid}),this.parent.activeViewOptions.group.byDate)?w.filter(function(e){return e[v.parent.eventFields.startTime]>=f[parseInt(t.toString(),10)]&&e[v.parent.eventFields.endTime]<=Y(new Date(+f[parseInt(t.toString(),10)]),1)}):w).length)&&(p=y.data.count,c=this.getOverlapIndex(y,t,!0,e),y.Index=c,this.allDayLevel=this.allDayLevel<c?c:this.allDayLevel,h=y.data.isRight?0:"Day"===this.parent.currentView?4:7,0<=p&&(o=100*p-(this.parent.activeViewOptions.allowOverlap?h:0)),B.isNullOrUndefined(this.renderedAllDayEvents[parseInt(e.toString(),10)])&&(this.renderedAllDayEvents[parseInt(e.toString(),10)]=[]),this.renderedAllDayEvents[parseInt(e.toString(),10)].push(B.extend({},y,null,!0)),d=[].slice.call(this.element.querySelector("."+Ot).children),u=this.getDayIndex(t,e,i),g=this.element.querySelector("."+rn+":nth-child("+(u+1)+")"),m=r?this.parent.inlineModule.createInlineAppointmentElement(n):this.createAppointmentElement(n,!0,y.data,e),B.addClass([m],an),T=B.extend({},y.data,null,!0),n.data=T,w={data:n,element:m,cancel:!1},this.parent.trigger(ie,w,function(e){if(!e.cancel){if(g.appendChild(m),l+=(0===c?a:a+c*s)+1,B.setStyleAttribute(m,{width:o+"%",top:B.formatUnit(l)}),1<c){v.moreEvents.push(m);for(var t=0,i=p;t<i;t++)v.createMoreIndicator(d,t,u)}v.allDayElement[0].setAttribute("data-count",v.allDayLevel.toString());e=4+(!v.parent.uiStateValues.expand&&2<v.allDayLevel?3*s:(v.allDayLevel+1)*s);v.setAllDayRowHeight(e),v.addOrRemoveClass(),v.wireAppointmentEvents(m,n)}})))},r.prototype.renderNormalEvents=function(e,t,i,n,r){var a=this.isSpannedEvent(e,t,i),s=a[this.fields.startTime],o=a[this.fields.endTime],l=0,p=Je(z(new Date(this.dateRender[parseInt(i.toString(),10)][parseInt(t.toString(),10)].getTime())),this.startHour,this.endHour),c=this.isValidEvent(e,s,o,p);s.getTime()<this.parent.minDate.getTime()||o.getTime()>Y(this.parent.maxDate,1).getTime()||s<=o&&c&&this.isWorkDayAvailable(i,s)&&(c=a.isSpanned.isSameDuration?this.cellHeight:this.getHeight(s,o),s.getTime()>=p.startHour.getTime()&&(l=this.getTopValue(s)),o=this.getOverlapIndex(a,t,!1,i),a.Index=o,this.overlapList.push(a),1<this.overlapList.length?(B.isNullOrUndefined(this.overlapEvents[parseInt(o.toString(),10)])&&(this.overlapEvents[parseInt(o.toString(),10)]=[]),this.overlapEvents[parseInt(o.toString(),10)].push(a)):(this.overlapEvents=[],this.overlapEvents.push([a])),p={index:o,left:"0%",width:this.getEventWidth(),day:n,dayIndex:t,record:a,resource:i},(s=this.adjustOverlapElements(p)).appWidth,B.isNullOrUndefined(this.renderedEvents[parseInt(i.toString(),10)])&&(this.renderedEvents[parseInt(i.toString(),10)]=[]),o=void this.renderedEvents[parseInt(i.toString(),10)].push(B.extend({},a,null,!0)),o=r?this.parent.inlineModule.createInlineAppointmentElement(e):this.createAppointmentElement(e,!1,a.isSpanned,i),B.setStyleAttribute(o,{width:this.parent.eventSettings.enableMaxHeight||!this.parent.activeViewOptions.allowOverlap?"100%":s.appWidth,height:c+"px",top:l+"px"}),p=c-40-15*o.querySelectorAll("."+Fi).length,r=o.querySelector("."+Gn),!this.parent.isAdaptive&&r&&(r.style.maxHeight=B.formatUnit(p)),l=this.getDayIndex(t,i,n),(c={})[this.fields.startTime]=e[this.fields.startTime],c[this.fields.endTime]=e[this.fields.endTime],a.data=c,this.appendEvent(a,o,l,s.appLeft),this.wireAppointmentEvents(o,e))},r.prototype.getEventWidth=function(){var e=(("Day"===this.parent.currentView?97:94)-this.overlapEvents.length)/this.overlapEvents.length;return(e<0?0:e)+"%"},r.prototype.getEventLeft=function(e,t){e=(parseFloat(e)+1)*t;return(99<e?99:e)+"%"},r.prototype.getStartEndHours=function(e){var t;return B.isNullOrUndefined(e)||""===e?null:(t=new Date(2e3,0,0,0),2===(e=e.split(":")).length&&t.setHours(parseInt(e[0],10),parseInt(e[1],10),0),t)},r.prototype.getTopValue=function(e){var t=this.getStartEndHours(this.parent.activeViewOptions.startHour),e=60*(e.getHours()-t.getHours())+(e.getMinutes()-t.getMinutes());return this.parent.activeViewOptions.timeScale.enable?e*this.cellHeight*this.slotCount/this.interval:0},r.prototype.getOverlapIndex=function(t,e,i,r){var n,a=this,s=this.parent.eventFields,o=[],l=-1;if(this.overlapEvents=[],i)B.isNullOrUndefined(this.renderedAllDayEvents[parseInt(r.toString(),10)])||(n=z(new Date(this.dateRender[parseInt(r.toString(),10)][parseInt(e.toString(),10)].getTime())),o=this.renderedAllDayEvents[parseInt(r.toString(),10)].filter(function(e){return z(e[s.startTime]).getTime()<=n.getTime()&&z(e[s.endTime]).getTime()>=n.getTime()}),0<this.parent.activeViewOptions.group.resources.length&&(o=this.filterEventsByResource(this.resources[parseInt(r.toString(),10)],o)));else{var p=B.isNullOrUndefined(this.renderedEvents[parseInt(r.toString(),10)])?[]:this.renderedEvents[parseInt(r.toString(),10)],c=[],h=t[s.startTime],d=t[s.endTime],u=(this.overlapList=p.filter(function(e){return e[s.endTime]>h&&e[s.startTime]<=d||e[s.startTime]>=d&&e[s.endTime]<=h||e[s.endTime].getTime()===e[s.startTime].getTime()&&e[s.startTime].getTime()===h.getTime()&&e[s.endTime]<d}),0<this.parent.activeViewOptions.group.resources.length&&(this.overlapList=this.filterEventsByResource(this.resources[parseInt(r.toString(),10)],this.overlapList)),[]);this.overlapList.forEach(function(e){u.push(e);for(var i=[],n=new Set;0<u.length&&"break"!==function(){var t=u.shift();if(p.filter(function(e){return e[s.endTime]>t[s.startTime]&&e[s.startTime]<=t[s.endTime]&&!n.has(e[s.id])}).forEach(function(e){i.push(e),n.add(e[s.id]),u.push(e)}),n.size<p.length-1)return"break"}(););e=(i=0<a.parent.activeViewOptions.group.resources.length?a.filterEventsByResource(a.resources[parseInt(r.toString(),10)],i):i).filter(function(e){return-1===a.overlapList.indexOf(e)});0<e.length&&(c=c.concat(e))});for(var g=0;g<c.length-1;g++)for(var m=g+1;m<c.length;m++)c[parseInt(g.toString(),10)][s.id]===c[parseInt(m.toString(),10)][s.id]&&(c.splice(m,1),m--);this.overlapList=this.overlapList.concat(c);for(var v=0,f=o=this.overlapList;v<f.length;v++){var y=f[v],T=y.Index;B.isNullOrUndefined(this.overlapEvents[parseInt(T.toString(),10)])?this.overlapEvents[parseInt(T.toString(),10)]=[y]:this.overlapEvents[parseInt(T.toString(),10)].push(y)}}return-1===(l=0<(o=i?o:o.filter(function(e){return e[s.startTime]===t[s.startTime]&&e[s.endTime]>t[s.endTime]||e[s.endTime]>t[s.startTime]&&e[s.startTime]<t[s.endTime]||e[s.endTime]===t[s.startTime]&&e[s.startTime]===t[s.endTime]||e[s.startTime].getTime()===t[s.startTime].getTime()&&e[s.endTime].getTime()===t[s.endTime].getTime()||e[s.startTime].getTime()===t[s.startTime].getTime()&&e[s.endTime].getTime()<t[s.endTime].getTime()||e[s.endTime].getTime()>t[s.endTime].getTime()})).length?0<(e=o.map(function(e){return e.Index})).length?this.getSmallestMissingNumber(e):0:l)?0:l},r.prototype.adjustOverlapElements=function(e){for(var t={appWidth:e.width,appLeft:e.left},i=0,n=this.overlapEvents.length;i<n;i++)if(!B.isNullOrUndefined(this.overlapEvents[parseInt(i.toString(),10)]))for(var r=0,a=this.overlapEvents[parseInt(i.toString(),10)].length;r<a;r++){var s,o=this.getDayIndex(e.dayIndex,e.resource,e.day),o=this.element.querySelector("#e-appointment-wrapper-"+o);o&&0<o.childElementCount&&(s=this.overlapEvents[parseInt(i.toString(),10)][parseInt(r.toString(),10)].Guid,0<o.querySelectorAll('div[data-guid="'+s+'"]').length&&s!==e.record.Guid?(o=o.querySelector('div[data-guid="'+s+'"]'),parseFloat(e.width)<=parseFloat(o.style.width)&&(this.parent.enableRtl?o.style.right=this.getEventLeft(e.width,i):o.style.left=this.getEventLeft(e.width,i),o.style.width=parseFloat(e.width)+"%"),t.appWidth=o.style.width):(s=e.width,B.isNullOrUndefined(this.overlapEvents[i-1])&&(s=this.getEventWidth()),t.appWidth=s,t.appLeft=this.getEventLeft(s,e.index)))}return t},r.prototype.setAllDayRowHeight=function(e){var t=this.parent.element.querySelector("."+Vt),i=("auto"!==this.parent.height&&this.parent.enableAllDayScroll||B.addClass([t],Fr),this.parent.element.querySelector("."+Ot));if(i.style.height="",this.parent.uiStateValues.expand&&"auto"!==this.parent.height&&this.parent.enableAllDayScroll)i.style.height=e/12+"em",this.parent.eventBase.allDayExpandScroll(t);else{for(var n=0,r=this.allDayElement;n<r.length;n++)r[n].style.height=e/12+"em";B.removeClass([t],qr)}},r.prototype.addOrRemoveClass=function(){var t=this,e=(this.moreEvents.filter(function(e){!t.parent.uiStateValues.expand&&2<t.allDayLevel?(B.addClass([e],sn),e.setAttribute("tabindex","-1")):(B.removeClass([e],sn),e.setAttribute("tabindex","0"))}),this.element.querySelector("."+ln));this.parent.uiStateValues.expand?(B.removeClass([e],pn),B.addClass([e],cn)):(B.removeClass([e],cn),B.addClass([e],pn)),2<this.allDayLevel?B.removeClass([e],d):B.addClass([e],d),[].slice.call(this.element.querySelectorAll("."+on)).forEach(function(e){!t.parent.uiStateValues.expand&&2<t.allDayLevel?B.removeClass([e],d):B.addClass([e],d)})},r.prototype.getEventHeight=function(){var e=B.createElement("div",{className:V,styles:"visibility:hidden"}),t=(this.element.querySelector("."+rn+":first-child").appendChild(e),e.offsetHeight);return B.remove(e),t},r.prototype.rowExpandCollapse=function(){var e,t=this.element.querySelector("."+ln);this.parent.uiStateValues.expand=t.classList.contains(pn),this.parent.uiStateValues.expand?(t.setAttribute("title",this.parent.localeObj.getConstant("collapseAllDaySection")),t.setAttribute("aria-label",this.parent.localeObj.getConstant("collapseAllDaySection")),e=(this.allDayLevel+1)*this.getEventHeight()+4):(t.setAttribute("title",this.parent.localeObj.getConstant("expandAllDaySection")),t.setAttribute("aria-label",this.parent.localeObj.getConstant("expandAllDaySection")),e=3*this.getEventHeight()+4,this.parent.element.querySelector("."+Vt).scrollTop=0),this.setAllDayRowHeight(e),this.animation.animate(this.allDayElement[0]),this.addOrRemoveClass(),this.animation.animate(t)},r.prototype.animationUiUpdate=function(){this.parent.notify(Ve,{})},r.prototype.destroy=function(){!this.parent||this.parent&&this.parent.isDestroyed||(this.removeEventListener(),this.allDayElement=null,this.renderedAllDayEvents=null,this.renderedEvents=null,this.slotCount=null,this.interval=null,this.startHour=null,this.endHour=null,this.element=null,this.fields=null,this.animation=null,Ga.prototype.destroy.call(this))};var _a,Ga,Xa=r;function r(e){e=Ga.call(this,e)||this;return e.dateRender=[],e.renderedEvents=[],e.renderedAllDayEvents=[],e.overlapEvents=[],e.moreEvents=[],e.overlapList=[],e.allDayEvents=[],e.slotCount=e.parent.activeViewOptions.timeScale.slotCount,e.interval=e.parent.activeViewOptions.timeScale.interval,e.allDayLevel=0,e.startHour=e.getStartEndHours(e.parent.activeViewOptions.startHour),e.endHour=e.getStartEndHours(e.parent.activeViewOptions.endHour),e.element=e.parent.activeView.getPanel(),e.fields=e.parent.eventFields,e.animation=new B.Animation({progress:e.animationUiUpdate.bind(e)}),e.addEventListener(),e}Qa=function(e,t){return(Qa=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}Qa(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(a,Ka=Ya),a.prototype.removeEventWrapper=function(e){if(0<e.length)for(var t=0,i=e="Month"===this.parent.currentView||!this.parent.activeView.isTimelineView()&&!this.parent.activeViewOptions.timeScale.enable?e:[e[0]];t<i.length;t++){var n=i[t];n.parentElement&&n.parentElement.parentNode&&B.remove(n.parentElement)}},a.prototype.renderAppointments=function(){this.parent.dragAndDropModule&&this.parent.dragAndDropModule.setDragArea(),this.isResourceEventTemplate=this.parent.isSpecificResourceEvents();var e,i,t=this.parent.element.querySelector("."+A),n=(this.parent.rowAutoHeight&&(this.parent.uiStateValues.top=t.scrollTop,this.parent.uiStateValues.left=t.scrollLeft),[].slice.call(this.element.querySelectorAll("."+x)));if(this.parent.crudModule&&this.parent.crudModule.crudObj.isCrudAction)for(var r=0,a=this.parent.crudModule.crudObj.sourceEvent.length;r<a;r++){var s=[].slice.call(this.element.querySelectorAll('.e-appointment-wrapper [data-group-index="'+this.parent.crudModule.crudObj.sourceEvent[parseInt(r.toString(),10)].groupIndex+'"]'));this.removeEventWrapper(s),this.parent.crudModule.crudObj.targetEvent[parseInt(r.toString(),10)]&&this.parent.crudModule.crudObj.sourceEvent[parseInt(r.toString(),10)].groupIndex!==this.parent.crudModule.crudObj.targetEvent[parseInt(r.toString(),10)].groupIndex&&(s=[].slice.call(this.element.querySelectorAll('.e-appointment-wrapper [data-group-index="'+this.parent.crudModule.crudObj.targetEvent[parseInt(r.toString(),10)].groupIndex+'"]')),this.removeEventWrapper(s))}else for(var o=0,l=n;o<l.length;o++){var p=l[o];B.remove(p)}this.removeHeightProperty(C),this.element.querySelector("."+O)&&("Month"===this.parent.currentView&&(n=B.createElement("div",{className:x}),(e=this.parent.element.querySelector("."+O)).appendChild(n),this.monthHeaderHeight=n.offsetTop-e.offsetTop,e.removeChild(n)),this.eventHeight=this.parent.getElementHeightFromClass(this.element,V),this.addCellHeight(".e-content-table tbody tr",this.eventHeight,"Month"===this.parent.currentView?0:2,this.monthHeaderHeight,this.moreIndicatorHeight),e=t.scrollTop,this.parent.rowAutoHeight&&this.parent.virtualScrollModule&&!this.parent.virtualScrollModule.isHorizontalScroll&&!B.isNullOrUndefined(this.parent.currentAction)&&(t.scrollTop=t.scrollTop-1),0<this.parent.activeViewOptions.group.resources.length?(this.renderResourceEvents(),this.parent.virtualScrollModule&&this.parent.virtualScrollModule.updateFocusedWorkCell()):this.renderEventsHandler(this.parent.activeView.renderDates,this.parent.activeViewOptions.workDays),this.parent.rowAutoHeight&&(this.updateBlockElements(),n={cssProperties:this.parent.getCssProperties(),module:this.parent.getModuleName(),isPreventScrollUpdate:!0,scrollPosition:{left:this.parent.uiStateValues.left,top:this.parent.uiStateValues.top}},this.parent.virtualScrollModule&&!this.parent.virtualScrollModule.isHorizontalScroll&&(this.parent.currentAction?(t.scrollTop=e,this.parent.currentAction=null):this.parent.virtualScrollModule.updateVirtualScrollHeight()),this.parent.enablePersistence||this.parent.notify(Ve,{}),this.parent.notify(Me,n),"Month"===this.parent.currentView)&&this.parent.showWeekNumber&&(i=[].slice.call(this.parent.element.querySelectorAll(".e-content-wrap table tr td:first-child")),[].slice.call(this.parent.element.querySelectorAll("td."+gi)).forEach(function(e,t){t=i[parseInt(t.toString(),10)].offsetHeight;B.setStyleAttribute(e,{height:t+"px"})}),t=this.parent.element.querySelector("."+ui),B.isNullOrUndefined(t)||(t.scrollTop=this.parent.element.querySelector("."+A).scrollTop)),this.parent.renderTemplates())},a.prototype.renderEventsHandler=function(e,t,i){this.renderedEvents=[];for(var n,r,a,s=0,o=(i?(s=i.groupIndex,this.cssClass=i.cssClass,this.groupOrder=i.groupOrder,n=this.parent.eventBase.filterEventsByResource(i,this.parent.eventsProcessed),r=this.parent.eventBase.filterEventsByResource(i,this.parent.blockProcessed),this.workCells=[].slice.call(this.element.querySelectorAll("."+O+'[data-group-index="'+s+'"]'))):(n=this.parent.eventsProcessed,r=this.parent.blockProcessed,this.workCells=[].slice.call(this.element.querySelectorAll("."+O))),this.sortByDateTime(n),this.sortByDateTime(r),"Month"===this.parent.currentView&&this.parent.rowAutoHeight&&0===this.parent.activeViewOptions.group.resources.length&&(o=[].slice.call(this.parent.element.querySelectorAll(".e-content-wrap table tr td:first-child")),a=this.parent.element.querySelector("."+C).clientHeight/o.length,o.forEach(function(e){B.setStyleAttribute(e,{height:a+"px"})})),this.workCells[this.parent.activeView.isTimelineView()?0:this.workCells.length-1]),l=(this.cellWidth=this.parent.getElementWidth(o),this.cellHeight=this.parent.getElementHeight(o),this.dateRender=e,this.getRenderedDates(e)),p=(this.getSlotDates(t||this.parent.activeViewOptions.workDays),this.processBlockEvents(r,s,i),[]),c=0,h=n;c<h.length;c++){var d=h[c];this.parent.resourceBase&&!i&&(this.cssClass=this.parent.resourceBase.getCssClass(d)),p=p.concat(this.splitEvent(d,l||this.dateRender))}for(var u=0;u<this.slots.length;u++){this.renderedEvents=[];for(var g=this.slots[parseInt(u.toString(),10)],m=Y(new Date(g[g.length-1]),1),v=0,f=this.filterEvents(new Date(g[0]),m,p);v<f.length;v++){var y=f[v];if(this.maxHeight){var T="Month"===this.parent.currentView?y[this.fields.startTime]:this.getStartTime(y,y.data);if(0<this.getIndex(T))continue}this.updateIndicatorIcon(y),this.renderEvents(y,s,n)}}this.cssClass=null,this.groupOrder=null},a.prototype.processBlockEvents=function(e,t,i){for(var n=0,r=e;n<r.length;n++){var a,s,o,l=r[n],p=(this.parent.resourceBase&&!i&&(this.cssClass=this.parent.resourceBase.getCssClass(l)),[]);"day"!==this.renderType||l[this.fields.isAllDay]?p.push(l):(a=B.extend({},l,null,!0),s=this.isSameDate(a[this.fields.startTime],a[this.fields.endTime]),!(a.isBlockIcon=s)&&0<Xe(a[this.fields.startTime])&&((o=B.extend({},l,null,!0))[this.fields.endTime]=Y(z(new Date(l[this.fields.startTime]+"")),1),o.isBlockIcon=!0,a[this.fields.startTime]=o[this.fields.endTime],p.push(o)),!(s=this.isSameDate(a[this.fields.startTime],a[this.fields.endTime]))&&0<Xe(a[this.fields.endTime])&&((o=B.extend({},l,null,!0))[this.fields.startTime]=z(new Date(l[this.fields.endTime]+"")),o.isBlockIcon=!0,p.push(o),a[this.fields.endTime]=o[this.fields.startTime]),p.push(a));for(var c=0,h=p;c<h.length;c++)for(var d=h[c],u=0,g=this.splitEvent(d,this.dateRender);u<g.length;u++){var m=g[u];this.renderBlockEvents(m,t,!!d.isBlockIcon)}}},a.prototype.isSameDate=function(e,t){return new Date(+e).setHours(0,0,0,0)===new Date(+t).setHours(0,0,0,0)},a.prototype.renderBlockEvents=function(e,t,i){var n,r=e.data,a=this.getStartTime(e,r),s=this.getEndTime(e,r),o=this.parent.getIndexOfDate(this.dateRender,z(new Date(a.getTime())));o<0||s<a||(n=this.getCellTd(o),o=this.getPosition(a,s,e[this.fields.isAllDay],o),i?this.renderBlockIndicator(n,o,t):(i=r.count,r=(r=this.getEventWidth(a,s,e[this.fields.isAllDay],i))<=0?this.cellWidth:r,r=e.IsBlock?r-1:r,a=this.parent.enableRtl?0:e.IsBlock?o+1:o,s=this.parent.enableRtl?e.IsBlock?o+1:o:0,i=this.cellHeight-this.monthHeaderHeight,i=e.IsBlock?i-1:i,o=this.getRowTop(t),t=this.createBlockAppointmentElement(e,t,this.isResourceEventTemplate),B.setStyleAttribute(t,{width:r+"px",height:i+"px",left:a+"px",right:s+"px",top:o+"px"}),this.renderEventElement(e,t,n)))},a.prototype.renderBlockIndicator=function(e,t,i){var n=B.createElement("div",{className:"e-icons "+Ti});B.isNullOrUndefined(e.querySelector("."+Ti))&&e.appendChild(n)},a.prototype.getStartTime=function(e,t){return e[this.fields.startTime]},a.prototype.getEndTime=function(e,t){return e[this.fields.endTime]},a.prototype.getCellTd=function(e){return this.workCells[parseInt(e.toString(),10)]},a.prototype.getEventWidth=function(e,t,i,n){return n*this.cellWidth-1},a.prototype.getPosition=function(e,t,i,n){return 0},a.prototype.getRowTop=function(e){return 0},a.prototype.updateIndicatorIcon=function(e){var t,i,n,r,a,s;-1===this.parent.currentView.indexOf("Timeline")||"TimelineMonth"===this.parent.currentView||e[this.fields.isAllDay]||(t=e.data,n=this.parent.activeView.getStartHour(),r=this.parent.activeView.getEndHour(),i=Je(e[this.fields.startTime],n,r),e=Je(e[this.fields.endTime],n,r),n=t[this.fields.startTime],r=t[this.fields.endTime],t.isLeft=t.isLeft||n.getTime()<i.startHour.getTime(),t.isRight=t.isRight||r.getTime()>e.endHour.getTime(),z(n).getTime()!==z(r).getTime()&&(a=i.startHour,e=e.endHour,(s=new Date(z(n))).setHours(e.getHours(),e.getMinutes(),e.getSeconds()),t.isLeft=t.isLeft||n.getTime()>=(a.getDate()===i.endHour.getDate()?s:Y(s,1)).getTime(),r.getTime()!==z(r).getTime())&&(e=new Date(z(r)),t.isRight=t.isRight||r.getTime()<=e.setHours(a.getHours(),a.getMinutes(),a.getSeconds())))},a.prototype.renderResourceEvents=function(){var e=this.parent.uiStateValues.isGroupAdaptive?[this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex]]:this.parent.resourceBase.renderedResources;if(this.parent.crudModule&&this.parent.crudModule.crudObj.isCrudAction){for(var t=0,i=this.parent.crudModule.crudObj.sourceEvent.length;t<i;t++){var n=this.parent.crudModule.crudObj.sourceEvent[parseInt(t.toString(),10)];(!this.parent.uiStateValues.isGroupAdaptive||this.parent.uiStateValues.groupIndex===n.groupIndex&&this.parent.uiStateValues.isGroupAdaptive)&&this.renderEventsHandler(n.renderDates,n.workDays,n),this.parent.crudModule.crudObj.sourceEvent[parseInt(t.toString(),10)].groupIndex!==this.parent.crudModule.crudObj.targetEvent[parseInt(t.toString(),10)].groupIndex&&(n=this.parent.crudModule.crudObj.targetEvent[parseInt(t.toString(),10)],this.renderEventsHandler(n.renderDates,n.workDays,n))}this.parent.crudModule.crudObj.isCrudAction=!1}else for(var r=0,a=e;r<a.length;r++){var s=a[r];this.renderEventsHandler(s.renderDates,s.workDays,s)}},a.prototype.getSlotDates=function(e){this.slots=[];for(var t=this.dateRender.map(function(e){return+e}),i=!this.parent.activeViewOptions.showWeekend||this.parent.activeViewOptions.group.byDate&&this.parent.activeViewOptions.group.hideNonWorkingDays?e.length:7;0<t.length;)this.slots.push(t.splice(0,i))},a.prototype.createAppointmentElement=function(e,t,i){void 0===i&&(i=!1);var n,r,a,s,o=e[this.fields.subject]||this.parent.eventSettings.fields.subject.default||this.parent.localeObj.getConstant("addTitle"),l=B.extend({},e,e.data,!0),l={"data-id":"Appointment_"+e[this.fields.id],role:"button",tabindex:"0","aria-disabled":this.parent.eventBase.getReadonlyAttribute(e),"aria-label":this.parent.getAnnouncementString(l,o)},i=(i||(l["data-guid"]=e.Guid),0<this.parent.activeViewOptions.group.resources.length&&(l["data-group-index"]=t.toString()),B.createElement("div",{className:V,attrs:l})),l=(B.isNullOrUndefined(this.cssClass)||B.addClass([i],this.cssClass),e[this.fields.isReadonly]&&B.addClass([i],"e-read-only"),B.createElement("div",{className:Di})),p=(i.appendChild(l),e.data),c=this.getEventData(e);return B.isNullOrUndefined(this.parent.activeViewOptions.eventTemplate)?(r=e[this.fields.location]||this.parent.eventSettings.fields.location.default||"",a=B.createElement("div",{className:Gn}),this.parent.sanitize(o+(r?"; "+r:""),a),o=B.createElement("div",{className:Ci+(this.parent.isAdaptive?" "+d:""),innerHTML:this.parent.getTimeString(p[this.fields.startTime])}),n=B.createElement("div",{className:Ci+(this.parent.isAdaptive?" "+d:""),innerHTML:this.parent.getTimeString(p[this.fields.endTime])}),"Month"===this.parent.currentView?e[this.fields.isAllDay]?(s=[a],B.addClass([a],"e-text-center")):p.count<=1&&!p.isLeft&&!p.isRight?s=[o,a]:(s=[],B.addClass([a],"e-text-center"),p.isLeft||s.push(o),s.push(a),p.isRight||s.push(n)):(o=void 0,o=e[this.fields.isAllDay]?[a,B.createElement("div",{className:Ci,innerHTML:this.parent.localeObj.getConstant("allDay")})]:(n=this.parent.getTimeString(p[this.fields.startTime])+" - "+this.parent.getTimeString(p[this.fields.endTime]),p=B.createElement("div",{className:Ci+(this.parent.isAdaptive?" "+d:""),innerHTML:n}),n=B.createElement("div",{className:Xn}),this.parent.sanitize(r,n),[a,p,n]),r=B.createElement("div",{className:"e-inner-wrap"}),B.append(o,r),s=[r])):(a=this.parent.element.id+"_"+this.parent.activeViewOptions.eventTemplateName+"eventTemplate",p=this.isResourceEventTemplate?this.parent.getEventTemplateName(t):"eventTemplate",s=this.parent.getAppointmentTemplate()(c,this.parent,p,a,!1,void 0,void 0,this.parent.root)),B.append(s,l),this.appendEventIcons(e,l),this.renderResizeHandler(i,e.data,e[this.fields.isReadonly]),i},a.prototype.appendEventIcons=function(e,t){var i=e.data;B.isNullOrUndefined(e[this.fields.recurrenceRule])&&B.isNullOrUndefined(e[this.fields.recurrenceID])||(e=e[this.fields.id]===e[this.fields.recurrenceID]?en:tn,t.appendChild(B.createElement("div",{className:Dt+" "+e+(this.parent.isAdaptive?" "+d:"")}))),i.isLeft&&(e=B.createElement("div",{className:Fi+" "+Dt+" "+Ui}),B.prepend([e],t)),i.isRight&&(e=B.createElement("div",{className:Fi+" "+Dt+" "+Bi}),B.append([e],t))},a.prototype.renderEvents=function(e,t,i){var n=e[this.fields.startTime],r=e[this.fields.endTime],a=this.parent.getIndexOfDate(this.dateRender,z(n));if(!(a<0||n.getTime()<this.parent.minDate.getTime()||r.getTime()>this.parent.maxDate.getTime())){var s=this.parent.rowAutoHeight?1:this.parent.activeViewOptions.maxEventsPerRow,o=this.getIndex(n),l=(e.Index=o,e.data.count);if(n.getTime()<=r.getTime()){var n=l*this.cellWidth-5,r=this.workCells[parseInt(a.toString(),10)],p=o*(this.eventHeight+0),c=this.monthHeaderHeight+(o+1)*(this.eventHeight+0)+this.moreIndicatorHeight,o=!this.parent.activeViewOptions.maxEventsPerRow||this.parent.rowAutoHeight||this.parent.eventSettings.enableIndicator?this.maxOrIndicator?o<1:this.cellHeight>c:o<s;if(this.parent.rowAutoHeight||o){this.renderedEvents.push(B.extend({},e,null,!0));s=void 0,s=this.inlineValue?this.parent.inlineModule.createInlineAppointmentElement():this.createAppointmentElement(e,t);this.applyResourceColor(s,e,"backgroundColor",this.groupOrder),this.wireAppointmentEvents(s,e),B.setStyleAttribute(s,{width:n+"px",top:p+"px"}),this.renderEventElement(e,s,r),this.parent.rowAutoHeight&&(o=this.parent.element.querySelector("."+A),t=this.parent.getElementWidth(o),n=o.offsetHeight===o.clientHeight&&o.offsetWidth===o.clientWidth,p=r.parentElement.firstElementChild,this.updateCellHeight(p,c),n)&&(o.offsetWidth>o.clientWidth||t!==this.parent.getElementWidth(o))&&this.adjustAppointments(t)}else for(var h,d,u,g=0;g<l;g++)this.workCells[a+g]&&((u=this.workCells[a+g].querySelector("."+hn))?(h=parseInt(u.getAttribute("data-count"),10)+1,u.setAttribute("data-count",h.toString()),u.setAttribute("aria-label",h+" "+this.parent.localeObj.getConstant("moreEvents")),u.innerHTML=this.getMoreIndicatorText(h)):(u=new Date(this.dateRender[a+g].getTime()),h=Y(this.dateRender[a+g],1),d=this.workCells[a+g].getAttribute("data-group-index"),u=this.getMoreIndicatorElement(1,u,h),B.isNullOrUndefined(d)||u.setAttribute("data-group-index",d),u.style.top=this.cellHeight-this.monthHeaderHeight-this.moreIndicatorHeight+"px",u.style.width=this.cellWidth-2+"px",this.renderElement(this.workCells[a+g],u),B.EventHandler.add(u,"click",this.moreIndicatorClick,this)))}}},a.prototype.adjustAppointments=function(e){var t=this,i=this.parent.element.querySelector("."+C+" tbody tr"),n=this.parent.getElementWidth(this.workCells[0]),r=(this.cellWidth=n/+(this.workCells[0].getAttribute("colspan")||1),n*i.children.length/(e/100));[].slice.call(this.parent.element.querySelectorAll("."+V)).forEach(function(e){t.parent.enableRtl&&"0px"!==e.style.right?e.style.right=parseFloat(e.style.right)/100*r+"px":"0px"!==e.style.left&&(e.style.left=parseFloat(e.style.left)/100*r+"px"),e.style.width=parseFloat(e.style.width)/100*r+"px"})},a.prototype.updateCellHeight=function(e,t){t>e.offsetHeight&&B.setStyleAttribute(e,{height:t+"px"})},a.prototype.updateBlockElements=function(){for(var e=0,t=[].slice.call(this.element.querySelectorAll("."+yi));e<t.length;e++){var i=t[e],n=B.closest(i,"tr"),n=(this.monthHeaderHeight=i.offsetParent.offsetTop-n.offsetTop,i.style.height=n.offsetHeight-1-this.monthHeaderHeight+"px",n.firstElementChild),r=Math.round(i.offsetWidth/n.offsetWidth);i.style.width=n.offsetWidth*r+"px"}},a.prototype.getFilteredEvents=function(e,t,i,n){return B.isNullOrUndefined(i)?this.filterEvents(e,t):(i=this.parent.resourceBase.lastResourceLevel[parseInt(i,10)],this.filterEvents(e,t,B.isNullOrUndefined(n)?void 0:n,i))},a.prototype.getOverlapEvents=function(e,t){for(var i=[],n=z(e).getTime(),r=0,a=t;r<a.length;r++){var s=a[r];z(s[this.fields.startTime]).getTime()<=n&&z(s[this.fields.endTime]).getTime()>=n&&i.push(s)}return i},a.prototype.getIndex=function(e){var t=-1,i=this.renderedEvents;return-1===(t=0<i.length?0<(e=this.getOverlapEvents(e,i).map(function(e){return e.Index})).length?this.getSmallestMissingNumber(e):0:t)?0:t},a.prototype.moreIndicatorClick=function(i){var n=this,e=B.closest(i.target,"."+hn),r=new Date(parseInt(e.getAttribute("data-start-date"),10)),a=new Date(parseInt(e.getAttribute("data-end-date"),10)),s=e.getAttribute("data-group-index"),e={cancel:!1,event:i,element:e,isPopupOpen:!0,startTime:r,endTime:a,viewName:this.parent.getNavigateView()};s&&(e.groupIndex=parseInt(s,10)),this.parent.trigger(U,e,function(e){var t;e.cancel||(e.isPopupOpen?(t=n.getFilteredEvents(r,a,s),t={date:r,event:t,element:i.target},n.parent.quickPopup.moreEventClick(t,a,s)):(n.parent.setProperties({selectedDate:r},!0),n.parent.changeView(e.viewName,i)))})},a.prototype.renderEventElement=function(e,t,i){var n=this,r=t.classList.contains(yi)?"blockEvent":"event",a=t.classList.contains(V),e="Month"===this.parent.currentView?this.getSpannedTime(e):this.getEventData(e);this.parent.trigger(ie,{data:e,element:t,cancel:!1,type:r},function(e){e.cancel?n.renderedEvents.pop():n.renderElement(i,t,a)})},a.prototype.getSpannedTime=function(e){e=B.extend({},e,null,!0);return e[this.fields.startTime].getDate()===e.data[this.fields.startTime].getDate()&&(e[this.fields.startTime]=e.data[this.fields.startTime]),e[this.fields.endTime].getDate()===e.data[this.fields.endTime].getDate()&&(e[this.fields.endTime]=e.data[this.fields.endTime]),e},a.prototype.getEventData=function(e){var t=B.extend({},e,null,!0);return t[this.fields.startTime]=e.data[this.fields.startTime],t[this.fields.endTime]=e.data[this.fields.endTime],t},a.prototype.renderElement=function(e,t,i){void 0===i&&(i=!1),this.maxOrIndicator&&i&&this.setMaxEventHeight(t,e);var i=e.querySelector("."+x);i?i.appendChild(t):((i=B.createElement("div",{className:x})).appendChild(t),e.appendChild(i))},a.prototype.getMoreIndicatorElement=function(e,t,i){return B.createElement("div",{className:hn,innerHTML:this.getMoreIndicatorText(e),attrs:{role:"button",tabindex:"0","aria-label":this.parent.globalize.formatNumber(e)+" "+this.parent.localeObj.getConstant("moreEvents"),"data-count":e.toString(),"data-start-date":t.getTime().toString(),"data-end-date":i.getTime().toString()}})},a.prototype.getMoreIndicatorText=function(e){return"+"+this.parent.globalize.formatNumber(e)+" "+(this.parent.isAdaptive?"":this.parent.localeObj.getConstant("more"))},a.prototype.removeHeightProperty=function(e){for(var t=0,i=[].slice.call(this.element.querySelectorAll("."+e+" tbody tr"));t<i.length;t++)i[t].firstElementChild.style.height=""},a.prototype.setMaxEventHeight=function(e,t){var i=ot(t.querySelector("."+Pi)),t=t.offsetHeight-i-(this.maxHeight?0:this.moreIndicatorHeight);B.setStyleAttribute(e,{height:t+"px","align-items":"center"})},a.prototype.destroy=function(){this.element=null,this.fields=null,this.maxHeight=null,this.withIndicator=null,this.maxOrIndicator=null,this.moreIndicatorHeight=null,this.removeEventListener(),Ka.prototype.destroy.call(this)};var Qa,Ka,Za=a;function a(e){e=Ka.call(this,e)||this;return e.renderedEvents=[],e.monthHeaderHeight=0,e.moreIndicatorHeight=19,e.renderType="day",e.element=e.parent.activeView.getPanel(),e.fields=e.parent.eventFields,e.maxHeight=e.parent.eventSettings.enableMaxHeight&&!e.parent.eventSettings.enableIndicator&&!e.parent.rowAutoHeight,e.withIndicator=e.parent.eventSettings.enableMaxHeight&&e.parent.eventSettings.enableIndicator&&!e.parent.rowAutoHeight,e.maxOrIndicator=e.maxHeight||e.withIndicator,e.moreIndicatorHeight=e.parent.rowAutoHeight&&e.parent.eventSettings.ignoreWhitespace?0:e.moreIndicatorHeight,e.addEventListener(),e}Ja=function(e,t){return(Ja=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}Ja(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(s,$a=Za),s.prototype.getSlotDates=function(){var e;this.slots=[],this.slots.push(this.parent.activeView.renderDates.map(function(e){return+e})),0<this.parent.activeViewOptions.headerRows.length&&"Hour"!==this.parent.activeViewOptions.headerRows.slice(-1)[0].option?(this.renderType="day",e=this.content.querySelector("."+O),this.cellWidth=this.parent.getElementWidth(e)/+(e.getAttribute("colspan")||1),this.slotsPerDay=1):this.slotsPerDay=this.dayLength/this.dateRender.length},s.prototype.getOverlapEvents=function(e,t){var i=[];if("day"===this.renderType)for(var n=0,r=t;n<r.length;n++)z((o=r[n])[this.fields.startTime]).getTime()<=z(new Date(e.getTime())).getTime()&&z(o[this.fields.endTime]).getTime()>=z(new Date(e.getTime())).getTime()&&i.push(o);else for(var a=0,s=t;a<s.length;a++){var o,l=(o=s[a]).data;(l.trimStartTime.getTime()<=e.getTime()&&l.trimEndTime.getTime()>e.getTime()||l.trimStartTime.getTime()===e.getTime()&&l.trimEndTime.getTime()===e.getTime())&&i.push(o)}return i},s.prototype.getSortComparerIndex=function(e,t){var i=-1,n=this.renderedEvents;return-1===(i=0<n.length?0<(e=this.getOverlapSortComparerEvents(e,t,n).map(function(e){return e.Index})).length?this.getSmallestMissingNumber(e):0:i)?0:i},s.prototype.getOverlapSortComparerEvents=function(s,o,e){for(var l=[],t=function(e){var t,i,n,r,a;"day"===p.renderType?(t=z(s).getTime(),i=z(o).getTime(),n=z(e[p.fields.startTime]).getTime(),r=z(e[p.fields.endTime]).getTime(),(n<=t&&t<=r||(a=(a=i-(Xe(o)<=0?W:0))<t?t:a)<=r&&n<=a||t<n&&r<i)&&l.push(e)):((a=e.data).trimStartTime.getTime()<=s.getTime()&&s.getTime()<a.trimEndTime.getTime()||s.getTime()<=a.trimStartTime.getTime()&&a.trimStartTime.getTime()<o.getTime())&&l.push(e)},p=this,i=0,n=e;i<n.length;i++)t(n[i]);return l},s.prototype.renderResourceEvents=function(){this.removeHeightProperty(zt);this.addCellHeight(".e-resource-column-table tbody tr",this.eventHeight,2,this.moreIndicatorHeight,0,!1);var e=this.parent.uiStateValues.isGroupAdaptive?[this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex]]:this.parent.resourceBase.renderedResources;if(this.parent.crudModule&&this.parent.crudModule.crudObj.isCrudAction){for(var t=0,i=this.parent.crudModule.crudObj.sourceEvent.length;t<i;t++){var n=this.parent.crudModule.crudObj.sourceEvent[parseInt(t.toString(),10)];this.rowIndex=n.groupIndex,(!this.parent.uiStateValues.isGroupAdaptive||this.parent.uiStateValues.groupIndex===n.groupIndex&&this.parent.uiStateValues.isGroupAdaptive)&&this.renderEventsHandler(this.parent.activeView.renderDates,this.parent.activeViewOptions.workDays,n),this.parent.crudModule.crudObj.targetEvent[parseInt(t.toString(),10)]&&this.parent.crudModule.crudObj.sourceEvent[parseInt(t.toString(),10)].groupIndex!==this.parent.crudModule.crudObj.targetEvent[parseInt(t.toString(),10)].groupIndex&&(n=this.parent.crudModule.crudObj.targetEvent[parseInt(t.toString(),10)],this.rowIndex=n.groupIndex,this.renderEventsHandler(this.parent.activeView.renderDates,this.parent.activeViewOptions.workDays,n))}this.parent.crudModule.crudObj.isCrudAction=!1}else for(t=0;t<e.length;t++)this.rowIndex=t,this.renderEventsHandler(this.parent.activeView.renderDates,this.parent.activeViewOptions.workDays,e[parseInt(t.toString(),10)])},s.prototype.renderEvents=function(e,t,i){var n=e[this.fields.startTime],r=e[this.fields.endTime];if(!(n.getTime()<this.parent.minDate.getTime()||r.getTime()>this.parent.maxDate.getTime())){var a=e.data,n=this.getStartTime(e,a),r=this.getEndTime(e,a),s=Je(e[this.fields.startTime],this.startHour,this.endHour),s=this.updateEventMinimumDuration(s,n,r);if(n=s.startDate,r=s.endDate,this.day=this.parent.getIndexOfDate(this.dateRender,z(new Date(n.getTime()))),!(this.day<0)){var o=this.getCellTd(),s=this.parent.rowAutoHeight?1:this.parent.activeViewOptions.maxEventsPerRow,l=B.isNullOrUndefined(this.parent.eventSettings.sortComparer)?this.getIndex(n):this.getSortComparerIndex(n,r),p=(e.Index=l,this.eventHeight),c=a.count,h=B.extend({},e,null,!0);h[this.fields.startTime]=a[this.fields.startTime],h[this.fields.endTime]=a[this.fields.endTime];var a=Je(z(new Date(this.dateRender[this.day].getTime())),this.startHour,this.endHour),d=!0,d=!(!this.isDayProcess()&&!h[this.fields.isAllDay])||this.isValidEvent(h,n,r,a);if(n<=r&&d){var h=this.getEventWidth(n,r,e[this.fields.isAllDay],c),h="day"===this.renderType?h-2:h,a=this.getPosition(n,r,e[this.fields.isAllDay],this.day),u=(h=h<=0?this.cellWidth:h,this.renderedEvents.push(B.extend({},e,null,!0)),B.isNullOrUndefined(this.cellTops[parseInt(t.toString(),10)])&&(this.cellTops[parseInt(t.toString(),10)]=this.getRowTop(t)),this.cellTops[parseInt(t.toString(),10)]),d=u+(this.maxHeight?0:2)+l*(p+2),g=this.parent.enableRtl?0:a,m=this.parent.enableRtl?a:0,a=(l+1)*(p+2)+this.moreIndicatorHeight,l=!this.parent.activeViewOptions.maxEventsPerRow||this.parent.rowAutoHeight||this.parent.eventSettings.enableIndicator?this.maxOrIndicator?l<1:this.cellHeight>a:l<s;if(this.parent.rowAutoHeight||l){var v,s=void 0,s=B.isNullOrUndefined(this.inlineValue)?this.createAppointmentElement(e,t):this.parent.inlineModule.createInlineAppointmentElement();this.applyResourceColor(s,e,"backgroundColor",this.groupOrder),B.setStyleAttribute(s,{width:h+"px",left:g+"px",right:m+"px",top:d+"px"}),this.wireAppointmentEvents(s,e),this.parent.rowAutoHeight?(l=this.parent.element.querySelector("."+A),h=this.parent.getElementWidth(l),d=l.offsetHeight===l.clientHeight&&l.offsetWidth===l.clientWidth,this.renderEventElement(e,s,o),v=this.getFirstChild(t),this.updateCellHeight(v,a),d&&(l.offsetWidth>l.clientWidth||h!==this.parent.getElementWidth(l))&&this.adjustAppointments(h)):this.renderEventElement(e,s,o)}else for(var f=0;f<c;f++){var y=o.querySelector("."+hn),T=this.parent.enableRtl?m:g,T=Math.floor(T/this.cellWidth)*this.cellWidth,w=this.interval/this.slotCount,D="TimelineMonth"===this.parent.activeViewOptions.option||"day"===this.renderType||0!==f?new Date(this.dateRender[this.day+f].getTime()):new Date(n),b=Y(this.dateRender[this.day+f],1);if("TimelineMonth"===this.parent.activeViewOptions.option||"day"===this.renderType){var S=this.getPosition(D,b,e[this.fields.isAllDay],this.day+f);this.renderTimelineMoreIndicator(n,D,b,p,w,t,i,u,g,m,o,y,T,S)}else for(var C=(ct(r)-ct(n))/je*this.slotCount/this.interval,O=0;O<C&&(D=0===O?new Date(D.getTime()):new Date(D.getTime()+6e4*w),C<1&&(D=this.adjustToNearestTimeSlot(D,w)),b=new Date(D.getTime()+6e4*w),!(1<=C&&b.getTime()>r.getTime()));O++){var E=this.getPosition(D,b,!1,this.day+f);if(E<T)break;this.renderTimelineMoreIndicator(n,D,b,p,w,t,i,u,g,m,o,y,T=E,E)}}}this.parent.renderTemplates()}}},s.prototype.adjustToNearestTimeSlot=function(e,t){var e=new Date(e),i=60*e.getHours()*60*1e3+60*e.getMinutes()*1e3,i=Math.floor(i/(60*t*1e3))*(60*t*1e3),t=new Date(e.getTime());return t.setHours(i/36e5%24),t.setMinutes(i%36e5/6e4),t},s.prototype.renderTimelineMoreIndicator=function(e,t,i,n,r,a,s,o,l,p,c,h,d,u){l=this.parent.enableRtl?p=u:u,d=this.parent.enableRtl?p:l,d=Math.floor(d/this.cellWidth)*this.cellWidth,(c&&B.isNullOrUndefined(h)||!this.isAlreadyAvail(d,c))&&(u="TimelineMonth"===this.parent.activeViewOptions.option||"day"===this.renderType?new Date(+e):t,h=new Date(u.setMinutes(Math.floor(u.getMinutes()/r)*r)),d=new Date(h.getTime()+6e4*r),e=void 0,0<this.parent.activeViewOptions.group.resources.length&&!B.isNullOrUndefined(a)&&(e=a.toString()),u=this.getFilterEvents(t,i,h,d,e,s),r=this.cellHeight-this.moreIndicatorHeight,n=this.withIndicator?r-2:n,a=Math.floor(r/(n+2)),s=this.parent.activeViewOptions.maxEventsPerRow&&!this.parent.eventSettings.enableIndicator?u.length-this.parent.activeViewOptions.maxEventsPerRow:u.length-a<=0?1:u.length-a,n=void 0,n="day"===this.renderType?this.getMoreIndicatorElement(s,t,i):this.getMoreIndicatorElement(s,h,d),B.isNullOrUndefined(e)||n.setAttribute("data-group-index",e),n.style.top=o+r+"px",n.style.width=this.cellWidth+"px",n.style.left=Math.floor(l/this.cellWidth)*this.cellWidth+"px",n.style.right=Math.floor(p/this.cellWidth)*this.cellWidth+"px",this.renderElement(c,n),B.EventHandler.add(n,"click",this.moreIndicatorClick,this))},s.prototype.updateCellHeight=function(e,t){var i;(""===e.style.height?this.cellHeight:parseInt(e.style.height,10))<t&&(B.setStyleAttribute(e,{height:t+"px"}),0<this.parent.activeViewOptions.group.resources.length&&(i=this.parent.element.querySelector("."+zt+' tbody td[data-group-index="'+e.getAttribute("data-group-index")+'"]'))&&B.setStyleAttribute(i,{height:t+"px"}),i=this.parent.element.querySelector(".e-month-header-wrapper table tr:nth-child("+(e.parentElement.rowIndex+1)+") td"))&&B.setStyleAttribute(i,{height:t+"px"})},s.prototype.getFirstChild=function(e){var t="";return 0<this.parent.activeViewOptions.group.resources.length&&(t='[data-group-index="'+e.toString()+'"]'),this.parent.element.querySelector(".e-content-table tbody td"+t)},s.prototype.updateBlockElements=function(){for(var e=0,t=[].slice.call(this.element.querySelectorAll("."+yi));e<t.length;e++){var i=t[e],n=parseInt(i.getAttribute("data-group-index"),10),r=this.getFirstChild(n),a=(i.style.height=r.offsetHeight-1+"px",i.offsetWidth/r.offsetWidth);i.style.width=r.offsetWidth*a+"px"}for(var s=0,o=[].slice.call(this.element.querySelectorAll("."+Ti));s<o.length;s++){i=o[s],n=parseInt(i.getAttribute("data-group-index"),10);i.style.top=this.getRowTop(n)+this.getFirstChild(n).offsetHeight-18+"px"}},s.prototype.getStartTime=function(e,t){var i=Je(n=e[this.fields.startTime],this.startHour,this.endHour),n=this.isDayProcess()?e[this.fields.startTime]:i.startHour.getTime()>=t[this.fields.startTime]?i.startHour:i.endHour.getTime()<=t[this.fields.startTime]?this.getNextDay(i.startHour,t):t[this.fields.startTime];return t.trimStartTime=e[this.fields.isAllDay]?i.startHour:t[this.fields.startTime],n},s.prototype.getNextDay=function(e,t){for(var i,n=1;n<=this.dateRender.length;n++)if(i=Y(e,n),-1!==this.parent.getIndexOfDate(this.dateRender,z(new Date(e.getTime()))))return t.count=t.count-1,i;return i},s.prototype.getEndTime=function(e,t){var i=e[this.fields.endTime],n=Je(i,this.startHour,this.endHour);return this.isDayProcess()?i=t[this.fields.endTime]:(i=t[this.fields.endTime],(n.endHour.getTime()<=t[this.fields.endTime]||e[this.fields.isAllDay])&&(i=n.endHour),n.startHour.getTime()>=t[this.fields.endTime].getTime()&&!e[this.fields.isAllDay]&&(i=this.getPreviousDay(n.startHour,n.endHour,t))),t.trimEndTime=e[this.fields.isAllDay]?n.endHour:t[this.fields.endTime],i},s.prototype.getPreviousDay=function(e,t,i){for(var n=1;n<=this.dateRender.length;n++){var r,a,s=Y(t,-n);if(-1!==this.parent.getIndexOfDate(this.dateRender,z(new Date(e.getTime()))))return(s=z(new Date(s.getTime()))).setHours(t.getHours(),t.getMinutes(),t.getSeconds()),r=i.count,a=i[this.fields.endTime],i.count=0!==a.getHours()||0!==a.getMinutes()?r-1:r,s}return i[this.fields.endTime]},s.prototype.getEventWidth=function(e,t,i,n){return"day"===this.renderType||i?n*this.slotsPerDay*this.cellWidth:this.isSameDay(e,t)?this.getSameDayEventsWidth(e,t):this.getSpannedEventsWidth(e,t,n)},s.prototype.getSameDayEventsWidth=function(e,t){return(ct(t)-ct(e))/je*(this.cellWidth*this.slotCount)/this.getIntervalInMinutes(e)},s.prototype.getSpannedEventsWidth=function(e,t,i){var n,r,i=i*this.slotsPerDay*this.cellWidth,a=Je(z(new Date(e.getTime())),this.startHour,this.endHour),a=this.getSameDayEventsWidth(a.startHour,e),t=a+(r=-1===this.parent.getIndexOfDate(this.dateRender,z(new Date(t.getTime())))||(n=(e=Je(z(new Date(t.getTime())),this.startHour,this.endHour)).startHour,e=e.endHour,r=this.interval/this.slotCount,n=this.getEndTimeOfLastSlot(n,e,r),r=this.getSameDayEventsWidth(t,e<n?e:n),this.slotsPerDay*this.cellWidth===r)?0:r);return t<i?i-t:i-a},s.prototype.getEndTimeOfLastSlot=function(e,t,i){t=(t.getTime()-e.getTime())/6e4,t=Math.floor(t/i)*i,i=new Date(e);return i.setMinutes(t),i},s.prototype.isSameDay=function(e,t){return this.parent.getIndexOfDate(this.dateRender,z(new Date(e.getTime())))===this.parent.getIndexOfDate(this.dateRender,z(new Date(t.getTime())))},s.prototype.getAppointmentLeft=function(e,t,i){t=this.isSameDay(t,e.startHour)?(ct(t)-ct(e.startHour))/(je*this.getIntervalInMinutes(t))*this.slotCount:0;return 0===i?t:Math.round((ct(e.endHour)-ct(e.startHour))/this.interval/je*this.slotCount)*i+t},s.prototype.getPosition=function(e,t,i,n){return"day"===this.renderType||i?n*this.slotsPerDay*this.cellWidth:((i=Je(z(new Date(this.dateRender[parseInt(n.toString(),10)].getTime())),this.startHour,this.endHour)).endHour.getTime()<=t.getTime()&&i.startHour.getTime()>=e.getTime()||!(i.endHour.getTime()<=t.getTime())&&i.startHour.getTime()>=e.getTime()?this.getAppointmentLeft(i,i.startHour,n):this.getAppointmentLeft(i,e,n))*this.cellWidth},s.prototype.getFilterEvents=function(e,t,i,n,r,a){return"day"===this.renderType?this.getFilteredEvents(e,t,r,a):this.getFilteredEvents(i,n,r,a)},s.prototype.getIntervalInMinutes=function(e){return 1!==this.slotsPerDay?this.interval:((e=Je(z(new Date(e.getTime())),this.startHour,this.endHour)).endHour.getTime()-e.startHour.getTime())/je},s.prototype.isAlreadyAvail=function(e,t){for(var i=[].slice.call(t.querySelectorAll("."+hn)),n=0;n<i.length;n++){var r=void 0;if(i&&(r=this.parent.enableRtl?i[parseInt(n.toString(),10)].style.right:i[parseInt(n.toString(),10)].style.left),parseInt(r,10)===Math.floor(e))return!0}return!1},s.prototype.getRowTop=function(e){return 0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive?this.parent.element.querySelector("."+A+' tbody td[data-group-index="'+e.toString()+'"]').offsetTop:0},s.prototype.getCellTd=function(){var e=this.parent.uiStateValues.isGroupAdaptive?0:this.rowIndex;return this.eventContainers[parseInt(e.toString(),10)]},s.prototype.renderBlockIndicator=function(e,t,i){var n;0<this.parent.headerRows.length&&("Hour"!==this.parent.headerRows[this.parent.headerRows.length-1].option||"Date"!==this.parent.headerRows[this.parent.headerRows.length-1].option)||(t=Math.floor(t/this.cellWidth)*this.cellWidth+this.cellWidth-22,this.isAlreadyAvail(t,e))||(n=B.createElement("div",{className:"e-icons "+Ti}),0<this.parent.activeViewOptions.group.resources.length&&n.setAttribute("data-group-index",i.toString()),this.parent.enableRtl?n.style.right=t+"px":n.style.left=t+"px",n.style.top=this.getRowTop(i)+this.cellHeight-18+"px",this.renderElement(e,n))},s.prototype.setMaxEventHeight=function(e,t){B.setStyleAttribute(e,{height:this.cellHeight-(this.maxHeight?0:2)-(this.maxHeight?0:this.moreIndicatorHeight)+"px"})},s.prototype.isDayProcess=function(){return"TimelineMonth"===this.parent.currentView||!this.parent.activeViewOptions.timeScale.enable||0<this.parent.activeViewOptions.headerRows.length&&"Hour"!==this.parent.activeViewOptions.headerRows.slice(-1)[0].option},s.prototype.destroy=function(){this.renderType=null,this.eventContainers=null,this.dayLength=null,this.content=null,$a.prototype.destroy.call(this),this.parent=null};var Ja,$a,es=s;function s(e,t){e=$a.call(this,e)||this,e.startHour=e.parent.activeView.getStartHour(),e.endHour=e.parent.activeView.getEndHour(),e.slotCount=e.parent.activeViewOptions.timeScale.slotCount,e.interval=e.parent.activeViewOptions.timeScale.interval,e.day=0,e.rowIndex=0,e.cellTops=[],e.renderType=t,e.eventContainers=[].slice.call(e.element.querySelectorAll("."+fi)),t=[].slice.call(e.element.querySelectorAll("."+C+" tbody tr"));return e.dayLength=0===t.length?0:t[0].children.length,e.content=e.parent.element.querySelector("."+Ct+"."+C),e}is.prototype.inlineEdit=function(e){var t;this.parent.quickPopup&&this.parent.quickPopup.quickPopupHide(),"Cell"===e.type?((t=this.parent.element.querySelector("."+Sn))&&t.classList.contains(xt)&&this.parent.quickPopup.morePopup.hide(),this.removeInlineAppointmentElement(),this.cellEdit(e)):(this.parent.element.querySelector("."+Pr)!==e.element.querySelector("."+Pr)&&this.removeInlineAppointmentElement(),this.eventEdit(e))},is.prototype.cellEdit=function(e){var t=this.generateEventData(),i=e.element.cellIndex,n=this.getEventDaysCount(t),n=(1<n&&(n=Math.round(n),i-=--n),z(new Date(""+t[this.parent.eventFields.startTime])).getTime()),r=z(new Date(""+t[this.parent.eventFields.endTime])).getTime(),e=e.groupIndex||0,a="Day"===this.parent.currentView||"Week"===this.parent.currentView||"WorkWeek"===this.parent.currentView,s=(this.parent.activeViewOptions.timeScale.enable&&a?(s=t[this.parent.eventFields.startTime].getDay(),this.createVerticalViewInline(t,s,e,i)):"Month"===this.parent.currentView||!this.parent.activeViewOptions.timeScale.enable&&a?this.createMonthViewInline(t,e,n,r):this.createTimelineViewInline(t,n,r,e),this.parent.element.querySelector("."+Pr));s&&s.focus()},is.prototype.eventEdit=function(e){var t,i,n,r=e.element.querySelector("."+Pr);B.addClass([e.element],Nr),r?t=r.value:(i=e.element.querySelector("."+Gn),B.isNullOrUndefined(i)||B.addClass([i],d),t=!B.isNullOrUndefined(e.data)&&e.data[this.parent.eventFields.subject]||this.parent.eventSettings.fields.subject.default||this.parent.localeObj.getConstant("addTitle"),r=this.inlineInputEle=B.createElement("input",{className:Pr,attrs:{value:t}}),B.closest(e.element,"."+Sn)?e.element.insertBefore(r,i):-1<["Agenda","MonthAgenda"].indexOf(this.parent.currentView)?(n=e.element.querySelector("."+bi),B.isNullOrUndefined(n)&&(n=B.createElement("div",{className:bi}),e.element.prepend(n)),n.insertBefore(r,n.firstChild)):(n=-1<["TimelineDay","TimelineWeek","TimelineWorkWeek","TimelineMonth"].indexOf(this.parent.currentView)?".e-inner-wrap":".e-appointment-details",n=e.element.querySelector(n),B.isNullOrUndefined(n)?e.element.querySelector(".e-appointment-details").prepend(r):i&&this.parent.activeViewOptions&&!this.parent.activeViewOptions.eventTemplate?n.insertBefore(r,i):n.prepend(r)),r.focus()),r.setSelectionRange(t.length,t.length)},is.prototype.createVerticalViewInline=function(e,t,i,n){var r,a=this.getEventDaysCount(e),s=new Xa(this.parent),t=(s.initializeValues(),s.dateRender[parseInt(i.toString(),10)].map(function(e){return e.getDay()}).indexOf(t));1<=a?(s.allDayElement=[].slice.call(this.parent.element.querySelectorAll("."+w)),(a=s.slots).push.apply(a,this.parent.activeView.renderDates.map(function(e){return+e})),(a=0)<(r=[].slice.call(this.parent.element.querySelectorAll("."+an))).length&&(a=Math.floor(this.parent.getElementHeight(this.parent.element.querySelector("."+Ot))/r[0].offsetHeight)-1),s.allDayLevel=a,r=this.parent.getElementHeightFromClass(this.parent.element.querySelector("."+rn),V),a=0<s.allDayElement.length?s.allDayElement[0].offsetTop:0,s.renderAllDayEvents(e,t,i,n,this.parent.allowInline,a,r)):s.renderNormalEvents(e,t,i,n,this.parent.allowInline)},is.prototype.createMonthViewInline=function(e,t,i,n){for(var r=this.getEventDaysCount(e),e=this.parent.eventBase.cloneEventObject(e,i,n,r,!1,!1),a=new Za(this.parent),i=(a.dateRender=this.parent.activeView.renderDates,a.inlineValue=this.parent.allowInline,this.parent.activeView.renderDates),n=this.parent.activeViewOptions.workDays,r="."+O,s=(0<this.parent.activeViewOptions.group.resources.length&&(r+='[data-group-index="'+t+'"]',i=(s=this.parent.resourceBase.lastResourceLevel[parseInt(t.toString(),10)]).renderDates,n=s.workDays),a.dateRender=i,a.workCells=[].slice.call(this.parent.element.querySelectorAll(r)),a.cellWidth=a.workCells[0].offsetWidth,a.cellHeight=a.workCells[0].offsetHeight,a.eventHeight=this.parent.getElementHeightFromClass(this.parent.monthModule.element||a.element,V),a.getSlotDates(n),a.getRenderedDates(i)),o=0,l=a.splitEvent(e,s||i);o<l.length;o++){var p=l[o];a.renderEvents(p,t)}this.parent.element.querySelector("."+Pr).focus()},is.prototype.createTimelineViewInline=function(e,t,i,n){var r=this.getEventDaysCount(e),e=this.parent.eventBase.cloneEventObject(e,t,i,r,!1,!1),t=new es(this.parent,this.parent.activeViewOptions.timeScale.enable?"hour":"day"),i=(t.dateRender=this.parent.activeView.renderDates,t.eventContainers=[].slice.call(this.parent.element.querySelectorAll("."+fi)),this.parent.element.querySelector("."+O)),r=(t.inlineValue=this.parent.allowInline,t.cellWidth=i.offsetWidth,t.cellHeight=i.offsetHeight,0===this.parent.element.querySelectorAll("."+C+" tbody tr").length?0:this.parent.element.querySelectorAll("."+C+" tbody tr")[0].children.length);t.slotsPerDay=r/t.dateRender.length,t.eventHeight=this.parent.getElementHeightFromClass(t.element,V),t.renderEvents(e,n)},is.prototype.getEventDaysCount=function(e){var t=e[this.parent.eventFields.startTime],e=e[this.parent.eventFields.endTime];return Math.abs(e.getTime()-t.getTime())/W},is.prototype.generateEventData=function(e){var t=this.parent.element.querySelector("."+Pr),t=t?t.value:e?e.innerHTML:"",e={};return e[this.parent.eventFields.id]=this.parent.eventBase.getEventMaxID(),e[this.parent.eventFields.subject]=t,e[this.parent.eventFields.startTime]=this.parent.activeCellsData.startTime,e[this.parent.eventFields.endTime]=this.parent.activeCellsData.endTime,e[this.parent.eventFields.isAllDay]=this.parent.activeCellsData.isAllDay,this.parent.eventWindow.setDefaultValueToObject(e),this.parent.resourceBase&&this.parent.resourceBase.setResourceValues(e,this.parent.activeCellsData.groupIndex),e},is.prototype.documentClick=function(e){e&&""!==e.value?this.inlineCrudActions(e):this.removeInlineAppointmentElement()},is.prototype.inlineCrudActions=function(e){var t;B.closest(e,"."+jr)?(t=this.generateEventData(e),this.parent.addEvent(t)):(t=B.closest(e,"."+V),e=void((t=this.parent.getEventDetails(t))[this.parent.eventFields.subject]=e.value),t[this.parent.eventFields.id]===t[this.parent.eventFields.recurrenceID]&&(e="EditOccurrence",t[this.parent.eventFields.id]=this.parent.eventBase.getEventMaxID()),this.parent.saveEvent(t,e)),this.removeInlineAppointmentElement()},is.prototype.createInlineAppointmentElement=function(e){var t=B.createElement("div",{className:V+" "+jr+" "+Nr}),i=B.createElement("div",{className:Di}),n=(t.appendChild(i),this.inlineInputEle=B.createElement("input",{className:Pr}));return i.appendChild(n),e&&this.parent.eventBase.applyResourceColor(t,e,"backgroundColor"),t},is.prototype.removeInlineAppointmentElement=function(){var e,t=[].slice.call(this.parent.element.querySelectorAll("."+jr)),t=(0<t.length&&t.forEach(function(e){var t=e.querySelector("."+Pr);B.isNullOrUndefined(t)||t.blur(),B.remove(e)}),this.getInlineElement());t&&(e=B.closest(t,"."+V),B.removeClass([e],Nr),e=e.querySelector("."+Gn),B.isNullOrUndefined(e)||B.removeClass([e],d),B.remove(t)),this.inlineInputEle=null},is.prototype.getInlineElement=function(){return this.inlineInputEle},is.prototype.destroy=function(){this.inlineInputEle=null,this.parent.off(ue,this.inlineEdit)};var ts=is;function is(e){this.parent=e,this.parent.on(ue,this.inlineEdit,this)}rs.prototype.renderFormValidator=function(e,t,i,n){var r=this;this.element=i,this.formObj=new P.FormValidator(e,{locale:n,customPlacement:function(e,t){r.errorPlacement(e,t)},rules:t,validationComplete:function(e){r.validationComplete(e)},focusout:function(e){r.focusOut(e)}})},rs.prototype.focusOut=function(e){e=e.relatedTarget;e&&(e.classList.contains("e-dlg-closeicon-btn")||e.classList.contains("e-close")||e.classList.contains(w)||e.classList.contains(It)||e.classList.contains(yn)||e.classList.contains(O)||e.classList.contains(rr))?this.ignoreError=!0:this.ignoreError=!1},rs.prototype.validationComplete=function(e){var t=this.element.querySelector("#"+e.inputName+"_Error");t&&(t.style.display="failure"===e.status?"":"none")},rs.prototype.errorPlacement=function(e,t){var i=t.getAttribute("for"),n=this.element.querySelector("#"+i+"_Error");n||this.ignoreError||this.createTooltip(e,t,i,""),B.isNullOrUndefined(n)||(n.querySelector(".e-error").innerHTML=t.innerHTML)},rs.prototype.createTooltip=function(e,t,i,n){var r,e=e.getBoundingClientRect(),a=(this.element.classList.contains(Tr)?(r=this.element,this.element):r=this.element.querySelector(".e-schedule-dialog .e-dlg-content")).getBoundingClientRect(),i=B.createElement("div",{className:"e-tooltip-wrap e-popup "+gr,id:i+"_Error",styles:"display:"+n+";top:"+(e.bottom-a.top+r.scrollTop+9)+"px;left:"+(e.left-a.left+r.scrollLeft+e.width/2)+"px;"}),n=B.createElement("div",{className:"e-tip-content"}),a=(n.appendChild(t),B.createElement("div",{className:"e-arrow-tip e-tip-top"}));a.appendChild(B.createElement("div",{className:"e-arrow-tip-outer e-tip-top"})),a.appendChild(B.createElement("div",{className:"e-arrow-tip-inner e-tip-top"})),i.appendChild(n),i.appendChild(a),r.appendChild(i),i.style.left=parseInt(i.style.left,10)-i.offsetWidth/2+"px"},rs.prototype.destroyToolTip=function(){if(this.element)for(var e=0,t=[].slice.call(this.element.querySelectorAll("."+gr));e<t.length;e++){var i=t[e];B.remove(i)}this.formObj&&this.formObj.element&&this.formObj.reset()},rs.prototype.destroy=function(){this.formObj&&this.formObj.element&&!this.formObj.isDestroyed&&this.formObj.destroy(),this.formObj=null,this.element=null};var ns=rs;function rs(){}o.prototype.render=function(){this.renderQuickPopup(),this.renderMorePopup(),this.renderQuickDialog()},o.prototype.renderQuickPopup=function(){var e=B.createElement("div",{className:Tr+" e-popup-close",attrs:{role:"dialog"}});this.parent.isAdaptive?(document.body.appendChild(e),B.addClass([e],yt)):this.parent.element.appendChild(e),this.quickPopup=new M.Popup(e,{targetType:this.parent.isAdaptive?"container":"relative",enableRtl:this.parent.enableRtl,open:this.quickPopupOpen.bind(this),close:this.quickPopupClose.bind(this),hideAnimation:this.parent.isAdaptive?{name:"ZoomOut"}:{name:"FadeOut",duration:150},showAnimation:this.parent.isAdaptive?{name:"ZoomIn"}:{name:"FadeIn",duration:150},collision:this.parent.isAdaptive?{X:"fit",Y:"fit"}:this.parent.enableRtl?{X:"flip",Y:"fit"}:{X:"none",Y:"fit"},position:this.parent.isAdaptive||this.parent.enableRtl?{X:"left",Y:"top"}:{X:"right",Y:"top"},viewPortElement:this.parent.isAdaptive?document.body:this.parent.element,zIndex:this.parent.isAdaptive?1004:3})},o.prototype.renderMorePopup=function(){var e='<div class="'+Cn+'"><div class="e-more-event-header"><div class="'+Vn+'" title="'+this.l10n.getConstant("close")+'" tabindex="0" role="button"></div><div class="'+On+'"><div class="'+En+'" id="'+this.parent.element.id+'_more_popup"></div><div class="'+xn+" "+Hi+'" tabindex="0" role="link"></div></div></div></div>',e=B.createElement("div",{className:Sn+" e-popup-close",innerHTML:e}),e=(this.parent.isAdaptive?(document.body.appendChild(e),B.addClass([e],yt)):this.parent.element.appendChild(e),this.morePopup=new M.Popup(e,{targetType:this.parent.isAdaptive?"container":"relative",enableRtl:this.parent.enableRtl,hideAnimation:{name:"ZoomOut",duration:300},showAnimation:{name:"ZoomIn",duration:300},open:this.morePopupOpen.bind(this),close:this.morePopupClose.bind(this),collision:this.parent.isAdaptive?{X:"fit",Y:"fit"}:this.parent.enableRtl?{X:"flip",Y:"fit"}:{X:"flip",Y:"flip"},viewPortElement:this.parent.isAdaptive?document.body:this.parent.element,zIndex:this.parent.isAdaptive?1002:2}),this.morePopup.element.setAttribute("role","dialog"),this.morePopup.element.setAttribute("aria-labelledby",this.parent.element.id+"_more_popup"),this.morePopup.element.querySelector("."+Vn));this.renderButton("e-round",Dt+" "+ur,!1,e,this.closeClick),B.EventHandler.add(this.morePopup.element.querySelector("."+xn),"click",this.navigationClick,this)},o.prototype.renderQuickDialog=function(){var e=[{buttonModel:{cssClass:"e-quick-alertok e-flat",isPrimary:!0},click:this.dialogButtonClick.bind(this)},{buttonModel:{cssClass:"e-quick-alertcancel e-flat",isPrimary:!1},click:this.dialogButtonClick.bind(this)},{buttonModel:{cssClass:"e-quick-dialog-cancel e-disable e-flat",isPrimary:!1},click:this.dialogButtonClick.bind(this)}],t=(this.parent.eventSettings.editFollowingEvents&&(t={buttonModel:{cssClass:"e-quick-alertfollowing e-flat",isPrimary:!1},click:this.dialogButtonClick.bind(this)},e.splice(1,0,t)),this.quickDialog=new M.Dialog({animationSettings:{effect:"Zoom"},buttons:e,cssClass:Mn,closeOnEscape:!0,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,beforeClose:this.beforeQuickDialogClose.bind(this),isModal:!0,position:{X:"center",Y:"center"},showCloseIcon:!0,target:document.body,visible:!1,width:"auto"}),B.createElement("div",{id:this.parent.element.id+"QuickDialog"})),e=(this.parent.element.appendChild(t),this.quickDialog.appendTo(t),this.quickDialog.element.querySelector("."+Ln)),t=(e&&(e.setAttribute("aria-label",this.l10n.getConstant("occurrence")),e.setAttribute("aria-label",e.innerHTML)),this.quickDialog.element.querySelector("."+qn));t&&(t.setAttribute("aria-label",this.l10n.getConstant("series")),t.setAttribute("aria-label",t.innerHTML)),this.quickDialog.element.querySelector(".e-dlg-closeicon-btn")&&this.quickDialog.element.querySelector(".e-dlg-closeicon-btn").setAttribute("title",this.l10n.getConstant("close"))},o.prototype.renderButton=function(e,t,i,n,r){new H.Button({cssClass:e,disabled:i,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,iconCss:t}).appendTo(n),B.EventHandler.add(n,"click",r,this),B.removeClass([n],Dt)},o.prototype.quickDialogClass=function(e){var t=[kn,Rn,jn,Nn,Un,d],i=this.quickDialog.element.querySelector("."+Ln),n=this.quickDialog.element.querySelector("."+qn),r=this.quickDialog.element.querySelector("."+Fn);switch(B.removeClass([i,n],t),B.addClass([this.quickDialog.element.querySelector("."+Nn)],d),this.parent.eventSettings.editFollowingEvents&&(B.addClass([r],d),B.removeClass([this.quickDialog.element],Pn)),e){case"Recurrence":B.addClass([i],kn),B.addClass([n],Rn),this.parent.eventSettings.editFollowingEvents&&(B.removeClass([r],d),B.addClass([this.quickDialog.element],Pn),B.addClass([r],Hn));break;case"Delete":B.addClass([i],jn),B.addClass([n],Nn);break;case"Alert":B.addClass([i],[Ln,Un]),B.addClass([n],[qn,d])}},o.prototype.applyFormValidation=function(){var e=this.quickPopup.element.querySelector("."+Wn),t={};t[this.parent.eventSettings.fields.subject.name]=this.parent.eventSettings.fields.subject.validation,this.fieldValidator.renderFormValidator(e,t,this.quickPopup.element,this.parent.locale)},o.prototype.openRecurrenceAlert=function(){var e=this.quickDialog.element.querySelector("."+Ln),e=(e&&(e.innerHTML=this.l10n.getConstant("Delete"===this.parent.currentAction?"deleteEvent":"editEvent"),e.setAttribute("aria-label",e.innerHTML)),this.quickDialog.element.querySelector("."+Fn)),e=(e&&(e.innerHTML=this.l10n.getConstant("editFollowingEvent"),e.setAttribute("aria-label",e.innerHTML)),this.quickDialog.element.querySelector("."+qn));e&&(e.innerHTML=this.l10n.getConstant("Delete"===this.parent.currentAction?"deleteSeries":"editSeries"),e.setAttribute("aria-label",e.innerHTML)),this.quickDialog.content=this.l10n.getConstant("editContent"),this.quickDialog.header=this.l10n.getConstant("Delete"===this.parent.currentAction?"deleteTitle":"editTitle"),this.quickDialogClass("Recurrence"),this.showQuickDialog("RecurrenceAlert")},o.prototype.openRecurrenceValidationAlert=function(e){this.quickDialogClass("Alert");var t,i=this.quickDialog.element.querySelector("."+Ln),n=(i.innerHTML=this.l10n.getConstant("ok"),i.setAttribute("aria-label",i.innerHTML),this.quickDialog.element.querySelector("."+qn));switch(n.innerHTML=this.l10n.getConstant("cancel"),n.setAttribute("aria-label",n.innerHTML),this.quickDialog.header=this.l10n.getConstant("alert"),e){case"wrongPattern":B.addClass([n],d),this.quickDialog.content=this.l10n.getConstant("wrongPattern");break;case"createError":B.addClass([n],d),this.quickDialog.content=this.l10n.getConstant("createError");break;case"sameDayAlert":B.addClass([n],d),this.quickDialog.content=this.l10n.getConstant("sameDayAlert");break;case"seriesChangeAlert":t=this.quickDialog.element.querySelector("."+Nn),B.removeClass([n,t],d),this.quickDialog.content=this.l10n.getConstant("seriesChangeAlert"),i.innerHTML=this.l10n.getConstant("yes"),n.innerHTML=this.l10n.getConstant("no"),t.innerHTML=this.l10n.getConstant("cancel");break;case"occurrenceAlert":B.addClass([n],d),this.quickDialog.content=this.l10n.getConstant("occurenceAlert")}(!this.parent.enableRecurrenceValidation&&"wrongPattern"===e||this.parent.enableRecurrenceValidation)&&this.showQuickDialog("RecurrenceValidationAlert")},o.prototype.openDeleteAlert=function(){var e;this.parent.activeViewOptions.readonly||((e=this.quickDialog.element.querySelector("."+Ln))&&(e.innerHTML=this.l10n.getConstant("delete"),e.setAttribute("aria-label",e.innerHTML)),(e=this.quickDialog.element.querySelector("."+qn))&&(e.innerHTML=this.l10n.getConstant("cancel"),e.setAttribute("aria-label",e.innerHTML)),this.quickDialog.content=1<this.parent.activeEventData.event.length?this.l10n.getConstant("deleteMultipleContent"):this.l10n.getConstant("deleteContent"),this.quickDialog.header=1<this.parent.activeEventData.event.length?this.l10n.getConstant("deleteMultipleEvent"):this.l10n.getConstant("deleteEvent"),this.quickDialogClass("Delete"),this.showQuickDialog("DeleteAlert"))},o.prototype.openValidationError=function(e,t){this.quickDialog.header=this.l10n.getConstant("alert"),this.quickDialog.content=this.l10n.getConstant(e);var i=this.quickDialog.element.querySelector("."+Ln),n=(i&&(i.innerHTML=this.l10n.getConstant("ok"),i.setAttribute("aria-label",i.innerHTML)),this.quickDialog.element.querySelector("."+qn));n&&(n.innerHTML=this.l10n.getConstant("cancel"),i.setAttribute("aria-label",n.innerHTML)),this.quickDialogClass("Alert"),this.showQuickDialog("overlapAlert"===e?"OverlapAlert":"ValidationAlert",t)},o.prototype.showQuickDialog=function(e,t){var i=this,e=(this.quickDialog.dataBind(),{type:e,cancel:!1,element:this.quickDialog.element,data:B.extend({},t||this.parent.activeEventData.event,null,!0)});this.parent.activeViewOptions.allowOverlap||(e.overlapEvents=this.parent.overlapAppointments),this.parent.trigger(ae,e,function(e){e.cancel||i.quickDialog.show()})},o.prototype.createMoreEventList=function(e,r,a){var s=this,o=this.parent.eventFields,t=B.createElement("div",{className:An}),l=B.createElement("div",{className:In});if(0===e.length)l=B.createElement("div",{className:An,innerHTML:this.l10n.getConstant("emptyContainer")});else for(var p=this,i=0,n=e;i<n.length;i++)!function(t){var e=t[o.subject]||p.parent.eventSettings.fields.subject.default||p.parent.localeObj.getConstant("addTitle"),i=B.createElement("div",{className:V,attrs:{"data-id":""+t[o.id],"data-guid":t.Guid,role:"button",tabindex:"0","aria-disabled":p.parent.eventBase.getReadonlyAttribute(t),"aria-label":p.parent.getAnnouncementString(t)}}),n=(t[o.isReadonly]&&B.addClass([i],"e-read-only"),void 0),n=(B.isNullOrUndefined(p.parent.activeViewOptions.eventTemplate)?(i.appendChild(B.createElement("div",{className:Gn})),p.parent.sanitize(e,i.firstElementChild)):(e=p.parent.element.id+"_"+p.parent.activeViewOptions.eventTemplateName+"eventTemplate",n=p.parent.getAppointmentTemplate()(t,p.parent,"eventTemplate",e,!1,void 0,void 0,p.parent.root),B.append(n,i)),B.isNullOrUndefined(a)||i.setAttribute("data-group-index",a),B.isNullOrUndefined(t[o.recurrenceRule])||(e=t[o.id]===t[o.recurrenceID]?en:tn,i.appendChild(B.createElement("div",{className:Dt+" "+e}))),{data:B.extend({},t,null,!0),element:i,cancel:!1});p.parent.trigger(ie,n,function(e){e.cancel||(l.appendChild(i),e=s.parent.isAdaptive||"Year"===s.parent.currentView,s.parent.eventBase.wireAppointmentEvents(i,t,e),s.parent.eventBase.applyResourceColor(i,t,"backgroundColor",r))})}(n[i]);return t.appendChild(l),t},o.prototype.tapHoldEventPopup=function(e){var t,i,n=B.closest(e.target,"."+V),r=(this.parent.selectedElements=[],this.isMultipleEventSelect=!0,this.parent.eventBase.getSelectedEventElements(n),this.parent.activeEventData=this.parent.eventBase.getSelectedEvents(),n.getAttribute("data-guid")),r=this.parent.eventBase.getEventByGuid(r);B.isNullOrUndefined(r)||(t=r[this.parent.eventFields.subject]||this.l10n.getConstant("noTitle"),t='<div class="e-multiple-event-popup"><div class="'+gn+'"><button class="'+dr+'" title="'+this.l10n.getConstant("close")+'"></button><div class="'+Gn+'">'+t+'</div><button class="e-edit" title="'+this.l10n.getConstant("edit")+'"></button><button class="'+cr+'" title="'+this.l10n.getConstant("delete")+'"></button></div></div>',this.quickPopup.element.innerHTML=t,t=this.quickPopup.element.querySelector("."+dr),this.renderButton("e-flat e-round e-small",Dt+" "+ur,!1,t,this.closeClick),t=this.parent.activeViewOptions.readonly||r[this.parent.eventFields.isReadonly],r=!this.parent.eventSettings.allowEditing||t,t=!this.parent.eventSettings.allowDeleting||t,(i=this.quickPopup.element.querySelector("."+lr))&&this.renderButton("e-flat e-round e-small",Dt+" "+pr,r,i,this.editClick),(r=this.quickPopup.element.querySelector("."+cr))&&this.renderButton("e-flat e-round e-small",Dt+" "+hr,t,r,this.deleteClick),this.beforeQuickPopupOpen(n,this.parent.eventBase.getPageCoordinates(e)))},o.prototype.isCellBlocked=function(e){var t={};return t[this.parent.eventFields.startTime]=this.parent.activeCellsData.startTime,t[this.parent.eventFields.endTime]=this.parent.activeCellsData.endTime,t[this.parent.eventFields.isAllDay]=this.parent.activeCellsData.isAllDay,0<this.parent.activeViewOptions.group.resources.length&&(e=e.element instanceof Array?e.element[0]:e.element,e=parseInt(e.getAttribute("data-group-index"),10),this.parent.resourceBase.setResourceValues(t,isNaN(e)?null:e)),this.parent.eventBase.isBlockRange(t)},o.prototype.cellClick=function(e){var t,i,n=new Date(e.startTime.getTime());this.parent.showQuickInfo&&this.parent.eventSettings.allowAdding&&"MonthAgenda"!==this.parent.currentView&&!this.isCellBlocked(e)&&this.parent.isMinMaxDate(new Date(n.setHours(0,0,0,0)))?(n=B.isNullOrUndefined(e.event)?e.element:e.event.target,this.parent.isAdaptive?(this.quickPopupHide(),i=this.parent.element.querySelector("."+zi),B.isNullOrUndefined(i)&&(i=B.createElement("div",{className:zi,innerHTML:'<div class="e-title">+ '+this.l10n.getConstant("newEvent")+"</div>"})),(t=B.closest(n,"."+O+",."+w))&&t.appendChild(i)):(t=B.closest(n,"."+O+",."+w+",."+It),B.isNullOrUndefined(t)||n.classList.contains(hn)||(this.quickPopup.relateTo===t&&this.quickPopup.element.classList.contains(xt)?(i=this.quickPopup.element.querySelector("."+Gn))&&i.focus():(this.quickPopup.element&&this.destroyPopupButtons("quickPopup"),(n={})[this.parent.eventFields.startTime]=this.parent.activeCellsData.startTime,n[this.parent.eventFields.endTime]=this.parent.activeCellsData.endTime,n[this.parent.eventFields.isAllDay]=this.parent.activeCellsData.isAllDay,(i=B.createElement("div",{className:dn})).appendChild(this.getPopupHeader("Cell",n)),i.appendChild(this.getPopupContent("Cell",e,n)),i.appendChild(this.getPopupFooter("Cell",n)),this.quickPopup.element.setAttribute("aria-label",this.l10n.getConstant("newEvent")),(n=i.querySelector("."+Gn))&&P.Input.createInput({element:n,properties:{placeholder:this.l10n.getConstant("addTitle")}}),B.isNullOrUndefined(this.parent.eventSettings.fields.subject.default)||(n.value=this.parent.eventSettings.fields.subject.default),(n=i.querySelector("."+dr))&&this.renderButton("e-flat e-round e-small",Dt+" "+ur,!1,n,this.popupClose),(n=i.querySelector("."+yn))&&this.renderButton("e-flat","",!1,n,this.detailsClick),(n=i.querySelector("."+Tn))&&this.renderButton("e-flat e-primary","",this.parent.activeViewOptions.readonly,n,this.saveClick),this.morePopup&&this.morePopup.hide(),this.quickPopup.content=i,this.quickPopup.relateTo=t,this.quickPopup.dataBind(),this.beforeQuickPopupOpen(t,this.parent.eventBase.getPageCoordinates(e.event)))))):this.quickPopupHide()},o.prototype.isSameEventClick=function(e){return!(this.quickPopup.relateTo!==B.closest(e.element,"."+V)||!this.quickPopup.element.classList.contains(xt)||((e=this.quickPopup.element.querySelector("."+lr))&&e.focus(),this.parent.isAdaptive||(e=this.quickPopup.element.querySelector("."+wn))&&e.focus(),0))},o.prototype.isQuickTemplate=function(e){return"Both"===this.parent.quickInfoTemplates.templateType||this.parent.quickInfoTemplates.templateType===e},o.prototype.eventClick=function(e){var t,i,n,r,a;this.parent.eventTooltip&&this.parent.eventTooltip.close(),this.parent.showQuickInfo&&(this.parent.isAdaptive&&this.isMultipleEventSelect?this.updateTapHoldEventPopup(B.closest(e.element,"."+V)):(n=this.isSameEventClick(e),this.parent.selectedElements=[],n||(this.quickPopup.element&&this.destroyPopupButtons("quickPopup"),n=e.event,(t=B.createElement("div",{className:un})).appendChild(this.getPopupHeader("Event",n)),t.appendChild(this.getPopupContent("Event",e,n)),t.appendChild(this.getPopupFooter("Event",n)),this.quickPopup.element.setAttribute("aria-label",this.l10n.getConstant("editEvent")),n=this.parent.activeViewOptions.readonly||n[this.parent.eventFields.isReadonly],i=!this.parent.eventSettings.allowEditing||n,n=!this.parent.eventSettings.allowDeleting||n,r="e-flat e-round e-small",(a=t.querySelector("."+lr))&&this.renderButton(r,Dt+" "+pr,i,a,this.editClick),(a=t.querySelector("."+cr))&&this.renderButton(r,Dt+" "+hr,n,a,this.deleteClick),(a=t.querySelector("."+dr))&&this.renderButton(r,Dt+" "+ur,!1,a,this.popupClose),(r=t.querySelector("."+wn))&&this.renderButton("e-flat e-primary","",i,r,this.editClick),(a=t.querySelector("."+Dn))&&this.renderButton("e-flat","",n,a,this.deleteClick),this.morePopup&&!B.closest(e.element,"."+In)&&this.morePopup.hide(),this.quickPopup.content=t,this.quickPopup.relateTo=this.parent.isAdaptive?document.body:B.closest(e.element,"."+V),this.quickPopup.dataBind(),this.beforeQuickPopupOpen(e.element,this.parent.eventBase.getPageCoordinates(e.originalEvent)))))},o.prototype.getPopupHeader=function(e,t){var i=B.createElement("div",{className:gn});if(this.isQuickTemplate(e)&&this.parent.quickInfoTemplates.header){var n=B.extend({},t,{elementType:e.toLowerCase()},!0),r=this.parent.element.id,n=[].slice.call(this.parent.getQuickInfoTemplatesHeader()(n,this.parent,"header",r+"_headerTemplate",!1));B.append([].slice.call(n),i)}else{var a=void 0,s=void 0;switch(e){case"Cell":a='<div class="'+mn+'"><button class="'+dr+'" title="'+this.l10n.getConstant("close")+'"></button></div>';break;case"Event":s=this.getFormattedString(t),a='<div class="'+mn+'"><button class="e-edit '+Dt+'" title="'+this.l10n.getConstant("edit")+'"></button><button class="'+cr+" "+Dt+'" title="'+this.l10n.getConstant("delete")+'"></button><button class="'+dr+'" title="'+this.l10n.getConstant("close")+'"></button></div><div class="'+bi+'"><div class="'+Gn+" "+bn+'" title="'+(s.eventSubject&&s.eventSubject.replaceAll('"',"'"))+'"></div></div >'}r=B.createElement("div",{innerHTML:a});"Event"===e&&(n=r.querySelector("."+Gn),this.parent.sanitize(s.eventSubject,n)),B.append([].slice.call(r.childNodes),i)}return i},o.prototype.getPopupContent=function(e,t,i){var n=B.createElement("div",{className:"e-popup-content"});if(this.isQuickTemplate(e)&&this.parent.quickInfoTemplates.content){var r=B.extend({},i,{elementType:e.toLowerCase()},!0),a=this.parent.element.id,r=[].slice.call(this.parent.getQuickInfoTemplatesContent()(r,this.parent,"content",a+"_contentTemplate",!1));B.append([].slice.call(r),n)}else{var s,o=void 0,a=this.getResourceText(t,e.toLowerCase());switch(e){case"Cell":s=this.getFormattedString(i),o='<table class="e-popup-table"><tbody><tr><td><form class="'+Wn+'">\n <input class="'+Gn+' e-field" type="text" name="'+this.parent.eventFields.subject+'" /></form></td></tr><tr><td><div class="'+Ni+'"><div class="'+Vr+" "+Dt+'"></div><div class="'+fn+" "+bn+'">'+s.details+"</div></div>"+(0<this.parent.activeViewOptions.group.resources.length?'<div class="'+Or+'"><div class="'+Er+" "+Dt+' "></div><div class="'+xr+" "+bn+'"></div></div>':"")+"</td></tr></tbody></table>";break;case"Event":s=this.getFormattedString(i),o='<div class="'+Ni+'"><div class="'+Vr+" "+Dt+'"></div><div class="e-date-time-wrapper '+bn+'"><div class="'+fn+" "+bn+'">'+s.details+"</div>",i[this.parent.eventFields.recurrenceRule]&&(o+='<div class="e-recurrence-summary '+bn+'">'+this.getRecurrenceSummary(i)+"</div>"),o+="</div></div>",i[this.parent.eventFields.location]&&(o+='<div class="'+Xn+'"><div class="e-location-icon '+Dt+'"></div><div class="'+Qn+" "+bn+'"></div></div>'),(i[this.parent.eventFields.startTimezone]||i[this.parent.eventFields.endTimezone])&&(o+='<div class="'+Yn+'"><div class="e-time-zone-icon '+Dt+'"></div><div class="e-time-zone-details '+bn+'">'+this.getTimezone(i)+"</div></div>"),i[this.parent.eventFields.description]&&(o+='<div class="'+Jn+'"><div class="e-description-icon '+Dt+'"></div><div class="'+$n+" "+bn+'"></div></div>'),0<this.parent.resourceCollection.length&&(o+='<div class="'+Or+'"><div class="'+Er+" "+Dt+'"></div><div class="'+xr+" "+bn+'"></div></div>')}var r=B.createElement("div",{innerHTML:o}),t=r.querySelector("form");t&&(t.onsubmit=function(){return!1}),i[this.parent.eventFields.location]&&(e=r.querySelector("."+Qn),B.isNullOrUndefined(e)||this.parent.sanitize(i[this.parent.eventFields.location],e)),i[this.parent.eventFields.description]&&(t=r.querySelector("."+$n),B.isNullOrUndefined(t)||this.parent.sanitize(i[this.parent.eventFields.description],t)),a&&(e=r.querySelector("."+xr),B.isNullOrUndefined(e)||this.parent.sanitize(a,e)),B.append([].slice.call(r.childNodes),n)}return n},o.prototype.getPopupFooter=function(e,t){var i=B.createElement("div",{className:vn});if(this.isQuickTemplate(e)&&this.parent.quickInfoTemplates.footer){var t=B.extend({},t,{elementType:e.toLowerCase()},!0),n=this.parent.element.id,t=[].slice.call(this.parent.getQuickInfoTemplatesFooter()(t,this.parent,"footer",n+"_footerTemplate",!1));B.append([].slice.call(t),i)}else{var r=void 0;switch(e){case"Cell":r='<button class="'+yn+" "+bn+'" title="'+this.l10n.getConstant("moreDetails")+'">'+this.l10n.getConstant("moreDetails")+'</button><button class="'+Tn+" "+bn+'" title="'+this.l10n.getConstant("save")+'">'+this.l10n.getConstant("save")+"</button>";break;case"Event":r=this.parent.isAdaptive?"":'<button class="'+wn+" "+bn+'" title="'+this.l10n.getConstant("edit")+'">'+this.l10n.getConstant("edit")+'</button><button class="'+Dn+" "+bn+'" title="'+this.l10n.getConstant("delete")+'">'+this.l10n.getConstant("delete")+"</button>"}n=B.createElement("div",{innerHTML:r});B.append([].slice.call(n.childNodes),i)}return i},o.prototype.getResourceText=function(e,t){if(0===this.parent.resourceCollection.length)return null;var r="";if(0===this.parent.activeViewOptions.group.resources.length){var a=this.parent.resourceBase.resourceCollection.slice(-1)[0],s=a.dataSource;if("event"===t)for(var o=e.event,i=0,n=s;i<n.length;i++)!function(e){var t,i,n=o[a.field];n instanceof Array?-1<n.indexOf(e[a.idField])&&(t=n[n.indexOf(e[a.idField])],i=s.filter(function(e){return e[a.idField]===t})[0],r+=""===r?i[a.textField]:", "+i[a.textField]):e[a.idField]===n&&(r=e[a.textField].toString())}(n[i]);else r=s[0][a.textField].toString()}else if("event"===t){for(var l,o=e.event,s=void 0,p=this.parent.resourceBase.resourceCollection.length-1;0<=p;p--)if(s=o[this.parent.resourceBase.resourceCollection[parseInt(p.toString(),10)].field],!B.isNullOrUndefined(s)){l=this.parent.resourceBase.resourceCollection[parseInt(p.toString(),10)];break}Array.isArray(s)||(s=[s]);var c=[],h=l.dataSource;s.forEach(function(e){var t,e=st(h,l.idField,e);(t=-1<e?h[parseInt(e.toString(),10)][l.textField]:t)&&c.push(t)}),r=c.join(", ")}else t=e,e=B.isNullOrUndefined(t.groupIndex)?0:t.groupIndex,t=this.parent.resourceBase.lastResourceLevel[parseInt(e.toString(),10)],r=t.resourceData[t.resource.textField];return r},o.prototype.getFormattedString=function(e){var t=this.parent.eventFields,i=e[t.subject]||this.l10n.getConstant("noTitle"),n=e[t.startTime],r=e[t.endTime],a=this.getDateFormat(n,"long"),s=e[t.isAllDay]&&0===r.getHours()&&0===r.getMinutes()?this.getDateFormat(Y(new Date(r.getTime()),-1),"long"):this.getDateFormat(r,"long"),o=this.parent.getTimeString(n),l=this.parent.getTimeString(r),p="",c=r.getDate()!==n.getDate()&&(r.getTime()-n.getTime())/36e5<24?1:0;return e[t.isAllDay]?(p=a+" ("+this.l10n.getConstant("allDay")+")",1<(ct(r)-ct(n))/W&&(p+=" - "+s+" ("+this.l10n.getConstant("allDay")+")")):p=1<=(ct(r)-ct(n))/W||0<c?a+" ("+o+") - "+s+" ("+l+")":a+" ("+o+" - "+l+")",{eventSubject:i,details:p}},o.prototype.moreEventClick=function(t,e,i){var n,r=this,a=(this.quickPopupHide(!0),this.morePopup.element.querySelector("."+An)),a=(a&&B.remove(a),t.date.getTime().toString()),s=B.closest(t.element,"."+hn+",."+O),o=this.parent.globalize.formatDate(t.date,{format:"E",calendar:this.parent.getCalendarMode()}),o=(this.morePopup.element.querySelector("."+En).innerHTML=y(o,"single"),this.morePopup.element.querySelector("."+xn)),a=(o.innerHTML=this.getDateFormat(t.date,"d"),o.setAttribute("data-date",a),o.setAttribute("data-end-date",e.getTime().toString()),B.isNullOrUndefined(i)||(o.setAttribute("data-group-index",i),n=this.parent.resourceBase.lastResourceLevel[parseInt(i,10)].groupOrder),this.createMoreEventList(t.event,n,i));if(this.morePopup.element.querySelector("."+Cn).appendChild(a),B.removeClass(this.morePopup.element.querySelector("."+On).childNodes,Rt),z(t.date).getTime()===z(this.parent.getCurrentTime()).getTime()&&B.addClass(this.morePopup.element.querySelector("."+On).childNodes,Rt),!this.parent.isAdaptive)if(-1!==this.parent.currentView.indexOf("Timeline")){var e=s.getAttribute("data-group-index"),o=new Date(parseInt(s.getAttribute("data-start-date"),10)),l=(o.setHours(o.getHours(),o.getMinutes(),0),o.getTime().toString());if(B.isNullOrUndefined(e))this.morePopup.relateTo=this.parent.element.querySelector("."+A+' tbody tr td[data-date="'+l+'"]');else if(this.morePopup.relateTo=this.parent.element.querySelector("."+A+' tbody tr td[data-group-index="'+e+'"][data-date="'+l+'"]'),B.isNullOrUndefined(this.morePopup.relateTo))for(var p=[].slice.call(this.parent.element.querySelectorAll("."+A+' tbody tr td[data-group-index="'+e+'"]')),c=0;c<p.length;c++)p[parseInt(c.toString(),10)].getAttribute("data-date")<l&&(this.morePopup.relateTo=p[parseInt(c.toString(),10)])}else this.morePopup.relateTo=B.closest(s,"."+O);this.parent.renderTemplates(function(){var e={type:"EventContainer",cancel:!1,element:r.morePopup.element,data:t};r.parent.trigger(ae,e,function(e){e.cancel||r.morePopup.show()})})},o.prototype.saveClick=function(e){this.applyFormValidation(),this.dialogEvent=e,this.isCrudAction=!0,this.quickPopupHide()},o.prototype.detailsClick=function(e){var t=this.quickPopup.element.querySelector("."+Gn);t&&""!==t.value&&B.extend(this.parent.activeCellsData,{subject:t.value}),this.dialogEvent=e,this.isCrudAction=!1,this.fieldValidator.destroyToolTip(),this.quickPopupHide(),this.parent.eventWindow.openEditor(this.parent.activeCellsData,"Add")},o.prototype.editClick=function(e){this.dialogEvent=e,this.quickPopupHide(!0);e=this.parent.activeEventData.event;this.parent.currentAction="EditSeries",B.isNullOrUndefined(e[this.parent.eventFields.recurrenceRule])?this.parent.eventWindow.openEditor(e,this.parent.currentAction):(this.parent.currentAction="EditOccurrence",this.openRecurrenceAlert())},o.prototype.deleteClick=function(e){this.dialogEvent=e,this.quickPopupHide(!0),this.parent.currentAction="Delete",this.parent.activeEventData.event[this.parent.eventFields.recurrenceRule]?this.openRecurrenceAlert():this.openDeleteAlert()},o.prototype.updateMoreEventContent=function(){var e,t,i,n,r;this.morePopup.element.classList.contains("e-popup-close")||((e=this.morePopup.element.querySelector("."+An))&&B.remove(e),e=this.morePopup.element.querySelector("."+xn),n=new Date(parseInt(e.getAttribute("data-date"),10)),r=new Date(parseInt(e.getAttribute("data-end-date"),10)),e=e.getAttribute("data-group-index"),B.isNullOrUndefined(e)||(i=(t=this.parent.resourceBase.lastResourceLevel[parseInt(e,10)]).groupOrder),n=this.parent.eventBase.filterEvents(n,r,this.parent.eventsProcessed,t),r=this.createMoreEventList(n,i,e),this.morePopup.element.querySelector("."+Cn).appendChild(r))},o.prototype.closeClick=function(e){this.dialogEvent=e,"Year"===this.parent.currentView&&this.parent.activeCellsData&&this.parent.activeCellsData.element&&this.parent.selectCell(this.parent.activeCellsData.element),this.quickPopupHide(),this.morePopup.hide()},o.prototype.dialogButtonClick=function(e){this.dialogEvent=e,this.quickDialog.hide();var t=e.target,i=this.quickDialog.element.querySelector("."+qn),n=this.parent.activeEventData.event;if(t.classList.contains(kn))switch(this.parent.currentAction="Delete"===this.parent.currentAction?"DeleteOccurrence":"EditOccurrence",this.parent.currentAction){case"EditOccurrence":this.parent.eventWindow.openEditor(n,this.parent.currentAction);break;case"DeleteOccurrence":this.parent.crudModule.deleteEvent(n,this.parent.currentAction)}else if(t.classList.contains(Hn))switch(this.parent.currentAction="Delete"===this.parent.currentAction?"DeleteFollowingEvents":"EditFollowingEvents",this.parent.currentAction){case"EditFollowingEvents":this.parent.eventWindow.openEditor(n,this.parent.currentAction);break;case"DeleteFollowingEvents":this.parent.crudModule.deleteEvent(n,this.parent.currentAction)}else if(t.classList.contains(Rn))switch(this.parent.currentAction="Delete"===this.parent.currentAction?"DeleteSeries":"EditSeries",this.parent.currentAction){case"EditSeries":this.parent.eventWindow.openEditor(this.parent.eventBase.getParentEvent(n,!0),this.parent.currentAction);break;case"DeleteSeries":this.parent.crudModule.deleteEvent(n,this.parent.currentAction)}else t.classList.contains(jn)?this.parent.crudModule.deleteEvent(n,this.parent.currentAction):!i.classList.contains(d)&&(t.classList.contains(Ln)||t.classList.contains(qn)&&!i.classList.contains(Nn))&&(this.parent.uiStateValues.isIgnoreOccurrence=t.classList.contains(qn),this.parent.eventWindow.eventSave(e,this.l10n.getConstant("ok")))},o.prototype.updateTapHoldEventPopup=function(e){var t,e=this.parent.eventBase.getSelectedEventElements(e);this.parent.activeEventData=this.parent.eventBase.getSelectedEvents(),0<e.length?(t=this.parent.eventBase.getEventByGuid(e[0].getAttribute("data-guid")),t=1===e.length?t[this.parent.eventFields.subject]||this.l10n.getConstant("noTitle"):"("+e.length+") "+this.l10n.getConstant("selectedItems"),this.quickPopup.element.querySelector("."+Gn).innerHTML=t,1<e.length?B.addClass([this.quickPopup.element.querySelector("."+pr)],fr):B.removeClass([this.quickPopup.element.querySelector("."+pr)],fr)):(this.parent.selectedElements=[],this.quickPopupHide())},o.prototype.getTimezone=function(e){var t="";return(t+=e[this.parent.eventFields.startTimezone]||"")+(t?" - ":"")+(e[this.parent.eventFields.endTimezone]||"")},o.prototype.getRecurrenceSummary=function(e){var t=this.parent.eventWindow.getRecurrenceEditorInstance();return t?(t=t.getRuleSummary(e[this.parent.eventFields.recurrenceRule])).charAt(0).toUpperCase()+t.slice(1):""},o.prototype.getDateFormat=function(e,t){return y(this.parent.globalize.formatDate(e,{skeleton:t,calendar:this.parent.getCalendarMode()}),"single")},o.prototype.getDataFromTarget=function(e){var t;return e.classList.contains(V)?this.parent.activeEventData.event:(e={startTime:this.parent.activeCellsData.startTime,endTime:this.parent.activeCellsData.endTime,isAllDay:this.parent.activeCellsData.isAllDay,groupIndex:this.parent.activeCellsData.groupIndex},t=this.parent.activeCellsData,this.parent.eventWindow.convertToEventData(t,e),e)},o.prototype.beforeQuickDialogClose=function(e){var t=this,e={event:e.event||this.dialogEvent,type:B.isNullOrUndefined(this.parent.activeEventData.event)?"ValidationAlert":B.isNullOrUndefined(this.parent.activeEventData.event[this.parent.eventFields.recurrenceRule])?"DeleteAlert":"RecurrenceAlert",cancel:!1,data:this.parent.activeEventData.event,element:this.quickDialog.element};this.parent.trigger(se,e,function(e){e.cancel||t.parent.eventBase.focusElement(!0)})},o.prototype.beforeQuickPopupOpen=function(p,c){var h=this;this.parent.renderTemplates(function(){var o=h.quickPopup.element.querySelector("."+un),l=h.parent.isAdaptive?o?"ViewEventInfo":"EditEventInfo":"QuickInfo",e={type:l,cancel:!1,data:B.extend({},h.getDataFromTarget(p),null,!0),target:p,element:h.quickPopup.element};h.parent.trigger(ae,e,function(e){var t,i,n,r,a,s;e.cancel?(h.quickPopupHide(),h.destroyPopupButtons("quickPopup"),e.element.classList.contains(xt)&&h.quickPopupClose(),lt(h.quickPopup.element),h.isMultipleEventSelect=!1):(e=h.quickPopup.element.style.display,h.quickPopup.element.style.display="block",h.parent.isAdaptive?(h.quickPopup.element.removeAttribute("style"),h.quickPopup.element.style.display="block",h.quickPopup.element.style.height=B.formatUnit("EditEventInfo"==l?65:window.innerHeight)):(i=h.parent.virtualScrollModule&&h.parent.virtualScrollModule.isHorizontalScroll&&!B.isNullOrUndefined(B.closest(p,"."+C)),t=h.parent.element.querySelector("."+A+" table"),h.quickPopup.offsetX=i&&!h.parent.enableRtl?Fe(t)+10:10,h.quickPopup.offsetY=h.parent.virtualScrollModule&&!h.parent.virtualScrollModule.isHorizontalScroll?h.quickPopup.offsetY:0,h.quickPopup.collision={X:h.parent.enableRtl?"flip":"none",Y:"fit"},h.quickPopup.position={X:h.parent.enableRtl?"left":"right",Y:h.parent.enableRtl?"bottom":"top"},h.quickPopup.dataBind(),h.quickPopup.refreshPosition(null,!0),-1<(s=M.isCollide(h.quickPopup.element,h.parent.element)).indexOf(h.parent.enableRtl?"left":"right")&&(h.quickPopup.offsetX=-p.offsetWidth-10-h.quickPopup.element.offsetWidth,i&&!h.parent.enableRtl&&(h.quickPopup.offsetX=Fe(t)+h.quickPopup.offsetX),h.quickPopup.dataBind(),h.quickPopup.refreshPosition(null,!0),-1<M.isCollide(h.quickPopup.element,h.parent.element).indexOf("left"))&&(h.quickPopup.position={X:"center",Y:"center"},h.quickPopup.collision={X:"fit",Y:"fit"},h.quickPopup.offsetX=-h.quickPopup.element.offsetWidth/2,h.quickPopup.dataBind()),h.parent.virtualScrollModule&&!h.parent.virtualScrollModule.isHorizontalScroll&&(-1<s.indexOf("top")||-1<s.indexOf("bottom"))&&(i=qe(t),h.quickPopup.offsetY=i,h.quickPopup.dataBind(),h.quickPopup.refreshPosition(null,!0)),"center"===h.quickPopup.position.X&&"center"===h.quickPopup.position.Y&&!B.isNullOrUndefined(c)&&c.clientX&&c.clientY&&(s=c.clientX,t=c.clientY,i=p.getBoundingClientRect(),i=c.offsetY||Math.ceil(t-i.y),n=h.quickPopup.offsetY,r=M.isCollide(h.quickPopup.element,p),a=h.quickPopup.element.getBoundingClientRect(),s=document.elementFromPoint(s,t),-1<r.indexOf("top")||-1<r.indexOf("bottom")||B.closest(s,"."+Tr))&&(a.top<=t&&t<=a.top+a.height?(h.quickPopup.offsetY=n-a.height-10,h.quickPopup.dataBind(),-1<(r=M.isCollide(h.quickPopup.element,h.parent.element)).indexOf("top")&&(h.quickPopup.offsetY=n+i+10,h.quickPopup.dataBind())):-1<M.isCollide(h.quickPopup.element,h.parent.element).indexOf("bottom")&&(h.quickPopup.offsetY=n-i-Math.ceil(a.height)-10,h.quickPopup.dataBind()))),o&&h.applyEventColor(),h.quickPopup.element.style.display=e,h.quickPopup.dataBind(),h.quickPopup.show())})})},o.prototype.applyEventColor=function(){var e,t,i="",i="Agenda"===this.parent.currentView||"MonthAgenda"===this.parent.currentView?this.parent.enableRtl?"border-right-color":"border-left-color":"background-color",i=this.parent.activeEventData.element.style[i];""!==i&&(e=this.quickPopup.element.querySelector("."+gn),(t=this.quickPopup.element.querySelector("."+vn))&&t.offsetParent&&(e=this.quickPopup.element.querySelector("."+Gn))&&(i="rgba("+(e.style.borderLeftColor=i).match(/\d+/g).join()+",0.3)"),e)&&(e.style.backgroundColor=i)},o.prototype.quickPopupOpen=function(){var e;this.parent.isAdaptive?this.quickPopup.element.style.top="0px":this.quickPopup.element.querySelector("."+dn)?(e=this.quickPopup.element.querySelector("."+Gn))&&e.focus():((e=this.quickPopup.element.querySelector("."+wn))&&e.focus(),(e=this.quickPopup.element.querySelector("."+lr))&&e.focus())},o.prototype.quickPopupClose=function(){this.parent.eventBase.focusElement(),this.quickPopup.relateTo="."+O,this.fieldValidator.destroyToolTip(),this.quickPopup.element.querySelectorAll(".e-formvalidator").length&&this.fieldValidator.destroy(),this.destroyPopupButtons("quickPopup"),lt(this.quickPopup.element)},o.prototype.morePopupOpen=function(){this.parent.isAdaptive?(this.morePopup.element.style.top="0px",this.morePopup.element.style.left="0px",this.morePopup.element.style.height=B.formatUnit(window.innerHeight)):(this.morePopup.element.querySelector("."+xn).focus(),this.morePopup.refreshPosition())},o.prototype.morePopupClose=function(){var e=this.parent.element.querySelector("."+In);e&&B.remove(e)},o.prototype.popupClose=function(e){this.dialogEvent=e,this.isCrudAction=!1,this.quickPopupHide(!0)},o.prototype.quickPopupHide=function(t){var i=this;if(this.quickPopup.element.classList.contains(xt)){var n=this.quickPopup.element.querySelector("."+dn);if(n){var e=this.quickPopup.element.querySelector(".e-formvalidator");if(this.isCrudAction&&e&&!e.ej2_instances[0].validate())return;var e=this.parent.eventFields,r=this.parent.eventWindow.getObjectFromFormData(Tr);this.parent.eventWindow.setDefaultValueToObject(r),r[e.id]=this.parent.eventBase.getEventMaxID(),r[e.startTime]=this.parent.activeCellsData.startTime,r[e.endTime]=this.parent.activeCellsData.endTime,r[e.isAllDay]=this.parent.activeCellsData.isAllDay,this.parent.resourceBase&&this.parent.resourceBase.setResourceValues(r),e=r}else e=this.parent.activeEventData.event;r=this.quickPopup.element.querySelector("."+un),r={event:this.dialogEvent,type:this.parent.isAdaptive?r?"ViewEventInfo":"EditEventInfo":"QuickInfo",cancel:!1,data:e,element:this.quickPopup.element,target:(n?this.parent.activeCellsData:this.parent.activeEventData).element};this.parent.trigger(se,r,function(e){e.cancel||i.quickPopup.element.classList.contains("e-popup-open")&&(n&&i.isCrudAction&&(i.parent.currentAction="Add",i.parent.crudModule.addEvent(e.data)),t?(e=i.quickPopup.hideAnimation,i.quickPopup.hideAnimation=null,i.quickPopup.hide(),i.quickPopup.hideAnimation=e):i.quickPopup.hide(),i.isMultipleEventSelect=!1,i.isCrudAction=!1)})}},o.prototype.navigationClick=function(e){var t=B.closest(e.target,"."+Hi);B.isNullOrUndefined(t)||(t=this.parent.getDateFromElement(e.currentTarget),B.isNullOrUndefined(t))||(this.closeClick(e),this.parent.setProperties({selectedDate:t},!0),this.parent.changeView(this.parent.getNavigateView(),e))},o.prototype.documentClick=function(e){var e=e.event.target,t=!!B.closest(e,".e-dialog"),i="."+Tr+",."+It+",."+w+",."+O+",."+V,t=(t||(i+=",.e-popup"),this.parent.element.querySelector("."+Tr)),t=((t&&0<t.childElementCount&&!B.closest(e,i)||!B.closest(e,i))&&(this.quickPopupHide(),this.parent.removeNewEventElement()),this.parent.allowInline?this.parent.inlineModule.getInlineElement():null),i=(t&&t!==e&&this.parent.inlineModule.documentClick(t),B.closest(e,"."+V+",."+It)&&this.parent.removeNewEventElement(),B.closest(e,"."+Tr)||B.closest(e,"."+Mn));(e.classList.contains(wn)||e.classList.contains(lr)||e.classList.contains(pr)||!(i||B.closest(e,"."+Sn)||!e.classList||e.classList.contains(hn)||B.closest(e,"."+Sn+"."+xt)||B.closest(e,"."+O)))&&this.morePopup.hide()},o.prototype.onClosePopup=function(e){B.isNullOrUndefined(e)||(this.dialogEvent=e),this.quickPopupHide(),(B.isNullOrUndefined(e)||!B.isNullOrUndefined(e)&&"escape"!==e.action||this.parent.inlineModule&&this.parent.element.querySelector("."+jr))&&this.parent.eventBase.focusElement()},o.prototype.addEventListener=function(){this.parent.on(q,this.cellClick,this),this.parent.on(ee,this.eventClick,this),this.parent.on(Re,this.documentClick,this),this.parent.on(Ee,this.updateMoreEventContent,this)},o.prototype.removeEventListener=function(){this.parent.off(q,this.cellClick),this.parent.off(ee,this.eventClick),this.parent.off(Re,this.documentClick),this.parent.off(Ee,this.updateMoreEventContent)},o.prototype.destroyPopupButtons=function(e){for(var t="quickPopup"===e?this.quickPopup:this.morePopup,i=0,n=[].slice.call(t.element.querySelectorAll(".e-control.e-btn"));i<n.length;i++){var r=n[i],r=r.ej2_instances?r.ej2_instances[0]:null;r&&r.destroy()}"quickPopup"===e&&((e=t.element.querySelector("input."+Gn))&&e.remove(),(t=this.quickPopup.element.querySelector("form."+Wn))&&(lt(t),t.remove()),this.parent.resetTemplates(["content","header","footer"]))},o.prototype.refreshQuickDialog=function(){this.destroyQuickDialog(),this.renderQuickDialog()},o.prototype.refreshQuickPopup=function(){this.destroyQuickPopup(),this.renderQuickPopup()},o.prototype.refreshMorePopup=function(){this.destroyMorePopup(),this.renderMorePopup()},o.prototype.destroyQuickDialog=function(){this.quickDialog.element&&(this.quickDialog.destroy(),B.remove(this.quickDialog.element),this.quickDialog=null)},o.prototype.destroyQuickPopup=function(){this.quickPopup.element&&(this.destroyPopupButtons("quickPopup"),this.quickPopup.destroy(),B.remove(this.quickPopup.element),this.quickPopup=null)},o.prototype.destroyMorePopup=function(){this.morePopup.element&&(this.destroyPopupButtons("morePopup"),this.morePopup.destroy(),B.remove(this.morePopup.element),this.morePopup=null)},o.prototype.destroy=function(){this.quickPopup.element.querySelectorAll(".e-formvalidator").length&&this.fieldValidator.destroy(),this.removeEventListener(),this.destroyQuickPopup(),this.destroyMorePopup(),this.destroyQuickDialog(),this.dialogEvent=null,this.parent=null,this.l10n=null,this.isCrudAction=null,this.fieldValidator=null,this.isMultipleEventSelect=null};var as=o;function o(e){this.isMultipleEventSelect=!1,this.isCrudAction=!1,this.parent=e,this.l10n=this.parent.localeObj,this.fieldValidator=new ns,this.render(),this.addEventListener()}os.prototype.getTargets=function(){var e=[];return this.parent.activeViewOptions.group.headerTooltipTemplate&&e.push("."+Kt),this.parent.eventSettings.enableTooltip&&e.push("."+V),e.join(",")},os.prototype.onBeforeRender=function(e){var t=this;if(this.parent.uiStateValues.isSwipeScroll)e.cancel=!0;else if(B.isNullOrUndefined(e.target.getAttribute("data-tooltip-id"))){if(e.target.classList.contains(Kt)&&0<this.parent.activeViewOptions.group.resources.length)return e.target.closest("."+qt)?void(e.cancel=!0):(v=void 0,f={resource:(v=this.parent.activeView.isTimelineView()?(f=parseInt(e.target.getAttribute("data-group-index"),10),this.parent.resourceBase.lastResourceLevel[parseInt(f.toString(),10)]):(f=e.target.parentNode.sectionRowIndex,m=e.target.cellIndex,this.parent.activeView.getColumnLevels()[parseInt(f.toString(),10)][parseInt(m.toString(),10)])).resource,resourceData:v.resourceData},m=B.createElement("div"),v=this.parent.element.id+"_headerTooltipTemplate",f=[].slice.call(this.parent.getHeaderTooltipTemplate()(f,this.parent,"headerTooltipTemplate",v,!1)),B.append(f,m),this.setContent(m),void this.parent.renderTemplates());var i,n,r,a,s,o,l,p,c,h,d,u,g,m,v,f,e=this.parent.eventBase.getEventByGuid(e.target.getAttribute("data-guid"));B.isNullOrUndefined(e)||(B.isNullOrUndefined(this.parent.eventSettings.tooltipTemplate)?(i=this.parent.globalize,n=this.parent.eventFields,r=new Date(""+e[n.startTime]),u=(u=new Date(""+e[n.endTime])).getTime()-r.getTime()!=0&&0===u.getHours()&&0===u.getMinutes()?new Date(u.setMilliseconds(-1e3)):u,a=z(new Date(""+r)),s=z(new Date(""+u)),o=e[n.subject]||this.parent.eventSettings.fields.subject.default||this.parent.localeObj.getConstant("addTitle"),l=B.isNullOrUndefined(e[n.location])?"":e[n.location],h=c=p="",p=i.formatDate(r,{type:"date",skeleton:"MMMd",calendar:this.parent.getCalendarMode()}),c=i.formatDate(r,{type:"date",skeleton:"medium",calendar:this.parent.getCalendarMode()}),h=i.formatDate(u,{type:"date",skeleton:"medium",calendar:this.parent.getCalendarMode()}),p=y(p,"single"),c=y(c,"single"),h=y(h,"single"),d=this.parent.getTimeString(r),u=this.parent.getTimeString(u),g='<div><div class="e-subject">'+o+'</div><div class="e-location">'+l+'</div><div class="e-details">'+(a.getTime()===s.getTime()?y(i.formatDate(r,{type:"date",skeleton:"long",calendar:this.parent.getCalendarMode()}),"single"):a.getFullYear()===s.getFullYear()?p+" - "+h:c+" - "+h)+'</div><div class="e-all-day">'+(e[n.isAllDay]?this.parent.localeObj.getConstant("allDay"):d+" - "+u)+"</div></div>",this.setContent(B.initializeCSPTemplate(function(){return g}))):(m=B.createElement("div"),v=this.parent.element.id+"_tooltipTemplate",f=[].slice.call(this.parent.getEventTooltipTemplate()(e,this.parent,"tooltipTemplate",v,!1)),B.append(f,m),this.setContent(m)),this.parent.renderTemplates(function(){var e;t.parent&&t.parent.isReact&&!B.isNullOrUndefined(t.parent.eventSettings.tooltipTemplate)&&(e=document.querySelector("."+mr))&&B.removeClass([e],mr)}))}},os.prototype.onTooltipOpen=function(t){t.element&&this.parent.isReact&&!B.isNullOrUndefined(this.parent.eventSettings.tooltipTemplate)&&B.addClass([t.element],mr);var e=this.parent.eventBase.getEventByGuid(t.target.getAttribute("data-guid"));B.isNullOrUndefined(e)||(e={cancel:!1,data:e,content:t.element,target:t.target},this.parent.trigger(Ce,e,function(e){e.cancel?t.cancel=!0:t.element=e.content}))},os.prototype.onTooltipClose=function(e){e.element&&(B.removeClass([e.element],xt),B.addClass([e.element],"e-popup-close")),this.parent.isReact&&this.parent.eventWindow.dialogObject&&this.parent.eventWindow.dialogObject.visible||this.parent.resetTemplates(["tooltipTemplate","headerTooltipTemplate"])},os.prototype.setContent=function(e){this.tooltipObj.setProperties({content:e,windowCollision:!0},!0)},os.prototype.close=function(){this.tooltipObj.close()},os.prototype.destroy=function(){this.tooltipObj.destroy(),B.addClass([this.parent.element],"e-control"),this.tooltipObj=null,this.parent=null};var ss=os;function os(e){this.parent=e,this.tooltipObj=new M.Tooltip({animation:{close:{effect:"FadeOut"}},content:"No title",position:"BottomRight",offsetY:10,mouseTrail:!this.parent.isAdaptive,showTipPointer:!1,cssClass:this.parent.cssClass+" e-schedule-event-tooltip",target:this.getTargets(),beforeRender:this.onBeforeRender.bind(this),beforeClose:this.onTooltipClose.bind(this),beforeOpen:this.onTooltipOpen.bind(this),enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer}),this.tooltipObj.appendTo(this.parent.element)}ls=function(e,t){return(ls=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var ls,ps,cs=function(e,t){function i(){this.constructor=e}ls(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},hs=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;0<=o;o--)(r=e[o])&&(s=(a<3?r(s):3<a?r(t,i,s):r(t,i))||s);return 3<a&&s&&Object.defineProperty(t,i,s),s},ds="e-input-wrapper",us="e-input-wrapper-side",gs="e-repeat-element",ms="e-repeat-interval",vs="e-interval",fs="e-days",ys="e-non-week",Ts="e-year-expander",ws="e-year-expander-element",Ds="e-month-expander",bs="e-month-expander-element",Ss="e-month-expander-checkbox-wrapper",Cs="e-form-left",Os="e-form-right",Es="e-month-day",xs="e-month-expander-wrapper",Vs="e-month-pos",As="e-month-week",Is="e-end-on",Ms="e-end-on-element",ks="e-end-on-date",Rs="e-until-date",Hs="e-end-on-count",Ps="e-recurrence-count",js="e-hide-recurrence-element",Ns="e-primary",Ls="e-active",qs="e-recurrence-table",Fs="e-repeat-content",Us="none",Bs="daily",Ws="weekly",zs="monthly",Ys="yearly",_s="never",Gs="until",Xs="count",Qs="text",Ks="value",Zs="MONTHLY",Js="=",$s=";",eo={none:"",daily:"days",weekly:"weeks",monthly:"months",yearly:"years"},to={sun:"SU",mon:"MO",tue:"TU",wed:"WE",thu:"TH",fri:"FR",sat:"SA"},io=[fs,ys,Is,vs,Ts,Ds],no=[ys],ro=[fs,Ts],ao=[fs],so=[fs,ys,Ts,Ds],oo=[ks,Hs],lo=[ks],po=[Hs],co=(ps=B.Component,cs(l,ps),l.prototype.startState=function(e,t,i){this.showFormElement(),this.updateForm(e),this.freshOnEndForm(),this.updateEndOnForm(t),this.selectMonthDay(i),this.updateUntilDate(i),this.onMonthDay.setProperties({checked:!0})},l.prototype.preRender=function(){this.localeObj=new B.L10n(this.getModuleName(),this.defaultLocale,this.locale),this.calendarUtil=Ia(this.calendarMode)},l.prototype.applyCustomClass=function(e){e&&B.addClass([this.element],e.split(" "))},l.prototype.initialize=function(){B.addClass([this.element],"e-"+this.getModuleName()),this.renderComponent(),"string"==typeof this.startDate&&this.setProperties({startDate:new Date(this.startDate)},!1),B.isNullOrUndefined(this.value)||""===this.value?(B.isNullOrUndefined(this.repeatType.value)||(this.startState(this.repeatType.value.toString().toUpperCase(),this.endTypes[0],this.startDate),this.updateForm(this.repeatType.value.toString())),0<this.selectedType&&this.setProperties({value:this.getRecurrenceRule()},!1)):this.setRecurrenceRule(this.value),this.applyCustomClass(this.cssClass)},l.prototype.triggerChangeEvent=function(){var e,t=this;this.renderStatus&&(e=this.getRecurrenceRule(),this.trigger("change",{value:e},function(e){return t.setProperties({value:e.value},!1)}))},l.prototype.resetDayButton=function(){[].slice.call(this.element.querySelectorAll(".e-days button")).forEach(function(e){return B.removeClass([e],[Ls,Ns])})},l.prototype.daySelection=function(e){this.resetDayButton();var t=[0,1,2,3,4,5,6],t=(this.rotateArray(t,this.firstDayOfWeek),this.element.querySelector('.e-days button[data-index="'+t.indexOf(e)+'"]'));t&&B.addClass([t],[Ls,Ns])},l.prototype.rtlClass=function(e){e?B.addClass([this.element],"e-rtl"):B.removeClass([this.element],"e-rtl")},l.prototype.updateUntilDate=function(e){e=new Date(e.getTime());e.setDate(e.getDate()+60),this.untilDateObj.setProperties({value:e})},l.prototype.selectMonthDay=function(e){var t=["sun","mon","tue","wed","thu","fri","sat"];this.monthDate.setProperties({value:this.calendarUtil.getDate(e)}),this.monthWeekDays.setProperties({value:to[t[e.getDay()]]}),this.monthValue.setProperties({value:""+this.calendarUtil.getMonth(e)}),this.monthWeekPos.setProperties({value:this.getDayPosition(e)}),this.daySelection(e.getDay())},l.prototype.updateForm=function(e){var t=this,i=(this.repeatType.setProperties({value:e}),this.element.querySelector("."+Is));switch(e===Bs?B.classList(i,[Cs],[Os]):B.classList(i,[Os],[Cs]),e){case Us:io.forEach(function(e){return B.addClass([t.element.querySelector("."+e)],js)});break;case Ws:no.forEach(function(e){return B.addClass([t.element.querySelector("."+e)],js)});break;case zs:ro.forEach(function(e){return B.addClass([t.element.querySelector("."+e)],js)});break;case Ys:ao.forEach(function(e){return B.addClass([t.element.querySelector("."+e)],js)});break;case Bs:so.forEach(function(e){return B.addClass([t.element.querySelector("."+e)],js)})}},l.prototype.updateEndOnForm=function(e){var t=this;switch(this.endType.setProperties({value:e}),e){case _s:oo.forEach(function(e){return B.addClass([t.element.querySelector("."+e)],js)});break;case Gs:po.forEach(function(e){return B.addClass([t.element.querySelector("."+e)],js)});break;case Xs:lo.forEach(function(e){return B.addClass([t.element.querySelector("."+e)],js)})}},l.prototype.freshOnEndForm=function(){var t=this;oo.forEach(function(e){e=t.element.querySelector("."+e);e&&B.removeClass([e],js)})},l.prototype.showFormElement=function(){var t=this;io.forEach(function(e){e=t.element.querySelector("."+e);e&&B.removeClass([e],js)})},l.prototype.renderDropdowns=function(){function e(e){return new j.DropDownList({dataSource:e,popupWidth:t.getPopupWidth(),enableRtl:t.enableRtl,fields:{text:Qs,value:Ks},index:1,change:function(e){i.onWeekDay.setProperties({checked:!0}),i.resetFormValues(),i.triggerChangeEvent()}})}var t=this,i=this;this.repeatType=new j.DropDownList({dataSource:this.getRepeatData(),floatLabelType:"Always",enableRtl:this.enableRtl,index:this.selectedType,fields:{text:Qs,value:Ks},placeholder:this.localeObj.getConstant("repeat"),htmlAttributes:{title:this.localeObj.getConstant("repeat")},change:function(e){i.setProperties({selectedType:t.frequencies.indexOf(e.value)},!1),i.element.querySelector("."+Fs).innerHTML=i.localeObj.getConstant(eo[e.value]),i.showFormElement(),i.updateForm(e.value),i.resetFormValues(),i.triggerChangeEvent()}}),this.repeatType.appendTo(this.element.querySelector("."+gs)),this.endType=new j.DropDownList({dataSource:this.getEndData(),popupWidth:this.getPopupWidth(),floatLabelType:"Always",placeholder:this.localeObj.getConstant("end"),enableRtl:this.enableRtl,index:1,fields:{text:Qs,value:Ks},change:function(e){i.freshOnEndForm(),i.updateEndOnForm(e.value),i.resetFormValues(),i.triggerChangeEvent()}}),this.endType.appendTo(this.element.querySelector("."+Ms));this.monthWeekPos=e(this.getMonthPosData()),this.monthWeekPos.appendTo(this.element.querySelector("."+Vs)),this.monthWeekDays=e(this.getDayData("wide")),this.monthWeekDays.appendTo(this.element.querySelector("."+As)),this.monthValue=new j.DropDownList({dataSource:this.getMonthData(),fields:{text:Qs,value:Ks},enableRtl:this.enableRtl,index:7,change:function(e){i.resetFormValues(),i.triggerChangeEvent()}}),this.monthValue.appendTo(this.element.querySelector("."+ws))},l.prototype.setDefaultValue=function(){for(var e=0,t=[].slice.call(this.element.querySelectorAll(".e-control .e-numerictextbox"));e<t.length;e++){var i=t[e].ej2_instances[0];i.element.classList.contains(ms)?(i.value=1,i.dataBind()):i.element.classList.contains(Ps)&&(i.value=10,i.dataBind())}},l.prototype.resetFormValues=function(){for(var e=0,t=[].slice.call(this.element.querySelectorAll('.e-control [type="text"]'));e<t.length;e++){var i,n=t[e],r=void 0;n.classList.contains("e-datepicker")?(r=n.ej2_instances[0]).value?(r.value=r.value,r.dataBind()):this.updateUntilDate(this.startDate):n.classList.contains("e-dropdownlist")?((r=n.ej2_instances[0]).index=r.index||0,r.dataBind()):n.classList.contains("e-numerictextbox")&&(i=void 0,i=(r=n.ej2_instances[0]).element.classList.contains(ms)?1:r.element.classList.contains(Ps)?10:this.startDate.getDate(),r.value=r.value||i,r.dataBind())}},l.prototype.getPopupWidth=function(){return B.Browser.isDevice?"100%":"auto"},l.prototype.renderDatePickers=function(){var t=this;this.untilDateObj=new R.DatePicker({firstDayOfWeek:this.firstDayOfWeek,enableRtl:this.enableRtl,locale:this.locale,min:this.minDate,max:this.maxDate,format:B.isNullOrUndefined(this.dateFormat)?this.getFormat("dateFormats"):this.dateFormat,change:function(e){e.value&&t.triggerChangeEvent()}}),this.untilDateObj.appendTo(this.element.querySelector("."+Rs))},l.prototype.getFormat=function(e){e="en"===this.locale||"en-US"===this.locale?B.getValue(e+".short",B.getDefaultDateObject(this.getCalendarMode())):B.getValue("main."+this.locale+".dates.calendars."+this.getCalendarMode()+"."+e+".short",B.cldrData);return e},l.prototype.dayButtonRender=function(){for(var i=this,e=[].slice.call(this.element.querySelectorAll(".e-days button")),n=this,t=0,r=e;t<r.length;t++){var a=r[t],s=new H.Button({isToggle:!0,enableRtl:this.enableRtl},a);this.dayButtons.push(s),B.EventHandler.add(a,"click",function(e){var t=[].slice.call(i.element.querySelectorAll(".e-days button."+Ns)),e=e.target;e.classList.contains(Ns)?1<t.length&&(B.removeClass([e],Ns),n.triggerChangeEvent()):(B.addClass([e],Ns),n.triggerChangeEvent())})}},l.prototype.radioButtonRender=function(){var e=this;this.onMonthDay=new H.RadioButton({label:this.localeObj.getConstant("onDay"),enableRtl:this.enableRtl,name:"monthType",value:"day",change:function(){e.resetFormValues(),e.triggerChangeEvent()}}),this.onMonthDay.appendTo(this.element.querySelector("."+bs)),this.monthButtons.push(this.onMonthDay),this.onWeekDay=new H.RadioButton({label:this.localeObj.getConstant("monthExpander"),cssClass:"e-month-type",name:"monthType",enableRtl:this.enableRtl,value:"daypos",change:function(){e.resetFormValues(),e.triggerChangeEvent()}}),this.onWeekDay.appendTo(this.element.querySelector("."+xs)),this.monthButtons.push(this.onWeekDay)},l.prototype.numericTextboxRender=function(){var e=this;this.recurrenceCount=new P.NumericTextBox({value:10,format:"#",enableRtl:this.enableRtl,min:1,max:999,change:function(){e.triggerChangeEvent()}}),this.recurrenceCount.appendTo(this.element.querySelector("."+Ps)),this.monthDate=new P.NumericTextBox({value:1,format:"#",enableRtl:this.enableRtl,min:1,max:31,change:function(){e.onMonthDay.setProperties({checked:!0}),e.triggerChangeEvent()}}),this.monthDate.appendTo(this.element.querySelector("."+Es)),this.repeatInterval=new P.NumericTextBox({value:1,format:"#",min:1,max:999,enableRtl:this.enableRtl,floatLabelType:"Always",placeholder:this.localeObj.getConstant("repeatEvery"),change:function(){e.triggerChangeEvent()}}),this.repeatInterval.appendTo(this.element.querySelector("."+ms))},l.prototype.renderComponent=function(){this.setTemplate(),this.renderDropdowns(),this.renderDatePickers(),this.dayButtonRender(),this.radioButtonRender(),this.numericTextboxRender()},l.prototype.rotateArray=function(e,t){for(var i,n=0;n<t;n++)i=e.shift(),e.push(i)},l.prototype.getEndData=function(){var t=this,i=[];return this.endTypes.forEach(function(e){i.push({text:t.localeObj.getConstant(e),value:e})}),i},l.prototype.getDayPosition=function(e){for(var t=new Date(e.getTime()),i=new Date(e.getTime()),n=e.getDay(),r=[],t=this.calendarUtil.getMonthStartDate(t),i=this.calendarUtil.getMonthEndDate(i);t<i;)t.getDay()===n&&r.push(t.getTime()),t.setDate(t.getDate()+1);return r.indexOf(e.getTime())===r.length-1?-1:r.indexOf(e.getTime())+1},l.prototype.getRepeatData=function(){var t=[],i=this;return this.frequencies.forEach(function(e){t.push({text:i.localeObj.getConstant(e===Us?_s:e),value:e})}),t},l.prototype.getMonthPosData=function(){var t={first:1,second:2,third:3,fourth:4,last:-1},i=this,n=[];return["first","second","third","fourth","last"].forEach(function(e){n.push({text:i.localeObj.getConstant(e),value:t[""+e]})}),n},l.prototype.getDayData=function(e){var t,i,n=["sun","mon","tue","wed","thu","fri","sat"],r=[];this.rotateArray(n,this.firstDayOfWeek),t="en"===this.locale||"en-US"===this.locale?B.getValue((i="days.stand-alone.")+e,B.getDefaultDateObject(this.getCalendarMode())):(i="main."+this.locale+".dates.calendars."+this.getCalendarMode()+".days.stand-alone."+e,B.getValue(i,B.cldrData));for(var a=0,s=n;a<s.length;a++){var o=s[a],l=B.getValue(o,t);r.push({text:"narrow"===e?l:y(l,"single"),value:to[""+o]})}return r},l.prototype.getMonthData=function(){var e,t,i=[];e="en"===this.locale||"en-US"===this.locale?B.getValue(t="months.stand-alone.wide",B.getDefaultDateObject(this.getCalendarMode())):(t="main."+this.locale+".dates.calendars."+this.getCalendarMode()+".months.stand-alone.wide",B.getValue(t,B.cldrData));for(var n=0,r=Object.keys(e);n<r.length;n++){var a=r[n];i.push({text:y(B.getValue(a,e),"single"),value:a})}return i},l.prototype.setTemplate=function(){var e=this.getDayData("narrow"),t=this.getDayData("wide");this.element.innerHTML='<div class="e-editor"><div class="'+ds+" "+Cs+'"><input type="text" tabindex="0" class="'+gs+'"label="'+gs.substr(2)+'" /></div><div class="'+ds+" "+vs+" "+Os+'"><table class="'+qs+' e-repeat-content-wrapper" role="none"><tr><td><input type="text" tabindex="0" id="'+this.element.id+"_"+ms+'" class="'+ms+'"title="'+this.localeObj.getConstant("repeatEvery")+'" /></td><td><span class="'+Fs+'"></span></td></tr></table></div><div class="'+us+" "+fs+" "+Cs+'"><div class=e-week-expander-label>'+this.localeObj.getConstant("on")+'</div><button type="button" class="e-round" data-index="0" title="'+t[0].text+'">'+e[0].text+'</button><button type="button" class="e-round" data-index="1" title="'+t[1].text+'">'+e[1].text+'</button><button type="button" class="e-round" data-index="2" title="'+t[2].text+'">'+e[2].text+'</button><button type="button" class="e-round" data-index="3" title="'+t[3].text+'">'+e[3].text+'</button><button type="button" class="e-round" data-index="4" title="'+t[4].text+'">'+e[4].text+'</button><button type="button" class="e-round" data-index="5" title="'+t[5].text+'">'+e[5].text+'</button><button type="button" class="e-round" data-index="6" title="'+t[6].text+'">'+e[6].text+'</button></div><div class="'+us+" "+ys+" "+Cs+'"><div class=e-month-expander-label>'+this.localeObj.getConstant("on")+'</div><div class="'+Ts+'"><input class="'+ws+'" type="text" tabindex="0" title="'+this.localeObj.getConstant("yearExpander")+'"/></div><div class="'+Ds+'"><table class="'+qs+' e-month-expand-wrapper" role="none"><tr><td><div class="'+ds+" "+Ss+'"><input class="'+bs+'"title="'+this.localeObj.getConstant("monthExpander")+'" type="radio"></div></td><td colspan="2"><div class="'+ds+' e-monthday-element"><input type="text" tabindex="0" id="'+this.element.id+"_"+Es+'" class="'+Es+'"title="'+this.localeObj.getConstant("on")+'" /></div></td></tr><tr><td><div class="'+ds+" "+Ss+' e-repeat-on-week-selector"><input class="'+xs+'"title="'+this.localeObj.getConstant("monthExpander")+'" type="radio"></div></td><td><div class="'+ds+' e-week-position" ><input type="text" tabindex="0" class="'+Vs+'"title="'+this.localeObj.getConstant("monthPosition")+'" /></div></td><td><div class="'+ds+' e-day-position"><input type="text" tabindex="0" class="'+As+'"title="'+this.localeObj.getConstant("monthWeek")+'" /></div></td></tr></table></div></div><div class="'+us+" "+Is+" "+Os+'"><div class="'+ds+' e-end-on-left"><input type="text" tabindex="0" class="'+Ms+'"title="'+this.localeObj.getConstant("end")+'" /></div><div class="'+ds+" "+ks+'" ><input type="text" tabindex="0" class="'+Rs+'"title="'+this.localeObj.getConstant(Gs)+'" /></div><div class="'+ds+" "+Hs+'"><input type="text" tabindex="0" id="'+this.element.id+"_"+Ps+'" class="'+Ps+'"title="'+this.localeObj.getConstant(Xs)+'" /></div></div></div></div>'},l.prototype.getSelectedDaysData=function(){var e="BYDAY=",t=[].slice.call(this.element.querySelectorAll(".e-days button."+Ns)),i=["SU","MO","TU","WE","TH","FR","SA"];this.rotateArray(i,this.firstDayOfWeek);for(var n=0;n<t.length;n++)e+=i[parseInt(t[parseInt(n.toString(),10)].getAttribute("data-index"),10)]+(n===t.length-1?"":",");return e+$s},l.prototype.getSelectedMonthData=function(){var e=this.onWeekDay.checked?"BYDAY="+this.monthWeekDays.value+$s+"BYSETPOS"+Js+this.monthWeekPos.value+$s:"BYMONTHDAY="+this.monthDate.value+$s;return e},l.prototype.getIntervalData=function(){return"INTERVAL="+this.repeatInterval.value+$s},l.prototype.getEndOnCount=function(){return"COUNT="+this.recurrenceCount.value+$s},l.prototype.getYearMonthRuleData=function(){return"BYMONTH="+this.monthValue.value+$s},l.prototype.updateWeekButton=function(e){var t=["SU","MO","TU","WE","TH","FR","SA"];this.rotateArray(t,this.firstDayOfWeek);for(var i=0,n=this.dayButtons;i<n.length;i++){var r=n[i],a=parseInt(r.element.getAttribute("data-index"),10);-1!==e.indexOf(t[parseInt(a.toString(),10)])?r.setProperties({isPrimary:!0}):r.setProperties({isPrimary:!1})}},l.prototype.updateMonthUI=function(){if(this.ruleObject.monthDay.length)this.monthDate.setProperties({value:this.ruleObject.monthDay[0]}),this.onMonthDay.setProperties({checked:!0});else{this.onWeekDay.setProperties({checked:!0}),this.monthWeekPos.setProperties({value:this.ruleObject.setPosition});for(var e=0,t=Object.keys(to);e<t.length;e++){var i=t[e];if(to[""+i]===this.ruleObject.day[0]){this.monthWeekDays.setProperties({value:this.ruleObject.day[0]});break}}}},l.prototype.updateUI=function(e,t){switch(this.repeatInterval.setProperties({value:this.ruleObject.interval}),t){case Gs:this.untilDateObj.setProperties({value:this.ruleObject.until});break;case Xs:this.recurrenceCount.setProperties({value:this.ruleObject.count})}switch(e){case Ws:this.updateWeekButton(this.ruleObject.day);break;case Ys:this.monthValue.setProperties({index:this.ruleObject.month[0]-1}),this.updateMonthUI();break;case zs:this.updateMonthUI()}},l.prototype.getUntilData=function(){return this.untilDateObj.value?"UNTIL="+Wa(this.untilDateObj.value)+$s:""},l.prototype.destroyComponents=function(){this.recurrenceCount.isDestroyed||(this.recurrenceCount.destroy(),this.recurrenceCount=null),this.monthDate.isDestroyed||(this.monthDate.destroy(),this.monthDate=null),this.repeatInterval.isDestroyed||(this.repeatInterval.destroy(),this.repeatInterval=null),this.untilDateObj.isDestroyed||(this.untilDateObj.destroy(),this.untilDateObj=null),this.repeatType.isDestroyed||(this.repeatType.destroy(),this.repeatType=null),this.endType.isDestroyed||(this.endType.destroy(),this.endType=null),this.monthWeekPos.isDestroyed||(this.monthWeekPos.destroy(),this.monthWeekPos=null),this.monthWeekDays.isDestroyed||(this.monthWeekDays.destroy(),this.monthWeekDays=null),this.monthValue.isDestroyed||(this.monthValue.destroy(),this.monthValue=null),this.onMonthDay.isDestroyed||(this.onMonthDay.destroy(),this.onMonthDay=null),this.onWeekDay.isDestroyed||(this.onWeekDay.destroy(),this.onWeekDay=null),this.dayButtons.forEach(function(e){e.isDestroyed||e.destroy()}),this.dayButtons=[],this.monthButtons.forEach(function(e){e.isDestroyed||e.destroy()}),this.monthButtons=[]},l.prototype.resetFields=function(){this.startState(Us,this.endTypes[0],this.startDate),this.setDefaultValue()},l.prototype.updateRuleUntilDate=function(e){var t;this.untilDateObj.value&&e&&(t=this.untilDateObj.value,t=new Date(t.getFullYear(),t.getMonth(),t.getDate(),e.getHours(),e.getMinutes(),e.getMilliseconds()),this.untilDateObj.setProperties({value:t}))},l.prototype.getCalendarMode=function(){return B.isNullOrUndefined(this.calendarMode)?"gregorian":this.calendarMode.toLowerCase()},l.prototype.getRuleSummary=function(e){return ra(e=void 0===e?this.getRecurrenceRule():e,this.localeObj,this.locale,this.calendarMode)},l.prototype.getRecurrenceDates=function(e,t,i,n,r){return r=B.isNullOrUndefined(r)?this.startDate:r,sa(e,t,i,this.firstDayOfWeek,n,r,this.calendarMode)},l.prototype.getRecurrenceRule=function(){var e="FREQ=";switch(this.repeatType.value){case Bs:e+="DAILY;";break;case Ws:e+="WEEKLY;"+this.getSelectedDaysData();break;case zs:e+=Zs+$s+this.getSelectedMonthData();break;case Ys:e+="YEARLY;"+this.getSelectedMonthData()+this.getYearMonthRuleData();break;case Us:return""}switch(e+=this.getIntervalData(),this.endType.value){case Gs:e+=this.getUntilData();break;case Xs:e+=this.getEndOnCount()}return e},l.prototype.setRecurrenceRule=function(e,t){if(void 0===t&&(t=this.startDate),e){this.renderStatus=!1,this.ruleObject=xa(e);var i=this.ruleObject.count?Xs:this.ruleObject.until?Gs:_s;switch(this.ruleObject.freq){case"DAILY":this.startState(Bs,i,t),this.updateUI(Bs,i);break;case"WEEKLY":this.startState(Ws,i,t),this.updateUI(Ws,i);break;case Zs:this.startState(zs,i,t),this.updateUI(zs,i);break;case"YEARLY":this.startState(Ys,i,t),this.updateUI(Ys,i)}this.renderStatus=!0,this.triggerChangeEvent()}else this.repeatType.setProperties({value:Us})},l.prototype.detachInputs=function(){for(var e=0,t=[].slice.call(this.element.querySelectorAll("input"));e<t.length;e++){var i=t[e];B.detach(i)}},l.prototype.destroy=function(){if(!this.isDestroyed){this.destroyComponents(),ps.prototype.destroy.call(this);var e=["e-"+this.getModuleName()];for(this.cssClass&&(e=e.concat(this.cssClass.split(" "))),B.removeClass([this.element],e),this.detachInputs();this.element.firstElementChild;)this.element.removeChild(this.element.firstElementChild)}},l.prototype.getModuleName=function(){return"recurrenceeditor"},l.prototype.getPersistData=function(){return this.addOnPersist([])},l.prototype.render=function(){this.initialize(),this.rtlClass(this.enableRtl),this.renderStatus=!0,this.renderComplete()},l.prototype.onPropertyChanged=function(e,t){for(var i=0,n=Object.keys(e);i<n.length;i++)switch(n[i]){case"startDate":this.selectMonthDay(e.startDate),this.updateUntilDate(e.startDate),this.endType.setProperties({index:0});break;case"enableRtl":this.rtlClass(e.enableRtl);break;case"cssClass":t.cssClass&&B.removeClass([this.element],t.cssClass.split(" ")),e.cssClass&&B.addClass([this.element],e.cssClass.split(" "));break;case"selectedType":this.repeatType.setProperties({index:this.selectedType});break;case"minDate":this.untilDateObj.setProperties({min:this.minDate});break;case"maxDate":this.untilDateObj.setProperties({max:this.maxDate});break;case"value":this.getRecurrenceRule()!==this.value&&this.setRecurrenceRule(this.value);break;case"calendarMode":this.calendarMode=e.calendarMode,this.calendarUtil=Ia(e.calendarMode);break;case"locale":case"frequencies":case"firstDayOfWeek":case"endTypes":this.refresh();break;case"dateFormat":this.untilDateObj.setProperties({format:e.dateFormat})}},hs([B.Property(["none","daily","weekly","monthly","yearly"])],l.prototype,"frequencies",void 0),hs([B.Property(["never","until","count"])],l.prototype,"endTypes",void 0),hs([B.Property(0)],l.prototype,"firstDayOfWeek",void 0),hs([B.Property(new Date)],l.prototype,"startDate",void 0),hs([B.Property()],l.prototype,"dateFormat",void 0),hs([B.Property("Gregorian")],l.prototype,"calendarMode",void 0),hs([B.Property()],l.prototype,"cssClass",void 0),hs([B.Property()],l.prototype,"value",void 0),hs([B.Property(new Date(1900,0,1))],l.prototype,"minDate",void 0),hs([B.Property(new Date(2099,11,31))],l.prototype,"maxDate",void 0),hs([B.Property(0)],l.prototype,"selectedType",void 0),hs([B.Event()],l.prototype,"change",void 0),hs([B.Event()],l.prototype,"created",void 0),hs([B.Event()],l.prototype,"destroyed",void 0),hs([B.NotifyPropertyChanges],l));function l(e,t){e=ps.call(this,e,t)||this;return e.defaultLocale={none:"None",daily:"Daily",weekly:"Weekly",monthly:"Monthly",month:"Month",yearly:"Yearly",never:"Never",until:"Until",count:"Count",first:"First",second:"Second",third:"Third",fourth:"Fourth",last:"Last",repeat:"Repeat",repeatEvery:"Repeat every",on:"Repeat On",end:"End",onDay:"Day",days:"Day(s)",weeks:"Week(s)",months:"Month(s)",years:"Year(s)",every:"every",summaryTimes:"time(s)",summaryOn:"on",summaryUntil:"until",summaryRepeat:"Repeats",summaryDay:"day(s)",summaryWeek:"week(s)",summaryMonth:"month(s)",summaryYear:"year(s)",monthWeek:"Month Week",monthPosition:"Month Position",monthExpander:"Month Expander",yearExpander:"Year Expander",repeatInterval:"Repeat Interval"},e.renderStatus=!1,e.dayButtons=[],e.monthButtons=[],e}var ho="e-field",uo="e-recurrence-container",go="e-hide",mo=(c.prototype.renderEventWindow=function(){this.element=B.createElement("div",{id:this.parent.element.id+"_dialog_wrapper"}),this.parent.element.appendChild(this.element);var e={animationSettings:{effect:"Zoom"},content:this.getEventWindowContent(),cssClass:Bn,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,height:this.parent.isAdaptive?"100%":"auto",minHeight:"300px",isModal:!0,showCloseIcon:!this.parent.isAdaptive,target:document.body,visible:!1,width:"500px",beforeOpen:this.onBeforeOpen.bind(this),beforeClose:this.onBeforeClose.bind(this)};this.parent.isAdaptive?(e.cssClass=Bn+" "+yt,this.parent.editorHeaderTemplate||(e.header='<div class="e-title-header"><div class="e-back-icon e-icons"></div><div class="e-title-text">'+this.l10n.getConstant("newEvent")+'</div><div class="e-save-icon e-icons"></div></div>')):(this.parent.editorFooterTemplate||this.renderDialogButtons(e),this.parent.editorHeaderTemplate||(e.header='<div class="e-title-text">'+this.l10n.getConstant("newEvent")+"</div>")),this.dialogObject=new M.Dialog(e,this.element),this.dialogObject.element.querySelector(".e-dlg-closeicon-btn")&&this.dialogObject.element.querySelector(".e-dlg-closeicon-btn").setAttribute("title",this.l10n.getConstant("close")),this.addEventHandlers(),B.addClass([this.element.parentElement],Bn+"-container"),B.EventHandler.add(this.dialogObject.element,"keydown",this.preventEventSave,this),this.applyFormValidation()},c.prototype.renderDialogButtons=function(e){e.buttons=[{buttonModel:{content:this.l10n.getConstant("deleteButton"),cssClass:Dn,disabled:!this.parent.eventSettings.allowDeleting||this.parent.readonly},click:this.eventDelete.bind(this)},{buttonModel:{content:this.l10n.getConstant("saveButton"),cssClass:"e-primary "+ar,isPrimary:!0,disabled:!this.parent.eventSettings.allowAdding||this.parent.readonly},click:this.eventSave.bind(this)},{buttonModel:{cssClass:rr,content:this.l10n.getConstant("cancelButton")},click:this.dialogClose.bind(this)}]},c.prototype.addEventHandlers=function(){var e=this.element.querySelector(".e-back-icon"),t=this.element.querySelector("."+nr);!this.parent.isAdaptive||B.isNullOrUndefined(e)||B.isNullOrUndefined(t)||(B.EventHandler.add(e,"click",this.dialogClose,this),B.EventHandler.add(t,"click",this.eventSave,this))},c.prototype.refresh=function(){this.destroy(!0),this.renderEventWindow()},c.prototype.refreshRecurrenceEditor=function(){var e;this.recurrenceEditor&&(e=this.recurrenceEditor.element,this.recurrenceEditor.destroy(),this.createRecurrenceEditor(e))},c.prototype.setRecurrenceEditor=function(e){this.parent.editorTemplate&&(this.recurrenceEditor=e)},c.prototype.openEditor=function(e,t,i,n){var r;this.parent.currentAction=t,this.parent.removeNewEventElement(),this.parent.quickPopup&&this.parent.quickPopup.quickPopupHide(!0),this.parent.inlineModule.removeInlineAppointmentElement(),"Add"===t&&(r={},this.cellClickAction=!i,i=this.parent.activeCellsData=e,this.cellClickAction?this.convertToEventData(i,r):(this.parent.activeCellsData={startTime:i.startTime||i[this.fields.startTime],endTime:i.endTime||i[this.fields.endTime],isAllDay:i.isAllDay||i[this.fields.isAllDay],element:i.element,groupIndex:i.groupIndex},r=i),e=r),B.isNullOrUndefined(this.parent.editorHeaderTemplate)||(this.parent.resetTemplates(["editorHeaderTemplate"]),this.parent.isAdaptive&&!this.parent.editorFooterTemplate?this.dialogObject.header=this.createAdaptiveHeaderElement(e):this.dialogObject.header=this.getDialogHeader(e)),B.isNullOrUndefined(this.parent.editorFooterTemplate)||(this.parent.resetTemplates(["editorFooterTemplate"]),this.dialogObject.footerTemplate=this.getDialogFooter(e)),B.isNullOrUndefined(this.parent.editorHeaderTemplate)&&B.isNullOrUndefined(this.parent.editorFooterTemplate)||(this.dialogObject.dataBind(),this.addEventHandlers()),B.isNullOrUndefined(this.parent.editorTemplate)?this.setEditorContent(e,t,n):this.renderFormElements(this.element.querySelector(".e-schedule-form"),e,t,n)},c.prototype.setEditorContent=function(e,t,i){switch(!this.parent.isAdaptive&&B.isNullOrUndefined(this.parent.editorTemplate)&&B.removeClass([this.dialogObject.element.querySelector(".e-recurrenceeditor")],d),this.recurrenceEditor&&(this.recurrenceEditor.firstDayOfWeek=this.parent.activeViewOptions.firstDayOfWeek),t){case"Add":this.onCellDetailsUpdate(e,i);break;case"Save":case"EditOccurrence":case"EditSeries":case"EditFollowingEvents":"EditOccurrence"===t&&!this.parent.isAdaptive&&B.isNullOrUndefined(this.parent.editorTemplate)&&B.addClass([this.dialogObject.element.querySelector(".e-recurrenceeditor")],d),this.cellClickAction=!1,this.onEventDetailsUpdate(e)}},c.prototype.setDialogContent=function(){this.dialogObject.content=this.getEventWindowContent(),this.dialogObject.dataBind(),this.applyFormValidation()},c.prototype.setDialogHeader=function(){B.isNullOrUndefined(this.parent.editorHeaderTemplate)?this.parent.isAdaptive?this.dialogObject.header='<div class="e-title-header"><div class="e-back-icon e-icons"></div><div class="e-title-text">'+this.l10n.getConstant("newEvent")+'</div><div class="e-save-icon e-icons"></div></div>':this.dialogObject.header='<div class="e-title-text">'+this.l10n.getConstant("newEvent")+"</div>":(this.parent.resetTemplates(["editorHeaderTemplate"]),this.parent.isAdaptive&&!this.parent.editorFooterTemplate?this.dialogObject.header=this.createAdaptiveHeaderElement():this.dialogObject.header=this.getDialogHeader()),this.dialogObject.dataBind(),this.addEventHandlers()},c.prototype.setDialogFooter=function(){B.isNullOrUndefined(this.parent.editorFooterTemplate)?!this.parent.isAdaptive&&B.isNullOrUndefined(this.parent.editorFooterTemplate)?this.renderDialogButtons(this.dialogObject):this.parent.isAdaptive&&B.isNullOrUndefined(this.parent.editorFooterTemplate)&&(this.dialogObject.footerTemplate=null):(this.parent.resetTemplates(["editorFooterTemplate"]),this.dialogObject.footerTemplate=this.getDialogFooter()),this.dialogObject.dataBind()},c.prototype.createAdaptiveHeaderElement=function(e){var t=B.createElement("div",{className:"e-title-header"}),i=B.createElement("div",{className:"e-back-icon e-icons"}),i=(t.appendChild(i),this.getDialogHeader(e)),e=(t.appendChild(i),B.createElement("div",{className:"e-save-icon e-icons"}));return t.appendChild(e),t},c.prototype.getDialogHeader=function(e){var t=this.parent.element.id+"_editorHeaderTemplate",i=document.createElement("div"),e=[].slice.call(this.parent.getEditorHeaderTemplate()(e||{},this.parent,"editorHeaderTemplate",t,!1));return B.append(e,i),i},c.prototype.getDialogFooter=function(e){var t=this.parent.element.id+"_editorFooterTemplate",i=document.createElement("div"),e=[].slice.call(this.parent.getEditorFooterTemplate()(e||{},this.parent,"editorFooterTemplate",t,!1));return B.append(e,i),i},c.prototype.preventEventSave=function(e){this.parent&&!this.parent.allowKeyboardInteraction&&"Enter"===e.code&&(this.isEnterKey=!0)},c.prototype.onBeforeOpen=function(n){var r=this,a=this.eventData[this.fields.endTime].getTime(),e={type:"Editor",data:this.eventData,cancel:!1,element:this.element,target:(this.cellClickAction?this.parent.activeCellsData:this.parent.activeEventData).element},t=(this.cellClickAction&&(e.duration=this.getSlotDuration()),this.getInstance(ar)),t=(t&&(t.disabled=!(this.cellClickAction?this.parent.eventSettings.allowAdding:this.parent.eventSettings.allowEditing),t.dataBind()),this.getInstance(Dn)),s=(t&&(t.disabled=!this.parent.eventSettings.allowDeleting,t.dataBind()),new p.Deferred);return this.parent.trigger(ae,e,function(e){var t,i;n.cancel=e.cancel,n.maxHeight=r.parent.isAdaptive?"max-content":n.maxHeight,r.duration=r.cellClickAction?e.duration:null,r.eventData[r.fields.endTime].getTime()!==a||r.cellClickAction||0!==r.eventData[r.fields.endTime].getHours()||0!==r.eventData[r.fields.endTime].getMinutes()||(r.eventData=B.extend({},r.eventData,null,!0),r.trimAllDay(r.eventData)),r.refreshDateTimePicker(r.duration),r.cellClickAction&&e.duration!==r.getSlotDuration()&&B.isNullOrUndefined(r.parent.editorTemplate)&&(t=r.getInstance(Kn),(i=r.getInstance(Zn)).value=new Date(t.value.getTime()+je*e.duration),i.dataBind()),r.parent.editorTemplate&&r.element.querySelector(".e-recurrenceeditor")&&!r.recurrenceEditor&&(r.recurrenceEditor=r.getInstance("e-recurrenceeditor")),s.resolve(n)}),s},c.prototype.onBeforeClose=function(t){var i=this,e=(t.isInteracted&&(this.isCrudAction=!1),{type:"Editor",event:t.event||this.dialogEvent,data:this.eventCrudData,cancel:!1,element:this.element,target:(this.cellClickAction?this.parent.activeCellsData:this.parent.activeEventData).element}),n=new p.Deferred;return this.parent.trigger(se,e,function(e){t.cancel=e.cancel,e.cancel||(i.isCrudAction&&(t.cancel=i.processCrudActions(e.data),i.isCrudAction=t.cancel),i.isCrudAction)||(i.resetForm(),i.parent.eventBase.focusElement(!0),i.eventCrudData=null),n.resolve(t)}),n},c.prototype.getEventWindowContent=function(){var e=B.createElement("div",{className:"e-form-container"}),t=B.createElement("form",{id:this.parent.element.id+"EditForm",className:Wn});return t.onsubmit=function(){return!1},this.renderFormElements(t),e.appendChild(t),e},c.prototype.renderFormElements=function(e,t,i,n){var r=this;if(B.isNullOrUndefined(this.parent.editorTemplate))e.appendChild(this.getDefaultEventWindowContent()),t&&this.setEditorContent(t,i,n);else{if(t&&(this.fieldValidator&&(this.fieldValidator.destroy(),this.fieldValidator=null),this.recurrenceEditor&&(this.recurrenceEditor.destroy(),this.recurrenceEditor=null),this.destroyComponents(),this.parent.resetTemplates(["editorTemplate"]),B.EventHandler.clearEvents(e),!this.parent.isReact))for(var a=0,s=[].slice.call(e.children);a<s.length;a++){var o=s[a];B.remove(o)}var l=this.parent.element.id+"_editorTemplate",l=[].slice.call(this.parent.getEditorTemplate()(t||{},this.parent,"editorTemplate",l,!1));B.append(l,e),this.parent.renderTemplates(function(){r.element&&(r.applyFormValidation(),t)&&r.setEditorContent(t,i,n)})}},c.prototype.getDefaultEventWindowContent=function(){var e=this.createDivElement("e-dialog-parent"),t=this.createDivElement("e-title-location-row"),t=(e.appendChild(t),t.appendChild(this.renderTextBox(Gn)),t.appendChild(this.renderTextBox(Xn)),this.createDivElement("e-start-end-row")),t=(e.appendChild(t),t.appendChild(this.renderDateTimePicker(Kn,this.onTimeChange.bind(this))),t.appendChild(this.renderDateTimePicker(Zn)),this.createDivElement("e-all-day-time-zone-row")),t=(e.appendChild(t),t.appendChild(this.renderCheckBox(zn)),t.appendChild(this.renderCheckBox(Yn)),this.createDivElement(er)),t=(e.appendChild(t),t.appendChild(this.renderDropDown(tr)),t.appendChild(this.renderDropDown(ir)),this.createDivElement("e-repeat-parent-row")),i=(e.appendChild(t),this.renderCheckBox(_n)),n=B.createElement("span",{className:uo}),r=B.createElement("button",{className:"e-recurrence-edit-button",attrs:{type:"button",title:this.l10n.getConstant("editRecurrence")}});if(this.buttonObj=new H.Button({iconCss:"e-recurrence-edit e-icons",cssClass:"e-medium "+this.parent.cssClass}),n.appendChild(r),this.buttonObj.appendTo(r),i.appendChild(n),t.appendChild(i),this.parent.isAdaptive?B.EventHandler.add(r,"click",this.loadRecurrenceEditor,this):this.createRecurrenceEditor(e),0<this.parent.resourceCollection.length){for(var a=this.createDivElement("e-resources-row"),s=0,o=this.parent.resourceBase.resourceCollection;s<o.length;s++){var l=o[s];a.appendChild(this.renderResourceDetails(l))}e.appendChild(a)}n=this.createDivElement(Jn+"-row"),n.appendChild(this.renderTextBox(Jn)),e.appendChild(n),t=B.createElement("button",{attrs:{type:"hidden",title:"submit"}});return t.style.display="none",e.appendChild(t),e},c.prototype.createRecurrenceEditor=function(e){var t=B.createElement("div",{id:this.parent.element.id+"_recurrence_editor"});e.appendChild(t),this.recurrenceEditor=this.renderRecurrenceEditor(),this.recurrenceEditor.appendTo(t),this.updateMinMaxDateToEditor()},c.prototype.createDivElement=function(e){return B.createElement("div",{className:e})},c.prototype.createInputElement=function(e,t,i){return B.createElement(i||"input",{className:e,attrs:{type:"text",name:t,value:"",id:t}})},c.prototype.getSlotDuration=function(){return this.parent.activeViewOptions.timeScale.interval/this.parent.activeViewOptions.timeScale.slotCount},c.prototype.renderDateTimePicker=function(e,t){var i=this.createDivElement(e+"-container"),n=this.getFieldName(e),n=this.createInputElement(e+" "+ho,n);return i.appendChild(n),new R.DateTimePicker({change:t,firstDayOfWeek:this.parent.activeViewOptions.firstDayOfWeek,calendarMode:this.parent.calendarMode,min:this.parent.minDate,max:new Date(new Date(+this.parent.maxDate).setHours(23,59,59)),cssClass:this.parent.cssClass,enableRtl:this.parent.enableRtl,locale:this.parent.locale,floatLabelType:"Always",strictMode:!0,timeFormat:this.parent.activeViewOptions.timeFormat,format:(B.isNullOrUndefined(this.parent.dateFormat)?this.getFormat("dateFormats"):this.parent.dateFormat)+" "+this.parent.activeViewOptions.timeFormat,placeholder:this.getFieldLabel(e),step:this.getSlotDuration(),width:"100%"}).appendTo(n),i},c.prototype.refreshDateTimePicker=function(e){for(var t=0,i=[].slice.call(this.element.querySelectorAll(".e-start,.e-end"));t<i.length;t++){var n=i[t].ej2_instances[0];n.firstDayOfWeek=this.parent.activeViewOptions.firstDayOfWeek,n.timeFormat=this.parent.activeViewOptions.timeFormat,n.step=e||this.getSlotDuration(),n.dataBind()}},c.prototype.onTimeChange=function(){var e,t,i=this.getInstance(Kn);i.element.parentElement.classList.contains("e-input-focus")&&(e=this.getInstance(Zn),t=0,this.cellClickAction?(t=je*this.duration,this.eventWindowTime.startTime=i.value):t=this.eventData[this.fields.endTime].getTime()-this.eventData[this.fields.startTime].getTime(),i=B.isNullOrUndefined(i.value)?null:new Date(i.value.getTime()+t),this.cellClickAction&&(this.eventWindowTime.endTime=i),e.value=i,e.dataBind()),this.recurrenceEditor&&this.recurrenceEditor.updateRuleUntilDate(this.eventWindowTime.startTime)},c.prototype.renderResourceDetails=function(t){function e(e){return B.SanitizeHtmlHelper.sanitize('<div class="e-resource-template">\n <div class="e-resource-color" data-resource-color="'+e[t.colorField]+'"></div>\n <div class="e-resource-text">'+e[t.textField]+"</div></div>")}var i=this,n=t.field,r="e-"+n,a=t.title,s=this.createDivElement(r+"-container e-resources"),r=this.createInputElement(r+" "+ho,n);s.appendChild(r);return B.initializeCSPTemplate(e,t),(t.allowMultiple?new j.MultiSelect({enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:this.parent.cssClass||"",dataSource:t.dataSource,change:this.onMultiselectResourceChange.bind(this),itemTemplate:e,fields:{text:t.textField,value:t.idField},htmlAttributes:{name:n},floatLabelType:"Always",placeholder:a,popupHeight:"230px",popupWidth:"447px",mode:"Box",open:function(e){Promise.resolve().then(function(){i.applyStylesAfterRender(e)})}}):new j.DropDownList({cssClass:this.parent.cssClass||"",change:this.onDropdownResourceChange.bind(this),dataSource:t.dataSource,enableRtl:this.parent.enableRtl,fields:{text:t.textField,value:t.idField},htmlAttributes:{name:n},floatLabelType:"Always",placeholder:a,popupHeight:"230px",popupWidth:"447px",itemTemplate:e,open:function(e){Promise.resolve().then(function(){i.applyStylesAfterRender(e)})}})).appendTo(r),s},c.prototype.applyStylesAfterRender=function(e){e.popup&&e.popup.element&&e.popup.element.querySelectorAll(".e-resource-color[data-resource-color]").forEach(function(e){var t=e.getAttribute("data-resource-color");t&&(e.style.backgroundColor=t)})},c.prototype.renderDropDown=function(e){var i=this,t=this.getFieldName(e),n=this.createDivElement(e+"-container"),r=this.createInputElement(e+" "+ho,t);return n.appendChild(r),new j.DropDownList({allowFiltering:!0,change:this.onTimezoneChange.bind(this),cssClass:this.parent.cssClass||"",dataSource:this.parent.timezoneDataSource,enableRtl:this.parent.enableRtl,fields:{text:"Text",value:"Value"},filterBarPlaceholder:this.parent.localeObj.getConstant("searchTimezone"),noRecordsTemplate:this.parent.localeObj.getConstant("noRecords"),filtering:function(e){var t=new p.Query,t=""!==e.text?t.where("Text","contains",e.text,!0):t;e.updateData(i.parent.timezoneDataSource,t)},htmlAttributes:{title:this.getFieldLabel(e),name:t},floatLabelType:"Always",placeholder:this.getFieldLabel(e),popupHeight:"230px"}).appendTo(r),n},c.prototype.onMultiselectResourceChange=function(n){if(n.value&&this.parent.activeViewOptions.group.byGroupID&&!(this.parent.resourceCollection.length<=1))for(var r=this.parent.resourceBase.resourceCollection,e=n.element.getAttribute("name")||this.getColumnName(n.element),a=0;a<r.length;a++)if(r[parseInt(a.toString(),10)].field===e&&a<r.length-1){for(var t=this.createInstance(a),s=[],o=this,i=0;i<n.value.length;i++)!function(t){var i=r[a+1],e=i.dataSource.filter(function(e){return e[i.groupIDField]===n.value[parseInt(t.toString(),10)]})[0],e=B.isNullOrUndefined(e)?null:e[r[a+1].groupIDField],e=o.filterDatasource(a,e);s=s.concat(e)}(i);t.dataSource=s,t.dataBind()}},c.prototype.createInstance=function(e){e=this.parent.resourceBase.resourceCollection[e+1],e=this.element.querySelector(".e-"+e.field).ej2_instances[0];return e.clear(),e},c.prototype.onDropdownResourceChange=function(e){if(e.value&&!(this.parent.resourceCollection.length<=1)&&this.parent.activeViewOptions.group.byGroupID)for(var t,i,n=e.element.getAttribute("name")||this.getColumnName(e.element),r=this.parent.resourceBase.resourceCollection,a=0;a<r.length;a++)a<r.length-1&&r[parseInt(a.toString(),10)].field===n&&(t=this.createInstance(a),i=e.itemData[r[parseInt(a.toString(),10)].idField],t.dataSource=this.filterDatasource(a,i),t.dataBind(),i=0<t.dataSource.length?t.dataSource[0][r[a+1].idField]:null,t.value=r[a+1].allowMultiple?[i]:i,t.dataBind())},c.prototype.filterDatasource=function(e,t){var i=this.parent.resourceBase.resourceCollection[e+1];return i.dataSource.filter(function(e){return e[i.groupIDField]===t})},c.prototype.onTimezoneChange=function(e){var t;(e.element.getAttribute("name")||this.getColumnName(e.element))===this.parent.eventFields.startTimezone&&(e=this.getInstance(tr),(t=this.getInstance(ir)).value=e.value,t.dataBind())},c.prototype.renderCheckBox=function(e){var t=this.createDivElement(e+"-container"),i=this.getFieldName(e),n=this.createInputElement(e+" "+ho,i),e=(t.appendChild(n),new H.CheckBox({change:this.onChange.bind(this),cssClass:e+" "+this.parent.cssClass,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,label:this.getFieldLabel(e)}));return e.appendTo(n),n.setAttribute("name",i),"Repeat"===i&&(this.repeatStatus=e),t},c.prototype.renderTextBox=function(e){var t=this.createDivElement(e+"-container"),i=this.getFieldName(e),i=this.createInputElement(e+" "+ho,i,e===Jn?"textarea":"input");return t.appendChild(i),P.Input.createInput({element:i,floatLabelType:"Always",properties:{enableRtl:this.parent.enableRtl,placeholder:this.getFieldLabel(e)}}),t},c.prototype.getFieldName=function(e){var t="";switch(e){case Gn:t=this.fields.subject;break;case Xn:t=this.fields.location;break;case Kn:t=this.fields.startTime;break;case Zn:t=this.fields.endTime;break;case Jn:t=this.fields.description;break;case zn:t=this.fields.isAllDay;break;case tr:t=this.fields.startTimezone;break;case ir:t=this.fields.endTimezone;break;case Yn:t="Timezone";break;case _n:t="Repeat"}return t},c.prototype.getFieldLabel=function(e){var t="";switch(e){case Gn:t=this.parent.editorTitles.subject;break;case Xn:t=this.parent.editorTitles.location;break;case Jn:t=this.parent.editorTitles.description;break;case Kn:t=this.parent.editorTitles.startTime;break;case Zn:t=this.parent.editorTitles.endTime;break;case tr:t=this.parent.editorTitles.startTimezone;break;case ir:t=this.parent.editorTitles.endTimezone;break;case _n:t=this.parent.editorTitles.recurrenceRule;break;case zn:t=this.parent.editorTitles.isAllDay;break;case Yn:t=this.l10n.getConstant("timezone")}return t},c.prototype.onChange=function(e){var t;e.event&&e.event.target&&((t=B.closest(e.event.target,".e-all-day,.e-time-zone,.e-repeat")).classList.contains(zn)?this.onAllDayChange(e.checked):t.classList.contains(Yn)?this.timezoneChangeStyle(e.checked):t.classList.contains(_n)&&this.onRepeatChange(e.checked))},c.prototype.renderRepeatDialog=function(){var e=B.createElement("div");this.repeatDialogObject=new M.Dialog({header:this.l10n.getConstant("recurrence"),visible:!1,content:'<div class="e-rec-editor"></div>',closeOnEscape:!0,width:"90%",buttons:[{click:this.repeatSaveDialog.bind(this),buttonModel:{content:this.l10n.getConstant("save"),cssClass:"e-save",isPrimary:!0}},{click:this.repeatCancelDialog.bind(this),buttonModel:{cssClass:"e-cancel",content:this.l10n.getConstant("cancel")}}],target:this.element,animationSettings:{effect:"Zoom"},enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,isModal:!0,cssClass:"e-recurrence-dialog",open:this.repeatOpenDialog.bind(this)}),this.element.appendChild(e),this.repeatDialogObject.appendTo(e),this.createRecurrenceEditor(this.repeatDialogObject.element.querySelector(".e-rec-editor"))},c.prototype.loadRecurrenceEditor=function(){this.repeatDialogObject.show(),this.recurrenceEditor&&this.repeatRule&&this.recurrenceEditor.setRecurrenceRule(this.repeatRule)},c.prototype.onRepeatChange=function(e){e?(this.repeatDialogObject||this.renderRepeatDialog(),this.recurrenceEditor.setProperties({startDate:this.repeatStartDate,selectedType:0}),this.loadRecurrenceEditor()):(this.repeatDialogObject&&this.repeatDialogObject.hide(),this.repeatRule="",this.recurrenceEditor&&(this.recurrenceEditor.setRecurrenceRule(this.repeatRule),this.updateRepeatLabel(this.repeatRule)),e=this.element.querySelector("."+uo),B.addClass([e],go))},c.prototype.repeatSaveDialog=function(){this.repeatRule=this.recurrenceEditor.getRecurrenceRule();var e=this.element.querySelector("."+uo);this.recurrenceEditor.getRecurrenceRule()?B.removeClass([e],go):(B.addClass([e],go),this.repeatStatus.setProperties({checked:!1})),this.updateRepeatLabel(this.repeatRule),this.closeRepeatDialog()},c.prototype.closeRepeatDialog=function(){this.repeatDialogObject.hide()},c.prototype.repeatCancelDialog=function(){this.closeRepeatDialog(),this.recurrenceEditor&&this.recurrenceEditor.setRecurrenceRule(this.repeatTempRule),this.repeatTempRule||this.repeatStatus.setProperties({checked:!1})},c.prototype.repeatOpenDialog=function(){this.repeatTempRule=this.recurrenceEditor.getRecurrenceRule()},c.prototype.onCellDetailsUpdate=function(e,t){var i;this.parent.eventSettings.allowAdding&&(this.parent.isAdaptive&&t&&!this.repeatDialogObject&&this.renderRepeatDialog(),this.element.querySelector("."+Wn).removeAttribute("data-id"),B.isNullOrUndefined(this.parent.editorHeaderTemplate)&&(this.element.querySelector("."+sr).innerHTML=this.l10n.getConstant("newEvent")),e.Timezone=!1,this.repeatStartDate=e[this.fields.startTime],this.repeatRule="",B.isNullOrUndefined(this.parent.eventSettings.fields.subject.default)||(e[this.fields.subject]=this.parent.eventSettings.fields.subject.default),B.isNullOrUndefined(this.parent.eventSettings.fields.location.default)||(e[this.fields.location]=this.parent.eventSettings.fields.location.default),B.isNullOrUndefined(this.parent.eventSettings.fields.description.default)||(e[this.fields.description]=this.parent.eventSettings.fields.description.default),this.showDetails(e),e[this.fields.recurrenceRule]&&this.recurrenceEditor&&(this.recurrenceEditor.setRecurrenceRule(e[this.fields.recurrenceRule],e[this.fields.startTime]),this.repeatRule=e[this.fields.recurrenceRule]),(i=this.element.querySelector("."+Dn))&&B.addClass([i],d),this.recurrenceEditor&&(this.recurrenceEditor.setProperties({startDate:e[this.fields.startTime],selectedType:B.isNullOrUndefined(t)?B.isNullOrUndefined(e[this.fields.recurrenceRule])?0:this.recurrenceEditor.selectedType:t}),this.repeatRule=this.recurrenceEditor.value),this.parent.isAdaptive&&B.isNullOrUndefined(this.parent.editorTemplate)?(i=this.element.querySelector("."+uo),e[this.fields.recurrenceRule]||t?(B.removeClass([i],go),this.repeatStatus.setProperties({checked:!0})):(B.addClass([i],go),this.repeatStatus.setProperties({checked:!1})),this.updateRepeatLabel(this.repeatRule)):(e=this.element.querySelector("."+ar),this.disableButton(e,!1)),this.dialogObject.show())},c.prototype.convertToEventData=function(e,t){e&&(e.subject&&(t[this.fields.subject]=e.subject),t[this.fields.startTime]=e.startTime,t[this.fields.endTime]=e.endTime,t[this.fields.isAllDay]=e.isAllDay,e.RecurrenceRule&&(t[this.fields.recurrenceRule]=e.RecurrenceRule),0<this.parent.resourceCollection.length||0<this.parent.activeViewOptions.group.resources.length)&&this.parent.resourceBase.setResourceValues(t)},c.prototype.applyFormValidation=function(){var e,t,i,n=this.element.querySelector("."+Wn);n&&(t={},i=(e=function(e){return e&&0<Object.keys(e).length?e:void 0})(this.parent.eventSettings.fields.subject.validation),B.isNullOrUndefined(i)||(t[this.parent.eventSettings.fields.subject.name]=i),i=e(this.parent.eventSettings.fields.location.validation),B.isNullOrUndefined(i)||(t[this.parent.eventSettings.fields.location.name]=i),i=e(this.parent.eventSettings.fields.startTime.validation),B.isNullOrUndefined(i)||(t[this.parent.eventSettings.fields.startTime.name]=i),i=e(this.parent.eventSettings.fields.endTime.validation),B.isNullOrUndefined(i)||(t[this.parent.eventSettings.fields.endTime.name]=i),i=e(this.parent.eventSettings.fields.description.validation),B.isNullOrUndefined(i)||(t[this.parent.eventSettings.fields.description.name]=i),this.fieldValidator&&(this.fieldValidator.destroy(),this.fieldValidator=null),this.fieldValidator=new ns,this.fieldValidator.renderFormValidator(n,t,this.element,this.parent.locale))},c.prototype.showDetails=function(e){this.eventData=e;for(var t=B.extend({},e,null,!0),e=this.getFormElements(Bn),i=(this.cellClickAction&&(!this.cellClickAction||B.isNullOrUndefined(this.parent.editorTemplate))||0!==t[this.fields.endTime].getHours()||0!==t[this.fields.endTime].getMinutes()||this.trimAllDay(t),Object.keys(t)),n=0,r=e;n<r.length;n++){var a=r[n],s=a.name||this.getColumnName(a);B.isNullOrUndefined(s)||""===s||(-1!==i.indexOf(s)?this.setValueToElement(a,t[""+s]):this.setDefaultValueToElement(a))}B.isNullOrUndefined(this.parent.editorTemplate)&&(this.onAllDayChange(t[this.fields.isAllDay]),e=this.getInstance(Yn+"."+ho),B.isNullOrUndefined(t[this.fields.startTimezone])&&B.isNullOrUndefined(t[this.fields.endTimezone])||(e.checked=!0,e.dataBind()),this.timezoneChangeStyle(e.checked),delete t.Timezone)},c.prototype.getColumnName=function(e){var t,i,n=e.getAttribute("data-name")||"";return n=""===n&&(i=!1,t="",e.classList.contains("e-dropdownlist")?(t="e-ddl",i=!0):e.classList.contains("e-multiselect")?(t="e-multiselect",i=!0):e.classList.contains("e-datetimepicker")?t="e-datetimepicker":e.classList.contains("e-datepicker")?t="e-datepicker":e.classList.contains("e-checkbox")?t="e-checkbox":e.classList.contains("e-numerictextbox")&&(t="e-numerictextbox"),i=B.closest(e,i?"."+t+":not(.e-control)":"."+t)||e.querySelector("."+t))&&(e=i.querySelector("[name]"))?e.name:n},c.prototype.onAllDayChange=function(e){var t,i=this.getInstance(Kn),n=this.getInstance(Zn),r=this.element.querySelector(".e-time-zone-container");e?(t=B.isNullOrUndefined(this.parent.dateFormat)?this.getFormat("dateFormats"):this.parent.dateFormat,B.addClass(this.element.querySelectorAll(".e-time-icon"),or),B.addClass([r],d),this.element.querySelector("."+er)&&B.removeClass([this.element.querySelector("."+er)],bt)):(t=B.isNullOrUndefined(this.parent.dateFormat)?this.getFormat("dateFormats")+" "+this.parent.activeViewOptions.timeFormat:this.parent.dateFormat+" "+this.parent.activeViewOptions.timeFormat,B.removeClass(this.element.querySelectorAll(".e-time-icon"),or),B.removeClass([r],d),this.element.querySelector(".e-checkbox-wrapper .e-time-zone").checked&&B.addClass([this.element.querySelector("."+er)],bt)),i.format=n.format=t,this.cellClickAction&&this.updateDateTime(e,i,n),i.dataBind(),n.dataBind(),B.isNullOrUndefined(this.recurrenceEditor)||this.recurrenceEditor.updateRuleUntilDate(i.value)},c.prototype.updateDateTime=function(e,t,i){var n,r;B.isNullOrUndefined(this.eventWindowTime.startTime)&&B.isNullOrUndefined(this.eventWindowTime.endTime)||(e?(r=z(new Date(this.eventWindowTime.startTime.getTime())),n=this.parent.activeCellsData.isAllDay?(e=Y(new Date(this.eventWindowTime.endTime.getTime()),-1).getTime(),+this.eventWindowTime.startTime>e?this.eventWindowTime.endTime:new Date(e)):z(new Date(this.eventWindowTime.endTime.getTime()))):(e=this.parent.activeCellsData.startTime,(r=new Date(this.eventWindowTime.startTime.getTime())).setHours(e.getHours(),e.getMinutes(),e.getSeconds()),this.parent.activeCellsData.isAllDay?(e=this.parent.getStartEndTime(this.parent.workHours.start),r.setHours(e.getHours(),e.getMinutes(),e.getSeconds()),(n=new Date(r.getTime())).setMilliseconds(je*this.getSlotDuration())):(n=new Date(r.getTime())).setMilliseconds(this.parent.activeCellsData.endTime.getTime()-this.parent.activeCellsData.startTime.getTime())),this.eventWindowTime={startTime:new Date(r.getTime()),endTime:new Date(n.getTime())},t.value=r,i.value=n,t.dataBind(),i.dataBind())},c.prototype.getFormat=function(e){e=B.isNullOrUndefined(this.parent.locale)||"en"===this.parent.locale||"en-US"===this.parent.locale?B.getValue(e+".short",B.getDefaultDateObject(this.parent.getCalendarMode())):B.getValue("main."+this.parent.locale+".dates.calendars."+this.parent.getCalendarMode()+"."+e+".short",B.cldrData);return e},c.prototype.onEventDetailsUpdate=function(e){var t,i;this.parent.eventSettings.allowEditing&&(!this.parent.isAdaptive&&B.isNullOrUndefined(this.parent.editorFooterTemplate)&&B.removeClass([this.element.querySelector("."+Dn)],d),B.isNullOrUndefined(this.parent.editorHeaderTemplate)&&(this.element.querySelector("."+sr).innerHTML=this.l10n.getConstant("editEvent")),this.element.querySelector("."+Wn).setAttribute("data-id",e[this.fields.id].toString()),B.isNullOrUndefined(this.parent.editorTemplate)&&(e=B.extend({},e,null,!0),t=this.getInstance(Yn+"."+ho),i=void 0,e[this.fields.startTimezone]||e[this.fields.endTimezone]?(i=!0,this.parent.eventBase.timezoneConvert(e)):i=!1,e.Timezone=i,t.checked=i,t.dataBind()),this.showDetails(e),e[this.fields.recurrenceRule]&&this.recurrenceEditor?this.recurrenceEditor.setRecurrenceRule(e[this.fields.recurrenceRule],e[this.fields.startTime]):!this.parent.isAdaptive&&this.recurrenceEditor&&(this.recurrenceEditor.setProperties({startDate:e[this.fields.startTime]}),this.recurrenceEditor.setRecurrenceRule("")),this.repeatStartDate=e[this.fields.startTime],this.repeatRule="",e[this.fields.recurrenceRule]&&(this.recurrenceEditor&&this.recurrenceEditor.setRecurrenceRule(e[this.fields.recurrenceRule],e[this.fields.startTime]),this.repeatRule=e[this.fields.recurrenceRule]),this.parent.isAdaptive&&B.isNullOrUndefined(this.parent.editorTemplate)&&(i=this.element.querySelector("."+uo),e[this.fields.recurrenceRule]?(B.removeClass([i],go),this.repeatStatus.setProperties({checked:!0})):(B.addClass([i],go),this.repeatStatus.setProperties({checked:!1})),this.updateRepeatLabel(this.repeatRule)),t=this.parent.readonly||e[this.fields.isReadonly],this.parent.isAdaptive?(i=this.element.querySelector("."+nr))&&(t?B.addClass([i],Ir):B.removeClass([i],Ir)):(e=this.element.querySelector("."+ar),i=this.element.querySelector("."+Dn),this.disableButton(e,t),this.disableButton(i,t)),this.dialogObject.show())},c.prototype.disableButton=function(e,t){e&&(e.ej2_instances[0].disabled=t)},c.prototype.renderRecurrenceEditor=function(){return new co({calendarMode:this.parent.calendarMode,cssClass:this.parent.cssClass,dateFormat:this.parent.dateFormat,enableRtl:this.parent.enableRtl,firstDayOfWeek:this.parent.activeViewOptions.firstDayOfWeek,locale:this.parent.locale})},c.prototype.updateMinMaxDateToEditor=function(){var e=this.element.querySelector(".e-start"),t=this.element.querySelector(".e-end");e&&t&&(e=e.ej2_instances[0],t=t.ej2_instances[0],e.min=this.parent.minDate,e.max=new Date(new Date(+this.parent.maxDate).setHours(23,59,59)),t.min=this.parent.minDate,t.max=new Date(new Date(+this.parent.maxDate).setHours(23,59,59)),e.dataBind(),t.dataBind()),this.recurrenceEditor&&(e=this.recurrenceEditor.element.querySelector(".e-until-date"))&&((t=e.ej2_instances[0]).min=this.parent.minDate,t.max=this.parent.maxDate,t.dataBind())},c.prototype.updateRepeatLabel=function(e){this.parent.isAdaptive&&!this.repeatDialogObject&&this.renderRepeatDialog();e=e?this.l10n.getConstant("repeats")+" "+this.recurrenceEditor.getRuleSummary(e):this.l10n.getConstant("repeat");this.repeatStatus.setProperties({label:e})},c.prototype.dialogClose=function(e){this.isEnterKey?this.isEnterKey=!1:(this.dialogEvent=e,this.isCrudAction=!1,this.parent.activeEventData={event:void 0,element:void 0},this.parent.currentAction=null,this.dialogObject.hide())},c.prototype.resetForm=function(){this.fieldValidator.destroyToolTip(),this.resetFormFields(),this.parent.isAdaptive||!this.recurrenceEditor||this.recurrenceEditor.isDestroyed||this.recurrenceEditor.resetFields()},c.prototype.timezoneChangeStyle=function(e){var t,i,n=this.element.querySelector("."+er),r=this.parent.tzModule.getLocalTimezoneName();e?(B.addClass([n],bt),e=this.getInstance(tr),t=this.getInstance(ir),i=e.dataSource,e.value&&this.parent.timezone||i.some(function(e){return e.Value===r})||(i.push({Value:r,Text:r}),e.dataSource=i,t.dataSource=i,e.dataBind(),t.dataBind()),e.value=e.value||this.parent.timezone||r,t.value=t.value||this.parent.timezone||r,e.dataBind(),t.dataBind()):B.removeClass([n],bt)},c.prototype.resetFormFields=function(){for(var e=0,t=this.getFormElements(Bn);e<t.length;e++){var i=t[e],n=i.name||this.getColumnName(i);B.isNullOrUndefined(n)||""===n||this.setDefaultValueToElement(i)}},c.prototype.eventSave=function(e,t){var i;this.isEnterKey?this.isEnterKey=!1:(i=this.element.querySelector("."+Wn))&&i.classList.contains("e-formvalidator")&&!i.ej2_instances[0].validate()||(i=this.getEventDataFromEditor(),this.processEventValidation(i.tempData,t))||(this.eventCrudData=i.eventData,this.dialogEvent=e,this.isCrudAction=!0,this.dialogObject.hide())},c.prototype.getEventDataFromEditor=function(){var e=B.extend({},this.getObjectFromFormData(Bn)),t=(e.Timezone||(e[this.fields.startTimezone]=null,e[this.fields.endTimezone]=null),delete e.Timezone,delete e.Repeat,this.setDefaultValueToObject(e),e[this.fields.recurrenceRule]=this.recurrenceEditor?this.recurrenceEditor.getRecurrenceRule()||null:void 0,B.extend({},e,null,!0));return e[this.fields.isAllDay]&&(e[this.fields.startTime]=B.isNullOrUndefined(e[this.fields.startTime])?null:z(new Date(e[this.fields.startTime].getTime())),e[this.fields.endTime]=B.isNullOrUndefined(e[this.fields.endTime])?null:Y(z(new Date(e[this.fields.endTime].getTime())),1)),{eventData:e,tempData:t}},c.prototype.processEventValidation=function(e,t){var i;if(B.isNullOrUndefined(this.parent.editorTemplate)){if(!e[this.fields.startTime]||!e[this.fields.endTime])return this.parent.quickPopup.openValidationError("invalidDateError"),!0;if(e[this.fields.startTime]>e[this.fields.endTime])return this.parent.quickPopup.openValidationError("startEndError"),!0}if(this.recurrenceEditor&&this.recurrenceEditor.value&&""!==this.recurrenceEditor.value){var n=!0;if("seriesChangeAlert"===(i="EditOccurrence"!==this.parent.currentAction?this.recurrenceValidation(e[this.fields.startTime],e[this.fields.endTime],t):i)&&this.parent.uiStateValues.isIgnoreOccurrence&&(n=!1),!B.isNullOrUndefined(i)&&n&&(!this.parent.enableRecurrenceValidation&&"wrongPattern"===i||this.parent.enableRecurrenceValidation))return this.parent.quickPopup.openRecurrenceValidationAlert(i),!0}return!1},c.prototype.processCrudActions=function(e){var t=this,i=(this.parent.uiStateValues.isBlock=!1,this.getResourceData(e)),i=(0<this.parent.activeViewOptions.group.resources.length||0<this.parent.resourceCollection.length)&&!this.parent.activeViewOptions.group.allowGroupEdit&&!B.isNullOrUndefined(i),n=this.getEventIdFromForm();if(B.isNullOrUndefined(n)){if(this.parent.currentAction="Add",this.parent.eventBase.checkOverlap(e))return!0;i?this.resourceSaveEvent(e,this.parent.currentAction):(e[this.fields.id]=this.parent.eventBase.getEventMaxID(),this.parent.addEvent(e))}else{var r="string"===this.parent.eventBase.getEventIDType()?n:parseInt(n,10),n=this.parent.eventsData.filter(function(e){return e[t.fields.id]===r})[0];if(B.isNullOrUndefined(n)&&(n=this.parent.blockData.filter(function(e){return e[t.fields.id]===r})[0]),(e=B.extend({},n,e))[this.fields.isReadonly])return!1;if(this.parent.eventBase.checkOverlap(e))return!0;var a=void 0;if(!B.isNullOrUndefined(n[this.fields.recurrenceRule])){if(a=this.parent.currentAction,e.Guid=this.parent.activeEventData.event.Guid,"EditOccurrence"===this.parent.currentAction&&(e[this.fields.recurrenceID]?(r=e[this.fields.recurrenceID],a=null):(e[this.fields.id]=this.parent.eventBase.getEventMaxID(),e.Guid=this.parent.activeEventData.event.Guid),this.parent.enableRecurrenceValidation)&&this.editOccurrenceValidation(r,e))return!0;"EditSeries"===this.parent.currentAction||e[this.fields.id]!==n[this.fields.id]?e[this.fields.recurrenceID]=n[this.fields.id]:"EditFollowingEvents"===this.parent.currentAction&&(e[this.fields.id]=this.parent.eventBase.getEventMaxID(),e[this.fields.followingID]=n[this.fields.id])}i?this.resourceSaveEvent(e,"Save",a):this.parent.saveEvent(e,a)}return this.parent.uiStateValues.isBlock},c.prototype.getResourceData=function(e){var t=null;return t=!B.isNullOrUndefined(this.parent.resourceBase)&&!B.isNullOrUndefined(this.parent.resourceBase.resourceCollection)&&0<this.parent.resourceBase.resourceCollection.length?e[this.parent.resourceBase.resourceCollection.slice(-1)[0].field]:t},c.prototype.getObjectFromFormData=function(e){for(var t={},i=0,n=this.getFormElements(e);i<n.length;i++){var r=n[i],a=r.name||this.getColumnName(r);B.isNullOrUndefined(a)||""===a||(t[""+a]=this.getValueFromElement(r))}return t},c.prototype.setDefaultValueToObject=function(e){B.isNullOrUndefined(e[this.fields.subject])||(e[this.fields.subject]=e[this.fields.subject]||this.parent.eventSettings.fields.subject.default||this.l10n.getConstant("addTitle")),B.isNullOrUndefined(e[this.fields.location])||(e[this.fields.location]=e[this.fields.location]||this.parent.eventSettings.fields.location.default),B.isNullOrUndefined(e[this.fields.description])||(e[this.fields.description]=e[this.fields.description]||this.parent.eventSettings.fields.description.default)},c.prototype.recurrenceValidation=function(e,t,i){var n,r=this.recurrenceEditor,a=this.getInstance("e-repeat-interval.e-numerictextbox").value;if(i!==this.l10n.getConstant("ok")){var s,o,i=this.parent.activeEventData.event,l=[];if("EditSeries"!==this.parent.currentAction&&"EditFollowingEvents"!==this.parent.currentAction||B.isNullOrUndefined(i)||(s=i[this.parent.eventFields.startTime],l=0<(o=this.parent.eventBase.getSeriesEvents(this.eventData,s)).length?this.parent.eventBase.getEditedOccurrences(o,s):(o=this.parent.eventBase.getEventById(i[this.parent.eventFields.id]),this.parent.eventBase.getEditedOccurrences([o],s)),"EditSeries"!==this.parent.currentAction)||B.isNullOrUndefined(this.eventData[this.parent.eventFields.recurrenceException])||l.push(this.eventData),0<l.length&&(n="seriesChangeAlert"),"until"===this.getInstance("e-end-on-left .e-ddl .e-dropdownlist").value&&this.getInstance("e-end-on-date .e-datepicker").value<e&&(n="wrongPattern"),B.isNullOrUndefined(n)){r.value.split(";")[1].split("=")[1].split(",");var p={SU:0,MO:1,TU:2,WE:3,TH:4,FR:5,SA:6},c=[],h=[];switch(r.value.split(";")[0].split("=")[1]){case"DAILY":(t.getTime()-e.getTime())/36e5>24*a&&(n="createError");break;case"WEEKLY":for(var d=r.value.split(";")[1].split("=")[1].split(","),u=0;u<d.length*(a+1);u++)c[parseInt(u.toString(),10)]=d.length>u?p[d[parseInt(u.toString(),10)]]:c[u-d.length]+7*a;for(var g=c.sort(function(e,t){return e-t}),u=1;u<g.length;u++)h.push(g[parseInt(u.toString(),10)]-g[u-1]);((t.getTime()-e.getTime())/36e5>=24*Math.min.apply(Math,h)||B.isNullOrUndefined(a))&&(n="createError");break;case"MONTHLY":t.getTime()>=new Date(+e).setMonth(e.getMonth()+a)&&(n="createError");break;case"YEARLY":t.getTime()>=new Date(+e).setFullYear(e.getFullYear()+a)&&(n="createError")}}}else t.getTime()>=new Date(+e).setMonth(e.getMonth()+a)&&(n="createError"),B.isNullOrUndefined(n)&&this.parent.quickPopup.quickDialog.hide();return n=B.isNullOrUndefined(a)?"createError":n},c.prototype.getRecurrenceIndex=function(e,t){for(var i,n=0;n<e.length;n++)if(t[this.fields.startTime].valueOf()===e[parseInt(n.toString(),10)][this.fields.startTime].valueOf()){i=n;break}return i},c.prototype.trimAllDay=function(e){var t;e[this.fields.isAllDay]&&(t=Y(new Date(+e[this.fields.endTime]),-1).getTime(),e[this.fields.endTime]=+e[this.fields.startTime]>t?e[this.fields.endTime]:new Date(t))},c.prototype.editOccurrenceValidation=function(t,e,i){var n=this,r=(void 0===i&&(i=this.eventData),this.parent.getOccurrencesByID(t));this.parent.eventsData.filter(function(e){return e[n.fields.recurrenceID]===t}).map(function(e){return r.push(B.extend({},e))}),e=B.extend({},e),this.trimAllDay(e);for(var a=0,s=r;a<s.length;a++){var o=s[a];this.trimAllDay(o)}this.parent.eventBase.sortByTime(r);i=this.getRecurrenceIndex(r,i);if(!B.isNullOrUndefined(i)){var l,p,c=new Date(+e[this.fields.startTime]),e=new Date(+e[this.fields.endTime]),h=(i!==r.length-1&&(l=new Date(+r[i+1][this.fields.startTime]),p=new Date(+r[i+1][this.fields.endTime])),new Date(+r[r.length-1][this.fields.endTime]));if(0===i){if(!B.isNullOrUndefined(r[i+1])){if(!(l.getTime()>=e.getTime())&&z(h).getTime()>=z(c).getTime()||z(h).getTime()<z(c).getTime())return this.parent.quickPopup.openRecurrenceValidationAlert("occurrenceAlert"),!0;if(!(z(c).getTime()<z(l).getTime()))return this.parent.quickPopup.openRecurrenceValidationAlert("sameDayAlert"),!0}}else{var d=new Date(+r[i-1][this.fields.startTime]),u=new Date(+r[i-1][this.fields.endTime]);if(i===r.length-1){if(z(new Date(+r[r.length-1-i][this.fields.startTime])).getTime()>z(c).getTime())return this.parent.quickPopup.openRecurrenceValidationAlert("occurrenceAlert"),!0;if(!(u.getTime()<=c.getTime()&&z(c).getTime()>z(d).getTime()))return this.parent.quickPopup.openRecurrenceValidationAlert("sameDayAlert"),!0}else{if(!(z(d).getTime()<z(c).getTime()||z(new Date(+r[0][this.fields.startTime])).getTime()>z(c).getTime())||!(z(l).getTime()>z(c).getTime()||h.getTime()<c.getTime()))return this.parent.quickPopup.openRecurrenceValidationAlert("sameDayAlert"),!0;if(!(u.getTime()<=c.getTime()&&l.getTime()>=e.getTime())||z(p).getTime()<z(c).getTime()||z(d).getTime()>z(e).getTime()||!(z(c).getTime()<z(l).getTime()))return this.parent.quickPopup.openRecurrenceValidationAlert("occurrenceAlert"),!0}}}return!1},c.prototype.resourceSaveEvent=function(g,m,v){for(var f=this,y=this.parent.resourceBase.resourceCollection.slice(-1)[0],T=((T=g[y.field])instanceof Array?T:[T]).reverse(),w=this.parent.resourceBase.lastResourceLevel,D=[],e=function(i){function e(){if("Save"===m&&i===T.length-1)if(0<r.length){r[0][f.fields.id]=g[f.fields.id];for(var e=1;e<r.length;e++)r[parseInt(e.toString(),10)][f.fields.id]=f.parent.eventBase.getEventMaxID(i),D.push(r[parseInt(e.toString(),10)]),f.parent.saveEvent(r[0],v)}else n[f.fields.id]=g[f.fields.id],f.parent.saveEvent(n,v);else if(0<r.length)for(var t=0;t<r.length;t++)r[parseInt(t.toString(),10)][f.fields.id]=f.parent.eventBase.getEventMaxID(t),D.push(r[parseInt(t.toString(),10)]);else n[f.fields.id]=f.parent.eventBase.getEventMaxID(i),D.push(n)}var n=B.extend({},g,null,!0),r=(n[b.fields.id]=b.parent.eventBase.getEventMaxID(),[]);if(b.parent.activeViewOptions.group.byGroupID&&!B.isNullOrUndefined(w)){var t=y.dataSource,a=b.parent.resourceCollection,s=void 0;if((s=1<a.length?st(t,y.idField,T[parseInt(i.toString(),10)],n,a):st(t,y.idField,T[parseInt(i.toString(),10)]))<0)return{value:void 0};for(var o=t[parseInt(s.toString(),10)][y.groupIDField],l=w.filter(function(e){return e.resourceData[y.idField]===T[parseInt(i.toString(),10)]}).filter(function(e){return e.resourceData[y.groupIDField]===o})[0].groupOrder,p=0;p<b.parent.resourceBase.resourceCollection.length;p++){var c=b.parent.resourceBase.resourceCollection[parseInt(p.toString(),10)].field;n[""+c]=l[parseInt(p.toString(),10)]instanceof Array?l[parseInt(p.toString(),10)][0]:l[parseInt(p.toString(),10)]}}else{for(s=0;s<b.parent.resourceBase.resourceCollection.length-1;s++){c=b.parent.resourceBase.resourceCollection[parseInt(s.toString(),10)].field;if(n[""+c]instanceof Array&&1<n[""+c].length)for(var h=0;h<n[""+c].length;h++){var d=B.extend({},n,null,!0);d[""+c]=g[""+c][parseInt(h.toString(),10)],d[y.field]=T[parseInt(i.toString(),10)],r.push(d)}else if(0===r.length)n[""+c]=g[""+c]instanceof Array?g[""+c][0]:g[""+c],n[y.field]=T[parseInt(i.toString(),10)];else for(var u=0;u<r.length;u++)r[parseInt(u.toString(),10)][""+c]=g[""+c]instanceof Array?g[""+c][0]:g[""+c]}n[y.field]=T[parseInt(i.toString(),10)]}e()},b=this,t=0;t<T.length;t++){var i=e(t);if("object"==typeof i)return i.value}if(0<D.length){for(var n=0,r=D;n<r.length;n++){var a=r[n];a[this.fields.recurrenceException]=null,a[this.fields.recurrenceID]=null}this.parent.addEvent(D)}},c.prototype.getEventIdFromForm=function(){return this.element.querySelector("."+Wn).getAttribute("data-id")},c.prototype.getFormElements=function(e){return e===Bn?[].slice.call(this.element.querySelectorAll("."+ho)):[].slice.call(this.parent.element.querySelectorAll("."+e+" ."+ho))},c.prototype.getValueFromElement=function(e){e=e.classList.contains("e-datepicker")||e.classList.contains("e-datetimepicker")||e.classList.contains("e-dropdownlist")||e.classList.contains("e-multiselect")?e.ej2_instances[0].value:e.classList.contains("e-checkbox")?e.ej2_instances[0].checked:e.classList.contains("e-numerictextbox")?e.ej2_instances[0].value:"checkbox"===e.type?e.checked:this.parent.enableHtmlSanitizer?B.SanitizeHtmlHelper.sanitize(e.value):e.value;return e},c.prototype.setValueToElement=function(e,t){var i;e.classList.contains("e-datepicker")?((i=e.ej2_instances[0]).value=t,i.dataBind()):e.classList.contains("e-datetimepicker")?((i=e.ej2_instances[0]).element.classList.contains(Kn)?this.eventWindowTime.startTime=new Date(""+t):this.eventWindowTime.endTime=new Date(""+t),i.value=t,i.dataBind()):e.classList.contains("e-dropdownlist")?((i=e.ej2_instances[0]).value=t,i.dataBind()):e.classList.contains("e-multiselect")?((i=e.ej2_instances[0]).value=[],i.value=t instanceof Array?t:[t],i.dataBind()):e.classList.contains("e-checkbox")?((i=e.ej2_instances[0]).checked=t,i.dataBind()):e.classList.contains("e-numerictextbox")?((i=e.ej2_instances[0]).value=t,i.dataBind()):"checkbox"!==e.type?e.value=t||"":e.checked=t},c.prototype.setDefaultValueToElement=function(e){var t,i;e.classList.contains("e-datepicker")?((i=e.ej2_instances[0]).value=this.parent.getCurrentTime(),i.dataBind()):e.classList.contains("e-datetimepicker")?(i=e.ej2_instances[0],t=this.parent.getCurrentTime(),this.eventWindowTime={startTime:t,endTime:t},i.value=t,i.dataBind()):e.classList.contains("e-dropdownlist")?((i=e.ej2_instances[0]).value=null,i.dataBind()):e.classList.contains("e-multiselect")?((i=e.ej2_instances[0]).value=[],i.dataBind()):e.classList.contains("e-checkbox")?((i=e.ej2_instances[0]).checked=!1,i.dataBind()):e.classList.contains("e-numerictextbox")?((i=e.ej2_instances[0]).value=null,i.dataBind()):"checkbox"===e.type?e.checked=!1:e.value=""},c.prototype.getInstance=function(e){e=this.element.querySelector("."+e);return e?e.ej2_instances[0]:null},c.prototype.eventDelete=function(e){if(this.isEnterKey)this.isEnterKey=!1;else{switch(this.parent.currentAction){case"EditOccurrence":B.isNullOrUndefined(this.parent.activeEventData.event[this.parent.eventFields.recurrenceRule])?this.parent.currentAction="Delete":this.parent.currentAction="DeleteOccurrence";break;case"EditSeries":this.parent.currentAction="DeleteSeries";break;case"Save":this.parent.currentAction="Delete";break;case"EditFollowingEvents":B.isNullOrUndefined(this.parent.activeEventData.event[this.parent.eventFields.recurrenceRule])||(this.parent.currentAction="DeleteFollowingEvents")}this.dialogEvent=e,this.isCrudAction=!1,this.dialogObject.hide(),this.parent.quickPopup.openDeleteAlert()}},c.prototype.getRecurrenceEditorInstance=function(){return this.parent.isAdaptive&&!this.repeatDialogObject&&this.renderRepeatDialog(),this.recurrenceEditor},c.prototype.destroyComponents=function(){for(var e=0,t=this.getFormElements(Bn);e<t.length;e++){var i=t[e],n=void 0;(n=i.classList.contains("e-datetimepicker")||i.classList.contains("e-datepicker")||i.classList.contains("e-checkbox")||i.classList.contains("e-dropdownlist")||i.classList.contains("e-multiselect")||i.classList.contains("e-numerictextbox")?i.ej2_instances:n)&&n[0]&&n[0].destroy()}this.buttonObj&&this.buttonObj.destroy()},c.prototype.detachComponents=function(){for(var e=0,t=this.getFormElements(Bn);e<t.length;e++){var i=t[e];B.detach(i)}},c.prototype.destroy=function(e){var t;this.parent&&!this.parent.isDestroyed&&this.parent.resetTemplates(["editorTemplate","editorHeaderTemplate","editorFooterTemplate"]),this.destroyComponents(),this.recurrenceEditor&&(this.recurrenceEditor.destroy(),B.detach(this.recurrenceEditor.element),this.recurrenceEditor=null),this.fieldValidator&&(this.fieldValidator.destroy(),this.fieldValidator=null),this.repeatDialogObject&&(this.repeatDialogObject.destroy(),this.repeatDialogObject=null),this.detachComponents(),this.dialogObject&&(this.dialogObject.element&&(lt(t=this.dialogObject.element.querySelector("form")),B.detach(t),B.EventHandler.remove(this.dialogObject.element,"keydown",this.preventEventSave)),this.dialogObject.destroy(),this.dialogObject=null),this.element&&(B.remove(this.element),this.element=null),e||(this.l10n=null,this.parent=null,this.fields=null,this.buttonObj=null,this.repeatStatus=null,this.eventWindowTime=null,this.dialogEvent=null)},c);function c(e){this.parent=e,this.l10n=this.parent.localeObj,this.fields=this.parent.eventFields,this.eventWindowTime={startTime:new Date,endTime:new Date},this.renderEventWindow()}h.prototype.addEventListener=function(){!this.parent||this.parent&&this.parent.isDestroyed||this.parent.on(Ie,this.virtualScrolling,this)},h.prototype.removeEventListener=function(){!this.parent||this.parent&&this.parent.isDestroyed||this.parent.off(Ie,this.virtualScrolling)},h.prototype.getRenderedCount=function(){this.setItemSize();var e=this.isHorizontalScroll?this.parent.element.clientWidth:this.parent.element.clientHeight;return this.renderedLength=Math.ceil(e/this.itemSize)+this.bufferCount,this.renderedLength},h.prototype.renderVirtualTrack=function(e){var t,i=B.createElement("div",{className:xi});this.isHorizontalScroll?(t=this.parent.activeView.colLevels[this.parent.activeView.colLevels.length-1].length,i.style.width=t*this.itemSize+"px"):i.style.height=this.parent.resourceBase.expandedResources.length*this.itemSize+"px",e.appendChild(i)},h.prototype.updateVirtualScrollHeight=function(){var e=this.parent.element.querySelector("."+xi),t=this.parent.resourceBase.expandedResources[this.parent.resourceBase.expandedResources.length-1].groupIndex;this.parent.resourceBase.renderedResources[this.parent.resourceBase.renderedResources.length-1].groupIndex!==t?(t=this.parent.element.querySelector("."+C),this.renderedLength=t.querySelector("tbody").children.length,e.style.height=t.offsetHeight+(this.parent.resourceBase.expandedResources.length-this.renderedLength)*t.offsetHeight/this.renderedLength+"px",(t=this.parent.element.querySelector("."+A)).scrollHeight-t.scrollTop<t.offsetHeight*this.bufferCount&&(e.style.height=parseInt(e.style.height,10)+t.offsetHeight*this.bufferCount+"px")):e.style.height="",this.averageRowHeight=e.offsetHeight/this.parent.resourceBase.expandedResources.length},h.prototype.updateVirtualTrackHeight=function(e){var t,i,n,r=this.parent.resourceBase.renderedResources.length;r!==this.getRenderedCount()?(e.style.height=this.parent.element.querySelector(".e-content-wrap").clientHeight+"px",i=this.parent.element.querySelector("."+Wt),n=this.parent.element.querySelector("."+A),t=this.parent.element.querySelector("."+Ft),this.translateY=0,this.setTranslate(i,n,t)):(i=this.parent.resourceBase.renderedResources[r-1].groupIndex,n=(n=r+(this.parent.resourceBase.expandedResources[this.parent.resourceBase.expandedResources.length-1].groupIndex-i))>this.parent.resourceBase.expandedResources.length?this.parent.resourceBase.expandedResources.length:n,e.style.height=n*this.itemSize+"px")},h.prototype.setItemSize=function(){this.isHorizontalScroll?this.itemSize=Le(this.parent.activeView.element,O,this.parent.uiStateValues.isTransformed)||this.itemSize:this.itemSize=this.parent.getElementHeightFromClass(this.parent.activeView.element,O)||this.itemSize},h.prototype.refreshLayout=function(){var e,t,i,n=this.parent.uiStateValues.scheduleHeight,r=(this.parent.uiStateValues.scheduleHeight=this.parent.element.offsetHeight,this.renderedLength);this.parent.uiStateValues.scheduleHeight!==n&&(r<this.getRenderedCount()&&(this.isRemoteRefresh=!0),n=this.parent.element.querySelector("."+Wt),r=this.parent.element.querySelector("."+A),e=this.parent.element.querySelector("."+Ft),this.parent.rowAutoHeight||(this.enableTransition=!1,B.removeClass([r,n],"e-transition")),i=(i=(t=(i=parseInt(n.querySelector("tbody td").getAttribute("data-group-index"),10))+this.renderedLength)>this.parent.resourceBase.expandedResources.length?this.parent.resourceBase.expandedResources.length-this.renderedLength:i)<0?0:i,this.existingDataCollection=this.parent.resourceBase.renderedResources,this.parent.resourceBase.renderedResources=this.parent.resourceBase.expandedResources.slice(i,t),0<this.parent.resourceBase.renderedResources.length)&&this.updateContent(n,r,e,this.parent.resourceBase.renderedResources)},h.prototype.renderEvents=function(){this.setTabIndex();var e=this.triggerScrollEvent(ve);if(this.parent.activeViewOptions&&this.parent.activeViewOptions.enableLazyLoading&&this.parent.crudModule)return 0<e.length?(this.parent.crudModule.refreshProcessedData(!0,e),void this.parent.hideSpinner()):void this.parent.crudModule.refreshDataManager();this.parent.crudModule&&this.parent.crudModule.refreshProcessedData(!0),"Month"!==this.parent.currentView&&this.parent.notify(Ve,{}),this.parent.hideSpinner()},h.prototype.virtualScrolling=function(){var e,t,i,n,r,a,s=this,o=(this.parent.quickPopup&&(this.parent.quickPopup.quickPopupHide(),this.parent.quickPopup.morePopup.hide()),this.parent.element.querySelector("."+A));this.isHorizontalScroll?this.horizontalScrolling(o):(e=this.parent.element.querySelector("."+Wt),t=this.parent.element.querySelector("."+Ft),i=this.parent.element.querySelector("."+ii),a=this.parent.element.querySelector("."+C),this.parent.rowAutoHeight||B.addClass([o,e],"e-transition"),this.renderedLength=e.querySelector("tbody").children.length,n=parseInt(e.querySelector("tbody td").getAttribute("data-group-index"),10),a=this.parent.rowAutoHeight?a.offsetHeight-o.offsetHeight:this.bufferCount*this.itemSize,r=[],this.existingDataCollection=this.parent.resourceBase.renderedResources,o.scrollTop-this.translateY<0?r=this.upScroll(o,n):(o.scrollTop+o.clientHeight>=o.scrollHeight-this.itemSize||o.scrollTop>this.translateY+a)&&(r=this.downScroll(o,n)),!B.isNullOrUndefined(r)&&0<r.length&&(this.triggerScrollEvent(me),a=this.parent.getSelectedCells(),this.focusedEle=a[a.length-1]||this.focusedEle,this.updateContent(e,o,t,r),this.setTranslate(e,o,t,i),this.parent.dragAndDropModule&&"drag"===this.parent.dragAndDropModule.actionObj.action&&this.parent.dragAndDropModule.navigationWrapper(),window.clearTimeout(this.timeValue),this.timeValue=window.setTimeout(function(){s.renderEvents()},250)))},h.prototype.horizontalScrolling=function(e){var t=this,i=[],n=this.bufferCount*this.itemSize;Math.abs(e.scrollLeft)-Math.abs(this.translateY)<0?i=this.leftScroll(e):Math.abs(e.scrollLeft)-Math.abs(this.translateY)>n&&(i=this.rightScroll(e)),!B.isNullOrUndefined(i)&&0<i.length&&(this.parent.resourceBase.expandedResources.length===i.length&&this.parent.resourceBase.expandedResources[0]===i[0]&&this.parent.resourceBase.expandedResources[this.parent.resourceBase.expandedResources.length-1]===i[i.length-1]||(this.triggerScrollEvent(me),n=this.parent.activeView.colLevels.slice(0),this.updateHorizontalContent(e,i),B.setStyleAttribute(e.querySelector("table"),{transform:"translateX("+this.translateY+"px)"}),this.parent.activeView.colLevels=n,this.parent.dragAndDropModule&&"drag"===this.parent.dragAndDropModule.actionObj.action&&this.parent.dragAndDropModule.navigationWrapper()),window.clearTimeout(this.timeValue),this.timeValue=window.setTimeout(function(){t.renderEvents()},250))},h.prototype.triggerScrollEvent=function(t){var e,i=this,n=[];return this.parent.activeView&&(e={startDate:this.parent.activeView.startDate(),endDate:this.parent.activeView.endDate(),startIndex:this.parent.resourceBase.renderedResources[0].groupIndex,endIndex:this.parent.resourceBase.renderedResources[this.parent.resourceBase.renderedResources.length-1].groupIndex,resourceData:this.parent.resourceBase.renderedResources.map(function(e){return e.resourceData}),name:t},this.parent.trigger(t,e,function(e){t===me?i.parent.showSpinner():t===ve&&!B.isNullOrUndefined(e.eventData)&&0<e.eventData.length&&(n=e.eventData)})),n},h.prototype.upScroll=function(e,t){var i=0,i=~~(e.scrollTop/this.itemSize)+Math.ceil(e.clientHeight/this.itemSize)-this.renderedLength,i=(this.parent.rowAutoHeight&&(i=t<i?t-this.bufferCount:i),this.getBufferCollection(i=0<i?i:0,i+this.renderedLength));return this.parent.resourceBase.renderedResources=i,0===t?this.translateY=e.scrollTop:(t=0<(t=this.parent.rowAutoHeight?this.averageRowHeight:this.itemSize)?t:this.itemSize,this.translateY=0<e.scrollTop-this.bufferCount*t?e.scrollTop-this.bufferCount*t:0),i},h.prototype.downScroll=function(e,t){var i;return this.parent.resourceBase.renderedResources[this.parent.resourceBase.renderedResources.length-1].groupIndex===this.parent.resourceBase.expandedResources[this.parent.resourceBase.expandedResources.length-1].groupIndex?null:(i=0,i=~~(e.scrollTop/this.itemSize),t=(t=(i=this.parent.rowAutoHeight?(i=~~((e.scrollTop-this.translateY)/this.averageRowHeight)+t)>t+this.bufferCount?i:t+this.bufferCount:i)+this.renderedLength)>this.parent.resourceBase.expandedResources.length?i+(this.parent.resourceBase.expandedResources.length-i):t,i=this.getBufferCollection(t-this.renderedLength,t),this.translateY=e.scrollTop,i)},h.prototype.leftScroll=function(e){e=~~(Math.abs(e.scrollLeft)/this.itemSize)+Math.ceil(e.clientWidth/this.itemSize)-this.renderedLength;return this.getCollection(e=0<e?e:0,e+this.renderedLength)},h.prototype.rightScroll=function(e){var t=this.parent.activeView.colLevels[this.parent.activeView.colLevels.length-1],e=(e=~~(Math.abs(e.scrollLeft)/this.itemSize)+this.renderedLength)>t.length-1?t.length-1:e;return this.getCollection(e-this.renderedLength,e)},h.prototype.getCollection=function(e,t){this.translateY=e*this.itemSize;e=this.getResCollection(e=e<0?0:e,t);return this.parent.enableRtl&&(this.translateY=-this.translateY),e},h.prototype.getResCollection=function(e,t){var i=this.parent.activeView.colLevels[this.parent.activeView.colLevels.length-1],n=(t=t>i.length?i.length-1:t,[]),r={startIndex:0,endIndex:0};if(this.parent.activeViewOptions.group.byDate){if(i[parseInt(e.toString(),10)].date.getTime()===this.parent.resourceBase.expandedResources[0].date.getTime()&&i[parseInt(t.toString(),10)].date.getTime()===this.parent.resourceBase.expandedResources[this.parent.resourceBase.expandedResources.length-1].date.getTime())return this.parent.resourceBase.expandedResources;n=this.getByDateCollection(i[parseInt(e.toString(),10)],i[parseInt(t.toString(),10)],r),this.setRenderedDates(n)}else{if(i[parseInt(e.toString(),10)].groupIndex===this.parent.resourceBase.expandedResources[0].groupIndex&&i[parseInt(t.toString(),10)].groupIndex===this.parent.resourceBase.expandedResources[this.parent.resourceBase.expandedResources.length-1].groupIndex)return this.parent.resourceBase.expandedResources;n=this.getByIdCollection(i[parseInt(e.toString(),10)],i[parseInt(t.toString(),10)],r)}return"Month"!==this.parent.currentView&&(this.startIndex=r.startIndex,n=i.slice(r.startIndex,r.endIndex)),this.translateY=r.startIndex*this.itemSize,n},h.prototype.getByDateCollection=function(t,i,e){var n=this.parent.activeView.colLevels[0].filter(function(e){return t.date.getTime()<=e.date.getTime()&&e.date.getTime()<=i.date.getTime()});return this.setStartEndIndex(this.parent.activeView.colLevels[0],n[0],n[n.length-1],e),n},h.prototype.getByIdCollection=function(t,i,e){var n=this.parent.resourceBase.lastResourceLevel.filter(function(e){return t.groupIndex<=e.groupIndex&&e.groupIndex<=i.groupIndex});return this.parent.resourceBase.renderedResources=n,this.setStartEndIndex(this.parent.resourceBase.lastResourceLevel,n[0],n[n.length-1],e),n},h.prototype.setStartEndIndex=function(e,t,i,n){var r=0;e.filter(function(e){t===e?n.startIndex=r:i===e&&(n.endIndex=r+e.colSpan),r+=e.colSpan}),t===i&&(n.endIndex=n.startIndex+i.colSpan)},h.prototype.updateContent=function(e,t,i,n){var r=e.querySelector("tbody").children.length;document.activeElement&&document.activeElement.classList.contains(Kt)&&(this.isResourceCell=!0,this.parent.element.focus());for(var a=0;a<r;a++)B.remove(i.querySelector("div"));this.parent.resourceBase.renderedResources=n;for(var s=this.parent.activeView.getGroupIndices(n),o=this.parent.activeView.getGroupIndices(this.existingDataCollection),l=s.filter(function(e){return o.indexOf(e)<0}),p=Array.from(e.querySelectorAll("tbody tr")),c=Array.from(t.querySelectorAll("tbody tr")),h=e.querySelector("tbody"),d=t.querySelector("tbody"),u=(this.removeObsoleteRows(p,s),this.removeObsoleteRows(c,s),this.parent.resourceBase.getContentRows(n,!0)),g=(this.parent.isReact&&this.parent.renderTemplates(),this.parent.activeView.getContentRows()),e=this.parent.activeView.getEventRows(n.length),a=0;a<l.length;a++){var m=s.indexOf(l[parseInt(a.toString(),10)]);0===m?(B.prepend([u[parseInt(a.toString(),10)]],h),B.prepend([g[parseInt(a.toString(),10)]],d)):h&&d&&h.children[parseInt(m.toString(),10)]&&d.children[parseInt(m.toString(),10)]?(h.insertBefore(u[parseInt(a.toString(),10)],h.children[parseInt(m.toString(),10)]),d.insertBefore(g[parseInt(a.toString(),10)],d.children[parseInt(m.toString(),10)])):(B.append([u[parseInt(a.toString(),10)]],h),B.append([g[parseInt(a.toString(),10)]],d))}B.append(e,i)},h.prototype.removeObsoleteRows=function(e,i){e.forEach(function(e){var t=parseInt(e.firstElementChild.getAttribute("data-group-index"),10);i.indexOf(t)<0&&B.remove(e)})},h.prototype.updateHorizontalContent=function(e,t){this.existingDataCollection=this.parent.resourceBase.expandedResources,this.parent.resourceBase.expandedResources=t;var i=this.parent.getSelectedCells(),i=(this.focusedEle=i[i.length-1]||this.focusedEle,e.querySelector("tbody")),i=Array.from(i.querySelectorAll("tr"));"Month"===this.parent.currentView?this.updateMonthViewContent(e,t):this.updateOtherViewContent(e,t,i)},h.prototype.updateMonthViewContent=function(e,t){for(var i=e.querySelectorAll(" tr").length,n=0;n<i;n++)B.remove(e.querySelector("tbody tr"));this.parent.activeViewOptions.group.byDate?this.parent.activeView.colLevels[0]=t:this.parent.activeView.colLevels[this.parent.activeView.colLevels.length-2]=t;t=this.parent.activeView.getContentRows();B.append(t,e.querySelector("tbody"))},h.prototype.updateOtherViewContent=function(e,t,i){for(var n=e.querySelector("tbody"),r=e.querySelector("colgroup"),a=e.querySelector("thead"),s=e.querySelector("table"),o=(this.parent.activeView.colLevels[this.parent.activeView.colLevels.length-1]=t,new Set(t.map(function(e){return e.groupIndex}))),l=(i.forEach(function(e){e.querySelectorAll("td").forEach(function(e){var t=parseInt(e.getAttribute("data-group-index"),10);o.has(t)||e.remove()})}),[].slice.call(e.querySelector("colgroup").children)),p=0;p<l.length;p++)B.remove(l[parseInt(p.toString(),10)]);t.forEach(function(){return r.appendChild(B.createElement("col"))});for(var c=[].slice.call(e.querySelector("thead").children),p=0;p<c.length;p++)B.remove(c[parseInt(p.toString(),10)]);a.appendChild(this.parent.eventBase.createEventWrapper("",0<this.startIndex?this.startIndex:0)),this.parent.activeViewOptions.timeScale.enable&&a.appendChild(this.parent.eventBase.createEventWrapper("timeIndicator")),B.prepend([a],s);i=this.parent.activeView.getContentRows();this.mergeNewTdData(n,i)},h.prototype.mergeNewTdData=function(e,t){Array.from(e.querySelectorAll("tr")).forEach(function(s,e){var o;e<t.length&&(e=t[parseInt(e.toString(),10)],o=Array.from(s.querySelectorAll("td")),Array.from(e.querySelectorAll("td")).forEach(function(e){for(var t=parseInt(e.getAttribute("data-group-index").toString(),10),i=!1,n=0,r=o;n<r.length;n++){var a=r[n];if(t<parseInt(a.getAttribute("data-group-index").toString(),10)){s.insertBefore(e,a),i=!0;break}}i||s.appendChild(e)}))})},h.prototype.getBufferCollection=function(e,t){return this.parent.resourceBase.expandedResources.slice(e,t)},h.prototype.setTranslate=function(e,t,i,n){B.setStyleAttribute(e.querySelector("table"),{transform:"translateY("+this.translateY+"px)"}),B.setStyleAttribute(t.querySelector("table"),{transform:"translateY("+this.translateY+"px)"}),B.setStyleAttribute(i,{transform:"translateY("+this.translateY+"px)"}),B.isNullOrUndefined(n)||B.setStyleAttribute(n,{transform:"translateY("+this.translateY+"px)"})},h.prototype.updateFocusedWorkCell=function(){var e,t;this.focusedEle&&(t=parseInt(this.focusedEle.getAttribute("data-date"),10),e=parseInt(this.focusedEle.getAttribute("data-group-index"),10),(t=this.parent.element.querySelector("."+O+'[data-date="'+t+'"][data-group-index="'+e+'"]'))&&this.parent.addSelectedClass([t],t,!0),this.focusedEle=null)},h.prototype.setRenderedDates=function(e){var t,i,n;"Month"!==this.parent.currentView?(t=e.map(function(e){return e.date}),this.parent.resourceBase.renderedResources.forEach(function(e){return e.renderDates=t})):(i=e.map(function(e){return e.date.getDay()}),n=this.parent.activeView.renderDates.filter(function(e){return 0<=i.indexOf(e.getDay())}),this.parent.resourceBase.renderedResources.forEach(function(e){return e.renderDates=n}))},h.prototype.setTabIndex=function(){var t=this.parent.element.querySelector("."+Wt),e=[].slice.call(this.parent.element.querySelectorAll("."+Kt)),e=(e&&t&&e.forEach(function(e){e.getBoundingClientRect().top>=t.getBoundingClientRect().top&&e.setAttribute("tabindex","0")}),this.parent.element.querySelector("."+Kt+'[tabindex="0"]'));this.isResourceCell&&e&&(e.focus(),this.isResourceCell=!1)},h.prototype.destroy=function(){this.removeEventListener(),this.focusedEle=null};var vo=h;function h(e){this.translateY=0,this.itemSize=60,this.renderedLength=0,this.averageRowHeight=0,this.startIndex=0,this.existingDataCollection=[],this.enableTransition=!0,this.parent=e,this.bufferCount=e.activeViewOptions.overscanCount<3?3:e.activeViewOptions.overscanCount,this.addEventListener()}yo.prototype.render=function(e,t){void 0===t&&(t=!0),this.initializeLayout(e),this.parent.activeView&&t&&this.parent.crudModule.refreshDataManager()},yo.prototype.initializeLayout=function(e){switch(this.parent.activeView&&(t=["cellTemplate","tooltipTemplate","majorSlotTemplate","minorSlotTemplate","headerTooltipTemplate","dateHeaderTemplate","dayHeaderTemplate","monthHeaderTemplate","headerIndentTemplate","resourceHeaderTemplate","cellHeaderTemplate","dateRangeTemplate"],0<this.parent.activeEventTemplates.length?(t=t.concat(this.parent.activeEventTemplates),this.parent.activeEventTemplates=[]):t.push("eventTemplate"),this.parent.resetTemplates(t),this.parent.activeView.removeEventListener(),this.parent.activeView.destroy()),e){case"Day":this.parent.activeView=this.parent.dayModule;break;case"Week":this.parent.activeView=this.parent.weekModule;break;case"WorkWeek":this.parent.activeView=this.parent.workWeekModule;break;case"Month":this.parent.activeView=this.parent.monthModule;break;case"Year":this.parent.activeView=this.parent.yearModule;break;case"Agenda":this.parent.activeView=this.parent.agendaModule;break;case"MonthAgenda":this.parent.activeView=this.parent.monthAgendaModule;break;case"TimelineDay":this.parent.activeView=this.parent.timelineViewsModule,B.isNullOrUndefined(this.parent.activeView)||(this.parent.activeView.viewClass="e-timeline-day-view");break;case"TimelineWorkWeek":this.parent.activeView=this.parent.timelineViewsModule,B.isNullOrUndefined(this.parent.activeView)||(this.parent.activeView.viewClass="e-timeline-work-week-view");break;case"TimelineWeek":this.parent.activeView=this.parent.timelineViewsModule,B.isNullOrUndefined(this.parent.activeView)||(this.parent.activeView.viewClass="e-timeline-week-view");break;case"TimelineMonth":this.parent.activeView=this.parent.timelineMonthModule;break;case"TimelineYear":this.parent.activeView=this.parent.timelineYearModule}if(B.isNullOrUndefined(this.parent.activeView)){var t=this.parent.viewCollections[0].option;if(t)return this.parent.setProperties({currentView:t},!0),this.parent.headerModule&&(this.parent.headerModule.updateActiveView(),this.parent.headerModule.setCalendarView()),console.warn('[WARNING] :: Module "'+e+'" is not available in Schedule component! You either misspelled the module name or forgot to load it.'),this.initializeLayout(t);throw Error("Inject required modules")}this.parent.uiStateValues.scheduleHeight=this.parent.element.offsetHeight,this.parent.activeView.viewIndex=this.parent.viewIndex,this.updateLabelText(e),this.parent.activeView.addEventListener(),this.parent.activeView.getRenderDates(),this.parent.uiStateValues.isGroupAdaptive=0<this.parent.activeViewOptions.group.resources.length&&(this.parent.enableAdaptiveUI&&!this.parent.isAdaptive||this.parent.isAdaptive&&this.parent.activeViewOptions.group.enableCompactView),this.parent.virtualScrollModule&&(this.parent.virtualScrollModule.destroy(),this.parent.virtualScrollModule=null),(-1===["Agenda","MonthAgenda","Year","TimelineYear"].indexOf(this.parent.currentView)||"TimelineYear"===this.parent.currentView&&"Vertical"===this.parent.activeViewOptions.orientation)&&this.parent.activeViewOptions.allowVirtualScrolling&&0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive&&(this.parent.virtualScrollModule=new vo(this.parent),this.parent.activeView.isTimelineView()?this.parent.uiStateValues.top=0:(this.parent.virtualScrollModule.isHorizontalScroll=!0,this.parent.uiStateValues.left=0)),this.updateHeader(),this.parent.currentTimezoneDate=this.parent.getCurrentTime(),this.parent.activeView.renderLayout(Ht),this.parent.renderTemplates(),this.parent.eventTooltip&&(this.parent.eventTooltip.destroy(),this.parent.eventTooltip=null),(this.parent.eventSettings.enableTooltip||0<this.parent.activeViewOptions.group.resources.length&&this.parent.activeViewOptions.group.headerTooltipTemplate)&&(this.parent.eventTooltip=new ss(this.parent))},yo.prototype.updateHeader=function(){this.parent.headerModule&&(this.parent.headerModule.setDayOfWeek(this.parent.activeViewOptions.firstDayOfWeek),this.parent.activeViewOptions.readonly?B.addClass([this.parent.element],Rr):this.parent.element.classList.contains(Rr)&&B.removeClass([this.parent.element],Rr),this.parent.headerModule.updateDateRange(),this.parent.headerModule.updateHeaderItems("remove"))},yo.prototype.updateLabelText=function(e){this.parent.element.setAttribute("role","application"),this.parent.element.removeAttribute("aria-labelledby"),this.parent.element.removeAttribute("aria-label"),"Year"===e?this.parent.element.setAttribute("aria-label",this.parent.activeView.getLabelText(e)):this.parent.element.setAttribute("aria-labelledby",this.parent.element.id+"_table")};var fo=yo;function yo(e){this.parent=e}To=function(e,t){return(To=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var To,wo,cs=function(e,t){function i(){this.constructor=e}To(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},hs=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;0<=o;o--)(r=e[o])&&(s=(a<3?r(s):3<a?r(t,i,s):r(t,i))||s);return 3<a&&s&&Object.defineProperty(t,i,s),s},cs=(wo=B.ChildProperty,cs(Do,wo),hs([B.Property(!0)],Do.prototype,"highlight",void 0),hs([B.Property("09:00")],Do.prototype,"start",void 0),hs([B.Property("18:00")],Do.prototype,"end",void 0),Do);function Do(){return null!==wo&&wo.apply(this,arguments)||this}bo=function(e,t){return(bo=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var bo,So,hs=function(e,t){function i(){this.constructor=e}bo(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Co=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;0<=o;o--)(r=e[o])&&(s=(a<3?r(s):3<a?r(t,i,s):r(t,i))||s);return 3<a&&s&&Object.defineProperty(t,i,s),s},hs=(So=B.ChildProperty,hs(Oo,So),Co([B.Property(!0)],Oo.prototype,"enable",void 0),Co([B.Property(60)],Oo.prototype,"interval",void 0),Co([B.Property(2)],Oo.prototype,"slotCount",void 0),Co([B.Property()],Oo.prototype,"minorSlotTemplate",void 0),Co([B.Property()],Oo.prototype,"majorSlotTemplate",void 0),Oo);function Oo(){return null!==So&&So.apply(this,arguments)||this}Eo=function(e,t){return(Eo=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var Eo,xo,Co=function(e,t){function i(){this.constructor=e}Eo(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Vo=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;0<=o;o--)(r=e[o])&&(s=(a<3?r(s):3<a?r(t,i,s):r(t,i))||s);return 3<a&&s&&Object.defineProperty(t,i,s),s},Co=(xo=B.ChildProperty,Co(Ao,xo),Vo([B.Property("Both")],Ao.prototype,"templateType",void 0),Vo([B.Property()],Ao.prototype,"header",void 0),Vo([B.Property()],Ao.prototype,"content",void 0),Vo([B.Property()],Ao.prototype,"footer",void 0),Ao);function Ao(){return null!==xo&&xo.apply(this,arguments)||this}Io=function(e,t){return(Io=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var Io,Mo,Vo=function(e,t){function i(){this.constructor=e}Io(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},ko=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;0<=o;o--)(r=e[o])&&(s=(a<3?r(s):3<a?r(t,i,s):r(t,i))||s);return 3<a&&s&&Object.defineProperty(t,i,s),s},Vo=(Mo=B.ChildProperty,Vo(Ro,Mo),ko([B.Property()],Ro.prototype,"option",void 0),ko([B.Property()],Ro.prototype,"template",void 0),Ro);function Ro(){return null!==Mo&&Mo.apply(this,arguments)||this}Po.prototype.getQuery=function(){var e=this.parent.activeView.startDate(),t=this.parent.activeView.endDate();return this.parent.dataModule.generateQuery(e,t)},Po.prototype.getTable=function(){return this.parent.eventSettings.query?this.parent.eventSettings.query.clone().fromTable:null},Po.prototype.refreshDataManager=function(){var e,t,i=this;this.parent.activeView&&(this.parent.uiStateValues&&this.parent.uiStateValues.isPreventEventRefresh?(this.parent.uiStateValues.isPreventEventRefresh=!1,this.parent.refreshEvents(!1),this.parent.hideSpinner()):(e=this.parent.activeView.startDate(),t=this.parent.activeView.endDate(),this.parent.dataModule.getData(this.parent.dataModule.generateQuery(e,t)).then(function(e){return i.dataManagerSuccess(e)}).catch(function(e){return i.dataManagerFailure(e)})))},Po.prototype.dataManagerSuccess=function(e){var t=this;!this.parent||this.parent&&this.parent.isDestroyed||this.parent.trigger(ne,e,function(e){e.cancel||(e=B.extend([],e.result,null,!0),t.parent.eventsData=e.filter(function(e){return!e[t.parent.eventFields.isBlock]}),t.parent.blockData=e.filter(function(e){return e[t.parent.eventFields.isBlock]}),t.refreshProcessedData(),t.parent.dragAndDropModule&&"drag"===t.parent.dragAndDropModule.actionObj.action&&t.parent.dragAndDropModule.navigationWrapper(),t.parent.trigger(re,null,function(){t.parent.hideSpinner(),t.parent.isPrinting&&setTimeout(function(){t.parent.notify(Oe,{})},100)}))})},Po.prototype.dataManagerFailure=function(e){var t=this;!this.parent||this.parent&&this.parent.isDestroyed||this.parent.trigger(Z,{error:e},function(){return t.parent.hideSpinner()})},Po.prototype.refreshProcessedData=function(e,t){if(void 0===e&&(e=!1),this.parent.dragAndDropModule&&(this.parent.dragAndDropModule.actionObj.action="",B.removeClass([this.parent.element],"e-event-action")),this.parent.activeViewOptions&&this.parent.activeViewOptions.eventTemplate){var i=["eventTemplate"];if(this.crudObj.isCrudAction&&-1===["Agenda","MonthAgenda","Year","TimelineYear"].indexOf(this.parent.currentView))for(var i=[],n=0,r=this.crudObj.sourceEvent.length;n<r;n++)i.push("eventTemplate_"+this.crudObj.sourceEvent[parseInt(n.toString(),10)].groupIndex),this.crudObj.targetEvent[parseInt(n.toString(),10)]&&this.crudObj.sourceEvent[parseInt(n.toString(),10)].groupIndex!==this.crudObj.targetEvent[parseInt(n.toString(),10)].groupIndex&&i.push("eventTemplate_"+this.crudObj.targetEvent[parseInt(n.toString(),10)].groupIndex);0<i.length&&this.parent.resetTemplates(i)}e?this.parent.notify(Ee,{processedData:t?this.parent.eventBase.processData(t):this.parent.eventsProcessed}):(e=this.parent.eventsData||[],t=this.parent.blockData||[],e=e.concat(t),this.parent.notify(Ee,{processedData:this.parent.eventBase?this.parent.eventBase.processData(e):[]}))},Po.prototype.refreshData=function(i){var t=this,e={requestType:i.requestType,cancel:!1,data:i.data,addedRecords:i.editParams.addedRecords,changedRecords:i.editParams.changedRecords,deletedRecords:i.editParams.deletedRecords};if(this.parent.dragAndDropModule&&this.parent.dragAndDropModule.actionObj&&this.parent.dragAndDropModule.actionObj.element&&this.parent.dragAndDropModule.actionObj.action&&(this.parent.dragAndDropModule.actionObj.element.style.display="none"),this.parent.resizeModule&&this.parent.resizeModule.actionObj&&this.parent.resizeModule.actionObj.element&&this.parent.resizeModule.actionObj.action&&(this.parent.resizeModule.actionObj.element.style.display="none"),this.parent.isSpecificResourceEvents()&&("eventCreated"===i.requestType||"eventRemoved"===i.requestType)){this.crudObj.isCrudAction=!0,this.crudObj.sourceEvent=[];for(var n=i.data instanceof Array?0===i.data.length&&"eventRemoved"===i.requestType?i.editParams.deletedRecords:i.data:"string"!=typeof i.data&&"number"!=typeof i.data||"eventRemoved"!==i.requestType?[i.data]:i.editParams.deletedRecords,r=this,a=0,s=n;a<s.length;a++)!function(e){r.crudObj.isCrudAction=!("eventRemoved"===i.requestType&&!B.isNullOrUndefined(e.parent));var t=r.parent.eventBase.getGroupIndexFromEvent(e);-1<t&&0===r.parent.crudModule.crudObj.sourceEvent.filter(function(e){return e.groupIndex===t}).length&&r.crudObj.isCrudAction&&r.crudObj.sourceEvent.push(r.parent.resourceBase.lastResourceLevel[parseInt(t.toString(),10)])}(s[a]);this.crudObj.targetEvent=this.crudObj.sourceEvent}this.parent.dataModule.dataManager.dataSource.offline?this.parent.trigger(K,e,function(e){e.cancel||t.refreshDataManager()}):i.promise.then(function(){!t.parent||t.parent&&t.parent.isDestroyed||t.parent.trigger(K,e,function(e){e.cancel||t.refreshDataManager()})}).catch(function(e){!t.parent||t.parent&&t.parent.isDestroyed||t.parent.trigger(Z,{error:e})})},Po.prototype.processAddEvent=function(e){var t,i=this.parent.eventFields,n={addedRecords:[],changedRecords:[],deletedRecords:[]};if(e.addedRecords instanceof Array){for(var r=0,a=e.addedRecords;r<a.length;r++){var s=a[r],s=this.parent.eventBase.updateEventDateTime(s),s=B.extend({},this.parent.eventBase.processTimezone(s,!0),null,!0);n.addedRecords.push(s)}t=this.parent.dataModule.dataManager.saveChanges(n,i.id,this.getTable(),this.getQuery())}else{i=this.parent.eventBase.processTimezone(e.addedRecords,!0);n.addedRecords.push(i),t=this.parent.dataModule.dataManager.insert(i,this.getTable(),this.getQuery())}i={requestType:"eventCreated",cancel:!1,data:e.addedRecords,promise:t,editParams:n};this.refreshData(i)},Po.prototype.processSaveEvent=function(e){var t,i=this.parent.eventFields,n={addedRecords:[],changedRecords:[],deletedRecords:[]};if(e.changedRecords instanceof Array){for(var r=0,a=e.changedRecords;r<a.length;r++){var s=a[r],s=this.parent.eventBase.updateEventDateTime(s),s=B.extend({},this.parent.eventBase.processTimezone(s,!0),null,!0);n.changedRecords.push(s)}t=this.parent.dataModule.dataManager.saveChanges(n,i.id,this.getTable(),this.getQuery())}else{var o=this.parent.eventBase.processTimezone(e.changedRecords,!0);n.changedRecords.push(o),t=this.parent.dataModule.dataManager.update(i.id,o,this.getTable(),this.getQuery())}i=B.extend({},e.changedRecords[e.changedRecords.length-1],null,!0),this.parent.eventBase.selectWorkCellByTime([this.parent.eventBase.processTimezone(i)]),o={requestType:"eventChanged",cancel:!1,data:e.changedRecords,promise:t,editParams:n};this.refreshData(o)},Po.prototype.processDeleteEvent=function(e){var t=this.parent.eventFields,i={addedRecords:[],changedRecords:[],deletedRecords:[]},t=1<e.deletedRecords.length?(i.deletedRecords=i.deletedRecords.concat(e.deletedRecords),this.parent.dataModule.dataManager.saveChanges(i,t.id,this.getTable(),this.getQuery())):(i.deletedRecords.push(e.deletedRecords[0]),this.parent.dataModule.dataManager.remove(t.id,e.deletedRecords[0],this.getTable(),this.getQuery())),e=(this.parent.eventBase.selectWorkCellByTime(e.deletedRecords),{requestType:"eventRemoved",cancel:!1,data:e.deletedRecords,promise:t,editParams:i});this.refreshData(e)},Po.prototype.addEvent=function(e){var i=this;this.parent.eventSettings.allowAdding&&!this.parent.activeViewOptions.readonly&&(!this.isBlockEvent(e)&&this.parent.eventBase.isBlockRange(e)?this.parent.quickPopup.openValidationError("blockAlert",e):this.parent.eventBase.checkOverlap(e)||0!==(e=e instanceof Array?e:[e]).length&&this.parent.trigger(Q,{requestType:"eventCreate",cancel:!1,data:e,addedRecords:e,changedRecords:[],deletedRecords:[]},function(t){t.cancel||(t.promise?t.promise.then(function(e){!i.parent||i.parent&&i.parent.isDestroyed||e&&i.processAddEvent(t)}).catch(function(e){!i.parent||i.parent&&i.parent.isDestroyed||i.parent.trigger(Z,{error:e})}):i.processAddEvent(t))}))},Po.prototype.saveEvent=function(e,t){var i=this;if(this.parent.eventSettings.allowEditing&&!this.parent.activeViewOptions.readonly)if("EditFollowingEvents"!==this.parent.currentAction&&!this.isBlockEvent(e)&&this.parent.eventBase.isBlockRange(e))this.parent.quickPopup.openValidationError("blockAlert",e),this.parent.crudModule.crudObj.isCrudAction=!1;else{var n=e instanceof Array?e:[e];if(0!==n.length)if(this.parent.currentAction=t)switch(t){case"Save":this.processSave(e);break;case"EditOccurrence":this.processOccurrences(e,t);break;case"EditFollowingEvents":this.processFollowSeries(e,t);break;case"EditSeries":this.processEntireSeries(e,t)}else this.parent.eventBase.checkOverlap(e)||this.parent.trigger(Q,{requestType:"eventChange",cancel:!1,data:e,addedRecords:[],changedRecords:n,deletedRecords:[]},function(t){t.cancel||(t.promise?t.promise.then(function(e){!i.parent||i.parent&&i.parent.isDestroyed||e&&i.processSaveEvent(t)}).catch(function(e){!i.parent||i.parent&&i.parent.isDestroyed||i.parent.trigger(Z,{error:e})}):i.processSaveEvent(t))})}},Po.prototype.deleteEvent=function(t,e){var i=this;if(this.parent.eventSettings.allowDeleting&&!this.parent.activeViewOptions.readonly){this.parent.currentAction=e;var n=[],n="string"==typeof t||"number"==typeof t?this.parent.eventsData.filter(function(e){return e[i.parent.eventFields.id]===t}):t instanceof Array?t:[t];if(0!==n.length)if(e)switch(e){case"Delete":this.processDelete(n);break;case"DeleteOccurrence":this.processOccurrences(n,e);break;case"DeleteFollowingEvents":this.processFollowSeries(n,e);break;case"DeleteSeries":this.processEntireSeries(n,e)}else this.parent.trigger(Q,{requestType:"eventRemove",cancel:!1,data:t,addedRecords:[],changedRecords:[],deletedRecords:n},function(t){t.cancel||(t.promise?t.promise.then(function(e){!i.parent||i.parent&&i.parent.isDestroyed||e&&i.processDeleteEvent(t)}).catch(function(e){!i.parent||i.parent&&i.parent.isDestroyed||i.parent.trigger(Z,{error:e})}):i.processDeleteEvent(t))})}},Po.prototype.processOccurrences=function(e,c){var h=this,r=[],d=!1;if(e instanceof Array)for(var t=0,i=e;t<i.length;t++){var n=i[t];r.push({occurrence:n,parent:this.getParentEvent(n)})}else r={occurrence:e,parent:this.getParentEvent(e)};e=e instanceof Array?e:[e],e={requestType:"EditOccurrence"===c?"eventChange":"eventRemove",cancel:!1,addedRecords:[],changedRecords:e,deletedRecords:[]};e.data=r,this.parent.trigger(Q,e,function(s){if(!s.cancel){for(var o=h.parent.eventFields,l={addedRecords:[],changedRecords:[],deletedRecords:[]},p=r instanceof Array?r:[r],e=0,t=s.changedRecords.length;e<t;e++)!function(e){var t,i,n=s.changedRecords[parseInt(e.toString(),10)],r=p[parseInt(e.toString(),10)].parent,a=r[o.recurrenceException];switch(c){case"EditOccurrence":t=h.parent.eventsProcessed.filter(function(e){return e.Guid===n.Guid})[0],((i=h.excludeDateCheck(t[o.startTime],a))!==r[o.recurrenceException]?(r[o.recurrenceException]=i,n[o.recurrenceException]=Wa(t[o.startTime]),n[o.recurrenceID]=r[o.id],n[o.followingID]=null,l.changedRecords.push(h.parent.eventBase.processTimezone(r,!0)),l.addedRecords):l.changedRecords).push(h.parent.eventBase.processTimezone(n,!0));break;case"DeleteOccurrence":n[o.recurrenceException]||(r[o.recurrenceException]=h.excludeDateCheck(n[o.startTime],a),l.changedRecords.push(h.parent.eventBase.processTimezone(r,!0))),n[o.id]!==r[o.id]&&(l.deletedRecords.push(h.parent.eventBase.processTimezone(n,!0)),d=!0)}}(e);var i=h.parent.dataModule.dataManager.saveChanges(l,o.id,h.getTable(),h.getQuery()),n=B.extend({},s.changedRecords[s.changedRecords.length-1],null,!0),n=(h.parent.eventBase.selectWorkCellByTime("EditOccurrence"===c?[h.parent.eventBase.processTimezone(n)]:[n]),{requestType:"EditOccurrence"===c?"eventChanged":"eventRemoved",cancel:!1,data:d?s.deletedRecords:s.changedRecords,promise:i,editParams:l});h.refreshData(n)}})},Po.prototype.processFollowSeries=function(e,c){var h=this,r=[];if(e instanceof Array)for(var t=0,i=e;t<i.length;t++){var n=i[t];r.push({occurrence:n,parent:this.getParentEvent(n)})}else r={occurrence:e,parent:this.getParentEvent(e)};e=e instanceof Array?e:[e],e={requestType:"EditFollowingEvents"===c?"eventChange":"eventRemove",cancel:!1,addedRecords:[],changedRecords:e,deletedRecords:[]};e.data=r,this.parent.trigger(Q,e,function(s){if(!s.cancel){for(var o=h.parent.eventFields,l={addedRecords:[],changedRecords:[],deletedRecords:[]},p=r instanceof Array?r:[r],e=0,t=s.changedRecords.length;e<t;e++)!function(e){var t,i,n=s.changedRecords[parseInt(e.toString(),10)],r=p[parseInt(e.toString(),10)].parent,a=h.parent.eventBase.getEventCollections(r,n);switch(c){case"EditFollowingEvents":h.processRecurrenceRule(r,n),t=!h.parent.eventBase.isFollowingEvent(r,n),n[o.followingID]=t?null:r[o.id],n[o.recurrenceID]=null,l.addedRecords.push(h.parent.eventBase.processTimezone(n,!0)),l.changedRecords.push(h.parent.eventBase.processTimezone(r,!0)),h.parent.uiStateValues.isIgnoreOccurrence||(n[o.recurrenceException]=null,0<a.occurrence.length&&-1===(i=a.occurrence.slice(-1)[0][o.recurrenceRule]).indexOf("COUNT")&&(n[o.recurrenceRule]=i),0<a.follow.length&&(n[o.recurrenceRule]=a.follow.slice(-1)[0][o.recurrenceRule],l.deletedRecords=l.deletedRecords.concat(a.follow)),t&&(a.occurrence=a.occurrence.filter(function(e){return e[o.recurrenceID]===r[o.id]})),l.deletedRecords=l.deletedRecords.concat(a.occurrence));break;case"DeleteFollowingEvents":h.processRecurrenceRule(r,n[o.startTime]),l.changedRecords.push(h.parent.eventBase.processTimezone(r,!0)),l.deletedRecords=l.deletedRecords.concat(a.occurrence).concat(a.follow)}}(e);var i=h.parent.dataModule.dataManager.saveChanges(l,o.id,h.getTable(),h.getQuery()),n=B.extend({},s.changedRecords[s.changedRecords.length-1],null,!0),n=(h.parent.eventBase.selectWorkCellByTime("EditFollowingEvents"===c?[h.parent.eventBase.processTimezone(n)]:[n]),{requestType:"EditFollowingEvents"===c?"eventChanged":"eventRemoved",cancel:!1,data:s.changedRecords,promise:i,editParams:l});h.refreshData(n)}})},Po.prototype.processEntireSeries=function(e,p){var c=this,h=[],d=!1;if(e instanceof Array)for(var t=0,i=e;t<i.length;t++){var n=i[t];h.push(this.getParentEvent(n,!0))}else h=this.getParentEvent(e,!0);var e=e instanceof Array?e:[e],r={requestType:"EditSeries"===p?"eventChange":"eventRemove",cancel:!1,addedRecords:[],changedRecords:[],deletedRecords:[]};if(r.data=h,"EditSeries"===p?r.changedRecords=e:r.deletedRecords=e,"EditSeries"===p&&!this.parent.uiStateValues.isIgnoreOccurrence)for(var a=h instanceof Array?h:[h],s=0,o=r.changedRecords.length;s<o;s++){var l=a[parseInt(s.toString(),10)],l=this.parent.eventBase.getEventCollections(l),l=l.follow.concat(l.occurrence);r.deletedRecords=r.deletedRecords.concat(l)}this.parent.trigger(Q,r,function(e){if(!e.cancel){for(var a=c.parent.eventFields,s={addedRecords:[],changedRecords:[],deletedRecords:[]},o=h instanceof Array?h:[h],l="EditSeries"===p?e.changedRecords:e.deletedRecords,t=0,i=l.length;t<i;t++)!function(e){var t,i=l[parseInt(e.toString(),10)],n=o[parseInt(e.toString(),10)],e=c.parent.eventBase.getEventCollections(n),r=e.follow.concat(e.occurrence);switch(p){case"EditSeries":i[a.id]=n[a.id],i[a.recurrenceID]=null,i[a.followingID]=null,c.parent.uiStateValues.isIgnoreOccurrence&&i[a.recurrenceException]?0<(t=c.parent.eventsData.filter(function(e){return e[a.id]===i[a.id]})).length&&(i[a.recurrenceRule]=t[0][a.recurrenceRule]):(i[a.recurrenceException]=null,s.deletedRecords=s.deletedRecords.concat(r)),s.changedRecords.push(c.parent.eventBase.processTimezone(i,!0)),c.parent.uiStateValues.isIgnoreOccurrence=!1;break;case"DeleteSeries":s.deletedRecords=s.deletedRecords.concat(r.concat(c.parent.eventBase.processTimezone(n,!0))),d=!0}}(t);var n=c.parent.dataModule.dataManager.saveChanges(s,a.id,c.getTable(),c.getQuery()),r=B.extend({},l[l.length-1],null,!0),r=(c.parent.eventBase.selectWorkCellByTime("EditSeries"===p?[c.parent.eventBase.processTimezone(r)]:[r]),{requestType:"EditSeries"===p?"eventChanged":"eventRemoved",cancel:!1,data:d?e.deletedRecords:e.changedRecords,promise:n,editParams:s});c.refreshData(r)}})},Po.prototype.processDelete=function(e){for(var d=this,u=[],t=0,i=e;t<i.length;t++){var n=i[t];n[this.parent.eventFields.recurrenceRule]?u.push({occurrence:n,parent:this.getParentEvent(n)}):u.push(n)}e={requestType:"eventRemove",cancel:!1,addedRecords:[],changedRecords:[],deletedRecords:e};e.data=u,this.parent.trigger(Q,e,function(p){if(!p.cancel){for(var c=d.parent.eventFields,h={addedRecords:[],changedRecords:[],deletedRecords:[]},e=B.extend([],p.deletedRecords,null,!0),t=0,i=p.deletedRecords.length;t<i;t++)!function(e){var t,i,n,r,a=B.isNullOrUndefined(p.deletedRecords[parseInt(e.toString(),10)][d.parent.eventFields.recurrenceRule]);if(a||(t=u[parseInt(e.toString(),10)].parent,i=h.changedRecords.filter(function(e){return e[c.id]===t[c.id]}),n=p.deletedRecords[parseInt(e.toString(),10)][c.startTime],0<i.length?(r=i[0])[c.recurrenceException]=d.excludeDateCheck(n,r[c.recurrenceException]):t[c.recurrenceException]=d.excludeDateCheck(n,t[c.recurrenceException]),0===i.length&&h.changedRecords.push(d.parent.eventBase.processTimezone(t,!0)),a=p.deletedRecords[parseInt(e.toString(),10)][c.id]!==t[c.id]),a){if(p.deletedRecords instanceof Array)for(var s=0,o=p.deletedRecords;s<o.length;s++){var l=o[s];d.parent.eventBase.processTimezone(l,!0)}h.deletedRecords.push(p.deletedRecords[parseInt(e.toString(),10)])}}(t);var n=d.parent.dataModule.dataManager.saveChanges(h,c.id,d.getTable(),d.getQuery()),e=(d.parent.eventBase.selectWorkCellByTime(e),{requestType:"eventRemoved",cancel:!1,data:p.deletedRecords,promise:n,editParams:h});d.refreshData(e)}})},Po.prototype.processSave=function(e){for(var c=this,e=e instanceof Array?e:[e],t=[],i=0,n=e;i<n.length;i++){var r=n[i];r[this.parent.eventFields.recurrenceRule]?t.push({occurrence:r,parent:this.getParentEvent(r)}):t.push(r)}e={requestType:"eventChange",cancel:!1,addedRecords:[],changedRecords:e,deletedRecords:[]};e.data=t,this.parent.trigger(Q,e,function(e){if(!e.cancel){for(var t=c.parent.eventFields,i={addedRecords:[],changedRecords:[],deletedRecords:[]},n=0,r=e.changedRecords;n<r.length;n++){var a,s,o=r[n];!B.isNullOrUndefined(o[t.recurrenceRule])&&B.isNullOrUndefined(o[t.recurrenceException])?(a=Wa(o[t.startTime]),(s=c.getParentEvent(o))[t.recurrenceException]=B.isNullOrUndefined(s[t.recurrenceException])?a:s[t.recurrenceException].concat(","+a),o[t.id]=c.parent.getEventMaxID(),o[t.recurrenceException]=a,i.addedRecords.push(c.parent.eventBase.processTimezone(o,!0)),i.changedRecords.push(c.parent.eventBase.processTimezone(s,!0))):i.changedRecords.push(c.parent.eventBase.processTimezone(o,!0))}var l=c.parent.dataModule.dataManager.saveChanges(i,t.id,c.getTable(),c.getQuery()),p=B.extend({},e.changedRecords[e.changedRecords.length-1],null,!0),p=(c.parent.eventBase.selectWorkCellByTime([c.parent.eventBase.processTimezone(p)]),{requestType:"eventChanged",cancel:!1,data:e.changedRecords,promise:l,editParams:i});c.refreshData(p)}})},Po.prototype.getParentEvent=function(e,t){t=this.parent.eventBase.getParentEvent(e,t=void 0===t?!1:t)||e;return(t[this.parent.eventFields.startTimezone]||t[this.parent.eventFields.endTimezone])&&this.parent.eventBase.timezoneConvert(t),t},Po.prototype.excludeDateCheck=function(e,t){var i=this.parent.timezone||this.parent.tzModule.getLocalTimezoneName(),i=Wa(e=i?this.parent.tzModule.remove(new Date(+e.getTime()),i):e);return B.isNullOrUndefined(t)?t=i:-1===t.indexOf(i)&&(t=B.isNullOrUndefined(t)?i:t+","+i),t},Po.prototype.processRecurrenceRule=function(e,t){var i,n,r,a,s=this.parent.eventFields,o=e[s.recurrenceRule];t instanceof Date?i=new Date(+t):(i=new Date(+t[s.startTime]),(n=t[s.recurrenceRule])&&(a=sa(r=e[s.startTime],n,"DeleteFollowingEvents"===this.parent.currentAction?t[s.recurrenceException]:null,this.parent.activeViewOptions.firstDayOfWeek),(a=new Date(a.slice(-1)[0])).setHours(i.getHours(),i.getMinutes(),i.getSeconds()),i.setHours(r.getHours(),r.getMinutes(),r.getSeconds()),t[s.recurrenceRule]=this.getUpdatedRecurrenceRule(n,new Date(+a),!1))),e[s.recurrenceRule]=this.getUpdatedRecurrenceRule(o,Y(new Date(i.getTime()),-1),!0)},Po.prototype.getUpdatedRecurrenceRule=function(e,t,i){for(var n="",r=0,a=e.split(";");r<a.length;r++){var s,o,l=a[r];""!==l&&(s=l.split("=")[0],o=l.split("=")[1],"COUNT"!==s&&"UNTIL"!==s||(o=Wa(t),l=l.replace(l,"UNTIL="+o)),n+=l+";")}return i&&-1===n.indexOf("UNTIL")&&(n+="UNTIL="+Wa(t)),n},Po.prototype.isBlockEvent=function(e){for(var t=!1,i=0,n=e instanceof Array?e:[e];i<n.length;i++)t=n[i][this.parent.eventFields.isBlock]||!1;return t},Po.prototype.destroy=function(){this.crudObj=null,this.parent=null};var Ho=Po;function Po(e){this.parent=e,this.crudObj={sourceEvent:null,targetEvent:null,isCrudAction:!1}}No.prototype.cellMouseDown=function(e){this.isPreventAction(e)||this.parent.notify(Pe,{event:e})},No.prototype.cellClick=function(e){var i,n,t,r,a,s=this;this.isPreventAction(e)||(i=B.closest(e.target,".e-work-cells,.e-all-day-cells,.e-header-cells"),B.isNullOrUndefined(i))||(B.isNullOrUndefined(B.closest(e.target,"."+zi))?(n=i.classList.contains(O)||i.classList.contains(w),this.parent.uiStateValues.isTapHold&&!this.parent.uiStateValues.action&&n&&(this.parent.uiStateValues.isTapHold=!1,this.parent.eventBase.removeSelectedAppointmentClass(),this.parent.selectedElements=[]),r=B.closest(e.target,"."+Hi),t=this.parent.getNavigateView(),a=this.parent.currentView===t,B.isNullOrUndefined(r)||a||B.isNullOrUndefined(this.parent.viewOptions[t.charAt(0).toLowerCase()+t.slice(1)])?this.parent.activeViewOptions.readonly&&"MonthAgenda"!==this.parent.currentView?this.parent.quickPopup&&this.parent.quickPopup.quickPopupHide():this.parent.isAdaptive&&(e.target.classList.contains(hn)||B.closest(e.target,"."+hn))||(n&&e.shiftKey&&1===e.which&&this.parent.keyboardInteractionModule?this.parent.keyboardInteractionModule.onMouseSelection(e):(this.parent.activeCellsData=this.parent.getCellDetails(i),r=B.extend(this.parent.activeCellsData,{cancel:!1,event:e,name:"cellClick"}),this.parent.trigger(q,r,function(e){var t;e.cancel?s.parent.quickPopup&&s.parent.quickPopup.quickPopupHide():(n&&s.parent.selectCell(i),s.parent.allowInline?(t={element:e.element,groupIndex:e.groupIndex,type:"Cell"},s.parent.notify(ue,t)):s.parent.notify(q,e))}))):(a=this.parent.getDateFromElement(i),!B.isNullOrUndefined(a)&&this.parent.isMinMaxDate(a)&&(this.parent.setProperties({selectedDate:a},!0),this.parent.changeView(this.parent.getNavigateView(),e)))):this.parent.eventWindow.openEditor(this.parent.activeCellsData,"Add"))},No.prototype.cellDblClick=function(e){var i=this,t=B.closest(e.target,".e-work-cells,.e-all-day-cells,.e-header-cells");this.parent.activeViewOptions.readonly||this.isPreventAction(e)||B.isNullOrUndefined(t)||(t=B.extend(this.parent.activeCellsData,{cancel:!1,event:e,name:"cellDoubleClick"}),this.parent.trigger(F,t,function(e){var t;e.startTime&&(t=new Date(e.startTime.getTime()),i.parent.isMinMaxDate(new Date(t.setHours(0,0,0,0))))&&!e.cancel&&i.parent.eventWindow.openEditor(i.parent.activeCellsData,"Add")}))},No.prototype.onHover=function(e){var t=B.closest(e.target,".e-work-cells,.e-time-slots,.e-all-day-cells,.e-header-cells,.e-resource-cells,.e-appointment,.e-week-number,.e-month-header");t&&this.parent.trigger(X,{element:t,event:e})},No.prototype.isPreventAction=function(e){var t;return!(B.closest(e.target,"."+Hi)||(!B.closest(e.target,"."+x)||B.closest(e.target,"."+hn))&&(t=B.closest(e.target,"."+V+",."+Ut),B.isNullOrUndefined(t))&&(t=B.closest(e.target,"."+It),!this.parent.activeView||!this.parent.activeView.isTimelineView()||B.isNullOrUndefined(t)))},No.prototype.destroy=function(){B.EventHandler.remove(this.parent.element,"mouseover",this.onHover)};var jo=No;function No(e){this.parent=e,B.EventHandler.add(this.parent.element,"mouseover",this.onHover,this)}Lo=function(e,t){return(Lo=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var Lo,qo,ko=function(e,t){function i(){this.constructor=e}Lo(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Fo=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;0<=o;o--)(r=e[o])&&(s=(a<3?r(s):3<a?r(t,i,s):r(t,i))||s);return 3<a&&s&&Object.defineProperty(t,i,s),s},ko=(qo=B.ChildProperty,ko(Uo,qo),Fo([B.Property()],Uo.prototype,"name",void 0),Fo([B.Property()],Uo.prototype,"default",void 0),Fo([B.Property()],Uo.prototype,"title",void 0),Fo([B.Property({})],Uo.prototype,"validation",void 0),Uo);function Uo(){return null!==qo&&qo.apply(this,arguments)||this}Bo=function(e,t){return(Bo=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var Bo,Wo,Fo=function(e,t){function i(){this.constructor=e}Bo(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},u=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;0<=o;o--)(r=e[o])&&(s=(a<3?r(s):3<a?r(t,i,s):r(t,i))||s);return 3<a&&s&&Object.defineProperty(t,i,s),s},Fo=(Wo=B.ChildProperty,Fo(zo,Wo),u([B.Property("Id")],zo.prototype,"id",void 0),u([B.Property("IsBlock")],zo.prototype,"isBlock",void 0),u([B.Complex({name:"Subject"},ko)],zo.prototype,"subject",void 0),u([B.Complex({name:"StartTime"},ko)],zo.prototype,"startTime",void 0),u([B.Complex({name:"EndTime"},ko)],zo.prototype,"endTime",void 0),u([B.Complex({name:"StartTimezone"},ko)],zo.prototype,"startTimezone",void 0),u([B.Complex({name:"EndTimezone"},ko)],zo.prototype,"endTimezone",void 0),u([B.Complex({name:"Location"},ko)],zo.prototype,"location",void 0),u([B.Complex({name:"Description"},ko)],zo.prototype,"description",void 0),u([B.Complex({name:"IsAllDay"},ko)],zo.prototype,"isAllDay",void 0),u([B.Complex({name:"RecurrenceID"},ko)],zo.prototype,"recurrenceID",void 0),u([B.Complex({name:"RecurrenceRule"},ko)],zo.prototype,"recurrenceRule",void 0),u([B.Complex({name:"RecurrenceException"},ko)],zo.prototype,"recurrenceException",void 0),u([B.Property("IsReadonly")],zo.prototype,"isReadonly",void 0),u([B.Property("FollowingID")],zo.prototype,"followingID",void 0),zo);function zo(){return null!==Wo&&Wo.apply(this,arguments)||this}Yo=function(e,t){return(Yo=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var Yo,_o,ko=function(e,t){function i(){this.constructor=e}Yo(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},u=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;0<=o;o--)(r=e[o])&&(s=(a<3?r(s):3<a?r(t,i,s):r(t,i))||s);return 3<a&&s&&Object.defineProperty(t,i,s),s},ko=(_o=B.ChildProperty,ko(Go,_o),u([B.Property()],Go.prototype,"template",void 0),u([B.Property([])],Go.prototype,"dataSource",void 0),u([B.Property()],Go.prototype,"query",void 0),u([B.Complex({},Fo)],Go.prototype,"fields",void 0),u([B.Property(!1)],Go.prototype,"enableTooltip",void 0),u([B.Property("AllDayRow")],Go.prototype,"spannedEventPlacement",void 0),u([B.Property(1)],Go.prototype,"minimumEventDuration",void 0),u([B.Property()],Go.prototype,"tooltipTemplate",void 0),u([B.Property()],Go.prototype,"resourceColorField",void 0),u([B.Property(!1)],Go.prototype,"editFollowingEvents",void 0),u([B.Property(!0)],Go.prototype,"allowAdding",void 0),u([B.Property(!0)],Go.prototype,"allowEditing",void 0),u([B.Property(!0)],Go.prototype,"allowDeleting",void 0),u([B.Property(!1)],Go.prototype,"enableMaxHeight",void 0),u([B.Property(!1)],Go.prototype,"enableIndicator",void 0),u([B.Property(!1)],Go.prototype,"ignoreWhitespace",void 0),u([B.Property()],Go.prototype,"sortComparer",void 0),u([B.Property()],Go.prototype,"includeFiltersInQuery",void 0),Go);function Go(){return null!==_o&&_o.apply(this,arguments)||this}Xo=function(e,t){return(Xo=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var Xo,Qo,Fo=function(e,t){function i(){this.constructor=e}Xo(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},u=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;0<=o;o--)(r=e[o])&&(s=(a<3?r(s):3<a?r(t,i,s):r(t,i))||s);return 3<a&&s&&Object.defineProperty(t,i,s),s},Fo=(Qo=B.ChildProperty,Fo(Ko,Qo),u([B.Property(!1)],Ko.prototype,"byDate",void 0),u([B.Property(!0)],Ko.prototype,"byGroupID",void 0),u([B.Property(!1)],Ko.prototype,"allowGroupEdit",void 0),u([B.Property([])],Ko.prototype,"resources",void 0),u([B.Property(!0)],Ko.prototype,"enableCompactView",void 0),u([B.Property()],Ko.prototype,"headerTooltipTemplate",void 0),u([B.Property(!1)],Ko.prototype,"hideNonWorkingDays",void 0),Ko);function Ko(){return null!==Qo&&Qo.apply(this,arguments)||this}Zo=function(e,t){return(Zo=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var Zo,Jo,u=function(e,t){function i(){this.constructor=e}Zo(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},$o=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;0<=o;o--)(r=e[o])&&(s=(a<3?r(s):3<a?r(t,i,s):r(t,i))||s);return 3<a&&s&&Object.defineProperty(t,i,s),s},u=(Jo=B.ChildProperty,u(el,Jo),$o([B.Property()],el.prototype,"field",void 0),$o([B.Property()],el.prototype,"title",void 0),$o([B.Property()],el.prototype,"name",void 0),$o([B.Property(!1)],el.prototype,"allowMultiple",void 0),$o([B.Property([])],el.prototype,"dataSource",void 0),$o([B.Property()],el.prototype,"query",void 0),$o([B.Property("Id")],el.prototype,"idField",void 0),$o([B.Property("Text")],el.prototype,"textField",void 0),$o([B.Property("Expanded")],el.prototype,"expandedField",void 0),$o([B.Property("GroupID")],el.prototype,"groupIDField",void 0),$o([B.Property("Color")],el.prototype,"colorField",void 0),$o([B.Property("StartHour")],el.prototype,"startHourField",void 0),$o([B.Property("EndHour")],el.prototype,"endHourField",void 0),$o([B.Property("WorkDays")],el.prototype,"workDaysField",void 0),$o([B.Property("CssClass")],el.prototype,"cssClassField",void 0),el);function el(){return null!==Jo&&Jo.apply(this,arguments)||this}g.prototype.renderResourceHeaderIndent=function(e){var t=B.createElement("td",{className:"e-resource-left-td"}),i=B.createElement("div",{className:Bt}),n=(this.parent.activeViewOptions.headerIndentTemplate?(n={className:[t.className],type:"emptyCells"},this.parent.renderHeaderIndentTemplate(n,t)):t.appendChild(i),{elementType:"emptyCells",element:t});this.parent.trigger($,n),e.appendChild(t)},g.prototype.hideResourceRows=function(e){if(!(this.resourceCollection.length<=1||this.parent.virtualScrollModule))for(var t=this.lastResourceLevel.length,i=0;i<t;i++){var n=this.lastResourceLevel[parseInt(i.toString(),10)].resourceData,r=this.lastResourceLevel[parseInt(i.toString(),10)].resource;n.ClassName!==_t||n[r.expandedField]||B.isNullOrUndefined(n[r.expandedField])||(r=[].slice.call(e.children).slice(i+1,i+(parseInt(n.Count,10)+1)),B.addClass(r,fr))}},g.prototype.createResourceColumn=function(){var e=this.resourceCollection,t=B.createElement("div",{className:Wt}),i=this.parent.activeView.createTableLayout(zt),n=(!this.parent.uiStateValues.isGroupAdaptive&&this.parent.rowAutoHeight&&this.parent.activeView.isTimelineView()&&0<this.parent.activeViewOptions.group.resources.length&&B.addClass([i],Mr),i.querySelector("tbody")),r=this.generateTreeData(!0);return this.countCalculation(e.slice(0,-2),e.slice(0,-1)),this.renderedResources=this.lastResourceLevel,this.parent.virtualScrollModule&&(e=this.parent.virtualScrollModule.getRenderedCount(),this.setExpandedResources(),r=this.expandedResources.slice(0,e),this.renderedResources=r),B.append(this.getContentRows(r),n),this.hideResourceRows(n),i.appendChild(n),t.appendChild(i),t},g.prototype.setRenderedResources=function(){var e=this.resourceCollection;this.generateTreeData(!0);this.countCalculation(e.slice(0,-2),e.slice(0,-1)),this.renderedResources=this.lastResourceLevel},g.prototype.setExpandedResources=function(){for(var e=[],t=0;t<this.lastResourceLevel.length;t++){var i=this.lastResourceLevel[parseInt(t.toString(),10)].resourceData,n=i.Count,i=(e.push(this.lastResourceLevel[parseInt(t.toString(),10)]),i[this.lastResourceLevel[parseInt(t.toString(),10)].resource.expandedField]);!B.isNullOrUndefined(i)&&!i&&0<n&&(t+=n)}this.expandedResources=e},g.prototype.getContentRows=function(e,t){for(var i,n,r,a,s=[],o=this.resourceCollection,l=B.createElement("tr"),p=B.createElement("td",{attrs:{tabindex:t?"-1":"0"}}),c=this.parent.activeView.getGroupIndices(),h=0;h<e.length;h++)0<c.length&&-1<c.indexOf(e[parseInt(h.toString(),10)].groupIndex)||(i=p.cloneNode(),(r=st(o,"name",e[parseInt(h.toString(),10)].resource.name))===o.length-1?(B.extend(e[parseInt(h.toString(),10)].resourceData,{ClassName:Yt}),this.renderedResources[parseInt(h.toString(),10)].className=[Yt]):(B.extend(e[parseInt(h.toString(),10)].resourceData,{ClassName:_t}),this.renderedResources[parseInt(h.toString(),10)].className=[_t]),a=r*this.leftPixel+"px",e[parseInt(h.toString(),10)].resourceData.ClassName===_t&&!B.isNullOrUndefined(e[parseInt(h.toString(),10)].resourceData.Count)&&0<e[parseInt(h.toString(),10)].resourceData.Count&&(n=void 0,n=e[parseInt(h.toString(),10)].resourceData[o[parseInt(r.toString(),10)].expandedField]||B.isNullOrUndefined(e[parseInt(h.toString(),10)].resourceData[o[parseInt(r.toString(),10)].expandedField])?Xt:Gt,r=B.createElement("div"),B.addClass([r],[Qt,n]),this.setMargin(r,a),i.appendChild(r),1<this.resourceCollection.length)&&B.EventHandler.add(r,"click",this.onTreeIconClick,this),this.parent.activeView.setResourceHeaderContent(i,e[parseInt(h.toString(),10)],Bt),i.setAttribute("data-group-index",e[parseInt(h.toString(),10)].groupIndex.toString()),i.setAttribute("aria-label",e[parseInt(h.toString(),10)].resourceData[e[parseInt(h.toString(),10)].resource.textField]+" resource"),this.parent.activeViewOptions.resourceHeaderTemplate||this.setMargin(i.querySelector("."+Bt),a),n=[Kt,e[parseInt(h.toString(),10)].resourceData.ClassName],B.addClass([i],n),r={elementType:"resourceHeader",element:i,groupIndex:e[parseInt(h.toString(),10)].groupIndex},this.parent.trigger($,r),(a=l.cloneNode()).appendChild(i),s.push(a));return s},g.prototype.setMargin=function(e,t){this.parent.enableRtl?e.style.marginRight=t:e.style.marginLeft=t},g.prototype.countCalculation=function(e,t){for(var i=0;i<e.length;i++){for(var n=e[e.length-(i+1)].dataSource,r=0;r<n.length;r++){var a,s,o=0;s=this.parent.activeViewOptions.group.byGroupID?(a=(new p.Query).where(t[t.length-1].groupIDField,"equal",n[parseInt(r.toString(),10)][e[e.length-(i+1)].idField]),new p.DataManager(t[t.length-1].dataSource).executeLocal(a)):t[t.length-1].dataSource;for(var l=0;l<s.length;l++)o+=parseInt(s[parseInt(l.toString(),10)].Count,10);o+=parseInt(n[parseInt(r.toString(),10)].Count,10),B.extend(n[parseInt(r.toString(),10)],{Count:o})}t=t.slice(0,-1)}},g.prototype.onTreeIconClick=function(r){var a,s=this,o=(this.parent.eventTooltip&&this.parent.eventTooltip.close(),r.target),e=B.closest(o,"."+_t).parentElement,l=parseInt(e.children[0].getAttribute("data-group-index"),10),p={cancel:!1,event:r,groupIndex:l,requestType:o.classList.contains(Xt)?"resourceCollapse":"resourceExpand"};this.parent.trigger(Q,p,function(e){if(!e.cancel){a=o.classList.contains(Xt)?(B.classList(o,[Gt],[Xt]),!0):(B.classList(o,[Xt],[Gt]),!1);for(var t=0,i=[].slice.call(s.parent.element.querySelectorAll("."+V+",."+hn));t<i.length;t++){var n=i[t];B.remove(n)}s.parent.virtualScrollModule?s.updateVirtualContent(l,a,r,o):s.updateContent(l,a);e={cssProperties:s.parent.getCssProperties(),module:"scroll"};s.parent.notify(Me,e),p={cancel:!1,event:r,groupIndex:l,requestType:o.classList.contains(Xt)?"resourceExpanded":"resourceCollapsed"},s.parent.refreshEvents(!1),s.parent.trigger(K,p)}})},g.prototype.updateContent=function(e,t){for(var i=[],n=[],r=[],a=this.lastResourceLevel[parseInt(e.toString(),10)].resourceData,s=[].slice.call(this.parent.element.querySelectorAll("."+Wt+" tr")),o=[].slice.call(this.parent.element.querySelectorAll("."+A+" tbody tr")),l=[].slice.call(this.parent.element.querySelectorAll("."+A+" ."+fi)),p=0;p<a.Count;p++)i.push(s[e+p+1]),n.push(o[e+p+1]),r.push(l[e+p+1]);for(var c=this.lastResourceLevel,h=0;h<i.length;h++){var d,u=!0,g=i[parseInt(h.toString(),10)].children[0].classList.contains(_t);c[parseInt(e.toString(),10)].resourceData[c[parseInt(e.toString(),10)].resource.expandedField]=!t,t?(g&&(d=i[parseInt(h.toString(),10)].querySelector("."+Qt))&&B.classList(d,[Gt],[Xt]),i[parseInt(h.toString(),10)].classList.contains(fr)||B.addClass([i[parseInt(h.toString(),10)],n[parseInt(h.toString(),10)],r[parseInt(h.toString(),10)]],fr)):(g&&(g=i[parseInt(h.toString(),10)].rowIndex,c[parseInt(g.toString(),10)].resourceData[c[parseInt(g.toString(),10)].resource.expandedField]||B.isNullOrUndefined(c[parseInt(g.toString(),10)].resourceData[c[parseInt(g.toString(),10)].resource.expandedField])||(i.splice(h+1,parseInt(c[parseInt(g.toString(),10)].resourceData.Count,10)),n.splice(h+1,parseInt(c[parseInt(g.toString(),10)].resourceData.Count,10)),r.splice(h+1,parseInt(c[parseInt(g.toString(),10)].resourceData.Count,10)),u=!1),u)&&(d=i[parseInt(h.toString(),10)].querySelector("."+Qt))&&B.classList(d,[Xt],[Gt]),i[parseInt(h.toString(),10)].classList.contains(fr)&&B.removeClass([i[parseInt(h.toString(),10)],n[parseInt(h.toString(),10)],r[parseInt(h.toString(),10)]],fr))}},g.prototype.updateVirtualContent=function(e,t,i,n){this.lastResourceLevel[parseInt(e.toString(),10)].resourceData[this.lastResourceLevel[parseInt(e.toString(),10)].resource.expandedField]=!t,this.setExpandedResources();var e=this.parent.virtualScrollModule.getRenderedCount(),t=this.expandedResources.indexOf(this.renderedResources[0]),e=(this.parent.virtualScrollModule.existingDataCollection=this.renderedResources,this.renderedResources=this.expandedResources.slice(t,t+e),this.renderedResources.length<e&&(t=this.expandedResources.length-e,this.renderedResources=this.expandedResources.slice(t=0<t?t:0,this.expandedResources.length)),this.parent.element.querySelector("."+xi)),t=(this.parent.virtualScrollModule.updateVirtualTrackHeight(e),this.parent.element.querySelector("."+Wt+" table")),e=this.parent.element.querySelector("."+A+" table"),r=this.parent.element.querySelector("."+Ft),t=(this.parent.virtualScrollModule.updateContent(t,e,r,this.renderedResources),this.parent.element.querySelector("."+ii));B.isNullOrUndefined(t)||(t.style.height=this.parent.element.querySelector("."+C).offsetHeight+"px")},g.prototype.renderResourceHeader=function(){var e,t=B.createElement("div",{className:pi});t.innerHTML='<div class="'+hi+'"><div class="'+wr+'"><div class="e-icons '+Dr+'"></div></div><div class="'+br+'"></div></div>',"MonthAgenda"===this.parent.currentView?(e=this.parent.activeView.getPanel().querySelector("."+A)).insertBefore(t,e.querySelector("."+vi)):this.parent.element.insertBefore(t,this.parent.element.querySelector("."+St)),this.renderResourceHeaderText(),B.EventHandler.add(t.querySelector("."+Dr),"click",this.menuClick,this)},g.prototype.renderResourceTree=function(){this.popupOverlay=B.createElement("div",{className:Sr});var e=B.createElement("div",{className:Cr+" e-popup-close"}),t=(("MonthAgenda"===this.parent.currentView?((t=this.parent.activeView.getPanel().querySelector("."+vi)).insertBefore(e,t.children[0]),t):(this.parent.element.querySelector("."+St).appendChild(e),this.parent.element.querySelector("."+St))).appendChild(this.popupOverlay),B.createElement("div",{className:"e-resource-tree"}));e.appendChild(t),this.treeViewObj=new k.TreeView({cssClass:this.parent.cssClass,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,fields:{dataSource:[].slice.call(this.generateTreeData()),id:"resourceId",text:"resourceName",child:"resourceChild"},nodeTemplate:this.parent.resourceHeaderTemplate,nodeClicked:this.resourceClick.bind(this),created:this.resourceTreeCreated.bind(this)}),this.treeViewObj.root=this.parent.root||this.parent,this.treeViewObj.appendTo(t),this.treeViewObj.expandAll(),this.treePopup=new M.Popup(e,{targetType:"relative",actionOnScroll:"none",content:this.treeViewObj.element,relateTo:this.parent.element.querySelector("."+St),enableRtl:this.parent.enableRtl,hideAnimation:{name:"SlideLeftOut",duration:500},showAnimation:{name:"SlideLeftIn",duration:500},viewPortElement:this.parent.element.querySelector("."+("MonthAgenda"===this.parent.currentView?vi:St))}),this.parent.on(Re,this.documentClick,this)},g.prototype.resourceTreeCreated=function(){this.parent.activeViewOptions.resourceHeaderTemplate&&this.parent.portals&&this.treeViewObj.portals&&(this.parent.portals=this.parent.portals.concat(this.treeViewObj.portals),this.parent.renderTemplates())},g.prototype.generateTreeData=function(h){for(var d=this,i=[],u=[],g=0,e=function(e,t){function c(e,t,i){for(var n,r,a=d.resourceCollection[parseInt(t.toString(),10)],s=(h?(r={type:"resourceHeader",resource:e.resource,resourceData:e.resourceData,groupIndex:g,groupOrder:e.groupOrder},u.push(r),g++):n={resourceId:i,resourceName:e.resourceData[a.textField],resource:e.resource,resourceData:e.resourceData},0<e.child.length&&!h&&(n.resourceChild=[]),1),o=0,l=e.child;o<l.length;o++){var p=l[o];h?c(p,t+1,i+"-"+s):n.resourceChild.push(c(p,t+1,i+"-"+s)),s+=1}return h&&B.extend(r.resourceData,{Count:s-1}),n}h?c(n.resourceTreeLevel[parseInt(e.toString(),10)],0,(e+1).toString()):i.push(c(n.resourceTreeLevel[parseInt(e.toString(),10)],0,(e+1).toString()))},n=this,t=0,r=this.resourceTreeLevel.length;t<r;t++)e(t);return h?this.lastResourceLevel=u:i},g.prototype.renderResourceHeaderText=function(){for(var r=this.lastResourceLevel[this.parent.uiStateValues.groupIndex],a=[],s=this,e=0,t=r.groupOrder.length;e<t;e++)!function(t){var i=s.resourceCollection[parseInt(t.toString(),10)],e=i.dataSource.filter(function(e){return e[i.idField]===r.groupOrder[parseInt(t.toString(),10)]}),n=B.createElement("div",{className:Si}),e=(s.parent.sanitize(e[0][i.textField],n),a.push(n),B.createElement("div",{className:"e-icons e-icon-next"}));a.push(e)}(e);a.pop();var i=("MonthAgenda"===this.parent.currentView?this.parent.activeView.getPanel():this.parent.element).querySelector("."+br);lt(i);for(var n=0,o=a;n<o.length;n++)i.appendChild(o[n]);1===this.lastResourceLevel.length&&B.addClass([this.parent.element.querySelector("."+wr)],d)},g.prototype.menuClick=function(e){var t;this.parent.element.querySelector("."+Cr).classList.contains(xt)?(this.treePopup.hide(),B.removeClass([this.popupOverlay],bt)):(t=[].slice.call(this.treeViewObj.element.querySelectorAll(".e-list-item:not(.e-has-child)")),B.removeClass(t,"e-active"),B.addClass([t[this.parent.uiStateValues.groupIndex]],"e-active"),this.treePopup.show(),B.addClass([this.popupOverlay],bt))},g.prototype.selectResourceByIndex=function(e){this.lastResourceLevel&&-1<e&&e<this.lastResourceLevel.length&&this.triggerEvents(e)},g.prototype.resourceClick=function(e){var t;e.node.classList.contains("e-has-child")||(this.treePopup.hide(),B.removeClass([this.popupOverlay],bt),t=[].slice.call(this.treeViewObj.element.querySelectorAll(".e-list-item:not(.e-has-child)")).indexOf(e.node),this.triggerEvents(t,e),e.event.preventDefault())},g.prototype.triggerEvents=function(e,t){var i=this,n={cancel:!1,event:t?t.event:null,groupIndex:e,requestType:"resourceChange"};this.parent.trigger(Q,n,function(e){e.cancel||(i.parent.uiStateValues.groupIndex=e.groupIndex,i.parent.renderModule.render(i.parent.currentView),n={cancel:!1,event:t?t.event:null,groupIndex:i.parent.uiStateValues.groupIndex,requestType:"resourceChanged"},i.parent.adaptiveGroupIndex=i.parent.uiStateValues.groupIndex,i.parent.trigger(K,n))})},g.prototype.documentClick=function(e){B.closest(e.event.target,"."+Cr)||(e=this.parent.element.querySelector("."+Cr))&&e.classList.contains(xt)&&(this.treePopup.hide(),B.removeClass([this.popupOverlay],bt))},g.prototype.bindResourcesData=function(t){for(var i=this,e=(this.parent.showSpinner(),[]),n=0,r=this.parent.resources;n<r.length;n++){var a=r[n],a=new Qr(this.parent,a.dataSource,a.query);e.push(a.getData(a.generateQuery()))}Promise.all(e).then(function(e){return i.dataManagerSuccess(e,t)}).catch(function(e){return i.parent.crudModule.dataManagerFailure(e)})},g.prototype.dataManagerSuccess=function(e,t){if(!(!this.parent||this.parent&&this.parent.isDestroyed)){this.parent.resourceCollection=[];for(var i=0,n=e.length;i<n;i++){var r=this.parent.resources[parseInt(i.toString(),10)],r=this.getResourceModel(r,e[parseInt(i.toString(),10)].result);this.parent.resourceCollection.push(r)}this.refreshLayout(t)}},g.prototype.getResourceModel=function(e,t){return{field:e.field,title:e.title,name:e.name,allowMultiple:e.allowMultiple,dataSource:t||e.dataSource,idField:e.idField,textField:e.textField,groupIDField:e.groupIDField,colorField:e.colorField,startHourField:e.startHourField,endHourField:e.endHourField,workDaysField:e.workDaysField,expandedField:e.expandedField,cssClassField:e.cssClassField}},g.prototype.refreshLayout=function(e){!B.isNullOrUndefined(this.parent.uiStateValues.groupIndex)&&this.parent.enablePersistence||(this.parent.uiStateValues.groupIndex=0),this.parent.renderElements(e)},g.prototype.setResourceCollection=function(){var e=[];if(this.resourceCollection=[],this.colorIndex=null,0<this.parent.activeViewOptions.group.resources.length)for(var t=0,i=this.parent.activeViewOptions.group.resources;t<i.length;t++){var n=i[t],r=st(this.parent.resourceCollection,"name",n);0<=r&&e.push(this.parent.resourceCollection[parseInt(r.toString(),10)])}else 0<this.parent.resourceCollection.length&&(e=this.parent.resourceCollection);for(var a=0,s=0,o=e;s<o.length;s++){var n=o[s],l=this.getResourceModel(n);n.name===this.parent.eventSettings.resourceColorField&&(this.colorIndex=a),a++,this.resourceCollection.push(l)}B.isNullOrUndefined(this.colorIndex)&&(this.colorIndex=this.resourceCollection.length-1)},g.prototype.generateResourceLevels=function(y,e){function T(e,t,i,n,r){var a=[],s=e[0];if(s){var o,l=void 0;l=n&&w.parent.activeViewOptions.group.byGroupID?(o=n[i.idField],s.dataSource.filter(function(e){return e[s.groupIDField]===o})):s.dataSource;for(var p=0;p<l.length;p++){var c,h,d,u,g,m,v=[],f=((v=r&&0<r.length?v.concat(r):v).push(l[parseInt(p.toString(),10)][s.idField]),T(e.slice(1),t+1,s,l[parseInt(p.toString(),10)],v));0===t&&0===f.length&&1<w.resourceCollection.length||(d=[],c=w.parent.activeView.renderDates,h=void 0,w.parent.activeViewOptions.group.byDate||t+1!==w.resourceCollection.length||(u=l[parseInt(p.toString(),10)][s.workDaysField],g=l[parseInt(p.toString(),10)][s.startHourField],m=l[parseInt(p.toString(),10)][s.endHourField],d=u&&0<u.length?(c=w.parent.activeView.getRenderDates(u),w.parent.activeView.getDateSlots(c,h=u)):(h=w.parent.activeViewOptions.workDays,y),u=w.generateCustomHours(d,g,m,v),b=b.concat(u)),g=l[parseInt(p.toString(),10)][s.cssClassField],m={type:"resourceHeader",className:["e-resource-cells"],resourceLevelIndex:t,groupOrder:v,resource:s,resourceData:l[parseInt(p.toString(),10)],colSpan:w.parent.activeViewOptions.group.byDate?1:d.length,renderDates:c,workDays:h,cssClass:g,child:f},a.push(m))}return D[parseInt(t.toString(),10)]||(D[parseInt(t.toString(),10)]=[]),0<a.length&&D[parseInt(t.toString(),10)].push(a),a}return[]}var w=this,t=this.resourceCollection,D=[],b=[];return this.resourceTreeLevel=T(t,0),e?[]:this.generateHeaderLevels(D,b,y)},g.prototype.generateCustomHours=function(e,t,i,n){for(var e=B.extend([],e,null,!0),r=0,a=e;r<a.length;r++){var s=a[r];t&&(s.startHour=this.parent.getStartEndTime(t)),i&&(s.endHour=this.parent.getStartEndTime(i)),n&&(s.groupOrder=n)}return e},g.prototype.generateHeaderLevels=function(e,t,i){for(var n=[],r=e.length-1;0<=r;r--)for(var a=0,s=0,o=e[parseInt(r.toString(),10)];s<o.length;s++)for(var l=0,p=o[s];l<p.length;l++){var c=p[l];if(e[r+1]&&0<e[r+1].length){var h=e[parseInt((r+1).toString(),10)][parseInt(a.toString(),10)];if(!h)continue;for(var d=0,u=0,g=h;u<g.length;u++){var m=g[u];(!this.parent.activeViewOptions.group.byGroupID||this.parent.activeViewOptions.group.byGroupID&&m.resourceData[m.resource.groupIDField]===c.resourceData[c.resource.idField])&&(d+=m.colSpan)}c.colSpan=d}c.groupIndex=a,a++,n[c.resourceLevelIndex]=n[c.resourceLevelIndex]||[],n[c.resourceLevelIndex].push(c)}if(this.lastResourceLevel=n.slice(-1)[0]||[],!this.parent.activeViewOptions.group.byDate){for(var v=0,f=0,y=this.lastResourceLevel;f<y.length;f++)for(var T=y[f],r=0;r<T.colSpan;r++)t[parseInt(v.toString(),10)].groupIndex=T.groupIndex,v++;return n.push(t),n}var w=[],D=B.extend([],n,null,!0),b=[];if(this.parent.activeViewOptions.group.hideNonWorkingDays){for(var S=[],C=0,j=function(a){O.resourceDateTree[parseInt(C.toString(),10)]=[];for(var s=[],e=function(n){var e=O.lastResourceLevel[parseInt(n.toString(),10)].resourceData[O.lastResourceLevel[parseInt(n.toString(),10)].resource.workDaysField];if(-1!==(e=e||O.parent.activeViewOptions.workDays).indexOf(a.date.getDay()))for(var r=B.extend({},O.lastResourceLevel[parseInt(n.toString(),10)],null,!0),t=(r.date=a.date,O.lastResourceLevel[parseInt(n.toString(),10)].workDays=e,r.startHour=O.parent.getStartEndTime(r.resourceData[r.resource.startHourField])||a.startHour,r.endHour=O.parent.getStartEndTime(r.resourceData[r.resource.endHourField])||a.endHour,O.resourceDateTree[parseInt(C.toString(),10)].push(r),0);t<r.groupOrder.length;t++)!function(t){if(s[parseInt(t.toString(),10)]||(s[parseInt(t.toString(),10)]=[]),t===r.groupOrder.length-1)return S[parseInt(n.toString(),10)]||(S[parseInt(n.toString(),10)]=[]),i=r.renderDates.filter(function(e){return e.getDay()===a.date.getDay()}),S[parseInt(n.toString(),10)]=S[parseInt(n.toString(),10)].concat(i),s[parseInt(t.toString(),10)].push(r);var e,i=D[parseInt(t.toString(),10)].filter(function(e){return e.resourceData[e.resource.idField]===r.groupOrder[parseInt(t.toString(),10)]});i&&0<i.length&&((e=s[parseInt(t.toString(),10)].filter(function(e){return e.resourceData[e.resource.idField]===r.groupOrder[parseInt(t.toString(),10)]}))&&0<e.length?e[0].colSpan+=1:((e=B.extend({},i[0],null,!0)).colSpan=1,s[parseInt(t.toString(),10)].push(e)))}(t)},t=0;t<O.lastResourceLevel.length;t++)e(t);if(0<s.length){for(var i=0;i<D.length;i++)w[parseInt(i.toString(),10)]||(w[parseInt(i.toString(),10)]=[]),w[parseInt(i.toString(),10)]=w[parseInt(i.toString(),10)].concat(s[parseInt(i.toString(),10)]);a.colSpan=s[s.length-1].length,b.push(a)}C++},O=this,E=0,x=i;E<x.length;E++)j(M=x[E]);this.resourceDateTree=this.resourceDateTree.filter(function(e){return 0<e.length}),this.lastResourceLevel.forEach(function(e,t){S[parseInt(t.toString(),10)]&&(e.renderDates=S[parseInt(t.toString(),10)].sort(function(e,t){return e.getTime()-t.getTime()}))})}else{for(var V=0,A=0,N=D[0];A<N.length;A++)V+=N[A].colSpan;for(var I=0,L=i;I<L.length;I++){(M=L[I]).colSpan=V,b.push(M);for(var M,k=B.extend([],D,null,!0),R=0,q=k.length;R<q;R++){if(R===k.length-1)for(var H=0,F=k[parseInt(R.toString(),10)];H<F.length;H++){var P=F[H];P.date=M.date,P.workDays=M.workDays,P.startHour=this.parent.getStartEndTime(P.resourceData[P.resource.startHourField])||M.startHour,P.endHour=this.parent.getStartEndTime(P.resourceData[P.resource.endHourField])||M.endHour}w[parseInt(R.toString(),10)]||(w[parseInt(R.toString(),10)]=[]),w[parseInt(R.toString(),10)]=w[parseInt(R.toString(),10)].concat(k[parseInt(R.toString(),10)])}}}return w.unshift(b),w},g.prototype.setResourceValues=function(n,e){function t(e,t,i){r.resourceCollection[parseInt(e.toString(),10)].allowMultiple&&r.parent.activeViewOptions.group.allowGroupEdit?n[""+t]=[i]:n[""+t]=i}var r=this;if(void 0===e&&(e=(this.parent.uiStateValues.isGroupAdaptive?this.parent.uiStateValues:this.parent.activeCellsData).groupIndex),0<this.parent.activeViewOptions.group.resources.length&&!B.isNullOrUndefined(e))for(var i=this.lastResourceLevel[parseInt(e.toString(),10)].groupOrder,a=0;a<this.resourceCollection.length;a++)t(a,this.resourceCollection[parseInt(a.toString(),10)].field,i[parseInt(a.toString(),10)]);else if(0<this.parent.resourceCollection.length)for(a=0;a<this.resourceCollection.length;a++){var s=this.resourceCollection[parseInt(a.toString(),10)].dataSource[0];s&&t(a,this.resourceCollection[parseInt(a.toString(),10)].field,s[this.resourceCollection[parseInt(a.toString(),10)].idField])}},g.prototype.getResourceColor=function(e,t){var i=!B.isNullOrUndefined(t)&&this.colorIndex>t.length-1?t.length-1:this.colorIndex,n=this.resourceCollection[parseInt(i.toString(),10)];if(!(B.isNullOrUndefined(t)&&this.parent.activeViewOptions.group.allowGroupEdit&&n.allowMultiple))return e=B.isNullOrUndefined(t)?e[n.field]:t[parseInt(i.toString(),10)],0<(t=this.filterData(n.dataSource,n.idField,e)).length?t[0][n.colorField]:void 0},g.prototype.getCssClass=function(e){var t=this.resourceCollection.slice(-1)[0];return(!this.parent.activeViewOptions.group.allowGroupEdit||!t.allowMultiple)&&0<(e=this.filterData(t.dataSource,t.idField,e[t.field])).length?e[0][t.cssClassField]:void 0},g.prototype.getResourceRenderDates=function(){var e=[].concat.apply([],this.lastResourceLevel.map(function(e){return e.renderDates})),i=e.map(function(e){return e.getTime()}),e=e.filter(function(e,t){return i.indexOf(e.getTime())===t});return e.sort(function(e,t){return e.getTime()-t.getTime()}),e},g.prototype.filterData=function(e,t,i){return e.filter(function(e){return e[""+t]===i})},g.prototype.getResourceData=function(e,t,i){if(this.parent.activeViewOptions.group.allowGroupEdit){for(var n={},r=0,a=i;r<a.length;r++)for(var s=a[r],o=this.lastResourceLevel[parseInt(s.toString(),10)].groupOrder,l=0,p=o.length;l<p;l++){var c=this.resourceCollection[parseInt(l.toString(),10)].field;B.isNullOrUndefined(n[""+c])&&(n[""+c]=[]),n[""+c].push(o[parseInt(l.toString(),10)])}B.extend(e,n)}else for(var l=0,h=this.resourceCollection.length;l<h;l++)this.lastResourceLevel[parseInt(t.toString(),10)]&&(e[this.resourceCollection[parseInt(l.toString(),10)].field]=this.lastResourceLevel[parseInt(t.toString(),10)].groupOrder[parseInt(l.toString(),10)])},g.prototype.addResource=function(e,t,n){for(var r=e instanceof Array?e:[e],i=0,a=this.parent.resourceCollection;i<a.length&&"break"!==function(i){if(i.name===t)return r.forEach(function(e,t){return new p.DataManager({json:i.dataSource}).insert(e,null,null,n+t)}),"break"}(a[i]);i++);this.refreshLayout(!0)},g.prototype.removeResource=function(e,i){for(var n=e instanceof Array?e:[e],t=0,r=this.parent.resourceCollection;t<r.length&&"break"!==function(t){if(t.name===i)return n.forEach(function(e){return new p.DataManager({json:t.dataSource}).remove(t.idField,e)}),"break"}(r[t]);t++);this.refreshLayout(!0)},g.prototype.getIndexFromResourceId=function(t,i,n,r,a){var e;return i=i||this.parent.resourceCollection.slice(-1)[0].name,B.isNullOrUndefined(n)&&(n=this.resourceCollection.filter(function(e){return e.name===i})[0],B.isNullOrUndefined(n))?null:(e=n.dataSource.filter(function(e){return!r||e[n.idField]!==t||e[n.groupIDField]===r[""+a]?e[n.idField]===t:null})[0],this.lastResourceLevel.map(function(e){return e.resourceData}).indexOf(e))},g.prototype.resourceExpand=function(t,i,e){var n=this.parent.resourceCollection.filter(function(e){return e.name===i?e:null})[0],r=0,a=n.dataSource.filter(function(e){return e[n.idField]===t})[0],r=this.parent.activeViewOptions.group.byGroupID?this.lastResourceLevel.map(function(e){return e.resourceData}).indexOf(a):this.getIndexFromResourceId(t,i,n),a=this.parent.element.querySelector("."+Wt+' [data-group-index="'+r+'"] .'+Qt);a&&(a.classList.contains(Gt)&&!e||a.classList.contains(Xt)&&e)&&a.click()},g.prototype.resourceScroll=function(t,e){var i,n,r,a,s,o;this.parent.isAdaptive||-1<["Agenda","MonthAgenda"].indexOf(this.parent.currentView)||(i=e||this.parent.resourceCollection.slice(-1)[0].name,n=this.parent.resourceCollection.length-1,r=this.parent.resourceCollection.filter(function(e,t){return e.name===i?(n=t,e):null})[0],e=this.parent.element.querySelector("."+A),a=0,this.parent.activeView.isTimelineView()?(a=this.parent.activeViewOptions.group.byGroupID?(s=r.dataSource.filter(function(e){return e[r.idField]===t})[0],this.lastResourceLevel.map(function(e){return e.resourceData}).indexOf(s)):this.getIndexFromResourceId(t,i,r),this.parent.virtualScrollModule?(s=this.parent.element.querySelector("."+xi),s=Math.round(s.offsetHeight/this.expandedResources.length),this.parent.rowAutoHeight&&(e.scrollTop=0,this.parent.virtualScrollModule.virtualScrolling()),e.scrollTop=a*s-(this.parent.virtualScrollModule.bufferCount-1)*s,this.parent.virtualScrollModule.virtualScrolling(),this.parent.rowAutoHeight?(o=this.parent.element.querySelector("."+O+'[data-group-index="'+a+'"]'))&&!o.parentElement.classList.contains(fr)&&(e.scrollTop=e.scrollTop<o.offsetTop?o.offsetTop:e.scrollTop+o.offsetTop):e.scrollTop=a*s):(o=this.parent.element.querySelector("."+O+'[data-group-index="'+a+'"]'))&&!o.parentElement.classList.contains(fr)&&(e.scrollTop=o.offsetTop)):(a=this.parent.activeViewOptions.group.byGroupID?(i===this.parent.resourceCollection.slice(-1)[0].name?this.lastResourceLevel.map(function(e){return e.resourceData[r.idField]}):r.dataSource.map(function(e){return e[r.idField]})).indexOf(t):this.getIndexFromResourceId(t,i,r),s="Month"===this.parent.currentView?this.parent.element.querySelector("."+Vt+" tbody tr:nth-child("+(n+1)+")"):this.parent.element.querySelector("."+nn+":nth-child("+(n+1)+")"),o=[].slice.call(s.children).map(function(e){return e.offsetLeft}),e.scrollLeft=o[parseInt(a.toString(),10)]))},g.prototype.destroy=function(){this.parent.off(Re,this.documentClick),this.treeViewObj&&(this.treeViewObj.portals&&0<this.treeViewObj.portals.length&&0<(e=this.treeViewObj.portals.map(function(e){return e.propName})).length&&this.parent.resetTemplates(e),this.treeViewObj.destroy(),this.treeViewObj=null),this.treePopup&&(this.treePopup.destroy(),this.treePopup=null,B.remove(this.parent.element.querySelector("."+Cr)),B.remove(this.parent.element.querySelector("."+Sr)));var e=this.parent.element.querySelector("."+pi);e&&B.remove(e)};var tl=g;function g(e){this.resourceCollection=[],this.leftPixel=25,this.resourceDateTree=[],this.parent=e}il=function(e,t){return(il=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var il,nl,$o=function(e,t){function i(){this.constructor=e}il(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},rl=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;0<=o;o--)(r=e[o])&&(s=(a<3?r(s):3<a?r(t,i,s):r(t,i))||s);return 3<a&&s&&Object.defineProperty(t,i,s),s},$o=(nl=B.ChildProperty,$o(al,nl),rl([B.Property("")],al.prototype,"id",void 0),rl([B.Property("")],al.prototype,"text",void 0),rl([B.Property("auto")],al.prototype,"width",void 0),rl([B.Property("")],al.prototype,"cssClass",void 0),rl([B.Property(!1)],al.prototype,"showAlwaysInPopup",void 0),rl([B.Property(!1)],al.prototype,"disabled",void 0),rl([B.Property("")],al.prototype,"prefixIcon",void 0),rl([B.Property("")],al.prototype,"suffixIcon",void 0),rl([B.Property(!0)],al.prototype,"visible",void 0),rl([B.Property("None")],al.prototype,"overflow",void 0),rl([B.Property("")],al.prototype,"template",void 0),rl([B.Property("Button")],al.prototype,"type",void 0),rl([B.Property("Both")],al.prototype,"showTextOn",void 0),rl([B.Property(null)],al.prototype,"htmlAttributes",void 0),rl([B.Property("")],al.prototype,"tooltipText",void 0),rl([B.Property("Left")],al.prototype,"align",void 0),rl([B.Property(-1)],al.prototype,"tabIndex",void 0),rl([B.Property("Custom")],al.prototype,"name",void 0),rl([B.Event()],al.prototype,"click",void 0),al);function al(){return null!==nl&&nl.apply(this,arguments)||this}sl=function(e,t){return(sl=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var sl,ol,rl=function(e,t){function i(){this.constructor=e}sl(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},m=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;0<=o;o--)(r=e[o])&&(s=(a<3?r(s):3<a?r(t,i,s):r(t,i))||s);return 3<a&&s&&Object.defineProperty(t,i,s),s},ll=(ol=B.Component,rl(v,ol),v.prototype.render=function(){var e=[],t=[];if(e.push(vt),(this.enableRtl?e:t).push(ft),(this.isAdaptive?e:t).push(yt),(this.enableAdaptiveUI?e:t).push(Tt),(this.allowMultiDrag?e:t).push(wt),this.cssClass)for(var i=0,n=this.cssClass.split(" ");i<n.length;i++){var r=n[i];e.push(r)}B.classList(this.element,e,t),this.validateDate(),M.createSpinner({target:this.element}),this.scrollModule=new Wr(this),this.scrollModule.setWidth(),this.scrollModule.setHeight(),this.renderModule=new fo(this),this.eventBase=new Ya(this),this.workCellAction=new jo(this),this.allowKeyboardInteraction&&(this.keyboardInteractionModule=new Xr(this)),this.inlineModule=new ts(this),this.initializeDataModule(),this.renderTableContainer(),this.activeViewOptions=this.getActiveViewOptions(),this.initializeResources(),this.wireEvents()},v.prototype.renderTableContainer=function(){this.element.querySelector("."+St)||this.element.appendChild(this.createElement("div",{className:St}))},v.prototype.getEventTemplateName=function(e){e="eventTemplate_"+e;return this.activeEventTemplates.indexOf(e)<0&&this.activeEventTemplates.push(e),e},v.prototype.getElementWidth=function(e){return ut(e,this.uiStateValues.isTransformed)},v.prototype.getElementHeight=function(e){return gt(e,this.uiStateValues.isTransformed)},v.prototype.getElementHeightFromClass=function(e,t){return Ne(e,t,this.uiStateValues.isTransformed)},v.prototype.renderTemplates=function(e){this.isReact?this.renderReactTemplates(e):e&&e()},v.prototype.resetTemplates=function(e){(this.isAngular||this.isReact)&&this.clearTemplate(e)},v.prototype.sanitize=function(e,t){this.enableHtmlSanitizer?t.innerText=B.SanitizeHtmlHelper.sanitize(e):t.innerHTML=e},v.prototype.initializeResources=function(e){void 0===e&&(e=!1),0<this.resources.length?(this.resourceBase=new tl(this),this.resourceBase.bindResourcesData(e)):(this.resourceBase=null,this.resourceCollection=[],this.renderElements(e))},v.prototype.destroyEditorWindow=function(){this.eventWindow&&(this.eventWindow.destroy(),this.eventWindow=null),this.eventWindow=new mo(this)},v.prototype.renderElements=function(e){e?(this.initializeView(this.currentView),this.eventWindow.refresh()):(this.destroyHeaderModule(),this.showHeaderBar&&(this.headerModule=new Br(this)),this.renderTableContainer(),this.uiStateValues.isTransformed=Math.round(this.element.getBoundingClientRect().width)!==this.element.offsetWidth,(B.Browser.isDevice||B.Browser.isTouch)&&(this.scheduleTouchModule=new Yr(this)),this.initializeView(this.currentView),this.destroyPopups(),this.isPrinting||this.initializePopups())},v.prototype.validateDate=function(e){var e=(e=void 0===e?this.selectedDate:e)instanceof Date?new Date(e.getTime()):new Date(e),t=B.isNullOrUndefined(this.minDate)?new Date(1900,0,1):this.minDate instanceof Date?new Date(this.minDate.getTime()):new Date(this.minDate),i=B.isNullOrUndefined(this.maxDate)?new Date(2099,11,31):this.maxDate instanceof Date?new Date(this.maxDate.getTime()):new Date(this.maxDate);if(!(t<=i))throw Error("minDate should be equal or less than maxDate");i<(e=e<t?t:e)&&(e=i),this.setProperties({selectedDate:new Date(""+e),minDate:new Date(""+t),maxDate:new Date(""+i)},!0),this.eventWindow&&this.eventWindow.updateMinMaxDateToEditor()},v.prototype.getViewIndex=function(e){for(var t=0;t<this.viewCollections.length;t++)if(this.viewCollections[parseInt(t.toString(),10)].option===e)return t;return-1},v.prototype.setViewOptions=function(e){if(void 0===e&&(e=!1),!B.isNullOrUndefined(this.views)&&0!==this.views.length){this.viewOptions={},this.viewCollections=[];var t,i,n=this.viewIndex,r=0;this.viewIndex=-1;for(var a=0,s=this.views;a<s.length;a++){var o=s[a],l="string"!=typeof o,l=("string"==typeof o?this.currentView===(t=o)&&(i=t,this.viewIndex=r):(t=o.option,o.isSelected&&(i=t,this.viewIndex=r)),B.extend({option:t},l?o:{})),o=t.charAt(0).toLowerCase()+t.slice(1);l.cellHeaderTemplateName=l.cellHeaderTemplate?l.option:"",l.dateHeaderTemplateName=l.dateHeaderTemplate?l.option:"",l.dateRangeTemplateName=l.dateRangeTemplate?l.option:"",l.cellTemplateName=l.cellTemplate?l.option:"",l.dayHeaderTemplateName=l.dayHeaderTemplate?l.option:"",l.monthHeaderTemplateName=l.monthHeaderTemplate?l.option:"",l.resourceHeaderTemplateName=l.resourceHeaderTemplate?l.option:"",l.headerIndentTemplateName=l.headerIndentTemplate?l.option:"",l.eventTemplateName=l.eventTemplate?l.option:"",B.isNullOrUndefined(l.firstDayOfWeek)||0!==l.firstDayOfWeek||delete l.firstDayOfWeek,B.isNullOrUndefined(l.interval)||1!==l.interval||delete l.interval,this.viewCollections.push(l),B.isNullOrUndefined(this.viewOptions[""+o])?this.viewOptions[""+o]=[l]:this.viewOptions[""+o].push(l),r++}!e&&i&&this.setProperties({currentView:i},!0),-1===this.viewIndex&&(e=this.getViewIndex(this.currentView),this.viewIndex="string"==typeof this.views[0]||B.isNullOrUndefined(n)||-1===n?-1===e?0:e:n)}},v.prototype.getActiveViewOptions=function(){var e={enable:this.timeScale.enable,interval:this.timeScale.interval,slotCount:this.timeScale.slotCount,majorSlotTemplate:this.timeScale.majorSlotTemplate,minorSlotTemplate:this.timeScale.minorSlotTemplate},t={byDate:!(-1<this.viewCollections[this.viewIndex].option.indexOf("Year"))&&this.group.byDate,byGroupID:this.group.byGroupID,allowGroupEdit:this.group.allowGroupEdit,resources:B.isNullOrUndefined(this.group.resources)?[]:this.group.resources,headerTooltipTemplate:this.group.headerTooltipTemplate,enableCompactView:this.group.enableCompactView,hideNonWorkingDays:-1<["Day","Week","WorkWeek","Month"].indexOf(this.currentView)&&this.group.hideNonWorkingDays},i=this.viewCollections[this.viewIndex].workDays?[]:this.workDays,i={dateFormat:this.dateFormat,endHour:this.endHour,isSelected:!1,option:null,readonly:this.readonly,startHour:this.startHour,allowVirtualScrolling:!1,allowOverlap:this.allowOverlap,overscanCount:this.overscanCount,cellHeaderTemplate:this.cellHeaderTemplate,dayHeaderTemplate:this.dayHeaderTemplate,monthHeaderTemplate:this.monthHeaderTemplate,cellTemplate:this.cellTemplate,eventTemplate:this.eventSettings.template,dateHeaderTemplate:this.dateHeaderTemplate,dateRangeTemplate:this.dateRangeTemplate,resourceHeaderTemplate:this.resourceHeaderTemplate,headerIndentTemplate:this.headerIndentTemplate,firstMonthOfYear:this.firstMonthOfYear,firstDayOfWeek:this.firstDayOfWeek,workDays:i,monthsCount:this.monthsCount,showWeekend:this.showWeekend,showWeekNumber:this.showWeekNumber,displayName:null,interval:1,timeScale:e,timeFormat:this.internalTimeFormat,group:t,headerRows:this.headerRows,orientation:"Horizontal",numberOfWeeks:0,displayDate:null,enableLazyLoading:!1},e=this.viewCollections[this.viewIndex],t=B.extend(i,e,void 0,!0);return 0!==this.firstDayOfWeek&&e.firstDayOfWeek&&this.firstDayOfWeek!==e.firstDayOfWeek&&(t.firstDayOfWeek=this.firstDayOfWeek),t.displayDate&&(t.displayDate=t.displayDate instanceof Date?new Date(t.displayDate.getTime()):new Date(t.displayDate)),t.enableLazyLoading&&!B.isNullOrUndefined(t.group.resources)&&0<t.group.resources.length&&(-1===["Agenda","MonthAgenda","Year","TimelineYear"].indexOf(t.option)||"TimelineYear"===t.option&&"Vertical"===t.orientation)&&(t.allowVirtualScrolling=!0),t},v.prototype.initializeDataModule=function(){this.eventFields={id:this.eventSettings.fields.id,isBlock:this.eventSettings.fields.isBlock,subject:this.eventSettings.fields.subject.name,startTime:this.eventSettings.fields.startTime.name,endTime:this.eventSettings.fields.endTime.name,startTimezone:this.eventSettings.fields.startTimezone.name,endTimezone:this.eventSettings.fields.endTimezone.name,location:this.eventSettings.fields.location.name,description:this.eventSettings.fields.description.name,isAllDay:this.eventSettings.fields.isAllDay.name,recurrenceID:this.eventSettings.fields.recurrenceID.name,recurrenceRule:this.eventSettings.fields.recurrenceRule.name,recurrenceException:this.eventSettings.fields.recurrenceException.name,isReadonly:this.eventSettings.fields.isReadonly,followingID:this.eventSettings.fields.followingID},this.setEditorTitles(),this.dataModule=new Qr(this,this.eventSettings.dataSource,this.eventSettings.query),this.crudModule=new Ho(this)},v.prototype.setEditorTitles=function(){this.editorTitles={subject:this.eventSettings.fields.subject.title||this.localeObj.getConstant("title"),startTime:this.eventSettings.fields.startTime.title||this.localeObj.getConstant("start"),endTime:this.eventSettings.fields.endTime.title||this.localeObj.getConstant("end"),isAllDay:this.eventSettings.fields.isAllDay.title||this.localeObj.getConstant("allDay"),startTimezone:this.eventSettings.fields.startTimezone.title||this.localeObj.getConstant("startTimezone"),endTimezone:this.eventSettings.fields.endTimezone.title||this.localeObj.getConstant("endTimezone"),location:this.eventSettings.fields.location.title||this.localeObj.getConstant("location"),description:this.eventSettings.fields.description.title||this.localeObj.getConstant("description"),recurrenceRule:this.eventSettings.fields.recurrenceRule.title||this.localeObj.getConstant("repeat")}},v.prototype.initializeView=function(e){this.showSpinner(),this.activeViewOptions=this.getActiveViewOptions(),this.resourceBase&&this.resourceBase.setResourceCollection(),this.initializeTemplates(),this.renderModule.render(e)},v.prototype.initializeTemplates=function(){this.cellHeaderTemplateFn=this.templateParser(this.activeViewOptions.cellHeaderTemplate),this.dayHeaderTemplateFn=this.templateParser(this.activeViewOptions.dayHeaderTemplate),this.monthHeaderTemplateFn=this.templateParser(this.activeViewOptions.monthHeaderTemplate),this.cellTemplateFn=this.templateParser(this.activeViewOptions.cellTemplate),this.dateHeaderTemplateFn=this.templateParser(this.activeViewOptions.dateHeaderTemplate),this.dateRangeTemplateFn=this.templateParser(this.activeViewOptions.dateRangeTemplate),this.majorSlotTemplateFn=this.templateParser(this.activeViewOptions.timeScale.majorSlotTemplate),this.minorSlotTemplateFn=this.templateParser(this.activeViewOptions.timeScale.minorSlotTemplate),this.appointmentTemplateFn=this.templateParser(this.activeViewOptions.eventTemplate),this.resourceHeaderTemplateFn=this.templateParser(this.activeViewOptions.resourceHeaderTemplate),this.headerIndentTemplateFn=this.templateParser(this.activeViewOptions.headerIndentTemplate),this.headerTooltipTemplateFn=this.templateParser(this.activeViewOptions.group.headerTooltipTemplate),this.eventTooltipTemplateFn=this.templateParser(this.eventSettings.tooltipTemplate),this.editorTemplateFn=this.templateParser(this.editorTemplate),this.editorHeaderTemplateFn=this.templateParser(this.editorHeaderTemplate),this.editorFooterTemplateFn=this.templateParser(this.editorFooterTemplate),this.quickInfoTemplatesHeaderFn=this.templateParser(this.quickInfoTemplates.header),this.quickInfoTemplatesContentFn=this.templateParser(this.quickInfoTemplates.content),this.quickInfoTemplatesFooterFn=this.templateParser(this.quickInfoTemplates.footer)},v.prototype.initializePopups=function(){this.eventWindow=new mo(this),this.quickPopup=new as(this)},v.prototype.getDayNames=function(e){for(var t=[],i="",n=B.isNullOrUndefined(this.locale)||"en"===this.locale||"en-US"===this.locale?B.getValue((i="days.stand-alone.")+e,B.getDefaultDateObject(this.getCalendarMode())):(i="main."+this.locale+".dates.calendars."+this.getCalendarMode()+".days.format."+e,B.getValue(i,B.cldrData)),r=0,a=Object.keys(n);r<a.length;r++){var s=a[r];t.push(B.getValue(s,n))}return t},v.prototype.setCldrTimeFormat=function(){B.isNullOrUndefined(this.timeFormat)?B.isNullOrUndefined(this.locale)||"en"===this.locale||"en-US"===this.locale?this.internalTimeFormat=B.getValue("timeFormats.short",B.getDefaultDateObject(this.getCalendarMode())):this.internalTimeFormat=B.getValue("main."+this.locale+".dates.calendars."+this.getCalendarMode()+".timeFormats.short",B.cldrData):this.internalTimeFormat=this.timeFormat},v.prototype.getCalendarMode=function(){return B.isNullOrUndefined(this.calendarMode)?"gregorian":this.calendarMode.toLowerCase()},v.prototype.getTimeString=function(e){return this.globalize.formatDate(e,{format:this.activeViewOptions.timeFormat,type:"time",calendar:this.getCalendarMode()}).toLocaleUpperCase()},v.prototype.getDateTime=function(e){return e instanceof Date?new Date(e.getTime()):new Date(e)},v.prototype.setCalendarMode=function(){"Islamic"===this.calendarMode?this.calendarUtil=new $r:this.calendarUtil=new Zr},v.prototype.changeView=function(i,n,e,t){var r,a,s=this;B.isNullOrUndefined(t)&&(t=this.getViewIndex(i)),!e&&t===this.viewIndex&&this.currentView===i||t<0||(r=this.activeViewOptions?this.activeViewOptions.option:this.currentView,this.trigger(Q,{requestType:"viewNavigate",cancel:!1,event:n},function(e){e.cancel?s.currentView=r:(e={action:"view",cancel:!1,currentDate:s.selectedDate,previousView:r,currentView:i,viewIndex:t},s.trigger(J,e,function(e){var t;e.cancel?s.currentView=r:(t=-1<["Day","Week","WorkWeek"].indexOf(i)&&["Day","Week","WorkWeek"].indexOf(r)<0,s.uiStateValues.isInitial=t||-1<i.indexOf("Timeline")||-1<i.indexOf("Year"),s.uiStateValues.top=-1<i.indexOf("Timeline")&&r.indexOf("Timeline")<0?0:s.uiStateValues.top,s.viewIndex=e.viewIndex,s.setProperties({currentView:i},!0),s.headerModule&&(s.headerModule.updateActiveView(),s.headerModule.setCalendarDate(s.selectedDate),s.headerModule.setCalendarView()),s.initializeView(s.currentView),s.animateLayout(),a={requestType:"viewNavigate",cancel:!1,event:n},s.trigger(K,a))}))}))},v.prototype.changeDate=function(t,i){var n,r=this;this.trigger(Q,{requestType:"dateNavigate",cancel:!1,event:i},function(e){e.cancel||(e={action:"date",cancel:!1,previousDate:r.selectedDate,currentDate:t},r.trigger(J,e,function(e){e.cancel||(r.uiStateValues.isInitial=r.activeView.isTimelineView()&&"TimelineYear"!==r.currentView,r.validateDate(e.currentDate),r.headerModule&&r.headerModule.setCalendarDate(e.currentDate),"MonthAgenda"===r.currentView&&r.monthAgendaModule&&(r.monthAgendaModule.monthAgendaDate=new Date(""+r.selectedDate)),r.initializeView(r.currentView),r.animateLayout(),n={requestType:"dateNavigate",cancel:!1,event:i},r.trigger(K,n))}))})},v.prototype.isMinMaxDate=function(e){void 0===e&&(e=this.selectedDate);var t=B.isNullOrUndefined(this.maxDate)?new Date(2099,11,31):this.maxDate,i=B.isNullOrUndefined(this.minDate)?new Date(1900,0,1):this.minDate;return e.getTime()>=i.getTime()&&e.getTime()<=t.getTime()},v.prototype.isSelectedDate=function(e){return e.setHours(0,0,0,0)===new Date(""+this.selectedDate).setHours(0,0,0,0)},v.prototype.getCurrentTime=function(e){return void 0===e&&(e=new Date),this.timezone?this.tzModule.convert(e,this.tzModule.getLocalTimezoneName(),this.timezone):e},v.prototype.getNavigateView=function(){return this.activeView.isTimelineView()?"TimelineMonth"===this.currentView||"TimelineYear"===this.currentView?"TimelineDay":"Agenda":"Day"},v.prototype.animateLayout=function(){this.activeView.element&&new B.Animation({duration:600,name:"FadeIn",timingFunction:"easeIn"}).animate(this.activeView.element)},v.prototype.requiredModules=function(){var e=[];this.setViewOptions(!0);for(var t=0,i=Object.keys(this.viewOptions);t<i.length;t++){var n=i[t];e.push({member:"timelineDay"===n||"timelineWeek"===n||"timelineWorkWeek"===n?"timelineViews":n,args:[this]})}return this.allowDragAndDrop&&e.push({member:"dragAndDrop",args:[this]}),this.allowResizing&&e.push({member:"resize",args:[this]}),e.push({member:"excelExport",args:[this]}),e.push({member:"iCalendarExport",args:[this]}),e.push({member:"iCalendarImport",args:[this]}),e.push({member:"print",args:[this]}),e},v.prototype.preRender=function(){this.isAdaptive=B.Browser.isDevice||dt(),this.globalize=new B.Internationalization(this.locale),this.tzModule=new ta,(this&&B.isNullOrUndefined(this.uiStateValues)||!this.enablePersistence)&&(this.uiStateValues={expand:!1,isInitial:!0,left:0,top:0,isGroupAdaptive:!1,isIgnoreOccurrence:!1,groupIndex:this.adaptiveGroupIndex,action:!1,isBlock:!1,isCustomMonth:!0,isPreventTimezone:!1,isTransformed:!1}),this.currentTimezoneDate=this.getCurrentTime(),this.activeCellsData={startTime:new Date(this.currentTimezoneDate),endTime:new Date(this.currentTimezoneDate),isAllDay:!1},this.activeEventData={event:void 0,element:void 0},this.getDefaultLocale(),this.localeObj=new B.L10n(this.getModuleName(),this.defaultLocale,this.locale),this.setCldrTimeFormat(),this.setCalendarMode(),this.eventsData=[],this.eventsProcessed=[],this.blockData=[],this.blockProcessed=[],this.resourceCollection=[],this.currentAction=null,this.selectedElements=[],this.activeEventTemplates=[],this.setViewOptions()},v.prototype.getDefaultLocale=function(){this.defaultLocale={day:"Day",week:"Week",workWeek:"Work Week",month:"Month",year:"Year",agenda:"Agenda",weekAgenda:"Week Agenda",workWeekAgenda:"Work Week Agenda",monthAgenda:"Month Agenda",today:"Today",noEvents:"No events",emptyContainer:"There are no events scheduled on this day.",allDay:"All day",start:"Start",end:"End",more:"more",close:"Close",cancel:"Cancel",noTitle:"(No Title)",delete:"Delete",deleteEvent:"Delete Event",deleteMultipleEvent:"Delete Multiple Events",selectedItems:"Items selected",deleteSeries:"Entire Series",edit:"Edit",editSeries:"Entire Series",editEvent:"Edit Event",createEvent:"Create",subject:"Subject",addTitle:"Add title",moreDetails:"More Details",moreEvents:"More Events",save:"Save",editContent:"How would you like to change the appointment in the series?",deleteContent:"Are you sure you want to delete this event?",deleteMultipleContent:"Are you sure you want to delete the selected events?",newEvent:"New Event",title:"Title",location:"Location",description:"Description",timezone:"Timezone",startTimezone:"Start Timezone",endTimezone:"End Timezone",repeat:"Repeat",saveButton:"Save",cancelButton:"Cancel",deleteButton:"Delete",recurrence:"Recurrence",wrongPattern:"The recurrence pattern is not valid.",seriesChangeAlert:"Do you want to cancel the changes made to specific instances of this series and match it to the whole series again?",createError:"The duration of the event must be shorter than how frequently it occurs. Shorten the duration, or change the recurrence pattern in the recurrence event editor.",sameDayAlert:"Two occurrences of the same event cannot occur on the same day.",occurenceAlert:"Cannot reschedule an occurrence of the recurring appointment if it skips over a later occurrence of the same appointment.",editRecurrence:"Edit Recurrence",recurringEvent:"Recurring Event",repeats:"Repeats",alert:"Alert",startEndError:"The selected end date occurs before the start date.",invalidDateError:"The entered date value is invalid.",blockAlert:"Events cannot be scheduled within the blocked time range.",overlapAlert:"Events cannot be scheduled during the chosen time as it overlaps with another event.",ok:"Ok",yes:"Yes",no:"No",of:"of",occurrence:"Occurrence",series:"Series",previous:"Previous",next:"Next",timelineDay:"Timeline Day",timelineWeek:"Timeline Week",timelineWorkWeek:"Timeline Work Week",timelineMonth:"Timeline Month",timelineYear:"Timeline Year",editFollowingEvent:"Following Events",deleteTitle:"Delete Event",editTitle:"Edit Event",beginFrom:"Begin From",endAt:"Ends At",expandAllDaySection:"Expand-all-day-section",collapseAllDaySection:"Collapse-all-day-section",searchTimezone:"Search Timezone",noRecords:"No records found"}},v.prototype.wireEvents=function(){B.EventHandler.add(window,"resize",this.onScheduleResize,this),B.EventHandler.add(window,"orientationchange",this.onScheduleResize,this),B.EventHandler.add(document,B.Browser.touchStartEvent,this.onDocumentClick,this),this.allowClipboard&&B.EventHandler.add(document,"paste",this.onDocumentPaste,this)},v.prototype.removeSelectedClass=function(){for(var e=this.getSelectedCells(),t=0,i=e;t<i.length;t++)i[t].removeAttribute("tabindex");B.removeClass(e,di),this.keyboardInteractionModule&&0<this.keyboardInteractionModule.selectedCells.length&&(this.keyboardInteractionModule.selectedCells=[])},v.prototype.addSelectedClass=function(e,t,i){B.addClass(e,di),t&&(t.setAttribute("tabindex","0"),t.focus({preventScroll:i||!1}))},v.prototype.selectCell=function(e){this.removeSelectedClass(),this.addSelectedClass([e],e)},v.prototype.getAllDayRow=function(){return this.element.querySelector("."+Ot)},v.prototype.getContentTable=function(){return this.activeView.element.querySelector("."+C+" tbody")},v.prototype.getTableRows=function(){return[].slice.call(this.element.querySelectorAll("."+C+" tbody tr:not(."+fr+")"))},v.prototype.getWorkCellElements=function(){return[].slice.call(this.element.querySelectorAll("."+O))},v.prototype.getIndexOfDate=function(e,t){return e.map(Number).indexOf(+t)},v.prototype.isAllDayCell=function(e){return!(!(-1<["Month","TimelineMonth","TimelineYear","MonthAgenda"].indexOf(this.currentView)||e.classList.contains(w)||e.classList.contains(It))&&this.activeViewOptions.timeScale.enable&&!(this.activeView.isTimelineView()&&0<this.activeViewOptions.headerRows.length&&"Hour"!==this.activeViewOptions.headerRows.slice(-1)[0].option))},v.prototype.getDateFromElement=function(e){var t;if(B.isNullOrUndefined(e)||(t=e.getAttribute("data-date")),!B.isNullOrUndefined(t))return e=parseInt(t,10),new Date(e)},v.prototype.getTargetElement=function(e,t,i){var n,t=document.elementFromPoint(t,i);return(n=t?t.closest(e):n)?[n]:null},v.prototype.getCellHeaderTemplate=function(){return this.cellHeaderTemplateFn},v.prototype.getDayHeaderTemplate=function(){return this.dayHeaderTemplateFn},v.prototype.getMonthHeaderTemplate=function(){return this.monthHeaderTemplateFn},v.prototype.getCellTemplate=function(){return this.cellTemplateFn},v.prototype.getDateHeaderTemplate=function(){return this.dateHeaderTemplateFn},v.prototype.getDateRangeTemplate=function(){return this.dateRangeTemplateFn},v.prototype.getMajorSlotTemplate=function(){return this.majorSlotTemplateFn},v.prototype.getMinorSlotTemplate=function(){return this.minorSlotTemplateFn},v.prototype.getAppointmentTemplate=function(){return this.appointmentTemplateFn},v.prototype.getEventTooltipTemplate=function(){return this.eventTooltipTemplateFn},v.prototype.getHeaderTooltipTemplate=function(){return this.headerTooltipTemplateFn},v.prototype.getEditorTemplate=function(){return this.editorTemplateFn},v.prototype.getEditorHeaderTemplate=function(){return this.editorHeaderTemplateFn},v.prototype.getEditorFooterTemplate=function(){return this.editorFooterTemplateFn},v.prototype.getQuickInfoTemplatesHeader=function(){return this.quickInfoTemplatesHeaderFn},v.prototype.getQuickInfoTemplatesContent=function(){return this.quickInfoTemplatesContentFn},v.prototype.getQuickInfoTemplatesFooter=function(){return this.quickInfoTemplatesFooterFn},v.prototype.getResourceHeaderTemplate=function(){return this.resourceHeaderTemplateFn},v.prototype.getHeaderIndentTemplate=function(){return this.headerIndentTemplateFn},v.prototype.getCssProperties=function(){return{border:this.enableRtl?"borderLeftWidth":"borderRightWidth",padding:this.enableRtl?"paddingLeft":"paddingRight",rtlBorder:this.enableRtl?"borderRightWidth":"borderLeftWidth",rtlPadding:this.enableRtl?"paddingRight":"paddingLeft"}},v.prototype.removeNewEventElement=function(){var e=this.element.querySelector("."+zi);B.isNullOrUndefined(e)||B.remove(e)},v.prototype.getStartEndTime=function(e){var t;return B.isNullOrUndefined(e)||""===e?null:(t=z(new Date(this.currentTimezoneDate)||this.getCurrentTime()),2===(e=e.split(":")).length&&t.setHours(parseInt(e[0],10),parseInt(e[1],10),0),t)},v.prototype.onDocumentClick=function(e){this.notify(Re,{event:e})},v.prototype.onDocumentPaste=function(e){this.notify(He,{event:e})},v.prototype.onScheduleResize=function(){var e,t;B.isNullOrUndefined(this.activeView)||(this.isAdaptive||ht())&&document.activeElement&&(document.activeElement.classList.contains(Gn)||document.activeElement.classList.contains(Pr))||this.uiStateValues.isTapHold||(this.virtualScrollModule&&this.activeView.isTimelineView()&&this.virtualScrollModule.refreshLayout(),this.activeViewOptions.timeScale.enable&&this.activeView&&this.activeView.highlightCurrentTime(),this.quickPopup&&this.quickPopup.onClosePopup(),at(),"Month"===this.currentView||"Agenda"!==this.currentView&&"MonthAgenda"!==this.currentView&&!this.activeViewOptions.timeScale.enable||this.activeView.isTimelineView()?(this.activeView.resetColWidth(),this.notify(Me,{cssProperties:this.getCssProperties(),isPreventScrollUpdate:!0}),e=!1,this.activeViewOptions.enableLazyLoading&&this.virtualScrollModule&&this.virtualScrollModule.isRemoteRefresh&&(e=this.virtualScrollModule.isRemoteRefresh,this.virtualScrollModule.isRemoteRefresh=!1),this.refreshEvents(e),this.virtualScrollModule&&!this.virtualScrollModule.enableTransition&&(e=this.element.querySelector("."+Wt),t=this.element.querySelector("."+A),this.virtualScrollModule.enableTransition=!0,B.addClass([t,e],"e-transition"))):this.notify(Ve,{}))},v.prototype.templateParser=function(t){if(t)try{return"function"!=typeof t&&document.querySelectorAll(t).length?B.compile(document.querySelector(t).innerHTML.trim()):B.compile(t)}catch(e){return B.compile(t)}},v.prototype.getSelectedCells=function(){return[].slice.call(this.element.querySelectorAll("."+di))},v.prototype.getAnnouncementString=function(e,t){this.quickPopup&&0<this.activeViewOptions.group.resources.length&&(i=this.quickPopup.getResourceText({event:e},"event")+'"s event - ');var i,t=t||e[this.eventFields.subject]||this.eventSettings.fields.subject.default,n=e[this.eventFields.location]||this.eventSettings.fields.location.default,r=this.globalize.formatDate(e[this.eventFields.startTime],{type:"dateTime",skeleton:"full",calendar:this.getCalendarMode()}),a=this.globalize.formatDate(e[this.eventFields.endTime],{type:"dateTime",skeleton:"full",calendar:this.getCalendarMode()}),t=t+" "+this.localeObj.getConstant("beginFrom")+" "+r+" "+this.localeObj.getConstant("endAt")+" "+a;return i&&(t=i+" "+t),n&&""!==n&&(t=t+" "+this.localeObj.getConstant("location")+" "+n),t=e[this.eventFields.recurrenceRule]&&""!==e[this.eventFields.recurrenceRule]&&e[this.eventFields.id]===e[this.eventFields.recurrenceID]?t+" "+this.localeObj.getConstant("recurringEvent"):t},v.prototype.boundaryValidation=function(e,t){var i={left:!1,right:!1,top:!1,bottom:!1},n=this.element.querySelector("."+A).getBoundingClientRect();return e<n.top+30+window.pageYOffset&&e>n.top+window.pageYOffset&&(i.top=!0),e>n.bottom-30+window.pageYOffset&&e<n.bottom+window.pageYOffset&&(i.bottom=!0),t<n.left+30+window.pageXOffset&&t>n.left+window.pageXOffset&&(i.left=!0),t>n.right-30+window.pageXOffset&&t<n.right+window.pageXOffset&&(i.right=!0),i},v.prototype.getWeekNumberContent=function(e){var t,i,n;return"FirstDay"===this.weekRule?(t=Be(e.slice(-1)[0],this.firstDayOfWeek),t=this.globalize.formatNumber(Ye(t))):"FirstFourDayWeek"===this.weekRule?(i=_e(n=Ue(e.slice(-1)[0],this.firstDayOfWeek),Be(e.slice(-1)[0],this.firstDayOfWeek)),t=this.globalize.formatNumber(Ye(i))):"FirstFullWeek"===this.weekRule&&(n=Ue(e.slice(-1)[0],this.firstDayOfWeek),t=this.globalize.formatNumber(Ye(n))),t},v.prototype.renderHeaderIndentTemplate=function(e,t){var i;this.activeViewOptions.headerIndentTemplate&&(i=this.element.id+"_"+this.activeViewOptions.headerIndentTemplateName+"headerIndentTemplate",e=[].slice.call(this.getHeaderIndentTemplate()(e,this,"headerIndentTemplate",i,!1,void 0,void 0,this.root)),B.append(e,t))},v.prototype.isSpecificResourceEvents=function(){return 0<this.activeViewOptions.group.resources.length&&!this.activeViewOptions.group.allowGroupEdit&&!this.rowAutoHeight&&!this.virtualScrollModule&&this.activeViewOptions.group.byGroupID},v.prototype.unWireEvents=function(){B.EventHandler.remove(window,"resize",this.onScheduleResize),B.EventHandler.remove(window,"orientationchange",this.onScheduleResize),B.EventHandler.remove(document,B.Browser.touchStartEvent,this.onDocumentClick),B.EventHandler.remove(document,"paste",this.onDocumentPaste)},v.prototype.getModuleName=function(){return"schedule"},v.prototype.getPersistData=function(){return this.addOnPersist(["currentView","selectedDate","scrollTop","scrollLeft","adaptiveGroupIndex"])},v.prototype.onPropertyChanged=function(e,t){if(!this.isReact||!B.isNullOrUndefined(this.activeView)){for(var i={isRefresh:!1,isResource:!1,isDate:!1,isView:!1,isLayout:!1,isDataManager:!1},n=0,r=Object.keys(e);n<r.length;n++){var a=r[n];switch(a){case"views":this.setViewOptions(),this.headerModule&&this.headerModule.updateItems(),i.isView=!0;break;case"currentView":i.isView=!0;break;case"minDate":case"maxDate":case"selectedDate":i.isDate=!0;break;case"dateFormat":this.activeViewOptions=this.getActiveViewOptions(),this.headerModule&&this.headerModule.updateDateRange();break;case"showHeaderBar":case"toolbarItems":this.destroyHeaderModule(),e.showHeaderBar&&(this.headerModule=new Br(this),this.headerModule.updateDateRange()),this.notify(Me,{cssProperties:this.getCssProperties()}),this.activeView.isTimelineView()&&this.refreshEvents(!1);break;case"workDays":JSON.stringify(t.workDays)!==JSON.stringify(e.workDays)&&(i.isLayout=!0);break;case"showWeekend":case"startHour":case"endHour":case"workHours":case"readonly":case"headerRows":case"showWeekNumber":case"rowAutoHeight":i.isLayout=!0;break;case"locale":case"calendarMode":this.globalize=new B.Internationalization(this.locale),this.localeObj=new B.L10n(this.getModuleName(),this.defaultLocale,this.locale),this.setCldrTimeFormat(),this.setCalendarMode(),i.isRefresh=!0;break;case"firstDayOfWeek":this.activeViewOptions.firstDayOfWeek=e.firstDayOfWeek,this.eventWindow&&this.eventWindow.refreshRecurrenceEditor(),i.isLayout=!0;break;case"showTimeIndicator":this.activeViewOptions.timeScale.enable&&this.activeView&&this.activeView.highlightCurrentTime();break;case"cellHeaderTemplate":this.activeViewOptions.cellHeaderTemplate=e.cellHeaderTemplate,this.cellHeaderTemplateFn=this.templateParser(this.activeViewOptions.cellHeaderTemplate),i.isLayout=!0;break;case"cellTemplate":this.activeViewOptions.cellTemplate=e.cellTemplate,this.cellTemplateFn=this.templateParser(this.activeViewOptions.cellTemplate),i.isLayout=!0;break;case"dateHeaderTemplate":this.activeViewOptions.dateHeaderTemplate=e.dateHeaderTemplate,this.dateHeaderTemplateFn=this.templateParser(this.activeViewOptions.dateHeaderTemplate),i.isLayout=!0;break;case"dateRangeTemplate":this.activeViewOptions.dateRangeTemplate=e.dateRangeTemplate,this.dateRangeTemplateFn=this.templateParser(this.activeViewOptions.dateRangeTemplate),this.headerModule&&this.headerModule.updateDateRange();break;case"dayHeaderTemplate":this.activeViewOptions.dayHeaderTemplate=e.dayHeaderTemplate,this.dayHeaderTemplateFn=this.templateParser(this.activeViewOptions.dayHeaderTemplate),i.isLayout=!0;break;case"monthHeaderTemplate":this.activeViewOptions.monthHeaderTemplate=e.monthHeaderTemplate,this.monthHeaderTemplateFn=this.templateParser(this.activeViewOptions.monthHeaderTemplate),i.isLayout=!0;break;case"resourceHeaderTemplate":this.activeViewOptions.resourceHeaderTemplate=e.resourceHeaderTemplate,this.resourceHeaderTemplateFn=this.templateParser(this.activeViewOptions.resourceHeaderTemplate),i.isLayout=!0;break;case"timezone":this.eventBase.timezonePropertyChange(t.timezone),this.headerModule&&this.headerModule.setCalendarTimezone();break;case"enableRtl":this.setRtlClass(),i.isRefresh=!0;break;default:this.extendedPropertyChange(a,e,t,i)}}this.propertyChangeAction(i)}},v.prototype.propertyChangeAction=function(e){e.isRefresh?this.refresh():e.isResource?this.initializeResources(!0):e.isView?this.changeView(this.currentView,null,!0):e.isDate?(B.isNullOrUndefined(this.selectedDate)&&this.setProperties({selectedDate:this.getCurrentTime()},!0),this.changeDate(this.selectedDate)):e.isLayout?(this.activeCellsData=null,this.initializeView(this.currentView)):e.isDataManager&&this.crudModule&&(this.dragAndDropModule&&(this.dragAndDropModule.actionObj.action="",B.removeClass([this.element],Wi)),this.crudModule.refreshDataManager())},v.prototype.allDayRowScrollUpdate=function(){var e=this.element.querySelector("."+Vt),t=this.element.querySelector("."+Ot);"auto"!==this.height&&this.enableAllDayScroll?(e.classList.contains(Fr)&&B.removeClass([e],Fr),this.eventBase.allDayExpandScroll(e)):(B.addClass([e],Fr),e.classList.contains(qr)&&B.removeClass([e],qr),this.uiStateValues.expand&&((e=[].slice.call(this.element.querySelectorAll("."+w)))[0].style.height=t.style.height||e[1].style.height)),this.uiStateValues.expand||(t.style.height="")},v.prototype.extendedPropertyChange=function(e,t,i,n){switch(e){case"width":case"height":case"enableAllDayScroll":-1<["Day","Week","WorkWeek"].indexOf(this.currentView)&&this.allDayRowScrollUpdate(),this.notify(ke,{module:"scroll",properties:{width:t.width,height:t.height}});break;case"cssClass":i.cssClass&&B.removeClass([this.element],i.cssClass.split(" ")),t.cssClass&&B.addClass([this.element],t.cssClass.split(" "));break;case"hideEmptyAgendaDays":case"agendaDaysCount":this.activeViewOptions=this.getActiveViewOptions(),n.isView=!0;break;case"eventSettings":this.onEventSettingsPropertyChanged(t.eventSettings,i.eventSettings,n);break;case"allowKeyboardInteraction":case"allowClipboard":this.keyboardInteractionModule&&(this.keyboardInteractionModule.destroy(),this.keyboardInteractionModule=null),(t.allowKeyboardInteraction||t.allowClipboard)&&(this.keyboardInteractionModule=new Xr(this)),"allowClipboard"===e&&(t.allowClipboard?B.EventHandler.add(document,"paste",this.onDocumentPaste,this):B.EventHandler.remove(document,"paste",this.onDocumentPaste));break;case"timezoneDataSource":this.eventWindow&&this.eventWindow.refresh();break;case"editorTemplate":B.isNullOrUndefined(this.editorTemplate)||(this.editorTemplateFn=this.templateParser(this.editorTemplate)),this.eventWindow&&this.eventWindow.setDialogContent();break;case"editorHeaderTemplate":B.isNullOrUndefined(this.editorHeaderTemplate)||(this.editorHeaderTemplateFn=this.templateParser(this.editorHeaderTemplate)),this.eventWindow&&this.eventWindow.setDialogHeader();break;case"editorFooterTemplate":B.isNullOrUndefined(this.editorFooterTemplate)||(this.editorFooterTemplateFn=this.templateParser(this.editorFooterTemplate)),this.eventWindow&&this.eventWindow.setDialogFooter();break;case"quickInfoTemplates":this.quickInfoTemplates.header&&(this.quickInfoTemplatesHeaderFn=this.templateParser(this.quickInfoTemplates.header)),this.quickInfoTemplates.content&&(this.quickInfoTemplatesContentFn=this.templateParser(this.quickInfoTemplates.content)),this.quickInfoTemplates.footer&&(this.quickInfoTemplatesFooterFn=this.templateParser(this.quickInfoTemplates.footer));break;case"group":this.onGroupSettingsPropertyChanged(t.group,i.group,n);break;case"resources":n.isResource=!0;break;case"timeScale":this.activeViewOptions.timeScale.interval=t.timeScale.interval||this.activeViewOptions.timeScale.interval,this.activeViewOptions.timeScale.slotCount=t.timeScale.slotCount||this.activeViewOptions.timeScale.slotCount,this.eventWindow&&this.eventWindow.refreshDateTimePicker(),n.isLayout=!0;break;case"allowDragAndDrop":case"allowResizing":case"eventDragArea":case"allowOverlap":this.refreshEvents(!1);break;case"weekRule":n.isLayout=!0;break;case"firstMonthOfYear":this.activeViewOptions.firstMonthOfYear=t.firstMonthOfYear,this.viewIndex=this.activeView.viewIndex,n.isLayout=!0;break;case"monthsCount":this.activeViewOptions.monthsCount=t.monthsCount,this.viewIndex=this.activeView.viewIndex,n.isLayout=!0;break;case"timeFormat":this.internalTimeFormat=t.timeFormat||this.activeViewOptions.timeFormat,this.eventWindow&&this.eventWindow.refreshDateTimePicker(),n.isLayout=!0;break;case"enableAdaptiveUI":this.showHeaderBar&&this.headerModule&&(this.destroyHeaderModule(),this.headerModule=new Br(this),this.headerModule.updateDateRange()),n.isLayout=!0;break;case"headerIndentTemplate":this.activeViewOptions.headerIndentTemplate=t.headerIndentTemplate,this.headerIndentTemplateFn=this.templateParser(this.activeViewOptions.headerIndentTemplate),n.isLayout=!0}},v.prototype.setRtlClass=function(){this.enableRtl?B.addClass([this.element],"e-rtl"):B.removeClass([this.element],"e-rtl")},v.prototype.onGroupSettingsPropertyChanged=function(e,t,i){for(var n=0,r=Object.keys(e);n<r.length;n++)"headerTooltipTemplate"===r[n]?this.headerTooltipTemplateFn=this.templateParser(e.headerTooltipTemplate):(i.isLayout=!0,this.eventWindow&&this.eventWindow.refresh())},v.prototype.onEventSettingsPropertyChanged=function(e,t,i){for(var n=0,r=Object.keys(e);n<r.length;n++)switch(r[n]){case"dataSource":case"query":case"fields":case"includeFiltersInQuery":this.initializeDataModule(),i.isDataManager=!0;break;case"template":this.activeViewOptions.eventTemplate=e.template,this.appointmentTemplateFn=this.templateParser(this.activeViewOptions.eventTemplate),i.isDataManager=!0;break;case"enableTooltip":this.eventTooltip&&(this.eventTooltip.destroy(),this.eventTooltip=null),e.enableTooltip&&(this.eventTooltip=new ss(this));break;case"tooltipTemplate":this.eventTooltipTemplateFn=this.templateParser(this.eventSettings.tooltipTemplate);break;case"resourceColorField":this.resourceBase&&this.resourceBase.setResourceCollection(),i.isDataManager=!0;break;case"editFollowingEvents":this.quickPopup&&this.quickPopup.refreshQuickDialog();break;case"allowAdding":case"allowEditing":case"allowDeleting":this.showHeaderBar&&this.headerModule&&this.headerModule.updateAddIcon(),this.eventWindow&&this.eventWindow.refresh();break;case"spannedEventPlacement":case"minimumEventDuration":case"enableMaxHeight":case"enableIndicator":this.refreshEvents(!1);break;case"ignoreWhitespace":i.isLayout=!0}},v.prototype.destroyHeaderModule=function(){this.headerModule&&(this.headerModule.destroy(),this.headerModule=null)},v.prototype.destroyPopups=function(){this.quickPopup&&(this.quickPopup.destroy(),this.quickPopup=null),this.eventWindow&&(this.eventWindow.destroy(),this.eventWindow=null)},v.prototype.showSpinner=function(){M.showSpinner(this.element)},v.prototype.hideSpinner=function(){M.hideSpinner(this.element)},v.prototype.setWorkHours=function(e,t,i,n){e=this.getWorkHourCells(e,t,i,n);B.addClass(e,Et)},v.prototype.resetWorkHours=function(e,t,i,n){(e=void 0===e?this.activeView.renderDates:e)&&t&&i?(e=this.getWorkHourCells(e,t,i,n),B.removeClass(e,Et)):(t=[].slice.call(this.element.querySelectorAll("."+Et)),B.removeClass(t,Et))},v.prototype.getWorkHourCells=function(e,t,i,n){if(-1<["Agenda","MonthAgenda","Month","TimelineMonth"].indexOf(this.currentView))return[];var t=this.getStartEndTime(t),i=this.getStartEndTime(i),r=this.getContentTable();if(B.isNullOrUndefined(t)||B.isNullOrUndefined(i)||!r)return[];t.setMilliseconds(0),i.setMilliseconds(0);var a=this.activeView.getStartHour(),s=(t<a&&(t=a),this.activeView.getEndHour());s<i&&(i=s);for(var o=this.activeViewOptions.timeScale.interval*je/this.activeViewOptions.timeScale.slotCount,l=(a.getTimezoneOffset()-t.getTimezoneOffset())*je,p=Math.abs((a.getTimezoneOffset()-i.getTimezoneOffset())*je),c=m=Math.round((t.getTime()-a.getTime()+l)/o),h=v=Math.ceil((i.getTime()-a.getTime()-p)/o),d=[],u=0,g=e;u<g.length;u++){var m,v,f=g[u],y=(z(f=this.getDateTime(f)),this.activeView.renderDates),T=(B.isNullOrUndefined(n)||!this.resourceBase||this.activeView.isTimelineView()||(y=this.resourceBase.lastResourceLevel[parseInt(n.toString(),10)].renderDates),this.getIndexOfDate(y,f));if(0<=T){this.activeView.isTimelineView()&&(m=c+T*(y=Math.round((s.getTime()-a.getTime())/o)),v=h+T*y);for(var w,D,b=m;b<v;b++)this.activeView.isTimelineView()?(w=B.isNullOrUndefined(n)?0:n,d.push(r.rows[parseInt(w.toString(),10)].cells[parseInt(b.toString(),10)])):B.isNullOrUndefined(n)?d.push(r.rows[parseInt(b.toString(),10)].cells[parseInt(T.toString(),10)]):(w="."+O+'[data-group-index="'+n+'"]',D=[].slice.call(r.rows[parseInt(b.toString(),10)].querySelectorAll(w)),d.push(D[parseInt(T.toString(),10)]))}}return d},v.prototype.getCellDetails=function(e){var t,i,n=e instanceof Array?e:[e],r=B.getElement(n[0]),n=B.getElement(n.slice(-1)[0]),a=this.getDateFromElement(r),s=this.getDateFromElement(n);if(!B.isNullOrUndefined(a)&&!B.isNullOrUndefined(s))return t=(i=this.activeView.isTimelineView()&&!B.isNullOrUndefined(n.getAttribute("colSpan"))&&0<this.headerRows.length)?parseInt(n.getAttribute("colSpan"),10):1,a={startTime:a,endTime:s=!this.activeViewOptions.timeScale.enable||i||n.classList.contains(w)||n.classList.contains(It)?Y(new Date(s.getTime()),t):this.activeView.getEndDateFromStartDate(s),isAllDay:this.isAllDayCell(r),element:e},i=r.getAttribute("data-group-index"),B.isNullOrUndefined(i)||(a.groupIndex=parseInt(i,10)),a},v.prototype.getSelectedElements=function(){return this.keyboardInteractionModule&&0<this.keyboardInteractionModule.selectedCells.length?this.keyboardInteractionModule.selectedCells:this.getSelectedCells()},v.prototype.getResourceCollections=function(){return this.resourceCollection},v.prototype.setResourceCollections=function(e,t){!(t=void 0===t?!0:t)&&this.uiStateValues&&(this.uiStateValues.isPreventEventRefresh=!0),this.setProperties({resources:e},!1)},v.prototype.changeCurrentView=function(e,t){var i=this.getViewIndex(e),n=e.charAt(0).toLowerCase()+e.slice(1),n=this.viewOptions[""+n];-1!==(i=n?this.viewCollections.indexOf(n[t||0]):i)&&i!==this.viewIndex&&this.changeView(e,null,null,i)},v.prototype.getCurrentViewIndex=function(){return this.viewIndex},v.prototype.getResourcesByIndex=function(e){var t,i;return!this.resourceBase||!this.resourceBase.lastResourceLevel||e<0||e>=this.resourceBase.lastResourceLevel.length?void 0:(t=this.resourceBase.lastResourceLevel[parseInt(e.toString(),10)],this.resourceBase.setResourceValues(i={},e),{resource:t.resource,resourceData:t.resourceData,groupData:i})},v.prototype.expandResource=function(e,t){this.activeView.isTimelineView()&&this.resourceBase&&1<this.resourceCollection.length&&this.resourceBase.resourceExpand(e,t,!1)},v.prototype.collapseResource=function(e,t){this.activeView.isTimelineView()&&this.resourceBase&&1<this.resourceCollection.length&&this.resourceBase.resourceExpand(e,t,!0)},v.prototype.scrollTo=function(e,t){this.currentView.indexOf("Agenda")<0&&B.isNullOrUndefined(this.element.querySelector(".e-work-cells"))||(this.activeView.scrollToDate&&B.isNullOrUndefined(e)&&t?this.activeView.scrollToDate(t):this.activeView.scrollToHour&&this.activeView.scrollToHour(e,t))},v.prototype.scrollToResource=function(e,t){this.resourceBase&&this.resourceBase.lastResourceLevel&&this.resourceBase.resourceScroll(e,t)},v.prototype.exportToICalendar=function(e,t){if(!this.iCalendarExportModule)throw console.warn('[WARNING] :: Module "ICalendarExport" is not available in Schedule component! You either misspelled the module name or forgot to load it.'),Error("Inject ICalendarExport module");this.iCalendarExportModule.initializeCalendarExport(e,t)},v.prototype.importICalendar=function(e){if(!this.iCalendarImportModule)throw console.warn('[WARNING] :: Module "ICalendarImport" is not available in Schedule component! You either misspelled the module name or forgot to load it.'),Error("Inject ICalendarImport module");this.iCalendarImportModule.initializeCalendarImport(e)},v.prototype.addEvent=function(e){this.crudModule.addEvent(e)},v.prototype.generateEventOccurrences=function(e,t){return this.eventBase?this.eventBase.generateOccurrence(e,t):[]},v.prototype.exportToExcel=function(e){if(!this.excelExportModule)throw console.warn('[WARNING] :: Module "ExcelExport" is not available in Schedule component! You either misspelled the module name or forgot to load it.'),Error("Inject ExcelExport module");this.excelExportModule.initializeExcelExport(e)},v.prototype.print=function(e){if(!this.printModule)throw console.warn('[WARNING] :: Module "Print" is not available in Schedule component! You either misspelled the module name or forgot to load it.'),Error("Inject Print module");this.printModule.print(e)},v.prototype.saveEvent=function(e,t){this.crudModule.saveEvent(e,t)},v.prototype.deleteEvent=function(e,t){this.crudModule.deleteEvent(e,t)},v.prototype.getEvents=function(e,t,i){var n=[],n=i?this.eventBase.getProcessedEvents():this.eventsData;return e=e&&this.getDateTime(e),t=t&&this.getDateTime(t),n=this.eventBase.filterEventsByRange(n,e,t)},v.prototype.getBlockEvents=function(e,t,i){var n=[],n=i?this.eventBase.getProcessedEvents(this.blockData):this.blockData;return e=e&&this.getDateTime(e),t=t&&this.getDateTime(t),n=this.eventBase.filterEventsByRange(n,e,t)},v.prototype.getOccurrencesByID=function(e){return this.eventBase.getOccurrencesByID(e)},v.prototype.getOccurrencesByRange=function(e,t){return e=this.getDateTime(e),t=this.getDateTime(t),this.eventBase.getOccurrencesByRange(e,t)},v.prototype.getCurrentViewDates=function(){return this.activeView?this.activeView.renderDates:[]},v.prototype.setRecurrenceEditor=function(e){this.eventWindow.setRecurrenceEditor(e)},v.prototype.getEventMaxID=function(){return this.eventBase.getEventMaxID()},v.prototype.getDeletedOccurrences=function(e){return this.eventBase.getDeletedOccurrences(e)},v.prototype.getCurrentViewEvents=function(){return this.eventsProcessed},v.prototype.refreshEvents=function(e){(e=void 0===e?!0:e)?(this.dragAndDropModule&&(this.dragAndDropModule.actionObj.action="",B.removeClass([this.element],Wi)),this.crudModule.refreshDataManager()):(this.uiStateValues&&(this.uiStateValues.isPreventTimezone=!0),this.crudModule&&this.crudModule.refreshProcessedData(),this.uiStateValues&&(this.uiStateValues.isPreventTimezone=!1))},v.prototype.refreshTemplates=function(e){switch(e?this.resetTemplates([e]):this.resetTemplates(),e){case"eventTemplate":this.appointmentTemplateFn=this.templateParser(this.activeViewOptions.eventTemplate),this.refreshEvents(!1);break;case"dateHeaderTemplate":this.dateHeaderTemplateFn=this.templateParser(this.activeViewOptions.dateHeaderTemplate),this.activeView.refreshHeader();break;case"dateRangeTemplate":this.dateRangeTemplateFn=this.templateParser(this.activeViewOptions.dateRangeTemplate),this.headerModule&&this.headerModule.refresh();break;case"resourceHeaderTemplate":this.resourceHeaderTemplateFn=this.templateParser(this.activeViewOptions.resourceHeaderTemplate),this.activeView.isTimelineView()?this.activeView.refreshResourceHeader():this.activeView.refreshHeader();break;case"quickInfoTemplates":this.quickPopup&&(this.quickPopup.destroy(),this.quickPopup=null),this.quickPopup=new as(this),this.quickInfoTemplatesHeaderFn=this.templateParser(this.quickInfoTemplates.header),this.quickInfoTemplatesContentFn=this.templateParser(this.quickInfoTemplates.content),this.quickInfoTemplatesFooterFn=this.templateParser(this.quickInfoTemplates.footer);break;case"editorTemplate":this.destroyEditorWindow(),this.editorTemplateFn=this.templateParser(this.editorTemplate);break;case"editorHeaderTemplate":this.destroyEditorWindow(),this.editorHeaderTemplateFn=this.templateParser(this.editorHeaderTemplate);break;case"editorFooterTemplate":this.destroyEditorWindow(),this.editorFooterTemplateFn=this.templateParser(this.editorFooterTemplate);break;case"tooltipTemplate":case"headerTooltipTemplate":this.eventTooltip&&(this.eventTooltip.destroy(),this.eventTooltip=null),this.eventTooltip=new ss(this),this.eventTooltipTemplateFn=this.templateParser(this.eventSettings.tooltipTemplate),this.headerTooltipTemplateFn=this.templateParser(this.activeViewOptions.group.headerTooltipTemplate);break;default:this.initializeView(this.currentView)}},v.prototype.refreshLayout=function(){this.onScheduleResize(),this.headerModule&&this.headerModule.refresh(),this.eventWindow&&this.eventWindow.refresh()},v.prototype.getEventDetails=function(e){e=(e=B.getElement(e)).getAttribute("data-guid");return e?this.eventBase.getEventByGuid(e):{}},v.prototype.isSlotAvailable=function(e,t,i){var n,r,a=this,s=this.activeEventData.event;return e instanceof Date||"string"==typeof e?(n=e,r=t):(n=(s=e)[this.eventFields.startTime],r=e[this.eventFields.endTime],this.resourceBase&&(i=this.eventBase.getGroupIndexFromEvent(e))),!(!B.isNullOrUndefined(n)&&!B.isNullOrUndefined(r)&&(n=this.getDateTime(n),r=this.getDateTime(r),t=this.eventBase.filterEvents(n,r),!B.isNullOrUndefined(i)&&this.resourceBase&&0<this.resourceBase.lastResourceLevel.length&&(t=this.eventBase.filterEventsByResource(this.resourceBase.lastResourceLevel[parseInt(i.toString(),10)],t)),0<(t=s?s.Guid?t.filter(function(e){return e.Guid!==s.Guid}):t.filter(function(e){return e[a.eventFields.id]!==s[a.eventFields.id]}):t).length))},v.prototype.copy=function(e){this.processCutCopyActions(e,!1)},v.prototype.cut=function(e){this.processCutCopyActions(e,!0)},v.prototype.paste=function(t){var e,i,n=this;this.allowClipboard&&this.allowKeyboardInteraction&&t&&(t.classList.contains("e-work-cells")||t.classList.contains("e-all-day-cells"))&&(this.activeCellsData||(e=this.getCellDetails([t]))&&(this.activeCellsData=e),i=new DataTransfer,B.isNullOrUndefined(navigator.clipboard)||navigator.clipboard.readText().then(function(e){i.setData("text/plain",e);e=new ClipboardEvent("paste",{bubbles:!0,cancelable:!0});Object.defineProperty(e,"clipboardData",{value:i}),n.keyboardInteractionModule.pasteHandler(e,t)}).catch(function(e){throw e}))},v.prototype.processCutCopyActions=function(e,t){var i,n=this;e&&this.allowClipboard&&this.allowKeyboardInteraction&&(i=[],e.forEach(function(e){e.classList.contains(V)&&(e=n.getEventDetails(e))&&i.push(e)}),0<i.length)&&this.keyboardInteractionModule.processClipboardAction(t,i)},v.prototype.openEditor=function(e,t,i,n){"Add"!==t||i?(e[this.eventFields.startTime]=this.getDateTime(e[this.eventFields.startTime]),e[this.eventFields.endTime]=this.getDateTime(e[this.eventFields.endTime])):(e.startTime=this.getDateTime(e.startTime),e.endTime=this.getDateTime(e.endTime),B.isNullOrUndefined(e.element)||(e.element=B.getElement(e.element))),"Add"!==(this.currentAction=t)&&(this.activeEventData.event=e),this.eventWindow.openEditor(e,t,i,n)},v.prototype.closeEditor=function(){this.eventWindow&&this.eventWindow.dialogClose()},v.prototype.openQuickInfoPopup=function(t){var e,i,n,r=this;"Year"===this.currentView||B.isNullOrUndefined(t)||(B.isNullOrUndefined(t[this.eventFields.id])?"Agenda"===this.currentView||"MonthAgenda"===this.currentView||B.isNullOrUndefined(this.activeView)||(i={startTime:this.activeCellsData.startTime=this.getDateTime(t[this.eventFields.startTime]),endTime:this.activeCellsData.endTime=this.getDateTime(t[this.eventFields.endTime]),isAllDay:this.activeCellsData.isAllDay=!B.isNullOrUndefined(t[this.eventFields.isAllDay])&&t[this.eventFields.isAllDay]},(e=this.activeView.getAdjustedDate(new Date(i.startTime)))&&(n="."+O+'[data-date="'+e.getTime()+'"]',0<this.activeViewOptions.group.resources.length&&!this.uiStateValues.isGroupAdaptive&&this.resourceBase&&this.eventBase&&(i.groupIndex=this.eventBase.getGroupIndexFromEvent(t),n="."+O+'[data-date="'+e.getTime()+'"][data-group-index="'+i.groupIndex+'"]'),e=this.element.querySelector(n))&&(e.focus(),i.element=e,this.notify(q,i))):(n=this.getCurrentViewEvents().filter(function(e){return t[r.eventFields.id]===e[r.eventFields.id]})).length<=0||(e=n[0],t[this.eventFields.recurrenceRule]&&0<(i=n.filter(function(e){return e[r.eventFields.startTime].getTime()===t[r.eventFields.startTime].getTime()})).length&&(e=i[0]),(n=this.element.querySelector('div[data-guid="'+e.Guid+'"]'))&&(this.eventBase.removeSelectedAppointmentClass(),this.eventBase.addSelectedAppointments([n],!1),this.activeEventData={event:e,element:n},"Agenda"!==this.currentView&&"MonthAgenda"!==this.currentView||B.addClass([this.activeEventData.element],Ii),this.notify(ee,this.activeEventData))))},v.prototype.closeQuickInfoPopup=function(){this.quickPopup&&this.quickPopup.quickPopupHide(!0)},v.prototype.openOverlapAlert=function(t){var e,i=this;this.quickPopup&&(e={type:"OverlapAlert",cancel:!1,element:this.quickPopup.quickDialog.element,data:t.data,overlapEvents:t.overlapEvents},this.trigger(ae,e,function(e){e.cancel||i.quickPopup.openValidationError("overlapAlert",t.data)}))},v.prototype.closeOverlapAlert=function(){var e,t=this;this.quickPopup&&(e={type:"OverlapAlert",cancel:!1,data:this.activeEventData.event,element:this.quickPopup.quickDialog.element},this.trigger(se,e,function(e){e.cancel||t.quickPopup.quickDialog.hide()}))},v.prototype.closeTooltip=function(){this.eventTooltip&&this.eventTooltip.close()},v.prototype.getDateRangeText=function(e){return B.isNullOrUndefined(e)&&0===e.length||!this.activeView?"":this.activeView.getDateRangeText(e[0],e)},v.prototype.getViewDates=function(e){if(!this.activeView)return[];switch(e=void 0===e?"Current":e){case"Previous":case"Next":return this.activeView.getRenderDates(void 0,this.activeView.getNextPreviousDate(e));case"Current":return this.getCurrentViewDates()}},v.prototype.selectResourceByIndex=function(e){this.resourceBase&&this.uiStateValues.isGroupAdaptive&&this.resourceBase.selectResourceByIndex(e)},v.prototype.getIndexFromResourceId=function(e,t){return this.resourceBase?this.resourceBase.getIndexFromResourceId(e,t):null},v.prototype.addResource=function(e,t,i){this.resourceBase.addResource(e,t,i)},v.prototype.removeResource=function(e,t){this.resourceBase.removeResource(e,t)},v.prototype.destroy=function(){this.eventTooltip&&(this.eventTooltip.destroy(),this.eventTooltip=null),this.destroyPopups(),this.hideSpinner(),this.unWireEvents(),this.destroyHeaderModule(),this.eventBase&&(this.eventBase.destroy(),this.eventBase=null),this.workCellAction&&(this.workCellAction.destroy(),this.workCellAction=null),this.inlineModule&&(this.inlineModule.destroy(),this.inlineModule=null),this.keyboardInteractionModule&&(this.keyboardInteractionModule.destroy(),this.keyboardInteractionModule=null),this.scrollModule&&(this.scrollModule.destroy(),this.scrollModule=null),this.printModule&&this.printModule.destroy(),this.activeView&&(this.resetTemplates(),this.activeView.removeEventListener(),this.activeView.destroy(),this.activeView=null),this.scheduleTouchModule&&(this.scheduleTouchModule.destroy(),this.scheduleTouchModule=null),this.crudModule&&(this.crudModule.destroy(),this.crudModule=null),this.dataModule&&(this.dataModule.destroy(),this.dataModule=null),ol.prototype.destroy.call(this);for(var e=0,t=["dayModule","weekModule","workWeekModule","monthModule","monthAgendaModule","yearModule","agendaModule","timelineViewsModule","timelineMonthModule","timelineYearModule","resizeModule","dragAndDropModule","excelExportModule","printModule","iCalendarExportModule","iCalendarImportModule","tzModule","eventsData","eventsProcessed","blockData","blockProcessed","uiStateValues","viewCollections","viewOptions","defaultLocale","localeObj","selectedElements","resourceCollection","editorTitles","eventFields","activeViewOptions","activeEventData","activeCellsData","renderModule"];e<t.length;e++)this[""+t[e]]=null;lt(this.element);var i=[vt,ft,yt,wt];this.cssClass&&(i=i.concat(this.cssClass.split(" "))),B.removeClass([this.element],i)},m([B.Property("auto")],v.prototype,"width",void 0),m([B.Property("auto")],v.prototype,"height",void 0),m([B.Property(!0)],v.prototype,"showHeaderBar",void 0),m([B.Property(!0)],v.prototype,"showTimeIndicator",void 0),m([B.Property(!0)],v.prototype,"allowSwiping",void 0),m([B.Property(!0)],v.prototype,"allowOverlap",void 0),m([B.Property(3)],v.prototype,"overscanCount",void 0),m([B.Collection([],$o)],v.prototype,"toolbarItems",void 0),m([B.Property("Week")],v.prototype,"currentView",void 0),m([B.Property(["Day","Week","WorkWeek","Month","Agenda"])],v.prototype,"views",void 0),m([B.Property(new Date)],v.prototype,"selectedDate",void 0),m([B.Property(new Date(1900,0,1))],v.prototype,"minDate",void 0),m([B.Property(new Date(2099,11,31))],v.prototype,"maxDate",void 0),m([B.Property()],v.prototype,"dateFormat",void 0),m([B.Property("Gregorian")],v.prototype,"calendarMode",void 0),m([B.Property(!0)],v.prototype,"showWeekend",void 0),m([B.Property(0)],v.prototype,"firstDayOfWeek",void 0),m([B.Property("FirstDay")],v.prototype,"weekRule",void 0),m([B.Property([1,2,3,4,5])],v.prototype,"workDays",void 0),m([B.Property(12)],v.prototype,"monthsCount",void 0),m([B.Property("00:00")],v.prototype,"startHour",void 0),m([B.Property("24:00")],v.prototype,"endHour",void 0),m([B.Property(null)],v.prototype,"timeFormat",void 0),m([B.Property(!0)],v.prototype,"enableHtmlSanitizer",void 0),m([B.Property(!1)],v.prototype,"enableAllDayScroll",void 0),m([B.Property(!1)],v.prototype,"enableAdaptiveUI",void 0),m([B.Property(!0)],v.prototype,"allowResizing",void 0),m([B.Complex({},cs)],v.prototype,"workHours",void 0),m([B.Complex({},hs)],v.prototype,"timeScale",void 0),m([B.Property(!0)],v.prototype,"allowKeyboardInteraction",void 0),m([B.Property(!0)],v.prototype,"allowDragAndDrop",void 0),m([B.Property()],v.prototype,"dateHeaderTemplate",void 0),m([B.Property()],v.prototype,"dateRangeTemplate",void 0),m([B.Property()],v.prototype,"cellHeaderTemplate",void 0),m([B.Property()],v.prototype,"dayHeaderTemplate",void 0),m([B.Property()],v.prototype,"monthHeaderTemplate",void 0),m([B.Property()],v.prototype,"cellTemplate",void 0),m([B.Property(!1)],v.prototype,"readonly",void 0),m([B.Property(!0)],v.prototype,"showQuickInfo",void 0),m([B.Property(!1)],v.prototype,"allowInline",void 0),m([B.Property(!0)],v.prototype,"allowMultiCellSelection",void 0),m([B.Property(!0)],v.prototype,"allowMultiRowSelection",void 0),m([B.Property(!1)],v.prototype,"quickInfoOnSelectionEnd",void 0),m([B.Property(!1)],v.prototype,"showWeekNumber",void 0),m([B.Property(!1)],v.prototype,"rowAutoHeight",void 0),m([B.Property(!1)],v.prototype,"allowMultiDrag",void 0),m([B.Property(0)],v.prototype,"firstMonthOfYear",void 0),m([B.Property()],v.prototype,"editorTemplate",void 0),m([B.Property()],v.prototype,"editorHeaderTemplate",void 0),m([B.Property()],v.prototype,"editorFooterTemplate",void 0),m([B.Complex({},Co)],v.prototype,"quickInfoTemplates",void 0),m([B.Property(7)],v.prototype,"agendaDaysCount",void 0),m([B.Property(!0)],v.prototype,"hideEmptyAgendaDays",void 0),m([B.Property(!0)],v.prototype,"enableRecurrenceValidation",void 0),m([B.Property()],v.prototype,"timezone",void 0),m([B.Complex({},ko)],v.prototype,"eventSettings",void 0),m([B.Property(na)],v.prototype,"timezoneDataSource",void 0),m([B.Property()],v.prototype,"resourceHeaderTemplate",void 0),m([B.Property()],v.prototype,"headerIndentTemplate",void 0),m([B.Complex({},Fo)],v.prototype,"group",void 0),m([B.Collection([],u)],v.prototype,"resources",void 0),m([B.Collection([],Vo)],v.prototype,"headerRows",void 0),m([B.Property()],v.prototype,"cssClass",void 0),m([B.Property(!1)],v.prototype,"allowClipboard",void 0),m([B.Property()],v.prototype,"eventDragArea",void 0),m([B.Event()],v.prototype,"created",void 0),m([B.Event()],v.prototype,"destroyed",void 0),m([B.Event()],v.prototype,"cellClick",void 0),m([B.Event()],v.prototype,"cellDoubleClick",void 0),m([B.Event()],v.prototype,"moreEventsClick",void 0),m([B.Event()],v.prototype,"hover",void 0),m([B.Event()],v.prototype,"select",void 0),m([B.Event()],v.prototype,"actionBegin",void 0),m([B.Event()],v.prototype,"actionComplete",void 0),m([B.Event()],v.prototype,"actionFailure",void 0),m([B.Event()],v.prototype,"navigating",void 0),m([B.Event()],v.prototype,"renderCell",void 0),m([B.Event()],v.prototype,"eventClick",void 0),m([B.Event()],v.prototype,"eventDoubleClick",void 0),m([B.Event()],v.prototype,"eventRendered",void 0),m([B.Event()],v.prototype,"dataBinding",void 0),m([B.Event()],v.prototype,"popupOpen",void 0),m([B.Event()],v.prototype,"popupClose",void 0),m([B.Event()],v.prototype,"dragStart",void 0),m([B.Event()],v.prototype,"drag",void 0),m([B.Event()],v.prototype,"dragStop",void 0),m([B.Event()],v.prototype,"resizeStart",void 0),m([B.Event()],v.prototype,"resizing",void 0),m([B.Event()],v.prototype,"resizeStop",void 0),m([B.Event()],v.prototype,"virtualScrollStart",void 0),m([B.Event()],v.prototype,"virtualScrollStop",void 0),m([B.Event()],v.prototype,"dataBound",void 0),m([B.Event()],v.prototype,"beforePaste",void 0),m([B.Event()],v.prototype,"beforePrint",void 0),m([B.Event()],v.prototype,"excelExport",void 0),m([B.Event()],v.prototype,"tooltipOpen",void 0),m([B.NotifyPropertyChanges],v));function v(e,t){e=ol.call(this,e,t)||this;return e.adaptiveGroupIndex=0,e}pl.prototype.getChangedData=function(e){var t,i,n,r=this,a=B.extend({},this.actionObj.event,null,!0);return a[this.parent.eventFields.startTime]=this.actionObj.start,a[this.parent.eventFields.endTime]=this.actionObj.end,B.isNullOrUndefined(this.actionObj.isAllDay)||(a[this.parent.eventFields.isAllDay]=this.actionObj.isAllDay),0<this.parent.activeViewOptions.group.resources.length&&(t=this.getOriginalElement(this.actionObj.element))&&(-1===(n=t.map(function(e){return parseInt(e.getAttribute("data-group-index"),10)})).indexOf(this.actionObj.groupIndex)||!B.isNullOrUndefined(e)&&0<e.length)&&(i=parseInt(this.actionObj.clone.getAttribute("data-group-index"),10),(n=n.filter(function(e){return e!==i})).push(this.actionObj.groupIndex),e&&0<e.length?e.forEach(function(e){r.parent.resourceBase.getResourceData(e,r.actionObj.groupIndex,n)}):this.parent.resourceBase.getResourceData(a,this.actionObj.groupIndex,n)),a},pl.prototype.saveChangedData=function(e,t){void 0===t&&(t=!1),this.parent.activeEventData.event=this.actionObj.event,this.parent.currentAction="Save";for(var i,n=[e.data],r=0,a=n=t?e.selectedData:n;r<a.length;r++){var s=a[r],o=!(0<this.parent.activeViewOptions.group.resources.length)||parseInt(this.actionObj.element.getAttribute("data-group-index"),10)===this.actionObj.groupIndex;if(+s[this.parent.eventFields.startTime]==+this.actionObj.event[this.parent.eventFields.startTime]&&+s[this.parent.eventFields.endTime]==+this.actionObj.event[this.parent.eventFields.endTime]&&o)return void(this.parent.crudModule.crudObj.isCrudAction=!1);if(s[this.parent.eventFields.recurrenceRule]){o=s[this.parent.eventFields.recurrenceID]||s[this.parent.eventFields.id];if(s[this.parent.eventFields.id]===s[this.parent.eventFields.recurrenceID]&&(s[this.parent.eventFields.id]=this.parent.eventBase.getEventMaxID(),i="EditOccurrence"),this.parent.enableRecurrenceValidation&&this.parent.eventWindow.editOccurrenceValidation(o,s,this.actionObj.event))return}else i=null;(s[this.parent.eventFields.startTimezone]||s[this.parent.eventFields.endTimezone])&&this.parent.eventBase.timezoneConvert(s),this.parent.crudModule.saveEvent(s,i)}},pl.prototype.calculateIntervalTime=function(e){var t=z(e).getTime(),i=this.parent.activeView.getStartHour(),n=je*this.actionObj.interval,t=(t+=(60*i.getHours()+i.getMinutes())*je+1e3*i.getSeconds())+Math.floor((e.getTime()-t)/n)*n;return new Date(t)},pl.prototype.getContentAreaDimension=function(){var e=this.parent.element.querySelector("."+A),t=[].slice.call(e.querySelector("tr").children),i=(t=this.parent.activeView.isTimelineView()||!(0<this.parent.activeViewOptions.group.resources.length)||this.parent.isAdaptive||this.parent.enableAdaptiveUI||this.parent.virtualScrollModule?t:this.getResourceElements(t))[0].getBoundingClientRect(),t=t.slice(-1)[0].getBoundingClientRect();return{bottom:e.scrollHeight-5,left:(this.parent.enableRtl?t:i).left,right:(this.parent.enableRtl?i:t).right,top:0,leftOffset:(this.parent.enableRtl?t:i).right,rightOffset:(this.parent.enableRtl?i:t).left}},pl.prototype.getIndex=function(e){var t=[].slice.call(this.parent.getContentTable().querySelector("tr").children),i={minIndex:0,maxIndex:t.length-1};return"resize"===this.actionObj.action&&0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive&&!this.parent.activeView.isTimelineView()&&(t=this.getResourceElements(t),i.minIndex=t[0].cellIndex,i.maxIndex=t.slice(-1)[0].cellIndex),e=i.maxIndex<(e=e<i.minIndex?i.minIndex:e)?i.maxIndex:e},pl.prototype.updateTimePosition=function(e,t){for(var i,n,r=0,a=0,s=this.actionObj.cloneElement;a<s.length;a++){var o,l,p=s[a].querySelector("."+Ci);p&&(o=this.actionObj.start,l=this.actionObj.end,t&&0<t.length&&(o=t[parseInt(r.toString(),10)][this.parent.eventFields.startTime],l=t[parseInt(r.toString(),10)][this.parent.eventFields.endTime]),p.innerHTML=this.parent.getTimeString(o)+" - "+this.parent.getTimeString(l)),r++}this.parent.activeViewOptions.timeScale.enable&&this.parent.isAdaptive&&"Month"!==this.parent.currentView&&"TimelineMonth"!==this.parent.currentView&&((i=this.parent.element.querySelector("."+_i))||(i=B.createElement("div",{className:_i}),n=this.parent.activeView.isTimelineView()?Vt:Zt,this.parent.element.querySelector("."+n).appendChild(i)),i.innerHTML=this.parent.getTimeString(e),n=0,this.parent.activeView.isTimelineView()?this.parent.enableRtl?(e=parseInt(this.actionObj.clone.style.right,10),n="drag"===this.actionObj.action||this.resizeEdges.left?e+this.actionObj.clone.offsetWidth:e,i.style.right=B.formatUnit(n)):(e=parseInt(this.actionObj.clone.style.left,10),n="drag"===this.actionObj.action||this.resizeEdges.left?e:e+this.actionObj.clone.offsetWidth,i.style.left=B.formatUnit(n)):(n="drag"===this.actionObj.action||this.resizeEdges.top?this.actionObj.clone.offsetTop:this.actionObj.clone.offsetTop+this.actionObj.clone.offsetHeight,i.style.top=B.formatUnit(n)))},pl.prototype.getResourceElements=function(e){var t=this;return e.filter(function(e){return parseInt(e.getAttribute("data-group-index"),10)===t.actionObj.groupIndex})},pl.prototype.getOriginalElement=function(e){var t,i=e.getAttribute("data-guid");return e.offsetParent&&e.offsetParent.classList.contains(Cn)||this.parent.activeView.isTimelineView()||"resize"!==this.actionObj.action&&this.parent.virtualScrollModule?t=[].slice.call(this.parent.element.querySelectorAll('[data-guid="'+i+'"]')):(e=B.closest(e,"tr"))&&(t=[].slice.call(e.querySelectorAll('[data-guid="'+i+'"]'))),t},pl.prototype.createCloneElement=function(e){var t=document.createElement("div"),t=(t.appendChild(e.cloneNode(!0)),t.children[0]),i=[Yi],i=(i.push("drag"===this.actionObj.action?Gi:Qi),"Month"!==this.parent.currentView&&"TimelineMonth"!==this.parent.currentView||i.push("e-month-event"),B.addClass([t],i),B.addClass([e],Wi),B.isNullOrUndefined(e.parentElement)||e.parentElement.appendChild(t),t.style.width=B.formatUnit(t.offsetWidth-2),document.querySelector(this.parent.eventDragArea));return this.parent.eventDragArea&&"drag"===this.actionObj.action&&i&&i.appendChild(t),B.setStyleAttribute(t,{border:"0px"}),t},pl.prototype.removeCloneElementClasses=function(){var e=this.actionObj.originalElement;"Month"!==this.parent.currentView&&"TimelineYear"!==this.parent.currentView&&"Day"!==this.parent.currentView&&"Week"!==this.parent.currentView&&"WorkWeek"!==this.parent.currentView||(e=[].slice.call(this.parent.element.querySelectorAll("."+Wi))),B.removeClass(e,Wi)},pl.prototype.removeCloneElement=function(){this.actionObj.originalElement=[];for(var e=0,t=[].slice.call(this.parent.element.querySelectorAll(".e-dynamic-clone"));e<t.length;e++){var i=t[e];B.remove(i)}for(var n=0,r=this.actionObj.cloneElement;n<r.length;n++){var a=r[n];B.isNullOrUndefined(a.parentNode)||B.remove(a)}this.actionObj.cloneElement=[];var s=this.parent.element.querySelector("."+_i);s&&B.remove(s)},pl.prototype.getCursorElement=function(e){e=this.parent.eventBase.getPageCoordinates(e);return document.elementFromPoint(e.clientX,e.clientY)},pl.prototype.autoScroll=function(){var e,t=this.parent.element.querySelector("."+A),i=t.offsetHeight<=t.scrollHeight,n=t.offsetWidth<=t.scrollWidth,i=i&&0<=t.scrollTop&&t.scrollTop+t.offsetHeight<=t.scrollHeight,n=n&&0<=t.scrollLeft&&t.scrollLeft+t.offsetWidth<=t.scrollWidth;"resize"===this.actionObj.action&&this.scrollEdges.right&&t.scrollLeft+t.offsetWidth>t.scrollWidth&&(e=[].slice.call(this.parent.getContentTable().querySelector("tr").children).length-1,n=Math.ceil((this.actionObj.clone.offsetLeft+this.actionObj.clone.offsetWidth)/this.actionObj.cellWidth)===e),i&&(this.scrollEdges.top||this.scrollEdges.bottom)&&(t.scrollTop+=this.scrollEdges.top?-this.actionObj.scroll.scrollBy:this.actionObj.scroll.scrollBy,"resize"===this.actionObj.action)&&t.scrollHeight!==t.offsetHeight+t.scrollTop&&0<t.scrollTop&&(this.actionObj.Y+=this.scrollEdges.top?this.actionObj.scroll.scrollBy:-this.actionObj.scroll.scrollBy),n&&(this.scrollEdges.left||this.scrollEdges.right)&&(t.scrollLeft+=this.scrollEdges.left?-this.actionObj.scroll.scrollBy:this.actionObj.scroll.scrollBy,"resize"===this.actionObj.action)&&t.scrollWidth!==t.offsetWidth+t.scrollLeft&&0<t.scrollLeft&&(this.actionObj.X+=this.scrollEdges.left?this.actionObj.scroll.scrollBy:-this.actionObj.scroll.scrollBy)},pl.prototype.autoScrollValidation=function(){var e;return!!this.actionObj.scroll.enable&&(e=this.parent.boundaryValidation(this.actionObj.pageY,this.actionObj.pageX),(this.scrollEdges=e).bottom||e.top||e.left||e.right)},pl.prototype.actionClass=function(e){"addClass"===e?B.addClass([this.parent.element],Wi):B.removeClass([this.parent.element],Wi)},pl.prototype.updateScrollPosition=function(e){var t=this;this.scrollEventArgs=e,this.actionObj.scroll.enable&&B.isNullOrUndefined(this.actionObj.scrollInterval)&&(this.actionObj.scrollInterval=window.setInterval(function(){!t.autoScrollValidation()||t.actionObj.clone.classList.contains(an)||t.parent.activeView.isTimelineView()&&0<t.parent.activeViewOptions.group.resources.length&&t.actionObj.groupIndex<0||(t.autoScroll(),"drag"===t.actionObj.action?t.parent.dragAndDropModule.updateDraggingDateTime(t.scrollEventArgs):t.parent.resizeModule.updateResizingDirection(t.scrollEventArgs))},this.actionObj.scroll.timeDelay))},pl.prototype.updateOriginalElement=function(e){var t='[data-id="'+e.getAttribute("data-id")+'"]',e=(0<this.parent.activeViewOptions.group.resources.length&&(t=t.concat('[data-group-index = "'+e.getAttribute("data-group-index")+'"]')),e.hasAttribute("data-guid")&&(t+='[data-guid="'+e.getAttribute("data-guid")+'"]'),[].slice.call(this.parent.element.querySelectorAll(t))),t=(B.addClass(e,Wi),[].slice.call(this.parent.element.querySelectorAll("."+Yi)));B.removeClass(t,Wi)},pl.prototype.getUpdatedEvent=function(e,t,i){i=JSON.parse(JSON.stringify(i));return i[this.parent.eventFields.startTime]=e,i[this.parent.eventFields.endTime]=t,i},pl.prototype.dynamicYearlyEventsRendering=function(e,t){var i,n,r;void 0===t&&(t=!1),B.isNullOrUndefined(this.parent.eventDragArea)&&(n=this.actionObj.cellWidth-7,t&&(this.resizeEdges.left||this.resizeEdges.right)&&(n=this.actionObj.cellWidth*e.count),t||"Horizontal"!==this.parent.activeViewOptions.orientation||0!==this.parent.activeViewOptions.group.resources.length||((i=this.yearEvent.isSpannedEvent(e,e[this.parent.eventFields.startTime]))[this.parent.eventFields.startTime].getTime()===i[this.parent.eventFields.endTime].getTime()&&(i.isSpanned.count=1),n=i.isSpanned.count*this.actionObj.cellWidth),t||"Vertical"!==this.parent.activeViewOptions.orientation||0===this.parent.activeViewOptions.group.resources.length||(n=(i=this.yearEvent.isSpannedEvent(e,e[this.parent.eventFields.startTime])).isSpanned.count*this.actionObj.cellWidth),(i=this.createAppointmentElement(this.actionObj.groupIndex,e[this.parent.eventFields.subject])).setAttribute("drag","true"),B.addClass([i],Yi),B.setStyleAttribute(i,{width:n+"px",border:"0px","pointer-events":"none",position:"absolute",overflow:"hidden",padding:"3px"}),""!==this.actionObj.clone.style.backgroundColor&&B.setStyleAttribute(i,{backgroundColor:this.actionObj.clone.style.backgroundColor}),n=z(e[this.parent.eventFields.startTime]).getTime(),r="."+O+'[data-date="'+n+'"]',0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive&&(r="."+O+'[data-date="'+n+'"][data-group-index="'+this.actionObj.groupIndex+'"]'),n=this.parent.element.querySelector(r),B.isNullOrUndefined(n)||(t&&(r=n.querySelector("."+Pi),t=this.actionObj.cellHeight*e.count-(r?r.offsetHeight:0)-7,(this.resizeEdges.right||this.resizeEdges.left)&&(t=parseInt(this.actionObj.clone.style.height,10)),B.setStyleAttribute(i,{height:t+"px"})),this.renderDynamicElement(n,i,!0),this.actionObj.cloneElement.push(i)))},pl.prototype.renderDynamicElement=function(e,t,i){var n;e.querySelector("."+x)?e.querySelector("."+x).appendChild(t):((n=B.createElement("div",{className:x})).appendChild(t),e.appendChild(n))},pl.prototype.createAppointmentElement=function(e,t){t=B.createElement("div",{className:V,innerHTML:t});return 0<this.parent.activeViewOptions.group.resources.length&&t.setAttribute("data-group-index",e.toString()),t},pl.prototype.dynamicEventsRendering=function(e){var t=this;if(B.isNullOrUndefined(this.parent.eventDragArea)){var i,n,r,a=this.parent.activeView.renderDates,s=[].slice.call(this.parent.element.querySelectorAll("."+O)),o=this.parent.activeViewOptions.workDays;if(0<this.parent.activeViewOptions.group.resources.length&&(a=(i=(this.parent.virtualScrollModule&&this.parent.virtualScrollModule.isHorizontalScroll?this.parent.resourceBase.renderedResources:this.parent.resourceBase.lastResourceLevel).filter(function(e){return e.groupIndex===t.actionObj.groupIndex}))[0].renderDates,n="."+O+'[data-group-index="'+this.actionObj.groupIndex+'"]',s=[].slice.call(this.parent.element.querySelectorAll(n)),o=i[0].workDays,r=i[0].groupOrder),this.monthEvent.dateRender=a,this.monthEvent.getSlotDates(o),this.resizeEdges.left||this.resizeEdges.right)for(var l=0,p=[].slice.call(this.parent.element.querySelectorAll("."+Yi));l<p.length;l++){var c=p[l];B.remove(c)}for(var h=0,d=this.monthEvent.splitEvent(e,a);h<d.length;h++){var u=d[h],g=this.parent.getIndexOfDate(a,z(u[this.monthEvent.fields.startTime])),m=u.data.count*this.actionObj.cellWidth-7,v=this.monthEvent.createAppointmentElement(u,this.actionObj.groupIndex,!0),u=(v.setAttribute("drag","true"),B.addClass([v],Yi),this.monthEvent.applyResourceColor(v,u,"backgroundColor",r),B.setStyleAttribute(v,{width:m+"px",border:"0px","pointer-events":"none"}),s[parseInt(g.toString(),10)]);u&&(this.monthEvent.renderElement(u,v,!0),this.actionObj.cloneElement.push(v))}}},pl.prototype.destroy=function(){!this.parent||this.parent&&this.parent.isDestroyed||(this.actionObj={},this.scrollArgs={},this.resizeEdges={left:!1,right:!1,top:!1,bottom:!1},this.scrollEdges={left:!1,right:!1,top:!1,bottom:!1})};rl=pl;function pl(e){this.daysVariation=0,this.parent=e,this.actionObj={X:0,Y:0,groupIndex:0,cellWidth:0,cellHeight:0,slotInterval:0,interval:0,actionIndex:0,cloneElement:[],originalElement:[],action:null,isAllDay:null,excludeSelectors:null,index:0,navigationInterval:null,scrollInterval:null},this.scrollArgs={element:null,width:0,height:0},this.resizeEdges={left:!1,right:!1,top:!1,bottom:!1},this.scrollEdges={left:!1,right:!1,top:!1,bottom:!1}}cl=function(e,t){return(cl=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}cl(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(dl,hl=rl),dl.prototype.wireResizeEvent=function(e){for(var t=0,i=[].slice.call(e.querySelectorAll("."+Xi));t<i.length;t++){var n=i[t];B.EventHandler.add(n,B.Browser.touchStartEvent,this.resizeStart,this)}},dl.prototype.resizeHelper=function(){if(0<this.parent.activeViewOptions.group.resources.length&&this.parent.activeViewOptions.group.allowGroupEdit)for(var e=0,t=this.actionObj.originalElement.length;e<t;e++){var i=this.createCloneElement(this.actionObj.originalElement[parseInt(e.toString(),10)]);this.actionObj.cloneElement[parseInt(e.toString(),10)]=i,this.actionObj.element===this.actionObj.originalElement[parseInt(e.toString(),10)]&&(this.actionObj.clone=i)}else this.actionObj.element&&(this.actionObj.clone=this.createCloneElement(this.actionObj.element)),this.actionObj.cloneElement=[this.actionObj.clone],this.actionObj.originalElement=[this.actionObj.element]},dl.prototype.resizeStart=function(s){var o,l,e,p=this;s&&"touchstart"===s.type&&(!this.parent.uiStateValues.isTapHold||!B.closest(s.target,"."+wi))||B.closest(s.target,"."+Nr)||(o=B.closest(s.target,"."+Xi),this.actionObj.element=B.closest(o,"."+V),this.actionObj.event=this.parent.eventBase.getEventByGuid(this.actionObj.element.getAttribute("data-guid")),B.isNullOrUndefined(this.actionObj.event))||(this.parent.eventBase.removeSelectedAppointmentClass(),this.actionObj.action="resize",this.actionObj.slotInterval=this.parent.activeViewOptions.timeScale.interval/this.parent.activeViewOptions.timeScale.slotCount,this.actionObj.interval=this.actionObj.slotInterval,e={cancel:!1,data:l=B.extend({},this.actionObj.event,null,!0),element:this.actionObj.element,event:s,interval:this.actionObj.interval,scroll:{enable:!0,scrollBy:30,timeDelay:100}},this.parent.trigger(ce,e,function(e){if(!e.cancel){p.actionClass("addClass"),p.parent.uiStateValues.action=!0,p.resizeEdges={left:o.classList.contains(Ki),right:o.classList.contains(Zi),top:o.classList.contains(Ji),bottom:o.classList.contains($i)},p.actionObj.groupIndex=p.parent.uiStateValues.isGroupAdaptive?p.parent.uiStateValues.groupIndex:0;var t=p.parent.element.querySelector("."+O),t=(p.actionObj.cellWidth=p.parent.getElementWidth(t),p.actionObj.cellHeight=p.parent.getElementHeight(t),p.parent.activeViewOptions.headerRows.map(function(e){return e.option}));if(p.parent.activeView.isTimelineView()&&0<t.length&&["Date","Hour"].indexOf(t.slice(-1)[0])<0){for(var t=p.parent.getContentTable().querySelector("tr"),i=0,n=0,r=[].slice.call(t.children);n<r.length;n++){var a=r[n];i+=parseInt(a.getAttribute("colspan"),10)}t=t.getBoundingClientRect();p.actionObj.cellWidth=t.width/i,p.actionObj.cellHeight=t.height}t=p.parent.eventBase.getPageCoordinates(s),t=(p.actionObj.X=t.pageX,p.actionObj.Y=t.pageY,p.actionObj.groupIndex=parseInt(p.actionObj.element.getAttribute("data-group-index")||"0",10),p.actionObj.interval=e.interval,p.actionObj.scroll=e.scroll,p.actionObj.start=new Date(l[p.parent.eventFields.startTime].getTime()),p.actionObj.end=new Date(l[p.parent.eventFields.endTime].getTime()),p.actionObj.originalElement=p.getOriginalElement(p.actionObj.element),"Month"===p.parent.currentView&&(p.daysVariation=-1,p.monthEvent=new Za(p.parent)),p.parent.element.querySelector("."+A));p.scrollArgs={element:t,width:t.scrollWidth,height:t.scrollHeight},["Month","TimelineYear"].indexOf(p.parent.currentView)<0&&(e=Math.round(p.scrollArgs.width/p.actionObj.cellWidth)*p.actionObj.cellWidth,p.scrollArgs.width=p.scrollArgs.width<e?e:p.scrollArgs.width),B.EventHandler.add(document,B.Browser.touchMoveEvent,p.resizing,p),B.EventHandler.add(document,B.Browser.touchEndEvent,p.resizeStop,p)}}))},dl.prototype.resizing=function(e){var t,i,n;e&&"touchmove"===e.type&&e.preventDefault(),this.parent.quickPopup&&this.parent.quickPopup.quickPopupHide(),0===this.parent.element.querySelectorAll("."+Qi).length&&this.resizeHelper(),!B.isNullOrUndefined(e.target)&&e.target.classList.contains(yr)||(t=this.parent.eventBase.getPageCoordinates(e),"Month"===this.parent.currentView||"TimelineYear"===this.parent.currentView?(i=document.documentElement,n=(window.pageXOffset||i.scrollLeft)-(i.clientLeft||0),i=(window.pageYOffset||i.scrollTop)-(i.clientTop||0),this.actionObj.pageX=t.pageX-n,this.actionObj.pageY=t.pageY-i):(this.actionObj.pageX=t.pageX,this.actionObj.pageY=t.pageY),this.updateScrollPosition(e),this.updateResizingDirection(e),n={cancel:!1,data:B.extend({},this.actionObj.event,null,!0),element:this.actionObj.element,event:e,startTime:this.actionObj.start,endTime:this.actionObj.end},0<this.parent.group.resources.length&&(n.groupIndex=this.actionObj.groupIndex),this.parent.trigger(he,n))},dl.prototype.updateResizingDirection=function(e){if("Month"===this.parent.currentView||"TimelineYear"===this.parent.currentView)this.monthResizing();else{var t=this.resizeValidation(e);if(this.resizeEdges.left){if(t){var i=this.getLeftRightStyles(e,!0);if(parseInt(i.width,10)<1)return;for(var n=0,r=this.actionObj.cloneElement;n<r.length;n++){var a=r[n];B.setStyleAttribute(a,i),B.addClass([a],Ki)}}this.horizontalResizing(!this.parent.enableRtl)}if(this.resizeEdges.right){if(t){var s=this.getLeftRightStyles(e,!1);if(parseInt(s.width,10)<1)return;for(var o=0,l=this.actionObj.cloneElement;o<l.length;o++){a=l[o];B.setStyleAttribute(a,s),B.addClass([a],Zi)}}this.horizontalResizing(this.parent.enableRtl)}if(this.resizeEdges.top){if(t){var p=this.getTopBottomStyles(e,!0);if(parseInt(p.height,10)<1)return;for(var c=0,h=this.actionObj.cloneElement;c<h.length;c++){a=h[c];B.setStyleAttribute(a,p),B.addClass([a],Ji)}}this.verticalResizing(!0)}if(this.resizeEdges.bottom){if(t){var d=this.getTopBottomStyles(e,!1);if(parseInt(d.height,10)<1)return;for(var u=0,g=this.actionObj.cloneElement;u<g.length;u++){a=g[u];B.setStyleAttribute(a,d),B.addClass([a],$i)}}this.verticalResizing(!1)}}},dl.prototype.monthResizing=function(){var e,t,i,n;this.removeCloneElement(),B.isNullOrUndefined(this.actionObj.pageX)||B.isNullOrUndefined(this.actionObj.pageY)||(e=document.elementFromPoint(this.actionObj.pageX,this.actionObj.pageY),B.isNullOrUndefined(e))||(n=this.parent.getDateFromElement(e),e=!(0<this.parent.activeViewOptions.group.resources.length)||parseInt(e.getAttribute("data-group-index"),10)===this.actionObj.groupIndex,t=new Date(this.actionObj.event[this.parent.eventFields.startTime].getTime()),i=new Date(this.actionObj.event[this.parent.eventFields.endTime].getTime()),!this.parent.enableRtl&&this.resizeEdges.left||this.parent.enableRtl&&this.resizeEdges.right||this.resizeEdges.top?t=n:(!this.parent.enableRtl&&this.resizeEdges.right||this.parent.enableRtl&&this.resizeEdges.left||this.resizeEdges.bottom)&&(i=Y(n,1)),e&&t<i&&(this.actionObj.start=t,this.actionObj.end=i,n=this.getUpdatedEvent(this.actionObj.start,this.actionObj.end,this.actionObj.event),"TimelineYear"===this.parent.currentView?this.yearEventsRendering(n):this.dynamicEventsRendering(n),this.updateOriginalElement(this.actionObj.clone)))},dl.prototype.yearEventsRendering=function(e){for(var t=0,i=[].slice.call(this.parent.element.querySelectorAll("."+Yi));t<i.length;t++){var n=i[t];B.remove(n)}var r=new Date(e[this.parent.eventFields.endTime]),a=0;0===this.parent.activeViewOptions.group.resources.length&&(a=this.getMonthDiff(e[this.parent.eventFields.startTime],Y(r,-1)));for(var s=0;s<=a;s++){var o=void 0;0===this.parent.activeViewOptions.group.resources.length?o=this.getEventCount(e,this.actionObj.start.getMonth()+s):(o=B.extend({},e,null,!0),r=this.resizeEdges.left||this.resizeEdges.right?Y(r,-1):r,o.count=this.getMonthDiff(e[this.parent.eventFields.startTime],r)+1),this.dynamicYearlyEventsRendering(o,!0)}},dl.prototype.getMonthDiff=function(e,t){var i=12*(t.getFullYear()-e.getFullYear());return(i=(i-=e.getMonth())+t.getMonth())<=0?0:i},dl.prototype.getEventCount=function(e,t){var e=B.extend({},e,null,!0),i=e[this.parent.eventFields.startTime],n=e[this.parent.eventFields.endTime],r=new Date(this.parent.selectedDate.getFullYear(),t,1),t=Y(new Date(this.parent.selectedDate.getFullYear(),t+1,0),1),a=1;return i.getTime()<r.getTime()&&(e[this.parent.eventFields.startTime]=r),n.getTime()>t.getTime()&&(e[this.parent.eventFields.endTime]=t),0===this.parent.activeViewOptions.group.resources.length&&(a=Math.ceil((e[this.parent.eventFields.endTime].getTime()-e[this.parent.eventFields.startTime].getTime())/W)),e.count=a,e},dl.prototype.resizeStop=function(e){var t=this,e=(B.EventHandler.remove(document,B.Browser.touchMoveEvent,this.resizing),B.EventHandler.remove(document,B.Browser.touchEndEvent,this.resizeStop),clearInterval(this.actionObj.scrollInterval),this.actionObj.scrollInterval=null,this.actionObj.action=null,this.removeCloneElementClasses(),this.removeCloneElement(),this.actionClass("removeClass"),{cancel:this.parent.uiStateValues.action=this.parent.uiStateValues.isTapHold=!1,data:this.getChangedData(),element:this.actionObj.element,event:e});this.parent.trigger(de,e,function(e){e.cancel||t.parent.eventBase.checkOverlap(e.data)||(t.parent.isSpecificResourceEvents()&&(t.parent.crudModule.crudObj.sourceEvent=[t.parent.resourceBase.lastResourceLevel[parseInt(e.element.getAttribute("data-group-index"),10)]],t.parent.crudModule.crudObj.targetEvent=t.parent.crudModule.crudObj.sourceEvent,t.parent.crudModule.crudObj.isCrudAction=!0),t.saveChangedData(e))})},dl.prototype.verticalResizing=function(e){var t=this.actionObj.clone.offsetTop,t=(e||(t+=this.actionObj.clone.offsetHeight),t/Math.round(this.actionObj.cellHeight)*this.actionObj.slotInterval),i=this.actionObj.clone.offsetParent;B.isNullOrUndefined(i)||((i=z(this.parent.getDateFromElement(i))).setHours(this.parent.activeView.getStartHour().getHours()),i.setMinutes(t+this.parent.activeView.getStartHour().getMinutes()),e?this.actionObj.start=this.calculateIntervalTime(i):this.actionObj.end=this.calculateIntervalTime(i),this.updateTimePosition(i))},dl.prototype.horizontalResizing=function(e){var t=new Date(this.actionObj.event[this.parent.eventFields.startTime].getTime()),i=new Date(this.actionObj.event[this.parent.eventFields.endTime].getTime()),n=this.parent.currentView,r="TimelineMonth"===this.parent.currentView;if(this.parent.activeView.isTimelineView()){var a=this.parent.getContentTable().querySelector("tr"),s=(0<this.parent.activeViewOptions.headerRows.length&&(n=(m=this.parent.activeViewOptions.headerRows.map(function(e){return e.option})).slice(-1)[0],r)&&"Hour"===n&&(n=m.slice(-2)[0]||"Month"),m=e?t:i,0),o=[].slice.call(a.children),l=!1,p=this.actionObj.cellWidth/(this.parent.activeViewOptions.timeScale.interval/this.parent.activeViewOptions.timeScale.slotCount),c=parseFloat(this.parent.enableRtl?this.actionObj.clone.style.right:this.actionObj.clone.style.left),c=Math.round(c/p)*p;if(-1!==["Year","Month","Week","Date"].indexOf(n)){for(var h=0,d=0,u=o;d<u.length;d++){var g=u[d];h+=parseInt(g.getAttribute("colspan"),10)}p=this.parent.enableRtl?parseInt(this.actionObj.clone.style.right,10):parseInt(this.actionObj.clone.style.left,10),p=Math.round(p/this.actionObj.cellWidth)*this.actionObj.cellWidth;e||(p+=this.parent.getElementWidth(this.actionObj.clone)-this.actionObj.cellWidth),s=r?Math.floor(p/Math.floor(this.parent.getElementWidth(a)/h)):Math.round(p/(this.parent.getElementWidth(a)/h)),l=(s=!e&&r?s+1:s)===o.length,s=s<0?0:h<=s?h-1:s}else{p=this.actionObj.cellWidth;s=e?Math.round(c/this.actionObj.cellWidth):Math.ceil((c+(this.parent.getElementWidth(this.actionObj.clone)-p))/this.actionObj.cellWidth),this.parent.enableRtl&&(r=Math.round(c/this.actionObj.cellWidth)*this.actionObj.cellWidth+(e?0:this.parent.getElementWidth(this.actionObj.clone)-this.actionObj.cellWidth),s=Math.floor(r/this.actionObj.cellWidth)),l=s===o.length,s=this.getIndex(s)}var m,p=void 0,p=-1!==["Year","Month","Week","Date"].indexOf(n)?new Date(this.parent.activeView.renderDates[parseInt(s.toString(),10)].getTime()):this.parent.getDateFromElement(a.children[parseInt(s.toString(),10)]);-1===["TimelineMonth","Year","Month","Week","Date"].indexOf(n)&&this.parent.activeViewOptions.timeScale.enable?(e||(c+=this.parent.getElementWidth(this.actionObj.clone)),r=Math.floor(this.actionObj.slotInterval/this.actionObj.cellWidth*(c-Math.floor(c/this.actionObj.cellWidth)*this.actionObj.cellWidth)),r=l||!e&&0===r?this.actionObj.slotInterval:r,m=new Date(p.getTime()),m=new Date(p.getTime()+r*je),this.updateTimePosition(m)):m=new Date(p.setHours(m.getHours(),m.getMinutes(),m.getSeconds()))}else{o=B.closest(this.actionObj.clone,"td").cellIndex,s=Math.ceil((e?this.parent.getElementWidth(this.actionObj.element):0)/this.actionObj.cellWidth)*this.actionObj.cellWidth,h=Math.ceil((this.parent.getElementWidth(this.actionObj.clone)-s)/this.actionObj.cellWidth),a=B.closest(this.actionObj.clone,"tr"),c=e?o-h:o+h-1,c=this.getIndex(c);m=this.parent.getDateFromElement(a.children[parseInt(c.toString(),10)]),e?m.setHours(t.getHours(),t.getMinutes(),t.getSeconds()):m.setHours(i.getHours(),i.getMinutes(),i.getSeconds())}l=-1!==["TimelineMonth","Year","Month","Week","WorkWeek","Date","Day"].indexOf(n)||!this.parent.activeViewOptions.timeScale.enable;e?(i.getTime()-m.getTime()<=0&&(m=l?z(i):t),this.actionObj.start=l?m:this.calculateIntervalTime(m)):(r=l&&0===m.getHours()&&0===m.getMinutes()?Y(m,1):m,l&&r.getTime()-t.getTime()<=0&&(r=Y(z(t),1)),this.actionObj.end=l?r:this.calculateIntervalTime(r))},dl.prototype.getTopBottomStyles=function(e,t){var i=this.parent.element.querySelector("."+A),n=this.actionObj.cellHeight/this.actionObj.slotInterval*this.actionObj.interval,r=t?this.actionObj.element.offsetHeight+(this.actionObj.Y-this.actionObj.pageY):this.actionObj.element.offsetHeight+(this.actionObj.pageY-this.actionObj.Y),r=(a=t?this.actionObj.element.offsetTop-(this.actionObj.Y-this.actionObj.pageY):this.actionObj.clone.offsetTop)<0||this.actionObj.clone.offsetTop+this.actionObj.clone.offsetHeight>this.scrollArgs.height?this.actionObj.clone.offsetHeight:r,a=a<0?0:a;return r=(a=t?Math.floor(a/n)*n:a)+r>=i.scrollHeight?i.scrollHeight-a:Math.ceil(r/n)*n,!t&&this.actionObj.clone.offsetTop+r>=this.parent.getContentTable().offsetHeight&&(r=this.parent.getContentTable().offsetHeight-this.actionObj.clone.offsetTop),{height:B.formatUnit(r<this.actionObj.cellHeight?Math.floor(r/n)*n:r),top:B.formatUnit(r<this.actionObj.cellHeight&&t?Math.ceil(a/n)*n:a),left:"0px",right:"0px",width:"100%"}},dl.prototype.getLeftRightStyles=function(e,t){var i,n={},r=this.parent.activeView.isTimelineView(),a=-1<["TimelineDay","TimelineWeek","TimelineWorkWeek"].indexOf(this.parent.currentView)&&this.parent.activeViewOptions.timeScale.enable,s=this.actionObj.cellWidth/this.actionObj.slotInterval*this.actionObj.interval,o=t?this.actionObj.X-this.actionObj.pageX:this.actionObj.pageX-this.actionObj.X,l=r?Math.round(this.parent.getElementWidth(this.actionObj.element)/this.actionObj.cellWidth)*this.actionObj.cellWidth:"Month"===this.parent.currentView?this.parent.getElementWidth(this.actionObj.element):Math.ceil(this.parent.getElementWidth(this.actionObj.element)/this.actionObj.cellWidth)*this.actionObj.cellWidth,p=l+Math.ceil(o/this.actionObj.cellWidth)*this.actionObj.cellWidth,c=this.parent.enableRtl?parseInt(this.actionObj.element.style.right,10):this.actionObj.clone.offsetLeft,c=Math.round(c/s)*s,o=(a&&(p=l+Math.ceil(o/s)*s,t||(o=(+parseFloat(this.actionObj.element.style[this.parent.enableRtl?"right":"left"])).toFixed(1),i=Math.round(l/s)*s,o===c.toFixed(1)&&i===l)||(p=Math.round((c+p)/s)*s-c),this.actionObj.event[this.parent.eventFields.isAllDay]=!1),!t&&Math.floor(p+this.actionObj.clone.offsetLeft)>this.scrollArgs.width?this.parent.getElementWidth(this.actionObj.clone):(this.actionObj.cellWidth,p));return this.parent.enableRtl?(i=r?parseInt(this.actionObj.element.style.right,10):-(p-this.actionObj.cellWidth),i=!r&&(t||0<i)?0:i,r&&!t&&(i=Math.round(i/s)*s,(i-=Math.ceil((this.actionObj.pageX-this.actionObj.X)/s)*s)<0)&&(i=parseInt(this.actionObj.clone.style.right,10),o=parseInt(this.actionObj.clone.style.width,10)),i=i>=this.scrollArgs.width?this.scrollArgs.width-this.actionObj.cellWidth:i,n.right=B.formatUnit(i),o=o+i>this.scrollArgs.width?this.parent.getElementWidth(this.actionObj.clone):o):(c=t?this.actionObj.element.offsetLeft-(this.actionObj.X-this.actionObj.pageX):this.parent.enableRtl?this.actionObj.element.offsetLeft:0,r&&(c=t?c:parseInt(this.actionObj.clone.style.left,10),c=this.parent.enableRtl?!t&&this.actionObj.pageX<this.actionObj.X-this.parent.getElementWidth(this.actionObj.clone)?parseInt(this.actionObj.clone.style.right,10):c:t&&this.actionObj.pageX>this.actionObj.X+this.parent.getElementWidth(this.actionObj.clone)&&this.parent.getElementWidth(this.actionObj.clone)===this.actionObj.cellWidth?parseInt(this.actionObj.clone.style.left,10):c),p=c,(c=r?a?t?this.actionObj.element.offsetLeft-Math.ceil((this.actionObj.element.offsetLeft-c)/s)*s:c:Math.floor(c/this.actionObj.cellWidth)*this.actionObj.cellWidth:Math.ceil(Math.abs(c)/this.actionObj.cellWidth)*this.actionObj.cellWidth)<0&&(o=r&&t&&c%s?(c=parseInt(this.actionObj.clone.style.left,10),parseInt(this.actionObj.clone.style.width,10)):(c=0,this.parent.getElementWidth(this.actionObj.clone))),i=Math.ceil(this.parent.getElementWidth(this.actionObj.clone)/this.actionObj.cellWidth)*this.actionObj.cellWidth,t&&(n.left=B.formatUnit(!r&&t?p<0?-c:Math.ceil((l-i)/this.actionObj.cellWidth)*this.actionObj.cellWidth:c))),o=Math.floor(o),n.width=B.formatUnit(o),n},dl.prototype.resizeValidation=function(e){var e=this.parent.eventBase.getPageCoordinates(e),t=this.getContentAreaDimension(),i=this.parent.activeView.isTimelineView()&&this.parent.activeViewOptions.timeScale.enable,n=this.actionObj.cellWidth,r=!1;return this.resizeEdges.left&&(e.pageX<t.leftOffset&&e.pageX>=t.left&&i&&(n=0),r=e.pageX-n>=t.left),this.resizeEdges.right&&(e.pageX>t.rightOffset&&e.pageX<=t.right&&i&&(n=0),r=e.pageX+n<=t.right),this.resizeEdges.top&&(r=this.actionObj.clone.offsetTop>=t.top),r=this.resizeEdges.bottom?this.actionObj.clone.offsetTop+this.actionObj.clone.offsetHeight<=this.scrollArgs.height:r},dl.prototype.getModuleName=function(){return"resize"};var cl,hl,$o=dl;function dl(){return null!==hl&&hl.apply(this,arguments)||this}ul=function(e,t){return(ul=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}ul(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(vl,gl=es),vl.prototype.renderAppointments=function(){this.parent.dragAndDropModule&&this.parent.dragAndDropModule.setDragArea(),this.fields=this.parent.eventFields;for(var e="Year"===this.parent.currentView?"."+O+" ."+V:"."+x+",."+hn,t=0,i=[].slice.call(this.parent.element.querySelectorAll(e));t<i.length;t++){var n=i[t];B.remove(n)}this.renderedEvents=[],"Year"===this.parent.currentView?this.yearViewEvents():(this.removeCellHeight(),0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive?(this.isResource=!0,this.timelineResourceEvents()):this.timelineYearViewEvents()),this.parent.renderTemplates(),this.parent.notify(Ve,{})},vl.prototype.yearViewEvents=function(){for(var e=this.getMonths(),t=0,i=e;t<i.length;t++)for(var n=i[t],r=".e-month-calendar:nth-child("+(e.indexOf(n)+1)+") td.e-work-cells",a=[].slice.call(this.parent.element.querySelectorAll(r)),r=new Date(this.parent.selectedDate.getFullYear(),n,1),n=this.parent.calendarUtil.getMonthStartDate(new Date(r.getTime())),r=this.parent.calendarUtil.getMonthEndDate(new Date(r.getTime())),s=Ue(n,this.parent.activeViewOptions.firstDayOfWeek),o=Y(Be(r,this.parent.activeViewOptions.firstDayOfWeek),1),l=0;s.getTime()<o.getTime();l++){var p=z(new Date(s.getTime())),c=Y(new Date(p.getTime()),1),s=Y(new Date(s.getTime()),1);this.parent.isMinMaxDate(p)&&0<this.parent.eventBase.filterEvents(p,c).length&&(p=a[parseInt(l.toString(),10)])&&p.appendChild(B.createElement("div",{className:V}))}},vl.prototype.timelineYearViewEvents=function(){for(var n,r=this,e=this.parent.element.querySelector("."+O+":not(."+E+")"),e=(this.cellWidth=this.parent.getElementWidth(e),this.cellHeader=ot(e.querySelector("."+Pi)),this.parent.element.querySelector("."+Ft)),t=(this.eventHeight=this.parent.getElementHeightFromClass(e,V),this.addCellHeight(".e-month-header-wrapper tbody tr,.e-resource-column-table tbody tr,.e-content-table tbody tr",this.eventHeight,2,this.cellHeader,this.moreIndicatorHeight),[].slice.call(this.parent.element.querySelectorAll("."+fi))),i=this.getMonths(),o=0<this.parent.activeViewOptions.group.resources.length&&this.parent.uiStateValues.isGroupAdaptive?this.parent.uiStateValues.groupIndex:void 0,l=0;l<i.length;l++){var a=t[parseInt(l.toString(),10)],s=l+1,p=B.createElement("div",{className:x}),c=(a.appendChild(p),new Date(this.parent.selectedDate.getFullYear(),i[parseInt(l.toString(),10)],1)),h=new Date(c.getFullYear(),c.getMonth()+1,0),d=c.getDay(),u=[];for("Horizontal"===this.parent.activeViewOptions.orientation&&(this.renderedEvents=[]);c.getTime()<=h.getTime();){for(var g=void 0,m=void 0,v=("Vertical"===this.parent.activeViewOptions.orientation?(T=t[parseInt(d.toString(),10)],s=d+1,(p=T.querySelector("."+x))||(p=B.createElement("div",{className:x}),T.appendChild(p)),this.parent.enableRtl?m=l*this.cellWidth:g=l*this.cellWidth):this.parent.enableRtl?m=(d+c.getDate()-1)*this.cellWidth:g=(d+c.getDate()-1)*this.cellWidth,this.parent.element.querySelector(".e-content-wrap tr:nth-child("+s+") td")),f=(this.cellHeight=v.offsetHeight,z(new Date(c.getTime()))),y=Y(new Date(f.getTime()),1),T=void 0,w=(this.parent.uiStateValues.isGroupAdaptive&&(T=this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex]),this.parent.eventBase.filterEvents(f,y,void 0,T)),w=this.parent.eventBase.sortByDateTime(w),D=this,b=0,S=w.length;b<S;b++)!function(e,t){var i=B.extend({},w[parseInt(e.toString(),10)],null,!0),e=(D.updateSpannedEvents(i,f,y),D.getIndex(f)),n=(i.Index=e,D.cellHeader+D.eventHeight*(e+1)+2+D.moreIndicatorHeight),r=D.cellHeight-D.cellHeader-D.moreIndicatorHeight,r=Math.floor(r/(D.eventHeight+2)),a=D.parent.rowAutoHeight?1:D.parent.activeViewOptions.maxEventsPerRow,a=D.parent.activeViewOptions.maxEventsPerRow?t-a:t-r<=0?1:t-r;if("Horizontal"===D.parent.activeViewOptions.orientation){var s,t=D.renderedEvents.filter(function(e){return e.Guid===i.Guid}),r=u.filter(function(e){return e.Guid===i.Guid});if(0<t.length&&t[0].MoreIndicator||0<r.length&&r[0].MoreIndicator)return s="Horizontal"===D.parent.activeViewOptions.orientation?l:d,D.renderMoreIndicator(p,a,f,s,g,m,o);if(0<t.length||0<r.length)return}if(D.maxHeight&&-1!==D.parent.currentView.indexOf("Timeline")&&0<e)return;D.parent.rowAutoHeight||D.shouldRenderAppointment(e,n)?(D.renderEvent(p,i,l,g,m,c,d),(D.parent.rowAutoHeight||D.cellHeight>n)&&D.updateCellHeight(v,n),u.push(i)):(s="Horizontal"===D.parent.activeViewOptions.orientation?l:d,D.renderMoreIndicator(p,a,f,s,g,m,o),"Horizontal"===D.parent.activeViewOptions.orientation&&(i.MoreIndicator=!0,D.renderedEvents.push(i),u.push(i)))}(b,S);c=Y(new Date(c.getTime()),1),"Vertical"===this.parent.activeViewOptions.orientation&&(d++,this.renderedEvents=[])}}this.parent.rowAutoHeight&&"Vertical"===this.parent.activeViewOptions.orientation&&(e=[].slice.call(this.parent.element.querySelectorAll("."+fi)),n=[].slice.call(this.parent.element.querySelectorAll("."+C+" tbody tr")),e.forEach(function(e,t){var e=[].slice.call(e.querySelectorAll("."+V)),i=n[parseInt(t.toString(),10)].offsetTop+r.cellHeader+2;e.forEach(function(e){var t=parseInt(e.getAttribute("data-index"),10);e.style.top=i+t*r.eventHeight+"px",e.removeAttribute("data-index")})}))},vl.prototype.updateSpannedEvents=function(e,t,i){var n=this.isResource&&"Vertical"===this.parent.activeViewOptions.orientation||!this.isResource&&"Horizontal"===this.parent.activeViewOptions.orientation,r={isLeft:!0,isRight:!0,isBottom:!0,isTop:!0};t.getTime()<=e[this.fields.startTime].getTime()&&(n?r.isLeft=!1:r.isTop=!1),(i.getTime()>=e[this.fields.endTime].getTime()||n&&!this.isResource&&Y(i,-1).getMonth()===e[this.fields.endTime].getMonth()||n&&this.isResource&&i.getTime()<=e[this.fields.endTime].getTime())&&(n?r.isRight=!1:r.isBottom=!1),e.data=r},vl.prototype.timelineResourceEvents=function(){var s,i,o=this,e=this.parent.element.querySelector("."+A),t=e.offsetWidth>e.clientWidth,n=this.parent.element.querySelector("."+O),n=(this.cellWidth=this.parent.getElementWidth(n),this.cellHeader=0,this.parent.element.querySelector("."+Ft)),r=(this.eventHeight=this.parent.getElementHeightFromClass(n,V),this.addCellHeight(".e-month-header-wrapper tbody tr,.e-resource-column-table tbody tr,.e-content-table tbody tr",this.eventHeight,2,this.cellHeader,this.moreIndicatorHeight),[].slice.call(this.parent.element.querySelectorAll("."+fi))),a=this.parent.uiStateValues.isGroupAdaptive?[this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex]]:this.parent.activeViewOptions.allowVirtualScrolling?this.parent.resourceBase.renderedResources:this.parent.resourceBase.lastResourceLevel,l=this.getMonths();if("Horizontal"===this.parent.activeViewOptions.orientation)for(var p=0;p<l.length;p++)for(var c=new Date(this.parent.selectedDate.getFullYear(),l[parseInt(p.toString(),10)],1),h=0,d=a.length;h<d;h++)this.renderedEvents=[],this.renderResourceEvent(r[parseInt(p.toString(),10)],a[parseInt(h.toString(),10)],p,h,c);else for(h=0,d=a.length;h<d;h++){this.renderedEvents=[];for(p=0;p<l.length;p++){c=new Date(this.parent.selectedDate.getFullYear(),l[parseInt(p.toString(),10)],1);this.renderResourceEvent(r[parseInt(h.toString(),10)],a[parseInt(h.toString(),10)],p,h,c)}}this.parent.rowAutoHeight&&!t&&e.offsetWidth>e.clientWidth&&([].slice.call(this.parent.element.querySelectorAll("."+V)).forEach(function(e){e.style.removeProperty("left"),e.style.removeProperty("right")}),n=[].slice.call(this.parent.element.querySelectorAll("."+fi)),s=this.parent.element.querySelector("."+C),i=[].slice.call(s.querySelectorAll("tbody tr")),n.forEach(function(e,t){var e=[].slice.call(e.children),a=i[parseInt(t.toString(),10)];e.forEach(function(e,t){var i,t=a.querySelector("td:nth-child("+(t+1)+")"),e=[].slice.call(e.children),n=o.parent.getElementWidth(t),r=t.offsetLeft;o.parent.enableRtl?(i=s.offsetWidth-r-t.offsetWidth,e.forEach(function(e){e.style.width=Math.floor(parseInt(e.style.width,10)/n)*n+"px",e.style.right=i+"px"})):e.forEach(function(e){e.style.width=Math.floor(parseInt(e.style.width,10)/n)*n+"px",e.style.left=r+"px"})})}))},vl.prototype.shouldRenderAppointment=function(e,t){var i=this.parent.rowAutoHeight?1:this.parent.activeViewOptions.maxEventsPerRow;return!this.parent.activeViewOptions.maxEventsPerRow||this.parent.rowAutoHeight||this.parent.eventSettings.enableIndicator?this.maxOrIndicator?e<1:this.cellHeight>t:e<i},vl.prototype.renderResourceEvent=function(e,t,l,p,c){for(var h=B.createElement("div",{className:x}),e=(e.appendChild(h),Y(ze(new Date(c.getTime())),1)),d=this.parent.eventBase.filterEvents(c,e,void 0,t),e="Vertical"===this.parent.activeViewOptions.orientation?p:l,u=this.parent.element.querySelector(".e-content-wrap tr:nth-child("+(e+1)+") td"),g=(this.cellHeight=u.offsetHeight,this.groupOrder=t.groupOrder,[]),m=this,i=0;i<d.length;i++){var n=function(e){var t=d[parseInt(e.toString(),10)],i=void 0,n=B.extend({},t,null,!0),t=(i=0<m.parent.activeViewOptions.group.resources.length?(t=m.isSpannedEvent(n,c),m.getIndex(t[m.fields.startTime])):m.getIndex(n[m.fields.startTime]),n.Index=i,m.cellHeader+m.eventHeight*(e+1)+2+m.moreIndicatorHeight),r="Vertical"===m.parent.activeViewOptions.orientation?l*m.cellWidth:p*m.cellWidth;if(!m.parent.isMinMaxDate(n[m.fields.startTime]))return{value:void 0};if("Vertical"===m.parent.activeViewOptions.orientation&&0<m.parent.activeViewOptions.group.resources.length){var a=m.renderedEvents.filter(function(e){return e.Guid===n.Guid}),s=g.filter(function(e){return e.Guid===n.Guid});if(0<a.length||0<s.length)return"continue"}if(m.maxHeight&&-1!==m.parent.currentView.indexOf("Timeline")&&0<i)return"continue";if(!m.parent.rowAutoHeight&&!m.shouldRenderAppointment(i,t)){a="Horizontal"===m.parent.activeViewOptions.orientation?l:p;if(m.renderMoreIndicator(h,d.length-e,c,a,r,r,p),"Horizontal"===m.parent.activeViewOptions.orientation)for(var o=p;o<d.length;o++)m.renderedEvents.push(B.extend({},d[parseInt(o.toString(),10)],{Index:i+o},!0));return"break"}m.renderEvent(h,n,l,r,r,c,p),m.updateCellHeight(u,t),g.push(n)}(i);if("object"==typeof n)return n.value;if("break"===n)break}},vl.prototype.setMaxEventHeight=function(e,t){t=t.offsetHeight-this.cellHeader-(this.maxHeight?0:this.moreIndicatorHeight);B.setStyleAttribute(e,{height:t+"px","align-items":"center"})},vl.prototype.renderEvent=function(t,e,i,n,r,a,s){var o,l=this,p=this.isSpannedEvent(e,a),c=this.createEventElement(p);1===p.isSpanned.count&&(e=Y(p[this.fields.endTime],-1),p[this.fields.endTime]=e>p[this.fields.startTime]?e:p[this.fields.endTime]),p[this.fields.startTime]>p[this.fields.endTime]||(a="Horizontal"===this.parent.activeViewOptions.orientation?(o=i+1,p[this.fields.startTime].getTime()===p[this.fields.endTime].getTime()&&(p.isSpanned.count=1),p.isSpanned.count*this.cellWidth):(o=s+1,this.isResource?p.isSpanned.count*this.cellWidth:this.cellWidth),i=(e=this.parent.element.querySelector(".e-content-wrap tr:nth-child("+o+") td")).offsetTop+this.cellHeader+this.eventHeight*p.Index+2,B.setStyleAttribute(c,{width:a+"px",height:this.eventHeight+"px",left:n+"px",right:r+"px",top:i+"px"}),this.maxOrIndicator&&-1!==this.parent.currentView.indexOf("Timeline")&&this.setMaxEventHeight(c,e),!this.isResource&&this.parent.rowAutoHeight&&"Vertical"===this.parent.activeViewOptions.orientation&&c.setAttribute("data-index",p.Index.toString()),this.parent.trigger(ie,{data:p,element:c,cancel:!1,type:"event"},function(e){!e.cancel&&(t.appendChild(c),l.wireAppointmentEvents(c,p),0<l.parent.activeViewOptions.group.resources.length||"Vertical"===l.parent.activeViewOptions.orientation||(p.isSpanned.isRight||p.isSpanned.isLeft)&&"Horizontal"===l.parent.activeViewOptions.orientation||!p.isSpanned.isRight)&&l.renderedEvents.push(B.extend({},p,null,!0))}))},vl.prototype.renderMoreIndicator=function(e,t,i,n,r,a,s){var o;0===this.parent.activeViewOptions.group.resources.length&&e.querySelector('[data-start-date="'+i.getTime()+'"]')||(o=0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive?Y(ze(new Date(i.getTime())),1):Y(new Date(i.getTime()),1),t=this.getMoreIndicatorElement(t,i,o),i=this.parent.element.querySelector(".e-content-wrap tr:nth-child("+(n+1)+")").offsetTop+(this.cellHeight-this.moreIndicatorHeight),r=Math.floor(r/this.cellWidth)*this.cellWidth,a=Math.floor(a/this.cellWidth)*this.cellWidth,B.setStyleAttribute(t,{width:this.cellWidth+"px",left:r+"px",right:a+"px",top:i+"px"}),B.isNullOrUndefined(s)||t.setAttribute("data-group-index",s.toString()),e.appendChild(t),B.EventHandler.add(t,"click",this.moreIndicatorClick,this))},vl.prototype.createEventElement=function(e){var t,i=e[this.fields.subject]||this.parent.eventSettings.fields.subject.default||this.parent.localeObj.getConstant("addTitle"),n=B.createElement("div",{className:V,attrs:{"data-id":"Appointment_"+e[this.fields.id],"data-guid":e.Guid,role:"button",tabindex:"0","aria-disabled":this.parent.eventBase.getReadonlyAttribute(e),"aria-label":this.parent.getAnnouncementString(e)}}),r=(this.cssClass&&B.addClass([n],this.cssClass),e[this.fields.isReadonly]&&B.addClass([n],Rr),0<this.parent.activeViewOptions.group.resources.length&&(r=this.getGroupIndexFromEvent(e),n.setAttribute("data-group-index",r.toString())),[]),a=B.extend({},e,null,!0),s=(this.parent.activeViewOptions.eventTemplate?(s=this.parent.element.id+"_"+this.parent.activeViewOptions.eventTemplateName+"eventTemplate",r=this.parent.getAppointmentTemplate()(a,this.parent,"eventTemplate",s,!1,void 0,void 0,this.parent.root)):(s=e[this.fields.location]||this.parent.eventSettings.fields.location.default||"",i=B.createElement("div",{className:Gn,innerHTML:i+(s?"; "+s:"")}),s=B.createElement("div",{className:Ci+(this.parent.isAdaptive?" "+d:""),innerHTML:this.parent.getTimeString(a[this.fields.startTime])}),t=B.createElement("div",{className:Ci+(this.parent.isAdaptive?" "+d:""),innerHTML:this.parent.getTimeString(a[this.fields.endTime])}),B.addClass([i],"e-text-center"),e[this.fields.isAllDay]?r=[i]:a.isLeft||a.isRight?(a.isLeft||r.push(s),r.push(i),a.isRight||r.push(t)):r=[s,i,t]),B.createElement("div",{className:Di}));return B.append(r,s),n.appendChild(s),this.parent.eventBase.renderSpannedIcon(n,e.isSpanned),this.renderResizeHandler(n,e.data,e[this.fields.isReadonly]),this.applyResourceColor(n,a,"backgroundColor",this.groupOrder),n},vl.prototype.isSpannedEvent=function(e,t){var i=new Date(t.getFullYear(),t.getMonth(),1),t=Y(new Date(t.getFullYear(),t.getMonth()+1,0),1),n=B.extend({},e,null,!0),r=n[this.fields.startTime],a=n[this.fields.endTime],s={isLeft:!1,isRight:!1,count:1},o=new Date(this.parent.selectedDate.getFullYear(),this.parent.firstMonthOfYear,1),l=Ke(o,this.parent.monthsCount);return this.isResource&&this.updateSpannedEvents(e,i,t),"Vertical"===this.parent.activeViewOptions.orientation&&0<this.parent.activeViewOptions.group.resources.length?(this.updateSpannedEventDetails(r,a,o,l,n,s),o=n[this.fields.startTime],l=new Date(n[this.fields.endTime]-1),s.count=l.getMonth()-o.getMonth()+this.parent.monthsCount*(l.getFullYear()-o.getFullYear())+1):(this.updateSpannedEventDetails(r,a,i,t,n,s),0!==this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive||(l=z(n[this.fields.endTime]).getTime(),o=z(n[this.fields.startTime]).getTime(),(e[this.fields.isAllDay]&&l===e[this.fields.endTime].getTime()||s.isRight)&&(l=Y(new Date(l),-1).getTime()),s.count=Math.round((l-o)/W)+1)),n.isSpanned=s,z(r).getTime()<z(this.parent.minDate).getTime()&&(n[this.fields.startTime]=this.parent.minDate),z(a).getTime()>z(this.parent.maxDate).getTime()&&(n[this.fields.endTime]=this.parent.maxDate),n},vl.prototype.updateSpannedEventDetails=function(e,t,i,n,r,a){e.getTime()<i.getTime()&&(r[this.fields.startTime]=i,a.isLeft=!0),t.getTime()>n.getTime()&&(r[this.fields.endTime]=n,a.isRight=!0)},vl.prototype.getOverlapEvents=function(e,t){var i,n,r,a,s=[];0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive?(i=this.parent.calendarUtil.getMonthStartDate(new Date(e.getTime())),n=Y(this.parent.calendarUtil.getMonthEndDate(new Date(e.getTime())),-1),r=z(new Date(i.getTime())).getTime(),a=z(new Date(n.getTime())).getTime()):this.parent.rowAutoHeight?(r=z(new Date(e.getTime())).getTime(),a=Y(z(new Date(e.getTime())),1).getTime()):r=a=z(new Date(e.getTime())).getTime();for(var o=0,l=t;o<l.length;o++){var p=l[o],c=new Date(p[this.fields.startTime].getTime()),h=new Date(p[this.fields.endTime].getTime()),d=p[this.fields.isAllDay]?z(h).getTime()>r:z(h).getTime()>=r;(z(c).getTime()<=r&&d||z(c).getTime()>=r&&z(h).getTime()<=a||"Vertical"===this.parent.activeViewOptions.orientation&&z(c).getTime()>=r&&z(h).getTime()>=a)&&s.push(p)}return s},vl.prototype.getMonths=function(){var i=this;return Array.apply(null,{length:this.parent.monthsCount}).map(function(e,t){return i.parent.firstMonthOfYear+t})},vl.prototype.removeCellHeight=function(){for(var e=0,t=[].slice.call(this.element.querySelectorAll(".e-month-header-wrapper tbody tr,.e-resource-column-table tbody tr,.e-content-table tbody tr"));e<t.length;e++)t[e].firstElementChild.style.height=""},vl.prototype.destroy=function(){gl.prototype.destroy.call(this),this.parent=null};var ul,gl,ml=vl;function vl(e){e=gl.call(this,e,"day")||this;return e.isResource=!1,e}fl=function(e,t){return(fl=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}fl(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(f,yl=rl),f.prototype.wireDragEvent=function(e){new B.Draggable(e,{abort:"."+Xi+", ."+Nr,clone:!0,isDragScroll:!0,enableTailMode:!!this.parent.eventDragArea,cursorAt:this.parent.eventDragArea?{left:-20,top:-20}:{left:0,top:0},dragArea:this.dragArea,dragStart:this.dragStart.bind(this),drag:this.drag.bind(this),dragStop:this.dragStop.bind(this),enableAutoScroll:!1,helper:this.dragHelper.bind(this),queryPositionInfo:this.dragPosition.bind(this)})},f.prototype.setDragArea=function(){var e=document.querySelector(this.parent.eventDragArea);this.dragArea=this.parent.eventDragArea&&e?e:this.parent.element.querySelector("."+C)},f.prototype.dragHelper=function(e){var i=this;if(e.sender&&"touchmove"===e.sender.type&&(!this.parent.uiStateValues.isTapHold||!e.element.classList.contains(wi)))return null;this.setDragActionDefaultValues(),this.actionObj.element=e.element,e.sender&&-1<["Day","Week","WorkWeek"].indexOf(this.parent.currentView)&&(t=this.parent.eventBase.getPageCoordinates(e.sender),this.distanceUptoCursor=t.clientY-this.actionObj.element.getBoundingClientRect().top,this.eleTop=parseFloat(this.actionObj.element.style.top),this.slotsUptoCursor=-1),this.actionObj.action="drag";var t=[];return!this.parent.allowMultiDrag||B.isNullOrUndefined(this.parent.selectedElements)||0===this.parent.selectedElements.length||0<this.parent.selectedElements.length&&-1===this.parent.selectedElements.indexOf(this.actionObj.element)?t=[e.element]:(t=this.parent.selectedElements,this.isMultiSelect=!0),t.forEach(function(e){var t=i.createCloneElement(e);e.getAttribute("data-guid")===i.actionObj.element.getAttribute("data-guid")&&(i.actionObj.clone=t,i.parent.eventDragArea||"Month"===i.parent.currentView||!i.parent.activeViewOptions.timeScale.enable||i.parent.activeView.isTimelineView()||i.actionObj.element.classList.contains(an)||B.setStyleAttribute(i.actionObj.clone,{cursor:"move",left:"0%",right:"0%",width:"100%"}),i.actionObj.clone.style.top=B.formatUnit(i.actionObj.element.offsetTop)),i.actionObj.cloneElement.push(t),i.actionObj.originalElement.push(e)}),this.actionObj.clone},f.prototype.dragPosition=function(e){var t,i,n,r,a;return this.parent.eventDragArea?{left:e.left,top:e.top}:(t=this.actionObj.cellHeight/this.actionObj.slotInterval*this.actionObj.interval,i=B.formatUnit(0),"Month"===this.parent.currentView&&(i=e.left),n=this.isStepDragging?Math.ceil(this.actionObj.clone.getBoundingClientRect().right)+this.actionObj.interval:this.actionObj.clone.getBoundingClientRect().right,a=this.parent.element.querySelector("."+A).getBoundingClientRect().right,!(this.parent.activeView.isTimelineView()&&"TimelineYear"!==this.parent.currentView&&!this.parent.enableRtl&&this.actionObj.pageX>n)||this.isMorePopupOpened||this.actionObj.pageX>a||(this.isCursorAhead=!0),this.parent.activeView.isTimelineView()&&(i=B.formatUnit(this.actionObj.clone.offsetLeft)),this.parent.activeView.isTimelineView()||!this.parent.timeScale.enable||!B.isNullOrUndefined(this.actionObj.clone.offsetParent)&&this.actionObj.clone.offsetParent.classList.contains(Cn)?r=B.formatUnit(this.actionObj.clone.offsetTop):"Month"===this.parent.currentView?r=B.formatUnit(0):this.actionObj.clone.classList.contains(an)?(r=B.formatUnit(this.parent.element.querySelector("."+Ot).offsetTop),B.setStyleAttribute(this.actionObj.clone,{width:B.formatUnit(Math.ceil(this.actionObj.clone.offsetWidth/this.actionObj.cellWidth)*this.actionObj.cellWidth),right:this.parent.enableRtl&&B.formatUnit(0)})):(this.actionObj.element.classList.contains(an)&&!this.actionObj.clone.classList.contains(an)&&B.setStyleAttribute(this.actionObj.clone,{height:B.formatUnit(this.actionObj.cellHeight),width:B.formatUnit(this.actionObj.cellWidth-1),pointerEvents:"none"}),n=(n=parseInt(e.top,10))<0?0:n,this.slotsUptoCursor<0&&(a=Math.floor((this.eleTop+this.distanceUptoCursor)/t),e=Math.floor(this.eleTop/t),this.slotsUptoCursor=a-e),n=(Math.floor((n+this.distanceUptoCursor+1)/t)-this.slotsUptoCursor)*t,r=B.formatUnit(n<0?0:n),(a=this.parent.element.querySelector(".e-content-wrap").scrollHeight)<(e=parseInt(r,10)+this.actionObj.clone.offsetHeight)&&(r=parseInt(r,10)-(e-a)+"px"),this.isPreventMultiDrag&&(r=B.formatUnit(this.actionObj.clone.offsetTop))),{left:i,top:r})},f.prototype.setDragActionDefaultValues=function(){this.actionObj.action="drag",this.actionObj.isAllDay=null,this.actionObj.slotInterval=this.parent.activeViewOptions.timeScale.interval/this.parent.activeViewOptions.timeScale.slotCount,this.actionObj.interval=this.actionObj.slotInterval;var e=this.parent.element.querySelector("."+O);this.actionObj.cellWidth=e.offsetWidth,this.actionObj.cellHeight=e.offsetHeight},f.prototype.dragStart=function(i){var n=this,e=this.actionObj.element.getAttribute("data-guid"),r=(this.actionObj.event=this.parent.eventBase.getEventByGuid(e),B.extend({},this.actionObj.event,null,!0)),a=(B.isNullOrUndefined(r)||(this.startTime=r[this.parent.eventFields.startTime].getTime()),this.parent.allowMultiDrag||this.parent.eventBase.removeSelectedAppointmentClass(),{cancel:!1,data:r,selectedData:this.getSelectedData(),event:i,excludeSelectors:null,element:this.actionObj.element,interval:this.actionObj.interval,navigation:{enable:!1,timeDelay:2e3},scroll:{enable:!0,scrollBy:30,timeDelay:100}});this.parent.trigger(oe,a,function(e){var t;e.cancel||!B.isNullOrUndefined(n.actionObj.element)&&B.isNullOrUndefined(n.actionObj.element.parentElement)?(t=n.actionObj.element.ej2_instances[0],B.isNullOrUndefined(t)||t.intDestroy(i.event),n.isMultiSelect=!1,n.multiData=[],n.actionObj.action="",n.removeCloneElementClasses(),n.removeCloneElement()):(n.actionClass("addClass"),n.parent.uiStateValues.action=!0,n.actionObj.start=r[n.parent.eventFields.startTime],n.actionObj.end=r[n.parent.eventFields.endTime],n.actionObj.groupIndex=parseInt(n.actionObj.element.getAttribute("data-group-index")||"0",10),n.actionObj.interval=e.interval,n.actionObj.navigation=e.navigation,n.actionObj.scroll=e.scroll,n.enableCurrentViewDrag=a.dragWithinRange&&!a.navigation.enable&&n.parent.allowMultiDrag,n.actionObj.excludeSelectors=e.excludeSelectors,t=n.parent.element.querySelector("."+A),n.scrollArgs={element:t,width:t.scrollWidth,height:t.scrollHeight},n.widthPerMinute=n.actionObj.cellWidth/n.actionObj.slotInterval*n.actionObj.interval,n.heightPerMinute=n.actionObj.cellHeight/n.actionObj.slotInterval*n.actionObj.interval,n.widthUptoCursorPoint=0,n.heightUptoCursorPoint=0,n.cursorPointIndex=-1,n.isHeaderRows=!1,n.isTimelineDayProcess=!1,n.minDiff=0,n.isMorePopupOpened=!1,n.daysVariation=-1,n.isAllDayTarget=n.actionObj.clone.classList.contains(an),!n.parent.activeView.isTimelineView()&&n.parent.timeScale.enable||"TimelineYear"===n.parent.currentView||(!B.isNullOrUndefined(n.actionObj.clone.offsetParent)&&n.actionObj.clone.offsetParent.classList.contains(Cn)&&(n.isMorePopupOpened=!0),n.actionObj.pageX=i.event.pageX,e=n.parent.activeViewOptions.headerRows,n.isHeaderRows=0<e.length&&"Hour"!==e[e.length-1].option&&"Date"!==e[e.length-1].option,n.isTimelineDayProcess=!n.parent.activeViewOptions.timeScale.enable||n.isHeaderRows||"TimelineMonth"===n.parent.currentView||0<e.length&&"Date"===e[e.length-1].option,n.isAllDayDrag=!n.isTimelineDayProcess&&r[n.parent.eventFields.isAllDay],n.isStepDragging=!n.isTimelineDayProcess&&!n.isAllDayDrag&&n.actionObj.slotInterval!==n.actionObj.interval,n.isTimelineDayProcess?n.timelineEventModule=new es(n.parent,"day"):n.timelineEventModule=new es(n.parent,"hour")),"TimelineYear"===n.parent.currentView&&(n.yearEvent=new ml(n.parent)),"Month"===n.parent.currentView&&(n.startTime=z(new Date(n.startTime)).getTime(),n.updateOriginalElement(n.actionObj.clone),n.monthEvent=new Za(n.parent)),"Day"!==n.parent.currentView&&"Week"!==n.parent.currentView&&"WorkWeek"!==n.parent.currentView||(n.verticalEvent=new Xa(n.parent),n.verticalEvent.initializeValues(),n.splitEvent(n.actionObj.event).forEach(function(e){var e='.e-day-wrapper[data-date="'+z(e[n.parent.eventFields.startTime]).getTime()+'"]',e=(0<n.parent.activeViewOptions.group.resources.length&&(e=e.concat('[data-group-index = "'+n.actionObj.groupIndex+'"]')),n.parent.element.querySelector(e));e&&(e=e.querySelector('[data-id="'+n.actionObj.clone.getAttribute("data-id")+'"]'))&&B.addClass([e],Wi)})))})},f.prototype.getSelectedData=function(){if(this.isMultiSelect&&0===this.multiData.length&&0<this.parent.selectedElements.length)for(var e=0,t=this.parent.selectedElements;e<t.length;e++){var i=t[e].getAttribute("data-guid"),i=this.parent.eventBase.getEventByGuid(i);this.multiData.push(B.extend({},i,null,!0))}return this.multiData},f.prototype.drag=function(e){var t,i,n,r;e.event&&"touchmove"===e.event.type&&e.event.preventDefault(),this.parent.quickPopup&&this.parent.quickPopup.quickPopupHide(!0),!B.isNullOrUndefined(e.target)&&e.target.classList&&e.target.classList.contains(yr)||(t=B.extend({},this.actionObj.event,null,!0),i=this.parent.eventBase.getPageCoordinates(e),this.actionObj.Y=this.actionObj.pageY=i.pageY,this.actionObj.X=this.actionObj.pageX=i.pageX,this.actionObj.target=e.target,this.widthUptoCursorPoint=0===this.widthUptoCursorPoint?Math.ceil(Math.abs(this.actionObj.clone.getBoundingClientRect().left-this.actionObj.X)/this.widthPerMinute)*this.widthPerMinute:this.widthUptoCursorPoint,this.widthUptoCursorPoint=this.isMorePopupOpened?this.actionObj.cellWidth:this.widthUptoCursorPoint,this.heightUptoCursorPoint=0===this.heightUptoCursorPoint?Math.ceil(Math.abs(this.actionObj.clone.getBoundingClientRect().top-this.actionObj.Y)/this.heightPerMinute)*this.heightPerMinute:this.heightUptoCursorPoint,-1<["Day","Week","WorkWeek"].indexOf(this.parent.currentView)&&(this.isAllDayDrag=this.parent.activeViewOptions.timeScale.enable?this.actionObj.clone.classList.contains(an):this.actionObj.event[this.parent.eventFields.isAllDay]),this.isStepDragging&&0===this.minDiff&&this.calculateMinutesDiff(t),"Month"!==this.parent.currentView&&!this.isAllDayDrag||!(this.daysVariation<0)||(n=this.parent.getDateFromElement(this.actionObj.target),B.isNullOrUndefined(n))?this.daysVariation=0:(n=z(n),r=z(new Date(t[this.parent.eventFields.startTime].getTime())),this.daysVariation=(n.getTime()-r.getTime())/W),this.parent.eventDragArea&&(n=i.target,this.actionObj.clone.style.top=B.formatUnit(n.offsetTop),this.actionObj.clone.style.left=B.formatUnit(n.offsetLeft),B.closest(n,"."+vt)?"Week"!==this.parent.currentView&&"WorkWeek"!==this.parent.currentView&&"Day"!==this.parent.currentView&&(this.actionObj.clone.style.width=B.formatUnit(this.actionObj.element.offsetWidth)):(this.actionObj.clone.style.height="",this.actionObj.clone.style.width="")),this.updateScrollPosition(e),this.updateNavigatingPosition(e),this.updateDraggingDateTime(e),r={data:t,event:e,element:this.actionObj.element,startTime:this.actionObj.start,endTime:this.actionObj.end,selectedData:this.updatedData},0<this.parent.group.resources.length&&(r.groupIndex=this.actionObj.groupIndex),this.parent.trigger(le,r))},f.prototype.calculateMinutesDiff=function(e){this.parent.enableRtl?this.minDiff=(this.actionObj.clone.offsetWidth-this.widthUptoCursorPoint)/this.widthPerMinute*this.actionObj.interval:this.minDiff=this.widthUptoCursorPoint/this.widthPerMinute*this.actionObj.interval;var e=e[this.parent.eventFields.startTime],t=Je(this.parent.activeView.renderDates[0],this.parent.activeView.getStartHour(),this.parent.activeView.getEndHour());t.startHour.getTime()>e.getTime()&&(this.minDiff=this.minDiff+(t.startHour.getTime()-e.getTime())/je)},f.prototype.dragStop=function(e){var t,i,n=this;this.isCursorAhead=!1,this.isPreventMultiDrag=!1,this.removeCloneElementClasses(),this.removeCloneElement(),clearInterval(this.actionObj.navigationInterval),this.actionObj.navigationInterval=null,clearInterval(this.actionObj.scrollInterval),this.actionObj.scrollInterval=null,this.actionClass("removeClass"),this.parent.uiStateValues.action=this.parent.uiStateValues.isTapHold=!1,this.isAllowDrop(e)||(t=e.target.classList&&!e.target.classList.contains("e-work-cells")&&this.parent.cellTemplate?B.closest(e.target,".e-work-cells"):e.target,i={cancel:!1,data:this.getChangedData(this.updatedData),selectedData:this.updatedData,event:e,element:this.actionObj.element,target:t},this.actionObj.action=null,this.parent.trigger(pe,i,function(e){var t;e.cancel||n.parent.eventBase.checkOverlap(e.data)||(n.parent.isSpecificResourceEvents()&&(n.parent.crudModule.crudObj.isCrudAction=!0,n.parent.crudModule.crudObj.sourceEvent=[n.parent.resourceBase.lastResourceLevel[parseInt(i.element.getAttribute("data-group-index"),10)]],t=parseInt(i.target.getAttribute("data-group-index"),10)||n.actionObj.groupIndex,n.parent.crudModule.crudObj.targetEvent=[n.parent.resourceBase.lastResourceLevel[parseInt(t.toString(),10)]]),n.saveChangedData(e,n.isMultiSelect))}),this.updatedData=[],this.multiData=[],this.isMultiSelect=!1,this.parent.selectedElements=[])},f.prototype.updateNavigatingPosition=function(i){var n,r=this;this.actionObj.navigation.enable&&(n=this.parent.getCurrentTime(),B.isNullOrUndefined(this.actionObj.navigationInterval))&&(this.actionObj.navigationInterval=window.setInterval(function(){var e,t;n&&(e=r.parent.getCurrentTime().getSeconds(),(t=60<=(t=n.getSeconds()+r.actionObj.navigation.timeDelay/1e3)?t-60:t)===e)&&(n=r.parent.getCurrentTime(),r.viewNavigation(i),r.updateDraggingDateTime(i))},this.actionObj.navigation.timeDelay))},f.prototype.updateDraggingDateTime=function(e){!B.isNullOrUndefined(this.actionObj.clone.offsetParent)&&this.actionObj.clone.offsetParent.classList.contains(Cn)?this.morePopupEventDragging(e):this.parent.activeView.isTimelineView()&&"TimelineYear"!==this.parent.currentView?(this.timelineEventModule.dateRender=this.parent.activeView.renderDates,this.timelineEventModule.cellWidth=this.actionObj.cellWidth,this.timelineEventModule.getSlotDates(),this.actionObj.cellWidth=this.isHeaderRows?this.timelineEventModule.cellWidth:this.parent.getElementWidth(this.parent.element.querySelector("."+O)),this.calculateTimelineTime(e)):"Month"===this.parent.currentView||"TimelineYear"===this.parent.currentView?this.calculateVerticalDate(e):this.calculateVerticalTime(e)},f.prototype.navigationWrapper=function(){if(this.parent.activeView.isTimelineView()){var t,e=void 0,e=0<this.parent.activeViewOptions.group.resources.length?this.parent.element.querySelectorAll(".e-appointment-container:not(.e-hidden)").item(this.actionObj.index):this.parent.element.querySelector("."+fi);B.isNullOrUndefined(e)||((t=e.querySelector("."+x))||(t=B.createElement("div",{className:x}),e.appendChild(t)),this.actionObj.cloneElement.forEach(function(e){t.appendChild(e)}))}else if("Month"!==this.parent.currentView&&this.parent.timeScale.enable){e=this.actionObj.clone.classList.contains(an)?"."+rn:"."+x;if(this.parent.element.querySelectorAll(e).item(this.actionObj.index).appendChild(this.actionObj.clone),e=="."+rn){var i=this.getAllDayEventHeight(),e=[].slice.call(this.parent.element.querySelectorAll("."+w+":first-child"));if(e[0].offsetHeight<i)for(var n=0,r=e;n<r.length;n++)r[n].style.height=(i+2)/12+"em";this.actionObj.clone.style.height=B.formatUnit(i)}this.actionObj.height=parseInt(this.actionObj.clone.style.height,10)}else{var e=[].slice.call(this.parent.element.querySelectorAll("."+O)),a=(this.actionObj.index=this.parent.activeView.renderDates.length<this.actionObj.index?this.parent.activeView.renderDates.length-1:this.actionObj.index,e[this.actionObj.index].querySelector("."+x));a||(a=B.createElement("div",{className:x}),e[this.actionObj.index].appendChild(a)),a.appendChild(this.actionObj.clone)}},f.prototype.viewNavigation=function(e){var t,i=this.parent.element.querySelector("."+A);i&&(!this.scrollEdges.top&&!this.scrollEdges.bottom||B.closest(this.actionObj.clone,"."+rn))&&(0===i.scrollLeft&&Math.round(this.actionObj.X)<=Math.round(i.getBoundingClientRect().left+this.actionObj.cellWidth+window.pageXOffset)?t=this.parent.enableRtl?"Next":"Previous":Math.round(i.scrollLeft)+i.clientWidth===i.scrollWidth&&Math.round(this.actionObj.X)>=Math.round(i.getBoundingClientRect().right-this.actionObj.cellWidth+window.pageXOffset)&&(t=this.parent.enableRtl?"Previous":"Next"),t)&&this.parent.changeDate(this.parent.activeView.getNextPreviousDate(t))},f.prototype.morePopupEventDragging=function(e){var t,i,n;B.isNullOrUndefined(e.target)||e.target&&B.isNullOrUndefined(B.closest(e.target,"td"))||(n=(n=B.extend({},this.actionObj.event,null,!0))[this.parent.eventFields.endTime].getTime()-n[this.parent.eventFields.startTime].getTime(),t=B.closest(e.target,"td"),("TimelineYear"!==this.parent.currentView||t.classList.contains(O)&&!t.classList.contains(E))&&(e=this.parent.getDateFromElement(t),(i=new Date(e.getTime())).setMilliseconds(n),0<this.parent.activeViewOptions.group.resources.length&&(this.actionObj.groupIndex=parseInt(t.getAttribute("data-group-index"),10)),this.actionObj.start=new Date(e.getTime()),this.actionObj.end=new Date(i.getTime()),this.actionObj.clone.style.top=B.formatUnit(t.offsetParent.offsetTop),this.actionObj.clone.style.left=B.formatUnit(t.offsetLeft),this.actionObj.clone.style.width=B.formatUnit(t.offsetWidth),1<this.actionObj.cloneElement.length&&this.actionObj.cloneElement.forEach(function(e){e.style.width=B.formatUnit(t.offsetWidth)}),n=t,this.parent.activeView.isTimelineView()&&(e=B.closest(t,"tr").rowIndex,n=this.parent.element.querySelectorAll(".e-appointment-container").item(e)),(i=n.querySelector("."+x))||(i=B.createElement("div",{className:x}),n.appendChild(i)),this.appendCloneElement(i)))},f.prototype.calculateVerticalTime=function(e){var i=this;if(!(B.isNullOrUndefined(this.actionObj.target)||this.actionObj.target&&B.isNullOrUndefined(B.closest(this.actionObj.target,"tr")))&&(B.isNullOrUndefined(B.closest(this.actionObj.target,"td"))||B.closest(this.actionObj.target,"td").classList.contains(O)||B.closest(this.actionObj.target,"td").classList.contains(w))){this.parent.activeViewOptions.timeScale.enable&&this.swapDragging(e);var e=this.parent.element.querySelector("."+A),t=B.extend({},this.actionObj.event,null,!0),n=t[this.parent.eventFields.startTime],t=ct(t[this.parent.eventFields.endTime])-ct(n),r=(r=Math.floor(parseInt(this.actionObj.clone.style.top,10)/this.actionObj.cellHeight)*this.actionObj.cellHeight)<0?0:r,e=((this.scrollEdges.top||this.scrollEdges.bottom)&&(r=this.scrollEdges.top?e.scrollTop-this.heightUptoCursorPoint+this.actionObj.cellHeight+window.pageYOffset:e.scrollTop+e.offsetHeight-this.actionObj.clone.offsetHeight+window.pageYOffset+(this.actionObj.clone.offsetHeight-this.heightUptoCursorPoint),r=Math.round(r/this.actionObj.cellHeight)*this.actionObj.cellHeight,0<e.scrollTop)&&r<e.scrollHeight&&(this.actionObj.clone.style.top=B.formatUnit(r)),this.parent.activeViewOptions.timeScale.enable?r/this.actionObj.cellHeight:0),a=this.actionObj.cellHeight/this.actionObj.slotInterval,r=parseInt(this.actionObj.clone.style.top,10)-r,s=(e=this.isAllDayDrag?this.parent.element.querySelector("."+Ot):[].slice.call(this.parent.getContentTable().querySelectorAll("tr"))[parseInt(e.toString(),10)],B.isNullOrUndefined(B.closest(this.actionObj.target,"td"))||!B.closest(this.actionObj.target,"td").classList.contains(O)&&!B.closest(this.actionObj.target,"td").classList.contains(w)||(s=B.closest(this.actionObj.target,"td").cellIndex),B.isNullOrUndefined(s)?B.closest(this.actionObj.clone,"td").cellIndex:s);if(this.actionObj.index=s,!B.isNullOrUndefined(e)){for(var o,l,e=e.children[parseInt(s.toString(),10)],a=(0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive&&(this.actionObj.groupIndex=parseInt(e.getAttribute("data-group-index"),10)),this.parent.activeViewOptions.timeScale.enable&&!this.isAllDayDrag?(this.enableCurrentViewDrag&&0!==this.multiData.length||this.appendCloneElement(this.getEventWrapper(s)),(o=this.parent.getDateFromElement(e)).setMinutes(o.getMinutes()+r/a),l=new Date(o.getTime()),this.actionObj.element.classList.contains(an)?l.setMinutes(l.getMinutes()+this.actionObj.slotInterval):l.setMilliseconds(t)):((o=this.parent.getDateFromElement(e)).setDate(o.getDate()-this.daysVariation),o.setHours(n.getHours(),n.getMinutes(),n.getSeconds()),(l=new Date(o.getTime())).setMilliseconds(t),!this.actionObj.element.classList.contains(an)&&this.actionObj.clone.classList.contains(an)&&(l=Y(z(l),1)),r=this.parent.activeViewOptions.group.byDate||this.parent.virtualScrollModule&&!this.parent.activeViewOptions.timeScale.enable?s:void 0,this.updateAllDayEvents(o,l,r)),this.actionObj.start=new Date(+o),this.actionObj.end=new Date(+l),this.getUpdatedEvent(this.actionObj.start,this.actionObj.end,this.actionObj.event)),p=0,c=[].slice.call(this.parent.element.querySelectorAll(".e-dynamic-clone"));p<c.length;p++){var h=c[p];B.remove(h)}if(0<this.multiData.length){this.isAllDayTarget&&this.isAllDayDrag&&!B.isNullOrUndefined(this.actionObj.isAllDay)&&!this.actionObj.isAllDay&&(d=parseInt(B.closest(this.actionObj.target,"td").getAttribute("data-date"),10),this.multiData.forEach(function(e){var t;i.swagData.push(B.extend({},e,null,!0)),e[i.parent.eventFields.isAllDay]&&(e[i.parent.eventFields.startTime]=new Date(e[i.parent.eventFields.startTime].getTime()+(d-i.startTime)),t=new Date(e[i.parent.eventFields.startTime]),t=new Date(t.setMinutes(t.getMinutes()+i.actionObj.slotInterval)),e[i.parent.eventFields.endTime]=t,e[i.parent.eventFields.isAllDay]=!1)}),this.startTime=d),this.isAllDayTarget&&this.isAllDayDrag&&!B.isNullOrUndefined(this.actionObj.isAllDay)&&this.actionObj.isAllDay&&0<this.swagData.length&&(this.multiData=this.swagData,this.swagData=[],e=B.extend({},this.actionObj.event,null,!0),this.startTime=e[this.parent.eventFields.startTime].getTime());var d,u=a[this.parent.eventFields.startTime].getTime()-this.startTime;if(this.enableCurrentViewDrag)for(var g=this.getRenderedDates(),m=0;m<this.multiData.length;m++){var v=B.extend({},this.multiData[parseInt(m.toString(),10)],null,!0),v=new Date(v[this.parent.eventFields.startTime].getTime()+u);if((f=this.parent.getIndexOfDate(g,z(v)))<0){this.isPreventMultiDrag=!0;break}this.isPreventMultiDrag=!1}if(!this.isPreventMultiDrag)for(var f,y,T=0;T<this.multiData.length;T++)this.updatedData[parseInt(T.toString(),10)]=this.updateMultipleData(this.multiData[parseInt(T.toString(),10)],u),0<=(f=this.getDayIndex(this.updatedData[parseInt(T.toString(),10)]))?(y=this.updatedData[parseInt(T.toString(),10)][this.parent.eventFields.isAllDay],h=this.getEventWrapper(f,y),this.appendCloneElement(h,this.actionObj.cloneElement[parseInt(T.toString(),10)]),this.updateEventHeight(this.updatedData[parseInt(T.toString(),10)],T,f)):B.isNullOrUndefined(this.actionObj.cloneElement[parseInt(T.toString(),10)].parentNode)||B.remove(this.actionObj.cloneElement[parseInt(T.toString(),10)])}else this.updateEventHeight(a);this.updateTimePosition(this.actionObj.start,this.updatedData)}}},f.prototype.splitEvent=function(e){var t=this.parent.eventFields,i=[],n=e[t.startTime],r=e[t.endTime];if(z(new Date(n.getTime()))<z(new Date(r.getTime()))){for(var a=z(new Date(n.getTime())),s=new Date(a.getTime());a<new Date(r.getTime());0){var s=new Date(s.setDate(a.getDate()+1)),o=B.extend({},e,null,!0);o[t.startTime]=new Date(a),o[t.endTime]=new Date(s),a=new Date(a.setDate(a.getDate()+1)),i.push(o)}var l=i.length-1;i[0][t.startTime]=n,i[parseInt(l.toString(),10)][t.endTime]=r}else i.push(e);return i},f.prototype.updateMultipleData=function(e,t){var i,n,r,e=B.extend({},e,null,!0),a=(!B.isNullOrUndefined(this.actionObj.isAllDay)&&this.parent.activeViewOptions.timeScale.enable&&(this.isAllDayTarget&&e[this.parent.eventFields.isAllDay]||!this.isAllDayTarget&&!e[this.parent.eventFields.isAllDay])&&(e[this.parent.eventFields.isAllDay]=this.actionObj.isAllDay),e[this.parent.eventFields.endTime].getTime()-e[this.parent.eventFields.startTime].getTime());return e[this.parent.eventFields.isAllDay]?(i=Math.ceil(t/864e5),n=Math.ceil(a/864e5),r=new Date(e[this.parent.eventFields.startTime]),e[this.parent.eventFields.startTime]=z(new Date(r.setDate(r.getDate()+i))),e[this.parent.eventFields.endTime]=Y(e[this.parent.eventFields.startTime],n)):(e[this.parent.eventFields.startTime]=new Date(e[this.parent.eventFields.startTime].getTime()+t),e[this.parent.eventFields.endTime]=new Date(e[this.parent.eventFields.startTime].getTime()+a)),e},f.prototype.getDayIndex=function(e){var e=B.extend({},e,null,!0),t=z(e[this.parent.eventFields.startTime]),i=(this.parent.activeViewOptions.timeScale.enable&&!e[this.parent.eventFields.isAllDay]&&(i=this.parent.activeView.getStartHour(),t.setMilliseconds(i.getTime()-z(i).getTime())),t.getTime()),t="",t="."+(this.parent.activeViewOptions.timeScale.enable&&e[this.parent.eventFields.isAllDay]?rn:O)+'[data-date="'+i+'"]';return 0<this.parent.activeViewOptions.group.resources.length&&(t=t+'[data-group-index="'+this.actionObj.groupIndex+'"]'),this.targetTd=this.parent.element.querySelector(t),B.isNullOrUndefined(this.targetTd)?-1:this.targetTd.cellIndex},f.prototype.updateEventHeight=function(e,t,i){this.verticalEvent.initializeValues();var n=this.verticalEvent.getStartCount();if(!this.parent.uiStateValues.isGroupAdaptive)for(var r=0;r<this.actionObj.groupIndex;r++)this.verticalEvent.dateRender[parseInt(r.toString(),10)]&&(n+=this.verticalEvent.dateRender[parseInt(r.toString(),10)].length);var a=this.parent.uiStateValues.isGroupAdaptive?n:this.actionObj.groupIndex;if(!(!this.parent.activeViewOptions.group.byDate||B.isNullOrUndefined(this.parent.getDateFromElement(this.actionObj.target)))||!this.parent.activeViewOptions.group.byDate)for(var s,o,l,p,c,h=-1,d=this.parent.activeViewOptions.group.byDate?this.parent.getIndexOfDate(this.verticalEvent.dateRender[parseInt(a.toString(),10)],z(this.parent.getDateFromElement(B.isNullOrUndefined(t)?this.actionObj.target:this.targetTd))):B.isNullOrUndefined(t)?this.actionObj.index-n:i-n,i=this.splitEvent(e),u=this.parent.eventBase.isAllDayAppointment(e)||2<i.length||"TimeSlot"!==this.parent.eventSettings.spannedEventPlacement?[e]:i,r=0;r<u.length;r++)0<r&&(s='.e-day-wrapper[data-date="'+z(u[parseInt(r.toString(),10)][this.parent.eventFields.startTime]).getTime()+'"]',0<this.parent.activeViewOptions.group.resources.length&&(s=s.concat('[data-group-index = "'+this.actionObj.groupIndex+'"]')),(s=this.parent.element.querySelector(s))?(d+=1,h=s.cellIndex):d=-1),0<=d&&(l=(s=this.verticalEvent.isSpannedEvent(u[parseInt(r.toString(),10)],d,a))[this.verticalEvent.fields.startTime],o=s[this.verticalEvent.fields.endTime],o=this.parent.activeViewOptions.timeScale.enable?this.verticalEvent.getHeight(l,o):this.actionObj.element.offsetHeight,l=this.parent.activeViewOptions.timeScale.enable?this.verticalEvent.getTopValue(l):this.actionObj.element.offsetTop,B.isNullOrUndefined(t)?0===r?(this.actionObj.clone.classList.contains(an)&&(l=this.parent.element.querySelector("."+Ot).offsetTop,o=this.getAllDayEventHeight()),this.actionObj.clone.style.top=B.formatUnit(l),this.actionObj.clone.style.height=B.formatUnit(o)):this.renderSpannedEvents(s,h,l,o):(p=this.actionObj.cellWidth,e[this.parent.eventFields.isAllDay]&&this.parent.activeViewOptions.timeScale.enable&&(c=e[this.parent.eventFields.endTime].getTime()-e[this.parent.eventFields.startTime].getTime(),0<=(c=Math.ceil(c/864e5)))&&(p=c*this.actionObj.cellWidth),this.actionObj.cloneElement[parseInt(t.toString(),10)]&&(0===r?(this.actionObj.cloneElement[parseInt(t.toString(),10)].style.top=B.formatUnit(l),this.actionObj.cloneElement[parseInt(t.toString(),10)].style.height=B.formatUnit(o),this.actionObj.cloneElement[parseInt(t.toString(),10)].style.width=B.formatUnit(p),this.actionObj.cloneElement[parseInt(t.toString(),10)].style.left=B.formatUnit(0)):this.renderSpannedEvents(s,h,l,o))))},f.prototype.renderSpannedEvents=function(e,t,i,n){e[this.parent.eventFields.startTime].getTime()!==e[this.parent.eventFields.endTime].getTime()&&(e=this.verticalEvent.createAppointmentElement(e,!1,e.isSpanned,this.actionObj.groupIndex),B.addClass([e],[Yi,"e-dynamic-clone"]),B.setStyleAttribute(e,{width:"100%",height:n+"px",top:i+"px",border:"0px"}),[].slice.call(this.parent.element.querySelectorAll("."+x))[parseInt(t.toString(),10)].appendChild(e))},f.prototype.getRenderedDates=function(){var e,t=this,i=this.parent.activeView.renderDates;return(e=this.parent.eventBase.slots).push.apply(e,this.parent.activeView.renderDates.map(function(e){return+e})),0<this.parent.activeViewOptions.group.resources.length&&(this.parent.eventBase.slots=[],i=this.parent.resourceBase.lastResourceLevel.filter(function(e){return e.groupIndex===t.actionObj.groupIndex})[0].renderDates,(e=this.parent.eventBase.slots).push.apply(e,i.map(function(e){return+e}))),i},f.prototype.updateAllDayEvents=function(e,t,i){this.parent.eventBase.slots=[];var e=this.getUpdatedEvent(e,t,this.actionObj.event),t=this.getRenderedDates(),e=this.parent.eventBase.splitEvent(e,t),t='.e-all-day-cells[data-date="'+e[0][this.parent.eventFields.startTime].getTime()+'"]',t=(0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive&&(t=t.concat('[data-group-index = "'+this.actionObj.groupIndex+'"]')),[].slice.call(this.parent.element.querySelectorAll(t)));(0<t.length||!B.isNullOrUndefined(i))&&(t=B.isNullOrUndefined(i)?t[0].cellIndex:i,this.appendCloneElement(this.getEventWrapper(t)),this.actionObj.clone.style.width=B.formatUnit(e[0].data.count*this.actionObj.cellWidth))},f.prototype.swapDragging=function(e){if(!this.isPreventMultiDrag){var t=!B.isNullOrUndefined(B.closest(this.actionObj.target,"td"))&&B.closest(this.actionObj.target,"td").cellIndex;if(B.closest(this.actionObj.target,"."+Vt)&&!B.closest(this.actionObj.clone,"."+rn)){B.addClass([this.actionObj.clone],an),this.appendCloneElement(this.getEventWrapper(t)),this.actionObj.isAllDay=!0;var i=this.getAllDayEventHeight(),n=[].slice.call(this.parent.element.querySelectorAll("."+w+":first-child"));if(n[0].offsetHeight<i)for(var r=0,a=n;r<a.length;r++)a[r].style.height=(i+2)/12+"em";B.setStyleAttribute(this.actionObj.clone,{width:B.formatUnit(this.actionObj.cellWidth),height:B.formatUnit(i),top:B.formatUnit(this.parent.element.querySelector("."+Ot).offsetTop)})}B.closest(this.actionObj.target,"."+O)&&!B.closest(this.actionObj.clone,"."+li)&&(B.removeClass([this.actionObj.clone],an),this.appendCloneElement(this.getEventWrapper(t)),this.actionObj.isAllDay=!1,n=0===this.actionObj.element.offsetHeight?this.actionObj.height:this.actionObj.element.offsetHeight,B.setStyleAttribute(this.actionObj.clone,{left:B.formatUnit(0),height:B.formatUnit(n),width:B.formatUnit(this.actionObj.cellWidth)}))}},f.prototype.calculateVerticalDate=function(e){if(!(B.isNullOrUndefined(e.target)||e.target&&B.isNullOrUndefined(B.closest(e.target,"tr"))||e.target&&"DIV"===e.target.tagName)){var t,e=B.extend({},this.actionObj.event,null,!0),i=(B.isNullOrUndefined(this.parent.eventDragArea)&&this.removeCloneElement(),ct(e[this.parent.eventFields.endTime])-ct(e[this.parent.eventFields.startTime])),n=B.closest(this.actionObj.target,"td"),e=(B.isNullOrUndefined(n)||(t=n.parentElement,this.actionObj.index=t.rowIndex*t.children.length+n.cellIndex,n=[].slice.call(this.parent.element.querySelectorAll("."+O))[this.actionObj.index],t=this.parent.getDateFromElement(n),B.isNullOrUndefined(t))||(0<this.parent.activeViewOptions.group.resources.length&&(this.actionObj.groupIndex=parseInt(n.getAttribute("data-group-index"),10)),n=new Date(t.setDate(t.getDate()-this.daysVariation)),t=new Date(n.getTime()),o=ct(e[this.parent.eventFields.startTime])-ct(z(new Date(+e[this.parent.eventFields.startTime]))),t.setMilliseconds(o),(n=new Date(t.getTime())).setMilliseconds(i),this.actionObj.start=new Date(t.getTime()),this.actionObj.end=new Date(n.getTime())),this.getUpdatedEvent(this.actionObj.start,this.actionObj.end,this.actionObj.event));if(B.isNullOrUndefined(this.parent.eventDragArea))for(var r=0,a=[].slice.call(this.parent.element.querySelectorAll("."+Yi));r<a.length;r++){var s=a[r];B.remove(s)}if(this.multiData&&0<this.multiData.length){var i=z(new Date(e[this.parent.eventFields.startTime])),o=i.getTime()-this.startTime;"TimelineYear"===this.parent.currentView&&0<this.parent.group.resources.length&&(o=12*(i.getFullYear()-new Date(this.startTime).getFullYear()),o=(o-=new Date(this.startTime).getMonth())+i.getMonth());for(var l=0;l<this.multiData.length;l++)this.updatedData[parseInt(l.toString(),10)]=this.updateMultipleVerticalDate(this.multiData[parseInt(l.toString(),10)],o),"TimelineYear"===this.parent.currentView?this.dynamicYearlyEventsRendering(this.updatedData[parseInt(l.toString(),10)]):this.dynamicEventsRendering(this.updatedData[parseInt(l.toString(),10)])}else"TimelineYear"===this.parent.currentView?this.dynamicYearlyEventsRendering(e):this.dynamicEventsRendering(e)}},f.prototype.updateMultipleVerticalDate=function(e,t){var e=B.extend({},e,null,!0),i=e[this.parent.eventFields.endTime].getTime()-e[this.parent.eventFields.startTime].getTime(),n=new Date(e[this.parent.eventFields.startTime]);return"TimelineYear"===this.parent.currentView&&0<this.parent.group.resources.length?e[this.parent.eventFields.startTime]=new Date(n.setMonth(n.getMonth()+t)):(t=Math.ceil(t/W),e[this.parent.eventFields.startTime]=new Date(n.setDate(n.getDate()+t))),e[this.parent.eventFields.endTime]=new Date(e[this.parent.eventFields.startTime].getTime()+i),e},f.prototype.calculateTimelineTime=function(e){var t,i=B.extend({},this.actionObj.event,null,!0),n=ct(i[this.parent.eventFields.endTime])-ct(i[this.parent.eventFields.startTime]),r=this.parent.enableRtl?Math.abs(this.actionObj.clone.offsetLeft)-this.actionObj.clone.offsetWidth:parseInt(this.actionObj.clone.style.left,10),r=Math.round(r/this.actionObj.cellWidth)*this.actionObj.cellWidth,a=(this.parent.enableRtl&&(a=Math.abs(parseInt(this.actionObj.clone.style.right,10)),this.actionObj.clone.style.right=B.formatUnit(a)),r=this.getOffsetValue(r,a),this.getColumnIndex(r)),s=this.parent.element.querySelector("."+A),o=s.getBoundingClientRect().right,o=this.parent.activeView.isTimelineView()&&!this.parent.enableRtl&&this.actionObj.pageX>this.actionObj.clone.getBoundingClientRect().right&&!this.isMorePopupOpened&&!(this.actionObj.pageX>o),s=this.parent.eventDragArea?s.scrollLeft-s.offsetLeft:0,s=(!this.isCursorAhead&&!o||this.isStepDragging||(this.isCursorAhead=!0),Math.floor((this.actionObj.pageX-this.actionObj.clone.getBoundingClientRect().left+s)/this.actionObj.cellWidth)),r=(this.parent.enableRtl&&(s=Math.abs(Math.floor((this.actionObj.pageX-this.actionObj.clone.getBoundingClientRect().right)/this.actionObj.cellWidth))-1),this.cursorPointIndex<0&&this.cursorIndex(e,i,r,s),this.parent.getContentTable().querySelector("tr")),a=(a=this.getCursorCurrentIndex(a,s,r))<0?0:a,l=this.isHeaderRows?new Date(this.timelineEventModule.dateRender[parseInt(a.toString(),10)].getTime()):this.parent.getDateFromElement(r.children[parseInt(a.toString(),10)]),p=(l=this.isAllDayDrag?z(l):l,this.isStepDragging?0!==(s=this.getWidthDiff(r,a))?(r=Math.ceil(s/this.widthPerMinute),l.setMinutes(l.getMinutes()+r*this.actionObj.interval),this.isCursorAhead||o?l.setMilliseconds(-n):(l.setMinutes(l.getMinutes()-this.minDiff),a=this.actionObj.interval*je,r=Math.abs(l.getTime()-this.actionObj.start.getTime())/a,(s=Math.trunc(r))!==r&&(r=s*a*(l>this.actionObj.start?1:-1),l=new Date(this.actionObj.start.getTime()+r)))):l=this.actionObj.start:!this.isCursorAhead&&!o||this.isAllDayDrag?l.setMinutes(l.getMinutes()-this.cursorPointIndex*(this.isTimelineDayProcess||this.isAllDayDrag?1440:this.actionObj.slotInterval)):(s=this.isTimelineDayProcess||this.isAllDayDrag?1440:this.actionObj.slotInterval,l.setMinutes(l.getMinutes()+s),l.setMilliseconds(-n),l.getTime()===z(l).getTime()&&0===l.getMinutes()&&0==n&&l.setMinutes(-s)),this.isStepDragging||(l=this.calculateIntervalTime(l)),(this.isTimelineDayProcess||this.isAllDayDrag)&&(t=i[this.parent.eventFields.startTime],l.setHours(t.getHours(),t.getMinutes(),t.getSeconds())),this.parent.eventDragArea&&(a=this.parent.getDateFromElement(e.target),B.isNullOrUndefined(a)||(l=this.parent.activeViewOptions.timeScale.enable&&"TimelineMonth"!==this.parent.currentView?a:(t=i[this.parent.eventFields.startTime],new Date(a.setHours(t.getHours(),t.getMinutes(),t.getSeconds()))))),new Date(l.getTime())),c=(p.setMilliseconds(n),[this.getUpdatedEvent(l,p,this.actionObj.event)]);if(0<this.multiData.length){for(var h=c[0][this.parent.eventFields.startTime].getTime()-this.startTime,d=0;d<this.multiData.length;d++)this.updatedData[parseInt(d.toString(),10)]=this.updateMultipleData(this.multiData[parseInt(d.toString(),10)],h);c=this.updatedData}for(var u=0;u<c.length;u++){var g,m,v,f,y=0<this.multiData.length?this.actionObj.cloneElement[parseInt(u.toString(),10)]:this.actionObj.clone;B.isNullOrUndefined(this.parent.eventDragArea)&&(m=(g=this.timelineEventModule.splitEvent(c[parseInt(u.toString(),10)],this.timelineEventModule.dateRender))[0].data,f=this.timelineEventModule.getStartTime(g[0],m),g=this.timelineEventModule.getEndTime(g[0],m),m=this.timelineEventModule.getEventWidth(f,g,i[this.parent.eventFields.isAllDay],m.count),v=this.parent.getIndexOfDate(this.timelineEventModule.dateRender,z(new Date(f.getTime()))),f=this.timelineEventModule.getPosition(f,g,i[this.parent.eventFields.isAllDay],v=v<0?0:v),this.parent.enableRtl?y.style.right=B.formatUnit(f):y.style.left=B.formatUnit(f),this.isMorePopupOpened||(y.style.width=B.formatUnit(m))),0<this.parent.activeViewOptions.group.resources.length&&this.calculateResourceGroupingPosition(e,y),this.actionObj.start=new Date(l.getTime()),this.actionObj.end=new Date(p.getTime()),this.updateTimePosition(this.actionObj.start,this.updatedData)}},f.prototype.getOffsetValue=function(e,t){var i;return(this.scrollEdges.left||this.scrollEdges.right)&&(i=this.parent.element.querySelector("."+A),this.parent.enableRtl?(t=i.offsetWidth-i.scrollLeft,this.scrollEdges.right?t=t-i.offsetWidth+this.actionObj.clone.offsetWidth-(this.actionObj.clone.offsetWidth-this.widthUptoCursorPoint):(t+=this.widthUptoCursorPoint)-this.widthUptoCursorPoint>=i.scrollWidth&&(this.actionObj.clone.style.width=B.formatUnit(this.actionObj.clone.offsetWidth-this.widthUptoCursorPoint+this.actionObj.cellWidth),t=i.scrollLeft-i.scrollWidth),B.isNullOrUndefined(this.parent.eventDragArea)&&(this.actionObj.clone.style.left=B.formatUnit(t))):(this.scrollEdges.left?(e=i.scrollLeft-this.widthUptoCursorPoint+this.actionObj.cellWidth,i.scrollLeft+i.offsetWidth>=i.offsetWidth?i.scrollLeft=i.scrollLeft-1:0===this.actionObj.clone.offsetLeft&&(e=i.scrollLeft)):e=i.scrollLeft+i.offsetWidth-this.actionObj.clone.offsetWidth+(this.actionObj.clone.offsetWidth-this.widthUptoCursorPoint),e=e<0?0:e,B.isNullOrUndefined(this.parent.eventDragArea)&&(this.actionObj.clone.style.left=B.formatUnit(e)))),e},f.prototype.getWidthDiff=function(e,t){var i=this.scrollArgs.element.getBoundingClientRect();return i.left<=this.actionObj.pageX&&i.right>=this.actionObj.pageX?(e=e.children[parseInt(t.toString(),10)].offsetLeft,t=this.actionObj.pageX-i.left,this.parent.enableRtl?e+this.actionObj.cellWidth-(this.scrollArgs.element.scrollLeft+t):this.scrollArgs.element.scrollLeft+t-e):0},f.prototype.getColumnIndex=function(e){e=Math.round(e/this.actionObj.cellWidth);return this.isHeaderRows?e:this.getIndex(e)},f.prototype.getCursorCurrentIndex=function(e,t,i){e+=t;return this.isHeaderRows?(t=Math.floor(i.offsetWidth/this.actionObj.cellWidth))-1<e?t-1:e:e>i.children.length-1?i.children.length-1:e},f.prototype.cursorIndex=function(e,t,i,n){var e=B.closest(e.target,".e-work-cells");B.isNullOrUndefined(e)||this.isMorePopupOpened?this.cursorPointIndex=0:(e=this.parent.getDateFromElement(e),e=this.isAllDayDrag?z(e):e,this.isHeaderRows&&(i=Math.floor(i/this.actionObj.cellWidth),e=new Date(this.timelineEventModule.dateRender[i+n].getTime())),i=e.getTime()-t[this.parent.eventFields.startTime].getTime(),this.isTimelineDayProcess||this.isAllDayDrag?this.cursorPointIndex=Math.abs(Math.ceil(i/W)):(n=Math.floor(i/je/(this.actionObj.slotInterval/this.actionObj.cellWidth)),this.cursorPointIndex=Math.floor(n/this.actionObj.cellWidth),this.cursorPointIndex=this.cursorPointIndex<0?0:this.cursorPointIndex))},f.prototype.calculateResourceGroupingPosition=function(e,t){var i=this.parent.element.querySelector("."+A),n=[].slice.call(this.parent.element.querySelectorAll(".e-content-wrap .e-content-table tr:not(.e-hidden)")),r=qe(i.querySelector("table")),r=B.isNullOrUndefined(r)?0:r,a=this.parent.rowAutoHeight?~~(i.querySelector("table").offsetHeight/n.length):this.actionObj.cellHeight,r=(r=Math.floor(Math.floor(this.actionObj.Y+(i.scrollTop-r-(window.scrollY||window.pageYOffset))-mt(i,this.parent.uiStateValues.isTransformed))/a))<0?0:r>n.length-1?n.length-1:r,i=(this.actionObj.index=r,this.parent.element.querySelectorAll(".e-appointment-container:not(.e-hidden)").item(r)),a=i.querySelector("."+x),i=(a||(a=B.createElement("div",{className:x}),i.appendChild(a)),this.appendCloneElement(a,t),B.closest(this.actionObj.target,"td"));this.actionObj.groupIndex=i&&!isNaN(parseInt(i.getAttribute("data-group-index"),10))?parseInt(i.getAttribute("data-group-index"),10):this.actionObj.groupIndex,B.isNullOrUndefined(this.parent.eventDragArea)&&(a=this.parent.getElementHeight(n[parseInt(r.toString(),10)])*r,this.parent.rowAutoHeight&&(i=this.getCursorElement(e))&&(a=i.classList.contains(O)?i.offsetTop:i.offsetParent&&i.offsetParent.classList.contains(V)?i.offsetParent.offsetTop:a),t.style.top=B.formatUnit(a))},f.prototype.appendCloneElement=function(e,t){t=B.isNullOrUndefined(t=void 0===t?null:t)?this.actionObj.clone:t;var i=document.querySelector(this.parent.eventDragArea);(this.parent.eventDragArea&&i?i:e).appendChild(t)},f.prototype.getEventWrapper=function(e,t){var i;return B.isNullOrUndefined(t)&&(t=this.actionObj.clone.classList.contains(an)),this.parent.activeViewOptions.timeScale.enable?i=this.parent.element.querySelectorAll(t?"."+rn:"."+x).item(e):(i=(t=this.parent.element.querySelectorAll("."+O).item(e)).querySelector("."+x))||(i=B.createElement("div",{className:x}),t.appendChild(i)),i},f.prototype.getAllDayEventHeight=function(){var e=B.createElement("div",{className:V}),t=(this.parent.element.querySelector("."+rn).appendChild(e),e.offsetHeight);return B.remove(e),t},f.prototype.isAllowDrop=function(e){if(!this.actionObj.excludeSelectors)return!1;for(var t=!1,i=0,n=this.actionObj.excludeSelectors.split(",");i<n.length;i++){var r=n[i];if(e.target.classList.contains(r)){t=!0;break}}return t},f.prototype.getModuleName=function(){return"dragAndDrop"};var fl,yl,cs=f;function f(){var e=null!==yl&&yl.apply(this,arguments)||this;return e.widthUptoCursorPoint=0,e.heightUptoCursorPoint=0,e.cursorPointIndex=0,e.isHeaderRows=!1,e.isTimelineDayProcess=!1,e.widthPerMinute=0,e.heightPerMinute=0,e.minDiff=0,e.isStepDragging=!1,e.isMorePopupOpened=!1,e.isAllDayDrag=!1,e.isMultiSelect=!1,e.multiData=[],e.updatedData=[],e.swagData=[],e.startTime=0,e.isAllDayTarget=!1,e.targetTd=null,e.isCursorAhead=!1,e.enableCurrentViewDrag=!1,e.isPreventMultiDrag=!1,e.slotsUptoCursor=-1,e.eleTop=0,e.distanceUptoCursor=0,e}T.prototype.isTimelineView=function(){return-1!==this.parent.currentView.indexOf("Timeline")},T.prototype.getContentRows=function(){return[]},T.prototype.refreshHeader=function(){},T.prototype.refreshResourceHeader=function(){var e=this.element.querySelector("."+zt),t=Array.from(e.querySelectorAll("."+Kt)),i=(t.forEach(function(e){Array.from(e.children).forEach(function(e){e.classList.contains(Gt)||e.classList.contains(Xt)||B.remove(e)})}),this.parent.resourceBase.renderedResources);if(!B.isNullOrUndefined(i)&&0<i.length)for(var n=0;n<t.length;n++){var r=t[parseInt(n.toString(),10)],a=i[parseInt(n.toString(),10)];!this.parent.activeView||B.isNullOrUndefined(r)||B.isNullOrUndefined(a)||parseInt(r.getAttribute("data-group-index"),10)!==a.groupIndex||(this.parent.activeView.setResourceHeaderContent(r,a,Bt),r={element:r,elementType:"resourceHeader",groupIndex:a.groupIndex},this.parent.trigger($,r))}this.parent.renderTemplates(),this.parent.notify(Ve,{})},T.prototype.getDayName=function(e){return this.parent.getDayNames("abbreviated")[e.getDay()]},T.prototype.getDate=function(e){return this.parent.globalize.formatDate(e,{format:"d",calendar:this.parent.getCalendarMode()})},T.prototype.getTime=function(e){return this.parent.isAdaptive?"HH:mm"===this.parent.activeViewOptions.timeFormat||"HH.mm"===this.parent.activeViewOptions.timeFormat?this.parent.globalize.formatDate(e,{format:"H",calendar:this.parent.getCalendarMode()}):this.parent.globalize.formatDate(e,{skeleton:"h",calendar:this.parent.getCalendarMode()}):this.parent.getTimeString(e)},T.prototype.getTimelineDate=function(e){return y(this.parent.globalize.formatDate(e,{skeleton:"MMMd",calendar:this.parent.getCalendarMode()})+", "+this.parent.getDayNames("wide")[e.getDay()],"multiple")},T.prototype.createEventTable=function(e){var t=B.createElement("div",{className:Ft});return B.append(this.getEventRows(e),t),t},T.prototype.getEventRows=function(e){for(var t,i=[],n=0;n<e;n++)t=B.createElement("div",{className:fi}),this.parent.resourceBase&&!this.parent.uiStateValues.isGroupAdaptive&&this.parent.resourceBase.renderedResources&&t.setAttribute("data-group-index",this.parent.resourceBase.renderedResources[parseInt(n.toString(),10)].groupIndex.toString()),i.push(t);return i},T.prototype.collapseRows=function(e){0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive&&(this.parent.resourceBase.hideResourceRows(e.querySelector("tbody")),this.parent.resourceBase.hideResourceRows(e.querySelector("."+Ft)))},T.prototype.createTableLayout=function(e){var e=B.createElement("table",{className:Ct+" "+(e||"")}),t=B.createElement("tbody");return e.appendChild(t),e},T.prototype.setAriaAttributes=function(e){e.setAttribute("role","grid"),"Year"!==this.parent.currentView&&e.setAttribute("id",this.parent.element.id+"_table"),e.setAttribute("aria-label",this.getLabelText(this.parent.currentView))},T.prototype.createColGroup=function(e,t){if(!B.isNullOrUndefined(t)){for(var i=t.length,n=(t[0]&&t[0].colSpan&&(i=t.map(function(e){return e.colSpan}).reduce(function(e,t){return e+t})),B.createElement("colgroup")),r=0;r<i;r++)n.appendChild(B.createElement("col"));B.prepend([n],e)}},T.prototype.getScrollXIndent=function(e){return 0<e.offsetHeight-e.clientHeight?rt():0},T.prototype.scrollTopPanel=function(e){this.getDatesHeaderElement().firstElementChild.scrollLeft=e.scrollLeft},T.prototype.scrollHeaderLabels=function(e){for(var t=this.element.querySelector(".e-date-header-wrap table"),i=t.offsetWidth/t.querySelectorAll("colgroup col").length,n=0,r=[".e-header-year-cell",".e-header-month-cell",".e-header-week-cell",".e-header-cells"];n<r.length;n++){var a=[].slice.call(this.element.querySelectorAll(r[n]));if(0<a.length){for(var s=0,o=a;s<o.length;s++)o[s].children[0].style[this.parent.enableRtl?"right":"left"]="";m=g=u=d=h=c=l=void 0;for(var l,p=this.parent.enableRtl,c=0,h=0,d=p?-e.scrollLeft:e.scrollLeft,u=0,g=a;u<g.length;u++){var m=g[u];if((h+=parseInt(m.getAttribute("colSpan"),10))>Math.floor(d/i)){l=m;break}c+=m.offsetWidth}B.isNullOrUndefined(l)||(l.children[0].style[p?"right":"left"]=d-c+"px")}}},T.prototype.addAttributes=function(e,t){e.template&&B.append(e.template,t),e.colSpan&&t.setAttribute("colspan",e.colSpan.toString()),e.className&&B.addClass([t],e.className)},T.prototype.getHeaderBarHeight=function(){var e,t=2;return this.parent.headerModule&&(t+=ot(this.parent.headerModule.getHeaderElement())),this.parent.uiStateValues.isGroupAdaptive&&(e=this.parent.element.querySelector("."+hi))&&(t+=e.offsetHeight),t},T.prototype.renderPanel=function(e){e===Pt?B.prepend([this.element],this.parent.element.querySelector("."+St)):this.parent.element.querySelector("."+St).appendChild(this.element)},T.prototype.setPanel=function(e){this.element=e},T.prototype.getPanel=function(){return this.element},T.prototype.getDatesHeaderElement=function(){return this.element.querySelector("."+At)},T.prototype.getDateSlots=function(e,t){return[]},T.prototype.generateColumnLevels=function(){return[]},T.prototype.getColumnLevels=function(){return this.colLevels},T.prototype.highlightCurrentTime=function(){},T.prototype.getStartDate=function(){return this.renderDates[0]},T.prototype.getEndDate=function(){return this.renderDates[this.renderDates.length-1]},T.prototype.startDate=function(){return this.renderDates[0]},T.prototype.endDate=function(){return Y(this.renderDates[this.renderDates.length-1],1)},T.prototype.getStartHour=function(){var e=this.parent.getStartEndTime(this.parent.activeViewOptions.startHour);return e=B.isNullOrUndefined(e)?new Date(2e3,0,0,0):e},T.prototype.getEndHour=function(){var e=this.parent.getStartEndTime(this.parent.activeViewOptions.endHour);return e=B.isNullOrUndefined(e)?new Date(2e3,0,0,0):e},T.prototype.isCurrentDate=function(e){return e.setHours(0,0,0,0)===new Date(this.parent.currentTimezoneDate).setHours(0,0,0,0)},T.prototype.isCurrentMonth=function(e){return this.parent.activeViewOptions.displayDate||0<this.parent.activeViewOptions.numberOfWeeks?this.parent.activeView.getStartDate().getTime()<=this.parent.getCurrentTime().getTime()&&this.parent.activeView.getEndDate().getTime()>=this.parent.getCurrentTime().getTime():e.getFullYear()===this.parent.getCurrentTime().getFullYear()&&e.getMonth()===this.parent.getCurrentTime().getMonth()},T.prototype.isWorkDay=function(e,t){return void 0===t&&(t=this.parent.activeViewOptions.workDays),!B.isNullOrUndefined(t)&&0<=t.indexOf(e.getDay())},T.prototype.isWorkHour=function(e,t,i,n){return!(B.isNullOrUndefined(t)||B.isNullOrUndefined(i)||(t.setMilliseconds(0),i.setMilliseconds(0),z(e).getTime()!==z(t).getTime()&&(t=new Date(2e3,0,0,t.getHours(),t.getMinutes(),t.getMilliseconds()),i=new Date(2e3,0,0,i.getHours(),i.getMinutes(),i.getMilliseconds())),Xe(e)<Xe(t))||Xe(e)>=Xe(i)||!this.isWorkDay(e,n))},T.prototype.getRenderDates=function(e,t){void 0===t&&(t=this.parent.selectedDate);var i=[];if("Week"===this.parent.currentView||"TimelineWeek"===this.parent.currentView)for(var n=Ue(z(t),this.parent.activeViewOptions.firstDayOfWeek),r=0,a=7*this.parent.activeViewOptions.interval;r<a;r++)(this.parent.activeViewOptions.showWeekend||this.isWorkDay(n,e))&&i.push(n),n=Y(n,1);else if("WorkWeek"===this.parent.currentView||"TimelineWorkWeek"===this.parent.currentView)for(var n=Ue(z(t),this.parent.activeViewOptions.firstDayOfWeek),r=0,s=7*this.parent.activeViewOptions.interval;r<s;r++)this.isWorkDay(n,e)&&i.push(n),n=Y(n,1);else for(var o="Agenda"===this.parent.currentView?this.parent.agendaDaysCount:this.parent.activeViewOptions.interval,n=z(t);(this.parent.activeViewOptions.showWeekend||this.isWorkDay(n,e))&&i.push(n),n=Y(n,1),o!==i.length;);return e||(this.renderDates=i),this.parent.headerModule&&this.parent.headerModule.previousNextIconHandler(),i},T.prototype.getNextPreviousDate=function(e){if(this.previousNextAction=e,"Day"===this.parent.currentView||"TimelineDay"===this.parent.currentView){var t;if(this.parent.activeViewOptions.showWeekend)return t=this.parent.activeViewOptions.interval,Y(this.parent.selectedDate,"Next"===e?t:-t);var i=void 0;if("Next"===e)for(i=Y(this.renderDates.slice(-1)[0],1);!this.isWorkDay(i);)i=Y(i,1);else for(var i=Y(this.renderDates[0],-1),n=0;this.isWorkDay(i)&&(n+=1),this.parent.activeViewOptions.interval!==n&&(i=Y(i,-1)),this.parent.activeViewOptions.interval!==n;);return i}return Y(this.parent.selectedDate,("Next"===e?7:-7)*this.parent.activeViewOptions.interval)},T.prototype.formatViewLabel=function(e,t,i){var n={type:"date",skeleton:"full",calendar:this.parent.getCalendarMode()};return this.parent.localeObj.getConstant(e)+" "+this.parent.localeObj.getConstant("start")+" "+this.parent.globalize.formatDate(t,n)+" "+this.parent.localeObj.getConstant("endAt")+" "+this.parent.globalize.formatDate(i,n)},T.prototype.getLabelText=function(e){var t=e.charAt(0).toLowerCase()+e.substring(1);return"Year"===e||"TimelineYear"===e?this.formatViewLabel(t,this.parent.activeView.getStartDate(),this.parent.activeView.getEndDate()):0<this.renderDates.length?"Day"===this.parent.currentView||"TimelineDay"===this.parent.currentView?this.parent.localeObj.getConstant(t)+" of "+y(this.parent.globalize.formatDate(this.parent.selectedDate,{type:"date",skeleton:"full",calendar:this.parent.getCalendarMode()}),"single"):this.formatViewLabel(t,this.renderDates[0],this.renderDates[this.renderDates.length-1]):""},T.prototype.getDateRangeText=function(e,t){var i;return void 0===e&&(e=this.renderDates[0]),void 0===t&&(t=this.renderDates),this.parent.isAdaptive?(i=this.parent.activeViewOptions.dateFormat||"MMMM y",y(this.parent.globalize.formatDate(this.parent.selectedDate,{format:i,calendar:this.parent.getCalendarMode()}),"single")):this.formatDateRange(e,t[t.length-1])},T.prototype.formatDateRange=function(e,t){var i,n,r=this.parent.globalize,a=this.parent.getCalendarMode();return e===t&&(t=null),B.isNullOrUndefined(this.parent.activeViewOptions.dateFormat)?(n=B.isNullOrUndefined(this.parent.locale)||"en"===this.parent.locale||"en-US"===this.parent.locale?B.getValue("dateFormats.long",B.getDefaultDateObject(a)):B.getValue("main."+this.parent.locale+".dates.calendars."+a+".dateFormats.long",B.cldrData),t?y("d"===(i=n.trim().toLocaleLowerCase()).substr(0,1)?e.getFullYear()===t.getFullYear()?e.getMonth()===t.getMonth()?r.formatDate(e,{format:"dd",calendar:a})+" - "+r.formatDate(t,{format:"dd MMMM yyyy",calendar:a}):r.formatDate(e,{format:"dd MMM",calendar:a})+" - "+r.formatDate(t,{format:"dd MMM yyyy",calendar:a}):r.formatDate(e,{format:"dd MMM yyyy",calendar:a})+" - "+r.formatDate(t,{format:"dd MMM yyyy",calendar:a}):"m"===i.substr(0,1)?e.getFullYear()===t.getFullYear()?e.getMonth()===t.getMonth()?r.formatDate(e,{format:"MMMM dd",calendar:a})+" - "+r.formatDate(t,{format:"dd, yyyy",calendar:a}):r.formatDate(e,{format:"MMM dd",calendar:a})+" - "+r.formatDate(t,{format:"MMM dd, yyyy",calendar:a}):r.formatDate(e,{format:"MMM dd, yyyy",calendar:a})+" - "+r.formatDate(t,{format:"MMM dd, yyyy",calendar:a}):r.formatDate(e,{format:n,calendar:a})+" - "+r.formatDate(t,{format:n,calendar:a}),"multiple"):y(r.formatDate(e,{format:n,calendar:a}),"single")):y(t?r.formatDate(e,{format:this.parent.activeViewOptions.dateFormat,calendar:a})+" - "+r.formatDate(t,{format:this.parent.activeViewOptions.dateFormat,calendar:a}):r.formatDate(e,{format:this.parent.activeViewOptions.dateFormat,calendar:a}),"multiple")},T.prototype.getMobileDateElement=function(e,t){return B.createElement("div",{className:t,innerHTML:'<div class="e-m-date">'+this.parent.globalize.formatDate(e,{format:"d",calendar:this.parent.getCalendarMode()})+'</div><div class="e-m-day">'+y(this.parent.globalize.formatDate(e,{format:"E",calendar:this.parent.getCalendarMode()}),"single")+"</div>"})},T.prototype.setResourceHeaderContent=function(e,t,i){var n,r;void 0===i&&(i=bn),this.parent.activeViewOptions.resourceHeaderTemplate?(n={resource:t.resource,resourceData:t.resourceData},r=this.parent.element.id+"_"+this.parent.activeViewOptions.resourceHeaderTemplateName+"resourceHeaderTemplate",n=[].slice.call(this.parent.getResourceHeaderTemplate()(n,this.parent,"resourceHeaderTemplate",r,!1,void 0,void 0,this.parent.root)),B.append(n,e)):(r=B.createElement("div",{className:i}),this.parent.sanitize(t.resourceData[t.resource.textField],r),e.appendChild(r))},T.prototype.renderResourceMobileLayout=function(){this.parent.resourceBase.lastResourceLevel&&this.parent.resourceBase.lastResourceLevel.length<=0||(this.parent.resourceBase.renderResourceHeader(),this.parent.resourceBase.renderResourceTree())},T.prototype.addAutoHeightClass=function(e){!this.parent.uiStateValues.isGroupAdaptive&&this.parent.rowAutoHeight&&this.isTimelineView()&&0<this.parent.activeViewOptions.group.resources.length&&B.addClass([e],Mr)},T.prototype.getColElements=function(){return[].slice.call(this.element.querySelectorAll("."+A+" col, ."+Vt+" col"))},T.prototype.setColWidth=function(e){var t,i,n;this.isTimelineView()&&(t=this.getColElements(),n=this.element.querySelector("."+C+" tbody"),i=this.parent.getElementWidth(n)/(t.length/2),e.offsetHeight!==e.clientHeight&&(n=this.parent.element.querySelector("."+Wt),B.isNullOrUndefined(n)||n.offsetHeight===e.clientHeight||B.setStyleAttribute(n,{height:B.formatUnit(e.clientHeight)})),[].slice.call(this.element.querySelectorAll(".e-header-cells,.e-time-slots,.e-header-week-cell,.e-header-month-cell,.e-header-year-cell")).forEach(function(e){var t=B.isNullOrUndefined(e.getAttribute("colspan"))?"1":e.getAttribute("colspan"),t=parseInt(t,10);B.setStyleAttribute(e,{width:B.formatUnit(i*t)})}))},T.prototype.resetColWidth=function(){for(var e=0,t=this.getColElements();e<t.length;e++)t[e].style.width=""},T.prototype.getContentAreaElement=function(){return this.element.querySelector("."+A)},T.prototype.wireExpandCollapseIconEvents=function(){if(this.parent.resourceBase&&1<this.parent.resourceBase.resourceCollection.length)for(var e=0,t=[].slice.call(this.element.querySelectorAll("."+Qt));e<t.length;e++){var i=t[e];B.EventHandler.clearEvents(i),B.EventHandler.add(i,"click",this.parent.resourceBase.onTreeIconClick,this.parent.resourceBase)}},T.prototype.scrollToDate=function(e){var t;-1===["Month","TimelineMonth"].indexOf(this.parent.currentView)||B.isNullOrUndefined(e)||(t=this.getContentAreaElement(),e=new Date(z(new Date(+e)).getTime()).getTime(),e=t.querySelector("."+O+'[data-date="'+e+'"]'),"Month"===this.parent.currentView&&e&&(t.scrollWidth>t.clientWidth&&(this.parent.enableRtl?t.scrollLeft=-(this.parent.getContentTable().offsetWidth-e.offsetLeft-e.offsetWidth):t.scrollLeft=e.offsetLeft),t.scrollTop=e.offsetTop),"TimelineMonth"===this.parent.currentView&&e&&(this.parent.enableRtl?t.scrollLeft=-(this.parent.getContentTable().offsetWidth-e.offsetLeft-e.offsetWidth):t.scrollLeft=e.offsetLeft))},T.prototype.setPersistence=function(){var e;this.parent.enablePersistence&&(e=this.element.querySelector(".e-content-wrap"),this.parent.virtualScrollModule&&this.isScrolledBottom&&(this.isScrolledBottom=!1,this.skipPersistenceSave=!0,e.scrollTop=this.parent.scrollTop,this.skipPersistenceSave=!1),B.isNullOrUndefined(e)||(this.parent.scrollLeft=e.scrollLeft,this.parent.scrollTop=e.scrollTop))},T.prototype.retainScrollPosition=function(){var e;this.parent.enablePersistence&&(e=this.parent.element.querySelector(".e-content-wrap"),B.isNullOrUndefined(e)||B.isNullOrUndefined(this.parent.scrollLeft)||B.isNullOrUndefined(this.parent.scrollTop)||(this.isScrolledBottom=e.scrollHeight-e.clientHeight<this.parent.scrollTop,e.scrollTop=this.parent.scrollTop,e.scrollLeft=this.parent.scrollLeft))},T.prototype.getViewStartDate=function(){var e=this.renderDates[0];return e=0<this.parent.activeViewOptions.group.resources.length&&0<this.parent.resourceBase.lastResourceLevel.length?this.parent.resourceBase.getResourceRenderDates()[0]:e},T.prototype.getViewEndDate=function(){var e=Y(this.renderDates[this.renderDates.length-1],1);return e=0<this.parent.activeViewOptions.group.resources.length&&0<this.parent.resourceBase.lastResourceLevel.length?Y(this.parent.resourceBase.getResourceRenderDates().slice(-1)[0],1):e},T.prototype.getAdjustedDate=function(e){return!this.parent.activeViewOptions.timeScale.enable||"Month"===this.parent.currentView||"TimelineYear"===this.parent.currentView&&0===this.parent.activeViewOptions.group.resources.length?new Date(e.setHours(0,0,0,0)):"TimelineYear"===this.parent.currentView&&0<this.parent.activeViewOptions.group.resources.length?(e.setHours(0,0,0,0),new Date(e.setDate(1))):null},T.prototype.resetColLevels=function(){this.parent.resourceBase.expandedResources=[];for(var e=this.parent.virtualScrollModule.getRenderedCount(),t=this.parent.activeViewOptions.group.byDate?this.colLevels[0]:this.parent.resourceBase.renderedResources,i=0,n=0;n<t.length&&!(e<=i);n++)i+=t[parseInt(n.toString(),10)].colSpan,this.parent.resourceBase.expandedResources.push(t[parseInt(n.toString(),10)]);this.parent.activeViewOptions.group.byDate?(this.colLevels[0]=this.parent.resourceBase.expandedResources,this.parent.virtualScrollModule.setRenderedDates(this.parent.resourceBase.expandedResources)):(this.colLevels[this.colLevels.length-2]=this.parent.resourceBase.expandedResources,this.parent.resourceBase.renderedResources=this.parent.resourceBase.expandedResources),"Month"!==this.parent.currentView&&(this.colLevels[this.colLevels.length-1]=this.colLevels[this.colLevels.length-1].slice(0,i),this.parent.resourceBase.expandedResources=this.colLevels[this.colLevels.length-1])},T.prototype.getGroupIndices=function(e){var t=[];return t=this.parent.virtualScrollModule&&0<this.parent.activeViewOptions.group.resources.length&&(e||0<this.parent.virtualScrollModule.existingDataCollection.length)&&!this.parent.uiStateValues.isGroupAdaptive?(e=B.isNullOrUndefined(e)?this.parent.virtualScrollModule.existingDataCollection:e).map(function(e){return e.groupIndex}):t},T.prototype.destroy=function(){this.element&&this.element.parentNode&&B.remove(this.element),this.element=null,this.renderDates=null,this.colLevels=null};hs=T;function T(e){this.previousNextAction="Next",this.skipPersistenceSave=!1,this.isScrolledBottom=!1,this.parent=e}Tl=function(e,t){return(Tl=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}Tl(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(D,wl=hs),D.prototype.getModuleName=function(){return"verticalView"},D.prototype.addEventListener=function(){this.parent.on(Me,this.scrollUiUpdate,this),this.parent.on(Ee,this.renderEvents,this)},D.prototype.removeEventListener=function(){this.parent&&(this.parent.off(Me,this.scrollUiUpdate),this.parent.off(Ee,this.renderEvents))},D.prototype.renderEvents=function(){this.appointment=new(this.parent.activeViewOptions.timeScale.enable?Xa:Za)(this.parent),this.appointment.renderAppointments(),this.parent.notify(xe,{})},D.prototype.onContentScroll=function(e){this.parent.removeNewEventElement();var t=e.target;this.parent.notify(Ie,e),this.scrollLeftPanel(t),this.scrollTopPanel(t),this.parent.isAdaptive||(this.parent.uiStateValues.top=t.scrollTop),this.parent.uiStateValues.left=t.scrollLeft,B.isNullOrUndefined(this.parent.quickPopup)||this.parent.uiStateValues.isTapHold||this.parent.quickPopup.quickPopupHide(),this.setPersistence()},D.prototype.onAdaptiveMove=function(e){this.parent.uiStateValues.action&&e.preventDefault()},D.prototype.onAdaptiveScroll=function(e){this.parent&&!this.parent.isDestroyed&&(this.parent.removeNewEventElement(),this.parent.uiStateValues.top=e.target.scrollTop)},D.prototype.scrollLeftPanel=function(e){var t=this.getLeftPanelElement();B.isNullOrUndefined(t)||(t.scrollTop=e.scrollTop)},D.prototype.scrollUiUpdate=function(e){var t,i,n,r,a;this.parent&&(a=this.parent.element.querySelector("."+Vt),r=this.getHeaderBarHeight(),t=this.getLeftPanelElement(),i=this.getScrollableElement(),n=this.getDatesHeaderElement(),r=this.parent.element.offsetHeight-r-n.offsetHeight,this.setContentHeight(i,t,r),this.setColWidth(i),r=rt(),n.firstElementChild.style[e.cssProperties.rtlBorder]="",n.style[e.cssProperties.rtlPadding]="",a=!this.parent.enableAllDayScroll||!(i.offsetWidth-i.clientWidth<=a.offsetWidth-a.clientWidth&&a.classList.contains("e-all-day-scroll")),0<i.offsetWidth-i.clientWidth&&a?(n.firstElementChild.style[e.cssProperties.border]=0<r?"1px":"0px",n.style[e.cssProperties.padding]=0<r?r-1+"px":"0px"):(n.firstElementChild.style[e.cssProperties.border]="",n.style[e.cssProperties.padding]=""),e.isPreventScrollUpdate||(this.parent.uiStateValues.isInitial?(-1<this.parent.currentView.indexOf("Timeline")&&(i.scrollTop=this.parent.uiStateValues.top),this.scrollToWorkHour(),this.parent.uiStateValues.isInitial=!1):(t&&(t.scrollTop=this.parent.uiStateValues.top),i.scrollTop=this.parent.uiStateValues.top,i.scrollLeft=this.parent.uiStateValues.left)),this.parent.activeViewOptions.timeScale.enable&&this.highlightCurrentTime(),this.retainScrollPosition(),B.isNullOrUndefined(t)||B.isNullOrUndefined(i)||t.scrollTop===i.scrollTop||(t.scrollTop=i.scrollTop))},D.prototype.setContentHeight=function(e,t,i){this.parent.isAdaptive&&!this.isTimelineView()||B.isNullOrUndefined(t)||(t.style.height="auto"===this.parent.height?"auto":B.formatUnit(i-this.getScrollXIndent(e))),e.style.height="auto"===this.parent.height?"auto":B.formatUnit(i)},D.prototype.scrollToWorkHour=function(){var e;this.parent.workHours.highlight&&(e=this.element.querySelector("."+Et))&&(this.getScrollableElement().scrollTop=e.offsetTop,this.parent.uiStateValues.top=e.offsetTop,this.parent.uiStateValues.left=0)},D.prototype.scrollToHour=function(e,t){var i,e=this.parent.getStartEndTime(e);B.isNullOrUndefined(t)||(t=this.element.querySelector("."+It+'[data-date="'+new Date(z(t)).getTime()+'"]'))&&(this.parent.enableRtl?(i=this.element.querySelector("."+C),this.getScrollableElement().scrollLeft=-(i.offsetWidth-t.offsetLeft-t.offsetWidth)):this.getScrollableElement().scrollLeft=t.offsetLeft),B.isNullOrUndefined(e)||(this.getScrollableElement().scrollTop=this.getTopFromDateTime(e))},D.prototype.scrollToDate=function(e){this.scrollToHour(null,e)},D.prototype.generateColumnLevels=function(){var e,t,i,n=this.getDateSlots(this.renderDates,this.parent.activeViewOptions.workDays),r=[];if(0<this.parent.activeViewOptions.group.resources.length){if(r=this.parent.resourceBase.generateResourceLevels(n),this.parent.activeViewOptions.group.hideNonWorkingDays)for(;0===r[0].length;)this.parent.setProperties({selectedDate:this.parent.activeView.getNextPreviousDate(this.previousNextAction)},!0),this.parent.activeView.getRenderDates(),this.parent.headerModule&&(this.parent.headerModule.setCalendarDate(this.parent.selectedDate),this.parent.headerModule.updateDateRange()),n=this.getDateSlots(this.renderDates,this.parent.activeViewOptions.workDays),r=this.parent.resourceBase.generateResourceLevels(n);this.parent.uiStateValues.isGroupAdaptive&&0<this.parent.resourceBase.lastResourceLevel.length&&(t=(e=this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex]).resourceData[e.resource.startHourField],i=e.resourceData[e.resource.endHourField],r=[this.getDateSlots(e.renderDates,e.workDays,t,i)])}else r.push(n);return this.colLevels=r},D.prototype.getDateSlots=function(e,t,i,n){void 0===i&&(i=this.parent.workHours.start),void 0===n&&(n=this.parent.workHours.end);for(var r=[],a=this.parent.getStartEndTime(i),s=this.parent.getStartEndTime(n),o=0,l=e;o<l.length;o++){var p=l[o],c=[It];this.isCurrentDate(p)&&c.push(kt),r.push({date:p,type:"dateHeader",className:c,colSpan:1,workDays:t,startHour:new Date(+a),endHour:new Date(+s)})}return r},D.prototype.isWorkHourRange=function(e){return this.getStartHour().getTime()<=e.getTime()&&this.getEndHour().getTime()>=e.getTime()},D.prototype.highlightCurrentTime=function(){var e,t=this;0<this.parent.activeViewOptions.headerRows.length&&"Hour"!==this.parent.activeViewOptions.headerRows.slice(-1)[0].option||(e=this.parent.getCurrentTime(),this.parent.showTimeIndicator&&this.isWorkHourRange(e)&&0<this.getCurrentTimeIndicatorIndex().length&&!B.isNullOrUndefined(this.element.querySelector("."+O))?(this.changeCurrentTimePosition(),B.isNullOrUndefined(this.currentTimeIndicatorTimer)&&((e=je-(1e3*e.getSeconds()+e.getMilliseconds()))<=59e3&&window.setTimeout(function(){B.isNullOrUndefined(t.currentTimeIndicatorTimer)||(t.clearCurrentTimeIndicatorTimer(),t.changeCurrentTimePosition(),t.updateCurrentTimeIndicatorTimer())},e),this.updateCurrentTimeIndicatorTimer())):this.clearCurrentTimeIndicatorTimer())},D.prototype.getCurrentTimeIndicatorIndex=function(){var e=[];if(!B.isNullOrUndefined(this.parent.resourceBase)&&0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive){var t=0,i=z(this.parent.getCurrentTime());if(this.parent.virtualScrollModule&&this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.activeViewOptions.group.byDate)for(var n=0,r=this.parent.resourceBase.expandedResources;n<r.length;n++)z((l=r[n]).date).getTime()===i.getTime()&&e.push(t),t+=1;else for(var a=0,s=this.parent.resourceBase.renderedResources;a<s.length;a++){var o,l=s[a];0<=(p=this.parent.getIndexOfDate(l.renderDates,i))&&(o=this.parent.activeViewOptions.group.byDate?this.parent.resourceBase.lastResourceLevel.length*p+t:t+p,e.push(o)),t+=this.parent.activeViewOptions.group.byDate?1:l.renderDates.length}}else{var p,c=(this.parent.uiStateValues.isGroupAdaptive&&0<this.parent.resourceBase.lastResourceLevel.length?this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex]:this).renderDates;0<=(p=this.parent.getIndexOfDate(c,z(this.parent.getCurrentTime())))&&e.push(p)}return e},D.prototype.clearCurrentTimeIndicatorTimer=function(){B.isNullOrUndefined(this.currentTimeIndicatorTimer)||(window.clearInterval(this.currentTimeIndicatorTimer),this.currentTimeIndicatorTimer=null,this.removeCurrentTimeIndicatorElements())},D.prototype.updateCurrentTimeIndicatorTimer=function(){var e=this;this.currentTimeIndicatorTimer=window.setInterval(function(){e.changeCurrentTimePosition()},je)},D.prototype.removeCurrentTimeIndicatorElements=function(){for(var e=0,t=[].slice.call(this.element.querySelectorAll(".e-previous-timeline,.e-current-timeline,.e-current-time"));e<t.length;e++){var i=t[e];B.remove(i)}},D.prototype.changeCurrentTimePosition=function(){if(!this.parent||this.parent&&this.parent.isDestroyed)this.parent=null;else{this.removeCurrentTimeIndicatorElements();var e=this.getCurrentTimeIndicatorIndex(),t=this.parent.getContentTable().rows[0],i=this.getTopFromDateTime(this.parent.getCurrentTime()),n=B.formatUnit(i),i=Math.floor(i/t.cells[0].offsetHeight),t=this.getLeftPanelElement(),r=[].slice.call(t.querySelectorAll("tr"));if(!B.isNullOrUndefined(i)&&!isNaN(i)&&i!==r.length){for(var a=[].slice.call(this.element.querySelectorAll("."+si)),s=0,o=e[0];s<o;s++)a[parseInt(s.toString(),10)].appendChild(B.createElement("div",{className:ni,styles:"top:"+n}));for(var l=0,p=e;l<p.length;l++){var c=p[l];a.length>c&&a[parseInt(c.toString(),10)].appendChild(B.createElement("div",{className:ii,styles:"top:"+n}))}e=B.createElement("div",{innerHTML:this.parent.getTimeString(this.parent.getCurrentTime()),className:ti,styles:"top:"+n});i<=r.length&&(B.removeClass(t.querySelectorAll("."+ri),ri),r[parseInt(i.toString(),10)]&&B.addClass([r[parseInt(i.toString(),10)].lastElementChild],ri),B.prepend([e],t),e.style.top=B.formatUnit(e.offsetTop-e.offsetHeight/2))}}},D.prototype.getTopFromDateTime=function(e){var t=this.getStartEndHours(this.parent.activeViewOptions.startHour),i=this.getStartEndHours(this.parent.activeViewOptions.endHour),n=60*(e.getHours()-t.getHours())+(e.getMinutes()-t.getMinutes()),e=Je(z(new Date(e.getTime())),t,i),e=(e.endHour.getTime()-e.startHour.getTime())/je,r=this.parent.activeViewOptions.timeScale.interval,a=0,a=(0!==t.getHours()||0!==t.getMinutes()||0!==i.getHours()||0!==i.getMinutes())&&1===this.parent.activeViewOptions.timeScale.slotCount&&e<r?e:r;return n*this.getWorkCellHeight()*this.parent.activeViewOptions.timeScale.slotCount/a},D.prototype.getWorkCellHeight=function(){return parseFloat(this.parent.getElementHeight(this.element.querySelector("."+O)).toFixed(2))},D.prototype.getTdContent=function(e,t,i){var n,r,a,s=B.createElement("div"),o="",l=this.parent.element.id+"_";switch(t){case"dateHeader":n=this.parent.activeViewOptions.dateHeaderTemplate?(o="dateHeaderTemplate",a={date:e,type:t,groupIndex:i},r=this.parent.activeViewOptions.dateHeaderTemplateName,[].slice.call(this.parent.getDateHeaderTemplate()(a,this.parent,o,l+r+o,!1,void 0,void 0,this.parent.root))):(s.innerHTML=this.parent.activeView.isTimelineView()?'<span class="e-header-date e-navigate">'+this.getTimelineDate(e)+"</span>":'<div class="e-header-day">'+y(this.getDayName(e),"single")+'</div><div class="e-header-date e-navigate" role="link">'+this.getDate(e)+"</div>",[].slice.call(s.childNodes));break;case"majorSlot":n=this.parent.activeViewOptions.timeScale.majorSlotTemplate?(o="majorSlotTemplate",a={date:e,type:t},[].slice.call(this.parent.getMajorSlotTemplate()(a,this.parent,o,l+o,!1,void 0,void 0,this.parent.root))):(s.innerHTML="<span>"+this.getTime(e)+"</span>",[].slice.call(s.childNodes));break;case"minorSlot":n=this.parent.activeViewOptions.timeScale.minorSlotTemplate?(o="minorSlotTemplate",a={date:e,type:t},[].slice.call(this.parent.getMinorSlotTemplate()(a,this.parent,o,l+o,!1,void 0,void 0,this.parent.root))):[].slice.call(s.childNodes);break;case"alldayCells":this.parent.activeViewOptions.cellTemplate&&(r=this.parent.activeViewOptions.cellTemplateName,o="cellTemplate",a={date:e,type:t,groupIndex:i},n=[].slice.call(this.parent.getCellTemplate()(a,this.parent,o,l+r+o,!1,void 0,void 0,this.parent.root)))}return n},D.prototype.refreshHeader=function(){B.remove(this.element.querySelector("tbody tr")),this.renderHeader(),this.parent.notify(Ve,{});var e=this.element.querySelector("."+Vt);e&&(e.scrollLeft=this.parent.uiStateValues.left)},D.prototype.renderLayout=function(e){this.setPanel(B.createElement("div",{className:Oi}));var t=[this.baseCssClass,this.viewClass];t.push(e),this.parent.activeViewOptions.group.byDate&&t.push("e-by-date"),this.parent.activeViewOptions.timeScale.enable||B.addClass([this.element],["e-timescale-disable",this.viewClass]),this.parent.activeViewOptions.allowVirtualScrolling&&!this.parent.uiStateValues.isGroupAdaptive&&t.push(Ar),this.parent.rowAutoHeight&&this.parent.eventSettings.ignoreWhitespace&&t.push(kr),this.renderPanel(e),B.addClass([this.element],t),this.element.appendChild(this.createTableLayout(Ei)),this.element.querySelector("table").setAttribute("role","presentation"),this.colLevels=this.generateColumnLevels(),this.renderHeader(),this.renderContent(),this.parent.uiStateValues.isGroupAdaptive&&!this.parent.element.querySelector("."+pi)&&this.renderResourceMobileLayout(),this.parent.notify(Ve,{})},D.prototype.renderHeader=function(){var e,t=B.createElement("tr"),i=B.createElement("td");i.appendChild(this.renderDatesHeader()),this.parent.activeViewOptions.timeScale.enable&&((e=B.createElement("td",{className:Lt})).appendChild(this.renderLeftIndent()),t.appendChild(e)),t.appendChild(i),B.prepend([t],this.element.querySelector("tbody"))},D.prototype.renderContent=function(){0<this.parent.activeViewOptions.group.resources.length&&(this.parent.resourceBase.renderedResources=B.extend([],this.parent.resourceBase.lastResourceLevel,null,!0));var e,t,i,n=B.createElement("tr"),r=B.createElement("td");this.parent.isAdaptive?(r.setAttribute("colspan",this.parent.activeViewOptions.timeScale.enable?"2":"1"),e=B.createElement("div",{className:ai}),this.parent.activeViewOptions.timeScale.enable&&e.appendChild(this.renderTimeCells()),e.appendChild(this.renderContentArea()),r.appendChild(e),B.EventHandler.add(e,"scroll",this.onAdaptiveScroll,this),B.EventHandler.add(e,B.Browser.touchMoveEvent,this.onAdaptiveMove,this),n.appendChild(r)):(e=this.colLevels.slice(0),this.parent.virtualScrollModule&&this.resetColLevels(),t=this.renderContentArea(),r.appendChild(t),this.parent.activeViewOptions.timeScale.enable&&((i=B.createElement("td")).appendChild(this.renderTimeCells()),n.appendChild(i)),n.appendChild(r),this.parent.virtualScrollModule&&(this.colLevels=e,this.parent.virtualScrollModule.renderVirtualTrack(t))),this.element.querySelector("tbody").appendChild(n)},D.prototype.renderLeftIndent=function(){for(var e=B.createElement("div",{className:qt}),t=this.createTableLayout(),i=B.createElement("tr"),n=this.colLevels.length,r=0;r<n;r++){var a,s=i.cloneNode(),o={className:[this.colLevels[parseInt(r.toString(),10)][0]&&this.colLevels[parseInt(r.toString(),10)][0].className[0]],type:"emptyCells"};this.parent.activeViewOptions.showWeekNumber&&-1!==o.className.indexOf(It)&&(o.className.push(gi),a=this.parent.getWeekNumberContent(this.renderDates),o.template=[B.createElement("span",{innerHTML:""+a,attrs:{title:this.parent.localeObj.getConstant("week")+" "+a}})]),l=this.createTd(o),this.parent.renderHeaderIndentTemplate(o,l),s.appendChild(l),t.querySelector("tbody").appendChild(s)}var l,p=i.cloneNode(),c=B.createElement("div",{attrs:{tabindex:"0",role:"button",title:this.parent.localeObj.getConstant("expandAllDaySection"),"aria-disabled":"false","aria-label":this.parent.localeObj.getConstant("expandAllDaySection")},className:ln+" "+pn+" "+Dt+" "+d}),h={className:[w],type:"emptyCells"};return(l=this.createTd(h)).appendChild(c),this.parent.renderHeaderIndentTemplate(h,l),p.appendChild(l),t.querySelector("tbody").appendChild(p),e.appendChild(t),e},D.prototype.renderDatesHeader=function(){for(var e=B.createElement("div",{className:At}),t=B.createElement("div",{className:Vt}),i=(e.appendChild(t),this.createTableLayout()),n=B.createElement("tr",{className:nn}),r=this.colLevels.length,a=this.colLevels[r-1],s=0;s<r;s++){for(var o=n.cloneNode(),l=this.colLevels[parseInt(s.toString(),10)],p=0;p<l.length;p++)o.appendChild(this.createTd(l[parseInt(p.toString(),10)]));i.querySelector("tbody").appendChild(o)}return this.createAllDayRow(i,a),this.createColGroup(i,a),t.appendChild(i),e},D.prototype.createAllDayRow=function(e,t){for(var i=B.createElement("tr",{className:Ot}),n=0;n<t.length;n++){var r=B.extend({},t[parseInt(n.toString(),10)]),a=(r.className=[w],r.type="alldayCells",this.createTd(r));a.setAttribute("data-date",r.date.getTime().toString()),B.isNullOrUndefined(r.groupIndex)?this.parent.uiStateValues.isGroupAdaptive&&a.setAttribute("data-group-index",""+this.parent.uiStateValues.groupIndex):a.setAttribute("data-group-index",""+r.groupIndex),this.wireCellEvents(a),i.appendChild(a)}e.querySelector("tbody").appendChild(i);var s=B.createElement("thead");s.appendChild(this.parent.eventBase.createEventWrapper("allDay")),B.prepend([s],e)},D.prototype.createTd=function(e){var t=B.createElement("td"),i=(this.addAttributes(e,t),e.date&&e.type&&(i=this.getTdContent(e.date,e.type,e.groupIndex))&&i.length&&B.append(i,t),this.parent.isMinMaxDate(z(new Date(""+e.date)))||B.addClass([t],yr),"resourceHeader"===e.type&&this.setResourceHeaderContent(t,e),"dateHeader"===e.type&&0<=e.className.indexOf(It)&&(t.setAttribute("data-date",e.date.getTime().toString()),B.isNullOrUndefined(e.groupIndex)||t.setAttribute("data-group-index",""+e.groupIndex),this.wireMouseEvents(t)),{elementType:e.type,element:t,date:e.date,groupIndex:e.groupIndex});return this.parent.trigger($,i),t},D.prototype.wireCellEvents=function(e){B.EventHandler.add(e,"mousedown",this.parent.workCellAction.cellMouseDown,this.parent.workCellAction),this.wireMouseEvents(e)},D.prototype.wireMouseEvents=function(e){B.EventHandler.add(e,"click",this.parent.workCellAction.cellClick,this.parent.workCellAction),this.parent.isAdaptive||B.EventHandler.add(e,"dblclick",this.parent.workCellAction.cellDblClick,this.parent.workCellAction)},D.prototype.renderTimeCells=function(){var n=this,e=B.createElement("div",{className:Zt}),r=this.createTableLayout(),a=B.createElement("tr");return this.getTimeSlotRows(function(e){e.type=e.first?"majorSlot":"minorSlot",e.className=e.last?[Jt,$t]:[$t];var t=a.cloneNode(),i={date:e.date,type:e.type,className:e.className};return t.appendChild(n.createTd(i)),r.querySelector("tbody").appendChild(t),e}),e.appendChild(r),e},D.prototype.renderContentArea=function(){var e=B.createElement("div",{className:A}),t=this.createTableLayout(C);return this.setAriaAttributes(t),this.addAutoHeightClass(t),this.renderContentTable(t),this.createColGroup(t,this.colLevels.slice(-1)[0]),e.appendChild(t),this.wireCellEvents(t.querySelector("tbody")),B.EventHandler.add(e,"scroll",this.onContentScroll,this),B.EventHandler.add(e,B.Browser.touchMoveEvent,this.onAdaptiveMove,this),e},D.prototype.renderContentTable=function(e){var t=e.querySelector("tbody");B.append(this.getContentRows(),t),this.renderContentTableHeader(e)},D.prototype.getContentRows=function(){var s=this,o=[],l=B.createElement("tr"),p=B.createElement("td"),c=this.getGroupIndices();return this.getTimeSlotRows(function(e){for(var t=l.cloneNode(),i=0,n=s.colLevels[s.colLevels.length-1];i<n.length;i++){var r=n[i],a=!0;(a=s.parent.virtualScrollModule&&0<s.parent.activeViewOptions.group.resources.length&&-1<c.indexOf(r.groupIndex)?!1:a)&&(a=s.createContentTd(r,e,p),t.appendChild(a))}return o.push(t),e}),o},D.prototype.createContentTd=function(e,t,i){var i=i.cloneNode(),n=(e.colSpan&&i.setAttribute("colspan",e.colSpan.toString()),this.getContentTdClass(t)),r=z(e.date),t=(this.parent.isMinMaxDate(r)||n.push(yr),r=new Date(r.setHours(t.date.getHours(),t.date.getMinutes(),t.date.getSeconds(),t.date.getMilliseconds())),"workCells"),a=(-1!==e.className.indexOf(_t)&&(n.push(Ut),t="resourceGroupCells"),this.parent.workHours.highlight&&(this.parent.activeViewOptions.timeScale.enable&&this.isWorkHour(r,e.startHour,e.endHour,e.workDays)||!this.parent.activeViewOptions.timeScale.enable&&this.isWorkDay(r,e.workDays))&&n.push(Et),B.addClass([i],n),this.parent.activeViewOptions.cellTemplate&&(n={date:r,type:t,groupIndex:e.groupIndex},a=this.parent.element.id+"_"+this.parent.activeViewOptions.cellTemplateName+"cellTemplate",n=[].slice.call(this.parent.getCellTemplate()(n,this.parent,"cellTemplate",a,!1,void 0,void 0,this.parent.root)),B.append(n,i)),i.setAttribute("data-date",r.getTime().toString()),this.parent.activeViewOptions.timeScale.enable?(a=this.parent.globalize.formatDate(r,{type:"dateTime",skeleton:"full",calendar:this.parent.getCalendarMode()}),n=this.parent.globalize.formatDate(this.getEndDateFromStartDate(r),{type:"dateTime",skeleton:"full",calendar:this.parent.getCalendarMode()}),i.setAttribute("aria-label",a+" "+this.parent.localeObj.getConstant("endAt")+" "+n)):(a=this.parent.globalize.formatDate(e.date,{skeleton:"full",calendar:this.parent.getCalendarMode()}),i.setAttribute("aria-label",a)),B.isNullOrUndefined(e.groupIndex)&&!this.parent.uiStateValues.isGroupAdaptive||(n=(this.parent.uiStateValues.isGroupAdaptive?this.parent.uiStateValues:e).groupIndex,i.setAttribute("data-group-index",""+n)),{elementType:t,element:i,date:r,groupIndex:e.groupIndex});return this.parent.trigger($,a),i},D.prototype.getContentTdClass=function(e){return e.last?[O]:[O,ei]},D.prototype.renderContentTableHeader=function(e){var t=B.createElement("thead");t.appendChild(this.parent.eventBase.createEventWrapper()),this.parent.activeViewOptions.timeScale.enable&&t.appendChild(this.parent.eventBase.createEventWrapper("timeIndicator")),B.prepend([t],e)},D.prototype.getScrollableElement=function(){return this.parent.isAdaptive&&!this.isTimelineView()?this.element.querySelector("."+ai):this.getContentAreaElement()},D.prototype.getLeftPanelElement=function(){return this.element.querySelector("."+Zt)},D.prototype.getEndDateFromStartDate=function(e){var t=this.parent.activeViewOptions.timeScale.interval*je/this.parent.activeViewOptions.timeScale.slotCount,e=new Date(e.getTime());return e.setMilliseconds(e.getMilliseconds()+t),e},D.prototype.getStartEndHours=function(e){var t;return B.isNullOrUndefined(e)||""===e?new Date(2e3,0,0,0):(t=new Date(2e3,0,0,0),2===(e=e.split(":")).length&&t.setHours(parseInt(e[0],10),parseInt(e[1],10),0),t)},D.prototype.getTimeSlotRows=function(e){for(var t=[],i=this.getStartEndHours(this.parent.activeViewOptions.startHour),n=this.getStartEndHours(this.parent.activeViewOptions.endHour),r=this.parent.activeViewOptions.timeScale.interval*je,a=r/this.parent.activeViewOptions.timeScale.slotCount,s=Math.round(W/a),o=i.getTime(),l=n.getTime(),p=(o!==l&&(i=i.getTimezoneOffset()!==n.getTimezoneOffset()?l-o-36e5:l-o,s=Math.round(i/a)),this.parent.activeViewOptions.timeScale.enable||(s=1),this.parent.getStartEndTime(this.parent.workHours.start)),c=this.parent.getStartEndTime(this.parent.workHours.end),h=0;h<s;h++){var d=new Date(o+a*h),u=(!pt(d)&&new Date(o).getTimezoneOffset()===d.getTimezoneOffset()||(u=new Date(o).getTimezoneOffset()-d.getTimezoneOffset(),d=new Date(d.getTime()-6e4*u)),h%(r/a)),d={date:new Date(""+d),startHour:p,endHour:c,first:0==u,middle:u<this.parent.activeViewOptions.timeScale.slotCount-1,last:u==this.parent.activeViewOptions.timeScale.slotCount-1,type:""};e&&e(d),t.push(d)}return t},D.prototype.getAdjustedDate=function(e){if(!this.parent.activeViewOptions.timeScale.enable)return new Date(e.setHours(0,0,0,0));for(var t=this.getTimeSlotRows(),i=new Date(new Date(t[0].date.getTime()).setHours(e.getHours(),e.getMinutes(),e.getMilliseconds())),n=0;n<t.length;n++)if(t[parseInt(n.toString(),10)].date.getTime()>i.getTime())return e.setHours(t[n-1].date.getHours(),t[n-1].date.getMinutes(),t[n-1].date.getMilliseconds()),new Date(e);return null},D.prototype.destroy=function(){var e;!this.parent||this.parent&&this.parent.isDestroyed?this.parent=null:(this.clearCurrentTimeIndicatorTimer(),this.element&&(this.appointment&&(this.appointment.destroy(),this.appointment=null),(e=this.getContentAreaElement())&&(B.EventHandler.remove(e,"scroll",this.onContentScroll),B.EventHandler.remove(e,B.Browser.touchMoveEvent,this.onAdaptiveMove)),this.parent.resourceBase&&this.parent.resourceBase.destroy(),this.parent.scheduleTouchModule&&this.parent.scheduleTouchModule.resetValues(),wl.prototype.destroy.call(this)))};var Tl,wl,Co=D;function D(e){e=wl.call(this,e)||this;return e.viewClass="e-day-view",e.isInverseTableSelect=!0,e.baseCssClass="e-vertical-view",e.appointment=null,e}Dl=function(e,t){return(Dl=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}Dl(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Cl,bl=Co),Cl.prototype.getModuleName=function(){return"day"};var Dl,bl,Sl=Cl;function Cl(e){e=bl.call(this,e)||this;return e.viewClass="e-day-view",e}Ol=function(e,t){return(Ol=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}Ol(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Vl,El=Co),Vl.prototype.startDate=function(){return this.getViewStartDate()},Vl.prototype.endDate=function(){return this.getViewEndDate()},Vl.prototype.getModuleName=function(){return"week"};var Ol,El,xl=Vl;function Vl(e){e=El.call(this,e)||this;return e.viewClass="e-week-view",e}Al=function(e,t){return(Al=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}Al(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(kl,Il=Co),kl.prototype.startDate=function(){return this.getViewStartDate()},kl.prototype.endDate=function(){return this.getViewEndDate()},kl.prototype.getModuleName=function(){return"workWeek"};var Al,Il,Ml=kl;function kl(e){e=Il.call(this,e)||this;return e.viewClass="e-work-week-view",e}Rl=function(e,t){return(Rl=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}Rl(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(b,Hl=hs),b.prototype.addEventListener=function(){this.parent.on(Me,this.onScrollUIUpdate,this),this.parent.on(Ee,this.onDataReady,this),this.parent.on(q,this.onCellClick,this)},b.prototype.removeEventListener=function(){this.parent&&(this.parent.off(Me,this.onScrollUIUpdate),this.parent.off(Ee,this.onDataReady),this.parent.off(q,this.onCellClick))},b.prototype.onDataReady=function(e){this.monthEvent=new Za(this.parent),this.monthEvent.renderAppointments(),this.parent.notify(xe,{})},b.prototype.onCellClick=function(e){},b.prototype.onContentScroll=function(e){this.skipPersistenceSave||(this.parent.removeNewEventElement(),this.parent.notify(Ie,e),this.scrollTopPanel(e.target),this.scrollLeftPanel(e.target),this.parent.uiStateValues.top=e.target.scrollTop,this.parent.uiStateValues.left=e.target.scrollLeft,this.setPersistence())},b.prototype.scrollLeftPanel=function(e){var t=this.getLeftPanelElement();t&&(t.scrollTop=e.scrollTop)},b.prototype.getLeftPanelElement=function(){return this.element.querySelector("."+ui)},b.prototype.onScrollUIUpdate=function(e){var t=this.getHeaderBarHeight(),i=this.getDatesHeaderElement(),n=this.getContentAreaElement(),t=this.parent.element.offsetHeight-t-i.offsetHeight,r=this.getLeftPanelElement(),t=("auto"!==this.parent.height&&this.setContentHeight(n,r,t),rt());i.firstElementChild.style[e.cssProperties.rtlBorder]="",i.style[e.cssProperties.rtlPadding]="",0<n.offsetWidth-n.clientWidth?(i.firstElementChild.style[e.cssProperties.border]=0<t?"1px":"0px",i.style[e.cssProperties.padding]=0<t?t-1+"px":"0px"):(i.firstElementChild.style[e.cssProperties.border]="",i.style[e.cssProperties.padding]=""),this.setColWidth(n),(e.scrollPosition||!e.isPreventScrollUpdate&&"TimelineMonth"===this.parent.currentView)&&(t=("TimelineMonth"===this.parent.currentView?this.parent.uiStateValues:e.scrollPosition).top,r&&(r.scrollTop=t),n.scrollTop=t,this.parent.uiStateValues.isInitial?(this.scrollToSelectedDate(),this.parent.uiStateValues.isInitial=!1):n.scrollLeft=("TimelineMonth"===this.parent.currentView?this.parent.uiStateValues:e.scrollPosition).left),this.retainScrollPosition()},b.prototype.scrollToSelectedDate=function(){var e=new Date(this.parent.selectedDate),e=(e.setHours(0,0,0,0),this.element.querySelector("."+It+'[data-date="'+e.getTime().toString()+'"]')),t=this.getContentAreaElement();B.isNullOrUndefined(e)?t.scrollLeft=0:t.scrollLeft=this.parent.enableRtl?-(this.parent.getContentTable().offsetWidth-e.offsetLeft-e.offsetWidth):e.offsetLeft,0===t.scrollLeft&&this.parent.uiStateValues.isInitial&&(this.parent.uiStateValues.left=0)},b.prototype.setContentHeight=function(e,t,i){e.style.height="auto","Month"===this.parent.currentView&&(e.style.height=B.formatUnit(i)),t&&("MonthAgenda"===this.parent.currentView&&(i=(1<this.parent.activeViewOptions.interval?this.getContentAreaElement().firstElementChild:this.element.querySelector("."+C)).offsetHeight),t.style.height="auto",t.style.height=B.formatUnit(i-this.getScrollXIndent(e)))},b.prototype.generateColumnLevels=function(){var e,i,t=[],n=this.getDateSlots(this.renderDates,this.parent.activeViewOptions.workDays);return 0<this.parent.activeViewOptions.group.resources.length?(t=this.parent.resourceBase.generateResourceLevels(n),"MonthAgenda"===this.parent.currentView&&(t=[n]),this.parent.uiStateValues.isGroupAdaptive&&0<this.parent.resourceBase.lastResourceLevel.length&&(e=this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex],i=this.getDateSlots(e.renderDates,e.workDays),t=[i=this.parent.activeViewOptions.group.byDate&&this.parent.activeViewOptions.group.hideNonWorkingDays?-1<(e=i.findIndex(function(e,t){return 0!==t&&e.date.getDay()===i[0].date.getDay()}))?i.slice(0,e):i:i])):t.push(n),this.colLevels=t},b.prototype.getDateSlots=function(e,t){for(var i=this.parent.activeViewOptions.showWeekend?7:t.length,n=[],r=this.isCurrentMonth(this.parent.selectedDate),a=0;a<i;a++){var s=[It],o=e.slice(0,i).map(function(e){return e.getDay()});r&&o.indexOf(this.parent.currentTimezoneDate.getDay())===a&&s.push(kt),n.push({date:e[parseInt(a.toString(),10)],type:"monthDay",className:s,colSpan:1,workDays:t})}return n},b.prototype.getDayNameFormat=function(){return this.parent.isAdaptive||0<this.parent.activeViewOptions.group.resources.length?"abbreviated":"wide"},b.prototype.renderLayout=function(e){this.dayNameFormat=this.getDayNameFormat(),this.setPanel(B.createElement("div",{className:Oi}));var t=[this.viewClass],t=(t.push(e),this.parent.activeViewOptions.group.byDate&&(t.push("e-by-date"),"Month"!==this.parent.currentView)&&(this.parent.activeViewOptions.group.hideNonWorkingDays=!1),this.parent.activeViewOptions.allowVirtualScrolling&&!this.parent.uiStateValues.isGroupAdaptive&&t.push(Ar),this.parent.rowAutoHeight&&this.parent.eventSettings.ignoreWhitespace&&t.push(kr),B.addClass([this.element],t),this.renderPanel(e),this.element.appendChild(this.createTableLayout(Ei)),this.element.querySelector("table").setAttribute("role","presentation"),this.colLevels=this.generateColumnLevels(),this.renderHeader(),this.renderContent(),"MonthAgenda"===this.parent.currentView?this.parent.activeView.getPanel():this.parent.element);this.parent.uiStateValues.isGroupAdaptive&&!t.querySelector("."+pi)&&this.renderResourceMobileLayout(),this.parent.notify(Ve,{}),this.parent.uiStateValues.isCustomMonth&&(this.parent.uiStateValues.isCustomMonth=!1)},b.prototype.refreshHeader=function(){B.remove(this.element.querySelector("tbody tr")),this.renderHeader(),this.parent.notify(Ve,{});var e=this.element.querySelector("."+Vt),t=this.element.querySelector("."+A);e&&(e.scrollLeft=this.parent.uiStateValues.left),t&&(t.scrollLeft=this.parent.uiStateValues.left)},b.prototype.wireCellEvents=function(e){B.EventHandler.add(e,"mousedown",this.parent.workCellAction.cellMouseDown,this.parent.workCellAction),B.EventHandler.add(e,"click",this.parent.workCellAction.cellClick,this.parent.workCellAction),this.parent.isAdaptive||B.EventHandler.add(e,"dblclick",this.parent.workCellAction.cellDblClick,this.parent.workCellAction)},b.prototype.renderHeader=function(){var e=B.createElement("tr"),t=(this.renderLeftIndent(e),B.createElement("td"));t.appendChild(this.renderDatesHeader()),e.appendChild(t),B.prepend([e],this.element.querySelector("tbody"))},b.prototype.renderLeftIndent=function(e){this.parent.activeViewOptions.showWeekNumber&&e.appendChild(B.createElement("td",{className:"e-left-indent"}))},b.prototype.renderContent=function(){0<this.parent.activeViewOptions.group.resources.length&&(this.parent.resourceBase.renderedResources=B.extend([],this.parent.resourceBase.lastResourceLevel,null,!0));var e,t=B.createElement("tr"),i=(this.parent.activeViewOptions.showWeekNumber&&t.appendChild(this.renderWeekNumberContent()),B.createElement("td")),n=this.colLevels.slice(0),r=(this.parent.virtualScrollModule&&this.resetColLevels(),B.createElement("div",{className:A})),a=this.renderContentArea();"Month"===this.parent.currentView?r.appendChild(a):((e=B.createElement("div",{className:St})).appendChild(a),r.appendChild(e)),B.EventHandler.add(r,"scroll",this.onContentScroll,this),i.appendChild(r),t.appendChild(i),this.parent.virtualScrollModule&&(this.colLevels=n,this.parent.virtualScrollModule.renderVirtualTrack(r)),this.element.querySelector("tbody").appendChild(t),this.renderAppointmentContainer()},b.prototype.renderWeekNumberContent=function(){for(var e=this.renderDates.map(function(e){return new Date(+e)}),t=B.createElement("td"),i=B.createElement("div",{className:ui}),n=(t.appendChild(i),this.createTableLayout()),r=(i.appendChild(n),this.parent.activeViewOptions.showWeekend?7:this.parent.activeViewOptions.workDays.length),a=0,s=this.renderDates.length/r;a<s;a++){var o=e.splice(0,r),o=this.parent.getWeekNumberContent(o);n.querySelector("tbody").appendChild(this.createWeekNumberElement(o))}return t},b.prototype.renderAppointmentContainer=function(){},b.prototype.renderDatesHeader=function(){for(var e,t=B.createElement("div",{className:At}),i=B.createElement("div",{className:Vt}),n=(t.appendChild(i),this.createTableLayout()),r=("Month"===this.parent.currentView&&((e=B.createElement("thead")).appendChild(B.createElement("tr")),B.prepend([e],n)),this.createColGroup(n,this.colLevels[this.colLevels.length-1]),B.createElement("tr")),a=0;a<this.colLevels.length;a++){for(var s=this.colLevels[parseInt(a.toString(),10)],o=r.cloneNode(),l=0;l<s.length;l++){var p=s[parseInt(l.toString(),10)];o.appendChild(this.createHeaderCell(p))}n.querySelector("tbody").appendChild(o)}return i.appendChild(n),t},b.prototype.createHeaderCell=function(e){var t,i,n=B.createElement("td"),r=(this.addAttributes(e,n),"monthDay"===e.type&&(t=B.createElement("span",{innerHTML:y(this.parent.getDayNames(this.dayNameFormat)[e.date.getDay()],"single")}),n.appendChild(t)),"resourceHeader"===e.type&&this.setResourceHeaderContent(n,e),"dateHeader"===e.type&&(B.addClass([n],Pi),n.setAttribute("data-date",e.date.getTime().toString()),this.parent.activeViewOptions.dateHeaderTemplate?(i={date:e.date,type:e.type},r=this.parent.element.id+"_"+this.parent.activeViewOptions.dateHeaderTemplateName+"dateHeaderTemplate",(i=[].slice.call(this.parent.getDateHeaderTemplate()(i,this.parent,"dateHeaderTemplate",r,!1,void 0,void 0,this.parent.root)))&&i.length&&B.append(i,n)):(t=B.createElement("span",{className:Hi}),r=this.parent.globalize.formatDate(e.date,{skeleton:"full",calendar:this.parent.getCalendarMode()}),t.setAttribute("title",y(r,"multiple")),i=!this.parent.calendarUtil.isMonthStart(e.date)||this.isCurrentDate(e.date)||this.parent.isAdaptive?this.parent.globalize.formatDate(e.date,{skeleton:"d",calendar:this.parent.getCalendarMode()}):this.parent.globalize.formatDate(e.date,{format:"MMM d",calendar:this.parent.getCalendarMode()}),t.innerHTML=y(i,"single"),n.appendChild(t)),this.wireCellEvents(n)),{elementType:e.type,element:n,date:e.date,groupIndex:e.groupIndex});return this.parent.trigger($,r),n},b.prototype.getContentSlots=function(){if(!this.colLevels[this.colLevels.length-1]||!this.colLevels[this.colLevels.length-1][0])return[];var r=[],o=function(e,t,i,n){t={date:new Date(+t),groupIndex:i.groupIndex,workDays:i.workDays,type:"monthCells",className:n||[O]};r[parseInt(e.toString(),10)]||(r[parseInt(e.toString(),10)]=[]),r[parseInt(e.toString(),10)].push(t)},l="MonthAgenda"!==this.parent.currentView&&0<this.parent.activeViewOptions.group.resources.length;if(!l||this.parent.uiStateValues.isGroupAdaptive||this.parent.activeViewOptions.group.byDate)for(var e=this.renderDates.map(function(e){return new Date(+e)}),p=this.parent.activeViewOptions.showWeekend?7:this.parent.activeViewOptions.workDays.length,t=this.colLevels.slice(0,1)[0],i=this.renderDates.map(Number).indexOf(+t[0].date),c=0;c<this.renderDates.length/p;c++)for(var h,d=e.splice(0,p),u=i,g=this,n=i;n<this.colLevels[0].length+i&&n<d.length;n++)!function(e){var t=d[parseInt(u.toString(),10)];if(u++,l){var i=g.colLevels[g.colLevels.length-1],n=i.length/p,r=i.slice(0,n);if(g.parent.activeViewOptions.group.hideNonWorkingDays&&0===(r=i.filter(function(e){return e.date.getDay()===t.getDay()})).length)return h=e-=1;for(var a=0;a<r.length;a++){var s=0!==a?[O,"e-disable-date"]:void 0;o(c,t,r[parseInt(a.toString(),10)],s)}}else o(c,t,g.colLevels[g.colLevels.length-1][0]);h=e}(n),n=h;else for(var a=0,s=this.colLevels[this.colLevels.length-2];a<s.length;a++)for(var m=s[a],e=m.renderDates.map(function(e){return new Date(+e)}),p=this.parent.activeViewOptions.showWeekend?7:m.workDays.length,c=0;c<m.renderDates.length/p;c++)for(var d,v=0,f=d=e.splice(0,p);v<f.length;v++){var y=f[v];o(c,y,m)}return r},b.prototype.updateClassList=function(e){!this.isCustomMonth()&&this.isOtherMonth(e.date)&&e.className.push(E),this.parent.isMinMaxDate(e.date)||e.className.push(yr),this.updateSelectedCellClass(e)},b.prototype.updateSelectedCellClass=function(e){},b.prototype.isOtherMonth=function(e){return e.getTime()<this.monthDates.start.getTime()||e.getTime()>this.monthDates.end.getTime()},b.prototype.renderContentArea=function(){var e=this.createTableLayout(C),t=(this.setAriaAttributes(e),this.addAutoHeightClass(e),"TimelineMonth"===this.parent.currentView&&this.createColGroup(e,this.colLevels[this.colLevels.length-1]),new Date(this.parent.selectedDate.getTime())),t=(this.monthDates={start:this.parent.calendarUtil.firstDateOfMonth(t),end:this.parent.calendarUtil.lastDateOfMonth(Ke(t,this.parent.activeViewOptions.interval-1))},e.querySelector("tbody"));return B.append(this.getContentRows(),t),this.wireCellEvents(t),e},b.prototype.getContentRows=function(){for(var e=[],t=B.createElement("tr"),i=B.createElement("td"),n=this.getContentSlots(),r="TimelineMonth"===this.parent.currentView?this.getGroupIndices():[],a=0;a<n.length;a++)if(!(0<r.length&&-1<r.indexOf(n[parseInt(a.toString(),10)][0].groupIndex))){for(var s=t.cloneNode(),o=0;o<n[parseInt(a.toString(),10)].length;o++){var l=this.createContentTd(n[parseInt(a.toString(),10)][parseInt(o.toString(),10)],i);s.appendChild(l)}e.push(s)}return e},b.prototype.createContentTd=function(e,t){var i,t=t.cloneNode(),n=(e.colSpan&&t.setAttribute("colspan",e.colSpan.toString()),this.updateClassList(e),e.type),r=(-1!==e.className.indexOf(_t)&&(e.className.push(Ut),n="resourceGroupCells"),this.parent.workHours.highlight&&this.isWorkDay(e.date,e.workDays)&&e.className.push(Mt),this.isCurrentDate(e.date)&&e.className.push(Rt),B.addClass([t],e.className),t.setAttribute("data-date",e.date.getTime().toString()),B.isNullOrUndefined(e.groupIndex)&&!this.parent.uiStateValues.isGroupAdaptive||(i=(this.parent.uiStateValues.isGroupAdaptive?this.parent.uiStateValues:e).groupIndex,t.setAttribute("data-group-index",""+i)),this.renderDateHeaderElement(e,t),this.parent.activeViewOptions.cellTemplate&&(i={date:e.date,type:n,groupIndex:e.groupIndex},r=this.parent.element.id+"_"+this.parent.activeViewOptions.cellTemplateName+"cellTemplate",i=[].slice.call(this.parent.getCellTemplate()(i,this.parent,"cellTemplate",r,!1,void 0,void 0,this.parent.root)),B.append(i,t)),{elementType:n,element:t,date:e.date,groupIndex:e.groupIndex});return this.parent.trigger($,r),t},b.prototype.renderDateHeaderElement=function(e,t){var i,n,r;"TimelineMonth"!==this.parent.currentView&&(i=B.createElement("div",{className:Pi}),this.parent.activeViewOptions.cellHeaderTemplate?(r={date:e.date,type:e.type,groupIndex:e.groupIndex},n=this.parent.element.id+"_"+this.parent.activeViewOptions.cellHeaderTemplateName+"cellHeaderTemplate",r=[].slice.call(this.parent.getCellHeaderTemplate()(r,this.parent,"cellHeaderTemplate",n,!1,void 0,void 0,this.parent.root)),B.append(r,i)):(n=!this.parent.calendarUtil.isMonthStart(e.date)||this.isCurrentDate(e.date)||this.parent.isAdaptive?this.parent.globalize.formatDate(e.date,{skeleton:"d",calendar:this.parent.getCalendarMode()}):this.parent.globalize.formatDate(e.date,{format:"MMM d",calendar:this.parent.getCalendarMode()}),i.innerHTML=y(n,"single")),t.appendChild(i),"month"===this.getModuleName())&&(B.addClass([i],Hi),r=this.parent.globalize.formatDate(e.date,{skeleton:"full",calendar:this.parent.getCalendarMode()}),t.setAttribute("aria-label",r))},b.prototype.getMonthStart=function(e){e=Ue("Month"===this.parent.currentView&&!B.isNullOrUndefined(this.parent.activeViewOptions.displayDate)&&!this.parent.uiStateValues.isSwipeScroll&&(this.parent.uiStateValues.isCustomMonth||this.isCustomRange())?this.parent.activeViewOptions.displayDate:this.parent.uiStateValues.isCustomMonth||!this.parent.uiStateValues.isSwipeScroll&&this.isCustomRange()||!this.isCustomMonth()?this.parent.calendarUtil.firstDateOfMonth(e):e,this.parent.activeViewOptions.firstDayOfWeek);return new Date(e.getFullYear(),e.getMonth(),e.getDate())},b.prototype.getMonthEnd=function(e){return this.isCustomMonth()?Y(this.getMonthStart(e),7*(0<this.parent.activeViewOptions.numberOfWeeks?this.parent.activeViewOptions.numberOfWeeks:6)-1):(e=Ke(e,this.parent.activeViewOptions.interval-1),Y(Ue(this.parent.calendarUtil.lastDateOfMonth(e),this.parent.activeViewOptions.firstDayOfWeek),6))},b.prototype.isCustomRange=function(){var e,t,i=this.parent.getCurrentViewDates();return!(!(i&&0<i.length)||(e=z(this.parent.selectedDate).getTime(),t=Ue(i[i.length-1],this.parent.activeViewOptions.firstDayOfWeek),e>=Ue(i[0],this.parent.activeViewOptions.firstDayOfWeek).getTime()&&e<=Y(t,6).getTime()))},b.prototype.getRenderDates=function(e,t){void 0===t&&(t=this.parent.selectedDate);for(var i=[],t=z(t),n=this.getMonthStart(t),r=this.getMonthEnd(t);(this.parent.activeViewOptions.showWeekend||this.isWorkDay(n,e))&&i.push(n),(n=0<(n=Y(n,1)).getHours()?z(n):n).getTime()<=r.getTime(););return e||(this.renderDates=i),this.parent.headerModule&&this.parent.headerModule.previousNextIconHandler(),i},b.prototype.getNextPreviousDate=function(e){var t;return this.isCustomMonth()?(t=this.parent.getCurrentViewDates(),Y(Ue("Next"===e?t[t.length-1]:t[0],this.parent.activeViewOptions.firstDayOfWeek),"Next"===e?7:7*-(0<this.parent.activeViewOptions.numberOfWeeks?this.parent.activeViewOptions.numberOfWeeks:6))):Ke(this.parent.selectedDate,("Next"===e?1:-1)*this.parent.activeViewOptions.interval)},b.prototype.getStartDate=function(){return this.getMonthStart(this.parent.selectedDate)},b.prototype.getEndDate=function(){return this.getMonthEnd(this.parent.selectedDate)},b.prototype.getEndDateFromStartDate=function(e){return Y(new Date(e.getTime()),1)},b.prototype.getDateRangeText=function(e,t){var i,n,r;return void 0===e&&(e=this.parent.selectedDate),void 0===t&&(t=null),this.parent.isAdaptive||B.isNullOrUndefined(this.parent.activeViewOptions.dateFormat)?(n=void(e=!B.isNullOrUndefined(t)&&6<t.length?t[6]:e),i=!1,this.isCustomMonth()&&(i=(r=!B.isNullOrUndefined(t)&&0<t.length?t:this.parent.getCurrentViewDates())[0].getMonth()!==r[r.length-1].getMonth()||r[0].getFullYear()!==r[r.length-1].getFullYear())&&(e=r[0],n=r[r.length-1]),r="Month"!==this.parent.currentView||!this.isCustomMonth(),1<this.parent.activeViewOptions.interval&&r||i?(n=n||Ke(ze(e),this.parent.activeViewOptions.interval-1),e.getFullYear()===n.getFullYear()?y(this.parent.globalize.formatDate(e,{format:"MMMM",calendar:this.parent.getCalendarMode()})+" - "+this.parent.globalize.formatDate(n,{format:"MMMM ",calendar:this.parent.getCalendarMode()})+this.parent.globalize.formatDate(n,{skeleton:"y",calendar:this.parent.getCalendarMode()}),"single"):y(this.parent.globalize.formatDate(e,{format:"MMMM",calendar:this.parent.getCalendarMode()})+" "+e.getFullYear()+" - "+this.parent.globalize.formatDate(n,{format:"MMMM ",calendar:this.parent.getCalendarMode()})+this.parent.globalize.formatDate(n,{skeleton:"y",calendar:this.parent.getCalendarMode()}),"single")):(r=this.parent.activeViewOptions.dateFormat||"MMMM y",y(this.parent.globalize.formatDate(e,{format:r,calendar:this.parent.getCalendarMode()}),"single"))):this.formatDateRange(!B.isNullOrUndefined(t)&&0<t.length?t[0]:this.parent.selectedDate)},b.prototype.getLabelText=function(e){e=e.charAt(0).toLowerCase()+e.substring(1);return this.formatViewLabel(e,this.getStartDate(),this.getEndDate())},b.prototype.createWeekNumberElement=function(e){var t=B.createElement("tr"),e=B.createElement("td",{className:gi,attrs:{title:e?this.parent.localeObj.getConstant("week")+" "+e:""},innerHTML:e||""});return t.appendChild(e),this.parent.trigger($,{elementType:"weekNumberCell",element:e}),t},b.prototype.unWireEvents=function(){var e=this.element.querySelector("."+A);e&&B.EventHandler.remove(e,"scroll",this.onContentScroll)},b.prototype.isCustomMonth=function(){return"Month"===this.parent.currentView&&(!B.isNullOrUndefined(this.parent.activeViewOptions.displayDate)||0<this.parent.activeViewOptions.numberOfWeeks)},b.prototype.getModuleName=function(){return"month"},b.prototype.destroy=function(){!this.parent||this.parent&&this.parent.isDestroyed?this.parent=null:this.element&&(this.monthEvent&&(this.monthEvent.destroy(),this.monthEvent=null),this.unWireEvents(),this.parent.resourceBase&&this.parent.resourceBase.destroy(),this.parent.scheduleTouchModule&&this.parent.scheduleTouchModule.resetValues(),Hl.prototype.destroy.call(this))};var Rl,Hl,Pl=b;function b(e){e=Hl.call(this,e)||this;return e.dayNameFormat="wide",e.viewClass="e-month-view",e.isInverseTableSelect=!1,e.monthEvent=null,e.monthDates={},e}jl=function(e,t){return(jl=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}jl(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(S,Nl=hs),S.prototype.getModuleName=function(){return"year"},S.prototype.renderLayout=function(e){this.parent.resourceBase&&this.parent.resourceBase.generateResourceLevels([{renderDates:this.parent.activeView.renderDates}]),this.setPanel(B.createElement("div",{className:Oi}));var t="Horizontal"===this.parent.activeViewOptions.orientation?"e-horizontal":"e-vertical",t=(B.addClass([this.element],[this.viewClass,t,e]),this.renderPanel(e),this.parent.activeViewOptions.allowVirtualScrolling&&B.addClass([this.element],[Ar]),this.createTableLayout(Ei)),e=(this.element.appendChild(t),this.element.querySelector("table").setAttribute("role","presentation"),t.querySelector("tbody"));this.rowCount=this.getRowColumnCount("row"),this.columnCount=this.getRowColumnCount("column"),this.renderHeader(e),this.renderContent(e),"Year"!==this.parent.currentView&&this.parent.uiStateValues.isGroupAdaptive&&(this.generateColumnLevels(),this.renderResourceMobileLayout()),B.EventHandler.add(this.element.querySelector("."+A),"scroll",this.onContentScroll,this),this.parent.notify(Ve,{})},S.prototype.renderHeader=function(e){},S.prototype.renderContent=function(e){var t=B.createElement("tr"),e=(e.appendChild(t),B.createElement("td")),t=(t.appendChild(e),this.element.querySelector("tbody").appendChild(t),B.createElement("div",{className:A})),e=(e.appendChild(t),this.createTableLayout("e-calendar-table")),t=(t.appendChild(e),B.createElement("tr")),e=(e.querySelector("tbody").appendChild(t),B.createElement("td")),i=(t.appendChild(e),B.createElement("div",{className:"e-calendar-wrapper"}));e.appendChild(i);for(var n=0,r=this.getMonths();n<r.length;n++){var a=r[n],a=new Date(this.parent.selectedDate.getFullYear(),a,1),s=B.createElement("div",{className:"e-month-calendar e-calendar",attrs:{"data-role":"calendar"}});s.appendChild(this.renderCalendarHeader(a)),s.appendChild(this.renderCalendarContent(a)),i.appendChild(s)}this.renderDates.splice(0,1)},S.prototype.renderCalendarHeader=function(e){var t,i=B.createElement("div",{className:"e-header e-month"}),n=B.createElement("div",{className:"e-day e-title"});return this.parent.activeViewOptions.monthHeaderTemplate?(t={date:e,type:"monthHeader"},this.renderTemplates(this.parent.getMonthHeaderTemplate(),t,"monthHeaderTemplate",this.parent.activeViewOptions.monthHeaderTemplateName,n)):n.innerHTML=this.getMonthName(e),i.appendChild(n),this.parent.trigger($,{elementType:"headerCells",element:n,date:e}),i},S.prototype.renderCalendarContent=function(e){var t=this.getMonthDates(e),i=B.createElement("div",{className:"e-content e-month"}),n=this.createTableLayout("e-calendar-table "+C),r=(i.appendChild(n),this.setAriaAttributes(n),B.createElement("thead",{className:"e-week-header"})),a=B.createElement("tr"),s=Ue(We(e),this.parent.activeViewOptions.firstDayOfWeek);this.parent.activeViewOptions.showWeekNumber&&a.appendChild(B.createElement("th"));for(var o=0;o<7;o++){this.parent.activeViewOptions.dayHeaderTemplate?(l=B.createElement("th"),m={date:s,type:"dayHeader"},this.renderTemplates(this.parent.getDayHeaderTemplate(),m,"dayHeaderTemplate",this.parent.activeViewOptions.dayHeaderTemplateName,l),a.appendChild(l)):a.appendChild(B.createElement("th",{innerHTML:this.parent.getDayNames("narrow")[s.getDay()]}));var l=new Date(s.getTime()+W),s=l.getDate()===s.getDate()?Y(l,1):l}r.appendChild(a),B.prepend([r],n);for(var p=n.querySelector("tbody");0<t.length;){var c,h=t.splice(0,7),d=B.createElement("tr");this.parent.activeViewOptions.showWeekNumber&&(c=this.parent.getWeekNumberContent(h),f=B.createElement("td",{className:"e-week-number",attrs:{title:this.parent.localeObj.getConstant("week")+" "+c},innerHTML:c}),d.appendChild(f),this.parent.trigger($,{elementType:"weekNumberCells",element:f}));for(var u=0,g=h;u<g.length;u++){var m,v=g[u],f=B.createElement("td",{className:"e-cell "+O,attrs:{"data-date":v.getTime().toString()}}),y=(this.parent.activeViewOptions.cellHeaderTemplate?(m={date:v,type:"monthCells"},this.renderTemplates(this.parent.getCellHeaderTemplate(),m,"cellHeaderTemplate",this.parent.activeViewOptions.cellHeaderTemplateName,f)):(y=B.createElement("span",{className:"e-day",innerHTML:this.parent.globalize.formatDate(v,{skeleton:"d",calendar:this.parent.getCalendarMode()}),attrs:{title:this.parent.globalize.formatDate(v,{type:"date",skeleton:"full"})}}),f.appendChild(y)),this.parent.activeViewOptions.cellTemplate&&(m={date:v,type:"monthCells"},this.renderTemplates(this.parent.getCellTemplate(),m,"cellTemplate",this.parent.activeViewOptions.cellTemplateName,f)),[]);e.getMonth()!==v.getMonth()&&(y.push(E),f.firstElementChild)&&!this.parent.activeViewOptions.cellTemplate&&f.firstElementChild.setAttribute("aria-disabled","true"),0<(y=this.isCurrentDate(v)&&e.getMonth()===v.getMonth()?y.concat(["e-today","e-selected"]):y).length&&B.addClass([f],y),d.appendChild(f),e.getMonth()===v.getMonth()&&this.renderDates.push(new Date(v)),this.parent.isMinMaxDate(v)?(B.EventHandler.add(f,"click",this.onCellClick,this),this.parent.isAdaptive||B.EventHandler.add(f,"dblclick",this.parent.workCellAction.cellDblClick,this.parent.workCellAction)):B.addClass([f],yr),this.parent.trigger($,{elementType:"workCells",element:f,date:v})}p.appendChild(d)}return i},S.prototype.createTableColGroup=function(e){for(var t=B.createElement("colgroup"),i=0;i<e;i++)t.appendChild(B.createElement("col"));return t},S.prototype.getMonthName=function(e){return y(this.parent.globalize.formatDate(e,{format:this.parent.activeViewOptions.dateFormat||"MMMM y",calendar:this.parent.getCalendarMode()}),"multiple")},S.prototype.generateColumnLevels=function(){var e,t=[],i=this.getDateSlots([this.parent.selectedDate],this.parent.activeViewOptions.workDays);return 0<this.parent.activeViewOptions.group.resources.length?(t=this.parent.resourceBase.generateResourceLevels(i),this.parent.uiStateValues.isGroupAdaptive&&(e=this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex],t=[this.getDateSlots([this.parent.selectedDate],e.workDays)])):t.push(i),t.pop(),this.colLevels=t},S.prototype.getDateSlots=function(e,t,i,n){return void 0===i&&(i=this.parent.workHours.start),void 0===n&&(n=this.parent.workHours.end),[{date:e[0],type:"dateHeader",className:[It],colSpan:1,workDays:t,startHour:new Date(+this.parent.globalize.parseDate(i,{skeleton:"Hm"})),endHour:new Date(+this.parent.globalize.parseDate(n,{skeleton:"Hm"}))}]},S.prototype.getMonthDates=function(e){for(var e=Ue(We(e),this.parent.activeViewOptions.firstDayOfWeek),t=Y(new Date(+e),42),i=[],n=e;n.getTime()<t.getTime();n=Y(n,1))i.push(z(new Date(n)));return i},S.prototype.getRowColumnCount=function(e){for(var t=this.getMonths(),i=this.parent.selectedDate.getFullYear(),n=[],r=0,a=t;r<a.length;r++){var s=a[r];n.push(new Date(i,s,1).getDay()+new Date(i,s+1,0).getDate())}var o=Math.max.apply(Math,n),e="row"===e?"Horizontal"===this.parent.activeViewOptions.orientation?t.length:o:"Horizontal"===this.parent.activeViewOptions.orientation?o:t.length;return e},S.prototype.isCurrentDate=function(e){return z(new Date).getTime()===z(new Date(e.getTime())).getTime()},S.prototype.getMonths=function(){var i=this;return Array.apply(null,{length:this.parent.activeViewOptions.monthsCount}).map(function(e,t){return i.parent.firstMonthOfYear+t})},S.prototype.renderTemplates=function(e,t,i,n,r){n=this.parent.element.id+"_"+n+i,e=[].slice.call(e(t,this.parent,i,n,!1,void 0,void 0,this.parent.root));B.append(e,r)},S.prototype.onCellClick=function(e){var t,i=B.closest(e.target,"."+O),n=this.parent.getDateFromElement(i),r=(this.parent.activeCellsData=this.parent.getCellDetails(i),n.getTime()<this.getStartDate().getTime());r||n.getTime()>this.getEndDate().getTime()?(this.parent.changeDate(this.parent.activeView.getNextPreviousDate(r?"Previous":"Next"),e),t=(t=this.parent.activeCellsData.startTime.getTime())>=this.getStartDate().getTime()&&t<=this.getEndDate().getTime()?t:(r?this.getEndDate():this.getStartDate()).getTime(),r=this.parent.element.querySelector(":not(."+E+')[data-date="'+t+'"]'),this.parent.selectCell(r),this.parent.activeCellsData=this.parent.getCellDetails(r)):(t=Y(new Date(n.getTime()),1),r={date:n,event:this.parent.eventBase.filterEvents(n,t),element:e.target},i.classList.contains(E)&&(i=this.parent.element.querySelector(":not(."+E+')[data-date="'+i.getAttribute("data-date")+'"]')),this.parent.activeCellsData=this.parent.getCellDetails(i),n=B.extend(this.parent.activeCellsData,{cancel:!1,event:e,name:"cellClick"}),this.parent.trigger(q,n),this.parent.quickPopup.moreEventClick(r,t))},S.prototype.onContentScroll=function(e){var t=e.target,i=this.getDatesHeaderElement(),i=(this.parent.notify(Ie,e),i&&(i.firstElementChild.scrollLeft=t.scrollLeft),this.element.querySelector(".e-month-header-wrapper,.e-resource-column-wrap"));i&&(i.scrollTop=t.scrollTop),this.parent.isAdaptive||(this.parent.uiStateValues.top=e.target.scrollTop),this.parent.uiStateValues.left=e.target.scrollLeft,this.setPersistence()},S.prototype.onScrollUiUpdate=function(e){var t=this.parent.element.offsetHeight-this.getHeaderBarHeight(),i=this.element.querySelector("."+At),n=(i&&(t-=i.offsetHeight),this.element.querySelector("."+A)),r=(n&&(n.style.height=B.formatUnit(t)),!this.parent.isAdaptive&&i&&(r=rt(),0<n.offsetWidth-n.clientWidth?(i.firstElementChild.style[e.cssProperties.border]=0<r?"1px":"0px",i.style[e.cssProperties.padding]=0<r?r-1+"px":"0px"):(i.firstElementChild.style[e.cssProperties.border]="",i.style[e.cssProperties.padding]="")),this.setColWidth(this.getContentAreaElement()),this.element.querySelector(".e-month-header-wrapper,.e-resource-column-wrap"));r&&(i=n.scrollWidth>n.clientWidth,r.style.height=B.formatUnit(t-(i?17:0))),e.isPreventScrollUpdate||(this.parent.uiStateValues.isInitial?(this.parent.uiStateValues.isInitial=!1,this.parent.uiStateValues.top=this.parent.uiStateValues.left=0):(r&&(r.scrollTop=this.parent.uiStateValues.top),n.scrollTop=this.parent.uiStateValues.top,n.scrollLeft=this.parent.uiStateValues.left)),this.retainScrollPosition()},S.prototype.getStartDate=function(){return new Date(this.parent.selectedDate.getFullYear(),this.parent.firstMonthOfYear%12,1)},S.prototype.getEndDate=function(){return Y(Ke(this.getStartDate(),this.parent.monthsCount),-1)},S.prototype.startDate=function(){return"Year"===this.parent.currentView?Ue(this.getStartDate(),this.parent.activeViewOptions.firstDayOfWeek):this.getStartDate()},S.prototype.endDate=function(){return"Year"===this.parent.currentView?Y(Be(this.getEndDate(),this.parent.activeViewOptions.firstDayOfWeek),1):Y(this.getEndDate(),1)},S.prototype.getEndDateFromStartDate=function(e){e=new Date(e.getTime());return 0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive&&(e=ze(e)),Y(new Date(e.getTime()),1)},S.prototype.getNextPreviousDate=function(e){return Ze(this.parent.selectedDate,"Next"===e?1:-1)},S.prototype.getDateRangeText=function(e,t){void 0===e&&(e=this.parent.selectedDate);var i=!B.isNullOrUndefined(t=void 0===t?null:t)&&0<t.length,n=i?t[0]:this.getStartDate(),r=i?t[t.length-1]:this.getEndDate();return n.getFullYear()!==r.getFullYear()?this.parent.globalize.formatDate(n,{format:"MMM y",calendar:this.parent.getCalendarMode()})+" - "+this.parent.globalize.formatDate(r,{format:"MMM y",calendar:this.parent.getCalendarMode()}):this.parent.globalize.formatDate(i?t[0]:e,{skeleton:"y",calendar:this.parent.getCalendarMode()})},S.prototype.addEventListener=function(){this.parent.on(Me,this.onScrollUiUpdate,this),this.parent.on(Ee,this.onDataReady,this)},S.prototype.removeEventListener=function(){this.parent&&(this.parent.off(Me,this.onScrollUiUpdate),this.parent.off(Ee,this.onDataReady))},S.prototype.onDataReady=function(e){this.yearEventModule=new ml(this.parent),this.yearEventModule.renderAppointments(),this.parent.notify(xe,e)},S.prototype.scrollToDate=function(e){e=+new Date(z(e)),e=this.element.querySelector("."+O+":not(."+E+')[data-date="'+e+'"]');e&&(e=B.closest(e,".e-month-calendar"),this.getContentAreaElement().scrollTop=e.offsetTop)},S.prototype.destroy=function(){var e;!this.parent||this.parent&&this.parent.isDestroyed?this.parent=null:this.element&&((e=this.element.querySelector("."+A))&&B.EventHandler.remove(e,"scroll",this.onContentScroll),this.yearEventModule&&(this.yearEventModule.destroy(),this.yearEventModule=null),this.parent.resourceBase&&this.parent.resourceBase.destroy(),Nl.prototype.destroy.call(this))};var jl,Nl,Ll=S;function S(e){e=Nl.call(this,e)||this;return e.viewClass="e-year-view",e.isInverseTableSelect=!1,e.yearEventModule=null,e}ql=function(e,t){return(ql=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}ql(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Bl,Fl=hs),Bl.prototype.createAgendaContentElement=function(e,a,t,s,o){var i,l=this,p=this.parent.eventFields;return"noEvents"===e?(e=[{subject:this.parent.localeObj.getConstant("noEvents")}],0===(i=N.ListBase.createList(this.parent.createElement,e,{moduleName:"agenda",listClass:this.parent.activeView.viewClass,itemClass:this.parent.activeView.viewClass,template:B.initializeCSPTemplate(function(){return'<div class="'+Li+'">'+l.parent.localeObj.getConstant("noEvents")+"</div>"})})).querySelector(".e-agenda-item").children.length&&i.firstElementChild.appendChild(B.createElement("div",{className:Li,innerHTML:this.parent.localeObj.getConstant("noEvents")}))):(i=N.ListBase.createList(this.parent.createElement,a,{moduleName:"agenda",listClass:this.parent.activeView.viewClass,itemClass:this.parent.activeView.viewClass}),[].slice.call(i.children).forEach(function(t,e){var i,n=B.createElement("div",{className:V,attrs:{"data-id":"Appointment_"+a[parseInt(e.toString(),10)][""+l.parent.eventFields.id],"data-guid":a[parseInt(e.toString(),10)].Guid,role:"button",tabindex:"0","aria-disabled":l.parent.eventBase.getReadonlyAttribute(a[parseInt(e.toString(),10)]),"aria-label":l.parent.getAnnouncementString(a[parseInt(e.toString(),10)])}}),r=(B.isNullOrUndefined(o)||n.setAttribute("data-group-index",o.toString()),l.parent.eventBase.applyResourceColor(n,a[parseInt(e.toString(),10)],"borderColor",s),B.isNullOrUndefined(l.parent.activeViewOptions.eventTemplate)?i=l.createAppointment(a[parseInt(e.toString(),10)]):(B.addClass([n],"e-template"),r=l.parent.element.id+"_"+l.parent.activeViewOptions.eventTemplateName+"eventTemplate",i=l.parent.getAppointmentTemplate()(a[parseInt(e.toString(),10)],l.parent,"eventTemplate",r,!1,void 0,void 0,l.parent.root),B.isNullOrUndefined(a[parseInt(e.toString(),10)][p.recurrenceRule])||(r=a[parseInt(e.toString(),10)][p.id]===a[parseInt(e.toString(),10)][p.recurrenceID]?en:tn,n.appendChild(B.createElement("div",{className:Dt+" "+r})))),B.append([].slice.call(i),n),lt(t),t.appendChild(n),{data:B.extend({},a[parseInt(e.toString(),10)],null,!0),element:t,cancel:!1});l.parent.trigger(ie,r,function(e){e.cancel&&B.remove(t)})})),t.appendChild(i),("MonthAgenda"===this.parent.currentView&&0<this.parent.activeViewOptions.group.resources.length||"Agenda"===this.parent.currentView)&&B.addClass([t],ji),this.parent.renderTemplates(),t},Bl.prototype.createAppointment=function(e){var t=this.parent.eventFields,i=e[t.subject]||this.parent.eventSettings.fields.subject.default||this.parent.localeObj.getConstant("addTitle"),n=e[t.location]||this.parent.eventSettings.fields.location.default,r=B.createElement("div",{className:bi}),a=(B.isNullOrUndefined(n)||""===n||(i+=","),B.createElement("div",{className:Gn})),n=(this.parent.sanitize(i,a),r.appendChild(a),B.isNullOrUndefined(n)||""===n||(i=B.createElement("div",{className:Xn}),this.parent.sanitize(n,i),r.appendChild(i)),B.isNullOrUndefined(e[t.recurrenceRule])||(a=e[t.id]===e[t.recurrenceID]?en:tn,r.appendChild(B.createElement("div",{className:Dt+" "+a}))),e[t.startTime]),i=e[t.endTime],a=e[t.isAllDay],t=this.parent.localeObj.getConstant("allDay"),s=this.parent.getTimeString(n)+" - "+this.parent.getTimeString(i),i=(B.isNullOrUndefined(e.data)||(t=(1<=(i.getTimezoneOffset()!==n.getTimezoneOffset()?i.getTime()-n.getTime()+36e5:i.getTime()-n.getTime())/W?t:s)+" ("+this.parent.localeObj.getConstant("day")+" "+e.data.index+"/"+e.data.count+")"),!B.isNullOrUndefined(e.data)||a?t:s);return[r,B.createElement("div",{className:Ni,innerHTML:i})]},Bl.prototype.processAgendaEvents=function(e){var t=[];if(!B.isNullOrUndefined(e))for(var i=0,n=e;i<n.length;i++)var r=n[i],a=this.parent.eventBase.splitEventByDay(r),t=t.concat(1<a.length?a:r);return t},Bl.prototype.wireEventActions=function(){for(var e=0,t=[].slice.call(this.parent.element.querySelectorAll("."+V));e<t.length;e++){var i=t[e];this.parent.eventBase.wireAppointmentEvents(i,this.parent.getEventDetails(i),!0)}for(var n=0,r=[].slice.call(this.parent.element.querySelectorAll(".e-m-date"));n<r.length;n++){i=r[n];B.EventHandler.add(i,"click",this.parent.agendaModule.dayNavigationClick,this)}},Bl.prototype.calculateResourceTableElement=function(e,t,i,n){void 0===n&&(n=null),B.isNullOrUndefined(this.parent.resourceBase.lastResourceLevel)&&(l=this.getDateSlots(this.renderDates,this.parent.activeViewOptions.workDays),this.parent.resourceBase.generateResourceLevels(l));for(var r=Y(new Date(i.getTime()),t),a=this.parent.activeViewOptions.group.byDate||"MonthAgenda"===this.parent.currentView?t:1,s=this.parent.resourceBase.resourceCollection,o=this.parent.resourceBase.lastResourceLevel,l=i,p=i,c=this.parent.activeViewOptions.showWeekend,h=0;h<a;h++){var d,u=[],g=[],m=0,v=Y(p,h);if("Agenda"===this.parent.currentView&&this.parent.activeViewOptions.group.byDate&&this.parent.activeViewOptions.allowVirtualScrolling&&!c&&!this.isWorkDay(v)){do{if(n<=(v=Y(v,1)))break}while(!this.isWorkDay(v)||this.parent.eventBase.filterEvents(v,Y(v,1)).length<1);if(n<=v)break;p=Y(v,-h),r=Y(v,1)}var f=this.parent.activeViewOptions.group.byDate||"MonthAgenda"===this.parent.currentView?Y(v,1):r,y=this.parent.eventBase.filterEvents(v,f);if(0<y.length||!this.parent.hideEmptyAgendaDays||"MonthAgenda"===this.parent.currentView){for(var T=0;T<o.length;T++){t=this.parent.activeViewOptions.group.byDate&&"MonthAgenda"!==this.parent.currentView?1:t;var w=[],D=(i=v,this.parent.eventBase.filterEvents(i,r,y,o[parseInt(T.toString(),10)]));if(0<D.length||!this.parent.hideEmptyAgendaDays||"MonthAgenda"===this.parent.currentView)for(var b=0;b<t;b++){var S=this.parent.eventBase.filterEvents(i,Y(i,1),D,void 0);if(((c||!c&&(this.parent.group.byDate?this.isWorkDay(i):this.isWorkDay(i,o[parseInt(T.toString(),10)].workDays)))&&(0<S.length||!this.parent.hideEmptyAgendaDays)||"MonthAgenda"===this.parent.currentView)&&(w.push(S[0]),S={rowSpan:1,type:"eventColumn",resource:s[s.length-1],groupIndex:o[parseInt(T.toString(),10)].groupIndex,groupOrder:o[parseInt(T.toString(),10)].groupOrder,resourceData:o[parseInt(T.toString(),10)].resourceData,eventData:S,date:i},d={rowSpan:1,type:"dateColumn",resource:s[parseInt((s.length-1).toString(),10)],groupOrder:o[parseInt(T.toString(),10)].groupOrder,resourceData:o[parseInt(T.toString(),10)].resourceData,date:i,groupIndex:o[parseInt(T.toString(),10)].groupIndex},u[parseInt(m.toString(),10)]||(u[parseInt(m.toString(),10)]=[]),u[parseInt(m.toString(),10)].push(S),u[parseInt(m.toString(),10)].push(d),m++),(i=Y(i,1)).getTime()>=r.getTime()||this.parent.activeViewOptions.group.byDate||"MonthAgenda"===this.parent.currentView){0<w.length&&(u[u.length-1][1].cssClass=ji,S={rowSpan:w.length,type:"resourceColumn",resource:s[parseInt((s.length-1).toString(),10)],groupOrder:o[parseInt(T.toString(),10)].groupOrder.slice(0,-1),resourceData:o[parseInt(T.toString(),10)].resourceData,groupIndex:u.length-w.length,className:[Si],date:i},u[parseInt((u.length-w.length).toString(),10)].push(S),g.push(B.extend({},S,null,!0)));break}}}for(var C=s.slice(0,-1),O=[],E=0,x=0;x<C.length;x++)for(var w=C[C.length-(x+1)].dataSource,V=0;V<w.length;V++)for(var A=0,I=0;I<g.length;I++)g[parseInt(I.toString(),10)].groupOrder[C.length-(x+1)]===w[parseInt(V.toString(),10)][C[C.length-(x+1)].idField]&&(E+=g[parseInt(I.toString(),10)].rowSpan,O.push(B.extend({},g[parseInt(I.toString(),10)],null,!0))),++A===g.length&&0<O.length&&(O[0].rowSpan=E,O[0].type="parentColumnLevel_"+(x+1),O[0].resource=C[C.length-(x+1)],O[0].resourceData=w[parseInt(V.toString(),10)],O[0].date=i,u[O[0].groupIndex].push(O[0]),O=[],E=0);this.createResourceTableRow(u,e)}}0===this.parent.eventBase.filterEvents(l,r).length&&!this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.hideEmptyAgendaDays&&this.renderEmptyContent(e,l)},Bl.prototype.createResourceTableRow=function(e,t){var i,n=B.createElement("tr"),r=B.createElement("td"),a=0;if(this.parent.activeViewOptions.group.byDate||"MonthAgenda"===this.parent.currentView){for(var s=[],o=this.parent.resourceBase.resourceCollection.slice(0,-1),l=0;l<e.length;l++)s=s.concat(e[parseInt(l.toString(),10)]);for(var p=0<o.length?"parentColumnLevel_"+o.length:"resourceColumn",c=s.filter(function(e){return e.type===p}),h=0;h<c.length;h++)a+=c[parseInt(h.toString(),10)].rowSpan}for(var d=0;d<e.length;d++){for(var u=n.cloneNode(),g=e[parseInt(d.toString(),10)].length-1;0<=g;g--){var m=e[parseInt(d.toString(),10)][parseInt(g.toString(),10)],v=r.cloneNode();if("dateColumn"===m.type)this.parent.activeViewOptions.group.byDate||"MonthAgenda"===this.parent.currentView?i=e[parseInt(d.toString(),10)][parseInt(g.toString(),10)]:(v.setAttribute("data-date",m.date.getTime().toString()),v.appendChild(this.createDateHeaderElement(m.date,m.groupIndex)),f=[Vi,Ri],m.cssClass&&f.push(m.cssClass),B.addClass([v],f),this.isCurrentDate(new Date(m.date.getTime()))&&B.addClass(v.childNodes,Ai),u.appendChild(v));else if("eventColumn"===m.type){for(var f=0===m.eventData.length?"noEvents":"data",y=0;y<u.childNodes.length;y++){var T=u.childNodes.item(y),w=T.classList.contains("e-resource-column")?Te:we;this.parent.trigger($,{elementType:w,element:T,date:m.date,groupIndex:m.groupIndex})}(v=this.createAgendaContentElement(f,m.eventData,v,m.groupOrder,m.groupIndex)).setAttribute("data-date",m.date.getTime().toString()),!this.parent.activeViewOptions.group.byDate&&"MonthAgenda"!==this.parent.currentView||B.addClass([v],[Vi,"e-day-padding"]),u.appendChild(v);var D=0===m.eventData.length?fe:ye;this.parent.trigger($,{elementType:D,element:v,date:m.date,groupIndex:m.groupIndex})}else v.setAttribute("rowspan",m.rowSpan.toString()),B.addClass([v],"e-resource-column"),this.setResourceHeaderContent(v,m,m.className[0]),u.appendChild(v)}if(this.parent.activeViewOptions.group.byDate&&0===d&&"MonthAgenda"!==this.parent.currentView){(v=r.cloneNode()).setAttribute("data-date",i.date.getTime().toString()),v.setAttribute("rowspan",a.toString()),v.appendChild(this.createDateHeaderElement(i.date)),B.addClass([v],[Vi,Ri,"e-date-border"]);var b=et(this.parent.selectedDate.getTime(),i.date.getTime());if(u.setAttribute("data-row-index",b.toString()),this.parent.element.querySelector('.e-agenda-view tr[data-row-index="'+b+'"]'))break;u.insertBefore(v,u.childNodes[0])}t.appendChild(u)}},Bl.prototype.createDateHeaderElement=function(e,t){var i,n;return this.parent.activeViewOptions.dateHeaderTemplate?(i=B.createElement("div",{className:ki}),t={date:e,type:"dateHeader",groupIndex:t},n=this.parent.element.id+"_"+this.parent.activeViewOptions.dateHeaderTemplateName+"dateHeaderTemplate",t=[].slice.call(this.parent.getDateHeaderTemplate()(t,this.parent,"dateHeaderTemplate",n,!1,void 0,void 0,this.parent.root)),B.append(t,i)):i=this.getMobileDateElement(e,ki),i},Bl.prototype.renderEmptyContent=function(e,t,i){var n=this.createTableRowElement(t,"noEvents"),r=n.children[0],a=B.createElement("div",{className:"e-empty-event",innerHTML:this.parent.localeObj.getConstant("noEvents")});r.appendChild(a),e.appendChild(n),i&&this.parent.trigger($,{elementType:fe,element:r,date:t})},Bl.prototype.createTableRowElement=function(e,t){var i=et(this.parent.selectedDate.getTime(),e.getTime()),n=B.createElement("tr",{attrs:{"data-row-index":i.toString()}}),i=B.createElement("td",{attrs:{class:"monthHeader"===t?Mi:Vi,"aria-selected":"false","data-column-index":i.toString(),"data-date":e.getTime().toString()}}),e=i.cloneNode(),i=i.cloneNode();return n.appendChild(e),"noEvents"!==t&&n.appendChild(i),n},Bl.prototype.destroy=function(){Fl.prototype.destroy.call(this)};var ql,Fl,Ul=Bl;function Bl(e){return Fl.call(this,e)||this}Wl=function(e,t){return(Wl=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}Wl(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(I,zl=Ul),I.prototype.getModuleName=function(){return"agenda"},I.prototype.renderLayout=function(){this.agendaDates={},this.element=B.createElement("div",{className:Oi}),B.addClass([this.element],this.viewClass),this.element.appendChild(this.createTableLayout(Ei)),this.element.querySelector("table").setAttribute("role","presentation"),this.parent.element.querySelector("."+St).appendChild(this.element);var e=B.createElement("tr"),t=(this.element.querySelector("tbody").appendChild(e),B.createElement("td")),e=(e.appendChild(t),B.createElement("div",{className:A})),t=(t.appendChild(e),this.createTableLayout(C)),e=(this.setAriaAttributes(t),e.appendChild(t),t.querySelector("tbody")),t=z(this.parent.selectedDate);this.renderEmptyContent(e,t),this.wireEvents(),this.parent.resourceBase&&this.parent.resourceBase.generateResourceLevels([{renderDates:this.parent.activeView.renderDates}]),this.parent.uiStateValues.isGroupAdaptive&&!this.parent.element.querySelector("."+pi)&&this.renderResourceMobileLayout(),this.parent.notify(Ve,{})},I.prototype.eventLoad=function(e){this.dataSource=B.extend([],this.parent.eventsData,null,!0);for(var t=0,i=this.parent.eventsData;t<i.length;t++)delete i[t].generatedDates;var e=this.parent.activeViewOptions.allowVirtualScrolling?e.processedData:this.parent.eventsProcessed,n=(this.parent.uiStateValues.isGroupAdaptive&&(n=this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex],this.dataSource=this.parent.eventBase.filterEventsByResource(n,this.dataSource),e=this.parent.eventBase.filterEventsByResource(n,e)),this.parent.eventsProcessed=this.processAgendaEvents(e),z(this.parent.selectedDate)),e=this.element.querySelector("."+C+" tbody"),r=B.closest(e,"."+A),a=r.scrollTop;lt(e),this.renderInitialContent(e,n),this.wireEventActions(),r.scrollTop=a,this.parent.notify(xe,{}),this.parent.activeViewOptions.allowVirtualScrolling||this.retainScrollPosition()},I.prototype.refreshEvent=function(e){for(var t=[],i=this.parent.eventFields,n=0,r=this.dataSource;n<r.length;n++){var a=r[n];B.isNullOrUndefined(a[i.recurrenceID])&&!B.isNullOrUndefined(a[i.recurrenceRule])&&!B.isNullOrUndefined(a.generatedDates)&&e>=a.generatedDates.end&&(t=t.concat(this.parent.eventBase.generateOccurrence(a,e)))}this.parent.eventsProcessed=this.parent.eventsProcessed.concat(this.processAgendaEvents(t))},I.prototype.refreshHeader=function(){var e=this.element.querySelector("."+C+" tbody"),t=(this.parent.activeViewOptions.group.byDate?lt(e):B.remove(e.firstElementChild),z(this.parent.selectedDate)),i=B.createElement("tbody"),t=new Date(t.getTime()),n=this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.hideEmptyAgendaDays?this.getEndDateFromStartDate(t):Y(t,this.parent.agendaDaysCount);this.renderContent(i,t,n),B.append([].slice.call(i.childNodes),e)},I.prototype.renderInitialContent=function(e,t){var i=B.createElement("tbody"),n=new Date(t.getTime()),r=this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.hideEmptyAgendaDays?this.getEndDateFromStartDate(n):Y(n,this.parent.agendaDaysCount);if(this.renderContent(i,n,r),B.append([].slice.call(i.childNodes),e),this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.hideEmptyAgendaDays&&0<this.parent.eventsData.length)for(var a=this.getContentAreaElement(),s=a.querySelector(".e-content-table");a.offsetWidth<=a.clientWidth&&!(this.parent.isAdaptive&&s.offsetHeight>=a.clientHeight);){var o=B.createElement("tbody"),n=Y(r=n,-this.parent.agendaDaysCount);if(this.renderContent(o,n,r),B.prepend([].slice.call(o.childNodes),e),n<=this.parent.minDate)break}e.childNodes.length<=0&&this.renderEmptyContent(e,t,!0)},I.prototype.renderContent=function(e,t,i){var n,r=this.parent.eventFields,a=new Date(t.getTime()),s=this.appointmentFiltering(a,i);if(0<s.length&&this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.hideEmptyAgendaDays)if(this.parent.activeViewOptions.showWeekend||this.isAgendaWorkDay(s[0][r.startTime]))t=new Date(new Date(s[0][r.startTime].getTime()).setHours(0,0,0,0)),this.updateHeaderText(s[0][r.startTime]);else for(var o=0,l=s;o<l.length;o++){var p=l[o];if(this.isAgendaWorkDay(p[r.startTime])){t=new Date(new Date(p[r.startTime].getTime()).setHours(0,0,0,0)),this.updateHeaderText(p[r.startTime]);break}}if(!this.parent.hideEmptyAgendaDays||0<this.parent.agendaDaysCount&&0<s.length){if(0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive){s=t;this.parent.activeViewOptions.group.byDate||(this.parent.activeViewOptions.allowVirtualScrolling=!1,s=a,this.parent.headerModule&&(this.parent.headerModule.updateDateRange(),this.parent.headerModule.updateHeaderItems("remove"))),this.calculateResourceTableElement(e,this.parent.agendaDaysCount,s,i)}else for(var c=0;c<this.parent.agendaDaysCount;c++){var h=this.createTableRowElement(t,"data"),d=this.element.querySelector('tr[data-row-index="'+ +h.dataset.rowIndex+'"]');if(d||!this.parent.activeViewOptions.showWeekend&&!this.isAgendaWorkDay(t)){if(t=Y(t,1),!d&&this.parent.activeViewOptions.allowVirtualScrolling&&c--,t.getTime()>i.getTime())break}else{var u,d=h.children[0],g=h.children[1],m=this.appointmentFiltering(t);if(0<m.length||!this.parent.hideEmptyAgendaDays&&0===m.length?(u=this.parent.hideEmptyAgendaDays||0!==m.length?"data":"noEvents",d.appendChild(this.createDateHeaderElement(t)),h.appendChild(d),this.parent.trigger($,{elementType:we,element:d,date:t}),u=this.createAgendaContentElement(u,m,g),h.appendChild(u),0<u.querySelectorAll("li").length&&e.appendChild(h),g=this.parent.hideEmptyAgendaDays||0!==m.length?ye:fe,this.parent.trigger($,{elementType:g,element:u,date:t})):this.parent.activeViewOptions.allowVirtualScrolling&&c--,this.isCurrentDate(new Date(t.getTime()))&&B.addClass(d.childNodes,Ai),(t=Y(t,1)).getTime()>i.getTime())break}}n=new Date(t.getTime()-W)}this.agendaDates={start:a,end:n}},I.prototype.isAgendaWorkDay=function(e){return this.parent.uiStateValues.isGroupAdaptive&&!this.parent.group.byDate?this.isWorkDay(e,this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex].workDays):this.isWorkDay(e)},I.prototype.agendaScrolling=function(e){this.parent.quickPopup&&this.parent.quickPopup.quickPopupHide(),this.parent.activeViewOptions.allowVirtualScrolling&&this.virtualScrolling(e),this.parent.activeViewOptions.allowVirtualScrolling||this.setPersistence()},I.prototype.virtualScrolling=function(e){var t,i=e.target,n=i.scrollTop,r=i.scrollHeight,a=n+i.clientHeight,s=this.virtualScrollTop<n?"next":"previous",o=i.querySelector("tbody"),l=B.createElement("tbody"),p=this.getElementFromScrollerPosition(e),e=this.parent.getDateFromElement(p);if(0===n){if(t=this.getPreviousNextDate(Y(e,-1),s),0<this.appointmentFiltering(t.start,t.end).length||!this.parent.hideEmptyAgendaDays){this.renderContent(l,t.start,t.end),B.prepend([].slice.call(l.childNodes),o),this.wireEventActions();for(var c=0,h=o.children;c<h.length;c++)if(h[parseInt(c.toString(),10)].getAttribute("data-row-index")===p.getAttribute("data-column-index")){var d=h[parseInt(c.toString(),10)].offsetTop-this.element.querySelector(".e-agenda-item").offsetHeight;i.scrollTop=d;break}this.updateHeaderText(e)}}else r-5<=a?(t=this.getPreviousNextDate(Y(e,1),s),(0<this.appointmentFiltering(t.start,t.end).length||!this.parent.hideEmptyAgendaDays)&&(this.renderContent(l,t.start,t.end),B.append([].slice.call(l.childNodes),o),this.wireEventActions(),this.updateHeaderText(e))):this.updateHeaderText(e);this.virtualScrollTop=n;r=this.parent.eventBase.getSelectedAppointments();0<r.length&&r[r.length-1].focus()},I.prototype.getElementFromScrollerPosition=function(e){var t,i,e=e.target,n=e.scrollTop,r=e.scrollHeight,a=n+e.clientHeight,s=[].slice.call(e.querySelectorAll(".e-agenda-item"));if(0<s.length)if(0===n)i=s[0],t=B.closest(i,"."+Vi);else if(a===r)i=s[s.length-1],t=B.closest(i,"."+Vi);else for(var o=0,l=s.length;o<l;o++)if(0<=(i=s[parseInt(o.toString(),10)]).getBoundingClientRect().top){t=B.closest(i,"."+Vi);break}return t},I.prototype.updateHeaderText=function(e){this.parent.showHeaderBar&&this.parent.headerModule.updateDateRange(e)},I.prototype.getPreviousNextDate=function(e,t){var i=new Date(e.getTime()),n=this.getStartDateFromEndDate(e),r=this.getEndDateFromStartDate(e),a=0;do{}while(((this.parent.activeViewOptions.showWeekend||!this.parent.activeViewOptions.showWeekend&&this.isAgendaWorkDay(i))&&(0<this.appointmentFiltering(i).length||!this.parent.hideEmptyAgendaDays)&&a++,!((i=Y(i,"next"===t?1:-1))<n||r<i))&&a!==this.parent.agendaDaysCount);var s=Y(i,"next"===t?-1:1);return"next"===t?{start:e,end:Y(s,1)}:{start:s,end:Y(e,1)}},I.prototype.appointmentFiltering=function(e,t){var i,n,r=this,t=!B.isNullOrUndefined(e)&&B.isNullOrUndefined(t)?(i=z(new Date(e.getTime())),Ge(new Date(i.getTime()),W)):(i=new Date(e.getTime()),new Date(t.getTime())),a=this.parent.eventBase.filterEvents(i,t);return 0===a.length&&(this.refreshEvent(e),a=this.parent.eventBase.filterEvents(i,t)),B.isNullOrUndefined(this.parent.minDate)&&B.isNullOrUndefined(this.parent.maxDate)||(n=this.parent.eventFields,a=a.filter(function(e){var t=e[n.startTime],e=e[n.endTime];return!(t.getTime()<r.parent.minDate.getTime()||e.getTime()>Y(r.parent.maxDate,1).getTime())})),a},I.prototype.getStartDateFromEndDate=function(e){var t,i=this.parent.eventFields;return z(0<this.parent.eventsProcessed.length?(t=Math.min.apply(Math,this.parent.eventsProcessed.map(function(e){return e[i.startTime].getTime()})),this.parent.hideEmptyAgendaDays?new Date(t):this.parent.minDate):this.parent.hideEmptyAgendaDays?Ke(e,-1):this.parent.minDate)},I.prototype.getEndDateFromStartDate=function(e){var t,i=this.parent.eventFields;return z(Y(0<this.parent.eventsProcessed.length?(t=Math.max.apply(Math,this.parent.eventsProcessed.map(function(e){return e[i.endTime].getTime()})),this.parent.hideEmptyAgendaDays?new Date(t):this.parent.maxDate):this.parent.hideEmptyAgendaDays?Ke(e,1):this.parent.maxDate,1))},I.prototype.getNextPreviousDate=function(e){return Y(this.parent.selectedDate,"Next"===e?1:-1)},I.prototype.startDate=function(){return z(this.parent.selectedDate)},I.prototype.endDate=function(){return this.parent.activeViewOptions.allowVirtualScrolling?this.getEndDateFromStartDate(this.startDate()):Y(this.startDate(),this.parent.agendaDaysCount)},I.prototype.getDateRangeText=function(e){var t=this.parent.activeViewOptions.dateFormat||"MMMM y";return this.parent.activeViewOptions.allowVirtualScrolling||this.parent.isAdaptive?(e=B.isNullOrUndefined(e)?this.parent.selectedDate:e,y(this.parent.globalize.formatDate(e,{format:t,calendar:this.parent.getCalendarMode()}),"multiple")):(t=Y(e=this.parent.selectedDate,this.parent.agendaDaysCount-1),this.formatDateRange(e,t))},I.prototype.dayNavigationClick=function(e){var t=B.closest(e.currentTarget,"."+Vi),t=this.parent.getDateFromElement(t);B.isNullOrUndefined(t)||this.parent.isAdaptive||!this.parent.isMinMaxDate(t)||(this.parent.setProperties({selectedDate:t},!0),this.parent.changeView("Day",e))},I.prototype.wireEvents=function(){B.EventHandler.add(this.element.querySelector("."+A),Ae,this.agendaScrolling,this)},I.prototype.unWireEvents=function(){B.EventHandler.remove(this.element.querySelector("."+A),Ae,this.agendaScrolling);for(var e=0,t=[].slice.call(this.element.querySelectorAll(".e-m-date"));e<t.length;e++){var i=t[e];B.EventHandler.remove(i,"click",this.dayNavigationClick)}},I.prototype.addEventListener=function(){this.parent.on(Me,this.onAgendaScrollUiUpdate,this),this.parent.on(Ee,this.eventLoad,this)},I.prototype.removeEventListener=function(){this.parent&&(this.parent.off(Me,this.onAgendaScrollUiUpdate),this.parent.off(Ee,this.eventLoad))},I.prototype.onAgendaScrollUiUpdate=function(){var e=this.getHeaderBarHeight(),t=(this.parent.headerModule&&(this.parent.activeViewOptions.allowVirtualScrolling?this.parent.headerModule.updateHeaderItems("add"):this.parent.headerModule.updateHeaderItems("remove")),this.element.querySelector("."+A));"auto"!==this.parent.height&&(t.style.height=B.formatUnit(this.parent.element.offsetHeight-e))},I.prototype.scrollToDate=function(e){var e=new Date(+z(e));this.parent.activeViewOptions.allowVirtualScrolling?(!this.parent.hideEmptyAgendaDays||0<this.parent.getEvents(e,Y(e,1),!0).length)&&this.parent.changeDate(e):(e=this.element.querySelector("."+Vi+'[data-date="'+e.getTime()+'"]'))&&(this.getContentAreaElement().scrollTop=e.offsetTop)},I.prototype.destroy=function(){!this.parent||this.parent&&this.parent.isDestroyed?this.parent=null:this.element&&(this.unWireEvents(),this.parent.resourceBase&&this.parent.resourceBase.destroy(),this.parent.headerModule&&this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.headerModule.updateHeaderItems("remove"),zl.prototype.destroy.call(this))};var Wl,zl,Yl=I;function I(e){e=zl.call(this,e)||this;return e.viewClass="e-agenda-view",e.isInverseTableSelect=!1,e.agendaDates={},e.virtualScrollTop=1,e}_l=function(e,t){return(_l=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}_l(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Ql,Gl=Pl),Ql.prototype.getModuleName=function(){return"monthAgenda"},Ql.prototype.renderAppointmentContainer=function(){var e=this.getContentAreaElement(),t=B.createElement("div",{className:vi}),e=(e.appendChild(t),B.createElement("div",{className:mi}));t.appendChild(e),this.appendAppContainer(e),this.setEventWrapperHeight()},Ql.prototype.getDayNameFormat=function(){return this.parent.isAdaptive?"narrow":"abbreviated"},Ql.prototype.updateSelectedCellClass=function(e){z(e.date).getTime()===z(new Date(""+this.parent.selectedDate)).getTime()&&e.className.push(di)},Ql.prototype.setEventWrapperHeight=function(){var e=(this.parent.headerModule?this.parent.headerModule.getHeaderElement().offsetHeight:0)+2,t=this.parent.element.querySelector("."+hi),t=(t&&(e+=t.offsetHeight),this.getContentAreaElement().firstElementChild),i=this.element.querySelector("."+Vt),e=this.parent.element.offsetHeight-e-i.offsetHeight,i=1<this.parent.activeViewOptions.interval?Math.round(.8*e):t.offsetHeight,e=e-i,n=this.element.querySelector("."+vi),r=this.element.querySelector("."+mi);"auto"!==this.parent.height&&(1<this.parent.activeViewOptions.interval&&(t.style.height=B.formatUnit(i),B.EventHandler.add(t,"scroll",this.onContentScroll,this)),n.style.height=r.style.height=B.formatUnit(e))},Ql.prototype.onDataReady=function(e){this.setEventWrapperHeight(),this.clearElements();for(var t,e=e.processedData,i=(this.parent.uiStateValues.isGroupAdaptive&&(t=this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex],e=this.parent.eventBase.filterEventsByResource(t,e)),this.agendaBase=this.getAgendaBase(),this.parent.eventsProcessed=this.agendaBase.processAgendaEvents(e),0),n=0,r=this.renderDates;n<r.length;n++){var a=r[n],s=this.appointmentFiltering(a),o=this.element.querySelectorAll("."+O)[parseInt(i.toString(),10)];0<s.length&&(o.querySelector("."+qi)||o.appendChild(B.createElement("div",{className:qi})),a.getTime()===z(new Date(this.monthAgendaDate.getTime())).getTime())&&this.onEventRender(s,a),i++}this.parent.notify(xe,{})},Ql.prototype.onCellClick=function(e){this.parent.quickPopup&&this.parent.quickPopup.quickPopupHide();var t=this.appointmentFiltering(e.startTime);this.onEventRender(t,e.startTime),this.parent.notify(xe,{}),this.monthAgendaDate=new Date(""+e.startTime),this.parent.setProperties({selectedDate:this.monthAgendaDate},!0)},Ql.prototype.onEventRender=function(e,t){this.agendaBase=this.getAgendaBase();var i,n=this.element.querySelector("."+mi);lt(n),0===this.parent.activeViewOptions.group.resources.length||this.parent.uiStateValues.isGroupAdaptive?0<e.length?(i=B.createElement("div",{className:fi}),n.appendChild(this.agendaBase.createAgendaContentElement("data",e,i))):this.appendAppContainer(n):0<e.length?(e=(i=this.createTableLayout()).querySelector("tbody"),this.agendaBase.calculateResourceTableElement(e,1,t),i.appendChild(e),n.appendChild(i)):this.appendAppContainer(n),this.agendaBase.wireEventActions()},Ql.prototype.appointmentFiltering=function(e){var e=z(new Date(e.getTime())),t=Ge(new Date(e.getTime()),W);return this.parent.eventBase.filterEvents(e,t)},Ql.prototype.clearElements=function(){for(var e=0,t=[].slice.call(this.element.querySelectorAll("."+qi));e<t.length;e++){var i=t[e];B.remove(i)}this.appendAppContainer(this.element.querySelector("."+mi))},Ql.prototype.appendAppContainer=function(e){var t=B.createElement("div",{className:fi});B.addClass([t],Li),t.innerHTML=this.parent.localeObj.getConstant("noEvents"),lt(e),e.appendChild(t)},Ql.prototype.getNextPreviousDate=function(e){var t=this.parent.selectedDate,i="Next"===e?this.parent.activeViewOptions.interval:-this.parent.activeViewOptions.interval,i=Ke(this.parent.selectedDate,i),e="Next"===e?2:0,t=new Date(t.getFullYear(),t.getMonth()+e,0).getDate(),e=t>=this.monthAgendaDate.getDate()?this.monthAgendaDate.getDate():t;return this.monthAgendaDate=new Date(i.getFullYear(),i.getMonth(),e),this.monthAgendaDate},Ql.prototype.getAgendaBase=function(){return this.agendaBase||new Ul(this.parent)},Ql.prototype.destroy=function(){this.agendaBase&&(this.agendaBase.destroy(),this.agendaBase=null),Gl.prototype.destroy.call(this)};var _l,Gl,Xl=Ql;function Ql(e){var t=Gl.call(this,e)||this;return t.dayNameFormat="narrow",t.viewClass="e-month-agenda-view",t.monthAgendaDate=new Date(""+e.selectedDate),t}Zl.prototype.groupByYear=function(e){for(var t={},i=0,n=e;i<n.length;i++){var r=n[i],a=r.getFullYear();t[parseInt(a.toString(),10)]=t[parseInt(a.toString(),10)]||[],t[parseInt(a.toString(),10)].push(r)}return t},Zl.prototype.groupByMonth=function(e){for(var t={},i=0,n=e;i<n.length;i++){var r=n[i],a=12*(r.getFullYear()-1970)+r.getMonth();t[parseInt(a.toString(),10)]=t[parseInt(a.toString(),10)]||[],t[parseInt(a.toString(),10)].push(r)}return t},Zl.prototype.groupByWeek=function(e){for(var t={},i=0,n=e;i<n.length;i++){var r=n[i],a=+new Date(1970,0,1),s=r.getTimezoneOffset()-new Date(1970,0,1).getTimezoneOffset(),s=Math.ceil(((+r-a-60*s*1e3)/W+new Date(a).getDay()+1)/7);this.parent.activeViewOptions.firstDayOfWeek&&this.parent.activeViewOptions.firstDayOfWeek>new Date(+r).getDay()&&(s-=1),t[parseInt(s.toString(),10)]=t[parseInt(s.toString(),10)]||[],t[parseInt(s.toString(),10)].push(r)}return t},Zl.prototype.generateSlots=function(e,t,i,n,r){for(var a=this,s=function(e,t){return a.parent.globalize.formatDate(e,{format:t,calendar:a.parent.getCalendarMode()})},o=[],l=Object.keys(e),p=0;p<l.length;p++){var c=e[l[parseInt(p.toString(),10)]],h=void 0;if(i.template)var d={date:c[0],type:r},u=this.parent.element.id+"_headerRowTemplate",h=[].slice.call(this.parent.templateParser(i.template)(d,this.parent,"template",u,!1));else{var g=void 0;switch(i.option){case"Year":g='<span class="e-header-year">'+s(c[0],"y")+"</span>";break;case"Month":g='<span class="e-header-month">'+y(s(c[0],"MMMM"),"single")+"</span>";break;case"Week":g='<span class="e-header-week">'+this.parent.getWeekNumberContent(c)+"</span>"}d=B.createElement("div",{innerHTML:g});h=[].slice.call(d.childNodes)}o.push({date:c[0],type:r,className:[n],colSpan:c.length*t,template:h})}return o},Zl.prototype.generateColumnLevels=function(e,t){for(var i,n,r=[],a=this.parent.activeViewOptions.headerRows,s=1,o=("Hour"===a[a.length-1].option&&0<t.length&&(s=t.length/e.length),[]),l=0,p=a;l<p.length;l++){var c=p[l];switch(c.option){case"Year":i=this.groupByYear(this.renderDates),o=this.generateSlots(i,s,c,"e-header-year-cell","yearHeader"),r.push(o);break;case"Month":i=this.groupByMonth(this.renderDates),o=this.generateSlots(i,s,c,"e-header-month-cell","monthHeader"),r.push(o);break;case"Week":n=this.groupByWeek(this.renderDates),o=this.generateSlots(n,s,c,"e-header-week-cell","weekHeader"),r.push(o);break;case"Date":o=(o=e).map(function(e){return e.colSpan=s,e}),r.push(o);break;case"Hour":0<t.length&&r.push(t)}}return r};var Kl=Zl;function Zl(e,t){this.parent=e,this.renderDates=t}Jl=function(e,t){return(Jl=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}Jl(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(tp,$l=Co),tp.prototype.getModuleName=function(){return"timelineViews"},tp.prototype.getLeftPanelElement=function(){return this.element.querySelector("."+Wt)},tp.prototype.scrollTopPanel=function(e){$l.prototype.scrollTopPanel.call(this,e),this.scrollHeaderLabels(e)},tp.prototype.scrollToWorkHour=function(){var e=this.parent.getStartEndTime(this.parent.workHours.start),e=this.isWorkDay(this.parent.selectedDate)&&this.parent.workHours.highlight&&!B.isNullOrUndefined(e)?new Date(+this.parent.selectedDate).setHours(e.getHours(),e.getMinutes(),0,0):new Date(+this.parent.selectedDate).setHours(0,0,0,0),e='[data-date="'+new Date(e).getTime().toString()+'"]',e=this.element.querySelector(e);e&&(this.getContentAreaElement().scrollLeft=this.parent.enableRtl?-(this.parent.getContentTable().offsetWidth-e.offsetLeft-e.offsetWidth):e.offsetLeft)},tp.prototype.scrollToHour=function(e,t){var i,n,r;t&&0<=(n=this.parent.getIndexOfDate(this.renderDates,z(t)))&&(i=t,B.isNullOrUndefined(e)||2===(r=e.split(":")).length&&(i=new Date(t.setHours(parseInt(r[0],10),parseInt(r[1],10),0)))),i=B.isNullOrUndefined(t)?this.parent.getStartEndTime(e):i,B.isNullOrUndefined(i)||(r=B.isNullOrUndefined(e)||!this.parent.activeViewOptions.timeScale.enable?n*this.parent.getElementWidth(this.element.querySelector(".e-work-cells")):B.isNullOrUndefined(t)?this.getLeftFromDateTime(null,i):this.getLeftFromDateTime([n],i),this.getScrollableElement().scrollLeft=this.parent.enableRtl?-r:r)},tp.prototype.generateColumnLevels=function(){var e=[],t=this.getDateSlots(this.renderDates,this.parent.activeViewOptions.workDays),i=(e.push(t),0<this.parent.activeViewOptions.group.resources.length&&this.parent.resourceBase.generateResourceLevels(t,!this.parent.uiStateValues.isGroupAdaptive),[]);return this.parent.activeViewOptions.timeScale.enable&&(i=this.generateTimeSlots(e[e.length-1]),e.push(i)),e=0<this.parent.activeViewOptions.headerRows.length?new Kl(this.parent,this.renderDates).generateColumnLevels(t,i):e},tp.prototype.generateTimeSlots=function(e){for(var t=this,i=this.getTimeSlotRows(function(e){return e.type=e.first?"majorSlot":"minorSlot",e.className=e.first?[$t]:[$t,Jt],e.workDays=t.parent.activeViewOptions.workDays,e}),n=[],r=0,a=e;r<a.length;r++){var s=a[r];s.colSpan=i.length;for(var o=0,l=B.extend([],i,null,!0);o<l.length;o++){var p=l[o],c=z(new Date(""+s.date));p.date=Ge(c,Xe(p.date)),n.push(p)}}return n},tp.prototype.changeCurrentTimePosition=function(){var e,t,i,n;!this.parent||this.parent&&this.parent.isDestroyed||(this.removeCurrentTimeIndicatorElements(),e=this.getCurrentTimeIndicatorIndex(),e=this.getLeftFromDateTime(e,this.parent.getCurrentTime()),n=this.element.querySelector("."+C).offsetHeight,t=this.element.querySelector("."+Vt),this.element.querySelector("."+A).appendChild(B.createElement("div",{className:ii,styles:(this.parent.enableRtl?"right":"left")+":"+B.formatUnit(e)+"; height:"+B.formatUnit(n)})),this.parent.virtualScrollModule&&(n=this.parent.element.querySelector("."+ii),i=this.parent.element.querySelector("."+A+" table"),B.setStyleAttribute(n,{transform:i.style.transform})),n=B.createElement("div",{innerHTML:this.parent.getTimeString(this.parent.getCurrentTime()),className:ti}),t.appendChild(n),n.style[this.parent.enableRtl?"right":"left"]=B.formatUnit(e-n.offsetWidth/2))},tp.prototype.getLeftFromDateTime=function(e,t){var i=this.getStartHour(),n=this.getEndHour(),r=0,a=60*(t.getHours()-i.getHours())+(t.getMinutes()-i.getMinutes()),t=Je(z(new Date(t.getTime())),i,n),t=(t.endHour.getTime()-t.startHour.getTime())/je,s=this.parent.activeViewOptions.timeScale.interval,o=0,o=(0!==i.getHours()||0!==i.getMinutes()||0!==n.getHours()||0!==n.getMinutes())&&1===this.parent.activeViewOptions.timeScale.slotCount&&t<s?t:s;return B.isNullOrUndefined(e)||0!==e[0]&&(n=this.parent.activeView.colLevels.findIndex(function(e){return"dateHeader"===e[0].type}),this.parent.activeView.colLevels[parseInt(n.toString(),10)]&&this.parent.activeView.colLevels[parseInt(n.toString(),10)][0].colSpan?r=e[0]*this.parent.activeView.colLevels[parseInt(n.toString(),10)][0].colSpan*this.parent.getElementWidth(this.element.querySelector(".e-work-cells")):(s=0===(t=this.getEndHour()).getHours()?24:t.getHours(),a+=e[0]*(60*(s-i.getHours())+(t.getMinutes()-i.getMinutes())))),r+a*this.parent.getElementWidth(this.element.querySelector(".e-work-cells"))*this.parent.activeViewOptions.timeScale.slotCount/o},tp.prototype.renderHeader=function(){var e=B.createElement("tr"),t=(0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive&&this.parent.resourceBase.renderResourceHeaderIndent(e),B.createElement("td"));t.appendChild(this.renderDatesHeader()),e.appendChild(t),B.prepend([e],this.element.querySelector("tbody"))},tp.prototype.createAllDayRow=function(e,t){},tp.prototype.getCurrentTimeIndicatorIndex=function(){var e=[],t=this.parent.getIndexOfDate(this.renderDates,z(this.parent.getCurrentTime()));return 0<=t&&e.push(t),e},tp.prototype.renderContent=function(){var e=B.createElement("tr"),t=(0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive&&((t=B.createElement("td")).appendChild(this.parent.resourceBase.createResourceColumn()),e.appendChild(t)),B.createElement("td")),i=this.renderContentArea();i.appendChild(this.createEventTable(this.getRowCount())),this.collapseRows(i),t.appendChild(i),e.appendChild(t),this.parent.virtualScrollModule&&this.parent.virtualScrollModule.renderVirtualTrack(i),this.element.querySelector("tbody").appendChild(e)},tp.prototype.getRowCount=function(){return 0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive?this.parent.resourceBase.renderedResources.length:1},tp.prototype.getResourceTdData=function(e,t){var e=this.parent.resourceBase.renderedResources[parseInt(e.toString(),10)],i=e.resourceData[e.resource.startHourField]||this.parent.workHours.start,n=e.resourceData[e.resource.endHourField]||this.parent.workHours.end;return t.startHour=this.parent.getStartEndTime(i),t.endHour=this.parent.getStartEndTime(n),t.workDays=e.resourceData[e.resource.workDaysField]||this.parent.workDays,t.className=e.className,t.groupIndex=e.groupIndex,t.groupOrder=e.groupOrder,t},tp.prototype.renderContentTable=function(e){e=e.querySelector("tbody");B.append(this.getContentRows(),e)},tp.prototype.getContentRows=function(){for(var e=[],t=B.createElement("tr"),i=B.createElement("td"),n=this.getRowCount(),r=this.getGroupIndices(),a=0;a<n;a++)if(!(0<r.length&&-1<r.indexOf(this.parent.resourceBase.renderedResources[parseInt(a.toString(),10)].groupIndex))){for(var s=t.cloneNode(),o=0,l=this.colLevels[this.colLevels.length-1];o<l.length;o++){var p=l[o],p=(0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive&&(p=this.getResourceTdData(a,p)),this.createContentTd(p,p,i));s.appendChild(p)}e.push(s)}return e},tp.prototype.getContentTdClass=function(e){return e.first||!this.parent.activeViewOptions.timeScale.enable?[O]:[O,ei]},tp.prototype.renderEvents=function(){this.timelineAppointment=new es(this.parent,this.parent.activeViewOptions.timeScale.enable?"hour":"day"),this.timelineAppointment.renderAppointments(),this.parent.notify(xe,{})},tp.prototype.getAdjustedDate=function(e){if(!this.parent.activeViewOptions.timeScale.enable)return new Date(e.setHours(0,0,0,0));for(var t=this.colLevels[this.colLevels.length-1],i=0;i<t.length;i++)if(t[parseInt(i.toString(),10)].date.getTime()>e.getTime())return t[i-1].date;return null},tp.prototype.destroy=function(){!this.parent||this.parent&&this.parent.isDestroyed?this.parent=null:(this.timelineAppointment&&(this.timelineAppointment.destroy(),this.timelineAppointment=null),$l.prototype.destroy.call(this))};var Jl,$l,ep=tp;function tp(e){e=$l.call(this,e)||this;return e.timelineAppointment=null,e.baseCssClass="e-timeline-view",e}ip=function(e,t){return(ip=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}ip(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(ap,np=Pl),ap.prototype.getModuleName=function(){return"timelineMonth"},ap.prototype.onDataReady=function(){this.appointment=new es(this.parent,"day"),this.appointment.renderAppointments(),this.parent.notify(xe,{})},ap.prototype.getLeftPanelElement=function(){return this.element.querySelector("."+Wt)},ap.prototype.scrollTopPanel=function(e){np.prototype.scrollTopPanel.call(this,e),this.scrollHeaderLabels(e)},ap.prototype.setContentHeight=function(e,t,i){t&&(t.style.height=B.formatUnit(i-this.getScrollXIndent(e))),e.style.height=B.formatUnit(i)},ap.prototype.getDateSlots=function(e,t){for(var i=[],n=0,r=e;n<r.length;n++){var a=r[n],s=[It];this.isCurrentDate(a)&&s.push(kt),i.push({date:a,type:"dateHeader",className:s,colSpan:1,workDays:t})}return i},ap.prototype.renderLeftIndent=function(e){0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive&&this.parent.resourceBase.renderResourceHeaderIndent(e)},ap.prototype.renderContent=function(){var e=B.createElement("tr"),t=(0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive&&((t=B.createElement("td")).appendChild(this.parent.resourceBase.createResourceColumn()),e.appendChild(t)),B.createElement("td")),i=(this.element.querySelector("tbody").appendChild(e),B.createElement("div",{className:A}));i.appendChild(this.renderContentArea()),i.appendChild(this.createEventTable(this.getRowCount())),this.collapseRows(i),B.EventHandler.add(i,"scroll",this.onContentScroll,this),t.appendChild(i),this.parent.virtualScrollModule&&this.parent.virtualScrollModule.renderVirtualTrack(i),e.appendChild(t)},ap.prototype.getRowCount=function(){return 0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive?this.parent.resourceBase.renderedResources.length:1},ap.prototype.getContentSlots=function(){for(var e=[],t=0;t<this.getRowCount();t++)for(var i=0,n=this.colLevels[this.colLevels.length-1];i<n.length;i++){var r=n[i],a=(r.className=[O],0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive&&(a=this.parent.resourceBase.renderedResources[parseInt(t.toString(),10)],r.workDays=a.resourceData[a.resource.workDaysField]||this.parent.workDays,r.className=r.className.concat(a.className),r.groupIndex=a.groupIndex,r.groupOrder=a.groupOrder),{date:new Date(+r.date),colSpan:r.colSpan,groupIndex:r.groupIndex,workDays:r.workDays,type:"monthCells",className:r.className});e[parseInt(t.toString(),10)]||(e[parseInt(t.toString(),10)]=[]),e[parseInt(t.toString(),10)].push(a)}return e},ap.prototype.updateClassList=function(e){this.parent.isMinMaxDate(e.date)||e.className.push(yr)},ap.prototype.unWireEvents=function(){B.EventHandler.remove(this.getContentAreaElement(),"scroll",this.onContentScroll)},ap.prototype.getMonthStart=function(e){e=this.parent.calendarUtil.firstDateOfMonth(z(e));return new Date(e.getFullYear(),e.getMonth(),e.getDate())},ap.prototype.getMonthEnd=function(e){e=this.parent.calendarUtil.firstDateOfMonth(z(e));return this.parent.calendarUtil.lastDateOfMonth(Ke(new Date(+e),this.parent.activeViewOptions.interval-1))},ap.prototype.generateColumnLevels=function(){var e=[],t=this.getDateSlots(this.renderDates,this.parent.activeViewOptions.workDays);e.push(t),0<this.parent.activeViewOptions.group.resources.length&&this.parent.resourceBase.generateResourceLevels(t,!this.parent.uiStateValues.isGroupAdaptive);return 0<this.parent.activeViewOptions.headerRows.length&&(e=new Kl(this.parent,this.renderDates).generateColumnLevels(t,[])),this.colLevels=e},ap.prototype.getAdjustedDate=function(e){for(var t=this.colLevels[this.colLevels.length-1],i=0;i<t.length;i++)if(t[parseInt(i.toString(),10)].date.getTime()>e.getTime())return t[i-1].date;return null},ap.prototype.destroy=function(){var e;!this.parent||this.parent&&this.parent.isDestroyed?this.parent=null:(this.element&&(e=this.element.querySelector("."+A))&&B.EventHandler.remove(e,"scroll",this.onContentScroll),this.appointment&&(this.appointment.destroy(),this.appointment=null),np.prototype.destroy.call(this))};var ip,np,rp=ap;function ap(e){e=np.call(this,e)||this;return e.viewClass="e-timeline-month-view",e.isInverseTableSelect=!0,e.appointment=null,e}sp=function(e,t){return(sp=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}sp(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(pp,op=Ll),pp.prototype.getModuleName=function(){return"timelineYear"},pp.prototype.renderHeader=function(e){var t=B.createElement("tr"),e=(e.appendChild(t),"Vertical"===this.parent.activeViewOptions.orientation&&0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive?this.parent.resourceBase.renderResourceHeaderIndent(t):(e=B.createElement("td",{className:Lt}),t.appendChild(e),e.appendChild(this.renderResourceHeader(qt))),"Horizontal"===this.parent.activeViewOptions.orientation),i=0<this.parent.activeViewOptions.group.resources.length,e=(this.isInverseTableSelect=!e||i,B.createElement("td")),i=(t.appendChild(e),B.createElement("div",{className:At}));if(e.appendChild(i),"Horizontal"===this.parent.activeViewOptions.orientation&&0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive)i.appendChild(this.renderResourceHeader(Vt)),this.columnCount=this.colLevels.slice(-1)[0].length;else for(var t=B.createElement("div",{className:Vt}),e=(i.appendChild(t),this.createTableLayout()),n=(t.appendChild(e),e.appendChild(this.createTableColGroup(this.columnCount)),B.createElement("tr")),r=(e.querySelector("tbody").appendChild(n),this.getMonths()),a=this.getMonthDates(new Date(this.parent.selectedDate.getFullYear(),r[0],1)),s=0;s<this.columnCount;s++){var o=new Date(this.parent.selectedDate.getFullYear(),r[parseInt(s.toString(),10)],1),l=B.createElement("td",{className:It});"Horizontal"===this.parent.activeViewOptions.orientation?this.parent.dayHeaderTemplate?B.append(this.renderDayMonthHeaderTemplate(a[parseInt(s.toString(),10)],s,"dayHeaderTemplate"),l):l.innerHTML="<span>"+this.parent.getDayNames("abbreviated")[s%7]+"</span>":(this.parent.monthHeaderTemplate?B.append(this.renderDayMonthHeaderTemplate(o,r[parseInt(s.toString(),10)],"monthHeaderTemplate"),l):l.innerHTML="<span>"+this.getMonthName(o)+"</span>",l.setAttribute("data-date",o.getTime().toString())),n.appendChild(l),this.parent.trigger($,{elementType:"headerCells",element:l})}},pp.prototype.renderResourceHeader=function(e){var t=B.createElement("div",{className:e}),i=this.createTableLayout(),n=(t.appendChild(i),B.createElement("tr"));0<this.parent.activeViewOptions.group.resources.length?this.colLevels=this.generateColumnLevels():this.colLevels=[[{className:[It],type:"headerCell"}]];for(var r=0,a=this.colLevels;r<a.length;r++){for(var s=a[r],o=n.cloneNode(),l=0,p=e===Vt?s:[s[0]];l<p.length;l++){var c=p[l],h=B.createElement("td"),c=(c.className&&B.addClass([h],c.className),e===Vt&&(c.template&&B.append(c.template,h),c.colSpan&&h.setAttribute("colspan",c.colSpan.toString()),-1<c.groupIndex&&h.setAttribute("data-group-index",c.groupIndex.toString()),this.setResourceHeaderContent(h,c)),e===qt&&this.parent.renderHeaderIndentTemplate(c,h),{elementType:c.type,element:h,date:c.date,groupIndex:c.groupIndex});this.parent.trigger($,c),o.appendChild(h)}i.querySelector("tbody").appendChild(o)}return e===Vt&&i.appendChild(this.createTableColGroup(this.colLevels.slice(-1)[0].length)),t},pp.prototype.renderContent=function(e){var t,i,n=B.createElement("tr"),e=(e.appendChild(n),B.createElement("td")),r=B.createElement("td"),a=[],e=("Vertical"===this.parent.activeViewOptions.orientation&&0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive?(a.push(e),e.appendChild(this.parent.resourceBase.createResourceColumn()),this.rowCount=this.parent.resourceBase.renderedResources.length):(a.push(e),t=B.createElement("div",{className:Hr}),e.appendChild(t),t.appendChild(this.createTableLayout()),t=t.querySelector("tbody")),a.push(r),B.append(a,n),B.createElement("div",{className:A})),a=(r.appendChild(e),this.createTableLayout(C)),n=(this.setAriaAttributes(a),e.appendChild(a),B.createElement("div",{className:Ft})),r=(e.appendChild(n),this.parent.virtualScrollModule&&this.parent.virtualScrollModule.renderVirtualTrack(e),a.querySelector("tbody"));this.parent.rowAutoHeight&&(e=[a],(i=this.parent.element.querySelector("."+Hr+" ."+Ct))&&e.push(i),B.addClass(e,Mr)),0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive?(i="Horizontal"===this.parent.activeViewOptions.orientation?this.colLevels.slice(-1)[0].length:this.columnCount,a.appendChild(this.createTableColGroup(i)),this.renderResourceContent(n,t,r)):(a.appendChild(this.createTableColGroup(this.columnCount)),this.renderDefaultContent(n,t,r))},pp.prototype.renderDefaultContent=function(e,t,i){for(var n=this.getMonths(),r=this.getMonthDates(new Date(this.parent.selectedDate.getFullYear(),n[0],1)),a=0;a<this.rowCount;a++){e.appendChild(B.createElement("div",{className:fi}));for(var s=new Date(this.parent.selectedDate.getFullYear(),n[parseInt(a.toString(),10)],1),o=this.parent.calendarUtil.getMonthStartDate(new Date(s.getTime())),l=this.parent.calendarUtil.getMonthEndDate(new Date(s.getTime())),p=B.createElement("tr"),c=p.cloneNode(),h=(t.appendChild(c),p.cloneNode()),p=(i.appendChild(h),B.createElement("td",{className:Mi})),d=("Horizontal"===this.parent.activeViewOptions.orientation?(this.parent.monthHeaderTemplate?B.append(this.renderDayMonthHeaderTemplate(o,a,"monthHeaderTemplate"),p):p.innerHTML="<span>"+this.getMonthName(s)+"</span>",p.setAttribute("data-date",s.getTime().toString())):this.parent.dayHeaderTemplate?B.append(this.renderDayMonthHeaderTemplate(r[parseInt(a.toString(),10)],a,"dayHeaderTemplate"),p):p.innerHTML="<span>"+this.parent.getDayNames("abbreviated")[a%7]+"</span>",c.appendChild(p),this.parent.trigger($,{elementType:"leftHeaderCells",element:p}),new Date(o.getTime())),u=0;u<this.columnCount;u++){var g,m,v=void 0,f=(v="Vertical"===this.parent.activeViewOptions.orientation?(s=new Date(this.parent.selectedDate.getFullYear(),n[parseInt(u.toString(),10)],1),o=this.parent.calendarUtil.getMonthStartDate(new Date(s.getTime())),l=this.parent.calendarUtil.getMonthEndDate(new Date(s.getTime())),f=a-o.getDay()+1,d=new Date(this.parent.selectedDate.getFullYear(),n[parseInt(u.toString(),10)],f),0<f&&d.getTime()<l.getTime()):u>=o.getDay()&&d.getTime()<l.getTime(),this.parent.globalize.formatDate(d,{skeleton:"full",calendar:this.parent.getCalendarMode()})),y=B.createElement("td",{className:O,attrs:{"aria-label":f}}),T=(h.appendChild(y),B.createElement("div",{className:Pi+" "+Hi,innerHTML:v?this.parent.globalize.formatDate(d,{skeleton:"d",calendar:this.parent.getCalendarMode()}):""}));v?(g=[y],m=[],-1<this.parent.activeViewOptions.workDays.indexOf(d.getDay())&&m.push(Mt),this.parent.isMinMaxDate(d)||B.addClass([y],yr),this.isCurrentDate(d)&&(m.push(kt),"Horizontal"===this.parent.activeViewOptions.orientation?g.push(this.element.querySelector("."+It+":nth-child("+(u+1)+")")):g.push(this.element.querySelectorAll("."+Mi).item(a))),0<m.length&&B.addClass(g,m)):(B.addClass([y],E),this.parent.isMinMaxDate(d)||B.addClass([y],yr)),y.classList.contains(E)||(this.renderDates.push(new Date(d)),y.appendChild(T),v&&(y.setAttribute("data-date",d.getTime().toString()),this.wireEvents(y)),this.renderCellTemplate({date:d,type:"workCells"},y),this.parent.trigger($,{elementType:"workCells",element:y,date:d}),v&&"Horizontal"===this.parent.activeViewOptions.orientation&&(d=Y(new Date(d.getTime()),1)))}}this.renderDates.splice(0,1)},pp.prototype.getContentRows=function(){for(var e=[],t=this.getMonths(),i=this.getGroupIndices(),n=0;n<this.parent.resourceBase.renderedResources.length;n++){var r=void 0;if(!(0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive&&(r=this.parent.resourceBase.renderedResources[parseInt(n.toString(),10)],0<i.length)&&-1<i.indexOf(r.groupIndex)))for(var a=B.createElement("tr"),s=(e.push(a),new Date(this.parent.selectedDate.getFullYear(),t[parseInt(n.toString(),10)],1)),o=this.parent.calendarUtil.getMonthStartDate(new Date(s.getTime())),l=0;l<this.columnCount;l++){var p=[],c=r.groupIndex,s=(-1<(p=p.concat(r.className)).indexOf(_t)?p.push(Ut):p.push(Mt),new Date(this.parent.selectedDate.getFullYear(),t[parseInt(l.toString(),10)],1)),o=this.parent.calendarUtil.getMonthStartDate(new Date(s.getTime())),h=B.createElement("td",{className:O,attrs:{"aria-selected":"false","data-date":o.getTime().toString()}});B.addClass([h],p),h.setAttribute("data-group-index",c.toString()),this.renderCellTemplate({date:o,type:"resourceGroupCells",groupIndex:c},h),this.wireEvents(h),this.parent.trigger($,{elementType:"resourceGroupCells",element:h,date:o}),a.appendChild(h)}}return e},pp.prototype.renderResourceContent=function(e,t,i){for(var n=this.getMonths(),r=0;r<this.rowCount;r++){e.appendChild(B.createElement("div",{className:fi}));var a,s,o=B.createElement("tr"),l=(i.appendChild(o),void 0),p=("Vertical"===this.parent.activeViewOptions.orientation&&0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive&&(l=this.parent.resourceBase.renderedResources[parseInt(r.toString(),10)]),new Date(this.parent.selectedDate.getFullYear(),n[parseInt(r.toString(),10)],1)),c=this.parent.calendarUtil.getMonthStartDate(new Date(p.getTime()));"Horizontal"===this.parent.activeViewOptions.orientation&&(a=o.cloneNode(),t.appendChild(a),s=B.createElement("td",{className:Mi,attrs:{"data-date":c.getTime().toString()}}),this.parent.monthHeaderTemplate?B.append(this.renderDayMonthHeaderTemplate(p,r,"monthHeaderTemplate"),s):s.innerHTML="<span>"+this.getMonthName(p)+"</span>",a.appendChild(s));for(var h=0;h<this.columnCount;h++){var d=[],u=void 0,g=("Vertical"===this.parent.activeViewOptions.orientation?(u=l.groupIndex,-1<(d=d.concat(l.className)).indexOf(_t)?d.push(Ut):d.push(Mt),p=new Date(this.parent.selectedDate.getFullYear(),n[parseInt(h.toString(),10)],1),c=this.parent.calendarUtil.getMonthStartDate(new Date(p.getTime()))):(u=this.colLevels.slice(-1)[0][parseInt(h.toString(),10)].groupIndex,d.push(Mt)),this.parent.globalize.formatDate(c,{type:"dateTime",skeleton:"full",calendar:this.parent.getCalendarMode()})),m=this.parent.globalize.formatDate(this.parent.calendarUtil.getMonthEndDate(new Date(p.getTime())),{type:"dateTime",skeleton:"full",calendar:this.parent.getCalendarMode()}),g=B.createElement("td",{className:O,attrs:{"aria-selected":"false","data-date":c.getTime().toString(),"aria-label":g+" "+this.parent.localeObj.getConstant("endAt")+" "+m}});B.addClass([g],d),g.setAttribute("data-group-index",u.toString()),this.renderCellTemplate({date:c,type:"resourceGroupCells",groupIndex:u},g),this.wireEvents(g),o.appendChild(g),this.parent.trigger($,{elementType:"resourceGroupCells",element:g,date:c})}}"Vertical"===this.parent.activeViewOptions.orientation&&this.collapseRows(this.parent.element.querySelector("."+A))},pp.prototype.renderDayMonthHeaderTemplate=function(e,t,i){var e={date:e,type:"dayHeaderTemplate"===i?"dayHeader":"monthHeader"},n="schedule_"+this.parent.activeViewOptions.dayHeaderTemplateName+"dayHeaderTemplate",r="schedule_"+this.parent.activeViewOptions.dayHeaderTemplateName+"monthHeaderTemplate";return"dayHeaderTemplate"===i?(e.day=this.parent.getDayNames("wide")[t%7],[].slice.call(this.parent.getDayHeaderTemplate()(e,this.parent,"dayHeaderTemplate",n,!1,void 0,void 0,this.parent.root))):[].slice.call(this.parent.getMonthHeaderTemplate()(e,this.parent,"monthHeaderTemplate",r,!1,void 0,void 0,this.parent.root))},pp.prototype.renderCellTemplate=function(e,t){var i;this.parent.activeViewOptions.cellTemplate&&!t.classList.contains(E)&&(i={date:e.date,type:e.type},e.groupIndex&&(i.groupIndex=e.groupIndex),e=this.parent.element.id+"_"+this.parent.activeViewOptions.cellTemplateName+"cellTemplate",i=[].slice.call(this.parent.getCellTemplate()(i,this.parent,"cellTemplate",e,!1,void 0,void 0,this.parent.root)),B.append(i,t))},pp.prototype.scrollToDate=function(e){var t,i,e=null!==this.parent.activeViewOptions.group.resources&&0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive?+new Date(z(We(e))):+new Date(z(e)),e=this.element.querySelector('[data-date="'+e+'"]');e&&(t=this.getScrollableElement(),this.parent.enableRtl?(i=this.element.querySelector("."+C),t.scrollLeft=-(i.offsetWidth-e.offsetLeft-e.offsetWidth)):t.scrollLeft=e.offsetLeft,t.scrollTop=e.offsetTop)},pp.prototype.getScrollableElement=function(){return this.parent.isAdaptive&&!this.isTimelineView()?this.element.querySelector("."+ai):this.getContentAreaElement()},pp.prototype.wireEvents=function(e){B.EventHandler.add(e,"mousedown",this.parent.workCellAction.cellMouseDown,this.parent.workCellAction),B.EventHandler.add(e,"click",this.parent.workCellAction.cellClick,this.parent.workCellAction),this.parent.isAdaptive||B.EventHandler.add(e,"dblclick",this.parent.workCellAction.cellDblClick,this.parent.workCellAction)};var sp,op,lp=pp;function pp(e){e=op.call(this,e)||this;return e.viewClass="e-timeline-year-view",e.isInverseTableSelect=!0,e}cp.prototype.initializeCalendarExport=function(e,t){t=this.getCalendarString(e,t);this.download(t,e)},cp.prototype.getCalendarString=function(e,t){var p=this,c=t||B.extend([],this.parent.eventsData,null,!0),c=this.parent.eventBase.sortByTime(c),h=-1!==navigator.appVersion.indexOf("Win")?"\r\n":"\n",d=[],u=[],g=this.parent.timezone||this.parent.tzModule.getLocalTimezoneName(),m=this.parent.eventFields;return c.forEach(function(t){var e=t[m.id]||t.Guid||p.parent.eventBase.generateGuid(),i=[],n=(t[m.recurrenceID]&&(e=0<(n=p.filterEvents(u,m.id,t[m.recurrenceID])).length?n[0].UID:e),!t[m.recurrenceID]&&t[m.recurrenceRule]&&t[m.recurrenceException]&&(o=t[m.recurrenceException].split(","),p.filterEvents(c,m.recurrenceID,t[m.id]).forEach(function(e){i.push(Wa(e[m.startTime]))}),n=o.filter(function(e){return-1===i.indexOf(e)}),t[m.recurrenceException]=0<n.length?n.join(",")+",":""),t[m.startTimezone]||g),r=t[m.endTimezone]||g,a=t[m.isReadonly]||!1,s=["BEGIN:VEVENT","LOCATION:"+(t[m.location]||""),"SUMMARY:"+(t[m.subject]||""),"UID:"+e,"DESCRIPTION:"+(t[m.description]||""),"ISREADONLY:"+a,"END:VEVENT"];if(t[m.isAllDay]?(s.splice(4,0,"DTEND;VALUE=DATE:"+p.convertDateToString(t[m.endTime],!0)),s.splice(4,0,"DTSTART;VALUE=DATE:"+p.convertDateToString(t[m.startTime],!0))):t[m.isAllDay]||t[m.recurrenceRule]?(s.splice(4,0,'DTEND;TZID="'+r+'":'+p.convertDateToString(t[m.endTime])),s.splice(4,0,'DTSTART;TZID="'+n+'":'+p.convertDateToString(t[m.startTime]))):(s.splice(4,0,"DTEND:"+p.convertDateToString(t[m.endTime])),s.splice(4,0,"DTSTART:"+p.convertDateToString(t[m.startTime]))),t[m.recurrenceRule]&&s.splice(4,0,"RRULE:"+t[m.recurrenceRule]),t[m.recurrenceException])for(var o=t[m.recurrenceException].split(","),l=0;l<o.length-1;l++)s.splice(5,0,"EXDATE:"+p.convertDateToString(oa(o[parseInt(l.toString(),10)]),t[m.isAllDay]));t[m.recurrenceID]&&s.splice(4,0,'RECURRENCE-ID;TZID="'+n+'":'+p.convertDateToString(t[m.startTime],t[m.isAllDay]));a=p.customFieldFilter(t,m),0<a.length&&a.forEach(function(e){return s.splice(4,0,e+":"+(t[""+e]||""))}),r=B.extend({},t);r.UID=e,u.push(r),d.push(s.join(h))}),["BEGIN:VCALENDAR","PRODID:-//Syncfusion Inc//Scheduler//EN","VERSION:2.0","CALSCALE:GREGORIAN","METHOD:PUBLISH","X-WR-CALNAME:"+(e||"Calendar"),"X-WR-TIMEZONE:"+g].join(h)+h+d.join(h)+h+"END:VCALENDAR"},cp.prototype.customFieldFilter=function(e,t){var i=Object.keys(t).map(function(e){return t[""+e]});return Object.keys(e).filter(function(e){return-1===i.indexOf(e)&&"Guid"!==e})},cp.prototype.convertDateToString=function(e,t){var i=("0000"+e.getFullYear().toString()).slice(-4),n=("00"+(e.getMonth()+1).toString()).slice(-2),r=("00"+e.getDate().toString()).slice(-2),a=("00"+e.getHours().toString()).slice(-2),s=("00"+e.getMinutes().toString()).slice(-2),e=("00"+e.getSeconds().toString()).slice(-2);return t?i+n+r:i+n+r+"T"+a+s+e},cp.prototype.download=function(e,t){var i,e=new Blob([e],{type:"data:text/calendar;charset=utf8"});t=(t||"Calendar")+".ics",navigator.msSaveBlob?navigator.msSaveBlob(e,t):((i=document.createElementNS("http://www.w3.org/1999/xhtml","a")).download=t,i.href=URL.createObjectURL(e),(t=document.createEvent("MouseEvent")).initEvent("click",!0,!0),i.dispatchEvent(t),setTimeout(function(){URL.revokeObjectURL(i.href),i.href=void 0}))},cp.prototype.filterEvents=function(e,t,i){return e.filter(function(e){return e[""+t]===i})},cp.prototype.getModuleName=function(){return"iCalendarExport"},cp.prototype.destroy=function(){!this.parent||this.parent&&this.parent.isDestroyed||(this.parent=null)};ko=cp;function cp(e){this.parent=e}hp.prototype.initializeCalendarImport=function(e){var t,i=this;e&&e instanceof Blob?((t=new FileReader).onload=function(){var e=t.result;i.iCalendarParser(e)},t.readAsText(e,"UTF-8")):e&&"string"==typeof e&&this.iCalendarParser(e)},hp.prototype.iCalendarParser=function(e){var t,i={isEvent:!1,curEvent:null,id:this.parent.eventBase.getEventMaxID(),count:0,events:[],key:null},n=e.length,r=e.search(/[^ \t]/),a=r;do{var s=0===(a=e.indexOf("\n",r)+1)?(a=n,0):1<a&&"\r"===e[a-2]?2:1,o=e.charAt(r)}while(" "===o||"\n"===o||"\t"===o?t+=e.slice(r+1,a-s):(t&&(i=this.updateEventData(t,i)),t=e.slice(r,a-s)),(r=a)!==n);(t=t.trim()).length&&(i=this.updateEventData(t,i));var l=B.extend([],i.events,null,!0);this.parent.addEvent(this.processOccurrence(l,i.id))},hp.prototype.updateEventData=function(e,t){var i=this.parent.eventFields,n=t.id,r=t.events,a=t.isEvent,s=t.count,o=t.curEvent,t=t.key;if(a||"BEGIN:VEVENT"!==e||(a=!0,o={}),a&&"END:VEVENT"===e&&(a=!1,r.push(o),o=null),a){var l,p=e.indexOf(":"),c=e.substring(0,p).replace(/^\s\s*/,"").replace(/\s\s*$/,""),h=e.substring(p+1,e.length).replace(/^\s\s*/,"").replace(/\s\s*$/,"");if(-1!==e.indexOf("SUMMARY")&&(c="SUMMARY"),-1!==e.indexOf("DTSTART"))o[i.startTime]=this.dateParsing(e),o[i.isAllDay]=this.allDay,this.allDay=!1;else if(-1!==e.indexOf("DTEND"))o[i.endTime]=this.dateParsing(e);else if(-1!==e.indexOf("EXDATE"))h=Wa(this.dateParsing(e)),o[i.recurrenceException]=B.isNullOrUndefined(o[i.recurrenceException])?h:o[i.recurrenceException]+","+h;else if(-1!==e.indexOf("RECURRENCE-ID"))h=Wa(this.dateParsing(e)),o[i.recurrenceException]=h,o[i.recurrenceID]=h;else switch(t=c||t){case"BEGIN":break;case"UID":o[""+c]=h,"number"==typeof n?(o[i.id]=parseInt(h,10),isNaN(o[i.id])&&(o[i.id]=n+s,s++)):o[i.id]=h;break;case"SUMMARY":o[i.subject]=this.getFormattedString(h);break;case"LOCATION":o[i.location]=this.getFormattedString(h);break;case"DESCRIPTION":o[i.description]?o[i.description]=this.getFormattedString(o[i.description]+"\r\n"+h):o[i.description]=this.getFormattedString(h);break;case"ISREADONLY":o[i.isReadonly]=-1<h.indexOf("true");break;case"RRULE":o[i.recurrenceRule]=h;break;default:0<this.parent.resourceCollection.length?(l=this.parent.resourceCollection.filter(function(e){return e.field===c}),o[""+c]=0<l.length&&"number"==typeof l[0].dataSource[0][l[0].idField]?parseInt(h,10):h):o[""+c]=h}}return{isEvent:a,curEvent:o,id:n,count:s,events:r,key:t}},hp.prototype.processOccurrence=function(s,o){var l=this,p=[],c=this.parent.eventFields,h=[];return this.parent.eventsData.forEach(function(e){h.push(e[c.id])}),s.forEach(function(t){var e;if(t.hasOwnProperty(c.recurrenceID)||(r=(e=t)[c.id]),h.indexOf(t[c.id])<0){var i=s.filter(function(e){return e.UID===t.UID});if(1<i.length&&B.isNullOrUndefined(t[c.recurrenceID])){for(var n,r="number"==typeof o?o++:r,a=0;a<i.length;a++)i[parseInt(a.toString(),10)].hasOwnProperty(c.recurrenceID)&&(n=i[parseInt(a.toString(),10)][c.recurrenceID],i[parseInt(a.toString(),10)][c.id]="number"==typeof o?o++:l.parent.eventBase.generateGuid(),i[parseInt(a.toString(),10)][c.recurrenceID]=r,i[parseInt(a.toString(),10)][c.recurrenceException]=null,e[c.recurrenceException]=l.getExcludeDateString(e[c.recurrenceException],n),delete i[parseInt(a.toString(),10)].UID,p.push(i[parseInt(a.toString(),10)]));delete e.UID,e[c.id]=r,p.push(e)}else t.hasOwnProperty(c.recurrenceID)||(delete t.UID,t[c.id]="number"==typeof o?o++:r,p.push(t))}}),p},hp.prototype.getExcludeDateString=function(e,t){var i,n;return B.isNullOrUndefined(e)?t:B.isNullOrUndefined(t)||(i=e.split(",").map(function(e){return e.split("T")[0]}),n=t.split(",").map(function(e){return e.split("T")[0]}),0<i.filter(function(e){return-1<n.indexOf(e)}).length)?e:e+","+t},hp.prototype.getFormattedString=function(e){return(e=e||"").replace(/\\\,/g,",").replace(/\\\;/g,";").replace(/\\[nN]/g,"\n").replace(/\\\\/g,"\\")},hp.prototype.dateParsing=function(e){var t=e.split(":"),t=t[t.length-1],i=new Date(this.getFormattedString(t)),n=(e&&(-1<e.indexOf("VALUE=DATE")||-1<e.indexOf("RECURRENCE-ID;TZID"))&&(null!==(n=/^(\d{4})(\d{2})(\d{2})$/.exec(t))&&(i=new Date(parseInt(n[1],10),parseInt(n[2],10)-1,parseInt(n[3],10))),-1<e.indexOf("DTSTART"))&&(this.allDay=!0),/^(\d{4})(\d{2})(\d{2})T(\d{2})(\d{2})(\d{2})(Z)?$/.exec(t));return i=null!==n?"Z"===n[7]?new Date(Date.UTC(parseInt(n[1],10),parseInt(n[2],10)-1,parseInt(n[3],10),parseInt(n[4],10),parseInt(n[5],10),parseInt(n[6],10))):new Date(parseInt(n[1],10),parseInt(n[2],10)-1,parseInt(n[3],10),parseInt(n[4],10),parseInt(n[5],10),parseInt(n[6],10)):i},hp.prototype.getModuleName=function(){return"iCalendarImport"},hp.prototype.destroy=function(){this.parent&&this.parent&&this.parent.isDestroyed};Fo=hp;function hp(e){this.allDay=!1,this.parent=e}dp.prototype.initializeExcelExport=function(e){var t,i=this.getExportColumns(e=void 0===e?{}:e),n=e.fileName||"Schedule",r=e.exportType||"xlsx",a=e.includeOccurrences||!1;B.isNullOrUndefined(e.separator)||","===e.separator||(t=e.separator),e=e.customData?a?this.parent.eventBase.getProcessedEvents(e.customData):e.customData:a?this.parent.eventsProcessed:this.parent.eventsData,this.processWorkbook(i,n,r,e,t)},dp.prototype.processWorkbook=function(t,i,n,e,r){var a=this,s=[],o=[],l=[],p=(t.forEach(function(e,t){s.push({index:t+1,width:"Id"===e.name?50:150})}),{fontSize:12,borders:{color:"#E0E0E0"},bold:!0}),e=(t.forEach(function(e,t){l.push({index:t+1,value:e.text,style:p})}),o.push({index:1,cells:l}),e.forEach(function(i,e){var n=[];t.forEach(function(e,t){t={index:t+1,value:i[e.name]||""};e.name!==a.parent.eventFields.startTime&&e.name!==a.parent.eventFields.endTime||(t=B.extend({},t,{style:{fontSize:12,numberFormat:"m/d/yyyy h:mm a"}},!0)),n.push(t)}),o.push({index:e+2,cells:n})}),[{columns:s,rows:o}]);this.parent.trigger(Se,{cancel:!1,worksheets:e},function(e){e.cancel||new L.Workbook({worksheets:e.worksheets},n,a.parent.locale,void 0,r).save(i+"."+n)})},dp.prototype.getExportColumns=function(e){var t=this,i=e.fieldsInfo||[];return 0===i.length&&(e.fields||Object.keys(this.parent.eventFields).map(function(e){return t.parent.eventFields[""+e]})).forEach(function(e){i.push({name:e,text:e})}),i},dp.prototype.getModuleName=function(){return"excelExport"},dp.prototype.destroy=function(){this.parent=null};u=dp;function dp(e){this.parent=e}up.prototype.print=function(e){B.isNullOrUndefined(e)?this.printScheduler():this.printSchedulerWithModel(e)},up.prototype.printScheduler=function(){var l=this,p=this.parent.element.cloneNode(!0);p.id=this.parent.element.id+"_print",this.parent.trigger(be,{cancel:!1,printElement:p},function(e){if(!e.cancel){document.body.appendChild(p);for(var t="MonthAgenda"===l.parent.currentView?".e-appointment-wrap":".e-content-wrap",i=l.parent.element.querySelector(t),n="",r=0,a=[].slice.call(document.getElementsByTagName("head")[0].querySelectorAll("link, style"));r<a.length;r++)n+=a[r].outerHTML;var e=B.createElement("div"),s=(p.style.width=l.parent.element.offsetWidth+"px",100*Math.round(parseInt(p.style.width,10)/100)),o=(e.appendChild(p),window.open("","print","height=550,width="+s+",tabbar=no"));o.document.write("<!DOCTYPE html><html><head>"+n+"</head><body>"+e.innerHTML+"<script>(function() { window.ready = true; })();<\/script></body></html>"),o.document.close(),o.focus(),setTimeout(function(){var e;o.ready&&i&&(i.scrollLeft=i.scrollLeft,i.scrollTop=i.scrollTop,(e=o.document.querySelector(".e-date-header-wrap"))&&(e.scrollLeft=i.scrollLeft),(e=o.document.querySelector(".e-time-cells-wrap"))&&(e.scrollTop=i.scrollTop),(e=o.document.querySelector(t))&&(e.scrollLeft=i.scrollLeft,e.scrollTop=i.scrollTop),o.print(),o.close())},500)}})},up.prototype.printSchedulerWithModel=function(e){var t=this,i=B.createElement("div",{id:this.parent.element.id+"_print",className:"e-print-schedule"}),e=(document.body.appendChild(i),ll.Inject(Sl,xl,Ml,Pl,Yl,Xl,ep,rp,Ll,lp),this.printInstance=new ll(this.getPrintScheduleModel(e)),this.printInstance.isPrinting=!0,this.printInstance.registeredTemplate=this.parent.registeredTemplate,this.printInstance.root=this.parent.root||this.parent,this.printInstance.appendTo(i),{cancel:!1,printElement:i});this.parent.trigger(be,e,function(e){e.cancel?t.printCleanup():(t.printInstance.on(Oe,t.contentReady,t),t.printWindow=window.open("","print","height="+window.outerHeight+",width="+window.outerWidth+",tabbar=no"),t.printWindow.moveTo(0,0),t.printWindow.resizeTo(screen.availWidth,screen.availHeight))})},up.prototype.getPrintScheduleModel=function(e){for(var t,i,n={},r=["cellHeaderTemplate","dayHeaderTemplate","monthHeaderTemplate","cellTemplate","dateHeaderTemplate","dateRangeTemplate","eventTemplate","resourceHeaderTemplate","headerIndentTemplate"],a=["actionBegin","actionComplete","actionFailure","created","dataBinding","dataBound","destroyed","eventRendered","moreEventsClick","navigating","popupOpen","popupClose","renderCell"],s=0,o=["agendaDaysCount","calendarMode","cssClass","currentView","dateFormat","enableRtl","endHour","eventSettings","firstDayOfWeek","firstMonthOfYear","group","height","locale","maxDate","minDate","readonly","resources","rowAutoHeight","selectedDate","showHeaderBar","showTimeIndicator","showWeekNumber","showWeekend","startHour","timeFormat","timeScale","timezone","views","width","workDays","workHours","dateHeaderTemplate","dateRangeTemplate","cellHeaderTemplate","dayHeaderTemplate","monthHeaderTemplate","cellTemplate","resourceHeaderTemplate","headerIndentTemplate","actionBegin","actionComplete","actionFailure","created","dataBinding","dataBound","destroyed","eventRendered","moreEventsClick","navigating","popupOpen","popupClose","renderCell"];s<o.length;s++){var l=o[s];switch(l){case"eventSettings":(t=Object.assign({},this.parent.eventSettings.properties)).dataSource=this.parent.eventsData;var p=(B.isNullOrUndefined(e.eventSettings)||B.isNullOrUndefined(e.eventSettings.template)?t:e.eventSettings).template;t.template=this.parent.isAngular||"function"!=typeof p?p:null,n.eventSettings=t;break;case"group":(p=(B.isNullOrUndefined(e.group)?this.parent:e).group).headerTooltipTemplate=null,n.group=p;break;case"timeScale":t=(B.isNullOrUndefined(e.timeScale)?this.parent:e).timeScale,this.parent.isAngular||(t.majorSlotTemplate="function"==typeof t.majorSlotTemplate?null:t.majorSlotTemplate,t.minorSlotTemplate="function"==typeof t.minorSlotTemplate?null:t.minorSlotTemplate),n.timeScale=t;break;case"views":if(i=(B.isNullOrUndefined(e.views)?this.parent:e).views,!this.parent.isAngular&&i&&0<i.length&&"object"==typeof i[0])for(var c=0,h=i;c<h.length;c++)!function(t){r.forEach(function(e){B.isNullOrUndefined(t[""+e])||(t[""+e]="function"==typeof t[""+e]?null:t[""+e])})}(h[c]);n.views=i;break;default:-1<r.indexOf(l)?n[""+l]=B.isNullOrUndefined(e[""+l])?this.parent.isAngular||"function"!=typeof this.parent[""+l]?this.parent[""+l]:null:this.parent.isAngular||"function"!=typeof e[""+l]?e[""+l]:null:-1<a.indexOf(l)?n[""+l]=e[""+l]:n[""+l]=(B.isNullOrUndefined(e[""+l])?this.parent:e)[""+l]}}return n},up.prototype.contentReady=function(){var e=this;this.printWindow=B.print(this.printInstance.element,this.printWindow),this.closePrintWindow(this.printWindow,!0),this.printWindow.onbeforeunload=function(){e.printCleanup()}},up.prototype.closePrintWindow=function(e,t){var i,n=this;B.Browser.isIos&&(i=setInterval(function(){e.opener?e.close():B.isNullOrUndefined(e.opener)&&(t&&n.printCleanup(),clearInterval(i))},500))},up.prototype.printCleanup=function(){this.printInstance&&(this.printInstance.off(Oe,this.contentReady),this.printInstance.element.remove(),this.printInstance.destroy(),this.printInstance=null),this.printWindow&&(this.printWindow.onbeforeunload=null,this.printWindow=null)},up.prototype.getModuleName=function(){return"print"},up.prototype.destroy=function(){this.parent=null};Vo=up;function up(e){this.parent=e}e.Agenda=Yl,e.DEFAULT_WEEKS=6,e.Day=Sl,e.DragAndDrop=cs,e.ExcelExport=u,e.Gregorian=Zr,e.HeaderRenderer=Br,e.ICalendarExport=ko,e.ICalendarImport=Fo,e.Islamic=$r,e.MS_PER_DAY=W,e.MS_PER_MINUTE=je,e.Month=Pl,e.MonthAgenda=Xl,e.Print=Vo,e.RecurrenceEditor=co,e.Resize=$o,e.Schedule=ll,e.TimelineMonth=rp,e.TimelineViews=ep,e.TimelineYear=lp,e.Timezone=ta,e.ViewBase=hs,e.WEEK_LENGTH=7,e.Week=xl,e.WorkWeek=Ml,e.Year=Ll,e.actionBegin=Q,e.actionComplete=K,e.actionFailure=Z,e.addDays=Y,e.addMonths=Ke,e.addYears=Ze,e.agendaCells=ye,e.beforePaste=De,e.beforePrint=be,e.capitalizeFirstWord=y,e.cellClick=q,e.cellDoubleClick=F,e.cellMouseDown=Pe,e.cellSelect=ge,e.contentReady=Ve,e.dataBinding=ne,e.dataBound=re,e.dataReady=Ee,e.dateHeader=we,e.documentClick=Re,e.documentPaste=He,e.drag=le,e.dragStart=oe,e.dragStop=pe,e.eventClick=ee,e.eventDoubleClick=te,e.eventRendered=ie,e.eventsLoaded=xe,e.excelExport=Se,e.extractObjectFromRule=xa,e.findIndexInData=st,e.firstDateOfMonth=We,e.generate=sa,e.generateSummary=ra,e.getCalendarUtil=Ia,e.getDateCount=Qe,e.getDateFromRecurrenceDateString=oa,e.getDateFromString=tt,e.getDateInMs=Xe,e.getDaysCount=et,e.getElementHeight=gt,e.getElementHeightFromClass=Ne,e.getElementTop=mt,e.getElementWidth=ut,e.getElementWidthFromClass=Le,e.getMaxDays=$e,e.getOuterHeight=ot,e.getRecurrenceStringFromDate=Wa,e.getScrollBarWidth=rt,e.getStartEndHours=Je,e.getTranslateX=Fe,e.getTranslateY=qe,e.getUniversalTime=ct,e.getWeekFirstDate=Ue,e.getWeekLastDate=Be,e.getWeekMiddleDate=_e,e.getWeekNumber=Ye,e.hover=X,e.initialEnd="initial-end",e.initialLoad="initial-load",e.inlineClick=ue,e.isDaylightSavingTime=pt,e.isIPadDevice=dt,e.isMobile=ht,e.lastDateOfMonth=ze,e.moreEventsClick=U,e.navigating=J,e.noEvents=fe,e.popupClose=se,e.popupOpen=ae,e.print=Oe,e.removeChildren=lt,e.renderCell=$,e.resetScrollbarWidth=at,e.resetTime=z,e.resizeStart=ce,e.resizeStop=de,e.resizing=he,e.resourceHeader=Te,e.scroll=Ae,e.scrollUiUpdate=Me,e.select=G,e.setTime=Ge,e.timezoneData=na,e.tooltipOpen=Ce,e.uiUpdate=ke,e.virtualScroll=Ie,e.virtualScrollStart=me,e.virtualScrollStop=ve,Object.defineProperty(e,"__esModule",{value:!0})});
|
|
10
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-popups"),require("@syncfusion/ej2-navigations"),require("@syncfusion/ej2-calendars"),require("@syncfusion/ej2-data"),require("@syncfusion/ej2-buttons"),require("@syncfusion/ej2-inputs"),require("@syncfusion/ej2-dropdowns"),require("@syncfusion/ej2-lists"),require("@syncfusion/ej2-excel-export")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-popups","@syncfusion/ej2-navigations","@syncfusion/ej2-calendars","@syncfusion/ej2-data","@syncfusion/ej2-buttons","@syncfusion/ej2-inputs","@syncfusion/ej2-dropdowns","@syncfusion/ej2-lists","@syncfusion/ej2-excel-export"],t):t((e=e||self).ej={},e.ej2Base,e.ej2Popups,e.ej2Navigations,e.ej2Calendars,e.ej2Data,e.ej2Buttons,e.ej2Inputs,e.ej2Dropdowns,e.ej2Lists,e.ej2ExcelExport)}(this,function(e,B,M,k,R,p,H,P,j,N,L){"use strict";var q="cellClick",F="cellDoubleClick",U="moreEventsClick",G="select",X="hover",Q="actionBegin",K="actionComplete",Z="actionFailure",J="navigating",$="renderCell",ee="eventClick",te="eventDoubleClick",ie="eventRendered",ne="dataBinding",re="dataBound",ae="popupOpen",se="popupClose",oe="dragStart",le="drag",pe="dragStop",ce="resizeStart",he="resizing",de="resizeStop",ue="inlineClick",ge="cellSelect",me="virtualScrollStart",ve="virtualScrollStop",fe="noEvents",ye="agendaCells",Te="resourceHeader",we="dateHeader",De="beforePaste",be="beforePrint",Se="excelExport",Ce="tooltipOpen",Oe="print",Ee="data-ready",xe="events-loaded",Ve="content-ready",Ae="scroll",Ie="virtual-scroll",Me="scroll-ui-update",ke="ui-update",Re="document-click",He="document-paste",Pe="cell-mouse-down",W=864e5,je=6e4;function Ne(e,t,i){t=B.createElement("div",{className:t}).cloneNode();return t.style.visibility="hidden",t.style.position="absolute",e.appendChild(t),e=gt(t,i),B.remove(t),e}function Le(e,t,i){t=B.createElement("div",{className:t}).cloneNode();return t.style.visibility="hidden",t.style.position="absolute",e.appendChild(t),e=ut(t,i),B.remove(t),e}function qe(e){e=getComputedStyle(e);return window.WebKitCSSMatrix?new WebKitCSSMatrix(e.webkitTransform).m42:0}function Fe(e){e=getComputedStyle(e);return window.WebKitCSSMatrix?new WebKitCSSMatrix(e.webkitTransform).m41:0}function Ue(e,t){e=new Date(e.getTime());return t=(t-e.getDay()-7)%7,new Date(e.setDate(e.getDate()+(isNaN(t)?0:t)))}function Be(e,t){e=Ue(e,t),t=new Date(e.getFullYear(),e.getMonth(),e.getDate()+6);return new Date(t.getTime())}function We(e){return new Date(e.getFullYear(),e.getMonth(),1)}function ze(e){return new Date(e.getFullYear(),e.getMonth()+1,0)}function Ye(e){var t=new Date(e.getFullYear(),0,1).valueOf(),e=new Date(e.getFullYear(),e.getMonth(),e.getDate()).valueOf();return Math.ceil((e-t+W)/W/7)}function _e(e,t){return new Date(t.valueOf()-(t.valueOf()-e.valueOf())/2)}function Ge(e,t){var i=e.getTimezoneOffset(),t=new Date(e.getTime()+t),i=t.getTimezoneOffset()-i;return e.setTime(t.getTime()+i*je),e}function z(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function Xe(e){var t=new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0).getTimezoneOffset(),t=e.getTimezoneOffset()-t;return e.getTime()-new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0).getTime()-60*t*1e3}function Qe(e,t){return Math.ceil((t.getTime()-e.getTime())/W)}function Y(e,t){return e=new Date(""+e),new Date(e.setDate(e.getDate()+t))}function Ke(e,t){var i=(e=new Date(""+e)).getDate();return e.setDate(1),e.setMonth(e.getMonth()+t),e.setDate(Math.min(i,$e(e))),e}function Ze(e,t){var i=(e=new Date(""+e)).getDate();return e.setDate(1),e.setFullYear(e.getFullYear()+t),e.setDate(Math.min(i,$e(e))),e}function Je(e,t,i){var n=new Date(e.getTime()),t=(n.setHours(t.getHours()),n.setMinutes(t.getMinutes()),n.setSeconds(t.getSeconds()),new Date(e.getTime()));return 0===i.getHours()?t=Y(t,1):(t.setHours(i.getHours()),t.setMinutes(i.getMinutes()),t.setSeconds(i.getSeconds())),{startHour:n,endHour:t}}function $e(e){return ze(e).getDate()}function et(e,t){e=z(new Date(e)),t=z(new Date(t));return Math.round((t.getTime()-e.getTime())/W)}function tt(e){return-1!==e.indexOf("Date")?new Date(parseInt(e.match(/\d+/g).toString(),10)):-1!==e.indexOf("T")?new Date(e):new Date(e.replace(/-/g,"/"))}var it=null,nt=null;function rt(){if(null!==it)return it;null===nt&&(nt=window.devicePixelRatio||window.screen.availWidth/document.documentElement.clientWidth);var e=B.createElement("div"),t=(e.style.cssText="width:100px;height: 100px;overflow: scroll;position: absolute;top: -9999px;",document.body.appendChild(e),devicePixelRatio?"1.10"===devicePixelRatio.toFixed(2)||devicePixelRatio<=1?Math.ceil(devicePixelRatio%1):Math.floor(devicePixelRatio%1):0),t=e.offsetWidth-e.clientWidth-t|0;return document.body.removeChild(e),it=t}function at(){var e=window.devicePixelRatio||window.screen.availWidth/document.documentElement.clientWidth;nt&&nt!==e&&(it=null,nt=e)}function st(e,t,i,n,r){for(var a=0,s=e.length;a<s;a++)if(e[parseInt(a.toString(),10)][""+t]===i){if(!n)return a;var o=r.slice(-2)[0].field;if((n[""+o]instanceof Array?n[""+o]:[n[""+o]]).join(",").includes(e[parseInt(a.toString(),10)][r.slice(-1)[0].groupIDField]))return a}return-1}function ot(e){var t=getComputedStyle(e);return e.offsetHeight+(parseInt(t.marginTop,10)||0)+(parseInt(t.marginBottom,10)||0)}function lt(e){for(var t=0,i=[].slice.call(e.children);t<i.length;t++){var n=i[t];e.removeChild(n)}}function pt(e){var t=new Date(e.getFullYear(),0,1),i=new Date(e.getFullYear(),6,1);return e.getTimezoneOffset()<Math.max(t.getTimezoneOffset(),i.getTimezoneOffset())}function ct(e){var t=e.getFullYear(),i=e.getMonth(),n=e.getDate(),r=e.getHours(),a=e.getMinutes(),s=e.getSeconds(),e=e.getMilliseconds();return Date.UTC(t,i,n,r,a,s,e)}function ht(){return-1<window.navigator.userAgent.toLowerCase().indexOf("mobi")}function dt(){return-1<window.navigator.userAgent.toLowerCase().indexOf("ipad")}function y(e,t){return"multiple"===t?e=e.split(" ").map(function(e){return e.charAt(0).toLocaleUpperCase()+e.substring(1)}).join(" "):"single"===t&&("0"<=e[0]&&e[0]<="9"&&(t=e.match(/[a-zA-Z]/),e=B.isNullOrUndefined(t)?e:e.slice(0,t.index)+e[t.index].toLocaleUpperCase()+e.slice(t.index+1)),e=e[0].toLocaleUpperCase()+e.slice(1)),e}function ut(e,t){return t?e.offsetWidth:e.getBoundingClientRect().width}function gt(e,t){return t?e.offsetHeight:e.getBoundingClientRect().height}function mt(e,t){return t?e.offsetTop:e.getBoundingClientRect().top}var vt="e-schedule",ft="e-rtl",yt="e-device",Tt="e-adaptive",wt="e-multi-drag",Dt="e-icons",bt="e-enable",d="e-disable",St="e-table-container",Ct="e-schedule-table",w="e-all-day-cells",Ot="e-all-day-row",C="e-content-table",O="e-work-cells",Et="e-work-hours",xt="e-popup-open",Vt="e-date-header-wrap",At="e-date-header-container",It="e-header-cells",Mt="e-work-days",E="e-other-month",kt="e-current-day",Rt="e-current-date",Ht="e-current-panel",Pt="e-previous-panel",jt="e-next-panel",Nt="e-translate",Lt="e-left-indent",qt="e-left-indent-wrap",Ft="e-event-table",Ut="e-resource-group-cells",Bt="e-resource-text",Wt="e-resource-column-wrap",zt="e-resource-column-table",Yt="e-child-node",_t="e-parent-node",Gt="e-resource-expand",Xt="e-resource-collapse",Qt="e-resource-tree-icon",Kt="e-resource-cells",Zt="e-time-cells-wrap",Jt="e-time-cells",$t="e-time-slots",ei="e-alternate-cells",ti="e-current-time",ii="e-current-timeline",ni="e-previous-timeline",ri="e-hide-childs",ai="e-scroll-container",si="e-timeline-wrapper",x="e-appointment-wrapper",oi="e-appointment-wrapper-hidden",li="e-day-wrapper",pi="e-schedule-resource-toolbar-container",ci="e-schedule-toolbar",hi="e-schedule-resource-toolbar",di="e-selected-cell",ui="e-week-number-wrapper",gi="e-week-number",mi="e-appointment-wrap",vi="e-wrapper-container",fi="e-appointment-container",V="e-appointment",yi="e-block-appointment",Ti="e-block-indicator",wi="e-appointment-border",Di="e-appointment-details",bi="e-subject-wrap",Si="e-resource-name",Ci="e-time",Oi="e-table-wrap",Ei="e-outer-table",A="e-content-wrap",xi="e-virtual-track",Vi="e-agenda-cells",Ai="e-current-day",Ii="e-active-appointment-agenda",Mi="e-month-header",ki="e-day-date-header",Ri="e-date-column",Hi="e-navigate",Pi="e-date-header",ji="e-day-border",Ni="e-date-time",Li="e-no-event",qi="e-appointment-indicator",Fi="e-indicator",Ui="e-left-icon",Bi="e-right-icon",Wi="e-event-action",zi="e-new-event",Yi="e-schedule-event-clone",_i="e-clone-time-indicator",Gi="e-drag-clone",Xi="e-event-resize",Qi="e-resize-clone",Ki="e-left-handler",Zi="e-right-handler",Ji="e-top-handler",$i="e-bottom-handler",en="e-recurrence-icon",tn="e-recurrence-edit-icon",nn="e-header-row",rn="e-all-day-appointment-wrapper",an="e-all-day-appointment",sn="e-appointment-hide",on="e-row-count-wrapper",ln="e-all-day-appointment-section",pn="e-appointment-expand",cn="e-appointment-collapse",hn="e-more-indicator",dn="e-cell-popup",un="e-event-popup",gn="e-popup-header",mn="e-header-icon-wrapper",vn="e-popup-footer",fn="e-date-time-details",yn="e-event-details",Tn="e-event-create",wn="e-event-edit",Dn="e-event-delete",bn="e-text-ellipsis",Sn="e-more-popup-wrapper",Cn="e-more-event-popup",On="e-more-event-date-header",En="e-header-day",xn="e-header-date",Vn="e-more-event-close",An="e-more-event-content",In="e-more-appointment-wrapper",Mn="e-quick-dialog",kn="e-quick-dialog-occurrence-event",Rn="e-quick-dialog-series-event",Hn="e-quick-dialog-following-events",Pn="e-following-events-dialog",jn="e-quick-dialog-delete",Nn="e-quick-dialog-cancel",Ln="e-quick-alertok",qn="e-quick-alertcancel",Fn="e-quick-alertfollowing",Un="e-quick-dialog-alert-btn",Bn="e-schedule-dialog",Wn="e-schedule-form",zn="e-all-day",Yn="e-time-zone",_n="e-repeat",Gn="e-subject",Xn="e-location",Qn="e-location-details",Kn="e-start",Zn="e-end",Jn="e-description",$n="e-description-details",er="e-time-zone-row",tr="e-start-time-zone",ir="e-end-time-zone",nr="e-save-icon",rr="e-event-cancel",ar="e-event-save",sr="e-title-text",or="e-icon-disable",lr="e-edit",pr="e-edit-icon",cr="e-delete",hr="e-delete-icon",dr="e-close",ur="e-close-icon",gr="e-schedule-error",mr="e-tooltip-hidden",vr="e-animate",fr="e-hidden",yr="e-disable-dates",Tr="e-quick-popup-wrapper",wr="e-resource-menu",Dr="e-icon-menu",br="e-resource-level-title",Sr="e-resource-tree-popup-overlay",Cr="e-resource-tree-popup",Or="e-resource",Er="e-resource-icon",xr="e-resource-details",Vr="e-date-time-icon",Ar="e-virtual-scroll",Ir="e-icon-disable",Mr="e-auto-height",kr="e-ignore-whitespace",Rr="e-read-only",Hr="e-month-header-wrapper",Pr="e-inline-subject",jr="e-inline-appointment",Nr="e-inline-edit",Lr="e-scroll-hidden",qr="e-all-day-scroll",Fr="e-all-day-auto",Ur=function(){return(Ur=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},Br=(t.prototype.addEventListener=function(){this.parent.on(Re,this.closeHeaderPopup,this)},t.prototype.removeEventListener=function(){this.parent.off(Re,this.closeHeaderPopup)},t.prototype.closeHeaderPopup=function(e){var t,i=B.closest(e.event.target,".e-date-range,.e-header-popup,.e-day,.e-selected"),e=B.closest(e.event.target,".e-hor-nav,.e-toolbar-pop"),n=this.parent.element.querySelector("."+A),r=this.parent.element.querySelector(".e-toolbar-pop");this.parent.isAdaptive&&(B.isNullOrUndefined(e)||!e.classList.contains("e-toolbar-pop")&&!e.classList.contains("e-hor-nav")||e.classList.contains("e-hor-nav")&&r&&r.classList.contains(xt)?(B.removeClass([n],Lr),r=this.element.querySelector(".e-toolbar-pop"),B.isNullOrUndefined(r)||!(t=r.ej2_instances[0])||!B.isNullOrUndefined(e)&&e.classList.contains("e-hor-nav")&&r.classList.contains(xt)||t.hide()):B.addClass([n],Lr)),B.isNullOrUndefined(i)&&this.hideHeaderPopup()},t.prototype.hideHeaderPopup=function(){this.headerPopup&&this.headerPopup.hide()},t.prototype.renderHeader=function(){this.element=B.createElement("div",{className:"e-schedule-toolbar-container"});var e=B.createElement("div",{className:ci});this.element.appendChild(e),this.parent.element.insertBefore(this.element,this.parent.element.firstElementChild),this.renderToolbar()},t.prototype.renderToolbar=function(){var t=this,e=this.parent.toolbarItems&&0<this.parent.toolbarItems.length?this.getToolbarItems():this.getItems();this.parent.trigger(Q,{requestType:"toolbarItemRendering",items:e},function(e){t.toolbarObj=new k.Toolbar({items:e.items,overflowMode:"Popup",clicked:t.toolbarClickHandler.bind(t),created:t.toolbarCreateHandler.bind(t),enableRtl:t.parent.enableRtl,enableHtmlSanitizer:t.parent.enableHtmlSanitizer,locale:t.parent.locale}),t.toolbarObj.isStringTemplate=!0,t.toolbarObj.root=t.parent.root||t.parent,t.toolbarObj.appendTo(t.parent.element.querySelector("."+ci)),t.toolbarObj.element.setAttribute("aria-label","Scheduler");e=t.toolbarObj.element.querySelector(".e-prev"),e&&e.firstElementChild.setAttribute("title",t.l10n.getConstant("previous")),e=t.toolbarObj.element.querySelector(".e-next");e&&e.firstElementChild.setAttribute("title",t.l10n.getConstant("next")),t.updateAddIcon(),t.updateActiveView(),t.parent.trigger(K,{requestType:"toolBarItemRendered",items:t.toolbarObj.items})})},t.prototype.updateItems=function(){var e,t=this;this.toolbarObj&&(e=this.getItems(),this.parent.trigger(Q,{requestType:"toolbarItemRendering",items:e},function(e){t.toolbarObj.items=e.items,t.toolbarObj.dataBind(),t.parent.trigger(K,{requestType:"toolBarItemRendered",items:t.toolbarObj.items})}))},t.prototype.getPopUpRelativeElement=function(){return this.parent.isAdaptive?this.toolbarObj.element:this.element.querySelector(".e-date-range")},t.prototype.setDayOfWeek=function(e){this.headerCalendar&&(this.headerCalendar.firstDayOfWeek=e,this.headerCalendar.dataBind())},t.prototype.setCalendarDate=function(e){this.headerCalendar&&(this.headerCalendar.value=e,this.headerCalendar.dataBind())},t.prototype.setCalendarMinMaxDate=function(){this.headerCalendar&&(this.headerCalendar.min=this.parent.minDate,this.headerCalendar.max=this.parent.maxDate,this.headerCalendar.dataBind())},t.prototype.getCalendarView=function(){return-1<["Month","MonthAgenda","TimelineMonth"].indexOf(this.parent.currentView)?"Year":-1<["Year","TimelineYear"].indexOf(this.parent.currentView)?"Decade":"Month"},t.prototype.setCalendarView=function(){var e;this.headerCalendar&&(e=this.getCalendarView(),this.headerCalendar.depth=e,this.headerCalendar.start=e,this.headerCalendar.refresh())},t.prototype.updateActiveView=function(){var e=[].slice.call(this.toolbarObj.element.querySelectorAll(".e-views"));B.removeClass(e,["e-active-view"]),0<e.length&&e[this.parent.viewIndex]&&B.addClass([e[this.parent.viewIndex]],["e-active-view"])},t.prototype.updateDateRange=function(e){var t,i,n,r=this.toolbarObj.element.querySelector(".e-date-range");r&&(r.firstElementChild.setAttribute("aria-haspopup","true"),t=r.querySelector(".e-tbar-btn-text"),this.parent.activeViewOptions.dateRangeTemplate?(t.textContent="",i={startDate:this.parent.activeView.getStartDate(),endDate:this.parent.activeView.getEndDate(),currentView:this.parent.currentView},n=this.parent.activeViewOptions.dateRangeTemplateName,n=this.parent.element.id+"_"+n+"dateRangeTemplate",i=[].slice.call(this.parent.getDateRangeTemplate()(i,this.parent,"dateRangeTemplate",n,!1,void 0,void 0,this.parent.root)),B.append(i,t)):(n=this.parent.activeView.getDateRangeText(e),r.firstElementChild.setAttribute("aria-label",n),t.textContent=n),this.refresh())},t.prototype.refresh=function(){this.toolbarObj&&this.toolbarObj.refreshOverflow()},t.prototype.updateAddIcon=function(){var e=this.toolbarObj.element.querySelector(".e-add");e&&(this.parent.eventSettings.allowAdding?B.removeClass([e],fr):B.addClass([e],fr))},t.prototype.getDateRangeText=function(){return y(this.parent.globalize.formatDate(this.parent.selectedDate,{format:"MMMM y",calendar:this.parent.getCalendarMode()}),"single")},t.prototype.getItemModel=function(e){var t={};return e.id&&(t.id=e.id),e.text&&(t.text=e.text),e.tooltipText&&(t.tooltipText=e.tooltipText),e.prefixIcon&&(t.prefixIcon=e.prefixIcon),e.cssClass&&(t.cssClass=e.cssClass),"Both"!==e.showTextOn&&(t.showTextOn=e.showTextOn),e.template&&(t.template=e.template),e.disabled&&(t.disabled=e.disabled),"auto"!==e.width&&(t.width=e.width),e.suffixIcon&&(t.suffixIcon=e.suffixIcon),"Left"!==e.align&&(t.align=e.align),"None"!==e.overflow&&(t.overflow=e.overflow),e.htmlAttributes&&(t.htmlAttributes=e.htmlAttributes),"Button"!==e.type&&(t.type=e.type),!0!==e.visible&&(t.visible=e.visible),e.showAlwaysInPopup&&(t.showAlwaysInPopup=e.showAlwaysInPopup),-1!==e.tabIndex&&(t.tabIndex=e.tabIndex),t},t.prototype.getToolbarItems=function(){for(var e=[],t=0,i=this.parent.toolbarItems;t<i.length;t++){var n=i[t],r=this.getItemModel(n),a=void 0;if(n.name)switch(n.name){case"Today":(a={showAlwaysInPopup:this.parent.isAdaptive||this.parent.enableAdaptiveUI,prefixIcon:"e-icon-today",text:this.l10n.getConstant("today"),cssClass:"e-today",overflow:"Show"}).align=r.align||n.align,e.push(Ur({},a,r));break;case"Previous":(a={prefixIcon:"e-icon-prev",tooltipText:"Previous",overflow:"Show",cssClass:"e-prev",htmlAttributes:{role:"navigation"}}).align=r.align||n.align,e.push(Ur({},a,r));break;case"Next":(a={prefixIcon:"e-icon-next",tooltipText:"Next",overflow:"Show",cssClass:"e-next",htmlAttributes:{role:"navigation"}}).align=r.align||n.align,e.push(Ur({},a,r));break;case"DateRangeText":(a={text:this.getDateRangeText(),suffixIcon:"e-icon-down-arrow",cssClass:"e-date-range",overflow:"Show",htmlAttributes:{"aria-atomic":"true","aria-live":"assertive",role:"navigation"}}).align=r.align||n.align,e.push(Ur({},a,r));break;case"NewEvent":(a={showAlwaysInPopup:this.parent.isAdaptive||this.parent.enableAdaptiveUI,prefixIcon:"e-icon-add",text:this.l10n.getConstant("newEvent"),cssClass:"e-add",overflow:"Show"}).align=r.align||n.align,e.push(Ur({},a,r));break;case"Views":if(!B.isNullOrUndefined(this.parent.views)&&1<this.parent.views.length)for(var s=0,o=this.parent.views;s<o.length;s++){var l=o[s];(a=this.getItemObject(l)).align=r.align||n.align,e.push(Ur({},a,r))}break;case"Custom":e.push(n)}else e.push(n)}return e},t.prototype.getItems=function(){var e=[];if(e.push({align:"Left",prefixIcon:"e-icon-prev",tooltipText:"Previous",overflow:"Show",cssClass:"e-prev"}),e.push({align:"Left",prefixIcon:"e-icon-next",tooltipText:"Next",overflow:"Show",cssClass:"e-next"}),e.push({align:"Left",text:this.getDateRangeText(),suffixIcon:"e-icon-down-arrow",cssClass:"e-date-range",overflow:"Show",htmlAttributes:{"aria-atomic":"true","aria-live":"assertive"}}),this.parent.isAdaptive||this.parent.enableAdaptiveUI?(e.push({align:"Right",showAlwaysInPopup:this.parent.isAdaptive||this.parent.enableAdaptiveUI,prefixIcon:"e-icon-add",text:this.l10n.getConstant("newEvent"),cssClass:"e-add",overflow:"Show"}),e.push({align:"Right",showAlwaysInPopup:this.parent.isAdaptive||this.parent.enableAdaptiveUI,prefixIcon:"e-icon-today",text:this.l10n.getConstant("today"),cssClass:"e-today",overflow:"Show"})):(e.push({align:"Right",showAlwaysInPopup:this.parent.isAdaptive||this.parent.enableAdaptiveUI,prefixIcon:"e-icon-today",text:this.l10n.getConstant("today"),cssClass:"e-today",overflow:"Show"}),!B.isNullOrUndefined(this.parent.views)&&1<this.parent.views.length&&e.push({align:"Right",type:"Separator",cssClass:"e-schedule-seperator"})),!B.isNullOrUndefined(this.parent.views)&&1<this.parent.views.length)for(var t=0,i=this.parent.views;t<i.length;t++){var n=i[t];e.push(this.getItemObject(n))}return e},t.prototype.getItemObject=function(e){var t,i,n="string"==typeof e?(t=e.toLowerCase(),null):(t=e.option.toLowerCase(),e.displayName),r=this.parent.isAdaptive||this.parent.enableAdaptiveUI;switch(t){case"day":i={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-day",text:n||this.l10n.getConstant("day"),cssClass:"e-views e-day"};break;case"week":i={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-week",text:n||this.l10n.getConstant("week"),cssClass:"e-views e-week"};break;case"workweek":i={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-workweek",text:n||this.l10n.getConstant("workWeek"),cssClass:"e-views e-work-week"};break;case"month":i={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-month",text:n||this.l10n.getConstant("month"),cssClass:"e-views e-month"};break;case"year":i={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-year",text:n||this.l10n.getConstant("year"),cssClass:"e-views e-year"};break;case"agenda":i={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-agenda",text:n||this.l10n.getConstant("agenda"),cssClass:"e-views e-agenda"};break;case"monthagenda":i={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-month-agenda",text:n||this.l10n.getConstant("monthAgenda"),cssClass:"e-views e-month-agenda"};break;case"timelineday":i={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-timeline-day",text:n||this.l10n.getConstant("timelineDay"),cssClass:"e-views e-timeline-day"};break;case"timelineweek":i={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-timeline-week",text:n||this.l10n.getConstant("timelineWeek"),cssClass:"e-views e-timeline-week"};break;case"timelineworkweek":i={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-timeline-workweek",text:n||this.l10n.getConstant("timelineWorkWeek"),cssClass:"e-views e-timeline-work-week"};break;case"timelinemonth":i={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-timeline-month",text:n||this.l10n.getConstant("timelineMonth"),cssClass:"e-views e-timeline-month"};break;case"timelineyear":i={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-timeline-year-"+("Vertical"===e.orientation?"vertical":"horizontal"),text:n||this.l10n.getConstant("timelineYear"),cssClass:"e-views e-timeline-year"}}return i},t.prototype.renderHeaderPopup=function(){var e=B.createElement("div",{className:"e-header-popup"}),t=B.createElement("div",{className:"e-header-calendar"}),e=(e.appendChild(t),this.element.appendChild(e),this.headerPopup=new M.Popup(e,{actionOnScroll:"hide",targetType:"relative",relateTo:this.getPopUpRelativeElement(),position:{X:"left",Y:"bottom"},collision:{X:"fit"},viewPortElement:this.element,enableRtl:this.parent.enableRtl}),this.getCalendarView()),i="Month"===this.parent.currentView&&!B.isNullOrUndefined(this.parent.activeViewOptions.displayDate)&&!this.hasSelectedDate();this.headerCalendar=new R.Calendar({value:i?this.parent.activeViewOptions.displayDate:this.parent.selectedDate,min:this.parent.minDate,max:this.parent.maxDate,firstDayOfWeek:this.parent.activeViewOptions.firstDayOfWeek,weekNumber:this.parent.activeViewOptions.showWeekNumber,enableRtl:this.parent.enableRtl,locale:this.parent.locale,depth:e,start:e,calendarMode:this.parent.calendarMode,change:this.calendarChange.bind(this)}),this.setCalendarTimezone(),this.headerCalendar.appendTo(t),this.headerPopup.hide()},t.prototype.calendarChange=function(e){e.value.getTime()!==this.parent.selectedDate.getTime()&&(e=z(new Date(e.value)),this.parent.changeDate(e)),this.headerPopup.hide()},t.prototype.setCalendarTimezone=function(){this.headerCalendar&&(this.headerCalendar.timezone=this.parent.timezone||this.parent.tzModule.getLocalTimezoneName())},t.prototype.calculateViewIndex=function(e){e=B.closest(e.originalEvent.target,".e-views");return[].slice.call(this.element.querySelectorAll(".e-views")).indexOf(e)},t.prototype.toolbarCreateHandler=function(){this.parent&&this.parent.portals&&this.toolbarObj&&this.toolbarObj.portals&&(this.parent.portals=this.parent.portals.concat(this.toolbarObj.portals),this.parent.renderReactTemplates())},t.prototype.toolbarClickHandler=function(e){if(e.item){var t;switch(e.item.cssClass.replace("e-views ","")){case"e-date-range":this.headerPopup||this.renderHeaderPopup(),this.headerPopup.element.classList.contains(xt)?this.headerPopup.hide():this.headerPopup.show();break;case"e-day":this.parent.changeView("Day",e.originalEvent,void 0,this.calculateViewIndex(e));break;case"e-week":this.parent.changeView("Week",e.originalEvent,void 0,this.calculateViewIndex(e));break;case"e-work-week":this.parent.changeView("WorkWeek",e.originalEvent,void 0,this.calculateViewIndex(e));break;case"e-month":this.parent.changeView("Month",e.originalEvent,void 0,this.calculateViewIndex(e));break;case"e-year":this.parent.changeView("Year",e.originalEvent,void 0,this.calculateViewIndex(e));break;case"e-agenda":this.parent.changeView("Agenda",e.originalEvent,void 0,this.calculateViewIndex(e));break;case"e-month-agenda":this.parent.changeView("MonthAgenda",e.originalEvent,void 0,this.calculateViewIndex(e));break;case"e-timeline-day":this.parent.changeView("TimelineDay",e.originalEvent,void 0,this.calculateViewIndex(e));break;case"e-timeline-week":this.parent.changeView("TimelineWeek",e.originalEvent,void 0,this.calculateViewIndex(e));break;case"e-timeline-work-week":this.parent.changeView("TimelineWorkWeek",e.originalEvent,void 0,this.calculateViewIndex(e));break;case"e-timeline-month":this.parent.changeView("TimelineMonth",e.originalEvent,void 0,this.calculateViewIndex(e));break;case"e-timeline-year":this.parent.changeView("TimelineYear",e.originalEvent,void 0,this.calculateViewIndex(e));break;case"e-today":r=z(this.parent.getCurrentTime()),("Agenda"===this.parent.currentView||"MonthAgenda"===this.parent.currentView||!this.parent.isSelectedDate(r)||"Month"===this.parent.currentView&&this.parent.activeViewOptions.displayDate&&!this.hasSelectedDate()&&z(this.parent.activeViewOptions.displayDate)!==r||"Month"===this.parent.currentView&&0<this.parent.activeViewOptions.numberOfWeeks&&!this.hasSelectedDate()&&z(We(this.parent.selectedDate))!==r)&&this.parent.changeDate(r,e.originalEvent);break;case"e-prev":this.parent.changeDate(this.parent.activeView.getNextPreviousDate("Previous"),e.originalEvent);break;case"e-next":this.parent.changeDate(this.parent.activeView.getNextPreviousDate("Next"),e.originalEvent);break;case"e-add":var i,n,r=this.parent.activeCellsData.startTime.getTime()===this.parent.activeCellsData.endTime.getTime();r=this.parent.activeCellsData&&!r?this.parent.activeCellsData:(r=this.parent.activeViewOptions.timeScale.interval,i=this.parent.activeViewOptions.timeScale.slotCount,r=r*je/i,i=new Date(this.parent.selectedDate.getTime()),n=this.parent.getCurrentTime(),i.setHours(n.getHours(),Math.round(i.getMinutes()/r)*r,0),n=new Date(new Date(i.getTime()).setMilliseconds(i.getMilliseconds()+r)),{startTime:i,endTime:n,isAllDay:!1}),this.parent.eventWindow.openEditor(B.extend(r,{cancel:!1,event:e.originalEvent}),"Add")}B.isNullOrUndefined(this.toolbarObj)||(t=this.toolbarObj.element.querySelector(".e-toolbar-pop"))&&"Input"!==e.item.type&&t.ej2_instances[0].hide({name:"SlideUp",duration:100})}},t.prototype.hasSelectedDate=function(){var e=z(this.parent.selectedDate).getTime();return e>=this.parent.activeView.getStartDate().getTime()&&e<=this.parent.activeView.getEndDate().getTime()},t.prototype.getHeaderElement=function(){return this.toolbarObj.element},t.prototype.updateHeaderItems=function(e){var t=this.toolbarObj.element.querySelector(".e-prev"),i=this.toolbarObj.element.querySelector(".e-next"),n=this.toolbarObj.element.querySelector(".e-date-range");t&&("add"===e?B.addClass([t],fr):B.removeClass([t],fr)),i&&("add"===e?B.addClass([i],fr):B.removeClass([i],fr)),n&&("add"===e?B.addClass([n],bn):B.removeClass([n],bn))},t.prototype.previousNextIconHandler=function(){var e,t="Agenda"===this.parent.currentView?[this.parent.getCurrentViewDates()[0]]:this.parent.getCurrentViewDates(),i=this.toolbarObj.element.querySelector(".e-prev"),n=this.toolbarObj.element.querySelector(".e-next"),r=new Date(t[0].getTime()),t=new Date(t[t.length-1].getTime());"WorkWeek"===this.parent.currentView||"TimelineWorkWeek"===this.parent.currentView?t=Y(r=Ue(z(this.parent.selectedDate),this.parent.activeViewOptions.firstDayOfWeek),7*this.parent.activeViewOptions.interval):"Month"===this.parent.currentView&&(r=(e=!B.isNullOrUndefined(this.parent.activeViewOptions.displayDate)||0<this.parent.activeViewOptions.numberOfWeeks)?this.parent.activeView.getStartDate():We(this.parent.selectedDate),t=e?this.parent.activeView.getEndDate():ze(Ke(r,this.parent.activeViewOptions.interval-1))),B.isNullOrUndefined(i)||this.toolbarObj.enableItems(i,r>z(this.parent.minDate)),B.isNullOrUndefined(n)||this.toolbarObj.enableItems(n,t<z(this.parent.maxDate)),this.setCalendarMinMaxDate()},t.prototype.getModuleName=function(){return"headerbar"},t.prototype.destroy=function(){this.headerPopup&&!this.headerPopup.isDestroyed&&(this.headerPopup.destroy(),this.headerPopup=null),this.headerCalendar&&!this.headerCalendar.isDestroyed&&(this.headerCalendar.destroy(),this.headerCalendar=null),this.toolbarObj&&!this.toolbarObj.isDestroyed&&(this.toolbarObj.destroy(),this.removeEventListener(),B.remove(this.element),this.toolbarObj=null),this.element=null,this.parent=null,this.l10n=null},t);function t(e){this.parent=e,this.l10n=this.parent.localeObj,this.renderHeader(),this.addEventListener()}zr.prototype.getModuleName=function(){return"scroll"},zr.prototype.setWidth=function(){this.parent.element.style.width=B.formatUnit(this.parent.width)},zr.prototype.setHeight=function(){this.parent.element.style.height=B.formatUnit(this.parent.height)},zr.prototype.addEventListener=function(){this.parent.on(Ve,this.setDimensions,this),this.parent.on(ke,this.onPropertyChanged,this)},zr.prototype.removeEventListener=function(){this.parent.off(Ve,this.setDimensions),this.parent.off(ke,this.onPropertyChanged)},zr.prototype.setDimensions=function(){this.setWidth(),this.setHeight();var e={cssProperties:this.parent.getCssProperties(),module:this.getModuleName()};this.parent.notify(Me,e)},zr.prototype.onPropertyChanged=function(){this.setDimensions()},zr.prototype.destroy=function(){this.removeEventListener()};var Wr=zr;function zr(e){this.parent=e,this.addEventListener()}_r.prototype.scrollHandler=function(e){B.isNullOrUndefined(this.parent.eventTooltip)||this.parent.eventTooltip.close();var t,i=!this.parent.isAdaptive&&e.originalEvent&&e.originalEvent.target&&!B.isNullOrUndefined(B.closest(e.originalEvent.target,"."+V));if(this.parent.uiStateValues.isTouchScroll=i&&"touchmove"===e.originalEvent.type&&!this.parent.uiStateValues.action,!i&&"Agenda"!==this.parent.currentView&&!this.parent.uiStateValues.action&&this.parent.allowSwiping&&!this.parent.uiStateValues.isTapHold){if(this.parent.uiStateValues.isSwipeScroll=!0,this.timeStampStart||(this.timeStampStart=Date.now()),this.element.classList.contains(Nt)&&this.onTransitionEnd(),"Left"===e.scrollDirection||"Right"===e.scrollDirection){var i={requestType:"dateNavigate",cancel:!1,event:e.originalEvent};if(this.parent.trigger(Q,i),i.cancel)return;i=this.element.querySelector("."+A);if(i&&i.scrollWidth>i.clientWidth)return;this.isScrollTriggered=!0,e.originalEvent.preventDefault(),e.originalEvent.stopPropagation()}e.scrollDirection===this.touchLeftDirection?(this.nextPanel||(this.renderPanel(jt,"Next"),this.nextPanel={element:this.parent.activeView.getPanel(),selectedDate:new Date(this.parent.selectedDate.getTime()),renderDates:this.parent.activeView.renderDates,colLevels:this.parent.activeView.colLevels},this.setDimensions(this.nextPanel.element)),t=this.parent.enableRtl?e.distanceX:-e.distanceX,this.element.style.transform="translatex("+(this.getTranslateX(this.element)+t)+"px)"):e.scrollDirection===this.touchRightDirection&&(i=0,this.previousPanel||(this.renderPanel(Pt,"Previous"),this.previousPanel={element:this.parent.activeView.getPanel(),selectedDate:new Date(this.parent.selectedDate.getTime()),renderDates:this.parent.activeView.renderDates,colLevels:this.parent.activeView.colLevels},this.setDimensions(this.previousPanel.element),i=this.previousPanel.element.offsetWidth),t=this.parent.enableRtl?i-e.distanceX:-i+e.distanceX,this.element.style.transform="translatex("+(this.getTranslateX(this.element)+t)+"px)")}},_r.prototype.swipeHandler=function(e){var t,i;this.isScrollTriggered&&!this.parent.uiStateValues.action&&this.parent.allowSwiping&&!this.parent.uiStateValues.isTapHold&&(this.isScrollTriggered=!1,t=("Left"===e.swipeDirection?this.parent.activeView.renderDates:this.parent.activeView.renderDates.slice(-1))[0],"Left"===e.swipeDirection&&t<this.parent.maxDate||"Right"===e.swipeDirection&&t>=this.parent.minDate?((t=Date.now()-this.timeStampStart)<(i=e.distanceX*(B.Browser.isDevice?6:1.66))||e.distanceX>this.parent.element.offsetWidth/2?(this.swapPanels(e.swipeDirection),t<i&&e.distanceX>this.parent.element.offsetWidth/2&&(this.element.style.transitionDuration=(B.Browser.isDevice?e.distanceX:i)/t/10+"s"),this.confirmSwipe(e.swipeDirection)):this.cancelSwipe(),i={requestType:"dateNavigate",cancel:!1,event:e.originalEvent},this.parent.trigger(K,i)):this.cancelSwipe(),this.timeStampStart=null)},_r.prototype.tapHoldHandler=function(e){var t=B.closest(e.originalEvent.target,"."+V);B.isNullOrUndefined(t)||(this.parent.uiStateValues.isTapHold=!0,this.parent.isAdaptive?(B.Browser.isIos&&B.EventHandler.add(this.element,"touchend",this.preventEventClick,this),this.parent.quickPopup.tapHoldEventPopup(e.originalEvent),this.triggerResizeStart(e.originalEvent)):["Agenda","MonthAgenda","Year"].indexOf(this.parent.currentView)<0&&(this.parent.selectedElements=[],this.parent.eventBase.getSelectedEventElements(t),this.triggerResizeStart(e.originalEvent)))},_r.prototype.triggerResizeStart=function(e){this.parent.resizeModule&&B.closest(e.target,"."+Xi)&&this.parent.resizeModule.resizeStart(e)},_r.prototype.preventEventClick=function(e){e.preventDefault(),B.EventHandler.remove(this.element,"touchend",this.preventEventClick)},_r.prototype.renderPanel=function(e,t){this.currentPanel?this.parent.setProperties({selectedDate:this.currentPanel.selectedDate},!0):(this.currentPanel={element:this.parent.activeView.getPanel(),selectedDate:new Date(this.parent.selectedDate.getTime()),renderDates:this.parent.activeView.renderDates,colLevels:this.parent.activeView.colLevels},this.setDimensions(this.currentPanel.element)),this.parent.setProperties({selectedDate:this.parent.activeView.getNextPreviousDate(t)},!0),this.parent.headerModule&&this.parent.headerModule.setCalendarDate(this.parent.selectedDate),this.parent.activeView.getRenderDates(),this.parent.activeView.renderLayout(e)},_r.prototype.swapPanels=function(e){var t;e===this.touchLeftDirection?(t=this.nextPanel,this.nextPanel=this.currentPanel):(t=this.previousPanel,this.previousPanel=this.currentPanel),this.currentPanel=t},_r.prototype.confirmSwipe=function(t){var i=this,e={action:"date",cancel:!1,previousDate:(t===this.touchLeftDirection?this.nextPanel:this.previousPanel).selectedDate,currentDate:this.currentPanel.selectedDate};this.parent.trigger(J,e,function(e){e.cancel?(i.swapPanels(t),i.cancelSwipe()):(i.parent.activeView.setPanel(i.currentPanel.element),i.parent.setProperties({selectedDate:i.currentPanel.selectedDate},!0),e=void 0,e=i.parent.enableRtl?t===i.touchLeftDirection?i.previousPanel?i.previousPanel.element.offsetLeft:i.currentPanel.element.offsetWidth:0:t===i.touchLeftDirection?-i.currentPanel.element.offsetLeft:0,i.parent.activeView.renderDates=i.currentPanel.renderDates,i.parent.activeView.colLevels=i.currentPanel.colLevels,B.addClass([i.element],Nt),i.element.style.transform="translatex("+e+"px)",i.parent.headerModule&&i.parent.headerModule.updateDateRange(),i.parent.renderTemplates(),i.parent.crudModule.refreshDataManager())})},_r.prototype.cancelSwipe=function(){var i,n=this,e=(this.parent.activeView.setPanel(this.currentPanel.element),this.parent.setProperties({selectedDate:this.currentPanel.selectedDate},!0),this.parent.activeView.renderDates=this.currentPanel.renderDates,0<this.parent.activeViewOptions.group.resources.length&&0<this.parent.resourceBase.lastResourceLevel.length&&(i=this.parent.resourceBase.resourceCollection[0].workDaysField,this.parent.resourceBase.lastResourceLevel.forEach(function(e){var t;i?(t=e[i],t=Array.isArray(t)&&(!n.parent.showWeekend||"WorkWeek"===n.parent.currentView),e.renderDates=t?n.calculateResourceSpecificDates(e,i):n.currentPanel.renderDates):e.renderDates=n.currentPanel.renderDates})),this.parent.activeView.colLevels=this.currentPanel.colLevels,B.addClass([this.element],Nt),this.previousPanel?this.previousPanel.element.offsetWidth:0);this.element.style.transform="translatex("+(this.parent.enableRtl?e:-this.currentPanel.element.offsetLeft)+"px)"},_r.prototype.calculateResourceSpecificDates=function(e,t){var i=[],n=e[t];return this.currentPanel.renderDates.forEach(function(e){Array.isArray(n)&&-1!==n.indexOf(e.getDay())&&i.push(e)}),i},_r.prototype.onTransitionEnd=function(){(B.isNullOrUndefined(this.element)||this.element.classList.contains(Nt))&&(this.parent.uiStateValues.isSwipeScroll=!1,B.removeClass([this.element],Nt),this.element.style.transitionDuration="",this.element.style.transform="",this.previousPanel&&(B.remove(this.previousPanel.element),this.previousPanel=null,B.removeClass([this.currentPanel.element],Pt),B.addClass([this.currentPanel.element],Ht)),this.nextPanel&&(B.remove(this.nextPanel.element),this.nextPanel=null,B.removeClass([this.currentPanel.element],jt),B.addClass([this.currentPanel.element],Ht)),this.currentPanel=null,this.parent.activeView.getPanel().style.width="")},_r.prototype.getTranslateX=function(e){e=window.getComputedStyle(e);return new WebKitCSSMatrix(e.webkitTransform).m41},_r.prototype.setDimensions=function(e){e.style.width=this.parent.element.clientWidth+"px"},_r.prototype.resetValues=function(){this.currentPanel=null,this.previousPanel=null,this.nextPanel=null,this.timeStampStart=null,this.element.style.transform="",this.element.style.transitionDuration="",lt(this.element),B.removeClass([this.element],Nt)},_r.prototype.destroy=function(){this.touchObj&&(this.touchObj.destroy(),this.touchObj=null),B.EventHandler.remove(this.element,"transitionend",this.onTransitionEnd),this.resetValues()};var Yr=_r;function _r(e){this.parent=e,this.element=this.parent.element.querySelector("."+St),this.touchObj=new B.Touch(this.element,{scroll:this.scrollHandler.bind(this),swipe:this.swipeHandler.bind(this),tapHold:this.tapHoldHandler.bind(this),swipeSettings:{swipeThresholdDistance:1}}),B.EventHandler.add(this.element,"transitionend",this.onTransitionEnd,this),this.touchLeftDirection=this.parent.enableRtl?"Right":"Left",this.touchRightDirection=this.parent.enableRtl?"Left":"Right"}var Gr=function(){return(Gr=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},Xr=(i.prototype.keyActionHandler=function(e){var t=e.target;if(!("home"===e.action&&t&&-1<["INPUT","TEXTAREA","SELECT"].indexOf(t.tagName)&&t.closest(".e-quick-popup-wrapper")))switch(e.action){case"downArrow":case"shiftDownArrow":this.processDown(e,e.shiftKey);break;case"upArrow":case"shiftUpArrow":this.processUp(e,e.shiftKey);break;case"leftArrow":case"shiftLeftArrow":this.processLeft(e,e.shiftKey);break;case"rightArrow":case"shiftRightArrow":this.processRight(e,e.shiftKey);break;case"ctrlLeftArrow":this.parent.changeDate(this.parent.activeView.getNextPreviousDate("Previous"),e),this.parent.headerModule&&this.parent.headerModule.element.querySelector(".e-prev button").focus();break;case"ctrlRightArrow":this.parent.changeDate(this.parent.activeView.getNextPreviousDate("Next"),e),this.parent.headerModule&&this.parent.headerModule.element.querySelector(".e-next button").focus();break;case"altOne":case"altTwo":case"altThree":case"altFour":case"altFive":case"altSix":case"altSeven":case"altEight":case"altNine":this.processViewNavigation(e);break;case"enter":this.processEnter(e);break;case"home":this.focusFirstCell();break;case"tab":case"shiftTab":this.processTab(e,e.shiftKey);break;case"delete":case"backspace":this.processDelete(e);break;case"ctrlShiftUpArrow":case"ctrlShiftDownArrow":case"ctrlShiftLeftArrow":case"ctrlShiftRightArrow":this.processCtrlShiftNavigationArrows(e);break;case"escape":this.processEscape(e);break;case"fTwelve":this.parent.allowInline&&this.parent.inlineModule&&(e.preventDefault(),this.processFTwelve(e));break;case"shiftAltY":this.parent.changeDate(new Date,e);break;case"shiftAltN":"Agenda"!==this.parent.currentView&&"MonthAgenda"!==this.parent.currentView&&"Year"!==this.parent.currentView&&this.processShiftAltN(e);break;case"cut":case"cmdCut":(e.ctrlKey||e.metaKey)&&this.processClipboardAction(!0,void 0,e);break;case"copy":case"cmdCopy":(e.ctrlKey||e.metaKey)&&this.processClipboardAction(!1,void 0,e)}},i.prototype.processShiftAltN=function(e){var t=this.parent.getSelectedCells(),i=e.target,n=B.extend({},null,!0),i=(0<t.length&&(B.closest(i,"."+O)||B.closest(i,"."+w)||B.closest(i,"."+It))?n=this.getSelectedElements(i):B.closest(i,"."+V)&&!B.isNullOrUndefined(this.parent.activeEventData.event)?(t=this.parent.activeEventData.event,n.startTime=t.StartTime,n.endTime=t.EndTime,n.isAllDay=t.IsAllDay):(i=this.parent.getStartEndTime(this.parent.workHours.start),t=this.parent.activeViewOptions.timeScale.interval/this.parent.activeViewOptions.timeScale.slotCount,n.startTime=new Date(this.parent.selectedDate),n.startTime.setHours(i.getHours(),i.getMinutes(),0,0),n.endTime=new Date(n.startTime.getTime()+6e4*t)),B.extend(n,{cancel:!1,event:e}));null!=i&&this.parent.eventWindow.openEditor(i,"Add")},i.prototype.processFTwelve=function(e){var t=e.target;(t.classList.contains(O)||t.classList.contains(w))&&(this.parent.activeCellsData=this.getSelectedElements(t),e={element:(e=B.extend(this.parent.activeCellsData,{cancel:!1,event:e})).element,groupIndex:e.groupIndex,type:"Cell"},this.parent.notify(ue,e)),t.classList.contains(V)&&t.click()},i.prototype.addEventListener=function(){this.parent.on(Pe,this.onCellMouseDown,this),this.parent.allowClipboard&&this.parent.on(He,this.pasteHandler,this)},i.prototype.removeEventListener=function(){this.parent.off(Pe,this.onCellMouseDown),this.parent.off(He,this.pasteHandler)},i.prototype.onCellMouseDown=function(e){e.event.shiftKey||(this.initialTarget=this.getClosestCell(e.event),!this.parent.activeViewOptions.readonly&&"MonthAgenda"!==this.parent.currentView&&this.initialTarget&&(e.event.target.classList.contains(O)&&3!==e.event.which&&(this.parent.removeSelectedClass(),B.EventHandler.add(this.parent.getContentTable(),"mousemove",this.onMouseSelection,this),B.EventHandler.add(this.parent.getContentTable(),"mouseup mouseleave",this.onMoveUp,this)),e.event.target.classList.contains(w))&&3!==e.event.which&&(this.parent.removeSelectedClass(),e=this.parent.getAllDayRow(),B.EventHandler.add(e,"mousemove",this.onMouseSelection,this),B.EventHandler.add(e,"mouseup mouseleave",this.onMoveUp,this)))},i.prototype.onMouseSelection=function(e){var t,i,n=[].slice.call(this.parent.element.querySelectorAll("."+V)),n=(B.addClass(n,"e-allow-select"),this.parent.boundaryValidation(e.pageY,e.pageX)),r=((n.bottom||n.top||n.left||n.right)&&(r=(t=this.parent.element.querySelector("."+A)).offsetHeight<=t.scrollHeight&&0<=t.scrollTop&&t.scrollTop+t.offsetHeight<=t.scrollHeight,i=t.offsetWidth<=t.scrollWidth&&0<=t.scrollLeft&&t.scrollLeft+t.offsetWidth<=t.scrollWidth,r&&(n.top||n.bottom)&&(t.scrollTop+=n.top?-e.target.offsetHeight:e.target.offsetHeight),i)&&(n.left||n.right)&&(t.scrollLeft+=n.left?-e.target.offsetWidth:e.target.offsetWidth),this.getClosestCell(e));r&&this.selectCells(!0,r)},i.prototype.getClosestCell=function(e){return B.closest(e.target,"."+O+",."+w)},i.prototype.onMoveUp=function(t){var i,n=this,e=[].slice.call(this.parent.element.querySelectorAll("."+V));B.removeClass(e,"e-allow-select"),B.EventHandler.remove(this.parent.getContentTable(),"mousemove",this.onMouseSelection),B.EventHandler.remove(this.parent.getContentTable(),"mouseup mouseleave",this.onMoveUp),t.target.classList.contains(w)&&(e=this.parent.getAllDayRow(),B.EventHandler.remove(e,"mousemove",this.onMouseSelection),B.EventHandler.remove(e,"mouseup mouseleave",this.onMoveUp)),this.isPreventAction(t)||(e=B.closest(t.target,".e-work-cells,.e-all-day-cells,.e-header-cells"))&&(0<(i=this.parent.getSelectedCells()).length&&-1===i.indexOf(e)&&(e=i[i.length-1]),"TimelineYear"===this.parent.currentView&&e.classList.contains(E)||(this.parent.activeCellsData=this.getSelectedElements(e),e={},this.parent.eventWindow&&this.parent.eventWindow.convertToEventData(this.parent.activeCellsData,e),e={data:e,element:this.parent.activeCellsData.element,event:t,requestType:ge,showQuickPopup:!1},this.parent.trigger(G,e,function(e){(e.showQuickPopup||n.parent.quickInfoOnSelectionEnd)&&1<i.length&&(e=B.extend(n.parent.activeCellsData,{cancel:!1,event:t,name:"cellClick"}),n.parent.notify(q,e))})))},i.prototype.processEnter=function(e){var t,i,n;this.parent.activeViewOptions.readonly&&!e.target.classList.contains(V)||this.isPreventAction(e)||"TimelineYear"===this.parent.currentView&&e.target.classList.contains(E)||(t=e.target,B.closest(t,"."+Tr)?t.classList.contains(yn)||t.classList.contains(Tn)||t.classList.contains(wn)||t.classList.contains(Dn)||t.classList.contains(dr)?(t.click(),e.preventDefault()):t.classList.contains(Gn)&&(this.parent.element.querySelector("."+Tn).click(),e.preventDefault()):t.classList.contains(Kt)&&t.classList.contains(_t)?(i=t.querySelector("."+Qt))&&i.click():t.classList.contains(O)||t.classList.contains(w)?(this.parent.activeCellsData=this.getSelectedElements(t),i=B.extend(this.parent.activeCellsData,{cancel:!1,event:e}),this.parent.allowInline?(n={element:i.element,groupIndex:i.groupIndex,type:"Cell"},this.parent.notify(ue,n)):"Year"===this.parent.currentView?t.click():this.parent.notify(q,i)):t.classList.contains(Pr)&&this.parent.inlineModule?this.parent.inlineModule.inlineCrudActions(t):t.classList.contains(V)||t.classList.contains(Vn)||t.classList.contains(ln)||t.classList.contains(hn)?t.click():t.classList.contains(xn)&&(this.parent.setProperties({selectedDate:this.parent.getDateFromElement(t)},!0),this.parent.changeView(this.parent.getNavigateView(),e),this.processEscape(e)))},i.prototype.getSelectedElements=function(e){var t,i=1<this.selectedCells.length&&e.classList.contains(di)?(t=this.parent.getCellDetails(this.selectedCells[0]),i=this.parent.getCellDetails(this.selectedCells.slice(-1)[0]),t.endTime=i.endTime,t.element=e,t):this.parent.getCellDetails(e);return i},i.prototype.getCells=function(e,t,i){var n=this.parent.getContentTable(),r="TimelineYear"===this.parent.currentView,a=[].slice.call(n.querySelectorAll(r&&!e?"."+O+":not(."+E+")":"td")),s=n.rows.length,o=n.rows[0].cells.length,n=(t&&t.classList.contains(w)&&(n=this.parent.getAllDayRow(),a=[].slice.call(n.cells),s=1,o=n.cells.length),a.indexOf(t)),l=a.indexOf(i),p=[];if(e){for(var c=0;c<o;c++)for(var h=0;h<s;h++){var d=a[o*h+c];r&&d.classList.contains(E)||p.push(d)}n=p.indexOf(t),l=p.indexOf(i)}return l<n&&(t=n,n=l,l=t),(e?p:a).slice(n,l+1)},i.prototype.focusFirstCell=function(){var e;"Agenda"===this.parent.currentView?((e=this.parent.getContentTable().querySelector("."+Vi)).setAttribute("tabindex","0"),e.focus()):(this.parent.eventBase.removeSelectedAppointmentClass(),this.parent.activeView.isTimelineView()&&"TimelineYear"!==this.parent.currentView?(e=this.parent.element.querySelector("."+C+" tr:not(."+fr+") ."+O+":not(."+Ut+")"),this.selectCells(!1,e)):-1<this.parent.currentView.indexOf("Year")?(e="."+O+":not(."+E+"):not(."+Ut+")",e+="TimelineYear"===this.parent.currentView&&"Vertical"===this.parent.activeViewOptions.orientation?'[data-date="'+this.parent.activeView.startDate().getTime()+'"]':"",this.selectCells(!1,this.parent.element.querySelector(e))):this.selectCells(!1,this.parent.getWorkCellElements()[0]))},i.prototype.isInverseTableSelect=function(){return this.parent.activeView.isInverseTableSelect},i.prototype.selectCells=function(e,t){var p,c,i,h=this,d=(this.parent.removeSelectedClass(),t instanceof Array?t.slice(-1)[0]:t);e?(c=["Day","Week","WorkWeek","TimelineDay","TimelineWeek","TimelineWorkWeek","TimelineMonth","TimelineYear"],i={element:t,requestType:"mousemove",allowMultipleRow:!0},this.parent.inlineModule.removeInlineAppointmentElement(),this.parent.trigger(G,i,function(e){e.allowMultipleRow&&h.parent.allowMultiRowSelection||((e="TimelineYear"===h.parent.currentView)&&"Horizontal"===h.parent.activeViewOptions.orientation||"Month"===h.parent.currentView?(e=e&&0<h.parent.activeViewOptions.group.resources.length,d=e?h.initialTarget:h.initialTarget.parentElement.children[d.cellIndex]):-1<c.indexOf(h.parent.currentView)&&(d=d.parentElement.children[h.initialTarget.cellIndex]));e=h.getCells(h.isInverseTableSelect(),h.initialTarget,d);if(0<h.parent.activeViewOptions.group.resources.length){p=h.initialTarget.getAttribute("data-group-index");for(var t=[],i=0,n=e;i<n.length;i++)(a=n[i]).getAttribute("data-group-index")===p&&t.push(a);e=t}if(h.parent.allowMultiCellSelection||(e=[h.initialTarget]),2<(h.selectedCells=e).length&&!d.classList.contains(w)){var r=h.getAllDayCells(e);if(0<h.parent.activeViewOptions.group.resources.length){for(var a,s=[],o=0,l=r;o<l.length;o++)(a=l[o]).getAttribute("data-group-index")===p&&s.push(a);r=s}e=e.concat(r)}d.getAttribute("data-group-index")!==p&&0<h.parent.activeViewOptions.group.resources.length&&(d=h.selectedCells[h.selectedCells.length-1]),h.parent.addSelectedClass(e,d)})):(i={element:d,requestType:ge},this.parent.trigger(G,i,function(){h.initialTarget=d,h.selectedCells=[d],h.parent.addSelectedClass([d],d)}))},i.prototype.selectAppointment=function(e,t){var i=this.getAppointmentElements();i.length<0||(this.parent.eventBase.removeSelectedAppointmentClass(),(t=t.classList.contains(V)?(t=i.indexOf(t),i[e?t-1:t+1]):e?i[i.length-1]:i[0])&&(this.parent.eventBase.addSelectedAppointments([t],!0),t.focus(),B.addClass([t],Ii)))},i.prototype.selectAppointmentElementFromWorkCell=function(t,e){var i,n,r,a=this;this.parent.eventBase.removeSelectedAppointmentClass(),this.parent.removeSelectedClass(),(e.classList.contains(O)||e.classList.contains(w))&&(i=this.getUniqueAppointmentElements(),n=[],r=this.parent.getDateFromElement(e).getTime(),this.parent.eventsProcessed.filter(function(e){return t?e[a.parent.eventFields.startTime].getTime()<=r:e[a.parent.eventFields.startTime].getTime()>=r}).filter(function(t){i.filter(function(e){JSON.stringify(t.Guid)===JSON.stringify(e.getAttribute("data-guid"))&&n.push(e)})}),0<n.length)&&(e=this.getAppointmentElementsByGuid((t?n[n.length-1]:n[0]).getAttribute("data-guid")),this.parent.eventBase.addSelectedAppointments(e,!0),e[e.length-1].focus())},i.prototype.getAllDayCells=function(e){var t,i,n=this.parent.getAllDayRow();return n&&(t=e[0],e=e[e.length-1],i=this.parent.getCellDetails(t),this.parent.getCellDetails(e).endTime.getTime()-i.startTime.getTime()>=W)?[].slice.call(n.cells).slice(t.cellIndex,e.cellIndex+1):[]},i.prototype.getAppointmentElements=function(){return[].slice.call(this.parent.element.querySelectorAll("."+V))},i.prototype.getAppointmentElementsByGuid=function(e){return[].slice.call(this.parent.element.querySelectorAll('div[data-guid="'+e+'"]'))},i.prototype.getUniqueAppointmentElements=function(){var n=this.getAppointmentElements(),r=[];return n.map(function(e){return e.getAttribute("data-guid")}).filter(function(e,t,i){i.indexOf(e)===t&&r.push(n[parseInt(t.toString(),10)])}),r},i.prototype.getWorkCellFromAppointmentElement=function(e){e=this.parent.eventBase.getEventByGuid(e.getAttribute("data-guid"));return this.parent.eventBase.selectWorkCellByTime([e])},i.prototype.processViewNavigation=function(e){var t,i;B.isNullOrUndefined(e.code)||(t=parseInt(e.code.slice(e.code.length-1),10)-1,!isNaN(t)&&!B.isNullOrUndefined(this.parent.views)&&t<this.parent.views.length&&(i=this.parent.viewCollections[parseInt(t.toString(),10)].option,this.parent.changeView(i,e,void 0,t),this.parent.headerModule)&&this.parent.headerModule.element.querySelector(".e-active-view button").focus())},i.prototype.isCalendarTarget=function(e){e=e.currentTarget||e.target;return!(!e||B.isNullOrUndefined(e.querySelector(".e-header-popup.e-popup-open")))},i.prototype.cancelUpDownAction=function(e){var t=e&&"Vertical"===this.parent.activeViewOptions.orientation,i=0<this.parent.activeViewOptions.group.resources.length;return!!(t&&i||e&&this.initialTarget.classList.contains(E))||!((!this.parent.activeView.isTimelineView()||e)&&"MonthAgenda"!==this.parent.currentView)},i.prototype.processUp=function(e,t){var i="TimelineYear"===this.parent.currentView;if(!(t&&this.cancelUpDownAction(i)||this.isCalendarTarget(e))){var n=e.target,r=this.parent.getSelectedCells(),a=this.parent.eventBase.getSelectedAppointments(),s=this.parent.element.querySelector("."+Sn),o=this.getQuickPopupElement();if(0<r.length&&!e.target.classList.contains(O)&&(n=r[r.length-1]),0<a.length&&!s.classList.contains(xt)&&!o.classList.contains(xt)&&-1!==["Day","Week","WorkWeek","Month"].indexOf(this.parent.currentView)&&(n=this.getWorkCellFromAppointmentElement(a[a.length-1]),this.parent.eventBase.removeSelectedAppointmentClass()),n)if(n.classList.contains(O)&&!this.parent.element.querySelector("."+xt)){r=this.parent.getTableRows(),s=r.indexOf(n.parentElement),o=void 0;if(i&&t&&0===this.parent.activeViewOptions.group.resources.length&&(o=this.isInverseTableSelect()?this.getVerticalUpDownCell(r,n,s,!0):this.getHorizontalUpDownCell(r,n,s,!0)),(0<s||o)&&s<r.length){if(o=o||r[s-1].cells[n.cellIndex],"Year"===this.parent.currentView&&o.classList.contains(E)){if(!(this.parent.activeView.getStartDate().getTime()<+o.getAttribute("data-date")))return;o=this.getYearUpDownCell(r,s-1,n.cellIndex,!0)}e.preventDefault(),this.selectCells(t,o)}}else"Agenda"!==this.parent.currentView&&"MonthAgenda"!==this.parent.currentView||this.selectAppointment(!0,n)}},i.prototype.processDown=function(e,t){var i="TimelineYear"===this.parent.currentView;if(!(t&&this.cancelUpDownAction(i)||this.isCalendarTarget(e))){var n=e.target,r=this.parent.getSelectedCells(),a=this.parent.eventBase.getSelectedAppointments(),s=this.parent.element.querySelector("."+Sn),o=this.getQuickPopupElement(),r=(0<r.length&&!e.target.classList.contains(O)&&(n=r[r.length-1]),0<a.length&&!s.classList.contains(xt)&&!o.classList.contains(xt)&&-1!==["Day","Week","WorkWeek","Month"].indexOf(this.parent.currentView)&&(n=this.getWorkCellFromAppointmentElement(a[a.length-1]),this.parent.eventBase.removeSelectedAppointmentClass()),this.parent.getTableRows());if(n)if(n.classList.contains(O)&&!this.parent.element.querySelector("."+xt)){s=r.indexOf(n.parentElement),o=void 0;if(i&&t&&0===this.parent.activeViewOptions.group.resources.length&&(o=this.isInverseTableSelect()?this.getVerticalUpDownCell(r,n,s,!1):this.getHorizontalUpDownCell(r,n,s,!1)),0<=s&&(s<r.length-1||o)){if(o=o||r[s+1].cells[n.cellIndex],"Year"===this.parent.currentView&&o.classList.contains(E)){if(!(this.parent.activeView.getEndDate().getTime()>+o.getAttribute("data-date")))return;o=this.getYearUpDownCell(r,s+1,n.cellIndex,!1)}e.preventDefault(),this.selectCells(t,o)}}else"Agenda"!==this.parent.currentView&&"MonthAgenda"!==this.parent.currentView||this.selectAppointment(!1,n)}},i.prototype.getYearUpDownCell=function(e,t,i,n){for(;e[parseInt(t.toString(),10)]&&e[parseInt(t.toString(),10)].cells[parseInt(i.toString(),10)].classList.contains(E);)t+=n?-1:1;return e[parseInt(t.toString(),10)].cells[parseInt(i.toString(),10)]},i.prototype.getHorizontalUpDownCell=function(e,t,i,n){e=e[i+(n?-1:1)],i=e?e.cells[t.cellIndex]:t;return i.classList.contains(E)&&(n=e.querySelector("."+O+":not(."+E+")"),t=new Date(+n.getAttribute("data-date")),t='[data-date="'+new Date(t.getFullYear(),t.getMonth()+1,0).getTime()+'"]',i=i.cellIndex<n.cellIndex?n:e.querySelector(t)),i},i.prototype.getVerticalUpDownCell=function(e,t,i,n){var r=n&&0<i||!n&&i<e.length-1?e[i+(n?-1:1)].cells[t.cellIndex]:void 0;if(!r||r.classList.contains(E)){if(e[parseInt(i.toString(),10)].cells[t.cellIndex-(n?1:-1)])return e=+t.getAttribute("data-date")-(n?W:-W),this.parent.getContentTable().querySelector("."+O+'[data-date="'+e+'"]');r=t}return r},i.prototype.processLeftRight=function(e){var t="Year"===this.parent.currentView?e.closest("tbody"):this.parent.getContentTable(),i=e.parentNode.sectionRowIndex;return{element:t,rowIndex:i,columnIndex:e.cellIndex,maxIndex:t.rows[parseInt(i.toString(),10)].cells.length}},i.prototype.getQuickPopupElement=function(){return(this.parent.isAdaptive?document.body:this.parent.element).querySelector("."+Tr)},i.prototype.isCancelLeftRightAction=function(e,t,i){var i="MonthAgenda"===this.parent.currentView||i&&this.initialTarget.classList.contains(E);return!!("Agenda"===this.parent.currentView||t&&i)||!!(this.isPreventAction(e)&&t||(i=this.parent.element.querySelector("."+Sn),e=this.getQuickPopupElement(),i.classList.contains(xt))||e.classList.contains(xt))},i.prototype.processRight=function(e,t){var i,n,r,a,s,o="TimelineYear"===this.parent.currentView;this.isCancelLeftRightAction(e,t,o)||this.isCalendarTarget(e)||(r=this.parent.getSelectedCells(),n=this.parent.eventBase.getSelectedAppointments(),i=e.target,0<r.length&&!i.classList.contains(O)&&!i.classList.contains(w)&&(i=r[r.length-1]),0<n.length&&(i=this.getWorkCellFromAppointmentElement(n[n.length-1]),this.parent.eventBase.removeSelectedAppointmentClass(),!i))||(i.classList.contains(O)&&e.target.classList.contains(O)?(r=this.processLeftRight(i),n=new Date(+i.getAttribute("data-date")),a="Year"===this.parent.currentView&&n.getTime()===ze(n).getTime(),0<=r.columnIndex&&r.columnIndex<r.maxIndex-1&&!a?(s=this.calculateNextPrevDate(i,r.element.rows[r.rowIndex].cells[i.cellIndex+1],"right"),o&&t&&s.classList.contains(E)&&(s=this.getTimelineYearTargetCell(r,i,!0)),B.isNullOrUndefined(s)||this.selectCells(t,s)):r.columnIndex!==r.maxIndex-1&&!a||(!this.isInverseTableSelect()&&r.rowIndex<r.element.rows.length-1&&!a?(s=this.calculateNextPrevDate(i,r.element.rows[r.rowIndex+1].cells[0],"right"),s=o&&t&&s.classList.contains(E)?this.getHorizontalLeftRightCell(r,i,!0):s,B.isNullOrUndefined(s)||this.selectCells(t,s)):t||(a&&n.getTime()!==this.parent.activeView.getEndDate().getTime()?this.selectCells(t,this.parent.element.querySelector(":not(."+E+')[data-date="'+(n.getTime()+W)+'"]')):(o=this.isInverseTableSelect()?r.rowIndex:0,this.parent.changeDate(this.parent.activeView.getNextPreviousDate("Next"),e),s=this.parent.getContentTable(),n=a?s.rows[parseInt(o.toString(),10)].querySelector("."+O+":not(."+E+")"):s.rows[parseInt(o.toString(),10)].cells[0],this.selectCells(!1,n))))):i.classList.contains(w)&&(r=i.cellIndex,s=(a=this.parent.getAllDayRow()).cells.length,0<=r&&r<s-1?this.selectCells(t,a.cells[r+1]):r!==s-1||t||(this.parent.changeDate(this.parent.activeView.getNextPreviousDate("Next"),e),o=this.parent.getAllDayRow(),this.selectCells(!1,o.cells[0]))))},i.prototype.processLeft=function(e,t){var i,n,r,a,s,o="TimelineYear"===this.parent.currentView;this.isCancelLeftRightAction(e,t,o)||this.isCalendarTarget(e)||(i=e.target,0<(a=this.parent.getSelectedCells()).length&&!i.classList.contains(O)&&!i.classList.contains(w)&&(i=a[a.length-1]),0<(a=this.parent.eventBase.getSelectedAppointments()).length&&(i=this.getWorkCellFromAppointmentElement(a[a.length-1]),this.parent.eventBase.removeSelectedAppointmentClass(),!i))||(e.target.classList.contains(O)&&i.classList.contains(O)?(a=this.processLeftRight(i),n=new Date(+i.getAttribute("data-date")),s="Year"===this.parent.currentView&&n.getTime()===We(n).getTime(),0<a.columnIndex&&a.columnIndex<a.maxIndex&&!s?(r=this.calculateNextPrevDate(i,a.element.rows[a.rowIndex].cells[i.cellIndex-1],"left"),o&&t&&r.classList.contains(E)&&(r=this.getTimelineYearTargetCell(a,i,!1)),B.isNullOrUndefined(r)||this.selectCells(t,r)):0!==a.columnIndex&&!s||(!this.isInverseTableSelect()&&0<a.rowIndex?(r=this.calculateNextPrevDate(i,a.element.rows[a.rowIndex-1].cells[a.maxIndex-1],"left"),r=o&&t&&r.classList.contains(E)?this.getHorizontalLeftRightCell(a,i,!1):r,B.isNullOrUndefined(r)||this.selectCells(t,r)):t||(s&&n.getTime()!==this.parent.activeView.getStartDate().getTime()?this.selectCells(t,this.parent.element.querySelector('[data-date="'+(n.getTime()-W)+'"]')):(this.parent.changeDate(this.parent.activeView.getNextPreviousDate("Previous"),e),o=this.parent.getContentTable(),r=this.isInverseTableSelect()?a.rowIndex:o.rows.length-1,n=o.rows[parseInt(r.toString(),10)].cells[a.maxIndex-1],s&&(n=(o=this.parent.element.querySelectorAll("."+C+" tbody")).item(o.length-1).querySelector(":not(."+E+')[data-date="'+this.parent.activeView.getEndDate().getTime()+'"]')),this.selectCells(!1,n))))):i.classList.contains(w)&&(r=i.cellIndex,s=(a=this.parent.getAllDayRow()).cells.length,0<r&&r<s?this.selectCells(t,a.cells[r-1]):0!==r||t||(this.parent.changeDate(this.parent.activeView.getNextPreviousDate("Previous"),e),o=this.parent.getAllDayRow(),this.selectCells(!1,o.cells[s-1]))))},i.prototype.getTimelineYearTargetCell=function(e,t,i){return this.isInverseTableSelect()?this.getVerticalLeftRightCell(t,i):this.getHorizontalLeftRightCell(e,t,i)},i.prototype.getHorizontalLeftRightCell=function(e,t,i){e=e.element.rows[t.parentNode.sectionRowIndex+(i?1:-1)];return e?(i=i?"."+O+":not(."+E+")":'[data-date="'+(+t.getAttribute("data-date")-W)+'"]',e.querySelector(i)):t},i.prototype.getVerticalLeftRightCell=function(e,t){var i=new Date(+e.getAttribute("data-date")),i=new Date(i.getFullYear(),i.getMonth()+(t?1:-1),1),t=this.parent.getContentTable(),n=t.querySelector('[data-date="'+i.getTime()+'"]');return n.parentNode.sectionRowIndex>e.parentNode.sectionRowIndex?n:t.querySelector('[data-date="'+new Date(i.getFullYear(),i.getMonth()+1,0).getTime()+'"]')},i.prototype.calculateNextPrevDate=function(e,t,i){var n=this.initialTarget.getAttribute("data-group-index");return 0<this.parent.activeViewOptions.group.resources.length&&"Month"===this.parent.currentView&&e&&t&&t.getAttribute("data-group-index")!==n&&(e=this.parent.getDateFromElement(e),i="right"===i?new Date(e.setDate(e.getDate()+1)):new Date(e.setDate(e.getDate()-1)),t=[].slice.call(this.parent.element.querySelectorAll('td[data-date="'+i.getTime().toString()+'"][data-group-index="'+n+'"]'))[0]),t},i.prototype.getFocusableElements=function(e){return[].slice.call(e.querySelectorAll('a[href]:not([tabindex="-1"]),input:not([disabled]):not([tabindex="-1"]),textarea:not([disabled]):not([tabindex="-1"]),button:not([disabled]):not([tabindex="-1"]),select:not([disabled]):not([tabindex="-1"]),[tabindex]:not([tabindex="-1"]),[contentEditable=true]:not([tabindex="-1"])'))},i.prototype.processTabOnPopup=function(e,t){var i=this,t=this.getFocusableElements(t),n=(t=t.filter(function(e){var t=i.parent.element.querySelector("."+vn);return t&&t.offsetParent?!(e.classList.contains(lr)||e.classList.contains(cr)):!(e.classList.contains(wn)||e.classList.contains(Dn))}))[0],t=t[t.length-1];B.isNullOrUndefined(t)||document.activeElement!==t||e.shiftKey||(e.preventDefault(),n.focus()),!B.isNullOrUndefined(n)&&document.activeElement===n&&e.shiftKey&&(e.preventDefault(),t.focus())},i.prototype.processTab=function(e,t){var i=e.target;if(i.classList.contains(Pr)&&this.parent.inlineModule&&(i=i.closest(".e-appointment"),this.parent.inlineModule.inlineCrudActions(e.target)),"TimelineYear"===this.parent.currentView&&i.classList.contains(E))i.classList.contains(di)&&this.parent.removeSelectedClass();else{var n=B.closest(i,"."+Tr+",."+Sn);if(n&&n.classList.contains(xt))n.classList.contains(Sn)&&this.parent.eventBase.removeSelectedAppointmentClass(),this.processTabOnPopup(e,n);else if(i.classList.contains(vt))this.parent.eventBase.removeSelectedAppointmentClass();else if(i.classList.contains(Kt)&&this.parent.activeView.isTimelineView()&&0<this.parent.activeViewOptions.group.resources.length)a=parseInt(i.getAttribute("data-group-index"),10),0<(r=[].slice.call(this.parent.element.querySelectorAll("."+V+'[data-group-index="'+(t?a-1:a)+'"]'))).length?(this.parent.eventBase.removeSelectedAppointmentClass(),n=(t?r.slice(-1):r)[0],this.parent.eventBase.addSelectedAppointments([n],!0),n.focus(),e.preventDefault()):a+1===this.parent.resourceBase.lastResourceLevel.length?(this.parent.element.focus(),e.preventDefault()):this.parent.virtualScrollModule?(n=this.parent.element.querySelector("."+xi),n=Math.round(n.offsetHeight/this.parent.resourceBase.expandedResources.length),this.parent.element.querySelector(".e-content-wrap").scrollTop=(t?a-1:a+1)*n,this.parent.virtualScrollModule.virtualScrolling()):this.setScrollPosition(a);else{if(i.classList.contains(V)){var r=[].slice.call(this.parent.element.querySelectorAll("."+V)),n="TimelineYear"===this.parent.currentView;if((this.parent.activeView.isTimelineView()&&!n||n&&"Vertical"===this.parent.activeViewOptions.orientation)&&0<this.parent.activeViewOptions.group.resources.length){var a=parseInt(i.getAttribute("data-group-index"),10),n=(r=[].slice.call(this.parent.element.querySelectorAll("."+V+'[data-group-index="'+a+'"]')),"."+Kt+'[data-group-index="'+(t?a:a+1)+'"]'),n=this.parent.element.querySelector(n);if(n&&(t&&i.getAttribute("data-guid")===r[0].getAttribute("data-guid")||!t&&i.getAttribute("data-guid")===r.slice(-1)[0].getAttribute("data-guid")))return this.parent.eventBase.removeSelectedAppointmentClass(),this.parent.virtualScrollModule?n.focus({preventScroll:!0}):n.focus(),this.parent.activeView.isTimelineView()&&0<this.parent.activeViewOptions.group.resources.length&&B.isNullOrUndefined(this.parent.virtualScrollModule)&&this.setScrollPosition(a),void e.preventDefault()}n=this.parent.eventBase.getSelectedAppointments();return(0<n.length&&(i=n[n.length-1]),this.parent.eventBase.removeSelectedAppointmentClass(),!t&&i.getAttribute("data-guid")===r[r.length-1].getAttribute("data-guid")||t&&i.getAttribute("data-guid")===r[0].getAttribute("data-guid"))?void 0:void("Agenda"!==this.parent.currentView&&"MonthAgenda"!==this.parent.currentView||(this.selectAppointment(t,i),e.preventDefault()))}a=this.parent.getSelectedCells();0<a.length&&!i.classList.contains(V)?(i=a[a.length-1],this.selectAppointmentElementFromWorkCell(t,i),e.preventDefault()):i&&!i.classList.contains(Kt)&&this.parent.activeView.isTimelineView()&&0<this.parent.activeViewOptions.group.resources.length&&this.processTabOnResourceCells(i,t)}}},i.prototype.processDelete=function(e){var t,i=document.activeElement;(i="MonthAgenda"===this.parent.currentView||!B.isNullOrUndefined(i)&&B.closest(i,"."+Tr)?(t=this.parent.eventBase.getSelectedEvents().element)&&B.isNullOrUndefined(t.length)?t:t[0]:i)&&i.classList.contains(V)&&(B.addClass([i],wi),this.parent.activeEventData=this.parent.eventBase.getSelectedEvents(),this.parent.activeViewOptions.readonly||i.classList.contains(Rr)||!this.parent.eventSettings.allowDeleting||this.parent.quickPopup.deleteClick(e))},i.prototype.processCtrlShiftNavigationArrows=function(e){if(0<this.parent.activeViewOptions.group.resources.length&&document.activeElement.classList.contains(V)){for(var t=parseInt(document.activeElement.getAttribute("data-group-index"),10),i=(n=(n="ctrlShiftLeftArrow"===e.action||"ctrlShiftUpArrow"===e.action?t-1:t+1)<0?0:n>this.parent.resourceBase.lastResourceLevel.length?this.parent.resourceBase.lastResourceLevel.length:n,[]);0===i.length&&0<=n&&n<=this.parent.resourceBase.lastResourceLevel.length;)i=[].slice.call(this.parent.element.querySelectorAll("."+V+'[data-group-index="'+n+'"]')),n="ctrlShiftLeftArrow"===e.action||"ctrlShiftUpArrow"===e.action?n-1:n+1;t=i[0];t&&(this.parent.eventBase.removeSelectedAppointmentClass(),this.parent.eventBase.addSelectedAppointments([t],!0),t.focus())}else{var n;0<this.parent.activeViewOptions.group.resources.length&&!document.activeElement.classList.contains(V)&&(n=this.parent.resourceBase.renderedResources[0].groupIndex,0<(t=[].slice.call(this.parent.element.querySelectorAll("."+V+'[data-group-index="'+n+'"]'))).length)&&(this.parent.eventBase.removeSelectedAppointmentClass(),t=t[0],this.parent.eventBase.addSelectedAppointments([t],!0),t.focus(),e.preventDefault())}},i.prototype.processEscape=function(e){this.parent.quickPopup.onClosePopup(e),this.parent.quickPopup.morePopup.hide(),this.parent.headerModule&&this.parent.headerModule.hideHeaderPopup(),this.parent.inlineModule&&this.parent.inlineModule.removeInlineAppointmentElement()},i.prototype.isPreventAction=function(e){e=B.closest(e.target,"."+Ut);return!(!this.parent.activeView.isTimelineView()||B.isNullOrUndefined(e))},i.prototype.processTabOnResourceCells=function(e,t){var i,n=[].slice.call(this.parent.element.querySelectorAll('[tabIndex="0"]')),e=n.indexOf(e),t=t?n[e-1]:n[e+1];t&&t.classList.contains(Kt)&&(n=parseInt(t.getAttribute("data-group-index"),10),this.parent.virtualScrollModule?(i=this.parent.element.querySelector("."+Wt),[].slice.call(this.parent.element.querySelectorAll("."+Kt)).forEach(function(e){e.getBoundingClientRect().top<i.getBoundingClientRect().top&&e.setAttribute("tabindex","-1")})):this.setScrollPosition(n))},i.prototype.setScrollPosition=function(e){e=this.parent.element.querySelector("."+O+'[data-group-index="'+e+'"]');e&&(this.parent.element.querySelector("."+A).scrollTop=e.offsetTop)},i.prototype.createClipboardElement=function(){this.parent.allowClipboard&&(this.clipBoardTextArea=this.parent.createElement("textarea",{className:"e-clipboard",attrs:{tabindex:"-1"}}),this.parent.element.appendChild(this.clipBoardTextArea))},i.prototype.setCopy=function(e,t){var i=this;if(""===window.getSelection().toString()){this.clipBoardTextArea.value="";var n={elements:[],eventDatas:[]};if(e){e=this.filterReadOnlyEvent(e);n.eventDatas=e}else{if(!this.parent||!this.parent.eventBase)return;e=this.parent.eventBase.getSelectedEvents();e.event=e&&e.event?Array.isArray(e.event)?this.filterReadOnlyEvent(e.event):this.filterReadOnlyEvent([e.event]):void 0,e.element&&e.event?n={elements:e.element,eventDatas:e.event}:(n.element=[t.target],n.eventDatas=[this.parent.getEventDetails(t.target)])}this.clipBoardTextArea.value=JSON.stringify(n.eventDatas,void 0,2),/ipad|ipod|iphone/i.test(B.Browser.userAgent)?this.clipBoardTextArea.setSelectionRange(0,this.clipBoardTextArea.value.length):this.clipBoardTextArea.select(),B.isNullOrUndefined(navigator.clipboard)||navigator.clipboard.writeText(this.clipBoardTextArea.value).then(function(){var e;i.clipBoardTextArea.blur(),window.getSelection().removeAllRanges(),t&&(e=t.target.closest("."+V))&&e.focus()}).catch(function(e){throw e})}},i.prototype.filterReadOnlyEvent=function(e){var t=this;return e.filter(function(e){return!e[t.parent.eventFields.isReadonly]})},i.prototype.processClipboardAction=function(e,t,i){this.parent.allowClipboard&&(this.isCutAction=e,this.isCutContentPasted=!1,this.parent.closeQuickInfoPopup(),this.setCopy(t||void 0,i))},i.prototype.pasteHandler=function(t,i){var n=this;if(this.parent.allowClipboard&&!this.isCutContentPasted){var e=0<this.parent.getSelectedCells().length?this.parent.getSelectedCells():i?[i]:[];if(0!==e.length&&!this.parent.eventWindow.dialogObject.visible&&!this.parent.quickPopup.quickPopup.element.classList.contains(xt)){var r,t=(t.clipboardData||t.event.clipboardData||window.clipboardData).getData("text");if("[]"!==t&&""!==t){try{r=JSON.parse(t)}catch(e){r=t}this.parent.trigger(De,{cancel:!1,data:r,element:e},function(e){e.cancel?n.parent.closeQuickInfoPopup():Array.isArray(e.data)&&e.data.every(function(e){return"object"==typeof e})?(n.processPaste(e.data,i),n.isCutAction&&(n.isCutContentPasted=!0)):n.clipBoardTextArea.value=""})}}}},i.prototype.processPaste=function(e,t){var i,n,r,a;this.parent&&this.parent.eventWindow&&this.parent.eventBase&&e&&e.length&&(t=this.getTargetElements(t),a=this.parent.getCellDetails(t),this.parent.eventWindow.convertToEventData(a,i={}),r=this.isAllDayEvent(t),n=this.parent.getResourcesByIndex(a.groupIndex),e=this.processEventData(e,r,a,n),r=this.parent.eventBase.sortByDateTime(e),a=this.prepareEventData(r,i),B.removeClass(t,di),0<a.length)&&(this.isCutAction?this.parent.saveEvent(a):this.parent.addEvent(a))},i.prototype.getTargetElements=function(e){return 0<this.parent.getSelectedCells().length?this.parent.getSelectedCells():e?[e]:[]},i.prototype.isAllDayEvent=function(e){return!e.some(function(e){return e.classList.contains(O)})},i.prototype.processEventData=function(e,i,n,r){var a=this;return e.map(function(e){var t=Gr({},e,((t={})[a.parent.eventFields.startTime]=new Date(e[a.parent.eventFields.startTime]),t[a.parent.eventFields.endTime]=new Date(e[a.parent.eventFields.endTime]),t[a.parent.eventFields.recurrenceID]=null,t[a.parent.eventFields.isAllDay]=i,t));return a.adjustEventTime(t,i,e.IsAllDay,n),r&&r.groupData&&Object.assign(t,r.groupData),t})},i.prototype.adjustEventTime=function(e,t,i,n){var r=this.parent.activeViewOptions.timeScale.enable;-1!==["Day","Week","WorkWeek"].indexOf(this.parent.currentView)&&r?t?(e[this.parent.eventFields.endTime]=new Date(e[this.parent.eventFields.startTime]),e[this.parent.eventFields.endTime].setDate(e[this.parent.eventFields.startTime].getDate()+1)):i&&(e[this.parent.eventFields.startTime]=new Date(e[this.parent.eventFields.startTime].setHours(0,0,0,0)),e[this.parent.eventFields.endTime]=new Date(e[this.parent.eventFields.startTime].getTime()+(n.endTime.getTime()-n.startTime.getTime()))):i&&(e[this.parent.eventFields.isAllDay]=!0,e[this.parent.eventFields.startTime]=new Date(e[this.parent.eventFields.startTime].setHours(0,0,0,0)),e[this.parent.eventFields.endTime]=new Date(e[this.parent.eventFields.startTime].getTime()+(e[this.parent.eventFields.endTime].getTime()-e[this.parent.eventFields.startTime].getTime())))},i.prototype.prepareEventData=function(e,n){var r=this,a=new Date(e[0][this.parent.eventFields.startTime]),s=this.parent.getEventMaxID();return e.map(function(e){var t=r.calculateTotalDuration(e,n,a),i=r.isCutAction?e:Gr({},e);return e[r.parent.eventFields.recurrenceRule]||(i[r.parent.eventFields.startTime]=new Date(new Date(i[r.parent.eventFields.startTime]).setMilliseconds(t)),i[r.parent.eventFields.endTime]=new Date(new Date(i[r.parent.eventFields.endTime]).setMilliseconds(t))),r.isCutAction||(i[r.parent.eventFields.id]=s++),i})},i.prototype.calculateTotalDuration=function(e,t,i){return-1===["Month","TimelineMonth","TimelineYear"].indexOf(this.parent.currentView)&&this.parent.activeViewOptions.timeScale.enable?t[this.parent.eventFields.startTime].getTime()-i.getTime():(e=new Date(e[this.parent.eventFields.startTime]),t[this.parent.eventFields.startTime].getTime()-i.getTime()+(36e5*e.getHours()+6e4*e.getMinutes()+1e3*e.getSeconds()))},i.prototype.getModuleName=function(){return"keyboard"},i.prototype.destroy=function(){this.removeEventListener(),this.selectedCells=[],this.clipBoardTextArea=null,this.keyboardModule.destroy()},i);function i(e){this.selectedCells=[],this.isCutContentPasted=!1,this.isCutAction=!1,this.keyConfigs={downArrow:"downarrow",upArrow:"uparrow",rightArrow:"rightarrow",leftArrow:"leftarrow",shiftDownArrow:"shift+downarrow",shiftUpArrow:"shift+uparrow",shiftRightArrow:"shift+rightarrow",shiftLeftArrow:"shift+leftarrow",ctrlLeftArrow:"ctrl+leftarrow",ctrlRightArrow:"ctrl+rightarrow",altOne:"alt+1",altTwo:"alt+2",altThree:"alt+3",altFour:"alt+4",altFive:"alt+5",altSix:"alt+6",altSeven:"alt+7",altEight:"alt+8",altNine:"alt+9",enter:"enter",escape:"escape",delete:"delete",backspace:"backspace",home:"home",pageUp:"pageup",pageDown:"pagedown",tab:"tab",shiftTab:"shift+tab",ctrlShiftUpArrow:"ctrl+shift+uparrow",ctrlShiftDownArrow:"ctrl+shift+downarrow",ctrlShiftLeftArrow:"ctrl+shift+leftarrow",ctrlShiftRightArrow:"ctrl+shift+rightarrow",shiftAltY:"shift+alt+y",shiftAltN:"shift+alt+n",cut:"ctrl+x",copy:"ctrl+c",cmdCut:"cmd+x",cmdCopy:"cmd+c"},this.parent=e,this.parent.element.tabIndex=-1===this.parent.element.tabIndex?0:this.parent.element.tabIndex,this.keyboardModule=new B.KeyboardEvents(this.parent.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"}),this.addEventListener(),this.createClipboardElement()}Kr.prototype.initDataManager=function(e,t){this.dataManager=e instanceof p.DataManager?e:new p.DataManager(e),this.query=t instanceof p.Query?t:new p.Query},Kr.prototype.generateQuery=function(e,t){var n,i,r,a=this.query.clone();if(this.parent&&e&&t){if(this.parent.activeViewOptions&&this.parent.activeViewOptions.enableLazyLoading&&!B.isNullOrUndefined(this.parent.activeViewOptions.group.resources)&&0<this.parent.activeViewOptions.group.resources.length&&this.parent.resourceBase&&0<this.parent.resourceBase.resourceCollection.length&&0<this.parent.resourceBase.renderedResources.length&&(n=[],this.parent.resourceBase.resourceCollection.forEach(function(){return n.push([])}),this.parent.resourceBase.renderedResources.forEach(function(i){n.forEach(function(e,t){t=i.groupOrder[parseInt(t.toString(),10)];t&&e.indexOf(t)<0&&e.push(t)})}),this.parent.resourceBase.resourceCollection.forEach(function(e,t){a.addParams(e.field,n[parseInt(t.toString(),10)].toString())})),this.parent.timezone&&(e=this.parent.tzModule.remove(new Date(+e.getTime()),this.parent.timezone),t=this.parent.tzModule.remove(new Date(+t.getTime()),this.parent.timezone)),this.parent.eventSettings.includeFiltersInQuery)return i=this.getStartEndQuery(e,t),r=new p.Predicate(this.parent.eventFields.recurrenceRule,"notequal",null).and(new p.Predicate(this.parent.eventFields.recurrenceRule,"notequal","")),a.where(i.or(r));a.addParams("StartDate",e.toISOString()),a.addParams("EndDate",t.toISOString())}return a},Kr.prototype.getStartEndQuery=function(e,t){var i=this.parent.eventFields;return new p.Predicate(i.startTime,"greaterthanorequal",e).and(new p.Predicate(i.endTime,"greaterthanorequal",e)).and(new p.Predicate(i.startTime,"lessthan",t)).or(new p.Predicate(i.startTime,"lessthanorequal",e).and(new p.Predicate(i.endTime,"greaterthan",e)))},Kr.prototype.getData=function(e){return this.dataManager.executeQuery(e)},Kr.prototype.destroy=function(){this.dataManager=null,this.query=null};var Qr=Kr;function Kr(e,t,i){this.parent=e,this.initDataManager(t,i)}Jr.prototype.firstDateOfMonth=function(e){return new Date(e.getFullYear(),e.getMonth())},Jr.prototype.lastDateOfMonth=function(e){return new Date(e.getFullYear(),e.getMonth()+1,0)},Jr.prototype.isMonthStart=function(e){return 1===e.getDate()},Jr.prototype.getLeapYearDaysCount=function(){return 366},Jr.prototype.getYearDaysCount=function(e,t){return(e.getFullYear()+t)%4==0?366:365},Jr.prototype.getDate=function(e){return e.getDate()},Jr.prototype.getMonth=function(e){return e.getMonth()+1},Jr.prototype.getFullYear=function(e){return e.getFullYear()},Jr.prototype.getYearLastDate=function(e,t){return new Date(e.getFullYear()+t,0,0)},Jr.prototype.getMonthDaysCount=function(e){return this.lastDateOfMonth(e).getDate()},Jr.prototype.getMonthStartDate=function(e){return new Date(e.getFullYear(),e.getMonth(),1,e.getHours(),e.getMinutes())},Jr.prototype.getMonthEndDate=function(e){return e.setDate(1),new Date(e.setMonth(e.getMonth()+1))},Jr.prototype.getExpectedDays=function(e,t){return t},Jr.prototype.setDate=function(e,t){e.setDate(t)},Jr.prototype.setValidDate=function(e,t,i,n,r){B.isNullOrUndefined(r)?e.setMonth(e.getMonth()+t,i):e.setMonth((r?n:e.getMonth())+t)},Jr.prototype.setMonth=function(e,t,i){e.setDate(1),e.setFullYear(e.getFullYear()),e.setMonth(t-1);t=new Date(e.getFullYear(),e.getMonth()+1,0).getDate();e.setDate(Math.min(i,t))},Jr.prototype.addYears=function(e,t){e.setFullYear(e.getFullYear()+t)},Jr.prototype.isSameMonth=function(e,t){return e.getMonth()===t.getMonth()},Jr.prototype.checkMonth=function(e,t){return-1===t.indexOf(e.getMonth()+1)},Jr.prototype.compareMonth=function(e,t){return e.getMonth()>t.getMonth()},Jr.prototype.isSameYear=function(e,t){return e.getFullYear()===t.getFullYear()},Jr.prototype.isLastMonth=function(e){return 11===e.getMonth()},Jr.prototype.isLeapYear=function(e,t){return(e+t)%4==0};var Zr=Jr;function Jr(){}ea.prototype.firstDateOfMonth=function(e){e=this.getHijriDate(e);return B.HijriParser.toGregorian(e.year,e.month,1)},ea.prototype.lastDateOfMonth=function(e){var e=this.getHijriDate(e),t=this.getDaysInMonth(e.month,e.year),t=B.HijriParser.toGregorian(e.year,e.month,t),i=new Date(t.getTime()),i=new Date(i.setDate(i.getDate()+1)),n=this.getHijriDate(i);return e.month===n.month?i:(n=this.getHijriDate(t),e.month===n.month?t:new Date(t.setDate(t.getDate()-1)))},ea.prototype.isMonthStart=function(e){return 1===this.getHijriDate(e).date},ea.prototype.getLeapYearDaysCount=function(){return 355},ea.prototype.getYearDaysCount=function(e,t){e=this.getHijriDate(e);return this.isLeapYear(e.year,t)?355:354},ea.prototype.getDate=function(e){return this.getHijriDate(e).date},ea.prototype.getMonth=function(e){return this.getHijriDate(e).month},ea.prototype.getFullYear=function(e){return this.getHijriDate(e).year},ea.prototype.getYearLastDate=function(e,t){e=this.getHijriDate(e);return B.HijriParser.toGregorian(e.year+t,1,0)},ea.prototype.getMonthDaysCount=function(e){e=this.lastDateOfMonth(e);return this.getHijriDate(e).date},ea.prototype.getMonthStartDate=function(e){var t=this.firstDateOfMonth(e);return new Date(t.getFullYear(),t.getMonth(),t.getDate(),e.getHours(),e.getMinutes())},ea.prototype.getMonthEndDate=function(e){e=this.lastDateOfMonth(e);return e.setDate(e.getDate()+1),new Date(e.setMonth(e.getMonth()))},ea.prototype.getExpectedDays=function(e,t){for(var i=this.getHijriDate(e),n=[],r=0;r<t.length;r++){var a=B.HijriParser.toGregorian(i.year,i.month,t[parseInt(r.toString(),10)]);n.push(a.getDate())}return n},ea.prototype.setDate=function(e,t){var i=this.getHijriDate(e),i=B.HijriParser.toGregorian(i.year,i.month,t);this.updateDateObj(e,i)},ea.prototype.setValidDate=function(e,t,i,n,r){r=B.isNullOrUndefined(r)?e:this.firstDateOfMonth(r),r=this.getHijriDate(r),r=B.HijriParser.toGregorian(r.year,r.month+t,i);this.updateDateObj(e,r)},ea.prototype.setMonth=function(e,t,i){var n=this.getHijriDate(e),n=B.HijriParser.toGregorian(n.year,t,i);this.updateDateObj(e,n)},ea.prototype.addYears=function(e,t,i){var n=this.getHijriDate(e),n=B.HijriParser.toGregorian(n.year+t,i,1);this.updateDateObj(e,n)},ea.prototype.isSameMonth=function(e,t){e=this.getHijriDate(e),t=this.getHijriDate(t);return e.month===t.month},ea.prototype.checkMonth=function(e,t){e=this.getHijriDate(e);return-1===t.indexOf(e.month)},ea.prototype.compareMonth=function(e,t){e=this.getHijriDate(e),t=this.getHijriDate(t);return e.month>t.month},ea.prototype.isSameYear=function(e,t){e=this.getHijriDate(e),t=this.getHijriDate(t);return e.year===t.year},ea.prototype.isLastMonth=function(e){return 12===this.getHijriDate(e).month},ea.prototype.updateDateObj=function(e,t){e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate())},ea.prototype.isLeapYear=function(e,t){return(14+11*(e+t))%30<11},ea.prototype.getDaysInMonth=function(e,t){var i=0,i=29+(e+1)%2;return 11===e&&this.isLeapYear(t,0)&&i++,i},ea.prototype.getHijriDate=function(e){return B.HijriParser.getHijriDate(e)};var $r=ea;function ea(){}ia.prototype.offset=function(e,t){var i=e.getTimezoneOffset();try{var n=new Date(e.toLocaleString("en-US",{timeZone:t}));return isNaN(n.getTime())?0:(e.getTime()-n.getTime())/6e4+i}catch(e){return 0}},ia.prototype.convert=function(e,t,i){"string"==typeof t&&(t=this.offset(e,t)),"string"==typeof i&&(i=this.offset(e,i));var n=e.getTimezoneOffset(),t=(e=new Date(e.getTime()+6e4*(t-i))).getTimezoneOffset();return new Date(e.getTime()+6e4*(t-n))},ia.prototype.add=function(e,t){return this.convert(e,e.getTimezoneOffset(),t)},ia.prototype.remove=function(e,t){return this.convert(e,t,e.getTimezoneOffset())},ia.prototype.removeLocalOffset=function(e){return new Date(e.getTime()-6e4*e.getTimezoneOffset())},ia.prototype.getLocalTimezoneName=function(){return window.Intl&&Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"},ia.prototype.getTimezoneData=function(){return na};var ta=ia;function ia(){this.timezoneData=[],this.timezoneData=this.getTimezoneData()}var na=[{Value:"Pacific/Niue",Text:"(UTC-11:00) Niue"},{Value:"Pacific/Pago_Pago",Text:"(UTC-11:00) Pago Pago"},{Value:"Pacific/Honolulu",Text:"(UTC-10:00) Hawaii Time"},{Value:"Pacific/Rarotonga",Text:"(UTC-10:00) Rarotonga"},{Value:"Pacific/Tahiti",Text:"(UTC-10:00) Tahiti"},{Value:"Pacific/Marquesas",Text:"(UTC-09:30) Marquesas"},{Value:"America/Anchorage",Text:"(UTC-09:00) Alaska Time"},{Value:"Pacific/Gambier",Text:"(UTC-09:00) Gambier"},{Value:"America/Los_Angeles",Text:"(UTC-08:00) Pacific Time"},{Value:"America/Tijuana",Text:"(UTC-08:00) Pacific Time - Tijuana"},{Value:"America/Vancouver",Text:"(UTC-08:00) Pacific Time - Vancouver"},{Value:"America/Whitehorse",Text:"(UTC-08:00) Pacific Time - Whitehorse"},{Value:"Pacific/Pitcairn",Text:"(UTC-08:00) Pitcairn"},{Value:"America/Denver",Text:"(UTC-07:00) Mountain Time"},{Value:"America/Phoenix",Text:"(UTC-07:00) Mountain Time - Arizona"},{Value:"America/Mazatlan",Text:"(UTC-07:00) Mountain Time - Chihuahua, Mazatlan"},{Value:"America/Dawson_Creek",Text:"(UTC-07:00) Mountain Time - Dawson Creek"},{Value:"America/Edmonton",Text:"(UTC-07:00) Mountain Time - Edmonton"},{Value:"America/Hermosillo",Text:"(UTC-07:00) Mountain Time - Hermosillo"},{Value:"America/Yellowknife",Text:"(UTC-07:00) Mountain Time - Yellowknife"},{Value:"America/Belize",Text:"(UTC-06:00) Belize"},{Value:"America/Chicago",Text:"(UTC-06:00) Central Time"},{Value:"America/Mexico_City",Text:"(UTC-06:00) Central Time - Mexico City"},{Value:"America/Regina",Text:"(UTC-06:00) Central Time - Regina"},{Value:"America/Tegucigalpa",Text:"(UTC-06:00) Central Time - Tegucigalpa"},{Value:"America/Winnipeg",Text:"(UTC-06:00) Central Time - Winnipeg"},{Value:"America/Costa_Rica",Text:"(UTC-06:00) Costa Rica"},{Value:"America/El_Salvador",Text:"(UTC-06:00) El Salvador"},{Value:"Pacific/Galapagos",Text:"(UTC-06:00) Galapagos"},{Value:"America/Guatemala",Text:"(UTC-06:00) Guatemala"},{Value:"America/Managua",Text:"(UTC-06:00) Managua"},{Value:"America/Cancun",Text:"(UTC-05:00) America Cancun"},{Value:"America/Bogota",Text:"(UTC-05:00) Bogota"},{Value:"Pacific/Easter",Text:"(UTC-05:00) Easter Island"},{Value:"America/New_York",Text:"(UTC-05:00) Eastern Time"},{Value:"America/Iqaluit",Text:"(UTC-05:00) Eastern Time - Iqaluit"},{Value:"America/Toronto",Text:"(UTC-05:00) Eastern Time - Toronto"},{Value:"America/Guayaquil",Text:"(UTC-05:00) Guayaquil"},{Value:"America/Havana",Text:"(UTC-05:00) Havana"},{Value:"America/Jamaica",Text:"(UTC-05:00) Jamaica"},{Value:"America/Lima",Text:"(UTC-05:00) Lima"},{Value:"America/Nassau",Text:"(UTC-05:00) Nassau"},{Value:"America/Panama",Text:"(UTC-05:00) Panama"},{Value:"America/Port-au-Prince",Text:"(UTC-05:00) Port-au-Prince"},{Value:"America/Rio_Branco",Text:"(UTC-05:00) Rio Branco"},{Value:"America/Halifax",Text:"(UTC-04:00) Atlantic Time - Halifax"},{Value:"America/Barbados",Text:"(UTC-04:00) Barbados"},{Value:"Atlantic/Bermuda",Text:"(UTC-04:00) Bermuda"},{Value:"America/Boa_Vista",Text:"(UTC-04:00) Boa Vista"},{Value:"America/Caracas",Text:"(UTC-04:00) Caracas"},{Value:"America/Curacao",Text:"(UTC-04:00) Curacao"},{Value:"America/Grand_Turk",Text:"(UTC-04:00) Grand Turk"},{Value:"America/Guyana",Text:"(UTC-04:00) Guyana"},{Value:"America/La_Paz",Text:"(UTC-04:00) La Paz"},{Value:"America/Manaus",Text:"(UTC-04:00) Manaus"},{Value:"America/Martinique",Text:"(UTC-04:00) Martinique"},{Value:"America/Port_of_Spain",Text:"(UTC-04:00) Port of Spain"},{Value:"America/Porto_Velho",Text:"(UTC-04:00) Porto Velho"},{Value:"America/Puerto_Rico",Text:"(UTC-04:00) Puerto Rico"},{Value:"America/Santo_Domingo",Text:"(UTC-04:00) Santo Domingo"},{Value:"America/Thule",Text:"(UTC-04:00) Thule"},{Value:"America/St_Johns",Text:"(UTC-03:30) Newfoundland Time - St. Johns"},{Value:"America/Araguaina",Text:"(UTC-03:00) Araguaina"},{Value:"America/Asuncion",Text:"(UTC-03:00) Asuncion"},{Value:"America/Belem",Text:"(UTC-03:00) Belem"},{Value:"America/Argentina/Buenos_Aires",Text:"(UTC-03:00) Buenos Aires"},{Value:"America/Campo_Grande",Text:"(UTC-03:00) Campo Grande"},{Value:"America/Cayenne",Text:"(UTC-03:00) Cayenne"},{Value:"America/Cuiaba",Text:"(UTC-03:00) Cuiaba"},{Value:"America/Fortaleza",Text:"(UTC-03:00) Fortaleza"},{Value:"America/Godthab",Text:"(UTC-03:00) Godthab"},{Value:"America/Maceio",Text:"(UTC-03:00) Maceio"},{Value:"America/Miquelon",Text:"(UTC-03:00) Miquelon"},{Value:"America/Montevideo",Text:"(UTC-03:00) Montevideo"},{Value:"Antarctica/Palmer",Text:"(UTC-03:00) Palmer"},{Value:"America/Paramaribo",Text:"(UTC-03:00) Paramaribo"},{Value:"America/Punta_Arenas",Text:"(UTC-03:00) Punta Arenas"},{Value:"America/Recife",Text:"(UTC-03:00) Recife"},{Value:"Antarctica/Rothera",Text:"(UTC-03:00) Rothera"},{Value:"America/Bahia",Text:"(UTC-03:00) Salvador"},{Value:"America/Santiago",Text:"(UTC-03:00) Santiago"},{Value:"Atlantic/Stanley",Text:"(UTC-03:00) Stanley"},{Value:"America/Noronha",Text:"(UTC-02:00) Noronha"},{Value:"America/Sao_Paulo",Text:"(UTC-02:00) Sao Paulo"},{Value:"Atlantic/South_Georgia",Text:"(UTC-02:00) South Georgia"},{Value:"Atlantic/Azores",Text:"(UTC-01:00) Azores"},{Value:"Atlantic/Cape_Verde",Text:"(UTC-01:00) Cape Verde"},{Value:"America/Scoresbysund",Text:"(UTC-01:00) Scoresbysund"},{Value:"Africa/Abidjan",Text:"(UTC+00:00) Abidjan"},{Value:"Africa/Accra",Text:"(UTC+00:00) Accra"},{Value:"Africa/Bissau",Text:"(UTC+00:00) Bissau"},{Value:"Atlantic/Canary",Text:"(UTC+00:00) Canary Islands"},{Value:"Africa/Casablanca",Text:"(UTC+00:00) Casablanca"},{Value:"America/Danmarkshavn",Text:"(UTC+00:00) Danmarkshavn"},{Value:"Europe/Dublin",Text:"(UTC+00:00) Dublin"},{Value:"Africa/El_Aaiun",Text:"(UTC+00:00) El Aaiun"},{Value:"Atlantic/Faroe",Text:"(UTC+00:00) Faeroe"},{Value:"Etc/UTC",Text:"(UTC+00:00) UTC (no daylight saving)"},{Value:"Europe/Lisbon",Text:"(UTC+00:00) Lisbon"},{Value:"Europe/London",Text:"(UTC+00:00) London"},{Value:"Africa/Monrovia",Text:"(UTC+00:00) Monrovia"},{Value:"Atlantic/Reykjavik",Text:"(UTC+00:00) Reykjavik"},{Value:"UTC",Text:"UTC"},{Value:"Africa/Algiers",Text:"(UTC+01:00) Algiers"},{Value:"Europe/Amsterdam",Text:"(UTC+01:00) Amsterdam"},{Value:"Europe/Andorra",Text:"(UTC+01:00) Andorra"},{Value:"Europe/Berlin",Text:"(UTC+01:00) Berlin"},{Value:"Europe/Brussels",Text:"(UTC+01:00) Brussels"},{Value:"Europe/Budapest",Text:"(UTC+01:00) Budapest"},{Value:"Europe/Belgrade",Text:"(UTC+01:00) Central European Time - Belgrade"},{Value:"Europe/Prague",Text:"(UTC+01:00) Central European Time - Prague"},{Value:"Africa/Ceuta",Text:"(UTC+01:00) Ceuta"},{Value:"Europe/Copenhagen",Text:"(UTC+01:00) Copenhagen"},{Value:"Europe/Gibraltar",Text:"(UTC+01:00) Gibraltar"},{Value:"Africa/Lagos",Text:"(UTC+01:00) Lagos"},{Value:"Europe/Luxembourg",Text:"(UTC+01:00) Luxembourg"},{Value:"Europe/Madrid",Text:"(UTC+01:00) Madrid"},{Value:"Europe/Malta",Text:"(UTC+01:00) Malta"},{Value:"Europe/Monaco",Text:"(UTC+01:00) Monaco"},{Value:"Africa/Ndjamena",Text:"(UTC+01:00) Ndjamena"},{Value:"Europe/Oslo",Text:"(UTC+01:00) Oslo"},{Value:"Europe/Paris",Text:"(UTC+01:00) Paris"},{Value:"Europe/Rome",Text:"(UTC+01:00) Rome"},{Value:"Europe/Stockholm",Text:"(UTC+01:00) Stockholm"},{Value:"Europe/Tirane",Text:"(UTC+01:00) Tirane"},{Value:"Africa/Tunis",Text:"(UTC+01:00) Tunis"},{Value:"Europe/Vienna",Text:"(UTC+01:00) Vienna"},{Value:"Europe/Warsaw",Text:"(UTC+01:00) Warsaw"},{Value:"Europe/Zurich",Text:"(UTC+01:00) Zurich"},{Value:"Asia/Amman",Text:"(UTC+02:00) Amman"},{Value:"Europe/Athens",Text:"(UTC+02:00) Athens"},{Value:"Asia/Beirut",Text:"(UTC+02:00) Beirut"},{Value:"Europe/Bucharest",Text:"(UTC+02:00) Bucharest"},{Value:"Africa/Cairo",Text:"(UTC+02:00) Cairo"},{Value:"Europe/Chisinau",Text:"(UTC+02:00) Chisinau"},{Value:"Asia/Damascus",Text:"(UTC+02:00) Damascus"},{Value:"Asia/Gaza",Text:"(UTC+02:00) Gaza"},{Value:"Europe/Helsinki",Text:"(UTC+02:00) Helsinki"},{Value:"Asia/Jerusalem",Text:"(UTC+02:00) Jerusalem"},{Value:"Africa/Johannesburg",Text:"(UTC+02:00) Johannesburg"},{Value:"Africa/Khartoum",Text:"(UTC+02:00) Khartoum"},{Value:"Europe/Kiev",Text:"(UTC+02:00) Kiev"},{Value:"Africa/Maputo",Text:"(UTC+02:00) Maputo"},{Value:"Europe/Kaliningrad",Text:"(UTC+02:00) Moscow-01 - Kaliningrad"},{Value:"Asia/Nicosia",Text:"(UTC+02:00) Nicosia"},{Value:"Europe/Riga",Text:"(UTC+02:00) Riga"},{Value:"Europe/Sofia",Text:"(UTC+02:00) Sofia"},{Value:"Europe/Tallinn",Text:"(UTC+02:00) Tallinn"},{Value:"Africa/Tripoli",Text:"(UTC+02:00) Tripoli"},{Value:"Europe/Vilnius",Text:"(UTC+02:00) Vilnius"},{Value:"Africa/Windhoek",Text:"(UTC+02:00) Windhoek"},{Value:"Asia/Baghdad",Text:"(UTC+03:00) Baghdad"},{Value:"Europe/Istanbul",Text:"(UTC+03:00) Istanbul"},{Value:"Europe/Minsk",Text:"(UTC+03:00) Minsk"},{Value:"Europe/Moscow",Text:"(UTC+03:00) Moscow+00 - Moscow"},{Value:"Africa/Nairobi",Text:"(UTC+03:00) Nairobi"},{Value:"Asia/Qatar",Text:"(UTC+03:00) Qatar"},{Value:"Asia/Riyadh",Text:"(UTC+03:00) Riyadh"},{Value:"Antarctica/Syowa",Text:"(UTC+03:00) Syowa"},{Value:"Asia/Tehran",Text:"(UTC+03:30) Tehran"},{Value:"Asia/Baku",Text:"(UTC+04:00) Baku"},{Value:"Asia/Dubai",Text:"(UTC+04:00) Dubai"},{Value:"Indian/Mahe",Text:"(UTC+04:00) Mahe"},{Value:"Indian/Mauritius",Text:"(UTC+04:00) Mauritius"},{Value:"Europe/Samara",Text:"(UTC+04:00) Moscow+01 - Samara"},{Value:"Indian/Reunion",Text:"(UTC+04:00) Reunion"},{Value:"Asia/Tbilisi",Text:"(UTC+04:00) Tbilisi"},{Value:"Asia/Yerevan",Text:"(UTC+04:00) Yerevan"},{Value:"Asia/Kabul",Text:"(UTC+04:30) Kabul"},{Value:"Asia/Aqtau",Text:"(UTC+05:00) Aqtau"},{Value:"Asia/Aqtobe",Text:"(UTC+05:00) Aqtobe"},{Value:"Asia/Ashgabat",Text:"(UTC+05:00) Ashgabat"},{Value:"Asia/Dushanbe",Text:"(UTC+05:00) Dushanbe"},{Value:"Asia/Karachi",Text:"(UTC+05:00) Karachi"},{Value:"Indian/Kerguelen",Text:"(UTC+05:00) Kerguelen"},{Value:"Indian/Maldives",Text:"(UTC+05:00) Maldives"},{Value:"Antarctica/Mawson",Text:"(UTC+05:00) Mawson"},{Value:"Asia/Yekaterinburg",Text:"(UTC+05:00) Moscow+02 - Yekaterinburg"},{Value:"Asia/Tashkent",Text:"(UTC+05:00) Tashkent"},{Value:"Asia/Colombo",Text:"(UTC+05:30) Colombo"},{Value:"Asia/Kolkata",Text:"(UTC+05:30) India Standard Time"},{Value:"Asia/Katmandu",Text:"(UTC+05:45) Katmandu"},{Value:"Asia/Almaty",Text:"(UTC+06:00) Almaty"},{Value:"Asia/Bishkek",Text:"(UTC+06:00) Bishkek"},{Value:"Indian/Chagos",Text:"(UTC+06:00) Chagos"},{Value:"Asia/Dhaka",Text:"(UTC+06:00) Dhaka"},{Value:"Asia/Omsk",Text:"(UTC+06:00) Moscow+03 - Omsk"},{Value:"Asia/Thimphu",Text:"(UTC+06:00) Thimphu"},{Value:"Antarctica/Vostok",Text:"(UTC+06:00) Vostok"},{Value:"Indian/Cocos",Text:"(UTC+06:30) Cocos"},{Value:"Asia/Yangon",Text:"(UTC+06:30) Rangoon"},{Value:"Asia/Bangkok",Text:"(UTC+07:00) Bangkok"},{Value:"Indian/Christmas",Text:"(UTC+07:00) Christmas"},{Value:"Antarctica/Davis",Text:"(UTC+07:00) Davis"},{Value:"Asia/Saigon",Text:"(UTC+07:00) Hanoi"},{Value:"Asia/Hovd",Text:"(UTC+07:00) Hovd"},{Value:"Asia/Jakarta",Text:"(UTC+07:00) Jakarta"},{Value:"Asia/Krasnoyarsk",Text:"(UTC+07:00) Moscow+04 - Krasnoyarsk"},{Value:"Asia/Brunei",Text:"(UTC+08:00) Brunei"},{Value:"Asia/Shanghai",Text:"(UTC+08:00) China Time - Beijing"},{Value:"Asia/Choibalsan",Text:"(UTC+08:00) Choibalsan"},{Value:"Asia/Hong_Kong",Text:"(UTC+08:00) Hong Kong"},{Value:"Asia/Kuala_Lumpur",Text:"(UTC+08:00) Kuala Lumpur"},{Value:"Asia/Macau",Text:"(UTC+08:00) Macau"},{Value:"Asia/Makassar",Text:"(UTC+08:00) Makassar"},{Value:"Asia/Manila",Text:"(UTC+08:00) Manila"},{Value:"Asia/Irkutsk",Text:"(UTC+08:00) Moscow+05 - Irkutsk"},{Value:"Asia/Singapore",Text:"(UTC+08:00) Singapore"},{Value:"Asia/Taipei",Text:"(UTC+08:00) Taipei"},{Value:"Asia/Ulaanbaatar",Text:"(UTC+08:00) Ulaanbaatar"},{Value:"Australia/Perth",Text:"(UTC+08:00) Western Time - Perth"},{Value:"Asia/Pyongyang",Text:"(UTC+08:30) Pyongyang"},{Value:"Asia/Dili",Text:"(UTC+09:00) Dili"},{Value:"Asia/Jayapura",Text:"(UTC+09:00) Jayapura"},{Value:"Asia/Yakutsk",Text:"(UTC+09:00) Moscow+06 - Yakutsk"},{Value:"Pacific/Palau",Text:"(UTC+09:00) Palau"},{Value:"Asia/Seoul",Text:"(UTC+09:00) Seoul"},{Value:"Asia/Tokyo",Text:"(UTC+09:00) Tokyo"},{Value:"Australia/Darwin",Text:"(UTC+09:30) Central Time - Darwin"},{Value:"Antarctica/DumontDUrville",Text:'(UTC+10:00) Dumont D"Urville'},{Value:"Australia/Brisbane",Text:"(UTC+10:00) Eastern Time - Brisbane"},{Value:"Pacific/Guam",Text:"(UTC+10:00) Guam"},{Value:"Asia/Vladivostok",Text:"(UTC+10:00) Moscow+07 - Vladivostok"},{Value:"Pacific/Port_Moresby",Text:"(UTC+10:00) Port Moresby"},{Value:"Pacific / Chuuk",Text:"(UTC+10:00) Truk"},{Value:"Australia/Adelaide",Text:"(UTC+10:30) Central Time - Adelaide"},{Value:"Antarctica/Casey",Text:"(UTC+11:00) Casey"},{Value:"Australia/Hobart",Text:"(UTC+11:00) Eastern Time - Hobart"},{Value:"Australia/Sydney",Text:"(UTC+11:00) Eastern Time - Melbourne, Sydney"},{Value:"Pacific/Efate",Text:"(UTC+11:00) Efate"},{Value:"Pacific/Guadalcanal",Text:"(UTC+11:00) Guadalcanal"},{Value:"Pacific/Kosrae",Text:"(UTC+11:00) Kosrae"},{Value:"Asia/Magadan",Text:"(UTC+11:00) Moscow+08 - Magadan"},{Value:"Pacific / Norfolk",Text:"(UTC+11:00) Norfolk"},{Value:"Pacific/Noumea",Text:"(UTC+11:00) Noumea"},{Value:"Pacific/Pohnpei",Text:"(UTC+11:00) Ponape"},{Value:"Pacific/Funafuti",Text:"(UTC+12:00) Funafuti"},{Value:"Pacific/Kwajalein",Text:"(UTC+12:00) Kwajalein"},{Value:"Pacific/Majuro",Text:"(UTC+12:00) Majuro"},{Value:"Asia/Kamchatka",Text:"(UTC+12:00) Moscow+09 - Petropavlovsk - Kamchatskiy"},{Value:"Pacific / Nauru",Text:"(UTC+12:00) Nauru"},{Value:"Pacific/Tarawa",Text:"(UTC+12:00) Tarawa"},{Value:"Pacific/Wake",Text:"(UTC+12:00) Wake"},{Value:"Pacific/Wallis",Text:"(UTC+12:00) Wallis"},{Value:"Pacific/Auckland",Text:"(UTC+13:00) Auckland"},{Value:"Pacific/Enderbury",Text:"(UTC+13:00) Enderbury"},{Value:"Pacific/Fakaofo",Text:"(UTC+13:00) Fakaofo"},{Value:"Pacific/Fiji",Text:"(UTC+13:00) Fiji"},{Value:"Pacific/Tongatapu",Text:"(UTC+13:00) Tongatapu"},{Value:"Pacific/Apia",Text:"(UTC+14:00) Apia"},{Value:"Pacific/Kiritimati",Text:"(UTC+14:00) Kiritimati"}];function ra(e,t,i,n){void 0===n&&(n="Gregorian");var r,a,s,o=xa(e),l=t.getConstant("every")+" ",e=n.toLowerCase();switch(a="en"===i||"en-US"===i?(s="days.stand-alone.abbreviated",r=B.getValue("months.stand-alone.abbreviated",B.getDefaultDateObject(e)),B.getValue(s,B.getDefaultDateObject(e))):(s="main."+i+".dates.calendars."+e+".days.stand-alone.abbreviated",r=B.getValue("main."+i+".dates.calendars."+e+".months.stand-alone.abbreviated",B.cldrData),B.getValue(s,B.cldrData)),1<o.interval&&(l+=o.interval+" "),o.freq){case"DAILY":l+=t.getConstant("summaryDay");break;case"WEEKLY":l+=t.getConstant("summaryWeek")+" "+t.getConstant(La)+" ",o.day.forEach(function(e,t){l=(l+=y(B.getValue(qa[""+e],a),"single"))+(o.day.length-1===t?"":", ")});break;case"MONTHLY":l=(l+=t.getConstant("summaryMonth")+" "+t.getConstant(La)+" ")+aa(o,a,t);break;case"YEARLY":l=(l=(l+=t.getConstant("summaryYear")+" "+t.getConstant(La)+" ")+(y(B.getValue(o.month[0].toString(),r),"single")+" "))+aa(o,a,t)}return o.count?l+=", "+o.count+" "+t.getConstant("summaryTimes"):o.until&&(n=o.until,l+=", "+t.getConstant("summaryUntil")+" "+n.getDate()+" "+y(B.getValue((n.getMonth()+1).toString(),r),"single")+" "+n.getFullYear()),l}function aa(e,t,i){var n,r="";return e.monthDay.length?r+=e.monthDay[0]:e.day&&(n=e.setPosition-1,r+=i.getConstant(Na[-1<n?n:Na.length-1])+" "+y(B.getValue(qa[e.day[0]],t),"single")),r}function sa(e,t,i,n,r,a,s,o){void 0===r&&(r=43),void 0===a&&(a=null),void 0===s&&(s="Gregorian"),void 0===o&&(o=null);var l=xa(t),p=(_=Ia(s),[]),c=new Date(e.getTime()),t=(Ma=[],B.isNullOrUndefined(i)?[]:i.split(",")),j=new ta;if(t.forEach(function(e){e=oa(e);o&&(e=j.add(new Date(e.getTime()),o)),Ma.push(new Date(e.getTime()).setHours(0,0,0,0))}),l.recExceptionCount=B.isNullOrUndefined(l.count)?0:Ma.length,Ra=a&&e<a&&!l.count?new Date(new Date(a.getTime()).setHours(0,0,0)):null,!l.until&&Ra&&((s=new Date(Ra.getTime())).setDate(Ra.getDate()+r*l.interval),l.until=s),!(l.until&&e>l.until)){ka=r,n=n||0;for(var N=ja[parseInt(n.toString(),10)];Pa[0]!==N;){h=void 0;d=void 0;var h=Pa;var d=h.shift();h.push(d)}switch(l.until&&(i=z(l.until),l.until=new Date(i.getFullYear(),i.getMonth(),i.getDate(),23,59,59)),l.freq){case"DAILY":for(var u=c,L=l.until,g=p,m=l,v=new Date(u.getTime()),q=m.interval,f=pa(u,m),y=m.day;Ca(v,L)&&!(Aa(v,m)&&(-1<y.indexOf(ja[v.getDay()])||0===y.length)&&(la(g,v.getTime()),f)&&g.length+m.recExceptionCount>=f);)v.setDate(v.getDate()+q),v.getHours()!==u.getHours()&&v.setHours(u.getHours());break;case"WEEKLY":var T=c,w=l.until,D=p,b=l,F=n,S=new Date(T.getTime());b.day.length||b.day.push(ja[T.getDay()]);var C,O=b.interval,E=b.day,x=pa(T,b),U=!0,V=[];if(1<E.length)for(!B.isNullOrUndefined(b.wkst)&&""!==b.wkst||(b.wkst=Pa[0]),C=ja.indexOf(b.wkst);Ca(S,w);){var A=ja.indexOf(ja[S.getDay()])-C,A=Y(S,-(A=-1==A?6:A)),I=Y(A,6),M=new Date(S.getTime());for(I=z(I),M=z(M);M<=I&&(-1<E.indexOf(ja[S.getDay()])&&V.push([S.getTime()]),!(x&&D.length+b.recExceptionCount>=x));)S.setDate(S.getDate()+1),S.getHours()!==T.getHours()&&S.setHours(T.getHours()),M=z(M=new Date(S.getTime()));if(S.setDate(S.getDate()-1),x&&D.length+b.recExceptionCount>=x)break;S.setDate(S.getDate()+1+7*(O-1)),fa(V,0,T,w,D,b),V=[]}else{for(S=Ea(T,b.day),1<O&&Pa.indexOf(b.day[0])<T.getDay()-F&&S.setDate(S.getDate()+7*(O-1));Ca(S,w)&&((U=Aa(S,b))&&-1<E.indexOf(ja[S.getDay()])&&la(D,S.getTime()),!(x&&D.length+b.recExceptionCount>=x));)S.setDate(S.getDate()+7*O);fa(V,0,T,w,D,b),V=[]}break;case"MONTHLY":ca(c,l.until,p,l);break;case"YEARLY":var k=c,R=l.until,H=p,P=l;switch(function(e){{if(e.yearDay.length)return"YEARDAY";if(e.weekNo.length)return"WEEKNO"}return"MONTH"}(P)){case"MONTH":ca(k,R,H,P);break;case"WEEKNO":!function(e,t,i,n){var r,a,s,o,l,p,c=_.getYearLastDate(e,0),h=pa(e,n),d=n.weekNo,u=[],g=n.day;for(;Ca(c,t);){a=Pa.indexOf(ja[c.getDay()]),s=6-a+1;for(var m=0;m<d.length;m++)for(o=d[parseInt(m.toString(),10)],l=1===(o=0<o?o:53+o+1)?s:s+7*(o-1),p=1===o?s-7:s+7*(o-2);p<l;)r=new Date(c.getTime()+W*p),(0===g.length||-1<g.indexOf(ja[r.getDay()]))&&(B.isNullOrUndefined(n.setPosition)?Da(0,e,t,i,n,r.getTime()):u.push([r.getTime()])),p++;if(B.isNullOrUndefined(n.setPosition)||Sa(u,0,e,t,i,n),h&&i.length+n.recExceptionCount>=h)return;c=_.getYearLastDate(r,n.interval),u=[]}}(k,R,H,P);break;case"YEARDAY":!function(e,t,i,n){var r,a,s=_.getYearLastDate(e,0),o=pa(e,n),l=[],p=n.day;for(;Ca(s,t);){for(var c=0;c<n.yearDay.length;c++)a=n.yearDay[parseInt(c.toString(),10)],r=new Date(s.getTime()),a!==_.getLeapYearDaysCount()&&a!==-_.getLeapYearDaysCount()||_.isLeapYear(_.getFullYear(r),1)?(r.setDate(r.getDate()+(a<0?_.getYearDaysCount(r,1)+1+a:a)),(0===p.length||-1<p.indexOf(ja[r.getDay()]))&&(null==n.setPosition?Da(0,e,t,i,n,r.getTime()):l.push([r.getTime()]))):r.setDate(r.getDate()+1);if(B.isNullOrUndefined(n.setPosition)||Sa(l,0,e,t,i,n),o&&i.length+n.recExceptionCount>=o)return;s=_.getYearLastDate(r,n.interval),l=[]}}(k,R,H,P)}}}return p}function oa(e){return new Date(e.substr(0,4)+"-"+e.substr(4,2)+"-"+e.substr(6,5)+":"+e.substr(11,2)+":"+e.substr(13))}function la(e,t){var i=new Date(t).setHours(0,0,0,0);-1===Ma.indexOf(i)&&(!Ra||i>=Ra.getTime())&&e.push(t)}function pa(e,t){var i=ka;return t.count?i=t.count:t.until&&("DAILY"===t.freq||"WEEKLY"===t.freq?i=Math.floor((t.until.getTime()-e.getTime())/W)+1:"MONTHLY"!==t.freq&&"YEARLY"!==t.freq||(i=Math.floor((t.until.getMonth()+12*t.until.getFullYear()-(e.getMonth()+12*e.getFullYear()))/t.interval)+(1<t.day.length?Math.floor((t.until.getTime()-e.getTime())/W)+1:1),"YEARLY"===t.freq&&(i=1<t.month.length?i*t.month.length:i))),i}function ca(e,t,i,n){switch(n.month.length||n.day.length||n.monthDay.length?0<n.month.length&&!n.day.length&&!n.monthDay.length&&n.monthDay.push(e.getDate()):(n.monthDay.push(e.getDate()),"YEARLY"===n.freq&&n.month.push(e.getMonth()+1)),function(e){{if(e.monthDay.length&&!e.day.length)return"date";if(!e.monthDay.length&&e.day.length)return"day"}return"both"}(n)){case"day":switch(n.freq){case"MONTHLY":va(e,t,i,n);break;case"YEARLY":!function(e,t,i,n){var r=n.day,a=r.map(function(e){return Fa.test(e)});if(1<r.length&&-1<a.indexOf(!0)){var s,o,l,p=e,c=t,h=i,d=n,u=d.day,g=pa(p,d),m=new Date(p.getTime()),v=d.interval,f=[],y=[],T=0,w=(m=_.getMonthStartDate(m),[]);for(d.month.length&&_.setMonth(m,d.month[0],1),m=Ea(m,d.day);Ca(m,c);){o=new Date(m.getTime());for(var D=0;D<=d.month.length;D++)for(var b=0;b<=u.length-1;b++){for(m=Ea(m=_.getMonthStartDate(m),d.day),f=[];_.isSameYear(o,m)&&g&&h.length+d.recExceptionCount<=g;)for(;_.isSameYear(o,m);){if(o=new Date(m.getTime()),0===d.month.length||0<d.month.length&&d.month[parseInt(D.toString(),10)]===_.getMonth(o)){var S=u[parseInt(b.toString(),10)].match(Ba),C=parseInt(S[0],10);for(l=new Date(m.getTime());_.isSameYear(l,m)&&_.isSameMonth(l,m);)S[S.length-1]===ja[l.getDay()]&&f.push([l.getTime()]),l.setDate(l.getDate()+1);l.setDate(l.getDate()-1),s=-1<S[0].indexOf("-")?f.length- -1*C:C-1,s=isNaN(s)?0:s}T=ga(m,d,T,void 0,1),m=Ea(m,d.day)}if(m=0===b&&l?new Date(l.getTime()):new Date(o.getTime()),0<f.length&&(B.isNullOrUndefined(d.setPosition)?Sa(f,0,p,c,h,d,s):y=[wa(f,s,w)]),g&&h.length+d.recExceptionCount>=g)return}B.isNullOrUndefined(d.setPosition)||(ba(y,0,p,c,h,d),w=[]),_.isLastMonth(m)?(_.setValidDate(m,1,1),m.setFullYear(m.getFullYear()+v-1)):m.setFullYear(m.getFullYear()+v),m=Ea(m,d.day),d.month.length&&_.setMonth(m,d.month[0],m.getDate())}}else if(n.month.length&&1===r.length&&-1<a.indexOf(!0))va(e,t,i,n);else{var O,E=new Date(e.getTime()),x=pa(e,n),V=n.interval,A=[];for(n.month.length&&_.setMonth(E,n.month[0],E.getDate()),B.isNullOrUndefined(n.setPosition)&&0===n.month.length&&0===n.weekNo.length&&E.setFullYear(e.getFullYear(),0,1),E=Ea(E=_.getMonthStartDate(E),n.day);Ca(E,t);){for(O=new Date(E.getTime());_.isSameYear(O,E)&&x&&i.length+n.recExceptionCount<=x;)for(O=new Date(E.getTime());_.isSameYear(O,E);){if(!(0===n.month.length||0<n.month.length&&!_.checkMonth(E,n.month))){_.setValidDate(E,1,1),E=Ea(E,n.day);break}if(1<r.length){if(_.compareMonth(O,E)){_.setValidDate(E,1,1),E=Ea(E,n.day);break}-1<r.indexOf(ja[O.getDay()])&&A.push([O.getTime()]),O.setDate(O.getDate()+1)}else{if(O.getFullYear()>E.getFullYear()){_.setValidDate(E,1,1),E=Ea(E,n.day);break}var I=Oa(r[0]);ja[O.getDay()]===I&&new Date(O.getFullYear(),O.getMonth(),0)>new Date(e.getFullYear())&&A.push([O.getTime()]),O.setDate(O.getDate()+7)}}if(E.setFullYear(O.getFullYear(),O.getMonth(),O.getDate()),Ta(A,e,t,i,n),_.isLastMonth(E)&&(_.setValidDate(E,1,1),E=Ea(E,n.day)),E.setFullYear(E.getFullYear()+V-1),x&&i.length+n.recExceptionCount>=x)return;E=Ea(E,n.day),A=[]}}}(e,t,i,n)}break;case"both":case"date":switch(n.freq){case"MONTHLY":da(e,t,i,n);break;case"YEARLY":!function(e,t,i,n){if(n.month.length)da(e,t,i,n);else{var r,a=ha(e,n);for(a.tempDate=a.mainDate=_.getMonthStartDate(a.tempDate);Ca(a.tempDate,t);){for(r=new Date(a.tempDate.getTime());_.isSameYear(r,a.tempDate)&&a.expectedCount&&i.length+n.recExceptionCount<=a.expectedCount;){if(!(0===n.month.length||0<n.month.length&&!_.checkMonth(a.tempDate,n.month))){_.setValidDate(a.tempDate,1,1),a.tempDate=Ea(a.tempDate,n.day);break}ua(n,a,t,!1),a.beginDate=new Date(a.tempDate.getTime()),a.monthInit=ga(a.tempDate,n,a.monthInit,a.beginDate)}if(a.tempDate.setFullYear(r.getFullYear(),r.getMonth(),r.getDate()),fa(a.dateCollection,a.state,e,t,i,n),_.isLastMonth(a.tempDate)&&(_.setValidDate(a.tempDate,1,1),a.tempDate=Ea(a.tempDate,n.day)),a.expectedCount&&i.length+n.recExceptionCount>=a.expectedCount)return;a.tempDate.setFullYear(a.tempDate.getFullYear()+n.interval-1),a.tempDate=Ea(a.tempDate,n.day),a.monthInit=ga(a.tempDate,n,a.monthInit,a.beginDate),a.dateCollection=[]}}}(e,t,i,n)}}}function ha(e,t){e={monthCollection:[],index:0,tempDate:new Date(e.getTime()),mainDate:new Date(e.getTime()),expectedCount:pa(e,t),monthInit:0,dateCollection:[]};return t.month.length&&_.setMonth(e.tempDate,t.month[0],e.tempDate.getDate()),e}function da(e,t,i,n){var r=ha(e,n);if(r.tempDate=r.mainDate=_.getMonthStartDate(r.tempDate),!(("MONTHLY"===n.freq&&12===n.interval||"YEARLY"===n.freq)&&_.getMonthDaysCount(e)<n.monthDay[0]))for(;Ca(r.tempDate,t);){if(r.beginDate=new Date(r.tempDate.getTime()),ua(n,r,t,!0,e,i),B.isNullOrUndefined(n.setPosition)||Sa(r.dateCollection,r.state,e,t,i,n),r.expectedCount&&i.length+n.recExceptionCount>=r.expectedCount)return;r.monthInit=ga(r.tempDate,n,r.monthInit,r.beginDate),r.dateCollection=[]}}function ua(e,t,i,n,r,a){for(var s,o,l,p=0;p<e.monthDay.length;p++){t.date=e.monthDay[parseInt(p.toString(),10)],t.tempDate=_.getMonthStartDate(t.tempDate);var c=_.getMonthDaysCount(t.tempDate);if(t.date=0<t.date?t.date:c+t.date+1,c=t.tempDate,s=t.date,o=t.mainDate,l=void 0,l=_.getMonthDaysCount(c),s<=l&&o<=c&&0<t.date){if(_.setDate(t.tempDate,t.date),i&&t.tempDate>i)return;(0===e.day.length||-1<e.day.indexOf(ja[t.tempDate.getDay()]))&&(n&&B.isNullOrUndefined(e.setPosition)&&t.expectedCount&&a.length+e.recExceptionCount<t.expectedCount?Da(t.state,r,i,a,e,t.tempDate.getTime()):t.dateCollection.push([t.tempDate.getTime()]))}}}function ga(e,t,i,n,r){var a=(n=void 0===n?null:n)?n.getMonth():0,s=_.getMonthStartDate(e);return r=B.isNullOrUndefined(r)?t.interval:r,e.setFullYear(s.getFullYear()),e.setMonth(s.getMonth()),e.setDate(s.getDate()),t.month.length?(i++,i%=t.month.length,_.setMonth(e,t.month[parseInt(i.toString(),10)],1),0===i&&_.addYears(e,r,t.month[0])):(n&&n.getFullYear()<e.getFullYear()&&(a=e.getMonth()-1),_.setValidDate(e,r,1,a,n)),i}function ma(e,t,i,n){var r,a=n.day,s=new Date(e.getTime()),o=(s=_.getMonthStartDate(s),[]),l=[],p=[],c=pa(e,n),h=0;for(n.month.length&&_.setMonth(s,n.month[0],1),s=Ea(s,n.day);Ca(s,t)&&c&&i.length+n.recExceptionCount<c;){var d=new Date(s.getTime());if(-1<a.map(function(e){return Fa.test(e)}).indexOf(!0)){for(var u=0;u<=a.length-1;u++){var g=a[parseInt(u.toString(),10)].match(Ba),m=parseInt(g[0],10),s=new Date(s.getTime());for(s=Ea(s=_.getMonthStartDate(s),a),d.setFullYear(s.getFullYear(),s.getMonth(),s.getDate());_.isSameYear(d,s)&&_.isSameMonth(d,s);)g[g.length-1]===ja[d.getDay()]&&o.push([d.getTime()]),d.setDate(d.getDate()+1);if(d.setDate(d.getDate()-1),w=-1<g[0].indexOf("-")?o.length- -1*m:m-1,w=isNaN(w)?0:w,0<o.length&&(B.isNullOrUndefined(n.setPosition)?Sa(o,0,e,t,i,n,w):l=[wa(o,w,p)]),c&&i.length+n.recExceptionCount>=c)return;o=[]}B.isNullOrUndefined(n.setPosition)||(ba(l,0,e,t,i,n),p=[])}else{for(var v=[],f=function(r){var a={};return r.forEach(function(e,t){if(t===r.length-1){for(var i=Pa.indexOf(e),n=i;n%7!==Pa.indexOf(r[0]);)n++;a[""+e]=n-i}else a[""+e]=Pa.indexOf(r[t+1])-Pa.indexOf(e)}),a}(a),y=(d.setFullYear(s.getFullYear(),s.getMonth(),s.getDate()),new Date(s.getTime())),T=new Date(s.getTime());_.isSameMonth(y,s);)v.push(s.getTime()),-1<a.indexOf(ja[s.getDay()])&&(o.push(v),v=[]),s.setDate(s.getDate()+f[ja[s.getDay()]]);if(w=n.setPosition<1?o.length+n.setPosition:n.setPosition-1,B.isNullOrUndefined(n.setPosition)){for(var w=0,D=[],b=0;b<o.length;b++)for(var S=0;S<o[parseInt(b.toString(),10)].length;S++)D.push(o[parseInt(b.toString(),10)][parseInt(S.toString(),10)]);o=[D]}if(0<o.length&&Sa(o,0,e,t,i,n,w),c&&i.length+n.recExceptionCount>=c)return}h=ga(s,n,h,T),s=Ea(s,n.day),o=[]}}function va(e,t,i,n){if(1<n.day.length)ma(e,t,i,n);else{var r=new Date(e.getTime()),a=pa(e,n),s=[],o=0,r=_.getMonthStartDate(r);for(n.month.length&&_.setMonth(r,n.month[0],1),r=Ea(r,n.day);Ca(r,t)&&a&&i.length+n.recExceptionCount<a;){for(var l=new Date(r.getTime()),p=new Date(r.getTime());_.isSameMonth(r,p);)s.push([p.getTime()]),p.setDate(p.getDate()+7);Ta(s,e,t,i,n),o=ga(r,n,o,l),r=Ea(r,n.day),s=[]}}}function fa(e,t,i,n,r,a){var s=a.setPosition<1?e.length+a.setPosition:a.setPosition-1;B.isNullOrUndefined(a.setPosition)&&(s=0,e=ya(e)),0<e.length&&Sa(e,0,i,n,r,a,s)}function ya(e){for(var t=[],i=0;i<e.length;i++)for(var n=0;n<e[parseInt(i.toString(),10)].length;n++)t.push(new Date(e[parseInt(i.toString(),10)][parseInt(n.toString(),10)]).getTime());return e=0<t.length?[t]:[]}function Ta(e,t,i,n,r){var a,s,o,l=r.day,l=(a=e,o={monthCollection:[],index:0},1===(l=l).length&&(p=void 0,1<(l=l[0].match(Ba)).length)?s=(p=parseInt(l[0],10))<1?a.length+p:p-1:(s=0,a=ya(a)),o.monthCollection=a,o.index=s,o),p=(e=l.monthCollection,l.index);null!=r.setPosition?ba([wa(e,p,[])],0,t,i,n,r):0<e.length&&Sa(e,0,t,i,n,r,p)}function wa(e,t,i){for(var n=0;n<e[parseInt(t.toString(),10)].length;n++)i.push(e[parseInt(t.toString(),10)][parseInt(n.toString(),10)]);return i}function Da(e,t,i,n,r,a){var s=pa(t,r),o=new Date(a);e=Aa(o,r),t<=o&&Ca(o,i)&&e&&s&&n.length+r.recExceptionCount<s&&la(n,a)}function ba(e,t,i,n,r,a){if(0<e.length)for(var s=0;s<e.length;s++){e[parseInt(s.toString(),10)].sort();var o=a.day.map(function(e){return Fa.test(e)}),o="YEARLY"===a.freq&&-1<a.validRules.indexOf("BYMONTH")&&!(-1<o.indexOf(!0))?(o=new Date(e[0][0]).getFullYear(),l=e,c=s,h=a,d=void(p=0),p=p||0,d=new Date(o,h.month[0]-1,1),o=new Date(o,h.month[0],0).getDate(),d=(d.getDay()-p+7)%7,p=Math.ceil((d+o)/7)-1,d=l[parseInt(c.toString(),10)][parseInt(p.toString(),10)],Aa(new Date(d),h)?p:p-1):e[parseInt(s.toString(),10)].length+a.setPosition,l=a.setPosition<1?o:a.setPosition-1;Da(0,i,n,r,a,e[parseInt(s.toString(),10)][parseInt(l.toString(),10)])}var p,l,c,h,d}function Sa(e,t,i,n,r,a,s){if(0<e.length){s=B.isNullOrUndefined(s)?a.setPosition<1?e.length+a.setPosition:a.setPosition-1:s,e[parseInt(s.toString(),10)].sort();for(var o=0;o<e[parseInt(s.toString(),10)].length;o++)Da(0,i,n,r,a,e[parseInt(s.toString(),10)][parseInt(o.toString(),10)])}}function Ca(e,t){return!t||e<=t}function Oa(e){return e.replace(Ua,"")}function Ea(e,t){var i,n=new Date(e.getTime());if(0<t.length){for(var r=[],a=0;a<=t.length-1;a++)i=Oa(t[parseInt(a.toString(),10)]),r.push(i);if(-1===r.indexOf(ja[n.getDay()]))for(;n.setDate(n.getDate()+1),-1===r.indexOf(ja[n.getDay()]););}return n}function xa(e){var t,i={freq:null,interval:1,count:null,until:null,day:[],wkst:null,month:[],weekNo:[],monthDay:[],yearDay:[],setPosition:null,validRules:[]},e=e.split(";"),n=[];return e.forEach(function(e){switch((n=e.split("="))[0]){case"UNTIL":t=n[1],i.until=oa(t);break;case"BYDAY":i.day=n[1].split(","),i.validRules.push(n[0]);break;case"BYMONTHDAY":i.monthDay=n[1].split(",").map(Number),i.validRules.push(n[0]);break;case"BYMONTH":i.month=n[1].split(",").map(Number),i.validRules.push(n[0]);break;case"BYYEARDAY":i.yearDay=n[1].split(",").map(Number),i.validRules.push(n[0]);break;case"BYWEEKNO":i.weekNo=n[1].split(",").map(Number),i.validRules.push(n[0]);break;case"INTERVAL":i.interval=parseInt(n[1],10);break;case"COUNT":i.count=parseInt(n[1],10);break;case"BYSETPOS":i.setPosition=4<parseInt(n[1],10)?-1:parseInt(n[1],10);break;case"FREQ":i.freq=n[1];break;case"WKST":i.wkst=n[1]}}),"MONTHLY"===i.freq&&0===i.monthDay.length&&(e=i.validRules.indexOf("BYDAY"),i.validRules.splice(e,1)),i}function Va(e,t){for(var i,n=t.slice(0),r=(t=e,Ha[_.getFullYear(t)]||(Ha[_.getFullYear(t)]=_.getYearLastDate(t,0)),i=Ha[_.getFullYear(t)],t=t.getTime()-i.getTime(),Math.ceil(t/W)),a=n.shift();a;){if((a=a<0?a+_.getYearDaysCount(e,0)+1:a)===r)return;a=n.shift()}return 1}function Aa(n,e){var r=!0,a=e.day,s=e.month,o=_.getExpectedDays(n,e.monthDay),l=e.yearDay;return e.validRules.forEach(function(e){switch(e){case"BYDAY":t=n.getDay(),i=[],a.forEach(function(e){e=e.match(Ba);2===e.length?i.push(e[1]):i.push(e[0])}),-1===i.indexOf(ja[parseInt(t.toString(),10)])&&(r=!1);break;case"BYMONTH":_.checkMonth(n,s)&&(r=!1);break;case"BYMONTHDAY":!function(e,t){for(var i=t.slice(0),n=_.getMonthDaysCount(e),r=i.shift();r;){if((r=r<0?r+n+1:r)===e.getDate())return;r=i.shift()}return 1}(n,o)||(r=!1);break;case"BYYEARDAY":Va(n,l)&&(r=!1)}var t,i}),r}function Ia(e){return new("Islamic"===e?$r:Zr)}var Ma,ka,Ra,_,Ha={},Pa=["SU","MO","TU","WE","TH","FR","SA"],ja=["SU","MO","TU","WE","TH","FR","SA"],Na=["first","second","third","fourth","last"],La="summaryOn",qa={SU:"sun",MO:"mon",TU:"tue",WE:"wed",TH:"thu",FR:"fri",SA:"sat"},Fa=/\d/,Ua=/[^A-Z]+/,Ba=/[a-z]+|[^a-z]+/gi;function Wa(e){return[e.getUTCFullYear(),za(e.getUTCMonth()+1),za(e.getUTCDate()),"T",za(e.getUTCHours()),za(e.getUTCMinutes()),za(e.getUTCSeconds()),"Z"].join("")}function za(e){return("0"+e).slice(-2)}n.prototype.processData=function(e,a,s){for(var o=this,t=this.parent.activeView.startDate(),i=this.parent.activeView.endDate(),l=this.parent.eventFields,p=[],c=1,h=!1,d=this.parent.resourceBase?this.parent.resourceBase.resourceCollection:[],n=(0<e.length&&B.isNullOrUndefined(e[0][l.id])&&(h=!0),function(t){h&&(t[l.id]=c++),t=u.updateEventDateTime(t),a?u.processTimezoneChange(t,s):u.parent.isPrinting||u.parent.uiStateValues.isPreventTimezone||(t=u.processTimezone(t));for(var e=0;e<d.length;e++)null!==t[d[parseInt(e.toString(),10)].field]&&0!==t[d[parseInt(e.toString(),10)].field]||(t[d[parseInt(e.toString(),10)].field]=void 0);if(B.isNullOrUndefined(t[l.recurrenceRule])||""!==t[l.recurrenceRule]||(t[l.recurrenceRule]=null),B.isNullOrUndefined(t[l.recurrenceRule])||!B.isNullOrUndefined(t[l.recurrenceID])||u.parent.crudModule&&u.parent.crudModule.crudObj.isCrudAction)if(u.parent.crudModule&&u.parent.crudModule.crudObj.isCrudAction)if(!B.isNullOrUndefined(t[l.recurrenceRule])&&B.isNullOrUndefined(t[l.recurrenceID]))for(var i=0,n=u.generateOccurrence(t,null,!0);i<n.length;i++)!function(t){var e=u.parent.eventsProcessed.filter(function(e){return e[l.startTime].getTime()-t[l.startTime].getTime()==0&&e[l.id]===t[l.id]});t.Guid=0<e.length?e[0].Guid:u.generateGuid(),p.push(t)}(n[i]);else{var r=u.parent.eventsProcessed.filter(function(e){return e[o.parent.eventFields.id]===t[o.parent.eventFields.id]});t.Guid=0<r.length?r[0].Guid:u.generateGuid(),p.push(t)}else t.Guid=u.generateGuid(),p.push(t);else p=p.concat(u.generateOccurrence(t,null,!0))}),u=this,r=0,g=e;r<g.length;r++)n(g[r]);this.parent.eventsProcessed=[];e=p.filter(function(e){return!e[o.parent.eventFields.isBlock]});if(this.parent.eventsProcessed=this.filterEvents(t,i,e),!this.parent.activeViewOptions.allowOverlap&&0<this.parent.eventsProcessed.length){this.processedData=this.parent.eventsProcessed;for(var m=[],v=this.parent.eventFields,f=0,y=this.parent.eventsProcessed;f<y.length;f++){var T,w=y[f],D=this.findOverlappingData(w,m);D?!this.parent.eventSettings.sortComparer&&(T=new Date(w[v.endTime]).getTime()-new Date(w[v.startTime]).getTime(),new Date(D[v.endTime]).getTime()-new Date(D[v.startTime]).getTime()<T&&w[v.startTime]===D[v.startTime]||!0===w[v.isAllDay])&&(-1!==(T=m.indexOf(D))&&m.splice(T,1),m.push(w)):m.push(w)}this.parent.eventsProcessed=m}for(var t=p.filter(function(e){return e[o.parent.eventFields.isBlock]}),b=0,S=t;b<S.length;b++){var C=S[b];!C[l.isAllDay]||z(new Date(C[l.startTime].getTime()))<z(new Date(C[l.endTime].getTime()))||(C[l.startTime]=z(C[l.startTime]),C[l.endTime]=Y(z(C[l.endTime]),1))}return this.parent.blockProcessed=t,e},n.prototype.findOverlappingData=function(e,t){for(var i=0<this.parent.activeViewOptions.group.resources.length,n=i?this.parent.resourceBase.resourceCollection:[],r=i?n[n.length-1].field:null,a=this.parent.eventFields,s=new Date(e[a.startTime]),o=new Date(e[a.endTime]),l=0,p=t;l<p.length;l++){var c=p[l];if(s<c[a.endTime]&&o>c[a.startTime]&&c[a.id]!==e[a.id]&&(!i||B.isNullOrUndefined(r)||this.compareResourceValues(c[""+r],e[""+r])))return c}},n.prototype.isOverlapRange=function(e,t){for(var i=this,n=(void 0===t&&(t=null),0<this.parent.activeViewOptions.group.resources.length),r=n?this.parent.resourceBase.resourceCollection:[],a=n?r[r.length-1].field:null,r=Array.isArray(e)?e:[e],s=this.parent.eventFields,o=[],l=!1,p=0,c=r;p<c.length;p++)for(var h=c[p],d=0,u=B.isNullOrUndefined(h[s.recurrenceRule])||!B.isNullOrUndefined(h[s.recurrenceID])&&h[s.recurrenceID]!==h[s.id]||!B.isNullOrUndefined(h[s.recurrenceID])&&"EditSeries"!==t?[h]:this.generateOccurrence(h);d<u.length;d++){var g=u[d],m=function(t){return i.processedData.filter(function(e){return t[s.startTime]<e[s.endTime]&&t[s.endTime]>e[s.startTime]&&e[s.id]!==t[s.id]&&(!n||B.isNullOrUndefined(a)||i.compareResourceValues(e[""+a],t[""+a]))})}(g);0<m.length&&o.push.apply(o,m),this.findOverlappingData(g,this.parent.eventsProcessed)&&(l=!0)}return this.parent.overlapAppointments=o,l},n.prototype.compareResourceValues=function(e,t){function i(e){return Array.isArray(e)?e[0]:e}return i(e)===i(t)},n.prototype.checkOverlap=function(e){return!(this.parent.activeViewOptions.allowOverlap||!this.isOverlapRange(e)||(this.parent.quickPopup.openValidationError("overlapAlert",e),0))},n.prototype.updateEventDateTime=function(e){return"string"==typeof e[this.parent.eventFields.startTime]&&(e[this.parent.eventFields.startTime]=tt(e[this.parent.eventFields.startTime])),"string"==typeof e[this.parent.eventFields.endTime]&&(e[this.parent.eventFields.endTime]=tt(e[this.parent.eventFields.endTime])),e},n.prototype.getProcessedEvents=function(e){for(var t=[],i=0,n=e=void 0===e?this.parent.eventsData:e;i<n.length;i++){var r=n[i];!B.isNullOrUndefined(r[this.parent.eventFields.recurrenceRule])&&B.isNullOrUndefined(r[this.parent.eventFields.recurrenceID])?t=t.concat(this.generateOccurrence(r)):t.push(r)}return t},n.prototype.timezonePropertyChange=function(e){var t=this.parent.eventsData.concat(this.parent.blockData),t=this.processData(t,!0,e);this.parent.notify(Ee,{processedData:t})},n.prototype.timezoneConvert=function(e){var t,i,n=this.parent.eventFields;e[n.startTimezone]=e[n.startTimezone]||e[n.endTimezone],e[n.endTimezone]=e[n.endTimezone]||e[n.startTimezone],this.parent.timezone&&(t=e[n.startTimezone],i=e[n.endTimezone],e[n.startTime]=this.parent.tzModule.convert(e[n.startTime],this.parent.timezone,t),e[n.endTime]=this.parent.tzModule.convert(e[n.endTime],this.parent.timezone,i))},n.prototype.processTimezoneChange=function(e,t){var i=this.parent.eventFields;e[i.isAllDay]||(t&&this.parent.timezone?(e[i.startTime]=this.parent.tzModule.convert(e[i.startTime],t,this.parent.timezone),e[i.endTime]=this.parent.tzModule.convert(e[i.endTime],t,this.parent.timezone)):!t&&this.parent.timezone?(e[i.startTime]=this.parent.tzModule.add(e[i.startTime],this.parent.timezone),e[i.endTime]=this.parent.tzModule.add(e[i.endTime],this.parent.timezone)):t&&!this.parent.timezone&&(e[i.startTime]=this.parent.tzModule.remove(e[i.startTime],t),e[i.endTime]=this.parent.tzModule.remove(e[i.endTime],t)))},n.prototype.processTimezone=function(e,t){void 0===t&&(t=!1);var i,n,r=this.parent.eventFields;return e[r.isAllDay]||(e[r.startTimezone]||e[r.endTimezone]?(i=e[r.startTimezone]||e[r.endTimezone],n=e[r.endTimezone]||e[r.startTimezone],t?this.parent.timezone?(e[r.startTime]=this.parent.tzModule.convert(e[r.startTime],i,this.parent.timezone),e[r.endTime]=this.parent.tzModule.convert(e[r.endTime],n,this.parent.timezone),e[r.startTime]=this.parent.tzModule.remove(e[r.startTime],this.parent.timezone),e[r.endTime]=this.parent.tzModule.remove(e[r.endTime],this.parent.timezone)):(e[r.startTime]=this.parent.tzModule.remove(e[r.startTime],i),e[r.endTime]=this.parent.tzModule.remove(e[r.endTime],n)):(e[r.startTime]=this.parent.tzModule.add(e[r.startTime],i),e[r.endTime]=this.parent.tzModule.add(e[r.endTime],n),this.parent.timezone&&(e[r.startTime]=this.parent.tzModule.convert(e[r.startTime],i,this.parent.timezone),e[r.endTime]=this.parent.tzModule.convert(e[r.endTime],n,this.parent.timezone)))):this.parent.timezone&&(t?(e[r.startTime]=this.parent.tzModule.remove(e[r.startTime],this.parent.timezone),e[r.endTime]=this.parent.tzModule.remove(e[r.endTime],this.parent.timezone)):(e[r.startTime]=this.parent.tzModule.add(e[r.startTime],this.parent.timezone),e[r.endTime]=this.parent.tzModule.add(e[r.endTime],this.parent.timezone)))),e},n.prototype.filterBlockEvents=function(e){for(var t,i=this.parent.eventFields,n=e[i.startTime],r=e[i.endTime],e=(0<this.parent.activeViewOptions.group.resources.length&&(e=this.getGroupIndexFromEvent(e),t=this.parent.resourceBase.lastResourceLevel[parseInt(e.toString(),10)]),B.extend([],this.parent.blockProcessed,null,!0)),a=0,s=e;a<s.length;a++){var o=s[a];o[i.isAllDay]&&o[i.endTime].getTime()>z(new Date(o[i.endTime].getTime())).getTime()&&(o[i.startTime]=z(o[i.startTime]),o[i.endTime]=Y(z(o[i.endTime]),1))}return this.filterEvents(n,r,e,t)},n.prototype.filterEvents=function(e,t,i,n){void 0===i&&(i=this.parent.eventsProcessed);e=this.parent.dataModule.getStartEndQuery(e,t),t=new p.DataManager({json:i}).executeLocal((new p.Query).where(e));return n&&(t=this.filterEventsByResource(n,t)),this.sortByTime(t)},n.prototype.filterEventsByRange=function(e,t,i){var n=this,r=[],r=t&&i?this.filterEvents(t,i,e):t&&!i?e.filter(function(e){return e[n.parent.eventFields.startTime]>=t}):!t&&i?e.filter(function(e){return e[n.parent.eventFields.endTime]<=i}):e;return this.sortByTime(r)},n.prototype.filterEventsByResource=function(e,t){void 0===t&&(t=this.parent.eventsProcessed);for(var i={},n=this.parent.resourceBase.resourceCollection,r=0;r<n.length;r++)i[n[parseInt(r.toString(),10)].field]=e.groupOrder[parseInt(r.toString(),10)];var a=Object.keys(i);return t.filter(function(t){return a.every(function(e){return t[""+e]instanceof Array?-1<t[""+e].indexOf(i[""+e]):t[""+e]===i[""+e]})})},n.prototype.sortByTime=function(e){var i;return!this.parent.eventSettings.sortComparer||"function"!=typeof this.parent.eventSettings.sortComparer&&"string"!=typeof this.parent.eventSettings.sortComparer?(i=this.parent.eventFields,e.sort(function(e,t){e=e[i.startTime],t=t[i.startTime];return e.getTime()-t.getTime()})):e=this.customSorting(e),e},n.prototype.sortByDateTime=function(e){var r;return!this.parent.eventSettings.sortComparer||"function"!=typeof this.parent.eventSettings.sortComparer&&"string"!=typeof this.parent.eventSettings.sortComparer?(r=this.parent.eventFields,e.sort(function(e,t){var i=e[r.startTime],n=t[r.startTime],e=e[r.endTime],t=t[r.endTime],e=e.getTime()-i.getTime(),t=t.getTime()-n.getTime();return i.getTime()-n.getTime()||t-e})):e=this.customSorting(e),e},n.prototype.customSorting=function(e){if("function"==typeof this.parent.eventSettings.sortComparer)return this.parent.eventSettings.sortComparer.call(this.parent,e);if("string"==typeof this.parent.eventSettings.sortComparer){var t=this.parent.eventSettings.sortComparer.split("."),i=void 0;if(i=B.isNullOrUndefined(window)?i:window[t[t.length-1]])return i(e)}return e},n.prototype.getSmallestMissingNumber=function(e){for(var t=Math.max.apply(Math,e),i=0;i<t;i++)if(-1===e.indexOf(i))return i;return t+1},n.prototype.splitEventByDay=function(e){var t=this.parent.eventFields,i=[],n=e[t.startTime],r=e[t.endTime];if(z(new Date(n.getTime()))<z(new Date(r.getTime())))for(var a=new Date(n.getTime()),s=Y(z(new Date(n.getTime())),1),o=0===r.getHours()&&0===r.getMinutes()?r:Y(r,1),l=1,p=et(n.getTime(),o.getTime());s<=r&&a.getTime()!==s.getTime();){var c=B.extend({},e);c[t.startTime]=a,c[t.endTime]=s,c.data={index:l,count:p},c.Guid=this.generateGuid(),c.isSpanned=!0,i.push(c),a=s,s=z(new Date(a.getTime())).getTime()===z(new Date(r.getTime())).getTime()&&s.getTime()!==r.getTime()?(s=new Date(a.getTime()),new Date(s.setHours(r.getHours(),r.getMinutes(),r.getSeconds()))):Y(z(new Date(a.getTime())),1),l++}else i.push(e);return i},n.prototype.splitEvent=function(e,t){var i=this.parent.eventFields,n=z(e[i.startTime]).getTime(),r=z(e[i.endTime]).getTime(),a=n,s=r=Xe(e[i.endTime])<=0?(c=Y(z(e[i.endTime]),-1).getTime())<n?n:c:r,o=[];if(n!==r){n<t[0].getTime()&&(n=t[0].getTime()),r>t[t.length-1].getTime()&&(r=t[t.length-1].getTime());for(var l=n,p=0;p<this.slots.length;p++){var c,h=this.slots[parseInt(p.toString(),10)];if("WorkWeek"===this.parent.currentView||"TimelineWorkWeek"===this.parent.currentView||this.parent.activeViewOptions.group.byDate||this.parent.activeViewOptions.showWeekend){for(var d=[],u=0,g=h;u<g.length;u++){var m=g[u];d.push(new Date(m))}var v=this.getRenderedDates(d);if(!B.isNullOrUndefined(v)&&0<v.length)for(var h=[],f=0,y=v;f<y.length;f++){var T=y[f];h.push(T.getTime())}}"number"==typeof h&&(c=h,(h=[]).push(c));v=h[0];if(r<(l=l<=v&&v<=r?v:l)||r<v)break;if(!this.parent.activeViewOptions.group.byDate&&this.parent.activeViewOptions.showWeekend&&"WorkWeek"!==this.parent.currentView&&"TimelineWorkWeek"!==this.parent.currentView){var w=h.indexOf(l);if(-1!==w){var D=h.indexOf(r),b=-1!==D,S=(D=b?D:h.length-1)-w+1,C=h[parseInt(w.toString(),10)]!==a,O=h[parseInt(D.toString(),10)]!==s;if(o.push(this.cloneEventObject(e,h[parseInt(w.toString(),10)],h[parseInt(D.toString(),10)],S,C,O)),b)break}}else if(this.dateInRange(l,h[0],h[h.length-1])){for(var E=[],x=0;x<h.length;x++)this.dateInRange(h[parseInt(x.toString(),10)],a,s)&&E.push(h[parseInt(x.toString(),10)]);if(0<E.length)if(this.parent.activeViewOptions.group.byDate)for(var V=0,A=E;V<A.length;V++){var I=A[V];o.push(this.cloneEventObject(e,I,I,1,I!==a,I!==s))}else{C=E[0]!==a,O=E[E.length-1]!==s;o.push(this.cloneEventObject(e,E[0],E[E.length-1],E.length,C,O))}}}}else o.push(this.cloneEventObject(e,n,r,1,!1,!1));return o},n.prototype.cloneEventObject=function(e,t,i,n,r,a){var s=this.parent.eventFields,o=B.extend({},e,null,!0),n={count:n,isLeft:r,isRight:a};return n[s.startTime]=e[s.startTime],n[s.endTime]=e[s.endTime],o.data=n,o[s.startTime]=new Date(t),o[s.endTime]=new Date(i),o},n.prototype.dateInRange=function(e,t,i){return t<=e&&e<=i},n.prototype.getSelectedEventElements=function(t){if(this.removeSelectedAppointmentClass(),this.parent.selectedElements.length<=0)this.parent.selectedElements.push(t);else if(this.parent.selectedElements.filter(function(e){return e.getAttribute("data-guid")===t.getAttribute("data-guid")}).length<=0)for(var e='div[data-guid="'+t.getAttribute("data-guid")+'"]',i=0,n=[].slice.call(this.parent.element.querySelectorAll(e));i<n.length;i++){var r=n[i];this.parent.selectedElements.push(r)}else{e=this.parent.selectedElements.filter(function(e){return e.getAttribute("data-guid")!==t.getAttribute("data-guid")});this.parent.selectedElements=e}return t&&0<this.parent.selectedElements.length&&this.addSelectedAppointments(this.parent.selectedElements,!1),this.parent.selectedElements},n.prototype.getSelectedEvents=function(){var e=this,i=[],n=[];return[].slice.call(this.parent.element.querySelectorAll("."+wi)).filter(function(t){0===i.filter(function(e){return e.Guid===t.getAttribute("data-guid")}).length&&i.push(e.getEventByGuid(t.getAttribute("data-guid"))),n.push(t)}),{event:1<i.length?i:i[0],element:1<n.length?n:n[0]}},n.prototype.removeSelectedAppointmentClass=function(){var e=this.getSelectedAppointments();B.removeClass(e,wi),"Agenda"!==this.parent.currentView&&"MonthAgenda"!==this.parent.currentView||B.removeClass(e,Ii)},n.prototype.addSelectedAppointments=function(e,t){"MonthAgenda"!==this.parent.currentView&&this.parent.removeSelectedClass(),B.addClass(e,wi),0<e.length&&!t&&e[e.length-1].focus()},n.prototype.getSelectedAppointments=function(){return[].slice.call(this.parent.element.querySelectorAll("."+wi+",."+V+":focus"))},n.prototype.focusElement=function(e){var t,i;this.parent.eventWindow.dialogObject&&this.parent.eventWindow.dialogObject.visible||(i=document.activeElement,0<(t=this.parent.getSelectedCells()).length&&(i&&(this.parent.element.contains(i)||-1!==t.indexOf(i))||e)?this.parent.keyboardInteractionModule&&(i=!B.isNullOrUndefined(this.parent.activeCellsData)&&this.parent.activeCellsData.element||t[t.length-1],this.parent.keyboardInteractionModule.selectCells(i instanceof Array,i)):0<(e=this.getSelectedAppointments()).length&&(this.parent.activeEventData&&this.parent.activeEventData.element&&-1<e.indexOf(this.parent.activeEventData.element)?this.parent.activeEventData.element:e[e.length-1]).focus())},n.prototype.selectWorkCellByTime=function(e){if("Agenda"!==this.parent.currentView&&"MonthAgenda"!==this.parent.currentView&&0<e.length){var e=e[e.length-1],t=e[this.parent.eventFields.startTime],i=void 0,n=this.isAllDayAppointment(e),i="Month"===this.parent.currentView||n||!this.parent.activeViewOptions.timeScale.enable?new Date(+t).setHours(0,0,0,0):this.findNearestSlot(t),t=void 0,t=n&&-1!==["Day","Week","WorkWeek"].indexOf(this.parent.currentView)?this.parent.getAllDayRow():this.parent.getContentTable(),n='[data-date="'+new Date(i).getTime()+'"]';if(!B.isNullOrUndefined(this.parent.activeViewOptions.group.resources)&&0<this.parent.activeViewOptions.group.resources.length&&(n+='[data-group-index="'+this.getGroupIndexFromEvent(e)+'"]'),i=t.querySelector(n))this.parent.activeCellsData=this.parent.getCellDetails(i),this.parent.keyboardInteractionModule&&this.parent.keyboardInteractionModule.selectCells(!1,i)}return i},n.prototype.findNearestSlot=function(n){var i=this.parent.activeViewOptions.timeScale.interval*je/this.parent.activeViewOptions.timeScale.slotCount,e=Math.round(W/i),r=new Date(n);r.setHours(0,0,0,0);e=Array.from({length:e},function(e,t){return new Date(r.getTime()+t*i)}).reduce(function(e,t){var i=Math.abs(n.getTime()-t.getTime());return!e||i<Math.abs(n.getTime()-e.getTime())?t:e},null);return 1e3*Math.trunc(e.getTime()/1e3)},n.prototype.getGroupIndexFromEvent=function(e){for(var i,t,n,r,a=this.parent.resourceBase.resourceCollection.length-1;0<=a;a--){var s=e[this.parent.resourceBase.resourceCollection[parseInt(a.toString(),10)].field];if(!B.isNullOrUndefined(s)){t=this.parent.resourceBase.resourceCollection[parseInt(a.toString(),10)],i=a,n=t.name,r=t.field;break}}B.isNullOrUndefined(n)&&B.isNullOrUndefined(i)&&(n=this.parent.resourceCollection.slice(-1)[0].name,i=this.parent.resourceCollection.length-1,r=this.parent.resourceCollection.slice(-1)[0].field,t=this.parent.resourceCollection.filter(function(e,t){return e.name===n?(i=t,e):null})[0]);var o,l=e[""+r]instanceof Array?e[""+r][0]:e[""+r];return 0<i?(o=this.parent.resourceCollection[i-1].field,this.parent.resourceBase.getIndexFromResourceId(l,n,t,e,o)):this.parent.resourceBase.getIndexFromResourceId(l,n,t)},n.prototype.isAllDayAppointment=function(e){var t=this.parent.eventFields,i=e[t.isAllDay],e=1<=(ct(e[t.endTime])-ct(e[t.startTime]))/W;return!!(i||"TimeSlot"!==this.parent.eventSettings.spannedEventPlacement&&e)},n.prototype.addEventListener=function(){this.parent.on(Re,this.appointmentBorderRemove,this)},n.prototype.removeEventListener=function(){this.parent.off(Re,this.appointmentBorderRemove)},n.prototype.appointmentBorderRemove=function(e){e=e.event.target;B.closest(e,"."+V)?"MonthAgenda"!==this.parent.currentView&&this.parent.removeSelectedClass():B.closest(e,"."+xt)||this.parent.uiStateValues.isTapHold&&B.closest(e,"."+O+",."+w)||(this.parent.uiStateValues.isTapHold=!1,this.removeSelectedAppointmentClass(),this.parent.selectedElements=[])},n.prototype.wireAppointmentEvents=function(e,t,i){void 0===i&&(i=!1);t=!B.isNullOrUndefined(t)&&t[this.parent.eventFields.isReadonly];B.EventHandler.add(e,"click",this.eventClick,this),this.parent.isAdaptive||this.parent.activeViewOptions.readonly||t||(B.EventHandler.add(e,"touchend",this.eventTouchClick,this),B.EventHandler.add(e,"dblclick",this.eventDoubleClick,this)),this.parent.activeViewOptions.readonly||t||i||(this.parent.resizeModule&&this.parent.resizeModule.wireResizeEvent(e),this.parent.dragAndDropModule&&this.parent.dragAndDropModule.wireDragEvent(e))},n.prototype.eventTouchClick=function(e){var t=this;this.parent.uiStateValues.isTouchScroll||this.parent.uiStateValues.isTapHold||this.parent.uiStateValues.action?this.parent.uiStateValues.isTouchScroll=this.parent.uiStateValues.isTapHold=!1:(setTimeout(function(){return t.isDoubleTapped=!1},250),e.preventDefault(),this.isDoubleTapped?this.eventDoubleClick(e):this.isDoubleTapped||(this.isDoubleTapped=!0,this.eventClick(e)))},n.prototype.renderResizeHandler=function(e,t,i){if(this.parent.resizeModule&&this.parent.allowResizing&&!this.parent.activeViewOptions.readonly&&!i)for(var n=0,r=Object.keys(t);n<r.length;n++){var a=r[n],s=B.createElement("div",{className:Xi});switch(a){case"isLeft":t.isLeft||(s.appendChild(B.createElement("div",{className:"e-left-right-resize"})),B.addClass([s],this.parent.enableRtl?Zi:Ki),B.prepend([s],e));break;case"isRight":t.isRight||(s.appendChild(B.createElement("div",{className:"e-left-right-resize"})),B.addClass([s],this.parent.enableRtl?Ki:Zi),B.append([s],e));break;case"isTop":t.isTop||(s.appendChild(B.createElement("div",{className:"e-top-bottom-resize"})),B.addClass([s],Ji),B.prepend([s],e));break;case"isBottom":t.isBottom||(s.appendChild(B.createElement("div",{className:"e-top-bottom-resize"})),B.addClass([s],$i),B.append([s],e))}}},n.prototype.eventClick=function(e){var t,i=this,n=e.target;n.classList.contains(Gi)||n.classList.contains(Qi)||n.classList.contains(Pr)||((e.ctrlKey||e.metaKey)&&1===e.which&&this.parent.keyboardInteractionModule?(this.parent.quickPopup.quickPopup.hide(),this.parent.selectedElements=[].slice.call(this.parent.element.querySelectorAll("."+wi)),n=B.closest(e.target,"."+V),this.getSelectedEventElements(n),this.activeEventData(e,!1),n={data:this.parent.activeEventData.event,element:this.parent.activeEventData.element,event:e,requestType:"eventSelect"},this.parent.trigger(G,n),t=B.extend(this.parent.activeEventData,{cancel:!1,originalEvent:e}),this.parent.trigger(ee,t)):(this.removeSelectedAppointmentClass(),this.activeEventData(e,!0),n={data:this.parent.activeEventData.event,element:this.parent.activeEventData.element,event:e,requestType:"eventSelect"},this.parent.trigger(G,n),t=B.extend(this.parent.activeEventData,{cancel:!1,originalEvent:e}),this.parent.trigger(ee,t,function(e){var t;e.cancel?(i.removeSelectedAppointmentClass(),i.parent.selectedElements=[],i.parent.quickPopup&&i.parent.quickPopup.quickPopupHide()):("Agenda"!==i.parent.currentView&&"MonthAgenda"!==i.parent.currentView||B.addClass([i.parent.activeEventData.element],Ii),i.parent.allowInline?(t={data:e.event,element:e.element,type:"Event"},i.parent.notify(ue,t)):i.parent.notify(ee,e))})))},n.prototype.eventDoubleClick=function(e){var t=this;this.parent.quickPopup&&this.parent.quickPopup.quickPopupHide(!0),"touchend"===e.type&&this.activeEventData(e,!0),this.removeSelectedAppointmentClass(),this.parent.selectedElements=[],this.parent.activeEventData.element.classList.contains(jr)||this.parent.activeEventData.element.querySelector("."+Pr)||(e=B.extend(this.parent.activeEventData,{cancel:!1,originalEvent:e}),this.parent.trigger(te,e,function(e){!e.cancel&&t.parent.eventSettings.allowEditing&&(!B.isNullOrUndefined(t.parent.activeEventData.event)&&B.isNullOrUndefined(t.parent.activeEventData.event[t.parent.eventFields.recurrenceID])?t.parent.eventWindow.openEditor(t.parent.activeEventData.event,"Save"):(t.parent.currentAction="EditOccurrence",t.parent.quickPopup.openRecurrenceAlert()))}))},n.prototype.getEventByGuid=function(t){return this.parent.eventsProcessed.filter(function(e){return e.Guid===t})[0]},n.prototype.getEventById=function(t){var i=this;return this.parent.eventsData.filter(function(e){return e[i.parent.eventFields.id]===t})[0]},n.prototype.generateGuid=function(){return"xyxxxxyx-xxxy-yxxx-xyxx-xxyxxxxyyxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},n.prototype.getEventIDType=function(){return 0!==this.parent.eventsData.length?typeof this.parent.eventsData[0][this.parent.eventFields.id]:0!==this.parent.blockData.length?typeof this.parent.blockData[0][this.parent.eventFields.id]:"string"},n.prototype.getEventMaxID=function(e){var t,i,n=this;return this.parent.eventsData.length<1&&this.parent.blockData.length<1?1:("string"===(t=this.getEventIDType())&&(i=this.generateGuid()),"number"===t&&(t=this.parent.eventsData.concat(this.parent.blockData).map(function(e){return e[n.parent.eventFields.id]}).reduce(function(e,t){return Math.max(e,t)}),i=(t=B.isNullOrUndefined(e)?t:t+e)+1),i)},n.prototype.activeEventData=function(e,t){var i=this,e=B.closest(e.target,"."+V),n=e.getAttribute("data-guid"),r=(t&&(this.addSelectedAppointments([].slice.call(this.parent.element.querySelectorAll('div[data-guid="'+n+'"]')),!0),e.focus()),this.getEventByGuid(n));r&&r.isSpanned&&(r=this.parent.eventsData.filter(function(e){return e[i.parent.eventFields.id]===r[i.parent.eventFields.id]})[0]),this.parent.activeEventData={event:r,element:e}},n.prototype.generateOccurrence=function(t,e,i){for(var n,r=this,a=t[this.parent.eventFields.startTime],s=t[this.parent.eventFields.endTime],o=t[this.parent.eventFields.recurrenceRule],l=s.getTimezoneOffset()-a.getTimezoneOffset(),p=s.getTime()-a.getTime()-6e4*l,s=(e=new Date((e||this.parent.activeView.startDate()).getTime()-p),t[this.parent.eventFields.recurrenceException]),l=("Agenda"!==this.parent.currentView&&i&&(n=Qe(e,this.parent.activeView.endDate())+1),this.parent.timezone||this.parent.tzModule.getLocalTimezoneName()),i=this.parent.activeViewOptions.firstDayOfWeek,c=this.parent.calendarMode,a=sa(a=t[this.parent.eventFields.recurrenceRule]&&this.isDayBasedRecurrence(t)&&this.parent.timezone&&t[this.parent.eventFields.startTimezone]&&t[this.parent.eventFields.endTimezone]?this.parent.tzModule.convert(t[this.parent.eventFields.startTime],this.parent.timezone,t[this.parent.eventFields.startTimezone]):a,o,s,i,n,e,c,l),h=("Agenda"===this.parent.currentView&&-1===o.indexOf("COUNT")&&-1===o.indexOf("UNTIL")&&(B.isNullOrUndefined(t.generatedDates)?t.generatedDates={start:new Date(a[0]),end:new Date(a[a.length-1])}:(a[0]<t.generatedDates.start.getTime()&&(t.generatedDates.start=new Date(a[0])),a[a.length-1]>t.generatedDates.end.getTime()&&(t.generatedDates.end=new Date(a[a.length-1])))),!1),s=[],d=(t[this.parent.eventFields.recurrenceRule]&&this.isDayBasedRecurrence(t)&&this.parent.timezone&&t[this.parent.eventFields.startTimezone]&&t[this.parent.eventFields.endTimezone]&&(h=!0,s.push.apply(s,a.map(function(e){return r.parent.tzModule.convert(new Date(e),t[r.parent.eventFields.startTimezone],r.parent.timezone).getTime()}))),[]),u=0,g=s=0<s.length?s:a;u<g.length;u++){var m=g[u],v=B.extend({},t,null,!0),m=h?m:this.getDSTAdjustedTime(m,v);v[this.parent.eventFields.startTime]=new Date(m),v[this.parent.eventFields.endTime]=new Date(new Date(m).setMilliseconds(p)),v[this.parent.eventFields.recurrenceID]=v[this.parent.eventFields.id],delete v[this.parent.eventFields.recurrenceException],delete v[this.parent.eventFields.followingID],v.Guid=this.generateGuid(),d.push(v)}return d},n.prototype.isDayBasedRecurrence=function(e){return e[this.parent.eventFields.recurrenceRule].includes("BYMONTHDAY")||e[this.parent.eventFields.recurrenceRule].includes("BYDAY")},n.prototype.getDSTAdjustedTime=function(e,t){var i,n=e;return this.parent.timezone&&(t[this.parent.eventFields.startTimezone]||t[this.parent.eventFields.endTimezone])&&(i=this.getDSTDiff(t[this.parent.eventFields.startTime],new Date(e),t[this.parent.eventFields.startTimezone]),t=this.getDSTDiff(t[this.parent.eventFields.startTime],new Date(e),this.parent.timezone),n=new Date(e).getTime()-6e4*(i-t)),n},n.prototype.getDSTDiff=function(e,t,i){return this.parent.tzModule.offset(new Date(e),i)-this.parent.tzModule.offset(new Date(t),i)},n.prototype.getParentEvent=function(e,t){var i,n,r;for(void 0===t&&(t=!1);(e=this.getFollowingEvent(e))&&(i=B.extend({},e,null,!0)),e&&t;);return t&&i&&(r=(n=this.getEventCollections(i)).follow.slice(-1)[0],r=0<n.occurrence.length&&!i[this.parent.eventFields.recurrenceException]?n.occurrence.slice(-1)[0]:r)&&(i[this.parent.eventFields.recurrenceRule]=r[this.parent.eventFields.recurrenceRule]),i},n.prototype.getEventCollections=function(e,t){for(var i=[],n=[],r=e;(r=this.getFollowingEvent(r,!0))&&i.push(r),n=n.concat(this.getOccurrenceEvent(r||e)),r;);var a;return t?(a=this.parent.eventFields,{follow:i.filter(function(e){return e[a.startTime]>=t[a.startTime]}),occurrence:n.filter(function(e){return e[a.startTime]>=t[a.startTime]})}):{follow:i,occurrence:n}},n.prototype.getFollowingEvent=function(e,t){var i=this.parent.eventFields,n=t?e[i.id]:e[i.recurrenceID]||e[i.followingID];return this.parent.eventsData.filter(function(e){return e[t?i.followingID:i.id]===n}).shift()},n.prototype.isFollowingEvent=function(e,t){e=e[this.parent.eventFields.startTime],t=t[this.parent.eventFields.startTime];return e.getHours()===t.getHours()&&e.getMinutes()===t.getMinutes()&&e.getSeconds()===t.getSeconds()},n.prototype.getOccurrenceEvent=function(t,e,i){void 0===i&&(i=!1);var n=(e=void 0===e?!1:e)?"Guid":i?this.parent.eventFields.followingID:this.parent.eventFields.recurrenceID,r=e?"Guid":this.parent.eventFields.id;return(e?this.parent.eventsProcessed:this.parent.eventsData).filter(function(e){return e[""+n]===t[""+r]})},n.prototype.getOccurrencesByID=function(t){for(var i=this.parent.eventFields,e=[],n=0,r=this.parent.eventsData.filter(function(e){return e[i.id]===t});n<r.length;n++){var a=r[n];B.isNullOrUndefined(a[i.recurrenceRule])||(e=e.concat(this.generateOccurrence(a)))}return e},n.prototype.getOccurrencesByRange=function(t,i){for(var n=this.parent.eventFields,e=[],r=0,a=this.parent.eventsData;r<a.length;r++){var s=a[r];B.isNullOrUndefined(s[n.recurrenceRule])||(e=e.concat(this.generateOccurrence(s)))}return e.filter(function(e){return e[n.startTime]>=t&&e[n.endTime]<=i&&!B.isNullOrUndefined(e[n.recurrenceID])})},n.prototype.getDeletedOccurrences=function(a){var s=this.parent.eventFields,o=[],l="string"==typeof a||"number"==typeof a?this.parent.eventsData.filter(function(e){return e[s.id]===a})[0]:B.extend({},a,null,!0);if(l[s.recurrenceException])for(var p=l[s.recurrenceException].split(","),c=this,e=0,t=p.length;e<t;e++)!function(t){var e,i,n,r;0===c.parent.eventsData.filter(function(e){return e[s.recurrenceID]===l[s.id]&&e[s.recurrenceException]===p[parseInt(t.toString(),10)]}).length&&(i=oa(p[parseInt(t.toString(),10)]),(e=B.extend({},a,null,!0))[s.recurrenceID]=l[s.id],delete e[s.followingID],e[s.recurrenceException]=p[parseInt(t.toString(),10)],i=new Date(i.getTime()),n=l[s.endTime].getTime()-l[s.startTime].getTime(),(r=new Date(i.getTime())).setMilliseconds(n),e[s.startTime]=new Date(i.getTime()),e[s.endTime]=new Date(r.getTime()),o.push(e))}(e);return o},n.prototype.applyResourceColor=function(e,t,i,n,r){this.parent.resourceBase&&(t=this.parent.resourceBase.getResourceColor(t,n))&&(e.style[i]=B.isNullOrUndefined(r)?t:(n=r,e=(e=t).replace("#",""),"rgba("+parseInt(e.substring(0,e.length/3),16)+", "+parseInt(e.substring(e.length/3,2*e.length/3),16)+", "+parseInt(e.substring(2*e.length/3,3*e.length/3),16)+", "+n+")"))},n.prototype.createBlockAppointmentElement=function(e,t,i){var n,r=e[this.parent.eventFields.subject]||this.parent.eventSettings.fields.subject.default,a=B.createElement("div",{className:yi,attrs:{"data-id":"Appointment_"+e[this.parent.eventFields.id],"aria-disabled":"true"}});return i=B.isNullOrUndefined(this.parent.activeViewOptions.eventTemplate)?(n=B.createElement("div",{className:Gn}),this.parent.sanitize(r,n),[n]):(r=this.parent.element.id+"_"+this.parent.activeViewOptions.eventTemplateName+"eventTemplate",n=i&&-1===this.parent.currentView.indexOf("Year")?this.parent.getEventTemplateName(t):"eventTemplate",this.parent.getAppointmentTemplate()(e,this.parent,n,r,!1,void 0,void 0,this.parent.root)),B.append(i,a),this.setWrapperAttributes(a,t),a},n.prototype.setWrapperAttributes=function(e,t){B.isNullOrUndefined(this.cssClass)||B.addClass([e],this.cssClass),0<this.parent.activeViewOptions.group.resources.length&&e.setAttribute("data-group-index",t.toString())},n.prototype.getReadonlyAttribute=function(e){return(e[this.parent.eventFields.isReadonly]||this.parent.readonly).toString()},n.prototype.isBlockRange=function(e){for(var e=e instanceof Array?e:[e],t=!1,i=this.parent.eventFields,n=0,r=e;n<r.length;n++){var a=r[n],s=[];B.isNullOrUndefined(a[i.recurrenceRule])||!B.isNullOrUndefined(a[i.recurrenceID])&&a[i.id]!==a[i.recurrenceID]?s.push(a):s=this.generateOccurrence(a);for(var o=0,l=s;o<l.length;o++){var p=l[o];if(0<this.filterBlockEvents(p).length){t=!0;break}}}return this.parent.uiStateValues.isBlock=t},n.prototype.getFilterEventsList=function(e,t){return new p.DataManager(e).executeLocal((new p.Query).where(t))},n.prototype.getSeriesEvents=function(e,t){for(var i,n,r=this.parent.eventFields,a=(t=B.isNullOrUndefined(t)?e[r.startTime]:t,[]),s=e[r.id],o=e[r.followingID],l="EditSeries"===this.parent.currentAction?"greaterthan":"greaterthanorequal";n=new p.Predicate(r.followingID,"equal",s).and(new p.Predicate(r.startTime,l,t)),i=(n=this.getFilterEventsList(this.parent.eventsData,n)).slice(-1)[0],o=B.isNullOrUndefined(i)||i[r.id]===o?null:(a.push(i),s=i[r.id],i[r.followingID]),1===n.length&&!B.isNullOrUndefined(i[r.followingID]););return a},n.prototype.getEditedOccurrences=function(e,t){for(var i=this.parent.eventFields,n=[],r=0,a=e;r<a.length;r++){var s=a[r],s=new p.Predicate(i.recurrenceID,"equal",s[i.id]).or(new p.Predicate(i.recurrenceID,"equal",s[i.followingID]).and(new p.Predicate(i.recurrenceID,"notequal",void 0)).and(new p.Predicate(i.recurrenceID,"notequal",null)));"EditFollowingEvents"!==this.parent.currentAction&&"DeleteFollowingEvents"!==this.parent.currentAction||(s=s.and(new p.Predicate(i.startTime,"greaterthanorequal",t))),s=this.getFilterEventsList(this.parent.eventsData,s),n=n.concat(s)}return n},n.prototype.getRenderedDates=function(t){var e,i=0,n=t.length,r=B.isNullOrUndefined(this.parent.maxDate)?new Date(2099,11,31):this.parent.maxDate,a=B.isNullOrUndefined(this.parent.minDate)?new Date(1900,0,1):this.parent.minDate;if(t[0]<a&&t[t.length-1]>r){for(var s=0;s<t.length;s++)z(t[parseInt(s.toString(),10)]).getTime()===z(new Date(a)).getTime()&&(i=s),z(t[parseInt(s.toString(),10)]).getTime()===z(new Date(r)).getTime()&&(n=s);e=t.filter(function(e){return e>=t[parseInt(i.toString(),10)]&&e<=t[parseInt(n.toString(),10)]})}return e},n.prototype.isValidEvent=function(e,t,i,n){var r=i.getTime()>n.startHour.getTime()&&t.getTime()<n.endHour.getTime(),e=n.startHour.getTime()<=t.getTime()&&e[this.parent.eventFields.startTime].getTime()>=n.startHour.getTime()&&e[this.parent.eventFields.endTime].getTime()<n.endHour.getTime()&&t.getTime()===i.getTime();return r||e},n.prototype.allDayExpandScroll=function(e){var t=0;[].slice.call(this.parent.element.querySelectorAll("."+nn)).forEach(function(e){[].slice.call(e.children).forEach(function(e){e.style.top=t+"px"}),t+=e.offsetHeight}),t=e.offsetHeight-t,this.parent.element.querySelector("."+w).style.height=t/12+"em",this.parent.uiStateValues.expand?B.addClass([e],qr):B.removeClass([e],qr)},n.prototype.updateEventMinimumDuration=function(e,t,i){var n;return(t.getTime()<i.getTime()||t.getTime()===i.getTime()&&e.startHour.getTime()<i.getTime()&&e.endHour.getTime()>t.getTime()&&-1===this.parent.currentView.indexOf("Timeline"))&&(ct(i)-ct(t))/je<this.parent.eventSettings.minimumEventDuration&&((n=new Date(t)).setMinutes(n.getMinutes()+this.parent.eventSettings.minimumEventDuration),(i=n).getTime()>e.endHour.getTime())&&((n=new Date(e.endHour.getTime())).setMinutes(n.getMinutes()-this.parent.eventSettings.minimumEventDuration),t=n,i=e.endHour),{startDate:t,endDate:i}},n.prototype.createEventWrapper=function(e,t){void 0===e&&(e=""),void 0===t&&(t=0);for(var i=B.createElement("tr"),n=this.parent.activeView.colLevels.slice(-1)[0],r=this.parent.isReact&&this.parent.activeViewOptions.eventTemplate?" "+oi:"",a=0,s=n.length;a<s;a++){var o=n[parseInt(a.toString(),10)],l=B.createElement("td",{className:"allDay"===e?rn+r:"timeIndicator"===e?si:li+r,attrs:{"data-date":o.date.getTime().toString()}});B.isNullOrUndefined(o.groupIndex)||l.setAttribute("data-group-index",o.groupIndex.toString()),""===e&&(o=B.createElement("div",{id:x+"-"+t.toString(),className:x}),l.appendChild(o)),i.appendChild(l),t+=1}return i},n.prototype.getPageCoordinates=function(e){var t;return B.isNullOrUndefined(e)?e:(t=e.event)&&t.changedTouches?t.changedTouches[0]:e.changedTouches?e.changedTouches[0]:t||e},n.prototype.renderSpannedIcon=function(e,t){var i,n=B.createElement("div",{className:Fi+" "+Dt});t.isLeft&&(i=n.cloneNode(),B.addClass([i],Ui),B.prepend([i],e)),t.isRight&&(i=n.cloneNode(),B.addClass([i],Bi),B.append([i],e)),t.isTop&&(i=n.cloneNode(),B.addClass([i],"e-up-icon"),B.prepend([i],e)),t.isBottom&&(i=n.cloneNode(),B.addClass([i],"e-down-icon"),B.append([i],e))},n.prototype.addCellHeight=function(e,t,i,n,r,a){if(void 0===a&&(a=!0),this.parent.activeViewOptions.maxEventsPerRow&&!this.parent.rowAutoHeight){for(var s=[].slice.call(this.parent.element.querySelectorAll(e)),o=this.parent.showWeekNumber?[].slice.call(this.parent.element.querySelectorAll("."+ui+" tbody tr")):[],l=0,p=s;l<p.length;l++){var c=p[l],h=this.parent.activeViewOptions.maxEventsPerRow*(t+("Month"===this.parent.currentView?i:2))+n+r;0<o.length&&B.setStyleAttribute(o[s.indexOf(c)].firstElementChild,{height:h+"px"}),B.setStyleAttribute(c.firstElementChild,{height:h+"px"})}this.parent.enablePersistence||this.parent.activeViewOptions.allowVirtualScrolling||!a||this.parent.notify(Ve,{})}},n.prototype.unWireEvents=function(){for(var e=0,t=[].slice.call(this.parent.element.querySelectorAll("."+V));e<t.length;e++){var i=t[e];B.EventHandler.clearEvents(i)}},n.prototype.destroy=function(){this.unWireEvents(),this.parent=null};var Ya=n;function n(e){this.slots=[],this.processedData=[],this.isDoubleTapped=!1,this.parent=e}_a=function(e,t){return(_a=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}_a(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(r,Ga=Ya),r.prototype.renderAppointments=function(){var t=this;if(!B.isNullOrUndefined(this.parent)){this.parent.dragAndDropModule&&this.parent.dragAndDropModule.setDragArea(),this.isResourceEventTemplate=this.parent.isSpecificResourceEvents();for(var e=[].slice.call(this.parent.element.querySelectorAll("."+yi+",."+V+",."+on)),i=!(!this.parent.crudModule||!this.parent.crudModule.crudObj.isCrudAction),n=function(e){t.parent.isReact&&!B.isNullOrUndefined(t.parent.activeViewOptions.eventTemplate)&&(e=B.closest(e,"."+li+",."+rn))&&!e.classList.contains(oi)&&B.addClass([e],oi)},r=0,a=e;r<a.length;r++){var s=a[r];if(!i||s.classList.contains(an)||s.classList.contains(on))n(s),B.remove(s);else for(var o=parseInt(s.getAttribute("data-group-index"),10),l=0,p=this.parent.crudModule.crudObj.sourceEvent.length;l<p;l++)o!==this.parent.crudModule.crudObj.sourceEvent[parseInt(l.toString(),10)].groupIndex&&o!==this.parent.crudModule.crudObj.targetEvent[parseInt(l.toString(),10)].groupIndex||(n(s),B.remove(s))}this.element.querySelector("."+O)&&(this.parent.virtualScrollModule&&this.parent.virtualScrollModule.updateFocusedWorkCell(),this.allDayElement=[].slice.call(this.element.querySelectorAll("."+w)),this.setAllDayRowHeight(0),0===this.parent.eventsProcessed.length&&0===this.parent.blockProcessed.length||(e=this.element.querySelector("."+ln),B.EventHandler.remove(e,"click",this.rowExpandCollapse),B.EventHandler.add(e,"click",this.rowExpandCollapse,this),this.renderedEvents=[],this.renderedAllDayEvents=[],this.initializeValues(),this.processBlockEvents(),this.renderEvents("normalEvents"),0<this.allDayEvents.length&&(this.allDayEvents=this.allDayEvents.filter(function(e,t,i){return t===i.map(function(e){return e.Guid}).indexOf(e.Guid)}),B.removeClass(this.allDayElement,vr),this.slots.push(this.parent.activeView.renderDates.map(function(e){return+e})),this.renderEvents("allDayEvents"),this.animation.animate(this.allDayElement[0])),this.parent.notify(Ve,{}),B.addClass(this.allDayElement,vr),i&&(this.parent.crudModule.crudObj.isCrudAction=!1),this.parent.renderTemplates(function(){var e;t.parent&&t.parent.isReact&&t.parent.activeViewOptions.eventTemplate&&(e=[].slice.call(t.parent.element.querySelectorAll("."+oi)),B.removeClass(e,oi))})))}},r.prototype.initializeValues=function(){if(this.resources=0<this.parent.activeViewOptions.group.resources.length?this.parent.uiStateValues.isGroupAdaptive?[this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex]]:this.parent.resourceBase.lastResourceLevel:[],0<this.resources.length&&this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.virtualScrollModule&&(this.resources=this.parent.resourceBase.renderedResources),this.cellHeight=parseFloat(this.parent.getElementHeight(this.parent.element.querySelector(".e-content-wrap tbody tr")).toFixed(2)),this.dateRender[0]=this.parent.activeView.renderDates,0<this.parent.activeViewOptions.group.resources.length)for(var e=0,t=this.resources.length;e<t;e++)this.dateRender[parseInt(e.toString(),10)]=this.resources[parseInt(e.toString(),10)].renderDates},r.prototype.getHeight=function(e,t){t=(ct(t)-ct(e))/je*(this.cellHeight*this.slotCount)/this.interval;return t<=0?this.cellHeight:t},r.prototype.appendEvent=function(e,t,i,n){var r=this.element.querySelector("."+x+'[id="'+x+"-"+i+'"]'),i=(this.parent.enableRtl?B.setStyleAttribute(t,{right:n}):B.setStyleAttribute(t,{left:n}),t.classList.contains(yi)?"blockEvent":"event"),n={data:B.extend({},e,null,!0),element:t,cancel:!1,type:i};this.parent.trigger(ie,n,function(e){e.cancel||r.appendChild(t)})},r.prototype.processBlockEvents=function(){for(var e=this.getResourceList(),t=this.getStartCount(),i=0,n=e;i<n.length;i++)for(var r=n[i],a=this.dateRender[parseInt(r.toString(),10)],s=0,o=a.length;s<o;s++){for(var l=new Date(a[parseInt(s.toString(),10)].getTime()),p=z(Y(a[parseInt(s.toString(),10)],1)),c=0,h=this.filterEvents(l,p,this.parent.blockProcessed,this.resources[parseInt(r.toString(),10)]);c<h.length;c++){var d=h[c];this.parent.resourceBase&&this.setValues(d,r),this.renderBlockEvents(d,s,r,t),this.cssClass=null,this.groupOrder=null}t+=1}},r.prototype.renderBlockEvents=function(e,t,i,n){var r,a=this.isSpannedEvent(e,t,i),s=a[this.fields.startTime],o=a[this.fields.endTime],l=Je(z(new Date(this.dateRender[parseInt(i.toString(),10)][parseInt(t.toString(),10)].getTime())),this.startHour,this.endHour);s<=o&&this.isValidEvent(e,s,o,l)&&this.isWorkDayAvailable(i,s)&&(r=l=void 0,l=a[this.fields.isAllDay]?(a=this.parent.element.querySelector("."+A+" table"),r=B.formatUnit(a.offsetHeight),B.formatUnit(0)):(r=B.formatUnit(this.getHeight(s,o)),B.formatUnit(this.getTopValue(s))),e.IsBlock&&(r=B.formatUnit(parseInt(r,10)-1)),a=this.createBlockAppointmentElement(e,i,this.isResourceEventTemplate),o=e.IsBlock?"99%":"100%",B.setStyleAttribute(a,{width:o,height:r,top:l}),s=this.getDayIndex(t,i,n),o=e.IsBlock?"0.5px":"0px",this.appendEvent(e,a,s,o))},r.prototype.renderEvents=function(u){B.removeClass(this.allDayElement,vr);for(var g,m="allDayEvents"===u?this.sortByDateTime(this.allDayEvents):void 0,e=this.getResourceList(),v=this.getStartCount(),f="allDayEvents"===u?this.parent.getElementHeightFromClass(this.element.querySelector("."+rn),V):0,y="allDayEvents"===u&&0<this.allDayElement.length?this.allDayElement[0].offsetTop:0,T=this,t=0,i=e;t<i.length;t++)!function(t){g=!0,T.parent.crudModule&&T.parent.crudModule.crudObj.isCrudAction&&"allDayEvents"!==u&&!T.parent.uiStateValues.isGroupAdaptive&&0===T.parent.crudModule.crudObj.sourceEvent.filter(function(e){return e.groupIndex===t}).length&&0===T.parent.crudModule.crudObj.targetEvent.filter(function(e){return e.groupIndex===t}).length&&(g=!1),T.slots=[];var e=T.dateRender[parseInt(t.toString(),10)],i=T.getRenderedDates(e)||e;T.slots.push(e.map(function(e){return+e}));for(var n=0,r=e.length;n<r&&e[parseInt(n.toString(),10)]<=i[i.length-1];n++){T.renderedEvents=[];var a=new Date(e[parseInt(n.toString(),10)].getTime()),s=z(Y(e[parseInt(n.toString(),10)],1)),a=T.filterEvents(a,s,m,T.resources[parseInt(t.toString(),10)]);if(g)for(var o=0,l=a;o<l.length;o++){var p=l[o];if(T.parent.resourceBase&&T.setValues(p,t),"allDayEvents"===u)T.renderAllDayEvents(p,n,t,v,!1,y,f);else if(T.isAllDayAppointment(p))T.allDayEvents.push(B.extend({},p,null,!0));else{if(T.parent.eventSettings.enableMaxHeight&&0<T.getOverlapIndex(p,n,!1,t))continue;T.renderNormalEvents(p,n,t,v)}T.cssClass=null,T.groupOrder=null}else for(var c=0,h=a;c<h.length;c++){var d=h[c];T.isAllDayAppointment(d)&&T.allDayEvents.push(B.extend({},d,null,!0))}v+=1}}(i[t])},r.prototype.getStartCount=function(){return this.parent.virtualScrollModule&&this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.timeScale.enable?parseInt(this.element.querySelector("."+x).getAttribute("id").split("-").slice(-1)[0],10):0},r.prototype.getDayIndex=function(e,t,i){var n=this;if(!this.parent.activeViewOptions.group.byDate)return i;if(this.parent.activeViewOptions.group.byDate&&!this.parent.activeViewOptions.group.hideNonWorkingDays)return i=this.parent.resourceBase.lastResourceLevel[0].renderDates.indexOf(this.dateRender[parseInt(t.toString(),10)][parseInt(e.toString(),10)]),this.resources.length*i+t;for(var r=0,a=this.parent.activeView.colLevels[0],s=this.dateRender[parseInt(t.toString(),10)][parseInt(e.toString(),10)].getTime(),o=[],l=0;l<a.length&&(o=this.parent.resourceBase.resourceDateTree[parseInt(l.toString(),10)],s!==a[parseInt(l.toString(),10)].date.getTime());l++)r+=a[parseInt(l.toString(),10)].colSpan;i=o.findIndex(function(e){return e.groupOrder.toString()===n.resources[parseInt(t.toString(),10)].groupOrder.toString()});return i<0?r:r+i},r.prototype.setValues=function(e,t){0<this.parent.activeViewOptions.group.resources.length?(this.cssClass=this.resources[parseInt(t.toString(),10)].cssClass,this.groupOrder=this.resources[parseInt(t.toString(),10)].groupOrder):this.cssClass=this.parent.resourceBase.getCssClass(e)},r.prototype.getResourceList=function(){return Array.apply(null,{length:0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive?this.resources.length:1}).map(function(e,t){return t})},r.prototype.createAppointmentElement=function(e,t,i,n){var r,a,s=this.parent.eventFields,o=e[s.subject]||this.parent.eventSettings.fields.subject.default||this.parent.localeObj.getConstant("addTitle"),l=B.createElement("div",{className:V,attrs:{"data-id":"Appointment_"+e[s.id],"data-guid":e.Guid,role:"button",tabindex:"0","aria-disabled":this.parent.eventBase.getReadonlyAttribute(e),"aria-label":this.parent.getAnnouncementString(e)}}),p=(e[this.fields.isReadonly]&&B.addClass([l],"e-read-only"),B.createElement("div",{className:Di})),c=(l.appendChild(p),0<this.parent.activeViewOptions.group.resources.length&&(c=this.parent.uiStateValues.isGroupAdaptive?this.parent.uiStateValues.groupIndex:n,l.setAttribute("data-group-index",c.toString())),i);return B.isNullOrUndefined(this.parent.activeViewOptions.eventTemplate)?(i=B.createElement("div",{className:Gn}),this.parent.sanitize(o,i),t?e[s.isAllDay]?r=[i]:(r=[],o=B.createElement("div",{className:Ci+(this.parent.isAdaptive?" "+d:""),innerHTML:this.parent.getTimeString(e[s.startTime])}),a=B.createElement("div",{className:Ci+(this.parent.isAdaptive?" "+d:""),innerHTML:this.parent.getTimeString(e[s.endTime])}),B.addClass([i],"e-text-center"),c.isLeft||r.push(o),r.push(i),c.isRight||r.push(a)):(o=this.parent.getTimeString(e[s.startTime])+" - "+this.parent.getTimeString(e[s.endTime]),a=B.createElement("div",{className:Ci+(this.parent.isAdaptive?" "+d:""),innerHTML:o}),o=B.createElement("div",{className:Xn}),this.parent.sanitize(e[s.location]||this.parent.eventSettings.fields.location.default||"",o),r=[i,a,o])):(i=this.parent.element.id+"_"+this.parent.activeViewOptions.eventTemplateName+"eventTemplate",a=this.parent.uiStateValues.isGroupAdaptive?this.parent.uiStateValues.groupIndex:n,o=this.isResourceEventTemplate?this.parent.getEventTemplateName(a):"eventTemplate",r=this.parent.getAppointmentTemplate()(e,this.parent,o,i,!1,void 0,void 0,this.parent.root)),B.append(r,p),this.parent.isAdaptive||B.isNullOrUndefined(e[s.recurrenceRule])&&B.isNullOrUndefined(e[s.recurrenceID])||(n=e[s.id]===e[s.recurrenceID]?en:tn,a=B.createElement("div",{className:Dt+" "+n}),(t?p:l).appendChild(a)),this.parent.eventBase.renderSpannedIcon(t?p:l,c),B.isNullOrUndefined(this.cssClass)||B.addClass([l],this.cssClass),this.applyResourceColor(l,e,"backgroundColor",this.groupOrder),this.renderResizeHandler(l,c,e[this.fields.isReadonly]),l},r.prototype.createMoreIndicator=function(e,t,i){var i=i+t,t=e[parseInt(i.toString(),10)];t.childElementCount<=0?(e=B.createElement("div",{className:on,id:on+"-"+i.toString()}),i=B.createElement("div",{className:hn,attrs:{tabindex:"0","data-index":i.toString(),"data-count":"1"},innerHTML:"+1 "+(this.parent.isAdaptive?"":this.parent.localeObj.getConstant("more"))}),e.appendChild(i),t.appendChild(e),B.EventHandler.add(i,"click",this.rowExpandCollapse,this)):(e=t.querySelector("."+hn),i=parseInt(e.getAttribute("data-count"),10)+1,e.setAttribute("data-count",i.toString()),e.innerHTML="+"+this.parent.globalize.formatNumber(i)+" "+(this.parent.isAdaptive?"":this.parent.localeObj.getConstant("more")))},r.prototype.isSpannedEvent=function(e,t,i){var n=z(this.dateRender[parseInt(i.toString(),10)][parseInt(t.toString(),10)]),i=this.getRenderedDates(this.dateRender[parseInt(i.toString(),10)])||[n],i=(0===i.filter(function(e){return e.getDay()===t}).length&&(n=z(i[0])),this.parent.eventFields),n=Je(n,this.startHour,this.endHour),r=B.extend({},e,null,!0),e=(r.isSpanned={isBottom:!1,isTop:!1,isSameDuration:r[i.startTime].getTime()===r[i.endTime].getTime()},e[i.startTime].getTime()<n.startHour.getTime()&&(r[i.startTime]=n.startHour,r.isSpanned.isTop=!0),e[i.endTime].getTime()>n.endHour.getTime()&&(r[i.endTime]=n.endHour,r.isSpanned.isBottom=!0),this.updateEventMinimumDuration(n,r[i.startTime],r[i.endTime]));return r[i.startTime]=e.startDate,r[i.endTime]=e.endDate,r},r.prototype.isWorkDayAvailable=function(e,t){return!(this.parent.activeViewOptions.group.hideNonWorkingDays&&0<this.resources.length)||(e=this.resources[parseInt(e.toString(),10)].resourceData[this.resources[parseInt(e.toString(),10)].resource.workDaysField]||this.parent.activeViewOptions.workDays)&&0<=e.indexOf(t.getDay())},r.prototype.renderAllDayEvents=function(n,t,e,i,r,a,s){var o,l,p,c,h,d,u,g,m,v=this,f=this.getRenderedDates(this.dateRender[parseInt(e.toString(),10)])||this.dateRender[parseInt(e.toString(),10)],y=(this.parent.activeViewOptions.group.byDate&&(this.slots[0]=[this.dateRender[parseInt(e.toString(),10)][parseInt(t.toString(),10)].getTime()],f=[this.dateRender[parseInt(e.toString(),10)][parseInt(t.toString(),10)]]),this.splitEvent(n,f)[0]),T=new Date(y[this.parent.eventFields.startTime].getTime()),w=new Date(y[this.parent.eventFields.endTime].getTime());T.getTime()<this.parent.minDate.getTime()||w.getTime()>this.parent.maxDate.getTime()||(l=1,h=f[o=0].getTime()<=T.getTime()&&Y(f.slice(-1)[0],1).getTime()>=T.getTime(),T<=w&&h&&this.isWorkDayAvailable(e,T)&&(w=[],0===(w=this.renderedAllDayEvents[parseInt(e.toString(),10)]&&(w=this.renderedAllDayEvents[parseInt(e.toString(),10)].filter(function(e){return e.Guid===n.Guid}),this.parent.activeViewOptions.group.byDate)?w.filter(function(e){return e[v.parent.eventFields.startTime]>=f[parseInt(t.toString(),10)]&&e[v.parent.eventFields.endTime]<=Y(new Date(+f[parseInt(t.toString(),10)]),1)}):w).length)&&(p=y.data.count,c=this.getOverlapIndex(y,t,!0,e),y.Index=c,this.allDayLevel=this.allDayLevel<c?c:this.allDayLevel,h=y.data.isRight?0:"Day"===this.parent.currentView?4:7,0<=p&&(o=100*p-(this.parent.activeViewOptions.allowOverlap?h:0)),B.isNullOrUndefined(this.renderedAllDayEvents[parseInt(e.toString(),10)])&&(this.renderedAllDayEvents[parseInt(e.toString(),10)]=[]),this.renderedAllDayEvents[parseInt(e.toString(),10)].push(B.extend({},y,null,!0)),d=[].slice.call(this.element.querySelector("."+Ot).children),u=this.getDayIndex(t,e,i),g=this.element.querySelector("."+rn+":nth-child("+(u+1)+")"),m=r?this.parent.inlineModule.createInlineAppointmentElement(n):this.createAppointmentElement(n,!0,y.data,e),B.addClass([m],an),T=B.extend({},y.data,null,!0),n.data=T,w={data:n,element:m,cancel:!1},this.parent.trigger(ie,w,function(e){if(!e.cancel){if(g.appendChild(m),l+=(0===c?a:a+c*s)+1,B.setStyleAttribute(m,{width:o+"%",top:B.formatUnit(l)}),1<c){v.moreEvents.push(m);for(var t=0,i=p;t<i;t++)v.createMoreIndicator(d,t,u)}v.allDayElement[0].setAttribute("data-count",v.allDayLevel.toString());e=4+(!v.parent.uiStateValues.expand&&2<v.allDayLevel?3*s:(v.allDayLevel+1)*s);v.setAllDayRowHeight(e),v.addOrRemoveClass(),v.wireAppointmentEvents(m,n)}})))},r.prototype.renderNormalEvents=function(e,t,i,n,r){var a=this.isSpannedEvent(e,t,i),s=a[this.fields.startTime],o=a[this.fields.endTime],l=0,p=Je(z(new Date(this.dateRender[parseInt(i.toString(),10)][parseInt(t.toString(),10)].getTime())),this.startHour,this.endHour),c=this.isValidEvent(e,s,o,p);s.getTime()<this.parent.minDate.getTime()||o.getTime()>Y(this.parent.maxDate,1).getTime()||s<=o&&c&&this.isWorkDayAvailable(i,s)&&(c=a.isSpanned.isSameDuration?this.cellHeight:this.getHeight(s,o),s.getTime()>=p.startHour.getTime()&&(l=this.getTopValue(s)),o=this.getOverlapIndex(a,t,!1,i),a.Index=o,this.overlapList.push(a),1<this.overlapList.length?(B.isNullOrUndefined(this.overlapEvents[parseInt(o.toString(),10)])&&(this.overlapEvents[parseInt(o.toString(),10)]=[]),this.overlapEvents[parseInt(o.toString(),10)].push(a)):(this.overlapEvents=[],this.overlapEvents.push([a])),p={index:o,left:"0%",width:this.getEventWidth(),day:n,dayIndex:t,record:a,resource:i},(s=this.adjustOverlapElements(p)).appWidth,B.isNullOrUndefined(this.renderedEvents[parseInt(i.toString(),10)])&&(this.renderedEvents[parseInt(i.toString(),10)]=[]),o=void this.renderedEvents[parseInt(i.toString(),10)].push(B.extend({},a,null,!0)),o=r?this.parent.inlineModule.createInlineAppointmentElement(e):this.createAppointmentElement(e,!1,a.isSpanned,i),B.setStyleAttribute(o,{width:this.parent.eventSettings.enableMaxHeight||!this.parent.activeViewOptions.allowOverlap?"100%":s.appWidth,height:c+"px",top:l+"px"}),p=c-40-15*o.querySelectorAll("."+Fi).length,r=o.querySelector("."+Gn),!this.parent.isAdaptive&&r&&(r.style.maxHeight=B.formatUnit(p)),l=this.getDayIndex(t,i,n),(c={})[this.fields.startTime]=e[this.fields.startTime],c[this.fields.endTime]=e[this.fields.endTime],a.data=c,this.appendEvent(a,o,l,s.appLeft),this.wireAppointmentEvents(o,e))},r.prototype.getEventWidth=function(){var e=(("Day"===this.parent.currentView?97:94)-this.overlapEvents.length)/this.overlapEvents.length;return(e<0?0:e)+"%"},r.prototype.getEventLeft=function(e,t){e=(parseFloat(e)+1)*t;return(99<e?99:e)+"%"},r.prototype.getStartEndHours=function(e){var t;return B.isNullOrUndefined(e)||""===e?null:(t=new Date(2e3,0,0,0),2===(e=e.split(":")).length&&t.setHours(parseInt(e[0],10),parseInt(e[1],10),0),t)},r.prototype.getTopValue=function(e){var t=this.getStartEndHours(this.parent.activeViewOptions.startHour),e=60*(e.getHours()-t.getHours())+(e.getMinutes()-t.getMinutes());return this.parent.activeViewOptions.timeScale.enable?e*this.cellHeight*this.slotCount/this.interval:0},r.prototype.getOverlapIndex=function(t,e,i,r){var n,a=this,s=this.parent.eventFields,o=[],l=-1;if(this.overlapEvents=[],i)B.isNullOrUndefined(this.renderedAllDayEvents[parseInt(r.toString(),10)])||(n=z(new Date(this.dateRender[parseInt(r.toString(),10)][parseInt(e.toString(),10)].getTime())),o=this.renderedAllDayEvents[parseInt(r.toString(),10)].filter(function(e){return z(e[s.startTime]).getTime()<=n.getTime()&&z(e[s.endTime]).getTime()>=n.getTime()}),0<this.parent.activeViewOptions.group.resources.length&&(o=this.filterEventsByResource(this.resources[parseInt(r.toString(),10)],o)));else{var p=B.isNullOrUndefined(this.renderedEvents[parseInt(r.toString(),10)])?[]:this.renderedEvents[parseInt(r.toString(),10)],c=[],h=t[s.startTime],d=t[s.endTime],u=(this.overlapList=p.filter(function(e){return e[s.endTime]>h&&e[s.startTime]<=d||e[s.startTime]>=d&&e[s.endTime]<=h||e[s.endTime].getTime()===e[s.startTime].getTime()&&e[s.startTime].getTime()===h.getTime()&&e[s.endTime]<d}),0<this.parent.activeViewOptions.group.resources.length&&(this.overlapList=this.filterEventsByResource(this.resources[parseInt(r.toString(),10)],this.overlapList)),[]);this.overlapList.forEach(function(e){u.push(e);for(var i=[],n=new Set;0<u.length&&"break"!==function(){var t=u.shift();if(p.filter(function(e){return e[s.endTime]>t[s.startTime]&&e[s.startTime]<=t[s.endTime]&&!n.has(e[s.id])}).forEach(function(e){i.push(e),n.add(e[s.id]),u.push(e)}),n.size<p.length-1)return"break"}(););e=(i=0<a.parent.activeViewOptions.group.resources.length?a.filterEventsByResource(a.resources[parseInt(r.toString(),10)],i):i).filter(function(e){return-1===a.overlapList.indexOf(e)});0<e.length&&(c=c.concat(e))});for(var g=0;g<c.length-1;g++)for(var m=g+1;m<c.length;m++)c[parseInt(g.toString(),10)][s.id]===c[parseInt(m.toString(),10)][s.id]&&(c.splice(m,1),m--);this.overlapList=this.overlapList.concat(c);for(var v=0,f=o=this.overlapList;v<f.length;v++){var y=f[v],T=y.Index;B.isNullOrUndefined(this.overlapEvents[parseInt(T.toString(),10)])?this.overlapEvents[parseInt(T.toString(),10)]=[y]:this.overlapEvents[parseInt(T.toString(),10)].push(y)}}return-1===(l=0<(o=i?o:o.filter(function(e){return e[s.startTime]===t[s.startTime]&&e[s.endTime]>t[s.endTime]||e[s.endTime]>t[s.startTime]&&e[s.startTime]<t[s.endTime]||e[s.endTime]===t[s.startTime]&&e[s.startTime]===t[s.endTime]||e[s.startTime].getTime()===t[s.startTime].getTime()&&e[s.endTime].getTime()===t[s.endTime].getTime()||e[s.startTime].getTime()===t[s.startTime].getTime()&&e[s.endTime].getTime()<t[s.endTime].getTime()||e[s.endTime].getTime()>t[s.endTime].getTime()})).length?0<(e=o.map(function(e){return e.Index})).length?this.getSmallestMissingNumber(e):0:l)?0:l},r.prototype.adjustOverlapElements=function(e){for(var t={appWidth:e.width,appLeft:e.left},i=0,n=this.overlapEvents.length;i<n;i++)if(!B.isNullOrUndefined(this.overlapEvents[parseInt(i.toString(),10)]))for(var r=0,a=this.overlapEvents[parseInt(i.toString(),10)].length;r<a;r++){var s,o=this.getDayIndex(e.dayIndex,e.resource,e.day),o=this.element.querySelector("#e-appointment-wrapper-"+o);o&&0<o.childElementCount&&(s=this.overlapEvents[parseInt(i.toString(),10)][parseInt(r.toString(),10)].Guid,0<o.querySelectorAll('div[data-guid="'+s+'"]').length&&s!==e.record.Guid?(o=o.querySelector('div[data-guid="'+s+'"]'),parseFloat(e.width)<=parseFloat(o.style.width)&&(this.parent.enableRtl?o.style.right=this.getEventLeft(e.width,i):o.style.left=this.getEventLeft(e.width,i),o.style.width=parseFloat(e.width)+"%"),t.appWidth=o.style.width):(s=e.width,B.isNullOrUndefined(this.overlapEvents[i-1])&&(s=this.getEventWidth()),t.appWidth=s,t.appLeft=this.getEventLeft(s,e.index)))}return t},r.prototype.setAllDayRowHeight=function(e){var t=this.parent.element.querySelector("."+Vt),i=("auto"!==this.parent.height&&this.parent.enableAllDayScroll||B.addClass([t],Fr),this.parent.element.querySelector("."+Ot));if(i.style.height="",this.parent.uiStateValues.expand&&"auto"!==this.parent.height&&this.parent.enableAllDayScroll)i.style.height=e/12+"em",this.parent.eventBase.allDayExpandScroll(t);else{for(var n=0,r=this.allDayElement;n<r.length;n++)r[n].style.height=e/12+"em";B.removeClass([t],qr)}},r.prototype.addOrRemoveClass=function(){var t=this,e=(this.moreEvents.filter(function(e){!t.parent.uiStateValues.expand&&2<t.allDayLevel?(B.addClass([e],sn),e.setAttribute("tabindex","-1")):(B.removeClass([e],sn),e.setAttribute("tabindex","0"))}),this.element.querySelector("."+ln));this.parent.uiStateValues.expand?(B.removeClass([e],pn),B.addClass([e],cn)):(B.removeClass([e],cn),B.addClass([e],pn)),2<this.allDayLevel?B.removeClass([e],d):B.addClass([e],d),[].slice.call(this.element.querySelectorAll("."+on)).forEach(function(e){!t.parent.uiStateValues.expand&&2<t.allDayLevel?B.removeClass([e],d):B.addClass([e],d)})},r.prototype.getEventHeight=function(){var e=B.createElement("div",{className:V,styles:"visibility:hidden"}),t=(this.element.querySelector("."+rn+":first-child").appendChild(e),e.offsetHeight);return B.remove(e),t},r.prototype.rowExpandCollapse=function(){var e,t=this.element.querySelector("."+ln);this.parent.uiStateValues.expand=t.classList.contains(pn),this.parent.uiStateValues.expand?(t.setAttribute("title",this.parent.localeObj.getConstant("collapseAllDaySection")),t.setAttribute("aria-label",this.parent.localeObj.getConstant("collapseAllDaySection")),e=(this.allDayLevel+1)*this.getEventHeight()+4):(t.setAttribute("title",this.parent.localeObj.getConstant("expandAllDaySection")),t.setAttribute("aria-label",this.parent.localeObj.getConstant("expandAllDaySection")),e=3*this.getEventHeight()+4,this.parent.element.querySelector("."+Vt).scrollTop=0),this.setAllDayRowHeight(e),this.animation.animate(this.allDayElement[0]),this.addOrRemoveClass(),this.animation.animate(t)},r.prototype.animationUiUpdate=function(){this.parent.notify(Ve,{})},r.prototype.destroy=function(){!this.parent||this.parent&&this.parent.isDestroyed||(this.removeEventListener(),this.allDayElement=null,this.renderedAllDayEvents=null,this.renderedEvents=null,this.slotCount=null,this.interval=null,this.startHour=null,this.endHour=null,this.element=null,this.fields=null,this.animation=null,Ga.prototype.destroy.call(this))};var _a,Ga,Xa=r;function r(e){e=Ga.call(this,e)||this;return e.dateRender=[],e.renderedEvents=[],e.renderedAllDayEvents=[],e.overlapEvents=[],e.moreEvents=[],e.overlapList=[],e.allDayEvents=[],e.slotCount=e.parent.activeViewOptions.timeScale.slotCount,e.interval=e.parent.activeViewOptions.timeScale.interval,e.allDayLevel=0,e.startHour=e.getStartEndHours(e.parent.activeViewOptions.startHour),e.endHour=e.getStartEndHours(e.parent.activeViewOptions.endHour),e.element=e.parent.activeView.getPanel(),e.fields=e.parent.eventFields,e.animation=new B.Animation({progress:e.animationUiUpdate.bind(e)}),e.addEventListener(),e}Qa=function(e,t){return(Qa=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}Qa(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(a,Ka=Ya),a.prototype.removeEventWrapper=function(e){if(0<e.length)for(var t=0,i=e="Month"===this.parent.currentView||!this.parent.activeView.isTimelineView()&&!this.parent.activeViewOptions.timeScale.enable?e:[e[0]];t<i.length;t++){var n=i[t];n.parentElement&&n.parentElement.parentNode&&B.remove(n.parentElement)}},a.prototype.renderAppointments=function(){this.parent.dragAndDropModule&&this.parent.dragAndDropModule.setDragArea(),this.isResourceEventTemplate=this.parent.isSpecificResourceEvents();var e,i,t=this.parent.element.querySelector("."+A),n=(this.parent.rowAutoHeight&&(this.parent.uiStateValues.top=t.scrollTop,this.parent.uiStateValues.left=t.scrollLeft),[].slice.call(this.element.querySelectorAll("."+x)));if(this.parent.crudModule&&this.parent.crudModule.crudObj.isCrudAction)for(var r=0,a=this.parent.crudModule.crudObj.sourceEvent.length;r<a;r++){var s=[].slice.call(this.element.querySelectorAll('.e-appointment-wrapper [data-group-index="'+this.parent.crudModule.crudObj.sourceEvent[parseInt(r.toString(),10)].groupIndex+'"]'));this.removeEventWrapper(s),this.parent.crudModule.crudObj.targetEvent[parseInt(r.toString(),10)]&&this.parent.crudModule.crudObj.sourceEvent[parseInt(r.toString(),10)].groupIndex!==this.parent.crudModule.crudObj.targetEvent[parseInt(r.toString(),10)].groupIndex&&(s=[].slice.call(this.element.querySelectorAll('.e-appointment-wrapper [data-group-index="'+this.parent.crudModule.crudObj.targetEvent[parseInt(r.toString(),10)].groupIndex+'"]')),this.removeEventWrapper(s))}else for(var o=0,l=n;o<l.length;o++){var p=l[o];B.remove(p)}this.removeHeightProperty(C),this.element.querySelector("."+O)&&("Month"===this.parent.currentView&&(n=B.createElement("div",{className:x}),(e=this.parent.element.querySelector("."+O)).appendChild(n),this.monthHeaderHeight=n.offsetTop-e.offsetTop,e.removeChild(n)),this.eventHeight=this.parent.getElementHeightFromClass(this.element,V),this.addCellHeight(".e-content-table tbody tr",this.eventHeight,"Month"===this.parent.currentView?0:2,this.monthHeaderHeight,this.moreIndicatorHeight),e=t.scrollTop,this.parent.rowAutoHeight&&this.parent.virtualScrollModule&&!this.parent.virtualScrollModule.isHorizontalScroll&&!B.isNullOrUndefined(this.parent.currentAction)&&(t.scrollTop=t.scrollTop-1),0<this.parent.activeViewOptions.group.resources.length?(this.renderResourceEvents(),this.parent.virtualScrollModule&&this.parent.virtualScrollModule.updateFocusedWorkCell()):this.renderEventsHandler(this.parent.activeView.renderDates,this.parent.activeViewOptions.workDays),this.parent.rowAutoHeight&&(this.updateBlockElements(),n={cssProperties:this.parent.getCssProperties(),module:this.parent.getModuleName(),isPreventScrollUpdate:!0,scrollPosition:{left:this.parent.uiStateValues.left,top:this.parent.uiStateValues.top}},this.parent.virtualScrollModule&&!this.parent.virtualScrollModule.isHorizontalScroll&&(this.parent.currentAction?(t.scrollTop=e,this.parent.currentAction=null):this.parent.virtualScrollModule.updateVirtualScrollHeight()),this.parent.enablePersistence||this.parent.notify(Ve,{}),this.parent.notify(Me,n),"Month"===this.parent.currentView)&&this.parent.showWeekNumber&&(i=[].slice.call(this.parent.element.querySelectorAll(".e-content-wrap table tr td:first-child")),[].slice.call(this.parent.element.querySelectorAll("td."+gi)).forEach(function(e,t){t=i[parseInt(t.toString(),10)].offsetHeight;B.setStyleAttribute(e,{height:t+"px"})}),t=this.parent.element.querySelector("."+ui),B.isNullOrUndefined(t)||(t.scrollTop=this.parent.element.querySelector("."+A).scrollTop)),this.parent.renderTemplates())},a.prototype.renderEventsHandler=function(e,t,i){this.renderedEvents=[];for(var n,r,a,s=0,o=(i?(s=i.groupIndex,this.cssClass=i.cssClass,this.groupOrder=i.groupOrder,n=this.parent.eventBase.filterEventsByResource(i,this.parent.eventsProcessed),r=this.parent.eventBase.filterEventsByResource(i,this.parent.blockProcessed),this.workCells=[].slice.call(this.element.querySelectorAll("."+O+'[data-group-index="'+s+'"]'))):(n=this.parent.eventsProcessed,r=this.parent.blockProcessed,this.workCells=[].slice.call(this.element.querySelectorAll("."+O))),this.sortByDateTime(n),this.sortByDateTime(r),"Month"===this.parent.currentView&&this.parent.rowAutoHeight&&0===this.parent.activeViewOptions.group.resources.length&&(o=[].slice.call(this.parent.element.querySelectorAll(".e-content-wrap table tr td:first-child")),a=this.parent.element.querySelector("."+C).clientHeight/o.length,o.forEach(function(e){B.setStyleAttribute(e,{height:a+"px"})})),this.workCells[this.parent.activeView.isTimelineView()?0:this.workCells.length-1]),l=(this.cellWidth=this.parent.getElementWidth(o),this.cellHeight=this.parent.getElementHeight(o),this.dateRender=e,this.getRenderedDates(e)),p=(this.getSlotDates(t||this.parent.activeViewOptions.workDays),this.processBlockEvents(r,s,i),[]),c=0,h=n;c<h.length;c++){var d=h[c];this.parent.resourceBase&&!i&&(this.cssClass=this.parent.resourceBase.getCssClass(d)),p=p.concat(this.splitEvent(d,l||this.dateRender))}for(var u=0;u<this.slots.length;u++){this.renderedEvents=[];for(var g=this.slots[parseInt(u.toString(),10)],m=Y(new Date(g[g.length-1]),1),v=0,f=this.filterEvents(new Date(g[0]),m,p);v<f.length;v++){var y=f[v];if(this.maxHeight){var T="Month"===this.parent.currentView?y[this.fields.startTime]:this.getStartTime(y,y.data);if(0<this.getIndex(T))continue}this.updateIndicatorIcon(y),this.renderEvents(y,s,n)}}this.cssClass=null,this.groupOrder=null},a.prototype.processBlockEvents=function(e,t,i){for(var n=0,r=e;n<r.length;n++){var a,s,o,l=r[n],p=(this.parent.resourceBase&&!i&&(this.cssClass=this.parent.resourceBase.getCssClass(l)),[]);"day"!==this.renderType||l[this.fields.isAllDay]?p.push(l):(a=B.extend({},l,null,!0),s=this.isSameDate(a[this.fields.startTime],a[this.fields.endTime]),!(a.isBlockIcon=s)&&0<Xe(a[this.fields.startTime])&&((o=B.extend({},l,null,!0))[this.fields.endTime]=Y(z(new Date(l[this.fields.startTime]+"")),1),o.isBlockIcon=!0,a[this.fields.startTime]=o[this.fields.endTime],p.push(o)),!(s=this.isSameDate(a[this.fields.startTime],a[this.fields.endTime]))&&0<Xe(a[this.fields.endTime])&&((o=B.extend({},l,null,!0))[this.fields.startTime]=z(new Date(l[this.fields.endTime]+"")),o.isBlockIcon=!0,p.push(o),a[this.fields.endTime]=o[this.fields.startTime]),p.push(a));for(var c=0,h=p;c<h.length;c++)for(var d=h[c],u=0,g=this.splitEvent(d,this.dateRender);u<g.length;u++){var m=g[u];this.renderBlockEvents(m,t,!!d.isBlockIcon)}}},a.prototype.isSameDate=function(e,t){return new Date(+e).setHours(0,0,0,0)===new Date(+t).setHours(0,0,0,0)},a.prototype.renderBlockEvents=function(e,t,i){var n,r=e.data,a=this.getStartTime(e,r),s=this.getEndTime(e,r),o=this.parent.getIndexOfDate(this.dateRender,z(new Date(a.getTime())));o<0||s<a||(n=this.getCellTd(o),o=this.getPosition(a,s,e[this.fields.isAllDay],o),i?this.renderBlockIndicator(n,o,t):(i=r.count,r=(r=this.getEventWidth(a,s,e[this.fields.isAllDay],i))<=0?this.cellWidth:r,r=e.IsBlock?r-1:r,a=this.parent.enableRtl?0:e.IsBlock?o+1:o,s=this.parent.enableRtl?e.IsBlock?o+1:o:0,i=this.cellHeight-this.monthHeaderHeight,i=e.IsBlock?i-1:i,o=this.getRowTop(t),t=this.createBlockAppointmentElement(e,t,this.isResourceEventTemplate),B.setStyleAttribute(t,{width:r+"px",height:i+"px",left:a+"px",right:s+"px",top:o+"px"}),this.renderEventElement(e,t,n)))},a.prototype.renderBlockIndicator=function(e,t,i){var n=B.createElement("div",{className:"e-icons "+Ti});B.isNullOrUndefined(e.querySelector("."+Ti))&&e.appendChild(n)},a.prototype.getStartTime=function(e,t){return e[this.fields.startTime]},a.prototype.getEndTime=function(e,t){return e[this.fields.endTime]},a.prototype.getCellTd=function(e){return this.workCells[parseInt(e.toString(),10)]},a.prototype.getEventWidth=function(e,t,i,n){return n*this.cellWidth-1},a.prototype.getPosition=function(e,t,i,n){return 0},a.prototype.getRowTop=function(e){return 0},a.prototype.updateIndicatorIcon=function(e){var t,i,n,r,a,s;-1===this.parent.currentView.indexOf("Timeline")||"TimelineMonth"===this.parent.currentView||e[this.fields.isAllDay]||(t=e.data,n=this.parent.activeView.getStartHour(),r=this.parent.activeView.getEndHour(),i=Je(e[this.fields.startTime],n,r),e=Je(e[this.fields.endTime],n,r),n=t[this.fields.startTime],r=t[this.fields.endTime],t.isLeft=t.isLeft||n.getTime()<i.startHour.getTime(),t.isRight=t.isRight||r.getTime()>e.endHour.getTime(),z(n).getTime()!==z(r).getTime()&&(a=i.startHour,e=e.endHour,(s=new Date(z(n))).setHours(e.getHours(),e.getMinutes(),e.getSeconds()),t.isLeft=t.isLeft||n.getTime()>=(a.getDate()===i.endHour.getDate()?s:Y(s,1)).getTime(),r.getTime()!==z(r).getTime())&&(e=new Date(z(r)),t.isRight=t.isRight||r.getTime()<=e.setHours(a.getHours(),a.getMinutes(),a.getSeconds())))},a.prototype.renderResourceEvents=function(){var e=this.parent.uiStateValues.isGroupAdaptive?[this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex]]:this.parent.resourceBase.renderedResources;if(this.parent.crudModule&&this.parent.crudModule.crudObj.isCrudAction){for(var t=0,i=this.parent.crudModule.crudObj.sourceEvent.length;t<i;t++){var n=this.parent.crudModule.crudObj.sourceEvent[parseInt(t.toString(),10)];(!this.parent.uiStateValues.isGroupAdaptive||this.parent.uiStateValues.groupIndex===n.groupIndex&&this.parent.uiStateValues.isGroupAdaptive)&&this.renderEventsHandler(n.renderDates,n.workDays,n),this.parent.crudModule.crudObj.sourceEvent[parseInt(t.toString(),10)].groupIndex!==this.parent.crudModule.crudObj.targetEvent[parseInt(t.toString(),10)].groupIndex&&(n=this.parent.crudModule.crudObj.targetEvent[parseInt(t.toString(),10)],this.renderEventsHandler(n.renderDates,n.workDays,n))}this.parent.crudModule.crudObj.isCrudAction=!1}else for(var r=0,a=e;r<a.length;r++){var s=a[r];this.renderEventsHandler(s.renderDates,s.workDays,s)}},a.prototype.getSlotDates=function(e){this.slots=[];for(var t=this.dateRender.map(function(e){return+e}),i=!this.parent.activeViewOptions.showWeekend||this.parent.activeViewOptions.group.byDate&&this.parent.activeViewOptions.group.hideNonWorkingDays?e.length:7;0<t.length;)this.slots.push(t.splice(0,i))},a.prototype.createAppointmentElement=function(e,t,i){void 0===i&&(i=!1);var n,r,a,s,o=e[this.fields.subject]||this.parent.eventSettings.fields.subject.default||this.parent.localeObj.getConstant("addTitle"),l=B.extend({},e,e.data,!0),l={"data-id":"Appointment_"+e[this.fields.id],role:"button",tabindex:"0","aria-disabled":this.parent.eventBase.getReadonlyAttribute(e),"aria-label":this.parent.getAnnouncementString(l,o)},i=(i||(l["data-guid"]=e.Guid),0<this.parent.activeViewOptions.group.resources.length&&(l["data-group-index"]=t.toString()),B.createElement("div",{className:V,attrs:l})),l=(B.isNullOrUndefined(this.cssClass)||B.addClass([i],this.cssClass),e[this.fields.isReadonly]&&B.addClass([i],"e-read-only"),B.createElement("div",{className:Di})),p=(i.appendChild(l),e.data),c=this.getEventData(e);return B.isNullOrUndefined(this.parent.activeViewOptions.eventTemplate)?(r=e[this.fields.location]||this.parent.eventSettings.fields.location.default||"",a=B.createElement("div",{className:Gn}),this.parent.sanitize(o+(r?"; "+r:""),a),o=B.createElement("div",{className:Ci+(this.parent.isAdaptive?" "+d:""),innerHTML:this.parent.getTimeString(p[this.fields.startTime])}),n=B.createElement("div",{className:Ci+(this.parent.isAdaptive?" "+d:""),innerHTML:this.parent.getTimeString(p[this.fields.endTime])}),"Month"===this.parent.currentView?e[this.fields.isAllDay]?(s=[a],B.addClass([a],"e-text-center")):p.count<=1&&!p.isLeft&&!p.isRight?s=[o,a]:(s=[],B.addClass([a],"e-text-center"),p.isLeft||s.push(o),s.push(a),p.isRight||s.push(n)):(o=void 0,o=e[this.fields.isAllDay]?[a,B.createElement("div",{className:Ci,innerHTML:this.parent.localeObj.getConstant("allDay")})]:(n=this.parent.getTimeString(p[this.fields.startTime])+" - "+this.parent.getTimeString(p[this.fields.endTime]),p=B.createElement("div",{className:Ci+(this.parent.isAdaptive?" "+d:""),innerHTML:n}),n=B.createElement("div",{className:Xn}),this.parent.sanitize(r,n),[a,p,n]),r=B.createElement("div",{className:"e-inner-wrap"}),B.append(o,r),s=[r])):(a=this.parent.element.id+"_"+this.parent.activeViewOptions.eventTemplateName+"eventTemplate",p=this.isResourceEventTemplate?this.parent.getEventTemplateName(t):"eventTemplate",s=this.parent.getAppointmentTemplate()(c,this.parent,p,a,!1,void 0,void 0,this.parent.root)),B.append(s,l),this.appendEventIcons(e,l),this.renderResizeHandler(i,e.data,e[this.fields.isReadonly]),i},a.prototype.appendEventIcons=function(e,t){var i=e.data;B.isNullOrUndefined(e[this.fields.recurrenceRule])&&B.isNullOrUndefined(e[this.fields.recurrenceID])||(e=e[this.fields.id]===e[this.fields.recurrenceID]?en:tn,t.appendChild(B.createElement("div",{className:Dt+" "+e+(this.parent.isAdaptive?" "+d:"")}))),i.isLeft&&(e=B.createElement("div",{className:Fi+" "+Dt+" "+Ui}),B.prepend([e],t)),i.isRight&&(e=B.createElement("div",{className:Fi+" "+Dt+" "+Bi}),B.append([e],t))},a.prototype.renderEvents=function(e,t,i){var n=e[this.fields.startTime],r=e[this.fields.endTime],a=this.parent.getIndexOfDate(this.dateRender,z(n));if(!(a<0||n.getTime()<this.parent.minDate.getTime()||r.getTime()>this.parent.maxDate.getTime())){var s=this.parent.rowAutoHeight?1:this.parent.activeViewOptions.maxEventsPerRow,o=this.getIndex(n),l=(e.Index=o,e.data.count);if(n.getTime()<=r.getTime()){var n=l*this.cellWidth-5,r=this.workCells[parseInt(a.toString(),10)],p=o*(this.eventHeight+0),c=this.monthHeaderHeight+(o+1)*(this.eventHeight+0)+this.moreIndicatorHeight,o=!this.parent.activeViewOptions.maxEventsPerRow||this.parent.rowAutoHeight||this.parent.eventSettings.enableIndicator?this.maxOrIndicator?o<1:this.cellHeight>c:o<s;if(this.parent.rowAutoHeight||o){this.renderedEvents.push(B.extend({},e,null,!0));s=void 0,s=this.inlineValue?this.parent.inlineModule.createInlineAppointmentElement():this.createAppointmentElement(e,t);this.applyResourceColor(s,e,"backgroundColor",this.groupOrder),this.wireAppointmentEvents(s,e),B.setStyleAttribute(s,{width:n+"px",top:p+"px"}),this.renderEventElement(e,s,r),this.parent.rowAutoHeight&&(o=this.parent.element.querySelector("."+A),t=this.parent.getElementWidth(o),n=o.offsetHeight===o.clientHeight&&o.offsetWidth===o.clientWidth,p=r.parentElement.firstElementChild,this.updateCellHeight(p,c),n)&&(o.offsetWidth>o.clientWidth||t!==this.parent.getElementWidth(o))&&this.adjustAppointments(t)}else for(var h,d,u,g=0;g<l;g++)this.workCells[a+g]&&((u=this.workCells[a+g].querySelector("."+hn))?(h=parseInt(u.getAttribute("data-count"),10)+1,u.setAttribute("data-count",h.toString()),u.setAttribute("aria-label",h+" "+this.parent.localeObj.getConstant("moreEvents")),u.innerHTML=this.getMoreIndicatorText(h)):(u=new Date(this.dateRender[a+g].getTime()),h=Y(this.dateRender[a+g],1),d=this.workCells[a+g].getAttribute("data-group-index"),u=this.getMoreIndicatorElement(1,u,h),B.isNullOrUndefined(d)||u.setAttribute("data-group-index",d),u.style.top=this.cellHeight-this.monthHeaderHeight-this.moreIndicatorHeight+"px",u.style.width=this.cellWidth-2+"px",this.renderElement(this.workCells[a+g],u),B.EventHandler.add(u,"click",this.moreIndicatorClick,this)))}}},a.prototype.adjustAppointments=function(e){var t=this,i=this.parent.element.querySelector("."+C+" tbody tr"),n=this.parent.getElementWidth(this.workCells[0]),r=(this.cellWidth=n/+(this.workCells[0].getAttribute("colspan")||1),n*i.children.length/(e/100));[].slice.call(this.parent.element.querySelectorAll("."+V)).forEach(function(e){t.parent.enableRtl&&"0px"!==e.style.right?e.style.right=parseFloat(e.style.right)/100*r+"px":"0px"!==e.style.left&&(e.style.left=parseFloat(e.style.left)/100*r+"px"),e.style.width=parseFloat(e.style.width)/100*r+"px"})},a.prototype.updateCellHeight=function(e,t){t>e.offsetHeight&&B.setStyleAttribute(e,{height:t+"px"})},a.prototype.updateBlockElements=function(){for(var e=0,t=[].slice.call(this.element.querySelectorAll("."+yi));e<t.length;e++){var i=t[e],n=B.closest(i,"tr"),n=(this.monthHeaderHeight=i.offsetParent.offsetTop-n.offsetTop,i.style.height=n.offsetHeight-1-this.monthHeaderHeight+"px",n.firstElementChild),r=Math.round(i.offsetWidth/n.offsetWidth);i.style.width=n.offsetWidth*r+"px"}},a.prototype.getFilteredEvents=function(e,t,i,n){return B.isNullOrUndefined(i)?this.filterEvents(e,t):(i=this.parent.resourceBase.lastResourceLevel[parseInt(i,10)],this.filterEvents(e,t,B.isNullOrUndefined(n)?void 0:n,i))},a.prototype.getOverlapEvents=function(e,t){for(var i=[],n=z(e).getTime(),r=0,a=t;r<a.length;r++){var s=a[r];z(s[this.fields.startTime]).getTime()<=n&&z(s[this.fields.endTime]).getTime()>=n&&i.push(s)}return i},a.prototype.getIndex=function(e){var t=-1,i=this.renderedEvents;return-1===(t=0<i.length?0<(e=this.getOverlapEvents(e,i).map(function(e){return e.Index})).length?this.getSmallestMissingNumber(e):0:t)?0:t},a.prototype.moreIndicatorClick=function(i){var n=this,e=B.closest(i.target,"."+hn),r=new Date(parseInt(e.getAttribute("data-start-date"),10)),a=new Date(parseInt(e.getAttribute("data-end-date"),10)),s=e.getAttribute("data-group-index"),e={cancel:!1,event:i,element:e,isPopupOpen:!0,startTime:r,endTime:a,viewName:this.parent.getNavigateView()};s&&(e.groupIndex=parseInt(s,10)),this.parent.trigger(U,e,function(e){var t;e.cancel||(e.isPopupOpen?(t=n.getFilteredEvents(r,a,s),t={date:r,event:t,element:i.target},n.parent.quickPopup.moreEventClick(t,a,s)):(n.parent.setProperties({selectedDate:r},!0),n.parent.changeView(e.viewName,i)))})},a.prototype.renderEventElement=function(e,t,i){var n=this,r=t.classList.contains(yi)?"blockEvent":"event",a=t.classList.contains(V),e="Month"===this.parent.currentView?this.getSpannedTime(e):this.getEventData(e);this.parent.trigger(ie,{data:e,element:t,cancel:!1,type:r},function(e){e.cancel?n.renderedEvents.pop():n.renderElement(i,t,a)})},a.prototype.getSpannedTime=function(e){e=B.extend({},e,null,!0);return e[this.fields.startTime].getDate()===e.data[this.fields.startTime].getDate()&&(e[this.fields.startTime]=e.data[this.fields.startTime]),e[this.fields.endTime].getDate()===e.data[this.fields.endTime].getDate()&&(e[this.fields.endTime]=e.data[this.fields.endTime]),e},a.prototype.getEventData=function(e){var t=B.extend({},e,null,!0);return t[this.fields.startTime]=e.data[this.fields.startTime],t[this.fields.endTime]=e.data[this.fields.endTime],t},a.prototype.renderElement=function(e,t,i){void 0===i&&(i=!1),this.maxOrIndicator&&i&&this.setMaxEventHeight(t,e);var i=e.querySelector("."+x);i?i.appendChild(t):((i=B.createElement("div",{className:x})).appendChild(t),e.appendChild(i))},a.prototype.getMoreIndicatorElement=function(e,t,i){return B.createElement("div",{className:hn,innerHTML:this.getMoreIndicatorText(e),attrs:{role:"button",tabindex:"0","aria-label":this.parent.globalize.formatNumber(e)+" "+this.parent.localeObj.getConstant("moreEvents"),"data-count":e.toString(),"data-start-date":t.getTime().toString(),"data-end-date":i.getTime().toString()}})},a.prototype.getMoreIndicatorText=function(e){return"+"+this.parent.globalize.formatNumber(e)+" "+(this.parent.isAdaptive?"":this.parent.localeObj.getConstant("more"))},a.prototype.removeHeightProperty=function(e){for(var t=0,i=[].slice.call(this.element.querySelectorAll("."+e+" tbody tr"));t<i.length;t++)i[t].firstElementChild.style.height=""},a.prototype.setMaxEventHeight=function(e,t){var i=ot(t.querySelector("."+Pi)),t=t.offsetHeight-i-(this.maxHeight?0:this.moreIndicatorHeight);B.setStyleAttribute(e,{height:t+"px","align-items":"center"})},a.prototype.destroy=function(){this.element=null,this.fields=null,this.maxHeight=null,this.withIndicator=null,this.maxOrIndicator=null,this.moreIndicatorHeight=null,this.removeEventListener(),Ka.prototype.destroy.call(this)};var Qa,Ka,Za=a;function a(e){e=Ka.call(this,e)||this;return e.renderedEvents=[],e.monthHeaderHeight=0,e.moreIndicatorHeight=19,e.renderType="day",e.element=e.parent.activeView.getPanel(),e.fields=e.parent.eventFields,e.maxHeight=e.parent.eventSettings.enableMaxHeight&&!e.parent.eventSettings.enableIndicator&&!e.parent.rowAutoHeight,e.withIndicator=e.parent.eventSettings.enableMaxHeight&&e.parent.eventSettings.enableIndicator&&!e.parent.rowAutoHeight,e.maxOrIndicator=e.maxHeight||e.withIndicator,e.moreIndicatorHeight=e.parent.rowAutoHeight&&e.parent.eventSettings.ignoreWhitespace?0:e.moreIndicatorHeight,e.addEventListener(),e}Ja=function(e,t){return(Ja=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}Ja(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(s,$a=Za),s.prototype.getSlotDates=function(){var e;this.slots=[],this.slots.push(this.parent.activeView.renderDates.map(function(e){return+e})),0<this.parent.activeViewOptions.headerRows.length&&"Hour"!==this.parent.activeViewOptions.headerRows.slice(-1)[0].option?(this.renderType="day",e=this.content.querySelector("."+O),this.cellWidth=this.parent.getElementWidth(e)/+(e.getAttribute("colspan")||1),this.slotsPerDay=1):this.slotsPerDay=this.dayLength/this.dateRender.length},s.prototype.getOverlapEvents=function(e,t){var i=[];if("day"===this.renderType)for(var n=0,r=t;n<r.length;n++)z((o=r[n])[this.fields.startTime]).getTime()<=z(new Date(e.getTime())).getTime()&&z(o[this.fields.endTime]).getTime()>=z(new Date(e.getTime())).getTime()&&i.push(o);else for(var a=0,s=t;a<s.length;a++){var o,l=(o=s[a]).data;(l.trimStartTime.getTime()<=e.getTime()&&l.trimEndTime.getTime()>e.getTime()||l.trimStartTime.getTime()===e.getTime()&&l.trimEndTime.getTime()===e.getTime())&&i.push(o)}return i},s.prototype.getSortComparerIndex=function(e,t){var i=-1,n=this.renderedEvents;return-1===(i=0<n.length?0<(e=this.getOverlapSortComparerEvents(e,t,n).map(function(e){return e.Index})).length?this.getSmallestMissingNumber(e):0:i)?0:i},s.prototype.getOverlapSortComparerEvents=function(s,o,e){for(var l=[],t=function(e){var t,i,n,r,a;"day"===p.renderType?(t=z(s).getTime(),i=z(o).getTime(),n=z(e[p.fields.startTime]).getTime(),r=z(e[p.fields.endTime]).getTime(),(n<=t&&t<=r||(a=(a=i-(Xe(o)<=0?W:0))<t?t:a)<=r&&n<=a||t<n&&r<i)&&l.push(e)):((a=e.data).trimStartTime.getTime()<=s.getTime()&&s.getTime()<a.trimEndTime.getTime()||s.getTime()<=a.trimStartTime.getTime()&&a.trimStartTime.getTime()<o.getTime())&&l.push(e)},p=this,i=0,n=e;i<n.length;i++)t(n[i]);return l},s.prototype.renderResourceEvents=function(){this.removeHeightProperty(zt);this.addCellHeight(".e-resource-column-table tbody tr",this.eventHeight,2,this.moreIndicatorHeight,0,!1);var e=this.parent.uiStateValues.isGroupAdaptive?[this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex]]:this.parent.resourceBase.renderedResources;if(this.parent.crudModule&&this.parent.crudModule.crudObj.isCrudAction){for(var t=0,i=this.parent.crudModule.crudObj.sourceEvent.length;t<i;t++){var n=this.parent.crudModule.crudObj.sourceEvent[parseInt(t.toString(),10)];this.rowIndex=n.groupIndex,(!this.parent.uiStateValues.isGroupAdaptive||this.parent.uiStateValues.groupIndex===n.groupIndex&&this.parent.uiStateValues.isGroupAdaptive)&&this.renderEventsHandler(this.parent.activeView.renderDates,this.parent.activeViewOptions.workDays,n),this.parent.crudModule.crudObj.targetEvent[parseInt(t.toString(),10)]&&this.parent.crudModule.crudObj.sourceEvent[parseInt(t.toString(),10)].groupIndex!==this.parent.crudModule.crudObj.targetEvent[parseInt(t.toString(),10)].groupIndex&&(n=this.parent.crudModule.crudObj.targetEvent[parseInt(t.toString(),10)],this.rowIndex=n.groupIndex,this.renderEventsHandler(this.parent.activeView.renderDates,this.parent.activeViewOptions.workDays,n))}this.parent.crudModule.crudObj.isCrudAction=!1}else for(t=0;t<e.length;t++)this.rowIndex=t,this.renderEventsHandler(this.parent.activeView.renderDates,this.parent.activeViewOptions.workDays,e[parseInt(t.toString(),10)])},s.prototype.renderEvents=function(e,t,i){var n=e[this.fields.startTime],r=e[this.fields.endTime];if(!(n.getTime()<this.parent.minDate.getTime()||r.getTime()>this.parent.maxDate.getTime())){var a=e.data,n=this.getStartTime(e,a),r=this.getEndTime(e,a),s=Je(e[this.fields.startTime],this.startHour,this.endHour),s=this.updateEventMinimumDuration(s,n,r);if(n=s.startDate,r=s.endDate,this.day=this.parent.getIndexOfDate(this.dateRender,z(new Date(n.getTime()))),!(this.day<0)){var o=this.getCellTd(),s=this.parent.rowAutoHeight?1:this.parent.activeViewOptions.maxEventsPerRow,l=B.isNullOrUndefined(this.parent.eventSettings.sortComparer)?this.getIndex(n):this.getSortComparerIndex(n,r),p=(e.Index=l,this.eventHeight),c=a.count,h=B.extend({},e,null,!0);h[this.fields.startTime]=a[this.fields.startTime],h[this.fields.endTime]=a[this.fields.endTime];var a=Je(z(new Date(this.dateRender[this.day].getTime())),this.startHour,this.endHour),d=!0,d=!(!this.isDayProcess()&&!h[this.fields.isAllDay])||this.isValidEvent(h,n,r,a);if(n<=r&&d){var h=this.getEventWidth(n,r,e[this.fields.isAllDay],c),h="day"===this.renderType?h-2:h,a=this.getPosition(n,r,e[this.fields.isAllDay],this.day),u=(h=h<=0?this.cellWidth:h,this.renderedEvents.push(B.extend({},e,null,!0)),B.isNullOrUndefined(this.cellTops[parseInt(t.toString(),10)])&&(this.cellTops[parseInt(t.toString(),10)]=this.getRowTop(t)),this.cellTops[parseInt(t.toString(),10)]),d=u+(this.maxHeight?0:2)+l*(p+2),g=this.parent.enableRtl?0:a,m=this.parent.enableRtl?a:0,a=(l+1)*(p+2)+this.moreIndicatorHeight,l=!this.parent.activeViewOptions.maxEventsPerRow||this.parent.rowAutoHeight||this.parent.eventSettings.enableIndicator?this.maxOrIndicator?l<1:this.cellHeight>a:l<s;if(this.parent.rowAutoHeight||l){var v,s=void 0,s=B.isNullOrUndefined(this.inlineValue)?this.createAppointmentElement(e,t):this.parent.inlineModule.createInlineAppointmentElement();this.applyResourceColor(s,e,"backgroundColor",this.groupOrder),B.setStyleAttribute(s,{width:h+"px",left:g+"px",right:m+"px",top:d+"px"}),this.wireAppointmentEvents(s,e),this.parent.rowAutoHeight?(l=this.parent.element.querySelector("."+A),h=this.parent.getElementWidth(l),d=l.offsetHeight===l.clientHeight&&l.offsetWidth===l.clientWidth,this.renderEventElement(e,s,o),v=this.getFirstChild(t),this.updateCellHeight(v,a),d&&(l.offsetWidth>l.clientWidth||h!==this.parent.getElementWidth(l))&&this.adjustAppointments(h)):this.renderEventElement(e,s,o)}else for(var f=0;f<c;f++){var y=o.querySelector("."+hn),T=this.parent.enableRtl?m:g,T=Math.floor(T/this.cellWidth)*this.cellWidth,w=this.interval/this.slotCount,D="TimelineMonth"===this.parent.activeViewOptions.option||"day"===this.renderType||0!==f?new Date(this.dateRender[this.day+f].getTime()):new Date(n),b=Y(this.dateRender[this.day+f],1);if("TimelineMonth"===this.parent.activeViewOptions.option||"day"===this.renderType){var S=this.getPosition(D,b,e[this.fields.isAllDay],this.day+f);this.renderTimelineMoreIndicator(n,D,b,p,w,t,i,u,g,m,o,y,T,S)}else for(var C=(ct(r)-ct(n))/je*this.slotCount/this.interval,O=0;O<C&&(D=0===O?new Date(D.getTime()):new Date(D.getTime()+6e4*w),C<1&&(D=this.adjustToNearestTimeSlot(D,w)),b=new Date(D.getTime()+6e4*w),!(1<=C&&b.getTime()>r.getTime()));O++){var E=this.getPosition(D,b,!1,this.day+f);if(E<T)break;this.renderTimelineMoreIndicator(n,D,b,p,w,t,i,u,g,m,o,y,T=E,E)}}}this.parent.renderTemplates()}}},s.prototype.adjustToNearestTimeSlot=function(e,t){var e=new Date(e),i=60*e.getHours()*60*1e3+60*e.getMinutes()*1e3,i=Math.floor(i/(60*t*1e3))*(60*t*1e3),t=new Date(e.getTime());return t.setHours(i/36e5%24),t.setMinutes(i%36e5/6e4),t},s.prototype.renderTimelineMoreIndicator=function(e,t,i,n,r,a,s,o,l,p,c,h,d,u){l=this.parent.enableRtl?p=u:u,d=this.parent.enableRtl?p:l,d=Math.floor(d/this.cellWidth)*this.cellWidth,(c&&B.isNullOrUndefined(h)||!this.isAlreadyAvail(d,c))&&(u="TimelineMonth"===this.parent.activeViewOptions.option||"day"===this.renderType?new Date(+e):t,h=new Date(u.setMinutes(Math.floor(u.getMinutes()/r)*r)),d=new Date(h.getTime()+6e4*r),e=void 0,0<this.parent.activeViewOptions.group.resources.length&&!B.isNullOrUndefined(a)&&(e=a.toString()),u=this.getFilterEvents(t,i,h,d,e,s),r=this.cellHeight-this.moreIndicatorHeight,n=this.withIndicator?r-2:n,a=Math.floor(r/(n+2)),s=this.parent.activeViewOptions.maxEventsPerRow&&!this.parent.eventSettings.enableIndicator?u.length-this.parent.activeViewOptions.maxEventsPerRow:u.length-a<=0?1:u.length-a,n=void 0,n="day"===this.renderType?this.getMoreIndicatorElement(s,t,i):this.getMoreIndicatorElement(s,h,d),B.isNullOrUndefined(e)||n.setAttribute("data-group-index",e),n.style.top=o+r+"px",n.style.width=this.cellWidth+"px",n.style.left=Math.floor(l/this.cellWidth)*this.cellWidth+"px",n.style.right=Math.floor(p/this.cellWidth)*this.cellWidth+"px",this.renderElement(c,n),B.EventHandler.add(n,"click",this.moreIndicatorClick,this))},s.prototype.updateCellHeight=function(e,t){var i;(""===e.style.height?this.cellHeight:parseInt(e.style.height,10))<t&&(B.setStyleAttribute(e,{height:t+"px"}),0<this.parent.activeViewOptions.group.resources.length&&(i=this.parent.element.querySelector("."+zt+' tbody td[data-group-index="'+e.getAttribute("data-group-index")+'"]'))&&B.setStyleAttribute(i,{height:t+"px"}),i=this.parent.element.querySelector(".e-month-header-wrapper table tr:nth-child("+(e.parentElement.rowIndex+1)+") td"))&&B.setStyleAttribute(i,{height:t+"px"})},s.prototype.getFirstChild=function(e){var t="";return 0<this.parent.activeViewOptions.group.resources.length&&(t='[data-group-index="'+e.toString()+'"]'),this.parent.element.querySelector(".e-content-table tbody td"+t)},s.prototype.updateBlockElements=function(){for(var e=0,t=[].slice.call(this.element.querySelectorAll("."+yi));e<t.length;e++){var i=t[e],n=parseInt(i.getAttribute("data-group-index"),10),r=this.getFirstChild(n),a=(i.style.height=r.offsetHeight-1+"px",i.offsetWidth/r.offsetWidth);i.style.width=r.offsetWidth*a+"px"}for(var s=0,o=[].slice.call(this.element.querySelectorAll("."+Ti));s<o.length;s++){i=o[s],n=parseInt(i.getAttribute("data-group-index"),10);i.style.top=this.getRowTop(n)+this.getFirstChild(n).offsetHeight-18+"px"}},s.prototype.getStartTime=function(e,t){var i=Je(n=e[this.fields.startTime],this.startHour,this.endHour),n=this.isDayProcess()?e[this.fields.startTime]:i.startHour.getTime()>=t[this.fields.startTime]?i.startHour:i.endHour.getTime()<=t[this.fields.startTime]?this.getNextDay(i.startHour,t):t[this.fields.startTime];return t.trimStartTime=e[this.fields.isAllDay]?i.startHour:t[this.fields.startTime],n},s.prototype.getNextDay=function(e,t){for(var i,n=1;n<=this.dateRender.length;n++)if(i=Y(e,n),-1!==this.parent.getIndexOfDate(this.dateRender,z(new Date(e.getTime()))))return t.count=t.count-1,i;return i},s.prototype.getEndTime=function(e,t){var i=e[this.fields.endTime],n=Je(i,this.startHour,this.endHour);return this.isDayProcess()?i=t[this.fields.endTime]:(i=t[this.fields.endTime],(n.endHour.getTime()<=t[this.fields.endTime]||e[this.fields.isAllDay])&&(i=n.endHour),n.startHour.getTime()>=t[this.fields.endTime].getTime()&&!e[this.fields.isAllDay]&&(i=this.getPreviousDay(n.startHour,n.endHour,t))),t.trimEndTime=e[this.fields.isAllDay]?n.endHour:t[this.fields.endTime],i},s.prototype.getPreviousDay=function(e,t,i){for(var n=1;n<=this.dateRender.length;n++){var r,a,s=Y(t,-n);if(-1!==this.parent.getIndexOfDate(this.dateRender,z(new Date(e.getTime()))))return(s=z(new Date(s.getTime()))).setHours(t.getHours(),t.getMinutes(),t.getSeconds()),r=i.count,a=i[this.fields.endTime],i.count=0!==a.getHours()||0!==a.getMinutes()?r-1:r,s}return i[this.fields.endTime]},s.prototype.getEventWidth=function(e,t,i,n){return"day"===this.renderType||i?n*this.slotsPerDay*this.cellWidth:this.isSameDay(e,t)?this.getSameDayEventsWidth(e,t):this.getSpannedEventsWidth(e,t,n)},s.prototype.getSameDayEventsWidth=function(e,t){return(ct(t)-ct(e))/je*(this.cellWidth*this.slotCount)/this.getIntervalInMinutes(e)},s.prototype.getSpannedEventsWidth=function(e,t,i){var n,r,i=i*this.slotsPerDay*this.cellWidth,a=Je(z(new Date(e.getTime())),this.startHour,this.endHour),a=this.getSameDayEventsWidth(a.startHour,e),t=a+(r=-1===this.parent.getIndexOfDate(this.dateRender,z(new Date(t.getTime())))||(n=(e=Je(z(new Date(t.getTime())),this.startHour,this.endHour)).startHour,e=e.endHour,r=this.interval/this.slotCount,n=this.getEndTimeOfLastSlot(n,e,r),r=this.getSameDayEventsWidth(t,e<n?e:n),this.slotsPerDay*this.cellWidth===r)?0:r);return t<i?i-t:i-a},s.prototype.getEndTimeOfLastSlot=function(e,t,i){t=(t.getTime()-e.getTime())/6e4,t=Math.floor(t/i)*i,i=new Date(e);return i.setMinutes(t),i},s.prototype.isSameDay=function(e,t){return this.parent.getIndexOfDate(this.dateRender,z(new Date(e.getTime())))===this.parent.getIndexOfDate(this.dateRender,z(new Date(t.getTime())))},s.prototype.getAppointmentLeft=function(e,t,i){t=this.isSameDay(t,e.startHour)?(ct(t)-ct(e.startHour))/(je*this.getIntervalInMinutes(t))*this.slotCount:0;return 0===i?t:Math.round((ct(e.endHour)-ct(e.startHour))/this.interval/je*this.slotCount)*i+t},s.prototype.getPosition=function(e,t,i,n){return"day"===this.renderType||i?n*this.slotsPerDay*this.cellWidth:((i=Je(z(new Date(this.dateRender[parseInt(n.toString(),10)].getTime())),this.startHour,this.endHour)).endHour.getTime()<=t.getTime()&&i.startHour.getTime()>=e.getTime()||!(i.endHour.getTime()<=t.getTime())&&i.startHour.getTime()>=e.getTime()?this.getAppointmentLeft(i,i.startHour,n):this.getAppointmentLeft(i,e,n))*this.cellWidth},s.prototype.getFilterEvents=function(e,t,i,n,r,a){return"day"===this.renderType?this.getFilteredEvents(e,t,r,a):this.getFilteredEvents(i,n,r,a)},s.prototype.getIntervalInMinutes=function(e){return 1!==this.slotsPerDay?this.interval:((e=Je(z(new Date(e.getTime())),this.startHour,this.endHour)).endHour.getTime()-e.startHour.getTime())/je},s.prototype.isAlreadyAvail=function(e,t){for(var i=[].slice.call(t.querySelectorAll("."+hn)),n=0;n<i.length;n++){var r=void 0;if(i&&(r=this.parent.enableRtl?i[parseInt(n.toString(),10)].style.right:i[parseInt(n.toString(),10)].style.left),parseInt(r,10)===Math.floor(e))return!0}return!1},s.prototype.getRowTop=function(e){return 0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive?this.parent.element.querySelector("."+A+' tbody td[data-group-index="'+e.toString()+'"]').offsetTop:0},s.prototype.getCellTd=function(){var e=this.parent.uiStateValues.isGroupAdaptive?0:this.rowIndex;return this.eventContainers[parseInt(e.toString(),10)]},s.prototype.renderBlockIndicator=function(e,t,i){var n;0<this.parent.headerRows.length&&("Hour"!==this.parent.headerRows[this.parent.headerRows.length-1].option||"Date"!==this.parent.headerRows[this.parent.headerRows.length-1].option)||(t=Math.floor(t/this.cellWidth)*this.cellWidth+this.cellWidth-22,this.isAlreadyAvail(t,e))||(n=B.createElement("div",{className:"e-icons "+Ti}),0<this.parent.activeViewOptions.group.resources.length&&n.setAttribute("data-group-index",i.toString()),this.parent.enableRtl?n.style.right=t+"px":n.style.left=t+"px",n.style.top=this.getRowTop(i)+this.cellHeight-18+"px",this.renderElement(e,n))},s.prototype.setMaxEventHeight=function(e,t){B.setStyleAttribute(e,{height:this.cellHeight-(this.maxHeight?0:2)-(this.maxHeight?0:this.moreIndicatorHeight)+"px"})},s.prototype.isDayProcess=function(){return"TimelineMonth"===this.parent.currentView||!this.parent.activeViewOptions.timeScale.enable||0<this.parent.activeViewOptions.headerRows.length&&"Hour"!==this.parent.activeViewOptions.headerRows.slice(-1)[0].option},s.prototype.destroy=function(){this.renderType=null,this.eventContainers=null,this.dayLength=null,this.content=null,$a.prototype.destroy.call(this),this.parent=null};var Ja,$a,es=s;function s(e,t){e=$a.call(this,e)||this,e.startHour=e.parent.activeView.getStartHour(),e.endHour=e.parent.activeView.getEndHour(),e.slotCount=e.parent.activeViewOptions.timeScale.slotCount,e.interval=e.parent.activeViewOptions.timeScale.interval,e.day=0,e.rowIndex=0,e.cellTops=[],e.renderType=t,e.eventContainers=[].slice.call(e.element.querySelectorAll("."+fi)),t=[].slice.call(e.element.querySelectorAll("."+C+" tbody tr"));return e.dayLength=0===t.length?0:t[0].children.length,e.content=e.parent.element.querySelector("."+Ct+"."+C),e}is.prototype.inlineEdit=function(e){var t;this.parent.quickPopup&&this.parent.quickPopup.quickPopupHide(),"Cell"===e.type?((t=this.parent.element.querySelector("."+Sn))&&t.classList.contains(xt)&&this.parent.quickPopup.morePopup.hide(),this.removeInlineAppointmentElement(),this.cellEdit(e)):(this.parent.element.querySelector("."+Pr)!==e.element.querySelector("."+Pr)&&this.removeInlineAppointmentElement(),this.eventEdit(e))},is.prototype.cellEdit=function(e){var t=this.generateEventData(),i=e.element.cellIndex,n=this.getEventDaysCount(t),n=(1<n&&(n=Math.round(n),i-=--n),z(new Date(""+t[this.parent.eventFields.startTime])).getTime()),r=z(new Date(""+t[this.parent.eventFields.endTime])).getTime(),e=e.groupIndex||0,a="Day"===this.parent.currentView||"Week"===this.parent.currentView||"WorkWeek"===this.parent.currentView,s=(this.parent.activeViewOptions.timeScale.enable&&a?(s=t[this.parent.eventFields.startTime].getDay(),this.createVerticalViewInline(t,s,e,i)):"Month"===this.parent.currentView||!this.parent.activeViewOptions.timeScale.enable&&a?this.createMonthViewInline(t,e,n,r):this.createTimelineViewInline(t,n,r,e),this.parent.element.querySelector("."+Pr));s&&s.focus()},is.prototype.eventEdit=function(e){var t,i,n,r=e.element.querySelector("."+Pr);B.addClass([e.element],Nr),r?t=r.value:(i=e.element.querySelector("."+Gn),B.isNullOrUndefined(i)||B.addClass([i],d),t=!B.isNullOrUndefined(e.data)&&e.data[this.parent.eventFields.subject]||this.parent.eventSettings.fields.subject.default||this.parent.localeObj.getConstant("addTitle"),r=this.inlineInputEle=B.createElement("input",{className:Pr,attrs:{value:t}}),B.closest(e.element,"."+Sn)?e.element.insertBefore(r,i):-1<["Agenda","MonthAgenda"].indexOf(this.parent.currentView)?(n=e.element.querySelector("."+bi),B.isNullOrUndefined(n)&&(n=B.createElement("div",{className:bi}),e.element.prepend(n)),n.insertBefore(r,n.firstChild)):(n=-1<["TimelineDay","TimelineWeek","TimelineWorkWeek","TimelineMonth"].indexOf(this.parent.currentView)?".e-inner-wrap":".e-appointment-details",n=e.element.querySelector(n),B.isNullOrUndefined(n)?e.element.querySelector(".e-appointment-details").prepend(r):i&&this.parent.activeViewOptions&&!this.parent.activeViewOptions.eventTemplate?n.insertBefore(r,i):n.prepend(r)),r.focus()),r.setSelectionRange(t.length,t.length)},is.prototype.createVerticalViewInline=function(e,t,i,n){var r,a=this.getEventDaysCount(e),s=new Xa(this.parent),t=(s.initializeValues(),s.dateRender[parseInt(i.toString(),10)].map(function(e){return e.getDay()}).indexOf(t));1<=a?(s.allDayElement=[].slice.call(this.parent.element.querySelectorAll("."+w)),(a=s.slots).push.apply(a,this.parent.activeView.renderDates.map(function(e){return+e})),(a=0)<(r=[].slice.call(this.parent.element.querySelectorAll("."+an))).length&&(a=Math.floor(this.parent.getElementHeight(this.parent.element.querySelector("."+Ot))/r[0].offsetHeight)-1),s.allDayLevel=a,r=this.parent.getElementHeightFromClass(this.parent.element.querySelector("."+rn),V),a=0<s.allDayElement.length?s.allDayElement[0].offsetTop:0,s.renderAllDayEvents(e,t,i,n,this.parent.allowInline,a,r)):s.renderNormalEvents(e,t,i,n,this.parent.allowInline)},is.prototype.createMonthViewInline=function(e,t,i,n){for(var r=this.getEventDaysCount(e),e=this.parent.eventBase.cloneEventObject(e,i,n,r,!1,!1),a=new Za(this.parent),i=(a.dateRender=this.parent.activeView.renderDates,a.inlineValue=this.parent.allowInline,this.parent.activeView.renderDates),n=this.parent.activeViewOptions.workDays,r="."+O,s=(0<this.parent.activeViewOptions.group.resources.length&&(r+='[data-group-index="'+t+'"]',i=(s=this.parent.resourceBase.lastResourceLevel[parseInt(t.toString(),10)]).renderDates,n=s.workDays),a.dateRender=i,a.workCells=[].slice.call(this.parent.element.querySelectorAll(r)),a.cellWidth=a.workCells[0].offsetWidth,a.cellHeight=a.workCells[0].offsetHeight,a.eventHeight=this.parent.getElementHeightFromClass(this.parent.monthModule.element||a.element,V),a.getSlotDates(n),a.getRenderedDates(i)),o=0,l=a.splitEvent(e,s||i);o<l.length;o++){var p=l[o];a.renderEvents(p,t)}this.parent.element.querySelector("."+Pr).focus()},is.prototype.createTimelineViewInline=function(e,t,i,n){var r=this.getEventDaysCount(e),e=this.parent.eventBase.cloneEventObject(e,t,i,r,!1,!1),t=new es(this.parent,this.parent.activeViewOptions.timeScale.enable?"hour":"day"),i=(t.dateRender=this.parent.activeView.renderDates,t.eventContainers=[].slice.call(this.parent.element.querySelectorAll("."+fi)),this.parent.element.querySelector("."+O)),r=(t.inlineValue=this.parent.allowInline,t.cellWidth=i.offsetWidth,t.cellHeight=i.offsetHeight,0===this.parent.element.querySelectorAll("."+C+" tbody tr").length?0:this.parent.element.querySelectorAll("."+C+" tbody tr")[0].children.length);t.slotsPerDay=r/t.dateRender.length,t.eventHeight=this.parent.getElementHeightFromClass(t.element,V),t.renderEvents(e,n)},is.prototype.getEventDaysCount=function(e){var t=e[this.parent.eventFields.startTime],e=e[this.parent.eventFields.endTime];return Math.abs(e.getTime()-t.getTime())/W},is.prototype.generateEventData=function(e){var t=this.parent.element.querySelector("."+Pr),t=t?t.value:e?e.innerHTML:"",e={};return e[this.parent.eventFields.id]=this.parent.eventBase.getEventMaxID(),e[this.parent.eventFields.subject]=t,e[this.parent.eventFields.startTime]=this.parent.activeCellsData.startTime,e[this.parent.eventFields.endTime]=this.parent.activeCellsData.endTime,e[this.parent.eventFields.isAllDay]=this.parent.activeCellsData.isAllDay,this.parent.eventWindow.setDefaultValueToObject(e),this.parent.resourceBase&&this.parent.resourceBase.setResourceValues(e,this.parent.activeCellsData.groupIndex),e},is.prototype.documentClick=function(e){e&&""!==e.value?this.inlineCrudActions(e):this.removeInlineAppointmentElement()},is.prototype.inlineCrudActions=function(e){var t;B.closest(e,"."+jr)?(t=this.generateEventData(e),this.parent.addEvent(t)):(t=B.closest(e,"."+V),e=void((t=this.parent.getEventDetails(t))[this.parent.eventFields.subject]=e.value),t[this.parent.eventFields.id]===t[this.parent.eventFields.recurrenceID]&&(e="EditOccurrence",t[this.parent.eventFields.id]=this.parent.eventBase.getEventMaxID()),this.parent.saveEvent(t,e)),this.removeInlineAppointmentElement()},is.prototype.createInlineAppointmentElement=function(e){var t=B.createElement("div",{className:V+" "+jr+" "+Nr}),i=B.createElement("div",{className:Di}),n=(t.appendChild(i),this.inlineInputEle=B.createElement("input",{className:Pr}));return i.appendChild(n),e&&this.parent.eventBase.applyResourceColor(t,e,"backgroundColor"),t},is.prototype.removeInlineAppointmentElement=function(){var e,t=[].slice.call(this.parent.element.querySelectorAll("."+jr)),t=(0<t.length&&t.forEach(function(e){var t=e.querySelector("."+Pr);B.isNullOrUndefined(t)||t.blur(),B.remove(e)}),this.getInlineElement());t&&(e=B.closest(t,"."+V),B.removeClass([e],Nr),e=e.querySelector("."+Gn),B.isNullOrUndefined(e)||B.removeClass([e],d),B.remove(t)),this.inlineInputEle=null},is.prototype.getInlineElement=function(){return this.inlineInputEle},is.prototype.destroy=function(){this.inlineInputEle=null,this.parent.off(ue,this.inlineEdit)};var ts=is;function is(e){this.parent=e,this.parent.on(ue,this.inlineEdit,this)}rs.prototype.renderFormValidator=function(e,t,i,n){var r=this;this.element=i,this.formObj=new P.FormValidator(e,{locale:n,customPlacement:function(e,t){r.errorPlacement(e,t)},rules:t,validationComplete:function(e){r.validationComplete(e)},focusout:function(e){r.focusOut(e)}})},rs.prototype.focusOut=function(e){e=e.relatedTarget;e&&(e.classList.contains("e-dlg-closeicon-btn")||e.classList.contains("e-close")||e.classList.contains(w)||e.classList.contains(It)||e.classList.contains(yn)||e.classList.contains(O)||e.classList.contains(rr))?this.ignoreError=!0:this.ignoreError=!1},rs.prototype.validationComplete=function(e){var t=this.element.querySelector("#"+e.inputName+"_Error");t&&(t.style.display="failure"===e.status?"":"none")},rs.prototype.errorPlacement=function(e,t){var i=t.getAttribute("for"),n=this.element.querySelector("#"+i+"_Error");n||this.ignoreError||this.createTooltip(e,t,i,""),B.isNullOrUndefined(n)||(n.querySelector(".e-error").innerHTML=t.innerHTML)},rs.prototype.createTooltip=function(e,t,i,n){var r,e=e.getBoundingClientRect(),a=(this.element.classList.contains(Tr)?(r=this.element,this.element):r=this.element.querySelector(".e-schedule-dialog .e-dlg-content")).getBoundingClientRect(),i=B.createElement("div",{className:"e-tooltip-wrap e-popup "+gr,id:i+"_Error",styles:"display:"+n+";top:"+(e.bottom-a.top+r.scrollTop+9)+"px;left:"+(e.left-a.left+r.scrollLeft+e.width/2)+"px;"}),n=B.createElement("div",{className:"e-tip-content"}),a=(n.appendChild(t),B.createElement("div",{className:"e-arrow-tip e-tip-top"}));a.appendChild(B.createElement("div",{className:"e-arrow-tip-outer e-tip-top"})),a.appendChild(B.createElement("div",{className:"e-arrow-tip-inner e-tip-top"})),i.appendChild(n),i.appendChild(a),r.appendChild(i),i.style.left=parseInt(i.style.left,10)-i.offsetWidth/2+"px"},rs.prototype.destroyToolTip=function(){if(this.element)for(var e=0,t=[].slice.call(this.element.querySelectorAll("."+gr));e<t.length;e++){var i=t[e];B.remove(i)}this.formObj&&this.formObj.element&&this.formObj.reset()},rs.prototype.destroy=function(){this.formObj&&this.formObj.element&&!this.formObj.isDestroyed&&this.formObj.destroy(),this.formObj=null,this.element=null};var ns=rs;function rs(){}o.prototype.render=function(){this.renderQuickPopup(),this.renderMorePopup(),this.renderQuickDialog()},o.prototype.renderQuickPopup=function(){var e=B.createElement("div",{className:Tr+" e-popup-close",attrs:{role:"dialog"}});this.parent.isAdaptive?(document.body.appendChild(e),B.addClass([e],yt)):this.parent.element.appendChild(e),this.quickPopup=new M.Popup(e,{targetType:this.parent.isAdaptive?"container":"relative",enableRtl:this.parent.enableRtl,open:this.quickPopupOpen.bind(this),close:this.quickPopupClose.bind(this),hideAnimation:this.parent.isAdaptive?{name:"ZoomOut"}:{name:"FadeOut",duration:150},showAnimation:this.parent.isAdaptive?{name:"ZoomIn"}:{name:"FadeIn",duration:150},collision:this.parent.isAdaptive?{X:"fit",Y:"fit"}:this.parent.enableRtl?{X:"flip",Y:"fit"}:{X:"none",Y:"fit"},position:this.parent.isAdaptive||this.parent.enableRtl?{X:"left",Y:"top"}:{X:"right",Y:"top"},viewPortElement:this.parent.isAdaptive?document.body:this.parent.element,zIndex:this.parent.isAdaptive?1004:3})},o.prototype.renderMorePopup=function(){var e='<div class="'+Cn+'"><div class="e-more-event-header"><div class="'+Vn+'" title="'+this.l10n.getConstant("close")+'" tabindex="0" role="button"></div><div class="'+On+'"><div class="'+En+'" id="'+this.parent.element.id+'_more_popup"></div><div class="'+xn+" "+Hi+'" tabindex="0" role="link"></div></div></div></div>',e=B.createElement("div",{className:Sn+" e-popup-close",innerHTML:e}),e=(this.parent.isAdaptive?(document.body.appendChild(e),B.addClass([e],yt)):this.parent.element.appendChild(e),this.morePopup=new M.Popup(e,{targetType:this.parent.isAdaptive?"container":"relative",enableRtl:this.parent.enableRtl,hideAnimation:{name:"ZoomOut",duration:300},showAnimation:{name:"ZoomIn",duration:300},open:this.morePopupOpen.bind(this),close:this.morePopupClose.bind(this),collision:this.parent.isAdaptive?{X:"fit",Y:"fit"}:this.parent.enableRtl?{X:"flip",Y:"fit"}:{X:"flip",Y:"flip"},viewPortElement:this.parent.isAdaptive?document.body:this.parent.element,zIndex:this.parent.isAdaptive?1002:2}),this.morePopup.element.setAttribute("role","dialog"),this.morePopup.element.setAttribute("aria-labelledby",this.parent.element.id+"_more_popup"),this.morePopup.element.querySelector("."+Vn));this.renderButton("e-round",Dt+" "+ur,!1,e,this.closeClick),B.EventHandler.add(this.morePopup.element.querySelector("."+xn),"click",this.navigationClick,this)},o.prototype.renderQuickDialog=function(){var e=[{buttonModel:{cssClass:"e-quick-alertok e-flat",isPrimary:!0},click:this.dialogButtonClick.bind(this)},{buttonModel:{cssClass:"e-quick-alertcancel e-flat",isPrimary:!1},click:this.dialogButtonClick.bind(this)},{buttonModel:{cssClass:"e-quick-dialog-cancel e-disable e-flat",isPrimary:!1},click:this.dialogButtonClick.bind(this)}],t=(this.parent.eventSettings.editFollowingEvents&&(t={buttonModel:{cssClass:"e-quick-alertfollowing e-flat",isPrimary:!1},click:this.dialogButtonClick.bind(this)},e.splice(1,0,t)),this.quickDialog=new M.Dialog({animationSettings:{effect:"Zoom"},buttons:e,cssClass:Mn,closeOnEscape:!0,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,beforeClose:this.beforeQuickDialogClose.bind(this),isModal:!0,position:{X:"center",Y:"center"},showCloseIcon:!0,target:document.body,visible:!1,width:"auto"}),B.createElement("div",{id:this.parent.element.id+"QuickDialog"})),e=(this.parent.element.appendChild(t),this.quickDialog.appendTo(t),this.quickDialog.element.querySelector("."+Ln)),t=(e&&(e.setAttribute("aria-label",this.l10n.getConstant("occurrence")),e.setAttribute("aria-label",e.innerHTML)),this.quickDialog.element.querySelector("."+qn));t&&(t.setAttribute("aria-label",this.l10n.getConstant("series")),t.setAttribute("aria-label",t.innerHTML)),this.quickDialog.element.querySelector(".e-dlg-closeicon-btn")&&this.quickDialog.element.querySelector(".e-dlg-closeicon-btn").setAttribute("title",this.l10n.getConstant("close"))},o.prototype.renderButton=function(e,t,i,n,r){new H.Button({cssClass:e,disabled:i,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,iconCss:t}).appendTo(n),B.EventHandler.add(n,"click",r,this),B.removeClass([n],Dt)},o.prototype.quickDialogClass=function(e){var t=[kn,Rn,jn,Nn,Un,d],i=this.quickDialog.element.querySelector("."+Ln),n=this.quickDialog.element.querySelector("."+qn),r=this.quickDialog.element.querySelector("."+Fn);switch(B.removeClass([i,n],t),B.addClass([this.quickDialog.element.querySelector("."+Nn)],d),this.parent.eventSettings.editFollowingEvents&&(B.addClass([r],d),B.removeClass([this.quickDialog.element],Pn)),e){case"Recurrence":B.addClass([i],kn),B.addClass([n],Rn),this.parent.eventSettings.editFollowingEvents&&(B.removeClass([r],d),B.addClass([this.quickDialog.element],Pn),B.addClass([r],Hn));break;case"Delete":B.addClass([i],jn),B.addClass([n],Nn);break;case"Alert":B.addClass([i],[Ln,Un]),B.addClass([n],[qn,d])}},o.prototype.applyFormValidation=function(){var e=this.quickPopup.element.querySelector("."+Wn),t={};t[this.parent.eventSettings.fields.subject.name]=this.parent.eventSettings.fields.subject.validation,this.fieldValidator.renderFormValidator(e,t,this.quickPopup.element,this.parent.locale)},o.prototype.openRecurrenceAlert=function(){var e=this.quickDialog.element.querySelector("."+Ln),e=(e&&(e.innerHTML=this.l10n.getConstant("Delete"===this.parent.currentAction?"deleteEvent":"editEvent"),e.setAttribute("aria-label",e.innerHTML)),this.quickDialog.element.querySelector("."+Fn)),e=(e&&(e.innerHTML=this.l10n.getConstant("editFollowingEvent"),e.setAttribute("aria-label",e.innerHTML)),this.quickDialog.element.querySelector("."+qn));e&&(e.innerHTML=this.l10n.getConstant("Delete"===this.parent.currentAction?"deleteSeries":"editSeries"),e.setAttribute("aria-label",e.innerHTML)),this.quickDialog.content=this.l10n.getConstant("editContent"),this.quickDialog.header=this.l10n.getConstant("Delete"===this.parent.currentAction?"deleteTitle":"editTitle"),this.quickDialogClass("Recurrence"),this.showQuickDialog("RecurrenceAlert")},o.prototype.openRecurrenceValidationAlert=function(e){this.quickDialogClass("Alert");var t,i=this.quickDialog.element.querySelector("."+Ln),n=(i.innerHTML=this.l10n.getConstant("ok"),i.setAttribute("aria-label",i.innerHTML),this.quickDialog.element.querySelector("."+qn));switch(n.innerHTML=this.l10n.getConstant("cancel"),n.setAttribute("aria-label",n.innerHTML),this.quickDialog.header=this.l10n.getConstant("alert"),e){case"wrongPattern":B.addClass([n],d),this.quickDialog.content=this.l10n.getConstant("wrongPattern");break;case"createError":B.addClass([n],d),this.quickDialog.content=this.l10n.getConstant("createError");break;case"sameDayAlert":B.addClass([n],d),this.quickDialog.content=this.l10n.getConstant("sameDayAlert");break;case"seriesChangeAlert":t=this.quickDialog.element.querySelector("."+Nn),B.removeClass([n,t],d),this.quickDialog.content=this.l10n.getConstant("seriesChangeAlert"),i.innerHTML=this.l10n.getConstant("yes"),n.innerHTML=this.l10n.getConstant("no"),t.innerHTML=this.l10n.getConstant("cancel");break;case"occurrenceAlert":B.addClass([n],d),this.quickDialog.content=this.l10n.getConstant("occurenceAlert")}(!this.parent.enableRecurrenceValidation&&"wrongPattern"===e||this.parent.enableRecurrenceValidation)&&this.showQuickDialog("RecurrenceValidationAlert")},o.prototype.openDeleteAlert=function(){var e;this.parent.activeViewOptions.readonly||((e=this.quickDialog.element.querySelector("."+Ln))&&(e.innerHTML=this.l10n.getConstant("delete"),e.setAttribute("aria-label",e.innerHTML)),(e=this.quickDialog.element.querySelector("."+qn))&&(e.innerHTML=this.l10n.getConstant("cancel"),e.setAttribute("aria-label",e.innerHTML)),this.quickDialog.content=1<this.parent.activeEventData.event.length?this.l10n.getConstant("deleteMultipleContent"):this.l10n.getConstant("deleteContent"),this.quickDialog.header=1<this.parent.activeEventData.event.length?this.l10n.getConstant("deleteMultipleEvent"):this.l10n.getConstant("deleteEvent"),this.quickDialogClass("Delete"),this.showQuickDialog("DeleteAlert"))},o.prototype.openValidationError=function(e,t){this.quickDialog.header=this.l10n.getConstant("alert"),this.quickDialog.content=this.l10n.getConstant(e);var i=this.quickDialog.element.querySelector("."+Ln),n=(i&&(i.innerHTML=this.l10n.getConstant("ok"),i.setAttribute("aria-label",i.innerHTML)),this.quickDialog.element.querySelector("."+qn));n&&(n.innerHTML=this.l10n.getConstant("cancel"),i.setAttribute("aria-label",n.innerHTML)),this.quickDialogClass("Alert"),this.showQuickDialog("overlapAlert"===e?"OverlapAlert":"ValidationAlert",t)},o.prototype.showQuickDialog=function(e,t){var i=this,e=(this.quickDialog.dataBind(),{type:e,cancel:!1,element:this.quickDialog.element,data:B.extend({},t||this.parent.activeEventData.event,null,!0)});this.parent.activeViewOptions.allowOverlap||(e.overlapEvents=this.parent.overlapAppointments),this.parent.trigger(ae,e,function(e){e.cancel||i.quickDialog.show()})},o.prototype.createMoreEventList=function(e,r,a){var s=this,o=this.parent.eventFields,t=B.createElement("div",{className:An}),l=B.createElement("div",{className:In});if(0===e.length)l=B.createElement("div",{className:An,innerHTML:this.l10n.getConstant("emptyContainer")});else for(var p=this,i=0,n=e;i<n.length;i++)!function(t){var e=t[o.subject]||p.parent.eventSettings.fields.subject.default||p.parent.localeObj.getConstant("addTitle"),i=B.createElement("div",{className:V,attrs:{"data-id":""+t[o.id],"data-guid":t.Guid,role:"button",tabindex:"0","aria-disabled":p.parent.eventBase.getReadonlyAttribute(t),"aria-label":p.parent.getAnnouncementString(t)}}),n=(t[o.isReadonly]&&B.addClass([i],"e-read-only"),void 0),n=(B.isNullOrUndefined(p.parent.activeViewOptions.eventTemplate)?(i.appendChild(B.createElement("div",{className:Gn})),p.parent.sanitize(e,i.firstElementChild)):(e=p.parent.element.id+"_"+p.parent.activeViewOptions.eventTemplateName+"eventTemplate",n=p.parent.getAppointmentTemplate()(t,p.parent,"eventTemplate",e,!1,void 0,void 0,p.parent.root),B.append(n,i)),B.isNullOrUndefined(a)||i.setAttribute("data-group-index",a),B.isNullOrUndefined(t[o.recurrenceRule])||(e=t[o.id]===t[o.recurrenceID]?en:tn,i.appendChild(B.createElement("div",{className:Dt+" "+e}))),{data:B.extend({},t,null,!0),element:i,cancel:!1});p.parent.trigger(ie,n,function(e){e.cancel||(l.appendChild(i),e=s.parent.isAdaptive||"Year"===s.parent.currentView,s.parent.eventBase.wireAppointmentEvents(i,t,e),s.parent.eventBase.applyResourceColor(i,t,"backgroundColor",r))})}(n[i]);return t.appendChild(l),t},o.prototype.tapHoldEventPopup=function(e){var t,i,n=B.closest(e.target,"."+V),r=(this.parent.selectedElements=[],this.isMultipleEventSelect=!0,this.parent.eventBase.getSelectedEventElements(n),this.parent.activeEventData=this.parent.eventBase.getSelectedEvents(),n.getAttribute("data-guid")),r=this.parent.eventBase.getEventByGuid(r);B.isNullOrUndefined(r)||(t=r[this.parent.eventFields.subject]||this.l10n.getConstant("noTitle"),t='<div class="e-multiple-event-popup"><div class="'+gn+'"><button class="'+dr+'" title="'+this.l10n.getConstant("close")+'"></button><div class="'+Gn+'">'+t+'</div><button class="e-edit" title="'+this.l10n.getConstant("edit")+'"></button><button class="'+cr+'" title="'+this.l10n.getConstant("delete")+'"></button></div></div>',this.quickPopup.element.innerHTML=t,t=this.quickPopup.element.querySelector("."+dr),this.renderButton("e-flat e-round e-small",Dt+" "+ur,!1,t,this.closeClick),t=this.parent.activeViewOptions.readonly||r[this.parent.eventFields.isReadonly],r=!this.parent.eventSettings.allowEditing||t,t=!this.parent.eventSettings.allowDeleting||t,(i=this.quickPopup.element.querySelector("."+lr))&&this.renderButton("e-flat e-round e-small",Dt+" "+pr,r,i,this.editClick),(r=this.quickPopup.element.querySelector("."+cr))&&this.renderButton("e-flat e-round e-small",Dt+" "+hr,t,r,this.deleteClick),this.beforeQuickPopupOpen(n,this.parent.eventBase.getPageCoordinates(e)))},o.prototype.isCellBlocked=function(e){var t={};return t[this.parent.eventFields.startTime]=this.parent.activeCellsData.startTime,t[this.parent.eventFields.endTime]=this.parent.activeCellsData.endTime,t[this.parent.eventFields.isAllDay]=this.parent.activeCellsData.isAllDay,0<this.parent.activeViewOptions.group.resources.length&&(e=e.element instanceof Array?e.element[0]:e.element,e=parseInt(e.getAttribute("data-group-index"),10),this.parent.resourceBase.setResourceValues(t,isNaN(e)?null:e)),this.parent.eventBase.isBlockRange(t)},o.prototype.cellClick=function(e){var t,i,n=new Date(e.startTime.getTime());this.parent.showQuickInfo&&this.parent.eventSettings.allowAdding&&"MonthAgenda"!==this.parent.currentView&&!this.isCellBlocked(e)&&this.parent.isMinMaxDate(new Date(n.setHours(0,0,0,0)))?(n=B.isNullOrUndefined(e.event)?e.element:e.event.target,this.parent.isAdaptive?(this.quickPopupHide(),i=this.parent.element.querySelector("."+zi),B.isNullOrUndefined(i)&&(i=B.createElement("div",{className:zi,innerHTML:'<div class="e-title">+ '+this.l10n.getConstant("newEvent")+"</div>"})),(t=B.closest(n,"."+O+",."+w))&&t.appendChild(i)):(t=B.closest(n,"."+O+",."+w+",."+It),B.isNullOrUndefined(t)||n.classList.contains(hn)||(this.quickPopup.relateTo===t&&this.quickPopup.element.classList.contains(xt)?(i=this.quickPopup.element.querySelector("."+Gn))&&i.focus():(this.quickPopup.element&&this.destroyPopupButtons("quickPopup"),(n={})[this.parent.eventFields.startTime]=this.parent.activeCellsData.startTime,n[this.parent.eventFields.endTime]=this.parent.activeCellsData.endTime,n[this.parent.eventFields.isAllDay]=this.parent.activeCellsData.isAllDay,(i=B.createElement("div",{className:dn})).appendChild(this.getPopupHeader("Cell",n)),i.appendChild(this.getPopupContent("Cell",e,n)),i.appendChild(this.getPopupFooter("Cell",n)),this.quickPopup.element.setAttribute("aria-label",this.l10n.getConstant("newEvent")),(n=i.querySelector("."+Gn))&&P.Input.createInput({element:n,properties:{placeholder:this.l10n.getConstant("addTitle")}}),B.isNullOrUndefined(this.parent.eventSettings.fields.subject.default)||(n.value=this.parent.eventSettings.fields.subject.default),(n=i.querySelector("."+dr))&&this.renderButton("e-flat e-round e-small",Dt+" "+ur,!1,n,this.popupClose),(n=i.querySelector("."+yn))&&this.renderButton("e-flat","",!1,n,this.detailsClick),(n=i.querySelector("."+Tn))&&this.renderButton("e-flat e-primary","",this.parent.activeViewOptions.readonly,n,this.saveClick),this.morePopup&&this.morePopup.hide(),this.quickPopup.content=i,this.quickPopup.relateTo=t,this.quickPopup.dataBind(),this.beforeQuickPopupOpen(t,this.parent.eventBase.getPageCoordinates(e.event)))))):this.quickPopupHide()},o.prototype.isSameEventClick=function(e){return!(this.quickPopup.relateTo!==B.closest(e.element,"."+V)||!this.quickPopup.element.classList.contains(xt)||((e=this.quickPopup.element.querySelector("."+lr))&&e.focus(),this.parent.isAdaptive||(e=this.quickPopup.element.querySelector("."+wn))&&e.focus(),0))},o.prototype.isQuickTemplate=function(e){return"Both"===this.parent.quickInfoTemplates.templateType||this.parent.quickInfoTemplates.templateType===e},o.prototype.eventClick=function(e){var t,i,n,r,a;this.parent.eventTooltip&&this.parent.eventTooltip.close(),this.parent.showQuickInfo&&(this.parent.isAdaptive&&this.isMultipleEventSelect?this.updateTapHoldEventPopup(B.closest(e.element,"."+V)):(n=this.isSameEventClick(e),this.parent.selectedElements=[],n||(this.quickPopup.element&&this.destroyPopupButtons("quickPopup"),n=e.event,(t=B.createElement("div",{className:un})).appendChild(this.getPopupHeader("Event",n)),t.appendChild(this.getPopupContent("Event",e,n)),t.appendChild(this.getPopupFooter("Event",n)),this.quickPopup.element.setAttribute("aria-label",this.l10n.getConstant("editEvent")),n=this.parent.activeViewOptions.readonly||n[this.parent.eventFields.isReadonly],i=!this.parent.eventSettings.allowEditing||n,n=!this.parent.eventSettings.allowDeleting||n,r="e-flat e-round e-small",(a=t.querySelector("."+lr))&&this.renderButton(r,Dt+" "+pr,i,a,this.editClick),(a=t.querySelector("."+cr))&&this.renderButton(r,Dt+" "+hr,n,a,this.deleteClick),(a=t.querySelector("."+dr))&&this.renderButton(r,Dt+" "+ur,!1,a,this.popupClose),(r=t.querySelector("."+wn))&&this.renderButton("e-flat e-primary","",i,r,this.editClick),(a=t.querySelector("."+Dn))&&this.renderButton("e-flat","",n,a,this.deleteClick),this.morePopup&&!B.closest(e.element,"."+In)&&this.morePopup.hide(),this.quickPopup.content=t,this.quickPopup.relateTo=this.parent.isAdaptive?document.body:B.closest(e.element,"."+V),this.quickPopup.dataBind(),this.beforeQuickPopupOpen(e.element,this.parent.eventBase.getPageCoordinates(e.originalEvent)))))},o.prototype.getPopupHeader=function(e,t){var i=B.createElement("div",{className:gn});if(this.isQuickTemplate(e)&&this.parent.quickInfoTemplates.header){var n=B.extend({},t,{elementType:e.toLowerCase()},!0),r=this.parent.element.id,n=[].slice.call(this.parent.getQuickInfoTemplatesHeader()(n,this.parent,"header",r+"_headerTemplate",!1));B.append([].slice.call(n),i)}else{var a=void 0,s=void 0;switch(e){case"Cell":a='<div class="'+mn+'"><button class="'+dr+'" title="'+this.l10n.getConstant("close")+'"></button></div>';break;case"Event":s=this.getFormattedString(t),a='<div class="'+mn+'"><button class="e-edit '+Dt+'" title="'+this.l10n.getConstant("edit")+'"></button><button class="'+cr+" "+Dt+'" title="'+this.l10n.getConstant("delete")+'"></button><button class="'+dr+'" title="'+this.l10n.getConstant("close")+'"></button></div><div class="'+bi+'"><div class="'+Gn+" "+bn+'" title="'+(s.eventSubject&&s.eventSubject.replaceAll('"',"'"))+'"></div></div >'}r=B.createElement("div",{innerHTML:a});"Event"===e&&(n=r.querySelector("."+Gn),this.parent.sanitize(s.eventSubject,n)),B.append([].slice.call(r.childNodes),i)}return i},o.prototype.getPopupContent=function(e,t,i){var n=B.createElement("div",{className:"e-popup-content"});if(this.isQuickTemplate(e)&&this.parent.quickInfoTemplates.content){var r=B.extend({},i,{elementType:e.toLowerCase()},!0),a=this.parent.element.id,r=[].slice.call(this.parent.getQuickInfoTemplatesContent()(r,this.parent,"content",a+"_contentTemplate",!1));B.append([].slice.call(r),n)}else{var s,o=void 0,a=this.getResourceText(t,e.toLowerCase());switch(e){case"Cell":s=this.getFormattedString(i),o='<table class="e-popup-table"><tbody><tr><td><form class="'+Wn+'">\n <input class="'+Gn+' e-field" type="text" name="'+this.parent.eventFields.subject+'" /></form></td></tr><tr><td><div class="'+Ni+'"><div class="'+Vr+" "+Dt+'"></div><div class="'+fn+" "+bn+'">'+s.details+"</div></div>"+(0<this.parent.activeViewOptions.group.resources.length?'<div class="'+Or+'"><div class="'+Er+" "+Dt+' "></div><div class="'+xr+" "+bn+'"></div></div>':"")+"</td></tr></tbody></table>";break;case"Event":s=this.getFormattedString(i),o='<div class="'+Ni+'"><div class="'+Vr+" "+Dt+'"></div><div class="e-date-time-wrapper '+bn+'"><div class="'+fn+" "+bn+'">'+s.details+"</div>",i[this.parent.eventFields.recurrenceRule]&&(o+='<div class="e-recurrence-summary '+bn+'">'+this.getRecurrenceSummary(i)+"</div>"),o+="</div></div>",i[this.parent.eventFields.location]&&(o+='<div class="'+Xn+'"><div class="e-location-icon '+Dt+'"></div><div class="'+Qn+" "+bn+'"></div></div>'),(i[this.parent.eventFields.startTimezone]||i[this.parent.eventFields.endTimezone])&&(o+='<div class="'+Yn+'"><div class="e-time-zone-icon '+Dt+'"></div><div class="e-time-zone-details '+bn+'">'+this.getTimezone(i)+"</div></div>"),i[this.parent.eventFields.description]&&(o+='<div class="'+Jn+'"><div class="e-description-icon '+Dt+'"></div><div class="'+$n+" "+bn+'"></div></div>'),0<this.parent.resourceCollection.length&&(o+='<div class="'+Or+'"><div class="'+Er+" "+Dt+'"></div><div class="'+xr+" "+bn+'"></div></div>')}var r=B.createElement("div",{innerHTML:o}),t=r.querySelector("form");t&&(t.onsubmit=function(){return!1}),i[this.parent.eventFields.location]&&(e=r.querySelector("."+Qn),B.isNullOrUndefined(e)||this.parent.sanitize(i[this.parent.eventFields.location],e)),i[this.parent.eventFields.description]&&(t=r.querySelector("."+$n),B.isNullOrUndefined(t)||this.parent.sanitize(i[this.parent.eventFields.description],t)),a&&(e=r.querySelector("."+xr),B.isNullOrUndefined(e)||this.parent.sanitize(a,e)),B.append([].slice.call(r.childNodes),n)}return n},o.prototype.getPopupFooter=function(e,t){var i=B.createElement("div",{className:vn});if(this.isQuickTemplate(e)&&this.parent.quickInfoTemplates.footer){var t=B.extend({},t,{elementType:e.toLowerCase()},!0),n=this.parent.element.id,t=[].slice.call(this.parent.getQuickInfoTemplatesFooter()(t,this.parent,"footer",n+"_footerTemplate",!1));B.append([].slice.call(t),i)}else{var r=void 0;switch(e){case"Cell":r='<button class="'+yn+" "+bn+'" title="'+this.l10n.getConstant("moreDetails")+'">'+this.l10n.getConstant("moreDetails")+'</button><button class="'+Tn+" "+bn+'" title="'+this.l10n.getConstant("save")+'">'+this.l10n.getConstant("save")+"</button>";break;case"Event":r=this.parent.isAdaptive?"":'<button class="'+wn+" "+bn+'" title="'+this.l10n.getConstant("edit")+'">'+this.l10n.getConstant("edit")+'</button><button class="'+Dn+" "+bn+'" title="'+this.l10n.getConstant("delete")+'">'+this.l10n.getConstant("delete")+"</button>"}n=B.createElement("div",{innerHTML:r});B.append([].slice.call(n.childNodes),i)}return i},o.prototype.getResourceText=function(e,t){if(0===this.parent.resourceCollection.length)return null;var r="";if(0===this.parent.activeViewOptions.group.resources.length){var a=this.parent.resourceBase.resourceCollection.slice(-1)[0],s=a.dataSource;if("event"===t)for(var o=e.event,i=0,n=s;i<n.length;i++)!function(e){var t,i,n=o[a.field];n instanceof Array?-1<n.indexOf(e[a.idField])&&(t=n[n.indexOf(e[a.idField])],i=s.filter(function(e){return e[a.idField]===t})[0],r+=""===r?i[a.textField]:", "+i[a.textField]):e[a.idField]===n&&(r=e[a.textField].toString())}(n[i]);else r=s[0][a.textField].toString()}else if("event"===t){for(var l,o=e.event,s=void 0,p=this.parent.resourceBase.resourceCollection.length-1;0<=p;p--)if(s=o[this.parent.resourceBase.resourceCollection[parseInt(p.toString(),10)].field],!B.isNullOrUndefined(s)){l=this.parent.resourceBase.resourceCollection[parseInt(p.toString(),10)];break}Array.isArray(s)||(s=[s]);var c=[],h=l.dataSource;s.forEach(function(e){var t,e=st(h,l.idField,e);(t=-1<e?h[parseInt(e.toString(),10)][l.textField]:t)&&c.push(t)}),r=c.join(", ")}else t=e,e=B.isNullOrUndefined(t.groupIndex)?0:t.groupIndex,t=this.parent.resourceBase.lastResourceLevel[parseInt(e.toString(),10)],r=t.resourceData[t.resource.textField];return r},o.prototype.getFormattedString=function(e){var t=this.parent.eventFields,i=e[t.subject]||this.l10n.getConstant("noTitle"),n=e[t.startTime],r=e[t.endTime],a=this.getDateFormat(n,"long"),s=e[t.isAllDay]&&0===r.getHours()&&0===r.getMinutes()?this.getDateFormat(Y(new Date(r.getTime()),-1),"long"):this.getDateFormat(r,"long"),o=this.parent.getTimeString(n),l=this.parent.getTimeString(r),p="",c=r.getDate()!==n.getDate()&&(r.getTime()-n.getTime())/36e5<24?1:0;return e[t.isAllDay]?(p=a+" ("+this.l10n.getConstant("allDay")+")",1<(ct(r)-ct(n))/W&&(p+=" - "+s+" ("+this.l10n.getConstant("allDay")+")")):p=1<=(ct(r)-ct(n))/W||0<c?a+" ("+o+") - "+s+" ("+l+")":a+" ("+o+" - "+l+")",{eventSubject:i,details:p}},o.prototype.moreEventClick=function(t,e,i){var n,r=this,a=(this.quickPopupHide(!0),this.morePopup.element.querySelector("."+An)),a=(a&&B.remove(a),t.date.getTime().toString()),s=B.closest(t.element,"."+hn+",."+O),o=this.parent.globalize.formatDate(t.date,{format:"E",calendar:this.parent.getCalendarMode()}),o=(this.morePopup.element.querySelector("."+En).innerHTML=y(o,"single"),this.morePopup.element.querySelector("."+xn)),a=(o.innerHTML=this.getDateFormat(t.date,"d"),o.setAttribute("data-date",a),o.setAttribute("data-end-date",e.getTime().toString()),B.isNullOrUndefined(i)||(o.setAttribute("data-group-index",i),n=this.parent.resourceBase.lastResourceLevel[parseInt(i,10)].groupOrder),this.createMoreEventList(t.event,n,i));if(this.morePopup.element.querySelector("."+Cn).appendChild(a),B.removeClass(this.morePopup.element.querySelector("."+On).childNodes,Rt),z(t.date).getTime()===z(this.parent.getCurrentTime()).getTime()&&B.addClass(this.morePopup.element.querySelector("."+On).childNodes,Rt),!this.parent.isAdaptive)if(-1!==this.parent.currentView.indexOf("Timeline")){var e=s.getAttribute("data-group-index"),o=new Date(parseInt(s.getAttribute("data-start-date"),10)),l=(o.setHours(o.getHours(),o.getMinutes(),0),o.getTime().toString());if(B.isNullOrUndefined(e))this.morePopup.relateTo=this.parent.element.querySelector("."+A+' tbody tr td[data-date="'+l+'"]');else if(this.morePopup.relateTo=this.parent.element.querySelector("."+A+' tbody tr td[data-group-index="'+e+'"][data-date="'+l+'"]'),B.isNullOrUndefined(this.morePopup.relateTo))for(var p=[].slice.call(this.parent.element.querySelectorAll("."+A+' tbody tr td[data-group-index="'+e+'"]')),c=0;c<p.length;c++)p[parseInt(c.toString(),10)].getAttribute("data-date")<l&&(this.morePopup.relateTo=p[parseInt(c.toString(),10)])}else this.morePopup.relateTo=B.closest(s,"."+O);this.parent.renderTemplates(function(){var e={type:"EventContainer",cancel:!1,element:r.morePopup.element,data:t};r.parent.trigger(ae,e,function(e){e.cancel||r.morePopup.show()})})},o.prototype.saveClick=function(e){this.applyFormValidation(),this.dialogEvent=e,this.isCrudAction=!0,this.quickPopupHide()},o.prototype.detailsClick=function(e){var t=this.quickPopup.element.querySelector("."+Gn);t&&""!==t.value&&B.extend(this.parent.activeCellsData,{subject:t.value}),this.dialogEvent=e,this.isCrudAction=!1,this.fieldValidator.destroyToolTip(),this.quickPopupHide(),this.parent.eventWindow.openEditor(this.parent.activeCellsData,"Add")},o.prototype.editClick=function(e){this.dialogEvent=e,this.quickPopupHide(!0);e=this.parent.activeEventData.event;this.parent.currentAction="EditSeries",B.isNullOrUndefined(e[this.parent.eventFields.recurrenceRule])?this.parent.eventWindow.openEditor(e,this.parent.currentAction):(this.parent.currentAction="EditOccurrence",this.openRecurrenceAlert())},o.prototype.deleteClick=function(e){this.dialogEvent=e,this.quickPopupHide(!0),this.parent.currentAction="Delete",this.parent.activeEventData.event[this.parent.eventFields.recurrenceRule]?this.openRecurrenceAlert():this.openDeleteAlert()},o.prototype.updateMoreEventContent=function(){var e,t,i,n,r;this.morePopup.element.classList.contains("e-popup-close")||((e=this.morePopup.element.querySelector("."+An))&&B.remove(e),e=this.morePopup.element.querySelector("."+xn),n=new Date(parseInt(e.getAttribute("data-date"),10)),r=new Date(parseInt(e.getAttribute("data-end-date"),10)),e=e.getAttribute("data-group-index"),B.isNullOrUndefined(e)||(i=(t=this.parent.resourceBase.lastResourceLevel[parseInt(e,10)]).groupOrder),n=this.parent.eventBase.filterEvents(n,r,this.parent.eventsProcessed,t),r=this.createMoreEventList(n,i,e),this.morePopup.element.querySelector("."+Cn).appendChild(r))},o.prototype.closeClick=function(e){this.dialogEvent=e,"Year"===this.parent.currentView&&this.parent.activeCellsData&&this.parent.activeCellsData.element&&this.parent.selectCell(this.parent.activeCellsData.element),this.quickPopupHide(),this.morePopup.hide()},o.prototype.dialogButtonClick=function(e){this.dialogEvent=e,this.quickDialog.hide();var t=e.target,i=this.quickDialog.element.querySelector("."+qn),n=this.parent.activeEventData.event;if(t.classList.contains(kn))switch(this.parent.currentAction="Delete"===this.parent.currentAction?"DeleteOccurrence":"EditOccurrence",this.parent.currentAction){case"EditOccurrence":this.parent.eventWindow.openEditor(n,this.parent.currentAction);break;case"DeleteOccurrence":this.parent.crudModule.deleteEvent(n,this.parent.currentAction)}else if(t.classList.contains(Hn))switch(this.parent.currentAction="Delete"===this.parent.currentAction?"DeleteFollowingEvents":"EditFollowingEvents",this.parent.currentAction){case"EditFollowingEvents":this.parent.eventWindow.openEditor(n,this.parent.currentAction);break;case"DeleteFollowingEvents":this.parent.crudModule.deleteEvent(n,this.parent.currentAction)}else if(t.classList.contains(Rn))switch(this.parent.currentAction="Delete"===this.parent.currentAction?"DeleteSeries":"EditSeries",this.parent.currentAction){case"EditSeries":this.parent.eventWindow.openEditor(this.parent.eventBase.getParentEvent(n,!0),this.parent.currentAction);break;case"DeleteSeries":this.parent.crudModule.deleteEvent(n,this.parent.currentAction)}else t.classList.contains(jn)?this.parent.crudModule.deleteEvent(n,this.parent.currentAction):!i.classList.contains(d)&&(t.classList.contains(Ln)||t.classList.contains(qn)&&!i.classList.contains(Nn))&&(this.parent.uiStateValues.isIgnoreOccurrence=t.classList.contains(qn),this.parent.eventWindow.eventSave(e,this.l10n.getConstant("ok")))},o.prototype.updateTapHoldEventPopup=function(e){var t,e=this.parent.eventBase.getSelectedEventElements(e);this.parent.activeEventData=this.parent.eventBase.getSelectedEvents(),0<e.length?(t=this.parent.eventBase.getEventByGuid(e[0].getAttribute("data-guid")),t=1===e.length?t[this.parent.eventFields.subject]||this.l10n.getConstant("noTitle"):"("+e.length+") "+this.l10n.getConstant("selectedItems"),this.quickPopup.element.querySelector("."+Gn).innerHTML=t,1<e.length?B.addClass([this.quickPopup.element.querySelector("."+pr)],fr):B.removeClass([this.quickPopup.element.querySelector("."+pr)],fr)):(this.parent.selectedElements=[],this.quickPopupHide())},o.prototype.getTimezone=function(e){var t="";return(t+=e[this.parent.eventFields.startTimezone]||"")+(t?" - ":"")+(e[this.parent.eventFields.endTimezone]||"")},o.prototype.getRecurrenceSummary=function(e){var t=this.parent.eventWindow.getRecurrenceEditorInstance();return t?(t=t.getRuleSummary(e[this.parent.eventFields.recurrenceRule])).charAt(0).toUpperCase()+t.slice(1):""},o.prototype.getDateFormat=function(e,t){return y(this.parent.globalize.formatDate(e,{skeleton:t,calendar:this.parent.getCalendarMode()}),"single")},o.prototype.getDataFromTarget=function(e){var t;return e.classList.contains(V)?this.parent.activeEventData.event:(e={startTime:this.parent.activeCellsData.startTime,endTime:this.parent.activeCellsData.endTime,isAllDay:this.parent.activeCellsData.isAllDay,groupIndex:this.parent.activeCellsData.groupIndex},t=this.parent.activeCellsData,this.parent.eventWindow.convertToEventData(t,e),e)},o.prototype.beforeQuickDialogClose=function(e){var t=this,e={event:e.event||this.dialogEvent,type:B.isNullOrUndefined(this.parent.activeEventData.event)?"ValidationAlert":B.isNullOrUndefined(this.parent.activeEventData.event[this.parent.eventFields.recurrenceRule])?"DeleteAlert":"RecurrenceAlert",cancel:!1,data:this.parent.activeEventData.event,element:this.quickDialog.element};this.parent.trigger(se,e,function(e){e.cancel||t.parent.eventBase.focusElement(!0)})},o.prototype.beforeQuickPopupOpen=function(p,c){var h=this;this.parent.renderTemplates(function(){var o=h.quickPopup.element.querySelector("."+un),l=h.parent.isAdaptive?o?"ViewEventInfo":"EditEventInfo":"QuickInfo",e={type:l,cancel:!1,data:B.extend({},h.getDataFromTarget(p),null,!0),target:p,element:h.quickPopup.element};h.parent.trigger(ae,e,function(e){var t,i,n,r,a,s;e.cancel?(h.quickPopupHide(),h.destroyPopupButtons("quickPopup"),e.element.classList.contains(xt)&&h.quickPopupClose(),lt(h.quickPopup.element),h.isMultipleEventSelect=!1):(e=h.quickPopup.element.style.display,h.quickPopup.element.style.display="block",h.parent.isAdaptive?(h.quickPopup.element.removeAttribute("style"),h.quickPopup.element.style.display="block",h.quickPopup.element.style.height=B.formatUnit("EditEventInfo"==l?65:window.innerHeight)):(i=h.parent.virtualScrollModule&&h.parent.virtualScrollModule.isHorizontalScroll&&!B.isNullOrUndefined(B.closest(p,"."+C)),t=h.parent.element.querySelector("."+A+" table"),h.quickPopup.offsetX=i&&!h.parent.enableRtl?Fe(t)+10:10,h.quickPopup.offsetY=h.parent.virtualScrollModule&&!h.parent.virtualScrollModule.isHorizontalScroll?h.quickPopup.offsetY:0,h.quickPopup.collision={X:h.parent.enableRtl?"flip":"none",Y:"fit"},h.quickPopup.position={X:h.parent.enableRtl?"left":"right",Y:h.parent.enableRtl?"bottom":"top"},h.quickPopup.dataBind(),h.quickPopup.refreshPosition(null,!0),-1<(s=M.isCollide(h.quickPopup.element,h.parent.element)).indexOf(h.parent.enableRtl?"left":"right")&&(h.quickPopup.offsetX=-p.offsetWidth-10-h.quickPopup.element.offsetWidth,i&&!h.parent.enableRtl&&(h.quickPopup.offsetX=Fe(t)+h.quickPopup.offsetX),h.quickPopup.dataBind(),h.quickPopup.refreshPosition(null,!0),-1<M.isCollide(h.quickPopup.element,h.parent.element).indexOf("left"))&&(h.quickPopup.position={X:"center",Y:"center"},h.quickPopup.collision={X:"fit",Y:"fit"},h.quickPopup.offsetX=-h.quickPopup.element.offsetWidth/2,h.quickPopup.dataBind()),h.parent.virtualScrollModule&&!h.parent.virtualScrollModule.isHorizontalScroll&&(-1<s.indexOf("top")||-1<s.indexOf("bottom"))&&(i=qe(t),h.quickPopup.offsetY=i,h.quickPopup.dataBind(),h.quickPopup.refreshPosition(null,!0)),"center"===h.quickPopup.position.X&&"center"===h.quickPopup.position.Y&&!B.isNullOrUndefined(c)&&c.clientX&&c.clientY&&(s=c.clientX,t=c.clientY,i=p.getBoundingClientRect(),i=c.offsetY||Math.ceil(t-i.y),n=h.quickPopup.offsetY,r=M.isCollide(h.quickPopup.element,p),a=h.quickPopup.element.getBoundingClientRect(),s=document.elementFromPoint(s,t),-1<r.indexOf("top")||-1<r.indexOf("bottom")||B.closest(s,"."+Tr))&&(a.top<=t&&t<=a.top+a.height?(h.quickPopup.offsetY=n-a.height-10,h.quickPopup.dataBind(),-1<(r=M.isCollide(h.quickPopup.element,h.parent.element)).indexOf("top")&&(h.quickPopup.offsetY=n+i+10,h.quickPopup.dataBind())):-1<M.isCollide(h.quickPopup.element,h.parent.element).indexOf("bottom")&&(h.quickPopup.offsetY=n-i-Math.ceil(a.height)-10,h.quickPopup.dataBind()))),o&&h.applyEventColor(),h.quickPopup.element.style.display=e,h.quickPopup.dataBind(),h.quickPopup.show())})})},o.prototype.applyEventColor=function(){var e,t,i="",i="Agenda"===this.parent.currentView||"MonthAgenda"===this.parent.currentView?this.parent.enableRtl?"border-right-color":"border-left-color":"background-color",i=this.parent.activeEventData.element.style[i];""!==i&&(e=this.quickPopup.element.querySelector("."+gn),(t=this.quickPopup.element.querySelector("."+vn))&&t.offsetParent&&(e=this.quickPopup.element.querySelector("."+Gn))&&(i="rgba("+(e.style.borderLeftColor=i).match(/\d+/g).join()+",0.3)"),e)&&(e.style.backgroundColor=i)},o.prototype.quickPopupOpen=function(){var e;this.parent.isAdaptive?this.quickPopup.element.style.top="0px":this.quickPopup.element.querySelector("."+dn)?(e=this.quickPopup.element.querySelector("."+Gn))&&e.focus():((e=this.quickPopup.element.querySelector("."+wn))&&e.focus(),(e=this.quickPopup.element.querySelector("."+lr))&&e.focus())},o.prototype.quickPopupClose=function(){this.parent.eventBase.focusElement(),this.quickPopup.relateTo="."+O,this.fieldValidator.destroyToolTip(),this.quickPopup.element.querySelectorAll(".e-formvalidator").length&&this.fieldValidator.destroy(),this.destroyPopupButtons("quickPopup"),lt(this.quickPopup.element)},o.prototype.morePopupOpen=function(){this.parent.isAdaptive?(this.morePopup.element.style.top="0px",this.morePopup.element.style.left="0px",this.morePopup.element.style.height=B.formatUnit(window.innerHeight)):(this.morePopup.element.querySelector("."+xn).focus(),this.morePopup.refreshPosition())},o.prototype.morePopupClose=function(){var e=this.parent.element.querySelector("."+In);e&&B.remove(e)},o.prototype.popupClose=function(e){this.dialogEvent=e,this.isCrudAction=!1,this.quickPopupHide(!0)},o.prototype.quickPopupHide=function(t){var i=this;if(this.quickPopup.element.classList.contains(xt)){var n=this.quickPopup.element.querySelector("."+dn);if(n){var e=this.quickPopup.element.querySelector(".e-formvalidator");if(this.isCrudAction&&e&&!e.ej2_instances[0].validate())return;var e=this.parent.eventFields,r=this.parent.eventWindow.getObjectFromFormData(Tr);this.parent.eventWindow.setDefaultValueToObject(r),r[e.id]=this.parent.eventBase.getEventMaxID(),r[e.startTime]=this.parent.activeCellsData.startTime,r[e.endTime]=this.parent.activeCellsData.endTime,r[e.isAllDay]=this.parent.activeCellsData.isAllDay,this.parent.resourceBase&&this.parent.resourceBase.setResourceValues(r),e=r}else e=this.parent.activeEventData.event;r=this.quickPopup.element.querySelector("."+un),r={event:this.dialogEvent,type:this.parent.isAdaptive?r?"ViewEventInfo":"EditEventInfo":"QuickInfo",cancel:!1,data:e,element:this.quickPopup.element,target:(n?this.parent.activeCellsData:this.parent.activeEventData).element};this.parent.trigger(se,r,function(e){e.cancel||i.quickPopup.element.classList.contains("e-popup-open")&&(n&&i.isCrudAction&&(i.parent.currentAction="Add",i.parent.crudModule.addEvent(e.data)),t?(e=i.quickPopup.hideAnimation,i.quickPopup.hideAnimation=null,i.quickPopup.hide(),i.quickPopup.hideAnimation=e):i.quickPopup.hide(),i.isMultipleEventSelect=!1,i.isCrudAction=!1)})}},o.prototype.navigationClick=function(e){var t=B.closest(e.target,"."+Hi);B.isNullOrUndefined(t)||(t=this.parent.getDateFromElement(e.currentTarget),B.isNullOrUndefined(t))||(this.closeClick(e),this.parent.setProperties({selectedDate:t},!0),this.parent.changeView(this.parent.getNavigateView(),e))},o.prototype.documentClick=function(e){var e=e.event.target,t=!!B.closest(e,".e-dialog"),i="."+Tr+",."+It+",."+w+",."+O+",."+V,t=(t||(i+=",.e-popup"),this.parent.element.querySelector("."+Tr)),t=((t&&0<t.childElementCount&&!B.closest(e,i)||!B.closest(e,i))&&(this.quickPopupHide(),this.parent.removeNewEventElement()),this.parent.allowInline?this.parent.inlineModule.getInlineElement():null),i=(t&&t!==e&&this.parent.inlineModule.documentClick(t),B.closest(e,"."+V+",."+It)&&this.parent.removeNewEventElement(),B.closest(e,"."+Tr)||B.closest(e,"."+Mn));(e.classList.contains(wn)||e.classList.contains(lr)||e.classList.contains(pr)||!(i||B.closest(e,"."+Sn)||!e.classList||e.classList.contains(hn)||B.closest(e,"."+Sn+"."+xt)||B.closest(e,"."+O)))&&this.morePopup.hide()},o.prototype.onClosePopup=function(e){B.isNullOrUndefined(e)||(this.dialogEvent=e),this.quickPopupHide(),(B.isNullOrUndefined(e)||!B.isNullOrUndefined(e)&&"escape"!==e.action||this.parent.inlineModule&&this.parent.element.querySelector("."+jr))&&this.parent.eventBase.focusElement()},o.prototype.addEventListener=function(){this.parent.on(q,this.cellClick,this),this.parent.on(ee,this.eventClick,this),this.parent.on(Re,this.documentClick,this),this.parent.on(Ee,this.updateMoreEventContent,this)},o.prototype.removeEventListener=function(){this.parent.off(q,this.cellClick),this.parent.off(ee,this.eventClick),this.parent.off(Re,this.documentClick),this.parent.off(Ee,this.updateMoreEventContent)},o.prototype.destroyPopupButtons=function(e){for(var t="quickPopup"===e?this.quickPopup:this.morePopup,i=0,n=[].slice.call(t.element.querySelectorAll(".e-control.e-btn"));i<n.length;i++){var r=n[i],r=r.ej2_instances?r.ej2_instances[0]:null;r&&r.destroy()}"quickPopup"===e&&((e=t.element.querySelector("input."+Gn))&&e.remove(),(t=this.quickPopup.element.querySelector("form."+Wn))&&(lt(t),t.remove()),this.parent.resetTemplates(["content","header","footer"]))},o.prototype.refreshQuickDialog=function(){this.destroyQuickDialog(),this.renderQuickDialog()},o.prototype.refreshQuickPopup=function(){this.destroyQuickPopup(),this.renderQuickPopup()},o.prototype.refreshMorePopup=function(){this.destroyMorePopup(),this.renderMorePopup()},o.prototype.destroyQuickDialog=function(){this.quickDialog.element&&(this.quickDialog.destroy(),B.remove(this.quickDialog.element),this.quickDialog=null)},o.prototype.destroyQuickPopup=function(){this.quickPopup.element&&(this.destroyPopupButtons("quickPopup"),this.quickPopup.destroy(),B.remove(this.quickPopup.element),this.quickPopup=null)},o.prototype.destroyMorePopup=function(){this.morePopup.element&&(this.destroyPopupButtons("morePopup"),this.morePopup.destroy(),B.remove(this.morePopup.element),this.morePopup=null)},o.prototype.destroy=function(){this.quickPopup.element.querySelectorAll(".e-formvalidator").length&&this.fieldValidator.destroy(),this.removeEventListener(),this.destroyQuickPopup(),this.destroyMorePopup(),this.destroyQuickDialog(),this.dialogEvent=null,this.parent=null,this.l10n=null,this.isCrudAction=null,this.fieldValidator=null,this.isMultipleEventSelect=null};var as=o;function o(e){this.isMultipleEventSelect=!1,this.isCrudAction=!1,this.parent=e,this.l10n=this.parent.localeObj,this.fieldValidator=new ns,this.render(),this.addEventListener()}os.prototype.getTargets=function(){var e=[];return this.parent.activeViewOptions.group.headerTooltipTemplate&&e.push("."+Kt),this.parent.eventSettings.enableTooltip&&e.push("."+V),e.join(",")},os.prototype.onBeforeRender=function(e){var t=this;if(this.parent.uiStateValues.isSwipeScroll)e.cancel=!0;else if(B.isNullOrUndefined(e.target.getAttribute("data-tooltip-id"))){if(e.target.classList.contains(Kt)&&0<this.parent.activeViewOptions.group.resources.length)return e.target.closest("."+qt)?void(e.cancel=!0):(v=void 0,f={resource:(v=this.parent.activeView.isTimelineView()?(f=parseInt(e.target.getAttribute("data-group-index"),10),this.parent.resourceBase.lastResourceLevel[parseInt(f.toString(),10)]):(f=e.target.parentNode.sectionRowIndex,m=e.target.cellIndex,this.parent.activeView.getColumnLevels()[parseInt(f.toString(),10)][parseInt(m.toString(),10)])).resource,resourceData:v.resourceData},m=B.createElement("div"),v=this.parent.element.id+"_headerTooltipTemplate",f=[].slice.call(this.parent.getHeaderTooltipTemplate()(f,this.parent,"headerTooltipTemplate",v,!1)),B.append(f,m),this.setContent(m),void this.parent.renderTemplates());var i,n,r,a,s,o,l,p,c,h,d,u,g,m,v,f,e=this.parent.eventBase.getEventByGuid(e.target.getAttribute("data-guid"));B.isNullOrUndefined(e)||(B.isNullOrUndefined(this.parent.eventSettings.tooltipTemplate)?(i=this.parent.globalize,n=this.parent.eventFields,r=new Date(""+e[n.startTime]),u=(u=new Date(""+e[n.endTime])).getTime()-r.getTime()!=0&&0===u.getHours()&&0===u.getMinutes()?new Date(u.setMilliseconds(-1e3)):u,a=z(new Date(""+r)),s=z(new Date(""+u)),o=e[n.subject]||this.parent.eventSettings.fields.subject.default||this.parent.localeObj.getConstant("addTitle"),l=B.isNullOrUndefined(e[n.location])?"":e[n.location],h=c=p="",p=i.formatDate(r,{type:"date",skeleton:"MMMd",calendar:this.parent.getCalendarMode()}),c=i.formatDate(r,{type:"date",skeleton:"medium",calendar:this.parent.getCalendarMode()}),h=i.formatDate(u,{type:"date",skeleton:"medium",calendar:this.parent.getCalendarMode()}),p=y(p,"single"),c=y(c,"single"),h=y(h,"single"),d=this.parent.getTimeString(r),u=this.parent.getTimeString(u),g='<div><div class="e-subject">'+o+'</div><div class="e-location">'+l+'</div><div class="e-details">'+(a.getTime()===s.getTime()?y(i.formatDate(r,{type:"date",skeleton:"long",calendar:this.parent.getCalendarMode()}),"single"):a.getFullYear()===s.getFullYear()?p+" - "+h:c+" - "+h)+'</div><div class="e-all-day">'+(e[n.isAllDay]?this.parent.localeObj.getConstant("allDay"):d+" - "+u)+"</div></div>",this.setContent(B.initializeCSPTemplate(function(){return g}))):(m=B.createElement("div"),v=this.parent.element.id+"_tooltipTemplate",f=[].slice.call(this.parent.getEventTooltipTemplate()(e,this.parent,"tooltipTemplate",v,!1)),B.append(f,m),this.setContent(m)),this.parent.renderTemplates(function(){var e;t.parent&&t.parent.isReact&&!B.isNullOrUndefined(t.parent.eventSettings.tooltipTemplate)&&(e=document.querySelector("."+mr))&&B.removeClass([e],mr)}))}},os.prototype.onTooltipOpen=function(t){t.element&&this.parent.isReact&&!B.isNullOrUndefined(this.parent.eventSettings.tooltipTemplate)&&B.addClass([t.element],mr);var e=this.parent.eventBase.getEventByGuid(t.target.getAttribute("data-guid"));B.isNullOrUndefined(e)||(e={cancel:!1,data:e,content:t.element,target:t.target},this.parent.trigger(Ce,e,function(e){e.cancel?t.cancel=!0:t.element=e.content}))},os.prototype.onTooltipClose=function(e){e.element&&(B.removeClass([e.element],xt),B.addClass([e.element],"e-popup-close")),this.parent.isReact&&this.parent.eventWindow.dialogObject&&this.parent.eventWindow.dialogObject.visible||this.parent.resetTemplates(["tooltipTemplate","headerTooltipTemplate"])},os.prototype.setContent=function(e){this.tooltipObj.setProperties({content:e,windowCollision:!0},!0)},os.prototype.close=function(){this.tooltipObj.close()},os.prototype.destroy=function(){this.tooltipObj.destroy(),B.addClass([this.parent.element],"e-control"),this.tooltipObj=null,this.parent=null};var ss=os;function os(e){this.parent=e,this.tooltipObj=new M.Tooltip({animation:{close:{effect:"FadeOut"}},content:"No title",position:"BottomRight",offsetY:10,mouseTrail:!this.parent.isAdaptive,showTipPointer:!1,cssClass:this.parent.cssClass+" e-schedule-event-tooltip",target:this.getTargets(),beforeRender:this.onBeforeRender.bind(this),beforeClose:this.onTooltipClose.bind(this),beforeOpen:this.onTooltipOpen.bind(this),enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer}),this.tooltipObj.appendTo(this.parent.element)}ls=function(e,t){return(ls=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var ls,ps,cs=function(e,t){function i(){this.constructor=e}ls(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},hs=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;0<=o;o--)(r=e[o])&&(s=(a<3?r(s):3<a?r(t,i,s):r(t,i))||s);return 3<a&&s&&Object.defineProperty(t,i,s),s},ds="e-input-wrapper",us="e-input-wrapper-side",gs="e-repeat-element",ms="e-repeat-interval",vs="e-interval",fs="e-days",ys="e-non-week",Ts="e-year-expander",ws="e-year-expander-element",Ds="e-month-expander",bs="e-month-expander-element",Ss="e-month-expander-checkbox-wrapper",Cs="e-form-left",Os="e-form-right",Es="e-month-day",xs="e-month-expander-wrapper",Vs="e-month-pos",As="e-month-week",Is="e-end-on",Ms="e-end-on-element",ks="e-end-on-date",Rs="e-until-date",Hs="e-end-on-count",Ps="e-recurrence-count",js="e-hide-recurrence-element",Ns="e-primary",Ls="e-active",qs="e-recurrence-table",Fs="e-repeat-content",Us="none",Bs="daily",Ws="weekly",zs="monthly",Ys="yearly",_s="never",Gs="until",Xs="count",Qs="text",Ks="value",Zs="MONTHLY",Js="=",$s=";",eo={none:"",daily:"days",weekly:"weeks",monthly:"months",yearly:"years"},to={sun:"SU",mon:"MO",tue:"TU",wed:"WE",thu:"TH",fri:"FR",sat:"SA"},io=[fs,ys,Is,vs,Ts,Ds],no=[ys],ro=[fs,Ts],ao=[fs],so=[fs,ys,Ts,Ds],oo=[ks,Hs],lo=[ks],po=[Hs],co=(ps=B.Component,cs(l,ps),l.prototype.startState=function(e,t,i){this.showFormElement(),this.updateForm(e),this.freshOnEndForm(),this.updateEndOnForm(t),this.selectMonthDay(i),this.updateUntilDate(i),this.onMonthDay.setProperties({checked:!0})},l.prototype.preRender=function(){this.localeObj=new B.L10n(this.getModuleName(),this.defaultLocale,this.locale),this.calendarUtil=Ia(this.calendarMode)},l.prototype.applyCustomClass=function(e){e&&B.addClass([this.element],e.split(" "))},l.prototype.initialize=function(){B.addClass([this.element],"e-"+this.getModuleName()),this.renderComponent(),"string"==typeof this.startDate&&this.setProperties({startDate:new Date(this.startDate)},!1),B.isNullOrUndefined(this.value)||""===this.value?(B.isNullOrUndefined(this.repeatType.value)||(this.startState(this.repeatType.value.toString().toUpperCase(),this.endTypes[0],this.startDate),this.updateForm(this.repeatType.value.toString())),0<this.selectedType&&this.setProperties({value:this.getRecurrenceRule()},!1)):this.setRecurrenceRule(this.value),this.applyCustomClass(this.cssClass)},l.prototype.triggerChangeEvent=function(){var e,t=this;this.renderStatus&&(e=this.getRecurrenceRule(),this.trigger("change",{value:e},function(e){return t.setProperties({value:e.value},!1)}))},l.prototype.resetDayButton=function(){[].slice.call(this.element.querySelectorAll(".e-days button")).forEach(function(e){return B.removeClass([e],[Ls,Ns])})},l.prototype.daySelection=function(e){this.resetDayButton();var t=[0,1,2,3,4,5,6],t=(this.rotateArray(t,this.firstDayOfWeek),this.element.querySelector('.e-days button[data-index="'+t.indexOf(e)+'"]'));t&&B.addClass([t],[Ls,Ns])},l.prototype.rtlClass=function(e){e?B.addClass([this.element],"e-rtl"):B.removeClass([this.element],"e-rtl")},l.prototype.updateUntilDate=function(e){e=new Date(e.getTime());e.setDate(e.getDate()+60),this.untilDateObj.setProperties({value:e})},l.prototype.selectMonthDay=function(e){var t=["sun","mon","tue","wed","thu","fri","sat"];this.monthDate.setProperties({value:this.calendarUtil.getDate(e)}),this.monthWeekDays.setProperties({value:to[t[e.getDay()]]}),this.monthValue.setProperties({value:""+this.calendarUtil.getMonth(e)}),this.monthWeekPos.setProperties({value:this.getDayPosition(e)}),this.daySelection(e.getDay())},l.prototype.updateForm=function(e){var t=this,i=(this.repeatType.setProperties({value:e}),this.element.querySelector("."+Is));switch(e===Bs?B.classList(i,[Cs],[Os]):B.classList(i,[Os],[Cs]),e){case Us:io.forEach(function(e){return B.addClass([t.element.querySelector("."+e)],js)});break;case Ws:no.forEach(function(e){return B.addClass([t.element.querySelector("."+e)],js)});break;case zs:ro.forEach(function(e){return B.addClass([t.element.querySelector("."+e)],js)});break;case Ys:ao.forEach(function(e){return B.addClass([t.element.querySelector("."+e)],js)});break;case Bs:so.forEach(function(e){return B.addClass([t.element.querySelector("."+e)],js)})}},l.prototype.updateEndOnForm=function(e){var t=this;switch(this.endType.setProperties({value:e}),e){case _s:oo.forEach(function(e){return B.addClass([t.element.querySelector("."+e)],js)});break;case Gs:po.forEach(function(e){return B.addClass([t.element.querySelector("."+e)],js)});break;case Xs:lo.forEach(function(e){return B.addClass([t.element.querySelector("."+e)],js)})}},l.prototype.freshOnEndForm=function(){var t=this;oo.forEach(function(e){e=t.element.querySelector("."+e);e&&B.removeClass([e],js)})},l.prototype.showFormElement=function(){var t=this;io.forEach(function(e){e=t.element.querySelector("."+e);e&&B.removeClass([e],js)})},l.prototype.renderDropdowns=function(){function e(e){return new j.DropDownList({dataSource:e,popupWidth:t.getPopupWidth(),enableRtl:t.enableRtl,fields:{text:Qs,value:Ks},index:1,change:function(e){i.onWeekDay.setProperties({checked:!0}),i.resetFormValues(),i.triggerChangeEvent()}})}var t=this,i=this;this.repeatType=new j.DropDownList({dataSource:this.getRepeatData(),floatLabelType:"Always",enableRtl:this.enableRtl,index:this.selectedType,fields:{text:Qs,value:Ks},placeholder:this.localeObj.getConstant("repeat"),htmlAttributes:{title:this.localeObj.getConstant("repeat")},change:function(e){i.setProperties({selectedType:t.frequencies.indexOf(e.value)},!1),i.element.querySelector("."+Fs).innerHTML=i.localeObj.getConstant(eo[e.value]),i.showFormElement(),i.updateForm(e.value),i.resetFormValues(),i.triggerChangeEvent()}}),this.repeatType.appendTo(this.element.querySelector("."+gs)),this.endType=new j.DropDownList({dataSource:this.getEndData(),popupWidth:this.getPopupWidth(),floatLabelType:"Always",placeholder:this.localeObj.getConstant("end"),enableRtl:this.enableRtl,index:1,fields:{text:Qs,value:Ks},change:function(e){i.freshOnEndForm(),i.updateEndOnForm(e.value),i.resetFormValues(),i.triggerChangeEvent()}}),this.endType.appendTo(this.element.querySelector("."+Ms));this.monthWeekPos=e(this.getMonthPosData()),this.monthWeekPos.appendTo(this.element.querySelector("."+Vs)),this.monthWeekDays=e(this.getDayData("wide")),this.monthWeekDays.appendTo(this.element.querySelector("."+As)),this.monthValue=new j.DropDownList({dataSource:this.getMonthData(),fields:{text:Qs,value:Ks},enableRtl:this.enableRtl,index:7,change:function(e){i.resetFormValues(),i.triggerChangeEvent()}}),this.monthValue.appendTo(this.element.querySelector("."+ws))},l.prototype.setDefaultValue=function(){for(var e=0,t=[].slice.call(this.element.querySelectorAll(".e-control .e-numerictextbox"));e<t.length;e++){var i=t[e].ej2_instances[0];i.element.classList.contains(ms)?(i.value=1,i.dataBind()):i.element.classList.contains(Ps)&&(i.value=10,i.dataBind())}},l.prototype.resetFormValues=function(){for(var e=0,t=[].slice.call(this.element.querySelectorAll('.e-control [type="text"]'));e<t.length;e++){var i,n=t[e],r=void 0;n.classList.contains("e-datepicker")?(r=n.ej2_instances[0]).value?(r.value=r.value,r.dataBind()):this.updateUntilDate(this.startDate):n.classList.contains("e-dropdownlist")?((r=n.ej2_instances[0]).index=r.index||0,r.dataBind()):n.classList.contains("e-numerictextbox")&&(i=void 0,i=(r=n.ej2_instances[0]).element.classList.contains(ms)?1:r.element.classList.contains(Ps)?10:this.startDate.getDate(),r.value=r.value||i,r.dataBind())}},l.prototype.getPopupWidth=function(){return B.Browser.isDevice?"100%":"auto"},l.prototype.renderDatePickers=function(){var t=this;this.untilDateObj=new R.DatePicker({firstDayOfWeek:this.firstDayOfWeek,enableRtl:this.enableRtl,locale:this.locale,min:this.minDate,max:this.maxDate,format:B.isNullOrUndefined(this.dateFormat)?this.getFormat("dateFormats"):this.dateFormat,change:function(e){e.value&&t.triggerChangeEvent()}}),this.untilDateObj.appendTo(this.element.querySelector("."+Rs))},l.prototype.getFormat=function(e){e="en"===this.locale||"en-US"===this.locale?B.getValue(e+".short",B.getDefaultDateObject(this.getCalendarMode())):B.getValue("main."+this.locale+".dates.calendars."+this.getCalendarMode()+"."+e+".short",B.cldrData);return e},l.prototype.dayButtonRender=function(){for(var i=this,e=[].slice.call(this.element.querySelectorAll(".e-days button")),n=this,t=0,r=e;t<r.length;t++){var a=r[t],s=new H.Button({isToggle:!0,enableRtl:this.enableRtl},a);this.dayButtons.push(s),B.EventHandler.add(a,"click",function(e){var t=[].slice.call(i.element.querySelectorAll(".e-days button."+Ns)),e=e.target;e.classList.contains(Ns)?1<t.length&&(B.removeClass([e],Ns),n.triggerChangeEvent()):(B.addClass([e],Ns),n.triggerChangeEvent())})}},l.prototype.radioButtonRender=function(){var e=this;this.onMonthDay=new H.RadioButton({label:this.localeObj.getConstant("onDay"),enableRtl:this.enableRtl,name:"monthType",value:"day",change:function(){e.resetFormValues(),e.triggerChangeEvent()}}),this.onMonthDay.appendTo(this.element.querySelector("."+bs)),this.monthButtons.push(this.onMonthDay),this.onWeekDay=new H.RadioButton({label:this.localeObj.getConstant("monthExpander"),cssClass:"e-month-type",name:"monthType",enableRtl:this.enableRtl,value:"daypos",change:function(){e.resetFormValues(),e.triggerChangeEvent()}}),this.onWeekDay.appendTo(this.element.querySelector("."+xs)),this.monthButtons.push(this.onWeekDay)},l.prototype.numericTextboxRender=function(){var e=this;this.recurrenceCount=new P.NumericTextBox({value:10,format:"#",enableRtl:this.enableRtl,min:1,max:999,change:function(){e.triggerChangeEvent()}}),this.recurrenceCount.appendTo(this.element.querySelector("."+Ps)),this.monthDate=new P.NumericTextBox({value:1,format:"#",enableRtl:this.enableRtl,min:1,max:31,change:function(){e.onMonthDay.setProperties({checked:!0}),e.triggerChangeEvent()}}),this.monthDate.appendTo(this.element.querySelector("."+Es)),this.repeatInterval=new P.NumericTextBox({value:1,format:"#",min:1,max:999,enableRtl:this.enableRtl,floatLabelType:"Always",placeholder:this.localeObj.getConstant("repeatEvery"),change:function(){e.triggerChangeEvent()}}),this.repeatInterval.appendTo(this.element.querySelector("."+ms))},l.prototype.renderComponent=function(){this.setTemplate(),this.renderDropdowns(),this.renderDatePickers(),this.dayButtonRender(),this.radioButtonRender(),this.numericTextboxRender()},l.prototype.rotateArray=function(e,t){for(var i,n=0;n<t;n++)i=e.shift(),e.push(i)},l.prototype.getEndData=function(){var t=this,i=[];return this.endTypes.forEach(function(e){i.push({text:t.localeObj.getConstant(e),value:e})}),i},l.prototype.getDayPosition=function(e){for(var t=new Date(e.getTime()),i=new Date(e.getTime()),n=e.getDay(),r=[],t=this.calendarUtil.getMonthStartDate(t),i=this.calendarUtil.getMonthEndDate(i);t<i;)t.getDay()===n&&r.push(t.getTime()),t.setDate(t.getDate()+1);return r.indexOf(e.getTime())===r.length-1?-1:r.indexOf(e.getTime())+1},l.prototype.getRepeatData=function(){var t=[],i=this;return this.frequencies.forEach(function(e){t.push({text:i.localeObj.getConstant(e===Us?_s:e),value:e})}),t},l.prototype.getMonthPosData=function(){var t={first:1,second:2,third:3,fourth:4,last:-1},i=this,n=[];return["first","second","third","fourth","last"].forEach(function(e){n.push({text:i.localeObj.getConstant(e),value:t[""+e]})}),n},l.prototype.getDayData=function(e){var t,i,n=["sun","mon","tue","wed","thu","fri","sat"],r=[];this.rotateArray(n,this.firstDayOfWeek),t="en"===this.locale||"en-US"===this.locale?B.getValue((i="days.stand-alone.")+e,B.getDefaultDateObject(this.getCalendarMode())):(i="main."+this.locale+".dates.calendars."+this.getCalendarMode()+".days.stand-alone."+e,B.getValue(i,B.cldrData));for(var a=0,s=n;a<s.length;a++){var o=s[a],l=B.getValue(o,t);r.push({text:"narrow"===e?l:y(l,"single"),value:to[""+o]})}return r},l.prototype.getMonthData=function(){var e,t,i=[];e="en"===this.locale||"en-US"===this.locale?B.getValue(t="months.stand-alone.wide",B.getDefaultDateObject(this.getCalendarMode())):(t="main."+this.locale+".dates.calendars."+this.getCalendarMode()+".months.stand-alone.wide",B.getValue(t,B.cldrData));for(var n=0,r=Object.keys(e);n<r.length;n++){var a=r[n];i.push({text:y(B.getValue(a,e),"single"),value:a})}return i},l.prototype.setTemplate=function(){var e=this.getDayData("narrow"),t=this.getDayData("wide");this.element.innerHTML='<div class="e-editor"><div class="'+ds+" "+Cs+'"><input type="text" tabindex="0" class="'+gs+'"label="'+gs.substr(2)+'" /></div><div class="'+ds+" "+vs+" "+Os+'"><table class="'+qs+' e-repeat-content-wrapper" role="none"><tr><td><input type="text" tabindex="0" id="'+this.element.id+"_"+ms+'" class="'+ms+'"title="'+this.localeObj.getConstant("repeatEvery")+'" /></td><td><span class="'+Fs+'"></span></td></tr></table></div><div class="'+us+" "+fs+" "+Cs+'"><div class=e-week-expander-label>'+this.localeObj.getConstant("on")+'</div><button type="button" class="e-round" data-index="0" title="'+t[0].text+'">'+e[0].text+'</button><button type="button" class="e-round" data-index="1" title="'+t[1].text+'">'+e[1].text+'</button><button type="button" class="e-round" data-index="2" title="'+t[2].text+'">'+e[2].text+'</button><button type="button" class="e-round" data-index="3" title="'+t[3].text+'">'+e[3].text+'</button><button type="button" class="e-round" data-index="4" title="'+t[4].text+'">'+e[4].text+'</button><button type="button" class="e-round" data-index="5" title="'+t[5].text+'">'+e[5].text+'</button><button type="button" class="e-round" data-index="6" title="'+t[6].text+'">'+e[6].text+'</button></div><div class="'+us+" "+ys+" "+Cs+'"><div class=e-month-expander-label>'+this.localeObj.getConstant("on")+'</div><div class="'+Ts+'"><input class="'+ws+'" type="text" tabindex="0" title="'+this.localeObj.getConstant("yearExpander")+'"/></div><div class="'+Ds+'"><table class="'+qs+' e-month-expand-wrapper" role="none"><tr><td><div class="'+ds+" "+Ss+'"><input class="'+bs+'"title="'+this.localeObj.getConstant("monthExpander")+'" type="radio"></div></td><td colspan="2"><div class="'+ds+' e-monthday-element"><input type="text" tabindex="0" id="'+this.element.id+"_"+Es+'" class="'+Es+'"title="'+this.localeObj.getConstant("on")+'" /></div></td></tr><tr><td><div class="'+ds+" "+Ss+' e-repeat-on-week-selector"><input class="'+xs+'"title="'+this.localeObj.getConstant("monthExpander")+'" type="radio"></div></td><td><div class="'+ds+' e-week-position" ><input type="text" tabindex="0" class="'+Vs+'"title="'+this.localeObj.getConstant("monthPosition")+'" /></div></td><td><div class="'+ds+' e-day-position"><input type="text" tabindex="0" class="'+As+'"title="'+this.localeObj.getConstant("monthWeek")+'" /></div></td></tr></table></div></div><div class="'+us+" "+Is+" "+Os+'"><div class="'+ds+' e-end-on-left"><input type="text" tabindex="0" class="'+Ms+'"title="'+this.localeObj.getConstant("end")+'" /></div><div class="'+ds+" "+ks+'" ><input type="text" tabindex="0" class="'+Rs+'"title="'+this.localeObj.getConstant(Gs)+'" /></div><div class="'+ds+" "+Hs+'"><input type="text" tabindex="0" id="'+this.element.id+"_"+Ps+'" class="'+Ps+'"title="'+this.localeObj.getConstant(Xs)+'" /></div></div></div></div>'},l.prototype.getSelectedDaysData=function(){var e="BYDAY=",t=[].slice.call(this.element.querySelectorAll(".e-days button."+Ns)),i=["SU","MO","TU","WE","TH","FR","SA"];this.rotateArray(i,this.firstDayOfWeek);for(var n=0;n<t.length;n++)e+=i[parseInt(t[parseInt(n.toString(),10)].getAttribute("data-index"),10)]+(n===t.length-1?"":",");return e+$s},l.prototype.getSelectedMonthData=function(){var e=this.onWeekDay.checked?"BYDAY="+this.monthWeekDays.value+$s+"BYSETPOS"+Js+this.monthWeekPos.value+$s:"BYMONTHDAY="+this.monthDate.value+$s;return e},l.prototype.getIntervalData=function(){return"INTERVAL="+this.repeatInterval.value+$s},l.prototype.getEndOnCount=function(){return"COUNT="+this.recurrenceCount.value+$s},l.prototype.getYearMonthRuleData=function(){return"BYMONTH="+this.monthValue.value+$s},l.prototype.updateWeekButton=function(e){var t=["SU","MO","TU","WE","TH","FR","SA"];this.rotateArray(t,this.firstDayOfWeek);for(var i=0,n=this.dayButtons;i<n.length;i++){var r=n[i],a=parseInt(r.element.getAttribute("data-index"),10);-1!==e.indexOf(t[parseInt(a.toString(),10)])?r.setProperties({isPrimary:!0}):r.setProperties({isPrimary:!1})}},l.prototype.updateMonthUI=function(){if(this.ruleObject.monthDay.length)this.monthDate.setProperties({value:this.ruleObject.monthDay[0]}),this.onMonthDay.setProperties({checked:!0});else{this.onWeekDay.setProperties({checked:!0}),this.monthWeekPos.setProperties({value:this.ruleObject.setPosition});for(var e=0,t=Object.keys(to);e<t.length;e++){var i=t[e];if(to[""+i]===this.ruleObject.day[0]){this.monthWeekDays.setProperties({value:this.ruleObject.day[0]});break}}}},l.prototype.updateUI=function(e,t){switch(this.repeatInterval.setProperties({value:this.ruleObject.interval}),t){case Gs:this.untilDateObj.setProperties({value:this.ruleObject.until});break;case Xs:this.recurrenceCount.setProperties({value:this.ruleObject.count})}switch(e){case Ws:this.updateWeekButton(this.ruleObject.day);break;case Ys:this.monthValue.setProperties({index:this.ruleObject.month[0]-1}),this.updateMonthUI();break;case zs:this.updateMonthUI()}},l.prototype.getUntilData=function(){return this.untilDateObj.value?"UNTIL="+Wa(this.untilDateObj.value)+$s:""},l.prototype.destroyComponents=function(){this.recurrenceCount.isDestroyed||(this.recurrenceCount.destroy(),this.recurrenceCount=null),this.monthDate.isDestroyed||(this.monthDate.destroy(),this.monthDate=null),this.repeatInterval.isDestroyed||(this.repeatInterval.destroy(),this.repeatInterval=null),this.untilDateObj.isDestroyed||(this.untilDateObj.destroy(),this.untilDateObj=null),this.repeatType.isDestroyed||(this.repeatType.destroy(),this.repeatType=null),this.endType.isDestroyed||(this.endType.destroy(),this.endType=null),this.monthWeekPos.isDestroyed||(this.monthWeekPos.destroy(),this.monthWeekPos=null),this.monthWeekDays.isDestroyed||(this.monthWeekDays.destroy(),this.monthWeekDays=null),this.monthValue.isDestroyed||(this.monthValue.destroy(),this.monthValue=null),this.onMonthDay.isDestroyed||(this.onMonthDay.destroy(),this.onMonthDay=null),this.onWeekDay.isDestroyed||(this.onWeekDay.destroy(),this.onWeekDay=null),this.dayButtons.forEach(function(e){e.isDestroyed||e.destroy()}),this.dayButtons=[],this.monthButtons.forEach(function(e){e.isDestroyed||e.destroy()}),this.monthButtons=[]},l.prototype.resetFields=function(){this.startState(Us,this.endTypes[0],this.startDate),this.setDefaultValue()},l.prototype.updateRuleUntilDate=function(e){var t;this.untilDateObj.value&&e&&(t=this.untilDateObj.value,t=new Date(t.getFullYear(),t.getMonth(),t.getDate(),e.getHours(),e.getMinutes(),e.getMilliseconds()),this.untilDateObj.setProperties({value:t}))},l.prototype.getCalendarMode=function(){return B.isNullOrUndefined(this.calendarMode)?"gregorian":this.calendarMode.toLowerCase()},l.prototype.getRuleSummary=function(e){return ra(e=void 0===e?this.getRecurrenceRule():e,this.localeObj,this.locale,this.calendarMode)},l.prototype.getRecurrenceDates=function(e,t,i,n,r){return r=B.isNullOrUndefined(r)?this.startDate:r,sa(e,t,i,this.firstDayOfWeek,n,r,this.calendarMode)},l.prototype.getRecurrenceRule=function(){var e="FREQ=";switch(this.repeatType.value){case Bs:e+="DAILY;";break;case Ws:e+="WEEKLY;"+this.getSelectedDaysData();break;case zs:e+=Zs+$s+this.getSelectedMonthData();break;case Ys:e+="YEARLY;"+this.getSelectedMonthData()+this.getYearMonthRuleData();break;case Us:return""}switch(e+=this.getIntervalData(),this.endType.value){case Gs:e+=this.getUntilData();break;case Xs:e+=this.getEndOnCount()}return e},l.prototype.setRecurrenceRule=function(e,t){if(void 0===t&&(t=this.startDate),e){this.renderStatus=!1,this.ruleObject=xa(e);var i=this.ruleObject.count?Xs:this.ruleObject.until?Gs:_s;switch(this.ruleObject.freq){case"DAILY":this.startState(Bs,i,t),this.updateUI(Bs,i);break;case"WEEKLY":this.startState(Ws,i,t),this.updateUI(Ws,i);break;case Zs:this.startState(zs,i,t),this.updateUI(zs,i);break;case"YEARLY":this.startState(Ys,i,t),this.updateUI(Ys,i)}this.renderStatus=!0,this.triggerChangeEvent()}else this.repeatType.setProperties({value:Us})},l.prototype.detachInputs=function(){for(var e=0,t=[].slice.call(this.element.querySelectorAll("input"));e<t.length;e++){var i=t[e];B.detach(i)}},l.prototype.destroy=function(){if(!this.isDestroyed){this.destroyComponents(),ps.prototype.destroy.call(this);var e=["e-"+this.getModuleName()];for(this.cssClass&&(e=e.concat(this.cssClass.split(" "))),B.removeClass([this.element],e),this.detachInputs();this.element.firstElementChild;)this.element.removeChild(this.element.firstElementChild)}},l.prototype.getModuleName=function(){return"recurrenceeditor"},l.prototype.getPersistData=function(){return this.addOnPersist([])},l.prototype.render=function(){this.initialize(),this.rtlClass(this.enableRtl),this.renderStatus=!0,this.renderComplete()},l.prototype.onPropertyChanged=function(e,t){for(var i=0,n=Object.keys(e);i<n.length;i++)switch(n[i]){case"startDate":this.selectMonthDay(e.startDate),this.updateUntilDate(e.startDate),this.endType.setProperties({index:0});break;case"enableRtl":this.rtlClass(e.enableRtl);break;case"cssClass":t.cssClass&&B.removeClass([this.element],t.cssClass.split(" ")),e.cssClass&&B.addClass([this.element],e.cssClass.split(" "));break;case"selectedType":this.repeatType.setProperties({index:this.selectedType});break;case"minDate":this.untilDateObj.setProperties({min:this.minDate});break;case"maxDate":this.untilDateObj.setProperties({max:this.maxDate});break;case"value":this.getRecurrenceRule()!==this.value&&this.setRecurrenceRule(this.value);break;case"calendarMode":this.calendarMode=e.calendarMode,this.calendarUtil=Ia(e.calendarMode);break;case"locale":case"frequencies":case"firstDayOfWeek":case"endTypes":this.refresh();break;case"dateFormat":this.untilDateObj.setProperties({format:e.dateFormat})}},hs([B.Property(["none","daily","weekly","monthly","yearly"])],l.prototype,"frequencies",void 0),hs([B.Property(["never","until","count"])],l.prototype,"endTypes",void 0),hs([B.Property(0)],l.prototype,"firstDayOfWeek",void 0),hs([B.Property(new Date)],l.prototype,"startDate",void 0),hs([B.Property()],l.prototype,"dateFormat",void 0),hs([B.Property("Gregorian")],l.prototype,"calendarMode",void 0),hs([B.Property()],l.prototype,"cssClass",void 0),hs([B.Property()],l.prototype,"value",void 0),hs([B.Property(new Date(1900,0,1))],l.prototype,"minDate",void 0),hs([B.Property(new Date(2099,11,31))],l.prototype,"maxDate",void 0),hs([B.Property(0)],l.prototype,"selectedType",void 0),hs([B.Event()],l.prototype,"change",void 0),hs([B.Event()],l.prototype,"created",void 0),hs([B.Event()],l.prototype,"destroyed",void 0),hs([B.NotifyPropertyChanges],l));function l(e,t){e=ps.call(this,e,t)||this;return e.defaultLocale={none:"None",daily:"Daily",weekly:"Weekly",monthly:"Monthly",month:"Month",yearly:"Yearly",never:"Never",until:"Until",count:"Count",first:"First",second:"Second",third:"Third",fourth:"Fourth",last:"Last",repeat:"Repeat",repeatEvery:"Repeat every",on:"Repeat On",end:"End",onDay:"Day",days:"Day(s)",weeks:"Week(s)",months:"Month(s)",years:"Year(s)",every:"every",summaryTimes:"time(s)",summaryOn:"on",summaryUntil:"until",summaryRepeat:"Repeats",summaryDay:"day(s)",summaryWeek:"week(s)",summaryMonth:"month(s)",summaryYear:"year(s)",monthWeek:"Month Week",monthPosition:"Month Position",monthExpander:"Month Expander",yearExpander:"Year Expander",repeatInterval:"Repeat Interval"},e.renderStatus=!1,e.dayButtons=[],e.monthButtons=[],e}var ho="e-field",uo="e-recurrence-container",go="e-hide",mo=(c.prototype.renderEventWindow=function(){this.element=B.createElement("div",{id:this.parent.element.id+"_dialog_wrapper"}),this.parent.element.appendChild(this.element);var e={animationSettings:{effect:"Zoom"},content:this.getEventWindowContent(),cssClass:Bn,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,height:this.parent.isAdaptive?"100%":"auto",minHeight:"300px",isModal:!0,showCloseIcon:!this.parent.isAdaptive,target:document.body,visible:!1,width:"500px",beforeOpen:this.onBeforeOpen.bind(this),beforeClose:this.onBeforeClose.bind(this)};this.parent.isAdaptive?(e.cssClass=Bn+" "+yt,this.parent.editorHeaderTemplate||(e.header='<div class="e-title-header"><div class="e-back-icon e-icons"></div><div class="e-title-text">'+this.l10n.getConstant("newEvent")+'</div><div class="e-save-icon e-icons"></div></div>')):(this.parent.editorFooterTemplate||this.renderDialogButtons(e),this.parent.editorHeaderTemplate||(e.header='<div class="e-title-text">'+this.l10n.getConstant("newEvent")+"</div>")),this.dialogObject=new M.Dialog(e,this.element),this.dialogObject.element.querySelector(".e-dlg-closeicon-btn")&&this.dialogObject.element.querySelector(".e-dlg-closeicon-btn").setAttribute("title",this.l10n.getConstant("close")),this.addEventHandlers(),B.addClass([this.element.parentElement],Bn+"-container"),B.EventHandler.add(this.dialogObject.element,"keydown",this.preventEventSave,this),this.applyFormValidation()},c.prototype.renderDialogButtons=function(e){e.buttons=[{buttonModel:{content:this.l10n.getConstant("deleteButton"),cssClass:Dn,disabled:!this.parent.eventSettings.allowDeleting||this.parent.readonly},click:this.eventDelete.bind(this)},{buttonModel:{content:this.l10n.getConstant("saveButton"),cssClass:"e-primary "+ar,isPrimary:!0,disabled:!this.parent.eventSettings.allowAdding||this.parent.readonly},click:this.eventSave.bind(this)},{buttonModel:{cssClass:rr,content:this.l10n.getConstant("cancelButton")},click:this.dialogClose.bind(this)}]},c.prototype.addEventHandlers=function(){var e=this.element.querySelector(".e-back-icon"),t=this.element.querySelector("."+nr);!this.parent.isAdaptive||B.isNullOrUndefined(e)||B.isNullOrUndefined(t)||(B.EventHandler.add(e,"click",this.dialogClose,this),B.EventHandler.add(t,"click",this.eventSave,this))},c.prototype.refresh=function(){this.destroy(!0),this.renderEventWindow()},c.prototype.refreshRecurrenceEditor=function(){var e;this.recurrenceEditor&&(e=this.recurrenceEditor.element,this.recurrenceEditor.destroy(),this.createRecurrenceEditor(e))},c.prototype.setRecurrenceEditor=function(e){this.parent.editorTemplate&&(this.recurrenceEditor=e)},c.prototype.openEditor=function(e,t,i,n){var r;this.parent.currentAction=t,this.parent.removeNewEventElement(),this.parent.quickPopup&&this.parent.quickPopup.quickPopupHide(!0),this.parent.inlineModule.removeInlineAppointmentElement(),"Add"===t&&(r={},this.cellClickAction=!i,i=this.parent.activeCellsData=e,this.cellClickAction?this.convertToEventData(i,r):(this.parent.activeCellsData={startTime:i.startTime||i[this.fields.startTime],endTime:i.endTime||i[this.fields.endTime],isAllDay:i.isAllDay||i[this.fields.isAllDay],element:i.element,groupIndex:i.groupIndex},r=i),e=r),B.isNullOrUndefined(this.parent.editorHeaderTemplate)||(this.parent.resetTemplates(["editorHeaderTemplate"]),this.parent.isAdaptive&&!this.parent.editorFooterTemplate?this.dialogObject.header=this.createAdaptiveHeaderElement(e):this.dialogObject.header=this.getDialogHeader(e)),B.isNullOrUndefined(this.parent.editorFooterTemplate)||(this.parent.resetTemplates(["editorFooterTemplate"]),this.dialogObject.footerTemplate=this.getDialogFooter(e)),B.isNullOrUndefined(this.parent.editorHeaderTemplate)&&B.isNullOrUndefined(this.parent.editorFooterTemplate)||(this.dialogObject.dataBind(),this.addEventHandlers()),B.isNullOrUndefined(this.parent.editorTemplate)?this.setEditorContent(e,t,n):this.renderFormElements(this.element.querySelector(".e-schedule-form"),e,t,n)},c.prototype.setEditorContent=function(e,t,i){switch(!this.parent.isAdaptive&&B.isNullOrUndefined(this.parent.editorTemplate)&&B.removeClass([this.dialogObject.element.querySelector(".e-recurrenceeditor")],d),this.recurrenceEditor&&(this.recurrenceEditor.firstDayOfWeek=this.parent.activeViewOptions.firstDayOfWeek),t){case"Add":this.onCellDetailsUpdate(e,i);break;case"Save":case"EditOccurrence":case"EditSeries":case"EditFollowingEvents":"EditOccurrence"===t&&!this.parent.isAdaptive&&B.isNullOrUndefined(this.parent.editorTemplate)&&B.addClass([this.dialogObject.element.querySelector(".e-recurrenceeditor")],d),this.cellClickAction=!1,this.onEventDetailsUpdate(e)}},c.prototype.setDialogContent=function(){this.dialogObject.content=this.getEventWindowContent(),this.dialogObject.dataBind(),this.applyFormValidation()},c.prototype.setDialogHeader=function(){B.isNullOrUndefined(this.parent.editorHeaderTemplate)?this.parent.isAdaptive?this.dialogObject.header='<div class="e-title-header"><div class="e-back-icon e-icons"></div><div class="e-title-text">'+this.l10n.getConstant("newEvent")+'</div><div class="e-save-icon e-icons"></div></div>':this.dialogObject.header='<div class="e-title-text">'+this.l10n.getConstant("newEvent")+"</div>":(this.parent.resetTemplates(["editorHeaderTemplate"]),this.parent.isAdaptive&&!this.parent.editorFooterTemplate?this.dialogObject.header=this.createAdaptiveHeaderElement():this.dialogObject.header=this.getDialogHeader()),this.dialogObject.dataBind(),this.addEventHandlers()},c.prototype.setDialogFooter=function(){B.isNullOrUndefined(this.parent.editorFooterTemplate)?!this.parent.isAdaptive&&B.isNullOrUndefined(this.parent.editorFooterTemplate)?this.renderDialogButtons(this.dialogObject):this.parent.isAdaptive&&B.isNullOrUndefined(this.parent.editorFooterTemplate)&&(this.dialogObject.footerTemplate=null):(this.parent.resetTemplates(["editorFooterTemplate"]),this.dialogObject.footerTemplate=this.getDialogFooter()),this.dialogObject.dataBind()},c.prototype.createAdaptiveHeaderElement=function(e){var t=B.createElement("div",{className:"e-title-header"}),i=B.createElement("div",{className:"e-back-icon e-icons"}),i=(t.appendChild(i),this.getDialogHeader(e)),e=(t.appendChild(i),B.createElement("div",{className:"e-save-icon e-icons"}));return t.appendChild(e),t},c.prototype.getDialogHeader=function(e){var t=this.parent.element.id+"_editorHeaderTemplate",i=document.createElement("div"),e=[].slice.call(this.parent.getEditorHeaderTemplate()(e||{},this.parent,"editorHeaderTemplate",t,!1));return B.append(e,i),i},c.prototype.getDialogFooter=function(e){var t=this.parent.element.id+"_editorFooterTemplate",i=document.createElement("div"),e=[].slice.call(this.parent.getEditorFooterTemplate()(e||{},this.parent,"editorFooterTemplate",t,!1));return B.append(e,i),i},c.prototype.preventEventSave=function(e){this.parent&&!this.parent.allowKeyboardInteraction&&"Enter"===e.code&&(this.isEnterKey=!0)},c.prototype.onBeforeOpen=function(n){var r=this,a=this.eventData[this.fields.endTime].getTime(),e={type:"Editor",data:this.eventData,cancel:!1,element:this.element,target:(this.cellClickAction?this.parent.activeCellsData:this.parent.activeEventData).element},t=(this.cellClickAction&&(e.duration=this.getSlotDuration()),this.getInstance(ar)),t=(t&&(t.disabled=!(this.cellClickAction?this.parent.eventSettings.allowAdding:this.parent.eventSettings.allowEditing),t.dataBind()),this.getInstance(Dn)),s=(t&&(t.disabled=!this.parent.eventSettings.allowDeleting,t.dataBind()),new p.Deferred);return this.parent.trigger(ae,e,function(e){var t,i;n.cancel=e.cancel,n.maxHeight=r.parent.isAdaptive?"max-content":n.maxHeight,r.duration=r.cellClickAction?e.duration:null,r.eventData[r.fields.endTime].getTime()!==a||r.cellClickAction||0!==r.eventData[r.fields.endTime].getHours()||0!==r.eventData[r.fields.endTime].getMinutes()||(r.eventData=B.extend({},r.eventData,null,!0),r.trimAllDay(r.eventData)),r.refreshDateTimePicker(r.duration),r.cellClickAction&&e.duration!==r.getSlotDuration()&&B.isNullOrUndefined(r.parent.editorTemplate)&&(t=r.getInstance(Kn),(i=r.getInstance(Zn)).value=new Date(t.value.getTime()+je*e.duration),i.dataBind()),r.parent.editorTemplate&&r.element.querySelector(".e-recurrenceeditor")&&!r.recurrenceEditor&&(r.recurrenceEditor=r.getInstance("e-recurrenceeditor")),s.resolve(n)}),s},c.prototype.onBeforeClose=function(t){var i=this,e=(t.isInteracted&&(this.isCrudAction=!1),{type:"Editor",event:t.event||this.dialogEvent,data:this.eventCrudData,cancel:!1,element:this.element,target:(this.cellClickAction?this.parent.activeCellsData:this.parent.activeEventData).element}),n=new p.Deferred;return this.parent.trigger(se,e,function(e){t.cancel=e.cancel,e.cancel||(i.isCrudAction&&(t.cancel=i.processCrudActions(e.data),i.isCrudAction=t.cancel),i.isCrudAction)||(i.resetForm(),i.parent.eventBase.focusElement(!0),i.eventCrudData=null),n.resolve(t)}),n},c.prototype.getEventWindowContent=function(){var e=B.createElement("div",{className:"e-form-container"}),t=B.createElement("form",{id:this.parent.element.id+"EditForm",className:Wn});return t.onsubmit=function(){return!1},this.renderFormElements(t),e.appendChild(t),e},c.prototype.renderFormElements=function(e,t,i,n){var r=this;if(B.isNullOrUndefined(this.parent.editorTemplate))e.appendChild(this.getDefaultEventWindowContent()),t&&this.setEditorContent(t,i,n);else{if(t&&(this.fieldValidator&&(this.fieldValidator.destroy(),this.fieldValidator=null),this.recurrenceEditor&&(this.recurrenceEditor.destroy(),this.recurrenceEditor=null),this.destroyComponents(),this.parent.resetTemplates(["editorTemplate"]),B.EventHandler.clearEvents(e),!this.parent.isReact))for(var a=0,s=[].slice.call(e.children);a<s.length;a++){var o=s[a];B.remove(o)}var l=this.parent.element.id+"_editorTemplate",l=[].slice.call(this.parent.getEditorTemplate()(t||{},this.parent,"editorTemplate",l,!1));B.append(l,e),this.parent.renderTemplates(function(){r.element&&(r.applyFormValidation(),t)&&r.setEditorContent(t,i,n)})}},c.prototype.getDefaultEventWindowContent=function(){var e=this.createDivElement("e-dialog-parent"),t=this.createDivElement("e-title-location-row"),t=(e.appendChild(t),t.appendChild(this.renderTextBox(Gn)),t.appendChild(this.renderTextBox(Xn)),this.createDivElement("e-start-end-row")),t=(e.appendChild(t),t.appendChild(this.renderDateTimePicker(Kn,this.onTimeChange.bind(this))),t.appendChild(this.renderDateTimePicker(Zn)),this.createDivElement("e-all-day-time-zone-row")),t=(e.appendChild(t),t.appendChild(this.renderCheckBox(zn)),t.appendChild(this.renderCheckBox(Yn)),this.createDivElement(er)),t=(e.appendChild(t),t.appendChild(this.renderDropDown(tr)),t.appendChild(this.renderDropDown(ir)),this.createDivElement("e-repeat-parent-row")),i=(e.appendChild(t),this.renderCheckBox(_n)),n=B.createElement("span",{className:uo}),r=B.createElement("button",{className:"e-recurrence-edit-button",attrs:{type:"button",title:this.l10n.getConstant("editRecurrence")}});if(this.buttonObj=new H.Button({iconCss:"e-recurrence-edit e-icons",cssClass:"e-medium "+this.parent.cssClass}),n.appendChild(r),this.buttonObj.appendTo(r),i.appendChild(n),t.appendChild(i),this.parent.isAdaptive?B.EventHandler.add(r,"click",this.loadRecurrenceEditor,this):this.createRecurrenceEditor(e),0<this.parent.resourceCollection.length){for(var a=this.createDivElement("e-resources-row"),s=0,o=this.parent.resourceBase.resourceCollection;s<o.length;s++){var l=o[s];a.appendChild(this.renderResourceDetails(l))}e.appendChild(a)}n=this.createDivElement(Jn+"-row"),n.appendChild(this.renderTextBox(Jn)),e.appendChild(n),t=B.createElement("button",{attrs:{type:"hidden",title:"submit"}});return t.style.display="none",e.appendChild(t),e},c.prototype.createRecurrenceEditor=function(e){var t=B.createElement("div",{id:this.parent.element.id+"_recurrence_editor"});e.appendChild(t),this.recurrenceEditor=this.renderRecurrenceEditor(),this.recurrenceEditor.appendTo(t),this.updateMinMaxDateToEditor()},c.prototype.createDivElement=function(e){return B.createElement("div",{className:e})},c.prototype.createInputElement=function(e,t,i){return B.createElement(i||"input",{className:e,attrs:{type:"text",name:t,value:"",id:t}})},c.prototype.getSlotDuration=function(){return this.parent.activeViewOptions.timeScale.interval/this.parent.activeViewOptions.timeScale.slotCount},c.prototype.renderDateTimePicker=function(e,t){var i=this.createDivElement(e+"-container"),n=this.getFieldName(e),n=this.createInputElement(e+" "+ho,n);return i.appendChild(n),new R.DateTimePicker({change:t,firstDayOfWeek:this.parent.activeViewOptions.firstDayOfWeek,calendarMode:this.parent.calendarMode,min:this.parent.minDate,max:new Date(new Date(+this.parent.maxDate).setHours(23,59,59)),cssClass:this.parent.cssClass,enableRtl:this.parent.enableRtl,locale:this.parent.locale,floatLabelType:"Always",strictMode:!0,timeFormat:this.parent.activeViewOptions.timeFormat,format:(B.isNullOrUndefined(this.parent.dateFormat)?this.getFormat("dateFormats"):this.parent.dateFormat)+" "+this.parent.activeViewOptions.timeFormat,placeholder:this.getFieldLabel(e),step:this.getSlotDuration(),width:"100%"}).appendTo(n),i},c.prototype.refreshDateTimePicker=function(e){for(var t=0,i=[].slice.call(this.element.querySelectorAll(".e-start,.e-end"));t<i.length;t++){var n=i[t].ej2_instances[0];n.firstDayOfWeek=this.parent.activeViewOptions.firstDayOfWeek,n.timeFormat=this.parent.activeViewOptions.timeFormat,n.step=e||this.getSlotDuration(),n.dataBind()}},c.prototype.onTimeChange=function(){var e,t,i=this.getInstance(Kn);i.element.parentElement.classList.contains("e-input-focus")&&(e=this.getInstance(Zn),t=0,this.cellClickAction?(t=je*this.duration,this.eventWindowTime.startTime=i.value):t=this.eventData[this.fields.endTime].getTime()-this.eventData[this.fields.startTime].getTime(),i=B.isNullOrUndefined(i.value)?null:new Date(i.value.getTime()+t),this.cellClickAction&&(this.eventWindowTime.endTime=i),e.value=i,e.dataBind()),this.recurrenceEditor&&this.recurrenceEditor.updateRuleUntilDate(this.eventWindowTime.startTime)},c.prototype.renderResourceDetails=function(t){function e(e){return B.SanitizeHtmlHelper.sanitize('<div class="e-resource-template">\n <div class="e-resource-color" data-resource-color="'+e[t.colorField]+'"></div>\n <div class="e-resource-text">'+e[t.textField]+"</div></div>")}var i=this,n=t.field,r="e-"+n,a=t.title,s=this.createDivElement(r+"-container e-resources"),r=this.createInputElement(r+" "+ho,n);s.appendChild(r);return B.initializeCSPTemplate(e,t),(t.allowMultiple?new j.MultiSelect({enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:this.parent.cssClass||"",dataSource:t.dataSource,change:this.onMultiselectResourceChange.bind(this),itemTemplate:e,fields:{text:t.textField,value:t.idField},htmlAttributes:{name:n},floatLabelType:"Always",placeholder:a,popupHeight:"230px",popupWidth:"447px",mode:"Box",open:function(e){Promise.resolve().then(function(){i.applyStylesAfterRender(e)})}}):new j.DropDownList({cssClass:this.parent.cssClass||"",change:this.onDropdownResourceChange.bind(this),dataSource:t.dataSource,enableRtl:this.parent.enableRtl,fields:{text:t.textField,value:t.idField},htmlAttributes:{name:n},floatLabelType:"Always",placeholder:a,popupHeight:"230px",popupWidth:"447px",itemTemplate:e,open:function(e){Promise.resolve().then(function(){i.applyStylesAfterRender(e)})}})).appendTo(r),s},c.prototype.applyStylesAfterRender=function(e){e.popup&&e.popup.element&&e.popup.element.querySelectorAll(".e-resource-color[data-resource-color]").forEach(function(e){var t=e.getAttribute("data-resource-color");t&&(e.style.backgroundColor=t)})},c.prototype.renderDropDown=function(e){var i=this,t=this.getFieldName(e),n=this.createDivElement(e+"-container"),r=this.createInputElement(e+" "+ho,t);return n.appendChild(r),new j.DropDownList({allowFiltering:!0,change:this.onTimezoneChange.bind(this),cssClass:this.parent.cssClass||"",dataSource:this.parent.timezoneDataSource,enableRtl:this.parent.enableRtl,fields:{text:"Text",value:"Value"},filterBarPlaceholder:this.parent.localeObj.getConstant("searchTimezone"),noRecordsTemplate:this.parent.localeObj.getConstant("noRecords"),filtering:function(e){var t=new p.Query,t=""!==e.text?t.where("Text","contains",e.text,!0):t;e.updateData(i.parent.timezoneDataSource,t)},htmlAttributes:{title:this.getFieldLabel(e),name:t},floatLabelType:"Always",placeholder:this.getFieldLabel(e),popupHeight:"230px"}).appendTo(r),n},c.prototype.onMultiselectResourceChange=function(n){if(n.value&&this.parent.activeViewOptions.group.byGroupID&&!(this.parent.resourceCollection.length<=1))for(var r=this.parent.resourceBase.resourceCollection,e=n.element.getAttribute("name")||this.getColumnName(n.element),a=0;a<r.length;a++)if(r[parseInt(a.toString(),10)].field===e&&a<r.length-1){for(var t=this.createInstance(a),s=[],o=this,i=0;i<n.value.length;i++)!function(t){var i=r[a+1],e=i.dataSource.filter(function(e){return e[i.groupIDField]===n.value[parseInt(t.toString(),10)]})[0],e=B.isNullOrUndefined(e)?null:e[r[a+1].groupIDField],e=o.filterDatasource(a,e);s=s.concat(e)}(i);t.dataSource=s,t.dataBind()}},c.prototype.createInstance=function(e){e=this.parent.resourceBase.resourceCollection[e+1],e=this.element.querySelector(".e-"+e.field).ej2_instances[0];return e.clear(),e},c.prototype.onDropdownResourceChange=function(e){if(e.value&&!(this.parent.resourceCollection.length<=1)&&this.parent.activeViewOptions.group.byGroupID)for(var t,i,n=e.element.getAttribute("name")||this.getColumnName(e.element),r=this.parent.resourceBase.resourceCollection,a=0;a<r.length;a++)a<r.length-1&&r[parseInt(a.toString(),10)].field===n&&(t=this.createInstance(a),i=e.itemData[r[parseInt(a.toString(),10)].idField],t.dataSource=this.filterDatasource(a,i),t.dataBind(),i=0<t.dataSource.length?t.dataSource[0][r[a+1].idField]:null,t.value=r[a+1].allowMultiple?[i]:i,t.dataBind())},c.prototype.filterDatasource=function(e,t){var i=this.parent.resourceBase.resourceCollection[e+1];return i.dataSource.filter(function(e){return e[i.groupIDField]===t})},c.prototype.onTimezoneChange=function(e){var t;(e.element.getAttribute("name")||this.getColumnName(e.element))===this.parent.eventFields.startTimezone&&(e=this.getInstance(tr),(t=this.getInstance(ir)).value=e.value,t.dataBind())},c.prototype.renderCheckBox=function(e){var t=this.createDivElement(e+"-container"),i=this.getFieldName(e),n=this.createInputElement(e+" "+ho,i),e=(t.appendChild(n),new H.CheckBox({change:this.onChange.bind(this),cssClass:e+" "+this.parent.cssClass,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,label:this.getFieldLabel(e)}));return e.appendTo(n),n.setAttribute("name",i),"Repeat"===i&&(this.repeatStatus=e),t},c.prototype.renderTextBox=function(e){var t=this.createDivElement(e+"-container"),i=this.getFieldName(e),i=this.createInputElement(e+" "+ho,i,e===Jn?"textarea":"input");return t.appendChild(i),P.Input.createInput({element:i,floatLabelType:"Always",properties:{enableRtl:this.parent.enableRtl,placeholder:this.getFieldLabel(e)}}),t},c.prototype.getFieldName=function(e){var t="";switch(e){case Gn:t=this.fields.subject;break;case Xn:t=this.fields.location;break;case Kn:t=this.fields.startTime;break;case Zn:t=this.fields.endTime;break;case Jn:t=this.fields.description;break;case zn:t=this.fields.isAllDay;break;case tr:t=this.fields.startTimezone;break;case ir:t=this.fields.endTimezone;break;case Yn:t="Timezone";break;case _n:t="Repeat"}return t},c.prototype.getFieldLabel=function(e){var t="";switch(e){case Gn:t=this.parent.editorTitles.subject;break;case Xn:t=this.parent.editorTitles.location;break;case Jn:t=this.parent.editorTitles.description;break;case Kn:t=this.parent.editorTitles.startTime;break;case Zn:t=this.parent.editorTitles.endTime;break;case tr:t=this.parent.editorTitles.startTimezone;break;case ir:t=this.parent.editorTitles.endTimezone;break;case _n:t=this.parent.editorTitles.recurrenceRule;break;case zn:t=this.parent.editorTitles.isAllDay;break;case Yn:t=this.l10n.getConstant("timezone")}return t},c.prototype.onChange=function(e){var t;e.event&&e.event.target&&((t=B.closest(e.event.target,".e-all-day,.e-time-zone,.e-repeat")).classList.contains(zn)?this.onAllDayChange(e.checked):t.classList.contains(Yn)?this.timezoneChangeStyle(e.checked):t.classList.contains(_n)&&this.onRepeatChange(e.checked))},c.prototype.renderRepeatDialog=function(){var e=B.createElement("div");this.repeatDialogObject=new M.Dialog({header:this.l10n.getConstant("recurrence"),visible:!1,content:'<div class="e-rec-editor"></div>',closeOnEscape:!0,width:"90%",buttons:[{click:this.repeatSaveDialog.bind(this),buttonModel:{content:this.l10n.getConstant("save"),cssClass:"e-save",isPrimary:!0}},{click:this.repeatCancelDialog.bind(this),buttonModel:{cssClass:"e-cancel",content:this.l10n.getConstant("cancel")}}],target:this.element,animationSettings:{effect:"Zoom"},enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,isModal:!0,cssClass:"e-recurrence-dialog",open:this.repeatOpenDialog.bind(this)}),this.element.appendChild(e),this.repeatDialogObject.appendTo(e),this.createRecurrenceEditor(this.repeatDialogObject.element.querySelector(".e-rec-editor"))},c.prototype.loadRecurrenceEditor=function(){this.repeatDialogObject.show(),this.recurrenceEditor&&this.repeatRule&&this.recurrenceEditor.setRecurrenceRule(this.repeatRule)},c.prototype.onRepeatChange=function(e){e?(this.repeatDialogObject||this.renderRepeatDialog(),this.recurrenceEditor.setProperties({startDate:this.repeatStartDate,selectedType:0}),this.loadRecurrenceEditor()):(this.repeatDialogObject&&this.repeatDialogObject.hide(),this.repeatRule="",this.recurrenceEditor&&(this.recurrenceEditor.setRecurrenceRule(this.repeatRule),this.updateRepeatLabel(this.repeatRule)),e=this.element.querySelector("."+uo),B.addClass([e],go))},c.prototype.repeatSaveDialog=function(){this.repeatRule=this.recurrenceEditor.getRecurrenceRule();var e=this.element.querySelector("."+uo);this.recurrenceEditor.getRecurrenceRule()?B.removeClass([e],go):(B.addClass([e],go),this.repeatStatus.setProperties({checked:!1})),this.updateRepeatLabel(this.repeatRule),this.closeRepeatDialog()},c.prototype.closeRepeatDialog=function(){this.repeatDialogObject.hide()},c.prototype.repeatCancelDialog=function(){this.closeRepeatDialog(),this.recurrenceEditor&&this.recurrenceEditor.setRecurrenceRule(this.repeatTempRule),this.repeatTempRule||this.repeatStatus.setProperties({checked:!1})},c.prototype.repeatOpenDialog=function(){this.repeatTempRule=this.recurrenceEditor.getRecurrenceRule()},c.prototype.onCellDetailsUpdate=function(e,t){var i;this.parent.eventSettings.allowAdding&&(this.parent.isAdaptive&&t&&!this.repeatDialogObject&&this.renderRepeatDialog(),this.element.querySelector("."+Wn).removeAttribute("data-id"),B.isNullOrUndefined(this.parent.editorHeaderTemplate)&&(this.element.querySelector("."+sr).innerHTML=this.l10n.getConstant("newEvent")),e.Timezone=!1,this.repeatStartDate=e[this.fields.startTime],this.repeatRule="",B.isNullOrUndefined(this.parent.eventSettings.fields.subject.default)||(e[this.fields.subject]=this.parent.eventSettings.fields.subject.default),B.isNullOrUndefined(this.parent.eventSettings.fields.location.default)||(e[this.fields.location]=this.parent.eventSettings.fields.location.default),B.isNullOrUndefined(this.parent.eventSettings.fields.description.default)||(e[this.fields.description]=this.parent.eventSettings.fields.description.default),this.showDetails(e),e[this.fields.recurrenceRule]&&this.recurrenceEditor&&(this.recurrenceEditor.setRecurrenceRule(e[this.fields.recurrenceRule],e[this.fields.startTime]),this.repeatRule=e[this.fields.recurrenceRule]),(i=this.element.querySelector("."+Dn))&&B.addClass([i],d),this.recurrenceEditor&&(this.recurrenceEditor.setProperties({startDate:e[this.fields.startTime],selectedType:B.isNullOrUndefined(t)?B.isNullOrUndefined(e[this.fields.recurrenceRule])?0:this.recurrenceEditor.selectedType:t}),this.repeatRule=this.recurrenceEditor.value),this.parent.isAdaptive&&B.isNullOrUndefined(this.parent.editorTemplate)?(i=this.element.querySelector("."+uo),e[this.fields.recurrenceRule]||t?(B.removeClass([i],go),this.repeatStatus.setProperties({checked:!0})):(B.addClass([i],go),this.repeatStatus.setProperties({checked:!1})),this.updateRepeatLabel(this.repeatRule)):(e=this.element.querySelector("."+ar),this.disableButton(e,!1)),this.dialogObject.show())},c.prototype.convertToEventData=function(e,t){e&&(e.subject&&(t[this.fields.subject]=e.subject),t[this.fields.startTime]=e.startTime,t[this.fields.endTime]=e.endTime,t[this.fields.isAllDay]=e.isAllDay,e.RecurrenceRule&&(t[this.fields.recurrenceRule]=e.RecurrenceRule),0<this.parent.resourceCollection.length||0<this.parent.activeViewOptions.group.resources.length)&&this.parent.resourceBase.setResourceValues(t)},c.prototype.applyFormValidation=function(){var e,t,i,n=this.element.querySelector("."+Wn);n&&(t={},i=(e=function(e){return e&&0<Object.keys(e).length?e:void 0})(this.parent.eventSettings.fields.subject.validation),B.isNullOrUndefined(i)||(t[this.parent.eventSettings.fields.subject.name]=i),i=e(this.parent.eventSettings.fields.location.validation),B.isNullOrUndefined(i)||(t[this.parent.eventSettings.fields.location.name]=i),i=e(this.parent.eventSettings.fields.startTime.validation),B.isNullOrUndefined(i)||(t[this.parent.eventSettings.fields.startTime.name]=i),i=e(this.parent.eventSettings.fields.endTime.validation),B.isNullOrUndefined(i)||(t[this.parent.eventSettings.fields.endTime.name]=i),i=e(this.parent.eventSettings.fields.description.validation),B.isNullOrUndefined(i)||(t[this.parent.eventSettings.fields.description.name]=i),this.fieldValidator&&(this.fieldValidator.destroy(),this.fieldValidator=null),this.fieldValidator=new ns,this.fieldValidator.renderFormValidator(n,t,this.element,this.parent.locale))},c.prototype.showDetails=function(e){this.eventData=e;for(var t=B.extend({},e,null,!0),e=this.getFormElements(Bn),i=(this.cellClickAction&&(!this.cellClickAction||B.isNullOrUndefined(this.parent.editorTemplate))||0!==t[this.fields.endTime].getHours()||0!==t[this.fields.endTime].getMinutes()||this.trimAllDay(t),Object.keys(t)),n=0,r=e;n<r.length;n++){var a=r[n],s=a.name||this.getColumnName(a);B.isNullOrUndefined(s)||""===s||(-1!==i.indexOf(s)?this.setValueToElement(a,t[""+s]):this.setDefaultValueToElement(a))}B.isNullOrUndefined(this.parent.editorTemplate)&&(this.onAllDayChange(t[this.fields.isAllDay]),e=this.getInstance(Yn+"."+ho),B.isNullOrUndefined(t[this.fields.startTimezone])&&B.isNullOrUndefined(t[this.fields.endTimezone])||(e.checked=!0,e.dataBind()),this.timezoneChangeStyle(e.checked),delete t.Timezone)},c.prototype.getColumnName=function(e){var t,i,n=e.getAttribute("data-name")||"";return n=""===n&&(i=!1,t="",e.classList.contains("e-dropdownlist")?(t="e-ddl",i=!0):e.classList.contains("e-multiselect")?(t="e-multiselect",i=!0):e.classList.contains("e-datetimepicker")?t="e-datetimepicker":e.classList.contains("e-datepicker")?t="e-datepicker":e.classList.contains("e-checkbox")?t="e-checkbox":e.classList.contains("e-numerictextbox")&&(t="e-numerictextbox"),i=B.closest(e,i?"."+t+":not(.e-control)":"."+t)||e.querySelector("."+t))&&(e=i.querySelector("[name]"))?e.name:n},c.prototype.onAllDayChange=function(e){var t,i=this.getInstance(Kn),n=this.getInstance(Zn),r=this.element.querySelector(".e-time-zone-container");e?(t=B.isNullOrUndefined(this.parent.dateFormat)?this.getFormat("dateFormats"):this.parent.dateFormat,B.addClass(this.element.querySelectorAll(".e-time-icon"),or),B.addClass([r],d),this.element.querySelector("."+er)&&B.removeClass([this.element.querySelector("."+er)],bt)):(t=B.isNullOrUndefined(this.parent.dateFormat)?this.getFormat("dateFormats")+" "+this.parent.activeViewOptions.timeFormat:this.parent.dateFormat+" "+this.parent.activeViewOptions.timeFormat,B.removeClass(this.element.querySelectorAll(".e-time-icon"),or),B.removeClass([r],d),this.element.querySelector(".e-checkbox-wrapper .e-time-zone").checked&&B.addClass([this.element.querySelector("."+er)],bt)),i.format=n.format=t,this.cellClickAction&&this.updateDateTime(e,i,n),i.dataBind(),n.dataBind(),B.isNullOrUndefined(this.recurrenceEditor)||this.recurrenceEditor.updateRuleUntilDate(i.value)},c.prototype.updateDateTime=function(e,t,i){var n,r;B.isNullOrUndefined(this.eventWindowTime.startTime)&&B.isNullOrUndefined(this.eventWindowTime.endTime)||(e?(r=z(new Date(this.eventWindowTime.startTime.getTime())),n=this.parent.activeCellsData.isAllDay?(e=Y(new Date(this.eventWindowTime.endTime.getTime()),-1).getTime(),+this.eventWindowTime.startTime>e?this.eventWindowTime.endTime:new Date(e)):z(new Date(this.eventWindowTime.endTime.getTime()))):(e=this.parent.activeCellsData.startTime,(r=new Date(this.eventWindowTime.startTime.getTime())).setHours(e.getHours(),e.getMinutes(),e.getSeconds()),this.parent.activeCellsData.isAllDay?(e=this.parent.getStartEndTime(this.parent.workHours.start),r.setHours(e.getHours(),e.getMinutes(),e.getSeconds()),(n=new Date(r.getTime())).setMilliseconds(je*this.getSlotDuration())):(n=new Date(r.getTime())).setMilliseconds(this.parent.activeCellsData.endTime.getTime()-this.parent.activeCellsData.startTime.getTime())),this.eventWindowTime={startTime:new Date(r.getTime()),endTime:new Date(n.getTime())},t.value=r,i.value=n,t.dataBind(),i.dataBind())},c.prototype.getFormat=function(e){e=B.isNullOrUndefined(this.parent.locale)||"en"===this.parent.locale||"en-US"===this.parent.locale?B.getValue(e+".short",B.getDefaultDateObject(this.parent.getCalendarMode())):B.getValue("main."+this.parent.locale+".dates.calendars."+this.parent.getCalendarMode()+"."+e+".short",B.cldrData);return e},c.prototype.onEventDetailsUpdate=function(e){var t,i;this.parent.eventSettings.allowEditing&&(!this.parent.isAdaptive&&B.isNullOrUndefined(this.parent.editorFooterTemplate)&&B.removeClass([this.element.querySelector("."+Dn)],d),B.isNullOrUndefined(this.parent.editorHeaderTemplate)&&(this.element.querySelector("."+sr).innerHTML=this.l10n.getConstant("editEvent")),this.element.querySelector("."+Wn).setAttribute("data-id",e[this.fields.id].toString()),B.isNullOrUndefined(this.parent.editorTemplate)&&(e=B.extend({},e,null,!0),t=this.getInstance(Yn+"."+ho),i=void 0,e[this.fields.startTimezone]||e[this.fields.endTimezone]?(i=!0,this.parent.eventBase.timezoneConvert(e)):i=!1,e.Timezone=i,t.checked=i,t.dataBind()),this.showDetails(e),e[this.fields.recurrenceRule]&&this.recurrenceEditor?this.recurrenceEditor.setRecurrenceRule(e[this.fields.recurrenceRule],e[this.fields.startTime]):!this.parent.isAdaptive&&this.recurrenceEditor&&(this.recurrenceEditor.setProperties({startDate:e[this.fields.startTime]}),this.recurrenceEditor.setRecurrenceRule("")),this.repeatStartDate=e[this.fields.startTime],this.repeatRule="",e[this.fields.recurrenceRule]&&(this.recurrenceEditor&&this.recurrenceEditor.setRecurrenceRule(e[this.fields.recurrenceRule],e[this.fields.startTime]),this.repeatRule=e[this.fields.recurrenceRule]),this.parent.isAdaptive&&B.isNullOrUndefined(this.parent.editorTemplate)&&(i=this.element.querySelector("."+uo),e[this.fields.recurrenceRule]?(B.removeClass([i],go),this.repeatStatus.setProperties({checked:!0})):(B.addClass([i],go),this.repeatStatus.setProperties({checked:!1})),this.updateRepeatLabel(this.repeatRule)),t=this.parent.readonly||e[this.fields.isReadonly],this.parent.isAdaptive?(i=this.element.querySelector("."+nr))&&(t?B.addClass([i],Ir):B.removeClass([i],Ir)):(e=this.element.querySelector("."+ar),i=this.element.querySelector("."+Dn),this.disableButton(e,t),this.disableButton(i,t)),this.dialogObject.show())},c.prototype.disableButton=function(e,t){e&&(e.ej2_instances[0].disabled=t)},c.prototype.renderRecurrenceEditor=function(){return new co({calendarMode:this.parent.calendarMode,cssClass:this.parent.cssClass,dateFormat:this.parent.dateFormat,enableRtl:this.parent.enableRtl,firstDayOfWeek:this.parent.activeViewOptions.firstDayOfWeek,locale:this.parent.locale})},c.prototype.updateMinMaxDateToEditor=function(){var e=this.element.querySelector(".e-start"),t=this.element.querySelector(".e-end");e&&t&&(e=e.ej2_instances[0],t=t.ej2_instances[0],e.min=this.parent.minDate,e.max=new Date(new Date(+this.parent.maxDate).setHours(23,59,59)),t.min=this.parent.minDate,t.max=new Date(new Date(+this.parent.maxDate).setHours(23,59,59)),e.dataBind(),t.dataBind()),this.recurrenceEditor&&(e=this.recurrenceEditor.element.querySelector(".e-until-date"))&&((t=e.ej2_instances[0]).min=this.parent.minDate,t.max=this.parent.maxDate,t.dataBind())},c.prototype.updateRepeatLabel=function(e){this.parent.isAdaptive&&!this.repeatDialogObject&&this.renderRepeatDialog();e=e?this.l10n.getConstant("repeats")+" "+this.recurrenceEditor.getRuleSummary(e):this.l10n.getConstant("repeat");this.repeatStatus.setProperties({label:e})},c.prototype.dialogClose=function(e){this.isEnterKey?this.isEnterKey=!1:(this.dialogEvent=e,this.isCrudAction=!1,this.parent.activeEventData={event:void 0,element:void 0},this.parent.currentAction=null,this.dialogObject.hide())},c.prototype.resetForm=function(){this.fieldValidator.destroyToolTip(),this.resetFormFields(),this.parent.isAdaptive||!this.recurrenceEditor||this.recurrenceEditor.isDestroyed||this.recurrenceEditor.resetFields()},c.prototype.timezoneChangeStyle=function(e){var t,i,n=this.element.querySelector("."+er),r=this.parent.tzModule.getLocalTimezoneName();e?(B.addClass([n],bt),e=this.getInstance(tr),t=this.getInstance(ir),i=e.dataSource,e.value&&this.parent.timezone||i.some(function(e){return e.Value===r})||(i.push({Value:r,Text:r}),e.dataSource=i,t.dataSource=i,e.dataBind(),t.dataBind()),e.value=e.value||this.parent.timezone||r,t.value=t.value||this.parent.timezone||r,e.dataBind(),t.dataBind()):B.removeClass([n],bt)},c.prototype.resetFormFields=function(){for(var e=0,t=this.getFormElements(Bn);e<t.length;e++){var i=t[e],n=i.name||this.getColumnName(i);B.isNullOrUndefined(n)||""===n||this.setDefaultValueToElement(i)}},c.prototype.eventSave=function(e,t){var i;this.isEnterKey?this.isEnterKey=!1:(i=this.element.querySelector("."+Wn))&&i.classList.contains("e-formvalidator")&&!i.ej2_instances[0].validate()||(i=this.getEventDataFromEditor(),this.processEventValidation(i.tempData,t))||(this.eventCrudData=i.eventData,this.dialogEvent=e,this.isCrudAction=!0,this.dialogObject.hide())},c.prototype.getEventDataFromEditor=function(){var e=B.extend({},this.getObjectFromFormData(Bn)),t=(e.Timezone||(e[this.fields.startTimezone]=null,e[this.fields.endTimezone]=null),delete e.Timezone,delete e.Repeat,this.setDefaultValueToObject(e),e[this.fields.recurrenceRule]=this.recurrenceEditor?this.recurrenceEditor.getRecurrenceRule()||null:void 0,B.extend({},e,null,!0));return e[this.fields.isAllDay]&&(e[this.fields.startTime]=B.isNullOrUndefined(e[this.fields.startTime])?null:z(new Date(e[this.fields.startTime].getTime())),e[this.fields.endTime]=B.isNullOrUndefined(e[this.fields.endTime])?null:Y(z(new Date(e[this.fields.endTime].getTime())),1)),{eventData:e,tempData:t}},c.prototype.processEventValidation=function(e,t){var i;if(B.isNullOrUndefined(this.parent.editorTemplate)){if(!e[this.fields.startTime]||!e[this.fields.endTime])return this.parent.quickPopup.openValidationError("invalidDateError"),!0;if(e[this.fields.startTime]>e[this.fields.endTime])return this.parent.quickPopup.openValidationError("startEndError"),!0}if(this.recurrenceEditor&&this.recurrenceEditor.value&&""!==this.recurrenceEditor.value){var n=!0;if("seriesChangeAlert"===(i="EditOccurrence"!==this.parent.currentAction?this.recurrenceValidation(e[this.fields.startTime],e[this.fields.endTime],t):i)&&this.parent.uiStateValues.isIgnoreOccurrence&&(n=!1),!B.isNullOrUndefined(i)&&n&&(!this.parent.enableRecurrenceValidation&&"wrongPattern"===i||this.parent.enableRecurrenceValidation))return this.parent.quickPopup.openRecurrenceValidationAlert(i),!0}return!1},c.prototype.processCrudActions=function(e){var t=this,i=(this.parent.uiStateValues.isBlock=!1,this.getResourceData(e)),i=(0<this.parent.activeViewOptions.group.resources.length||0<this.parent.resourceCollection.length)&&!this.parent.activeViewOptions.group.allowGroupEdit&&!B.isNullOrUndefined(i),n=this.getEventIdFromForm();if(B.isNullOrUndefined(n)){if(this.parent.currentAction="Add",this.parent.eventBase.checkOverlap(e))return!0;i?this.resourceSaveEvent(e,this.parent.currentAction):(e[this.fields.id]=this.parent.eventBase.getEventMaxID(),this.parent.addEvent(e))}else{var r="string"===this.parent.eventBase.getEventIDType()?n:parseInt(n,10),n=this.parent.eventsData.filter(function(e){return e[t.fields.id]===r})[0];if(B.isNullOrUndefined(n)&&(n=this.parent.blockData.filter(function(e){return e[t.fields.id]===r})[0]),(e=B.extend({},n,e))[this.fields.isReadonly])return!1;if(this.parent.eventBase.checkOverlap(e))return!0;var a=void 0;if(!B.isNullOrUndefined(n[this.fields.recurrenceRule])){if(a=this.parent.currentAction,e.Guid=this.parent.activeEventData.event.Guid,"EditOccurrence"===this.parent.currentAction&&(e[this.fields.recurrenceID]?(r=e[this.fields.recurrenceID],a=null):(e[this.fields.id]=this.parent.eventBase.getEventMaxID(),e.Guid=this.parent.activeEventData.event.Guid),this.parent.enableRecurrenceValidation)&&this.editOccurrenceValidation(r,e))return!0;"EditSeries"===this.parent.currentAction||e[this.fields.id]!==n[this.fields.id]?e[this.fields.recurrenceID]=n[this.fields.id]:"EditFollowingEvents"===this.parent.currentAction&&(e[this.fields.id]=this.parent.eventBase.getEventMaxID(),e[this.fields.followingID]=n[this.fields.id])}i?this.resourceSaveEvent(e,"Save",a):this.parent.saveEvent(e,a)}return this.parent.uiStateValues.isBlock},c.prototype.getResourceData=function(e){var t=null;return t=!B.isNullOrUndefined(this.parent.resourceBase)&&!B.isNullOrUndefined(this.parent.resourceBase.resourceCollection)&&0<this.parent.resourceBase.resourceCollection.length?e[this.parent.resourceBase.resourceCollection.slice(-1)[0].field]:t},c.prototype.getObjectFromFormData=function(e){for(var t={},i=0,n=this.getFormElements(e);i<n.length;i++){var r=n[i],a=r.name||this.getColumnName(r);B.isNullOrUndefined(a)||""===a||(t[""+a]=this.getValueFromElement(r))}return t},c.prototype.setDefaultValueToObject=function(e){B.isNullOrUndefined(e[this.fields.subject])||(e[this.fields.subject]=e[this.fields.subject]||this.parent.eventSettings.fields.subject.default||this.l10n.getConstant("addTitle")),B.isNullOrUndefined(e[this.fields.location])||(e[this.fields.location]=e[this.fields.location]||this.parent.eventSettings.fields.location.default),B.isNullOrUndefined(e[this.fields.description])||(e[this.fields.description]=e[this.fields.description]||this.parent.eventSettings.fields.description.default)},c.prototype.recurrenceValidation=function(e,t,i){var n,r=this.recurrenceEditor,a=this.getInstance("e-repeat-interval.e-numerictextbox").value;if(i!==this.l10n.getConstant("ok")){var s,o,i=this.parent.activeEventData.event,l=[];if("EditSeries"!==this.parent.currentAction&&"EditFollowingEvents"!==this.parent.currentAction||B.isNullOrUndefined(i)||(s=i[this.parent.eventFields.startTime],l=0<(o=this.parent.eventBase.getSeriesEvents(this.eventData,s)).length?this.parent.eventBase.getEditedOccurrences(o,s):(o=this.parent.eventBase.getEventById(i[this.parent.eventFields.id]),this.parent.eventBase.getEditedOccurrences([o],s)),"EditSeries"!==this.parent.currentAction)||B.isNullOrUndefined(this.eventData[this.parent.eventFields.recurrenceException])||l.push(this.eventData),0<l.length&&(n="seriesChangeAlert"),"until"===this.getInstance("e-end-on-left .e-ddl .e-dropdownlist").value&&this.getInstance("e-end-on-date .e-datepicker").value<e&&(n="wrongPattern"),B.isNullOrUndefined(n)){r.value.split(";")[1].split("=")[1].split(",");var p={SU:0,MO:1,TU:2,WE:3,TH:4,FR:5,SA:6},c=[],h=[];switch(r.value.split(";")[0].split("=")[1]){case"DAILY":(t.getTime()-e.getTime())/36e5>24*a&&(n="createError");break;case"WEEKLY":for(var d=r.value.split(";")[1].split("=")[1].split(","),u=0;u<d.length*(a+1);u++)c[parseInt(u.toString(),10)]=d.length>u?p[d[parseInt(u.toString(),10)]]:c[u-d.length]+7*a;for(var g=c.sort(function(e,t){return e-t}),u=1;u<g.length;u++)h.push(g[parseInt(u.toString(),10)]-g[u-1]);((t.getTime()-e.getTime())/36e5>=24*Math.min.apply(Math,h)||B.isNullOrUndefined(a))&&(n="createError");break;case"MONTHLY":t.getTime()>=new Date(+e).setMonth(e.getMonth()+a)&&(n="createError");break;case"YEARLY":t.getTime()>=new Date(+e).setFullYear(e.getFullYear()+a)&&(n="createError")}}}else t.getTime()>=new Date(+e).setMonth(e.getMonth()+a)&&(n="createError"),B.isNullOrUndefined(n)&&this.parent.quickPopup.quickDialog.hide();return n=B.isNullOrUndefined(a)?"createError":n},c.prototype.getRecurrenceIndex=function(e,t){for(var i,n=0;n<e.length;n++)if(t[this.fields.startTime].valueOf()===e[parseInt(n.toString(),10)][this.fields.startTime].valueOf()){i=n;break}return i},c.prototype.trimAllDay=function(e){var t;e[this.fields.isAllDay]&&(t=Y(new Date(+e[this.fields.endTime]),-1).getTime(),e[this.fields.endTime]=+e[this.fields.startTime]>t?e[this.fields.endTime]:new Date(t))},c.prototype.editOccurrenceValidation=function(t,e,i){var n=this,r=(void 0===i&&(i=this.eventData),this.parent.getOccurrencesByID(t));this.parent.eventsData.filter(function(e){return e[n.fields.recurrenceID]===t}).map(function(e){return r.push(B.extend({},e))}),e=B.extend({},e),this.trimAllDay(e);for(var a=0,s=r;a<s.length;a++){var o=s[a];this.trimAllDay(o)}this.parent.eventBase.sortByTime(r);i=this.getRecurrenceIndex(r,i);if(!B.isNullOrUndefined(i)){var l,p,c=new Date(+e[this.fields.startTime]),e=new Date(+e[this.fields.endTime]),h=(i!==r.length-1&&(l=new Date(+r[i+1][this.fields.startTime]),p=new Date(+r[i+1][this.fields.endTime])),new Date(+r[r.length-1][this.fields.endTime]));if(0===i){if(!B.isNullOrUndefined(r[i+1])){if(!(l.getTime()>=e.getTime())&&z(h).getTime()>=z(c).getTime()||z(h).getTime()<z(c).getTime())return this.parent.quickPopup.openRecurrenceValidationAlert("occurrenceAlert"),!0;if(!(z(c).getTime()<z(l).getTime()))return this.parent.quickPopup.openRecurrenceValidationAlert("sameDayAlert"),!0}}else{var d=new Date(+r[i-1][this.fields.startTime]),u=new Date(+r[i-1][this.fields.endTime]);if(i===r.length-1){if(z(new Date(+r[r.length-1-i][this.fields.startTime])).getTime()>z(c).getTime())return this.parent.quickPopup.openRecurrenceValidationAlert("occurrenceAlert"),!0;if(!(u.getTime()<=c.getTime()&&z(c).getTime()>z(d).getTime()))return this.parent.quickPopup.openRecurrenceValidationAlert("sameDayAlert"),!0}else{if(!(z(d).getTime()<z(c).getTime()||z(new Date(+r[0][this.fields.startTime])).getTime()>z(c).getTime())||!(z(l).getTime()>z(c).getTime()||h.getTime()<c.getTime()))return this.parent.quickPopup.openRecurrenceValidationAlert("sameDayAlert"),!0;if(!(u.getTime()<=c.getTime()&&l.getTime()>=e.getTime())||z(p).getTime()<z(c).getTime()||z(d).getTime()>z(e).getTime()||!(z(c).getTime()<z(l).getTime()))return this.parent.quickPopup.openRecurrenceValidationAlert("occurrenceAlert"),!0}}}return!1},c.prototype.resourceSaveEvent=function(g,m,v){for(var f=this,y=this.parent.resourceBase.resourceCollection.slice(-1)[0],T=((T=g[y.field])instanceof Array?T:[T]).reverse(),w=this.parent.resourceBase.lastResourceLevel,D=[],e=function(i){function e(){if("Save"===m&&i===T.length-1)if(0<r.length){r[0][f.fields.id]=g[f.fields.id];for(var e=1;e<r.length;e++)r[parseInt(e.toString(),10)][f.fields.id]=f.parent.eventBase.getEventMaxID(i),D.push(r[parseInt(e.toString(),10)]),f.parent.saveEvent(r[0],v)}else n[f.fields.id]=g[f.fields.id],f.parent.saveEvent(n,v);else if(0<r.length)for(var t=0;t<r.length;t++)r[parseInt(t.toString(),10)][f.fields.id]=f.parent.eventBase.getEventMaxID(t),D.push(r[parseInt(t.toString(),10)]);else n[f.fields.id]=f.parent.eventBase.getEventMaxID(i),D.push(n)}var n=B.extend({},g,null,!0),r=(n[b.fields.id]=b.parent.eventBase.getEventMaxID(),[]);if(b.parent.activeViewOptions.group.byGroupID&&!B.isNullOrUndefined(w)){var t=y.dataSource,a=b.parent.resourceCollection,s=void 0;if((s=1<a.length?st(t,y.idField,T[parseInt(i.toString(),10)],n,a):st(t,y.idField,T[parseInt(i.toString(),10)]))<0)return{value:void 0};for(var o=t[parseInt(s.toString(),10)][y.groupIDField],l=w.filter(function(e){return e.resourceData[y.idField]===T[parseInt(i.toString(),10)]}).filter(function(e){return e.resourceData[y.groupIDField]===o})[0].groupOrder,p=0;p<b.parent.resourceBase.resourceCollection.length;p++){var c=b.parent.resourceBase.resourceCollection[parseInt(p.toString(),10)].field;n[""+c]=l[parseInt(p.toString(),10)]instanceof Array?l[parseInt(p.toString(),10)][0]:l[parseInt(p.toString(),10)]}}else{for(s=0;s<b.parent.resourceBase.resourceCollection.length-1;s++){c=b.parent.resourceBase.resourceCollection[parseInt(s.toString(),10)].field;if(n[""+c]instanceof Array&&1<n[""+c].length)for(var h=0;h<n[""+c].length;h++){var d=B.extend({},n,null,!0);d[""+c]=g[""+c][parseInt(h.toString(),10)],d[y.field]=T[parseInt(i.toString(),10)],r.push(d)}else if(0===r.length)n[""+c]=g[""+c]instanceof Array?g[""+c][0]:g[""+c],n[y.field]=T[parseInt(i.toString(),10)];else for(var u=0;u<r.length;u++)r[parseInt(u.toString(),10)][""+c]=g[""+c]instanceof Array?g[""+c][0]:g[""+c]}n[y.field]=T[parseInt(i.toString(),10)]}e()},b=this,t=0;t<T.length;t++){var i=e(t);if("object"==typeof i)return i.value}if(0<D.length){for(var n=0,r=D;n<r.length;n++){var a=r[n];a[this.fields.recurrenceException]=null,a[this.fields.recurrenceID]=null}this.parent.addEvent(D)}},c.prototype.getEventIdFromForm=function(){return this.element.querySelector("."+Wn).getAttribute("data-id")},c.prototype.getFormElements=function(e){return e===Bn?[].slice.call(this.element.querySelectorAll("."+ho)):[].slice.call(this.parent.element.querySelectorAll("."+e+" ."+ho))},c.prototype.getValueFromElement=function(e){e=e.classList.contains("e-datepicker")||e.classList.contains("e-datetimepicker")||e.classList.contains("e-dropdownlist")||e.classList.contains("e-multiselect")?e.ej2_instances[0].value:e.classList.contains("e-checkbox")?e.ej2_instances[0].checked:e.classList.contains("e-numerictextbox")?e.ej2_instances[0].value:"checkbox"===e.type?e.checked:this.parent.enableHtmlSanitizer?B.SanitizeHtmlHelper.sanitize(e.value):e.value;return e},c.prototype.setValueToElement=function(e,t){var i;e.classList.contains("e-datepicker")?((i=e.ej2_instances[0]).value=t,i.dataBind()):e.classList.contains("e-datetimepicker")?((i=e.ej2_instances[0]).element.classList.contains(Kn)?this.eventWindowTime.startTime=new Date(""+t):this.eventWindowTime.endTime=new Date(""+t),i.value=t,i.dataBind()):e.classList.contains("e-dropdownlist")?((i=e.ej2_instances[0]).value=t,i.dataBind()):e.classList.contains("e-multiselect")?((i=e.ej2_instances[0]).value=[],i.value=t instanceof Array?t:[t],i.dataBind()):e.classList.contains("e-checkbox")?((i=e.ej2_instances[0]).checked=t,i.dataBind()):e.classList.contains("e-numerictextbox")?((i=e.ej2_instances[0]).value=t,i.dataBind()):"checkbox"!==e.type?e.value=t||"":e.checked=t},c.prototype.setDefaultValueToElement=function(e){var t,i;e.classList.contains("e-datepicker")?((i=e.ej2_instances[0]).value=this.parent.getCurrentTime(),i.dataBind()):e.classList.contains("e-datetimepicker")?(i=e.ej2_instances[0],t=this.parent.getCurrentTime(),this.eventWindowTime={startTime:t,endTime:t},i.value=t,i.dataBind()):e.classList.contains("e-dropdownlist")?((i=e.ej2_instances[0]).value=null,i.dataBind()):e.classList.contains("e-multiselect")?((i=e.ej2_instances[0]).value=[],i.dataBind()):e.classList.contains("e-checkbox")?((i=e.ej2_instances[0]).checked=!1,i.dataBind()):e.classList.contains("e-numerictextbox")?((i=e.ej2_instances[0]).value=null,i.dataBind()):"checkbox"===e.type?e.checked=!1:e.value=""},c.prototype.getInstance=function(e){e=this.element.querySelector("."+e);return e?e.ej2_instances[0]:null},c.prototype.eventDelete=function(e){if(this.isEnterKey)this.isEnterKey=!1;else{switch(this.parent.currentAction){case"EditOccurrence":B.isNullOrUndefined(this.parent.activeEventData.event[this.parent.eventFields.recurrenceRule])?this.parent.currentAction="Delete":this.parent.currentAction="DeleteOccurrence";break;case"EditSeries":this.parent.currentAction="DeleteSeries";break;case"Save":this.parent.currentAction="Delete";break;case"EditFollowingEvents":B.isNullOrUndefined(this.parent.activeEventData.event[this.parent.eventFields.recurrenceRule])||(this.parent.currentAction="DeleteFollowingEvents")}this.dialogEvent=e,this.isCrudAction=!1,this.dialogObject.hide(),this.parent.quickPopup.openDeleteAlert()}},c.prototype.getRecurrenceEditorInstance=function(){return this.parent.isAdaptive&&!this.repeatDialogObject&&this.renderRepeatDialog(),this.recurrenceEditor},c.prototype.destroyComponents=function(){for(var e=0,t=this.getFormElements(Bn);e<t.length;e++){var i=t[e],n=void 0;(n=i.classList.contains("e-datetimepicker")||i.classList.contains("e-datepicker")||i.classList.contains("e-checkbox")||i.classList.contains("e-dropdownlist")||i.classList.contains("e-multiselect")||i.classList.contains("e-numerictextbox")?i.ej2_instances:n)&&n[0]&&n[0].destroy()}this.buttonObj&&this.buttonObj.destroy()},c.prototype.detachComponents=function(){for(var e=0,t=this.getFormElements(Bn);e<t.length;e++){var i=t[e];B.detach(i)}},c.prototype.destroy=function(e){var t;this.parent&&!this.parent.isDestroyed&&this.parent.resetTemplates(["editorTemplate","editorHeaderTemplate","editorFooterTemplate"]),this.destroyComponents(),this.recurrenceEditor&&(this.recurrenceEditor.destroy(),B.detach(this.recurrenceEditor.element),this.recurrenceEditor=null),this.fieldValidator&&(this.fieldValidator.destroy(),this.fieldValidator=null),this.repeatDialogObject&&(this.repeatDialogObject.destroy(),this.repeatDialogObject=null),this.detachComponents(),this.dialogObject&&(this.dialogObject.element&&(lt(t=this.dialogObject.element.querySelector("form")),B.detach(t),B.EventHandler.remove(this.dialogObject.element,"keydown",this.preventEventSave)),this.dialogObject.destroy(),this.dialogObject=null),this.element&&(B.remove(this.element),this.element=null),e||(this.l10n=null,this.parent=null,this.fields=null,this.buttonObj=null,this.repeatStatus=null,this.eventWindowTime=null,this.dialogEvent=null)},c);function c(e){this.parent=e,this.l10n=this.parent.localeObj,this.fields=this.parent.eventFields,this.eventWindowTime={startTime:new Date,endTime:new Date},this.renderEventWindow()}h.prototype.addEventListener=function(){!this.parent||this.parent&&this.parent.isDestroyed||this.parent.on(Ie,this.virtualScrolling,this)},h.prototype.removeEventListener=function(){!this.parent||this.parent&&this.parent.isDestroyed||this.parent.off(Ie,this.virtualScrolling)},h.prototype.getRenderedCount=function(){this.setItemSize();var e=this.isHorizontalScroll?this.parent.element.clientWidth:this.parent.element.clientHeight;return this.renderedLength=Math.ceil(e/this.itemSize)+this.bufferCount,this.renderedLength},h.prototype.renderVirtualTrack=function(e){var t,i=B.createElement("div",{className:xi});this.isHorizontalScroll?(t=this.parent.activeView.colLevels[this.parent.activeView.colLevels.length-1].length,i.style.width=t*this.itemSize+"px"):i.style.height=this.parent.resourceBase.expandedResources.length*this.itemSize+"px",e.appendChild(i)},h.prototype.updateVirtualScrollHeight=function(){var e=this.parent.element.querySelector("."+xi),t=this.parent.resourceBase.expandedResources[this.parent.resourceBase.expandedResources.length-1].groupIndex;this.parent.resourceBase.renderedResources[this.parent.resourceBase.renderedResources.length-1].groupIndex!==t?(t=this.parent.element.querySelector("."+C),this.renderedLength=t.querySelector("tbody").children.length,e.style.height=t.offsetHeight+(this.parent.resourceBase.expandedResources.length-this.renderedLength)*t.offsetHeight/this.renderedLength+"px",t=this.parent.element.querySelector("."+A),3===this.bufferCount&&t.scrollHeight-t.scrollTop<t.offsetHeight*this.bufferCount&&(e.style.height=parseInt(e.style.height,10)+t.offsetHeight*this.bufferCount+"px")):e.style.height="",this.averageRowHeight=e.offsetHeight/this.parent.resourceBase.expandedResources.length},h.prototype.updateVirtualTrackHeight=function(e){var t,i,n,r=this.parent.resourceBase.renderedResources.length;r!==this.getRenderedCount()?(e.style.height=this.parent.element.querySelector(".e-content-wrap").clientHeight+"px",i=this.parent.element.querySelector("."+Wt),n=this.parent.element.querySelector("."+A),t=this.parent.element.querySelector("."+Ft),this.translateY=0,this.setTranslate(i,n,t)):(i=this.parent.resourceBase.renderedResources[r-1].groupIndex,n=(n=r+(this.parent.resourceBase.expandedResources[this.parent.resourceBase.expandedResources.length-1].groupIndex-i))>this.parent.resourceBase.expandedResources.length?this.parent.resourceBase.expandedResources.length:n,e.style.height=n*this.itemSize+"px")},h.prototype.setItemSize=function(){this.isHorizontalScroll?this.itemSize=Le(this.parent.activeView.element,O,this.parent.uiStateValues.isTransformed)||this.itemSize:this.itemSize=this.parent.getElementHeightFromClass(this.parent.activeView.element,O)||this.itemSize},h.prototype.refreshLayout=function(){var e,t,i,n=this.parent.uiStateValues.scheduleHeight,r=(this.parent.uiStateValues.scheduleHeight=this.parent.element.offsetHeight,this.renderedLength);this.parent.uiStateValues.scheduleHeight!==n&&(r<this.getRenderedCount()&&(this.isRemoteRefresh=!0),n=this.parent.element.querySelector("."+Wt),r=this.parent.element.querySelector("."+A),e=this.parent.element.querySelector("."+Ft),this.parent.rowAutoHeight||(this.enableTransition=!1,B.removeClass([r,n],"e-transition")),i=(i=(t=(i=parseInt(n.querySelector("tbody td").getAttribute("data-group-index"),10))+this.renderedLength)>this.parent.resourceBase.expandedResources.length?this.parent.resourceBase.expandedResources.length-this.renderedLength:i)<0?0:i,this.existingDataCollection=this.parent.resourceBase.renderedResources,this.parent.resourceBase.renderedResources=this.parent.resourceBase.expandedResources.slice(i,t),0<this.parent.resourceBase.renderedResources.length)&&this.updateContent(n,r,e,this.parent.resourceBase.renderedResources)},h.prototype.renderEvents=function(){this.setTabIndex();var e=this.triggerScrollEvent(ve);if(this.parent.activeViewOptions&&this.parent.activeViewOptions.enableLazyLoading&&this.parent.crudModule)return 0<e.length?(this.parent.crudModule.refreshProcessedData(!0,e),void this.parent.hideSpinner()):void this.parent.crudModule.refreshDataManager();this.parent.crudModule&&this.parent.crudModule.refreshProcessedData(!0),"Month"!==this.parent.currentView&&this.parent.notify(Ve,{}),this.parent.hideSpinner()},h.prototype.virtualScrolling=function(){var e,t,i,n,r,a,s=this,o=(this.parent.quickPopup&&(this.parent.quickPopup.quickPopupHide(),this.parent.quickPopup.morePopup.hide()),this.parent.element.querySelector("."+A));this.isHorizontalScroll?this.horizontalScrolling(o):(e=this.parent.element.querySelector("."+Wt),t=this.parent.element.querySelector("."+Ft),i=this.parent.element.querySelector("."+ii),a=this.parent.element.querySelector("."+C),this.parent.rowAutoHeight||B.addClass([o,e],"e-transition"),this.renderedLength=e.querySelector("tbody").children.length,n=parseInt(e.querySelector("tbody td").getAttribute("data-group-index"),10),a=this.parent.rowAutoHeight?a.offsetHeight-o.offsetHeight:this.bufferCount*this.itemSize,r=[],this.existingDataCollection=this.parent.resourceBase.renderedResources,o.scrollTop-this.translateY<0?r=this.upScroll(o,n):(o.scrollTop+o.clientHeight>=o.scrollHeight-this.itemSize||o.scrollTop>this.translateY+a)&&(r=this.downScroll(o,n)),!B.isNullOrUndefined(r)&&0<r.length&&(this.triggerScrollEvent(me),a=this.parent.getSelectedCells(),this.focusedEle=a[a.length-1]||this.focusedEle,this.updateContent(e,o,t,r),this.setTranslate(e,o,t,i),this.parent.dragAndDropModule&&"drag"===this.parent.dragAndDropModule.actionObj.action&&this.parent.dragAndDropModule.navigationWrapper(),window.clearTimeout(this.timeValue),this.timeValue=window.setTimeout(function(){s.renderEvents()},250)))},h.prototype.horizontalScrolling=function(e){var t=this,i=[],n=this.bufferCount*this.itemSize;Math.abs(e.scrollLeft)-Math.abs(this.translateY)<0?i=this.leftScroll(e):Math.abs(e.scrollLeft)-Math.abs(this.translateY)>n&&(i=this.rightScroll(e)),!B.isNullOrUndefined(i)&&0<i.length&&(this.parent.resourceBase.expandedResources.length===i.length&&this.parent.resourceBase.expandedResources[0]===i[0]&&this.parent.resourceBase.expandedResources[this.parent.resourceBase.expandedResources.length-1]===i[i.length-1]||(this.triggerScrollEvent(me),n=this.parent.activeView.colLevels.slice(0),this.updateHorizontalContent(e,i),B.setStyleAttribute(e.querySelector("table"),{transform:"translateX("+this.translateY+"px)"}),this.parent.activeView.colLevels=n,this.parent.dragAndDropModule&&"drag"===this.parent.dragAndDropModule.actionObj.action&&this.parent.dragAndDropModule.navigationWrapper()),window.clearTimeout(this.timeValue),this.timeValue=window.setTimeout(function(){t.renderEvents()},250))},h.prototype.triggerScrollEvent=function(t){var e,i=this,n=[];return this.parent.activeView&&(e={startDate:this.parent.activeView.startDate(),endDate:this.parent.activeView.endDate(),startIndex:this.parent.resourceBase.renderedResources[0].groupIndex,endIndex:this.parent.resourceBase.renderedResources[this.parent.resourceBase.renderedResources.length-1].groupIndex,resourceData:this.parent.resourceBase.renderedResources.map(function(e){return e.resourceData}),name:t},this.parent.trigger(t,e,function(e){t===me?i.parent.showSpinner():t===ve&&!B.isNullOrUndefined(e.eventData)&&0<e.eventData.length&&(n=e.eventData)})),n},h.prototype.upScroll=function(e,t){var i=0,i=~~(e.scrollTop/this.itemSize)+Math.ceil(e.clientHeight/this.itemSize)-this.renderedLength,n=(this.parent.rowAutoHeight&&(i=t<i?t-this.bufferCount:i),this.getBufferCollection(i=0<i?i:0,i+this.renderedLength));return this.parent.resourceBase.renderedResources=n,0===t?this.translateY=e.scrollTop:(t=0<(t=this.parent.rowAutoHeight?this.averageRowHeight:this.itemSize)?t:this.itemSize,this.translateY=0<e.scrollTop-this.bufferCount*t?e.scrollTop-this.bufferCount*t:0,this.parent.rowAutoHeight&&0===this.translateY&&0!==i&&(n=this.getBufferCollection(0,this.renderedLength),this.parent.resourceBase.renderedResources=n)),n},h.prototype.downScroll=function(e,t){var i;return this.parent.resourceBase.renderedResources[this.parent.resourceBase.renderedResources.length-1].groupIndex===this.parent.resourceBase.expandedResources[this.parent.resourceBase.expandedResources.length-1].groupIndex?null:(i=0,i=~~(e.scrollTop/this.itemSize),t=(t=(i=this.parent.rowAutoHeight?(i=~~((e.scrollTop-this.translateY)/this.averageRowHeight)+t)>t+this.bufferCount?i:t+this.bufferCount:i)+this.renderedLength)>this.parent.resourceBase.expandedResources.length?i+(this.parent.resourceBase.expandedResources.length-i):t,i=this.getBufferCollection(t-this.renderedLength,t),this.translateY=e.scrollTop,i)},h.prototype.leftScroll=function(e){e=~~(Math.abs(e.scrollLeft)/this.itemSize)+Math.ceil(e.clientWidth/this.itemSize)-this.renderedLength;return this.getCollection(e=0<e?e:0,e+this.renderedLength)},h.prototype.rightScroll=function(e){var t=this.parent.activeView.colLevels[this.parent.activeView.colLevels.length-1],e=(e=~~(Math.abs(e.scrollLeft)/this.itemSize)+this.renderedLength)>t.length-1?t.length-1:e;return this.getCollection(e-this.renderedLength,e)},h.prototype.getCollection=function(e,t){this.translateY=e*this.itemSize;e=this.getResCollection(e=e<0?0:e,t);return this.parent.enableRtl&&(this.translateY=-this.translateY),e},h.prototype.getResCollection=function(e,t){var i=this.parent.activeView.colLevels[this.parent.activeView.colLevels.length-1],n=(t=t>i.length?i.length-1:t,[]),r={startIndex:0,endIndex:0};if(this.parent.activeViewOptions.group.byDate){if(i[parseInt(e.toString(),10)].date.getTime()===this.parent.resourceBase.expandedResources[0].date.getTime()&&i[parseInt(t.toString(),10)].date.getTime()===this.parent.resourceBase.expandedResources[this.parent.resourceBase.expandedResources.length-1].date.getTime())return this.parent.resourceBase.expandedResources;n=this.getByDateCollection(i[parseInt(e.toString(),10)],i[parseInt(t.toString(),10)],r),this.setRenderedDates(n)}else{if(i[parseInt(e.toString(),10)].groupIndex===this.parent.resourceBase.expandedResources[0].groupIndex&&i[parseInt(t.toString(),10)].groupIndex===this.parent.resourceBase.expandedResources[this.parent.resourceBase.expandedResources.length-1].groupIndex)return this.parent.resourceBase.expandedResources;n=this.getByIdCollection(i[parseInt(e.toString(),10)],i[parseInt(t.toString(),10)],r)}return"Month"!==this.parent.currentView&&(this.startIndex=r.startIndex,n=i.slice(r.startIndex,r.endIndex)),this.translateY=r.startIndex*this.itemSize,n},h.prototype.getByDateCollection=function(t,i,e){var n=this.parent.activeView.colLevels[0].filter(function(e){return t.date.getTime()<=e.date.getTime()&&e.date.getTime()<=i.date.getTime()});return this.setStartEndIndex(this.parent.activeView.colLevels[0],n[0],n[n.length-1],e),n},h.prototype.getByIdCollection=function(t,i,e){var n=this.parent.resourceBase.lastResourceLevel.filter(function(e){return t.groupIndex<=e.groupIndex&&e.groupIndex<=i.groupIndex});return this.parent.resourceBase.renderedResources=n,this.setStartEndIndex(this.parent.resourceBase.lastResourceLevel,n[0],n[n.length-1],e),n},h.prototype.setStartEndIndex=function(e,t,i,n){var r=0;e.filter(function(e){t===e?n.startIndex=r:i===e&&(n.endIndex=r+e.colSpan),r+=e.colSpan}),t===i&&(n.endIndex=n.startIndex+i.colSpan)},h.prototype.updateContent=function(e,t,i,n){var r=e.querySelector("tbody").children.length;document.activeElement&&document.activeElement.classList.contains(Kt)&&(this.isResourceCell=!0,this.parent.element.focus());for(var a=0;a<r;a++)B.remove(i.querySelector("div"));this.parent.resourceBase.renderedResources=n;for(var s=this.parent.activeView.getGroupIndices(n),o=this.parent.activeView.getGroupIndices(this.existingDataCollection),l=s.filter(function(e){return o.indexOf(e)<0}),p=Array.from(e.querySelectorAll("tbody tr")),c=Array.from(t.querySelectorAll("tbody tr")),h=e.querySelector("tbody"),d=t.querySelector("tbody"),u=(this.removeObsoleteRows(p,s),this.removeObsoleteRows(c,s),this.parent.resourceBase.getContentRows(n,!0)),g=(this.parent.isReact&&this.parent.renderTemplates(),this.parent.activeView.getContentRows()),e=this.parent.activeView.getEventRows(n.length),a=0;a<l.length;a++){var m=s.indexOf(l[parseInt(a.toString(),10)]);0===m?(B.prepend([u[parseInt(a.toString(),10)]],h),B.prepend([g[parseInt(a.toString(),10)]],d)):h&&d&&h.children[parseInt(m.toString(),10)]&&d.children[parseInt(m.toString(),10)]?(h.insertBefore(u[parseInt(a.toString(),10)],h.children[parseInt(m.toString(),10)]),d.insertBefore(g[parseInt(a.toString(),10)],d.children[parseInt(m.toString(),10)])):(B.append([u[parseInt(a.toString(),10)]],h),B.append([g[parseInt(a.toString(),10)]],d))}B.append(e,i)},h.prototype.removeObsoleteRows=function(e,i){e.forEach(function(e){var t=parseInt(e.firstElementChild.getAttribute("data-group-index"),10);i.indexOf(t)<0&&B.remove(e)})},h.prototype.updateHorizontalContent=function(e,t){this.existingDataCollection=this.parent.resourceBase.expandedResources,this.parent.resourceBase.expandedResources=t;var i=this.parent.getSelectedCells(),i=(this.focusedEle=i[i.length-1]||this.focusedEle,e.querySelector("tbody")),i=Array.from(i.querySelectorAll("tr"));"Month"===this.parent.currentView?this.updateMonthViewContent(e,t):this.updateOtherViewContent(e,t,i)},h.prototype.updateMonthViewContent=function(e,t){for(var i=e.querySelectorAll(" tr").length,n=0;n<i;n++)B.remove(e.querySelector("tbody tr"));this.parent.activeViewOptions.group.byDate?this.parent.activeView.colLevels[0]=t:this.parent.activeView.colLevels[this.parent.activeView.colLevels.length-2]=t;t=this.parent.activeView.getContentRows();B.append(t,e.querySelector("tbody"))},h.prototype.updateOtherViewContent=function(e,t,i){for(var n=e.querySelector("tbody"),r=e.querySelector("colgroup"),a=e.querySelector("thead"),s=e.querySelector("table"),o=(this.parent.activeView.colLevels[this.parent.activeView.colLevels.length-1]=t,new Set(t.map(function(e){return e.groupIndex}))),l=(i.forEach(function(e){e.querySelectorAll("td").forEach(function(e){var t=parseInt(e.getAttribute("data-group-index"),10);o.has(t)||e.remove()})}),[].slice.call(e.querySelector("colgroup").children)),p=0;p<l.length;p++)B.remove(l[parseInt(p.toString(),10)]);t.forEach(function(){return r.appendChild(B.createElement("col"))});for(var c=[].slice.call(e.querySelector("thead").children),p=0;p<c.length;p++)B.remove(c[parseInt(p.toString(),10)]);a.appendChild(this.parent.eventBase.createEventWrapper("",0<this.startIndex?this.startIndex:0)),this.parent.activeViewOptions.timeScale.enable&&a.appendChild(this.parent.eventBase.createEventWrapper("timeIndicator")),B.prepend([a],s);i=this.parent.activeView.getContentRows();this.mergeNewTdData(n,i)},h.prototype.mergeNewTdData=function(e,t){Array.from(e.querySelectorAll("tr")).forEach(function(s,e){var o;e<t.length&&(e=t[parseInt(e.toString(),10)],o=Array.from(s.querySelectorAll("td")),Array.from(e.querySelectorAll("td")).forEach(function(e){for(var t=parseInt(e.getAttribute("data-group-index").toString(),10),i=!1,n=0,r=o;n<r.length;n++){var a=r[n];if(t<parseInt(a.getAttribute("data-group-index").toString(),10)){s.insertBefore(e,a),i=!0;break}}i||s.appendChild(e)}))})},h.prototype.getBufferCollection=function(e,t){return this.parent.resourceBase.expandedResources.slice(e,t)},h.prototype.setTranslate=function(e,t,i,n){B.setStyleAttribute(e.querySelector("table"),{transform:"translateY("+this.translateY+"px)"}),B.setStyleAttribute(t.querySelector("table"),{transform:"translateY("+this.translateY+"px)"}),B.setStyleAttribute(i,{transform:"translateY("+this.translateY+"px)"}),B.isNullOrUndefined(n)||B.setStyleAttribute(n,{transform:"translateY("+this.translateY+"px)"})},h.prototype.updateFocusedWorkCell=function(){var e,t;this.focusedEle&&(t=parseInt(this.focusedEle.getAttribute("data-date"),10),e=parseInt(this.focusedEle.getAttribute("data-group-index"),10),(t=this.parent.element.querySelector("."+O+'[data-date="'+t+'"][data-group-index="'+e+'"]'))&&this.parent.addSelectedClass([t],t,!0),this.focusedEle=null)},h.prototype.setRenderedDates=function(e){var t,i,n;"Month"!==this.parent.currentView?(t=e.map(function(e){return e.date}),this.parent.resourceBase.renderedResources.forEach(function(e){return e.renderDates=t})):(i=e.map(function(e){return e.date.getDay()}),n=this.parent.activeView.renderDates.filter(function(e){return 0<=i.indexOf(e.getDay())}),this.parent.resourceBase.renderedResources.forEach(function(e){return e.renderDates=n}))},h.prototype.setTabIndex=function(){var t=this.parent.element.querySelector("."+Wt),e=[].slice.call(this.parent.element.querySelectorAll("."+Kt)),e=(e&&t&&e.forEach(function(e){e.getBoundingClientRect().top>=t.getBoundingClientRect().top&&e.setAttribute("tabindex","0")}),this.parent.element.querySelector("."+Kt+'[tabindex="0"]'));this.isResourceCell&&e&&(e.focus(),this.isResourceCell=!1)},h.prototype.destroy=function(){this.removeEventListener(),this.focusedEle=null};var vo=h;function h(e){this.translateY=0,this.itemSize=60,this.renderedLength=0,this.averageRowHeight=0,this.startIndex=0,this.existingDataCollection=[],this.enableTransition=!0,this.parent=e,this.bufferCount=e.activeViewOptions.overscanCount<3?3:e.activeViewOptions.overscanCount,this.addEventListener()}yo.prototype.render=function(e,t){void 0===t&&(t=!0),this.initializeLayout(e),this.parent.activeView&&t&&this.parent.crudModule.refreshDataManager()},yo.prototype.initializeLayout=function(e){switch(this.parent.activeView&&(t=["cellTemplate","tooltipTemplate","majorSlotTemplate","minorSlotTemplate","headerTooltipTemplate","dateHeaderTemplate","dayHeaderTemplate","monthHeaderTemplate","headerIndentTemplate","resourceHeaderTemplate","cellHeaderTemplate","dateRangeTemplate"],0<this.parent.activeEventTemplates.length?(t=t.concat(this.parent.activeEventTemplates),this.parent.activeEventTemplates=[]):t.push("eventTemplate"),this.parent.resetTemplates(t),this.parent.activeView.removeEventListener(),this.parent.activeView.destroy()),e){case"Day":this.parent.activeView=this.parent.dayModule;break;case"Week":this.parent.activeView=this.parent.weekModule;break;case"WorkWeek":this.parent.activeView=this.parent.workWeekModule;break;case"Month":this.parent.activeView=this.parent.monthModule;break;case"Year":this.parent.activeView=this.parent.yearModule;break;case"Agenda":this.parent.activeView=this.parent.agendaModule;break;case"MonthAgenda":this.parent.activeView=this.parent.monthAgendaModule;break;case"TimelineDay":this.parent.activeView=this.parent.timelineViewsModule,B.isNullOrUndefined(this.parent.activeView)||(this.parent.activeView.viewClass="e-timeline-day-view");break;case"TimelineWorkWeek":this.parent.activeView=this.parent.timelineViewsModule,B.isNullOrUndefined(this.parent.activeView)||(this.parent.activeView.viewClass="e-timeline-work-week-view");break;case"TimelineWeek":this.parent.activeView=this.parent.timelineViewsModule,B.isNullOrUndefined(this.parent.activeView)||(this.parent.activeView.viewClass="e-timeline-week-view");break;case"TimelineMonth":this.parent.activeView=this.parent.timelineMonthModule;break;case"TimelineYear":this.parent.activeView=this.parent.timelineYearModule}if(B.isNullOrUndefined(this.parent.activeView)){var t=this.parent.viewCollections[0].option;if(t)return this.parent.setProperties({currentView:t},!0),this.parent.headerModule&&(this.parent.headerModule.updateActiveView(),this.parent.headerModule.setCalendarView()),console.warn('[WARNING] :: Module "'+e+'" is not available in Schedule component! You either misspelled the module name or forgot to load it.'),this.initializeLayout(t);throw Error("Inject required modules")}this.parent.uiStateValues.scheduleHeight=this.parent.element.offsetHeight,this.parent.activeView.viewIndex=this.parent.viewIndex,this.updateLabelText(e),this.parent.activeView.addEventListener(),this.parent.activeView.getRenderDates(),this.parent.uiStateValues.isGroupAdaptive=0<this.parent.activeViewOptions.group.resources.length&&(this.parent.enableAdaptiveUI&&!this.parent.isAdaptive||this.parent.isAdaptive&&this.parent.activeViewOptions.group.enableCompactView),this.parent.virtualScrollModule&&(this.parent.virtualScrollModule.destroy(),this.parent.virtualScrollModule=null),(-1===["Agenda","MonthAgenda","Year","TimelineYear"].indexOf(this.parent.currentView)||"TimelineYear"===this.parent.currentView&&"Vertical"===this.parent.activeViewOptions.orientation)&&this.parent.activeViewOptions.allowVirtualScrolling&&0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive&&(this.parent.virtualScrollModule=new vo(this.parent),this.parent.activeView.isTimelineView()?this.parent.uiStateValues.top=0:(this.parent.virtualScrollModule.isHorizontalScroll=!0,this.parent.uiStateValues.left=0)),this.updateHeader(),this.parent.currentTimezoneDate=this.parent.getCurrentTime(),this.parent.activeView.renderLayout(Ht),this.parent.renderTemplates(),this.parent.eventTooltip&&(this.parent.eventTooltip.destroy(),this.parent.eventTooltip=null),(this.parent.eventSettings.enableTooltip||0<this.parent.activeViewOptions.group.resources.length&&this.parent.activeViewOptions.group.headerTooltipTemplate)&&(this.parent.eventTooltip=new ss(this.parent))},yo.prototype.updateHeader=function(){this.parent.headerModule&&(this.parent.headerModule.setDayOfWeek(this.parent.activeViewOptions.firstDayOfWeek),this.parent.activeViewOptions.readonly?B.addClass([this.parent.element],Rr):this.parent.element.classList.contains(Rr)&&B.removeClass([this.parent.element],Rr),this.parent.headerModule.updateDateRange(),this.parent.headerModule.updateHeaderItems("remove"))},yo.prototype.updateLabelText=function(e){this.parent.element.setAttribute("role","application"),this.parent.element.removeAttribute("aria-labelledby"),this.parent.element.removeAttribute("aria-label"),"Year"===e?this.parent.element.setAttribute("aria-label",this.parent.activeView.getLabelText(e)):this.parent.element.setAttribute("aria-labelledby",this.parent.element.id+"_table")};var fo=yo;function yo(e){this.parent=e}To=function(e,t){return(To=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var To,wo,cs=function(e,t){function i(){this.constructor=e}To(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},hs=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;0<=o;o--)(r=e[o])&&(s=(a<3?r(s):3<a?r(t,i,s):r(t,i))||s);return 3<a&&s&&Object.defineProperty(t,i,s),s},cs=(wo=B.ChildProperty,cs(Do,wo),hs([B.Property(!0)],Do.prototype,"highlight",void 0),hs([B.Property("09:00")],Do.prototype,"start",void 0),hs([B.Property("18:00")],Do.prototype,"end",void 0),Do);function Do(){return null!==wo&&wo.apply(this,arguments)||this}bo=function(e,t){return(bo=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var bo,So,hs=function(e,t){function i(){this.constructor=e}bo(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Co=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;0<=o;o--)(r=e[o])&&(s=(a<3?r(s):3<a?r(t,i,s):r(t,i))||s);return 3<a&&s&&Object.defineProperty(t,i,s),s},hs=(So=B.ChildProperty,hs(Oo,So),Co([B.Property(!0)],Oo.prototype,"enable",void 0),Co([B.Property(60)],Oo.prototype,"interval",void 0),Co([B.Property(2)],Oo.prototype,"slotCount",void 0),Co([B.Property()],Oo.prototype,"minorSlotTemplate",void 0),Co([B.Property()],Oo.prototype,"majorSlotTemplate",void 0),Oo);function Oo(){return null!==So&&So.apply(this,arguments)||this}Eo=function(e,t){return(Eo=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var Eo,xo,Co=function(e,t){function i(){this.constructor=e}Eo(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Vo=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;0<=o;o--)(r=e[o])&&(s=(a<3?r(s):3<a?r(t,i,s):r(t,i))||s);return 3<a&&s&&Object.defineProperty(t,i,s),s},Co=(xo=B.ChildProperty,Co(Ao,xo),Vo([B.Property("Both")],Ao.prototype,"templateType",void 0),Vo([B.Property()],Ao.prototype,"header",void 0),Vo([B.Property()],Ao.prototype,"content",void 0),Vo([B.Property()],Ao.prototype,"footer",void 0),Ao);function Ao(){return null!==xo&&xo.apply(this,arguments)||this}Io=function(e,t){return(Io=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var Io,Mo,Vo=function(e,t){function i(){this.constructor=e}Io(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},ko=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;0<=o;o--)(r=e[o])&&(s=(a<3?r(s):3<a?r(t,i,s):r(t,i))||s);return 3<a&&s&&Object.defineProperty(t,i,s),s},Vo=(Mo=B.ChildProperty,Vo(Ro,Mo),ko([B.Property()],Ro.prototype,"option",void 0),ko([B.Property()],Ro.prototype,"template",void 0),Ro);function Ro(){return null!==Mo&&Mo.apply(this,arguments)||this}Po.prototype.getQuery=function(){var e=this.parent.activeView.startDate(),t=this.parent.activeView.endDate();return this.parent.dataModule.generateQuery(e,t)},Po.prototype.getTable=function(){return this.parent.eventSettings.query?this.parent.eventSettings.query.clone().fromTable:null},Po.prototype.refreshDataManager=function(){var e,t,i=this;this.parent.activeView&&(this.parent.uiStateValues&&this.parent.uiStateValues.isPreventEventRefresh?(this.parent.uiStateValues.isPreventEventRefresh=!1,this.parent.refreshEvents(!1),this.parent.hideSpinner()):(e=this.parent.activeView.startDate(),t=this.parent.activeView.endDate(),this.parent.dataModule.getData(this.parent.dataModule.generateQuery(e,t)).then(function(e){return i.dataManagerSuccess(e)}).catch(function(e){return i.dataManagerFailure(e)})))},Po.prototype.dataManagerSuccess=function(e){var t=this;!this.parent||this.parent&&this.parent.isDestroyed||this.parent.trigger(ne,e,function(e){e.cancel||(e=B.extend([],e.result,null,!0),t.parent.eventsData=e.filter(function(e){return!e[t.parent.eventFields.isBlock]}),t.parent.blockData=e.filter(function(e){return e[t.parent.eventFields.isBlock]}),t.refreshProcessedData(),t.parent.dragAndDropModule&&"drag"===t.parent.dragAndDropModule.actionObj.action&&t.parent.dragAndDropModule.navigationWrapper(),t.parent.trigger(re,null,function(){t.parent.hideSpinner(),t.parent.isPrinting&&setTimeout(function(){t.parent.notify(Oe,{})},100)}))})},Po.prototype.dataManagerFailure=function(e){var t=this;!this.parent||this.parent&&this.parent.isDestroyed||this.parent.trigger(Z,{error:e},function(){return t.parent.hideSpinner()})},Po.prototype.refreshProcessedData=function(e,t){if(void 0===e&&(e=!1),this.parent.dragAndDropModule&&(this.parent.dragAndDropModule.actionObj.action="",B.removeClass([this.parent.element],"e-event-action")),this.parent.activeViewOptions&&this.parent.activeViewOptions.eventTemplate){var i=["eventTemplate"];if(this.crudObj.isCrudAction&&-1===["Agenda","MonthAgenda","Year","TimelineYear"].indexOf(this.parent.currentView))for(var i=[],n=0,r=this.crudObj.sourceEvent.length;n<r;n++)i.push("eventTemplate_"+this.crudObj.sourceEvent[parseInt(n.toString(),10)].groupIndex),this.crudObj.targetEvent[parseInt(n.toString(),10)]&&this.crudObj.sourceEvent[parseInt(n.toString(),10)].groupIndex!==this.crudObj.targetEvent[parseInt(n.toString(),10)].groupIndex&&i.push("eventTemplate_"+this.crudObj.targetEvent[parseInt(n.toString(),10)].groupIndex);0<i.length&&this.parent.resetTemplates(i)}e?this.parent.notify(Ee,{processedData:t?this.parent.eventBase.processData(t):this.parent.eventsProcessed}):(e=this.parent.eventsData||[],t=this.parent.blockData||[],e=e.concat(t),this.parent.notify(Ee,{processedData:this.parent.eventBase?this.parent.eventBase.processData(e):[]}))},Po.prototype.refreshData=function(i){var t=this,e={requestType:i.requestType,cancel:!1,data:i.data,addedRecords:i.editParams.addedRecords,changedRecords:i.editParams.changedRecords,deletedRecords:i.editParams.deletedRecords};if(this.parent.dragAndDropModule&&this.parent.dragAndDropModule.actionObj&&this.parent.dragAndDropModule.actionObj.element&&this.parent.dragAndDropModule.actionObj.action&&(this.parent.dragAndDropModule.actionObj.element.style.display="none"),this.parent.resizeModule&&this.parent.resizeModule.actionObj&&this.parent.resizeModule.actionObj.element&&this.parent.resizeModule.actionObj.action&&(this.parent.resizeModule.actionObj.element.style.display="none"),this.parent.isSpecificResourceEvents()&&("eventCreated"===i.requestType||"eventRemoved"===i.requestType)){this.crudObj.isCrudAction=!0,this.crudObj.sourceEvent=[];for(var n=i.data instanceof Array?0===i.data.length&&"eventRemoved"===i.requestType?i.editParams.deletedRecords:i.data:"string"!=typeof i.data&&"number"!=typeof i.data||"eventRemoved"!==i.requestType?[i.data]:i.editParams.deletedRecords,r=this,a=0,s=n;a<s.length;a++)!function(e){r.crudObj.isCrudAction=!("eventRemoved"===i.requestType&&!B.isNullOrUndefined(e.parent));var t=r.parent.eventBase.getGroupIndexFromEvent(e);-1<t&&0===r.parent.crudModule.crudObj.sourceEvent.filter(function(e){return e.groupIndex===t}).length&&r.crudObj.isCrudAction&&r.crudObj.sourceEvent.push(r.parent.resourceBase.lastResourceLevel[parseInt(t.toString(),10)])}(s[a]);this.crudObj.targetEvent=this.crudObj.sourceEvent}this.parent.dataModule.dataManager.dataSource.offline?this.parent.trigger(K,e,function(e){e.cancel||t.refreshDataManager()}):i.promise.then(function(){!t.parent||t.parent&&t.parent.isDestroyed||t.parent.trigger(K,e,function(e){e.cancel||t.refreshDataManager()})}).catch(function(e){!t.parent||t.parent&&t.parent.isDestroyed||t.parent.trigger(Z,{error:e})})},Po.prototype.processAddEvent=function(e){var t,i=this.parent.eventFields,n={addedRecords:[],changedRecords:[],deletedRecords:[]};if(e.addedRecords instanceof Array){for(var r=0,a=e.addedRecords;r<a.length;r++){var s=a[r],s=this.parent.eventBase.updateEventDateTime(s),s=B.extend({},this.parent.eventBase.processTimezone(s,!0),null,!0);n.addedRecords.push(s)}t=this.parent.dataModule.dataManager.saveChanges(n,i.id,this.getTable(),this.getQuery())}else{i=this.parent.eventBase.processTimezone(e.addedRecords,!0);n.addedRecords.push(i),t=this.parent.dataModule.dataManager.insert(i,this.getTable(),this.getQuery())}i={requestType:"eventCreated",cancel:!1,data:e.addedRecords,promise:t,editParams:n};this.refreshData(i)},Po.prototype.processSaveEvent=function(e){var t,i=this.parent.eventFields,n={addedRecords:[],changedRecords:[],deletedRecords:[]};if(e.changedRecords instanceof Array){for(var r=0,a=e.changedRecords;r<a.length;r++){var s=a[r],s=this.parent.eventBase.updateEventDateTime(s),s=B.extend({},this.parent.eventBase.processTimezone(s,!0),null,!0);n.changedRecords.push(s)}t=this.parent.dataModule.dataManager.saveChanges(n,i.id,this.getTable(),this.getQuery())}else{var o=this.parent.eventBase.processTimezone(e.changedRecords,!0);n.changedRecords.push(o),t=this.parent.dataModule.dataManager.update(i.id,o,this.getTable(),this.getQuery())}i=B.extend({},e.changedRecords[e.changedRecords.length-1],null,!0),this.parent.eventBase.selectWorkCellByTime([this.parent.eventBase.processTimezone(i)]),o={requestType:"eventChanged",cancel:!1,data:e.changedRecords,promise:t,editParams:n};this.refreshData(o)},Po.prototype.processDeleteEvent=function(e){var t=this.parent.eventFields,i={addedRecords:[],changedRecords:[],deletedRecords:[]},t=1<e.deletedRecords.length?(i.deletedRecords=i.deletedRecords.concat(e.deletedRecords),this.parent.dataModule.dataManager.saveChanges(i,t.id,this.getTable(),this.getQuery())):(i.deletedRecords.push(e.deletedRecords[0]),this.parent.dataModule.dataManager.remove(t.id,e.deletedRecords[0],this.getTable(),this.getQuery())),e=(this.parent.eventBase.selectWorkCellByTime(e.deletedRecords),{requestType:"eventRemoved",cancel:!1,data:e.deletedRecords,promise:t,editParams:i});this.refreshData(e)},Po.prototype.addEvent=function(e){var i=this;this.parent.eventSettings.allowAdding&&!this.parent.activeViewOptions.readonly&&(!this.isBlockEvent(e)&&this.parent.eventBase.isBlockRange(e)?this.parent.quickPopup.openValidationError("blockAlert",e):this.parent.eventBase.checkOverlap(e)||0!==(e=e instanceof Array?e:[e]).length&&this.parent.trigger(Q,{requestType:"eventCreate",cancel:!1,data:e,addedRecords:e,changedRecords:[],deletedRecords:[]},function(t){t.cancel||(t.promise?t.promise.then(function(e){!i.parent||i.parent&&i.parent.isDestroyed||e&&i.processAddEvent(t)}).catch(function(e){!i.parent||i.parent&&i.parent.isDestroyed||i.parent.trigger(Z,{error:e})}):i.processAddEvent(t))}))},Po.prototype.saveEvent=function(e,t){var i=this;if(this.parent.eventSettings.allowEditing&&!this.parent.activeViewOptions.readonly)if("EditFollowingEvents"!==this.parent.currentAction&&!this.isBlockEvent(e)&&this.parent.eventBase.isBlockRange(e))this.parent.quickPopup.openValidationError("blockAlert",e),this.parent.crudModule.crudObj.isCrudAction=!1;else{var n=e instanceof Array?e:[e];if(0!==n.length)if(this.parent.currentAction=t)switch(t){case"Save":this.processSave(e);break;case"EditOccurrence":this.processOccurrences(e,t);break;case"EditFollowingEvents":this.processFollowSeries(e,t);break;case"EditSeries":this.processEntireSeries(e,t)}else this.parent.eventBase.checkOverlap(e)||this.parent.trigger(Q,{requestType:"eventChange",cancel:!1,data:e,addedRecords:[],changedRecords:n,deletedRecords:[]},function(t){t.cancel||(t.promise?t.promise.then(function(e){!i.parent||i.parent&&i.parent.isDestroyed||e&&i.processSaveEvent(t)}).catch(function(e){!i.parent||i.parent&&i.parent.isDestroyed||i.parent.trigger(Z,{error:e})}):i.processSaveEvent(t))})}},Po.prototype.deleteEvent=function(t,e){var i=this;if(this.parent.eventSettings.allowDeleting&&!this.parent.activeViewOptions.readonly){this.parent.currentAction=e;var n=[],n="string"==typeof t||"number"==typeof t?this.parent.eventsData.filter(function(e){return e[i.parent.eventFields.id]===t}):t instanceof Array?t:[t];if(0!==n.length)if(e)switch(e){case"Delete":this.processDelete(n);break;case"DeleteOccurrence":this.processOccurrences(n,e);break;case"DeleteFollowingEvents":this.processFollowSeries(n,e);break;case"DeleteSeries":this.processEntireSeries(n,e)}else this.parent.trigger(Q,{requestType:"eventRemove",cancel:!1,data:t,addedRecords:[],changedRecords:[],deletedRecords:n},function(t){t.cancel||(t.promise?t.promise.then(function(e){!i.parent||i.parent&&i.parent.isDestroyed||e&&i.processDeleteEvent(t)}).catch(function(e){!i.parent||i.parent&&i.parent.isDestroyed||i.parent.trigger(Z,{error:e})}):i.processDeleteEvent(t))})}},Po.prototype.processOccurrences=function(e,c){var h=this,r=[],d=!1;if(e instanceof Array)for(var t=0,i=e;t<i.length;t++){var n=i[t];r.push({occurrence:n,parent:this.getParentEvent(n)})}else r={occurrence:e,parent:this.getParentEvent(e)};e=e instanceof Array?e:[e],e={requestType:"EditOccurrence"===c?"eventChange":"eventRemove",cancel:!1,addedRecords:[],changedRecords:e,deletedRecords:[]};e.data=r,this.parent.trigger(Q,e,function(s){if(!s.cancel){for(var o=h.parent.eventFields,l={addedRecords:[],changedRecords:[],deletedRecords:[]},p=r instanceof Array?r:[r],e=0,t=s.changedRecords.length;e<t;e++)!function(e){var t,i,n=s.changedRecords[parseInt(e.toString(),10)],r=p[parseInt(e.toString(),10)].parent,a=r[o.recurrenceException];switch(c){case"EditOccurrence":t=h.parent.eventsProcessed.filter(function(e){return e.Guid===n.Guid})[0],((i=h.excludeDateCheck(t[o.startTime],a))!==r[o.recurrenceException]?(r[o.recurrenceException]=i,n[o.recurrenceException]=Wa(t[o.startTime]),n[o.recurrenceID]=r[o.id],n[o.followingID]=null,l.changedRecords.push(h.parent.eventBase.processTimezone(r,!0)),l.addedRecords):l.changedRecords).push(h.parent.eventBase.processTimezone(n,!0));break;case"DeleteOccurrence":n[o.recurrenceException]||(r[o.recurrenceException]=h.excludeDateCheck(n[o.startTime],a),l.changedRecords.push(h.parent.eventBase.processTimezone(r,!0))),n[o.id]!==r[o.id]&&(l.deletedRecords.push(h.parent.eventBase.processTimezone(n,!0)),d=!0)}}(e);var i=h.parent.dataModule.dataManager.saveChanges(l,o.id,h.getTable(),h.getQuery()),n=B.extend({},s.changedRecords[s.changedRecords.length-1],null,!0),n=(h.parent.eventBase.selectWorkCellByTime("EditOccurrence"===c?[h.parent.eventBase.processTimezone(n)]:[n]),{requestType:"EditOccurrence"===c?"eventChanged":"eventRemoved",cancel:!1,data:d?s.deletedRecords:s.changedRecords,promise:i,editParams:l});h.refreshData(n)}})},Po.prototype.processFollowSeries=function(e,c){var h=this,r=[];if(e instanceof Array)for(var t=0,i=e;t<i.length;t++){var n=i[t];r.push({occurrence:n,parent:this.getParentEvent(n)})}else r={occurrence:e,parent:this.getParentEvent(e)};e=e instanceof Array?e:[e],e={requestType:"EditFollowingEvents"===c?"eventChange":"eventRemove",cancel:!1,addedRecords:[],changedRecords:e,deletedRecords:[]};e.data=r,this.parent.trigger(Q,e,function(s){if(!s.cancel){for(var o=h.parent.eventFields,l={addedRecords:[],changedRecords:[],deletedRecords:[]},p=r instanceof Array?r:[r],e=0,t=s.changedRecords.length;e<t;e++)!function(e){var t,i,n=s.changedRecords[parseInt(e.toString(),10)],r=p[parseInt(e.toString(),10)].parent,a=h.parent.eventBase.getEventCollections(r,n);switch(c){case"EditFollowingEvents":h.processRecurrenceRule(r,n),t=!h.parent.eventBase.isFollowingEvent(r,n),n[o.followingID]=t?null:r[o.id],n[o.recurrenceID]=null,l.addedRecords.push(h.parent.eventBase.processTimezone(n,!0)),l.changedRecords.push(h.parent.eventBase.processTimezone(r,!0)),h.parent.uiStateValues.isIgnoreOccurrence||(n[o.recurrenceException]=null,0<a.occurrence.length&&-1===(i=a.occurrence.slice(-1)[0][o.recurrenceRule]).indexOf("COUNT")&&(n[o.recurrenceRule]=i),0<a.follow.length&&(n[o.recurrenceRule]=a.follow.slice(-1)[0][o.recurrenceRule],l.deletedRecords=l.deletedRecords.concat(a.follow)),t&&(a.occurrence=a.occurrence.filter(function(e){return e[o.recurrenceID]===r[o.id]})),l.deletedRecords=l.deletedRecords.concat(a.occurrence));break;case"DeleteFollowingEvents":h.processRecurrenceRule(r,n[o.startTime]),l.changedRecords.push(h.parent.eventBase.processTimezone(r,!0)),l.deletedRecords=l.deletedRecords.concat(a.occurrence).concat(a.follow)}}(e);var i=h.parent.dataModule.dataManager.saveChanges(l,o.id,h.getTable(),h.getQuery()),n=B.extend({},s.changedRecords[s.changedRecords.length-1],null,!0),n=(h.parent.eventBase.selectWorkCellByTime("EditFollowingEvents"===c?[h.parent.eventBase.processTimezone(n)]:[n]),{requestType:"EditFollowingEvents"===c?"eventChanged":"eventRemoved",cancel:!1,data:s.changedRecords,promise:i,editParams:l});h.refreshData(n)}})},Po.prototype.processEntireSeries=function(e,p){var c=this,h=[],d=!1;if(e instanceof Array)for(var t=0,i=e;t<i.length;t++){var n=i[t];h.push(this.getParentEvent(n,!0))}else h=this.getParentEvent(e,!0);var e=e instanceof Array?e:[e],r={requestType:"EditSeries"===p?"eventChange":"eventRemove",cancel:!1,addedRecords:[],changedRecords:[],deletedRecords:[]};if(r.data=h,"EditSeries"===p?r.changedRecords=e:r.deletedRecords=e,"EditSeries"===p&&!this.parent.uiStateValues.isIgnoreOccurrence)for(var a=h instanceof Array?h:[h],s=0,o=r.changedRecords.length;s<o;s++){var l=a[parseInt(s.toString(),10)],l=this.parent.eventBase.getEventCollections(l),l=l.follow.concat(l.occurrence);r.deletedRecords=r.deletedRecords.concat(l)}this.parent.trigger(Q,r,function(e){if(!e.cancel){for(var a=c.parent.eventFields,s={addedRecords:[],changedRecords:[],deletedRecords:[]},o=h instanceof Array?h:[h],l="EditSeries"===p?e.changedRecords:e.deletedRecords,t=0,i=l.length;t<i;t++)!function(e){var t,i=l[parseInt(e.toString(),10)],n=o[parseInt(e.toString(),10)],e=c.parent.eventBase.getEventCollections(n),r=e.follow.concat(e.occurrence);switch(p){case"EditSeries":i[a.id]=n[a.id],i[a.recurrenceID]=null,i[a.followingID]=null,c.parent.uiStateValues.isIgnoreOccurrence&&i[a.recurrenceException]?0<(t=c.parent.eventsData.filter(function(e){return e[a.id]===i[a.id]})).length&&(i[a.recurrenceRule]=t[0][a.recurrenceRule]):(i[a.recurrenceException]=null,s.deletedRecords=s.deletedRecords.concat(r)),s.changedRecords.push(c.parent.eventBase.processTimezone(i,!0)),c.parent.uiStateValues.isIgnoreOccurrence=!1;break;case"DeleteSeries":s.deletedRecords=s.deletedRecords.concat(r.concat(c.parent.eventBase.processTimezone(n,!0))),d=!0}}(t);var n=c.parent.dataModule.dataManager.saveChanges(s,a.id,c.getTable(),c.getQuery()),r=B.extend({},l[l.length-1],null,!0),r=(c.parent.eventBase.selectWorkCellByTime("EditSeries"===p?[c.parent.eventBase.processTimezone(r)]:[r]),{requestType:"EditSeries"===p?"eventChanged":"eventRemoved",cancel:!1,data:d?e.deletedRecords:e.changedRecords,promise:n,editParams:s});c.refreshData(r)}})},Po.prototype.processDelete=function(e){for(var d=this,u=[],t=0,i=e;t<i.length;t++){var n=i[t];n[this.parent.eventFields.recurrenceRule]?u.push({occurrence:n,parent:this.getParentEvent(n)}):u.push(n)}e={requestType:"eventRemove",cancel:!1,addedRecords:[],changedRecords:[],deletedRecords:e};e.data=u,this.parent.trigger(Q,e,function(p){if(!p.cancel){for(var c=d.parent.eventFields,h={addedRecords:[],changedRecords:[],deletedRecords:[]},e=B.extend([],p.deletedRecords,null,!0),t=0,i=p.deletedRecords.length;t<i;t++)!function(e){var t,i,n,r,a=B.isNullOrUndefined(p.deletedRecords[parseInt(e.toString(),10)][d.parent.eventFields.recurrenceRule]);if(a||(t=u[parseInt(e.toString(),10)].parent,i=h.changedRecords.filter(function(e){return e[c.id]===t[c.id]}),n=p.deletedRecords[parseInt(e.toString(),10)][c.startTime],0<i.length?(r=i[0])[c.recurrenceException]=d.excludeDateCheck(n,r[c.recurrenceException]):t[c.recurrenceException]=d.excludeDateCheck(n,t[c.recurrenceException]),0===i.length&&h.changedRecords.push(d.parent.eventBase.processTimezone(t,!0)),a=p.deletedRecords[parseInt(e.toString(),10)][c.id]!==t[c.id]),a){if(p.deletedRecords instanceof Array)for(var s=0,o=p.deletedRecords;s<o.length;s++){var l=o[s];d.parent.eventBase.processTimezone(l,!0)}h.deletedRecords.push(p.deletedRecords[parseInt(e.toString(),10)])}}(t);var n=d.parent.dataModule.dataManager.saveChanges(h,c.id,d.getTable(),d.getQuery()),e=(d.parent.eventBase.selectWorkCellByTime(e),{requestType:"eventRemoved",cancel:!1,data:p.deletedRecords,promise:n,editParams:h});d.refreshData(e)}})},Po.prototype.processSave=function(e){for(var c=this,e=e instanceof Array?e:[e],t=[],i=0,n=e;i<n.length;i++){var r=n[i];r[this.parent.eventFields.recurrenceRule]?t.push({occurrence:r,parent:this.getParentEvent(r)}):t.push(r)}e={requestType:"eventChange",cancel:!1,addedRecords:[],changedRecords:e,deletedRecords:[]};e.data=t,this.parent.trigger(Q,e,function(e){if(!e.cancel){for(var t=c.parent.eventFields,i={addedRecords:[],changedRecords:[],deletedRecords:[]},n=0,r=e.changedRecords;n<r.length;n++){var a,s,o=r[n];!B.isNullOrUndefined(o[t.recurrenceRule])&&B.isNullOrUndefined(o[t.recurrenceException])?(a=Wa(o[t.startTime]),(s=c.getParentEvent(o))[t.recurrenceException]=B.isNullOrUndefined(s[t.recurrenceException])?a:s[t.recurrenceException].concat(","+a),o[t.id]=c.parent.getEventMaxID(),o[t.recurrenceException]=a,i.addedRecords.push(c.parent.eventBase.processTimezone(o,!0)),i.changedRecords.push(c.parent.eventBase.processTimezone(s,!0))):i.changedRecords.push(c.parent.eventBase.processTimezone(o,!0))}var l=c.parent.dataModule.dataManager.saveChanges(i,t.id,c.getTable(),c.getQuery()),p=B.extend({},e.changedRecords[e.changedRecords.length-1],null,!0),p=(c.parent.eventBase.selectWorkCellByTime([c.parent.eventBase.processTimezone(p)]),{requestType:"eventChanged",cancel:!1,data:e.changedRecords,promise:l,editParams:i});c.refreshData(p)}})},Po.prototype.getParentEvent=function(e,t){t=this.parent.eventBase.getParentEvent(e,t=void 0===t?!1:t)||e;return(t[this.parent.eventFields.startTimezone]||t[this.parent.eventFields.endTimezone])&&this.parent.eventBase.timezoneConvert(t),t},Po.prototype.excludeDateCheck=function(e,t){var i=this.parent.timezone||this.parent.tzModule.getLocalTimezoneName(),i=Wa(e=i?this.parent.tzModule.remove(new Date(+e.getTime()),i):e);return B.isNullOrUndefined(t)?t=i:-1===t.indexOf(i)&&(t=B.isNullOrUndefined(t)?i:t+","+i),t},Po.prototype.processRecurrenceRule=function(e,t){var i,n,r,a,s=this.parent.eventFields,o=e[s.recurrenceRule];t instanceof Date?i=new Date(+t):(i=new Date(+t[s.startTime]),(n=t[s.recurrenceRule])&&(a=sa(r=e[s.startTime],n,"DeleteFollowingEvents"===this.parent.currentAction?t[s.recurrenceException]:null,this.parent.activeViewOptions.firstDayOfWeek),(a=new Date(a.slice(-1)[0])).setHours(i.getHours(),i.getMinutes(),i.getSeconds()),i.setHours(r.getHours(),r.getMinutes(),r.getSeconds()),t[s.recurrenceRule]=this.getUpdatedRecurrenceRule(n,new Date(+a),!1))),e[s.recurrenceRule]=this.getUpdatedRecurrenceRule(o,Y(new Date(i.getTime()),-1),!0)},Po.prototype.getUpdatedRecurrenceRule=function(e,t,i){for(var n="",r=0,a=e.split(";");r<a.length;r++){var s,o,l=a[r];""!==l&&(s=l.split("=")[0],o=l.split("=")[1],"COUNT"!==s&&"UNTIL"!==s||(o=Wa(t),l=l.replace(l,"UNTIL="+o)),n+=l+";")}return i&&-1===n.indexOf("UNTIL")&&(n+="UNTIL="+Wa(t)),n},Po.prototype.isBlockEvent=function(e){for(var t=!1,i=0,n=e instanceof Array?e:[e];i<n.length;i++)t=n[i][this.parent.eventFields.isBlock]||!1;return t},Po.prototype.destroy=function(){this.crudObj=null,this.parent=null};var Ho=Po;function Po(e){this.parent=e,this.crudObj={sourceEvent:null,targetEvent:null,isCrudAction:!1}}No.prototype.cellMouseDown=function(e){this.isPreventAction(e)||this.parent.notify(Pe,{event:e})},No.prototype.cellClick=function(e){var i,n,t,r,a,s=this;this.isPreventAction(e)||(i=B.closest(e.target,".e-work-cells,.e-all-day-cells,.e-header-cells"),B.isNullOrUndefined(i))||(B.isNullOrUndefined(B.closest(e.target,"."+zi))?(n=i.classList.contains(O)||i.classList.contains(w),this.parent.uiStateValues.isTapHold&&!this.parent.uiStateValues.action&&n&&(this.parent.uiStateValues.isTapHold=!1,this.parent.eventBase.removeSelectedAppointmentClass(),this.parent.selectedElements=[]),r=B.closest(e.target,"."+Hi),t=this.parent.getNavigateView(),a=this.parent.currentView===t,B.isNullOrUndefined(r)||a||B.isNullOrUndefined(this.parent.viewOptions[t.charAt(0).toLowerCase()+t.slice(1)])?this.parent.activeViewOptions.readonly&&"MonthAgenda"!==this.parent.currentView?this.parent.quickPopup&&this.parent.quickPopup.quickPopupHide():this.parent.isAdaptive&&(e.target.classList.contains(hn)||B.closest(e.target,"."+hn))||(n&&e.shiftKey&&1===e.which&&this.parent.keyboardInteractionModule?this.parent.keyboardInteractionModule.onMouseSelection(e):(this.parent.activeCellsData=this.parent.getCellDetails(i),r=B.extend(this.parent.activeCellsData,{cancel:!1,event:e,name:"cellClick"}),this.parent.trigger(q,r,function(e){var t;e.cancel?s.parent.quickPopup&&s.parent.quickPopup.quickPopupHide():(n&&s.parent.selectCell(i),s.parent.allowInline?(t={element:e.element,groupIndex:e.groupIndex,type:"Cell"},s.parent.notify(ue,t)):s.parent.notify(q,e))}))):(a=this.parent.getDateFromElement(i),!B.isNullOrUndefined(a)&&this.parent.isMinMaxDate(a)&&(this.parent.setProperties({selectedDate:a},!0),this.parent.changeView(this.parent.getNavigateView(),e)))):this.parent.eventWindow.openEditor(this.parent.activeCellsData,"Add"))},No.prototype.cellDblClick=function(e){var i=this,t=B.closest(e.target,".e-work-cells,.e-all-day-cells,.e-header-cells");this.parent.activeViewOptions.readonly||this.isPreventAction(e)||B.isNullOrUndefined(t)||(t=B.extend(this.parent.activeCellsData,{cancel:!1,event:e,name:"cellDoubleClick"}),this.parent.trigger(F,t,function(e){var t;e.startTime&&(t=new Date(e.startTime.getTime()),i.parent.isMinMaxDate(new Date(t.setHours(0,0,0,0))))&&!e.cancel&&i.parent.eventWindow.openEditor(i.parent.activeCellsData,"Add")}))},No.prototype.onHover=function(e){var t=B.closest(e.target,".e-work-cells,.e-time-slots,.e-all-day-cells,.e-header-cells,.e-resource-cells,.e-appointment,.e-week-number,.e-month-header");t&&this.parent.trigger(X,{element:t,event:e})},No.prototype.isPreventAction=function(e){var t;return!(B.closest(e.target,"."+Hi)||(!B.closest(e.target,"."+x)||B.closest(e.target,"."+hn))&&(t=B.closest(e.target,"."+V+",."+Ut),B.isNullOrUndefined(t))&&(t=B.closest(e.target,"."+It),!this.parent.activeView||!this.parent.activeView.isTimelineView()||B.isNullOrUndefined(t)))},No.prototype.destroy=function(){B.EventHandler.remove(this.parent.element,"mouseover",this.onHover)};var jo=No;function No(e){this.parent=e,B.EventHandler.add(this.parent.element,"mouseover",this.onHover,this)}Lo=function(e,t){return(Lo=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var Lo,qo,ko=function(e,t){function i(){this.constructor=e}Lo(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Fo=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;0<=o;o--)(r=e[o])&&(s=(a<3?r(s):3<a?r(t,i,s):r(t,i))||s);return 3<a&&s&&Object.defineProperty(t,i,s),s},ko=(qo=B.ChildProperty,ko(Uo,qo),Fo([B.Property()],Uo.prototype,"name",void 0),Fo([B.Property()],Uo.prototype,"default",void 0),Fo([B.Property()],Uo.prototype,"title",void 0),Fo([B.Property({})],Uo.prototype,"validation",void 0),Uo);function Uo(){return null!==qo&&qo.apply(this,arguments)||this}Bo=function(e,t){return(Bo=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var Bo,Wo,Fo=function(e,t){function i(){this.constructor=e}Bo(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},u=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;0<=o;o--)(r=e[o])&&(s=(a<3?r(s):3<a?r(t,i,s):r(t,i))||s);return 3<a&&s&&Object.defineProperty(t,i,s),s},Fo=(Wo=B.ChildProperty,Fo(zo,Wo),u([B.Property("Id")],zo.prototype,"id",void 0),u([B.Property("IsBlock")],zo.prototype,"isBlock",void 0),u([B.Complex({name:"Subject"},ko)],zo.prototype,"subject",void 0),u([B.Complex({name:"StartTime"},ko)],zo.prototype,"startTime",void 0),u([B.Complex({name:"EndTime"},ko)],zo.prototype,"endTime",void 0),u([B.Complex({name:"StartTimezone"},ko)],zo.prototype,"startTimezone",void 0),u([B.Complex({name:"EndTimezone"},ko)],zo.prototype,"endTimezone",void 0),u([B.Complex({name:"Location"},ko)],zo.prototype,"location",void 0),u([B.Complex({name:"Description"},ko)],zo.prototype,"description",void 0),u([B.Complex({name:"IsAllDay"},ko)],zo.prototype,"isAllDay",void 0),u([B.Complex({name:"RecurrenceID"},ko)],zo.prototype,"recurrenceID",void 0),u([B.Complex({name:"RecurrenceRule"},ko)],zo.prototype,"recurrenceRule",void 0),u([B.Complex({name:"RecurrenceException"},ko)],zo.prototype,"recurrenceException",void 0),u([B.Property("IsReadonly")],zo.prototype,"isReadonly",void 0),u([B.Property("FollowingID")],zo.prototype,"followingID",void 0),zo);function zo(){return null!==Wo&&Wo.apply(this,arguments)||this}Yo=function(e,t){return(Yo=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var Yo,_o,ko=function(e,t){function i(){this.constructor=e}Yo(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},u=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;0<=o;o--)(r=e[o])&&(s=(a<3?r(s):3<a?r(t,i,s):r(t,i))||s);return 3<a&&s&&Object.defineProperty(t,i,s),s},ko=(_o=B.ChildProperty,ko(Go,_o),u([B.Property()],Go.prototype,"template",void 0),u([B.Property([])],Go.prototype,"dataSource",void 0),u([B.Property()],Go.prototype,"query",void 0),u([B.Complex({},Fo)],Go.prototype,"fields",void 0),u([B.Property(!1)],Go.prototype,"enableTooltip",void 0),u([B.Property("AllDayRow")],Go.prototype,"spannedEventPlacement",void 0),u([B.Property(1)],Go.prototype,"minimumEventDuration",void 0),u([B.Property()],Go.prototype,"tooltipTemplate",void 0),u([B.Property()],Go.prototype,"resourceColorField",void 0),u([B.Property(!1)],Go.prototype,"editFollowingEvents",void 0),u([B.Property(!0)],Go.prototype,"allowAdding",void 0),u([B.Property(!0)],Go.prototype,"allowEditing",void 0),u([B.Property(!0)],Go.prototype,"allowDeleting",void 0),u([B.Property(!1)],Go.prototype,"enableMaxHeight",void 0),u([B.Property(!1)],Go.prototype,"enableIndicator",void 0),u([B.Property(!1)],Go.prototype,"ignoreWhitespace",void 0),u([B.Property()],Go.prototype,"sortComparer",void 0),u([B.Property()],Go.prototype,"includeFiltersInQuery",void 0),Go);function Go(){return null!==_o&&_o.apply(this,arguments)||this}Xo=function(e,t){return(Xo=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var Xo,Qo,Fo=function(e,t){function i(){this.constructor=e}Xo(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},u=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;0<=o;o--)(r=e[o])&&(s=(a<3?r(s):3<a?r(t,i,s):r(t,i))||s);return 3<a&&s&&Object.defineProperty(t,i,s),s},Fo=(Qo=B.ChildProperty,Fo(Ko,Qo),u([B.Property(!1)],Ko.prototype,"byDate",void 0),u([B.Property(!0)],Ko.prototype,"byGroupID",void 0),u([B.Property(!1)],Ko.prototype,"allowGroupEdit",void 0),u([B.Property([])],Ko.prototype,"resources",void 0),u([B.Property(!0)],Ko.prototype,"enableCompactView",void 0),u([B.Property()],Ko.prototype,"headerTooltipTemplate",void 0),u([B.Property(!1)],Ko.prototype,"hideNonWorkingDays",void 0),Ko);function Ko(){return null!==Qo&&Qo.apply(this,arguments)||this}Zo=function(e,t){return(Zo=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var Zo,Jo,u=function(e,t){function i(){this.constructor=e}Zo(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},$o=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;0<=o;o--)(r=e[o])&&(s=(a<3?r(s):3<a?r(t,i,s):r(t,i))||s);return 3<a&&s&&Object.defineProperty(t,i,s),s},u=(Jo=B.ChildProperty,u(el,Jo),$o([B.Property()],el.prototype,"field",void 0),$o([B.Property()],el.prototype,"title",void 0),$o([B.Property()],el.prototype,"name",void 0),$o([B.Property(!1)],el.prototype,"allowMultiple",void 0),$o([B.Property([])],el.prototype,"dataSource",void 0),$o([B.Property()],el.prototype,"query",void 0),$o([B.Property("Id")],el.prototype,"idField",void 0),$o([B.Property("Text")],el.prototype,"textField",void 0),$o([B.Property("Expanded")],el.prototype,"expandedField",void 0),$o([B.Property("GroupID")],el.prototype,"groupIDField",void 0),$o([B.Property("Color")],el.prototype,"colorField",void 0),$o([B.Property("StartHour")],el.prototype,"startHourField",void 0),$o([B.Property("EndHour")],el.prototype,"endHourField",void 0),$o([B.Property("WorkDays")],el.prototype,"workDaysField",void 0),$o([B.Property("CssClass")],el.prototype,"cssClassField",void 0),el);function el(){return null!==Jo&&Jo.apply(this,arguments)||this}g.prototype.renderResourceHeaderIndent=function(e){var t=B.createElement("td",{className:"e-resource-left-td"}),i=B.createElement("div",{className:Bt}),n=(this.parent.activeViewOptions.headerIndentTemplate?(n={className:[t.className],type:"emptyCells"},this.parent.renderHeaderIndentTemplate(n,t)):t.appendChild(i),{elementType:"emptyCells",element:t});this.parent.trigger($,n),e.appendChild(t)},g.prototype.hideResourceRows=function(e){if(!(this.resourceCollection.length<=1||this.parent.virtualScrollModule))for(var t=this.lastResourceLevel.length,i=0;i<t;i++){var n=this.lastResourceLevel[parseInt(i.toString(),10)].resourceData,r=this.lastResourceLevel[parseInt(i.toString(),10)].resource;n.ClassName!==_t||n[r.expandedField]||B.isNullOrUndefined(n[r.expandedField])||(r=[].slice.call(e.children).slice(i+1,i+(parseInt(n.Count,10)+1)),B.addClass(r,fr))}},g.prototype.createResourceColumn=function(){var e=this.resourceCollection,t=B.createElement("div",{className:Wt}),i=this.parent.activeView.createTableLayout(zt),n=(!this.parent.uiStateValues.isGroupAdaptive&&this.parent.rowAutoHeight&&this.parent.activeView.isTimelineView()&&0<this.parent.activeViewOptions.group.resources.length&&B.addClass([i],Mr),i.querySelector("tbody")),r=this.generateTreeData(!0);return this.countCalculation(e.slice(0,-2),e.slice(0,-1)),this.renderedResources=this.lastResourceLevel,this.parent.virtualScrollModule&&(e=this.parent.virtualScrollModule.getRenderedCount(),this.setExpandedResources(),r=this.expandedResources.slice(0,e),this.renderedResources=r),B.append(this.getContentRows(r),n),this.hideResourceRows(n),i.appendChild(n),t.appendChild(i),t},g.prototype.setRenderedResources=function(){var e=this.resourceCollection;this.generateTreeData(!0);this.countCalculation(e.slice(0,-2),e.slice(0,-1)),this.renderedResources=this.lastResourceLevel},g.prototype.setExpandedResources=function(){for(var e=[],t=0;t<this.lastResourceLevel.length;t++){var i=this.lastResourceLevel[parseInt(t.toString(),10)].resourceData,n=i.Count,i=(e.push(this.lastResourceLevel[parseInt(t.toString(),10)]),i[this.lastResourceLevel[parseInt(t.toString(),10)].resource.expandedField]);!B.isNullOrUndefined(i)&&!i&&0<n&&(t+=n)}this.expandedResources=e},g.prototype.getContentRows=function(e,t){for(var i,n,r,a,s=[],o=this.resourceCollection,l=B.createElement("tr"),p=B.createElement("td",{attrs:{tabindex:t?"-1":"0"}}),c=this.parent.activeView.getGroupIndices(),h=0;h<e.length;h++)0<c.length&&-1<c.indexOf(e[parseInt(h.toString(),10)].groupIndex)||(i=p.cloneNode(),(r=st(o,"name",e[parseInt(h.toString(),10)].resource.name))===o.length-1?(B.extend(e[parseInt(h.toString(),10)].resourceData,{ClassName:Yt}),this.renderedResources[parseInt(h.toString(),10)].className=[Yt]):(B.extend(e[parseInt(h.toString(),10)].resourceData,{ClassName:_t}),this.renderedResources[parseInt(h.toString(),10)].className=[_t]),a=r*this.leftPixel+"px",e[parseInt(h.toString(),10)].resourceData.ClassName===_t&&!B.isNullOrUndefined(e[parseInt(h.toString(),10)].resourceData.Count)&&0<e[parseInt(h.toString(),10)].resourceData.Count&&(n=void 0,n=e[parseInt(h.toString(),10)].resourceData[o[parseInt(r.toString(),10)].expandedField]||B.isNullOrUndefined(e[parseInt(h.toString(),10)].resourceData[o[parseInt(r.toString(),10)].expandedField])?Xt:Gt,r=B.createElement("div"),B.addClass([r],[Qt,n]),this.setMargin(r,a),i.appendChild(r),1<this.resourceCollection.length)&&B.EventHandler.add(r,"click",this.onTreeIconClick,this),this.parent.activeView.setResourceHeaderContent(i,e[parseInt(h.toString(),10)],Bt),i.setAttribute("data-group-index",e[parseInt(h.toString(),10)].groupIndex.toString()),i.setAttribute("aria-label",e[parseInt(h.toString(),10)].resourceData[e[parseInt(h.toString(),10)].resource.textField]+" resource"),this.parent.activeViewOptions.resourceHeaderTemplate||this.setMargin(i.querySelector("."+Bt),a),n=[Kt,e[parseInt(h.toString(),10)].resourceData.ClassName],B.addClass([i],n),r={elementType:"resourceHeader",element:i,groupIndex:e[parseInt(h.toString(),10)].groupIndex},this.parent.trigger($,r),(a=l.cloneNode()).appendChild(i),s.push(a));return s},g.prototype.setMargin=function(e,t){this.parent.enableRtl?e.style.marginRight=t:e.style.marginLeft=t},g.prototype.countCalculation=function(e,t){for(var i=0;i<e.length;i++){for(var n=e[e.length-(i+1)].dataSource,r=0;r<n.length;r++){var a,s,o=0;s=this.parent.activeViewOptions.group.byGroupID?(a=(new p.Query).where(t[t.length-1].groupIDField,"equal",n[parseInt(r.toString(),10)][e[e.length-(i+1)].idField]),new p.DataManager(t[t.length-1].dataSource).executeLocal(a)):t[t.length-1].dataSource;for(var l=0;l<s.length;l++)o+=parseInt(s[parseInt(l.toString(),10)].Count,10);o+=parseInt(n[parseInt(r.toString(),10)].Count,10),B.extend(n[parseInt(r.toString(),10)],{Count:o})}t=t.slice(0,-1)}},g.prototype.onTreeIconClick=function(r){var a,s=this,o=(this.parent.eventTooltip&&this.parent.eventTooltip.close(),r.target),e=B.closest(o,"."+_t).parentElement,l=parseInt(e.children[0].getAttribute("data-group-index"),10),p={cancel:!1,event:r,groupIndex:l,requestType:o.classList.contains(Xt)?"resourceCollapse":"resourceExpand"};this.parent.trigger(Q,p,function(e){if(!e.cancel){a=o.classList.contains(Xt)?(B.classList(o,[Gt],[Xt]),!0):(B.classList(o,[Xt],[Gt]),!1);for(var t=0,i=[].slice.call(s.parent.element.querySelectorAll("."+V+",."+hn));t<i.length;t++){var n=i[t];B.remove(n)}s.parent.virtualScrollModule?s.updateVirtualContent(l,a,r,o):s.updateContent(l,a);e={cssProperties:s.parent.getCssProperties(),module:"scroll"};s.parent.notify(Me,e),p={cancel:!1,event:r,groupIndex:l,requestType:o.classList.contains(Xt)?"resourceExpanded":"resourceCollapsed"},s.parent.refreshEvents(!1),s.parent.trigger(K,p)}})},g.prototype.updateContent=function(e,t){for(var i=[],n=[],r=[],a=this.lastResourceLevel[parseInt(e.toString(),10)].resourceData,s=[].slice.call(this.parent.element.querySelectorAll("."+Wt+" tr")),o=[].slice.call(this.parent.element.querySelectorAll("."+A+" tbody tr")),l=[].slice.call(this.parent.element.querySelectorAll("."+A+" ."+fi)),p=0;p<a.Count;p++)i.push(s[e+p+1]),n.push(o[e+p+1]),r.push(l[e+p+1]);for(var c=this.lastResourceLevel,h=0;h<i.length;h++){var d,u=!0,g=i[parseInt(h.toString(),10)].children[0].classList.contains(_t);c[parseInt(e.toString(),10)].resourceData[c[parseInt(e.toString(),10)].resource.expandedField]=!t,t?(g&&(d=i[parseInt(h.toString(),10)].querySelector("."+Qt))&&B.classList(d,[Gt],[Xt]),i[parseInt(h.toString(),10)].classList.contains(fr)||B.addClass([i[parseInt(h.toString(),10)],n[parseInt(h.toString(),10)],r[parseInt(h.toString(),10)]],fr)):(g&&(g=i[parseInt(h.toString(),10)].rowIndex,c[parseInt(g.toString(),10)].resourceData[c[parseInt(g.toString(),10)].resource.expandedField]||B.isNullOrUndefined(c[parseInt(g.toString(),10)].resourceData[c[parseInt(g.toString(),10)].resource.expandedField])||(i.splice(h+1,parseInt(c[parseInt(g.toString(),10)].resourceData.Count,10)),n.splice(h+1,parseInt(c[parseInt(g.toString(),10)].resourceData.Count,10)),r.splice(h+1,parseInt(c[parseInt(g.toString(),10)].resourceData.Count,10)),u=!1),u)&&(d=i[parseInt(h.toString(),10)].querySelector("."+Qt))&&B.classList(d,[Xt],[Gt]),i[parseInt(h.toString(),10)].classList.contains(fr)&&B.removeClass([i[parseInt(h.toString(),10)],n[parseInt(h.toString(),10)],r[parseInt(h.toString(),10)]],fr))}},g.prototype.updateVirtualContent=function(e,t,i,n){this.lastResourceLevel[parseInt(e.toString(),10)].resourceData[this.lastResourceLevel[parseInt(e.toString(),10)].resource.expandedField]=!t,this.setExpandedResources();var e=this.parent.virtualScrollModule.getRenderedCount(),t=this.expandedResources.indexOf(this.renderedResources[0]),e=(this.parent.virtualScrollModule.existingDataCollection=this.renderedResources,this.renderedResources=this.expandedResources.slice(t,t+e),this.renderedResources.length<e&&(t=this.expandedResources.length-e,this.renderedResources=this.expandedResources.slice(t=0<t?t:0,this.expandedResources.length)),this.parent.element.querySelector("."+xi)),t=(this.parent.virtualScrollModule.updateVirtualTrackHeight(e),this.parent.element.querySelector("."+Wt+" table")),e=this.parent.element.querySelector("."+A+" table"),r=this.parent.element.querySelector("."+Ft),t=(this.parent.virtualScrollModule.updateContent(t,e,r,this.renderedResources),this.parent.element.querySelector("."+ii));B.isNullOrUndefined(t)||(t.style.height=this.parent.element.querySelector("."+C).offsetHeight+"px")},g.prototype.renderResourceHeader=function(){var e,t=B.createElement("div",{className:pi});t.innerHTML='<div class="'+hi+'"><div class="'+wr+'"><div class="e-icons '+Dr+'"></div></div><div class="'+br+'"></div></div>',"MonthAgenda"===this.parent.currentView?(e=this.parent.activeView.getPanel().querySelector("."+A)).insertBefore(t,e.querySelector("."+vi)):this.parent.element.insertBefore(t,this.parent.element.querySelector("."+St)),this.renderResourceHeaderText(),B.EventHandler.add(t.querySelector("."+Dr),"click",this.menuClick,this)},g.prototype.renderResourceTree=function(){this.popupOverlay=B.createElement("div",{className:Sr});var e=B.createElement("div",{className:Cr+" e-popup-close"}),t=(("MonthAgenda"===this.parent.currentView?((t=this.parent.activeView.getPanel().querySelector("."+vi)).insertBefore(e,t.children[0]),t):(this.parent.element.querySelector("."+St).appendChild(e),this.parent.element.querySelector("."+St))).appendChild(this.popupOverlay),B.createElement("div",{className:"e-resource-tree"}));e.appendChild(t),this.treeViewObj=new k.TreeView({cssClass:this.parent.cssClass,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,fields:{dataSource:[].slice.call(this.generateTreeData()),id:"resourceId",text:"resourceName",child:"resourceChild"},nodeTemplate:this.parent.resourceHeaderTemplate,nodeClicked:this.resourceClick.bind(this),created:this.resourceTreeCreated.bind(this)}),this.treeViewObj.root=this.parent.root||this.parent,this.treeViewObj.appendTo(t),this.treeViewObj.expandAll(),this.treePopup=new M.Popup(e,{targetType:"relative",actionOnScroll:"none",content:this.treeViewObj.element,relateTo:this.parent.element.querySelector("."+St),enableRtl:this.parent.enableRtl,hideAnimation:{name:"SlideLeftOut",duration:500},showAnimation:{name:"SlideLeftIn",duration:500},viewPortElement:this.parent.element.querySelector("."+("MonthAgenda"===this.parent.currentView?vi:St))}),this.parent.on(Re,this.documentClick,this)},g.prototype.resourceTreeCreated=function(){this.parent.activeViewOptions.resourceHeaderTemplate&&this.parent.portals&&this.treeViewObj.portals&&(this.parent.portals=this.parent.portals.concat(this.treeViewObj.portals),this.parent.renderTemplates())},g.prototype.generateTreeData=function(h){for(var d=this,i=[],u=[],g=0,e=function(e,t){function c(e,t,i){for(var n,r,a=d.resourceCollection[parseInt(t.toString(),10)],s=(h?(r={type:"resourceHeader",resource:e.resource,resourceData:e.resourceData,groupIndex:g,groupOrder:e.groupOrder},u.push(r),g++):n={resourceId:i,resourceName:e.resourceData[a.textField],resource:e.resource,resourceData:e.resourceData},0<e.child.length&&!h&&(n.resourceChild=[]),1),o=0,l=e.child;o<l.length;o++){var p=l[o];h?c(p,t+1,i+"-"+s):n.resourceChild.push(c(p,t+1,i+"-"+s)),s+=1}return h&&B.extend(r.resourceData,{Count:s-1}),n}h?c(n.resourceTreeLevel[parseInt(e.toString(),10)],0,(e+1).toString()):i.push(c(n.resourceTreeLevel[parseInt(e.toString(),10)],0,(e+1).toString()))},n=this,t=0,r=this.resourceTreeLevel.length;t<r;t++)e(t);return h?this.lastResourceLevel=u:i},g.prototype.renderResourceHeaderText=function(){for(var r=this.lastResourceLevel[this.parent.uiStateValues.groupIndex],a=[],s=this,e=0,t=r.groupOrder.length;e<t;e++)!function(t){var i=s.resourceCollection[parseInt(t.toString(),10)],e=i.dataSource.filter(function(e){return e[i.idField]===r.groupOrder[parseInt(t.toString(),10)]}),n=B.createElement("div",{className:Si}),e=(s.parent.sanitize(e[0][i.textField],n),a.push(n),B.createElement("div",{className:"e-icons e-icon-next"}));a.push(e)}(e);a.pop();var i=("MonthAgenda"===this.parent.currentView?this.parent.activeView.getPanel():this.parent.element).querySelector("."+br);lt(i);for(var n=0,o=a;n<o.length;n++)i.appendChild(o[n]);1===this.lastResourceLevel.length&&B.addClass([this.parent.element.querySelector("."+wr)],d)},g.prototype.menuClick=function(e){var t;this.parent.element.querySelector("."+Cr).classList.contains(xt)?(this.treePopup.hide(),B.removeClass([this.popupOverlay],bt)):(t=[].slice.call(this.treeViewObj.element.querySelectorAll(".e-list-item:not(.e-has-child)")),B.removeClass(t,"e-active"),B.addClass([t[this.parent.uiStateValues.groupIndex]],"e-active"),this.treePopup.show(),B.addClass([this.popupOverlay],bt))},g.prototype.selectResourceByIndex=function(e){this.lastResourceLevel&&-1<e&&e<this.lastResourceLevel.length&&this.triggerEvents(e)},g.prototype.resourceClick=function(e){var t;e.node.classList.contains("e-has-child")||(this.treePopup.hide(),B.removeClass([this.popupOverlay],bt),t=[].slice.call(this.treeViewObj.element.querySelectorAll(".e-list-item:not(.e-has-child)")).indexOf(e.node),this.triggerEvents(t,e),e.event.preventDefault())},g.prototype.triggerEvents=function(e,t){var i=this,n={cancel:!1,event:t?t.event:null,groupIndex:e,requestType:"resourceChange"};this.parent.trigger(Q,n,function(e){e.cancel||(i.parent.uiStateValues.groupIndex=e.groupIndex,i.parent.renderModule.render(i.parent.currentView),n={cancel:!1,event:t?t.event:null,groupIndex:i.parent.uiStateValues.groupIndex,requestType:"resourceChanged"},i.parent.adaptiveGroupIndex=i.parent.uiStateValues.groupIndex,i.parent.trigger(K,n))})},g.prototype.documentClick=function(e){B.closest(e.event.target,"."+Cr)||(e=this.parent.element.querySelector("."+Cr))&&e.classList.contains(xt)&&(this.treePopup.hide(),B.removeClass([this.popupOverlay],bt))},g.prototype.bindResourcesData=function(t){for(var i=this,e=(this.parent.showSpinner(),[]),n=0,r=this.parent.resources;n<r.length;n++){var a=r[n],a=new Qr(this.parent,a.dataSource,a.query);e.push(a.getData(a.generateQuery()))}Promise.all(e).then(function(e){return i.dataManagerSuccess(e,t)}).catch(function(e){return i.parent.crudModule.dataManagerFailure(e)})},g.prototype.dataManagerSuccess=function(e,t){if(!(!this.parent||this.parent&&this.parent.isDestroyed)){this.parent.resourceCollection=[];for(var i=0,n=e.length;i<n;i++){var r=this.parent.resources[parseInt(i.toString(),10)],r=this.getResourceModel(r,e[parseInt(i.toString(),10)].result);this.parent.resourceCollection.push(r)}this.refreshLayout(t)}},g.prototype.getResourceModel=function(e,t){return{field:e.field,title:e.title,name:e.name,allowMultiple:e.allowMultiple,dataSource:t||e.dataSource,idField:e.idField,textField:e.textField,groupIDField:e.groupIDField,colorField:e.colorField,startHourField:e.startHourField,endHourField:e.endHourField,workDaysField:e.workDaysField,expandedField:e.expandedField,cssClassField:e.cssClassField}},g.prototype.refreshLayout=function(e){!B.isNullOrUndefined(this.parent.uiStateValues.groupIndex)&&this.parent.enablePersistence||(this.parent.uiStateValues.groupIndex=0),this.parent.renderElements(e)},g.prototype.setResourceCollection=function(){var e=[];if(this.resourceCollection=[],this.colorIndex=null,0<this.parent.activeViewOptions.group.resources.length)for(var t=0,i=this.parent.activeViewOptions.group.resources;t<i.length;t++){var n=i[t],r=st(this.parent.resourceCollection,"name",n);0<=r&&e.push(this.parent.resourceCollection[parseInt(r.toString(),10)])}else 0<this.parent.resourceCollection.length&&(e=this.parent.resourceCollection);for(var a=0,s=0,o=e;s<o.length;s++){var n=o[s],l=this.getResourceModel(n);n.name===this.parent.eventSettings.resourceColorField&&(this.colorIndex=a),a++,this.resourceCollection.push(l)}B.isNullOrUndefined(this.colorIndex)&&(this.colorIndex=this.resourceCollection.length-1)},g.prototype.generateResourceLevels=function(y,e){function T(e,t,i,n,r){var a=[],s=e[0];if(s){var o,l=void 0;l=n&&w.parent.activeViewOptions.group.byGroupID?(o=n[i.idField],s.dataSource.filter(function(e){return e[s.groupIDField]===o})):s.dataSource;for(var p=0;p<l.length;p++){var c,h,d,u,g,m,v=[],f=((v=r&&0<r.length?v.concat(r):v).push(l[parseInt(p.toString(),10)][s.idField]),T(e.slice(1),t+1,s,l[parseInt(p.toString(),10)],v));0===t&&0===f.length&&1<w.resourceCollection.length||(d=[],c=w.parent.activeView.renderDates,h=void 0,w.parent.activeViewOptions.group.byDate||t+1!==w.resourceCollection.length||(u=l[parseInt(p.toString(),10)][s.workDaysField],g=l[parseInt(p.toString(),10)][s.startHourField],m=l[parseInt(p.toString(),10)][s.endHourField],d=u&&0<u.length?(c=w.parent.activeView.getRenderDates(u),w.parent.activeView.getDateSlots(c,h=u)):(h=w.parent.activeViewOptions.workDays,y),u=w.generateCustomHours(d,g,m,v),b=b.concat(u)),g=l[parseInt(p.toString(),10)][s.cssClassField],m={type:"resourceHeader",className:["e-resource-cells"],resourceLevelIndex:t,groupOrder:v,resource:s,resourceData:l[parseInt(p.toString(),10)],colSpan:w.parent.activeViewOptions.group.byDate?1:d.length,renderDates:c,workDays:h,cssClass:g,child:f},a.push(m))}return D[parseInt(t.toString(),10)]||(D[parseInt(t.toString(),10)]=[]),0<a.length&&D[parseInt(t.toString(),10)].push(a),a}return[]}var w=this,t=this.resourceCollection,D=[],b=[];return this.resourceTreeLevel=T(t,0),e?[]:this.generateHeaderLevels(D,b,y)},g.prototype.generateCustomHours=function(e,t,i,n){for(var e=B.extend([],e,null,!0),r=0,a=e;r<a.length;r++){var s=a[r];t&&(s.startHour=this.parent.getStartEndTime(t)),i&&(s.endHour=this.parent.getStartEndTime(i)),n&&(s.groupOrder=n)}return e},g.prototype.generateHeaderLevels=function(e,t,i){for(var n=[],r=e.length-1;0<=r;r--)for(var a=0,s=0,o=e[parseInt(r.toString(),10)];s<o.length;s++)for(var l=0,p=o[s];l<p.length;l++){var c=p[l];if(e[r+1]&&0<e[r+1].length){var h=e[parseInt((r+1).toString(),10)][parseInt(a.toString(),10)];if(!h)continue;for(var d=0,u=0,g=h;u<g.length;u++){var m=g[u];(!this.parent.activeViewOptions.group.byGroupID||this.parent.activeViewOptions.group.byGroupID&&m.resourceData[m.resource.groupIDField]===c.resourceData[c.resource.idField])&&(d+=m.colSpan)}c.colSpan=d}c.groupIndex=a,a++,n[c.resourceLevelIndex]=n[c.resourceLevelIndex]||[],n[c.resourceLevelIndex].push(c)}if(this.lastResourceLevel=n.slice(-1)[0]||[],!this.parent.activeViewOptions.group.byDate){for(var v=0,f=0,y=this.lastResourceLevel;f<y.length;f++)for(var T=y[f],r=0;r<T.colSpan;r++)t[parseInt(v.toString(),10)].groupIndex=T.groupIndex,v++;return n.push(t),n}var w=[],D=B.extend([],n,null,!0),b=[];if(this.parent.activeViewOptions.group.hideNonWorkingDays){for(var S=[],C=0,j=function(a){O.resourceDateTree[parseInt(C.toString(),10)]=[];for(var s=[],e=function(n){var e=O.lastResourceLevel[parseInt(n.toString(),10)].resourceData[O.lastResourceLevel[parseInt(n.toString(),10)].resource.workDaysField];if(-1!==(e=e||O.parent.activeViewOptions.workDays).indexOf(a.date.getDay()))for(var r=B.extend({},O.lastResourceLevel[parseInt(n.toString(),10)],null,!0),t=(r.date=a.date,O.lastResourceLevel[parseInt(n.toString(),10)].workDays=e,r.startHour=O.parent.getStartEndTime(r.resourceData[r.resource.startHourField])||a.startHour,r.endHour=O.parent.getStartEndTime(r.resourceData[r.resource.endHourField])||a.endHour,O.resourceDateTree[parseInt(C.toString(),10)].push(r),0);t<r.groupOrder.length;t++)!function(t){if(s[parseInt(t.toString(),10)]||(s[parseInt(t.toString(),10)]=[]),t===r.groupOrder.length-1)return S[parseInt(n.toString(),10)]||(S[parseInt(n.toString(),10)]=[]),i=r.renderDates.filter(function(e){return e.getDay()===a.date.getDay()}),S[parseInt(n.toString(),10)]=S[parseInt(n.toString(),10)].concat(i),s[parseInt(t.toString(),10)].push(r);var e,i=D[parseInt(t.toString(),10)].filter(function(e){return e.resourceData[e.resource.idField]===r.groupOrder[parseInt(t.toString(),10)]});i&&0<i.length&&((e=s[parseInt(t.toString(),10)].filter(function(e){return e.resourceData[e.resource.idField]===r.groupOrder[parseInt(t.toString(),10)]}))&&0<e.length?e[0].colSpan+=1:((e=B.extend({},i[0],null,!0)).colSpan=1,s[parseInt(t.toString(),10)].push(e)))}(t)},t=0;t<O.lastResourceLevel.length;t++)e(t);if(0<s.length){for(var i=0;i<D.length;i++)w[parseInt(i.toString(),10)]||(w[parseInt(i.toString(),10)]=[]),w[parseInt(i.toString(),10)]=w[parseInt(i.toString(),10)].concat(s[parseInt(i.toString(),10)]);a.colSpan=s[s.length-1].length,b.push(a)}C++},O=this,E=0,x=i;E<x.length;E++)j(M=x[E]);this.resourceDateTree=this.resourceDateTree.filter(function(e){return 0<e.length}),this.lastResourceLevel.forEach(function(e,t){S[parseInt(t.toString(),10)]&&(e.renderDates=S[parseInt(t.toString(),10)].sort(function(e,t){return e.getTime()-t.getTime()}))})}else{for(var V=0,A=0,N=D[0];A<N.length;A++)V+=N[A].colSpan;for(var I=0,L=i;I<L.length;I++){(M=L[I]).colSpan=V,b.push(M);for(var M,k=B.extend([],D,null,!0),R=0,q=k.length;R<q;R++){if(R===k.length-1)for(var H=0,F=k[parseInt(R.toString(),10)];H<F.length;H++){var P=F[H];P.date=M.date,P.workDays=M.workDays,P.startHour=this.parent.getStartEndTime(P.resourceData[P.resource.startHourField])||M.startHour,P.endHour=this.parent.getStartEndTime(P.resourceData[P.resource.endHourField])||M.endHour}w[parseInt(R.toString(),10)]||(w[parseInt(R.toString(),10)]=[]),w[parseInt(R.toString(),10)]=w[parseInt(R.toString(),10)].concat(k[parseInt(R.toString(),10)])}}}return w.unshift(b),w},g.prototype.setResourceValues=function(n,e){function t(e,t,i){r.resourceCollection[parseInt(e.toString(),10)].allowMultiple&&r.parent.activeViewOptions.group.allowGroupEdit?n[""+t]=[i]:n[""+t]=i}var r=this;if(void 0===e&&(e=(this.parent.uiStateValues.isGroupAdaptive?this.parent.uiStateValues:this.parent.activeCellsData).groupIndex),0<this.parent.activeViewOptions.group.resources.length&&!B.isNullOrUndefined(e))for(var i=this.lastResourceLevel[parseInt(e.toString(),10)].groupOrder,a=0;a<this.resourceCollection.length;a++)t(a,this.resourceCollection[parseInt(a.toString(),10)].field,i[parseInt(a.toString(),10)]);else if(0<this.parent.resourceCollection.length)for(a=0;a<this.resourceCollection.length;a++){var s=this.resourceCollection[parseInt(a.toString(),10)].dataSource[0];s&&t(a,this.resourceCollection[parseInt(a.toString(),10)].field,s[this.resourceCollection[parseInt(a.toString(),10)].idField])}},g.prototype.getResourceColor=function(e,t){var i=!B.isNullOrUndefined(t)&&this.colorIndex>t.length-1?t.length-1:this.colorIndex,n=this.resourceCollection[parseInt(i.toString(),10)];if(!(B.isNullOrUndefined(t)&&this.parent.activeViewOptions.group.allowGroupEdit&&n.allowMultiple))return e=B.isNullOrUndefined(t)?e[n.field]:t[parseInt(i.toString(),10)],0<(t=this.filterData(n.dataSource,n.idField,e)).length?t[0][n.colorField]:void 0},g.prototype.getCssClass=function(e){var t=this.resourceCollection.slice(-1)[0];return(!this.parent.activeViewOptions.group.allowGroupEdit||!t.allowMultiple)&&0<(e=this.filterData(t.dataSource,t.idField,e[t.field])).length?e[0][t.cssClassField]:void 0},g.prototype.getResourceRenderDates=function(){var e=[].concat.apply([],this.lastResourceLevel.map(function(e){return e.renderDates})),i=e.map(function(e){return e.getTime()}),e=e.filter(function(e,t){return i.indexOf(e.getTime())===t});return e.sort(function(e,t){return e.getTime()-t.getTime()}),e},g.prototype.filterData=function(e,t,i){return e.filter(function(e){return e[""+t]===i})},g.prototype.getResourceData=function(e,t,i){if(this.parent.activeViewOptions.group.allowGroupEdit){for(var n={},r=0,a=i;r<a.length;r++)for(var s=a[r],o=this.lastResourceLevel[parseInt(s.toString(),10)].groupOrder,l=0,p=o.length;l<p;l++){var c=this.resourceCollection[parseInt(l.toString(),10)].field;B.isNullOrUndefined(n[""+c])&&(n[""+c]=[]),n[""+c].push(o[parseInt(l.toString(),10)])}B.extend(e,n)}else for(var l=0,h=this.resourceCollection.length;l<h;l++)this.lastResourceLevel[parseInt(t.toString(),10)]&&(e[this.resourceCollection[parseInt(l.toString(),10)].field]=this.lastResourceLevel[parseInt(t.toString(),10)].groupOrder[parseInt(l.toString(),10)])},g.prototype.addResource=function(e,t,n){for(var r=e instanceof Array?e:[e],i=0,a=this.parent.resourceCollection;i<a.length&&"break"!==function(i){if(i.name===t)return r.forEach(function(e,t){return new p.DataManager({json:i.dataSource}).insert(e,null,null,n+t)}),"break"}(a[i]);i++);this.refreshLayout(!0)},g.prototype.removeResource=function(e,i){for(var n=e instanceof Array?e:[e],t=0,r=this.parent.resourceCollection;t<r.length&&"break"!==function(t){if(t.name===i)return n.forEach(function(e){return new p.DataManager({json:t.dataSource}).remove(t.idField,e)}),"break"}(r[t]);t++);this.refreshLayout(!0)},g.prototype.getIndexFromResourceId=function(t,i,n,r,a){var e;return i=i||this.parent.resourceCollection.slice(-1)[0].name,B.isNullOrUndefined(n)&&(n=this.resourceCollection.filter(function(e){return e.name===i})[0],B.isNullOrUndefined(n))?null:(e=n.dataSource.filter(function(e){return!r||e[n.idField]!==t||e[n.groupIDField]===r[""+a]?e[n.idField]===t:null})[0],this.lastResourceLevel.map(function(e){return e.resourceData}).indexOf(e))},g.prototype.resourceExpand=function(t,i,e){var n=this.parent.resourceCollection.filter(function(e){return e.name===i?e:null})[0],r=0,a=n.dataSource.filter(function(e){return e[n.idField]===t})[0],r=this.parent.activeViewOptions.group.byGroupID?this.lastResourceLevel.map(function(e){return e.resourceData}).indexOf(a):this.getIndexFromResourceId(t,i,n),a=this.parent.element.querySelector("."+Wt+' [data-group-index="'+r+'"] .'+Qt);a&&(a.classList.contains(Gt)&&!e||a.classList.contains(Xt)&&e)&&a.click()},g.prototype.resourceScroll=function(t,e){var i,n,r,a,s,o;this.parent.isAdaptive||-1<["Agenda","MonthAgenda"].indexOf(this.parent.currentView)||(i=e||this.parent.resourceCollection.slice(-1)[0].name,n=this.parent.resourceCollection.length-1,r=this.parent.resourceCollection.filter(function(e,t){return e.name===i?(n=t,e):null})[0],e=this.parent.element.querySelector("."+A),a=0,this.parent.activeView.isTimelineView()?(a=this.parent.activeViewOptions.group.byGroupID?(s=r.dataSource.filter(function(e){return e[r.idField]===t})[0],this.lastResourceLevel.map(function(e){return e.resourceData}).indexOf(s)):this.getIndexFromResourceId(t,i,r),this.parent.virtualScrollModule?(s=this.parent.element.querySelector("."+xi),s=Math.round(s.offsetHeight/this.expandedResources.length),this.parent.rowAutoHeight&&(e.scrollTop=0,this.parent.virtualScrollModule.virtualScrolling()),e.scrollTop=a*s-(this.parent.virtualScrollModule.bufferCount-1)*s,this.parent.virtualScrollModule.virtualScrolling(),this.parent.rowAutoHeight?(o=this.parent.element.querySelector("."+O+'[data-group-index="'+a+'"]'))&&!o.parentElement.classList.contains(fr)&&(e.scrollTop=e.scrollTop<o.offsetTop?o.offsetTop:e.scrollTop+o.offsetTop):e.scrollTop=a*s):(o=this.parent.element.querySelector("."+O+'[data-group-index="'+a+'"]'))&&!o.parentElement.classList.contains(fr)&&(e.scrollTop=o.offsetTop)):(a=this.parent.activeViewOptions.group.byGroupID?(i===this.parent.resourceCollection.slice(-1)[0].name?this.lastResourceLevel.map(function(e){return e.resourceData[r.idField]}):r.dataSource.map(function(e){return e[r.idField]})).indexOf(t):this.getIndexFromResourceId(t,i,r),s="Month"===this.parent.currentView?this.parent.element.querySelector("."+Vt+" tbody tr:nth-child("+(n+1)+")"):this.parent.element.querySelector("."+nn+":nth-child("+(n+1)+")"),o=[].slice.call(s.children).map(function(e){return e.offsetLeft}),e.scrollLeft=o[parseInt(a.toString(),10)]))},g.prototype.destroy=function(){this.parent.off(Re,this.documentClick),this.treeViewObj&&(this.treeViewObj.portals&&0<this.treeViewObj.portals.length&&0<(e=this.treeViewObj.portals.map(function(e){return e.propName})).length&&this.parent.resetTemplates(e),this.treeViewObj.destroy(),this.treeViewObj=null),this.treePopup&&(this.treePopup.destroy(),this.treePopup=null,B.remove(this.parent.element.querySelector("."+Cr)),B.remove(this.parent.element.querySelector("."+Sr)));var e=this.parent.element.querySelector("."+pi);e&&B.remove(e)};var tl=g;function g(e){this.resourceCollection=[],this.leftPixel=25,this.resourceDateTree=[],this.parent=e}il=function(e,t){return(il=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var il,nl,$o=function(e,t){function i(){this.constructor=e}il(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},rl=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;0<=o;o--)(r=e[o])&&(s=(a<3?r(s):3<a?r(t,i,s):r(t,i))||s);return 3<a&&s&&Object.defineProperty(t,i,s),s},$o=(nl=B.ChildProperty,$o(al,nl),rl([B.Property("")],al.prototype,"id",void 0),rl([B.Property("")],al.prototype,"text",void 0),rl([B.Property("auto")],al.prototype,"width",void 0),rl([B.Property("")],al.prototype,"cssClass",void 0),rl([B.Property(!1)],al.prototype,"showAlwaysInPopup",void 0),rl([B.Property(!1)],al.prototype,"disabled",void 0),rl([B.Property("")],al.prototype,"prefixIcon",void 0),rl([B.Property("")],al.prototype,"suffixIcon",void 0),rl([B.Property(!0)],al.prototype,"visible",void 0),rl([B.Property("None")],al.prototype,"overflow",void 0),rl([B.Property("")],al.prototype,"template",void 0),rl([B.Property("Button")],al.prototype,"type",void 0),rl([B.Property("Both")],al.prototype,"showTextOn",void 0),rl([B.Property(null)],al.prototype,"htmlAttributes",void 0),rl([B.Property("")],al.prototype,"tooltipText",void 0),rl([B.Property("Left")],al.prototype,"align",void 0),rl([B.Property(-1)],al.prototype,"tabIndex",void 0),rl([B.Property("Custom")],al.prototype,"name",void 0),rl([B.Event()],al.prototype,"click",void 0),al);function al(){return null!==nl&&nl.apply(this,arguments)||this}sl=function(e,t){return(sl=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var sl,ol,rl=function(e,t){function i(){this.constructor=e}sl(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},m=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;0<=o;o--)(r=e[o])&&(s=(a<3?r(s):3<a?r(t,i,s):r(t,i))||s);return 3<a&&s&&Object.defineProperty(t,i,s),s},ll=(ol=B.Component,rl(v,ol),v.prototype.render=function(){var e=[],t=[];if(e.push(vt),(this.enableRtl?e:t).push(ft),(this.isAdaptive?e:t).push(yt),(this.enableAdaptiveUI?e:t).push(Tt),(this.allowMultiDrag?e:t).push(wt),this.cssClass)for(var i=0,n=this.cssClass.split(" ");i<n.length;i++){var r=n[i];e.push(r)}B.classList(this.element,e,t),this.validateDate(),M.createSpinner({target:this.element}),this.scrollModule=new Wr(this),this.scrollModule.setWidth(),this.scrollModule.setHeight(),this.renderModule=new fo(this),this.eventBase=new Ya(this),this.workCellAction=new jo(this),this.allowKeyboardInteraction&&(this.keyboardInteractionModule=new Xr(this)),this.inlineModule=new ts(this),this.initializeDataModule(),this.renderTableContainer(),this.activeViewOptions=this.getActiveViewOptions(),this.initializeResources(),this.wireEvents()},v.prototype.renderTableContainer=function(){this.element.querySelector("."+St)||this.element.appendChild(this.createElement("div",{className:St}))},v.prototype.getEventTemplateName=function(e){e="eventTemplate_"+e;return this.activeEventTemplates.indexOf(e)<0&&this.activeEventTemplates.push(e),e},v.prototype.getElementWidth=function(e){return ut(e,this.uiStateValues.isTransformed)},v.prototype.getElementHeight=function(e){return gt(e,this.uiStateValues.isTransformed)},v.prototype.getElementHeightFromClass=function(e,t){return Ne(e,t,this.uiStateValues.isTransformed)},v.prototype.renderTemplates=function(e){this.isReact?this.renderReactTemplates(e):e&&e()},v.prototype.resetTemplates=function(e){(this.isAngular||this.isReact)&&this.clearTemplate(e)},v.prototype.sanitize=function(e,t){this.enableHtmlSanitizer?t.innerText=B.SanitizeHtmlHelper.sanitize(e):t.innerHTML=e},v.prototype.initializeResources=function(e){void 0===e&&(e=!1),0<this.resources.length?(this.resourceBase=new tl(this),this.resourceBase.bindResourcesData(e)):(this.resourceBase=null,this.resourceCollection=[],this.renderElements(e))},v.prototype.destroyEditorWindow=function(){this.eventWindow&&(this.eventWindow.destroy(),this.eventWindow=null),this.eventWindow=new mo(this)},v.prototype.renderElements=function(e){e?(this.initializeView(this.currentView),this.eventWindow.refresh()):(this.destroyHeaderModule(),this.showHeaderBar&&(this.headerModule=new Br(this)),this.renderTableContainer(),this.uiStateValues.isTransformed=Math.round(this.element.getBoundingClientRect().width)!==this.element.offsetWidth,(B.Browser.isDevice||B.Browser.isTouch)&&(this.scheduleTouchModule=new Yr(this)),this.initializeView(this.currentView),this.destroyPopups(),this.isPrinting||this.initializePopups())},v.prototype.validateDate=function(e){var e=(e=void 0===e?this.selectedDate:e)instanceof Date?new Date(e.getTime()):new Date(e),t=B.isNullOrUndefined(this.minDate)?new Date(1900,0,1):this.minDate instanceof Date?new Date(this.minDate.getTime()):new Date(this.minDate),i=B.isNullOrUndefined(this.maxDate)?new Date(2099,11,31):this.maxDate instanceof Date?new Date(this.maxDate.getTime()):new Date(this.maxDate);if(!(t<=i))throw Error("minDate should be equal or less than maxDate");i<(e=e<t?t:e)&&(e=i),this.setProperties({selectedDate:new Date(""+e),minDate:new Date(""+t),maxDate:new Date(""+i)},!0),this.eventWindow&&this.eventWindow.updateMinMaxDateToEditor()},v.prototype.getViewIndex=function(e){for(var t=0;t<this.viewCollections.length;t++)if(this.viewCollections[parseInt(t.toString(),10)].option===e)return t;return-1},v.prototype.setViewOptions=function(e){if(void 0===e&&(e=!1),!B.isNullOrUndefined(this.views)&&0!==this.views.length){this.viewOptions={},this.viewCollections=[];var t,i,n=this.viewIndex,r=0;this.viewIndex=-1;for(var a=0,s=this.views;a<s.length;a++){var o=s[a],l="string"!=typeof o,l=("string"==typeof o?this.currentView===(t=o)&&(i=t,this.viewIndex=r):(t=o.option,o.isSelected&&(i=t,this.viewIndex=r)),B.extend({option:t},l?o:{})),o=t.charAt(0).toLowerCase()+t.slice(1);l.cellHeaderTemplateName=l.cellHeaderTemplate?l.option:"",l.dateHeaderTemplateName=l.dateHeaderTemplate?l.option:"",l.dateRangeTemplateName=l.dateRangeTemplate?l.option:"",l.cellTemplateName=l.cellTemplate?l.option:"",l.dayHeaderTemplateName=l.dayHeaderTemplate?l.option:"",l.monthHeaderTemplateName=l.monthHeaderTemplate?l.option:"",l.resourceHeaderTemplateName=l.resourceHeaderTemplate?l.option:"",l.headerIndentTemplateName=l.headerIndentTemplate?l.option:"",l.eventTemplateName=l.eventTemplate?l.option:"",B.isNullOrUndefined(l.firstDayOfWeek)||0!==l.firstDayOfWeek||delete l.firstDayOfWeek,B.isNullOrUndefined(l.interval)||1!==l.interval||delete l.interval,this.viewCollections.push(l),B.isNullOrUndefined(this.viewOptions[""+o])?this.viewOptions[""+o]=[l]:this.viewOptions[""+o].push(l),r++}!e&&i&&this.setProperties({currentView:i},!0),-1===this.viewIndex&&(e=this.getViewIndex(this.currentView),this.viewIndex="string"==typeof this.views[0]||B.isNullOrUndefined(n)||-1===n?-1===e?0:e:n)}},v.prototype.getActiveViewOptions=function(){var e={enable:this.timeScale.enable,interval:this.timeScale.interval,slotCount:this.timeScale.slotCount,majorSlotTemplate:this.timeScale.majorSlotTemplate,minorSlotTemplate:this.timeScale.minorSlotTemplate},t={byDate:!(-1<this.viewCollections[this.viewIndex].option.indexOf("Year"))&&this.group.byDate,byGroupID:this.group.byGroupID,allowGroupEdit:this.group.allowGroupEdit,resources:B.isNullOrUndefined(this.group.resources)?[]:this.group.resources,headerTooltipTemplate:this.group.headerTooltipTemplate,enableCompactView:this.group.enableCompactView,hideNonWorkingDays:-1<["Day","Week","WorkWeek","Month"].indexOf(this.currentView)&&this.group.hideNonWorkingDays},i=this.viewCollections[this.viewIndex].workDays?[]:this.workDays,i={dateFormat:this.dateFormat,endHour:this.endHour,isSelected:!1,option:null,readonly:this.readonly,startHour:this.startHour,allowVirtualScrolling:!1,allowOverlap:this.allowOverlap,overscanCount:this.overscanCount,cellHeaderTemplate:this.cellHeaderTemplate,dayHeaderTemplate:this.dayHeaderTemplate,monthHeaderTemplate:this.monthHeaderTemplate,cellTemplate:this.cellTemplate,eventTemplate:this.eventSettings.template,dateHeaderTemplate:this.dateHeaderTemplate,dateRangeTemplate:this.dateRangeTemplate,resourceHeaderTemplate:this.resourceHeaderTemplate,headerIndentTemplate:this.headerIndentTemplate,firstMonthOfYear:this.firstMonthOfYear,firstDayOfWeek:this.firstDayOfWeek,workDays:i,monthsCount:this.monthsCount,showWeekend:this.showWeekend,showWeekNumber:this.showWeekNumber,displayName:null,interval:1,timeScale:e,timeFormat:this.internalTimeFormat,group:t,headerRows:this.headerRows,orientation:"Horizontal",numberOfWeeks:0,displayDate:null,enableLazyLoading:!1},e=this.viewCollections[this.viewIndex],t=B.extend(i,e,void 0,!0);return 0!==this.firstDayOfWeek&&e.firstDayOfWeek&&this.firstDayOfWeek!==e.firstDayOfWeek&&(t.firstDayOfWeek=this.firstDayOfWeek),t.displayDate&&(t.displayDate=t.displayDate instanceof Date?new Date(t.displayDate.getTime()):new Date(t.displayDate)),t.enableLazyLoading&&!B.isNullOrUndefined(t.group.resources)&&0<t.group.resources.length&&(-1===["Agenda","MonthAgenda","Year","TimelineYear"].indexOf(t.option)||"TimelineYear"===t.option&&"Vertical"===t.orientation)&&(t.allowVirtualScrolling=!0),t},v.prototype.initializeDataModule=function(){this.eventFields={id:this.eventSettings.fields.id,isBlock:this.eventSettings.fields.isBlock,subject:this.eventSettings.fields.subject.name,startTime:this.eventSettings.fields.startTime.name,endTime:this.eventSettings.fields.endTime.name,startTimezone:this.eventSettings.fields.startTimezone.name,endTimezone:this.eventSettings.fields.endTimezone.name,location:this.eventSettings.fields.location.name,description:this.eventSettings.fields.description.name,isAllDay:this.eventSettings.fields.isAllDay.name,recurrenceID:this.eventSettings.fields.recurrenceID.name,recurrenceRule:this.eventSettings.fields.recurrenceRule.name,recurrenceException:this.eventSettings.fields.recurrenceException.name,isReadonly:this.eventSettings.fields.isReadonly,followingID:this.eventSettings.fields.followingID},this.setEditorTitles(),this.dataModule=new Qr(this,this.eventSettings.dataSource,this.eventSettings.query),this.crudModule=new Ho(this)},v.prototype.setEditorTitles=function(){this.editorTitles={subject:this.eventSettings.fields.subject.title||this.localeObj.getConstant("title"),startTime:this.eventSettings.fields.startTime.title||this.localeObj.getConstant("start"),endTime:this.eventSettings.fields.endTime.title||this.localeObj.getConstant("end"),isAllDay:this.eventSettings.fields.isAllDay.title||this.localeObj.getConstant("allDay"),startTimezone:this.eventSettings.fields.startTimezone.title||this.localeObj.getConstant("startTimezone"),endTimezone:this.eventSettings.fields.endTimezone.title||this.localeObj.getConstant("endTimezone"),location:this.eventSettings.fields.location.title||this.localeObj.getConstant("location"),description:this.eventSettings.fields.description.title||this.localeObj.getConstant("description"),recurrenceRule:this.eventSettings.fields.recurrenceRule.title||this.localeObj.getConstant("repeat")}},v.prototype.initializeView=function(e){this.showSpinner(),this.activeViewOptions=this.getActiveViewOptions(),this.resourceBase&&this.resourceBase.setResourceCollection(),this.initializeTemplates(),this.renderModule.render(e)},v.prototype.initializeTemplates=function(){this.cellHeaderTemplateFn=this.templateParser(this.activeViewOptions.cellHeaderTemplate),this.dayHeaderTemplateFn=this.templateParser(this.activeViewOptions.dayHeaderTemplate),this.monthHeaderTemplateFn=this.templateParser(this.activeViewOptions.monthHeaderTemplate),this.cellTemplateFn=this.templateParser(this.activeViewOptions.cellTemplate),this.dateHeaderTemplateFn=this.templateParser(this.activeViewOptions.dateHeaderTemplate),this.dateRangeTemplateFn=this.templateParser(this.activeViewOptions.dateRangeTemplate),this.majorSlotTemplateFn=this.templateParser(this.activeViewOptions.timeScale.majorSlotTemplate),this.minorSlotTemplateFn=this.templateParser(this.activeViewOptions.timeScale.minorSlotTemplate),this.appointmentTemplateFn=this.templateParser(this.activeViewOptions.eventTemplate),this.resourceHeaderTemplateFn=this.templateParser(this.activeViewOptions.resourceHeaderTemplate),this.headerIndentTemplateFn=this.templateParser(this.activeViewOptions.headerIndentTemplate),this.headerTooltipTemplateFn=this.templateParser(this.activeViewOptions.group.headerTooltipTemplate),this.eventTooltipTemplateFn=this.templateParser(this.eventSettings.tooltipTemplate),this.editorTemplateFn=this.templateParser(this.editorTemplate),this.editorHeaderTemplateFn=this.templateParser(this.editorHeaderTemplate),this.editorFooterTemplateFn=this.templateParser(this.editorFooterTemplate),this.quickInfoTemplatesHeaderFn=this.templateParser(this.quickInfoTemplates.header),this.quickInfoTemplatesContentFn=this.templateParser(this.quickInfoTemplates.content),this.quickInfoTemplatesFooterFn=this.templateParser(this.quickInfoTemplates.footer)},v.prototype.initializePopups=function(){this.eventWindow=new mo(this),this.quickPopup=new as(this)},v.prototype.getDayNames=function(e){for(var t=[],i="",n=B.isNullOrUndefined(this.locale)||"en"===this.locale||"en-US"===this.locale?B.getValue((i="days.stand-alone.")+e,B.getDefaultDateObject(this.getCalendarMode())):(i="main."+this.locale+".dates.calendars."+this.getCalendarMode()+".days.format."+e,B.getValue(i,B.cldrData)),r=0,a=Object.keys(n);r<a.length;r++){var s=a[r];t.push(B.getValue(s,n))}return t},v.prototype.setCldrTimeFormat=function(){B.isNullOrUndefined(this.timeFormat)?B.isNullOrUndefined(this.locale)||"en"===this.locale||"en-US"===this.locale?this.internalTimeFormat=B.getValue("timeFormats.short",B.getDefaultDateObject(this.getCalendarMode())):this.internalTimeFormat=B.getValue("main."+this.locale+".dates.calendars."+this.getCalendarMode()+".timeFormats.short",B.cldrData):this.internalTimeFormat=this.timeFormat},v.prototype.getCalendarMode=function(){return B.isNullOrUndefined(this.calendarMode)?"gregorian":this.calendarMode.toLowerCase()},v.prototype.getTimeString=function(e){return this.globalize.formatDate(e,{format:this.activeViewOptions.timeFormat,type:"time",calendar:this.getCalendarMode()}).toLocaleUpperCase()},v.prototype.getDateTime=function(e){return e instanceof Date?new Date(e.getTime()):new Date(e)},v.prototype.setCalendarMode=function(){"Islamic"===this.calendarMode?this.calendarUtil=new $r:this.calendarUtil=new Zr},v.prototype.changeView=function(i,n,e,t){var r,a,s=this;B.isNullOrUndefined(t)&&(t=this.getViewIndex(i)),!e&&t===this.viewIndex&&this.currentView===i||t<0||(r=this.activeViewOptions?this.activeViewOptions.option:this.currentView,this.trigger(Q,{requestType:"viewNavigate",cancel:!1,event:n},function(e){e.cancel?s.currentView=r:(e={action:"view",cancel:!1,currentDate:s.selectedDate,previousView:r,currentView:i,viewIndex:t},s.trigger(J,e,function(e){var t;e.cancel?s.currentView=r:(t=-1<["Day","Week","WorkWeek"].indexOf(i)&&["Day","Week","WorkWeek"].indexOf(r)<0,s.uiStateValues.isInitial=t||-1<i.indexOf("Timeline")||-1<i.indexOf("Year"),s.uiStateValues.top=-1<i.indexOf("Timeline")&&r.indexOf("Timeline")<0?0:s.uiStateValues.top,s.viewIndex=e.viewIndex,s.setProperties({currentView:i},!0),s.headerModule&&(s.headerModule.updateActiveView(),s.headerModule.setCalendarDate(s.selectedDate),s.headerModule.setCalendarView()),s.initializeView(s.currentView),s.animateLayout(),a={requestType:"viewNavigate",cancel:!1,event:n},s.trigger(K,a))}))}))},v.prototype.changeDate=function(t,i){var n,r=this;this.trigger(Q,{requestType:"dateNavigate",cancel:!1,event:i},function(e){e.cancel||(e={action:"date",cancel:!1,previousDate:r.selectedDate,currentDate:t},r.trigger(J,e,function(e){e.cancel||(r.uiStateValues.isInitial=r.activeView.isTimelineView()&&"TimelineYear"!==r.currentView,r.validateDate(e.currentDate),r.headerModule&&r.headerModule.setCalendarDate(e.currentDate),"MonthAgenda"===r.currentView&&r.monthAgendaModule&&(r.monthAgendaModule.monthAgendaDate=new Date(""+r.selectedDate)),r.initializeView(r.currentView),r.animateLayout(),n={requestType:"dateNavigate",cancel:!1,event:i},r.trigger(K,n))}))})},v.prototype.isMinMaxDate=function(e){void 0===e&&(e=this.selectedDate);var t=B.isNullOrUndefined(this.maxDate)?new Date(2099,11,31):this.maxDate,i=B.isNullOrUndefined(this.minDate)?new Date(1900,0,1):this.minDate;return e.getTime()>=i.getTime()&&e.getTime()<=t.getTime()},v.prototype.isSelectedDate=function(e){return e.setHours(0,0,0,0)===new Date(""+this.selectedDate).setHours(0,0,0,0)},v.prototype.getCurrentTime=function(e){return void 0===e&&(e=new Date),this.timezone?this.tzModule.convert(e,this.tzModule.getLocalTimezoneName(),this.timezone):e},v.prototype.getNavigateView=function(){return this.activeView.isTimelineView()?"TimelineMonth"===this.currentView||"TimelineYear"===this.currentView?"TimelineDay":"Agenda":"Day"},v.prototype.animateLayout=function(){this.activeView.element&&new B.Animation({duration:600,name:"FadeIn",timingFunction:"easeIn"}).animate(this.activeView.element)},v.prototype.requiredModules=function(){var e=[];this.setViewOptions(!0);for(var t=0,i=Object.keys(this.viewOptions);t<i.length;t++){var n=i[t];e.push({member:"timelineDay"===n||"timelineWeek"===n||"timelineWorkWeek"===n?"timelineViews":n,args:[this]})}return this.allowDragAndDrop&&e.push({member:"dragAndDrop",args:[this]}),this.allowResizing&&e.push({member:"resize",args:[this]}),e.push({member:"excelExport",args:[this]}),e.push({member:"iCalendarExport",args:[this]}),e.push({member:"iCalendarImport",args:[this]}),e.push({member:"print",args:[this]}),e},v.prototype.preRender=function(){this.isAdaptive=B.Browser.isDevice||dt(),this.globalize=new B.Internationalization(this.locale),this.tzModule=new ta,(this&&B.isNullOrUndefined(this.uiStateValues)||!this.enablePersistence)&&(this.uiStateValues={expand:!1,isInitial:!0,left:0,top:0,isGroupAdaptive:!1,isIgnoreOccurrence:!1,groupIndex:this.adaptiveGroupIndex,action:!1,isBlock:!1,isCustomMonth:!0,isPreventTimezone:!1,isTransformed:!1}),this.currentTimezoneDate=this.getCurrentTime(),this.activeCellsData={startTime:new Date(this.currentTimezoneDate),endTime:new Date(this.currentTimezoneDate),isAllDay:!1},this.activeEventData={event:void 0,element:void 0},this.getDefaultLocale(),this.localeObj=new B.L10n(this.getModuleName(),this.defaultLocale,this.locale),this.setCldrTimeFormat(),this.setCalendarMode(),this.eventsData=[],this.eventsProcessed=[],this.blockData=[],this.blockProcessed=[],this.resourceCollection=[],this.currentAction=null,this.selectedElements=[],this.activeEventTemplates=[],this.setViewOptions()},v.prototype.getDefaultLocale=function(){this.defaultLocale={day:"Day",week:"Week",workWeek:"Work Week",month:"Month",year:"Year",agenda:"Agenda",weekAgenda:"Week Agenda",workWeekAgenda:"Work Week Agenda",monthAgenda:"Month Agenda",today:"Today",noEvents:"No events",emptyContainer:"There are no events scheduled on this day.",allDay:"All day",start:"Start",end:"End",more:"more",close:"Close",cancel:"Cancel",noTitle:"(No Title)",delete:"Delete",deleteEvent:"Delete Event",deleteMultipleEvent:"Delete Multiple Events",selectedItems:"Items selected",deleteSeries:"Entire Series",edit:"Edit",editSeries:"Entire Series",editEvent:"Edit Event",createEvent:"Create",subject:"Subject",addTitle:"Add title",moreDetails:"More Details",moreEvents:"More Events",save:"Save",editContent:"How would you like to change the appointment in the series?",deleteContent:"Are you sure you want to delete this event?",deleteMultipleContent:"Are you sure you want to delete the selected events?",newEvent:"New Event",title:"Title",location:"Location",description:"Description",timezone:"Timezone",startTimezone:"Start Timezone",endTimezone:"End Timezone",repeat:"Repeat",saveButton:"Save",cancelButton:"Cancel",deleteButton:"Delete",recurrence:"Recurrence",wrongPattern:"The recurrence pattern is not valid.",seriesChangeAlert:"Do you want to cancel the changes made to specific instances of this series and match it to the whole series again?",createError:"The duration of the event must be shorter than how frequently it occurs. Shorten the duration, or change the recurrence pattern in the recurrence event editor.",sameDayAlert:"Two occurrences of the same event cannot occur on the same day.",occurenceAlert:"Cannot reschedule an occurrence of the recurring appointment if it skips over a later occurrence of the same appointment.",editRecurrence:"Edit Recurrence",recurringEvent:"Recurring Event",repeats:"Repeats",alert:"Alert",startEndError:"The selected end date occurs before the start date.",invalidDateError:"The entered date value is invalid.",blockAlert:"Events cannot be scheduled within the blocked time range.",overlapAlert:"Events cannot be scheduled during the chosen time as it overlaps with another event.",ok:"Ok",yes:"Yes",no:"No",of:"of",occurrence:"Occurrence",series:"Series",previous:"Previous",next:"Next",timelineDay:"Timeline Day",timelineWeek:"Timeline Week",timelineWorkWeek:"Timeline Work Week",timelineMonth:"Timeline Month",timelineYear:"Timeline Year",editFollowingEvent:"Following Events",deleteTitle:"Delete Event",editTitle:"Edit Event",beginFrom:"Begin From",endAt:"Ends At",expandAllDaySection:"Expand-all-day-section",collapseAllDaySection:"Collapse-all-day-section",searchTimezone:"Search Timezone",noRecords:"No records found"}},v.prototype.wireEvents=function(){B.EventHandler.add(window,"resize",this.onScheduleResize,this),B.EventHandler.add(window,"orientationchange",this.onScheduleResize,this),B.EventHandler.add(document,B.Browser.touchStartEvent,this.onDocumentClick,this),this.allowClipboard&&B.EventHandler.add(document,"paste",this.onDocumentPaste,this)},v.prototype.removeSelectedClass=function(){for(var e=this.getSelectedCells(),t=0,i=e;t<i.length;t++)i[t].removeAttribute("tabindex");B.removeClass(e,di),this.keyboardInteractionModule&&0<this.keyboardInteractionModule.selectedCells.length&&(this.keyboardInteractionModule.selectedCells=[])},v.prototype.addSelectedClass=function(e,t,i){B.addClass(e,di),t&&(t.setAttribute("tabindex","0"),t.focus({preventScroll:i||!1}))},v.prototype.selectCell=function(e){this.removeSelectedClass(),this.addSelectedClass([e],e)},v.prototype.getAllDayRow=function(){return this.element.querySelector("."+Ot)},v.prototype.getContentTable=function(){return this.activeView.element.querySelector("."+C+" tbody")},v.prototype.getTableRows=function(){return[].slice.call(this.element.querySelectorAll("."+C+" tbody tr:not(."+fr+")"))},v.prototype.getWorkCellElements=function(){return[].slice.call(this.element.querySelectorAll("."+O))},v.prototype.getIndexOfDate=function(e,t){return e.map(Number).indexOf(+t)},v.prototype.isAllDayCell=function(e){return!(!(-1<["Month","TimelineMonth","TimelineYear","MonthAgenda"].indexOf(this.currentView)||e.classList.contains(w)||e.classList.contains(It))&&this.activeViewOptions.timeScale.enable&&!(this.activeView.isTimelineView()&&0<this.activeViewOptions.headerRows.length&&"Hour"!==this.activeViewOptions.headerRows.slice(-1)[0].option))},v.prototype.getDateFromElement=function(e){var t;if(B.isNullOrUndefined(e)||(t=e.getAttribute("data-date")),!B.isNullOrUndefined(t))return e=parseInt(t,10),new Date(e)},v.prototype.getTargetElement=function(e,t,i){var n,t=document.elementFromPoint(t,i);return(n=t?t.closest(e):n)?[n]:null},v.prototype.getCellHeaderTemplate=function(){return this.cellHeaderTemplateFn},v.prototype.getDayHeaderTemplate=function(){return this.dayHeaderTemplateFn},v.prototype.getMonthHeaderTemplate=function(){return this.monthHeaderTemplateFn},v.prototype.getCellTemplate=function(){return this.cellTemplateFn},v.prototype.getDateHeaderTemplate=function(){return this.dateHeaderTemplateFn},v.prototype.getDateRangeTemplate=function(){return this.dateRangeTemplateFn},v.prototype.getMajorSlotTemplate=function(){return this.majorSlotTemplateFn},v.prototype.getMinorSlotTemplate=function(){return this.minorSlotTemplateFn},v.prototype.getAppointmentTemplate=function(){return this.appointmentTemplateFn},v.prototype.getEventTooltipTemplate=function(){return this.eventTooltipTemplateFn},v.prototype.getHeaderTooltipTemplate=function(){return this.headerTooltipTemplateFn},v.prototype.getEditorTemplate=function(){return this.editorTemplateFn},v.prototype.getEditorHeaderTemplate=function(){return this.editorHeaderTemplateFn},v.prototype.getEditorFooterTemplate=function(){return this.editorFooterTemplateFn},v.prototype.getQuickInfoTemplatesHeader=function(){return this.quickInfoTemplatesHeaderFn},v.prototype.getQuickInfoTemplatesContent=function(){return this.quickInfoTemplatesContentFn},v.prototype.getQuickInfoTemplatesFooter=function(){return this.quickInfoTemplatesFooterFn},v.prototype.getResourceHeaderTemplate=function(){return this.resourceHeaderTemplateFn},v.prototype.getHeaderIndentTemplate=function(){return this.headerIndentTemplateFn},v.prototype.getCssProperties=function(){return{border:this.enableRtl?"borderLeftWidth":"borderRightWidth",padding:this.enableRtl?"paddingLeft":"paddingRight",rtlBorder:this.enableRtl?"borderRightWidth":"borderLeftWidth",rtlPadding:this.enableRtl?"paddingRight":"paddingLeft"}},v.prototype.removeNewEventElement=function(){var e=this.element.querySelector("."+zi);B.isNullOrUndefined(e)||B.remove(e)},v.prototype.getStartEndTime=function(e){var t;return B.isNullOrUndefined(e)||""===e?null:(t=z(new Date(this.currentTimezoneDate)||this.getCurrentTime()),2===(e=e.split(":")).length&&t.setHours(parseInt(e[0],10),parseInt(e[1],10),0),t)},v.prototype.onDocumentClick=function(e){this.notify(Re,{event:e})},v.prototype.onDocumentPaste=function(e){this.notify(He,{event:e})},v.prototype.onScheduleResize=function(){var e,t;B.isNullOrUndefined(this.activeView)||(this.isAdaptive||ht())&&document.activeElement&&(document.activeElement.classList.contains(Gn)||document.activeElement.classList.contains(Pr))||this.uiStateValues.isTapHold||(this.virtualScrollModule&&this.activeView.isTimelineView()&&this.virtualScrollModule.refreshLayout(),this.activeViewOptions.timeScale.enable&&this.activeView&&this.activeView.highlightCurrentTime(),this.quickPopup&&this.quickPopup.onClosePopup(),at(),"Month"===this.currentView||"Agenda"!==this.currentView&&"MonthAgenda"!==this.currentView&&!this.activeViewOptions.timeScale.enable||this.activeView.isTimelineView()?(this.activeView.resetColWidth(),this.notify(Me,{cssProperties:this.getCssProperties(),isPreventScrollUpdate:!0}),e=!1,this.activeViewOptions.enableLazyLoading&&this.virtualScrollModule&&this.virtualScrollModule.isRemoteRefresh&&(e=this.virtualScrollModule.isRemoteRefresh,this.virtualScrollModule.isRemoteRefresh=!1),this.refreshEvents(e),this.virtualScrollModule&&!this.virtualScrollModule.enableTransition&&(e=this.element.querySelector("."+Wt),t=this.element.querySelector("."+A),this.virtualScrollModule.enableTransition=!0,B.addClass([t,e],"e-transition"))):this.notify(Ve,{}))},v.prototype.templateParser=function(t){if(t)try{return"function"!=typeof t&&document.querySelectorAll(t).length?B.compile(document.querySelector(t).innerHTML.trim()):B.compile(t)}catch(e){return B.compile(t)}},v.prototype.getSelectedCells=function(){return[].slice.call(this.element.querySelectorAll("."+di))},v.prototype.getAnnouncementString=function(e,t){this.quickPopup&&0<this.activeViewOptions.group.resources.length&&(i=this.quickPopup.getResourceText({event:e},"event")+'"s event - ');var i,t=t||e[this.eventFields.subject]||this.eventSettings.fields.subject.default,n=e[this.eventFields.location]||this.eventSettings.fields.location.default,r=this.globalize.formatDate(e[this.eventFields.startTime],{type:"dateTime",skeleton:"full",calendar:this.getCalendarMode()}),a=this.globalize.formatDate(e[this.eventFields.endTime],{type:"dateTime",skeleton:"full",calendar:this.getCalendarMode()}),t=t+" "+this.localeObj.getConstant("beginFrom")+" "+r+" "+this.localeObj.getConstant("endAt")+" "+a;return i&&(t=i+" "+t),n&&""!==n&&(t=t+" "+this.localeObj.getConstant("location")+" "+n),t=e[this.eventFields.recurrenceRule]&&""!==e[this.eventFields.recurrenceRule]&&e[this.eventFields.id]===e[this.eventFields.recurrenceID]?t+" "+this.localeObj.getConstant("recurringEvent"):t},v.prototype.boundaryValidation=function(e,t){var i={left:!1,right:!1,top:!1,bottom:!1},n=this.element.querySelector("."+A).getBoundingClientRect();return e<n.top+30+window.pageYOffset&&e>n.top+window.pageYOffset&&(i.top=!0),e>n.bottom-30+window.pageYOffset&&e<n.bottom+window.pageYOffset&&(i.bottom=!0),t<n.left+30+window.pageXOffset&&t>n.left+window.pageXOffset&&(i.left=!0),t>n.right-30+window.pageXOffset&&t<n.right+window.pageXOffset&&(i.right=!0),i},v.prototype.getWeekNumberContent=function(e){var t,i,n;return"FirstDay"===this.weekRule?(t=Be(e.slice(-1)[0],this.firstDayOfWeek),t=this.globalize.formatNumber(Ye(t))):"FirstFourDayWeek"===this.weekRule?(i=_e(n=Ue(e.slice(-1)[0],this.firstDayOfWeek),Be(e.slice(-1)[0],this.firstDayOfWeek)),t=this.globalize.formatNumber(Ye(i))):"FirstFullWeek"===this.weekRule&&(n=Ue(e.slice(-1)[0],this.firstDayOfWeek),t=this.globalize.formatNumber(Ye(n))),t},v.prototype.renderHeaderIndentTemplate=function(e,t){var i;this.activeViewOptions.headerIndentTemplate&&(i=this.element.id+"_"+this.activeViewOptions.headerIndentTemplateName+"headerIndentTemplate",e=[].slice.call(this.getHeaderIndentTemplate()(e,this,"headerIndentTemplate",i,!1,void 0,void 0,this.root)),B.append(e,t))},v.prototype.isSpecificResourceEvents=function(){return 0<this.activeViewOptions.group.resources.length&&!this.activeViewOptions.group.allowGroupEdit&&!this.rowAutoHeight&&!this.virtualScrollModule&&this.activeViewOptions.group.byGroupID},v.prototype.unWireEvents=function(){B.EventHandler.remove(window,"resize",this.onScheduleResize),B.EventHandler.remove(window,"orientationchange",this.onScheduleResize),B.EventHandler.remove(document,B.Browser.touchStartEvent,this.onDocumentClick),B.EventHandler.remove(document,"paste",this.onDocumentPaste)},v.prototype.getModuleName=function(){return"schedule"},v.prototype.getPersistData=function(){return this.addOnPersist(["currentView","selectedDate","scrollTop","scrollLeft","adaptiveGroupIndex"])},v.prototype.onPropertyChanged=function(e,t){if(!this.isReact||!B.isNullOrUndefined(this.activeView)){for(var i={isRefresh:!1,isResource:!1,isDate:!1,isView:!1,isLayout:!1,isDataManager:!1},n=0,r=Object.keys(e);n<r.length;n++){var a=r[n];switch(a){case"views":this.setViewOptions(),this.headerModule&&this.headerModule.updateItems(),i.isView=!0;break;case"currentView":i.isView=!0;break;case"minDate":case"maxDate":case"selectedDate":i.isDate=!0;break;case"dateFormat":this.activeViewOptions=this.getActiveViewOptions(),this.headerModule&&this.headerModule.updateDateRange();break;case"showHeaderBar":case"toolbarItems":this.destroyHeaderModule(),e.showHeaderBar&&(this.headerModule=new Br(this),this.headerModule.updateDateRange()),this.notify(Me,{cssProperties:this.getCssProperties()}),this.activeView.isTimelineView()&&this.refreshEvents(!1);break;case"workDays":JSON.stringify(t.workDays)!==JSON.stringify(e.workDays)&&(i.isLayout=!0);break;case"showWeekend":case"startHour":case"endHour":case"workHours":case"readonly":case"headerRows":case"showWeekNumber":case"rowAutoHeight":i.isLayout=!0;break;case"locale":case"calendarMode":this.globalize=new B.Internationalization(this.locale),this.localeObj=new B.L10n(this.getModuleName(),this.defaultLocale,this.locale),this.setCldrTimeFormat(),this.setCalendarMode(),i.isRefresh=!0;break;case"firstDayOfWeek":this.activeViewOptions.firstDayOfWeek=e.firstDayOfWeek,this.eventWindow&&this.eventWindow.refreshRecurrenceEditor(),i.isLayout=!0;break;case"showTimeIndicator":this.activeViewOptions.timeScale.enable&&this.activeView&&this.activeView.highlightCurrentTime();break;case"cellHeaderTemplate":this.activeViewOptions.cellHeaderTemplate=e.cellHeaderTemplate,this.cellHeaderTemplateFn=this.templateParser(this.activeViewOptions.cellHeaderTemplate),i.isLayout=!0;break;case"cellTemplate":this.activeViewOptions.cellTemplate=e.cellTemplate,this.cellTemplateFn=this.templateParser(this.activeViewOptions.cellTemplate),i.isLayout=!0;break;case"dateHeaderTemplate":this.activeViewOptions.dateHeaderTemplate=e.dateHeaderTemplate,this.dateHeaderTemplateFn=this.templateParser(this.activeViewOptions.dateHeaderTemplate),i.isLayout=!0;break;case"dateRangeTemplate":this.activeViewOptions.dateRangeTemplate=e.dateRangeTemplate,this.dateRangeTemplateFn=this.templateParser(this.activeViewOptions.dateRangeTemplate),this.headerModule&&this.headerModule.updateDateRange();break;case"dayHeaderTemplate":this.activeViewOptions.dayHeaderTemplate=e.dayHeaderTemplate,this.dayHeaderTemplateFn=this.templateParser(this.activeViewOptions.dayHeaderTemplate),i.isLayout=!0;break;case"monthHeaderTemplate":this.activeViewOptions.monthHeaderTemplate=e.monthHeaderTemplate,this.monthHeaderTemplateFn=this.templateParser(this.activeViewOptions.monthHeaderTemplate),i.isLayout=!0;break;case"resourceHeaderTemplate":this.activeViewOptions.resourceHeaderTemplate=e.resourceHeaderTemplate,this.resourceHeaderTemplateFn=this.templateParser(this.activeViewOptions.resourceHeaderTemplate),i.isLayout=!0;break;case"timezone":this.eventBase.timezonePropertyChange(t.timezone),this.headerModule&&this.headerModule.setCalendarTimezone();break;case"enableRtl":this.setRtlClass(),i.isRefresh=!0;break;default:this.extendedPropertyChange(a,e,t,i)}}this.propertyChangeAction(i)}},v.prototype.propertyChangeAction=function(e){e.isRefresh?this.refresh():e.isResource?this.initializeResources(!0):e.isView?this.changeView(this.currentView,null,!0):e.isDate?(B.isNullOrUndefined(this.selectedDate)&&this.setProperties({selectedDate:this.getCurrentTime()},!0),this.changeDate(this.selectedDate)):e.isLayout?(this.activeCellsData=null,this.initializeView(this.currentView)):e.isDataManager&&this.crudModule&&(this.dragAndDropModule&&(this.dragAndDropModule.actionObj.action="",B.removeClass([this.element],Wi)),this.crudModule.refreshDataManager())},v.prototype.allDayRowScrollUpdate=function(){var e=this.element.querySelector("."+Vt),t=this.element.querySelector("."+Ot);"auto"!==this.height&&this.enableAllDayScroll?(e.classList.contains(Fr)&&B.removeClass([e],Fr),this.eventBase.allDayExpandScroll(e)):(B.addClass([e],Fr),e.classList.contains(qr)&&B.removeClass([e],qr),this.uiStateValues.expand&&((e=[].slice.call(this.element.querySelectorAll("."+w)))[0].style.height=t.style.height||e[1].style.height)),this.uiStateValues.expand||(t.style.height="")},v.prototype.extendedPropertyChange=function(e,t,i,n){switch(e){case"width":case"height":case"enableAllDayScroll":-1<["Day","Week","WorkWeek"].indexOf(this.currentView)&&this.allDayRowScrollUpdate(),this.notify(ke,{module:"scroll",properties:{width:t.width,height:t.height}});break;case"cssClass":i.cssClass&&B.removeClass([this.element],i.cssClass.split(" ")),t.cssClass&&B.addClass([this.element],t.cssClass.split(" "));break;case"hideEmptyAgendaDays":case"agendaDaysCount":this.activeViewOptions=this.getActiveViewOptions(),n.isView=!0;break;case"eventSettings":this.onEventSettingsPropertyChanged(t.eventSettings,i.eventSettings,n);break;case"allowKeyboardInteraction":case"allowClipboard":this.keyboardInteractionModule&&(this.keyboardInteractionModule.destroy(),this.keyboardInteractionModule=null),(t.allowKeyboardInteraction||t.allowClipboard)&&(this.keyboardInteractionModule=new Xr(this)),"allowClipboard"===e&&(t.allowClipboard?B.EventHandler.add(document,"paste",this.onDocumentPaste,this):B.EventHandler.remove(document,"paste",this.onDocumentPaste));break;case"timezoneDataSource":this.eventWindow&&this.eventWindow.refresh();break;case"editorTemplate":B.isNullOrUndefined(this.editorTemplate)||(this.editorTemplateFn=this.templateParser(this.editorTemplate)),this.eventWindow&&this.eventWindow.setDialogContent();break;case"editorHeaderTemplate":B.isNullOrUndefined(this.editorHeaderTemplate)||(this.editorHeaderTemplateFn=this.templateParser(this.editorHeaderTemplate)),this.eventWindow&&this.eventWindow.setDialogHeader();break;case"editorFooterTemplate":B.isNullOrUndefined(this.editorFooterTemplate)||(this.editorFooterTemplateFn=this.templateParser(this.editorFooterTemplate)),this.eventWindow&&this.eventWindow.setDialogFooter();break;case"quickInfoTemplates":this.quickInfoTemplates.header&&(this.quickInfoTemplatesHeaderFn=this.templateParser(this.quickInfoTemplates.header)),this.quickInfoTemplates.content&&(this.quickInfoTemplatesContentFn=this.templateParser(this.quickInfoTemplates.content)),this.quickInfoTemplates.footer&&(this.quickInfoTemplatesFooterFn=this.templateParser(this.quickInfoTemplates.footer));break;case"group":this.onGroupSettingsPropertyChanged(t.group,i.group,n);break;case"resources":n.isResource=!0;break;case"timeScale":this.activeViewOptions.timeScale.interval=t.timeScale.interval||this.activeViewOptions.timeScale.interval,this.activeViewOptions.timeScale.slotCount=t.timeScale.slotCount||this.activeViewOptions.timeScale.slotCount,this.eventWindow&&this.eventWindow.refreshDateTimePicker(),n.isLayout=!0;break;case"allowDragAndDrop":case"allowResizing":case"eventDragArea":case"allowOverlap":this.refreshEvents(!1);break;case"weekRule":n.isLayout=!0;break;case"firstMonthOfYear":this.activeViewOptions.firstMonthOfYear=t.firstMonthOfYear,this.viewIndex=this.activeView.viewIndex,n.isLayout=!0;break;case"monthsCount":this.activeViewOptions.monthsCount=t.monthsCount,this.viewIndex=this.activeView.viewIndex,n.isLayout=!0;break;case"timeFormat":this.internalTimeFormat=t.timeFormat||this.activeViewOptions.timeFormat,this.eventWindow&&this.eventWindow.refreshDateTimePicker(),n.isLayout=!0;break;case"enableAdaptiveUI":this.showHeaderBar&&this.headerModule&&(this.destroyHeaderModule(),this.headerModule=new Br(this),this.headerModule.updateDateRange()),n.isLayout=!0;break;case"headerIndentTemplate":this.activeViewOptions.headerIndentTemplate=t.headerIndentTemplate,this.headerIndentTemplateFn=this.templateParser(this.activeViewOptions.headerIndentTemplate),n.isLayout=!0}},v.prototype.setRtlClass=function(){this.enableRtl?B.addClass([this.element],"e-rtl"):B.removeClass([this.element],"e-rtl")},v.prototype.onGroupSettingsPropertyChanged=function(e,t,i){for(var n=0,r=Object.keys(e);n<r.length;n++)"headerTooltipTemplate"===r[n]?this.headerTooltipTemplateFn=this.templateParser(e.headerTooltipTemplate):(i.isLayout=!0,this.eventWindow&&this.eventWindow.refresh())},v.prototype.onEventSettingsPropertyChanged=function(e,t,i){for(var n=0,r=Object.keys(e);n<r.length;n++)switch(r[n]){case"dataSource":case"query":case"fields":case"includeFiltersInQuery":this.initializeDataModule(),i.isDataManager=!0;break;case"template":this.activeViewOptions.eventTemplate=e.template,this.appointmentTemplateFn=this.templateParser(this.activeViewOptions.eventTemplate),i.isDataManager=!0;break;case"enableTooltip":this.eventTooltip&&(this.eventTooltip.destroy(),this.eventTooltip=null),e.enableTooltip&&(this.eventTooltip=new ss(this));break;case"tooltipTemplate":this.eventTooltipTemplateFn=this.templateParser(this.eventSettings.tooltipTemplate);break;case"resourceColorField":this.resourceBase&&this.resourceBase.setResourceCollection(),i.isDataManager=!0;break;case"editFollowingEvents":this.quickPopup&&this.quickPopup.refreshQuickDialog();break;case"allowAdding":case"allowEditing":case"allowDeleting":this.showHeaderBar&&this.headerModule&&this.headerModule.updateAddIcon(),this.eventWindow&&this.eventWindow.refresh();break;case"spannedEventPlacement":case"minimumEventDuration":case"enableMaxHeight":case"enableIndicator":this.refreshEvents(!1);break;case"ignoreWhitespace":i.isLayout=!0}},v.prototype.destroyHeaderModule=function(){this.headerModule&&(this.headerModule.destroy(),this.headerModule=null)},v.prototype.destroyPopups=function(){this.quickPopup&&(this.quickPopup.destroy(),this.quickPopup=null),this.eventWindow&&(this.eventWindow.destroy(),this.eventWindow=null)},v.prototype.showSpinner=function(){M.showSpinner(this.element)},v.prototype.hideSpinner=function(){M.hideSpinner(this.element)},v.prototype.setWorkHours=function(e,t,i,n){e=this.getWorkHourCells(e,t,i,n);B.addClass(e,Et)},v.prototype.resetWorkHours=function(e,t,i,n){(e=void 0===e?this.activeView.renderDates:e)&&t&&i?(e=this.getWorkHourCells(e,t,i,n),B.removeClass(e,Et)):(t=[].slice.call(this.element.querySelectorAll("."+Et)),B.removeClass(t,Et))},v.prototype.getWorkHourCells=function(e,t,i,n){if(-1<["Agenda","MonthAgenda","Month","TimelineMonth"].indexOf(this.currentView))return[];var t=this.getStartEndTime(t),i=this.getStartEndTime(i),r=this.getContentTable();if(B.isNullOrUndefined(t)||B.isNullOrUndefined(i)||!r)return[];t.setMilliseconds(0),i.setMilliseconds(0);var a=this.activeView.getStartHour(),s=(t<a&&(t=a),this.activeView.getEndHour());s<i&&(i=s);for(var o=this.activeViewOptions.timeScale.interval*je/this.activeViewOptions.timeScale.slotCount,l=(a.getTimezoneOffset()-t.getTimezoneOffset())*je,p=Math.abs((a.getTimezoneOffset()-i.getTimezoneOffset())*je),c=m=Math.round((t.getTime()-a.getTime()+l)/o),h=v=Math.ceil((i.getTime()-a.getTime()-p)/o),d=[],u=0,g=e;u<g.length;u++){var m,v,f=g[u],y=(z(f=this.getDateTime(f)),this.activeView.renderDates),T=(B.isNullOrUndefined(n)||!this.resourceBase||this.activeView.isTimelineView()||(y=this.resourceBase.lastResourceLevel[parseInt(n.toString(),10)].renderDates),this.getIndexOfDate(y,f));if(0<=T){this.activeView.isTimelineView()&&(m=c+T*(y=Math.round((s.getTime()-a.getTime())/o)),v=h+T*y);for(var w,D,b=m;b<v;b++)this.activeView.isTimelineView()?(w=B.isNullOrUndefined(n)?0:n,d.push(r.rows[parseInt(w.toString(),10)].cells[parseInt(b.toString(),10)])):B.isNullOrUndefined(n)?d.push(r.rows[parseInt(b.toString(),10)].cells[parseInt(T.toString(),10)]):(w="."+O+'[data-group-index="'+n+'"]',D=[].slice.call(r.rows[parseInt(b.toString(),10)].querySelectorAll(w)),d.push(D[parseInt(T.toString(),10)]))}}return d},v.prototype.getCellDetails=function(e){var t,i,n=e instanceof Array?e:[e],r=B.getElement(n[0]),n=B.getElement(n.slice(-1)[0]),a=this.getDateFromElement(r),s=this.getDateFromElement(n);if(!B.isNullOrUndefined(a)&&!B.isNullOrUndefined(s))return t=(i=this.activeView.isTimelineView()&&!B.isNullOrUndefined(n.getAttribute("colSpan"))&&0<this.headerRows.length)?parseInt(n.getAttribute("colSpan"),10):1,a={startTime:a,endTime:s=!this.activeViewOptions.timeScale.enable||i||n.classList.contains(w)||n.classList.contains(It)?Y(new Date(s.getTime()),t):this.activeView.getEndDateFromStartDate(s),isAllDay:this.isAllDayCell(r),element:e},i=r.getAttribute("data-group-index"),B.isNullOrUndefined(i)||(a.groupIndex=parseInt(i,10)),a},v.prototype.getSelectedElements=function(){return this.keyboardInteractionModule&&0<this.keyboardInteractionModule.selectedCells.length?this.keyboardInteractionModule.selectedCells:this.getSelectedCells()},v.prototype.getResourceCollections=function(){return this.resourceCollection},v.prototype.setResourceCollections=function(e,t){!(t=void 0===t?!0:t)&&this.uiStateValues&&(this.uiStateValues.isPreventEventRefresh=!0),this.setProperties({resources:e},!1)},v.prototype.changeCurrentView=function(e,t){var i=this.getViewIndex(e),n=e.charAt(0).toLowerCase()+e.slice(1),n=this.viewOptions[""+n];-1!==(i=n?this.viewCollections.indexOf(n[t||0]):i)&&i!==this.viewIndex&&this.changeView(e,null,null,i)},v.prototype.getCurrentViewIndex=function(){return this.viewIndex},v.prototype.getResourcesByIndex=function(e){var t,i;return!this.resourceBase||!this.resourceBase.lastResourceLevel||e<0||e>=this.resourceBase.lastResourceLevel.length?void 0:(t=this.resourceBase.lastResourceLevel[parseInt(e.toString(),10)],this.resourceBase.setResourceValues(i={},e),{resource:t.resource,resourceData:t.resourceData,groupData:i})},v.prototype.expandResource=function(e,t){this.activeView.isTimelineView()&&this.resourceBase&&1<this.resourceCollection.length&&this.resourceBase.resourceExpand(e,t,!1)},v.prototype.collapseResource=function(e,t){this.activeView.isTimelineView()&&this.resourceBase&&1<this.resourceCollection.length&&this.resourceBase.resourceExpand(e,t,!0)},v.prototype.scrollTo=function(e,t){this.currentView.indexOf("Agenda")<0&&B.isNullOrUndefined(this.element.querySelector(".e-work-cells"))||(this.activeView.scrollToDate&&B.isNullOrUndefined(e)&&t?this.activeView.scrollToDate(t):this.activeView.scrollToHour&&this.activeView.scrollToHour(e,t))},v.prototype.scrollToResource=function(e,t){this.resourceBase&&this.resourceBase.lastResourceLevel&&this.resourceBase.resourceScroll(e,t)},v.prototype.exportToICalendar=function(e,t){if(!this.iCalendarExportModule)throw console.warn('[WARNING] :: Module "ICalendarExport" is not available in Schedule component! You either misspelled the module name or forgot to load it.'),Error("Inject ICalendarExport module");this.iCalendarExportModule.initializeCalendarExport(e,t)},v.prototype.importICalendar=function(e){if(!this.iCalendarImportModule)throw console.warn('[WARNING] :: Module "ICalendarImport" is not available in Schedule component! You either misspelled the module name or forgot to load it.'),Error("Inject ICalendarImport module");this.iCalendarImportModule.initializeCalendarImport(e)},v.prototype.addEvent=function(e){this.crudModule.addEvent(e)},v.prototype.generateEventOccurrences=function(e,t){return this.eventBase?this.eventBase.generateOccurrence(e,t):[]},v.prototype.exportToExcel=function(e){if(!this.excelExportModule)throw console.warn('[WARNING] :: Module "ExcelExport" is not available in Schedule component! You either misspelled the module name or forgot to load it.'),Error("Inject ExcelExport module");this.excelExportModule.initializeExcelExport(e)},v.prototype.print=function(e){if(!this.printModule)throw console.warn('[WARNING] :: Module "Print" is not available in Schedule component! You either misspelled the module name or forgot to load it.'),Error("Inject Print module");this.printModule.print(e)},v.prototype.saveEvent=function(e,t){this.crudModule.saveEvent(e,t)},v.prototype.deleteEvent=function(e,t){this.crudModule.deleteEvent(e,t)},v.prototype.getEvents=function(e,t,i){var n=[],n=i?this.eventBase.getProcessedEvents():this.eventsData;return e=e&&this.getDateTime(e),t=t&&this.getDateTime(t),n=this.eventBase.filterEventsByRange(n,e,t)},v.prototype.getBlockEvents=function(e,t,i){var n=[],n=i?this.eventBase.getProcessedEvents(this.blockData):this.blockData;return e=e&&this.getDateTime(e),t=t&&this.getDateTime(t),n=this.eventBase.filterEventsByRange(n,e,t)},v.prototype.getOccurrencesByID=function(e){return this.eventBase.getOccurrencesByID(e)},v.prototype.getOccurrencesByRange=function(e,t){return e=this.getDateTime(e),t=this.getDateTime(t),this.eventBase.getOccurrencesByRange(e,t)},v.prototype.getCurrentViewDates=function(){return this.activeView?this.activeView.renderDates:[]},v.prototype.setRecurrenceEditor=function(e){this.eventWindow.setRecurrenceEditor(e)},v.prototype.getEventMaxID=function(){return this.eventBase.getEventMaxID()},v.prototype.getDeletedOccurrences=function(e){return this.eventBase.getDeletedOccurrences(e)},v.prototype.getCurrentViewEvents=function(){return this.eventsProcessed},v.prototype.refreshEvents=function(e){(e=void 0===e?!0:e)?(this.dragAndDropModule&&(this.dragAndDropModule.actionObj.action="",B.removeClass([this.element],Wi)),this.crudModule.refreshDataManager()):(this.uiStateValues&&(this.uiStateValues.isPreventTimezone=!0),this.crudModule&&this.crudModule.refreshProcessedData(),this.uiStateValues&&(this.uiStateValues.isPreventTimezone=!1))},v.prototype.refreshTemplates=function(e){switch(e?this.resetTemplates([e]):this.resetTemplates(),e){case"eventTemplate":this.appointmentTemplateFn=this.templateParser(this.activeViewOptions.eventTemplate),this.refreshEvents(!1);break;case"dateHeaderTemplate":this.dateHeaderTemplateFn=this.templateParser(this.activeViewOptions.dateHeaderTemplate),this.activeView.refreshHeader();break;case"dateRangeTemplate":this.dateRangeTemplateFn=this.templateParser(this.activeViewOptions.dateRangeTemplate),this.headerModule&&this.headerModule.refresh();break;case"resourceHeaderTemplate":this.resourceHeaderTemplateFn=this.templateParser(this.activeViewOptions.resourceHeaderTemplate),this.activeView.isTimelineView()?this.activeView.refreshResourceHeader():this.activeView.refreshHeader();break;case"quickInfoTemplates":this.quickPopup&&(this.quickPopup.destroy(),this.quickPopup=null),this.quickPopup=new as(this),this.quickInfoTemplatesHeaderFn=this.templateParser(this.quickInfoTemplates.header),this.quickInfoTemplatesContentFn=this.templateParser(this.quickInfoTemplates.content),this.quickInfoTemplatesFooterFn=this.templateParser(this.quickInfoTemplates.footer);break;case"editorTemplate":this.destroyEditorWindow(),this.editorTemplateFn=this.templateParser(this.editorTemplate);break;case"editorHeaderTemplate":this.destroyEditorWindow(),this.editorHeaderTemplateFn=this.templateParser(this.editorHeaderTemplate);break;case"editorFooterTemplate":this.destroyEditorWindow(),this.editorFooterTemplateFn=this.templateParser(this.editorFooterTemplate);break;case"tooltipTemplate":case"headerTooltipTemplate":this.eventTooltip&&(this.eventTooltip.destroy(),this.eventTooltip=null),this.eventTooltip=new ss(this),this.eventTooltipTemplateFn=this.templateParser(this.eventSettings.tooltipTemplate),this.headerTooltipTemplateFn=this.templateParser(this.activeViewOptions.group.headerTooltipTemplate);break;default:this.initializeView(this.currentView)}},v.prototype.refreshLayout=function(){this.onScheduleResize(),this.headerModule&&this.headerModule.refresh(),this.eventWindow&&this.eventWindow.refresh()},v.prototype.getEventDetails=function(e){e=(e=B.getElement(e)).getAttribute("data-guid");return e?this.eventBase.getEventByGuid(e):{}},v.prototype.isSlotAvailable=function(e,t,i){var n,r,a=this,s=this.activeEventData.event;return e instanceof Date||"string"==typeof e?(n=e,r=t):(n=(s=e)[this.eventFields.startTime],r=e[this.eventFields.endTime],this.resourceBase&&(i=this.eventBase.getGroupIndexFromEvent(e))),!(!B.isNullOrUndefined(n)&&!B.isNullOrUndefined(r)&&(n=this.getDateTime(n),r=this.getDateTime(r),t=this.eventBase.filterEvents(n,r),!B.isNullOrUndefined(i)&&this.resourceBase&&0<this.resourceBase.lastResourceLevel.length&&(t=this.eventBase.filterEventsByResource(this.resourceBase.lastResourceLevel[parseInt(i.toString(),10)],t)),0<(t=s?s.Guid?t.filter(function(e){return e.Guid!==s.Guid}):t.filter(function(e){return e[a.eventFields.id]!==s[a.eventFields.id]}):t).length))},v.prototype.copy=function(e){this.processCutCopyActions(e,!1)},v.prototype.cut=function(e){this.processCutCopyActions(e,!0)},v.prototype.paste=function(t){var e,i,n=this;this.allowClipboard&&this.allowKeyboardInteraction&&t&&(t.classList.contains("e-work-cells")||t.classList.contains("e-all-day-cells"))&&(this.activeCellsData||(e=this.getCellDetails([t]))&&(this.activeCellsData=e),i=new DataTransfer,B.isNullOrUndefined(navigator.clipboard)||navigator.clipboard.readText().then(function(e){i.setData("text/plain",e);e=new ClipboardEvent("paste",{bubbles:!0,cancelable:!0});Object.defineProperty(e,"clipboardData",{value:i}),n.keyboardInteractionModule.pasteHandler(e,t)}).catch(function(e){throw e}))},v.prototype.processCutCopyActions=function(e,t){var i,n=this;e&&this.allowClipboard&&this.allowKeyboardInteraction&&(i=[],e.forEach(function(e){e.classList.contains(V)&&(e=n.getEventDetails(e))&&i.push(e)}),0<i.length)&&this.keyboardInteractionModule.processClipboardAction(t,i)},v.prototype.openEditor=function(e,t,i,n){"Add"!==t||i?(e[this.eventFields.startTime]=this.getDateTime(e[this.eventFields.startTime]),e[this.eventFields.endTime]=this.getDateTime(e[this.eventFields.endTime])):(e.startTime=this.getDateTime(e.startTime),e.endTime=this.getDateTime(e.endTime),B.isNullOrUndefined(e.element)||(e.element=B.getElement(e.element))),"Add"!==(this.currentAction=t)&&(this.activeEventData.event=e),this.eventWindow.openEditor(e,t,i,n)},v.prototype.closeEditor=function(){this.eventWindow&&this.eventWindow.dialogClose()},v.prototype.openQuickInfoPopup=function(t){var e,i,n,r=this;"Year"===this.currentView||B.isNullOrUndefined(t)||(B.isNullOrUndefined(t[this.eventFields.id])?"Agenda"===this.currentView||"MonthAgenda"===this.currentView||B.isNullOrUndefined(this.activeView)||(i={startTime:this.activeCellsData.startTime=this.getDateTime(t[this.eventFields.startTime]),endTime:this.activeCellsData.endTime=this.getDateTime(t[this.eventFields.endTime]),isAllDay:this.activeCellsData.isAllDay=!B.isNullOrUndefined(t[this.eventFields.isAllDay])&&t[this.eventFields.isAllDay]},(e=this.activeView.getAdjustedDate(new Date(i.startTime)))&&(n="."+O+'[data-date="'+e.getTime()+'"]',0<this.activeViewOptions.group.resources.length&&!this.uiStateValues.isGroupAdaptive&&this.resourceBase&&this.eventBase&&(i.groupIndex=this.eventBase.getGroupIndexFromEvent(t),n="."+O+'[data-date="'+e.getTime()+'"][data-group-index="'+i.groupIndex+'"]'),e=this.element.querySelector(n))&&(e.focus(),i.element=e,this.notify(q,i))):(n=this.getCurrentViewEvents().filter(function(e){return t[r.eventFields.id]===e[r.eventFields.id]})).length<=0||(e=n[0],t[this.eventFields.recurrenceRule]&&0<(i=n.filter(function(e){return e[r.eventFields.startTime].getTime()===t[r.eventFields.startTime].getTime()})).length&&(e=i[0]),(n=this.element.querySelector('div[data-guid="'+e.Guid+'"]'))&&(this.eventBase.removeSelectedAppointmentClass(),this.eventBase.addSelectedAppointments([n],!1),this.activeEventData={event:e,element:n},"Agenda"!==this.currentView&&"MonthAgenda"!==this.currentView||B.addClass([this.activeEventData.element],Ii),this.notify(ee,this.activeEventData))))},v.prototype.closeQuickInfoPopup=function(){this.quickPopup&&this.quickPopup.quickPopupHide(!0)},v.prototype.openOverlapAlert=function(t){var e,i=this;this.quickPopup&&(e={type:"OverlapAlert",cancel:!1,element:this.quickPopup.quickDialog.element,data:t.data,overlapEvents:t.overlapEvents},this.trigger(ae,e,function(e){e.cancel||i.quickPopup.openValidationError("overlapAlert",t.data)}))},v.prototype.closeOverlapAlert=function(){var e,t=this;this.quickPopup&&(e={type:"OverlapAlert",cancel:!1,data:this.activeEventData.event,element:this.quickPopup.quickDialog.element},this.trigger(se,e,function(e){e.cancel||t.quickPopup.quickDialog.hide()}))},v.prototype.closeTooltip=function(){this.eventTooltip&&this.eventTooltip.close()},v.prototype.getDateRangeText=function(e){return B.isNullOrUndefined(e)&&0===e.length||!this.activeView?"":this.activeView.getDateRangeText(e[0],e)},v.prototype.getViewDates=function(e){if(!this.activeView)return[];switch(e=void 0===e?"Current":e){case"Previous":case"Next":return this.activeView.getRenderDates(void 0,this.activeView.getNextPreviousDate(e));case"Current":return this.getCurrentViewDates()}},v.prototype.selectResourceByIndex=function(e){this.resourceBase&&this.uiStateValues.isGroupAdaptive&&this.resourceBase.selectResourceByIndex(e)},v.prototype.getIndexFromResourceId=function(e,t){return this.resourceBase?this.resourceBase.getIndexFromResourceId(e,t):null},v.prototype.addResource=function(e,t,i){this.resourceBase.addResource(e,t,i)},v.prototype.removeResource=function(e,t){this.resourceBase.removeResource(e,t)},v.prototype.destroy=function(){this.eventTooltip&&(this.eventTooltip.destroy(),this.eventTooltip=null),this.destroyPopups(),this.hideSpinner(),this.unWireEvents(),this.destroyHeaderModule(),this.eventBase&&(this.eventBase.destroy(),this.eventBase=null),this.workCellAction&&(this.workCellAction.destroy(),this.workCellAction=null),this.inlineModule&&(this.inlineModule.destroy(),this.inlineModule=null),this.keyboardInteractionModule&&(this.keyboardInteractionModule.destroy(),this.keyboardInteractionModule=null),this.scrollModule&&(this.scrollModule.destroy(),this.scrollModule=null),this.printModule&&this.printModule.destroy(),this.activeView&&(this.resetTemplates(),this.activeView.removeEventListener(),this.activeView.destroy(),this.activeView=null),this.scheduleTouchModule&&(this.scheduleTouchModule.destroy(),this.scheduleTouchModule=null),this.crudModule&&(this.crudModule.destroy(),this.crudModule=null),this.dataModule&&(this.dataModule.destroy(),this.dataModule=null),ol.prototype.destroy.call(this);for(var e=0,t=["dayModule","weekModule","workWeekModule","monthModule","monthAgendaModule","yearModule","agendaModule","timelineViewsModule","timelineMonthModule","timelineYearModule","resizeModule","dragAndDropModule","excelExportModule","printModule","iCalendarExportModule","iCalendarImportModule","tzModule","eventsData","eventsProcessed","blockData","blockProcessed","uiStateValues","viewCollections","viewOptions","defaultLocale","localeObj","selectedElements","resourceCollection","editorTitles","eventFields","activeViewOptions","activeEventData","activeCellsData","renderModule"];e<t.length;e++)this[""+t[e]]=null;lt(this.element);var i=[vt,ft,yt,wt];this.cssClass&&(i=i.concat(this.cssClass.split(" "))),B.removeClass([this.element],i)},m([B.Property("auto")],v.prototype,"width",void 0),m([B.Property("auto")],v.prototype,"height",void 0),m([B.Property(!0)],v.prototype,"showHeaderBar",void 0),m([B.Property(!0)],v.prototype,"showTimeIndicator",void 0),m([B.Property(!0)],v.prototype,"allowSwiping",void 0),m([B.Property(!0)],v.prototype,"allowOverlap",void 0),m([B.Property(3)],v.prototype,"overscanCount",void 0),m([B.Collection([],$o)],v.prototype,"toolbarItems",void 0),m([B.Property("Week")],v.prototype,"currentView",void 0),m([B.Property(["Day","Week","WorkWeek","Month","Agenda"])],v.prototype,"views",void 0),m([B.Property(new Date)],v.prototype,"selectedDate",void 0),m([B.Property(new Date(1900,0,1))],v.prototype,"minDate",void 0),m([B.Property(new Date(2099,11,31))],v.prototype,"maxDate",void 0),m([B.Property()],v.prototype,"dateFormat",void 0),m([B.Property("Gregorian")],v.prototype,"calendarMode",void 0),m([B.Property(!0)],v.prototype,"showWeekend",void 0),m([B.Property(0)],v.prototype,"firstDayOfWeek",void 0),m([B.Property("FirstDay")],v.prototype,"weekRule",void 0),m([B.Property([1,2,3,4,5])],v.prototype,"workDays",void 0),m([B.Property(12)],v.prototype,"monthsCount",void 0),m([B.Property("00:00")],v.prototype,"startHour",void 0),m([B.Property("24:00")],v.prototype,"endHour",void 0),m([B.Property(null)],v.prototype,"timeFormat",void 0),m([B.Property(!0)],v.prototype,"enableHtmlSanitizer",void 0),m([B.Property(!1)],v.prototype,"enableAllDayScroll",void 0),m([B.Property(!1)],v.prototype,"enableAdaptiveUI",void 0),m([B.Property(!0)],v.prototype,"allowResizing",void 0),m([B.Complex({},cs)],v.prototype,"workHours",void 0),m([B.Complex({},hs)],v.prototype,"timeScale",void 0),m([B.Property(!0)],v.prototype,"allowKeyboardInteraction",void 0),m([B.Property(!0)],v.prototype,"allowDragAndDrop",void 0),m([B.Property()],v.prototype,"dateHeaderTemplate",void 0),m([B.Property()],v.prototype,"dateRangeTemplate",void 0),m([B.Property()],v.prototype,"cellHeaderTemplate",void 0),m([B.Property()],v.prototype,"dayHeaderTemplate",void 0),m([B.Property()],v.prototype,"monthHeaderTemplate",void 0),m([B.Property()],v.prototype,"cellTemplate",void 0),m([B.Property(!1)],v.prototype,"readonly",void 0),m([B.Property(!0)],v.prototype,"showQuickInfo",void 0),m([B.Property(!1)],v.prototype,"allowInline",void 0),m([B.Property(!0)],v.prototype,"allowMultiCellSelection",void 0),m([B.Property(!0)],v.prototype,"allowMultiRowSelection",void 0),m([B.Property(!1)],v.prototype,"quickInfoOnSelectionEnd",void 0),m([B.Property(!1)],v.prototype,"showWeekNumber",void 0),m([B.Property(!1)],v.prototype,"rowAutoHeight",void 0),m([B.Property(!1)],v.prototype,"allowMultiDrag",void 0),m([B.Property(0)],v.prototype,"firstMonthOfYear",void 0),m([B.Property()],v.prototype,"editorTemplate",void 0),m([B.Property()],v.prototype,"editorHeaderTemplate",void 0),m([B.Property()],v.prototype,"editorFooterTemplate",void 0),m([B.Complex({},Co)],v.prototype,"quickInfoTemplates",void 0),m([B.Property(7)],v.prototype,"agendaDaysCount",void 0),m([B.Property(!0)],v.prototype,"hideEmptyAgendaDays",void 0),m([B.Property(!0)],v.prototype,"enableRecurrenceValidation",void 0),m([B.Property()],v.prototype,"timezone",void 0),m([B.Complex({},ko)],v.prototype,"eventSettings",void 0),m([B.Property(na)],v.prototype,"timezoneDataSource",void 0),m([B.Property()],v.prototype,"resourceHeaderTemplate",void 0),m([B.Property()],v.prototype,"headerIndentTemplate",void 0),m([B.Complex({},Fo)],v.prototype,"group",void 0),m([B.Collection([],u)],v.prototype,"resources",void 0),m([B.Collection([],Vo)],v.prototype,"headerRows",void 0),m([B.Property()],v.prototype,"cssClass",void 0),m([B.Property(!1)],v.prototype,"allowClipboard",void 0),m([B.Property()],v.prototype,"eventDragArea",void 0),m([B.Event()],v.prototype,"created",void 0),m([B.Event()],v.prototype,"destroyed",void 0),m([B.Event()],v.prototype,"cellClick",void 0),m([B.Event()],v.prototype,"cellDoubleClick",void 0),m([B.Event()],v.prototype,"moreEventsClick",void 0),m([B.Event()],v.prototype,"hover",void 0),m([B.Event()],v.prototype,"select",void 0),m([B.Event()],v.prototype,"actionBegin",void 0),m([B.Event()],v.prototype,"actionComplete",void 0),m([B.Event()],v.prototype,"actionFailure",void 0),m([B.Event()],v.prototype,"navigating",void 0),m([B.Event()],v.prototype,"renderCell",void 0),m([B.Event()],v.prototype,"eventClick",void 0),m([B.Event()],v.prototype,"eventDoubleClick",void 0),m([B.Event()],v.prototype,"eventRendered",void 0),m([B.Event()],v.prototype,"dataBinding",void 0),m([B.Event()],v.prototype,"popupOpen",void 0),m([B.Event()],v.prototype,"popupClose",void 0),m([B.Event()],v.prototype,"dragStart",void 0),m([B.Event()],v.prototype,"drag",void 0),m([B.Event()],v.prototype,"dragStop",void 0),m([B.Event()],v.prototype,"resizeStart",void 0),m([B.Event()],v.prototype,"resizing",void 0),m([B.Event()],v.prototype,"resizeStop",void 0),m([B.Event()],v.prototype,"virtualScrollStart",void 0),m([B.Event()],v.prototype,"virtualScrollStop",void 0),m([B.Event()],v.prototype,"dataBound",void 0),m([B.Event()],v.prototype,"beforePaste",void 0),m([B.Event()],v.prototype,"beforePrint",void 0),m([B.Event()],v.prototype,"excelExport",void 0),m([B.Event()],v.prototype,"tooltipOpen",void 0),m([B.NotifyPropertyChanges],v));function v(e,t){e=ol.call(this,e,t)||this;return e.adaptiveGroupIndex=0,e}pl.prototype.getChangedData=function(e){var t,i,n,r=this,a=B.extend({},this.actionObj.event,null,!0);return a[this.parent.eventFields.startTime]=this.actionObj.start,a[this.parent.eventFields.endTime]=this.actionObj.end,B.isNullOrUndefined(this.actionObj.isAllDay)||(a[this.parent.eventFields.isAllDay]=this.actionObj.isAllDay),0<this.parent.activeViewOptions.group.resources.length&&(t=this.getOriginalElement(this.actionObj.element))&&(-1===(n=t.map(function(e){return parseInt(e.getAttribute("data-group-index"),10)})).indexOf(this.actionObj.groupIndex)||!B.isNullOrUndefined(e)&&0<e.length)&&(i=parseInt(this.actionObj.clone.getAttribute("data-group-index"),10),(n=n.filter(function(e){return e!==i})).push(this.actionObj.groupIndex),e&&0<e.length?e.forEach(function(e){r.parent.resourceBase.getResourceData(e,r.actionObj.groupIndex,n)}):this.parent.resourceBase.getResourceData(a,this.actionObj.groupIndex,n)),a},pl.prototype.saveChangedData=function(e,t){void 0===t&&(t=!1),this.parent.activeEventData.event=this.actionObj.event,this.parent.currentAction="Save";for(var i,n=[e.data],r=0,a=n=t?e.selectedData:n;r<a.length;r++){var s=a[r],o=!(0<this.parent.activeViewOptions.group.resources.length)||parseInt(this.actionObj.element.getAttribute("data-group-index"),10)===this.actionObj.groupIndex;if(+s[this.parent.eventFields.startTime]==+this.actionObj.event[this.parent.eventFields.startTime]&&+s[this.parent.eventFields.endTime]==+this.actionObj.event[this.parent.eventFields.endTime]&&o)return void(this.parent.crudModule.crudObj.isCrudAction=!1);if(s[this.parent.eventFields.recurrenceRule]){o=s[this.parent.eventFields.recurrenceID]||s[this.parent.eventFields.id];if(s[this.parent.eventFields.id]===s[this.parent.eventFields.recurrenceID]&&(s[this.parent.eventFields.id]=this.parent.eventBase.getEventMaxID(),i="EditOccurrence"),this.parent.enableRecurrenceValidation&&this.parent.eventWindow.editOccurrenceValidation(o,s,this.actionObj.event))return}else i=null;(s[this.parent.eventFields.startTimezone]||s[this.parent.eventFields.endTimezone])&&this.parent.eventBase.timezoneConvert(s),this.parent.crudModule.saveEvent(s,i)}},pl.prototype.calculateIntervalTime=function(e){var t=z(e).getTime(),i=this.parent.activeView.getStartHour(),n=je*this.actionObj.interval,t=(t+=(60*i.getHours()+i.getMinutes())*je+1e3*i.getSeconds())+Math.floor((e.getTime()-t)/n)*n;return new Date(t)},pl.prototype.getContentAreaDimension=function(){var e=this.parent.element.querySelector("."+A),t=[].slice.call(e.querySelector("tr").children),i=(t=this.parent.activeView.isTimelineView()||!(0<this.parent.activeViewOptions.group.resources.length)||this.parent.isAdaptive||this.parent.enableAdaptiveUI||this.parent.virtualScrollModule?t:this.getResourceElements(t))[0].getBoundingClientRect(),t=t.slice(-1)[0].getBoundingClientRect();return{bottom:e.scrollHeight-5,left:(this.parent.enableRtl?t:i).left,right:(this.parent.enableRtl?i:t).right,top:0,leftOffset:(this.parent.enableRtl?t:i).right,rightOffset:(this.parent.enableRtl?i:t).left}},pl.prototype.getIndex=function(e){var t=[].slice.call(this.parent.getContentTable().querySelector("tr").children),i={minIndex:0,maxIndex:t.length-1};return"resize"===this.actionObj.action&&0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive&&!this.parent.activeView.isTimelineView()&&(t=this.getResourceElements(t),i.minIndex=t[0].cellIndex,i.maxIndex=t.slice(-1)[0].cellIndex),e=i.maxIndex<(e=e<i.minIndex?i.minIndex:e)?i.maxIndex:e},pl.prototype.updateTimePosition=function(e,t){for(var i,n,r=0,a=0,s=this.actionObj.cloneElement;a<s.length;a++){var o,l,p=s[a].querySelector("."+Ci);p&&(o=this.actionObj.start,l=this.actionObj.end,t&&0<t.length&&(o=t[parseInt(r.toString(),10)][this.parent.eventFields.startTime],l=t[parseInt(r.toString(),10)][this.parent.eventFields.endTime]),p.innerHTML=this.parent.getTimeString(o)+" - "+this.parent.getTimeString(l)),r++}this.parent.activeViewOptions.timeScale.enable&&this.parent.isAdaptive&&"Month"!==this.parent.currentView&&"TimelineMonth"!==this.parent.currentView&&((i=this.parent.element.querySelector("."+_i))||(i=B.createElement("div",{className:_i}),n=this.parent.activeView.isTimelineView()?Vt:Zt,this.parent.element.querySelector("."+n).appendChild(i)),i.innerHTML=this.parent.getTimeString(e),n=0,this.parent.activeView.isTimelineView()?this.parent.enableRtl?(e=parseInt(this.actionObj.clone.style.right,10),n="drag"===this.actionObj.action||this.resizeEdges.left?e+this.actionObj.clone.offsetWidth:e,i.style.right=B.formatUnit(n)):(e=parseInt(this.actionObj.clone.style.left,10),n="drag"===this.actionObj.action||this.resizeEdges.left?e:e+this.actionObj.clone.offsetWidth,i.style.left=B.formatUnit(n)):(n="drag"===this.actionObj.action||this.resizeEdges.top?this.actionObj.clone.offsetTop:this.actionObj.clone.offsetTop+this.actionObj.clone.offsetHeight,i.style.top=B.formatUnit(n)))},pl.prototype.getResourceElements=function(e){var t=this;return e.filter(function(e){return parseInt(e.getAttribute("data-group-index"),10)===t.actionObj.groupIndex})},pl.prototype.getOriginalElement=function(e){var t,i=e.getAttribute("data-guid");return e.offsetParent&&e.offsetParent.classList.contains(Cn)||this.parent.activeView.isTimelineView()||"resize"!==this.actionObj.action&&this.parent.virtualScrollModule?t=[].slice.call(this.parent.element.querySelectorAll('[data-guid="'+i+'"]')):(e=B.closest(e,"tr"))&&(t=[].slice.call(e.querySelectorAll('[data-guid="'+i+'"]'))),t},pl.prototype.createCloneElement=function(e){var t=document.createElement("div"),t=(t.appendChild(e.cloneNode(!0)),t.children[0]),i=[Yi],i=(i.push("drag"===this.actionObj.action?Gi:Qi),"Month"!==this.parent.currentView&&"TimelineMonth"!==this.parent.currentView||i.push("e-month-event"),B.addClass([t],i),B.addClass([e],Wi),B.isNullOrUndefined(e.parentElement)||e.parentElement.appendChild(t),t.style.width=B.formatUnit(t.offsetWidth-2),document.querySelector(this.parent.eventDragArea));return this.parent.eventDragArea&&"drag"===this.actionObj.action&&i&&i.appendChild(t),B.setStyleAttribute(t,{border:"0px"}),t},pl.prototype.removeCloneElementClasses=function(){var e=this.actionObj.originalElement;"Month"!==this.parent.currentView&&"TimelineYear"!==this.parent.currentView&&"Day"!==this.parent.currentView&&"Week"!==this.parent.currentView&&"WorkWeek"!==this.parent.currentView||(e=[].slice.call(this.parent.element.querySelectorAll("."+Wi))),B.removeClass(e,Wi)},pl.prototype.removeCloneElement=function(){this.actionObj.originalElement=[];for(var e=0,t=[].slice.call(this.parent.element.querySelectorAll(".e-dynamic-clone"));e<t.length;e++){var i=t[e];B.remove(i)}for(var n=0,r=this.actionObj.cloneElement;n<r.length;n++){var a=r[n];B.isNullOrUndefined(a.parentNode)||B.remove(a)}this.actionObj.cloneElement=[];var s=this.parent.element.querySelector("."+_i);s&&B.remove(s)},pl.prototype.getCursorElement=function(e){e=this.parent.eventBase.getPageCoordinates(e);return document.elementFromPoint(e.clientX,e.clientY)},pl.prototype.autoScroll=function(){var e,t=this.parent.element.querySelector("."+A),i=t.offsetHeight<=t.scrollHeight,n=t.offsetWidth<=t.scrollWidth,i=i&&0<=t.scrollTop&&t.scrollTop+t.offsetHeight<=t.scrollHeight,n=n&&0<=t.scrollLeft&&t.scrollLeft+t.offsetWidth<=t.scrollWidth;"resize"===this.actionObj.action&&this.scrollEdges.right&&t.scrollLeft+t.offsetWidth>t.scrollWidth&&(e=[].slice.call(this.parent.getContentTable().querySelector("tr").children).length-1,n=Math.ceil((this.actionObj.clone.offsetLeft+this.actionObj.clone.offsetWidth)/this.actionObj.cellWidth)===e),i&&(this.scrollEdges.top||this.scrollEdges.bottom)&&(t.scrollTop+=this.scrollEdges.top?-this.actionObj.scroll.scrollBy:this.actionObj.scroll.scrollBy,"resize"===this.actionObj.action)&&t.scrollHeight!==t.offsetHeight+t.scrollTop&&0<t.scrollTop&&(this.actionObj.Y+=this.scrollEdges.top?this.actionObj.scroll.scrollBy:-this.actionObj.scroll.scrollBy),n&&(this.scrollEdges.left||this.scrollEdges.right)&&(t.scrollLeft+=this.scrollEdges.left?-this.actionObj.scroll.scrollBy:this.actionObj.scroll.scrollBy,"resize"===this.actionObj.action)&&t.scrollWidth!==t.offsetWidth+t.scrollLeft&&0<t.scrollLeft&&(this.actionObj.X+=this.scrollEdges.left?this.actionObj.scroll.scrollBy:-this.actionObj.scroll.scrollBy)},pl.prototype.autoScrollValidation=function(){var e;return!!this.actionObj.scroll.enable&&(e=this.parent.boundaryValidation(this.actionObj.pageY,this.actionObj.pageX),(this.scrollEdges=e).bottom||e.top||e.left||e.right)},pl.prototype.actionClass=function(e){"addClass"===e?B.addClass([this.parent.element],Wi):B.removeClass([this.parent.element],Wi)},pl.prototype.updateScrollPosition=function(e){var t=this;this.scrollEventArgs=e,this.actionObj.scroll.enable&&B.isNullOrUndefined(this.actionObj.scrollInterval)&&(this.actionObj.scrollInterval=window.setInterval(function(){!t.autoScrollValidation()||t.actionObj.clone.classList.contains(an)||t.parent.activeView.isTimelineView()&&0<t.parent.activeViewOptions.group.resources.length&&t.actionObj.groupIndex<0||(t.autoScroll(),"drag"===t.actionObj.action?t.parent.dragAndDropModule.updateDraggingDateTime(t.scrollEventArgs):t.parent.resizeModule.updateResizingDirection(t.scrollEventArgs))},this.actionObj.scroll.timeDelay))},pl.prototype.updateOriginalElement=function(e){var t='[data-id="'+e.getAttribute("data-id")+'"]',e=(0<this.parent.activeViewOptions.group.resources.length&&(t=t.concat('[data-group-index = "'+e.getAttribute("data-group-index")+'"]')),e.hasAttribute("data-guid")&&(t+='[data-guid="'+e.getAttribute("data-guid")+'"]'),[].slice.call(this.parent.element.querySelectorAll(t))),t=(B.addClass(e,Wi),[].slice.call(this.parent.element.querySelectorAll("."+Yi)));B.removeClass(t,Wi)},pl.prototype.getUpdatedEvent=function(e,t,i){i=JSON.parse(JSON.stringify(i));return i[this.parent.eventFields.startTime]=e,i[this.parent.eventFields.endTime]=t,i},pl.prototype.dynamicYearlyEventsRendering=function(e,t){var i,n,r;void 0===t&&(t=!1),B.isNullOrUndefined(this.parent.eventDragArea)&&(n=this.actionObj.cellWidth-7,t&&(this.resizeEdges.left||this.resizeEdges.right)&&(n=this.actionObj.cellWidth*e.count),t||"Horizontal"!==this.parent.activeViewOptions.orientation||0!==this.parent.activeViewOptions.group.resources.length||((i=this.yearEvent.isSpannedEvent(e,e[this.parent.eventFields.startTime]))[this.parent.eventFields.startTime].getTime()===i[this.parent.eventFields.endTime].getTime()&&(i.isSpanned.count=1),n=i.isSpanned.count*this.actionObj.cellWidth),t||"Vertical"!==this.parent.activeViewOptions.orientation||0===this.parent.activeViewOptions.group.resources.length||(n=(i=this.yearEvent.isSpannedEvent(e,e[this.parent.eventFields.startTime])).isSpanned.count*this.actionObj.cellWidth),(i=this.createAppointmentElement(this.actionObj.groupIndex,e[this.parent.eventFields.subject])).setAttribute("drag","true"),B.addClass([i],Yi),B.setStyleAttribute(i,{width:n+"px",border:"0px","pointer-events":"none",position:"absolute",overflow:"hidden",padding:"3px"}),""!==this.actionObj.clone.style.backgroundColor&&B.setStyleAttribute(i,{backgroundColor:this.actionObj.clone.style.backgroundColor}),n=z(e[this.parent.eventFields.startTime]).getTime(),r="."+O+'[data-date="'+n+'"]',0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive&&(r="."+O+'[data-date="'+n+'"][data-group-index="'+this.actionObj.groupIndex+'"]'),n=this.parent.element.querySelector(r),B.isNullOrUndefined(n)||(t&&(r=n.querySelector("."+Pi),t=this.actionObj.cellHeight*e.count-(r?r.offsetHeight:0)-7,(this.resizeEdges.right||this.resizeEdges.left)&&(t=parseInt(this.actionObj.clone.style.height,10)),B.setStyleAttribute(i,{height:t+"px"})),this.renderDynamicElement(n,i,!0),this.actionObj.cloneElement.push(i)))},pl.prototype.renderDynamicElement=function(e,t,i){var n;e.querySelector("."+x)?e.querySelector("."+x).appendChild(t):((n=B.createElement("div",{className:x})).appendChild(t),e.appendChild(n))},pl.prototype.createAppointmentElement=function(e,t){t=B.createElement("div",{className:V,innerHTML:t});return 0<this.parent.activeViewOptions.group.resources.length&&t.setAttribute("data-group-index",e.toString()),t},pl.prototype.dynamicEventsRendering=function(e){var t=this;if(B.isNullOrUndefined(this.parent.eventDragArea)){var i,n,r,a=this.parent.activeView.renderDates,s=[].slice.call(this.parent.element.querySelectorAll("."+O)),o=this.parent.activeViewOptions.workDays;if(0<this.parent.activeViewOptions.group.resources.length&&(a=(i=(this.parent.virtualScrollModule&&this.parent.virtualScrollModule.isHorizontalScroll?this.parent.resourceBase.renderedResources:this.parent.resourceBase.lastResourceLevel).filter(function(e){return e.groupIndex===t.actionObj.groupIndex}))[0].renderDates,n="."+O+'[data-group-index="'+this.actionObj.groupIndex+'"]',s=[].slice.call(this.parent.element.querySelectorAll(n)),o=i[0].workDays,r=i[0].groupOrder),this.monthEvent.dateRender=a,this.monthEvent.getSlotDates(o),this.resizeEdges.left||this.resizeEdges.right)for(var l=0,p=[].slice.call(this.parent.element.querySelectorAll("."+Yi));l<p.length;l++){var c=p[l];B.remove(c)}for(var h=0,d=this.monthEvent.splitEvent(e,a);h<d.length;h++){var u=d[h],g=this.parent.getIndexOfDate(a,z(u[this.monthEvent.fields.startTime])),m=u.data.count*this.actionObj.cellWidth-7,v=this.monthEvent.createAppointmentElement(u,this.actionObj.groupIndex,!0),u=(v.setAttribute("drag","true"),B.addClass([v],Yi),this.monthEvent.applyResourceColor(v,u,"backgroundColor",r),B.setStyleAttribute(v,{width:m+"px",border:"0px","pointer-events":"none"}),s[parseInt(g.toString(),10)]);u&&(this.monthEvent.renderElement(u,v,!0),this.actionObj.cloneElement.push(v))}}},pl.prototype.destroy=function(){!this.parent||this.parent&&this.parent.isDestroyed||(this.actionObj={},this.scrollArgs={},this.resizeEdges={left:!1,right:!1,top:!1,bottom:!1},this.scrollEdges={left:!1,right:!1,top:!1,bottom:!1})};rl=pl;function pl(e){this.daysVariation=0,this.parent=e,this.actionObj={X:0,Y:0,groupIndex:0,cellWidth:0,cellHeight:0,slotInterval:0,interval:0,actionIndex:0,cloneElement:[],originalElement:[],action:null,isAllDay:null,excludeSelectors:null,index:0,navigationInterval:null,scrollInterval:null},this.scrollArgs={element:null,width:0,height:0},this.resizeEdges={left:!1,right:!1,top:!1,bottom:!1},this.scrollEdges={left:!1,right:!1,top:!1,bottom:!1}}cl=function(e,t){return(cl=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}cl(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(dl,hl=rl),dl.prototype.wireResizeEvent=function(e){for(var t=0,i=[].slice.call(e.querySelectorAll("."+Xi));t<i.length;t++){var n=i[t];B.EventHandler.add(n,B.Browser.touchStartEvent,this.resizeStart,this)}},dl.prototype.resizeHelper=function(){if(0<this.parent.activeViewOptions.group.resources.length&&this.parent.activeViewOptions.group.allowGroupEdit)for(var e=0,t=this.actionObj.originalElement.length;e<t;e++){var i=this.createCloneElement(this.actionObj.originalElement[parseInt(e.toString(),10)]);this.actionObj.cloneElement[parseInt(e.toString(),10)]=i,this.actionObj.element===this.actionObj.originalElement[parseInt(e.toString(),10)]&&(this.actionObj.clone=i)}else this.actionObj.element&&(this.actionObj.clone=this.createCloneElement(this.actionObj.element)),this.actionObj.cloneElement=[this.actionObj.clone],this.actionObj.originalElement=[this.actionObj.element]},dl.prototype.resizeStart=function(s){var o,l,e,p=this;s&&"touchstart"===s.type&&(!this.parent.uiStateValues.isTapHold||!B.closest(s.target,"."+wi))||B.closest(s.target,"."+Nr)||(o=B.closest(s.target,"."+Xi),this.actionObj.element=B.closest(o,"."+V),this.actionObj.event=this.parent.eventBase.getEventByGuid(this.actionObj.element.getAttribute("data-guid")),B.isNullOrUndefined(this.actionObj.event))||(this.parent.eventBase.removeSelectedAppointmentClass(),this.actionObj.action="resize",this.actionObj.slotInterval=this.parent.activeViewOptions.timeScale.interval/this.parent.activeViewOptions.timeScale.slotCount,this.actionObj.interval=this.actionObj.slotInterval,e={cancel:!1,data:l=B.extend({},this.actionObj.event,null,!0),element:this.actionObj.element,event:s,interval:this.actionObj.interval,scroll:{enable:!0,scrollBy:30,timeDelay:100}},this.parent.trigger(ce,e,function(e){if(!e.cancel){p.actionClass("addClass"),p.parent.uiStateValues.action=!0,p.resizeEdges={left:o.classList.contains(Ki),right:o.classList.contains(Zi),top:o.classList.contains(Ji),bottom:o.classList.contains($i)},p.actionObj.groupIndex=p.parent.uiStateValues.isGroupAdaptive?p.parent.uiStateValues.groupIndex:0;var t=p.parent.element.querySelector("."+O),t=(p.actionObj.cellWidth=p.parent.getElementWidth(t),p.actionObj.cellHeight=p.parent.getElementHeight(t),p.parent.activeViewOptions.headerRows.map(function(e){return e.option}));if(p.parent.activeView.isTimelineView()&&0<t.length&&["Date","Hour"].indexOf(t.slice(-1)[0])<0){for(var t=p.parent.getContentTable().querySelector("tr"),i=0,n=0,r=[].slice.call(t.children);n<r.length;n++){var a=r[n];i+=parseInt(a.getAttribute("colspan"),10)}t=t.getBoundingClientRect();p.actionObj.cellWidth=t.width/i,p.actionObj.cellHeight=t.height}t=p.parent.eventBase.getPageCoordinates(s),t=(p.actionObj.X=t.pageX,p.actionObj.Y=t.pageY,p.actionObj.groupIndex=parseInt(p.actionObj.element.getAttribute("data-group-index")||"0",10),p.actionObj.interval=e.interval,p.actionObj.scroll=e.scroll,p.actionObj.start=new Date(l[p.parent.eventFields.startTime].getTime()),p.actionObj.end=new Date(l[p.parent.eventFields.endTime].getTime()),p.actionObj.originalElement=p.getOriginalElement(p.actionObj.element),"Month"===p.parent.currentView&&(p.daysVariation=-1,p.monthEvent=new Za(p.parent)),p.parent.element.querySelector("."+A));p.scrollArgs={element:t,width:t.scrollWidth,height:t.scrollHeight},["Month","TimelineYear"].indexOf(p.parent.currentView)<0&&(e=Math.round(p.scrollArgs.width/p.actionObj.cellWidth)*p.actionObj.cellWidth,p.scrollArgs.width=p.scrollArgs.width<e?e:p.scrollArgs.width),B.EventHandler.add(document,B.Browser.touchMoveEvent,p.resizing,p),B.EventHandler.add(document,B.Browser.touchEndEvent,p.resizeStop,p)}}))},dl.prototype.resizing=function(e){var t,i,n;e&&"touchmove"===e.type&&e.preventDefault(),this.parent.quickPopup&&this.parent.quickPopup.quickPopupHide(),0===this.parent.element.querySelectorAll("."+Qi).length&&this.resizeHelper(),!B.isNullOrUndefined(e.target)&&e.target.classList.contains(yr)||(t=this.parent.eventBase.getPageCoordinates(e),"Month"===this.parent.currentView||"TimelineYear"===this.parent.currentView?(i=document.documentElement,n=(window.pageXOffset||i.scrollLeft)-(i.clientLeft||0),i=(window.pageYOffset||i.scrollTop)-(i.clientTop||0),this.actionObj.pageX=t.pageX-n,this.actionObj.pageY=t.pageY-i):(this.actionObj.pageX=t.pageX,this.actionObj.pageY=t.pageY),this.updateScrollPosition(e),this.updateResizingDirection(e),n={cancel:!1,data:B.extend({},this.actionObj.event,null,!0),element:this.actionObj.element,event:e,startTime:this.actionObj.start,endTime:this.actionObj.end},0<this.parent.group.resources.length&&(n.groupIndex=this.actionObj.groupIndex),this.parent.trigger(he,n))},dl.prototype.updateResizingDirection=function(e){if("Month"===this.parent.currentView||"TimelineYear"===this.parent.currentView)this.monthResizing();else{var t=this.resizeValidation(e);if(this.resizeEdges.left){if(t){var i=this.getLeftRightStyles(e,!0);if(parseInt(i.width,10)<1)return;for(var n=0,r=this.actionObj.cloneElement;n<r.length;n++){var a=r[n];B.setStyleAttribute(a,i),B.addClass([a],Ki)}}this.horizontalResizing(!this.parent.enableRtl)}if(this.resizeEdges.right){if(t){var s=this.getLeftRightStyles(e,!1);if(parseInt(s.width,10)<1)return;for(var o=0,l=this.actionObj.cloneElement;o<l.length;o++){a=l[o];B.setStyleAttribute(a,s),B.addClass([a],Zi)}}this.horizontalResizing(this.parent.enableRtl)}if(this.resizeEdges.top){if(t){var p=this.getTopBottomStyles(e,!0);if(parseInt(p.height,10)<1)return;for(var c=0,h=this.actionObj.cloneElement;c<h.length;c++){a=h[c];B.setStyleAttribute(a,p),B.addClass([a],Ji)}}this.verticalResizing(!0)}if(this.resizeEdges.bottom){if(t){var d=this.getTopBottomStyles(e,!1);if(parseInt(d.height,10)<1)return;for(var u=0,g=this.actionObj.cloneElement;u<g.length;u++){a=g[u];B.setStyleAttribute(a,d),B.addClass([a],$i)}}this.verticalResizing(!1)}}},dl.prototype.monthResizing=function(){var e,t,i,n;this.removeCloneElement(),B.isNullOrUndefined(this.actionObj.pageX)||B.isNullOrUndefined(this.actionObj.pageY)||(e=document.elementFromPoint(this.actionObj.pageX,this.actionObj.pageY),B.isNullOrUndefined(e))||(n=this.parent.getDateFromElement(e),e=!(0<this.parent.activeViewOptions.group.resources.length)||parseInt(e.getAttribute("data-group-index"),10)===this.actionObj.groupIndex,t=new Date(this.actionObj.event[this.parent.eventFields.startTime].getTime()),i=new Date(this.actionObj.event[this.parent.eventFields.endTime].getTime()),!this.parent.enableRtl&&this.resizeEdges.left||this.parent.enableRtl&&this.resizeEdges.right||this.resizeEdges.top?t=n:(!this.parent.enableRtl&&this.resizeEdges.right||this.parent.enableRtl&&this.resizeEdges.left||this.resizeEdges.bottom)&&(i=Y(n,1)),e&&t<i&&(this.actionObj.start=t,this.actionObj.end=i,n=this.getUpdatedEvent(this.actionObj.start,this.actionObj.end,this.actionObj.event),"TimelineYear"===this.parent.currentView?this.yearEventsRendering(n):this.dynamicEventsRendering(n),this.updateOriginalElement(this.actionObj.clone)))},dl.prototype.yearEventsRendering=function(e){for(var t=0,i=[].slice.call(this.parent.element.querySelectorAll("."+Yi));t<i.length;t++){var n=i[t];B.remove(n)}var r=new Date(e[this.parent.eventFields.endTime]),a=0;0===this.parent.activeViewOptions.group.resources.length&&(a=this.getMonthDiff(e[this.parent.eventFields.startTime],Y(r,-1)));for(var s=0;s<=a;s++){var o=void 0;0===this.parent.activeViewOptions.group.resources.length?o=this.getEventCount(e,this.actionObj.start.getMonth()+s):(o=B.extend({},e,null,!0),r=this.resizeEdges.left||this.resizeEdges.right?Y(r,-1):r,o.count=this.getMonthDiff(e[this.parent.eventFields.startTime],r)+1),this.dynamicYearlyEventsRendering(o,!0)}},dl.prototype.getMonthDiff=function(e,t){var i=12*(t.getFullYear()-e.getFullYear());return(i=(i-=e.getMonth())+t.getMonth())<=0?0:i},dl.prototype.getEventCount=function(e,t){var e=B.extend({},e,null,!0),i=e[this.parent.eventFields.startTime],n=e[this.parent.eventFields.endTime],r=new Date(this.parent.selectedDate.getFullYear(),t,1),t=Y(new Date(this.parent.selectedDate.getFullYear(),t+1,0),1),a=1;return i.getTime()<r.getTime()&&(e[this.parent.eventFields.startTime]=r),n.getTime()>t.getTime()&&(e[this.parent.eventFields.endTime]=t),0===this.parent.activeViewOptions.group.resources.length&&(a=Math.ceil((e[this.parent.eventFields.endTime].getTime()-e[this.parent.eventFields.startTime].getTime())/W)),e.count=a,e},dl.prototype.resizeStop=function(e){var t=this,e=(B.EventHandler.remove(document,B.Browser.touchMoveEvent,this.resizing),B.EventHandler.remove(document,B.Browser.touchEndEvent,this.resizeStop),clearInterval(this.actionObj.scrollInterval),this.actionObj.scrollInterval=null,this.actionObj.action=null,this.removeCloneElementClasses(),this.removeCloneElement(),this.actionClass("removeClass"),{cancel:this.parent.uiStateValues.action=this.parent.uiStateValues.isTapHold=!1,data:this.getChangedData(),element:this.actionObj.element,event:e});this.parent.trigger(de,e,function(e){e.cancel||t.parent.eventBase.checkOverlap(e.data)||(t.parent.isSpecificResourceEvents()&&(t.parent.crudModule.crudObj.sourceEvent=[t.parent.resourceBase.lastResourceLevel[parseInt(e.element.getAttribute("data-group-index"),10)]],t.parent.crudModule.crudObj.targetEvent=t.parent.crudModule.crudObj.sourceEvent,t.parent.crudModule.crudObj.isCrudAction=!0),t.saveChangedData(e))})},dl.prototype.verticalResizing=function(e){var t=this.actionObj.clone.offsetTop,t=(e||(t+=this.actionObj.clone.offsetHeight),t/Math.round(this.actionObj.cellHeight)*this.actionObj.slotInterval),i=this.actionObj.clone.offsetParent;B.isNullOrUndefined(i)||((i=z(this.parent.getDateFromElement(i))).setHours(this.parent.activeView.getStartHour().getHours()),i.setMinutes(t+this.parent.activeView.getStartHour().getMinutes()),e?this.actionObj.start=this.calculateIntervalTime(i):this.actionObj.end=this.calculateIntervalTime(i),this.updateTimePosition(i))},dl.prototype.horizontalResizing=function(e){var t=new Date(this.actionObj.event[this.parent.eventFields.startTime].getTime()),i=new Date(this.actionObj.event[this.parent.eventFields.endTime].getTime()),n=this.parent.currentView,r="TimelineMonth"===this.parent.currentView;if(this.parent.activeView.isTimelineView()){var a=this.parent.getContentTable().querySelector("tr"),s=(0<this.parent.activeViewOptions.headerRows.length&&(n=(m=this.parent.activeViewOptions.headerRows.map(function(e){return e.option})).slice(-1)[0],r)&&"Hour"===n&&(n=m.slice(-2)[0]||"Month"),m=e?t:i,0),o=[].slice.call(a.children),l=!1,p=this.actionObj.cellWidth/(this.parent.activeViewOptions.timeScale.interval/this.parent.activeViewOptions.timeScale.slotCount),c=parseFloat(this.parent.enableRtl?this.actionObj.clone.style.right:this.actionObj.clone.style.left),c=Math.round(c/p)*p;if(-1!==["Year","Month","Week","Date"].indexOf(n)){for(var h=0,d=0,u=o;d<u.length;d++){var g=u[d];h+=parseInt(g.getAttribute("colspan"),10)}p=this.parent.enableRtl?parseInt(this.actionObj.clone.style.right,10):parseInt(this.actionObj.clone.style.left,10),p=Math.round(p/this.actionObj.cellWidth)*this.actionObj.cellWidth;e||(p+=this.parent.getElementWidth(this.actionObj.clone)-this.actionObj.cellWidth),s=r?Math.floor(p/Math.floor(this.parent.getElementWidth(a)/h)):Math.round(p/(this.parent.getElementWidth(a)/h)),l=(s=!e&&r?s+1:s)===o.length,s=s<0?0:h<=s?h-1:s}else{p=this.actionObj.cellWidth;s=e?Math.round(c/this.actionObj.cellWidth):Math.ceil((c+(this.parent.getElementWidth(this.actionObj.clone)-p))/this.actionObj.cellWidth),this.parent.enableRtl&&(r=Math.round(c/this.actionObj.cellWidth)*this.actionObj.cellWidth+(e?0:this.parent.getElementWidth(this.actionObj.clone)-this.actionObj.cellWidth),s=Math.floor(r/this.actionObj.cellWidth)),l=s===o.length,s=this.getIndex(s)}var m,p=void 0,p=-1!==["Year","Month","Week","Date"].indexOf(n)?new Date(this.parent.activeView.renderDates[parseInt(s.toString(),10)].getTime()):this.parent.getDateFromElement(a.children[parseInt(s.toString(),10)]);-1===["TimelineMonth","Year","Month","Week","Date"].indexOf(n)&&this.parent.activeViewOptions.timeScale.enable?(e||(c+=this.parent.getElementWidth(this.actionObj.clone)),r=Math.floor(this.actionObj.slotInterval/this.actionObj.cellWidth*(c-Math.floor(c/this.actionObj.cellWidth)*this.actionObj.cellWidth)),r=l||!e&&0===r?this.actionObj.slotInterval:r,m=new Date(p.getTime()),m=new Date(p.getTime()+r*je),this.updateTimePosition(m)):m=new Date(p.setHours(m.getHours(),m.getMinutes(),m.getSeconds()))}else{o=B.closest(this.actionObj.clone,"td").cellIndex,s=Math.ceil((e?this.parent.getElementWidth(this.actionObj.element):0)/this.actionObj.cellWidth)*this.actionObj.cellWidth,h=Math.ceil((this.parent.getElementWidth(this.actionObj.clone)-s)/this.actionObj.cellWidth),a=B.closest(this.actionObj.clone,"tr"),c=e?o-h:o+h-1,c=this.getIndex(c);m=this.parent.getDateFromElement(a.children[parseInt(c.toString(),10)]),e?m.setHours(t.getHours(),t.getMinutes(),t.getSeconds()):m.setHours(i.getHours(),i.getMinutes(),i.getSeconds())}l=-1!==["TimelineMonth","Year","Month","Week","WorkWeek","Date","Day"].indexOf(n)||!this.parent.activeViewOptions.timeScale.enable;e?(i.getTime()-m.getTime()<=0&&(m=l?z(i):t),this.actionObj.start=l?m:this.calculateIntervalTime(m)):(r=l&&0===m.getHours()&&0===m.getMinutes()?Y(m,1):m,l&&r.getTime()-t.getTime()<=0&&(r=Y(z(t),1)),this.actionObj.end=l?r:this.calculateIntervalTime(r))},dl.prototype.getTopBottomStyles=function(e,t){var i=this.parent.element.querySelector("."+A),n=this.actionObj.cellHeight/this.actionObj.slotInterval*this.actionObj.interval,r=t?this.actionObj.element.offsetHeight+(this.actionObj.Y-this.actionObj.pageY):this.actionObj.element.offsetHeight+(this.actionObj.pageY-this.actionObj.Y),r=(a=t?this.actionObj.element.offsetTop-(this.actionObj.Y-this.actionObj.pageY):this.actionObj.clone.offsetTop)<0||this.actionObj.clone.offsetTop+this.actionObj.clone.offsetHeight>this.scrollArgs.height?this.actionObj.clone.offsetHeight:r,a=a<0?0:a;return r=(a=t?Math.floor(a/n)*n:a)+r>=i.scrollHeight?i.scrollHeight-a:Math.ceil(r/n)*n,!t&&this.actionObj.clone.offsetTop+r>=this.parent.getContentTable().offsetHeight&&(r=this.parent.getContentTable().offsetHeight-this.actionObj.clone.offsetTop),{height:B.formatUnit(r<this.actionObj.cellHeight?Math.floor(r/n)*n:r),top:B.formatUnit(r<this.actionObj.cellHeight&&t?Math.ceil(a/n)*n:a),left:"0px",right:"0px",width:"100%"}},dl.prototype.getLeftRightStyles=function(e,t){var i,n={},r=this.parent.activeView.isTimelineView(),a=-1<["TimelineDay","TimelineWeek","TimelineWorkWeek"].indexOf(this.parent.currentView)&&this.parent.activeViewOptions.timeScale.enable,s=this.actionObj.cellWidth/this.actionObj.slotInterval*this.actionObj.interval,o=t?this.actionObj.X-this.actionObj.pageX:this.actionObj.pageX-this.actionObj.X,l=r?Math.round(this.parent.getElementWidth(this.actionObj.element)/this.actionObj.cellWidth)*this.actionObj.cellWidth:"Month"===this.parent.currentView?this.parent.getElementWidth(this.actionObj.element):Math.ceil(this.parent.getElementWidth(this.actionObj.element)/this.actionObj.cellWidth)*this.actionObj.cellWidth,p=l+Math.ceil(o/this.actionObj.cellWidth)*this.actionObj.cellWidth,c=this.parent.enableRtl?parseInt(this.actionObj.element.style.right,10):this.actionObj.clone.offsetLeft,c=Math.round(c/s)*s,o=(a&&(p=l+Math.ceil(o/s)*s,t||(o=(+parseFloat(this.actionObj.element.style[this.parent.enableRtl?"right":"left"])).toFixed(1),i=Math.round(l/s)*s,o===c.toFixed(1)&&i===l)||(p=Math.round((c+p)/s)*s-c),this.actionObj.event[this.parent.eventFields.isAllDay]=!1),!t&&Math.floor(p+this.actionObj.clone.offsetLeft)>this.scrollArgs.width?this.parent.getElementWidth(this.actionObj.clone):(this.actionObj.cellWidth,p));return this.parent.enableRtl?(i=r?parseInt(this.actionObj.element.style.right,10):-(p-this.actionObj.cellWidth),i=!r&&(t||0<i)?0:i,r&&!t&&(i=Math.round(i/s)*s,(i-=Math.ceil((this.actionObj.pageX-this.actionObj.X)/s)*s)<0)&&(i=parseInt(this.actionObj.clone.style.right,10),o=parseInt(this.actionObj.clone.style.width,10)),i=i>=this.scrollArgs.width?this.scrollArgs.width-this.actionObj.cellWidth:i,n.right=B.formatUnit(i),o=o+i>this.scrollArgs.width?this.parent.getElementWidth(this.actionObj.clone):o):(c=t?this.actionObj.element.offsetLeft-(this.actionObj.X-this.actionObj.pageX):this.parent.enableRtl?this.actionObj.element.offsetLeft:0,r&&(c=t?c:parseInt(this.actionObj.clone.style.left,10),c=this.parent.enableRtl?!t&&this.actionObj.pageX<this.actionObj.X-this.parent.getElementWidth(this.actionObj.clone)?parseInt(this.actionObj.clone.style.right,10):c:t&&this.actionObj.pageX>this.actionObj.X+this.parent.getElementWidth(this.actionObj.clone)&&this.parent.getElementWidth(this.actionObj.clone)===this.actionObj.cellWidth?parseInt(this.actionObj.clone.style.left,10):c),p=c,(c=r?a?t?this.actionObj.element.offsetLeft-Math.ceil((this.actionObj.element.offsetLeft-c)/s)*s:c:Math.floor(c/this.actionObj.cellWidth)*this.actionObj.cellWidth:Math.ceil(Math.abs(c)/this.actionObj.cellWidth)*this.actionObj.cellWidth)<0&&(o=r&&t&&c%s?(c=parseInt(this.actionObj.clone.style.left,10),parseInt(this.actionObj.clone.style.width,10)):(c=0,this.parent.getElementWidth(this.actionObj.clone))),i=Math.ceil(this.parent.getElementWidth(this.actionObj.clone)/this.actionObj.cellWidth)*this.actionObj.cellWidth,t&&(n.left=B.formatUnit(!r&&t?p<0?-c:Math.ceil((l-i)/this.actionObj.cellWidth)*this.actionObj.cellWidth:c))),o=Math.floor(o),n.width=B.formatUnit(o),n},dl.prototype.resizeValidation=function(e){var e=this.parent.eventBase.getPageCoordinates(e),t=this.getContentAreaDimension(),i=this.parent.activeView.isTimelineView()&&this.parent.activeViewOptions.timeScale.enable,n=this.actionObj.cellWidth,r=!1;return this.resizeEdges.left&&(e.pageX<t.leftOffset&&e.pageX>=t.left&&i&&(n=0),r=e.pageX-n>=t.left),this.resizeEdges.right&&(e.pageX>t.rightOffset&&e.pageX<=t.right&&i&&(n=0),r=e.pageX+n<=t.right),this.resizeEdges.top&&(r=this.actionObj.clone.offsetTop>=t.top),r=this.resizeEdges.bottom?this.actionObj.clone.offsetTop+this.actionObj.clone.offsetHeight<=this.scrollArgs.height:r},dl.prototype.getModuleName=function(){return"resize"};var cl,hl,$o=dl;function dl(){return null!==hl&&hl.apply(this,arguments)||this}ul=function(e,t){return(ul=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}ul(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(vl,gl=es),vl.prototype.renderAppointments=function(){this.parent.dragAndDropModule&&this.parent.dragAndDropModule.setDragArea(),this.fields=this.parent.eventFields;for(var e="Year"===this.parent.currentView?"."+O+" ."+V:"."+x+",."+hn,t=0,i=[].slice.call(this.parent.element.querySelectorAll(e));t<i.length;t++){var n=i[t];B.remove(n)}this.renderedEvents=[],"Year"===this.parent.currentView?this.yearViewEvents():(this.removeCellHeight(),0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive?(this.isResource=!0,this.timelineResourceEvents()):this.timelineYearViewEvents()),this.parent.renderTemplates(),this.parent.notify(Ve,{})},vl.prototype.yearViewEvents=function(){for(var e=this.getMonths(),t=0,i=e;t<i.length;t++)for(var n=i[t],r=".e-month-calendar:nth-child("+(e.indexOf(n)+1)+") td.e-work-cells",a=[].slice.call(this.parent.element.querySelectorAll(r)),r=new Date(this.parent.selectedDate.getFullYear(),n,1),n=this.parent.calendarUtil.getMonthStartDate(new Date(r.getTime())),r=this.parent.calendarUtil.getMonthEndDate(new Date(r.getTime())),s=Ue(n,this.parent.activeViewOptions.firstDayOfWeek),o=Y(Be(r,this.parent.activeViewOptions.firstDayOfWeek),1),l=0;s.getTime()<o.getTime();l++){var p=z(new Date(s.getTime())),c=Y(new Date(p.getTime()),1),s=Y(new Date(s.getTime()),1);this.parent.isMinMaxDate(p)&&0<this.parent.eventBase.filterEvents(p,c).length&&(p=a[parseInt(l.toString(),10)])&&p.appendChild(B.createElement("div",{className:V}))}},vl.prototype.timelineYearViewEvents=function(){for(var n,r=this,e=this.parent.element.querySelector("."+O+":not(."+E+")"),e=(this.cellWidth=this.parent.getElementWidth(e),this.cellHeader=ot(e.querySelector("."+Pi)),this.parent.element.querySelector("."+Ft)),t=(this.eventHeight=this.parent.getElementHeightFromClass(e,V),this.addCellHeight(".e-month-header-wrapper tbody tr,.e-resource-column-table tbody tr,.e-content-table tbody tr",this.eventHeight,2,this.cellHeader,this.moreIndicatorHeight),[].slice.call(this.parent.element.querySelectorAll("."+fi))),i=this.getMonths(),o=0<this.parent.activeViewOptions.group.resources.length&&this.parent.uiStateValues.isGroupAdaptive?this.parent.uiStateValues.groupIndex:void 0,l=0;l<i.length;l++){var a=t[parseInt(l.toString(),10)],s=l+1,p=B.createElement("div",{className:x}),c=(a.appendChild(p),new Date(this.parent.selectedDate.getFullYear(),i[parseInt(l.toString(),10)],1)),h=new Date(c.getFullYear(),c.getMonth()+1,0),d=c.getDay(),u=[];for("Horizontal"===this.parent.activeViewOptions.orientation&&(this.renderedEvents=[]);c.getTime()<=h.getTime();){for(var g=void 0,m=void 0,v=("Vertical"===this.parent.activeViewOptions.orientation?(T=t[parseInt(d.toString(),10)],s=d+1,(p=T.querySelector("."+x))||(p=B.createElement("div",{className:x}),T.appendChild(p)),this.parent.enableRtl?m=l*this.cellWidth:g=l*this.cellWidth):this.parent.enableRtl?m=(d+c.getDate()-1)*this.cellWidth:g=(d+c.getDate()-1)*this.cellWidth,this.parent.element.querySelector(".e-content-wrap tr:nth-child("+s+") td")),f=(this.cellHeight=v.offsetHeight,z(new Date(c.getTime()))),y=Y(new Date(f.getTime()),1),T=void 0,w=(this.parent.uiStateValues.isGroupAdaptive&&(T=this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex]),this.parent.eventBase.filterEvents(f,y,void 0,T)),w=this.parent.eventBase.sortByDateTime(w),D=this,b=0,S=w.length;b<S;b++)!function(e,t){var i=B.extend({},w[parseInt(e.toString(),10)],null,!0),e=(D.updateSpannedEvents(i,f,y),D.getIndex(f)),n=(i.Index=e,D.cellHeader+D.eventHeight*(e+1)+2+D.moreIndicatorHeight),r=D.cellHeight-D.cellHeader-D.moreIndicatorHeight,r=Math.floor(r/(D.eventHeight+2)),a=D.parent.rowAutoHeight?1:D.parent.activeViewOptions.maxEventsPerRow,a=D.parent.activeViewOptions.maxEventsPerRow?t-a:t-r<=0?1:t-r;if("Horizontal"===D.parent.activeViewOptions.orientation){var s,t=D.renderedEvents.filter(function(e){return e.Guid===i.Guid}),r=u.filter(function(e){return e.Guid===i.Guid});if(0<t.length&&t[0].MoreIndicator||0<r.length&&r[0].MoreIndicator)return s="Horizontal"===D.parent.activeViewOptions.orientation?l:d,D.renderMoreIndicator(p,a,f,s,g,m,o);if(0<t.length||0<r.length)return}if(D.maxHeight&&-1!==D.parent.currentView.indexOf("Timeline")&&0<e)return;D.parent.rowAutoHeight||D.shouldRenderAppointment(e,n)?(D.renderEvent(p,i,l,g,m,c,d),(D.parent.rowAutoHeight||D.cellHeight>n)&&D.updateCellHeight(v,n),u.push(i)):(s="Horizontal"===D.parent.activeViewOptions.orientation?l:d,D.renderMoreIndicator(p,a,f,s,g,m,o),"Horizontal"===D.parent.activeViewOptions.orientation&&(i.MoreIndicator=!0,D.renderedEvents.push(i),u.push(i)))}(b,S);c=Y(new Date(c.getTime()),1),"Vertical"===this.parent.activeViewOptions.orientation&&(d++,this.renderedEvents=[])}}this.parent.rowAutoHeight&&"Vertical"===this.parent.activeViewOptions.orientation&&(e=[].slice.call(this.parent.element.querySelectorAll("."+fi)),n=[].slice.call(this.parent.element.querySelectorAll("."+C+" tbody tr")),e.forEach(function(e,t){var e=[].slice.call(e.querySelectorAll("."+V)),i=n[parseInt(t.toString(),10)].offsetTop+r.cellHeader+2;e.forEach(function(e){var t=parseInt(e.getAttribute("data-index"),10);e.style.top=i+t*r.eventHeight+"px",e.removeAttribute("data-index")})}))},vl.prototype.updateSpannedEvents=function(e,t,i){var n=this.isResource&&"Vertical"===this.parent.activeViewOptions.orientation||!this.isResource&&"Horizontal"===this.parent.activeViewOptions.orientation,r={isLeft:!0,isRight:!0,isBottom:!0,isTop:!0};t.getTime()<=e[this.fields.startTime].getTime()&&(n?r.isLeft=!1:r.isTop=!1),(i.getTime()>=e[this.fields.endTime].getTime()||n&&!this.isResource&&Y(i,-1).getMonth()===e[this.fields.endTime].getMonth()||n&&this.isResource&&i.getTime()<=e[this.fields.endTime].getTime())&&(n?r.isRight=!1:r.isBottom=!1),e.data=r},vl.prototype.timelineResourceEvents=function(){var s,i,o=this,e=this.parent.element.querySelector("."+A),t=e.offsetWidth>e.clientWidth,n=this.parent.element.querySelector("."+O),n=(this.cellWidth=this.parent.getElementWidth(n),this.cellHeader=0,this.parent.element.querySelector("."+Ft)),r=(this.eventHeight=this.parent.getElementHeightFromClass(n,V),this.addCellHeight(".e-month-header-wrapper tbody tr,.e-resource-column-table tbody tr,.e-content-table tbody tr",this.eventHeight,2,this.cellHeader,this.moreIndicatorHeight),[].slice.call(this.parent.element.querySelectorAll("."+fi))),a=this.parent.uiStateValues.isGroupAdaptive?[this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex]]:this.parent.activeViewOptions.allowVirtualScrolling?this.parent.resourceBase.renderedResources:this.parent.resourceBase.lastResourceLevel,l=this.getMonths();if("Horizontal"===this.parent.activeViewOptions.orientation)for(var p=0;p<l.length;p++)for(var c=new Date(this.parent.selectedDate.getFullYear(),l[parseInt(p.toString(),10)],1),h=0,d=a.length;h<d;h++)this.renderedEvents=[],this.renderResourceEvent(r[parseInt(p.toString(),10)],a[parseInt(h.toString(),10)],p,h,c);else for(h=0,d=a.length;h<d;h++){this.renderedEvents=[];for(p=0;p<l.length;p++){c=new Date(this.parent.selectedDate.getFullYear(),l[parseInt(p.toString(),10)],1);this.renderResourceEvent(r[parseInt(h.toString(),10)],a[parseInt(h.toString(),10)],p,h,c)}}this.parent.rowAutoHeight&&!t&&e.offsetWidth>e.clientWidth&&([].slice.call(this.parent.element.querySelectorAll("."+V)).forEach(function(e){e.style.removeProperty("left"),e.style.removeProperty("right")}),n=[].slice.call(this.parent.element.querySelectorAll("."+fi)),s=this.parent.element.querySelector("."+C),i=[].slice.call(s.querySelectorAll("tbody tr")),n.forEach(function(e,t){var e=[].slice.call(e.children),a=i[parseInt(t.toString(),10)];e.forEach(function(e,t){var i,t=a.querySelector("td:nth-child("+(t+1)+")"),e=[].slice.call(e.children),n=o.parent.getElementWidth(t),r=t.offsetLeft;o.parent.enableRtl?(i=s.offsetWidth-r-t.offsetWidth,e.forEach(function(e){e.style.width=Math.floor(parseInt(e.style.width,10)/n)*n+"px",e.style.right=i+"px"})):e.forEach(function(e){e.style.width=Math.floor(parseInt(e.style.width,10)/n)*n+"px",e.style.left=r+"px"})})}))},vl.prototype.shouldRenderAppointment=function(e,t){var i=this.parent.rowAutoHeight?1:this.parent.activeViewOptions.maxEventsPerRow;return!this.parent.activeViewOptions.maxEventsPerRow||this.parent.rowAutoHeight||this.parent.eventSettings.enableIndicator?this.maxOrIndicator?e<1:this.cellHeight>t:e<i},vl.prototype.renderResourceEvent=function(e,t,l,p,c){for(var h=B.createElement("div",{className:x}),e=(e.appendChild(h),Y(ze(new Date(c.getTime())),1)),d=this.parent.eventBase.filterEvents(c,e,void 0,t),e="Vertical"===this.parent.activeViewOptions.orientation?p:l,u=this.parent.element.querySelector(".e-content-wrap tr:nth-child("+(e+1)+") td"),g=(this.cellHeight=u.offsetHeight,this.groupOrder=t.groupOrder,[]),m=this,i=0;i<d.length;i++){var n=function(e){var t=d[parseInt(e.toString(),10)],i=void 0,n=B.extend({},t,null,!0),t=(i=0<m.parent.activeViewOptions.group.resources.length?(t=m.isSpannedEvent(n,c),m.getIndex(t[m.fields.startTime])):m.getIndex(n[m.fields.startTime]),n.Index=i,m.cellHeader+m.eventHeight*(e+1)+2+m.moreIndicatorHeight),r="Vertical"===m.parent.activeViewOptions.orientation?l*m.cellWidth:p*m.cellWidth;if(!m.parent.isMinMaxDate(n[m.fields.startTime]))return{value:void 0};if("Vertical"===m.parent.activeViewOptions.orientation&&0<m.parent.activeViewOptions.group.resources.length){var a=m.renderedEvents.filter(function(e){return e.Guid===n.Guid}),s=g.filter(function(e){return e.Guid===n.Guid});if(0<a.length||0<s.length)return"continue"}if(m.maxHeight&&-1!==m.parent.currentView.indexOf("Timeline")&&0<i)return"continue";if(!m.parent.rowAutoHeight&&!m.shouldRenderAppointment(i,t)){a="Horizontal"===m.parent.activeViewOptions.orientation?l:p;if(m.renderMoreIndicator(h,d.length-e,c,a,r,r,p),"Horizontal"===m.parent.activeViewOptions.orientation)for(var o=p;o<d.length;o++)m.renderedEvents.push(B.extend({},d[parseInt(o.toString(),10)],{Index:i+o},!0));return"break"}m.renderEvent(h,n,l,r,r,c,p),m.updateCellHeight(u,t),g.push(n)}(i);if("object"==typeof n)return n.value;if("break"===n)break}},vl.prototype.setMaxEventHeight=function(e,t){t=t.offsetHeight-this.cellHeader-(this.maxHeight?0:this.moreIndicatorHeight);B.setStyleAttribute(e,{height:t+"px","align-items":"center"})},vl.prototype.renderEvent=function(t,e,i,n,r,a,s){var o,l=this,p=this.isSpannedEvent(e,a),c=this.createEventElement(p);1===p.isSpanned.count&&(e=Y(p[this.fields.endTime],-1),p[this.fields.endTime]=e>p[this.fields.startTime]?e:p[this.fields.endTime]),p[this.fields.startTime]>p[this.fields.endTime]||(a="Horizontal"===this.parent.activeViewOptions.orientation?(o=i+1,p[this.fields.startTime].getTime()===p[this.fields.endTime].getTime()&&(p.isSpanned.count=1),p.isSpanned.count*this.cellWidth):(o=s+1,this.isResource?p.isSpanned.count*this.cellWidth:this.cellWidth),i=(e=this.parent.element.querySelector(".e-content-wrap tr:nth-child("+o+") td")).offsetTop+this.cellHeader+this.eventHeight*p.Index+2,B.setStyleAttribute(c,{width:a+"px",height:this.eventHeight+"px",left:n+"px",right:r+"px",top:i+"px"}),this.maxOrIndicator&&-1!==this.parent.currentView.indexOf("Timeline")&&this.setMaxEventHeight(c,e),!this.isResource&&this.parent.rowAutoHeight&&"Vertical"===this.parent.activeViewOptions.orientation&&c.setAttribute("data-index",p.Index.toString()),this.parent.trigger(ie,{data:p,element:c,cancel:!1,type:"event"},function(e){!e.cancel&&(t.appendChild(c),l.wireAppointmentEvents(c,p),0<l.parent.activeViewOptions.group.resources.length||"Vertical"===l.parent.activeViewOptions.orientation||(p.isSpanned.isRight||p.isSpanned.isLeft)&&"Horizontal"===l.parent.activeViewOptions.orientation||!p.isSpanned.isRight)&&l.renderedEvents.push(B.extend({},p,null,!0))}))},vl.prototype.renderMoreIndicator=function(e,t,i,n,r,a,s){var o;0===this.parent.activeViewOptions.group.resources.length&&e.querySelector('[data-start-date="'+i.getTime()+'"]')||(o=0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive?Y(ze(new Date(i.getTime())),1):Y(new Date(i.getTime()),1),t=this.getMoreIndicatorElement(t,i,o),i=this.parent.element.querySelector(".e-content-wrap tr:nth-child("+(n+1)+")").offsetTop+(this.cellHeight-this.moreIndicatorHeight),r=Math.floor(r/this.cellWidth)*this.cellWidth,a=Math.floor(a/this.cellWidth)*this.cellWidth,B.setStyleAttribute(t,{width:this.cellWidth+"px",left:r+"px",right:a+"px",top:i+"px"}),B.isNullOrUndefined(s)||t.setAttribute("data-group-index",s.toString()),e.appendChild(t),B.EventHandler.add(t,"click",this.moreIndicatorClick,this))},vl.prototype.createEventElement=function(e){var t,i=e[this.fields.subject]||this.parent.eventSettings.fields.subject.default||this.parent.localeObj.getConstant("addTitle"),n=B.createElement("div",{className:V,attrs:{"data-id":"Appointment_"+e[this.fields.id],"data-guid":e.Guid,role:"button",tabindex:"0","aria-disabled":this.parent.eventBase.getReadonlyAttribute(e),"aria-label":this.parent.getAnnouncementString(e)}}),r=(this.cssClass&&B.addClass([n],this.cssClass),e[this.fields.isReadonly]&&B.addClass([n],Rr),0<this.parent.activeViewOptions.group.resources.length&&(r=this.getGroupIndexFromEvent(e),n.setAttribute("data-group-index",r.toString())),[]),a=B.extend({},e,null,!0),s=(this.parent.activeViewOptions.eventTemplate?(s=this.parent.element.id+"_"+this.parent.activeViewOptions.eventTemplateName+"eventTemplate",r=this.parent.getAppointmentTemplate()(a,this.parent,"eventTemplate",s,!1,void 0,void 0,this.parent.root)):(s=e[this.fields.location]||this.parent.eventSettings.fields.location.default||"",i=B.createElement("div",{className:Gn,innerHTML:i+(s?"; "+s:"")}),s=B.createElement("div",{className:Ci+(this.parent.isAdaptive?" "+d:""),innerHTML:this.parent.getTimeString(a[this.fields.startTime])}),t=B.createElement("div",{className:Ci+(this.parent.isAdaptive?" "+d:""),innerHTML:this.parent.getTimeString(a[this.fields.endTime])}),B.addClass([i],"e-text-center"),e[this.fields.isAllDay]?r=[i]:a.isLeft||a.isRight?(a.isLeft||r.push(s),r.push(i),a.isRight||r.push(t)):r=[s,i,t]),B.createElement("div",{className:Di}));return B.append(r,s),n.appendChild(s),this.parent.eventBase.renderSpannedIcon(n,e.isSpanned),this.renderResizeHandler(n,e.data,e[this.fields.isReadonly]),this.applyResourceColor(n,a,"backgroundColor",this.groupOrder),n},vl.prototype.isSpannedEvent=function(e,t){var i=new Date(t.getFullYear(),t.getMonth(),1),t=Y(new Date(t.getFullYear(),t.getMonth()+1,0),1),n=B.extend({},e,null,!0),r=n[this.fields.startTime],a=n[this.fields.endTime],s={isLeft:!1,isRight:!1,count:1},o=new Date(this.parent.selectedDate.getFullYear(),this.parent.firstMonthOfYear,1),l=Ke(o,this.parent.monthsCount);return this.isResource&&this.updateSpannedEvents(e,i,t),"Vertical"===this.parent.activeViewOptions.orientation&&0<this.parent.activeViewOptions.group.resources.length?(this.updateSpannedEventDetails(r,a,o,l,n,s),o=n[this.fields.startTime],l=new Date(n[this.fields.endTime]-1),s.count=l.getMonth()-o.getMonth()+this.parent.monthsCount*(l.getFullYear()-o.getFullYear())+1):(this.updateSpannedEventDetails(r,a,i,t,n,s),0!==this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive||(l=z(n[this.fields.endTime]).getTime(),o=z(n[this.fields.startTime]).getTime(),(e[this.fields.isAllDay]&&l===e[this.fields.endTime].getTime()||s.isRight)&&(l=Y(new Date(l),-1).getTime()),s.count=Math.round((l-o)/W)+1)),n.isSpanned=s,z(r).getTime()<z(this.parent.minDate).getTime()&&(n[this.fields.startTime]=this.parent.minDate),z(a).getTime()>z(this.parent.maxDate).getTime()&&(n[this.fields.endTime]=this.parent.maxDate),n},vl.prototype.updateSpannedEventDetails=function(e,t,i,n,r,a){e.getTime()<i.getTime()&&(r[this.fields.startTime]=i,a.isLeft=!0),t.getTime()>n.getTime()&&(r[this.fields.endTime]=n,a.isRight=!0)},vl.prototype.getOverlapEvents=function(e,t){var i,n,r,a,s=[];0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive?(i=this.parent.calendarUtil.getMonthStartDate(new Date(e.getTime())),n=Y(this.parent.calendarUtil.getMonthEndDate(new Date(e.getTime())),-1),r=z(new Date(i.getTime())).getTime(),a=z(new Date(n.getTime())).getTime()):this.parent.rowAutoHeight?(r=z(new Date(e.getTime())).getTime(),a=Y(z(new Date(e.getTime())),1).getTime()):r=a=z(new Date(e.getTime())).getTime();for(var o=0,l=t;o<l.length;o++){var p=l[o],c=new Date(p[this.fields.startTime].getTime()),h=new Date(p[this.fields.endTime].getTime()),d=p[this.fields.isAllDay]?z(h).getTime()>r:z(h).getTime()>=r;(z(c).getTime()<=r&&d||z(c).getTime()>=r&&z(h).getTime()<=a||"Vertical"===this.parent.activeViewOptions.orientation&&z(c).getTime()>=r&&z(h).getTime()>=a)&&s.push(p)}return s},vl.prototype.getMonths=function(){var i=this;return Array.apply(null,{length:this.parent.monthsCount}).map(function(e,t){return i.parent.firstMonthOfYear+t})},vl.prototype.removeCellHeight=function(){for(var e=0,t=[].slice.call(this.element.querySelectorAll(".e-month-header-wrapper tbody tr,.e-resource-column-table tbody tr,.e-content-table tbody tr"));e<t.length;e++)t[e].firstElementChild.style.height=""},vl.prototype.destroy=function(){gl.prototype.destroy.call(this),this.parent=null};var ul,gl,ml=vl;function vl(e){e=gl.call(this,e,"day")||this;return e.isResource=!1,e}fl=function(e,t){return(fl=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}fl(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(f,yl=rl),f.prototype.wireDragEvent=function(e){new B.Draggable(e,{abort:"."+Xi+", ."+Nr,clone:!0,isDragScroll:!0,enableTailMode:!!this.parent.eventDragArea,cursorAt:this.parent.eventDragArea?{left:-20,top:-20}:{left:0,top:0},dragArea:this.dragArea,dragStart:this.dragStart.bind(this),drag:this.drag.bind(this),dragStop:this.dragStop.bind(this),enableAutoScroll:!1,helper:this.dragHelper.bind(this),queryPositionInfo:this.dragPosition.bind(this)})},f.prototype.setDragArea=function(){var e=document.querySelector(this.parent.eventDragArea);this.dragArea=this.parent.eventDragArea&&e?e:this.parent.element.querySelector("."+C)},f.prototype.dragHelper=function(e){var i=this;if(e.sender&&"touchmove"===e.sender.type&&(!this.parent.uiStateValues.isTapHold||!e.element.classList.contains(wi)))return null;this.setDragActionDefaultValues(),this.actionObj.element=e.element,e.sender&&-1<["Day","Week","WorkWeek"].indexOf(this.parent.currentView)&&(t=this.parent.eventBase.getPageCoordinates(e.sender),this.distanceUptoCursor=t.clientY-this.actionObj.element.getBoundingClientRect().top,this.eleTop=parseFloat(this.actionObj.element.style.top),this.slotsUptoCursor=-1),this.actionObj.action="drag";var t=[];return!this.parent.allowMultiDrag||B.isNullOrUndefined(this.parent.selectedElements)||0===this.parent.selectedElements.length||0<this.parent.selectedElements.length&&-1===this.parent.selectedElements.indexOf(this.actionObj.element)?t=[e.element]:(t=this.parent.selectedElements,this.isMultiSelect=!0),t.forEach(function(e){var t=i.createCloneElement(e);e.getAttribute("data-guid")===i.actionObj.element.getAttribute("data-guid")&&(i.actionObj.clone=t,i.parent.eventDragArea||"Month"===i.parent.currentView||!i.parent.activeViewOptions.timeScale.enable||i.parent.activeView.isTimelineView()||i.actionObj.element.classList.contains(an)||B.setStyleAttribute(i.actionObj.clone,{cursor:"move",left:"0%",right:"0%",width:"100%"}),i.actionObj.clone.style.top=B.formatUnit(i.actionObj.element.offsetTop)),i.actionObj.cloneElement.push(t),i.actionObj.originalElement.push(e)}),this.actionObj.clone},f.prototype.dragPosition=function(e){var t,i,n,r,a;return this.parent.eventDragArea?{left:e.left,top:e.top}:(t=this.actionObj.cellHeight/this.actionObj.slotInterval*this.actionObj.interval,i=B.formatUnit(0),"Month"===this.parent.currentView&&(i=e.left),n=this.isStepDragging?Math.ceil(this.actionObj.clone.getBoundingClientRect().right)+this.actionObj.interval:this.actionObj.clone.getBoundingClientRect().right,a=this.parent.element.querySelector("."+A).getBoundingClientRect().right,!(this.parent.activeView.isTimelineView()&&"TimelineYear"!==this.parent.currentView&&!this.parent.enableRtl&&this.actionObj.pageX>n)||this.isMorePopupOpened||this.actionObj.pageX>a||(this.isCursorAhead=!0),this.parent.activeView.isTimelineView()&&(i=B.formatUnit(this.actionObj.clone.offsetLeft)),this.parent.activeView.isTimelineView()||!this.parent.timeScale.enable||!B.isNullOrUndefined(this.actionObj.clone.offsetParent)&&this.actionObj.clone.offsetParent.classList.contains(Cn)?r=B.formatUnit(this.actionObj.clone.offsetTop):"Month"===this.parent.currentView?r=B.formatUnit(0):this.actionObj.clone.classList.contains(an)?(r=B.formatUnit(this.parent.element.querySelector("."+Ot).offsetTop),B.setStyleAttribute(this.actionObj.clone,{width:B.formatUnit(Math.ceil(this.actionObj.clone.offsetWidth/this.actionObj.cellWidth)*this.actionObj.cellWidth),right:this.parent.enableRtl&&B.formatUnit(0)})):(this.actionObj.element.classList.contains(an)&&!this.actionObj.clone.classList.contains(an)&&B.setStyleAttribute(this.actionObj.clone,{height:B.formatUnit(this.actionObj.cellHeight),width:B.formatUnit(this.actionObj.cellWidth-1),pointerEvents:"none"}),n=(n=parseInt(e.top,10))<0?0:n,this.slotsUptoCursor<0&&(a=Math.floor((this.eleTop+this.distanceUptoCursor)/t),e=Math.floor(this.eleTop/t),this.slotsUptoCursor=a-e),n=(Math.floor((n+this.distanceUptoCursor+1)/t)-this.slotsUptoCursor)*t,r=B.formatUnit(n<0?0:n),(a=this.parent.element.querySelector(".e-content-wrap").scrollHeight)<(e=parseInt(r,10)+this.actionObj.clone.offsetHeight)&&(r=parseInt(r,10)-(e-a)+"px"),this.isPreventMultiDrag&&(r=B.formatUnit(this.actionObj.clone.offsetTop))),{left:i,top:r})},f.prototype.setDragActionDefaultValues=function(){this.actionObj.action="drag",this.actionObj.isAllDay=null,this.actionObj.slotInterval=this.parent.activeViewOptions.timeScale.interval/this.parent.activeViewOptions.timeScale.slotCount,this.actionObj.interval=this.actionObj.slotInterval;var e=this.parent.element.querySelector("."+O);this.actionObj.cellWidth=e.offsetWidth,this.actionObj.cellHeight=e.offsetHeight},f.prototype.dragStart=function(i){var n=this,e=this.actionObj.element.getAttribute("data-guid"),r=(this.actionObj.event=this.parent.eventBase.getEventByGuid(e),B.extend({},this.actionObj.event,null,!0)),a=(B.isNullOrUndefined(r)||(this.startTime=r[this.parent.eventFields.startTime].getTime()),this.parent.allowMultiDrag||this.parent.eventBase.removeSelectedAppointmentClass(),{cancel:!1,data:r,selectedData:this.getSelectedData(),event:i,excludeSelectors:null,element:this.actionObj.element,interval:this.actionObj.interval,navigation:{enable:!1,timeDelay:2e3},scroll:{enable:!0,scrollBy:30,timeDelay:100}});this.parent.trigger(oe,a,function(e){var t;e.cancel||!B.isNullOrUndefined(n.actionObj.element)&&B.isNullOrUndefined(n.actionObj.element.parentElement)?(t=n.actionObj.element.ej2_instances[0],B.isNullOrUndefined(t)||t.intDestroy(i.event),n.isMultiSelect=!1,n.multiData=[],n.actionObj.action="",n.removeCloneElementClasses(),n.removeCloneElement()):(n.actionClass("addClass"),n.parent.uiStateValues.action=!0,n.actionObj.start=r[n.parent.eventFields.startTime],n.actionObj.end=r[n.parent.eventFields.endTime],n.actionObj.groupIndex=parseInt(n.actionObj.element.getAttribute("data-group-index")||"0",10),n.actionObj.interval=e.interval,n.actionObj.navigation=e.navigation,n.actionObj.scroll=e.scroll,n.enableCurrentViewDrag=a.dragWithinRange&&!a.navigation.enable&&n.parent.allowMultiDrag,n.actionObj.excludeSelectors=e.excludeSelectors,t=n.parent.element.querySelector("."+A),n.scrollArgs={element:t,width:t.scrollWidth,height:t.scrollHeight},n.widthPerMinute=n.actionObj.cellWidth/n.actionObj.slotInterval*n.actionObj.interval,n.heightPerMinute=n.actionObj.cellHeight/n.actionObj.slotInterval*n.actionObj.interval,n.widthUptoCursorPoint=0,n.heightUptoCursorPoint=0,n.cursorPointIndex=-1,n.isHeaderRows=!1,n.isTimelineDayProcess=!1,n.minDiff=0,n.isMorePopupOpened=!1,n.daysVariation=-1,n.isAllDayTarget=n.actionObj.clone.classList.contains(an),!n.parent.activeView.isTimelineView()&&n.parent.timeScale.enable||"TimelineYear"===n.parent.currentView||(!B.isNullOrUndefined(n.actionObj.clone.offsetParent)&&n.actionObj.clone.offsetParent.classList.contains(Cn)&&(n.isMorePopupOpened=!0),n.actionObj.pageX=i.event.pageX,e=n.parent.activeViewOptions.headerRows,n.isHeaderRows=0<e.length&&"Hour"!==e[e.length-1].option&&"Date"!==e[e.length-1].option,n.isTimelineDayProcess=!n.parent.activeViewOptions.timeScale.enable||n.isHeaderRows||"TimelineMonth"===n.parent.currentView||0<e.length&&"Date"===e[e.length-1].option,n.isAllDayDrag=!n.isTimelineDayProcess&&r[n.parent.eventFields.isAllDay],n.isStepDragging=!n.isTimelineDayProcess&&!n.isAllDayDrag&&n.actionObj.slotInterval!==n.actionObj.interval,n.isTimelineDayProcess?n.timelineEventModule=new es(n.parent,"day"):n.timelineEventModule=new es(n.parent,"hour")),"TimelineYear"===n.parent.currentView&&(n.yearEvent=new ml(n.parent)),"Month"===n.parent.currentView&&(n.startTime=z(new Date(n.startTime)).getTime(),n.updateOriginalElement(n.actionObj.clone),n.monthEvent=new Za(n.parent)),"Day"!==n.parent.currentView&&"Week"!==n.parent.currentView&&"WorkWeek"!==n.parent.currentView||(n.verticalEvent=new Xa(n.parent),n.verticalEvent.initializeValues(),n.splitEvent(n.actionObj.event).forEach(function(e){var e='.e-day-wrapper[data-date="'+z(e[n.parent.eventFields.startTime]).getTime()+'"]',e=(0<n.parent.activeViewOptions.group.resources.length&&(e=e.concat('[data-group-index = "'+n.actionObj.groupIndex+'"]')),n.parent.element.querySelector(e));e&&(e=e.querySelector('[data-id="'+n.actionObj.clone.getAttribute("data-id")+'"]'))&&B.addClass([e],Wi)})))})},f.prototype.getSelectedData=function(){if(this.isMultiSelect&&0===this.multiData.length&&0<this.parent.selectedElements.length)for(var e=0,t=this.parent.selectedElements;e<t.length;e++){var i=t[e].getAttribute("data-guid"),i=this.parent.eventBase.getEventByGuid(i);this.multiData.push(B.extend({},i,null,!0))}return this.multiData},f.prototype.drag=function(e){var t,i,n,r;e.event&&"touchmove"===e.event.type&&e.event.preventDefault(),this.parent.quickPopup&&this.parent.quickPopup.quickPopupHide(!0),!B.isNullOrUndefined(e.target)&&e.target.classList&&e.target.classList.contains(yr)||(t=B.extend({},this.actionObj.event,null,!0),i=this.parent.eventBase.getPageCoordinates(e),this.actionObj.Y=this.actionObj.pageY=i.pageY,this.actionObj.X=this.actionObj.pageX=i.pageX,this.actionObj.target=e.target,this.widthUptoCursorPoint=0===this.widthUptoCursorPoint?Math.ceil(Math.abs(this.actionObj.clone.getBoundingClientRect().left-this.actionObj.X)/this.widthPerMinute)*this.widthPerMinute:this.widthUptoCursorPoint,this.widthUptoCursorPoint=this.isMorePopupOpened?this.actionObj.cellWidth:this.widthUptoCursorPoint,this.heightUptoCursorPoint=0===this.heightUptoCursorPoint?Math.ceil(Math.abs(this.actionObj.clone.getBoundingClientRect().top-this.actionObj.Y)/this.heightPerMinute)*this.heightPerMinute:this.heightUptoCursorPoint,-1<["Day","Week","WorkWeek"].indexOf(this.parent.currentView)&&(this.isAllDayDrag=this.parent.activeViewOptions.timeScale.enable?this.actionObj.clone.classList.contains(an):this.actionObj.event[this.parent.eventFields.isAllDay]),this.isStepDragging&&0===this.minDiff&&this.calculateMinutesDiff(t),"Month"!==this.parent.currentView&&!this.isAllDayDrag||!(this.daysVariation<0)||(n=this.parent.getDateFromElement(this.actionObj.target),B.isNullOrUndefined(n))?this.daysVariation=0:(n=z(n),r=z(new Date(t[this.parent.eventFields.startTime].getTime())),this.daysVariation=(n.getTime()-r.getTime())/W),this.parent.eventDragArea&&(n=i.target,this.actionObj.clone.style.top=B.formatUnit(n.offsetTop),this.actionObj.clone.style.left=B.formatUnit(n.offsetLeft),B.closest(n,"."+vt)?"Week"!==this.parent.currentView&&"WorkWeek"!==this.parent.currentView&&"Day"!==this.parent.currentView&&(this.actionObj.clone.style.width=B.formatUnit(this.actionObj.element.offsetWidth)):(this.actionObj.clone.style.height="",this.actionObj.clone.style.width="")),this.updateScrollPosition(e),this.updateNavigatingPosition(e),this.updateDraggingDateTime(e),r={data:t,event:e,element:this.actionObj.element,startTime:this.actionObj.start,endTime:this.actionObj.end,selectedData:this.updatedData},0<this.parent.group.resources.length&&(r.groupIndex=this.actionObj.groupIndex),this.parent.trigger(le,r))},f.prototype.calculateMinutesDiff=function(e){this.parent.enableRtl?this.minDiff=(this.actionObj.clone.offsetWidth-this.widthUptoCursorPoint)/this.widthPerMinute*this.actionObj.interval:this.minDiff=this.widthUptoCursorPoint/this.widthPerMinute*this.actionObj.interval;var e=e[this.parent.eventFields.startTime],t=Je(this.parent.activeView.renderDates[0],this.parent.activeView.getStartHour(),this.parent.activeView.getEndHour());t.startHour.getTime()>e.getTime()&&(this.minDiff=this.minDiff+(t.startHour.getTime()-e.getTime())/je)},f.prototype.dragStop=function(e){var t,i,n=this;this.isCursorAhead=!1,this.isPreventMultiDrag=!1,this.removeCloneElementClasses(),this.removeCloneElement(),clearInterval(this.actionObj.navigationInterval),this.actionObj.navigationInterval=null,clearInterval(this.actionObj.scrollInterval),this.actionObj.scrollInterval=null,this.actionClass("removeClass"),this.parent.uiStateValues.action=this.parent.uiStateValues.isTapHold=!1,this.isAllowDrop(e)||(t=e.target.classList&&!e.target.classList.contains("e-work-cells")&&this.parent.cellTemplate?B.closest(e.target,".e-work-cells"):e.target,i={cancel:!1,data:this.getChangedData(this.updatedData),selectedData:this.updatedData,event:e,element:this.actionObj.element,target:t},this.actionObj.action=null,this.parent.trigger(pe,i,function(e){var t;e.cancel||n.parent.eventBase.checkOverlap(e.data)||(n.parent.isSpecificResourceEvents()&&(n.parent.crudModule.crudObj.isCrudAction=!0,n.parent.crudModule.crudObj.sourceEvent=[n.parent.resourceBase.lastResourceLevel[parseInt(i.element.getAttribute("data-group-index"),10)]],t=parseInt(i.target.getAttribute("data-group-index"),10)||n.actionObj.groupIndex,n.parent.crudModule.crudObj.targetEvent=[n.parent.resourceBase.lastResourceLevel[parseInt(t.toString(),10)]]),n.saveChangedData(e,n.isMultiSelect))}),this.updatedData=[],this.multiData=[],this.isMultiSelect=!1,this.parent.selectedElements=[])},f.prototype.updateNavigatingPosition=function(i){var n,r=this;this.actionObj.navigation.enable&&(n=this.parent.getCurrentTime(),B.isNullOrUndefined(this.actionObj.navigationInterval))&&(this.actionObj.navigationInterval=window.setInterval(function(){var e,t;n&&(e=r.parent.getCurrentTime().getSeconds(),(t=60<=(t=n.getSeconds()+r.actionObj.navigation.timeDelay/1e3)?t-60:t)===e)&&(n=r.parent.getCurrentTime(),r.viewNavigation(i),r.updateDraggingDateTime(i))},this.actionObj.navigation.timeDelay))},f.prototype.updateDraggingDateTime=function(e){!B.isNullOrUndefined(this.actionObj.clone.offsetParent)&&this.actionObj.clone.offsetParent.classList.contains(Cn)?this.morePopupEventDragging(e):this.parent.activeView.isTimelineView()&&"TimelineYear"!==this.parent.currentView?(this.timelineEventModule.dateRender=this.parent.activeView.renderDates,this.timelineEventModule.cellWidth=this.actionObj.cellWidth,this.timelineEventModule.getSlotDates(),this.actionObj.cellWidth=this.isHeaderRows?this.timelineEventModule.cellWidth:this.parent.getElementWidth(this.parent.element.querySelector("."+O)),this.calculateTimelineTime(e)):"Month"===this.parent.currentView||"TimelineYear"===this.parent.currentView?this.calculateVerticalDate(e):this.calculateVerticalTime(e)},f.prototype.navigationWrapper=function(){if(this.parent.activeView.isTimelineView()){var t,e=void 0,e=0<this.parent.activeViewOptions.group.resources.length?this.parent.element.querySelectorAll(".e-appointment-container:not(.e-hidden)").item(this.actionObj.index):this.parent.element.querySelector("."+fi);B.isNullOrUndefined(e)||((t=e.querySelector("."+x))||(t=B.createElement("div",{className:x}),e.appendChild(t)),this.actionObj.cloneElement.forEach(function(e){t.appendChild(e)}))}else if("Month"!==this.parent.currentView&&this.parent.timeScale.enable){e=this.actionObj.clone.classList.contains(an)?"."+rn:"."+x;if(this.parent.element.querySelectorAll(e).item(this.actionObj.index).appendChild(this.actionObj.clone),e=="."+rn){var i=this.getAllDayEventHeight(),e=[].slice.call(this.parent.element.querySelectorAll("."+w+":first-child"));if(e[0].offsetHeight<i)for(var n=0,r=e;n<r.length;n++)r[n].style.height=(i+2)/12+"em";this.actionObj.clone.style.height=B.formatUnit(i)}this.actionObj.height=parseInt(this.actionObj.clone.style.height,10)}else{var e=[].slice.call(this.parent.element.querySelectorAll("."+O)),a=(this.actionObj.index=this.parent.activeView.renderDates.length<this.actionObj.index?this.parent.activeView.renderDates.length-1:this.actionObj.index,e[this.actionObj.index].querySelector("."+x));a||(a=B.createElement("div",{className:x}),e[this.actionObj.index].appendChild(a)),a.appendChild(this.actionObj.clone)}},f.prototype.viewNavigation=function(e){var t,i=this.parent.element.querySelector("."+A);i&&(!this.scrollEdges.top&&!this.scrollEdges.bottom||B.closest(this.actionObj.clone,"."+rn))&&(0===i.scrollLeft&&Math.round(this.actionObj.X)<=Math.round(i.getBoundingClientRect().left+this.actionObj.cellWidth+window.pageXOffset)?t=this.parent.enableRtl?"Next":"Previous":Math.round(i.scrollLeft)+i.clientWidth===i.scrollWidth&&Math.round(this.actionObj.X)>=Math.round(i.getBoundingClientRect().right-this.actionObj.cellWidth+window.pageXOffset)&&(t=this.parent.enableRtl?"Previous":"Next"),t)&&this.parent.changeDate(this.parent.activeView.getNextPreviousDate(t))},f.prototype.morePopupEventDragging=function(e){var t,i,n;B.isNullOrUndefined(e.target)||e.target&&B.isNullOrUndefined(B.closest(e.target,"td"))||(n=(n=B.extend({},this.actionObj.event,null,!0))[this.parent.eventFields.endTime].getTime()-n[this.parent.eventFields.startTime].getTime(),t=B.closest(e.target,"td"),("TimelineYear"!==this.parent.currentView||t.classList.contains(O)&&!t.classList.contains(E))&&(e=this.parent.getDateFromElement(t),(i=new Date(e.getTime())).setMilliseconds(n),0<this.parent.activeViewOptions.group.resources.length&&(this.actionObj.groupIndex=parseInt(t.getAttribute("data-group-index"),10)),this.actionObj.start=new Date(e.getTime()),this.actionObj.end=new Date(i.getTime()),this.actionObj.clone.style.top=B.formatUnit(t.offsetParent.offsetTop),this.actionObj.clone.style.left=B.formatUnit(t.offsetLeft),this.actionObj.clone.style.width=B.formatUnit(t.offsetWidth),1<this.actionObj.cloneElement.length&&this.actionObj.cloneElement.forEach(function(e){e.style.width=B.formatUnit(t.offsetWidth)}),n=t,this.parent.activeView.isTimelineView()&&(e=B.closest(t,"tr").rowIndex,n=this.parent.element.querySelectorAll(".e-appointment-container").item(e)),(i=n.querySelector("."+x))||(i=B.createElement("div",{className:x}),n.appendChild(i)),this.appendCloneElement(i)))},f.prototype.calculateVerticalTime=function(e){var i=this;if(!(B.isNullOrUndefined(this.actionObj.target)||this.actionObj.target&&B.isNullOrUndefined(B.closest(this.actionObj.target,"tr")))&&(B.isNullOrUndefined(B.closest(this.actionObj.target,"td"))||B.closest(this.actionObj.target,"td").classList.contains(O)||B.closest(this.actionObj.target,"td").classList.contains(w))){this.parent.activeViewOptions.timeScale.enable&&this.swapDragging(e);var e=this.parent.element.querySelector("."+A),t=B.extend({},this.actionObj.event,null,!0),n=t[this.parent.eventFields.startTime],t=ct(t[this.parent.eventFields.endTime])-ct(n),r=(r=Math.floor(parseInt(this.actionObj.clone.style.top,10)/this.actionObj.cellHeight)*this.actionObj.cellHeight)<0?0:r,e=((this.scrollEdges.top||this.scrollEdges.bottom)&&(r=this.scrollEdges.top?e.scrollTop-this.heightUptoCursorPoint+this.actionObj.cellHeight+window.pageYOffset:e.scrollTop+e.offsetHeight-this.actionObj.clone.offsetHeight+window.pageYOffset+(this.actionObj.clone.offsetHeight-this.heightUptoCursorPoint),r=Math.round(r/this.actionObj.cellHeight)*this.actionObj.cellHeight,0<e.scrollTop)&&r<e.scrollHeight&&(this.actionObj.clone.style.top=B.formatUnit(r)),this.parent.activeViewOptions.timeScale.enable?r/this.actionObj.cellHeight:0),a=this.actionObj.cellHeight/this.actionObj.slotInterval,r=parseInt(this.actionObj.clone.style.top,10)-r,s=(e=this.isAllDayDrag?this.parent.element.querySelector("."+Ot):[].slice.call(this.parent.getContentTable().querySelectorAll("tr"))[parseInt(e.toString(),10)],B.isNullOrUndefined(B.closest(this.actionObj.target,"td"))||!B.closest(this.actionObj.target,"td").classList.contains(O)&&!B.closest(this.actionObj.target,"td").classList.contains(w)||(s=B.closest(this.actionObj.target,"td").cellIndex),B.isNullOrUndefined(s)?B.closest(this.actionObj.clone,"td").cellIndex:s);if(this.actionObj.index=s,!B.isNullOrUndefined(e)){for(var o,l,e=e.children[parseInt(s.toString(),10)],a=(0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive&&(this.actionObj.groupIndex=parseInt(e.getAttribute("data-group-index"),10)),this.parent.activeViewOptions.timeScale.enable&&!this.isAllDayDrag?(this.enableCurrentViewDrag&&0!==this.multiData.length||this.appendCloneElement(this.getEventWrapper(s)),(o=this.parent.getDateFromElement(e)).setMinutes(o.getMinutes()+r/a),l=new Date(o.getTime()),this.actionObj.element.classList.contains(an)?l.setMinutes(l.getMinutes()+this.actionObj.slotInterval):l.setMilliseconds(t)):((o=this.parent.getDateFromElement(e)).setDate(o.getDate()-this.daysVariation),o.setHours(n.getHours(),n.getMinutes(),n.getSeconds()),(l=new Date(o.getTime())).setMilliseconds(t),!this.actionObj.element.classList.contains(an)&&this.actionObj.clone.classList.contains(an)&&(l=Y(z(l),1)),r=this.parent.activeViewOptions.group.byDate||this.parent.virtualScrollModule&&!this.parent.activeViewOptions.timeScale.enable?s:void 0,this.updateAllDayEvents(o,l,r)),this.actionObj.start=new Date(+o),this.actionObj.end=new Date(+l),this.getUpdatedEvent(this.actionObj.start,this.actionObj.end,this.actionObj.event)),p=0,c=[].slice.call(this.parent.element.querySelectorAll(".e-dynamic-clone"));p<c.length;p++){var h=c[p];B.remove(h)}if(0<this.multiData.length){this.isAllDayTarget&&this.isAllDayDrag&&!B.isNullOrUndefined(this.actionObj.isAllDay)&&!this.actionObj.isAllDay&&(d=parseInt(B.closest(this.actionObj.target,"td").getAttribute("data-date"),10),this.multiData.forEach(function(e){var t;i.swagData.push(B.extend({},e,null,!0)),e[i.parent.eventFields.isAllDay]&&(e[i.parent.eventFields.startTime]=new Date(e[i.parent.eventFields.startTime].getTime()+(d-i.startTime)),t=new Date(e[i.parent.eventFields.startTime]),t=new Date(t.setMinutes(t.getMinutes()+i.actionObj.slotInterval)),e[i.parent.eventFields.endTime]=t,e[i.parent.eventFields.isAllDay]=!1)}),this.startTime=d),this.isAllDayTarget&&this.isAllDayDrag&&!B.isNullOrUndefined(this.actionObj.isAllDay)&&this.actionObj.isAllDay&&0<this.swagData.length&&(this.multiData=this.swagData,this.swagData=[],e=B.extend({},this.actionObj.event,null,!0),this.startTime=e[this.parent.eventFields.startTime].getTime());var d,u=a[this.parent.eventFields.startTime].getTime()-this.startTime;if(this.enableCurrentViewDrag)for(var g=this.getRenderedDates(),m=0;m<this.multiData.length;m++){var v=B.extend({},this.multiData[parseInt(m.toString(),10)],null,!0),v=new Date(v[this.parent.eventFields.startTime].getTime()+u);if((f=this.parent.getIndexOfDate(g,z(v)))<0){this.isPreventMultiDrag=!0;break}this.isPreventMultiDrag=!1}if(!this.isPreventMultiDrag)for(var f,y,T=0;T<this.multiData.length;T++)this.updatedData[parseInt(T.toString(),10)]=this.updateMultipleData(this.multiData[parseInt(T.toString(),10)],u),0<=(f=this.getDayIndex(this.updatedData[parseInt(T.toString(),10)]))?(y=this.updatedData[parseInt(T.toString(),10)][this.parent.eventFields.isAllDay],h=this.getEventWrapper(f,y),this.appendCloneElement(h,this.actionObj.cloneElement[parseInt(T.toString(),10)]),this.updateEventHeight(this.updatedData[parseInt(T.toString(),10)],T,f)):B.isNullOrUndefined(this.actionObj.cloneElement[parseInt(T.toString(),10)].parentNode)||B.remove(this.actionObj.cloneElement[parseInt(T.toString(),10)])}else this.updateEventHeight(a);this.updateTimePosition(this.actionObj.start,this.updatedData)}}},f.prototype.splitEvent=function(e){var t=this.parent.eventFields,i=[],n=e[t.startTime],r=e[t.endTime];if(z(new Date(n.getTime()))<z(new Date(r.getTime()))){for(var a=z(new Date(n.getTime())),s=new Date(a.getTime());a<new Date(r.getTime());0){var s=new Date(s.setDate(a.getDate()+1)),o=B.extend({},e,null,!0);o[t.startTime]=new Date(a),o[t.endTime]=new Date(s),a=new Date(a.setDate(a.getDate()+1)),i.push(o)}var l=i.length-1;i[0][t.startTime]=n,i[parseInt(l.toString(),10)][t.endTime]=r}else i.push(e);return i},f.prototype.updateMultipleData=function(e,t){var i,n,r,e=B.extend({},e,null,!0),a=(!B.isNullOrUndefined(this.actionObj.isAllDay)&&this.parent.activeViewOptions.timeScale.enable&&(this.isAllDayTarget&&e[this.parent.eventFields.isAllDay]||!this.isAllDayTarget&&!e[this.parent.eventFields.isAllDay])&&(e[this.parent.eventFields.isAllDay]=this.actionObj.isAllDay),e[this.parent.eventFields.endTime].getTime()-e[this.parent.eventFields.startTime].getTime());return e[this.parent.eventFields.isAllDay]?(i=Math.ceil(t/864e5),n=Math.ceil(a/864e5),r=new Date(e[this.parent.eventFields.startTime]),e[this.parent.eventFields.startTime]=z(new Date(r.setDate(r.getDate()+i))),e[this.parent.eventFields.endTime]=Y(e[this.parent.eventFields.startTime],n)):(e[this.parent.eventFields.startTime]=new Date(e[this.parent.eventFields.startTime].getTime()+t),e[this.parent.eventFields.endTime]=new Date(e[this.parent.eventFields.startTime].getTime()+a)),e},f.prototype.getDayIndex=function(e){var e=B.extend({},e,null,!0),t=z(e[this.parent.eventFields.startTime]),i=(this.parent.activeViewOptions.timeScale.enable&&!e[this.parent.eventFields.isAllDay]&&(i=this.parent.activeView.getStartHour(),t.setMilliseconds(i.getTime()-z(i).getTime())),t.getTime()),t="",t="."+(this.parent.activeViewOptions.timeScale.enable&&e[this.parent.eventFields.isAllDay]?rn:O)+'[data-date="'+i+'"]';return 0<this.parent.activeViewOptions.group.resources.length&&(t=t+'[data-group-index="'+this.actionObj.groupIndex+'"]'),this.targetTd=this.parent.element.querySelector(t),B.isNullOrUndefined(this.targetTd)?-1:this.targetTd.cellIndex},f.prototype.updateEventHeight=function(e,t,i){this.verticalEvent.initializeValues();var n=this.verticalEvent.getStartCount();if(!this.parent.uiStateValues.isGroupAdaptive)for(var r=0;r<this.actionObj.groupIndex;r++)this.verticalEvent.dateRender[parseInt(r.toString(),10)]&&(n+=this.verticalEvent.dateRender[parseInt(r.toString(),10)].length);var a=this.parent.uiStateValues.isGroupAdaptive?n:this.actionObj.groupIndex;if(!(!this.parent.activeViewOptions.group.byDate||B.isNullOrUndefined(this.parent.getDateFromElement(this.actionObj.target)))||!this.parent.activeViewOptions.group.byDate)for(var s,o,l,p,c,h=-1,d=this.parent.activeViewOptions.group.byDate?this.parent.getIndexOfDate(this.verticalEvent.dateRender[parseInt(a.toString(),10)],z(this.parent.getDateFromElement(B.isNullOrUndefined(t)?this.actionObj.target:this.targetTd))):B.isNullOrUndefined(t)?this.actionObj.index-n:i-n,i=this.splitEvent(e),u=this.parent.eventBase.isAllDayAppointment(e)||2<i.length||"TimeSlot"!==this.parent.eventSettings.spannedEventPlacement?[e]:i,r=0;r<u.length;r++)0<r&&(s='.e-day-wrapper[data-date="'+z(u[parseInt(r.toString(),10)][this.parent.eventFields.startTime]).getTime()+'"]',0<this.parent.activeViewOptions.group.resources.length&&(s=s.concat('[data-group-index = "'+this.actionObj.groupIndex+'"]')),(s=this.parent.element.querySelector(s))?(d+=1,h=s.cellIndex):d=-1),0<=d&&(l=(s=this.verticalEvent.isSpannedEvent(u[parseInt(r.toString(),10)],d,a))[this.verticalEvent.fields.startTime],o=s[this.verticalEvent.fields.endTime],o=this.parent.activeViewOptions.timeScale.enable?this.verticalEvent.getHeight(l,o):this.actionObj.element.offsetHeight,l=this.parent.activeViewOptions.timeScale.enable?this.verticalEvent.getTopValue(l):this.actionObj.element.offsetTop,B.isNullOrUndefined(t)?0===r?(this.actionObj.clone.classList.contains(an)&&(l=this.parent.element.querySelector("."+Ot).offsetTop,o=this.getAllDayEventHeight()),this.actionObj.clone.style.top=B.formatUnit(l),this.actionObj.clone.style.height=B.formatUnit(o)):this.renderSpannedEvents(s,h,l,o):(p=this.actionObj.cellWidth,e[this.parent.eventFields.isAllDay]&&this.parent.activeViewOptions.timeScale.enable&&(c=e[this.parent.eventFields.endTime].getTime()-e[this.parent.eventFields.startTime].getTime(),0<=(c=Math.ceil(c/864e5)))&&(p=c*this.actionObj.cellWidth),this.actionObj.cloneElement[parseInt(t.toString(),10)]&&(0===r?(this.actionObj.cloneElement[parseInt(t.toString(),10)].style.top=B.formatUnit(l),this.actionObj.cloneElement[parseInt(t.toString(),10)].style.height=B.formatUnit(o),this.actionObj.cloneElement[parseInt(t.toString(),10)].style.width=B.formatUnit(p),this.actionObj.cloneElement[parseInt(t.toString(),10)].style.left=B.formatUnit(0)):this.renderSpannedEvents(s,h,l,o))))},f.prototype.renderSpannedEvents=function(e,t,i,n){e[this.parent.eventFields.startTime].getTime()!==e[this.parent.eventFields.endTime].getTime()&&(e=this.verticalEvent.createAppointmentElement(e,!1,e.isSpanned,this.actionObj.groupIndex),B.addClass([e],[Yi,"e-dynamic-clone"]),B.setStyleAttribute(e,{width:"100%",height:n+"px",top:i+"px",border:"0px"}),[].slice.call(this.parent.element.querySelectorAll("."+x))[parseInt(t.toString(),10)].appendChild(e))},f.prototype.getRenderedDates=function(){var e,t=this,i=this.parent.activeView.renderDates;return(e=this.parent.eventBase.slots).push.apply(e,this.parent.activeView.renderDates.map(function(e){return+e})),0<this.parent.activeViewOptions.group.resources.length&&(this.parent.eventBase.slots=[],i=this.parent.resourceBase.lastResourceLevel.filter(function(e){return e.groupIndex===t.actionObj.groupIndex})[0].renderDates,(e=this.parent.eventBase.slots).push.apply(e,i.map(function(e){return+e}))),i},f.prototype.updateAllDayEvents=function(e,t,i){this.parent.eventBase.slots=[];var e=this.getUpdatedEvent(e,t,this.actionObj.event),t=this.getRenderedDates(),e=this.parent.eventBase.splitEvent(e,t),t='.e-all-day-cells[data-date="'+e[0][this.parent.eventFields.startTime].getTime()+'"]',t=(0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive&&(t=t.concat('[data-group-index = "'+this.actionObj.groupIndex+'"]')),[].slice.call(this.parent.element.querySelectorAll(t)));(0<t.length||!B.isNullOrUndefined(i))&&(t=B.isNullOrUndefined(i)?t[0].cellIndex:i,this.appendCloneElement(this.getEventWrapper(t)),this.actionObj.clone.style.width=B.formatUnit(e[0].data.count*this.actionObj.cellWidth))},f.prototype.swapDragging=function(e){if(!this.isPreventMultiDrag){var t=!B.isNullOrUndefined(B.closest(this.actionObj.target,"td"))&&B.closest(this.actionObj.target,"td").cellIndex;if(B.closest(this.actionObj.target,"."+Vt)&&!B.closest(this.actionObj.clone,"."+rn)){B.addClass([this.actionObj.clone],an),this.appendCloneElement(this.getEventWrapper(t)),this.actionObj.isAllDay=!0;var i=this.getAllDayEventHeight(),n=[].slice.call(this.parent.element.querySelectorAll("."+w+":first-child"));if(n[0].offsetHeight<i)for(var r=0,a=n;r<a.length;r++)a[r].style.height=(i+2)/12+"em";B.setStyleAttribute(this.actionObj.clone,{width:B.formatUnit(this.actionObj.cellWidth),height:B.formatUnit(i),top:B.formatUnit(this.parent.element.querySelector("."+Ot).offsetTop)})}B.closest(this.actionObj.target,"."+O)&&!B.closest(this.actionObj.clone,"."+li)&&(B.removeClass([this.actionObj.clone],an),this.appendCloneElement(this.getEventWrapper(t)),this.actionObj.isAllDay=!1,n=0===this.actionObj.element.offsetHeight?this.actionObj.height:this.actionObj.element.offsetHeight,B.setStyleAttribute(this.actionObj.clone,{left:B.formatUnit(0),height:B.formatUnit(n),width:B.formatUnit(this.actionObj.cellWidth)}))}},f.prototype.calculateVerticalDate=function(e){if(!(B.isNullOrUndefined(e.target)||e.target&&B.isNullOrUndefined(B.closest(e.target,"tr"))||e.target&&"DIV"===e.target.tagName)){var t,e=B.extend({},this.actionObj.event,null,!0),i=(B.isNullOrUndefined(this.parent.eventDragArea)&&this.removeCloneElement(),ct(e[this.parent.eventFields.endTime])-ct(e[this.parent.eventFields.startTime])),n=B.closest(this.actionObj.target,"td"),e=(B.isNullOrUndefined(n)||(t=n.parentElement,this.actionObj.index=t.rowIndex*t.children.length+n.cellIndex,n=[].slice.call(this.parent.element.querySelectorAll("."+O))[this.actionObj.index],t=this.parent.getDateFromElement(n),B.isNullOrUndefined(t))||(0<this.parent.activeViewOptions.group.resources.length&&(this.actionObj.groupIndex=parseInt(n.getAttribute("data-group-index"),10)),n=new Date(t.setDate(t.getDate()-this.daysVariation)),t=new Date(n.getTime()),o=ct(e[this.parent.eventFields.startTime])-ct(z(new Date(+e[this.parent.eventFields.startTime]))),t.setMilliseconds(o),(n=new Date(t.getTime())).setMilliseconds(i),this.actionObj.start=new Date(t.getTime()),this.actionObj.end=new Date(n.getTime())),this.getUpdatedEvent(this.actionObj.start,this.actionObj.end,this.actionObj.event));if(B.isNullOrUndefined(this.parent.eventDragArea))for(var r=0,a=[].slice.call(this.parent.element.querySelectorAll("."+Yi));r<a.length;r++){var s=a[r];B.remove(s)}if(this.multiData&&0<this.multiData.length){var i=z(new Date(e[this.parent.eventFields.startTime])),o=i.getTime()-this.startTime;"TimelineYear"===this.parent.currentView&&0<this.parent.group.resources.length&&(o=12*(i.getFullYear()-new Date(this.startTime).getFullYear()),o=(o-=new Date(this.startTime).getMonth())+i.getMonth());for(var l=0;l<this.multiData.length;l++)this.updatedData[parseInt(l.toString(),10)]=this.updateMultipleVerticalDate(this.multiData[parseInt(l.toString(),10)],o),"TimelineYear"===this.parent.currentView?this.dynamicYearlyEventsRendering(this.updatedData[parseInt(l.toString(),10)]):this.dynamicEventsRendering(this.updatedData[parseInt(l.toString(),10)])}else"TimelineYear"===this.parent.currentView?this.dynamicYearlyEventsRendering(e):this.dynamicEventsRendering(e)}},f.prototype.updateMultipleVerticalDate=function(e,t){var e=B.extend({},e,null,!0),i=e[this.parent.eventFields.endTime].getTime()-e[this.parent.eventFields.startTime].getTime(),n=new Date(e[this.parent.eventFields.startTime]);return"TimelineYear"===this.parent.currentView&&0<this.parent.group.resources.length?e[this.parent.eventFields.startTime]=new Date(n.setMonth(n.getMonth()+t)):(t=Math.ceil(t/W),e[this.parent.eventFields.startTime]=new Date(n.setDate(n.getDate()+t))),e[this.parent.eventFields.endTime]=new Date(e[this.parent.eventFields.startTime].getTime()+i),e},f.prototype.calculateTimelineTime=function(e){var t,i=B.extend({},this.actionObj.event,null,!0),n=ct(i[this.parent.eventFields.endTime])-ct(i[this.parent.eventFields.startTime]),r=this.parent.enableRtl?Math.abs(this.actionObj.clone.offsetLeft)-this.actionObj.clone.offsetWidth:parseInt(this.actionObj.clone.style.left,10),r=Math.round(r/this.actionObj.cellWidth)*this.actionObj.cellWidth,a=(this.parent.enableRtl&&(a=Math.abs(parseInt(this.actionObj.clone.style.right,10)),this.actionObj.clone.style.right=B.formatUnit(a)),r=this.getOffsetValue(r,a),this.getColumnIndex(r)),s=this.parent.element.querySelector("."+A),o=s.getBoundingClientRect().right,o=this.parent.activeView.isTimelineView()&&!this.parent.enableRtl&&this.actionObj.pageX>this.actionObj.clone.getBoundingClientRect().right&&!this.isMorePopupOpened&&!(this.actionObj.pageX>o),s=this.parent.eventDragArea?s.scrollLeft-s.offsetLeft:0,s=(!this.isCursorAhead&&!o||this.isStepDragging||(this.isCursorAhead=!0),Math.floor((this.actionObj.pageX-this.actionObj.clone.getBoundingClientRect().left+s)/this.actionObj.cellWidth)),r=(this.parent.enableRtl&&(s=Math.abs(Math.floor((this.actionObj.pageX-this.actionObj.clone.getBoundingClientRect().right)/this.actionObj.cellWidth))-1),this.cursorPointIndex<0&&this.cursorIndex(e,i,r,s),this.parent.getContentTable().querySelector("tr")),a=(a=this.getCursorCurrentIndex(a,s,r))<0?0:a,l=this.isHeaderRows?new Date(this.timelineEventModule.dateRender[parseInt(a.toString(),10)].getTime()):this.parent.getDateFromElement(r.children[parseInt(a.toString(),10)]),p=(l=this.isAllDayDrag?z(l):l,this.isStepDragging?0!==(s=this.getWidthDiff(r,a))?(r=Math.ceil(s/this.widthPerMinute),l.setMinutes(l.getMinutes()+r*this.actionObj.interval),this.isCursorAhead||o?l.setMilliseconds(-n):(l.setMinutes(l.getMinutes()-this.minDiff),a=this.actionObj.interval*je,r=Math.abs(l.getTime()-this.actionObj.start.getTime())/a,(s=Math.trunc(r))!==r&&(r=s*a*(l>this.actionObj.start?1:-1),l=new Date(this.actionObj.start.getTime()+r)))):l=this.actionObj.start:!this.isCursorAhead&&!o||this.isAllDayDrag?l.setMinutes(l.getMinutes()-this.cursorPointIndex*(this.isTimelineDayProcess||this.isAllDayDrag?1440:this.actionObj.slotInterval)):(s=this.isTimelineDayProcess||this.isAllDayDrag?1440:this.actionObj.slotInterval,l.setMinutes(l.getMinutes()+s),l.setMilliseconds(-n),l.getTime()===z(l).getTime()&&0===l.getMinutes()&&0==n&&l.setMinutes(-s)),this.isStepDragging||(l=this.calculateIntervalTime(l)),(this.isTimelineDayProcess||this.isAllDayDrag)&&(t=i[this.parent.eventFields.startTime],l.setHours(t.getHours(),t.getMinutes(),t.getSeconds())),this.parent.eventDragArea&&(a=this.parent.getDateFromElement(e.target),B.isNullOrUndefined(a)||(l=this.parent.activeViewOptions.timeScale.enable&&"TimelineMonth"!==this.parent.currentView?a:(t=i[this.parent.eventFields.startTime],new Date(a.setHours(t.getHours(),t.getMinutes(),t.getSeconds()))))),new Date(l.getTime())),c=(p.setMilliseconds(n),[this.getUpdatedEvent(l,p,this.actionObj.event)]);if(0<this.multiData.length){for(var h=c[0][this.parent.eventFields.startTime].getTime()-this.startTime,d=0;d<this.multiData.length;d++)this.updatedData[parseInt(d.toString(),10)]=this.updateMultipleData(this.multiData[parseInt(d.toString(),10)],h);c=this.updatedData}for(var u=0;u<c.length;u++){var g,m,v,f,y=0<this.multiData.length?this.actionObj.cloneElement[parseInt(u.toString(),10)]:this.actionObj.clone;B.isNullOrUndefined(this.parent.eventDragArea)&&(m=(g=this.timelineEventModule.splitEvent(c[parseInt(u.toString(),10)],this.timelineEventModule.dateRender))[0].data,f=this.timelineEventModule.getStartTime(g[0],m),g=this.timelineEventModule.getEndTime(g[0],m),m=this.timelineEventModule.getEventWidth(f,g,i[this.parent.eventFields.isAllDay],m.count),v=this.parent.getIndexOfDate(this.timelineEventModule.dateRender,z(new Date(f.getTime()))),f=this.timelineEventModule.getPosition(f,g,i[this.parent.eventFields.isAllDay],v=v<0?0:v),this.parent.enableRtl?y.style.right=B.formatUnit(f):y.style.left=B.formatUnit(f),this.isMorePopupOpened||(y.style.width=B.formatUnit(m))),0<this.parent.activeViewOptions.group.resources.length&&this.calculateResourceGroupingPosition(e,y),this.actionObj.start=new Date(l.getTime()),this.actionObj.end=new Date(p.getTime()),this.updateTimePosition(this.actionObj.start,this.updatedData)}},f.prototype.getOffsetValue=function(e,t){var i;return(this.scrollEdges.left||this.scrollEdges.right)&&(i=this.parent.element.querySelector("."+A),this.parent.enableRtl?(t=i.offsetWidth-i.scrollLeft,this.scrollEdges.right?t=t-i.offsetWidth+this.actionObj.clone.offsetWidth-(this.actionObj.clone.offsetWidth-this.widthUptoCursorPoint):(t+=this.widthUptoCursorPoint)-this.widthUptoCursorPoint>=i.scrollWidth&&(this.actionObj.clone.style.width=B.formatUnit(this.actionObj.clone.offsetWidth-this.widthUptoCursorPoint+this.actionObj.cellWidth),t=i.scrollLeft-i.scrollWidth),B.isNullOrUndefined(this.parent.eventDragArea)&&(this.actionObj.clone.style.left=B.formatUnit(t))):(this.scrollEdges.left?(e=i.scrollLeft-this.widthUptoCursorPoint+this.actionObj.cellWidth,i.scrollLeft+i.offsetWidth>=i.offsetWidth?i.scrollLeft=i.scrollLeft-1:0===this.actionObj.clone.offsetLeft&&(e=i.scrollLeft)):e=i.scrollLeft+i.offsetWidth-this.actionObj.clone.offsetWidth+(this.actionObj.clone.offsetWidth-this.widthUptoCursorPoint),e=e<0?0:e,B.isNullOrUndefined(this.parent.eventDragArea)&&(this.actionObj.clone.style.left=B.formatUnit(e)))),e},f.prototype.getWidthDiff=function(e,t){var i=this.scrollArgs.element.getBoundingClientRect();return i.left<=this.actionObj.pageX&&i.right>=this.actionObj.pageX?(e=e.children[parseInt(t.toString(),10)].offsetLeft,t=this.actionObj.pageX-i.left,this.parent.enableRtl?e+this.actionObj.cellWidth-(this.scrollArgs.element.scrollLeft+t):this.scrollArgs.element.scrollLeft+t-e):0},f.prototype.getColumnIndex=function(e){e=Math.round(e/this.actionObj.cellWidth);return this.isHeaderRows?e:this.getIndex(e)},f.prototype.getCursorCurrentIndex=function(e,t,i){e+=t;return this.isHeaderRows?(t=Math.floor(i.offsetWidth/this.actionObj.cellWidth))-1<e?t-1:e:e>i.children.length-1?i.children.length-1:e},f.prototype.cursorIndex=function(e,t,i,n){var e=B.closest(e.target,".e-work-cells");B.isNullOrUndefined(e)||this.isMorePopupOpened?this.cursorPointIndex=0:(e=this.parent.getDateFromElement(e),e=this.isAllDayDrag?z(e):e,this.isHeaderRows&&(i=Math.floor(i/this.actionObj.cellWidth),e=new Date(this.timelineEventModule.dateRender[i+n].getTime())),i=e.getTime()-t[this.parent.eventFields.startTime].getTime(),this.isTimelineDayProcess||this.isAllDayDrag?this.cursorPointIndex=Math.abs(Math.ceil(i/W)):(n=Math.floor(i/je/(this.actionObj.slotInterval/this.actionObj.cellWidth)),this.cursorPointIndex=Math.floor(n/this.actionObj.cellWidth),this.cursorPointIndex=this.cursorPointIndex<0?0:this.cursorPointIndex))},f.prototype.calculateResourceGroupingPosition=function(e,t){var i=this.parent.element.querySelector("."+A),n=[].slice.call(this.parent.element.querySelectorAll(".e-content-wrap .e-content-table tr:not(.e-hidden)")),r=qe(i.querySelector("table")),r=B.isNullOrUndefined(r)?0:r,a=this.parent.rowAutoHeight?~~(i.querySelector("table").offsetHeight/n.length):this.actionObj.cellHeight,r=(r=Math.floor(Math.floor(this.actionObj.Y+(i.scrollTop-r-(window.scrollY||window.pageYOffset))-mt(i,this.parent.uiStateValues.isTransformed))/a))<0?0:r>n.length-1?n.length-1:r,i=(this.actionObj.index=r,this.parent.element.querySelectorAll(".e-appointment-container:not(.e-hidden)").item(r)),a=i.querySelector("."+x),i=(a||(a=B.createElement("div",{className:x}),i.appendChild(a)),this.appendCloneElement(a,t),B.closest(this.actionObj.target,"td"));this.actionObj.groupIndex=i&&!isNaN(parseInt(i.getAttribute("data-group-index"),10))?parseInt(i.getAttribute("data-group-index"),10):this.actionObj.groupIndex,B.isNullOrUndefined(this.parent.eventDragArea)&&(a=this.parent.getElementHeight(n[parseInt(r.toString(),10)])*r,this.parent.rowAutoHeight&&(i=this.getCursorElement(e))&&(a=i.classList.contains(O)?i.offsetTop:i.offsetParent&&i.offsetParent.classList.contains(V)?i.offsetParent.offsetTop:a),t.style.top=B.formatUnit(a))},f.prototype.appendCloneElement=function(e,t){t=B.isNullOrUndefined(t=void 0===t?null:t)?this.actionObj.clone:t;var i=document.querySelector(this.parent.eventDragArea);(this.parent.eventDragArea&&i?i:e).appendChild(t)},f.prototype.getEventWrapper=function(e,t){var i;return B.isNullOrUndefined(t)&&(t=this.actionObj.clone.classList.contains(an)),this.parent.activeViewOptions.timeScale.enable?i=this.parent.element.querySelectorAll(t?"."+rn:"."+x).item(e):(i=(t=this.parent.element.querySelectorAll("."+O).item(e)).querySelector("."+x))||(i=B.createElement("div",{className:x}),t.appendChild(i)),i},f.prototype.getAllDayEventHeight=function(){var e=B.createElement("div",{className:V}),t=(this.parent.element.querySelector("."+rn).appendChild(e),e.offsetHeight);return B.remove(e),t},f.prototype.isAllowDrop=function(e){if(!this.actionObj.excludeSelectors)return!1;for(var t=!1,i=0,n=this.actionObj.excludeSelectors.split(",");i<n.length;i++){var r=n[i];if(e.target.classList.contains(r)){t=!0;break}}return t},f.prototype.getModuleName=function(){return"dragAndDrop"};var fl,yl,cs=f;function f(){var e=null!==yl&&yl.apply(this,arguments)||this;return e.widthUptoCursorPoint=0,e.heightUptoCursorPoint=0,e.cursorPointIndex=0,e.isHeaderRows=!1,e.isTimelineDayProcess=!1,e.widthPerMinute=0,e.heightPerMinute=0,e.minDiff=0,e.isStepDragging=!1,e.isMorePopupOpened=!1,e.isAllDayDrag=!1,e.isMultiSelect=!1,e.multiData=[],e.updatedData=[],e.swagData=[],e.startTime=0,e.isAllDayTarget=!1,e.targetTd=null,e.isCursorAhead=!1,e.enableCurrentViewDrag=!1,e.isPreventMultiDrag=!1,e.slotsUptoCursor=-1,e.eleTop=0,e.distanceUptoCursor=0,e}T.prototype.isTimelineView=function(){return-1!==this.parent.currentView.indexOf("Timeline")},T.prototype.getContentRows=function(){return[]},T.prototype.refreshHeader=function(){},T.prototype.refreshResourceHeader=function(){var e=this.element.querySelector("."+zt),t=Array.from(e.querySelectorAll("."+Kt)),i=(t.forEach(function(e){Array.from(e.children).forEach(function(e){e.classList.contains(Gt)||e.classList.contains(Xt)||B.remove(e)})}),this.parent.resourceBase.renderedResources);if(!B.isNullOrUndefined(i)&&0<i.length)for(var n=0;n<t.length;n++){var r=t[parseInt(n.toString(),10)],a=i[parseInt(n.toString(),10)];!this.parent.activeView||B.isNullOrUndefined(r)||B.isNullOrUndefined(a)||parseInt(r.getAttribute("data-group-index"),10)!==a.groupIndex||(this.parent.activeView.setResourceHeaderContent(r,a,Bt),r={element:r,elementType:"resourceHeader",groupIndex:a.groupIndex},this.parent.trigger($,r))}this.parent.renderTemplates(),this.parent.notify(Ve,{})},T.prototype.getDayName=function(e){return this.parent.getDayNames("abbreviated")[e.getDay()]},T.prototype.getDate=function(e){return this.parent.globalize.formatDate(e,{format:"d",calendar:this.parent.getCalendarMode()})},T.prototype.getTime=function(e){return this.parent.isAdaptive?"HH:mm"===this.parent.activeViewOptions.timeFormat||"HH.mm"===this.parent.activeViewOptions.timeFormat?this.parent.globalize.formatDate(e,{format:"H",calendar:this.parent.getCalendarMode()}):this.parent.globalize.formatDate(e,{skeleton:"h",calendar:this.parent.getCalendarMode()}):this.parent.getTimeString(e)},T.prototype.getTimelineDate=function(e){return y(this.parent.globalize.formatDate(e,{skeleton:"MMMd",calendar:this.parent.getCalendarMode()})+", "+this.parent.getDayNames("wide")[e.getDay()],"multiple")},T.prototype.createEventTable=function(e){var t=B.createElement("div",{className:Ft});return B.append(this.getEventRows(e),t),t},T.prototype.getEventRows=function(e){for(var t,i=[],n=0;n<e;n++)t=B.createElement("div",{className:fi}),this.parent.resourceBase&&!this.parent.uiStateValues.isGroupAdaptive&&this.parent.resourceBase.renderedResources&&t.setAttribute("data-group-index",this.parent.resourceBase.renderedResources[parseInt(n.toString(),10)].groupIndex.toString()),i.push(t);return i},T.prototype.collapseRows=function(e){0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive&&(this.parent.resourceBase.hideResourceRows(e.querySelector("tbody")),this.parent.resourceBase.hideResourceRows(e.querySelector("."+Ft)))},T.prototype.createTableLayout=function(e){var e=B.createElement("table",{className:Ct+" "+(e||"")}),t=B.createElement("tbody");return e.appendChild(t),e},T.prototype.setAriaAttributes=function(e){e.setAttribute("role","grid"),"Year"!==this.parent.currentView&&e.setAttribute("id",this.parent.element.id+"_table"),e.setAttribute("aria-label",this.getLabelText(this.parent.currentView))},T.prototype.createColGroup=function(e,t){if(!B.isNullOrUndefined(t)){for(var i=t.length,n=(t[0]&&t[0].colSpan&&(i=t.map(function(e){return e.colSpan}).reduce(function(e,t){return e+t})),B.createElement("colgroup")),r=0;r<i;r++)n.appendChild(B.createElement("col"));B.prepend([n],e)}},T.prototype.getScrollXIndent=function(e){return 0<e.offsetHeight-e.clientHeight?rt():0},T.prototype.scrollTopPanel=function(e){this.getDatesHeaderElement().firstElementChild.scrollLeft=e.scrollLeft},T.prototype.scrollHeaderLabels=function(e){for(var t=this.element.querySelector(".e-date-header-wrap table"),i=t.offsetWidth/t.querySelectorAll("colgroup col").length,n=0,r=[".e-header-year-cell",".e-header-month-cell",".e-header-week-cell",".e-header-cells"];n<r.length;n++){var a=[].slice.call(this.element.querySelectorAll(r[n]));if(0<a.length){for(var s=0,o=a;s<o.length;s++)o[s].children[0].style[this.parent.enableRtl?"right":"left"]="";m=g=u=d=h=c=l=void 0;for(var l,p=this.parent.enableRtl,c=0,h=0,d=p?-e.scrollLeft:e.scrollLeft,u=0,g=a;u<g.length;u++){var m=g[u];if((h+=parseInt(m.getAttribute("colSpan"),10))>Math.floor(d/i)){l=m;break}c+=m.offsetWidth}B.isNullOrUndefined(l)||(l.children[0].style[p?"right":"left"]=d-c+"px")}}},T.prototype.addAttributes=function(e,t){e.template&&B.append(e.template,t),e.colSpan&&t.setAttribute("colspan",e.colSpan.toString()),e.className&&B.addClass([t],e.className)},T.prototype.getHeaderBarHeight=function(){var e,t=2;return this.parent.headerModule&&(t+=ot(this.parent.headerModule.getHeaderElement())),this.parent.uiStateValues.isGroupAdaptive&&(e=this.parent.element.querySelector("."+hi))&&(t+=e.offsetHeight),t},T.prototype.renderPanel=function(e){e===Pt?B.prepend([this.element],this.parent.element.querySelector("."+St)):this.parent.element.querySelector("."+St).appendChild(this.element)},T.prototype.setPanel=function(e){this.element=e},T.prototype.getPanel=function(){return this.element},T.prototype.getDatesHeaderElement=function(){return this.element.querySelector("."+At)},T.prototype.getDateSlots=function(e,t){return[]},T.prototype.generateColumnLevels=function(){return[]},T.prototype.getColumnLevels=function(){return this.colLevels},T.prototype.highlightCurrentTime=function(){},T.prototype.getStartDate=function(){return this.renderDates[0]},T.prototype.getEndDate=function(){return this.renderDates[this.renderDates.length-1]},T.prototype.startDate=function(){return this.renderDates[0]},T.prototype.endDate=function(){return Y(this.renderDates[this.renderDates.length-1],1)},T.prototype.getStartHour=function(){var e=this.parent.getStartEndTime(this.parent.activeViewOptions.startHour);return e=B.isNullOrUndefined(e)?new Date(2e3,0,0,0):e},T.prototype.getEndHour=function(){var e=this.parent.getStartEndTime(this.parent.activeViewOptions.endHour);return e=B.isNullOrUndefined(e)?new Date(2e3,0,0,0):e},T.prototype.isCurrentDate=function(e){return e.setHours(0,0,0,0)===new Date(this.parent.currentTimezoneDate).setHours(0,0,0,0)},T.prototype.isCurrentMonth=function(e){return this.parent.activeViewOptions.displayDate||0<this.parent.activeViewOptions.numberOfWeeks?this.parent.activeView.getStartDate().getTime()<=this.parent.getCurrentTime().getTime()&&this.parent.activeView.getEndDate().getTime()>=this.parent.getCurrentTime().getTime():e.getFullYear()===this.parent.getCurrentTime().getFullYear()&&e.getMonth()===this.parent.getCurrentTime().getMonth()},T.prototype.isWorkDay=function(e,t){return void 0===t&&(t=this.parent.activeViewOptions.workDays),!B.isNullOrUndefined(t)&&0<=t.indexOf(e.getDay())},T.prototype.isWorkHour=function(e,t,i,n){return!(B.isNullOrUndefined(t)||B.isNullOrUndefined(i)||(t.setMilliseconds(0),i.setMilliseconds(0),z(e).getTime()!==z(t).getTime()&&(t=new Date(2e3,0,0,t.getHours(),t.getMinutes(),t.getMilliseconds()),i=new Date(2e3,0,0,i.getHours(),i.getMinutes(),i.getMilliseconds())),Xe(e)<Xe(t))||Xe(e)>=Xe(i)||!this.isWorkDay(e,n))},T.prototype.getRenderDates=function(e,t){void 0===t&&(t=this.parent.selectedDate);var i=[];if("Week"===this.parent.currentView||"TimelineWeek"===this.parent.currentView)for(var n=Ue(z(t),this.parent.activeViewOptions.firstDayOfWeek),r=0,a=7*this.parent.activeViewOptions.interval;r<a;r++)(this.parent.activeViewOptions.showWeekend||this.isWorkDay(n,e))&&i.push(n),n=Y(n,1);else if("WorkWeek"===this.parent.currentView||"TimelineWorkWeek"===this.parent.currentView)for(var n=Ue(z(t),this.parent.activeViewOptions.firstDayOfWeek),r=0,s=7*this.parent.activeViewOptions.interval;r<s;r++)this.isWorkDay(n,e)&&i.push(n),n=Y(n,1);else for(var o="Agenda"===this.parent.currentView?this.parent.agendaDaysCount:this.parent.activeViewOptions.interval,n=z(t);(this.parent.activeViewOptions.showWeekend||this.isWorkDay(n,e))&&i.push(n),n=Y(n,1),o!==i.length;);return e||(this.renderDates=i),this.parent.headerModule&&this.parent.headerModule.previousNextIconHandler(),i},T.prototype.getNextPreviousDate=function(e){if(this.previousNextAction=e,"Day"===this.parent.currentView||"TimelineDay"===this.parent.currentView){var t;if(this.parent.activeViewOptions.showWeekend)return t=this.parent.activeViewOptions.interval,Y(this.parent.selectedDate,"Next"===e?t:-t);var i=void 0;if("Next"===e)for(i=Y(this.renderDates.slice(-1)[0],1);!this.isWorkDay(i);)i=Y(i,1);else for(var i=Y(this.renderDates[0],-1),n=0;this.isWorkDay(i)&&(n+=1),this.parent.activeViewOptions.interval!==n&&(i=Y(i,-1)),this.parent.activeViewOptions.interval!==n;);return i}return Y(this.parent.selectedDate,("Next"===e?7:-7)*this.parent.activeViewOptions.interval)},T.prototype.formatViewLabel=function(e,t,i){var n={type:"date",skeleton:"full",calendar:this.parent.getCalendarMode()};return this.parent.localeObj.getConstant(e)+" "+this.parent.localeObj.getConstant("start")+" "+this.parent.globalize.formatDate(t,n)+" "+this.parent.localeObj.getConstant("endAt")+" "+this.parent.globalize.formatDate(i,n)},T.prototype.getLabelText=function(e){var t=e.charAt(0).toLowerCase()+e.substring(1);return"Year"===e||"TimelineYear"===e?this.formatViewLabel(t,this.parent.activeView.getStartDate(),this.parent.activeView.getEndDate()):0<this.renderDates.length?"Day"===this.parent.currentView||"TimelineDay"===this.parent.currentView?this.parent.localeObj.getConstant(t)+" of "+y(this.parent.globalize.formatDate(this.parent.selectedDate,{type:"date",skeleton:"full",calendar:this.parent.getCalendarMode()}),"single"):this.formatViewLabel(t,this.renderDates[0],this.renderDates[this.renderDates.length-1]):""},T.prototype.getDateRangeText=function(e,t){var i;return void 0===e&&(e=this.renderDates[0]),void 0===t&&(t=this.renderDates),this.parent.isAdaptive?(i=this.parent.activeViewOptions.dateFormat||"MMMM y",y(this.parent.globalize.formatDate(this.parent.selectedDate,{format:i,calendar:this.parent.getCalendarMode()}),"single")):this.formatDateRange(e,t[t.length-1])},T.prototype.formatDateRange=function(e,t){var i,n,r=this.parent.globalize,a=this.parent.getCalendarMode();return e===t&&(t=null),B.isNullOrUndefined(this.parent.activeViewOptions.dateFormat)?(n=B.isNullOrUndefined(this.parent.locale)||"en"===this.parent.locale||"en-US"===this.parent.locale?B.getValue("dateFormats.long",B.getDefaultDateObject(a)):B.getValue("main."+this.parent.locale+".dates.calendars."+a+".dateFormats.long",B.cldrData),t?y("d"===(i=n.trim().toLocaleLowerCase()).substr(0,1)?e.getFullYear()===t.getFullYear()?e.getMonth()===t.getMonth()?r.formatDate(e,{format:"dd",calendar:a})+" - "+r.formatDate(t,{format:"dd MMMM yyyy",calendar:a}):r.formatDate(e,{format:"dd MMM",calendar:a})+" - "+r.formatDate(t,{format:"dd MMM yyyy",calendar:a}):r.formatDate(e,{format:"dd MMM yyyy",calendar:a})+" - "+r.formatDate(t,{format:"dd MMM yyyy",calendar:a}):"m"===i.substr(0,1)?e.getFullYear()===t.getFullYear()?e.getMonth()===t.getMonth()?r.formatDate(e,{format:"MMMM dd",calendar:a})+" - "+r.formatDate(t,{format:"dd, yyyy",calendar:a}):r.formatDate(e,{format:"MMM dd",calendar:a})+" - "+r.formatDate(t,{format:"MMM dd, yyyy",calendar:a}):r.formatDate(e,{format:"MMM dd, yyyy",calendar:a})+" - "+r.formatDate(t,{format:"MMM dd, yyyy",calendar:a}):r.formatDate(e,{format:n,calendar:a})+" - "+r.formatDate(t,{format:n,calendar:a}),"multiple"):y(r.formatDate(e,{format:n,calendar:a}),"single")):y(t?r.formatDate(e,{format:this.parent.activeViewOptions.dateFormat,calendar:a})+" - "+r.formatDate(t,{format:this.parent.activeViewOptions.dateFormat,calendar:a}):r.formatDate(e,{format:this.parent.activeViewOptions.dateFormat,calendar:a}),"multiple")},T.prototype.getMobileDateElement=function(e,t){return B.createElement("div",{className:t,innerHTML:'<div class="e-m-date">'+this.parent.globalize.formatDate(e,{format:"d",calendar:this.parent.getCalendarMode()})+'</div><div class="e-m-day">'+y(this.parent.globalize.formatDate(e,{format:"E",calendar:this.parent.getCalendarMode()}),"single")+"</div>"})},T.prototype.setResourceHeaderContent=function(e,t,i){var n,r;void 0===i&&(i=bn),this.parent.activeViewOptions.resourceHeaderTemplate?(n={resource:t.resource,resourceData:t.resourceData},r=this.parent.element.id+"_"+this.parent.activeViewOptions.resourceHeaderTemplateName+"resourceHeaderTemplate",n=[].slice.call(this.parent.getResourceHeaderTemplate()(n,this.parent,"resourceHeaderTemplate",r,!1,void 0,void 0,this.parent.root)),B.append(n,e)):(r=B.createElement("div",{className:i}),this.parent.sanitize(t.resourceData[t.resource.textField],r),e.appendChild(r))},T.prototype.renderResourceMobileLayout=function(){this.parent.resourceBase.lastResourceLevel&&this.parent.resourceBase.lastResourceLevel.length<=0||(this.parent.resourceBase.renderResourceHeader(),this.parent.resourceBase.renderResourceTree())},T.prototype.addAutoHeightClass=function(e){!this.parent.uiStateValues.isGroupAdaptive&&this.parent.rowAutoHeight&&this.isTimelineView()&&0<this.parent.activeViewOptions.group.resources.length&&B.addClass([e],Mr)},T.prototype.getColElements=function(){return[].slice.call(this.element.querySelectorAll("."+A+" col, ."+Vt+" col"))},T.prototype.setColWidth=function(e){var t,i,n;this.isTimelineView()&&(t=this.getColElements(),n=this.element.querySelector("."+C+" tbody"),i=this.parent.getElementWidth(n)/(t.length/2),e.offsetHeight!==e.clientHeight&&(n=this.parent.element.querySelector("."+Wt),B.isNullOrUndefined(n)||n.offsetHeight===e.clientHeight||B.setStyleAttribute(n,{height:B.formatUnit(e.clientHeight)})),[].slice.call(this.element.querySelectorAll(".e-header-cells,.e-time-slots,.e-header-week-cell,.e-header-month-cell,.e-header-year-cell")).forEach(function(e){var t=B.isNullOrUndefined(e.getAttribute("colspan"))?"1":e.getAttribute("colspan"),t=parseInt(t,10);B.setStyleAttribute(e,{width:B.formatUnit(i*t)})}))},T.prototype.resetColWidth=function(){for(var e=0,t=this.getColElements();e<t.length;e++)t[e].style.width=""},T.prototype.getContentAreaElement=function(){return this.element.querySelector("."+A)},T.prototype.wireExpandCollapseIconEvents=function(){if(this.parent.resourceBase&&1<this.parent.resourceBase.resourceCollection.length)for(var e=0,t=[].slice.call(this.element.querySelectorAll("."+Qt));e<t.length;e++){var i=t[e];B.EventHandler.clearEvents(i),B.EventHandler.add(i,"click",this.parent.resourceBase.onTreeIconClick,this.parent.resourceBase)}},T.prototype.scrollToDate=function(e){var t;-1===["Month","TimelineMonth"].indexOf(this.parent.currentView)||B.isNullOrUndefined(e)||(t=this.getContentAreaElement(),e=new Date(z(new Date(+e)).getTime()).getTime(),e=t.querySelector("."+O+'[data-date="'+e+'"]'),"Month"===this.parent.currentView&&e&&(t.scrollWidth>t.clientWidth&&(this.parent.enableRtl?t.scrollLeft=-(this.parent.getContentTable().offsetWidth-e.offsetLeft-e.offsetWidth):t.scrollLeft=e.offsetLeft),t.scrollTop=e.offsetTop),"TimelineMonth"===this.parent.currentView&&e&&(this.parent.enableRtl?t.scrollLeft=-(this.parent.getContentTable().offsetWidth-e.offsetLeft-e.offsetWidth):t.scrollLeft=e.offsetLeft))},T.prototype.setPersistence=function(){var e;this.parent.enablePersistence&&(e=this.element.querySelector(".e-content-wrap"),this.parent.virtualScrollModule&&this.isScrolledBottom&&(this.isScrolledBottom=!1,this.skipPersistenceSave=!0,e.scrollTop=this.parent.scrollTop,this.skipPersistenceSave=!1),B.isNullOrUndefined(e)||(this.parent.scrollLeft=e.scrollLeft,this.parent.scrollTop=e.scrollTop))},T.prototype.retainScrollPosition=function(){var e;this.parent.enablePersistence&&(e=this.parent.element.querySelector(".e-content-wrap"),B.isNullOrUndefined(e)||B.isNullOrUndefined(this.parent.scrollLeft)||B.isNullOrUndefined(this.parent.scrollTop)||(this.isScrolledBottom=e.scrollHeight-e.clientHeight<this.parent.scrollTop,e.scrollTop=this.parent.scrollTop,e.scrollLeft=this.parent.scrollLeft))},T.prototype.getViewStartDate=function(){var e=this.renderDates[0];return e=0<this.parent.activeViewOptions.group.resources.length&&0<this.parent.resourceBase.lastResourceLevel.length?this.parent.resourceBase.getResourceRenderDates()[0]:e},T.prototype.getViewEndDate=function(){var e=Y(this.renderDates[this.renderDates.length-1],1);return e=0<this.parent.activeViewOptions.group.resources.length&&0<this.parent.resourceBase.lastResourceLevel.length?Y(this.parent.resourceBase.getResourceRenderDates().slice(-1)[0],1):e},T.prototype.getAdjustedDate=function(e){return!this.parent.activeViewOptions.timeScale.enable||"Month"===this.parent.currentView||"TimelineYear"===this.parent.currentView&&0===this.parent.activeViewOptions.group.resources.length?new Date(e.setHours(0,0,0,0)):"TimelineYear"===this.parent.currentView&&0<this.parent.activeViewOptions.group.resources.length?(e.setHours(0,0,0,0),new Date(e.setDate(1))):null},T.prototype.resetColLevels=function(){this.parent.resourceBase.expandedResources=[];for(var e=this.parent.virtualScrollModule.getRenderedCount(),t=this.parent.activeViewOptions.group.byDate?this.colLevels[0]:this.parent.resourceBase.renderedResources,i=0,n=0;n<t.length&&!(e<=i);n++)i+=t[parseInt(n.toString(),10)].colSpan,this.parent.resourceBase.expandedResources.push(t[parseInt(n.toString(),10)]);this.parent.activeViewOptions.group.byDate?(this.colLevels[0]=this.parent.resourceBase.expandedResources,this.parent.virtualScrollModule.setRenderedDates(this.parent.resourceBase.expandedResources)):(this.colLevels[this.colLevels.length-2]=this.parent.resourceBase.expandedResources,this.parent.resourceBase.renderedResources=this.parent.resourceBase.expandedResources),"Month"!==this.parent.currentView&&(this.colLevels[this.colLevels.length-1]=this.colLevels[this.colLevels.length-1].slice(0,i),this.parent.resourceBase.expandedResources=this.colLevels[this.colLevels.length-1])},T.prototype.getGroupIndices=function(e){var t=[];return t=this.parent.virtualScrollModule&&0<this.parent.activeViewOptions.group.resources.length&&(e||0<this.parent.virtualScrollModule.existingDataCollection.length)&&!this.parent.uiStateValues.isGroupAdaptive?(e=B.isNullOrUndefined(e)?this.parent.virtualScrollModule.existingDataCollection:e).map(function(e){return e.groupIndex}):t},T.prototype.destroy=function(){this.element&&this.element.parentNode&&B.remove(this.element),this.element=null,this.renderDates=null,this.colLevels=null};hs=T;function T(e){this.previousNextAction="Next",this.skipPersistenceSave=!1,this.isScrolledBottom=!1,this.parent=e}Tl=function(e,t){return(Tl=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}Tl(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(D,wl=hs),D.prototype.getModuleName=function(){return"verticalView"},D.prototype.addEventListener=function(){this.parent.on(Me,this.scrollUiUpdate,this),this.parent.on(Ee,this.renderEvents,this)},D.prototype.removeEventListener=function(){this.parent&&(this.parent.off(Me,this.scrollUiUpdate),this.parent.off(Ee,this.renderEvents))},D.prototype.renderEvents=function(){this.appointment=new(this.parent.activeViewOptions.timeScale.enable?Xa:Za)(this.parent),this.appointment.renderAppointments(),this.parent.notify(xe,{})},D.prototype.onContentScroll=function(e){this.parent.removeNewEventElement();var t=e.target;this.parent.notify(Ie,e),this.scrollLeftPanel(t),this.scrollTopPanel(t),this.parent.isAdaptive||(this.parent.uiStateValues.top=t.scrollTop),this.parent.uiStateValues.left=t.scrollLeft,B.isNullOrUndefined(this.parent.quickPopup)||this.parent.uiStateValues.isTapHold||this.parent.quickPopup.quickPopupHide(),this.setPersistence()},D.prototype.onAdaptiveMove=function(e){this.parent.uiStateValues.action&&e.preventDefault()},D.prototype.onAdaptiveScroll=function(e){this.parent&&!this.parent.isDestroyed&&(this.parent.removeNewEventElement(),this.parent.uiStateValues.top=e.target.scrollTop)},D.prototype.scrollLeftPanel=function(e){var t=this.getLeftPanelElement();B.isNullOrUndefined(t)||(t.scrollTop=e.scrollTop)},D.prototype.scrollUiUpdate=function(e){var t,i,n,r,a;this.parent&&(a=this.parent.element.querySelector("."+Vt),r=this.getHeaderBarHeight(),t=this.getLeftPanelElement(),i=this.getScrollableElement(),n=this.getDatesHeaderElement(),r=this.parent.element.offsetHeight-r-n.offsetHeight,this.setContentHeight(i,t,r),this.setColWidth(i),r=rt(),n.firstElementChild.style[e.cssProperties.rtlBorder]="",n.style[e.cssProperties.rtlPadding]="",a=!this.parent.enableAllDayScroll||!(i.offsetWidth-i.clientWidth<=a.offsetWidth-a.clientWidth&&a.classList.contains("e-all-day-scroll")),0<i.offsetWidth-i.clientWidth&&a?(n.firstElementChild.style[e.cssProperties.border]=0<r?"1px":"0px",n.style[e.cssProperties.padding]=0<r?r-1+"px":"0px"):(n.firstElementChild.style[e.cssProperties.border]="",n.style[e.cssProperties.padding]=""),e.isPreventScrollUpdate||(this.parent.uiStateValues.isInitial?(-1<this.parent.currentView.indexOf("Timeline")&&(i.scrollTop=this.parent.uiStateValues.top),this.scrollToWorkHour(),this.parent.uiStateValues.isInitial=!1):(t&&(t.scrollTop=this.parent.uiStateValues.top),i.scrollTop=this.parent.uiStateValues.top,i.scrollLeft=this.parent.uiStateValues.left)),this.parent.activeViewOptions.timeScale.enable&&this.highlightCurrentTime(),this.retainScrollPosition(),B.isNullOrUndefined(t)||B.isNullOrUndefined(i)||t.scrollTop===i.scrollTop||(t.scrollTop=i.scrollTop))},D.prototype.setContentHeight=function(e,t,i){this.parent.isAdaptive&&!this.isTimelineView()||B.isNullOrUndefined(t)||(t.style.height="auto"===this.parent.height?"auto":B.formatUnit(i-this.getScrollXIndent(e))),e.style.height="auto"===this.parent.height?"auto":B.formatUnit(i)},D.prototype.scrollToWorkHour=function(){var e;this.parent.workHours.highlight&&(e=this.element.querySelector("."+Et))&&(this.getScrollableElement().scrollTop=e.offsetTop,this.parent.uiStateValues.top=e.offsetTop,this.parent.uiStateValues.left=0)},D.prototype.scrollToHour=function(e,t){var i,e=this.parent.getStartEndTime(e);B.isNullOrUndefined(t)||(t=this.element.querySelector("."+It+'[data-date="'+new Date(z(t)).getTime()+'"]'))&&(this.parent.enableRtl?(i=this.element.querySelector("."+C),this.getScrollableElement().scrollLeft=-(i.offsetWidth-t.offsetLeft-t.offsetWidth)):this.getScrollableElement().scrollLeft=t.offsetLeft),B.isNullOrUndefined(e)||(this.getScrollableElement().scrollTop=this.getTopFromDateTime(e))},D.prototype.scrollToDate=function(e){this.scrollToHour(null,e)},D.prototype.generateColumnLevels=function(){var e,t,i,n=this.getDateSlots(this.renderDates,this.parent.activeViewOptions.workDays),r=[];if(0<this.parent.activeViewOptions.group.resources.length){if(r=this.parent.resourceBase.generateResourceLevels(n),this.parent.activeViewOptions.group.hideNonWorkingDays)for(;0===r[0].length;)this.parent.setProperties({selectedDate:this.parent.activeView.getNextPreviousDate(this.previousNextAction)},!0),this.parent.activeView.getRenderDates(),this.parent.headerModule&&(this.parent.headerModule.setCalendarDate(this.parent.selectedDate),this.parent.headerModule.updateDateRange()),n=this.getDateSlots(this.renderDates,this.parent.activeViewOptions.workDays),r=this.parent.resourceBase.generateResourceLevels(n);this.parent.uiStateValues.isGroupAdaptive&&0<this.parent.resourceBase.lastResourceLevel.length&&(t=(e=this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex]).resourceData[e.resource.startHourField],i=e.resourceData[e.resource.endHourField],r=[this.getDateSlots(e.renderDates,e.workDays,t,i)])}else r.push(n);return this.colLevels=r},D.prototype.getDateSlots=function(e,t,i,n){void 0===i&&(i=this.parent.workHours.start),void 0===n&&(n=this.parent.workHours.end);for(var r=[],a=this.parent.getStartEndTime(i),s=this.parent.getStartEndTime(n),o=0,l=e;o<l.length;o++){var p=l[o],c=[It];this.isCurrentDate(p)&&c.push(kt),r.push({date:p,type:"dateHeader",className:c,colSpan:1,workDays:t,startHour:new Date(+a),endHour:new Date(+s)})}return r},D.prototype.isWorkHourRange=function(e){return this.getStartHour().getTime()<=e.getTime()&&this.getEndHour().getTime()>=e.getTime()},D.prototype.highlightCurrentTime=function(){var e,t=this;0<this.parent.activeViewOptions.headerRows.length&&"Hour"!==this.parent.activeViewOptions.headerRows.slice(-1)[0].option||(e=this.parent.getCurrentTime(),this.parent.showTimeIndicator&&this.isWorkHourRange(e)&&0<this.getCurrentTimeIndicatorIndex().length&&!B.isNullOrUndefined(this.element.querySelector("."+O))?(this.changeCurrentTimePosition(),B.isNullOrUndefined(this.currentTimeIndicatorTimer)&&((e=je-(1e3*e.getSeconds()+e.getMilliseconds()))<=59e3&&window.setTimeout(function(){B.isNullOrUndefined(t.currentTimeIndicatorTimer)||(t.clearCurrentTimeIndicatorTimer(),t.changeCurrentTimePosition(),t.updateCurrentTimeIndicatorTimer())},e),this.updateCurrentTimeIndicatorTimer())):this.clearCurrentTimeIndicatorTimer())},D.prototype.getCurrentTimeIndicatorIndex=function(){var e=[];if(!B.isNullOrUndefined(this.parent.resourceBase)&&0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive){var t=0,i=z(this.parent.getCurrentTime());if(this.parent.virtualScrollModule&&this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.activeViewOptions.group.byDate)for(var n=0,r=this.parent.resourceBase.expandedResources;n<r.length;n++)z((l=r[n]).date).getTime()===i.getTime()&&e.push(t),t+=1;else for(var a=0,s=this.parent.resourceBase.renderedResources;a<s.length;a++){var o,l=s[a];0<=(p=this.parent.getIndexOfDate(l.renderDates,i))&&(o=this.parent.activeViewOptions.group.byDate?this.parent.resourceBase.lastResourceLevel.length*p+t:t+p,e.push(o)),t+=this.parent.activeViewOptions.group.byDate?1:l.renderDates.length}}else{var p,c=(this.parent.uiStateValues.isGroupAdaptive&&0<this.parent.resourceBase.lastResourceLevel.length?this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex]:this).renderDates;0<=(p=this.parent.getIndexOfDate(c,z(this.parent.getCurrentTime())))&&e.push(p)}return e},D.prototype.clearCurrentTimeIndicatorTimer=function(){B.isNullOrUndefined(this.currentTimeIndicatorTimer)||(window.clearInterval(this.currentTimeIndicatorTimer),this.currentTimeIndicatorTimer=null,this.removeCurrentTimeIndicatorElements())},D.prototype.updateCurrentTimeIndicatorTimer=function(){var e=this;this.currentTimeIndicatorTimer=window.setInterval(function(){e.changeCurrentTimePosition()},je)},D.prototype.removeCurrentTimeIndicatorElements=function(){for(var e=0,t=[].slice.call(this.element.querySelectorAll(".e-previous-timeline,.e-current-timeline,.e-current-time"));e<t.length;e++){var i=t[e];B.remove(i)}},D.prototype.changeCurrentTimePosition=function(){if(!this.parent||this.parent&&this.parent.isDestroyed)this.parent=null;else{this.removeCurrentTimeIndicatorElements();var e=this.getCurrentTimeIndicatorIndex(),t=this.parent.getContentTable().rows[0],i=this.getTopFromDateTime(this.parent.getCurrentTime()),n=B.formatUnit(i),i=Math.floor(i/t.cells[0].offsetHeight),t=this.getLeftPanelElement(),r=[].slice.call(t.querySelectorAll("tr"));if(!B.isNullOrUndefined(i)&&!isNaN(i)&&i!==r.length){for(var a=[].slice.call(this.element.querySelectorAll("."+si)),s=0,o=e[0];s<o;s++)a[parseInt(s.toString(),10)].appendChild(B.createElement("div",{className:ni,styles:"top:"+n}));for(var l=0,p=e;l<p.length;l++){var c=p[l];a.length>c&&a[parseInt(c.toString(),10)].appendChild(B.createElement("div",{className:ii,styles:"top:"+n}))}e=B.createElement("div",{innerHTML:this.parent.getTimeString(this.parent.getCurrentTime()),className:ti,styles:"top:"+n});i<=r.length&&(B.removeClass(t.querySelectorAll("."+ri),ri),r[parseInt(i.toString(),10)]&&B.addClass([r[parseInt(i.toString(),10)].lastElementChild],ri),B.prepend([e],t),e.style.top=B.formatUnit(e.offsetTop-e.offsetHeight/2))}}},D.prototype.getTopFromDateTime=function(e){var t=this.getStartEndHours(this.parent.activeViewOptions.startHour),i=this.getStartEndHours(this.parent.activeViewOptions.endHour),n=60*(e.getHours()-t.getHours())+(e.getMinutes()-t.getMinutes()),e=Je(z(new Date(e.getTime())),t,i),e=(e.endHour.getTime()-e.startHour.getTime())/je,r=this.parent.activeViewOptions.timeScale.interval,a=0,a=(0!==t.getHours()||0!==t.getMinutes()||0!==i.getHours()||0!==i.getMinutes())&&1===this.parent.activeViewOptions.timeScale.slotCount&&e<r?e:r;return n*this.getWorkCellHeight()*this.parent.activeViewOptions.timeScale.slotCount/a},D.prototype.getWorkCellHeight=function(){return parseFloat(this.parent.getElementHeight(this.element.querySelector("."+O)).toFixed(2))},D.prototype.getTdContent=function(e,t,i){var n,r,a,s=B.createElement("div"),o="",l=this.parent.element.id+"_";switch(t){case"dateHeader":n=this.parent.activeViewOptions.dateHeaderTemplate?(o="dateHeaderTemplate",a={date:e,type:t,groupIndex:i},r=this.parent.activeViewOptions.dateHeaderTemplateName,[].slice.call(this.parent.getDateHeaderTemplate()(a,this.parent,o,l+r+o,!1,void 0,void 0,this.parent.root))):(s.innerHTML=this.parent.activeView.isTimelineView()?'<span class="e-header-date e-navigate">'+this.getTimelineDate(e)+"</span>":'<div class="e-header-day">'+y(this.getDayName(e),"single")+'</div><div class="e-header-date e-navigate" role="link">'+this.getDate(e)+"</div>",[].slice.call(s.childNodes));break;case"majorSlot":n=this.parent.activeViewOptions.timeScale.majorSlotTemplate?(o="majorSlotTemplate",a={date:e,type:t},[].slice.call(this.parent.getMajorSlotTemplate()(a,this.parent,o,l+o,!1,void 0,void 0,this.parent.root))):(s.innerHTML="<span>"+this.getTime(e)+"</span>",[].slice.call(s.childNodes));break;case"minorSlot":n=this.parent.activeViewOptions.timeScale.minorSlotTemplate?(o="minorSlotTemplate",a={date:e,type:t},[].slice.call(this.parent.getMinorSlotTemplate()(a,this.parent,o,l+o,!1,void 0,void 0,this.parent.root))):[].slice.call(s.childNodes);break;case"alldayCells":this.parent.activeViewOptions.cellTemplate&&(r=this.parent.activeViewOptions.cellTemplateName,o="cellTemplate",a={date:e,type:t,groupIndex:i},n=[].slice.call(this.parent.getCellTemplate()(a,this.parent,o,l+r+o,!1,void 0,void 0,this.parent.root)))}return n},D.prototype.refreshHeader=function(){B.remove(this.element.querySelector("tbody tr")),this.renderHeader(),this.parent.notify(Ve,{});var e=this.element.querySelector("."+Vt);e&&(e.scrollLeft=this.parent.uiStateValues.left)},D.prototype.renderLayout=function(e){this.setPanel(B.createElement("div",{className:Oi}));var t=[this.baseCssClass,this.viewClass];t.push(e),this.parent.activeViewOptions.group.byDate&&t.push("e-by-date"),this.parent.activeViewOptions.timeScale.enable||B.addClass([this.element],["e-timescale-disable",this.viewClass]),this.parent.activeViewOptions.allowVirtualScrolling&&!this.parent.uiStateValues.isGroupAdaptive&&t.push(Ar),this.parent.rowAutoHeight&&this.parent.eventSettings.ignoreWhitespace&&t.push(kr),this.renderPanel(e),B.addClass([this.element],t),this.element.appendChild(this.createTableLayout(Ei)),this.element.querySelector("table").setAttribute("role","presentation"),this.colLevels=this.generateColumnLevels(),this.renderHeader(),this.renderContent(),this.parent.uiStateValues.isGroupAdaptive&&!this.parent.element.querySelector("."+pi)&&this.renderResourceMobileLayout(),this.parent.notify(Ve,{})},D.prototype.renderHeader=function(){var e,t=B.createElement("tr"),i=B.createElement("td");i.appendChild(this.renderDatesHeader()),this.parent.activeViewOptions.timeScale.enable&&((e=B.createElement("td",{className:Lt})).appendChild(this.renderLeftIndent()),t.appendChild(e)),t.appendChild(i),B.prepend([t],this.element.querySelector("tbody"))},D.prototype.renderContent=function(){0<this.parent.activeViewOptions.group.resources.length&&(this.parent.resourceBase.renderedResources=B.extend([],this.parent.resourceBase.lastResourceLevel,null,!0));var e,t,i,n=B.createElement("tr"),r=B.createElement("td");this.parent.isAdaptive?(r.setAttribute("colspan",this.parent.activeViewOptions.timeScale.enable?"2":"1"),e=B.createElement("div",{className:ai}),this.parent.activeViewOptions.timeScale.enable&&e.appendChild(this.renderTimeCells()),e.appendChild(this.renderContentArea()),r.appendChild(e),B.EventHandler.add(e,"scroll",this.onAdaptiveScroll,this),B.EventHandler.add(e,B.Browser.touchMoveEvent,this.onAdaptiveMove,this),n.appendChild(r)):(e=this.colLevels.slice(0),this.parent.virtualScrollModule&&this.resetColLevels(),t=this.renderContentArea(),r.appendChild(t),this.parent.activeViewOptions.timeScale.enable&&((i=B.createElement("td")).appendChild(this.renderTimeCells()),n.appendChild(i)),n.appendChild(r),this.parent.virtualScrollModule&&(this.colLevels=e,this.parent.virtualScrollModule.renderVirtualTrack(t))),this.element.querySelector("tbody").appendChild(n)},D.prototype.renderLeftIndent=function(){for(var e=B.createElement("div",{className:qt}),t=this.createTableLayout(),i=B.createElement("tr"),n=this.colLevels.length,r=0;r<n;r++){var a,s=i.cloneNode(),o={className:[this.colLevels[parseInt(r.toString(),10)][0]&&this.colLevels[parseInt(r.toString(),10)][0].className[0]],type:"emptyCells"};this.parent.activeViewOptions.showWeekNumber&&-1!==o.className.indexOf(It)&&(o.className.push(gi),a=this.parent.getWeekNumberContent(this.renderDates),o.template=[B.createElement("span",{innerHTML:""+a,attrs:{title:this.parent.localeObj.getConstant("week")+" "+a}})]),l=this.createTd(o),this.parent.renderHeaderIndentTemplate(o,l),s.appendChild(l),t.querySelector("tbody").appendChild(s)}var l,p=i.cloneNode(),c=B.createElement("div",{attrs:{tabindex:"0",role:"button",title:this.parent.localeObj.getConstant("expandAllDaySection"),"aria-disabled":"false","aria-label":this.parent.localeObj.getConstant("expandAllDaySection")},className:ln+" "+pn+" "+Dt+" "+d}),h={className:[w],type:"emptyCells"};return(l=this.createTd(h)).appendChild(c),this.parent.renderHeaderIndentTemplate(h,l),p.appendChild(l),t.querySelector("tbody").appendChild(p),e.appendChild(t),e},D.prototype.renderDatesHeader=function(){for(var e=B.createElement("div",{className:At}),t=B.createElement("div",{className:Vt}),i=(e.appendChild(t),this.createTableLayout()),n=B.createElement("tr",{className:nn}),r=this.colLevels.length,a=this.colLevels[r-1],s=0;s<r;s++){for(var o=n.cloneNode(),l=this.colLevels[parseInt(s.toString(),10)],p=0;p<l.length;p++)o.appendChild(this.createTd(l[parseInt(p.toString(),10)]));i.querySelector("tbody").appendChild(o)}return this.createAllDayRow(i,a),this.createColGroup(i,a),t.appendChild(i),e},D.prototype.createAllDayRow=function(e,t){for(var i=B.createElement("tr",{className:Ot}),n=0;n<t.length;n++){var r=B.extend({},t[parseInt(n.toString(),10)]),a=(r.className=[w],r.type="alldayCells",this.createTd(r));a.setAttribute("data-date",r.date.getTime().toString()),B.isNullOrUndefined(r.groupIndex)?this.parent.uiStateValues.isGroupAdaptive&&a.setAttribute("data-group-index",""+this.parent.uiStateValues.groupIndex):a.setAttribute("data-group-index",""+r.groupIndex),this.wireCellEvents(a),i.appendChild(a)}e.querySelector("tbody").appendChild(i);var s=B.createElement("thead");s.appendChild(this.parent.eventBase.createEventWrapper("allDay")),B.prepend([s],e)},D.prototype.createTd=function(e){var t=B.createElement("td"),i=(this.addAttributes(e,t),e.date&&e.type&&(i=this.getTdContent(e.date,e.type,e.groupIndex))&&i.length&&B.append(i,t),this.parent.isMinMaxDate(z(new Date(""+e.date)))||B.addClass([t],yr),"resourceHeader"===e.type&&this.setResourceHeaderContent(t,e),"dateHeader"===e.type&&0<=e.className.indexOf(It)&&(t.setAttribute("data-date",e.date.getTime().toString()),B.isNullOrUndefined(e.groupIndex)||t.setAttribute("data-group-index",""+e.groupIndex),this.wireMouseEvents(t)),{elementType:e.type,element:t,date:e.date,groupIndex:e.groupIndex});return this.parent.trigger($,i),t},D.prototype.wireCellEvents=function(e){B.EventHandler.add(e,"mousedown",this.parent.workCellAction.cellMouseDown,this.parent.workCellAction),this.wireMouseEvents(e)},D.prototype.wireMouseEvents=function(e){B.EventHandler.add(e,"click",this.parent.workCellAction.cellClick,this.parent.workCellAction),this.parent.isAdaptive||B.EventHandler.add(e,"dblclick",this.parent.workCellAction.cellDblClick,this.parent.workCellAction)},D.prototype.renderTimeCells=function(){var n=this,e=B.createElement("div",{className:Zt}),r=this.createTableLayout(),a=B.createElement("tr");return this.getTimeSlotRows(function(e){e.type=e.first?"majorSlot":"minorSlot",e.className=e.last?[Jt,$t]:[$t];var t=a.cloneNode(),i={date:e.date,type:e.type,className:e.className};return t.appendChild(n.createTd(i)),r.querySelector("tbody").appendChild(t),e}),e.appendChild(r),e},D.prototype.renderContentArea=function(){var e=B.createElement("div",{className:A}),t=this.createTableLayout(C);return this.setAriaAttributes(t),this.addAutoHeightClass(t),this.renderContentTable(t),this.createColGroup(t,this.colLevels.slice(-1)[0]),e.appendChild(t),this.wireCellEvents(t.querySelector("tbody")),B.EventHandler.add(e,"scroll",this.onContentScroll,this),B.EventHandler.add(e,B.Browser.touchMoveEvent,this.onAdaptiveMove,this),e},D.prototype.renderContentTable=function(e){var t=e.querySelector("tbody");B.append(this.getContentRows(),t),this.renderContentTableHeader(e)},D.prototype.getContentRows=function(){var s=this,o=[],l=B.createElement("tr"),p=B.createElement("td"),c=this.getGroupIndices();return this.getTimeSlotRows(function(e){for(var t=l.cloneNode(),i=0,n=s.colLevels[s.colLevels.length-1];i<n.length;i++){var r=n[i],a=!0;(a=s.parent.virtualScrollModule&&0<s.parent.activeViewOptions.group.resources.length&&-1<c.indexOf(r.groupIndex)?!1:a)&&(a=s.createContentTd(r,e,p),t.appendChild(a))}return o.push(t),e}),o},D.prototype.createContentTd=function(e,t,i){var i=i.cloneNode(),n=(e.colSpan&&i.setAttribute("colspan",e.colSpan.toString()),this.getContentTdClass(t)),r=z(e.date),t=(this.parent.isMinMaxDate(r)||n.push(yr),r=new Date(r.setHours(t.date.getHours(),t.date.getMinutes(),t.date.getSeconds(),t.date.getMilliseconds())),"workCells"),a=(-1!==e.className.indexOf(_t)&&(n.push(Ut),t="resourceGroupCells"),this.parent.workHours.highlight&&(this.parent.activeViewOptions.timeScale.enable&&this.isWorkHour(r,e.startHour,e.endHour,e.workDays)||!this.parent.activeViewOptions.timeScale.enable&&this.isWorkDay(r,e.workDays))&&n.push(Et),B.addClass([i],n),this.parent.activeViewOptions.cellTemplate&&(n={date:r,type:t,groupIndex:e.groupIndex},a=this.parent.element.id+"_"+this.parent.activeViewOptions.cellTemplateName+"cellTemplate",n=[].slice.call(this.parent.getCellTemplate()(n,this.parent,"cellTemplate",a,!1,void 0,void 0,this.parent.root)),B.append(n,i)),i.setAttribute("data-date",r.getTime().toString()),this.parent.activeViewOptions.timeScale.enable?(a=this.parent.globalize.formatDate(r,{type:"dateTime",skeleton:"full",calendar:this.parent.getCalendarMode()}),n=this.parent.globalize.formatDate(this.getEndDateFromStartDate(r),{type:"dateTime",skeleton:"full",calendar:this.parent.getCalendarMode()}),i.setAttribute("aria-label",a+" "+this.parent.localeObj.getConstant("endAt")+" "+n)):(a=this.parent.globalize.formatDate(e.date,{skeleton:"full",calendar:this.parent.getCalendarMode()}),i.setAttribute("aria-label",a)),B.isNullOrUndefined(e.groupIndex)&&!this.parent.uiStateValues.isGroupAdaptive||(n=(this.parent.uiStateValues.isGroupAdaptive?this.parent.uiStateValues:e).groupIndex,i.setAttribute("data-group-index",""+n)),{elementType:t,element:i,date:r,groupIndex:e.groupIndex});return this.parent.trigger($,a),i},D.prototype.getContentTdClass=function(e){return e.last?[O]:[O,ei]},D.prototype.renderContentTableHeader=function(e){var t=B.createElement("thead");t.appendChild(this.parent.eventBase.createEventWrapper()),this.parent.activeViewOptions.timeScale.enable&&t.appendChild(this.parent.eventBase.createEventWrapper("timeIndicator")),B.prepend([t],e)},D.prototype.getScrollableElement=function(){return this.parent.isAdaptive&&!this.isTimelineView()?this.element.querySelector("."+ai):this.getContentAreaElement()},D.prototype.getLeftPanelElement=function(){return this.element.querySelector("."+Zt)},D.prototype.getEndDateFromStartDate=function(e){var t=this.parent.activeViewOptions.timeScale.interval*je/this.parent.activeViewOptions.timeScale.slotCount,e=new Date(e.getTime());return e.setMilliseconds(e.getMilliseconds()+t),e},D.prototype.getStartEndHours=function(e){var t;return B.isNullOrUndefined(e)||""===e?new Date(2e3,0,0,0):(t=new Date(2e3,0,0,0),2===(e=e.split(":")).length&&t.setHours(parseInt(e[0],10),parseInt(e[1],10),0),t)},D.prototype.getTimeSlotRows=function(e){for(var t=[],i=this.getStartEndHours(this.parent.activeViewOptions.startHour),n=this.getStartEndHours(this.parent.activeViewOptions.endHour),r=this.parent.activeViewOptions.timeScale.interval*je,a=r/this.parent.activeViewOptions.timeScale.slotCount,s=Math.round(W/a),o=i.getTime(),l=n.getTime(),p=(o!==l&&(i=i.getTimezoneOffset()!==n.getTimezoneOffset()?l-o-36e5:l-o,s=Math.round(i/a)),this.parent.activeViewOptions.timeScale.enable||(s=1),this.parent.getStartEndTime(this.parent.workHours.start)),c=this.parent.getStartEndTime(this.parent.workHours.end),h=0;h<s;h++){var d=new Date(o+a*h),u=(!pt(d)&&new Date(o).getTimezoneOffset()===d.getTimezoneOffset()||(u=new Date(o).getTimezoneOffset()-d.getTimezoneOffset(),d=new Date(d.getTime()-6e4*u)),h%(r/a)),d={date:new Date(""+d),startHour:p,endHour:c,first:0==u,middle:u<this.parent.activeViewOptions.timeScale.slotCount-1,last:u==this.parent.activeViewOptions.timeScale.slotCount-1,type:""};e&&e(d),t.push(d)}return t},D.prototype.getAdjustedDate=function(e){if(!this.parent.activeViewOptions.timeScale.enable)return new Date(e.setHours(0,0,0,0));for(var t=this.getTimeSlotRows(),i=new Date(new Date(t[0].date.getTime()).setHours(e.getHours(),e.getMinutes(),e.getMilliseconds())),n=0;n<t.length;n++)if(t[parseInt(n.toString(),10)].date.getTime()>i.getTime())return e.setHours(t[n-1].date.getHours(),t[n-1].date.getMinutes(),t[n-1].date.getMilliseconds()),new Date(e);return null},D.prototype.destroy=function(){var e;!this.parent||this.parent&&this.parent.isDestroyed?this.parent=null:(this.clearCurrentTimeIndicatorTimer(),this.element&&(this.appointment&&(this.appointment.destroy(),this.appointment=null),(e=this.getContentAreaElement())&&(B.EventHandler.remove(e,"scroll",this.onContentScroll),B.EventHandler.remove(e,B.Browser.touchMoveEvent,this.onAdaptiveMove)),this.parent.resourceBase&&this.parent.resourceBase.destroy(),this.parent.scheduleTouchModule&&this.parent.scheduleTouchModule.resetValues(),wl.prototype.destroy.call(this)))};var Tl,wl,Co=D;function D(e){e=wl.call(this,e)||this;return e.viewClass="e-day-view",e.isInverseTableSelect=!0,e.baseCssClass="e-vertical-view",e.appointment=null,e}Dl=function(e,t){return(Dl=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}Dl(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Cl,bl=Co),Cl.prototype.getModuleName=function(){return"day"};var Dl,bl,Sl=Cl;function Cl(e){e=bl.call(this,e)||this;return e.viewClass="e-day-view",e}Ol=function(e,t){return(Ol=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}Ol(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Vl,El=Co),Vl.prototype.startDate=function(){return this.getViewStartDate()},Vl.prototype.endDate=function(){return this.getViewEndDate()},Vl.prototype.getModuleName=function(){return"week"};var Ol,El,xl=Vl;function Vl(e){e=El.call(this,e)||this;return e.viewClass="e-week-view",e}Al=function(e,t){return(Al=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}Al(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(kl,Il=Co),kl.prototype.startDate=function(){return this.getViewStartDate()},kl.prototype.endDate=function(){return this.getViewEndDate()},kl.prototype.getModuleName=function(){return"workWeek"};var Al,Il,Ml=kl;function kl(e){e=Il.call(this,e)||this;return e.viewClass="e-work-week-view",e}Rl=function(e,t){return(Rl=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}Rl(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(b,Hl=hs),b.prototype.addEventListener=function(){this.parent.on(Me,this.onScrollUIUpdate,this),this.parent.on(Ee,this.onDataReady,this),this.parent.on(q,this.onCellClick,this)},b.prototype.removeEventListener=function(){this.parent&&(this.parent.off(Me,this.onScrollUIUpdate),this.parent.off(Ee,this.onDataReady),this.parent.off(q,this.onCellClick))},b.prototype.onDataReady=function(e){this.monthEvent=new Za(this.parent),this.monthEvent.renderAppointments(),this.parent.notify(xe,{})},b.prototype.onCellClick=function(e){},b.prototype.onContentScroll=function(e){this.skipPersistenceSave||(this.parent.removeNewEventElement(),this.parent.notify(Ie,e),this.scrollTopPanel(e.target),this.scrollLeftPanel(e.target),this.parent.uiStateValues.top=e.target.scrollTop,this.parent.uiStateValues.left=e.target.scrollLeft,this.setPersistence())},b.prototype.scrollLeftPanel=function(e){var t=this.getLeftPanelElement();t&&(t.scrollTop=e.scrollTop)},b.prototype.getLeftPanelElement=function(){return this.element.querySelector("."+ui)},b.prototype.onScrollUIUpdate=function(e){var t=this.getHeaderBarHeight(),i=this.getDatesHeaderElement(),n=this.getContentAreaElement(),t=this.parent.element.offsetHeight-t-i.offsetHeight,r=this.getLeftPanelElement(),t=("auto"!==this.parent.height&&this.setContentHeight(n,r,t),rt());i.firstElementChild.style[e.cssProperties.rtlBorder]="",i.style[e.cssProperties.rtlPadding]="",0<n.offsetWidth-n.clientWidth?(i.firstElementChild.style[e.cssProperties.border]=0<t?"1px":"0px",i.style[e.cssProperties.padding]=0<t?t-1+"px":"0px"):(i.firstElementChild.style[e.cssProperties.border]="",i.style[e.cssProperties.padding]=""),this.setColWidth(n),(e.scrollPosition||!e.isPreventScrollUpdate&&"TimelineMonth"===this.parent.currentView)&&(t=("TimelineMonth"===this.parent.currentView?this.parent.uiStateValues:e.scrollPosition).top,r&&(r.scrollTop=t),n.scrollTop=t,this.parent.uiStateValues.isInitial?(this.scrollToSelectedDate(),this.parent.uiStateValues.isInitial=!1):n.scrollLeft=("TimelineMonth"===this.parent.currentView?this.parent.uiStateValues:e.scrollPosition).left),this.retainScrollPosition()},b.prototype.scrollToSelectedDate=function(){var e=new Date(this.parent.selectedDate),e=(e.setHours(0,0,0,0),this.element.querySelector("."+It+'[data-date="'+e.getTime().toString()+'"]')),t=this.getContentAreaElement();B.isNullOrUndefined(e)?t.scrollLeft=0:t.scrollLeft=this.parent.enableRtl?-(this.parent.getContentTable().offsetWidth-e.offsetLeft-e.offsetWidth):e.offsetLeft,0===t.scrollLeft&&this.parent.uiStateValues.isInitial&&(this.parent.uiStateValues.left=0)},b.prototype.setContentHeight=function(e,t,i){e.style.height="auto","Month"===this.parent.currentView&&(e.style.height=B.formatUnit(i)),t&&("MonthAgenda"===this.parent.currentView&&(i=(1<this.parent.activeViewOptions.interval?this.getContentAreaElement().firstElementChild:this.element.querySelector("."+C)).offsetHeight),t.style.height="auto",t.style.height=B.formatUnit(i-this.getScrollXIndent(e)))},b.prototype.generateColumnLevels=function(){var e,i,t=[],n=this.getDateSlots(this.renderDates,this.parent.activeViewOptions.workDays);return 0<this.parent.activeViewOptions.group.resources.length?(t=this.parent.resourceBase.generateResourceLevels(n),"MonthAgenda"===this.parent.currentView&&(t=[n]),this.parent.uiStateValues.isGroupAdaptive&&0<this.parent.resourceBase.lastResourceLevel.length&&(e=this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex],i=this.getDateSlots(e.renderDates,e.workDays),t=[i=this.parent.activeViewOptions.group.byDate&&this.parent.activeViewOptions.group.hideNonWorkingDays?-1<(e=i.findIndex(function(e,t){return 0!==t&&e.date.getDay()===i[0].date.getDay()}))?i.slice(0,e):i:i])):t.push(n),this.colLevels=t},b.prototype.getDateSlots=function(e,t){for(var i=this.parent.activeViewOptions.showWeekend?7:t.length,n=[],r=this.isCurrentMonth(this.parent.selectedDate),a=0;a<i;a++){var s=[It],o=e.slice(0,i).map(function(e){return e.getDay()});r&&o.indexOf(this.parent.currentTimezoneDate.getDay())===a&&s.push(kt),n.push({date:e[parseInt(a.toString(),10)],type:"monthDay",className:s,colSpan:1,workDays:t})}return n},b.prototype.getDayNameFormat=function(){return this.parent.isAdaptive||0<this.parent.activeViewOptions.group.resources.length?"abbreviated":"wide"},b.prototype.renderLayout=function(e){this.dayNameFormat=this.getDayNameFormat(),this.setPanel(B.createElement("div",{className:Oi}));var t=[this.viewClass],t=(t.push(e),this.parent.activeViewOptions.group.byDate&&(t.push("e-by-date"),"Month"!==this.parent.currentView)&&(this.parent.activeViewOptions.group.hideNonWorkingDays=!1),this.parent.activeViewOptions.allowVirtualScrolling&&!this.parent.uiStateValues.isGroupAdaptive&&t.push(Ar),this.parent.rowAutoHeight&&this.parent.eventSettings.ignoreWhitespace&&t.push(kr),B.addClass([this.element],t),this.renderPanel(e),this.element.appendChild(this.createTableLayout(Ei)),this.element.querySelector("table").setAttribute("role","presentation"),this.colLevels=this.generateColumnLevels(),this.renderHeader(),this.renderContent(),"MonthAgenda"===this.parent.currentView?this.parent.activeView.getPanel():this.parent.element);this.parent.uiStateValues.isGroupAdaptive&&!t.querySelector("."+pi)&&this.renderResourceMobileLayout(),this.parent.notify(Ve,{}),this.parent.uiStateValues.isCustomMonth&&(this.parent.uiStateValues.isCustomMonth=!1)},b.prototype.refreshHeader=function(){B.remove(this.element.querySelector("tbody tr")),this.renderHeader(),this.parent.notify(Ve,{});var e=this.element.querySelector("."+Vt),t=this.element.querySelector("."+A);e&&(e.scrollLeft=this.parent.uiStateValues.left),t&&(t.scrollLeft=this.parent.uiStateValues.left)},b.prototype.wireCellEvents=function(e){B.EventHandler.add(e,"mousedown",this.parent.workCellAction.cellMouseDown,this.parent.workCellAction),B.EventHandler.add(e,"click",this.parent.workCellAction.cellClick,this.parent.workCellAction),this.parent.isAdaptive||B.EventHandler.add(e,"dblclick",this.parent.workCellAction.cellDblClick,this.parent.workCellAction)},b.prototype.renderHeader=function(){var e=B.createElement("tr"),t=(this.renderLeftIndent(e),B.createElement("td"));t.appendChild(this.renderDatesHeader()),e.appendChild(t),B.prepend([e],this.element.querySelector("tbody"))},b.prototype.renderLeftIndent=function(e){this.parent.activeViewOptions.showWeekNumber&&e.appendChild(B.createElement("td",{className:"e-left-indent"}))},b.prototype.renderContent=function(){0<this.parent.activeViewOptions.group.resources.length&&(this.parent.resourceBase.renderedResources=B.extend([],this.parent.resourceBase.lastResourceLevel,null,!0));var e,t=B.createElement("tr"),i=(this.parent.activeViewOptions.showWeekNumber&&t.appendChild(this.renderWeekNumberContent()),B.createElement("td")),n=this.colLevels.slice(0),r=(this.parent.virtualScrollModule&&this.resetColLevels(),B.createElement("div",{className:A})),a=this.renderContentArea();"Month"===this.parent.currentView?r.appendChild(a):((e=B.createElement("div",{className:St})).appendChild(a),r.appendChild(e)),B.EventHandler.add(r,"scroll",this.onContentScroll,this),i.appendChild(r),t.appendChild(i),this.parent.virtualScrollModule&&(this.colLevels=n,this.parent.virtualScrollModule.renderVirtualTrack(r)),this.element.querySelector("tbody").appendChild(t),this.renderAppointmentContainer()},b.prototype.renderWeekNumberContent=function(){for(var e=this.renderDates.map(function(e){return new Date(+e)}),t=B.createElement("td"),i=B.createElement("div",{className:ui}),n=(t.appendChild(i),this.createTableLayout()),r=(i.appendChild(n),this.parent.activeViewOptions.showWeekend?7:this.parent.activeViewOptions.workDays.length),a=0,s=this.renderDates.length/r;a<s;a++){var o=e.splice(0,r),o=this.parent.getWeekNumberContent(o);n.querySelector("tbody").appendChild(this.createWeekNumberElement(o))}return t},b.prototype.renderAppointmentContainer=function(){},b.prototype.renderDatesHeader=function(){for(var e,t=B.createElement("div",{className:At}),i=B.createElement("div",{className:Vt}),n=(t.appendChild(i),this.createTableLayout()),r=("Month"===this.parent.currentView&&((e=B.createElement("thead")).appendChild(B.createElement("tr")),B.prepend([e],n)),this.createColGroup(n,this.colLevels[this.colLevels.length-1]),B.createElement("tr")),a=0;a<this.colLevels.length;a++){for(var s=this.colLevels[parseInt(a.toString(),10)],o=r.cloneNode(),l=0;l<s.length;l++){var p=s[parseInt(l.toString(),10)];o.appendChild(this.createHeaderCell(p))}n.querySelector("tbody").appendChild(o)}return i.appendChild(n),t},b.prototype.createHeaderCell=function(e){var t,i,n=B.createElement("td"),r=(this.addAttributes(e,n),"monthDay"===e.type&&(t=B.createElement("span",{innerHTML:y(this.parent.getDayNames(this.dayNameFormat)[e.date.getDay()],"single")}),n.appendChild(t)),"resourceHeader"===e.type&&this.setResourceHeaderContent(n,e),"dateHeader"===e.type&&(B.addClass([n],Pi),n.setAttribute("data-date",e.date.getTime().toString()),this.parent.activeViewOptions.dateHeaderTemplate?(i={date:e.date,type:e.type},r=this.parent.element.id+"_"+this.parent.activeViewOptions.dateHeaderTemplateName+"dateHeaderTemplate",(i=[].slice.call(this.parent.getDateHeaderTemplate()(i,this.parent,"dateHeaderTemplate",r,!1,void 0,void 0,this.parent.root)))&&i.length&&B.append(i,n)):(t=B.createElement("span",{className:Hi}),r=this.parent.globalize.formatDate(e.date,{skeleton:"full",calendar:this.parent.getCalendarMode()}),t.setAttribute("title",y(r,"multiple")),i=!this.parent.calendarUtil.isMonthStart(e.date)||this.isCurrentDate(e.date)||this.parent.isAdaptive?this.parent.globalize.formatDate(e.date,{skeleton:"d",calendar:this.parent.getCalendarMode()}):this.parent.globalize.formatDate(e.date,{format:"MMM d",calendar:this.parent.getCalendarMode()}),t.innerHTML=y(i,"single"),n.appendChild(t)),this.wireCellEvents(n)),{elementType:e.type,element:n,date:e.date,groupIndex:e.groupIndex});return this.parent.trigger($,r),n},b.prototype.getContentSlots=function(){if(!this.colLevels[this.colLevels.length-1]||!this.colLevels[this.colLevels.length-1][0])return[];var r=[],o=function(e,t,i,n){t={date:new Date(+t),groupIndex:i.groupIndex,workDays:i.workDays,type:"monthCells",className:n||[O]};r[parseInt(e.toString(),10)]||(r[parseInt(e.toString(),10)]=[]),r[parseInt(e.toString(),10)].push(t)},l="MonthAgenda"!==this.parent.currentView&&0<this.parent.activeViewOptions.group.resources.length;if(!l||this.parent.uiStateValues.isGroupAdaptive||this.parent.activeViewOptions.group.byDate)for(var e=this.renderDates.map(function(e){return new Date(+e)}),p=this.parent.activeViewOptions.showWeekend?7:this.parent.activeViewOptions.workDays.length,t=this.colLevels.slice(0,1)[0],i=this.renderDates.map(Number).indexOf(+t[0].date),c=0;c<this.renderDates.length/p;c++)for(var h,d=e.splice(0,p),u=i,g=this,n=i;n<this.colLevels[0].length+i&&n<d.length;n++)!function(e){var t=d[parseInt(u.toString(),10)];if(u++,l){var i=g.colLevels[g.colLevels.length-1],n=i.length/p,r=i.slice(0,n);if(g.parent.activeViewOptions.group.hideNonWorkingDays&&0===(r=i.filter(function(e){return e.date.getDay()===t.getDay()})).length)return h=e-=1;for(var a=0;a<r.length;a++){var s=0!==a?[O,"e-disable-date"]:void 0;o(c,t,r[parseInt(a.toString(),10)],s)}}else o(c,t,g.colLevels[g.colLevels.length-1][0]);h=e}(n),n=h;else for(var a=0,s=this.colLevels[this.colLevels.length-2];a<s.length;a++)for(var m=s[a],e=m.renderDates.map(function(e){return new Date(+e)}),p=this.parent.activeViewOptions.showWeekend?7:m.workDays.length,c=0;c<m.renderDates.length/p;c++)for(var d,v=0,f=d=e.splice(0,p);v<f.length;v++){var y=f[v];o(c,y,m)}return r},b.prototype.updateClassList=function(e){!this.isCustomMonth()&&this.isOtherMonth(e.date)&&e.className.push(E),this.parent.isMinMaxDate(e.date)||e.className.push(yr),this.updateSelectedCellClass(e)},b.prototype.updateSelectedCellClass=function(e){},b.prototype.isOtherMonth=function(e){return e.getTime()<this.monthDates.start.getTime()||e.getTime()>this.monthDates.end.getTime()},b.prototype.renderContentArea=function(){var e=this.createTableLayout(C),t=(this.setAriaAttributes(e),this.addAutoHeightClass(e),"TimelineMonth"===this.parent.currentView&&this.createColGroup(e,this.colLevels[this.colLevels.length-1]),new Date(this.parent.selectedDate.getTime())),t=(this.monthDates={start:this.parent.calendarUtil.firstDateOfMonth(t),end:this.parent.calendarUtil.lastDateOfMonth(Ke(t,this.parent.activeViewOptions.interval-1))},e.querySelector("tbody"));return B.append(this.getContentRows(),t),this.wireCellEvents(t),e},b.prototype.getContentRows=function(){for(var e=[],t=B.createElement("tr"),i=B.createElement("td"),n=this.getContentSlots(),r="TimelineMonth"===this.parent.currentView?this.getGroupIndices():[],a=0;a<n.length;a++)if(!(0<r.length&&-1<r.indexOf(n[parseInt(a.toString(),10)][0].groupIndex))){for(var s=t.cloneNode(),o=0;o<n[parseInt(a.toString(),10)].length;o++){var l=this.createContentTd(n[parseInt(a.toString(),10)][parseInt(o.toString(),10)],i);s.appendChild(l)}e.push(s)}return e},b.prototype.createContentTd=function(e,t){var i,t=t.cloneNode(),n=(e.colSpan&&t.setAttribute("colspan",e.colSpan.toString()),this.updateClassList(e),e.type),r=(-1!==e.className.indexOf(_t)&&(e.className.push(Ut),n="resourceGroupCells"),this.parent.workHours.highlight&&this.isWorkDay(e.date,e.workDays)&&e.className.push(Mt),this.isCurrentDate(e.date)&&e.className.push(Rt),B.addClass([t],e.className),t.setAttribute("data-date",e.date.getTime().toString()),B.isNullOrUndefined(e.groupIndex)&&!this.parent.uiStateValues.isGroupAdaptive||(i=(this.parent.uiStateValues.isGroupAdaptive?this.parent.uiStateValues:e).groupIndex,t.setAttribute("data-group-index",""+i)),this.renderDateHeaderElement(e,t),this.parent.activeViewOptions.cellTemplate&&(i={date:e.date,type:n,groupIndex:e.groupIndex},r=this.parent.element.id+"_"+this.parent.activeViewOptions.cellTemplateName+"cellTemplate",i=[].slice.call(this.parent.getCellTemplate()(i,this.parent,"cellTemplate",r,!1,void 0,void 0,this.parent.root)),B.append(i,t)),{elementType:n,element:t,date:e.date,groupIndex:e.groupIndex});return this.parent.trigger($,r),t},b.prototype.renderDateHeaderElement=function(e,t){var i,n,r;"TimelineMonth"!==this.parent.currentView&&(i=B.createElement("div",{className:Pi}),this.parent.activeViewOptions.cellHeaderTemplate?(r={date:e.date,type:e.type,groupIndex:e.groupIndex},n=this.parent.element.id+"_"+this.parent.activeViewOptions.cellHeaderTemplateName+"cellHeaderTemplate",r=[].slice.call(this.parent.getCellHeaderTemplate()(r,this.parent,"cellHeaderTemplate",n,!1,void 0,void 0,this.parent.root)),B.append(r,i)):(n=!this.parent.calendarUtil.isMonthStart(e.date)||this.isCurrentDate(e.date)||this.parent.isAdaptive?this.parent.globalize.formatDate(e.date,{skeleton:"d",calendar:this.parent.getCalendarMode()}):this.parent.globalize.formatDate(e.date,{format:"MMM d",calendar:this.parent.getCalendarMode()}),i.innerHTML=y(n,"single")),t.appendChild(i),"month"===this.getModuleName())&&(B.addClass([i],Hi),r=this.parent.globalize.formatDate(e.date,{skeleton:"full",calendar:this.parent.getCalendarMode()}),t.setAttribute("aria-label",r))},b.prototype.getMonthStart=function(e){e=Ue("Month"===this.parent.currentView&&!B.isNullOrUndefined(this.parent.activeViewOptions.displayDate)&&!this.parent.uiStateValues.isSwipeScroll&&(this.parent.uiStateValues.isCustomMonth||this.isCustomRange())?this.parent.activeViewOptions.displayDate:this.parent.uiStateValues.isCustomMonth||!this.parent.uiStateValues.isSwipeScroll&&this.isCustomRange()||!this.isCustomMonth()?this.parent.calendarUtil.firstDateOfMonth(e):e,this.parent.activeViewOptions.firstDayOfWeek);return new Date(e.getFullYear(),e.getMonth(),e.getDate())},b.prototype.getMonthEnd=function(e){return this.isCustomMonth()?Y(this.getMonthStart(e),7*(0<this.parent.activeViewOptions.numberOfWeeks?this.parent.activeViewOptions.numberOfWeeks:6)-1):(e=Ke(e,this.parent.activeViewOptions.interval-1),Y(Ue(this.parent.calendarUtil.lastDateOfMonth(e),this.parent.activeViewOptions.firstDayOfWeek),6))},b.prototype.isCustomRange=function(){var e,t,i=this.parent.getCurrentViewDates();return!(!(i&&0<i.length)||(e=z(this.parent.selectedDate).getTime(),t=Ue(i[i.length-1],this.parent.activeViewOptions.firstDayOfWeek),e>=Ue(i[0],this.parent.activeViewOptions.firstDayOfWeek).getTime()&&e<=Y(t,6).getTime()))},b.prototype.getRenderDates=function(e,t){void 0===t&&(t=this.parent.selectedDate);for(var i=[],t=z(t),n=this.getMonthStart(t),r=this.getMonthEnd(t);(this.parent.activeViewOptions.showWeekend||this.isWorkDay(n,e))&&i.push(n),(n=0<(n=Y(n,1)).getHours()?z(n):n).getTime()<=r.getTime(););return e||(this.renderDates=i),this.parent.headerModule&&this.parent.headerModule.previousNextIconHandler(),i},b.prototype.getNextPreviousDate=function(e){var t;return this.isCustomMonth()?(t=this.parent.getCurrentViewDates(),Y(Ue("Next"===e?t[t.length-1]:t[0],this.parent.activeViewOptions.firstDayOfWeek),"Next"===e?7:7*-(0<this.parent.activeViewOptions.numberOfWeeks?this.parent.activeViewOptions.numberOfWeeks:6))):Ke(this.parent.selectedDate,("Next"===e?1:-1)*this.parent.activeViewOptions.interval)},b.prototype.getStartDate=function(){return this.getMonthStart(this.parent.selectedDate)},b.prototype.getEndDate=function(){return this.getMonthEnd(this.parent.selectedDate)},b.prototype.getEndDateFromStartDate=function(e){return Y(new Date(e.getTime()),1)},b.prototype.getDateRangeText=function(e,t){var i,n,r;return void 0===e&&(e=this.parent.selectedDate),void 0===t&&(t=null),this.parent.isAdaptive||B.isNullOrUndefined(this.parent.activeViewOptions.dateFormat)?(n=void(e=!B.isNullOrUndefined(t)&&6<t.length?t[6]:e),i=!1,this.isCustomMonth()&&(i=(r=!B.isNullOrUndefined(t)&&0<t.length?t:this.parent.getCurrentViewDates())[0].getMonth()!==r[r.length-1].getMonth()||r[0].getFullYear()!==r[r.length-1].getFullYear())&&(e=r[0],n=r[r.length-1]),r="Month"!==this.parent.currentView||!this.isCustomMonth(),1<this.parent.activeViewOptions.interval&&r||i?(n=n||Ke(ze(e),this.parent.activeViewOptions.interval-1),e.getFullYear()===n.getFullYear()?y(this.parent.globalize.formatDate(e,{format:"MMMM",calendar:this.parent.getCalendarMode()})+" - "+this.parent.globalize.formatDate(n,{format:"MMMM ",calendar:this.parent.getCalendarMode()})+this.parent.globalize.formatDate(n,{skeleton:"y",calendar:this.parent.getCalendarMode()}),"single"):y(this.parent.globalize.formatDate(e,{format:"MMMM",calendar:this.parent.getCalendarMode()})+" "+e.getFullYear()+" - "+this.parent.globalize.formatDate(n,{format:"MMMM ",calendar:this.parent.getCalendarMode()})+this.parent.globalize.formatDate(n,{skeleton:"y",calendar:this.parent.getCalendarMode()}),"single")):(r=this.parent.activeViewOptions.dateFormat||"MMMM y",y(this.parent.globalize.formatDate(e,{format:r,calendar:this.parent.getCalendarMode()}),"single"))):this.formatDateRange(!B.isNullOrUndefined(t)&&0<t.length?t[0]:this.parent.selectedDate)},b.prototype.getLabelText=function(e){e=e.charAt(0).toLowerCase()+e.substring(1);return this.formatViewLabel(e,this.getStartDate(),this.getEndDate())},b.prototype.createWeekNumberElement=function(e){var t=B.createElement("tr"),e=B.createElement("td",{className:gi,attrs:{title:e?this.parent.localeObj.getConstant("week")+" "+e:""},innerHTML:e||""});return t.appendChild(e),this.parent.trigger($,{elementType:"weekNumberCell",element:e}),t},b.prototype.unWireEvents=function(){var e=this.element.querySelector("."+A);e&&B.EventHandler.remove(e,"scroll",this.onContentScroll)},b.prototype.isCustomMonth=function(){return"Month"===this.parent.currentView&&(!B.isNullOrUndefined(this.parent.activeViewOptions.displayDate)||0<this.parent.activeViewOptions.numberOfWeeks)},b.prototype.getModuleName=function(){return"month"},b.prototype.destroy=function(){!this.parent||this.parent&&this.parent.isDestroyed?this.parent=null:this.element&&(this.monthEvent&&(this.monthEvent.destroy(),this.monthEvent=null),this.unWireEvents(),this.parent.resourceBase&&this.parent.resourceBase.destroy(),this.parent.scheduleTouchModule&&this.parent.scheduleTouchModule.resetValues(),Hl.prototype.destroy.call(this))};var Rl,Hl,Pl=b;function b(e){e=Hl.call(this,e)||this;return e.dayNameFormat="wide",e.viewClass="e-month-view",e.isInverseTableSelect=!1,e.monthEvent=null,e.monthDates={},e}jl=function(e,t){return(jl=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}jl(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(S,Nl=hs),S.prototype.getModuleName=function(){return"year"},S.prototype.renderLayout=function(e){this.parent.resourceBase&&this.parent.resourceBase.generateResourceLevels([{renderDates:this.parent.activeView.renderDates}]),this.setPanel(B.createElement("div",{className:Oi}));var t="Horizontal"===this.parent.activeViewOptions.orientation?"e-horizontal":"e-vertical",t=(B.addClass([this.element],[this.viewClass,t,e]),this.renderPanel(e),this.parent.activeViewOptions.allowVirtualScrolling&&B.addClass([this.element],[Ar]),this.createTableLayout(Ei)),e=(this.element.appendChild(t),this.element.querySelector("table").setAttribute("role","presentation"),t.querySelector("tbody"));this.rowCount=this.getRowColumnCount("row"),this.columnCount=this.getRowColumnCount("column"),this.renderHeader(e),this.renderContent(e),"Year"!==this.parent.currentView&&this.parent.uiStateValues.isGroupAdaptive&&(this.generateColumnLevels(),this.renderResourceMobileLayout()),B.EventHandler.add(this.element.querySelector("."+A),"scroll",this.onContentScroll,this),this.parent.notify(Ve,{})},S.prototype.renderHeader=function(e){},S.prototype.renderContent=function(e){var t=B.createElement("tr"),e=(e.appendChild(t),B.createElement("td")),t=(t.appendChild(e),this.element.querySelector("tbody").appendChild(t),B.createElement("div",{className:A})),e=(e.appendChild(t),this.createTableLayout("e-calendar-table")),t=(t.appendChild(e),B.createElement("tr")),e=(e.querySelector("tbody").appendChild(t),B.createElement("td")),i=(t.appendChild(e),B.createElement("div",{className:"e-calendar-wrapper"}));e.appendChild(i);for(var n=0,r=this.getMonths();n<r.length;n++){var a=r[n],a=new Date(this.parent.selectedDate.getFullYear(),a,1),s=B.createElement("div",{className:"e-month-calendar e-calendar",attrs:{"data-role":"calendar"}});s.appendChild(this.renderCalendarHeader(a)),s.appendChild(this.renderCalendarContent(a)),i.appendChild(s)}this.renderDates.splice(0,1)},S.prototype.renderCalendarHeader=function(e){var t,i=B.createElement("div",{className:"e-header e-month"}),n=B.createElement("div",{className:"e-day e-title"});return this.parent.activeViewOptions.monthHeaderTemplate?(t={date:e,type:"monthHeader"},this.renderTemplates(this.parent.getMonthHeaderTemplate(),t,"monthHeaderTemplate",this.parent.activeViewOptions.monthHeaderTemplateName,n)):n.innerHTML=this.getMonthName(e),i.appendChild(n),this.parent.trigger($,{elementType:"headerCells",element:n,date:e}),i},S.prototype.renderCalendarContent=function(e){var t=this.getMonthDates(e),i=B.createElement("div",{className:"e-content e-month"}),n=this.createTableLayout("e-calendar-table "+C),r=(i.appendChild(n),this.setAriaAttributes(n),B.createElement("thead",{className:"e-week-header"})),a=B.createElement("tr"),s=Ue(We(e),this.parent.activeViewOptions.firstDayOfWeek);this.parent.activeViewOptions.showWeekNumber&&a.appendChild(B.createElement("th"));for(var o=0;o<7;o++){this.parent.activeViewOptions.dayHeaderTemplate?(l=B.createElement("th"),m={date:s,type:"dayHeader"},this.renderTemplates(this.parent.getDayHeaderTemplate(),m,"dayHeaderTemplate",this.parent.activeViewOptions.dayHeaderTemplateName,l),a.appendChild(l)):a.appendChild(B.createElement("th",{innerHTML:this.parent.getDayNames("narrow")[s.getDay()]}));var l=new Date(s.getTime()+W),s=l.getDate()===s.getDate()?Y(l,1):l}r.appendChild(a),B.prepend([r],n);for(var p=n.querySelector("tbody");0<t.length;){var c,h=t.splice(0,7),d=B.createElement("tr");this.parent.activeViewOptions.showWeekNumber&&(c=this.parent.getWeekNumberContent(h),f=B.createElement("td",{className:"e-week-number",attrs:{title:this.parent.localeObj.getConstant("week")+" "+c},innerHTML:c}),d.appendChild(f),this.parent.trigger($,{elementType:"weekNumberCells",element:f}));for(var u=0,g=h;u<g.length;u++){var m,v=g[u],f=B.createElement("td",{className:"e-cell "+O,attrs:{"data-date":v.getTime().toString()}}),y=(this.parent.activeViewOptions.cellHeaderTemplate?(m={date:v,type:"monthCells"},this.renderTemplates(this.parent.getCellHeaderTemplate(),m,"cellHeaderTemplate",this.parent.activeViewOptions.cellHeaderTemplateName,f)):(y=B.createElement("span",{className:"e-day",innerHTML:this.parent.globalize.formatDate(v,{skeleton:"d",calendar:this.parent.getCalendarMode()}),attrs:{title:this.parent.globalize.formatDate(v,{type:"date",skeleton:"full"})}}),f.appendChild(y)),this.parent.activeViewOptions.cellTemplate&&(m={date:v,type:"monthCells"},this.renderTemplates(this.parent.getCellTemplate(),m,"cellTemplate",this.parent.activeViewOptions.cellTemplateName,f)),[]);e.getMonth()!==v.getMonth()&&(y.push(E),f.firstElementChild)&&!this.parent.activeViewOptions.cellTemplate&&f.firstElementChild.setAttribute("aria-disabled","true"),0<(y=this.isCurrentDate(v)&&e.getMonth()===v.getMonth()?y.concat(["e-today","e-selected"]):y).length&&B.addClass([f],y),d.appendChild(f),e.getMonth()===v.getMonth()&&this.renderDates.push(new Date(v)),this.parent.isMinMaxDate(v)?(B.EventHandler.add(f,"click",this.onCellClick,this),this.parent.isAdaptive||B.EventHandler.add(f,"dblclick",this.parent.workCellAction.cellDblClick,this.parent.workCellAction)):B.addClass([f],yr),this.parent.trigger($,{elementType:"workCells",element:f,date:v})}p.appendChild(d)}return i},S.prototype.createTableColGroup=function(e){for(var t=B.createElement("colgroup"),i=0;i<e;i++)t.appendChild(B.createElement("col"));return t},S.prototype.getMonthName=function(e){return y(this.parent.globalize.formatDate(e,{format:this.parent.activeViewOptions.dateFormat||"MMMM y",calendar:this.parent.getCalendarMode()}),"multiple")},S.prototype.generateColumnLevels=function(){var e,t=[],i=this.getDateSlots([this.parent.selectedDate],this.parent.activeViewOptions.workDays);return 0<this.parent.activeViewOptions.group.resources.length?(t=this.parent.resourceBase.generateResourceLevels(i),this.parent.uiStateValues.isGroupAdaptive&&(e=this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex],t=[this.getDateSlots([this.parent.selectedDate],e.workDays)])):t.push(i),t.pop(),this.colLevels=t},S.prototype.getDateSlots=function(e,t,i,n){return void 0===i&&(i=this.parent.workHours.start),void 0===n&&(n=this.parent.workHours.end),[{date:e[0],type:"dateHeader",className:[It],colSpan:1,workDays:t,startHour:new Date(+this.parent.globalize.parseDate(i,{skeleton:"Hm"})),endHour:new Date(+this.parent.globalize.parseDate(n,{skeleton:"Hm"}))}]},S.prototype.getMonthDates=function(e){for(var e=Ue(We(e),this.parent.activeViewOptions.firstDayOfWeek),t=Y(new Date(+e),42),i=[],n=e;n.getTime()<t.getTime();n=Y(n,1))i.push(z(new Date(n)));return i},S.prototype.getRowColumnCount=function(e){for(var t=this.getMonths(),i=this.parent.selectedDate.getFullYear(),n=[],r=0,a=t;r<a.length;r++){var s=a[r];n.push(new Date(i,s,1).getDay()+new Date(i,s+1,0).getDate())}var o=Math.max.apply(Math,n),e="row"===e?"Horizontal"===this.parent.activeViewOptions.orientation?t.length:o:"Horizontal"===this.parent.activeViewOptions.orientation?o:t.length;return e},S.prototype.isCurrentDate=function(e){return z(new Date).getTime()===z(new Date(e.getTime())).getTime()},S.prototype.getMonths=function(){var i=this;return Array.apply(null,{length:this.parent.activeViewOptions.monthsCount}).map(function(e,t){return i.parent.firstMonthOfYear+t})},S.prototype.renderTemplates=function(e,t,i,n,r){n=this.parent.element.id+"_"+n+i,e=[].slice.call(e(t,this.parent,i,n,!1,void 0,void 0,this.parent.root));B.append(e,r)},S.prototype.onCellClick=function(e){var t,i=B.closest(e.target,"."+O),n=this.parent.getDateFromElement(i),r=(this.parent.activeCellsData=this.parent.getCellDetails(i),n.getTime()<this.getStartDate().getTime());r||n.getTime()>this.getEndDate().getTime()?(this.parent.changeDate(this.parent.activeView.getNextPreviousDate(r?"Previous":"Next"),e),t=(t=this.parent.activeCellsData.startTime.getTime())>=this.getStartDate().getTime()&&t<=this.getEndDate().getTime()?t:(r?this.getEndDate():this.getStartDate()).getTime(),r=this.parent.element.querySelector(":not(."+E+')[data-date="'+t+'"]'),this.parent.selectCell(r),this.parent.activeCellsData=this.parent.getCellDetails(r)):(t=Y(new Date(n.getTime()),1),r={date:n,event:this.parent.eventBase.filterEvents(n,t),element:e.target},i.classList.contains(E)&&(i=this.parent.element.querySelector(":not(."+E+')[data-date="'+i.getAttribute("data-date")+'"]')),this.parent.activeCellsData=this.parent.getCellDetails(i),n=B.extend(this.parent.activeCellsData,{cancel:!1,event:e,name:"cellClick"}),this.parent.trigger(q,n),this.parent.quickPopup.moreEventClick(r,t))},S.prototype.onContentScroll=function(e){var t=e.target,i=this.getDatesHeaderElement(),i=(this.parent.notify(Ie,e),i&&(i.firstElementChild.scrollLeft=t.scrollLeft),this.element.querySelector(".e-month-header-wrapper,.e-resource-column-wrap"));i&&(i.scrollTop=t.scrollTop),this.parent.isAdaptive||(this.parent.uiStateValues.top=e.target.scrollTop),this.parent.uiStateValues.left=e.target.scrollLeft,this.setPersistence()},S.prototype.onScrollUiUpdate=function(e){var t=this.parent.element.offsetHeight-this.getHeaderBarHeight(),i=this.element.querySelector("."+At),n=(i&&(t-=i.offsetHeight),this.element.querySelector("."+A)),r=(n&&(n.style.height=B.formatUnit(t)),!this.parent.isAdaptive&&i&&(r=rt(),0<n.offsetWidth-n.clientWidth?(i.firstElementChild.style[e.cssProperties.border]=0<r?"1px":"0px",i.style[e.cssProperties.padding]=0<r?r-1+"px":"0px"):(i.firstElementChild.style[e.cssProperties.border]="",i.style[e.cssProperties.padding]="")),this.setColWidth(this.getContentAreaElement()),this.element.querySelector(".e-month-header-wrapper,.e-resource-column-wrap"));r&&(i=n.scrollWidth>n.clientWidth,r.style.height=B.formatUnit(t-(i?17:0))),e.isPreventScrollUpdate||(this.parent.uiStateValues.isInitial?(this.parent.uiStateValues.isInitial=!1,this.parent.uiStateValues.top=this.parent.uiStateValues.left=0):(r&&(r.scrollTop=this.parent.uiStateValues.top),n.scrollTop=this.parent.uiStateValues.top,n.scrollLeft=this.parent.uiStateValues.left)),this.retainScrollPosition()},S.prototype.getStartDate=function(){return new Date(this.parent.selectedDate.getFullYear(),this.parent.firstMonthOfYear%12,1)},S.prototype.getEndDate=function(){return Y(Ke(this.getStartDate(),this.parent.monthsCount),-1)},S.prototype.startDate=function(){return"Year"===this.parent.currentView?Ue(this.getStartDate(),this.parent.activeViewOptions.firstDayOfWeek):this.getStartDate()},S.prototype.endDate=function(){return"Year"===this.parent.currentView?Y(Be(this.getEndDate(),this.parent.activeViewOptions.firstDayOfWeek),1):Y(this.getEndDate(),1)},S.prototype.getEndDateFromStartDate=function(e){e=new Date(e.getTime());return 0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive&&(e=ze(e)),Y(new Date(e.getTime()),1)},S.prototype.getNextPreviousDate=function(e){return Ze(this.parent.selectedDate,"Next"===e?1:-1)},S.prototype.getDateRangeText=function(e,t){void 0===e&&(e=this.parent.selectedDate);var i=!B.isNullOrUndefined(t=void 0===t?null:t)&&0<t.length,n=i?t[0]:this.getStartDate(),r=i?t[t.length-1]:this.getEndDate();return n.getFullYear()!==r.getFullYear()?this.parent.globalize.formatDate(n,{format:"MMM y",calendar:this.parent.getCalendarMode()})+" - "+this.parent.globalize.formatDate(r,{format:"MMM y",calendar:this.parent.getCalendarMode()}):this.parent.globalize.formatDate(i?t[0]:e,{skeleton:"y",calendar:this.parent.getCalendarMode()})},S.prototype.addEventListener=function(){this.parent.on(Me,this.onScrollUiUpdate,this),this.parent.on(Ee,this.onDataReady,this)},S.prototype.removeEventListener=function(){this.parent&&(this.parent.off(Me,this.onScrollUiUpdate),this.parent.off(Ee,this.onDataReady))},S.prototype.onDataReady=function(e){this.yearEventModule=new ml(this.parent),this.yearEventModule.renderAppointments(),this.parent.notify(xe,e)},S.prototype.scrollToDate=function(e){e=+new Date(z(e)),e=this.element.querySelector("."+O+":not(."+E+')[data-date="'+e+'"]');e&&(e=B.closest(e,".e-month-calendar"),this.getContentAreaElement().scrollTop=e.offsetTop)},S.prototype.destroy=function(){var e;!this.parent||this.parent&&this.parent.isDestroyed?this.parent=null:this.element&&((e=this.element.querySelector("."+A))&&B.EventHandler.remove(e,"scroll",this.onContentScroll),this.yearEventModule&&(this.yearEventModule.destroy(),this.yearEventModule=null),this.parent.resourceBase&&this.parent.resourceBase.destroy(),Nl.prototype.destroy.call(this))};var jl,Nl,Ll=S;function S(e){e=Nl.call(this,e)||this;return e.viewClass="e-year-view",e.isInverseTableSelect=!1,e.yearEventModule=null,e}ql=function(e,t){return(ql=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}ql(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Bl,Fl=hs),Bl.prototype.createAgendaContentElement=function(e,a,t,s,o){var i,l=this,p=this.parent.eventFields;return"noEvents"===e?(e=[{subject:this.parent.localeObj.getConstant("noEvents")}],0===(i=N.ListBase.createList(this.parent.createElement,e,{moduleName:"agenda",listClass:this.parent.activeView.viewClass,itemClass:this.parent.activeView.viewClass,template:B.initializeCSPTemplate(function(){return'<div class="'+Li+'">'+l.parent.localeObj.getConstant("noEvents")+"</div>"})})).querySelector(".e-agenda-item").children.length&&i.firstElementChild.appendChild(B.createElement("div",{className:Li,innerHTML:this.parent.localeObj.getConstant("noEvents")}))):(i=N.ListBase.createList(this.parent.createElement,a,{moduleName:"agenda",listClass:this.parent.activeView.viewClass,itemClass:this.parent.activeView.viewClass}),[].slice.call(i.children).forEach(function(t,e){var i,n=B.createElement("div",{className:V,attrs:{"data-id":"Appointment_"+a[parseInt(e.toString(),10)][""+l.parent.eventFields.id],"data-guid":a[parseInt(e.toString(),10)].Guid,role:"button",tabindex:"0","aria-disabled":l.parent.eventBase.getReadonlyAttribute(a[parseInt(e.toString(),10)]),"aria-label":l.parent.getAnnouncementString(a[parseInt(e.toString(),10)])}}),r=(B.isNullOrUndefined(o)||n.setAttribute("data-group-index",o.toString()),l.parent.eventBase.applyResourceColor(n,a[parseInt(e.toString(),10)],"borderColor",s),B.isNullOrUndefined(l.parent.activeViewOptions.eventTemplate)?i=l.createAppointment(a[parseInt(e.toString(),10)]):(B.addClass([n],"e-template"),r=l.parent.element.id+"_"+l.parent.activeViewOptions.eventTemplateName+"eventTemplate",i=l.parent.getAppointmentTemplate()(a[parseInt(e.toString(),10)],l.parent,"eventTemplate",r,!1,void 0,void 0,l.parent.root),B.isNullOrUndefined(a[parseInt(e.toString(),10)][p.recurrenceRule])||(r=a[parseInt(e.toString(),10)][p.id]===a[parseInt(e.toString(),10)][p.recurrenceID]?en:tn,n.appendChild(B.createElement("div",{className:Dt+" "+r})))),B.append([].slice.call(i),n),lt(t),t.appendChild(n),{data:B.extend({},a[parseInt(e.toString(),10)],null,!0),element:t,cancel:!1});l.parent.trigger(ie,r,function(e){e.cancel&&B.remove(t)})})),t.appendChild(i),("MonthAgenda"===this.parent.currentView&&0<this.parent.activeViewOptions.group.resources.length||"Agenda"===this.parent.currentView)&&B.addClass([t],ji),this.parent.renderTemplates(),t},Bl.prototype.createAppointment=function(e){var t=this.parent.eventFields,i=e[t.subject]||this.parent.eventSettings.fields.subject.default||this.parent.localeObj.getConstant("addTitle"),n=e[t.location]||this.parent.eventSettings.fields.location.default,r=B.createElement("div",{className:bi}),a=(B.isNullOrUndefined(n)||""===n||(i+=","),B.createElement("div",{className:Gn})),n=(this.parent.sanitize(i,a),r.appendChild(a),B.isNullOrUndefined(n)||""===n||(i=B.createElement("div",{className:Xn}),this.parent.sanitize(n,i),r.appendChild(i)),B.isNullOrUndefined(e[t.recurrenceRule])||(a=e[t.id]===e[t.recurrenceID]?en:tn,r.appendChild(B.createElement("div",{className:Dt+" "+a}))),e[t.startTime]),i=e[t.endTime],a=e[t.isAllDay],t=this.parent.localeObj.getConstant("allDay"),s=this.parent.getTimeString(n)+" - "+this.parent.getTimeString(i),i=(B.isNullOrUndefined(e.data)||(t=(1<=(i.getTimezoneOffset()!==n.getTimezoneOffset()?i.getTime()-n.getTime()+36e5:i.getTime()-n.getTime())/W?t:s)+" ("+this.parent.localeObj.getConstant("day")+" "+e.data.index+"/"+e.data.count+")"),!B.isNullOrUndefined(e.data)||a?t:s);return[r,B.createElement("div",{className:Ni,innerHTML:i})]},Bl.prototype.processAgendaEvents=function(e){var t=[];if(!B.isNullOrUndefined(e))for(var i=0,n=e;i<n.length;i++)var r=n[i],a=this.parent.eventBase.splitEventByDay(r),t=t.concat(1<a.length?a:r);return t},Bl.prototype.wireEventActions=function(){for(var e=0,t=[].slice.call(this.parent.element.querySelectorAll("."+V));e<t.length;e++){var i=t[e];this.parent.eventBase.wireAppointmentEvents(i,this.parent.getEventDetails(i),!0)}for(var n=0,r=[].slice.call(this.parent.element.querySelectorAll(".e-m-date"));n<r.length;n++){i=r[n];B.EventHandler.add(i,"click",this.parent.agendaModule.dayNavigationClick,this)}},Bl.prototype.calculateResourceTableElement=function(e,t,i,n){void 0===n&&(n=null),B.isNullOrUndefined(this.parent.resourceBase.lastResourceLevel)&&(l=this.getDateSlots(this.renderDates,this.parent.activeViewOptions.workDays),this.parent.resourceBase.generateResourceLevels(l));for(var r=Y(new Date(i.getTime()),t),a=this.parent.activeViewOptions.group.byDate||"MonthAgenda"===this.parent.currentView?t:1,s=this.parent.resourceBase.resourceCollection,o=this.parent.resourceBase.lastResourceLevel,l=i,p=i,c=this.parent.activeViewOptions.showWeekend,h=0;h<a;h++){var d,u=[],g=[],m=0,v=Y(p,h);if("Agenda"===this.parent.currentView&&this.parent.activeViewOptions.group.byDate&&this.parent.activeViewOptions.allowVirtualScrolling&&!c&&!this.isWorkDay(v)){do{if(n<=(v=Y(v,1)))break}while(!this.isWorkDay(v)||this.parent.eventBase.filterEvents(v,Y(v,1)).length<1);if(n<=v)break;p=Y(v,-h),r=Y(v,1)}var f=this.parent.activeViewOptions.group.byDate||"MonthAgenda"===this.parent.currentView?Y(v,1):r,y=this.parent.eventBase.filterEvents(v,f);if(0<y.length||!this.parent.hideEmptyAgendaDays||"MonthAgenda"===this.parent.currentView){for(var T=0;T<o.length;T++){t=this.parent.activeViewOptions.group.byDate&&"MonthAgenda"!==this.parent.currentView?1:t;var w=[],D=(i=v,this.parent.eventBase.filterEvents(i,r,y,o[parseInt(T.toString(),10)]));if(0<D.length||!this.parent.hideEmptyAgendaDays||"MonthAgenda"===this.parent.currentView)for(var b=0;b<t;b++){var S=this.parent.eventBase.filterEvents(i,Y(i,1),D,void 0);if(((c||!c&&(this.parent.group.byDate?this.isWorkDay(i):this.isWorkDay(i,o[parseInt(T.toString(),10)].workDays)))&&(0<S.length||!this.parent.hideEmptyAgendaDays)||"MonthAgenda"===this.parent.currentView)&&(w.push(S[0]),S={rowSpan:1,type:"eventColumn",resource:s[s.length-1],groupIndex:o[parseInt(T.toString(),10)].groupIndex,groupOrder:o[parseInt(T.toString(),10)].groupOrder,resourceData:o[parseInt(T.toString(),10)].resourceData,eventData:S,date:i},d={rowSpan:1,type:"dateColumn",resource:s[parseInt((s.length-1).toString(),10)],groupOrder:o[parseInt(T.toString(),10)].groupOrder,resourceData:o[parseInt(T.toString(),10)].resourceData,date:i,groupIndex:o[parseInt(T.toString(),10)].groupIndex},u[parseInt(m.toString(),10)]||(u[parseInt(m.toString(),10)]=[]),u[parseInt(m.toString(),10)].push(S),u[parseInt(m.toString(),10)].push(d),m++),(i=Y(i,1)).getTime()>=r.getTime()||this.parent.activeViewOptions.group.byDate||"MonthAgenda"===this.parent.currentView){0<w.length&&(u[u.length-1][1].cssClass=ji,S={rowSpan:w.length,type:"resourceColumn",resource:s[parseInt((s.length-1).toString(),10)],groupOrder:o[parseInt(T.toString(),10)].groupOrder.slice(0,-1),resourceData:o[parseInt(T.toString(),10)].resourceData,groupIndex:u.length-w.length,className:[Si],date:i},u[parseInt((u.length-w.length).toString(),10)].push(S),g.push(B.extend({},S,null,!0)));break}}}for(var C=s.slice(0,-1),O=[],E=0,x=0;x<C.length;x++)for(var w=C[C.length-(x+1)].dataSource,V=0;V<w.length;V++)for(var A=0,I=0;I<g.length;I++)g[parseInt(I.toString(),10)].groupOrder[C.length-(x+1)]===w[parseInt(V.toString(),10)][C[C.length-(x+1)].idField]&&(E+=g[parseInt(I.toString(),10)].rowSpan,O.push(B.extend({},g[parseInt(I.toString(),10)],null,!0))),++A===g.length&&0<O.length&&(O[0].rowSpan=E,O[0].type="parentColumnLevel_"+(x+1),O[0].resource=C[C.length-(x+1)],O[0].resourceData=w[parseInt(V.toString(),10)],O[0].date=i,u[O[0].groupIndex].push(O[0]),O=[],E=0);this.createResourceTableRow(u,e)}}0===this.parent.eventBase.filterEvents(l,r).length&&!this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.hideEmptyAgendaDays&&this.renderEmptyContent(e,l)},Bl.prototype.createResourceTableRow=function(e,t){var i,n=B.createElement("tr"),r=B.createElement("td"),a=0;if(this.parent.activeViewOptions.group.byDate||"MonthAgenda"===this.parent.currentView){for(var s=[],o=this.parent.resourceBase.resourceCollection.slice(0,-1),l=0;l<e.length;l++)s=s.concat(e[parseInt(l.toString(),10)]);for(var p=0<o.length?"parentColumnLevel_"+o.length:"resourceColumn",c=s.filter(function(e){return e.type===p}),h=0;h<c.length;h++)a+=c[parseInt(h.toString(),10)].rowSpan}for(var d=0;d<e.length;d++){for(var u=n.cloneNode(),g=e[parseInt(d.toString(),10)].length-1;0<=g;g--){var m=e[parseInt(d.toString(),10)][parseInt(g.toString(),10)],v=r.cloneNode();if("dateColumn"===m.type)this.parent.activeViewOptions.group.byDate||"MonthAgenda"===this.parent.currentView?i=e[parseInt(d.toString(),10)][parseInt(g.toString(),10)]:(v.setAttribute("data-date",m.date.getTime().toString()),v.appendChild(this.createDateHeaderElement(m.date,m.groupIndex)),f=[Vi,Ri],m.cssClass&&f.push(m.cssClass),B.addClass([v],f),this.isCurrentDate(new Date(m.date.getTime()))&&B.addClass(v.childNodes,Ai),u.appendChild(v));else if("eventColumn"===m.type){for(var f=0===m.eventData.length?"noEvents":"data",y=0;y<u.childNodes.length;y++){var T=u.childNodes.item(y),w=T.classList.contains("e-resource-column")?Te:we;this.parent.trigger($,{elementType:w,element:T,date:m.date,groupIndex:m.groupIndex})}(v=this.createAgendaContentElement(f,m.eventData,v,m.groupOrder,m.groupIndex)).setAttribute("data-date",m.date.getTime().toString()),!this.parent.activeViewOptions.group.byDate&&"MonthAgenda"!==this.parent.currentView||B.addClass([v],[Vi,"e-day-padding"]),u.appendChild(v);var D=0===m.eventData.length?fe:ye;this.parent.trigger($,{elementType:D,element:v,date:m.date,groupIndex:m.groupIndex})}else v.setAttribute("rowspan",m.rowSpan.toString()),B.addClass([v],"e-resource-column"),this.setResourceHeaderContent(v,m,m.className[0]),u.appendChild(v)}if(this.parent.activeViewOptions.group.byDate&&0===d&&"MonthAgenda"!==this.parent.currentView){(v=r.cloneNode()).setAttribute("data-date",i.date.getTime().toString()),v.setAttribute("rowspan",a.toString()),v.appendChild(this.createDateHeaderElement(i.date)),B.addClass([v],[Vi,Ri,"e-date-border"]);var b=et(this.parent.selectedDate.getTime(),i.date.getTime());if(u.setAttribute("data-row-index",b.toString()),this.parent.element.querySelector('.e-agenda-view tr[data-row-index="'+b+'"]'))break;u.insertBefore(v,u.childNodes[0])}t.appendChild(u)}},Bl.prototype.createDateHeaderElement=function(e,t){var i,n;return this.parent.activeViewOptions.dateHeaderTemplate?(i=B.createElement("div",{className:ki}),t={date:e,type:"dateHeader",groupIndex:t},n=this.parent.element.id+"_"+this.parent.activeViewOptions.dateHeaderTemplateName+"dateHeaderTemplate",t=[].slice.call(this.parent.getDateHeaderTemplate()(t,this.parent,"dateHeaderTemplate",n,!1,void 0,void 0,this.parent.root)),B.append(t,i)):i=this.getMobileDateElement(e,ki),i},Bl.prototype.renderEmptyContent=function(e,t,i){var n=this.createTableRowElement(t,"noEvents"),r=n.children[0],a=B.createElement("div",{className:"e-empty-event",innerHTML:this.parent.localeObj.getConstant("noEvents")});r.appendChild(a),e.appendChild(n),i&&this.parent.trigger($,{elementType:fe,element:r,date:t})},Bl.prototype.createTableRowElement=function(e,t){var i=et(this.parent.selectedDate.getTime(),e.getTime()),n=B.createElement("tr",{attrs:{"data-row-index":i.toString()}}),i=B.createElement("td",{attrs:{class:"monthHeader"===t?Mi:Vi,"aria-selected":"false","data-column-index":i.toString(),"data-date":e.getTime().toString()}}),e=i.cloneNode(),i=i.cloneNode();return n.appendChild(e),"noEvents"!==t&&n.appendChild(i),n},Bl.prototype.destroy=function(){Fl.prototype.destroy.call(this)};var ql,Fl,Ul=Bl;function Bl(e){return Fl.call(this,e)||this}Wl=function(e,t){return(Wl=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}Wl(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(I,zl=Ul),I.prototype.getModuleName=function(){return"agenda"},I.prototype.renderLayout=function(){this.agendaDates={},this.element=B.createElement("div",{className:Oi}),B.addClass([this.element],this.viewClass),this.element.appendChild(this.createTableLayout(Ei)),this.element.querySelector("table").setAttribute("role","presentation"),this.parent.element.querySelector("."+St).appendChild(this.element);var e=B.createElement("tr"),t=(this.element.querySelector("tbody").appendChild(e),B.createElement("td")),e=(e.appendChild(t),B.createElement("div",{className:A})),t=(t.appendChild(e),this.createTableLayout(C)),e=(this.setAriaAttributes(t),e.appendChild(t),t.querySelector("tbody")),t=z(this.parent.selectedDate);this.renderEmptyContent(e,t),this.wireEvents(),this.parent.resourceBase&&this.parent.resourceBase.generateResourceLevels([{renderDates:this.parent.activeView.renderDates}]),this.parent.uiStateValues.isGroupAdaptive&&!this.parent.element.querySelector("."+pi)&&this.renderResourceMobileLayout(),this.parent.notify(Ve,{})},I.prototype.eventLoad=function(e){this.dataSource=B.extend([],this.parent.eventsData,null,!0);for(var t=0,i=this.parent.eventsData;t<i.length;t++)delete i[t].generatedDates;var e=this.parent.activeViewOptions.allowVirtualScrolling?e.processedData:this.parent.eventsProcessed,n=(this.parent.uiStateValues.isGroupAdaptive&&(n=this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex],this.dataSource=this.parent.eventBase.filterEventsByResource(n,this.dataSource),e=this.parent.eventBase.filterEventsByResource(n,e)),this.parent.eventsProcessed=this.processAgendaEvents(e),z(this.parent.selectedDate)),e=this.element.querySelector("."+C+" tbody"),r=B.closest(e,"."+A),a=r.scrollTop;lt(e),this.renderInitialContent(e,n),this.wireEventActions(),r.scrollTop=a,this.parent.notify(xe,{}),this.parent.activeViewOptions.allowVirtualScrolling||this.retainScrollPosition()},I.prototype.refreshEvent=function(e){for(var t=[],i=this.parent.eventFields,n=0,r=this.dataSource;n<r.length;n++){var a=r[n];B.isNullOrUndefined(a[i.recurrenceID])&&!B.isNullOrUndefined(a[i.recurrenceRule])&&!B.isNullOrUndefined(a.generatedDates)&&e>=a.generatedDates.end&&(t=t.concat(this.parent.eventBase.generateOccurrence(a,e)))}this.parent.eventsProcessed=this.parent.eventsProcessed.concat(this.processAgendaEvents(t))},I.prototype.refreshHeader=function(){var e=this.element.querySelector("."+C+" tbody"),t=(this.parent.activeViewOptions.group.byDate?lt(e):B.remove(e.firstElementChild),z(this.parent.selectedDate)),i=B.createElement("tbody"),t=new Date(t.getTime()),n=this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.hideEmptyAgendaDays?this.getEndDateFromStartDate(t):Y(t,this.parent.agendaDaysCount);this.renderContent(i,t,n),B.append([].slice.call(i.childNodes),e)},I.prototype.renderInitialContent=function(e,t){var i=B.createElement("tbody"),n=new Date(t.getTime()),r=this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.hideEmptyAgendaDays?this.getEndDateFromStartDate(n):Y(n,this.parent.agendaDaysCount);if(this.renderContent(i,n,r),B.append([].slice.call(i.childNodes),e),this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.hideEmptyAgendaDays&&0<this.parent.eventsData.length)for(var a=this.getContentAreaElement(),s=a.querySelector(".e-content-table");a.offsetWidth<=a.clientWidth&&!(this.parent.isAdaptive&&s.offsetHeight>=a.clientHeight);){var o=B.createElement("tbody"),n=Y(r=n,-this.parent.agendaDaysCount);if(this.renderContent(o,n,r),B.prepend([].slice.call(o.childNodes),e),n<=this.parent.minDate)break}e.childNodes.length<=0&&this.renderEmptyContent(e,t,!0)},I.prototype.renderContent=function(e,t,i){var n,r=this.parent.eventFields,a=new Date(t.getTime()),s=this.appointmentFiltering(a,i);if(0<s.length&&this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.hideEmptyAgendaDays)if(this.parent.activeViewOptions.showWeekend||this.isAgendaWorkDay(s[0][r.startTime]))t=new Date(new Date(s[0][r.startTime].getTime()).setHours(0,0,0,0)),this.updateHeaderText(s[0][r.startTime]);else for(var o=0,l=s;o<l.length;o++){var p=l[o];if(this.isAgendaWorkDay(p[r.startTime])){t=new Date(new Date(p[r.startTime].getTime()).setHours(0,0,0,0)),this.updateHeaderText(p[r.startTime]);break}}if(!this.parent.hideEmptyAgendaDays||0<this.parent.agendaDaysCount&&0<s.length){if(0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive){s=t;this.parent.activeViewOptions.group.byDate||(this.parent.activeViewOptions.allowVirtualScrolling=!1,s=a,this.parent.headerModule&&(this.parent.headerModule.updateDateRange(),this.parent.headerModule.updateHeaderItems("remove"))),this.calculateResourceTableElement(e,this.parent.agendaDaysCount,s,i)}else for(var c=0;c<this.parent.agendaDaysCount;c++){var h=this.createTableRowElement(t,"data"),d=this.element.querySelector('tr[data-row-index="'+ +h.dataset.rowIndex+'"]');if(d||!this.parent.activeViewOptions.showWeekend&&!this.isAgendaWorkDay(t)){if(t=Y(t,1),!d&&this.parent.activeViewOptions.allowVirtualScrolling&&c--,t.getTime()>i.getTime())break}else{var u,d=h.children[0],g=h.children[1],m=this.appointmentFiltering(t);if(0<m.length||!this.parent.hideEmptyAgendaDays&&0===m.length?(u=this.parent.hideEmptyAgendaDays||0!==m.length?"data":"noEvents",d.appendChild(this.createDateHeaderElement(t)),h.appendChild(d),this.parent.trigger($,{elementType:we,element:d,date:t}),u=this.createAgendaContentElement(u,m,g),h.appendChild(u),0<u.querySelectorAll("li").length&&e.appendChild(h),g=this.parent.hideEmptyAgendaDays||0!==m.length?ye:fe,this.parent.trigger($,{elementType:g,element:u,date:t})):this.parent.activeViewOptions.allowVirtualScrolling&&c--,this.isCurrentDate(new Date(t.getTime()))&&B.addClass(d.childNodes,Ai),(t=Y(t,1)).getTime()>i.getTime())break}}n=new Date(t.getTime()-W)}this.agendaDates={start:a,end:n}},I.prototype.isAgendaWorkDay=function(e){return this.parent.uiStateValues.isGroupAdaptive&&!this.parent.group.byDate?this.isWorkDay(e,this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex].workDays):this.isWorkDay(e)},I.prototype.agendaScrolling=function(e){this.parent.quickPopup&&this.parent.quickPopup.quickPopupHide(),this.parent.activeViewOptions.allowVirtualScrolling&&this.virtualScrolling(e),this.parent.activeViewOptions.allowVirtualScrolling||this.setPersistence()},I.prototype.virtualScrolling=function(e){var t,i=e.target,n=i.scrollTop,r=i.scrollHeight,a=n+i.clientHeight,s=this.virtualScrollTop<n?"next":"previous",o=i.querySelector("tbody"),l=B.createElement("tbody"),p=this.getElementFromScrollerPosition(e),e=this.parent.getDateFromElement(p);if(0===n){if(t=this.getPreviousNextDate(Y(e,-1),s),0<this.appointmentFiltering(t.start,t.end).length||!this.parent.hideEmptyAgendaDays){this.renderContent(l,t.start,t.end),B.prepend([].slice.call(l.childNodes),o),this.wireEventActions();for(var c=0,h=o.children;c<h.length;c++)if(h[parseInt(c.toString(),10)].getAttribute("data-row-index")===p.getAttribute("data-column-index")){var d=h[parseInt(c.toString(),10)].offsetTop-this.element.querySelector(".e-agenda-item").offsetHeight;i.scrollTop=d;break}this.updateHeaderText(e)}}else r-5<=a?(t=this.getPreviousNextDate(Y(e,1),s),(0<this.appointmentFiltering(t.start,t.end).length||!this.parent.hideEmptyAgendaDays)&&(this.renderContent(l,t.start,t.end),B.append([].slice.call(l.childNodes),o),this.wireEventActions(),this.updateHeaderText(e))):this.updateHeaderText(e);this.virtualScrollTop=n;r=this.parent.eventBase.getSelectedAppointments();0<r.length&&r[r.length-1].focus()},I.prototype.getElementFromScrollerPosition=function(e){var t,i,e=e.target,n=e.scrollTop,r=e.scrollHeight,a=n+e.clientHeight,s=[].slice.call(e.querySelectorAll(".e-agenda-item"));if(0<s.length)if(0===n)i=s[0],t=B.closest(i,"."+Vi);else if(a===r)i=s[s.length-1],t=B.closest(i,"."+Vi);else for(var o=0,l=s.length;o<l;o++)if(0<=(i=s[parseInt(o.toString(),10)]).getBoundingClientRect().top){t=B.closest(i,"."+Vi);break}return t},I.prototype.updateHeaderText=function(e){this.parent.showHeaderBar&&this.parent.headerModule.updateDateRange(e)},I.prototype.getPreviousNextDate=function(e,t){var i=new Date(e.getTime()),n=this.getStartDateFromEndDate(e),r=this.getEndDateFromStartDate(e),a=0;do{}while(((this.parent.activeViewOptions.showWeekend||!this.parent.activeViewOptions.showWeekend&&this.isAgendaWorkDay(i))&&(0<this.appointmentFiltering(i).length||!this.parent.hideEmptyAgendaDays)&&a++,!((i=Y(i,"next"===t?1:-1))<n||r<i))&&a!==this.parent.agendaDaysCount);var s=Y(i,"next"===t?-1:1);return"next"===t?{start:e,end:Y(s,1)}:{start:s,end:Y(e,1)}},I.prototype.appointmentFiltering=function(e,t){var i,n,r=this,t=!B.isNullOrUndefined(e)&&B.isNullOrUndefined(t)?(i=z(new Date(e.getTime())),Ge(new Date(i.getTime()),W)):(i=new Date(e.getTime()),new Date(t.getTime())),a=this.parent.eventBase.filterEvents(i,t);return 0===a.length&&(this.refreshEvent(e),a=this.parent.eventBase.filterEvents(i,t)),B.isNullOrUndefined(this.parent.minDate)&&B.isNullOrUndefined(this.parent.maxDate)||(n=this.parent.eventFields,a=a.filter(function(e){var t=e[n.startTime],e=e[n.endTime];return!(t.getTime()<r.parent.minDate.getTime()||e.getTime()>Y(r.parent.maxDate,1).getTime())})),a},I.prototype.getStartDateFromEndDate=function(e){var t,i=this.parent.eventFields;return z(0<this.parent.eventsProcessed.length?(t=Math.min.apply(Math,this.parent.eventsProcessed.map(function(e){return e[i.startTime].getTime()})),this.parent.hideEmptyAgendaDays?new Date(t):this.parent.minDate):this.parent.hideEmptyAgendaDays?Ke(e,-1):this.parent.minDate)},I.prototype.getEndDateFromStartDate=function(e){var t,i=this.parent.eventFields;return z(Y(0<this.parent.eventsProcessed.length?(t=Math.max.apply(Math,this.parent.eventsProcessed.map(function(e){return e[i.endTime].getTime()})),this.parent.hideEmptyAgendaDays?new Date(t):this.parent.maxDate):this.parent.hideEmptyAgendaDays?Ke(e,1):this.parent.maxDate,1))},I.prototype.getNextPreviousDate=function(e){return Y(this.parent.selectedDate,"Next"===e?1:-1)},I.prototype.startDate=function(){return z(this.parent.selectedDate)},I.prototype.endDate=function(){return this.parent.activeViewOptions.allowVirtualScrolling?this.getEndDateFromStartDate(this.startDate()):Y(this.startDate(),this.parent.agendaDaysCount)},I.prototype.getDateRangeText=function(e){var t=this.parent.activeViewOptions.dateFormat||"MMMM y";return this.parent.activeViewOptions.allowVirtualScrolling||this.parent.isAdaptive?(e=B.isNullOrUndefined(e)?this.parent.selectedDate:e,y(this.parent.globalize.formatDate(e,{format:t,calendar:this.parent.getCalendarMode()}),"multiple")):(t=Y(e=this.parent.selectedDate,this.parent.agendaDaysCount-1),this.formatDateRange(e,t))},I.prototype.dayNavigationClick=function(e){var t=B.closest(e.currentTarget,"."+Vi),t=this.parent.getDateFromElement(t);B.isNullOrUndefined(t)||this.parent.isAdaptive||!this.parent.isMinMaxDate(t)||(this.parent.setProperties({selectedDate:t},!0),this.parent.changeView("Day",e))},I.prototype.wireEvents=function(){B.EventHandler.add(this.element.querySelector("."+A),Ae,this.agendaScrolling,this)},I.prototype.unWireEvents=function(){B.EventHandler.remove(this.element.querySelector("."+A),Ae,this.agendaScrolling);for(var e=0,t=[].slice.call(this.element.querySelectorAll(".e-m-date"));e<t.length;e++){var i=t[e];B.EventHandler.remove(i,"click",this.dayNavigationClick)}},I.prototype.addEventListener=function(){this.parent.on(Me,this.onAgendaScrollUiUpdate,this),this.parent.on(Ee,this.eventLoad,this)},I.prototype.removeEventListener=function(){this.parent&&(this.parent.off(Me,this.onAgendaScrollUiUpdate),this.parent.off(Ee,this.eventLoad))},I.prototype.onAgendaScrollUiUpdate=function(){var e=this.getHeaderBarHeight(),t=(this.parent.headerModule&&(this.parent.activeViewOptions.allowVirtualScrolling?this.parent.headerModule.updateHeaderItems("add"):this.parent.headerModule.updateHeaderItems("remove")),this.element.querySelector("."+A));"auto"!==this.parent.height&&(t.style.height=B.formatUnit(this.parent.element.offsetHeight-e))},I.prototype.scrollToDate=function(e){var e=new Date(+z(e));this.parent.activeViewOptions.allowVirtualScrolling?(!this.parent.hideEmptyAgendaDays||0<this.parent.getEvents(e,Y(e,1),!0).length)&&this.parent.changeDate(e):(e=this.element.querySelector("."+Vi+'[data-date="'+e.getTime()+'"]'))&&(this.getContentAreaElement().scrollTop=e.offsetTop)},I.prototype.destroy=function(){!this.parent||this.parent&&this.parent.isDestroyed?this.parent=null:this.element&&(this.unWireEvents(),this.parent.resourceBase&&this.parent.resourceBase.destroy(),this.parent.headerModule&&this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.headerModule.updateHeaderItems("remove"),zl.prototype.destroy.call(this))};var Wl,zl,Yl=I;function I(e){e=zl.call(this,e)||this;return e.viewClass="e-agenda-view",e.isInverseTableSelect=!1,e.agendaDates={},e.virtualScrollTop=1,e}_l=function(e,t){return(_l=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}_l(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Ql,Gl=Pl),Ql.prototype.getModuleName=function(){return"monthAgenda"},Ql.prototype.renderAppointmentContainer=function(){var e=this.getContentAreaElement(),t=B.createElement("div",{className:vi}),e=(e.appendChild(t),B.createElement("div",{className:mi}));t.appendChild(e),this.appendAppContainer(e),this.setEventWrapperHeight()},Ql.prototype.getDayNameFormat=function(){return this.parent.isAdaptive?"narrow":"abbreviated"},Ql.prototype.updateSelectedCellClass=function(e){z(e.date).getTime()===z(new Date(""+this.parent.selectedDate)).getTime()&&e.className.push(di)},Ql.prototype.setEventWrapperHeight=function(){var e=(this.parent.headerModule?this.parent.headerModule.getHeaderElement().offsetHeight:0)+2,t=this.parent.element.querySelector("."+hi),t=(t&&(e+=t.offsetHeight),this.getContentAreaElement().firstElementChild),i=this.element.querySelector("."+Vt),e=this.parent.element.offsetHeight-e-i.offsetHeight,i=1<this.parent.activeViewOptions.interval?Math.round(.8*e):t.offsetHeight,e=e-i,n=this.element.querySelector("."+vi),r=this.element.querySelector("."+mi);"auto"!==this.parent.height&&(1<this.parent.activeViewOptions.interval&&(t.style.height=B.formatUnit(i),B.EventHandler.add(t,"scroll",this.onContentScroll,this)),n.style.height=r.style.height=B.formatUnit(e))},Ql.prototype.onDataReady=function(e){this.setEventWrapperHeight(),this.clearElements();for(var t,e=e.processedData,i=(this.parent.uiStateValues.isGroupAdaptive&&(t=this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex],e=this.parent.eventBase.filterEventsByResource(t,e)),this.agendaBase=this.getAgendaBase(),this.parent.eventsProcessed=this.agendaBase.processAgendaEvents(e),0),n=0,r=this.renderDates;n<r.length;n++){var a=r[n],s=this.appointmentFiltering(a),o=this.element.querySelectorAll("."+O)[parseInt(i.toString(),10)];0<s.length&&(o.querySelector("."+qi)||o.appendChild(B.createElement("div",{className:qi})),a.getTime()===z(new Date(this.monthAgendaDate.getTime())).getTime())&&this.onEventRender(s,a),i++}this.parent.notify(xe,{})},Ql.prototype.onCellClick=function(e){this.parent.quickPopup&&this.parent.quickPopup.quickPopupHide();var t=this.appointmentFiltering(e.startTime);this.onEventRender(t,e.startTime),this.parent.notify(xe,{}),this.monthAgendaDate=new Date(""+e.startTime),this.parent.setProperties({selectedDate:this.monthAgendaDate},!0)},Ql.prototype.onEventRender=function(e,t){this.agendaBase=this.getAgendaBase();var i,n=this.element.querySelector("."+mi);lt(n),0===this.parent.activeViewOptions.group.resources.length||this.parent.uiStateValues.isGroupAdaptive?0<e.length?(i=B.createElement("div",{className:fi}),n.appendChild(this.agendaBase.createAgendaContentElement("data",e,i))):this.appendAppContainer(n):0<e.length?(e=(i=this.createTableLayout()).querySelector("tbody"),this.agendaBase.calculateResourceTableElement(e,1,t),i.appendChild(e),n.appendChild(i)):this.appendAppContainer(n),this.agendaBase.wireEventActions()},Ql.prototype.appointmentFiltering=function(e){var e=z(new Date(e.getTime())),t=Ge(new Date(e.getTime()),W);return this.parent.eventBase.filterEvents(e,t)},Ql.prototype.clearElements=function(){for(var e=0,t=[].slice.call(this.element.querySelectorAll("."+qi));e<t.length;e++){var i=t[e];B.remove(i)}this.appendAppContainer(this.element.querySelector("."+mi))},Ql.prototype.appendAppContainer=function(e){var t=B.createElement("div",{className:fi});B.addClass([t],Li),t.innerHTML=this.parent.localeObj.getConstant("noEvents"),lt(e),e.appendChild(t)},Ql.prototype.getNextPreviousDate=function(e){var t=this.parent.selectedDate,i="Next"===e?this.parent.activeViewOptions.interval:-this.parent.activeViewOptions.interval,i=Ke(this.parent.selectedDate,i),e="Next"===e?2:0,t=new Date(t.getFullYear(),t.getMonth()+e,0).getDate(),e=t>=this.monthAgendaDate.getDate()?this.monthAgendaDate.getDate():t;return this.monthAgendaDate=new Date(i.getFullYear(),i.getMonth(),e),this.monthAgendaDate},Ql.prototype.getAgendaBase=function(){return this.agendaBase||new Ul(this.parent)},Ql.prototype.destroy=function(){this.agendaBase&&(this.agendaBase.destroy(),this.agendaBase=null),Gl.prototype.destroy.call(this)};var _l,Gl,Xl=Ql;function Ql(e){var t=Gl.call(this,e)||this;return t.dayNameFormat="narrow",t.viewClass="e-month-agenda-view",t.monthAgendaDate=new Date(""+e.selectedDate),t}Zl.prototype.groupByYear=function(e){for(var t={},i=0,n=e;i<n.length;i++){var r=n[i],a=r.getFullYear();t[parseInt(a.toString(),10)]=t[parseInt(a.toString(),10)]||[],t[parseInt(a.toString(),10)].push(r)}return t},Zl.prototype.groupByMonth=function(e){for(var t={},i=0,n=e;i<n.length;i++){var r=n[i],a=12*(r.getFullYear()-1970)+r.getMonth();t[parseInt(a.toString(),10)]=t[parseInt(a.toString(),10)]||[],t[parseInt(a.toString(),10)].push(r)}return t},Zl.prototype.groupByWeek=function(e){for(var t={},i=0,n=e;i<n.length;i++){var r=n[i],a=+new Date(1970,0,1),s=r.getTimezoneOffset()-new Date(1970,0,1).getTimezoneOffset(),s=Math.ceil(((+r-a-60*s*1e3)/W+new Date(a).getDay()+1)/7);this.parent.activeViewOptions.firstDayOfWeek&&this.parent.activeViewOptions.firstDayOfWeek>new Date(+r).getDay()&&(s-=1),t[parseInt(s.toString(),10)]=t[parseInt(s.toString(),10)]||[],t[parseInt(s.toString(),10)].push(r)}return t},Zl.prototype.generateSlots=function(e,t,i,n,r){for(var a=this,s=function(e,t){return a.parent.globalize.formatDate(e,{format:t,calendar:a.parent.getCalendarMode()})},o=[],l=Object.keys(e),p=0;p<l.length;p++){var c=e[l[parseInt(p.toString(),10)]],h=void 0;if(i.template)var d={date:c[0],type:r},u=this.parent.element.id+"_headerRowTemplate",h=[].slice.call(this.parent.templateParser(i.template)(d,this.parent,"template",u,!1));else{var g=void 0;switch(i.option){case"Year":g='<span class="e-header-year">'+s(c[0],"y")+"</span>";break;case"Month":g='<span class="e-header-month">'+y(s(c[0],"MMMM"),"single")+"</span>";break;case"Week":g='<span class="e-header-week">'+this.parent.getWeekNumberContent(c)+"</span>"}d=B.createElement("div",{innerHTML:g});h=[].slice.call(d.childNodes)}o.push({date:c[0],type:r,className:[n],colSpan:c.length*t,template:h})}return o},Zl.prototype.generateColumnLevels=function(e,t){for(var i,n,r=[],a=this.parent.activeViewOptions.headerRows,s=1,o=("Hour"===a[a.length-1].option&&0<t.length&&(s=t.length/e.length),[]),l=0,p=a;l<p.length;l++){var c=p[l];switch(c.option){case"Year":i=this.groupByYear(this.renderDates),o=this.generateSlots(i,s,c,"e-header-year-cell","yearHeader"),r.push(o);break;case"Month":i=this.groupByMonth(this.renderDates),o=this.generateSlots(i,s,c,"e-header-month-cell","monthHeader"),r.push(o);break;case"Week":n=this.groupByWeek(this.renderDates),o=this.generateSlots(n,s,c,"e-header-week-cell","weekHeader"),r.push(o);break;case"Date":o=(o=e).map(function(e){return e.colSpan=s,e}),r.push(o);break;case"Hour":0<t.length&&r.push(t)}}return r};var Kl=Zl;function Zl(e,t){this.parent=e,this.renderDates=t}Jl=function(e,t){return(Jl=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}Jl(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(tp,$l=Co),tp.prototype.getModuleName=function(){return"timelineViews"},tp.prototype.getLeftPanelElement=function(){return this.element.querySelector("."+Wt)},tp.prototype.scrollTopPanel=function(e){$l.prototype.scrollTopPanel.call(this,e),this.scrollHeaderLabels(e)},tp.prototype.scrollToWorkHour=function(){var e=this.parent.getStartEndTime(this.parent.workHours.start),e=this.isWorkDay(this.parent.selectedDate)&&this.parent.workHours.highlight&&!B.isNullOrUndefined(e)?new Date(+this.parent.selectedDate).setHours(e.getHours(),e.getMinutes(),0,0):new Date(+this.parent.selectedDate).setHours(0,0,0,0),e='[data-date="'+new Date(e).getTime().toString()+'"]',e=this.element.querySelector(e);e&&(this.getContentAreaElement().scrollLeft=this.parent.enableRtl?-(this.parent.getContentTable().offsetWidth-e.offsetLeft-e.offsetWidth):e.offsetLeft)},tp.prototype.scrollToHour=function(e,t){var i,n,r;t&&0<=(n=this.parent.getIndexOfDate(this.renderDates,z(t)))&&(i=t,B.isNullOrUndefined(e)||2===(r=e.split(":")).length&&(i=new Date(t.setHours(parseInt(r[0],10),parseInt(r[1],10),0)))),i=B.isNullOrUndefined(t)?this.parent.getStartEndTime(e):i,B.isNullOrUndefined(i)||(r=B.isNullOrUndefined(e)||!this.parent.activeViewOptions.timeScale.enable?n*this.parent.getElementWidth(this.element.querySelector(".e-work-cells")):B.isNullOrUndefined(t)?this.getLeftFromDateTime(null,i):this.getLeftFromDateTime([n],i),this.getScrollableElement().scrollLeft=this.parent.enableRtl?-r:r)},tp.prototype.generateColumnLevels=function(){var e=[],t=this.getDateSlots(this.renderDates,this.parent.activeViewOptions.workDays),i=(e.push(t),0<this.parent.activeViewOptions.group.resources.length&&this.parent.resourceBase.generateResourceLevels(t,!this.parent.uiStateValues.isGroupAdaptive),[]);return this.parent.activeViewOptions.timeScale.enable&&(i=this.generateTimeSlots(e[e.length-1]),e.push(i)),e=0<this.parent.activeViewOptions.headerRows.length?new Kl(this.parent,this.renderDates).generateColumnLevels(t,i):e},tp.prototype.generateTimeSlots=function(e){for(var t=this,i=this.getTimeSlotRows(function(e){return e.type=e.first?"majorSlot":"minorSlot",e.className=e.first?[$t]:[$t,Jt],e.workDays=t.parent.activeViewOptions.workDays,e}),n=[],r=0,a=e;r<a.length;r++){var s=a[r];s.colSpan=i.length;for(var o=0,l=B.extend([],i,null,!0);o<l.length;o++){var p=l[o],c=z(new Date(""+s.date));p.date=Ge(c,Xe(p.date)),n.push(p)}}return n},tp.prototype.changeCurrentTimePosition=function(){var e,t,i,n;!this.parent||this.parent&&this.parent.isDestroyed||(this.removeCurrentTimeIndicatorElements(),e=this.getCurrentTimeIndicatorIndex(),e=this.getLeftFromDateTime(e,this.parent.getCurrentTime()),n=this.element.querySelector("."+C).offsetHeight,t=this.element.querySelector("."+Vt),this.element.querySelector("."+A).appendChild(B.createElement("div",{className:ii,styles:(this.parent.enableRtl?"right":"left")+":"+B.formatUnit(e)+"; height:"+B.formatUnit(n)})),this.parent.virtualScrollModule&&(n=this.parent.element.querySelector("."+ii),i=this.parent.element.querySelector("."+A+" table"),B.setStyleAttribute(n,{transform:i.style.transform})),n=B.createElement("div",{innerHTML:this.parent.getTimeString(this.parent.getCurrentTime()),className:ti}),t.appendChild(n),n.style[this.parent.enableRtl?"right":"left"]=B.formatUnit(e-n.offsetWidth/2))},tp.prototype.getLeftFromDateTime=function(e,t){var i=this.getStartHour(),n=this.getEndHour(),r=0,a=60*(t.getHours()-i.getHours())+(t.getMinutes()-i.getMinutes()),t=Je(z(new Date(t.getTime())),i,n),t=(t.endHour.getTime()-t.startHour.getTime())/je,s=this.parent.activeViewOptions.timeScale.interval,o=0,o=(0!==i.getHours()||0!==i.getMinutes()||0!==n.getHours()||0!==n.getMinutes())&&1===this.parent.activeViewOptions.timeScale.slotCount&&t<s?t:s;return B.isNullOrUndefined(e)||0!==e[0]&&(n=this.parent.activeView.colLevels.findIndex(function(e){return"dateHeader"===e[0].type}),this.parent.activeView.colLevels[parseInt(n.toString(),10)]&&this.parent.activeView.colLevels[parseInt(n.toString(),10)][0].colSpan?r=e[0]*this.parent.activeView.colLevels[parseInt(n.toString(),10)][0].colSpan*this.parent.getElementWidth(this.element.querySelector(".e-work-cells")):(s=0===(t=this.getEndHour()).getHours()?24:t.getHours(),a+=e[0]*(60*(s-i.getHours())+(t.getMinutes()-i.getMinutes())))),r+a*this.parent.getElementWidth(this.element.querySelector(".e-work-cells"))*this.parent.activeViewOptions.timeScale.slotCount/o},tp.prototype.renderHeader=function(){var e=B.createElement("tr"),t=(0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive&&this.parent.resourceBase.renderResourceHeaderIndent(e),B.createElement("td"));t.appendChild(this.renderDatesHeader()),e.appendChild(t),B.prepend([e],this.element.querySelector("tbody"))},tp.prototype.createAllDayRow=function(e,t){},tp.prototype.getCurrentTimeIndicatorIndex=function(){var e=[],t=this.parent.getIndexOfDate(this.renderDates,z(this.parent.getCurrentTime()));return 0<=t&&e.push(t),e},tp.prototype.renderContent=function(){var e=B.createElement("tr"),t=(0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive&&((t=B.createElement("td")).appendChild(this.parent.resourceBase.createResourceColumn()),e.appendChild(t)),B.createElement("td")),i=this.renderContentArea();i.appendChild(this.createEventTable(this.getRowCount())),this.collapseRows(i),t.appendChild(i),e.appendChild(t),this.parent.virtualScrollModule&&this.parent.virtualScrollModule.renderVirtualTrack(i),this.element.querySelector("tbody").appendChild(e)},tp.prototype.getRowCount=function(){return 0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive?this.parent.resourceBase.renderedResources.length:1},tp.prototype.getResourceTdData=function(e,t){var e=this.parent.resourceBase.renderedResources[parseInt(e.toString(),10)],i=e.resourceData[e.resource.startHourField]||this.parent.workHours.start,n=e.resourceData[e.resource.endHourField]||this.parent.workHours.end;return t.startHour=this.parent.getStartEndTime(i),t.endHour=this.parent.getStartEndTime(n),t.workDays=e.resourceData[e.resource.workDaysField]||this.parent.workDays,t.className=e.className,t.groupIndex=e.groupIndex,t.groupOrder=e.groupOrder,t},tp.prototype.renderContentTable=function(e){e=e.querySelector("tbody");B.append(this.getContentRows(),e)},tp.prototype.getContentRows=function(){for(var e=[],t=B.createElement("tr"),i=B.createElement("td"),n=this.getRowCount(),r=this.getGroupIndices(),a=0;a<n;a++)if(!(0<r.length&&-1<r.indexOf(this.parent.resourceBase.renderedResources[parseInt(a.toString(),10)].groupIndex))){for(var s=t.cloneNode(),o=0,l=this.colLevels[this.colLevels.length-1];o<l.length;o++){var p=l[o],p=(0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive&&(p=this.getResourceTdData(a,p)),this.createContentTd(p,p,i));s.appendChild(p)}e.push(s)}return e},tp.prototype.getContentTdClass=function(e){return e.first||!this.parent.activeViewOptions.timeScale.enable?[O]:[O,ei]},tp.prototype.renderEvents=function(){this.timelineAppointment=new es(this.parent,this.parent.activeViewOptions.timeScale.enable?"hour":"day"),this.timelineAppointment.renderAppointments(),this.parent.notify(xe,{})},tp.prototype.getAdjustedDate=function(e){if(!this.parent.activeViewOptions.timeScale.enable)return new Date(e.setHours(0,0,0,0));for(var t=this.colLevels[this.colLevels.length-1],i=0;i<t.length;i++)if(t[parseInt(i.toString(),10)].date.getTime()>e.getTime())return t[i-1].date;return null},tp.prototype.destroy=function(){!this.parent||this.parent&&this.parent.isDestroyed?this.parent=null:(this.timelineAppointment&&(this.timelineAppointment.destroy(),this.timelineAppointment=null),$l.prototype.destroy.call(this))};var Jl,$l,ep=tp;function tp(e){e=$l.call(this,e)||this;return e.timelineAppointment=null,e.baseCssClass="e-timeline-view",e}ip=function(e,t){return(ip=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}ip(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(ap,np=Pl),ap.prototype.getModuleName=function(){return"timelineMonth"},ap.prototype.onDataReady=function(){this.appointment=new es(this.parent,"day"),this.appointment.renderAppointments(),this.parent.notify(xe,{})},ap.prototype.getLeftPanelElement=function(){return this.element.querySelector("."+Wt)},ap.prototype.scrollTopPanel=function(e){np.prototype.scrollTopPanel.call(this,e),this.scrollHeaderLabels(e)},ap.prototype.setContentHeight=function(e,t,i){t&&(t.style.height=B.formatUnit(i-this.getScrollXIndent(e))),e.style.height=B.formatUnit(i)},ap.prototype.getDateSlots=function(e,t){for(var i=[],n=0,r=e;n<r.length;n++){var a=r[n],s=[It];this.isCurrentDate(a)&&s.push(kt),i.push({date:a,type:"dateHeader",className:s,colSpan:1,workDays:t})}return i},ap.prototype.renderLeftIndent=function(e){0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive&&this.parent.resourceBase.renderResourceHeaderIndent(e)},ap.prototype.renderContent=function(){var e=B.createElement("tr"),t=(0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive&&((t=B.createElement("td")).appendChild(this.parent.resourceBase.createResourceColumn()),e.appendChild(t)),B.createElement("td")),i=(this.element.querySelector("tbody").appendChild(e),B.createElement("div",{className:A}));i.appendChild(this.renderContentArea()),i.appendChild(this.createEventTable(this.getRowCount())),this.collapseRows(i),B.EventHandler.add(i,"scroll",this.onContentScroll,this),t.appendChild(i),this.parent.virtualScrollModule&&this.parent.virtualScrollModule.renderVirtualTrack(i),e.appendChild(t)},ap.prototype.getRowCount=function(){return 0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive?this.parent.resourceBase.renderedResources.length:1},ap.prototype.getContentSlots=function(){for(var e=[],t=0;t<this.getRowCount();t++)for(var i=0,n=this.colLevels[this.colLevels.length-1];i<n.length;i++){var r=n[i],a=(r.className=[O],0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive&&(a=this.parent.resourceBase.renderedResources[parseInt(t.toString(),10)],r.workDays=a.resourceData[a.resource.workDaysField]||this.parent.workDays,r.className=r.className.concat(a.className),r.groupIndex=a.groupIndex,r.groupOrder=a.groupOrder),{date:new Date(+r.date),colSpan:r.colSpan,groupIndex:r.groupIndex,workDays:r.workDays,type:"monthCells",className:r.className});e[parseInt(t.toString(),10)]||(e[parseInt(t.toString(),10)]=[]),e[parseInt(t.toString(),10)].push(a)}return e},ap.prototype.updateClassList=function(e){this.parent.isMinMaxDate(e.date)||e.className.push(yr)},ap.prototype.unWireEvents=function(){B.EventHandler.remove(this.getContentAreaElement(),"scroll",this.onContentScroll)},ap.prototype.getMonthStart=function(e){e=this.parent.calendarUtil.firstDateOfMonth(z(e));return new Date(e.getFullYear(),e.getMonth(),e.getDate())},ap.prototype.getMonthEnd=function(e){e=this.parent.calendarUtil.firstDateOfMonth(z(e));return this.parent.calendarUtil.lastDateOfMonth(Ke(new Date(+e),this.parent.activeViewOptions.interval-1))},ap.prototype.generateColumnLevels=function(){var e=[],t=this.getDateSlots(this.renderDates,this.parent.activeViewOptions.workDays);e.push(t),0<this.parent.activeViewOptions.group.resources.length&&this.parent.resourceBase.generateResourceLevels(t,!this.parent.uiStateValues.isGroupAdaptive);return 0<this.parent.activeViewOptions.headerRows.length&&(e=new Kl(this.parent,this.renderDates).generateColumnLevels(t,[])),this.colLevels=e},ap.prototype.getAdjustedDate=function(e){for(var t=this.colLevels[this.colLevels.length-1],i=0;i<t.length;i++)if(t[parseInt(i.toString(),10)].date.getTime()>e.getTime())return t[i-1].date;return null},ap.prototype.destroy=function(){var e;!this.parent||this.parent&&this.parent.isDestroyed?this.parent=null:(this.element&&(e=this.element.querySelector("."+A))&&B.EventHandler.remove(e,"scroll",this.onContentScroll),this.appointment&&(this.appointment.destroy(),this.appointment=null),np.prototype.destroy.call(this))};var ip,np,rp=ap;function ap(e){e=np.call(this,e)||this;return e.viewClass="e-timeline-month-view",e.isInverseTableSelect=!0,e.appointment=null,e}sp=function(e,t){return(sp=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}sp(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(pp,op=Ll),pp.prototype.getModuleName=function(){return"timelineYear"},pp.prototype.renderHeader=function(e){var t=B.createElement("tr"),e=(e.appendChild(t),"Vertical"===this.parent.activeViewOptions.orientation&&0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive?this.parent.resourceBase.renderResourceHeaderIndent(t):(e=B.createElement("td",{className:Lt}),t.appendChild(e),e.appendChild(this.renderResourceHeader(qt))),"Horizontal"===this.parent.activeViewOptions.orientation),i=0<this.parent.activeViewOptions.group.resources.length,e=(this.isInverseTableSelect=!e||i,B.createElement("td")),i=(t.appendChild(e),B.createElement("div",{className:At}));if(e.appendChild(i),"Horizontal"===this.parent.activeViewOptions.orientation&&0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive)i.appendChild(this.renderResourceHeader(Vt)),this.columnCount=this.colLevels.slice(-1)[0].length;else for(var t=B.createElement("div",{className:Vt}),e=(i.appendChild(t),this.createTableLayout()),n=(t.appendChild(e),e.appendChild(this.createTableColGroup(this.columnCount)),B.createElement("tr")),r=(e.querySelector("tbody").appendChild(n),this.getMonths()),a=this.getMonthDates(new Date(this.parent.selectedDate.getFullYear(),r[0],1)),s=0;s<this.columnCount;s++){var o=new Date(this.parent.selectedDate.getFullYear(),r[parseInt(s.toString(),10)],1),l=B.createElement("td",{className:It});"Horizontal"===this.parent.activeViewOptions.orientation?this.parent.dayHeaderTemplate?B.append(this.renderDayMonthHeaderTemplate(a[parseInt(s.toString(),10)],s,"dayHeaderTemplate"),l):l.innerHTML="<span>"+this.parent.getDayNames("abbreviated")[s%7]+"</span>":(this.parent.monthHeaderTemplate?B.append(this.renderDayMonthHeaderTemplate(o,r[parseInt(s.toString(),10)],"monthHeaderTemplate"),l):l.innerHTML="<span>"+this.getMonthName(o)+"</span>",l.setAttribute("data-date",o.getTime().toString())),n.appendChild(l),this.parent.trigger($,{elementType:"headerCells",element:l})}},pp.prototype.renderResourceHeader=function(e){var t=B.createElement("div",{className:e}),i=this.createTableLayout(),n=(t.appendChild(i),B.createElement("tr"));0<this.parent.activeViewOptions.group.resources.length?this.colLevels=this.generateColumnLevels():this.colLevels=[[{className:[It],type:"headerCell"}]];for(var r=0,a=this.colLevels;r<a.length;r++){for(var s=a[r],o=n.cloneNode(),l=0,p=e===Vt?s:[s[0]];l<p.length;l++){var c=p[l],h=B.createElement("td"),c=(c.className&&B.addClass([h],c.className),e===Vt&&(c.template&&B.append(c.template,h),c.colSpan&&h.setAttribute("colspan",c.colSpan.toString()),-1<c.groupIndex&&h.setAttribute("data-group-index",c.groupIndex.toString()),this.setResourceHeaderContent(h,c)),e===qt&&this.parent.renderHeaderIndentTemplate(c,h),{elementType:c.type,element:h,date:c.date,groupIndex:c.groupIndex});this.parent.trigger($,c),o.appendChild(h)}i.querySelector("tbody").appendChild(o)}return e===Vt&&i.appendChild(this.createTableColGroup(this.colLevels.slice(-1)[0].length)),t},pp.prototype.renderContent=function(e){var t,i,n=B.createElement("tr"),e=(e.appendChild(n),B.createElement("td")),r=B.createElement("td"),a=[],e=("Vertical"===this.parent.activeViewOptions.orientation&&0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive?(a.push(e),e.appendChild(this.parent.resourceBase.createResourceColumn()),this.rowCount=this.parent.resourceBase.renderedResources.length):(a.push(e),t=B.createElement("div",{className:Hr}),e.appendChild(t),t.appendChild(this.createTableLayout()),t=t.querySelector("tbody")),a.push(r),B.append(a,n),B.createElement("div",{className:A})),a=(r.appendChild(e),this.createTableLayout(C)),n=(this.setAriaAttributes(a),e.appendChild(a),B.createElement("div",{className:Ft})),r=(e.appendChild(n),this.parent.virtualScrollModule&&this.parent.virtualScrollModule.renderVirtualTrack(e),a.querySelector("tbody"));this.parent.rowAutoHeight&&(e=[a],(i=this.parent.element.querySelector("."+Hr+" ."+Ct))&&e.push(i),B.addClass(e,Mr)),0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive?(i="Horizontal"===this.parent.activeViewOptions.orientation?this.colLevels.slice(-1)[0].length:this.columnCount,a.appendChild(this.createTableColGroup(i)),this.renderResourceContent(n,t,r)):(a.appendChild(this.createTableColGroup(this.columnCount)),this.renderDefaultContent(n,t,r))},pp.prototype.renderDefaultContent=function(e,t,i){for(var n=this.getMonths(),r=this.getMonthDates(new Date(this.parent.selectedDate.getFullYear(),n[0],1)),a=0;a<this.rowCount;a++){e.appendChild(B.createElement("div",{className:fi}));for(var s=new Date(this.parent.selectedDate.getFullYear(),n[parseInt(a.toString(),10)],1),o=this.parent.calendarUtil.getMonthStartDate(new Date(s.getTime())),l=this.parent.calendarUtil.getMonthEndDate(new Date(s.getTime())),p=B.createElement("tr"),c=p.cloneNode(),h=(t.appendChild(c),p.cloneNode()),p=(i.appendChild(h),B.createElement("td",{className:Mi})),d=("Horizontal"===this.parent.activeViewOptions.orientation?(this.parent.monthHeaderTemplate?B.append(this.renderDayMonthHeaderTemplate(o,a,"monthHeaderTemplate"),p):p.innerHTML="<span>"+this.getMonthName(s)+"</span>",p.setAttribute("data-date",s.getTime().toString())):this.parent.dayHeaderTemplate?B.append(this.renderDayMonthHeaderTemplate(r[parseInt(a.toString(),10)],a,"dayHeaderTemplate"),p):p.innerHTML="<span>"+this.parent.getDayNames("abbreviated")[a%7]+"</span>",c.appendChild(p),this.parent.trigger($,{elementType:"leftHeaderCells",element:p}),new Date(o.getTime())),u=0;u<this.columnCount;u++){var g,m,v=void 0,f=(v="Vertical"===this.parent.activeViewOptions.orientation?(s=new Date(this.parent.selectedDate.getFullYear(),n[parseInt(u.toString(),10)],1),o=this.parent.calendarUtil.getMonthStartDate(new Date(s.getTime())),l=this.parent.calendarUtil.getMonthEndDate(new Date(s.getTime())),f=a-o.getDay()+1,d=new Date(this.parent.selectedDate.getFullYear(),n[parseInt(u.toString(),10)],f),0<f&&d.getTime()<l.getTime()):u>=o.getDay()&&d.getTime()<l.getTime(),this.parent.globalize.formatDate(d,{skeleton:"full",calendar:this.parent.getCalendarMode()})),y=B.createElement("td",{className:O,attrs:{"aria-label":f}}),T=(h.appendChild(y),B.createElement("div",{className:Pi+" "+Hi,innerHTML:v?this.parent.globalize.formatDate(d,{skeleton:"d",calendar:this.parent.getCalendarMode()}):""}));v?(g=[y],m=[],-1<this.parent.activeViewOptions.workDays.indexOf(d.getDay())&&m.push(Mt),this.parent.isMinMaxDate(d)||B.addClass([y],yr),this.isCurrentDate(d)&&(m.push(kt),"Horizontal"===this.parent.activeViewOptions.orientation?g.push(this.element.querySelector("."+It+":nth-child("+(u+1)+")")):g.push(this.element.querySelectorAll("."+Mi).item(a))),0<m.length&&B.addClass(g,m)):(B.addClass([y],E),this.parent.isMinMaxDate(d)||B.addClass([y],yr)),y.classList.contains(E)||(this.renderDates.push(new Date(d)),y.appendChild(T),v&&(y.setAttribute("data-date",d.getTime().toString()),this.wireEvents(y)),this.renderCellTemplate({date:d,type:"workCells"},y),this.parent.trigger($,{elementType:"workCells",element:y,date:d}),v&&"Horizontal"===this.parent.activeViewOptions.orientation&&(d=Y(new Date(d.getTime()),1)))}}this.renderDates.splice(0,1)},pp.prototype.getContentRows=function(){for(var e=[],t=this.getMonths(),i=this.getGroupIndices(),n=0;n<this.parent.resourceBase.renderedResources.length;n++){var r=void 0;if(!(0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive&&(r=this.parent.resourceBase.renderedResources[parseInt(n.toString(),10)],0<i.length)&&-1<i.indexOf(r.groupIndex)))for(var a=B.createElement("tr"),s=(e.push(a),new Date(this.parent.selectedDate.getFullYear(),t[parseInt(n.toString(),10)],1)),o=this.parent.calendarUtil.getMonthStartDate(new Date(s.getTime())),l=0;l<this.columnCount;l++){var p=[],c=r.groupIndex,s=(-1<(p=p.concat(r.className)).indexOf(_t)?p.push(Ut):p.push(Mt),new Date(this.parent.selectedDate.getFullYear(),t[parseInt(l.toString(),10)],1)),o=this.parent.calendarUtil.getMonthStartDate(new Date(s.getTime())),h=B.createElement("td",{className:O,attrs:{"aria-selected":"false","data-date":o.getTime().toString()}});B.addClass([h],p),h.setAttribute("data-group-index",c.toString()),this.renderCellTemplate({date:o,type:"resourceGroupCells",groupIndex:c},h),this.wireEvents(h),this.parent.trigger($,{elementType:"resourceGroupCells",element:h,date:o}),a.appendChild(h)}}return e},pp.prototype.renderResourceContent=function(e,t,i){for(var n=this.getMonths(),r=0;r<this.rowCount;r++){e.appendChild(B.createElement("div",{className:fi}));var a,s,o=B.createElement("tr"),l=(i.appendChild(o),void 0),p=("Vertical"===this.parent.activeViewOptions.orientation&&0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive&&(l=this.parent.resourceBase.renderedResources[parseInt(r.toString(),10)]),new Date(this.parent.selectedDate.getFullYear(),n[parseInt(r.toString(),10)],1)),c=this.parent.calendarUtil.getMonthStartDate(new Date(p.getTime()));"Horizontal"===this.parent.activeViewOptions.orientation&&(a=o.cloneNode(),t.appendChild(a),s=B.createElement("td",{className:Mi,attrs:{"data-date":c.getTime().toString()}}),this.parent.monthHeaderTemplate?B.append(this.renderDayMonthHeaderTemplate(p,r,"monthHeaderTemplate"),s):s.innerHTML="<span>"+this.getMonthName(p)+"</span>",a.appendChild(s));for(var h=0;h<this.columnCount;h++){var d=[],u=void 0,g=("Vertical"===this.parent.activeViewOptions.orientation?(u=l.groupIndex,-1<(d=d.concat(l.className)).indexOf(_t)?d.push(Ut):d.push(Mt),p=new Date(this.parent.selectedDate.getFullYear(),n[parseInt(h.toString(),10)],1),c=this.parent.calendarUtil.getMonthStartDate(new Date(p.getTime()))):(u=this.colLevels.slice(-1)[0][parseInt(h.toString(),10)].groupIndex,d.push(Mt)),this.parent.globalize.formatDate(c,{type:"dateTime",skeleton:"full",calendar:this.parent.getCalendarMode()})),m=this.parent.globalize.formatDate(this.parent.calendarUtil.getMonthEndDate(new Date(p.getTime())),{type:"dateTime",skeleton:"full",calendar:this.parent.getCalendarMode()}),g=B.createElement("td",{className:O,attrs:{"aria-selected":"false","data-date":c.getTime().toString(),"aria-label":g+" "+this.parent.localeObj.getConstant("endAt")+" "+m}});B.addClass([g],d),g.setAttribute("data-group-index",u.toString()),this.renderCellTemplate({date:c,type:"resourceGroupCells",groupIndex:u},g),this.wireEvents(g),o.appendChild(g),this.parent.trigger($,{elementType:"resourceGroupCells",element:g,date:c})}}"Vertical"===this.parent.activeViewOptions.orientation&&this.collapseRows(this.parent.element.querySelector("."+A))},pp.prototype.renderDayMonthHeaderTemplate=function(e,t,i){var e={date:e,type:"dayHeaderTemplate"===i?"dayHeader":"monthHeader"},n="schedule_"+this.parent.activeViewOptions.dayHeaderTemplateName+"dayHeaderTemplate",r="schedule_"+this.parent.activeViewOptions.dayHeaderTemplateName+"monthHeaderTemplate";return"dayHeaderTemplate"===i?(e.day=this.parent.getDayNames("wide")[t%7],[].slice.call(this.parent.getDayHeaderTemplate()(e,this.parent,"dayHeaderTemplate",n,!1,void 0,void 0,this.parent.root))):[].slice.call(this.parent.getMonthHeaderTemplate()(e,this.parent,"monthHeaderTemplate",r,!1,void 0,void 0,this.parent.root))},pp.prototype.renderCellTemplate=function(e,t){var i;this.parent.activeViewOptions.cellTemplate&&!t.classList.contains(E)&&(i={date:e.date,type:e.type},e.groupIndex&&(i.groupIndex=e.groupIndex),e=this.parent.element.id+"_"+this.parent.activeViewOptions.cellTemplateName+"cellTemplate",i=[].slice.call(this.parent.getCellTemplate()(i,this.parent,"cellTemplate",e,!1,void 0,void 0,this.parent.root)),B.append(i,t))},pp.prototype.scrollToDate=function(e){var t,i,e=null!==this.parent.activeViewOptions.group.resources&&0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive?+new Date(z(We(e))):+new Date(z(e)),e=this.element.querySelector('[data-date="'+e+'"]');e&&(t=this.getScrollableElement(),this.parent.enableRtl?(i=this.element.querySelector("."+C),t.scrollLeft=-(i.offsetWidth-e.offsetLeft-e.offsetWidth)):t.scrollLeft=e.offsetLeft,t.scrollTop=e.offsetTop)},pp.prototype.getScrollableElement=function(){return this.parent.isAdaptive&&!this.isTimelineView()?this.element.querySelector("."+ai):this.getContentAreaElement()},pp.prototype.wireEvents=function(e){B.EventHandler.add(e,"mousedown",this.parent.workCellAction.cellMouseDown,this.parent.workCellAction),B.EventHandler.add(e,"click",this.parent.workCellAction.cellClick,this.parent.workCellAction),this.parent.isAdaptive||B.EventHandler.add(e,"dblclick",this.parent.workCellAction.cellDblClick,this.parent.workCellAction)};var sp,op,lp=pp;function pp(e){e=op.call(this,e)||this;return e.viewClass="e-timeline-year-view",e.isInverseTableSelect=!0,e}cp.prototype.initializeCalendarExport=function(e,t){t=this.getCalendarString(e,t);this.download(t,e)},cp.prototype.getCalendarString=function(e,t){var p=this,c=t||B.extend([],this.parent.eventsData,null,!0),c=this.parent.eventBase.sortByTime(c),h=-1!==navigator.appVersion.indexOf("Win")?"\r\n":"\n",d=[],u=[],g=this.parent.timezone||this.parent.tzModule.getLocalTimezoneName(),m=this.parent.eventFields;return c.forEach(function(t){var e=t[m.id]||t.Guid||p.parent.eventBase.generateGuid(),i=[],n=(t[m.recurrenceID]&&(e=0<(n=p.filterEvents(u,m.id,t[m.recurrenceID])).length?n[0].UID:e),!t[m.recurrenceID]&&t[m.recurrenceRule]&&t[m.recurrenceException]&&(o=t[m.recurrenceException].split(","),p.filterEvents(c,m.recurrenceID,t[m.id]).forEach(function(e){i.push(Wa(e[m.startTime]))}),n=o.filter(function(e){return-1===i.indexOf(e)}),t[m.recurrenceException]=0<n.length?n.join(",")+",":""),t[m.startTimezone]||g),r=t[m.endTimezone]||g,a=t[m.isReadonly]||!1,s=["BEGIN:VEVENT","LOCATION:"+(t[m.location]||""),"SUMMARY:"+(t[m.subject]||""),"UID:"+e,"DESCRIPTION:"+(t[m.description]||""),"ISREADONLY:"+a,"END:VEVENT"];if(t[m.isAllDay]?(s.splice(4,0,"DTEND;VALUE=DATE:"+p.convertDateToString(t[m.endTime],!0)),s.splice(4,0,"DTSTART;VALUE=DATE:"+p.convertDateToString(t[m.startTime],!0))):t[m.isAllDay]||t[m.recurrenceRule]?(s.splice(4,0,'DTEND;TZID="'+r+'":'+p.convertDateToString(t[m.endTime])),s.splice(4,0,'DTSTART;TZID="'+n+'":'+p.convertDateToString(t[m.startTime]))):(s.splice(4,0,"DTEND:"+p.convertDateToString(t[m.endTime])),s.splice(4,0,"DTSTART:"+p.convertDateToString(t[m.startTime]))),t[m.recurrenceRule]&&s.splice(4,0,"RRULE:"+t[m.recurrenceRule]),t[m.recurrenceException])for(var o=t[m.recurrenceException].split(","),l=0;l<o.length-1;l++)s.splice(5,0,"EXDATE:"+p.convertDateToString(oa(o[parseInt(l.toString(),10)]),t[m.isAllDay]));t[m.recurrenceID]&&s.splice(4,0,'RECURRENCE-ID;TZID="'+n+'":'+p.convertDateToString(t[m.startTime],t[m.isAllDay]));a=p.customFieldFilter(t,m),0<a.length&&a.forEach(function(e){return s.splice(4,0,e+":"+(t[""+e]||""))}),r=B.extend({},t);r.UID=e,u.push(r),d.push(s.join(h))}),["BEGIN:VCALENDAR","PRODID:-//Syncfusion Inc//Scheduler//EN","VERSION:2.0","CALSCALE:GREGORIAN","METHOD:PUBLISH","X-WR-CALNAME:"+(e||"Calendar"),"X-WR-TIMEZONE:"+g].join(h)+h+d.join(h)+h+"END:VCALENDAR"},cp.prototype.customFieldFilter=function(e,t){var i=Object.keys(t).map(function(e){return t[""+e]});return Object.keys(e).filter(function(e){return-1===i.indexOf(e)&&"Guid"!==e})},cp.prototype.convertDateToString=function(e,t){var i=("0000"+e.getFullYear().toString()).slice(-4),n=("00"+(e.getMonth()+1).toString()).slice(-2),r=("00"+e.getDate().toString()).slice(-2),a=("00"+e.getHours().toString()).slice(-2),s=("00"+e.getMinutes().toString()).slice(-2),e=("00"+e.getSeconds().toString()).slice(-2);return t?i+n+r:i+n+r+"T"+a+s+e},cp.prototype.download=function(e,t){var i,e=new Blob([e],{type:"data:text/calendar;charset=utf8"});t=(t||"Calendar")+".ics",navigator.msSaveBlob?navigator.msSaveBlob(e,t):((i=document.createElementNS("http://www.w3.org/1999/xhtml","a")).download=t,i.href=URL.createObjectURL(e),(t=document.createEvent("MouseEvent")).initEvent("click",!0,!0),i.dispatchEvent(t),setTimeout(function(){URL.revokeObjectURL(i.href),i.href=void 0}))},cp.prototype.filterEvents=function(e,t,i){return e.filter(function(e){return e[""+t]===i})},cp.prototype.getModuleName=function(){return"iCalendarExport"},cp.prototype.destroy=function(){!this.parent||this.parent&&this.parent.isDestroyed||(this.parent=null)};ko=cp;function cp(e){this.parent=e}hp.prototype.initializeCalendarImport=function(e){var t,i=this;e&&e instanceof Blob?((t=new FileReader).onload=function(){var e=t.result;i.iCalendarParser(e)},t.readAsText(e,"UTF-8")):e&&"string"==typeof e&&this.iCalendarParser(e)},hp.prototype.iCalendarParser=function(e){var t,i={isEvent:!1,curEvent:null,id:this.parent.eventBase.getEventMaxID(),count:0,events:[],key:null},n=e.length,r=e.search(/[^ \t]/),a=r;do{var s=0===(a=e.indexOf("\n",r)+1)?(a=n,0):1<a&&"\r"===e[a-2]?2:1,o=e.charAt(r)}while(" "===o||"\n"===o||"\t"===o?t+=e.slice(r+1,a-s):(t&&(i=this.updateEventData(t,i)),t=e.slice(r,a-s)),(r=a)!==n);(t=t.trim()).length&&(i=this.updateEventData(t,i));var l=B.extend([],i.events,null,!0);this.parent.addEvent(this.processOccurrence(l,i.id))},hp.prototype.updateEventData=function(e,t){var i=this.parent.eventFields,n=t.id,r=t.events,a=t.isEvent,s=t.count,o=t.curEvent,t=t.key;if(a||"BEGIN:VEVENT"!==e||(a=!0,o={}),a&&"END:VEVENT"===e&&(a=!1,r.push(o),o=null),a){var l,p=e.indexOf(":"),c=e.substring(0,p).replace(/^\s\s*/,"").replace(/\s\s*$/,""),h=e.substring(p+1,e.length).replace(/^\s\s*/,"").replace(/\s\s*$/,"");if(-1!==e.indexOf("SUMMARY")&&(c="SUMMARY"),-1!==e.indexOf("DTSTART"))o[i.startTime]=this.dateParsing(e),o[i.isAllDay]=this.allDay,this.allDay=!1;else if(-1!==e.indexOf("DTEND"))o[i.endTime]=this.dateParsing(e);else if(-1!==e.indexOf("EXDATE"))h=Wa(this.dateParsing(e)),o[i.recurrenceException]=B.isNullOrUndefined(o[i.recurrenceException])?h:o[i.recurrenceException]+","+h;else if(-1!==e.indexOf("RECURRENCE-ID"))h=Wa(this.dateParsing(e)),o[i.recurrenceException]=h,o[i.recurrenceID]=h;else switch(t=c||t){case"BEGIN":break;case"UID":o[""+c]=h,"number"==typeof n?(o[i.id]=parseInt(h,10),isNaN(o[i.id])&&(o[i.id]=n+s,s++)):o[i.id]=h;break;case"SUMMARY":o[i.subject]=this.getFormattedString(h);break;case"LOCATION":o[i.location]=this.getFormattedString(h);break;case"DESCRIPTION":o[i.description]?o[i.description]=this.getFormattedString(o[i.description]+"\r\n"+h):o[i.description]=this.getFormattedString(h);break;case"ISREADONLY":o[i.isReadonly]=-1<h.indexOf("true");break;case"RRULE":o[i.recurrenceRule]=h;break;default:0<this.parent.resourceCollection.length?(l=this.parent.resourceCollection.filter(function(e){return e.field===c}),o[""+c]=0<l.length&&"number"==typeof l[0].dataSource[0][l[0].idField]?parseInt(h,10):h):o[""+c]=h}}return{isEvent:a,curEvent:o,id:n,count:s,events:r,key:t}},hp.prototype.processOccurrence=function(s,o){var l=this,p=[],c=this.parent.eventFields,h=[];return this.parent.eventsData.forEach(function(e){h.push(e[c.id])}),s.forEach(function(t){var e;if(t.hasOwnProperty(c.recurrenceID)||(r=(e=t)[c.id]),h.indexOf(t[c.id])<0){var i=s.filter(function(e){return e.UID===t.UID});if(1<i.length&&B.isNullOrUndefined(t[c.recurrenceID])){for(var n,r="number"==typeof o?o++:r,a=0;a<i.length;a++)i[parseInt(a.toString(),10)].hasOwnProperty(c.recurrenceID)&&(n=i[parseInt(a.toString(),10)][c.recurrenceID],i[parseInt(a.toString(),10)][c.id]="number"==typeof o?o++:l.parent.eventBase.generateGuid(),i[parseInt(a.toString(),10)][c.recurrenceID]=r,i[parseInt(a.toString(),10)][c.recurrenceException]=null,e[c.recurrenceException]=l.getExcludeDateString(e[c.recurrenceException],n),delete i[parseInt(a.toString(),10)].UID,p.push(i[parseInt(a.toString(),10)]));delete e.UID,e[c.id]=r,p.push(e)}else t.hasOwnProperty(c.recurrenceID)||(delete t.UID,t[c.id]="number"==typeof o?o++:r,p.push(t))}}),p},hp.prototype.getExcludeDateString=function(e,t){var i,n;return B.isNullOrUndefined(e)?t:B.isNullOrUndefined(t)||(i=e.split(",").map(function(e){return e.split("T")[0]}),n=t.split(",").map(function(e){return e.split("T")[0]}),0<i.filter(function(e){return-1<n.indexOf(e)}).length)?e:e+","+t},hp.prototype.getFormattedString=function(e){return(e=e||"").replace(/\\\,/g,",").replace(/\\\;/g,";").replace(/\\[nN]/g,"\n").replace(/\\\\/g,"\\")},hp.prototype.dateParsing=function(e){var t=e.split(":"),t=t[t.length-1],i=new Date(this.getFormattedString(t)),n=(e&&(-1<e.indexOf("VALUE=DATE")||-1<e.indexOf("RECURRENCE-ID;TZID"))&&(null!==(n=/^(\d{4})(\d{2})(\d{2})$/.exec(t))&&(i=new Date(parseInt(n[1],10),parseInt(n[2],10)-1,parseInt(n[3],10))),-1<e.indexOf("DTSTART"))&&(this.allDay=!0),/^(\d{4})(\d{2})(\d{2})T(\d{2})(\d{2})(\d{2})(Z)?$/.exec(t));return i=null!==n?"Z"===n[7]?new Date(Date.UTC(parseInt(n[1],10),parseInt(n[2],10)-1,parseInt(n[3],10),parseInt(n[4],10),parseInt(n[5],10),parseInt(n[6],10))):new Date(parseInt(n[1],10),parseInt(n[2],10)-1,parseInt(n[3],10),parseInt(n[4],10),parseInt(n[5],10),parseInt(n[6],10)):i},hp.prototype.getModuleName=function(){return"iCalendarImport"},hp.prototype.destroy=function(){this.parent&&this.parent&&this.parent.isDestroyed};Fo=hp;function hp(e){this.allDay=!1,this.parent=e}dp.prototype.initializeExcelExport=function(e){var t,i=this.getExportColumns(e=void 0===e?{}:e),n=e.fileName||"Schedule",r=e.exportType||"xlsx",a=e.includeOccurrences||!1;B.isNullOrUndefined(e.separator)||","===e.separator||(t=e.separator),e=e.customData?a?this.parent.eventBase.getProcessedEvents(e.customData):e.customData:a?this.parent.eventsProcessed:this.parent.eventsData,this.processWorkbook(i,n,r,e,t)},dp.prototype.processWorkbook=function(t,i,n,e,r){var a=this,s=[],o=[],l=[],p=(t.forEach(function(e,t){s.push({index:t+1,width:"Id"===e.name?50:150})}),{fontSize:12,borders:{color:"#E0E0E0"},bold:!0}),e=(t.forEach(function(e,t){l.push({index:t+1,value:e.text,style:p})}),o.push({index:1,cells:l}),e.forEach(function(i,e){var n=[];t.forEach(function(e,t){t={index:t+1,value:i[e.name]||""};e.name!==a.parent.eventFields.startTime&&e.name!==a.parent.eventFields.endTime||(t=B.extend({},t,{style:{fontSize:12,numberFormat:"m/d/yyyy h:mm a"}},!0)),n.push(t)}),o.push({index:e+2,cells:n})}),[{columns:s,rows:o}]);this.parent.trigger(Se,{cancel:!1,worksheets:e},function(e){e.cancel||new L.Workbook({worksheets:e.worksheets},n,a.parent.locale,void 0,r).save(i+"."+n)})},dp.prototype.getExportColumns=function(e){var t=this,i=e.fieldsInfo||[];return 0===i.length&&(e.fields||Object.keys(this.parent.eventFields).map(function(e){return t.parent.eventFields[""+e]})).forEach(function(e){i.push({name:e,text:e})}),i},dp.prototype.getModuleName=function(){return"excelExport"},dp.prototype.destroy=function(){this.parent=null};u=dp;function dp(e){this.parent=e}up.prototype.print=function(e){B.isNullOrUndefined(e)?this.printScheduler():this.printSchedulerWithModel(e)},up.prototype.printScheduler=function(){var l=this,p=this.parent.element.cloneNode(!0);p.id=this.parent.element.id+"_print",this.parent.trigger(be,{cancel:!1,printElement:p},function(e){if(!e.cancel){document.body.appendChild(p);for(var t="MonthAgenda"===l.parent.currentView?".e-appointment-wrap":".e-content-wrap",i=l.parent.element.querySelector(t),n="",r=0,a=[].slice.call(document.getElementsByTagName("head")[0].querySelectorAll("link, style"));r<a.length;r++)n+=a[r].outerHTML;var e=B.createElement("div"),s=(p.style.width=l.parent.element.offsetWidth+"px",100*Math.round(parseInt(p.style.width,10)/100)),o=(e.appendChild(p),window.open("","print","height=550,width="+s+",tabbar=no"));o.document.write("<!DOCTYPE html><html><head>"+n+"</head><body>"+e.innerHTML+"<script>(function() { window.ready = true; })();<\/script></body></html>"),o.document.close(),o.focus(),setTimeout(function(){var e;o.ready&&i&&(i.scrollLeft=i.scrollLeft,i.scrollTop=i.scrollTop,(e=o.document.querySelector(".e-date-header-wrap"))&&(e.scrollLeft=i.scrollLeft),(e=o.document.querySelector(".e-time-cells-wrap"))&&(e.scrollTop=i.scrollTop),(e=o.document.querySelector(t))&&(e.scrollLeft=i.scrollLeft,e.scrollTop=i.scrollTop),o.print(),o.close())},500)}})},up.prototype.printSchedulerWithModel=function(e){var t=this,i=B.createElement("div",{id:this.parent.element.id+"_print",className:"e-print-schedule"}),e=(document.body.appendChild(i),ll.Inject(Sl,xl,Ml,Pl,Yl,Xl,ep,rp,Ll,lp),this.printInstance=new ll(this.getPrintScheduleModel(e)),this.printInstance.isPrinting=!0,this.printInstance.registeredTemplate=this.parent.registeredTemplate,this.printInstance.root=this.parent.root||this.parent,this.printInstance.appendTo(i),{cancel:!1,printElement:i});this.parent.trigger(be,e,function(e){e.cancel?t.printCleanup():(t.printInstance.on(Oe,t.contentReady,t),t.printWindow=window.open("","print","height="+window.outerHeight+",width="+window.outerWidth+",tabbar=no"),t.printWindow.moveTo(0,0),t.printWindow.resizeTo(screen.availWidth,screen.availHeight))})},up.prototype.getPrintScheduleModel=function(e){for(var t,i,n={},r=["cellHeaderTemplate","dayHeaderTemplate","monthHeaderTemplate","cellTemplate","dateHeaderTemplate","dateRangeTemplate","eventTemplate","resourceHeaderTemplate","headerIndentTemplate"],a=["actionBegin","actionComplete","actionFailure","created","dataBinding","dataBound","destroyed","eventRendered","moreEventsClick","navigating","popupOpen","popupClose","renderCell"],s=0,o=["agendaDaysCount","calendarMode","cssClass","currentView","dateFormat","enableRtl","endHour","eventSettings","firstDayOfWeek","firstMonthOfYear","group","height","locale","maxDate","minDate","readonly","resources","rowAutoHeight","selectedDate","showHeaderBar","showTimeIndicator","showWeekNumber","showWeekend","startHour","timeFormat","timeScale","timezone","views","width","workDays","workHours","dateHeaderTemplate","dateRangeTemplate","cellHeaderTemplate","dayHeaderTemplate","monthHeaderTemplate","cellTemplate","resourceHeaderTemplate","headerIndentTemplate","actionBegin","actionComplete","actionFailure","created","dataBinding","dataBound","destroyed","eventRendered","moreEventsClick","navigating","popupOpen","popupClose","renderCell"];s<o.length;s++){var l=o[s];switch(l){case"eventSettings":(t=Object.assign({},this.parent.eventSettings.properties)).dataSource=this.parent.eventsData;var p=(B.isNullOrUndefined(e.eventSettings)||B.isNullOrUndefined(e.eventSettings.template)?t:e.eventSettings).template;t.template=this.parent.isAngular||"function"!=typeof p?p:null,n.eventSettings=t;break;case"group":(p=(B.isNullOrUndefined(e.group)?this.parent:e).group).headerTooltipTemplate=null,n.group=p;break;case"timeScale":t=(B.isNullOrUndefined(e.timeScale)?this.parent:e).timeScale,this.parent.isAngular||(t.majorSlotTemplate="function"==typeof t.majorSlotTemplate?null:t.majorSlotTemplate,t.minorSlotTemplate="function"==typeof t.minorSlotTemplate?null:t.minorSlotTemplate),n.timeScale=t;break;case"views":if(i=(B.isNullOrUndefined(e.views)?this.parent:e).views,!this.parent.isAngular&&i&&0<i.length&&"object"==typeof i[0])for(var c=0,h=i;c<h.length;c++)!function(t){r.forEach(function(e){B.isNullOrUndefined(t[""+e])||(t[""+e]="function"==typeof t[""+e]?null:t[""+e])})}(h[c]);n.views=i;break;default:-1<r.indexOf(l)?n[""+l]=B.isNullOrUndefined(e[""+l])?this.parent.isAngular||"function"!=typeof this.parent[""+l]?this.parent[""+l]:null:this.parent.isAngular||"function"!=typeof e[""+l]?e[""+l]:null:-1<a.indexOf(l)?n[""+l]=e[""+l]:n[""+l]=(B.isNullOrUndefined(e[""+l])?this.parent:e)[""+l]}}return n},up.prototype.contentReady=function(){var e=this;this.printWindow=B.print(this.printInstance.element,this.printWindow),this.closePrintWindow(this.printWindow,!0),this.printWindow.onbeforeunload=function(){e.printCleanup()}},up.prototype.closePrintWindow=function(e,t){var i,n=this;B.Browser.isIos&&(i=setInterval(function(){e.opener?e.close():B.isNullOrUndefined(e.opener)&&(t&&n.printCleanup(),clearInterval(i))},500))},up.prototype.printCleanup=function(){this.printInstance&&(this.printInstance.off(Oe,this.contentReady),this.printInstance.element.remove(),this.printInstance.destroy(),this.printInstance=null),this.printWindow&&(this.printWindow.onbeforeunload=null,this.printWindow=null)},up.prototype.getModuleName=function(){return"print"},up.prototype.destroy=function(){this.parent=null};Vo=up;function up(e){this.parent=e}e.Agenda=Yl,e.DEFAULT_WEEKS=6,e.Day=Sl,e.DragAndDrop=cs,e.ExcelExport=u,e.Gregorian=Zr,e.HeaderRenderer=Br,e.ICalendarExport=ko,e.ICalendarImport=Fo,e.Islamic=$r,e.MS_PER_DAY=W,e.MS_PER_MINUTE=je,e.Month=Pl,e.MonthAgenda=Xl,e.Print=Vo,e.RecurrenceEditor=co,e.Resize=$o,e.Schedule=ll,e.TimelineMonth=rp,e.TimelineViews=ep,e.TimelineYear=lp,e.Timezone=ta,e.ViewBase=hs,e.WEEK_LENGTH=7,e.Week=xl,e.WorkWeek=Ml,e.Year=Ll,e.actionBegin=Q,e.actionComplete=K,e.actionFailure=Z,e.addDays=Y,e.addMonths=Ke,e.addYears=Ze,e.agendaCells=ye,e.beforePaste=De,e.beforePrint=be,e.capitalizeFirstWord=y,e.cellClick=q,e.cellDoubleClick=F,e.cellMouseDown=Pe,e.cellSelect=ge,e.contentReady=Ve,e.dataBinding=ne,e.dataBound=re,e.dataReady=Ee,e.dateHeader=we,e.documentClick=Re,e.documentPaste=He,e.drag=le,e.dragStart=oe,e.dragStop=pe,e.eventClick=ee,e.eventDoubleClick=te,e.eventRendered=ie,e.eventsLoaded=xe,e.excelExport=Se,e.extractObjectFromRule=xa,e.findIndexInData=st,e.firstDateOfMonth=We,e.generate=sa,e.generateSummary=ra,e.getCalendarUtil=Ia,e.getDateCount=Qe,e.getDateFromRecurrenceDateString=oa,e.getDateFromString=tt,e.getDateInMs=Xe,e.getDaysCount=et,e.getElementHeight=gt,e.getElementHeightFromClass=Ne,e.getElementTop=mt,e.getElementWidth=ut,e.getElementWidthFromClass=Le,e.getMaxDays=$e,e.getOuterHeight=ot,e.getRecurrenceStringFromDate=Wa,e.getScrollBarWidth=rt,e.getStartEndHours=Je,e.getTranslateX=Fe,e.getTranslateY=qe,e.getUniversalTime=ct,e.getWeekFirstDate=Ue,e.getWeekLastDate=Be,e.getWeekMiddleDate=_e,e.getWeekNumber=Ye,e.hover=X,e.initialEnd="initial-end",e.initialLoad="initial-load",e.inlineClick=ue,e.isDaylightSavingTime=pt,e.isIPadDevice=dt,e.isMobile=ht,e.lastDateOfMonth=ze,e.moreEventsClick=U,e.navigating=J,e.noEvents=fe,e.popupClose=se,e.popupOpen=ae,e.print=Oe,e.removeChildren=lt,e.renderCell=$,e.resetScrollbarWidth=at,e.resetTime=z,e.resizeStart=ce,e.resizeStop=de,e.resizing=he,e.resourceHeader=Te,e.scroll=Ae,e.scrollUiUpdate=Me,e.select=G,e.setTime=Ge,e.timezoneData=na,e.tooltipOpen=Ce,e.uiUpdate=ke,e.virtualScroll=Ie,e.virtualScrollStart=me,e.virtualScrollStop=ve,Object.defineProperty(e,"__esModule",{value:!0})});
|
|
11
11
|
//# sourceMappingURL=ej2-schedule.umd.min.js.map
|