@progress/kendo-react-scheduler
Version:
React Scheduler brings the functionality of Outlook's Calendar to a single UI component. KendoReact Scheduler package
15 lines • 145 kB
JavaScript
/**
* @license
*-------------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the package root for more information
*-------------------------------------------------------------------------------------------
*/
/**
* @license
*-------------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the package root for more information
*-------------------------------------------------------------------------------------------
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("prop-types"),require("@progress/kendo-date-math"),require("@progress/kendo-react-common"),require("@progress/kendo-data-query"),require("@progress/kendo-react-intl"),require("@progress/kendo-react-buttons"),require("@progress/kendo-react-dateinputs"),require("@progress/kendo-react-popup"),require("@progress/kendo-svg-icons"),require("react-dom"),require("@progress/kendo-react-form"),require("@progress/kendo-react-dialogs"),require("@progress/kendo-react-labels"),require("@progress/kendo-react-inputs"),require("@progress/kendo-react-dropdowns"),require("@progress/kendo-recurrence")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","@progress/kendo-date-math","@progress/kendo-react-common","@progress/kendo-data-query","@progress/kendo-react-intl","@progress/kendo-react-buttons","@progress/kendo-react-dateinputs","@progress/kendo-react-popup","@progress/kendo-svg-icons","react-dom","@progress/kendo-react-form","@progress/kendo-react-dialogs","@progress/kendo-react-labels","@progress/kendo-react-inputs","@progress/kendo-react-dropdowns","@progress/kendo-recurrence"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoReactScheduler={},e.React,e.PropTypes,e.KendoDateMath,e.KendoReactCommon,e.KendoDataQuery,e.KendoReactIntl,e.KendoReactButtons,e.KendoReactDateinputs,e.KendoReactPopup,e.KendoSvgIcons,e.ReactDOM,e.KendoReactForm,e.KendoReactDialogs,e.KendoReactLabels,e.KendoReactInputs,e.KendoReactDropdowns,e.KendoRecurrence)}(this,(function(e,t,r,a,n,l,o,s,c,i,d,u,m,p,g,E,h,y){"use strict";function v(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,a.get?a:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var f=v(t),k=v(u);const D=(e,t=0,r=0,a=[])=>{if(e.length<=t)return[a];const n=[];return e[t].data.map((l=>{n.push(...D(e,t+1,r+1,[...a,{...l,field:e[t].field,valueField:e[t].valueField,colorField:e[t].colorField,multiple:e[t].multiple}]))})),n};function S(e,t){const r=[];if(!t||!t.length)return r;if(e&&e.resources&&e.resources.length){const a=e.resources;for(let e=0;e<a.length;e++){const n=t.find((t=>t.name===a[e]));r.push(n)}}return r}const C=(e,t=e.length-1)=>{const r=Math.max(0,t),a=[];e&&e.length||(e=[{}]);const n=(e[r].data||[]).map((t=>({...t,text:t[e[r].textField]})))||[],l=n.length;let o=1;for(let t=0;t<=r;t++)o*=(e[t].data||[]).length||1;for(let e=0;e<o;e++)n[e%l]&&a.push(n[e%l]);return a},b=e=>{if(!e)return{top:0,left:0,width:0,height:0,right:0};return{top:e.offsetTop,left:e.offsetLeft,right:e.offsetParent?e.offsetParent.offsetWidth-(e.offsetLeft+e.offsetWidth):0,width:e.offsetWidth,height:e.offsetHeight}},I=(e,t=!1)=>parseFloat(window.getComputedStyle(e)[t?"paddingLeft":"paddingTop"]||"0")+parseFloat(window.getComputedStyle(e)[t?"paddingRight":"paddingBottom"]||"0"),w=(e,t,r=!1)=>{e&&(void 0!==t.top&&(e.style.top=`${t.top}px`),void 0!==t.left&&(e.style.left=`${t.left}px`),void 0!==t.width&&(e.style.width=`${t.width}px`),void 0!==t.height&&!r&&(e.style.height="number"==typeof t.height?`${t.height}px`:t.height),r&&(e.style.minHeight=void 0!==t.height&&t.height>0?`${t.height}px`:""))},T=e=>e[0],R=e=>e[e.length-1],x=e=>{const t=new Set;return e.forEach((e=>{t.add(e.field)})),t.size===e.length};const A=(e,t,r,a=0)=>{if(a===r)return null;let n=null;const l=document.elementFromPoint(e,t);if(!l)return n;if("true"===l.getAttribute("data-slot"))return l;const o=l.style.pointerEvents;return l.style.pointerEvents="none",n=A(e,t,r,a+1),l.style.pointerEvents=o,n},_=(e,t)=>n.getter(t)(e),N=(e,t,r)=>{if(t)return n.setter(t)(e,r)},M=e=>null!=e;function z(e){return new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()))}const L=(e,t,r)=>{const a=O(e,t)?_(e,t.id):_(e,t.recurrenceId);return r.find((e=>_(e,t.id)===a))},O=(e,t)=>{const r=_(e,t.id),a=_(e,t.recurrenceId),n=_(e,t.recurrenceRule);return!(!r||!n||null!=a)},F=(e,t)=>Math.max(e.getTime(),t.getTime()),P=(e,t)=>Math.min(e.getTime(),t.getTime()),W=(e,t,r,a,n=!1)=>n?F(t,a)-P(e,r)<=t.getTime()-e.getTime()+(a.getTime()-r.getTime()):F(t,a)-P(e,r)<t.getTime()-e.getTime()+(a.getTime()-r.getTime()),H={id:"id",start:"start",startTimezone:"startTimezone",originalStart:"originalStart",end:"end",endTimezone:"endTimezone",isAllDay:"isAllDay",title:"title",description:"description",recurrenceRule:"recurrenceRule",recurrenceId:"recurrenceId",recurrenceExceptions:"recurrenceExceptions"},K=(e,t,r)=>(t.getHours()<e.getHours()||t.getHours()===e.getHours()&&t.getMinutes()<=e.getMinutes())&&(e.getHours()<r.getHours()||r.getHours()===e.getHours()&&e.getMinutes()<r.getMinutes()),V=(e,t,r)=>t<r?t<=e&&e<=r:e<=r||t<=e,G=e=>{let t=0;const r=e.slice();return r.sort(((e,t)=>e-t)).forEach(((e,a)=>{r[a]===a&&(t=a+1)})),t},B=(e,t,r=!1)=>{t.forEach((e=>e.items.splice(0,e.items.length))),t.forEach((t=>{const a=[];e.forEach((e=>{if((r||e.isAllDay===t.isAllDay)&&e.range.index===t.range.index&&e.group.index===t.group.index&&W(e.start,e.end,t.start,t.end)){const r=G(a);(null===e.order||void 0===e.order||e.order<r)&&(e.order=r),a.splice(e.order,0,e.order),t.items.push(e)}}))}))},U=(e,t,r=!1)=>{e.forEach((e=>e.slots.splice(0,e.slots.length))),e.forEach((e=>{t.forEach((t=>{(r||e.isAllDay===t.isAllDay)&&e.range.index===t.range.index&&e.group.index===t.group.index&&W(e.start,e.end,t.start,t.end)&&e.slots.push(t)}))}))},Z=(...e)=>{},$=(e,t,r=!1,a=!1)=>{const n=e.current;if(!n||!t)return null;const o=t.filter((e=>null!==e.current&&null!==e.current.element)),s=l.orderBy(o,[{field:"current.props.group.index",dir:"asc"},{field:"current.props.range.index",dir:"asc"},r?{field:""}:{field:"current.props.isAllDay",dir:"desc"},{field:"current.props.start",dir:"asc"}]),c=s.findIndex((e=>null!==e.current&&!(e.current.props.uid!==n.props.uid||void 0!==e.current.props.occurrenceId&&e.current.props.occurrenceId!==n.props.occurrenceId||e.current.props.group.index!==n.props.group.index||e.current.props.range.index!==n.props.range.index||!r&&e.current.props.isAllDay!==n.props.isAllDay)));return s[c+(a?-1:1)]},q=(e,t)=>(e.order||0)-(t.order||0),Y=6e4,j=[{}],X=new Date(1900,0,1),Q=new Date(2099,11,31);a.ZonedDate.fromLocalDate(X),a.ZonedDate.fromLocalDate(Q);var J=(e=>(e[e.create=0]="create",e[e.update=1]="update",e[e.remove=2]="remove",e))(J||{});const ee=f.createContext({current:null}),te=()=>f.useContext(ee);ee.displayName="SchedulerElementContext";const re=f.createContext({}),ae=()=>f.useContext(re);re.displayName="SchedulerPropsContext";const ne=f.createContext([]),le=()=>f.useContext(ne);ne.displayName="SchedulerViewsContext";const oe=f.createContext(H),se=()=>f.useContext(oe);oe.displayName="SchedulerFieldsContext";const ce=f.createContext({dateFormat:"{0:D}",shortDateFormat:"{0:d}"});ce.displayName="SchedulerDateFormatContext";const ie=f.createContext([{index:0,resources:[]}]),de=()=>f.useContext(ie);ie.displayName="SchedulerGroupsContext";const ue=f.createContext({start:new Date,end:new Date,zonedStart:a.ZonedDate.fromLocalDate(new Date),zonedEnd:a.ZonedDate.fromLocalDate(new Date)}),me=()=>f.useContext(ue);ue.displayName="SchedulerDateRangeContext";const pe=f.createContext(null),ge=()=>f.useContext(pe);pe.displayName="SchedulerOrientationContext";const Ee=f.createContext([new Date,Z]),he=()=>f.useContext(Ee);Ee.displayName="SchedulerDateContext";const ye=f.createContext([[],Z]),ve=()=>f.useContext(ye);ye.displayName="SchedulerDataContext";const fe=f.createContext(["day",Z]),ke=()=>f.useContext(fe);fe.displayName="SchedulerActiveViewContext";const De=f.createContext([null,()=>{}]);De.displayName="SchedulerItemSelectionContext";const Se=({children:e,element:t,props:r,views:a,fields:n,groups:l,dateRange:o,dateFormat:s,orientation:c,date:i,data:d,activeView:u,selection:m})=>f.createElement(ee.Provider,{value:t},f.createElement(re.Provider,{value:r},f.createElement(ne.Provider,{value:a},f.createElement(oe.Provider,{value:n},f.createElement(ce.Provider,{value:s},f.createElement(ie.Provider,{value:l},f.createElement(ue.Provider,{value:o},f.createElement(pe.Provider,{value:c},f.createElement(Ee.Provider,{value:i},f.createElement(ye.Provider,{value:d},f.createElement(fe.Provider,{value:u},f.createElement(De.Provider,{value:m},e)))))))))))),Ce=(e,t,r)=>{const[a,n]=f.useState(t||e),l=f.useCallback(((e,t)=>{n(e),r&&r.call(void 0,{...t,value:e})}),[r,n]);return[void 0!==t?t:a,l]},be=f.forwardRef(((e,t)=>{const{className:r,...a}=e,l=f.useRef(null),o=f.useRef(null);f.useImperativeHandle(o,(()=>({element:l.current,props:e}))),f.useImperativeHandle(t,(()=>o.current));const c=f.useMemo((()=>n.classNames("k-scheduler-toolbar",r)),[r]);return f.createElement(s.Toolbar,{id:e.id,ref:e=>{e&&(l.current=e.element)},className:c,...a},e.children)}));be.displayName="KendoReactSchedulerHeader";const Ie=f.forwardRef(((e,t)=>{const{className:r,...a}=e,l=f.useRef(null);return f.useImperativeHandle(t,(()=>({element:l.current,props:e}))),f.createElement(s.ToolbarItem,{ref:e=>{e&&(l.current=e.element)},className:n.classNames(r),...a},e.children)}));Ie.displayName="KendoReactSchedulerSchedulerNavigation";const we=f.forwardRef(((e,t)=>{const{className:r,...a}=e,l=f.useRef(null);return f.useImperativeHandle(t,(()=>({element:l.current,props:e}))),f.createElement(s.ToolbarItem,{ref:e=>{e&&(l.current=e.element)},className:n.classNames("k-scheduler-views",r),...a},e.children)}));we.displayName="KendoReactSchedulerViewSelector";const Te=f.forwardRef(((e,t)=>{const{className:r,style:a,...l}=e,o=f.useRef(null),c=f.useRef(null);f.useImperativeHandle(o,(()=>({element:c.current,props:e}))),f.useImperativeHandle(t,(()=>o.current));const i=f.useMemo((()=>n.classNames("k-scheduler-footer",e.className)),[e.className]);return f.createElement(s.Toolbar,{ref:e=>{e&&(c.current=e.element)},className:i,style:{boxShadow:"none",...a},...l},e.children)}));Te.displayName="KendoReactSchedulerFooter";const Re="scheduler.allEvents",xe="scheduler.allDay",Ae="scheduler.today",_e="scheduler.timelineViewTitle",Ne="scheduler.weekViewTitle",Me="scheduler.workWeekViewTitle",ze="scheduler.agendaViewTitle",Le="scheduler.dayViewTitle",Oe="scheduler.monthViewTitle",Fe="scheduler.deleteTitle",Pe="scheduler.previousTitle",We="scheduler.nextTitle",He="scheduler.showFullDay",Ke="scheduler.showWorkDay",Ve="scheduler.editOccurrence",Ge="scheduler.editSeries",Be="scheduler.editRecurringConfirmation",Ue="scheduler.editRecurringDialogTitle",Ze="scheduler.editSave",$e="scheduler.editCancel",qe="scheduler.editorTitle",Ye="scheduler.editorEventTitle",je="scheduler.editorEventStart",Xe="scheduler.editorEventStartTimeZone",Qe="scheduler.editorEventEnd",Je="scheduler.editorEventEndTimeZone",et="scheduler.editorEventAllDay",tt="scheduler.editorEventDescription",rt="scheduler.editorEventSeparateTimeZones",at="scheduler.editorEventTimeZone",nt="scheduler.recurrenceEditorRepeat",lt="scheduler.recurrenceEditorWeeklyRepeatOn",ot="scheduler.recurrenceEditorMonthlyDay",st="scheduler.recurrenceEditorMonthlyRepeatOn",ct="scheduler.recurrenceEditorYearlyOf",it="scheduler.recurrenceEditorYearlyRepeatOn",dt="scheduler.recurrenceEditorEndAfter",ut="scheduler.recurrenceEditorEndOccurrence",mt="scheduler.recurrenceEditorEndLabel",pt="scheduler.recurrenceEditorEndNever",gt="scheduler.recurrenceEditorEndOn",Et="scheduler.editorDelete",ht="scheduler.deleteConfirmation",yt="scheduler.deleteRecurringConfirmation",vt="scheduler.deleteOccurrence",ft="scheduler.deleteSeries",kt="scheduler.deleteDialogTitle",Dt="scheduler.deleteRecurringDialogTitle",St="scheduler.dateTitle",Ct="scheduler.timeTitle",bt="scheduler.eventTitle",It="scheduler.editorValidationRequired",wt="scheduler.editorValidationStart",Tt="scheduler.editorValidationEnd",Rt="scheduler.noEvents",xt="scheduler.moreEvents",At={[It]:"Field is required.",[wt]:"Start time must be before End time.",[Tt]:"End time must be after Start time.",[Re]:"All events",[xe]:"all day",[Ae]:"Today",[Le]:"Day",[Oe]:"Month",[Ne]:"Week",[Me]:"Work Week",[_e]:"Timeline",[ze]:"Agenda",[Fe]:"Delete",[Pe]:"Previous",[We]:"Next",[He]:"Show full day",[Ke]:"Show business hours",[Ve]:"Edit current occurrence",[Ge]:"Edit the series",[Be]:"Do you want to edit only this event occurrence or the whole series?",[Ue]:"Edit Recurring Item",[Ze]:"Save",[$e]:"Cancel",[Et]:"Delete",[qe]:"Event",[Ye]:"Title",[je]:"Start",[Xe]:"Start Time Zone",[Qe]:"End",[Je]:"End Time Zone",[et]:"All Day Event",[tt]:"Description",[rt]:"End in different Time Zone",[at]:"Specify Time Zone",[nt]:"Repeat","scheduler.recurrenceEditorDailyInterval":"day(s)","scheduler.recurrenceEditorDailyRepeatEvery":"Repeat every","scheduler.recurrenceEditorWeeklyInterval":"week(s)","scheduler.recurrenceEditorWeeklyRepeatEvery":"Repeat every",[lt]:"Repeat on",[ot]:"Day","scheduler.recurrenceEditorMonthlyInterval":"month(s)","scheduler.recurrenceEditorMonthlyRepeatEvery":"Repeat every",[st]:"Repeat on",[ct]:"of","scheduler.recurrenceEditorYearlyRepeatEvery":"Repeat every",[it]:"Repeat on","scheduler.recurrenceEditorYearlyInterval":"year(s)","scheduler.recurrenceEditorFrequenciesDaily":"Daily","scheduler.recurrenceEditorFrequenciesMonthly":"Monthly","scheduler.recurrenceEditorFrequenciesNever":"Never","scheduler.recurrenceEditorFrequenciesWeekly":"Weekly","scheduler.recurrenceEditorFrequenciesYearly":"Yearly","scheduler.recurrenceEditorOffsetPositionsFirst":"First","scheduler.recurrenceEditorOffsetPositionsSecond":"Second","scheduler.recurrenceEditorOffsetPositionsThird":"Third","scheduler.recurrenceEditorOffsetPositionsFourth":"Fourth","scheduler.recurrenceEditorOffsetPositionsLast":"Last","scheduler.recurrenceEditorWeekdaysDay":"Day","scheduler.recurrenceEditorWeekdaysWeekday":"Weekday","scheduler.recurrenceEditorWeekdaysWeekendday":"Weekend Day",[dt]:"After",[ut]:"occurrence(s)",[mt]:"End",[pt]:"Never",[gt]:"On",[ht]:"Are you sure you want to delete this event?",[yt]:"Do you want to delete only this event occurrence or the whole series?",[vt]:"Delete current occurrence",[ft]:"Delete the series",[kt]:"Delete Event",[Dt]:"Delete Recurring Item",[St]:"Date",[Ct]:"Time",[bt]:"Event",[Rt]:"no events",[xt]:"More events"},_t=f.forwardRef(((e,t)=>{var r;const l=f.useRef(null),u=f.useRef(null);f.useImperativeHandle(t,(()=>l.current));const{timezone:m}=ae(),p=a.ZonedDate.fromLocalDate(e.value,m),g=a.getDate(p),E=te(),h=n.useWindow(E),[y,v]=f.useState("desktop"),[k,D]=f.useState(!1),[S,C]=f.useState(!1),b=o.useInternationalization(),{dateFormat:I,shortDateFormat:w}=f.useContext(ce),T=me(),[R]=he(),x=T.end.getTime()-T.start.getTime()>27*a.MS_PER_DAY,A=b.format(I,x?R:T.zonedStart,x?R:T.zonedEnd.addDays(-1)),_=b.format(w,x?R:T.zonedStart,x?R:T.zonedEnd.addDays(-1)),N=f.useCallback((()=>{D(!k)}),[k]),M=f.useCallback((()=>{C(!0)}),[]),L=f.useCallback((()=>{D(!1),C(!1)}),[]),O=f.useCallback((t=>{if(e.onChange){const r=a.ZonedDate.fromUTCDate(z(t.value),m);e.onChange.call(void 0,{...t,value:r})}D(!1)}),[e.onChange,m]),F=f.useCallback((()=>{h().matchMedia&&v(h().matchMedia("(min-width: 1024px)").matches?"desktop":"mobile")}),[h]);f.useEffect((()=>{F();const e=h().ResizeObserver,t=e&&new e(F);return t&&t.observe(E.current),()=>{e&&t.disconnect()}}),[F,E,h]),f.useEffect((()=>{k&&S&&u.current&&u.current.focus()}),[S,k]);const{onFocus:P,onBlur:W}=n.useAsyncFocusBlur({onFocus:M,onBlur:L});return f.createElement(f.Fragment,null,f.createElement(s.Button,{ref:l,onFocus:P,onBlur:W,fillMode:"flat",className:"k-nav-current",icon:"calendar",svgIcon:d.calendarIcon,"aria-live":"polite",tabIndex:-1,onClick:N},"desktop"===y?A:_),f.createElement(i.Popup,{anchor:null==(r=l.current)?void 0:r.element,show:k},f.createElement(c.Calendar,{ref:u,onFocus:P,onBlur:W,onChange:O,value:g})))}));_t.displayName="KendoReactSchedulerNavigationDatePicker";const Nt=e=>{const[t,r]=ke(),a=o.useLocalization(),n=f.useMemo((()=>"function"==typeof e.view.title?e.view.title.call(void 0,a):e.view.title),[e.view.title,a]),l=f.useCallback((()=>{e.view.name&&r(e.view.name)}),[r,e.view.name]);return f.createElement(s.Button,{className:"k-toolbar-button",role:"button",type:"button",tabIndex:-1,togglable:!0,selected:e.view.name===t,onClick:l},n)},Mt=f.forwardRef((()=>{const e=f.useRef(null),[t,r]=f.useState("desktop"),a=le(),l=n.useWindow(e),[c,i]=ke(),u=a.find((e=>e.props.name===c)),m=o.useLocalization(),p=f.useCallback((e=>{i&&(e.syntheticEvent.preventDefault(),i(e.item.name))}),[i]),g=()=>{l().matchMedia&&r(l().matchMedia("(min-width: 1024px)").matches?"desktop":"mobile")};return f.useEffect((()=>{g();const t=l().ResizeObserver,r=t&&new t(g);return r&&r.observe(e.current),()=>{r&&r.disconnect()}}),[]),f.createElement("div",{className:n.classNames("k-toolbar-button-group k-button-group k-button-group-solid",{"k-scheduler-views":"desktop"===t,"k-scheduler-tools":"mobile"===t}),role:"group",ref:e},u&&"mobile"===t&&f.createElement(s.DropDownButton,{className:"k-views-dropdown",onItemClick:p,popupSettings:{popupClass:"k-scheduler-toolbar"},textField:"title",items:a.map((e=>({...e.props,selected:e.props.name===c,title:"function"==typeof e.props.title?e.props.title.call(void 0,m):e.props.title}))),text:f.createElement(f.Fragment,null,"function"==typeof u.props.title?u.props.title.call(void 0,m):u.props.title,f.createElement(n.IconWrap,{name:"caret-alt-down",icon:d.caretAltDownIcon}))}),"desktop"===t&&f.createElement(f.Fragment,null,a.map((e=>f.createElement(Nt,{key:e.props.name,view:e.props})))))}));Mt.displayName="KendoReactSchedulerViewSelectorList";const zt=f.forwardRef(((e,t)=>{const{className:r,...a}=e,l=f.useRef(null);return f.useImperativeHandle(t,(()=>({element:l.current,props:e}))),f.createElement(s.ToolbarItem,{ref:e=>{e&&(l.current=e.element)},className:n.classNames("k-scheduler-navigation",r),...a},e.children)})),Lt=f.createContext({});Lt.displayName="SchedulerViewPropsContext";const Ot=f.createContext([]),Ft=()=>f.useContext(Ot);Ot.displayName="SchedulerViewRangesContext";const Pt=f.createContext([[],Z]),Wt=()=>f.useContext(Pt);Pt.displayName="SchedulerViewSlotsContext";const Ht=f.createContext([[],Z]),Kt=()=>f.useContext(Ht);Ht.displayName="SchedulerViewItemsContext";const Vt=f.createContext([[],Z]);Vt.displayName="SchedulerViewSelectedSlotsContext";const Gt=f.createContext([[],Z]),Bt=()=>f.useContext(Gt);Gt.displayName="SchedulerViewSelectedItemsContext";const Ut=f.createContext([[],Z]);Ut.displayName="SchedulerViewFocusedItemsContext";const Zt=f.createContext([[],Z]),$t=()=>f.useContext(Zt);Zt.displayName="SchedulerViewFocusedSlotsContext";const qt=({children:e,props:t,ranges:r,slots:a,items:n,selectedSlots:l,selectedItems:o,focusedItems:s,focusedSlots:c})=>f.createElement(Lt.Provider,{value:t},f.createElement(Ot.Provider,{value:r},f.createElement(Pt.Provider,{value:a},f.createElement(Ht.Provider,{value:n},f.createElement(Vt.Provider,{value:l},f.createElement(Gt.Provider,{value:o},f.createElement(Ut.Provider,{value:s},f.createElement(Zt.Provider,{value:c},e))))))));var Yt=(e=>(e.select="ITEMS_SELECT_SELECT",e.selectNext="ITEMS_SELECT_SELECT_NEXT",e.selectPrev="ITEMS_SELECT_SELECT_PREV",e.reset="ITEMS_SELECT_RESET",e.add="ITEMS_SELECT_ADD",e.remove="ITEMS_SELECT_REMOVE",e))(Yt||{});var jt=(e=>(e.select="SLOTS_SELECT_SELECT",e.reset="SLOTS_SELECT_RESET",e.add="SLOTS_SELECT_ADD",e))(jt||{});const Xt=(e,t)=>{const{element:r}=e;n.useIsomorphicLayoutEffect((()=>{if(!r||!r.current)return;const t=[],a=[],n=[],l=r.current.querySelectorAll(e.selector);l.forEach((r=>{const l=r.getBoundingClientRect().width,o=e.explicitDepth&&void 0!==e.attribute?r.getAttribute(e.attribute):0,s=I(r,!0),c=((e,t=!1)=>parseFloat(window.getComputedStyle(e)[t?"borderLeftWidth":"borderTopWidth"]||"0")+parseFloat(window.getComputedStyle(e)[t?"borderRightWidth":"borderBottomWidth"]||"0"))(r,!0);null!==o&&((!n[o]||c>n[o])&&(n[o]=c),(!a[o]||s>a[o])&&(a[o]=s),(!t[o]||l>t[o])&&(t[o]=l))})),l.forEach((r=>{const l=e.explicitDepth?r.getAttribute(e.attribute):0;null!==l&&(r.style.minWidth=t[l]-a[l]-n[l]+"px")}))}),t)};var Qt=(e=>(e.next="ITEMS_FOCUS_NEXT",e.prev="ITEMS_FOCUS_PREV",e))(Qt||{});var Jt=(e=>(e.up="SLOT_FOCUS_UP",e.down="SLOT_FOCUS_DOWN",e.left="SLOT_FOCUS_LEFT",e.right="SLOT_FOCUS_RIGHT",e))(Jt||{});const er=(e,t)=>t.find((t=>null!==t.current&&null!==e.current&&t.current.props.row===e.current.props.row-1&&t.current.props.col===e.current.props.col)),tr=(e,t)=>t.find((t=>null!==t.current&&null!==e.current&&t.current.props.row===e.current.props.row&&t.current.props.col===e.current.props.col-1)),rr=(e,t)=>t.find((t=>null!==t.current&&null!==e.current&&t.current.props.row===e.current.props.row&&t.current.props.col===e.current.props.col+1)),ar=(e,t)=>t.find((t=>null!==t.current&&null!==e.current&&t.current.props.row===e.current.props.row+1&&t.current.props.col===e.current.props.col)),nr=f.forwardRef(((e,t)=>{const r=f.useRef(null);f.useImperativeHandle(t,(()=>r.current));const[a,l]=n.useCollection([]),[o,s]=n.useCollection([]),[c,i]=(e=>[[],(t,r)=>{switch(t.type){case"ITEMS_FOCUS_NEXT":{if(!t.item||!t.item.current||!e)return;const a=$(t.item,e,t.ignoreIsAllDay,!1);a&&a.current&&a.current.element&&(r.preventDefault(),a.current.element.focus());break}case"ITEMS_FOCUS_PREV":{if(!t.item||!t.item.current||!e)return;const a=$(t.item,e,t.ignoreIsAllDay,!0);a&&a.current&&a.current.element&&(r.preventDefault(),a.current.element.focus());break}}}])(a),[d,u]=(e=>[[],(t,r)=>{switch(t.type){case"SLOT_FOCUS_UP":{if(!t.slot.current||!e)return;const a=er(t.slot,e);a&&a.current&&a.current.element&&(r.preventDefault(),a.current.element.focus());break}case"SLOT_FOCUS_DOWN":{if(!t.slot||!e)return;const a=ar(t.slot,e);a&&a.current&&a.current.element&&(r.preventDefault(),a.current.element.focus());break}case"SLOT_FOCUS_LEFT":{if(!t.slot||!e)return;const a=tr(t.slot,e);a&&a.current&&a.current.element&&(r.preventDefault(),a.current.element.focus());break}case"SLOT_FOCUS_RIGHT":{if(!t.slot||!e)return;const a=rr(t.slot,e);a&&a.current&&a.current.element&&(r.preventDefault(),a.current.element.focus());break}}}])(o),[m,p]=(e=>{const[t,r]=f.useState([]),a=f.useCallback(((a,n)=>{switch(a.type){case"ITEMS_SELECT_SELECT":if(!a.item)return;r([a.item]);break;case"ITEMS_SELECT_SELECT_NEXT":{if(!a.item||!a.item.current||!e)return;const t=$(a.item,e,a.ignoreIsAllDay,!1);t&&(n.preventDefault(),r([t]));break}case"ITEMS_SELECT_SELECT_PREV":{if(!a.item||!a.item.current||!e)return;const t=$(a.item,e,a.ignoreIsAllDay,!0);t&&(n.preventDefault(),r([t]));break}case"ITEMS_SELECT_RESET":r([]);break;case"ITEMS_SELECT_ADD":if(!a.item)return;t.some((e=>e===a.item))||r([...t,a.item]);break;case"ITEMS_SELECT_REMOVE":if(!a.item)return;r([...t.filter((e=>e!==a.item))])}}),[e,t]);return[t,a]})(a),[g,E]=(e=>{const[t,r]=f.useState([]),a=f.useCallback((e=>{switch(e.type){case"SLOTS_SELECT_SELECT":if(!e.slot)return;r([e.slot]);break;case"SLOTS_SELECT_RESET":r([]);break;case"SLOTS_SELECT_ADD":if(!e.slot)return;t.some((t=>t===e.slot))||r([...t,e.slot])}}),[t]);return[t,a]})(),h=f.useCallback(((e,t)=>{E({type:jt.reset}),p(e,t)}),[p,E]),y=f.useCallback(((e,t)=>{p({type:Yt.reset},t),E(e)}),[p,E]),v=f.useMemo((()=>n.classNames("k-scheduler-layout k-scheduler-layout-flex",e.className)),[e.className]);return Xt({element:r,selector:".k-group-cell",attribute:"data-depth-index",explicitDepth:!0}),Xt({element:r,selector:".k-side-cell",attribute:"data-depth-index",explicitDepth:!1}),f.createElement(qt,{props:e.props,ranges:e.ranges,items:[a,l],slots:[o,s],selectedItems:[m,h],selectedSlots:[g,y],focusedItems:[c,i],focusedSlots:[d,u]},f.createElement("div",{ref:r,style:e.style,className:v,role:"presentation"},e.children))}));nr.displayName="KendoReactSchedulerBaseView";const lr=f.createContext({resource:{},groupIndex:0}),or=e=>{const{nested:t,children:r,rowContentProps:a}=e,n=e.rowContent||ir,l=e.childRowContent||n,o=S(e.group,e.resources);return f.createElement("div",{className:"k-scheduler-group k-group-horizontal"},t?sr({resources:o,children:r,nested:t,groupIndex:0,rowContent:n,rowContentProps:a,childRowContent:l}):cr({resources:o,children:r,rowContent:n,nested:!!t,groupIndex:0,rowContentProps:a,childRowContent:l}))},sr=e=>{const{resources:t,rowContent:r,nested:a,children:n,groupIndex:l,rowContentProps:o,childRowContent:s}=e;if(l===t.length)return cr({resources:t,rowContent:r,children:n,nested:a,groupIndex:l,rowContentProps:o,childRowContent:s});const c=C(t,l),i=r;return f.createElement(f.Fragment,null,a?f.createElement("div",{className:"k-scheduler-row"},f.createElement(i,{resources:t,groupIndex:l,...o},c.map(((e,t)=>f.createElement("div",{key:t,className:"k-scheduler-cell k-heading-cell"},e.text))))):f.createElement(i,{resources:t,groupIndex:l,...o},c.map(((e,t)=>f.createElement("div",{key:t,className:"k-scheduler-cell k-heading-cell"},e.text)))),sr({resources:t,children:n,nested:a,rowContent:r,childRowContent:s,groupIndex:l+1}))},cr=e=>{const{resources:t,childRowContent:r,children:a,rowContentProps:n}=e,l=C(t,t.length-1),o=r,s=t.length>0;return f.createElement("div",{className:"k-scheduler-row"},f.createElement(o,{resources:t,...n},(l.length?l:j).map(((e,t)=>f.createElement("div",{key:t,className:"k-scheduler-cell k-group-cell"},f.createElement(lr.Provider,{value:{resource:e,groupIndex:s?t:0}},a))))))};or.displayName="KendoReactSchedulerHorizontalResourceIterator";const ir=e=>e.children,dr=e=>f.createElement(f.Fragment,null,f.createElement("div",{className:"k-scheduler-cell k-side-cell","data-range-index":e.rangeIndex}),e.children),ur=e=>{const{nested:t,wrapGroup:r,children:a}=e,n=e.cellContent||vr,l=S(e.group,e.resources);return f.createElement("div",{className:"k-scheduler-group"},t?r?f.createElement("div",{className:"k-scheduler-row"},f.createElement("div",{className:"k-sticky-cell"},gr({resources:l,children:a,cellContent:n,depth:0,groupIndex:0})),f.createElement("div",{className:"k-scheduler-cell k-group-content"},pr({resources:l,children:a,cellContent:n,depth:0,groupIndex:0},!1))):pr({resources:l,children:a,cellContent:n,depth:0,groupIndex:0},!0):r?f.createElement("div",{className:"k-scheduler-row"},f.createElement("div",{className:"k-sticky-cell"},mr({resources:l,children:a,cellContent:n,depth:0,groupIndex:0})),f.createElement("div",{className:"k-scheduler-cell k-group-content"},a)):Er({resources:l,children:a,cellContent:n,depth:0,groupIndex:0}))},mr=e=>f.createElement("div",{className:"k-scheduler-row"},f.createElement("div",{className:"k-scheduler-row"},e.resources.map(((e,t)=>f.createElement("div",{key:t,className:"k-scheduler-cell k-resource-cell k-heading-cell","data-depth-index":t}))))),pr=(e,t=!0)=>{const{resources:r,children:a,cellContent:n,groupIndex:l,depth:o}=e,s=r.length>0;if(o===r.length||!s)return f.createElement(lr.Provider,{value:{resource:r[o],groupIndex:s?l:0}},a);const c=r[o].data.length;return r[o].data.map(((e,s)=>f.createElement("div",{key:s,className:"k-scheduler-row"},t&&f.createElement("div",{className:"k-scheduler-cell k-group-cell k-heading-cell","data-depth-index":o},e[r[o].textField]),f.createElement("div",{className:"k-scheduler-cell k-group-content k-resource-row","data-depth-index":o,"data-resource-index":c*l+s},pr({resources:r,children:a,cellContent:n,groupIndex:c*l+s,depth:o+1},t)))))},gr=e=>{const{resources:t,children:r,cellContent:a,groupIndex:n,depth:l}=e,o=t.length?t[l].data.length:0;return t[l]?t[l].data.map(((e,s)=>f.createElement("div",{key:s,className:"k-scheduler-row"},f.createElement("div",{className:"k-scheduler-cell k-resource-cell k-resource-row k-heading-cell","data-depth-index":l,"data-resource-index":o*n+s},e[t[l].textField]),l+1!==t.length&&f.createElement("div",{className:"k-scheduler-cell k-resource-content"},gr({resources:t,children:r,cellContent:a,groupIndex:o*n+s,depth:l+1}))))):null},Er=e=>{const{resources:t,children:r,groupIndex:a,cellContent:n}=e;return f.createElement("div",{className:"k-scheduler-row"},yr(t),n,hr(r,t,a))},hr=(e,t,r)=>{const a=t.length>0;return f.createElement("div",{className:"k-scheduler-cell k-group-content"},f.createElement(lr.Provider,{value:{resource:t[r],groupIndex:a?r:void 0}},e))},yr=e=>e.map(((e,t)=>f.createElement("div",{key:t,className:"k-scheduler-cell k-group-cell k-heading-cell","data-depth-index":t})));ur.displayName="KendoReactSchedulerVerticalResourceIterator";const vr=null,fr=e=>{const t=o.useLocalization();return f.createElement(f.Fragment,null,f.createElement("div",{className:"k-scheduler-cell k-heading-cell k-side-cell k-scheduler-times-all-day"},t.toLanguageString(xe,At[xe])),e.children)},kr=f.forwardRef(((e,t)=>{const{as:r=Dr.as,...a}=e,l=f.useRef(null),s=f.useRef(null),c=o.useInternationalization(),i=f.useMemo((()=>n.classNames("k-scheduler-cell k-heading-cell",e.className)),[e.className]);return f.useImperativeHandle(s,(()=>({element:l.current&&l.current.element?l.current.element:l.current,props:e}))),f.useImperativeHandle(t,(()=>s.current)),f.createElement(r,{ref:r!==Dr.as?void 0:l,...a,className:i},c.formatDate(e.date,e.format?e.format:Dr.format))})),Dr={as:f.forwardRef((({as:e,format:t,start:r,end:a,...n},l)=>f.createElement("div",{...n,ref:l}))),format:"t"};kr.displayName="KendoReactSchedulerTimeHeaderCell";const Sr=e=>{const{slot:t,children:r}=e;return f.createElement(f.Fragment,null,e.isMaster?f.createElement(kr,{as:e.timeHeaderCell,date:t.zonedStart,start:t.zonedStart,end:t.zonedEnd,className:n.classNames("k-side-cell",{"k-major-cell":!e.isLast})}):f.createElement("div",{className:"k-scheduler-cell k-heading-cell k-side-cell"}),r)},Cr=e=>{const{onChange:t,data:r,validationMessage:a,visited:n,touched:o,modified:s,...c}=e,[i,d]=f.useState(r),u=f.useCallback((e=>t(e)),[t]),m=f.useCallback((e=>{const t=l.filterBy(r||[],e.filter);d(t)}),[]);return f.createElement(h.ComboBox,{style:{width:"100%"},data:i,filterable:!0,onFilterChange:m,onChange:u,...c})},br=e=>{const{value:t,data:r,onChange:a,...n}=e,l=f.useCallback((e=>{a&&a.call(void 0,e.currentTarget.dataset.value)}),[a]);return f.createElement(s.ButtonGroup,{className:"k-scheduler-recurrence-repeat",width:"100%",...n},r.map((e=>f.createElement(s.Button,{type:"button",key:e.value,selected:e.value===t,onClick:l,"data-value":e.value,togglable:!0},e.text))))},Ir=e=>e.charAt(0).toUpperCase()+e.slice(1),wr=["first","second","third","fourth","last"],Tr=["never","daily","weekly","monthly","yearly"],Rr=[{day:0,offset:0},{day:1,offset:0},{day:2,offset:0},{day:3,offset:0},{day:4,offset:0},{day:5,offset:0},{day:6,offset:0}],xr=[{day:1,offset:0},{day:2,offset:0},{day:3,offset:0},{day:4,offset:0},{day:5,offset:0}],Ar=[{day:0,offset:0},{day:6,offset:0}],_r=e=>{switch(e){case"day":return Rr;case"weekday":return xr;case"weekend":return Ar}},Nr=e=>{const{value:t,data:r,onChange:a,...n}={...Mr,...e},l=r=>{const a=Number(r.currentTarget.dataset.key);e.onChange&&e.onChange.call(void 0,t.some((e=>e===a))?t.filter((e=>e!==a)):[...t,a])};return f.createElement(s.ButtonGroup,{width:"auto",...n},(e.data||Mr.data).map((e=>f.createElement(s.Button,{type:"button",key:e.value,"data-key":e.value,selected:t.some((t=>t===e.value)),togglable:!0,onClick:l},Ir(e.text)))))},Mr={data:[],value:[]},zr=e=>{const t=o.useInternationalization(),r=o.useLocalization(),{timezone:n}=ae(),[l,s]=f.useState(1),[i,d]=f.useState(a.ZonedDate.fromUTCDate(e.start)),u=f.useCallback(((e,t)=>{const a=t?e:"scheduler.recurrenceEditor"+e;return r.toLanguageString(a,At[a])}),[r]),p=f.useMemo((()=>{var t;return(e=>y.parseRule({recurrenceRule:e})||{})(null!=(t=e.value)?t:Or.value)}),[e.value]),v=f.useMemo((()=>(e=>Tr.map((t=>({value:t,text:e("Frequencies"+Ir(t))}))))(u)),[u]),k=f.useMemo((()=>(e=>M(e)&&!(e=>(e=>null==e)(e)||e.trim&&0===e.trim().length)(e.freq)?e.freq:"never")(p)),[p]),D=f.useMemo((()=>((e,t)=>{const r=e.firstDay(),a=e.dateFormatNames({type:"days",nameType:"wide"}).map(((e,t)=>({text:e,value:t}))),n=a.slice(r).concat(a.slice(0,r));return[{text:t("WeekdaysDay"),value:"day"},{text:t("WeekdaysWeekday"),value:"weekday"},{text:t("WeekdaysWeekendday"),value:"weekend"}].concat(n)})(t,u)),[t,u]),S=f.useMemo((()=>((e,t,r)=>{var a;let n;if(M(t.byWeekDay))switch(t.byWeekDay.length){case 7:n="day";break;case 5:n="weekday";break;case 2:n="weekend";break;case 1:n=t.byWeekDay[0].day;break;default:n=r.getDay()}else n=r.getDay();return null!=(a=e.find((e=>n===e.value)))?a:e[0]})(D,p,e.start)),[D,p,e.start]),C=f.useMemo((()=>(e=>e.dateFormatNames({type:"months",nameType:"wide",standAlone:!0}).map(((e,t)=>({text:e,value:t+1}))))(t)),[t]),b=f.useMemo((()=>((e,t)=>e.find((e=>(t.byMonth?t.byMonth[0]:null)===e.value))||e[0])(C,p)),[C,p]),I=f.useMemo((()=>(e=>{const t=[1,2,3,4,-1];return wr.map(((r,a)=>({text:e("OffsetPositions"+Ir(r)),value:t[a]})))})(u)),[u]),w=f.useMemo((()=>((e,t)=>e.find((e=>e.value===(t.bySetPosition?t.bySetPosition[0]:t.byWeekDay&&t.byWeekDay[0]?t.byWeekDay[0].offset:1)))||e[0])(I,p)),[I,p]),T=f.useMemo((()=>(e=>M(e.count)?"count":M(e.until)?"until":"never")(p)),[p]),R=f.useMemo((()=>((e,t)=>M(e.byMonthDay)&&e.byMonthDay.length>0?e.byMonthDay[0]:t.getDate())(p,e.start)),[p,e.start]),x=f.useMemo((()=>(e=>M(e.until)?a.toLocalDate(e.until):null)(p)),[p.until]),A=f.useMemo((()=>(e=>{const t=e.firstDay(),r=e.dateFormatNames({type:"days",nameType:"abbreviated"}).map(((e,t)=>({text:e,value:t})));return r.slice(t).concat(r.slice(0,t))})(t)),[t]),_=f.useMemo((()=>(e=>M(e.byWeekDay)?"weekday":M(e.byMonthDay)?"monthday":void 0)(p)),[p.byWeekDay,p.byMonthDay]),N=f.useCallback((r=>{"never"===r.freq?e.onChange({value:null}):(void 0===r.weekStart&&(r.weekStart=t.firstDay()),e.onChange({value:y.serializeRule(r,e.timezone)}))}),[e.onChange,e.timezone]),z=f.useCallback((t=>{const r={};r.freq=t,r.interval=1,"weekly"===t&&(r.byWeekDay=[{day:a.ZonedDate.fromLocalDate(e.start,n).getDay(),offset:0}]),("monthly"===t||"yearly"===t)&&(r.byMonthDay=[e.start.getDate()]),"yearly"===t&&(r.byMonth=[e.start.getMonth()+1]),N(r)}),[N,e.start,n]),L=f.useCallback((e=>{const t=e.value;N(Object.assign({},p,{interval:t}))}),[N,p]),O=f.useCallback((e=>{const t=e.value;N(Object.assign({},p,{count:t})),null!==t&&s(t)}),[N,p]),F=f.useCallback((t=>{const r=t.value;if(!r)return;const n=a.ZonedDate.fromLocalDate(r,e.timezone);N(Object.assign({},p,{until:n})),d(n)}),[N,p,e.timezone]),P=f.useCallback((e=>{N(Object.assign({},p,{byWeekDay:A.filter((t=>e.some((e=>e===t.value)))).map((e=>({offset:0,day:e.value})))}))}),[N,p,A]),W=f.useCallback((e=>{const t=Object.assign({},p),r=e.target.value;"string"==typeof r.value?(t.byWeekDay=_r(r.value),t.bySetPosition=[w.value]):(t.bySetPosition=void 0,t.byWeekDay=[{day:r.value,offset:w.value}]),N(t)}),[w.value,N,p]),H=f.useCallback((e=>{N(Object.assign({},p,{byMonthDay:[e.value]}))}),[N,p]),K=f.useCallback((e=>{const t=e.value;N(Object.assign({},p,{byMonth:[t.value]}))}),[N,p]),V=f.useCallback((e=>{const t=e.value,r=Object.assign({},p);switch(t){case"never":r.until=void 0,r.count=void 0;break;case"count":r.until=void 0,r.count=l;break;case"until":r.until=i,r.count=void 0}N(r)}),[N,p,e.timezone]),G=f.useCallback((e=>{const t=Object.assign({},p);"monthday"===e.value?(t.byWeekDay=void 0,t.bySetPosition=void 0,t.byMonthDay=[R]):"weekday"===e.value&&(t.byMonthDay=void 0,"string"==typeof S.value?(t.bySetPosition=[w.value],t.byWeekDay=_r(S.value)):t.byWeekDay=[{day:S.value,offset:w.value}]),N(t)}),[N,p,R,S]),B=f.useCallback((e=>{const t=Object.assign({},p),r=e.value;if(t.byWeekDay)switch(t.byWeekDay.length){case 7:case 5:case 2:t.bySetPosition=[r.value];break;case 1:t.byWeekDay[0].offset=r.value}N(t)}),[N,p]);return f.createElement(f.Fragment,null,f.createElement(m.FieldWrapper,null,f.createElement(g.Label,{className:"k-form-label"},r.toLanguageString(nt,At[nt])),f.createElement("div",{className:"k-form-field-wrap"},f.createElement(br,{value:k,data:v,onChange:z}))),"never"!==k&&f.createElement(m.FieldWrapper,null,f.createElement(g.Label,{editorId:"interval-editor",className:"k-form-label"},u(Ir(k)+"RepeatEvery")),f.createElement("div",{className:"k-form-field-wrap"},f.createElement(E.NumericTextBox,{min:1,step:1,defaultValue:1,value:p.interval,onChange:L,id:"interval-editor",className:"k-recur-interval"})," ",f.createElement(g.Label,{editorId:"interval-editor",className:"k-form-label"},u(Ir(k)+"Interval")))),"weekly"===k&&f.createElement(m.FieldWrapper,null,f.createElement(g.Label,{className:"k-form-label"},u(lt,!0)),f.createElement("div",{className:"k-form-field-wrap"},f.createElement(Nr,{data:A,value:(p.byWeekDay||[]).map((({day:e})=>e)),onChange:P}))),"monthly"===k&&f.createElement(m.FieldWrapper,null,f.createElement(g.Label,{key:"recurrence-repeat-on-monthly-label",className:"k-form-label"},u(st,!0)),f.createElement("div",{className:"k-form-field-wrap"},f.createElement(E.RadioGroup,{value:_,onChange:G,item:Lr,className:"k-reset",data:[{value:"monthday",label:u(ot,!0),children:[f.createElement(f.Fragment,{key:"separator"}," "),f.createElement(E.NumericTextBox,{key:"weekday-day",min:1,max:31,disabled:"monthday"!==_,value:p&&p.byMonthDay&&p.byMonthDay[0],onChange:H,width:"auto"})]},{value:"weekday",label:" ",children:[f.createElement(h.DropDownList,{key:"weekday-offset",textField:"text",dataItemKey:"value",disabled:"weekday"!==_,data:I,value:w,onChange:B,style:{width:"auto"}}),f.createElement(f.Fragment,{key:"separator"}," "),f.createElement(h.DropDownList,{key:"weekday-value",disabled:"weekday"!==_,value:S,data:D,onChange:W,textField:"text",dataItemKey:"value",style:{width:"auto"}})]}]}))),"yearly"===k&&f.createElement(m.FieldWrapper,null,f.createElement(g.Label,null,u(it,!0)),f.createElement("div",{className:"k-form-field-wrap"},f.createElement(E.RadioGroup,{value:_,item:Lr,onChange:G,className:"k-reset",data:[{value:"monthday",label:" ",children:[f.createElement(h.DropDownList,{key:"monthday-month",disabled:"monthday"!==_,value:b,data:C,textField:"text",dataItemKey:"value",onChange:K,style:{width:"auto"}}),f.createElement(f.Fragment,{key:"separator"}," "),f.createElement(E.NumericTextBox,{key:"monthday-day",min:1,max:31,disabled:"monthday"!==_,value:R,onChange:H,width:"auto"})]},{value:"weekday",label:" ",children:[f.createElement(h.DropDownList,{key:"yearly-weekday-offset",textField:"text",dataItemKey:"value",disabled:"weekday"!==_,data:I,value:w,onChange:B,style:{width:"auto"}}),f.createElement(f.Fragment,{key:"yearly-separator-1"}," "),f.createElement(h.DropDownList,{key:"yearly-weekday-day",textField:"text",dataItemKey:"value",disabled:"weekday"!==_,value:S,data:D,onChange:W,style:{width:"auto"}}),f.createElement(f.Fragment,{key:"yearly-separator-2"}," "),f.createElement("span",{key:"yearly-weekday-of-label"},u(ct,!0)),f.createElement(f.Fragment,{key:"yearly-separator-3"}," "),f.createElement(h.DropDownList,{key:"yearly-weekday-month",textField:"text",dataItemKey:"value",disabled:"weekday"!==_,value:b,data:C,onChange:K,style:{width:"auto"}})]}]}))),"never"!==k&&f.createElement("div",{className:"k-scheduler-recurrence-end-rule-editor"},f.createElement(m.FieldWrapper,null,f.createElement(g.Label,{className:"k-form-label"},u(mt,!0)),f.createElement("div",{className:"k-form-field-wrap"},f.createElement(E.RadioGroup,{item:Lr,value:T,onChange:V,data:[{value:"never",label:u(pt,!0)},{value:"count",label:u(dt,!0),children:[f.createElement(f.Fragment,{key:"separator-1"}," "),f.createElement(E.NumericTextBox,{key:"endrule-after-editor",id:"k-endrule-after",className:"k-recur-count",min:1,width:"auto",value:"count"===T?p.count:l,onChange:O,disabled:"count"!==T}),f.createElement(f.Fragment,{key:"separator-2"}," "),f.createElement(g.Label,{key:"endrule-after-label",className:"k-radio-label",editorId:"k-endrule-after"},u(ut,!0))]},{value:"until",label:u(gt,!0),children:[f.createElement(f.Fragment,{key:"separator"}," "),f.createElement(c.DatePicker,{key:"k-endrule-until-editor",id:"k-endrule-until",disabled:"until"!==T,min:e.start,value:"until"===T?x:a.toLocalDate(i),onChange:F,width:"auto"})]}]})))))},Lr=e=>f.createElement("li",{...e},e.children),Or={value:""};zr.displayName="KendoReactSchedulerRepeatEditor";const Fr=e=>{const{as:t=Hr.as,value:r,onChange:a,...n}=e,{timezone:l}=ae();return f.createElement(t,{...n,value:Pr(r,l),onChange:e=>{a&&a({value:Wr(e.target.value,l)})}})},Pr=(e,t)=>{if(e){const r=a.toLocalDate(a.ZonedDate.fromLocalDate(e,t).toUTCDate());return r.setUTCFullYear(e.getFullYear()),r}return e},Wr=(e,t)=>{if(e){const r=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return r.setUTCFullYear(e.getFullYear()),a.ZonedDate.fromUTCDate(r,t).toLocalDate()}return e},Hr={as:c.DateTimePicker},Kr=f.forwardRef(((e,t)=>{const r=f.useRef(null),l=f.useRef(null),s=a.timezoneNames(),i=o.useLocalization(),d=se(),{resources:u,timezone:p}=ae();f.useImperativeHandle(l,(()=>{var t;return{element:null!=(t=r.current)&&t.element?r.current.element:r.current,props:e}})),f.useImperativeHandle(t,(()=>l.current));const{as:E=Vr.as,...h}=e,{titleLabel:y=Vr.titleLabel,titleError:v=Vr.titleError,titleEditor:k=Vr.titleEditor,startLabel:D=Vr.startLabel,startError:S=Vr.startError,startEditor:C=Vr.startEditor,startTimezoneLabel:b=Vr.startTimezoneLabel,startTimezoneError:I=Vr.startTimezoneError,startTimezoneEditor:w=Vr.startTimezoneEditor,startTimezoneCheckedLabel:T=Vr.startTimezoneCheckedLabel,startTimezoneCheckedEditor:R=Vr.startTimezoneCheckedEditor,endLabel:x=Vr.endLabel,endError:A=Vr.endError,endEditor:_=Vr.endEditor,endTimezoneLabel:N=Vr.endTimezoneLabel,endTimezoneError:M=Vr.endTimezoneError,endTimezoneEditor:z=Vr.endTimezoneEditor,endTimezoneCheckedLabel:L=Vr.endTimezoneCheckedLabel,endTimezoneCheckedEditor:O=Vr.endTimezoneCheckedEditor,allDayLabel:F=Vr.allDayLabel,allDayEditor:P=Vr.allDayEditor,recurrenceEditor:W=Vr.recurrenceEditor,descriptionLabel:H=Vr.descriptionLabel,descriptionEditor:K=Vr.descriptionEditor,descriptionError:V=Vr.descriptionError,resourceLabel:G=Vr.resourceLabel,resourceEditor:B=Vr.resourceEditor}=e,U=e.valueGetter(d.start)||new Date,Z=e.valueGetter(d.startTimezone)||p||"",$=e.valueGetter(d.endTimezone)||p||"",q=f.useMemo((()=>i.toLanguageString(It,At[It])),[i]),[Y,j]=f.useState(!!e.valueGetter(d.startTimezone)),[X,Q]=f.useState(!!e.valueGetter(d.endTimezone)),J=f.useCallback((t=>{t.value||(e.onChange(d.startTimezone,{value:null}),e.onChange(d.endTimezone,{value:null}),Q(t.value)),j(t.value)}),[e.onChange,d.startTimezone,d.endTimezone]),ee=f.useCallback((t=>{t.value||e.onChange(d.endTimezone,{value:null}),Q(t.value)}),[e.onChange]),te=f.useCallback((e=>e?void 0:q),[q]),re=f.useCallback(((e,t)=>Y?te(t(d.startTimezone)):void 0),[te,Y,d.startTimezone]),ne=f.useCallback(((e,t)=>Y&&X?te(t(d.endTimezone))||te(t(d.startTimezone)):void 0),[te,Y,X,d.startTimezone,d.endTimezone]),le=f.useMemo((()=>n.classNames("k-scheduler-edit-form",e.className)),[e.className]);return f.createElement(E,{ref:E===Vr.as?r:void 0,...h,className:le},f.createElement(f.Fragment,null,f.createElement(m.FieldWrapper,null,f.createElement(m.Field,{name:d.title,component:y,editorId:"k-scheduler-editor-title",className:"k-form-label"},i.toLanguageString(Ye,At[Ye])),f.createElement("div",{className:"k-form-field-wrap"},f.createElement(m.Field,{id:"k-scheduler-editor-title",name:d.title,field:d.title,component:k}),e.errors[d.title]&&f.createElement(m.Field,{name:d.title,component:v},e.errors[d.title]))),f.createElement(m.FieldWrapper,null,f.createElement(m.Field,{name:d.start,component:D,editorId:"k-scheduler-editor-start",className:"k-form-label"},i.toLanguageString(je,At[je])),f.createElement("div",{className:"k-form-field-wrap"},f.createElement(m.Field,{id:"k-scheduler-editor-start",name:d.start,width:"auto",component:C,as:e.valueGetter(d.isAllDay)?c.DatePicker:c.DateTimePicker,timezone:p}),e.errors[d.start]&&f.createElement(m.Field,{name:d.start,component:S},e.errors[d.start]))),f.createElement(m.FieldWrapper,null,f.createElement(T,{className:"k-form-label"}),f.createElement("div",{className:"k-form-field-wrap"},f.createElement(R,{id:"k-scheduler-editor-set-start-timezone",onChange:J,value:Y}),f.createElement(T,{className:"k-checkbox-label",editorId:"k-scheduler-editor-set-start-timezone"},i.toLanguageString(at,At[at])))),Y&&f.createElement(m.FieldWrapper,null,f.createElement(m.Field,{name:d.start,component:b,className:"k-form-label"},i.toLanguageString(Xe,At[Xe])),f.createElement("div",{className:"k-form-field-wrap"},f.createElement(m.Field,{component:w,value:Z,validator:re,data:s,name:d.startTimezone}),e.errors[d.startTimezone]&&f.createElement(m.Field,{name:d.startTimezone,component:I},e.errors[d.startTimezone]))),f.createElement(m.FieldWrapper,null,f.createElement(m.Field,{name:d.end,component:x,editorId:"k-scheduler-editor-end",className:"k-form-label"},i.toLanguageString(Qe,At[Qe])),f.createElement("div",{className:"k-form-field-wrap"},f.createElement(m.Field,{id:"k-scheduler-editor-end",name:d.end,width:"auto",component:_,as:e.valueGetter(d.isAllDay)?c.DatePicker:c.DateTimePicker,timezone:p}),e.errors[d.end]&&f.createElement(m.Field,{name:d.end,component:A},e.errors[d.end]))),Y&&f.createElement(m.FieldWrapper,null,f.createElement("div",{className:"k-form-field-wrap"},f.createElement(O,{id:"k-scheduler-editor-set-end-timezone",onChange:ee,value:X})),f.createElement(L,{editorId:"k-scheduler-editor-set-end-timezone",className:"k-form-label"},i.toLanguageString(rt,At[rt]))),X&&f.createElement(m.FieldWrapper,null,f.createElement(m.Field,{name:d.endTimezone,component:N,className:"k-form-label"},i.toLanguageString(Je,At[Je])),f.createElement("div",{className:"k-form-field-wrap"},f.createElement(m.Field,{value:$,data:s,validator:ne,component:z,name:d.endTimezone}),e.errors[d.endTimezone]&&f.createElement(m.Field,{name:d.endTimezone,component:M},e.errors[d.endTimezone]))),f.createElement(m.FieldWrapper,null,f.createElement(m.Field,{name:d.isAllDay,component:g.Label,className:"k-form-label"}),f.createElement("div",{className:"k-form-field-wrap"},f.createElement(m.Field,{id:"k-is-allday-checkbox",name:d.isAllDay,component:P}),f.createElement(m.Field,{name:d.isAllDay,field:d.isAllDay,editorId:"k-is-allday-checkbox",className:"k-checkbox-label",component:F},i.toLanguageString(et,At[et])))),f.createElement("div",{className:"k-recurrence-editor"},f.createElement(m.Field,{component:W,field:d.recurrenceRule,name:d.recurrenceRule,start:U})),f.createElement(m.FieldWrapper,null,f.createElement(m.Field,{name:d.description,component:H,className:"k-form-label"},i.toLanguageString(tt,At[tt])),f.createElement("div",{className:"k-form-field-wrap"},f.createElement(m.Field,{component:K,name:d.description,rows:1,id:"k-event-description"}),e.errors[d.description]&&f.createElement(m.Field,{name:d.description,component:V},e.errors[d.description]))),(u||[]).map((e=>f.createElement(m.FieldWrapper,{key:e.field},f.createElement(m.Field,{name:e.field,component:G,className:"k-form-label"}),f.createElement(g.Label,{className:"k-form-label"},e.name),f.createElement(m.Field,{name:e.field,component:B,resource:e,multiple:e.multiple,data:e.data,textField:e.textField,valueField:e.valueField,colorField:e.colorField}))))))})),Vr={as:f.forwardRef(((e,t)=>f.createElement(m.FormElement,{ref:t,id:e.id,style:e.style,tabIndex:e.tabIndex,className:e.className,horizontal:e.horizontal,children:e.children}))),titleLabel:g.Label,titleError:g.Error,titleEditor:E.Input,startLabel:g.Label,startError:g.Error,startEditor:Fr,startTimezoneLabel:g.Label,startTimezoneError:g.Error,startTimezoneEditor:Cr,startTimezoneCheckedLabel:g.Label,startTimezoneCheckedEditor:E.Checkbox,endLabel:g.Label,endError:g.Error,endEditor:Fr,endTimezoneLabel:g.Label,endTimezoneError:g.Error,endTimezoneEditor:Cr,endTimezoneCheckedLabel:g.Label,endTimezoneCheckedEditor:E.Checkbox,allDayLabel:g.Label,allDayEditor:E.Checkbox,recurrenceEditor:zr,descriptionLabel:g.Label,descriptionEditor:E.TextArea,descriptionError:g.Error,resourceLabel:g.Label,resourceEditor:e=>{const t=e.multiple?h.MultiSelect:h.DropDownList,r=f.useCallback((t=>{const r=t.target.props.dataItemKey,a=e.multiple?(t.target.value||[]).map((e=>e[r])):t.target.value[r];e.onChange.call(void 0,{value:a})}),[e.multiple,e.onChange]),a=f.useCallback(((t,r)=>{const a=f.createElement(f.Fragment,null,e.colorField&&f.createElement("span",{key:1,className:"k-scheduler-mark",style:{backgroundColor:r.dataItem[e.colorField],marginRight:M(r.dataItem[e.valueField])?"8px":"4px"}}," "),f.createElement("span",{key:2}," ",t.props.children));return f.cloneElement(t,{...t.props},a)}),[e.colorField,e.valueField]),n=f.useCallback(((t,r)=>{const a=f.createElement(f.Fragment,null,e.colorField&&r&&f.createElement("span",{key:1,className:"k-scheduler-mark",style:{backgroundColor:r[e.colorField],marginRight:r[e.valueField]?"8px":"4px"}}," "),t.props.children);return f.cloneElement(t,{},a)}),[e.colorField,e.valueField]),l=Array.isArray(e.value)?e.data.filter((t=>e.value.some((r=>t[e.valueField]===r)))):e.data.find((t=>t[e.valueField]===e.value));return f.createElement(t,{value:l,onChange:r,data:e.data,textField:e.textField,dataItemKey:e.valueField,valid:e.valid,validationMessage:e.validationMessage,itemRender:a,valueRender:n})}};Kr.displayName="KendoReactSchedulerFormEditor";const Gr=f.forwardRef(((e,t)=>{const{onCancel:r,onClose:a,onSubmit:l,editor:c,dialog:i=Br.dia