@rqmii_immersive/agent-react-sdk 5.1.2 → 5.2.0

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