@cuekit-ai/react 1.6.6 → 1.6.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-JVYSFKMO.mjs → chunk-ZP7AXODE.mjs} +673 -993
- package/dist/index.d.mts +32 -10
- package/dist/index.d.ts +32 -10
- package/dist/index.js +810 -951
- package/dist/index.mjs +260 -82
- package/dist/{webrtc-service-KN5SEJKS.mjs → webrtc-service-IMARTHNM.mjs} +1 -1
- package/package.json +6 -4
package/dist/index.mjs
CHANGED
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
setWebRTCCallbacks,
|
|
38
38
|
setWebRTCConfig,
|
|
39
39
|
validateDynamicElements
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-ZP7AXODE.mjs";
|
|
41
41
|
|
|
42
42
|
// node_modules/inline-style-parser/index.js
|
|
43
43
|
var require_inline_style_parser = __commonJS({
|
|
@@ -389,7 +389,7 @@ var require_core = __commonJS({
|
|
|
389
389
|
root4.CryptoJS = factory();
|
|
390
390
|
}
|
|
391
391
|
})(exports, function() {
|
|
392
|
-
var CryptoJS = CryptoJS ||
|
|
392
|
+
var CryptoJS = CryptoJS || function(Math2, undefined2) {
|
|
393
393
|
var crypto;
|
|
394
394
|
if (typeof window !== "undefined" && window.crypto) {
|
|
395
395
|
crypto = window.crypto;
|
|
@@ -429,7 +429,7 @@ var require_core = __commonJS({
|
|
|
429
429
|
}
|
|
430
430
|
throw new Error("Native crypto module could not be used to get secure random number.");
|
|
431
431
|
};
|
|
432
|
-
var create2 = Object.create || /* @__PURE__ */
|
|
432
|
+
var create2 = Object.create || /* @__PURE__ */ function() {
|
|
433
433
|
function F2() {
|
|
434
434
|
}
|
|
435
435
|
return function(obj) {
|
|
@@ -439,10 +439,10 @@ var require_core = __commonJS({
|
|
|
439
439
|
F2.prototype = null;
|
|
440
440
|
return subtype;
|
|
441
441
|
};
|
|
442
|
-
}
|
|
442
|
+
}();
|
|
443
443
|
var C = {};
|
|
444
444
|
var C_lib = C.lib = {};
|
|
445
|
-
var Base = C_lib.Base = /* @__PURE__ */
|
|
445
|
+
var Base = C_lib.Base = /* @__PURE__ */ function() {
|
|
446
446
|
return {
|
|
447
447
|
/**
|
|
448
448
|
* Creates a new object that inherits from this object.
|
|
@@ -541,7 +541,7 @@ var require_core = __commonJS({
|
|
|
541
541
|
return this.init.prototype.extend(this);
|
|
542
542
|
}
|
|
543
543
|
};
|
|
544
|
-
}
|
|
544
|
+
}();
|
|
545
545
|
var WordArray = C_lib.WordArray = Base.extend({
|
|
546
546
|
/**
|
|
547
547
|
* Initializes a newly created word array.
|
|
@@ -979,7 +979,7 @@ var require_core = __commonJS({
|
|
|
979
979
|
});
|
|
980
980
|
var C_algo = C.algo = {};
|
|
981
981
|
return C;
|
|
982
|
-
}
|
|
982
|
+
}(Math);
|
|
983
983
|
return CryptoJS;
|
|
984
984
|
});
|
|
985
985
|
}
|
|
@@ -1222,6 +1222,45 @@ var initWebRTC = (apiKey) => {
|
|
|
1222
1222
|
return initWebRTCWithDeployedBackend(apiKey);
|
|
1223
1223
|
};
|
|
1224
1224
|
|
|
1225
|
+
// src/utils/colors.ts
|
|
1226
|
+
function hexToHSL(hex) {
|
|
1227
|
+
hex = hex.replace(/^#/, "");
|
|
1228
|
+
if (hex.length === 3) {
|
|
1229
|
+
hex = hex.split("").map((char) => char + char).join("");
|
|
1230
|
+
}
|
|
1231
|
+
if (hex.length !== 6) return null;
|
|
1232
|
+
const r2 = parseInt(hex.substring(0, 2), 16) / 255;
|
|
1233
|
+
const g = parseInt(hex.substring(2, 4), 16) / 255;
|
|
1234
|
+
const b2 = parseInt(hex.substring(4, 6), 16) / 255;
|
|
1235
|
+
const max = Math.max(r2, g, b2), min = Math.min(r2, g, b2);
|
|
1236
|
+
let h = 0, s = 0, l = (max + min) / 2;
|
|
1237
|
+
if (max !== min) {
|
|
1238
|
+
const d = max - min;
|
|
1239
|
+
s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
|
|
1240
|
+
switch (max) {
|
|
1241
|
+
case r2:
|
|
1242
|
+
h = (g - b2) / d + (g < b2 ? 6 : 0);
|
|
1243
|
+
break;
|
|
1244
|
+
case g:
|
|
1245
|
+
h = (b2 - r2) / d + 2;
|
|
1246
|
+
break;
|
|
1247
|
+
case b2:
|
|
1248
|
+
h = (r2 - g) / d + 4;
|
|
1249
|
+
break;
|
|
1250
|
+
}
|
|
1251
|
+
h /= 6;
|
|
1252
|
+
}
|
|
1253
|
+
const res = {
|
|
1254
|
+
h: Math.round(h * 360),
|
|
1255
|
+
s: Math.round(s * 100),
|
|
1256
|
+
l: Math.round(l * 100)
|
|
1257
|
+
};
|
|
1258
|
+
return {
|
|
1259
|
+
...res,
|
|
1260
|
+
toString: () => `${res.h} ${res.s}% ${res.l}%`
|
|
1261
|
+
};
|
|
1262
|
+
}
|
|
1263
|
+
|
|
1225
1264
|
// src/providers/ansyr-provider.tsx
|
|
1226
1265
|
if (typeof window !== "undefined" && !globalThis.AnsyrStore) {
|
|
1227
1266
|
globalThis.AnsyrStore = {
|
|
@@ -1271,9 +1310,52 @@ var AnsyrProvider = ({
|
|
|
1271
1310
|
title = "ansyr.ai",
|
|
1272
1311
|
showLogo = true,
|
|
1273
1312
|
showAIIcon = true,
|
|
1274
|
-
showUserIcon = true
|
|
1313
|
+
showUserIcon = true,
|
|
1314
|
+
theme,
|
|
1315
|
+
emptyStateMessage
|
|
1275
1316
|
}) => {
|
|
1276
1317
|
const [internalDeviceId, setInternalDeviceId] = useState(deviceId);
|
|
1318
|
+
const generateThemeStyles2 = (theme2) => {
|
|
1319
|
+
if (!theme2) return {};
|
|
1320
|
+
const mapColorsToVars = (colors) => {
|
|
1321
|
+
const mapping = {
|
|
1322
|
+
primary: "--voice-accent",
|
|
1323
|
+
background: "--voice-bg",
|
|
1324
|
+
surface: "--voice-surface",
|
|
1325
|
+
border: "--voice-border",
|
|
1326
|
+
text: "--voice-text",
|
|
1327
|
+
textMuted: "--voice-text-muted",
|
|
1328
|
+
userBubble: "--voice-user-bubble",
|
|
1329
|
+
userText: "--voice-user-text",
|
|
1330
|
+
aiBubble: "--voice-ai-bubble",
|
|
1331
|
+
aiText: "--voice-ai-text"
|
|
1332
|
+
};
|
|
1333
|
+
const styles2 = {};
|
|
1334
|
+
Object.entries(colors).forEach(([key, value]) => {
|
|
1335
|
+
const varName = mapping[key];
|
|
1336
|
+
if (varName && value) {
|
|
1337
|
+
const hsl = hexToHSL(value);
|
|
1338
|
+
if (hsl) {
|
|
1339
|
+
styles2[varName] = hsl.toString();
|
|
1340
|
+
if (key === "primary") {
|
|
1341
|
+
styles2["--indicator-bg"] = hsl.toString();
|
|
1342
|
+
styles2["--voice-accent-light"] = `${hsl.h} ${hsl.s}% 96%`;
|
|
1343
|
+
}
|
|
1344
|
+
}
|
|
1345
|
+
}
|
|
1346
|
+
});
|
|
1347
|
+
return styles2;
|
|
1348
|
+
};
|
|
1349
|
+
const styles = {};
|
|
1350
|
+
if (theme2.light) {
|
|
1351
|
+
const lightStyles = mapColorsToVars(theme2.light);
|
|
1352
|
+
Object.entries(lightStyles).forEach(([key, value]) => {
|
|
1353
|
+
styles[key] = value;
|
|
1354
|
+
});
|
|
1355
|
+
}
|
|
1356
|
+
return styles;
|
|
1357
|
+
};
|
|
1358
|
+
const themeStyles = generateThemeStyles2(theme);
|
|
1277
1359
|
useEffect(() => {
|
|
1278
1360
|
InitCuekit({ apiKey, appId });
|
|
1279
1361
|
}, [apiKey, appId]);
|
|
@@ -1293,7 +1375,7 @@ var AnsyrProvider = ({
|
|
|
1293
1375
|
};
|
|
1294
1376
|
}, [navigationHandler]);
|
|
1295
1377
|
useEffect(() => {
|
|
1296
|
-
import("./webrtc-service-
|
|
1378
|
+
import("./webrtc-service-IMARTHNM.mjs").then(({ setWebRTCCallbacks: setWebRTCCallbacks2 }) => {
|
|
1297
1379
|
setWebRTCCallbacks2({
|
|
1298
1380
|
onNavigationCommand: (command) => {
|
|
1299
1381
|
const data = command.data ?? command;
|
|
@@ -1380,10 +1462,12 @@ var AnsyrProvider = ({
|
|
|
1380
1462
|
title,
|
|
1381
1463
|
showLogo,
|
|
1382
1464
|
showAIIcon,
|
|
1383
|
-
showUserIcon
|
|
1465
|
+
showUserIcon,
|
|
1466
|
+
theme,
|
|
1467
|
+
emptyStateMessage
|
|
1384
1468
|
}
|
|
1385
1469
|
},
|
|
1386
|
-
children
|
|
1470
|
+
/* @__PURE__ */ React.createElement("div", { style: themeStyles }, children)
|
|
1387
1471
|
);
|
|
1388
1472
|
};
|
|
1389
1473
|
|
|
@@ -9387,7 +9471,7 @@ var convert = (
|
|
|
9387
9471
|
* @param {Test} [test]
|
|
9388
9472
|
* @returns {Check}
|
|
9389
9473
|
*/
|
|
9390
|
-
|
|
9474
|
+
function(test) {
|
|
9391
9475
|
if (test === null || test === void 0) {
|
|
9392
9476
|
return ok2;
|
|
9393
9477
|
}
|
|
@@ -9401,7 +9485,7 @@ var convert = (
|
|
|
9401
9485
|
return typeFactory(test);
|
|
9402
9486
|
}
|
|
9403
9487
|
throw new Error("Expected function, string, or object as test");
|
|
9404
|
-
}
|
|
9488
|
+
}
|
|
9405
9489
|
);
|
|
9406
9490
|
function anyFactory(tests) {
|
|
9407
9491
|
const checks2 = [];
|
|
@@ -10581,7 +10665,7 @@ var CallableInstance = (
|
|
|
10581
10665
|
* @param {string | symbol} property
|
|
10582
10666
|
* @returns {(...parameters: Array<unknown>) => unknown}
|
|
10583
10667
|
*/
|
|
10584
|
-
|
|
10668
|
+
function(property) {
|
|
10585
10669
|
const self2 = this;
|
|
10586
10670
|
const constr = self2.constructor;
|
|
10587
10671
|
const proto = (
|
|
@@ -10596,7 +10680,7 @@ var CallableInstance = (
|
|
|
10596
10680
|
};
|
|
10597
10681
|
Object.setPrototypeOf(apply, proto);
|
|
10598
10682
|
return apply;
|
|
10599
|
-
}
|
|
10683
|
+
}
|
|
10600
10684
|
);
|
|
10601
10685
|
|
|
10602
10686
|
// node_modules/unified/lib/index.js
|
|
@@ -15188,6 +15272,38 @@ var useDraggableResizableContainer = (storageKey) => {
|
|
|
15188
15272
|
};
|
|
15189
15273
|
|
|
15190
15274
|
// src/components/chat-popup.tsx
|
|
15275
|
+
var generateThemeStyles = (theme, currentTheme = "dark") => {
|
|
15276
|
+
if (!theme) return {};
|
|
15277
|
+
const colors = currentTheme === "light" ? theme.light : theme.dark;
|
|
15278
|
+
if (!colors) return {};
|
|
15279
|
+
const mapping = {
|
|
15280
|
+
primary: "--voice-accent",
|
|
15281
|
+
background: "--voice-bg",
|
|
15282
|
+
surface: "--voice-surface",
|
|
15283
|
+
border: "--voice-border",
|
|
15284
|
+
text: "--voice-text",
|
|
15285
|
+
textMuted: "--voice-text-muted",
|
|
15286
|
+
userBubble: "--voice-user-bubble",
|
|
15287
|
+
userText: "--voice-user-text",
|
|
15288
|
+
aiBubble: "--voice-ai-bubble",
|
|
15289
|
+
aiText: "--voice-ai-text"
|
|
15290
|
+
};
|
|
15291
|
+
const styles = {};
|
|
15292
|
+
Object.entries(colors).forEach(([key, value]) => {
|
|
15293
|
+
const varName = mapping[key];
|
|
15294
|
+
if (varName && value) {
|
|
15295
|
+
const hsl = hexToHSL(value);
|
|
15296
|
+
if (hsl) {
|
|
15297
|
+
styles[varName] = hsl.toString();
|
|
15298
|
+
if (key === "primary") {
|
|
15299
|
+
styles["--indicator-bg"] = hsl.toString();
|
|
15300
|
+
styles["--voice-accent-light"] = currentTheme === "light" ? `${hsl.h} ${hsl.s}% 96%` : `${hsl.h} ${hsl.s}% 25%`;
|
|
15301
|
+
}
|
|
15302
|
+
}
|
|
15303
|
+
}
|
|
15304
|
+
});
|
|
15305
|
+
return styles;
|
|
15306
|
+
};
|
|
15191
15307
|
var ChatPopup = ({
|
|
15192
15308
|
isOpen,
|
|
15193
15309
|
isMinimized,
|
|
@@ -15215,9 +15331,20 @@ var ChatPopup = ({
|
|
|
15215
15331
|
onSizeChange,
|
|
15216
15332
|
persistPosition = true,
|
|
15217
15333
|
persistSize = true,
|
|
15218
|
-
storageKey = "chat-popup"
|
|
15334
|
+
storageKey = "chat-popup",
|
|
15335
|
+
theme: localTheme,
|
|
15336
|
+
emptyStateMessage: localEmptyStateMessage
|
|
15219
15337
|
}) => {
|
|
15220
|
-
const {
|
|
15338
|
+
const {
|
|
15339
|
+
title,
|
|
15340
|
+
showLogo,
|
|
15341
|
+
showAIIcon,
|
|
15342
|
+
showUserIcon,
|
|
15343
|
+
theme: contextTheme,
|
|
15344
|
+
emptyStateMessage: contextEmptyStateMessage
|
|
15345
|
+
} = useAnsyrContext();
|
|
15346
|
+
const theme = localTheme || contextTheme;
|
|
15347
|
+
const emptyStateMessage = localEmptyStateMessage || contextEmptyStateMessage;
|
|
15221
15348
|
const [inputText, setInputText] = useState6("");
|
|
15222
15349
|
const [isSending, setIsSending] = useState6(false);
|
|
15223
15350
|
const messagesEndRef = useRef5(null);
|
|
@@ -15312,7 +15439,8 @@ var ChatPopup = ({
|
|
|
15312
15439
|
animation: "scaleIn 0.3s ease-out",
|
|
15313
15440
|
flexDirection: "column",
|
|
15314
15441
|
fontFamily: "Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif",
|
|
15315
|
-
overflow: "hidden"
|
|
15442
|
+
overflow: "hidden",
|
|
15443
|
+
...generateThemeStyles(theme, currentTheme)
|
|
15316
15444
|
}
|
|
15317
15445
|
},
|
|
15318
15446
|
/* @__PURE__ */ React10.createElement(
|
|
@@ -15507,7 +15635,7 @@ var ChatPopup = ({
|
|
|
15507
15635
|
fontSize: "14px"
|
|
15508
15636
|
}
|
|
15509
15637
|
},
|
|
15510
|
-
"Start a conversation with CueKit AI"
|
|
15638
|
+
emptyStateMessage || "Start a conversation with CueKit AI"
|
|
15511
15639
|
) : messages.map((message, index2) => /* @__PURE__ */ React10.createElement(
|
|
15512
15640
|
"div",
|
|
15513
15641
|
{
|
|
@@ -15811,8 +15939,9 @@ var ChatPopup = ({
|
|
|
15811
15939
|
style: {
|
|
15812
15940
|
padding: "10px 12px",
|
|
15813
15941
|
borderRadius: 8,
|
|
15814
|
-
border:
|
|
15815
|
-
background: "
|
|
15942
|
+
border: `1px solid ${currentTheme === "dark" ? "#8177ed" : "#6257d9"}`,
|
|
15943
|
+
background: currentTheme === "dark" ? "#8177ed" : "#6257d9",
|
|
15944
|
+
color: "#fff",
|
|
15816
15945
|
fontSize: 12,
|
|
15817
15946
|
fontWeight: 700,
|
|
15818
15947
|
display: "flex",
|
|
@@ -15824,25 +15953,7 @@ var ChatPopup = ({
|
|
|
15824
15953
|
"aria-label": muteState.isMuted ? "Unmute microphone" : "Mute microphone",
|
|
15825
15954
|
title: muteState.isMuted ? "Unmute microphone" : "Mute microphone"
|
|
15826
15955
|
},
|
|
15827
|
-
muteState.isMuted ? /* @__PURE__ */ React10.createElement(
|
|
15828
|
-
mic_off_default,
|
|
15829
|
-
{
|
|
15830
|
-
style: {
|
|
15831
|
-
width: 16,
|
|
15832
|
-
height: 16,
|
|
15833
|
-
color: "hsl(var(--voice-user-text))"
|
|
15834
|
-
}
|
|
15835
|
-
}
|
|
15836
|
-
) : /* @__PURE__ */ React10.createElement(
|
|
15837
|
-
mic_default,
|
|
15838
|
-
{
|
|
15839
|
-
style: {
|
|
15840
|
-
width: 16,
|
|
15841
|
-
height: 16,
|
|
15842
|
-
color: "hsl(var(--voice-user-text))"
|
|
15843
|
-
}
|
|
15844
|
-
}
|
|
15845
|
-
)
|
|
15956
|
+
muteState.isMuted ? /* @__PURE__ */ React10.createElement(mic_off_default, { style: { width: 16, height: 16, color: "#fff" } }) : /* @__PURE__ */ React10.createElement(mic_default, { style: { width: 16, height: 16, color: "#fff" } })
|
|
15846
15957
|
),
|
|
15847
15958
|
isConnected && onEndCall && /* @__PURE__ */ React10.createElement(
|
|
15848
15959
|
"button",
|
|
@@ -15852,9 +15963,9 @@ var ChatPopup = ({
|
|
|
15852
15963
|
style: {
|
|
15853
15964
|
padding: "10px 12px",
|
|
15854
15965
|
borderRadius: 8,
|
|
15855
|
-
border:
|
|
15856
|
-
background: "
|
|
15857
|
-
color: "
|
|
15966
|
+
border: `1px solid ${currentTheme === "dark" ? "#8177ed" : "#6257d9"}`,
|
|
15967
|
+
background: currentTheme === "dark" ? "#8177ed" : "#6257d9",
|
|
15968
|
+
color: "#fff",
|
|
15858
15969
|
fontSize: 12,
|
|
15859
15970
|
fontWeight: 700,
|
|
15860
15971
|
display: "flex",
|
|
@@ -15863,7 +15974,7 @@ var ChatPopup = ({
|
|
|
15863
15974
|
cursor: "pointer"
|
|
15864
15975
|
}
|
|
15865
15976
|
},
|
|
15866
|
-
/* @__PURE__ */ React10.createElement(phone_off_default, { style: { width: 16, height: 16 } })
|
|
15977
|
+
/* @__PURE__ */ React10.createElement(phone_off_default, { style: { width: 16, height: 16, color: "#fff" } })
|
|
15867
15978
|
)
|
|
15868
15979
|
)
|
|
15869
15980
|
)
|
|
@@ -16027,7 +16138,7 @@ var Me = { exports: {} };
|
|
|
16027
16138
|
var Or = Me.exports;
|
|
16028
16139
|
var kt;
|
|
16029
16140
|
function kr() {
|
|
16030
|
-
return kt || (kt = 1,
|
|
16141
|
+
return kt || (kt = 1, function(e2) {
|
|
16031
16142
|
(function(t, n) {
|
|
16032
16143
|
e2.exports ? e2.exports = n() : t.log = n();
|
|
16033
16144
|
})(Or, function() {
|
|
@@ -16171,7 +16282,7 @@ function kr() {
|
|
|
16171
16282
|
return o;
|
|
16172
16283
|
}, s.default = s, s;
|
|
16173
16284
|
});
|
|
16174
|
-
}
|
|
16285
|
+
}(Me)), Me.exports;
|
|
16175
16286
|
}
|
|
16176
16287
|
var _r = kr();
|
|
16177
16288
|
var Lr = /* @__PURE__ */ Ar(_r);
|
|
@@ -16394,7 +16505,7 @@ function Ue(e2, t) {
|
|
|
16394
16505
|
0 <= n && e2.splice(n, 1);
|
|
16395
16506
|
}
|
|
16396
16507
|
}
|
|
16397
|
-
var Oe =
|
|
16508
|
+
var Oe = function() {
|
|
16398
16509
|
function e2(t) {
|
|
16399
16510
|
this.initialTeardown = t, this.closed = false, this._parentage = null, this._finalizers = null;
|
|
16400
16511
|
}
|
|
@@ -16478,11 +16589,11 @@ var Oe = (function() {
|
|
|
16478
16589
|
}, e2.prototype.remove = function(t) {
|
|
16479
16590
|
var n = this._finalizers;
|
|
16480
16591
|
n && Ue(n, t), t instanceof e2 && t._removeParent(this);
|
|
16481
|
-
}, e2.EMPTY =
|
|
16592
|
+
}, e2.EMPTY = function() {
|
|
16482
16593
|
var t = new e2();
|
|
16483
16594
|
return t.closed = true, t;
|
|
16484
|
-
}
|
|
16485
|
-
}
|
|
16595
|
+
}(), e2;
|
|
16596
|
+
}();
|
|
16486
16597
|
var an = Oe.EMPTY;
|
|
16487
16598
|
function cn(e2) {
|
|
16488
16599
|
return e2 instanceof Oe || e2 && "closed" in e2 && P(e2.remove) && P(e2.add) && P(e2.unsubscribe);
|
|
@@ -16514,7 +16625,7 @@ function je() {
|
|
|
16514
16625
|
function Re(e2) {
|
|
16515
16626
|
e2();
|
|
16516
16627
|
}
|
|
16517
|
-
var gt =
|
|
16628
|
+
var gt = function(e2) {
|
|
16518
16629
|
te(t, e2);
|
|
16519
16630
|
function t(n) {
|
|
16520
16631
|
var r2 = e2.call(this) || this;
|
|
@@ -16545,8 +16656,8 @@ var gt = (function(e2) {
|
|
|
16545
16656
|
this.unsubscribe();
|
|
16546
16657
|
}
|
|
16547
16658
|
}, t;
|
|
16548
|
-
}
|
|
16549
|
-
var Nr =
|
|
16659
|
+
}(Oe);
|
|
16660
|
+
var Nr = function() {
|
|
16550
16661
|
function e2(t) {
|
|
16551
16662
|
this.partialObserver = t;
|
|
16552
16663
|
}
|
|
@@ -16577,8 +16688,8 @@ var Nr = (function() {
|
|
|
16577
16688
|
Le(n);
|
|
16578
16689
|
}
|
|
16579
16690
|
}, e2;
|
|
16580
|
-
}
|
|
16581
|
-
var Ce =
|
|
16691
|
+
}();
|
|
16692
|
+
var Ce = function(e2) {
|
|
16582
16693
|
te(t, e2);
|
|
16583
16694
|
function t(n, r2, i2) {
|
|
16584
16695
|
var o = e2.call(this) || this, s;
|
|
@@ -16589,7 +16700,7 @@ var Ce = (function(e2) {
|
|
|
16589
16700
|
} : s = n, o.destination = new Nr(s), o;
|
|
16590
16701
|
}
|
|
16591
16702
|
return t;
|
|
16592
|
-
}
|
|
16703
|
+
}(gt);
|
|
16593
16704
|
function Le(e2) {
|
|
16594
16705
|
un(e2);
|
|
16595
16706
|
}
|
|
@@ -16602,9 +16713,9 @@ var Ur = {
|
|
|
16602
16713
|
error: Fr,
|
|
16603
16714
|
complete: je
|
|
16604
16715
|
};
|
|
16605
|
-
var bt =
|
|
16716
|
+
var bt = function() {
|
|
16606
16717
|
return typeof Symbol == "function" && Symbol.observable || "@@observable";
|
|
16607
|
-
}
|
|
16718
|
+
}();
|
|
16608
16719
|
function Ge(e2) {
|
|
16609
16720
|
return e2;
|
|
16610
16721
|
}
|
|
@@ -16615,7 +16726,7 @@ function jr(e2) {
|
|
|
16615
16726
|
}, n);
|
|
16616
16727
|
};
|
|
16617
16728
|
}
|
|
16618
|
-
var k =
|
|
16729
|
+
var k = function() {
|
|
16619
16730
|
function e2(t) {
|
|
16620
16731
|
t && (this._subscribe = t);
|
|
16621
16732
|
}
|
|
@@ -16674,7 +16785,7 @@ var k = (function() {
|
|
|
16674
16785
|
}, e2.create = function(t) {
|
|
16675
16786
|
return new e2(t);
|
|
16676
16787
|
}, e2;
|
|
16677
|
-
}
|
|
16788
|
+
}();
|
|
16678
16789
|
function Lt(e2) {
|
|
16679
16790
|
var t;
|
|
16680
16791
|
return (t = e2 ?? Dr.Promise) !== null && t !== void 0 ? t : Promise;
|
|
@@ -16704,7 +16815,7 @@ function j(e2) {
|
|
|
16704
16815
|
function F(e2, t, n, r2, i2) {
|
|
16705
16816
|
return new Hr(e2, t, n, r2, i2);
|
|
16706
16817
|
}
|
|
16707
|
-
var Hr =
|
|
16818
|
+
var Hr = function(e2) {
|
|
16708
16819
|
te(t, e2);
|
|
16709
16820
|
function t(n, r2, i2, o, s, a) {
|
|
16710
16821
|
var c = e2.call(this, n) || this;
|
|
@@ -16739,13 +16850,13 @@ var Hr = (function(e2) {
|
|
|
16739
16850
|
e2.prototype.unsubscribe.call(this), !r2 && ((n = this.onFinalize) === null || n === void 0 || n.call(this));
|
|
16740
16851
|
}
|
|
16741
16852
|
}, t;
|
|
16742
|
-
}
|
|
16853
|
+
}(gt);
|
|
16743
16854
|
var zr = mt(function(e2) {
|
|
16744
16855
|
return function() {
|
|
16745
16856
|
e2(this), this.name = "ObjectUnsubscribedError", this.message = "object unsubscribed";
|
|
16746
16857
|
};
|
|
16747
16858
|
});
|
|
16748
|
-
var ee =
|
|
16859
|
+
var ee = function(e2) {
|
|
16749
16860
|
te(t, e2);
|
|
16750
16861
|
function t() {
|
|
16751
16862
|
var n = e2.call(this) || this;
|
|
@@ -16824,8 +16935,8 @@ var ee = (function(e2) {
|
|
|
16824
16935
|
}, t.create = function(n, r2) {
|
|
16825
16936
|
return new It(n, r2);
|
|
16826
16937
|
}, t;
|
|
16827
|
-
}
|
|
16828
|
-
var It =
|
|
16938
|
+
}(k);
|
|
16939
|
+
var It = function(e2) {
|
|
16829
16940
|
te(t, e2);
|
|
16830
16941
|
function t(n, r2) {
|
|
16831
16942
|
var i2 = e2.call(this) || this;
|
|
@@ -16844,8 +16955,8 @@ var It = (function(e2) {
|
|
|
16844
16955
|
var r2, i2;
|
|
16845
16956
|
return (i2 = (r2 = this.source) === null || r2 === void 0 ? void 0 : r2.subscribe(n)) !== null && i2 !== void 0 ? i2 : an;
|
|
16846
16957
|
}, t;
|
|
16847
|
-
}
|
|
16848
|
-
var ln =
|
|
16958
|
+
}(ee);
|
|
16959
|
+
var ln = function(e2) {
|
|
16849
16960
|
te(t, e2);
|
|
16850
16961
|
function t(n) {
|
|
16851
16962
|
var r2 = e2.call(this) || this;
|
|
@@ -16868,13 +16979,13 @@ var ln = (function(e2) {
|
|
|
16868
16979
|
}, t.prototype.next = function(n) {
|
|
16869
16980
|
e2.prototype.next.call(this, this._value = n);
|
|
16870
16981
|
}, t;
|
|
16871
|
-
}
|
|
16982
|
+
}(ee);
|
|
16872
16983
|
var Yr = {
|
|
16873
16984
|
now: function() {
|
|
16874
16985
|
return Date.now();
|
|
16875
16986
|
}
|
|
16876
16987
|
};
|
|
16877
|
-
var qr =
|
|
16988
|
+
var qr = function(e2) {
|
|
16878
16989
|
te(t, e2);
|
|
16879
16990
|
function t(n, r2) {
|
|
16880
16991
|
return e2.call(this) || this;
|
|
@@ -16882,7 +16993,7 @@ var qr = (function(e2) {
|
|
|
16882
16993
|
return t.prototype.schedule = function(n, r2) {
|
|
16883
16994
|
return this;
|
|
16884
16995
|
}, t;
|
|
16885
|
-
}
|
|
16996
|
+
}(Oe);
|
|
16886
16997
|
var Mt = {
|
|
16887
16998
|
setInterval: function(e2, t) {
|
|
16888
16999
|
for (var n = [], r2 = 2; r2 < arguments.length; r2++)
|
|
@@ -16894,7 +17005,7 @@ var Mt = {
|
|
|
16894
17005
|
},
|
|
16895
17006
|
delegate: void 0
|
|
16896
17007
|
};
|
|
16897
|
-
var Kr =
|
|
17008
|
+
var Kr = function(e2) {
|
|
16898
17009
|
te(t, e2);
|
|
16899
17010
|
function t(n, r2) {
|
|
16900
17011
|
var i2 = e2.call(this, n, r2) || this;
|
|
@@ -16936,16 +17047,16 @@ var Kr = (function(e2) {
|
|
|
16936
17047
|
this.work = this.state = this.scheduler = null, this.pending = false, Ue(o, this), r2 != null && (this.id = this.recycleAsyncId(i2, r2, null)), this.delay = null, e2.prototype.unsubscribe.call(this);
|
|
16937
17048
|
}
|
|
16938
17049
|
}, t;
|
|
16939
|
-
}
|
|
16940
|
-
var Rt =
|
|
17050
|
+
}(qr);
|
|
17051
|
+
var Rt = function() {
|
|
16941
17052
|
function e2(t, n) {
|
|
16942
17053
|
n === void 0 && (n = e2.now), this.schedulerActionCtor = t, this.now = n;
|
|
16943
17054
|
}
|
|
16944
17055
|
return e2.prototype.schedule = function(t, n, r2) {
|
|
16945
17056
|
return n === void 0 && (n = 0), new this.schedulerActionCtor(this, t).schedule(r2, n);
|
|
16946
17057
|
}, e2.now = Yr.now, e2;
|
|
16947
|
-
}
|
|
16948
|
-
var Gr =
|
|
17058
|
+
}();
|
|
17059
|
+
var Gr = function(e2) {
|
|
16949
17060
|
te(t, e2);
|
|
16950
17061
|
function t(n, r2) {
|
|
16951
17062
|
r2 === void 0 && (r2 = Rt.now);
|
|
@@ -16970,7 +17081,7 @@ var Gr = (function(e2) {
|
|
|
16970
17081
|
throw i2;
|
|
16971
17082
|
}
|
|
16972
17083
|
}, t;
|
|
16973
|
-
}
|
|
17084
|
+
}(Rt);
|
|
16974
17085
|
var Qr = new Gr(Kr);
|
|
16975
17086
|
function Jr(e2) {
|
|
16976
17087
|
return e2 && P(e2.schedule);
|
|
@@ -18091,7 +18202,7 @@ var MicButton = ({
|
|
|
18091
18202
|
onLanguageChange,
|
|
18092
18203
|
showLanguageDropdown = true
|
|
18093
18204
|
}) => {
|
|
18094
|
-
const { apiKey, appId } = useAnsyrContext();
|
|
18205
|
+
const { apiKey, appId, theme, emptyStateMessage } = useAnsyrContext();
|
|
18095
18206
|
const [showBodyGlow, setShowBodyGlow] = useState12(false);
|
|
18096
18207
|
const [currentTheme, setCurrentTheme] = useState12("dark");
|
|
18097
18208
|
const [showLanguageSelector, setShowLanguageSelector] = useState12(false);
|
|
@@ -18380,6 +18491,50 @@ var MicButton = ({
|
|
|
18380
18491
|
};
|
|
18381
18492
|
}
|
|
18382
18493
|
};
|
|
18494
|
+
const generateMicButtonGradient = () => {
|
|
18495
|
+
const colors = currentTheme === "light" ? theme?.light : theme?.dark;
|
|
18496
|
+
if (colors?.primary) {
|
|
18497
|
+
const hsl = hexToHSL(colors.primary);
|
|
18498
|
+
if (hsl) {
|
|
18499
|
+
const lightHsl = `${hsl.h} ${hsl.s}% ${Math.min(hsl.l + 10, 100)}%`;
|
|
18500
|
+
return `radial-gradient(circle at 50% 0%, hsl(${lightHsl}), hsl(${hsl.toString()}))`;
|
|
18501
|
+
}
|
|
18502
|
+
}
|
|
18503
|
+
return currentTheme === "dark" ? "radial-gradient(circle at 50% 0%, #9a92f6, #5447cd)" : "radial-gradient(circle at 50% 0%, #9a92f6, #6257d9)";
|
|
18504
|
+
};
|
|
18505
|
+
const generateThemeStyles2 = (theme2, currentTheme2 = "dark") => {
|
|
18506
|
+
if (!theme2) return {};
|
|
18507
|
+
const colors = currentTheme2 === "light" ? theme2.light : theme2.dark;
|
|
18508
|
+
if (!colors) return {};
|
|
18509
|
+
const mapping = {
|
|
18510
|
+
primary: "--voice-accent",
|
|
18511
|
+
background: "--voice-bg",
|
|
18512
|
+
surface: "--voice-surface",
|
|
18513
|
+
border: "--voice-border",
|
|
18514
|
+
text: "--voice-text",
|
|
18515
|
+
textMuted: "--voice-text-muted",
|
|
18516
|
+
userBubble: "--voice-user-bubble",
|
|
18517
|
+
userText: "--voice-user-text",
|
|
18518
|
+
aiBubble: "--voice-ai-bubble",
|
|
18519
|
+
aiText: "--voice-ai-text"
|
|
18520
|
+
};
|
|
18521
|
+
const styles = {};
|
|
18522
|
+
Object.entries(colors).forEach(([key, value]) => {
|
|
18523
|
+
const varName = mapping[key];
|
|
18524
|
+
if (varName && value) {
|
|
18525
|
+
const hsl = hexToHSL(value);
|
|
18526
|
+
if (hsl) {
|
|
18527
|
+
styles[varName] = hsl.toString();
|
|
18528
|
+
if (key === "primary") {
|
|
18529
|
+
styles["--indicator-bg"] = hsl.toString();
|
|
18530
|
+
styles["--voice-accent-light"] = currentTheme2 === "light" ? `${hsl.h} ${hsl.s}% 96%` : `${hsl.h} ${hsl.s}% 25%`;
|
|
18531
|
+
}
|
|
18532
|
+
}
|
|
18533
|
+
}
|
|
18534
|
+
});
|
|
18535
|
+
return styles;
|
|
18536
|
+
};
|
|
18537
|
+
const micButtonGradient = generateMicButtonGradient();
|
|
18383
18538
|
const buttonStyles = {
|
|
18384
18539
|
container: {
|
|
18385
18540
|
position: "relative",
|
|
@@ -18395,7 +18550,7 @@ var MicButton = ({
|
|
|
18395
18550
|
width: `${buttonSize}px`,
|
|
18396
18551
|
height: `${buttonSize}px`,
|
|
18397
18552
|
borderRadius: "50%",
|
|
18398
|
-
background:
|
|
18553
|
+
background: micButtonGradient,
|
|
18399
18554
|
transition: "all 0.5s",
|
|
18400
18555
|
border: "none",
|
|
18401
18556
|
boxShadow: "0 25px 50px -12px rgba(0, 0, 0, 0.25)",
|
|
@@ -18435,7 +18590,11 @@ var MicButton = ({
|
|
|
18435
18590
|
{
|
|
18436
18591
|
"data-cuekit-ignore": true,
|
|
18437
18592
|
className: `cuekit-voice-popup ${currentTheme === "dark" ? "cuekit-dark" : ""}`,
|
|
18438
|
-
style: {
|
|
18593
|
+
style: {
|
|
18594
|
+
...buttonStyles.container,
|
|
18595
|
+
...getPositionStyle(),
|
|
18596
|
+
...generateThemeStyles2(theme, currentTheme)
|
|
18597
|
+
}
|
|
18439
18598
|
},
|
|
18440
18599
|
showLanguageSelector && showLanguageDropdown ? /* @__PURE__ */ React15.createElement("div", { className: "voice-chat-language-selection" }, /* @__PURE__ */ React15.createElement("div", { className: "voice-chat-language-header" }, /* @__PURE__ */ React15.createElement("div", { className: "voice-chat-language-icon" }, /* @__PURE__ */ React15.createElement(mic_default, { width: 20, height: 20 })), /* @__PURE__ */ React15.createElement("span", { className: "voice-chat-language-title" }, "Select Language")), /* @__PURE__ */ React15.createElement(
|
|
18441
18600
|
LanguageSelector,
|
|
@@ -18450,10 +18609,27 @@ var MicButton = ({
|
|
|
18450
18609
|
"button",
|
|
18451
18610
|
{
|
|
18452
18611
|
className: "voice-chat-cancel-button",
|
|
18453
|
-
onClick: () => setShowLanguageSelector(false)
|
|
18612
|
+
onClick: () => setShowLanguageSelector(false),
|
|
18613
|
+
style: {
|
|
18614
|
+
background: currentTheme === "dark" ? "hsl(248 32% 17.5%)" : "#f6f5ff",
|
|
18615
|
+
color: currentTheme === "dark" ? "hsl(252 20% 65%)" : "#6257d9",
|
|
18616
|
+
border: `1px solid ${currentTheme === "dark" ? "hsl(248 32% 22%)" : "#c0bbfb"}`
|
|
18617
|
+
}
|
|
18454
18618
|
},
|
|
18455
18619
|
"Cancel"
|
|
18456
|
-
), /* @__PURE__ */ React15.createElement(
|
|
18620
|
+
), /* @__PURE__ */ React15.createElement(
|
|
18621
|
+
"button",
|
|
18622
|
+
{
|
|
18623
|
+
className: "voice-chat-confirm-button",
|
|
18624
|
+
onClick: handleLanguageConfirm,
|
|
18625
|
+
style: {
|
|
18626
|
+
background: currentTheme === "dark" ? "#8177ed" : "#6257d9",
|
|
18627
|
+
color: "#fff",
|
|
18628
|
+
border: `1px solid ${currentTheme === "dark" ? "#8177ed" : "#6257d9"}`
|
|
18629
|
+
}
|
|
18630
|
+
},
|
|
18631
|
+
"Start Voice Chat"
|
|
18632
|
+
))) : /* @__PURE__ */ React15.createElement("div", { className: "voice-chat-main-button" }, showLanguageDropdown && /* @__PURE__ */ React15.createElement(
|
|
18457
18633
|
LanguageSelector,
|
|
18458
18634
|
{
|
|
18459
18635
|
selectedLanguage,
|
|
@@ -18539,7 +18715,9 @@ var MicButton = ({
|
|
|
18539
18715
|
resizable: true,
|
|
18540
18716
|
persistPosition: true,
|
|
18541
18717
|
persistSize: true,
|
|
18542
|
-
storageKey: "cuekit-chat-popup"
|
|
18718
|
+
storageKey: "cuekit-chat-popup",
|
|
18719
|
+
theme,
|
|
18720
|
+
emptyStateMessage
|
|
18543
18721
|
}
|
|
18544
18722
|
), isChatOpen && isChatMinimized && /* @__PURE__ */ React15.createElement(
|
|
18545
18723
|
"button",
|