@quoreadmin/ui 1.7.5 → 1.7.6
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/index140.js +298 -296
- package/dist/index171.js +14 -14
- package/dist/index172.js +3 -3
- package/dist/index175.js +4 -4
- package/dist/index182.js +10 -10
- package/dist/index184.js +10 -10
- package/dist/index190.js +9 -9
- package/dist/index191.js +1 -1
- package/dist/index192.js +1 -1
- package/dist/index193.js +1 -1
- package/dist/index201.js +1 -1
- package/dist/index202.js +29 -84
- package/dist/index203.js +109 -400
- package/dist/index204.js +36 -22
- package/dist/index205.js +26 -33
- package/dist/index206.js +31 -111
- package/dist/index207.js +9 -36
- package/dist/index208.js +19 -26
- package/dist/index209.js +10 -36
- package/dist/index210.js +10 -9
- package/dist/index211.js +50 -18
- package/dist/index212.js +43 -10
- package/dist/index213.js +4 -10
- package/dist/index214.js +36 -48
- package/dist/index215.js +21 -43
- package/dist/index216.js +87 -3
- package/dist/index217.js +403 -35
- package/dist/index218.js +22 -21
- package/dist/index219.js +159 -159
- package/dist/index220.js +20 -228
- package/dist/index221.js +19 -36
- package/dist/index222.js +22 -10
- package/dist/index223.js +167 -129
- package/dist/index224.js +69 -19
- package/dist/index225.js +34 -20
- package/dist/index226.js +39 -21
- package/dist/index227.js +113 -185
- package/dist/index228.js +25 -57
- package/dist/index229.js +77 -31
- package/dist/index230.js +19 -39
- package/dist/index231.js +19 -126
- package/dist/index232.js +16 -34
- package/dist/index233.js +20 -80
- package/dist/index234.js +160 -19
- package/dist/index235.js +228 -20
- package/dist/index236.js +36 -19
- package/dist/index237.js +10 -20
- package/dist/index241.js +8 -8
- package/dist/index242.js +2 -2
- package/dist/index248.js +2 -2
- package/dist/index249.js +2 -2
- package/dist/index250.js +8 -8
- package/dist/index259.js +6 -6
- package/dist/index274.js +2 -2
- package/dist/index280.js +1 -1
- package/dist/index290.js +79 -1518
- package/dist/index291.js +22 -386
- package/dist/index292.js +902 -2698
- package/dist/index293.js +21 -85
- package/dist/index294.js +20 -3770
- package/dist/index295.js +19 -59
- package/dist/index296.js +67 -77
- package/dist/index297.js +18 -21
- package/dist/index298.js +18 -934
- package/dist/index299.js +16 -16
- package/dist/index300.js +13 -11
- package/dist/index301.js +62 -19
- package/dist/index302.js +1518 -69
- package/dist/index303.js +386 -19
- package/dist/index304.js +2731 -19
- package/dist/index305.js +85 -21
- package/dist/index306.js +3770 -22
- package/dist/index307.js +60 -63
- package/dist/index309.js +1 -1
- package/dist/index310.js +3 -3
- package/dist/index311.js +1 -1
- package/dist/index332.js +1 -1
- package/dist/index337.js +1 -1
- package/dist/index342.js +2 -2
- package/dist/index347.js +1 -1
- package/dist/index348.js +2 -2
- package/dist/index355.js +1 -1
- package/package.json +1 -1
package/dist/index140.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useI18n as
|
|
1
|
+
import { defineComponent as mt, ref as i, computed as y, watch as B, onMounted as vt, onUnmounted as pt } from "vue";
|
|
2
|
+
import { useI18n as ft } from "vue-i18n";
|
|
3
3
|
import { DateTime as _ } from "./index163.js";
|
|
4
4
|
import "./index186.js";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
const
|
|
5
|
+
import ht from "./index2.js";
|
|
6
|
+
import yt from "./index3.js";
|
|
7
|
+
import gt from "./index4.js";
|
|
8
|
+
import _t from "./index21.js";
|
|
9
|
+
import wt from "./index28.js";
|
|
10
|
+
import It from "./index39.js";
|
|
11
|
+
import Dt from "./index20.js";
|
|
12
|
+
import Tt from "./index46.js";
|
|
13
|
+
import Ot from "./index47.js";
|
|
14
|
+
import kt from "./index49.js";
|
|
15
|
+
import K from "./index187.js";
|
|
16
|
+
const Gt = mt({
|
|
17
17
|
name: "QRoomDetailsPopover",
|
|
18
18
|
components: {
|
|
19
|
-
QAccordion:
|
|
20
|
-
QActivityItem:
|
|
21
|
-
QAvatar:
|
|
22
|
-
QDatePicker:
|
|
23
|
-
QDivider:
|
|
24
|
-
QIcon:
|
|
25
|
-
QPopover:
|
|
26
|
-
QTag:
|
|
27
|
-
QTextarea:
|
|
28
|
-
QTooltip:
|
|
19
|
+
QAccordion: ht,
|
|
20
|
+
QActivityItem: yt,
|
|
21
|
+
QAvatar: gt,
|
|
22
|
+
QDatePicker: Dt,
|
|
23
|
+
QDivider: _t,
|
|
24
|
+
QIcon: wt,
|
|
25
|
+
QPopover: It,
|
|
26
|
+
QTag: Tt,
|
|
27
|
+
QTextarea: Ot,
|
|
28
|
+
QTooltip: kt
|
|
29
29
|
},
|
|
30
30
|
props: {
|
|
31
31
|
id: {
|
|
@@ -145,8 +145,8 @@ const Bt = dt({
|
|
|
145
145
|
}
|
|
146
146
|
},
|
|
147
147
|
emits: ["create:callback", "create:todo", "refresh:pms", "show:toast", "toggle"],
|
|
148
|
-
setup(
|
|
149
|
-
const { t: c } =
|
|
148
|
+
setup(s, { emit: h }) {
|
|
149
|
+
const { t: c } = ft(), r = i(null), ie = i(!1), ue = i("left"), X = i([
|
|
150
150
|
{
|
|
151
151
|
id: 1,
|
|
152
152
|
label: c("HC_DEPARTMENT")
|
|
@@ -162,7 +162,7 @@ const Bt = dt({
|
|
|
162
162
|
label: c("HC_ANYONE")
|
|
163
163
|
// need to localize
|
|
164
164
|
}
|
|
165
|
-
]), A = i(""),
|
|
165
|
+
]), A = i(""), p = i({
|
|
166
166
|
checkInDate: /* @__PURE__ */ new Date(),
|
|
167
167
|
checkOutDate: /* @__PURE__ */ new Date(),
|
|
168
168
|
guestEmail: "",
|
|
@@ -170,19 +170,19 @@ const Bt = dt({
|
|
|
170
170
|
guestMood: null,
|
|
171
171
|
guestName: "",
|
|
172
172
|
guestPhone: "",
|
|
173
|
-
inHouse: !!
|
|
173
|
+
inHouse: !!r.value?.tokenId || !1,
|
|
174
174
|
problem: null,
|
|
175
175
|
notes: "",
|
|
176
|
-
tokenId:
|
|
177
|
-
}),
|
|
176
|
+
tokenId: r.value?.tokenId
|
|
177
|
+
}), G = i(250), W = i(290), N = i([]), we = i([]), Z = i(!0), ee = i(!0), M = i({
|
|
178
178
|
info: !0,
|
|
179
179
|
tickets: !0,
|
|
180
180
|
comments: !0
|
|
181
|
-
}),
|
|
181
|
+
}), te = i(!0), be = i(s.guestDetails), T = i([]), b = i({
|
|
182
182
|
pms: !1,
|
|
183
183
|
roomNotices: !1,
|
|
184
184
|
tickets: !1
|
|
185
|
-
}), C = i([]), ce = i([]), de = i("bottom"),
|
|
185
|
+
}), C = i([]), ce = i([]), de = i("bottom"), R = i(null), H = i(!1), U = i(!1), j = i(""), me = i(!1), S = i(!1), O = i(null), $ = i(null), Ce = 3e4, u = i({
|
|
186
186
|
assignType: null,
|
|
187
187
|
department: null,
|
|
188
188
|
due: /* @__PURE__ */ new Date(),
|
|
@@ -192,7 +192,7 @@ const Bt = dt({
|
|
|
192
192
|
requestedBy: null,
|
|
193
193
|
when: null,
|
|
194
194
|
where: null
|
|
195
|
-
}),
|
|
195
|
+
}), Q = i([
|
|
196
196
|
{
|
|
197
197
|
id: 0,
|
|
198
198
|
label: c("HC_STAFF_MEMBER")
|
|
@@ -203,12 +203,12 @@ const Bt = dt({
|
|
|
203
203
|
label: c("HC_HOTEL_GUEST")
|
|
204
204
|
// need to localize
|
|
205
205
|
}
|
|
206
|
-
]),
|
|
206
|
+
]), Ne = i(!1), k = i(null), w = i({
|
|
207
207
|
endDate: /* @__PURE__ */ new Date(),
|
|
208
208
|
issue: null,
|
|
209
209
|
notes: "",
|
|
210
210
|
startDate: /* @__PURE__ */ new Date()
|
|
211
|
-
}), ae = i([]), oe = i(!1), E = i([]),
|
|
211
|
+
}), ae = i([]), oe = i(!1), E = i([]), L = i([]), Me = i([
|
|
212
212
|
{
|
|
213
213
|
label: c("HC_COMPLAINT"),
|
|
214
214
|
id: "complaint"
|
|
@@ -225,7 +225,7 @@ const Bt = dt({
|
|
|
225
225
|
label: c("HC_WORK_ORDER"),
|
|
226
226
|
id: "work_order"
|
|
227
227
|
}
|
|
228
|
-
]),
|
|
228
|
+
]), J = i(), P = i(null), v = i({
|
|
229
229
|
assignType: null,
|
|
230
230
|
department: null,
|
|
231
231
|
due: /* @__PURE__ */ new Date(),
|
|
@@ -234,8 +234,8 @@ const Bt = dt({
|
|
|
234
234
|
notes: "",
|
|
235
235
|
person: null,
|
|
236
236
|
requestedBy: null
|
|
237
|
-
}),
|
|
238
|
-
switch (
|
|
237
|
+
}), ve = i([]), q = i([]), x = i([]), pe = y(() => {
|
|
238
|
+
switch (r.value.cleaning?.name || r.value.cleaningStatus) {
|
|
239
239
|
case "CLEAN":
|
|
240
240
|
case "INSPECTED":
|
|
241
241
|
return "CLEAN";
|
|
@@ -247,13 +247,13 @@ const Bt = dt({
|
|
|
247
247
|
default:
|
|
248
248
|
return "";
|
|
249
249
|
}
|
|
250
|
-
}),
|
|
251
|
-
const e =
|
|
250
|
+
}), Re = y(() => pe.value === "CLEAN" ? "blue-10" : pe.value === "DIRTY" ? "red-10" : "gray-30"), He = y(() => {
|
|
251
|
+
const e = r.value.cleaning?.name || r.value.cleaningStatus;
|
|
252
252
|
return e ? c(`HC_${e}`) : "";
|
|
253
|
-
}), He = y(() => {
|
|
254
|
-
const e = A.value.toLowerCase();
|
|
255
|
-
return n.quickReplies.filter((a) => a.toLowerCase().match(e));
|
|
256
253
|
}), Le = y(() => {
|
|
254
|
+
const e = A.value.toLowerCase();
|
|
255
|
+
return s.quickReplies.filter((a) => a.toLowerCase().match(e));
|
|
256
|
+
}), Pe = y(() => {
|
|
257
257
|
if (!C.value.length) return [];
|
|
258
258
|
const e = [];
|
|
259
259
|
let a = null;
|
|
@@ -262,12 +262,12 @@ const Bt = dt({
|
|
|
262
262
|
t.dateUtc,
|
|
263
263
|
"yyyy-MM-dd HH:mm:ss",
|
|
264
264
|
{ zone: "utc" }
|
|
265
|
-
).setZone(
|
|
266
|
-
|
|
265
|
+
).setZone(s.propertyTimeZone), n = o.toFormat("yyyy-MM-dd-HH");
|
|
266
|
+
n !== a && (e.push({
|
|
267
267
|
type: "separator",
|
|
268
268
|
label: o.toFormat("ccc, LLL d 'at' h:mma").replace("AM", "am").replace("PM", "pm"),
|
|
269
|
-
hourKey:
|
|
270
|
-
}), a =
|
|
269
|
+
hourKey: n
|
|
270
|
+
}), a = n), e.push({
|
|
271
271
|
type: "message",
|
|
272
272
|
...t,
|
|
273
273
|
formattedTime: o.toFormat("h:mma").replace("AM", "am").replace("PM", "pm")
|
|
@@ -275,9 +275,9 @@ const Bt = dt({
|
|
|
275
275
|
}), e;
|
|
276
276
|
}), Ie = y(() => E.value.length ? !!E.value.find(
|
|
277
277
|
(a) => a.type === "complaint"
|
|
278
|
-
) : !1),
|
|
278
|
+
) : !1), qe = y(() => E.value.length ? !!E.value.find(
|
|
279
279
|
(a) => a.type === "callback"
|
|
280
|
-
) : !1),
|
|
280
|
+
) : !1), xe = y(() => {
|
|
281
281
|
let e = [];
|
|
282
282
|
return T.value[0] && T.value[0].options === void 0 ? T.value.forEach((a) => {
|
|
283
283
|
e.push({
|
|
@@ -285,15 +285,15 @@ const Bt = dt({
|
|
|
285
285
|
label: a.display_name
|
|
286
286
|
});
|
|
287
287
|
}) : e = T.value, e;
|
|
288
|
-
}), De = y(() =>
|
|
288
|
+
}), De = y(() => r.value.occupancy?.name === "OCCUPIED" || r.value.occupancyStatus === "OCCUPIED"), Fe = y(() => De.value && Ie.value ? "HK_ROOM_STATUS_Occupied_Complaint" : "HK_ROOM_STATUS_Occupied"), Be = y(() => {
|
|
289
289
|
switch (k.value?.id) {
|
|
290
290
|
case "request":
|
|
291
291
|
case "work_order":
|
|
292
|
-
return
|
|
292
|
+
return X.value[0];
|
|
293
293
|
default:
|
|
294
294
|
return null;
|
|
295
295
|
}
|
|
296
|
-
}),
|
|
296
|
+
}), Ge = y(() => {
|
|
297
297
|
if (N.value)
|
|
298
298
|
switch (k.value?.id) {
|
|
299
299
|
case "request":
|
|
@@ -304,30 +304,30 @@ const Bt = dt({
|
|
|
304
304
|
return null;
|
|
305
305
|
}
|
|
306
306
|
return null;
|
|
307
|
-
}),
|
|
307
|
+
}), We = y(() => {
|
|
308
308
|
switch (k.value?.id) {
|
|
309
309
|
case "request":
|
|
310
|
-
return
|
|
310
|
+
return Q.value[1];
|
|
311
311
|
case "work_order":
|
|
312
|
-
return
|
|
312
|
+
return Q.value[0];
|
|
313
313
|
default:
|
|
314
314
|
return null;
|
|
315
315
|
}
|
|
316
|
-
}),
|
|
316
|
+
}), Ue = y(() => {
|
|
317
317
|
let e = "";
|
|
318
|
-
if (
|
|
318
|
+
if (r.value && r.value.reservations[0]) {
|
|
319
319
|
const a = _.fromISO(
|
|
320
|
-
|
|
321
|
-
), t = a.toFormat("MMM"), o = a.day,
|
|
322
|
-
|
|
323
|
-
), d =
|
|
324
|
-
e += t + " " + o,
|
|
320
|
+
r.value.reservations[0].arrivalDate
|
|
321
|
+
), t = a.toFormat("MMM"), o = a.day, n = a.year, l = _.fromISO(
|
|
322
|
+
r.value.reservations[0].departureDate
|
|
323
|
+
), d = l.toFormat("MMM"), m = l.day, f = l.year;
|
|
324
|
+
e += t + " " + o, n !== f && (e += ", " + n), t === d ? e += "-" + m : e += " - " + d + " " + m, e += ", " + f;
|
|
325
325
|
}
|
|
326
326
|
return e;
|
|
327
|
-
}),
|
|
327
|
+
}), je = y(() => {
|
|
328
328
|
let e = ae.value;
|
|
329
329
|
return e = [...new Set(e)], e;
|
|
330
|
-
}),
|
|
330
|
+
}), $e = y(() => {
|
|
331
331
|
const e = k.value?.id;
|
|
332
332
|
if (!e)
|
|
333
333
|
return !1;
|
|
@@ -335,29 +335,29 @@ const Bt = dt({
|
|
|
335
335
|
case "room_notice":
|
|
336
336
|
return w.value.issue && w.value.startDate && w.value.endDate;
|
|
337
337
|
case "complaint":
|
|
338
|
-
return
|
|
338
|
+
return p.value.problem && p.value.guestName && p.value.guestMood;
|
|
339
339
|
case "work_order":
|
|
340
|
-
return
|
|
340
|
+
return v.value.item && v.value.issue && v.value.requestedBy && v.value.due && (v.value.assignType && v.value.assignType.id === 0 || v.value.assignType && v.value.assignType.id === 1 && v.value.department || v.value.assignType && v.value.assignType.id === 2 && v.value.person);
|
|
341
341
|
case "request": {
|
|
342
|
-
const a = u.value.item && u.value.requestedBy && u.value.due && (u.value.assignType && u.value.assignType.id === 0 || u.value.assignType && u.value.assignType.id === 1 && u.value.department || u.value.assignType && u.value.assignType.id === 2 && u.value.person), t =
|
|
342
|
+
const a = u.value.item && u.value.requestedBy && u.value.due && (u.value.assignType && u.value.assignType.id === 0 || u.value.assignType && u.value.assignType.id === 1 && u.value.department || u.value.assignType && u.value.assignType.id === 2 && u.value.person), t = s.allowWhenWhere ? u.value.when && u.value.where : !0;
|
|
343
343
|
return a && t;
|
|
344
344
|
}
|
|
345
345
|
default:
|
|
346
346
|
return !1;
|
|
347
347
|
}
|
|
348
348
|
}), Te = () => {
|
|
349
|
-
oe.value = !1,
|
|
350
|
-
},
|
|
351
|
-
h("create:callback",
|
|
352
|
-
},
|
|
349
|
+
oe.value = !1, H.value = !1, ie.value = !1, T.value = [], ce.value = [], ve.value = [], q.value = [], x.value = [], k.value = null, w.value.issue = null, w.value.startDate = /* @__PURE__ */ new Date(), w.value.endDate = /* @__PURE__ */ new Date(), w.value.notes = "", p.value.guestName = "", p.value.guestEmail = "", p.value.guestPhone = "", p.value.guestMood = null, p.value.guestLoyalty = "", p.value.problem = null, p.value.checkInDate = /* @__PURE__ */ new Date(), p.value.checkOutDate = /* @__PURE__ */ new Date(), p.value.notes = "", v.value.assignType = null, v.value.department = null, v.value.person = null, v.value.due = /* @__PURE__ */ new Date(), v.value.item = null, v.value.issue = null, v.value.notes = "", u.value.assignType = null, u.value.department = null, u.value.person = null, u.value.due = /* @__PURE__ */ new Date(), u.value.item = null, u.value.notes = "", u.value.when = null, u.value.where = null;
|
|
350
|
+
}, Qe = async () => {
|
|
351
|
+
h("create:callback", r.value), h("toggle", !1);
|
|
352
|
+
}, F = (e) => {
|
|
353
353
|
const a = [];
|
|
354
354
|
(Array.isArray(e) ? e : Object.values(e)).forEach((o) => {
|
|
355
|
-
const
|
|
355
|
+
const n = o.senderType || o.sender_type, l = o.senderName || "", d = o.senderId || o.sender_id, m = o.profileImg || o.profile_img, f = l ? l.split(" ") : ["", ""], g = o.user_first_name || o.guest_first_name || f[0] || "", z = o.user_last_name || o.guest_last_name || f.slice(1).join(" ") || "", re = g && z ? `${g} ${z}` : g || "Auto-Reply", le = n === "system" || n === "user", I = n === "guest";
|
|
356
356
|
let D = {
|
|
357
357
|
id: o.id,
|
|
358
|
-
isPropertyEmployee:
|
|
358
|
+
isPropertyEmployee: n === "user",
|
|
359
359
|
isSent: !!o.sent,
|
|
360
|
-
isSystemMessage:
|
|
360
|
+
isSystemMessage: n === "system",
|
|
361
361
|
isStaffMessage: le,
|
|
362
362
|
isGuestMessage: I,
|
|
363
363
|
comment: o.content,
|
|
@@ -367,19 +367,19 @@ const Bt = dt({
|
|
|
367
367
|
icon: "",
|
|
368
368
|
id: d || "system-message",
|
|
369
369
|
initials: "",
|
|
370
|
-
lastName:
|
|
370
|
+
lastName: z || "",
|
|
371
371
|
name: re,
|
|
372
372
|
src: m || ""
|
|
373
373
|
}
|
|
374
374
|
};
|
|
375
375
|
D.user.firstName && D.user.lastName ? D.user.initials = D.user.firstName[0] + D.user.lastName[0] : D.user.firstName && (D.user.initials = D.user.firstName[0]), le && (D.user.icon = "property-fill"), a.push(D);
|
|
376
376
|
}), C.value = a;
|
|
377
|
-
},
|
|
377
|
+
}, Je = (e) => {
|
|
378
378
|
if (!e || e.length === 0) return;
|
|
379
379
|
(Array.isArray(e) ? e : Object.values(e)).forEach((t) => {
|
|
380
380
|
if (C.value.some((D) => D.id === t.id))
|
|
381
381
|
return;
|
|
382
|
-
const o = t.senderType || t.sender_type,
|
|
382
|
+
const o = t.senderType || t.sender_type, n = t.senderName || "", l = t.senderId || t.sender_id, d = t.profileImg || t.profile_img, m = n ? n.split(" ") : ["", ""], f = t.user_first_name || t.guest_first_name || m[0] || "", g = t.user_last_name || t.guest_last_name || m.slice(1).join(" ") || "", z = f && g ? `${f} ${g}` : f || "Auto-Reply", re = o === "system" || o === "user", le = o === "guest";
|
|
383
383
|
let I = {
|
|
384
384
|
id: t.id,
|
|
385
385
|
isPropertyEmployee: o === "user",
|
|
@@ -392,19 +392,19 @@ const Bt = dt({
|
|
|
392
392
|
user: {
|
|
393
393
|
firstName: f || "Auto-Reply",
|
|
394
394
|
icon: "",
|
|
395
|
-
id:
|
|
395
|
+
id: l || "system-message",
|
|
396
396
|
initials: "",
|
|
397
397
|
lastName: g || "",
|
|
398
|
-
name:
|
|
398
|
+
name: z,
|
|
399
399
|
src: d || ""
|
|
400
400
|
}
|
|
401
401
|
};
|
|
402
402
|
I.user.firstName && I.user.lastName ? I.user.initials = I.user.firstName[0] + I.user.lastName[0] : I.user.firstName && (I.user.initials = I.user.firstName[0]), re && (I.user.icon = "property-fill"), C.value.push(I);
|
|
403
403
|
});
|
|
404
404
|
}, fe = async (e = !1) => {
|
|
405
|
-
if (
|
|
405
|
+
if (s.showComments && r.value.tokenId)
|
|
406
406
|
try {
|
|
407
|
-
let a = `/api/client/connect/getMessages.php?tokenId=${
|
|
407
|
+
let a = `/api/client/connect/getMessages.php?tokenId=${r.value.tokenId}`;
|
|
408
408
|
e && O.value !== null && (a += `&lastMsgId=${O.value}`);
|
|
409
409
|
const o = await (await fetch(a, {
|
|
410
410
|
method: "GET",
|
|
@@ -413,14 +413,14 @@ const Bt = dt({
|
|
|
413
413
|
if (o.status === "error")
|
|
414
414
|
throw new Error(o.message || "Failed to get messages");
|
|
415
415
|
if (S.value = !o.closed, o.messages && o.messages.length > 0) {
|
|
416
|
-
O.value = o.messages[o.messages.length - 1].id, e ?
|
|
417
|
-
const
|
|
418
|
-
|
|
419
|
-
} else e ||
|
|
416
|
+
O.value = o.messages[o.messages.length - 1].id, e ? Je(o.messages) : F(o.messages);
|
|
417
|
+
const n = setTimeout(V, 100);
|
|
418
|
+
L.value.push(n);
|
|
419
|
+
} else e || F(o.messages || []);
|
|
420
420
|
} catch (a) {
|
|
421
421
|
console.error("getChatMessages error:", a);
|
|
422
422
|
}
|
|
423
|
-
},
|
|
423
|
+
}, Ye = (e) => {
|
|
424
424
|
const a = _.utc(), t = _.fromFormat(e, "yyyy-MM-dd HH:mm:ss", { zone: "utc" }), o = a.diff(
|
|
425
425
|
t,
|
|
426
426
|
[
|
|
@@ -430,11 +430,11 @@ const Bt = dt({
|
|
|
430
430
|
"hours",
|
|
431
431
|
"minutes"
|
|
432
432
|
]
|
|
433
|
-
),
|
|
434
|
-
if (
|
|
435
|
-
return
|
|
436
|
-
if (
|
|
437
|
-
return
|
|
433
|
+
), n = Math.floor(o.years), l = Math.floor(o.months), d = Math.floor(o.days), m = Math.floor(o.hours), f = Math.floor(o.minutes);
|
|
434
|
+
if (n)
|
|
435
|
+
return n === 1 ? c("HC_ONE_YEAR_AGO") : c("HC_X_YEARS_AGO", { years: n });
|
|
436
|
+
if (l)
|
|
437
|
+
return l === 1 ? c("HC_ONE_MONTH_AGO") : c("HC_X_MONTHS_AGO", { months: l });
|
|
438
438
|
if (d)
|
|
439
439
|
return d === 1 ? c("HC_ONE_DAY_AGO") : c("HC_X_DAYS_AGO", { days: d });
|
|
440
440
|
if (m)
|
|
@@ -443,14 +443,14 @@ const Bt = dt({
|
|
|
443
443
|
return f === 1 ? c("HC_ONE_MINUTE_AGO") : c("HC_X_MINUTES_AGO", { minutes: f });
|
|
444
444
|
if (f === 0)
|
|
445
445
|
return c("HC_A_MOMENT_AGO");
|
|
446
|
-
},
|
|
447
|
-
|
|
446
|
+
}, Ve = async () => {
|
|
447
|
+
s.showGuestDetails && se(), ne(), Y(), h("refresh:pms", r.value);
|
|
448
448
|
}, se = async () => {
|
|
449
449
|
try {
|
|
450
450
|
b.value.pms = !0;
|
|
451
451
|
const e = new AbortController(), a = setTimeout(() => e.abort(), 45e3);
|
|
452
|
-
|
|
453
|
-
const t =
|
|
452
|
+
L.value.push(a);
|
|
453
|
+
const t = s.pmsBaseUrl;
|
|
454
454
|
if (!t)
|
|
455
455
|
throw new Error("PMS base URL is required");
|
|
456
456
|
const o = {
|
|
@@ -459,21 +459,21 @@ const Bt = dt({
|
|
|
459
459
|
return g.length === 2 && g.pop()?.split(";").shift() || "";
|
|
460
460
|
})(),
|
|
461
461
|
"Content-Type": "application/json"
|
|
462
|
-
},
|
|
463
|
-
`${t}/vendors/properties/statuses/${
|
|
462
|
+
}, n = r.value?.qv2Rooms?.qRoomId || r.value?.id || s.room.id, l = await fetch(
|
|
463
|
+
`${t}/vendors/properties/statuses/${s.propertyId}/rooms`,
|
|
464
464
|
{
|
|
465
465
|
method: "POST",
|
|
466
466
|
headers: o,
|
|
467
467
|
signal: e.signal,
|
|
468
|
-
body: JSON.stringify({ roomsIds: [
|
|
468
|
+
body: JSON.stringify({ roomsIds: [n] })
|
|
469
469
|
}
|
|
470
470
|
);
|
|
471
|
-
clearTimeout(a),
|
|
472
|
-
const d = await
|
|
473
|
-
|
|
471
|
+
clearTimeout(a), l.ok || ke(l);
|
|
472
|
+
const d = await l.json(), m = d.data?.pmsRooms || d.data?.rooms || d.rooms || [];
|
|
473
|
+
R.value = m, m.length > 0 ? r.value = {
|
|
474
474
|
...m[0],
|
|
475
|
-
tokenId: m[0].tokenId ||
|
|
476
|
-
} :
|
|
475
|
+
tokenId: m[0].tokenId || s.room.tokenId
|
|
476
|
+
} : r.value = s.room, b.value.pms = !1;
|
|
477
477
|
} catch (e) {
|
|
478
478
|
return b.value.pms = !1, h("show:toast", {
|
|
479
479
|
show: !0,
|
|
@@ -486,7 +486,7 @@ const Bt = dt({
|
|
|
486
486
|
try {
|
|
487
487
|
b.value.roomNotices = !0;
|
|
488
488
|
const e = await fetch(
|
|
489
|
-
"/api/client/common/getRoomNotices.php?propertyId=" +
|
|
489
|
+
"/api/client/common/getRoomNotices.php?propertyId=" + s.propertyId + "&roomIds=[" + s.room.id + "]"
|
|
490
490
|
);
|
|
491
491
|
if (!e.ok)
|
|
492
492
|
throw new Error(`HTTP error! status: ${e.status}`);
|
|
@@ -505,7 +505,7 @@ const Bt = dt({
|
|
|
505
505
|
}, he = async () => {
|
|
506
506
|
try {
|
|
507
507
|
const e = new FormData();
|
|
508
|
-
e.append("property_id",
|
|
508
|
+
e.append("property_id", s.propertyId), e.append("filter", "tasks_new");
|
|
509
509
|
const [a, t] = await Promise.all([
|
|
510
510
|
fetch("/api/client/common/getDepartments.php", {
|
|
511
511
|
method: "POST"
|
|
@@ -514,18 +514,18 @@ const Bt = dt({
|
|
|
514
514
|
method: "POST",
|
|
515
515
|
body: e
|
|
516
516
|
})
|
|
517
|
-
]), o = await a.json(),
|
|
518
|
-
if (o.departments && (o.departments.forEach((
|
|
519
|
-
|
|
520
|
-
}), N.value = o.departments),
|
|
521
|
-
const
|
|
517
|
+
]), o = await a.json(), n = await t.json();
|
|
518
|
+
if (o.departments && (o.departments.forEach((l) => {
|
|
519
|
+
l.label = l.display_name;
|
|
520
|
+
}), N.value = o.departments), n.users) {
|
|
521
|
+
const l = [];
|
|
522
522
|
let d = {
|
|
523
523
|
group: "",
|
|
524
524
|
options: []
|
|
525
525
|
};
|
|
526
|
-
|
|
527
|
-
m.translated_department !== d.group && (d.group &&
|
|
528
|
-
}), d.group &&
|
|
526
|
+
n.users.forEach((m) => {
|
|
527
|
+
m.translated_department !== d.group && (d.group && l.push({ ...d }), d.group = m.translated_department, d.options = []), d.options.push(m);
|
|
528
|
+
}), d.group && l.push({ ...d }), we.value = l;
|
|
529
529
|
}
|
|
530
530
|
} catch (e) {
|
|
531
531
|
console.error("Error getting shared data:", e), h("show:toast", {
|
|
@@ -538,7 +538,7 @@ const Bt = dt({
|
|
|
538
538
|
}, Oe = async () => {
|
|
539
539
|
try {
|
|
540
540
|
const a = await (await fetch(
|
|
541
|
-
`/api/client/connect/getStayDetails.php?tokenId=${
|
|
541
|
+
`/api/client/connect/getStayDetails.php?tokenId=${r.value.tokenId}`,
|
|
542
542
|
{
|
|
543
543
|
method: "GET",
|
|
544
544
|
credentials: "include"
|
|
@@ -546,9 +546,9 @@ const Bt = dt({
|
|
|
546
546
|
)).json();
|
|
547
547
|
if (a.status === "error")
|
|
548
548
|
throw new Error(a.message || "Failed to get stay details");
|
|
549
|
-
a.userName && (
|
|
549
|
+
a.userName && (p.value.guestName = a.userName), a.cellPhone && (p.value.guestPhone = a.cellPhone), a.email && (p.value.guestEmail = a.email), a.checkIn && (p.value.checkInDate = _.fromISO(
|
|
550
550
|
a.checkIn
|
|
551
|
-
).toJSDate()), a.checkOut && (
|
|
551
|
+
).toJSDate()), a.checkOut && (p.value.checkOutDate = _.fromISO(
|
|
552
552
|
a.checkOut
|
|
553
553
|
).toJSDate());
|
|
554
554
|
} catch (e) {
|
|
@@ -559,7 +559,7 @@ const Bt = dt({
|
|
|
559
559
|
icon: "exclamation-circle"
|
|
560
560
|
});
|
|
561
561
|
}
|
|
562
|
-
},
|
|
562
|
+
}, ze = (e) => {
|
|
563
563
|
switch (e) {
|
|
564
564
|
case "complaint":
|
|
565
565
|
return "red-30";
|
|
@@ -572,7 +572,7 @@ const Bt = dt({
|
|
|
572
572
|
case "task":
|
|
573
573
|
return "green-20";
|
|
574
574
|
}
|
|
575
|
-
},
|
|
575
|
+
}, Ke = (e) => {
|
|
576
576
|
switch (e) {
|
|
577
577
|
case "complaint":
|
|
578
578
|
return "face-frown";
|
|
@@ -585,11 +585,11 @@ const Bt = dt({
|
|
|
585
585
|
case "task":
|
|
586
586
|
return "check";
|
|
587
587
|
}
|
|
588
|
-
},
|
|
588
|
+
}, Y = async () => {
|
|
589
589
|
try {
|
|
590
590
|
b.value.tickets = !0;
|
|
591
591
|
const e = await fetch(
|
|
592
|
-
"/api/client/common/getAllToDos.php?propertyId=" +
|
|
592
|
+
"/api/client/common/getAllToDos.php?propertyId=" + s.propertyId + "&roomIds=[" + s.room.id + "]"
|
|
593
593
|
);
|
|
594
594
|
if (!e.ok)
|
|
595
595
|
throw new Error(`HTTP error! status: ${e.status}`);
|
|
@@ -614,34 +614,34 @@ const Bt = dt({
|
|
|
614
614
|
t = { code: e.status, message: a };
|
|
615
615
|
}
|
|
616
616
|
return t.code === 401 ? (window.location.href = "/logout.php?unauthorized=1", { error: t }) : t;
|
|
617
|
-
},
|
|
617
|
+
}, Xe = (e) => {
|
|
618
618
|
const a = document.querySelectorAll(".pulse");
|
|
619
619
|
if (a && a.length) {
|
|
620
|
-
const t =
|
|
620
|
+
const t = r.value?.qv2Rooms?.qRoomId || r.value?.id || s.room?.id, o = document.getElementById("room-" + t), n = o?.classList;
|
|
621
621
|
switch (e) {
|
|
622
622
|
case "room_notice":
|
|
623
|
-
(
|
|
623
|
+
(n?.contains("roombox_unsel") || n?.contains("roombox_unsel_active")) && (o?.classList.remove(), o?.classList.add("roomnoticeroombox_sel"));
|
|
624
624
|
break;
|
|
625
625
|
case "complaint":
|
|
626
|
-
!
|
|
626
|
+
!n?.contains("smsroombox_sel") && !n?.contains("callbackroombox_sel") && (o?.classList.remove(), o?.classList.add("complaintsroombox_sel"));
|
|
627
627
|
break;
|
|
628
628
|
case "request":
|
|
629
|
-
!
|
|
629
|
+
!n?.contains("smsroombox_sel") && !n?.contains("callbackroombox_sel") && !n?.contains("complaintsroombox_sel") && (o?.classList.remove(), o?.classList.add("guestrequestroombox_sel"));
|
|
630
630
|
break;
|
|
631
631
|
case "work_order":
|
|
632
|
-
!
|
|
632
|
+
!n?.contains("smsroombox_sel") && !n?.contains("callbackroombox_sel") && !n?.contains("complaintsroombox_sel") && !n?.contains("guestrequestroombox_sel") && (o?.classList.remove(), o?.classList.add("workordersroombox_sel"));
|
|
633
633
|
break;
|
|
634
634
|
}
|
|
635
|
-
const
|
|
635
|
+
const l = setTimeout(() => {
|
|
636
636
|
a.forEach((d) => {
|
|
637
637
|
d.classList.remove("pulse");
|
|
638
638
|
});
|
|
639
639
|
}, 4500);
|
|
640
|
-
|
|
640
|
+
L.value.push(l);
|
|
641
641
|
}
|
|
642
|
-
},
|
|
642
|
+
}, Ze = () => {
|
|
643
643
|
window.open("/guest/overview.php", "_blank");
|
|
644
|
-
},
|
|
644
|
+
}, et = (e) => {
|
|
645
645
|
let a = "";
|
|
646
646
|
switch (e.type) {
|
|
647
647
|
case "complaint":
|
|
@@ -663,55 +663,55 @@ const Bt = dt({
|
|
|
663
663
|
return "#";
|
|
664
664
|
}
|
|
665
665
|
window.open(a, "_blank");
|
|
666
|
-
},
|
|
667
|
-
const e =
|
|
666
|
+
}, tt = async () => {
|
|
667
|
+
const e = r.value?.qv2Rooms?.qRoomId || r.value?.id || s.room?.id, a = r.value?.qv2Rooms?.qRoomName || r.value?.name || s.room?.name, t = {
|
|
668
668
|
type: k.value?.id,
|
|
669
|
-
propertyId:
|
|
670
|
-
userId:
|
|
669
|
+
propertyId: s.propertyId,
|
|
670
|
+
userId: P.value,
|
|
671
671
|
areaId: e,
|
|
672
672
|
areaName: a
|
|
673
673
|
};
|
|
674
674
|
switch (k.value?.id) {
|
|
675
675
|
case "complaint":
|
|
676
|
-
t.tokenId =
|
|
676
|
+
t.tokenId = r.value.tokenId, t.problemId = p.value.problem.id, t.guestName = p.value.guestName, t.guestPhone = p.value.guestPhone, t.guestEmail = p.value.guestEmail, t.guestLoyalty = p.value.guestLoyalty, t.guestMood = p.value.guestMood.id, t.checkInDate = _.fromJSDate(p.value.checkInDate).toFormat(
|
|
677
677
|
"yyyy-MM-dd"
|
|
678
|
-
), t.checkOutDate = _.fromJSDate(
|
|
678
|
+
), t.checkOutDate = _.fromJSDate(p.value.checkOutDate).toFormat(
|
|
679
679
|
"yyyy-MM-dd"
|
|
680
|
-
), t.notes =
|
|
680
|
+
), t.notes = p.value.notes, t.inHouse = 2, t.source = "dashboard", h("create:todo", t);
|
|
681
681
|
break;
|
|
682
682
|
case "request":
|
|
683
|
-
t.itemId = u.value.item.id, t.assignType = u.value.assignType.id, t.occupied = u.value.requestedBy.id, t.notes = u.value.notes, t.dueDate = _.fromJSDate(u.value.due).toFormat("yyyy-MM-dd"), u.value.assignType.id === 1 && (t.department = u.value.department.id), u.value.assignType.id === 2 && (t.person = u.value.person.id),
|
|
683
|
+
t.itemId = u.value.item.id, t.assignType = u.value.assignType.id, t.occupied = u.value.requestedBy.id, t.notes = u.value.notes, t.dueDate = _.fromJSDate(u.value.due).toFormat("yyyy-MM-dd"), u.value.assignType.id === 1 && (t.department = u.value.department.id), u.value.assignType.id === 2 && (t.person = u.value.person.id), s.allowWhenWhere && (t.requestWhen = u.value.when ? u.value.when.id : "", t.requestWhere = u.value.where ? u.value.where.id : ""), h("create:todo", t);
|
|
684
684
|
break;
|
|
685
685
|
case "room_notice":
|
|
686
686
|
t.issueId = w.value.issue.id, t.startDate = _.fromJSDate(w.value.startDate).toFormat("yyyy-MM-dd"), t.endDate = _.fromJSDate(w.value.endDate).toFormat("yyyy-MM-dd"), t.notes = w.value.notes, t.sendPush = "1", h("create:todo", t);
|
|
687
687
|
break;
|
|
688
688
|
case "work_order":
|
|
689
|
-
t.itemId =
|
|
689
|
+
t.itemId = v.value.item.id, t.issueId = v.value.issue.id, t.assignType = v.value.assignType.id, t.occupied = v.value.requestedBy.id, t.notes = v.value.notes, t.dueDate = _.fromJSDate(v.value.due).toFormat("yyyy-MM-dd"), v.value.assignType.id === 1 && (t.department = v.value.department.id), v.value.assignType.id === 2 && (t.person = v.value.person.id), h("create:todo", t);
|
|
690
690
|
break;
|
|
691
691
|
}
|
|
692
|
-
}, tt = (e) => {
|
|
693
|
-
ge(), _e(), n.hover && h("toggle", e);
|
|
694
692
|
}, at = (e) => {
|
|
693
|
+
ge(), _e(), s.hover && h("toggle", e);
|
|
694
|
+
}, ot = (e) => {
|
|
695
695
|
Se(), A.value = e;
|
|
696
|
-
},
|
|
697
|
-
if (console.log("selected:", e), k.value = e, T.value = [], w.value.issue = null,
|
|
696
|
+
}, st = async (e) => {
|
|
697
|
+
if (console.log("selected:", e), k.value = e, T.value = [], w.value.issue = null, p.value.problem = null, v.value.item = null, v.value.issue = null, u.value.item = null, !k.value)
|
|
698
698
|
return;
|
|
699
|
-
const a =
|
|
700
|
-
switch (t.append("property_id",
|
|
699
|
+
const a = r.value?.qv2Rooms?.qRoomId || r.value?.id || s.room?.id, t = new FormData();
|
|
700
|
+
switch (t.append("property_id", s.propertyId), t.append("area_id", a), e.id) {
|
|
701
701
|
case "complaint":
|
|
702
702
|
try {
|
|
703
|
-
|
|
704
|
-
const
|
|
703
|
+
r.value.tokenId && await Oe();
|
|
704
|
+
const n = await (await fetch("/api/client/common/getComplaintProblemsByPropertyId.php", {
|
|
705
705
|
method: "POST",
|
|
706
706
|
body: t
|
|
707
707
|
})).json();
|
|
708
|
-
|
|
709
|
-
const
|
|
708
|
+
n.items && (T.value = n.items);
|
|
709
|
+
const l = await K.post(
|
|
710
710
|
"/api/client/common/getComplaintMoods.php"
|
|
711
711
|
);
|
|
712
|
-
|
|
712
|
+
l.data.items.forEach((d) => {
|
|
713
713
|
d.label = d.display_name;
|
|
714
|
-
}), ce.value =
|
|
714
|
+
}), ce.value = l.data.items;
|
|
715
715
|
} catch (o) {
|
|
716
716
|
console.error("Error loading complaint options:", o), h("show:toast", {
|
|
717
717
|
show: !0,
|
|
@@ -723,11 +723,11 @@ const Bt = dt({
|
|
|
723
723
|
break;
|
|
724
724
|
case "room_notice":
|
|
725
725
|
try {
|
|
726
|
-
const
|
|
726
|
+
const n = await (await fetch("/api/client/common/getRoomNoticeIssuesByPropertyId.php", {
|
|
727
727
|
method: "POST",
|
|
728
728
|
body: t
|
|
729
729
|
})).json();
|
|
730
|
-
|
|
730
|
+
n.items && (T.value = n.items);
|
|
731
731
|
} catch (o) {
|
|
732
732
|
console.error("Error loading room notice options:", o), h("show:toast", {
|
|
733
733
|
show: !0,
|
|
@@ -739,35 +739,35 @@ const Bt = dt({
|
|
|
739
739
|
break;
|
|
740
740
|
case "request":
|
|
741
741
|
try {
|
|
742
|
-
u.value.requestedBy =
|
|
743
|
-
const
|
|
742
|
+
u.value.requestedBy = Q.value[1], u.value.assignType = X.value[0];
|
|
743
|
+
const n = await (await fetch("/api/client/common/getHousekeepingItemsByPropertyId.php", {
|
|
744
744
|
method: "POST",
|
|
745
745
|
body: t
|
|
746
746
|
})).json();
|
|
747
|
-
if (
|
|
748
|
-
(
|
|
749
|
-
),
|
|
747
|
+
if (n.items && (T.value = n.items), await he(), u.value.department = N.value.find(
|
|
748
|
+
(l) => parseInt(l.id) === 4
|
|
749
|
+
), s.allowWhenWhere)
|
|
750
750
|
try {
|
|
751
|
-
const
|
|
752
|
-
|
|
751
|
+
const l = new FormData();
|
|
752
|
+
l.append("property_id", s.propertyId);
|
|
753
753
|
const m = await (await fetch(
|
|
754
754
|
"/api/client/common/getWhenWhereOptions.php",
|
|
755
755
|
{
|
|
756
756
|
method: "POST",
|
|
757
|
-
body:
|
|
757
|
+
body: l
|
|
758
758
|
}
|
|
759
759
|
)).json();
|
|
760
|
-
m.when && Array.isArray(m.when) ?
|
|
760
|
+
m.when && Array.isArray(m.when) ? q.value = m.when.map((f) => ({
|
|
761
761
|
id: f.id,
|
|
762
762
|
label: f.name,
|
|
763
763
|
value: f.id
|
|
764
|
-
})) :
|
|
764
|
+
})) : q.value = [], m.where && Array.isArray(m.where) ? x.value = m.where.map((f) => ({
|
|
765
765
|
id: f.id,
|
|
766
766
|
label: f.name,
|
|
767
767
|
value: f.id
|
|
768
|
-
})) :
|
|
769
|
-
} catch (
|
|
770
|
-
console.error("Error loading When/Where options:",
|
|
768
|
+
})) : x.value = [];
|
|
769
|
+
} catch (l) {
|
|
770
|
+
console.error("Error loading When/Where options:", l), q.value = [], x.value = [], h("show:toast", {
|
|
771
771
|
show: !0,
|
|
772
772
|
message: c("HC_FAILED_TO_LOAD_WHEN_WHERE_OPTIONS"),
|
|
773
773
|
variant: "error",
|
|
@@ -785,19 +785,19 @@ const Bt = dt({
|
|
|
785
785
|
break;
|
|
786
786
|
case "work_order":
|
|
787
787
|
try {
|
|
788
|
-
|
|
789
|
-
const
|
|
788
|
+
v.value.requestedBy = Q.value[0], v.value.assignType = X.value[0];
|
|
789
|
+
const n = await (await fetch("/api/client/common/getItemsByRoomId.php", {
|
|
790
790
|
method: "POST",
|
|
791
791
|
body: t
|
|
792
|
-
})).json(),
|
|
792
|
+
})).json(), l = [];
|
|
793
793
|
let d = {
|
|
794
794
|
group: "",
|
|
795
795
|
options: []
|
|
796
796
|
};
|
|
797
|
-
|
|
798
|
-
m.section_name !== d.group && (d.group &&
|
|
799
|
-
}), d.group &&
|
|
800
|
-
|
|
797
|
+
n.items && (n.items.forEach((m) => {
|
|
798
|
+
m.section_name !== d.group && (d.group && l.push({ ...d }), d.group = m.section_name, d.options = []), m.label && d.options.push(m);
|
|
799
|
+
}), d.group && l.push({ ...d })), T.value = l, await Promise.all([
|
|
800
|
+
K.post(
|
|
801
801
|
"/api/client/common/getWorkOrderIssues.php"
|
|
802
802
|
),
|
|
803
803
|
he()
|
|
@@ -805,8 +805,8 @@ const Bt = dt({
|
|
|
805
805
|
const f = m[0];
|
|
806
806
|
f.data.issues.forEach((g) => {
|
|
807
807
|
g.label = g.display_name;
|
|
808
|
-
}),
|
|
809
|
-
}),
|
|
808
|
+
}), ve.value = f.data.issues;
|
|
809
|
+
}), v.value.department = N.value.find(
|
|
810
810
|
(m) => parseInt(m.id) === 2
|
|
811
811
|
);
|
|
812
812
|
} catch (o) {
|
|
@@ -821,23 +821,23 @@ const Bt = dt({
|
|
|
821
821
|
default:
|
|
822
822
|
return;
|
|
823
823
|
}
|
|
824
|
-
},
|
|
824
|
+
}, nt = () => {
|
|
825
825
|
oe.value = !oe.value, ie.value = !1;
|
|
826
826
|
}, Ee = () => {
|
|
827
827
|
const e = document.getElementById("comment-field"), a = document.getElementById("hidden-text");
|
|
828
828
|
e.style.height = a?.offsetHeight + "px";
|
|
829
|
-
},
|
|
829
|
+
}, V = () => {
|
|
830
830
|
const e = document.getElementById("comments-container");
|
|
831
831
|
e?.scroll({
|
|
832
832
|
top: e.scrollHeight,
|
|
833
833
|
behavior: "smooth"
|
|
834
834
|
});
|
|
835
|
-
},
|
|
836
|
-
if (e && e.type === "keydown" && e.preventDefault(),
|
|
835
|
+
}, rt = async (e) => {
|
|
836
|
+
if (e && e.type === "keydown" && e.preventDefault(), r.value.tokenId && A.value && !H.value)
|
|
837
837
|
try {
|
|
838
838
|
const a = new FormData();
|
|
839
|
-
a.append("tokenId",
|
|
840
|
-
const t = await
|
|
839
|
+
a.append("tokenId", r.value.tokenId), a.append("content", A.value), a.append("senderId", P.value || "");
|
|
840
|
+
const t = await K.post(
|
|
841
841
|
"/api/client/connect/sendMessage.php",
|
|
842
842
|
a
|
|
843
843
|
);
|
|
@@ -850,7 +850,7 @@ const Bt = dt({
|
|
|
850
850
|
});
|
|
851
851
|
return;
|
|
852
852
|
}
|
|
853
|
-
A.value = "", S.value = !t.data.closed, t.data.messages && (
|
|
853
|
+
A.value = "", S.value = !t.data.closed, t.data.messages && (F(t.data.messages), t.data.messages.length > 0 && (O.value = t.data.messages[t.data.messages.length - 1].id)), V();
|
|
854
854
|
} catch (a) {
|
|
855
855
|
console.error("sendChatMessage error:", a), h("show:toast", {
|
|
856
856
|
show: !0,
|
|
@@ -859,12 +859,12 @@ const Bt = dt({
|
|
|
859
859
|
icon: "exclamation-circle"
|
|
860
860
|
});
|
|
861
861
|
}
|
|
862
|
-
},
|
|
863
|
-
if (!(!
|
|
862
|
+
}, lt = async () => {
|
|
863
|
+
if (!(!r.value.tokenId || !P.value))
|
|
864
864
|
try {
|
|
865
865
|
const e = S.value ? "/api/client/connect/closeConversation.php" : "/api/client/connect/openConversation.php", a = new FormData();
|
|
866
|
-
a.append("tokenId",
|
|
867
|
-
const t = await
|
|
866
|
+
a.append("tokenId", r.value.tokenId), a.append("userId", P.value), S.value && O.value !== null && a.append("lastMsgId", O.value.toString());
|
|
867
|
+
const t = await K.post(e, a);
|
|
868
868
|
if (t.data.status === "error") {
|
|
869
869
|
h("show:toast", {
|
|
870
870
|
show: !0,
|
|
@@ -874,7 +874,7 @@ const Bt = dt({
|
|
|
874
874
|
});
|
|
875
875
|
return;
|
|
876
876
|
}
|
|
877
|
-
S.value = !t.data.closed, t.data.messages && (
|
|
877
|
+
S.value = !t.data.closed, t.data.messages && (F(t.data.messages), t.data.messages.length > 0 && (O.value = t.data.messages[t.data.messages.length - 1].id)), h("show:toast", {
|
|
878
878
|
show: !0,
|
|
879
879
|
message: S.value ? c("HC_CONVERSATION_REOPENED") : c("HC_CONVERSATION_CLOSED"),
|
|
880
880
|
variant: "success",
|
|
@@ -888,13 +888,13 @@ const Bt = dt({
|
|
|
888
888
|
icon: "exclamation-circle"
|
|
889
889
|
});
|
|
890
890
|
}
|
|
891
|
-
},
|
|
892
|
-
if (
|
|
891
|
+
}, it = async () => {
|
|
892
|
+
if (s.isTestEnvironment && !(!r.value?.tokenId || !j.value.trim())) {
|
|
893
893
|
me.value = !0;
|
|
894
894
|
try {
|
|
895
895
|
const e = new FormData();
|
|
896
|
-
e.append("tokenId",
|
|
897
|
-
const a = await
|
|
896
|
+
e.append("tokenId", r.value.tokenId), e.append("content", j.value.trim());
|
|
897
|
+
const a = await K.post(
|
|
898
898
|
"/api/client/connect/simulateInbound.php",
|
|
899
899
|
e
|
|
900
900
|
);
|
|
@@ -907,7 +907,7 @@ const Bt = dt({
|
|
|
907
907
|
});
|
|
908
908
|
return;
|
|
909
909
|
}
|
|
910
|
-
a.data.messages && (
|
|
910
|
+
a.data.messages && (F(a.data.messages), S.value = !a.data.closed, a.data.messages.length > 0 && (O.value = a.data.messages[a.data.messages.length - 1].id)), j.value = "", U.value = !1, V(), h("show:toast", {
|
|
911
911
|
show: !0,
|
|
912
912
|
message: c("HC_SIMULATED_GUEST_REPLY"),
|
|
913
913
|
variant: "success",
|
|
@@ -924,77 +924,79 @@ const Bt = dt({
|
|
|
924
924
|
me.value = !1;
|
|
925
925
|
}
|
|
926
926
|
}
|
|
927
|
-
}, it = () => {
|
|
928
|
-
W.value = !W.value, W.value || (U.value = "");
|
|
929
927
|
}, ut = () => {
|
|
930
|
-
|
|
928
|
+
U.value = !U.value, U.value || (j.value = "");
|
|
929
|
+
}, ct = () => {
|
|
930
|
+
$.value || ($.value = setInterval(() => {
|
|
931
931
|
document.visibilityState === "visible" && fe(!0);
|
|
932
|
-
},
|
|
932
|
+
}, Ce));
|
|
933
933
|
}, ye = () => {
|
|
934
|
-
|
|
934
|
+
$.value && (clearInterval($.value), $.value = null);
|
|
935
935
|
}, ge = () => {
|
|
936
|
-
if (
|
|
937
|
-
const e =
|
|
938
|
-
ue.value = a - e <
|
|
936
|
+
if (s.align === "left" || s.align === "right") {
|
|
937
|
+
const e = J.value?.getBoundingClientRect().left, a = window.innerWidth;
|
|
938
|
+
ue.value = a - e < W.value ? "right" : "left";
|
|
939
939
|
} else {
|
|
940
|
-
const e =
|
|
941
|
-
ue.value = a - e <
|
|
940
|
+
const e = J.value?.getBoundingClientRect().top, a = window.innerHeight;
|
|
941
|
+
ue.value = a - e < G.value ? "bottom" : "top";
|
|
942
942
|
}
|
|
943
943
|
}, _e = () => {
|
|
944
|
-
if (
|
|
945
|
-
const e =
|
|
946
|
-
de.value = a - e <
|
|
944
|
+
if (s.position === "top" || s.position === "bottom") {
|
|
945
|
+
const e = J.value?.getBoundingClientRect().top, a = window.innerHeight;
|
|
946
|
+
de.value = a - e < G.value ? "top" : "bottom";
|
|
947
947
|
} else {
|
|
948
|
-
const e =
|
|
949
|
-
de.value = a - e <
|
|
948
|
+
const e = J.value?.getBoundingClientRect().left, a = window.innerWidth;
|
|
949
|
+
de.value = a - e < W.value ? "left" : "right";
|
|
950
950
|
}
|
|
951
951
|
}, Se = () => {
|
|
952
|
-
|
|
953
|
-
},
|
|
954
|
-
const t =
|
|
955
|
-
if (o.append("property_id",
|
|
956
|
-
const
|
|
957
|
-
E.value.forEach((
|
|
958
|
-
|
|
959
|
-
...
|
|
952
|
+
H.value = !H.value, H.value ? (A.value = "", M.value.info = ee.value, M.value.tickets = te.value, M.value.comments = Z.value, ee.value = !1, te.value = !1, document.getElementById("comment-field")?.focus()) : (ee.value = M.value.info, te.value = M.value.tickets, Z.value = M.value.comments);
|
|
953
|
+
}, dt = async (e, a) => {
|
|
954
|
+
const t = r.value?.qv2Rooms?.qRoomId || r.value?.id || s.room?.id, o = new FormData();
|
|
955
|
+
if (o.append("property_id", s.propertyId), o.append("room_ids", JSON.stringify([t])), await Y(), E.value) {
|
|
956
|
+
const n = [];
|
|
957
|
+
E.value.forEach((l) => {
|
|
958
|
+
l.id === e && l.type === a ? n.unshift({
|
|
959
|
+
...l,
|
|
960
960
|
isNew: !0
|
|
961
|
-
}) :
|
|
962
|
-
...
|
|
961
|
+
}) : n.push({
|
|
962
|
+
...l,
|
|
963
963
|
isNew: !1
|
|
964
964
|
});
|
|
965
|
-
}),
|
|
965
|
+
}), n.sort((l, d) => l.id === e ? -1 : d.id === e ? 1 : 0), E.value = [...n];
|
|
966
966
|
}
|
|
967
967
|
};
|
|
968
|
-
|
|
969
|
-
if (
|
|
970
|
-
const e = setTimeout(
|
|
971
|
-
|
|
968
|
+
B(() => s.open, () => {
|
|
969
|
+
if (s.open && s.showComments && C.value.length) {
|
|
970
|
+
const e = setTimeout(V, 500);
|
|
971
|
+
L.value.push(e);
|
|
972
972
|
}
|
|
973
|
-
|
|
974
|
-
}),
|
|
975
|
-
() => [
|
|
973
|
+
s.open || (Te(), ye(), O.value = null, C.value = [], S.value = !1);
|
|
974
|
+
}), B(
|
|
975
|
+
() => [s.open, s.showComments, Z.value, r.value?.tokenId],
|
|
976
976
|
([e, a, t, o]) => {
|
|
977
|
-
e && a && t && o ?
|
|
977
|
+
e && a && t && o ? ct() : ye();
|
|
978
978
|
}
|
|
979
|
-
),
|
|
979
|
+
), B(A, () => {
|
|
980
980
|
const e = setTimeout(Ee, 100);
|
|
981
|
-
|
|
982
|
-
}),
|
|
983
|
-
a === !0 && e === !1 && (u.value.when = null, u.value.where = null,
|
|
984
|
-
})
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
()
|
|
981
|
+
L.value.push(e);
|
|
982
|
+
}), B(() => s.allowWhenWhere, (e, a) => {
|
|
983
|
+
a === !0 && e === !1 && (u.value.when = null, u.value.where = null, q.value = [], x.value = []);
|
|
984
|
+
});
|
|
985
|
+
const Ae = () => !!(s.room.reservations || s.room.cleaning || s.room.occupancy);
|
|
986
|
+
return B(() => s.open, async (e, a) => {
|
|
987
|
+
e && !a && (Ae() ? (r.value = s.room, R.value = [s.room]) : s.showGuestDetails && !R.value ? await se() : r.value || (r.value = s.room), Y(), ne(), s.showComments && fe());
|
|
988
|
+
}), B(
|
|
989
|
+
() => s.room.id,
|
|
988
990
|
(e, a) => {
|
|
989
|
-
e !== a && (
|
|
991
|
+
e !== a && (r.value = s.room, R.value = null, s.open && (Ae() ? R.value = [s.room] : s.showGuestDetails && se(), Y(), ne()));
|
|
990
992
|
}
|
|
991
|
-
),
|
|
993
|
+
), vt(async () => {
|
|
992
994
|
const e = JSON.parse(
|
|
993
995
|
window.localStorage.getItem("authenticated")
|
|
994
996
|
);
|
|
995
|
-
|
|
997
|
+
P.value = e?.user?.id || window.userId || "", r.value = s.room, s.size === "sm" && (G.value = 140, W.value = 160), s.size === "lg" && (G.value = 250, W.value = 440), ge(), _e();
|
|
996
998
|
}), pt(() => {
|
|
997
|
-
|
|
999
|
+
L.value.forEach((e) => {
|
|
998
1000
|
clearTimeout(e);
|
|
999
1001
|
}), ye();
|
|
1000
1002
|
}), {
|
|
@@ -1002,102 +1004,102 @@ const Bt = dt({
|
|
|
1002
1004
|
// Refs
|
|
1003
1005
|
actionMenuOpen: ie,
|
|
1004
1006
|
alignment: ue,
|
|
1005
|
-
assignTypes:
|
|
1007
|
+
assignTypes: X,
|
|
1006
1008
|
comment: A,
|
|
1007
|
-
complaint:
|
|
1008
|
-
componentHeight:
|
|
1009
|
-
componentWidth:
|
|
1009
|
+
complaint: p,
|
|
1010
|
+
componentHeight: G,
|
|
1011
|
+
componentWidth: W,
|
|
1010
1012
|
departments: N,
|
|
1011
1013
|
departmentUsers: we,
|
|
1012
|
-
expandComments:
|
|
1013
|
-
expandGuestInfo:
|
|
1014
|
+
expandComments: Z,
|
|
1015
|
+
expandGuestInfo: ee,
|
|
1014
1016
|
expandedStates: M,
|
|
1015
|
-
expandTickets:
|
|
1016
|
-
guestDetailsData:
|
|
1017
|
+
expandTickets: te,
|
|
1018
|
+
guestDetailsData: be,
|
|
1017
1019
|
itemOptions: T,
|
|
1018
1020
|
loading: b,
|
|
1019
1021
|
messages: C,
|
|
1020
1022
|
moodOptions: ce,
|
|
1021
|
-
pmsData:
|
|
1023
|
+
pmsData: R,
|
|
1022
1024
|
positioning: de,
|
|
1023
|
-
quickReplyOpen:
|
|
1025
|
+
quickReplyOpen: H,
|
|
1024
1026
|
request: u,
|
|
1025
|
-
requestedByOptions:
|
|
1026
|
-
requestLoading:
|
|
1027
|
+
requestedByOptions: Q,
|
|
1028
|
+
requestLoading: Ne,
|
|
1027
1029
|
requestType: k,
|
|
1028
|
-
roomDetailsData:
|
|
1030
|
+
roomDetailsData: r,
|
|
1029
1031
|
roomNotice: w,
|
|
1030
1032
|
roomNotices: ae,
|
|
1031
1033
|
showCreateRequest: oe,
|
|
1032
1034
|
ticketsList: E,
|
|
1033
|
-
todoOptions:
|
|
1034
|
-
trigger:
|
|
1035
|
-
userId:
|
|
1036
|
-
workOrder:
|
|
1037
|
-
workOrderIssues:
|
|
1038
|
-
whenOptions:
|
|
1039
|
-
whereOptions:
|
|
1035
|
+
todoOptions: Me,
|
|
1036
|
+
trigger: J,
|
|
1037
|
+
userId: P,
|
|
1038
|
+
workOrder: v,
|
|
1039
|
+
workOrderIssues: ve,
|
|
1040
|
+
whenOptions: q,
|
|
1041
|
+
whereOptions: x,
|
|
1040
1042
|
// Guest Connect state
|
|
1041
1043
|
isConversationOpen: S,
|
|
1042
1044
|
lastMessageId: O,
|
|
1043
1045
|
// Simulate Guest Reply state (test environments only)
|
|
1044
|
-
simulateOpen:
|
|
1045
|
-
simulateContent:
|
|
1046
|
+
simulateOpen: U,
|
|
1047
|
+
simulateContent: j,
|
|
1046
1048
|
simulateLoading: me,
|
|
1047
1049
|
// Computed
|
|
1048
|
-
cleanliness:
|
|
1049
|
-
cleanlinessColor:
|
|
1050
|
-
cleanlinessTooltipContent:
|
|
1051
|
-
filteredReplies:
|
|
1052
|
-
groupedMessages:
|
|
1053
|
-
hasGuestCallback:
|
|
1050
|
+
cleanliness: pe,
|
|
1051
|
+
cleanlinessColor: Re,
|
|
1052
|
+
cleanlinessTooltipContent: He,
|
|
1053
|
+
filteredReplies: Le,
|
|
1054
|
+
groupedMessages: Pe,
|
|
1055
|
+
hasGuestCallback: qe,
|
|
1054
1056
|
hasComplaint: Ie,
|
|
1055
|
-
itemOptionsList:
|
|
1057
|
+
itemOptionsList: xe,
|
|
1056
1058
|
occupied: De,
|
|
1057
|
-
occupancyTooltipContent:
|
|
1058
|
-
selectedAssignType:
|
|
1059
|
-
selectedDepartment:
|
|
1060
|
-
selectedRequestedBy:
|
|
1061
|
-
stayDetails:
|
|
1062
|
-
tagsList:
|
|
1063
|
-
validateToDo:
|
|
1059
|
+
occupancyTooltipContent: Fe,
|
|
1060
|
+
selectedAssignType: Be,
|
|
1061
|
+
selectedDepartment: Ge,
|
|
1062
|
+
selectedRequestedBy: We,
|
|
1063
|
+
stayDetails: Ue,
|
|
1064
|
+
tagsList: je,
|
|
1065
|
+
validateToDo: $e,
|
|
1064
1066
|
// Methods
|
|
1065
1067
|
closeRequest: Te,
|
|
1066
|
-
createCallback:
|
|
1067
|
-
createMessageList:
|
|
1068
|
+
createCallback: Qe,
|
|
1069
|
+
createMessageList: F,
|
|
1068
1070
|
getChatMessages: fe,
|
|
1069
|
-
getHowLongAgo:
|
|
1071
|
+
getHowLongAgo: Ye,
|
|
1070
1072
|
getPMSData: se,
|
|
1071
1073
|
getRoomNotices: ne,
|
|
1072
1074
|
getSharedData: he,
|
|
1073
1075
|
getStayDetails: Oe,
|
|
1074
|
-
getTicketColor:
|
|
1075
|
-
getTicketIcon:
|
|
1076
|
-
getTickets:
|
|
1076
|
+
getTicketColor: ze,
|
|
1077
|
+
getTicketIcon: Ke,
|
|
1078
|
+
getTickets: Y,
|
|
1077
1079
|
handleFailedResponse: ke,
|
|
1078
|
-
handlePulse:
|
|
1079
|
-
onClickEditConnectGuest:
|
|
1080
|
-
onClickTicket:
|
|
1081
|
-
onCreateRequestSubmit:
|
|
1082
|
-
onHoverToggle:
|
|
1083
|
-
onSelectQuickReply:
|
|
1084
|
-
onSelectToDo:
|
|
1085
|
-
openRequest:
|
|
1086
|
-
refreshPMSData:
|
|
1080
|
+
handlePulse: Xe,
|
|
1081
|
+
onClickEditConnectGuest: Ze,
|
|
1082
|
+
onClickTicket: et,
|
|
1083
|
+
onCreateRequestSubmit: tt,
|
|
1084
|
+
onHoverToggle: at,
|
|
1085
|
+
onSelectQuickReply: ot,
|
|
1086
|
+
onSelectToDo: st,
|
|
1087
|
+
openRequest: nt,
|
|
1088
|
+
refreshPMSData: Ve,
|
|
1087
1089
|
resizeTextarea: Ee,
|
|
1088
|
-
scrollToConnectBottom:
|
|
1089
|
-
sendChatMessage:
|
|
1090
|
+
scrollToConnectBottom: V,
|
|
1091
|
+
sendChatMessage: rt,
|
|
1090
1092
|
setAlignment: ge,
|
|
1091
1093
|
setPositioning: _e,
|
|
1092
|
-
toggleMarkOpenClose:
|
|
1094
|
+
toggleMarkOpenClose: lt,
|
|
1093
1095
|
toggleQuickReply: Se,
|
|
1094
|
-
updateTickets:
|
|
1096
|
+
updateTickets: dt,
|
|
1095
1097
|
// Simulate Guest Reply methods (test environments only)
|
|
1096
|
-
simulateGuestReply:
|
|
1097
|
-
toggleSimulateOpen:
|
|
1098
|
+
simulateGuestReply: it,
|
|
1099
|
+
toggleSimulateOpen: ut
|
|
1098
1100
|
};
|
|
1099
1101
|
}
|
|
1100
1102
|
});
|
|
1101
1103
|
export {
|
|
1102
|
-
|
|
1104
|
+
Gt as default
|
|
1103
1105
|
};
|