@oneclick.dev/cms-core-modules 0.0.102 → 0.0.103

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 (102) hide show
  1. package/dist/AgendaOpeningHoursCard-B7ROIPWw.js +1 -0
  2. package/dist/AgendaOpeningHoursCard-Cp4wxUeK.mjs +172 -0
  3. package/dist/AppointmentListTable-DZJNmTMb.mjs +177 -0
  4. package/dist/AppointmentListTable-Dieu9US_.js +1 -0
  5. package/dist/{ContentEditor-Cjqgb64R.mjs → ContentEditor-B1nfKG_5.mjs} +706 -677
  6. package/dist/{ContentEditor-YgOS3kxS.js → ContentEditor-DdFU8piH.js} +15 -16
  7. package/dist/{Create-6uT9HWar.mjs → Create-BRBh0xjM.mjs} +2 -2
  8. package/dist/{Create-DuZ5nZrX.js → Create-qPeQxkdl.js} +1 -1
  9. package/dist/{DateFormatter-2B0R-DY4.mjs → DateFormatter-Bw-87W31.mjs} +212 -227
  10. package/dist/DateFormatter-CYAD4GBN.js +1 -0
  11. package/dist/{Detail-BZ-iE9vf.js → Detail-C857g62L.js} +1 -1
  12. package/dist/{Detail-CJVMJDP7.mjs → Detail-CujdFApD.mjs} +2 -2
  13. package/dist/EditLayout.vue_vue_type_script_setup_true_lang-DWMqQvHl.mjs +76 -0
  14. package/dist/EditLayout.vue_vue_type_script_setup_true_lang-kpjbVSXg.js +1 -0
  15. package/dist/{Entries-DkRhOt95.js → Entries-BaS6H6ak.js} +1 -1
  16. package/dist/{Entries-dLlCrXXe.mjs → Entries-C8UJkrVC.mjs} +1 -1
  17. package/dist/{Find-Bd1uLqSa.mjs → Find-B24ZEhYM.mjs} +1 -1
  18. package/dist/{NewReservationDialog.vue_vue_type_script_setup_true_lang-Bc946oSc.mjs → NewReservationDialog.vue_vue_type_script_setup_true_lang-9Q7TMm4u.mjs} +37 -37
  19. package/dist/{NewReservationDialog.vue_vue_type_script_setup_true_lang-CqERfyYb.js → NewReservationDialog.vue_vue_type_script_setup_true_lang-DiNzGl-q.js} +1 -1
  20. package/dist/{Overview-DoOASlNz.mjs → Overview-3HWhsqaz.mjs} +2 -2
  21. package/dist/{Overview-37nilXzE.js → Overview-CpHhuiaV.js} +1 -1
  22. package/dist/{Overview-DeQQ0FY3.js → Overview-DAxCu9XC.js} +1 -1
  23. package/dist/{Overview-C--dq51X.mjs → Overview-D_T3K6aq.mjs} +1 -1
  24. package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-Cz_22Oce.mjs +2927 -0
  25. package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-DPPNc-Z5.js +349 -0
  26. package/dist/TableView-CPAw3h8g.js +4 -0
  27. package/dist/TableView-DXmEF6pY.mjs +6143 -0
  28. package/dist/agenda-BNG05SAq.js +1 -0
  29. package/dist/agenda-D1RxMxBS.mjs +1152 -0
  30. package/dist/availability-CMrRa5y2.mjs +269 -0
  31. package/dist/availability-Cf2YfMwM.js +1 -0
  32. package/dist/booking-data-DgJd0BcM.mjs +889 -0
  33. package/dist/booking-data-Di5GmH_8.js +1 -0
  34. package/dist/cms-core-modules.css +1 -1
  35. package/dist/{exceptions-Bp5BSvxO.js → exceptions-CI0B4xVj.js} +1 -1
  36. package/dist/{exceptions-C97cNZYl.mjs → exceptions-vo8SA5SE.mjs} +68 -68
  37. package/dist/index-BtujSJeg.js +35 -0
  38. package/dist/{index-CrGjxSwa.mjs → index-CrgzoTyR.mjs} +1 -1
  39. package/dist/{index-D2a6wEPh.js → index-DPd3waTN.js} +1 -1
  40. package/dist/{index-CABh6Qn6.mjs → index-DrXxXB2F.mjs} +15 -15
  41. package/dist/{index-B-lVEpFX.mjs → index-MYWjg0zi.mjs} +3 -3
  42. package/dist/index-dOdMm1pV.mjs +1105 -0
  43. package/dist/index.cjs.js +1 -1
  44. package/dist/index.mjs +196 -143
  45. package/dist/interpolation-DEDSLETn.mjs +128 -0
  46. package/dist/interpolation-DERg6Lwt.js +1 -0
  47. package/dist/orders-CzzcFQha.mjs +559 -0
  48. package/dist/orders-ETtbA4aQ.js +1 -0
  49. package/dist/{payment-Bosr0m3u.mjs → payment-C3ohkehF.mjs} +1 -1
  50. package/dist/{payment-DDnC03jb.js → payment-Dfr-Ro-a.js} +1 -1
  51. package/dist/{resources-BtF5RUUq.js → resources-CxeFd57z.js} +1 -1
  52. package/dist/{resources-B7qDBC91.mjs → resources-WI_4SO6T.mjs} +2 -2
  53. package/dist/server-handlers.cjs.js +1 -1
  54. package/dist/server-handlers.mjs +457 -387
  55. package/dist/src/appointments/chat-components/AgendaOpeningHoursCard.vue.d.ts +15 -0
  56. package/dist/src/appointments/components/edit/CustomerInformationFieldEditorDialog.vue.d.ts +17 -5
  57. package/dist/src/appointments/components/edit/EventDialog/BookingsList.vue.d.ts +8 -3
  58. package/dist/src/appointments/components/edit/EventDialog/EventDialog.vue.d.ts +1 -0
  59. package/dist/src/appointments/components/edit/EventDialog/ReservationDetailDialog.vue.d.ts +6 -3
  60. package/dist/src/appointments/components/edit/EventTimeline.vue.d.ts +3 -0
  61. package/dist/src/appointments/components/edit/EventView.vue.d.ts +6 -1
  62. package/dist/src/appointments/components/edit/MetadataSchemaEditorDialog.vue.d.ts +12 -0
  63. package/dist/src/appointments/components/edit/OrderMetadataDisplay.vue.d.ts +21 -0
  64. package/dist/src/appointments/components/edit/dashboard/BookingsList.vue.d.ts +8 -3
  65. package/dist/src/appointments/index.d.ts +53 -0
  66. package/dist/src/appointments/pages/edit/agenda.vue.d.ts +3 -1
  67. package/dist/src/appointments/pages/edit/availability.vue.d.ts +1 -26
  68. package/dist/src/appointments/pages/edit/booking-data.vue.d.ts +65 -0
  69. package/dist/src/appointments/pages/edit/orders.vue.d.ts +7 -3
  70. package/dist/src/appointments/tools.d.ts +52 -0
  71. package/dist/src/appointments/types.d.ts +12 -0
  72. package/dist/src/table/config.d.ts +200 -0
  73. package/dist/src/table/get_data_flow-DEFAULT.json.d.ts +129 -0
  74. package/dist/src/table/index.d.ts +200 -0
  75. package/dist/utils-CanmrIWO.mjs +47 -0
  76. package/dist/utils-Yd6F5mea.js +3 -0
  77. package/package.json +2 -2
  78. package/src/appointments/tools.ts +38 -0
  79. package/dist/AppointmentListTable-CQ0WIXtj.js +0 -1
  80. package/dist/AppointmentListTable-aV_UJd6j.mjs +0 -159
  81. package/dist/DateFormatter-DbtOLV0L.js +0 -1
  82. package/dist/EditLayout.vue_vue_type_script_setup_true_lang-DXa-Xxue.mjs +0 -74
  83. package/dist/EditLayout.vue_vue_type_script_setup_true_lang-ozYrxb2g.js +0 -1
  84. package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-CL5kbDII.mjs +0 -2782
  85. package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-DcyyNvf6.js +0 -349
  86. package/dist/TableView-CIJs118q.mjs +0 -5929
  87. package/dist/TableView-DzZYf34i.js +0 -4
  88. package/dist/agenda-CCOjPiwP.mjs +0 -1133
  89. package/dist/agenda-CNPQfaIQ.js +0 -1
  90. package/dist/availability-B1D4Fyzi.mjs +0 -629
  91. package/dist/availability-DxrUcYbW.js +0 -1
  92. package/dist/index-BOnqrBfY.js +0 -35
  93. package/dist/index-Bj0qaL1N.mjs +0 -1091
  94. package/dist/interpolation-BBwG_ON6.mjs +0 -65
  95. package/dist/interpolation-CsOrww73.js +0 -1
  96. package/dist/orders-BJV5vRQr.mjs +0 -397
  97. package/dist/orders-C1C5IEIP.js +0 -1
  98. package/dist/regular-slots-Cc1jmKuC.mjs +0 -222
  99. package/dist/regular-slots-DBs1XVeN.js +0 -1
  100. package/dist/src/appointments/pages/edit/regular-slots.vue.d.ts +0 -2
  101. package/dist/utils-BVKy9S2J.mjs +0 -29
  102. package/dist/utils-D6CaKJbp.js +0 -2
@@ -0,0 +1,2927 @@
1
+ import { defineComponent as ie, ref as R, resolveComponent as x, openBlock as D, createBlock as H, withCtx as y, createVNode as p, createTextVNode as C, createElementVNode as g, unref as $, normalizeClass as Y, toDisplayString as I, computed as J, createElementBlock as M, Fragment as G, renderList as re, normalizeStyle as ne, resolveDynamicComponent as le, createCommentVNode as E, inject as rt, useTemplateRef as fe } from "vue";
2
+ import { icons as Q, User as lt, Mail as ct, Phone as ut, Clock as dt, Users as ft, Tag as pt, CreditCard as mt, Receipt as ht, Ban as gt, ClockCheck as vt, MoreHorizontal as _t, Download as yt, MailCheck as xt, XCircle as bt, Gift as Dt } from "lucide-vue-next";
3
+ import { useModule as ue, useMailer as $e, useModulePermissions as Ct, useFirebaseIntegration as kt } from "@oneclick.dev/cms-kit";
4
+ import { t as oe } from "./index-RLz1QPrf.mjs";
5
+ function Z(s) {
6
+ return Array.isArray ? Array.isArray(s) : Ke(s) === "[object Array]";
7
+ }
8
+ function At(s) {
9
+ if (typeof s == "string")
10
+ return s;
11
+ if (typeof s == "bigint")
12
+ return s.toString();
13
+ const e = s + "";
14
+ return e == "0" && 1 / s == -1 / 0 ? "-0" : e;
15
+ }
16
+ function be(s) {
17
+ return s == null ? "" : At(s);
18
+ }
19
+ function P(s) {
20
+ return typeof s == "string";
21
+ }
22
+ function me(s) {
23
+ return typeof s == "number";
24
+ }
25
+ function wt(s) {
26
+ return s === !0 || s === !1 || Mt(s) && Ke(s) == "[object Boolean]";
27
+ }
28
+ function He(s) {
29
+ return typeof s == "object";
30
+ }
31
+ function Mt(s) {
32
+ return He(s) && s !== null;
33
+ }
34
+ function V(s) {
35
+ return s != null;
36
+ }
37
+ function pe(s) {
38
+ return !s.trim().length;
39
+ }
40
+ function Ke(s) {
41
+ return s == null ? s === void 0 ? "[object Undefined]" : "[object Null]" : Object.prototype.toString.call(s);
42
+ }
43
+ const It = "Incorrect 'index' type", $t = (s) => `Invalid value for key ${s}`, Et = (s) => `Pattern length exceeds max of ${s}.`, St = (s) => `Missing ${s} property in key`, Ft = (s) => `Property 'weight' in key '${s}' must be a positive integer`, Te = Object.prototype.hasOwnProperty;
44
+ class Bt {
45
+ constructor(e) {
46
+ this._keys = [], this._keyMap = {};
47
+ let t = 0;
48
+ e.forEach((n) => {
49
+ const i = Ge(n);
50
+ this._keys.push(i), this._keyMap[i.id] = i, t += i.weight;
51
+ }), this._keys.forEach((n) => {
52
+ n.weight /= t;
53
+ });
54
+ }
55
+ get(e) {
56
+ return this._keyMap[e];
57
+ }
58
+ keys() {
59
+ return this._keys;
60
+ }
61
+ toJSON() {
62
+ return JSON.stringify(this._keys);
63
+ }
64
+ }
65
+ function Ge(s) {
66
+ let e = null, t = null, n = null, i = 1, l = null;
67
+ if (P(s) || Z(s))
68
+ n = s, e = Ne(s), t = De(s);
69
+ else {
70
+ if (!Te.call(s, "name"))
71
+ throw new Error(St("name"));
72
+ const r = s.name;
73
+ if (n = r, Te.call(s, "weight") && (i = s.weight, i <= 0))
74
+ throw new Error(Ft(r));
75
+ e = Ne(r), t = De(r), l = s.getFn;
76
+ }
77
+ return {
78
+ path: e,
79
+ id: t,
80
+ weight: i,
81
+ src: n,
82
+ getFn: l
83
+ };
84
+ }
85
+ function Ne(s) {
86
+ return Z(s) ? s : s.split(".");
87
+ }
88
+ function De(s) {
89
+ return Z(s) ? s.join(".") : s;
90
+ }
91
+ function Rt(s, e) {
92
+ const t = [];
93
+ let n = !1;
94
+ const i = (l, r, u, c) => {
95
+ if (V(l))
96
+ if (!r[u])
97
+ t.push(c !== void 0 ? {
98
+ v: l,
99
+ i: c
100
+ } : l);
101
+ else {
102
+ const m = r[u], o = l[m];
103
+ if (!V(o))
104
+ return;
105
+ if (u === r.length - 1 && (P(o) || me(o) || wt(o) || typeof o == "bigint"))
106
+ t.push(c !== void 0 ? {
107
+ v: be(o),
108
+ i: c
109
+ } : be(o));
110
+ else if (Z(o)) {
111
+ n = !0;
112
+ for (let a = 0, h = o.length; a < h; a += 1)
113
+ i(o[a], r, u + 1, a);
114
+ } else r.length && i(o, r, u + 1, c);
115
+ }
116
+ };
117
+ return i(s, P(e) ? e.split(".") : e, 0), n ? t : t[0];
118
+ }
119
+ const jt = {
120
+ includeMatches: !1,
121
+ findAllMatches: !1,
122
+ minMatchCharLength: 1
123
+ }, Ot = {
124
+ isCaseSensitive: !1,
125
+ ignoreDiacritics: !1,
126
+ includeScore: !1,
127
+ keys: [],
128
+ shouldSort: !0,
129
+ sortFn: (s, e) => s.score === e.score ? s.idx < e.idx ? -1 : 1 : s.score < e.score ? -1 : 1
130
+ }, Tt = {
131
+ location: 0,
132
+ threshold: 0.6,
133
+ distance: 100
134
+ }, Nt = {
135
+ useExtendedSearch: !1,
136
+ useTokenSearch: !1,
137
+ getFn: Rt,
138
+ ignoreLocation: !1,
139
+ ignoreFieldNorm: !1,
140
+ fieldNormWeight: 1
141
+ }, b = Object.freeze({
142
+ ...Ot,
143
+ ...jt,
144
+ ...Tt,
145
+ ...Nt
146
+ }), zt = /[^ ]+/g;
147
+ function Lt(s = 1, e = 3) {
148
+ const t = /* @__PURE__ */ new Map(), n = Math.pow(10, e);
149
+ return {
150
+ get(i) {
151
+ const l = i.match(zt).length;
152
+ if (t.has(l))
153
+ return t.get(l);
154
+ const r = 1 / Math.pow(l, 0.5 * s), u = parseFloat(Math.round(r * n) / n);
155
+ return t.set(l, u), u;
156
+ },
157
+ clear() {
158
+ t.clear();
159
+ }
160
+ };
161
+ }
162
+ class Ee {
163
+ constructor({
164
+ getFn: e = b.getFn,
165
+ fieldNormWeight: t = b.fieldNormWeight
166
+ } = {}) {
167
+ this.norm = Lt(t, 3), this.getFn = e, this.isCreated = !1, this.docs = [], this.keys = [], this._keysMap = {}, this.setIndexRecords();
168
+ }
169
+ setSources(e = []) {
170
+ this.docs = e;
171
+ }
172
+ setIndexRecords(e = []) {
173
+ this.records = e;
174
+ }
175
+ setKeys(e = []) {
176
+ this.keys = e, this._keysMap = {}, e.forEach((t, n) => {
177
+ this._keysMap[t.id] = n;
178
+ });
179
+ }
180
+ create() {
181
+ this.isCreated || !this.docs.length || (this.isCreated = !0, P(this.docs[0]) ? this.docs.forEach((e, t) => {
182
+ this._addString(e, t);
183
+ }) : this.docs.forEach((e, t) => {
184
+ this._addObject(e, t);
185
+ }), this.norm.clear());
186
+ }
187
+ // Adds a doc to the end of the index
188
+ add(e) {
189
+ const t = this.size();
190
+ P(e) ? this._addString(e, t) : this._addObject(e, t);
191
+ }
192
+ // Removes the doc at the specified index of the index
193
+ removeAt(e) {
194
+ this.records.splice(e, 1);
195
+ for (let t = e, n = this.size(); t < n; t += 1)
196
+ this.records[t].i -= 1;
197
+ }
198
+ // Removes docs at the specified indices (must be sorted ascending)
199
+ removeAll(e) {
200
+ for (let t = e.length - 1; t >= 0; t -= 1)
201
+ this.records.splice(e[t], 1);
202
+ for (let t = 0, n = this.records.length; t < n; t += 1)
203
+ this.records[t].i = t;
204
+ }
205
+ getValueForItemAtKeyId(e, t) {
206
+ return e[this._keysMap[t]];
207
+ }
208
+ size() {
209
+ return this.records.length;
210
+ }
211
+ _addString(e, t) {
212
+ if (!V(e) || pe(e))
213
+ return;
214
+ const n = {
215
+ v: e,
216
+ i: t,
217
+ n: this.norm.get(e)
218
+ };
219
+ this.records.push(n);
220
+ }
221
+ _addObject(e, t) {
222
+ const n = {
223
+ i: t,
224
+ $: {}
225
+ };
226
+ this.keys.forEach((i, l) => {
227
+ const r = i.getFn ? i.getFn(e) : this.getFn(e, i.path);
228
+ if (V(r)) {
229
+ if (Z(r)) {
230
+ const u = [];
231
+ for (let c = 0, m = r.length; c < m; c += 1) {
232
+ const o = r[c];
233
+ if (V(o)) {
234
+ if (P(o)) {
235
+ if (!pe(o)) {
236
+ const a = {
237
+ v: o,
238
+ i: c,
239
+ n: this.norm.get(o)
240
+ };
241
+ u.push(a);
242
+ }
243
+ } else if (V(o.v)) {
244
+ const a = P(o.v) ? o.v : be(o.v);
245
+ if (!pe(a)) {
246
+ const h = {
247
+ v: a,
248
+ i: o.i,
249
+ n: this.norm.get(a)
250
+ };
251
+ u.push(h);
252
+ }
253
+ }
254
+ }
255
+ }
256
+ n.$[l] = u;
257
+ } else if (P(r) && !pe(r)) {
258
+ const u = {
259
+ v: r,
260
+ n: this.norm.get(r)
261
+ };
262
+ n.$[l] = u;
263
+ }
264
+ }
265
+ }), this.records.push(n);
266
+ }
267
+ toJSON() {
268
+ return {
269
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
270
+ keys: this.keys.map(({
271
+ getFn: e,
272
+ ...t
273
+ }) => t),
274
+ records: this.records
275
+ };
276
+ }
277
+ }
278
+ function Ye(s, e, {
279
+ getFn: t = b.getFn,
280
+ fieldNormWeight: n = b.fieldNormWeight
281
+ } = {}) {
282
+ const i = new Ee({
283
+ getFn: t,
284
+ fieldNormWeight: n
285
+ });
286
+ return i.setKeys(s.map(Ge)), i.setSources(e), i.create(), i;
287
+ }
288
+ function Pt(s, {
289
+ getFn: e = b.getFn,
290
+ fieldNormWeight: t = b.fieldNormWeight
291
+ } = {}) {
292
+ const {
293
+ keys: n,
294
+ records: i
295
+ } = s, l = new Ee({
296
+ getFn: e,
297
+ fieldNormWeight: t
298
+ });
299
+ return l.setKeys(n), l.setIndexRecords(i), l;
300
+ }
301
+ function Vt(s = [], e = b.minMatchCharLength) {
302
+ const t = [];
303
+ let n = -1, i = -1, l = 0;
304
+ for (let r = s.length; l < r; l += 1) {
305
+ const u = s[l];
306
+ u && n === -1 ? n = l : !u && n !== -1 && (i = l - 1, i - n + 1 >= e && t.push([n, i]), n = -1);
307
+ }
308
+ return s[l - 1] && l - n >= e && t.push([n, l - 1]), t;
309
+ }
310
+ const te = 32;
311
+ function Ut(s, e, t, {
312
+ location: n = b.location,
313
+ distance: i = b.distance,
314
+ threshold: l = b.threshold,
315
+ findAllMatches: r = b.findAllMatches,
316
+ minMatchCharLength: u = b.minMatchCharLength,
317
+ includeMatches: c = b.includeMatches,
318
+ ignoreLocation: m = b.ignoreLocation
319
+ } = {}) {
320
+ if (e.length > te)
321
+ throw new Error(Et(te));
322
+ const o = e.length, a = s.length, h = Math.max(0, Math.min(n, a));
323
+ let d = l, f = h;
324
+ const _ = (F, T) => {
325
+ const k = F / o;
326
+ if (m) return k;
327
+ const N = Math.abs(h - T);
328
+ return i ? k + N / i : N ? 1 : k;
329
+ }, w = u > 1 || c, O = w ? Array(a) : [];
330
+ let L;
331
+ for (; (L = s.indexOf(e, f)) > -1; ) {
332
+ const F = _(0, L);
333
+ if (d = Math.min(F, d), f = L + o, w) {
334
+ let T = 0;
335
+ for (; T < o; )
336
+ O[L + T] = 1, T += 1;
337
+ }
338
+ }
339
+ f = -1;
340
+ let S = [], B = 1, j = o + a;
341
+ const K = 1 << o - 1;
342
+ for (let F = 0; F < o; F += 1) {
343
+ let T = 0, k = j;
344
+ for (; T < k; )
345
+ _(F, h + k) <= d ? T = k : j = k, k = Math.floor((j - T) / 2 + T);
346
+ j = k;
347
+ let N = Math.max(1, h - k + 1);
348
+ const ae = r ? a : Math.min(h + k, a) + o, X = Array(ae + 2);
349
+ X[ae + 1] = (1 << F) - 1;
350
+ for (let U = ae; U >= N; U -= 1) {
351
+ const A = U - 1, v = t[s[A]];
352
+ if (w && (O[A] = +!!v), X[U] = (X[U + 1] << 1 | 1) & v, F && (X[U] |= (S[U + 1] | S[U]) << 1 | 1 | S[U + 1]), X[U] & K && (B = _(F, A), B <= d)) {
353
+ if (d = B, f = A, f <= h)
354
+ break;
355
+ N = Math.max(1, 2 * h - f);
356
+ }
357
+ }
358
+ if (_(F + 1, h) > d)
359
+ break;
360
+ S = X;
361
+ }
362
+ const W = {
363
+ isMatch: f >= 0,
364
+ // Count exact matches (those with a score of 0) to be "almost" exact
365
+ score: Math.max(1e-3, B)
366
+ };
367
+ if (w) {
368
+ const F = Vt(O, u);
369
+ F.length ? c && (W.indices = F) : W.isMatch = !1;
370
+ }
371
+ return W;
372
+ }
373
+ function Wt(s) {
374
+ const e = {};
375
+ for (let t = 0, n = s.length; t < n; t += 1) {
376
+ const i = s.charAt(t);
377
+ e[i] = (e[i] || 0) | 1 << n - t - 1;
378
+ }
379
+ return e;
380
+ }
381
+ function Se(s) {
382
+ if (s.length <= 1) return s;
383
+ s.sort((t, n) => t[0] - n[0] || t[1] - n[1]);
384
+ const e = [s[0]];
385
+ for (let t = 1, n = s.length; t < n; t += 1) {
386
+ const i = e[e.length - 1], l = s[t];
387
+ l[0] <= i[1] + 1 ? i[1] = Math.max(i[1], l[1]) : e.push(l);
388
+ }
389
+ return e;
390
+ }
391
+ const Qe = {
392
+ ł: "l",
393
+ // ł
394
+ Ł: "L",
395
+ // Ł
396
+ đ: "d",
397
+ // đ
398
+ Đ: "D",
399
+ // Đ
400
+ ø: "o",
401
+ // ø
402
+ Ø: "O",
403
+ // Ø
404
+ ħ: "h",
405
+ // ħ
406
+ Ħ: "H",
407
+ // Ħ
408
+ ŧ: "t",
409
+ // ŧ
410
+ Ŧ: "T",
411
+ // Ŧ
412
+ ı: "i",
413
+ // ı
414
+ ß: "ss"
415
+ // ß
416
+ }, Ht = new RegExp("[" + Object.keys(Qe).join("") + "]", "g"), ce = String.prototype.normalize ? (s) => s.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, "").replace(Ht, (e) => Qe[e]) : (s) => s;
417
+ class Fe {
418
+ constructor(e, {
419
+ location: t = b.location,
420
+ threshold: n = b.threshold,
421
+ distance: i = b.distance,
422
+ includeMatches: l = b.includeMatches,
423
+ findAllMatches: r = b.findAllMatches,
424
+ minMatchCharLength: u = b.minMatchCharLength,
425
+ isCaseSensitive: c = b.isCaseSensitive,
426
+ ignoreDiacritics: m = b.ignoreDiacritics,
427
+ ignoreLocation: o = b.ignoreLocation
428
+ } = {}) {
429
+ if (this.options = {
430
+ location: t,
431
+ threshold: n,
432
+ distance: i,
433
+ includeMatches: l,
434
+ findAllMatches: r,
435
+ minMatchCharLength: u,
436
+ isCaseSensitive: c,
437
+ ignoreDiacritics: m,
438
+ ignoreLocation: o
439
+ }, e = c ? e : e.toLowerCase(), e = m ? ce(e) : e, this.pattern = e, this.chunks = [], !this.pattern.length)
440
+ return;
441
+ const a = (d, f) => {
442
+ this.chunks.push({
443
+ pattern: d,
444
+ alphabet: Wt(d),
445
+ startIndex: f
446
+ });
447
+ }, h = this.pattern.length;
448
+ if (h > te) {
449
+ let d = 0;
450
+ const f = h % te, _ = h - f;
451
+ for (; d < _; )
452
+ a(this.pattern.substr(d, te), d), d += te;
453
+ if (f) {
454
+ const w = h - te;
455
+ a(this.pattern.substr(w), w);
456
+ }
457
+ } else
458
+ a(this.pattern, 0);
459
+ }
460
+ searchIn(e) {
461
+ const {
462
+ isCaseSensitive: t,
463
+ ignoreDiacritics: n,
464
+ includeMatches: i
465
+ } = this.options;
466
+ if (e = t ? e : e.toLowerCase(), e = n ? ce(e) : e, this.pattern === e) {
467
+ const _ = {
468
+ isMatch: !0,
469
+ score: 0
470
+ };
471
+ return i && (_.indices = [[0, e.length - 1]]), _;
472
+ }
473
+ const {
474
+ location: l,
475
+ distance: r,
476
+ threshold: u,
477
+ findAllMatches: c,
478
+ minMatchCharLength: m,
479
+ ignoreLocation: o
480
+ } = this.options, a = [];
481
+ let h = 0, d = !1;
482
+ this.chunks.forEach(({
483
+ pattern: _,
484
+ alphabet: w,
485
+ startIndex: O
486
+ }) => {
487
+ const {
488
+ isMatch: L,
489
+ score: S,
490
+ indices: B
491
+ } = Ut(e, _, w, {
492
+ location: l + O,
493
+ distance: r,
494
+ threshold: u,
495
+ findAllMatches: c,
496
+ minMatchCharLength: m,
497
+ includeMatches: i,
498
+ ignoreLocation: o
499
+ });
500
+ L && (d = !0), h += S, L && B && a.push(...B);
501
+ });
502
+ const f = {
503
+ isMatch: d,
504
+ score: d ? h / this.chunks.length : 1
505
+ };
506
+ return d && i && (f.indices = Se(a)), f;
507
+ }
508
+ }
509
+ class q {
510
+ constructor(e) {
511
+ this.pattern = e;
512
+ }
513
+ static isMultiMatch(e) {
514
+ return ze(e, this.multiRegex);
515
+ }
516
+ static isSingleMatch(e) {
517
+ return ze(e, this.singleRegex);
518
+ }
519
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
520
+ search(e) {
521
+ return {
522
+ isMatch: !1,
523
+ score: 1
524
+ };
525
+ }
526
+ }
527
+ function ze(s, e) {
528
+ const t = s.match(e);
529
+ return t ? t[1] : null;
530
+ }
531
+ class Kt extends q {
532
+ constructor(e) {
533
+ super(e);
534
+ }
535
+ static get type() {
536
+ return "exact";
537
+ }
538
+ static get multiRegex() {
539
+ return /^="(.*)"$/;
540
+ }
541
+ static get singleRegex() {
542
+ return /^=(.*)$/;
543
+ }
544
+ search(e) {
545
+ const t = e === this.pattern;
546
+ return {
547
+ isMatch: t,
548
+ score: t ? 0 : 1,
549
+ indices: [0, this.pattern.length - 1]
550
+ };
551
+ }
552
+ }
553
+ class Gt extends q {
554
+ constructor(e) {
555
+ super(e);
556
+ }
557
+ static get type() {
558
+ return "inverse-exact";
559
+ }
560
+ static get multiRegex() {
561
+ return /^!"(.*)"$/;
562
+ }
563
+ static get singleRegex() {
564
+ return /^!(.*)$/;
565
+ }
566
+ search(e) {
567
+ const n = e.indexOf(this.pattern) === -1;
568
+ return {
569
+ isMatch: n,
570
+ score: n ? 0 : 1,
571
+ indices: [0, e.length - 1]
572
+ };
573
+ }
574
+ }
575
+ class Yt extends q {
576
+ constructor(e) {
577
+ super(e);
578
+ }
579
+ static get type() {
580
+ return "prefix-exact";
581
+ }
582
+ static get multiRegex() {
583
+ return /^\^"(.*)"$/;
584
+ }
585
+ static get singleRegex() {
586
+ return /^\^(.*)$/;
587
+ }
588
+ search(e) {
589
+ const t = e.startsWith(this.pattern);
590
+ return {
591
+ isMatch: t,
592
+ score: t ? 0 : 1,
593
+ indices: [0, this.pattern.length - 1]
594
+ };
595
+ }
596
+ }
597
+ class Qt extends q {
598
+ constructor(e) {
599
+ super(e);
600
+ }
601
+ static get type() {
602
+ return "inverse-prefix-exact";
603
+ }
604
+ static get multiRegex() {
605
+ return /^!\^"(.*)"$/;
606
+ }
607
+ static get singleRegex() {
608
+ return /^!\^(.*)$/;
609
+ }
610
+ search(e) {
611
+ const t = !e.startsWith(this.pattern);
612
+ return {
613
+ isMatch: t,
614
+ score: t ? 0 : 1,
615
+ indices: [0, e.length - 1]
616
+ };
617
+ }
618
+ }
619
+ class Jt extends q {
620
+ constructor(e) {
621
+ super(e);
622
+ }
623
+ static get type() {
624
+ return "suffix-exact";
625
+ }
626
+ static get multiRegex() {
627
+ return /^"(.*)"\$$/;
628
+ }
629
+ static get singleRegex() {
630
+ return /^(.*)\$$/;
631
+ }
632
+ search(e) {
633
+ const t = e.endsWith(this.pattern);
634
+ return {
635
+ isMatch: t,
636
+ score: t ? 0 : 1,
637
+ indices: [e.length - this.pattern.length, e.length - 1]
638
+ };
639
+ }
640
+ }
641
+ class Xt extends q {
642
+ constructor(e) {
643
+ super(e);
644
+ }
645
+ static get type() {
646
+ return "inverse-suffix-exact";
647
+ }
648
+ static get multiRegex() {
649
+ return /^!"(.*)"\$$/;
650
+ }
651
+ static get singleRegex() {
652
+ return /^!(.*)\$$/;
653
+ }
654
+ search(e) {
655
+ const t = !e.endsWith(this.pattern);
656
+ return {
657
+ isMatch: t,
658
+ score: t ? 0 : 1,
659
+ indices: [0, e.length - 1]
660
+ };
661
+ }
662
+ }
663
+ class Je extends q {
664
+ constructor(e, {
665
+ location: t = b.location,
666
+ threshold: n = b.threshold,
667
+ distance: i = b.distance,
668
+ includeMatches: l = b.includeMatches,
669
+ findAllMatches: r = b.findAllMatches,
670
+ minMatchCharLength: u = b.minMatchCharLength,
671
+ isCaseSensitive: c = b.isCaseSensitive,
672
+ ignoreDiacritics: m = b.ignoreDiacritics,
673
+ ignoreLocation: o = b.ignoreLocation
674
+ } = {}) {
675
+ super(e), this._bitapSearch = new Fe(e, {
676
+ location: t,
677
+ threshold: n,
678
+ distance: i,
679
+ includeMatches: l,
680
+ findAllMatches: r,
681
+ minMatchCharLength: u,
682
+ isCaseSensitive: c,
683
+ ignoreDiacritics: m,
684
+ ignoreLocation: o
685
+ });
686
+ }
687
+ static get type() {
688
+ return "fuzzy";
689
+ }
690
+ static get multiRegex() {
691
+ return /^"(.*)"$/;
692
+ }
693
+ static get singleRegex() {
694
+ return /^(.*)$/;
695
+ }
696
+ search(e) {
697
+ return this._bitapSearch.searchIn(e);
698
+ }
699
+ }
700
+ class Xe extends q {
701
+ constructor(e) {
702
+ super(e);
703
+ }
704
+ static get type() {
705
+ return "include";
706
+ }
707
+ static get multiRegex() {
708
+ return /^'"(.*)"$/;
709
+ }
710
+ static get singleRegex() {
711
+ return /^'(.*)$/;
712
+ }
713
+ search(e) {
714
+ let t = 0, n;
715
+ const i = [], l = this.pattern.length;
716
+ for (; (n = e.indexOf(this.pattern, t)) > -1; )
717
+ t = n + l, i.push([n, t - 1]);
718
+ const r = !!i.length;
719
+ return {
720
+ isMatch: r,
721
+ score: r ? 0 : 1,
722
+ indices: i
723
+ };
724
+ }
725
+ }
726
+ const Ce = [Kt, Xe, Yt, Qt, Xt, Jt, Gt, Je], Le = Ce.length, Zt = "\0", qt = "|";
727
+ function es(s) {
728
+ const e = [], t = s.length;
729
+ let n = 0;
730
+ for (; n < t; ) {
731
+ for (; n < t && s[n] === " "; ) n++;
732
+ if (n >= t) break;
733
+ let i = n;
734
+ for (; i < t && s[i] !== " " && s[i] !== '"'; ) i++;
735
+ if (i < t && s[i] === '"') {
736
+ for (i++; i < t; ) {
737
+ if (s[i] === '"') {
738
+ const l = i + 1;
739
+ if (l >= t || s[l] === " ") {
740
+ i++;
741
+ break;
742
+ }
743
+ if (s[l] === "$" && (l + 1 >= t || s[l + 1] === " ")) {
744
+ i += 2;
745
+ break;
746
+ }
747
+ }
748
+ i++;
749
+ }
750
+ e.push(s.substring(n, i)), n = i;
751
+ } else {
752
+ for (; i < t && s[i] !== " "; ) i++;
753
+ e.push(s.substring(n, i)), n = i;
754
+ }
755
+ }
756
+ return e;
757
+ }
758
+ function ts(s, e = {}) {
759
+ return s.replace(/\\\|/g, Zt).split(qt).map((n) => {
760
+ const i = n.replace(/\u0000/g, "|"), l = es(i.trim()).filter((u) => u && !!u.trim()), r = [];
761
+ for (let u = 0, c = l.length; u < c; u += 1) {
762
+ const m = l[u];
763
+ let o = !1, a = -1;
764
+ for (; !o && ++a < Le; ) {
765
+ const h = Ce[a], d = h.isMultiMatch(m);
766
+ d && (r.push(new h(d, e)), o = !0);
767
+ }
768
+ if (!o)
769
+ for (a = -1; ++a < Le; ) {
770
+ const h = Ce[a], d = h.isSingleMatch(m);
771
+ if (d) {
772
+ r.push(new h(d, e));
773
+ break;
774
+ }
775
+ }
776
+ }
777
+ return r;
778
+ });
779
+ }
780
+ const ss = /* @__PURE__ */ new Set([Je.type, Xe.type]);
781
+ class ns {
782
+ constructor(e, {
783
+ isCaseSensitive: t = b.isCaseSensitive,
784
+ ignoreDiacritics: n = b.ignoreDiacritics,
785
+ includeMatches: i = b.includeMatches,
786
+ minMatchCharLength: l = b.minMatchCharLength,
787
+ ignoreLocation: r = b.ignoreLocation,
788
+ findAllMatches: u = b.findAllMatches,
789
+ location: c = b.location,
790
+ threshold: m = b.threshold,
791
+ distance: o = b.distance
792
+ } = {}) {
793
+ this.query = null, this.options = {
794
+ isCaseSensitive: t,
795
+ ignoreDiacritics: n,
796
+ includeMatches: i,
797
+ minMatchCharLength: l,
798
+ findAllMatches: u,
799
+ ignoreLocation: r,
800
+ location: c,
801
+ threshold: m,
802
+ distance: o
803
+ }, e = t ? e : e.toLowerCase(), e = n ? ce(e) : e, this.pattern = e, this.query = ts(this.pattern, this.options);
804
+ }
805
+ static condition(e, t) {
806
+ return t.useExtendedSearch;
807
+ }
808
+ // Note: searchIn operates on a single text value and sets hasInverse on the
809
+ // result when inverse patterns are involved. _searchObjectList uses this to
810
+ // switch from "ANY key" to "ALL keys" aggregation. See #712.
811
+ searchIn(e) {
812
+ const t = this.query;
813
+ if (!t)
814
+ return {
815
+ isMatch: !1,
816
+ score: 1
817
+ };
818
+ const {
819
+ includeMatches: n,
820
+ isCaseSensitive: i,
821
+ ignoreDiacritics: l
822
+ } = this.options;
823
+ e = i ? e : e.toLowerCase(), e = l ? ce(e) : e;
824
+ let r = 0;
825
+ const u = [];
826
+ let c = 0, m = !1;
827
+ for (let o = 0, a = t.length; o < a; o += 1) {
828
+ const h = t[o];
829
+ u.length = 0, r = 0, m = !1;
830
+ for (let d = 0, f = h.length; d < f; d += 1) {
831
+ const _ = h[d], {
832
+ isMatch: w,
833
+ indices: O,
834
+ score: L
835
+ } = _.search(e);
836
+ if (w) {
837
+ r += 1, c += L;
838
+ const S = _.constructor.type;
839
+ S.startsWith("inverse") && (m = !0), n && (ss.has(S) ? u.push(...O) : u.push(O));
840
+ } else {
841
+ c = 0, r = 0, u.length = 0, m = !1;
842
+ break;
843
+ }
844
+ }
845
+ if (r) {
846
+ const d = {
847
+ isMatch: !0,
848
+ score: c / r
849
+ };
850
+ return m && (d.hasInverse = !0), n && (d.indices = Se(u)), d;
851
+ }
852
+ }
853
+ return {
854
+ isMatch: !1,
855
+ score: 1
856
+ };
857
+ }
858
+ }
859
+ const ke = [];
860
+ function Be(...s) {
861
+ ke.push(...s);
862
+ }
863
+ function he(s, e) {
864
+ for (let t = 0, n = ke.length; t < n; t += 1) {
865
+ const i = ke[t];
866
+ if (i.condition(s, e))
867
+ return new i(s, e);
868
+ }
869
+ return new Fe(s, e);
870
+ }
871
+ const ge = {
872
+ AND: "$and",
873
+ OR: "$or"
874
+ }, Ae = {
875
+ PATH: "$path",
876
+ PATTERN: "$val"
877
+ }, we = (s) => !!(s[ge.AND] || s[ge.OR]), os = (s) => !!s[Ae.PATH], is = (s) => !Z(s) && He(s) && !we(s), Pe = (s) => ({
878
+ [ge.AND]: Object.keys(s).map((e) => ({
879
+ [e]: s[e]
880
+ }))
881
+ });
882
+ function Ze(s, e, {
883
+ auto: t = !0
884
+ } = {}) {
885
+ const n = (i) => {
886
+ if (P(i)) {
887
+ const c = {
888
+ keyId: null,
889
+ pattern: i
890
+ };
891
+ return t && (c.searcher = he(i, e)), c;
892
+ }
893
+ const l = Object.keys(i), r = os(i);
894
+ if (!r && l.length > 1 && !we(i))
895
+ return n(Pe(i));
896
+ if (is(i)) {
897
+ const c = r ? i[Ae.PATH] : l[0], m = r ? i[Ae.PATTERN] : i[c];
898
+ if (!P(m))
899
+ throw new Error($t(c));
900
+ const o = {
901
+ keyId: De(c),
902
+ pattern: m
903
+ };
904
+ return t && (o.searcher = he(m, e)), o;
905
+ }
906
+ const u = {
907
+ children: [],
908
+ operator: l[0]
909
+ };
910
+ return l.forEach((c) => {
911
+ const m = i[c];
912
+ Z(m) && m.forEach((o) => {
913
+ u.children.push(n(o));
914
+ });
915
+ }), u;
916
+ };
917
+ return we(s) || (s = Pe(s)), n(s);
918
+ }
919
+ function Me(s, {
920
+ ignoreFieldNorm: e = b.ignoreFieldNorm
921
+ }) {
922
+ let t = 1;
923
+ return s.forEach(({
924
+ key: n,
925
+ norm: i,
926
+ score: l
927
+ }) => {
928
+ const r = n ? n.weight : null;
929
+ t *= Math.pow(l === 0 && r ? Number.EPSILON : l, (r || 1) * (e ? 1 : i));
930
+ }), t;
931
+ }
932
+ function as(s, {
933
+ ignoreFieldNorm: e = b.ignoreFieldNorm
934
+ }) {
935
+ s.forEach((t) => {
936
+ t.score = Me(t.matches, {
937
+ ignoreFieldNorm: e
938
+ });
939
+ });
940
+ }
941
+ class rs {
942
+ constructor(e) {
943
+ this.limit = e, this.heap = [];
944
+ }
945
+ get size() {
946
+ return this.heap.length;
947
+ }
948
+ shouldInsert(e) {
949
+ return this.size < this.limit || e < this.heap[0].score;
950
+ }
951
+ insert(e) {
952
+ this.size < this.limit ? (this.heap.push(e), this._bubbleUp(this.size - 1)) : e.score < this.heap[0].score && (this.heap[0] = e, this._sinkDown(0));
953
+ }
954
+ extractSorted(e) {
955
+ return this.heap.sort(e);
956
+ }
957
+ _bubbleUp(e) {
958
+ const t = this.heap;
959
+ for (; e > 0; ) {
960
+ const n = e - 1 >> 1;
961
+ if (t[e].score <= t[n].score) break;
962
+ const i = t[e];
963
+ t[e] = t[n], t[n] = i, e = n;
964
+ }
965
+ }
966
+ _sinkDown(e) {
967
+ const t = this.heap, n = t.length;
968
+ let i = e;
969
+ do {
970
+ e = i;
971
+ const l = 2 * e + 1, r = 2 * e + 2;
972
+ if (l < n && t[l].score > t[i].score && (i = l), r < n && t[r].score > t[i].score && (i = r), i !== e) {
973
+ const u = t[e];
974
+ t[e] = t[i], t[i] = u;
975
+ }
976
+ } while (i !== e);
977
+ }
978
+ }
979
+ function ls(s, e) {
980
+ const t = s.matches;
981
+ e.matches = [], V(t) && t.forEach((n) => {
982
+ if (!V(n.indices) || !n.indices.length)
983
+ return;
984
+ const {
985
+ indices: i,
986
+ value: l
987
+ } = n, r = {
988
+ indices: i,
989
+ value: l
990
+ };
991
+ n.key && (r.key = n.key.src), n.idx > -1 && (r.refIndex = n.idx), e.matches.push(r);
992
+ });
993
+ }
994
+ function cs(s, e) {
995
+ e.score = s.score;
996
+ }
997
+ function us(s, e, {
998
+ includeMatches: t = b.includeMatches,
999
+ includeScore: n = b.includeScore
1000
+ } = {}) {
1001
+ const i = [];
1002
+ return t && i.push(ls), n && i.push(cs), s.map((l) => {
1003
+ const {
1004
+ idx: r
1005
+ } = l, u = {
1006
+ item: e[r],
1007
+ refIndex: r
1008
+ };
1009
+ return i.length && i.forEach((c) => {
1010
+ c(l, u);
1011
+ }), u;
1012
+ });
1013
+ }
1014
+ const ds = /\b\w+\b/g;
1015
+ function Ie({
1016
+ isCaseSensitive: s = !1,
1017
+ ignoreDiacritics: e = !1
1018
+ } = {}) {
1019
+ return {
1020
+ tokenize(t) {
1021
+ return s || (t = t.toLowerCase()), e && (t = ce(t)), t.match(ds) || [];
1022
+ }
1023
+ };
1024
+ }
1025
+ function fs(s, e, t) {
1026
+ const n = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
1027
+ let l = 0;
1028
+ function r(u, c, m, o) {
1029
+ const a = t.tokenize(u);
1030
+ if (!a.length) return;
1031
+ l++;
1032
+ const h = /* @__PURE__ */ new Map();
1033
+ for (const d of a)
1034
+ h.set(d, (h.get(d) || 0) + 1);
1035
+ for (const [d, f] of h) {
1036
+ const _ = {
1037
+ docIdx: c,
1038
+ keyIdx: m,
1039
+ subIdx: o,
1040
+ tf: f
1041
+ };
1042
+ let w = n.get(d);
1043
+ w || (w = [], n.set(d, w)), w.push(_), i.set(d, (i.get(d) || 0) + 1);
1044
+ }
1045
+ }
1046
+ for (const u of s) {
1047
+ const {
1048
+ i: c,
1049
+ v: m,
1050
+ $: o
1051
+ } = u;
1052
+ if (m !== void 0) {
1053
+ r(m, c, -1, -1);
1054
+ continue;
1055
+ }
1056
+ if (o)
1057
+ for (let a = 0; a < e; a++) {
1058
+ const h = o[a];
1059
+ if (h)
1060
+ if (Array.isArray(h))
1061
+ for (const d of h)
1062
+ r(d.v, c, a, d.i ?? -1);
1063
+ else
1064
+ r(h.v, c, a, -1);
1065
+ }
1066
+ }
1067
+ return {
1068
+ terms: n,
1069
+ fieldCount: l,
1070
+ df: i
1071
+ };
1072
+ }
1073
+ function ps(s, e, t, n) {
1074
+ const {
1075
+ i,
1076
+ v: l,
1077
+ $: r
1078
+ } = e;
1079
+ function u(c, m, o) {
1080
+ const a = n.tokenize(c);
1081
+ if (!a.length) return;
1082
+ s.fieldCount++;
1083
+ const h = /* @__PURE__ */ new Map();
1084
+ for (const d of a)
1085
+ h.set(d, (h.get(d) || 0) + 1);
1086
+ for (const [d, f] of h) {
1087
+ const _ = {
1088
+ docIdx: i,
1089
+ keyIdx: m,
1090
+ subIdx: o,
1091
+ tf: f
1092
+ };
1093
+ let w = s.terms.get(d);
1094
+ w || (w = [], s.terms.set(d, w)), w.push(_), s.df.set(d, (s.df.get(d) || 0) + 1);
1095
+ }
1096
+ }
1097
+ if (l !== void 0) {
1098
+ u(l, -1, -1);
1099
+ return;
1100
+ }
1101
+ if (r)
1102
+ for (let c = 0; c < t; c++) {
1103
+ const m = r[c];
1104
+ if (m)
1105
+ if (Array.isArray(m))
1106
+ for (const o of m)
1107
+ u(o.v, c, o.i ?? -1);
1108
+ else
1109
+ u(m.v, c, -1);
1110
+ }
1111
+ }
1112
+ function Ve(s, e) {
1113
+ for (const [t, n] of s.terms) {
1114
+ const i = n.filter((r) => r.docIdx !== e), l = n.length - i.length;
1115
+ l > 0 && (s.fieldCount -= l, s.df.set(t, (s.df.get(t) || 0) - l), i.length === 0 ? (s.terms.delete(t), s.df.delete(t)) : s.terms.set(t, i));
1116
+ }
1117
+ }
1118
+ class se {
1119
+ // Statics are assigned in entry.ts
1120
+ constructor(e, t, n) {
1121
+ this.options = {
1122
+ ...b,
1123
+ ...t
1124
+ }, this.options.useExtendedSearch, this.options.useTokenSearch, this._keyStore = new Bt(this.options.keys), this._docs = e, this._myIndex = null, this._invertedIndex = null, this.setCollection(e, n), this._lastQuery = null, this._lastSearcher = null;
1125
+ }
1126
+ _getSearcher(e) {
1127
+ if (this._lastQuery === e)
1128
+ return this._lastSearcher;
1129
+ const t = this._invertedIndex ? {
1130
+ ...this.options,
1131
+ _invertedIndex: this._invertedIndex
1132
+ } : this.options, n = he(e, t);
1133
+ return this._lastQuery = e, this._lastSearcher = n, n;
1134
+ }
1135
+ setCollection(e, t) {
1136
+ if (this._docs = e, t && !(t instanceof Ee))
1137
+ throw new Error(It);
1138
+ if (this._myIndex = t || Ye(this.options.keys, this._docs, {
1139
+ getFn: this.options.getFn,
1140
+ fieldNormWeight: this.options.fieldNormWeight
1141
+ }), this.options.useTokenSearch) {
1142
+ const n = Ie({
1143
+ isCaseSensitive: this.options.isCaseSensitive,
1144
+ ignoreDiacritics: this.options.ignoreDiacritics
1145
+ });
1146
+ this._invertedIndex = fs(this._myIndex.records, this._myIndex.keys.length, n);
1147
+ }
1148
+ }
1149
+ add(e) {
1150
+ if (V(e) && (this._docs.push(e), this._myIndex.add(e), this._invertedIndex)) {
1151
+ const t = this._myIndex.records[this._myIndex.records.length - 1], n = Ie({
1152
+ isCaseSensitive: this.options.isCaseSensitive,
1153
+ ignoreDiacritics: this.options.ignoreDiacritics
1154
+ });
1155
+ ps(this._invertedIndex, t, this._myIndex.keys.length, n);
1156
+ }
1157
+ }
1158
+ remove(e = () => !1) {
1159
+ const t = [], n = [];
1160
+ for (let i = 0, l = this._docs.length; i < l; i += 1)
1161
+ e(this._docs[i], i) && (t.push(this._docs[i]), n.push(i));
1162
+ if (n.length) {
1163
+ if (this._invertedIndex)
1164
+ for (const i of n)
1165
+ Ve(this._invertedIndex, i);
1166
+ for (let i = n.length - 1; i >= 0; i -= 1)
1167
+ this._docs.splice(n[i], 1);
1168
+ this._myIndex.removeAll(n);
1169
+ }
1170
+ return t;
1171
+ }
1172
+ removeAt(e) {
1173
+ this._invertedIndex && Ve(this._invertedIndex, e);
1174
+ const t = this._docs.splice(e, 1)[0];
1175
+ return this._myIndex.removeAt(e), t;
1176
+ }
1177
+ getIndex() {
1178
+ return this._myIndex;
1179
+ }
1180
+ search(e, t) {
1181
+ const {
1182
+ limit: n = -1
1183
+ } = t || {}, {
1184
+ includeMatches: i,
1185
+ includeScore: l,
1186
+ shouldSort: r,
1187
+ sortFn: u,
1188
+ ignoreFieldNorm: c
1189
+ } = this.options;
1190
+ if (P(e) && !e.trim()) {
1191
+ let a = this._docs.map((h, d) => ({
1192
+ item: h,
1193
+ refIndex: d
1194
+ }));
1195
+ return me(n) && n > -1 && (a = a.slice(0, n)), a;
1196
+ }
1197
+ const m = me(n) && n > 0 && P(e);
1198
+ let o;
1199
+ if (m) {
1200
+ const a = new rs(n);
1201
+ P(this._docs[0]) ? this._searchStringList(e, {
1202
+ heap: a,
1203
+ ignoreFieldNorm: c
1204
+ }) : this._searchObjectList(e, {
1205
+ heap: a,
1206
+ ignoreFieldNorm: c
1207
+ }), o = a.extractSorted(u);
1208
+ } else
1209
+ o = P(e) ? P(this._docs[0]) ? this._searchStringList(e) : this._searchObjectList(e) : this._searchLogical(e), as(o, {
1210
+ ignoreFieldNorm: c
1211
+ }), r && o.sort(u), me(n) && n > -1 && (o = o.slice(0, n));
1212
+ return us(o, this._docs, {
1213
+ includeMatches: i,
1214
+ includeScore: l
1215
+ });
1216
+ }
1217
+ _searchStringList(e, {
1218
+ heap: t,
1219
+ ignoreFieldNorm: n
1220
+ } = {}) {
1221
+ const i = this._getSearcher(e), {
1222
+ records: l
1223
+ } = this._myIndex, r = t ? null : [];
1224
+ return l.forEach(({
1225
+ v: u,
1226
+ i: c,
1227
+ n: m
1228
+ }) => {
1229
+ if (!V(u))
1230
+ return;
1231
+ const {
1232
+ isMatch: o,
1233
+ score: a,
1234
+ indices: h
1235
+ } = i.searchIn(u);
1236
+ if (o) {
1237
+ const d = {
1238
+ item: u,
1239
+ idx: c,
1240
+ matches: [{
1241
+ score: a,
1242
+ value: u,
1243
+ norm: m,
1244
+ indices: h
1245
+ }]
1246
+ };
1247
+ t ? (d.score = Me(d.matches, {
1248
+ ignoreFieldNorm: n
1249
+ }), t.shouldInsert(d.score) && t.insert(d)) : r.push(d);
1250
+ }
1251
+ }), r;
1252
+ }
1253
+ _searchLogical(e) {
1254
+ const t = Ze(e, this.options), n = (u, c, m) => {
1255
+ if (!("children" in u)) {
1256
+ const {
1257
+ keyId: d,
1258
+ searcher: f
1259
+ } = u;
1260
+ let _;
1261
+ return d === null ? (_ = [], this._myIndex.keys.forEach((w, O) => {
1262
+ _.push(...this._findMatches({
1263
+ key: w,
1264
+ value: c[O],
1265
+ searcher: f
1266
+ }));
1267
+ })) : _ = this._findMatches({
1268
+ key: this._keyStore.get(d),
1269
+ value: this._myIndex.getValueForItemAtKeyId(c, d),
1270
+ searcher: f
1271
+ }), _ && _.length ? [{
1272
+ idx: m,
1273
+ item: c,
1274
+ matches: _
1275
+ }] : [];
1276
+ }
1277
+ const {
1278
+ children: o,
1279
+ operator: a
1280
+ } = u, h = [];
1281
+ for (let d = 0, f = o.length; d < f; d += 1) {
1282
+ const _ = o[d], w = n(_, c, m);
1283
+ if (w.length)
1284
+ h.push(...w);
1285
+ else if (a === ge.AND)
1286
+ return [];
1287
+ }
1288
+ return h;
1289
+ }, i = this._myIndex.records, l = /* @__PURE__ */ new Map(), r = [];
1290
+ return i.forEach(({
1291
+ $: u,
1292
+ i: c
1293
+ }) => {
1294
+ if (V(u)) {
1295
+ const m = n(t, u, c);
1296
+ m.length && (l.has(c) || (l.set(c, {
1297
+ idx: c,
1298
+ item: u,
1299
+ matches: []
1300
+ }), r.push(l.get(c))), m.forEach(({
1301
+ matches: o
1302
+ }) => {
1303
+ l.get(c).matches.push(...o);
1304
+ }));
1305
+ }
1306
+ }), r;
1307
+ }
1308
+ // When a search involves inverse patterns (e.g. !Syrup), the aggregation
1309
+ // across keys switches from "ANY key matches" to "ALL keys must match."
1310
+ // This is signaled by hasInverse on the SearchResult from ExtendedSearch.
1311
+ //
1312
+ // For mixed patterns like "^hello !Syrup", a key failure is ambiguous —
1313
+ // it could be the positive or inverse term that failed. In that case we
1314
+ // conservatively exclude the item, which is strictly better than the old
1315
+ // behavior of including it. See: https://github.com/krisk/Fuse/issues/712
1316
+ _searchObjectList(e, {
1317
+ heap: t,
1318
+ ignoreFieldNorm: n
1319
+ } = {}) {
1320
+ const i = this._getSearcher(e), {
1321
+ keys: l,
1322
+ records: r
1323
+ } = this._myIndex, u = t ? null : [];
1324
+ return r.forEach(({
1325
+ $: c,
1326
+ i: m
1327
+ }) => {
1328
+ if (!V(c))
1329
+ return;
1330
+ const o = [];
1331
+ let a = !1, h = !1;
1332
+ if (l.forEach((d, f) => {
1333
+ const _ = this._findMatches({
1334
+ key: d,
1335
+ value: c[f],
1336
+ searcher: i
1337
+ });
1338
+ _.length ? (o.push(..._), _[0].hasInverse && (h = !0)) : a = !0;
1339
+ }), !(h && a) && o.length) {
1340
+ const d = {
1341
+ idx: m,
1342
+ item: c,
1343
+ matches: o
1344
+ };
1345
+ t ? (d.score = Me(d.matches, {
1346
+ ignoreFieldNorm: n
1347
+ }), t.shouldInsert(d.score) && t.insert(d)) : u.push(d);
1348
+ }
1349
+ }), u;
1350
+ }
1351
+ _findMatches({
1352
+ key: e,
1353
+ value: t,
1354
+ searcher: n
1355
+ }) {
1356
+ if (!V(t))
1357
+ return [];
1358
+ const i = [];
1359
+ if (Z(t))
1360
+ t.forEach(({
1361
+ v: l,
1362
+ i: r,
1363
+ n: u
1364
+ }) => {
1365
+ if (!V(l))
1366
+ return;
1367
+ const {
1368
+ isMatch: c,
1369
+ score: m,
1370
+ indices: o,
1371
+ hasInverse: a
1372
+ } = n.searchIn(l);
1373
+ c && i.push({
1374
+ score: m,
1375
+ key: e,
1376
+ value: l,
1377
+ idx: r,
1378
+ norm: u,
1379
+ indices: o,
1380
+ hasInverse: a
1381
+ });
1382
+ });
1383
+ else {
1384
+ const {
1385
+ v: l,
1386
+ n: r
1387
+ } = t, {
1388
+ isMatch: u,
1389
+ score: c,
1390
+ indices: m,
1391
+ hasInverse: o
1392
+ } = n.searchIn(l);
1393
+ u && i.push({
1394
+ score: c,
1395
+ key: e,
1396
+ value: l,
1397
+ norm: r,
1398
+ indices: m,
1399
+ hasInverse: o
1400
+ });
1401
+ }
1402
+ return i;
1403
+ }
1404
+ }
1405
+ class ms {
1406
+ static condition(e, t) {
1407
+ return t.useTokenSearch;
1408
+ }
1409
+ constructor(e, t) {
1410
+ this.options = t, this.analyzer = Ie({
1411
+ isCaseSensitive: t.isCaseSensitive,
1412
+ ignoreDiacritics: t.ignoreDiacritics
1413
+ });
1414
+ const n = this.analyzer.tokenize(e), i = t._invertedIndex, {
1415
+ df: l,
1416
+ fieldCount: r
1417
+ } = i;
1418
+ this.termSearchers = [], this.idfWeights = [];
1419
+ for (const u of n) {
1420
+ this.termSearchers.push(new Fe(u, {
1421
+ location: t.location,
1422
+ threshold: t.threshold,
1423
+ distance: t.distance,
1424
+ includeMatches: t.includeMatches,
1425
+ findAllMatches: t.findAllMatches,
1426
+ minMatchCharLength: t.minMatchCharLength,
1427
+ isCaseSensitive: t.isCaseSensitive,
1428
+ ignoreDiacritics: t.ignoreDiacritics,
1429
+ ignoreLocation: !0
1430
+ }));
1431
+ const c = l.get(u) || 0, m = Math.log(1 + (r - c + 0.5) / (c + 0.5));
1432
+ this.idfWeights.push(m);
1433
+ }
1434
+ }
1435
+ searchIn(e) {
1436
+ if (!this.termSearchers.length)
1437
+ return {
1438
+ isMatch: !1,
1439
+ score: 1
1440
+ };
1441
+ const t = [];
1442
+ let n = 0, i = 0, l = 0;
1443
+ for (let c = 0; c < this.termSearchers.length; c++) {
1444
+ const m = this.termSearchers[c].searchIn(e), o = this.idfWeights[c];
1445
+ i += o, m.isMatch && (l++, n += o * (1 - m.score), m.indices && t.push(...m.indices));
1446
+ }
1447
+ if (l === 0)
1448
+ return {
1449
+ isMatch: !1,
1450
+ score: 1
1451
+ };
1452
+ const r = i > 0 ? 1 - n / i : 0, u = {
1453
+ isMatch: !0,
1454
+ score: Math.max(1e-3, r)
1455
+ };
1456
+ return this.options.includeMatches && t.length && (u.indices = Se(t)), u;
1457
+ }
1458
+ }
1459
+ se.version = "7.3.0";
1460
+ se.createIndex = Ye;
1461
+ se.parseIndex = Pt;
1462
+ se.config = b;
1463
+ se.match = function(s, e, t) {
1464
+ return he(s, {
1465
+ ...b,
1466
+ ...t
1467
+ }).searchIn(e);
1468
+ };
1469
+ se.parseQuery = Ze;
1470
+ Be(ns);
1471
+ Be(ms);
1472
+ se.use = function(...s) {
1473
+ s.forEach((e) => Be(e));
1474
+ };
1475
+ const ee = (s) => s == null ? "—" : `€${s.toFixed(2)}`, hs = (s) => {
1476
+ if (!s) return "—";
1477
+ if (s < 60) return `${s} min`;
1478
+ const e = Math.floor(s / 60), t = s % 60;
1479
+ return t > 0 ? `${e}h ${t}min` : `${e}h`;
1480
+ }, gs = (s) => {
1481
+ switch (s) {
1482
+ case "confirmed":
1483
+ return "Confirmed";
1484
+ case "pending":
1485
+ return "Pending";
1486
+ case "cancelled":
1487
+ return "Cancelled";
1488
+ default:
1489
+ return s || "Unknown";
1490
+ }
1491
+ }, Ue = (s) => {
1492
+ switch (s) {
1493
+ case "confirmed":
1494
+ return "#16a34a";
1495
+ // green-600
1496
+ case "pending":
1497
+ return "#ca8a04";
1498
+ // yellow-600
1499
+ case "cancelled":
1500
+ return "#dc2626";
1501
+ // red-600
1502
+ default:
1503
+ return "#6b7280";
1504
+ }
1505
+ }, vs = (s, e = {}) => {
1506
+ const t = `${s.customerInfo?.firstName || ""} ${s.customerInfo?.lastName || ""}`.trim() || "Unknown Customer", n = s.id?.slice(0, 8) || "—", i = (/* @__PURE__ */ new Date()).toLocaleDateString("en-US", {
1507
+ year: "numeric",
1508
+ month: "long",
1509
+ day: "numeric"
1510
+ }), l = `
1511
+ <!DOCTYPE html>
1512
+ <html lang="en">
1513
+ <head>
1514
+ <meta charset="UTF-8">
1515
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
1516
+ <title>Reservation ${n}</title>
1517
+ <style>
1518
+ * {
1519
+ margin: 0;
1520
+ padding: 0;
1521
+ box-sizing: border-box;
1522
+ }
1523
+
1524
+ body {
1525
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
1526
+ line-height: 1.6;
1527
+ color: #1f2937;
1528
+ background: #fff;
1529
+ padding: 40px;
1530
+ max-width: 800px;
1531
+ margin: 0 auto;
1532
+ }
1533
+
1534
+ .header {
1535
+ display: flex;
1536
+ justify-content: space-between;
1537
+ align-items: flex-start;
1538
+ margin-bottom: 40px;
1539
+ padding-bottom: 20px;
1540
+ border-bottom: 2px solid #e5e7eb;
1541
+ }
1542
+
1543
+ .company-info {
1544
+ display: flex;
1545
+ align-items: center;
1546
+ gap: 16px;
1547
+ }
1548
+
1549
+ .company-logo {
1550
+ max-height: 50px;
1551
+ max-width: 150px;
1552
+ object-fit: contain;
1553
+ }
1554
+
1555
+ .company-name {
1556
+ font-size: 24px;
1557
+ font-weight: 700;
1558
+ color: #111827;
1559
+ }
1560
+
1561
+ .document-info {
1562
+ text-align: right;
1563
+ }
1564
+
1565
+ .document-title {
1566
+ font-size: 28px;
1567
+ font-weight: 700;
1568
+ color: #111827;
1569
+ margin-bottom: 8px;
1570
+ }
1571
+
1572
+ .booking-id {
1573
+ font-size: 14px;
1574
+ color: #6b7280;
1575
+ }
1576
+
1577
+ .status-badge {
1578
+ display: inline-block;
1579
+ padding: 4px 12px;
1580
+ border-radius: 9999px;
1581
+ font-size: 12px;
1582
+ font-weight: 600;
1583
+ text-transform: uppercase;
1584
+ margin-top: 8px;
1585
+ }
1586
+
1587
+ .section {
1588
+ margin-bottom: 32px;
1589
+ }
1590
+
1591
+ .section-title {
1592
+ font-size: 12px;
1593
+ font-weight: 600;
1594
+ text-transform: uppercase;
1595
+ letter-spacing: 0.05em;
1596
+ color: #6b7280;
1597
+ margin-bottom: 12px;
1598
+ }
1599
+
1600
+ .section-content {
1601
+ background: #f9fafb;
1602
+ border-radius: 8px;
1603
+ padding: 20px;
1604
+ }
1605
+
1606
+ .customer-name {
1607
+ font-size: 18px;
1608
+ font-weight: 600;
1609
+ margin-bottom: 8px;
1610
+ }
1611
+
1612
+ .contact-info {
1613
+ font-size: 14px;
1614
+ color: #4b5563;
1615
+ }
1616
+
1617
+ .contact-info a {
1618
+ color: #4b5563;
1619
+ text-decoration: none;
1620
+ }
1621
+
1622
+ .grid {
1623
+ display: grid;
1624
+ grid-template-columns: 1fr 1fr;
1625
+ gap: 16px;
1626
+ }
1627
+
1628
+ .info-card {
1629
+ background: #f9fafb;
1630
+ border-radius: 8px;
1631
+ padding: 16px;
1632
+ }
1633
+
1634
+ .info-label {
1635
+ font-size: 12px;
1636
+ color: #6b7280;
1637
+ margin-bottom: 4px;
1638
+ }
1639
+
1640
+ .info-value {
1641
+ font-size: 16px;
1642
+ font-weight: 600;
1643
+ }
1644
+
1645
+ .package-row {
1646
+ display: flex;
1647
+ justify-content: space-between;
1648
+ align-items: flex-start;
1649
+ }
1650
+
1651
+ .package-name {
1652
+ font-size: 16px;
1653
+ font-weight: 600;
1654
+ }
1655
+
1656
+ .package-duration {
1657
+ font-size: 14px;
1658
+ color: #6b7280;
1659
+ }
1660
+
1661
+ .package-price {
1662
+ font-size: 16px;
1663
+ font-weight: 600;
1664
+ }
1665
+
1666
+ .payment-row {
1667
+ display: flex;
1668
+ justify-content: space-between;
1669
+ padding: 8px 0;
1670
+ font-size: 14px;
1671
+ }
1672
+
1673
+ .payment-label {
1674
+ color: #6b7280;
1675
+ }
1676
+
1677
+ .payment-value {
1678
+ font-weight: 500;
1679
+ }
1680
+
1681
+ .payment-value.green {
1682
+ color: #16a34a;
1683
+ }
1684
+
1685
+ .payment-value.orange {
1686
+ color: #ea580c;
1687
+ }
1688
+
1689
+ .payment-divider {
1690
+ border-top: 1px solid #e5e7eb;
1691
+ margin: 12px 0;
1692
+ }
1693
+
1694
+ .payment-total {
1695
+ font-size: 16px;
1696
+ font-weight: 600;
1697
+ }
1698
+
1699
+ .footer {
1700
+ margin-top: 60px;
1701
+ padding-top: 20px;
1702
+ border-top: 1px solid #e5e7eb;
1703
+ text-align: center;
1704
+ font-size: 12px;
1705
+ color: #9ca3af;
1706
+ }
1707
+
1708
+ @media print {
1709
+ body {
1710
+ padding: 20px;
1711
+ }
1712
+
1713
+ .no-print {
1714
+ display: none;
1715
+ }
1716
+ }
1717
+ </style>
1718
+ </head>
1719
+ <body>
1720
+ <div class="header">
1721
+ <div class="company-info">
1722
+ ${e.companyLogo ? `<img src="${e.companyLogo}" alt="Logo" class="company-logo" />` : ""}
1723
+ ${e.companyName ? `<span class="company-name">${e.companyName}</span>` : ""}
1724
+ </div>
1725
+ <div class="document-info">
1726
+ <div class="document-title">Reservation</div>
1727
+ <div class="booking-id">Booking #${n}</div>
1728
+ <div
1729
+ class="status-badge"
1730
+ style="background-color: ${Ue(s.status)}20; color: ${Ue(s.status)};"
1731
+ >
1732
+ ${gs(s.status)}
1733
+ </div>
1734
+ </div>
1735
+ </div>
1736
+
1737
+ <div class="section">
1738
+ <div class="section-title">Customer</div>
1739
+ <div class="section-content">
1740
+ <div class="customer-name">${t}</div>
1741
+ <div class="contact-info">
1742
+ ${s.customerInfo?.email ? `<div>Email: <a href="mailto:${s.customerInfo.email}">${s.customerInfo.email}</a></div>` : ""}
1743
+ ${s.customerInfo?.phone ? `<div>Phone: <a href="tel:${s.customerInfo.phone}">${s.customerInfo.phone}</a></div>` : ""}
1744
+ </div>
1745
+ </div>
1746
+ </div>
1747
+
1748
+ <div class="section">
1749
+ <div class="section-title">Reservation Details</div>
1750
+ <div class="grid">
1751
+ <div class="info-card">
1752
+ <div class="info-label">Date</div>
1753
+ <div class="info-value">${e.date || "—"}</div>
1754
+ </div>
1755
+ <div class="info-card">
1756
+ <div class="info-label">Time</div>
1757
+ <div class="info-value">${s.startTime} - ${s.endTime}</div>
1758
+ </div>
1759
+ <div class="info-card">
1760
+ <div class="info-label">Spots</div>
1761
+ <div class="info-value">${s.spots || 1} ${(s.spots || 1) === 1 ? "person" : "people"}</div>
1762
+ </div>
1763
+ ${e.resourceName ? `
1764
+ <div class="info-card">
1765
+ <div class="info-label">Resource</div>
1766
+ <div class="info-value">${e.resourceName}</div>
1767
+ </div>
1768
+ ` : ""}
1769
+ ${e.agendaName ? `
1770
+ <div class="info-card">
1771
+ <div class="info-label">Service</div>
1772
+ <div class="info-value">${e.agendaName}</div>
1773
+ </div>
1774
+ ` : ""}
1775
+ </div>
1776
+ </div>
1777
+
1778
+ ${s.pricingOption ? `
1779
+ <div class="section">
1780
+ <div class="section-title">Package</div>
1781
+ <div class="section-content">
1782
+ <div class="package-row">
1783
+ <div>
1784
+ <div class="package-name">${s.pricingOption.name}</div>
1785
+ <div class="package-duration">${hs(s.pricingOption.duration)}</div>
1786
+ </div>
1787
+ <div class="package-price">${ee(s.pricingOption.price)}</div>
1788
+ </div>
1789
+ </div>
1790
+ </div>
1791
+ ` : ""}
1792
+
1793
+ <div class="section">
1794
+ <div class="section-title">Payment Summary</div>
1795
+ <div class="section-content">
1796
+ <div class="payment-row">
1797
+ <span class="payment-label">Base price</span>
1798
+ <span class="payment-value">${ee(s.reservationBasePrice)}</span>
1799
+ </div>
1800
+ ${s.reservationAddOnsPrice ? `
1801
+ <div class="payment-row">
1802
+ <span class="payment-label">Add-ons</span>
1803
+ <span class="payment-value">${ee(s.reservationAddOnsPrice)}</span>
1804
+ </div>
1805
+ ` : ""}
1806
+ ${s.discount ? `
1807
+ <div class="payment-row">
1808
+ <span class="payment-label">Discount</span>
1809
+ <span class="payment-value green">-${ee(s.discount)}</span>
1810
+ </div>
1811
+ ` : ""}
1812
+
1813
+ <div class="payment-divider"></div>
1814
+
1815
+ <div class="payment-row payment-total">
1816
+ <span>Reservation Total</span>
1817
+ <span>${ee(s.reservationPrice)}</span>
1818
+ </div>
1819
+
1820
+ ${s.amountPaid !== void 0 || s.amountDue !== void 0 ? `
1821
+ <div class="payment-divider"></div>
1822
+
1823
+ ${s.amountPaid !== void 0 ? `
1824
+ <div class="payment-row">
1825
+ <span class="payment-label">Amount paid</span>
1826
+ <span class="payment-value green">${ee(s.amountPaid)}</span>
1827
+ </div>
1828
+ ` : ""}
1829
+
1830
+ ${s.amountDue !== void 0 && s.amountDue > 0 ? `
1831
+ <div class="payment-row">
1832
+ <span class="payment-label">Amount due</span>
1833
+ <span class="payment-value orange">${ee(s.amountDue)}</span>
1834
+ </div>
1835
+ ` : ""}
1836
+ ` : ""}
1837
+ </div>
1838
+ </div>
1839
+
1840
+ <div class="footer">
1841
+ <p>Generated on ${i}</p>
1842
+ ${e.companyName ? `<p>${e.companyName}</p>` : ""}
1843
+ </div>
1844
+ </body>
1845
+ </html>
1846
+ `, r = window.open("", "_blank");
1847
+ r && (r.document.write(l), r.document.close(), r.onload = () => {
1848
+ r.print();
1849
+ });
1850
+ }, _s = { class: "flex items-center bg-muted/70 dark:bg-muted/20 px-4 rounded-md" }, ys = { class: "grid gap-2" }, xs = { class: "grid gap-2" }, bs = { class: "grid gap-2" }, Ds = /* @__PURE__ */ ie({
1851
+ __name: "CancelReservationDialog",
1852
+ emits: ["confirm"],
1853
+ setup(s, { expose: e, emit: t }) {
1854
+ const { config: n } = ue(), { sendMail: i } = $e(n.mailAccount), l = t, r = R(!1), u = R(!1), c = R(""), m = R(""), o = R(""), a = (d) => {
1855
+ u.value = !n.mailAccount, r.value = !0, d && (c.value = d.customerInfo?.email, m.value = "Cancellation of your reservation - " + new Date(d.date)?.toDateString(), o.value = `Dear ${d.customerInfo?.firstName ?? ""} ${d.customerInfo?.lastName ?? ""},
1856
+
1857
+ We are writing to inform you that your reservation scheduled for ${new Date(d.date)?.toDateString()} at ${d.startTime} has been cancelled.
1858
+
1859
+ 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.`);
1860
+ }, h = () => {
1861
+ if (!u.value) {
1862
+ if (!c.value || !m.value || !o.value) return alert("Please fill in all the fields.");
1863
+ i({
1864
+ to: c.value,
1865
+ subject: m.value,
1866
+ body: o.value
1867
+ });
1868
+ }
1869
+ r.value = !1;
1870
+ const { $confetti: d } = useNuxtApp();
1871
+ d(), l("confirm");
1872
+ };
1873
+ return e({
1874
+ openDialog: a
1875
+ }), (d, f) => {
1876
+ const _ = x("DialogTitle"), w = x("DialogDescription"), O = x("DialogHeader"), L = x("Checkbox"), S = x("Label"), B = x("Input"), j = x("Textarea"), K = x("Button"), W = x("DialogFooter"), F = x("DialogScrollContent"), T = x("Dialog");
1877
+ return D(), H(T, {
1878
+ open: r.value,
1879
+ "onUpdate:open": f[5] || (f[5] = (k) => r.value = k)
1880
+ }, {
1881
+ default: y(() => [
1882
+ p(F, { class: "sm:max-w-3xl" }, {
1883
+ default: y(() => [
1884
+ p(O, null, {
1885
+ default: y(() => [
1886
+ p(_, null, {
1887
+ default: y(() => [...f[6] || (f[6] = [
1888
+ C(" Cancel Reservation ", -1)
1889
+ ])]),
1890
+ _: 1
1891
+ }),
1892
+ p(w)
1893
+ ]),
1894
+ _: 1
1895
+ }),
1896
+ g("div", _s, [
1897
+ p(L, {
1898
+ modelValue: u.value,
1899
+ "onUpdate:modelValue": f[0] || (f[0] = (k) => u.value = k),
1900
+ id: "cancel-dialog-skip-mail",
1901
+ class: "border-black/80 dark:border-gray-200",
1902
+ disabled: !$(n).mailAccount
1903
+ }, null, 8, ["modelValue", "disabled"]),
1904
+ p(S, {
1905
+ for: "cancel-dialog-skip-mail",
1906
+ class: "py-4 pl-2 pr-4"
1907
+ }, {
1908
+ default: y(() => [...f[7] || (f[7] = [
1909
+ C("Do not send email to customer", -1)
1910
+ ])]),
1911
+ _: 1
1912
+ })
1913
+ ]),
1914
+ g("div", {
1915
+ class: Y(["grid gap-4 py-4", { "opacity-50": u.value }])
1916
+ }, [
1917
+ g("div", ys, [
1918
+ p(S, { for: "cancel-dialog-email" }, {
1919
+ default: y(() => [...f[8] || (f[8] = [
1920
+ C("To:", -1)
1921
+ ])]),
1922
+ _: 1
1923
+ }),
1924
+ p(B, {
1925
+ modelValue: c.value,
1926
+ "onUpdate:modelValue": f[1] || (f[1] = (k) => c.value = k),
1927
+ disabled: u.value,
1928
+ id: "cancel-dialog-email"
1929
+ }, null, 8, ["modelValue", "disabled"])
1930
+ ]),
1931
+ g("div", xs, [
1932
+ p(S, { for: "cancel-dialog-subject" }, {
1933
+ default: y(() => [...f[9] || (f[9] = [
1934
+ C("Subject:", -1)
1935
+ ])]),
1936
+ _: 1
1937
+ }),
1938
+ p(B, {
1939
+ modelValue: m.value,
1940
+ "onUpdate:modelValue": f[2] || (f[2] = (k) => m.value = k),
1941
+ disabled: u.value,
1942
+ id: "cancel-dialog-subject"
1943
+ }, null, 8, ["modelValue", "disabled"])
1944
+ ]),
1945
+ g("div", bs, [
1946
+ p(S, { for: "cancel-dialog-body" }, {
1947
+ default: y(() => [...f[10] || (f[10] = [
1948
+ C("Body:", -1)
1949
+ ])]),
1950
+ _: 1
1951
+ }),
1952
+ p(j, {
1953
+ modelValue: o.value,
1954
+ "onUpdate:modelValue": f[3] || (f[3] = (k) => o.value = k),
1955
+ disabled: u.value,
1956
+ id: "cancel-dialog-body"
1957
+ }, null, 8, ["modelValue", "disabled"])
1958
+ ])
1959
+ ], 2),
1960
+ p(W, null, {
1961
+ default: y(() => [
1962
+ p(K, {
1963
+ variant: "outline",
1964
+ onClick: f[4] || (f[4] = (k) => r.value = !1)
1965
+ }, {
1966
+ default: y(() => [...f[11] || (f[11] = [
1967
+ C("Close", -1)
1968
+ ])]),
1969
+ _: 1
1970
+ }),
1971
+ p(K, {
1972
+ variant: "destructive",
1973
+ onClick: h
1974
+ }, {
1975
+ default: y(() => [...f[12] || (f[12] = [
1976
+ C("Cancel reservation", -1)
1977
+ ])]),
1978
+ _: 1
1979
+ })
1980
+ ]),
1981
+ _: 1
1982
+ })
1983
+ ]),
1984
+ _: 1
1985
+ })
1986
+ ]),
1987
+ _: 1
1988
+ }, 8, ["open"]);
1989
+ };
1990
+ }
1991
+ }), Cs = /* @__PURE__ */ ie({
1992
+ __name: "TransferReservationDialog",
1993
+ setup(s, { expose: e }) {
1994
+ const { config: t } = ue(), n = R(!1);
1995
+ return e({
1996
+ openDialog: () => {
1997
+ n.value = !0;
1998
+ }
1999
+ }), (l, r) => {
2000
+ const u = x("DialogTitle"), c = x("DialogDescription"), m = x("DialogHeader"), o = x("Button"), a = x("DialogFooter"), h = x("DialogScrollContent"), d = x("Dialog");
2001
+ return D(), H(d, {
2002
+ open: n.value,
2003
+ "onUpdate:open": r[2] || (r[2] = (f) => n.value = f)
2004
+ }, {
2005
+ default: y(() => [
2006
+ p(h, { class: "sm:max-w-3xl" }, {
2007
+ default: y(() => [
2008
+ p(m, null, {
2009
+ default: y(() => [
2010
+ p(u, null, {
2011
+ default: y(() => [...r[3] || (r[3] = [
2012
+ C(" Transfer Reservation ", -1)
2013
+ ])]),
2014
+ _: 1
2015
+ }),
2016
+ p(c)
2017
+ ]),
2018
+ _: 1
2019
+ }),
2020
+ r[6] || (r[6] = g("div", { class: "py-4" }, null, -1)),
2021
+ p(a, null, {
2022
+ default: y(() => [
2023
+ p(o, {
2024
+ variant: "outline",
2025
+ onClick: r[0] || (r[0] = (f) => n.value = !1)
2026
+ }, {
2027
+ default: y(() => [...r[4] || (r[4] = [
2028
+ C("Close", -1)
2029
+ ])]),
2030
+ _: 1
2031
+ }),
2032
+ p(o, {
2033
+ onClick: r[1] || (r[1] = (f) => n.value = !1)
2034
+ }, {
2035
+ default: y(() => [...r[5] || (r[5] = [
2036
+ C("Transfer reservation", -1)
2037
+ ])]),
2038
+ _: 1
2039
+ })
2040
+ ]),
2041
+ _: 1
2042
+ })
2043
+ ]),
2044
+ _: 1
2045
+ })
2046
+ ]),
2047
+ _: 1
2048
+ }, 8, ["open"]);
2049
+ };
2050
+ }
2051
+ }), ks = { class: "flex items-center bg-muted/70 dark:bg-muted/20 px-4 rounded-md" }, As = { class: "grid gap-2" }, ws = { class: "grid gap-2" }, Ms = { class: "grid gap-2" }, Is = /* @__PURE__ */ ie({
2052
+ __name: "ApproveReservationDialog",
2053
+ emits: ["confirm"],
2054
+ setup(s, { expose: e, emit: t }) {
2055
+ const { config: n } = ue(), { sendMail: i } = $e(n.mailAccount), l = t, r = R(!1), u = R("approve"), c = R(!1), m = R(""), o = R(""), a = R(""), h = (f, _) => {
2056
+ c.value = !n.mailAccount, r.value = !0, f && (_ || (_ = "approve"), u.value = _, m.value = f.customerInfo?.email, o.value = "Confirmation: Your reservation for " + new Date(f.date)?.toDateString(), a.value = `Dear ${f.customerInfo?.firstName ?? ""} ${f.customerInfo?.lastName ?? ""},
2057
+
2058
+ This email confirms your reservation for ${new Date(f.date)?.toDateString()} at ${f.startTime}.
2059
+
2060
+ 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.`);
2061
+ }, d = () => {
2062
+ if (!c.value) {
2063
+ if (!m.value || !o.value || !a.value) return alert("Please fill in all the fields.");
2064
+ i({
2065
+ to: m.value,
2066
+ subject: o.value,
2067
+ body: a.value
2068
+ });
2069
+ }
2070
+ r.value = !1;
2071
+ const { $confetti: f } = useNuxtApp();
2072
+ f(), l("confirm");
2073
+ };
2074
+ return e({
2075
+ openDialog: h
2076
+ }), (f, _) => {
2077
+ const w = x("DialogTitle"), O = x("DialogDescription"), L = x("DialogHeader"), S = x("Checkbox"), B = x("Label"), j = x("Input"), K = x("Textarea"), W = x("Button"), F = x("DialogFooter"), T = x("DialogScrollContent"), k = x("Dialog");
2078
+ return D(), H(k, {
2079
+ open: r.value,
2080
+ "onUpdate:open": _[5] || (_[5] = (N) => r.value = N)
2081
+ }, {
2082
+ default: y(() => [
2083
+ p(T, { class: "sm:max-w-3xl" }, {
2084
+ default: y(() => [
2085
+ p(L, null, {
2086
+ default: y(() => [
2087
+ p(w, null, {
2088
+ default: y(() => [
2089
+ C(I(u.value === "approve" ? "Approve Reservation" : "Resend Confirmation Email"), 1)
2090
+ ]),
2091
+ _: 1
2092
+ }),
2093
+ p(O)
2094
+ ]),
2095
+ _: 1
2096
+ }),
2097
+ g("div", ks, [
2098
+ p(S, {
2099
+ modelValue: c.value,
2100
+ "onUpdate:modelValue": _[0] || (_[0] = (N) => c.value = N),
2101
+ id: "reject-dialog-skip-mail",
2102
+ class: "border-black/80 dark:border-gray-200",
2103
+ disabled: !$(n).mailAccount
2104
+ }, null, 8, ["modelValue", "disabled"]),
2105
+ p(B, {
2106
+ for: "reject-dialog-skip-mail",
2107
+ class: "py-4 pl-2 pr-4"
2108
+ }, {
2109
+ default: y(() => [..._[6] || (_[6] = [
2110
+ C("Do not send email to customer", -1)
2111
+ ])]),
2112
+ _: 1
2113
+ })
2114
+ ]),
2115
+ g("div", {
2116
+ class: Y(["grid gap-4 py-4", { "opacity-50": c.value }])
2117
+ }, [
2118
+ g("div", As, [
2119
+ p(B, { for: "approve-dialog-email" }, {
2120
+ default: y(() => [..._[7] || (_[7] = [
2121
+ C("To:", -1)
2122
+ ])]),
2123
+ _: 1
2124
+ }),
2125
+ p(j, {
2126
+ modelValue: m.value,
2127
+ "onUpdate:modelValue": _[1] || (_[1] = (N) => m.value = N),
2128
+ disabled: c.value,
2129
+ id: "approve-dialog-email"
2130
+ }, null, 8, ["modelValue", "disabled"])
2131
+ ]),
2132
+ g("div", ws, [
2133
+ p(B, { for: "approve-dialog-subject" }, {
2134
+ default: y(() => [..._[8] || (_[8] = [
2135
+ C("Subject:", -1)
2136
+ ])]),
2137
+ _: 1
2138
+ }),
2139
+ p(j, {
2140
+ modelValue: o.value,
2141
+ "onUpdate:modelValue": _[2] || (_[2] = (N) => o.value = N),
2142
+ disabled: c.value,
2143
+ id: "approve-dialog-subject"
2144
+ }, null, 8, ["modelValue", "disabled"])
2145
+ ]),
2146
+ g("div", Ms, [
2147
+ p(B, { for: "approve-dialog-body" }, {
2148
+ default: y(() => [..._[9] || (_[9] = [
2149
+ C("Body:", -1)
2150
+ ])]),
2151
+ _: 1
2152
+ }),
2153
+ p(K, {
2154
+ modelValue: a.value,
2155
+ "onUpdate:modelValue": _[3] || (_[3] = (N) => a.value = N),
2156
+ disabled: c.value,
2157
+ id: "approve-dialog-body"
2158
+ }, null, 8, ["modelValue", "disabled"])
2159
+ ])
2160
+ ], 2),
2161
+ p(F, null, {
2162
+ default: y(() => [
2163
+ p(W, {
2164
+ variant: "outline",
2165
+ onClick: _[4] || (_[4] = (N) => r.value = !1)
2166
+ }, {
2167
+ default: y(() => [..._[10] || (_[10] = [
2168
+ C("Close", -1)
2169
+ ])]),
2170
+ _: 1
2171
+ }),
2172
+ p(W, { onClick: d }, {
2173
+ default: y(() => [..._[11] || (_[11] = [
2174
+ C("Approve reservation", -1)
2175
+ ])]),
2176
+ _: 1
2177
+ })
2178
+ ]),
2179
+ _: 1
2180
+ })
2181
+ ]),
2182
+ _: 1
2183
+ })
2184
+ ]),
2185
+ _: 1
2186
+ }, 8, ["open"]);
2187
+ };
2188
+ }
2189
+ }), $s = { class: "flex items-center bg-muted/70 dark:bg-muted/20 px-4 rounded-md" }, Es = { class: "grid gap-2" }, Ss = { class: "grid gap-2" }, Fs = { class: "grid gap-2" }, Bs = /* @__PURE__ */ ie({
2190
+ __name: "RejectReservationDialog",
2191
+ emits: ["confirm"],
2192
+ setup(s, { expose: e, emit: t }) {
2193
+ const { config: n } = ue(), { sendMail: i } = $e(n.mailAccount), l = t, r = R(!1), u = R(!1), c = R(""), m = R(""), o = R(""), a = (d) => {
2194
+ u.value = !n.mailAccount, r.value = !0, d && (c.value = d.customerInfo?.email, m.value = "Regarding your reservation request for " + new Date(d.date)?.toDateString(), o.value = `Dear ${d.customerInfo?.firstName ?? ""} ${d.customerInfo?.lastName ?? ""},
2195
+
2196
+ Thank you for your interest in booking with us. Unfortunately, we are unable to confirm your request for ${new Date(d.date)?.toDateString()} at ${d.startTime}.
2197
+
2198
+ We would love to see you another time!`);
2199
+ }, h = () => {
2200
+ if (!u.value) {
2201
+ if (!c.value || !m.value || !o.value) return alert("Please fill in all the fields.");
2202
+ i({
2203
+ to: c.value,
2204
+ subject: m.value,
2205
+ body: o.value
2206
+ });
2207
+ }
2208
+ r.value = !1;
2209
+ const { $confetti: d } = useNuxtApp();
2210
+ d(), l("confirm");
2211
+ };
2212
+ return e({
2213
+ openDialog: a
2214
+ }), (d, f) => {
2215
+ const _ = x("DialogTitle"), w = x("DialogDescription"), O = x("DialogHeader"), L = x("Checkbox"), S = x("Label"), B = x("Input"), j = x("Textarea"), K = x("Button"), W = x("DialogFooter"), F = x("DialogScrollContent"), T = x("Dialog");
2216
+ return D(), H(T, {
2217
+ open: r.value,
2218
+ "onUpdate:open": f[5] || (f[5] = (k) => r.value = k)
2219
+ }, {
2220
+ default: y(() => [
2221
+ p(F, { class: "sm:max-w-3xl" }, {
2222
+ default: y(() => [
2223
+ p(O, null, {
2224
+ default: y(() => [
2225
+ p(_, null, {
2226
+ default: y(() => [...f[6] || (f[6] = [
2227
+ C(" Reject Reservation Request ", -1)
2228
+ ])]),
2229
+ _: 1
2230
+ }),
2231
+ p(w)
2232
+ ]),
2233
+ _: 1
2234
+ }),
2235
+ g("div", $s, [
2236
+ p(L, {
2237
+ modelValue: u.value,
2238
+ "onUpdate:modelValue": f[0] || (f[0] = (k) => u.value = k),
2239
+ id: "reject-dialog-skip-mail",
2240
+ class: "border-black/80 dark:border-gray-200",
2241
+ disabled: !$(n).mailAccount
2242
+ }, null, 8, ["modelValue", "disabled"]),
2243
+ p(S, {
2244
+ for: "reject-dialog-skip-mail",
2245
+ class: "py-4 pl-2 pr-4"
2246
+ }, {
2247
+ default: y(() => [...f[7] || (f[7] = [
2248
+ C("Do not send email to customer", -1)
2249
+ ])]),
2250
+ _: 1
2251
+ })
2252
+ ]),
2253
+ g("div", {
2254
+ class: Y(["grid gap-4 py-4", { "opacity-50": u.value }])
2255
+ }, [
2256
+ g("div", Es, [
2257
+ p(S, { for: "reject-dialog-email" }, {
2258
+ default: y(() => [...f[8] || (f[8] = [
2259
+ C("To:", -1)
2260
+ ])]),
2261
+ _: 1
2262
+ }),
2263
+ p(B, {
2264
+ modelValue: c.value,
2265
+ "onUpdate:modelValue": f[1] || (f[1] = (k) => c.value = k),
2266
+ disabled: u.value,
2267
+ id: "reject-dialog-email"
2268
+ }, null, 8, ["modelValue", "disabled"])
2269
+ ]),
2270
+ g("div", Ss, [
2271
+ p(S, { for: "reject-dialog-subject" }, {
2272
+ default: y(() => [...f[9] || (f[9] = [
2273
+ C("Subject:", -1)
2274
+ ])]),
2275
+ _: 1
2276
+ }),
2277
+ p(B, {
2278
+ modelValue: m.value,
2279
+ "onUpdate:modelValue": f[2] || (f[2] = (k) => m.value = k),
2280
+ disabled: u.value,
2281
+ id: "reject-dialog-subject"
2282
+ }, null, 8, ["modelValue", "disabled"])
2283
+ ]),
2284
+ g("div", Fs, [
2285
+ p(S, { for: "reject-dialog-body" }, {
2286
+ default: y(() => [...f[10] || (f[10] = [
2287
+ C("Body:", -1)
2288
+ ])]),
2289
+ _: 1
2290
+ }),
2291
+ p(j, {
2292
+ modelValue: o.value,
2293
+ "onUpdate:modelValue": f[3] || (f[3] = (k) => o.value = k),
2294
+ disabled: u.value,
2295
+ id: "reject-dialog-body"
2296
+ }, null, 8, ["modelValue", "disabled"])
2297
+ ])
2298
+ ], 2),
2299
+ p(W, null, {
2300
+ default: y(() => [
2301
+ p(K, {
2302
+ variant: "outline",
2303
+ onClick: f[4] || (f[4] = (k) => r.value = !1)
2304
+ }, {
2305
+ default: y(() => [...f[11] || (f[11] = [
2306
+ C("Close", -1)
2307
+ ])]),
2308
+ _: 1
2309
+ }),
2310
+ p(K, {
2311
+ variant: "destructive",
2312
+ onClick: h
2313
+ }, {
2314
+ default: y(() => [...f[12] || (f[12] = [
2315
+ C("Reject reservation", -1)
2316
+ ])]),
2317
+ _: 1
2318
+ })
2319
+ ]),
2320
+ _: 1
2321
+ })
2322
+ ]),
2323
+ _: 1
2324
+ })
2325
+ ]),
2326
+ _: 1
2327
+ }, 8, ["open"]);
2328
+ };
2329
+ }
2330
+ }), Rs = { key: 0 }, js = {
2331
+ key: 0,
2332
+ class: "flex items-center gap-1.5 flex-wrap"
2333
+ }, Os = {
2334
+ key: 0,
2335
+ class: "space-y-2 mb-4"
2336
+ }, Ts = { class: "text-xs font-medium text-muted-foreground uppercase tracking-wide" }, Ns = {
2337
+ key: 0,
2338
+ class: "text-2xl font-bold tracking-wider"
2339
+ }, zs = {
2340
+ key: 1,
2341
+ class: "flex flex-wrap gap-2 mb-4"
2342
+ }, Ls = {
2343
+ key: 1,
2344
+ class: "text-xs text-muted-foreground mr-0.5"
2345
+ }, Ps = {
2346
+ key: 2,
2347
+ class: "space-y-3"
2348
+ }, Vs = { class: "bg-muted/30 rounded-lg p-4 space-y-2" }, Us = { class: "text-muted-foreground flex items-center gap-1.5" }, Ws = { class: "font-medium" }, We = /* @__PURE__ */ ie({
2349
+ __name: "OrderMetadataDisplay",
2350
+ props: {
2351
+ metadata: { default: () => ({}) },
2352
+ schema: { default: () => [] },
2353
+ displayFilter: { default: void 0 },
2354
+ scope: { default: void 0 },
2355
+ compact: { type: Boolean, default: !1 }
2356
+ },
2357
+ setup(s, { expose: e }) {
2358
+ const t = s, n = J(() => {
2359
+ if (!t.metadata) return [];
2360
+ const c = new Set(t.schema?.map((a) => a.key) || []), m = (t.schema || []).filter((a) => !(t.scope && a.scope !== t.scope || t.displayFilter && !t.displayFilter.includes(a.display) || t.metadata[a.key] === void 0 || t.metadata[a.key] === null || a.display === "hidden" || t.metadata[a.key] === !1)).sort((a, h) => (a.order || 0) - (h.order || 0)).map((a) => ({
2361
+ ...a,
2362
+ value: t.metadata[a.key]
2363
+ }));
2364
+ if (t.displayFilter && !t.displayFilter.includes("field")) return m;
2365
+ const o = Object.entries(t.metadata).filter(([a, h]) => !c.has(a) && h !== void 0 && h !== null && h !== !1).map(([a, h]) => ({
2366
+ id: `_fallback_${a}`,
2367
+ key: a,
2368
+ label: a.replace(/([A-Z])/g, " $1").replace(/[_-]/g, " ").replace(/^\w/, (d) => d.toUpperCase()).trim(),
2369
+ display: "field",
2370
+ scope: "order",
2371
+ value: typeof h == "object" ? JSON.stringify(h) : String(h)
2372
+ }));
2373
+ return [...m, ...o];
2374
+ }), i = J(() => n.value.filter((c) => c.display === "highlight")), l = J(() => n.value.filter((c) => c.display === "badge")), r = J(() => n.value.filter((c) => c.display === "field")), u = J(() => n.value.length > 0);
2375
+ return e({ hasContent: u }), (c, m) => u.value ? (D(), M("div", Rs, [
2376
+ s.compact ? (D(), M("div", js, [
2377
+ (D(!0), M(G, null, re(i.value, (o) => (D(), M("span", {
2378
+ key: o.id,
2379
+ class: Y(["inline-flex items-center gap-1 px-2 py-0.5 text-xs font-bold rounded-md", o.color ? "" : "bg-primary/10 text-primary"]),
2380
+ style: ne(o.color ? { backgroundColor: o.color + "20", color: o.color } : {})
2381
+ }, [
2382
+ (D(), H(le($(Q)[o.icon]), { size: 12 })),
2383
+ C(" " + I(o.value === !0 ? o.label : o.value), 1)
2384
+ ], 6))), 128)),
2385
+ (D(!0), M(G, null, re(l.value, (o) => (D(), M("span", {
2386
+ key: o.id,
2387
+ class: Y(["inline-flex items-center gap-1 px-2 py-0.5 text-xs font-medium rounded-full", o.color ? "" : "bg-muted text-muted-foreground"]),
2388
+ style: ne(o.color ? { backgroundColor: o.color + "20", color: o.color } : {})
2389
+ }, [
2390
+ o.icon && $(Q)[o.icon] ? (D(), H(le($(Q)[o.icon]), {
2391
+ key: 0,
2392
+ size: 10
2393
+ })) : E("", !0),
2394
+ C(" " + I(o.value === !0 ? o.label : o.value), 1)
2395
+ ], 6))), 128))
2396
+ ])) : (D(), M(G, { key: 1 }, [
2397
+ i.value.length ? (D(), M("div", Os, [
2398
+ (D(!0), M(G, null, re(i.value, (o) => (D(), M("div", {
2399
+ key: o.id,
2400
+ class: Y(["rounded-lg border-2 p-4 flex items-center gap-4", o.color ? "" : "border-primary/20 bg-primary/5"]),
2401
+ style: ne(o.color ? { borderColor: o.color + "40", backgroundColor: o.color + "08" } : {})
2402
+ }, [
2403
+ g("div", {
2404
+ class: Y(["h-12 w-12 rounded-xl flex items-center justify-center shrink-0", o.color ? "" : "bg-primary/10"]),
2405
+ style: ne(o.color ? { backgroundColor: o.color + "20" } : {})
2406
+ }, [
2407
+ o.icon && $(Q)[o.icon] ? (D(), H(le($(Q)[o.icon]), {
2408
+ key: 0,
2409
+ size: 24,
2410
+ style: ne(o.color ? { color: o.color } : {}),
2411
+ class: Y(o.color ? "" : "text-primary")
2412
+ }, null, 8, ["style", "class"])) : E("", !0)
2413
+ ], 6),
2414
+ g("div", null, [
2415
+ g("p", Ts, I(o.label), 1),
2416
+ o.value !== !0 ? (D(), M("p", Ns, I(o.value), 1)) : E("", !0)
2417
+ ])
2418
+ ], 6))), 128))
2419
+ ])) : E("", !0),
2420
+ l.value.length ? (D(), M("div", zs, [
2421
+ (D(!0), M(G, null, re(l.value, (o) => (D(), M("span", {
2422
+ key: o.id,
2423
+ class: Y(["inline-flex items-center gap-1.5 px-3 py-1.5 text-sm font-medium rounded-full", o.color ? "" : "bg-muted text-muted-foreground"]),
2424
+ style: ne(o.color ? { backgroundColor: o.color + "20", color: o.color } : {})
2425
+ }, [
2426
+ o.icon && $(Q)[o.icon] ? (D(), H(le($(Q)[o.icon]), {
2427
+ key: 0,
2428
+ size: 14
2429
+ })) : E("", !0),
2430
+ o.label ? (D(), M("span", Ls, [
2431
+ C(I(o.label), 1),
2432
+ o.value !== !0 ? (D(), M(G, { key: 0 }, [
2433
+ C(":")
2434
+ ], 64)) : E("", !0)
2435
+ ])) : E("", !0),
2436
+ o.value !== !0 ? (D(), M(G, { key: 2 }, [
2437
+ C(I(o.value), 1)
2438
+ ], 64)) : E("", !0)
2439
+ ], 6))), 128))
2440
+ ])) : E("", !0),
2441
+ r.value.length ? (D(), M("div", Ps, [
2442
+ m[0] || (m[0] = g("h3", { class: "text-sm font-semibold text-muted-foreground uppercase tracking-wide" }, "Additional Info", -1)),
2443
+ g("div", Vs, [
2444
+ (D(!0), M(G, null, re(r.value, (o) => (D(), M("div", {
2445
+ key: o.id,
2446
+ class: "flex justify-between text-sm"
2447
+ }, [
2448
+ g("span", Us, [
2449
+ o.icon && $(Q)[o.icon] ? (D(), H(le($(Q)[o.icon]), {
2450
+ key: 0,
2451
+ size: 14
2452
+ })) : E("", !0),
2453
+ C(" " + I(o.label), 1)
2454
+ ]),
2455
+ g("span", Ws, I(o.value === !0 ? "✓" : o.value), 1)
2456
+ ]))), 128))
2457
+ ])
2458
+ ])) : E("", !0)
2459
+ ], 64))
2460
+ ])) : E("", !0);
2461
+ }
2462
+ }), Hs = {
2463
+ key: 0,
2464
+ class: "space-y-6 py-4"
2465
+ }, Ks = { class: "space-y-3" }, Gs = { class: "bg-muted/30 rounded-lg p-4 space-y-3" }, Ys = { class: "flex items-center gap-3" }, Qs = { class: "h-10 w-10 rounded-full bg-primary/10 flex items-center justify-center" }, Js = { class: "font-medium" }, Xs = { class: "grid gap-2 text-sm" }, Zs = {
2466
+ key: 0,
2467
+ class: "flex items-center gap-2 text-muted-foreground"
2468
+ }, qs = ["href"], en = {
2469
+ key: 1,
2470
+ class: "flex items-center gap-2 text-muted-foreground"
2471
+ }, tn = ["href"], sn = { class: "space-y-3" }, nn = { class: "grid grid-cols-2 gap-3" }, on = { class: "bg-muted/30 rounded-lg p-3" }, an = { class: "flex items-center gap-2 text-muted-foreground mb-1" }, rn = { class: "text-xs" }, ln = { class: "font-medium" }, cn = { class: "bg-muted/30 rounded-lg p-3" }, un = { class: "flex items-center gap-2 text-muted-foreground mb-1" }, dn = { class: "font-medium" }, fn = {
2472
+ key: 0,
2473
+ class: "space-y-3"
2474
+ }, pn = { class: "bg-muted/30 rounded-lg p-4" }, mn = { class: "flex items-start justify-between" }, hn = { class: "flex items-start gap-3" }, gn = { class: "h-9 w-9 rounded-lg bg-primary/10 flex items-center justify-center mt-0.5" }, vn = { class: "font-medium" }, _n = { class: "text-sm text-muted-foreground" }, yn = { class: "font-semibold" }, xn = { class: "space-y-3" }, bn = { class: "bg-muted/30 rounded-lg p-4 space-y-3" }, Dn = { class: "space-y-2 text-sm" }, Cn = { class: "flex justify-between" }, kn = {
2475
+ key: 0,
2476
+ class: "flex justify-between"
2477
+ }, An = {
2478
+ key: 1,
2479
+ class: "flex justify-between text-green-600 dark:text-green-400"
2480
+ }, wn = { class: "flex justify-between font-semibold" }, Mn = {
2481
+ key: 1,
2482
+ class: "space-y-2 text-sm"
2483
+ }, In = {
2484
+ key: 0,
2485
+ class: "flex justify-between"
2486
+ }, $n = { class: "text-muted-foreground flex items-center gap-1.5" }, En = { class: "text-green-600 dark:text-green-400" }, Sn = {
2487
+ key: 1,
2488
+ class: "flex justify-between"
2489
+ }, Fn = { class: "text-muted-foreground flex items-center gap-1.5" }, Bn = { class: "text-orange-600 dark:text-orange-400 font-medium" }, Nn = /* @__PURE__ */ ie({
2490
+ __name: "ReservationDetailDialog",
2491
+ props: {
2492
+ agendaData: {}
2493
+ },
2494
+ emits: ["cancelled", "confirmed", "rejected"],
2495
+ setup(s, { expose: e, emit: t }) {
2496
+ const n = s, { hasPermission: i } = Ct(), { config: l } = ue(), r = kt(l.project), u = rt("event", R(null)), c = J(() => n.agendaData?.metadataSchema || []), m = t, o = R(!1), a = R(null), h = R(!1), d = fe("cancelReservationDialog"), f = fe("approveReservationDialog"), _ = fe("rejectReservationDialog"), w = fe("transferReservationDialog"), O = (A) => {
2497
+ a.value = A, o.value = !0;
2498
+ }, L = J(() => a.value?.customerInfo && `${a.value.customerInfo.firstName} ${a.value.customerInfo.lastName}`.trim() || "Unknown Customer"), S = J(() => {
2499
+ let A = a.value?.status;
2500
+ const v = a.value?.reservationStatus;
2501
+ switch (A === "confirmed" && ["needs_approval", "rejected", "approved", "cancelled"].includes(v) && (A = v), A) {
2502
+ case "pending":
2503
+ return { label: "Pending", class: "bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400" };
2504
+ case "cancelled":
2505
+ return { label: "Cancelled", class: "bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400" };
2506
+ case "needs_approval":
2507
+ return { label: "Needs Approval", class: "bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400" };
2508
+ case "rejected":
2509
+ return { label: "Rejected", class: "bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400" };
2510
+ case "approved":
2511
+ return { label: "Approved", class: "bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400" };
2512
+ case "confirmed":
2513
+ return { label: "Confirmed", class: "bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400" };
2514
+ default:
2515
+ return { label: A || "Unknown", class: "bg-muted text-muted-foreground" };
2516
+ }
2517
+ }), B = J(() => a.value?.status === "cancelled"), j = (A) => A == null || typeof A != "number" ? "—" : `€${A?.toFixed(2)}`, K = (A) => {
2518
+ if (!A) return "—";
2519
+ if (A < 60) return `${A} min`;
2520
+ const v = Math.floor(A / 60), z = A % 60;
2521
+ return z > 0 ? `${v}h ${z}min` : `${v}h`;
2522
+ }, W = () => {
2523
+ if (!a.value) return;
2524
+ let A = "";
2525
+ const v = u?.value?.date;
2526
+ if (v)
2527
+ try {
2528
+ A = new Date(v).toLocaleDateString("en-US", {
2529
+ weekday: "long",
2530
+ year: "numeric",
2531
+ month: "long",
2532
+ day: "numeric"
2533
+ });
2534
+ } catch {
2535
+ A = v;
2536
+ }
2537
+ const z = {
2538
+ date: A,
2539
+ resourceName: u?.value?.resource?.name
2540
+ };
2541
+ vs(a.value, z);
2542
+ }, F = () => {
2543
+ f.value?.openDialog(a.value);
2544
+ }, T = () => {
2545
+ _.value?.openDialog(a.value);
2546
+ }, k = () => {
2547
+ f.value?.openDialog(a.value);
2548
+ }, N = () => {
2549
+ d.value?.openDialog(a.value);
2550
+ }, ae = async () => {
2551
+ try {
2552
+ if (h.value || !a.value?.id) throw new Error("Invalid state");
2553
+ h.value = !0;
2554
+ let v = (await r.get(l.reservationsCollection, a.value.id))?.reservations || [];
2555
+ if (!v.find((z) => z.id === a.value.res_id))
2556
+ throw new Error("Reservation not found");
2557
+ v.find((z) => z.id === a.value.res_id).status = "cancelled", await r.update(l.reservationsCollection, a.value.id, {
2558
+ reservations: v
2559
+ }), a.value.status = "cancelled", oe.success("Reservation cancelled successfully"), m("cancelled"), o.value = !1;
2560
+ } catch (A) {
2561
+ console.error("Error cancelling reservation:", A), oe.error("Failed to cancel reservation");
2562
+ } finally {
2563
+ h.value = !1;
2564
+ }
2565
+ }, X = async () => {
2566
+ try {
2567
+ if (h.value || !a.value?.id) throw new Error("Invalid state");
2568
+ h.value = !0;
2569
+ let v = (await r.get(l.reservationsCollection, a.value.id))?.reservations || [];
2570
+ if (!v.find((z) => z.id === a.value.res_id))
2571
+ throw new Error("Reservation not found");
2572
+ v.find((z) => z.id === a.value.res_id).status = "approved", await r.update(l.reservationsCollection, a.value.id, {
2573
+ reservations: v
2574
+ }), a.value.status = "approved", oe.success("Reservation approved successfully"), m("confirmed"), o.value = !1;
2575
+ } catch (A) {
2576
+ console.error("Error approving reservation:", A), oe.error("Failed to approve reservation");
2577
+ } finally {
2578
+ h.value = !1;
2579
+ }
2580
+ }, Re = async () => {
2581
+ try {
2582
+ if (h.value || !a.value?.id) throw new Error("Invalid state");
2583
+ h.value = !0;
2584
+ let v = (await r.get(l.reservationsCollection, a.value.id))?.reservations || [];
2585
+ if (!v.find((z) => z.id === a.value.res_id))
2586
+ throw new Error("Reservation not found");
2587
+ v.find((z) => z.id === a.value.res_id).status = "rejected", await r.update(l.reservationsCollection, a.value.id, {
2588
+ reservations: v
2589
+ }), a.value.status = "rejected", oe.success("Reservation rejected successfully"), m("rejected"), o.value = !1;
2590
+ } catch (A) {
2591
+ console.error("Error rejecting reservation:", A), oe.error("Failed to reject reservation");
2592
+ } finally {
2593
+ h.value = !1;
2594
+ }
2595
+ }, U = () => {
2596
+ };
2597
+ return e({
2598
+ openDialog: O
2599
+ }), (A, v) => {
2600
+ const z = x("DialogTitle"), ve = x("DialogDescription"), qe = x("DialogHeader"), je = x("Separator"), _e = x("Button"), et = x("DropdownMenuTrigger"), ye = x("DropdownMenuLabel"), de = x("DropdownMenuItem"), xe = x("DropdownMenuGroup"), Oe = x("DropdownMenuSeparator"), tt = x("DropdownMenuContent"), st = x("DropdownMenu"), nt = x("DialogFooter"), ot = x("DialogScrollContent"), it = x("Dialog");
2601
+ return D(), M(G, null, [
2602
+ p(it, {
2603
+ open: o.value,
2604
+ "onUpdate:open": v[0] || (v[0] = (at) => o.value = at)
2605
+ }, {
2606
+ default: y(() => [
2607
+ p(ot, { class: "sm:max-w-xl" }, {
2608
+ default: y(() => [
2609
+ p(qe, null, {
2610
+ default: y(() => [
2611
+ p(z, { class: "flex items-center gap-3" }, {
2612
+ default: y(() => [
2613
+ v[1] || (v[1] = g("span", null, "Reservation Details", -1)),
2614
+ g("span", {
2615
+ class: Y(["px-2.5 py-1 text-xs font-medium rounded-full", S.value.class])
2616
+ }, I(S.value.label), 3)
2617
+ ]),
2618
+ _: 1
2619
+ }),
2620
+ p(ve, null, {
2621
+ default: y(() => [
2622
+ C(" Booking #" + I(a.value?.id?.slice(0, 8) || "—"), 1)
2623
+ ]),
2624
+ _: 1
2625
+ })
2626
+ ]),
2627
+ _: 1
2628
+ }),
2629
+ a.value ? (D(), M("div", Hs, [
2630
+ p(We, {
2631
+ metadata: a.value.metadata,
2632
+ schema: c.value,
2633
+ scope: "order"
2634
+ }, null, 8, ["metadata", "schema"]),
2635
+ p(We, {
2636
+ metadata: a.value.reservationMetadata,
2637
+ schema: c.value,
2638
+ scope: "reservation"
2639
+ }, null, 8, ["metadata", "schema"]),
2640
+ g("div", Ks, [
2641
+ v[2] || (v[2] = g("h3", { class: "text-sm font-semibold text-muted-foreground uppercase tracking-wide" }, "Customer", -1)),
2642
+ g("div", Gs, [
2643
+ g("div", Ys, [
2644
+ g("div", Qs, [
2645
+ p($(lt), {
2646
+ size: 20,
2647
+ class: "text-primary"
2648
+ })
2649
+ ]),
2650
+ g("div", null, [
2651
+ g("p", Js, I(L.value), 1)
2652
+ ])
2653
+ ]),
2654
+ g("div", Xs, [
2655
+ a.value.customerInfo?.email ? (D(), M("div", Zs, [
2656
+ p($(ct), { size: 14 }),
2657
+ g("a", {
2658
+ href: `mailto:${a.value.customerInfo.email}`,
2659
+ class: "hover:text-foreground transition-colors"
2660
+ }, I(a.value.customerInfo.email), 9, qs)
2661
+ ])) : E("", !0),
2662
+ a.value.customerInfo?.phone ? (D(), M("div", en, [
2663
+ p($(ut), { size: 14 }),
2664
+ g("a", {
2665
+ href: `tel:${a.value.customerInfo.phone}`,
2666
+ class: "hover:text-foreground transition-colors"
2667
+ }, I(a.value.customerInfo.phone), 9, tn)
2668
+ ])) : E("", !0)
2669
+ ])
2670
+ ])
2671
+ ]),
2672
+ g("div", sn, [
2673
+ v[4] || (v[4] = g("h3", { class: "text-sm font-semibold text-muted-foreground uppercase tracking-wide" }, "Reservation", -1)),
2674
+ g("div", nn, [
2675
+ g("div", on, [
2676
+ g("div", an, [
2677
+ p($(dt), { size: 14 }),
2678
+ g("span", rn, I(a.value.startTime) + " - " + I(a.value.endTime), 1)
2679
+ ]),
2680
+ g("p", ln, I(new Date(a.value.date).toLocaleDateString("en-US", { weekday: "long", month: "long", day: "numeric", year: "numeric" })), 1)
2681
+ ]),
2682
+ g("div", cn, [
2683
+ g("div", un, [
2684
+ p($(ft), { size: 14 }),
2685
+ v[3] || (v[3] = g("span", { class: "text-xs" }, "Spots", -1))
2686
+ ]),
2687
+ g("p", dn, I(a.value.spots || 1) + " " + I(a.value.spots === 1 ? "person" : "people"), 1)
2688
+ ])
2689
+ ])
2690
+ ]),
2691
+ a.value.pricingOption ? (D(), M("div", fn, [
2692
+ v[5] || (v[5] = g("h3", { class: "text-sm font-semibold text-muted-foreground uppercase tracking-wide" }, "Package", -1)),
2693
+ g("div", pn, [
2694
+ g("div", mn, [
2695
+ g("div", hn, [
2696
+ g("div", gn, [
2697
+ p($(pt), {
2698
+ size: 18,
2699
+ class: "text-primary"
2700
+ })
2701
+ ]),
2702
+ g("div", null, [
2703
+ g("p", vn, I(a.value.pricingOption.name), 1),
2704
+ g("p", _n, I(K(a.value.pricingOption.duration)), 1)
2705
+ ])
2706
+ ]),
2707
+ g("p", yn, I(j(a.value.pricingOption.price)), 1)
2708
+ ])
2709
+ ])
2710
+ ])) : E("", !0),
2711
+ g("div", xn, [
2712
+ v[12] || (v[12] = g("h3", { class: "text-sm font-semibold text-muted-foreground uppercase tracking-wide" }, "Payment", -1)),
2713
+ g("div", bn, [
2714
+ g("div", Dn, [
2715
+ g("div", Cn, [
2716
+ v[6] || (v[6] = g("span", { class: "text-muted-foreground" }, "Base price", -1)),
2717
+ g("span", null, I(j(a.value.reservationBasePrice)), 1)
2718
+ ]),
2719
+ a.value.reservationAddOnsPrice ? (D(), M("div", kn, [
2720
+ v[7] || (v[7] = g("span", { class: "text-muted-foreground" }, "Add-ons", -1)),
2721
+ g("span", null, I(j(a.value.reservationAddOnsPrice)), 1)
2722
+ ])) : E("", !0),
2723
+ a.value.discount ? (D(), M("div", An, [
2724
+ v[8] || (v[8] = g("span", null, "Discount", -1)),
2725
+ g("span", null, "-" + I(j(a.value.discount)), 1)
2726
+ ])) : E("", !0)
2727
+ ]),
2728
+ p(je),
2729
+ g("div", wn, [
2730
+ v[9] || (v[9] = g("span", null, "Reservation Total", -1)),
2731
+ g("span", null, I(j(a.value.reservationPrice)), 1)
2732
+ ]),
2733
+ a.value.amountPaid !== void 0 || a.value.amountDue !== void 0 ? (D(), H(je, { key: 0 })) : E("", !0),
2734
+ a.value.amountPaid !== void 0 || a.value.amountDue !== void 0 ? (D(), M("div", Mn, [
2735
+ a.value.amountPaid !== void 0 ? (D(), M("div", In, [
2736
+ g("span", $n, [
2737
+ p($(mt), { size: 14 }),
2738
+ v[10] || (v[10] = C(" Amount paid ", -1))
2739
+ ]),
2740
+ g("span", En, I(j(a.value.amountPaid)), 1)
2741
+ ])) : E("", !0),
2742
+ a.value.amountDue !== void 0 && a.value.amountDue > 0 ? (D(), M("div", Sn, [
2743
+ g("span", Fn, [
2744
+ p($(ht), { size: 14 }),
2745
+ v[11] || (v[11] = C(" Amount due ", -1))
2746
+ ]),
2747
+ g("span", Bn, I(j(a.value.amountDue)), 1)
2748
+ ])) : E("", !0)
2749
+ ])) : E("", !0)
2750
+ ])
2751
+ ])
2752
+ ])) : E("", !0),
2753
+ p(nt, { class: "gap-2 sm:justify-between" }, {
2754
+ default: y(() => [
2755
+ a.value.status === "confirmed" && a.value.reservationStatus === "needs_approval" ? (D(), M(G, { key: 0 }, [
2756
+ p(_e, {
2757
+ variant: "destructive",
2758
+ onClick: T
2759
+ }, {
2760
+ default: y(() => [
2761
+ p($(gt), { size: 16 }),
2762
+ v[13] || (v[13] = C(" Reject Reservation ", -1))
2763
+ ]),
2764
+ _: 1
2765
+ }),
2766
+ p(_e, { onClick: F }, {
2767
+ default: y(() => [
2768
+ p($(vt), { size: 16 }),
2769
+ v[14] || (v[14] = C(" Approve Reservation ", -1))
2770
+ ]),
2771
+ _: 1
2772
+ })
2773
+ ], 64)) : a.value.status === "confirmed" && a.value.reservationStatus === "approved" ? (D(), H(st, { key: 1 }, {
2774
+ default: y(() => [
2775
+ p(et, { "as-child": "" }, {
2776
+ default: y(() => [
2777
+ p(_e, {
2778
+ variant: "outline",
2779
+ class: "gap-2"
2780
+ }, {
2781
+ default: y(() => [
2782
+ p($(_t), { size: 16 }),
2783
+ v[15] || (v[15] = C(" Actions ", -1))
2784
+ ]),
2785
+ _: 1
2786
+ })
2787
+ ]),
2788
+ _: 1
2789
+ }),
2790
+ p(tt, {
2791
+ class: "w-60",
2792
+ align: "start"
2793
+ }, {
2794
+ default: y(() => [
2795
+ p(ye, { class: "text-xs text-muted-foreground font-normal" }, {
2796
+ default: y(() => [...v[16] || (v[16] = [
2797
+ C(" Reservation Actions ", -1)
2798
+ ])]),
2799
+ _: 1
2800
+ }),
2801
+ p(xe, null, {
2802
+ default: y(() => [
2803
+ p(de, {
2804
+ onClick: W,
2805
+ class: "gap-2 cursor-pointer"
2806
+ }, {
2807
+ default: y(() => [
2808
+ p($(yt), {
2809
+ size: 16,
2810
+ class: "text-muted-foreground"
2811
+ }),
2812
+ v[17] || (v[17] = g("span", null, "Download PDF", -1))
2813
+ ]),
2814
+ _: 1
2815
+ })
2816
+ ]),
2817
+ _: 1
2818
+ }),
2819
+ p(Oe),
2820
+ p(xe, null, {
2821
+ default: y(() => [
2822
+ p(ye, { class: "text-xs text-muted-foreground font-normal" }, {
2823
+ default: y(() => [...v[18] || (v[18] = [
2824
+ C(" Communication ", -1)
2825
+ ])]),
2826
+ _: 1
2827
+ }),
2828
+ p(de, {
2829
+ onClick: k,
2830
+ class: "gap-2 cursor-pointer"
2831
+ }, {
2832
+ default: y(() => [
2833
+ p($(xt), {
2834
+ size: 16,
2835
+ class: "text-muted-foreground"
2836
+ }),
2837
+ v[19] || (v[19] = g("span", null, "(Re)send Confirmation Mail", -1))
2838
+ ]),
2839
+ _: 1
2840
+ })
2841
+ ]),
2842
+ _: 1
2843
+ }),
2844
+ $(i)("manage-reservations") ? (D(), M(G, { key: 0 }, [
2845
+ p(Oe),
2846
+ p(xe, null, {
2847
+ default: y(() => [
2848
+ p(ye, { class: "text-xs text-muted-foreground font-normal" }, {
2849
+ default: y(() => [...v[20] || (v[20] = [
2850
+ C(" Cancellation ", -1)
2851
+ ])]),
2852
+ _: 1
2853
+ }),
2854
+ p(de, {
2855
+ onClick: N,
2856
+ class: "gap-2 cursor-pointer",
2857
+ variant: "destructive",
2858
+ disabled: B.value
2859
+ }, {
2860
+ default: y(() => [
2861
+ p($(bt), { size: 16 }),
2862
+ v[21] || (v[21] = g("span", null, "Cancel Reservation", -1))
2863
+ ]),
2864
+ _: 1
2865
+ }, 8, ["disabled"]),
2866
+ a.value?.reservationPrice && a.value.reservationPrice > 0 ? (D(), H(de, {
2867
+ key: 0,
2868
+ onClick: U,
2869
+ class: "gap-2 cursor-pointer text-orange-600 dark:text-orange-400 focus:text-orange-600 dark:focus:text-orange-400",
2870
+ disabled: B.value
2871
+ }, {
2872
+ default: y(() => [
2873
+ p($(Dt), {
2874
+ class: "text-inherit",
2875
+ size: 16
2876
+ }),
2877
+ v[22] || (v[22] = g("span", null, "Cancel & Send Coupon", -1))
2878
+ ]),
2879
+ _: 1
2880
+ }, 8, ["disabled"])) : E("", !0)
2881
+ ]),
2882
+ _: 1
2883
+ })
2884
+ ], 64)) : E("", !0)
2885
+ ]),
2886
+ _: 1
2887
+ })
2888
+ ]),
2889
+ _: 1
2890
+ })) : E("", !0)
2891
+ ]),
2892
+ _: 1
2893
+ })
2894
+ ]),
2895
+ _: 1
2896
+ })
2897
+ ]),
2898
+ _: 1
2899
+ }, 8, ["open"]),
2900
+ p(Ds, {
2901
+ ref_key: "cancelReservationDialog",
2902
+ ref: d,
2903
+ onConfirm: ae
2904
+ }, null, 512),
2905
+ p(Is, {
2906
+ ref_key: "approveReservationDialog",
2907
+ ref: f,
2908
+ onConfirm: X
2909
+ }, null, 512),
2910
+ p(Bs, {
2911
+ ref_key: "rejectReservationDialog",
2912
+ ref: _,
2913
+ onConfirm: Re
2914
+ }, null, 512),
2915
+ p(Cs, {
2916
+ ref_key: "transferReservationDialog",
2917
+ ref: w
2918
+ }, null, 512)
2919
+ ], 64);
2920
+ };
2921
+ }
2922
+ });
2923
+ export {
2924
+ se as F,
2925
+ We as _,
2926
+ Nn as a
2927
+ };