$((function(){var e="";$("#scheduler").dxScheduler({dataSource:t(schedulers),showCurrentTimeIndicator:!0,showAllDayPanel:!0,editing:{allowAdding:hasRole("00602"),allowDeleting:hasRole("00604"),allowDragging:hasRole("00603"),allowEditingTimeZones:!1,allowResizing:hasRole("00603"),allowUpdating:hasRole("00603")},views:[{type:"agenda",groupOrientation:"horizontal",cellDuration:30,intervalCount:1},{type:"day",groupOrientation:"horizontal",cellDuration:30,intervalCount:1},{type:"timelineDay",groupOrientation:"vertical",cellDuration:30,intervalCount:1},{type:"workWeek",groupOrientation:"vertical",cellDuration:30,intervalCount:1},{type:"month",groupOrientation:"horizontal",cellDuration:30,intervalCount:2,maxAppointmentsPerCell:"auto"}],currentView:"day",crossScrollingEnabled:!0,currentDate:new Date,startDayHour:7,endDayHour:20,groups:["staffID"],descriptionExpr:"content",textExpr:"title",startDateExpr:"fromDateTime",endDateExpr:"toDateTime",onAppointmentFormOpening:function(e){},onAppointmentUpdating:function(t){var a=t.newData;a.branchID=n(a.staffID),"undefined"===typeof a.id?"undefined"!==typeof e.success&&!0===e.success?(a.id=e.message,t.cancel=_globals.apiUpdateData(a,"scheduler","SchedulerModel")):t.cancel=!1:t.cancel=_globals.apiUpdateData(a,"scheduler","SchedulerModel")},onAppointmentDeleting:function(n){var t=n.appointmentData;"undefined"===typeof t.id?"undefined"!==typeof e.success&&!0===e.success?(t.id=e.message,n.cancel=_globals.apiDeleteData(t.id,"scheduler")):n.cancel=!1:n.cancel=_globals.apiDeleteData(t.id,"scheduler")},onAppointmentAdding:function(e){var t=e.appointmentData;t.branchID=n(t.staffID),"undefined"===typeof t.recurrenceRule&&(t.recurrenceRule=""),e.cancel=_globals.apiInsertData(t,"scheduler","SchedulerModel")},onAppointmentAdded:function(n){var t=setInterval((function(){""===e?e=_globals.IdOfInserted():clearInterval(t)}),100)},resources:[{fieldExpr:"staffID",allowMultiple:!1,dataSource:staffs,displayExpr:"name",label:_globals.language.staff}],showCurrentTimeIndicator:!0});function n(e){let n=staffs.find((function(n){return n.id===e}));return"undefined"!==typeof n&&null!=n?n.branchID:""}function t(e){return e.forEach((function(e,n){e.fromDateTime=e.fromDateTime.replace(/-/g,"/"),e.toDateTime=e.toDateTime.replace(/-/g,"/")})),e}}));