@cuekit-ai/react 1.3.1 → 1.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-PLOG3DEN.mjs → chunk-ZGHSIEXZ.mjs} +132 -162
- package/dist/index.d.mts +22 -13
- package/dist/index.d.ts +22 -13
- package/dist/index.js +909 -246
- package/dist/index.mjs +829 -132
- package/dist/{webrtc-service-BHI4M7YJ.mjs → webrtc-service-SDVOO4LS.mjs} +1 -1
- package/package.json +4 -2
package/dist/index.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ConnectionState,
|
|
3
3
|
GlobalStore,
|
|
4
|
-
Participant,
|
|
5
4
|
ParticipantEvent,
|
|
6
5
|
RoomEvent,
|
|
7
6
|
Track,
|
|
8
7
|
WEBRTC_BACKEND_SERVER_URL,
|
|
9
8
|
__commonJS,
|
|
10
9
|
__export,
|
|
10
|
+
__require,
|
|
11
11
|
__toESM,
|
|
12
12
|
_apiKey,
|
|
13
13
|
_appId,
|
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
setServerUrl,
|
|
35
35
|
setWebRTCCallbacks,
|
|
36
36
|
setWebRTCConfig
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-ZGHSIEXZ.mjs";
|
|
38
38
|
|
|
39
39
|
// node_modules/inline-style-parser/index.js
|
|
40
40
|
var require_inline_style_parser = __commonJS({
|
|
@@ -366,6 +366,802 @@ var require_extend = __commonJS({
|
|
|
366
366
|
}
|
|
367
367
|
});
|
|
368
368
|
|
|
369
|
+
// (disabled):crypto
|
|
370
|
+
var require_crypto = __commonJS({
|
|
371
|
+
"(disabled):crypto"() {
|
|
372
|
+
"use strict";
|
|
373
|
+
}
|
|
374
|
+
});
|
|
375
|
+
|
|
376
|
+
// node_modules/crypto-js/core.js
|
|
377
|
+
var require_core = __commonJS({
|
|
378
|
+
"node_modules/crypto-js/core.js"(exports, module) {
|
|
379
|
+
"use strict";
|
|
380
|
+
(function(root4, factory) {
|
|
381
|
+
if (typeof exports === "object") {
|
|
382
|
+
module.exports = exports = factory();
|
|
383
|
+
} else if (typeof define === "function" && define.amd) {
|
|
384
|
+
define([], factory);
|
|
385
|
+
} else {
|
|
386
|
+
root4.CryptoJS = factory();
|
|
387
|
+
}
|
|
388
|
+
})(exports, function() {
|
|
389
|
+
var CryptoJS = CryptoJS || function(Math2, undefined2) {
|
|
390
|
+
var crypto;
|
|
391
|
+
if (typeof window !== "undefined" && window.crypto) {
|
|
392
|
+
crypto = window.crypto;
|
|
393
|
+
}
|
|
394
|
+
if (typeof self !== "undefined" && self.crypto) {
|
|
395
|
+
crypto = self.crypto;
|
|
396
|
+
}
|
|
397
|
+
if (typeof globalThis !== "undefined" && globalThis.crypto) {
|
|
398
|
+
crypto = globalThis.crypto;
|
|
399
|
+
}
|
|
400
|
+
if (!crypto && typeof window !== "undefined" && window.msCrypto) {
|
|
401
|
+
crypto = window.msCrypto;
|
|
402
|
+
}
|
|
403
|
+
if (!crypto && typeof global !== "undefined" && global.crypto) {
|
|
404
|
+
crypto = global.crypto;
|
|
405
|
+
}
|
|
406
|
+
if (!crypto && typeof __require === "function") {
|
|
407
|
+
try {
|
|
408
|
+
crypto = require_crypto();
|
|
409
|
+
} catch (err) {
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
var cryptoSecureRandomInt = function() {
|
|
413
|
+
if (crypto) {
|
|
414
|
+
if (typeof crypto.getRandomValues === "function") {
|
|
415
|
+
try {
|
|
416
|
+
return crypto.getRandomValues(new Uint32Array(1))[0];
|
|
417
|
+
} catch (err) {
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
if (typeof crypto.randomBytes === "function") {
|
|
421
|
+
try {
|
|
422
|
+
return crypto.randomBytes(4).readInt32LE();
|
|
423
|
+
} catch (err) {
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
throw new Error("Native crypto module could not be used to get secure random number.");
|
|
428
|
+
};
|
|
429
|
+
var create2 = Object.create || /* @__PURE__ */ function() {
|
|
430
|
+
function F2() {
|
|
431
|
+
}
|
|
432
|
+
return function(obj) {
|
|
433
|
+
var subtype;
|
|
434
|
+
F2.prototype = obj;
|
|
435
|
+
subtype = new F2();
|
|
436
|
+
F2.prototype = null;
|
|
437
|
+
return subtype;
|
|
438
|
+
};
|
|
439
|
+
}();
|
|
440
|
+
var C = {};
|
|
441
|
+
var C_lib = C.lib = {};
|
|
442
|
+
var Base = C_lib.Base = /* @__PURE__ */ function() {
|
|
443
|
+
return {
|
|
444
|
+
/**
|
|
445
|
+
* Creates a new object that inherits from this object.
|
|
446
|
+
*
|
|
447
|
+
* @param {Object} overrides Properties to copy into the new object.
|
|
448
|
+
*
|
|
449
|
+
* @return {Object} The new object.
|
|
450
|
+
*
|
|
451
|
+
* @static
|
|
452
|
+
*
|
|
453
|
+
* @example
|
|
454
|
+
*
|
|
455
|
+
* var MyType = CryptoJS.lib.Base.extend({
|
|
456
|
+
* field: 'value',
|
|
457
|
+
*
|
|
458
|
+
* method: function () {
|
|
459
|
+
* }
|
|
460
|
+
* });
|
|
461
|
+
*/
|
|
462
|
+
extend: function(overrides) {
|
|
463
|
+
var subtype = create2(this);
|
|
464
|
+
if (overrides) {
|
|
465
|
+
subtype.mixIn(overrides);
|
|
466
|
+
}
|
|
467
|
+
if (!subtype.hasOwnProperty("init") || this.init === subtype.init) {
|
|
468
|
+
subtype.init = function() {
|
|
469
|
+
subtype.$super.init.apply(this, arguments);
|
|
470
|
+
};
|
|
471
|
+
}
|
|
472
|
+
subtype.init.prototype = subtype;
|
|
473
|
+
subtype.$super = this;
|
|
474
|
+
return subtype;
|
|
475
|
+
},
|
|
476
|
+
/**
|
|
477
|
+
* Extends this object and runs the init method.
|
|
478
|
+
* Arguments to create() will be passed to init().
|
|
479
|
+
*
|
|
480
|
+
* @return {Object} The new object.
|
|
481
|
+
*
|
|
482
|
+
* @static
|
|
483
|
+
*
|
|
484
|
+
* @example
|
|
485
|
+
*
|
|
486
|
+
* var instance = MyType.create();
|
|
487
|
+
*/
|
|
488
|
+
create: function() {
|
|
489
|
+
var instance = this.extend();
|
|
490
|
+
instance.init.apply(instance, arguments);
|
|
491
|
+
return instance;
|
|
492
|
+
},
|
|
493
|
+
/**
|
|
494
|
+
* Initializes a newly created object.
|
|
495
|
+
* Override this method to add some logic when your objects are created.
|
|
496
|
+
*
|
|
497
|
+
* @example
|
|
498
|
+
*
|
|
499
|
+
* var MyType = CryptoJS.lib.Base.extend({
|
|
500
|
+
* init: function () {
|
|
501
|
+
* // ...
|
|
502
|
+
* }
|
|
503
|
+
* });
|
|
504
|
+
*/
|
|
505
|
+
init: function() {
|
|
506
|
+
},
|
|
507
|
+
/**
|
|
508
|
+
* Copies properties into this object.
|
|
509
|
+
*
|
|
510
|
+
* @param {Object} properties The properties to mix in.
|
|
511
|
+
*
|
|
512
|
+
* @example
|
|
513
|
+
*
|
|
514
|
+
* MyType.mixIn({
|
|
515
|
+
* field: 'value'
|
|
516
|
+
* });
|
|
517
|
+
*/
|
|
518
|
+
mixIn: function(properties) {
|
|
519
|
+
for (var propertyName in properties) {
|
|
520
|
+
if (properties.hasOwnProperty(propertyName)) {
|
|
521
|
+
this[propertyName] = properties[propertyName];
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
if (properties.hasOwnProperty("toString")) {
|
|
525
|
+
this.toString = properties.toString;
|
|
526
|
+
}
|
|
527
|
+
},
|
|
528
|
+
/**
|
|
529
|
+
* Creates a copy of this object.
|
|
530
|
+
*
|
|
531
|
+
* @return {Object} The clone.
|
|
532
|
+
*
|
|
533
|
+
* @example
|
|
534
|
+
*
|
|
535
|
+
* var clone = instance.clone();
|
|
536
|
+
*/
|
|
537
|
+
clone: function() {
|
|
538
|
+
return this.init.prototype.extend(this);
|
|
539
|
+
}
|
|
540
|
+
};
|
|
541
|
+
}();
|
|
542
|
+
var WordArray = C_lib.WordArray = Base.extend({
|
|
543
|
+
/**
|
|
544
|
+
* Initializes a newly created word array.
|
|
545
|
+
*
|
|
546
|
+
* @param {Array} words (Optional) An array of 32-bit words.
|
|
547
|
+
* @param {number} sigBytes (Optional) The number of significant bytes in the words.
|
|
548
|
+
*
|
|
549
|
+
* @example
|
|
550
|
+
*
|
|
551
|
+
* var wordArray = CryptoJS.lib.WordArray.create();
|
|
552
|
+
* var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]);
|
|
553
|
+
* var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6);
|
|
554
|
+
*/
|
|
555
|
+
init: function(words, sigBytes) {
|
|
556
|
+
words = this.words = words || [];
|
|
557
|
+
if (sigBytes != undefined2) {
|
|
558
|
+
this.sigBytes = sigBytes;
|
|
559
|
+
} else {
|
|
560
|
+
this.sigBytes = words.length * 4;
|
|
561
|
+
}
|
|
562
|
+
},
|
|
563
|
+
/**
|
|
564
|
+
* Converts this word array to a string.
|
|
565
|
+
*
|
|
566
|
+
* @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex
|
|
567
|
+
*
|
|
568
|
+
* @return {string} The stringified word array.
|
|
569
|
+
*
|
|
570
|
+
* @example
|
|
571
|
+
*
|
|
572
|
+
* var string = wordArray + '';
|
|
573
|
+
* var string = wordArray.toString();
|
|
574
|
+
* var string = wordArray.toString(CryptoJS.enc.Utf8);
|
|
575
|
+
*/
|
|
576
|
+
toString: function(encoder) {
|
|
577
|
+
return (encoder || Hex).stringify(this);
|
|
578
|
+
},
|
|
579
|
+
/**
|
|
580
|
+
* Concatenates a word array to this word array.
|
|
581
|
+
*
|
|
582
|
+
* @param {WordArray} wordArray The word array to append.
|
|
583
|
+
*
|
|
584
|
+
* @return {WordArray} This word array.
|
|
585
|
+
*
|
|
586
|
+
* @example
|
|
587
|
+
*
|
|
588
|
+
* wordArray1.concat(wordArray2);
|
|
589
|
+
*/
|
|
590
|
+
concat: function(wordArray) {
|
|
591
|
+
var thisWords = this.words;
|
|
592
|
+
var thatWords = wordArray.words;
|
|
593
|
+
var thisSigBytes = this.sigBytes;
|
|
594
|
+
var thatSigBytes = wordArray.sigBytes;
|
|
595
|
+
this.clamp();
|
|
596
|
+
if (thisSigBytes % 4) {
|
|
597
|
+
for (var i2 = 0; i2 < thatSigBytes; i2++) {
|
|
598
|
+
var thatByte = thatWords[i2 >>> 2] >>> 24 - i2 % 4 * 8 & 255;
|
|
599
|
+
thisWords[thisSigBytes + i2 >>> 2] |= thatByte << 24 - (thisSigBytes + i2) % 4 * 8;
|
|
600
|
+
}
|
|
601
|
+
} else {
|
|
602
|
+
for (var j2 = 0; j2 < thatSigBytes; j2 += 4) {
|
|
603
|
+
thisWords[thisSigBytes + j2 >>> 2] = thatWords[j2 >>> 2];
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
this.sigBytes += thatSigBytes;
|
|
607
|
+
return this;
|
|
608
|
+
},
|
|
609
|
+
/**
|
|
610
|
+
* Removes insignificant bits.
|
|
611
|
+
*
|
|
612
|
+
* @example
|
|
613
|
+
*
|
|
614
|
+
* wordArray.clamp();
|
|
615
|
+
*/
|
|
616
|
+
clamp: function() {
|
|
617
|
+
var words = this.words;
|
|
618
|
+
var sigBytes = this.sigBytes;
|
|
619
|
+
words[sigBytes >>> 2] &= 4294967295 << 32 - sigBytes % 4 * 8;
|
|
620
|
+
words.length = Math2.ceil(sigBytes / 4);
|
|
621
|
+
},
|
|
622
|
+
/**
|
|
623
|
+
* Creates a copy of this word array.
|
|
624
|
+
*
|
|
625
|
+
* @return {WordArray} The clone.
|
|
626
|
+
*
|
|
627
|
+
* @example
|
|
628
|
+
*
|
|
629
|
+
* var clone = wordArray.clone();
|
|
630
|
+
*/
|
|
631
|
+
clone: function() {
|
|
632
|
+
var clone = Base.clone.call(this);
|
|
633
|
+
clone.words = this.words.slice(0);
|
|
634
|
+
return clone;
|
|
635
|
+
},
|
|
636
|
+
/**
|
|
637
|
+
* Creates a word array filled with random bytes.
|
|
638
|
+
*
|
|
639
|
+
* @param {number} nBytes The number of random bytes to generate.
|
|
640
|
+
*
|
|
641
|
+
* @return {WordArray} The random word array.
|
|
642
|
+
*
|
|
643
|
+
* @static
|
|
644
|
+
*
|
|
645
|
+
* @example
|
|
646
|
+
*
|
|
647
|
+
* var wordArray = CryptoJS.lib.WordArray.random(16);
|
|
648
|
+
*/
|
|
649
|
+
random: function(nBytes) {
|
|
650
|
+
var words = [];
|
|
651
|
+
for (var i2 = 0; i2 < nBytes; i2 += 4) {
|
|
652
|
+
words.push(cryptoSecureRandomInt());
|
|
653
|
+
}
|
|
654
|
+
return new WordArray.init(words, nBytes);
|
|
655
|
+
}
|
|
656
|
+
});
|
|
657
|
+
var C_enc = C.enc = {};
|
|
658
|
+
var Hex = C_enc.Hex = {
|
|
659
|
+
/**
|
|
660
|
+
* Converts a word array to a hex string.
|
|
661
|
+
*
|
|
662
|
+
* @param {WordArray} wordArray The word array.
|
|
663
|
+
*
|
|
664
|
+
* @return {string} The hex string.
|
|
665
|
+
*
|
|
666
|
+
* @static
|
|
667
|
+
*
|
|
668
|
+
* @example
|
|
669
|
+
*
|
|
670
|
+
* var hexString = CryptoJS.enc.Hex.stringify(wordArray);
|
|
671
|
+
*/
|
|
672
|
+
stringify: function(wordArray) {
|
|
673
|
+
var words = wordArray.words;
|
|
674
|
+
var sigBytes = wordArray.sigBytes;
|
|
675
|
+
var hexChars = [];
|
|
676
|
+
for (var i2 = 0; i2 < sigBytes; i2++) {
|
|
677
|
+
var bite = words[i2 >>> 2] >>> 24 - i2 % 4 * 8 & 255;
|
|
678
|
+
hexChars.push((bite >>> 4).toString(16));
|
|
679
|
+
hexChars.push((bite & 15).toString(16));
|
|
680
|
+
}
|
|
681
|
+
return hexChars.join("");
|
|
682
|
+
},
|
|
683
|
+
/**
|
|
684
|
+
* Converts a hex string to a word array.
|
|
685
|
+
*
|
|
686
|
+
* @param {string} hexStr The hex string.
|
|
687
|
+
*
|
|
688
|
+
* @return {WordArray} The word array.
|
|
689
|
+
*
|
|
690
|
+
* @static
|
|
691
|
+
*
|
|
692
|
+
* @example
|
|
693
|
+
*
|
|
694
|
+
* var wordArray = CryptoJS.enc.Hex.parse(hexString);
|
|
695
|
+
*/
|
|
696
|
+
parse: function(hexStr) {
|
|
697
|
+
var hexStrLength = hexStr.length;
|
|
698
|
+
var words = [];
|
|
699
|
+
for (var i2 = 0; i2 < hexStrLength; i2 += 2) {
|
|
700
|
+
words[i2 >>> 3] |= parseInt(hexStr.substr(i2, 2), 16) << 24 - i2 % 8 * 4;
|
|
701
|
+
}
|
|
702
|
+
return new WordArray.init(words, hexStrLength / 2);
|
|
703
|
+
}
|
|
704
|
+
};
|
|
705
|
+
var Latin1 = C_enc.Latin1 = {
|
|
706
|
+
/**
|
|
707
|
+
* Converts a word array to a Latin1 string.
|
|
708
|
+
*
|
|
709
|
+
* @param {WordArray} wordArray The word array.
|
|
710
|
+
*
|
|
711
|
+
* @return {string} The Latin1 string.
|
|
712
|
+
*
|
|
713
|
+
* @static
|
|
714
|
+
*
|
|
715
|
+
* @example
|
|
716
|
+
*
|
|
717
|
+
* var latin1String = CryptoJS.enc.Latin1.stringify(wordArray);
|
|
718
|
+
*/
|
|
719
|
+
stringify: function(wordArray) {
|
|
720
|
+
var words = wordArray.words;
|
|
721
|
+
var sigBytes = wordArray.sigBytes;
|
|
722
|
+
var latin1Chars = [];
|
|
723
|
+
for (var i2 = 0; i2 < sigBytes; i2++) {
|
|
724
|
+
var bite = words[i2 >>> 2] >>> 24 - i2 % 4 * 8 & 255;
|
|
725
|
+
latin1Chars.push(String.fromCharCode(bite));
|
|
726
|
+
}
|
|
727
|
+
return latin1Chars.join("");
|
|
728
|
+
},
|
|
729
|
+
/**
|
|
730
|
+
* Converts a Latin1 string to a word array.
|
|
731
|
+
*
|
|
732
|
+
* @param {string} latin1Str The Latin1 string.
|
|
733
|
+
*
|
|
734
|
+
* @return {WordArray} The word array.
|
|
735
|
+
*
|
|
736
|
+
* @static
|
|
737
|
+
*
|
|
738
|
+
* @example
|
|
739
|
+
*
|
|
740
|
+
* var wordArray = CryptoJS.enc.Latin1.parse(latin1String);
|
|
741
|
+
*/
|
|
742
|
+
parse: function(latin1Str) {
|
|
743
|
+
var latin1StrLength = latin1Str.length;
|
|
744
|
+
var words = [];
|
|
745
|
+
for (var i2 = 0; i2 < latin1StrLength; i2++) {
|
|
746
|
+
words[i2 >>> 2] |= (latin1Str.charCodeAt(i2) & 255) << 24 - i2 % 4 * 8;
|
|
747
|
+
}
|
|
748
|
+
return new WordArray.init(words, latin1StrLength);
|
|
749
|
+
}
|
|
750
|
+
};
|
|
751
|
+
var Utf8 = C_enc.Utf8 = {
|
|
752
|
+
/**
|
|
753
|
+
* Converts a word array to a UTF-8 string.
|
|
754
|
+
*
|
|
755
|
+
* @param {WordArray} wordArray The word array.
|
|
756
|
+
*
|
|
757
|
+
* @return {string} The UTF-8 string.
|
|
758
|
+
*
|
|
759
|
+
* @static
|
|
760
|
+
*
|
|
761
|
+
* @example
|
|
762
|
+
*
|
|
763
|
+
* var utf8String = CryptoJS.enc.Utf8.stringify(wordArray);
|
|
764
|
+
*/
|
|
765
|
+
stringify: function(wordArray) {
|
|
766
|
+
try {
|
|
767
|
+
return decodeURIComponent(escape(Latin1.stringify(wordArray)));
|
|
768
|
+
} catch (e2) {
|
|
769
|
+
throw new Error("Malformed UTF-8 data");
|
|
770
|
+
}
|
|
771
|
+
},
|
|
772
|
+
/**
|
|
773
|
+
* Converts a UTF-8 string to a word array.
|
|
774
|
+
*
|
|
775
|
+
* @param {string} utf8Str The UTF-8 string.
|
|
776
|
+
*
|
|
777
|
+
* @return {WordArray} The word array.
|
|
778
|
+
*
|
|
779
|
+
* @static
|
|
780
|
+
*
|
|
781
|
+
* @example
|
|
782
|
+
*
|
|
783
|
+
* var wordArray = CryptoJS.enc.Utf8.parse(utf8String);
|
|
784
|
+
*/
|
|
785
|
+
parse: function(utf8Str) {
|
|
786
|
+
return Latin1.parse(unescape(encodeURIComponent(utf8Str)));
|
|
787
|
+
}
|
|
788
|
+
};
|
|
789
|
+
var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({
|
|
790
|
+
/**
|
|
791
|
+
* Resets this block algorithm's data buffer to its initial state.
|
|
792
|
+
*
|
|
793
|
+
* @example
|
|
794
|
+
*
|
|
795
|
+
* bufferedBlockAlgorithm.reset();
|
|
796
|
+
*/
|
|
797
|
+
reset: function() {
|
|
798
|
+
this._data = new WordArray.init();
|
|
799
|
+
this._nDataBytes = 0;
|
|
800
|
+
},
|
|
801
|
+
/**
|
|
802
|
+
* Adds new data to this block algorithm's buffer.
|
|
803
|
+
*
|
|
804
|
+
* @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8.
|
|
805
|
+
*
|
|
806
|
+
* @example
|
|
807
|
+
*
|
|
808
|
+
* bufferedBlockAlgorithm._append('data');
|
|
809
|
+
* bufferedBlockAlgorithm._append(wordArray);
|
|
810
|
+
*/
|
|
811
|
+
_append: function(data) {
|
|
812
|
+
if (typeof data == "string") {
|
|
813
|
+
data = Utf8.parse(data);
|
|
814
|
+
}
|
|
815
|
+
this._data.concat(data);
|
|
816
|
+
this._nDataBytes += data.sigBytes;
|
|
817
|
+
},
|
|
818
|
+
/**
|
|
819
|
+
* Processes available data blocks.
|
|
820
|
+
*
|
|
821
|
+
* This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype.
|
|
822
|
+
*
|
|
823
|
+
* @param {boolean} doFlush Whether all blocks and partial blocks should be processed.
|
|
824
|
+
*
|
|
825
|
+
* @return {WordArray} The processed data.
|
|
826
|
+
*
|
|
827
|
+
* @example
|
|
828
|
+
*
|
|
829
|
+
* var processedData = bufferedBlockAlgorithm._process();
|
|
830
|
+
* var processedData = bufferedBlockAlgorithm._process(!!'flush');
|
|
831
|
+
*/
|
|
832
|
+
_process: function(doFlush) {
|
|
833
|
+
var processedWords;
|
|
834
|
+
var data = this._data;
|
|
835
|
+
var dataWords = data.words;
|
|
836
|
+
var dataSigBytes = data.sigBytes;
|
|
837
|
+
var blockSize = this.blockSize;
|
|
838
|
+
var blockSizeBytes = blockSize * 4;
|
|
839
|
+
var nBlocksReady = dataSigBytes / blockSizeBytes;
|
|
840
|
+
if (doFlush) {
|
|
841
|
+
nBlocksReady = Math2.ceil(nBlocksReady);
|
|
842
|
+
} else {
|
|
843
|
+
nBlocksReady = Math2.max((nBlocksReady | 0) - this._minBufferSize, 0);
|
|
844
|
+
}
|
|
845
|
+
var nWordsReady = nBlocksReady * blockSize;
|
|
846
|
+
var nBytesReady = Math2.min(nWordsReady * 4, dataSigBytes);
|
|
847
|
+
if (nWordsReady) {
|
|
848
|
+
for (var offset = 0; offset < nWordsReady; offset += blockSize) {
|
|
849
|
+
this._doProcessBlock(dataWords, offset);
|
|
850
|
+
}
|
|
851
|
+
processedWords = dataWords.splice(0, nWordsReady);
|
|
852
|
+
data.sigBytes -= nBytesReady;
|
|
853
|
+
}
|
|
854
|
+
return new WordArray.init(processedWords, nBytesReady);
|
|
855
|
+
},
|
|
856
|
+
/**
|
|
857
|
+
* Creates a copy of this object.
|
|
858
|
+
*
|
|
859
|
+
* @return {Object} The clone.
|
|
860
|
+
*
|
|
861
|
+
* @example
|
|
862
|
+
*
|
|
863
|
+
* var clone = bufferedBlockAlgorithm.clone();
|
|
864
|
+
*/
|
|
865
|
+
clone: function() {
|
|
866
|
+
var clone = Base.clone.call(this);
|
|
867
|
+
clone._data = this._data.clone();
|
|
868
|
+
return clone;
|
|
869
|
+
},
|
|
870
|
+
_minBufferSize: 0
|
|
871
|
+
});
|
|
872
|
+
var Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({
|
|
873
|
+
/**
|
|
874
|
+
* Configuration options.
|
|
875
|
+
*/
|
|
876
|
+
cfg: Base.extend(),
|
|
877
|
+
/**
|
|
878
|
+
* Initializes a newly created hasher.
|
|
879
|
+
*
|
|
880
|
+
* @param {Object} cfg (Optional) The configuration options to use for this hash computation.
|
|
881
|
+
*
|
|
882
|
+
* @example
|
|
883
|
+
*
|
|
884
|
+
* var hasher = CryptoJS.algo.SHA256.create();
|
|
885
|
+
*/
|
|
886
|
+
init: function(cfg) {
|
|
887
|
+
this.cfg = this.cfg.extend(cfg);
|
|
888
|
+
this.reset();
|
|
889
|
+
},
|
|
890
|
+
/**
|
|
891
|
+
* Resets this hasher to its initial state.
|
|
892
|
+
*
|
|
893
|
+
* @example
|
|
894
|
+
*
|
|
895
|
+
* hasher.reset();
|
|
896
|
+
*/
|
|
897
|
+
reset: function() {
|
|
898
|
+
BufferedBlockAlgorithm.reset.call(this);
|
|
899
|
+
this._doReset();
|
|
900
|
+
},
|
|
901
|
+
/**
|
|
902
|
+
* Updates this hasher with a message.
|
|
903
|
+
*
|
|
904
|
+
* @param {WordArray|string} messageUpdate The message to append.
|
|
905
|
+
*
|
|
906
|
+
* @return {Hasher} This hasher.
|
|
907
|
+
*
|
|
908
|
+
* @example
|
|
909
|
+
*
|
|
910
|
+
* hasher.update('message');
|
|
911
|
+
* hasher.update(wordArray);
|
|
912
|
+
*/
|
|
913
|
+
update: function(messageUpdate) {
|
|
914
|
+
this._append(messageUpdate);
|
|
915
|
+
this._process();
|
|
916
|
+
return this;
|
|
917
|
+
},
|
|
918
|
+
/**
|
|
919
|
+
* Finalizes the hash computation.
|
|
920
|
+
* Note that the finalize operation is effectively a destructive, read-once operation.
|
|
921
|
+
*
|
|
922
|
+
* @param {WordArray|string} messageUpdate (Optional) A final message update.
|
|
923
|
+
*
|
|
924
|
+
* @return {WordArray} The hash.
|
|
925
|
+
*
|
|
926
|
+
* @example
|
|
927
|
+
*
|
|
928
|
+
* var hash = hasher.finalize();
|
|
929
|
+
* var hash = hasher.finalize('message');
|
|
930
|
+
* var hash = hasher.finalize(wordArray);
|
|
931
|
+
*/
|
|
932
|
+
finalize: function(messageUpdate) {
|
|
933
|
+
if (messageUpdate) {
|
|
934
|
+
this._append(messageUpdate);
|
|
935
|
+
}
|
|
936
|
+
var hash = this._doFinalize();
|
|
937
|
+
return hash;
|
|
938
|
+
},
|
|
939
|
+
blockSize: 512 / 32,
|
|
940
|
+
/**
|
|
941
|
+
* Creates a shortcut function to a hasher's object interface.
|
|
942
|
+
*
|
|
943
|
+
* @param {Hasher} hasher The hasher to create a helper for.
|
|
944
|
+
*
|
|
945
|
+
* @return {Function} The shortcut function.
|
|
946
|
+
*
|
|
947
|
+
* @static
|
|
948
|
+
*
|
|
949
|
+
* @example
|
|
950
|
+
*
|
|
951
|
+
* var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256);
|
|
952
|
+
*/
|
|
953
|
+
_createHelper: function(hasher) {
|
|
954
|
+
return function(message, cfg) {
|
|
955
|
+
return new hasher.init(cfg).finalize(message);
|
|
956
|
+
};
|
|
957
|
+
},
|
|
958
|
+
/**
|
|
959
|
+
* Creates a shortcut function to the HMAC's object interface.
|
|
960
|
+
*
|
|
961
|
+
* @param {Hasher} hasher The hasher to use in this HMAC helper.
|
|
962
|
+
*
|
|
963
|
+
* @return {Function} The shortcut function.
|
|
964
|
+
*
|
|
965
|
+
* @static
|
|
966
|
+
*
|
|
967
|
+
* @example
|
|
968
|
+
*
|
|
969
|
+
* var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);
|
|
970
|
+
*/
|
|
971
|
+
_createHmacHelper: function(hasher) {
|
|
972
|
+
return function(message, key) {
|
|
973
|
+
return new C_algo.HMAC.init(hasher, key).finalize(message);
|
|
974
|
+
};
|
|
975
|
+
}
|
|
976
|
+
});
|
|
977
|
+
var C_algo = C.algo = {};
|
|
978
|
+
return C;
|
|
979
|
+
}(Math);
|
|
980
|
+
return CryptoJS;
|
|
981
|
+
});
|
|
982
|
+
}
|
|
983
|
+
});
|
|
984
|
+
|
|
985
|
+
// node_modules/crypto-js/md5.js
|
|
986
|
+
var require_md5 = __commonJS({
|
|
987
|
+
"node_modules/crypto-js/md5.js"(exports, module) {
|
|
988
|
+
"use strict";
|
|
989
|
+
(function(root4, factory) {
|
|
990
|
+
if (typeof exports === "object") {
|
|
991
|
+
module.exports = exports = factory(require_core());
|
|
992
|
+
} else if (typeof define === "function" && define.amd) {
|
|
993
|
+
define(["./core"], factory);
|
|
994
|
+
} else {
|
|
995
|
+
factory(root4.CryptoJS);
|
|
996
|
+
}
|
|
997
|
+
})(exports, function(CryptoJS) {
|
|
998
|
+
(function(Math2) {
|
|
999
|
+
var C = CryptoJS;
|
|
1000
|
+
var C_lib = C.lib;
|
|
1001
|
+
var WordArray = C_lib.WordArray;
|
|
1002
|
+
var Hasher = C_lib.Hasher;
|
|
1003
|
+
var C_algo = C.algo;
|
|
1004
|
+
var T = [];
|
|
1005
|
+
(function() {
|
|
1006
|
+
for (var i2 = 0; i2 < 64; i2++) {
|
|
1007
|
+
T[i2] = Math2.abs(Math2.sin(i2 + 1)) * 4294967296 | 0;
|
|
1008
|
+
}
|
|
1009
|
+
})();
|
|
1010
|
+
var MD52 = C_algo.MD5 = Hasher.extend({
|
|
1011
|
+
_doReset: function() {
|
|
1012
|
+
this._hash = new WordArray.init([
|
|
1013
|
+
1732584193,
|
|
1014
|
+
4023233417,
|
|
1015
|
+
2562383102,
|
|
1016
|
+
271733878
|
|
1017
|
+
]);
|
|
1018
|
+
},
|
|
1019
|
+
_doProcessBlock: function(M3, offset) {
|
|
1020
|
+
for (var i2 = 0; i2 < 16; i2++) {
|
|
1021
|
+
var offset_i = offset + i2;
|
|
1022
|
+
var M_offset_i = M3[offset_i];
|
|
1023
|
+
M3[offset_i] = (M_offset_i << 8 | M_offset_i >>> 24) & 16711935 | (M_offset_i << 24 | M_offset_i >>> 8) & 4278255360;
|
|
1024
|
+
}
|
|
1025
|
+
var H3 = this._hash.words;
|
|
1026
|
+
var M_offset_0 = M3[offset + 0];
|
|
1027
|
+
var M_offset_1 = M3[offset + 1];
|
|
1028
|
+
var M_offset_2 = M3[offset + 2];
|
|
1029
|
+
var M_offset_3 = M3[offset + 3];
|
|
1030
|
+
var M_offset_4 = M3[offset + 4];
|
|
1031
|
+
var M_offset_5 = M3[offset + 5];
|
|
1032
|
+
var M_offset_6 = M3[offset + 6];
|
|
1033
|
+
var M_offset_7 = M3[offset + 7];
|
|
1034
|
+
var M_offset_8 = M3[offset + 8];
|
|
1035
|
+
var M_offset_9 = M3[offset + 9];
|
|
1036
|
+
var M_offset_10 = M3[offset + 10];
|
|
1037
|
+
var M_offset_11 = M3[offset + 11];
|
|
1038
|
+
var M_offset_12 = M3[offset + 12];
|
|
1039
|
+
var M_offset_13 = M3[offset + 13];
|
|
1040
|
+
var M_offset_14 = M3[offset + 14];
|
|
1041
|
+
var M_offset_15 = M3[offset + 15];
|
|
1042
|
+
var a = H3[0];
|
|
1043
|
+
var b2 = H3[1];
|
|
1044
|
+
var c = H3[2];
|
|
1045
|
+
var d = H3[3];
|
|
1046
|
+
a = FF(a, b2, c, d, M_offset_0, 7, T[0]);
|
|
1047
|
+
d = FF(d, a, b2, c, M_offset_1, 12, T[1]);
|
|
1048
|
+
c = FF(c, d, a, b2, M_offset_2, 17, T[2]);
|
|
1049
|
+
b2 = FF(b2, c, d, a, M_offset_3, 22, T[3]);
|
|
1050
|
+
a = FF(a, b2, c, d, M_offset_4, 7, T[4]);
|
|
1051
|
+
d = FF(d, a, b2, c, M_offset_5, 12, T[5]);
|
|
1052
|
+
c = FF(c, d, a, b2, M_offset_6, 17, T[6]);
|
|
1053
|
+
b2 = FF(b2, c, d, a, M_offset_7, 22, T[7]);
|
|
1054
|
+
a = FF(a, b2, c, d, M_offset_8, 7, T[8]);
|
|
1055
|
+
d = FF(d, a, b2, c, M_offset_9, 12, T[9]);
|
|
1056
|
+
c = FF(c, d, a, b2, M_offset_10, 17, T[10]);
|
|
1057
|
+
b2 = FF(b2, c, d, a, M_offset_11, 22, T[11]);
|
|
1058
|
+
a = FF(a, b2, c, d, M_offset_12, 7, T[12]);
|
|
1059
|
+
d = FF(d, a, b2, c, M_offset_13, 12, T[13]);
|
|
1060
|
+
c = FF(c, d, a, b2, M_offset_14, 17, T[14]);
|
|
1061
|
+
b2 = FF(b2, c, d, a, M_offset_15, 22, T[15]);
|
|
1062
|
+
a = GG(a, b2, c, d, M_offset_1, 5, T[16]);
|
|
1063
|
+
d = GG(d, a, b2, c, M_offset_6, 9, T[17]);
|
|
1064
|
+
c = GG(c, d, a, b2, M_offset_11, 14, T[18]);
|
|
1065
|
+
b2 = GG(b2, c, d, a, M_offset_0, 20, T[19]);
|
|
1066
|
+
a = GG(a, b2, c, d, M_offset_5, 5, T[20]);
|
|
1067
|
+
d = GG(d, a, b2, c, M_offset_10, 9, T[21]);
|
|
1068
|
+
c = GG(c, d, a, b2, M_offset_15, 14, T[22]);
|
|
1069
|
+
b2 = GG(b2, c, d, a, M_offset_4, 20, T[23]);
|
|
1070
|
+
a = GG(a, b2, c, d, M_offset_9, 5, T[24]);
|
|
1071
|
+
d = GG(d, a, b2, c, M_offset_14, 9, T[25]);
|
|
1072
|
+
c = GG(c, d, a, b2, M_offset_3, 14, T[26]);
|
|
1073
|
+
b2 = GG(b2, c, d, a, M_offset_8, 20, T[27]);
|
|
1074
|
+
a = GG(a, b2, c, d, M_offset_13, 5, T[28]);
|
|
1075
|
+
d = GG(d, a, b2, c, M_offset_2, 9, T[29]);
|
|
1076
|
+
c = GG(c, d, a, b2, M_offset_7, 14, T[30]);
|
|
1077
|
+
b2 = GG(b2, c, d, a, M_offset_12, 20, T[31]);
|
|
1078
|
+
a = HH(a, b2, c, d, M_offset_5, 4, T[32]);
|
|
1079
|
+
d = HH(d, a, b2, c, M_offset_8, 11, T[33]);
|
|
1080
|
+
c = HH(c, d, a, b2, M_offset_11, 16, T[34]);
|
|
1081
|
+
b2 = HH(b2, c, d, a, M_offset_14, 23, T[35]);
|
|
1082
|
+
a = HH(a, b2, c, d, M_offset_1, 4, T[36]);
|
|
1083
|
+
d = HH(d, a, b2, c, M_offset_4, 11, T[37]);
|
|
1084
|
+
c = HH(c, d, a, b2, M_offset_7, 16, T[38]);
|
|
1085
|
+
b2 = HH(b2, c, d, a, M_offset_10, 23, T[39]);
|
|
1086
|
+
a = HH(a, b2, c, d, M_offset_13, 4, T[40]);
|
|
1087
|
+
d = HH(d, a, b2, c, M_offset_0, 11, T[41]);
|
|
1088
|
+
c = HH(c, d, a, b2, M_offset_3, 16, T[42]);
|
|
1089
|
+
b2 = HH(b2, c, d, a, M_offset_6, 23, T[43]);
|
|
1090
|
+
a = HH(a, b2, c, d, M_offset_9, 4, T[44]);
|
|
1091
|
+
d = HH(d, a, b2, c, M_offset_12, 11, T[45]);
|
|
1092
|
+
c = HH(c, d, a, b2, M_offset_15, 16, T[46]);
|
|
1093
|
+
b2 = HH(b2, c, d, a, M_offset_2, 23, T[47]);
|
|
1094
|
+
a = II(a, b2, c, d, M_offset_0, 6, T[48]);
|
|
1095
|
+
d = II(d, a, b2, c, M_offset_7, 10, T[49]);
|
|
1096
|
+
c = II(c, d, a, b2, M_offset_14, 15, T[50]);
|
|
1097
|
+
b2 = II(b2, c, d, a, M_offset_5, 21, T[51]);
|
|
1098
|
+
a = II(a, b2, c, d, M_offset_12, 6, T[52]);
|
|
1099
|
+
d = II(d, a, b2, c, M_offset_3, 10, T[53]);
|
|
1100
|
+
c = II(c, d, a, b2, M_offset_10, 15, T[54]);
|
|
1101
|
+
b2 = II(b2, c, d, a, M_offset_1, 21, T[55]);
|
|
1102
|
+
a = II(a, b2, c, d, M_offset_8, 6, T[56]);
|
|
1103
|
+
d = II(d, a, b2, c, M_offset_15, 10, T[57]);
|
|
1104
|
+
c = II(c, d, a, b2, M_offset_6, 15, T[58]);
|
|
1105
|
+
b2 = II(b2, c, d, a, M_offset_13, 21, T[59]);
|
|
1106
|
+
a = II(a, b2, c, d, M_offset_4, 6, T[60]);
|
|
1107
|
+
d = II(d, a, b2, c, M_offset_11, 10, T[61]);
|
|
1108
|
+
c = II(c, d, a, b2, M_offset_2, 15, T[62]);
|
|
1109
|
+
b2 = II(b2, c, d, a, M_offset_9, 21, T[63]);
|
|
1110
|
+
H3[0] = H3[0] + a | 0;
|
|
1111
|
+
H3[1] = H3[1] + b2 | 0;
|
|
1112
|
+
H3[2] = H3[2] + c | 0;
|
|
1113
|
+
H3[3] = H3[3] + d | 0;
|
|
1114
|
+
},
|
|
1115
|
+
_doFinalize: function() {
|
|
1116
|
+
var data = this._data;
|
|
1117
|
+
var dataWords = data.words;
|
|
1118
|
+
var nBitsTotal = this._nDataBytes * 8;
|
|
1119
|
+
var nBitsLeft = data.sigBytes * 8;
|
|
1120
|
+
dataWords[nBitsLeft >>> 5] |= 128 << 24 - nBitsLeft % 32;
|
|
1121
|
+
var nBitsTotalH = Math2.floor(nBitsTotal / 4294967296);
|
|
1122
|
+
var nBitsTotalL = nBitsTotal;
|
|
1123
|
+
dataWords[(nBitsLeft + 64 >>> 9 << 4) + 15] = (nBitsTotalH << 8 | nBitsTotalH >>> 24) & 16711935 | (nBitsTotalH << 24 | nBitsTotalH >>> 8) & 4278255360;
|
|
1124
|
+
dataWords[(nBitsLeft + 64 >>> 9 << 4) + 14] = (nBitsTotalL << 8 | nBitsTotalL >>> 24) & 16711935 | (nBitsTotalL << 24 | nBitsTotalL >>> 8) & 4278255360;
|
|
1125
|
+
data.sigBytes = (dataWords.length + 1) * 4;
|
|
1126
|
+
this._process();
|
|
1127
|
+
var hash = this._hash;
|
|
1128
|
+
var H3 = hash.words;
|
|
1129
|
+
for (var i2 = 0; i2 < 4; i2++) {
|
|
1130
|
+
var H_i = H3[i2];
|
|
1131
|
+
H3[i2] = (H_i << 8 | H_i >>> 24) & 16711935 | (H_i << 24 | H_i >>> 8) & 4278255360;
|
|
1132
|
+
}
|
|
1133
|
+
return hash;
|
|
1134
|
+
},
|
|
1135
|
+
clone: function() {
|
|
1136
|
+
var clone = Hasher.clone.call(this);
|
|
1137
|
+
clone._hash = this._hash.clone();
|
|
1138
|
+
return clone;
|
|
1139
|
+
}
|
|
1140
|
+
});
|
|
1141
|
+
function FF(a, b2, c, d, x, s, t) {
|
|
1142
|
+
var n = a + (b2 & c | ~b2 & d) + x + t;
|
|
1143
|
+
return (n << s | n >>> 32 - s) + b2;
|
|
1144
|
+
}
|
|
1145
|
+
function GG(a, b2, c, d, x, s, t) {
|
|
1146
|
+
var n = a + (b2 & d | c & ~d) + x + t;
|
|
1147
|
+
return (n << s | n >>> 32 - s) + b2;
|
|
1148
|
+
}
|
|
1149
|
+
function HH(a, b2, c, d, x, s, t) {
|
|
1150
|
+
var n = a + (b2 ^ c ^ d) + x + t;
|
|
1151
|
+
return (n << s | n >>> 32 - s) + b2;
|
|
1152
|
+
}
|
|
1153
|
+
function II(a, b2, c, d, x, s, t) {
|
|
1154
|
+
var n = a + (c ^ (b2 | ~d)) + x + t;
|
|
1155
|
+
return (n << s | n >>> 32 - s) + b2;
|
|
1156
|
+
}
|
|
1157
|
+
C.MD5 = Hasher._createHelper(MD52);
|
|
1158
|
+
C.HmacMD5 = Hasher._createHmacHelper(MD52);
|
|
1159
|
+
})(Math);
|
|
1160
|
+
return CryptoJS.MD5;
|
|
1161
|
+
});
|
|
1162
|
+
}
|
|
1163
|
+
});
|
|
1164
|
+
|
|
369
1165
|
// src/providers/cuekit-provider.tsx
|
|
370
1166
|
import React, { createContext, useContext, useEffect, useState } from "react";
|
|
371
1167
|
|
|
@@ -473,16 +1269,10 @@ var CuekitProvider = ({
|
|
|
473
1269
|
useEffect(() => {
|
|
474
1270
|
if (apiKey) {
|
|
475
1271
|
try {
|
|
476
|
-
console.log("\u{1F3A4} CuekitProvider: Starting WebRTC initialization...", {
|
|
477
|
-
apiKey: apiKey.substring(0, 10) + "..."
|
|
478
|
-
});
|
|
479
1272
|
initWebRTC(apiKey);
|
|
480
|
-
console.log("\u{1F3A4} CuekitProvider: WebRTC initialized successfully");
|
|
481
1273
|
} catch (error) {
|
|
482
|
-
console.error("\u{1F3A4} CuekitProvider: Failed to initialize WebRTC:", error);
|
|
483
1274
|
}
|
|
484
1275
|
} else {
|
|
485
|
-
console.warn("\u{1F3A4} CuekitProvider: No API key provided, skipping WebRTC initialization");
|
|
486
1276
|
}
|
|
487
1277
|
}, [apiKey]);
|
|
488
1278
|
useEffect(() => {
|
|
@@ -492,18 +1282,14 @@ var CuekitProvider = ({
|
|
|
492
1282
|
};
|
|
493
1283
|
}, [navigationHandler]);
|
|
494
1284
|
useEffect(() => {
|
|
495
|
-
import("./webrtc-service-
|
|
1285
|
+
import("./webrtc-service-SDVOO4LS.mjs").then(({ setWebRTCCallbacks: setWebRTCCallbacks2 }) => {
|
|
496
1286
|
setWebRTCCallbacks2({
|
|
497
1287
|
onNavigationCommand: (command) => {
|
|
498
|
-
console.log("\u{1F9ED} Processing navigation command:", command);
|
|
499
1288
|
switch (command.type) {
|
|
500
1289
|
case "static_data_ready":
|
|
501
|
-
console.log("\u{1F4E6} Static data ready:", command.data);
|
|
502
1290
|
break;
|
|
503
1291
|
case "ai_intent":
|
|
504
|
-
console.log("\u{1F3AF} AI Intent:", command.text, "->", command.actionType);
|
|
505
1292
|
if (command.actionType === "navigate" && command.current_page) {
|
|
506
|
-
console.log(`\u{1F9ED} Navigating to: ${command.current_page}`);
|
|
507
1293
|
if (navigationHandler) {
|
|
508
1294
|
navigationHandler(command.current_page, {
|
|
509
1295
|
intent: command.intent,
|
|
@@ -514,13 +1300,10 @@ var CuekitProvider = ({
|
|
|
514
1300
|
}
|
|
515
1301
|
break;
|
|
516
1302
|
case "user_speech_text":
|
|
517
|
-
console.log("\u{1F464} User said:", command.text);
|
|
518
1303
|
break;
|
|
519
1304
|
case "ai_speech_text":
|
|
520
|
-
console.log("\u{1F916} AI said:", command.text);
|
|
521
1305
|
break;
|
|
522
1306
|
default:
|
|
523
|
-
console.log("\u{1F50D} Unknown command type:", command.type);
|
|
524
1307
|
}
|
|
525
1308
|
},
|
|
526
1309
|
onConnectionStateChange: (state) => {
|
|
@@ -657,7 +1440,6 @@ var useWebRTC = (options) => {
|
|
|
657
1440
|
setIsConnected(true);
|
|
658
1441
|
return authData;
|
|
659
1442
|
} catch (err) {
|
|
660
|
-
console.error("Connection failed:", err);
|
|
661
1443
|
setError(err.message || "Failed to connect");
|
|
662
1444
|
setIsConnected(false);
|
|
663
1445
|
} finally {
|
|
@@ -742,7 +1524,7 @@ var useCuekit = (options) => {
|
|
|
742
1524
|
const [micState, setMicState] = useState3("idle");
|
|
743
1525
|
const [status, setStatus] = useState3("");
|
|
744
1526
|
const handleNavigationCommand = (event) => {
|
|
745
|
-
console.log(`\
|
|
1527
|
+
console.log(`\u2B07\uFE0F Received event from backend: ${event.type}`, event);
|
|
746
1528
|
switch (event.type) {
|
|
747
1529
|
case "user_speech_chunk":
|
|
748
1530
|
case "ai_speech_chunk": {
|
|
@@ -4625,9 +5407,9 @@ function factoryTitle(effects, ok3, nok, type, markerType, stringType) {
|
|
|
4625
5407
|
return atBreak(code4);
|
|
4626
5408
|
}
|
|
4627
5409
|
effects.consume(code4);
|
|
4628
|
-
return code4 === 92 ?
|
|
5410
|
+
return code4 === 92 ? escape2 : inside;
|
|
4629
5411
|
}
|
|
4630
|
-
function
|
|
5412
|
+
function escape2(code4) {
|
|
4631
5413
|
if (code4 === marker || code4 === 92) {
|
|
4632
5414
|
effects.consume(code4);
|
|
4633
5415
|
return inside;
|
|
@@ -13523,9 +14305,9 @@ var SunIcon = ({ width = 24, height = 24, className, ...props }) => {
|
|
|
13523
14305
|
viewBox: "0 0 24 24",
|
|
13524
14306
|
fill: "none",
|
|
13525
14307
|
stroke: "currentColor",
|
|
13526
|
-
|
|
13527
|
-
|
|
13528
|
-
|
|
14308
|
+
strokeWidth: "2",
|
|
14309
|
+
strokeLinecap: "round",
|
|
14310
|
+
strokeLinejoin: "round",
|
|
13529
14311
|
className,
|
|
13530
14312
|
...props
|
|
13531
14313
|
},
|
|
@@ -13554,9 +14336,9 @@ var MoonIcon = ({ width = 24, height = 24, className, ...props }) => {
|
|
|
13554
14336
|
viewBox: "0 0 24 24",
|
|
13555
14337
|
fill: "none",
|
|
13556
14338
|
stroke: "currentColor",
|
|
13557
|
-
|
|
13558
|
-
|
|
13559
|
-
|
|
14339
|
+
strokeWidth: "2",
|
|
14340
|
+
strokeLinecap: "round",
|
|
14341
|
+
strokeLinejoin: "round",
|
|
13560
14342
|
className,
|
|
13561
14343
|
...props
|
|
13562
14344
|
},
|
|
@@ -13577,9 +14359,9 @@ var CloseIcon = ({ width = 24, height = 24, className, ...props }) => {
|
|
|
13577
14359
|
viewBox: "0 0 24 24",
|
|
13578
14360
|
fill: "none",
|
|
13579
14361
|
stroke: "currentColor",
|
|
13580
|
-
|
|
13581
|
-
|
|
13582
|
-
|
|
14362
|
+
strokeWidth: "2",
|
|
14363
|
+
strokeLinecap: "round",
|
|
14364
|
+
strokeLinejoin: "round",
|
|
13583
14365
|
className,
|
|
13584
14366
|
...props
|
|
13585
14367
|
},
|
|
@@ -13601,9 +14383,9 @@ var PhoneOffIcon = ({ width = 24, height = 24, className, ...props }) => {
|
|
|
13601
14383
|
viewBox: "0 0 24 24",
|
|
13602
14384
|
fill: "none",
|
|
13603
14385
|
stroke: "currentColor",
|
|
13604
|
-
|
|
13605
|
-
|
|
13606
|
-
|
|
14386
|
+
strokeWidth: "2",
|
|
14387
|
+
strokeLinecap: "round",
|
|
14388
|
+
strokeLinejoin: "round",
|
|
13607
14389
|
className,
|
|
13608
14390
|
...props
|
|
13609
14391
|
},
|
|
@@ -16224,19 +17006,6 @@ var VoiceIntensityBars = ({
|
|
|
16224
17006
|
return null;
|
|
16225
17007
|
}
|
|
16226
17008
|
let trackRef = null;
|
|
16227
|
-
console.log("VoiceIntensityVisualizer Debug:", {
|
|
16228
|
-
participants: participants.length,
|
|
16229
|
-
localParticipant: !!localParticipant,
|
|
16230
|
-
isActive
|
|
16231
|
-
});
|
|
16232
|
-
console.log(
|
|
16233
|
-
"All participants:",
|
|
16234
|
-
participants.map((p) => ({
|
|
16235
|
-
identity: p.identity,
|
|
16236
|
-
isLocal: p instanceof Participant,
|
|
16237
|
-
hasAudio: p.getTrackPublication(Track.Source.Microphone)?.track !== void 0
|
|
16238
|
-
}))
|
|
16239
|
-
);
|
|
16240
17009
|
let speakingParticipant = null;
|
|
16241
17010
|
let highestAudioLevel = 0;
|
|
16242
17011
|
participants.forEach((participant) => {
|
|
@@ -16249,15 +17018,8 @@ var VoiceIntensityBars = ({
|
|
|
16249
17018
|
if (!speakingParticipant || highestAudioLevel === 0) {
|
|
16250
17019
|
speakingParticipant = participants.find((p) => p.isSpeaking) || (participants.length > 0 ? participants[0] : null);
|
|
16251
17020
|
if (speakingParticipant) {
|
|
16252
|
-
console.log("Fallback to speaking status or first participant:", speakingParticipant.identity);
|
|
16253
17021
|
}
|
|
16254
17022
|
} else {
|
|
16255
|
-
console.log(
|
|
16256
|
-
"Using participant with highest audio level:",
|
|
16257
|
-
speakingParticipant.identity,
|
|
16258
|
-
"level:",
|
|
16259
|
-
highestAudioLevel
|
|
16260
|
-
);
|
|
16261
17023
|
}
|
|
16262
17024
|
if (speakingParticipant) {
|
|
16263
17025
|
const audioTrack = speakingParticipant.getTrackPublication(Track.Source.Microphone);
|
|
@@ -16321,9 +17083,9 @@ var MicIcon = ({ width = 24, height = 24, className, ...props }) => {
|
|
|
16321
17083
|
viewBox: "0 0 24 24",
|
|
16322
17084
|
fill: "none",
|
|
16323
17085
|
stroke: "currentColor",
|
|
16324
|
-
|
|
16325
|
-
|
|
16326
|
-
|
|
17086
|
+
strokeWidth: "2",
|
|
17087
|
+
strokeLinecap: "round",
|
|
17088
|
+
strokeLinejoin: "round",
|
|
16327
17089
|
className,
|
|
16328
17090
|
...props
|
|
16329
17091
|
},
|
|
@@ -16346,9 +17108,9 @@ var LoaderIcon = ({ width = 24, height = 24, className, ...props }) => {
|
|
|
16346
17108
|
viewBox: "0 0 24 24",
|
|
16347
17109
|
fill: "none",
|
|
16348
17110
|
stroke: "currentColor",
|
|
16349
|
-
|
|
16350
|
-
|
|
16351
|
-
|
|
17111
|
+
strokeWidth: "2",
|
|
17112
|
+
strokeLinecap: "round",
|
|
17113
|
+
strokeLinejoin: "round",
|
|
16352
17114
|
className,
|
|
16353
17115
|
...props
|
|
16354
17116
|
},
|
|
@@ -16427,9 +17189,6 @@ var MicButton = ({
|
|
|
16427
17189
|
onAISpeechEnd: (trackId) => handleAISpeech(false, trackId),
|
|
16428
17190
|
appId
|
|
16429
17191
|
});
|
|
16430
|
-
useEffect10(() => {
|
|
16431
|
-
console.log("\u{1F3A4} MicButton received messages:", JSON.stringify(messageManagerMessages, null, 2));
|
|
16432
|
-
}, [messageManagerMessages]);
|
|
16433
17192
|
useEffect10(() => {
|
|
16434
17193
|
const checkTheme = () => {
|
|
16435
17194
|
if (typeof document !== "undefined") {
|
|
@@ -16479,74 +17238,27 @@ var MicButton = ({
|
|
|
16479
17238
|
}, [showBorderGlow]);
|
|
16480
17239
|
const handleAISpeech = useCallback5(
|
|
16481
17240
|
(isSpeaking, trackId) => {
|
|
16482
|
-
console.log("\u{1F3A4} MicButton: ===== AI SPEECH EVENT START =====");
|
|
16483
|
-
console.log("\u{1F3A4} MicButton: Event type:", isSpeaking ? "START" : "END");
|
|
16484
|
-
console.log("\u{1F3A4} MicButton: Track ID:", trackId);
|
|
16485
|
-
console.log("\u{1F3A4} MicButton: Current AI speaking state:", aiSpeakingRef.current);
|
|
16486
|
-
console.log("\u{1F3A4} MicButton: Current active AI tracks:", Array.from(activeAITracksRef.current));
|
|
16487
|
-
console.log("\u{1F3A4} MicButton: Current status:", status);
|
|
16488
|
-
console.log("\u{1F3A4} MicButton: Current mic state:", micState);
|
|
16489
|
-
console.log("\u{1F3A4} MicButton: Is listening:", isConnected);
|
|
16490
|
-
console.log("\u{1F3A4} MicButton: Is connected:", isConnected);
|
|
16491
17241
|
if (isSpeaking && trackId) {
|
|
16492
|
-
console.log("\u{1F3A4} MicButton: ===== AI SPEECH START =====");
|
|
16493
|
-
console.log("\u{1F3A4} MicButton: Adding track to active set:", trackId);
|
|
16494
17242
|
activeAITracksRef.current.add(trackId);
|
|
16495
17243
|
aiSpeakingRef.current = true;
|
|
16496
|
-
console.log("\u{1F3A4} MicButton: After adding track:");
|
|
16497
|
-
console.log("\u{1F3A4} MicButton: - Active tracks:", Array.from(activeAITracksRef.current));
|
|
16498
|
-
console.log("\u{1F3A4} MicButton: - AI speaking state:", aiSpeakingRef.current);
|
|
16499
|
-
console.log("\u{1F3A4} MicButton: - Status set to: AI is speaking...");
|
|
16500
17244
|
if (aiSpeechTimeoutRef.current) {
|
|
16501
|
-
console.log("\u{1F3A4} MicButton: Clearing existing AI speech timeout");
|
|
16502
17245
|
clearTimeout(aiSpeechTimeoutRef.current);
|
|
16503
17246
|
}
|
|
16504
|
-
console.log(
|
|
16505
|
-
"\u{1F3A4} MicButton: AI speech started, active tracks:",
|
|
16506
|
-
Array.from(activeAITracksRef.current)
|
|
16507
|
-
);
|
|
16508
17247
|
} else if (!isSpeaking && trackId) {
|
|
16509
|
-
console.log("\u{1F3A4} MicButton: ===== AI SPEECH END =====");
|
|
16510
|
-
console.log("\u{1F3A4} MicButton: Removing track from active set:", trackId);
|
|
16511
17248
|
activeAITracksRef.current.delete(trackId);
|
|
16512
|
-
console.log("\u{1F3A4} MicButton: After removing track:");
|
|
16513
|
-
console.log("\u{1F3A4} MicButton: - Active tracks:", Array.from(activeAITracksRef.current));
|
|
16514
|
-
console.log("\u{1F3A4} MicButton: - Active tracks size:", activeAITracksRef.current.size);
|
|
16515
17249
|
if (activeAITracksRef.current.size === 0) {
|
|
16516
|
-
console.log("\u{1F3A4} MicButton: ===== ALL AI TRACKS ENDED =====");
|
|
16517
|
-
console.log("\u{1F3A4} MicButton: No more active tracks, resetting AI speaking state");
|
|
16518
17250
|
aiSpeakingRef.current = false;
|
|
16519
|
-
console.log("\u{1F3A4} MicButton: After reset:");
|
|
16520
|
-
console.log("\u{1F3A4} MicButton: - AI speaking state:", aiSpeakingRef.current);
|
|
16521
|
-
console.log("\u{1F3A4} MicButton: - Status set to: Listening");
|
|
16522
|
-
console.log("\u{1F3A4} MicButton: All AI tracks ended, voice recognition re-enabled");
|
|
16523
17251
|
} else {
|
|
16524
|
-
console.log("\u{1F3A4} MicButton: Still have active tracks, keeping AI speaking state");
|
|
16525
|
-
console.log("\u{1F3A4} MicButton: Remaining tracks:", Array.from(activeAITracksRef.current));
|
|
16526
17252
|
}
|
|
16527
17253
|
} else if (!isSpeaking && !trackId) {
|
|
16528
|
-
console.log("\u{1F3A4} MicButton: ===== MANUAL RESET =====");
|
|
16529
|
-
console.log("\u{1F3A4} MicButton: Manual reset triggered");
|
|
16530
17254
|
activeAITracksRef.current.clear();
|
|
16531
17255
|
aiSpeakingRef.current = false;
|
|
16532
|
-
console.log("\u{1F3A4} MicButton: After manual reset:");
|
|
16533
|
-
console.log("\u{1F3A4} MicButton: - Active tracks cleared");
|
|
16534
|
-
console.log("\u{1F3A4} MicButton: - AI speaking state:", aiSpeakingRef.current);
|
|
16535
|
-
console.log("\u{1F3A4} MicButton: - Status set to: Listening");
|
|
16536
|
-
console.log("\u{1F3A4} MicButton: AI speech manually reset");
|
|
16537
17256
|
}
|
|
16538
|
-
console.log("\u{1F3A4} MicButton: ===== AI SPEECH EVENT END =====");
|
|
16539
|
-
console.log("\u{1F3A4} MicButton: Final state:");
|
|
16540
|
-
console.log("\u{1F3A4} MicButton: - AI speaking:", aiSpeakingRef.current);
|
|
16541
|
-
console.log("\u{1F3A4} MicButton: - Active tracks:", Array.from(activeAITracksRef.current));
|
|
16542
|
-
console.log("\u{1F3A4} MicButton: - Status:", status);
|
|
16543
|
-
console.log("\u{1F3A4} MicButton: ================================");
|
|
16544
17257
|
},
|
|
16545
17258
|
[status, micState, isConnected]
|
|
16546
17259
|
);
|
|
16547
17260
|
useEffect10(() => {
|
|
16548
17261
|
if (audioContainerRef.current) {
|
|
16549
|
-
console.log("\u{1F3A4} MicButton: Setting up audio container on mount");
|
|
16550
17262
|
setAudioContainer(audioContainerRef);
|
|
16551
17263
|
}
|
|
16552
17264
|
return () => {
|
|
@@ -16574,49 +17286,33 @@ var MicButton = ({
|
|
|
16574
17286
|
};
|
|
16575
17287
|
useEffect10(() => {
|
|
16576
17288
|
if (isConnected) {
|
|
16577
|
-
console.log("\u{1F3A4} MicButton: WebRTC and SSE connections established - ready for commands");
|
|
16578
17289
|
} else {
|
|
16579
|
-
console.log("\u{1F3A4} MicButton: WebRTC not yet connected - ignoring speech");
|
|
16580
17290
|
}
|
|
16581
17291
|
}, [isConnected]);
|
|
16582
17292
|
useEffect10(() => {
|
|
16583
|
-
console.log("\u{1F3A4} MicButton: Auto-open check:", {
|
|
16584
|
-
isConnected,
|
|
16585
|
-
chatIsOpen: isChatOpen
|
|
16586
|
-
});
|
|
16587
17293
|
if (isConnected && !isChatOpen) {
|
|
16588
|
-
console.log("\u{1F3A4} MicButton: Auto-opening chat popup");
|
|
16589
17294
|
openChat();
|
|
16590
17295
|
}
|
|
16591
17296
|
}, [isConnected, isChatOpen, openChat]);
|
|
16592
17297
|
useEffect10(() => {
|
|
16593
17298
|
if (messageManagerMessages.length > 0 && !isChatOpen) {
|
|
16594
|
-
console.log("\u{1F3A4} MicButton: Auto-opening chat popup due to messages");
|
|
16595
17299
|
openChat();
|
|
16596
17300
|
}
|
|
16597
17301
|
}, [messageManagerMessages.length, isChatOpen, openChat]);
|
|
16598
17302
|
const handleMicClick = useCallback5(() => {
|
|
16599
17303
|
const shouldStop = micState === "listening" && isConnected;
|
|
16600
17304
|
if (shouldStop) {
|
|
16601
|
-
console.log("\u{1F3A4} MicButton: User wants to stop - closing everything");
|
|
16602
17305
|
voiceDisconnect().then(() => {
|
|
16603
|
-
console.log("\u{1F3A4} MicButton: Stopped and disconnected");
|
|
16604
17306
|
}).catch((error) => {
|
|
16605
|
-
console.error("\u{1F3A4} MicButton: Error during disconnect:", error);
|
|
16606
17307
|
});
|
|
16607
17308
|
} else {
|
|
16608
|
-
console.log("\u{1F3A4} MicButton: User wants to start - connecting everything");
|
|
16609
17309
|
voiceConnect(`user_${Date.now()}`, apiKey, appId).then(() => {
|
|
16610
|
-
console.log("\u{1F3A4} MicButton: WebRTC and SSE connections started");
|
|
16611
17310
|
if (showBorderGlow) setShowBodyGlow(true);
|
|
16612
17311
|
openChat();
|
|
16613
|
-
console.log("\u{1F3A4} MicButton: Started listening");
|
|
16614
17312
|
setTimeout(() => {
|
|
16615
|
-
console.log("\u{1F3A4} MicButton: Force opening chat popup after connection");
|
|
16616
17313
|
openChat();
|
|
16617
17314
|
}, 500);
|
|
16618
17315
|
}).catch((error) => {
|
|
16619
|
-
console.error("\u{1F3A4} MicButton: Failed to start connections:", error);
|
|
16620
17316
|
});
|
|
16621
17317
|
}
|
|
16622
17318
|
}, [
|
|
@@ -16630,14 +17326,12 @@ var MicButton = ({
|
|
|
16630
17326
|
showBorderGlow
|
|
16631
17327
|
]);
|
|
16632
17328
|
const handleSendText = async (textToSend) => {
|
|
16633
|
-
console.log("\u{1F3A4} MicButton: handleSendText called with:", textToSend);
|
|
16634
17329
|
setMicState("thinking");
|
|
16635
17330
|
if (showBorderGlow) setShowBodyGlow(true);
|
|
16636
17331
|
if (!isChatOpen) {
|
|
16637
17332
|
openChat();
|
|
16638
17333
|
}
|
|
16639
17334
|
if (isConnected) {
|
|
16640
|
-
console.log("\u{1F3A4} MicButton: Sending via WebRTC");
|
|
16641
17335
|
try {
|
|
16642
17336
|
await sendUserCommand2(textToSend);
|
|
16643
17337
|
setMicState("replying");
|
|
@@ -16646,27 +17340,21 @@ var MicButton = ({
|
|
|
16646
17340
|
if (showBorderGlow) setShowBodyGlow(true);
|
|
16647
17341
|
}, 1e3);
|
|
16648
17342
|
} catch (error) {
|
|
16649
|
-
console.error("\u{1F3A4} MicButton: Failed to send text:", error);
|
|
16650
17343
|
} finally {
|
|
16651
17344
|
setMicState("listening");
|
|
16652
17345
|
if (showBorderGlow) setShowBodyGlow(true);
|
|
16653
17346
|
}
|
|
16654
17347
|
} else {
|
|
16655
|
-
console.log("\u{1F3A4} MicButton: WebRTC not connected, cannot send message");
|
|
16656
17348
|
setMicState("listening");
|
|
16657
17349
|
if (showBorderGlow) setShowBodyGlow(true);
|
|
16658
17350
|
}
|
|
16659
|
-
console.log("\u{1F3A4} MicButton: Text sent via WebRTC");
|
|
16660
17351
|
};
|
|
16661
17352
|
const handleEndCall = async () => {
|
|
16662
|
-
console.log("\u{1F3A4} MicButton: Ending call completely...");
|
|
16663
17353
|
try {
|
|
16664
17354
|
await voiceDisconnect();
|
|
16665
17355
|
await voiceDisconnect();
|
|
16666
17356
|
closeChat();
|
|
16667
|
-
console.log("\u{1F3A4} MicButton: Call ended successfully");
|
|
16668
17357
|
} catch (error) {
|
|
16669
|
-
console.error("\u{1F3A4} MicButton: Error ending call:", error);
|
|
16670
17358
|
}
|
|
16671
17359
|
};
|
|
16672
17360
|
const getIcon = () => {
|
|
@@ -16866,6 +17554,14 @@ var MicButton = ({
|
|
|
16866
17554
|
/* @__PURE__ */ React11.createElement("span", { style: { fontSize: 12, fontWeight: 600, color: "hsl(var(--voice-text))" } }, "Open chat")
|
|
16867
17555
|
), /* @__PURE__ */ React11.createElement("div", { ref: audioContainerRef, style: { display: "none" } }), showBorderGlow && showBodyGlow && /* @__PURE__ */ React11.createElement(border_glow_default, { isActive: true }));
|
|
16868
17556
|
};
|
|
17557
|
+
|
|
17558
|
+
// src/utils/instrumentation.ts
|
|
17559
|
+
var import_md5 = __toESM(require_md5());
|
|
17560
|
+
function generateDynamicId(routePath, elementIdentifier) {
|
|
17561
|
+
const combinedString = `${routePath}:${elementIdentifier}`;
|
|
17562
|
+
const hash = (0, import_md5.default)(combinedString).toString();
|
|
17563
|
+
return hash.substring(0, 8);
|
|
17564
|
+
}
|
|
16869
17565
|
export {
|
|
16870
17566
|
border_glow_default as BorderGlow,
|
|
16871
17567
|
ChatPopup,
|
|
@@ -16876,6 +17572,7 @@ export {
|
|
|
16876
17572
|
captureFullDOMStructure,
|
|
16877
17573
|
configureWebRTCServer,
|
|
16878
17574
|
executeAction,
|
|
17575
|
+
generateDynamicId,
|
|
16879
17576
|
getFullDOMStructure,
|
|
16880
17577
|
getWebRTCServerConfig,
|
|
16881
17578
|
initWebRTC,
|