@quoreadmin/ui 1.6.7 → 1.6.9

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 (290) hide show
  1. package/dist/index.css +1 -1
  2. package/dist/index102.js +2 -2
  3. package/dist/index109.js +1 -1
  4. package/dist/index113.js +2 -2
  5. package/dist/index117.js +3 -3
  6. package/dist/index129.js +1 -1
  7. package/dist/index131.js +116 -59
  8. package/dist/{index139.js → index140.js} +264 -254
  9. package/dist/{index141.js → index142.js} +1 -1
  10. package/dist/{index143.js → index144.js} +6 -6
  11. package/dist/{index151.js → index152.js} +1 -1
  12. package/dist/{index153.js → index154.js} +1 -1
  13. package/dist/{index157.js → index158.js} +9 -9
  14. package/dist/index161.js +111 -492
  15. package/dist/index162.js +471 -5498
  16. package/dist/index163.js +5511 -80
  17. package/dist/index164.js +86 -856
  18. package/dist/index165.js +844 -21
  19. package/dist/index166.js +23 -265
  20. package/dist/index167.js +256 -126
  21. package/dist/index168.js +146 -1195
  22. package/dist/index169.js +1139 -712
  23. package/dist/index170.js +704 -1240
  24. package/dist/index171.js +1280 -248
  25. package/dist/index172.js +266 -96
  26. package/dist/index173.js +106 -2
  27. package/dist/index174.js +2 -1376
  28. package/dist/index175.js +1378 -0
  29. package/dist/index177.js +12 -12
  30. package/dist/index178.js +10 -10
  31. package/dist/index179.js +12 -12
  32. package/dist/index180.js +14 -21
  33. package/dist/index181.js +23 -757
  34. package/dist/index182.js +759 -1100
  35. package/dist/index183.js +1117 -1234
  36. package/dist/index184.js +1205 -11248
  37. package/dist/index185.js +11277 -36
  38. package/dist/index186.js +1188 -42
  39. package/dist/index188.js +38 -0
  40. package/dist/index189.js +44 -5938
  41. package/dist/index190.js +5830 -99
  42. package/dist/index191.js +188 -16
  43. package/dist/index192.js +25 -8
  44. package/dist/index193.js +16 -76
  45. package/dist/index194.js +74 -249
  46. package/dist/index195.js +229 -13660
  47. package/dist/index196.js +13684 -27
  48. package/dist/index197.js +26 -62
  49. package/dist/index198.js +40 -215
  50. package/dist/index199.js +206 -276
  51. package/dist/index200.js +278 -258
  52. package/dist/index201.js +287 -32
  53. package/dist/index202.js +81 -109
  54. package/dist/index203.js +404 -33
  55. package/dist/index204.js +22 -26
  56. package/dist/index205.js +30 -33
  57. package/dist/index206.js +116 -9
  58. package/dist/index207.js +35 -18
  59. package/dist/index208.js +26 -10
  60. package/dist/index209.js +36 -10
  61. package/dist/index210.js +9 -51
  62. package/dist/index211.js +18 -42
  63. package/dist/index212.js +10 -4
  64. package/dist/index213.js +10 -39
  65. package/dist/index214.js +51 -21
  66. package/dist/index215.js +40 -85
  67. package/dist/index216.js +3 -406
  68. package/dist/index217.js +39 -22
  69. package/dist/index218.js +21 -161
  70. package/dist/index219.js +126 -19
  71. package/dist/index220.js +37 -19
  72. package/dist/index221.js +80 -22
  73. package/dist/index222.js +19 -198
  74. package/dist/index223.js +18 -68
  75. package/dist/index224.js +20 -34
  76. package/dist/index225.js +19 -39
  77. package/dist/index226.js +12 -14
  78. package/dist/index227.js +160 -21
  79. package/dist/index228.js +9 -9
  80. package/dist/index229.js +22 -836
  81. package/dist/index230.js +158 -661
  82. package/dist/index231.js +67 -173
  83. package/dist/index232.js +34 -20
  84. package/dist/index233.js +39 -19
  85. package/dist/index234.js +3632 -22
  86. package/dist/index235.js +55 -20
  87. package/dist/index236.js +77 -20
  88. package/dist/index237.js +52 -3
  89. package/dist/index238.js +208 -180
  90. package/dist/index239.js +10 -133
  91. package/dist/index240.js +51 -1217
  92. package/dist/index241.js +56 -122
  93. package/dist/index242.js +54 -20
  94. package/dist/index243.js +75 -22
  95. package/dist/index244.js +722 -21
  96. package/dist/index245.js +34 -33
  97. package/dist/index246.js +64 -29
  98. package/dist/index247.js +11 -20
  99. package/dist/index248.js +705 -20
  100. package/dist/index249.js +820 -2
  101. package/dist/index250.js +161 -2
  102. package/dist/index251.js +187 -3591
  103. package/dist/index252.js +37 -55
  104. package/dist/index253.js +10 -77
  105. package/dist/index254.js +22 -52
  106. package/dist/index255.js +22 -215
  107. package/dist/index256.js +20 -10
  108. package/dist/index257.js +827 -48
  109. package/dist/index258.js +691 -50
  110. package/dist/index259.js +174 -52
  111. package/dist/index260.js +22 -75
  112. package/dist/index261.js +19 -722
  113. package/dist/index262.js +20 -39
  114. package/dist/index263.js +3 -64
  115. package/dist/index264.js +187 -11
  116. package/dist/index265.js +124 -696
  117. package/dist/index266.js +1189 -786
  118. package/dist/index267.js +19 -160
  119. package/dist/index268.js +22 -228
  120. package/dist/index269.js +21 -36
  121. package/dist/index270.js +29 -10
  122. package/dist/index271.js +20 -80
  123. package/dist/index272.js +9 -9
  124. package/dist/index273.js +2 -20
  125. package/dist/index274.js +2 -253
  126. package/dist/index275.js +235 -8
  127. package/dist/index276.js +5 -137
  128. package/dist/index277.js +128 -77
  129. package/dist/index278.js +66 -52
  130. package/dist/index279.js +81 -73
  131. package/dist/index280.js +28 -25
  132. package/dist/index281.js +7 -20
  133. package/dist/index282.js +74 -21
  134. package/dist/index283.js +4 -16
  135. package/dist/index284.js +2 -17
  136. package/dist/index285.js +82 -22
  137. package/dist/index286.js +49 -1513
  138. package/dist/index287.js +4 -384
  139. package/dist/index288.js +4 -2730
  140. package/dist/index289.js +170 -77
  141. package/dist/index290.js +55 -3762
  142. package/dist/index291.js +75 -60
  143. package/dist/index292.js +252 -14
  144. package/dist/index293.js +2 -84
  145. package/dist/index294.js +123 -187
  146. package/dist/index295.js +68 -231
  147. package/dist/index296.js +71 -71
  148. package/dist/index297.js +8 -22
  149. package/dist/index298.js +49 -930
  150. package/dist/index299.js +17 -13
  151. package/dist/index300.js +13 -11
  152. package/dist/index301.js +15 -13
  153. package/dist/index302.js +14 -67
  154. package/dist/index303.js +14 -16
  155. package/dist/index304.js +21 -17
  156. package/dist/index305.js +1518 -22
  157. package/dist/index306.js +386 -22
  158. package/dist/index307.js +2731 -63
  159. package/dist/index308.js +86 -2
  160. package/dist/index309.js +3770 -3
  161. package/dist/index310.js +56 -23
  162. package/dist/index311.js +14 -234
  163. package/dist/index312.js +83 -5
  164. package/dist/index313.js +190 -122
  165. package/dist/index314.js +239 -61
  166. package/dist/index315.js +3 -87
  167. package/dist/index316.js +26 -28
  168. package/dist/index317.js +77 -7
  169. package/dist/index318.js +21 -74
  170. package/dist/index319.js +934 -3
  171. package/dist/index320.js +22 -2
  172. package/dist/index321.js +19 -82
  173. package/dist/index322.js +19 -53
  174. package/dist/index323.js +68 -5
  175. package/dist/index324.js +19 -5
  176. package/dist/index325.js +18 -178
  177. package/dist/index326.js +21 -62
  178. package/dist/index327.js +22 -75
  179. package/dist/index328.js +62 -36
  180. package/dist/index329.js +20 -19
  181. package/dist/index330.js +55 -19
  182. package/dist/index331.js +28 -63
  183. package/dist/index332.js +7 -37
  184. package/dist/index333.js +51 -8
  185. package/dist/index334.js +6 -13
  186. package/dist/index335.js +11 -54
  187. package/dist/index336.js +7 -12
  188. package/dist/index337.js +28 -14
  189. package/dist/index338.js +2 -58
  190. package/dist/index339.js +69 -51
  191. package/dist/index340.js +164 -28
  192. package/dist/index341.js +37 -2
  193. package/dist/index342.js +9 -5
  194. package/dist/index343.js +13 -2
  195. package/dist/index344.js +54 -22
  196. package/dist/index345.js +10 -39
  197. package/dist/index346.js +14 -2
  198. package/dist/index347.js +58 -11
  199. package/dist/index348.js +50 -18
  200. package/dist/index349.js +29 -15
  201. package/dist/index350.js +2 -10
  202. package/dist/index351.js +4 -9
  203. package/dist/index352.js +2 -2
  204. package/dist/index353.js +22 -8
  205. package/dist/index354.js +40 -9
  206. package/dist/index355.js +2 -14
  207. package/dist/index356.js +11 -21
  208. package/dist/index357.js +18 -54
  209. package/dist/index358.js +16 -28
  210. package/dist/index359.js +10 -7
  211. package/dist/index360.js +9 -51
  212. package/dist/index361.js +2 -6
  213. package/dist/index362.js +9 -12
  214. package/dist/index363.js +10 -7
  215. package/dist/index364.js +13 -27
  216. package/dist/index365.js +20 -2
  217. package/dist/index366.js +20 -70
  218. package/dist/index367.js +60 -163
  219. package/dist/index368.js +36 -100
  220. package/dist/index369.js +30 -90
  221. package/dist/index370.js +11 -98
  222. package/dist/index371.js +4 -17
  223. package/dist/index372.js +3 -30
  224. package/dist/index373.js +13 -11
  225. package/dist/index374.js +7 -4
  226. package/dist/index375.js +11 -3
  227. package/dist/index376.js +5 -13
  228. package/dist/index377.js +33 -7
  229. package/dist/index378.js +30 -11
  230. package/dist/index379.js +28 -5
  231. package/dist/index380.js +61 -33
  232. package/dist/index381.js +99 -29
  233. package/dist/index382.js +91 -28
  234. package/dist/index383.js +96 -59
  235. package/dist/index384.js +17 -3
  236. package/dist/index385.js +3 -2
  237. package/dist/index386.js +2 -2
  238. package/dist/index387.js +2 -17
  239. package/dist/index388.js +15 -11
  240. package/dist/index389.js +13 -6
  241. package/dist/index39.js +44 -14
  242. package/dist/index390.js +6 -32
  243. package/dist/index391.js +34 -0
  244. package/dist/index40.js +1 -1
  245. package/dist/index41.js +1 -1
  246. package/dist/index42.js +1 -1
  247. package/dist/index43.js +72 -49
  248. package/dist/index44.js +1 -1
  249. package/dist/index45.js +1 -1
  250. package/dist/index46.js +1 -1
  251. package/dist/index47.js +2 -2
  252. package/dist/index48.js +2 -2
  253. package/dist/index49.js +1 -1
  254. package/dist/index50.js +1 -1
  255. package/dist/index51.js +1 -1
  256. package/dist/index52.js +1 -1
  257. package/dist/index54.js +2 -2
  258. package/dist/index56.js +1 -1
  259. package/dist/index58.js +5 -5
  260. package/dist/index59.js +1 -1
  261. package/dist/index71.js +2 -2
  262. package/dist/index75.js +1 -1
  263. package/dist/index80.js +1 -1
  264. package/dist/index85.js +1 -1
  265. package/dist/index87.js +3 -3
  266. package/dist/index89.js +2 -2
  267. package/dist/index95.js +2 -2
  268. package/dist/src/components/comment/comment.d.ts +32 -0
  269. package/dist/src/components/comment/comment.stories.d.ts +32 -0
  270. package/dist/src/components/comment-section/comment-section.d.ts +32 -0
  271. package/dist/src/components/comment-section/comment-section.stories.d.ts +32 -0
  272. package/dist/src/components/data-filter/data-filter.d.ts +32 -0
  273. package/dist/src/components/data-list/data-list.d.ts +32 -0
  274. package/dist/src/components/grid/grid.stories.d.ts +64 -0
  275. package/dist/src/components/popover/popover.d.ts +36 -0
  276. package/dist/src/components/popover/popover.stories.d.ts +128 -0
  277. package/dist/src/components/room-details-popover/room-details-popover.d.ts +106 -4
  278. package/dist/src/views/lists.vue.d.ts +64 -0
  279. package/dist/src/views/tables.vue.d.ts +32 -0
  280. package/package.json +1 -1
  281. package/dist/index160.js +0 -116
  282. package/dist/index176.js +0 -20
  283. package/dist/index187.js +0 -1192
  284. /package/dist/{index133.js → index134.js} +0 -0
  285. /package/dist/{index135.js → index136.js} +0 -0
  286. /package/dist/{index137.js → index138.js} +0 -0
  287. /package/dist/{index145.js → index146.js} +0 -0
  288. /package/dist/{index147.js → index148.js} +0 -0
  289. /package/dist/{index149.js → index150.js} +0 -0
  290. /package/dist/{index155.js → index156.js} +0 -0
@@ -1,31 +1,31 @@
1
- import { defineComponent as Ve, ref as i, computed as h, watch as F, onMounted as Ze, onUnmounted as et } from "vue";
2
- import { useI18n as tt } from "vue-i18n";
3
- import { DateTime as y } from "./index162.js";
4
- import "./index185.js";
5
- import at from "./index2.js";
6
- import ot from "./index3.js";
7
- import st from "./index13.js";
8
- import nt from "./index21.js";
9
- import rt from "./index28.js";
1
+ import { defineComponent as Ke, ref as i, computed as h, watch as F, onMounted as Ve, onUnmounted as Ze } from "vue";
2
+ import { useI18n as et } from "vue-i18n";
3
+ import { DateTime as g } from "./index163.js";
4
+ import "./index188.js";
5
+ import tt from "./index2.js";
6
+ import at from "./index3.js";
7
+ import ot from "./index13.js";
8
+ import st from "./index21.js";
9
+ import nt from "./index28.js";
10
10
  import lt from "./index39.js";
11
- import ut from "./index20.js";
12
- import it from "./index46.js";
13
- import ct from "./index47.js";
14
- import dt from "./index49.js";
15
- import G from "./index186.js";
16
- const Ct = Ve({
11
+ import rt from "./index20.js";
12
+ import ut from "./index46.js";
13
+ import it from "./index47.js";
14
+ import ct from "./index49.js";
15
+ import X from "./index189.js";
16
+ const Ot = Ke({
17
17
  name: "QRoomDetailsPopover",
18
18
  components: {
19
- QAccordion: at,
20
- QActivityItem: ot,
21
- QCommentSection: st,
22
- QDatePicker: ut,
23
- QDivider: nt,
24
- QIcon: rt,
19
+ QAccordion: tt,
20
+ QActivityItem: at,
21
+ QCommentSection: ot,
22
+ QDatePicker: rt,
23
+ QDivider: st,
24
+ QIcon: nt,
25
25
  QPopover: lt,
26
- QTag: it,
27
- QTextarea: ct,
28
- QTooltip: dt
26
+ QTag: ut,
27
+ QTextarea: it,
28
+ QTooltip: ct
29
29
  },
30
30
  props: {
31
31
  id: {
@@ -123,11 +123,25 @@ const Ct = Ve({
123
123
  allowWhenWhere: {
124
124
  type: Boolean,
125
125
  default: !1
126
+ },
127
+ quickReplies: {
128
+ type: Array,
129
+ default: () => []
130
+ },
131
+ /** Set if the popover is teleported to the body (escapes overflow clipping) */
132
+ teleport: {
133
+ type: Boolean,
134
+ default: !1
135
+ },
136
+ /** Target element for teleport */
137
+ teleportTo: {
138
+ type: String,
139
+ default: "body"
126
140
  }
127
141
  },
128
142
  emits: ["create:callback", "create:todo", "refresh:pms", "toggle"],
129
- setup(s, { emit: I }) {
130
- const { t: v } = tt(), l = i(null), K = i(!1), V = i("left"), j = i([
143
+ setup(s, { emit: D }) {
144
+ const { t: v } = et(), r = i(null), K = i(!1), V = i("left"), G = i([
131
145
  {
132
146
  id: 1,
133
147
  label: v("HC_DEPARTMENT")
@@ -151,19 +165,19 @@ const Ct = Ve({
151
165
  guestMood: null,
152
166
  guestName: "",
153
167
  guestPhone: "",
154
- inHouse: !!l.value?.tokenId || !1,
168
+ inHouse: !!r.value?.tokenId || !1,
155
169
  problem: null,
156
170
  notes: "",
157
- tokenId: l.value?.tokenId
158
- }), H = i(250), P = i(290), C = i([]), de = i([]), Z = i(!0), U = i(!0), E = i({
171
+ tokenId: r.value?.tokenId
172
+ }), H = i(250), P = i(290), C = i([]), ce = i([]), Z = i(!0), j = i(!0), E = i({
159
173
  info: !0,
160
174
  tickets: !0,
161
175
  comments: !0
162
- }), Q = i(!0), _e = i(s.guestDetails), w = i([]), b = i({
176
+ }), U = i(!0), we = i(s.guestDetails), w = i([]), b = i({
163
177
  pms: !1,
164
178
  roomNotices: !1,
165
179
  tickets: !1
166
- }), ee = i([]), te = i([]), ae = i("bottom"), M = i(null), oe = i([]), R = i(!1), S = i(!1), O = i(null), u = i({
180
+ }), ee = i([]), te = i([]), ae = i("bottom"), R = i(null), S = i(!1), N = i(!1), O = i(null), u = i({
167
181
  assignType: null,
168
182
  department: null,
169
183
  due: /* @__PURE__ */ new Date(),
@@ -184,12 +198,12 @@ const Ct = Ve({
184
198
  label: v("HC_HOTEL_GUEST")
185
199
  // need to localize
186
200
  }
187
- ]), ke = i(!1), k = i(null), g = i({
201
+ ]), ke = i(!1), _ = i(null), y = i({
188
202
  endDate: /* @__PURE__ */ new Date(),
189
203
  issue: null,
190
204
  notes: "",
191
205
  startDate: /* @__PURE__ */ new Date()
192
- }), $ = i([]), J = i(!1), D = i([]), L = i([]), De = i([
206
+ }), Q = i([]), $ = i(!1), I = i([]), L = i([]), _e = i([
193
207
  {
194
208
  label: v("HC_COMPLAINT"),
195
209
  id: "complaint"
@@ -206,7 +220,7 @@ const Ct = Ve({
206
220
  label: v("HC_WORK_ORDER"),
207
221
  id: "work_order"
208
222
  }
209
- ]), x = i(), N = i(null), d = i({
223
+ ]), x = i(), M = i(null), d = i({
210
224
  assignType: null,
211
225
  department: null,
212
226
  due: /* @__PURE__ */ new Date(),
@@ -215,8 +229,8 @@ const Ct = Ve({
215
229
  notes: "",
216
230
  person: null,
217
231
  requestedBy: null
218
- }), se = i([]), q = i([]), A = i([]), ne = h(() => {
219
- switch (l.value.cleaning?.name) {
232
+ }), oe = i([]), q = i([]), A = i([]), se = h(() => {
233
+ switch (r.value.cleaning?.name) {
220
234
  case "CLEAN":
221
235
  case "INSPECTED":
222
236
  return "CLEAN";
@@ -228,14 +242,14 @@ const Ct = Ve({
228
242
  default:
229
243
  return "";
230
244
  }
231
- }), Ie = h(() => ne.value === "CLEAN" ? "blue-10" : ne.value === "DIRTY" ? "red-10" : "gray-30"), Te = h(() => v(`HC_${l.value.cleaning?.name}`) || ""), be = h(() => {
245
+ }), Ie = h(() => se.value === "CLEAN" ? "blue-10" : se.value === "DIRTY" ? "red-10" : "gray-30"), De = h(() => v(`HC_${r.value.cleaning?.name}`) || ""), Te = h(() => {
232
246
  const e = T.value.toLowerCase();
233
- return oe.value.filter((a) => a.toLowerCase().match(e));
234
- }), me = h(() => D.value.length ? !!D.value.find(
247
+ return s.quickReplies.filter((a) => a.toLowerCase().match(e));
248
+ }), de = h(() => I.value.length ? !!I.value.find(
235
249
  (a) => a.type === "complaint"
236
- ) : !1), Oe = h(() => D.value.length ? !!D.value.find(
250
+ ) : !1), be = h(() => I.value.length ? !!I.value.find(
237
251
  (a) => a.type === "callback"
238
- ) : !1), Ce = h(() => {
252
+ ) : !1), Oe = h(() => {
239
253
  let e = [];
240
254
  return w.value[0] && w.value[0].options === void 0 ? w.value.forEach((a) => {
241
255
  e.push({
@@ -243,17 +257,17 @@ const Ct = Ve({
243
257
  label: a.display_name
244
258
  });
245
259
  }) : e = w.value, e;
246
- }), pe = h(() => l.value.occupancy?.name === "OCCUPIED"), Ee = h(() => pe.value && me.value ? "HK_ROOM_STATUS_Occupied_Complaint" : "HK_ROOM_STATUS_Occupied"), Me = h(() => {
247
- switch (k.value?.id) {
260
+ }), me = h(() => r.value.occupancy?.name === "OCCUPIED"), Ce = h(() => me.value && de.value ? "HK_ROOM_STATUS_Occupied_Complaint" : "HK_ROOM_STATUS_Occupied"), Ee = h(() => {
261
+ switch (_.value?.id) {
248
262
  case "request":
249
263
  case "work_order":
250
- return j.value[0];
264
+ return G.value[0];
251
265
  default:
252
266
  return null;
253
267
  }
254
- }), Re = h(() => {
268
+ }), Me = h(() => {
255
269
  if (C.value)
256
- switch (k.value?.id) {
270
+ switch (_.value?.id) {
257
271
  case "request":
258
272
  return C.value.find((e) => parseInt(e.id) === 4);
259
273
  case "work_order":
@@ -262,8 +276,8 @@ const Ct = Ve({
262
276
  return null;
263
277
  }
264
278
  return null;
265
- }), Se = h(() => {
266
- switch (k.value?.id) {
279
+ }), Re = h(() => {
280
+ switch (_.value?.id) {
267
281
  case "request":
268
282
  return B.value[1];
269
283
  case "work_order":
@@ -271,27 +285,27 @@ const Ct = Ve({
271
285
  default:
272
286
  return null;
273
287
  }
274
- }), Ne = h(() => {
288
+ }), Se = h(() => {
275
289
  let e = "";
276
- if (l.value && l.value.reservations[0]) {
277
- const a = y.fromISO(
278
- l.value.reservations[0].arrivalDate
279
- ), t = a.toFormat("MMM"), o = a.day, n = a.year, r = y.fromISO(
280
- l.value.reservations[0].departureDate
281
- ), c = r.toFormat("MMM"), m = r.day, f = r.year;
290
+ if (r.value && r.value.reservations[0]) {
291
+ const a = g.fromISO(
292
+ r.value.reservations[0].arrivalDate
293
+ ), t = a.toFormat("MMM"), o = a.day, n = a.year, l = g.fromISO(
294
+ r.value.reservations[0].departureDate
295
+ ), c = l.toFormat("MMM"), m = l.day, f = l.year;
282
296
  e += t + " " + o, n !== f && (e += ", " + n), t === c ? e += "-" + m : e += " - " + c + " " + m, e += ", " + f;
283
297
  }
284
298
  return e;
285
- }), qe = h(() => {
286
- let e = $.value;
299
+ }), Ne = h(() => {
300
+ let e = Q.value;
287
301
  return e = [...new Set(e)], e;
288
- }), Ae = h(() => {
289
- const e = k.value?.id;
302
+ }), qe = h(() => {
303
+ const e = _.value?.id;
290
304
  if (!e)
291
305
  return !1;
292
306
  switch (e) {
293
307
  case "room_notice":
294
- return g.value.issue && g.value.startDate && g.value.endDate;
308
+ return y.value.issue && y.value.startDate && y.value.endDate;
295
309
  case "complaint":
296
310
  return p.value.problem && p.value.guestName && p.value.guestMood;
297
311
  case "work_order":
@@ -303,15 +317,15 @@ const Ct = Ve({
303
317
  default:
304
318
  return !1;
305
319
  }
306
- }), ve = () => {
307
- J.value = !1, R.value = !1, K.value = !1, w.value = [], te.value = [], se.value = [], q.value = [], A.value = [], k.value = null, g.value.issue = null, g.value.startDate = /* @__PURE__ */ new Date(), g.value.endDate = /* @__PURE__ */ new Date(), g.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 = "", d.value.assignType = null, d.value.department = null, d.value.person = null, d.value.due = /* @__PURE__ */ new Date(), d.value.item = null, d.value.issue = null, d.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;
308
- }, He = async () => {
309
- I("create:callback", l.value), I("toggle", !1);
310
- }, Y = (e) => {
320
+ }), pe = () => {
321
+ $.value = !1, S.value = !1, K.value = !1, w.value = [], te.value = [], oe.value = [], q.value = [], A.value = [], _.value = null, y.value.issue = null, y.value.startDate = /* @__PURE__ */ new Date(), y.value.endDate = /* @__PURE__ */ new Date(), y.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 = "", d.value.assignType = null, d.value.department = null, d.value.person = null, d.value.due = /* @__PURE__ */ new Date(), d.value.item = null, d.value.issue = null, d.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;
322
+ }, Ae = async () => {
323
+ D("create:callback", r.value), D("toggle", !1);
324
+ }, J = (e) => {
311
325
  const a = [];
312
326
  (Array.isArray(e) ? e : Object.values(e)).forEach((o) => {
313
- const n = o.senderType || o.sender_type, r = o.senderName || "", c = o.senderId || o.sender_id, m = o.profileImg || o.profile_img, f = r ? r.split(" ") : ["", ""], X = o.user_first_name || o.guest_first_name || f[0] || "", Ke = o.user_last_name || o.guest_last_name || f.slice(1).join(" ") || "";
314
- let _ = {
327
+ const n = o.senderType || o.sender_type, l = o.senderName || "", c = o.senderId || o.sender_id, m = o.profileImg || o.profile_img, f = l ? l.split(" ") : ["", ""], z = o.user_first_name || o.guest_first_name || f[0] || "", Xe = o.user_last_name || o.guest_last_name || f.slice(1).join(" ") || "";
328
+ let k = {
315
329
  id: o.id,
316
330
  isPropertyEmployee: n === "user",
317
331
  isSent: !!o.sent,
@@ -319,20 +333,20 @@ const Ct = Ve({
319
333
  message: o.content,
320
334
  timestamp: o.sent || o.created,
321
335
  user: {
322
- firstName: X || "Auto-Reply",
336
+ firstName: z || "Auto-Reply",
323
337
  icon: "",
324
338
  id: c || "system-message",
325
339
  initials: "",
326
- lastName: Ke || "",
340
+ lastName: Xe || "",
327
341
  src: m || ""
328
342
  }
329
343
  };
330
- _.user.firstName && _.user.lastName ? _.user.initials = _.user.firstName[0] + _.user.lastName[0] : _.user.firstName && (_.user.initials = _.user.firstName[0]), _.isSystemMessage && (_.user.icon = "property-fill"), a.push(_);
344
+ k.user.firstName && k.user.lastName ? k.user.initials = k.user.firstName[0] + k.user.lastName[0] : k.user.firstName && (k.user.initials = k.user.firstName[0]), k.isSystemMessage && (k.user.icon = "property-fill"), a.push(k);
331
345
  }), ee.value = a;
332
- }, fe = async () => {
333
- if (s.showComments && l.value.tokenId)
346
+ }, ve = async () => {
347
+ if (s.showComments && r.value.tokenId)
334
348
  try {
335
- let e = `/api/client/connect/getMessages.php?tokenId=${l.value.tokenId}`;
349
+ let e = `/api/client/connect/getMessages.php?tokenId=${r.value.tokenId}`;
336
350
  O.value !== null && (e += `&lastMsgId=${O.value}`);
337
351
  const t = await (await fetch(e, {
338
352
  method: "GET",
@@ -340,12 +354,12 @@ const Ct = Ve({
340
354
  })).json();
341
355
  if (t.status === "error")
342
356
  throw new Error(t.message || "Failed to get messages");
343
- S.value = !t.closed, t.messages && t.messages.length > 0 && (O.value = t.messages[t.messages.length - 1].id), Y(t.messages || []);
357
+ N.value = !t.closed, t.messages && t.messages.length > 0 && (O.value = t.messages[t.messages.length - 1].id), J(t.messages || []);
344
358
  } catch (e) {
345
359
  console.error("getChatMessages error:", e);
346
360
  }
347
- }, Pe = (e) => {
348
- const a = y.utc(), t = y.fromFormat(e, "yyyy-MM-dd HH:mm:ss", { zone: "utc" }), o = a.diff(
361
+ }, He = (e) => {
362
+ const a = g.utc(), t = g.fromFormat(e, "yyyy-MM-dd HH:mm:ss", { zone: "utc" }), o = a.diff(
349
363
  t,
350
364
  [
351
365
  "years",
@@ -354,11 +368,11 @@ const Ct = Ve({
354
368
  "hours",
355
369
  "minutes"
356
370
  ]
357
- ), n = Math.floor(o.years), r = Math.floor(o.months), c = Math.floor(o.days), m = Math.floor(o.hours), f = Math.floor(o.minutes);
371
+ ), n = Math.floor(o.years), l = Math.floor(o.months), c = Math.floor(o.days), m = Math.floor(o.hours), f = Math.floor(o.minutes);
358
372
  if (n)
359
373
  return n === 1 ? v("HC_ONE_YEAR_AGO") : v("HC_X_YEARS_AGO", { years: n });
360
- if (r)
361
- return r === 1 ? v("HC_ONE_MONTH_AGO") : v("HC_X_MONTHS_AGO", { months: r });
374
+ if (l)
375
+ return l === 1 ? v("HC_ONE_MONTH_AGO") : v("HC_X_MONTHS_AGO", { months: l });
362
376
  if (c)
363
377
  return c === 1 ? v("HC_ONE_DAY_AGO") : v("HC_X_DAYS_AGO", { days: c });
364
378
  if (m)
@@ -367,9 +381,9 @@ const Ct = Ve({
367
381
  return f === 1 ? v("HC_ONE_MINUTE_AGO") : v("HC_X_MINUTES_AGO", { minutes: f });
368
382
  if (f === 0)
369
383
  return v("HC_A_MOMENT_AGO");
370
- }, Be = async () => {
371
- s.showGuestDetails && re(), z(), W(), I("refresh:pms", l.value);
372
- }, re = async () => {
384
+ }, Pe = async () => {
385
+ s.showGuestDetails && ne(), Y(), W(), D("refresh:pms", r.value);
386
+ }, ne = async () => {
373
387
  try {
374
388
  b.value.pms = !0;
375
389
  const e = new AbortController(), a = setTimeout(() => e.abort(), 45e3);
@@ -391,15 +405,15 @@ const Ct = Ve({
391
405
  signal: e.signal
392
406
  }
393
407
  );
394
- clearTimeout(a), n.ok || ge(n);
395
- const r = await n.json();
396
- M.value = r.data.pmsRooms, l.value = M.value.find(
408
+ clearTimeout(a), n.ok || he(n);
409
+ const l = await n.json();
410
+ R.value = l.data.pmsRooms, r.value = R.value.find(
397
411
  (c) => c.qv2Rooms.qRoomId === s.room.id
398
- ), l.value || (l.value = s.room), b.value.pms = !1;
412
+ ), r.value || (r.value = s.room), b.value.pms = !1;
399
413
  } catch (e) {
400
414
  return b.value.pms = !1, e;
401
415
  }
402
- }, z = async () => {
416
+ }, Y = async () => {
403
417
  try {
404
418
  b.value.roomNotices = !0;
405
419
  const e = await fetch(
@@ -408,9 +422,9 @@ const Ct = Ve({
408
422
  if (!e.ok)
409
423
  throw new Error(`HTTP error! status: ${e.status}`);
410
424
  const a = await e.json();
411
- $.value = a.notices;
425
+ Q.value = a.notices;
412
426
  } catch (e) {
413
- console.error("Error getting room notices:", e), $.value = [];
427
+ console.error("Error getting room notices:", e), Q.value = [];
414
428
  } finally {
415
429
  b.value.roomNotices = !1;
416
430
  }
@@ -426,37 +440,38 @@ const Ct = Ve({
426
440
  body: e
427
441
  })
428
442
  ]), o = await a.json(), n = await t.json();
429
- if (o.departments && (o.departments.forEach((r) => {
430
- r.label = r.display_name;
443
+ if (o.departments && (o.departments.forEach((l) => {
444
+ l.label = l.display_name;
431
445
  }), C.value = o.departments), n.users) {
432
- const r = [];
446
+ const l = [];
433
447
  let c = {
434
448
  group: "",
435
449
  options: []
436
450
  };
437
451
  n.users.forEach((m) => {
438
- m.translated_department !== c.group && (c.group && r.push({ ...c }), c.group = m.translated_department, c.options = []), c.options.push(m);
439
- }), c.group && r.push({ ...c }), de.value = r;
452
+ m.translated_department !== c.group && (c.group && l.push({ ...c }), c.group = m.translated_department, c.options = []), c.options.push(m);
453
+ }), c.group && l.push({ ...c }), ce.value = l;
440
454
  }
441
- }, he = async () => {
455
+ }, fe = async () => {
442
456
  try {
443
- const e = new FormData();
444
- e.append("funcname", "get_stay_details"), e.append("token_id", l.value.tokenId);
445
- const t = (await G.post(
446
- "/includes/chat_api.php",
447
- e
448
- )).data.result;
449
- if (t !== void 0 && t.error_message)
450
- throw new Error(t.error_message);
451
- t && t.user_name && (p.value.guestName = t.user_name), t && t.cell_phone && (p.value.guestPhone = t.cell_phone), t && t.email && (p.value.guestEmail = t.email), t && t.check_in && (p.value.checkInDate = y.fromISO(
452
- t.check_in
453
- ).toJSDate()), t && t.check_out && (p.value.checkOutDate = y.fromISO(
454
- t.check_out
457
+ const a = await (await fetch(
458
+ `/api/client/connect/getStayDetails.php?tokenId=${r.value.tokenId}`,
459
+ {
460
+ method: "GET",
461
+ credentials: "include"
462
+ }
463
+ )).json();
464
+ if (a.status === "error")
465
+ throw new Error(a.message || "Failed to get stay details");
466
+ a.userName && (p.value.guestName = a.userName), a.cellPhone && (p.value.guestPhone = a.cellPhone), a.email && (p.value.guestEmail = a.email), a.checkIn && (p.value.checkInDate = g.fromISO(
467
+ a.checkIn
468
+ ).toJSDate()), a.checkOut && (p.value.checkOutDate = g.fromISO(
469
+ a.checkOut
455
470
  ).toJSDate());
456
471
  } catch (e) {
457
- console.log(e);
472
+ console.error("getStayDetails error:", e);
458
473
  }
459
- }, Le = (e) => {
474
+ }, Be = (e) => {
460
475
  switch (e) {
461
476
  case "complaint":
462
477
  return "red-30";
@@ -469,7 +484,7 @@ const Ct = Ve({
469
484
  case "task":
470
485
  return "green-20";
471
486
  }
472
- }, xe = (e) => {
487
+ }, Le = (e) => {
473
488
  switch (e) {
474
489
  case "complaint":
475
490
  return "face-frown";
@@ -491,13 +506,13 @@ const Ct = Ve({
491
506
  if (!e.ok)
492
507
  throw new Error(`HTTP error! status: ${e.status}`);
493
508
  const a = await e.json();
494
- D.value = a.tickets;
509
+ I.value = a.tickets;
495
510
  } catch (e) {
496
- console.error("Error getting tickets:", e), D.value = [];
511
+ console.error("Error getting tickets:", e), I.value = [];
497
512
  } finally {
498
513
  b.value.tickets = !1;
499
514
  }
500
- }, ge = async (e) => {
515
+ }, he = async (e) => {
501
516
  const a = await e.text();
502
517
  let t;
503
518
  try {
@@ -506,10 +521,10 @@ const Ct = Ve({
506
521
  t = { code: e.status, message: a };
507
522
  }
508
523
  return t.code === 401 ? (window.location.href = "/logout.php?unauthorized=1", { error: t }) : t;
509
- }, We = (e) => {
524
+ }, xe = (e) => {
510
525
  const a = document.querySelectorAll(".pulse");
511
526
  if (a && a.length) {
512
- const t = l.value?.qv2Rooms?.qRoomId || l.value?.id || s.room?.id, o = document.getElementById("room-" + t), n = o?.classList;
527
+ const t = r.value?.qv2Rooms?.qRoomId || r.value?.id || s.room?.id, o = document.getElementById("room-" + t), n = o?.classList;
513
528
  switch (e) {
514
529
  case "room_notice":
515
530
  (n?.contains("roombox_unsel") || n?.contains("roombox_unsel_active")) && (o?.classList.remove(), o?.classList.add("roomnoticeroombox_sel"));
@@ -524,16 +539,16 @@ const Ct = Ve({
524
539
  !n?.contains("smsroombox_sel") && !n?.contains("callbackroombox_sel") && !n?.contains("complaintsroombox_sel") && !n?.contains("guestrequestroombox_sel") && (o?.classList.remove(), o?.classList.add("workordersroombox_sel"));
525
540
  break;
526
541
  }
527
- const r = setTimeout(() => {
542
+ const l = setTimeout(() => {
528
543
  a.forEach((c) => {
529
544
  c.classList.remove("pulse");
530
545
  });
531
546
  }, 4500);
532
- L.value.push(r);
547
+ L.value.push(l);
533
548
  }
534
- }, Fe = () => {
535
- window.location.href = "/guest/overview.php";
536
- }, Ge = (e) => {
549
+ }, We = () => {
550
+ window.open("/guest/overview.php", "_blank");
551
+ }, Fe = (e) => {
537
552
  let a = "";
538
553
  switch (e.type) {
539
554
  case "complaint":
@@ -554,54 +569,54 @@ const Ct = Ve({
554
569
  default:
555
570
  return "#";
556
571
  }
557
- window.open(a);
558
- }, je = async () => {
559
- const e = l.value?.qv2Rooms?.qRoomId || l.value?.id || s.room?.id, a = l.value?.qv2Rooms?.qRoomName || l.value?.name || s.room?.name, t = {
560
- type: k.value?.id,
572
+ window.open(a, "_blank");
573
+ }, Ge = async () => {
574
+ const e = r.value?.qv2Rooms?.qRoomId || r.value?.id || s.room?.id, a = r.value?.qv2Rooms?.qRoomName || r.value?.name || s.room?.name, t = {
575
+ type: _.value?.id,
561
576
  propertyId: s.propertyId,
562
- userId: N.value,
577
+ userId: M.value,
563
578
  areaId: e,
564
579
  areaName: a
565
580
  };
566
- switch (k.value?.id) {
581
+ switch (_.value?.id) {
567
582
  case "complaint":
568
- t.tokenId = l.value.tokenId, t.problemId = p.value.problem.id, t.guestName = p.value.guestName, t.guestPhone = p.value.guestPhone, t.guestEmail = p.value.guestEmail, t.guestLoyalty = p.value.guestLoyalty, t.guestMood = p.value.guestMood.id, t.checkInDate = y.fromJSDate(p.value.checkInDate).toFormat(
583
+ t.tokenId = r.value.tokenId, t.problemId = p.value.problem.id, t.guestName = p.value.guestName, t.guestPhone = p.value.guestPhone, t.guestEmail = p.value.guestEmail, t.guestLoyalty = p.value.guestLoyalty, t.guestMood = p.value.guestMood.id, t.checkInDate = g.fromJSDate(p.value.checkInDate).toFormat(
569
584
  "yyyy-MM-dd"
570
- ), t.notes = p.value.notes, t.inHouse = "2", t.source = "dashboard", I("create:todo", t);
585
+ ), t.notes = p.value.notes, t.inHouse = "2", t.source = "dashboard", D("create:todo", t);
571
586
  break;
572
587
  case "request":
573
- 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 = y.fromJSDate(u.value.due).toFormat("yyyy-MM-dd"), u.value.assignType.id === 1 && (t.department = u.value.department.id), u.value.assignType.id === 2 && (t.person = u.value.person.id), s.allowWhenWhere && (t.requestWhen = u.value.when ? u.value.when.id : "", t.requestWhere = u.value.where ? u.value.where.id : ""), I("create:todo", t);
588
+ 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 = g.fromJSDate(u.value.due).toFormat("yyyy-MM-dd"), u.value.assignType.id === 1 && (t.department = u.value.department.id), u.value.assignType.id === 2 && (t.person = u.value.person.id), s.allowWhenWhere && (t.requestWhen = u.value.when ? u.value.when.id : "", t.requestWhere = u.value.where ? u.value.where.id : ""), D("create:todo", t);
574
589
  break;
575
590
  case "room_notice":
576
- t.issueId = g.value.issue.id, t.startDate = y.fromJSDate(g.value.startDate).toFormat("yyyy-MM-dd"), t.endDate = y.fromJSDate(g.value.endDate).toFormat("yyyy-MM-dd"), t.notes = g.value.notes, t.sendPush = "1", I("create:todo", t);
591
+ t.issueId = y.value.issue.id, t.startDate = g.fromJSDate(y.value.startDate).toFormat("yyyy-MM-dd"), t.endDate = g.fromJSDate(y.value.endDate).toFormat("yyyy-MM-dd"), t.notes = y.value.notes, t.sendPush = "1", D("create:todo", t);
577
592
  break;
578
593
  case "work_order":
579
- t.itemId = d.value.item.id, t.issueId = d.value.issue.id, t.assignType = d.value.assignType.id, t.occupied = d.value.requestedBy.id, t.notes = d.value.notes, t.dueDate = y.fromJSDate(d.value.due).toFormat("yyyy-MM-dd"), d.value.assignType.id === 1 && (t.department = d.value.department.id), d.value.assignType.id === 2 && (t.person = d.value.person.id), I("create:todo", t);
594
+ t.itemId = d.value.item.id, t.issueId = d.value.issue.id, t.assignType = d.value.assignType.id, t.occupied = d.value.requestedBy.id, t.notes = d.value.notes, t.dueDate = g.fromJSDate(d.value.due).toFormat("yyyy-MM-dd"), d.value.assignType.id === 1 && (t.department = d.value.department.id), d.value.assignType.id === 2 && (t.person = d.value.person.id), D("create:todo", t);
580
595
  break;
581
596
  }
597
+ }, je = (e) => {
598
+ ue(), ie(), s.hover && D("toggle", e);
582
599
  }, Ue = (e) => {
583
- ie(), ce(), s.hover && I("toggle", e);
584
- }, Qe = (e) => {
585
- we(), T.value = e;
586
- }, $e = async (e) => {
587
- if (console.log("selected:", e), k.value = e, w.value = [], g.value.issue = null, p.value.problem = null, d.value.item = null, d.value.issue = null, u.value.item = null, !k.value)
600
+ ge(), T.value = e;
601
+ }, Qe = async (e) => {
602
+ if (console.log("selected:", e), _.value = e, w.value = [], y.value.issue = null, p.value.problem = null, d.value.item = null, d.value.issue = null, u.value.item = null, !_.value)
588
603
  return;
589
- const a = l.value?.qv2Rooms?.qRoomId || l.value?.id || s.room?.id, t = new FormData();
604
+ const a = r.value?.qv2Rooms?.qRoomId || r.value?.id || s.room?.id, t = new FormData();
590
605
  switch (t.append("property_id", s.propertyId), t.append("area_id", a), e.id) {
591
606
  case "complaint":
592
607
  try {
593
- l.value.tokenId && await he();
608
+ r.value.tokenId && await fe();
594
609
  const n = await (await fetch("/api/client/common/getComplaintProblemsByPropertyId.php", {
595
610
  method: "POST",
596
611
  body: t
597
612
  })).json();
598
613
  n.items && (w.value = n.items);
599
- const r = await G.post(
614
+ const l = await X.post(
600
615
  "/api/client/common/getComplaintMoods.php"
601
616
  );
602
- r.data.items.forEach((c) => {
617
+ l.data.items.forEach((c) => {
603
618
  c.label = c.display_name;
604
- }), te.value = r.data.items;
619
+ }), te.value = l.data.items;
605
620
  } catch (o) {
606
621
  console.log(o);
607
622
  }
@@ -619,22 +634,22 @@ const Ct = Ve({
619
634
  break;
620
635
  case "request":
621
636
  try {
622
- u.value.requestedBy = B.value[1], u.value.assignType = j.value[0];
637
+ u.value.requestedBy = B.value[1], u.value.assignType = G.value[0];
623
638
  const n = await (await fetch("/api/client/common/getHousekeepingItemsByPropertyId.php", {
624
639
  method: "POST",
625
640
  body: t
626
641
  })).json();
627
642
  if (n.items && (w.value = n.items), await le(), u.value.department = C.value.find(
628
- (r) => parseInt(r.id) === 4
643
+ (l) => parseInt(l.id) === 4
629
644
  ), s.allowWhenWhere)
630
645
  try {
631
- const r = new FormData();
632
- r.append("property_id", s.propertyId);
646
+ const l = new FormData();
647
+ l.append("property_id", s.propertyId);
633
648
  const m = await (await fetch(
634
649
  "/api/client/common/getWhenWhereOptions.php",
635
650
  {
636
651
  method: "POST",
637
- body: r
652
+ body: l
638
653
  }
639
654
  )).json();
640
655
  m.when && Array.isArray(m.when) ? q.value = m.when.map((f) => ({
@@ -646,8 +661,8 @@ const Ct = Ve({
646
661
  label: f.name,
647
662
  value: f.id
648
663
  })) : A.value = [];
649
- } catch (r) {
650
- console.log("Error loading When/Where options:", r), q.value = [], A.value = [];
664
+ } catch (l) {
665
+ console.log("Error loading When/Where options:", l), q.value = [], A.value = [];
651
666
  }
652
667
  } catch (o) {
653
668
  console.log(o);
@@ -655,27 +670,27 @@ const Ct = Ve({
655
670
  break;
656
671
  case "work_order":
657
672
  try {
658
- d.value.requestedBy = B.value[0], d.value.assignType = j.value[0];
673
+ d.value.requestedBy = B.value[0], d.value.assignType = G.value[0];
659
674
  const n = await (await fetch("/api/client/common/getItemsByRoomId.php", {
660
675
  method: "POST",
661
676
  body: t
662
- })).json(), r = [];
677
+ })).json(), l = [];
663
678
  let c = {
664
679
  group: "",
665
680
  options: []
666
681
  };
667
682
  n.items && (n.items.forEach((m) => {
668
- m.section_name !== c.group && (c.group && r.push({ ...c }), c.group = m.section_name, c.options = []), m.label && c.options.push(m);
669
- }), c.group && r.push({ ...c })), w.value = r, await Promise.all([
670
- G.post(
683
+ m.section_name !== c.group && (c.group && l.push({ ...c }), c.group = m.section_name, c.options = []), m.label && c.options.push(m);
684
+ }), c.group && l.push({ ...c })), w.value = l, await Promise.all([
685
+ X.post(
671
686
  "/api/client/common/getWorkOrderIssues.php"
672
687
  ),
673
688
  le()
674
689
  ]).then((m) => {
675
690
  const f = m[0];
676
- f.data.issues.forEach((X) => {
677
- X.label = X.display_name;
678
- }), se.value = f.data.issues;
691
+ f.data.issues.forEach((z) => {
692
+ z.label = z.display_name;
693
+ }), oe.value = f.data.issues;
679
694
  }), d.value.department = C.value.find(
680
695
  (m) => parseInt(m.id) === 2
681
696
  );
@@ -686,45 +701,45 @@ const Ct = Ve({
686
701
  default:
687
702
  return;
688
703
  }
689
- }, Je = () => {
690
- J.value = !J.value, K.value = !1;
704
+ }, $e = () => {
705
+ $.value = !$.value, K.value = !1;
691
706
  }, ye = () => {
692
707
  const e = document.getElementById("comment-field"), a = document.getElementById("hidden-text");
693
708
  e.style.height = a?.offsetHeight + "px";
694
- }, ue = () => {
709
+ }, re = () => {
695
710
  const e = document.getElementById("comments-container");
696
711
  e?.scroll({
697
712
  top: e.scrollHeight,
698
713
  behavior: "smooth"
699
714
  });
700
- }, Ye = async (e) => {
701
- if (e && e.type === "keydown" && e.preventDefault(), l.value.tokenId && T.value && !R.value)
715
+ }, Je = async (e) => {
716
+ if (e && e.type === "keydown" && e.preventDefault(), r.value.tokenId && T.value && !S.value)
702
717
  try {
703
718
  const a = new FormData();
704
- a.append("tokenId", l.value.tokenId), a.append("content", T.value), a.append("senderId", N.value || "");
705
- const t = await G.post(
719
+ a.append("tokenId", r.value.tokenId), a.append("content", T.value), a.append("senderId", M.value || "");
720
+ const t = await X.post(
706
721
  "/api/client/connect/sendMessage.php",
707
722
  a
708
723
  );
709
724
  if (t.data.status === "error")
710
725
  throw new Error(t.data.message || "Failed to send message");
711
- T.value = "", S.value = !t.data.closed, t.data.messages && (Y(t.data.messages), t.data.messages.length > 0 && (O.value = t.data.messages[t.data.messages.length - 1].id)), ue();
726
+ T.value = "", N.value = !t.data.closed, t.data.messages && (J(t.data.messages), t.data.messages.length > 0 && (O.value = t.data.messages[t.data.messages.length - 1].id)), re();
712
727
  } catch (a) {
713
728
  console.error("sendChatMessage error:", a);
714
729
  }
715
- }, ze = async () => {
716
- if (!(!l.value.tokenId || !N.value))
730
+ }, Ye = async () => {
731
+ if (!(!r.value.tokenId || !M.value))
717
732
  try {
718
- const e = S.value ? "/api/client/connect/closeConversation.php" : "/api/client/connect/openConversation.php", a = new FormData();
719
- a.append("tokenId", l.value.tokenId), a.append("userId", N.value), S.value && O.value !== null && a.append("lastMsgId", O.value.toString());
720
- const t = await G.post(e, a);
733
+ const e = N.value ? "/api/client/connect/closeConversation.php" : "/api/client/connect/openConversation.php", a = new FormData();
734
+ a.append("tokenId", r.value.tokenId), a.append("userId", M.value), N.value && O.value !== null && a.append("lastMsgId", O.value.toString());
735
+ const t = await X.post(e, a);
721
736
  if (t.data.status === "error")
722
737
  throw new Error(t.data.message || "Failed to update conversation status");
723
- S.value = !t.data.closed, t.data.messages && (Y(t.data.messages), t.data.messages.length > 0 && (O.value = t.data.messages[t.data.messages.length - 1].id));
738
+ N.value = !t.data.closed, t.data.messages && (J(t.data.messages), t.data.messages.length > 0 && (O.value = t.data.messages[t.data.messages.length - 1].id));
724
739
  } catch (e) {
725
740
  console.error("toggleMarkOpenClose error:", e);
726
741
  }
727
- }, ie = () => {
742
+ }, ue = () => {
728
743
  if (s.align === "left" || s.align === "right") {
729
744
  const e = x.value?.getBoundingClientRect().left, a = window.innerWidth;
730
745
  V.value = a - e < P.value ? "right" : "left";
@@ -732,7 +747,7 @@ const Ct = Ve({
732
747
  const e = x.value?.getBoundingClientRect().top, a = window.innerHeight;
733
748
  V.value = a - e < H.value ? "bottom" : "top";
734
749
  }
735
- }, ce = () => {
750
+ }, ie = () => {
736
751
  if (s.position === "top" || s.position === "bottom") {
737
752
  const e = x.value?.getBoundingClientRect().top, a = window.innerHeight;
738
753
  ae.value = a - e < H.value ? "top" : "bottom";
@@ -740,148 +755,143 @@ const Ct = Ve({
740
755
  const e = x.value?.getBoundingClientRect().left, a = window.innerWidth;
741
756
  ae.value = a - e < P.value ? "left" : "right";
742
757
  }
743
- }, we = () => {
744
- R.value = !R.value, R.value ? (T.value = "", E.value.info = U.value, E.value.tickets = Q.value, E.value.comments = Z.value, U.value = !1, Q.value = !1, document.getElementById("comment-field")?.focus()) : (U.value = E.value.info, Q.value = E.value.tickets, Z.value = E.value.comments);
745
- }, Xe = async (e, a) => {
746
- const t = l.value?.qv2Rooms?.qRoomId || l.value?.id || s.room?.id, o = new FormData();
747
- if (o.append("property_id", s.propertyId), o.append("room_ids", JSON.stringify([t])), await W(), D.value) {
758
+ }, ge = () => {
759
+ S.value = !S.value, S.value ? (T.value = "", E.value.info = j.value, E.value.tickets = U.value, E.value.comments = Z.value, j.value = !1, U.value = !1, document.getElementById("comment-field")?.focus()) : (j.value = E.value.info, U.value = E.value.tickets, Z.value = E.value.comments);
760
+ }, ze = async (e, a) => {
761
+ const t = r.value?.qv2Rooms?.qRoomId || r.value?.id || s.room?.id, o = new FormData();
762
+ if (o.append("property_id", s.propertyId), o.append("room_ids", JSON.stringify([t])), await W(), I.value) {
748
763
  const n = [];
749
- D.value.forEach((r) => {
750
- r.id === e && r.type === a ? n.unshift({
751
- ...r,
764
+ I.value.forEach((l) => {
765
+ l.id === e && l.type === a ? n.unshift({
766
+ ...l,
752
767
  isNew: !0
753
768
  }) : n.push({
754
- ...r,
769
+ ...l,
755
770
  isNew: !1
756
771
  });
757
- }), n.sort((r, c) => r.id === e ? -1 : c.id === e ? 1 : 0), D.value = [...n];
772
+ }), n.sort((l, c) => l.id === e ? -1 : c.id === e ? 1 : 0), I.value = [...n];
758
773
  }
759
774
  };
760
775
  return F(() => s.open, () => {
761
776
  if (s.open && s.showComments && ee.value.length) {
762
- const e = setTimeout(ue, 500);
777
+ const e = setTimeout(re, 500);
763
778
  L.value.push(e);
764
779
  }
765
- s.open || ve();
780
+ s.open || pe();
766
781
  }), F(T, () => {
767
782
  const e = setTimeout(ye, 100);
768
783
  L.value.push(e);
769
784
  }), F(() => s.allowWhenWhere, (e, a) => {
770
785
  a === !0 && e === !1 && (u.value.when = null, u.value.where = null, q.value = [], A.value = []);
771
786
  }), F(() => s.open, async (e, a) => {
772
- e && !a && (s.showGuestDetails && !M.value ? await re() : l.value || (l.value = s.room), W(), z(), s.showComments && fe());
787
+ e && !a && (s.showGuestDetails && !R.value ? await ne() : r.value || (r.value = s.room), W(), Y(), s.showComments && ve());
773
788
  }), F(
774
789
  () => s.room.id,
775
790
  (e, a) => {
776
- e !== a && (M.value ? (l.value = M.value.find((t) => t.qv2Rooms.qRoomId === s.room.id), l.value || (l.value = s.room)) : l.value = s.room, s.open && (W(), z()));
791
+ e !== a && (R.value ? (r.value = R.value.find((t) => t.qv2Rooms.qRoomId === s.room.id), r.value || (r.value = s.room)) : r.value = s.room, s.open && (W(), Y()));
777
792
  }
778
- ), Ze(async () => {
793
+ ), Ve(async () => {
779
794
  const e = JSON.parse(
780
795
  window.localStorage.getItem("authenticated")
781
796
  );
782
- N.value = e?.user?.id || "", l.value = s.room, s.size === "sm" && (H.value = 140, P.value = 160), s.size === "lg" && (H.value = 250, P.value = 440), ie(), ce();
783
- const a = [], t = window.localStorage.getItem("quick-replies");
784
- t && JSON.parse(t).forEach((o) => {
785
- a.push(o.message);
786
- }), oe.value = a;
787
- }), et(() => {
797
+ M.value = e?.user?.id || "", console.log("userId:", M.value), r.value = s.room, s.size === "sm" && (H.value = 140, P.value = 160), s.size === "lg" && (H.value = 250, P.value = 440), ue(), ie();
798
+ }), Ze(() => {
788
799
  L.value.forEach((e) => {
789
800
  clearTimeout(e);
790
801
  });
791
802
  }), {
792
- DateTime: y,
803
+ DateTime: g,
793
804
  // Refs
794
805
  actionMenuOpen: K,
795
806
  alignment: V,
796
- assignTypes: j,
807
+ assignTypes: G,
797
808
  comment: T,
798
809
  complaint: p,
799
810
  componentHeight: H,
800
811
  componentWidth: P,
801
812
  departments: C,
802
- departmentUsers: de,
813
+ departmentUsers: ce,
803
814
  expandComments: Z,
804
- expandGuestInfo: U,
815
+ expandGuestInfo: j,
805
816
  expandedStates: E,
806
- expandTickets: Q,
807
- guestDetailsData: _e,
817
+ expandTickets: U,
818
+ guestDetailsData: we,
808
819
  itemOptions: w,
809
820
  loading: b,
810
821
  messages: ee,
811
822
  moodOptions: te,
812
- pmsData: M,
823
+ pmsData: R,
813
824
  positioning: ae,
814
- quickReplies: oe,
815
- quickReplyOpen: R,
825
+ quickReplyOpen: S,
816
826
  request: u,
817
827
  requestedByOptions: B,
818
828
  requestLoading: ke,
819
- requestType: k,
820
- roomDetailsData: l,
821
- roomNotice: g,
822
- roomNotices: $,
823
- showCreateRequest: J,
824
- ticketsList: D,
825
- todoOptions: De,
829
+ requestType: _,
830
+ roomDetailsData: r,
831
+ roomNotice: y,
832
+ roomNotices: Q,
833
+ showCreateRequest: $,
834
+ ticketsList: I,
835
+ todoOptions: _e,
826
836
  trigger: x,
827
- userId: N,
837
+ userId: M,
828
838
  workOrder: d,
829
- workOrderIssues: se,
839
+ workOrderIssues: oe,
830
840
  whenOptions: q,
831
841
  whereOptions: A,
832
842
  // Guest Connect state
833
- isConversationOpen: S,
843
+ isConversationOpen: N,
834
844
  lastMessageId: O,
835
845
  // Computed
836
- cleanliness: ne,
846
+ cleanliness: se,
837
847
  cleanlinessColor: Ie,
838
- cleanlinessTooltipContent: Te,
839
- filteredReplies: be,
840
- hasGuestCallback: Oe,
841
- hasComplaint: me,
842
- itemOptionsList: Ce,
843
- occupied: pe,
844
- occupancyTooltipContent: Ee,
845
- selectedAssignType: Me,
846
- selectedDepartment: Re,
847
- selectedRequestedBy: Se,
848
- stayDetails: Ne,
849
- tagsList: qe,
850
- validateToDo: Ae,
848
+ cleanlinessTooltipContent: De,
849
+ filteredReplies: Te,
850
+ hasGuestCallback: be,
851
+ hasComplaint: de,
852
+ itemOptionsList: Oe,
853
+ occupied: me,
854
+ occupancyTooltipContent: Ce,
855
+ selectedAssignType: Ee,
856
+ selectedDepartment: Me,
857
+ selectedRequestedBy: Re,
858
+ stayDetails: Se,
859
+ tagsList: Ne,
860
+ validateToDo: qe,
851
861
  // Methods
852
- closeRequest: ve,
853
- createCallback: He,
854
- createMessageList: Y,
855
- getChatMessages: fe,
856
- getHowLongAgo: Pe,
857
- getPMSData: re,
858
- getRoomNotices: z,
862
+ closeRequest: pe,
863
+ createCallback: Ae,
864
+ createMessageList: J,
865
+ getChatMessages: ve,
866
+ getHowLongAgo: He,
867
+ getPMSData: ne,
868
+ getRoomNotices: Y,
859
869
  getSharedData: le,
860
- getStayDetails: he,
861
- getTicketColor: Le,
862
- getTicketIcon: xe,
870
+ getStayDetails: fe,
871
+ getTicketColor: Be,
872
+ getTicketIcon: Le,
863
873
  getTickets: W,
864
- handleFailedResponse: ge,
865
- handlePulse: We,
866
- onClickEditConnectGuest: Fe,
867
- onClickTicket: Ge,
868
- onCreateRequestSubmit: je,
869
- onHoverToggle: Ue,
870
- onSelectQuickReply: Qe,
871
- onSelectToDo: $e,
872
- openRequest: Je,
873
- refreshPMSData: Be,
874
+ handleFailedResponse: he,
875
+ handlePulse: xe,
876
+ onClickEditConnectGuest: We,
877
+ onClickTicket: Fe,
878
+ onCreateRequestSubmit: Ge,
879
+ onHoverToggle: je,
880
+ onSelectQuickReply: Ue,
881
+ onSelectToDo: Qe,
882
+ openRequest: $e,
883
+ refreshPMSData: Pe,
874
884
  resizeTextarea: ye,
875
- scrollToConnectBottom: ue,
876
- sendChatMessage: Ye,
877
- setAlignment: ie,
878
- setPositioning: ce,
879
- toggleMarkOpenClose: ze,
880
- toggleQuickReply: we,
881
- updateTickets: Xe
885
+ scrollToConnectBottom: re,
886
+ sendChatMessage: Je,
887
+ setAlignment: ue,
888
+ setPositioning: ie,
889
+ toggleMarkOpenClose: Ye,
890
+ toggleQuickReply: ge,
891
+ updateTickets: ze
882
892
  };
883
893
  }
884
894
  });
885
895
  export {
886
- Ct as default
896
+ Ot as default
887
897
  };