@asafarim/booking-calendar 0.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/LICENSE +23 -0
- package/README.md +135 -0
- package/dist/BookingCalendar.d.ts +3 -0
- package/dist/BookingModal.d.ts +16 -0
- package/dist/BookingStatusBadge.d.ts +8 -0
- package/dist/DayView.d.ts +10 -0
- package/dist/DeliveryStatusBadge.d.ts +8 -0
- package/dist/MonthView.d.ts +10 -0
- package/dist/WeekView.d.ts +10 -0
- package/dist/hooks/useCalendarGrid.d.ts +8 -0
- package/dist/hooks/useDragInteractions.d.ts +19 -0
- package/dist/hooks/useEventLayout.d.ts +11 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +1291 -0
- package/dist/types.d.ts +76 -0
- package/package.json +63 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,1291 @@
|
|
|
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 = {};
|
|
4
|
+
/**
|
|
5
|
+
* @license React
|
|
6
|
+
* react-jsx-runtime.production.min.js
|
|
7
|
+
*
|
|
8
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
9
|
+
*
|
|
10
|
+
* This source code is licensed under the MIT license found in the
|
|
11
|
+
* LICENSE file in the root directory of this source tree.
|
|
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 };
|
|
24
|
+
}
|
|
25
|
+
return Z.Fragment = C, Z.jsx = c, Z.jsxs = c, Z;
|
|
26
|
+
}
|
|
27
|
+
var Q = {};
|
|
28
|
+
/**
|
|
29
|
+
* @license React
|
|
30
|
+
* react-jsx-runtime.development.js
|
|
31
|
+
*
|
|
32
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
33
|
+
*
|
|
34
|
+
* This source code is licensed under the MIT license found in the
|
|
35
|
+
* LICENSE file in the root directory of this source tree.
|
|
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";
|
|
41
|
+
function O(e) {
|
|
42
|
+
if (e === null || typeof e != "object")
|
|
43
|
+
return null;
|
|
44
|
+
var r = s && e[s] || e[h];
|
|
45
|
+
return typeof r == "function" ? r : null;
|
|
46
|
+
}
|
|
47
|
+
var R = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
48
|
+
function w(e) {
|
|
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);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
function I(e, r, n) {
|
|
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);
|
|
61
|
+
});
|
|
62
|
+
T.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, T);
|
|
63
|
+
}
|
|
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
|
|
69
|
+
// types supported by any Flight configuration anywhere since
|
|
70
|
+
// we don't know which Flight build this will end up being used
|
|
71
|
+
// with.
|
|
72
|
+
e.$$typeof === V || e.getModuleId !== void 0));
|
|
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;
|
|
80
|
+
}
|
|
81
|
+
function re(e) {
|
|
82
|
+
return e.displayName || "Context";
|
|
83
|
+
}
|
|
84
|
+
function $(e) {
|
|
85
|
+
if (e == null)
|
|
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")
|
|
88
|
+
return e.displayName || e.name || null;
|
|
89
|
+
if (typeof e == "string")
|
|
90
|
+
return e;
|
|
91
|
+
switch (e) {
|
|
92
|
+
case b:
|
|
93
|
+
return "Fragment";
|
|
94
|
+
case C:
|
|
95
|
+
return "Portal";
|
|
96
|
+
case v:
|
|
97
|
+
return "Profiler";
|
|
98
|
+
case y:
|
|
99
|
+
return "StrictMode";
|
|
100
|
+
case S:
|
|
101
|
+
return "Suspense";
|
|
102
|
+
case f:
|
|
103
|
+
return "SuspenseList";
|
|
104
|
+
}
|
|
105
|
+
if (typeof e == "object")
|
|
106
|
+
switch (e.$$typeof) {
|
|
107
|
+
case d:
|
|
108
|
+
var r = e;
|
|
109
|
+
return re(r) + ".Consumer";
|
|
110
|
+
case c:
|
|
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;
|
|
120
|
+
try {
|
|
121
|
+
return $(p(T));
|
|
122
|
+
} catch {
|
|
123
|
+
return null;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
return null;
|
|
128
|
+
}
|
|
129
|
+
var F = Object.assign, W = 0, ne, ae, se, ie, i, B, oe;
|
|
130
|
+
function ce() {
|
|
131
|
+
}
|
|
132
|
+
ce.__reactDisabledLog = !0;
|
|
133
|
+
function be() {
|
|
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;
|
|
137
|
+
var e = {
|
|
138
|
+
configurable: !0,
|
|
139
|
+
enumerable: !0,
|
|
140
|
+
value: ce,
|
|
141
|
+
writable: !0
|
|
142
|
+
};
|
|
143
|
+
Object.defineProperties(console, {
|
|
144
|
+
info: e,
|
|
145
|
+
log: e,
|
|
146
|
+
warn: e,
|
|
147
|
+
error: e,
|
|
148
|
+
group: e,
|
|
149
|
+
groupCollapsed: e,
|
|
150
|
+
groupEnd: e
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
W++;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
function ye() {
|
|
157
|
+
{
|
|
158
|
+
if (W--, W === 0) {
|
|
159
|
+
var e = {
|
|
160
|
+
configurable: !0,
|
|
161
|
+
enumerable: !0,
|
|
162
|
+
writable: !0
|
|
163
|
+
};
|
|
164
|
+
Object.defineProperties(console, {
|
|
165
|
+
log: F({}, e, {
|
|
166
|
+
value: ne
|
|
167
|
+
}),
|
|
168
|
+
info: F({}, e, {
|
|
169
|
+
value: ae
|
|
170
|
+
}),
|
|
171
|
+
warn: F({}, e, {
|
|
172
|
+
value: se
|
|
173
|
+
}),
|
|
174
|
+
error: F({}, e, {
|
|
175
|
+
value: ie
|
|
176
|
+
}),
|
|
177
|
+
group: F({}, e, {
|
|
178
|
+
value: i
|
|
179
|
+
}),
|
|
180
|
+
groupCollapsed: F({}, e, {
|
|
181
|
+
value: B
|
|
182
|
+
}),
|
|
183
|
+
groupEnd: F({}, e, {
|
|
184
|
+
value: oe
|
|
185
|
+
})
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
W < 0 && w("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
var xe = R.ReactCurrentDispatcher, je;
|
|
192
|
+
function le(e, r, n) {
|
|
193
|
+
{
|
|
194
|
+
if (je === void 0)
|
|
195
|
+
try {
|
|
196
|
+
throw Error();
|
|
197
|
+
} catch (x) {
|
|
198
|
+
var o = x.stack.trim().match(/\n( *(at )?)/);
|
|
199
|
+
je = o && o[1] || "";
|
|
200
|
+
}
|
|
201
|
+
return `
|
|
202
|
+
` + je + e;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
var we = !1, ue;
|
|
206
|
+
{
|
|
207
|
+
var tt = typeof WeakMap == "function" ? WeakMap : Map;
|
|
208
|
+
ue = new tt();
|
|
209
|
+
}
|
|
210
|
+
function Re(e, r) {
|
|
211
|
+
if (!e || we)
|
|
212
|
+
return "";
|
|
213
|
+
{
|
|
214
|
+
var n = ue.get(e);
|
|
215
|
+
if (n !== void 0)
|
|
216
|
+
return n;
|
|
217
|
+
}
|
|
218
|
+
var o;
|
|
219
|
+
we = !0;
|
|
220
|
+
var x = Error.prepareStackTrace;
|
|
221
|
+
Error.prepareStackTrace = void 0;
|
|
222
|
+
var T;
|
|
223
|
+
T = xe.current, xe.current = null, be();
|
|
224
|
+
try {
|
|
225
|
+
if (r) {
|
|
226
|
+
var p = function() {
|
|
227
|
+
throw Error();
|
|
228
|
+
};
|
|
229
|
+
if (Object.defineProperty(p.prototype, "props", {
|
|
230
|
+
set: function() {
|
|
231
|
+
throw Error();
|
|
232
|
+
}
|
|
233
|
+
}), typeof Reflect == "object" && Reflect.construct) {
|
|
234
|
+
try {
|
|
235
|
+
Reflect.construct(p, []);
|
|
236
|
+
} catch (A) {
|
|
237
|
+
o = A;
|
|
238
|
+
}
|
|
239
|
+
Reflect.construct(e, [], p);
|
|
240
|
+
} else {
|
|
241
|
+
try {
|
|
242
|
+
p.call();
|
|
243
|
+
} catch (A) {
|
|
244
|
+
o = A;
|
|
245
|
+
}
|
|
246
|
+
e.call(p.prototype);
|
|
247
|
+
}
|
|
248
|
+
} else {
|
|
249
|
+
try {
|
|
250
|
+
throw Error();
|
|
251
|
+
} catch (A) {
|
|
252
|
+
o = A;
|
|
253
|
+
}
|
|
254
|
+
e();
|
|
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)
|
|
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;
|
|
270
|
+
}
|
|
271
|
+
while (D >= 1 && _ >= 0);
|
|
272
|
+
break;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
} finally {
|
|
276
|
+
we = !1, xe.current = T, ye(), Error.prepareStackTrace = x;
|
|
277
|
+
}
|
|
278
|
+
var K = e ? e.displayName || e.name : "", q = K ? le(K) : "";
|
|
279
|
+
return typeof e == "function" && ue.set(e, q), q;
|
|
280
|
+
}
|
|
281
|
+
function rt(e, r, n) {
|
|
282
|
+
return Re(e, !1);
|
|
283
|
+
}
|
|
284
|
+
function nt(e) {
|
|
285
|
+
var r = e.prototype;
|
|
286
|
+
return !!(r && r.isReactComponent);
|
|
287
|
+
}
|
|
288
|
+
function de(e, r, n) {
|
|
289
|
+
if (e == null)
|
|
290
|
+
return "";
|
|
291
|
+
if (typeof e == "function")
|
|
292
|
+
return Re(e, nt(e));
|
|
293
|
+
if (typeof e == "string")
|
|
294
|
+
return le(e);
|
|
295
|
+
switch (e) {
|
|
296
|
+
case S:
|
|
297
|
+
return le("Suspense");
|
|
298
|
+
case f:
|
|
299
|
+
return le("SuspenseList");
|
|
300
|
+
}
|
|
301
|
+
if (typeof e == "object")
|
|
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;
|
|
309
|
+
try {
|
|
310
|
+
return de(T(x), r, n);
|
|
311
|
+
} catch {
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
return "";
|
|
316
|
+
}
|
|
317
|
+
var G = Object.prototype.hasOwnProperty, De = {}, _e = R.ReactDebugCurrentFrame;
|
|
318
|
+
function fe(e) {
|
|
319
|
+
if (e) {
|
|
320
|
+
var r = e._owner, n = de(e.type, e._source, r ? r.type : null);
|
|
321
|
+
_e.setExtraStackFrame(n);
|
|
322
|
+
} else
|
|
323
|
+
_e.setExtraStackFrame(null);
|
|
324
|
+
}
|
|
325
|
+
function at(e, r, n, o, x) {
|
|
326
|
+
{
|
|
327
|
+
var T = Function.call.bind(G);
|
|
328
|
+
for (var p in e)
|
|
329
|
+
if (T(e, p)) {
|
|
330
|
+
var m = void 0;
|
|
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`.");
|
|
334
|
+
throw M.name = "Invariant Violation", M;
|
|
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;
|
|
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));
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
var st = Array.isArray;
|
|
345
|
+
function Ee(e) {
|
|
346
|
+
return st(e);
|
|
347
|
+
}
|
|
348
|
+
function it(e) {
|
|
349
|
+
{
|
|
350
|
+
var r = typeof Symbol == "function" && Symbol.toStringTag, n = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
351
|
+
return n;
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
function ot(e) {
|
|
355
|
+
try {
|
|
356
|
+
return ke(e), !1;
|
|
357
|
+
} catch {
|
|
358
|
+
return !0;
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
function ke(e) {
|
|
362
|
+
return "" + e;
|
|
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);
|
|
367
|
+
}
|
|
368
|
+
var Pe = R.ReactCurrentOwner, ct = {
|
|
369
|
+
key: !0,
|
|
370
|
+
ref: !0,
|
|
371
|
+
__self: !0,
|
|
372
|
+
__source: !0
|
|
373
|
+
}, Me, $e;
|
|
374
|
+
function lt(e) {
|
|
375
|
+
if (G.call(e, "ref")) {
|
|
376
|
+
var r = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
377
|
+
if (r && r.isReactWarning)
|
|
378
|
+
return !1;
|
|
379
|
+
}
|
|
380
|
+
return e.ref !== void 0;
|
|
381
|
+
}
|
|
382
|
+
function ut(e) {
|
|
383
|
+
if (G.call(e, "key")) {
|
|
384
|
+
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
385
|
+
if (r && r.isReactWarning)
|
|
386
|
+
return !1;
|
|
387
|
+
}
|
|
388
|
+
return e.key !== void 0;
|
|
389
|
+
}
|
|
390
|
+
function dt(e, r) {
|
|
391
|
+
typeof e.ref == "string" && Pe.current;
|
|
392
|
+
}
|
|
393
|
+
function ft(e, r) {
|
|
394
|
+
{
|
|
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));
|
|
397
|
+
};
|
|
398
|
+
n.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
399
|
+
get: n,
|
|
400
|
+
configurable: !0
|
|
401
|
+
});
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
function mt(e, r) {
|
|
405
|
+
{
|
|
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));
|
|
408
|
+
};
|
|
409
|
+
n.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
410
|
+
get: n,
|
|
411
|
+
configurable: !0
|
|
412
|
+
});
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
var vt = function(e, r, n, o, x, T, p) {
|
|
416
|
+
var m = {
|
|
417
|
+
// This tag allows us to uniquely identify this as a React Element
|
|
418
|
+
$$typeof: j,
|
|
419
|
+
// Built-in properties that belong on the element
|
|
420
|
+
type: e,
|
|
421
|
+
key: r,
|
|
422
|
+
ref: n,
|
|
423
|
+
props: p,
|
|
424
|
+
// Record the component responsible for creating this element.
|
|
425
|
+
_owner: T
|
|
426
|
+
};
|
|
427
|
+
return m._store = {}, Object.defineProperty(m._store, "validated", {
|
|
428
|
+
configurable: !1,
|
|
429
|
+
enumerable: !1,
|
|
430
|
+
writable: !0,
|
|
431
|
+
value: !1
|
|
432
|
+
}), Object.defineProperty(m, "_self", {
|
|
433
|
+
configurable: !1,
|
|
434
|
+
enumerable: !1,
|
|
435
|
+
writable: !1,
|
|
436
|
+
value: o
|
|
437
|
+
}), Object.defineProperty(m, "_source", {
|
|
438
|
+
configurable: !1,
|
|
439
|
+
enumerable: !1,
|
|
440
|
+
writable: !1,
|
|
441
|
+
value: x
|
|
442
|
+
}), Object.freeze && (Object.freeze(m.props), Object.freeze(m)), m;
|
|
443
|
+
};
|
|
444
|
+
function ht(e, r, n, o, x) {
|
|
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]);
|
|
450
|
+
if (e && e.defaultProps) {
|
|
451
|
+
var D = e.defaultProps;
|
|
452
|
+
for (T in D)
|
|
453
|
+
p[T] === void 0 && (p[T] = D[T]);
|
|
454
|
+
}
|
|
455
|
+
if (m || M) {
|
|
456
|
+
var _ = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
457
|
+
m && ft(p, _), M && mt(p, _);
|
|
458
|
+
}
|
|
459
|
+
return vt(e, m, M, x, o, Pe.current, p);
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
var Te = R.ReactCurrentOwner, Fe = R.ReactDebugCurrentFrame;
|
|
463
|
+
function z(e) {
|
|
464
|
+
if (e) {
|
|
465
|
+
var r = e._owner, n = de(e.type, e._source, r ? r.type : null);
|
|
466
|
+
Fe.setExtraStackFrame(n);
|
|
467
|
+
} else
|
|
468
|
+
Fe.setExtraStackFrame(null);
|
|
469
|
+
}
|
|
470
|
+
var Ce;
|
|
471
|
+
Ce = !1;
|
|
472
|
+
function Se(e) {
|
|
473
|
+
return typeof e == "object" && e !== null && e.$$typeof === j;
|
|
474
|
+
}
|
|
475
|
+
function Ae() {
|
|
476
|
+
{
|
|
477
|
+
if (Te.current) {
|
|
478
|
+
var e = $(Te.current.type);
|
|
479
|
+
if (e)
|
|
480
|
+
return `
|
|
481
|
+
|
|
482
|
+
Check the render method of \`` + e + "`.";
|
|
483
|
+
}
|
|
484
|
+
return "";
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
function pt(e) {
|
|
488
|
+
return "";
|
|
489
|
+
}
|
|
490
|
+
var Ie = {};
|
|
491
|
+
function gt(e) {
|
|
492
|
+
{
|
|
493
|
+
var r = Ae();
|
|
494
|
+
if (!r) {
|
|
495
|
+
var n = typeof e == "string" ? e : e.displayName || e.name;
|
|
496
|
+
n && (r = `
|
|
497
|
+
|
|
498
|
+
Check the top-level render call using <` + n + ">.");
|
|
499
|
+
}
|
|
500
|
+
return r;
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
function Ye(e, r) {
|
|
504
|
+
{
|
|
505
|
+
if (!e._store || e._store.validated || e.key != null)
|
|
506
|
+
return;
|
|
507
|
+
e._store.validated = !0;
|
|
508
|
+
var n = gt(r);
|
|
509
|
+
if (Ie[n])
|
|
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);
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
function We(e, r) {
|
|
517
|
+
{
|
|
518
|
+
if (typeof e != "object")
|
|
519
|
+
return;
|
|
520
|
+
if (Ee(e))
|
|
521
|
+
for (var n = 0; n < e.length; n++) {
|
|
522
|
+
var o = e[n];
|
|
523
|
+
Se(o) && Ye(o, r);
|
|
524
|
+
}
|
|
525
|
+
else if (Se(e))
|
|
526
|
+
e._store && (e._store.validated = !0);
|
|
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);
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
function bt(e) {
|
|
536
|
+
{
|
|
537
|
+
var r = e.type;
|
|
538
|
+
if (r == null || typeof r == "string")
|
|
539
|
+
return;
|
|
540
|
+
var n;
|
|
541
|
+
if (typeof r == "function")
|
|
542
|
+
n = r.propTypes;
|
|
543
|
+
else if (typeof r == "object" && (r.$$typeof === l || // Note: Memo only checks outer props here.
|
|
544
|
+
// Inner props are checked in the reconciler.
|
|
545
|
+
r.$$typeof === E))
|
|
546
|
+
n = r.propTypes;
|
|
547
|
+
else
|
|
548
|
+
return;
|
|
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");
|
|
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.");
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
function yt(e) {
|
|
561
|
+
{
|
|
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);
|
|
566
|
+
break;
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
e.ref !== null && (z(e), w("Invalid attribute `ref` supplied to `React.Fragment`."), z(null));
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
var Be = {};
|
|
573
|
+
function Le(e, r, n, o, x, T) {
|
|
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);
|
|
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);
|
|
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.");
|
|
597
|
+
else
|
|
598
|
+
We(Y, e);
|
|
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:
|
|
607
|
+
let props = %s;
|
|
608
|
+
<%s {...props} />
|
|
609
|
+
React keys must be passed directly to JSX without using spread:
|
|
610
|
+
let props = %s;
|
|
611
|
+
<%s key={someKey} {...props} />`, Ne, q, Tt, q), Be[q + Ne] = !0;
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
return e === b ? yt(_) : bt(_), _;
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
function xt(e, r, n) {
|
|
618
|
+
return Le(e, r, n, !0);
|
|
619
|
+
}
|
|
620
|
+
function jt(e, r, n) {
|
|
621
|
+
return Le(e, r, n, !1);
|
|
622
|
+
}
|
|
623
|
+
var wt = jt, Et = xt;
|
|
624
|
+
Q.Fragment = b, Q.jsx = wt, Q.jsxs = Et;
|
|
625
|
+
}()), Q;
|
|
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;
|
|
630
|
+
}
|
|
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);
|
|
644
|
+
};
|
|
645
|
+
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);
|
|
649
|
+
return /* @__PURE__ */ t.jsxs(
|
|
650
|
+
"div",
|
|
651
|
+
{
|
|
652
|
+
className: `bc-month-day ${O ? "" : "bc-other-month"} ${R ? "bc-today" : ""}`,
|
|
653
|
+
onClick: () => E(s),
|
|
654
|
+
children: [
|
|
655
|
+
/* @__PURE__ */ t.jsx("div", { className: "bc-month-day-number", children: L(s, "d") }),
|
|
656
|
+
/* @__PURE__ */ t.jsxs("div", { className: "bc-month-day-events", children: [
|
|
657
|
+
h.slice(0, 3).map((w) => /* @__PURE__ */ t.jsxs(
|
|
658
|
+
"div",
|
|
659
|
+
{
|
|
660
|
+
className: "bc-month-event",
|
|
661
|
+
onClick: (I) => {
|
|
662
|
+
I.stopPropagation(), b(w);
|
|
663
|
+
},
|
|
664
|
+
children: [
|
|
665
|
+
/* @__PURE__ */ t.jsx(ge, { status: w.status, size: "sm" }),
|
|
666
|
+
/* @__PURE__ */ t.jsx("span", { className: "bc-month-event-title", children: w.title })
|
|
667
|
+
]
|
|
668
|
+
},
|
|
669
|
+
w.id
|
|
670
|
+
)),
|
|
671
|
+
h.length > 3 && /* @__PURE__ */ t.jsxs("div", { className: "bc-month-event-more", children: [
|
|
672
|
+
"+",
|
|
673
|
+
h.length - 3,
|
|
674
|
+
" more"
|
|
675
|
+
] })
|
|
676
|
+
] })
|
|
677
|
+
]
|
|
678
|
+
},
|
|
679
|
+
s.toISOString()
|
|
680
|
+
);
|
|
681
|
+
}) }, u)) })
|
|
682
|
+
] });
|
|
683
|
+
}
|
|
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;
|
|
687
|
+
return {
|
|
688
|
+
top: S,
|
|
689
|
+
height: f,
|
|
690
|
+
left: 0,
|
|
691
|
+
width: 95
|
|
692
|
+
};
|
|
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;
|
|
701
|
+
})) {
|
|
702
|
+
l.push(c), d = !0;
|
|
703
|
+
break;
|
|
704
|
+
}
|
|
705
|
+
d || v.push([c]);
|
|
706
|
+
}), v;
|
|
707
|
+
} };
|
|
708
|
+
}
|
|
709
|
+
function Pt({
|
|
710
|
+
currentDate: a,
|
|
711
|
+
bookings: j,
|
|
712
|
+
onSlotClick: C,
|
|
713
|
+
onBookingClick: b
|
|
714
|
+
}) {
|
|
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);
|
|
720
|
+
};
|
|
721
|
+
return /* @__PURE__ */ t.jsxs("div", { className: "bc-week-view", children: [
|
|
722
|
+
/* @__PURE__ */ t.jsxs("div", { className: "bc-week-header", children: [
|
|
723
|
+
/* @__PURE__ */ t.jsx("div", { className: "bc-week-time-gutter" }),
|
|
724
|
+
v.map((s) => /* @__PURE__ */ t.jsxs(
|
|
725
|
+
"div",
|
|
726
|
+
{
|
|
727
|
+
className: `bc-week-day-header ${pe(s) ? "bc-today" : ""}`,
|
|
728
|
+
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") })
|
|
731
|
+
]
|
|
732
|
+
},
|
|
733
|
+
s.toISOString()
|
|
734
|
+
))
|
|
735
|
+
] }),
|
|
736
|
+
/* @__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)) }),
|
|
738
|
+
/* @__PURE__ */ t.jsxs("div", { className: "bc-week-grid-container", children: [
|
|
739
|
+
l && ee(v[d.getDay()], d) && /* @__PURE__ */ t.jsx(
|
|
740
|
+
"div",
|
|
741
|
+
{
|
|
742
|
+
className: "bc-week-now-line",
|
|
743
|
+
style: { top: `${E}%` },
|
|
744
|
+
children: /* @__PURE__ */ t.jsx("div", { className: "bc-week-now-dot" })
|
|
745
|
+
}
|
|
746
|
+
),
|
|
747
|
+
v.map((s) => /* @__PURE__ */ t.jsxs(
|
|
748
|
+
"div",
|
|
749
|
+
{
|
|
750
|
+
className: `bc-week-day-column ${pe(s) ? "bc-today" : ""}`,
|
|
751
|
+
children: [
|
|
752
|
+
c.map((h) => /* @__PURE__ */ t.jsx(
|
|
753
|
+
"div",
|
|
754
|
+
{
|
|
755
|
+
className: "bc-week-grid-slot",
|
|
756
|
+
onClick: () => u(s, h)
|
|
757
|
+
},
|
|
758
|
+
h
|
|
759
|
+
)),
|
|
760
|
+
j.filter((h) => ee(new Date(h.startTime), s)).map((h) => {
|
|
761
|
+
const O = g(h, s);
|
|
762
|
+
return /* @__PURE__ */ t.jsxs(
|
|
763
|
+
"div",
|
|
764
|
+
{
|
|
765
|
+
className: "bc-week-event",
|
|
766
|
+
style: {
|
|
767
|
+
top: `${O.top}%`,
|
|
768
|
+
height: `${O.height}%`,
|
|
769
|
+
left: `${O.left}%`,
|
|
770
|
+
width: `${O.width}%`
|
|
771
|
+
},
|
|
772
|
+
onClick: (R) => {
|
|
773
|
+
R.stopPropagation(), b(h);
|
|
774
|
+
},
|
|
775
|
+
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") })
|
|
779
|
+
]
|
|
780
|
+
},
|
|
781
|
+
h.id
|
|
782
|
+
);
|
|
783
|
+
})
|
|
784
|
+
]
|
|
785
|
+
},
|
|
786
|
+
s.toISOString()
|
|
787
|
+
))
|
|
788
|
+
] })
|
|
789
|
+
] })
|
|
790
|
+
] });
|
|
791
|
+
}
|
|
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);
|
|
798
|
+
};
|
|
799
|
+
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") }) }),
|
|
801
|
+
/* @__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)) }),
|
|
803
|
+
/* @__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" }) }),
|
|
805
|
+
/* @__PURE__ */ t.jsxs("div", { className: "bc-day-column", children: [
|
|
806
|
+
y.map((u) => /* @__PURE__ */ t.jsx(
|
|
807
|
+
"div",
|
|
808
|
+
{
|
|
809
|
+
className: "bc-day-grid-slot",
|
|
810
|
+
onClick: () => g(u)
|
|
811
|
+
},
|
|
812
|
+
u
|
|
813
|
+
)),
|
|
814
|
+
E.map((u) => {
|
|
815
|
+
const s = v(u, a);
|
|
816
|
+
return /* @__PURE__ */ t.jsxs(
|
|
817
|
+
"div",
|
|
818
|
+
{
|
|
819
|
+
className: "bc-day-event",
|
|
820
|
+
style: {
|
|
821
|
+
top: `${s.top}%`,
|
|
822
|
+
height: `${s.height}%`,
|
|
823
|
+
left: `${s.left}%`,
|
|
824
|
+
width: `${s.width}%`
|
|
825
|
+
},
|
|
826
|
+
onClick: (h) => {
|
|
827
|
+
h.stopPropagation(), b(u);
|
|
828
|
+
},
|
|
829
|
+
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 }),
|
|
833
|
+
/* @__PURE__ */ t.jsxs("div", { className: "bc-day-event-time", children: [
|
|
834
|
+
L(new Date(u.startTime), "h:mm a"),
|
|
835
|
+
" - ",
|
|
836
|
+
L(new Date(u.endTime), "h:mm a")
|
|
837
|
+
] })
|
|
838
|
+
]
|
|
839
|
+
},
|
|
840
|
+
u.id
|
|
841
|
+
);
|
|
842
|
+
})
|
|
843
|
+
] })
|
|
844
|
+
] })
|
|
845
|
+
] })
|
|
846
|
+
] });
|
|
847
|
+
}
|
|
848
|
+
function $t({
|
|
849
|
+
booking: a,
|
|
850
|
+
initialSlot: j,
|
|
851
|
+
onClose: C,
|
|
852
|
+
onCreate: b,
|
|
853
|
+
onUpdate: y,
|
|
854
|
+
onDelete: v,
|
|
855
|
+
onSendConfirmation: c
|
|
856
|
+
}) {
|
|
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()) {
|
|
869
|
+
F(!0);
|
|
870
|
+
try {
|
|
871
|
+
const B = {
|
|
872
|
+
title: d,
|
|
873
|
+
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
|
|
882
|
+
};
|
|
883
|
+
a && y ? await y(a.id, B) : b && await b(B), C();
|
|
884
|
+
} catch (B) {
|
|
885
|
+
console.error("Failed to save booking:", B);
|
|
886
|
+
} finally {
|
|
887
|
+
F(!1);
|
|
888
|
+
}
|
|
889
|
+
}
|
|
890
|
+
}, se = async () => {
|
|
891
|
+
if (!(!a || !v) && confirm("Are you sure you want to delete this booking?")) {
|
|
892
|
+
F(!0);
|
|
893
|
+
try {
|
|
894
|
+
await v(a.id), C();
|
|
895
|
+
} catch (i) {
|
|
896
|
+
console.error("Failed to delete booking:", i);
|
|
897
|
+
} finally {
|
|
898
|
+
F(!1);
|
|
899
|
+
}
|
|
900
|
+
}
|
|
901
|
+
}, ie = async () => {
|
|
902
|
+
if (!(!a || !c)) {
|
|
903
|
+
F(!0);
|
|
904
|
+
try {
|
|
905
|
+
await c(a.id);
|
|
906
|
+
} catch (i) {
|
|
907
|
+
console.error("Failed to send confirmation:", i);
|
|
908
|
+
} finally {
|
|
909
|
+
F(!1);
|
|
910
|
+
}
|
|
911
|
+
}
|
|
912
|
+
};
|
|
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: [
|
|
914
|
+
/* @__PURE__ */ t.jsxs("div", { className: "bc-modal-header", children: [
|
|
915
|
+
/* @__PURE__ */ t.jsx("h2", { children: a ? "Edit Booking" : "Create Booking" }),
|
|
916
|
+
/* @__PURE__ */ t.jsx("button", { className: "bc-modal-close", onClick: C, children: "×" })
|
|
917
|
+
] }),
|
|
918
|
+
/* @__PURE__ */ t.jsxs("form", { className: "bc-modal-body", onSubmit: ae, children: [
|
|
919
|
+
/* @__PURE__ */ t.jsxs("div", { className: "bc-form-group", children: [
|
|
920
|
+
/* @__PURE__ */ t.jsx("label", { children: "Title *" }),
|
|
921
|
+
/* @__PURE__ */ t.jsx(
|
|
922
|
+
"input",
|
|
923
|
+
{
|
|
924
|
+
type: "text",
|
|
925
|
+
value: d,
|
|
926
|
+
onChange: (i) => l(i.target.value),
|
|
927
|
+
className: P.title ? "bc-input-error" : ""
|
|
928
|
+
}
|
|
929
|
+
),
|
|
930
|
+
P.title && /* @__PURE__ */ t.jsx("span", { className: "bc-error-text", children: P.title })
|
|
931
|
+
] }),
|
|
932
|
+
/* @__PURE__ */ t.jsxs("div", { className: "bc-form-row", children: [
|
|
933
|
+
/* @__PURE__ */ t.jsxs("div", { className: "bc-form-group", children: [
|
|
934
|
+
/* @__PURE__ */ t.jsx("label", { children: "Client Name *" }),
|
|
935
|
+
/* @__PURE__ */ t.jsx(
|
|
936
|
+
"input",
|
|
937
|
+
{
|
|
938
|
+
type: "text",
|
|
939
|
+
value: S,
|
|
940
|
+
onChange: (i) => f(i.target.value),
|
|
941
|
+
className: P.clientName ? "bc-input-error" : ""
|
|
942
|
+
}
|
|
943
|
+
),
|
|
944
|
+
P.clientName && /* @__PURE__ */ t.jsx("span", { className: "bc-error-text", children: P.clientName })
|
|
945
|
+
] }),
|
|
946
|
+
/* @__PURE__ */ t.jsxs("div", { className: "bc-form-group", children: [
|
|
947
|
+
/* @__PURE__ */ t.jsx("label", { children: "Client Email *" }),
|
|
948
|
+
/* @__PURE__ */ t.jsx(
|
|
949
|
+
"input",
|
|
950
|
+
{
|
|
951
|
+
type: "email",
|
|
952
|
+
value: E,
|
|
953
|
+
onChange: (i) => g(i.target.value),
|
|
954
|
+
className: P.clientEmail ? "bc-input-error" : ""
|
|
955
|
+
}
|
|
956
|
+
),
|
|
957
|
+
P.clientEmail && /* @__PURE__ */ t.jsx("span", { className: "bc-error-text", children: P.clientEmail })
|
|
958
|
+
] })
|
|
959
|
+
] }),
|
|
960
|
+
/* @__PURE__ */ t.jsxs("div", { className: "bc-form-row", children: [
|
|
961
|
+
/* @__PURE__ */ t.jsxs("div", { className: "bc-form-group", children: [
|
|
962
|
+
/* @__PURE__ */ t.jsx("label", { children: "Client Phone" }),
|
|
963
|
+
/* @__PURE__ */ t.jsx(
|
|
964
|
+
"input",
|
|
965
|
+
{
|
|
966
|
+
type: "tel",
|
|
967
|
+
value: u,
|
|
968
|
+
onChange: (i) => s(i.target.value)
|
|
969
|
+
}
|
|
970
|
+
)
|
|
971
|
+
] }),
|
|
972
|
+
/* @__PURE__ */ t.jsxs("div", { className: "bc-form-group", children: [
|
|
973
|
+
/* @__PURE__ */ t.jsx("label", { children: "Meeting Reason" }),
|
|
974
|
+
/* @__PURE__ */ t.jsx(
|
|
975
|
+
"input",
|
|
976
|
+
{
|
|
977
|
+
type: "text",
|
|
978
|
+
value: h,
|
|
979
|
+
onChange: (i) => O(i.target.value)
|
|
980
|
+
}
|
|
981
|
+
)
|
|
982
|
+
] })
|
|
983
|
+
] }),
|
|
984
|
+
/* @__PURE__ */ t.jsxs("div", { className: "bc-form-row", children: [
|
|
985
|
+
/* @__PURE__ */ t.jsxs("div", { className: "bc-form-group", children: [
|
|
986
|
+
/* @__PURE__ */ t.jsx("label", { children: "Start Time *" }),
|
|
987
|
+
/* @__PURE__ */ t.jsx(
|
|
988
|
+
"input",
|
|
989
|
+
{
|
|
990
|
+
type: "datetime-local",
|
|
991
|
+
value: R,
|
|
992
|
+
onChange: (i) => w(i.target.value),
|
|
993
|
+
className: P.startTime ? "bc-input-error" : ""
|
|
994
|
+
}
|
|
995
|
+
),
|
|
996
|
+
P.startTime && /* @__PURE__ */ t.jsx("span", { className: "bc-error-text", children: P.startTime })
|
|
997
|
+
] }),
|
|
998
|
+
/* @__PURE__ */ t.jsxs("div", { className: "bc-form-group", children: [
|
|
999
|
+
/* @__PURE__ */ t.jsx("label", { children: "End Time *" }),
|
|
1000
|
+
/* @__PURE__ */ t.jsx(
|
|
1001
|
+
"input",
|
|
1002
|
+
{
|
|
1003
|
+
type: "datetime-local",
|
|
1004
|
+
value: I,
|
|
1005
|
+
onChange: (i) => U(i.target.value),
|
|
1006
|
+
className: P.endTime ? "bc-input-error" : ""
|
|
1007
|
+
}
|
|
1008
|
+
),
|
|
1009
|
+
P.endTime && /* @__PURE__ */ t.jsx("span", { className: "bc-error-text", children: P.endTime })
|
|
1010
|
+
] })
|
|
1011
|
+
] }),
|
|
1012
|
+
/* @__PURE__ */ t.jsxs("div", { className: "bc-form-group", children: [
|
|
1013
|
+
/* @__PURE__ */ t.jsx("label", { children: "Location" }),
|
|
1014
|
+
/* @__PURE__ */ t.jsx(
|
|
1015
|
+
"input",
|
|
1016
|
+
{
|
|
1017
|
+
type: "text",
|
|
1018
|
+
value: H,
|
|
1019
|
+
onChange: (i) => X(i.target.value),
|
|
1020
|
+
placeholder: "Office, Zoom, etc."
|
|
1021
|
+
}
|
|
1022
|
+
)
|
|
1023
|
+
] }),
|
|
1024
|
+
/* @__PURE__ */ t.jsxs("div", { className: "bc-form-group", children: [
|
|
1025
|
+
/* @__PURE__ */ t.jsx("label", { children: "Description" }),
|
|
1026
|
+
/* @__PURE__ */ t.jsx(
|
|
1027
|
+
"textarea",
|
|
1028
|
+
{
|
|
1029
|
+
value: J,
|
|
1030
|
+
onChange: (i) => N(i.target.value),
|
|
1031
|
+
rows: 3
|
|
1032
|
+
}
|
|
1033
|
+
)
|
|
1034
|
+
] }),
|
|
1035
|
+
a && /* @__PURE__ */ t.jsxs("div", { className: "bc-form-group", children: [
|
|
1036
|
+
/* @__PURE__ */ t.jsx("label", { children: "Status" }),
|
|
1037
|
+
/* @__PURE__ */ t.jsxs(
|
|
1038
|
+
"select",
|
|
1039
|
+
{
|
|
1040
|
+
value: V,
|
|
1041
|
+
onChange: (i) => te(i.target.value),
|
|
1042
|
+
children: [
|
|
1043
|
+
/* @__PURE__ */ t.jsx("option", { value: "Pending", children: "Pending" }),
|
|
1044
|
+
/* @__PURE__ */ t.jsx("option", { value: "Confirmed", children: "Confirmed" }),
|
|
1045
|
+
/* @__PURE__ */ t.jsx("option", { value: "Cancelled", children: "Cancelled" }),
|
|
1046
|
+
/* @__PURE__ */ t.jsx("option", { value: "Completed", children: "Completed" }),
|
|
1047
|
+
/* @__PURE__ */ t.jsx("option", { value: "NoShow", children: "No Show" })
|
|
1048
|
+
]
|
|
1049
|
+
}
|
|
1050
|
+
),
|
|
1051
|
+
/* @__PURE__ */ t.jsx(ge, { status: V, size: "sm" })
|
|
1052
|
+
] }),
|
|
1053
|
+
/* @__PURE__ */ t.jsxs("div", { className: "bc-modal-footer", children: [
|
|
1054
|
+
/* @__PURE__ */ t.jsxs("div", { className: "bc-modal-actions-left", children: [
|
|
1055
|
+
a && v && /* @__PURE__ */ t.jsx(
|
|
1056
|
+
"button",
|
|
1057
|
+
{
|
|
1058
|
+
type: "button",
|
|
1059
|
+
className: "bc-btn bc-btn-danger",
|
|
1060
|
+
onClick: se,
|
|
1061
|
+
disabled: $,
|
|
1062
|
+
children: "Delete"
|
|
1063
|
+
}
|
|
1064
|
+
),
|
|
1065
|
+
a && c && /* @__PURE__ */ t.jsx(
|
|
1066
|
+
"button",
|
|
1067
|
+
{
|
|
1068
|
+
type: "button",
|
|
1069
|
+
className: "bc-btn bc-btn-secondary",
|
|
1070
|
+
onClick: ie,
|
|
1071
|
+
disabled: $,
|
|
1072
|
+
children: "Send Confirmation"
|
|
1073
|
+
}
|
|
1074
|
+
)
|
|
1075
|
+
] }),
|
|
1076
|
+
/* @__PURE__ */ t.jsxs("div", { className: "bc-modal-actions-right", children: [
|
|
1077
|
+
/* @__PURE__ */ t.jsx(
|
|
1078
|
+
"button",
|
|
1079
|
+
{
|
|
1080
|
+
type: "button",
|
|
1081
|
+
className: "bc-btn bc-btn-secondary",
|
|
1082
|
+
onClick: C,
|
|
1083
|
+
disabled: $,
|
|
1084
|
+
children: "Cancel"
|
|
1085
|
+
}
|
|
1086
|
+
),
|
|
1087
|
+
/* @__PURE__ */ t.jsx(
|
|
1088
|
+
"button",
|
|
1089
|
+
{
|
|
1090
|
+
type: "submit",
|
|
1091
|
+
className: "bc-btn bc-btn-primary",
|
|
1092
|
+
disabled: $,
|
|
1093
|
+
children: $ ? "Saving..." : a ? "Update" : "Create"
|
|
1094
|
+
}
|
|
1095
|
+
)
|
|
1096
|
+
] })
|
|
1097
|
+
] })
|
|
1098
|
+
] })
|
|
1099
|
+
] }) });
|
|
1100
|
+
}
|
|
1101
|
+
function It({
|
|
1102
|
+
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 = ""
|
|
1110
|
+
}) {
|
|
1111
|
+
const [l, S] = k(c), [f, E] = k(v), [g, u] = k(
|
|
1112
|
+
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 = () => {
|
|
1126
|
+
S(/* @__PURE__ */ new Date());
|
|
1127
|
+
};
|
|
1128
|
+
return /* @__PURE__ */ t.jsxs("div", { className: `booking-calendar ${d}`, children: [
|
|
1129
|
+
/* @__PURE__ */ t.jsxs("div", { className: "booking-calendar-header", children: [
|
|
1130
|
+
/* @__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
|
+
}) })
|
|
1138
|
+
] }),
|
|
1139
|
+
/* @__PURE__ */ t.jsxs("div", { className: "booking-calendar-view-switcher", children: [
|
|
1140
|
+
/* @__PURE__ */ t.jsx(
|
|
1141
|
+
"button",
|
|
1142
|
+
{
|
|
1143
|
+
onClick: () => E("month"),
|
|
1144
|
+
className: f === "month" ? "active" : "",
|
|
1145
|
+
children: "Month"
|
|
1146
|
+
}
|
|
1147
|
+
),
|
|
1148
|
+
/* @__PURE__ */ t.jsx(
|
|
1149
|
+
"button",
|
|
1150
|
+
{
|
|
1151
|
+
onClick: () => E("week"),
|
|
1152
|
+
className: f === "week" ? "active" : "",
|
|
1153
|
+
children: "Week"
|
|
1154
|
+
}
|
|
1155
|
+
),
|
|
1156
|
+
/* @__PURE__ */ t.jsx(
|
|
1157
|
+
"button",
|
|
1158
|
+
{
|
|
1159
|
+
onClick: () => E("day"),
|
|
1160
|
+
className: f === "day" ? "active" : "",
|
|
1161
|
+
children: "Day"
|
|
1162
|
+
}
|
|
1163
|
+
)
|
|
1164
|
+
] })
|
|
1165
|
+
] }),
|
|
1166
|
+
/* @__PURE__ */ t.jsxs("div", { className: "booking-calendar-body", children: [
|
|
1167
|
+
f === "month" && /* @__PURE__ */ t.jsx(
|
|
1168
|
+
Ot,
|
|
1169
|
+
{
|
|
1170
|
+
currentDate: l,
|
|
1171
|
+
bookings: a,
|
|
1172
|
+
onSlotClick: w,
|
|
1173
|
+
onBookingClick: I
|
|
1174
|
+
}
|
|
1175
|
+
),
|
|
1176
|
+
f === "week" && /* @__PURE__ */ t.jsx(
|
|
1177
|
+
Pt,
|
|
1178
|
+
{
|
|
1179
|
+
currentDate: l,
|
|
1180
|
+
bookings: a,
|
|
1181
|
+
onSlotClick: w,
|
|
1182
|
+
onBookingClick: I
|
|
1183
|
+
}
|
|
1184
|
+
),
|
|
1185
|
+
f === "day" && /* @__PURE__ */ t.jsx(
|
|
1186
|
+
Mt,
|
|
1187
|
+
{
|
|
1188
|
+
currentDate: l,
|
|
1189
|
+
bookings: a,
|
|
1190
|
+
onSlotClick: w,
|
|
1191
|
+
onBookingClick: I
|
|
1192
|
+
}
|
|
1193
|
+
)
|
|
1194
|
+
] }),
|
|
1195
|
+
s && /* @__PURE__ */ t.jsx(
|
|
1196
|
+
$t,
|
|
1197
|
+
{
|
|
1198
|
+
booking: g,
|
|
1199
|
+
initialSlot: O,
|
|
1200
|
+
onClose: U,
|
|
1201
|
+
onCreate: j,
|
|
1202
|
+
onUpdate: C,
|
|
1203
|
+
onDelete: b,
|
|
1204
|
+
onSendConfirmation: y
|
|
1205
|
+
}
|
|
1206
|
+
)
|
|
1207
|
+
] });
|
|
1208
|
+
}
|
|
1209
|
+
function Yt({
|
|
1210
|
+
status: a,
|
|
1211
|
+
size: j = "md"
|
|
1212
|
+
}) {
|
|
1213
|
+
return /* @__PURE__ */ t.jsx(
|
|
1214
|
+
"span",
|
|
1215
|
+
{
|
|
1216
|
+
className: `bc-delivery-badge bc-delivery-${a.toLowerCase()} bc-badge-${j}`,
|
|
1217
|
+
children: a
|
|
1218
|
+
}
|
|
1219
|
+
);
|
|
1220
|
+
}
|
|
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;
|
|
1234
|
+
} };
|
|
1235
|
+
}
|
|
1236
|
+
function Bt() {
|
|
1237
|
+
const [a, j] = k({
|
|
1238
|
+
isDragging: !1,
|
|
1239
|
+
draggedEventId: null,
|
|
1240
|
+
startX: 0,
|
|
1241
|
+
startY: 0,
|
|
1242
|
+
currentX: 0,
|
|
1243
|
+
currentY: 0
|
|
1244
|
+
}), C = me((c, d, l) => {
|
|
1245
|
+
j({
|
|
1246
|
+
isDragging: !0,
|
|
1247
|
+
draggedEventId: c,
|
|
1248
|
+
startX: d,
|
|
1249
|
+
startY: l,
|
|
1250
|
+
currentX: d,
|
|
1251
|
+
currentY: l
|
|
1252
|
+
});
|
|
1253
|
+
}, []), b = me((c, d) => {
|
|
1254
|
+
j((l) => ({
|
|
1255
|
+
...l,
|
|
1256
|
+
currentX: c,
|
|
1257
|
+
currentY: d
|
|
1258
|
+
}));
|
|
1259
|
+
}, []), y = me(() => {
|
|
1260
|
+
j({
|
|
1261
|
+
isDragging: !1,
|
|
1262
|
+
draggedEventId: null,
|
|
1263
|
+
startX: 0,
|
|
1264
|
+
startY: 0,
|
|
1265
|
+
currentX: 0,
|
|
1266
|
+
currentY: 0
|
|
1267
|
+
});
|
|
1268
|
+
}, []), v = me(() => ({
|
|
1269
|
+
x: a.currentX - a.startX,
|
|
1270
|
+
y: a.currentY - a.startY
|
|
1271
|
+
}), [a]);
|
|
1272
|
+
return {
|
|
1273
|
+
dragState: a,
|
|
1274
|
+
handleDragStart: C,
|
|
1275
|
+
handleDragMove: b,
|
|
1276
|
+
handleDragEnd: y,
|
|
1277
|
+
getDragOffset: v
|
|
1278
|
+
};
|
|
1279
|
+
}
|
|
1280
|
+
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
|
|
1291
|
+
};
|