calendar-simple 1.1.1 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1,48 +1,48 @@
1
- import u, { createContext as be, memo as ge, useCallback as Se, useContext as Le, useEffect as ve, useMemo as me, useReducer as Ae, useRef as Me, useState as we } from "react";
2
- var Ce = Object.create, pe = Object.defineProperty, $e = Object.getOwnPropertyDescriptor, Ne = Object.getOwnPropertyNames, Oe = Object.getPrototypeOf, Te = Object.prototype.hasOwnProperty, ye = (e, c) => () => (c || e((c = { exports: {} }).exports, c), c.exports), ke = (e, c, s, i) => {
3
- if (c && typeof c == "object" || typeof c == "function")
4
- for (var y = Ne(c), o = 0, r = y.length, f; o < r; o++)
5
- f = y[o], !Te.call(e, f) && f !== s && pe(e, f, {
6
- get: ((D) => c[D]).bind(null, f),
7
- enumerable: !(i = $e(c, f)) || i.enumerable
1
+ import u, { createContext as Fe, memo as Re, useCallback as xe, useContext as Ue, useEffect as be, useLayoutEffect as Ie, useMemo as _e, useReducer as We, useRef as Te, useState as Se } from "react";
2
+ var Be = Object.create, Ye = Object.defineProperty, Pe = Object.getOwnPropertyDescriptor, je = Object.getOwnPropertyNames, Ge = Object.getPrototypeOf, Ve = Object.prototype.hasOwnProperty, He = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports), Je = (e, t, r, c) => {
3
+ if (t && typeof t == "object" || typeof t == "function")
4
+ for (var y = je(t), m = 0, s = y.length, h; m < s; m++)
5
+ h = y[m], !Ve.call(e, h) && h !== r && Ye(e, h, {
6
+ get: ((i) => t[i]).bind(null, h),
7
+ enumerable: !(c = Pe(t, h)) || c.enumerable
8
8
  });
9
9
  return e;
10
- }, re = (e, c, s) => (s = e != null ? Ce(Oe(e)) : {}, ke(c || !e || !e.__esModule ? pe(s, "default", {
10
+ }, ie = (e, t, r) => (r = e != null ? Be(Ge(e)) : {}, Je(t || !e || !e.__esModule ? Ye(r, "default", {
11
11
  value: e,
12
12
  enumerable: !0
13
- }) : s, e)), de = /* @__PURE__ */ ye(((e, c) => {
13
+ }) : r, e)), pe = /* @__PURE__ */ He(((e, t) => {
14
14
  (function() {
15
15
  "use strict";
16
- var s = {}.hasOwnProperty;
17
- function i() {
18
- for (var r = "", f = 0; f < arguments.length; f++) {
19
- var D = arguments[f];
20
- D && (r = o(r, y(D)));
16
+ var r = {}.hasOwnProperty;
17
+ function c() {
18
+ for (var s = "", h = 0; h < arguments.length; h++) {
19
+ var i = arguments[h];
20
+ i && (s = m(s, y(i)));
21
21
  }
22
- return r;
22
+ return s;
23
23
  }
24
- function y(r) {
25
- if (typeof r == "string" || typeof r == "number") return r;
26
- if (typeof r != "object") return "";
27
- if (Array.isArray(r)) return i.apply(null, r);
28
- if (r.toString !== Object.prototype.toString && !r.toString.toString().includes("[native code]")) return r.toString();
29
- var f = "";
30
- for (var D in r) s.call(r, D) && r[D] && (f = o(f, D));
31
- return f;
24
+ function y(s) {
25
+ if (typeof s == "string" || typeof s == "number") return s;
26
+ if (typeof s != "object") return "";
27
+ if (Array.isArray(s)) return c.apply(null, s);
28
+ if (s.toString !== Object.prototype.toString && !s.toString.toString().includes("[native code]")) return s.toString();
29
+ var h = "";
30
+ for (var i in s) r.call(s, i) && s[i] && (h = m(h, i));
31
+ return h;
32
32
  }
33
- function o(r, f) {
34
- return f ? r ? r + " " + f : r + f : r;
33
+ function m(s, h) {
34
+ return h ? s ? s + " " + h : s + h : s;
35
35
  }
36
- typeof c < "u" && c.exports ? (i.default = i, c.exports = i) : typeof define == "function" && typeof define.amd == "object" && define.amd ? define("classnames", [], function() {
37
- return i;
38
- }) : window.classNames = i;
36
+ typeof t < "u" && t.exports ? (c.default = c, t.exports = c) : typeof define == "function" && typeof define.amd == "object" && define.amd ? define("classnames", [], function() {
37
+ return c;
38
+ }) : window.classNames = c;
39
39
  })();
40
- })), Ye = /* @__PURE__ */ re(de());
41
- let He = /* @__PURE__ */ (function(e) {
40
+ })), qe = /* @__PURE__ */ ie(pe(), 1);
41
+ let ze = /* @__PURE__ */ (function(e) {
42
42
  return e.fullName = "FULL", e.halfName = "HALF", e;
43
- })({}), oe = /* @__PURE__ */ (function(e) {
43
+ })({}), ue = /* @__PURE__ */ (function(e) {
44
44
  return e.add = "add", e.sub = "sub", e;
45
- })({}), ce = /* @__PURE__ */ (function(e) {
45
+ })({}), de = /* @__PURE__ */ (function(e) {
46
46
  return e.month = "month", e.year = "year", e;
47
47
  })({});
48
48
  var W = {
@@ -75,7 +75,7 @@ var W = {
75
75
  HALF: "Sat"
76
76
  }
77
77
  };
78
- const Fe = {
78
+ const Ze = {
79
79
  FULL: [
80
80
  W.SUNDAY.FULL,
81
81
  W.MONDAY.FULL,
@@ -95,7 +95,7 @@ const Fe = {
95
95
  W.SATURDAY.HALF
96
96
  ]
97
97
  };
98
- var xe = {
98
+ var Ke = {
99
99
  JAN: {
100
100
  label: "January",
101
101
  value: 0
@@ -145,13 +145,13 @@ var xe = {
145
145
  value: 11
146
146
  }
147
147
  };
148
- const Re = Object.values(xe), le = {
148
+ const Xe = Object.values(Ke), fe = {
149
149
  MONTH: "monthDropdown",
150
150
  YEAR: "yearDropdown"
151
- }, It = {
151
+ }, cn = {
152
152
  FULL_NAME: "FULL",
153
153
  HALF_NAME: "HALF"
154
- }, ue = {
154
+ }, me = {
155
155
  default: {
156
156
  color: "#000",
157
157
  bgColor: "#fff"
@@ -164,142 +164,151 @@ const Re = Object.values(xe), le = {
164
164
  color: "#007bff",
165
165
  bgColor: "#e6f2ff"
166
166
  }
167
- }, _e = {
168
- dayType: He.halfName,
167
+ }, Me = {
168
+ dayType: ze.halfName,
169
169
  data: [],
170
170
  isSelectDate: !1,
171
171
  pastYearLength: 5,
172
172
  futureYearLength: 5,
173
- theme: ue
173
+ theme: me
174
+ }, ne = {
175
+ HEADER_HEIGHT: 122,
176
+ DATE_LABEL_HEIGHT: 28,
177
+ CELL_PADDING: 8,
178
+ EVENT_HEIGHT: 26,
179
+ DEFAULT_ROWS: 6,
180
+ MIN_ROWS: 4,
181
+ DAYS_IN_WEEK: 7,
182
+ EVENT_ITEM_PADDING: 16
174
183
  };
175
- var Ue = /* @__PURE__ */ ye(((e, c) => {
176
- (function(s, i) {
177
- typeof e == "object" && typeof c < "u" ? c.exports = i() : typeof define == "function" && define.amd ? define(i) : (s = typeof globalThis < "u" ? globalThis : s || self).dayjs = i();
184
+ var Qe = /* @__PURE__ */ He(((e, t) => {
185
+ (function(r, c) {
186
+ typeof e == "object" && typeof t < "u" ? t.exports = c() : typeof define == "function" && define.amd ? define(c) : (r = typeof globalThis < "u" ? globalThis : r || self).dayjs = c();
178
187
  })(e, (function() {
179
188
  "use strict";
180
- var s = 1e3, i = 6e4, y = 36e5, o = "millisecond", r = "second", f = "minute", D = "hour", d = "day", A = "week", v = "month", b = "quarter", m = "year", $ = "date", T = "Invalid Date", S = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, L = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, N = {
189
+ var r = 1e3, c = 6e4, y = 36e5, m = "millisecond", s = "second", h = "minute", i = "hour", v = "day", g = "week", d = "month", E = "quarter", f = "year", M = "date", w = "Invalid Date", L = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, b = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, $ = {
181
190
  name: "en",
182
191
  weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),
183
192
  months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"),
184
- ordinal: function(h) {
185
- var n = [
193
+ ordinal: function(_) {
194
+ var o = [
186
195
  "th",
187
196
  "st",
188
197
  "nd",
189
198
  "rd"
190
- ], t = h % 100;
191
- return "[" + h + (n[(t - 20) % 10] || n[t] || n[0]) + "]";
199
+ ], n = _ % 100;
200
+ return "[" + _ + (o[(n - 20) % 10] || o[n] || o[0]) + "]";
192
201
  }
193
- }, w = function(h, n, t) {
194
- var l = String(h);
195
- return !l || l.length >= n ? h : "" + Array(n + 1 - l.length).join(t) + h;
196
- }, C = {
197
- s: w,
198
- z: function(h) {
199
- var n = -h.utcOffset(), t = Math.abs(n), l = Math.floor(t / 60), a = t % 60;
200
- return (n <= 0 ? "+" : "-") + w(l, 2, "0") + ":" + w(a, 2, "0");
202
+ }, N = function(_, o, n) {
203
+ var l = String(_);
204
+ return !l || l.length >= o ? _ : "" + Array(o + 1 - l.length).join(n) + _;
205
+ }, T = {
206
+ s: N,
207
+ z: function(_) {
208
+ var o = -_.utcOffset(), n = Math.abs(o), l = Math.floor(n / 60), a = n % 60;
209
+ return (o <= 0 ? "+" : "-") + N(l, 2, "0") + ":" + N(a, 2, "0");
201
210
  },
202
- m: function h(n, t) {
203
- if (n.date() < t.date()) return -h(t, n);
204
- var l = 12 * (t.year() - n.year()) + (t.month() - n.month()), a = n.clone().add(l, v), _ = t - a < 0, p = n.clone().add(l + (_ ? -1 : 1), v);
205
- return +(-(l + (t - a) / (_ ? a - p : p - a)) || 0);
211
+ m: function _(o, n) {
212
+ if (o.date() < n.date()) return -_(n, o);
213
+ var l = 12 * (n.year() - o.year()) + (n.month() - o.month()), a = o.clone().add(l, d), p = n - a < 0, D = o.clone().add(l + (p ? -1 : 1), d);
214
+ return +(-(l + (n - a) / (p ? a - D : D - a)) || 0);
206
215
  },
207
- a: function(h) {
208
- return h < 0 ? Math.ceil(h) || 0 : Math.floor(h);
216
+ a: function(_) {
217
+ return _ < 0 ? Math.ceil(_) || 0 : Math.floor(_);
209
218
  },
210
- p: function(h) {
219
+ p: function(_) {
211
220
  return {
212
- M: v,
213
- y: m,
214
- w: A,
215
- d,
216
- D: $,
217
- h: D,
218
- m: f,
219
- s: r,
220
- ms: o,
221
- Q: b
222
- }[h] || String(h || "").toLowerCase().replace(/s$/, "");
221
+ M: d,
222
+ y: f,
223
+ w: g,
224
+ d: v,
225
+ D: M,
226
+ h: i,
227
+ m: h,
228
+ s,
229
+ ms: m,
230
+ Q: E
231
+ }[_] || String(_ || "").toLowerCase().replace(/s$/, "");
223
232
  },
224
- u: function(h) {
225
- return h === void 0;
233
+ u: function(_) {
234
+ return _ === void 0;
226
235
  }
227
- }, F = "en", R = {};
228
- R[F] = N;
229
- var V = "$isDayjsObject", O = function(h) {
230
- return h instanceof Z || !(!h || !h[V]);
231
- }, G = function h(n, t, l) {
236
+ }, x = "en", U = {};
237
+ U[x] = $;
238
+ var G = "$isDayjsObject", ae = function(_) {
239
+ return _ instanceof V || !(!_ || !_[G]);
240
+ }, Y = function _(o, n, l) {
232
241
  var a;
233
- if (!n) return F;
234
- if (typeof n == "string") {
235
- var _ = n.toLowerCase();
236
- R[_] && (a = _), t && (R[_] = t, a = _);
237
- var p = n.split("-");
238
- if (!a && p.length > 1) return h(p[0]);
242
+ if (!o) return x;
243
+ if (typeof o == "string") {
244
+ var p = o.toLowerCase();
245
+ U[p] && (a = p), n && (U[p] = n, a = p);
246
+ var D = o.split("-");
247
+ if (!a && D.length > 1) return _(D[0]);
239
248
  } else {
240
- var M = n.name;
241
- R[M] = n, a = M;
249
+ var C = o.name;
250
+ U[C] = o, a = C;
242
251
  }
243
- return !l && a && (F = a), a || !l && F;
244
- }, k = function(h, n) {
245
- if (O(h)) return h.clone();
246
- var t = typeof n == "object" ? n : {};
247
- return t.date = h, t.args = arguments, new Z(t);
248
- }, g = C;
249
- g.l = G, g.i = O, g.w = function(h, n) {
250
- return k(h, {
251
- locale: n.$L,
252
- utc: n.$u,
253
- x: n.$x,
254
- $offset: n.$offset
252
+ return !l && a && (x = a), a || !l && x;
253
+ }, H = function(_, o) {
254
+ if (ae(_)) return _.clone();
255
+ var n = typeof o == "object" ? o : {};
256
+ return n.date = _, n.args = arguments, new V(n);
257
+ }, S = T;
258
+ S.l = Y, S.i = ae, S.w = function(_, o) {
259
+ return H(_, {
260
+ locale: o.$L,
261
+ utc: o.$u,
262
+ x: o.$x,
263
+ $offset: o.$offset
255
264
  });
256
265
  };
257
- var Z = (function() {
258
- function h(t) {
259
- this.$L = G(t.locale, null, !0), this.parse(t), this.$x = this.$x || t.x || {}, this[V] = !0;
266
+ var V = (function() {
267
+ function _(n) {
268
+ this.$L = Y(n.locale, null, !0), this.parse(n), this.$x = this.$x || n.x || {}, this[G] = !0;
260
269
  }
261
- var n = h.prototype;
262
- return n.parse = function(t) {
270
+ var o = _.prototype;
271
+ return o.parse = function(n) {
263
272
  this.$d = (function(l) {
264
- var a = l.date, _ = l.utc;
273
+ var a = l.date, p = l.utc;
265
274
  if (a === null) return /* @__PURE__ */ new Date(NaN);
266
- if (g.u(a)) return /* @__PURE__ */ new Date();
275
+ if (S.u(a)) return /* @__PURE__ */ new Date();
267
276
  if (a instanceof Date) return new Date(a);
268
277
  if (typeof a == "string" && !/Z$/i.test(a)) {
269
- var p = a.match(S);
270
- if (p) {
271
- var M = p[2] - 1 || 0, Y = (p[7] || "0").substring(0, 3);
272
- return _ ? new Date(Date.UTC(p[1], M, p[3] || 1, p[4] || 0, p[5] || 0, p[6] || 0, Y)) : new Date(p[1], M, p[3] || 1, p[4] || 0, p[5] || 0, p[6] || 0, Y);
278
+ var D = a.match(L);
279
+ if (D) {
280
+ var C = D[2] - 1 || 0, O = (D[7] || "0").substring(0, 3);
281
+ return p ? new Date(Date.UTC(D[1], C, D[3] || 1, D[4] || 0, D[5] || 0, D[6] || 0, O)) : new Date(D[1], C, D[3] || 1, D[4] || 0, D[5] || 0, D[6] || 0, O);
273
282
  }
274
283
  }
275
284
  return new Date(a);
276
- })(t), this.init();
277
- }, n.init = function() {
278
- var t = this.$d;
279
- this.$y = t.getFullYear(), this.$M = t.getMonth(), this.$D = t.getDate(), this.$W = t.getDay(), this.$H = t.getHours(), this.$m = t.getMinutes(), this.$s = t.getSeconds(), this.$ms = t.getMilliseconds();
280
- }, n.$utils = function() {
281
- return g;
282
- }, n.isValid = function() {
283
- return this.$d.toString() !== T;
284
- }, n.isSame = function(t, l) {
285
- var a = k(t);
285
+ })(n), this.init();
286
+ }, o.init = function() {
287
+ var n = this.$d;
288
+ this.$y = n.getFullYear(), this.$M = n.getMonth(), this.$D = n.getDate(), this.$W = n.getDay(), this.$H = n.getHours(), this.$m = n.getMinutes(), this.$s = n.getSeconds(), this.$ms = n.getMilliseconds();
289
+ }, o.$utils = function() {
290
+ return S;
291
+ }, o.isValid = function() {
292
+ return this.$d.toString() !== w;
293
+ }, o.isSame = function(n, l) {
294
+ var a = H(n);
286
295
  return this.startOf(l) <= a && a <= this.endOf(l);
287
- }, n.isAfter = function(t, l) {
288
- return k(t) < this.startOf(l);
289
- }, n.isBefore = function(t, l) {
290
- return this.endOf(l) < k(t);
291
- }, n.$g = function(t, l, a) {
292
- return g.u(t) ? this[l] : this.set(a, t);
293
- }, n.unix = function() {
296
+ }, o.isAfter = function(n, l) {
297
+ return H(n) < this.startOf(l);
298
+ }, o.isBefore = function(n, l) {
299
+ return this.endOf(l) < H(n);
300
+ }, o.$g = function(n, l, a) {
301
+ return S.u(n) ? this[l] : this.set(a, n);
302
+ }, o.unix = function() {
294
303
  return Math.floor(this.valueOf() / 1e3);
295
- }, n.valueOf = function() {
304
+ }, o.valueOf = function() {
296
305
  return this.$d.getTime();
297
- }, n.startOf = function(t, l) {
298
- var a = this, _ = !!g.u(l) || l, p = g.p(t), M = function(q, U) {
299
- var P = g.w(a.$u ? Date.UTC(a.$y, U, q) : new Date(a.$y, U, q), a);
300
- return _ ? P : P.endOf(d);
301
- }, Y = function(q, U) {
302
- return g.w(a.toDate()[q].apply(a.toDate("s"), (_ ? [
306
+ }, o.startOf = function(n, l) {
307
+ var a = this, p = !!S.u(l) || l, D = S.p(n), C = function(Z, I) {
308
+ var J = S.w(a.$u ? Date.UTC(a.$y, I, Z) : new Date(a.$y, I, Z), a);
309
+ return p ? J : J.endOf(v);
310
+ }, O = function(Z, I) {
311
+ return S.w(a.toDate()[Z].apply(a.toDate("s"), (p ? [
303
312
  0,
304
313
  0,
305
314
  0,
@@ -309,455 +318,542 @@ var Ue = /* @__PURE__ */ ye(((e, c) => {
309
318
  59,
310
319
  59,
311
320
  999
312
- ]).slice(U)), a);
313
- }, H = this.$W, x = this.$M, I = this.$D, X = "set" + (this.$u ? "UTC" : "");
314
- switch (p) {
315
- case m:
316
- return _ ? M(1, 0) : M(31, 11);
317
- case v:
318
- return _ ? M(1, x) : M(0, x + 1);
319
- case A:
320
- var J = this.$locale().weekStart || 0, ee = (H < J ? H + 7 : H) - J;
321
- return M(_ ? I - ee : I + (6 - ee), x);
322
- case d:
323
- case $:
324
- return Y(X + "Hours", 0);
325
- case D:
326
- return Y(X + "Minutes", 1);
321
+ ]).slice(I)), a);
322
+ }, F = this.$W, R = this.$M, B = this.$D, X = "set" + (this.$u ? "UTC" : "");
323
+ switch (D) {
327
324
  case f:
328
- return Y(X + "Seconds", 2);
329
- case r:
330
- return Y(X + "Milliseconds", 3);
325
+ return p ? C(1, 0) : C(31, 11);
326
+ case d:
327
+ return p ? C(1, R) : C(0, R + 1);
328
+ case g:
329
+ var z = this.$locale().weekStart || 0, se = (F < z ? F + 7 : F) - z;
330
+ return C(p ? B - se : B + (6 - se), R);
331
+ case v:
332
+ case M:
333
+ return O(X + "Hours", 0);
334
+ case i:
335
+ return O(X + "Minutes", 1);
336
+ case h:
337
+ return O(X + "Seconds", 2);
338
+ case s:
339
+ return O(X + "Milliseconds", 3);
331
340
  default:
332
341
  return this.clone();
333
342
  }
334
- }, n.endOf = function(t) {
335
- return this.startOf(t, !1);
336
- }, n.$set = function(t, l) {
337
- var a, _ = g.p(t), p = "set" + (this.$u ? "UTC" : ""), M = (a = {}, a[d] = p + "Date", a[$] = p + "Date", a[v] = p + "Month", a[m] = p + "FullYear", a[D] = p + "Hours", a[f] = p + "Minutes", a[r] = p + "Seconds", a[o] = p + "Milliseconds", a)[_], Y = _ === d ? this.$D + (l - this.$W) : l;
338
- if (_ === v || _ === m) {
339
- var H = this.clone().set($, 1);
340
- H.$d[M](Y), H.init(), this.$d = H.set($, Math.min(this.$D, H.daysInMonth())).$d;
341
- } else M && this.$d[M](Y);
343
+ }, o.endOf = function(n) {
344
+ return this.startOf(n, !1);
345
+ }, o.$set = function(n, l) {
346
+ var a, p = S.p(n), D = "set" + (this.$u ? "UTC" : ""), C = (a = {}, a[v] = D + "Date", a[M] = D + "Date", a[d] = D + "Month", a[f] = D + "FullYear", a[i] = D + "Hours", a[h] = D + "Minutes", a[s] = D + "Seconds", a[m] = D + "Milliseconds", a)[p], O = p === v ? this.$D + (l - this.$W) : l;
347
+ if (p === d || p === f) {
348
+ var F = this.clone().set(M, 1);
349
+ F.$d[C](O), F.init(), this.$d = F.set(M, Math.min(this.$D, F.daysInMonth())).$d;
350
+ } else C && this.$d[C](O);
342
351
  return this.init(), this;
343
- }, n.set = function(t, l) {
344
- return this.clone().$set(t, l);
345
- }, n.get = function(t) {
346
- return this[g.p(t)]();
347
- }, n.add = function(t, l) {
348
- var a, _ = this;
349
- t = Number(t);
350
- var p = g.p(l), M = function(x) {
351
- var I = k(_);
352
- return g.w(I.date(I.date() + Math.round(x * t)), _);
352
+ }, o.set = function(n, l) {
353
+ return this.clone().$set(n, l);
354
+ }, o.get = function(n) {
355
+ return this[S.p(n)]();
356
+ }, o.add = function(n, l) {
357
+ var a, p = this;
358
+ n = Number(n);
359
+ var D = S.p(l), C = function(R) {
360
+ var B = H(p);
361
+ return S.w(B.date(B.date() + Math.round(R * n)), p);
353
362
  };
354
- if (p === v) return this.set(v, this.$M + t);
355
- if (p === m) return this.set(m, this.$y + t);
356
- if (p === d) return M(1);
357
- if (p === A) return M(7);
358
- var Y = (a = {}, a[f] = i, a[D] = y, a[r] = s, a)[p] || 1, H = this.$d.getTime() + t * Y;
359
- return g.w(H, this);
360
- }, n.subtract = function(t, l) {
361
- return this.add(-1 * t, l);
362
- }, n.format = function(t) {
363
+ if (D === d) return this.set(d, this.$M + n);
364
+ if (D === f) return this.set(f, this.$y + n);
365
+ if (D === v) return C(1);
366
+ if (D === g) return C(7);
367
+ var O = (a = {}, a[h] = c, a[i] = y, a[s] = r, a)[D] || 1, F = this.$d.getTime() + n * O;
368
+ return S.w(F, this);
369
+ }, o.subtract = function(n, l) {
370
+ return this.add(-1 * n, l);
371
+ }, o.format = function(n) {
363
372
  var l = this, a = this.$locale();
364
- if (!this.isValid()) return a.invalidDate || T;
365
- var _ = t || "YYYY-MM-DDTHH:mm:ssZ", p = g.z(this), M = this.$H, Y = this.$m, H = this.$M, x = a.weekdays, I = a.months, X = a.meridiem, J = function(U, P, te, se) {
366
- return U && (U[P] || U(l, _)) || te[P].slice(0, se);
367
- }, ee = function(U) {
368
- return g.s(M % 12 || 12, U, "0");
369
- }, q = X || function(U, P, te) {
370
- var se = U < 12 ? "AM" : "PM";
371
- return te ? se.toLowerCase() : se;
373
+ if (!this.isValid()) return a.invalidDate || w;
374
+ var p = n || "YYYY-MM-DDTHH:mm:ssZ", D = S.z(this), C = this.$H, O = this.$m, F = this.$M, R = a.weekdays, B = a.months, X = a.meridiem, z = function(I, J, oe, le) {
375
+ return I && (I[J] || I(l, p)) || oe[J].slice(0, le);
376
+ }, se = function(I) {
377
+ return S.s(C % 12 || 12, I, "0");
378
+ }, Z = X || function(I, J, oe) {
379
+ var le = I < 12 ? "AM" : "PM";
380
+ return oe ? le.toLowerCase() : le;
372
381
  };
373
- return _.replace(L, (function(U, P) {
374
- return P || (function(te) {
375
- switch (te) {
382
+ return p.replace(b, (function(I, J) {
383
+ return J || (function(oe) {
384
+ switch (oe) {
376
385
  case "YY":
377
386
  return String(l.$y).slice(-2);
378
387
  case "YYYY":
379
- return g.s(l.$y, 4, "0");
388
+ return S.s(l.$y, 4, "0");
380
389
  case "M":
381
- return H + 1;
390
+ return F + 1;
382
391
  case "MM":
383
- return g.s(H + 1, 2, "0");
392
+ return S.s(F + 1, 2, "0");
384
393
  case "MMM":
385
- return J(a.monthsShort, H, I, 3);
394
+ return z(a.monthsShort, F, B, 3);
386
395
  case "MMMM":
387
- return J(I, H);
396
+ return z(B, F);
388
397
  case "D":
389
398
  return l.$D;
390
399
  case "DD":
391
- return g.s(l.$D, 2, "0");
400
+ return S.s(l.$D, 2, "0");
392
401
  case "d":
393
402
  return String(l.$W);
394
403
  case "dd":
395
- return J(a.weekdaysMin, l.$W, x, 2);
404
+ return z(a.weekdaysMin, l.$W, R, 2);
396
405
  case "ddd":
397
- return J(a.weekdaysShort, l.$W, x, 3);
406
+ return z(a.weekdaysShort, l.$W, R, 3);
398
407
  case "dddd":
399
- return x[l.$W];
408
+ return R[l.$W];
400
409
  case "H":
401
- return String(M);
410
+ return String(C);
402
411
  case "HH":
403
- return g.s(M, 2, "0");
412
+ return S.s(C, 2, "0");
404
413
  case "h":
405
- return ee(1);
414
+ return se(1);
406
415
  case "hh":
407
- return ee(2);
416
+ return se(2);
408
417
  case "a":
409
- return q(M, Y, !0);
418
+ return Z(C, O, !0);
410
419
  case "A":
411
- return q(M, Y, !1);
420
+ return Z(C, O, !1);
412
421
  case "m":
413
- return String(Y);
422
+ return String(O);
414
423
  case "mm":
415
- return g.s(Y, 2, "0");
424
+ return S.s(O, 2, "0");
416
425
  case "s":
417
426
  return String(l.$s);
418
427
  case "ss":
419
- return g.s(l.$s, 2, "0");
428
+ return S.s(l.$s, 2, "0");
420
429
  case "SSS":
421
- return g.s(l.$ms, 3, "0");
430
+ return S.s(l.$ms, 3, "0");
422
431
  case "Z":
423
- return p;
432
+ return D;
424
433
  }
425
434
  return null;
426
- })(U) || p.replace(":", "");
435
+ })(I) || D.replace(":", "");
427
436
  }));
428
- }, n.utcOffset = function() {
437
+ }, o.utcOffset = function() {
429
438
  return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
430
- }, n.diff = function(t, l, a) {
431
- var _, p = this, M = g.p(l), Y = k(t), H = (Y.utcOffset() - this.utcOffset()) * i, x = this - Y, I = function() {
432
- return g.m(p, Y);
439
+ }, o.diff = function(n, l, a) {
440
+ var p, D = this, C = S.p(l), O = H(n), F = (O.utcOffset() - this.utcOffset()) * c, R = this - O, B = function() {
441
+ return S.m(D, O);
433
442
  };
434
- switch (M) {
435
- case m:
436
- _ = I() / 12;
443
+ switch (C) {
444
+ case f:
445
+ p = B() / 12;
437
446
  break;
438
- case v:
439
- _ = I();
447
+ case d:
448
+ p = B();
440
449
  break;
441
- case b:
442
- _ = I() / 3;
450
+ case E:
451
+ p = B() / 3;
443
452
  break;
444
- case A:
445
- _ = (x - H) / 6048e5;
453
+ case g:
454
+ p = (R - F) / 6048e5;
446
455
  break;
447
- case d:
448
- _ = (x - H) / 864e5;
456
+ case v:
457
+ p = (R - F) / 864e5;
449
458
  break;
450
- case D:
451
- _ = x / y;
459
+ case i:
460
+ p = R / y;
452
461
  break;
453
- case f:
454
- _ = x / i;
462
+ case h:
463
+ p = R / c;
455
464
  break;
456
- case r:
457
- _ = x / s;
465
+ case s:
466
+ p = R / r;
458
467
  break;
459
468
  default:
460
- _ = x;
469
+ p = R;
461
470
  }
462
- return a ? _ : g.a(_);
463
- }, n.daysInMonth = function() {
464
- return this.endOf(v).$D;
465
- }, n.$locale = function() {
466
- return R[this.$L];
467
- }, n.locale = function(t, l) {
468
- if (!t) return this.$L;
469
- var a = this.clone(), _ = G(t, l, !0);
470
- return _ && (a.$L = _), a;
471
- }, n.clone = function() {
472
- return g.w(this.$d, this);
473
- }, n.toDate = function() {
471
+ return a ? p : S.a(p);
472
+ }, o.daysInMonth = function() {
473
+ return this.endOf(d).$D;
474
+ }, o.$locale = function() {
475
+ return U[this.$L];
476
+ }, o.locale = function(n, l) {
477
+ if (!n) return this.$L;
478
+ var a = this.clone(), p = Y(n, l, !0);
479
+ return p && (a.$L = p), a;
480
+ }, o.clone = function() {
481
+ return S.w(this.$d, this);
482
+ }, o.toDate = function() {
474
483
  return new Date(this.valueOf());
475
- }, n.toJSON = function() {
484
+ }, o.toJSON = function() {
476
485
  return this.isValid() ? this.toISOString() : null;
477
- }, n.toISOString = function() {
486
+ }, o.toISOString = function() {
478
487
  return this.$d.toISOString();
479
- }, n.toString = function() {
488
+ }, o.toString = function() {
480
489
  return this.$d.toUTCString();
481
- }, h;
482
- })(), ne = Z.prototype;
483
- return k.prototype = ne, [
484
- ["$ms", o],
485
- ["$s", r],
486
- ["$m", f],
487
- ["$H", D],
488
- ["$W", d],
489
- ["$M", v],
490
- ["$y", m],
491
- ["$D", $]
492
- ].forEach((function(h) {
493
- ne[h[1]] = function(n) {
494
- return this.$g(n, h[0], h[1]);
490
+ }, _;
491
+ })(), ce = V.prototype;
492
+ return H.prototype = ce, [
493
+ ["$ms", m],
494
+ ["$s", s],
495
+ ["$m", h],
496
+ ["$H", i],
497
+ ["$W", v],
498
+ ["$M", d],
499
+ ["$y", f],
500
+ ["$D", M]
501
+ ].forEach((function(_) {
502
+ ce[_[1]] = function(o) {
503
+ return this.$g(o, _[0], _[1]);
495
504
  };
496
- })), k.extend = function(h, n) {
497
- return h.$i || (h(n, Z, k), h.$i = !0), k;
498
- }, k.locale = G, k.isDayjs = O, k.unix = function(h) {
499
- return k(1e3 * h);
500
- }, k.en = R[F], k.Ls = R, k.p = {}, k;
505
+ })), H.extend = function(_, o) {
506
+ return _.$i || (_(o, V, H), _.$i = !0), H;
507
+ }, H.locale = Y, H.isDayjs = ae, H.unix = function(_) {
508
+ return H(1e3 * _);
509
+ }, H.en = U[x], H.Ls = U, H.p = {}, H;
501
510
  }));
502
- })), z = /* @__PURE__ */ re(Ue());
503
- const E = z.default, K = (e) => (0, z.default)(e).toDate(), We = (e) => (0, z.default)(e), Ie = (e, c, s) => {
504
- const i = e + c, y = (0, z.default)().year() - e, o = Array.from({ length: i }, (r, f) => f + y);
505
- if (!o.includes(s)) if ((0, z.default)().year() <= s) o.push(s);
506
- else return [s, ...o];
507
- return o;
508
- }, Be = (e, c) => {
509
- const s = (0, z.default)(e).date(c);
510
- return (0, z.default)().isSame(s, "day");
511
- };
512
- function je(e, c) {
513
- for (var s = 0, i = 0, y, o = [], r = new Date(e || /* @__PURE__ */ new Date()), f = r.getFullYear(), D = r.getMonth(), d = new Date(f, D, 1 - (c | 0)).getDay(), A = new Date(f, D + 1, 0).getDate(); s < A; ) {
514
- for (i = 0, y = Array(7); i < 7; ) {
515
- for (; i < d; ) y[i++] = 0;
516
- y[i++] = ++s > A ? 0 : s, d = 0;
511
+ })), A = /* @__PURE__ */ ie(Qe(), 1);
512
+ const q = A.default;
513
+ function Ae(e) {
514
+ return Number((0, A.default)(e).startOf("month").format("d"));
515
+ }
516
+ function te(e) {
517
+ return (0, A.default)(e).toDate();
518
+ }
519
+ function et(e, t, r) {
520
+ const c = e + t, y = (0, A.default)().year() - e, m = Array.from({ length: c }, (s, h) => h + y);
521
+ if (!m.includes(r)) if ((0, A.default)().year() <= r) m.push(r);
522
+ else return [r, ...m];
523
+ return m;
524
+ }
525
+ function tt(e, t) {
526
+ const r = (0, A.default)(e).date(t);
527
+ return (0, A.default)().isSame(r, "day");
528
+ }
529
+ function k(e) {
530
+ return (0, A.default)(e).startOf("day");
531
+ }
532
+ function we(e) {
533
+ return (0, A.default)(e).startOf("month");
534
+ }
535
+ function De(e, t) {
536
+ return (0, A.default)(e).add(t, "day");
537
+ }
538
+ function Le(e, t) {
539
+ return (0, A.default)(e).subtract(t, "day");
540
+ }
541
+ function nt(e, t) {
542
+ return (0, A.default)(e).add(t, "month");
543
+ }
544
+ function rt(e, t) {
545
+ return (0, A.default)(e).subtract(t, "month");
546
+ }
547
+ function K(e, t) {
548
+ return (0, A.default)(e).diff((0, A.default)(t), "day");
549
+ }
550
+ function ge(e, t) {
551
+ return (0, A.default)(e).isBefore((0, A.default)(t), "day");
552
+ }
553
+ function ve(e, t) {
554
+ return (0, A.default)(e).isAfter((0, A.default)(t), "day");
555
+ }
556
+ function Ne(e, t) {
557
+ return (0, A.default)(e).isSame((0, A.default)(t), "day");
558
+ }
559
+ function re(e, t) {
560
+ return (0, A.default)(e).format(t);
561
+ }
562
+ function at(e, t) {
563
+ return (0, A.default)(e).date(t);
564
+ }
565
+ function st(e, t) {
566
+ return (0, A.default)(e).month(t);
567
+ }
568
+ function ot(e, t) {
569
+ return (0, A.default)(e).year(t);
570
+ }
571
+ function Ce(e) {
572
+ return (0, A.default)(e).date();
573
+ }
574
+ function it(e) {
575
+ return (0, A.default)(e).month();
576
+ }
577
+ function $e(e) {
578
+ return (0, A.default)(e).year();
579
+ }
580
+ function ct(e, t) {
581
+ for (var r = 0, c = 0, y, m = [], s = new Date(e || /* @__PURE__ */ new Date()), h = s.getFullYear(), i = s.getMonth(), v = new Date(h, i, 1 - (t | 0)).getDay(), g = new Date(h, i + 1, 0).getDate(); r < g; ) {
582
+ for (c = 0, y = Array(7); c < 7; ) {
583
+ for (; c < v; ) y[c++] = 0;
584
+ y[c++] = ++r > g ? 0 : r, v = 0;
517
585
  }
518
- o.push(y);
586
+ m.push(y);
519
587
  }
520
- return o;
521
- }
522
- const Pe = (e, c) => {
523
- const s = [...c].sort((i, y) => E(i.startDate).startOf("day").diff(E(y.startDate).startOf("day"), "days"));
524
- return je(e.toDate()).map((i, y) => {
525
- const o = i.map((v, b) => {
526
- let m = E(e), $ = !0, T = v;
527
- if (v === 0)
528
- if ($ = !1, y === 0) {
529
- const S = E(e).startOf("month"), L = S.day();
530
- m = S.subtract(L - b, "day"), T = m.date();
531
- } else {
532
- const S = E(e).startOf("month"), L = S.day(), N = y * 7 + b - L;
533
- m = S.add(N, "day"), T = m.date();
588
+ return m;
589
+ }
590
+ function lt(e, t) {
591
+ const r = [...t].sort((c, y) => K(k(c.startDate), k(y.startDate)));
592
+ return ct(e.toDate()).map((c, y) => {
593
+ const m = c.map((d, E) => {
594
+ let f = q(e), M = !0, w = d;
595
+ if (d === 0)
596
+ if (M = !1, y === 0)
597
+ f = Le(we(e), Ae(e) - E), w = Ce(f);
598
+ else {
599
+ const L = we(e), b = Ae(e);
600
+ f = De(L, y * 7 + E - b), w = Ce(f);
534
601
  }
535
- else m = E(e).date(v);
602
+ else f = at(e, d);
536
603
  return {
537
- currentDate: m,
538
- isCurrentMonth: $,
539
- displayDay: T
604
+ currentDate: f,
605
+ isCurrentMonth: M,
606
+ displayDay: w
540
607
  };
541
- }), r = o[0].currentDate.startOf("day"), f = o[6].currentDate.startOf("day"), D = s.filter((v) => {
542
- const b = E(v.startDate).startOf("day"), m = v.endDate ? E(v.endDate).startOf("day") : b;
543
- return b.isBefore(f.add(1, "day"), "day") && m.isAfter(r.subtract(1, "day"), "day");
608
+ }), s = k(m[0].currentDate), h = k(m[6].currentDate), i = r.filter((d) => {
609
+ const E = k(d.startDate), f = d.endDate ? k(d.endDate) : E;
610
+ return ge(E, De(h, 1)) && ve(f, Le(s, 1));
544
611
  });
545
- D.sort((v, b) => {
546
- const m = E(v.startDate).startOf("day"), $ = E(b.startDate).startOf("day");
547
- if (!m.isSame($, "day")) return m.diff($);
548
- const T = v.endDate ? E(v.endDate).startOf("day") : m, S = b.endDate ? E(b.endDate).startOf("day") : $, L = T.diff(m, "day");
549
- return S.diff($, "day") - L;
612
+ i.sort((d, E) => {
613
+ const f = k(d.startDate), M = k(E.startDate);
614
+ if (!Ne(f, M)) return K(f, M);
615
+ const w = d.endDate ? k(d.endDate) : f, L = E.endDate ? k(E.endDate) : M, b = K(w, f);
616
+ return K(L, M) - b;
550
617
  });
551
- const d = Array(7).fill(null).map(() => []), A = /* @__PURE__ */ new Map();
552
- return D.forEach((v, b) => {
553
- const m = E(v.startDate).startOf("day"), $ = v.endDate ? E(v.endDate).startOf("day") : m;
554
- let T = m.diff(r, "day"), S = $.diff(r, "day");
555
- T < 0 && (T = 0), S > 6 && (S = 6);
556
- let L = 0;
618
+ const v = Array(7).fill(null).map(() => []), g = /* @__PURE__ */ new Map();
619
+ return i.forEach((d, E) => {
620
+ const f = k(d.startDate), M = d.endDate ? k(d.endDate) : f;
621
+ let w = K(f, s), L = K(M, s);
622
+ w < 0 && (w = 0), L > 6 && (L = 6);
623
+ let b = 0;
557
624
  for (; ; ) {
558
- let w = !0;
559
- for (let C = T; C <= S; C++) if (d[C][L]) {
560
- w = !1;
625
+ let N = !0;
626
+ for (let T = w; T <= L; T++) if (v[T][b]) {
627
+ N = !1;
561
628
  break;
562
629
  }
563
- if (w) break;
564
- L++;
630
+ if (N) break;
631
+ b++;
565
632
  }
566
- const N = v.startDate + v.value + b;
567
- A.set(N, L);
568
- for (let w = T; w <= S; w++) d[w][L] = N;
569
- v._tempId = N;
570
- }), o.map((v, b) => {
571
- const { currentDate: m, isCurrentMonth: $, displayDay: T } = v, S = D.filter((w) => {
572
- const C = E(w.startDate).startOf("day"), F = w.endDate ? E(w.endDate).startOf("day") : C;
573
- return !m.isBefore(C, "day") && !m.isAfter(F, "day");
574
- }), L = [];
575
- let N = -1;
576
- S.forEach((w) => {
577
- const C = A.get(w._tempId);
578
- C !== void 0 && C > N && (N = C);
633
+ const $ = d.startDate + d.value + E;
634
+ g.set($, b);
635
+ for (let N = w; N <= L; N++) v[N][b] = $;
636
+ d._tempId = $;
637
+ }), m.map((d, E) => {
638
+ const { currentDate: f, isCurrentMonth: M, displayDay: w } = d, L = i.filter((N) => {
639
+ const T = k(N.startDate), x = N.endDate ? k(N.endDate) : T;
640
+ return !ge(f, T) && !ve(f, x);
641
+ }), b = [];
642
+ let $ = -1;
643
+ L.forEach((N) => {
644
+ const T = g.get(N._tempId);
645
+ T !== void 0 && T > $ && ($ = T);
579
646
  });
580
- for (let w = 0; w <= N; w++) {
581
- const C = S.find((F) => A.get(F._tempId) === w);
582
- if (C) if (E(C.startDate).startOf("day").isSame(m, "day") || b === 0) {
583
- const F = C.endDate ? E(C.endDate).startOf("day") : E(C.startDate).startOf("day"), R = E(m).add(6 - b, "day");
584
- let V = F;
585
- F.isAfter(R, "date") && (V = R), L.push({
586
- ...C,
587
- startDateWeek: m.format("YYYY-MM-DD"),
588
- endDateWeek: V.format("YYYY-MM-DD")
647
+ for (let N = 0; N <= $; N++) {
648
+ const T = L.find((x) => g.get(x._tempId) === N);
649
+ if (T) if (Ne(k(T.startDate), f) || E === 0) {
650
+ const x = T.endDate ? k(T.endDate) : k(T.startDate), U = De(f, 6 - E);
651
+ let G = x;
652
+ ve(x, U) && (G = U), b.push({
653
+ ...T,
654
+ startDateWeek: re(f, "YYYY-MM-DD"),
655
+ endDateWeek: re(G, "YYYY-MM-DD"),
656
+ isSpacer: !1
589
657
  });
590
- } else L.push({
591
- ...C,
658
+ } else b.push({
659
+ ...T,
592
660
  isSpacer: !0
593
661
  });
594
- else L.push(null);
662
+ else b.push(null);
595
663
  }
596
664
  return {
597
- currentDate: m,
598
- isCurrentMonth: $,
599
- displayDay: T,
600
- events: L,
601
- totalEvents: S.length,
602
- isToday: Be(e, T) && $
665
+ currentDate: f,
666
+ isCurrentMonth: M,
667
+ displayDay: w,
668
+ events: b,
669
+ totalEvents: L.length,
670
+ isToday: tt(e, w) && M
603
671
  };
604
672
  });
605
673
  });
606
- }, Ve = (e) => {
607
- const o = e / 6 - 28 - 8, r = Math.round(o / 26) - 1;
608
- return Math.max(0, r);
609
- }, Ge = (e) => {
610
- const [c, s] = we({
674
+ }
675
+ function ut(e, t) {
676
+ const { DATE_LABEL_HEIGHT: r, CELL_PADDING: c, EVENT_HEIGHT: y } = ne, m = e / t - r - c, s = Math.round(m / y) - 1;
677
+ return Math.max(0, s);
678
+ }
679
+ function dt(e) {
680
+ const [t, r] = Se({
611
681
  width: 0,
612
682
  height: 0
613
683
  });
614
- return ve(() => {
615
- const i = e.current;
616
- if (!i) return;
617
- const y = new ResizeObserver((o) => {
618
- if (!Array.isArray(o) || !o.length) return;
619
- const { width: r, height: f } = o[0].contentRect;
620
- s({
621
- width: r,
622
- height: f
684
+ return be(() => {
685
+ const c = e.current;
686
+ if (!c) return;
687
+ const y = new ResizeObserver((m) => {
688
+ if (!Array.isArray(m) || !m.length) return;
689
+ const { width: s, height: h } = m[0].contentRect;
690
+ r({
691
+ width: s,
692
+ height: h
623
693
  });
624
694
  });
625
- return y.observe(i), () => {
695
+ return y.observe(c), () => {
626
696
  y.disconnect();
627
697
  };
628
- }, [e]), c;
629
- }, Je = "_calendarContainer_q5rnf_1", qe = "_calendar_q5rnf_1", ze = "_table_q5rnf_56", Ze = "_tableHeader_q5rnf_61", Xe = "_tableCell_q5rnf_62", Qe = "_tableBody_q5rnf_88";
630
- var Q = {
631
- calendarContainer: Je,
632
- calendar: qe,
633
- table: ze,
634
- tableHeader: Ze,
635
- tableCell: Xe,
636
- tableBody: Qe
698
+ }, [e]), t;
699
+ }
700
+ const ft = "_calendarContainer_q5rnf_1", ht = "_calendar_q5rnf_1", mt = "_table_q5rnf_56", vt = "_tableHeader_q5rnf_61", _t = "_tableCell_q5rnf_62", pt = "_tableBody_q5rnf_88";
701
+ var ee = {
702
+ calendarContainer: ft,
703
+ calendar: ht,
704
+ table: mt,
705
+ tableHeader: vt,
706
+ tableCell: _t,
707
+ tableBody: pt
637
708
  };
638
- const Ke = "_dateData_5xvpr_1", et = "_currentMonth_5xvpr_16", tt = "_cellContent_5xvpr_21", at = "_dateLabel_5xvpr_30", rt = "_selected_5xvpr_44", nt = "_today_5xvpr_49", st = "_dataContainer_5xvpr_54", ot = "_spacer_5xvpr_62", ct = "_eventItem_5xvpr_67", lt = "_moreEventsContainer_5xvpr_95", it = "_moreEvents_5xvpr_95";
639
- var B = {
640
- dateData: Ke,
641
- currentMonth: et,
642
- cellContent: tt,
643
- dateLabel: at,
644
- selected: rt,
645
- today: nt,
646
- dataContainer: st,
647
- spacer: ot,
648
- eventItem: ct,
649
- moreEventsContainer: lt,
650
- moreEvents: it
709
+ const Dt = "_dateData_ed04n_1", yt = "_currentMonth_ed04n_18", Et = "_cellContent_ed04n_23", gt = "_dateLabel_ed04n_32", bt = "_selected_ed04n_46", St = "_today_ed04n_51", Mt = "_dataContainer_ed04n_56", At = "_spacer_ed04n_64", wt = "_eventItem_ed04n_69", Lt = "_moreEventsContainer_ed04n_97", Nt = "_moreEvents_ed04n_97";
710
+ var P = {
711
+ dateData: Dt,
712
+ currentMonth: yt,
713
+ cellContent: Et,
714
+ dateLabel: gt,
715
+ selected: bt,
716
+ today: St,
717
+ dataContainer: Mt,
718
+ spacer: At,
719
+ eventItem: wt,
720
+ moreEventsContainer: Lt,
721
+ moreEvents: Nt
651
722
  };
652
- const ut = "_popover_1l8k5_1", dt = "_fadeIn_1l8k5_1", ft = "_popoverHeader_1l8k5_33", ht = "_popoverItem_1l8k5_44", vt = "_startBefore_1l8k5_62", mt = "_endAfter_1l8k5_69";
653
- var ae = {
654
- popover: ut,
655
- fadeIn: dt,
656
- popoverHeader: ft,
657
- popoverItem: ht,
658
- startBefore: vt,
659
- endAfter: mt
723
+ const Ct = "_popover_5fy95_1", $t = "_fadeIn_5fy95_1", Tt = "_popoverHeader_5fy95_34", Yt = "_popoverContent_5fy95_45", Ht = "_popoverItem_5fy95_49", Ot = "_startBefore_5fy95_68", kt = "_endAfter_5fy95_75";
724
+ var Q = {
725
+ popover: Ct,
726
+ fadeIn: $t,
727
+ popoverHeader: Tt,
728
+ popoverContent: Yt,
729
+ popoverItem: Ht,
730
+ startBefore: Ot,
731
+ endAfter: kt
660
732
  };
661
- function _t({ dateObj: e, events: c, onEventClick: s, onClose: i }) {
662
- const y = Me(null);
663
- return ve(() => {
664
- function o(r) {
665
- y.current && !y.current.contains(r.target) && i();
733
+ function Ft({ dateObj: e, events: t, onEventClick: r, onClose: c, anchorEl: y }) {
734
+ const m = Te(null), [s, h] = Se({ visibility: "hidden" });
735
+ return Ie(() => {
736
+ if (m.current && y) {
737
+ const i = m.current.getBoundingClientRect(), v = y.getBoundingClientRect(), g = 10;
738
+ let d = v.bottom + 4, E = v.left;
739
+ const f = window.innerHeight, M = window.innerWidth, w = f - d, L = v.top - g;
740
+ let b = {
741
+ visibility: "visible",
742
+ position: "fixed",
743
+ top: `${d}px`,
744
+ left: `${E}px`,
745
+ width: "220px"
746
+ };
747
+ if (E + i.width > M - g && (E = M - i.width - g, b.left = `${E}px`), d + i.height > f - g) {
748
+ const $ = i.height;
749
+ if (w < $ && L > w) {
750
+ const N = Math.min($, L);
751
+ b.top = "auto", b.bottom = `${f - v.top + 4}px`, b.maxHeight = `${N}px`;
752
+ } else b.maxHeight = `${Math.min($, w - g)}px`;
753
+ }
754
+ h(b);
755
+ }
756
+ }, [y]), be(() => {
757
+ function i(v) {
758
+ m.current && !m.current.contains(v.target) && c();
666
759
  }
667
- return document.addEventListener("mousedown", o), () => {
668
- document.removeEventListener("mousedown", o);
760
+ return document.addEventListener("mousedown", i), () => {
761
+ document.removeEventListener("mousedown", i);
669
762
  };
670
- }, [i]), /* @__PURE__ */ u.createElement("div", {
671
- className: ae.popover,
672
- ref: y,
673
- onClick: (o) => o.stopPropagation()
674
- }, /* @__PURE__ */ u.createElement("div", { className: ae.popoverHeader }, E(e).format("ddd, D MMM")), c.map((o, r) => {
675
- const f = E(e).startOf("day"), D = E(o.startDate).startOf("day"), d = o.endDate ? E(o.endDate).startOf("day") : D, A = D.isBefore(f, "day"), v = d.isAfter(f, "day");
763
+ }, [c]), /* @__PURE__ */ u.createElement("div", {
764
+ className: Q.popover,
765
+ ref: m,
766
+ style: s,
767
+ onClick: (i) => i.stopPropagation()
768
+ }, /* @__PURE__ */ u.createElement("div", { className: Q.popoverHeader }, re(e, "ddd, D MMM")), /* @__PURE__ */ u.createElement("div", { className: Q.popoverContent }, t.map((i, v) => {
769
+ const g = k(e), d = k(i.startDate), E = i.endDate ? k(i.endDate) : d, f = ge(d, g), M = ve(E, g);
676
770
  return /* @__PURE__ */ u.createElement("div", {
677
- key: `pop-${r}`,
678
- className: (0, Ye.default)(ae.popoverItem, {
679
- [ae.startBefore]: A,
680
- [ae.endAfter]: v
771
+ key: `pop-${v}`,
772
+ className: (0, qe.default)(Q.popoverItem, {
773
+ [Q.startBefore]: f,
774
+ [Q.endAfter]: M
681
775
  }),
682
- style: { backgroundColor: o.color },
683
- onClick: (b) => {
684
- b.stopPropagation(), s?.(o), i();
776
+ style: { backgroundColor: i.color },
777
+ onClick: (w) => {
778
+ w.stopPropagation(), r?.(i), c();
685
779
  },
686
- title: o.value
687
- }, o.value);
688
- }));
780
+ title: i.value
781
+ }, i.value);
782
+ })));
689
783
  }
690
- var pt = _t, ie = /* @__PURE__ */ re(de());
691
- function yt({ date: e, dateObj: c, data: s, cellWidth: i, className: y, dataClassName: o, isSelected: r, isToday: f, onClick: D, selectedClassName: d, todayClassName: A, isCurrentMonth: v, theme: b, maxEvents: m = 3, onMoreClick: $, onEventClick: T, totalEvents: S = 0 }) {
692
- const [L, N] = u.useState(!1), w = r ? {
693
- ...ue.selected,
694
- ...b?.selected
695
- } : f ? {
696
- ...ue.today,
697
- ...b?.today
784
+ var Rt = Ft, he = /* @__PURE__ */ ie(pe(), 1);
785
+ function xt({ date: e, dateObj: t, data: r, cellWidth: c, className: y, dataClassName: m, isSelected: s, isToday: h, onClick: i, selectedClassName: v, todayClassName: g, isCurrentMonth: d, theme: E, maxEvents: f, onMoreClick: M, onEventClick: w, totalEvents: L = 0 }) {
786
+ const [b, $] = Se(!1), N = Te(null), T = s ? {
787
+ ...me.selected,
788
+ ...E?.selected
789
+ } : h ? {
790
+ ...me.today,
791
+ ...E?.today
698
792
  } : {
699
- ...ue.default,
700
- ...b?.default
701
- }, C = {
702
- color: w?.color,
703
- backgroundColor: w?.bgColor
793
+ ...me.default,
794
+ ...E?.default
795
+ }, x = {
796
+ color: T?.color,
797
+ backgroundColor: T?.bgColor
704
798
  };
705
- let F = s, R = 0;
706
- (m || m === 0) && s && (S >= m || s.length > m) && (F = s.slice(0, m), R = S - F.filter((O) => O !== null).length);
707
- const V = s?.filter((O) => O !== null) || [];
799
+ let U = r, G = 0;
800
+ (f || f === 0) && r && (L >= f || r.length > f) && (U = r.slice(0, f), G = L - U.filter((Y) => Y !== null).length);
801
+ const ae = r?.filter((Y) => Y !== null) || [];
708
802
  return /* @__PURE__ */ u.createElement("td", {
709
- style: C,
710
- onClick: () => D?.(c),
711
- className: (0, ie.default)(B.dateData, y, {
712
- [B.currentMonth]: !v,
713
- [(0, ie.default)(B.selected, d)]: r,
714
- [(0, ie.default)(B.today, A)]: f
803
+ style: x,
804
+ onClick: () => i?.(t),
805
+ className: (0, he.default)(P.dateData, y, {
806
+ [P.currentMonth]: !d,
807
+ [(0, he.default)(P.selected, v)]: s,
808
+ [(0, he.default)(P.today, g)]: h
715
809
  })
716
- }, /* @__PURE__ */ u.createElement("div", { className: B.cellContent }, /* @__PURE__ */ u.createElement("p", { className: B.dateLabel }, e), s && /* @__PURE__ */ u.createElement("div", { className: (0, ie.default)(B.dataContainer, o) }, F.map((O, G) => {
717
- if (!O || O.isSpacer) return /* @__PURE__ */ u.createElement("div", {
718
- key: `spacer-${G}`,
719
- className: B.spacer
810
+ }, /* @__PURE__ */ u.createElement("div", { className: P.cellContent }, /* @__PURE__ */ u.createElement("p", { className: P.dateLabel }, e), r && /* @__PURE__ */ u.createElement("div", { className: (0, he.default)(P.dataContainer, m) }, U.map((Y, H) => {
811
+ if (!Y || Y.isSpacer) return /* @__PURE__ */ u.createElement("div", {
812
+ key: `spacer-${H}`,
813
+ className: P.spacer
720
814
  });
721
- let k = 1, g = E(O.startDate).format("YYYY-MM-DD");
722
- O.endDateWeek && (k = E(O.endDateWeek).diff(O.startDateWeek, "days") + 1, g += ` to ${E(O.endDate).format("YYYY-MM-DD")}`), g += ` - ${O.value}`;
723
- const Z = `${i * k - 16}px`;
815
+ let S = 1, V = re(Y.startDate, "YYYY-MM-DD");
816
+ Y.endDateWeek && (S = K(Y.endDateWeek, Y.startDateWeek) + 1), Y.endDate && (V += ` to ${re(Y.endDate, "YYYY-MM-DD")}`), V += ` - ${Y.value}`;
817
+ const ce = `${c * S - ne.EVENT_ITEM_PADDING}px`;
724
818
  return /* @__PURE__ */ u.createElement("div", {
725
- key: `${O.startDate}-${G}`,
726
- className: B.eventItem,
819
+ key: `${Y.startDate}-${H}`,
820
+ className: P.eventItem,
727
821
  style: {
728
- width: Z,
729
- backgroundColor: O.color
822
+ width: ce,
823
+ backgroundColor: Y.color
730
824
  },
731
- title: g,
732
- onClick: (ne) => {
733
- ne.stopPropagation(), T?.(O);
825
+ title: V,
826
+ onClick: (_) => {
827
+ _.stopPropagation(), w?.(Y);
734
828
  }
735
- }, O.value);
736
- }), R > 0 && /* @__PURE__ */ u.createElement("div", { className: B.moreEventsContainer }, /* @__PURE__ */ u.createElement("button", {
737
- className: B.moreEvents,
738
- onClick: (O) => {
739
- O.stopPropagation(), !L && N(!0), $?.(c);
829
+ }, Y.value);
830
+ }), G > 0 && /* @__PURE__ */ u.createElement("div", { className: P.moreEventsContainer }, /* @__PURE__ */ u.createElement("button", {
831
+ ref: N,
832
+ className: P.moreEvents,
833
+ onClick: (Y) => {
834
+ Y.stopPropagation(), !b && $(!0), M?.(t);
740
835
  }
741
- }, "+ ", R, " more"), L && /* @__PURE__ */ u.createElement(pt, {
742
- dateObj: c,
743
- events: V,
744
- onEventClick: T,
745
- onClose: () => N(!1)
836
+ }, "+ ", G, " more"), b && /* @__PURE__ */ u.createElement(Rt, {
837
+ dateObj: t,
838
+ events: ae,
839
+ onEventClick: w,
840
+ onClose: () => $(!1),
841
+ anchorEl: N.current
746
842
  })))));
747
843
  }
748
- var Dt = yt;
749
- const Et = "_header_7f1ps_1", bt = "_navigation_7f1ps_11", gt = "_todayButton_7f1ps_17", St = "_arrows_7f1ps_35", Lt = "_iconButton_7f1ps_41", At = "_dateTitle_7f1ps_61", Mt = "_controls_7f1ps_70", wt = "_select_7f1ps_76";
844
+ var Ut = xt;
845
+ const It = "_header_7f1ps_1", Wt = "_navigation_7f1ps_11", Bt = "_todayButton_7f1ps_17", Pt = "_arrows_7f1ps_35", jt = "_iconButton_7f1ps_41", Gt = "_dateTitle_7f1ps_61", Vt = "_controls_7f1ps_70", Jt = "_select_7f1ps_76";
750
846
  var j = {
751
- header: Et,
752
- navigation: bt,
753
- todayButton: gt,
754
- arrows: St,
755
- iconButton: Lt,
756
- dateTitle: At,
757
- controls: Mt,
758
- select: wt
847
+ header: It,
848
+ navigation: Wt,
849
+ todayButton: Bt,
850
+ arrows: Pt,
851
+ iconButton: jt,
852
+ dateTitle: Gt,
853
+ controls: Vt,
854
+ select: Jt
759
855
  };
760
- function Ct() {
856
+ function qt() {
761
857
  return /* @__PURE__ */ u.createElement("svg", {
762
858
  width: "40px",
763
859
  height: "40px",
@@ -781,8 +877,8 @@ function Ct() {
781
877
  strokeLinejoin: "round"
782
878
  })));
783
879
  }
784
- var $t = Ct;
785
- function Nt() {
880
+ var zt = qt;
881
+ function Zt() {
786
882
  return /* @__PURE__ */ u.createElement("svg", {
787
883
  width: "40px",
788
884
  height: "40px",
@@ -805,196 +901,200 @@ function Nt() {
805
901
  strokeLinejoin: "round"
806
902
  })));
807
903
  }
808
- var Ot = Nt, fe = {
809
- currentDate: E(),
810
- selectedDate: E(),
904
+ var Kt = Zt, ye = {
905
+ currentDate: q(),
906
+ selectedDate: q(),
811
907
  view: "month",
812
908
  events: []
813
- }, De = be(void 0);
814
- function Tt(e, c) {
815
- switch (c.type) {
909
+ }, Oe = Fe(void 0);
910
+ function Xt(e, t) {
911
+ switch (t.type) {
816
912
  case "SET_DATE":
817
913
  return {
818
914
  ...e,
819
- currentDate: c.payload,
820
- selectedDate: c.payload
915
+ currentDate: t.payload,
916
+ selectedDate: t.payload
821
917
  };
822
918
  case "SET_VIEW":
823
919
  return {
824
920
  ...e,
825
- view: c.payload
921
+ view: t.payload
826
922
  };
827
923
  case "SET_EVENTS":
828
924
  return {
829
925
  ...e,
830
- events: c.payload
926
+ events: t.payload
831
927
  };
832
928
  case "NEXT": {
833
- let s = e.currentDate;
834
- return e.view === "month" ? s = s.add(1, "month") : e.view === "week" ? s = s.add(1, "week") : e.view === "day" && (s = s.add(1, "day")), {
929
+ let r = e.currentDate;
930
+ return e.view === "month" ? r = r.add(1, "month") : e.view === "week" ? r = r.add(1, "week") : e.view === "day" && (r = r.add(1, "day")), {
835
931
  ...e,
836
- currentDate: s
932
+ currentDate: r
837
933
  };
838
934
  }
839
935
  case "PREV": {
840
- let s = e.currentDate;
841
- return e.view === "month" ? s = s.subtract(1, "month") : e.view === "week" ? s = s.subtract(1, "week") : e.view === "day" && (s = s.subtract(1, "day")), {
936
+ let r = e.currentDate;
937
+ return e.view === "month" ? r = r.subtract(1, "month") : e.view === "week" ? r = r.subtract(1, "week") : e.view === "day" && (r = r.subtract(1, "day")), {
842
938
  ...e,
843
- currentDate: s
939
+ currentDate: r
844
940
  };
845
941
  }
846
942
  case "TODAY":
847
943
  return {
848
944
  ...e,
849
- currentDate: E(),
850
- selectedDate: E()
945
+ currentDate: q(),
946
+ selectedDate: q()
851
947
  };
852
948
  default:
853
949
  return e;
854
950
  }
855
951
  }
856
- function kt({ children: e, initialEvents: c = [], initialDate: s }) {
857
- const [i, y] = Ae(Tt, {
858
- ...fe,
859
- events: c,
860
- currentDate: s || fe.currentDate,
861
- selectedDate: s || fe.selectedDate
862
- }), o = me(() => ({
863
- state: i,
952
+ function Qt({ children: e, initialEvents: t = [], initialDate: r }) {
953
+ const [c, y] = We(Xt, {
954
+ ...ye,
955
+ events: t,
956
+ currentDate: r || ye.currentDate,
957
+ selectedDate: r || ye.selectedDate
958
+ }), m = _e(() => ({
959
+ state: c,
864
960
  dispatch: y
865
- }), [i]);
866
- return /* @__PURE__ */ u.createElement(De.Provider, { value: o }, e);
961
+ }), [c]);
962
+ return /* @__PURE__ */ u.createElement(Oe.Provider, { value: m }, e);
867
963
  }
868
- const Ee = () => {
869
- const e = Le(De);
964
+ const ke = () => {
965
+ const e = Ue(Oe);
870
966
  if (e === void 0) throw new Error("useCalendar must be used within a CalendarProvider");
871
967
  return e;
872
968
  };
873
- var Yt = /* @__PURE__ */ re(de());
874
- function Ht({ headerClassName: e, pastYearLength: c = 5, futureYearLength: s = 5, onMonthChange: i }) {
875
- const { state: y, dispatch: o } = Ee(), { currentDate: r } = y, f = (d) => {
876
- if (d === oe.add) {
877
- o({ type: "NEXT" });
878
- const A = r.add(1, "month");
879
- i?.(K(A));
880
- } else if (d === oe.sub) {
881
- o({ type: "PREV" });
882
- const A = r.subtract(1, "month");
883
- i?.(K(A));
969
+ var en = /* @__PURE__ */ ie(pe(), 1);
970
+ function tn({ headerClassName: e, pastYearLength: t = 5, futureYearLength: r = 5, onMonthChange: c }) {
971
+ const { state: y, dispatch: m } = ke(), { currentDate: s } = y, h = (v) => {
972
+ if (v === ue.add) {
973
+ m({ type: "NEXT" });
974
+ const g = nt(s, 1);
975
+ c?.(te(g));
976
+ } else if (v === ue.sub) {
977
+ m({ type: "PREV" });
978
+ const g = rt(s, 1);
979
+ c?.(te(g));
884
980
  }
885
- }, D = (d, A) => {
886
- const v = Number(d.target.value);
887
- let b = r;
888
- A === ce.month ? b = E(r).month(v) : A === ce.year && (b = E(r).year(v)), o({
981
+ }, i = (v, g) => {
982
+ const d = Number(v.target.value);
983
+ let E = s;
984
+ g === de.month ? E = st(s, d) : g === de.year && (E = ot(s, d)), m({
889
985
  type: "SET_DATE",
890
- payload: b
891
- }), i?.(K(b));
986
+ payload: E
987
+ }), c?.(te(E));
892
988
  };
893
- return /* @__PURE__ */ u.createElement("div", { className: (0, Yt.default)(j.header, e) }, /* @__PURE__ */ u.createElement("div", { className: j.navigation }, /* @__PURE__ */ u.createElement("button", {
989
+ return /* @__PURE__ */ u.createElement("div", { className: (0, en.default)(j.header, e) }, /* @__PURE__ */ u.createElement("div", { className: j.navigation }, /* @__PURE__ */ u.createElement("button", {
894
990
  className: j.todayButton,
895
991
  onClick: () => {
896
- o({ type: "TODAY" }), i?.(K(E()));
992
+ m({ type: "TODAY" }), c?.(te(q()));
897
993
  }
898
994
  }, "Today"), /* @__PURE__ */ u.createElement("div", { className: j.arrows }, /* @__PURE__ */ u.createElement("button", {
899
995
  className: j.iconButton,
900
- onClick: () => f(oe.sub)
901
- }, /* @__PURE__ */ u.createElement($t, null)), /* @__PURE__ */ u.createElement("button", {
996
+ onClick: () => h(ue.sub)
997
+ }, /* @__PURE__ */ u.createElement(zt, null)), /* @__PURE__ */ u.createElement("button", {
902
998
  className: j.iconButton,
903
- onClick: () => f(oe.add)
904
- }, /* @__PURE__ */ u.createElement(Ot, null))), /* @__PURE__ */ u.createElement("h2", { className: j.dateTitle }, r.format("MMMM YYYY"))), /* @__PURE__ */ u.createElement("div", { className: j.controls }, /* @__PURE__ */ u.createElement("select", {
999
+ onClick: () => h(ue.add)
1000
+ }, /* @__PURE__ */ u.createElement(Kt, null))), /* @__PURE__ */ u.createElement("h2", { className: j.dateTitle }, re(s, "MMMM YYYY"))), /* @__PURE__ */ u.createElement("div", { className: j.controls }, /* @__PURE__ */ u.createElement("select", {
905
1001
  className: j.select,
906
- id: le.MONTH,
907
- name: le.MONTH,
908
- value: r.month(),
909
- onChange: (d) => D(d, ce.month)
910
- }, Re.map((d) => /* @__PURE__ */ u.createElement("option", {
911
- key: d.label,
912
- value: d.value
913
- }, d.label))), /* @__PURE__ */ u.createElement("select", {
1002
+ id: fe.MONTH,
1003
+ name: fe.MONTH,
1004
+ value: it(s),
1005
+ onChange: (v) => i(v, de.month)
1006
+ }, Xe.map((v) => /* @__PURE__ */ u.createElement("option", {
1007
+ key: v.label,
1008
+ value: v.value
1009
+ }, v.label))), /* @__PURE__ */ u.createElement("select", {
914
1010
  className: j.select,
915
- id: le.YEAR,
916
- name: le.YEAR,
917
- value: r.year(),
918
- onChange: (d) => D(d, ce.year)
919
- }, Ie(c, s, r.year()).map((d) => /* @__PURE__ */ u.createElement("option", {
920
- key: d,
921
- value: d
922
- }, d)))));
923
- }
924
- var Ft = Ht, he = /* @__PURE__ */ re(de());
925
- function xt({ dayType: e, width: c, height: s, onDateClick: i, onEventClick: y, onMoreClick: o, onMonthChange: r, isSelectDate: f, data: D, ...d }) {
926
- const { state: A, dispatch: v } = Ee(), { currentDate: b, events: m } = A;
927
- ve(() => {
928
- D && v({
1011
+ id: fe.YEAR,
1012
+ name: fe.YEAR,
1013
+ value: $e(s),
1014
+ onChange: (v) => i(v, de.year)
1015
+ }, et(t, r, $e(s)).map((v) => /* @__PURE__ */ u.createElement("option", {
1016
+ key: v,
1017
+ value: v
1018
+ }, v)))));
1019
+ }
1020
+ var nn = tn, Ee = /* @__PURE__ */ ie(pe(), 1);
1021
+ function rn({ dayType: e, width: t, height: r, onDateClick: c, onEventClick: y, onMoreClick: m, isSelectDate: s, data: h, ...i }) {
1022
+ const { state: v, dispatch: g } = ke(), { currentDate: d, events: E } = v;
1023
+ be(() => {
1024
+ h && g({
929
1025
  type: "SET_EVENTS",
930
- payload: D
1026
+ payload: h
931
1027
  });
932
- }, [D]);
933
- const $ = me(() => Pe(b, m), [b, m]), T = Se((S) => {
934
- const L = E(S);
935
- i?.(K(L)), f && !L.isSame(b, "day") && v({
1028
+ }, [h]);
1029
+ const f = _e(() => lt(d, E), [d, E]), M = _e(() => i.maxEvents ?? ut(r, f.length || ne.MIN_ROWS), [
1030
+ i.maxEvents,
1031
+ r,
1032
+ f.length
1033
+ ]), w = xe((L) => {
1034
+ const b = q(L);
1035
+ c?.(te(b)), s && !b.isSame(d, "day") && g({
936
1036
  type: "SET_DATE",
937
- payload: L
1037
+ payload: b
938
1038
  });
939
- }, [b, i]);
1039
+ }, [d, c]);
940
1040
  return /* @__PURE__ */ u.createElement("section", {
941
1041
  style: {
942
- "--calendar-width": `${c}px`,
943
- "--calendar-height": `${s}px`
1042
+ "--calendar-width": `${t}px`,
1043
+ "--calendar-height": `${r}px`,
1044
+ "--calendar-rows": f.length || ne.DEFAULT_ROWS
944
1045
  },
945
- className: (0, he.default)(Q.calendar, d.className)
946
- }, /* @__PURE__ */ u.createElement(Ft, {
947
- headerClassName: d.headerClassName,
948
- onMonthChange: r,
949
- pastYearLength: d.pastYearLength,
950
- futureYearLength: d.futureYearLength
951
- }), /* @__PURE__ */ u.createElement("table", { className: (0, he.default)(Q.table, d.tableClassName) }, /* @__PURE__ */ u.createElement("thead", null, /* @__PURE__ */ u.createElement("tr", null, Fe[e].map((S) => /* @__PURE__ */ u.createElement("th", {
952
- key: S,
953
- className: Q.tableHeader
954
- }, S)))), /* @__PURE__ */ u.createElement("tbody", { className: Q.tableBody }, $.map((S, L) => /* @__PURE__ */ u.createElement("tr", { key: L }, S.map((N, w) => /* @__PURE__ */ u.createElement(Dt, {
955
- key: `date_${L}_${w}`,
956
- isSelected: f && N.isCurrentMonth && N.displayDay === b.date(),
957
- isToday: N.isToday,
958
- isCurrentMonth: N.isCurrentMonth,
959
- onClick: T,
960
- date: N.displayDay,
961
- dateObj: N.currentDate,
962
- data: N.events,
963
- cellWidth: c / 7,
964
- className: (0, he.default)(Q.tableCell, d.tableDateClassName),
965
- dataClassName: d.dataClassName,
966
- selectedClassName: d.selectedClassName,
967
- todayClassName: d.todayClassName,
968
- theme: d.theme,
969
- maxEvents: d.maxEvents,
970
- totalEvents: N.totalEvents,
1046
+ className: (0, Ee.default)(ee.calendar, i.className)
1047
+ }, /* @__PURE__ */ u.createElement(nn, {
1048
+ headerClassName: i.headerClassName,
1049
+ onMonthChange: i.onMonthChange,
1050
+ pastYearLength: i.pastYearLength,
1051
+ futureYearLength: i.futureYearLength
1052
+ }), /* @__PURE__ */ u.createElement("table", { className: (0, Ee.default)(ee.table, i.tableClassName) }, /* @__PURE__ */ u.createElement("thead", null, /* @__PURE__ */ u.createElement("tr", null, Ze[e].map((L) => /* @__PURE__ */ u.createElement("th", {
1053
+ key: L,
1054
+ className: ee.tableHeader
1055
+ }, L)))), /* @__PURE__ */ u.createElement("tbody", { className: ee.tableBody }, f.map((L, b) => /* @__PURE__ */ u.createElement("tr", { key: b }, L.map(($, N) => /* @__PURE__ */ u.createElement(Ut, {
1056
+ key: `date_${b}_${N}`,
1057
+ isSelected: s && $.isCurrentMonth && $.displayDay === d.date(),
1058
+ isToday: $.isToday,
1059
+ isCurrentMonth: $.isCurrentMonth,
1060
+ onClick: w,
1061
+ date: $.displayDay,
1062
+ dateObj: $.currentDate,
1063
+ data: $.events,
1064
+ cellWidth: t / ne.DAYS_IN_WEEK,
1065
+ className: (0, Ee.default)(ee.tableCell, i.tableDateClassName),
1066
+ dataClassName: i.dataClassName,
1067
+ selectedClassName: i.selectedClassName,
1068
+ todayClassName: i.todayClassName,
1069
+ theme: i.theme,
1070
+ maxEvents: M,
1071
+ totalEvents: $.totalEvents,
971
1072
  onEventClick: y,
972
- onMoreClick: (C) => o?.(K(C))
1073
+ onMoreClick: (T) => m?.(te(T))
973
1074
  })))))));
974
1075
  }
975
- function Rt(e = _e) {
976
- const c = u.useRef(null), { width: s, height: i } = Ge(c), y = {
977
- ..._e,
1076
+ function an(e = Me) {
1077
+ const t = u.useRef(null), { width: r, height: c } = dt(t), y = {
1078
+ ...Me,
978
1079
  ...e
979
- }, { data: o, selectedDate: r } = y, f = e.width ?? s ?? 0, D = (e.height ?? i ?? 0) - 120, d = me(() => r ? We(r) : void 0, [r]), A = y.maxEvents ?? Ve(D);
980
- return /* @__PURE__ */ u.createElement(kt, {
981
- initialEvents: o,
982
- initialDate: d
1080
+ }, { data: m, selectedDate: s } = y, h = e.width ?? r ?? 0, i = (e.height ?? c ?? 0) - ne.HEADER_HEIGHT, v = _e(() => s ? q(s) : void 0, [s]);
1081
+ return /* @__PURE__ */ u.createElement(Qt, {
1082
+ initialEvents: m,
1083
+ initialDate: v
983
1084
  }, /* @__PURE__ */ u.createElement("div", {
984
- ref: c,
985
- className: Q.calendarContainer
986
- }, /* @__PURE__ */ u.createElement(xt, {
1085
+ ref: t,
1086
+ className: ee.calendarContainer
1087
+ }, /* @__PURE__ */ u.createElement(rn, {
987
1088
  ...y,
988
- width: f,
989
- height: D,
990
- maxEvents: A
1089
+ width: h,
1090
+ height: i
991
1091
  })));
992
1092
  }
993
- var Ut = ge(Rt), Bt = Ut;
1093
+ var sn = Re(an), ln = sn;
994
1094
  export {
995
- It as DAY_TYPE,
996
- He as EDayType,
997
- Bt as default
1095
+ cn as DAY_TYPE,
1096
+ ze as EDayType,
1097
+ ln as default
998
1098
  };
999
1099
 
1000
1100
  //# sourceMappingURL=index.es.js.map