@rqmii_immersive/agent-react-sdk 5.3.2 → 5.3.4

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