@oneclick.dev/cms-core-modules 0.0.61 → 0.0.63

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.
Files changed (46) hide show
  1. package/dist/{ContentEditor-BAepN3Yd.js → ContentEditor-DKFCmfOs.js} +1 -1
  2. package/dist/{ContentEditor-BPjWW3d1.mjs → ContentEditor-owdOIage.mjs} +1 -1
  3. package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-DRVxQswt.js +1 -0
  4. package/dist/{NewReservationDialog.vue_vue_type_script_setup_true_lang-BJitmbPE.mjs → NewReservationDialog.vue_vue_type_script_setup_true_lang-DkgDWC2i.mjs} +130 -125
  5. package/dist/{Overview-DtWvKB3W.mjs → Overview-DiBYtvEX.mjs} +124 -119
  6. package/dist/Overview-qP1guKjx.js +1 -0
  7. package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-B7ks5mbf.mjs +2332 -0
  8. package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-Vxubki_v.js +349 -0
  9. package/dist/{TableView-_2cP-w_7.js → TableView-BqhL_P45.js} +100 -100
  10. package/dist/{TableView-DlhHyuUZ.mjs → TableView-Dbl8qcUy.mjs} +14991 -14728
  11. package/dist/agenda-DFNJ8C1N.mjs +1136 -0
  12. package/dist/agenda-MjkwV63A.js +1 -0
  13. package/dist/floating-ui.dom-CBBY0Ism.js +1 -0
  14. package/dist/floating-ui.dom-xfqXu4GA.mjs +1138 -0
  15. package/dist/{index-DTago6vW-Bhr8E1Y6.js → index-CgfL8UKf-DAN7RkzR.js} +10 -10
  16. package/dist/{index-DTago6vW-CnomHQ_S.mjs → index-CgfL8UKf-DUUg9HDA.mjs} +904 -875
  17. package/dist/index-DBDq-h4j.js +245 -0
  18. package/dist/{index-BDaVYdkD.mjs → index-X0L4AHBR.mjs} +2406 -2394
  19. package/dist/index-YMaY4uuk-BgpTtr73.js +1 -0
  20. package/dist/{index-YMaY4uuk-BshejgNP.mjs → index-YMaY4uuk-C_xV5K9Z.mjs} +13 -14
  21. package/dist/index.cjs.js +1 -1
  22. package/dist/index.mjs +6 -6
  23. package/dist/orders-Bqa3Z3tH.mjs +356 -0
  24. package/dist/orders-D5GJOZXN.js +1 -0
  25. package/dist/src/appointments/components/edit/EventDialog/ApproveReservationDialog.vue.d.ts +8 -0
  26. package/dist/src/appointments/components/edit/EventDialog/BookingsList.vue.d.ts +39 -9
  27. package/dist/src/appointments/components/edit/EventDialog/CancelReservationDialog.vue.d.ts +2 -2
  28. package/dist/src/appointments/components/edit/EventDialog/RejectReservationDialog.vue.d.ts +8 -0
  29. package/dist/src/appointments/components/edit/EventDialog/ReservationDetailDialog.vue.d.ts +36 -8
  30. package/dist/src/appointments/components/edit/dashboard/BookingsList.vue.d.ts +46 -9
  31. package/dist/src/appointments/components/edit/dashboard/Timeline.vue.d.ts +19 -0
  32. package/dist/src/appointments/pages/edit/orders.vue.d.ts +39 -9
  33. package/package.json +1 -1
  34. package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-D50uTpZY.js +0 -1
  35. package/dist/Overview-B_99j5eA.js +0 -1
  36. package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-CI8YgHdU.js +0 -345
  37. package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-P-MWwcVh.mjs +0 -2093
  38. package/dist/agenda-D81m29_4.mjs +0 -1135
  39. package/dist/agenda-uzPPxgsW.js +0 -1
  40. package/dist/floating-ui.dom-C82nbomj.js +0 -1
  41. package/dist/floating-ui.dom-ouSgPqty.mjs +0 -1133
  42. package/dist/index-DfV8-6ON.js +0 -245
  43. package/dist/index-YMaY4uuk-BxVT7IpO.js +0 -1
  44. package/dist/orders-Bh8w0ueq.mjs +0 -346
  45. package/dist/orders-Dt0zMz97.js +0 -1
  46. package/dist/src/appointments/components/edit/EventDialog/ResendConfirmationDialog.vue.d.ts +0 -4
@@ -1,2093 +0,0 @@
1
- import { defineComponent as se, ref as R, resolveComponent as _, openBlock as B, createBlock as J, withCtx as v, createVNode as u, createTextVNode as A, createElementVNode as f, inject as Ve, computed as re, createElementBlock as j, Fragment as le, normalizeClass as Ue, toDisplayString as $, unref as S, createCommentVNode as L } from "vue";
2
- import { User as We, Mail as He, Phone as Ke, Clock as Ge, Users as Ye, Tag as Qe, CreditCard as Je, Receipt as Xe, Ban as Ze, ClockCheck as qe, MoreHorizontal as et, Download as tt, MailCheck as nt, XCircle as st, Gift as ot } from "lucide-vue-next";
3
- import { useModule as oe, useMailer as we, useModulePermissions as it, useFirebaseIntegration as at, useConfirmation as rt } from "@oneclick.dev/cms-kit";
4
- import { t as xe } from "./index-RLz1QPrf.mjs";
5
- function U(t) {
6
- return Array.isArray ? Array.isArray(t) : Me(t) === "[object Array]";
7
- }
8
- function lt(t) {
9
- if (typeof t == "string")
10
- return t;
11
- let e = t + "";
12
- return e == "0" && 1 / t == -1 / 0 ? "-0" : e;
13
- }
14
- function ut(t) {
15
- return t == null ? "" : lt(t);
16
- }
17
- function V(t) {
18
- return typeof t == "string";
19
- }
20
- function Ee(t) {
21
- return typeof t == "number";
22
- }
23
- function ct(t) {
24
- return t === !0 || t === !1 || dt(t) && Me(t) == "[object Boolean]";
25
- }
26
- function ke(t) {
27
- return typeof t == "object";
28
- }
29
- function dt(t) {
30
- return ke(t) && t !== null;
31
- }
32
- function P(t) {
33
- return t != null;
34
- }
35
- function ue(t) {
36
- return !t.trim().length;
37
- }
38
- function Me(t) {
39
- return t == null ? t === void 0 ? "[object Undefined]" : "[object Null]" : Object.prototype.toString.call(t);
40
- }
41
- const pt = "Incorrect 'index' type", ft = (t) => `Invalid value for key ${t}`, mt = (t) => `Pattern length exceeds max of ${t}.`, gt = (t) => `Missing ${t} property in key`, ht = (t) => `Property 'weight' in key '${t}' must be a positive integer`, _e = Object.prototype.hasOwnProperty;
42
- class vt {
43
- constructor(e) {
44
- this._keys = [], this._keyMap = {};
45
- let n = 0;
46
- e.forEach((s) => {
47
- let i = $e(s);
48
- this._keys.push(i), this._keyMap[i.id] = i, n += i.weight;
49
- }), this._keys.forEach((s) => {
50
- s.weight /= n;
51
- });
52
- }
53
- get(e) {
54
- return this._keyMap[e];
55
- }
56
- keys() {
57
- return this._keys;
58
- }
59
- toJSON() {
60
- return JSON.stringify(this._keys);
61
- }
62
- }
63
- function $e(t) {
64
- let e = null, n = null, s = null, i = 1, r = null;
65
- if (V(t) || U(t))
66
- s = t, e = De(t), n = ce(t);
67
- else {
68
- if (!_e.call(t, "name"))
69
- throw new Error(gt("name"));
70
- const a = t.name;
71
- if (s = a, _e.call(t, "weight") && (i = t.weight, i <= 0))
72
- throw new Error(ht(a));
73
- e = De(a), n = ce(a), r = t.getFn;
74
- }
75
- return { path: e, id: n, weight: i, src: s, getFn: r };
76
- }
77
- function De(t) {
78
- return U(t) ? t : t.split(".");
79
- }
80
- function ce(t) {
81
- return U(t) ? t.join(".") : t;
82
- }
83
- function xt(t, e) {
84
- let n = [], s = !1;
85
- const i = (r, a, l) => {
86
- if (P(r))
87
- if (!a[l])
88
- n.push(r);
89
- else {
90
- let c = a[l];
91
- const d = r[c];
92
- if (!P(d))
93
- return;
94
- if (l === a.length - 1 && (V(d) || Ee(d) || ct(d)))
95
- n.push(ut(d));
96
- else if (U(d)) {
97
- s = !0;
98
- for (let o = 0, p = d.length; o < p; o += 1)
99
- i(d[o], a, l + 1);
100
- } else a.length && i(d, a, l + 1);
101
- }
102
- };
103
- return i(t, V(e) ? e.split(".") : e, 0), s ? n : n[0];
104
- }
105
- const _t = {
106
- // Whether the matches should be included in the result set. When `true`, each record in the result
107
- // set will include the indices of the matched characters.
108
- // These can consequently be used for highlighting purposes.
109
- includeMatches: !1,
110
- // When `true`, the matching function will continue to the end of a search pattern even if
111
- // a perfect match has already been located in the string.
112
- findAllMatches: !1,
113
- // Minimum number of characters that must be matched before a result is considered a match
114
- minMatchCharLength: 1
115
- }, Dt = {
116
- // When `true`, the algorithm continues searching to the end of the input even if a perfect
117
- // match is found before the end of the same input.
118
- isCaseSensitive: !1,
119
- // When `true`, the algorithm will ignore diacritics (accents) in comparisons
120
- ignoreDiacritics: !1,
121
- // When true, the matching function will continue to the end of a search pattern even if
122
- includeScore: !1,
123
- // List of properties that will be searched. This also supports nested properties.
124
- keys: [],
125
- // Whether to sort the result list, by score
126
- shouldSort: !0,
127
- // Default sort function: sort by ascending score, ascending index
128
- sortFn: (t, e) => t.score === e.score ? t.idx < e.idx ? -1 : 1 : t.score < e.score ? -1 : 1
129
- }, yt = {
130
- // Approximately where in the text is the pattern expected to be found?
131
- location: 0,
132
- // At what point does the match algorithm give up. A threshold of '0.0' requires a perfect match
133
- // (of both letters and location), a threshold of '1.0' would match anything.
134
- threshold: 0.6,
135
- // Determines how close the match must be to the fuzzy location (specified above).
136
- // An exact letter match which is 'distance' characters away from the fuzzy location
137
- // would score as a complete mismatch. A distance of '0' requires the match be at
138
- // the exact location specified, a threshold of '1000' would require a perfect match
139
- // to be within 800 characters of the fuzzy location to be found using a 0.8 threshold.
140
- distance: 100
141
- }, At = {
142
- // When `true`, it enables the use of unix-like search commands
143
- useExtendedSearch: !1,
144
- // The get function to use when fetching an object's properties.
145
- // The default will search nested paths *ie foo.bar.baz*
146
- getFn: xt,
147
- // When `true`, search will ignore `location` and `distance`, so it won't matter
148
- // where in the string the pattern appears.
149
- // More info: https://fusejs.io/concepts/scoring-theory.html#fuzziness-score
150
- ignoreLocation: !1,
151
- // When `true`, the calculation for the relevance score (used for sorting) will
152
- // ignore the field-length norm.
153
- // More info: https://fusejs.io/concepts/scoring-theory.html#field-length-norm
154
- ignoreFieldNorm: !1,
155
- // The weight to determine how much field length norm effects scoring.
156
- fieldNormWeight: 1
157
- };
158
- var x = {
159
- ...Dt,
160
- ..._t,
161
- ...yt,
162
- ...At
163
- };
164
- const Ct = /[^ ]+/g;
165
- function bt(t = 1, e = 3) {
166
- const n = /* @__PURE__ */ new Map(), s = Math.pow(10, e);
167
- return {
168
- get(i) {
169
- const r = i.match(Ct).length;
170
- if (n.has(r))
171
- return n.get(r);
172
- const a = 1 / Math.pow(r, 0.5 * t), l = parseFloat(Math.round(a * s) / s);
173
- return n.set(r, l), l;
174
- },
175
- clear() {
176
- n.clear();
177
- }
178
- };
179
- }
180
- class he {
181
- constructor({
182
- getFn: e = x.getFn,
183
- fieldNormWeight: n = x.fieldNormWeight
184
- } = {}) {
185
- this.norm = bt(n, 3), this.getFn = e, this.isCreated = !1, this.setIndexRecords();
186
- }
187
- setSources(e = []) {
188
- this.docs = e;
189
- }
190
- setIndexRecords(e = []) {
191
- this.records = e;
192
- }
193
- setKeys(e = []) {
194
- this.keys = e, this._keysMap = {}, e.forEach((n, s) => {
195
- this._keysMap[n.id] = s;
196
- });
197
- }
198
- create() {
199
- this.isCreated || !this.docs.length || (this.isCreated = !0, V(this.docs[0]) ? this.docs.forEach((e, n) => {
200
- this._addString(e, n);
201
- }) : this.docs.forEach((e, n) => {
202
- this._addObject(e, n);
203
- }), this.norm.clear());
204
- }
205
- // Adds a doc to the end of the index
206
- add(e) {
207
- const n = this.size();
208
- V(e) ? this._addString(e, n) : this._addObject(e, n);
209
- }
210
- // Removes the doc at the specified index of the index
211
- removeAt(e) {
212
- this.records.splice(e, 1);
213
- for (let n = e, s = this.size(); n < s; n += 1)
214
- this.records[n].i -= 1;
215
- }
216
- getValueForItemAtKeyId(e, n) {
217
- return e[this._keysMap[n]];
218
- }
219
- size() {
220
- return this.records.length;
221
- }
222
- _addString(e, n) {
223
- if (!P(e) || ue(e))
224
- return;
225
- let s = {
226
- v: e,
227
- i: n,
228
- n: this.norm.get(e)
229
- };
230
- this.records.push(s);
231
- }
232
- _addObject(e, n) {
233
- let s = { i: n, $: {} };
234
- this.keys.forEach((i, r) => {
235
- let a = i.getFn ? i.getFn(e) : this.getFn(e, i.path);
236
- if (P(a)) {
237
- if (U(a)) {
238
- let l = [];
239
- const c = [{ nestedArrIndex: -1, value: a }];
240
- for (; c.length; ) {
241
- const { nestedArrIndex: d, value: o } = c.pop();
242
- if (P(o))
243
- if (V(o) && !ue(o)) {
244
- let p = {
245
- v: o,
246
- i: d,
247
- n: this.norm.get(o)
248
- };
249
- l.push(p);
250
- } else U(o) && o.forEach((p, h) => {
251
- c.push({
252
- nestedArrIndex: h,
253
- value: p
254
- });
255
- });
256
- }
257
- s.$[r] = l;
258
- } else if (V(a) && !ue(a)) {
259
- let l = {
260
- v: a,
261
- n: this.norm.get(a)
262
- };
263
- s.$[r] = l;
264
- }
265
- }
266
- }), this.records.push(s);
267
- }
268
- toJSON() {
269
- return {
270
- keys: this.keys,
271
- records: this.records
272
- };
273
- }
274
- }
275
- function Be(t, e, { getFn: n = x.getFn, fieldNormWeight: s = x.fieldNormWeight } = {}) {
276
- const i = new he({ getFn: n, fieldNormWeight: s });
277
- return i.setKeys(t.map($e)), i.setSources(e), i.create(), i;
278
- }
279
- function wt(t, { getFn: e = x.getFn, fieldNormWeight: n = x.fieldNormWeight } = {}) {
280
- const { keys: s, records: i } = t, r = new he({ getFn: e, fieldNormWeight: n });
281
- return r.setKeys(s), r.setIndexRecords(i), r;
282
- }
283
- function ee(t, {
284
- errors: e = 0,
285
- currentLocation: n = 0,
286
- expectedLocation: s = 0,
287
- distance: i = x.distance,
288
- ignoreLocation: r = x.ignoreLocation
289
- } = {}) {
290
- const a = e / t.length;
291
- if (r)
292
- return a;
293
- const l = Math.abs(s - n);
294
- return i ? a + l / i : l ? 1 : a;
295
- }
296
- function Et(t = [], e = x.minMatchCharLength) {
297
- let n = [], s = -1, i = -1, r = 0;
298
- for (let a = t.length; r < a; r += 1) {
299
- let l = t[r];
300
- l && s === -1 ? s = r : !l && s !== -1 && (i = r - 1, i - s + 1 >= e && n.push([s, i]), s = -1);
301
- }
302
- return t[r - 1] && r - s >= e && n.push([s, r - 1]), n;
303
- }
304
- const Y = 32;
305
- function kt(t, e, n, {
306
- location: s = x.location,
307
- distance: i = x.distance,
308
- threshold: r = x.threshold,
309
- findAllMatches: a = x.findAllMatches,
310
- minMatchCharLength: l = x.minMatchCharLength,
311
- includeMatches: c = x.includeMatches,
312
- ignoreLocation: d = x.ignoreLocation
313
- } = {}) {
314
- if (e.length > Y)
315
- throw new Error(mt(Y));
316
- const o = e.length, p = t.length, h = Math.max(0, Math.min(s, p));
317
- let g = r, D = h;
318
- const C = l > 1 || c, w = C ? Array(p) : [];
319
- let F;
320
- for (; (F = t.indexOf(e, D)) > -1; ) {
321
- let I = ee(e, {
322
- currentLocation: F,
323
- expectedLocation: h,
324
- distance: i,
325
- ignoreLocation: d
326
- });
327
- if (g = Math.min(I, g), D = F + o, C) {
328
- let b = 0;
329
- for (; b < o; )
330
- w[F + b] = 1, b += 1;
331
- }
332
- }
333
- D = -1;
334
- let E = [], k = 1, T = o + p;
335
- const H = 1 << o - 1;
336
- for (let I = 0; I < o; I += 1) {
337
- let b = 0, z = T;
338
- for (; b < z; )
339
- ee(e, {
340
- errors: I,
341
- currentLocation: h + z,
342
- expectedLocation: h,
343
- distance: i,
344
- ignoreLocation: d
345
- }) <= g ? b = z : T = z, z = Math.floor((T - b) / 2 + b);
346
- T = z;
347
- let y = Math.max(1, h - z + 1), m = a ? p : Math.min(h + z, p) + o, N = Array(m + 2);
348
- N[m + 1] = (1 << I) - 1;
349
- for (let O = m; O >= y; O -= 1) {
350
- let K = O - 1, Q = n[t.charAt(K)];
351
- if (C && (w[K] = +!!Q), N[O] = (N[O + 1] << 1 | 1) & Q, I && (N[O] |= (E[O + 1] | E[O]) << 1 | 1 | E[O + 1]), N[O] & H && (k = ee(e, {
352
- errors: I,
353
- currentLocation: K,
354
- expectedLocation: h,
355
- distance: i,
356
- ignoreLocation: d
357
- }), k <= g)) {
358
- if (g = k, D = K, D <= h)
359
- break;
360
- y = Math.max(1, 2 * h - D);
361
- }
362
- }
363
- if (ee(e, {
364
- errors: I + 1,
365
- currentLocation: h,
366
- expectedLocation: h,
367
- distance: i,
368
- ignoreLocation: d
369
- }) > g)
370
- break;
371
- E = N;
372
- }
373
- const M = {
374
- isMatch: D >= 0,
375
- // Count exact matches (those with a score of 0) to be "almost" exact
376
- score: Math.max(1e-3, k)
377
- };
378
- if (C) {
379
- const I = Et(w, l);
380
- I.length ? c && (M.indices = I) : M.isMatch = !1;
381
- }
382
- return M;
383
- }
384
- function Mt(t) {
385
- let e = {};
386
- for (let n = 0, s = t.length; n < s; n += 1) {
387
- const i = t.charAt(n);
388
- e[i] = (e[i] || 0) | 1 << s - n - 1;
389
- }
390
- return e;
391
- }
392
- const te = String.prototype.normalize ? ((t) => t.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g, "")) : ((t) => t);
393
- class Fe {
394
- constructor(e, {
395
- location: n = x.location,
396
- threshold: s = x.threshold,
397
- distance: i = x.distance,
398
- includeMatches: r = x.includeMatches,
399
- findAllMatches: a = x.findAllMatches,
400
- minMatchCharLength: l = x.minMatchCharLength,
401
- isCaseSensitive: c = x.isCaseSensitive,
402
- ignoreDiacritics: d = x.ignoreDiacritics,
403
- ignoreLocation: o = x.ignoreLocation
404
- } = {}) {
405
- if (this.options = {
406
- location: n,
407
- threshold: s,
408
- distance: i,
409
- includeMatches: r,
410
- findAllMatches: a,
411
- minMatchCharLength: l,
412
- isCaseSensitive: c,
413
- ignoreDiacritics: d,
414
- ignoreLocation: o
415
- }, e = c ? e : e.toLowerCase(), e = d ? te(e) : e, this.pattern = e, this.chunks = [], !this.pattern.length)
416
- return;
417
- const p = (g, D) => {
418
- this.chunks.push({
419
- pattern: g,
420
- alphabet: Mt(g),
421
- startIndex: D
422
- });
423
- }, h = this.pattern.length;
424
- if (h > Y) {
425
- let g = 0;
426
- const D = h % Y, C = h - D;
427
- for (; g < C; )
428
- p(this.pattern.substr(g, Y), g), g += Y;
429
- if (D) {
430
- const w = h - Y;
431
- p(this.pattern.substr(w), w);
432
- }
433
- } else
434
- p(this.pattern, 0);
435
- }
436
- searchIn(e) {
437
- const { isCaseSensitive: n, ignoreDiacritics: s, includeMatches: i } = this.options;
438
- if (e = n ? e : e.toLowerCase(), e = s ? te(e) : e, this.pattern === e) {
439
- let C = {
440
- isMatch: !0,
441
- score: 0
442
- };
443
- return i && (C.indices = [[0, e.length - 1]]), C;
444
- }
445
- const {
446
- location: r,
447
- distance: a,
448
- threshold: l,
449
- findAllMatches: c,
450
- minMatchCharLength: d,
451
- ignoreLocation: o
452
- } = this.options;
453
- let p = [], h = 0, g = !1;
454
- this.chunks.forEach(({ pattern: C, alphabet: w, startIndex: F }) => {
455
- const { isMatch: E, score: k, indices: T } = kt(e, C, w, {
456
- location: r + F,
457
- distance: a,
458
- threshold: l,
459
- findAllMatches: c,
460
- minMatchCharLength: d,
461
- includeMatches: i,
462
- ignoreLocation: o
463
- });
464
- E && (g = !0), h += k, E && T && (p = [...p, ...T]);
465
- });
466
- let D = {
467
- isMatch: g,
468
- score: g ? h / this.chunks.length : 1
469
- };
470
- return g && i && (D.indices = p), D;
471
- }
472
- }
473
- class W {
474
- constructor(e) {
475
- this.pattern = e;
476
- }
477
- static isMultiMatch(e) {
478
- return ye(e, this.multiRegex);
479
- }
480
- static isSingleMatch(e) {
481
- return ye(e, this.singleRegex);
482
- }
483
- search() {
484
- }
485
- }
486
- function ye(t, e) {
487
- const n = t.match(e);
488
- return n ? n[1] : null;
489
- }
490
- class $t extends W {
491
- constructor(e) {
492
- super(e);
493
- }
494
- static get type() {
495
- return "exact";
496
- }
497
- static get multiRegex() {
498
- return /^="(.*)"$/;
499
- }
500
- static get singleRegex() {
501
- return /^=(.*)$/;
502
- }
503
- search(e) {
504
- const n = e === this.pattern;
505
- return {
506
- isMatch: n,
507
- score: n ? 0 : 1,
508
- indices: [0, this.pattern.length - 1]
509
- };
510
- }
511
- }
512
- class Bt extends W {
513
- constructor(e) {
514
- super(e);
515
- }
516
- static get type() {
517
- return "inverse-exact";
518
- }
519
- static get multiRegex() {
520
- return /^!"(.*)"$/;
521
- }
522
- static get singleRegex() {
523
- return /^!(.*)$/;
524
- }
525
- search(e) {
526
- const s = e.indexOf(this.pattern) === -1;
527
- return {
528
- isMatch: s,
529
- score: s ? 0 : 1,
530
- indices: [0, e.length - 1]
531
- };
532
- }
533
- }
534
- class Ft extends W {
535
- constructor(e) {
536
- super(e);
537
- }
538
- static get type() {
539
- return "prefix-exact";
540
- }
541
- static get multiRegex() {
542
- return /^\^"(.*)"$/;
543
- }
544
- static get singleRegex() {
545
- return /^\^(.*)$/;
546
- }
547
- search(e) {
548
- const n = e.startsWith(this.pattern);
549
- return {
550
- isMatch: n,
551
- score: n ? 0 : 1,
552
- indices: [0, this.pattern.length - 1]
553
- };
554
- }
555
- }
556
- class It extends W {
557
- constructor(e) {
558
- super(e);
559
- }
560
- static get type() {
561
- return "inverse-prefix-exact";
562
- }
563
- static get multiRegex() {
564
- return /^!\^"(.*)"$/;
565
- }
566
- static get singleRegex() {
567
- return /^!\^(.*)$/;
568
- }
569
- search(e) {
570
- const n = !e.startsWith(this.pattern);
571
- return {
572
- isMatch: n,
573
- score: n ? 0 : 1,
574
- indices: [0, e.length - 1]
575
- };
576
- }
577
- }
578
- class St extends W {
579
- constructor(e) {
580
- super(e);
581
- }
582
- static get type() {
583
- return "suffix-exact";
584
- }
585
- static get multiRegex() {
586
- return /^"(.*)"\$$/;
587
- }
588
- static get singleRegex() {
589
- return /^(.*)\$$/;
590
- }
591
- search(e) {
592
- const n = e.endsWith(this.pattern);
593
- return {
594
- isMatch: n,
595
- score: n ? 0 : 1,
596
- indices: [e.length - this.pattern.length, e.length - 1]
597
- };
598
- }
599
- }
600
- class Rt extends W {
601
- constructor(e) {
602
- super(e);
603
- }
604
- static get type() {
605
- return "inverse-suffix-exact";
606
- }
607
- static get multiRegex() {
608
- return /^!"(.*)"\$$/;
609
- }
610
- static get singleRegex() {
611
- return /^!(.*)\$$/;
612
- }
613
- search(e) {
614
- const n = !e.endsWith(this.pattern);
615
- return {
616
- isMatch: n,
617
- score: n ? 0 : 1,
618
- indices: [0, e.length - 1]
619
- };
620
- }
621
- }
622
- class Ie extends W {
623
- constructor(e, {
624
- location: n = x.location,
625
- threshold: s = x.threshold,
626
- distance: i = x.distance,
627
- includeMatches: r = x.includeMatches,
628
- findAllMatches: a = x.findAllMatches,
629
- minMatchCharLength: l = x.minMatchCharLength,
630
- isCaseSensitive: c = x.isCaseSensitive,
631
- ignoreDiacritics: d = x.ignoreDiacritics,
632
- ignoreLocation: o = x.ignoreLocation
633
- } = {}) {
634
- super(e), this._bitapSearch = new Fe(e, {
635
- location: n,
636
- threshold: s,
637
- distance: i,
638
- includeMatches: r,
639
- findAllMatches: a,
640
- minMatchCharLength: l,
641
- isCaseSensitive: c,
642
- ignoreDiacritics: d,
643
- ignoreLocation: o
644
- });
645
- }
646
- static get type() {
647
- return "fuzzy";
648
- }
649
- static get multiRegex() {
650
- return /^"(.*)"$/;
651
- }
652
- static get singleRegex() {
653
- return /^(.*)$/;
654
- }
655
- search(e) {
656
- return this._bitapSearch.searchIn(e);
657
- }
658
- }
659
- class Se extends W {
660
- constructor(e) {
661
- super(e);
662
- }
663
- static get type() {
664
- return "include";
665
- }
666
- static get multiRegex() {
667
- return /^'"(.*)"$/;
668
- }
669
- static get singleRegex() {
670
- return /^'(.*)$/;
671
- }
672
- search(e) {
673
- let n = 0, s;
674
- const i = [], r = this.pattern.length;
675
- for (; (s = e.indexOf(this.pattern, n)) > -1; )
676
- n = s + r, i.push([s, n - 1]);
677
- const a = !!i.length;
678
- return {
679
- isMatch: a,
680
- score: a ? 0 : 1,
681
- indices: i
682
- };
683
- }
684
- }
685
- const de = [
686
- $t,
687
- Se,
688
- Ft,
689
- It,
690
- Rt,
691
- St,
692
- Bt,
693
- Ie
694
- ], Ae = de.length, Tt = / +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/, Nt = "|";
695
- function Ot(t, e = {}) {
696
- return t.split(Nt).map((n) => {
697
- let s = n.trim().split(Tt).filter((r) => r && !!r.trim()), i = [];
698
- for (let r = 0, a = s.length; r < a; r += 1) {
699
- const l = s[r];
700
- let c = !1, d = -1;
701
- for (; !c && ++d < Ae; ) {
702
- const o = de[d];
703
- let p = o.isMultiMatch(l);
704
- p && (i.push(new o(p, e)), c = !0);
705
- }
706
- if (!c)
707
- for (d = -1; ++d < Ae; ) {
708
- const o = de[d];
709
- let p = o.isSingleMatch(l);
710
- if (p) {
711
- i.push(new o(p, e));
712
- break;
713
- }
714
- }
715
- }
716
- return i;
717
- });
718
- }
719
- const Lt = /* @__PURE__ */ new Set([Ie.type, Se.type]);
720
- class Pt {
721
- constructor(e, {
722
- isCaseSensitive: n = x.isCaseSensitive,
723
- ignoreDiacritics: s = x.ignoreDiacritics,
724
- includeMatches: i = x.includeMatches,
725
- minMatchCharLength: r = x.minMatchCharLength,
726
- ignoreLocation: a = x.ignoreLocation,
727
- findAllMatches: l = x.findAllMatches,
728
- location: c = x.location,
729
- threshold: d = x.threshold,
730
- distance: o = x.distance
731
- } = {}) {
732
- this.query = null, this.options = {
733
- isCaseSensitive: n,
734
- ignoreDiacritics: s,
735
- includeMatches: i,
736
- minMatchCharLength: r,
737
- findAllMatches: l,
738
- ignoreLocation: a,
739
- location: c,
740
- threshold: d,
741
- distance: o
742
- }, e = n ? e : e.toLowerCase(), e = s ? te(e) : e, this.pattern = e, this.query = Ot(this.pattern, this.options);
743
- }
744
- static condition(e, n) {
745
- return n.useExtendedSearch;
746
- }
747
- searchIn(e) {
748
- const n = this.query;
749
- if (!n)
750
- return {
751
- isMatch: !1,
752
- score: 1
753
- };
754
- const { includeMatches: s, isCaseSensitive: i, ignoreDiacritics: r } = this.options;
755
- e = i ? e : e.toLowerCase(), e = r ? te(e) : e;
756
- let a = 0, l = [], c = 0;
757
- for (let d = 0, o = n.length; d < o; d += 1) {
758
- const p = n[d];
759
- l.length = 0, a = 0;
760
- for (let h = 0, g = p.length; h < g; h += 1) {
761
- const D = p[h], { isMatch: C, indices: w, score: F } = D.search(e);
762
- if (C) {
763
- if (a += 1, c += F, s) {
764
- const E = D.constructor.type;
765
- Lt.has(E) ? l = [...l, ...w] : l.push(w);
766
- }
767
- } else {
768
- c = 0, a = 0, l.length = 0;
769
- break;
770
- }
771
- }
772
- if (a) {
773
- let h = {
774
- isMatch: !0,
775
- score: c / a
776
- };
777
- return s && (h.indices = l), h;
778
- }
779
- }
780
- return {
781
- isMatch: !1,
782
- score: 1
783
- };
784
- }
785
- }
786
- const pe = [];
787
- function jt(...t) {
788
- pe.push(...t);
789
- }
790
- function fe(t, e) {
791
- for (let n = 0, s = pe.length; n < s; n += 1) {
792
- let i = pe[n];
793
- if (i.condition(t, e))
794
- return new i(t, e);
795
- }
796
- return new Fe(t, e);
797
- }
798
- const ne = {
799
- AND: "$and",
800
- OR: "$or"
801
- }, me = {
802
- PATH: "$path",
803
- PATTERN: "$val"
804
- }, ge = (t) => !!(t[ne.AND] || t[ne.OR]), zt = (t) => !!t[me.PATH], Vt = (t) => !U(t) && ke(t) && !ge(t), Ce = (t) => ({
805
- [ne.AND]: Object.keys(t).map((e) => ({
806
- [e]: t[e]
807
- }))
808
- });
809
- function Re(t, e, { auto: n = !0 } = {}) {
810
- const s = (i) => {
811
- let r = Object.keys(i);
812
- const a = zt(i);
813
- if (!a && r.length > 1 && !ge(i))
814
- return s(Ce(i));
815
- if (Vt(i)) {
816
- const c = a ? i[me.PATH] : r[0], d = a ? i[me.PATTERN] : i[c];
817
- if (!V(d))
818
- throw new Error(ft(c));
819
- const o = {
820
- keyId: ce(c),
821
- pattern: d
822
- };
823
- return n && (o.searcher = fe(d, e)), o;
824
- }
825
- let l = {
826
- children: [],
827
- operator: r[0]
828
- };
829
- return r.forEach((c) => {
830
- const d = i[c];
831
- U(d) && d.forEach((o) => {
832
- l.children.push(s(o));
833
- });
834
- }), l;
835
- };
836
- return ge(t) || (t = Ce(t)), s(t);
837
- }
838
- function Ut(t, { ignoreFieldNorm: e = x.ignoreFieldNorm }) {
839
- t.forEach((n) => {
840
- let s = 1;
841
- n.matches.forEach(({ key: i, norm: r, score: a }) => {
842
- const l = i ? i.weight : null;
843
- s *= Math.pow(
844
- a === 0 && l ? Number.EPSILON : a,
845
- (l || 1) * (e ? 1 : r)
846
- );
847
- }), n.score = s;
848
- });
849
- }
850
- function Wt(t, e) {
851
- const n = t.matches;
852
- e.matches = [], P(n) && n.forEach((s) => {
853
- if (!P(s.indices) || !s.indices.length)
854
- return;
855
- const { indices: i, value: r } = s;
856
- let a = {
857
- indices: i,
858
- value: r
859
- };
860
- s.key && (a.key = s.key.src), s.idx > -1 && (a.refIndex = s.idx), e.matches.push(a);
861
- });
862
- }
863
- function Ht(t, e) {
864
- e.score = t.score;
865
- }
866
- function Kt(t, e, {
867
- includeMatches: n = x.includeMatches,
868
- includeScore: s = x.includeScore
869
- } = {}) {
870
- const i = [];
871
- return n && i.push(Wt), s && i.push(Ht), t.map((r) => {
872
- const { idx: a } = r, l = {
873
- item: e[a],
874
- refIndex: a
875
- };
876
- return i.length && i.forEach((c) => {
877
- c(r, l);
878
- }), l;
879
- });
880
- }
881
- class X {
882
- constructor(e, n = {}, s) {
883
- this.options = { ...x, ...n }, this.options.useExtendedSearch, this._keyStore = new vt(this.options.keys), this.setCollection(e, s);
884
- }
885
- setCollection(e, n) {
886
- if (this._docs = e, n && !(n instanceof he))
887
- throw new Error(pt);
888
- this._myIndex = n || Be(this.options.keys, this._docs, {
889
- getFn: this.options.getFn,
890
- fieldNormWeight: this.options.fieldNormWeight
891
- });
892
- }
893
- add(e) {
894
- P(e) && (this._docs.push(e), this._myIndex.add(e));
895
- }
896
- remove(e = () => !1) {
897
- const n = [];
898
- for (let s = 0, i = this._docs.length; s < i; s += 1) {
899
- const r = this._docs[s];
900
- e(r, s) && (this.removeAt(s), s -= 1, i -= 1, n.push(r));
901
- }
902
- return n;
903
- }
904
- removeAt(e) {
905
- this._docs.splice(e, 1), this._myIndex.removeAt(e);
906
- }
907
- getIndex() {
908
- return this._myIndex;
909
- }
910
- search(e, { limit: n = -1 } = {}) {
911
- const {
912
- includeMatches: s,
913
- includeScore: i,
914
- shouldSort: r,
915
- sortFn: a,
916
- ignoreFieldNorm: l
917
- } = this.options;
918
- let c = V(e) ? V(this._docs[0]) ? this._searchStringList(e) : this._searchObjectList(e) : this._searchLogical(e);
919
- return Ut(c, { ignoreFieldNorm: l }), r && c.sort(a), Ee(n) && n > -1 && (c = c.slice(0, n)), Kt(c, this._docs, {
920
- includeMatches: s,
921
- includeScore: i
922
- });
923
- }
924
- _searchStringList(e) {
925
- const n = fe(e, this.options), { records: s } = this._myIndex, i = [];
926
- return s.forEach(({ v: r, i: a, n: l }) => {
927
- if (!P(r))
928
- return;
929
- const { isMatch: c, score: d, indices: o } = n.searchIn(r);
930
- c && i.push({
931
- item: r,
932
- idx: a,
933
- matches: [{ score: d, value: r, norm: l, indices: o }]
934
- });
935
- }), i;
936
- }
937
- _searchLogical(e) {
938
- const n = Re(e, this.options), s = (l, c, d) => {
939
- if (!l.children) {
940
- const { keyId: p, searcher: h } = l, g = this._findMatches({
941
- key: this._keyStore.get(p),
942
- value: this._myIndex.getValueForItemAtKeyId(c, p),
943
- searcher: h
944
- });
945
- return g && g.length ? [
946
- {
947
- idx: d,
948
- item: c,
949
- matches: g
950
- }
951
- ] : [];
952
- }
953
- const o = [];
954
- for (let p = 0, h = l.children.length; p < h; p += 1) {
955
- const g = l.children[p], D = s(g, c, d);
956
- if (D.length)
957
- o.push(...D);
958
- else if (l.operator === ne.AND)
959
- return [];
960
- }
961
- return o;
962
- }, i = this._myIndex.records, r = {}, a = [];
963
- return i.forEach(({ $: l, i: c }) => {
964
- if (P(l)) {
965
- let d = s(n, l, c);
966
- d.length && (r[c] || (r[c] = { idx: c, item: l, matches: [] }, a.push(r[c])), d.forEach(({ matches: o }) => {
967
- r[c].matches.push(...o);
968
- }));
969
- }
970
- }), a;
971
- }
972
- _searchObjectList(e) {
973
- const n = fe(e, this.options), { keys: s, records: i } = this._myIndex, r = [];
974
- return i.forEach(({ $: a, i: l }) => {
975
- if (!P(a))
976
- return;
977
- let c = [];
978
- s.forEach((d, o) => {
979
- c.push(
980
- ...this._findMatches({
981
- key: d,
982
- value: a[o],
983
- searcher: n
984
- })
985
- );
986
- }), c.length && r.push({
987
- idx: l,
988
- item: a,
989
- matches: c
990
- });
991
- }), r;
992
- }
993
- _findMatches({ key: e, value: n, searcher: s }) {
994
- if (!P(n))
995
- return [];
996
- let i = [];
997
- if (U(n))
998
- n.forEach(({ v: r, i: a, n: l }) => {
999
- if (!P(r))
1000
- return;
1001
- const { isMatch: c, score: d, indices: o } = s.searchIn(r);
1002
- c && i.push({
1003
- score: d,
1004
- key: e,
1005
- value: r,
1006
- idx: a,
1007
- norm: l,
1008
- indices: o
1009
- });
1010
- });
1011
- else {
1012
- const { v: r, n: a } = n, { isMatch: l, score: c, indices: d } = s.searchIn(r);
1013
- l && i.push({ score: c, key: e, value: r, norm: a, indices: d });
1014
- }
1015
- return i;
1016
- }
1017
- }
1018
- X.version = "7.1.0";
1019
- X.createIndex = Be;
1020
- X.parseIndex = wt;
1021
- X.config = x;
1022
- X.parseQuery = Re;
1023
- jt(Pt);
1024
- const G = (t) => t == null ? "—" : `€${t.toFixed(2)}`, Gt = (t) => {
1025
- if (!t) return "—";
1026
- if (t < 60) return `${t} min`;
1027
- const e = Math.floor(t / 60), n = t % 60;
1028
- return n > 0 ? `${e}h ${n}min` : `${e}h`;
1029
- }, Yt = (t) => {
1030
- switch (t) {
1031
- case "confirmed":
1032
- return "Confirmed";
1033
- case "completed":
1034
- return "Completed";
1035
- case "pending":
1036
- return "Pending";
1037
- case "cancelled":
1038
- return "Cancelled";
1039
- default:
1040
- return t || "Unknown";
1041
- }
1042
- }, be = (t) => {
1043
- switch (t) {
1044
- case "confirmed":
1045
- case "completed":
1046
- return "#16a34a";
1047
- // green-600
1048
- case "pending":
1049
- return "#ca8a04";
1050
- // yellow-600
1051
- case "cancelled":
1052
- return "#dc2626";
1053
- // red-600
1054
- default:
1055
- return "#6b7280";
1056
- }
1057
- }, Qt = (t, e = {}) => {
1058
- const n = `${t.customerInfo?.firstName || ""} ${t.customerInfo?.lastName || ""}`.trim() || "Unknown Customer", s = t.id?.slice(0, 8) || "—", i = (/* @__PURE__ */ new Date()).toLocaleDateString("en-US", {
1059
- year: "numeric",
1060
- month: "long",
1061
- day: "numeric"
1062
- }), r = `
1063
- <!DOCTYPE html>
1064
- <html lang="en">
1065
- <head>
1066
- <meta charset="UTF-8">
1067
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
1068
- <title>Reservation ${s}</title>
1069
- <style>
1070
- * {
1071
- margin: 0;
1072
- padding: 0;
1073
- box-sizing: border-box;
1074
- }
1075
-
1076
- body {
1077
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
1078
- line-height: 1.6;
1079
- color: #1f2937;
1080
- background: #fff;
1081
- padding: 40px;
1082
- max-width: 800px;
1083
- margin: 0 auto;
1084
- }
1085
-
1086
- .header {
1087
- display: flex;
1088
- justify-content: space-between;
1089
- align-items: flex-start;
1090
- margin-bottom: 40px;
1091
- padding-bottom: 20px;
1092
- border-bottom: 2px solid #e5e7eb;
1093
- }
1094
-
1095
- .company-info {
1096
- display: flex;
1097
- align-items: center;
1098
- gap: 16px;
1099
- }
1100
-
1101
- .company-logo {
1102
- max-height: 50px;
1103
- max-width: 150px;
1104
- object-fit: contain;
1105
- }
1106
-
1107
- .company-name {
1108
- font-size: 24px;
1109
- font-weight: 700;
1110
- color: #111827;
1111
- }
1112
-
1113
- .document-info {
1114
- text-align: right;
1115
- }
1116
-
1117
- .document-title {
1118
- font-size: 28px;
1119
- font-weight: 700;
1120
- color: #111827;
1121
- margin-bottom: 8px;
1122
- }
1123
-
1124
- .booking-id {
1125
- font-size: 14px;
1126
- color: #6b7280;
1127
- }
1128
-
1129
- .status-badge {
1130
- display: inline-block;
1131
- padding: 4px 12px;
1132
- border-radius: 9999px;
1133
- font-size: 12px;
1134
- font-weight: 600;
1135
- text-transform: uppercase;
1136
- margin-top: 8px;
1137
- }
1138
-
1139
- .section {
1140
- margin-bottom: 32px;
1141
- }
1142
-
1143
- .section-title {
1144
- font-size: 12px;
1145
- font-weight: 600;
1146
- text-transform: uppercase;
1147
- letter-spacing: 0.05em;
1148
- color: #6b7280;
1149
- margin-bottom: 12px;
1150
- }
1151
-
1152
- .section-content {
1153
- background: #f9fafb;
1154
- border-radius: 8px;
1155
- padding: 20px;
1156
- }
1157
-
1158
- .customer-name {
1159
- font-size: 18px;
1160
- font-weight: 600;
1161
- margin-bottom: 8px;
1162
- }
1163
-
1164
- .contact-info {
1165
- font-size: 14px;
1166
- color: #4b5563;
1167
- }
1168
-
1169
- .contact-info a {
1170
- color: #4b5563;
1171
- text-decoration: none;
1172
- }
1173
-
1174
- .grid {
1175
- display: grid;
1176
- grid-template-columns: 1fr 1fr;
1177
- gap: 16px;
1178
- }
1179
-
1180
- .info-card {
1181
- background: #f9fafb;
1182
- border-radius: 8px;
1183
- padding: 16px;
1184
- }
1185
-
1186
- .info-label {
1187
- font-size: 12px;
1188
- color: #6b7280;
1189
- margin-bottom: 4px;
1190
- }
1191
-
1192
- .info-value {
1193
- font-size: 16px;
1194
- font-weight: 600;
1195
- }
1196
-
1197
- .package-row {
1198
- display: flex;
1199
- justify-content: space-between;
1200
- align-items: flex-start;
1201
- }
1202
-
1203
- .package-name {
1204
- font-size: 16px;
1205
- font-weight: 600;
1206
- }
1207
-
1208
- .package-duration {
1209
- font-size: 14px;
1210
- color: #6b7280;
1211
- }
1212
-
1213
- .package-price {
1214
- font-size: 16px;
1215
- font-weight: 600;
1216
- }
1217
-
1218
- .payment-row {
1219
- display: flex;
1220
- justify-content: space-between;
1221
- padding: 8px 0;
1222
- font-size: 14px;
1223
- }
1224
-
1225
- .payment-label {
1226
- color: #6b7280;
1227
- }
1228
-
1229
- .payment-value {
1230
- font-weight: 500;
1231
- }
1232
-
1233
- .payment-value.green {
1234
- color: #16a34a;
1235
- }
1236
-
1237
- .payment-value.orange {
1238
- color: #ea580c;
1239
- }
1240
-
1241
- .payment-divider {
1242
- border-top: 1px solid #e5e7eb;
1243
- margin: 12px 0;
1244
- }
1245
-
1246
- .payment-total {
1247
- font-size: 16px;
1248
- font-weight: 600;
1249
- }
1250
-
1251
- .footer {
1252
- margin-top: 60px;
1253
- padding-top: 20px;
1254
- border-top: 1px solid #e5e7eb;
1255
- text-align: center;
1256
- font-size: 12px;
1257
- color: #9ca3af;
1258
- }
1259
-
1260
- @media print {
1261
- body {
1262
- padding: 20px;
1263
- }
1264
-
1265
- .no-print {
1266
- display: none;
1267
- }
1268
- }
1269
- </style>
1270
- </head>
1271
- <body>
1272
- <div class="header">
1273
- <div class="company-info">
1274
- ${e.companyLogo ? `<img src="${e.companyLogo}" alt="Logo" class="company-logo" />` : ""}
1275
- ${e.companyName ? `<span class="company-name">${e.companyName}</span>` : ""}
1276
- </div>
1277
- <div class="document-info">
1278
- <div class="document-title">Reservation</div>
1279
- <div class="booking-id">Booking #${s}</div>
1280
- <div
1281
- class="status-badge"
1282
- style="background-color: ${be(t.status)}20; color: ${be(t.status)};"
1283
- >
1284
- ${Yt(t.status)}
1285
- </div>
1286
- </div>
1287
- </div>
1288
-
1289
- <div class="section">
1290
- <div class="section-title">Customer</div>
1291
- <div class="section-content">
1292
- <div class="customer-name">${n}</div>
1293
- <div class="contact-info">
1294
- ${t.customerInfo?.email ? `<div>Email: <a href="mailto:${t.customerInfo.email}">${t.customerInfo.email}</a></div>` : ""}
1295
- ${t.customerInfo?.phone ? `<div>Phone: <a href="tel:${t.customerInfo.phone}">${t.customerInfo.phone}</a></div>` : ""}
1296
- </div>
1297
- </div>
1298
- </div>
1299
-
1300
- <div class="section">
1301
- <div class="section-title">Reservation Details</div>
1302
- <div class="grid">
1303
- <div class="info-card">
1304
- <div class="info-label">Date</div>
1305
- <div class="info-value">${e.date || "—"}</div>
1306
- </div>
1307
- <div class="info-card">
1308
- <div class="info-label">Time</div>
1309
- <div class="info-value">${t.startTime} - ${t.endTime}</div>
1310
- </div>
1311
- <div class="info-card">
1312
- <div class="info-label">Spots</div>
1313
- <div class="info-value">${t.spots || 1} ${(t.spots || 1) === 1 ? "person" : "people"}</div>
1314
- </div>
1315
- ${e.resourceName ? `
1316
- <div class="info-card">
1317
- <div class="info-label">Resource</div>
1318
- <div class="info-value">${e.resourceName}</div>
1319
- </div>
1320
- ` : ""}
1321
- ${e.agendaName ? `
1322
- <div class="info-card">
1323
- <div class="info-label">Service</div>
1324
- <div class="info-value">${e.agendaName}</div>
1325
- </div>
1326
- ` : ""}
1327
- </div>
1328
- </div>
1329
-
1330
- ${t.pricingOption ? `
1331
- <div class="section">
1332
- <div class="section-title">Package</div>
1333
- <div class="section-content">
1334
- <div class="package-row">
1335
- <div>
1336
- <div class="package-name">${t.pricingOption.name}</div>
1337
- <div class="package-duration">${Gt(t.pricingOption.duration)}</div>
1338
- </div>
1339
- <div class="package-price">${G(t.pricingOption.price)}</div>
1340
- </div>
1341
- </div>
1342
- </div>
1343
- ` : ""}
1344
-
1345
- <div class="section">
1346
- <div class="section-title">Payment Summary</div>
1347
- <div class="section-content">
1348
- <div class="payment-row">
1349
- <span class="payment-label">Base price</span>
1350
- <span class="payment-value">${G(t.reservationBasePrice)}</span>
1351
- </div>
1352
- ${t.reservationAddOnsPrice ? `
1353
- <div class="payment-row">
1354
- <span class="payment-label">Add-ons</span>
1355
- <span class="payment-value">${G(t.reservationAddOnsPrice)}</span>
1356
- </div>
1357
- ` : ""}
1358
- ${t.discount ? `
1359
- <div class="payment-row">
1360
- <span class="payment-label">Discount</span>
1361
- <span class="payment-value green">-${G(t.discount)}</span>
1362
- </div>
1363
- ` : ""}
1364
-
1365
- <div class="payment-divider"></div>
1366
-
1367
- <div class="payment-row payment-total">
1368
- <span>Reservation Total</span>
1369
- <span>${G(t.reservationPrice)}</span>
1370
- </div>
1371
-
1372
- ${t.amountPaid !== void 0 || t.amountDue !== void 0 ? `
1373
- <div class="payment-divider"></div>
1374
-
1375
- ${t.amountPaid !== void 0 ? `
1376
- <div class="payment-row">
1377
- <span class="payment-label">Amount paid</span>
1378
- <span class="payment-value green">${G(t.amountPaid)}</span>
1379
- </div>
1380
- ` : ""}
1381
-
1382
- ${t.amountDue !== void 0 && t.amountDue > 0 ? `
1383
- <div class="payment-row">
1384
- <span class="payment-label">Amount due</span>
1385
- <span class="payment-value orange">${G(t.amountDue)}</span>
1386
- </div>
1387
- ` : ""}
1388
- ` : ""}
1389
- </div>
1390
- </div>
1391
-
1392
- <div class="footer">
1393
- <p>Generated on ${i}</p>
1394
- ${e.companyName ? `<p>${e.companyName}</p>` : ""}
1395
- </div>
1396
- </body>
1397
- </html>
1398
- `, a = window.open("", "_blank");
1399
- a && (a.document.write(r), a.document.close(), a.onload = () => {
1400
- a.print();
1401
- });
1402
- }, Jt = { class: "grid gap-4 py-4" }, Xt = { class: "grid gap-2" }, Zt = { class: "grid gap-2" }, qt = { class: "grid gap-2" }, en = /* @__PURE__ */ se({
1403
- __name: "CancelReservationDialog",
1404
- emits: ["cancel"],
1405
- setup(t, { expose: e, emit: n }) {
1406
- const { config: s } = oe(), { sendMail: i } = we(s.mailAccount), r = n, a = R(!1), l = R(""), c = R(""), d = R(""), o = (h) => {
1407
- a.value = !0, h && (l.value = h.customerInfo?.email, c.value = "Cancellation of your reservation - " + new Date(h.date)?.toDateString(), d.value = `Dear ${h.customerInfo?.firstName ?? ""} ${h.customerInfo?.lastName ?? ""},
1408
-
1409
- We are writing to inform you that your reservation scheduled for ${new Date(h.date)?.toDateString()} at ${h.startTime} has been cancelled.
1410
-
1411
- Please accept our sincere apologies for any inconvenience this may cause. We would be happy to help you find an alternative time that works for you.`);
1412
- }, p = () => {
1413
- if (!l.value || !c.value || !d.value) return alert("Please fill in all the fields.");
1414
- i({
1415
- to: l.value,
1416
- subject: c.value,
1417
- body: d.value
1418
- }), a.value = !1;
1419
- const { $confetti: h } = useNuxtApp();
1420
- h(), r("cancel");
1421
- };
1422
- return e({
1423
- openDialog: o
1424
- }), (h, g) => {
1425
- const D = _("DialogTitle"), C = _("DialogDescription"), w = _("DialogHeader"), F = _("Label"), E = _("Input"), k = _("Textarea"), T = _("Button"), H = _("DialogFooter"), M = _("DialogScrollContent"), I = _("Dialog");
1426
- return B(), J(I, {
1427
- open: a.value,
1428
- "onUpdate:open": g[4] || (g[4] = (b) => a.value = b)
1429
- }, {
1430
- default: v(() => [
1431
- u(M, { class: "sm:max-w-3xl" }, {
1432
- default: v(() => [
1433
- u(w, null, {
1434
- default: v(() => [
1435
- u(D, null, {
1436
- default: v(() => [...g[5] || (g[5] = [
1437
- A(" Cancel Reservation ", -1)
1438
- ])]),
1439
- _: 1
1440
- }),
1441
- u(C)
1442
- ]),
1443
- _: 1
1444
- }),
1445
- f("div", Jt, [
1446
- f("div", Xt, [
1447
- u(F, null, {
1448
- default: v(() => [...g[6] || (g[6] = [
1449
- A("To:", -1)
1450
- ])]),
1451
- _: 1
1452
- }),
1453
- u(E, {
1454
- modelValue: l.value,
1455
- "onUpdate:modelValue": g[0] || (g[0] = (b) => l.value = b)
1456
- }, null, 8, ["modelValue"])
1457
- ]),
1458
- f("div", Zt, [
1459
- u(F, null, {
1460
- default: v(() => [...g[7] || (g[7] = [
1461
- A("Subject:", -1)
1462
- ])]),
1463
- _: 1
1464
- }),
1465
- u(E, {
1466
- modelValue: c.value,
1467
- "onUpdate:modelValue": g[1] || (g[1] = (b) => c.value = b)
1468
- }, null, 8, ["modelValue"])
1469
- ]),
1470
- f("div", qt, [
1471
- u(F, null, {
1472
- default: v(() => [...g[8] || (g[8] = [
1473
- A("Body:", -1)
1474
- ])]),
1475
- _: 1
1476
- }),
1477
- u(k, {
1478
- modelValue: d.value,
1479
- "onUpdate:modelValue": g[2] || (g[2] = (b) => d.value = b)
1480
- }, null, 8, ["modelValue"])
1481
- ])
1482
- ]),
1483
- u(H, null, {
1484
- default: v(() => [
1485
- u(T, {
1486
- variant: "outline",
1487
- onClick: g[3] || (g[3] = (b) => a.value = !1)
1488
- }, {
1489
- default: v(() => [...g[9] || (g[9] = [
1490
- A("Close", -1)
1491
- ])]),
1492
- _: 1
1493
- }),
1494
- u(T, {
1495
- variant: "destructive",
1496
- onClick: p
1497
- }, {
1498
- default: v(() => [...g[10] || (g[10] = [
1499
- A("Cancel reservation", -1)
1500
- ])]),
1501
- _: 1
1502
- })
1503
- ]),
1504
- _: 1
1505
- })
1506
- ]),
1507
- _: 1
1508
- })
1509
- ]),
1510
- _: 1
1511
- }, 8, ["open"]);
1512
- };
1513
- }
1514
- }), tn = { class: "grid gap-4 py-4" }, nn = { class: "grid gap-2" }, sn = { class: "grid gap-2" }, on = { class: "grid gap-2" }, an = /* @__PURE__ */ se({
1515
- __name: "ResendConfirmationDialog",
1516
- setup(t, { expose: e }) {
1517
- const { config: n } = oe(), { sendMail: s } = we(n.mailAccount), i = R(!1), r = R(""), a = R(""), l = R(""), c = (o) => {
1518
- i.value = !0, o && (r.value = o.customerInfo?.email, a.value = "Confirmation: Your reservation for " + new Date(o.date)?.toDateString(), l.value = `Dear ${o.customerInfo?.firstName ?? ""} ${o.customerInfo?.lastName ?? ""},
1519
-
1520
- This email confirms your reservation for ${new Date(o.date)?.toDateString()} at ${o.startTime}.
1521
-
1522
- We've got everything ready for you and look forward to your visit! If you need to make any changes or have special requests, please let us know.`);
1523
- }, d = () => {
1524
- if (!r.value || !a.value || !l.value) return alert("Please fill in all the fields.");
1525
- s({
1526
- to: r.value,
1527
- subject: a.value,
1528
- body: l.value
1529
- }), i.value = !1;
1530
- const { $confetti: o } = useNuxtApp();
1531
- o();
1532
- };
1533
- return e({
1534
- openDialog: c
1535
- }), (o, p) => {
1536
- const h = _("DialogTitle"), g = _("DialogDescription"), D = _("DialogHeader"), C = _("Label"), w = _("Input"), F = _("Textarea"), E = _("Button"), k = _("DialogFooter"), T = _("DialogScrollContent"), H = _("Dialog");
1537
- return B(), J(H, {
1538
- open: i.value,
1539
- "onUpdate:open": p[4] || (p[4] = (M) => i.value = M)
1540
- }, {
1541
- default: v(() => [
1542
- u(T, { class: "sm:max-w-3xl" }, {
1543
- default: v(() => [
1544
- u(D, null, {
1545
- default: v(() => [
1546
- u(h, null, {
1547
- default: v(() => [...p[5] || (p[5] = [
1548
- A(" (Re)send Confirmation Mail ", -1)
1549
- ])]),
1550
- _: 1
1551
- }),
1552
- u(g)
1553
- ]),
1554
- _: 1
1555
- }),
1556
- f("div", tn, [
1557
- f("div", nn, [
1558
- u(C, null, {
1559
- default: v(() => [...p[6] || (p[6] = [
1560
- A("To:", -1)
1561
- ])]),
1562
- _: 1
1563
- }),
1564
- u(w, {
1565
- modelValue: r.value,
1566
- "onUpdate:modelValue": p[0] || (p[0] = (M) => r.value = M)
1567
- }, null, 8, ["modelValue"])
1568
- ]),
1569
- f("div", sn, [
1570
- u(C, null, {
1571
- default: v(() => [...p[7] || (p[7] = [
1572
- A("Subject:", -1)
1573
- ])]),
1574
- _: 1
1575
- }),
1576
- u(w, {
1577
- modelValue: a.value,
1578
- "onUpdate:modelValue": p[1] || (p[1] = (M) => a.value = M)
1579
- }, null, 8, ["modelValue"])
1580
- ]),
1581
- f("div", on, [
1582
- u(C, null, {
1583
- default: v(() => [...p[8] || (p[8] = [
1584
- A("Body:", -1)
1585
- ])]),
1586
- _: 1
1587
- }),
1588
- u(F, {
1589
- modelValue: l.value,
1590
- "onUpdate:modelValue": p[2] || (p[2] = (M) => l.value = M)
1591
- }, null, 8, ["modelValue"])
1592
- ])
1593
- ]),
1594
- u(k, null, {
1595
- default: v(() => [
1596
- u(E, {
1597
- variant: "outline",
1598
- onClick: p[3] || (p[3] = (M) => i.value = !1)
1599
- }, {
1600
- default: v(() => [...p[9] || (p[9] = [
1601
- A("Close", -1)
1602
- ])]),
1603
- _: 1
1604
- }),
1605
- u(E, { onClick: d }, {
1606
- default: v(() => [...p[10] || (p[10] = [
1607
- A("Send Mail", -1)
1608
- ])]),
1609
- _: 1
1610
- })
1611
- ]),
1612
- _: 1
1613
- })
1614
- ]),
1615
- _: 1
1616
- })
1617
- ]),
1618
- _: 1
1619
- }, 8, ["open"]);
1620
- };
1621
- }
1622
- }), rn = /* @__PURE__ */ se({
1623
- __name: "TransferReservationDialog",
1624
- setup(t, { expose: e }) {
1625
- const { config: n } = oe(), s = R(!1);
1626
- return e({
1627
- openDialog: () => {
1628
- s.value = !0;
1629
- }
1630
- }), (r, a) => {
1631
- const l = _("DialogTitle"), c = _("DialogDescription"), d = _("DialogHeader"), o = _("Button"), p = _("DialogFooter"), h = _("DialogScrollContent"), g = _("Dialog");
1632
- return B(), J(g, {
1633
- open: s.value,
1634
- "onUpdate:open": a[2] || (a[2] = (D) => s.value = D)
1635
- }, {
1636
- default: v(() => [
1637
- u(h, { class: "sm:max-w-3xl" }, {
1638
- default: v(() => [
1639
- u(d, null, {
1640
- default: v(() => [
1641
- u(l, null, {
1642
- default: v(() => [...a[3] || (a[3] = [
1643
- A(" Transfer Reservation ", -1)
1644
- ])]),
1645
- _: 1
1646
- }),
1647
- u(c)
1648
- ]),
1649
- _: 1
1650
- }),
1651
- a[6] || (a[6] = f("div", { class: "py-4" }, null, -1)),
1652
- u(p, null, {
1653
- default: v(() => [
1654
- u(o, {
1655
- variant: "outline",
1656
- onClick: a[0] || (a[0] = (D) => s.value = !1)
1657
- }, {
1658
- default: v(() => [...a[4] || (a[4] = [
1659
- A("Close", -1)
1660
- ])]),
1661
- _: 1
1662
- }),
1663
- u(o, {
1664
- onClick: a[1] || (a[1] = (D) => s.value = !1)
1665
- }, {
1666
- default: v(() => [...a[5] || (a[5] = [
1667
- A("Transfer reservation", -1)
1668
- ])]),
1669
- _: 1
1670
- })
1671
- ]),
1672
- _: 1
1673
- })
1674
- ]),
1675
- _: 1
1676
- })
1677
- ]),
1678
- _: 1
1679
- }, 8, ["open"]);
1680
- };
1681
- }
1682
- }), ln = {
1683
- key: 0,
1684
- class: "space-y-6 py-4"
1685
- }, un = { class: "space-y-3" }, cn = { class: "bg-muted/30 rounded-lg p-4 space-y-3" }, dn = { class: "flex items-center gap-3" }, pn = { class: "h-10 w-10 rounded-full bg-primary/10 flex items-center justify-center" }, fn = { class: "font-medium" }, mn = { class: "grid gap-2 text-sm" }, gn = {
1686
- key: 0,
1687
- class: "flex items-center gap-2 text-muted-foreground"
1688
- }, hn = ["href"], vn = {
1689
- key: 1,
1690
- class: "flex items-center gap-2 text-muted-foreground"
1691
- }, xn = ["href"], _n = { class: "space-y-3" }, Dn = { class: "grid grid-cols-2 gap-3" }, yn = { class: "bg-muted/30 rounded-lg p-3" }, An = { class: "flex items-center gap-2 text-muted-foreground mb-1" }, Cn = { class: "font-medium" }, bn = { class: "bg-muted/30 rounded-lg p-3" }, wn = { class: "flex items-center gap-2 text-muted-foreground mb-1" }, En = { class: "font-medium" }, kn = {
1692
- key: 0,
1693
- class: "space-y-3"
1694
- }, Mn = { class: "bg-muted/30 rounded-lg p-4" }, $n = { class: "flex items-start justify-between" }, Bn = { class: "flex items-start gap-3" }, Fn = { class: "h-9 w-9 rounded-lg bg-primary/10 flex items-center justify-center mt-0.5" }, In = { class: "font-medium" }, Sn = { class: "text-sm text-muted-foreground" }, Rn = { class: "font-semibold" }, Tn = { class: "space-y-3" }, Nn = { class: "bg-muted/30 rounded-lg p-4 space-y-3" }, On = { class: "space-y-2 text-sm" }, Ln = { class: "flex justify-between" }, Pn = {
1695
- key: 0,
1696
- class: "flex justify-between"
1697
- }, jn = {
1698
- key: 1,
1699
- class: "flex justify-between text-green-600 dark:text-green-400"
1700
- }, zn = { class: "flex justify-between font-semibold" }, Vn = {
1701
- key: 1,
1702
- class: "space-y-2 text-sm"
1703
- }, Un = {
1704
- key: 0,
1705
- class: "flex justify-between"
1706
- }, Wn = { class: "text-muted-foreground flex items-center gap-1.5" }, Hn = { class: "text-green-600 dark:text-green-400" }, Kn = {
1707
- key: 1,
1708
- class: "flex justify-between"
1709
- }, Gn = { class: "text-muted-foreground flex items-center gap-1.5" }, Yn = { class: "text-orange-600 dark:text-orange-400 font-medium" }, qn = /* @__PURE__ */ se({
1710
- __name: "ReservationDetailDialog",
1711
- emits: ["cancelled"],
1712
- setup(t, { expose: e, emit: n }) {
1713
- const { hasPermission: s } = it(), { config: i } = oe(), r = at(i.project), { confirm: a } = rt(), l = Ve("event", R(null)), c = n, d = R(!1), o = R(null), p = R(!1), h = R(null), g = R(null), D = R(null), C = (y) => {
1714
- o.value = y, d.value = !0;
1715
- }, w = re(() => o.value?.customerInfo && `${o.value.customerInfo.firstName} ${o.value.customerInfo.lastName}`.trim() || "Unknown Customer"), F = re(() => {
1716
- let y = o.value?.status;
1717
- const m = o.value?.reservationStatus;
1718
- switch (["needs_approval", "rejected", "approved"].includes(m) && (y = m), y) {
1719
- case "needs_approval":
1720
- return { label: "needs approval", class: "bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400" };
1721
- case "rejected":
1722
- return { label: "rejected", class: "bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400" };
1723
- case "approved":
1724
- return { label: "approved", class: "bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400" };
1725
- case "pending":
1726
- return { label: "pending", class: "bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400" };
1727
- case "cancelled":
1728
- return { label: "cancelled", class: "bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400" };
1729
- case "confirmed":
1730
- return { label: "confirmed", class: "bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400" };
1731
- default:
1732
- return { label: y || "unknown", class: "bg-muted text-muted-foreground" };
1733
- }
1734
- }), E = re(() => o.value?.status === "cancelled"), k = (y) => y == null || typeof y != "number" ? "—" : `€${y?.toFixed(2)}`, T = (y) => {
1735
- if (!y) return "—";
1736
- if (y < 60) return `${y} min`;
1737
- const m = Math.floor(y / 60), N = y % 60;
1738
- return N > 0 ? `${m}h ${N}min` : `${m}h`;
1739
- }, H = () => {
1740
- if (!o.value) return;
1741
- let y = "";
1742
- const m = l?.value?.date;
1743
- if (m)
1744
- try {
1745
- y = new Date(m).toLocaleDateString("en-US", {
1746
- weekday: "long",
1747
- year: "numeric",
1748
- month: "long",
1749
- day: "numeric"
1750
- });
1751
- } catch {
1752
- y = m;
1753
- }
1754
- const N = {
1755
- date: y,
1756
- resourceName: l?.value?.resource?.name
1757
- };
1758
- Qt(o.value, N);
1759
- }, M = () => {
1760
- g.value?.openDialog(o.value);
1761
- }, I = () => {
1762
- h.value?.openDialog(o.value);
1763
- }, b = async () => {
1764
- if (o.value?.id) {
1765
- p.value = !0;
1766
- try {
1767
- await r.update(i.reservationsCollection, o.value.id, {
1768
- status: "cancelled",
1769
- cancelledAt: (/* @__PURE__ */ new Date()).toISOString()
1770
- }), o.value.status = "cancelled", xe.success("Reservation cancelled successfully"), c("cancelled", o.value.id), d.value = !1;
1771
- } catch (y) {
1772
- console.error("Error cancelling reservation:", y), xe.error("Failed to cancel reservation");
1773
- } finally {
1774
- p.value = !1;
1775
- }
1776
- }
1777
- }, z = () => {
1778
- console.log("Cancel with coupon:", o.value?.id);
1779
- };
1780
- return e({
1781
- openDialog: C
1782
- }), (y, m) => {
1783
- const N = _("DialogTitle"), Z = _("DialogDescription"), O = _("DialogHeader"), K = _("Separator"), Q = _("Button"), Te = _("DropdownMenuTrigger"), ie = _("DropdownMenuLabel"), q = _("DropdownMenuItem"), ae = _("DropdownMenuGroup"), ve = _("DropdownMenuSeparator"), Ne = _("DropdownMenuContent"), Oe = _("DropdownMenu"), Le = _("DialogFooter"), Pe = _("DialogScrollContent"), je = _("Dialog");
1784
- return B(), j(le, null, [
1785
- u(je, {
1786
- open: d.value,
1787
- "onUpdate:open": m[0] || (m[0] = (ze) => d.value = ze)
1788
- }, {
1789
- default: v(() => [
1790
- u(Pe, { class: "sm:max-w-xl" }, {
1791
- default: v(() => [
1792
- u(O, null, {
1793
- default: v(() => [
1794
- u(N, { class: "flex items-center gap-3" }, {
1795
- default: v(() => [
1796
- m[1] || (m[1] = f("span", null, "Reservation Details", -1)),
1797
- f("span", {
1798
- class: Ue(["px-2.5 py-1 text-xs font-medium rounded-full", F.value.class])
1799
- }, $(F.value.label), 3)
1800
- ]),
1801
- _: 1
1802
- }),
1803
- u(Z, null, {
1804
- default: v(() => [
1805
- A(" Booking #" + $(o.value?.id?.slice(0, 8) || "—"), 1)
1806
- ]),
1807
- _: 1
1808
- })
1809
- ]),
1810
- _: 1
1811
- }),
1812
- o.value ? (B(), j("div", ln, [
1813
- f("div", un, [
1814
- m[2] || (m[2] = f("h3", { class: "text-sm font-semibold text-muted-foreground uppercase tracking-wide" }, "Customer", -1)),
1815
- f("div", cn, [
1816
- f("div", dn, [
1817
- f("div", pn, [
1818
- u(S(We), {
1819
- size: 20,
1820
- class: "text-primary"
1821
- })
1822
- ]),
1823
- f("div", null, [
1824
- f("p", fn, $(w.value), 1)
1825
- ])
1826
- ]),
1827
- f("div", mn, [
1828
- o.value.customerInfo?.email ? (B(), j("div", gn, [
1829
- u(S(He), { size: 14 }),
1830
- f("a", {
1831
- href: `mailto:${o.value.customerInfo.email}`,
1832
- class: "hover:text-foreground transition-colors"
1833
- }, $(o.value.customerInfo.email), 9, hn)
1834
- ])) : L("", !0),
1835
- o.value.customerInfo?.phone ? (B(), j("div", vn, [
1836
- u(S(Ke), { size: 14 }),
1837
- f("a", {
1838
- href: `tel:${o.value.customerInfo.phone}`,
1839
- class: "hover:text-foreground transition-colors"
1840
- }, $(o.value.customerInfo.phone), 9, xn)
1841
- ])) : L("", !0)
1842
- ])
1843
- ])
1844
- ]),
1845
- f("div", _n, [
1846
- m[5] || (m[5] = f("h3", { class: "text-sm font-semibold text-muted-foreground uppercase tracking-wide" }, "Reservation", -1)),
1847
- f("div", Dn, [
1848
- f("div", yn, [
1849
- f("div", An, [
1850
- u(S(Ge), { size: 14 }),
1851
- m[3] || (m[3] = f("span", { class: "text-xs" }, "Time", -1))
1852
- ]),
1853
- f("p", Cn, $(o.value.startTime) + " - " + $(o.value.endTime), 1)
1854
- ]),
1855
- f("div", bn, [
1856
- f("div", wn, [
1857
- u(S(Ye), { size: 14 }),
1858
- m[4] || (m[4] = f("span", { class: "text-xs" }, "Spots", -1))
1859
- ]),
1860
- f("p", En, $(o.value.spots || 1) + " " + $(o.value.spots === 1 ? "person" : "people"), 1)
1861
- ])
1862
- ])
1863
- ]),
1864
- o.value.pricingOption ? (B(), j("div", kn, [
1865
- m[6] || (m[6] = f("h3", { class: "text-sm font-semibold text-muted-foreground uppercase tracking-wide" }, "Package", -1)),
1866
- f("div", Mn, [
1867
- f("div", $n, [
1868
- f("div", Bn, [
1869
- f("div", Fn, [
1870
- u(S(Qe), {
1871
- size: 18,
1872
- class: "text-primary"
1873
- })
1874
- ]),
1875
- f("div", null, [
1876
- f("p", In, $(o.value.pricingOption.name), 1),
1877
- f("p", Sn, $(T(o.value.pricingOption.duration)), 1)
1878
- ])
1879
- ]),
1880
- f("p", Rn, $(k(o.value.pricingOption.price)), 1)
1881
- ])
1882
- ])
1883
- ])) : L("", !0),
1884
- f("div", Tn, [
1885
- m[13] || (m[13] = f("h3", { class: "text-sm font-semibold text-muted-foreground uppercase tracking-wide" }, "Payment", -1)),
1886
- f("div", Nn, [
1887
- f("div", On, [
1888
- f("div", Ln, [
1889
- m[7] || (m[7] = f("span", { class: "text-muted-foreground" }, "Base price", -1)),
1890
- f("span", null, $(k(o.value.reservationBasePrice)), 1)
1891
- ]),
1892
- o.value.reservationAddOnsPrice ? (B(), j("div", Pn, [
1893
- m[8] || (m[8] = f("span", { class: "text-muted-foreground" }, "Add-ons", -1)),
1894
- f("span", null, $(k(o.value.reservationAddOnsPrice)), 1)
1895
- ])) : L("", !0),
1896
- o.value.discount ? (B(), j("div", jn, [
1897
- m[9] || (m[9] = f("span", null, "Discount", -1)),
1898
- f("span", null, "-" + $(k(o.value.discount)), 1)
1899
- ])) : L("", !0)
1900
- ]),
1901
- u(K),
1902
- f("div", zn, [
1903
- m[10] || (m[10] = f("span", null, "Reservation Total", -1)),
1904
- f("span", null, $(k(o.value.reservationPrice)), 1)
1905
- ]),
1906
- o.value.amountPaid !== void 0 || o.value.amountDue !== void 0 ? (B(), J(K, { key: 0 })) : L("", !0),
1907
- o.value.amountPaid !== void 0 || o.value.amountDue !== void 0 ? (B(), j("div", Vn, [
1908
- o.value.amountPaid !== void 0 ? (B(), j("div", Un, [
1909
- f("span", Wn, [
1910
- u(S(Je), { size: 14 }),
1911
- m[11] || (m[11] = A(" Amount paid ", -1))
1912
- ]),
1913
- f("span", Hn, $(k(o.value.amountPaid)), 1)
1914
- ])) : L("", !0),
1915
- o.value.amountDue !== void 0 && o.value.amountDue > 0 ? (B(), j("div", Kn, [
1916
- f("span", Gn, [
1917
- u(S(Xe), { size: 14 }),
1918
- m[12] || (m[12] = A(" Amount due ", -1))
1919
- ]),
1920
- f("span", Yn, $(k(o.value.amountDue)), 1)
1921
- ])) : L("", !0)
1922
- ])) : L("", !0)
1923
- ])
1924
- ])
1925
- ])) : L("", !0),
1926
- u(Le, { class: "gap-2 sm:justify-between" }, {
1927
- default: v(() => [
1928
- o.value.reservationStatus === "needs_approval" ? (B(), j(le, { key: 0 }, [
1929
- u(Q, {
1930
- variant: "destructive",
1931
- onClick: M
1932
- }, {
1933
- default: v(() => [
1934
- u(S(Ze), { size: 16 }),
1935
- m[14] || (m[14] = A(" Reject Reservation ", -1))
1936
- ]),
1937
- _: 1
1938
- }),
1939
- u(Q, { onClick: M }, {
1940
- default: v(() => [
1941
- u(S(qe), { size: 16 }),
1942
- m[15] || (m[15] = A(" Approve Reservation ", -1))
1943
- ]),
1944
- _: 1
1945
- })
1946
- ], 64)) : o.value.status === "confirmed" ? (B(), J(Oe, { key: 1 }, {
1947
- default: v(() => [
1948
- u(Te, { "as-child": "" }, {
1949
- default: v(() => [
1950
- u(Q, {
1951
- variant: "outline",
1952
- class: "gap-2"
1953
- }, {
1954
- default: v(() => [
1955
- u(S(et), { size: 16 }),
1956
- m[16] || (m[16] = A(" Actions ", -1))
1957
- ]),
1958
- _: 1
1959
- })
1960
- ]),
1961
- _: 1
1962
- }),
1963
- u(Ne, {
1964
- class: "w-60",
1965
- align: "start"
1966
- }, {
1967
- default: v(() => [
1968
- u(ie, { class: "text-xs text-muted-foreground font-normal" }, {
1969
- default: v(() => [...m[17] || (m[17] = [
1970
- A(" Reservation Actions ", -1)
1971
- ])]),
1972
- _: 1
1973
- }),
1974
- u(ae, null, {
1975
- default: v(() => [
1976
- u(q, {
1977
- onClick: H,
1978
- class: "gap-2 cursor-pointer"
1979
- }, {
1980
- default: v(() => [
1981
- u(S(tt), {
1982
- size: 16,
1983
- class: "text-muted-foreground"
1984
- }),
1985
- m[18] || (m[18] = f("span", null, "Download PDF", -1))
1986
- ]),
1987
- _: 1
1988
- })
1989
- ]),
1990
- _: 1
1991
- }),
1992
- u(ve),
1993
- u(ae, null, {
1994
- default: v(() => [
1995
- u(ie, { class: "text-xs text-muted-foreground font-normal" }, {
1996
- default: v(() => [...m[19] || (m[19] = [
1997
- A(" Communication ", -1)
1998
- ])]),
1999
- _: 1
2000
- }),
2001
- u(q, {
2002
- onClick: M,
2003
- class: "gap-2 cursor-pointer"
2004
- }, {
2005
- default: v(() => [
2006
- u(S(nt), {
2007
- size: 16,
2008
- class: "text-muted-foreground"
2009
- }),
2010
- m[20] || (m[20] = f("span", null, "(Re)send Confirmation Mail", -1))
2011
- ]),
2012
- _: 1
2013
- })
2014
- ]),
2015
- _: 1
2016
- }),
2017
- S(s)("manage-reservations") ? (B(), j(le, { key: 0 }, [
2018
- u(ve),
2019
- u(ae, null, {
2020
- default: v(() => [
2021
- u(ie, { class: "text-xs text-muted-foreground font-normal" }, {
2022
- default: v(() => [...m[21] || (m[21] = [
2023
- A(" Cancellation ", -1)
2024
- ])]),
2025
- _: 1
2026
- }),
2027
- u(q, {
2028
- onClick: I,
2029
- class: "gap-2 cursor-pointer",
2030
- variant: "destructive",
2031
- disabled: E.value
2032
- }, {
2033
- default: v(() => [
2034
- u(S(st), { size: 16 }),
2035
- m[22] || (m[22] = f("span", null, "Cancel Reservation", -1))
2036
- ]),
2037
- _: 1
2038
- }, 8, ["disabled"]),
2039
- o.value?.reservationPrice && o.value.reservationPrice > 0 ? (B(), J(q, {
2040
- key: 0,
2041
- onClick: z,
2042
- class: "gap-2 cursor-pointer text-orange-600 dark:text-orange-400 focus:text-orange-600 dark:focus:text-orange-400",
2043
- disabled: E.value
2044
- }, {
2045
- default: v(() => [
2046
- u(S(ot), {
2047
- class: "text-inherit",
2048
- size: 16
2049
- }),
2050
- m[23] || (m[23] = f("span", null, "Cancel & Send Coupon", -1))
2051
- ]),
2052
- _: 1
2053
- }, 8, ["disabled"])) : L("", !0)
2054
- ]),
2055
- _: 1
2056
- })
2057
- ], 64)) : L("", !0)
2058
- ]),
2059
- _: 1
2060
- })
2061
- ]),
2062
- _: 1
2063
- })) : L("", !0)
2064
- ]),
2065
- _: 1
2066
- })
2067
- ]),
2068
- _: 1
2069
- })
2070
- ]),
2071
- _: 1
2072
- }, 8, ["open"]),
2073
- u(en, {
2074
- ref_key: "cancelReservationDialog",
2075
- ref: h,
2076
- onCancel: b
2077
- }, null, 512),
2078
- u(an, {
2079
- ref_key: "resendConfirmationDialog",
2080
- ref: g
2081
- }, null, 512),
2082
- u(rn, {
2083
- ref_key: "transferReservationDialog",
2084
- ref: D
2085
- }, null, 512)
2086
- ], 64);
2087
- };
2088
- }
2089
- });
2090
- export {
2091
- X as F,
2092
- qn as _
2093
- };