@quoreadmin/ui 1.7.17 → 1.7.19
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 +248 -253
- package/dist/index173.js +3 -3
- package/dist/index176.js +4 -4
- package/dist/index183.js +10 -10
- package/dist/index185.js +10 -10
- package/dist/index190.js +17 -17
- package/dist/index191.js +28 -28
- package/dist/index192.js +2 -2
- package/dist/index193.js +2 -2
- package/dist/index194.js +1 -1
- package/dist/index196.js +2 -2
- package/dist/index198.js +14 -14
- package/dist/index199.js +1 -1
- package/dist/index200.js +1 -1
- package/dist/index201.js +3 -3
- package/dist/index202.js +6 -6
- package/dist/index206.js +2 -2
- package/dist/index207.js +1 -1
- package/dist/index208.js +1 -1
- package/dist/index209.js +1 -1
- package/dist/index210.js +1 -1
- package/dist/index211.js +4 -4
- package/dist/index213.js +4 -4
- package/dist/index216.js +1 -1
- package/dist/index217.js +106 -67
- package/dist/index218.js +26 -395
- package/dist/index219.js +406 -21
- package/dist/index220.js +80 -161
- package/dist/index221.js +20 -228
- package/dist/index222.js +82 -31
- package/dist/index223.js +20 -10
- package/dist/index224.js +19 -126
- package/dist/index225.js +16 -34
- package/dist/index226.js +20 -80
- package/dist/index227.js +22 -20
- package/dist/index228.js +160 -19
- package/dist/index229.js +11 -11
- package/dist/index230.js +15 -13
- package/dist/index231.js +198 -19
- package/dist/index232.js +49 -140
- package/dist/index233.js +34 -20
- package/dist/index234.js +39 -21
- package/dist/index235.js +156 -194
- package/dist/index236.js +224 -66
- package/dist/index237.js +37 -34
- package/dist/index238.js +9 -39
- package/dist/index239.js +3632 -22
- package/dist/index240.js +55 -22
- package/dist/index241.js +77 -20
- package/dist/index242.js +39 -823
- package/dist/index243.js +198 -685
- package/dist/index244.js +9 -175
- package/dist/index245.js +57 -22
- package/dist/index246.js +61 -20
- package/dist/index247.js +54 -20
- package/dist/index248.js +75 -3
- package/dist/index249.js +707 -171
- package/dist/index250.js +34 -128
- package/dist/index251.js +55 -1214
- package/dist/index252.js +11 -20
- package/dist/index253.js +705 -22
- package/dist/index254.js +820 -22
- package/dist/index255.js +15 -22
- package/dist/index256.js +15 -13
- package/dist/index257.js +12 -12
- package/dist/index258.js +836 -2
- package/dist/index259.js +702 -2
- package/dist/index260.js +170 -3626
- package/dist/index261.js +22 -55
- package/dist/index262.js +20 -77
- package/dist/index263.js +20 -52
- package/dist/index264.js +3 -215
- package/dist/index265.js +187 -10
- package/dist/index266.js +128 -52
- package/dist/index267.js +1214 -52
- package/dist/index268.js +20 -54
- package/dist/index269.js +22 -75
- package/dist/index270.js +21 -722
- package/dist/index271.js +29 -39
- package/dist/index272.js +20 -64
- package/dist/index273.js +20 -11
- package/dist/index274.js +2 -705
- package/dist/index275.js +2 -820
- package/dist/index280.js +2 -3
- package/dist/index281.js +77 -25
- package/dist/index282.js +54 -2
- package/dist/index283.js +25 -78
- package/dist/index284.js +21 -53
- package/dist/index285.js +13 -17
- package/dist/index286.js +16 -22
- package/dist/index287.js +17 -22
- package/dist/index288.js +22 -15
- package/dist/index289.js +261 -16
- package/dist/index290.js +6 -23
- package/dist/index291.js +133 -228
- package/dist/index292.js +71 -4
- package/dist/index293.js +77 -124
- package/dist/index294.js +26 -65
- package/dist/index295.js +13 -84
- package/dist/index296.js +72 -26
- package/dist/index297.js +3 -8
- package/dist/index298.js +2 -75
- package/dist/index299.js +82 -3
- package/dist/index300.js +53 -2
- package/dist/index301.js +5 -82
- package/dist/index302.js +4 -53
- package/dist/index303.js +178 -5
- package/dist/index304.js +62 -4
- package/dist/index305.js +74 -178
- package/dist/index306.js +1509 -54
- package/dist/index307.js +385 -74
- package/dist/index308.js +2488 -1275
- package/dist/index309.js +70 -370
- package/dist/index310.js +3442 -2403
- package/dist/index311.js +51 -77
- package/dist/index312.js +13 -3768
- package/dist/index313.js +79 -55
- package/dist/index314.js +196 -73
- package/dist/index315.js +246 -22
- package/dist/index316.js +3 -935
- package/dist/index317.js +26 -21
- package/dist/index318.js +78 -19
- package/dist/index319.js +15 -13
- package/dist/index320.js +930 -64
- package/dist/index321.js +21 -18
- package/dist/index322.js +20 -19
- package/dist/index323.js +11 -13
- package/dist/index324.js +68 -21
- package/dist/index325.js +16 -60
- package/dist/index326.js +19 -15
- package/dist/index327.js +21 -83
- package/dist/index328.js +22 -202
- package/dist/index329.js +63 -246
- package/dist/index330.js +36 -8
- package/dist/index331.js +18 -12
- package/dist/index332.js +55 -53
- package/dist/index333.js +27 -10
- package/dist/index334.js +6 -13
- package/dist/index335.js +48 -54
- package/dist/index336.js +7 -52
- package/dist/index337.js +11 -30
- package/dist/index338.js +7 -2
- package/dist/index339.js +27 -4
- package/dist/index340.js +2 -2
- package/dist/index341.js +69 -22
- package/dist/index342.js +164 -38
- package/dist/index343.js +9 -2
- package/dist/index344.js +13 -11
- package/dist/index345.js +51 -16
- package/dist/index346.js +11 -16
- package/dist/index347.js +14 -10
- package/dist/index348.js +58 -10
- package/dist/index349.js +52 -2
- package/dist/index350.js +31 -9
- package/dist/index351.js +2 -10
- package/dist/index352.js +4 -13
- package/dist/index353.js +2 -37
- package/dist/index354.js +23 -21
- package/dist/index355.js +40 -55
- package/dist/index356.js +2 -29
- package/dist/index357.js +11 -7
- package/dist/index358.js +17 -49
- package/dist/index359.js +16 -5
- package/dist/index360.js +10 -12
- package/dist/index361.js +9 -6
- package/dist/index362.js +2 -28
- package/dist/index363.js +9 -2
- package/dist/index364.js +10 -70
- package/dist/index365.js +12 -165
- package/dist/index366.js +1 -1
- package/dist/index367.js +1 -1
- package/dist/index368.js +2 -2
- package/dist/index370.js +1 -1
- package/dist/index371.js +3 -3
- package/dist/index372.js +1 -1
- package/dist/index376.js +1 -1
- package/dist/index378.js +1 -1
- package/dist/index379.js +6 -6
- package/dist/index380.js +4 -4
- package/dist/index382.js +97 -16
- package/dist/index385.js +16 -97
- package/dist/index391.js +1 -1
- package/dist/index392.js +2 -2
- package/dist/index43.js +172 -166
- package/dist/src/components/room-details-popover/room-details-popover.d.ts +1 -7
- 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 ct, ref as i, computed as _, watch as B, onMounted as dt, onUnmounted as mt } from "vue";
|
|
2
|
+
import { useI18n as vt } from "vue-i18n";
|
|
3
3
|
import { DateTime as w } from "./index164.js";
|
|
4
4
|
import "./index189.js";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
5
|
+
import pt from "./index2.js";
|
|
6
|
+
import ft from "./index3.js";
|
|
7
|
+
import ht from "./index4.js";
|
|
8
|
+
import yt from "./index21.js";
|
|
9
|
+
import gt from "./index28.js";
|
|
10
|
+
import _t from "./index39.js";
|
|
11
|
+
import wt from "./index20.js";
|
|
12
|
+
import It from "./index46.js";
|
|
13
|
+
import Dt from "./index47.js";
|
|
14
|
+
import Tt from "./index49.js";
|
|
15
15
|
import K from "./index190.js";
|
|
16
|
-
const
|
|
16
|
+
const Ft = ct({
|
|
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: pt,
|
|
20
|
+
QActivityItem: ft,
|
|
21
|
+
QAvatar: ht,
|
|
22
|
+
QDatePicker: wt,
|
|
23
|
+
QDivider: yt,
|
|
24
|
+
QIcon: gt,
|
|
25
|
+
QPopover: _t,
|
|
26
|
+
QTag: It,
|
|
27
|
+
QTextarea: Dt,
|
|
28
|
+
QTooltip: Tt
|
|
29
29
|
},
|
|
30
30
|
props: {
|
|
31
31
|
id: {
|
|
@@ -161,18 +161,18 @@ const Gt = mt({
|
|
|
161
161
|
},
|
|
162
162
|
emits: ["create:callback", "create:todo", "refresh:pms", "show:toast", "toggle"],
|
|
163
163
|
setup(o, { emit: h }) {
|
|
164
|
-
const { t:
|
|
164
|
+
const { t: c } = vt(), l = i(null), ie = i(!1), ue = i("left"), X = i([
|
|
165
165
|
{
|
|
166
166
|
id: 1,
|
|
167
|
-
label:
|
|
167
|
+
label: c("HC_DEPARTMENT")
|
|
168
168
|
},
|
|
169
169
|
{
|
|
170
170
|
id: 2,
|
|
171
|
-
label:
|
|
171
|
+
label: c("HC_PERSON")
|
|
172
172
|
},
|
|
173
173
|
{
|
|
174
174
|
id: 0,
|
|
175
|
-
label:
|
|
175
|
+
label: c("HC_ANYONE")
|
|
176
176
|
}
|
|
177
177
|
]), b = i(""), p = i({
|
|
178
178
|
checkInDate: /* @__PURE__ */ new Date(),
|
|
@@ -182,15 +182,15 @@ const Gt = mt({
|
|
|
182
182
|
guestMood: null,
|
|
183
183
|
guestName: "",
|
|
184
184
|
guestPhone: "",
|
|
185
|
-
inHouse: !!
|
|
185
|
+
inHouse: !!l.value?.tokenId || !1,
|
|
186
186
|
problem: null,
|
|
187
187
|
notes: "",
|
|
188
|
-
tokenId:
|
|
189
|
-
}), G = i(250), U = i(290), M = i([]),
|
|
188
|
+
tokenId: l.value?.tokenId
|
|
189
|
+
}), G = i(250), U = i(290), M = i([]), we = i([]), Z = i(!0), ee = i(!0), N = i({
|
|
190
190
|
info: !0,
|
|
191
191
|
tickets: !0,
|
|
192
192
|
comments: !0
|
|
193
|
-
}), te = i(!0),
|
|
193
|
+
}), te = i(!0), be = i(o.guestDetails), O = i([]), y = i({
|
|
194
194
|
actionItems: !1,
|
|
195
195
|
conversationToggle: !1,
|
|
196
196
|
messages: !1,
|
|
@@ -198,7 +198,7 @@ const Gt = mt({
|
|
|
198
198
|
roomNotices: !1,
|
|
199
199
|
sendingMessage: !1,
|
|
200
200
|
tickets: !1
|
|
201
|
-
}), C = i([]), ce = i([]), de = i("bottom"), R = i(null), H = i(!1), W = i(!1), j = i(""), me = i(!1), A = i(!1), k = i(null),
|
|
201
|
+
}), C = i([]), ce = i([]), de = i("bottom"), R = i(null), H = i(!1), W = i(!1), j = i(""), me = i(!1), A = i(!1), k = i(null), Q = i(null), Ce = 3e4, d = i({
|
|
202
202
|
assignType: null,
|
|
203
203
|
department: null,
|
|
204
204
|
due: /* @__PURE__ */ new Date(),
|
|
@@ -208,35 +208,35 @@ const Gt = mt({
|
|
|
208
208
|
requestedBy: null,
|
|
209
209
|
when: null,
|
|
210
210
|
where: null
|
|
211
|
-
}),
|
|
211
|
+
}), $ = i([
|
|
212
212
|
{
|
|
213
213
|
id: 0,
|
|
214
|
-
label:
|
|
214
|
+
label: c("HC_STAFF_MEMBER")
|
|
215
215
|
},
|
|
216
216
|
{
|
|
217
217
|
id: 1,
|
|
218
|
-
label:
|
|
218
|
+
label: c("HC_HOTEL_GUEST")
|
|
219
219
|
}
|
|
220
220
|
]), ve = i(!1), E = i(null), I = i({
|
|
221
221
|
endDate: /* @__PURE__ */ new Date(),
|
|
222
222
|
issue: null,
|
|
223
223
|
notes: "",
|
|
224
224
|
startDate: /* @__PURE__ */ new Date()
|
|
225
|
-
}), ae = i([]), se = i(!1), S = i([]), L = i([]),
|
|
225
|
+
}), ae = i([]), se = i(!1), S = i([]), L = i([]), Me = i([
|
|
226
226
|
{
|
|
227
|
-
label:
|
|
227
|
+
label: c("HC_COMPLAINT"),
|
|
228
228
|
id: "complaint"
|
|
229
229
|
},
|
|
230
230
|
{
|
|
231
|
-
label:
|
|
231
|
+
label: c("HC_REQUEST"),
|
|
232
232
|
id: "request"
|
|
233
233
|
},
|
|
234
234
|
{
|
|
235
|
-
label:
|
|
235
|
+
label: c("HC_ROOM_NOTICE"),
|
|
236
236
|
id: "room_notice"
|
|
237
237
|
},
|
|
238
238
|
{
|
|
239
|
-
label:
|
|
239
|
+
label: c("HC_WORK_ORDER"),
|
|
240
240
|
id: "work_order"
|
|
241
241
|
}
|
|
242
242
|
]), J = i(), P = i(null), v = i({
|
|
@@ -248,8 +248,8 @@ const Gt = mt({
|
|
|
248
248
|
notes: "",
|
|
249
249
|
person: null,
|
|
250
250
|
requestedBy: null
|
|
251
|
-
}), pe = i([]), q = i([]), x = i([]),
|
|
252
|
-
switch (
|
|
251
|
+
}), pe = i([]), q = i([]), x = i([]), Ne = _(() => {
|
|
252
|
+
switch (l.value.cleaning?.name || l.value.cleaningStatus) {
|
|
253
253
|
case "CLEAN":
|
|
254
254
|
case "INSPECTED":
|
|
255
255
|
return "CLEAN";
|
|
@@ -261,13 +261,10 @@ const Gt = mt({
|
|
|
261
261
|
default:
|
|
262
262
|
return "";
|
|
263
263
|
}
|
|
264
|
-
}), Re =
|
|
265
|
-
const e = r.value.cleaning?.name || r.value.cleaningStatus;
|
|
266
|
-
return e ? u(`HC_${e}`) : "";
|
|
267
|
-
}), Le = g(() => {
|
|
264
|
+
}), Re = _(() => {
|
|
268
265
|
const e = b.value.toLowerCase();
|
|
269
266
|
return o.quickReplies.filter((t) => t.toLowerCase().match(e));
|
|
270
|
-
}),
|
|
267
|
+
}), He = _(() => {
|
|
271
268
|
if (!C.value.length) return [];
|
|
272
269
|
const e = [];
|
|
273
270
|
let t = null;
|
|
@@ -287,11 +284,11 @@ const Gt = mt({
|
|
|
287
284
|
formattedTime: s.toFormat("h:mma").replace("AM", "am").replace("PM", "pm")
|
|
288
285
|
});
|
|
289
286
|
}), e;
|
|
290
|
-
}),
|
|
287
|
+
}), Ie = _(() => S.value.length ? !!S.value.find(
|
|
291
288
|
(t) => t.type === "complaint"
|
|
292
|
-
) : !1),
|
|
289
|
+
) : !1), Le = _(() => S.value.length ? !!S.value.find(
|
|
293
290
|
(t) => t.type === "callback"
|
|
294
|
-
) : !1),
|
|
291
|
+
) : !1), Pe = _(() => {
|
|
295
292
|
let e = [];
|
|
296
293
|
return O.value[0] && O.value[0].options === void 0 ? O.value.forEach((t) => {
|
|
297
294
|
e.push({
|
|
@@ -299,7 +296,7 @@ const Gt = mt({
|
|
|
299
296
|
label: t.display_name
|
|
300
297
|
});
|
|
301
298
|
}) : e = O.value, e;
|
|
302
|
-
}),
|
|
299
|
+
}), De = _(() => l.value.occupancy?.name === "OCCUPIED" || l.value.occupancyStatus === "OCCUPIED"), qe = _(() => De.value && Ie.value ? "HK_ROOM_STATUS_Occupied_Complaint" : "HK_ROOM_STATUS_Occupied"), xe = _(() => {
|
|
303
300
|
switch (E.value?.id) {
|
|
304
301
|
case "request":
|
|
305
302
|
case "work_order":
|
|
@@ -307,7 +304,7 @@ const Gt = mt({
|
|
|
307
304
|
default:
|
|
308
305
|
return null;
|
|
309
306
|
}
|
|
310
|
-
}),
|
|
307
|
+
}), Fe = _(() => {
|
|
311
308
|
if (M.value)
|
|
312
309
|
switch (E.value?.id) {
|
|
313
310
|
case "request":
|
|
@@ -318,30 +315,30 @@ const Gt = mt({
|
|
|
318
315
|
return null;
|
|
319
316
|
}
|
|
320
317
|
return null;
|
|
321
|
-
}),
|
|
318
|
+
}), Be = _(() => {
|
|
322
319
|
switch (E.value?.id) {
|
|
323
320
|
case "request":
|
|
324
|
-
return
|
|
321
|
+
return $.value[1];
|
|
325
322
|
case "work_order":
|
|
326
|
-
return
|
|
323
|
+
return $.value[0];
|
|
327
324
|
default:
|
|
328
325
|
return null;
|
|
329
326
|
}
|
|
330
|
-
}),
|
|
327
|
+
}), Ge = _(() => {
|
|
331
328
|
let e = "";
|
|
332
|
-
if (
|
|
329
|
+
if (l.value && l.value.reservations[0]) {
|
|
333
330
|
const t = w.fromISO(
|
|
334
|
-
|
|
335
|
-
), a = t.toFormat("MMM"), s = t.day, n = t.year,
|
|
336
|
-
|
|
337
|
-
),
|
|
338
|
-
e += a + " " + s, n !== f && (e += ", " + n), a ===
|
|
331
|
+
l.value.reservations[0].arrivalDate
|
|
332
|
+
), a = t.toFormat("MMM"), s = t.day, n = t.year, r = w.fromISO(
|
|
333
|
+
l.value.reservations[0].departureDate
|
|
334
|
+
), u = r.toFormat("MMM"), m = r.day, f = r.year;
|
|
335
|
+
e += a + " " + s, n !== f && (e += ", " + n), a === u ? e += "-" + m : e += " - " + u + " " + m, e += ", " + f;
|
|
339
336
|
}
|
|
340
337
|
return e;
|
|
341
|
-
}),
|
|
338
|
+
}), Ue = _(() => {
|
|
342
339
|
let e = ae.value;
|
|
343
340
|
return e = [...new Set(e)], e;
|
|
344
|
-
}),
|
|
341
|
+
}), We = _(() => {
|
|
345
342
|
const e = E.value?.id;
|
|
346
343
|
if (!e)
|
|
347
344
|
return !1;
|
|
@@ -357,14 +354,14 @@ const Gt = mt({
|
|
|
357
354
|
default:
|
|
358
355
|
return !1;
|
|
359
356
|
}
|
|
360
|
-
}),
|
|
357
|
+
}), Te = () => {
|
|
361
358
|
se.value = !1, H.value = !1, ie.value = !1, ve.value = !1, O.value = [], ce.value = [], pe.value = [], q.value = [], x.value = [], E.value = null, I.value.issue = null, I.value.startDate = /* @__PURE__ */ new Date(), I.value.endDate = /* @__PURE__ */ new Date(), I.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 = "", d.value.assignType = null, d.value.department = null, d.value.person = null, d.value.due = /* @__PURE__ */ new Date(), d.value.item = null, d.value.notes = "", d.value.when = null, d.value.where = null;
|
|
362
|
-
},
|
|
363
|
-
h("create:callback",
|
|
359
|
+
}, je = async () => {
|
|
360
|
+
h("create:callback", l.value), h("toggle", !1);
|
|
364
361
|
}, F = (e) => {
|
|
365
362
|
const t = [];
|
|
366
363
|
(Array.isArray(e) ? e : Object.values(e)).forEach((s) => {
|
|
367
|
-
const n = s.senderType || s.sender_type,
|
|
364
|
+
const n = s.senderType || s.sender_type, r = s.senderName || "", u = s.senderId || s.sender_id, m = s.profileImg || s.profile_img, f = r ? r.split(" ") : ["", ""], g = s.user_first_name || s.guest_first_name || f[0] || "", z = s.user_last_name || s.guest_last_name || f.slice(1).join(" ") || "", re = g && z ? `${g} ${z}` : g || "Auto-Reply", le = n === "system" || n === "user", D = n === "guest";
|
|
368
365
|
let T = {
|
|
369
366
|
id: s.id,
|
|
370
367
|
isPropertyEmployee: n === "user",
|
|
@@ -375,9 +372,9 @@ const Gt = mt({
|
|
|
375
372
|
comment: s.content,
|
|
376
373
|
dateUtc: s.sent || s.created,
|
|
377
374
|
user: {
|
|
378
|
-
firstName:
|
|
375
|
+
firstName: g || "Auto-Reply",
|
|
379
376
|
icon: "",
|
|
380
|
-
id:
|
|
377
|
+
id: u || "system-message",
|
|
381
378
|
initials: "",
|
|
382
379
|
lastName: z || "",
|
|
383
380
|
name: re,
|
|
@@ -386,12 +383,12 @@ const Gt = mt({
|
|
|
386
383
|
};
|
|
387
384
|
T.user.firstName && T.user.lastName ? T.user.initials = T.user.firstName[0] + T.user.lastName[0] : T.user.firstName && (T.user.initials = T.user.firstName[0]), le && (T.user.icon = "property-fill"), t.push(T);
|
|
388
385
|
}), C.value = t;
|
|
389
|
-
},
|
|
386
|
+
}, Qe = (e) => {
|
|
390
387
|
if (!e || e.length === 0) return;
|
|
391
388
|
(Array.isArray(e) ? e : Object.values(e)).forEach((a) => {
|
|
392
389
|
if (C.value.some((T) => T.id === a.id))
|
|
393
390
|
return;
|
|
394
|
-
const s = a.senderType || a.sender_type, n = a.senderName || "",
|
|
391
|
+
const s = a.senderType || a.sender_type, n = a.senderName || "", r = a.senderId || a.sender_id, u = a.profileImg || a.profile_img, m = n ? n.split(" ") : ["", ""], f = a.user_first_name || a.guest_first_name || m[0] || "", g = a.user_last_name || a.guest_last_name || m.slice(1).join(" ") || "", z = f && g ? `${f} ${g}` : f || "Auto-Reply", re = s === "system" || s === "user", le = s === "guest";
|
|
395
392
|
let D = {
|
|
396
393
|
id: a.id,
|
|
397
394
|
isPropertyEmployee: s === "user",
|
|
@@ -404,20 +401,20 @@ const Gt = mt({
|
|
|
404
401
|
user: {
|
|
405
402
|
firstName: f || "Auto-Reply",
|
|
406
403
|
icon: "",
|
|
407
|
-
id:
|
|
404
|
+
id: r || "system-message",
|
|
408
405
|
initials: "",
|
|
409
|
-
lastName:
|
|
406
|
+
lastName: g || "",
|
|
410
407
|
name: z,
|
|
411
|
-
src:
|
|
408
|
+
src: u || ""
|
|
412
409
|
}
|
|
413
410
|
};
|
|
414
411
|
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]), re && (D.user.icon = "property-fill"), C.value.push(D);
|
|
415
412
|
});
|
|
416
|
-
},
|
|
417
|
-
if (o.showComments &&
|
|
413
|
+
}, fe = async (e = !1) => {
|
|
414
|
+
if (o.showComments && l.value.tokenId) {
|
|
418
415
|
e || (y.value.messages = !0);
|
|
419
416
|
try {
|
|
420
|
-
let t = `/api/client/connect/getMessages.php?tokenId=${
|
|
417
|
+
let t = `/api/client/connect/getMessages.php?tokenId=${l.value.tokenId}`;
|
|
421
418
|
e && k.value !== null && (t += `&lastMsgId=${k.value}`);
|
|
422
419
|
const s = await (await fetch(t, {
|
|
423
420
|
method: "GET",
|
|
@@ -426,7 +423,7 @@ const Gt = mt({
|
|
|
426
423
|
if (s.status === "error")
|
|
427
424
|
throw new Error(s.message || "Failed to get messages");
|
|
428
425
|
if (A.value = !s.closed, s.messages && s.messages.length > 0) {
|
|
429
|
-
k.value = s.messages[s.messages.length - 1].id, e ?
|
|
426
|
+
k.value = s.messages[s.messages.length - 1].id, e ? Qe(s.messages) : F(s.messages);
|
|
430
427
|
const n = setTimeout(Y, 100);
|
|
431
428
|
L.value.push(n);
|
|
432
429
|
} else e || F(s.messages || []);
|
|
@@ -436,7 +433,7 @@ const Gt = mt({
|
|
|
436
433
|
e || (y.value.messages = !1);
|
|
437
434
|
}
|
|
438
435
|
}
|
|
439
|
-
},
|
|
436
|
+
}, $e = (e) => {
|
|
440
437
|
const t = w.utc(), a = w.fromFormat(e, "yyyy-MM-dd HH:mm:ss", { zone: "utc" }), s = t.diff(
|
|
441
438
|
a,
|
|
442
439
|
[
|
|
@@ -446,21 +443,21 @@ const Gt = mt({
|
|
|
446
443
|
"hours",
|
|
447
444
|
"minutes"
|
|
448
445
|
]
|
|
449
|
-
), n = Math.floor(s.years),
|
|
446
|
+
), n = Math.floor(s.years), r = Math.floor(s.months), u = Math.floor(s.days), m = Math.floor(s.hours), f = Math.floor(s.minutes);
|
|
450
447
|
if (n)
|
|
451
|
-
return n === 1 ?
|
|
452
|
-
if (
|
|
453
|
-
return
|
|
454
|
-
if (
|
|
455
|
-
return
|
|
448
|
+
return n === 1 ? c("HC_ONE_YEAR_AGO") : c("HC_X_YEARS_AGO", { years: n });
|
|
449
|
+
if (r)
|
|
450
|
+
return r === 1 ? c("HC_ONE_MONTH_AGO") : c("HC_X_MONTHS_AGO", { months: r });
|
|
451
|
+
if (u)
|
|
452
|
+
return u === 1 ? c("HC_ONE_DAY_AGO") : c("HC_X_DAYS_AGO", { days: u });
|
|
456
453
|
if (m)
|
|
457
|
-
return m === 1 ?
|
|
454
|
+
return m === 1 ? c("HC_ONE_HOUR_AGO") : c("HC_X_HOURS_AGO", { hours: m });
|
|
458
455
|
if (f)
|
|
459
|
-
return f === 1 ?
|
|
456
|
+
return f === 1 ? c("HC_ONE_MINUTE_AGO") : c("HC_X_MINUTES_AGO", { minutes: f });
|
|
460
457
|
if (f === 0)
|
|
461
|
-
return
|
|
462
|
-
},
|
|
463
|
-
o.showGuestDetails && oe(), ne(), V(), h("refresh:pms",
|
|
458
|
+
return c("HC_A_MOMENT_AGO");
|
|
459
|
+
}, Je = async () => {
|
|
460
|
+
o.showGuestDetails && oe(), ne(), V(), h("refresh:pms", l.value);
|
|
464
461
|
}, oe = async () => {
|
|
465
462
|
try {
|
|
466
463
|
y.value.pms = !0;
|
|
@@ -471,11 +468,11 @@ const Gt = mt({
|
|
|
471
468
|
throw new Error("PMS base URL is required");
|
|
472
469
|
const s = {
|
|
473
470
|
Authorization: "Bearer " + (() => {
|
|
474
|
-
const
|
|
475
|
-
return
|
|
471
|
+
const g = `; ${document.cookie}`.split("; QV2Auth=");
|
|
472
|
+
return g.length === 2 && g.pop()?.split(";").shift() || "";
|
|
476
473
|
})(),
|
|
477
474
|
"Content-Type": "application/json"
|
|
478
|
-
}, n =
|
|
475
|
+
}, n = l.value?.qv2Rooms?.qRoomId || l.value?.id || o.room.id, r = await fetch(
|
|
479
476
|
`${a}/vendors/properties/statuses/${o.propertyId}/rooms`,
|
|
480
477
|
{
|
|
481
478
|
method: "POST",
|
|
@@ -484,16 +481,16 @@ const Gt = mt({
|
|
|
484
481
|
body: JSON.stringify({ roomsIds: [n] })
|
|
485
482
|
}
|
|
486
483
|
);
|
|
487
|
-
clearTimeout(t),
|
|
488
|
-
const
|
|
489
|
-
R.value = m, m.length > 0 ?
|
|
484
|
+
clearTimeout(t), r.ok || ke(r);
|
|
485
|
+
const u = await r.json(), m = u.data?.pmsRooms || u.data?.rooms || u.rooms || [];
|
|
486
|
+
R.value = m, m.length > 0 ? l.value = {
|
|
490
487
|
...m[0],
|
|
491
488
|
tokenId: m[0].tokenId || o.room.tokenId
|
|
492
|
-
} :
|
|
489
|
+
} : l.value = o.room, y.value.pms = !1;
|
|
493
490
|
} catch (e) {
|
|
494
491
|
return y.value.pms = !1, h("show:toast", {
|
|
495
492
|
show: !0,
|
|
496
|
-
message:
|
|
493
|
+
message: c("HC_FAILED_TO_LOAD_PMS_DATA"),
|
|
497
494
|
variant: "error",
|
|
498
495
|
icon: "exclamation-circle"
|
|
499
496
|
}), e;
|
|
@@ -511,14 +508,14 @@ const Gt = mt({
|
|
|
511
508
|
} catch (e) {
|
|
512
509
|
console.error("Error getting room notices:", e), ae.value = [], h("show:toast", {
|
|
513
510
|
show: !0,
|
|
514
|
-
message:
|
|
511
|
+
message: c("HC_FAILED_TO_LOAD_ROOM_NOTICES"),
|
|
515
512
|
variant: "error",
|
|
516
513
|
icon: "exclamation-circle"
|
|
517
514
|
});
|
|
518
515
|
} finally {
|
|
519
516
|
y.value.roomNotices = !1;
|
|
520
517
|
}
|
|
521
|
-
},
|
|
518
|
+
}, he = async () => {
|
|
522
519
|
try {
|
|
523
520
|
const e = new FormData();
|
|
524
521
|
e.append("property_id", o.propertyId), e.append("filter", "tasks_new");
|
|
@@ -531,30 +528,30 @@ const Gt = mt({
|
|
|
531
528
|
body: e
|
|
532
529
|
})
|
|
533
530
|
]), s = await t.json(), n = await a.json();
|
|
534
|
-
if (s.departments && (s.departments.forEach((
|
|
535
|
-
|
|
531
|
+
if (s.departments && (s.departments.forEach((r) => {
|
|
532
|
+
r.label = r.display_name;
|
|
536
533
|
}), M.value = s.departments), n.users) {
|
|
537
|
-
const
|
|
538
|
-
let
|
|
534
|
+
const r = [];
|
|
535
|
+
let u = {
|
|
539
536
|
group: "",
|
|
540
537
|
options: []
|
|
541
538
|
};
|
|
542
539
|
n.users.forEach((m) => {
|
|
543
|
-
m.translated_department !==
|
|
544
|
-
}),
|
|
540
|
+
m.translated_department !== u.group && (u.group && r.push({ ...u }), u.group = m.translated_department, u.options = []), u.options.push(m);
|
|
541
|
+
}), u.group && r.push({ ...u }), we.value = r;
|
|
545
542
|
}
|
|
546
543
|
} catch (e) {
|
|
547
544
|
console.error("Error getting shared data:", e), h("show:toast", {
|
|
548
545
|
show: !0,
|
|
549
|
-
message:
|
|
546
|
+
message: c("HC_FAILED_TO_LOAD_SHARED_DATA"),
|
|
550
547
|
variant: "error",
|
|
551
548
|
icon: "exclamation-circle"
|
|
552
549
|
});
|
|
553
550
|
}
|
|
554
|
-
},
|
|
551
|
+
}, Oe = async () => {
|
|
555
552
|
try {
|
|
556
553
|
const t = await (await fetch(
|
|
557
|
-
`/api/client/connect/getStayDetails.php?tokenId=${
|
|
554
|
+
`/api/client/connect/getStayDetails.php?tokenId=${l.value.tokenId}`,
|
|
558
555
|
{
|
|
559
556
|
method: "GET",
|
|
560
557
|
credentials: "include"
|
|
@@ -570,12 +567,12 @@ const Gt = mt({
|
|
|
570
567
|
} catch (e) {
|
|
571
568
|
console.error("getStayDetails error:", e), h("show:toast", {
|
|
572
569
|
show: !0,
|
|
573
|
-
message:
|
|
570
|
+
message: c("HC_FAILED_TO_LOAD_STAY_DETAILS"),
|
|
574
571
|
variant: "error",
|
|
575
572
|
icon: "exclamation-circle"
|
|
576
573
|
});
|
|
577
574
|
}
|
|
578
|
-
},
|
|
575
|
+
}, Ve = (e) => {
|
|
579
576
|
switch (e) {
|
|
580
577
|
case "complaint":
|
|
581
578
|
return "red-30";
|
|
@@ -588,7 +585,7 @@ const Gt = mt({
|
|
|
588
585
|
case "task":
|
|
589
586
|
return "green-20";
|
|
590
587
|
}
|
|
591
|
-
},
|
|
588
|
+
}, Ye = (e) => {
|
|
592
589
|
switch (e) {
|
|
593
590
|
case "complaint":
|
|
594
591
|
return "face-frown";
|
|
@@ -614,14 +611,14 @@ const Gt = mt({
|
|
|
614
611
|
} catch (e) {
|
|
615
612
|
console.error("Error getting tickets:", e), S.value = [], h("show:toast", {
|
|
616
613
|
show: !0,
|
|
617
|
-
message:
|
|
614
|
+
message: c("HC_FAILED_TO_LOAD_TICKETS"),
|
|
618
615
|
variant: "error",
|
|
619
616
|
icon: "exclamation-circle"
|
|
620
617
|
});
|
|
621
618
|
} finally {
|
|
622
619
|
y.value.tickets = !1;
|
|
623
620
|
}
|
|
624
|
-
},
|
|
621
|
+
}, ke = async (e) => {
|
|
625
622
|
const t = await e.text();
|
|
626
623
|
let a;
|
|
627
624
|
try {
|
|
@@ -630,10 +627,10 @@ const Gt = mt({
|
|
|
630
627
|
a = { code: e.status, message: t };
|
|
631
628
|
}
|
|
632
629
|
return a.code === 401 ? (window.location.href = "/logout.php?unauthorized=1", { error: a }) : a;
|
|
633
|
-
},
|
|
630
|
+
}, ze = (e) => {
|
|
634
631
|
const t = document.querySelectorAll(".pulse");
|
|
635
632
|
if (t && t.length) {
|
|
636
|
-
const a =
|
|
633
|
+
const a = l.value?.qv2Rooms?.qRoomId || l.value?.id || o.room?.id, s = document.getElementById("room-" + a), n = s?.classList;
|
|
637
634
|
switch (e) {
|
|
638
635
|
case "room_notice":
|
|
639
636
|
(n?.contains("roombox_unsel") || n?.contains("roombox_unsel_active")) && (s?.classList.remove(), s?.classList.add("roomnoticeroombox_sel"));
|
|
@@ -648,16 +645,16 @@ const Gt = mt({
|
|
|
648
645
|
!n?.contains("smsroombox_sel") && !n?.contains("callbackroombox_sel") && !n?.contains("complaintsroombox_sel") && !n?.contains("guestrequestroombox_sel") && (s?.classList.remove(), s?.classList.add("workordersroombox_sel"));
|
|
649
646
|
break;
|
|
650
647
|
}
|
|
651
|
-
const
|
|
652
|
-
t.forEach((
|
|
653
|
-
|
|
648
|
+
const r = setTimeout(() => {
|
|
649
|
+
t.forEach((u) => {
|
|
650
|
+
u.classList.remove("pulse");
|
|
654
651
|
});
|
|
655
652
|
}, 4500);
|
|
656
|
-
L.value.push(
|
|
653
|
+
L.value.push(r);
|
|
657
654
|
}
|
|
658
|
-
},
|
|
655
|
+
}, Ke = () => {
|
|
659
656
|
window.open("/guest/overview.php", "_blank");
|
|
660
|
-
},
|
|
657
|
+
}, Xe = (e) => {
|
|
661
658
|
let t = "";
|
|
662
659
|
switch (e.type) {
|
|
663
660
|
case "complaint":
|
|
@@ -679,9 +676,9 @@ const Gt = mt({
|
|
|
679
676
|
return "#";
|
|
680
677
|
}
|
|
681
678
|
window.open(t, "_blank");
|
|
682
|
-
},
|
|
679
|
+
}, Ze = async () => {
|
|
683
680
|
ve.value = !0;
|
|
684
|
-
const e =
|
|
681
|
+
const e = l.value?.qv2Rooms?.qRoomId || l.value?.id || o.room?.id, t = l.value?.qv2Rooms?.qRoomName || l.value?.name || o.room?.name, a = {
|
|
685
682
|
type: E.value?.id,
|
|
686
683
|
propertyId: o.propertyId,
|
|
687
684
|
userId: P.value,
|
|
@@ -690,7 +687,7 @@ const Gt = mt({
|
|
|
690
687
|
};
|
|
691
688
|
switch (E.value?.id) {
|
|
692
689
|
case "complaint":
|
|
693
|
-
a.tokenId =
|
|
690
|
+
a.tokenId = l.value.tokenId, a.problemId = p.value.problem.id, a.guestName = p.value.guestName, a.guestPhone = p.value.guestPhone, a.guestEmail = p.value.guestEmail, a.guestLoyalty = p.value.guestLoyalty, a.guestMood = p.value.guestMood.id, a.checkInDate = w.fromJSDate(p.value.checkInDate).toFormat(
|
|
694
691
|
"yyyy-MM-dd"
|
|
695
692
|
), a.checkOutDate = w.fromJSDate(p.value.checkOutDate).toFormat(
|
|
696
693
|
"yyyy-MM-dd"
|
|
@@ -706,36 +703,36 @@ const Gt = mt({
|
|
|
706
703
|
a.itemId = v.value.item.id, a.issueId = v.value.issue.id, a.assignType = v.value.assignType.id, a.occupied = v.value.requestedBy.id, a.notes = v.value.notes, a.dueDate = w.fromJSDate(v.value.due).toFormat("yyyy-MM-dd"), v.value.assignType.id === 1 && (a.department = v.value.department.id), v.value.assignType.id === 2 && (a.person = v.value.person.id), h("create:todo", a);
|
|
707
704
|
break;
|
|
708
705
|
}
|
|
709
|
-
},
|
|
710
|
-
|
|
711
|
-
},
|
|
712
|
-
|
|
713
|
-
},
|
|
706
|
+
}, et = (e) => {
|
|
707
|
+
ge(), _e(), o.hover && h("toggle", e);
|
|
708
|
+
}, tt = (e) => {
|
|
709
|
+
Se(), b.value = e;
|
|
710
|
+
}, at = async (e) => {
|
|
714
711
|
if (console.log("selected:", e), E.value = e, O.value = [], I.value.issue = null, p.value.problem = null, v.value.item = null, v.value.issue = null, d.value.item = null, !E.value) {
|
|
715
712
|
y.value.actionItems = !1;
|
|
716
713
|
return;
|
|
717
714
|
}
|
|
718
715
|
y.value.actionItems = !0;
|
|
719
|
-
const t =
|
|
716
|
+
const t = l.value?.qv2Rooms?.qRoomId || l.value?.id || o.room?.id, a = new FormData();
|
|
720
717
|
switch (a.append("property_id", o.propertyId), a.append("area_id", t), e.id) {
|
|
721
718
|
case "complaint":
|
|
722
719
|
try {
|
|
723
|
-
|
|
720
|
+
l.value.tokenId && await Oe();
|
|
724
721
|
const n = await (await fetch("/api/client/common/getComplaintProblemsByPropertyId.php", {
|
|
725
722
|
method: "POST",
|
|
726
723
|
body: a
|
|
727
724
|
})).json();
|
|
728
725
|
n.items && (O.value = n.items);
|
|
729
|
-
const
|
|
726
|
+
const r = await K.post(
|
|
730
727
|
"/api/client/common/getComplaintMoods.php"
|
|
731
728
|
);
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
}), ce.value =
|
|
729
|
+
r.data.items.forEach((u) => {
|
|
730
|
+
u.label = u.display_name;
|
|
731
|
+
}), ce.value = r.data.items;
|
|
735
732
|
} catch (s) {
|
|
736
733
|
console.error("Error loading complaint options:", s), h("show:toast", {
|
|
737
734
|
show: !0,
|
|
738
|
-
message:
|
|
735
|
+
message: c("HC_FAILED_TO_LOAD_COMPLAINT_OPTIONS"),
|
|
739
736
|
variant: "error",
|
|
740
737
|
icon: "exclamation-circle"
|
|
741
738
|
});
|
|
@@ -753,7 +750,7 @@ const Gt = mt({
|
|
|
753
750
|
} catch (s) {
|
|
754
751
|
console.error("Error loading room notice options:", s), h("show:toast", {
|
|
755
752
|
show: !0,
|
|
756
|
-
message:
|
|
753
|
+
message: c("HC_FAILED_TO_LOAD_ROOM_NOTICE_OPTIONS"),
|
|
757
754
|
variant: "error",
|
|
758
755
|
icon: "exclamation-circle"
|
|
759
756
|
});
|
|
@@ -763,22 +760,22 @@ const Gt = mt({
|
|
|
763
760
|
break;
|
|
764
761
|
case "request":
|
|
765
762
|
try {
|
|
766
|
-
d.value.requestedBy =
|
|
763
|
+
d.value.requestedBy = $.value[1], d.value.assignType = X.value[0];
|
|
767
764
|
const n = await (await fetch("/api/client/common/getHousekeepingItemsByPropertyId.php", {
|
|
768
765
|
method: "POST",
|
|
769
766
|
body: a
|
|
770
767
|
})).json();
|
|
771
|
-
if (n.items && (O.value = n.items), await
|
|
772
|
-
(
|
|
768
|
+
if (n.items && (O.value = n.items), await he(), d.value.department = M.value.find(
|
|
769
|
+
(r) => parseInt(r.id) === 4
|
|
773
770
|
), o.allowWhenWhere)
|
|
774
771
|
try {
|
|
775
|
-
const
|
|
776
|
-
|
|
772
|
+
const r = new FormData();
|
|
773
|
+
r.append("property_id", o.propertyId);
|
|
777
774
|
const m = await (await fetch(
|
|
778
775
|
"/api/client/common/getWhenWhereOptions.php",
|
|
779
776
|
{
|
|
780
777
|
method: "POST",
|
|
781
|
-
body:
|
|
778
|
+
body: r
|
|
782
779
|
}
|
|
783
780
|
)).json();
|
|
784
781
|
m.when && Array.isArray(m.when) ? q.value = m.when.map((f) => ({
|
|
@@ -790,10 +787,10 @@ const Gt = mt({
|
|
|
790
787
|
label: f.name,
|
|
791
788
|
value: f.id
|
|
792
789
|
})) : x.value = [];
|
|
793
|
-
} catch (
|
|
794
|
-
console.error("Error loading When/Where options:",
|
|
790
|
+
} catch (r) {
|
|
791
|
+
console.error("Error loading When/Where options:", r), q.value = [], x.value = [], h("show:toast", {
|
|
795
792
|
show: !0,
|
|
796
|
-
message:
|
|
793
|
+
message: c("HC_FAILED_TO_LOAD_WHEN_WHERE_OPTIONS"),
|
|
797
794
|
variant: "error",
|
|
798
795
|
icon: "exclamation-circle"
|
|
799
796
|
});
|
|
@@ -801,7 +798,7 @@ const Gt = mt({
|
|
|
801
798
|
} catch (s) {
|
|
802
799
|
console.error("Error loading request options:", s), h("show:toast", {
|
|
803
800
|
show: !0,
|
|
804
|
-
message:
|
|
801
|
+
message: c("HC_FAILED_TO_LOAD_REQUEST_OPTIONS"),
|
|
805
802
|
variant: "error",
|
|
806
803
|
icon: "exclamation-circle"
|
|
807
804
|
});
|
|
@@ -811,26 +808,26 @@ const Gt = mt({
|
|
|
811
808
|
break;
|
|
812
809
|
case "work_order":
|
|
813
810
|
try {
|
|
814
|
-
v.value.requestedBy =
|
|
811
|
+
v.value.requestedBy = $.value[0], v.value.assignType = X.value[0];
|
|
815
812
|
const n = await (await fetch("/api/client/common/getItemsByRoomId.php", {
|
|
816
813
|
method: "POST",
|
|
817
814
|
body: a
|
|
818
|
-
})).json(),
|
|
819
|
-
let
|
|
815
|
+
})).json(), r = [];
|
|
816
|
+
let u = {
|
|
820
817
|
group: "",
|
|
821
818
|
options: []
|
|
822
819
|
};
|
|
823
820
|
n.items && (n.items.forEach((m) => {
|
|
824
|
-
m.section_name !==
|
|
825
|
-
}),
|
|
821
|
+
m.section_name !== u.group && (u.group && r.push({ ...u }), u.group = m.section_name, u.options = []), m.label && u.options.push(m);
|
|
822
|
+
}), u.group && r.push({ ...u })), O.value = r, await Promise.all([
|
|
826
823
|
K.post(
|
|
827
824
|
"/api/client/common/getWorkOrderIssues.php"
|
|
828
825
|
),
|
|
829
|
-
|
|
826
|
+
he()
|
|
830
827
|
]).then((m) => {
|
|
831
828
|
const f = m[0];
|
|
832
|
-
f.data.issues.forEach((
|
|
833
|
-
|
|
829
|
+
f.data.issues.forEach((g) => {
|
|
830
|
+
g.label = g.display_name;
|
|
834
831
|
}), pe.value = f.data.issues;
|
|
835
832
|
}), v.value.department = M.value.find(
|
|
836
833
|
(m) => parseInt(m.id) === 2
|
|
@@ -838,7 +835,7 @@ const Gt = mt({
|
|
|
838
835
|
} catch (s) {
|
|
839
836
|
console.error("Error loading work order options:", s), h("show:toast", {
|
|
840
837
|
show: !0,
|
|
841
|
-
message:
|
|
838
|
+
message: c("HC_FAILED_TO_LOAD_WORK_ORDER_OPTIONS"),
|
|
842
839
|
variant: "error",
|
|
843
840
|
icon: "exclamation-circle"
|
|
844
841
|
});
|
|
@@ -850,9 +847,9 @@ const Gt = mt({
|
|
|
850
847
|
y.value.actionItems = !1;
|
|
851
848
|
return;
|
|
852
849
|
}
|
|
853
|
-
},
|
|
850
|
+
}, st = () => {
|
|
854
851
|
se.value = !se.value, ie.value = !1;
|
|
855
|
-
},
|
|
852
|
+
}, Ee = () => {
|
|
856
853
|
const e = document.getElementById("comment-field"), t = document.getElementById("hidden-text");
|
|
857
854
|
e.style.height = t?.offsetHeight + "px";
|
|
858
855
|
}, Y = () => {
|
|
@@ -861,12 +858,12 @@ const Gt = mt({
|
|
|
861
858
|
top: e.scrollHeight,
|
|
862
859
|
behavior: "smooth"
|
|
863
860
|
});
|
|
864
|
-
},
|
|
865
|
-
if (e && e.type === "keydown" && e.preventDefault(),
|
|
861
|
+
}, ot = async (e) => {
|
|
862
|
+
if (e && e.type === "keydown" && e.preventDefault(), l.value.tokenId && b.value && !H.value) {
|
|
866
863
|
y.value.sendingMessage = !0;
|
|
867
864
|
try {
|
|
868
865
|
const t = new FormData();
|
|
869
|
-
t.append("tokenId",
|
|
866
|
+
t.append("tokenId", l.value.tokenId), t.append("content", b.value), t.append("senderId", P.value || "");
|
|
870
867
|
const a = await K.post(
|
|
871
868
|
"/api/client/connect/sendMessage.php",
|
|
872
869
|
t
|
|
@@ -874,7 +871,7 @@ const Gt = mt({
|
|
|
874
871
|
if (a.data.status === "error") {
|
|
875
872
|
h("show:toast", {
|
|
876
873
|
show: !0,
|
|
877
|
-
message:
|
|
874
|
+
message: c("HC_FAILED_TO_SEND_MESSAGE"),
|
|
878
875
|
variant: "error",
|
|
879
876
|
icon: "exclamation-circle"
|
|
880
877
|
});
|
|
@@ -884,7 +881,7 @@ const Gt = mt({
|
|
|
884
881
|
} catch (t) {
|
|
885
882
|
console.error("sendChatMessage error:", t), h("show:toast", {
|
|
886
883
|
show: !0,
|
|
887
|
-
message:
|
|
884
|
+
message: c("HC_FAILED_TO_SEND_MESSAGE"),
|
|
888
885
|
variant: "error",
|
|
889
886
|
icon: "exclamation-circle"
|
|
890
887
|
});
|
|
@@ -892,17 +889,17 @@ const Gt = mt({
|
|
|
892
889
|
y.value.sendingMessage = !1;
|
|
893
890
|
}
|
|
894
891
|
}
|
|
895
|
-
},
|
|
896
|
-
if (!(!
|
|
892
|
+
}, nt = async () => {
|
|
893
|
+
if (!(!l.value.tokenId || !P.value)) {
|
|
897
894
|
y.value.conversationToggle = !0;
|
|
898
895
|
try {
|
|
899
896
|
const e = A.value ? "/api/client/connect/closeConversation.php" : "/api/client/connect/openConversation.php", t = new FormData();
|
|
900
|
-
t.append("tokenId",
|
|
897
|
+
t.append("tokenId", l.value.tokenId), t.append("userId", P.value), A.value && k.value !== null && t.append("lastMsgId", k.value.toString());
|
|
901
898
|
const a = await K.post(e, t);
|
|
902
899
|
if (a.data.status === "error") {
|
|
903
900
|
h("show:toast", {
|
|
904
901
|
show: !0,
|
|
905
|
-
message:
|
|
902
|
+
message: c("HC_FAILED_TO_UPDATE_CONVERSATION"),
|
|
906
903
|
variant: "error",
|
|
907
904
|
icon: "exclamation-circle"
|
|
908
905
|
});
|
|
@@ -910,14 +907,14 @@ const Gt = mt({
|
|
|
910
907
|
}
|
|
911
908
|
A.value = !a.data.closed, a.data.messages && (F(a.data.messages), a.data.messages.length > 0 && (k.value = a.data.messages[a.data.messages.length - 1].id)), h("show:toast", {
|
|
912
909
|
show: !0,
|
|
913
|
-
message: A.value ?
|
|
910
|
+
message: A.value ? c("HC_CONVERSATION_REOPENED") : c("HC_CONVERSATION_CLOSED"),
|
|
914
911
|
variant: "success",
|
|
915
912
|
icon: "check-circle"
|
|
916
913
|
});
|
|
917
914
|
} catch (e) {
|
|
918
915
|
console.error("toggleMarkOpenClose error:", e), h("show:toast", {
|
|
919
916
|
show: !0,
|
|
920
|
-
message:
|
|
917
|
+
message: c("HC_FAILED_TO_UPDATE_CONVERSATION"),
|
|
921
918
|
variant: "error",
|
|
922
919
|
icon: "exclamation-circle"
|
|
923
920
|
});
|
|
@@ -925,12 +922,12 @@ const Gt = mt({
|
|
|
925
922
|
y.value.conversationToggle = !1;
|
|
926
923
|
}
|
|
927
924
|
}
|
|
928
|
-
},
|
|
929
|
-
if (o.isTestEnvironment && !(!
|
|
925
|
+
}, rt = async () => {
|
|
926
|
+
if (o.isTestEnvironment && !(!l.value?.tokenId || !j.value.trim())) {
|
|
930
927
|
me.value = !0;
|
|
931
928
|
try {
|
|
932
929
|
const e = new FormData();
|
|
933
|
-
e.append("tokenId",
|
|
930
|
+
e.append("tokenId", l.value.tokenId), e.append("content", j.value.trim());
|
|
934
931
|
const t = await K.post(
|
|
935
932
|
"/api/client/connect/simulateInbound.php",
|
|
936
933
|
e
|
|
@@ -938,7 +935,7 @@ const Gt = mt({
|
|
|
938
935
|
if (t.data.status === "error") {
|
|
939
936
|
h("show:toast", {
|
|
940
937
|
show: !0,
|
|
941
|
-
message:
|
|
938
|
+
message: c("HC_FAILED_TO_SIMULATE_MESSAGE"),
|
|
942
939
|
variant: "error",
|
|
943
940
|
icon: "exclamation-circle"
|
|
944
941
|
});
|
|
@@ -946,14 +943,14 @@ const Gt = mt({
|
|
|
946
943
|
}
|
|
947
944
|
t.data.messages && (F(t.data.messages), A.value = !t.data.closed, t.data.messages.length > 0 && (k.value = t.data.messages[t.data.messages.length - 1].id)), j.value = "", W.value = !1, Y(), h("show:toast", {
|
|
948
945
|
show: !0,
|
|
949
|
-
message:
|
|
946
|
+
message: c("HC_SIMULATED_GUEST_REPLY"),
|
|
950
947
|
variant: "success",
|
|
951
948
|
icon: "check-circle"
|
|
952
949
|
});
|
|
953
950
|
} catch (e) {
|
|
954
951
|
console.error("simulateGuestReply error:", e), h("show:toast", {
|
|
955
952
|
show: !0,
|
|
956
|
-
message:
|
|
953
|
+
message: c("HC_FAILED_TO_SIMULATE_MESSAGE"),
|
|
957
954
|
variant: "error",
|
|
958
955
|
icon: "exclamation-circle"
|
|
959
956
|
});
|
|
@@ -961,15 +958,15 @@ const Gt = mt({
|
|
|
961
958
|
me.value = !1;
|
|
962
959
|
}
|
|
963
960
|
}
|
|
964
|
-
},
|
|
961
|
+
}, lt = () => {
|
|
965
962
|
W.value = !W.value, W.value || (j.value = "");
|
|
966
|
-
},
|
|
967
|
-
|
|
968
|
-
document.visibilityState === "visible" &&
|
|
969
|
-
},
|
|
963
|
+
}, it = () => {
|
|
964
|
+
Q.value || (Q.value = setInterval(() => {
|
|
965
|
+
document.visibilityState === "visible" && fe(!0);
|
|
966
|
+
}, Ce));
|
|
967
|
+
}, ye = () => {
|
|
968
|
+
Q.value && (clearInterval(Q.value), Q.value = null);
|
|
970
969
|
}, ge = () => {
|
|
971
|
-
$.value && (clearInterval($.value), $.value = null);
|
|
972
|
-
}, _e = () => {
|
|
973
970
|
if (o.align === "left" || o.align === "right") {
|
|
974
971
|
const e = J.value?.getBoundingClientRect().left, t = window.innerWidth;
|
|
975
972
|
ue.value = t - e < U.value ? "right" : "left";
|
|
@@ -977,7 +974,7 @@ const Gt = mt({
|
|
|
977
974
|
const e = J.value?.getBoundingClientRect().top, t = window.innerHeight;
|
|
978
975
|
ue.value = t - e < G.value ? "bottom" : "top";
|
|
979
976
|
}
|
|
980
|
-
},
|
|
977
|
+
}, _e = () => {
|
|
981
978
|
if (o.position === "top" || o.position === "bottom") {
|
|
982
979
|
const e = J.value?.getBoundingClientRect().top, t = window.innerHeight;
|
|
983
980
|
de.value = t - e < G.value ? "top" : "bottom";
|
|
@@ -985,21 +982,21 @@ const Gt = mt({
|
|
|
985
982
|
const e = J.value?.getBoundingClientRect().left, t = window.innerWidth;
|
|
986
983
|
de.value = t - e < U.value ? "left" : "right";
|
|
987
984
|
}
|
|
988
|
-
},
|
|
985
|
+
}, Se = () => {
|
|
989
986
|
H.value = !H.value, H.value ? (b.value = "", N.value.info = ee.value, N.value.tickets = te.value, N.value.comments = Z.value, ee.value = !1, te.value = !1, document.getElementById("comment-field")?.focus()) : (ee.value = N.value.info, te.value = N.value.tickets, Z.value = N.value.comments);
|
|
990
|
-
},
|
|
991
|
-
const a =
|
|
987
|
+
}, ut = async (e, t) => {
|
|
988
|
+
const a = l.value?.qv2Rooms?.qRoomId || l.value?.id || o.room?.id, s = new FormData();
|
|
992
989
|
if (s.append("property_id", o.propertyId), s.append("room_ids", JSON.stringify([a])), await V(), S.value) {
|
|
993
990
|
const n = [];
|
|
994
|
-
S.value.forEach((
|
|
995
|
-
|
|
996
|
-
...
|
|
991
|
+
S.value.forEach((r) => {
|
|
992
|
+
r.id === e && r.type === t ? n.unshift({
|
|
993
|
+
...r,
|
|
997
994
|
isNew: !0
|
|
998
995
|
}) : n.push({
|
|
999
|
-
...
|
|
996
|
+
...r,
|
|
1000
997
|
isNew: !1
|
|
1001
998
|
});
|
|
1002
|
-
}), n.sort((
|
|
999
|
+
}), n.sort((r, u) => r.id === e ? -1 : u.id === e ? 1 : 0), S.value = [...n];
|
|
1003
1000
|
}
|
|
1004
1001
|
};
|
|
1005
1002
|
B(() => o.open, () => {
|
|
@@ -1007,35 +1004,35 @@ const Gt = mt({
|
|
|
1007
1004
|
const e = setTimeout(Y, 500);
|
|
1008
1005
|
L.value.push(e);
|
|
1009
1006
|
}
|
|
1010
|
-
o.open || (
|
|
1007
|
+
o.open || (Te(), ye(), k.value = null, C.value = [], A.value = !1);
|
|
1011
1008
|
}), B(
|
|
1012
|
-
() => [o.open, o.showComments, Z.value,
|
|
1009
|
+
() => [o.open, o.showComments, Z.value, l.value?.tokenId],
|
|
1013
1010
|
([e, t, a, s]) => {
|
|
1014
|
-
e && t && a && s ?
|
|
1011
|
+
e && t && a && s ? it() : ye();
|
|
1015
1012
|
}
|
|
1016
1013
|
), B(b, () => {
|
|
1017
|
-
const e = setTimeout(
|
|
1014
|
+
const e = setTimeout(Ee, 100);
|
|
1018
1015
|
L.value.push(e);
|
|
1019
1016
|
}), B(() => o.allowWhenWhere, (e, t) => {
|
|
1020
1017
|
t === !0 && e === !1 && (d.value.when = null, d.value.where = null, q.value = [], x.value = []);
|
|
1021
1018
|
});
|
|
1022
|
-
const
|
|
1019
|
+
const Ae = () => !!(o.room.reservations || o.room.cleaning || o.room.occupancy);
|
|
1023
1020
|
return B(() => o.open, async (e, t) => {
|
|
1024
|
-
e && !t && (
|
|
1021
|
+
e && !t && (Ae() ? (l.value = o.room, R.value = [o.room]) : o.showGuestDetails && !R.value ? await oe() : l.value || (l.value = o.room), V(), ne(), o.showComments && fe());
|
|
1025
1022
|
}), B(
|
|
1026
1023
|
() => o.room.id,
|
|
1027
1024
|
(e, t) => {
|
|
1028
|
-
e !== t && (
|
|
1025
|
+
e !== t && (l.value = o.room, R.value = null, o.open && (Ae() ? R.value = [o.room] : o.showGuestDetails && oe(), V(), ne()));
|
|
1029
1026
|
}
|
|
1030
|
-
),
|
|
1027
|
+
), dt(async () => {
|
|
1031
1028
|
const e = JSON.parse(
|
|
1032
1029
|
window.localStorage.getItem("authenticated")
|
|
1033
1030
|
);
|
|
1034
|
-
P.value = e?.user?.id || window.userId || "",
|
|
1035
|
-
}),
|
|
1031
|
+
P.value = e?.user?.id || window.userId || "", l.value = o.room, o.size === "sm" && (G.value = 140, U.value = 160), o.size === "lg" && (G.value = 250, U.value = 440), ge(), _e();
|
|
1032
|
+
}), mt(() => {
|
|
1036
1033
|
L.value.forEach((e) => {
|
|
1037
1034
|
clearTimeout(e);
|
|
1038
|
-
}),
|
|
1035
|
+
}), ye();
|
|
1039
1036
|
}), {
|
|
1040
1037
|
DateTime: w,
|
|
1041
1038
|
// Refs
|
|
@@ -1047,12 +1044,12 @@ const Gt = mt({
|
|
|
1047
1044
|
componentHeight: G,
|
|
1048
1045
|
componentWidth: U,
|
|
1049
1046
|
departments: M,
|
|
1050
|
-
departmentUsers:
|
|
1047
|
+
departmentUsers: we,
|
|
1051
1048
|
expandComments: Z,
|
|
1052
1049
|
expandGuestInfo: ee,
|
|
1053
1050
|
expandedStates: N,
|
|
1054
1051
|
expandTickets: te,
|
|
1055
|
-
guestDetailsData:
|
|
1052
|
+
guestDetailsData: be,
|
|
1056
1053
|
itemOptions: O,
|
|
1057
1054
|
loading: y,
|
|
1058
1055
|
messages: C,
|
|
@@ -1061,15 +1058,15 @@ const Gt = mt({
|
|
|
1061
1058
|
positioning: de,
|
|
1062
1059
|
quickReplyOpen: H,
|
|
1063
1060
|
request: d,
|
|
1064
|
-
requestedByOptions:
|
|
1061
|
+
requestedByOptions: $,
|
|
1065
1062
|
requestLoading: ve,
|
|
1066
1063
|
requestType: E,
|
|
1067
|
-
roomDetailsData:
|
|
1064
|
+
roomDetailsData: l,
|
|
1068
1065
|
roomNotice: I,
|
|
1069
1066
|
roomNotices: ae,
|
|
1070
1067
|
showCreateRequest: se,
|
|
1071
1068
|
ticketsList: S,
|
|
1072
|
-
todoOptions:
|
|
1069
|
+
todoOptions: Me,
|
|
1073
1070
|
trigger: J,
|
|
1074
1071
|
userId: P,
|
|
1075
1072
|
workOrder: v,
|
|
@@ -1084,59 +1081,57 @@ const Gt = mt({
|
|
|
1084
1081
|
simulateContent: j,
|
|
1085
1082
|
simulateLoading: me,
|
|
1086
1083
|
// Computed
|
|
1087
|
-
cleanliness:
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
tagsList: je,
|
|
1102
|
-
validateToDo: $e,
|
|
1084
|
+
cleanliness: Ne,
|
|
1085
|
+
filteredReplies: Re,
|
|
1086
|
+
groupedMessages: He,
|
|
1087
|
+
hasGuestCallback: Le,
|
|
1088
|
+
hasComplaint: Ie,
|
|
1089
|
+
itemOptionsList: Pe,
|
|
1090
|
+
occupied: De,
|
|
1091
|
+
occupancyTooltipContent: qe,
|
|
1092
|
+
selectedAssignType: xe,
|
|
1093
|
+
selectedDepartment: Fe,
|
|
1094
|
+
selectedRequestedBy: Be,
|
|
1095
|
+
stayDetails: Ge,
|
|
1096
|
+
tagsList: Ue,
|
|
1097
|
+
validateToDo: We,
|
|
1103
1098
|
// Methods
|
|
1104
|
-
closeRequest:
|
|
1105
|
-
createCallback:
|
|
1099
|
+
closeRequest: Te,
|
|
1100
|
+
createCallback: je,
|
|
1106
1101
|
createMessageList: F,
|
|
1107
|
-
getChatMessages:
|
|
1108
|
-
getHowLongAgo:
|
|
1102
|
+
getChatMessages: fe,
|
|
1103
|
+
getHowLongAgo: $e,
|
|
1109
1104
|
getPMSData: oe,
|
|
1110
1105
|
getRoomNotices: ne,
|
|
1111
|
-
getSharedData:
|
|
1112
|
-
getStayDetails:
|
|
1113
|
-
getTicketColor:
|
|
1114
|
-
getTicketIcon:
|
|
1106
|
+
getSharedData: he,
|
|
1107
|
+
getStayDetails: Oe,
|
|
1108
|
+
getTicketColor: Ve,
|
|
1109
|
+
getTicketIcon: Ye,
|
|
1115
1110
|
getTickets: V,
|
|
1116
|
-
handleFailedResponse:
|
|
1117
|
-
handlePulse:
|
|
1118
|
-
onClickEditConnectGuest:
|
|
1119
|
-
onClickTicket:
|
|
1120
|
-
onCreateRequestSubmit:
|
|
1121
|
-
onHoverToggle:
|
|
1122
|
-
onSelectQuickReply:
|
|
1123
|
-
onSelectToDo:
|
|
1124
|
-
openRequest:
|
|
1125
|
-
refreshPMSData:
|
|
1126
|
-
resizeTextarea:
|
|
1111
|
+
handleFailedResponse: ke,
|
|
1112
|
+
handlePulse: ze,
|
|
1113
|
+
onClickEditConnectGuest: Ke,
|
|
1114
|
+
onClickTicket: Xe,
|
|
1115
|
+
onCreateRequestSubmit: Ze,
|
|
1116
|
+
onHoverToggle: et,
|
|
1117
|
+
onSelectQuickReply: tt,
|
|
1118
|
+
onSelectToDo: at,
|
|
1119
|
+
openRequest: st,
|
|
1120
|
+
refreshPMSData: Je,
|
|
1121
|
+
resizeTextarea: Ee,
|
|
1127
1122
|
scrollToConnectBottom: Y,
|
|
1128
|
-
sendChatMessage:
|
|
1129
|
-
setAlignment:
|
|
1130
|
-
setPositioning:
|
|
1131
|
-
toggleMarkOpenClose:
|
|
1132
|
-
toggleQuickReply:
|
|
1133
|
-
updateTickets:
|
|
1123
|
+
sendChatMessage: ot,
|
|
1124
|
+
setAlignment: ge,
|
|
1125
|
+
setPositioning: _e,
|
|
1126
|
+
toggleMarkOpenClose: nt,
|
|
1127
|
+
toggleQuickReply: Se,
|
|
1128
|
+
updateTickets: ut,
|
|
1134
1129
|
// Simulate Guest Reply methods (test environments only)
|
|
1135
|
-
simulateGuestReply:
|
|
1136
|
-
toggleSimulateOpen:
|
|
1130
|
+
simulateGuestReply: rt,
|
|
1131
|
+
toggleSimulateOpen: lt
|
|
1137
1132
|
};
|
|
1138
1133
|
}
|
|
1139
1134
|
});
|
|
1140
1135
|
export {
|
|
1141
|
-
|
|
1136
|
+
Ft as default
|
|
1142
1137
|
};
|