@isma91/react-scheduler 4.0.2 → 4.0.3

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/index.js CHANGED
@@ -1,7 +1,7 @@
1
- import { jsxs as M, jsx as r, Fragment as Y } from "react/jsx-runtime";
2
- import { createContext as pt, useContext as yt, useMemo as U, useState as L, Fragment as ie, useRef as nt, useEffect as te, useCallback as Z, forwardRef as mt } from "react";
3
- import { isWithinInterval as j, endOfDay as q, startOfDay as X, format as N, isSameDay as ye, isBefore as me, isAfter as Se, differenceInDays as vt, addSeconds as Zt, subMinutes as qt, addMinutes as de, differenceInMilliseconds as Xt, addDays as Q, addMilliseconds as Yt, isToday as ve, differenceInMinutes as Fe, set as ke, startOfWeek as $e, eachMinuteOfInterval as _t, endOfMonth as bt, endOfWeek as wt, startOfMonth as Ze, getMonth as Qt, setMonth as rt, getDaysInMonth as Jt, isSameMonth as Dt, differenceInCalendarWeeks as Kt, closestTo as en, setHours as ot, eachWeekOfInterval as tn, eachDayOfInterval as nn, isEqual as it } from "date-fns";
4
- import { useTheme as ne, ListItem as rn, ListItemAvatar as xt, Avatar as qe, ListItemText as kt, Typography as F, Tabs as on, Tab as an, Box as Ee, styled as se, alpha as Me, Paper as Tt, Grow as sn, IconButton as _e, Slide as ln, Button as ee, Popover as Te, List as dn, ListItemButton as cn, ButtonBase as un, useMediaQuery as Ct, MenuList as hn, MenuItem as Le, TextField as fn, FormControl as gn, InputLabel as pn, Select as yn, Checkbox as mn, Chip as vn, CircularProgress as Et, FormHelperText as _n, Dialog as bn, DialogTitle as wn, DialogContent as Dn, Grid as at, DialogActions as xn } from "@mui/material";
1
+ import { jsxs as E, jsx as r, Fragment as Y } from "react/jsx-runtime";
2
+ import { createContext as yt, useContext as mt, useMemo as U, useState as L, Fragment as ie, useRef as rt, useEffect as K, useCallback as Z, forwardRef as _t } from "react";
3
+ import { isWithinInterval as j, endOfDay as q, startOfDay as X, format as N, isSameDay as ye, isBefore as me, isAfter as Me, differenceInDays as vt, addSeconds as Zt, subMinutes as qt, addMinutes as de, differenceInMilliseconds as Xt, addDays as Q, addMilliseconds as Yt, isToday as _e, differenceInMinutes as $e, set as xe, startOfWeek as Re, eachMinuteOfInterval as bt, endOfMonth as wt, endOfWeek as Dt, startOfMonth as qe, getMonth as Qt, setMonth as ot, getDaysInMonth as Jt, isSameMonth as xt, differenceInCalendarWeeks as Kt, closestTo as en, setHours as it, eachWeekOfInterval as tn, eachDayOfInterval as nn, isEqual as at } from "date-fns";
4
+ import { useTheme as ee, ListItem as rn, ListItemAvatar as kt, Avatar as Xe, ListItemText as Tt, Typography as $, Tabs as on, Tab as an, Box as Se, styled as le, alpha as Ie, Paper as Ct, Grow as sn, IconButton as ve, Slide as ln, Button as J, Popover as ke, List as dn, ListItemButton as cn, ButtonBase as un, useMediaQuery as Et, MenuList as hn, MenuItem as Ve, TextField as fn, FormControl as gn, InputLabel as pn, Select as yn, Checkbox as mn, Chip as _n, CircularProgress as St, FormHelperText as vn, Dialog as bn, DialogTitle as wn, DialogContent as Dn, Grid as st, DialogActions as xn } from "@mui/material";
5
5
  import { enUS as kn } from "date-fns/locale";
6
6
  import { styled as Tn } from "@mui/material/styles";
7
7
  import Cn from "@mui/icons-material/DeleteRounded";
@@ -9,13 +9,13 @@ import En from "@mui/icons-material/EditRounded";
9
9
  import Sn from "@mui/icons-material/EventNoteRounded";
10
10
  import Mn from "@mui/icons-material/ClearRounded";
11
11
  import In from "@mui/icons-material/SupervisorAccountRounded";
12
- import st from "@mui/icons-material/ArrowRightRounded";
13
- import lt from "@mui/icons-material/ArrowLeftRounded";
12
+ import lt from "@mui/icons-material/ArrowRightRounded";
13
+ import dt from "@mui/icons-material/ArrowLeftRounded";
14
14
  import { LocalizationProvider as Nn } from "@mui/x-date-pickers/LocalizationProvider";
15
15
  import { AdapterDateFns as On } from "@mui/x-date-pickers/AdapterDateFns";
16
- import dt from "@mui/icons-material/NavigateBeforeRounded";
17
- import ze from "@mui/icons-material/NavigateNextRounded";
18
- import { DateCalendar as Xe } from "@mui/x-date-pickers";
16
+ import ct from "@mui/icons-material/NavigateBeforeRounded";
17
+ import Be from "@mui/icons-material/NavigateNextRounded";
18
+ import { DateCalendar as Ye } from "@mui/x-date-pickers";
19
19
  import Fn from "@mui/icons-material/MoreVert";
20
20
  import $n from "@mui/icons-material/ViewAgenda";
21
21
  import { DatePicker as Rn } from "@mui/x-date-pickers/DatePicker";
@@ -32,21 +32,21 @@ const Wn = (e) => {
32
32
  }, Pn = (e) => {
33
33
  const t = [];
34
34
  return e.month && t.push("month"), e.week && t.push("week"), e.day && t.push("day"), t;
35
- }, Ve = (e, t, n) => {
35
+ }, Ge = (e, t, n) => {
36
36
  var a;
37
37
  const o = ((a = e.config) == null ? void 0 : a.multiple) && !Array.isArray((n == null ? void 0 : n[e.name]) || e.default), i = o ? t ? [t] : [] : t, s = o ? i.length : i;
38
38
  return { value: i, validity: s };
39
- }, Ce = (e, t, n, o) => {
39
+ }, Te = (e, t, n, o) => {
40
40
  var f;
41
- const i = n.idField, s = o.find((c) => c.name === i), a = !!((f = s == null ? void 0 : s.config) != null && f.multiple), d = [];
42
- for (const c of e) {
43
- const _ = a && !Array.isArray(c[i]) ? [c[i]] : c[i];
44
- (a || Array.isArray(_) ? _.includes(t[i]) : _ === t[i]) && d.push({
45
- ...c,
46
- color: c.color || t[n.colorField || ""]
41
+ const i = n.idField, s = o.find((u) => u.name === i), a = !!((f = s == null ? void 0 : s.config) != null && f.multiple), c = [];
42
+ for (const u of e) {
43
+ const _ = a && !Array.isArray(u[i]) ? [u[i]] : u[i];
44
+ (a || Array.isArray(_) ? _.includes(t[i]) : _ === t[i]) && c.push({
45
+ ...u,
46
+ color: u.color || t[n.colorField || ""]
47
47
  });
48
48
  }
49
- return d;
49
+ return c;
50
50
  }, zn = (e, t) => e.filter(
51
51
  (n) => n.event_id !== t.event_id && (j(de(t.start, 1), {
52
52
  start: n.start,
@@ -61,87 +61,87 @@ const Wn = (e) => {
61
61
  start: t.start,
62
62
  end: t.end
63
63
  }))
64
- ), St = (e, t) => Math.ceil(e) / t, Mt = (e, t) => Math.max(e / t, 60), ae = (e, t) => vt(q(Zt(t, -1)), X(e)), Bn = (e) => new Date(
64
+ ), Mt = (e, t) => Math.ceil(e) / t, It = (e, t) => Math.max(e / t, 60), se = (e, t) => vt(q(Zt(t, -1)), X(e)), Bn = (e) => new Date(
65
65
  e.getUTCFullYear(),
66
66
  e.getUTCMonth(),
67
67
  e.getUTCDate(),
68
68
  e.getUTCHours(),
69
69
  e.getUTCMinutes()
70
- ), It = (e, t, n) => {
70
+ ), Nt = (e, t, n) => {
71
71
  var i;
72
72
  const o = Xt(e.end, e.start);
73
73
  return e.recurring ? (i = e.recurring) == null ? void 0 : i.between(Q(t, -1), Q(t, 1), !0).map((s, a) => {
74
- const d = Bn(s);
74
+ const c = Bn(s);
75
75
  return {
76
76
  ...e,
77
77
  recurrenceId: a,
78
- start: d,
79
- end: Yt(d, o)
78
+ start: c,
79
+ end: Yt(c, o)
80
80
  };
81
- }).map((s) => Oe(s, n)) : [Oe(e, n)];
82
- }, Nt = (e, t, n, o) => {
81
+ }).map((s) => Fe(s, n)) : [Fe(e, n)];
82
+ }, Ot = (e, t, n, o) => {
83
83
  const i = [];
84
84
  for (let s = 0; s < e.length; s++)
85
- for (const a of It(e[s], t, n)) {
86
- if (!a.allDay && ye(t, a.start) && !ae(a.start, a.end)) {
85
+ for (const a of Nt(e[s], t, n)) {
86
+ if (!a.allDay && ye(t, a.start) && !se(a.start, a.end)) {
87
87
  i.push(a);
88
88
  continue;
89
89
  }
90
- if (o && !a.allDay && ae(a.start, a.end) > 0) {
91
- const f = X(t), c = q(t);
92
- if (j(t, { start: X(a.start), end: q(a.end) }) || j(a.start, { start: f, end: c }) || j(a.end, { start: f, end: c })) {
93
- const _ = me(a.start, f) ? f : a.start, y = Se(a.end, c) ? c : a.end;
90
+ if (o && !a.allDay && se(a.start, a.end) > 0) {
91
+ const f = X(t), u = q(t);
92
+ if (j(t, { start: X(a.start), end: q(a.end) }) || j(a.start, { start: f, end: u }) || j(a.end, { start: f, end: u })) {
93
+ const _ = me(a.start, f) ? f : a.start, g = Me(a.end, u) ? u : a.end;
94
94
  i.push({
95
95
  ...a,
96
96
  start: _,
97
- end: y,
97
+ end: g,
98
98
  _originalStart: a.start,
99
99
  _originalEnd: a.end,
100
100
  _hasPrev: me(a.start, f),
101
- _hasNext: Se(a.end, c)
101
+ _hasNext: Me(a.end, u)
102
102
  });
103
103
  }
104
104
  }
105
105
  }
106
- return Ot(i);
107
- }, Ie = (e, t) => {
106
+ return Ft(i);
107
+ }, Ne = (e, t) => {
108
108
  const n = e.filter(
109
109
  (o) => j(t, {
110
110
  start: X(o.start),
111
111
  end: q(qt(o.end, 1))
112
112
  })
113
113
  );
114
- return Re(n);
115
- }, Ot = (e) => e.sort((t, n) => {
114
+ return Ae(n);
115
+ }, Ft = (e) => e.sort((t, n) => {
116
116
  const o = t.end.getTime() - t.start.getTime();
117
117
  return n.end.getTime() - n.start.getTime() - o;
118
- }), Re = (e) => e.sort((t, n) => t.allDay || ae(t.start, t.end) > 0 ? -1 : t.start.getTime() - n.start.getTime()), Ne = (e, t, n, o, i) => {
118
+ }), Ae = (e) => e.sort((t, n) => t.allDay || se(t.start, t.end) > 0 ? -1 : t.start.getTime() - n.start.getTime()), Oe = (e, t, n, o, i) => {
119
119
  var f;
120
- const s = Array.isArray(t), a = [], d = {};
121
- for (let c = 0; c < e.length; c++) {
122
- const h = Oe(e[c], n), _ = ae(h.start, h.end) > 0, y = i && !h.allDay && _;
123
- let p = h.allDay || _ && !y;
124
- if (p && (s ? p = t.some(
125
- (u) => j(u, {
120
+ const s = Array.isArray(t), a = [], c = {};
121
+ for (let u = 0; u < e.length; u++) {
122
+ const h = Fe(e[u], n), _ = se(h.start, h.end) > 0, g = i && !h.allDay && _;
123
+ let w = h.allDay || _ && !g;
124
+ if (w && (s ? w = t.some(
125
+ (d) => j(d, {
126
126
  start: X(h.start),
127
127
  end: q(h.end)
128
128
  })
129
- ) : p = j(t, {
129
+ ) : w = j(t, {
130
130
  start: X(h.start),
131
131
  end: q(h.end)
132
- }), p))
132
+ }), w))
133
133
  if (a.push(h), s)
134
- for (const u of t) {
135
- const g = N(u, "yyyy-MM-dd");
136
- j(u, { start: X(h.start), end: q(h.end) }) && (d[g] = (d[g] || []).concat(h));
134
+ for (const d of t) {
135
+ const p = N(d, "yyyy-MM-dd");
136
+ j(d, { start: X(h.start), end: q(h.end) }) && (c[p] = (c[p] || []).concat(h));
137
137
  }
138
138
  else {
139
- const u = N(h.start, "yyyy-MM-dd");
140
- d[u] = (d[u] || []).concat(h);
139
+ const d = N(h.start, "yyyy-MM-dd");
140
+ c[d] = (c[d] || []).concat(h);
141
141
  }
142
142
  }
143
- return s && o ? ((f = Object.values(d).sort((c, h) => h.length - c.length)) == null ? void 0 : f[0]) || [] : a;
144
- }, Oe = (e, t) => ({
143
+ return s && o ? ((f = Object.values(c).sort((u, h) => h.length - u.length)) == null ? void 0 : f[0]) || [] : a;
144
+ }, Fe = (e, t) => ({
145
145
  ...e,
146
146
  start: ue(e.start, t),
147
147
  end: ue(e.end, t),
@@ -152,7 +152,7 @@ const Wn = (e) => {
152
152
  timeStyle: "medium",
153
153
  timeZone: t
154
154
  }).format(e)
155
- ), Ge = (e, t) => {
155
+ ), je = (e, t) => {
156
156
  if (!t)
157
157
  return e;
158
158
  const n = -e.getTimezoneOffset(), o = Ln(t), i = n - o;
@@ -236,7 +236,7 @@ const Vn = {
236
236
  week: n !== null ? Object.assign(Gn, n) : null,
237
237
  day: o !== null ? Object.assign(jn, o) : null
238
238
  };
239
- }, Ft = (e) => {
239
+ }, $t = (e) => {
240
240
  const {
241
241
  translations: t,
242
242
  resourceFields: n,
@@ -244,16 +244,16 @@ const Vn = {
244
244
  agenda: i,
245
245
  selectedDate: s,
246
246
  resourceViewMode: a,
247
- direction: d,
247
+ direction: c,
248
248
  dialogMaxWidth: f,
249
- hourFormat: c,
249
+ hourFormat: u,
250
250
  ...h
251
- } = e, _ = qn(e), y = o || "week", p = _[y] ? y : Wn(_);
251
+ } = e, _ = qn(e), g = o || "week", w = _[g] ? g : Wn(_);
252
252
  return {
253
253
  ..._,
254
254
  translations: Zn(t),
255
255
  resourceFields: Object.assign(Un, n),
256
- view: p,
256
+ view: w,
257
257
  selectedDate: ue(s || /* @__PURE__ */ new Date(), e.timeZone),
258
258
  height: 600,
259
259
  navigation: !0,
@@ -268,12 +268,12 @@ const Vn = {
268
268
  resources: [],
269
269
  resourceHeaderComponent: void 0,
270
270
  resourceViewMode: a || "default",
271
- direction: d || "ltr",
271
+ direction: c || "ltr",
272
272
  dialogMaxWidth: f || "md",
273
273
  locale: kn,
274
274
  deletable: !0,
275
275
  editable: !0,
276
- hourFormat: c || "12",
276
+ hourFormat: u || "12",
277
277
  draggable: !0,
278
278
  agenda: i,
279
279
  enableAgenda: typeof i > "u" || i,
@@ -281,8 +281,8 @@ const Vn = {
281
281
  forceInlineMultiDay: !1,
282
282
  ...h
283
283
  };
284
- }, $t = {
285
- ...Ft({}),
284
+ }, Rt = {
285
+ ...$t({}),
286
286
  setProps: () => {
287
287
  },
288
288
  dialog: !1,
@@ -305,10 +305,13 @@ const Vn = {
305
305
  setCurrentDragged: () => {
306
306
  },
307
307
  onDrop: () => {
308
+ },
309
+ _refetchToken: 0,
310
+ refetch: () => {
308
311
  }
309
- }, Rt = pt($t), O = () => yt(Rt), je = ({ resource: e }) => {
310
- const { resourceHeaderComponent: t, resourceFields: n, direction: o, resourceViewMode: i } = O(), s = ne(), a = e[n.textField], d = e[n.subTextField || ""], f = e[n.avatarField || ""], c = e[n.colorField || ""];
311
- return t instanceof Function ? t(e) : /* @__PURE__ */ M(
312
+ }, At = yt(Rt), O = () => mt(At), Ue = ({ resource: e }) => {
313
+ const { resourceHeaderComponent: t, resourceFields: n, direction: o, resourceViewMode: i } = O(), s = ee(), a = e[n.textField], c = e[n.subTextField || ""], f = e[n.avatarField || ""], u = e[n.colorField || ""];
314
+ return t instanceof Function ? t(e) : /* @__PURE__ */ E(
312
315
  rn,
313
316
  {
314
317
  sx: {
@@ -327,18 +330,18 @@ const Vn = {
327
330
  },
328
331
  component: "div",
329
332
  children: [
330
- /* @__PURE__ */ r(xt, { children: /* @__PURE__ */ r(qe, { sx: { background: c, margin: "auto" }, alt: a, src: f }) }),
333
+ /* @__PURE__ */ r(kt, { children: /* @__PURE__ */ r(Xe, { sx: { background: u, margin: "auto" }, alt: a, src: f }) }),
331
334
  /* @__PURE__ */ r(
332
- kt,
335
+ Tt,
333
336
  {
334
- primary: /* @__PURE__ */ r(F, { variant: "body2", noWrap: i !== "vertical", children: a }),
337
+ primary: /* @__PURE__ */ r($, { variant: "body2", noWrap: i !== "vertical", children: a }),
335
338
  secondary: /* @__PURE__ */ r(
336
- F,
339
+ $,
337
340
  {
338
341
  variant: "caption",
339
342
  color: "textSecondary",
340
343
  noWrap: i !== "vertical",
341
- children: d
344
+ children: c
342
345
  }
343
346
  )
344
347
  }
@@ -403,7 +406,7 @@ const Qn = Tn("div")(({ theme: e }) => ({
403
406
  setTab: o,
404
407
  indicator: i = "primary",
405
408
  style: s
406
- }) => /* @__PURE__ */ M(Qn, { style: s, children: [
409
+ }) => /* @__PURE__ */ E(Qn, { style: s, children: [
407
410
  /* @__PURE__ */ r(
408
411
  on,
409
412
  {
@@ -412,7 +415,7 @@ const Qn = Tn("div")(({ theme: e }) => ({
412
415
  scrollButtons: !0,
413
416
  className: "tabs",
414
417
  classes: { indicator: i },
415
- children: e.map((a, d) => /* @__PURE__ */ r(
418
+ children: e.map((a, c) => /* @__PURE__ */ r(
416
419
  an,
417
420
  {
418
421
  label: a.label,
@@ -422,18 +425,18 @@ const Qn = Tn("div")(({ theme: e }) => ({
422
425
  onClick: () => o(a.id),
423
426
  onDragEnter: () => o(a.id)
424
427
  },
425
- a.id || d
428
+ a.id || c
426
429
  ))
427
430
  }
428
431
  ),
429
432
  e.map(
430
- (a, d) => a.component && /* @__PURE__ */ r(Xn, { value: n, index: a.id, children: a.component }, d)
433
+ (a, c) => a.component && /* @__PURE__ */ r(Xn, { value: n, index: a.id, children: a.component }, c)
431
434
  )
432
- ] }), Ye = ({ renderChildren: e }) => {
433
- const { resources: t, resourceFields: n, resourceViewMode: o } = O(), i = ne();
434
- return o === "tabs" ? /* @__PURE__ */ r(Kn, { renderChildren: e }) : o === "vertical" ? /* @__PURE__ */ r(Y, { children: t.map((s, a) => /* @__PURE__ */ M(Ee, { sx: { display: "flex" }, children: [
435
+ ] }), Qe = ({ renderChildren: e }) => {
436
+ const { resources: t, resourceFields: n, resourceViewMode: o } = O(), i = ee();
437
+ return o === "tabs" ? /* @__PURE__ */ r(Kn, { renderChildren: e }) : o === "vertical" ? /* @__PURE__ */ r(Y, { children: t.map((s, a) => /* @__PURE__ */ E(Se, { sx: { display: "flex" }, children: [
435
438
  /* @__PURE__ */ r(
436
- Ee,
439
+ Se,
437
440
  {
438
441
  sx: {
439
442
  borderColor: i.palette.grey[300],
@@ -442,36 +445,36 @@ const Qn = Tn("div")(({ theme: e }) => ({
442
445
  paddingTop: 1,
443
446
  flexBasis: 140
444
447
  },
445
- children: /* @__PURE__ */ r(je, { resource: s })
448
+ children: /* @__PURE__ */ r(Ue, { resource: s })
446
449
  }
447
450
  ),
448
451
  /* @__PURE__ */ r(
449
- Ee,
452
+ Se,
450
453
  {
451
454
  sx: { width: "100%", overflowX: "auto" },
452
455
  children: e(s)
453
456
  }
454
457
  )
455
- ] }, `${s[n.idField]}_${a}`)) }) : /* @__PURE__ */ r(Y, { children: t.map((s, a) => /* @__PURE__ */ M("div", { children: [
456
- /* @__PURE__ */ r(je, { resource: s }),
458
+ ] }, `${s[n.idField]}_${a}`)) }) : /* @__PURE__ */ r(Y, { children: t.map((s, a) => /* @__PURE__ */ E("div", { children: [
459
+ /* @__PURE__ */ r(Ue, { resource: s }),
457
460
  e(s)
458
461
  ] }, `${s[n.idField]}_${a}`)) });
459
462
  }, Kn = ({ renderChildren: e }) => {
460
- const { resources: t, resourceFields: n, selectedTab: o, handleState: i, onResourceChange: s } = O(), a = t.map((c) => ({
461
- id: c[n.idField],
462
- label: /* @__PURE__ */ r(je, { resource: c }),
463
- component: /* @__PURE__ */ r(Y, { children: e(c) })
464
- })), d = (c) => {
465
- if (i(c, "selectedTab"), typeof s == "function") {
466
- const h = t.find((_) => _[n.idField] === c);
463
+ const { resources: t, resourceFields: n, selectedTab: o, handleState: i, onResourceChange: s } = O(), a = t.map((u) => ({
464
+ id: u[n.idField],
465
+ label: /* @__PURE__ */ r(Ue, { resource: u }),
466
+ component: /* @__PURE__ */ r(Y, { children: e(u) })
467
+ })), c = (u) => {
468
+ if (i(u, "selectedTab"), typeof s == "function") {
469
+ const h = t.find((_) => _[n.idField] === u);
467
470
  h && s(h);
468
471
  }
469
472
  }, f = U(() => {
470
- const c = t[0][n.idField];
471
- return !o || t.findIndex((_) => _[n.idField] === o) < 0 ? c : o;
473
+ const u = t[0][n.idField];
474
+ return !o || t.findIndex((_) => _[n.idField] === o) < 0 ? u : o;
472
475
  }, [t, n.idField, o]);
473
- return /* @__PURE__ */ r(Jn, { tabs: a, tab: f, setTab: d, style: { display: "grid" } });
474
- }, er = se("div")(({ theme: e, dialog: t }) => ({
476
+ return /* @__PURE__ */ r(Jn, { tabs: a, tab: f, setTab: c, style: { display: "grid" } });
477
+ }, er = le("div")(({ theme: e, dialog: t }) => ({
475
478
  position: "relative",
476
479
  "& .rs__table_loading": {
477
480
  position: "absolute",
@@ -481,7 +484,7 @@ const Qn = Tn("div")(({ theme: e }) => ({
481
484
  bottom: 0,
482
485
  zIndex: 999999,
483
486
  "& .rs__table_loading_internal": {
484
- background: t ? "" : Me(e.palette.background.paper, 0.4),
487
+ background: t ? "" : Ie(e.palette.background.paper, 0.4),
485
488
  height: "100%",
486
489
  "& > span": {
487
490
  display: "flex",
@@ -495,7 +498,7 @@ const Qn = Tn("div")(({ theme: e }) => ({
495
498
  }
496
499
  }
497
500
  }
498
- })), tr = se("div")(({ resource_count: e }) => ({
501
+ })), tr = le("div")(({ resource_count: e }) => ({
499
502
  position: "relative",
500
503
  display: "flex",
501
504
  flexDirection: e > 1 ? "row" : "column",
@@ -505,7 +508,7 @@ const Qn = Tn("div")(({ theme: e }) => ({
505
508
  flexShrink: 0,
506
509
  flexGrow: 1
507
510
  }
508
- })), nr = se(Tt)(
511
+ })), nr = le(Ct)(
509
512
  ({ sticky: e = "0", offset: t = 0 }) => ({
510
513
  display: "flex",
511
514
  justifyContent: "space-between",
@@ -520,7 +523,7 @@ const Qn = Tn("div")(({ theme: e }) => ({
520
523
  alignItems: "center"
521
524
  }
522
525
  })
523
- ), Ae = se("div")(
526
+ ), He = le("div")(
524
527
  ({ theme: e, stickyOffset: t = 0, stickyHeight: n = 40 }) => ({
525
528
  borderStyle: "solid",
526
529
  borderColor: e.palette.grey[300],
@@ -553,7 +556,7 @@ const Qn = Tn("div")(({ theme: e }) => ({
553
556
  }
554
557
  }
555
558
  })
556
- ), be = se("div")(
559
+ ), be = le("div")(
557
560
  ({
558
561
  days: e,
559
562
  sticky: t = "0",
@@ -613,7 +616,7 @@ const Qn = Tn("div")(({ theme: e }) => ({
613
616
  borderRadius: 0,
614
617
  cursor: "pointer",
615
618
  "&:hover": {
616
- background: Me(i.palette.primary.main, 0.1)
619
+ background: Ie(i.palette.primary.main, 0.1)
617
620
  }
618
621
  },
619
622
  "& .rs__event__item": {
@@ -641,7 +644,7 @@ const Qn = Tn("div")(({ theme: e }) => ({
641
644
  }
642
645
  }
643
646
  })
644
- ), ct = se(Tt)(({ disabled: e }) => ({
647
+ ), ut = le(Ct)(({ disabled: e }) => ({
645
648
  width: "99.5%",
646
649
  height: "100%",
647
650
  display: "block",
@@ -657,7 +660,7 @@ const Qn = Tn("div")(({ theme: e }) => ({
657
660
  // padding: "2px 4px",
658
661
  }
659
662
  }
660
- })), rr = se("div")(({ theme: e }) => ({
663
+ })), rr = le("div")(({ theme: e }) => ({
661
664
  maxWidth: "100%",
662
665
  width: 400,
663
666
  "& > div": {
@@ -671,7 +674,7 @@ const Qn = Tn("div")(({ theme: e }) => ({
671
674
  }
672
675
  }
673
676
  }
674
- })), or = se("div")(({ theme: e }) => ({
677
+ })), or = le("div")(({ theme: e }) => ({
675
678
  display: "inherit",
676
679
  "& .MuiIconButton-root": {
677
680
  color: e.palette.primary.contrastText
@@ -684,7 +687,7 @@ const Qn = Tn("div")(({ theme: e }) => ({
684
687
  color: e.palette.action.disabled
685
688
  }
686
689
  }
687
- })), ir = se("div")(({ theme: e, color: t }) => ({
690
+ })), ir = le("div")(({ theme: e, color: t }) => ({
688
691
  position: "absolute",
689
692
  zIndex: 9,
690
693
  width: "100%",
@@ -701,7 +704,7 @@ const Qn = Tn("div")(({ theme: e }) => ({
701
704
  borderTop: `solid 2px ${t || e.palette.error.light}`,
702
705
  width: "100%"
703
706
  }
704
- })), At = (e) => {
707
+ })), Ht = (e) => {
705
708
  const { editable: t, deletable: n, draggable: o } = O(), i = U(() => typeof e.editable < "u" ? e.editable : t, [t, e.editable]), s = U(() => typeof e.deletable < "u" ? e.deletable : n, [n, e.deletable]), a = U(() => {
706
709
  if (i)
707
710
  return typeof e.draggable < "u" ? e.draggable : o;
@@ -712,15 +715,15 @@ const Qn = Tn("div")(({ theme: e }) => ({
712
715
  canDrag: a
713
716
  };
714
717
  }, ar = ({ event: e, onDelete: t, onEdit: n }) => {
715
- const { translations: o, direction: i } = O(), [s, a] = L(!1), d = () => {
718
+ const { translations: o, direction: i } = O(), [s, a] = L(!1), c = () => {
716
719
  if (!s)
717
720
  return a(!0);
718
721
  t();
719
- }, { canEdit: f, canDelete: c } = At(e);
720
- return /* @__PURE__ */ M(or, { children: [
721
- /* @__PURE__ */ r(sn, { in: !s, exit: !1, timeout: 400, unmountOnExit: !0, children: /* @__PURE__ */ M("div", { children: [
722
- f && /* @__PURE__ */ r(_e, { size: "small", onClick: n, children: /* @__PURE__ */ r(En, {}) }),
723
- c && /* @__PURE__ */ r(_e, { size: "small", onClick: d, children: /* @__PURE__ */ r(Cn, {}) })
722
+ }, { canEdit: f, canDelete: u } = Ht(e);
723
+ return /* @__PURE__ */ E(or, { children: [
724
+ /* @__PURE__ */ r(sn, { in: !s, exit: !1, timeout: 400, unmountOnExit: !0, children: /* @__PURE__ */ E("div", { children: [
725
+ f && /* @__PURE__ */ r(ve, { size: "small", onClick: n, children: /* @__PURE__ */ r(En, {}) }),
726
+ u && /* @__PURE__ */ r(ve, { size: "small", onClick: c, children: /* @__PURE__ */ r(Cn, {}) })
724
727
  ] }) }),
725
728
  /* @__PURE__ */ r(
726
729
  ln,
@@ -730,54 +733,54 @@ const Qn = Tn("div")(({ theme: e }) => ({
730
733
  unmountOnExit: !0,
731
734
  timeout: 400,
732
735
  exit: !1,
733
- children: /* @__PURE__ */ M("div", { children: [
734
- /* @__PURE__ */ r(ee, { className: "delete", size: "small", onClick: d, children: o.form.delete.toUpperCase() }),
735
- /* @__PURE__ */ r(ee, { className: "cancel", size: "small", onClick: () => a(!1), children: o.form.cancel.toUpperCase() })
736
+ children: /* @__PURE__ */ E("div", { children: [
737
+ /* @__PURE__ */ r(J, { className: "delete", size: "small", onClick: c, children: o.form.delete.toUpperCase() }),
738
+ /* @__PURE__ */ r(J, { className: "cancel", size: "small", onClick: () => a(!1), children: o.form.cancel.toUpperCase() })
736
739
  ] })
737
740
  }
738
741
  )
739
742
  ] });
740
- }, Ht = ({ anchorEl: e, event: t, onTriggerViewer: n }) => {
743
+ }, Wt = ({ anchorEl: e, event: t, onTriggerViewer: n }) => {
741
744
  const {
742
745
  triggerDialog: o,
743
746
  onDelete: i,
744
747
  events: s,
745
748
  handleState: a,
746
- triggerLoading: d,
749
+ triggerLoading: c,
747
750
  customViewer: f,
748
- viewerExtraComponent: c,
751
+ viewerExtraComponent: u,
749
752
  fields: h,
750
753
  resources: _,
751
- resourceFields: y,
752
- locale: p,
753
- viewerTitleComponent: u,
754
- viewerSubtitleComponent: g,
755
- hourFormat: b,
754
+ resourceFields: g,
755
+ locale: w,
756
+ viewerTitleComponent: d,
757
+ viewerSubtitleComponent: p,
758
+ hourFormat: y,
756
759
  translations: l,
757
- onEventEdit: v
758
- } = O(), T = ne(), E = De(b), D = t._originalStart || t.start, k = t._originalEnd || t.end, S = ae(D, k) <= 0 && t.allDay, I = y.idField, m = _.filter(
759
- (x) => Array.isArray(t[I]) ? t[I].includes(x[I]) : x[I] === t[I]
760
- ), w = async () => {
760
+ onEventEdit: m
761
+ } = O(), k = ee(), C = De(y), D = t._originalStart || t.start, T = t._originalEnd || t.end, M = se(D, T) <= 0 && t.allDay, I = g.idField, v = _.filter(
762
+ (S) => Array.isArray(t[I]) ? t[I].includes(S[I]) : S[I] === t[I]
763
+ ), b = async () => {
761
764
  try {
762
- d(!0);
763
- let x = t.event_id;
765
+ c(!0);
766
+ let S = t.event_id;
764
767
  if (i) {
765
- const C = await i(x);
766
- C ? x = C : x = "";
768
+ const x = await i(S);
769
+ x ? S = x : S = "";
767
770
  }
768
- if (x) {
771
+ if (S) {
769
772
  n();
770
- const C = s.filter((W) => W.event_id !== x);
771
- a(C, "events");
773
+ const x = s.filter((W) => W.event_id !== S);
774
+ a(x, "events");
772
775
  }
773
- } catch (x) {
774
- console.error(x);
776
+ } catch (S) {
777
+ console.error(S);
775
778
  } finally {
776
- d(!1);
779
+ c(!1);
777
780
  }
778
781
  };
779
782
  return /* @__PURE__ */ r(
780
- Te,
783
+ ke,
781
784
  {
782
785
  open: !!e,
783
786
  anchorEl: e,
@@ -792,21 +795,21 @@ const Qn = Tn("div")(({ theme: e }) => ({
792
795
  vertical: "top",
793
796
  horizontal: "center"
794
797
  },
795
- onClick: (x) => {
796
- x.stopPropagation();
798
+ onClick: (S) => {
799
+ S.stopPropagation();
797
800
  },
798
- children: typeof f == "function" ? f(t, () => n()) : /* @__PURE__ */ M(rr, { children: [
799
- /* @__PURE__ */ M(
800
- Ee,
801
+ children: typeof f == "function" ? f(t, () => n()) : /* @__PURE__ */ E(rr, { children: [
802
+ /* @__PURE__ */ E(
803
+ Se,
801
804
  {
802
805
  sx: {
803
- bgcolor: t.color || T.palette.primary.main,
804
- color: T.palette.primary.contrastText
806
+ bgcolor: t.color || k.palette.primary.main,
807
+ color: k.palette.primary.contrastText
805
808
  },
806
809
  children: [
807
- /* @__PURE__ */ M("div", { className: "rs__popper_actions", children: [
810
+ /* @__PURE__ */ E("div", { className: "rs__popper_actions", children: [
808
811
  /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(
809
- _e,
812
+ ve,
810
813
  {
811
814
  size: "small",
812
815
  onClick: () => {
@@ -819,20 +822,20 @@ const Qn = Tn("div")(({ theme: e }) => ({
819
822
  ar,
820
823
  {
821
824
  event: t,
822
- onDelete: w,
825
+ onDelete: b,
823
826
  onEdit: () => {
824
- n(), o(!0, t), v && typeof v == "function" && v(t);
827
+ n(), o(!0, t), m && typeof m == "function" && m(t);
825
828
  }
826
829
  }
827
830
  )
828
831
  ] }),
829
- u instanceof Function ? u(t) : /* @__PURE__ */ r(F, { style: { padding: "5px 0" }, noWrap: !0, children: t.title })
832
+ d instanceof Function ? d(t) : /* @__PURE__ */ r($, { style: { padding: "5px 0" }, noWrap: !0, children: t.title })
830
833
  ]
831
834
  }
832
835
  ),
833
- /* @__PURE__ */ M("div", { style: { padding: "5px 10px" }, children: [
834
- /* @__PURE__ */ M(
835
- F,
836
+ /* @__PURE__ */ E("div", { style: { padding: "5px 10px" }, children: [
837
+ /* @__PURE__ */ E(
838
+ $,
836
839
  {
837
840
  style: { display: "flex", alignItems: "center", gap: 8 },
838
841
  color: "textSecondary",
@@ -840,17 +843,17 @@ const Qn = Tn("div")(({ theme: e }) => ({
840
843
  noWrap: !0,
841
844
  children: [
842
845
  /* @__PURE__ */ r(Sn, {}),
843
- S ? l.event.allDay : `${N(D, `dd MMMM yyyy ${E}`, {
844
- locale: p
845
- })} - ${N(k, `dd MMMM yyyy ${E}`, {
846
- locale: p
846
+ M ? l.event.allDay : `${N(D, `dd MMMM yyyy ${C}`, {
847
+ locale: w
848
+ })} - ${N(T, `dd MMMM yyyy ${C}`, {
849
+ locale: w
847
850
  })}`
848
851
  ]
849
852
  }
850
853
  ),
851
- g instanceof Function ? g(t) : /* @__PURE__ */ r(F, { variant: "body2", style: { padding: "5px 0" }, children: t.subtitle }),
852
- m.length > 0 && /* @__PURE__ */ M(
853
- F,
854
+ p instanceof Function ? p(t) : /* @__PURE__ */ r($, { variant: "body2", style: { padding: "5px 0" }, children: t.subtitle }),
855
+ v.length > 0 && /* @__PURE__ */ E(
856
+ $,
854
857
  {
855
858
  style: { display: "flex", alignItems: "center", gap: 8 },
856
859
  color: "textSecondary",
@@ -858,75 +861,75 @@ const Qn = Tn("div")(({ theme: e }) => ({
858
861
  noWrap: !0,
859
862
  children: [
860
863
  /* @__PURE__ */ r(In, {}),
861
- m.map((x) => x[y.textField]).join(", ")
864
+ v.map((S) => S[g.textField]).join(", ")
862
865
  ]
863
866
  }
864
867
  ),
865
- c instanceof Function ? c(h, t) : c
868
+ u instanceof Function ? u(h, t) : u
866
869
  ] })
867
870
  ] })
868
871
  }
869
872
  );
870
- }, Qe = ({ day: e, events: t }) => {
871
- const [n, o] = L(null), [i, s] = L(), [a, d] = L(!1), { locale: f, hourFormat: c, eventRenderer: h, onEventClick: _, timeZone: y, disableViewer: p } = O(), u = ne(), g = De(c), b = (l) => {
872
- !(l != null && l.currentTarget) && a && d(!1), o((l == null ? void 0 : l.currentTarget) || null);
873
+ }, Je = ({ day: e, events: t }) => {
874
+ const [n, o] = L(null), [i, s] = L(), [a, c] = L(!1), { locale: f, hourFormat: u, eventRenderer: h, onEventClick: _, timeZone: g, disableViewer: w } = O(), d = ee(), p = De(u), y = (l) => {
875
+ !(l != null && l.currentTarget) && a && c(!1), o((l == null ? void 0 : l.currentTarget) || null);
873
876
  };
874
- return /* @__PURE__ */ M(ie, { children: [
877
+ return /* @__PURE__ */ E(ie, { children: [
875
878
  /* @__PURE__ */ r(dn, { children: t.map((l) => {
876
- const T = he({
879
+ const k = he({
877
880
  dateLeft: l.start,
878
881
  dateRight: e,
879
- timeZone: y
880
- }) ? g : `MMM d, ${g}`, E = N(l.start, T, {
882
+ timeZone: g
883
+ }) ? p : `MMM d, ${p}`, C = N(l.start, k, {
881
884
  locale: f
882
- }), k = he({ dateLeft: l.end, dateRight: e, timeZone: y }) ? g : `MMM d, ${g}`, S = N(l.end, k, {
885
+ }), T = he({ dateLeft: l.end, dateRight: e, timeZone: g }) ? p : `MMM d, ${p}`, M = N(l.end, T, {
883
886
  locale: f
884
887
  });
885
888
  return typeof h == "function" ? h({
886
889
  event: l,
887
890
  onClick: (I) => {
888
- s(l), b(I);
891
+ s(l), y(I);
889
892
  }
890
- }) : /* @__PURE__ */ M(
893
+ }) : /* @__PURE__ */ E(
891
894
  cn,
892
895
  {
893
896
  focusRipple: !0,
894
- disableRipple: p,
895
- tabIndex: p ? -1 : 0,
897
+ disableRipple: w,
898
+ tabIndex: w ? -1 : 0,
896
899
  disabled: l.disabled,
897
900
  onClick: (I) => {
898
- I.preventDefault(), I.stopPropagation(), p || b(I), s(l), typeof _ == "function" && _(l);
901
+ I.preventDefault(), I.stopPropagation(), w || y(I), s(l), typeof _ == "function" && _(l);
899
902
  },
900
903
  children: [
901
- /* @__PURE__ */ r(xt, { children: /* @__PURE__ */ r(
902
- qe,
904
+ /* @__PURE__ */ r(kt, { children: /* @__PURE__ */ r(
905
+ Xe,
903
906
  {
904
907
  sx: {
905
- bgcolor: l.disabled ? "#d0d0d0" : l.color || u.palette.primary.main,
906
- color: l.disabled ? "#808080" : l.textColor || u.palette.primary.contrastText
908
+ bgcolor: l.disabled ? "#d0d0d0" : l.color || d.palette.primary.main,
909
+ color: l.disabled ? "#808080" : l.textColor || d.palette.primary.contrastText
907
910
  },
908
911
  children: l.agendaAvatar || " "
909
912
  }
910
913
  ) }),
911
- /* @__PURE__ */ r(kt, { primary: l.title, secondary: `${E} - ${S}` })
914
+ /* @__PURE__ */ r(Tt, { primary: l.title, secondary: `${C} - ${M}` })
912
915
  ]
913
916
  },
914
917
  `${l.start.getTime()}_${l.end.getTime()}_${l.event_id}`
915
918
  );
916
919
  }) }),
917
920
  i && /* @__PURE__ */ r(
918
- Ht,
921
+ Wt,
919
922
  {
920
923
  anchorEl: n,
921
924
  event: i,
922
- onTriggerViewer: b
925
+ onTriggerViewer: y
923
926
  }
924
927
  )
925
928
  ] });
926
- }, Je = () => {
929
+ }, Ke = () => {
927
930
  const { height: e, translations: t, stickyNavigationOffset: n, stickyNavigationHeight: o } = O();
928
931
  return /* @__PURE__ */ r(
929
- Ae,
932
+ He,
930
933
  {
931
934
  stickyOffset: n,
932
935
  stickyHeight: o,
@@ -938,7 +941,7 @@ const Qn = Tn("div")(({ theme: e }) => ({
938
941
  alignItems: "center",
939
942
  justifyContent: "center"
940
943
  },
941
- children: /* @__PURE__ */ r("div", { className: "rs__cell rs__agenda_items", children: /* @__PURE__ */ r(F, { children: t.noDataToDisplay }) })
944
+ children: /* @__PURE__ */ r("div", { className: "rs__cell rs__agenda_items", children: /* @__PURE__ */ r($, { children: t.noDataToDisplay }) })
942
945
  }
943
946
  );
944
947
  }, sr = ({ daysList: e, resource: t, events: n }) => {
@@ -947,33 +950,33 @@ const Qn = Tn("div")(({ theme: e }) => ({
947
950
  handleGotoDay: i,
948
951
  locale: s,
949
952
  timeZone: a,
950
- translations: d,
953
+ translations: c,
951
954
  alwaysShowAgendaDays: f,
952
- stickyNavigationOffset: c,
955
+ stickyNavigationOffset: u,
953
956
  stickyNavigationHeight: h
954
- } = O(), { disableGoToDay: _, headRenderer: y } = o, p = U(() => e.some((u) => Ie(n, u).length > 0), [e, n]);
955
- return !f && !p ? /* @__PURE__ */ r(Je, {}) : /* @__PURE__ */ r(Ae, { stickyOffset: c, stickyHeight: h, children: e.map((u, g) => {
956
- const b = he({ dateLeft: u, timeZone: a }), l = Ie(n, u);
957
- return !f && !l.length ? null : /* @__PURE__ */ M("div", { className: `rs__agenda_row ${ve(u) ? "rs__today_cell" : ""}`, children: [
958
- /* @__PURE__ */ r("div", { className: "rs__cell rs__agenda__cell", children: typeof y == "function" ? /* @__PURE__ */ r("div", { children: y({ day: u, events: n, resource: t }) }) : /* @__PURE__ */ r(
959
- F,
957
+ } = O(), { disableGoToDay: _, headRenderer: g } = o, w = U(() => e.some((d) => Ne(n, d).length > 0), [e, n]);
958
+ return !f && !w ? /* @__PURE__ */ r(Ke, {}) : /* @__PURE__ */ r(He, { stickyOffset: u, stickyHeight: h, children: e.map((d, p) => {
959
+ const y = he({ dateLeft: d, timeZone: a }), l = Ne(n, d);
960
+ return !f && !l.length ? null : /* @__PURE__ */ E("div", { className: `rs__agenda_row ${_e(d) ? "rs__today_cell" : ""}`, children: [
961
+ /* @__PURE__ */ r("div", { className: "rs__cell rs__agenda__cell", children: typeof g == "function" ? /* @__PURE__ */ r("div", { children: g({ day: d, events: n, resource: t }) }) : /* @__PURE__ */ r(
962
+ $,
960
963
  {
961
- sx: { fontWeight: b ? "bold" : "inherit" },
962
- color: b ? "primary" : "inherit",
964
+ sx: { fontWeight: y ? "bold" : "inherit" },
965
+ color: y ? "primary" : "inherit",
963
966
  variant: "body2",
964
967
  className: _ ? "" : "rs__hover__op",
965
- onClick: (v) => {
966
- v.stopPropagation(), _ || i(u);
968
+ onClick: (m) => {
969
+ m.stopPropagation(), _ || i(d);
967
970
  },
968
- children: N(u, "dd E", { locale: s })
971
+ children: N(d, "dd E", { locale: s })
969
972
  }
970
973
  ) }),
971
- /* @__PURE__ */ r("div", { className: "rs__cell rs__agenda_items", children: l.length > 0 ? /* @__PURE__ */ r(Qe, { day: u, events: l }) : /* @__PURE__ */ r(F, { sx: { padding: 1 }, children: d.noDataToDisplay }) })
972
- ] }, g);
974
+ /* @__PURE__ */ r("div", { className: "rs__cell rs__agenda_items", children: l.length > 0 ? /* @__PURE__ */ r(Je, { day: d, events: l }) : /* @__PURE__ */ r($, { sx: { padding: 1 }, children: c.noDataToDisplay }) })
975
+ ] }, p);
973
976
  }) });
974
- }, Ue = 1, pe = 28, ut = 27, lr = 23, Wt = () => {
975
- const e = nt(null), t = nt(null);
976
- return te(() => {
977
+ }, Ze = 1, pe = 28, ht = 27, lr = 23, Pt = () => {
978
+ const e = rt(null), t = rt(null);
979
+ return K(() => {
977
980
  const n = e.current, o = t.current, i = (s) => {
978
981
  const a = s.currentTarget;
979
982
  o == null || o.scroll({ left: a.scrollLeft }), n == null || n.scroll({ left: a.scrollLeft });
@@ -982,11 +985,11 @@ const Qn = Tn("div")(({ theme: e }) => ({
982
985
  n == null || n.removeEventListener("scroll", i), o == null || o.removeEventListener("scroll", i);
983
986
  };
984
987
  }), { headersRef: e, bodyRef: t };
985
- }, Pt = ({ date: e, onClick: t, locale: n }) => {
988
+ }, zt = ({ date: e, onClick: t, locale: n }) => {
986
989
  const { timeZone: o } = O(), i = he({ dateLeft: e, timeZone: o });
987
- return /* @__PURE__ */ M("div", { children: [
990
+ return /* @__PURE__ */ E("div", { children: [
988
991
  /* @__PURE__ */ r(
989
- F,
992
+ $,
990
993
  {
991
994
  style: {
992
995
  fontWeight: i ? "bold" : "inherit"
@@ -1000,7 +1003,7 @@ const Qn = Tn("div")(({ theme: e }) => ({
1000
1003
  }
1001
1004
  ),
1002
1005
  /* @__PURE__ */ r(
1003
- F,
1006
+ $,
1004
1007
  {
1005
1008
  color: i ? "primary" : "inherit",
1006
1009
  style: {
@@ -1011,12 +1014,12 @@ const Qn = Tn("div")(({ theme: e }) => ({
1011
1014
  }
1012
1015
  )
1013
1016
  ] });
1014
- }, zt = pt({
1017
+ }, Bt = yt({
1015
1018
  renderedSlots: {},
1016
1019
  setRenderedSlot: () => {
1017
1020
  }
1018
- }), Bt = () => yt(zt), dr = (e) => {
1019
- const { setCurrentDragged: t } = O(), n = ne();
1021
+ }), Lt = () => mt(Bt), dr = (e) => {
1022
+ const { setCurrentDragged: t } = O(), n = ee();
1020
1023
  return {
1021
1024
  draggable: !0,
1022
1025
  onDragStart: (o) => {
@@ -1032,26 +1035,26 @@ const Qn = Tn("div")(({ theme: e }) => ({
1032
1035
  o.stopPropagation(), o.preventDefault();
1033
1036
  }
1034
1037
  };
1035
- }, He = ({ event: e, multiday: t, hasPrev: n, hasNext: o, showdate: i = !0 }) => {
1036
- const { direction: s, locale: a, hourFormat: d, eventRenderer: f, onEventClick: c, view: h, disableViewer: _ } = O(), y = dr(e), [p, u] = L(null), [g, b] = L(!1), l = ne(), v = De(d), T = s === "rtl" ? lt : st, E = s === "rtl" ? st : lt, D = ae(e.start, e.end) <= 0 && e.allDay, { canDrag: k } = At(e), S = Z(
1037
- (m) => {
1038
- !(m != null && m.currentTarget) && g && b(!1), u((m == null ? void 0 : m.currentTarget) || null);
1038
+ }, We = ({ event: e, multiday: t, hasPrev: n, hasNext: o, showdate: i = !0 }) => {
1039
+ const { direction: s, locale: a, hourFormat: c, eventRenderer: f, onEventClick: u, view: h, disableViewer: _ } = O(), g = dr(e), [w, d] = L(null), [p, y] = L(!1), l = ee(), m = De(c), k = s === "rtl" ? dt : lt, C = s === "rtl" ? lt : dt, D = se(e.start, e.end) <= 0 && e.allDay, { canDrag: T } = Ht(e), M = Z(
1040
+ (v) => {
1041
+ !(v != null && v.currentTarget) && p && y(!1), d((v == null ? void 0 : v.currentTarget) || null);
1039
1042
  },
1040
- [g]
1043
+ [p]
1041
1044
  ), I = U(() => {
1042
1045
  if (typeof f == "function" && !t && h !== "month") {
1043
- const w = f({ event: e, onClick: S, ...y });
1044
- if (w)
1045
- return /* @__PURE__ */ r(ct, { children: w }, `${e.start.getTime()}_${e.end.getTime()}_${e.event_id}`);
1046
+ const b = f({ event: e, onClick: M, ...g });
1047
+ if (b)
1048
+ return /* @__PURE__ */ r(ut, { children: b }, `${e.start.getTime()}_${e.end.getTime()}_${e.event_id}`);
1046
1049
  }
1047
- let m = /* @__PURE__ */ M("div", { style: { padding: "2px 6px" }, children: [
1048
- /* @__PURE__ */ r(F, { variant: "subtitle2", style: { fontSize: 12 }, noWrap: !0, children: e.title }),
1049
- e.subtitle && /* @__PURE__ */ r(F, { variant: "body2", style: { fontSize: 11 }, noWrap: !0, children: e.subtitle }),
1050
- i && /* @__PURE__ */ r(F, { style: { fontSize: 11 }, noWrap: !0, children: `${N(e.start, v, {
1050
+ let v = /* @__PURE__ */ E("div", { style: { padding: "2px 6px" }, children: [
1051
+ /* @__PURE__ */ r($, { variant: "subtitle2", style: { fontSize: 12 }, noWrap: !0, children: e.title }),
1052
+ e.subtitle && /* @__PURE__ */ r($, { variant: "body2", style: { fontSize: 11 }, noWrap: !0, children: e.subtitle }),
1053
+ i && /* @__PURE__ */ r($, { style: { fontSize: 11 }, noWrap: !0, children: `${N(e.start, m, {
1051
1054
  locale: a
1052
- })} - ${N(e.end, v, { locale: a })}` })
1055
+ })} - ${N(e.end, m, { locale: a })}` })
1053
1056
  ] });
1054
- return t && (m = /* @__PURE__ */ M(
1057
+ return t && (v = /* @__PURE__ */ E(
1055
1058
  "div",
1056
1059
  {
1057
1060
  style: {
@@ -1061,13 +1064,13 @@ const Qn = Tn("div")(({ theme: e }) => ({
1061
1064
  justifyContent: "space-between"
1062
1065
  },
1063
1066
  children: [
1064
- /* @__PURE__ */ r(F, { sx: { fontSize: 11 }, noWrap: !0, children: n ? /* @__PURE__ */ r(E, { fontSize: "small", sx: { display: "flex" } }) : i && !D && N(e.start, v, { locale: a }) }),
1065
- /* @__PURE__ */ r(F, { variant: "subtitle2", align: "center", sx: { fontSize: 12 }, noWrap: !0, children: e.title }),
1066
- /* @__PURE__ */ r(F, { sx: { fontSize: 11 }, noWrap: !0, children: o ? /* @__PURE__ */ r(T, { fontSize: "small", sx: { display: "flex" } }) : i && !D && N(e.end, v, { locale: a }) })
1067
+ /* @__PURE__ */ r($, { sx: { fontSize: 11 }, noWrap: !0, children: n ? /* @__PURE__ */ r(C, { fontSize: "small", sx: { display: "flex" } }) : i && !D && N(e.start, m, { locale: a }) }),
1068
+ /* @__PURE__ */ r($, { variant: "subtitle2", align: "center", sx: { fontSize: 12 }, noWrap: !0, children: e.title }),
1069
+ /* @__PURE__ */ r($, { sx: { fontSize: 11 }, noWrap: !0, children: o ? /* @__PURE__ */ r(k, { fontSize: "small", sx: { display: "flex" } }) : i && !D && N(e.end, m, { locale: a }) })
1067
1070
  ]
1068
1071
  }
1069
1072
  )), /* @__PURE__ */ r(
1070
- ct,
1073
+ ut,
1071
1074
  {
1072
1075
  disabled: e.disabled,
1073
1076
  sx: {
@@ -1080,14 +1083,14 @@ const Qn = Tn("div")(({ theme: e }) => ({
1080
1083
  children: /* @__PURE__ */ r(
1081
1084
  un,
1082
1085
  {
1083
- onClick: (w) => {
1084
- w.preventDefault(), w.stopPropagation(), _ || S(w), typeof c == "function" && c(e);
1086
+ onClick: (b) => {
1087
+ b.preventDefault(), b.stopPropagation(), _ || M(b), typeof u == "function" && u(e);
1085
1088
  },
1086
1089
  focusRipple: !0,
1087
1090
  tabIndex: _ ? -1 : 0,
1088
1091
  disableRipple: _,
1089
1092
  disabled: e.disabled,
1090
- children: /* @__PURE__ */ r("div", { ...y, draggable: k, children: m })
1093
+ children: /* @__PURE__ */ r("div", { ...g, draggable: T, children: v })
1091
1094
  }
1092
1095
  )
1093
1096
  },
@@ -1099,48 +1102,48 @@ const Qn = Tn("div")(({ theme: e }) => ({
1099
1102
  h,
1100
1103
  e,
1101
1104
  i,
1102
- v,
1105
+ m,
1103
1106
  a,
1104
1107
  l.palette.primary.main,
1105
1108
  l.palette.primary.contrastText,
1106
1109
  _,
1107
- y,
1108
- k,
1109
- S,
1110
+ g,
1111
+ T,
1112
+ M,
1110
1113
  n,
1111
- E,
1114
+ C,
1112
1115
  D,
1113
1116
  o,
1114
- T,
1115
- c
1117
+ k,
1118
+ u
1116
1119
  ]);
1117
- return /* @__PURE__ */ M(ie, { children: [
1120
+ return /* @__PURE__ */ E(ie, { children: [
1118
1121
  I,
1119
- /* @__PURE__ */ r(Ht, { anchorEl: p, event: e, onTriggerViewer: S })
1122
+ /* @__PURE__ */ r(Wt, { anchorEl: w, event: e, onTriggerViewer: M })
1120
1123
  ] });
1121
1124
  };
1122
- function Be({
1125
+ function Le({
1123
1126
  startHour: e,
1124
1127
  step: t,
1125
1128
  minuteHeight: n,
1126
1129
  timeZone: o,
1127
1130
  currentTime: i
1128
1131
  }) {
1129
- const s = ue(i || /* @__PURE__ */ new Date(), o), a = Fe(s, ke(s, { hours: e, minutes: 0 })), d = a * n, c = a / t + Ue;
1130
- return d + c;
1132
+ const s = ue(i || /* @__PURE__ */ new Date(), o), a = $e(s, xe(s, { hours: e, minutes: 0 })), c = a * n, u = a / t + Ze;
1133
+ return c + u;
1131
1134
  }
1132
1135
  const cr = (e) => {
1133
- const [t, n] = L(Be(e)), { startHour: o, step: i, minuteHeight: s, timeZone: a, currentTime: d, color: f } = e;
1134
- return te(() => {
1135
- const c = { startHour: o, step: i, minuteHeight: s, timeZone: a, currentTime: d };
1136
- n(Be(c));
1137
- const h = setInterval(() => n(Be(c)), 60 * 1e3);
1136
+ const [t, n] = L(Le(e)), { startHour: o, step: i, minuteHeight: s, timeZone: a, currentTime: c, color: f } = e;
1137
+ return K(() => {
1138
+ const u = { startHour: o, step: i, minuteHeight: s, timeZone: a, currentTime: c };
1139
+ n(Le(u));
1140
+ const h = setInterval(() => n(Le(u)), 60 * 1e3);
1138
1141
  return () => clearInterval(h);
1139
- }, [o, i, s, a, d]), t < 0 ? null : /* @__PURE__ */ M(ir, { style: { top: t, zIndex: e.zIndex }, color: f, children: [
1142
+ }, [o, i, s, a, c]), t < 0 ? null : /* @__PURE__ */ E(ir, { style: { top: t, zIndex: e.zIndex }, color: f, children: [
1140
1143
  /* @__PURE__ */ r("div", {}),
1141
1144
  /* @__PURE__ */ r("div", {})
1142
1145
  ] });
1143
- }, Lt = ({
1146
+ }, Vt = ({
1144
1147
  todayEvents: e,
1145
1148
  today: t,
1146
1149
  startHour: n,
@@ -1148,42 +1151,42 @@ const cr = (e) => {
1148
1151
  step: i,
1149
1152
  minuteHeight: s,
1150
1153
  direction: a,
1151
- timeZone: d,
1154
+ timeZone: c,
1152
1155
  currentTime: f,
1153
- showCurrentTimeBar: c = !0,
1156
+ showCurrentTimeBar: u = !0,
1154
1157
  currentTimeBarColor: h
1155
1158
  }) => {
1156
1159
  const _ = [];
1157
- return /* @__PURE__ */ M(ie, { children: [
1158
- c && he({ dateLeft: t, timeZone: d }) && /* @__PURE__ */ r(
1160
+ return /* @__PURE__ */ E(ie, { children: [
1161
+ u && he({ dateLeft: t, timeZone: c }) && /* @__PURE__ */ r(
1159
1162
  cr,
1160
1163
  {
1161
1164
  startHour: n,
1162
1165
  step: i,
1163
1166
  minuteHeight: s,
1164
- timeZone: d,
1167
+ timeZone: c,
1165
1168
  zIndex: 2 * e.length + 1,
1166
1169
  currentTime: f,
1167
1170
  color: h
1168
1171
  }
1169
1172
  ),
1170
- e.map((y, p) => {
1171
- const u = (o * 60 - n * 60) * s, g = Fe(y.end, y.start) * s, b = Math.min(g, u) - Ue, l = n * 60, v = y.start.getHours() * 60 + y.start.getMinutes(), T = Math.max(v - l, 0), E = T * s, k = b / 60 * Ue, S = T / i, I = E + S, m = zn(e, y), w = m.filter((x) => _.includes(x.event_id));
1172
- return _.push(y.event_id), /* @__PURE__ */ r(
1173
+ e.map((g, w) => {
1174
+ const d = (o * 60 - n * 60) * s, p = $e(g.end, g.start) * s, y = Math.min(p, d) - Ze, l = n * 60, m = g.start.getHours() * 60 + g.start.getMinutes(), k = Math.max(m - l, 0), C = k * s, T = y / 60 * Ze, M = k / i, I = C + M, v = zn(e, g), b = v.filter((S) => _.includes(S.event_id));
1175
+ return _.push(g.event_id), /* @__PURE__ */ r(
1173
1176
  "div",
1174
1177
  {
1175
1178
  className: "rs__event__item",
1176
1179
  style: {
1177
- height: b + k,
1180
+ height: y + T,
1178
1181
  top: I,
1179
- width: w.length > 0 ? `calc(100% - ${100 - 98 / (w.length + 1)}%)` : "98%",
1182
+ width: b.length > 0 ? `calc(100% - ${100 - 98 / (b.length + 1)}%)` : "98%",
1180
1183
  // Leave some space to click cell
1181
- zIndex: e.length + p,
1182
- [a === "rtl" ? "right" : "left"]: w.length > 0 ? `${100 / (m.length + 1) * w.length}%` : ""
1184
+ zIndex: e.length + w,
1185
+ [a === "rtl" ? "right" : "left"]: b.length > 0 ? `${100 / (v.length + 1) * b.length}%` : ""
1183
1186
  },
1184
- children: /* @__PURE__ */ r(He, { event: y })
1187
+ children: /* @__PURE__ */ r(We, { event: g })
1185
1188
  },
1186
- `${y.event_id}/${y.recurrenceId || ""}`
1189
+ `${g.event_id}/${g.recurrenceId || ""}`
1187
1190
  );
1188
1191
  })
1189
1192
  ] });
@@ -1192,40 +1195,40 @@ const cr = (e) => {
1192
1195
  triggerDialog: i,
1193
1196
  onCellClick: s,
1194
1197
  onDrop: a,
1195
- currentDragged: d,
1198
+ currentDragged: c,
1196
1199
  setCurrentDragged: f,
1197
- editable: c,
1200
+ editable: u,
1198
1201
  timeZone: h
1199
- } = O(), _ = ne();
1202
+ } = O(), _ = ee();
1200
1203
  return {
1201
- tabIndex: c ? 0 : -1,
1202
- disableRipple: !c,
1204
+ tabIndex: u ? 0 : -1,
1205
+ disableRipple: !u,
1203
1206
  onClick: () => {
1204
- c && i(!0, {
1207
+ u && i(!0, {
1205
1208
  start: e,
1206
1209
  end: t,
1207
1210
  [n]: o
1208
1211
  }), s && typeof s == "function" && s(e, t, n, o);
1209
1212
  },
1210
- onDragOver: (y) => {
1211
- y.preventDefault(), d && (y.currentTarget.style.backgroundColor = Me(_.palette.secondary.main, 0.3));
1213
+ onDragOver: (g) => {
1214
+ g.preventDefault(), c && (g.currentTarget.style.backgroundColor = Ie(_.palette.secondary.main, 0.3));
1212
1215
  },
1213
- onDragEnter: (y) => {
1214
- d && (y.currentTarget.style.backgroundColor = Me(_.palette.secondary.main, 0.3));
1216
+ onDragEnter: (g) => {
1217
+ c && (g.currentTarget.style.backgroundColor = Ie(_.palette.secondary.main, 0.3));
1215
1218
  },
1216
- onDragLeave: (y) => {
1217
- d && (y.currentTarget.style.backgroundColor = "");
1219
+ onDragLeave: (g) => {
1220
+ c && (g.currentTarget.style.backgroundColor = "");
1218
1221
  },
1219
- onDrop: (y) => {
1220
- if (d && d.event_id) {
1221
- y.preventDefault(), y.currentTarget.style.backgroundColor = "";
1222
- const p = Ge(e, h);
1223
- a(y, d.event_id.toString(), p, n, o), f();
1222
+ onDrop: (g) => {
1223
+ if (c && c.event_id) {
1224
+ g.preventDefault(), g.currentTarget.style.backgroundColor = "";
1225
+ const w = je(e, h);
1226
+ a(g, c.event_id.toString(), w, n, o), f();
1224
1227
  }
1225
1228
  },
1226
1229
  [n]: o
1227
1230
  };
1228
- }, Ke = ({
1231
+ }, et = ({
1229
1232
  day: e,
1230
1233
  start: t,
1231
1234
  end: n,
@@ -1233,7 +1236,7 @@ const cr = (e) => {
1233
1236
  resourceVal: i,
1234
1237
  cellRenderer: s,
1235
1238
  height: a,
1236
- children: d
1239
+ children: c
1237
1240
  }) => {
1238
1241
  const f = ur({ start: t, end: n, resourceKey: o, resourceVal: i });
1239
1242
  return s ? s({
@@ -1243,7 +1246,7 @@ const cr = (e) => {
1243
1246
  height: a,
1244
1247
  ...f
1245
1248
  }) : /* @__PURE__ */ r(
1246
- ee,
1249
+ J,
1247
1250
  {
1248
1251
  fullWidth: !0,
1249
1252
  "aria-label": `${t.toLocaleString("en", {
@@ -1251,7 +1254,7 @@ const cr = (e) => {
1251
1254
  timeStyle: "long"
1252
1255
  })} - ${n.toLocaleString("en", { dateStyle: "full", timeStyle: "long" })}`,
1253
1256
  ...f,
1254
- children: d
1257
+ children: c
1255
1258
  }
1256
1259
  );
1257
1260
  }, hr = ({
@@ -1264,140 +1267,140 @@ const cr = (e) => {
1264
1267
  }) => {
1265
1268
  const {
1266
1269
  week: a,
1267
- events: d,
1270
+ events: c,
1268
1271
  handleGotoDay: f,
1269
- resources: c,
1272
+ resources: u,
1270
1273
  resourceFields: h,
1271
1274
  resourceViewMode: _,
1272
- direction: y,
1273
- locale: p,
1274
- hourFormat: u,
1275
- timeZone: g,
1276
- stickyNavigation: b,
1275
+ direction: g,
1276
+ locale: w,
1277
+ hourFormat: d,
1278
+ timeZone: p,
1279
+ stickyNavigation: y,
1277
1280
  stickyNavigationOffset: l,
1278
- stickyNavigationHeight: v,
1279
- currentTime: T,
1280
- showCurrentTimeBar: E,
1281
+ stickyNavigationHeight: m,
1282
+ currentTime: k,
1283
+ showCurrentTimeBar: C,
1281
1284
  currentTimeBarColor: D,
1282
- forceInlineMultiDay: k
1283
- } = O(), { startHour: S, endHour: I, step: m, cellRenderer: w, disableGoToDay: x, headRenderer: C, hourRenderer: W } = a, { renderedSlots: A } = Bt(), { headersRef: z, bodyRef: J } = Wt(), re = pe, K = X(e[0]), le = q(e[e.length - 1]), P = De(u), fe = U(() => {
1284
- const $ = c.length && _ === "default", R = Ne(
1285
- $ ? d : i,
1285
+ forceInlineMultiDay: T
1286
+ } = O(), { startHour: M, endHour: I, step: v, cellRenderer: b, disableGoToDay: S, headRenderer: x, hourRenderer: W } = a, { renderedSlots: R } = Lt(), { headersRef: V, bodyRef: te } = Pt(), G = pe, ae = X(e[0]), ne = q(e[e.length - 1]), P = De(d), fe = U(() => {
1287
+ const F = u.length && _ === "default", A = Oe(
1288
+ F ? c : i,
1286
1289
  e,
1287
- g,
1290
+ p,
1288
1291
  !0,
1289
- k
1292
+ T
1290
1293
  );
1291
- return re * R.length + 45;
1294
+ return G * A.length + 45;
1292
1295
  }, [
1293
- re,
1296
+ G,
1294
1297
  e,
1295
- d,
1298
+ c,
1296
1299
  _,
1297
1300
  i,
1298
- c.length,
1299
- g
1300
- ]), V = ($, R, G) => {
1301
- const oe = ye(K, R);
1302
- return Ne(
1303
- $,
1301
+ u.length,
1302
+ p
1303
+ ]), ge = (F, A, H) => {
1304
+ const re = ye(ae, A);
1305
+ return Oe(
1306
+ F,
1304
1307
  e,
1305
- g,
1308
+ p,
1306
1309
  void 0,
1307
- k
1308
- ).filter((B) => me(B.start, K) ? oe : ye(B.start, R)).sort((B, ge) => ge.end.getTime() - B.end.getTime()).map((B) => {
1309
- var tt;
1310
- const ge = me(X(B.start), K), xe = Se(q(B.end), le), Vt = ae(ge ? K : B.start, xe ? le : B.end) + 1, Gt = N(R, "yyyy-MM-dd"), jt = G ? G[h.idField] : "all", Pe = (tt = A == null ? void 0 : A[jt]) == null ? void 0 : tt[Gt], Ut = (Pe == null ? void 0 : Pe[B.event_id]) || 0;
1310
+ T
1311
+ ).filter((B) => me(B.start, ae) ? re : ye(B.start, A)).sort((B, ce) => ce.end.getTime() - B.end.getTime()).map((B) => {
1312
+ var nt;
1313
+ const ce = me(X(B.start), ae), Ce = Me(q(B.end), ne), Ee = se(ce ? ae : B.start, Ce ? ne : B.end) + 1, Gt = N(A, "yyyy-MM-dd"), jt = H ? H[h.idField] : "all", ze = (nt = R == null ? void 0 : R[jt]) == null ? void 0 : nt[Gt], Ut = (ze == null ? void 0 : ze[B.event_id]) || 0;
1311
1314
  return /* @__PURE__ */ r(
1312
1315
  "div",
1313
1316
  {
1314
1317
  className: "rs__multi_day",
1315
1318
  style: {
1316
- top: Ut * re + 45,
1317
- width: `${99.9 * Vt}%`,
1319
+ top: Ut * G + 45,
1320
+ width: `${99.9 * Ee}%`,
1318
1321
  overflowX: "hidden"
1319
1322
  },
1320
- children: /* @__PURE__ */ r(He, { event: B, hasPrev: ge, hasNext: xe, multiday: !0 })
1323
+ children: /* @__PURE__ */ r(We, { event: B, hasPrev: ce, hasNext: Ce, multiday: !0 })
1321
1324
  },
1322
1325
  B.event_id
1323
1326
  );
1324
1327
  });
1325
1328
  };
1326
- return /* @__PURE__ */ M(Y, { children: [
1327
- /* @__PURE__ */ M(
1329
+ return /* @__PURE__ */ E(Y, { children: [
1330
+ /* @__PURE__ */ E(
1328
1331
  be,
1329
1332
  {
1330
1333
  days: e.length,
1331
- ref: z,
1334
+ ref: V,
1332
1335
  sticky: "1",
1333
- stickyNavigation: b,
1336
+ stickyNavigation: y,
1334
1337
  stickyOffset: l,
1335
- stickyHeight: v,
1338
+ stickyHeight: m,
1336
1339
  children: [
1337
1340
  /* @__PURE__ */ r("span", { className: "rs__cell rs__time" }),
1338
- e.map(($, R) => /* @__PURE__ */ M(
1341
+ e.map((F, A) => /* @__PURE__ */ E(
1339
1342
  "span",
1340
1343
  {
1341
- className: `rs__cell rs__header ${ve($) ? "rs__today_cell" : ""}`,
1344
+ className: `rs__cell rs__header ${_e(F) ? "rs__today_cell" : ""}`,
1342
1345
  style: { height: fe },
1343
1346
  children: [
1344
- typeof C == "function" ? /* @__PURE__ */ r("div", { children: C({ day: $, events: i, resource: s }) }) : /* @__PURE__ */ r(
1345
- Pt,
1347
+ typeof x == "function" ? /* @__PURE__ */ r("div", { children: x({ day: F, events: i, resource: s }) }) : /* @__PURE__ */ r(
1348
+ zt,
1346
1349
  {
1347
- date: $,
1348
- onClick: x ? void 0 : f,
1349
- locale: p
1350
+ date: F,
1351
+ onClick: S ? void 0 : f,
1352
+ locale: w
1350
1353
  }
1351
1354
  ),
1352
- V(i, $, s)
1355
+ ge(i, F, s)
1353
1356
  ]
1354
1357
  },
1355
- R
1358
+ A
1356
1359
  ))
1357
1360
  ]
1358
1361
  }
1359
1362
  ),
1360
- /* @__PURE__ */ r(be, { days: e.length, ref: J, children: t.map(($, R) => /* @__PURE__ */ M(ie, { children: [
1361
- /* @__PURE__ */ r("span", { style: { height: n }, className: "rs__cell rs__header rs__time", children: typeof W == "function" ? /* @__PURE__ */ r("div", { children: W(N($, P, { locale: p })) }) : /* @__PURE__ */ r(F, { variant: "caption", children: N($, P, { locale: p }) }) }),
1362
- e.map((G, oe) => {
1363
- const H = /* @__PURE__ */ new Date(`${N(G, "yyyy/MM/dd")} ${N($, P)}`), ce = de(H, m), B = h.idField;
1364
- return /* @__PURE__ */ M("span", { className: `rs__cell ${ve(G) ? "rs__today_cell" : ""}`, children: [
1365
- R === 0 && /* @__PURE__ */ r(
1366
- Lt,
1363
+ /* @__PURE__ */ r(be, { days: e.length, ref: te, children: t.map((F, A) => /* @__PURE__ */ E(ie, { children: [
1364
+ /* @__PURE__ */ r("span", { style: { height: n }, className: "rs__cell rs__header rs__time", children: typeof W == "function" ? /* @__PURE__ */ r("div", { children: W(N(F, P, { locale: w })) }) : /* @__PURE__ */ r($, { variant: "caption", children: N(F, P, { locale: w }) }) }),
1365
+ e.map((H, re) => {
1366
+ const z = /* @__PURE__ */ new Date(`${N(H, "yyyy/MM/dd")} ${N(F, P)}`), oe = de(z, v), B = h.idField;
1367
+ return /* @__PURE__ */ E("span", { className: `rs__cell ${_e(H) ? "rs__today_cell" : ""}`, children: [
1368
+ A === 0 && /* @__PURE__ */ r(
1369
+ Vt,
1367
1370
  {
1368
- todayEvents: Nt(
1371
+ todayEvents: Ot(
1369
1372
  i,
1370
- G,
1371
- g,
1372
- k
1373
+ H,
1374
+ p,
1375
+ T
1373
1376
  ),
1374
- today: G,
1377
+ today: H,
1375
1378
  minuteHeight: o,
1376
- startHour: S,
1379
+ startHour: M,
1377
1380
  endHour: I,
1378
- step: m,
1379
- direction: y,
1380
- timeZone: g,
1381
- currentTime: T,
1382
- showCurrentTimeBar: E,
1381
+ step: v,
1382
+ direction: g,
1383
+ timeZone: p,
1384
+ currentTime: k,
1385
+ showCurrentTimeBar: C,
1383
1386
  currentTimeBarColor: D
1384
1387
  }
1385
1388
  ),
1386
1389
  /* @__PURE__ */ r(
1387
- Ke,
1390
+ et,
1388
1391
  {
1389
- start: H,
1390
- end: ce,
1391
- day: G,
1392
+ start: z,
1393
+ end: oe,
1394
+ day: H,
1392
1395
  height: n,
1393
1396
  resourceKey: B,
1394
1397
  resourceVal: s ? s[B] : null,
1395
- cellRenderer: w
1398
+ cellRenderer: b
1396
1399
  }
1397
1400
  )
1398
- ] }, oe);
1401
+ ] }, re);
1399
1402
  })
1400
- ] }, R)) })
1403
+ ] }, A)) })
1401
1404
  ] });
1402
1405
  }, fr = () => {
1403
1406
  const {
@@ -1408,22 +1411,23 @@ const cr = (e) => {
1408
1411
  getRemoteEvents: i,
1409
1412
  triggerLoading: s,
1410
1413
  handleState: a,
1411
- resources: d,
1414
+ resources: c,
1412
1415
  resourceFields: f,
1413
- fields: c,
1414
- agenda: h
1415
- } = O(), { weekStartOn: _, weekDays: y, startHour: p, endHour: u, step: g } = e, b = $e(t, { weekStartsOn: _ }), l = y.map((x) => Q(b, x)), v = X(l[0]), T = q(l[l.length - 1]), E = ke(t, { hours: p, minutes: 0, seconds: 0 }), D = ke(t, { hours: u, minutes: -g, seconds: 0 }), k = _t(
1416
+ fields: u,
1417
+ agenda: h,
1418
+ _refetchToken: _
1419
+ } = O(), { weekStartOn: g, weekDays: w, startHour: d, endHour: p, step: y } = e, l = Re(t, { weekStartsOn: g }), m = w.map((x) => Q(l, x)), k = X(m[0]), C = q(m[m.length - 1]), D = xe(t, { hours: d, minutes: 0, seconds: 0 }), T = xe(t, { hours: p, minutes: -y, seconds: 0 }), M = bt(
1416
1420
  {
1417
- start: E,
1418
- end: D
1421
+ start: D,
1422
+ end: T
1419
1423
  },
1420
- { step: g }
1421
- ), S = Mt(n, k.length), I = St(S, g), m = Z(async () => {
1424
+ { step: y }
1425
+ ), I = It(n, M.length), v = Mt(I, y), b = Z(async () => {
1422
1426
  try {
1423
1427
  s(!0);
1424
1428
  const x = await i({
1425
- start: v,
1426
- end: T,
1429
+ start: k,
1430
+ end: C,
1427
1431
  view: "week"
1428
1432
  });
1429
1433
  Array.isArray(x) && a(x, "events");
@@ -1432,33 +1436,33 @@ const cr = (e) => {
1432
1436
  } finally {
1433
1437
  s(!1);
1434
1438
  }
1435
- }, [i]);
1436
- te(() => {
1437
- i instanceof Function && m();
1438
- }, [m, i]);
1439
- const w = (x) => {
1440
- let C = o;
1441
- return x && (C = Ce(o, x, f, c)), h ? /* @__PURE__ */ r(sr, { daysList: l, resource: x, events: C }) : /* @__PURE__ */ r(
1439
+ }, [i, _]);
1440
+ K(() => {
1441
+ i instanceof Function && b();
1442
+ }, [b, i, _]);
1443
+ const S = (x) => {
1444
+ let W = o;
1445
+ return x && (W = Te(o, x, f, u)), h ? /* @__PURE__ */ r(sr, { daysList: m, resource: x, events: W }) : /* @__PURE__ */ r(
1442
1446
  hr,
1443
1447
  {
1444
- resourcedEvents: C,
1448
+ resourcedEvents: W,
1445
1449
  resource: x,
1446
- hours: k,
1447
- cellHeight: S,
1448
- minutesHeight: I,
1449
- daysList: l
1450
+ hours: M,
1451
+ cellHeight: I,
1452
+ minutesHeight: v,
1453
+ daysList: m
1450
1454
  }
1451
1455
  );
1452
1456
  };
1453
- return d.length ? /* @__PURE__ */ r(Ye, { renderChildren: w }) : w();
1454
- }, We = ({ children: e }) => {
1457
+ return c.length ? /* @__PURE__ */ r(Qe, { renderChildren: S }) : S();
1458
+ }, Pe = ({ children: e }) => {
1455
1459
  const { locale: t } = O();
1456
1460
  return /* @__PURE__ */ r(Nn, { dateAdapter: On, adapterLocale: t, children: e });
1457
1461
  }, we = ({ type: e, onClick: t, ...n }) => {
1458
1462
  const { direction: o } = O();
1459
- let i = ze;
1460
- return e === "prev" ? i = o === "rtl" ? ze : dt : e === "next" && (i = o === "rtl" ? dt : ze), /* @__PURE__ */ r(
1461
- _e,
1463
+ let i = Be;
1464
+ return e === "prev" ? i = o === "rtl" ? Be : ct : e === "next" && (i = o === "rtl" ? ct : Be), /* @__PURE__ */ r(
1465
+ ve,
1462
1466
  {
1463
1467
  style: { padding: 2 },
1464
1468
  onClick: t,
@@ -1469,54 +1473,54 @@ const cr = (e) => {
1469
1473
  children: /* @__PURE__ */ r(i, {})
1470
1474
  }
1471
1475
  );
1472
- }, et = () => {
1473
- const { selectedDate: e, week: t, navigationPickerProps: n, view: o } = O(), i = n == null ? void 0 : n.minDate, s = n == null ? void 0 : n.maxDate, a = o === "month" ? bt(e) : o === "week" ? wt(e, { weekStartsOn: t == null ? void 0 : t.weekStartOn }) : e, d = o === "month" ? Ze(e) : o === "week" ? $e(e, { weekStartsOn: t == null ? void 0 : t.weekStartOn }) : e, f = i ? d <= i : !1, c = s ? a >= s : !1;
1474
- return { prevDisabled: f, nextDisabled: c };
1476
+ }, tt = () => {
1477
+ const { selectedDate: e, week: t, navigationPickerProps: n, view: o } = O(), i = n == null ? void 0 : n.minDate, s = n == null ? void 0 : n.maxDate, a = o === "month" ? wt(e) : o === "week" ? Dt(e, { weekStartsOn: t == null ? void 0 : t.weekStartOn }) : e, c = o === "month" ? qe(e) : o === "week" ? Re(e, { weekStartsOn: t == null ? void 0 : t.weekStartOn }) : e, f = i ? c <= i : !1, u = s ? a >= s : !1;
1478
+ return { prevDisabled: f, nextDisabled: u };
1475
1479
  }, gr = ({ selectedDate: e, onChange: t, weekProps: n }) => {
1476
- const { locale: o, navigationPickerProps: i } = O(), [s, a] = L(null), { weekStartOn: d } = n, f = $e(e, { weekStartsOn: d }), c = wt(e, { weekStartsOn: d }), { prevDisabled: h, nextDisabled: _ } = et(), y = (l) => {
1480
+ const { locale: o, navigationPickerProps: i } = O(), [s, a] = L(null), { weekStartOn: c } = n, f = Re(e, { weekStartsOn: c }), u = Dt(e, { weekStartsOn: c }), { prevDisabled: h, nextDisabled: _ } = tt(), g = (l) => {
1477
1481
  a(l.currentTarget);
1478
- }, p = () => {
1482
+ }, w = () => {
1479
1483
  a(null);
1480
- }, u = (l) => {
1481
- t(l || /* @__PURE__ */ new Date()), p();
1482
- }, g = () => {
1484
+ }, d = (l) => {
1485
+ t(l || /* @__PURE__ */ new Date()), w();
1486
+ }, p = () => {
1483
1487
  const l = Q(f, -1);
1484
1488
  t(l);
1485
- }, b = () => {
1486
- const l = Q(c, 1);
1489
+ }, y = () => {
1490
+ const l = Q(u, 1);
1487
1491
  t(l);
1488
1492
  };
1489
- return /* @__PURE__ */ M(Y, { children: [
1493
+ return /* @__PURE__ */ E(Y, { children: [
1490
1494
  /* @__PURE__ */ r(
1491
1495
  we,
1492
1496
  {
1493
1497
  type: "prev",
1494
- onClick: g,
1498
+ onClick: p,
1495
1499
  disabled: h,
1496
1500
  "aria-label": "previous week"
1497
1501
  }
1498
1502
  ),
1499
- /* @__PURE__ */ r(ee, { style: { padding: 4 }, onClick: y, "aria-label": "selected week", children: `${N(f, "dd", { locale: o })} - ${N(c, "dd MMM yyyy", {
1503
+ /* @__PURE__ */ r(J, { style: { padding: 4 }, onClick: g, "aria-label": "selected week", children: `${N(f, "dd", { locale: o })} - ${N(u, "dd MMM yyyy", {
1500
1504
  locale: o
1501
1505
  })}` }),
1502
1506
  /* @__PURE__ */ r(
1503
- Te,
1507
+ ke,
1504
1508
  {
1505
1509
  open: !!s,
1506
1510
  anchorEl: s,
1507
- onClose: p,
1511
+ onClose: w,
1508
1512
  anchorOrigin: {
1509
1513
  vertical: "bottom",
1510
1514
  horizontal: "left"
1511
1515
  },
1512
- children: /* @__PURE__ */ r(We, { children: /* @__PURE__ */ r(
1513
- Xe,
1516
+ children: /* @__PURE__ */ r(Pe, { children: /* @__PURE__ */ r(
1517
+ Ye,
1514
1518
  {
1515
1519
  ...i,
1516
1520
  openTo: "day",
1517
1521
  views: ["month", "day"],
1518
1522
  value: e,
1519
- onChange: u
1523
+ onChange: d
1520
1524
  }
1521
1525
  ) })
1522
1526
  }
@@ -1525,27 +1529,27 @@ const cr = (e) => {
1525
1529
  we,
1526
1530
  {
1527
1531
  type: "next",
1528
- onClick: b,
1532
+ onClick: y,
1529
1533
  disabled: _,
1530
1534
  "aria-label": "next week"
1531
1535
  }
1532
1536
  )
1533
1537
  ] });
1534
1538
  }, pr = ({ selectedDate: e, onChange: t }) => {
1535
- const { locale: n, navigationPickerProps: o } = O(), [i, s] = L(null), { prevDisabled: a, nextDisabled: d } = et(), f = (p) => {
1536
- s(p.currentTarget);
1537
- }, c = () => {
1539
+ const { locale: n, navigationPickerProps: o } = O(), [i, s] = L(null), { prevDisabled: a, nextDisabled: c } = tt(), f = (w) => {
1540
+ s(w.currentTarget);
1541
+ }, u = () => {
1538
1542
  s(null);
1539
- }, h = (p) => {
1540
- t(p || /* @__PURE__ */ new Date()), c();
1543
+ }, h = (w) => {
1544
+ t(w || /* @__PURE__ */ new Date()), u();
1541
1545
  }, _ = () => {
1542
- const p = Q(e, -1);
1543
- t(p);
1544
- }, y = () => {
1545
- const p = Q(e, 1);
1546
- t(p);
1546
+ const w = Q(e, -1);
1547
+ t(w);
1548
+ }, g = () => {
1549
+ const w = Q(e, 1);
1550
+ t(w);
1547
1551
  };
1548
- return /* @__PURE__ */ M(Y, { children: [
1552
+ return /* @__PURE__ */ E(Y, { children: [
1549
1553
  /* @__PURE__ */ r(
1550
1554
  we,
1551
1555
  {
@@ -1555,19 +1559,19 @@ const cr = (e) => {
1555
1559
  "aria-label": "previous day"
1556
1560
  }
1557
1561
  ),
1558
- /* @__PURE__ */ r(ee, { style: { padding: 4 }, onClick: f, "aria-label": "selected date", children: N(e, "dd MMMM yyyy", { locale: n }) }),
1562
+ /* @__PURE__ */ r(J, { style: { padding: 4 }, onClick: f, "aria-label": "selected date", children: N(e, "dd MMMM yyyy", { locale: n }) }),
1559
1563
  /* @__PURE__ */ r(
1560
- Te,
1564
+ ke,
1561
1565
  {
1562
1566
  open: !!i,
1563
1567
  anchorEl: i,
1564
- onClose: c,
1568
+ onClose: u,
1565
1569
  anchorOrigin: {
1566
1570
  vertical: "bottom",
1567
1571
  horizontal: "left"
1568
1572
  },
1569
- children: /* @__PURE__ */ r(We, { children: /* @__PURE__ */ r(
1570
- Xe,
1573
+ children: /* @__PURE__ */ r(Pe, { children: /* @__PURE__ */ r(
1574
+ Ye,
1571
1575
  {
1572
1576
  ...o,
1573
1577
  openTo: "day",
@@ -1578,35 +1582,35 @@ const cr = (e) => {
1578
1582
  ) })
1579
1583
  }
1580
1584
  ),
1581
- /* @__PURE__ */ r(we, { type: "next", onClick: y, disabled: d, "aria-label": "next day" })
1585
+ /* @__PURE__ */ r(we, { type: "next", onClick: g, disabled: c, "aria-label": "next day" })
1582
1586
  ] });
1583
1587
  }, yr = ({ selectedDate: e, onChange: t }) => {
1584
- const { locale: n, navigationPickerProps: o } = O(), i = Qt(e), [s, a] = L(null), { prevDisabled: d, nextDisabled: f } = et(), c = (u) => {
1585
- a(u.currentTarget);
1588
+ const { locale: n, navigationPickerProps: o } = O(), i = Qt(e), [s, a] = L(null), { prevDisabled: c, nextDisabled: f } = tt(), u = (d) => {
1589
+ a(d.currentTarget);
1586
1590
  }, h = () => {
1587
1591
  a(null);
1588
- }, _ = (u) => {
1589
- t(u || /* @__PURE__ */ new Date()), h();
1590
- }, y = () => {
1591
- const u = i - 1;
1592
- t(rt(e, u));
1593
- }, p = () => {
1594
- const u = i + 1;
1595
- t(rt(e, u));
1592
+ }, _ = (d) => {
1593
+ t(d || /* @__PURE__ */ new Date()), h();
1594
+ }, g = () => {
1595
+ const d = i - 1;
1596
+ t(ot(e, d));
1597
+ }, w = () => {
1598
+ const d = i + 1;
1599
+ t(ot(e, d));
1596
1600
  };
1597
- return /* @__PURE__ */ M(Y, { children: [
1601
+ return /* @__PURE__ */ E(Y, { children: [
1598
1602
  /* @__PURE__ */ r(
1599
1603
  we,
1600
1604
  {
1601
1605
  type: "prev",
1602
- onClick: y,
1603
- disabled: d,
1606
+ onClick: g,
1607
+ disabled: c,
1604
1608
  "aria-label": "previous month"
1605
1609
  }
1606
1610
  ),
1607
- /* @__PURE__ */ r(ee, { style: { padding: 4 }, onClick: c, "aria-label": "selected month", children: N(e, "MMMM yyyy", { locale: n }) }),
1611
+ /* @__PURE__ */ r(J, { style: { padding: 4 }, onClick: u, "aria-label": "selected month", children: N(e, "MMMM yyyy", { locale: n }) }),
1608
1612
  /* @__PURE__ */ r(
1609
- Te,
1613
+ ke,
1610
1614
  {
1611
1615
  open: !!s,
1612
1616
  anchorEl: s,
@@ -1615,8 +1619,8 @@ const cr = (e) => {
1615
1619
  vertical: "bottom",
1616
1620
  horizontal: "left"
1617
1621
  },
1618
- children: /* @__PURE__ */ r(We, { children: /* @__PURE__ */ r(
1619
- Xe,
1622
+ children: /* @__PURE__ */ r(Pe, { children: /* @__PURE__ */ r(
1623
+ Ye,
1620
1624
  {
1621
1625
  ...o,
1622
1626
  openTo: "month",
@@ -1631,7 +1635,7 @@ const cr = (e) => {
1631
1635
  we,
1632
1636
  {
1633
1637
  type: "next",
1634
- onClick: p,
1638
+ onClick: w,
1635
1639
  disabled: f,
1636
1640
  "aria-label": "next month"
1637
1641
  }
@@ -1646,107 +1650,107 @@ const cr = (e) => {
1646
1650
  getViews: i,
1647
1651
  translations: s,
1648
1652
  navigation: a,
1649
- day: d,
1653
+ day: c,
1650
1654
  month: f,
1651
- disableViewNavigator: c,
1655
+ disableViewNavigator: u,
1652
1656
  onSelectedDateChange: h,
1653
1657
  onViewChange: _,
1654
- stickyNavigation: y,
1655
- timeZone: p,
1656
- agenda: u,
1657
- toggleAgenda: g,
1658
- enableAgenda: b,
1658
+ stickyNavigation: g,
1659
+ timeZone: w,
1660
+ agenda: d,
1661
+ toggleAgenda: p,
1662
+ enableAgenda: y,
1659
1663
  customHeaderContent: l,
1660
- stickyNavigationOffset: v
1661
- } = O(), [T, E] = L(null), D = ne(), k = Ct(D.breakpoints.up("sm")), S = i(), I = (C) => {
1662
- E(C || null);
1663
- }, m = (C) => {
1664
- o(C, "selectedDate"), h && typeof h == "function" && h(C);
1665
- }, w = (C) => {
1666
- o(C, "view"), _ && typeof _ == "function" && _(C, u);
1667
- }, x = () => {
1664
+ stickyNavigationOffset: m
1665
+ } = O(), [k, C] = L(null), D = ee(), T = Et(D.breakpoints.up("sm")), M = i(), I = (x) => {
1666
+ C(x || null);
1667
+ }, v = (x) => {
1668
+ o(x, "selectedDate"), h && typeof h == "function" && h(x);
1669
+ }, b = (x) => {
1670
+ o(x, "view"), _ && typeof _ == "function" && _(x, d);
1671
+ }, S = () => {
1668
1672
  switch (t) {
1669
1673
  case "month":
1670
- return (f == null ? void 0 : f.navigation) && /* @__PURE__ */ r(yr, { selectedDate: e, onChange: m });
1674
+ return (f == null ? void 0 : f.navigation) && /* @__PURE__ */ r(yr, { selectedDate: e, onChange: v });
1671
1675
  case "week":
1672
1676
  return (n == null ? void 0 : n.navigation) && /* @__PURE__ */ r(
1673
1677
  gr,
1674
1678
  {
1675
1679
  selectedDate: e,
1676
- onChange: m,
1680
+ onChange: v,
1677
1681
  weekProps: n
1678
1682
  }
1679
1683
  );
1680
1684
  case "day":
1681
- return (d == null ? void 0 : d.navigation) && /* @__PURE__ */ r(pr, { selectedDate: e, onChange: m });
1685
+ return (c == null ? void 0 : c.navigation) && /* @__PURE__ */ r(pr, { selectedDate: e, onChange: v });
1682
1686
  default:
1683
1687
  return "";
1684
1688
  }
1685
1689
  };
1686
- return !a && c ? null : /* @__PURE__ */ M(nr, { sticky: y ? "1" : "0", offset: v, children: [
1687
- /* @__PURE__ */ r("div", { "data-testid": "date-navigator", children: a && x() }),
1690
+ return !a && u ? null : /* @__PURE__ */ E(nr, { sticky: g ? "1" : "0", offset: m, children: [
1691
+ /* @__PURE__ */ r("div", { "data-testid": "date-navigator", children: a && S() }),
1688
1692
  l && /* @__PURE__ */ r("div", { className: "rs__custom_header_content", children: l() }),
1689
- /* @__PURE__ */ M(
1693
+ /* @__PURE__ */ E(
1690
1694
  "div",
1691
1695
  {
1692
1696
  className: "rs__view_navigator",
1693
1697
  "data-testid": "view-navigator",
1694
1698
  style: {
1695
- visibility: c ? "hidden" : "visible"
1699
+ visibility: u ? "hidden" : "visible"
1696
1700
  },
1697
1701
  children: [
1698
1702
  /* @__PURE__ */ r(
1699
- ee,
1703
+ J,
1700
1704
  {
1701
- onClick: () => m(ue(/* @__PURE__ */ new Date(), p)),
1705
+ onClick: () => v(ue(/* @__PURE__ */ new Date(), w)),
1702
1706
  "aria-label": s.navigation.today,
1703
1707
  children: s.navigation.today
1704
1708
  }
1705
1709
  ),
1706
- b && (k ? /* @__PURE__ */ r(
1707
- ee,
1710
+ y && (T ? /* @__PURE__ */ r(
1711
+ J,
1708
1712
  {
1709
- color: u ? "primary" : "inherit",
1710
- onClick: g,
1713
+ color: d ? "primary" : "inherit",
1714
+ onClick: p,
1711
1715
  "aria-label": s.navigation.agenda,
1712
1716
  children: s.navigation.agenda
1713
1717
  }
1714
1718
  ) : /* @__PURE__ */ r(
1715
- _e,
1719
+ ve,
1716
1720
  {
1717
- color: u ? "primary" : "default",
1721
+ color: d ? "primary" : "default",
1718
1722
  style: { padding: 5 },
1719
- onClick: g,
1723
+ onClick: p,
1720
1724
  children: /* @__PURE__ */ r($n, {})
1721
1725
  }
1722
1726
  )),
1723
- S.length > 1 && (k ? S.map((C) => /* @__PURE__ */ r(
1724
- ee,
1727
+ M.length > 1 && (T ? M.map((x) => /* @__PURE__ */ r(
1728
+ J,
1725
1729
  {
1726
- color: C === t ? "primary" : "inherit",
1727
- onClick: () => w(C),
1730
+ color: x === t ? "primary" : "inherit",
1731
+ onClick: () => b(x),
1728
1732
  onDragOver: (W) => {
1729
- W.preventDefault(), w(C);
1733
+ W.preventDefault(), b(x);
1730
1734
  },
1731
- children: s.navigation[C]
1735
+ children: s.navigation[x]
1732
1736
  },
1733
- C
1734
- )) : /* @__PURE__ */ M(ie, { children: [
1737
+ x
1738
+ )) : /* @__PURE__ */ E(ie, { children: [
1735
1739
  /* @__PURE__ */ r(
1736
- _e,
1740
+ ve,
1737
1741
  {
1738
1742
  style: { padding: 5 },
1739
- onClick: (C) => {
1740
- I(C.currentTarget);
1743
+ onClick: (x) => {
1744
+ I(x.currentTarget);
1741
1745
  },
1742
1746
  children: /* @__PURE__ */ r(Fn, {})
1743
1747
  }
1744
1748
  ),
1745
1749
  /* @__PURE__ */ r(
1746
- Te,
1750
+ ke,
1747
1751
  {
1748
- open: !!T,
1749
- anchorEl: T,
1752
+ open: !!k,
1753
+ anchorEl: k,
1750
1754
  onClose: () => {
1751
1755
  I();
1752
1756
  },
@@ -1758,16 +1762,16 @@ const cr = (e) => {
1758
1762
  vertical: "top",
1759
1763
  horizontal: "center"
1760
1764
  },
1761
- children: /* @__PURE__ */ r(hn, { autoFocusItem: !!T, disablePadding: !0, children: S.map((C) => /* @__PURE__ */ r(
1762
- Le,
1765
+ children: /* @__PURE__ */ r(hn, { autoFocusItem: !!k, disablePadding: !0, children: M.map((x) => /* @__PURE__ */ r(
1766
+ Ve,
1763
1767
  {
1764
- selected: C === t,
1768
+ selected: x === t,
1765
1769
  onClick: () => {
1766
- I(), w(C);
1770
+ I(), b(x);
1767
1771
  },
1768
- children: s.navigation[C]
1772
+ children: s.navigation[x]
1769
1773
  },
1770
- C
1774
+ x
1771
1775
  )) })
1772
1776
  }
1773
1777
  )
@@ -1776,7 +1780,7 @@ const cr = (e) => {
1776
1780
  }
1777
1781
  )
1778
1782
  ] });
1779
- }, vr = ({
1783
+ }, _r = ({
1780
1784
  type: e = "datetime",
1781
1785
  value: t,
1782
1786
  label: n,
@@ -1784,46 +1788,46 @@ const cr = (e) => {
1784
1788
  onChange: i,
1785
1789
  variant: s = "outlined",
1786
1790
  error: a,
1787
- errMsg: d,
1791
+ errMsg: c,
1788
1792
  touched: f,
1789
- required: c
1793
+ required: u
1790
1794
  }) => {
1791
- var b, l;
1792
- const { translations: h } = O(), [_, y] = L({
1795
+ var y, l;
1796
+ const { translations: h } = O(), [_, g] = L({
1793
1797
  touched: !1,
1794
1798
  valid: !!t,
1795
- errorMsg: d || (c ? ((b = h == null ? void 0 : h.validation) == null ? void 0 : b.required) || "Required" : void 0)
1796
- }), p = e === "date" ? Rn : An, u = _.touched && (a || !_.valid), g = Z(
1797
- (v) => {
1798
- var S;
1799
- const T = !isNaN(Date.parse(v)), E = typeof v == "string" && T ? new Date(v) : v;
1800
- let D = !0, k = d;
1801
- c && !E && (D = !1, k = d || ((S = h == null ? void 0 : h.validation) == null ? void 0 : S.required) || "Required"), y((I) => ({ ...I, touched: !0, valid: D, errorMsg: k })), i(o, E);
1799
+ errorMsg: c || (u ? ((y = h == null ? void 0 : h.validation) == null ? void 0 : y.required) || "Required" : void 0)
1800
+ }), w = e === "date" ? Rn : An, d = _.touched && (a || !_.valid), p = Z(
1801
+ (m) => {
1802
+ var M;
1803
+ const k = !isNaN(Date.parse(m)), C = typeof m == "string" && k ? new Date(m) : m;
1804
+ let D = !0, T = c;
1805
+ u && !C && (D = !1, T = c || ((M = h == null ? void 0 : h.validation) == null ? void 0 : M.required) || "Required"), g((I) => ({ ...I, touched: !0, valid: D, errorMsg: T })), i(o, C);
1802
1806
  },
1803
- [d, o, i, c, (l = h == null ? void 0 : h.validation) == null ? void 0 : l.required]
1807
+ [c, o, i, u, (l = h == null ? void 0 : h.validation) == null ? void 0 : l.required]
1804
1808
  );
1805
- return te(() => {
1806
- f && g(t);
1807
- }, [g, f, t]), /* @__PURE__ */ r(We, { children: /* @__PURE__ */ r(
1808
- p,
1809
+ return K(() => {
1810
+ f && p(t);
1811
+ }, [p, f, t]), /* @__PURE__ */ r(Pe, { children: /* @__PURE__ */ r(
1812
+ w,
1809
1813
  {
1810
1814
  value: t instanceof Date ? t : new Date(t),
1811
1815
  label: n,
1812
- onChange: (v) => {
1813
- g(v);
1816
+ onChange: (m) => {
1817
+ p(m);
1814
1818
  },
1815
1819
  minutesStep: 5,
1816
1820
  slotProps: {
1817
1821
  textField: {
1818
1822
  variant: s,
1819
- helperText: u && _.errorMsg,
1820
- error: u,
1823
+ helperText: d && _.errorMsg,
1824
+ error: d,
1821
1825
  fullWidth: !0
1822
1826
  }
1823
1827
  }
1824
1828
  }
1825
1829
  ) });
1826
- }, _r = ({
1830
+ }, vr = ({
1827
1831
  variant: e = "outlined",
1828
1832
  label: t,
1829
1833
  placeholder: n,
@@ -1831,43 +1835,43 @@ const cr = (e) => {
1831
1835
  name: i,
1832
1836
  required: s,
1833
1837
  min: a,
1834
- max: d,
1838
+ max: c,
1835
1839
  email: f,
1836
- decimal: c,
1840
+ decimal: u,
1837
1841
  onChange: h,
1838
1842
  disabled: _,
1839
- multiline: y,
1840
- rows: p,
1841
- touched: u
1843
+ multiline: g,
1844
+ rows: w,
1845
+ touched: d
1842
1846
  }) => {
1843
- const [g, b] = L({
1847
+ const [p, y] = L({
1844
1848
  touched: !1,
1845
1849
  valid: !1,
1846
1850
  errorMsg: ""
1847
- }), { translations: l } = O(), v = Z(
1848
- (T) => {
1849
- var S, I, m, w, x, C, W, A, z;
1850
- const E = T;
1851
- let D = !0, k = "";
1852
- f && (D = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(E) && D, k = ((S = l == null ? void 0 : l.validation) == null ? void 0 : S.invalidEmail) || "Invalid Email"), c && (D = /^[0-9]+(\.[0-9]*)?$/.test(E) && D, k = ((I = l == null ? void 0 : l.validation) == null ? void 0 : I.onlyNumbers) || "Only Numbers Allowed"), a && `${E}`.trim().length < a && (D = !1, k = typeof ((m = l == null ? void 0 : l.validation) == null ? void 0 : m.min) == "function" ? (w = l == null ? void 0 : l.validation) == null ? void 0 : w.min(a) : ((x = l == null ? void 0 : l.validation) == null ? void 0 : x.min) || `Minimum ${a} letters`), d && `${E}`.trim().length > d && (D = !1, k = typeof ((C = l == null ? void 0 : l.validation) == null ? void 0 : C.max) == "function" ? (W = l == null ? void 0 : l.validation) == null ? void 0 : W.max(d) : ((A = l == null ? void 0 : l.validation) == null ? void 0 : A.max) || `Maximum ${d} letters`), s && `${E}`.trim().length <= 0 && (D = !1, k = ((z = l == null ? void 0 : l.validation) == null ? void 0 : z.required) || "Required"), b({ touched: !0, valid: D, errorMsg: k }), h(i, E, D);
1851
+ }), { translations: l } = O(), m = Z(
1852
+ (k) => {
1853
+ var M, I, v, b, S, x, W, R, V;
1854
+ const C = k;
1855
+ let D = !0, T = "";
1856
+ f && (D = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(C) && D, T = ((M = l == null ? void 0 : l.validation) == null ? void 0 : M.invalidEmail) || "Invalid Email"), u && (D = /^[0-9]+(\.[0-9]*)?$/.test(C) && D, T = ((I = l == null ? void 0 : l.validation) == null ? void 0 : I.onlyNumbers) || "Only Numbers Allowed"), a && `${C}`.trim().length < a && (D = !1, T = typeof ((v = l == null ? void 0 : l.validation) == null ? void 0 : v.min) == "function" ? (b = l == null ? void 0 : l.validation) == null ? void 0 : b.min(a) : ((S = l == null ? void 0 : l.validation) == null ? void 0 : S.min) || `Minimum ${a} letters`), c && `${C}`.trim().length > c && (D = !1, T = typeof ((x = l == null ? void 0 : l.validation) == null ? void 0 : x.max) == "function" ? (W = l == null ? void 0 : l.validation) == null ? void 0 : W.max(c) : ((R = l == null ? void 0 : l.validation) == null ? void 0 : R.max) || `Maximum ${c} letters`), s && `${C}`.trim().length <= 0 && (D = !1, T = ((V = l == null ? void 0 : l.validation) == null ? void 0 : V.required) || "Required"), y({ touched: !0, valid: D, errorMsg: T }), h(i, C, D);
1853
1857
  },
1854
- [c, f, d, a, i, h, s, l == null ? void 0 : l.validation]
1858
+ [u, f, c, a, i, h, s, l == null ? void 0 : l.validation]
1855
1859
  );
1856
- return te(() => {
1857
- u && v(o);
1858
- }, [v, u, o]), /* @__PURE__ */ r(
1860
+ return K(() => {
1861
+ d && m(o);
1862
+ }, [m, d, o]), /* @__PURE__ */ r(
1859
1863
  fn,
1860
1864
  {
1861
1865
  variant: e,
1862
- label: t && /* @__PURE__ */ r(F, { variant: "body2", children: `${t} ${s ? "*" : ""}` }),
1866
+ label: t && /* @__PURE__ */ r($, { variant: "body2", children: `${t} ${s ? "*" : ""}` }),
1863
1867
  value: o,
1864
1868
  name: i,
1865
- onChange: (T) => v(T.target.value),
1869
+ onChange: (k) => m(k.target.value),
1866
1870
  disabled: _,
1867
- error: g.touched && !g.valid,
1868
- helperText: g.touched && !g.valid && g.errorMsg,
1869
- multiline: y,
1870
- rows: p,
1871
+ error: p.touched && !p.valid,
1872
+ helperText: p.touched && !p.valid && p.errorMsg,
1873
+ multiline: g,
1874
+ rows: w,
1871
1875
  style: { width: "100%" },
1872
1876
  InputProps: {
1873
1877
  placeholder: n || ""
@@ -1882,50 +1886,50 @@ const cr = (e) => {
1882
1886
  onChange: i,
1883
1887
  label: s,
1884
1888
  disabled: a,
1885
- touched: d,
1889
+ touched: c,
1886
1890
  variant: f = "outlined",
1887
- loading: c,
1891
+ loading: u,
1888
1892
  multiple: h,
1889
1893
  placeholder: _,
1890
- errMsg: y
1894
+ errMsg: g
1891
1895
  }) => {
1892
- var T, E;
1893
- const p = ne(), { translations: u } = O(), [g, b] = L({
1896
+ var k, C;
1897
+ const w = ee(), { translations: d } = O(), [p, y] = L({
1894
1898
  touched: !1,
1895
1899
  valid: !!t,
1896
- errorMsg: y || (o ? ((T = u == null ? void 0 : u.validation) == null ? void 0 : T.required) || "Required" : void 0)
1900
+ errorMsg: g || (o ? ((k = d == null ? void 0 : d.validation) == null ? void 0 : k.required) || "Required" : void 0)
1897
1901
  }), l = Z(() => {
1898
- g.touched || b((D) => ({ ...D, touched: !0, errorMsg: y || D.errorMsg }));
1899
- }, [y, g.touched]), v = Z(
1902
+ p.touched || y((D) => ({ ...D, touched: !0, errorMsg: g || D.errorMsg }));
1903
+ }, [g, p.touched]), m = Z(
1900
1904
  (D) => {
1901
- var m;
1902
- const k = D;
1903
- let S = !0, I = y;
1904
- o && (h ? !k.length : !k) && (S = !1, I = y || ((m = u == null ? void 0 : u.validation) == null ? void 0 : m.required) || "Required"), b((w) => ({ ...w, touched: !0, valid: S, errorMsg: I })), i(n, k, S);
1905
+ var v;
1906
+ const T = D;
1907
+ let M = !0, I = g;
1908
+ o && (h ? !T.length : !T) && (M = !1, I = g || ((v = d == null ? void 0 : d.validation) == null ? void 0 : v.required) || "Required"), y((b) => ({ ...b, touched: !0, valid: M, errorMsg: I })), i(n, T, M);
1905
1909
  },
1906
- [y, h, n, i, o, (E = u == null ? void 0 : u.validation) == null ? void 0 : E.required]
1910
+ [g, h, n, i, o, (C = d == null ? void 0 : d.validation) == null ? void 0 : C.required]
1907
1911
  );
1908
- return te(() => {
1909
- d && v(t);
1910
- }, [v, d, t]), /* @__PURE__ */ M(Y, { children: [
1911
- /* @__PURE__ */ M(
1912
+ return K(() => {
1913
+ c && m(t);
1914
+ }, [m, c, t]), /* @__PURE__ */ E(Y, { children: [
1915
+ /* @__PURE__ */ E(
1912
1916
  gn,
1913
1917
  {
1914
1918
  variant: f || "outlined",
1915
1919
  fullWidth: !0,
1916
- error: o && g.touched && !g.valid,
1920
+ error: o && p.touched && !p.valid,
1917
1921
  disabled: a,
1918
1922
  children: [
1919
- s && /* @__PURE__ */ r(pn, { id: `input_${n}`, children: /* @__PURE__ */ r(F, { variant: "body2", children: `${s} ${o ? "*" : ""}` }) }),
1920
- /* @__PURE__ */ M(
1923
+ s && /* @__PURE__ */ r(pn, { id: `input_${n}`, children: /* @__PURE__ */ r($, { variant: "body2", children: `${s} ${o ? "*" : ""}` }) }),
1924
+ /* @__PURE__ */ E(
1921
1925
  yn,
1922
1926
  {
1923
1927
  label: s,
1924
1928
  labelId: `input_${n}`,
1925
1929
  value: t,
1926
1930
  onBlur: l,
1927
- onChange: (D) => v(D.target.value),
1928
- IconComponent: c ? () => /* @__PURE__ */ r(Et, { size: 5 }) : Hn,
1931
+ onChange: (D) => m(D.target.value),
1932
+ IconComponent: u ? () => /* @__PURE__ */ r(St, { size: 5 }) : Hn,
1929
1933
  multiple: !!h,
1930
1934
  classes: {
1931
1935
  select: h === "chips" ? "flex__wrap" : void 0
@@ -1933,20 +1937,20 @@ const cr = (e) => {
1933
1937
  renderValue: (D) => {
1934
1938
  if (!D || D.length === 0)
1935
1939
  return /* @__PURE__ */ r("em", { children: s });
1936
- const k = [];
1940
+ const T = [];
1937
1941
  if (h) {
1938
- for (const S of e)
1939
- D.includes(S.value) && k.push([S.text]);
1940
- return h === "chips" ? k.map((S, I) => /* @__PURE__ */ r(vn, { label: S, style: { margin: "0 2px" }, color: "primary" }, `${S}_${I}`)) : k.join(",");
1942
+ for (const M of e)
1943
+ D.includes(M.value) && T.push([M.text]);
1944
+ return h === "chips" ? T.map((M, I) => /* @__PURE__ */ r(_n, { label: M, style: { margin: "0 2px" }, color: "primary" }, `${M}_${I}`)) : T.join(",");
1941
1945
  } else {
1942
- for (const S of e)
1943
- D === S.value && k.push([S.text]);
1944
- return k.join(",");
1946
+ for (const M of e)
1947
+ D === M.value && T.push([M.text]);
1948
+ return T.join(",");
1945
1949
  }
1946
1950
  },
1947
1951
  children: [
1948
- _ && /* @__PURE__ */ r(Le, { value: "", children: /* @__PURE__ */ r("em", { children: _ }) }),
1949
- e.map((D) => /* @__PURE__ */ M(Le, { value: D.value, children: [
1952
+ _ && /* @__PURE__ */ r(Ve, { value: "", children: /* @__PURE__ */ r("em", { children: _ }) }),
1953
+ e.map((D) => /* @__PURE__ */ E(Ve, { value: D.value, children: [
1950
1954
  h && /* @__PURE__ */ r(mn, { checked: t.indexOf(D.value) > -1, color: "primary" }),
1951
1955
  D.text
1952
1956
  ] }, D.id || D.value))
@@ -1956,13 +1960,13 @@ const cr = (e) => {
1956
1960
  ]
1957
1961
  }
1958
1962
  ),
1959
- /* @__PURE__ */ r(_n, { style: { color: p.palette.error.main }, children: g.touched && !g.valid && g.errorMsg })
1963
+ /* @__PURE__ */ r(vn, { style: { color: w.palette.error.main }, children: p.touched && !p.valid && p.errorMsg })
1960
1964
  ] });
1961
- }, ht = (e, t) => {
1965
+ }, ft = (e, t) => {
1962
1966
  var o;
1963
1967
  const n = {};
1964
1968
  for (const i of e) {
1965
- const s = Ve(i, i.default, t), a = Ve(i, t == null ? void 0 : t[i.name], t);
1969
+ const s = Ge(i, i.default, t), a = Ge(i, t == null ? void 0 : t[i.name], t);
1966
1970
  n[i.name] = {
1967
1971
  value: a.value || s.value || "",
1968
1972
  validity: (o = i.config) != null && o.required ? !!a.validity || !!s.validity : !0,
@@ -2011,74 +2015,74 @@ const cr = (e) => {
2011
2015
  selectedEvent: i,
2012
2016
  resourceFields: s,
2013
2017
  selectedResource: a,
2014
- triggerLoading: d,
2018
+ triggerLoading: c,
2015
2019
  onConfirm: f,
2016
- customEditor: c,
2020
+ customEditor: u,
2017
2021
  confirmEvent: h,
2018
2022
  dialogMaxWidth: _,
2019
- translations: y,
2020
- timeZone: p
2021
- } = O(), [u, g] = L(ht(e, i || o)), [b, l] = L(!1), v = ne(), T = Ct(v.breakpoints.down("sm")), E = (m, w, x) => {
2022
- g((C) => ({
2023
- ...C,
2024
- [m]: { ...C[m], value: w, validity: x }
2023
+ translations: g,
2024
+ timeZone: w
2025
+ } = O(), [d, p] = L(ft(e, i || o)), [y, l] = L(!1), m = ee(), k = Et(m.breakpoints.down("sm")), C = (v, b, S) => {
2026
+ p((x) => ({
2027
+ ...x,
2028
+ [v]: { ...x[v], value: b, validity: S }
2025
2029
  }));
2026
- }, D = (m) => {
2027
- m && g(ht(e)), n(!1);
2028
- }, k = async () => {
2029
- let m = {};
2030
- for (const w in u)
2031
- if (m[w] = u[w].value, !c && !u[w].validity)
2030
+ }, D = (v) => {
2031
+ v && p(ft(e)), n(!1);
2032
+ }, T = async () => {
2033
+ let v = {};
2034
+ for (const b in d)
2035
+ if (v[b] = d[b].value, !u && !d[b].validity)
2032
2036
  return l(!0);
2033
2037
  try {
2034
- d(!0), m.end = m.start >= m.end ? de(m.start, Fe(o == null ? void 0 : o.end, o == null ? void 0 : o.start)) : m.end;
2035
- const w = i != null && i.event_id ? "edit" : "create";
2036
- f ? m = await f(m, w) : m.event_id = (i == null ? void 0 : i.event_id) || Date.now().toString(36) + Math.random().toString(36).slice(2), m.start = Ge(m.start, p), m.end = Ge(m.end, p), h(m, w), D(!0);
2037
- } catch (w) {
2038
- console.error(w);
2038
+ c(!0), v.end = v.start >= v.end ? de(v.start, $e(o == null ? void 0 : o.end, o == null ? void 0 : o.start)) : v.end;
2039
+ const b = i != null && i.event_id ? "edit" : "create";
2040
+ f ? v = await f(v, b) : v.event_id = (i == null ? void 0 : i.event_id) || Date.now().toString(36) + Math.random().toString(36).slice(2), v.start = je(v.start, w), v.end = je(v.end, w), h(v, b), D(!0);
2041
+ } catch (b) {
2042
+ console.error(b);
2039
2043
  } finally {
2040
- d(!1);
2044
+ c(!1);
2041
2045
  }
2042
- }, S = (m) => {
2043
- var x, C, W;
2044
- const w = u[m];
2045
- switch (w.type) {
2046
+ }, M = (v) => {
2047
+ var S, x, W;
2048
+ const b = d[v];
2049
+ switch (b.type) {
2046
2050
  case "input":
2047
2051
  return /* @__PURE__ */ r(
2048
- _r,
2052
+ vr,
2049
2053
  {
2050
- value: w.value,
2051
- name: m,
2052
- onChange: E,
2053
- touched: b,
2054
- ...w.config,
2055
- label: y.event[m] || ((x = w.config) == null ? void 0 : x.label)
2054
+ value: b.value,
2055
+ name: v,
2056
+ onChange: C,
2057
+ touched: y,
2058
+ ...b.config,
2059
+ label: g.event[v] || ((S = b.config) == null ? void 0 : S.label)
2056
2060
  }
2057
2061
  );
2058
2062
  case "date":
2059
2063
  return /* @__PURE__ */ r(
2060
- vr,
2064
+ _r,
2061
2065
  {
2062
- value: w.value,
2063
- name: m,
2064
- onChange: (...z) => E(...z, !0),
2065
- touched: b,
2066
- ...w.config,
2067
- label: y.event[m] || ((C = w.config) == null ? void 0 : C.label)
2066
+ value: b.value,
2067
+ name: v,
2068
+ onChange: (...V) => C(...V, !0),
2069
+ touched: y,
2070
+ ...b.config,
2071
+ label: g.event[v] || ((x = b.config) == null ? void 0 : x.label)
2068
2072
  }
2069
2073
  );
2070
2074
  case "select":
2071
- const A = e.find((z) => z.name === m);
2075
+ const R = e.find((V) => V.name === v);
2072
2076
  return /* @__PURE__ */ r(
2073
2077
  br,
2074
2078
  {
2075
- value: w.value,
2076
- name: m,
2077
- options: (A == null ? void 0 : A.options) || [],
2078
- onChange: E,
2079
- touched: b,
2080
- ...w.config,
2081
- label: y.event[m] || ((W = w.config) == null ? void 0 : W.label)
2079
+ value: b.value,
2080
+ name: v,
2081
+ options: (R == null ? void 0 : R.options) || [],
2082
+ onChange: C,
2083
+ touched: y,
2084
+ ...b.config,
2085
+ label: g.event[v] || ((W = b.config) == null ? void 0 : W.label)
2082
2086
  }
2083
2087
  );
2084
2088
  default:
@@ -2089,33 +2093,33 @@ const cr = (e) => {
2089
2093
  bn,
2090
2094
  {
2091
2095
  open: t,
2092
- fullScreen: T,
2096
+ fullScreen: k,
2093
2097
  maxWidth: _,
2094
2098
  onClose: () => {
2095
2099
  n(!1);
2096
2100
  },
2097
2101
  children: (() => {
2098
- if (c) {
2099
- const m = {
2100
- state: u,
2102
+ if (u) {
2103
+ const v = {
2104
+ state: d,
2101
2105
  close: () => n(!1),
2102
- loading: (w) => d(w),
2106
+ loading: (b) => c(b),
2103
2107
  edited: i,
2104
2108
  onConfirm: h,
2105
2109
  [s.idField]: a
2106
2110
  };
2107
- return c(m);
2111
+ return u(v);
2108
2112
  }
2109
- return /* @__PURE__ */ M(ie, { children: [
2110
- /* @__PURE__ */ r(wn, { children: i ? y.form.editTitle : y.form.addTitle }),
2111
- /* @__PURE__ */ r(Dn, { style: { overflowX: "hidden" }, children: /* @__PURE__ */ r(at, { container: !0, spacing: 2, children: Object.keys(u).map((m) => {
2112
- var x;
2113
- const w = u[m];
2114
- return /* @__PURE__ */ r(at, { size: { sm: (x = w.config) == null ? void 0 : x.sm, xs: 12 }, children: S(m) }, m);
2113
+ return /* @__PURE__ */ E(ie, { children: [
2114
+ /* @__PURE__ */ r(wn, { children: i ? g.form.editTitle : g.form.addTitle }),
2115
+ /* @__PURE__ */ r(Dn, { style: { overflowX: "hidden" }, children: /* @__PURE__ */ r(st, { container: !0, spacing: 2, children: Object.keys(d).map((v) => {
2116
+ var S;
2117
+ const b = d[v];
2118
+ return /* @__PURE__ */ r(st, { size: { sm: (S = b.config) == null ? void 0 : S.sm, xs: 12 }, children: M(v) }, v);
2115
2119
  }) }) }),
2116
- /* @__PURE__ */ M(xn, { children: [
2117
- /* @__PURE__ */ r(ee, { color: "inherit", fullWidth: !0, onClick: () => D(), children: y.form.cancel }),
2118
- /* @__PURE__ */ r(ee, { color: "primary", fullWidth: !0, onClick: k, children: y.form.confirm })
2120
+ /* @__PURE__ */ E(xn, { children: [
2121
+ /* @__PURE__ */ r(J, { color: "inherit", fullWidth: !0, onClick: () => D(), children: g.form.cancel }),
2122
+ /* @__PURE__ */ r(J, { color: "primary", fullWidth: !0, onClick: T, children: g.form.confirm })
2119
2123
  ] })
2120
2124
  ] });
2121
2125
  })()
@@ -2128,29 +2132,29 @@ const cr = (e) => {
2128
2132
  locale: i,
2129
2133
  timeZone: s,
2130
2134
  selectedDate: a,
2131
- translations: d,
2135
+ translations: c,
2132
2136
  alwaysShowAgendaDays: f,
2133
- stickyNavigationOffset: c,
2137
+ stickyNavigationOffset: u,
2134
2138
  stickyNavigationHeight: h
2135
- } = O(), { disableGoToDay: _, headRenderer: y } = n, p = Jt(a), u = Array.from({ length: p }, (b, l) => l + 1), g = U(() => e.filter((b) => Dt(b.start, a)), [e, a]);
2136
- return !f && !g.length ? /* @__PURE__ */ r(Je, {}) : /* @__PURE__ */ r(Ae, { stickyOffset: c, stickyHeight: h, children: u.map((b) => {
2137
- const l = new Date(a.getFullYear(), a.getMonth(), b), v = he({ dateLeft: l, timeZone: s }), T = Ie(e, l);
2138
- return !f && !T.length ? null : /* @__PURE__ */ M("div", { className: `rs__agenda_row ${ve(l) ? "rs__today_cell" : ""}`, children: [
2139
- /* @__PURE__ */ r("div", { className: "rs__cell rs__agenda__cell", children: typeof y == "function" ? /* @__PURE__ */ r("div", { children: y({ day: l, events: e, resource: t }) }) : /* @__PURE__ */ r(
2140
- F,
2139
+ } = O(), { disableGoToDay: _, headRenderer: g } = n, w = Jt(a), d = Array.from({ length: w }, (y, l) => l + 1), p = U(() => e.filter((y) => xt(y.start, a)), [e, a]);
2140
+ return !f && !p.length ? /* @__PURE__ */ r(Ke, {}) : /* @__PURE__ */ r(He, { stickyOffset: u, stickyHeight: h, children: d.map((y) => {
2141
+ const l = new Date(a.getFullYear(), a.getMonth(), y), m = he({ dateLeft: l, timeZone: s }), k = Ne(e, l);
2142
+ return !f && !k.length ? null : /* @__PURE__ */ E("div", { className: `rs__agenda_row ${_e(l) ? "rs__today_cell" : ""}`, children: [
2143
+ /* @__PURE__ */ r("div", { className: "rs__cell rs__agenda__cell", children: typeof g == "function" ? /* @__PURE__ */ r("div", { children: g({ day: l, events: e, resource: t }) }) : /* @__PURE__ */ r(
2144
+ $,
2141
2145
  {
2142
- sx: { fontWeight: v ? "bold" : "inherit" },
2143
- color: v ? "primary" : "inherit",
2146
+ sx: { fontWeight: m ? "bold" : "inherit" },
2147
+ color: m ? "primary" : "inherit",
2144
2148
  variant: "body2",
2145
2149
  className: _ ? "" : "rs__hover__op",
2146
- onClick: (E) => {
2147
- E.stopPropagation(), _ || o(l);
2150
+ onClick: (C) => {
2151
+ C.stopPropagation(), _ || o(l);
2148
2152
  },
2149
2153
  children: N(l, "dd E", { locale: i })
2150
2154
  }
2151
2155
  ) }),
2152
- /* @__PURE__ */ r("div", { className: "rs__cell rs__agenda_items", children: T.length > 0 ? /* @__PURE__ */ r(Qe, { day: l, events: T }) : /* @__PURE__ */ r(F, { sx: { padding: 1 }, children: d.noDataToDisplay }) })
2153
- ] }, b);
2156
+ /* @__PURE__ */ r("div", { className: "rs__cell rs__agenda_items", children: k.length > 0 ? /* @__PURE__ */ r(Je, { day: l, events: k }) : /* @__PURE__ */ r($, { sx: { padding: 1 }, children: c.noDataToDisplay }) })
2157
+ ] }, y);
2154
2158
  }) });
2155
2159
  }, xr = ({
2156
2160
  events: e,
@@ -2160,73 +2164,73 @@ const cr = (e) => {
2160
2164
  eachFirstDayInCalcRow: i,
2161
2165
  daysList: s,
2162
2166
  onViewMore: a,
2163
- cellHeight: d
2167
+ cellHeight: c
2164
2168
  }) => {
2165
- const f = Math.round((d - ut) / pe - 1), { translations: c, month: h, locale: _, timeZone: y } = O(), { renderedSlots: p } = Bt(), u = U(() => {
2166
- var b;
2167
- const g = [];
2169
+ const f = Math.round((c - ht) / pe - 1), { translations: u, month: h, locale: _, timeZone: g } = O(), { renderedSlots: w } = Lt(), d = U(() => {
2170
+ var y;
2171
+ const p = [];
2168
2172
  for (let l = 0; l < Math.min(e.length, f + 1); l++) {
2169
- const v = Oe(e[l], y), T = !!i && me(v.start, i), E = T && i ? i : v.start;
2170
- let D = ae(E, v.end) + 1;
2171
- const k = Kt(v.end, E, {
2173
+ const m = Fe(e[l], g), k = !!i && me(m.start, i), C = k && i ? i : m.start;
2174
+ let D = se(C, m.end) + 1;
2175
+ const T = Kt(m.end, C, {
2172
2176
  weekStartsOn: h == null ? void 0 : h.weekStartOn,
2173
2177
  locale: _
2174
2178
  }) > 0;
2175
- if (k) {
2176
- const x = $e(v.start, {
2179
+ if (T) {
2180
+ const S = Re(m.start, {
2177
2181
  weekStartsOn: h == null ? void 0 : h.weekStartOn,
2178
2182
  locale: _
2179
- }), C = en(x, o);
2180
- C && (D = s.length - (i ? 0 : vt(v.start, C)));
2183
+ }), x = en(S, o);
2184
+ x && (D = s.length - (i ? 0 : vt(m.start, x)));
2181
2185
  }
2182
- const S = N(n, "yyyy-MM-dd"), I = (b = p == null ? void 0 : p[t || "all"]) == null ? void 0 : b[S], m = (I == null ? void 0 : I[v.event_id]) || 0, w = Math.min(m, f) * pe + ut;
2183
- if (m >= f) {
2184
- g.push(
2186
+ const M = N(n, "yyyy-MM-dd"), I = (y = w == null ? void 0 : w[t || "all"]) == null ? void 0 : y[M], v = (I == null ? void 0 : I[m.event_id]) || 0, b = Math.min(v, f) * pe + ht;
2187
+ if (v >= f) {
2188
+ p.push(
2185
2189
  /* @__PURE__ */ r(
2186
- F,
2190
+ $,
2187
2191
  {
2188
2192
  width: "100%",
2189
2193
  className: "rs__multi_day rs__hover__op",
2190
- style: { top: w, fontSize: 11 },
2191
- onClick: (x) => {
2192
- x.stopPropagation(), a(n);
2194
+ style: { top: b, fontSize: 11 },
2195
+ onClick: (S) => {
2196
+ S.stopPropagation(), a(n);
2193
2197
  },
2194
- children: `${Math.abs(e.length - l)} ${c.moreEvents}`
2198
+ children: `${Math.abs(e.length - l)} ${u.moreEvents}`
2195
2199
  },
2196
2200
  l
2197
2201
  )
2198
2202
  );
2199
2203
  break;
2200
2204
  }
2201
- g.push(
2205
+ p.push(
2202
2206
  /* @__PURE__ */ r(
2203
2207
  "div",
2204
2208
  {
2205
2209
  className: "rs__multi_day",
2206
2210
  style: {
2207
- top: w,
2211
+ top: b,
2208
2212
  width: `${100 * D}%`,
2209
2213
  height: lr
2210
2214
  },
2211
2215
  children: /* @__PURE__ */ r(
2212
- He,
2216
+ We,
2213
2217
  {
2214
- event: v,
2218
+ event: m,
2215
2219
  showdate: !1,
2216
- multiday: ae(v.start, v.end) > 0,
2217
- hasPrev: T,
2218
- hasNext: k
2220
+ multiday: se(m.start, m.end) > 0,
2221
+ hasPrev: k,
2222
+ hasNext: T
2219
2223
  }
2220
2224
  )
2221
2225
  },
2222
- `${v.event_id}_${l}`
2226
+ `${m.event_id}_${l}`
2223
2227
  )
2224
2228
  );
2225
2229
  }
2226
- return g;
2230
+ return p;
2227
2231
  }, [
2228
2232
  t,
2229
- p,
2233
+ w,
2230
2234
  e,
2231
2235
  f,
2232
2236
  i,
@@ -2235,72 +2239,72 @@ const cr = (e) => {
2235
2239
  n,
2236
2240
  o,
2237
2241
  s.length,
2238
- c.moreEvents,
2242
+ u.moreEvents,
2239
2243
  a,
2240
- y
2244
+ g
2241
2245
  ]);
2242
- return /* @__PURE__ */ r(ie, { children: u });
2246
+ return /* @__PURE__ */ r(ie, { children: d });
2243
2247
  }, kr = ({ daysList: e, resource: t, eachWeekStart: n }) => {
2244
2248
  const {
2245
2249
  height: o,
2246
2250
  month: i,
2247
2251
  selectedDate: s,
2248
2252
  events: a,
2249
- handleGotoDay: d,
2253
+ handleGotoDay: c,
2250
2254
  resourceFields: f,
2251
- fields: c,
2255
+ fields: u,
2252
2256
  locale: h,
2253
2257
  hourFormat: _,
2254
- stickyNavigation: y,
2255
- timeZone: p,
2256
- onClickMore: u,
2257
- stickyNavigationOffset: g,
2258
- stickyNavigationHeight: b
2259
- } = O(), { weekDays: l, startHour: v, endHour: T, cellRenderer: E, headRenderer: D, disableGoToDay: k } = i, { headersRef: S, bodyRef: I } = Wt(), m = ne(), w = Ze(s), x = De(_), C = o / n.length, W = Z(
2260
- (A) => {
2261
- let z = Re(a);
2262
- A && (z = Ce(a, A, f, c));
2263
- const J = [];
2264
- for (const re of n) {
2265
- const K = l.map((le) => {
2266
- const P = Q(re, le), fe = /* @__PURE__ */ new Date(`${N(ot(P, v), `yyyy/MM/dd ${x}`)}`), V = /* @__PURE__ */ new Date(`${N(ot(P, T), `yyyy/MM/dd ${x}`)}`), $ = f.idField, R = ye(re, P) ? P : null, G = z.flatMap((H) => It(H, P)).filter((H) => {
2267
- if (ye(H.start, P)) return !0;
2268
- const ce = { start: X(H.start), end: q(H.end) };
2269
- return !!(R && j(R, ce));
2270
- }), oe = he({ dateLeft: P, timeZone: p });
2271
- return /* @__PURE__ */ M("span", { style: { height: C }, className: "rs__cell", children: [
2258
+ stickyNavigation: g,
2259
+ timeZone: w,
2260
+ onClickMore: d,
2261
+ stickyNavigationOffset: p,
2262
+ stickyNavigationHeight: y
2263
+ } = O(), { weekDays: l, startHour: m, endHour: k, cellRenderer: C, headRenderer: D, disableGoToDay: T } = i, { headersRef: M, bodyRef: I } = Pt(), v = ee(), b = qe(s), S = De(_), x = o / n.length, W = Z(
2264
+ (R) => {
2265
+ let V = Ae(a);
2266
+ R && (V = Te(a, R, f, u));
2267
+ const te = [];
2268
+ for (const G of n) {
2269
+ const ae = l.map((ne) => {
2270
+ const P = Q(G, ne), fe = /* @__PURE__ */ new Date(`${N(it(P, m), `yyyy/MM/dd ${S}`)}`), ge = /* @__PURE__ */ new Date(`${N(it(P, k), `yyyy/MM/dd ${S}`)}`), F = f.idField, A = ye(G, P) ? P : null, H = V.flatMap((z) => Nt(z, P)).filter((z) => {
2271
+ if (ye(z.start, P)) return !0;
2272
+ const oe = { start: X(z.start), end: q(z.end) };
2273
+ return !!(A && j(A, oe));
2274
+ }), re = he({ dateLeft: P, timeZone: w });
2275
+ return /* @__PURE__ */ E("span", { style: { height: x }, className: "rs__cell", children: [
2272
2276
  /* @__PURE__ */ r(
2273
- Ke,
2277
+ et,
2274
2278
  {
2275
2279
  start: fe,
2276
- end: V,
2280
+ end: ge,
2277
2281
  day: s,
2278
- height: C,
2279
- resourceKey: $,
2280
- resourceVal: A ? A[$] : null,
2281
- cellRenderer: E
2282
+ height: x,
2283
+ resourceKey: F,
2284
+ resourceVal: R ? R[F] : null,
2285
+ cellRenderer: C
2282
2286
  }
2283
2287
  ),
2284
- /* @__PURE__ */ M(ie, { children: [
2285
- typeof D == "function" ? /* @__PURE__ */ r("div", { style: { position: "absolute", top: 0 }, children: D({ day: P, events: z, resource: A }) }) : /* @__PURE__ */ r(
2286
- qe,
2288
+ /* @__PURE__ */ E(ie, { children: [
2289
+ typeof D == "function" ? /* @__PURE__ */ r("div", { style: { position: "absolute", top: 0 }, children: D({ day: P, events: V, resource: R }) }) : /* @__PURE__ */ r(
2290
+ Xe,
2287
2291
  {
2288
2292
  style: {
2289
2293
  width: 27,
2290
2294
  height: 27,
2291
2295
  position: "absolute",
2292
2296
  top: 0,
2293
- background: oe ? m.palette.secondary.main : "transparent",
2294
- color: oe ? m.palette.secondary.contrastText : "",
2297
+ background: re ? v.palette.secondary.main : "transparent",
2298
+ color: re ? v.palette.secondary.contrastText : "",
2295
2299
  marginBottom: 2
2296
2300
  },
2297
2301
  children: /* @__PURE__ */ r(
2298
- F,
2302
+ $,
2299
2303
  {
2300
- color: Dt(P, w) ? "textPrimary" : "#ccc",
2301
- className: k ? "" : "rs__hover__op",
2302
- onClick: (H) => {
2303
- H.stopPropagation(), k || d(P);
2304
+ color: xt(P, b) ? "textPrimary" : "#ccc",
2305
+ className: T ? "" : "rs__hover__op",
2306
+ onClick: (z) => {
2307
+ z.stopPropagation(), T || c(P);
2304
2308
  },
2305
2309
  children: N(P, "dd")
2306
2310
  }
@@ -2310,68 +2314,68 @@ const cr = (e) => {
2310
2314
  /* @__PURE__ */ r(
2311
2315
  xr,
2312
2316
  {
2313
- events: G,
2314
- resourceId: A == null ? void 0 : A[$],
2317
+ events: H,
2318
+ resourceId: R == null ? void 0 : R[F],
2315
2319
  today: P,
2316
2320
  eachWeekStart: n,
2317
- eachFirstDayInCalcRow: R,
2321
+ eachFirstDayInCalcRow: A,
2318
2322
  daysList: e,
2319
- onViewMore: (H) => {
2320
- u && typeof u == "function" ? u(H, d) : d(H);
2323
+ onViewMore: (z) => {
2324
+ d && typeof d == "function" ? d(z, c) : c(z);
2321
2325
  },
2322
- cellHeight: C
2326
+ cellHeight: x
2323
2327
  }
2324
2328
  )
2325
2329
  ] })
2326
- ] }, le.toString());
2330
+ ] }, ne.toString());
2327
2331
  });
2328
- J.push(/* @__PURE__ */ r(ie, { children: K }, re.toString()));
2332
+ te.push(/* @__PURE__ */ r(ie, { children: ae }, G.toString()));
2329
2333
  }
2330
- return J;
2334
+ return te;
2331
2335
  },
2332
2336
  [
2337
+ x,
2333
2338
  C,
2334
- E,
2335
2339
  e,
2336
- k,
2337
- n,
2338
2340
  T,
2341
+ n,
2342
+ k,
2339
2343
  a,
2344
+ u,
2345
+ S,
2340
2346
  c,
2341
- x,
2342
- d,
2343
2347
  D,
2344
- w,
2345
- u,
2348
+ b,
2349
+ d,
2346
2350
  f,
2347
2351
  s,
2348
- v,
2349
- m.palette.secondary.contrastText,
2350
- m.palette.secondary.main,
2351
- p,
2352
+ m,
2353
+ v.palette.secondary.contrastText,
2354
+ v.palette.secondary.main,
2355
+ w,
2352
2356
  l
2353
2357
  ]
2354
2358
  );
2355
- return /* @__PURE__ */ M(Y, { children: [
2359
+ return /* @__PURE__ */ E(Y, { children: [
2356
2360
  /* @__PURE__ */ r(
2357
2361
  be,
2358
2362
  {
2359
2363
  days: e.length,
2360
- ref: S,
2364
+ ref: M,
2361
2365
  indent: "0",
2362
2366
  sticky: "1",
2363
- stickyNavigation: y,
2364
- stickyOffset: g,
2365
- stickyHeight: b,
2366
- children: e.map((A, z) => /* @__PURE__ */ r(
2367
- F,
2367
+ stickyNavigation: g,
2368
+ stickyOffset: p,
2369
+ stickyHeight: y,
2370
+ children: e.map((R, V) => /* @__PURE__ */ r(
2371
+ $,
2368
2372
  {
2369
2373
  className: "rs__cell rs__header rs__header__center",
2370
2374
  align: "center",
2371
2375
  variant: "body2",
2372
- children: N(A, "EE", { locale: h })
2376
+ children: N(R, "EE", { locale: h })
2373
2377
  },
2374
- z
2378
+ V
2375
2379
  ))
2376
2380
  }
2377
2381
  ),
@@ -2386,44 +2390,44 @@ const cr = (e) => {
2386
2390
  triggerLoading: i,
2387
2391
  handleState: s,
2388
2392
  resources: a,
2389
- resourceFields: d,
2393
+ resourceFields: c,
2390
2394
  fields: f,
2391
- agenda: c
2392
- } = O(), { weekStartOn: h, weekDays: _ } = e, y = Ze(t), p = bt(t), u = tn(
2395
+ agenda: u
2396
+ } = O(), { weekStartOn: h, weekDays: _ } = e, g = qe(t), w = wt(t), d = tn(
2393
2397
  {
2394
- start: y,
2395
- end: p
2398
+ start: g,
2399
+ end: w
2396
2400
  },
2397
2401
  { weekStartsOn: h }
2398
- ), g = _.map((v) => Q(u[0], v)), b = Z(async () => {
2402
+ ), p = _.map((m) => Q(d[0], m)), y = Z(async () => {
2399
2403
  try {
2400
2404
  i(!0);
2401
- const v = u[0], T = Q(u[u.length - 1], g.length), E = await o({
2402
- start: v,
2403
- end: T,
2405
+ const m = d[0], k = Q(d[d.length - 1], p.length), C = await o({
2406
+ start: m,
2407
+ end: k,
2404
2408
  view: "month"
2405
2409
  });
2406
- E && (E != null && E.length) && s(E, "events");
2407
- } catch (v) {
2408
- throw v;
2410
+ C && (C != null && C.length) && s(C, "events");
2411
+ } catch (m) {
2412
+ throw m;
2409
2413
  } finally {
2410
2414
  i(!1);
2411
2415
  }
2412
- }, [g.length, o]);
2413
- te(() => {
2414
- o instanceof Function && b();
2415
- }, [b, o]);
2416
+ }, [p.length, o]);
2417
+ K(() => {
2418
+ o instanceof Function && y();
2419
+ }, [y, o]);
2416
2420
  const l = Z(
2417
- (v) => {
2418
- if (c) {
2419
- let T = Re(n);
2420
- return v && (T = Ce(n, v, d, f)), /* @__PURE__ */ r(Dr, { resource: v, events: T });
2421
+ (m) => {
2422
+ if (u) {
2423
+ let k = Ae(n);
2424
+ return m && (k = Te(n, m, c, f)), /* @__PURE__ */ r(Dr, { resource: m, events: k });
2421
2425
  }
2422
- return /* @__PURE__ */ r(kr, { daysList: g, eachWeekStart: u, resource: v });
2426
+ return /* @__PURE__ */ r(kr, { daysList: p, eachWeekStart: d, resource: m });
2423
2427
  },
2424
- [c, g, u, n, f, d]
2428
+ [u, p, d, n, f, c]
2425
2429
  );
2426
- return a.length ? /* @__PURE__ */ r(Ye, { renderChildren: l }) : l();
2430
+ return a.length ? /* @__PURE__ */ r(Qe, { renderChildren: l }) : l();
2427
2431
  }, Cr = ({ events: e, resource: t }) => {
2428
2432
  const {
2429
2433
  day: n,
@@ -2431,12 +2435,12 @@ const cr = (e) => {
2431
2435
  selectedDate: i,
2432
2436
  translations: s,
2433
2437
  alwaysShowAgendaDays: a,
2434
- stickyNavigationOffset: d,
2438
+ stickyNavigationOffset: c,
2435
2439
  stickyNavigationHeight: f
2436
- } = O(), { headRenderer: c } = n, h = U(() => Ie(e, i), [e, i]);
2437
- return !a && !h.length ? /* @__PURE__ */ r(Je, {}) : /* @__PURE__ */ r(Ae, { stickyOffset: d, stickyHeight: f, children: /* @__PURE__ */ M("div", { className: "rs__agenda_row rs__today_cell", children: [
2438
- /* @__PURE__ */ r("div", { className: "rs__cell rs__agenda__cell", children: typeof c == "function" ? /* @__PURE__ */ r("div", { children: c({ day: i, events: e, resource: t }) }) : /* @__PURE__ */ r(F, { variant: "body2", children: N(i, "dd E", { locale: o }) }) }),
2439
- /* @__PURE__ */ r("div", { className: "rs__cell rs__agenda_items", children: h.length > 0 ? /* @__PURE__ */ r(Qe, { day: i, events: h }) : /* @__PURE__ */ r(F, { sx: { padding: 1 }, children: s.noDataToDisplay }) })
2440
+ } = O(), { headRenderer: u } = n, h = U(() => Ne(e, i), [e, i]);
2441
+ return !a && !h.length ? /* @__PURE__ */ r(Ke, {}) : /* @__PURE__ */ r(He, { stickyOffset: c, stickyHeight: f, children: /* @__PURE__ */ E("div", { className: "rs__agenda_row rs__today_cell", children: [
2442
+ /* @__PURE__ */ r("div", { className: "rs__cell rs__agenda__cell", children: typeof u == "function" ? /* @__PURE__ */ r("div", { children: u({ day: i, events: e, resource: t }) }) : /* @__PURE__ */ r($, { variant: "body2", children: N(i, "dd E", { locale: o }) }) }),
2443
+ /* @__PURE__ */ r("div", { className: "rs__cell rs__agenda_items", children: h.length > 0 ? /* @__PURE__ */ r(Je, { day: i, events: h }) : /* @__PURE__ */ r($, { sx: { padding: 1 }, children: s.noDataToDisplay }) })
2440
2444
  ] }) });
2441
2445
  }, Er = () => {
2442
2446
  const {
@@ -2447,226 +2451,227 @@ const cr = (e) => {
2447
2451
  getRemoteEvents: i,
2448
2452
  triggerLoading: s,
2449
2453
  handleState: a,
2450
- resources: d,
2454
+ resources: c,
2451
2455
  resourceFields: f,
2452
- resourceViewMode: c,
2456
+ resourceViewMode: u,
2453
2457
  fields: h,
2454
2458
  direction: _,
2455
- locale: y,
2456
- hourFormat: p,
2457
- timeZone: u,
2458
- stickyNavigation: g,
2459
- agenda: b,
2459
+ locale: g,
2460
+ hourFormat: w,
2461
+ timeZone: d,
2462
+ stickyNavigation: p,
2463
+ agenda: y,
2460
2464
  stickyNavigationOffset: l,
2461
- stickyNavigationHeight: v,
2462
- currentTime: T,
2463
- showCurrentTimeBar: E,
2465
+ stickyNavigationHeight: m,
2466
+ currentTime: k,
2467
+ showCurrentTimeBar: C,
2464
2468
  currentTimeBarColor: D,
2465
- forceInlineMultiDay: k
2466
- } = O(), { startHour: S, endHour: I, step: m, cellRenderer: w, headRenderer: x, hourRenderer: C } = e, W = ke(t, { hours: S, minutes: 0, seconds: 0 }), A = ke(t, { hours: I, minutes: -m, seconds: 0 }), z = _t(
2469
+ forceInlineMultiDay: T,
2470
+ _refetchToken: M
2471
+ } = O(), { startHour: I, endHour: v, step: b, cellRenderer: S, headRenderer: x, hourRenderer: W } = e, R = xe(t, { hours: I, minutes: 0, seconds: 0 }), V = xe(t, { hours: v, minutes: -b, seconds: 0 }), te = bt(
2467
2472
  {
2468
- start: W,
2469
- end: A
2473
+ start: R,
2474
+ end: V
2470
2475
  },
2471
- { step: m }
2472
- ), J = Mt(o, z.length), re = St(J, m), K = De(p), le = Z(async () => {
2476
+ { step: b }
2477
+ ), G = It(o, te.length), ae = Mt(G, b), ne = De(w), P = Z(async () => {
2473
2478
  try {
2474
2479
  s(!0);
2475
- const V = Q(W, -1), $ = Q(A, 1), R = await i({
2476
- start: V,
2477
- end: $,
2480
+ const F = Q(R, -1), A = Q(V, 1), H = await i({
2481
+ start: F,
2482
+ end: A,
2478
2483
  view: "day"
2479
2484
  });
2480
- R && (R != null && R.length) && a(R, "events");
2481
- } catch (V) {
2482
- throw V;
2485
+ H && (H != null && H.length) && a(H, "events");
2486
+ } catch (F) {
2487
+ throw F;
2483
2488
  } finally {
2484
2489
  s(!1);
2485
2490
  }
2486
- }, [i]);
2487
- te(() => {
2488
- i instanceof Function && le();
2489
- }, [le, i]);
2490
- const P = Z(
2491
- (V) => {
2492
- const $ = Ne(
2493
- V,
2491
+ }, [i, M]);
2492
+ K(() => {
2493
+ i instanceof Function && P();
2494
+ }, [P, i, M]);
2495
+ const fe = Z(
2496
+ (F) => {
2497
+ const A = Oe(
2498
+ F,
2494
2499
  t,
2495
- u,
2500
+ d,
2496
2501
  void 0,
2497
- k
2502
+ T
2498
2503
  );
2499
2504
  return /* @__PURE__ */ r(
2500
2505
  "div",
2501
2506
  {
2502
2507
  className: "rs__block_col",
2503
- style: { height: pe * $.length },
2504
- children: $.map((R, G) => {
2505
- const oe = me(R.start, X(t)), H = Se(R.end, q(t));
2508
+ style: { height: pe * A.length },
2509
+ children: A.map((H, re) => {
2510
+ const z = me(H.start, X(t)), oe = Me(H.end, q(t));
2506
2511
  return /* @__PURE__ */ r(
2507
2512
  "div",
2508
2513
  {
2509
2514
  className: "rs__multi_day",
2510
2515
  style: {
2511
- top: G * pe,
2516
+ top: re * pe,
2512
2517
  width: "99.9%",
2513
2518
  overflowX: "hidden"
2514
2519
  },
2515
- children: /* @__PURE__ */ r(He, { event: R, multiday: !0, hasPrev: oe, hasNext: H })
2520
+ children: /* @__PURE__ */ r(We, { event: H, multiday: !0, hasPrev: z, hasNext: oe })
2516
2521
  },
2517
- R.event_id
2522
+ H.event_id
2518
2523
  );
2519
2524
  })
2520
2525
  }
2521
2526
  );
2522
2527
  },
2523
- [t, u]
2524
- ), fe = Z(
2525
- (V) => {
2526
- let $ = n;
2527
- if (V && ($ = Ce(n, V, f, h)), b)
2528
- return /* @__PURE__ */ r(Cr, { resource: V, events: $ });
2529
- const R = d.length && c === "default", G = Ne(
2530
- R ? n : $,
2528
+ [t, d]
2529
+ ), ge = Z(
2530
+ (F) => {
2531
+ let A = n;
2532
+ if (F && (A = Te(n, F, f, h)), y)
2533
+ return /* @__PURE__ */ r(Cr, { resource: F, events: A });
2534
+ const H = c.length && u === "default", re = Oe(
2535
+ H ? n : A,
2531
2536
  t,
2532
- u,
2537
+ d,
2533
2538
  void 0,
2534
- k
2535
- ), oe = pe * G.length + 45;
2536
- return /* @__PURE__ */ M(Y, { children: [
2537
- /* @__PURE__ */ M(
2539
+ T
2540
+ ), z = pe * re.length + 45;
2541
+ return /* @__PURE__ */ E(Y, { children: [
2542
+ /* @__PURE__ */ E(
2538
2543
  be,
2539
2544
  {
2540
2545
  days: 1,
2541
2546
  sticky: "1",
2542
- stickyNavigation: g,
2547
+ stickyNavigation: p,
2543
2548
  stickyOffset: l,
2544
- stickyHeight: v,
2549
+ stickyHeight: m,
2545
2550
  children: [
2546
2551
  /* @__PURE__ */ r("span", { className: "rs__cell" }),
2547
- /* @__PURE__ */ M(
2552
+ /* @__PURE__ */ E(
2548
2553
  "span",
2549
2554
  {
2550
- className: `rs__cell rs__header ${ve(t) ? "rs__today_cell" : ""}`,
2551
- style: { height: oe },
2555
+ className: `rs__cell rs__header ${_e(t) ? "rs__today_cell" : ""}`,
2556
+ style: { height: z },
2552
2557
  children: [
2553
- typeof x == "function" ? /* @__PURE__ */ r("div", { children: x({ day: t, events: $, resource: V }) }) : /* @__PURE__ */ r(Pt, { date: t, locale: y }),
2554
- P($)
2558
+ typeof x == "function" ? /* @__PURE__ */ r("div", { children: x({ day: t, events: A, resource: F }) }) : /* @__PURE__ */ r(zt, { date: t, locale: g }),
2559
+ fe(A)
2555
2560
  ]
2556
2561
  }
2557
2562
  )
2558
2563
  ]
2559
2564
  }
2560
2565
  ),
2561
- /* @__PURE__ */ r(be, { days: 1, children: z.map((H, ce) => {
2562
- const B = /* @__PURE__ */ new Date(`${N(t, "yyyy/MM/dd")} ${N(H, K)}`), ge = de(B, m), xe = f.idField;
2563
- return /* @__PURE__ */ M(ie, { children: [
2564
- /* @__PURE__ */ r("span", { className: "rs__cell rs__header rs__time", style: { height: J }, children: typeof C == "function" ? /* @__PURE__ */ r("div", { children: C(N(H, K, { locale: y })) }) : /* @__PURE__ */ r(F, { variant: "caption", children: N(H, K, { locale: y }) }) }),
2565
- /* @__PURE__ */ M("span", { className: `rs__cell ${ve(t) ? "rs__today_cell" : ""}`, children: [
2566
- ce === 0 && /* @__PURE__ */ r(
2567
- Lt,
2566
+ /* @__PURE__ */ r(be, { days: 1, children: te.map((oe, B) => {
2567
+ const ce = /* @__PURE__ */ new Date(`${N(t, "yyyy/MM/dd")} ${N(oe, ne)}`), Ce = de(ce, b), Ee = f.idField;
2568
+ return /* @__PURE__ */ E(ie, { children: [
2569
+ /* @__PURE__ */ r("span", { className: "rs__cell rs__header rs__time", style: { height: G }, children: typeof W == "function" ? /* @__PURE__ */ r("div", { children: W(N(oe, ne, { locale: g })) }) : /* @__PURE__ */ r($, { variant: "caption", children: N(oe, ne, { locale: g }) }) }),
2570
+ /* @__PURE__ */ E("span", { className: `rs__cell ${_e(t) ? "rs__today_cell" : ""}`, children: [
2571
+ B === 0 && /* @__PURE__ */ r(
2572
+ Vt,
2568
2573
  {
2569
- todayEvents: Nt(
2570
- $,
2574
+ todayEvents: Ot(
2575
+ A,
2571
2576
  t,
2572
- u,
2573
- k
2577
+ d,
2578
+ T
2574
2579
  ),
2575
- today: W,
2576
- minuteHeight: re,
2577
- startHour: S,
2578
- endHour: I,
2579
- step: m,
2580
+ today: R,
2581
+ minuteHeight: ae,
2582
+ startHour: I,
2583
+ endHour: v,
2584
+ step: b,
2580
2585
  direction: _,
2581
- timeZone: u,
2582
- currentTime: T,
2583
- showCurrentTimeBar: E,
2586
+ timeZone: d,
2587
+ currentTime: k,
2588
+ showCurrentTimeBar: C,
2584
2589
  currentTimeBarColor: D
2585
2590
  }
2586
2591
  ),
2587
2592
  /* @__PURE__ */ r(
2588
- Ke,
2593
+ et,
2589
2594
  {
2590
- start: B,
2591
- end: ge,
2595
+ start: ce,
2596
+ end: Ce,
2592
2597
  day: t,
2593
- height: J,
2594
- resourceKey: xe,
2595
- resourceVal: V ? V[xe] : null,
2596
- cellRenderer: w
2598
+ height: G,
2599
+ resourceKey: Ee,
2600
+ resourceVal: F ? F[Ee] : null,
2601
+ cellRenderer: S
2597
2602
  }
2598
2603
  )
2599
2604
  ] })
2600
- ] }, ce);
2605
+ ] }, B);
2601
2606
  }) })
2602
2607
  ] });
2603
2608
  },
2604
2609
  [
2605
- J,
2606
- re,
2607
- W,
2608
- b,
2609
- w,
2610
+ G,
2611
+ ae,
2612
+ R,
2613
+ y,
2614
+ S,
2610
2615
  _,
2611
- I,
2616
+ v,
2612
2617
  n,
2613
2618
  h,
2614
- K,
2619
+ ne,
2615
2620
  x,
2616
- C,
2617
- z,
2618
- y,
2619
- P,
2620
- f,
2621
- c,
2622
- d.length,
2623
- t,
2624
- S,
2625
- m,
2621
+ W,
2622
+ te,
2626
2623
  g,
2624
+ fe,
2625
+ f,
2627
2626
  u,
2628
- T,
2629
- E,
2627
+ c.length,
2628
+ t,
2629
+ I,
2630
+ b,
2631
+ p,
2632
+ d,
2633
+ k,
2634
+ C,
2630
2635
  D
2631
2636
  ]
2632
2637
  );
2633
- return d.length ? /* @__PURE__ */ r(Ye, { renderChildren: fe }) : fe();
2634
- }, ft = (e) => {
2638
+ return c.length ? /* @__PURE__ */ r(Qe, { renderChildren: ge }) : ge();
2639
+ }, gt = (e) => {
2635
2640
  const t = {};
2636
2641
  let n = 0;
2637
2642
  for (let o = 0; o < e.length; o++) {
2638
2643
  const i = e[o], s = nn({ start: i.start, end: i.end });
2639
2644
  for (let a = 0; a < s.length; a++) {
2640
- const d = N(s[a], "yyyy-MM-dd");
2641
- if (t[d]) {
2642
- const f = Object.values(t[d]);
2645
+ const c = N(s[a], "yyyy-MM-dd");
2646
+ if (t[c]) {
2647
+ const f = Object.values(t[c]);
2643
2648
  for (; f.includes(n); )
2644
2649
  n += 1;
2645
- t[d][i.event_id] = n;
2650
+ t[c][i.event_id] = n;
2646
2651
  } else
2647
- t[d] = { [i.event_id]: n };
2652
+ t[c] = { [i.event_id]: n };
2648
2653
  }
2649
2654
  n = 0;
2650
2655
  }
2651
2656
  return t;
2652
- }, gt = (e, t, n, o, i) => {
2653
- const s = i === "month" ? Ot(e) : Re(e), a = {};
2657
+ }, pt = (e, t, n, o, i) => {
2658
+ const s = i === "month" ? Ft(e) : Ae(e), a = {};
2654
2659
  if (t.length)
2655
- for (const d of t) {
2656
- const f = Ce(s, d, n, o), c = ft(f);
2657
- a[d[n.idField]] = c;
2660
+ for (const c of t) {
2661
+ const f = Te(s, c, n, o), u = gt(f);
2662
+ a[c[n.idField]] = u;
2658
2663
  }
2659
2664
  else
2660
- a.all = ft(s);
2665
+ a.all = gt(s);
2661
2666
  return a;
2662
2667
  }, Sr = ({ children: e }) => {
2663
- const { events: t, resources: n, resourceFields: o, fields: i, view: s } = O(), [a, d] = L({
2664
- renderedSlots: gt(t, n, o, i, s)
2668
+ const { events: t, resources: n, resourceFields: o, fields: i, view: s } = O(), [a, c] = L({
2669
+ renderedSlots: pt(t, n, o, i, s)
2665
2670
  });
2666
- te(() => {
2667
- d((c) => ({
2668
- ...c,
2669
- renderedSlots: gt(
2671
+ K(() => {
2672
+ c((u) => ({
2673
+ ...u,
2674
+ renderedSlots: pt(
2670
2675
  t,
2671
2676
  n,
2672
2677
  o,
@@ -2675,17 +2680,17 @@ const cr = (e) => {
2675
2680
  )
2676
2681
  }));
2677
2682
  }, [t, i, o, n, s]);
2678
- const f = (c, h, _, y) => {
2679
- d((p) => {
2680
- var u, g, b, l, v;
2683
+ const f = (u, h, _, g) => {
2684
+ c((w) => {
2685
+ var d, p, y, l, m;
2681
2686
  return {
2682
- ...p,
2687
+ ...w,
2683
2688
  renderedSlots: {
2684
- ...p.renderedSlots,
2685
- [y || "all"]: {
2686
- ...(u = p.renderedSlots) == null ? void 0 : u[y || "all"],
2687
- [c]: (b = (g = p.renderedSlots) == null ? void 0 : g[y || "all"]) != null && b[c] ? {
2688
- ...(v = (l = p.renderedSlots) == null ? void 0 : l[y || "all"]) == null ? void 0 : v[c],
2689
+ ...w.renderedSlots,
2690
+ [g || "all"]: {
2691
+ ...(d = w.renderedSlots) == null ? void 0 : d[g || "all"],
2692
+ [u]: (y = (p = w.renderedSlots) == null ? void 0 : p[g || "all"]) != null && y[u] ? {
2693
+ ...(m = (l = w.renderedSlots) == null ? void 0 : l[g || "all"]) == null ? void 0 : m[u],
2689
2694
  [h]: _
2690
2695
  } : { [h]: _ }
2691
2696
  }
@@ -2694,7 +2699,7 @@ const cr = (e) => {
2694
2699
  });
2695
2700
  };
2696
2701
  return /* @__PURE__ */ r(
2697
- zt.Provider,
2702
+ Bt.Provider,
2698
2703
  {
2699
2704
  value: {
2700
2705
  ...a,
@@ -2703,8 +2708,8 @@ const cr = (e) => {
2703
2708
  children: e
2704
2709
  }
2705
2710
  );
2706
- }, Mr = mt(function(t, n) {
2707
- const o = O(), { view: i, dialog: s, loading: a, loadingComponent: d, resourceViewMode: f, resources: c, translations: h } = o, _ = U(() => {
2711
+ }, Mr = _t(function(t, n) {
2712
+ const o = O(), { view: i, dialog: s, loading: a, loadingComponent: c, resourceViewMode: f, resources: u, translations: h } = o, _ = U(() => {
2708
2713
  switch (i) {
2709
2714
  case "month":
2710
2715
  return /* @__PURE__ */ r(Tr, {});
@@ -2715,31 +2720,31 @@ const cr = (e) => {
2715
2720
  default:
2716
2721
  return "";
2717
2722
  }
2718
- }, [i]), y = U(() => /* @__PURE__ */ r("div", { className: "rs__table_loading", children: d || /* @__PURE__ */ r("div", { className: "rs__table_loading_internal", children: /* @__PURE__ */ M("span", { children: [
2719
- /* @__PURE__ */ r(Et, { size: 50 }),
2720
- /* @__PURE__ */ r(F, { align: "center", children: h.loading })
2721
- ] }) }) }), [d, h.loading]);
2722
- return /* @__PURE__ */ M(
2723
+ }, [i]), g = U(() => /* @__PURE__ */ r("div", { className: "rs__table_loading", children: c || /* @__PURE__ */ r("div", { className: "rs__table_loading_internal", children: /* @__PURE__ */ E("span", { children: [
2724
+ /* @__PURE__ */ r(St, { size: 50 }),
2725
+ /* @__PURE__ */ r($, { align: "center", children: h.loading })
2726
+ ] }) }) }), [c, h.loading]);
2727
+ return /* @__PURE__ */ E(
2723
2728
  er,
2724
2729
  {
2725
2730
  dialog: s ? 1 : 0,
2726
2731
  "data-testid": "rs-wrapper",
2727
- ref: (p) => {
2728
- const u = n;
2729
- u && (u.current = {
2730
- el: p,
2732
+ ref: (w) => {
2733
+ const d = n;
2734
+ d && (d.current = {
2735
+ el: w,
2731
2736
  scheduler: o
2732
2737
  });
2733
2738
  },
2734
2739
  children: [
2735
- a ? y : null,
2740
+ a ? g : null,
2736
2741
  /* @__PURE__ */ r(mr, {}),
2737
2742
  /* @__PURE__ */ r(
2738
2743
  tr,
2739
2744
  {
2740
- resource_count: f === "default" ? c.length : 1,
2745
+ resource_count: f === "default" ? u.length : 1,
2741
2746
  sx: {
2742
- overflowX: f === "default" && c.length > 1 ? "auto" : void 0,
2747
+ overflowX: f === "default" && u.length > 1 ? "auto" : void 0,
2743
2748
  flexDirection: f === "vertical" ? "column" : void 0
2744
2749
  },
2745
2750
  "data-testid": "grid",
@@ -2751,10 +2756,10 @@ const cr = (e) => {
2751
2756
  }
2752
2757
  );
2753
2758
  }), Ir = ({ children: e, initial: t }) => {
2754
- const [n, o] = L({ ...$t, ...Ft(t) });
2755
- te(() => {
2756
- o((p) => ({
2757
- ...p,
2759
+ const [n, o] = L({ ...Rt, ...$t(t) });
2760
+ K(() => {
2761
+ o((d) => ({
2762
+ ...d,
2758
2763
  onEventDrop: t.onEventDrop,
2759
2764
  customEditor: t.customEditor,
2760
2765
  customHeaderContent: t.customHeaderContent,
@@ -2768,99 +2773,102 @@ const cr = (e) => {
2768
2773
  t.events,
2769
2774
  t.customHeaderContent,
2770
2775
  t.getRemoteEvents
2771
- ]), te(() => {
2772
- typeof t.loading < "u" && o((p) => ({ ...p, loading: t.loading }));
2776
+ ]), K(() => {
2777
+ typeof t.loading < "u" && o((d) => ({ ...d, loading: t.loading }));
2773
2778
  }, [t.loading]);
2774
- const i = (p, u) => {
2775
- o((g) => ({ ...g, [u]: p }));
2779
+ const i = (d, p) => {
2780
+ o((y) => ({ ...y, [p]: d }));
2776
2781
  }, s = () => Pn(n), a = () => {
2777
- o((p) => {
2778
- const u = !p.agenda;
2779
- return n.onViewChange && typeof n.onViewChange == "function" && n.onViewChange(n.view, u), { ...p, agenda: u };
2782
+ o((d) => {
2783
+ const p = !d.agenda;
2784
+ return n.onViewChange && typeof n.onViewChange == "function" && n.onViewChange(n.view, p), { ...d, agenda: p };
2780
2785
  });
2781
- }, d = (p, u) => {
2782
- const g = u;
2783
- o((b) => {
2784
- var l;
2786
+ }, c = (d, p) => {
2787
+ const y = p;
2788
+ o((l) => {
2789
+ var m;
2785
2790
  return {
2786
- ...b,
2787
- dialog: p,
2788
- selectedRange: g != null && g.event_id ? void 0 : g || {
2791
+ ...l,
2792
+ dialog: d,
2793
+ selectedRange: y != null && y.event_id ? void 0 : y || {
2789
2794
  start: /* @__PURE__ */ new Date(),
2790
2795
  end: new Date(Date.now() + 3600 * 1e3)
2791
2796
  },
2792
- selectedEvent: g != null && g.event_id ? g : void 0,
2793
- selectedResource: g == null ? void 0 : g[(l = n.resourceFields) == null ? void 0 : l.idField]
2797
+ selectedEvent: y != null && y.event_id ? y : void 0,
2798
+ selectedResource: y == null ? void 0 : y[(m = n.resourceFields) == null ? void 0 : m.idField]
2794
2799
  };
2795
2800
  });
2796
- }, f = (p) => {
2797
- typeof t.loading > "u" && o((u) => ({ ...u, loading: p }));
2798
- }, c = (p) => {
2799
- const u = s();
2800
- let g;
2801
- u.includes("day") ? (g = "day", o((b) => ({ ...b, view: "day", selectedDate: p }))) : u.includes("week") ? (g = "week", o((b) => ({ ...b, view: "week", selectedDate: p }))) : console.warn("No Day/Week views available"), g && n.onViewChange && typeof n.onViewChange == "function" && n.onViewChange(g, n.agenda), g && n.onSelectedDateChange && typeof n.onSelectedDateChange == "function" && n.onSelectedDateChange(p);
2802
- }, h = (p, u) => {
2803
- let g;
2804
- u === "edit" ? Array.isArray(p) ? g = n.events.map((b) => {
2805
- const l = p.find((v) => v.event_id === b.event_id);
2806
- return l ? { ...b, ...l } : b;
2807
- }) : g = n.events.map(
2808
- (b) => b.event_id === p.event_id ? { ...b, ...p } : b
2809
- ) : g = n.events.concat(p), o((b) => ({ ...b, events: g }));
2810
- }, _ = (p) => {
2811
- o((u) => ({ ...u, currentDragged: p }));
2812
- }, y = async (p, u, g, b, l) => {
2813
- var I;
2814
- const v = n.events.find((m) => typeof m.event_id == "number" ? m.event_id === +u : m.event_id === u), T = n.fields.find((m) => m.name === b), E = !!((I = T == null ? void 0 : T.config) != null && I.multiple);
2815
- let D = l;
2816
- if (T) {
2817
- const m = v[b], w = Ve(T, m, v).value;
2818
- if (E)
2819
- if (w.includes(l)) {
2820
- if (it(v.start, g))
2801
+ }, f = (d) => {
2802
+ typeof t.loading > "u" && o((p) => ({ ...p, loading: d }));
2803
+ }, u = (d) => {
2804
+ const p = s();
2805
+ let y;
2806
+ p.includes("day") ? (y = "day", o((l) => ({ ...l, view: "day", selectedDate: d }))) : p.includes("week") ? (y = "week", o((l) => ({ ...l, view: "week", selectedDate: d }))) : console.warn("No Day/Week views available"), y && n.onViewChange && typeof n.onViewChange == "function" && n.onViewChange(y, n.agenda), y && n.onSelectedDateChange && typeof n.onSelectedDateChange == "function" && n.onSelectedDateChange(d);
2807
+ }, h = (d, p) => {
2808
+ let y;
2809
+ p === "edit" ? Array.isArray(d) ? y = n.events.map((l) => {
2810
+ const m = d.find((k) => k.event_id === l.event_id);
2811
+ return m ? { ...l, ...m } : l;
2812
+ }) : y = n.events.map(
2813
+ (l) => l.event_id === d.event_id ? { ...l, ...d } : l
2814
+ ) : y = n.events.concat(d), o((l) => ({ ...l, events: y }));
2815
+ }, _ = (d) => {
2816
+ o((p) => ({ ...p, currentDragged: d }));
2817
+ }, g = async (d, p, y, l, m) => {
2818
+ var v;
2819
+ const k = n.events.find((b) => typeof b.event_id == "number" ? b.event_id === +p : b.event_id === p), C = n.fields.find((b) => b.name === l), D = !!((v = C == null ? void 0 : C.config) != null && v.multiple);
2820
+ let T = m;
2821
+ if (C) {
2822
+ const b = k[l], S = Ge(C, b, k).value;
2823
+ if (D)
2824
+ if (S.includes(m)) {
2825
+ if (at(k.start, y))
2821
2826
  return;
2822
- D = w;
2827
+ T = S;
2823
2828
  } else
2824
- D = w.length > 1 ? [...w, l] : [l];
2829
+ T = S.length > 1 ? [...S, m] : [m];
2825
2830
  }
2826
- if (it(v.start, g) && (!D || !E && D === v[b]))
2831
+ if (at(k.start, y) && (!T || !D && T === k[l]))
2827
2832
  return;
2828
- const k = Fe(v.end, v.start), S = {
2829
- ...v,
2830
- start: g,
2831
- end: de(g, k),
2833
+ const M = $e(k.end, k.start), I = {
2834
+ ...k,
2835
+ start: y,
2836
+ end: de(y, M),
2832
2837
  recurring: void 0,
2833
- [b]: D || ""
2838
+ [l]: T || ""
2834
2839
  };
2835
2840
  if (!n.onEventDrop || typeof n.onEventDrop != "function")
2836
- return h(S, "edit");
2841
+ return h(I, "edit");
2837
2842
  try {
2838
2843
  f(!0);
2839
- const m = await n.onEventDrop(p, g, S, v);
2840
- m && h(m, "edit");
2844
+ const b = await n.onEventDrop(d, y, I, k);
2845
+ b && h(b, "edit");
2841
2846
  } finally {
2842
2847
  f(!1);
2843
2848
  }
2849
+ }, w = () => {
2850
+ t.getRemoteEvents && o((d) => ({ ...d, _refetchToken: d._refetchToken + 1 }));
2844
2851
  };
2845
2852
  return /* @__PURE__ */ r(
2846
- Rt.Provider,
2853
+ At.Provider,
2847
2854
  {
2848
2855
  value: {
2849
2856
  ...n,
2850
2857
  handleState: i,
2851
2858
  getViews: s,
2852
2859
  toggleAgenda: a,
2853
- triggerDialog: d,
2860
+ triggerDialog: c,
2854
2861
  triggerLoading: f,
2855
- handleGotoDay: c,
2862
+ handleGotoDay: u,
2856
2863
  confirmEvent: h,
2857
2864
  setCurrentDragged: _,
2858
- onDrop: y
2865
+ onDrop: g,
2866
+ refetch: w
2859
2867
  },
2860
2868
  children: e
2861
2869
  }
2862
2870
  );
2863
- }, eo = mt(function(t, n) {
2871
+ }, eo = _t(function(t, n) {
2864
2872
  return /* @__PURE__ */ r(Ir, { initial: t, children: /* @__PURE__ */ r(Mr, { ref: n }) });
2865
2873
  });
2866
2874
  export {