@quoreadmin/ui 1.7.5 → 1.7.7

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