@asafarim/booking-calendar 0.2.1 → 0.4.1

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.js CHANGED
@@ -1,6 +1,6 @@
1
- import Xe, { useState as k, useEffect as St, useCallback as me } from "react";
2
- import { startOfMonth as Je, endOfMonth as ze, startOfWeek as he, endOfWeek as Ke, eachDayOfInterval as Ge, isSameMonth as Nt, isToday as pe, format as L, isSameDay as ee, startOfDay as Rt, differenceInMinutes as Ve, addDays as Ze, addMinutes as Qe } from "date-fns";
3
- var ve = { exports: {} }, Z = {};
1
+ import Ze, { useState as _, useEffect as Te, useRef as Xe, useCallback as he } from "react";
2
+ import { startOfMonth as ke, endOfMonth as Re, startOfWeek as ne, endOfWeek as _e, eachDayOfInterval as Qe, isSameMonth as et, isToday as ae, format as H, isSameDay as Q, startOfDay as Dt, differenceInMinutes as ze, addDays as Oe, addMinutes as tt } from "date-fns";
3
+ var De = { exports: {} }, te = {};
4
4
  /**
5
5
  * @license React
6
6
  * react-jsx-runtime.production.min.js
@@ -10,21 +10,21 @@ var ve = { exports: {} }, Z = {};
10
10
  * This source code is licensed under the MIT license found in the
11
11
  * LICENSE file in the root directory of this source tree.
12
12
  */
13
- var Ue;
14
- function Dt() {
15
- if (Ue) return Z;
16
- Ue = 1;
17
- var a = Xe, j = Symbol.for("react.element"), C = Symbol.for("react.fragment"), b = Object.prototype.hasOwnProperty, y = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, v = { key: !0, ref: !0, __self: !0, __source: !0 };
18
- function c(d, l, S) {
19
- var f, E = {}, g = null, u = null;
20
- S !== void 0 && (g = "" + S), l.key !== void 0 && (g = "" + l.key), l.ref !== void 0 && (u = l.ref);
21
- for (f in l) b.call(l, f) && !v.hasOwnProperty(f) && (E[f] = l[f]);
22
- if (d && d.defaultProps) for (f in l = d.defaultProps, l) E[f] === void 0 && (E[f] = l[f]);
23
- return { $$typeof: j, type: d, key: g, ref: u, props: E, _owner: y.current };
13
+ var Ke;
14
+ function kt() {
15
+ if (Ke) return te;
16
+ Ke = 1;
17
+ var a = Ze, y = Symbol.for("react.element"), E = Symbol.for("react.fragment"), w = Object.prototype.hasOwnProperty, p = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, m = { key: !0, ref: !0, __self: !0, __source: !0 };
18
+ function o(f, c, S) {
19
+ var v, C = {}, j = null, d = null;
20
+ S !== void 0 && (j = "" + S), c.key !== void 0 && (j = "" + c.key), c.ref !== void 0 && (d = c.ref);
21
+ for (v in c) w.call(c, v) && !m.hasOwnProperty(v) && (C[v] = c[v]);
22
+ if (f && f.defaultProps) for (v in c = f.defaultProps, c) C[v] === void 0 && (C[v] = c[v]);
23
+ return { $$typeof: y, type: f, key: j, ref: d, props: C, _owner: p.current };
24
24
  }
25
- return Z.Fragment = C, Z.jsx = c, Z.jsxs = c, Z;
25
+ return te.Fragment = E, te.jsx = o, te.jsxs = o, te;
26
26
  }
27
- var Q = {};
27
+ var re = {};
28
28
  /**
29
29
  * @license React
30
30
  * react-jsx-runtime.development.js
@@ -34,91 +34,91 @@ var Q = {};
34
34
  * This source code is licensed under the MIT license found in the
35
35
  * LICENSE file in the root directory of this source tree.
36
36
  */
37
- var qe;
38
- function _t() {
39
- return qe || (qe = 1, process.env.NODE_ENV !== "production" && function() {
40
- var a = Xe, j = Symbol.for("react.element"), C = Symbol.for("react.portal"), b = Symbol.for("react.fragment"), y = Symbol.for("react.strict_mode"), v = Symbol.for("react.profiler"), c = Symbol.for("react.provider"), d = Symbol.for("react.context"), l = Symbol.for("react.forward_ref"), S = Symbol.for("react.suspense"), f = Symbol.for("react.suspense_list"), E = Symbol.for("react.memo"), g = Symbol.for("react.lazy"), u = Symbol.for("react.offscreen"), s = Symbol.iterator, h = "@@iterator";
37
+ var Ge;
38
+ function Rt() {
39
+ return Ge || (Ge = 1, process.env.NODE_ENV !== "production" && function() {
40
+ var a = Ze, y = Symbol.for("react.element"), E = Symbol.for("react.portal"), w = Symbol.for("react.fragment"), p = Symbol.for("react.strict_mode"), m = Symbol.for("react.profiler"), o = Symbol.for("react.provider"), f = Symbol.for("react.context"), c = Symbol.for("react.forward_ref"), S = Symbol.for("react.suspense"), v = Symbol.for("react.suspense_list"), C = Symbol.for("react.memo"), j = Symbol.for("react.lazy"), d = Symbol.for("react.offscreen"), i = Symbol.iterator, b = "@@iterator";
41
41
  function O(e) {
42
42
  if (e === null || typeof e != "object")
43
43
  return null;
44
- var r = s && e[s] || e[h];
44
+ var r = i && e[i] || e[b];
45
45
  return typeof r == "function" ? r : null;
46
46
  }
47
- var R = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
48
- function w(e) {
47
+ var k = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
48
+ function s(e) {
49
49
  {
50
- for (var r = arguments.length, n = new Array(r > 1 ? r - 1 : 0), o = 1; o < r; o++)
51
- n[o - 1] = arguments[o];
52
- I("error", e, n);
50
+ for (var r = arguments.length, n = new Array(r > 1 ? r - 1 : 0), u = 1; u < r; u++)
51
+ n[u - 1] = arguments[u];
52
+ T("error", e, n);
53
53
  }
54
54
  }
55
- function I(e, r, n) {
55
+ function T(e, r, n) {
56
56
  {
57
- var o = R.ReactDebugCurrentFrame, x = o.getStackAddendum();
58
- x !== "" && (r += "%s", n = n.concat([x]));
59
- var T = n.map(function(p) {
60
- return String(p);
57
+ var u = k.ReactDebugCurrentFrame, N = u.getStackAddendum();
58
+ N !== "" && (r += "%s", n = n.concat([N]));
59
+ var D = n.map(function(x) {
60
+ return String(x);
61
61
  });
62
- T.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, T);
62
+ D.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, D);
63
63
  }
64
64
  }
65
- var U = !1, H = !1, X = !1, J = !1, N = !1, V;
66
- V = Symbol.for("react.module.reference");
67
- function te(e) {
68
- return !!(typeof e == "string" || typeof e == "function" || e === b || e === v || N || e === y || e === S || e === f || J || e === u || U || H || X || typeof e == "object" && e !== null && (e.$$typeof === g || e.$$typeof === E || e.$$typeof === c || e.$$typeof === d || e.$$typeof === l || // This needs to include all possible module reference object
65
+ var A = !1, Y = !1, V = !1, B = !1, L = !1, q;
66
+ q = Symbol.for("react.module.reference");
67
+ function z(e) {
68
+ return !!(typeof e == "string" || typeof e == "function" || e === w || e === m || L || e === p || e === S || e === v || B || e === d || A || Y || V || typeof e == "object" && e !== null && (e.$$typeof === j || e.$$typeof === C || e.$$typeof === o || e.$$typeof === f || e.$$typeof === c || // This needs to include all possible module reference object
69
69
  // types supported by any Flight configuration anywhere since
70
70
  // we don't know which Flight build this will end up being used
71
71
  // with.
72
- e.$$typeof === V || e.getModuleId !== void 0));
72
+ e.$$typeof === q || e.getModuleId !== void 0));
73
73
  }
74
- function P(e, r, n) {
75
- var o = e.displayName;
76
- if (o)
77
- return o;
78
- var x = r.displayName || r.name || "";
79
- return x !== "" ? n + "(" + x + ")" : n;
74
+ function h(e, r, n) {
75
+ var u = e.displayName;
76
+ if (u)
77
+ return u;
78
+ var N = r.displayName || r.name || "";
79
+ return N !== "" ? n + "(" + N + ")" : n;
80
80
  }
81
- function re(e) {
81
+ function K(e) {
82
82
  return e.displayName || "Context";
83
83
  }
84
84
  function $(e) {
85
85
  if (e == null)
86
86
  return null;
87
- if (typeof e.tag == "number" && w("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
87
+ if (typeof e.tag == "number" && s("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
88
88
  return e.displayName || e.name || null;
89
89
  if (typeof e == "string")
90
90
  return e;
91
91
  switch (e) {
92
- case b:
92
+ case w:
93
93
  return "Fragment";
94
- case C:
94
+ case E:
95
95
  return "Portal";
96
- case v:
96
+ case m:
97
97
  return "Profiler";
98
- case y:
98
+ case p:
99
99
  return "StrictMode";
100
100
  case S:
101
101
  return "Suspense";
102
- case f:
102
+ case v:
103
103
  return "SuspenseList";
104
104
  }
105
105
  if (typeof e == "object")
106
106
  switch (e.$$typeof) {
107
- case d:
107
+ case f:
108
108
  var r = e;
109
- return re(r) + ".Consumer";
110
- case c:
109
+ return K(r) + ".Consumer";
110
+ case o:
111
111
  var n = e;
112
- return re(n._context) + ".Provider";
113
- case l:
114
- return P(e, e.render, "ForwardRef");
115
- case E:
116
- var o = e.displayName || null;
117
- return o !== null ? o : $(e.type) || "Memo";
118
- case g: {
119
- var x = e, T = x._payload, p = x._init;
112
+ return K(n._context) + ".Provider";
113
+ case c:
114
+ return h(e, e.render, "ForwardRef");
115
+ case C:
116
+ var u = e.displayName || null;
117
+ return u !== null ? u : $(e.type) || "Memo";
118
+ case j: {
119
+ var N = e, D = N._payload, x = N._init;
120
120
  try {
121
- return $(p(T));
121
+ return $(x(D));
122
122
  } catch {
123
123
  return null;
124
124
  }
@@ -126,18 +126,18 @@ function _t() {
126
126
  }
127
127
  return null;
128
128
  }
129
- var F = Object.assign, W = 0, ne, ae, se, ie, i, B, oe;
130
- function ce() {
129
+ var F = Object.assign, J = 0, se, ie, oe, ce, l, U, le;
130
+ function ue() {
131
131
  }
132
- ce.__reactDisabledLog = !0;
132
+ ue.__reactDisabledLog = !0;
133
133
  function be() {
134
134
  {
135
- if (W === 0) {
136
- ne = console.log, ae = console.info, se = console.warn, ie = console.error, i = console.group, B = console.groupCollapsed, oe = console.groupEnd;
135
+ if (J === 0) {
136
+ se = console.log, ie = console.info, oe = console.warn, ce = console.error, l = console.group, U = console.groupCollapsed, le = console.groupEnd;
137
137
  var e = {
138
138
  configurable: !0,
139
139
  enumerable: !0,
140
- value: ce,
140
+ value: ue,
141
141
  writable: !0
142
142
  };
143
143
  Object.defineProperties(console, {
@@ -150,12 +150,12 @@ function _t() {
150
150
  groupEnd: e
151
151
  });
152
152
  }
153
- W++;
153
+ J++;
154
154
  }
155
155
  }
156
- function ye() {
156
+ function ge() {
157
157
  {
158
- if (W--, W === 0) {
158
+ if (J--, J === 0) {
159
159
  var e = {
160
160
  configurable: !0,
161
161
  enumerable: !0,
@@ -163,237 +163,237 @@ function _t() {
163
163
  };
164
164
  Object.defineProperties(console, {
165
165
  log: F({}, e, {
166
- value: ne
166
+ value: se
167
167
  }),
168
168
  info: F({}, e, {
169
- value: ae
169
+ value: ie
170
170
  }),
171
171
  warn: F({}, e, {
172
- value: se
172
+ value: oe
173
173
  }),
174
174
  error: F({}, e, {
175
- value: ie
175
+ value: ce
176
176
  }),
177
177
  group: F({}, e, {
178
- value: i
178
+ value: l
179
179
  }),
180
180
  groupCollapsed: F({}, e, {
181
- value: B
181
+ value: U
182
182
  }),
183
183
  groupEnd: F({}, e, {
184
- value: oe
184
+ value: le
185
185
  })
186
186
  });
187
187
  }
188
- W < 0 && w("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
188
+ J < 0 && s("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
189
189
  }
190
190
  }
191
- var xe = R.ReactCurrentDispatcher, je;
192
- function le(e, r, n) {
191
+ var ye = k.ReactCurrentDispatcher, je;
192
+ function de(e, r, n) {
193
193
  {
194
194
  if (je === void 0)
195
195
  try {
196
196
  throw Error();
197
- } catch (x) {
198
- var o = x.stack.trim().match(/\n( *(at )?)/);
199
- je = o && o[1] || "";
197
+ } catch (N) {
198
+ var u = N.stack.trim().match(/\n( *(at )?)/);
199
+ je = u && u[1] || "";
200
200
  }
201
201
  return `
202
202
  ` + je + e;
203
203
  }
204
204
  }
205
- var we = !1, ue;
205
+ var xe = !1, fe;
206
206
  {
207
- var tt = typeof WeakMap == "function" ? WeakMap : Map;
208
- ue = new tt();
207
+ var nt = typeof WeakMap == "function" ? WeakMap : Map;
208
+ fe = new nt();
209
209
  }
210
- function Re(e, r) {
211
- if (!e || we)
210
+ function Pe(e, r) {
211
+ if (!e || xe)
212
212
  return "";
213
213
  {
214
- var n = ue.get(e);
214
+ var n = fe.get(e);
215
215
  if (n !== void 0)
216
216
  return n;
217
217
  }
218
- var o;
219
- we = !0;
220
- var x = Error.prepareStackTrace;
218
+ var u;
219
+ xe = !0;
220
+ var N = Error.prepareStackTrace;
221
221
  Error.prepareStackTrace = void 0;
222
- var T;
223
- T = xe.current, xe.current = null, be();
222
+ var D;
223
+ D = ye.current, ye.current = null, be();
224
224
  try {
225
225
  if (r) {
226
- var p = function() {
226
+ var x = function() {
227
227
  throw Error();
228
228
  };
229
- if (Object.defineProperty(p.prototype, "props", {
229
+ if (Object.defineProperty(x.prototype, "props", {
230
230
  set: function() {
231
231
  throw Error();
232
232
  }
233
233
  }), typeof Reflect == "object" && Reflect.construct) {
234
234
  try {
235
- Reflect.construct(p, []);
236
- } catch (A) {
237
- o = A;
235
+ Reflect.construct(x, []);
236
+ } catch (I) {
237
+ u = I;
238
238
  }
239
- Reflect.construct(e, [], p);
239
+ Reflect.construct(e, [], x);
240
240
  } else {
241
241
  try {
242
- p.call();
243
- } catch (A) {
244
- o = A;
242
+ x.call();
243
+ } catch (I) {
244
+ u = I;
245
245
  }
246
- e.call(p.prototype);
246
+ e.call(x.prototype);
247
247
  }
248
248
  } else {
249
249
  try {
250
250
  throw Error();
251
- } catch (A) {
252
- o = A;
251
+ } catch (I) {
252
+ u = I;
253
253
  }
254
254
  e();
255
255
  }
256
- } catch (A) {
257
- if (A && o && typeof A.stack == "string") {
258
- for (var m = A.stack.split(`
259
- `), M = o.stack.split(`
260
- `), D = m.length - 1, _ = M.length - 1; D >= 1 && _ >= 0 && m[D] !== M[_]; )
261
- _--;
262
- for (; D >= 1 && _ >= 0; D--, _--)
263
- if (m[D] !== M[_]) {
264
- if (D !== 1 || _ !== 1)
256
+ } catch (I) {
257
+ if (I && u && typeof I.stack == "string") {
258
+ for (var g = I.stack.split(`
259
+ `), M = u.stack.split(`
260
+ `), R = g.length - 1, P = M.length - 1; R >= 1 && P >= 0 && g[R] !== M[P]; )
261
+ P--;
262
+ for (; R >= 1 && P >= 0; R--, P--)
263
+ if (g[R] !== M[P]) {
264
+ if (R !== 1 || P !== 1)
265
265
  do
266
- if (D--, _--, _ < 0 || m[D] !== M[_]) {
267
- var Y = `
268
- ` + m[D].replace(" at new ", " at ");
269
- return e.displayName && Y.includes("<anonymous>") && (Y = Y.replace("<anonymous>", e.displayName)), typeof e == "function" && ue.set(e, Y), Y;
266
+ if (R--, P--, P < 0 || g[R] !== M[P]) {
267
+ var W = `
268
+ ` + g[R].replace(" at new ", " at ");
269
+ return e.displayName && W.includes("<anonymous>") && (W = W.replace("<anonymous>", e.displayName)), typeof e == "function" && fe.set(e, W), W;
270
270
  }
271
- while (D >= 1 && _ >= 0);
271
+ while (R >= 1 && P >= 0);
272
272
  break;
273
273
  }
274
274
  }
275
275
  } finally {
276
- we = !1, xe.current = T, ye(), Error.prepareStackTrace = x;
276
+ xe = !1, ye.current = D, ge(), Error.prepareStackTrace = N;
277
277
  }
278
- var K = e ? e.displayName || e.name : "", q = K ? le(K) : "";
279
- return typeof e == "function" && ue.set(e, q), q;
278
+ var Z = e ? e.displayName || e.name : "", X = Z ? de(Z) : "";
279
+ return typeof e == "function" && fe.set(e, X), X;
280
280
  }
281
- function rt(e, r, n) {
282
- return Re(e, !1);
281
+ function at(e, r, n) {
282
+ return Pe(e, !1);
283
283
  }
284
- function nt(e) {
284
+ function st(e) {
285
285
  var r = e.prototype;
286
286
  return !!(r && r.isReactComponent);
287
287
  }
288
- function de(e, r, n) {
288
+ function me(e, r, n) {
289
289
  if (e == null)
290
290
  return "";
291
291
  if (typeof e == "function")
292
- return Re(e, nt(e));
292
+ return Pe(e, st(e));
293
293
  if (typeof e == "string")
294
- return le(e);
294
+ return de(e);
295
295
  switch (e) {
296
296
  case S:
297
- return le("Suspense");
298
- case f:
299
- return le("SuspenseList");
297
+ return de("Suspense");
298
+ case v:
299
+ return de("SuspenseList");
300
300
  }
301
301
  if (typeof e == "object")
302
302
  switch (e.$$typeof) {
303
- case l:
304
- return rt(e.render);
305
- case E:
306
- return de(e.type, r, n);
307
- case g: {
308
- var o = e, x = o._payload, T = o._init;
303
+ case c:
304
+ return at(e.render);
305
+ case C:
306
+ return me(e.type, r, n);
307
+ case j: {
308
+ var u = e, N = u._payload, D = u._init;
309
309
  try {
310
- return de(T(x), r, n);
310
+ return me(D(N), r, n);
311
311
  } catch {
312
312
  }
313
313
  }
314
314
  }
315
315
  return "";
316
316
  }
317
- var G = Object.prototype.hasOwnProperty, De = {}, _e = R.ReactDebugCurrentFrame;
318
- function fe(e) {
317
+ var ee = Object.prototype.hasOwnProperty, Me = {}, $e = k.ReactDebugCurrentFrame;
318
+ function ve(e) {
319
319
  if (e) {
320
- var r = e._owner, n = de(e.type, e._source, r ? r.type : null);
321
- _e.setExtraStackFrame(n);
320
+ var r = e._owner, n = me(e.type, e._source, r ? r.type : null);
321
+ $e.setExtraStackFrame(n);
322
322
  } else
323
- _e.setExtraStackFrame(null);
323
+ $e.setExtraStackFrame(null);
324
324
  }
325
- function at(e, r, n, o, x) {
325
+ function it(e, r, n, u, N) {
326
326
  {
327
- var T = Function.call.bind(G);
328
- for (var p in e)
329
- if (T(e, p)) {
330
- var m = void 0;
327
+ var D = Function.call.bind(ee);
328
+ for (var x in e)
329
+ if (D(e, x)) {
330
+ var g = void 0;
331
331
  try {
332
- if (typeof e[p] != "function") {
333
- var M = Error((o || "React class") + ": " + n + " type `" + p + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[p] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
332
+ if (typeof e[x] != "function") {
333
+ var M = Error((u || "React class") + ": " + n + " type `" + x + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[x] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
334
334
  throw M.name = "Invariant Violation", M;
335
335
  }
336
- m = e[p](r, p, o, n, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
337
- } catch (D) {
338
- m = D;
336
+ g = e[x](r, x, u, n, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
337
+ } catch (R) {
338
+ g = R;
339
339
  }
340
- m && !(m instanceof Error) && (fe(x), w("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", o || "React class", n, p, typeof m), fe(null)), m instanceof Error && !(m.message in De) && (De[m.message] = !0, fe(x), w("Failed %s type: %s", n, m.message), fe(null));
340
+ g && !(g instanceof Error) && (ve(N), s("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", u || "React class", n, x, typeof g), ve(null)), g instanceof Error && !(g.message in Me) && (Me[g.message] = !0, ve(N), s("Failed %s type: %s", n, g.message), ve(null));
341
341
  }
342
342
  }
343
343
  }
344
- var st = Array.isArray;
345
- function Ee(e) {
346
- return st(e);
344
+ var ot = Array.isArray;
345
+ function we(e) {
346
+ return ot(e);
347
347
  }
348
- function it(e) {
348
+ function ct(e) {
349
349
  {
350
350
  var r = typeof Symbol == "function" && Symbol.toStringTag, n = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
351
351
  return n;
352
352
  }
353
353
  }
354
- function ot(e) {
354
+ function lt(e) {
355
355
  try {
356
- return ke(e), !1;
356
+ return Fe(e), !1;
357
357
  } catch {
358
358
  return !0;
359
359
  }
360
360
  }
361
- function ke(e) {
361
+ function Fe(e) {
362
362
  return "" + e;
363
363
  }
364
- function Oe(e) {
365
- if (ot(e))
366
- return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", it(e)), ke(e);
364
+ function Ie(e) {
365
+ if (lt(e))
366
+ return s("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", ct(e)), Fe(e);
367
367
  }
368
- var Pe = R.ReactCurrentOwner, ct = {
368
+ var Ae = k.ReactCurrentOwner, ut = {
369
369
  key: !0,
370
370
  ref: !0,
371
371
  __self: !0,
372
372
  __source: !0
373
- }, Me, $e;
374
- function lt(e) {
375
- if (G.call(e, "ref")) {
373
+ }, Ye, We;
374
+ function dt(e) {
375
+ if (ee.call(e, "ref")) {
376
376
  var r = Object.getOwnPropertyDescriptor(e, "ref").get;
377
377
  if (r && r.isReactWarning)
378
378
  return !1;
379
379
  }
380
380
  return e.ref !== void 0;
381
381
  }
382
- function ut(e) {
383
- if (G.call(e, "key")) {
382
+ function ft(e) {
383
+ if (ee.call(e, "key")) {
384
384
  var r = Object.getOwnPropertyDescriptor(e, "key").get;
385
385
  if (r && r.isReactWarning)
386
386
  return !1;
387
387
  }
388
388
  return e.key !== void 0;
389
389
  }
390
- function dt(e, r) {
391
- typeof e.ref == "string" && Pe.current;
390
+ function mt(e, r) {
391
+ typeof e.ref == "string" && Ae.current;
392
392
  }
393
- function ft(e, r) {
393
+ function vt(e, r) {
394
394
  {
395
395
  var n = function() {
396
- Me || (Me = !0, w("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
396
+ Ye || (Ye = !0, s("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
397
397
  };
398
398
  n.isReactWarning = !0, Object.defineProperty(e, "key", {
399
399
  get: n,
@@ -401,10 +401,10 @@ function _t() {
401
401
  });
402
402
  }
403
403
  }
404
- function mt(e, r) {
404
+ function ht(e, r) {
405
405
  {
406
406
  var n = function() {
407
- $e || ($e = !0, w("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
407
+ We || (We = !0, s("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
408
408
  };
409
409
  n.isReactWarning = !0, Object.defineProperty(e, "ref", {
410
410
  get: n,
@@ -412,70 +412,70 @@ function _t() {
412
412
  });
413
413
  }
414
414
  }
415
- var vt = function(e, r, n, o, x, T, p) {
416
- var m = {
415
+ var pt = function(e, r, n, u, N, D, x) {
416
+ var g = {
417
417
  // This tag allows us to uniquely identify this as a React Element
418
- $$typeof: j,
418
+ $$typeof: y,
419
419
  // Built-in properties that belong on the element
420
420
  type: e,
421
421
  key: r,
422
422
  ref: n,
423
- props: p,
423
+ props: x,
424
424
  // Record the component responsible for creating this element.
425
- _owner: T
425
+ _owner: D
426
426
  };
427
- return m._store = {}, Object.defineProperty(m._store, "validated", {
427
+ return g._store = {}, Object.defineProperty(g._store, "validated", {
428
428
  configurable: !1,
429
429
  enumerable: !1,
430
430
  writable: !0,
431
431
  value: !1
432
- }), Object.defineProperty(m, "_self", {
432
+ }), Object.defineProperty(g, "_self", {
433
433
  configurable: !1,
434
434
  enumerable: !1,
435
435
  writable: !1,
436
- value: o
437
- }), Object.defineProperty(m, "_source", {
436
+ value: u
437
+ }), Object.defineProperty(g, "_source", {
438
438
  configurable: !1,
439
439
  enumerable: !1,
440
440
  writable: !1,
441
- value: x
442
- }), Object.freeze && (Object.freeze(m.props), Object.freeze(m)), m;
441
+ value: N
442
+ }), Object.freeze && (Object.freeze(g.props), Object.freeze(g)), g;
443
443
  };
444
- function ht(e, r, n, o, x) {
444
+ function bt(e, r, n, u, N) {
445
445
  {
446
- var T, p = {}, m = null, M = null;
447
- n !== void 0 && (Oe(n), m = "" + n), ut(r) && (Oe(r.key), m = "" + r.key), lt(r) && (M = r.ref, dt(r, x));
448
- for (T in r)
449
- G.call(r, T) && !ct.hasOwnProperty(T) && (p[T] = r[T]);
446
+ var D, x = {}, g = null, M = null;
447
+ n !== void 0 && (Ie(n), g = "" + n), ft(r) && (Ie(r.key), g = "" + r.key), dt(r) && (M = r.ref, mt(r, N));
448
+ for (D in r)
449
+ ee.call(r, D) && !ut.hasOwnProperty(D) && (x[D] = r[D]);
450
450
  if (e && e.defaultProps) {
451
- var D = e.defaultProps;
452
- for (T in D)
453
- p[T] === void 0 && (p[T] = D[T]);
451
+ var R = e.defaultProps;
452
+ for (D in R)
453
+ x[D] === void 0 && (x[D] = R[D]);
454
454
  }
455
- if (m || M) {
456
- var _ = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
457
- m && ft(p, _), M && mt(p, _);
455
+ if (g || M) {
456
+ var P = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
457
+ g && vt(x, P), M && ht(x, P);
458
458
  }
459
- return vt(e, m, M, x, o, Pe.current, p);
459
+ return pt(e, g, M, N, u, Ae.current, x);
460
460
  }
461
461
  }
462
- var Te = R.ReactCurrentOwner, Fe = R.ReactDebugCurrentFrame;
463
- function z(e) {
462
+ var Ee = k.ReactCurrentOwner, Be = k.ReactDebugCurrentFrame;
463
+ function G(e) {
464
464
  if (e) {
465
- var r = e._owner, n = de(e.type, e._source, r ? r.type : null);
466
- Fe.setExtraStackFrame(n);
465
+ var r = e._owner, n = me(e.type, e._source, r ? r.type : null);
466
+ Be.setExtraStackFrame(n);
467
467
  } else
468
- Fe.setExtraStackFrame(null);
468
+ Be.setExtraStackFrame(null);
469
469
  }
470
- var Ce;
471
- Ce = !1;
472
- function Se(e) {
473
- return typeof e == "object" && e !== null && e.$$typeof === j;
470
+ var Ne;
471
+ Ne = !1;
472
+ function Ce(e) {
473
+ return typeof e == "object" && e !== null && e.$$typeof === y;
474
474
  }
475
- function Ae() {
475
+ function Le() {
476
476
  {
477
- if (Te.current) {
478
- var e = $(Te.current.type);
477
+ if (Ee.current) {
478
+ var e = $(Ee.current.type);
479
479
  if (e)
480
480
  return `
481
481
 
@@ -484,13 +484,13 @@ Check the render method of \`` + e + "`.";
484
484
  return "";
485
485
  }
486
486
  }
487
- function pt(e) {
487
+ function gt(e) {
488
488
  return "";
489
489
  }
490
- var Ie = {};
491
- function gt(e) {
490
+ var Ve = {};
491
+ function yt(e) {
492
492
  {
493
- var r = Ae();
493
+ var r = Le();
494
494
  if (!r) {
495
495
  var n = typeof e == "string" ? e : e.displayName || e.name;
496
496
  n && (r = `
@@ -500,39 +500,39 @@ Check the top-level render call using <` + n + ">.");
500
500
  return r;
501
501
  }
502
502
  }
503
- function Ye(e, r) {
503
+ function Je(e, r) {
504
504
  {
505
505
  if (!e._store || e._store.validated || e.key != null)
506
506
  return;
507
507
  e._store.validated = !0;
508
- var n = gt(r);
509
- if (Ie[n])
508
+ var n = yt(r);
509
+ if (Ve[n])
510
510
  return;
511
- Ie[n] = !0;
512
- var o = "";
513
- e && e._owner && e._owner !== Te.current && (o = " It was passed a child from " + $(e._owner.type) + "."), z(e), w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', n, o), z(null);
511
+ Ve[n] = !0;
512
+ var u = "";
513
+ e && e._owner && e._owner !== Ee.current && (u = " It was passed a child from " + $(e._owner.type) + "."), G(e), s('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', n, u), G(null);
514
514
  }
515
515
  }
516
- function We(e, r) {
516
+ function Ue(e, r) {
517
517
  {
518
518
  if (typeof e != "object")
519
519
  return;
520
- if (Ee(e))
520
+ if (we(e))
521
521
  for (var n = 0; n < e.length; n++) {
522
- var o = e[n];
523
- Se(o) && Ye(o, r);
522
+ var u = e[n];
523
+ Ce(u) && Je(u, r);
524
524
  }
525
- else if (Se(e))
525
+ else if (Ce(e))
526
526
  e._store && (e._store.validated = !0);
527
527
  else if (e) {
528
- var x = O(e);
529
- if (typeof x == "function" && x !== e.entries)
530
- for (var T = x.call(e), p; !(p = T.next()).done; )
531
- Se(p.value) && Ye(p.value, r);
528
+ var N = O(e);
529
+ if (typeof N == "function" && N !== e.entries)
530
+ for (var D = N.call(e), x; !(x = D.next()).done; )
531
+ Ce(x.value) && Je(x.value, r);
532
532
  }
533
533
  }
534
534
  }
535
- function bt(e) {
535
+ function jt(e) {
536
536
  {
537
537
  var r = e.type;
538
538
  if (r == null || typeof r == "string")
@@ -540,225 +540,222 @@ Check the top-level render call using <` + n + ">.");
540
540
  var n;
541
541
  if (typeof r == "function")
542
542
  n = r.propTypes;
543
- else if (typeof r == "object" && (r.$$typeof === l || // Note: Memo only checks outer props here.
543
+ else if (typeof r == "object" && (r.$$typeof === c || // Note: Memo only checks outer props here.
544
544
  // Inner props are checked in the reconciler.
545
- r.$$typeof === E))
545
+ r.$$typeof === C))
546
546
  n = r.propTypes;
547
547
  else
548
548
  return;
549
549
  if (n) {
550
- var o = $(r);
551
- at(n, e.props, "prop", o, e);
552
- } else if (r.PropTypes !== void 0 && !Ce) {
553
- Ce = !0;
554
- var x = $(r);
555
- w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", x || "Unknown");
550
+ var u = $(r);
551
+ it(n, e.props, "prop", u, e);
552
+ } else if (r.PropTypes !== void 0 && !Ne) {
553
+ Ne = !0;
554
+ var N = $(r);
555
+ s("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", N || "Unknown");
556
556
  }
557
- typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
557
+ typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && s("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
558
558
  }
559
559
  }
560
- function yt(e) {
560
+ function xt(e) {
561
561
  {
562
562
  for (var r = Object.keys(e.props), n = 0; n < r.length; n++) {
563
- var o = r[n];
564
- if (o !== "children" && o !== "key") {
565
- z(e), w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", o), z(null);
563
+ var u = r[n];
564
+ if (u !== "children" && u !== "key") {
565
+ G(e), s("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", u), G(null);
566
566
  break;
567
567
  }
568
568
  }
569
- e.ref !== null && (z(e), w("Invalid attribute `ref` supplied to `React.Fragment`."), z(null));
569
+ e.ref !== null && (G(e), s("Invalid attribute `ref` supplied to `React.Fragment`."), G(null));
570
570
  }
571
571
  }
572
- var Be = {};
573
- function Le(e, r, n, o, x, T) {
572
+ var He = {};
573
+ function qe(e, r, n, u, N, D) {
574
574
  {
575
- var p = te(e);
576
- if (!p) {
577
- var m = "";
578
- (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (m += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
579
- var M = pt();
580
- M ? m += M : m += Ae();
581
- var D;
582
- e === null ? D = "null" : Ee(e) ? D = "array" : e !== void 0 && e.$$typeof === j ? (D = "<" + ($(e.type) || "Unknown") + " />", m = " Did you accidentally export a JSX literal instead of a component?") : D = typeof e, w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", D, m);
575
+ var x = z(e);
576
+ if (!x) {
577
+ var g = "";
578
+ (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (g += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
579
+ var M = gt();
580
+ M ? g += M : g += Le();
581
+ var R;
582
+ e === null ? R = "null" : we(e) ? R = "array" : e !== void 0 && e.$$typeof === y ? (R = "<" + ($(e.type) || "Unknown") + " />", g = " Did you accidentally export a JSX literal instead of a component?") : R = typeof e, s("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", R, g);
583
583
  }
584
- var _ = ht(e, r, n, x, T);
585
- if (_ == null)
586
- return _;
587
- if (p) {
588
- var Y = r.children;
589
- if (Y !== void 0)
590
- if (o)
591
- if (Ee(Y)) {
592
- for (var K = 0; K < Y.length; K++)
593
- We(Y[K], e);
594
- Object.freeze && Object.freeze(Y);
584
+ var P = bt(e, r, n, N, D);
585
+ if (P == null)
586
+ return P;
587
+ if (x) {
588
+ var W = r.children;
589
+ if (W !== void 0)
590
+ if (u)
591
+ if (we(W)) {
592
+ for (var Z = 0; Z < W.length; Z++)
593
+ Ue(W[Z], e);
594
+ Object.freeze && Object.freeze(W);
595
595
  } else
596
- w("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
596
+ s("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
597
597
  else
598
- We(Y, e);
598
+ Ue(W, e);
599
599
  }
600
- if (G.call(r, "key")) {
601
- var q = $(e), A = Object.keys(r).filter(function(Ct) {
602
- return Ct !== "key";
603
- }), Ne = A.length > 0 ? "{key: someKey, " + A.join(": ..., ") + ": ...}" : "{key: someKey}";
604
- if (!Be[q + Ne]) {
605
- var Tt = A.length > 0 ? "{" + A.join(": ..., ") + ": ...}" : "{}";
606
- w(`A props object containing a "key" prop is being spread into JSX:
600
+ if (ee.call(r, "key")) {
601
+ var X = $(e), I = Object.keys(r).filter(function(Tt) {
602
+ return Tt !== "key";
603
+ }), Se = I.length > 0 ? "{key: someKey, " + I.join(": ..., ") + ": ...}" : "{key: someKey}";
604
+ if (!He[X + Se]) {
605
+ var St = I.length > 0 ? "{" + I.join(": ..., ") + ": ...}" : "{}";
606
+ s(`A props object containing a "key" prop is being spread into JSX:
607
607
  let props = %s;
608
608
  <%s {...props} />
609
609
  React keys must be passed directly to JSX without using spread:
610
610
  let props = %s;
611
- <%s key={someKey} {...props} />`, Ne, q, Tt, q), Be[q + Ne] = !0;
611
+ <%s key={someKey} {...props} />`, Se, X, St, X), He[X + Se] = !0;
612
612
  }
613
613
  }
614
- return e === b ? yt(_) : bt(_), _;
614
+ return e === w ? xt(P) : jt(P), P;
615
615
  }
616
616
  }
617
- function xt(e, r, n) {
618
- return Le(e, r, n, !0);
617
+ function wt(e, r, n) {
618
+ return qe(e, r, n, !0);
619
619
  }
620
- function jt(e, r, n) {
621
- return Le(e, r, n, !1);
620
+ function Et(e, r, n) {
621
+ return qe(e, r, n, !1);
622
622
  }
623
- var wt = jt, Et = xt;
624
- Q.Fragment = b, Q.jsx = wt, Q.jsxs = Et;
625
- }()), Q;
623
+ var Nt = Et, Ct = wt;
624
+ re.Fragment = w, re.jsx = Nt, re.jsxs = Ct;
625
+ }()), re;
626
626
  }
627
- var He;
628
- function kt() {
629
- return He || (He = 1, process.env.NODE_ENV === "production" ? ve.exports = Dt() : ve.exports = _t()), ve.exports;
627
+ process.env.NODE_ENV === "production" ? De.exports = kt() : De.exports = Rt();
628
+ var t = De.exports;
629
+ function pe({ status: a, size: y = "md" }) {
630
+ return /* @__PURE__ */ t.jsx("span", { className: `bc-status-badge bc-status-${a.toLowerCase()} bc-badge-${y}`, children: a });
630
631
  }
631
- var t = kt();
632
- function ge({ status: a, size: j = "md" }) {
633
- return /* @__PURE__ */ t.jsx("span", { className: `bc-status-badge bc-status-${a.toLowerCase()} bc-badge-${j}`, children: a });
634
- }
635
- function Ot({ currentDate: a, bookings: j, onSlotClick: C, onBookingClick: b }) {
636
- const y = Je(a), v = ze(a), c = he(y), d = Ke(v), l = Ge({ start: c, end: d }), S = [];
637
- for (let g = 0; g < l.length; g += 7)
638
- S.push(l.slice(g, g + 7));
639
- const f = (g) => j.filter((u) => ee(new Date(u.startTime), g)), E = (g) => {
640
- const u = new Date(g);
641
- u.setHours(9, 0, 0, 0);
642
- const s = new Date(g);
643
- s.setHours(10, 0, 0, 0), C(u, s);
632
+ function _t({ currentDate: a, bookings: y, onSlotClick: E, onBookingClick: w }) {
633
+ const p = ke(a), m = Re(a), o = ne(p), f = _e(m), c = Qe({ start: o, end: f }), S = [];
634
+ for (let j = 0; j < c.length; j += 7)
635
+ S.push(c.slice(j, j + 7));
636
+ const v = (j) => y.filter((d) => Q(new Date(d.startTime), j)), C = (j) => {
637
+ const d = new Date(j);
638
+ d.setHours(9, 0, 0, 0);
639
+ const i = new Date(j);
640
+ i.setHours(10, 0, 0, 0), E(d, i);
644
641
  };
645
642
  return /* @__PURE__ */ t.jsxs("div", { className: "bc-month-view", children: [
646
- /* @__PURE__ */ t.jsx("div", { className: "bc-month-header", children: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"].map((g) => /* @__PURE__ */ t.jsx("div", { className: "bc-month-header-cell", children: g }, g)) }),
647
- /* @__PURE__ */ t.jsx("div", { className: "bc-month-grid", children: S.map((g, u) => /* @__PURE__ */ t.jsx("div", { className: "bc-month-week", children: g.map((s) => {
648
- const h = f(s), O = Nt(s, a), R = pe(s);
643
+ /* @__PURE__ */ t.jsx("div", { className: "bc-month-header", children: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"].map((j) => /* @__PURE__ */ t.jsx("div", { className: "bc-month-header-cell", children: j }, j)) }),
644
+ /* @__PURE__ */ t.jsx("div", { className: "bc-month-grid", children: S.map((j, d) => /* @__PURE__ */ t.jsx("div", { className: "bc-month-week", children: j.map((i) => {
645
+ const b = v(i), O = et(i, a), k = ae(i);
649
646
  return /* @__PURE__ */ t.jsxs(
650
647
  "div",
651
648
  {
652
- className: `bc-month-day ${O ? "" : "bc-other-month"} ${R ? "bc-today" : ""}`,
653
- onClick: () => E(s),
649
+ className: `bc-month-day ${O ? "" : "bc-other-month"} ${k ? "bc-today" : ""}`,
650
+ onClick: () => C(i),
654
651
  children: [
655
- /* @__PURE__ */ t.jsx("div", { className: "bc-month-day-number", children: L(s, "d") }),
652
+ /* @__PURE__ */ t.jsx("div", { className: "bc-month-day-number", children: H(i, "d") }),
656
653
  /* @__PURE__ */ t.jsxs("div", { className: "bc-month-day-events", children: [
657
- h.slice(0, 3).map((w) => /* @__PURE__ */ t.jsxs(
654
+ b.slice(0, 3).map((s) => /* @__PURE__ */ t.jsxs(
658
655
  "div",
659
656
  {
660
657
  className: "bc-month-event",
661
- onClick: (I) => {
662
- I.stopPropagation(), b(w);
658
+ onClick: (T) => {
659
+ T.stopPropagation(), w(s);
663
660
  },
664
661
  children: [
665
- /* @__PURE__ */ t.jsx(ge, { status: w.status, size: "sm" }),
666
- /* @__PURE__ */ t.jsx("span", { className: "bc-month-event-title", children: w.title })
662
+ /* @__PURE__ */ t.jsx(pe, { status: s.status, size: "sm" }),
663
+ /* @__PURE__ */ t.jsx("span", { className: "bc-month-event-title", children: s.title })
667
664
  ]
668
665
  },
669
- w.id
666
+ s.id
670
667
  )),
671
- h.length > 3 && /* @__PURE__ */ t.jsxs("div", { className: "bc-month-event-more", children: [
668
+ b.length > 3 && /* @__PURE__ */ t.jsxs("div", { className: "bc-month-event-more", children: [
672
669
  "+",
673
- h.length - 3,
670
+ b.length - 3,
674
671
  " more"
675
672
  ] })
676
673
  ] })
677
674
  ]
678
675
  },
679
- s.toISOString()
676
+ i.toISOString()
680
677
  );
681
- }) }, u)) })
678
+ }) }, d)) })
682
679
  ] });
683
680
  }
684
- function et() {
685
- return { getEventPosition: (C, b) => {
686
- const y = Rt(b), v = new Date(C.startTime), c = new Date(C.endTime), d = Ve(v, y), l = Ve(c, v), S = d / 1440 * 100, f = l / 1440 * 100;
681
+ function rt() {
682
+ return { getEventPosition: (E, w) => {
683
+ const p = Dt(w), m = new Date(E.startTime), o = new Date(E.endTime), f = ze(m, p), c = ze(o, m), S = f / (24 * 60) * 100, v = c / (24 * 60) * 100;
687
684
  return {
688
685
  top: S,
689
- height: f,
686
+ height: v,
690
687
  left: 0,
691
688
  width: 95
692
689
  };
693
- }, detectOverlaps: (C, b) => {
694
- const y = C.filter((c) => new Date(c.startTime).toDateString() === b.toDateString()), v = [];
695
- return y.sort((c, d) => new Date(c.startTime).getTime() - new Date(d.startTime).getTime()), y.forEach((c) => {
696
- let d = !1;
697
- for (const l of v)
698
- if (!l.some((f) => {
699
- const E = new Date(f.startTime).getTime(), g = new Date(f.endTime).getTime(), u = new Date(c.startTime).getTime(), s = new Date(c.endTime).getTime();
700
- return E < s && u < g;
690
+ }, detectOverlaps: (E, w) => {
691
+ const p = E.filter((o) => new Date(o.startTime).toDateString() === w.toDateString()), m = [];
692
+ return p.sort((o, f) => new Date(o.startTime).getTime() - new Date(f.startTime).getTime()), p.forEach((o) => {
693
+ let f = !1;
694
+ for (const c of m)
695
+ if (!c.some((v) => {
696
+ const C = new Date(v.startTime).getTime(), j = new Date(v.endTime).getTime(), d = new Date(o.startTime).getTime(), i = new Date(o.endTime).getTime();
697
+ return C < i && d < j;
701
698
  })) {
702
- l.push(c), d = !0;
699
+ c.push(o), f = !0;
703
700
  break;
704
701
  }
705
- d || v.push([c]);
706
- }), v;
702
+ f || m.push([o]);
703
+ }), m;
707
704
  } };
708
705
  }
709
- function Pt({
706
+ function Ot({
710
707
  currentDate: a,
711
- bookings: j,
712
- onSlotClick: C,
713
- onBookingClick: b
708
+ bookings: y,
709
+ onSlotClick: E,
710
+ onBookingClick: w
714
711
  }) {
715
- const y = he(a), v = Array.from({ length: 7 }, (s, h) => Ze(y, h)), c = Array.from({ length: 24 }, (s, h) => h), d = /* @__PURE__ */ new Date(), l = v.some((s) => ee(s, d)), S = d.getHours(), f = d.getMinutes(), E = (S * 60 + f) / 1440 * 100, { getEventPosition: g } = et(), u = (s, h) => {
716
- const O = new Date(s);
717
- O.setHours(h, 0, 0, 0);
718
- const R = Qe(O, 60);
719
- C(O, R);
712
+ const p = ne(a), m = Array.from({ length: 7 }, (i, b) => Oe(p, b)), o = Array.from({ length: 24 }, (i, b) => b), f = /* @__PURE__ */ new Date(), c = m.some((i) => Q(i, f)), S = f.getHours(), v = f.getMinutes(), C = (S * 60 + v) / (24 * 60) * 100, { getEventPosition: j } = rt(), d = (i, b) => {
713
+ const O = new Date(i);
714
+ O.setHours(b, 0, 0, 0);
715
+ const k = tt(O, 60);
716
+ E(O, k);
720
717
  };
721
718
  return /* @__PURE__ */ t.jsxs("div", { className: "bc-week-view", children: [
722
719
  /* @__PURE__ */ t.jsxs("div", { className: "bc-week-header", children: [
723
720
  /* @__PURE__ */ t.jsx("div", { className: "bc-week-time-gutter" }),
724
- v.map((s) => /* @__PURE__ */ t.jsxs(
721
+ m.map((i) => /* @__PURE__ */ t.jsxs(
725
722
  "div",
726
723
  {
727
- className: `bc-week-day-header ${pe(s) ? "bc-today" : ""}`,
724
+ className: `bc-week-day-header ${ae(i) ? "bc-today" : ""}`,
728
725
  children: [
729
- /* @__PURE__ */ t.jsx("div", { className: "bc-week-day-name", children: L(s, "EEE") }),
730
- /* @__PURE__ */ t.jsx("div", { className: "bc-week-day-date", children: L(s, "d") })
726
+ /* @__PURE__ */ t.jsx("div", { className: "bc-week-day-name", children: H(i, "EEE") }),
727
+ /* @__PURE__ */ t.jsx("div", { className: "bc-week-day-date", children: H(i, "d") })
731
728
  ]
732
729
  },
733
- s.toISOString()
730
+ i.toISOString()
734
731
  ))
735
732
  ] }),
736
733
  /* @__PURE__ */ t.jsxs("div", { className: "bc-week-body", children: [
737
- /* @__PURE__ */ t.jsx("div", { className: "bc-week-time-column", children: c.map((s) => /* @__PURE__ */ t.jsx("div", { className: "bc-week-time-slot", children: L((/* @__PURE__ */ new Date()).setHours(s, 0), "ha") }, s)) }),
734
+ /* @__PURE__ */ t.jsx("div", { className: "bc-week-time-column", children: o.map((i) => /* @__PURE__ */ t.jsx("div", { className: "bc-week-time-slot", children: H((/* @__PURE__ */ new Date()).setHours(i, 0), "ha") }, i)) }),
738
735
  /* @__PURE__ */ t.jsxs("div", { className: "bc-week-grid-container", children: [
739
- l && ee(v[d.getDay()], d) && /* @__PURE__ */ t.jsx(
736
+ c && Q(m[f.getDay()], f) && /* @__PURE__ */ t.jsx(
740
737
  "div",
741
738
  {
742
739
  className: "bc-week-now-line",
743
- style: { top: `${E}%` },
740
+ style: { top: `${C}%` },
744
741
  children: /* @__PURE__ */ t.jsx("div", { className: "bc-week-now-dot" })
745
742
  }
746
743
  ),
747
- v.map((s) => /* @__PURE__ */ t.jsxs(
744
+ m.map((i) => /* @__PURE__ */ t.jsxs(
748
745
  "div",
749
746
  {
750
- className: `bc-week-day-column ${pe(s) ? "bc-today" : ""}`,
747
+ className: `bc-week-day-column ${ae(i) ? "bc-today" : ""}`,
751
748
  children: [
752
- c.map((h) => /* @__PURE__ */ t.jsx(
749
+ o.map((b) => /* @__PURE__ */ t.jsx(
753
750
  "div",
754
751
  {
755
752
  className: "bc-week-grid-slot",
756
- onClick: () => u(s, h)
753
+ onClick: () => d(i, b)
757
754
  },
758
- h
755
+ b
759
756
  )),
760
- j.filter((h) => ee(new Date(h.startTime), s)).map((h) => {
761
- const O = g(h, s);
757
+ y.filter((b) => Q(new Date(b.startTime), i)).map((b) => {
758
+ const O = j(b, i);
762
759
  return /* @__PURE__ */ t.jsxs(
763
760
  "div",
764
761
  {
@@ -769,75 +766,75 @@ function Pt({
769
766
  left: `${O.left}%`,
770
767
  width: `${O.width}%`
771
768
  },
772
- onClick: (R) => {
773
- R.stopPropagation(), b(h);
769
+ onClick: (k) => {
770
+ k.stopPropagation(), w(b);
774
771
  },
775
772
  children: [
776
- /* @__PURE__ */ t.jsx(ge, { status: h.status, size: "xs" }),
777
- /* @__PURE__ */ t.jsx("div", { className: "bc-week-event-title", children: h.title }),
778
- /* @__PURE__ */ t.jsx("div", { className: "bc-week-event-time", children: L(new Date(h.startTime), "h:mm a") })
773
+ /* @__PURE__ */ t.jsx(pe, { status: b.status, size: "xs" }),
774
+ /* @__PURE__ */ t.jsx("div", { className: "bc-week-event-title", children: b.title }),
775
+ /* @__PURE__ */ t.jsx("div", { className: "bc-week-event-time", children: H(new Date(b.startTime), "h:mm a") })
779
776
  ]
780
777
  },
781
- h.id
778
+ b.id
782
779
  );
783
780
  })
784
781
  ]
785
782
  },
786
- s.toISOString()
783
+ i.toISOString()
787
784
  ))
788
785
  ] })
789
786
  ] })
790
787
  ] });
791
788
  }
792
- function Mt({ currentDate: a, bookings: j, onSlotClick: C, onBookingClick: b }) {
793
- const y = Array.from({ length: 24 }, (u, s) => s), { getEventPosition: v } = et(), c = /* @__PURE__ */ new Date(), d = pe(a), l = c.getHours(), S = c.getMinutes(), f = (l * 60 + S) / 1440 * 100, E = j.filter((u) => ee(new Date(u.startTime), a)), g = (u) => {
794
- const s = new Date(a);
795
- s.setHours(u, 0, 0, 0);
796
- const h = Qe(s, 60);
797
- C(s, h);
789
+ function Pt({ currentDate: a, bookings: y, onSlotClick: E, onBookingClick: w }) {
790
+ const p = Array.from({ length: 24 }, (d, i) => i), { getEventPosition: m } = rt(), o = /* @__PURE__ */ new Date(), f = ae(a), c = o.getHours(), S = o.getMinutes(), v = (c * 60 + S) / (24 * 60) * 100, C = y.filter((d) => Q(new Date(d.startTime), a)), j = (d) => {
791
+ const i = new Date(a);
792
+ i.setHours(d, 0, 0, 0);
793
+ const b = tt(i, 60);
794
+ E(i, b);
798
795
  };
799
796
  return /* @__PURE__ */ t.jsxs("div", { className: "bc-day-view", children: [
800
- /* @__PURE__ */ t.jsx("div", { className: "bc-day-header", children: /* @__PURE__ */ t.jsx("div", { className: "bc-day-title", children: L(a, "EEEE, MMMM d, yyyy") }) }),
797
+ /* @__PURE__ */ t.jsx("div", { className: "bc-day-header", children: /* @__PURE__ */ t.jsx("div", { className: "bc-day-title", children: H(a, "EEEE, MMMM d, yyyy") }) }),
801
798
  /* @__PURE__ */ t.jsxs("div", { className: "bc-day-body", children: [
802
- /* @__PURE__ */ t.jsx("div", { className: "bc-day-time-column", children: y.map((u) => /* @__PURE__ */ t.jsx("div", { className: "bc-day-time-slot", children: L((/* @__PURE__ */ new Date()).setHours(u, 0), "h a") }, u)) }),
799
+ /* @__PURE__ */ t.jsx("div", { className: "bc-day-time-column", children: p.map((d) => /* @__PURE__ */ t.jsx("div", { className: "bc-day-time-slot", children: H((/* @__PURE__ */ new Date()).setHours(d, 0), "h a") }, d)) }),
803
800
  /* @__PURE__ */ t.jsxs("div", { className: "bc-day-grid-container", children: [
804
- d && /* @__PURE__ */ t.jsx("div", { className: "bc-day-now-line", style: { top: `${f}%` }, children: /* @__PURE__ */ t.jsx("div", { className: "bc-day-now-dot" }) }),
801
+ f && /* @__PURE__ */ t.jsx("div", { className: "bc-day-now-line", style: { top: `${v}%` }, children: /* @__PURE__ */ t.jsx("div", { className: "bc-day-now-dot" }) }),
805
802
  /* @__PURE__ */ t.jsxs("div", { className: "bc-day-column", children: [
806
- y.map((u) => /* @__PURE__ */ t.jsx(
803
+ p.map((d) => /* @__PURE__ */ t.jsx(
807
804
  "div",
808
805
  {
809
806
  className: "bc-day-grid-slot",
810
- onClick: () => g(u)
807
+ onClick: () => j(d)
811
808
  },
812
- u
809
+ d
813
810
  )),
814
- E.map((u) => {
815
- const s = v(u, a);
811
+ C.map((d) => {
812
+ const i = m(d, a);
816
813
  return /* @__PURE__ */ t.jsxs(
817
814
  "div",
818
815
  {
819
816
  className: "bc-day-event",
820
817
  style: {
821
- top: `${s.top}%`,
822
- height: `${s.height}%`,
823
- left: `${s.left}%`,
824
- width: `${s.width}%`
818
+ top: `${i.top}%`,
819
+ height: `${i.height}%`,
820
+ left: `${i.left}%`,
821
+ width: `${i.width}%`
825
822
  },
826
- onClick: (h) => {
827
- h.stopPropagation(), b(u);
823
+ onClick: (b) => {
824
+ b.stopPropagation(), w(d);
828
825
  },
829
826
  children: [
830
- /* @__PURE__ */ t.jsx(ge, { status: u.status, size: "sm" }),
831
- /* @__PURE__ */ t.jsx("div", { className: "bc-day-event-title", children: u.title }),
832
- /* @__PURE__ */ t.jsx("div", { className: "bc-day-event-client", children: u.clientName }),
827
+ /* @__PURE__ */ t.jsx(pe, { status: d.status, size: "sm" }),
828
+ /* @__PURE__ */ t.jsx("div", { className: "bc-day-event-title", children: d.title }),
829
+ /* @__PURE__ */ t.jsx("div", { className: "bc-day-event-client", children: d.clientName }),
833
830
  /* @__PURE__ */ t.jsxs("div", { className: "bc-day-event-time", children: [
834
- L(new Date(u.startTime), "h:mm a"),
831
+ H(new Date(d.startTime), "h:mm a"),
835
832
  " - ",
836
- L(new Date(u.endTime), "h:mm a")
833
+ H(new Date(d.endTime), "h:mm a")
837
834
  ] })
838
835
  ]
839
836
  },
840
- u.id
837
+ d.id
841
838
  );
842
839
  })
843
840
  ] })
@@ -845,89 +842,89 @@ function Mt({ currentDate: a, bookings: j, onSlotClick: C, onBookingClick: b })
845
842
  ] })
846
843
  ] });
847
844
  }
848
- function $t({
845
+ function Mt({
849
846
  booking: a,
850
- initialSlot: j,
851
- onClose: C,
852
- onCreate: b,
853
- onUpdate: y,
854
- onDelete: v,
855
- onSendConfirmation: c
847
+ initialSlot: y,
848
+ onClose: E,
849
+ onCreate: w,
850
+ onUpdate: p,
851
+ onDelete: m,
852
+ onSendConfirmation: o
856
853
  }) {
857
- const [d, l] = k(""), [S, f] = k(""), [E, g] = k(""), [u, s] = k(""), [h, O] = k(""), [R, w] = k(""), [I, U] = k(""), [H, X] = k(""), [J, N] = k(""), [V, te] = k("Pending"), [P, re] = k({}), [$, F] = k(!1);
858
- St(() => {
859
- a ? (l(a.title), f(a.clientName), g(a.clientEmail), s(a.clientPhone || ""), O(a.meetingReason || ""), w(W(new Date(a.startTime))), U(W(new Date(a.endTime))), X(a.location || ""), N(a.description || ""), te(a.status)) : j && (w(W(j.start)), U(W(j.end)));
860
- }, [a, j]);
861
- const W = (i) => {
862
- const B = i.getFullYear(), oe = String(i.getMonth() + 1).padStart(2, "0"), ce = String(i.getDate()).padStart(2, "0"), be = String(i.getHours()).padStart(2, "0"), ye = String(i.getMinutes()).padStart(2, "0");
863
- return `${B}-${oe}-${ce}T${be}:${ye}`;
864
- }, ne = () => {
865
- const i = {};
866
- return d.trim() || (i.title = "Title is required"), S.trim() || (i.clientName = "Client name is required"), E.trim() || (i.clientEmail = "Client email is required"), E && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(E) && (i.clientEmail = "Invalid email format"), R || (i.startTime = "Start time is required"), I || (i.endTime = "End time is required"), R && I && new Date(R) >= new Date(I) && (i.endTime = "End time must be after start time"), re(i), Object.keys(i).length === 0;
867
- }, ae = async (i) => {
868
- if (i.preventDefault(), !!ne()) {
854
+ const [f, c] = _(""), [S, v] = _(""), [C, j] = _(""), [d, i] = _(""), [b, O] = _(""), [k, s] = _(""), [T, A] = _(""), [Y, V] = _(""), [B, L] = _(""), [q, z] = _("Pending"), [h, K] = _({}), [$, F] = _(!1);
855
+ Te(() => {
856
+ a ? (c(a.title), v(a.clientName), j(a.clientEmail), i(a.clientPhone || ""), O(a.meetingReason || ""), s(J(new Date(a.startTime))), A(J(new Date(a.endTime))), V(a.location || ""), L(a.description || ""), z(a.status)) : y && (s(J(y.start)), A(J(y.end)));
857
+ }, [a, y]);
858
+ const J = (l) => {
859
+ const U = l.getFullYear(), le = String(l.getMonth() + 1).padStart(2, "0"), ue = String(l.getDate()).padStart(2, "0"), be = String(l.getHours()).padStart(2, "0"), ge = String(l.getMinutes()).padStart(2, "0");
860
+ return `${U}-${le}-${ue}T${be}:${ge}`;
861
+ }, se = () => {
862
+ const l = {};
863
+ return f.trim() || (l.title = "Title is required"), S.trim() || (l.clientName = "Client name is required"), C.trim() || (l.clientEmail = "Client email is required"), C && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(C) && (l.clientEmail = "Invalid email format"), k || (l.startTime = "Start time is required"), T || (l.endTime = "End time is required"), k && T && new Date(k) >= new Date(T) && (l.endTime = "End time must be after start time"), K(l), Object.keys(l).length === 0;
864
+ }, ie = async (l) => {
865
+ if (l.preventDefault(), !!se()) {
869
866
  F(!0);
870
867
  try {
871
- const B = {
872
- title: d,
868
+ const U = {
869
+ title: f,
873
870
  clientName: S,
874
- clientEmail: E,
875
- clientPhone: u || void 0,
876
- meetingReason: h || void 0,
877
- startTime: R,
878
- endTime: I,
879
- location: H || void 0,
880
- description: J || void 0,
881
- status: V
871
+ clientEmail: C,
872
+ clientPhone: d || void 0,
873
+ meetingReason: b || void 0,
874
+ startTime: k,
875
+ endTime: T,
876
+ location: Y || void 0,
877
+ description: B || void 0,
878
+ status: q
882
879
  };
883
- a && y ? await y(a.id, B) : b && await b(B), C();
884
- } catch (B) {
885
- console.error("Failed to save booking:", B);
880
+ a && p ? await p(a.id, U) : w && await w(U), E();
881
+ } catch (U) {
882
+ console.error("Failed to save booking:", U);
886
883
  } finally {
887
884
  F(!1);
888
885
  }
889
886
  }
890
- }, se = async () => {
891
- if (!(!a || !v) && confirm("Are you sure you want to delete this booking?")) {
887
+ }, oe = async () => {
888
+ if (!(!a || !m) && confirm("Are you sure you want to delete this booking?")) {
892
889
  F(!0);
893
890
  try {
894
- await v(a.id), C();
895
- } catch (i) {
896
- console.error("Failed to delete booking:", i);
891
+ await m(a.id), E();
892
+ } catch (l) {
893
+ console.error("Failed to delete booking:", l);
897
894
  } finally {
898
895
  F(!1);
899
896
  }
900
897
  }
901
- }, ie = async () => {
902
- if (!(!a || !c)) {
898
+ }, ce = async () => {
899
+ if (!(!a || !o)) {
903
900
  F(!0);
904
901
  try {
905
- await c(a.id);
906
- } catch (i) {
907
- console.error("Failed to send confirmation:", i);
902
+ await o(a.id);
903
+ } catch (l) {
904
+ console.error("Failed to send confirmation:", l);
908
905
  } finally {
909
906
  F(!1);
910
907
  }
911
908
  }
912
909
  };
913
- return /* @__PURE__ */ t.jsx("div", { className: "bc-modal-overlay", onClick: C, children: /* @__PURE__ */ t.jsxs("div", { className: "bc-modal", onClick: (i) => i.stopPropagation(), children: [
910
+ return /* @__PURE__ */ t.jsx("div", { className: "bc-modal-overlay", onClick: E, children: /* @__PURE__ */ t.jsxs("div", { className: "bc-modal", onClick: (l) => l.stopPropagation(), children: [
914
911
  /* @__PURE__ */ t.jsxs("div", { className: "bc-modal-header", children: [
915
912
  /* @__PURE__ */ t.jsx("h2", { children: a ? "Edit Booking" : "Create Booking" }),
916
- /* @__PURE__ */ t.jsx("button", { className: "bc-modal-close", onClick: C, children: "×" })
913
+ /* @__PURE__ */ t.jsx("button", { className: "bc-modal-close", onClick: E, children: "×" })
917
914
  ] }),
918
- /* @__PURE__ */ t.jsxs("form", { className: "bc-modal-body", onSubmit: ae, children: [
915
+ /* @__PURE__ */ t.jsxs("form", { className: "bc-modal-body", onSubmit: ie, children: [
919
916
  /* @__PURE__ */ t.jsxs("div", { className: "bc-form-group", children: [
920
917
  /* @__PURE__ */ t.jsx("label", { children: "Title *" }),
921
918
  /* @__PURE__ */ t.jsx(
922
919
  "input",
923
920
  {
924
921
  type: "text",
925
- value: d,
926
- onChange: (i) => l(i.target.value),
927
- className: P.title ? "bc-input-error" : ""
922
+ value: f,
923
+ onChange: (l) => c(l.target.value),
924
+ className: h.title ? "bc-input-error" : ""
928
925
  }
929
926
  ),
930
- P.title && /* @__PURE__ */ t.jsx("span", { className: "bc-error-text", children: P.title })
927
+ h.title && /* @__PURE__ */ t.jsx("span", { className: "bc-error-text", children: h.title })
931
928
  ] }),
932
929
  /* @__PURE__ */ t.jsxs("div", { className: "bc-form-row", children: [
933
930
  /* @__PURE__ */ t.jsxs("div", { className: "bc-form-group", children: [
@@ -937,11 +934,11 @@ function $t({
937
934
  {
938
935
  type: "text",
939
936
  value: S,
940
- onChange: (i) => f(i.target.value),
941
- className: P.clientName ? "bc-input-error" : ""
937
+ onChange: (l) => v(l.target.value),
938
+ className: h.clientName ? "bc-input-error" : ""
942
939
  }
943
940
  ),
944
- P.clientName && /* @__PURE__ */ t.jsx("span", { className: "bc-error-text", children: P.clientName })
941
+ h.clientName && /* @__PURE__ */ t.jsx("span", { className: "bc-error-text", children: h.clientName })
945
942
  ] }),
946
943
  /* @__PURE__ */ t.jsxs("div", { className: "bc-form-group", children: [
947
944
  /* @__PURE__ */ t.jsx("label", { children: "Client Email *" }),
@@ -949,12 +946,12 @@ function $t({
949
946
  "input",
950
947
  {
951
948
  type: "email",
952
- value: E,
953
- onChange: (i) => g(i.target.value),
954
- className: P.clientEmail ? "bc-input-error" : ""
949
+ value: C,
950
+ onChange: (l) => j(l.target.value),
951
+ className: h.clientEmail ? "bc-input-error" : ""
955
952
  }
956
953
  ),
957
- P.clientEmail && /* @__PURE__ */ t.jsx("span", { className: "bc-error-text", children: P.clientEmail })
954
+ h.clientEmail && /* @__PURE__ */ t.jsx("span", { className: "bc-error-text", children: h.clientEmail })
958
955
  ] })
959
956
  ] }),
960
957
  /* @__PURE__ */ t.jsxs("div", { className: "bc-form-row", children: [
@@ -964,8 +961,8 @@ function $t({
964
961
  "input",
965
962
  {
966
963
  type: "tel",
967
- value: u,
968
- onChange: (i) => s(i.target.value)
964
+ value: d,
965
+ onChange: (l) => i(l.target.value)
969
966
  }
970
967
  )
971
968
  ] }),
@@ -975,8 +972,8 @@ function $t({
975
972
  "input",
976
973
  {
977
974
  type: "text",
978
- value: h,
979
- onChange: (i) => O(i.target.value)
975
+ value: b,
976
+ onChange: (l) => O(l.target.value)
980
977
  }
981
978
  )
982
979
  ] })
@@ -988,12 +985,12 @@ function $t({
988
985
  "input",
989
986
  {
990
987
  type: "datetime-local",
991
- value: R,
992
- onChange: (i) => w(i.target.value),
993
- className: P.startTime ? "bc-input-error" : ""
988
+ value: k,
989
+ onChange: (l) => s(l.target.value),
990
+ className: h.startTime ? "bc-input-error" : ""
994
991
  }
995
992
  ),
996
- P.startTime && /* @__PURE__ */ t.jsx("span", { className: "bc-error-text", children: P.startTime })
993
+ h.startTime && /* @__PURE__ */ t.jsx("span", { className: "bc-error-text", children: h.startTime })
997
994
  ] }),
998
995
  /* @__PURE__ */ t.jsxs("div", { className: "bc-form-group", children: [
999
996
  /* @__PURE__ */ t.jsx("label", { children: "End Time *" }),
@@ -1001,12 +998,12 @@ function $t({
1001
998
  "input",
1002
999
  {
1003
1000
  type: "datetime-local",
1004
- value: I,
1005
- onChange: (i) => U(i.target.value),
1006
- className: P.endTime ? "bc-input-error" : ""
1001
+ value: T,
1002
+ onChange: (l) => A(l.target.value),
1003
+ className: h.endTime ? "bc-input-error" : ""
1007
1004
  }
1008
1005
  ),
1009
- P.endTime && /* @__PURE__ */ t.jsx("span", { className: "bc-error-text", children: P.endTime })
1006
+ h.endTime && /* @__PURE__ */ t.jsx("span", { className: "bc-error-text", children: h.endTime })
1010
1007
  ] })
1011
1008
  ] }),
1012
1009
  /* @__PURE__ */ t.jsxs("div", { className: "bc-form-group", children: [
@@ -1015,8 +1012,8 @@ function $t({
1015
1012
  "input",
1016
1013
  {
1017
1014
  type: "text",
1018
- value: H,
1019
- onChange: (i) => X(i.target.value),
1015
+ value: Y,
1016
+ onChange: (l) => V(l.target.value),
1020
1017
  placeholder: "Office, Zoom, etc."
1021
1018
  }
1022
1019
  )
@@ -1026,8 +1023,8 @@ function $t({
1026
1023
  /* @__PURE__ */ t.jsx(
1027
1024
  "textarea",
1028
1025
  {
1029
- value: J,
1030
- onChange: (i) => N(i.target.value),
1026
+ value: B,
1027
+ onChange: (l) => L(l.target.value),
1031
1028
  rows: 3
1032
1029
  }
1033
1030
  )
@@ -1037,8 +1034,8 @@ function $t({
1037
1034
  /* @__PURE__ */ t.jsxs(
1038
1035
  "select",
1039
1036
  {
1040
- value: V,
1041
- onChange: (i) => te(i.target.value),
1037
+ value: q,
1038
+ onChange: (l) => z(l.target.value),
1042
1039
  children: [
1043
1040
  /* @__PURE__ */ t.jsx("option", { value: "Pending", children: "Pending" }),
1044
1041
  /* @__PURE__ */ t.jsx("option", { value: "Confirmed", children: "Confirmed" }),
@@ -1048,26 +1045,26 @@ function $t({
1048
1045
  ]
1049
1046
  }
1050
1047
  ),
1051
- /* @__PURE__ */ t.jsx(ge, { status: V, size: "sm" })
1048
+ /* @__PURE__ */ t.jsx(pe, { status: q, size: "sm" })
1052
1049
  ] }),
1053
1050
  /* @__PURE__ */ t.jsxs("div", { className: "bc-modal-footer", children: [
1054
1051
  /* @__PURE__ */ t.jsxs("div", { className: "bc-modal-actions-left", children: [
1055
- a && v && /* @__PURE__ */ t.jsx(
1052
+ a && m && /* @__PURE__ */ t.jsx(
1056
1053
  "button",
1057
1054
  {
1058
1055
  type: "button",
1059
1056
  className: "bc-btn bc-btn-danger",
1060
- onClick: se,
1057
+ onClick: oe,
1061
1058
  disabled: $,
1062
1059
  children: "Delete"
1063
1060
  }
1064
1061
  ),
1065
- a && c && /* @__PURE__ */ t.jsx(
1062
+ a && o && /* @__PURE__ */ t.jsx(
1066
1063
  "button",
1067
1064
  {
1068
1065
  type: "button",
1069
1066
  className: "bc-btn bc-btn-secondary",
1070
- onClick: ie,
1067
+ onClick: ce,
1071
1068
  disabled: $,
1072
1069
  children: "Send Confirmation"
1073
1070
  }
@@ -1079,7 +1076,7 @@ function $t({
1079
1076
  {
1080
1077
  type: "button",
1081
1078
  className: "bc-btn bc-btn-secondary",
1082
- onClick: C,
1079
+ onClick: E,
1083
1080
  disabled: $,
1084
1081
  children: "Cancel"
1085
1082
  }
@@ -1098,166 +1095,287 @@ function $t({
1098
1095
  ] })
1099
1096
  ] }) });
1100
1097
  }
1101
- function It({
1098
+ const $t = [
1099
+ "Jan",
1100
+ "Feb",
1101
+ "Mar",
1102
+ "Apr",
1103
+ "May",
1104
+ "Jun",
1105
+ "Jul",
1106
+ "Aug",
1107
+ "Sep",
1108
+ "Oct",
1109
+ "Nov",
1110
+ "Dec"
1111
+ ], Ft = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
1112
+ function It({ isOpen: a, currentDate: y, onClose: E, onSelect: w }) {
1113
+ const [p, m] = _(y.getFullYear()), [o, f] = _(y.getMonth()), c = Xe(null), S = Xe(null);
1114
+ Te(() => {
1115
+ a && (m(y.getFullYear()), f(y.getMonth()), setTimeout(() => {
1116
+ var s;
1117
+ return (s = c.current) == null ? void 0 : s.focus();
1118
+ }, 0));
1119
+ }, [a, y]), Te(() => {
1120
+ const s = (T) => {
1121
+ T.key === "Escape" && a && E();
1122
+ };
1123
+ return document.addEventListener("keydown", s), () => document.removeEventListener("keydown", s);
1124
+ }, [a, E]);
1125
+ const v = (s) => {
1126
+ s.target === S.current && E();
1127
+ }, C = (s) => {
1128
+ const T = parseInt(s.target.value, 10);
1129
+ !isNaN(T) && T >= 1900 && T <= 2100 && m(T);
1130
+ }, j = () => {
1131
+ p < 2100 && m(p + 1);
1132
+ }, d = () => {
1133
+ p > 1900 && m(p - 1);
1134
+ }, i = (s) => {
1135
+ f(s);
1136
+ }, b = (s) => {
1137
+ w(s), E();
1138
+ }, O = () => {
1139
+ const s = new Date(p, o, 1), T = ke(s), A = Re(s), Y = ne(T), V = _e(A), B = [];
1140
+ let L = Y;
1141
+ for (; L <= V; )
1142
+ B.push(L), L = Oe(L, 1);
1143
+ return B;
1144
+ };
1145
+ if (!a) return null;
1146
+ const k = O();
1147
+ return /* @__PURE__ */ t.jsx("div", { className: "bc-modal-overlay", ref: S, onClick: v, children: /* @__PURE__ */ t.jsxs("div", { className: "bc-modal bc-jump-modal", children: [
1148
+ /* @__PURE__ */ t.jsxs("div", { className: "bc-modal-header", children: [
1149
+ /* @__PURE__ */ t.jsx("h3", { children: "Jump to Date" }),
1150
+ /* @__PURE__ */ t.jsx("button", { className: "bc-modal-close", onClick: E, "aria-label": "Close", children: "×" })
1151
+ ] }),
1152
+ /* @__PURE__ */ t.jsxs("div", { className: "bc-modal-body", children: [
1153
+ /* @__PURE__ */ t.jsxs("div", { className: "bc-jump-year-row", children: [
1154
+ /* @__PURE__ */ t.jsx("button", { className: "bc-jump-year-btn", onClick: d, "aria-label": "Previous year", children: "−" }),
1155
+ /* @__PURE__ */ t.jsx(
1156
+ "input",
1157
+ {
1158
+ ref: c,
1159
+ type: "number",
1160
+ className: "bc-jump-year-input",
1161
+ value: p,
1162
+ onChange: C,
1163
+ min: 1900,
1164
+ max: 2100,
1165
+ "aria-label": "Year"
1166
+ }
1167
+ ),
1168
+ /* @__PURE__ */ t.jsx("button", { className: "bc-jump-year-btn", onClick: j, "aria-label": "Next year", children: "+" })
1169
+ ] }),
1170
+ /* @__PURE__ */ t.jsx("div", { className: "bc-jump-month-grid", children: $t.map((s, T) => /* @__PURE__ */ t.jsx(
1171
+ "button",
1172
+ {
1173
+ className: `bc-jump-month-btn ${o === T ? "bc-jump-selected" : ""}`,
1174
+ onClick: () => i(T),
1175
+ children: s
1176
+ },
1177
+ s
1178
+ )) }),
1179
+ /* @__PURE__ */ t.jsxs("div", { className: "bc-jump-calendar", children: [
1180
+ /* @__PURE__ */ t.jsx("div", { className: "bc-jump-weekdays", children: Ft.map((s) => /* @__PURE__ */ t.jsx("div", { className: "bc-jump-weekday", children: s }, s)) }),
1181
+ /* @__PURE__ */ t.jsx("div", { className: "bc-jump-days", children: k.map((s, T) => {
1182
+ const A = new Date(p, o, 1), Y = et(s, A), V = Q(s, y), B = ae(s);
1183
+ return /* @__PURE__ */ t.jsx(
1184
+ "button",
1185
+ {
1186
+ className: `bc-jump-day ${Y ? "" : "bc-jump-day-muted"} ${V ? "bc-jump-day-selected" : ""} ${B ? "bc-jump-day-today" : ""}`,
1187
+ onClick: () => b(s),
1188
+ children: s.getDate()
1189
+ },
1190
+ T
1191
+ );
1192
+ }) })
1193
+ ] })
1194
+ ] })
1195
+ ] }) });
1196
+ }
1197
+ function Wt({
1102
1198
  bookings: a,
1103
- onCreateBooking: j,
1104
- onUpdateBooking: C,
1105
- onDeleteBooking: b,
1106
- onSendConfirmation: y,
1107
- initialView: v = "week",
1108
- initialDate: c = /* @__PURE__ */ new Date(),
1109
- className: d = ""
1199
+ onCreateBooking: y,
1200
+ onUpdateBooking: E,
1201
+ onDeleteBooking: w,
1202
+ onSendConfirmation: p,
1203
+ initialView: m = "week",
1204
+ initialDate: o = /* @__PURE__ */ new Date(),
1205
+ className: f = ""
1110
1206
  }) {
1111
- const [l, S] = k(c), [f, E] = k(v), [g, u] = k(
1207
+ const [c, S] = _(o), [v, C] = _(m), [j, d] = _(
1112
1208
  null
1113
- ), [s, h] = k(!1), [O, R] = k(null), w = (N, V) => {
1114
- R({ start: N, end: V }), u(null), h(!0);
1115
- }, I = (N) => {
1116
- u(N), R(null), h(!0);
1117
- }, U = () => {
1118
- h(!1), u(null), R(null);
1119
- }, H = () => {
1120
- const N = new Date(l);
1121
- f === "month" ? N.setMonth(N.getMonth() - 1) : f === "week" ? N.setDate(N.getDate() - 7) : N.setDate(N.getDate() - 1), S(N);
1122
- }, X = () => {
1123
- const N = new Date(l);
1124
- f === "month" ? N.setMonth(N.getMonth() + 1) : f === "week" ? N.setDate(N.getDate() + 7) : N.setDate(N.getDate() + 1), S(N);
1125
- }, J = () => {
1209
+ ), [i, b] = _(!1), [O, k] = _(!1), [s, T] = _(null), A = (h, K) => {
1210
+ T({ start: h, end: K }), d(null), b(!0);
1211
+ }, Y = (h) => {
1212
+ d(h), T(null), b(!0);
1213
+ }, V = () => {
1214
+ b(!1), d(null), T(null);
1215
+ }, B = () => {
1216
+ const h = new Date(c);
1217
+ v === "month" ? h.setMonth(h.getMonth() - 1) : v === "week" ? h.setDate(h.getDate() - 7) : h.setDate(h.getDate() - 1), S(h);
1218
+ }, L = () => {
1219
+ const h = new Date(c);
1220
+ v === "month" ? h.setMonth(h.getMonth() + 1) : v === "week" ? h.setDate(h.getDate() + 7) : h.setDate(h.getDate() + 1), S(h);
1221
+ }, q = () => {
1126
1222
  S(/* @__PURE__ */ new Date());
1223
+ }, z = (h) => {
1224
+ S(h);
1127
1225
  };
1128
- return /* @__PURE__ */ t.jsxs("div", { className: `booking-calendar ${d}`, children: [
1226
+ return /* @__PURE__ */ t.jsxs("div", { className: `booking-calendar ${f}`, children: [
1129
1227
  /* @__PURE__ */ t.jsxs("div", { className: "booking-calendar-header", children: [
1130
1228
  /* @__PURE__ */ t.jsxs("div", { className: "booking-calendar-nav", children: [
1131
- /* @__PURE__ */ t.jsx("button", { onClick: H, className: "nav-btn", children: "←" }),
1132
- /* @__PURE__ */ t.jsx("button", { onClick: J, className: "nav-btn", children: "Today" }),
1133
- /* @__PURE__ */ t.jsx("button", { onClick: X, className: "nav-btn", children: "→" }),
1134
- /* @__PURE__ */ t.jsx("h2", { className: "current-date", children: l.toLocaleDateString("en-US", {
1135
- month: "long",
1136
- year: "numeric"
1137
- }) })
1229
+ /* @__PURE__ */ t.jsx("button", { onClick: B, className: "nav-btn", "aria-label": "Previous", children: "←" }),
1230
+ /* @__PURE__ */ t.jsx("button", { onClick: q, className: "nav-btn", children: "Today" }),
1231
+ /* @__PURE__ */ t.jsx("button", { onClick: L, className: "nav-btn", "aria-label": "Next", children: "→" })
1138
1232
  ] }),
1233
+ /* @__PURE__ */ t.jsx(
1234
+ "button",
1235
+ {
1236
+ className: "current-date current-date-btn",
1237
+ onClick: () => k(!0),
1238
+ "aria-label": "Jump to date",
1239
+ children: c.toLocaleDateString("en-US", {
1240
+ month: "long",
1241
+ year: "numeric"
1242
+ })
1243
+ }
1244
+ ),
1139
1245
  /* @__PURE__ */ t.jsxs("div", { className: "booking-calendar-view-switcher", children: [
1140
1246
  /* @__PURE__ */ t.jsx(
1141
1247
  "button",
1142
1248
  {
1143
- onClick: () => E("month"),
1144
- className: f === "month" ? "active" : "",
1249
+ onClick: () => C("month"),
1250
+ className: v === "month" ? "active" : "",
1251
+ "aria-label": "Month view",
1145
1252
  children: "Month"
1146
1253
  }
1147
1254
  ),
1148
1255
  /* @__PURE__ */ t.jsx(
1149
1256
  "button",
1150
1257
  {
1151
- onClick: () => E("week"),
1152
- className: f === "week" ? "active" : "",
1258
+ onClick: () => C("week"),
1259
+ className: v === "week" ? "active" : "",
1260
+ "aria-label": "Week view",
1153
1261
  children: "Week"
1154
1262
  }
1155
1263
  ),
1156
1264
  /* @__PURE__ */ t.jsx(
1157
1265
  "button",
1158
1266
  {
1159
- onClick: () => E("day"),
1160
- className: f === "day" ? "active" : "",
1267
+ onClick: () => C("day"),
1268
+ className: v === "day" ? "active" : "",
1269
+ "aria-label": "Day view",
1161
1270
  children: "Day"
1162
1271
  }
1163
1272
  )
1164
1273
  ] })
1165
1274
  ] }),
1166
1275
  /* @__PURE__ */ t.jsxs("div", { className: "booking-calendar-body", children: [
1167
- f === "month" && /* @__PURE__ */ t.jsx(
1168
- Ot,
1276
+ v === "month" && /* @__PURE__ */ t.jsx(
1277
+ _t,
1169
1278
  {
1170
- currentDate: l,
1279
+ currentDate: c,
1171
1280
  bookings: a,
1172
- onSlotClick: w,
1173
- onBookingClick: I
1281
+ onSlotClick: A,
1282
+ onBookingClick: Y
1174
1283
  }
1175
1284
  ),
1176
- f === "week" && /* @__PURE__ */ t.jsx(
1177
- Pt,
1285
+ v === "week" && /* @__PURE__ */ t.jsx(
1286
+ Ot,
1178
1287
  {
1179
- currentDate: l,
1288
+ currentDate: c,
1180
1289
  bookings: a,
1181
- onSlotClick: w,
1182
- onBookingClick: I
1290
+ onSlotClick: A,
1291
+ onBookingClick: Y
1183
1292
  }
1184
1293
  ),
1185
- f === "day" && /* @__PURE__ */ t.jsx(
1186
- Mt,
1294
+ v === "day" && /* @__PURE__ */ t.jsx(
1295
+ Pt,
1187
1296
  {
1188
- currentDate: l,
1297
+ currentDate: c,
1189
1298
  bookings: a,
1190
- onSlotClick: w,
1191
- onBookingClick: I
1299
+ onSlotClick: A,
1300
+ onBookingClick: Y
1192
1301
  }
1193
1302
  )
1194
1303
  ] }),
1195
- s && /* @__PURE__ */ t.jsx(
1196
- $t,
1304
+ i && /* @__PURE__ */ t.jsx(
1305
+ Mt,
1306
+ {
1307
+ booking: j,
1308
+ initialSlot: s,
1309
+ onClose: V,
1310
+ onCreate: y,
1311
+ onUpdate: E,
1312
+ onDelete: w,
1313
+ onSendConfirmation: p
1314
+ }
1315
+ ),
1316
+ O && /* @__PURE__ */ t.jsx(
1317
+ It,
1197
1318
  {
1198
- booking: g,
1199
- initialSlot: O,
1200
- onClose: U,
1201
- onCreate: j,
1202
- onUpdate: C,
1203
- onDelete: b,
1204
- onSendConfirmation: y
1319
+ isOpen: O,
1320
+ currentDate: c,
1321
+ onClose: () => k(!1),
1322
+ onSelect: z
1205
1323
  }
1206
1324
  )
1207
1325
  ] });
1208
1326
  }
1209
- function Yt({
1327
+ function Bt({
1210
1328
  status: a,
1211
- size: j = "md"
1329
+ size: y = "md"
1212
1330
  }) {
1213
1331
  return /* @__PURE__ */ t.jsx(
1214
1332
  "span",
1215
1333
  {
1216
- className: `bc-delivery-badge bc-delivery-${a.toLowerCase()} bc-badge-${j}`,
1334
+ className: `bc-delivery-badge bc-delivery-${a.toLowerCase()} bc-badge-${y}`,
1217
1335
  children: a
1218
1336
  }
1219
1337
  );
1220
1338
  }
1221
- function Wt() {
1222
- return { getWeekDays: (b) => {
1223
- const y = he(b);
1224
- return Array.from({ length: 7 }, (v, c) => Ze(y, c));
1225
- }, getMonthDays: (b) => {
1226
- const y = Je(b), v = ze(b), c = he(y), d = Ke(v);
1227
- return Ge({ start: c, end: d });
1228
- }, getTimeSlots: (b = 30) => {
1229
- const y = [];
1230
- for (let v = 0; v < 24; v++)
1231
- for (let c = 0; c < 60; c += b)
1232
- y.push({ hour: v, minute: c });
1233
- return y;
1339
+ function Lt() {
1340
+ return { getWeekDays: (w) => {
1341
+ const p = ne(w);
1342
+ return Array.from({ length: 7 }, (m, o) => Oe(p, o));
1343
+ }, getMonthDays: (w) => {
1344
+ const p = ke(w), m = Re(w), o = ne(p), f = _e(m);
1345
+ return Qe({ start: o, end: f });
1346
+ }, getTimeSlots: (w = 30) => {
1347
+ const p = [];
1348
+ for (let m = 0; m < 24; m++)
1349
+ for (let o = 0; o < 60; o += w)
1350
+ p.push({ hour: m, minute: o });
1351
+ return p;
1234
1352
  } };
1235
1353
  }
1236
- function Bt() {
1237
- const [a, j] = k({
1354
+ function Vt() {
1355
+ const [a, y] = _({
1238
1356
  isDragging: !1,
1239
1357
  draggedEventId: null,
1240
1358
  startX: 0,
1241
1359
  startY: 0,
1242
1360
  currentX: 0,
1243
1361
  currentY: 0
1244
- }), C = me((c, d, l) => {
1245
- j({
1362
+ }), E = he((o, f, c) => {
1363
+ y({
1246
1364
  isDragging: !0,
1247
- draggedEventId: c,
1248
- startX: d,
1249
- startY: l,
1250
- currentX: d,
1251
- currentY: l
1365
+ draggedEventId: o,
1366
+ startX: f,
1367
+ startY: c,
1368
+ currentX: f,
1369
+ currentY: c
1252
1370
  });
1253
- }, []), b = me((c, d) => {
1254
- j((l) => ({
1255
- ...l,
1256
- currentX: c,
1257
- currentY: d
1371
+ }, []), w = he((o, f) => {
1372
+ y((c) => ({
1373
+ ...c,
1374
+ currentX: o,
1375
+ currentY: f
1258
1376
  }));
1259
- }, []), y = me(() => {
1260
- j({
1377
+ }, []), p = he(() => {
1378
+ y({
1261
1379
  isDragging: !1,
1262
1380
  draggedEventId: null,
1263
1381
  startX: 0,
@@ -1265,27 +1383,28 @@ function Bt() {
1265
1383
  currentX: 0,
1266
1384
  currentY: 0
1267
1385
  });
1268
- }, []), v = me(() => ({
1386
+ }, []), m = he(() => ({
1269
1387
  x: a.currentX - a.startX,
1270
1388
  y: a.currentY - a.startY
1271
1389
  }), [a]);
1272
1390
  return {
1273
1391
  dragState: a,
1274
- handleDragStart: C,
1275
- handleDragMove: b,
1276
- handleDragEnd: y,
1277
- getDragOffset: v
1392
+ handleDragStart: E,
1393
+ handleDragMove: w,
1394
+ handleDragEnd: p,
1395
+ getDragOffset: m
1278
1396
  };
1279
1397
  }
1280
1398
  export {
1281
- It as BookingCalendar,
1282
- $t as BookingModal,
1283
- ge as BookingStatusBadge,
1284
- Mt as DayView,
1285
- Yt as DeliveryStatusBadge,
1286
- Ot as MonthView,
1287
- Pt as WeekView,
1288
- Wt as useCalendarGrid,
1289
- Bt as useDragInteractions,
1290
- et as useEventLayout
1399
+ Wt as BookingCalendar,
1400
+ Mt as BookingModal,
1401
+ pe as BookingStatusBadge,
1402
+ Pt as DayView,
1403
+ Bt as DeliveryStatusBadge,
1404
+ It as JumpToDateModal,
1405
+ _t as MonthView,
1406
+ Ot as WeekView,
1407
+ Lt as useCalendarGrid,
1408
+ Vt as useDragInteractions,
1409
+ rt as useEventLayout
1291
1410
  };