@cuekit-ai/react 1.2.1 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -0
- package/dist/cuekit.css +89 -536
- package/dist/index.js +260 -104
- package/dist/index.mjs +224 -70
- package/package.json +2 -9
package/dist/index.js
CHANGED
|
@@ -23714,8 +23714,7 @@ var CuekitProvider = ({
|
|
|
23714
23714
|
};
|
|
23715
23715
|
|
|
23716
23716
|
// src/components/mic-button.tsx
|
|
23717
|
-
var
|
|
23718
|
-
var import_lucide_react2 = require("lucide-react");
|
|
23717
|
+
var import_react15 = __toESM(require("react"));
|
|
23719
23718
|
|
|
23720
23719
|
// src/hooks/use-cuekit.ts
|
|
23721
23720
|
var import_react3 = require("react");
|
|
@@ -24463,8 +24462,7 @@ var useCuekit = (options) => {
|
|
|
24463
24462
|
};
|
|
24464
24463
|
|
|
24465
24464
|
// src/components/chat-popup.tsx
|
|
24466
|
-
var
|
|
24467
|
-
var import_lucide_react = require("lucide-react");
|
|
24465
|
+
var import_react9 = __toESM(require("react"));
|
|
24468
24466
|
|
|
24469
24467
|
// node_modules/devlop/lib/default.js
|
|
24470
24468
|
function ok() {
|
|
@@ -37105,6 +37103,109 @@ function remarkGfm(options) {
|
|
|
37105
37103
|
toMarkdownExtensions.push(gfmToMarkdown(settings));
|
|
37106
37104
|
}
|
|
37107
37105
|
|
|
37106
|
+
// src/components/svgs/sun.tsx
|
|
37107
|
+
var import_react5 = __toESM(require("react"));
|
|
37108
|
+
var SunIcon = ({ width = 24, height = 24, className, ...props }) => {
|
|
37109
|
+
return /* @__PURE__ */ import_react5.default.createElement(
|
|
37110
|
+
"svg",
|
|
37111
|
+
{
|
|
37112
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
37113
|
+
width: "24",
|
|
37114
|
+
height: "24",
|
|
37115
|
+
viewBox: "0 0 24 24",
|
|
37116
|
+
fill: "none",
|
|
37117
|
+
stroke: "currentColor",
|
|
37118
|
+
"stroke-width": "2",
|
|
37119
|
+
"stroke-linecap": "round",
|
|
37120
|
+
"stroke-linejoin": "round",
|
|
37121
|
+
className,
|
|
37122
|
+
...props
|
|
37123
|
+
},
|
|
37124
|
+
/* @__PURE__ */ import_react5.default.createElement("circle", { cx: "12", cy: "12", r: "4" }),
|
|
37125
|
+
/* @__PURE__ */ import_react5.default.createElement("path", { d: "M12 2v2" }),
|
|
37126
|
+
/* @__PURE__ */ import_react5.default.createElement("path", { d: "M12 20v2" }),
|
|
37127
|
+
/* @__PURE__ */ import_react5.default.createElement("path", { d: "m4.93 4.93 1.41 1.41" }),
|
|
37128
|
+
/* @__PURE__ */ import_react5.default.createElement("path", { d: "m17.66 17.66 1.41 1.41" }),
|
|
37129
|
+
/* @__PURE__ */ import_react5.default.createElement("path", { d: "M2 12h2" }),
|
|
37130
|
+
/* @__PURE__ */ import_react5.default.createElement("path", { d: "M20 12h2" }),
|
|
37131
|
+
/* @__PURE__ */ import_react5.default.createElement("path", { d: "m6.34 17.66-1.41 1.41" }),
|
|
37132
|
+
/* @__PURE__ */ import_react5.default.createElement("path", { d: "m19.07 4.93-1.41 1.41" })
|
|
37133
|
+
);
|
|
37134
|
+
};
|
|
37135
|
+
var sun_default = SunIcon;
|
|
37136
|
+
|
|
37137
|
+
// src/components/svgs/moon.tsx
|
|
37138
|
+
var import_react6 = __toESM(require("react"));
|
|
37139
|
+
var MoonIcon = ({ width = 24, height = 24, className, ...props }) => {
|
|
37140
|
+
return /* @__PURE__ */ import_react6.default.createElement(
|
|
37141
|
+
"svg",
|
|
37142
|
+
{
|
|
37143
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
37144
|
+
width: "24",
|
|
37145
|
+
height: "24",
|
|
37146
|
+
viewBox: "0 0 24 24",
|
|
37147
|
+
fill: "none",
|
|
37148
|
+
stroke: "currentColor",
|
|
37149
|
+
"stroke-width": "2",
|
|
37150
|
+
"stroke-linecap": "round",
|
|
37151
|
+
"stroke-linejoin": "round",
|
|
37152
|
+
className,
|
|
37153
|
+
...props
|
|
37154
|
+
},
|
|
37155
|
+
/* @__PURE__ */ import_react6.default.createElement("path", { d: "M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401" })
|
|
37156
|
+
);
|
|
37157
|
+
};
|
|
37158
|
+
var moon_default = MoonIcon;
|
|
37159
|
+
|
|
37160
|
+
// src/components/svgs/close.tsx
|
|
37161
|
+
var import_react7 = __toESM(require("react"));
|
|
37162
|
+
var CloseIcon = ({ width = 24, height = 24, className, ...props }) => {
|
|
37163
|
+
return /* @__PURE__ */ import_react7.default.createElement(
|
|
37164
|
+
"svg",
|
|
37165
|
+
{
|
|
37166
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
37167
|
+
width: "24",
|
|
37168
|
+
height: "24",
|
|
37169
|
+
viewBox: "0 0 24 24",
|
|
37170
|
+
fill: "none",
|
|
37171
|
+
stroke: "currentColor",
|
|
37172
|
+
"stroke-width": "2",
|
|
37173
|
+
"stroke-linecap": "round",
|
|
37174
|
+
"stroke-linejoin": "round",
|
|
37175
|
+
className,
|
|
37176
|
+
...props
|
|
37177
|
+
},
|
|
37178
|
+
/* @__PURE__ */ import_react7.default.createElement("path", { d: "M18 6 6 18" }),
|
|
37179
|
+
/* @__PURE__ */ import_react7.default.createElement("path", { d: "m6 6 12 12" })
|
|
37180
|
+
);
|
|
37181
|
+
};
|
|
37182
|
+
var close_default = CloseIcon;
|
|
37183
|
+
|
|
37184
|
+
// src/components/svgs/phone-off.tsx
|
|
37185
|
+
var import_react8 = __toESM(require("react"));
|
|
37186
|
+
var PhoneOffIcon = ({ width = 24, height = 24, className, ...props }) => {
|
|
37187
|
+
return /* @__PURE__ */ import_react8.default.createElement(
|
|
37188
|
+
"svg",
|
|
37189
|
+
{
|
|
37190
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
37191
|
+
width: "24",
|
|
37192
|
+
height: "24",
|
|
37193
|
+
viewBox: "0 0 24 24",
|
|
37194
|
+
fill: "none",
|
|
37195
|
+
stroke: "currentColor",
|
|
37196
|
+
"stroke-width": "2",
|
|
37197
|
+
"stroke-linecap": "round",
|
|
37198
|
+
"stroke-linejoin": "round",
|
|
37199
|
+
className,
|
|
37200
|
+
...props
|
|
37201
|
+
},
|
|
37202
|
+
/* @__PURE__ */ import_react8.default.createElement("path", { d: "M10.1 13.9a14 14 0 0 0 3.732 2.668 1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2 18 18 0 0 1-12.728-5.272" }),
|
|
37203
|
+
/* @__PURE__ */ import_react8.default.createElement("path", { d: "M22 2 2 22" }),
|
|
37204
|
+
/* @__PURE__ */ import_react8.default.createElement("path", { d: "M4.76 13.582A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 .244.473" })
|
|
37205
|
+
);
|
|
37206
|
+
};
|
|
37207
|
+
var phone_off_default = PhoneOffIcon;
|
|
37208
|
+
|
|
37108
37209
|
// src/components/chat-popup.tsx
|
|
37109
37210
|
var ChatPopup = ({
|
|
37110
37211
|
isOpen,
|
|
@@ -37123,13 +37224,13 @@ var ChatPopup = ({
|
|
|
37123
37224
|
status,
|
|
37124
37225
|
anchor
|
|
37125
37226
|
}) => {
|
|
37126
|
-
const [inputText, setInputText] = (0,
|
|
37127
|
-
const [isSending, setIsSending] = (0,
|
|
37128
|
-
const messagesEndRef = (0,
|
|
37227
|
+
const [inputText, setInputText] = (0, import_react9.useState)("");
|
|
37228
|
+
const [isSending, setIsSending] = (0, import_react9.useState)(false);
|
|
37229
|
+
const messagesEndRef = (0, import_react9.useRef)(null);
|
|
37129
37230
|
const scrollToBottom = () => {
|
|
37130
37231
|
messagesEndRef.current?.scrollIntoView({ behavior: "smooth" });
|
|
37131
37232
|
};
|
|
37132
|
-
(0,
|
|
37233
|
+
(0, import_react9.useEffect)(() => {
|
|
37133
37234
|
console.log("\u{1F4EC} ChatPopup received messages:", JSON.stringify(messages, null, 2));
|
|
37134
37235
|
scrollToBottom();
|
|
37135
37236
|
}, [messages]);
|
|
@@ -37191,7 +37292,7 @@ var ChatPopup = ({
|
|
|
37191
37292
|
}
|
|
37192
37293
|
};
|
|
37193
37294
|
const positionStyle = getPositionStyle();
|
|
37194
|
-
return /* @__PURE__ */
|
|
37295
|
+
return /* @__PURE__ */ import_react9.default.createElement(
|
|
37195
37296
|
"div",
|
|
37196
37297
|
{
|
|
37197
37298
|
"data-cuekit-ignore": true,
|
|
@@ -37214,7 +37315,7 @@ var ChatPopup = ({
|
|
|
37214
37315
|
...positionStyle
|
|
37215
37316
|
}
|
|
37216
37317
|
},
|
|
37217
|
-
/* @__PURE__ */
|
|
37318
|
+
/* @__PURE__ */ import_react9.default.createElement(
|
|
37218
37319
|
"div",
|
|
37219
37320
|
{
|
|
37220
37321
|
style: {
|
|
@@ -37225,14 +37326,14 @@ var ChatPopup = ({
|
|
|
37225
37326
|
justifyContent: "space-between"
|
|
37226
37327
|
}
|
|
37227
37328
|
},
|
|
37228
|
-
/* @__PURE__ */
|
|
37329
|
+
/* @__PURE__ */ import_react9.default.createElement("div", { style: { display: "flex", alignItems: "center", gap: 0 } }, /* @__PURE__ */ import_react9.default.createElement(
|
|
37229
37330
|
"img",
|
|
37230
37331
|
{
|
|
37231
37332
|
src: "https://dashboard.cuekit.ai/_next/image?url=%2Fimages%2Fcuekit-logo-2.png&w=256&q=100",
|
|
37232
37333
|
alt: "Cuekit AI",
|
|
37233
37334
|
style: { width: 58, objectFit: "cover" }
|
|
37234
37335
|
}
|
|
37235
|
-
), /* @__PURE__ */
|
|
37336
|
+
), /* @__PURE__ */ import_react9.default.createElement(
|
|
37236
37337
|
"div",
|
|
37237
37338
|
{
|
|
37238
37339
|
style: {
|
|
@@ -37243,7 +37344,7 @@ var ChatPopup = ({
|
|
|
37243
37344
|
justifyContent: "center"
|
|
37244
37345
|
}
|
|
37245
37346
|
},
|
|
37246
|
-
/* @__PURE__ */
|
|
37347
|
+
/* @__PURE__ */ import_react9.default.createElement(
|
|
37247
37348
|
"span",
|
|
37248
37349
|
{
|
|
37249
37350
|
style: {
|
|
@@ -37260,7 +37361,7 @@ var ChatPopup = ({
|
|
|
37260
37361
|
},
|
|
37261
37362
|
"Cuekit.ai"
|
|
37262
37363
|
),
|
|
37263
|
-
/* @__PURE__ */
|
|
37364
|
+
/* @__PURE__ */ import_react9.default.createElement("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", gap: 4 } }, /* @__PURE__ */ import_react9.default.createElement(
|
|
37264
37365
|
"div",
|
|
37265
37366
|
{
|
|
37266
37367
|
style: {
|
|
@@ -37276,7 +37377,7 @@ var ChatPopup = ({
|
|
|
37276
37377
|
fontWeight: "500"
|
|
37277
37378
|
}
|
|
37278
37379
|
},
|
|
37279
|
-
/* @__PURE__ */
|
|
37380
|
+
/* @__PURE__ */ import_react9.default.createElement(
|
|
37280
37381
|
"span",
|
|
37281
37382
|
{
|
|
37282
37383
|
style: {
|
|
@@ -37287,8 +37388,8 @@ var ChatPopup = ({
|
|
|
37287
37388
|
)
|
|
37288
37389
|
))
|
|
37289
37390
|
)),
|
|
37290
|
-
/* @__PURE__ */
|
|
37291
|
-
/* @__PURE__ */
|
|
37391
|
+
/* @__PURE__ */ import_react9.default.createElement("div", { style: { minWidth: 100, textAlign: "center" } }),
|
|
37392
|
+
/* @__PURE__ */ import_react9.default.createElement(
|
|
37292
37393
|
"div",
|
|
37293
37394
|
{
|
|
37294
37395
|
style: {
|
|
@@ -37300,7 +37401,7 @@ var ChatPopup = ({
|
|
|
37300
37401
|
top: 16
|
|
37301
37402
|
}
|
|
37302
37403
|
},
|
|
37303
|
-
onThemeToggle && /* @__PURE__ */
|
|
37404
|
+
onThemeToggle && /* @__PURE__ */ import_react9.default.createElement(
|
|
37304
37405
|
"button",
|
|
37305
37406
|
{
|
|
37306
37407
|
onClick: () => {
|
|
@@ -37330,8 +37431,8 @@ var ChatPopup = ({
|
|
|
37330
37431
|
"aria-label": "Toggle theme",
|
|
37331
37432
|
title: `Switch to ${currentTheme === "dark" ? "light" : "dark"} mode`
|
|
37332
37433
|
},
|
|
37333
|
-
currentTheme === "dark" ? /* @__PURE__ */
|
|
37334
|
-
|
|
37434
|
+
currentTheme === "dark" ? /* @__PURE__ */ import_react9.default.createElement(
|
|
37435
|
+
sun_default,
|
|
37335
37436
|
{
|
|
37336
37437
|
style: {
|
|
37337
37438
|
width: 16,
|
|
@@ -37340,8 +37441,8 @@ var ChatPopup = ({
|
|
|
37340
37441
|
animation: "themeToggleEnter 0.3s ease-in-out"
|
|
37341
37442
|
}
|
|
37342
37443
|
}
|
|
37343
|
-
) : /* @__PURE__ */
|
|
37344
|
-
|
|
37444
|
+
) : /* @__PURE__ */ import_react9.default.createElement(
|
|
37445
|
+
moon_default,
|
|
37345
37446
|
{
|
|
37346
37447
|
style: {
|
|
37347
37448
|
width: 16,
|
|
@@ -37352,7 +37453,7 @@ var ChatPopup = ({
|
|
|
37352
37453
|
}
|
|
37353
37454
|
)
|
|
37354
37455
|
),
|
|
37355
|
-
/* @__PURE__ */
|
|
37456
|
+
/* @__PURE__ */ import_react9.default.createElement(
|
|
37356
37457
|
"button",
|
|
37357
37458
|
{
|
|
37358
37459
|
onClick: onMinimize,
|
|
@@ -37379,11 +37480,11 @@ var ChatPopup = ({
|
|
|
37379
37480
|
"aria-label": "Minimize",
|
|
37380
37481
|
title: "Minimize chat"
|
|
37381
37482
|
},
|
|
37382
|
-
/* @__PURE__ */
|
|
37483
|
+
/* @__PURE__ */ import_react9.default.createElement(close_default, { style: { width: 16, height: 16, color: "hsl(var(--voice-text-muted))" } })
|
|
37383
37484
|
)
|
|
37384
37485
|
)
|
|
37385
37486
|
),
|
|
37386
|
-
/* @__PURE__ */
|
|
37487
|
+
/* @__PURE__ */ import_react9.default.createElement(
|
|
37387
37488
|
"div",
|
|
37388
37489
|
{
|
|
37389
37490
|
style: {
|
|
@@ -37396,7 +37497,7 @@ var ChatPopup = ({
|
|
|
37396
37497
|
color: "hsl(var(--voice-text))"
|
|
37397
37498
|
}
|
|
37398
37499
|
},
|
|
37399
|
-
messages.length === 0 ? /* @__PURE__ */
|
|
37500
|
+
messages.length === 0 ? /* @__PURE__ */ import_react9.default.createElement(
|
|
37400
37501
|
"div",
|
|
37401
37502
|
{
|
|
37402
37503
|
style: {
|
|
@@ -37406,7 +37507,7 @@ var ChatPopup = ({
|
|
|
37406
37507
|
}
|
|
37407
37508
|
},
|
|
37408
37509
|
"Start a conversation with CueKit AI"
|
|
37409
|
-
) : messages.map((message, index2) => /* @__PURE__ */
|
|
37510
|
+
) : messages.map((message, index2) => /* @__PURE__ */ import_react9.default.createElement(
|
|
37410
37511
|
"div",
|
|
37411
37512
|
{
|
|
37412
37513
|
key: index2,
|
|
@@ -37420,7 +37521,7 @@ var ChatPopup = ({
|
|
|
37420
37521
|
justifyContent: message.sender === "user" ? "flex-end" : "flex-start"
|
|
37421
37522
|
}
|
|
37422
37523
|
},
|
|
37423
|
-
message.sender === "assistant" && /* @__PURE__ */
|
|
37524
|
+
message.sender === "assistant" && /* @__PURE__ */ import_react9.default.createElement(
|
|
37424
37525
|
"div",
|
|
37425
37526
|
{
|
|
37426
37527
|
style: {
|
|
@@ -37435,7 +37536,7 @@ var ChatPopup = ({
|
|
|
37435
37536
|
overflow: "hidden"
|
|
37436
37537
|
}
|
|
37437
37538
|
},
|
|
37438
|
-
/* @__PURE__ */
|
|
37539
|
+
/* @__PURE__ */ import_react9.default.createElement(
|
|
37439
37540
|
"img",
|
|
37440
37541
|
{
|
|
37441
37542
|
src: "https://dashboard.cuekit.ai/_next/image?url=%2Fimages%2Fcuekit-logo-2.png&w=256&q=100",
|
|
@@ -37449,7 +37550,7 @@ var ChatPopup = ({
|
|
|
37449
37550
|
}
|
|
37450
37551
|
)
|
|
37451
37552
|
),
|
|
37452
|
-
/* @__PURE__ */
|
|
37553
|
+
/* @__PURE__ */ import_react9.default.createElement(
|
|
37453
37554
|
"div",
|
|
37454
37555
|
{
|
|
37455
37556
|
style: {
|
|
@@ -37460,7 +37561,7 @@ var ChatPopup = ({
|
|
|
37460
37561
|
flex: 1
|
|
37461
37562
|
}
|
|
37462
37563
|
},
|
|
37463
|
-
/* @__PURE__ */
|
|
37564
|
+
/* @__PURE__ */ import_react9.default.createElement(
|
|
37464
37565
|
"div",
|
|
37465
37566
|
{
|
|
37466
37567
|
style: {
|
|
@@ -37478,12 +37579,12 @@ var ChatPopup = ({
|
|
|
37478
37579
|
marginLeft: message.sender === "user" ? "auto" : 0
|
|
37479
37580
|
}
|
|
37480
37581
|
},
|
|
37481
|
-
/* @__PURE__ */
|
|
37582
|
+
/* @__PURE__ */ import_react9.default.createElement("div", null, /* @__PURE__ */ import_react9.default.createElement(
|
|
37482
37583
|
Markdown,
|
|
37483
37584
|
{
|
|
37484
37585
|
remarkPlugins: [remarkGfm],
|
|
37485
37586
|
components: {
|
|
37486
|
-
p: ({ children }) => /* @__PURE__ */
|
|
37587
|
+
p: ({ children }) => /* @__PURE__ */ import_react9.default.createElement(
|
|
37487
37588
|
"p",
|
|
37488
37589
|
{
|
|
37489
37590
|
style: {
|
|
@@ -37494,7 +37595,7 @@ var ChatPopup = ({
|
|
|
37494
37595
|
},
|
|
37495
37596
|
children
|
|
37496
37597
|
),
|
|
37497
|
-
h1: ({ children }) => /* @__PURE__ */
|
|
37598
|
+
h1: ({ children }) => /* @__PURE__ */ import_react9.default.createElement(
|
|
37498
37599
|
"h1",
|
|
37499
37600
|
{
|
|
37500
37601
|
style: {
|
|
@@ -37506,7 +37607,7 @@ var ChatPopup = ({
|
|
|
37506
37607
|
},
|
|
37507
37608
|
children
|
|
37508
37609
|
),
|
|
37509
|
-
h2: ({ children }) => /* @__PURE__ */
|
|
37610
|
+
h2: ({ children }) => /* @__PURE__ */ import_react9.default.createElement(
|
|
37510
37611
|
"h2",
|
|
37511
37612
|
{
|
|
37512
37613
|
style: {
|
|
@@ -37518,7 +37619,7 @@ var ChatPopup = ({
|
|
|
37518
37619
|
},
|
|
37519
37620
|
children
|
|
37520
37621
|
),
|
|
37521
|
-
h3: ({ children }) => /* @__PURE__ */
|
|
37622
|
+
h3: ({ children }) => /* @__PURE__ */ import_react9.default.createElement(
|
|
37522
37623
|
"h3",
|
|
37523
37624
|
{
|
|
37524
37625
|
style: {
|
|
@@ -37530,7 +37631,7 @@ var ChatPopup = ({
|
|
|
37530
37631
|
},
|
|
37531
37632
|
children
|
|
37532
37633
|
),
|
|
37533
|
-
ul: ({ children }) => /* @__PURE__ */
|
|
37634
|
+
ul: ({ children }) => /* @__PURE__ */ import_react9.default.createElement(
|
|
37534
37635
|
"ul",
|
|
37535
37636
|
{
|
|
37536
37637
|
style: {
|
|
@@ -37542,7 +37643,7 @@ var ChatPopup = ({
|
|
|
37542
37643
|
},
|
|
37543
37644
|
children
|
|
37544
37645
|
),
|
|
37545
|
-
ol: ({ children }) => /* @__PURE__ */
|
|
37646
|
+
ol: ({ children }) => /* @__PURE__ */ import_react9.default.createElement(
|
|
37546
37647
|
"ol",
|
|
37547
37648
|
{
|
|
37548
37649
|
style: {
|
|
@@ -37554,7 +37655,7 @@ var ChatPopup = ({
|
|
|
37554
37655
|
},
|
|
37555
37656
|
children
|
|
37556
37657
|
),
|
|
37557
|
-
li: ({ children }) => /* @__PURE__ */
|
|
37658
|
+
li: ({ children }) => /* @__PURE__ */ import_react9.default.createElement(
|
|
37558
37659
|
"li",
|
|
37559
37660
|
{
|
|
37560
37661
|
style: {
|
|
@@ -37565,7 +37666,7 @@ var ChatPopup = ({
|
|
|
37565
37666
|
},
|
|
37566
37667
|
children
|
|
37567
37668
|
),
|
|
37568
|
-
strong: ({ children }) => /* @__PURE__ */
|
|
37669
|
+
strong: ({ children }) => /* @__PURE__ */ import_react9.default.createElement(
|
|
37569
37670
|
"strong",
|
|
37570
37671
|
{
|
|
37571
37672
|
style: {
|
|
@@ -37576,7 +37677,7 @@ var ChatPopup = ({
|
|
|
37576
37677
|
},
|
|
37577
37678
|
children
|
|
37578
37679
|
),
|
|
37579
|
-
em: ({ children }) => /* @__PURE__ */
|
|
37680
|
+
em: ({ children }) => /* @__PURE__ */ import_react9.default.createElement(
|
|
37580
37681
|
"em",
|
|
37581
37682
|
{
|
|
37582
37683
|
style: {
|
|
@@ -37587,7 +37688,7 @@ var ChatPopup = ({
|
|
|
37587
37688
|
},
|
|
37588
37689
|
children
|
|
37589
37690
|
),
|
|
37590
|
-
code: ({ children }) => /* @__PURE__ */
|
|
37691
|
+
code: ({ children }) => /* @__PURE__ */ import_react9.default.createElement(
|
|
37591
37692
|
"code",
|
|
37592
37693
|
{
|
|
37593
37694
|
style: {
|
|
@@ -37600,7 +37701,7 @@ var ChatPopup = ({
|
|
|
37600
37701
|
},
|
|
37601
37702
|
children
|
|
37602
37703
|
),
|
|
37603
|
-
pre: ({ children }) => /* @__PURE__ */
|
|
37704
|
+
pre: ({ children }) => /* @__PURE__ */ import_react9.default.createElement(
|
|
37604
37705
|
"pre",
|
|
37605
37706
|
{
|
|
37606
37707
|
style: {
|
|
@@ -37615,7 +37716,7 @@ var ChatPopup = ({
|
|
|
37615
37716
|
},
|
|
37616
37717
|
children
|
|
37617
37718
|
),
|
|
37618
|
-
blockquote: ({ children }) => /* @__PURE__ */
|
|
37719
|
+
blockquote: ({ children }) => /* @__PURE__ */ import_react9.default.createElement(
|
|
37619
37720
|
"blockquote",
|
|
37620
37721
|
{
|
|
37621
37722
|
style: {
|
|
@@ -37634,7 +37735,7 @@ var ChatPopup = ({
|
|
|
37634
37735
|
message.text
|
|
37635
37736
|
))
|
|
37636
37737
|
),
|
|
37637
|
-
message.sender === "user" && /* @__PURE__ */
|
|
37738
|
+
message.sender === "user" && /* @__PURE__ */ import_react9.default.createElement(
|
|
37638
37739
|
"div",
|
|
37639
37740
|
{
|
|
37640
37741
|
style: {
|
|
@@ -37655,9 +37756,9 @@ var ChatPopup = ({
|
|
|
37655
37756
|
)
|
|
37656
37757
|
)
|
|
37657
37758
|
)),
|
|
37658
|
-
/* @__PURE__ */
|
|
37759
|
+
/* @__PURE__ */ import_react9.default.createElement("div", { ref: messagesEndRef })
|
|
37659
37760
|
),
|
|
37660
|
-
/* @__PURE__ */
|
|
37761
|
+
/* @__PURE__ */ import_react9.default.createElement(
|
|
37661
37762
|
"div",
|
|
37662
37763
|
{
|
|
37663
37764
|
style: {
|
|
@@ -37666,7 +37767,7 @@ var ChatPopup = ({
|
|
|
37666
37767
|
background: "hsl(var(--voice-bg))"
|
|
37667
37768
|
}
|
|
37668
37769
|
},
|
|
37669
|
-
/* @__PURE__ */
|
|
37770
|
+
/* @__PURE__ */ import_react9.default.createElement(
|
|
37670
37771
|
"form",
|
|
37671
37772
|
{
|
|
37672
37773
|
onSubmit: (e3) => {
|
|
@@ -37675,7 +37776,7 @@ var ChatPopup = ({
|
|
|
37675
37776
|
},
|
|
37676
37777
|
style: { display: "flex", alignItems: "center", gap: 8, margin: 0 }
|
|
37677
37778
|
},
|
|
37678
|
-
/* @__PURE__ */
|
|
37779
|
+
/* @__PURE__ */ import_react9.default.createElement(
|
|
37679
37780
|
"input",
|
|
37680
37781
|
{
|
|
37681
37782
|
type: "text",
|
|
@@ -37702,7 +37803,7 @@ var ChatPopup = ({
|
|
|
37702
37803
|
}
|
|
37703
37804
|
}
|
|
37704
37805
|
),
|
|
37705
|
-
isConnected4 && onEndCall && /* @__PURE__ */
|
|
37806
|
+
isConnected4 && onEndCall && /* @__PURE__ */ import_react9.default.createElement(
|
|
37706
37807
|
"button",
|
|
37707
37808
|
{
|
|
37708
37809
|
type: "submit",
|
|
@@ -37721,7 +37822,7 @@ var ChatPopup = ({
|
|
|
37721
37822
|
cursor: "pointer"
|
|
37722
37823
|
}
|
|
37723
37824
|
},
|
|
37724
|
-
/* @__PURE__ */
|
|
37825
|
+
/* @__PURE__ */ import_react9.default.createElement(phone_off_default, { style: { width: 16, height: 16 } })
|
|
37725
37826
|
)
|
|
37726
37827
|
)
|
|
37727
37828
|
)
|
|
@@ -37729,7 +37830,7 @@ var ChatPopup = ({
|
|
|
37729
37830
|
};
|
|
37730
37831
|
|
|
37731
37832
|
// src/components/border-glow.tsx
|
|
37732
|
-
var
|
|
37833
|
+
var import_react10 = __toESM(require("react"));
|
|
37733
37834
|
var BorderGlow = ({ isActive }) => {
|
|
37734
37835
|
if (!isActive) return null;
|
|
37735
37836
|
const styles = {
|
|
@@ -37856,7 +37957,7 @@ var BorderGlow = ({ isActive }) => {
|
|
|
37856
37957
|
opacity: 0.6
|
|
37857
37958
|
}
|
|
37858
37959
|
};
|
|
37859
|
-
return /* @__PURE__ */
|
|
37960
|
+
return /* @__PURE__ */ import_react10.default.createElement(import_react10.default.Fragment, null, /* @__PURE__ */ import_react10.default.createElement("style", null, `
|
|
37860
37961
|
@keyframes borderPulse {
|
|
37861
37962
|
0%, 100% {
|
|
37862
37963
|
opacity: 1;
|
|
@@ -37865,12 +37966,12 @@ var BorderGlow = ({ isActive }) => {
|
|
|
37865
37966
|
opacity: 0.5;
|
|
37866
37967
|
}
|
|
37867
37968
|
}
|
|
37868
|
-
`), /* @__PURE__ */
|
|
37969
|
+
`), /* @__PURE__ */ import_react10.default.createElement("div", { style: styles.container }, /* @__PURE__ */ import_react10.default.createElement("div", { style: styles.rightBorder1 }), /* @__PURE__ */ import_react10.default.createElement("div", { style: styles.rightBorder2 }), /* @__PURE__ */ import_react10.default.createElement("div", { style: styles.rightBorder3 }), /* @__PURE__ */ import_react10.default.createElement("div", { style: styles.leftBorder1 }), /* @__PURE__ */ import_react10.default.createElement("div", { style: styles.leftBorder2 }), /* @__PURE__ */ import_react10.default.createElement("div", { style: styles.leftBorder3 }), /* @__PURE__ */ import_react10.default.createElement("div", { style: styles.cornerTopLeft }), /* @__PURE__ */ import_react10.default.createElement("div", { style: styles.cornerTopRight }), /* @__PURE__ */ import_react10.default.createElement("div", { style: styles.cornerBottomRight }), /* @__PURE__ */ import_react10.default.createElement("div", { style: styles.cornerBottomLeft })));
|
|
37869
37970
|
};
|
|
37870
37971
|
var border_glow_default = BorderGlow;
|
|
37871
37972
|
|
|
37872
37973
|
// src/components/voice-intensity-visualizer.tsx
|
|
37873
|
-
var
|
|
37974
|
+
var import_react12 = __toESM(require("react"));
|
|
37874
37975
|
|
|
37875
37976
|
// node_modules/@livekit/components-react/dist/hooks-C2Bp5v2q.mjs
|
|
37876
37977
|
var r2 = __toESM(require("react"), 1);
|
|
@@ -39516,7 +39617,7 @@ function Yt(e3, t = {}) {
|
|
|
39516
39617
|
|
|
39517
39618
|
// node_modules/@livekit/components-react/dist/components-Bz2b1Fa9.mjs
|
|
39518
39619
|
var e2 = __toESM(require("react"), 1);
|
|
39519
|
-
var
|
|
39620
|
+
var import_react11 = require("react");
|
|
39520
39621
|
init_livekit_client_esm();
|
|
39521
39622
|
var Y;
|
|
39522
39623
|
var ue;
|
|
@@ -39611,8 +39712,8 @@ var Dt = (t) => {
|
|
|
39611
39712
|
};
|
|
39612
39713
|
var fe2 = (t) => [[Math.floor(t / 2)], [-1]];
|
|
39613
39714
|
var Ut2 = (t, n, a) => {
|
|
39614
|
-
const [r3, c] = (0,
|
|
39615
|
-
(0,
|
|
39715
|
+
const [r3, c] = (0, import_react11.useState)(0), [s, o2] = (0, import_react11.useState)([[]]);
|
|
39716
|
+
(0, import_react11.useEffect)(() => {
|
|
39616
39717
|
if (t === "thinking")
|
|
39617
39718
|
o2(fe2(n));
|
|
39618
39719
|
else if (t === "connecting" || t === "initializing") {
|
|
@@ -39621,8 +39722,8 @@ var Ut2 = (t, n, a) => {
|
|
|
39621
39722
|
} else o2(t === "listening" ? fe2(n) : t === void 0 || t === "speaking" ? [new Array(n).fill(0).map((i2, u) => u)] : [[]]);
|
|
39622
39723
|
c(0);
|
|
39623
39724
|
}, [t, n]);
|
|
39624
|
-
const l = (0,
|
|
39625
|
-
return (0,
|
|
39725
|
+
const l = (0, import_react11.useRef)(null);
|
|
39726
|
+
return (0, import_react11.useEffect)(() => {
|
|
39626
39727
|
let i2 = performance.now();
|
|
39627
39728
|
const u = (d) => {
|
|
39628
39729
|
d - i2 >= a && (c((f) => f + 1), i2 = d), l.current = requestAnimationFrame(u);
|
|
@@ -39692,8 +39793,8 @@ var Xt = /* @__PURE__ */ e2.forwardRef(
|
|
|
39692
39793
|
init_livekit_client_esm();
|
|
39693
39794
|
init_webrtc_service();
|
|
39694
39795
|
var VoiceIntensityWithRoom = (props) => {
|
|
39695
|
-
const [room2, setRoom] = (0,
|
|
39696
|
-
(0,
|
|
39796
|
+
const [room2, setRoom] = (0, import_react12.useState)(null);
|
|
39797
|
+
(0, import_react12.useEffect)(() => {
|
|
39697
39798
|
if (props.isActive) {
|
|
39698
39799
|
const currentRoom = getRoom();
|
|
39699
39800
|
if (currentRoom) {
|
|
@@ -39706,7 +39807,7 @@ var VoiceIntensityWithRoom = (props) => {
|
|
|
39706
39807
|
if (!room2) {
|
|
39707
39808
|
return null;
|
|
39708
39809
|
}
|
|
39709
|
-
return /* @__PURE__ */
|
|
39810
|
+
return /* @__PURE__ */ import_react12.default.createElement(Wn.Provider, { value: room2 }, /* @__PURE__ */ import_react12.default.createElement(VoiceIntensityBars, { ...props }));
|
|
39710
39811
|
};
|
|
39711
39812
|
var VoiceIntensityBars = ({
|
|
39712
39813
|
isActive,
|
|
@@ -39769,7 +39870,7 @@ var VoiceIntensityBars = ({
|
|
|
39769
39870
|
if (!trackRef) {
|
|
39770
39871
|
return null;
|
|
39771
39872
|
}
|
|
39772
|
-
return /* @__PURE__ */
|
|
39873
|
+
return /* @__PURE__ */ import_react12.default.createElement(
|
|
39773
39874
|
"div",
|
|
39774
39875
|
{
|
|
39775
39876
|
className: `voice-intensity-visualizer ${className}`,
|
|
@@ -39786,16 +39887,21 @@ var VoiceIntensityBars = ({
|
|
|
39786
39887
|
pointerEvents: "none"
|
|
39787
39888
|
}
|
|
39788
39889
|
},
|
|
39789
|
-
/* @__PURE__ */
|
|
39890
|
+
/* @__PURE__ */ import_react12.default.createElement(
|
|
39790
39891
|
Xt,
|
|
39791
39892
|
{
|
|
39792
39893
|
barCount,
|
|
39793
39894
|
state: "speaking",
|
|
39794
39895
|
options: { minHeight },
|
|
39795
39896
|
trackRef,
|
|
39796
|
-
|
|
39897
|
+
style: {
|
|
39898
|
+
display: "flex",
|
|
39899
|
+
alignItems: "center",
|
|
39900
|
+
justifyContent: "center",
|
|
39901
|
+
gap: "0.25rem"
|
|
39902
|
+
}
|
|
39797
39903
|
},
|
|
39798
|
-
/* @__PURE__ */
|
|
39904
|
+
/* @__PURE__ */ import_react12.default.createElement("span", { className: "cuekit-voice-intensity-bar" })
|
|
39799
39905
|
)
|
|
39800
39906
|
);
|
|
39801
39907
|
};
|
|
@@ -39803,12 +39909,62 @@ var VoiceIntensityVisualizer = VoiceIntensityWithRoom;
|
|
|
39803
39909
|
|
|
39804
39910
|
// src/components/mic-button.tsx
|
|
39805
39911
|
init_webrtc_service();
|
|
39912
|
+
|
|
39913
|
+
// src/components/svgs/mic.tsx
|
|
39914
|
+
var import_react13 = __toESM(require("react"));
|
|
39915
|
+
var MicIcon = ({ width = 24, height = 24, className, ...props }) => {
|
|
39916
|
+
return /* @__PURE__ */ import_react13.default.createElement(
|
|
39917
|
+
"svg",
|
|
39918
|
+
{
|
|
39919
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
39920
|
+
width,
|
|
39921
|
+
height,
|
|
39922
|
+
viewBox: "0 0 24 24",
|
|
39923
|
+
fill: "none",
|
|
39924
|
+
stroke: "currentColor",
|
|
39925
|
+
"stroke-width": "2",
|
|
39926
|
+
"stroke-linecap": "round",
|
|
39927
|
+
"stroke-linejoin": "round",
|
|
39928
|
+
className,
|
|
39929
|
+
...props
|
|
39930
|
+
},
|
|
39931
|
+
/* @__PURE__ */ import_react13.default.createElement("path", { d: "M12 19v3" }),
|
|
39932
|
+
/* @__PURE__ */ import_react13.default.createElement("path", { d: "M19 10v2a7 7 0 0 1-14 0v-2" }),
|
|
39933
|
+
/* @__PURE__ */ import_react13.default.createElement("rect", { x: "9", y: "2", width: "6", height: "13", rx: "3" })
|
|
39934
|
+
);
|
|
39935
|
+
};
|
|
39936
|
+
var mic_default = MicIcon;
|
|
39937
|
+
|
|
39938
|
+
// src/components/svgs/loader.tsx
|
|
39939
|
+
var import_react14 = __toESM(require("react"));
|
|
39940
|
+
var LoaderIcon = ({ width = 24, height = 24, className, ...props }) => {
|
|
39941
|
+
return /* @__PURE__ */ import_react14.default.createElement(
|
|
39942
|
+
"svg",
|
|
39943
|
+
{
|
|
39944
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
39945
|
+
width: "24",
|
|
39946
|
+
height: "24",
|
|
39947
|
+
viewBox: "0 0 24 24",
|
|
39948
|
+
fill: "none",
|
|
39949
|
+
stroke: "currentColor",
|
|
39950
|
+
"stroke-width": "2",
|
|
39951
|
+
"stroke-linecap": "round",
|
|
39952
|
+
"stroke-linejoin": "round",
|
|
39953
|
+
className,
|
|
39954
|
+
...props
|
|
39955
|
+
},
|
|
39956
|
+
/* @__PURE__ */ import_react14.default.createElement("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" })
|
|
39957
|
+
);
|
|
39958
|
+
};
|
|
39959
|
+
var loader_default = LoaderIcon;
|
|
39960
|
+
|
|
39961
|
+
// src/components/mic-button.tsx
|
|
39806
39962
|
var chatState = {
|
|
39807
39963
|
isOpen: false,
|
|
39808
39964
|
isMinimized: false
|
|
39809
39965
|
};
|
|
39810
39966
|
var VoiceIntensityWrapper = ({ active, buttonSize }) => {
|
|
39811
|
-
return /* @__PURE__ */
|
|
39967
|
+
return /* @__PURE__ */ import_react15.default.createElement(
|
|
39812
39968
|
VoiceIntensityVisualizer,
|
|
39813
39969
|
{
|
|
39814
39970
|
isActive: active,
|
|
@@ -39832,19 +39988,19 @@ var MicButton = ({
|
|
|
39832
39988
|
showBorderGlow = false
|
|
39833
39989
|
}) => {
|
|
39834
39990
|
const { apiKey, appId } = useQubeContext();
|
|
39835
|
-
const [showBodyGlow, setShowBodyGlow] = (0,
|
|
39836
|
-
const [currentTheme, setCurrentTheme] = (0,
|
|
39837
|
-
const [isChatOpen, setIsChatOpen] = (0,
|
|
39838
|
-
const [isChatMinimized, setIsChatMinimized] = (0,
|
|
39839
|
-
(0,
|
|
39991
|
+
const [showBodyGlow, setShowBodyGlow] = (0, import_react15.useState)(false);
|
|
39992
|
+
const [currentTheme, setCurrentTheme] = (0, import_react15.useState)("dark");
|
|
39993
|
+
const [isChatOpen, setIsChatOpen] = (0, import_react15.useState)(chatState.isOpen);
|
|
39994
|
+
const [isChatMinimized, setIsChatMinimized] = (0, import_react15.useState)(chatState.isMinimized);
|
|
39995
|
+
(0, import_react15.useEffect)(() => {
|
|
39840
39996
|
chatState.isOpen = isChatOpen;
|
|
39841
39997
|
chatState.isMinimized = isChatMinimized;
|
|
39842
39998
|
}, [isChatOpen, isChatMinimized]);
|
|
39843
|
-
const audioContainerRef2 = (0,
|
|
39844
|
-
const silenceTimerRef = (0,
|
|
39845
|
-
const aiSpeakingRef = (0,
|
|
39846
|
-
const aiSpeechTimeoutRef = (0,
|
|
39847
|
-
const activeAITracksRef = (0,
|
|
39999
|
+
const audioContainerRef2 = (0, import_react15.useRef)(null);
|
|
40000
|
+
const silenceTimerRef = (0, import_react15.useRef)(null);
|
|
40001
|
+
const aiSpeakingRef = (0, import_react15.useRef)(false);
|
|
40002
|
+
const aiSpeechTimeoutRef = (0, import_react15.useRef)(null);
|
|
40003
|
+
const activeAITracksRef = (0, import_react15.useRef)(/* @__PURE__ */ new Set());
|
|
39848
40004
|
const {
|
|
39849
40005
|
isConnected: isConnected4,
|
|
39850
40006
|
isConnecting,
|
|
@@ -39873,10 +40029,10 @@ var MicButton = ({
|
|
|
39873
40029
|
onAISpeechEnd: (trackId) => handleAISpeech(false, trackId),
|
|
39874
40030
|
appId
|
|
39875
40031
|
});
|
|
39876
|
-
(0,
|
|
40032
|
+
(0, import_react15.useEffect)(() => {
|
|
39877
40033
|
console.log("\u{1F3A4} MicButton received messages:", JSON.stringify(messageManagerMessages, null, 2));
|
|
39878
40034
|
}, [messageManagerMessages]);
|
|
39879
|
-
(0,
|
|
40035
|
+
(0, import_react15.useEffect)(() => {
|
|
39880
40036
|
const checkTheme = () => {
|
|
39881
40037
|
if (typeof document !== "undefined") {
|
|
39882
40038
|
let newTheme;
|
|
@@ -39899,31 +40055,31 @@ var MicButton = ({
|
|
|
39899
40055
|
return () => observer.disconnect();
|
|
39900
40056
|
}
|
|
39901
40057
|
}, [defaultTheme]);
|
|
39902
|
-
const openChat = (0,
|
|
40058
|
+
const openChat = (0, import_react15.useCallback)(() => {
|
|
39903
40059
|
setIsChatOpen(true);
|
|
39904
40060
|
setIsChatMinimized(false);
|
|
39905
40061
|
}, []);
|
|
39906
|
-
const minimizeChat = (0,
|
|
40062
|
+
const minimizeChat = (0, import_react15.useCallback)(() => {
|
|
39907
40063
|
setIsChatMinimized(true);
|
|
39908
40064
|
if (showBorderGlow) {
|
|
39909
40065
|
setShowBodyGlow(false);
|
|
39910
40066
|
}
|
|
39911
40067
|
}, [showBorderGlow]);
|
|
39912
|
-
const restoreChat = (0,
|
|
40068
|
+
const restoreChat = (0, import_react15.useCallback)(() => {
|
|
39913
40069
|
setIsChatMinimized(false);
|
|
39914
40070
|
setIsChatOpen(true);
|
|
39915
40071
|
if (showBorderGlow && (micState === "listening" || micState === "thinking" || micState === "replying")) {
|
|
39916
40072
|
setShowBodyGlow(true);
|
|
39917
40073
|
}
|
|
39918
40074
|
}, [showBorderGlow, micState]);
|
|
39919
|
-
const closeChat = (0,
|
|
40075
|
+
const closeChat = (0, import_react15.useCallback)(() => {
|
|
39920
40076
|
setIsChatOpen(false);
|
|
39921
40077
|
setIsChatMinimized(false);
|
|
39922
40078
|
if (showBorderGlow) {
|
|
39923
40079
|
setShowBodyGlow(false);
|
|
39924
40080
|
}
|
|
39925
40081
|
}, [showBorderGlow]);
|
|
39926
|
-
const handleAISpeech = (0,
|
|
40082
|
+
const handleAISpeech = (0, import_react15.useCallback)(
|
|
39927
40083
|
(isSpeaking, trackId) => {
|
|
39928
40084
|
console.log("\u{1F3A4} MicButton: ===== AI SPEECH EVENT START =====");
|
|
39929
40085
|
console.log("\u{1F3A4} MicButton: Event type:", isSpeaking ? "START" : "END");
|
|
@@ -39990,7 +40146,7 @@ var MicButton = ({
|
|
|
39990
40146
|
},
|
|
39991
40147
|
[status, micState, isConnected4]
|
|
39992
40148
|
);
|
|
39993
|
-
(0,
|
|
40149
|
+
(0, import_react15.useEffect)(() => {
|
|
39994
40150
|
if (audioContainerRef2.current) {
|
|
39995
40151
|
console.log("\u{1F3A4} MicButton: Setting up audio container on mount");
|
|
39996
40152
|
setAudioContainer(audioContainerRef2);
|
|
@@ -40019,14 +40175,14 @@ var MicButton = ({
|
|
|
40019
40175
|
}
|
|
40020
40176
|
return isConnected5 ? "Ready" : "Connecting...";
|
|
40021
40177
|
};
|
|
40022
|
-
(0,
|
|
40178
|
+
(0, import_react15.useEffect)(() => {
|
|
40023
40179
|
if (isConnected4) {
|
|
40024
40180
|
console.log("\u{1F3A4} MicButton: WebRTC and SSE connections established - ready for commands");
|
|
40025
40181
|
} else {
|
|
40026
40182
|
console.log("\u{1F3A4} MicButton: WebRTC not yet connected - ignoring speech");
|
|
40027
40183
|
}
|
|
40028
40184
|
}, [isConnected4]);
|
|
40029
|
-
(0,
|
|
40185
|
+
(0, import_react15.useEffect)(() => {
|
|
40030
40186
|
console.log("\u{1F3A4} MicButton: Auto-open check:", {
|
|
40031
40187
|
isConnected: isConnected4,
|
|
40032
40188
|
chatIsOpen: isChatOpen
|
|
@@ -40036,13 +40192,13 @@ var MicButton = ({
|
|
|
40036
40192
|
openChat();
|
|
40037
40193
|
}
|
|
40038
40194
|
}, [isConnected4, isChatOpen, openChat]);
|
|
40039
|
-
(0,
|
|
40195
|
+
(0, import_react15.useEffect)(() => {
|
|
40040
40196
|
if (messageManagerMessages.length > 0 && !isChatOpen) {
|
|
40041
40197
|
console.log("\u{1F3A4} MicButton: Auto-opening chat popup due to messages");
|
|
40042
40198
|
openChat();
|
|
40043
40199
|
}
|
|
40044
40200
|
}, [messageManagerMessages.length, isChatOpen, openChat]);
|
|
40045
|
-
const handleMicClick = (0,
|
|
40201
|
+
const handleMicClick = (0, import_react15.useCallback)(() => {
|
|
40046
40202
|
const shouldStop = micState === "listening" && isConnected4;
|
|
40047
40203
|
if (shouldStop) {
|
|
40048
40204
|
console.log("\u{1F3A4} MicButton: User wants to stop - closing everything");
|
|
@@ -40076,7 +40232,7 @@ var MicButton = ({
|
|
|
40076
40232
|
openChat,
|
|
40077
40233
|
showBorderGlow
|
|
40078
40234
|
]);
|
|
40079
|
-
(0,
|
|
40235
|
+
(0, import_react15.useEffect)(() => {
|
|
40080
40236
|
if (!isConnected4) {
|
|
40081
40237
|
return;
|
|
40082
40238
|
}
|
|
@@ -40139,7 +40295,7 @@ var MicButton = ({
|
|
|
40139
40295
|
...imageStyle
|
|
40140
40296
|
};
|
|
40141
40297
|
const animatedImageStyle = micState === "thinking" ? { ...baseImageStyle, animation: "spin 1s linear infinite" } : micState === "replying" ? { ...baseImageStyle, animation: "pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite" } : baseImageStyle;
|
|
40142
|
-
return /* @__PURE__ */
|
|
40298
|
+
return /* @__PURE__ */ import_react15.default.createElement("img", { src: imageSource, alt: "Voice Assistant", style: animatedImageStyle });
|
|
40143
40299
|
}
|
|
40144
40300
|
const iconStyle = {
|
|
40145
40301
|
width: `100%`,
|
|
@@ -40149,13 +40305,13 @@ var MicButton = ({
|
|
|
40149
40305
|
};
|
|
40150
40306
|
switch (micState) {
|
|
40151
40307
|
case "thinking":
|
|
40152
|
-
return /* @__PURE__ */
|
|
40308
|
+
return /* @__PURE__ */ import_react15.default.createElement(loader_default, { style: { ...iconStyle, animation: "spin 1s linear infinite" } });
|
|
40153
40309
|
case "replying":
|
|
40154
|
-
return /* @__PURE__ */
|
|
40310
|
+
return /* @__PURE__ */ import_react15.default.createElement(VoiceIntensityWrapper, { active: true, buttonSize });
|
|
40155
40311
|
case "listening":
|
|
40156
|
-
return /* @__PURE__ */
|
|
40312
|
+
return /* @__PURE__ */ import_react15.default.createElement(VoiceIntensityWrapper, { active: true, buttonSize });
|
|
40157
40313
|
default:
|
|
40158
|
-
return /* @__PURE__ */
|
|
40314
|
+
return /* @__PURE__ */ import_react15.default.createElement(mic_default, { style: iconStyle });
|
|
40159
40315
|
}
|
|
40160
40316
|
};
|
|
40161
40317
|
const getPositionStyle = () => {
|
|
@@ -40235,7 +40391,7 @@ var MicButton = ({
|
|
|
40235
40391
|
}
|
|
40236
40392
|
return baseStyle;
|
|
40237
40393
|
};
|
|
40238
|
-
return /* @__PURE__ */
|
|
40394
|
+
return /* @__PURE__ */ import_react15.default.createElement(import_react15.default.Fragment, null, /* @__PURE__ */ import_react15.default.createElement("div", { "data-cuekit-ignore": true, style: { ...buttonStyles.container, ...getPositionStyle() } }, /* @__PURE__ */ import_react15.default.createElement("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", gap: "8px" } }, /* @__PURE__ */ import_react15.default.createElement(
|
|
40239
40395
|
"button",
|
|
40240
40396
|
{
|
|
40241
40397
|
"data-testid": "ignore",
|
|
@@ -40256,8 +40412,8 @@ var MicButton = ({
|
|
|
40256
40412
|
},
|
|
40257
40413
|
"aria-label": micState === "thinking" ? "Processing..." : micState === "replying" ? "AI is responding..." : isListening ? "Stop listening" : "Start listening"
|
|
40258
40414
|
},
|
|
40259
|
-
/* @__PURE__ */
|
|
40260
|
-
), hasText && text7 && /* @__PURE__ */
|
|
40415
|
+
/* @__PURE__ */ import_react15.default.createElement("div", { style: buttonStyles.iconContainer }, getIcon())
|
|
40416
|
+
), hasText && text7 && /* @__PURE__ */ import_react15.default.createElement(
|
|
40261
40417
|
"div",
|
|
40262
40418
|
{
|
|
40263
40419
|
style: {
|
|
@@ -40278,8 +40434,8 @@ var MicButton = ({
|
|
|
40278
40434
|
...textStyle
|
|
40279
40435
|
}
|
|
40280
40436
|
},
|
|
40281
|
-
/* @__PURE__ */
|
|
40282
|
-
))), /* @__PURE__ */
|
|
40437
|
+
/* @__PURE__ */ import_react15.default.createElement("span", null, text7)
|
|
40438
|
+
))), /* @__PURE__ */ import_react15.default.createElement(
|
|
40283
40439
|
ChatPopup,
|
|
40284
40440
|
{
|
|
40285
40441
|
isOpen: isChatOpen,
|
|
@@ -40302,7 +40458,7 @@ var MicButton = ({
|
|
|
40302
40458
|
status: getUserFriendlyStatus(micState, isConnected4 ?? false),
|
|
40303
40459
|
anchor: { position: screenPosition, bottom: bottomSpace, size: buttonSize }
|
|
40304
40460
|
}
|
|
40305
|
-
), isChatOpen && isChatMinimized && /* @__PURE__ */
|
|
40461
|
+
), isChatOpen && isChatMinimized && /* @__PURE__ */ import_react15.default.createElement(
|
|
40306
40462
|
"button",
|
|
40307
40463
|
{
|
|
40308
40464
|
onClick: restoreChat,
|
|
@@ -40323,6 +40479,6 @@ var MicButton = ({
|
|
|
40323
40479
|
className: `cuekit-voice-popup ${currentTheme === "dark" ? "cuekit-dark" : ""}`,
|
|
40324
40480
|
"aria-label": "Open chat"
|
|
40325
40481
|
},
|
|
40326
|
-
/* @__PURE__ */
|
|
40327
|
-
), /* @__PURE__ */
|
|
40482
|
+
/* @__PURE__ */ import_react15.default.createElement("span", { style: { fontSize: 12, fontWeight: 600, color: "hsl(var(--voice-text))" } }, "Open chat")
|
|
40483
|
+
), /* @__PURE__ */ import_react15.default.createElement("div", { ref: audioContainerRef2, style: { display: "none" } }), showBorderGlow && showBodyGlow && /* @__PURE__ */ import_react15.default.createElement(border_glow_default, { isActive: true }));
|
|
40328
40484
|
};
|