@rqmii_immersive/agent-react-sdk 5.1.2 → 5.1.3
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/{RqmiiCloudAvatarPlayer-CldnIv4K.js → RqmiiCloudAvatarPlayer-BL7GVcr_.js} +1052 -1054
- package/dist/RqmiiCloudAvatarPlayer-BL7GVcr_.js.map +1 -0
- package/dist/{RqmiiCloudAvatarPlayer-Bm730tzg.cjs → RqmiiCloudAvatarPlayer-Dc1h266_.cjs} +82 -82
- package/dist/RqmiiCloudAvatarPlayer-Dc1h266_.cjs.map +1 -0
- package/dist/core/managers/session.d.ts +2 -3
- package/dist/core/managers/session.d.ts.map +1 -1
- package/dist/embed.js +350 -350
- package/dist/embed.js.map +1 -1
- package/dist/hooks/use-rqmii-connection.d.ts +1 -1
- package/dist/hooks/use-rqmii-connection.d.ts.map +1 -1
- package/dist/hooks/use-rqmii-sdk.d.ts +0 -1
- package/dist/hooks/use-rqmii-sdk.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/provider/use-manager-lifecycle.d.ts +2 -3
- package/dist/provider/use-manager-lifecycle.d.ts.map +1 -1
- package/dist/types/index.d.ts +4 -8
- package/dist/types/index.d.ts.map +1 -1
- package/dist/ui/RqmiiAgentChat.d.ts +1 -1
- package/dist/ui/RqmiiAgentChat.d.ts.map +1 -1
- package/dist/ui/agent-data.d.ts +2 -8
- package/dist/ui/agent-data.d.ts.map +1 -1
- package/dist/ui.cjs +22 -22
- package/dist/ui.cjs.map +1 -1
- package/dist/ui.d.ts +1 -1
- package/dist/ui.d.ts.map +1 -1
- package/dist/ui.js +911 -939
- package/dist/ui.js.map +1 -1
- package/package.json +1 -1
- package/README.frameworks.md +0 -244
- package/README.md +0 -168
- package/README.simple.md +0 -114
- package/dist/RqmiiCloudAvatarPlayer-Bm730tzg.cjs.map +0 -1
- package/dist/RqmiiCloudAvatarPlayer-CldnIv4K.js.map +0 -1
package/dist/ui.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { A as oe, u as
|
|
2
|
-
import { E as
|
|
3
|
-
import { jsx as n, jsxs as f, Fragment as
|
|
4
|
-
import
|
|
5
|
-
const
|
|
1
|
+
import { A as oe, u as ba, g as Ke, j as de, h as ue, i as aa, l as ta, k as na, R as ka, c as fa } from "./RqmiiCloudAvatarPlayer-BL7GVcr_.js";
|
|
2
|
+
import { E as ni, d as ii } from "./RqmiiCloudAvatarPlayer-BL7GVcr_.js";
|
|
3
|
+
import { jsx as n, jsxs as f, Fragment as Ae } from "react/jsx-runtime";
|
|
4
|
+
import I, { useContext as va, createContext as ya, forwardRef as ia, createElement as Pe, useState as v, useEffect as j, useRef as _, useLayoutEffect as Oe, useCallback as re, useMemo as ee } from "react";
|
|
5
|
+
const Fa = {
|
|
6
6
|
sendMessage: "Stuur 'n boodskap",
|
|
7
7
|
send: "Stuur",
|
|
8
8
|
close: "Sluit",
|
|
@@ -45,7 +45,7 @@ const Ta = {
|
|
|
45
45
|
leadFormEmail: "E-pos",
|
|
46
46
|
leadFormPhone: "Foon",
|
|
47
47
|
leadFormMessage: "Jou boodskap"
|
|
48
|
-
},
|
|
48
|
+
}, Ta = {
|
|
49
49
|
sendMessage: "Dërgo një mesazh",
|
|
50
50
|
send: "Dërgo",
|
|
51
51
|
close: "Mbyll",
|
|
@@ -131,7 +131,7 @@ const Ta = {
|
|
|
131
131
|
leadFormEmail: "البريد الإلكتروني",
|
|
132
132
|
leadFormPhone: "رقم الهاتف",
|
|
133
133
|
leadFormMessage: "رسالتك"
|
|
134
|
-
},
|
|
134
|
+
}, Ea = {
|
|
135
135
|
sendMessage: "Mesaj göndər",
|
|
136
136
|
send: "Göndər",
|
|
137
137
|
close: "Bağla",
|
|
@@ -174,7 +174,7 @@ const Ta = {
|
|
|
174
174
|
leadFormEmail: "E-poçt",
|
|
175
175
|
leadFormPhone: "Telefon",
|
|
176
176
|
leadFormMessage: "Mesajınız"
|
|
177
|
-
},
|
|
177
|
+
}, Sa = {
|
|
178
178
|
sendMessage: "Bidali mezua",
|
|
179
179
|
send: "Bidali",
|
|
180
180
|
close: "Itxi",
|
|
@@ -217,7 +217,7 @@ const Ta = {
|
|
|
217
217
|
leadFormEmail: "Helbide elektronikoa",
|
|
218
218
|
leadFormPhone: "Telefonoa",
|
|
219
219
|
leadFormMessage: "Zure mezua"
|
|
220
|
-
},
|
|
220
|
+
}, xa = {
|
|
221
221
|
sendMessage: "Адправіць паведамленне",
|
|
222
222
|
send: "Адправіць",
|
|
223
223
|
close: "Зачыніць",
|
|
@@ -260,7 +260,7 @@ const Ta = {
|
|
|
260
260
|
leadFormEmail: "Электронная пошта",
|
|
261
261
|
leadFormPhone: "Тэлефон",
|
|
262
262
|
leadFormMessage: "Ваша паведамленне"
|
|
263
|
-
},
|
|
263
|
+
}, Pa = {
|
|
264
264
|
sendMessage: "একটি বার্তা পাঠান",
|
|
265
265
|
send: "পাঠান",
|
|
266
266
|
close: "বন্ধ করুন",
|
|
@@ -303,7 +303,7 @@ const Ta = {
|
|
|
303
303
|
leadFormEmail: "ইমেইল",
|
|
304
304
|
leadFormPhone: "ফোন",
|
|
305
305
|
leadFormMessage: "আপনার বার্তা"
|
|
306
|
-
},
|
|
306
|
+
}, Ma = {
|
|
307
307
|
sendMessage: "Pošalji poruku",
|
|
308
308
|
send: "Pošalji",
|
|
309
309
|
close: "Zatvori",
|
|
@@ -346,7 +346,7 @@ const Ta = {
|
|
|
346
346
|
leadFormEmail: "E-mail",
|
|
347
347
|
leadFormPhone: "Telefon",
|
|
348
348
|
leadFormMessage: "Vaša poruka"
|
|
349
|
-
},
|
|
349
|
+
}, Ca = {
|
|
350
350
|
sendMessage: "Изпрати съобщение",
|
|
351
351
|
send: "Изпрати",
|
|
352
352
|
close: "Затвори",
|
|
@@ -389,7 +389,7 @@ const Ta = {
|
|
|
389
389
|
leadFormEmail: "Имейл",
|
|
390
390
|
leadFormPhone: "Телефон",
|
|
391
391
|
leadFormMessage: "Вашето съобщение"
|
|
392
|
-
},
|
|
392
|
+
}, wa = {
|
|
393
393
|
sendMessage: "Enviar un missatge",
|
|
394
394
|
send: "Enviar",
|
|
395
395
|
close: "Tancar",
|
|
@@ -432,7 +432,7 @@ const Ta = {
|
|
|
432
432
|
leadFormEmail: "Correu electrònic",
|
|
433
433
|
leadFormPhone: "Telèfon",
|
|
434
434
|
leadFormMessage: "El teu missatge"
|
|
435
|
-
},
|
|
435
|
+
}, Aa = {
|
|
436
436
|
sendMessage: "发送消息",
|
|
437
437
|
send: "发送",
|
|
438
438
|
close: "关闭",
|
|
@@ -475,7 +475,7 @@ const Ta = {
|
|
|
475
475
|
leadFormEmail: "电子邮箱",
|
|
476
476
|
leadFormPhone: "电话",
|
|
477
477
|
leadFormMessage: "您的留言"
|
|
478
|
-
},
|
|
478
|
+
}, La = {
|
|
479
479
|
sendMessage: "Pošalji poruku",
|
|
480
480
|
send: "Pošalji",
|
|
481
481
|
close: "Zatvori",
|
|
@@ -561,7 +561,7 @@ const Ta = {
|
|
|
561
561
|
leadFormEmail: "E-mail",
|
|
562
562
|
leadFormPhone: "Telefon",
|
|
563
563
|
leadFormMessage: "Vaše zpráva"
|
|
564
|
-
},
|
|
564
|
+
}, ja = {
|
|
565
565
|
sendMessage: "Send en besked",
|
|
566
566
|
send: "Send",
|
|
567
567
|
close: "Luk",
|
|
@@ -604,7 +604,7 @@ const Ta = {
|
|
|
604
604
|
leadFormEmail: "E-mail",
|
|
605
605
|
leadFormPhone: "Telefon",
|
|
606
606
|
leadFormMessage: "Din besked"
|
|
607
|
-
},
|
|
607
|
+
}, Ia = {
|
|
608
608
|
sendMessage: "Stuur een bericht",
|
|
609
609
|
send: "Verzenden",
|
|
610
610
|
close: "Sluiten",
|
|
@@ -647,7 +647,7 @@ const Ta = {
|
|
|
647
647
|
leadFormEmail: "E-mail",
|
|
648
648
|
leadFormPhone: "Telefoon",
|
|
649
649
|
leadFormMessage: "Uw bericht"
|
|
650
|
-
},
|
|
650
|
+
}, Da = {
|
|
651
651
|
sendMessage: "Send a message",
|
|
652
652
|
send: "Send",
|
|
653
653
|
close: "Close",
|
|
@@ -690,7 +690,7 @@ const Ta = {
|
|
|
690
690
|
leadFormEmail: "Email",
|
|
691
691
|
leadFormPhone: "Phone",
|
|
692
692
|
leadFormMessage: "Your message"
|
|
693
|
-
},
|
|
693
|
+
}, qa = {
|
|
694
694
|
sendMessage: "Saada sõnum",
|
|
695
695
|
send: "Saada",
|
|
696
696
|
close: "Sulge",
|
|
@@ -733,7 +733,7 @@ const Ta = {
|
|
|
733
733
|
leadFormEmail: "E-post",
|
|
734
734
|
leadFormPhone: "Telefon",
|
|
735
735
|
leadFormMessage: "Teie sõnum"
|
|
736
|
-
},
|
|
736
|
+
}, Na = {
|
|
737
737
|
sendMessage: "Lähetä viesti",
|
|
738
738
|
send: "Lähetä",
|
|
739
739
|
close: "Sulje",
|
|
@@ -776,7 +776,7 @@ const Ta = {
|
|
|
776
776
|
leadFormEmail: "Sähköposti",
|
|
777
777
|
leadFormPhone: "Puhelin",
|
|
778
778
|
leadFormMessage: "Viestisi"
|
|
779
|
-
},
|
|
779
|
+
}, _a = {
|
|
780
780
|
sendMessage: "Envoyer un message",
|
|
781
781
|
send: "Envoyer",
|
|
782
782
|
close: "Fermer",
|
|
@@ -819,7 +819,7 @@ const Ta = {
|
|
|
819
819
|
leadFormEmail: "E-mail",
|
|
820
820
|
leadFormPhone: "Téléphone",
|
|
821
821
|
leadFormMessage: "Votre message"
|
|
822
|
-
},
|
|
822
|
+
}, Ra = {
|
|
823
823
|
sendMessage: "Enviar unha mensaxe",
|
|
824
824
|
send: "Enviar",
|
|
825
825
|
close: "Pechar",
|
|
@@ -862,7 +862,7 @@ const Ta = {
|
|
|
862
862
|
leadFormEmail: "Correo electrónico",
|
|
863
863
|
leadFormPhone: "Teléfono",
|
|
864
864
|
leadFormMessage: "A túa mensaxe"
|
|
865
|
-
},
|
|
865
|
+
}, Ba = {
|
|
866
866
|
sendMessage: "Nachricht senden",
|
|
867
867
|
send: "Senden",
|
|
868
868
|
close: "Schließen",
|
|
@@ -905,7 +905,7 @@ const Ta = {
|
|
|
905
905
|
leadFormEmail: "E-Mail",
|
|
906
906
|
leadFormPhone: "Telefon",
|
|
907
907
|
leadFormMessage: "Ihre Nachricht"
|
|
908
|
-
},
|
|
908
|
+
}, Ga = {
|
|
909
909
|
sendMessage: "Αποστολή μηνύματος",
|
|
910
910
|
send: "Αποστολή",
|
|
911
911
|
close: "Κλείσιμο",
|
|
@@ -948,7 +948,7 @@ const Ta = {
|
|
|
948
948
|
leadFormEmail: "E-mail",
|
|
949
949
|
leadFormPhone: "Τηλέφωνο",
|
|
950
950
|
leadFormMessage: "Το μήνυμά σας"
|
|
951
|
-
},
|
|
951
|
+
}, Ua = {
|
|
952
952
|
sendMessage: "સંદેશ મોકલો",
|
|
953
953
|
send: "મોકલો",
|
|
954
954
|
close: "બંધ કરો",
|
|
@@ -991,7 +991,7 @@ const Ta = {
|
|
|
991
991
|
leadFormEmail: "ઇમેઇલ",
|
|
992
992
|
leadFormPhone: "ફોન",
|
|
993
993
|
leadFormMessage: "તમારો સંદેશ"
|
|
994
|
-
},
|
|
994
|
+
}, Ka = {
|
|
995
995
|
sendMessage: "संदेश भेजें",
|
|
996
996
|
send: "भेजें",
|
|
997
997
|
close: "बंद करें",
|
|
@@ -1034,7 +1034,7 @@ const Ta = {
|
|
|
1034
1034
|
leadFormEmail: "ईमेल",
|
|
1035
1035
|
leadFormPhone: "फ़ोन",
|
|
1036
1036
|
leadFormMessage: "आपका संदेश"
|
|
1037
|
-
},
|
|
1037
|
+
}, Oa = {
|
|
1038
1038
|
sendMessage: "Üzenet küldése",
|
|
1039
1039
|
send: "Küldés",
|
|
1040
1040
|
close: "Bezárás",
|
|
@@ -1077,7 +1077,7 @@ const Ta = {
|
|
|
1077
1077
|
leadFormEmail: "E-mail",
|
|
1078
1078
|
leadFormPhone: "Telefon",
|
|
1079
1079
|
leadFormMessage: "Üzenete"
|
|
1080
|
-
},
|
|
1080
|
+
}, Ya = {
|
|
1081
1081
|
sendMessage: "Kirim pesan",
|
|
1082
1082
|
send: "Kirim",
|
|
1083
1083
|
close: "Tutup",
|
|
@@ -1120,7 +1120,7 @@ const Ta = {
|
|
|
1120
1120
|
leadFormEmail: "Email",
|
|
1121
1121
|
leadFormPhone: "Telepon",
|
|
1122
1122
|
leadFormMessage: "Pesan Anda"
|
|
1123
|
-
},
|
|
1123
|
+
}, Qa = {
|
|
1124
1124
|
sendMessage: "Invia un messaggio",
|
|
1125
1125
|
send: "Invia",
|
|
1126
1126
|
close: "Chiudi",
|
|
@@ -1163,7 +1163,7 @@ const Ta = {
|
|
|
1163
1163
|
leadFormEmail: "E-mail",
|
|
1164
1164
|
leadFormPhone: "Telefono",
|
|
1165
1165
|
leadFormMessage: "Il tuo messaggio"
|
|
1166
|
-
},
|
|
1166
|
+
}, Ha = {
|
|
1167
1167
|
sendMessage: "メッセージを送信",
|
|
1168
1168
|
send: "送信",
|
|
1169
1169
|
close: "閉じる",
|
|
@@ -1206,7 +1206,7 @@ const Ta = {
|
|
|
1206
1206
|
leadFormEmail: "メールアドレス",
|
|
1207
1207
|
leadFormPhone: "電話番号",
|
|
1208
1208
|
leadFormMessage: "メッセージ"
|
|
1209
|
-
},
|
|
1209
|
+
}, Wa = {
|
|
1210
1210
|
sendMessage: "ಸಂದೇಶ ಕಳುಹಿಸಿ",
|
|
1211
1211
|
send: "ಕಳುಹಿಸಿ",
|
|
1212
1212
|
close: "ಮುಚ್ಚಿ",
|
|
@@ -1292,7 +1292,7 @@ const Ta = {
|
|
|
1292
1292
|
leadFormEmail: "Электрондық пошта",
|
|
1293
1293
|
leadFormPhone: "Телефон",
|
|
1294
1294
|
leadFormMessage: "Сіздің хабарламаңыз"
|
|
1295
|
-
},
|
|
1295
|
+
}, $a = {
|
|
1296
1296
|
sendMessage: "메시지 보내기",
|
|
1297
1297
|
send: "보내기",
|
|
1298
1298
|
close: "닫기",
|
|
@@ -1335,7 +1335,7 @@ const Ta = {
|
|
|
1335
1335
|
leadFormEmail: "이메일",
|
|
1336
1336
|
leadFormPhone: "전화번호",
|
|
1337
1337
|
leadFormMessage: "메시지"
|
|
1338
|
-
},
|
|
1338
|
+
}, Ja = {
|
|
1339
1339
|
sendMessage: "Sūtīt ziņojumu",
|
|
1340
1340
|
send: "Sūtīt",
|
|
1341
1341
|
close: "Aizvērt",
|
|
@@ -1378,7 +1378,7 @@ const Ta = {
|
|
|
1378
1378
|
leadFormEmail: "E-pasts",
|
|
1379
1379
|
leadFormPhone: "Tālrunis",
|
|
1380
1380
|
leadFormMessage: "Jūsu ziņojums"
|
|
1381
|
-
},
|
|
1381
|
+
}, Xa = {
|
|
1382
1382
|
sendMessage: "Siųsti žinutę",
|
|
1383
1383
|
send: "Siųsti",
|
|
1384
1384
|
close: "Uždaryti",
|
|
@@ -1421,7 +1421,7 @@ const Ta = {
|
|
|
1421
1421
|
leadFormEmail: "El. paštas",
|
|
1422
1422
|
leadFormPhone: "Telefonas",
|
|
1423
1423
|
leadFormMessage: "Jūsų žinutė"
|
|
1424
|
-
},
|
|
1424
|
+
}, et = {
|
|
1425
1425
|
sendMessage: "Испрати порака",
|
|
1426
1426
|
send: "Испрати",
|
|
1427
1427
|
close: "Затвори",
|
|
@@ -1464,7 +1464,7 @@ const Ta = {
|
|
|
1464
1464
|
leadFormEmail: "Е-пошта",
|
|
1465
1465
|
leadFormPhone: "Телефон",
|
|
1466
1466
|
leadFormMessage: "Вашата порака"
|
|
1467
|
-
},
|
|
1467
|
+
}, at = {
|
|
1468
1468
|
sendMessage: "Hantar mesej",
|
|
1469
1469
|
send: "Hantar",
|
|
1470
1470
|
close: "Tutup",
|
|
@@ -1507,7 +1507,7 @@ const Ta = {
|
|
|
1507
1507
|
leadFormEmail: "E-mel",
|
|
1508
1508
|
leadFormPhone: "Telefon",
|
|
1509
1509
|
leadFormMessage: "Mesej anda"
|
|
1510
|
-
},
|
|
1510
|
+
}, tt = {
|
|
1511
1511
|
sendMessage: "ഒരു സന്ദേശം അയയ്ക്കുക",
|
|
1512
1512
|
send: "അയയ്ക്കുക",
|
|
1513
1513
|
close: "അടയ്ക്കുക",
|
|
@@ -1550,7 +1550,7 @@ const Ta = {
|
|
|
1550
1550
|
leadFormEmail: "ഇമെയിൽ",
|
|
1551
1551
|
leadFormPhone: "ഫോൺ",
|
|
1552
1552
|
leadFormMessage: "നിങ്ങളുടെ സന്ദേശം"
|
|
1553
|
-
},
|
|
1553
|
+
}, nt = {
|
|
1554
1554
|
sendMessage: "संदेश पाठवा",
|
|
1555
1555
|
send: "पाठवा",
|
|
1556
1556
|
close: "बंद करा",
|
|
@@ -1593,7 +1593,7 @@ const Ta = {
|
|
|
1593
1593
|
leadFormEmail: "ईमेल",
|
|
1594
1594
|
leadFormPhone: "फोन",
|
|
1595
1595
|
leadFormMessage: "तुमचा संदेश"
|
|
1596
|
-
},
|
|
1596
|
+
}, it = {
|
|
1597
1597
|
sendMessage: "Send en melding",
|
|
1598
1598
|
send: "Send",
|
|
1599
1599
|
close: "Lukk",
|
|
@@ -1636,7 +1636,7 @@ const Ta = {
|
|
|
1636
1636
|
leadFormEmail: "E-post",
|
|
1637
1637
|
leadFormPhone: "Telefon",
|
|
1638
1638
|
leadFormMessage: "Din melding"
|
|
1639
|
-
},
|
|
1639
|
+
}, ot = {
|
|
1640
1640
|
sendMessage: "پیامی بنویسید",
|
|
1641
1641
|
send: "ارسال",
|
|
1642
1642
|
close: "بستن",
|
|
@@ -1679,7 +1679,7 @@ const Ta = {
|
|
|
1679
1679
|
leadFormEmail: "ایمیل",
|
|
1680
1680
|
leadFormPhone: "تلفن",
|
|
1681
1681
|
leadFormMessage: "پیام شما"
|
|
1682
|
-
},
|
|
1682
|
+
}, rt = {
|
|
1683
1683
|
sendMessage: "Wyślij wiadomość",
|
|
1684
1684
|
send: "Wyślij",
|
|
1685
1685
|
close: "Zamknij",
|
|
@@ -1722,7 +1722,7 @@ const Ta = {
|
|
|
1722
1722
|
leadFormEmail: "E-mail",
|
|
1723
1723
|
leadFormPhone: "Telefon",
|
|
1724
1724
|
leadFormMessage: "Twoja wiadomość"
|
|
1725
|
-
},
|
|
1725
|
+
}, st = {
|
|
1726
1726
|
sendMessage: "Enviar mensagem",
|
|
1727
1727
|
send: "Enviar",
|
|
1728
1728
|
close: "Fechar",
|
|
@@ -1765,7 +1765,7 @@ const Ta = {
|
|
|
1765
1765
|
leadFormEmail: "E-mail",
|
|
1766
1766
|
leadFormPhone: "Telefone",
|
|
1767
1767
|
leadFormMessage: "Sua mensagem"
|
|
1768
|
-
},
|
|
1768
|
+
}, lt = {
|
|
1769
1769
|
sendMessage: "ਇੱਕ ਸੁਨੇਹਾ ਭੇਜੋ",
|
|
1770
1770
|
send: "ਭੇਜੋ",
|
|
1771
1771
|
close: "ਬੰਦ ਕਰੋ",
|
|
@@ -1808,7 +1808,7 @@ const Ta = {
|
|
|
1808
1808
|
leadFormEmail: "ਈਮੇਲ",
|
|
1809
1809
|
leadFormPhone: "ਫ਼ੋਨ",
|
|
1810
1810
|
leadFormMessage: "ਤੁਹਾਡਾ ਸੁਨੇਹਾ"
|
|
1811
|
-
},
|
|
1811
|
+
}, ct = {
|
|
1812
1812
|
sendMessage: "Trimite un mesaj",
|
|
1813
1813
|
send: "Trimite",
|
|
1814
1814
|
close: "Închide",
|
|
@@ -1851,7 +1851,7 @@ const Ta = {
|
|
|
1851
1851
|
leadFormEmail: "E-mail",
|
|
1852
1852
|
leadFormPhone: "Telefon",
|
|
1853
1853
|
leadFormMessage: "Mesajul dumneavoastră"
|
|
1854
|
-
},
|
|
1854
|
+
}, dt = {
|
|
1855
1855
|
sendMessage: "Отправить сообщение",
|
|
1856
1856
|
send: "Отправить",
|
|
1857
1857
|
close: "Закрыть",
|
|
@@ -1894,7 +1894,7 @@ const Ta = {
|
|
|
1894
1894
|
leadFormEmail: "Электронная почта",
|
|
1895
1895
|
leadFormPhone: "Телефон",
|
|
1896
1896
|
leadFormMessage: "Ваше сообщение"
|
|
1897
|
-
},
|
|
1897
|
+
}, ut = {
|
|
1898
1898
|
sendMessage: "Пошаљи поруку",
|
|
1899
1899
|
send: "Пошаљи",
|
|
1900
1900
|
close: "Затвори",
|
|
@@ -1937,7 +1937,7 @@ const Ta = {
|
|
|
1937
1937
|
leadFormEmail: "Имејл",
|
|
1938
1938
|
leadFormPhone: "Телефон",
|
|
1939
1939
|
leadFormMessage: "Ваша порука"
|
|
1940
|
-
},
|
|
1940
|
+
}, mt = {
|
|
1941
1941
|
sendMessage: "Poslať správu",
|
|
1942
1942
|
send: "Odoslať",
|
|
1943
1943
|
close: "Zavrieť",
|
|
@@ -1980,7 +1980,7 @@ const Ta = {
|
|
|
1980
1980
|
leadFormEmail: "E-mail",
|
|
1981
1981
|
leadFormPhone: "Telefón",
|
|
1982
1982
|
leadFormMessage: "Vaša správa"
|
|
1983
|
-
},
|
|
1983
|
+
}, ht = {
|
|
1984
1984
|
sendMessage: "Pošlji sporočilo",
|
|
1985
1985
|
send: "Pošlji",
|
|
1986
1986
|
close: "Zapri",
|
|
@@ -2023,7 +2023,7 @@ const Ta = {
|
|
|
2023
2023
|
leadFormEmail: "E-pošta",
|
|
2024
2024
|
leadFormPhone: "Telefon",
|
|
2025
2025
|
leadFormMessage: "Vaše sporočilo"
|
|
2026
|
-
},
|
|
2026
|
+
}, gt = {
|
|
2027
2027
|
sendMessage: "Enviar un mensaje",
|
|
2028
2028
|
send: "Enviar",
|
|
2029
2029
|
close: "Cerrar",
|
|
@@ -2066,7 +2066,7 @@ const Ta = {
|
|
|
2066
2066
|
leadFormEmail: "Correo electrónico",
|
|
2067
2067
|
leadFormPhone: "Teléfono",
|
|
2068
2068
|
leadFormMessage: "Tu mensaje"
|
|
2069
|
-
},
|
|
2069
|
+
}, pt = {
|
|
2070
2070
|
sendMessage: "Tuma ujumbe",
|
|
2071
2071
|
send: "Tuma",
|
|
2072
2072
|
close: "Funga",
|
|
@@ -2109,7 +2109,7 @@ const Ta = {
|
|
|
2109
2109
|
leadFormEmail: "Barua pepe",
|
|
2110
2110
|
leadFormPhone: "Simu",
|
|
2111
2111
|
leadFormMessage: "Ujumbe wako"
|
|
2112
|
-
},
|
|
2112
|
+
}, bt = {
|
|
2113
2113
|
sendMessage: "Skicka ett meddelande",
|
|
2114
2114
|
send: "Skicka",
|
|
2115
2115
|
close: "Stäng",
|
|
@@ -2152,7 +2152,7 @@ const Ta = {
|
|
|
2152
2152
|
leadFormEmail: "E-post",
|
|
2153
2153
|
leadFormPhone: "Telefon",
|
|
2154
2154
|
leadFormMessage: "Ditt meddelande"
|
|
2155
|
-
},
|
|
2155
|
+
}, kt = {
|
|
2156
2156
|
sendMessage: "Magpadala ng mensahe",
|
|
2157
2157
|
send: "Ipadala",
|
|
2158
2158
|
close: "Isara",
|
|
@@ -2195,7 +2195,7 @@ const Ta = {
|
|
|
2195
2195
|
leadFormEmail: "Email",
|
|
2196
2196
|
leadFormPhone: "Telepono",
|
|
2197
2197
|
leadFormMessage: "Ang iyong mensahe"
|
|
2198
|
-
},
|
|
2198
|
+
}, ft = {
|
|
2199
2199
|
sendMessage: "ஒரு செய்தி அனுப்பவும்",
|
|
2200
2200
|
send: "அனுப்பு",
|
|
2201
2201
|
close: "மூடு",
|
|
@@ -2238,7 +2238,7 @@ const Ta = {
|
|
|
2238
2238
|
leadFormEmail: "மின்னஞ்சல்",
|
|
2239
2239
|
leadFormPhone: "தொலைபேசி",
|
|
2240
2240
|
leadFormMessage: "உங்கள் செய்தி"
|
|
2241
|
-
},
|
|
2241
|
+
}, vt = {
|
|
2242
2242
|
sendMessage: "సందేశం పంపండి",
|
|
2243
2243
|
send: "పంపు",
|
|
2244
2244
|
close: "మూసివేయండి",
|
|
@@ -2281,7 +2281,7 @@ const Ta = {
|
|
|
2281
2281
|
leadFormEmail: "ఇమెయిల్",
|
|
2282
2282
|
leadFormPhone: "ఫోన్",
|
|
2283
2283
|
leadFormMessage: "మీ సందేశం"
|
|
2284
|
-
},
|
|
2284
|
+
}, yt = {
|
|
2285
2285
|
sendMessage: "ส่งข้อความ",
|
|
2286
2286
|
send: "ส่ง",
|
|
2287
2287
|
close: "ปิด",
|
|
@@ -2324,7 +2324,7 @@ const Ta = {
|
|
|
2324
2324
|
leadFormEmail: "อีเมล",
|
|
2325
2325
|
leadFormPhone: "โทรศัพท์",
|
|
2326
2326
|
leadFormMessage: "ข้อความของคุณ"
|
|
2327
|
-
},
|
|
2327
|
+
}, Ft = {
|
|
2328
2328
|
sendMessage: "Mesaj gönder",
|
|
2329
2329
|
send: "Gönder",
|
|
2330
2330
|
close: "Kapat",
|
|
@@ -2367,7 +2367,7 @@ const Ta = {
|
|
|
2367
2367
|
leadFormEmail: "E-posta",
|
|
2368
2368
|
leadFormPhone: "Telefon",
|
|
2369
2369
|
leadFormMessage: "Mesajınız"
|
|
2370
|
-
},
|
|
2370
|
+
}, Tt = {
|
|
2371
2371
|
sendMessage: "Надіслати повідомлення",
|
|
2372
2372
|
send: "Надіслати",
|
|
2373
2373
|
close: "Закрити",
|
|
@@ -2453,7 +2453,7 @@ const Ta = {
|
|
|
2453
2453
|
leadFormEmail: "ای میل",
|
|
2454
2454
|
leadFormPhone: "فون",
|
|
2455
2455
|
leadFormMessage: "آپ کا پیغام"
|
|
2456
|
-
},
|
|
2456
|
+
}, Et = {
|
|
2457
2457
|
sendMessage: "Gửi tin nhắn",
|
|
2458
2458
|
send: "Gửi",
|
|
2459
2459
|
close: "Đóng",
|
|
@@ -2496,7 +2496,7 @@ const Ta = {
|
|
|
2496
2496
|
leadFormEmail: "Email",
|
|
2497
2497
|
leadFormPhone: "Điện thoại",
|
|
2498
2498
|
leadFormMessage: "Tin nhắn của bạn"
|
|
2499
|
-
},
|
|
2499
|
+
}, St = {
|
|
2500
2500
|
sendMessage: "Anfon neges",
|
|
2501
2501
|
send: "Anfon",
|
|
2502
2502
|
close: "Cau",
|
|
@@ -2540,66 +2540,66 @@ const Ta = {
|
|
|
2540
2540
|
leadFormPhone: "Ffôn",
|
|
2541
2541
|
leadFormMessage: "Eich neges"
|
|
2542
2542
|
}, Ye = {
|
|
2543
|
-
af:
|
|
2544
|
-
sq:
|
|
2543
|
+
af: Fa,
|
|
2544
|
+
sq: Ta,
|
|
2545
2545
|
ar: za,
|
|
2546
|
-
az:
|
|
2547
|
-
eu:
|
|
2548
|
-
be:
|
|
2549
|
-
bn:
|
|
2550
|
-
bs:
|
|
2551
|
-
bg:
|
|
2552
|
-
ca:
|
|
2553
|
-
zh:
|
|
2554
|
-
hr:
|
|
2546
|
+
az: Ea,
|
|
2547
|
+
eu: Sa,
|
|
2548
|
+
be: xa,
|
|
2549
|
+
bn: Pa,
|
|
2550
|
+
bs: Ma,
|
|
2551
|
+
bg: Ca,
|
|
2552
|
+
ca: wa,
|
|
2553
|
+
zh: Aa,
|
|
2554
|
+
hr: La,
|
|
2555
2555
|
cs: Va,
|
|
2556
|
-
da:
|
|
2557
|
-
nl:
|
|
2558
|
-
en:
|
|
2559
|
-
et:
|
|
2560
|
-
fi:
|
|
2561
|
-
fr:
|
|
2562
|
-
gl:
|
|
2563
|
-
de:
|
|
2564
|
-
el:
|
|
2565
|
-
gu:
|
|
2566
|
-
hi:
|
|
2567
|
-
hu:
|
|
2568
|
-
id:
|
|
2569
|
-
it:
|
|
2570
|
-
ja:
|
|
2571
|
-
kn:
|
|
2556
|
+
da: ja,
|
|
2557
|
+
nl: Ia,
|
|
2558
|
+
en: Da,
|
|
2559
|
+
et: qa,
|
|
2560
|
+
fi: Na,
|
|
2561
|
+
fr: _a,
|
|
2562
|
+
gl: Ra,
|
|
2563
|
+
de: Ba,
|
|
2564
|
+
el: Ga,
|
|
2565
|
+
gu: Ua,
|
|
2566
|
+
hi: Ka,
|
|
2567
|
+
hu: Oa,
|
|
2568
|
+
id: Ya,
|
|
2569
|
+
it: Qa,
|
|
2570
|
+
ja: Ha,
|
|
2571
|
+
kn: Wa,
|
|
2572
2572
|
kk: Za,
|
|
2573
|
-
ko:
|
|
2574
|
-
lv:
|
|
2575
|
-
lt:
|
|
2576
|
-
mk:
|
|
2577
|
-
ms:
|
|
2578
|
-
ml:
|
|
2579
|
-
mr:
|
|
2580
|
-
no:
|
|
2581
|
-
fa:
|
|
2582
|
-
pl:
|
|
2583
|
-
pt:
|
|
2584
|
-
pa:
|
|
2585
|
-
ro:
|
|
2586
|
-
ru:
|
|
2587
|
-
sr:
|
|
2588
|
-
sk:
|
|
2589
|
-
sl:
|
|
2590
|
-
es:
|
|
2591
|
-
sw:
|
|
2592
|
-
sv:
|
|
2593
|
-
tl:
|
|
2594
|
-
ta:
|
|
2595
|
-
te:
|
|
2596
|
-
th:
|
|
2597
|
-
tr:
|
|
2598
|
-
uk:
|
|
2573
|
+
ko: $a,
|
|
2574
|
+
lv: Ja,
|
|
2575
|
+
lt: Xa,
|
|
2576
|
+
mk: et,
|
|
2577
|
+
ms: at,
|
|
2578
|
+
ml: tt,
|
|
2579
|
+
mr: nt,
|
|
2580
|
+
no: it,
|
|
2581
|
+
fa: ot,
|
|
2582
|
+
pl: rt,
|
|
2583
|
+
pt: st,
|
|
2584
|
+
pa: lt,
|
|
2585
|
+
ro: ct,
|
|
2586
|
+
ru: dt,
|
|
2587
|
+
sr: ut,
|
|
2588
|
+
sk: mt,
|
|
2589
|
+
sl: ht,
|
|
2590
|
+
es: gt,
|
|
2591
|
+
sw: pt,
|
|
2592
|
+
sv: bt,
|
|
2593
|
+
tl: kt,
|
|
2594
|
+
ta: ft,
|
|
2595
|
+
te: vt,
|
|
2596
|
+
th: yt,
|
|
2597
|
+
tr: Ft,
|
|
2598
|
+
uk: Tt,
|
|
2599
2599
|
ur: zt,
|
|
2600
|
-
vi:
|
|
2601
|
-
cy:
|
|
2602
|
-
},
|
|
2600
|
+
vi: Et,
|
|
2601
|
+
cy: St
|
|
2602
|
+
}, Me = [
|
|
2603
2603
|
{ value: "af", label: "Afrikaans", dir: "ltr" },
|
|
2604
2604
|
{ value: "sq", label: "Shqip", dir: "ltr" },
|
|
2605
2605
|
{ value: "ar", label: "العربية", dir: "rtl" },
|
|
@@ -2659,22 +2659,21 @@ const Ta = {
|
|
|
2659
2659
|
{ value: "ur", label: "اردو", dir: "rtl" },
|
|
2660
2660
|
{ value: "vi", label: "Tiếng Việt", dir: "ltr" },
|
|
2661
2661
|
{ value: "cy", label: "Cymraeg", dir: "ltr" }
|
|
2662
|
-
], Qe =
|
|
2662
|
+
], Qe = Me.map(
|
|
2663
2663
|
(e) => e.value
|
|
2664
2664
|
);
|
|
2665
2665
|
function He(e) {
|
|
2666
|
-
return
|
|
2666
|
+
return Me.find((a) => a.value === e) || Me.find((a) => a.value === "en");
|
|
2667
2667
|
}
|
|
2668
|
-
function
|
|
2668
|
+
function F(e, a) {
|
|
2669
2669
|
return Ye[e]?.[a] || Ye.en[a] || a;
|
|
2670
2670
|
}
|
|
2671
2671
|
function be(e, a = "en") {
|
|
2672
|
-
const t = Array.isArray(e) ? e.filter((
|
|
2672
|
+
const t = Array.isArray(e) ? e.filter((i) => Qe.includes(i)) : [];
|
|
2673
2673
|
return !t.includes(a) && Qe.includes(a) && t.unshift(a), t.length ? [...new Set(t)] : ["ar"];
|
|
2674
2674
|
}
|
|
2675
2675
|
const We = {
|
|
2676
2676
|
id: null,
|
|
2677
|
-
publicChatId: null,
|
|
2678
2677
|
name: "Agent",
|
|
2679
2678
|
agentType: oe.TEXT,
|
|
2680
2679
|
useText: !0,
|
|
@@ -2692,13 +2691,13 @@ const We = {
|
|
|
2692
2691
|
behavior: { post_chat_rating_enabled: !1, welcome_bubble_enabled: !1, welcome_bubble_delay_seconds: 3, welcome_bubble_sound_enabled: !1, typing_indicator_enabled: !0 }
|
|
2693
2692
|
}
|
|
2694
2693
|
};
|
|
2695
|
-
function
|
|
2694
|
+
function pe(e) {
|
|
2696
2695
|
if (!e) return We;
|
|
2697
|
-
const a = e, t = a.agent_type || a.agentType || oe.TEXT,
|
|
2696
|
+
const a = e, t = a.agent_type || a.agentType || oe.TEXT, i = typeof a.use_text == "boolean" ? a.use_text : typeof a.useText == "boolean" ? a.useText : t !== oe.VOICE, r = typeof a.use_voice == "boolean" ? a.use_voice : typeof a.useVoice == "boolean" ? a.useVoice : t === oe.TEXT_AND_VOICE || t === oe.CLOUD_AVATAR || t === oe.DESKTOP_AVATAR, o = a.conversation || a.agent_customization?.conversation || {}, s = a.speech || a.agent_customization?.speech || {}, c = o.default_language || "en", d = be(o.languages, c), l = a.widget || a.agent_customization?.widget || null, m = l?.appearance, u = l?.behavior, h = l, z = typeof m?.hide_branding == "boolean" ? !m.hide_branding : typeof m?.show_branding == "boolean" ? m.show_branding : !0, k = h ? {
|
|
2698
2697
|
appearance: {
|
|
2699
2698
|
brand_color: m?.brand_color,
|
|
2700
2699
|
position: m?.position || "right",
|
|
2701
|
-
show_branding:
|
|
2700
|
+
show_branding: z,
|
|
2702
2701
|
footer_content: m?.footer_content || {}
|
|
2703
2702
|
},
|
|
2704
2703
|
behavior: {
|
|
@@ -2708,45 +2707,44 @@ function de(e) {
|
|
|
2708
2707
|
welcome_bubble_sound_enabled: typeof u?.welcome_bubble_sound_enabled == "boolean" ? u.welcome_bubble_sound_enabled : !1,
|
|
2709
2708
|
typing_indicator_enabled: typeof u?.typing_indicator_enabled == "boolean" ? u.typing_indicator_enabled : !0
|
|
2710
2709
|
}
|
|
2711
|
-
} : void 0,
|
|
2712
|
-
Object.entries(
|
|
2710
|
+
} : void 0, y = a.consent || a.consent_config || null, E = o.welcome_message || o.welcomeMessage || a.welcome_message || a.welcomeMessage || {}, T = Object.fromEntries(
|
|
2711
|
+
Object.entries(E).filter(([, p]) => typeof p == "string").map(([p, S]) => [p, S.slice(0, 1e3)])
|
|
2713
2712
|
), g = typeof a.allow_interrupt == "boolean" ? a.allow_interrupt : typeof s.allow_interrupt == "boolean" ? s.allow_interrupt : !0, b = typeof a.allow_welcome_message_interrupt == "boolean" ? a.allow_welcome_message_interrupt : typeof s.allow_welcome_message_interrupt == "boolean" ? s.allow_welcome_message_interrupt : !1;
|
|
2714
2713
|
return {
|
|
2715
2714
|
id: a.id || null,
|
|
2716
|
-
publicChatId: a.public_chat_id || a.publicChatId || null,
|
|
2717
2715
|
name: a.name || We.name,
|
|
2718
2716
|
agentType: t,
|
|
2719
|
-
useText:
|
|
2717
|
+
useText: i,
|
|
2720
2718
|
useVoice: r,
|
|
2721
2719
|
faceIndex: typeof a.face_index == "number" ? a.face_index : typeof a.faceIndex == "number" ? a.faceIndex : 1,
|
|
2722
2720
|
faceImageUrl: a.face_image_url || a.faceImageUrl || null,
|
|
2723
2721
|
allowInterrupt: g,
|
|
2724
2722
|
allowWelcomeMessageInterrupt: b,
|
|
2725
|
-
welcomeMessages:
|
|
2726
|
-
languages:
|
|
2727
|
-
defaultLanguage:
|
|
2723
|
+
welcomeMessages: T,
|
|
2724
|
+
languages: d,
|
|
2725
|
+
defaultLanguage: d.includes(c) ? c : d[0],
|
|
2728
2726
|
conversation: {
|
|
2729
|
-
default_language:
|
|
2730
|
-
languages:
|
|
2731
|
-
suggested_messages:
|
|
2727
|
+
default_language: c,
|
|
2728
|
+
languages: d,
|
|
2729
|
+
suggested_messages: o.suggested_messages || o.suggestedMessages || {}
|
|
2732
2730
|
},
|
|
2733
2731
|
widget: k || void 0,
|
|
2734
|
-
consent:
|
|
2735
|
-
enabled:
|
|
2736
|
-
title:
|
|
2737
|
-
body:
|
|
2738
|
-
acceptLabel:
|
|
2739
|
-
declineLabel:
|
|
2740
|
-
termsUrl:
|
|
2741
|
-
privacyUrl:
|
|
2732
|
+
consent: y ? {
|
|
2733
|
+
enabled: y.enabled ?? !1,
|
|
2734
|
+
title: y.title || void 0,
|
|
2735
|
+
body: y.body || void 0,
|
|
2736
|
+
acceptLabel: y.accept_label || y.acceptLabel || void 0,
|
|
2737
|
+
declineLabel: y.decline_label || y.declineLabel || void 0,
|
|
2738
|
+
termsUrl: y.terms_url || y.termsUrl || void 0,
|
|
2739
|
+
privacyUrl: y.privacy_url || y.privacyUrl || void 0
|
|
2742
2740
|
} : void 0
|
|
2743
2741
|
};
|
|
2744
2742
|
}
|
|
2745
|
-
async function
|
|
2743
|
+
async function xt({
|
|
2746
2744
|
restUrl: e,
|
|
2747
2745
|
identifier: a,
|
|
2748
2746
|
withCredentials: t = !1,
|
|
2749
|
-
signal:
|
|
2747
|
+
signal: i
|
|
2750
2748
|
}) {
|
|
2751
2749
|
if (!e) throw new Error("Missing restUrl");
|
|
2752
2750
|
if (!a) throw new Error("Missing agent identifier");
|
|
@@ -2755,85 +2753,62 @@ async function Pt({
|
|
|
2755
2753
|
mode: "cors",
|
|
2756
2754
|
credentials: t ? "include" : "omit",
|
|
2757
2755
|
headers: { Accept: "application/json" },
|
|
2758
|
-
signal:
|
|
2756
|
+
signal: i
|
|
2759
2757
|
});
|
|
2760
2758
|
if (!r.ok) {
|
|
2761
2759
|
let s = `HTTP ${r.status}`;
|
|
2762
2760
|
try {
|
|
2763
|
-
const
|
|
2764
|
-
s =
|
|
2761
|
+
const d = await r.json();
|
|
2762
|
+
s = d?.detail || d?.message || s;
|
|
2765
2763
|
} catch {
|
|
2766
2764
|
}
|
|
2767
2765
|
throw new Error(s);
|
|
2768
2766
|
}
|
|
2769
|
-
const
|
|
2770
|
-
return
|
|
2771
|
-
id:
|
|
2772
|
-
name:
|
|
2773
|
-
company_name:
|
|
2774
|
-
agent_type:
|
|
2775
|
-
use_voice:
|
|
2776
|
-
use_text:
|
|
2777
|
-
face_index:
|
|
2778
|
-
face_image_url:
|
|
2779
|
-
conversation:
|
|
2780
|
-
widget:
|
|
2781
|
-
allow_interrupt:
|
|
2782
|
-
allow_welcome_message_interrupt:
|
|
2783
|
-
welcome_message:
|
|
2767
|
+
const o = await r.json();
|
|
2768
|
+
return pe({
|
|
2769
|
+
id: o.id,
|
|
2770
|
+
name: o.name,
|
|
2771
|
+
company_name: o.company_name,
|
|
2772
|
+
agent_type: o.agent_type,
|
|
2773
|
+
use_voice: o.use_voice,
|
|
2774
|
+
use_text: o.use_text,
|
|
2775
|
+
face_index: o.face_index,
|
|
2776
|
+
face_image_url: o.face_image_url,
|
|
2777
|
+
conversation: o.conversation,
|
|
2778
|
+
widget: o.widget,
|
|
2779
|
+
allow_interrupt: o.allow_interrupt,
|
|
2780
|
+
allow_welcome_message_interrupt: o.allow_welcome_message_interrupt,
|
|
2781
|
+
welcome_message: o.welcome_message
|
|
2784
2782
|
});
|
|
2785
2783
|
}
|
|
2786
|
-
async function
|
|
2784
|
+
async function $n({ restUrl: e, apiKey: a, agentId: t, signal: i }) {
|
|
2787
2785
|
if (!e) throw new Error("Missing restUrl");
|
|
2788
|
-
|
|
2789
|
-
|
|
2786
|
+
const r = a || t;
|
|
2787
|
+
if (!r) throw new Error("Provide one of apiKey or agentId");
|
|
2788
|
+
const o = await fetch(`${e}/agent/${r}`, {
|
|
2790
2789
|
method: "GET",
|
|
2791
2790
|
mode: "cors",
|
|
2792
2791
|
credentials: "omit",
|
|
2793
2792
|
headers: {
|
|
2794
2793
|
Accept: "application/json"
|
|
2795
2794
|
},
|
|
2796
|
-
signal:
|
|
2795
|
+
signal: i
|
|
2797
2796
|
});
|
|
2798
2797
|
if (!o.ok) {
|
|
2799
|
-
let
|
|
2798
|
+
let s = `HTTP ${o.status}`;
|
|
2800
2799
|
try {
|
|
2801
|
-
const
|
|
2802
|
-
|
|
2800
|
+
const d = await o.json();
|
|
2801
|
+
s = d?.detail || d?.message || s;
|
|
2803
2802
|
} catch {
|
|
2804
2803
|
}
|
|
2805
|
-
throw new Error(
|
|
2806
|
-
}
|
|
2807
|
-
return de(await o.json());
|
|
2808
|
-
}
|
|
2809
|
-
async function Xn({ restUrl: e, apiKey: a, publicChatId: t, agentId: o, signal: r }) {
|
|
2810
|
-
if (!e) throw new Error("Missing restUrl");
|
|
2811
|
-
const i = a || t || o;
|
|
2812
|
-
if (!i) throw new Error("Provide one of apiKey, publicChatId, or agentId");
|
|
2813
|
-
const s = await fetch(`${e}/agent/${i}`, {
|
|
2814
|
-
method: "GET",
|
|
2815
|
-
mode: "cors",
|
|
2816
|
-
credentials: "omit",
|
|
2817
|
-
headers: {
|
|
2818
|
-
Accept: "application/json"
|
|
2819
|
-
},
|
|
2820
|
-
signal: r
|
|
2821
|
-
});
|
|
2822
|
-
if (!s.ok) {
|
|
2823
|
-
let d = `HTTP ${s.status}`;
|
|
2824
|
-
try {
|
|
2825
|
-
const l = await s.json();
|
|
2826
|
-
d = l?.detail || l?.message || d;
|
|
2827
|
-
} catch {
|
|
2828
|
-
}
|
|
2829
|
-
throw new Error(d);
|
|
2804
|
+
throw new Error(s);
|
|
2830
2805
|
}
|
|
2831
|
-
return
|
|
2806
|
+
return pe(await o.json());
|
|
2832
2807
|
}
|
|
2833
|
-
function
|
|
2808
|
+
function Pt(e, a) {
|
|
2834
2809
|
if (!a) return e;
|
|
2835
|
-
let { useVoice: t, useText:
|
|
2836
|
-
return typeof a.use_voice == "boolean" && (t = a.use_voice), typeof a.use_text == "boolean" && (
|
|
2810
|
+
let { useVoice: t, useText: i } = e;
|
|
2811
|
+
return typeof a.use_voice == "boolean" && (t = a.use_voice), typeof a.use_text == "boolean" && (i = a.use_text), t === e.useVoice && i === e.useText ? e : { ...e, useVoice: t, useText: i };
|
|
2837
2812
|
}
|
|
2838
2813
|
function ve(e) {
|
|
2839
2814
|
return e.agentType === oe.CLOUD_AVATAR || e.agentType === oe.DESKTOP_AVATAR ? "avatar" : e.useText && e.useVoice ? "text_and_voice" : e.useVoice ? "voice" : "text";
|
|
@@ -2844,23 +2819,23 @@ function ve(e) {
|
|
|
2844
2819
|
* This source code is licensed under the ISC license.
|
|
2845
2820
|
* See the LICENSE file in the root directory of this source tree.
|
|
2846
2821
|
*/
|
|
2847
|
-
const oa = (...e) => e.filter((a, t,
|
|
2822
|
+
const oa = (...e) => e.filter((a, t, i) => !!a && a.trim() !== "" && i.indexOf(a) === t).join(" ").trim();
|
|
2848
2823
|
/**
|
|
2849
2824
|
* @license lucide-react v1.24.0 - ISC
|
|
2850
2825
|
*
|
|
2851
2826
|
* This source code is licensed under the ISC license.
|
|
2852
2827
|
* See the LICENSE file in the root directory of this source tree.
|
|
2853
2828
|
*/
|
|
2854
|
-
const
|
|
2829
|
+
const Mt = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
2855
2830
|
/**
|
|
2856
2831
|
* @license lucide-react v1.24.0 - ISC
|
|
2857
2832
|
*
|
|
2858
2833
|
* This source code is licensed under the ISC license.
|
|
2859
2834
|
* See the LICENSE file in the root directory of this source tree.
|
|
2860
2835
|
*/
|
|
2861
|
-
const
|
|
2836
|
+
const Ct = (e) => e.replace(
|
|
2862
2837
|
/^([A-Z])|[\s-_]+(\w)/g,
|
|
2863
|
-
(a, t,
|
|
2838
|
+
(a, t, i) => i ? i.toUpperCase() : t.toLowerCase()
|
|
2864
2839
|
);
|
|
2865
2840
|
/**
|
|
2866
2841
|
* @license lucide-react v1.24.0 - ISC
|
|
@@ -2868,8 +2843,8 @@ const wt = (e) => e.replace(
|
|
|
2868
2843
|
* This source code is licensed under the ISC license.
|
|
2869
2844
|
* See the LICENSE file in the root directory of this source tree.
|
|
2870
2845
|
*/
|
|
2871
|
-
const
|
|
2872
|
-
const a =
|
|
2846
|
+
const Ze = (e) => {
|
|
2847
|
+
const a = Ct(e);
|
|
2873
2848
|
return a.charAt(0).toUpperCase() + a.slice(1);
|
|
2874
2849
|
};
|
|
2875
2850
|
/**
|
|
@@ -2878,7 +2853,7 @@ const $e = (e) => {
|
|
|
2878
2853
|
* This source code is licensed under the ISC license.
|
|
2879
2854
|
* See the LICENSE file in the root directory of this source tree.
|
|
2880
2855
|
*/
|
|
2881
|
-
var
|
|
2856
|
+
var xe = {
|
|
2882
2857
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2883
2858
|
width: 24,
|
|
2884
2859
|
height: 24,
|
|
@@ -2895,36 +2870,36 @@ var Pe = {
|
|
|
2895
2870
|
* This source code is licensed under the ISC license.
|
|
2896
2871
|
* See the LICENSE file in the root directory of this source tree.
|
|
2897
2872
|
*/
|
|
2898
|
-
const
|
|
2873
|
+
const wt = (e) => {
|
|
2899
2874
|
for (const a in e)
|
|
2900
2875
|
if (a.startsWith("aria-") || a === "role" || a === "title")
|
|
2901
2876
|
return !0;
|
|
2902
2877
|
return !1;
|
|
2903
|
-
},
|
|
2904
|
-
({ color: e, size: a, strokeWidth: t, absoluteStrokeWidth:
|
|
2878
|
+
}, At = ya({}), Lt = () => va(At), Vt = ia(
|
|
2879
|
+
({ color: e, size: a, strokeWidth: t, absoluteStrokeWidth: i, className: r = "", children: o, iconNode: s, ...c }, d) => {
|
|
2905
2880
|
const {
|
|
2906
2881
|
size: l = 24,
|
|
2907
2882
|
strokeWidth: m = 2,
|
|
2908
2883
|
absoluteStrokeWidth: u = !1,
|
|
2909
2884
|
color: h = "currentColor",
|
|
2910
|
-
className:
|
|
2911
|
-
} =
|
|
2912
|
-
return
|
|
2885
|
+
className: z = ""
|
|
2886
|
+
} = Lt() ?? {}, k = i ?? u ? Number(t ?? m) * 24 / Number(a ?? l) : t ?? m;
|
|
2887
|
+
return Pe(
|
|
2913
2888
|
"svg",
|
|
2914
2889
|
{
|
|
2915
|
-
ref:
|
|
2916
|
-
...
|
|
2917
|
-
width: a ?? l ??
|
|
2918
|
-
height: a ?? l ??
|
|
2890
|
+
ref: d,
|
|
2891
|
+
...xe,
|
|
2892
|
+
width: a ?? l ?? xe.width,
|
|
2893
|
+
height: a ?? l ?? xe.height,
|
|
2919
2894
|
stroke: e ?? h,
|
|
2920
2895
|
strokeWidth: k,
|
|
2921
|
-
className: oa("lucide",
|
|
2922
|
-
...!
|
|
2923
|
-
...
|
|
2896
|
+
className: oa("lucide", z, r),
|
|
2897
|
+
...!o && !wt(c) && { "aria-hidden": "true" },
|
|
2898
|
+
...c
|
|
2924
2899
|
},
|
|
2925
2900
|
[
|
|
2926
|
-
...s.map(([
|
|
2927
|
-
...Array.isArray(
|
|
2901
|
+
...s.map(([y, E]) => Pe(y, E)),
|
|
2902
|
+
...Array.isArray(o) ? o : [o]
|
|
2928
2903
|
]
|
|
2929
2904
|
);
|
|
2930
2905
|
}
|
|
@@ -2937,18 +2912,18 @@ const At = (e) => {
|
|
|
2937
2912
|
*/
|
|
2938
2913
|
const Y = (e, a) => {
|
|
2939
2914
|
const t = ia(
|
|
2940
|
-
({ className:
|
|
2941
|
-
ref:
|
|
2915
|
+
({ className: i, ...r }, o) => Pe(Vt, {
|
|
2916
|
+
ref: o,
|
|
2942
2917
|
iconNode: a,
|
|
2943
2918
|
className: oa(
|
|
2944
|
-
`lucide-${
|
|
2919
|
+
`lucide-${Mt(Ze(e))}`,
|
|
2945
2920
|
`lucide-${e}`,
|
|
2946
|
-
|
|
2921
|
+
i
|
|
2947
2922
|
),
|
|
2948
2923
|
...r
|
|
2949
2924
|
})
|
|
2950
2925
|
);
|
|
2951
|
-
return t.displayName =
|
|
2926
|
+
return t.displayName = Ze(e), t;
|
|
2952
2927
|
};
|
|
2953
2928
|
/**
|
|
2954
2929
|
* @license lucide-react v1.24.0 - ISC
|
|
@@ -2956,94 +2931,94 @@ const Y = (e, a) => {
|
|
|
2956
2931
|
* This source code is licensed under the ISC license.
|
|
2957
2932
|
* See the LICENSE file in the root directory of this source tree.
|
|
2958
2933
|
*/
|
|
2959
|
-
const
|
|
2934
|
+
const jt = [
|
|
2960
2935
|
["path", { d: "m5 12 7-7 7 7", key: "hav0vg" }],
|
|
2961
2936
|
["path", { d: "M12 19V5", key: "x0mq9r" }]
|
|
2962
|
-
],
|
|
2937
|
+
], It = Y("arrow-up", jt);
|
|
2963
2938
|
/**
|
|
2964
2939
|
* @license lucide-react v1.24.0 - ISC
|
|
2965
2940
|
*
|
|
2966
2941
|
* This source code is licensed under the ISC license.
|
|
2967
2942
|
* See the LICENSE file in the root directory of this source tree.
|
|
2968
2943
|
*/
|
|
2969
|
-
const
|
|
2944
|
+
const Dt = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], qt = Y("chevron-left", Dt);
|
|
2970
2945
|
/**
|
|
2971
2946
|
* @license lucide-react v1.24.0 - ISC
|
|
2972
2947
|
*
|
|
2973
2948
|
* This source code is licensed under the ISC license.
|
|
2974
2949
|
* See the LICENSE file in the root directory of this source tree.
|
|
2975
2950
|
*/
|
|
2976
|
-
const
|
|
2951
|
+
const Nt = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], ra = Y("chevron-down", Nt);
|
|
2977
2952
|
/**
|
|
2978
2953
|
* @license lucide-react v1.24.0 - ISC
|
|
2979
2954
|
*
|
|
2980
2955
|
* This source code is licensed under the ISC license.
|
|
2981
2956
|
* See the LICENSE file in the root directory of this source tree.
|
|
2982
2957
|
*/
|
|
2983
|
-
const
|
|
2958
|
+
const _t = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]], Rt = Y("chevron-up", _t);
|
|
2984
2959
|
/**
|
|
2985
2960
|
* @license lucide-react v1.24.0 - ISC
|
|
2986
2961
|
*
|
|
2987
2962
|
* This source code is licensed under the ISC license.
|
|
2988
2963
|
* See the LICENSE file in the root directory of this source tree.
|
|
2989
2964
|
*/
|
|
2990
|
-
const
|
|
2965
|
+
const Bt = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]], ye = Y("loader-circle", Bt);
|
|
2991
2966
|
/**
|
|
2992
2967
|
* @license lucide-react v1.24.0 - ISC
|
|
2993
2968
|
*
|
|
2994
2969
|
* This source code is licensed under the ISC license.
|
|
2995
2970
|
* See the LICENSE file in the root directory of this source tree.
|
|
2996
2971
|
*/
|
|
2997
|
-
const
|
|
2972
|
+
const Gt = [
|
|
2998
2973
|
["path", { d: "M15 3h6v6", key: "1q9fwt" }],
|
|
2999
2974
|
["path", { d: "m21 3-7 7", key: "1l2asr" }],
|
|
3000
2975
|
["path", { d: "m3 21 7-7", key: "tjx5ai" }],
|
|
3001
2976
|
["path", { d: "M9 21H3v-6", key: "wtvkvv" }]
|
|
3002
|
-
],
|
|
2977
|
+
], Ut = Y("maximize-2", Gt);
|
|
3003
2978
|
/**
|
|
3004
2979
|
* @license lucide-react v1.24.0 - ISC
|
|
3005
2980
|
*
|
|
3006
2981
|
* This source code is licensed under the ISC license.
|
|
3007
2982
|
* See the LICENSE file in the root directory of this source tree.
|
|
3008
2983
|
*/
|
|
3009
|
-
const
|
|
2984
|
+
const Kt = [
|
|
3010
2985
|
["path", { d: "M12 19v3", key: "npa21l" }],
|
|
3011
2986
|
["path", { d: "M15 9.34V5a3 3 0 0 0-5.68-1.33", key: "1gzdoj" }],
|
|
3012
2987
|
["path", { d: "M16.95 16.95A7 7 0 0 1 5 12v-2", key: "cqa7eg" }],
|
|
3013
2988
|
["path", { d: "M18.89 13.23A7 7 0 0 0 19 12v-2", key: "16hl24" }],
|
|
3014
2989
|
["path", { d: "m2 2 20 20", key: "1ooewy" }],
|
|
3015
2990
|
["path", { d: "M9 9v3a3 3 0 0 0 5.12 2.12", key: "r2i35w" }]
|
|
3016
|
-
],
|
|
2991
|
+
], Le = Y("mic-off", Kt);
|
|
3017
2992
|
/**
|
|
3018
2993
|
* @license lucide-react v1.24.0 - ISC
|
|
3019
2994
|
*
|
|
3020
2995
|
* This source code is licensed under the ISC license.
|
|
3021
2996
|
* See the LICENSE file in the root directory of this source tree.
|
|
3022
2997
|
*/
|
|
3023
|
-
const
|
|
2998
|
+
const Ot = [
|
|
3024
2999
|
["path", { d: "M12 19v3", key: "npa21l" }],
|
|
3025
3000
|
["path", { d: "M19 10v2a7 7 0 0 1-14 0v-2", key: "1vc78b" }],
|
|
3026
3001
|
["rect", { x: "9", y: "2", width: "6", height: "13", rx: "3", key: "s6n7sd" }]
|
|
3027
|
-
], Fe = Y("mic",
|
|
3002
|
+
], Fe = Y("mic", Ot);
|
|
3028
3003
|
/**
|
|
3029
3004
|
* @license lucide-react v1.24.0 - ISC
|
|
3030
3005
|
*
|
|
3031
3006
|
* This source code is licensed under the ISC license.
|
|
3032
3007
|
* See the LICENSE file in the root directory of this source tree.
|
|
3033
3008
|
*/
|
|
3034
|
-
const
|
|
3009
|
+
const Yt = [
|
|
3035
3010
|
["path", { d: "m14 10 7-7", key: "oa77jy" }],
|
|
3036
3011
|
["path", { d: "M20 10h-6V4", key: "mjg0md" }],
|
|
3037
3012
|
["path", { d: "m3 21 7-7", key: "tjx5ai" }],
|
|
3038
3013
|
["path", { d: "M4 14h6v6", key: "rmj7iw" }]
|
|
3039
|
-
], Te = Y("minimize-2",
|
|
3014
|
+
], Te = Y("minimize-2", Yt);
|
|
3040
3015
|
/**
|
|
3041
3016
|
* @license lucide-react v1.24.0 - ISC
|
|
3042
3017
|
*
|
|
3043
3018
|
* This source code is licensed under the ISC license.
|
|
3044
3019
|
* See the LICENSE file in the root directory of this source tree.
|
|
3045
3020
|
*/
|
|
3046
|
-
const
|
|
3021
|
+
const Qt = [
|
|
3047
3022
|
[
|
|
3048
3023
|
"path",
|
|
3049
3024
|
{
|
|
@@ -3059,14 +3034,14 @@ const Ht = [
|
|
|
3059
3034
|
key: "10hv5p"
|
|
3060
3035
|
}
|
|
3061
3036
|
]
|
|
3062
|
-
], Ve = Y("phone-off",
|
|
3037
|
+
], Ve = Y("phone-off", Qt);
|
|
3063
3038
|
/**
|
|
3064
3039
|
* @license lucide-react v1.24.0 - ISC
|
|
3065
3040
|
*
|
|
3066
3041
|
* This source code is licensed under the ISC license.
|
|
3067
3042
|
* See the LICENSE file in the root directory of this source tree.
|
|
3068
3043
|
*/
|
|
3069
|
-
const
|
|
3044
|
+
const Ht = [
|
|
3070
3045
|
[
|
|
3071
3046
|
"path",
|
|
3072
3047
|
{
|
|
@@ -3074,24 +3049,24 @@ const Wt = [
|
|
|
3074
3049
|
key: "9njp5v"
|
|
3075
3050
|
}
|
|
3076
3051
|
]
|
|
3077
|
-
],
|
|
3052
|
+
], je = Y("phone", Ht);
|
|
3078
3053
|
/**
|
|
3079
3054
|
* @license lucide-react v1.24.0 - ISC
|
|
3080
3055
|
*
|
|
3081
3056
|
* This source code is licensed under the ISC license.
|
|
3082
3057
|
* See the LICENSE file in the root directory of this source tree.
|
|
3083
3058
|
*/
|
|
3084
|
-
const
|
|
3059
|
+
const Wt = [
|
|
3085
3060
|
["path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", key: "1357e3" }],
|
|
3086
3061
|
["path", { d: "M3 3v5h5", key: "1xhq8a" }]
|
|
3087
|
-
], Zt = Y("rotate-ccw",
|
|
3062
|
+
], Zt = Y("rotate-ccw", Wt);
|
|
3088
3063
|
/**
|
|
3089
3064
|
* @license lucide-react v1.24.0 - ISC
|
|
3090
3065
|
*
|
|
3091
3066
|
* This source code is licensed under the ISC license.
|
|
3092
3067
|
* See the LICENSE file in the root directory of this source tree.
|
|
3093
3068
|
*/
|
|
3094
|
-
const
|
|
3069
|
+
const $t = [
|
|
3095
3070
|
[
|
|
3096
3071
|
"path",
|
|
3097
3072
|
{
|
|
@@ -3099,17 +3074,17 @@ const Jt = [
|
|
|
3099
3074
|
key: "r04s7s"
|
|
3100
3075
|
}
|
|
3101
3076
|
]
|
|
3102
|
-
],
|
|
3077
|
+
], Jt = Y("star", $t);
|
|
3103
3078
|
/**
|
|
3104
3079
|
* @license lucide-react v1.24.0 - ISC
|
|
3105
3080
|
*
|
|
3106
3081
|
* This source code is licensed under the ISC license.
|
|
3107
3082
|
* See the LICENSE file in the root directory of this source tree.
|
|
3108
3083
|
*/
|
|
3109
|
-
const
|
|
3084
|
+
const Xt = [
|
|
3110
3085
|
["path", { d: "M18 6 6 18", key: "1bl5f8" }],
|
|
3111
3086
|
["path", { d: "m6 6 12 12", key: "d8bk6v" }]
|
|
3112
|
-
],
|
|
3087
|
+
], Ie = Y("x", Xt), $e = [
|
|
3113
3088
|
() => import("./charachter1-D0qJg166.js").then((e) => e.default),
|
|
3114
3089
|
() => import("./charachter2-B5ArG_dI.js").then((e) => e.default),
|
|
3115
3090
|
() => import("./charachter3-DX1Okqyw.js").then((e) => e.default),
|
|
@@ -3119,19 +3094,19 @@ const en = [
|
|
|
3119
3094
|
() => import("./charachter7-DWEpJWjS.js").then((e) => e.default),
|
|
3120
3095
|
() => import("./charachter8-C3UF8oSz.js").then((e) => e.default)
|
|
3121
3096
|
];
|
|
3122
|
-
function
|
|
3097
|
+
function en(e = 1) {
|
|
3123
3098
|
const a = Math.max(0, Number(e || 1) - 1);
|
|
3124
|
-
return (
|
|
3099
|
+
return ($e[a] || $e[0])();
|
|
3125
3100
|
}
|
|
3126
|
-
const
|
|
3127
|
-
},
|
|
3128
|
-
function
|
|
3129
|
-
return typeof window < "u" && window.innerWidth <=
|
|
3101
|
+
const ne = () => {
|
|
3102
|
+
}, an = 767;
|
|
3103
|
+
function tn() {
|
|
3104
|
+
return typeof window < "u" && window.innerWidth <= an;
|
|
3130
3105
|
}
|
|
3131
|
-
function
|
|
3106
|
+
function V(...e) {
|
|
3132
3107
|
return e.filter(Boolean).join(" ");
|
|
3133
3108
|
}
|
|
3134
|
-
function
|
|
3109
|
+
function W(e) {
|
|
3135
3110
|
return ["ar", "fa", "ur", "he"].includes(e) ? "rqmii-chat-font-ar" : "rqmii-chat-font-latin";
|
|
3136
3111
|
}
|
|
3137
3112
|
function Je(e) {
|
|
@@ -3140,156 +3115,156 @@ function Je(e) {
|
|
|
3140
3115
|
function se(e) {
|
|
3141
3116
|
return ["ar", "fa", "ur", "he"].includes(e) ? "rtl" : "ltr";
|
|
3142
3117
|
}
|
|
3143
|
-
function
|
|
3118
|
+
function De(e) {
|
|
3144
3119
|
const a = Math.floor(e / 60).toString().padStart(2, "0"), t = (e % 60).toString().padStart(2, "0");
|
|
3145
3120
|
return `${a}:${t}`;
|
|
3146
3121
|
}
|
|
3147
|
-
function
|
|
3148
|
-
const [a, t] =
|
|
3149
|
-
return
|
|
3122
|
+
function nn(e = !0) {
|
|
3123
|
+
const [a, t] = v(0);
|
|
3124
|
+
return j(() => {
|
|
3150
3125
|
if (!e) return;
|
|
3151
|
-
const
|
|
3152
|
-
return () => clearInterval(
|
|
3126
|
+
const i = setInterval(() => t((r) => r + 1), 1e3);
|
|
3127
|
+
return () => clearInterval(i);
|
|
3153
3128
|
}, [e]), a;
|
|
3154
3129
|
}
|
|
3155
|
-
function
|
|
3156
|
-
const [e, a] =
|
|
3157
|
-
return
|
|
3130
|
+
function on() {
|
|
3131
|
+
const [e, a] = v(null);
|
|
3132
|
+
return j(() => {
|
|
3158
3133
|
const t = window.visualViewport;
|
|
3159
3134
|
if (!t) return;
|
|
3160
|
-
const
|
|
3161
|
-
return
|
|
3162
|
-
t.removeEventListener("resize",
|
|
3135
|
+
const i = () => a(t.height);
|
|
3136
|
+
return i(), t.addEventListener("resize", i), t.addEventListener("scroll", i), () => {
|
|
3137
|
+
t.removeEventListener("resize", i), t.removeEventListener("scroll", i);
|
|
3163
3138
|
};
|
|
3164
3139
|
}, []), e;
|
|
3165
3140
|
}
|
|
3166
|
-
function
|
|
3141
|
+
function rn(e, a) {
|
|
3167
3142
|
const t = _([]);
|
|
3168
3143
|
t.current = e.match(/\S+\s*/g) || [e];
|
|
3169
|
-
const [
|
|
3144
|
+
const [i, r] = v(
|
|
3170
3145
|
() => a ? Math.min(1, t.current.length) : t.current.length
|
|
3171
3146
|
);
|
|
3172
|
-
return
|
|
3147
|
+
return j(() => {
|
|
3173
3148
|
if (!a || !e) {
|
|
3174
3149
|
r(t.current.length);
|
|
3175
3150
|
return;
|
|
3176
3151
|
}
|
|
3177
3152
|
if (r((s) => Math.max(1, s)), t.current.length <= 1) return;
|
|
3178
|
-
const
|
|
3179
|
-
r((s) => s >= t.current.length ? (clearInterval(
|
|
3153
|
+
const o = setInterval(() => {
|
|
3154
|
+
r((s) => s >= t.current.length ? (clearInterval(o), s) : s + 1);
|
|
3180
3155
|
}, 50);
|
|
3181
|
-
return () => clearInterval(
|
|
3182
|
-
}, [e, a]), t.current.slice(0,
|
|
3156
|
+
return () => clearInterval(o);
|
|
3157
|
+
}, [e, a]), t.current.slice(0, i).join("");
|
|
3183
3158
|
}
|
|
3184
|
-
const
|
|
3185
|
-
function
|
|
3186
|
-
return e?.faceIndex === 0 && e.faceImageUrl ? e.faceImageUrl : e?.faceIndex === 9 ? null :
|
|
3159
|
+
const sn = I.lazy(() => import("./Orb-BLYExpBk.js").then((e) => ({ default: e.RqmiiOrb })));
|
|
3160
|
+
function ln(e) {
|
|
3161
|
+
return e?.faceIndex === 0 && e.faceImageUrl ? e.faceImageUrl : e?.faceIndex === 9 ? null : en(e?.faceIndex || 1);
|
|
3187
3162
|
}
|
|
3188
|
-
const
|
|
3189
|
-
const [r,
|
|
3190
|
-
return
|
|
3163
|
+
const qe = I.memo(function({ language: a, languages: t, onChange: i }) {
|
|
3164
|
+
const [r, o] = v(!1), s = _(null), c = He(a), d = be(t, a).map((l) => He(l)).filter(Boolean);
|
|
3165
|
+
return j(() => {
|
|
3191
3166
|
if (!r) return;
|
|
3192
3167
|
const l = (m) => {
|
|
3193
|
-
s.current?.contains(m.target) ||
|
|
3168
|
+
s.current?.contains(m.target) || o(!1);
|
|
3194
3169
|
};
|
|
3195
3170
|
return document.addEventListener("mousedown", l), () => document.removeEventListener("mousedown", l);
|
|
3196
3171
|
}, [r]), /* @__PURE__ */ f("div", { className: "rqmii-chat-language", ref: s, children: [
|
|
3197
|
-
/* @__PURE__ */ f("button", { type: "button", className:
|
|
3198
|
-
/* @__PURE__ */ n("span", { children:
|
|
3172
|
+
/* @__PURE__ */ f("button", { type: "button", className: V("rqmii-chat-pill", Je(a)), onClick: () => o((l) => !l), children: [
|
|
3173
|
+
/* @__PURE__ */ n("span", { children: c?.label || a }),
|
|
3199
3174
|
/* @__PURE__ */ n(ra, { size: 16 })
|
|
3200
3175
|
] }),
|
|
3201
|
-
r &&
|
|
3176
|
+
r && d.length > 1 && /* @__PURE__ */ n("div", { className: "rqmii-chat-language-menu", children: d.map((l) => /* @__PURE__ */ n(
|
|
3202
3177
|
"button",
|
|
3203
3178
|
{
|
|
3204
3179
|
type: "button",
|
|
3205
|
-
className:
|
|
3180
|
+
className: V("rqmii-chat-language-item", Je(l.value), l.value === a && "is-selected"),
|
|
3206
3181
|
onClick: () => {
|
|
3207
|
-
|
|
3182
|
+
i(l.value), o(!1);
|
|
3208
3183
|
},
|
|
3209
3184
|
children: l.label
|
|
3210
3185
|
},
|
|
3211
3186
|
l.value
|
|
3212
3187
|
)) })
|
|
3213
3188
|
] });
|
|
3214
|
-
}), le =
|
|
3215
|
-
const r =
|
|
3216
|
-
return !
|
|
3217
|
-
|
|
3189
|
+
}), le = I.memo(function({ language: a = "en", brand: t = "rqmii", agent: i }) {
|
|
3190
|
+
const r = i?.widget?.appearance, o = r?.show_branding !== !1, s = r?.footer_content?.[a], c = !!s?.trim();
|
|
3191
|
+
return !o && !c ? /* @__PURE__ */ n("div", { style: { padding: 11 } }) : /* @__PURE__ */ f("div", { className: "rqmii-chat-footer", children: [
|
|
3192
|
+
o && /* @__PURE__ */ f("p", { children: [
|
|
3218
3193
|
"Powered by ",
|
|
3219
3194
|
/* @__PURE__ */ n("strong", { children: t })
|
|
3220
3195
|
] }),
|
|
3221
|
-
|
|
3196
|
+
c && /* @__PURE__ */ n("p", { children: s })
|
|
3222
3197
|
] });
|
|
3223
|
-
}), J =
|
|
3224
|
-
const
|
|
3225
|
-
return
|
|
3198
|
+
}), J = I.memo(function({ agent: a, size: t = "large", active: i = !1, className: r = "" }) {
|
|
3199
|
+
const o = a?.faceIndex === 9, [s, c] = v(null), [d, l] = v(!s);
|
|
3200
|
+
return j(() => {
|
|
3226
3201
|
let m = !1;
|
|
3227
|
-
const u =
|
|
3228
|
-
return typeof u == "string" ? (
|
|
3229
|
-
m || (
|
|
3230
|
-
}) :
|
|
3202
|
+
const u = ln(a);
|
|
3203
|
+
return typeof u == "string" ? (c(u), l(!1)) : u instanceof Promise ? u.then((h) => {
|
|
3204
|
+
m || (c(h), l(!1));
|
|
3205
|
+
}) : c(null), () => {
|
|
3231
3206
|
m = !0;
|
|
3232
3207
|
};
|
|
3233
|
-
}, [a?.faceIndex, a?.faceImageUrl]), /* @__PURE__ */ n("div", { className:
|
|
3208
|
+
}, [a?.faceIndex, a?.faceImageUrl]), /* @__PURE__ */ n("div", { className: V("rqmii-agent-avatar", `rqmii-agent-avatar--${t}`, i && "is-active", o && "is-orb", r), children: o ? /* @__PURE__ */ n(I.Suspense, { fallback: null, children: /* @__PURE__ */ n(sn, { className: "rqmii-agent-avatar-orb" }) }) : s ? /* @__PURE__ */ n(
|
|
3234
3209
|
"img",
|
|
3235
3210
|
{
|
|
3236
3211
|
src: s,
|
|
3237
3212
|
alt: a?.name || "Agent",
|
|
3238
|
-
style: { opacity:
|
|
3213
|
+
style: { opacity: d ? 1 : 0, transition: "opacity 200ms ease" },
|
|
3239
3214
|
onLoad: () => l(!0)
|
|
3240
3215
|
}
|
|
3241
3216
|
) : null });
|
|
3242
|
-
}), sa =
|
|
3243
|
-
return /* @__PURE__ */ n("button", { type: "button", className:
|
|
3217
|
+
}), sa = I.memo(function({ agent: a, onClick: t, className: i = "", position: r = "fixed", active: o = !1 }) {
|
|
3218
|
+
return /* @__PURE__ */ n("button", { type: "button", className: V("rqmii-chat-open-button", r === "fixed" && "is-fixed", i), onClick: t, "aria-label": "Open chat", children: /* @__PURE__ */ n(J, { agent: a, size: "button", active: o }) });
|
|
3244
3219
|
});
|
|
3245
|
-
function
|
|
3220
|
+
function cn() {
|
|
3246
3221
|
try {
|
|
3247
3222
|
const e = window.AudioContext || window.webkitAudioContext;
|
|
3248
3223
|
if (!e) return;
|
|
3249
|
-
const a = new e(), t = a.currentTime,
|
|
3250
|
-
|
|
3224
|
+
const a = new e(), t = a.currentTime, i = a.createOscillator(), r = a.createGain();
|
|
3225
|
+
i.type = "sine", i.frequency.setValueAtTime(880, t), i.frequency.setValueAtTime(1180, t + 0.12), r.gain.setValueAtTime(1e-4, t), r.gain.exponentialRampToValueAtTime(0.18, t + 0.02), r.gain.exponentialRampToValueAtTime(1e-4, t + 0.32), i.connect(r), r.connect(a.destination), i.start(t), i.stop(t + 0.34), i.onended = () => {
|
|
3251
3226
|
a.close();
|
|
3252
3227
|
};
|
|
3253
3228
|
} catch {
|
|
3254
3229
|
}
|
|
3255
3230
|
}
|
|
3256
|
-
const
|
|
3257
|
-
const [
|
|
3258
|
-
return
|
|
3231
|
+
const dn = I.memo(function({ message: a, delaySeconds: t, soundEnabled: i, language: r, buttonPosition: o = "right", onClick: s }) {
|
|
3232
|
+
const [c, d] = v(!1), l = a.trim();
|
|
3233
|
+
return j(() => {
|
|
3259
3234
|
if (!l) return;
|
|
3260
3235
|
const u = setTimeout(() => {
|
|
3261
|
-
|
|
3236
|
+
d(!0), i && cn();
|
|
3262
3237
|
}, Math.max(0, t) * 1e3);
|
|
3263
3238
|
return () => clearTimeout(u);
|
|
3264
|
-
}, [l, t,
|
|
3239
|
+
}, [l, t, i]), !c || !l ? null : /* @__PURE__ */ n(
|
|
3265
3240
|
"button",
|
|
3266
3241
|
{
|
|
3267
3242
|
type: "button",
|
|
3268
|
-
className:
|
|
3243
|
+
className: V("rqmii-chat-welcome-bubble", o === "right" ? "is-right" : "is-left", W(r)),
|
|
3269
3244
|
dir: se(r),
|
|
3270
3245
|
onClick: s,
|
|
3271
3246
|
"aria-label": l,
|
|
3272
3247
|
children: l
|
|
3273
3248
|
}
|
|
3274
3249
|
);
|
|
3275
|
-
}),
|
|
3276
|
-
const [s,
|
|
3250
|
+
}), ze = I.memo(function({ language: a, placeholder: t, onSend: i, disabled: r = !1, variant: o = "text" }) {
|
|
3251
|
+
const [s, c] = v(""), d = _(null), l = 168, m = () => {
|
|
3277
3252
|
const u = s.trim();
|
|
3278
|
-
!u || r || (
|
|
3253
|
+
!u || r || (i(u), c(""), d.current && (d.current.style.height = "auto"));
|
|
3279
3254
|
};
|
|
3280
|
-
return /* @__PURE__ */ f("div", { className:
|
|
3255
|
+
return /* @__PURE__ */ f("div", { className: V("rqmii-chat-input", W(a), o === "voice" && "is-voice"), children: [
|
|
3281
3256
|
/* @__PURE__ */ n(
|
|
3282
3257
|
"textarea",
|
|
3283
3258
|
{
|
|
3284
|
-
ref:
|
|
3259
|
+
ref: d,
|
|
3285
3260
|
value: s,
|
|
3286
3261
|
disabled: r,
|
|
3287
|
-
rows:
|
|
3262
|
+
rows: o === "compact" ? 2 : 3,
|
|
3288
3263
|
dir: se(a),
|
|
3289
|
-
placeholder: t ||
|
|
3264
|
+
placeholder: t || F(a, "sendMessage"),
|
|
3290
3265
|
onChange: (u) => {
|
|
3291
|
-
|
|
3292
|
-
const h =
|
|
3266
|
+
c(u.target.value);
|
|
3267
|
+
const h = d.current;
|
|
3293
3268
|
h && (h.style.height = "auto", h.style.height = `${Math.min(h.scrollHeight, l)}px`);
|
|
3294
3269
|
},
|
|
3295
3270
|
onKeyDown: (u) => {
|
|
@@ -3297,96 +3272,96 @@ const un = D.memo(function({ message: a, delaySeconds: t, soundEnabled: o, langu
|
|
|
3297
3272
|
}
|
|
3298
3273
|
}
|
|
3299
3274
|
),
|
|
3300
|
-
/* @__PURE__ */ n("button", { type: "button", onClick: m, disabled: !s.trim() || r, "aria-label":
|
|
3275
|
+
/* @__PURE__ */ n("button", { type: "button", onClick: m, disabled: !s.trim() || r, "aria-label": F(a, "send"), children: /* @__PURE__ */ n(It, { size: 20 }) })
|
|
3301
3276
|
] });
|
|
3302
|
-
}),
|
|
3303
|
-
const
|
|
3304
|
-
return /* @__PURE__ */ n(
|
|
3305
|
-
}),
|
|
3306
|
-
function
|
|
3307
|
-
return typeof window > "u" ?
|
|
3277
|
+
}), un = I.memo(function({ text: a, streaming: t }) {
|
|
3278
|
+
const i = rn(a, t);
|
|
3279
|
+
return /* @__PURE__ */ n(Ae, { children: i });
|
|
3280
|
+
}), Ce = 133, mn = Ce + 44, hn = 767, ge = 36, gn = 8, Xe = ge + gn;
|
|
3281
|
+
function pn() {
|
|
3282
|
+
return typeof window > "u" ? Ce : window.innerWidth <= hn ? mn : Ce;
|
|
3308
3283
|
}
|
|
3309
|
-
function
|
|
3284
|
+
function bn(e) {
|
|
3310
3285
|
return e === "rtl" ? "right" : "left";
|
|
3311
3286
|
}
|
|
3312
|
-
function
|
|
3287
|
+
function kn(e, a, t, i) {
|
|
3313
3288
|
if (!e.length) return null;
|
|
3314
|
-
const r = Math.max(...e.map((s) => s.offsetTop)),
|
|
3315
|
-
return t === "right" ?
|
|
3289
|
+
const r = Math.max(...e.map((s) => s.offsetTop)), o = e.filter((s) => s.offsetTop >= r - 0.5);
|
|
3290
|
+
return t === "right" ? o.find((s) => s.offsetLeft + s.offsetWidth > a - i) || null : o.find((s) => s.offsetLeft < i) || null;
|
|
3316
3291
|
}
|
|
3317
|
-
function ea(e, a, t,
|
|
3292
|
+
function ea(e, a, t, i) {
|
|
3318
3293
|
for (let r = 0; r < 2; r++) {
|
|
3319
|
-
const
|
|
3320
|
-
if (!
|
|
3321
|
-
t === "right" ?
|
|
3294
|
+
const o = kn(e, a, t, i);
|
|
3295
|
+
if (!o) break;
|
|
3296
|
+
t === "right" ? o.style.marginRight = `${i}px` : o.style.marginLeft = `${i}px`, o.style.maxWidth = `calc(100% - ${i}px)`;
|
|
3322
3297
|
}
|
|
3323
3298
|
}
|
|
3324
|
-
const
|
|
3325
|
-
const [r,
|
|
3326
|
-
|
|
3299
|
+
const fn = I.memo(function({ suggestions: a, language: t, onClick: i }) {
|
|
3300
|
+
const [r, o] = v(!1), [s, c] = v(!1), [d, l] = v(null), [m, u] = v(null), h = _(null), z = _([]), k = se(t || "en"), y = bn(k), E = (T) => {
|
|
3301
|
+
T.forEach((g) => {
|
|
3327
3302
|
g && (g.style.maxWidth = "", g.style.marginRight = "", g.style.marginLeft = "");
|
|
3328
3303
|
});
|
|
3329
3304
|
};
|
|
3330
3305
|
return Oe(() => {
|
|
3331
|
-
const
|
|
3332
|
-
if (!
|
|
3306
|
+
const T = h.current;
|
|
3307
|
+
if (!T || r) return;
|
|
3333
3308
|
const g = () => {
|
|
3334
|
-
const p =
|
|
3335
|
-
|
|
3336
|
-
const
|
|
3309
|
+
const p = z.current;
|
|
3310
|
+
E(p);
|
|
3311
|
+
const S = T.clientWidth, x = pn(), P = () => {
|
|
3337
3312
|
for (let A = 0; A < p.length; A++) {
|
|
3338
|
-
const
|
|
3339
|
-
if (
|
|
3313
|
+
const w = p[A];
|
|
3314
|
+
if (w && w.offsetTop + w.offsetHeight > x + 0.5)
|
|
3340
3315
|
return A;
|
|
3341
3316
|
}
|
|
3342
3317
|
return null;
|
|
3343
3318
|
};
|
|
3344
|
-
let
|
|
3345
|
-
if (
|
|
3319
|
+
let C = P();
|
|
3320
|
+
if (C !== null)
|
|
3346
3321
|
for (let A = 0; A <= p.length; A++) {
|
|
3347
|
-
|
|
3348
|
-
const
|
|
3349
|
-
ea(
|
|
3350
|
-
const
|
|
3351
|
-
if (
|
|
3352
|
-
|
|
3322
|
+
E(p);
|
|
3323
|
+
const w = p.slice(0, C).filter((D) => !!D);
|
|
3324
|
+
ea(w, S, y, Xe);
|
|
3325
|
+
const M = P();
|
|
3326
|
+
if (M === null || M >= C) break;
|
|
3327
|
+
C = M;
|
|
3353
3328
|
}
|
|
3354
|
-
if (l(
|
|
3355
|
-
const A = p.slice(0,
|
|
3356
|
-
u(
|
|
3329
|
+
if (l(C), c(C !== null), C !== null) {
|
|
3330
|
+
const A = p.slice(0, C).filter((M) => !!M), w = A.length ? Math.max(...A.map((M) => M.offsetTop + M.offsetHeight)) : ge;
|
|
3331
|
+
u(w - ge);
|
|
3357
3332
|
} else
|
|
3358
3333
|
u(null);
|
|
3359
3334
|
};
|
|
3360
3335
|
g();
|
|
3361
3336
|
const b = typeof ResizeObserver < "u" ? new ResizeObserver(g) : null;
|
|
3362
|
-
return b?.observe(
|
|
3363
|
-
b?.disconnect(), z
|
|
3337
|
+
return b?.observe(T), () => {
|
|
3338
|
+
b?.disconnect(), E(z.current);
|
|
3364
3339
|
};
|
|
3365
|
-
}, [a, r,
|
|
3366
|
-
const
|
|
3367
|
-
if (!
|
|
3368
|
-
const g =
|
|
3369
|
-
z
|
|
3370
|
-
const b = g.length ? Math.max(...g.map((p) => p.offsetTop + p.offsetHeight)) :
|
|
3371
|
-
return u(b -
|
|
3372
|
-
z
|
|
3340
|
+
}, [a, r, y]), Oe(() => {
|
|
3341
|
+
const T = h.current;
|
|
3342
|
+
if (!T || !r) return;
|
|
3343
|
+
const g = z.current.filter((p) => !!p);
|
|
3344
|
+
E(z.current), ea(g, T.clientWidth, y, Xe);
|
|
3345
|
+
const b = g.length ? Math.max(...g.map((p) => p.offsetTop + p.offsetHeight)) : ge;
|
|
3346
|
+
return u(b - ge), () => {
|
|
3347
|
+
E(z.current);
|
|
3373
3348
|
};
|
|
3374
|
-
}, [r, a,
|
|
3375
|
-
a.map((
|
|
3376
|
-
const b = !r &&
|
|
3349
|
+
}, [r, a, y]), a.length ? /* @__PURE__ */ n("div", { className: V("rqmii-suggested-messages", r && "is-expanded", s && "has-overflow"), dir: k, children: /* @__PURE__ */ f("div", { ref: h, className: V("rqmii-suggested-messages-inner", r ? "is-expanded" : "is-collapsed"), children: [
|
|
3350
|
+
a.map((T, g) => {
|
|
3351
|
+
const b = !r && d !== null && g >= d;
|
|
3377
3352
|
return /* @__PURE__ */ n(
|
|
3378
3353
|
"button",
|
|
3379
3354
|
{
|
|
3380
3355
|
ref: (p) => {
|
|
3381
|
-
|
|
3356
|
+
z.current[g] = p;
|
|
3382
3357
|
},
|
|
3383
3358
|
type: "button",
|
|
3384
3359
|
className: "rqmii-suggested-message",
|
|
3385
|
-
onClick: () =>
|
|
3360
|
+
onClick: () => i(T),
|
|
3386
3361
|
style: b ? { visibility: "hidden" } : void 0,
|
|
3387
3362
|
"aria-hidden": b || void 0,
|
|
3388
3363
|
tabIndex: b ? -1 : void 0,
|
|
3389
|
-
children:
|
|
3364
|
+
children: T
|
|
3390
3365
|
},
|
|
3391
3366
|
g
|
|
3392
3367
|
);
|
|
@@ -3395,16 +3370,16 @@ const vn = D.memo(function({ suggestions: a, language: t, onClick: o }) {
|
|
|
3395
3370
|
"button",
|
|
3396
3371
|
{
|
|
3397
3372
|
type: "button",
|
|
3398
|
-
className:
|
|
3373
|
+
className: V("rqmii-suggested-messages-toggle", y === "left" && "is-start-left"),
|
|
3399
3374
|
style: m != null ? { top: m, bottom: "auto" } : void 0,
|
|
3400
|
-
onClick: () =>
|
|
3375
|
+
onClick: () => o((T) => (T && h.current && (h.current.scrollTop = 0), !T)),
|
|
3401
3376
|
"aria-label": r ? "Show less" : "Show more",
|
|
3402
3377
|
"aria-expanded": r,
|
|
3403
|
-
children: r ? /* @__PURE__ */ n(
|
|
3378
|
+
children: r ? /* @__PURE__ */ n(Rt, { size: 14 }) : /* @__PURE__ */ n(ra, { size: 14 })
|
|
3404
3379
|
}
|
|
3405
3380
|
)
|
|
3406
3381
|
] }) }) : null;
|
|
3407
|
-
}),
|
|
3382
|
+
}), vn = I.memo(function({ language: a }) {
|
|
3408
3383
|
const t = se(a || "en");
|
|
3409
3384
|
return /* @__PURE__ */ n("div", { className: "rqmii-chat-message-row", children: /* @__PURE__ */ f("div", { className: "rqmii-chat-message rqmii-chat-typing-indicator", dir: t, children: [
|
|
3410
3385
|
/* @__PURE__ */ n("span", { className: "rqmii-chat-typing-dot" }),
|
|
@@ -3412,55 +3387,55 @@ const vn = D.memo(function({ suggestions: a, language: t, onClick: o }) {
|
|
|
3412
3387
|
/* @__PURE__ */ n("span", { className: "rqmii-chat-typing-dot" })
|
|
3413
3388
|
] }) });
|
|
3414
3389
|
});
|
|
3415
|
-
function
|
|
3390
|
+
function yn(e) {
|
|
3416
3391
|
return e === "message";
|
|
3417
3392
|
}
|
|
3418
|
-
const
|
|
3393
|
+
const Fn = {
|
|
3419
3394
|
name: "leadFormName",
|
|
3420
3395
|
email: "leadFormEmail",
|
|
3421
3396
|
phone: "leadFormPhone",
|
|
3422
3397
|
message: "leadFormMessage"
|
|
3423
|
-
},
|
|
3424
|
-
const s =
|
|
3425
|
-
const p =
|
|
3426
|
-
return `${p ?
|
|
3427
|
-
},
|
|
3428
|
-
|
|
3398
|
+
}, Tn = I.memo(function({ messageId: a, form: t, language: i, textDirection: r, formSubmitted: o }) {
|
|
3399
|
+
const s = ba(), [c, d] = v({}), [l, m] = v(!1), [u, h] = v(!!o), [z, k] = v(null), y = t.title || F(i, "leadFormTitle"), E = (b) => {
|
|
3400
|
+
const p = Fn[b.key];
|
|
3401
|
+
return `${p ? F(i, p) : b.label}${b.required ? "*" : ""}`;
|
|
3402
|
+
}, T = (b, p) => {
|
|
3403
|
+
d((S) => ({ ...S, [b]: p })), z && k(null);
|
|
3429
3404
|
}, g = async (b) => {
|
|
3430
3405
|
if (b.preventDefault(), l || u) return;
|
|
3431
|
-
if (t.fields.some((
|
|
3432
|
-
k(
|
|
3406
|
+
if (t.fields.some((x) => x.required && !c[x.key]?.trim())) {
|
|
3407
|
+
k(F(i, "leadFormRequiredError"));
|
|
3433
3408
|
return;
|
|
3434
3409
|
}
|
|
3435
|
-
const
|
|
3436
|
-
for (const
|
|
3437
|
-
const
|
|
3438
|
-
|
|
3410
|
+
const S = {};
|
|
3411
|
+
for (const x of t.fields) {
|
|
3412
|
+
const P = c[x.key]?.trim();
|
|
3413
|
+
P && (S[x.key] = P);
|
|
3439
3414
|
}
|
|
3440
3415
|
m(!0), k(null);
|
|
3441
3416
|
try {
|
|
3442
|
-
await s.submitLead({ agentId: t.agentId, collectedData:
|
|
3417
|
+
await s.submitLead({ agentId: t.agentId, collectedData: S }), h(!0), s.setMessages(
|
|
3443
3418
|
s.messages.map(
|
|
3444
|
-
(
|
|
3419
|
+
(x) => x.id === a ? { ...x, formSubmitted: !0 } : x
|
|
3445
3420
|
)
|
|
3446
3421
|
);
|
|
3447
|
-
} catch (
|
|
3448
|
-
k(
|
|
3422
|
+
} catch (x) {
|
|
3423
|
+
k(x?.message || F(i, "leadFormGenericError"));
|
|
3449
3424
|
} finally {
|
|
3450
3425
|
m(!1);
|
|
3451
3426
|
}
|
|
3452
3427
|
};
|
|
3453
|
-
return u ? /* @__PURE__ */ n("div", { className: "rqmii-chat-message-row rqmii-chat-lead-form-row", children: /* @__PURE__ */ n("div", { className: "rqmii-chat-lead-form rqmii-chat-lead-form--done", dir: r, children: /* @__PURE__ */ n("div", { className: "rqmii-chat-lead-form-success", children:
|
|
3454
|
-
/* @__PURE__ */ n("div", { className: "rqmii-chat-lead-form-title", children:
|
|
3428
|
+
return u ? /* @__PURE__ */ n("div", { className: "rqmii-chat-message-row rqmii-chat-lead-form-row", children: /* @__PURE__ */ n("div", { className: "rqmii-chat-lead-form rqmii-chat-lead-form--done", dir: r, children: /* @__PURE__ */ n("div", { className: "rqmii-chat-lead-form-success", children: F(i, "leadFormSuccess") }) }) }) : /* @__PURE__ */ n("div", { className: "rqmii-chat-message-row rqmii-chat-lead-form-row", children: /* @__PURE__ */ f("form", { className: "rqmii-chat-lead-form", dir: r, onSubmit: g, children: [
|
|
3429
|
+
/* @__PURE__ */ n("div", { className: "rqmii-chat-lead-form-title", children: y }),
|
|
3455
3430
|
t.fields.map((b) => {
|
|
3456
|
-
const p =
|
|
3457
|
-
return
|
|
3431
|
+
const p = E(b), S = b.type === "email" ? "email" : b.type === "date" ? "date" : "text";
|
|
3432
|
+
return yn(b.key) ? /* @__PURE__ */ n(
|
|
3458
3433
|
"textarea",
|
|
3459
3434
|
{
|
|
3460
3435
|
className: "rqmii-chat-lead-form-input rqmii-chat-lead-form-textarea",
|
|
3461
3436
|
placeholder: p,
|
|
3462
|
-
value:
|
|
3463
|
-
onChange: (
|
|
3437
|
+
value: c[b.key] || "",
|
|
3438
|
+
onChange: (x) => T(b.key, x.target.value),
|
|
3464
3439
|
disabled: l,
|
|
3465
3440
|
rows: 4
|
|
3466
3441
|
},
|
|
@@ -3469,300 +3444,300 @@ const Tn = {
|
|
|
3469
3444
|
"input",
|
|
3470
3445
|
{
|
|
3471
3446
|
className: "rqmii-chat-lead-form-input",
|
|
3472
|
-
type:
|
|
3447
|
+
type: S,
|
|
3473
3448
|
placeholder: p,
|
|
3474
|
-
value:
|
|
3475
|
-
onChange: (
|
|
3449
|
+
value: c[b.key] || "",
|
|
3450
|
+
onChange: (x) => T(b.key, x.target.value),
|
|
3476
3451
|
disabled: l
|
|
3477
3452
|
},
|
|
3478
3453
|
b.key
|
|
3479
3454
|
);
|
|
3480
3455
|
}),
|
|
3481
|
-
|
|
3482
|
-
/* @__PURE__ */ n("button", { type: "submit", className: "rqmii-chat-lead-form-submit", disabled: l, children: l ?
|
|
3456
|
+
z && /* @__PURE__ */ n("div", { className: "rqmii-chat-lead-form-error", children: z }),
|
|
3457
|
+
/* @__PURE__ */ n("button", { type: "submit", className: "rqmii-chat-lead-form-submit", disabled: l, children: l ? F(i, "loading") : F(i, "submit") })
|
|
3483
3458
|
] }) });
|
|
3484
|
-
}), zn =
|
|
3459
|
+
}), zn = I.memo(function({ message: a, textDirection: t, language: i }) {
|
|
3485
3460
|
if (a.role === "lead_form" && a.form)
|
|
3486
|
-
return /* @__PURE__ */ n(
|
|
3461
|
+
return /* @__PURE__ */ n(Tn, { messageId: a.id, form: a.form, language: i, textDirection: t, formSubmitted: a.formSubmitted });
|
|
3487
3462
|
const r = a.role === "user" || a.sender === "user";
|
|
3488
|
-
return /* @__PURE__ */ n("div", { className:
|
|
3489
|
-
}),
|
|
3490
|
-
const
|
|
3491
|
-
return
|
|
3492
|
-
if (!
|
|
3493
|
-
const
|
|
3494
|
-
|
|
3463
|
+
return /* @__PURE__ */ n("div", { className: V("rqmii-chat-message-row", r && "is-user"), children: /* @__PURE__ */ n("div", { className: "rqmii-chat-message", dir: t, children: /* @__PURE__ */ n(un, { text: a.text, streaming: a.streaming }) }) });
|
|
3464
|
+
}), Ne = I.memo(function({ messages: a, partialTranscript: t, language: i, showTypingIndicator: r }) {
|
|
3465
|
+
const o = _(null), s = se(i || "en"), c = _(a.length);
|
|
3466
|
+
return j(() => {
|
|
3467
|
+
if (!o.current) return;
|
|
3468
|
+
const d = a.length !== c.current;
|
|
3469
|
+
c.current = a.length, o.current.scrollIntoView({ behavior: d ? "smooth" : "instant", block: "end" });
|
|
3495
3470
|
}, [a, t]), /* @__PURE__ */ f("div", { className: "rqmii-chat-messages", children: [
|
|
3496
|
-
a.map((
|
|
3497
|
-
r && /* @__PURE__ */ n(
|
|
3471
|
+
a.map((d) => /* @__PURE__ */ n(zn, { message: d, textDirection: s, language: i || "en" }, d.id || `${d.role}-${d.text}`)),
|
|
3472
|
+
r && /* @__PURE__ */ n(vn, { language: i }),
|
|
3498
3473
|
t && /* @__PURE__ */ n("div", { className: "rqmii-chat-message-row is-user is-partial", children: /* @__PURE__ */ n("div", { className: "rqmii-chat-message", dir: s, children: t }) }),
|
|
3499
|
-
/* @__PURE__ */ n("div", { ref:
|
|
3474
|
+
/* @__PURE__ */ n("div", { ref: o })
|
|
3500
3475
|
] });
|
|
3501
|
-
}), la =
|
|
3476
|
+
}), la = I.memo(function({ message: a, onRetry: t, onClose: i, language: r = "en" }) {
|
|
3502
3477
|
return /* @__PURE__ */ f("div", { className: "rqmii-chat-panel rqmii-chat-panel--error", children: [
|
|
3503
|
-
|
|
3504
|
-
/* @__PURE__ */ n("p", { children: a ||
|
|
3478
|
+
i && /* @__PURE__ */ n("button", { type: "button", className: "rqmii-error-close", onClick: i, children: "×" }),
|
|
3479
|
+
/* @__PURE__ */ n("p", { children: a || F(r, "connectionFailed") }),
|
|
3505
3480
|
t && /* @__PURE__ */ f("button", { type: "button", className: "rqmii-chat-retry", onClick: t, children: [
|
|
3506
3481
|
/* @__PURE__ */ n(Zt, { size: 16 }),
|
|
3507
|
-
/* @__PURE__ */ n("span", { children:
|
|
3482
|
+
/* @__PURE__ */ n("span", { children: F(r, "retry") })
|
|
3508
3483
|
] })
|
|
3509
3484
|
] });
|
|
3510
|
-
}),
|
|
3511
|
-
function ca({ rating: e, onRate: a, readonly: t, size:
|
|
3512
|
-
const [r,
|
|
3513
|
-
return /* @__PURE__ */ n("div", { className: "rqmii-chat-rating-stars", role: "radiogroup", children: Array.from({ length:
|
|
3514
|
-
const l =
|
|
3485
|
+
}), En = 5;
|
|
3486
|
+
function ca({ rating: e, onRate: a, readonly: t, size: i = 28 }) {
|
|
3487
|
+
const [r, o] = v(0), s = r || e;
|
|
3488
|
+
return /* @__PURE__ */ n("div", { className: "rqmii-chat-rating-stars", role: "radiogroup", children: Array.from({ length: En }, (c, d) => {
|
|
3489
|
+
const l = d + 1, m = l <= s;
|
|
3515
3490
|
return /* @__PURE__ */ n(
|
|
3516
3491
|
"button",
|
|
3517
3492
|
{
|
|
3518
3493
|
type: "button",
|
|
3519
|
-
className:
|
|
3494
|
+
className: V("rqmii-chat-star", m && "is-filled", t && "is-readonly"),
|
|
3520
3495
|
disabled: t,
|
|
3521
3496
|
"aria-label": `${l}`,
|
|
3522
3497
|
"aria-checked": l === e,
|
|
3523
3498
|
role: "radio",
|
|
3524
|
-
onMouseEnter: () => !t &&
|
|
3525
|
-
onMouseLeave: () => !t &&
|
|
3499
|
+
onMouseEnter: () => !t && o(l),
|
|
3500
|
+
onMouseLeave: () => !t && o(0),
|
|
3526
3501
|
onClick: () => !t && a?.(l),
|
|
3527
|
-
children: /* @__PURE__ */ n(
|
|
3502
|
+
children: /* @__PURE__ */ n(Jt, { size: i, fill: m ? "currentColor" : "none" })
|
|
3528
3503
|
},
|
|
3529
3504
|
l
|
|
3530
3505
|
);
|
|
3531
3506
|
}) });
|
|
3532
3507
|
}
|
|
3533
|
-
function
|
|
3508
|
+
function Sn({
|
|
3534
3509
|
language: e,
|
|
3535
3510
|
rating: a,
|
|
3536
3511
|
endedBy: t,
|
|
3537
|
-
sessionId:
|
|
3512
|
+
sessionId: i,
|
|
3538
3513
|
interactive: r,
|
|
3539
|
-
showTellUsMore:
|
|
3514
|
+
showTellUsMore: o,
|
|
3540
3515
|
onRate: s,
|
|
3541
|
-
onTellUsMore:
|
|
3516
|
+
onTellUsMore: c
|
|
3542
3517
|
}) {
|
|
3543
|
-
const
|
|
3544
|
-
return /* @__PURE__ */ f("div", { className:
|
|
3545
|
-
/* @__PURE__ */ n("div", { className: "rqmii-chat-rating-header", children:
|
|
3518
|
+
const d = a > 0 ? F(e, "ratingThankYou") : F(e, "ratingQuestion"), l = t === "user" ? F(e, "youEnded") : F(e, "agentEnded");
|
|
3519
|
+
return /* @__PURE__ */ f("div", { className: V("rqmii-chat-rating", W(e)), dir: se(e), children: [
|
|
3520
|
+
/* @__PURE__ */ n("div", { className: "rqmii-chat-rating-header", children: d }),
|
|
3546
3521
|
/* @__PURE__ */ n(ca, { rating: a, onRate: s, readonly: !r }),
|
|
3547
|
-
|
|
3522
|
+
o && /* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-rating-more", onClick: c, children: F(e, "tellUsMore") }),
|
|
3548
3523
|
/* @__PURE__ */ f("div", { className: "rqmii-chat-rating-meta", children: [
|
|
3549
3524
|
/* @__PURE__ */ n("div", { children: l }),
|
|
3550
|
-
|
|
3551
|
-
|
|
3525
|
+
i && /* @__PURE__ */ f("div", { children: [
|
|
3526
|
+
F(e, "sessionIdLabel"),
|
|
3552
3527
|
" ",
|
|
3553
|
-
/* @__PURE__ */ n("span", { className: "rqmii-chat-font-latin", children:
|
|
3528
|
+
/* @__PURE__ */ n("span", { className: "rqmii-chat-font-latin", children: i })
|
|
3554
3529
|
] })
|
|
3555
3530
|
] })
|
|
3556
3531
|
] });
|
|
3557
3532
|
}
|
|
3558
|
-
function
|
|
3533
|
+
function xn({
|
|
3559
3534
|
agent: e,
|
|
3560
3535
|
language: a,
|
|
3561
3536
|
rating: t,
|
|
3562
|
-
onBack:
|
|
3537
|
+
onBack: i,
|
|
3563
3538
|
onMinimize: r,
|
|
3564
|
-
onSubmit:
|
|
3539
|
+
onSubmit: o
|
|
3565
3540
|
}) {
|
|
3566
|
-
const [s,
|
|
3541
|
+
const [s, c] = v(""), [d, l] = v(!1), m = s.trim().length > 0 && !d, u = async () => {
|
|
3567
3542
|
if (m) {
|
|
3568
3543
|
l(!0);
|
|
3569
3544
|
try {
|
|
3570
|
-
await
|
|
3545
|
+
await o(s.trim());
|
|
3571
3546
|
} finally {
|
|
3572
3547
|
l(!1);
|
|
3573
3548
|
}
|
|
3574
3549
|
}
|
|
3575
3550
|
};
|
|
3576
|
-
return /* @__PURE__ */ f("div", { className:
|
|
3551
|
+
return /* @__PURE__ */ f("div", { className: V("rqmii-chat-panel rqmii-chat-panel--feedback", W(a)), dir: se(a), children: [
|
|
3577
3552
|
/* @__PURE__ */ f("div", { className: "rqmii-chat-topbar", children: [
|
|
3578
|
-
/* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button", onClick:
|
|
3579
|
-
/* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button", onClick: r, "aria-label":
|
|
3553
|
+
/* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button", onClick: i, "aria-label": "Back", children: /* @__PURE__ */ n(qt, { size: 20 }) }),
|
|
3554
|
+
/* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button", onClick: r, "aria-label": F(a, "minimize"), children: /* @__PURE__ */ n(Te, { size: 20 }) })
|
|
3580
3555
|
] }),
|
|
3581
3556
|
/* @__PURE__ */ f("div", { className: "rqmii-chat-feedback-body", children: [
|
|
3582
3557
|
/* @__PURE__ */ n(J, { agent: e, size: "hero" }),
|
|
3583
3558
|
/* @__PURE__ */ n(ca, { rating: t, readonly: !0 }),
|
|
3584
|
-
/* @__PURE__ */ n("div", { className: "rqmii-chat-feedback-title", children:
|
|
3585
|
-
/* @__PURE__ */ n("div", { className: "rqmii-chat-feedback-subtitle", children:
|
|
3559
|
+
/* @__PURE__ */ n("div", { className: "rqmii-chat-feedback-title", children: F(a, "ratingThankYou") }),
|
|
3560
|
+
/* @__PURE__ */ n("div", { className: "rqmii-chat-feedback-subtitle", children: F(a, "feedbackSubtitle") }),
|
|
3586
3561
|
/* @__PURE__ */ n(
|
|
3587
3562
|
"textarea",
|
|
3588
3563
|
{
|
|
3589
3564
|
className: "rqmii-chat-feedback-input",
|
|
3590
3565
|
value: s,
|
|
3591
3566
|
dir: se(a),
|
|
3592
|
-
placeholder:
|
|
3593
|
-
onChange: (h) =>
|
|
3567
|
+
placeholder: F(a, "feedbackPlaceholder"),
|
|
3568
|
+
onChange: (h) => c(h.target.value)
|
|
3594
3569
|
}
|
|
3595
3570
|
),
|
|
3596
|
-
/* @__PURE__ */ n("div", { className: "rqmii-chat-feedback-actions", children: /* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-feedback-submit", onClick: u, disabled: !m, children:
|
|
3571
|
+
/* @__PURE__ */ n("div", { className: "rqmii-chat-feedback-actions", children: /* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-feedback-submit", onClick: u, disabled: !m, children: d ? /* @__PURE__ */ n(ye, { className: "rqmii-chat-spin", size: 18 }) : F(a, "submit") }) })
|
|
3597
3572
|
] }),
|
|
3598
3573
|
/* @__PURE__ */ n(le, { language: a, agent: e })
|
|
3599
3574
|
] });
|
|
3600
3575
|
}
|
|
3601
|
-
const
|
|
3602
|
-
function
|
|
3576
|
+
const Pn = I.lazy(() => import("./RqmiiCloudAvatarPlayer-BL7GVcr_.js").then((e) => e.e).then((e) => ({ default: e.RqmiiCloudAvatarPlayer })));
|
|
3577
|
+
function me(e) {
|
|
3603
3578
|
if (!(e == null || typeof window > "u" || window.innerWidth >= 768))
|
|
3604
3579
|
return {
|
|
3605
3580
|
top: `${window.innerHeight - e}px`,
|
|
3606
3581
|
bottom: 0
|
|
3607
3582
|
};
|
|
3608
3583
|
}
|
|
3609
|
-
const
|
|
3610
|
-
const
|
|
3611
|
-
return /* @__PURE__ */ f("div", { className:
|
|
3584
|
+
const Mn = I.memo(function({ agent: a, language: t, languages: i, onLanguageChange: r, onClose: o, onSend: s, isVoiceEnabled: c = !1, isAudioPlaying: d = !1, isVoiceSetupLoading: l = !1, onStartVoice: m, visualViewportHeight: u, disabled: h = !1, error: z, suggestions: k, onSuggestionClick: y, compact: E = !1 }) {
|
|
3585
|
+
const T = me(u), g = E ? "start" : "hero", b = k && k.length > 0;
|
|
3586
|
+
return /* @__PURE__ */ f("div", { className: V("rqmii-chat-panel rqmii-chat-panel--start", E && "rqmii-chat-panel--start-compact", W(t)), style: T, children: [
|
|
3612
3587
|
/* @__PURE__ */ f("div", { className: "rqmii-chat-topbar", children: [
|
|
3613
3588
|
/* @__PURE__ */ n("span", {}),
|
|
3614
3589
|
/* @__PURE__ */ f("div", { className: "rqmii-chat-topbar-actions", children: [
|
|
3615
|
-
/* @__PURE__ */ n(
|
|
3616
|
-
/* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button", onClick:
|
|
3590
|
+
/* @__PURE__ */ n(qe, { language: t, languages: i, onChange: r }),
|
|
3591
|
+
/* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button", onClick: o, children: /* @__PURE__ */ n(Ie, { size: 20 }) })
|
|
3617
3592
|
] })
|
|
3618
3593
|
] }),
|
|
3619
3594
|
/* @__PURE__ */ f("div", { className: "rqmii-chat-start-body", children: [
|
|
3620
|
-
|
|
3621
|
-
/* @__PURE__ */ n(J, { agent: a, size: g, active:
|
|
3622
|
-
/* @__PURE__ */ n("button", { type: "button", className:
|
|
3595
|
+
c ? /* @__PURE__ */ f("div", { className: V("rqmii-chat-call-avatar-wrap", E && "is-compact"), children: [
|
|
3596
|
+
/* @__PURE__ */ n(J, { agent: a, size: g, active: d }),
|
|
3597
|
+
/* @__PURE__ */ n("button", { type: "button", className: V("rqmii-chat-call-button", E && "is-compact"), onClick: m, disabled: l, "aria-label": F(t, "startVoice"), children: l ? /* @__PURE__ */ n(ye, { className: "rqmii-chat-spin", size: E ? 18 : 24 }) : /* @__PURE__ */ n(je, { size: E ? 18 : 24 }) })
|
|
3623
3598
|
] }) : /* @__PURE__ */ n(J, { agent: a, size: g }),
|
|
3624
3599
|
/* @__PURE__ */ n("div", { className: "rqmii-chat-agent-name", children: a.name }),
|
|
3625
|
-
|
|
3600
|
+
z && /* @__PURE__ */ n("div", { className: "rqmii-chat-error-text", children: z })
|
|
3626
3601
|
] }),
|
|
3627
|
-
b && /* @__PURE__ */ n("div", { className: "rqmii-chat-start-suggestions", children: /* @__PURE__ */ n(
|
|
3628
|
-
/* @__PURE__ */ n(
|
|
3602
|
+
b && /* @__PURE__ */ n("div", { className: "rqmii-chat-start-suggestions", children: /* @__PURE__ */ n(fn, { suggestions: k, language: t, onClick: (p) => y?.(p) }) }),
|
|
3603
|
+
/* @__PURE__ */ n(ze, { language: t, onSend: s, disabled: h }),
|
|
3629
3604
|
/* @__PURE__ */ n(le, { language: t, agent: a })
|
|
3630
3605
|
] });
|
|
3631
|
-
}),
|
|
3632
|
-
const m =
|
|
3633
|
-
return /* @__PURE__ */ f("div", { className:
|
|
3606
|
+
}), Cn = I.memo(function({ agent: a, language: t, languages: i, onLanguageChange: r, onClose: o, onStartVoice: s, isVoiceSetupLoading: c = !1, isAudioPlaying: d, visualViewportHeight: l }) {
|
|
3607
|
+
const m = me(l);
|
|
3608
|
+
return /* @__PURE__ */ f("div", { className: V("rqmii-chat-panel rqmii-chat-panel--voice-start", W(t)), style: m, children: [
|
|
3634
3609
|
/* @__PURE__ */ f("div", { className: "rqmii-chat-topbar", children: [
|
|
3635
3610
|
/* @__PURE__ */ n("span", {}),
|
|
3636
3611
|
/* @__PURE__ */ f("div", { className: "rqmii-chat-topbar-actions", children: [
|
|
3637
|
-
/* @__PURE__ */ n(
|
|
3638
|
-
/* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button", onClick:
|
|
3612
|
+
/* @__PURE__ */ n(qe, { language: t, languages: i, onChange: r }),
|
|
3613
|
+
/* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button", onClick: o, children: /* @__PURE__ */ n(Ie, { size: 20 }) })
|
|
3639
3614
|
] })
|
|
3640
3615
|
] }),
|
|
3641
3616
|
/* @__PURE__ */ f("div", { className: "rqmii-chat-call-body", children: [
|
|
3642
3617
|
/* @__PURE__ */ f("div", { className: "rqmii-chat-call-avatar-wrap", children: [
|
|
3643
|
-
/* @__PURE__ */ n(J, { agent: a, size: "hero", active:
|
|
3644
|
-
/* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-call-button", onClick: s, disabled:
|
|
3618
|
+
/* @__PURE__ */ n(J, { agent: a, size: "hero", active: d }),
|
|
3619
|
+
/* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-call-button", onClick: s, disabled: c, "aria-label": F(t, "startVoice"), children: c ? /* @__PURE__ */ n(ye, { className: "rqmii-chat-spin", size: 24 }) : /* @__PURE__ */ n(je, { size: 24 }) })
|
|
3645
3620
|
] }),
|
|
3646
3621
|
/* @__PURE__ */ f("div", { className: "rqmii-chat-agent-name", children: [
|
|
3647
|
-
|
|
3622
|
+
F(t, "call"),
|
|
3648
3623
|
" ",
|
|
3649
3624
|
a.name
|
|
3650
3625
|
] })
|
|
3651
3626
|
] }),
|
|
3652
3627
|
/* @__PURE__ */ n(le, { language: t, agent: a })
|
|
3653
3628
|
] });
|
|
3654
|
-
}),
|
|
3655
|
-
const p = da({ language: t, isListening: u, isLoading:
|
|
3656
|
-
return /* @__PURE__ */ f("div", { className:
|
|
3629
|
+
}), wn = I.memo(function({ agent: a, language: t, onEndSession: i, onMinimize: r, messages: o, partialTranscript: s, onSend: c, isAudioPlaying: d, isVoiceEnabled: l, onToggleVoice: m, isListening: u, isSpeaking: h, isLoading: z, isAgentThinking: k, isAgentSpeaking: y, onStartVoice: E, elapsed: T, visualViewportHeight: g, waitingForResponse: b }) {
|
|
3630
|
+
const p = da({ language: t, isListening: u, isLoading: z, isSpeaking: h, isAudioPlaying: d, isAgentThinking: k, isAgentSpeaking: y, persistentListening: !1 }), S = me(g);
|
|
3631
|
+
return /* @__PURE__ */ f("div", { className: V("rqmii-chat-panel rqmii-chat-panel--conversation", W(t)), style: S, children: [
|
|
3657
3632
|
/* @__PURE__ */ f("div", { className: "rqmii-chat-header", children: [
|
|
3658
|
-
/* @__PURE__ */ n(J, { agent: a, size: "header", active:
|
|
3633
|
+
/* @__PURE__ */ n(J, { agent: a, size: "header", active: d }),
|
|
3659
3634
|
l && p && /* @__PURE__ */ n("div", { className: "rqmii-chat-header-status", children: /* @__PURE__ */ n("span", { children: p }) }),
|
|
3660
3635
|
/* @__PURE__ */ n("div", { className: "rqmii-chat-header-spacer" }),
|
|
3661
3636
|
/* @__PURE__ */ f("div", { className: "rqmii-chat-header-actions", children: [
|
|
3662
|
-
r && /* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button", onClick: r, "aria-label":
|
|
3663
|
-
l && /* @__PURE__ */ n("button", { type: "button", className:
|
|
3664
|
-
/* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button is-danger", onClick:
|
|
3637
|
+
r && /* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button", onClick: r, "aria-label": F(t, "minimize"), children: /* @__PURE__ */ n(Te, { size: 20 }) }),
|
|
3638
|
+
l && /* @__PURE__ */ n("button", { type: "button", className: V("rqmii-chat-circle-button", h && "is-active"), onClick: m, "aria-label": u ? F(t, "stopVoice") : F(t, "startVoice"), children: u ? /* @__PURE__ */ n(Fe, { size: 20 }) : /* @__PURE__ */ n(Le, { size: 20 }) }),
|
|
3639
|
+
/* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button is-danger", onClick: i, "aria-label": F(t, "endCall"), children: /* @__PURE__ */ n(Ve, { size: 20 }) })
|
|
3665
3640
|
] })
|
|
3666
3641
|
] }),
|
|
3667
|
-
/* @__PURE__ */ n(
|
|
3668
|
-
l && /* @__PURE__ */ n("div", { className: "rqmii-chat-session-counter", children:
|
|
3669
|
-
/* @__PURE__ */ n(
|
|
3642
|
+
/* @__PURE__ */ n(Ne, { messages: o, partialTranscript: s, language: t, showTypingIndicator: b }),
|
|
3643
|
+
l && /* @__PURE__ */ n("div", { className: "rqmii-chat-session-counter", children: De(T) }),
|
|
3644
|
+
/* @__PURE__ */ n(ze, { language: t, onSend: c }),
|
|
3670
3645
|
/* @__PURE__ */ n(le, { language: t, agent: a })
|
|
3671
3646
|
] });
|
|
3672
|
-
}),
|
|
3673
|
-
const k = da({ language: t, isListening:
|
|
3674
|
-
return /* @__PURE__ */ f("div", { className:
|
|
3647
|
+
}), An = I.memo(function({ agent: a, language: t, onEndSession: i, onMinimize: r, isListening: o, isLoading: s, isSpeaking: c, isAudioPlaying: d, isAgentThinking: l, isAgentSpeaking: m, onToggleVoice: u, elapsed: h, visualViewportHeight: z }) {
|
|
3648
|
+
const k = da({ language: t, isListening: o, isLoading: s, isSpeaking: c, isAudioPlaying: d, isAgentThinking: l, isAgentSpeaking: m, persistentListening: !0 }), y = me(z);
|
|
3649
|
+
return /* @__PURE__ */ f("div", { className: V("rqmii-chat-panel rqmii-chat-panel--voice-call", W(t)), style: y, children: [
|
|
3675
3650
|
/* @__PURE__ */ f("div", { className: "rqmii-chat-call-status", children: [
|
|
3676
|
-
/* @__PURE__ */ n("span", { className:
|
|
3677
|
-
/* @__PURE__ */ n("span", { children:
|
|
3651
|
+
/* @__PURE__ */ n("span", { className: V("rqmii-chat-live-dot", o && "is-live") }),
|
|
3652
|
+
/* @__PURE__ */ n("span", { children: De(h) }),
|
|
3678
3653
|
/* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button", onClick: r, children: /* @__PURE__ */ n(Te, { size: 20 }) })
|
|
3679
3654
|
] }),
|
|
3680
3655
|
/* @__PURE__ */ f("div", { className: "rqmii-chat-voice-frame", children: [
|
|
3681
|
-
/* @__PURE__ */ n(J, { agent: a, size: "hero", active:
|
|
3656
|
+
/* @__PURE__ */ n(J, { agent: a, size: "hero", active: d }),
|
|
3682
3657
|
/* @__PURE__ */ n("div", { className: "rqmii-chat-agent-name", children: a.name }),
|
|
3683
|
-
/* @__PURE__ */ n("div", { className:
|
|
3658
|
+
/* @__PURE__ */ n("div", { className: V("rqmii-chat-status-pill", !k && "is-empty"), children: k || F(t, "listening") }),
|
|
3684
3659
|
/* @__PURE__ */ f("div", { className: "rqmii-chat-voice-actions", children: [
|
|
3685
|
-
/* @__PURE__ */ n("button", { type: "button", className:
|
|
3686
|
-
/* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button is-danger", onClick:
|
|
3660
|
+
/* @__PURE__ */ n("button", { type: "button", className: V("rqmii-chat-circle-button", c && "is-active"), onClick: u, children: o ? /* @__PURE__ */ n(Fe, { size: 20 }) : /* @__PURE__ */ n(Le, { size: 20 }) }),
|
|
3661
|
+
/* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button is-danger", onClick: i, "aria-label": F(t, "endCall"), children: /* @__PURE__ */ n(Ve, { size: 20 }) })
|
|
3687
3662
|
] })
|
|
3688
3663
|
] }),
|
|
3689
3664
|
/* @__PURE__ */ n(le, { language: t, agent: a })
|
|
3690
3665
|
] });
|
|
3691
3666
|
});
|
|
3692
|
-
function da({ language: e, isListening: a, isLoading: t, isSpeaking:
|
|
3693
|
-
return t ?
|
|
3667
|
+
function da({ language: e, isListening: a, isLoading: t, isSpeaking: i, isAudioPlaying: r, isAgentThinking: o, isAgentSpeaking: s, persistentListening: c = !1 }) {
|
|
3668
|
+
return t ? F(e, "loading") : i ? F(e, "listening") : r || s ? F(e, "talkToInterrupt") : o ? F(e, "processing") : a && c ? F(e, "listening") : null;
|
|
3694
3669
|
}
|
|
3695
|
-
const
|
|
3696
|
-
const h =
|
|
3697
|
-
return /* @__PURE__ */ f("div", { className:
|
|
3670
|
+
const Ln = I.memo(function({ agent: a, language: t, onRestore: i, onClose: r, isListening: o, isAudioPlaying: s, isSpeaking: c, onToggleVoice: d, elapsed: l, visualViewportHeight: m, variant: u = "voice" }) {
|
|
3671
|
+
const h = me(m), z = u === "text";
|
|
3672
|
+
return /* @__PURE__ */ f("div", { className: V("rqmii-chat-minimized", W(t)), style: h, children: [
|
|
3698
3673
|
/* @__PURE__ */ n(J, { agent: a, size: "minimized", active: s }),
|
|
3699
|
-
!
|
|
3674
|
+
!z && /* @__PURE__ */ n("span", { className: "rqmii-chat-minimized-time", children: De(l) }),
|
|
3700
3675
|
/* @__PURE__ */ f("div", { className: "rqmii-chat-minimized-actions", children: [
|
|
3701
|
-
/* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button", onClick:
|
|
3702
|
-
!
|
|
3703
|
-
/* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button is-danger", onClick: r, "aria-label":
|
|
3676
|
+
/* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button", onClick: i, "aria-label": F(t, "maximize"), children: /* @__PURE__ */ n(Ut, { size: 20 }) }),
|
|
3677
|
+
!z && /* @__PURE__ */ n("button", { type: "button", className: V("rqmii-chat-circle-button", c && "is-active"), onClick: d, "aria-label": o ? F(t, "stopVoice") : F(t, "startVoice"), children: o ? /* @__PURE__ */ n(Fe, { size: 20 }) : /* @__PURE__ */ n(Le, { size: 20 }) }),
|
|
3678
|
+
/* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button is-danger", onClick: r, "aria-label": F(t, "endCall"), children: /* @__PURE__ */ n(Ve, { size: 20 }) })
|
|
3704
3679
|
] })
|
|
3705
3680
|
] });
|
|
3706
|
-
}), Vn =
|
|
3681
|
+
}), Vn = I.memo(function({
|
|
3707
3682
|
agent: a,
|
|
3708
3683
|
language: t,
|
|
3709
|
-
languages:
|
|
3684
|
+
languages: i,
|
|
3710
3685
|
chatKind: r,
|
|
3711
|
-
messages:
|
|
3686
|
+
messages: o,
|
|
3712
3687
|
onLanguageChange: s,
|
|
3713
|
-
onMinimize:
|
|
3714
|
-
onStartNewVoice:
|
|
3688
|
+
onMinimize: c,
|
|
3689
|
+
onStartNewVoice: d,
|
|
3715
3690
|
onStartNewText: l,
|
|
3716
3691
|
isVoiceSetupLoading: m = !1,
|
|
3717
3692
|
visualViewportHeight: u,
|
|
3718
3693
|
rating: h,
|
|
3719
|
-
endedBy:
|
|
3694
|
+
endedBy: z,
|
|
3720
3695
|
sessionId: k,
|
|
3721
|
-
ratingInteractive:
|
|
3722
|
-
showTellUsMore:
|
|
3723
|
-
onRate:
|
|
3696
|
+
ratingInteractive: y,
|
|
3697
|
+
showTellUsMore: E,
|
|
3698
|
+
onRate: T,
|
|
3724
3699
|
onTellUsMore: g
|
|
3725
3700
|
}) {
|
|
3726
|
-
const b =
|
|
3727
|
-
|
|
3701
|
+
const b = me(u), p = k && a.widget?.behavior?.post_chat_rating_enabled ? /* @__PURE__ */ n(
|
|
3702
|
+
Sn,
|
|
3728
3703
|
{
|
|
3729
3704
|
language: t,
|
|
3730
3705
|
rating: h,
|
|
3731
|
-
endedBy:
|
|
3706
|
+
endedBy: z,
|
|
3732
3707
|
sessionId: k,
|
|
3733
|
-
interactive:
|
|
3734
|
-
showTellUsMore:
|
|
3735
|
-
onRate:
|
|
3708
|
+
interactive: y,
|
|
3709
|
+
showTellUsMore: E,
|
|
3710
|
+
onRate: T,
|
|
3736
3711
|
onTellUsMore: g
|
|
3737
3712
|
}
|
|
3738
|
-
) : null,
|
|
3739
|
-
/* @__PURE__ */ n(
|
|
3713
|
+
) : null, S = r === "voice" || r === "text_and_voice", x = r === "text" || r === "text_and_voice", P = /* @__PURE__ */ f("div", { className: "rqmii-chat-topbar-actions rqmii-chat-topbar-actions--ended", children: [
|
|
3714
|
+
/* @__PURE__ */ n(qe, { language: t, languages: i, onChange: s }),
|
|
3740
3715
|
/* @__PURE__ */ n(
|
|
3741
3716
|
"button",
|
|
3742
3717
|
{
|
|
3743
3718
|
type: "button",
|
|
3744
3719
|
className: "rqmii-chat-circle-button",
|
|
3745
|
-
onClick:
|
|
3746
|
-
"aria-label":
|
|
3720
|
+
onClick: c,
|
|
3721
|
+
"aria-label": F(t, "minimize"),
|
|
3747
3722
|
children: /* @__PURE__ */ n(Te, { size: 20 })
|
|
3748
3723
|
}
|
|
3749
3724
|
),
|
|
3750
|
-
|
|
3725
|
+
S && /* @__PURE__ */ n(
|
|
3751
3726
|
"button",
|
|
3752
3727
|
{
|
|
3753
3728
|
type: "button",
|
|
3754
3729
|
className: "rqmii-chat-circle-button rqmii-chat-circle-button--call-start",
|
|
3755
|
-
onClick:
|
|
3730
|
+
onClick: d,
|
|
3756
3731
|
disabled: m,
|
|
3757
|
-
"aria-label":
|
|
3758
|
-
children: m ? /* @__PURE__ */ n(ye, { className: "rqmii-chat-spin", size: 20 }) : /* @__PURE__ */ n(
|
|
3732
|
+
"aria-label": F(t, "startVoice"),
|
|
3733
|
+
children: m ? /* @__PURE__ */ n(ye, { className: "rqmii-chat-spin", size: 20 }) : /* @__PURE__ */ n(je, { size: 20 })
|
|
3759
3734
|
}
|
|
3760
3735
|
)
|
|
3761
3736
|
] });
|
|
3762
|
-
return r === "voice" ? /* @__PURE__ */ f("div", { className:
|
|
3737
|
+
return r === "voice" ? /* @__PURE__ */ f("div", { className: V("rqmii-chat-panel rqmii-chat-panel--voice-call", W(t)), style: b, children: [
|
|
3763
3738
|
/* @__PURE__ */ f("div", { className: "rqmii-chat-topbar", children: [
|
|
3764
3739
|
/* @__PURE__ */ n("span", {}),
|
|
3765
|
-
|
|
3740
|
+
P
|
|
3766
3741
|
] }),
|
|
3767
3742
|
/* @__PURE__ */ f("div", { className: "rqmii-chat-voice-frame", children: [
|
|
3768
3743
|
/* @__PURE__ */ n(J, { agent: a, size: "hero" }),
|
|
@@ -3770,53 +3745,53 @@ const jn = D.memo(function({ agent: a, language: t, onRestore: o, onClose: r, is
|
|
|
3770
3745
|
p
|
|
3771
3746
|
] }),
|
|
3772
3747
|
/* @__PURE__ */ n(le, { language: t, agent: a })
|
|
3773
|
-
] }) : /* @__PURE__ */ f("div", { className:
|
|
3748
|
+
] }) : /* @__PURE__ */ f("div", { className: V("rqmii-chat-panel rqmii-chat-panel--conversation", W(t)), style: b, children: [
|
|
3774
3749
|
/* @__PURE__ */ f("div", { className: "rqmii-chat-topbar", children: [
|
|
3775
3750
|
/* @__PURE__ */ n(J, { agent: a, size: "header" }),
|
|
3776
|
-
|
|
3751
|
+
P
|
|
3777
3752
|
] }),
|
|
3778
|
-
/* @__PURE__ */ n(
|
|
3753
|
+
/* @__PURE__ */ n(Ne, { messages: o, language: t }),
|
|
3779
3754
|
p,
|
|
3780
|
-
|
|
3755
|
+
x && /* @__PURE__ */ n(ze, { language: t, onSend: l }),
|
|
3781
3756
|
/* @__PURE__ */ n(le, { language: t, agent: a })
|
|
3782
3757
|
] });
|
|
3783
|
-
}), ua =
|
|
3784
|
-
const { streamingUrl: r, isCloudStreamConnected:
|
|
3785
|
-
return /* @__PURE__ */ f("div", { className:
|
|
3758
|
+
}), ua = I.memo(function({ agent: a, language: t, onClose: i }) {
|
|
3759
|
+
const { streamingUrl: r, isCloudStreamConnected: o, cloudStreamError: s } = Ke(), { isAvatarSpeaking: c } = Ke(), { messages: d, sendTextMessage: l } = de();
|
|
3760
|
+
return /* @__PURE__ */ f("div", { className: V("rqmii-avatar-panel", W(t)), children: [
|
|
3786
3761
|
/* @__PURE__ */ f("div", { className: "rqmii-avatar-stream", children: [
|
|
3787
|
-
/* @__PURE__ */ n(
|
|
3788
|
-
!r && /* @__PURE__ */ n("div", { className: "rqmii-avatar-overlay", children:
|
|
3789
|
-
s && /* @__PURE__ */ n("div", { className: "rqmii-avatar-overlay", children:
|
|
3762
|
+
/* @__PURE__ */ n(I.Suspense, { fallback: /* @__PURE__ */ n("div", { className: "rqmii-avatar-overlay", children: F(t, "loading") }), children: /* @__PURE__ */ n(Pn, { autoConnect: !0, muted: !1 }) }),
|
|
3763
|
+
!r && /* @__PURE__ */ n("div", { className: "rqmii-avatar-overlay", children: F(t, "loading") }),
|
|
3764
|
+
s && /* @__PURE__ */ n("div", { className: "rqmii-avatar-overlay", children: F(t, "connectionFailed") }),
|
|
3790
3765
|
/* @__PURE__ */ f("div", { className: "rqmii-avatar-controls", children: [
|
|
3791
|
-
/* @__PURE__ */ n(J, { agent: a, size: "header", active:
|
|
3766
|
+
/* @__PURE__ */ n(J, { agent: a, size: "header", active: c }),
|
|
3792
3767
|
/* @__PURE__ */ n("div", { className: "rqmii-chat-header-spacer" }),
|
|
3793
|
-
/* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button", disabled: !
|
|
3794
|
-
/* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button is-danger", onClick:
|
|
3768
|
+
/* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button", disabled: !o, children: /* @__PURE__ */ n(Fe, { size: 20 }) }),
|
|
3769
|
+
/* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button is-danger", onClick: i, children: /* @__PURE__ */ n(Ie, { size: 20 }) })
|
|
3795
3770
|
] })
|
|
3796
3771
|
] }),
|
|
3797
3772
|
a.useText && /* @__PURE__ */ f("div", { className: "rqmii-avatar-sidebar", children: [
|
|
3798
|
-
/* @__PURE__ */ n(
|
|
3799
|
-
/* @__PURE__ */ n(
|
|
3773
|
+
/* @__PURE__ */ n(Ne, { messages: d, language: t }),
|
|
3774
|
+
/* @__PURE__ */ n(ze, { language: t, onSend: l, variant: "compact" }),
|
|
3800
3775
|
/* @__PURE__ */ n(le, { language: t, agent: a })
|
|
3801
3776
|
] })
|
|
3802
3777
|
] });
|
|
3803
3778
|
});
|
|
3804
|
-
function
|
|
3805
|
-
const r = a?.title?.[e] ||
|
|
3779
|
+
function jn({ language: e, config: a, onAccept: t, onDecline: i }) {
|
|
3780
|
+
const r = a?.title?.[e] || F(e, "consentTitle"), o = a?.body?.[e] || F(e, "consentBody"), s = a?.acceptLabel?.[e] || F(e, "consentAccept"), c = a?.declineLabel?.[e] || F(e, "consentDecline"), d = a?.termsUrl?.[e], l = a?.privacyUrl?.[e];
|
|
3806
3781
|
return /* @__PURE__ */ f("div", { className: "rqmii-chat-panel rqmii-chat-panel--start", style: { justifyContent: "space-between" }, children: [
|
|
3807
3782
|
/* @__PURE__ */ f("div", { style: { flex: 1, display: "flex", flexDirection: "column", justifyContent: "center", padding: "24px", gap: "16px" }, children: [
|
|
3808
3783
|
/* @__PURE__ */ n("div", { style: { fontSize: "16px", fontWeight: 600, color: "var(--rqmii-text)" }, children: r }),
|
|
3809
3784
|
/* @__PURE__ */ f("div", { style: { fontSize: "13px", lineHeight: 1.5, color: "var(--rqmii-muted)" }, children: [
|
|
3810
|
-
|
|
3811
|
-
(
|
|
3785
|
+
o,
|
|
3786
|
+
(d || l) && /* @__PURE__ */ f("span", { children: [
|
|
3812
3787
|
" ",
|
|
3813
|
-
|
|
3814
|
-
|
|
3788
|
+
d && /* @__PURE__ */ n("a", { href: d, target: "_blank", rel: "noopener noreferrer", style: { color: "var(--rqmii-action)", textDecoration: "underline" }, children: F(e, "consentTermsLink") }),
|
|
3789
|
+
d && l && /* @__PURE__ */ f("span", { children: [
|
|
3815
3790
|
" ",
|
|
3816
|
-
|
|
3791
|
+
F(e, "close")?.toLowerCase() === "close" ? "and" : "و",
|
|
3817
3792
|
" "
|
|
3818
3793
|
] }),
|
|
3819
|
-
l && /* @__PURE__ */ n("a", { href: l, target: "_blank", rel: "noopener noreferrer", style: { color: "var(--rqmii-action)", textDecoration: "underline" }, children:
|
|
3794
|
+
l && /* @__PURE__ */ n("a", { href: l, target: "_blank", rel: "noopener noreferrer", style: { color: "var(--rqmii-action)", textDecoration: "underline" }, children: F(e, "consentPrivacyLink") }),
|
|
3820
3795
|
"."
|
|
3821
3796
|
] })
|
|
3822
3797
|
] })
|
|
@@ -3827,9 +3802,9 @@ function In({ language: e, config: a, onAccept: t, onDecline: o }) {
|
|
|
3827
3802
|
{
|
|
3828
3803
|
type: "button",
|
|
3829
3804
|
className: "rqmii-chat-pill",
|
|
3830
|
-
onClick:
|
|
3805
|
+
onClick: i,
|
|
3831
3806
|
style: { background: "transparent", border: "1px solid var(--rqmii-border)" },
|
|
3832
|
-
children:
|
|
3807
|
+
children: c
|
|
3833
3808
|
}
|
|
3834
3809
|
),
|
|
3835
3810
|
/* @__PURE__ */ n(
|
|
@@ -3845,175 +3820,175 @@ function In({ language: e, config: a, onAccept: t, onDecline: o }) {
|
|
|
3845
3820
|
] })
|
|
3846
3821
|
] });
|
|
3847
3822
|
}
|
|
3848
|
-
function
|
|
3823
|
+
function In(e) {
|
|
3849
3824
|
return e ? typeof e == "string" ? e : typeof e == "object" && typeof e.text == "string" ? e.text : "" : "";
|
|
3850
3825
|
}
|
|
3851
|
-
function
|
|
3826
|
+
function Dn(e) {
|
|
3852
3827
|
return e === "text" || e === "voice" || e === "text_and_voice";
|
|
3853
3828
|
}
|
|
3854
|
-
const
|
|
3829
|
+
const _e = I.memo(function({
|
|
3855
3830
|
agent: a,
|
|
3856
3831
|
language: t,
|
|
3857
|
-
languages:
|
|
3858
|
-
onLanguageChange: r =
|
|
3859
|
-
onEndSession:
|
|
3832
|
+
languages: i,
|
|
3833
|
+
onLanguageChange: r = ne,
|
|
3834
|
+
onEndSession: o = ne,
|
|
3860
3835
|
onMinimize: s,
|
|
3861
|
-
messages:
|
|
3862
|
-
onSendMessage:
|
|
3836
|
+
messages: c,
|
|
3837
|
+
onSendMessage: d,
|
|
3863
3838
|
isPreview: l = !1,
|
|
3864
3839
|
chatKind: m,
|
|
3865
3840
|
sdk: u,
|
|
3866
3841
|
renderPanel: h,
|
|
3867
|
-
messagesRef:
|
|
3842
|
+
messagesRef: z,
|
|
3868
3843
|
initialText: k,
|
|
3869
|
-
autoStartVoice:
|
|
3844
|
+
autoStartVoice: y
|
|
3870
3845
|
}) {
|
|
3871
|
-
const [
|
|
3872
|
-
|
|
3846
|
+
const [E, T] = v(!1), g = m || ve(a), [b, p] = v(() => g === "voice" && u.isSessionReady || g === "voice" && !!y), [S, x] = v(() => (g === "text" || g === "text_and_voice") && u.isSessionReady || !!k || g === "text_and_voice" && !!y), [P, C] = v(!1), [A, w] = v(!1), [M, D] = v(null), Z = nn(g === "voice" && b || g === "text_and_voice" && S), q = on(), B = a.consent?.enabled && !E && !l, N = Dn(g), { events: U } = ue();
|
|
3847
|
+
j(() => {
|
|
3873
3848
|
if (!U) return;
|
|
3874
|
-
const
|
|
3875
|
-
N &&
|
|
3876
|
-
},
|
|
3877
|
-
N &&
|
|
3849
|
+
const O = () => {
|
|
3850
|
+
N && tn() && C(!0);
|
|
3851
|
+
}, H = () => {
|
|
3852
|
+
N && C(!1);
|
|
3878
3853
|
};
|
|
3879
|
-
return U.on("minimize_chat",
|
|
3880
|
-
U.off("minimize_chat",
|
|
3854
|
+
return U.on("minimize_chat", O), U.on("maximize_chat", H), () => {
|
|
3855
|
+
U.off("minimize_chat", O), U.off("maximize_chat", H);
|
|
3881
3856
|
};
|
|
3882
3857
|
}, [U, N]);
|
|
3883
|
-
const
|
|
3884
|
-
s ? s() :
|
|
3885
|
-
},
|
|
3886
|
-
r(
|
|
3887
|
-
},
|
|
3888
|
-
if (
|
|
3889
|
-
|
|
3858
|
+
const K = () => T(!0), $ = () => {
|
|
3859
|
+
s ? s() : o();
|
|
3860
|
+
}, ae = (O) => {
|
|
3861
|
+
r(O), l || u.changeSessionLanguage(O);
|
|
3862
|
+
}, te = re((O) => {
|
|
3863
|
+
if (D(null), w(!0), d) {
|
|
3864
|
+
d(O);
|
|
3890
3865
|
return;
|
|
3891
3866
|
}
|
|
3892
|
-
u.sendTextMessage(
|
|
3893
|
-
}, [
|
|
3894
|
-
|
|
3895
|
-
|
|
3867
|
+
u.sendTextMessage(O);
|
|
3868
|
+
}, [d, u]);
|
|
3869
|
+
j(() => {
|
|
3870
|
+
z && (z.current = u.messages);
|
|
3896
3871
|
});
|
|
3897
|
-
const
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
}, []),
|
|
3901
|
-
A && u.isSessionReady && (
|
|
3902
|
-
}, [A, u.isSessionReady, g]),
|
|
3903
|
-
A && u.error && (
|
|
3872
|
+
const Q = _(!1);
|
|
3873
|
+
j(() => {
|
|
3874
|
+
Q.current || (k ? (Q.current = !0, te(k)) : y && (Q.current = !0, D(null), w(!0), u.isVoiceActive || u.startVoice()));
|
|
3875
|
+
}, []), j(() => {
|
|
3876
|
+
A && u.isSessionReady && (w(!1), g === "voice" ? p(!0) : x(!0));
|
|
3877
|
+
}, [A, u.isSessionReady, g]), j(() => {
|
|
3878
|
+
A && u.error && (w(!1), D(u.error));
|
|
3904
3879
|
}, [A, u.error]);
|
|
3905
|
-
const
|
|
3906
|
-
|
|
3880
|
+
const ie = re(() => {
|
|
3881
|
+
D(null), w(!0), u.isVoiceActive || u.startVoice();
|
|
3907
3882
|
}, [u]);
|
|
3908
|
-
if (u.error && !l && (
|
|
3883
|
+
if (u.error && !l && (S || b)) return /* @__PURE__ */ n(la, { message: u.error, language: t, onClose: o });
|
|
3909
3884
|
if (B)
|
|
3910
|
-
return /* @__PURE__ */ n(
|
|
3885
|
+
return /* @__PURE__ */ n(jn, { language: t, config: a.consent, onAccept: K, onDecline: $ });
|
|
3911
3886
|
const R = {
|
|
3912
3887
|
agent: a,
|
|
3913
3888
|
language: t,
|
|
3914
|
-
languages:
|
|
3889
|
+
languages: i,
|
|
3915
3890
|
chatKind: g,
|
|
3916
3891
|
sdk: u,
|
|
3917
3892
|
isPreview: l,
|
|
3918
|
-
onLanguageChange:
|
|
3919
|
-
onClose:
|
|
3920
|
-
onMinimize: N ? () =>
|
|
3921
|
-
onRestore: N ? () =>
|
|
3922
|
-
onSend:
|
|
3893
|
+
onLanguageChange: ae,
|
|
3894
|
+
onClose: o,
|
|
3895
|
+
onMinimize: N ? () => C(!0) : void 0,
|
|
3896
|
+
onRestore: N ? () => C(!1) : void 0,
|
|
3897
|
+
onSend: te,
|
|
3923
3898
|
voiceStarted: b,
|
|
3924
|
-
conversationStarted:
|
|
3925
|
-
isMinimized:
|
|
3926
|
-
elapsed:
|
|
3899
|
+
conversationStarted: S,
|
|
3900
|
+
isMinimized: P,
|
|
3901
|
+
elapsed: Z,
|
|
3927
3902
|
setVoiceStarted: p,
|
|
3928
|
-
setConversationStarted:
|
|
3903
|
+
setConversationStarted: x
|
|
3929
3904
|
};
|
|
3930
|
-
return h ? /* @__PURE__ */ n(
|
|
3931
|
-
|
|
3905
|
+
return h ? /* @__PURE__ */ n(Ae, { children: h(R) }) : /* @__PURE__ */ n(qn, { ...R, connecting: A, connectError: M, visualViewportHeight: q, onCloseWidget: s ?? o, initiateVoice: ie, onSendSuggestion: (O) => {
|
|
3906
|
+
D(null), w(!0), u.sendSuggestion?.(O);
|
|
3932
3907
|
} });
|
|
3933
|
-
}),
|
|
3934
|
-
const
|
|
3935
|
-
if (r === "avatar") return /* @__PURE__ */ n(ua, { agent: a, language: t, onClose:
|
|
3936
|
-
if (
|
|
3937
|
-
return /* @__PURE__ */ n(
|
|
3908
|
+
}), qn = I.memo(function({ agent: a, language: t, languages: i, chatKind: r, sdk: o, onLanguageChange: s, onClose: c, onMinimize: d, onRestore: l, onSend: m, voiceStarted: u, conversationStarted: h, isMinimized: z, elapsed: k, setVoiceStarted: y, setConversationStarted: E, visualViewportHeight: T, connecting: g = !1, connectError: b = null, onCloseWidget: p, initiateVoice: S, onSendSuggestion: x }) {
|
|
3909
|
+
const P = a.widget?.behavior?.typing_indicator_enabled ?? !0, C = r === "text" ? o.waitingForResponse && P : !1, A = o.messages;
|
|
3910
|
+
if (r === "avatar") return /* @__PURE__ */ n(ua, { agent: a, language: t, onClose: c });
|
|
3911
|
+
if (z)
|
|
3912
|
+
return /* @__PURE__ */ n(Ln, { agent: a, language: t, onRestore: l, onClose: c, isListening: o.isVoiceActive, isAudioPlaying: o.isAudioPlaying, isSpeaking: o.vad.isSpeaking, onToggleVoice: o.toggleVoice, elapsed: k, visualViewportHeight: T, variant: r === "text" ? "text" : "voice" });
|
|
3938
3913
|
if (r === "voice" && u)
|
|
3939
|
-
return /* @__PURE__ */ n(
|
|
3914
|
+
return /* @__PURE__ */ n(An, { agent: a, language: t, onEndSession: c, onMinimize: d, isListening: o.isVoiceActive, isLoading: o.vad.isLoading, isSpeaking: o.vad.isSpeaking, isAudioPlaying: o.isAudioPlaying, isAgentThinking: o.isAgentThinking, isAgentSpeaking: o.isAgentSpeaking, onToggleVoice: o.toggleVoice, elapsed: k, visualViewportHeight: T });
|
|
3940
3915
|
if (r === "voice")
|
|
3941
|
-
return /* @__PURE__ */ n(
|
|
3942
|
-
if (!h && (
|
|
3943
|
-
const
|
|
3944
|
-
|
|
3945
|
-
},
|
|
3946
|
-
return /* @__PURE__ */ n(
|
|
3916
|
+
return /* @__PURE__ */ n(Cn, { agent: a, language: t, languages: i, onLanguageChange: s, onClose: p, isAudioPlaying: o.isAudioPlaying, isVoiceSetupLoading: o.isVoiceSetupLoading || g, onStartVoice: S, visualViewportHeight: T });
|
|
3917
|
+
if (!h && (o.messages.length === 0 || g)) {
|
|
3918
|
+
const w = a.conversation?.suggested_messages?.[t]?.filter((G) => G.trim()) || void 0, M = (G) => {
|
|
3919
|
+
o.sendSuggestion ? x(G) : m?.(G);
|
|
3920
|
+
}, D = r === "text_and_voice" || ve(a) === "text_and_voice";
|
|
3921
|
+
return /* @__PURE__ */ n(Mn, { agent: a, language: t, languages: i, onLanguageChange: s, onClose: p, onSend: m, isVoiceEnabled: D, isAudioPlaying: o.isAudioPlaying, isVoiceSetupLoading: o.isVoiceSetupLoading || g, onStartVoice: S, visualViewportHeight: T, disabled: g, error: b || void 0, suggestions: w, onSuggestionClick: M, compact: !!w });
|
|
3947
3922
|
}
|
|
3948
|
-
return /* @__PURE__ */ n(
|
|
3949
|
-
}),
|
|
3923
|
+
return /* @__PURE__ */ n(wn, { agent: a, language: t, onEndSession: c, messages: A, partialTranscript: In(o.partialTranscript), onSend: m, isAudioPlaying: o.isAudioPlaying, isVoiceEnabled: r === "text_and_voice", isListening: o.isVoiceActive, isSpeaking: o.vad.isSpeaking, isLoading: o.vad.isLoading, isAgentThinking: o.isAgentThinking, isAgentSpeaking: o.isAgentSpeaking, onToggleVoice: o.toggleVoice, onStartVoice: o.startVoice, onMinimize: d, elapsed: k, visualViewportHeight: T, waitingForResponse: C });
|
|
3924
|
+
}), Nn = { isListening: !1, isLoading: !1, isSpeaking: !1, toggle: async () => !1 };
|
|
3950
3925
|
function ma({ isSessionReady: e, sendTextMessage: a, messages: t }) {
|
|
3951
|
-
const [
|
|
3952
|
-
r((
|
|
3926
|
+
const [i, r] = v(null), [o, s] = v(null), c = re(() => {
|
|
3927
|
+
r((d) => (d && (e ? a(d) : s(d)), null));
|
|
3953
3928
|
}, [e, a]);
|
|
3954
|
-
return
|
|
3955
|
-
|
|
3956
|
-
}, [t,
|
|
3957
|
-
if (!
|
|
3958
|
-
const
|
|
3959
|
-
return () => clearTimeout(
|
|
3960
|
-
}, [
|
|
3961
|
-
!
|
|
3962
|
-
}, [e,
|
|
3929
|
+
return j(() => {
|
|
3930
|
+
i && t.length !== 0 && c();
|
|
3931
|
+
}, [t, i, c]), j(() => {
|
|
3932
|
+
if (!i) return;
|
|
3933
|
+
const d = setTimeout(c, 5e3);
|
|
3934
|
+
return () => clearTimeout(d);
|
|
3935
|
+
}, [i, c]), j(() => {
|
|
3936
|
+
!o || !e || (a(o), s(null));
|
|
3937
|
+
}, [e, o, a]), { pendingWelcomeText: i, pendingMessage: o, setPendingWelcomeText: r, setPendingMessage: s, sendPendingWelcomeText: c };
|
|
3963
3938
|
}
|
|
3964
|
-
function
|
|
3965
|
-
const [t,
|
|
3966
|
-
return
|
|
3967
|
-
!e || s.current || !t || (s.current = !0, a(r),
|
|
3968
|
-
}, [e, t, r, a]), { emitClientReady: re((
|
|
3969
|
-
e ? (s.current = !0, a(
|
|
3939
|
+
function Re({ isSessionReady: e, signalClientReady: a }) {
|
|
3940
|
+
const [t, i] = v(!1), [r, o] = v(void 0), s = _(!1);
|
|
3941
|
+
return j(() => {
|
|
3942
|
+
!e || s.current || !t || (s.current = !0, a(r), i(!1));
|
|
3943
|
+
}, [e, t, r, a]), { emitClientReady: re((d) => {
|
|
3944
|
+
e ? (s.current = !0, a(d)) : (o(d), i(!0));
|
|
3970
3945
|
}, [e, a]) };
|
|
3971
3946
|
}
|
|
3972
|
-
const
|
|
3973
|
-
function
|
|
3974
|
-
const { isPreview: a = !1, ...t } = e, { messages:
|
|
3975
|
-
|
|
3976
|
-
if (
|
|
3977
|
-
const q =
|
|
3978
|
-
q.role === "assistant" && q.streaming &&
|
|
3947
|
+
const _n = 300;
|
|
3948
|
+
function Rn(e) {
|
|
3949
|
+
const { isPreview: a = !1, ...t } = e, { messages: i, sendTextMessage: r, emitUserMessage: o, addLocalMessage: s, clearMessages: c } = de(), { changeSessionLanguage: d, clearSessionHistory: l, signalClientReady: m, error: u, isSessionReady: h, isAgentThinking: z, isAgentSpeaking: k } = ue(), y = _(!1), E = _(null), T = _(!1), [g, b] = v(!1), [p, S] = v(null), [x, P] = v(!1), C = _(i.length);
|
|
3950
|
+
j(() => {
|
|
3951
|
+
if (i.length > C.current) {
|
|
3952
|
+
const q = i[i.length - 1];
|
|
3953
|
+
q.role === "assistant" && q.streaming && P(!1);
|
|
3979
3954
|
}
|
|
3980
|
-
|
|
3981
|
-
}, [
|
|
3982
|
-
|
|
3983
|
-
}, [])),
|
|
3984
|
-
if (!h || !g ||
|
|
3985
|
-
const q =
|
|
3955
|
+
C.current = i.length;
|
|
3956
|
+
}, [i]), aa("message_rate_limited", re(() => {
|
|
3957
|
+
P(!1);
|
|
3958
|
+
}, [])), j(() => {
|
|
3959
|
+
if (!h || !g || T.current) return;
|
|
3960
|
+
const q = E.current;
|
|
3986
3961
|
if (q === null) return;
|
|
3987
|
-
|
|
3962
|
+
T.current = !0, E.current = null, s("user", q), S(null);
|
|
3988
3963
|
const B = e.agent.welcomeMessages?.[e.language];
|
|
3989
3964
|
m(B ? { welcomeMessage: B } : void 0);
|
|
3990
3965
|
const N = setTimeout(() => {
|
|
3991
|
-
|
|
3992
|
-
},
|
|
3966
|
+
o(q), P(!0);
|
|
3967
|
+
}, _n);
|
|
3993
3968
|
return () => clearTimeout(N);
|
|
3994
|
-
}, [h, g, m,
|
|
3995
|
-
const A =
|
|
3996
|
-
|
|
3997
|
-
}, [
|
|
3969
|
+
}, [h, g, m, o, s]);
|
|
3970
|
+
const A = ee(() => p ? [{ id: "first-user", role: "user", text: p }, ...i] : i, [p, i]), w = re(() => {
|
|
3971
|
+
S(null), c();
|
|
3972
|
+
}, [c]), M = {
|
|
3998
3973
|
emitClientReady: m,
|
|
3999
3974
|
sendMessage: (q) => {
|
|
4000
3975
|
r(q);
|
|
4001
3976
|
},
|
|
4002
|
-
queueForWelcome:
|
|
4003
|
-
enableVoice:
|
|
4004
|
-
disableVoice:
|
|
3977
|
+
queueForWelcome: ne,
|
|
3978
|
+
enableVoice: ne,
|
|
3979
|
+
disableVoice: ne,
|
|
4005
3980
|
language: e.language,
|
|
4006
3981
|
isSessionReady: h,
|
|
4007
3982
|
supportsVoice: !1,
|
|
4008
3983
|
isVoiceActive: !1,
|
|
4009
3984
|
chatKind: "text"
|
|
4010
|
-
},
|
|
4011
|
-
e.onSessionStart?.(),
|
|
3985
|
+
}, D = (q, B) => {
|
|
3986
|
+
e.onSessionStart?.(), y.current ? (P(!0), B.sendMessage(q)) : (y.current = !0, S(q), E.current = q, b(!0), P(!0));
|
|
4012
3987
|
}, G = (q) => {
|
|
4013
|
-
e.onTextSend ? e.onTextSend(q,
|
|
3988
|
+
e.onTextSend ? e.onTextSend(q, M) : D(q, M);
|
|
4014
3989
|
};
|
|
4015
3990
|
return /* @__PURE__ */ n(
|
|
4016
|
-
|
|
3991
|
+
_e,
|
|
4017
3992
|
{
|
|
4018
3993
|
...t,
|
|
4019
3994
|
isPreview: a,
|
|
@@ -4021,305 +3996,305 @@ function Bn(e) {
|
|
|
4021
3996
|
sdk: {
|
|
4022
3997
|
messages: A,
|
|
4023
3998
|
sendTextMessage: G,
|
|
4024
|
-
clearMessages:
|
|
3999
|
+
clearMessages: w,
|
|
4025
4000
|
clearSessionHistory: l,
|
|
4026
4001
|
isAudioPlaying: !1,
|
|
4027
4002
|
partialTranscript: null,
|
|
4028
|
-
changeSessionLanguage:
|
|
4003
|
+
changeSessionLanguage: d,
|
|
4029
4004
|
error: u,
|
|
4030
|
-
isAgentThinking:
|
|
4005
|
+
isAgentThinking: z,
|
|
4031
4006
|
isAgentSpeaking: k,
|
|
4032
4007
|
isVoiceSetupLoading: !1,
|
|
4033
4008
|
isVoiceActive: !1,
|
|
4034
4009
|
isSessionReady: h,
|
|
4035
|
-
vad:
|
|
4036
|
-
startVoice:
|
|
4037
|
-
prepareVoice:
|
|
4038
|
-
toggleVoice:
|
|
4010
|
+
vad: Nn,
|
|
4011
|
+
startVoice: ne,
|
|
4012
|
+
prepareVoice: ne,
|
|
4013
|
+
toggleVoice: ne,
|
|
4039
4014
|
signalClientReady: m,
|
|
4040
|
-
waitingForResponse:
|
|
4015
|
+
waitingForResponse: x,
|
|
4041
4016
|
sendSuggestion: G
|
|
4042
4017
|
}
|
|
4043
4018
|
}
|
|
4044
4019
|
);
|
|
4045
4020
|
}
|
|
4046
|
-
function
|
|
4047
|
-
const { isPreview: a = !1, ...t } = e, { messages:
|
|
4021
|
+
function Bn(e) {
|
|
4022
|
+
const { isPreview: a = !1, ...t } = e, { messages: i, sendTextMessage: r, clearMessages: o } = de(), { isAudioPlaying: s, partialTranscript: c } = ta(), { changeSessionLanguage: d, clearSessionHistory: l, signalClientReady: m, error: u, isSessionReady: h, isAgentThinking: z, isAgentSpeaking: k } = ue(), { setPendingWelcomeText: y, setPendingMessage: E } = ma({ isSessionReady: h, sendTextMessage: r, messages: i }), { emitClientReady: T } = Re({ isSessionReady: h, signalClientReady: m }), [g, b] = v(!1), p = na({
|
|
4048
4023
|
enabled: !0,
|
|
4049
4024
|
preloadStream: !1
|
|
4050
|
-
}), { isLoading:
|
|
4051
|
-
|
|
4052
|
-
!g || !h ||
|
|
4053
|
-
}, [g, h,
|
|
4054
|
-
const
|
|
4025
|
+
}), { isLoading: S, isListening: x, toggle: P } = p, C = S, A = x || g;
|
|
4026
|
+
j(() => {
|
|
4027
|
+
!g || !h || S || x || P();
|
|
4028
|
+
}, [g, h, S, x, P]);
|
|
4029
|
+
const w = () => {
|
|
4055
4030
|
e.onSessionStart?.();
|
|
4056
|
-
},
|
|
4057
|
-
emitClientReady:
|
|
4031
|
+
}, M = {
|
|
4032
|
+
emitClientReady: T,
|
|
4058
4033
|
sendMessage: (N) => {
|
|
4059
|
-
h ? r(N) :
|
|
4034
|
+
h ? r(N) : E(N);
|
|
4060
4035
|
},
|
|
4061
|
-
queueForWelcome: (N) =>
|
|
4036
|
+
queueForWelcome: (N) => y(N),
|
|
4062
4037
|
enableVoice: () => b(!0),
|
|
4063
4038
|
disableVoice: () => {
|
|
4064
|
-
b(!1),
|
|
4039
|
+
b(!1), x && P();
|
|
4065
4040
|
},
|
|
4066
4041
|
language: e.language,
|
|
4067
4042
|
isSessionReady: h,
|
|
4068
4043
|
supportsVoice: !0,
|
|
4069
4044
|
isVoiceActive: A,
|
|
4070
4045
|
chatKind: "voice"
|
|
4071
|
-
},
|
|
4072
|
-
|
|
4046
|
+
}, D = (N) => {
|
|
4047
|
+
w(), N.enableVoice();
|
|
4073
4048
|
const U = e.agent.welcomeMessages?.[e.language];
|
|
4074
4049
|
N.emitClientReady(U ? { welcomeMessage: U } : void 0);
|
|
4075
4050
|
}, G = (N) => {
|
|
4076
4051
|
N.isVoiceActive ? N.disableVoice() : N.enableVoice();
|
|
4077
4052
|
};
|
|
4078
4053
|
return /* @__PURE__ */ n(
|
|
4079
|
-
|
|
4054
|
+
_e,
|
|
4080
4055
|
{
|
|
4081
4056
|
...t,
|
|
4082
4057
|
isPreview: a,
|
|
4083
4058
|
chatKind: "voice",
|
|
4084
4059
|
sdk: {
|
|
4085
|
-
messages:
|
|
4060
|
+
messages: i,
|
|
4086
4061
|
sendTextMessage: () => {
|
|
4087
4062
|
},
|
|
4088
|
-
clearMessages:
|
|
4063
|
+
clearMessages: o,
|
|
4089
4064
|
clearSessionHistory: l,
|
|
4090
4065
|
isAudioPlaying: s,
|
|
4091
|
-
partialTranscript:
|
|
4092
|
-
changeSessionLanguage:
|
|
4066
|
+
partialTranscript: c,
|
|
4067
|
+
changeSessionLanguage: d,
|
|
4093
4068
|
error: u,
|
|
4094
|
-
isAgentThinking:
|
|
4069
|
+
isAgentThinking: z,
|
|
4095
4070
|
isAgentSpeaking: k,
|
|
4096
|
-
isVoiceSetupLoading:
|
|
4071
|
+
isVoiceSetupLoading: C,
|
|
4097
4072
|
isVoiceActive: A,
|
|
4098
4073
|
isSessionReady: h,
|
|
4099
4074
|
vad: p,
|
|
4100
4075
|
startVoice: () => {
|
|
4101
|
-
e.onVoiceStart ? e.onVoiceStart(
|
|
4076
|
+
e.onVoiceStart ? e.onVoiceStart(M) : D(M);
|
|
4102
4077
|
},
|
|
4103
4078
|
prepareVoice: () => {
|
|
4104
4079
|
},
|
|
4105
4080
|
toggleVoice: () => {
|
|
4106
|
-
e.onVoiceToggle ? e.onVoiceToggle(
|
|
4081
|
+
e.onVoiceToggle ? e.onVoiceToggle(M) : G(M);
|
|
4107
4082
|
},
|
|
4108
4083
|
signalClientReady: m
|
|
4109
4084
|
}
|
|
4110
4085
|
}
|
|
4111
4086
|
);
|
|
4112
4087
|
}
|
|
4113
|
-
const
|
|
4114
|
-
function
|
|
4115
|
-
const { isPreview: a = !1, ...t } = e, { messages:
|
|
4116
|
-
|
|
4117
|
-
if (
|
|
4118
|
-
const
|
|
4119
|
-
|
|
4088
|
+
const Gn = 300;
|
|
4089
|
+
function Un(e) {
|
|
4090
|
+
const { isPreview: a = !1, ...t } = e, { messages: i, sendTextMessage: r, emitUserMessage: o, addLocalMessage: s, clearMessages: c } = de(), { isAudioPlaying: d, partialTranscript: l } = ta(), { changeSessionLanguage: m, clearSessionHistory: u, signalClientReady: h, error: z, isSessionReady: k, isAgentThinking: y, isAgentSpeaking: E } = ue(), { emitClientReady: T } = Re({ isSessionReady: k, signalClientReady: h }), [g, b] = v(!1), p = _(null), [S, x] = v(!1), P = _(null), [C, A] = v(!1), w = _(!1), M = _(!1), D = _(!1), [G, Z] = v(null), [q, B] = v(!1), N = _(i.length);
|
|
4091
|
+
j(() => {
|
|
4092
|
+
if (i.length > N.current) {
|
|
4093
|
+
const L = i[i.length - 1];
|
|
4094
|
+
L.role === "assistant" && L.streaming && B(!1);
|
|
4120
4095
|
}
|
|
4121
|
-
N.current =
|
|
4122
|
-
}, [
|
|
4096
|
+
N.current = i.length;
|
|
4097
|
+
}, [i]), aa("message_rate_limited", re(() => {
|
|
4123
4098
|
B(!1);
|
|
4124
4099
|
}, []));
|
|
4125
4100
|
const U = na({
|
|
4126
4101
|
enabled: !0,
|
|
4127
4102
|
preloadStream: !1
|
|
4128
|
-
}), { isLoading:
|
|
4129
|
-
|
|
4130
|
-
!g || !k ||
|
|
4131
|
-
}, [g, k,
|
|
4132
|
-
if (!k || !
|
|
4133
|
-
const
|
|
4134
|
-
if (
|
|
4135
|
-
|
|
4136
|
-
const
|
|
4137
|
-
h(
|
|
4138
|
-
const
|
|
4139
|
-
|
|
4140
|
-
},
|
|
4141
|
-
return () => clearTimeout(
|
|
4142
|
-
}, [k,
|
|
4143
|
-
if (!k || !
|
|
4144
|
-
const
|
|
4145
|
-
|
|
4146
|
-
}, [k,
|
|
4147
|
-
const
|
|
4148
|
-
|
|
4149
|
-
}, [
|
|
4103
|
+
}), { isLoading: K, isListening: $, toggle: ae } = U, te = K, Q = $ || g;
|
|
4104
|
+
j(() => {
|
|
4105
|
+
!g || !k || K || $ || ae();
|
|
4106
|
+
}, [g, k, K, $, ae]), j(() => {
|
|
4107
|
+
if (!k || !S || D.current) return;
|
|
4108
|
+
const L = p.current;
|
|
4109
|
+
if (L === null) return;
|
|
4110
|
+
D.current = !0, p.current = null, s("user", L), Z(null);
|
|
4111
|
+
const X = e.agent.welcomeMessages?.[e.language];
|
|
4112
|
+
h(X ? { welcomeMessage: X } : void 0);
|
|
4113
|
+
const Se = setTimeout(() => {
|
|
4114
|
+
o(L), B(!0);
|
|
4115
|
+
}, Gn);
|
|
4116
|
+
return () => clearTimeout(Se);
|
|
4117
|
+
}, [k, S, h, o, s]), j(() => {
|
|
4118
|
+
if (!k || !C || w.current) return;
|
|
4119
|
+
const L = P.current;
|
|
4120
|
+
L !== null && (w.current = !0, P.current = null, s("user", L), o(L), B(!0), A(!1));
|
|
4121
|
+
}, [k, C, o, s]);
|
|
4122
|
+
const ie = ee(() => G ? [{ id: "first-user", role: "user", text: G }, ...i] : i, [G, i]), R = re(() => {
|
|
4123
|
+
Z(null), M.current = !1, D.current = !1, c();
|
|
4124
|
+
}, [c]), O = () => {
|
|
4150
4125
|
e.onSessionStart?.();
|
|
4151
|
-
},
|
|
4152
|
-
emitClientReady: (
|
|
4153
|
-
|
|
4126
|
+
}, H = {
|
|
4127
|
+
emitClientReady: (L) => {
|
|
4128
|
+
D.current = !0, M.current = !0, T(L);
|
|
4154
4129
|
},
|
|
4155
|
-
sendMessage: (
|
|
4156
|
-
r(
|
|
4130
|
+
sendMessage: (L) => {
|
|
4131
|
+
r(L);
|
|
4157
4132
|
},
|
|
4158
4133
|
queueForWelcome: () => {
|
|
4159
4134
|
},
|
|
4160
4135
|
enableVoice: () => b(!0),
|
|
4161
4136
|
disableVoice: () => {
|
|
4162
|
-
b(!1),
|
|
4137
|
+
b(!1), $ && ae();
|
|
4163
4138
|
},
|
|
4164
4139
|
language: e.language,
|
|
4165
4140
|
isSessionReady: k,
|
|
4166
4141
|
supportsVoice: !0,
|
|
4167
|
-
isVoiceActive:
|
|
4142
|
+
isVoiceActive: Q,
|
|
4168
4143
|
chatKind: "text_and_voice"
|
|
4169
|
-
},
|
|
4170
|
-
|
|
4171
|
-
},
|
|
4172
|
-
|
|
4173
|
-
const
|
|
4174
|
-
|
|
4175
|
-
}, fe = (
|
|
4176
|
-
|
|
4177
|
-
},
|
|
4178
|
-
messages:
|
|
4179
|
-
sendTextMessage: (
|
|
4180
|
-
e.onTextSend ? e.onTextSend(
|
|
4144
|
+
}, ce = (L, X) => {
|
|
4145
|
+
O(), !M.current && !D.current ? (M.current = !0, e.onStartText?.(), Z(L), p.current = L, x(!0), B(!0)) : (M.current = !0, B(!0), X.sendMessage(L));
|
|
4146
|
+
}, ke = (L) => {
|
|
4147
|
+
O(), M.current = !0, D.current = !0, e.onStartVoice?.(), L.enableVoice();
|
|
4148
|
+
const X = e.agent.welcomeMessages?.[e.language];
|
|
4149
|
+
L.emitClientReady(X ? { welcomeMessage: X } : void 0);
|
|
4150
|
+
}, fe = (L) => {
|
|
4151
|
+
L.isVoiceActive ? L.disableVoice() : L.enableVoice();
|
|
4152
|
+
}, Ee = {
|
|
4153
|
+
messages: ie,
|
|
4154
|
+
sendTextMessage: (L) => {
|
|
4155
|
+
e.onTextSend ? e.onTextSend(L, H) : ce(L, H);
|
|
4181
4156
|
},
|
|
4182
4157
|
clearMessages: R,
|
|
4183
4158
|
clearSessionHistory: u,
|
|
4184
|
-
isAudioPlaying:
|
|
4159
|
+
isAudioPlaying: d,
|
|
4185
4160
|
partialTranscript: l,
|
|
4186
4161
|
changeSessionLanguage: m,
|
|
4187
|
-
error:
|
|
4188
|
-
isAgentThinking:
|
|
4189
|
-
isAgentSpeaking:
|
|
4190
|
-
isVoiceSetupLoading:
|
|
4191
|
-
isVoiceActive:
|
|
4162
|
+
error: z,
|
|
4163
|
+
isAgentThinking: y,
|
|
4164
|
+
isAgentSpeaking: E,
|
|
4165
|
+
isVoiceSetupLoading: te,
|
|
4166
|
+
isVoiceActive: Q,
|
|
4192
4167
|
isSessionReady: k,
|
|
4193
4168
|
vad: U,
|
|
4194
4169
|
startVoice: () => {
|
|
4195
|
-
e.onVoiceStart ? e.onVoiceStart(
|
|
4170
|
+
e.onVoiceStart ? e.onVoiceStart(H) : ke(H);
|
|
4196
4171
|
},
|
|
4197
4172
|
prepareVoice: () => {
|
|
4198
4173
|
},
|
|
4199
4174
|
toggleVoice: () => {
|
|
4200
|
-
e.onVoiceToggle ? e.onVoiceToggle(
|
|
4175
|
+
e.onVoiceToggle ? e.onVoiceToggle(H) : fe(H);
|
|
4201
4176
|
},
|
|
4202
4177
|
signalClientReady: h,
|
|
4203
4178
|
waitingForResponse: q,
|
|
4204
|
-
sendSuggestion: (
|
|
4205
|
-
|
|
4179
|
+
sendSuggestion: (L) => {
|
|
4180
|
+
O(), M.current = !0, D.current = !0, e.onStartVoice?.(), b(!0), P.current = L, A(!0);
|
|
4206
4181
|
}
|
|
4207
4182
|
};
|
|
4208
4183
|
return /* @__PURE__ */ n(
|
|
4209
|
-
|
|
4184
|
+
_e,
|
|
4210
4185
|
{
|
|
4211
4186
|
...t,
|
|
4212
4187
|
isPreview: a,
|
|
4213
4188
|
chatKind: e.textOnly ? "text" : "text_and_voice",
|
|
4214
|
-
sdk:
|
|
4189
|
+
sdk: Ee
|
|
4215
4190
|
}
|
|
4216
4191
|
);
|
|
4217
4192
|
}
|
|
4218
|
-
function
|
|
4219
|
-
const { isPreview: a = !1, agent: t, language:
|
|
4220
|
-
return ma({ isSessionReady: g, sendTextMessage: h, messages: u }),
|
|
4193
|
+
function Kn(e) {
|
|
4194
|
+
const { isPreview: a = !1, agent: t, language: i, languages: r, onLanguageChange: o, onEndSession: s, onMinimize: c, messages: d, onSendMessage: l } = e, m = s || c || ne, { messages: u, sendTextMessage: h, clearMessages: z } = de(), { changeSessionLanguage: k, clearSessionHistory: y, signalClientReady: E, error: T, isSessionReady: g, isAgentThinking: b, isAgentSpeaking: p } = ue();
|
|
4195
|
+
return ma({ isSessionReady: g, sendTextMessage: h, messages: u }), Re({ isSessionReady: g, signalClientReady: E }), T && !a ? /* @__PURE__ */ n(la, { message: T, language: i, onClose: m }) : /* @__PURE__ */ n(ua, { agent: t, language: i, onClose: m });
|
|
4221
4196
|
}
|
|
4222
|
-
function
|
|
4223
|
-
const [
|
|
4224
|
-
return
|
|
4225
|
-
|
|
4226
|
-
}, [e.defaultLanguage]), /* @__PURE__ */ f("div", { className:
|
|
4227
|
-
!
|
|
4228
|
-
|
|
4197
|
+
function Jn({ agent: e, defaultOpen: a = !1, className: t = "", preview: i = !1, ChatBoxComponent: r }) {
|
|
4198
|
+
const [o, s] = I.useState(a), [c, d] = I.useState(e.defaultLanguage), l = ee(() => be(e.languages, e.defaultLanguage), [e.defaultLanguage, e.languages]);
|
|
4199
|
+
return I.useEffect(() => {
|
|
4200
|
+
d(e.defaultLanguage);
|
|
4201
|
+
}, [e.defaultLanguage]), /* @__PURE__ */ f("div", { className: V("rqmii-chat-surface", i && "is-preview", t), children: [
|
|
4202
|
+
!o && /* @__PURE__ */ n(sa, { agent: e, onClick: () => s(!0), position: i ? "static" : "fixed" }),
|
|
4203
|
+
o && /* @__PURE__ */ n(r, { agent: e, language: c, languages: l, onLanguageChange: d, onClose: () => s(!1), isPreview: i })
|
|
4229
4204
|
] });
|
|
4230
4205
|
}
|
|
4231
|
-
function
|
|
4232
|
-
const [s,
|
|
4233
|
-
return
|
|
4234
|
-
t && (
|
|
4235
|
-
}, [t]),
|
|
4206
|
+
function On({ restUrl: e, identifier: a, fallbackAgent: t, withCredentials: i = !1, children: r, onError: o }) {
|
|
4207
|
+
const [s, c] = v(() => t ? pe(t) : null), [d, l] = v(null);
|
|
4208
|
+
return j(() => {
|
|
4209
|
+
t && (c(pe(t)), l(null));
|
|
4210
|
+
}, [t]), j(() => {
|
|
4236
4211
|
if (!a || t) return;
|
|
4237
4212
|
const m = new AbortController();
|
|
4238
|
-
return l(null),
|
|
4239
|
-
m.signal.aborted || (l(u),
|
|
4213
|
+
return l(null), xt({ restUrl: e, identifier: a, withCredentials: i, signal: m.signal }).then(c).catch((u) => {
|
|
4214
|
+
m.signal.aborted || (l(u), o?.(u));
|
|
4240
4215
|
}), () => m.abort();
|
|
4241
|
-
}, [t, a,
|
|
4216
|
+
}, [t, a, o, e, i]), d ? /* @__PURE__ */ n("div", { className: "rqmii-chat-panel rqmii-chat-panel--error", children: d.message || "Could not load agent" }) : s ? /* @__PURE__ */ n(Ae, { children: r(s) }) : /* @__PURE__ */ n("div", { className: "rqmii-chat-panel rqmii-chat-panel--error", children: "Loading" });
|
|
4242
4217
|
}
|
|
4243
|
-
function
|
|
4244
|
-
const
|
|
4245
|
-
switch (
|
|
4218
|
+
function we({ agent: e, language: a, languages: t, onLanguageChange: i, onEndSession: r, onMinimize: o, onStartText: s, onStartVoice: c, textOnly: d, messages: l, onSendMessage: m, isPreview: u, onSessionStart: h, initialText: z, autoStartVoice: k }) {
|
|
4219
|
+
const y = ve(e), E = { agent: e, language: a, languages: t, onLanguageChange: i, onEndSession: r, onMinimize: o, messages: l, onSendMessage: m, isPreview: u, onSessionStart: h, initialText: z, autoStartVoice: k };
|
|
4220
|
+
switch (y) {
|
|
4246
4221
|
case "avatar":
|
|
4247
|
-
return /* @__PURE__ */ n(
|
|
4222
|
+
return /* @__PURE__ */ n(Kn, { ...E });
|
|
4248
4223
|
case "voice":
|
|
4249
|
-
return /* @__PURE__ */ n(
|
|
4224
|
+
return /* @__PURE__ */ n(Bn, { ...E });
|
|
4250
4225
|
case "text_and_voice":
|
|
4251
|
-
return /* @__PURE__ */ n(
|
|
4226
|
+
return /* @__PURE__ */ n(Un, { ...E, onStartText: s, onStartVoice: c, textOnly: d });
|
|
4252
4227
|
case "text":
|
|
4253
4228
|
default:
|
|
4254
|
-
return /* @__PURE__ */ n(
|
|
4229
|
+
return /* @__PURE__ */ n(Rn, { ...E });
|
|
4255
4230
|
}
|
|
4256
4231
|
}
|
|
4257
|
-
function
|
|
4232
|
+
function Yn({
|
|
4258
4233
|
agent: e,
|
|
4259
4234
|
language: a,
|
|
4260
4235
|
languages: t,
|
|
4261
|
-
startMode:
|
|
4236
|
+
startMode: i,
|
|
4262
4237
|
directive: r,
|
|
4263
|
-
open:
|
|
4238
|
+
open: o,
|
|
4264
4239
|
onOpen: s,
|
|
4265
|
-
onLanguageChange:
|
|
4266
|
-
onMinimize:
|
|
4240
|
+
onLanguageChange: c,
|
|
4241
|
+
onMinimize: d,
|
|
4267
4242
|
onStartNewSession: l,
|
|
4268
4243
|
onSessionStart: m,
|
|
4269
4244
|
onStartText: u,
|
|
4270
4245
|
onStartVoice: h
|
|
4271
4246
|
}) {
|
|
4272
|
-
const { connectionState:
|
|
4273
|
-
|
|
4274
|
-
k && (
|
|
4275
|
-
}, [k]),
|
|
4276
|
-
if (
|
|
4247
|
+
const { connectionState: z, isConnected: k, isSessionTerminated: y, creditExhausted: E, session: T, endSession: g, submitFeedback: b, interrupt: p } = ue(), { messages: S } = de(), x = _(!1), P = _(null), [C, A] = v(null), [w, M] = v(0), [D, G] = v(!1), [Z, q] = v(!1), [B, N] = v(!1);
|
|
4248
|
+
j(() => {
|
|
4249
|
+
k && (x.current = !0);
|
|
4250
|
+
}, [k]), j(() => {
|
|
4251
|
+
if (C) return;
|
|
4277
4252
|
let R = null;
|
|
4278
|
-
|
|
4279
|
-
sessionId:
|
|
4280
|
-
endedBy:
|
|
4253
|
+
y || z === "ended" ? R = P.current === "user" ? "user_ended" : "terminated" : z === "failed" ? E ? R = "credits_exhausted" : x.current ? R = "connection_lost" : R = "failed" : E && (R = "credits_exhausted"), R && A({
|
|
4254
|
+
sessionId: T.sessionId,
|
|
4255
|
+
endedBy: P.current ?? "agent",
|
|
4281
4256
|
reason: R
|
|
4282
4257
|
});
|
|
4283
|
-
}, [
|
|
4258
|
+
}, [y, z, E, T.sessionId, C]);
|
|
4284
4259
|
const U = () => {
|
|
4285
|
-
|
|
4286
|
-
},
|
|
4287
|
-
|
|
4260
|
+
P.current = "user", p(), g();
|
|
4261
|
+
}, K = C?.sessionId ?? null, $ = (R) => {
|
|
4262
|
+
D || (M(R), K && b({ sessionId: K, rating: R, endedBy: C?.endedBy }).catch(() => {
|
|
4288
4263
|
}), B || (N(!0), q(!0)));
|
|
4289
|
-
},
|
|
4290
|
-
if (
|
|
4264
|
+
}, ae = async (R) => {
|
|
4265
|
+
if (K)
|
|
4291
4266
|
try {
|
|
4292
|
-
await b({ sessionId:
|
|
4267
|
+
await b({ sessionId: K, feedback: R, endedBy: C?.endedBy });
|
|
4293
4268
|
} catch {
|
|
4294
4269
|
}
|
|
4295
4270
|
G(!0), q(!1);
|
|
4296
4271
|
};
|
|
4297
|
-
if (!
|
|
4298
|
-
return /* @__PURE__ */ n(sa, { agent: e, onClick: s, active:
|
|
4299
|
-
const
|
|
4300
|
-
return
|
|
4301
|
-
|
|
4272
|
+
if (!o)
|
|
4273
|
+
return /* @__PURE__ */ n(sa, { agent: e, onClick: s, active: z === "connected" });
|
|
4274
|
+
const te = ve(e), Q = e.agentType === "cloud_avatar" || e.agentType === "desktop_avatar", ie = i === "text";
|
|
4275
|
+
return Q ? /* @__PURE__ */ n(
|
|
4276
|
+
we,
|
|
4302
4277
|
{
|
|
4303
4278
|
agent: e,
|
|
4304
4279
|
language: a,
|
|
4305
4280
|
languages: t,
|
|
4306
|
-
onLanguageChange:
|
|
4281
|
+
onLanguageChange: c,
|
|
4307
4282
|
onEndSession: U,
|
|
4308
|
-
onMinimize:
|
|
4283
|
+
onMinimize: d,
|
|
4309
4284
|
onSessionStart: m,
|
|
4310
4285
|
onStartText: u,
|
|
4311
4286
|
onStartVoice: h,
|
|
4312
|
-
textOnly:
|
|
4287
|
+
textOnly: ie
|
|
4313
4288
|
}
|
|
4314
|
-
) :
|
|
4315
|
-
|
|
4289
|
+
) : C ? Z && K ? /* @__PURE__ */ n(
|
|
4290
|
+
xn,
|
|
4316
4291
|
{
|
|
4317
4292
|
agent: e,
|
|
4318
4293
|
language: a,
|
|
4319
|
-
rating:
|
|
4294
|
+
rating: w,
|
|
4320
4295
|
onBack: () => q(!1),
|
|
4321
|
-
onMinimize:
|
|
4322
|
-
onSubmit:
|
|
4296
|
+
onMinimize: d,
|
|
4297
|
+
onSubmit: ae
|
|
4323
4298
|
}
|
|
4324
4299
|
) : /* @__PURE__ */ n(
|
|
4325
4300
|
Vn,
|
|
@@ -4327,156 +4302,154 @@ function Qn({
|
|
|
4327
4302
|
agent: e,
|
|
4328
4303
|
language: a,
|
|
4329
4304
|
languages: t,
|
|
4330
|
-
chatKind:
|
|
4331
|
-
messages:
|
|
4332
|
-
onLanguageChange:
|
|
4333
|
-
onMinimize:
|
|
4305
|
+
chatKind: te === "avatar" ? "text" : te,
|
|
4306
|
+
messages: S,
|
|
4307
|
+
onLanguageChange: c,
|
|
4308
|
+
onMinimize: d,
|
|
4334
4309
|
onStartNewVoice: () => l("voice"),
|
|
4335
4310
|
onStartNewText: (R) => l("text", R),
|
|
4336
|
-
rating:
|
|
4337
|
-
endedBy:
|
|
4338
|
-
sessionId:
|
|
4339
|
-
ratingInteractive: !
|
|
4340
|
-
showTellUsMore: B && !
|
|
4341
|
-
onRate:
|
|
4311
|
+
rating: w,
|
|
4312
|
+
endedBy: C.endedBy,
|
|
4313
|
+
sessionId: K,
|
|
4314
|
+
ratingInteractive: !D,
|
|
4315
|
+
showTellUsMore: B && !D,
|
|
4316
|
+
onRate: $,
|
|
4342
4317
|
onTellUsMore: () => q(!0)
|
|
4343
4318
|
}
|
|
4344
4319
|
) : /* @__PURE__ */ n(
|
|
4345
|
-
|
|
4320
|
+
we,
|
|
4346
4321
|
{
|
|
4347
4322
|
agent: e,
|
|
4348
4323
|
language: a,
|
|
4349
4324
|
languages: t,
|
|
4350
|
-
onLanguageChange:
|
|
4325
|
+
onLanguageChange: c,
|
|
4351
4326
|
onEndSession: U,
|
|
4352
|
-
onMinimize:
|
|
4327
|
+
onMinimize: d,
|
|
4353
4328
|
onSessionStart: m,
|
|
4354
4329
|
onStartText: u,
|
|
4355
4330
|
onStartVoice: h,
|
|
4356
|
-
textOnly:
|
|
4331
|
+
textOnly: ie,
|
|
4357
4332
|
initialText: r?.mode === "text" ? r.text : void 0,
|
|
4358
4333
|
autoStartVoice: r?.mode === "voice"
|
|
4359
4334
|
}
|
|
4360
4335
|
);
|
|
4361
4336
|
}
|
|
4362
|
-
function
|
|
4363
|
-
if ([!!t, !!
|
|
4364
|
-
throw new Error("RqmiiAgentChat: only one of
|
|
4365
|
-
return /* @__PURE__ */ n(
|
|
4366
|
-
|
|
4337
|
+
function Xn({ wsUrl: e, restUrl: a, apiKey: t, agentId: i, agent: r, language: o, defaultOpen: s = !1, open: c, className: d = "", pcmOptions: l, debug: m = !1, withCredentials: u = !1, onError: h, onInitialized: z, config: k, clientTools: y, onMinimize: E, onOpen: T }) {
|
|
4338
|
+
if ([!!t, !!i].filter(Boolean).length > 1)
|
|
4339
|
+
throw new Error("RqmiiAgentChat: only one of apiKey, or agentId may be provided");
|
|
4340
|
+
return /* @__PURE__ */ n(On, { restUrl: a, identifier: t || i, fallbackAgent: r, withCredentials: u, onError: h, children: (p) => /* @__PURE__ */ n(
|
|
4341
|
+
Qn,
|
|
4367
4342
|
{
|
|
4368
4343
|
wsUrl: e,
|
|
4369
4344
|
restUrl: a,
|
|
4370
|
-
|
|
4371
|
-
|
|
4372
|
-
|
|
4373
|
-
|
|
4374
|
-
|
|
4375
|
-
defaultOpen: d,
|
|
4345
|
+
apiKey: t,
|
|
4346
|
+
agentId: i,
|
|
4347
|
+
agent: p,
|
|
4348
|
+
language: o,
|
|
4349
|
+
defaultOpen: s,
|
|
4376
4350
|
open: c,
|
|
4377
|
-
className:
|
|
4378
|
-
pcmOptions:
|
|
4379
|
-
debug:
|
|
4380
|
-
withCredentials:
|
|
4381
|
-
onError:
|
|
4382
|
-
onInitialized:
|
|
4383
|
-
config:
|
|
4384
|
-
clientTools:
|
|
4351
|
+
className: d,
|
|
4352
|
+
pcmOptions: l,
|
|
4353
|
+
debug: m,
|
|
4354
|
+
withCredentials: u,
|
|
4355
|
+
onError: h,
|
|
4356
|
+
onInitialized: z,
|
|
4357
|
+
config: k,
|
|
4358
|
+
clientTools: y,
|
|
4385
4359
|
onMinimize: E,
|
|
4386
|
-
onOpen:
|
|
4360
|
+
onOpen: T
|
|
4387
4361
|
}
|
|
4388
4362
|
) });
|
|
4389
4363
|
}
|
|
4390
|
-
function
|
|
4391
|
-
const [
|
|
4392
|
-
() =>
|
|
4393
|
-
[
|
|
4394
|
-
),
|
|
4395
|
-
...t ? {
|
|
4396
|
-
...
|
|
4397
|
-
...r ? { agentId: r } : {},
|
|
4364
|
+
function Qn({ wsUrl: e, restUrl: a, apiKey: t, agentId: i, agent: r, language: o, defaultOpen: s, open: c, className: d, pcmOptions: l, debug: m, withCredentials: u, onError: h, onInitialized: z, config: k, clientTools: y, onMinimize: E, onOpen: T }) {
|
|
4365
|
+
const [g, b] = v(s), p = c !== void 0 ? c : g, [S, x] = v(!1), [P, C] = v(o || r.defaultLanguage), [A, w] = v("idle"), [M, D] = v(0), [G, Z] = v(null), [q, B] = v(!1), N = r.agentType === "cloud_avatar" || r.agentType === "desktop_avatar", U = N, K = r.widget?.behavior, $ = r.welcomeMessages?.[P] || "", ae = !p && !q && !U && !!K?.welcome_bubble_enabled && !!$.trim(), te = ee(() => be(r.languages, r.defaultLanguage), [r.defaultLanguage, r.languages]), Q = ee(() => A === "text" ? { ...k ?? {}, use_voice: !1, use_text: !0 } : k, [k, A]), ie = ee(
|
|
4366
|
+
() => Pt(r, Q),
|
|
4367
|
+
[r, Q]
|
|
4368
|
+
), R = !U && ie.useVoice, O = N ? p : S, H = ee(() => ({
|
|
4369
|
+
...t ? { apiKey: t } : {},
|
|
4370
|
+
...i ? { agentId: i } : {},
|
|
4398
4371
|
language: P,
|
|
4399
|
-
config:
|
|
4400
|
-
}), [
|
|
4401
|
-
|
|
4402
|
-
const
|
|
4403
|
-
|
|
4404
|
-
|
|
4405
|
-
}, [
|
|
4406
|
-
const
|
|
4407
|
-
|
|
4408
|
-
} : (
|
|
4409
|
-
|
|
4410
|
-
}, [
|
|
4411
|
-
|
|
4412
|
-
},
|
|
4413
|
-
|
|
4414
|
-
},
|
|
4415
|
-
c === void 0 &&
|
|
4416
|
-
},
|
|
4417
|
-
c === void 0 &&
|
|
4418
|
-
},
|
|
4419
|
-
|
|
4372
|
+
config: Q
|
|
4373
|
+
}), [i, t, P, Q]), ce = _(null), ke = _(!1), fe = _(M), Be = fe.current !== M;
|
|
4374
|
+
fe.current = M, S && (!ke.current || Be) && (ce.current = H), ke.current = S, S || (ce.current = null);
|
|
4375
|
+
const Ge = S && ce.current ? ce.current : H;
|
|
4376
|
+
j(() => {
|
|
4377
|
+
C(o || r.defaultLanguage);
|
|
4378
|
+
}, [r.defaultLanguage, o]);
|
|
4379
|
+
const Ue = ee(() => h ? (he) => {
|
|
4380
|
+
w("idle"), h(he);
|
|
4381
|
+
} : (he) => {
|
|
4382
|
+
w("idle");
|
|
4383
|
+
}, [h]), Ee = () => {
|
|
4384
|
+
w("text"), x(!0);
|
|
4385
|
+
}, L = () => {
|
|
4386
|
+
w("voice"), x(!0);
|
|
4387
|
+
}, X = () => {
|
|
4388
|
+
c === void 0 && b(!1), E?.();
|
|
4389
|
+
}, Se = () => {
|
|
4390
|
+
c === void 0 && b(!0), B(!0), T?.();
|
|
4391
|
+
}, ha = (he, ga) => {
|
|
4392
|
+
Z(he === "text" ? { mode: "text", text: ga ?? "" } : { mode: "voice" }), w(he), x(!0), D((pa) => pa + 1);
|
|
4420
4393
|
};
|
|
4421
4394
|
return /* @__PURE__ */ n(
|
|
4422
|
-
|
|
4395
|
+
fa,
|
|
4423
4396
|
{
|
|
4424
4397
|
wsUrl: e,
|
|
4425
4398
|
restUrl: a,
|
|
4426
|
-
session:
|
|
4427
|
-
connect:
|
|
4428
|
-
enableAudio:
|
|
4429
|
-
pcmOptions:
|
|
4430
|
-
debug:
|
|
4431
|
-
withCredentials:
|
|
4432
|
-
onError:
|
|
4433
|
-
onInitialized:
|
|
4434
|
-
clientTools:
|
|
4435
|
-
children: /* @__PURE__ */ f("div", { className:
|
|
4436
|
-
|
|
4437
|
-
|
|
4399
|
+
session: Ge,
|
|
4400
|
+
connect: O,
|
|
4401
|
+
enableAudio: R,
|
|
4402
|
+
pcmOptions: l,
|
|
4403
|
+
debug: m,
|
|
4404
|
+
withCredentials: u,
|
|
4405
|
+
onError: Ue,
|
|
4406
|
+
onInitialized: z,
|
|
4407
|
+
clientTools: y,
|
|
4408
|
+
children: /* @__PURE__ */ f("div", { className: V("rqmii-chat-surface", r.widget?.appearance?.position === "left" && "rqmii-position-left", d), dir: "ltr", children: [
|
|
4409
|
+
ae && /* @__PURE__ */ n(
|
|
4410
|
+
dn,
|
|
4438
4411
|
{
|
|
4439
|
-
message:
|
|
4440
|
-
delaySeconds:
|
|
4441
|
-
soundEnabled: !!
|
|
4412
|
+
message: $,
|
|
4413
|
+
delaySeconds: K?.welcome_bubble_delay_seconds ?? 3,
|
|
4414
|
+
soundEnabled: !!K?.welcome_bubble_sound_enabled,
|
|
4442
4415
|
language: P,
|
|
4443
|
-
buttonPosition:
|
|
4444
|
-
onClick: () =>
|
|
4416
|
+
buttonPosition: r.widget?.appearance?.position === "left" ? "left" : "right",
|
|
4417
|
+
onClick: () => B(!0)
|
|
4445
4418
|
}
|
|
4446
4419
|
),
|
|
4447
4420
|
/* @__PURE__ */ n(
|
|
4448
|
-
|
|
4421
|
+
Yn,
|
|
4449
4422
|
{
|
|
4450
|
-
agent:
|
|
4423
|
+
agent: r,
|
|
4451
4424
|
language: P,
|
|
4452
|
-
languages:
|
|
4453
|
-
startMode:
|
|
4454
|
-
directive:
|
|
4455
|
-
open:
|
|
4456
|
-
onOpen:
|
|
4457
|
-
onLanguageChange:
|
|
4458
|
-
onMinimize:
|
|
4459
|
-
onStartNewSession:
|
|
4460
|
-
onSessionStart: () =>
|
|
4461
|
-
onStartText:
|
|
4462
|
-
onStartVoice:
|
|
4425
|
+
languages: te,
|
|
4426
|
+
startMode: A,
|
|
4427
|
+
directive: G,
|
|
4428
|
+
open: p,
|
|
4429
|
+
onOpen: Se,
|
|
4430
|
+
onLanguageChange: C,
|
|
4431
|
+
onMinimize: X,
|
|
4432
|
+
onStartNewSession: ha,
|
|
4433
|
+
onSessionStart: () => x(!0),
|
|
4434
|
+
onStartText: Ee,
|
|
4435
|
+
onStartVoice: L
|
|
4463
4436
|
}
|
|
4464
4437
|
)
|
|
4465
4438
|
] })
|
|
4466
4439
|
},
|
|
4467
|
-
|
|
4440
|
+
M
|
|
4468
4441
|
);
|
|
4469
4442
|
}
|
|
4470
|
-
function
|
|
4471
|
-
const
|
|
4472
|
-
return
|
|
4443
|
+
function ei({ agent: e, language: a, open: t = !0, className: i = "", messages: r, onSendMessage: o, onClose: s }) {
|
|
4444
|
+
const c = ee(() => pe(e), [e]), [d, l] = v(t), [m, u] = v(a || c.defaultLanguage), h = ee(() => be(c.languages, c.defaultLanguage), [c.defaultLanguage, c.languages]);
|
|
4445
|
+
return j(() => {
|
|
4473
4446
|
a && u(a);
|
|
4474
|
-
}, [a]),
|
|
4447
|
+
}, [a]), j(() => {
|
|
4475
4448
|
l(t);
|
|
4476
|
-
}, [t]), /* @__PURE__ */ n(
|
|
4477
|
-
|
|
4449
|
+
}, [t]), /* @__PURE__ */ n(ka, { wsUrl: "", restUrl: "", enableAudio: !1, children: /* @__PURE__ */ n("div", { className: V("rqmii-chat-surface is-preview", i), dir: "ltr", children: d ? /* @__PURE__ */ n(
|
|
4450
|
+
we,
|
|
4478
4451
|
{
|
|
4479
|
-
agent:
|
|
4452
|
+
agent: c,
|
|
4480
4453
|
language: m,
|
|
4481
4454
|
languages: h,
|
|
4482
4455
|
onLanguageChange: u,
|
|
@@ -4487,40 +4460,39 @@ function ti({ agent: e, language: a, open: t = !0, className: o = "", messages:
|
|
|
4487
4460
|
l(!1), s?.();
|
|
4488
4461
|
},
|
|
4489
4462
|
messages: r,
|
|
4490
|
-
onSendMessage:
|
|
4463
|
+
onSendMessage: o,
|
|
4491
4464
|
isPreview: !0
|
|
4492
4465
|
}
|
|
4493
4466
|
) : null }) });
|
|
4494
4467
|
}
|
|
4495
4468
|
export {
|
|
4496
|
-
|
|
4469
|
+
jn as ConsentDialog,
|
|
4497
4470
|
Vn as EndedChatPanel,
|
|
4498
|
-
|
|
4499
|
-
|
|
4500
|
-
|
|
4501
|
-
|
|
4471
|
+
ni as EpicPixelStreamingPlayer,
|
|
4472
|
+
xn as FeedbackPanel,
|
|
4473
|
+
$e as RQMII_BUILTIN_FACES,
|
|
4474
|
+
Me as RQMII_CHAT_LANGUAGES,
|
|
4502
4475
|
Qe as RQMII_CHAT_LANGUAGE_VALUES,
|
|
4503
|
-
|
|
4476
|
+
Sn as RatingBar,
|
|
4504
4477
|
J as RqmiiAgentAvatar,
|
|
4505
|
-
|
|
4506
|
-
|
|
4507
|
-
|
|
4508
|
-
|
|
4478
|
+
Xn as RqmiiAgentChat,
|
|
4479
|
+
ei as RqmiiAgentChatPreview,
|
|
4480
|
+
fa as RqmiiAgentRoom,
|
|
4481
|
+
Kn as RqmiiAvatarChatBox,
|
|
4509
4482
|
le as RqmiiChatFooter,
|
|
4510
4483
|
sa as RqmiiChatOpenButton,
|
|
4511
|
-
|
|
4512
|
-
|
|
4513
|
-
|
|
4514
|
-
|
|
4515
|
-
|
|
4516
|
-
|
|
4517
|
-
|
|
4518
|
-
|
|
4519
|
-
an as getBuiltinFace,
|
|
4484
|
+
Jn as RqmiiChatSurface,
|
|
4485
|
+
ii as RqmiiCloudAvatarPlayer,
|
|
4486
|
+
Un as RqmiiTextAndVoiceChatBox,
|
|
4487
|
+
Rn as RqmiiTextChatBox,
|
|
4488
|
+
Bn as RqmiiVoiceChatBox,
|
|
4489
|
+
$n as fetchAgentConfig,
|
|
4490
|
+
xt as fetchAgentCustomization,
|
|
4491
|
+
en as getBuiltinFace,
|
|
4520
4492
|
He as getChatLanguage,
|
|
4521
|
-
|
|
4493
|
+
F as getChatText,
|
|
4522
4494
|
be as normalizeChatLanguages,
|
|
4523
|
-
|
|
4495
|
+
pe as normalizePublicAgent,
|
|
4524
4496
|
ve as resolveChatKind
|
|
4525
4497
|
};
|
|
4526
4498
|
//# sourceMappingURL=ui.js.map
|