@phonghq/go-chat 1.0.45 → 1.0.47

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 (87) hide show
  1. package/dist/assets/icons/global/IconSms.vue.d.ts +2 -0
  2. package/dist/assets/icons/global/IconUser.vue.d.ts +2 -0
  3. package/dist/chat/App.vue.d.ts +2 -9
  4. package/dist/chat/page/home/PhoneNumpad.vue.d.ts +11 -0
  5. package/dist/components/common/select/SelectBase.vue.d.ts +27 -1
  6. package/dist/components/layout/PageError.vue.d.ts +2 -0
  7. package/dist/components/ui/select/SelectItem.vue.d.ts +2 -2
  8. package/dist/composable/useListConversations.d.ts +1 -1
  9. package/dist/composable/useListentEvent.d.ts +1 -1
  10. package/dist/go-chat.es.js +11199 -10856
  11. package/dist/go-chat.umd.js +15 -15
  12. package/dist/plugins/sdk.d.ts +1 -2
  13. package/dist/style.css +1 -1
  14. package/dist/test/assets/icons/call/IconPhoneBase.vue.js +20 -0
  15. package/dist/test/assets/icons/global/IconBackspace.vue.js +28 -0
  16. package/dist/test/chat/App.vue.js +165 -127
  17. package/dist/test/chat/page/customer-appointment/CustomerAppointment.vue.js +1 -1
  18. package/dist/test/chat/page/customer-check-in/CustomerCheckIn.vue.js +1 -1
  19. package/dist/test/chat/page/customer-detail/CustomerDetail.vue.js +1 -1
  20. package/dist/test/chat/page/error/Error.vue.js +1 -1
  21. package/dist/test/chat/page/home/ChatList.vue.js +54 -39
  22. package/dist/test/chat/page/home/ChatMessage.vue.js +1 -1
  23. package/dist/test/chat/page/home/ChatMessageItem.vue.js +7 -5
  24. package/dist/test/chat/page/home/ChatMessageItem2.vue.js +1 -1
  25. package/dist/test/chat/page/home/Home.vue.js +42 -35
  26. package/dist/test/chat/page/home/HomeHeader.vue.js +6 -6
  27. package/dist/test/chat/page/home/InputChat.vue.js +3 -6
  28. package/dist/test/chat/page/home/PhoneNumpad.vue.js +127 -0
  29. package/dist/test/chat/page/setting/Setting.vue.js +1 -1
  30. package/dist/test/components/chat/ScrollEvent/ScrollEvent.vue.js +2 -0
  31. package/dist/test/components/chat/call/Calling.vue.js +5 -17
  32. package/dist/test/components/chat/common/input/InputSearch.vue.js +1 -1
  33. package/dist/test/components/chat/common/modal/Modal.vue.js +1 -1
  34. package/dist/test/components/chat/customer/Avatar.vue.js +1 -1
  35. package/dist/test/components/common/modal/ModalBase.vue.js +1 -1
  36. package/dist/test/components/common/select/SelectBase.vue.js +69 -106
  37. package/dist/test/components/layout/PageError.vue.js +91 -0
  38. package/dist/test/components/ui/select/SelectContent.vue.js +2 -2
  39. package/dist/test/components/ui/select/SelectItem.vue.js +9 -22
  40. package/dist/test/components/ui/select/SelectTrigger.vue.js +3 -30
  41. package/dist/test/composable/useInitData.js +2 -2
  42. package/dist/test/composable/useListConversations.js +5 -5
  43. package/dist/test/composable/useListentEvent.js +7 -4
  44. package/dist/test/composable/usePlivo.js +2 -5
  45. package/dist/test/plugins/axios.js +0 -2
  46. package/dist/test/plugins/mqtt.js +12 -4
  47. package/dist/test/plugins/pocketbase.js +1 -2
  48. package/dist/test/plugins/sdk.js +2 -12
  49. package/dist/test/plugins/websocket.js +1 -1
  50. package/dist/test/utils/chat/cache.js +1 -1
  51. package/dist/test/utils/chat/{auth.js → store/auth.js} +14 -5
  52. package/dist/test/utils/chat/{call.js → store/call.js} +3 -3
  53. package/dist/test/utils/chat/{conversation.js → store/conversation.js} +6 -6
  54. package/dist/test/utils/chat/{message.js → store/message.js} +25 -1
  55. package/dist/test/utils/chat/{user.js → store/user.js} +2 -2
  56. package/dist/test/views/home/phone-numpad/ConvercationList.vue.js +174 -0
  57. package/dist/test/views/home/phone-numpad/PhoneNumpad.vue.js +270 -0
  58. package/dist/types/chat/auth.d.ts +1 -0
  59. package/dist/utils/chat/{auth.d.ts → store/auth.d.ts} +4 -1
  60. package/dist/utils/chat/{call.d.ts → store/call.d.ts} +1 -1
  61. package/dist/utils/chat/{conversation.d.ts → store/conversation.d.ts} +3 -3
  62. package/dist/utils/chat/{message.d.ts → store/message.d.ts} +8 -2
  63. package/dist/utils/chat/{user.d.ts → store/user.d.ts} +2 -2
  64. package/dist/views/home/phone-numpad/ConvercationList.vue.d.ts +18 -0
  65. package/dist/views/home/phone-numpad/PhoneNumpad.vue.d.ts +26 -0
  66. package/package.json +1 -1
  67. package/dist/composable/useCallHelper.d.ts +0 -48
  68. package/dist/test/composable/data.json +0 -32
  69. package/dist/test/composable/useCallHelper.js +0 -339
  70. /package/dist/assets/icons/{IconAiCheck.vue.d.ts → call/IconPhoneBase.vue.d.ts} +0 -0
  71. /package/dist/assets/icons/{IconArrowLeft.vue.d.ts → global/IconAiCheck.vue.d.ts} +0 -0
  72. /package/dist/assets/icons/{IconCloseCircle.vue.d.ts → global/IconArrowLeft.vue.d.ts} +0 -0
  73. /package/dist/assets/icons/{IconPhone.vue.d.ts → global/IconBackspace.vue.d.ts} +0 -0
  74. /package/dist/assets/icons/{IconPlus.vue.d.ts → global/IconCloseCircle.vue.d.ts} +0 -0
  75. /package/dist/assets/icons/{IconSms.vue.d.ts → global/IconPhone.vue.d.ts} +0 -0
  76. /package/dist/assets/icons/{IconPlan.vue.d.ts → global/IconPlan.vue.d.ts} +0 -0
  77. /package/dist/assets/icons/{IconUser.vue.d.ts → global/IconPlus.vue.d.ts} +0 -0
  78. /package/dist/assets/icons/{IconSearch.vue.d.ts → global/IconSearch.vue.d.ts} +0 -0
  79. /package/dist/test/assets/icons/{IconAiCheck.vue.js → global/IconAiCheck.vue.js} +0 -0
  80. /package/dist/test/assets/icons/{IconArrowLeft.vue.js → global/IconArrowLeft.vue.js} +0 -0
  81. /package/dist/test/assets/icons/{IconCloseCircle.vue.js → global/IconCloseCircle.vue.js} +0 -0
  82. /package/dist/test/assets/icons/{IconPhone.vue.js → global/IconPhone.vue.js} +0 -0
  83. /package/dist/test/assets/icons/{IconPlan.vue.js → global/IconPlan.vue.js} +0 -0
  84. /package/dist/test/assets/icons/{IconPlus.vue.js → global/IconPlus.vue.js} +0 -0
  85. /package/dist/test/assets/icons/{IconSearch.vue.js → global/IconSearch.vue.js} +0 -0
  86. /package/dist/test/assets/icons/{IconSms.vue.js → global/IconSms.vue.js} +0 -0
  87. /package/dist/test/assets/icons/{IconUser.vue.js → global/IconUser.vue.js} +0 -0
@@ -1,11 +1,11 @@
1
1
  import InputSearch from '../../../components/chat/common/input/InputSearch.vue';
2
- import IconPlus from '../../../assets/icons/IconPlus.vue';
2
+ import IconPlus from '../../../assets/icons/global/IconPlus.vue';
3
3
  import { computed, ref } from 'vue';
4
4
  import Avatar from '../../../components/chat/customer/Avatar.vue';
5
- import { getConversationView } from '../../../utils/chat/conversation';
5
+ import { getConversationView } from '../../../utils/chat/store/conversation';
6
6
  import ScrollEvent from '../../../components/chat/ScrollEvent/ScrollEvent.vue';
7
7
  import { useDebounce } from '../../../utils/debounce';
8
- import { dataProfile } from '../../../utils/chat/auth';
8
+ import { dataProfile } from '../../../utils/chat/store/auth';
9
9
  import dayjs from 'dayjs';
10
10
  import relativeTime from 'dayjs/plugin/relativeTime';
11
11
  import updateLocale from 'dayjs/plugin/updateLocale';
@@ -13,7 +13,7 @@ import utc from 'dayjs/plugin/utc';
13
13
  import timezone from 'dayjs/plugin/timezone';
14
14
  import { useDigibot } from '../../../composable/useDigibot';
15
15
  import { TIME_ZONE_UTC } from '../../../constant/datetime';
16
- import IconAiCheck from '../../../assets/icons/IconAiCheck.vue';
16
+ import IconAiCheck from '../../../assets/icons/global/IconAiCheck.vue';
17
17
  import TabBase2 from '../../../components/chat/common/tabs/TabBase.vue';
18
18
  import { useListConversations } from '../../../composable/useListConversations';
19
19
  import { phoneNumberFormat } from '../../../utils/string-helper';
@@ -94,7 +94,7 @@ const getData = async (data, option) => {
94
94
  checkHasReceiveId();
95
95
  }
96
96
  if (option?.reset) {
97
- getAllList();
97
+ getAllList(tab_value);
98
98
  }
99
99
  }
100
100
  catch (error) {
@@ -104,17 +104,17 @@ const getData = async (data, option) => {
104
104
  isLoadingSearch.value = false;
105
105
  }
106
106
  };
107
- const getAllList = async () => {
108
- if (activeTabs.value == TAB_VALUE.ALL) {
109
- while (paramsAll.value.page < pageCountAll && !scrollEventRef.value?.canScroll()) {
107
+ const getAllList = async (tab_value) => {
108
+ if (tab_value == TAB_VALUE.ALL) {
109
+ while (paramsAll.value.page < pageCountAll.value && !scrollEventRef.value?.canScroll()) {
110
110
  let page = paramsAll.value.page + 1;
111
- await getData({ page });
111
+ await getData({ page }, { tab: tab_value });
112
112
  }
113
113
  }
114
- else if (activeTabs.value == TAB_VALUE.UNKNOWN) {
115
- while (paramsUnknown.value.page < pageCountUnknown && !scrollEventRef.value?.canScroll()) {
114
+ else if (tab_value == TAB_VALUE.UNKNOWN) {
115
+ while (paramsUnknown.value.page < pageCountUnknown.value && !scrollEventRef.value?.canScroll()) {
116
116
  let page = paramsUnknown.value.page + 1;
117
- await getData({ page });
117
+ await getData({ page }, { tab: tab_value });
118
118
  }
119
119
  }
120
120
  };
@@ -134,7 +134,7 @@ const handleSearch = (value) => {
134
134
  };
135
135
  const handleScroll = useDebounce(async () => {
136
136
  if (activeTabs.value == TAB_VALUE.ALL) {
137
- if (paramsAll.value.page >= pageCountAll) {
137
+ if (paramsAll.value.page >= pageCountAll.value) {
138
138
  scrollEventRef.value?.hideLoading();
139
139
  return;
140
140
  }
@@ -143,7 +143,7 @@ const handleScroll = useDebounce(async () => {
143
143
  scrollEventRef.value?.hideLoading();
144
144
  }
145
145
  else if (activeTabs.value == TAB_VALUE.UNKNOWN) {
146
- if (paramsUnknown.value.page >= pageCountUnknown) {
146
+ if (paramsUnknown.value.page >= pageCountUnknown.value) {
147
147
  scrollEventRef.value?.hideLoading();
148
148
  return;
149
149
  }
@@ -247,22 +247,28 @@ const __VLS_5 = ({ search: {} },
247
247
  // @ts-ignore
248
248
  [responsive, keyword, handleSearch,];
249
249
  var __VLS_2;
250
- __VLS_asFunctionalElement(__VLS_elements.button, __VLS_elements.button)({
251
- ...{ onClick: (...[$event]) => {
252
- __VLS_ctx.emit('openPhoneNumpad');
253
- // @ts-ignore
254
- [emit,];
255
- } },
256
- ...{ class: "shrink-0 h-11 w-11 rounded-full flex-center bg-[#C7DEFF] block xl:hidden" },
257
- });
258
- /** @type {[typeof IconPlus, ]} */ ;
259
- // @ts-ignore
260
- const __VLS_7 = __VLS_asFunctionalComponent(IconPlus, new IconPlus({
261
- ...{ class: "text-[#004AB3]" },
262
- }));
263
- const __VLS_8 = __VLS_7({
264
- ...{ class: "text-[#004AB3]" },
265
- }, ...__VLS_functionalComponentArgsRest(__VLS_7));
250
+ if (__VLS_ctx.responsive != 'window') {
251
+ // @ts-ignore
252
+ [responsive,];
253
+ __VLS_asFunctionalElement(__VLS_elements.button, __VLS_elements.button)({
254
+ ...{ onClick: (...[$event]) => {
255
+ if (!(__VLS_ctx.responsive != 'window'))
256
+ return;
257
+ __VLS_ctx.emit('openPhoneNumpad');
258
+ // @ts-ignore
259
+ [emit,];
260
+ } },
261
+ ...{ class: "shrink-0 h-11 w-11 rounded-full flex-center bg-[#C7DEFF]" },
262
+ });
263
+ /** @type {[typeof IconPlus, ]} */ ;
264
+ // @ts-ignore
265
+ const __VLS_7 = __VLS_asFunctionalComponent(IconPlus, new IconPlus({
266
+ ...{ class: "text-[#004AB3]" },
267
+ }));
268
+ const __VLS_8 = __VLS_7({
269
+ ...{ class: "text-[#004AB3]" },
270
+ }, ...__VLS_functionalComponentArgsRest(__VLS_7));
271
+ }
266
272
  if (__VLS_ctx.dataProfile?.user_type == 'tenant') {
267
273
  // @ts-ignore
268
274
  [dataProfile,];
@@ -297,12 +303,14 @@ const __VLS_18 = __VLS_asFunctionalComponent(ScrollEvent, new ScrollEvent({
297
303
  ...{ 'onGetDataBottom': {} },
298
304
  ref: "scrollEventRef",
299
305
  ...{ class: "h-full overflow-auto" },
306
+ disabled: (__VLS_ctx.activeTabs == __VLS_ctx.TAB_VALUE.ALL ? __VLS_ctx.paramsAll.page >= __VLS_ctx.pageCountAll : __VLS_ctx.paramsUnknown.page >= __VLS_ctx.pageCountUnknown),
300
307
  bottom: true,
301
308
  }));
302
309
  const __VLS_19 = __VLS_18({
303
310
  ...{ 'onGetDataBottom': {} },
304
311
  ref: "scrollEventRef",
305
312
  ...{ class: "h-full overflow-auto" },
313
+ disabled: (__VLS_ctx.activeTabs == __VLS_ctx.TAB_VALUE.ALL ? __VLS_ctx.paramsAll.page >= __VLS_ctx.pageCountAll : __VLS_ctx.paramsUnknown.page >= __VLS_ctx.pageCountUnknown),
306
314
  bottom: true,
307
315
  }, ...__VLS_functionalComponentArgsRest(__VLS_18));
308
316
  let __VLS_21;
@@ -313,7 +321,7 @@ const __VLS_23 = ({ getDataBottom: {} },
313
321
  var __VLS_24 = {};
314
322
  const { default: __VLS_26 } = __VLS_20.slots;
315
323
  // @ts-ignore
316
- [handleScroll, scrollEventRef,];
324
+ [activeTabs, TAB_VALUE, paramsAll, pageCountAll, paramsUnknown, pageCountUnknown, handleScroll, scrollEventRef,];
317
325
  for (const [user] of __VLS_getVForSourceType((__VLS_ctx.listConversations))) {
318
326
  // @ts-ignore
319
327
  [listConversations,];
@@ -337,6 +345,7 @@ for (const [user] of __VLS_getVForSourceType((__VLS_ctx.listConversations))) {
337
345
  const __VLS_27 = __VLS_asFunctionalComponent(Avatar, new Avatar({
338
346
  id: (user.id),
339
347
  ...{ class: "shrink-0" },
348
+ ...{ class: ({ 'animal-icon': user?.id === __VLS_ctx.digibotId }) },
340
349
  src: (user.avatar ?? ''),
341
350
  color: (user.color),
342
351
  name: (user.username ?? ''),
@@ -344,10 +353,13 @@ for (const [user] of __VLS_getVForSourceType((__VLS_ctx.listConversations))) {
344
353
  const __VLS_28 = __VLS_27({
345
354
  id: (user.id),
346
355
  ...{ class: "shrink-0" },
356
+ ...{ class: ({ 'animal-icon': user?.id === __VLS_ctx.digibotId }) },
347
357
  src: (user.avatar ?? ''),
348
358
  color: (user.color),
349
359
  name: (user.username ?? ''),
350
360
  }, ...__VLS_functionalComponentArgsRest(__VLS_27));
361
+ // @ts-ignore
362
+ [digibotId,];
351
363
  __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
352
364
  ...{ class: "grow ml-3 overflow-hidden" },
353
365
  });
@@ -392,12 +404,16 @@ for (const [user] of __VLS_getVForSourceType((__VLS_ctx.listConversations))) {
392
404
  }) },
393
405
  });
394
406
  (user.last_message ?? 'No messages');
395
- __VLS_asFunctionalElement(__VLS_elements.span, __VLS_elements.span)({
396
- ...{ class: "shrink-0 text-sm text-right text-chat-gray-4 w-[80px] md:w-[130px]" },
397
- });
398
- (__VLS_ctx.getTimeFromNow(user.last_message_time ?? ''));
399
- // @ts-ignore
400
- [getTimeFromNow,];
407
+ if (user.id != __VLS_ctx.digibotId) {
408
+ // @ts-ignore
409
+ [digibotId,];
410
+ __VLS_asFunctionalElement(__VLS_elements.span, __VLS_elements.span)({
411
+ ...{ class: "shrink-0 text-sm text-right text-chat-gray-4 w-[80px] md:w-[130px]" },
412
+ });
413
+ (__VLS_ctx.getTimeFromNow(user.last_message_time ?? ''));
414
+ // @ts-ignore
415
+ [getTimeFromNow,];
416
+ }
401
417
  }
402
418
  var __VLS_20;
403
419
  /** @type {__VLS_StyleScopedClasses['']} */ ;
@@ -420,8 +436,6 @@ var __VLS_20;
420
436
  /** @type {__VLS_StyleScopedClasses['rounded-full']} */ ;
421
437
  /** @type {__VLS_StyleScopedClasses['flex-center']} */ ;
422
438
  /** @type {__VLS_StyleScopedClasses['bg-[#C7DEFF]']} */ ;
423
- /** @type {__VLS_StyleScopedClasses['block']} */ ;
424
- /** @type {__VLS_StyleScopedClasses['xl:hidden']} */ ;
425
439
  /** @type {__VLS_StyleScopedClasses['text-[#004AB3]']} */ ;
426
440
  /** @type {__VLS_StyleScopedClasses['shrink-0']} */ ;
427
441
  /** @type {__VLS_StyleScopedClasses['px-6']} */ ;
@@ -441,6 +455,7 @@ var __VLS_20;
441
455
  /** @type {__VLS_StyleScopedClasses['py-2']} */ ;
442
456
  /** @type {__VLS_StyleScopedClasses['bg-[#EDF5FF]']} */ ;
443
457
  /** @type {__VLS_StyleScopedClasses['shrink-0']} */ ;
458
+ /** @type {__VLS_StyleScopedClasses['animal-icon']} */ ;
444
459
  /** @type {__VLS_StyleScopedClasses['grow']} */ ;
445
460
  /** @type {__VLS_StyleScopedClasses['ml-3']} */ ;
446
461
  /** @type {__VLS_StyleScopedClasses['overflow-hidden']} */ ;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="C:/phonghq/go-chat-v2/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
2
- import { dataProfile } from '../../../utils/chat/auth';
2
+ import { dataProfile } from '../../../utils/chat/store/auth';
3
3
  import { nextTick, ref } from 'vue';
4
4
  import ScrollEvent from '../../../components/chat/ScrollEvent/ScrollEvent.vue';
5
5
  import NewCustomer from '../../../chat/page/home/NewCustomer.vue';
@@ -114,7 +114,7 @@ if (__VLS_ctx.message.state != __VLS_ctx.MessageState.Sending || __VLS_ctx.isMyM
114
114
  color: (__VLS_ctx.data?.color),
115
115
  name: (__VLS_ctx.data?.username),
116
116
  size: (__VLS_ctx.responsive == 'mobile' ? 'sm' : 'md'),
117
- ...{ class: (__VLS_ctx.responsive == 'mobile' ? 'translate-y-[-2px]' : '') },
117
+ ...{ class: ({ 'translate-y-[-2px]': __VLS_ctx.responsive == 'mobile', '-translate-y-6': __VLS_ctx.isChatStart && __VLS_ctx.isChatFinished }) },
118
118
  }));
119
119
  const __VLS_1 = __VLS_0({
120
120
  ...{ class: "shrink-0" },
@@ -122,10 +122,10 @@ if (__VLS_ctx.message.state != __VLS_ctx.MessageState.Sending || __VLS_ctx.isMyM
122
122
  color: (__VLS_ctx.data?.color),
123
123
  name: (__VLS_ctx.data?.username),
124
124
  size: (__VLS_ctx.responsive == 'mobile' ? 'sm' : 'md'),
125
- ...{ class: (__VLS_ctx.responsive == 'mobile' ? 'translate-y-[-2px]' : '') },
125
+ ...{ class: ({ 'translate-y-[-2px]': __VLS_ctx.responsive == 'mobile', '-translate-y-6': __VLS_ctx.isChatStart && __VLS_ctx.isChatFinished }) },
126
126
  }, ...__VLS_functionalComponentArgsRest(__VLS_0));
127
127
  // @ts-ignore
128
- [data, data, data, responsive, responsive,];
128
+ [data, data, data, responsive, responsive, isChatStart, isChatFinished,];
129
129
  }
130
130
  else {
131
131
  __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
@@ -167,11 +167,11 @@ if (__VLS_ctx.message.state != __VLS_ctx.MessageState.Sending || __VLS_ctx.isMyM
167
167
  // @ts-ignore
168
168
  const __VLS_4 = __VLS_asFunctionalComponent(IconPhone, new IconPhone({
169
169
  weight: (2),
170
- ...{ class: "w-5 h-5 text-chat-success" },
170
+ ...{ class: "w-5 h-5 text-chat-success" },
171
171
  }));
172
172
  const __VLS_5 = __VLS_4({
173
173
  weight: (2),
174
- ...{ class: "w-5 h-5 text-chat-success" },
174
+ ...{ class: "w-5 h-5 text-chat-success" },
175
175
  }, ...__VLS_functionalComponentArgsRest(__VLS_4));
176
176
  }
177
177
  else {
@@ -280,6 +280,8 @@ if (__VLS_ctx.message.state != __VLS_ctx.MessageState.Sending || __VLS_ctx.isMyM
280
280
  /** @type {__VLS_StyleScopedClasses['pl-[60px]']} */ ;
281
281
  /** @type {__VLS_StyleScopedClasses['gap-2']} */ ;
282
282
  /** @type {__VLS_StyleScopedClasses['shrink-0']} */ ;
283
+ /** @type {__VLS_StyleScopedClasses['translate-y-[-2px]']} */ ;
284
+ /** @type {__VLS_StyleScopedClasses['-translate-y-6']} */ ;
283
285
  /** @type {__VLS_StyleScopedClasses['shrink-0']} */ ;
284
286
  /** @type {__VLS_StyleScopedClasses['px-3']} */ ;
285
287
  /** @type {__VLS_StyleScopedClasses['py-2']} */ ;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="C:/phonghq/go-chat-v2/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
2
2
  import Avatar from '../../../components/chat/customer/Avatar.vue';
3
- import { dataProfile } from '../../../utils/chat/auth';
3
+ import { dataProfile } from '../../../utils/chat/store/auth';
4
4
  import { computed, nextTick } from 'vue';
5
5
  import { MessageState } from '../../../constant/message';
6
6
  import IconPhoneCancel from '../../../assets/icons/call/IconPhoneCancel.vue';
@@ -2,14 +2,15 @@
2
2
  import HomeHeader from '../../../chat/page/home/HomeHeader.vue';
3
3
  import NewCustomer from '../../../chat/page/home/NewCustomer.vue';
4
4
  import InputChat from '../../../chat/page/home/InputChat.vue';
5
- import { getDetailReceiver, getMessage, sendMessage, upLoadImage } from '../../../utils/chat/message';
5
+ import { getDetailReceiver, getMessage, sendMessage, upLoadImage } from '../../../utils/chat/store/message';
6
6
  import { computed, nextTick, onMounted, onUnmounted, ref, shallowRef } from 'vue';
7
7
  import ChatMessage from '../../../chat/page/home/ChatMessage.vue';
8
8
  import { addHandleMqttMessage, connectMqtt, publishMessage, removeHandleMqttMessage, subscribeToTopic, unsubscribeFromTopic } from '../../../plugins/mqtt';
9
9
  import { TOPIC_DETAIL_CHAT, TOPIC_PLIVO_SMS } from '../../../constant/mqtt';
10
10
  import { MessageState } from '../../../constant/message';
11
- import { publicTopicConversationUpdate } from '../../../utils/chat/conversation';
11
+ import { publicTopicConversationUpdate } from '../../../utils/chat/store/conversation';
12
12
  import { getCache, removeOldestCache, setCache } from '../../../utils/chat/cache';
13
+ import { digibotId } from '../../../composable/useDigibot';
13
14
  const props = withDefaults(defineProps(), {});
14
15
  const emit = defineEmits();
15
16
  const MESSAGE_STORAGE_KEY = 'chat-message-';
@@ -310,39 +311,45 @@ else {
310
311
  ...{ class: "grow" },
311
312
  });
312
313
  }
313
- /** @type {[typeof InputChat, ]} */ ;
314
- // @ts-ignore
315
- const __VLS_22 = __VLS_asFunctionalComponent(InputChat, new InputChat({
316
- ...{ 'onSendMessage': {} },
317
- ...{ 'onFocus': {} },
318
- data: (__VLS_ctx.infoUser),
319
- responsive: (__VLS_ctx.responsive),
320
- ref: "inputChatRef",
321
- ...{ class: "p-2 sm:p-6" },
322
- }));
323
- const __VLS_23 = __VLS_22({
324
- ...{ 'onSendMessage': {} },
325
- ...{ 'onFocus': {} },
326
- data: (__VLS_ctx.infoUser),
327
- responsive: (__VLS_ctx.responsive),
328
- ref: "inputChatRef",
329
- ...{ class: "p-2 sm:p-6" },
330
- }, ...__VLS_functionalComponentArgsRest(__VLS_22));
331
- let __VLS_25;
332
- let __VLS_26;
333
- const __VLS_27 = ({ sendMessage: {} },
334
- { onSendMessage: (__VLS_ctx.handleSendMessage) });
335
- const __VLS_28 = ({ focus: {} },
336
- { onFocus: (...[$event]) => {
337
- __VLS_ctx.emit('inputFocus');
338
- // @ts-ignore
339
- [infoUser, responsive, emit, handleSendMessage,];
340
- } });
341
- /** @type {typeof __VLS_ctx.inputChatRef} */ ;
342
- var __VLS_29 = {};
343
- // @ts-ignore
344
- [inputChatRef,];
345
- var __VLS_24;
314
+ if (__VLS_ctx.receiverId != __VLS_ctx.digibotId) {
315
+ // @ts-ignore
316
+ [receiverId, digibotId,];
317
+ /** @type {[typeof InputChat, ]} */ ;
318
+ // @ts-ignore
319
+ const __VLS_22 = __VLS_asFunctionalComponent(InputChat, new InputChat({
320
+ ...{ 'onSendMessage': {} },
321
+ ...{ 'onFocus': {} },
322
+ data: (__VLS_ctx.infoUser),
323
+ responsive: (__VLS_ctx.responsive),
324
+ ref: "inputChatRef",
325
+ ...{ class: "p-2 sm:p-6" },
326
+ }));
327
+ const __VLS_23 = __VLS_22({
328
+ ...{ 'onSendMessage': {} },
329
+ ...{ 'onFocus': {} },
330
+ data: (__VLS_ctx.infoUser),
331
+ responsive: (__VLS_ctx.responsive),
332
+ ref: "inputChatRef",
333
+ ...{ class: "p-2 sm:p-6" },
334
+ }, ...__VLS_functionalComponentArgsRest(__VLS_22));
335
+ let __VLS_25;
336
+ let __VLS_26;
337
+ const __VLS_27 = ({ sendMessage: {} },
338
+ { onSendMessage: (__VLS_ctx.handleSendMessage) });
339
+ const __VLS_28 = ({ focus: {} },
340
+ { onFocus: (...[$event]) => {
341
+ if (!(__VLS_ctx.receiverId != __VLS_ctx.digibotId))
342
+ return;
343
+ __VLS_ctx.emit('inputFocus');
344
+ // @ts-ignore
345
+ [infoUser, responsive, emit, handleSendMessage,];
346
+ } });
347
+ /** @type {typeof __VLS_ctx.inputChatRef} */ ;
348
+ var __VLS_29 = {};
349
+ // @ts-ignore
350
+ [inputChatRef,];
351
+ var __VLS_24;
352
+ }
346
353
  /** @type {__VLS_StyleScopedClasses['h-full']} */ ;
347
354
  /** @type {__VLS_StyleScopedClasses['flex']} */ ;
348
355
  /** @type {__VLS_StyleScopedClasses['flex-col']} */ ;
@@ -1,15 +1,15 @@
1
1
  /// <reference types="C:/phonghq/go-chat-v2/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
2
- import IconPhone from '../../../assets/icons/IconPhone.vue';
2
+ import IconPhone from '../../../assets/icons/global/IconPhone.vue';
3
3
  import { PAGE } from '../../../constant/general';
4
4
  import Avatar from '../../../components/chat/customer/Avatar.vue';
5
5
  import { routerPush } from '../../../utils/chat/chat-router';
6
- import { user } from '../../../utils/chat/user';
7
- import { dataProfile } from '../../../utils/chat/auth';
6
+ import { user } from '../../../utils/chat/store/user';
7
+ import { dataProfile } from '../../../utils/chat/store/auth';
8
8
  import { digibotId } from '../../../composable/useDigibot';
9
- import IconArrowLeft from '../../../assets/icons/IconArrowLeft.vue';
9
+ import IconArrowLeft from '../../../assets/icons/global/IconArrowLeft.vue';
10
10
  import { phoneNumberFormat } from '../../../utils/string-helper';
11
- import IconSms from '../../../assets/icons/IconSms.vue';
12
- import { activePlivoMode } from '../../..//utils/chat/message';
11
+ import IconSms from '../../../assets/icons/global/IconSms.vue';
12
+ import { activePlivoMode } from '../../../utils/chat/store/message';
13
13
  import { ref } from 'vue';
14
14
  import ButtonBase from '../../../components/common/button/ButtonBase.vue';
15
15
  const props = withDefaults(defineProps(), {});
@@ -1,14 +1,14 @@
1
1
  /// <reference types="C:/phonghq/go-chat-v2/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
2
- import IconPlan from '../../../assets/icons/IconPlan.vue';
2
+ import IconPlan from '../../../assets/icons/global/IconPlan.vue';
3
3
  import EmojiPicker from 'vue3-emoji-picker';
4
4
  import 'vue3-emoji-picker/css';
5
5
  import { useDebounce } from '../../../utils/debounce';
6
6
  import dayjs from 'dayjs';
7
7
  import { DATE_FORMATS, TIME_ZONE_UTC } from '../../../constant/datetime';
8
- import { dataProfile } from '../../../utils/chat/auth';
8
+ import { dataProfile } from '../../../utils/chat/store/auth';
9
9
  import { computed, ref } from 'vue';
10
10
  import PopoverBase from '../../../components/chat/common/popover/PopoverBase.vue';
11
- import { activePlivoMode } from '../../../utils/chat/message';
11
+ import { activePlivoMode } from '../../../utils/chat/store/message';
12
12
  const props = withDefaults(defineProps(), {});
13
13
  const emit = defineEmits();
14
14
  const ChatModeOptions = [
@@ -184,9 +184,6 @@ __VLS_asFunctionalElement(__VLS_elements.button, __VLS_elements.button)({
184
184
  } },
185
185
  ...{ class: "h-11 w-8" },
186
186
  });
187
- __VLS_asFunctionalDirective(__VLS_directives.vShow)(null, { ...__VLS_directiveBindingRestFields, value: (!(__VLS_ctx.keyword != '' && __VLS_ctx.responsive == 'mobile')) }, null, null);
188
- // @ts-ignore
189
- [keyword, responsive,];
190
187
  {
191
188
  const { content: __VLS_4 } = __VLS_2.slots;
192
189
  const __VLS_5 = {}.EmojiPicker;
@@ -0,0 +1,127 @@
1
+ /// <reference types="C:/phonghq/go-chat-v2/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
2
+ import { ref } from 'vue';
3
+ import DrawerBaseCustom from '../../../components/common/drawer/DrawerBaseCustom.vue';
4
+ import { responsiveObserver } from '../../../composable/useListentEvent';
5
+ import PhoneNumpad from '../../../views/home/phone-numpad/PhoneNumpad.vue';
6
+ const emit = defineEmits();
7
+ const drawerVisibleRef = ref();
8
+ const phoneNumpadRef = ref();
9
+ const openPhoneNumpad = () => {
10
+ phoneNumpadRef.value?.reset();
11
+ drawerVisibleRef.value?.open();
12
+ };
13
+ const handleCall = (data) => {
14
+ emit('call', data);
15
+ };
16
+ const __VLS_exposed = { openPhoneNumpad };
17
+ defineExpose(__VLS_exposed);
18
+ debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
19
+ const __VLS_ctx = {
20
+ ...{},
21
+ ...{},
22
+ ...{},
23
+ ...{},
24
+ ...{},
25
+ };
26
+ let __VLS_elements;
27
+ let __VLS_components;
28
+ let __VLS_directives;
29
+ if (__VLS_ctx.responsiveObserver == 'window') {
30
+ // @ts-ignore
31
+ [responsiveObserver,];
32
+ /** @type {[typeof PhoneNumpad, ]} */ ;
33
+ // @ts-ignore
34
+ const __VLS_0 = __VLS_asFunctionalComponent(PhoneNumpad, new PhoneNumpad({
35
+ ...{ 'onCall': {} },
36
+ ...{ class: "bg-white shrink-0 border-l layout-border" },
37
+ modelValue: "",
38
+ }));
39
+ const __VLS_1 = __VLS_0({
40
+ ...{ 'onCall': {} },
41
+ ...{ class: "bg-white shrink-0 border-l layout-border" },
42
+ modelValue: "",
43
+ }, ...__VLS_functionalComponentArgsRest(__VLS_0));
44
+ let __VLS_3;
45
+ let __VLS_4;
46
+ const __VLS_5 = ({ call: {} },
47
+ { onCall: (__VLS_ctx.handleCall) });
48
+ // @ts-ignore
49
+ [handleCall,];
50
+ var __VLS_2;
51
+ }
52
+ if (__VLS_ctx.responsiveObserver != 'window') {
53
+ // @ts-ignore
54
+ [responsiveObserver,];
55
+ /** @type {[typeof DrawerBaseCustom, typeof DrawerBaseCustom, ]} */ ;
56
+ // @ts-ignore
57
+ const __VLS_7 = __VLS_asFunctionalComponent(DrawerBaseCustom, new DrawerBaseCustom({
58
+ ref: "drawerVisibleRef",
59
+ width: (500),
60
+ }));
61
+ const __VLS_8 = __VLS_7({
62
+ ref: "drawerVisibleRef",
63
+ width: (500),
64
+ }, ...__VLS_functionalComponentArgsRest(__VLS_7));
65
+ /** @type {typeof __VLS_ctx.drawerVisibleRef} */ ;
66
+ var __VLS_10 = {};
67
+ const { default: __VLS_12 } = __VLS_9.slots;
68
+ // @ts-ignore
69
+ [drawerVisibleRef,];
70
+ {
71
+ const { content: __VLS_13 } = __VLS_9.slots;
72
+ __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
73
+ ...{ class: "h-full flex flex-col" },
74
+ });
75
+ /** @type {[typeof PhoneNumpad, ]} */ ;
76
+ // @ts-ignore
77
+ const __VLS_14 = __VLS_asFunctionalComponent(PhoneNumpad, new PhoneNumpad({
78
+ ...{ 'onCall': {} },
79
+ ...{ 'onBack': {} },
80
+ ref: "phoneNumpadRef",
81
+ ...{ class: "bg-white grow border-l layout-border w-full" },
82
+ }));
83
+ const __VLS_15 = __VLS_14({
84
+ ...{ 'onCall': {} },
85
+ ...{ 'onBack': {} },
86
+ ref: "phoneNumpadRef",
87
+ ...{ class: "bg-white grow border-l layout-border w-full" },
88
+ }, ...__VLS_functionalComponentArgsRest(__VLS_14));
89
+ let __VLS_17;
90
+ let __VLS_18;
91
+ const __VLS_19 = ({ call: {} },
92
+ { onCall: (__VLS_ctx.handleCall) });
93
+ const __VLS_20 = ({ back: {} },
94
+ { onBack: (...[$event]) => {
95
+ if (!(__VLS_ctx.responsiveObserver != 'window'))
96
+ return;
97
+ __VLS_ctx.drawerVisibleRef?.close();
98
+ // @ts-ignore
99
+ [handleCall, drawerVisibleRef,];
100
+ } });
101
+ /** @type {typeof __VLS_ctx.phoneNumpadRef} */ ;
102
+ var __VLS_21 = {};
103
+ // @ts-ignore
104
+ [phoneNumpadRef,];
105
+ var __VLS_16;
106
+ }
107
+ var __VLS_9;
108
+ }
109
+ /** @type {__VLS_StyleScopedClasses['bg-white']} */ ;
110
+ /** @type {__VLS_StyleScopedClasses['shrink-0']} */ ;
111
+ /** @type {__VLS_StyleScopedClasses['border-l']} */ ;
112
+ /** @type {__VLS_StyleScopedClasses['layout-border']} */ ;
113
+ /** @type {__VLS_StyleScopedClasses['h-full']} */ ;
114
+ /** @type {__VLS_StyleScopedClasses['flex']} */ ;
115
+ /** @type {__VLS_StyleScopedClasses['flex-col']} */ ;
116
+ /** @type {__VLS_StyleScopedClasses['bg-white']} */ ;
117
+ /** @type {__VLS_StyleScopedClasses['grow']} */ ;
118
+ /** @type {__VLS_StyleScopedClasses['border-l']} */ ;
119
+ /** @type {__VLS_StyleScopedClasses['layout-border']} */ ;
120
+ /** @type {__VLS_StyleScopedClasses['w-full']} */ ;
121
+ // @ts-ignore
122
+ var __VLS_11 = __VLS_10, __VLS_22 = __VLS_21;
123
+ const __VLS_export = (await import('vue')).defineComponent({
124
+ setup: () => (__VLS_exposed),
125
+ __typeEmits: {},
126
+ });
127
+ export default {};
@@ -1,7 +1,7 @@
1
1
  /// <reference types="C:/phonghq/go-chat-v2/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
2
2
  import { ref } from 'vue';
3
3
  import SelectBase from '../../../components/chat/select/SelectBase.vue';
4
- import { dataProfile } from '../../../utils/chat/auth';
4
+ import { dataProfile } from '../../../utils/chat/store/auth';
5
5
  import { createBusinessTenantPhone } from '../../../plugins/pocketbase';
6
6
  import { routerPush } from '../../../utils/chat/chat-router';
7
7
  import { PAGE } from '../../../constant/general';
@@ -26,6 +26,8 @@ const handleTouchMoveDebounce = useDebounce((event, el) => {
26
26
  handleTouchMove(event, el);
27
27
  }, 10);
28
28
  const handleTouchMove = async (event, el) => {
29
+ if (props.disabled)
30
+ return;
29
31
  scrollTopCurrent = el.scrollTop;
30
32
  if (el && el.scrollHeight <= el.clientHeight) {
31
33
  let position = event.touches[0].clientY;
@@ -1,12 +1,12 @@
1
1
  /// <reference types="C:/phonghq/go-chat-v2/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
2
2
  import { computed, onMounted, onUnmounted, ref } from 'vue';
3
3
  import IconPhone from '../../../assets/icons/call/IconPhone.vue';
4
- import { dataProfile } from '../../../utils/chat/auth.js';
4
+ import { dataProfile } from '../../../utils/chat/store/auth';
5
5
  import IconPhoneCancel from '../../../assets/icons/call/IconPhoneCancel.vue';
6
- import { downloadRecord, getPlivoAccessToken } from '../../../utils/chat/call';
6
+ import { downloadRecord, getPlivoAccessToken } from '../../../utils/chat/store/call';
7
7
  import DrawerBaseCustom from '../../../components/common/drawer/DrawerBaseCustom.vue';
8
8
  import Avatar from '../../../components/chat/customer/Avatar.vue';
9
- import { getUserDetailChat } from '../../../utils/chat/user';
9
+ import { getUserDetailChat } from '../../../utils/chat/store/user';
10
10
  import { formatPhone10number } from '../../../utils/chat/phone-string';
11
11
  import IconSoundDownload from '../../../assets/icons/call/IconSoundDownload.vue';
12
12
  import IconClose from '../../../assets/icons/call/IconClose.vue';
@@ -20,16 +20,6 @@ const props = withDefaults(defineProps(), {
20
20
  responsive: 'window'
21
21
  });
22
22
  const emit = defineEmits();
23
- // const {
24
- // // call,
25
- // // end,
26
- // // handleMedia,
27
- // // startIncomingCall,
28
- // // handleCallAnswer,
29
- // // callAnswer,
30
- // // uuid,
31
- // // startPeerConnection
32
- // } = useCallHelper()
33
23
  const handlePlivoCallBack = (status, data) => {
34
24
  if (status == PLIVO_CALL_STATUS.RINGING) {
35
25
  getUserOffer(data?.phone ?? '');
@@ -55,7 +45,6 @@ const handlePlivoCallBack = (status, data) => {
55
45
  }
56
46
  };
57
47
  const { plivoLogin, plivoCallAnswer, plivoCall, plivoEndCall, plivoCallSwishMute, plivoCallSwishSpeaker } = usePlivo(handlePlivoCallBack);
58
- // const { showError } = useError()
59
48
  const STATUS_LABEL = computed(() => {
60
49
  return {
61
50
  [PLIVO_CALL_STATUS.CONNECTING]: 'Connecting...',
@@ -100,11 +89,11 @@ onMounted(async () => {
100
89
  }
101
90
  });
102
91
  onUnmounted(() => {
103
- // removeHandleWebSK('call-message')
104
92
  if (timer)
105
93
  clearInterval(timer);
106
94
  if (timeOut)
107
95
  clearTimeout(timeOut);
96
+ endCall();
108
97
  errorMessage.value = '';
109
98
  });
110
99
  let dataWebSK = null;
@@ -299,7 +288,6 @@ let __VLS_directives;
299
288
  /** @type {__VLS_StyleScopedClasses['call-avatar']} */ ;
300
289
  /** @type {__VLS_StyleScopedClasses['call-avatar']} */ ;
301
290
  /** @type {__VLS_StyleScopedClasses['call-avatar']} */ ;
302
- /** @type {__VLS_StyleScopedClasses['call-avatar']} */ ;
303
291
  /** @type {[typeof DrawerBaseCustom, typeof DrawerBaseCustom, ]} */ ;
304
292
  // @ts-ignore
305
293
  const __VLS_0 = __VLS_asFunctionalComponent(DrawerBaseCustom, new DrawerBaseCustom({
@@ -334,7 +322,7 @@ const { default: __VLS_8 } = __VLS_2.slots;
334
322
  ...{ style: {} },
335
323
  });
336
324
  __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
337
- ...{ class: "h-40 w-40 call-avatar mb-8" },
325
+ ...{ class: "h-40 w-40 call-avatar mb-8" },
338
326
  });
339
327
  __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
340
328
  ...{ class: "h-40 w-40 rounded-full overflow-hidden mb-4 border-4 border-white flex-center" },
@@ -1,6 +1,6 @@
1
1
  /// <reference types="C:/phonghq/go-chat-v2/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
2
2
  import { computed } from 'vue';
3
- import IconSearch from '../../../../assets/icons/IconSearch.vue';
3
+ import IconSearch from '../../../../assets/icons/global/IconSearch.vue';
4
4
  import { useDebounce } from '../../../../utils/debounce';
5
5
  const props = withDefaults(defineProps(), {
6
6
  placeholder: 'Search...'