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