@superinterface/react 3.10.3 → 3.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1044 -529
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +56 -77
- package/dist/index.d.ts +56 -77
- package/dist/index.js +1006 -507
- package/dist/index.js.map +1 -1
- package/dist/types/index.d.cts +26 -1
- package/dist/types/index.d.ts +26 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -370,9 +370,15 @@ __export(src_exports, {
|
|
|
370
370
|
ThreadDialogContext: function() {
|
|
371
371
|
return ThreadDialogContext;
|
|
372
372
|
},
|
|
373
|
+
TtsAudioRuntimeProvider: function() {
|
|
374
|
+
return TtsAudioRuntimeProvider;
|
|
375
|
+
},
|
|
373
376
|
UserAvatarContext: function() {
|
|
374
377
|
return UserAvatarContext;
|
|
375
378
|
},
|
|
379
|
+
WebrtcAudioRuntimeProvider: function() {
|
|
380
|
+
return WebrtcAudioRuntimeProvider;
|
|
381
|
+
},
|
|
376
382
|
useAssistant: function() {
|
|
377
383
|
return useAssistant;
|
|
378
384
|
},
|
|
@@ -411,6 +417,12 @@ __export(src_exports, {
|
|
|
411
417
|
},
|
|
412
418
|
useThreadDialogContext: function() {
|
|
413
419
|
return useThreadDialogContext;
|
|
420
|
+
},
|
|
421
|
+
useTtsAudioRuntime: function() {
|
|
422
|
+
return useTtsAudioRuntime;
|
|
423
|
+
},
|
|
424
|
+
useWebrtcAudioRuntime: function() {
|
|
425
|
+
return useWebrtcAudioRuntime;
|
|
414
426
|
}
|
|
415
427
|
});
|
|
416
428
|
module.exports = __toCommonJS(src_exports);
|
|
@@ -2873,11 +2885,11 @@ function _asyncToGenerator3(n) {
|
|
|
2873
2885
|
}
|
|
2874
2886
|
var threadRunRequiresAction = /* @__PURE__ */ function() {
|
|
2875
2887
|
var _ref2 = _asyncToGenerator3(function(_ref) {
|
|
2876
|
-
var value,
|
|
2888
|
+
var value, superinterfaceContext, toolCalls, toolOutputs;
|
|
2877
2889
|
return _ts_generator(this, function(_state) {
|
|
2878
2890
|
switch(_state.label){
|
|
2879
2891
|
case 0:
|
|
2880
|
-
value = _ref.value,
|
|
2892
|
+
value = _ref.value, superinterfaceContext = _ref.superinterfaceContext;
|
|
2881
2893
|
if (!(value.data.required_action.type === "submit_client_tool_outputs")) return [
|
|
2882
2894
|
3,
|
|
2883
2895
|
2
|
|
@@ -8760,128 +8772,26 @@ ThreadDialog.Root = Root9;
|
|
|
8760
8772
|
ThreadDialog.Trigger = Trigger;
|
|
8761
8773
|
ThreadDialog.Content = Content7;
|
|
8762
8774
|
// src/components/threads/AudioThread/Root/index.tsx
|
|
8763
|
-
var
|
|
8775
|
+
var import_react_compiler_runtime52 = require("react-compiler-runtime");
|
|
8764
8776
|
var import_themes58 = require("@radix-ui/themes");
|
|
8765
8777
|
// src/contexts/threads/AudioThreadContext/index.ts
|
|
8766
8778
|
var import_react58 = require("react");
|
|
8767
|
-
function asyncGeneratorStep10(n, t, e, r, o, a, c) {
|
|
8768
|
-
try {
|
|
8769
|
-
var i = n[a](c), u = i.value;
|
|
8770
|
-
} catch (n2) {
|
|
8771
|
-
return void e(n2);
|
|
8772
|
-
}
|
|
8773
|
-
i.done ? t(u) : Promise.resolve(u).then(r, o);
|
|
8774
|
-
}
|
|
8775
|
-
function _asyncToGenerator10(n) {
|
|
8776
|
-
return function() {
|
|
8777
|
-
var t = this, e = arguments;
|
|
8778
|
-
return new Promise(function(r, o) {
|
|
8779
|
-
var a = n.apply(t, e);
|
|
8780
|
-
function _next(n2) {
|
|
8781
|
-
asyncGeneratorStep10(a, r, o, _next, _throw, "next", n2);
|
|
8782
|
-
}
|
|
8783
|
-
function _throw(n2) {
|
|
8784
|
-
asyncGeneratorStep10(a, r, o, _next, _throw, "throw", n2);
|
|
8785
|
-
}
|
|
8786
|
-
_next(void 0);
|
|
8787
|
-
});
|
|
8788
|
-
};
|
|
8789
|
-
}
|
|
8790
8779
|
var AudioThreadContext = /* @__PURE__ */ (0, import_react58.createContext)({
|
|
8791
|
-
|
|
8792
|
-
recorderProps: {
|
|
8793
|
-
status: "idle",
|
|
8794
|
-
start: function() {
|
|
8795
|
-
var _start = _asyncToGenerator10(function() {
|
|
8796
|
-
return _ts_generator(this, function(_state) {
|
|
8797
|
-
return [
|
|
8798
|
-
2
|
|
8799
|
-
];
|
|
8800
|
-
});
|
|
8801
|
-
});
|
|
8802
|
-
function start() {
|
|
8803
|
-
return _start.apply(this, arguments);
|
|
8804
|
-
}
|
|
8805
|
-
return start;
|
|
8806
|
-
}(),
|
|
8807
|
-
stop: function() {
|
|
8808
|
-
var _stop = _asyncToGenerator10(function() {
|
|
8809
|
-
return _ts_generator(this, function(_state) {
|
|
8810
|
-
return [
|
|
8811
|
-
2
|
|
8812
|
-
];
|
|
8813
|
-
});
|
|
8814
|
-
});
|
|
8815
|
-
function stop() {
|
|
8816
|
-
return _stop.apply(this, arguments);
|
|
8817
|
-
}
|
|
8818
|
-
return stop;
|
|
8819
|
-
}(),
|
|
8820
|
-
pause: function() {
|
|
8821
|
-
var _pause = _asyncToGenerator10(function() {
|
|
8822
|
-
return _ts_generator(this, function(_state) {
|
|
8823
|
-
return [
|
|
8824
|
-
2
|
|
8825
|
-
];
|
|
8826
|
-
});
|
|
8827
|
-
});
|
|
8828
|
-
function pause() {
|
|
8829
|
-
return _pause.apply(this, arguments);
|
|
8830
|
-
}
|
|
8831
|
-
return pause;
|
|
8832
|
-
}(),
|
|
8833
|
-
resume: function() {
|
|
8834
|
-
var _resume = _asyncToGenerator10(function() {
|
|
8835
|
-
return _ts_generator(this, function(_state) {
|
|
8836
|
-
return [
|
|
8837
|
-
2
|
|
8838
|
-
];
|
|
8839
|
-
});
|
|
8840
|
-
});
|
|
8841
|
-
function resume() {
|
|
8842
|
-
return _resume.apply(this, arguments);
|
|
8843
|
-
}
|
|
8844
|
-
return resume;
|
|
8845
|
-
}(),
|
|
8846
|
-
visualizationAnalyser: null
|
|
8847
|
-
},
|
|
8848
|
-
// @ts-ignore-next-line
|
|
8849
|
-
messageAudioProps: {
|
|
8850
|
-
visualizationAnalyser: null,
|
|
8851
|
-
playing: false,
|
|
8852
|
-
paused: false,
|
|
8853
|
-
isReady: false,
|
|
8854
|
-
play: function() {
|
|
8855
|
-
var _play = _asyncToGenerator10(function() {
|
|
8856
|
-
return _ts_generator(this, function(_state) {
|
|
8857
|
-
return [
|
|
8858
|
-
2
|
|
8859
|
-
];
|
|
8860
|
-
});
|
|
8861
|
-
});
|
|
8862
|
-
function play() {
|
|
8863
|
-
return _play.apply(this, arguments);
|
|
8864
|
-
}
|
|
8865
|
-
return play;
|
|
8866
|
-
}(),
|
|
8867
|
-
pause: function() {
|
|
8868
|
-
var _pause2 = _asyncToGenerator10(function() {
|
|
8869
|
-
return _ts_generator(this, function(_state) {
|
|
8870
|
-
return [
|
|
8871
|
-
2
|
|
8872
|
-
];
|
|
8873
|
-
});
|
|
8874
|
-
});
|
|
8875
|
-
function pause() {
|
|
8876
|
-
return _pause2.apply(this, arguments);
|
|
8877
|
-
}
|
|
8878
|
-
return pause;
|
|
8879
|
-
}()
|
|
8880
|
-
}
|
|
8780
|
+
audioRuntime: null
|
|
8881
8781
|
});
|
|
8782
|
+
// src/hooks/threads/useAudioThreadContext/index.ts
|
|
8783
|
+
var import_react59 = require("react");
|
|
8784
|
+
var useAudioThreadContext = function() {
|
|
8785
|
+
return (0, import_react59.useContext)(AudioThreadContext);
|
|
8786
|
+
};
|
|
8787
|
+
// src/components/audioRuntimes/TtsAudioRuntimeProvider.tsx
|
|
8788
|
+
var import_react_compiler_runtime51 = require("react-compiler-runtime");
|
|
8789
|
+
// src/hooks/audioRuntimes/useTtsAudioRuntime/index.ts
|
|
8790
|
+
var import_react_compiler_runtime50 = require("react-compiler-runtime");
|
|
8791
|
+
var import_react64 = require("react");
|
|
8882
8792
|
// src/hooks/misc/usePermission/index.ts
|
|
8883
8793
|
var import_react_compiler_runtime47 = require("react-compiler-runtime");
|
|
8884
|
-
var
|
|
8794
|
+
var import_react60 = require("react");
|
|
8885
8795
|
// src/hooks/misc/usePermission/util.ts
|
|
8886
8796
|
var noop = function() {};
|
|
8887
8797
|
function on(obj) {
|
|
@@ -8905,7 +8815,7 @@ function off(obj) {
|
|
|
8905
8815
|
// src/hooks/misc/usePermission/index.ts
|
|
8906
8816
|
var usePermission = function(permissionDesc) {
|
|
8907
8817
|
var $ = (0, import_react_compiler_runtime47.c)(3);
|
|
8908
|
-
var _ref = _sliced_to_array((0,
|
|
8818
|
+
var _ref = _sliced_to_array((0, import_react60.useState)(""), 2), state = _ref[0], setState = _ref[1];
|
|
8909
8819
|
var t0;
|
|
8910
8820
|
var t1;
|
|
8911
8821
|
if ($[0] !== permissionDesc) {
|
|
@@ -8944,86 +8854,19 @@ var usePermission = function(permissionDesc) {
|
|
|
8944
8854
|
t0 = $[1];
|
|
8945
8855
|
t1 = $[2];
|
|
8946
8856
|
}
|
|
8947
|
-
(0,
|
|
8857
|
+
(0, import_react60.useEffect)(t0, t1);
|
|
8948
8858
|
return state;
|
|
8949
8859
|
};
|
|
8950
|
-
// src/components/threads/AudioThread/Root/lib/blobToData.ts
|
|
8951
|
-
var blobToData = function(blob) {
|
|
8952
|
-
return new Promise(function(resolve) {
|
|
8953
|
-
var reader = new FileReader();
|
|
8954
|
-
reader.onloadend = function() {
|
|
8955
|
-
return resolve(reader.result);
|
|
8956
|
-
};
|
|
8957
|
-
reader.readAsDataURL(blob);
|
|
8958
|
-
});
|
|
8959
|
-
};
|
|
8960
|
-
// src/hooks/audioThreads/useStatus/index.ts
|
|
8961
|
-
var import_react_compiler_runtime48 = require("react-compiler-runtime");
|
|
8962
|
-
var import_react60 = require("react");
|
|
8963
|
-
var useStatus = function(t0) {
|
|
8964
|
-
var $ = (0, import_react_compiler_runtime48.c)(2);
|
|
8965
|
-
var messageAudioProps = t0.messageAudioProps, recorderProps = t0.recorderProps, createMessageProps = t0.createMessageProps;
|
|
8966
|
-
var latestMessageProps = useLatestMessage();
|
|
8967
|
-
var t1;
|
|
8968
|
-
bb0: {
|
|
8969
|
-
var _latestMessageProps$l;
|
|
8970
|
-
if (recorderProps.status === "recording") {
|
|
8971
|
-
t1 = "recording";
|
|
8972
|
-
break bb0;
|
|
8973
|
-
}
|
|
8974
|
-
if (createMessageProps.isPending) {
|
|
8975
|
-
t1 = "creatingMessage";
|
|
8976
|
-
break bb0;
|
|
8977
|
-
}
|
|
8978
|
-
if (messageAudioProps.paused || !messageAudioProps.isAudioPlayed) {
|
|
8979
|
-
t1 = "playerPaused";
|
|
8980
|
-
break bb0;
|
|
8981
|
-
}
|
|
8982
|
-
if (messageAudioProps.playing || messageAudioProps.isPending) {
|
|
8983
|
-
t1 = "playing";
|
|
8984
|
-
break bb0;
|
|
8985
|
-
}
|
|
8986
|
-
if (!messageAudioProps.isAudioPlayed && !messageAudioProps.isReady) {
|
|
8987
|
-
t1 = "loading";
|
|
8988
|
-
break bb0;
|
|
8989
|
-
}
|
|
8990
|
-
if (((_latestMessageProps$l = latestMessageProps.latestMessage) === null || _latestMessageProps$l === void 0 ? void 0 : _latestMessageProps$l.status) === "in_progress") {
|
|
8991
|
-
t1 = "creatingMessage";
|
|
8992
|
-
break bb0;
|
|
8993
|
-
}
|
|
8994
|
-
if (recorderProps.status === "idle") {
|
|
8995
|
-
t1 = "idle";
|
|
8996
|
-
break bb0;
|
|
8997
|
-
}
|
|
8998
|
-
if (recorderProps.status === "paused") {
|
|
8999
|
-
t1 = "recorderPaused";
|
|
9000
|
-
break bb0;
|
|
9001
|
-
}
|
|
9002
|
-
t1 = "loading";
|
|
9003
|
-
}
|
|
9004
|
-
var status = t1;
|
|
9005
|
-
var t2;
|
|
9006
|
-
if ($[0] !== status) {
|
|
9007
|
-
t2 = {
|
|
9008
|
-
status: status
|
|
9009
|
-
};
|
|
9010
|
-
$[0] = status;
|
|
9011
|
-
$[1] = t2;
|
|
9012
|
-
} else {
|
|
9013
|
-
t2 = $[1];
|
|
9014
|
-
}
|
|
9015
|
-
return t2;
|
|
9016
|
-
};
|
|
9017
8860
|
// src/hooks/audioThreads/useRecorder/index.ts
|
|
9018
8861
|
var import_dayjs3 = __toESM(require("dayjs"), 1);
|
|
9019
8862
|
var import_use_audio_capture = require("use-audio-capture");
|
|
9020
8863
|
var import_react62 = require("react");
|
|
9021
8864
|
var import_react_use_audio_player = require("react-use-audio-player");
|
|
9022
8865
|
// src/hooks/misc/useInterval.ts
|
|
9023
|
-
var
|
|
8866
|
+
var import_react_compiler_runtime48 = require("react-compiler-runtime");
|
|
9024
8867
|
var import_react61 = require("react");
|
|
9025
8868
|
var useInterval = function(callback, delay) {
|
|
9026
|
-
var $ = (0,
|
|
8869
|
+
var $ = (0, import_react_compiler_runtime48.c)(5);
|
|
9027
8870
|
var savedCallback = (0, import_react61.useRef)(_temp10);
|
|
9028
8871
|
var t0;
|
|
9029
8872
|
if ($[0] !== callback) {
|
|
@@ -9106,7 +8949,7 @@ function _toPrimitive44(t, r) {
|
|
|
9106
8949
|
}
|
|
9107
8950
|
return ("string" === r ? String : Number)(t);
|
|
9108
8951
|
}
|
|
9109
|
-
function
|
|
8952
|
+
function asyncGeneratorStep10(n, t, e, r, o, a, c) {
|
|
9110
8953
|
try {
|
|
9111
8954
|
var i = n[a](c), u = i.value;
|
|
9112
8955
|
} catch (n2) {
|
|
@@ -9114,16 +8957,16 @@ function asyncGeneratorStep11(n, t, e, r, o, a, c) {
|
|
|
9114
8957
|
}
|
|
9115
8958
|
i.done ? t(u) : Promise.resolve(u).then(r, o);
|
|
9116
8959
|
}
|
|
9117
|
-
function
|
|
8960
|
+
function _asyncToGenerator10(n) {
|
|
9118
8961
|
return function() {
|
|
9119
8962
|
var t = this, e = arguments;
|
|
9120
8963
|
return new Promise(function(r, o) {
|
|
9121
8964
|
var a = n.apply(t, e);
|
|
9122
8965
|
function _next(n2) {
|
|
9123
|
-
|
|
8966
|
+
asyncGeneratorStep10(a, r, o, _next, _throw, "next", n2);
|
|
9124
8967
|
}
|
|
9125
8968
|
function _throw(n2) {
|
|
9126
|
-
|
|
8969
|
+
asyncGeneratorStep10(a, r, o, _next, _throw, "throw", n2);
|
|
9127
8970
|
}
|
|
9128
8971
|
_next(void 0);
|
|
9129
8972
|
});
|
|
@@ -9156,7 +8999,7 @@ var useRecorder = function(_ref) {
|
|
|
9156
8999
|
setNoiseStart(null);
|
|
9157
9000
|
},
|
|
9158
9001
|
onStop: function() {
|
|
9159
|
-
var _onStop2 =
|
|
9002
|
+
var _onStop2 = _asyncToGenerator10(function() {
|
|
9160
9003
|
var _arguments = arguments;
|
|
9161
9004
|
return _ts_generator(this, function(_state) {
|
|
9162
9005
|
switch(_state.label){
|
|
@@ -9276,7 +9119,7 @@ var useRecorder = function(_ref) {
|
|
|
9276
9119
|
});
|
|
9277
9120
|
};
|
|
9278
9121
|
// src/hooks/audioThreads/useMessageAudio/index.ts
|
|
9279
|
-
var
|
|
9122
|
+
var import_react_compiler_runtime49 = require("react-compiler-runtime");
|
|
9280
9123
|
var import_react63 = require("react");
|
|
9281
9124
|
var import_compromise = __toESM(require("compromise"), 1);
|
|
9282
9125
|
var import_howler = require("howler");
|
|
@@ -9358,7 +9201,8 @@ var getMessageSentences = function(_ref) {
|
|
|
9358
9201
|
});
|
|
9359
9202
|
};
|
|
9360
9203
|
var useMessageAudio = function(t0) {
|
|
9361
|
-
var $
|
|
9204
|
+
var _latestMessageProps$l;
|
|
9205
|
+
var $ = (0, import_react_compiler_runtime49.c)(50);
|
|
9362
9206
|
var _onEnd = t0.onEnd, passedPlay = t0.play;
|
|
9363
9207
|
var _ref = _sliced_to_array((0, import_react63.useState)(false), 2), isAudioPlayed = _ref[0], setIsAudioPlayed = _ref[1];
|
|
9364
9208
|
var t1;
|
|
@@ -9468,7 +9312,7 @@ var useMessageAudio = function(t0) {
|
|
|
9468
9312
|
var searchParams = new URLSearchParams(_objectSpread45({
|
|
9469
9313
|
input: input_0
|
|
9470
9314
|
}, superinterfaceContext.variables));
|
|
9471
|
-
audioPlayer.load("".concat(superinterfaceContext.baseUrl, "/tts?").concat(searchParams), {
|
|
9315
|
+
audioPlayer.load("".concat(superinterfaceContext.baseUrl, "/audio-runtimes/tts?").concat(searchParams), {
|
|
9472
9316
|
format: "mp3",
|
|
9473
9317
|
autoplay: isAudioPlayed,
|
|
9474
9318
|
html5: isHtmlAudioSupported,
|
|
@@ -9486,7 +9330,7 @@ var useMessageAudio = function(t0) {
|
|
|
9486
9330
|
var nextSearchParams = new URLSearchParams(_objectSpread45({
|
|
9487
9331
|
input: nextUnplayedMessageSentence.sentence
|
|
9488
9332
|
}, superinterfaceContext.variables));
|
|
9489
|
-
nextAudioPlayer.load("".concat(superinterfaceContext.baseUrl, "/tts?").concat(nextSearchParams), {
|
|
9333
|
+
nextAudioPlayer.load("".concat(superinterfaceContext.baseUrl, "/audio-runtimes/tts?").concat(nextSearchParams), {
|
|
9490
9334
|
format: "mp3",
|
|
9491
9335
|
autoplay: false,
|
|
9492
9336
|
html5: isHtmlAudioSupported
|
|
@@ -9673,7 +9517,7 @@ var useMessageAudio = function(t0) {
|
|
|
9673
9517
|
}
|
|
9674
9518
|
var visualizationAnalyser = t11;
|
|
9675
9519
|
var t12;
|
|
9676
|
-
t12 = isPlaying || unplayedMessageSentences.length > 0;
|
|
9520
|
+
t12 = isPlaying || unplayedMessageSentences.length > 0 || ((_latestMessageProps$l = latestMessageProps.latestMessage) === null || _latestMessageProps$l === void 0 ? void 0 : _latestMessageProps$l.status) === "in_progress";
|
|
9677
9521
|
var isPending = t12;
|
|
9678
9522
|
var t13;
|
|
9679
9523
|
if ($[45] !== audioPlayer || $[46] !== isAudioPlayed || $[47] !== isPending || $[48] !== visualizationAnalyser) {
|
|
@@ -9702,74 +9546,20 @@ function _temp11() {
|
|
|
9702
9546
|
import_howler.Howler._howls[0]._sounds[0]._node.crossOrigin = "anonymous";
|
|
9703
9547
|
}
|
|
9704
9548
|
}
|
|
9705
|
-
// src/
|
|
9549
|
+
// src/hooks/audioRuntimes/useTtsAudioRuntime/index.ts
|
|
9706
9550
|
var import_react_query10 = require("@tanstack/react-query");
|
|
9707
|
-
|
|
9708
|
-
var
|
|
9709
|
-
|
|
9710
|
-
|
|
9711
|
-
function
|
|
9712
|
-
|
|
9713
|
-
|
|
9714
|
-
|
|
9715
|
-
|
|
9716
|
-
|
|
9717
|
-
|
|
9718
|
-
|
|
9719
|
-
return t;
|
|
9720
|
-
}
|
|
9721
|
-
function _objectSpread46(e) {
|
|
9722
|
-
for(var r = 1; r < arguments.length; r++){
|
|
9723
|
-
var t = null != arguments[r] ? arguments[r] : {};
|
|
9724
|
-
r % 2 ? ownKeys46(Object(t), true).forEach(function(r2) {
|
|
9725
|
-
_defineProperty46(e, r2, t[r2]);
|
|
9726
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys46(Object(t)).forEach(function(r2) {
|
|
9727
|
-
Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
|
|
9728
|
-
});
|
|
9729
|
-
}
|
|
9730
|
-
return e;
|
|
9731
|
-
}
|
|
9732
|
-
function _defineProperty46(e, r, t) {
|
|
9733
|
-
return (r = _toPropertyKey46(r)) in e ? Object.defineProperty(e, r, {
|
|
9734
|
-
value: t,
|
|
9735
|
-
enumerable: true,
|
|
9736
|
-
configurable: true,
|
|
9737
|
-
writable: true
|
|
9738
|
-
}) : e[r] = t, e;
|
|
9739
|
-
}
|
|
9740
|
-
function _toPropertyKey46(t) {
|
|
9741
|
-
var i = _toPrimitive46(t, "string");
|
|
9742
|
-
return "symbol" == (typeof i === "undefined" ? "undefined" : _type_of(i)) ? i : i + "";
|
|
9743
|
-
}
|
|
9744
|
-
function _toPrimitive46(t, r) {
|
|
9745
|
-
if ("object" != (typeof t === "undefined" ? "undefined" : _type_of(t)) || !t) return t;
|
|
9746
|
-
var e = t[Symbol.toPrimitive];
|
|
9747
|
-
if (void 0 !== e) {
|
|
9748
|
-
var i = e.call(t, r || "default");
|
|
9749
|
-
if ("object" != (typeof i === "undefined" ? "undefined" : _type_of(i))) return i;
|
|
9750
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
9751
|
-
}
|
|
9752
|
-
return ("string" === r ? String : Number)(t);
|
|
9753
|
-
}
|
|
9754
|
-
function _objectWithoutProperties5(e, t) {
|
|
9755
|
-
if (null == e) return {};
|
|
9756
|
-
var o, r, i = _objectWithoutPropertiesLoose5(e, t);
|
|
9757
|
-
if (Object.getOwnPropertySymbols) {
|
|
9758
|
-
var s = Object.getOwnPropertySymbols(e);
|
|
9759
|
-
for(r = 0; r < s.length; r++)o = s[r], t.includes(o) || ({}).propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
9760
|
-
}
|
|
9761
|
-
return i;
|
|
9762
|
-
}
|
|
9763
|
-
function _objectWithoutPropertiesLoose5(r, e) {
|
|
9764
|
-
if (null == r) return {};
|
|
9765
|
-
var t = {};
|
|
9766
|
-
for(var n in r)if (({}).hasOwnProperty.call(r, n)) {
|
|
9767
|
-
if (e.includes(n)) continue;
|
|
9768
|
-
t[n] = r[n];
|
|
9769
|
-
}
|
|
9770
|
-
return t;
|
|
9771
|
-
}
|
|
9772
|
-
function asyncGeneratorStep12(n, t, e, r, o, a, c) {
|
|
9551
|
+
// src/hooks/audioRuntimes/useTtsAudioRuntime/blobToData.ts
|
|
9552
|
+
var blobToData = function(blob) {
|
|
9553
|
+
return new Promise(function(resolve) {
|
|
9554
|
+
var reader = new FileReader();
|
|
9555
|
+
reader.onloadend = function() {
|
|
9556
|
+
return resolve(reader.result);
|
|
9557
|
+
};
|
|
9558
|
+
reader.readAsDataURL(blob);
|
|
9559
|
+
});
|
|
9560
|
+
};
|
|
9561
|
+
// src/hooks/audioRuntimes/useTtsAudioRuntime/index.ts
|
|
9562
|
+
function asyncGeneratorStep11(n, t, e, r, o, a, c) {
|
|
9773
9563
|
try {
|
|
9774
9564
|
var i = n[a](c), u = i.value;
|
|
9775
9565
|
} catch (n2) {
|
|
@@ -9777,27 +9567,37 @@ function asyncGeneratorStep12(n, t, e, r, o, a, c) {
|
|
|
9777
9567
|
}
|
|
9778
9568
|
i.done ? t(u) : Promise.resolve(u).then(r, o);
|
|
9779
9569
|
}
|
|
9780
|
-
function
|
|
9570
|
+
function _asyncToGenerator11(n) {
|
|
9781
9571
|
return function() {
|
|
9782
9572
|
var t = this, e = arguments;
|
|
9783
9573
|
return new Promise(function(r, o) {
|
|
9784
9574
|
var a = n.apply(t, e);
|
|
9785
9575
|
function _next(n2) {
|
|
9786
|
-
|
|
9576
|
+
asyncGeneratorStep11(a, r, o, _next, _throw, "next", n2);
|
|
9787
9577
|
}
|
|
9788
9578
|
function _throw(n2) {
|
|
9789
|
-
|
|
9579
|
+
asyncGeneratorStep11(a, r, o, _next, _throw, "throw", n2);
|
|
9790
9580
|
}
|
|
9791
9581
|
_next(void 0);
|
|
9792
9582
|
});
|
|
9793
9583
|
};
|
|
9794
9584
|
}
|
|
9795
|
-
var
|
|
9796
|
-
var $ = (0,
|
|
9797
|
-
var
|
|
9585
|
+
var useTtsAudioRuntime = function(t0) {
|
|
9586
|
+
var $ = (0, import_react_compiler_runtime50.c)(30);
|
|
9587
|
+
var play = t0.play;
|
|
9798
9588
|
var addToast = useToasts().addToast;
|
|
9799
9589
|
var queryClient = (0, import_react_query10.useQueryClient)();
|
|
9800
9590
|
var threadContext = useSuperinterfaceContext();
|
|
9591
|
+
var t1;
|
|
9592
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
9593
|
+
t1 = {
|
|
9594
|
+
name: "microphone"
|
|
9595
|
+
};
|
|
9596
|
+
$[0] = t1;
|
|
9597
|
+
} else {
|
|
9598
|
+
t1 = $[0];
|
|
9599
|
+
}
|
|
9600
|
+
var microphonePermission = usePermission(t1);
|
|
9801
9601
|
var createMessageProps = useCreateMessage({
|
|
9802
9602
|
onError: function(error) {
|
|
9803
9603
|
createMessageDefaultOnError({
|
|
@@ -9808,13 +9608,13 @@ var Content8 = function(t0) {
|
|
|
9808
9608
|
recorderProps.start();
|
|
9809
9609
|
}
|
|
9810
9610
|
});
|
|
9811
|
-
var
|
|
9812
|
-
if ($[
|
|
9813
|
-
|
|
9611
|
+
var t2;
|
|
9612
|
+
if ($[1] !== createMessageProps) {
|
|
9613
|
+
t2 = {
|
|
9814
9614
|
isStopOnSilence: true,
|
|
9815
9615
|
onStart: _temp12,
|
|
9816
9616
|
onStop: function() {
|
|
9817
|
-
var _onStop =
|
|
9617
|
+
var _onStop = _asyncToGenerator11(function(_event, chunks) {
|
|
9818
9618
|
var blob, audioContent;
|
|
9819
9619
|
return _ts_generator(this, function(_state) {
|
|
9820
9620
|
switch(_state.label){
|
|
@@ -9843,22 +9643,12 @@ var Content8 = function(t0) {
|
|
|
9843
9643
|
return onStop;
|
|
9844
9644
|
}()
|
|
9845
9645
|
};
|
|
9846
|
-
$[
|
|
9847
|
-
$[1] = t1;
|
|
9848
|
-
} else {
|
|
9849
|
-
t1 = $[1];
|
|
9850
|
-
}
|
|
9851
|
-
var recorderProps = useRecorder(t1);
|
|
9852
|
-
var t2;
|
|
9853
|
-
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
9854
|
-
t2 = {
|
|
9855
|
-
name: "microphone"
|
|
9856
|
-
};
|
|
9646
|
+
$[1] = createMessageProps;
|
|
9857
9647
|
$[2] = t2;
|
|
9858
9648
|
} else {
|
|
9859
9649
|
t2 = $[2];
|
|
9860
9650
|
}
|
|
9861
|
-
var
|
|
9651
|
+
var recorderProps = useRecorder(t2);
|
|
9862
9652
|
var t3;
|
|
9863
9653
|
if ($[3] !== microphonePermission || $[4] !== recorderProps) {
|
|
9864
9654
|
t3 = function() {
|
|
@@ -9885,81 +9675,91 @@ var Content8 = function(t0) {
|
|
|
9885
9675
|
t4 = $[8];
|
|
9886
9676
|
}
|
|
9887
9677
|
var messageAudioProps = useMessageAudio(t4);
|
|
9888
|
-
|
|
9889
|
-
|
|
9890
|
-
|
|
9891
|
-
|
|
9892
|
-
|
|
9893
|
-
|
|
9894
|
-
|
|
9678
|
+
recorderProps;
|
|
9679
|
+
recorderProps;
|
|
9680
|
+
recorderProps;
|
|
9681
|
+
recorderProps;
|
|
9682
|
+
recorderProps;
|
|
9683
|
+
recorderProps;
|
|
9684
|
+
recorderProps;
|
|
9685
|
+
var t5;
|
|
9686
|
+
var t6 = recorderProps;
|
|
9687
|
+
var t7 = recorderProps;
|
|
9688
|
+
var t8 = recorderProps;
|
|
9689
|
+
var t9 = recorderProps;
|
|
9690
|
+
var t10 = recorderProps;
|
|
9691
|
+
var t11 = recorderProps;
|
|
9692
|
+
var t12;
|
|
9693
|
+
if ($[9] !== createMessageProps.isPending || $[10] !== t10.visualizationAnalyser || $[11] !== t11.status || $[12] !== t6.start || $[13] !== t7.stop || $[14] !== t8.pause || $[15] !== t9.resume) {
|
|
9694
|
+
t12 = {
|
|
9695
|
+
start: t6.start,
|
|
9696
|
+
stop: t7.stop,
|
|
9697
|
+
pause: t8.pause,
|
|
9698
|
+
resume: t9.resume,
|
|
9699
|
+
isPending: createMessageProps.isPending,
|
|
9700
|
+
visualizationAnalyser: t10.visualizationAnalyser,
|
|
9701
|
+
rawStatus: t11.status
|
|
9895
9702
|
};
|
|
9896
|
-
$[9] = createMessageProps;
|
|
9897
|
-
$[10] =
|
|
9898
|
-
$[11] =
|
|
9899
|
-
$[12] = t6;
|
|
9703
|
+
$[9] = createMessageProps.isPending;
|
|
9704
|
+
$[10] = t10.visualizationAnalyser;
|
|
9705
|
+
$[11] = t11.status;
|
|
9706
|
+
$[12] = t6.start;
|
|
9707
|
+
$[13] = t7.stop;
|
|
9708
|
+
$[14] = t8.pause;
|
|
9709
|
+
$[15] = t9.resume;
|
|
9710
|
+
$[16] = t12;
|
|
9900
9711
|
} else {
|
|
9901
|
-
|
|
9712
|
+
t12 = $[16];
|
|
9902
9713
|
}
|
|
9903
|
-
var
|
|
9904
|
-
|
|
9905
|
-
|
|
9906
|
-
|
|
9907
|
-
|
|
9908
|
-
|
|
9909
|
-
|
|
9910
|
-
|
|
9714
|
+
var t13;
|
|
9715
|
+
if ($[17] !== messageAudioProps.isAudioPlayed || $[18] !== messageAudioProps.isPending || $[19] !== messageAudioProps.isReady || $[20] !== messageAudioProps.pause || $[21] !== messageAudioProps.paused || $[22] !== messageAudioProps.play || $[23] !== messageAudioProps.playing || $[24] !== messageAudioProps.stop || $[25] !== messageAudioProps.visualizationAnalyser) {
|
|
9716
|
+
t13 = {
|
|
9717
|
+
play: messageAudioProps.play,
|
|
9718
|
+
pause: messageAudioProps.pause,
|
|
9719
|
+
stop: messageAudioProps.stop,
|
|
9720
|
+
visualizationAnalyser: messageAudioProps.visualizationAnalyser,
|
|
9721
|
+
playing: messageAudioProps.playing,
|
|
9722
|
+
paused: messageAudioProps.paused,
|
|
9723
|
+
isPending: messageAudioProps.isPending,
|
|
9724
|
+
isReady: messageAudioProps.isReady,
|
|
9725
|
+
isAudioPlayed: messageAudioProps.isAudioPlayed,
|
|
9726
|
+
rawStatus: void 0
|
|
9911
9727
|
};
|
|
9912
|
-
$[
|
|
9913
|
-
$[
|
|
9914
|
-
$[
|
|
9915
|
-
$[
|
|
9916
|
-
|
|
9917
|
-
|
|
9918
|
-
|
|
9919
|
-
|
|
9920
|
-
|
|
9921
|
-
|
|
9922
|
-
|
|
9923
|
-
|
|
9924
|
-
|
|
9925
|
-
|
|
9926
|
-
|
|
9927
|
-
|
|
9928
|
-
|
|
9929
|
-
|
|
9930
|
-
|
|
9931
|
-
|
|
9932
|
-
|
|
9933
|
-
|
|
9934
|
-
|
|
9935
|
-
|
|
9936
|
-
var t10;
|
|
9937
|
-
if ($[21] !== t8 || $[22] !== t9) {
|
|
9938
|
-
t10 = /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(AudioThreadContext.Provider, {
|
|
9939
|
-
value: t8,
|
|
9940
|
-
children: t9
|
|
9941
|
-
});
|
|
9942
|
-
$[21] = t8;
|
|
9943
|
-
$[22] = t9;
|
|
9944
|
-
$[23] = t10;
|
|
9728
|
+
$[17] = messageAudioProps.isAudioPlayed;
|
|
9729
|
+
$[18] = messageAudioProps.isPending;
|
|
9730
|
+
$[19] = messageAudioProps.isReady;
|
|
9731
|
+
$[20] = messageAudioProps.pause;
|
|
9732
|
+
$[21] = messageAudioProps.paused;
|
|
9733
|
+
$[22] = messageAudioProps.play;
|
|
9734
|
+
$[23] = messageAudioProps.playing;
|
|
9735
|
+
$[24] = messageAudioProps.stop;
|
|
9736
|
+
$[25] = messageAudioProps.visualizationAnalyser;
|
|
9737
|
+
$[26] = t13;
|
|
9738
|
+
} else {
|
|
9739
|
+
t13 = $[26];
|
|
9740
|
+
}
|
|
9741
|
+
var t14;
|
|
9742
|
+
if ($[27] !== t12 || $[28] !== t13) {
|
|
9743
|
+
t14 = {
|
|
9744
|
+
ttsAudioRuntime: {
|
|
9745
|
+
user: t12,
|
|
9746
|
+
assistant: t13
|
|
9747
|
+
}
|
|
9748
|
+
};
|
|
9749
|
+
$[27] = t12;
|
|
9750
|
+
$[28] = t13;
|
|
9751
|
+
$[29] = t14;
|
|
9945
9752
|
} else {
|
|
9946
|
-
|
|
9753
|
+
t14 = $[29];
|
|
9947
9754
|
}
|
|
9948
|
-
|
|
9949
|
-
|
|
9950
|
-
var Root12 = function(_ref) {
|
|
9951
|
-
var children = _ref.children, rest = _objectWithoutProperties5(_ref, _excluded5);
|
|
9952
|
-
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(ToastsProvider, {
|
|
9953
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Content8, _objectSpread46(_objectSpread46({}, rest), {}, {
|
|
9954
|
-
children: children
|
|
9955
|
-
}))
|
|
9956
|
-
});
|
|
9755
|
+
t5 = t14;
|
|
9756
|
+
return t5;
|
|
9957
9757
|
};
|
|
9958
9758
|
function _temp12() {
|
|
9959
9759
|
return _temp23.apply(this, arguments);
|
|
9960
9760
|
}
|
|
9961
9761
|
function _temp23() {
|
|
9962
|
-
_temp23 =
|
|
9762
|
+
_temp23 = _asyncToGenerator11(function() {
|
|
9963
9763
|
return _ts_generator(this, function(_state) {
|
|
9964
9764
|
return [
|
|
9965
9765
|
2
|
|
@@ -9968,21 +9768,215 @@ function _temp23() {
|
|
|
9968
9768
|
});
|
|
9969
9769
|
return _temp23.apply(this, arguments);
|
|
9970
9770
|
}
|
|
9771
|
+
// src/components/audioRuntimes/TtsAudioRuntimeProvider.tsx
|
|
9772
|
+
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
9773
|
+
var TtsAudioRuntimeProvider = function(t0) {
|
|
9774
|
+
var $ = (0, import_react_compiler_runtime51.c)(7);
|
|
9775
|
+
var children = t0.children, play = t0.play;
|
|
9776
|
+
var t1;
|
|
9777
|
+
if ($[0] !== play) {
|
|
9778
|
+
t1 = {
|
|
9779
|
+
play: play
|
|
9780
|
+
};
|
|
9781
|
+
$[0] = play;
|
|
9782
|
+
$[1] = t1;
|
|
9783
|
+
} else {
|
|
9784
|
+
t1 = $[1];
|
|
9785
|
+
}
|
|
9786
|
+
var ttsAudioRuntime = useTtsAudioRuntime(t1).ttsAudioRuntime;
|
|
9787
|
+
var t2;
|
|
9788
|
+
if ($[2] !== ttsAudioRuntime) {
|
|
9789
|
+
t2 = {
|
|
9790
|
+
audioRuntime: ttsAudioRuntime
|
|
9791
|
+
};
|
|
9792
|
+
$[2] = ttsAudioRuntime;
|
|
9793
|
+
$[3] = t2;
|
|
9794
|
+
} else {
|
|
9795
|
+
t2 = $[3];
|
|
9796
|
+
}
|
|
9797
|
+
var t3;
|
|
9798
|
+
if ($[4] !== children || $[5] !== t2) {
|
|
9799
|
+
t3 = /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(AudioThreadContext.Provider, {
|
|
9800
|
+
value: t2,
|
|
9801
|
+
children: children
|
|
9802
|
+
});
|
|
9803
|
+
$[4] = children;
|
|
9804
|
+
$[5] = t2;
|
|
9805
|
+
$[6] = t3;
|
|
9806
|
+
} else {
|
|
9807
|
+
t3 = $[6];
|
|
9808
|
+
}
|
|
9809
|
+
return t3;
|
|
9810
|
+
};
|
|
9811
|
+
// src/components/threads/AudioThread/Root/index.tsx
|
|
9812
|
+
var import_jsx_runtime83 = require("react/jsx-runtime");
|
|
9813
|
+
var _excluded5 = [
|
|
9814
|
+
"children"
|
|
9815
|
+
];
|
|
9816
|
+
var _excluded22 = [
|
|
9817
|
+
"children",
|
|
9818
|
+
"play",
|
|
9819
|
+
"className",
|
|
9820
|
+
"style"
|
|
9821
|
+
];
|
|
9822
|
+
function ownKeys46(e, r) {
|
|
9823
|
+
var t = Object.keys(e);
|
|
9824
|
+
if (Object.getOwnPropertySymbols) {
|
|
9825
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
9826
|
+
r && (o = o.filter(function(r2) {
|
|
9827
|
+
return Object.getOwnPropertyDescriptor(e, r2).enumerable;
|
|
9828
|
+
})), t.push.apply(t, o);
|
|
9829
|
+
}
|
|
9830
|
+
return t;
|
|
9831
|
+
}
|
|
9832
|
+
function _objectSpread46(e) {
|
|
9833
|
+
for(var r = 1; r < arguments.length; r++){
|
|
9834
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
9835
|
+
r % 2 ? ownKeys46(Object(t), true).forEach(function(r2) {
|
|
9836
|
+
_defineProperty46(e, r2, t[r2]);
|
|
9837
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys46(Object(t)).forEach(function(r2) {
|
|
9838
|
+
Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
|
|
9839
|
+
});
|
|
9840
|
+
}
|
|
9841
|
+
return e;
|
|
9842
|
+
}
|
|
9843
|
+
function _defineProperty46(e, r, t) {
|
|
9844
|
+
return (r = _toPropertyKey46(r)) in e ? Object.defineProperty(e, r, {
|
|
9845
|
+
value: t,
|
|
9846
|
+
enumerable: true,
|
|
9847
|
+
configurable: true,
|
|
9848
|
+
writable: true
|
|
9849
|
+
}) : e[r] = t, e;
|
|
9850
|
+
}
|
|
9851
|
+
function _toPropertyKey46(t) {
|
|
9852
|
+
var i = _toPrimitive46(t, "string");
|
|
9853
|
+
return "symbol" == (typeof i === "undefined" ? "undefined" : _type_of(i)) ? i : i + "";
|
|
9854
|
+
}
|
|
9855
|
+
function _toPrimitive46(t, r) {
|
|
9856
|
+
if ("object" != (typeof t === "undefined" ? "undefined" : _type_of(t)) || !t) return t;
|
|
9857
|
+
var e = t[Symbol.toPrimitive];
|
|
9858
|
+
if (void 0 !== e) {
|
|
9859
|
+
var i = e.call(t, r || "default");
|
|
9860
|
+
if ("object" != (typeof i === "undefined" ? "undefined" : _type_of(i))) return i;
|
|
9861
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
9862
|
+
}
|
|
9863
|
+
return ("string" === r ? String : Number)(t);
|
|
9864
|
+
}
|
|
9865
|
+
function _objectWithoutProperties5(e, t) {
|
|
9866
|
+
if (null == e) return {};
|
|
9867
|
+
var o, r, i = _objectWithoutPropertiesLoose5(e, t);
|
|
9868
|
+
if (Object.getOwnPropertySymbols) {
|
|
9869
|
+
var s = Object.getOwnPropertySymbols(e);
|
|
9870
|
+
for(r = 0; r < s.length; r++)o = s[r], t.includes(o) || ({}).propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
9871
|
+
}
|
|
9872
|
+
return i;
|
|
9873
|
+
}
|
|
9874
|
+
function _objectWithoutPropertiesLoose5(r, e) {
|
|
9875
|
+
if (null == r) return {};
|
|
9876
|
+
var t = {};
|
|
9877
|
+
for(var n in r)if (({}).hasOwnProperty.call(r, n)) {
|
|
9878
|
+
if (e.includes(n)) continue;
|
|
9879
|
+
t[n] = r[n];
|
|
9880
|
+
}
|
|
9881
|
+
return t;
|
|
9882
|
+
}
|
|
9883
|
+
var Content8 = function(_ref) {
|
|
9884
|
+
var children = _ref.children, className = _ref.className, style = _ref.style;
|
|
9885
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(import_themes58.Flex, {
|
|
9886
|
+
direction: "column",
|
|
9887
|
+
flexGrow: "1",
|
|
9888
|
+
p: "9",
|
|
9889
|
+
className: className,
|
|
9890
|
+
style: style,
|
|
9891
|
+
children: children
|
|
9892
|
+
});
|
|
9893
|
+
};
|
|
9894
|
+
var AudioRuntimeProvider = function(t0) {
|
|
9895
|
+
var $ = (0, import_react_compiler_runtime52.c)(3);
|
|
9896
|
+
var children = t0.children, play = t0.play;
|
|
9897
|
+
var audioThreadContext = useAudioThreadContext();
|
|
9898
|
+
if (audioThreadContext.audioRuntime) {
|
|
9899
|
+
return children;
|
|
9900
|
+
}
|
|
9901
|
+
var t1;
|
|
9902
|
+
if ($[0] !== children || $[1] !== play) {
|
|
9903
|
+
t1 = /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(TtsAudioRuntimeProvider, {
|
|
9904
|
+
play: play,
|
|
9905
|
+
children: children
|
|
9906
|
+
});
|
|
9907
|
+
$[0] = children;
|
|
9908
|
+
$[1] = play;
|
|
9909
|
+
$[2] = t1;
|
|
9910
|
+
} else {
|
|
9911
|
+
t1 = $[2];
|
|
9912
|
+
}
|
|
9913
|
+
return t1;
|
|
9914
|
+
};
|
|
9915
|
+
var Provider5 = function(t0) {
|
|
9916
|
+
var $ = (0, import_react_compiler_runtime52.c)(9);
|
|
9917
|
+
var children;
|
|
9918
|
+
var rest;
|
|
9919
|
+
if ($[0] !== t0) {
|
|
9920
|
+
var _t = t0;
|
|
9921
|
+
children = _t.children;
|
|
9922
|
+
rest = _objectWithoutProperties5(_t, _excluded5);
|
|
9923
|
+
_t;
|
|
9924
|
+
$[0] = t0;
|
|
9925
|
+
$[1] = children;
|
|
9926
|
+
$[2] = rest;
|
|
9927
|
+
} else {
|
|
9928
|
+
children = $[1];
|
|
9929
|
+
rest = $[2];
|
|
9930
|
+
}
|
|
9931
|
+
var audioThreadContext = useAudioThreadContext();
|
|
9932
|
+
var t1;
|
|
9933
|
+
if ($[3] !== audioThreadContext || $[4] !== rest) {
|
|
9934
|
+
t1 = _objectSpread46(_objectSpread46({}, audioThreadContext), rest);
|
|
9935
|
+
$[3] = audioThreadContext;
|
|
9936
|
+
$[4] = rest;
|
|
9937
|
+
$[5] = t1;
|
|
9938
|
+
} else {
|
|
9939
|
+
t1 = $[5];
|
|
9940
|
+
}
|
|
9941
|
+
var t2;
|
|
9942
|
+
if ($[6] !== children || $[7] !== t1) {
|
|
9943
|
+
t2 = /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(AudioThreadContext.Provider, {
|
|
9944
|
+
value: t1,
|
|
9945
|
+
children: children
|
|
9946
|
+
});
|
|
9947
|
+
$[6] = children;
|
|
9948
|
+
$[7] = t1;
|
|
9949
|
+
$[8] = t2;
|
|
9950
|
+
} else {
|
|
9951
|
+
t2 = $[8];
|
|
9952
|
+
}
|
|
9953
|
+
return t2;
|
|
9954
|
+
};
|
|
9955
|
+
var Root12 = function(_ref2) {
|
|
9956
|
+
var children = _ref2.children, play = _ref2.play, className = _ref2.className, style = _ref2.style, rest = _objectWithoutProperties5(_ref2, _excluded22);
|
|
9957
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Provider5, _objectSpread46(_objectSpread46({}, rest), {}, {
|
|
9958
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(AudioRuntimeProvider, {
|
|
9959
|
+
play: play,
|
|
9960
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(ToastsProvider, {
|
|
9961
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Content8, {
|
|
9962
|
+
className: className,
|
|
9963
|
+
style: style,
|
|
9964
|
+
children: children
|
|
9965
|
+
})
|
|
9966
|
+
})
|
|
9967
|
+
})
|
|
9968
|
+
}));
|
|
9969
|
+
};
|
|
9971
9970
|
// src/components/threads/AudioThread/Visualization/index.tsx
|
|
9972
|
-
var
|
|
9971
|
+
var import_react67 = require("react");
|
|
9973
9972
|
var import_lodash9 = __toESM(require("lodash"), 1);
|
|
9974
9973
|
var import_themes60 = require("@radix-ui/themes");
|
|
9975
|
-
// src/hooks/threads/useAudioThreadContext/index.ts
|
|
9976
|
-
var import_react64 = require("react");
|
|
9977
|
-
var useAudioThreadContext = function() {
|
|
9978
|
-
return (0, import_react64.useContext)(AudioThreadContext);
|
|
9979
|
-
};
|
|
9980
9974
|
// src/components/threads/AudioThread/BarsVisualizer/index.tsx
|
|
9981
9975
|
var import_lodash8 = __toESM(require("lodash"), 1);
|
|
9982
9976
|
var import_themes59 = require("@radix-ui/themes");
|
|
9983
9977
|
var import_react65 = require("react");
|
|
9984
9978
|
var import_radash17 = require("radash");
|
|
9985
|
-
var
|
|
9979
|
+
var import_jsx_runtime84 = require("react/jsx-runtime");
|
|
9986
9980
|
var barCount = 4;
|
|
9987
9981
|
var BarsVisualizer = function(_ref) {
|
|
9988
9982
|
var visualizationAnalyser = _ref.visualizationAnalyser, backgroundColor = _ref.backgroundColor, height = _ref.height, barWidth = _ref.barWidth;
|
|
@@ -10013,7 +10007,7 @@ var BarsVisualizer = function(_ref) {
|
|
|
10013
10007
|
draw,
|
|
10014
10008
|
visualizationAnalyser
|
|
10015
10009
|
]);
|
|
10016
|
-
return /* @__PURE__ */ (0,
|
|
10010
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_themes59.Grid, {
|
|
10017
10011
|
columns: "".concat(barCount),
|
|
10018
10012
|
gap: "1",
|
|
10019
10013
|
width: "auto",
|
|
@@ -10022,12 +10016,12 @@ var BarsVisualizer = function(_ref) {
|
|
|
10022
10016
|
gridTemplateColumns: "repeat(4, minmax(0, 1fr))"
|
|
10023
10017
|
},
|
|
10024
10018
|
children: barHeights.map(function(barHeight, index) {
|
|
10025
|
-
return /* @__PURE__ */ (0,
|
|
10019
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_themes59.Flex, {
|
|
10026
10020
|
direction: "column",
|
|
10027
10021
|
align: "center",
|
|
10028
10022
|
justify: "center",
|
|
10029
10023
|
height: height,
|
|
10030
|
-
children: /* @__PURE__ */ (0,
|
|
10024
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_themes59.Flex, {
|
|
10031
10025
|
minHeight: "50%",
|
|
10032
10026
|
maxHeight: "100%",
|
|
10033
10027
|
height: "".concat(barHeight + 20, "%"),
|
|
@@ -10041,8 +10035,59 @@ var BarsVisualizer = function(_ref) {
|
|
|
10041
10035
|
})
|
|
10042
10036
|
});
|
|
10043
10037
|
};
|
|
10038
|
+
// src/hooks/audioThreads/useStatus/index.ts
|
|
10039
|
+
var import_react_compiler_runtime53 = require("react-compiler-runtime");
|
|
10040
|
+
var import_react66 = require("react");
|
|
10041
|
+
var useStatus = function() {
|
|
10042
|
+
var $ = (0, import_react_compiler_runtime53.c)(2);
|
|
10043
|
+
var audioRuntime = useAudioThreadContext().audioRuntime;
|
|
10044
|
+
var t0;
|
|
10045
|
+
bb0: {
|
|
10046
|
+
if (audioRuntime.user.rawStatus === "recording") {
|
|
10047
|
+
t0 = "recording";
|
|
10048
|
+
break bb0;
|
|
10049
|
+
}
|
|
10050
|
+
if (audioRuntime.user.isPending) {
|
|
10051
|
+
t0 = "creatingMessage";
|
|
10052
|
+
break bb0;
|
|
10053
|
+
}
|
|
10054
|
+
if (audioRuntime.assistant.paused || !audioRuntime.assistant.isAudioPlayed) {
|
|
10055
|
+
t0 = "playerPaused";
|
|
10056
|
+
break bb0;
|
|
10057
|
+
}
|
|
10058
|
+
if (audioRuntime.assistant.playing || audioRuntime.assistant.isPending) {
|
|
10059
|
+
t0 = "playing";
|
|
10060
|
+
break bb0;
|
|
10061
|
+
}
|
|
10062
|
+
if (!audioRuntime.assistant.isAudioPlayed && !audioRuntime.assistant.isReady) {
|
|
10063
|
+
t0 = "loading";
|
|
10064
|
+
break bb0;
|
|
10065
|
+
}
|
|
10066
|
+
if (audioRuntime.user.rawStatus === "idle") {
|
|
10067
|
+
t0 = "idle";
|
|
10068
|
+
break bb0;
|
|
10069
|
+
}
|
|
10070
|
+
if (audioRuntime.user.rawStatus === "paused") {
|
|
10071
|
+
t0 = "recorderPaused";
|
|
10072
|
+
break bb0;
|
|
10073
|
+
}
|
|
10074
|
+
t0 = "loading";
|
|
10075
|
+
}
|
|
10076
|
+
var status = t0;
|
|
10077
|
+
var t1;
|
|
10078
|
+
if ($[0] !== status) {
|
|
10079
|
+
t1 = {
|
|
10080
|
+
status: status
|
|
10081
|
+
};
|
|
10082
|
+
$[0] = status;
|
|
10083
|
+
$[1] = t1;
|
|
10084
|
+
} else {
|
|
10085
|
+
t1 = $[1];
|
|
10086
|
+
}
|
|
10087
|
+
return t1;
|
|
10088
|
+
};
|
|
10044
10089
|
// src/components/threads/AudioThread/Visualization/index.tsx
|
|
10045
|
-
var
|
|
10090
|
+
var import_jsx_runtime85 = require("react/jsx-runtime");
|
|
10046
10091
|
function ownKeys47(e, r) {
|
|
10047
10092
|
var t = Object.keys(e);
|
|
10048
10093
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -10087,10 +10132,11 @@ function _toPrimitive47(t, r) {
|
|
|
10087
10132
|
return ("string" === r ? String : Number)(t);
|
|
10088
10133
|
}
|
|
10089
10134
|
var Visualization = function(props) {
|
|
10135
|
+
var status = useStatus().status;
|
|
10090
10136
|
var audioThreadContext = useAudioThreadContext();
|
|
10091
|
-
var assistantNameContext = (0,
|
|
10092
|
-
var _ref = _sliced_to_array((0,
|
|
10093
|
-
var draw = (0,
|
|
10137
|
+
var assistantNameContext = (0, import_react67.useContext)(AssistantNameContext);
|
|
10138
|
+
var _ref = _sliced_to_array((0, import_react67.useState)(0), 2), scale = _ref[0], setScale = _ref[1];
|
|
10139
|
+
var draw = (0, import_react67.useCallback)(function(_ref) {
|
|
10094
10140
|
var visualizationAnalyser = _ref.visualizationAnalyser;
|
|
10095
10141
|
if (!visualizationAnalyser) {
|
|
10096
10142
|
setScale(1);
|
|
@@ -10105,15 +10151,15 @@ var Visualization = function(props) {
|
|
|
10105
10151
|
});
|
|
10106
10152
|
});
|
|
10107
10153
|
}, []);
|
|
10108
|
-
(0,
|
|
10154
|
+
(0, import_react67.useEffect)(function() {
|
|
10109
10155
|
draw({
|
|
10110
|
-
visualizationAnalyser: audioThreadContext.
|
|
10156
|
+
visualizationAnalyser: audioThreadContext.audioRuntime.user.visualizationAnalyser
|
|
10111
10157
|
});
|
|
10112
10158
|
}, [
|
|
10113
10159
|
draw,
|
|
10114
10160
|
audioThreadContext
|
|
10115
10161
|
]);
|
|
10116
|
-
return /* @__PURE__ */ (0,
|
|
10162
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(import_themes60.Flex, _objectSpread47(_objectSpread47({
|
|
10117
10163
|
direction: "column",
|
|
10118
10164
|
align: "center",
|
|
10119
10165
|
justify: "center",
|
|
@@ -10121,30 +10167,30 @@ var Visualization = function(props) {
|
|
|
10121
10167
|
flexGrow: "1"
|
|
10122
10168
|
}, props), {}, {
|
|
10123
10169
|
children: [
|
|
10124
|
-
/* @__PURE__ */ (0,
|
|
10170
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_themes60.Flex, {
|
|
10125
10171
|
align: "center",
|
|
10126
10172
|
justify: "center",
|
|
10127
10173
|
height: "200px",
|
|
10128
10174
|
width: "200px",
|
|
10129
10175
|
style: {
|
|
10130
|
-
backgroundColor:
|
|
10176
|
+
backgroundColor: status === "playing" ? "var(--accent-4)" : "var(--gray-4)",
|
|
10131
10177
|
borderRadius: "9999px",
|
|
10132
10178
|
scale: scale
|
|
10133
10179
|
},
|
|
10134
|
-
children: /* @__PURE__ */ (0,
|
|
10135
|
-
visualizationAnalyser: audioThreadContext.
|
|
10136
|
-
backgroundColor:
|
|
10180
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(BarsVisualizer, {
|
|
10181
|
+
visualizationAnalyser: audioThreadContext.audioRuntime.assistant.visualizationAnalyser,
|
|
10182
|
+
backgroundColor: status === "playing" ? "var(--accent-11)" : "var(--gray-11)",
|
|
10137
10183
|
height: "40px",
|
|
10138
10184
|
barWidth: "24px"
|
|
10139
10185
|
})
|
|
10140
10186
|
}),
|
|
10141
|
-
/* @__PURE__ */ (0,
|
|
10187
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(import_themes60.Flex, {
|
|
10142
10188
|
ml: "-22.5px",
|
|
10143
10189
|
gap: "3",
|
|
10144
10190
|
pt: "5",
|
|
10145
10191
|
children: [
|
|
10146
|
-
/* @__PURE__ */ (0,
|
|
10147
|
-
/* @__PURE__ */ (0,
|
|
10192
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(AssistantAvatar, {}),
|
|
10193
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(Name, {
|
|
10148
10194
|
children: assistantNameContext
|
|
10149
10195
|
})
|
|
10150
10196
|
]
|
|
@@ -10153,10 +10199,10 @@ var Visualization = function(props) {
|
|
|
10153
10199
|
}));
|
|
10154
10200
|
};
|
|
10155
10201
|
// src/components/threads/AudioThread/Status/index.tsx
|
|
10156
|
-
var
|
|
10202
|
+
var import_react_compiler_runtime54 = require("react-compiler-runtime");
|
|
10157
10203
|
// src/components/threads/AudioThread/Status/StatusMessages.tsx
|
|
10158
10204
|
var import_themes61 = require("@radix-ui/themes");
|
|
10159
|
-
var
|
|
10205
|
+
var import_jsx_runtime86 = require("react/jsx-runtime");
|
|
10160
10206
|
var html = function(_ref) {
|
|
10161
10207
|
var texts = _ref.texts;
|
|
10162
10208
|
return "\n .status-messages-texts:after {\n content: '".concat(texts[0], "';\n animation: texts ").concat(texts.length * 5, "s linear infinite;\n }\n\n @keyframes texts {\n ").concat(texts.map(function(_10, i) {
|
|
@@ -10165,19 +10211,19 @@ var html = function(_ref) {
|
|
|
10165
10211
|
};
|
|
10166
10212
|
var StatusMessages = function(_ref2) {
|
|
10167
10213
|
var texts = _ref2.texts, className = _ref2.className, style = _ref2.style;
|
|
10168
|
-
return /* @__PURE__ */ (0,
|
|
10214
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(import_themes61.Flex, {
|
|
10169
10215
|
justify: "center",
|
|
10170
10216
|
pb: "5",
|
|
10171
10217
|
className: className,
|
|
10172
10218
|
style: style,
|
|
10173
10219
|
children: [
|
|
10174
|
-
/* @__PURE__ */ (0,
|
|
10220
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_themes61.Text, {
|
|
10175
10221
|
size: "2",
|
|
10176
10222
|
weight: "regular",
|
|
10177
10223
|
color: "gray",
|
|
10178
10224
|
className: "status-messages-texts"
|
|
10179
10225
|
}),
|
|
10180
|
-
/* @__PURE__ */ (0,
|
|
10226
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("style", {
|
|
10181
10227
|
dangerouslySetInnerHTML: {
|
|
10182
10228
|
__html: html({
|
|
10183
10229
|
texts: texts
|
|
@@ -10188,7 +10234,7 @@ var StatusMessages = function(_ref2) {
|
|
|
10188
10234
|
});
|
|
10189
10235
|
};
|
|
10190
10236
|
// src/components/threads/AudioThread/Status/index.tsx
|
|
10191
|
-
var
|
|
10237
|
+
var import_jsx_runtime87 = require("react/jsx-runtime");
|
|
10192
10238
|
function ownKeys48(e, r) {
|
|
10193
10239
|
var t = Object.keys(e);
|
|
10194
10240
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -10233,9 +10279,9 @@ function _toPrimitive48(t, r) {
|
|
|
10233
10279
|
return ("string" === r ? String : Number)(t);
|
|
10234
10280
|
}
|
|
10235
10281
|
var Status = function(props) {
|
|
10236
|
-
var $ = (0,
|
|
10237
|
-
var
|
|
10238
|
-
if (
|
|
10282
|
+
var $ = (0, import_react_compiler_runtime54.c)(12);
|
|
10283
|
+
var status = useStatus().status;
|
|
10284
|
+
if (status === "recording") {
|
|
10239
10285
|
var _t;
|
|
10240
10286
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
10241
10287
|
_t = [
|
|
@@ -10250,7 +10296,7 @@ var Status = function(props) {
|
|
|
10250
10296
|
}
|
|
10251
10297
|
var _t2;
|
|
10252
10298
|
if ($[1] !== props) {
|
|
10253
|
-
_t2 = /* @__PURE__ */ (0,
|
|
10299
|
+
_t2 = /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(StatusMessages, _objectSpread48({
|
|
10254
10300
|
texts: _t
|
|
10255
10301
|
}, props));
|
|
10256
10302
|
$[1] = props;
|
|
@@ -10264,7 +10310,7 @@ var Status = function(props) {
|
|
|
10264
10310
|
"recorderPaused",
|
|
10265
10311
|
"idle",
|
|
10266
10312
|
"playerPaused"
|
|
10267
|
-
].includes(
|
|
10313
|
+
].includes(status)) {
|
|
10268
10314
|
var _t3;
|
|
10269
10315
|
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
|
10270
10316
|
_t3 = [
|
|
@@ -10276,7 +10322,7 @@ var Status = function(props) {
|
|
|
10276
10322
|
}
|
|
10277
10323
|
var _t4;
|
|
10278
10324
|
if ($[4] !== props) {
|
|
10279
|
-
_t4 = /* @__PURE__ */ (0,
|
|
10325
|
+
_t4 = /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(StatusMessages, _objectSpread48({
|
|
10280
10326
|
texts: _t3
|
|
10281
10327
|
}, props));
|
|
10282
10328
|
$[4] = props;
|
|
@@ -10286,7 +10332,7 @@ var Status = function(props) {
|
|
|
10286
10332
|
}
|
|
10287
10333
|
return _t4;
|
|
10288
10334
|
}
|
|
10289
|
-
if (
|
|
10335
|
+
if (status === "playing") {
|
|
10290
10336
|
var _t5;
|
|
10291
10337
|
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
10292
10338
|
_t5 = [
|
|
@@ -10298,7 +10344,7 @@ var Status = function(props) {
|
|
|
10298
10344
|
}
|
|
10299
10345
|
var _t6;
|
|
10300
10346
|
if ($[7] !== props) {
|
|
10301
|
-
_t6 = /* @__PURE__ */ (0,
|
|
10347
|
+
_t6 = /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(StatusMessages, _objectSpread48({
|
|
10302
10348
|
texts: _t5
|
|
10303
10349
|
}, props));
|
|
10304
10350
|
$[7] = props;
|
|
@@ -10319,7 +10365,7 @@ var Status = function(props) {
|
|
|
10319
10365
|
}
|
|
10320
10366
|
var t1;
|
|
10321
10367
|
if ($[10] !== props) {
|
|
10322
|
-
t1 = /* @__PURE__ */ (0,
|
|
10368
|
+
t1 = /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(StatusMessages, _objectSpread48({
|
|
10323
10369
|
texts: t0
|
|
10324
10370
|
}, props));
|
|
10325
10371
|
$[10] = props;
|
|
@@ -10330,10 +10376,10 @@ var Status = function(props) {
|
|
|
10330
10376
|
return t1;
|
|
10331
10377
|
};
|
|
10332
10378
|
// src/components/threads/AudioThread/Form/index.tsx
|
|
10333
|
-
var
|
|
10379
|
+
var import_react_compiler_runtime56 = require("react-compiler-runtime");
|
|
10334
10380
|
var import_themes63 = require("@radix-ui/themes");
|
|
10335
10381
|
// src/components/threads/AudioThread/Form/MicIcon.tsx
|
|
10336
|
-
var
|
|
10382
|
+
var import_jsx_runtime88 = require("react/jsx-runtime");
|
|
10337
10383
|
function ownKeys49(e, r) {
|
|
10338
10384
|
var t = Object.keys(e);
|
|
10339
10385
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -10378,7 +10424,7 @@ function _toPrimitive49(t, r) {
|
|
|
10378
10424
|
return ("string" === r ? String : Number)(t);
|
|
10379
10425
|
}
|
|
10380
10426
|
var MicIcon = function(props) {
|
|
10381
|
-
return /* @__PURE__ */ (0,
|
|
10427
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("svg", _objectSpread49(_objectSpread49({
|
|
10382
10428
|
xmlns: "http://www.w3.org/2000/svg",
|
|
10383
10429
|
fill: "currentColor",
|
|
10384
10430
|
stroke: "currentColor",
|
|
@@ -10387,71 +10433,72 @@ var MicIcon = function(props) {
|
|
|
10387
10433
|
height: "15",
|
|
10388
10434
|
width: "15"
|
|
10389
10435
|
}, props), {}, {
|
|
10390
|
-
children: /* @__PURE__ */ (0,
|
|
10436
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("path", {
|
|
10391
10437
|
stroke: "none",
|
|
10392
10438
|
d: "M192 0c-53 0-96 43-96 96v160c0 53 43 96 96 96s96-43 96-96V96c0-53-43-96-96-96zM64 216c0-13.3-10.7-24-24-24s-24 10.7-24 24v40c0 89.1 66.2 162.7 152 174.4V464h-48c-13.3 0-24 10.7-24 24s10.7 24 24 24h144c13.3 0 24-10.7 24-24s-10.7-24-24-24h-48v-33.6c85.8-11.7 152-85.3 152-174.4v-40c0-13.3-10.7-24-24-24s-24 10.7-24 24v40c0 70.7-57.3 128-128 128S64 326.7 64 256v-40z"
|
|
10393
10439
|
})
|
|
10394
10440
|
}));
|
|
10395
10441
|
};
|
|
10396
10442
|
// src/components/threads/AudioThread/Form/ActionButton/index.tsx
|
|
10397
|
-
var
|
|
10443
|
+
var import_react_compiler_runtime55 = require("react-compiler-runtime");
|
|
10398
10444
|
var import_themes62 = require("@radix-ui/themes");
|
|
10399
10445
|
var import_react_icons17 = require("@radix-ui/react-icons");
|
|
10400
|
-
var
|
|
10446
|
+
var import_jsx_runtime89 = require("react/jsx-runtime");
|
|
10401
10447
|
var ActionButton = function() {
|
|
10402
|
-
var $ = (0,
|
|
10448
|
+
var $ = (0, import_react_compiler_runtime55.c)(27);
|
|
10449
|
+
var status = useStatus().status;
|
|
10403
10450
|
var audioThreadContext = useAudioThreadContext();
|
|
10404
10451
|
var superinterfaceContext = useSuperinterfaceContext();
|
|
10405
|
-
if (
|
|
10452
|
+
if (status === "recording") {
|
|
10406
10453
|
var _t;
|
|
10407
10454
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
10408
|
-
_t = /* @__PURE__ */ (0,
|
|
10455
|
+
_t = /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_react_icons17.PauseIcon, {});
|
|
10409
10456
|
$[0] = _t;
|
|
10410
10457
|
} else {
|
|
10411
10458
|
_t = $[0];
|
|
10412
10459
|
}
|
|
10413
10460
|
var t1;
|
|
10414
|
-
if ($[1] !== audioThreadContext.
|
|
10415
|
-
t1 = /* @__PURE__ */ (0,
|
|
10461
|
+
if ($[1] !== audioThreadContext.audioRuntime.user.pause) {
|
|
10462
|
+
t1 = /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_themes62.Flex, {
|
|
10416
10463
|
mr: "3",
|
|
10417
10464
|
ml: "-7",
|
|
10418
|
-
children: /* @__PURE__ */ (0,
|
|
10419
|
-
onClick: audioThreadContext.
|
|
10465
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_themes62.IconButton, {
|
|
10466
|
+
onClick: audioThreadContext.audioRuntime.user.pause,
|
|
10420
10467
|
color: "gray",
|
|
10421
10468
|
variant: "soft",
|
|
10422
10469
|
size: "1",
|
|
10423
10470
|
children: _t
|
|
10424
10471
|
})
|
|
10425
10472
|
});
|
|
10426
|
-
$[1] = audioThreadContext.
|
|
10473
|
+
$[1] = audioThreadContext.audioRuntime.user.pause;
|
|
10427
10474
|
$[2] = t1;
|
|
10428
10475
|
} else {
|
|
10429
10476
|
t1 = $[2];
|
|
10430
10477
|
}
|
|
10431
10478
|
var t2;
|
|
10432
10479
|
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
|
10433
|
-
t2 = /* @__PURE__ */ (0,
|
|
10480
|
+
t2 = /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_react_icons17.ArrowUpIcon, {});
|
|
10434
10481
|
$[3] = t2;
|
|
10435
10482
|
} else {
|
|
10436
10483
|
t2 = $[3];
|
|
10437
10484
|
}
|
|
10438
10485
|
var t3;
|
|
10439
|
-
if ($[4] !== audioThreadContext.
|
|
10440
|
-
t3 = /* @__PURE__ */ (0,
|
|
10441
|
-
onClick: audioThreadContext.
|
|
10486
|
+
if ($[4] !== audioThreadContext.audioRuntime.user.stop) {
|
|
10487
|
+
t3 = /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_themes62.IconButton, {
|
|
10488
|
+
onClick: audioThreadContext.audioRuntime.user.stop,
|
|
10442
10489
|
highContrast: true,
|
|
10443
10490
|
variant: "soft",
|
|
10444
10491
|
size: "4",
|
|
10445
10492
|
children: t2
|
|
10446
10493
|
});
|
|
10447
|
-
$[4] = audioThreadContext.
|
|
10494
|
+
$[4] = audioThreadContext.audioRuntime.user.stop;
|
|
10448
10495
|
$[5] = t3;
|
|
10449
10496
|
} else {
|
|
10450
10497
|
t3 = $[5];
|
|
10451
10498
|
}
|
|
10452
10499
|
var t4;
|
|
10453
10500
|
if ($[6] !== t1 || $[7] !== t3) {
|
|
10454
|
-
t4 = /* @__PURE__ */ (0,
|
|
10501
|
+
t4 = /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(import_themes62.Flex, {
|
|
10455
10502
|
align: "center",
|
|
10456
10503
|
children: [
|
|
10457
10504
|
t1,
|
|
@@ -10466,57 +10513,57 @@ var ActionButton = function() {
|
|
|
10466
10513
|
}
|
|
10467
10514
|
return t4;
|
|
10468
10515
|
}
|
|
10469
|
-
if (
|
|
10516
|
+
if (status === "recorderPaused") {
|
|
10470
10517
|
var _t2;
|
|
10471
10518
|
if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
|
|
10472
|
-
_t2 = /* @__PURE__ */ (0,
|
|
10519
|
+
_t2 = /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_react_icons17.ResumeIcon, {});
|
|
10473
10520
|
$[9] = _t2;
|
|
10474
10521
|
} else {
|
|
10475
10522
|
_t2 = $[9];
|
|
10476
10523
|
}
|
|
10477
10524
|
var _t3;
|
|
10478
|
-
if ($[10] !== audioThreadContext.
|
|
10479
|
-
_t3 = /* @__PURE__ */ (0,
|
|
10480
|
-
onClick: audioThreadContext.
|
|
10525
|
+
if ($[10] !== audioThreadContext.audioRuntime.user.resume) {
|
|
10526
|
+
_t3 = /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_themes62.IconButton, {
|
|
10527
|
+
onClick: audioThreadContext.audioRuntime.user.resume,
|
|
10481
10528
|
color: "red",
|
|
10482
10529
|
size: "4",
|
|
10483
10530
|
children: _t2
|
|
10484
10531
|
});
|
|
10485
|
-
$[10] = audioThreadContext.
|
|
10532
|
+
$[10] = audioThreadContext.audioRuntime.user.resume;
|
|
10486
10533
|
$[11] = _t3;
|
|
10487
10534
|
} else {
|
|
10488
10535
|
_t3 = $[11];
|
|
10489
10536
|
}
|
|
10490
10537
|
return _t3;
|
|
10491
10538
|
}
|
|
10492
|
-
if (
|
|
10539
|
+
if (status === "idle") {
|
|
10493
10540
|
var _t4;
|
|
10494
|
-
if ($[12] !== audioThreadContext.
|
|
10495
|
-
_t4 = /* @__PURE__ */ (0,
|
|
10541
|
+
if ($[12] !== audioThreadContext.audioRuntime.user) {
|
|
10542
|
+
_t4 = /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_themes62.IconButton, {
|
|
10496
10543
|
onClick: function() {
|
|
10497
|
-
return audioThreadContext.
|
|
10544
|
+
return audioThreadContext.audioRuntime.user.start();
|
|
10498
10545
|
},
|
|
10499
10546
|
size: "4",
|
|
10500
10547
|
color: "red"
|
|
10501
10548
|
});
|
|
10502
|
-
$[12] = audioThreadContext.
|
|
10549
|
+
$[12] = audioThreadContext.audioRuntime.user;
|
|
10503
10550
|
$[13] = _t4;
|
|
10504
10551
|
} else {
|
|
10505
10552
|
_t4 = $[13];
|
|
10506
10553
|
}
|
|
10507
10554
|
return _t4;
|
|
10508
10555
|
}
|
|
10509
|
-
if (
|
|
10556
|
+
if (status === "playing") {
|
|
10510
10557
|
var _t5;
|
|
10511
|
-
if ($[14] !== audioThreadContext.
|
|
10558
|
+
if ($[14] !== audioThreadContext.audioRuntime.assistant || $[15] !== audioThreadContext.audioRuntime.user || $[16] !== superinterfaceContext.createMessageAbortControllerRef.current) {
|
|
10512
10559
|
_t5 = function() {
|
|
10513
10560
|
var _superinterfaceContex;
|
|
10514
|
-
audioThreadContext.
|
|
10561
|
+
audioThreadContext.audioRuntime.assistant.stop();
|
|
10515
10562
|
(_superinterfaceContex = superinterfaceContext.createMessageAbortControllerRef.current) === null || _superinterfaceContex === void 0 || _superinterfaceContex.abort();
|
|
10516
|
-
audioThreadContext.
|
|
10563
|
+
audioThreadContext.audioRuntime.user.start();
|
|
10517
10564
|
};
|
|
10518
|
-
$[14] = audioThreadContext.
|
|
10519
|
-
$[15] = audioThreadContext.
|
|
10565
|
+
$[14] = audioThreadContext.audioRuntime.assistant;
|
|
10566
|
+
$[15] = audioThreadContext.audioRuntime.user;
|
|
10520
10567
|
$[16] = superinterfaceContext.createMessageAbortControllerRef.current;
|
|
10521
10568
|
$[17] = _t5;
|
|
10522
10569
|
} else {
|
|
@@ -10524,14 +10571,14 @@ var ActionButton = function() {
|
|
|
10524
10571
|
}
|
|
10525
10572
|
var _t6;
|
|
10526
10573
|
if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
|
|
10527
|
-
_t6 = /* @__PURE__ */ (0,
|
|
10574
|
+
_t6 = /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_react_icons17.StopIcon, {});
|
|
10528
10575
|
$[18] = _t6;
|
|
10529
10576
|
} else {
|
|
10530
10577
|
_t6 = $[18];
|
|
10531
10578
|
}
|
|
10532
10579
|
var _t7;
|
|
10533
10580
|
if ($[19] !== _t5) {
|
|
10534
|
-
_t7 = /* @__PURE__ */ (0,
|
|
10581
|
+
_t7 = /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_themes62.IconButton, {
|
|
10535
10582
|
onClick: _t5,
|
|
10536
10583
|
size: "4",
|
|
10537
10584
|
color: "gray",
|
|
@@ -10545,27 +10592,27 @@ var ActionButton = function() {
|
|
|
10545
10592
|
}
|
|
10546
10593
|
return _t7;
|
|
10547
10594
|
}
|
|
10548
|
-
if (
|
|
10595
|
+
if (status === "playerPaused") {
|
|
10549
10596
|
var _t8;
|
|
10550
|
-
if ($[21] !== audioThreadContext.
|
|
10597
|
+
if ($[21] !== audioThreadContext.audioRuntime.assistant) {
|
|
10551
10598
|
_t8 = function() {
|
|
10552
|
-
return audioThreadContext.
|
|
10599
|
+
return audioThreadContext.audioRuntime.assistant.play();
|
|
10553
10600
|
};
|
|
10554
|
-
$[21] = audioThreadContext.
|
|
10601
|
+
$[21] = audioThreadContext.audioRuntime.assistant;
|
|
10555
10602
|
$[22] = _t8;
|
|
10556
10603
|
} else {
|
|
10557
10604
|
_t8 = $[22];
|
|
10558
10605
|
}
|
|
10559
10606
|
var _t9;
|
|
10560
10607
|
if ($[23] === Symbol.for("react.memo_cache_sentinel")) {
|
|
10561
|
-
_t9 = /* @__PURE__ */ (0,
|
|
10608
|
+
_t9 = /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_react_icons17.ResumeIcon, {});
|
|
10562
10609
|
$[23] = _t9;
|
|
10563
10610
|
} else {
|
|
10564
10611
|
_t9 = $[23];
|
|
10565
10612
|
}
|
|
10566
10613
|
var _t10;
|
|
10567
10614
|
if ($[24] !== _t8) {
|
|
10568
|
-
_t10 = /* @__PURE__ */ (0,
|
|
10615
|
+
_t10 = /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_themes62.IconButton, {
|
|
10569
10616
|
onClick: _t8,
|
|
10570
10617
|
size: "4",
|
|
10571
10618
|
children: _t9
|
|
@@ -10579,7 +10626,7 @@ var ActionButton = function() {
|
|
|
10579
10626
|
}
|
|
10580
10627
|
var t0;
|
|
10581
10628
|
if ($[26] === Symbol.for("react.memo_cache_sentinel")) {
|
|
10582
|
-
t0 = /* @__PURE__ */ (0,
|
|
10629
|
+
t0 = /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_themes62.IconButton, {
|
|
10583
10630
|
size: "4",
|
|
10584
10631
|
variant: "soft",
|
|
10585
10632
|
disabled: true
|
|
@@ -10591,7 +10638,7 @@ var ActionButton = function() {
|
|
|
10591
10638
|
return t0;
|
|
10592
10639
|
};
|
|
10593
10640
|
// src/components/threads/AudioThread/Form/index.tsx
|
|
10594
|
-
var
|
|
10641
|
+
var import_jsx_runtime90 = require("react/jsx-runtime");
|
|
10595
10642
|
function ownKeys50(e, r) {
|
|
10596
10643
|
var t = Object.keys(e);
|
|
10597
10644
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -10636,16 +10683,17 @@ function _toPrimitive50(t, r) {
|
|
|
10636
10683
|
return ("string" === r ? String : Number)(t);
|
|
10637
10684
|
}
|
|
10638
10685
|
var Form = function(props) {
|
|
10639
|
-
var $ = (0,
|
|
10686
|
+
var $ = (0, import_react_compiler_runtime56.c)(17);
|
|
10687
|
+
var status = useStatus().status;
|
|
10640
10688
|
var audioThreadContext = useAudioThreadContext();
|
|
10641
|
-
var t0 =
|
|
10689
|
+
var t0 = status === "recording" ? "var(--accent-11)" : "var(--gray-11)";
|
|
10642
10690
|
var t1;
|
|
10643
10691
|
if ($[0] !== t0) {
|
|
10644
|
-
t1 = /* @__PURE__ */ (0,
|
|
10692
|
+
t1 = /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(import_themes63.Flex, {
|
|
10645
10693
|
ml: "-22.5px",
|
|
10646
10694
|
mr: "2",
|
|
10647
10695
|
align: "center",
|
|
10648
|
-
children: /* @__PURE__ */ (0,
|
|
10696
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(MicIcon, {
|
|
10649
10697
|
style: {
|
|
10650
10698
|
color: t0
|
|
10651
10699
|
}
|
|
@@ -10656,7 +10704,7 @@ var Form = function(props) {
|
|
|
10656
10704
|
} else {
|
|
10657
10705
|
t1 = $[1];
|
|
10658
10706
|
}
|
|
10659
|
-
var t2 =
|
|
10707
|
+
var t2 = status === "recording" ? "var(--accent-4)" : "var(--gray-4)";
|
|
10660
10708
|
var t3;
|
|
10661
10709
|
if ($[2] !== t2) {
|
|
10662
10710
|
t3 = {
|
|
@@ -10668,16 +10716,16 @@ var Form = function(props) {
|
|
|
10668
10716
|
} else {
|
|
10669
10717
|
t3 = $[3];
|
|
10670
10718
|
}
|
|
10671
|
-
var t4 =
|
|
10719
|
+
var t4 = status === "recording" ? "var(--accent-11)" : "var(--gray-11)";
|
|
10672
10720
|
var t5;
|
|
10673
|
-
if ($[4] !== audioThreadContext.
|
|
10674
|
-
t5 = /* @__PURE__ */ (0,
|
|
10675
|
-
visualizationAnalyser: audioThreadContext.
|
|
10721
|
+
if ($[4] !== audioThreadContext.audioRuntime.user.visualizationAnalyser || $[5] !== t4) {
|
|
10722
|
+
t5 = /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(BarsVisualizer, {
|
|
10723
|
+
visualizationAnalyser: audioThreadContext.audioRuntime.user.visualizationAnalyser,
|
|
10676
10724
|
backgroundColor: t4,
|
|
10677
10725
|
height: "20px",
|
|
10678
10726
|
barWidth: "12px"
|
|
10679
10727
|
});
|
|
10680
|
-
$[4] = audioThreadContext.
|
|
10728
|
+
$[4] = audioThreadContext.audioRuntime.user.visualizationAnalyser;
|
|
10681
10729
|
$[5] = t4;
|
|
10682
10730
|
$[6] = t5;
|
|
10683
10731
|
} else {
|
|
@@ -10685,7 +10733,7 @@ var Form = function(props) {
|
|
|
10685
10733
|
}
|
|
10686
10734
|
var t6;
|
|
10687
10735
|
if ($[7] !== t3 || $[8] !== t5) {
|
|
10688
|
-
t6 = /* @__PURE__ */ (0,
|
|
10736
|
+
t6 = /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(import_themes63.Flex, {
|
|
10689
10737
|
px: "2",
|
|
10690
10738
|
py: "1",
|
|
10691
10739
|
style: t3,
|
|
@@ -10699,7 +10747,7 @@ var Form = function(props) {
|
|
|
10699
10747
|
}
|
|
10700
10748
|
var t7;
|
|
10701
10749
|
if ($[10] !== t1 || $[11] !== t6) {
|
|
10702
|
-
t7 = /* @__PURE__ */ (0,
|
|
10750
|
+
t7 = /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(import_themes63.Flex, {
|
|
10703
10751
|
pb: "3",
|
|
10704
10752
|
align: "center",
|
|
10705
10753
|
children: [
|
|
@@ -10715,14 +10763,14 @@ var Form = function(props) {
|
|
|
10715
10763
|
}
|
|
10716
10764
|
var t8;
|
|
10717
10765
|
if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
|
|
10718
|
-
t8 = /* @__PURE__ */ (0,
|
|
10766
|
+
t8 = /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(ActionButton, {});
|
|
10719
10767
|
$[13] = t8;
|
|
10720
10768
|
} else {
|
|
10721
10769
|
t8 = $[13];
|
|
10722
10770
|
}
|
|
10723
10771
|
var t9;
|
|
10724
10772
|
if ($[14] !== props || $[15] !== t7) {
|
|
10725
|
-
t9 = /* @__PURE__ */ (0,
|
|
10773
|
+
t9 = /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(import_themes63.Flex, _objectSpread50(_objectSpread50({
|
|
10726
10774
|
direction: "column",
|
|
10727
10775
|
align: "center"
|
|
10728
10776
|
}, props), {}, {
|
|
@@ -10740,7 +10788,7 @@ var Form = function(props) {
|
|
|
10740
10788
|
return t9;
|
|
10741
10789
|
};
|
|
10742
10790
|
// src/components/threads/AudioThread/index.tsx
|
|
10743
|
-
var
|
|
10791
|
+
var import_jsx_runtime91 = require("react/jsx-runtime");
|
|
10744
10792
|
function ownKeys51(e, r) {
|
|
10745
10793
|
var t = Object.keys(e);
|
|
10746
10794
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -10785,11 +10833,11 @@ function _toPrimitive51(t, r) {
|
|
|
10785
10833
|
return ("string" === r ? String : Number)(t);
|
|
10786
10834
|
}
|
|
10787
10835
|
var AudioThread = function(props) {
|
|
10788
|
-
return /* @__PURE__ */ (0,
|
|
10836
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(Root12, _objectSpread51(_objectSpread51({}, props), {}, {
|
|
10789
10837
|
children: [
|
|
10790
|
-
/* @__PURE__ */ (0,
|
|
10791
|
-
/* @__PURE__ */ (0,
|
|
10792
|
-
/* @__PURE__ */ (0,
|
|
10838
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Visualization, {}),
|
|
10839
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Status, {}),
|
|
10840
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Form, {})
|
|
10793
10841
|
]
|
|
10794
10842
|
}));
|
|
10795
10843
|
};
|
|
@@ -10798,7 +10846,7 @@ AudioThread.Visualization = Visualization;
|
|
|
10798
10846
|
AudioThread.Status = Status;
|
|
10799
10847
|
AudioThread.Form = Form;
|
|
10800
10848
|
// src/components/threads/AudioThreadDialog/index.tsx
|
|
10801
|
-
var
|
|
10849
|
+
var import_jsx_runtime92 = require("react/jsx-runtime");
|
|
10802
10850
|
function ownKeys52(e, r) {
|
|
10803
10851
|
var t = Object.keys(e);
|
|
10804
10852
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -10843,27 +10891,490 @@ function _toPrimitive52(t, r) {
|
|
|
10843
10891
|
return ("string" === r ? String : Number)(t);
|
|
10844
10892
|
}
|
|
10845
10893
|
var AudioThreadDialog = function(props) {
|
|
10846
|
-
return /* @__PURE__ */ (0,
|
|
10894
|
+
return /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(Root9, _objectSpread52(_objectSpread52({}, props), {}, {
|
|
10847
10895
|
children: [
|
|
10848
|
-
/* @__PURE__ */ (0,
|
|
10849
|
-
children: /* @__PURE__ */ (0,
|
|
10896
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Content7.Root, {
|
|
10897
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(AudioThread, {})
|
|
10850
10898
|
}),
|
|
10851
|
-
/* @__PURE__ */ (0,
|
|
10899
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Trigger, {})
|
|
10852
10900
|
]
|
|
10853
10901
|
}));
|
|
10854
10902
|
};
|
|
10855
10903
|
AudioThreadDialog.Root = Root9;
|
|
10856
10904
|
AudioThreadDialog.Trigger = Trigger;
|
|
10857
10905
|
AudioThreadDialog.Content = Content7;
|
|
10858
|
-
// src/
|
|
10859
|
-
var
|
|
10860
|
-
|
|
10861
|
-
|
|
10862
|
-
var
|
|
10863
|
-
|
|
10864
|
-
|
|
10865
|
-
|
|
10866
|
-
|
|
10906
|
+
// src/hooks/audioRuntimes/useWebrtcAudioRuntime/index.ts
|
|
10907
|
+
var import_react68 = require("react");
|
|
10908
|
+
function asyncGeneratorStep12(n, t, e, r, o, a, c) {
|
|
10909
|
+
try {
|
|
10910
|
+
var i = n[a](c), u = i.value;
|
|
10911
|
+
} catch (n2) {
|
|
10912
|
+
return void e(n2);
|
|
10913
|
+
}
|
|
10914
|
+
i.done ? t(u) : Promise.resolve(u).then(r, o);
|
|
10915
|
+
}
|
|
10916
|
+
function _asyncToGenerator12(n) {
|
|
10917
|
+
return function() {
|
|
10918
|
+
var t = this, e = arguments;
|
|
10919
|
+
return new Promise(function(r, o) {
|
|
10920
|
+
var a = n.apply(t, e);
|
|
10921
|
+
function _next(n2) {
|
|
10922
|
+
asyncGeneratorStep12(a, r, o, _next, _throw, "next", n2);
|
|
10923
|
+
}
|
|
10924
|
+
function _throw(n2) {
|
|
10925
|
+
asyncGeneratorStep12(a, r, o, _next, _throw, "throw", n2);
|
|
10926
|
+
}
|
|
10927
|
+
_next(void 0);
|
|
10928
|
+
});
|
|
10929
|
+
};
|
|
10930
|
+
}
|
|
10931
|
+
var useWebrtcAudioRuntime = function() {
|
|
10932
|
+
var startSessionIfNeeded = function startSessionIfNeeded() {
|
|
10933
|
+
return _startSessionIfNeeded.apply(this, arguments);
|
|
10934
|
+
};
|
|
10935
|
+
var initRealtimeSession = function initRealtimeSession() {
|
|
10936
|
+
return _initRealtimeSession.apply(this, arguments);
|
|
10937
|
+
};
|
|
10938
|
+
var buildAnalyzers = function buildAnalyzers(localStream, audioEl_0) {
|
|
10939
|
+
try {
|
|
10940
|
+
var audioCtx1 = new AudioContext();
|
|
10941
|
+
var micSource = audioCtx1.createMediaStreamSource(localStream);
|
|
10942
|
+
var micAnalyser = audioCtx1.createAnalyser();
|
|
10943
|
+
micSource.connect(micAnalyser);
|
|
10944
|
+
userAnalyserRef.current = micAnalyser;
|
|
10945
|
+
audioEl_0.addEventListener("canplay", function() {
|
|
10946
|
+
var audioCtx2 = new AudioContext();
|
|
10947
|
+
var remoteSource = audioCtx2.createMediaElementSource(audioEl_0);
|
|
10948
|
+
var remoteAnalyser = audioCtx2.createAnalyser();
|
|
10949
|
+
remoteSource.connect(remoteAnalyser);
|
|
10950
|
+
remoteSource.connect(audioCtx2.destination);
|
|
10951
|
+
assistantAnalyserRef.current = remoteAnalyser;
|
|
10952
|
+
});
|
|
10953
|
+
} catch (err_0) {
|
|
10954
|
+
console.warn("Could not build analyzers:", err_0);
|
|
10955
|
+
}
|
|
10956
|
+
};
|
|
10957
|
+
var _ref = _sliced_to_array((0, import_react68.useState)("idle"), 2), recorderStatus = _ref[0], setRecorderStatus = _ref[1];
|
|
10958
|
+
var superinterfaceContext = useSuperinterfaceContext();
|
|
10959
|
+
var _ref1 = _sliced_to_array((0, import_react68.useState)(false), 2), userIsPending = _ref1[0], setUserIsPending = _ref1[1];
|
|
10960
|
+
var _ref2 = _sliced_to_array((0, import_react68.useState)(false), 2), assistantPlaying = _ref2[0], setAssistantPlaying = _ref2[1];
|
|
10961
|
+
var _ref3 = _sliced_to_array((0, import_react68.useState)(false), 2), assistantPaused = _ref3[0], setAssistantPaused = _ref3[1];
|
|
10962
|
+
var _ref4 = _sliced_to_array((0, import_react68.useState)(true), 2), assistantIsPending = _ref4[0], setAssistantIsPending = _ref4[1];
|
|
10963
|
+
var _ref5 = _sliced_to_array((0, import_react68.useState)(false), 2), assistantIsReady = _ref5[0], setAssistantIsReady = _ref5[1];
|
|
10964
|
+
var _ref6 = _sliced_to_array((0, import_react68.useState)(false), 2), assistantAudioPlayed = _ref6[0], setAssistantAudioPlayed = _ref6[1];
|
|
10965
|
+
var sessionStartedRef = (0, import_react68.useRef)(false);
|
|
10966
|
+
var pcRef = (0, import_react68.useRef)(null);
|
|
10967
|
+
var localStreamRef = (0, import_react68.useRef)(null);
|
|
10968
|
+
var remoteStreamRef = (0, import_react68.useRef)(null);
|
|
10969
|
+
var userAnalyserRef = (0, import_react68.useRef)(null);
|
|
10970
|
+
var assistantAnalyserRef = (0, import_react68.useRef)(null);
|
|
10971
|
+
var assistantAudioElRef = (0, import_react68.useRef)(null);
|
|
10972
|
+
(0, import_react68.useEffect)(function() {
|
|
10973
|
+
return function() {
|
|
10974
|
+
if (pcRef.current) {
|
|
10975
|
+
pcRef.current.close();
|
|
10976
|
+
pcRef.current = null;
|
|
10977
|
+
}
|
|
10978
|
+
if (assistantAudioElRef.current) {
|
|
10979
|
+
assistantAudioElRef.current.srcObject = null;
|
|
10980
|
+
}
|
|
10981
|
+
};
|
|
10982
|
+
}, []);
|
|
10983
|
+
function _startSessionIfNeeded() {
|
|
10984
|
+
_startSessionIfNeeded = _asyncToGenerator12(function() {
|
|
10985
|
+
return _ts_generator(this, function(_state) {
|
|
10986
|
+
switch(_state.label){
|
|
10987
|
+
case 0:
|
|
10988
|
+
if (sessionStartedRef.current) return [
|
|
10989
|
+
2
|
|
10990
|
+
];
|
|
10991
|
+
sessionStartedRef.current = true;
|
|
10992
|
+
return [
|
|
10993
|
+
4,
|
|
10994
|
+
initRealtimeSession()
|
|
10995
|
+
];
|
|
10996
|
+
case 1:
|
|
10997
|
+
_state.sent();
|
|
10998
|
+
return [
|
|
10999
|
+
2
|
|
11000
|
+
];
|
|
11001
|
+
}
|
|
11002
|
+
});
|
|
11003
|
+
});
|
|
11004
|
+
return _startSessionIfNeeded.apply(this, arguments);
|
|
11005
|
+
}
|
|
11006
|
+
function _initRealtimeSession() {
|
|
11007
|
+
_initRealtimeSession = _asyncToGenerator12(function() {
|
|
11008
|
+
var peerConn, audioEl, ms, offer, searchParams, sdpResponse, answerSdp, answer, err;
|
|
11009
|
+
return _ts_generator(this, function(_state) {
|
|
11010
|
+
switch(_state.label){
|
|
11011
|
+
case 0:
|
|
11012
|
+
_state.trys.push([
|
|
11013
|
+
0,
|
|
11014
|
+
7,
|
|
11015
|
+
,
|
|
11016
|
+
8
|
|
11017
|
+
]);
|
|
11018
|
+
setUserIsPending(true);
|
|
11019
|
+
peerConn = new RTCPeerConnection();
|
|
11020
|
+
pcRef.current = peerConn;
|
|
11021
|
+
audioEl = document.createElement("audio");
|
|
11022
|
+
audioEl.autoplay = true;
|
|
11023
|
+
assistantAudioElRef.current = audioEl;
|
|
11024
|
+
peerConn.ontrack = function(evt) {
|
|
11025
|
+
remoteStreamRef.current = evt.streams[0];
|
|
11026
|
+
audioEl.srcObject = evt.streams[0];
|
|
11027
|
+
setAssistantIsPending(false);
|
|
11028
|
+
setAssistantPlaying(true);
|
|
11029
|
+
setAssistantPaused(false);
|
|
11030
|
+
setAssistantAudioPlayed(true);
|
|
11031
|
+
};
|
|
11032
|
+
peerConn.createDataChannel("unused-negotiation-only");
|
|
11033
|
+
peerConn.addEventListener("datachannel", function(event) {
|
|
11034
|
+
var channel = event.channel;
|
|
11035
|
+
if (channel.label === "thread-events") {
|
|
11036
|
+
channel.onmessage = function(_ref) {
|
|
11037
|
+
var data2 = _ref.data;
|
|
11038
|
+
console.log("Data channel message:", data2);
|
|
11039
|
+
var parsedData = JSON.parse(data2);
|
|
11040
|
+
if (parsedData.event === "thread.created") {
|
|
11041
|
+
threadCreated({
|
|
11042
|
+
value: parsedData,
|
|
11043
|
+
superinterfaceContext: superinterfaceContext
|
|
11044
|
+
});
|
|
11045
|
+
} else if (parsedData.event === "thread.run.requires_action") {
|
|
11046
|
+
threadRunRequiresAction({
|
|
11047
|
+
value: parsedData,
|
|
11048
|
+
superinterfaceContext: superinterfaceContext
|
|
11049
|
+
});
|
|
11050
|
+
}
|
|
11051
|
+
};
|
|
11052
|
+
}
|
|
11053
|
+
});
|
|
11054
|
+
return [
|
|
11055
|
+
4,
|
|
11056
|
+
navigator.mediaDevices.getUserMedia({
|
|
11057
|
+
audio: true
|
|
11058
|
+
})
|
|
11059
|
+
];
|
|
11060
|
+
case 1:
|
|
11061
|
+
ms = _state.sent();
|
|
11062
|
+
localStreamRef.current = ms;
|
|
11063
|
+
ms.getTracks().forEach(function(t) {
|
|
11064
|
+
peerConn.addTrack(t, ms);
|
|
11065
|
+
});
|
|
11066
|
+
setRecorderStatus("idle");
|
|
11067
|
+
return [
|
|
11068
|
+
4,
|
|
11069
|
+
peerConn.createOffer()
|
|
11070
|
+
];
|
|
11071
|
+
case 2:
|
|
11072
|
+
offer = _state.sent();
|
|
11073
|
+
return [
|
|
11074
|
+
4,
|
|
11075
|
+
peerConn.setLocalDescription(offer)
|
|
11076
|
+
];
|
|
11077
|
+
case 3:
|
|
11078
|
+
_state.sent();
|
|
11079
|
+
searchParams = new URLSearchParams(variableParams({
|
|
11080
|
+
variables: superinterfaceContext.variables,
|
|
11081
|
+
superinterfaceContext: superinterfaceContext
|
|
11082
|
+
}));
|
|
11083
|
+
return [
|
|
11084
|
+
4,
|
|
11085
|
+
fetch("".concat(superinterfaceContext.baseUrl, "/audio-runtimes/webrtc?").concat(searchParams), {
|
|
11086
|
+
method: "POST",
|
|
11087
|
+
body: offer.sdp,
|
|
11088
|
+
headers: {
|
|
11089
|
+
"Content-Type": "application/sdp"
|
|
11090
|
+
}
|
|
11091
|
+
})
|
|
11092
|
+
];
|
|
11093
|
+
case 4:
|
|
11094
|
+
sdpResponse = _state.sent();
|
|
11095
|
+
return [
|
|
11096
|
+
4,
|
|
11097
|
+
sdpResponse.text()
|
|
11098
|
+
];
|
|
11099
|
+
case 5:
|
|
11100
|
+
answerSdp = _state.sent();
|
|
11101
|
+
answer = {
|
|
11102
|
+
type: "answer",
|
|
11103
|
+
sdp: answerSdp
|
|
11104
|
+
};
|
|
11105
|
+
return [
|
|
11106
|
+
4,
|
|
11107
|
+
peerConn.setRemoteDescription(answer)
|
|
11108
|
+
];
|
|
11109
|
+
case 6:
|
|
11110
|
+
_state.sent();
|
|
11111
|
+
buildAnalyzers(ms, audioEl);
|
|
11112
|
+
setUserIsPending(false);
|
|
11113
|
+
setAssistantIsPending(false);
|
|
11114
|
+
setAssistantIsReady(true);
|
|
11115
|
+
setAssistantPlaying(true);
|
|
11116
|
+
return [
|
|
11117
|
+
3,
|
|
11118
|
+
8
|
|
11119
|
+
];
|
|
11120
|
+
case 7:
|
|
11121
|
+
err = _state.sent();
|
|
11122
|
+
console.error("Error initRealtimeSession:", err);
|
|
11123
|
+
setUserIsPending(false);
|
|
11124
|
+
setRecorderStatus("stopped");
|
|
11125
|
+
setAssistantPlaying(false);
|
|
11126
|
+
setAssistantPaused(false);
|
|
11127
|
+
setAssistantIsPending(false);
|
|
11128
|
+
setAssistantIsReady(false);
|
|
11129
|
+
setAssistantAudioPlayed(false);
|
|
11130
|
+
return [
|
|
11131
|
+
3,
|
|
11132
|
+
8
|
|
11133
|
+
];
|
|
11134
|
+
case 8:
|
|
11135
|
+
return [
|
|
11136
|
+
2
|
|
11137
|
+
];
|
|
11138
|
+
}
|
|
11139
|
+
});
|
|
11140
|
+
});
|
|
11141
|
+
return _initRealtimeSession.apply(this, arguments);
|
|
11142
|
+
}
|
|
11143
|
+
return (0, import_react68.useMemo)(function() {
|
|
11144
|
+
return {
|
|
11145
|
+
webrtcAudioRuntime: {
|
|
11146
|
+
user: {
|
|
11147
|
+
start: function() {
|
|
11148
|
+
var _start = _asyncToGenerator12(function() {
|
|
11149
|
+
return _ts_generator(this, function(_state) {
|
|
11150
|
+
switch(_state.label){
|
|
11151
|
+
case 0:
|
|
11152
|
+
return [
|
|
11153
|
+
4,
|
|
11154
|
+
startSessionIfNeeded()
|
|
11155
|
+
];
|
|
11156
|
+
case 1:
|
|
11157
|
+
_state.sent();
|
|
11158
|
+
setRecorderStatus("recording");
|
|
11159
|
+
if (localStreamRef.current) {
|
|
11160
|
+
localStreamRef.current.getAudioTracks().forEach(function(t_0) {
|
|
11161
|
+
return t_0.enabled = true;
|
|
11162
|
+
});
|
|
11163
|
+
}
|
|
11164
|
+
return [
|
|
11165
|
+
2
|
|
11166
|
+
];
|
|
11167
|
+
}
|
|
11168
|
+
});
|
|
11169
|
+
});
|
|
11170
|
+
function start() {
|
|
11171
|
+
return _start.apply(this, arguments);
|
|
11172
|
+
}
|
|
11173
|
+
return start;
|
|
11174
|
+
}(),
|
|
11175
|
+
pause: function() {
|
|
11176
|
+
var _pause = _asyncToGenerator12(function() {
|
|
11177
|
+
return _ts_generator(this, function(_state) {
|
|
11178
|
+
if (!sessionStartedRef.current) return [
|
|
11179
|
+
2
|
|
11180
|
+
];
|
|
11181
|
+
setRecorderStatus("paused");
|
|
11182
|
+
if (localStreamRef.current) {
|
|
11183
|
+
localStreamRef.current.getAudioTracks().forEach(function(t_1) {
|
|
11184
|
+
return t_1.enabled = false;
|
|
11185
|
+
});
|
|
11186
|
+
}
|
|
11187
|
+
return [
|
|
11188
|
+
2
|
|
11189
|
+
];
|
|
11190
|
+
});
|
|
11191
|
+
});
|
|
11192
|
+
function pause() {
|
|
11193
|
+
return _pause.apply(this, arguments);
|
|
11194
|
+
}
|
|
11195
|
+
return pause;
|
|
11196
|
+
}(),
|
|
11197
|
+
resume: function() {
|
|
11198
|
+
var _resume = _asyncToGenerator12(function() {
|
|
11199
|
+
return _ts_generator(this, function(_state) {
|
|
11200
|
+
if (!sessionStartedRef.current) return [
|
|
11201
|
+
2
|
|
11202
|
+
];
|
|
11203
|
+
setRecorderStatus("recording");
|
|
11204
|
+
if (localStreamRef.current) {
|
|
11205
|
+
localStreamRef.current.getAudioTracks().forEach(function(t_2) {
|
|
11206
|
+
return t_2.enabled = true;
|
|
11207
|
+
});
|
|
11208
|
+
}
|
|
11209
|
+
return [
|
|
11210
|
+
2
|
|
11211
|
+
];
|
|
11212
|
+
});
|
|
11213
|
+
});
|
|
11214
|
+
function resume() {
|
|
11215
|
+
return _resume.apply(this, arguments);
|
|
11216
|
+
}
|
|
11217
|
+
return resume;
|
|
11218
|
+
}(),
|
|
11219
|
+
stop: function() {
|
|
11220
|
+
var _stop = _asyncToGenerator12(function() {
|
|
11221
|
+
return _ts_generator(this, function(_state) {
|
|
11222
|
+
if (!sessionStartedRef.current) return [
|
|
11223
|
+
2
|
|
11224
|
+
];
|
|
11225
|
+
setRecorderStatus("stopped");
|
|
11226
|
+
if (localStreamRef.current) {
|
|
11227
|
+
localStreamRef.current.getTracks().forEach(function(track) {
|
|
11228
|
+
return track.stop();
|
|
11229
|
+
});
|
|
11230
|
+
}
|
|
11231
|
+
return [
|
|
11232
|
+
2
|
|
11233
|
+
];
|
|
11234
|
+
});
|
|
11235
|
+
});
|
|
11236
|
+
function stop() {
|
|
11237
|
+
return _stop.apply(this, arguments);
|
|
11238
|
+
}
|
|
11239
|
+
return stop;
|
|
11240
|
+
}(),
|
|
11241
|
+
isPending: userIsPending,
|
|
11242
|
+
visualizationAnalyser: userAnalyserRef.current,
|
|
11243
|
+
rawStatus: recorderStatus
|
|
11244
|
+
},
|
|
11245
|
+
assistant: {
|
|
11246
|
+
play: function() {
|
|
11247
|
+
var _play = _asyncToGenerator12(function() {
|
|
11248
|
+
return _ts_generator(this, function(_state) {
|
|
11249
|
+
switch(_state.label){
|
|
11250
|
+
case 0:
|
|
11251
|
+
return [
|
|
11252
|
+
4,
|
|
11253
|
+
startSessionIfNeeded()
|
|
11254
|
+
];
|
|
11255
|
+
case 1:
|
|
11256
|
+
_state.sent();
|
|
11257
|
+
setAssistantPaused(false);
|
|
11258
|
+
setAssistantPlaying(true);
|
|
11259
|
+
if (assistantAudioElRef.current) {
|
|
11260
|
+
assistantAudioElRef.current.play().catch(function(err_1) {
|
|
11261
|
+
console.error("Assistant play error:", err_1);
|
|
11262
|
+
});
|
|
11263
|
+
}
|
|
11264
|
+
return [
|
|
11265
|
+
2
|
|
11266
|
+
];
|
|
11267
|
+
}
|
|
11268
|
+
});
|
|
11269
|
+
});
|
|
11270
|
+
function play() {
|
|
11271
|
+
return _play.apply(this, arguments);
|
|
11272
|
+
}
|
|
11273
|
+
return play;
|
|
11274
|
+
}(),
|
|
11275
|
+
pause: function() {
|
|
11276
|
+
var _pause2 = _asyncToGenerator12(function() {
|
|
11277
|
+
return _ts_generator(this, function(_state) {
|
|
11278
|
+
if (!sessionStartedRef.current) return [
|
|
11279
|
+
2
|
|
11280
|
+
];
|
|
11281
|
+
setAssistantPaused(true);
|
|
11282
|
+
setAssistantPlaying(false);
|
|
11283
|
+
if (assistantAudioElRef.current) {
|
|
11284
|
+
assistantAudioElRef.current.pause();
|
|
11285
|
+
}
|
|
11286
|
+
return [
|
|
11287
|
+
2
|
|
11288
|
+
];
|
|
11289
|
+
});
|
|
11290
|
+
});
|
|
11291
|
+
function pause() {
|
|
11292
|
+
return _pause2.apply(this, arguments);
|
|
11293
|
+
}
|
|
11294
|
+
return pause;
|
|
11295
|
+
}(),
|
|
11296
|
+
stop: function() {
|
|
11297
|
+
var _stop2 = _asyncToGenerator12(function() {
|
|
11298
|
+
return _ts_generator(this, function(_state) {
|
|
11299
|
+
if (!sessionStartedRef.current) return [
|
|
11300
|
+
2
|
|
11301
|
+
];
|
|
11302
|
+
setAssistantPaused(false);
|
|
11303
|
+
setAssistantPlaying(false);
|
|
11304
|
+
if (assistantAudioElRef.current) {
|
|
11305
|
+
assistantAudioElRef.current.pause();
|
|
11306
|
+
assistantAudioElRef.current.currentTime = 0;
|
|
11307
|
+
}
|
|
11308
|
+
return [
|
|
11309
|
+
2
|
|
11310
|
+
];
|
|
11311
|
+
});
|
|
11312
|
+
});
|
|
11313
|
+
function stop() {
|
|
11314
|
+
return _stop2.apply(this, arguments);
|
|
11315
|
+
}
|
|
11316
|
+
return stop;
|
|
11317
|
+
}(),
|
|
11318
|
+
visualizationAnalyser: assistantAnalyserRef.current,
|
|
11319
|
+
playing: assistantPlaying,
|
|
11320
|
+
paused: assistantPaused,
|
|
11321
|
+
isPending: assistantIsPending,
|
|
11322
|
+
isReady: assistantIsReady,
|
|
11323
|
+
isAudioPlayed: assistantAudioPlayed,
|
|
11324
|
+
rawStatus: void 0
|
|
11325
|
+
}
|
|
11326
|
+
}
|
|
11327
|
+
};
|
|
11328
|
+
}, [
|
|
11329
|
+
recorderStatus,
|
|
11330
|
+
userIsPending,
|
|
11331
|
+
assistantPlaying,
|
|
11332
|
+
assistantPaused,
|
|
11333
|
+
assistantIsPending,
|
|
11334
|
+
assistantIsReady,
|
|
11335
|
+
assistantAudioPlayed
|
|
11336
|
+
]);
|
|
11337
|
+
};
|
|
11338
|
+
// src/components/audioRuntimes/WebrtcAudioRuntimeProvider.tsx
|
|
11339
|
+
var import_react_compiler_runtime57 = require("react-compiler-runtime");
|
|
11340
|
+
var import_jsx_runtime93 = require("react/jsx-runtime");
|
|
11341
|
+
var WebrtcAudioRuntimeProvider = function(t0) {
|
|
11342
|
+
var $ = (0, import_react_compiler_runtime57.c)(5);
|
|
11343
|
+
var children = t0.children;
|
|
11344
|
+
var webrtcAudioRuntime = useWebrtcAudioRuntime().webrtcAudioRuntime;
|
|
11345
|
+
var t1;
|
|
11346
|
+
if ($[0] !== webrtcAudioRuntime) {
|
|
11347
|
+
t1 = {
|
|
11348
|
+
audioRuntime: webrtcAudioRuntime
|
|
11349
|
+
};
|
|
11350
|
+
$[0] = webrtcAudioRuntime;
|
|
11351
|
+
$[1] = t1;
|
|
11352
|
+
} else {
|
|
11353
|
+
t1 = $[1];
|
|
11354
|
+
}
|
|
11355
|
+
var t2;
|
|
11356
|
+
if ($[2] !== children || $[3] !== t1) {
|
|
11357
|
+
t2 = /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(AudioThreadContext.Provider, {
|
|
11358
|
+
value: t1,
|
|
11359
|
+
children: children
|
|
11360
|
+
});
|
|
11361
|
+
$[2] = children;
|
|
11362
|
+
$[3] = t1;
|
|
11363
|
+
$[4] = t2;
|
|
11364
|
+
} else {
|
|
11365
|
+
t2 = $[4];
|
|
11366
|
+
}
|
|
11367
|
+
return t2;
|
|
11368
|
+
};
|
|
11369
|
+
// src/components/markdown/MarkdownProvider/index.tsx
|
|
11370
|
+
var import_react_compiler_runtime58 = require("react-compiler-runtime");
|
|
11371
|
+
var import_react69 = require("react");
|
|
11372
|
+
var import_jsx_runtime94 = require("react/jsx-runtime");
|
|
11373
|
+
var _excluded6 = [
|
|
11374
|
+
"children"
|
|
11375
|
+
];
|
|
11376
|
+
function _objectWithoutProperties6(e, t) {
|
|
11377
|
+
if (null == e) return {};
|
|
10867
11378
|
var o, r, i = _objectWithoutPropertiesLoose6(e, t);
|
|
10868
11379
|
if (Object.getOwnPropertySymbols) {
|
|
10869
11380
|
var s = Object.getOwnPropertySymbols(e);
|
|
@@ -10881,7 +11392,7 @@ function _objectWithoutPropertiesLoose6(r, e) {
|
|
|
10881
11392
|
return t;
|
|
10882
11393
|
}
|
|
10883
11394
|
var MarkdownProvider = function(t0) {
|
|
10884
|
-
var $ = (0,
|
|
11395
|
+
var $ = (0, import_react_compiler_runtime58.c)(9);
|
|
10885
11396
|
var children;
|
|
10886
11397
|
var rest;
|
|
10887
11398
|
if ($[0] !== t0) {
|
|
@@ -10911,7 +11422,7 @@ var MarkdownProvider = function(t0) {
|
|
|
10911
11422
|
var value = t1;
|
|
10912
11423
|
var t3;
|
|
10913
11424
|
if ($[6] !== children || $[7] !== value) {
|
|
10914
|
-
t3 = /* @__PURE__ */ (0,
|
|
11425
|
+
t3 = /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(MarkdownContext.Provider, {
|
|
10915
11426
|
value: value,
|
|
10916
11427
|
children: children
|
|
10917
11428
|
});
|
|
@@ -10924,18 +11435,18 @@ var MarkdownProvider = function(t0) {
|
|
|
10924
11435
|
return t3;
|
|
10925
11436
|
};
|
|
10926
11437
|
// src/components/annotations/SourceAnnotation/index.tsx
|
|
10927
|
-
var
|
|
11438
|
+
var import_react_compiler_runtime61 = require("react-compiler-runtime");
|
|
10928
11439
|
// src/components/annotations/SourceAnnotation/FileCitation/index.tsx
|
|
10929
|
-
var
|
|
10930
|
-
var
|
|
11440
|
+
var import_react_compiler_runtime60 = require("react-compiler-runtime");
|
|
11441
|
+
var import_react70 = require("react");
|
|
10931
11442
|
var import_react_icons18 = require("@radix-ui/react-icons");
|
|
10932
11443
|
var import_themes65 = require("@radix-ui/themes");
|
|
10933
11444
|
// src/components/annotations/SourceAnnotation/FileCitation/Content.tsx
|
|
10934
|
-
var
|
|
11445
|
+
var import_react_compiler_runtime59 = require("react-compiler-runtime");
|
|
10935
11446
|
var import_themes64 = require("@radix-ui/themes");
|
|
10936
|
-
var
|
|
11447
|
+
var import_jsx_runtime95 = require("react/jsx-runtime");
|
|
10937
11448
|
var Content9 = function(t0) {
|
|
10938
|
-
var $ = (0,
|
|
11449
|
+
var $ = (0, import_react_compiler_runtime59.c)(5);
|
|
10939
11450
|
var fileId = t0.fileId;
|
|
10940
11451
|
var superinterfaceContext = useSuperinterfaceContext();
|
|
10941
11452
|
var nextSearchParams = new URLSearchParams(superinterfaceContext.variables);
|
|
@@ -10972,18 +11483,18 @@ var Content9 = function(t0) {
|
|
|
10972
11483
|
}
|
|
10973
11484
|
var t5;
|
|
10974
11485
|
if ($[3] !== t3) {
|
|
10975
|
-
t5 = /* @__PURE__ */ (0,
|
|
11486
|
+
t5 = /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_themes64.Flex, {
|
|
10976
11487
|
direction: "column",
|
|
10977
11488
|
flexGrow: "1",
|
|
10978
11489
|
gap: "3",
|
|
10979
|
-
children: /* @__PURE__ */ (0,
|
|
11490
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_themes64.Card, {
|
|
10980
11491
|
style: t1,
|
|
10981
|
-
children: /* @__PURE__ */ (0,
|
|
11492
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_themes64.Inset, {
|
|
10982
11493
|
clip: "padding-box",
|
|
10983
11494
|
style: t2,
|
|
10984
|
-
children: /* @__PURE__ */ (0,
|
|
11495
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_themes64.Flex, {
|
|
10985
11496
|
flexGrow: "1",
|
|
10986
|
-
children: /* @__PURE__ */ (0,
|
|
11497
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("embed", {
|
|
10987
11498
|
src: t3,
|
|
10988
11499
|
style: t4
|
|
10989
11500
|
})
|
|
@@ -10999,11 +11510,11 @@ var Content9 = function(t0) {
|
|
|
10999
11510
|
return t5;
|
|
11000
11511
|
};
|
|
11001
11512
|
// src/components/annotations/SourceAnnotation/FileCitation/index.tsx
|
|
11002
|
-
var
|
|
11513
|
+
var import_jsx_runtime96 = require("react/jsx-runtime");
|
|
11003
11514
|
var FileCitation = function(t0) {
|
|
11004
|
-
var $ = (0,
|
|
11515
|
+
var $ = (0, import_react_compiler_runtime60.c)(18);
|
|
11005
11516
|
var annotation = t0.annotation;
|
|
11006
|
-
var _ref = _sliced_to_array((0,
|
|
11517
|
+
var _ref = _sliced_to_array((0, import_react70.useState)(null), 2), activeFileId = _ref[0], setActiveFileId = _ref[1];
|
|
11007
11518
|
var t1;
|
|
11008
11519
|
if ($[0] !== annotation.file_citation.file_id) {
|
|
11009
11520
|
t1 = function() {
|
|
@@ -11016,14 +11527,14 @@ var FileCitation = function(t0) {
|
|
|
11016
11527
|
}
|
|
11017
11528
|
var t2;
|
|
11018
11529
|
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
11019
|
-
t2 = /* @__PURE__ */ (0,
|
|
11530
|
+
t2 = /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_react_icons18.QuoteIcon, {});
|
|
11020
11531
|
$[2] = t2;
|
|
11021
11532
|
} else {
|
|
11022
11533
|
t2 = $[2];
|
|
11023
11534
|
}
|
|
11024
11535
|
var t3;
|
|
11025
11536
|
if ($[3] !== t1) {
|
|
11026
|
-
t3 = /* @__PURE__ */ (0,
|
|
11537
|
+
t3 = /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_themes65.IconButton, {
|
|
11027
11538
|
variant: "soft",
|
|
11028
11539
|
color: "gray",
|
|
11029
11540
|
size: "1",
|
|
@@ -11059,9 +11570,9 @@ var FileCitation = function(t0) {
|
|
|
11059
11570
|
}
|
|
11060
11571
|
var t7;
|
|
11061
11572
|
if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
|
|
11062
|
-
t7 = /* @__PURE__ */ (0,
|
|
11573
|
+
t7 = /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_themes65.VisuallyHidden, {
|
|
11063
11574
|
asChild: true,
|
|
11064
|
-
children: /* @__PURE__ */ (0,
|
|
11575
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_themes65.Dialog.Title, {
|
|
11065
11576
|
children: "Source"
|
|
11066
11577
|
})
|
|
11067
11578
|
});
|
|
@@ -11071,7 +11582,7 @@ var FileCitation = function(t0) {
|
|
|
11071
11582
|
}
|
|
11072
11583
|
var t8;
|
|
11073
11584
|
if ($[8] !== activeFileId) {
|
|
11074
|
-
t8 = activeFileId && /* @__PURE__ */ (0,
|
|
11585
|
+
t8 = activeFileId && /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(Content9, {
|
|
11075
11586
|
fileId: activeFileId
|
|
11076
11587
|
});
|
|
11077
11588
|
$[8] = activeFileId;
|
|
@@ -11081,7 +11592,7 @@ var FileCitation = function(t0) {
|
|
|
11081
11592
|
}
|
|
11082
11593
|
var t9;
|
|
11083
11594
|
if ($[10] !== t8) {
|
|
11084
|
-
t9 = /* @__PURE__ */ (0,
|
|
11595
|
+
t9 = /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(import_themes65.Dialog.Content, {
|
|
11085
11596
|
width: "1000px",
|
|
11086
11597
|
height: "90vh",
|
|
11087
11598
|
maxWidth: "calc(100vw - 2 * var(--space-4))",
|
|
@@ -11099,7 +11610,7 @@ var FileCitation = function(t0) {
|
|
|
11099
11610
|
}
|
|
11100
11611
|
var t10;
|
|
11101
11612
|
if ($[12] !== t4 || $[13] !== t9) {
|
|
11102
|
-
t10 = /* @__PURE__ */ (0,
|
|
11613
|
+
t10 = /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_themes65.Dialog.Root, {
|
|
11103
11614
|
open: t4,
|
|
11104
11615
|
onOpenChange: t5,
|
|
11105
11616
|
children: t9
|
|
@@ -11112,7 +11623,7 @@ var FileCitation = function(t0) {
|
|
|
11112
11623
|
}
|
|
11113
11624
|
var t11;
|
|
11114
11625
|
if ($[15] !== t10 || $[16] !== t3) {
|
|
11115
|
-
t11 = /* @__PURE__ */ (0,
|
|
11626
|
+
t11 = /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(import_jsx_runtime96.Fragment, {
|
|
11116
11627
|
children: [
|
|
11117
11628
|
t3,
|
|
11118
11629
|
t10
|
|
@@ -11127,7 +11638,7 @@ var FileCitation = function(t0) {
|
|
|
11127
11638
|
return t11;
|
|
11128
11639
|
};
|
|
11129
11640
|
// src/components/annotations/SourceAnnotation/index.tsx
|
|
11130
|
-
var
|
|
11641
|
+
var import_jsx_runtime97 = require("react/jsx-runtime");
|
|
11131
11642
|
var _excluded7 = [
|
|
11132
11643
|
"children"
|
|
11133
11644
|
];
|
|
@@ -11150,7 +11661,7 @@ function _objectWithoutPropertiesLoose7(r, e) {
|
|
|
11150
11661
|
return t;
|
|
11151
11662
|
}
|
|
11152
11663
|
var SourceAnnotation = function(t0) {
|
|
11153
|
-
var $ = (0,
|
|
11664
|
+
var $ = (0, import_react_compiler_runtime61.c)(10);
|
|
11154
11665
|
var children;
|
|
11155
11666
|
var rest;
|
|
11156
11667
|
if ($[0] !== t0) {
|
|
@@ -11178,7 +11689,7 @@ var SourceAnnotation = function(t0) {
|
|
|
11178
11689
|
if (annotation.type === "file_citation") {
|
|
11179
11690
|
var t2;
|
|
11180
11691
|
if ($[5] !== annotation) {
|
|
11181
|
-
t2 = /* @__PURE__ */ (0,
|
|
11692
|
+
t2 = /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(FileCitation, {
|
|
11182
11693
|
annotation: annotation
|
|
11183
11694
|
});
|
|
11184
11695
|
$[5] = annotation;
|
|
@@ -11191,7 +11702,7 @@ var SourceAnnotation = function(t0) {
|
|
|
11191
11702
|
if (annotation.type === "file_path") {
|
|
11192
11703
|
var _t2;
|
|
11193
11704
|
if ($[7] !== annotation || $[8] !== children) {
|
|
11194
|
-
_t2 = /* @__PURE__ */ (0,
|
|
11705
|
+
_t2 = /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(FilePathAnnotation, {
|
|
11195
11706
|
annotation: annotation,
|
|
11196
11707
|
children: children
|
|
11197
11708
|
});
|
|
@@ -11207,7 +11718,7 @@ var SourceAnnotation = function(t0) {
|
|
|
11207
11718
|
return null;
|
|
11208
11719
|
};
|
|
11209
11720
|
// src/components/avatars/Avatar.tsx
|
|
11210
|
-
var
|
|
11721
|
+
var import_react_compiler_runtime64 = require("react-compiler-runtime");
|
|
11211
11722
|
// src/lib/enums/index.ts
|
|
11212
11723
|
var IconAvatarName = /* @__PURE__ */ function(IconAvatarName2) {
|
|
11213
11724
|
IconAvatarName2["BACKPACK"] = "BACKPACK";
|
|
@@ -11232,7 +11743,7 @@ var AvatarType = /* @__PURE__ */ function(AvatarType2) {
|
|
|
11232
11743
|
// src/components/avatars/Avatar.tsx
|
|
11233
11744
|
var import_themes68 = require("@radix-ui/themes");
|
|
11234
11745
|
// src/components/imageAvatars/ImageAvatar/index.tsx
|
|
11235
|
-
var
|
|
11746
|
+
var import_react_compiler_runtime62 = require("react-compiler-runtime");
|
|
11236
11747
|
var import_themes66 = require("@radix-ui/themes");
|
|
11237
11748
|
// src/components/imageAvatars/ImageAvatar/lib/optimizedSrc/path.ts
|
|
11238
11749
|
var width = function(_ref) {
|
|
@@ -11284,9 +11795,9 @@ var optimizedSrc = function(_ref) {
|
|
|
11284
11795
|
}));
|
|
11285
11796
|
};
|
|
11286
11797
|
// src/components/imageAvatars/ImageAvatar/index.tsx
|
|
11287
|
-
var
|
|
11798
|
+
var import_jsx_runtime98 = require("react/jsx-runtime");
|
|
11288
11799
|
var ImageAvatar = function(t0) {
|
|
11289
|
-
var $ = (0,
|
|
11800
|
+
var $ = (0, import_react_compiler_runtime62.c)(9);
|
|
11290
11801
|
var imageAvatar = t0.imageAvatar, size = t0.size, className = t0.className, style = t0.style;
|
|
11291
11802
|
var superinterfaceContext = useSuperinterfaceContext();
|
|
11292
11803
|
var t1;
|
|
@@ -11305,7 +11816,7 @@ var ImageAvatar = function(t0) {
|
|
|
11305
11816
|
}
|
|
11306
11817
|
var t2;
|
|
11307
11818
|
if ($[4] !== className || $[5] !== size || $[6] !== style || $[7] !== t1) {
|
|
11308
|
-
t2 = /* @__PURE__ */ (0,
|
|
11819
|
+
t2 = /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(import_themes66.Avatar, {
|
|
11309
11820
|
className: className,
|
|
11310
11821
|
style: style,
|
|
11311
11822
|
fallback: "",
|
|
@@ -11323,24 +11834,24 @@ var ImageAvatar = function(t0) {
|
|
|
11323
11834
|
return t2;
|
|
11324
11835
|
};
|
|
11325
11836
|
// src/components/iconAvatars/IconAvatar.tsx
|
|
11326
|
-
var
|
|
11327
|
-
var
|
|
11837
|
+
var import_react_compiler_runtime63 = require("react-compiler-runtime");
|
|
11838
|
+
var import_react71 = require("react");
|
|
11328
11839
|
var import_themes67 = require("@radix-ui/themes");
|
|
11329
11840
|
// src/lib/iconAvatars/iconAvatarComponents.ts
|
|
11330
11841
|
var import_react_icons19 = require("@radix-ui/react-icons");
|
|
11331
11842
|
var _obj;
|
|
11332
11843
|
var iconAvatarComponents = (_obj = {}, _define_property(_obj, IconAvatarName.BACKPACK, import_react_icons19.BackpackIcon), _define_property(_obj, IconAvatarName.ROCKET, import_react_icons19.RocketIcon), _define_property(_obj, IconAvatarName.MAGIC_WAND, import_react_icons19.MagicWandIcon), _define_property(_obj, IconAvatarName.CUBE, import_react_icons19.CubeIcon), _define_property(_obj, IconAvatarName.TARGET, import_react_icons19.TargetIcon), _define_property(_obj, IconAvatarName.DISC, import_react_icons19.DiscIcon), _define_property(_obj, IconAvatarName.GLOBE, import_react_icons19.GlobeIcon), _define_property(_obj, IconAvatarName.STAR, import_react_icons19.StarIcon), _define_property(_obj, IconAvatarName.LIGHTNING_BOLT, import_react_icons19.LightningBoltIcon), _define_property(_obj, IconAvatarName.FACE, import_react_icons19.FaceIcon), _define_property(_obj, IconAvatarName.PERSON, import_react_icons19.PersonIcon), _define_property(_obj, IconAvatarName.HEART, import_react_icons19.HeartIcon), _obj);
|
|
11333
11844
|
// src/components/iconAvatars/IconAvatar.tsx
|
|
11334
|
-
var
|
|
11845
|
+
var import_jsx_runtime99 = require("react/jsx-runtime");
|
|
11335
11846
|
var IconAvatar = function(t0) {
|
|
11336
|
-
var $ = (0,
|
|
11847
|
+
var $ = (0, import_react_compiler_runtime63.c)(7);
|
|
11337
11848
|
var iconAvatar = t0.iconAvatar, size = t0.size, className = t0.className, style = t0.style;
|
|
11338
11849
|
var t1;
|
|
11339
11850
|
t1 = iconAvatarComponents[iconAvatar.name];
|
|
11340
11851
|
var Component2 = t1;
|
|
11341
11852
|
var t2;
|
|
11342
11853
|
if ($[0] !== Component2) {
|
|
11343
|
-
t2 = Component2 ? /* @__PURE__ */ (0,
|
|
11854
|
+
t2 = Component2 ? /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(Component2, {}) : "";
|
|
11344
11855
|
$[0] = Component2;
|
|
11345
11856
|
$[1] = t2;
|
|
11346
11857
|
} else {
|
|
@@ -11348,7 +11859,7 @@ var IconAvatar = function(t0) {
|
|
|
11348
11859
|
}
|
|
11349
11860
|
var t3;
|
|
11350
11861
|
if ($[2] !== className || $[3] !== size || $[4] !== style || $[5] !== t2) {
|
|
11351
|
-
t3 = /* @__PURE__ */ (0,
|
|
11862
|
+
t3 = /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(import_themes67.Avatar, {
|
|
11352
11863
|
className: className,
|
|
11353
11864
|
style: style,
|
|
11354
11865
|
size: size,
|
|
@@ -11365,16 +11876,16 @@ var IconAvatar = function(t0) {
|
|
|
11365
11876
|
return t3;
|
|
11366
11877
|
};
|
|
11367
11878
|
// src/components/avatars/Avatar.tsx
|
|
11368
|
-
var
|
|
11879
|
+
var import_jsx_runtime100 = require("react/jsx-runtime");
|
|
11369
11880
|
var Avatar6 = function(t0) {
|
|
11370
|
-
var $ = (0,
|
|
11881
|
+
var $ = (0, import_react_compiler_runtime64.c)(14);
|
|
11371
11882
|
var avatar = t0.avatar, t1 = t0.size, className = t0.className, style = t0.style;
|
|
11372
11883
|
var size = t1 === void 0 ? "1" : t1;
|
|
11373
11884
|
if (avatar) {
|
|
11374
11885
|
if (avatar.type === AvatarType.IMAGE && avatar.imageAvatar) {
|
|
11375
11886
|
var _t;
|
|
11376
11887
|
if ($[0] !== avatar.imageAvatar || $[1] !== className || $[2] !== size || $[3] !== style) {
|
|
11377
|
-
_t = /* @__PURE__ */ (0,
|
|
11888
|
+
_t = /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(ImageAvatar, {
|
|
11378
11889
|
imageAvatar: avatar.imageAvatar,
|
|
11379
11890
|
size: size,
|
|
11380
11891
|
className: className,
|
|
@@ -11393,7 +11904,7 @@ var Avatar6 = function(t0) {
|
|
|
11393
11904
|
if (avatar.type === AvatarType.ICON && avatar.iconAvatar) {
|
|
11394
11905
|
var _t2;
|
|
11395
11906
|
if ($[5] !== avatar.iconAvatar || $[6] !== className || $[7] !== size || $[8] !== style) {
|
|
11396
|
-
_t2 = /* @__PURE__ */ (0,
|
|
11907
|
+
_t2 = /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(IconAvatar, {
|
|
11397
11908
|
iconAvatar: avatar.iconAvatar,
|
|
11398
11909
|
size: size,
|
|
11399
11910
|
className: className,
|
|
@@ -11412,7 +11923,7 @@ var Avatar6 = function(t0) {
|
|
|
11412
11923
|
}
|
|
11413
11924
|
var t2;
|
|
11414
11925
|
if ($[10] !== className || $[11] !== size || $[12] !== style) {
|
|
11415
|
-
t2 = /* @__PURE__ */ (0,
|
|
11926
|
+
t2 = /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(import_themes68.Avatar, {
|
|
11416
11927
|
fallback: "",
|
|
11417
11928
|
size: size,
|
|
11418
11929
|
className: className,
|
|
@@ -11428,15 +11939,15 @@ var Avatar6 = function(t0) {
|
|
|
11428
11939
|
return t2;
|
|
11429
11940
|
};
|
|
11430
11941
|
// src/components/components/ComponentsProvider.tsx
|
|
11431
|
-
var
|
|
11432
|
-
var
|
|
11942
|
+
var import_react_compiler_runtime65 = require("react-compiler-runtime");
|
|
11943
|
+
var import_react73 = require("react");
|
|
11433
11944
|
// src/hooks/components/useComponents.ts
|
|
11434
|
-
var
|
|
11945
|
+
var import_react72 = require("react");
|
|
11435
11946
|
var useComponents = function() {
|
|
11436
|
-
return (0,
|
|
11947
|
+
return (0, import_react72.useContext)(ComponentsContext);
|
|
11437
11948
|
};
|
|
11438
11949
|
// src/components/components/ComponentsProvider.tsx
|
|
11439
|
-
var
|
|
11950
|
+
var import_jsx_runtime101 = require("react/jsx-runtime");
|
|
11440
11951
|
var _excluded8 = [
|
|
11441
11952
|
"children"
|
|
11442
11953
|
];
|
|
@@ -11459,7 +11970,7 @@ function _objectWithoutPropertiesLoose8(r, e) {
|
|
|
11459
11970
|
return t;
|
|
11460
11971
|
}
|
|
11461
11972
|
var ComponentsProvider = function(t0) {
|
|
11462
|
-
var $ = (0,
|
|
11973
|
+
var $ = (0, import_react_compiler_runtime65.c)(9);
|
|
11463
11974
|
var children;
|
|
11464
11975
|
var rest;
|
|
11465
11976
|
if ($[0] !== t0) {
|
|
@@ -11489,7 +12000,7 @@ var ComponentsProvider = function(t0) {
|
|
|
11489
12000
|
var value = t1;
|
|
11490
12001
|
var t3;
|
|
11491
12002
|
if ($[6] !== children || $[7] !== value) {
|
|
11492
|
-
t3 = /* @__PURE__ */ (0,
|
|
12003
|
+
t3 = /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(ComponentsContext.Provider, {
|
|
11493
12004
|
value: value,
|
|
11494
12005
|
children: children
|
|
11495
12006
|
});
|
|
@@ -11502,11 +12013,11 @@ var ComponentsProvider = function(t0) {
|
|
|
11502
12013
|
return t3;
|
|
11503
12014
|
};
|
|
11504
12015
|
// src/components/assistants/AssistantProvider/index.tsx
|
|
11505
|
-
var
|
|
11506
|
-
var
|
|
12016
|
+
var import_react_compiler_runtime66 = require("react-compiler-runtime");
|
|
12017
|
+
var import_jsx_runtime102 = require("react/jsx-runtime");
|
|
11507
12018
|
var AssistantProvider = function(t0) {
|
|
11508
12019
|
var _assistant$name;
|
|
11509
|
-
var $ = (0,
|
|
12020
|
+
var $ = (0, import_react_compiler_runtime66.c)(10);
|
|
11510
12021
|
var children = t0.children;
|
|
11511
12022
|
var superinterfaceContext = useSuperinterfaceContext();
|
|
11512
12023
|
var t1;
|
|
@@ -11524,7 +12035,7 @@ var AssistantProvider = function(t0) {
|
|
|
11524
12035
|
var t3 = assistant === null || assistant === void 0 ? void 0 : assistant.avatar;
|
|
11525
12036
|
var t4;
|
|
11526
12037
|
if ($[2] !== t3) {
|
|
11527
|
-
t4 = /* @__PURE__ */ (0,
|
|
12038
|
+
t4 = /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(Avatar6, {
|
|
11528
12039
|
avatar: t3
|
|
11529
12040
|
});
|
|
11530
12041
|
$[2] = t3;
|
|
@@ -11534,7 +12045,7 @@ var AssistantProvider = function(t0) {
|
|
|
11534
12045
|
}
|
|
11535
12046
|
var t5;
|
|
11536
12047
|
if ($[4] !== children || $[5] !== t4) {
|
|
11537
|
-
t5 = /* @__PURE__ */ (0,
|
|
12048
|
+
t5 = /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(AssistantAvatarContext.Provider, {
|
|
11538
12049
|
value: t4,
|
|
11539
12050
|
children: children
|
|
11540
12051
|
});
|
|
@@ -11546,7 +12057,7 @@ var AssistantProvider = function(t0) {
|
|
|
11546
12057
|
}
|
|
11547
12058
|
var t6;
|
|
11548
12059
|
if ($[7] !== t2 || $[8] !== t5) {
|
|
11549
|
-
t6 = /* @__PURE__ */ (0,
|
|
12060
|
+
t6 = /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(AssistantNameContext.Provider, {
|
|
11550
12061
|
value: t2,
|
|
11551
12062
|
children: t5
|
|
11552
12063
|
});
|
|
@@ -11578,7 +12089,9 @@ var AssistantProvider = function(t0) {
|
|
|
11578
12089
|
Thread: Thread,
|
|
11579
12090
|
ThreadDialog: ThreadDialog,
|
|
11580
12091
|
ThreadDialogContext: ThreadDialogContext,
|
|
12092
|
+
TtsAudioRuntimeProvider: TtsAudioRuntimeProvider,
|
|
11581
12093
|
UserAvatarContext: UserAvatarContext,
|
|
12094
|
+
WebrtcAudioRuntimeProvider: WebrtcAudioRuntimeProvider,
|
|
11582
12095
|
useAssistant: useAssistant,
|
|
11583
12096
|
useAudioThreadContext: useAudioThreadContext,
|
|
11584
12097
|
useComponents: useComponents,
|
|
@@ -11591,6 +12104,8 @@ var AssistantProvider = function(t0) {
|
|
|
11591
12104
|
useMessages: useMessages,
|
|
11592
12105
|
useSuperinterfaceContext: useSuperinterfaceContext,
|
|
11593
12106
|
useThreadContext: useThreadContext,
|
|
11594
|
-
useThreadDialogContext: useThreadDialogContext
|
|
12107
|
+
useThreadDialogContext: useThreadDialogContext,
|
|
12108
|
+
useTtsAudioRuntime: useTtsAudioRuntime,
|
|
12109
|
+
useWebrtcAudioRuntime: useWebrtcAudioRuntime
|
|
11595
12110
|
});
|
|
11596
12111
|
//# sourceMappingURL=index.cjs.map
|