@phonghq/go-chat 1.0.69 → 1.0.71
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chat/App.vue.js +141 -97
- package/dist/components/chat/call/Calling.vue.js +15 -6
- package/dist/composable/usePlivo.d.ts +1 -0
- package/dist/composable/usePlivo.js +5 -1
- package/dist/go-chat.es.js +9235 -9215
- package/dist/go-chat.umd.js +21 -21
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/chat/App.vue.js
CHANGED
|
@@ -91,7 +91,7 @@ const routerMobileConfig = computed(() => [
|
|
|
91
91
|
}
|
|
92
92
|
]);
|
|
93
93
|
const props = withDefaults(defineProps(), {
|
|
94
|
-
response: 'tablet'
|
|
94
|
+
response: 'tablet',
|
|
95
95
|
});
|
|
96
96
|
const emit = defineEmits();
|
|
97
97
|
let initTimer = null;
|
|
@@ -224,7 +224,7 @@ defineExpose({
|
|
|
224
224
|
});
|
|
225
225
|
debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
|
|
226
226
|
const __VLS_defaults = {
|
|
227
|
-
response: 'tablet'
|
|
227
|
+
response: 'tablet',
|
|
228
228
|
};
|
|
229
229
|
const __VLS_ctx = {
|
|
230
230
|
...{},
|
|
@@ -286,21 +286,54 @@ else if (__VLS_ctx.currentPage == __VLS_ctx.PAGE.REGISTER_SUCCESS) {
|
|
|
286
286
|
else if (__VLS_ctx.currentPage == __VLS_ctx.PAGE.NOT_TENANT_PHONE) {
|
|
287
287
|
// @ts-ignore
|
|
288
288
|
[currentPage, PAGE,];
|
|
289
|
+
__VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
|
|
290
|
+
...{ class: "h-full p-5 flex flex-col" },
|
|
291
|
+
});
|
|
292
|
+
if (props.isLib) {
|
|
293
|
+
__VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
|
|
294
|
+
...{ class: "shrink-0 flex items-center justify-between" },
|
|
295
|
+
});
|
|
296
|
+
__VLS_asFunctionalElement(__VLS_elements.span, __VLS_elements.span)({});
|
|
297
|
+
__VLS_asFunctionalElement(__VLS_elements.button, __VLS_elements.button)({
|
|
298
|
+
...{ onClick: (...[$event]) => {
|
|
299
|
+
if (!!(!__VLS_ctx.isRouterReady))
|
|
300
|
+
return;
|
|
301
|
+
if (!!(__VLS_ctx.currentPage == __VLS_ctx.PAGE.TENANT_ERROR))
|
|
302
|
+
return;
|
|
303
|
+
if (!!(__VLS_ctx.currentPage == __VLS_ctx.PAGE.REGISTER_TENANT))
|
|
304
|
+
return;
|
|
305
|
+
if (!!(__VLS_ctx.currentPage == __VLS_ctx.PAGE.REGISTER_SUCCESS))
|
|
306
|
+
return;
|
|
307
|
+
if (!(__VLS_ctx.currentPage == __VLS_ctx.PAGE.NOT_TENANT_PHONE))
|
|
308
|
+
return;
|
|
309
|
+
if (!(props.isLib))
|
|
310
|
+
return;
|
|
311
|
+
__VLS_ctx.handleCloseBtn();
|
|
312
|
+
// @ts-ignore
|
|
313
|
+
[handleCloseBtn,];
|
|
314
|
+
} },
|
|
315
|
+
...{ class: "w-10 h-10" },
|
|
316
|
+
});
|
|
317
|
+
/** @type {[typeof IconCloseCircle, ]} */ ;
|
|
318
|
+
// @ts-ignore
|
|
319
|
+
const __VLS_16 = __VLS_asFunctionalComponent(IconCloseCircle, new IconCloseCircle({}));
|
|
320
|
+
const __VLS_17 = __VLS_16({}, ...__VLS_functionalComponentArgsRest(__VLS_16));
|
|
321
|
+
}
|
|
289
322
|
/** @type {[typeof NotTenantPhone, ]} */ ;
|
|
290
323
|
// @ts-ignore
|
|
291
|
-
const
|
|
324
|
+
const __VLS_20 = __VLS_asFunctionalComponent(NotTenantPhone, new NotTenantPhone({
|
|
292
325
|
...{ 'onTryAgain': {} },
|
|
293
|
-
...{ class: "bg-white" },
|
|
326
|
+
...{ class: "bg-white grow" },
|
|
294
327
|
isLib: (props.isLib),
|
|
295
328
|
}));
|
|
296
|
-
const
|
|
329
|
+
const __VLS_21 = __VLS_20({
|
|
297
330
|
...{ 'onTryAgain': {} },
|
|
298
|
-
...{ class: "bg-white" },
|
|
331
|
+
...{ class: "bg-white grow" },
|
|
299
332
|
isLib: (props.isLib),
|
|
300
|
-
}, ...__VLS_functionalComponentArgsRest(
|
|
301
|
-
let
|
|
302
|
-
let
|
|
303
|
-
const
|
|
333
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_20));
|
|
334
|
+
let __VLS_23;
|
|
335
|
+
let __VLS_24;
|
|
336
|
+
const __VLS_25 = ({ tryAgain: {} },
|
|
304
337
|
{ onTryAgain: (...[$event]) => {
|
|
305
338
|
if (!!(!__VLS_ctx.isRouterReady))
|
|
306
339
|
return;
|
|
@@ -316,7 +349,7 @@ else if (__VLS_ctx.currentPage == __VLS_ctx.PAGE.NOT_TENANT_PHONE) {
|
|
|
316
349
|
// @ts-ignore
|
|
317
350
|
[handleInitPage,];
|
|
318
351
|
} });
|
|
319
|
-
var
|
|
352
|
+
var __VLS_22;
|
|
320
353
|
}
|
|
321
354
|
else {
|
|
322
355
|
__VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
|
|
@@ -327,12 +360,12 @@ else {
|
|
|
327
360
|
[isLib,];
|
|
328
361
|
/** @type {[typeof PageError, ]} */ ;
|
|
329
362
|
// @ts-ignore
|
|
330
|
-
const
|
|
363
|
+
const __VLS_27 = __VLS_asFunctionalComponent(PageError, new PageError({
|
|
331
364
|
...{ class: "shrink-0" },
|
|
332
365
|
}));
|
|
333
|
-
const
|
|
366
|
+
const __VLS_28 = __VLS_27({
|
|
334
367
|
...{ class: "shrink-0" },
|
|
335
|
-
}, ...__VLS_functionalComponentArgsRest(
|
|
368
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_27));
|
|
336
369
|
}
|
|
337
370
|
__VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
|
|
338
371
|
...{ class: "w-full grow flex overflow-hidden relative" },
|
|
@@ -342,21 +375,21 @@ else {
|
|
|
342
375
|
[isLib,];
|
|
343
376
|
/** @type {[typeof Calling, ]} */ ;
|
|
344
377
|
// @ts-ignore
|
|
345
|
-
const
|
|
378
|
+
const __VLS_31 = __VLS_asFunctionalComponent(Calling, new Calling({
|
|
346
379
|
...{ 'onUserCalling': {} },
|
|
347
380
|
...{ 'onEndCall': {} },
|
|
348
381
|
ref: "callingRef",
|
|
349
382
|
responsive: (__VLS_ctx.responsiveRender),
|
|
350
383
|
}));
|
|
351
|
-
const
|
|
384
|
+
const __VLS_32 = __VLS_31({
|
|
352
385
|
...{ 'onUserCalling': {} },
|
|
353
386
|
...{ 'onEndCall': {} },
|
|
354
387
|
ref: "callingRef",
|
|
355
388
|
responsive: (__VLS_ctx.responsiveRender),
|
|
356
|
-
}, ...__VLS_functionalComponentArgsRest(
|
|
357
|
-
let
|
|
358
|
-
let
|
|
359
|
-
const
|
|
389
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_31));
|
|
390
|
+
let __VLS_34;
|
|
391
|
+
let __VLS_35;
|
|
392
|
+
const __VLS_36 = ({ userCalling: {} },
|
|
360
393
|
{ onUserCalling: (...[$event]) => {
|
|
361
394
|
if (!!(!__VLS_ctx.isRouterReady))
|
|
362
395
|
return;
|
|
@@ -374,7 +407,7 @@ else {
|
|
|
374
407
|
// @ts-ignore
|
|
375
408
|
[responsiveRender, emit,];
|
|
376
409
|
} });
|
|
377
|
-
const
|
|
410
|
+
const __VLS_37 = ({ endCall: {} },
|
|
378
411
|
{ onEndCall: (...[$event]) => {
|
|
379
412
|
if (!!(!__VLS_ctx.isRouterReady))
|
|
380
413
|
return;
|
|
@@ -393,10 +426,10 @@ else {
|
|
|
393
426
|
[emit,];
|
|
394
427
|
} });
|
|
395
428
|
/** @type {typeof __VLS_ctx.callingRef} */ ;
|
|
396
|
-
var
|
|
429
|
+
var __VLS_38 = {};
|
|
397
430
|
// @ts-ignore
|
|
398
431
|
[callingRef,];
|
|
399
|
-
var
|
|
432
|
+
var __VLS_33;
|
|
400
433
|
}
|
|
401
434
|
if (__VLS_ctx.responsiveRender == 'mobile') {
|
|
402
435
|
// @ts-ignore
|
|
@@ -440,8 +473,8 @@ else {
|
|
|
440
473
|
});
|
|
441
474
|
/** @type {[typeof IconArrowLeft, ]} */ ;
|
|
442
475
|
// @ts-ignore
|
|
443
|
-
const
|
|
444
|
-
const
|
|
476
|
+
const __VLS_41 = __VLS_asFunctionalComponent(IconArrowLeft, new IconArrowLeft({}));
|
|
477
|
+
const __VLS_42 = __VLS_41({}, ...__VLS_functionalComponentArgsRest(__VLS_41));
|
|
445
478
|
__VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
|
|
446
479
|
...{ class: "ml-3" },
|
|
447
480
|
});
|
|
@@ -513,15 +546,15 @@ else {
|
|
|
513
546
|
});
|
|
514
547
|
/** @type {[typeof IconCloseCircle, ]} */ ;
|
|
515
548
|
// @ts-ignore
|
|
516
|
-
const
|
|
517
|
-
const
|
|
549
|
+
const __VLS_45 = __VLS_asFunctionalComponent(IconCloseCircle, new IconCloseCircle({}));
|
|
550
|
+
const __VLS_46 = __VLS_45({}, ...__VLS_functionalComponentArgsRest(__VLS_45));
|
|
518
551
|
}
|
|
519
552
|
__VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
|
|
520
553
|
...{ class: "grow overflow-hidden" },
|
|
521
554
|
});
|
|
522
555
|
/** @type {[typeof ChatList, ]} */ ;
|
|
523
556
|
// @ts-ignore
|
|
524
|
-
const
|
|
557
|
+
const __VLS_49 = __VLS_asFunctionalComponent(ChatList, new ChatList({
|
|
525
558
|
...{ 'onSelectReceiver': {} },
|
|
526
559
|
...{ 'onOpenPhoneNumpad': {} },
|
|
527
560
|
ref: "chatListRef",
|
|
@@ -529,19 +562,19 @@ else {
|
|
|
529
562
|
responsive: (__VLS_ctx.responsiveRender),
|
|
530
563
|
receiverId: (__VLS_ctx.receiverId),
|
|
531
564
|
}));
|
|
532
|
-
const
|
|
565
|
+
const __VLS_50 = __VLS_49({
|
|
533
566
|
...{ 'onSelectReceiver': {} },
|
|
534
567
|
...{ 'onOpenPhoneNumpad': {} },
|
|
535
568
|
ref: "chatListRef",
|
|
536
569
|
...{ class: "w-full max-w-[500px] !bg-[#F9FAFC]" },
|
|
537
570
|
responsive: (__VLS_ctx.responsiveRender),
|
|
538
571
|
receiverId: (__VLS_ctx.receiverId),
|
|
539
|
-
}, ...__VLS_functionalComponentArgsRest(
|
|
540
|
-
let
|
|
541
|
-
let
|
|
542
|
-
const
|
|
572
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_49));
|
|
573
|
+
let __VLS_52;
|
|
574
|
+
let __VLS_53;
|
|
575
|
+
const __VLS_54 = ({ selectReceiver: {} },
|
|
543
576
|
{ onSelectReceiver: (__VLS_ctx.selectReceiver) });
|
|
544
|
-
const
|
|
577
|
+
const __VLS_55 = ({ openPhoneNumpad: {} },
|
|
545
578
|
{ onOpenPhoneNumpad: (...[$event]) => {
|
|
546
579
|
if (!!(!__VLS_ctx.isRouterReady))
|
|
547
580
|
return;
|
|
@@ -561,13 +594,13 @@ else {
|
|
|
561
594
|
} });
|
|
562
595
|
__VLS_asFunctionalDirective(__VLS_directives.vShow)(null, { ...__VLS_directiveBindingRestFields, value: (__VLS_ctx.currentPage == __VLS_ctx.PAGE.CHAT_LIST) }, null, null);
|
|
563
596
|
/** @type {typeof __VLS_ctx.chatListRef} */ ;
|
|
564
|
-
var
|
|
597
|
+
var __VLS_56 = {};
|
|
565
598
|
// @ts-ignore
|
|
566
599
|
[currentPage, PAGE, chatListRef,];
|
|
567
|
-
var
|
|
600
|
+
var __VLS_51;
|
|
568
601
|
/** @type {[typeof HomeComponent, ]} */ ;
|
|
569
602
|
// @ts-ignore
|
|
570
|
-
const
|
|
603
|
+
const __VLS_59 = __VLS_asFunctionalComponent(HomeComponent, new HomeComponent({
|
|
571
604
|
...{ 'onCall': {} },
|
|
572
605
|
...{ 'onBack': {} },
|
|
573
606
|
...{ 'onInputFocus': {} },
|
|
@@ -577,7 +610,7 @@ else {
|
|
|
577
610
|
conversation: (__VLS_ctx.currentConversation),
|
|
578
611
|
responsive: (__VLS_ctx.responsiveRender),
|
|
579
612
|
}));
|
|
580
|
-
const
|
|
613
|
+
const __VLS_60 = __VLS_59({
|
|
581
614
|
...{ 'onCall': {} },
|
|
582
615
|
...{ 'onBack': {} },
|
|
583
616
|
...{ 'onInputFocus': {} },
|
|
@@ -586,12 +619,12 @@ else {
|
|
|
586
619
|
...{ class: "h-full" },
|
|
587
620
|
conversation: (__VLS_ctx.currentConversation),
|
|
588
621
|
responsive: (__VLS_ctx.responsiveRender),
|
|
589
|
-
}, ...__VLS_functionalComponentArgsRest(
|
|
590
|
-
let
|
|
591
|
-
let
|
|
592
|
-
const
|
|
622
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_59));
|
|
623
|
+
let __VLS_62;
|
|
624
|
+
let __VLS_63;
|
|
625
|
+
const __VLS_64 = ({ call: {} },
|
|
593
626
|
{ onCall: (__VLS_ctx.handleCall) });
|
|
594
|
-
const
|
|
627
|
+
const __VLS_65 = ({ back: {} },
|
|
595
628
|
{ onBack: (...[$event]) => {
|
|
596
629
|
if (!!(!__VLS_ctx.isRouterReady))
|
|
597
630
|
return;
|
|
@@ -609,60 +642,60 @@ else {
|
|
|
609
642
|
// @ts-ignore
|
|
610
643
|
[responsiveRender, currentPageConfig, receiverId, currentConversation, handleCall,];
|
|
611
644
|
} });
|
|
612
|
-
const
|
|
645
|
+
const __VLS_66 = ({ inputFocus: {} },
|
|
613
646
|
{ onInputFocus: (__VLS_ctx.handleReadMessage) });
|
|
614
647
|
__VLS_asFunctionalDirective(__VLS_directives.vShow)(null, { ...__VLS_directiveBindingRestFields, value: (__VLS_ctx.currentPage == __VLS_ctx.PAGE.HOME) }, null, null);
|
|
615
648
|
/** @type {typeof __VLS_ctx.homeComponentRef} */ ;
|
|
616
|
-
var
|
|
649
|
+
var __VLS_67 = {};
|
|
617
650
|
// @ts-ignore
|
|
618
651
|
[currentPage, PAGE, handleReadMessage, homeComponentRef,];
|
|
619
|
-
var
|
|
652
|
+
var __VLS_61;
|
|
620
653
|
if (__VLS_ctx.currentPage == __VLS_ctx.PAGE.CUSTOMER_DETAIL) {
|
|
621
654
|
// @ts-ignore
|
|
622
655
|
[currentPage, PAGE,];
|
|
623
656
|
/** @type {[typeof CustomerDetail, ]} */ ;
|
|
624
657
|
// @ts-ignore
|
|
625
|
-
const
|
|
658
|
+
const __VLS_70 = __VLS_asFunctionalComponent(CustomerDetail, new CustomerDetail({
|
|
626
659
|
ref: "customerDetailRef",
|
|
627
660
|
receiverId: (__VLS_ctx.receiverId),
|
|
628
661
|
...{ class: "w-full h-full" },
|
|
629
662
|
responsive: (__VLS_ctx.responsiveRender),
|
|
630
663
|
}));
|
|
631
|
-
const
|
|
664
|
+
const __VLS_71 = __VLS_70({
|
|
632
665
|
ref: "customerDetailRef",
|
|
633
666
|
receiverId: (__VLS_ctx.receiverId),
|
|
634
667
|
...{ class: "w-full h-full" },
|
|
635
668
|
responsive: (__VLS_ctx.responsiveRender),
|
|
636
|
-
}, ...__VLS_functionalComponentArgsRest(
|
|
669
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_70));
|
|
637
670
|
/** @type {typeof __VLS_ctx.customerDetailRef} */ ;
|
|
638
|
-
var
|
|
671
|
+
var __VLS_73 = {};
|
|
639
672
|
// @ts-ignore
|
|
640
673
|
[responsiveRender, receiverId, customerDetailRef,];
|
|
641
|
-
var
|
|
674
|
+
var __VLS_72;
|
|
642
675
|
}
|
|
643
676
|
if (__VLS_ctx.currentPage == __VLS_ctx.PAGE.CUSTOMER_CHECK_IN) {
|
|
644
677
|
// @ts-ignore
|
|
645
678
|
[currentPage, PAGE,];
|
|
646
679
|
/** @type {[typeof CustomerCheckIn, ]} */ ;
|
|
647
680
|
// @ts-ignore
|
|
648
|
-
const
|
|
681
|
+
const __VLS_76 = __VLS_asFunctionalComponent(CustomerCheckIn, new CustomerCheckIn({
|
|
649
682
|
...{ class: "w-full h-full" },
|
|
650
683
|
}));
|
|
651
|
-
const
|
|
684
|
+
const __VLS_77 = __VLS_76({
|
|
652
685
|
...{ class: "w-full h-full" },
|
|
653
|
-
}, ...__VLS_functionalComponentArgsRest(
|
|
686
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_76));
|
|
654
687
|
}
|
|
655
688
|
if (__VLS_ctx.currentPage == __VLS_ctx.PAGE.CUSTOMER_APPOINTMENT) {
|
|
656
689
|
// @ts-ignore
|
|
657
690
|
[currentPage, PAGE,];
|
|
658
691
|
/** @type {[typeof CustomerAppointment, ]} */ ;
|
|
659
692
|
// @ts-ignore
|
|
660
|
-
const
|
|
693
|
+
const __VLS_80 = __VLS_asFunctionalComponent(CustomerAppointment, new CustomerAppointment({
|
|
661
694
|
...{ class: "w-full h-full" },
|
|
662
695
|
}));
|
|
663
|
-
const
|
|
696
|
+
const __VLS_81 = __VLS_80({
|
|
664
697
|
...{ class: "w-full h-full" },
|
|
665
|
-
}, ...__VLS_functionalComponentArgsRest(
|
|
698
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_80));
|
|
666
699
|
}
|
|
667
700
|
}
|
|
668
701
|
else {
|
|
@@ -671,7 +704,7 @@ else {
|
|
|
671
704
|
});
|
|
672
705
|
/** @type {[typeof ChatList, ]} */ ;
|
|
673
706
|
// @ts-ignore
|
|
674
|
-
const
|
|
707
|
+
const __VLS_84 = __VLS_asFunctionalComponent(ChatList, new ChatList({
|
|
675
708
|
...{ 'onSelectReceiver': {} },
|
|
676
709
|
...{ 'onOpenPhoneNumpad': {} },
|
|
677
710
|
ref: "chatListRef",
|
|
@@ -679,19 +712,19 @@ else {
|
|
|
679
712
|
responsive: (__VLS_ctx.responsiveRender),
|
|
680
713
|
receiverId: (__VLS_ctx.receiverId),
|
|
681
714
|
}));
|
|
682
|
-
const
|
|
715
|
+
const __VLS_85 = __VLS_84({
|
|
683
716
|
...{ 'onSelectReceiver': {} },
|
|
684
717
|
...{ 'onOpenPhoneNumpad': {} },
|
|
685
718
|
ref: "chatListRef",
|
|
686
719
|
...{ class: "w-[38%] max-w-[500px] min-w-[300px] xl:min-w-[450px] border-r layout-border" },
|
|
687
720
|
responsive: (__VLS_ctx.responsiveRender),
|
|
688
721
|
receiverId: (__VLS_ctx.receiverId),
|
|
689
|
-
}, ...__VLS_functionalComponentArgsRest(
|
|
690
|
-
let
|
|
691
|
-
let
|
|
692
|
-
const
|
|
722
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_84));
|
|
723
|
+
let __VLS_87;
|
|
724
|
+
let __VLS_88;
|
|
725
|
+
const __VLS_89 = ({ selectReceiver: {} },
|
|
693
726
|
{ onSelectReceiver: (__VLS_ctx.selectReceiver) });
|
|
694
|
-
const
|
|
727
|
+
const __VLS_90 = ({ openPhoneNumpad: {} },
|
|
695
728
|
{ onOpenPhoneNumpad: (...[$event]) => {
|
|
696
729
|
if (!!(!__VLS_ctx.isRouterReady))
|
|
697
730
|
return;
|
|
@@ -710,10 +743,10 @@ else {
|
|
|
710
743
|
[responsiveRender, receiverId, selectReceiver, handleOpenPhoneNumpad,];
|
|
711
744
|
} });
|
|
712
745
|
/** @type {typeof __VLS_ctx.chatListRef} */ ;
|
|
713
|
-
var
|
|
746
|
+
var __VLS_91 = {};
|
|
714
747
|
// @ts-ignore
|
|
715
748
|
[chatListRef,];
|
|
716
|
-
var
|
|
749
|
+
var __VLS_86;
|
|
717
750
|
__VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
|
|
718
751
|
...{ class: "bg-white grow flex flex-col h-full overflow-hidden" },
|
|
719
752
|
});
|
|
@@ -747,8 +780,8 @@ else {
|
|
|
747
780
|
});
|
|
748
781
|
/** @type {[typeof IconArrowLeft, ]} */ ;
|
|
749
782
|
// @ts-ignore
|
|
750
|
-
const
|
|
751
|
-
const
|
|
783
|
+
const __VLS_94 = __VLS_asFunctionalComponent(IconArrowLeft, new IconArrowLeft({}));
|
|
784
|
+
const __VLS_95 = __VLS_94({}, ...__VLS_functionalComponentArgsRest(__VLS_94));
|
|
752
785
|
__VLS_asFunctionalElement(__VLS_elements.span, __VLS_elements.span)({
|
|
753
786
|
...{ class: "text-xl font-semibold text-chat-haze-900 ml-3" },
|
|
754
787
|
});
|
|
@@ -761,7 +794,7 @@ else {
|
|
|
761
794
|
});
|
|
762
795
|
/** @type {[typeof HomeComponent, ]} */ ;
|
|
763
796
|
// @ts-ignore
|
|
764
|
-
const
|
|
797
|
+
const __VLS_98 = __VLS_asFunctionalComponent(HomeComponent, new HomeComponent({
|
|
765
798
|
...{ 'onCall': {} },
|
|
766
799
|
...{ 'onInputFocus': {} },
|
|
767
800
|
ref: "homeComponentRef",
|
|
@@ -770,7 +803,7 @@ else {
|
|
|
770
803
|
responsive: (__VLS_ctx.responsiveRender),
|
|
771
804
|
conversation: (__VLS_ctx.currentConversation),
|
|
772
805
|
}));
|
|
773
|
-
const
|
|
806
|
+
const __VLS_99 = __VLS_98({
|
|
774
807
|
...{ 'onCall': {} },
|
|
775
808
|
...{ 'onInputFocus': {} },
|
|
776
809
|
ref: "homeComponentRef",
|
|
@@ -778,92 +811,92 @@ else {
|
|
|
778
811
|
...{ class: "h-full" },
|
|
779
812
|
responsive: (__VLS_ctx.responsiveRender),
|
|
780
813
|
conversation: (__VLS_ctx.currentConversation),
|
|
781
|
-
}, ...__VLS_functionalComponentArgsRest(
|
|
782
|
-
let
|
|
783
|
-
let
|
|
784
|
-
const
|
|
814
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_98));
|
|
815
|
+
let __VLS_101;
|
|
816
|
+
let __VLS_102;
|
|
817
|
+
const __VLS_103 = ({ call: {} },
|
|
785
818
|
{ onCall: (__VLS_ctx.handleCall) });
|
|
786
|
-
const
|
|
819
|
+
const __VLS_104 = ({ inputFocus: {} },
|
|
787
820
|
{ onInputFocus: (__VLS_ctx.handleReadMessage) });
|
|
788
821
|
__VLS_asFunctionalDirective(__VLS_directives.vShow)(null, { ...__VLS_directiveBindingRestFields, value: (__VLS_ctx.currentPage == __VLS_ctx.PAGE.HOME && __VLS_ctx.receiverId) }, null, null);
|
|
789
822
|
/** @type {typeof __VLS_ctx.homeComponentRef} */ ;
|
|
790
|
-
var
|
|
823
|
+
var __VLS_105 = {};
|
|
791
824
|
// @ts-ignore
|
|
792
825
|
[currentPage, PAGE, responsiveRender, receiverId, receiverId, currentConversation, handleCall, handleReadMessage, homeComponentRef,];
|
|
793
|
-
var
|
|
826
|
+
var __VLS_100;
|
|
794
827
|
if (__VLS_ctx.currentPage == __VLS_ctx.PAGE.CUSTOMER_DETAIL) {
|
|
795
828
|
// @ts-ignore
|
|
796
829
|
[currentPage, PAGE,];
|
|
797
830
|
/** @type {[typeof CustomerDetail, ]} */ ;
|
|
798
831
|
// @ts-ignore
|
|
799
|
-
const
|
|
832
|
+
const __VLS_108 = __VLS_asFunctionalComponent(CustomerDetail, new CustomerDetail({
|
|
800
833
|
ref: "customerDetailRef",
|
|
801
834
|
receiverId: (__VLS_ctx.receiverId),
|
|
802
835
|
...{ class: "h-full" },
|
|
803
836
|
responsive: (__VLS_ctx.responsiveRender),
|
|
804
837
|
}));
|
|
805
|
-
const
|
|
838
|
+
const __VLS_109 = __VLS_108({
|
|
806
839
|
ref: "customerDetailRef",
|
|
807
840
|
receiverId: (__VLS_ctx.receiverId),
|
|
808
841
|
...{ class: "h-full" },
|
|
809
842
|
responsive: (__VLS_ctx.responsiveRender),
|
|
810
|
-
}, ...__VLS_functionalComponentArgsRest(
|
|
843
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_108));
|
|
811
844
|
/** @type {typeof __VLS_ctx.customerDetailRef} */ ;
|
|
812
|
-
var
|
|
845
|
+
var __VLS_111 = {};
|
|
813
846
|
// @ts-ignore
|
|
814
847
|
[responsiveRender, receiverId, customerDetailRef,];
|
|
815
|
-
var
|
|
848
|
+
var __VLS_110;
|
|
816
849
|
}
|
|
817
850
|
if (__VLS_ctx.currentPage == __VLS_ctx.PAGE.CUSTOMER_CHECK_IN) {
|
|
818
851
|
// @ts-ignore
|
|
819
852
|
[currentPage, PAGE,];
|
|
820
853
|
/** @type {[typeof CustomerCheckIn, ]} */ ;
|
|
821
854
|
// @ts-ignore
|
|
822
|
-
const
|
|
855
|
+
const __VLS_114 = __VLS_asFunctionalComponent(CustomerCheckIn, new CustomerCheckIn({
|
|
823
856
|
...{ class: "h-full" },
|
|
824
857
|
}));
|
|
825
|
-
const
|
|
858
|
+
const __VLS_115 = __VLS_114({
|
|
826
859
|
...{ class: "h-full" },
|
|
827
|
-
}, ...__VLS_functionalComponentArgsRest(
|
|
860
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_114));
|
|
828
861
|
}
|
|
829
862
|
if (__VLS_ctx.currentPage == __VLS_ctx.PAGE.CUSTOMER_APPOINTMENT) {
|
|
830
863
|
// @ts-ignore
|
|
831
864
|
[currentPage, PAGE,];
|
|
832
865
|
/** @type {[typeof CustomerAppointment, ]} */ ;
|
|
833
866
|
// @ts-ignore
|
|
834
|
-
const
|
|
867
|
+
const __VLS_118 = __VLS_asFunctionalComponent(CustomerAppointment, new CustomerAppointment({
|
|
835
868
|
...{ class: "h-full" },
|
|
836
869
|
}));
|
|
837
|
-
const
|
|
870
|
+
const __VLS_119 = __VLS_118({
|
|
838
871
|
...{ class: "h-full" },
|
|
839
|
-
}, ...__VLS_functionalComponentArgsRest(
|
|
872
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_118));
|
|
840
873
|
}
|
|
841
874
|
}
|
|
842
875
|
/** @type {[typeof PhoneNumpad, ]} */ ;
|
|
843
876
|
// @ts-ignore
|
|
844
|
-
const
|
|
877
|
+
const __VLS_122 = __VLS_asFunctionalComponent(PhoneNumpad, new PhoneNumpad({
|
|
845
878
|
...{ 'onCall': {} },
|
|
846
879
|
ref: "phoneNumpadRef",
|
|
847
880
|
hideNumpad: (__VLS_ctx.isLib),
|
|
848
881
|
responsive: (__VLS_ctx.responsiveRender),
|
|
849
882
|
...{ class: "bg-white shrink-0 border-l layout-border" },
|
|
850
883
|
}));
|
|
851
|
-
const
|
|
884
|
+
const __VLS_123 = __VLS_122({
|
|
852
885
|
...{ 'onCall': {} },
|
|
853
886
|
ref: "phoneNumpadRef",
|
|
854
887
|
hideNumpad: (__VLS_ctx.isLib),
|
|
855
888
|
responsive: (__VLS_ctx.responsiveRender),
|
|
856
889
|
...{ class: "bg-white shrink-0 border-l layout-border" },
|
|
857
|
-
}, ...__VLS_functionalComponentArgsRest(
|
|
858
|
-
let
|
|
859
|
-
let
|
|
860
|
-
const
|
|
890
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_122));
|
|
891
|
+
let __VLS_125;
|
|
892
|
+
let __VLS_126;
|
|
893
|
+
const __VLS_127 = ({ call: {} },
|
|
861
894
|
{ onCall: (__VLS_ctx.handleCall) });
|
|
862
895
|
/** @type {typeof __VLS_ctx.phoneNumpadRef} */ ;
|
|
863
|
-
var
|
|
896
|
+
var __VLS_128 = {};
|
|
864
897
|
// @ts-ignore
|
|
865
898
|
[isLib, responsiveRender, handleCall, phoneNumpadRef,];
|
|
866
|
-
var
|
|
899
|
+
var __VLS_124;
|
|
867
900
|
}
|
|
868
901
|
/** @type {__VLS_StyleScopedClasses['go-chat-main']} */ ;
|
|
869
902
|
/** @type {__VLS_StyleScopedClasses['max-w-full']} */ ;
|
|
@@ -872,8 +905,19 @@ else {
|
|
|
872
905
|
/** @type {__VLS_StyleScopedClasses['flex-center']} */ ;
|
|
873
906
|
/** @type {__VLS_StyleScopedClasses['sc-full']} */ ;
|
|
874
907
|
/** @type {__VLS_StyleScopedClasses['mt-10']} */ ;
|
|
908
|
+
/** @type {__VLS_StyleScopedClasses['h-full']} */ ;
|
|
909
|
+
/** @type {__VLS_StyleScopedClasses['p-5']} */ ;
|
|
910
|
+
/** @type {__VLS_StyleScopedClasses['flex']} */ ;
|
|
911
|
+
/** @type {__VLS_StyleScopedClasses['flex-col']} */ ;
|
|
912
|
+
/** @type {__VLS_StyleScopedClasses['shrink-0']} */ ;
|
|
913
|
+
/** @type {__VLS_StyleScopedClasses['flex']} */ ;
|
|
914
|
+
/** @type {__VLS_StyleScopedClasses['items-center']} */ ;
|
|
915
|
+
/** @type {__VLS_StyleScopedClasses['justify-between']} */ ;
|
|
916
|
+
/** @type {__VLS_StyleScopedClasses['w-10']} */ ;
|
|
917
|
+
/** @type {__VLS_StyleScopedClasses['h-10']} */ ;
|
|
875
918
|
/** @type {__VLS_StyleScopedClasses['bg-white']} */ ;
|
|
876
919
|
/** @type {__VLS_StyleScopedClasses['grow']} */ ;
|
|
920
|
+
/** @type {__VLS_StyleScopedClasses['grow']} */ ;
|
|
877
921
|
/** @type {__VLS_StyleScopedClasses['h-full']} */ ;
|
|
878
922
|
/** @type {__VLS_StyleScopedClasses['overflow-hidden']} */ ;
|
|
879
923
|
/** @type {__VLS_StyleScopedClasses['flex']} */ ;
|
|
@@ -966,7 +1010,7 @@ else {
|
|
|
966
1010
|
/** @type {__VLS_StyleScopedClasses['border-l']} */ ;
|
|
967
1011
|
/** @type {__VLS_StyleScopedClasses['layout-border']} */ ;
|
|
968
1012
|
// @ts-ignore
|
|
969
|
-
var
|
|
1013
|
+
var __VLS_39 = __VLS_38, __VLS_57 = __VLS_56, __VLS_68 = __VLS_67, __VLS_74 = __VLS_73, __VLS_92 = __VLS_91, __VLS_106 = __VLS_105, __VLS_112 = __VLS_111, __VLS_129 = __VLS_128;
|
|
970
1014
|
const __VLS_export = (await import('vue')).defineComponent({
|
|
971
1015
|
setup: () => (__VLS_exposed),
|
|
972
1016
|
__typeEmits: {},
|
|
@@ -46,7 +46,7 @@ const handlePlivoCallBack = (status, data) => {
|
|
|
46
46
|
handleMedialPermissionError();
|
|
47
47
|
}
|
|
48
48
|
};
|
|
49
|
-
const { plivoLogin, plivoCallAnswer, plivoCall, plivoEndCall, plivoCallSwishMute, plivoCallSwishSpeaker, plivoRemoveCallBack, checkTimeLimit, isPlivoOn } = usePlivo(handlePlivoCallBack);
|
|
49
|
+
const { plivoLogin, plivoCallAnswer, plivoCall, plivoEndCall, plivoCallSwishMute, plivoCallSwishSpeaker, plivoRemoveCallBack, checkTimeLimit, isPlivoOn, isPlivoOn2 } = usePlivo(handlePlivoCallBack);
|
|
50
50
|
const STATUS_LABEL = computed(() => {
|
|
51
51
|
return {
|
|
52
52
|
[PLIVO_CALL_STATUS.CONNECTING]: 'Connecting...',
|
|
@@ -63,6 +63,7 @@ const STATUS_LABEL = computed(() => {
|
|
|
63
63
|
[PLIVO_CALL_STATUS.CHECK_USER_OFFER]: ''
|
|
64
64
|
};
|
|
65
65
|
});
|
|
66
|
+
const REFRESH_TOKEN_TIME = 15 * 60 * 1000;
|
|
66
67
|
const label = computed(() => STATUS_LABEL.value[callStatus.value] ?? '');
|
|
67
68
|
const callStatus = ref(PLIVO_CALL_STATUS.CONNECTING);
|
|
68
69
|
const duration = ref('00:00');
|
|
@@ -86,7 +87,7 @@ onMounted(async () => {
|
|
|
86
87
|
if (dataProfile.value?.phone) {
|
|
87
88
|
const token = await getPlivoAccessToken();
|
|
88
89
|
await plivoLogin({ token });
|
|
89
|
-
setTimeout(refreshToken,
|
|
90
|
+
setTimeout(refreshToken, REFRESH_TOKEN_TIME);
|
|
90
91
|
}
|
|
91
92
|
}
|
|
92
93
|
catch {
|
|
@@ -94,17 +95,23 @@ onMounted(async () => {
|
|
|
94
95
|
}
|
|
95
96
|
});
|
|
96
97
|
onBeforeUnmount(() => {
|
|
97
|
-
|
|
98
|
+
if (timer)
|
|
99
|
+
clearInterval(timer);
|
|
100
|
+
if (timeOut)
|
|
101
|
+
clearTimeout(timeOut);
|
|
102
|
+
endCall();
|
|
103
|
+
console.log('aaaaaaaaaaaaaaaaaaaaaaaa');
|
|
98
104
|
plivoRemoveCallBack();
|
|
105
|
+
errorMessage.value = '';
|
|
99
106
|
});
|
|
100
107
|
onUnmounted(() => {
|
|
101
|
-
console.log('ssssssssssssssssssssssss');
|
|
102
108
|
if (timer)
|
|
103
109
|
clearInterval(timer);
|
|
104
110
|
if (timeOut)
|
|
105
111
|
clearTimeout(timeOut);
|
|
106
112
|
endCall();
|
|
107
|
-
|
|
113
|
+
console.log('aaaaaaaaaaaaaaaaaaaaaaaa');
|
|
114
|
+
plivoRemoveCallBack();
|
|
108
115
|
errorMessage.value = '';
|
|
109
116
|
});
|
|
110
117
|
let dataWebSK = null;
|
|
@@ -154,7 +161,7 @@ const refreshToken = async () => {
|
|
|
154
161
|
}
|
|
155
162
|
const token = await getPlivoAccessToken();
|
|
156
163
|
await plivoLogin({ token, isRefresh: true });
|
|
157
|
-
setTimeout(() => refreshToken(),
|
|
164
|
+
setTimeout(() => refreshToken(), REFRESH_TOKEN_TIME);
|
|
158
165
|
refreshTokenCount = 0;
|
|
159
166
|
}
|
|
160
167
|
catch (e) {
|
|
@@ -247,6 +254,8 @@ const getUserOffer = async (phone) => {
|
|
|
247
254
|
}
|
|
248
255
|
};
|
|
249
256
|
const handleTimeLimitError = () => {
|
|
257
|
+
console.log(isPlivoOn.value, 'isPlivoOn.value isPlivoOn.value');
|
|
258
|
+
console.log(isPlivoOn2, 'isPlivoOn2');
|
|
250
259
|
if (!isPlivoOn.value)
|
|
251
260
|
return;
|
|
252
261
|
errorMessage.value = 'Call time limit reached. This call has ended.';
|
|
@@ -17,6 +17,7 @@ export function usePlivo(callback) {
|
|
|
17
17
|
let custom_resolve = null;
|
|
18
18
|
let custom_reject = null;
|
|
19
19
|
const isPlivoOn = ref(false);
|
|
20
|
+
let isPlivoOn2 = false;
|
|
20
21
|
const plivoLogin = async (data) => {
|
|
21
22
|
try {
|
|
22
23
|
if (!plivoBrowserSdk) {
|
|
@@ -44,6 +45,7 @@ export function usePlivo(callback) {
|
|
|
44
45
|
await plivoBrowserSdk?.client?.loginWithAccessToken(data.token);
|
|
45
46
|
plivoBrowserSdk?.client?.setRingTone(false);
|
|
46
47
|
isPlivoOn.value = true;
|
|
48
|
+
isPlivoOn2 = true;
|
|
47
49
|
// await plivoBrowserSdk?.client?.on?.(payload)
|
|
48
50
|
// console.log('Registered with token')
|
|
49
51
|
console.log(plivoBrowserSdk);
|
|
@@ -184,6 +186,7 @@ export function usePlivo(callback) {
|
|
|
184
186
|
plivoBrowserSdk?.client?.off?.('onLoginFailed', handleLoginFailed);
|
|
185
187
|
plivoBrowserSdk = null;
|
|
186
188
|
isPlivoOn.value = false;
|
|
189
|
+
isPlivoOn2 = false;
|
|
187
190
|
};
|
|
188
191
|
const sleep = () => {
|
|
189
192
|
return new Promise((resolve) => setTimeout(resolve, 2000));
|
|
@@ -198,6 +201,7 @@ export function usePlivo(callback) {
|
|
|
198
201
|
plivoCallSwishSpeaker,
|
|
199
202
|
plivoRemoveCallBack,
|
|
200
203
|
checkTimeLimit,
|
|
201
|
-
isPlivoOn
|
|
204
|
+
isPlivoOn,
|
|
205
|
+
isPlivoOn2
|
|
202
206
|
};
|
|
203
207
|
}
|