@realsee/live 0.6.8-dev.2 → 0.6.8-dev.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +7 -7
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +344 -319
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -3,13 +3,13 @@ var $t = (r, s, e) => s in r ? Vt(r, s, { enumerable: !0, configurable: !0, writ
|
|
|
3
3
|
var o = (r, s, e) => ($t(r, typeof s != "symbol" ? s + "" : s, e), e);
|
|
4
4
|
import xt from "@realsee/jsbridge-x";
|
|
5
5
|
import Ne from "trtc-js-sdk";
|
|
6
|
-
import { ConsoleLogger as Ut, LogLevel as Ft, DefaultDeviceController as
|
|
6
|
+
import { ConsoleLogger as Ut, LogLevel as Ft, DefaultDeviceController as Bt, MeetingSessionConfiguration as Wt, DefaultMeetingSession as Kt, DefaultModality as tt, MeetingSessionStatusCode as qt } from "amazon-chime-sdk-js";
|
|
7
7
|
import D, { createContext as Gt } from "react";
|
|
8
8
|
const ce = Symbol("$$REALSEE_LIVE_EVENT$$");
|
|
9
9
|
function pe(r) {
|
|
10
10
|
return r[ce] || (r[ce] = {}), r[ce];
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function Yt(r) {
|
|
13
13
|
r[ce] || delete r[ce];
|
|
14
14
|
}
|
|
15
15
|
class ue {
|
|
@@ -56,7 +56,7 @@ class ue {
|
|
|
56
56
|
*/
|
|
57
57
|
off(s, e) {
|
|
58
58
|
if (s === void 0) {
|
|
59
|
-
|
|
59
|
+
Yt(this);
|
|
60
60
|
return;
|
|
61
61
|
}
|
|
62
62
|
const i = pe(this);
|
|
@@ -80,8 +80,8 @@ class ue {
|
|
|
80
80
|
let i = !1;
|
|
81
81
|
const c = pe(this)[s] || [];
|
|
82
82
|
for (let u of c.slice()) {
|
|
83
|
-
const [d,
|
|
84
|
-
|
|
83
|
+
const [d, g = !1] = u, v = d(...e);
|
|
84
|
+
g && this.off(s, d), v === !1 && (i = !0);
|
|
85
85
|
}
|
|
86
86
|
return i;
|
|
87
87
|
}
|
|
@@ -89,11 +89,11 @@ class ue {
|
|
|
89
89
|
class Me extends ue {
|
|
90
90
|
}
|
|
91
91
|
var Q = /* @__PURE__ */ ((r) => (r.RealseeBrowserRTC = "RealseeBrowserRTC", r.RealseeVRWebViewRTC = "RealseeVRWebViewRTC", r.RealseeBrowserChimeRTC = "RealseeBrowserChimeRTC", r))(Q || {}), ut = /* @__PURE__ */ ((r) => (r.RealseeXTRTC = "trtc", r.RealseeXChimeRTC = "chime", r))(ut || {});
|
|
92
|
-
const
|
|
92
|
+
const Ht = () => {
|
|
93
93
|
const r = new Date(), s = r.getFullYear(), e = (r.getMonth() + 1).toString().padStart(2, "0"), i = r.getDate().toString().padStart(2, "0"), n = r.getHours().toString().padStart(2, "0"), c = r.getMinutes().toString().padStart(2, "0"), u = r.getSeconds().toString().padStart(2, "0"), d = r.getMilliseconds();
|
|
94
94
|
return `[${s}-${e}-${i} ${n}:${c}:${u}.${d}]`;
|
|
95
95
|
}, be = (r, s = []) => {
|
|
96
|
-
switch (s.unshift(`Realsee Live ${
|
|
96
|
+
switch (s.unshift(`Realsee Live ${Ht()} <${r}> `), r) {
|
|
97
97
|
case "INFO":
|
|
98
98
|
return console.info(...s);
|
|
99
99
|
case "ERROR":
|
|
@@ -108,7 +108,7 @@ const Yt = () => {
|
|
|
108
108
|
info: zt,
|
|
109
109
|
error: Xt,
|
|
110
110
|
warn: Zt
|
|
111
|
-
},
|
|
111
|
+
}, O = Qt;
|
|
112
112
|
function X() {
|
|
113
113
|
return ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
|
|
114
114
|
}
|
|
@@ -173,8 +173,8 @@ class rt extends Me {
|
|
|
173
173
|
u.id = c, this.$dom.appendChild(u), typeof this._autoPlayConfirm == "function" ? (i.play(c).catch((d) => {
|
|
174
174
|
}), i.on("error", (d) => {
|
|
175
175
|
if (d.getCode() === 16451) {
|
|
176
|
-
const
|
|
177
|
-
this._autoPlayConfirm({ onConfirm:
|
|
176
|
+
const v = () => i.resume();
|
|
177
|
+
this._autoPlayConfirm({ onConfirm: v });
|
|
178
178
|
}
|
|
179
179
|
})) : i.play(c);
|
|
180
180
|
});
|
|
@@ -194,7 +194,7 @@ class rt extends Me {
|
|
|
194
194
|
const i = { audio: !0, video: !1 };
|
|
195
195
|
try {
|
|
196
196
|
navigator.mediaDevices.getUserMedia(i).then(() => e(!0)).catch((n) => {
|
|
197
|
-
|
|
197
|
+
O.error(n.message), e(!1);
|
|
198
198
|
});
|
|
199
199
|
} catch (n) {
|
|
200
200
|
console.error(n), e(!1);
|
|
@@ -216,9 +216,9 @@ class rt extends Me {
|
|
|
216
216
|
"audio-volume",
|
|
217
217
|
(u) => this.emit(
|
|
218
218
|
"userVolumes",
|
|
219
|
-
u.result.map(({ userId: d, audioVolume:
|
|
219
|
+
u.result.map(({ userId: d, audioVolume: g }) => ({
|
|
220
220
|
userId: d,
|
|
221
|
-
audioVolume:
|
|
221
|
+
audioVolume: g
|
|
222
222
|
}))
|
|
223
223
|
)
|
|
224
224
|
), (c = this._trtc.client) == null || c.on("error", (u) => this.emit("error", u));
|
|
@@ -288,7 +288,7 @@ class it extends Me {
|
|
|
288
288
|
if (this.$audio.paused) {
|
|
289
289
|
const i = () => this.$audio.play().then(() => {
|
|
290
290
|
}).catch((n) => {
|
|
291
|
-
if (
|
|
291
|
+
if (O.error("播放远端流失败!", n), typeof this._autoPlayConfirm == "function") {
|
|
292
292
|
const c = () => i();
|
|
293
293
|
this._autoPlayConfirm({ onConfirm: c });
|
|
294
294
|
}
|
|
@@ -304,46 +304,46 @@ class it extends Me {
|
|
|
304
304
|
* 注册rtc事件
|
|
305
305
|
*/
|
|
306
306
|
o(this, "_registerRtcEvent", () => {
|
|
307
|
-
var i, n, c, u, d,
|
|
307
|
+
var i, n, c, u, d, g;
|
|
308
308
|
const e = ((c = (n = (i = this.meetingSession) == null ? void 0 : i.configuration) == null ? void 0 : n.credentials) == null ? void 0 : c.attendeeId) || "";
|
|
309
309
|
if (e) {
|
|
310
|
-
const
|
|
311
|
-
const
|
|
312
|
-
return
|
|
313
|
-
|
|
310
|
+
const v = /* @__PURE__ */ new Map(), E = () => {
|
|
311
|
+
const y = [];
|
|
312
|
+
return v.forEach((I, _) => {
|
|
313
|
+
y.push({
|
|
314
314
|
userId: I.userId,
|
|
315
315
|
volume: I.muted || I.signalStrength === 0 || !Boolean(I.volume) ? 0 : I.volume
|
|
316
316
|
});
|
|
317
|
-
}),
|
|
317
|
+
}), y;
|
|
318
318
|
};
|
|
319
319
|
(u = this.meetingSession) == null || u.audioVideo.realtimeSubscribeToAttendeeIdPresence(
|
|
320
|
-
(
|
|
320
|
+
(y, I, _) => {
|
|
321
321
|
var V;
|
|
322
322
|
if (!I) {
|
|
323
|
-
|
|
323
|
+
v.delete(y), this.emit("userVolumes", E());
|
|
324
324
|
return;
|
|
325
325
|
}
|
|
326
326
|
(V = this.meetingSession) == null || V.audioVideo.realtimeSubscribeToVolumeIndicator(
|
|
327
|
-
|
|
328
|
-
(
|
|
329
|
-
new tt(
|
|
330
|
-
userId:
|
|
327
|
+
y,
|
|
328
|
+
(C, k, U, P) => {
|
|
329
|
+
new tt(C).base() === C && (v.set(C, {
|
|
330
|
+
userId: _ || C,
|
|
331
331
|
volume: k,
|
|
332
332
|
muted: U,
|
|
333
333
|
signalStrength: P
|
|
334
|
-
}), this.emit("userVolumes",
|
|
334
|
+
}), this.emit("userVolumes", E()));
|
|
335
335
|
}
|
|
336
336
|
);
|
|
337
337
|
}
|
|
338
338
|
), (d = this.meetingSession) == null || d.audioVideo.realtimeSubscribeToVolumeIndicator(
|
|
339
339
|
e,
|
|
340
|
-
(
|
|
341
|
-
new tt(
|
|
340
|
+
(y, I, _, V) => {
|
|
341
|
+
new tt(y).base() === y && V !== null && V !== 1 && this.emit("weakNetwork");
|
|
342
342
|
}
|
|
343
|
-
), (
|
|
343
|
+
), (g = this.meetingSession) == null || g.audioVideo.realtimeSubscribeToFatalError((y) => this.emit("error", y));
|
|
344
344
|
}
|
|
345
345
|
});
|
|
346
|
-
this._getVoiceSign = e.getVoiceSign, this._autoPlayConfirm = e.autoPlayConfirm, this._initDom(), this.logger = new Ut("WebRTCLogger", e.logLevel || Ft.INFO), this.deviceController = new
|
|
346
|
+
this._getVoiceSign = e.getVoiceSign, this._autoPlayConfirm = e.autoPlayConfirm, this._initDom(), this.logger = new Ut("WebRTCLogger", e.logLevel || Ft.INFO), this.deviceController = new Bt(this.logger), this.initObservers();
|
|
347
347
|
}
|
|
348
348
|
/**
|
|
349
349
|
* 加入语音会议
|
|
@@ -355,30 +355,30 @@ class it extends Me {
|
|
|
355
355
|
var c, u;
|
|
356
356
|
this.emit("joinWillStart");
|
|
357
357
|
try {
|
|
358
|
-
const { sdkAppId: d, userId:
|
|
358
|
+
const { sdkAppId: d, userId: g, roomId: v, userSig: E } = await this._getVoiceSign({
|
|
359
359
|
...e,
|
|
360
360
|
roomId: e.roomId || 0
|
|
361
361
|
});
|
|
362
|
-
this.userId =
|
|
363
|
-
const { attendence:
|
|
364
|
-
decodeURIComponent(
|
|
365
|
-
),
|
|
362
|
+
this.userId = g;
|
|
363
|
+
const { attendence: y, vendor_wrapper: I } = JSON.parse(
|
|
364
|
+
decodeURIComponent(E)
|
|
365
|
+
), _ = new Wt(
|
|
366
366
|
{
|
|
367
367
|
Meeting: I
|
|
368
368
|
},
|
|
369
369
|
{
|
|
370
370
|
Attendee: {
|
|
371
|
-
ExternalUserId:
|
|
372
|
-
AttendeeId:
|
|
373
|
-
JoinToken:
|
|
371
|
+
ExternalUserId: y.external_user_id,
|
|
372
|
+
AttendeeId: y.attendee_id,
|
|
373
|
+
JoinToken: y.join_token
|
|
374
374
|
}
|
|
375
375
|
}
|
|
376
376
|
);
|
|
377
|
-
this.meetingSession = new Kt(
|
|
377
|
+
this.meetingSession = new Kt(_, this.logger, this.deviceController), this._registerRtcEvent(), this.meetingSession.audioVideo.addDeviceChangeObserver(this.deviceChangeObserver), this.meetingSession.audioVideo.addObserver(this.audioVideoObserver), this.meetingSession.audioVideo.bindAudioElement(this.$audio);
|
|
378
378
|
const V = {
|
|
379
379
|
audioVideoDidStart: () => {
|
|
380
|
-
var
|
|
381
|
-
(
|
|
380
|
+
var C;
|
|
381
|
+
(C = this.meetingSession) == null || C.audioVideo.realtimeMuteLocalAudio(), this.joined = !0, this.emit("joined"), i(!0);
|
|
382
382
|
},
|
|
383
383
|
audioVideoDidStop: () => {
|
|
384
384
|
this.joined = !1, i(!1);
|
|
@@ -388,20 +388,20 @@ class it extends Me {
|
|
|
388
388
|
async () => await navigator.mediaDevices.getUserMedia({ audio: !0, video: !1 })
|
|
389
389
|
);
|
|
390
390
|
try {
|
|
391
|
-
const
|
|
392
|
-
|
|
393
|
-
const k = ((c =
|
|
391
|
+
const C = await this.meetingSession.audioVideo.listAudioInputDevices();
|
|
392
|
+
O.info("audioInputDevices ===>", C);
|
|
393
|
+
const k = ((c = C[0]) == null ? void 0 : c.deviceId) || "default";
|
|
394
394
|
await this.meetingSession.audioVideo.startAudioInput(k);
|
|
395
|
-
} catch (
|
|
396
|
-
|
|
395
|
+
} catch (C) {
|
|
396
|
+
O.error(`设置语音输入设备失败:${C.message}`);
|
|
397
397
|
}
|
|
398
398
|
try {
|
|
399
|
-
const
|
|
400
|
-
|
|
401
|
-
const k = ((u =
|
|
399
|
+
const C = await this.meetingSession.audioVideo.listAudioOutputDevices();
|
|
400
|
+
O.info("audioOutputDevices ===>", C);
|
|
401
|
+
const k = ((u = C[0]) == null ? void 0 : u.deviceId) || "default";
|
|
402
402
|
await this.meetingSession.audioVideo.chooseAudioOutput(k);
|
|
403
|
-
} catch (
|
|
404
|
-
|
|
403
|
+
} catch (C) {
|
|
404
|
+
O.error(`设置语音输出设备失败:${C.message}`);
|
|
405
405
|
}
|
|
406
406
|
this.meetingSession.audioVideo.start();
|
|
407
407
|
} catch (d) {
|
|
@@ -415,9 +415,9 @@ class it extends Me {
|
|
|
415
415
|
this.joined = !1;
|
|
416
416
|
const n = {
|
|
417
417
|
audioVideoDidStop: async (d) => {
|
|
418
|
-
var
|
|
419
|
-
const
|
|
420
|
-
(
|
|
418
|
+
var v;
|
|
419
|
+
const g = d.statusCode();
|
|
420
|
+
(v = this.meetingSession) == null || v.deviceController.destroy(), g === qt.Left ? (this.logger.info("You left the session"), e(!0)) : (this.logger.info(`Stopped with a session status code: ${g}`), e(!0));
|
|
421
421
|
}
|
|
422
422
|
};
|
|
423
423
|
(c = this.meetingSession) == null || c.audioVideo.addObserver(n), (u = this.meetingSession) == null || u.audioVideo.stop();
|
|
@@ -506,7 +506,7 @@ class nt extends Me {
|
|
|
506
506
|
this.jsBridge.shock(1);
|
|
507
507
|
}
|
|
508
508
|
}
|
|
509
|
-
var K = /* @__PURE__ */ ((r) => (r.SelfUserInfo = "SELF_USER_INFO", r.RoomInfo = "ROOM_INFO", r.RTCInfo = "RTC_INFO", r.UserList = "USER_LIST", r.BuiltinMsg = "BUILTIN_MSG", r.CustomEvent = "CUSTOM_EVENT", r.KeyframeSync = "KEYFRAME_SYNC", r.UserKickOut = "USER_KICK_OUT", r))(K || {}), q = /* @__PURE__ */ ((r) => (r.UserChange = "user_change", r.RoomChange = "room_change", r))(q || {}),
|
|
509
|
+
var K = /* @__PURE__ */ ((r) => (r.SelfUserInfo = "SELF_USER_INFO", r.RoomInfo = "ROOM_INFO", r.RTCInfo = "RTC_INFO", r.UserList = "USER_LIST", r.BuiltinMsg = "BUILTIN_MSG", r.CustomEvent = "CUSTOM_EVENT", r.KeyframeSync = "KEYFRAME_SYNC", r.UserKickOut = "USER_KICK_OUT", r))(K || {}), q = /* @__PURE__ */ ((r) => (r.UserChange = "user_change", r.RoomChange = "room_change", r))(q || {}), H = /* @__PURE__ */ ((r) => (r.UserMicroStatus = "change_micro_status", r.UserMicroStatusSync = "sync_micro_status", r.UserPermission = "change_permission", r.UserStatus = "change_status", r.UserInfo = "change_info", r.RoomClose = "close", r))(H || {}), Z = /* @__PURE__ */ ((r) => (r.OPEN = "OPEN", r.CLOSE = "CLOSE", r))(Z || {});
|
|
510
510
|
function Nr(r) {
|
|
511
511
|
try {
|
|
512
512
|
const s = JSON.parse(r), e = {
|
|
@@ -633,7 +633,7 @@ class mr extends ue {
|
|
|
633
633
|
timeout: 1e4,
|
|
634
634
|
shouldReconnect: (e, i) => {
|
|
635
635
|
if (!(e.code === 1008 || e.code === 1011))
|
|
636
|
-
return [
|
|
636
|
+
return [0, 3e3, 1e4][i.attempts % 3];
|
|
637
637
|
},
|
|
638
638
|
should1000Reconnect: !1,
|
|
639
639
|
ignoreConnectivityEvents: !1,
|
|
@@ -651,57 +651,57 @@ class mr extends ue {
|
|
|
651
651
|
* 做一个健康检查
|
|
652
652
|
*/
|
|
653
653
|
o(this, "_healthCheck", async () => {
|
|
654
|
-
|
|
654
|
+
this._realWebSocket && this._realWebSocket.readyState !== this._readyState && (this._readyState = this._realWebSocket.readyState, this._readyState === Le.CLOSING && this.emit("closing")), await new Promise((e) => setTimeout(e, 2e3)), this._heathCheckTimer = requestAnimationFrame(this._healthCheck);
|
|
655
655
|
});
|
|
656
656
|
/**
|
|
657
657
|
* 清理健康检查
|
|
658
658
|
*/
|
|
659
659
|
o(this, "_clearHeathCheckIfNeed", () => {
|
|
660
|
-
|
|
660
|
+
this._heathCheckTimer && (cancelAnimationFrame(this._heathCheckTimer), this._heathCheckTimer = void 0);
|
|
661
661
|
});
|
|
662
662
|
/**
|
|
663
663
|
* 开启健康检查
|
|
664
664
|
*/
|
|
665
665
|
o(this, "_startHealthCheck", () => {
|
|
666
|
-
|
|
666
|
+
this._clearHeathCheckIfNeed(), this._heathCheckTimer = requestAnimationFrame(this._healthCheck);
|
|
667
667
|
});
|
|
668
668
|
/**
|
|
669
669
|
* 停止健康检查
|
|
670
670
|
*/
|
|
671
671
|
o(this, "_stopHealthCheck", () => {
|
|
672
|
-
|
|
672
|
+
this._clearHeathCheckIfNeed();
|
|
673
673
|
});
|
|
674
674
|
/**
|
|
675
675
|
* 清理连接中的请求
|
|
676
676
|
*/
|
|
677
677
|
o(this, "_clearPendingReconnectIfNeeded", () => {
|
|
678
|
-
|
|
678
|
+
this._pendingReconnect && (clearTimeout(this._pendingReconnect), this._pendingReconnect = void 0);
|
|
679
679
|
});
|
|
680
680
|
/**
|
|
681
681
|
* 当网页连接上网络进行重连
|
|
682
682
|
* @param event
|
|
683
683
|
*/
|
|
684
684
|
o(this, "_online", (e) => {
|
|
685
|
-
|
|
685
|
+
this._reconnectWhenOnlineAgain && (this._clearPendingReconnectIfNeeded(), this._reconnect(e));
|
|
686
686
|
});
|
|
687
687
|
/**
|
|
688
688
|
* 当网页断开网络进行关闭
|
|
689
689
|
*/
|
|
690
690
|
o(this, "_offline", () => {
|
|
691
691
|
var e;
|
|
692
|
-
|
|
692
|
+
this._reconnectWhenOnlineAgain = !0, (e = this._realWebSocket) == null || e.close(1e3, "offline");
|
|
693
693
|
});
|
|
694
694
|
/**
|
|
695
695
|
* 解除网络监听事件
|
|
696
696
|
*/
|
|
697
697
|
o(this, "_detachConnectivityEvents", () => {
|
|
698
|
-
|
|
698
|
+
this._connectivityEventsAttached && (globalThis == null || globalThis.removeEventListener("online", this._online), globalThis == null || globalThis.removeEventListener("offline", this._offline), this._connectivityEventsAttached = !1);
|
|
699
699
|
});
|
|
700
700
|
/**
|
|
701
701
|
* 注册网络监听事件
|
|
702
702
|
*/
|
|
703
703
|
o(this, "_attachConnectivityEvents", () => {
|
|
704
|
-
|
|
704
|
+
this._connectivityEventsAttached || (globalThis == null || globalThis.addEventListener("online", this._online), globalThis == null || globalThis.addEventListener("offline", this._offline), this._connectivityEventsAttached = !0);
|
|
705
705
|
});
|
|
706
706
|
/**
|
|
707
707
|
* 发送消息
|
|
@@ -710,7 +710,7 @@ class mr extends ue {
|
|
|
710
710
|
*/
|
|
711
711
|
o(this, "send", (e) => {
|
|
712
712
|
var i, n, c;
|
|
713
|
-
|
|
713
|
+
((i = this._realWebSocket) == null ? void 0 : i.readyState) === ((n = this._realWebSocket) == null ? void 0 : n.OPEN) && ((c = this._realWebSocket) == null || c.send(e));
|
|
714
714
|
});
|
|
715
715
|
/**
|
|
716
716
|
* 关闭连接
|
|
@@ -720,25 +720,24 @@ class mr extends ue {
|
|
|
720
720
|
*/
|
|
721
721
|
o(this, "close", (e, i) => {
|
|
722
722
|
var n;
|
|
723
|
-
return
|
|
723
|
+
return typeof e != "number" && (i = e, e = 1e3), this._clearPendingReconnectIfNeeded(), this._reconnectWhenOnlineAgain = !1, this._explicitlyClosed = !0, this._detachConnectivityEvents(), (n = this._realWebSocket) == null ? void 0 : n.close(e, i);
|
|
724
724
|
});
|
|
725
725
|
/**
|
|
726
726
|
* 进行ws连接
|
|
727
727
|
*/
|
|
728
728
|
o(this, "open", (e) => {
|
|
729
729
|
var i, n;
|
|
730
|
-
|
|
730
|
+
e && (this._url = e), ((i = this._realWebSocket) == null ? void 0 : i.readyState) !== WebSocket.OPEN && ((n = this._realWebSocket) == null ? void 0 : n.readyState) !== WebSocket.CONNECTING && (this._clearPendingReconnectIfNeeded(), this._reconnectWhenOnlineAgain = !1, this._explicitlyClosed = !1, this._createWebSocket());
|
|
731
731
|
});
|
|
732
732
|
/**
|
|
733
733
|
* 创建ws连接
|
|
734
734
|
*/
|
|
735
735
|
o(this, "_createWebSocket", () => {
|
|
736
736
|
var n, c, u;
|
|
737
|
-
_.info("_createWebSocket");
|
|
738
737
|
const e = typeof this._url == "string" ? this._url : (n = this._url) == null ? void 0 : n.call(this, this);
|
|
739
738
|
if (!e)
|
|
740
739
|
return;
|
|
741
|
-
this.
|
|
740
|
+
this._pendingReconnect = void 0, this._removeWebSocketEvent(), this._realWebSocket = new WebSocket(e, this._protocols || void 0), this._attempts = this._attempts + 1, this.emit(
|
|
742
741
|
"connecting",
|
|
743
742
|
new CustomEvent("connecting", {
|
|
744
743
|
detail: { attempts: this._attempts, reconnects: this._reconnects }
|
|
@@ -747,13 +746,13 @@ class mr extends ue {
|
|
|
747
746
|
const i = () => {
|
|
748
747
|
this._connectTimeout = void 0, this._detachConnectivityEvents(), this.emit(
|
|
749
748
|
"timeout",
|
|
750
|
-
new CustomEvent("
|
|
749
|
+
new CustomEvent("connecting", {
|
|
751
750
|
detail: {
|
|
752
751
|
attempts: this._attempts,
|
|
753
752
|
reconnects: this._reconnects
|
|
754
753
|
}
|
|
755
754
|
})
|
|
756
|
-
)
|
|
755
|
+
);
|
|
757
756
|
};
|
|
758
757
|
this._connectTimeout = setTimeout(i, (c = this._options) == null ? void 0 : c.timeout), this._dispatchWebSocketEvent(), (u = this._options) != null && u.ignoreConnectivityEvents || this._attachConnectivityEvents();
|
|
759
758
|
});
|
|
@@ -762,54 +761,77 @@ class mr extends ue {
|
|
|
762
761
|
*/
|
|
763
762
|
o(this, "_removeWebSocketEvent", () => {
|
|
764
763
|
var e, i, n, c;
|
|
765
|
-
|
|
764
|
+
(e = this._realWebSocket) == null || e.removeEventListener(
|
|
765
|
+
"open",
|
|
766
|
+
this._webSocketOpenHandler
|
|
767
|
+
), (i = this._realWebSocket) == null || i.removeEventListener(
|
|
768
|
+
"close",
|
|
769
|
+
this._webSocketCloseHandler
|
|
770
|
+
), (n = this._realWebSocket) == null || n.removeEventListener(
|
|
771
|
+
"error",
|
|
772
|
+
this._webSocketErrorHandler
|
|
773
|
+
), (c = this._realWebSocket) == null || c.removeEventListener(
|
|
774
|
+
"message",
|
|
775
|
+
this._webSocketMessageHandler
|
|
776
|
+
);
|
|
766
777
|
});
|
|
767
778
|
/**
|
|
768
779
|
* 分发ws事件
|
|
769
780
|
*/
|
|
770
781
|
o(this, "_dispatchWebSocketEvent", () => {
|
|
771
782
|
var e, i, n, c;
|
|
772
|
-
|
|
783
|
+
(e = this._realWebSocket) == null || e.addEventListener("open", this._webSocketOpenHandler), (i = this._realWebSocket) == null || i.addEventListener("close", this._webSocketCloseHandler), (n = this._realWebSocket) == null || n.addEventListener("error", this._webSocketErrorHandler), (c = this._realWebSocket) == null || c.addEventListener(
|
|
784
|
+
"message",
|
|
785
|
+
this._webSocketMessageHandler
|
|
786
|
+
);
|
|
773
787
|
});
|
|
774
788
|
/**
|
|
775
789
|
* ws连接事件
|
|
776
790
|
* @returns
|
|
777
791
|
*/
|
|
778
792
|
o(this, "_webSocketOpenHandler", (e) => {
|
|
779
|
-
|
|
793
|
+
this._connectTimeout && (clearTimeout(this._connectTimeout), this._connectTimeout = void 0);
|
|
780
794
|
const i = ++this._reconnects, n = this._attempts;
|
|
781
|
-
return this._attempts = 0, this._reconnectWhenOnlineAgain = !1, this._startHealthCheck(), this.emit(
|
|
795
|
+
return this._attempts = 0, this._reconnectWhenOnlineAgain = !1, this._startHealthCheck(), this.emit(
|
|
796
|
+
"open",
|
|
797
|
+
Object.assign(e, { detail: { reconnects: i, attempts: n } })
|
|
798
|
+
);
|
|
782
799
|
});
|
|
783
800
|
/**
|
|
784
801
|
* ws 关闭事件
|
|
785
802
|
* @param event
|
|
786
803
|
* @returns
|
|
787
804
|
*/
|
|
788
|
-
o(this, "_webSocketCloseHandler", (e) => (
|
|
805
|
+
o(this, "_webSocketCloseHandler", (e) => (this._reconnect(e), this._stopHealthCheck(), this.emit("close", e)));
|
|
789
806
|
/**
|
|
790
807
|
* ws 异常
|
|
791
808
|
* @param event
|
|
792
809
|
* @returns
|
|
793
810
|
*/
|
|
794
|
-
o(this, "_webSocketErrorHandler", (e) =>
|
|
811
|
+
o(this, "_webSocketErrorHandler", (e) => this.emit(
|
|
812
|
+
"error",
|
|
813
|
+
new CustomEvent("error", { detail: { error: e } })
|
|
814
|
+
));
|
|
795
815
|
/**
|
|
796
816
|
* ws消息
|
|
797
817
|
* @param event
|
|
798
818
|
* @returns
|
|
799
819
|
*/
|
|
800
|
-
o(this, "_webSocketMessageHandler", (e) =>
|
|
820
|
+
o(this, "_webSocketMessageHandler", (e) => this.emit("message", e));
|
|
801
821
|
e && this.setOptions(e), this._startHealthCheck();
|
|
802
822
|
}
|
|
803
823
|
get attempts() {
|
|
804
824
|
return this._attempts;
|
|
805
825
|
}
|
|
806
826
|
setOptions(e) {
|
|
807
|
-
if (
|
|
827
|
+
if (!e)
|
|
808
828
|
return;
|
|
809
829
|
this._url = e.url, this._protocols = e.protocols;
|
|
810
830
|
const i = Object.assign(this._options, e.robustOptions || {});
|
|
811
831
|
if (typeof (i == null ? void 0 : i.timeout) != "number")
|
|
812
|
-
throw new Error(
|
|
832
|
+
throw new Error(
|
|
833
|
+
"timeout must be the number of milliseconds to timeout a connection attempt"
|
|
834
|
+
);
|
|
813
835
|
if (typeof (i == null ? void 0 : i.shouldReconnect) != "function")
|
|
814
836
|
throw new Error(
|
|
815
837
|
"shouldReconnect must be a function that returns the number of milliseconds to wait for a reconnect attempt, or null or undefined to not reconnect."
|
|
@@ -823,7 +845,7 @@ class mr extends ue {
|
|
|
823
845
|
*/
|
|
824
846
|
_reconnect(e) {
|
|
825
847
|
var n, c, u, d;
|
|
826
|
-
if (
|
|
848
|
+
if (!((n = this._options) != null && n.should1000Reconnect) && e.code === 1e3 || this._explicitlyClosed) {
|
|
827
849
|
this._attempts = 0;
|
|
828
850
|
return;
|
|
829
851
|
}
|
|
@@ -842,7 +864,8 @@ class vr extends ue {
|
|
|
842
864
|
* ws代理器
|
|
843
865
|
*/
|
|
844
866
|
o(this, "_ws", new mr({
|
|
845
|
-
url: ""
|
|
867
|
+
url: "",
|
|
868
|
+
robustOptions: { timeout: 1e4, should1000Reconnect: !0 }
|
|
846
869
|
}));
|
|
847
870
|
/**
|
|
848
871
|
* 带看连接状态
|
|
@@ -865,28 +888,30 @@ class vr extends ue {
|
|
|
865
888
|
* @param event
|
|
866
889
|
*/
|
|
867
890
|
o(this, "_handleCloseEvent", (e) => {
|
|
868
|
-
|
|
891
|
+
O.info(
|
|
892
|
+
`live room closed bacause of ${e.code}-${e.reason || nr(e.code)}`
|
|
893
|
+
), this.state = x.CLOSED;
|
|
869
894
|
});
|
|
870
895
|
/**
|
|
871
896
|
* 处理房间正在关闭事件(这个时候可能是断网了)
|
|
872
897
|
*/
|
|
873
898
|
o(this, "_handleClosingEvent", () => {
|
|
874
899
|
var e;
|
|
875
|
-
|
|
900
|
+
O.info("live room is closing, onLine:", (e = globalThis == null ? void 0 : globalThis.navigator) == null ? void 0 : e.onLine), this.state = x.CLOSED;
|
|
876
901
|
});
|
|
877
902
|
/**
|
|
878
903
|
* 连接中
|
|
879
904
|
* @param event
|
|
880
905
|
*/
|
|
881
906
|
o(this, "_handleConnectingEvent", () => {
|
|
882
|
-
|
|
907
|
+
O.info("live room is connecting"), this.state = x.CONNECTING;
|
|
883
908
|
});
|
|
884
909
|
/**
|
|
885
910
|
* 连接发送异常
|
|
886
911
|
* @param event
|
|
887
912
|
*/
|
|
888
913
|
o(this, "_handleErrorEvent", (e) => {
|
|
889
|
-
|
|
914
|
+
O.error("live room error", e), this.state = x.CLOSED;
|
|
890
915
|
});
|
|
891
916
|
/**
|
|
892
917
|
* 接收到消息
|
|
@@ -907,14 +932,14 @@ class vr extends ue {
|
|
|
907
932
|
* @param event
|
|
908
933
|
*/
|
|
909
934
|
o(this, "_handleOpenEvent", (e) => {
|
|
910
|
-
|
|
935
|
+
O.info("live room open", e.detail), this.state = x.OPEN, e.detail.reconnects > 0 && this.emit("reconnected", e.detail);
|
|
911
936
|
});
|
|
912
937
|
/**
|
|
913
938
|
* 处理超时
|
|
914
939
|
* @param event
|
|
915
940
|
*/
|
|
916
941
|
o(this, "_handleTimeoutEvent", (e) => {
|
|
917
|
-
|
|
942
|
+
O.error("live room connect timeout!", e.detail), this.state = x.CLOSED;
|
|
918
943
|
});
|
|
919
944
|
/**
|
|
920
945
|
* 释放资源,释放之后需要重新实例化
|
|
@@ -1008,7 +1033,7 @@ class yr extends ue {
|
|
|
1008
1033
|
try {
|
|
1009
1034
|
return this._controller.sendMessage(n), !0;
|
|
1010
1035
|
} catch (c) {
|
|
1011
|
-
return
|
|
1036
|
+
return O.error(c), !1;
|
|
1012
1037
|
}
|
|
1013
1038
|
});
|
|
1014
1039
|
/**
|
|
@@ -1040,32 +1065,32 @@ class yr extends ue {
|
|
|
1040
1065
|
o(this, "_handleMessage", async (e) => {
|
|
1041
1066
|
var i, n, c, u, d;
|
|
1042
1067
|
if (typeof e == "object") {
|
|
1043
|
-
const { command:
|
|
1044
|
-
if (
|
|
1045
|
-
switch (
|
|
1068
|
+
const { command: g, data: v = {}, frontRequestId: E, code: y, message: I } = e;
|
|
1069
|
+
if (y === "SUCCESS")
|
|
1070
|
+
switch (g) {
|
|
1046
1071
|
case K.SelfUserInfo: {
|
|
1047
|
-
const
|
|
1048
|
-
ot(this.selfInfo,
|
|
1072
|
+
const _ = v;
|
|
1073
|
+
ot(this.selfInfo, _, { deep: !0 }) || (this._buildInData.selfInfo = _, this.emit(
|
|
1049
1074
|
"selfInfoUpdate",
|
|
1050
1075
|
this._buildInData.selfInfo,
|
|
1051
|
-
|
|
1076
|
+
E
|
|
1052
1077
|
));
|
|
1053
1078
|
break;
|
|
1054
1079
|
}
|
|
1055
1080
|
case K.RoomInfo: {
|
|
1056
|
-
const
|
|
1057
|
-
this._buildInData.roomInfo = Object.assign({},
|
|
1081
|
+
const _ = v;
|
|
1082
|
+
this._buildInData.roomInfo = Object.assign({}, _), this.emit(
|
|
1058
1083
|
"readyKeyframeSync",
|
|
1059
|
-
|
|
1084
|
+
_.last_frame || {}
|
|
1060
1085
|
);
|
|
1061
1086
|
break;
|
|
1062
1087
|
}
|
|
1063
1088
|
case K.RTCInfo: {
|
|
1064
|
-
const { voice_id:
|
|
1065
|
-
if (this._buildInData.rtcInfo = { voiceId:
|
|
1066
|
-
|
|
1089
|
+
const { voice_id: _, type: V } = v;
|
|
1090
|
+
if (this._buildInData.rtcInfo = { voiceId: _, type: V }, (i = this.$RTC) != null && i.joined)
|
|
1091
|
+
O.warn("已加入语音房间,无需重复加入!");
|
|
1067
1092
|
else if (await ((u = this.$RTC) == null ? void 0 : u.join({
|
|
1068
|
-
voiceId:
|
|
1093
|
+
voiceId: _,
|
|
1069
1094
|
userId: ((n = this.selfInfo) == null ? void 0 : n.id) || "",
|
|
1070
1095
|
roomId: (c = this.roomInfo) == null ? void 0 : c.info.room_code,
|
|
1071
1096
|
type: V
|
|
@@ -1073,52 +1098,52 @@ class yr extends ue {
|
|
|
1073
1098
|
const k = (d = this._options.initialMicroStatus) != null ? d : Z.OPEN;
|
|
1074
1099
|
await this.toggleMicro(k === Z.OPEN);
|
|
1075
1100
|
} else
|
|
1076
|
-
|
|
1101
|
+
O.error("加入语音房间失败");
|
|
1077
1102
|
break;
|
|
1078
1103
|
}
|
|
1079
1104
|
case K.UserList: {
|
|
1080
|
-
const
|
|
1081
|
-
this._buildInData.userList =
|
|
1105
|
+
const _ = v;
|
|
1106
|
+
this._buildInData.userList = _, this.emit("userListUpdate", this.userList, E);
|
|
1082
1107
|
break;
|
|
1083
1108
|
}
|
|
1084
1109
|
case K.CustomEvent: {
|
|
1085
|
-
const
|
|
1086
|
-
this.emit("broadcast",
|
|
1110
|
+
const _ = v;
|
|
1111
|
+
this.emit("broadcast", _, E);
|
|
1087
1112
|
break;
|
|
1088
1113
|
}
|
|
1089
1114
|
case K.KeyframeSync: {
|
|
1090
|
-
const
|
|
1091
|
-
|
|
1115
|
+
const _ = v, V = Object.keys(
|
|
1116
|
+
_
|
|
1092
1117
|
).reduce(
|
|
1093
|
-
(
|
|
1118
|
+
(C, k) => {
|
|
1094
1119
|
if (ot(
|
|
1095
|
-
|
|
1120
|
+
_[k],
|
|
1096
1121
|
this._buildInData.keyframes[k],
|
|
1097
1122
|
{
|
|
1098
1123
|
deep: !0
|
|
1099
1124
|
}
|
|
1100
1125
|
))
|
|
1101
|
-
return
|
|
1126
|
+
return C;
|
|
1102
1127
|
const U = [
|
|
1103
|
-
|
|
1128
|
+
_[k],
|
|
1104
1129
|
this._buildInData.keyframes[k],
|
|
1105
|
-
|
|
1130
|
+
E
|
|
1106
1131
|
], P = k;
|
|
1107
1132
|
return this.keyframes.emit(
|
|
1108
1133
|
P,
|
|
1109
1134
|
...U
|
|
1110
|
-
), this._buildInData.keyframes[k] =
|
|
1135
|
+
), this._buildInData.keyframes[k] = _[k], C[k] = _[k], C;
|
|
1111
1136
|
},
|
|
1112
1137
|
{}
|
|
1113
1138
|
);
|
|
1114
|
-
this.emit("keyframes", V,
|
|
1139
|
+
this.emit("keyframes", V, E);
|
|
1115
1140
|
break;
|
|
1116
1141
|
}
|
|
1117
1142
|
case K.BuiltinMsg: {
|
|
1118
|
-
const
|
|
1119
|
-
this.emit("builtinEvent",
|
|
1120
|
-
|
|
1121
|
-
),
|
|
1143
|
+
const _ = v;
|
|
1144
|
+
this.emit("builtinEvent", _), _.event_type === q.UserChange && this.emit("userChange", _), _.event_type === q.RoomChange && this.emit("roomChange", _), _.event_type === q.UserChange && _.action === H.UserMicroStatus && await this.toggleMicro(
|
|
1145
|
+
_.data.status === Z.OPEN
|
|
1146
|
+
), _.event_type === q.RoomChange && _.action === H.RoomClose && await this.exit();
|
|
1122
1147
|
break;
|
|
1123
1148
|
}
|
|
1124
1149
|
case K.UserKickOut: {
|
|
@@ -1126,7 +1151,7 @@ class yr extends ue {
|
|
|
1126
1151
|
break;
|
|
1127
1152
|
}
|
|
1128
1153
|
default:
|
|
1129
|
-
console.warn("unknown command: ",
|
|
1154
|
+
console.warn("unknown command: ", g);
|
|
1130
1155
|
}
|
|
1131
1156
|
else
|
|
1132
1157
|
this.emit("error", e);
|
|
@@ -1144,8 +1169,8 @@ class yr extends ue {
|
|
|
1144
1169
|
* @returns
|
|
1145
1170
|
*/
|
|
1146
1171
|
o(this, "connect", async (e = {}) => {
|
|
1147
|
-
var u, d,
|
|
1148
|
-
if (this._options.url = (d = (u = e.url) != null ? u : this._options.url) != null ? d : "", this._options.getTicket = (
|
|
1172
|
+
var u, d, g, v;
|
|
1173
|
+
if (this._options.url = (d = (u = e.url) != null ? u : this._options.url) != null ? d : "", this._options.getTicket = (g = e.getTicket) != null ? g : this._options.getTicket, this._options.initialMicroStatus = (v = e.rtcMicStatus) != null ? v : this._options.initialMicroStatus, !/^ws(s):\/\//.test(this._options.url) || typeof this._options.getTicket != "function")
|
|
1149
1174
|
return /^ws(s):\/\//.test(this._options.url) ? typeof this._options.getTicket != "function" ? new Error("getTicket muse be function") : !1 : new Error("Illegal realsee live room link");
|
|
1150
1175
|
const { force: i = !1 } = e;
|
|
1151
1176
|
if (this._options.rtc && !await this._options.rtc.detectMicro())
|
|
@@ -1155,8 +1180,8 @@ class yr extends ue {
|
|
|
1155
1180
|
if (i)
|
|
1156
1181
|
try {
|
|
1157
1182
|
await this._controller.close("force close by connect");
|
|
1158
|
-
} catch (
|
|
1159
|
-
console.warn(
|
|
1183
|
+
} catch (E) {
|
|
1184
|
+
console.warn(E);
|
|
1160
1185
|
}
|
|
1161
1186
|
else
|
|
1162
1187
|
return new Error("已有Live实例正在连接中,请勿重复连接!");
|
|
@@ -1178,7 +1203,7 @@ class yr extends ue {
|
|
|
1178
1203
|
try {
|
|
1179
1204
|
await ((e = this.$RTC) == null ? void 0 : e.quit());
|
|
1180
1205
|
} catch (i) {
|
|
1181
|
-
|
|
1206
|
+
O.warn(i);
|
|
1182
1207
|
}
|
|
1183
1208
|
return await this._controller.close();
|
|
1184
1209
|
});
|
|
@@ -1193,7 +1218,7 @@ class yr extends ue {
|
|
|
1193
1218
|
if ((i = (e = this.selfInfo) == null ? void 0 : e.permission) != null && i.close_live_room)
|
|
1194
1219
|
return await this.updateStatus(
|
|
1195
1220
|
q.RoomChange,
|
|
1196
|
-
|
|
1221
|
+
H.RoomClose,
|
|
1197
1222
|
{}
|
|
1198
1223
|
);
|
|
1199
1224
|
});
|
|
@@ -1209,7 +1234,7 @@ class yr extends ue {
|
|
|
1209
1234
|
*/
|
|
1210
1235
|
o(this, "setSelfInfo", async (e) => await this.updateStatus(
|
|
1211
1236
|
q.UserChange,
|
|
1212
|
-
|
|
1237
|
+
H.UserInfo,
|
|
1213
1238
|
e
|
|
1214
1239
|
));
|
|
1215
1240
|
// 仅用于用户自己的麦克风控制
|
|
@@ -1220,7 +1245,7 @@ class yr extends ue {
|
|
|
1220
1245
|
const i = await ((u = this.$RTC) == null ? void 0 : u.toggleMicro(e));
|
|
1221
1246
|
return i && await this.updateStatus(
|
|
1222
1247
|
q.UserChange,
|
|
1223
|
-
|
|
1248
|
+
H.UserMicroStatus,
|
|
1224
1249
|
{
|
|
1225
1250
|
status: e ? Z.OPEN : Z.CLOSE
|
|
1226
1251
|
},
|
|
@@ -1237,7 +1262,7 @@ class yr extends ue {
|
|
|
1237
1262
|
var n, c;
|
|
1238
1263
|
return typeof this._options.canForbidUserMicro == "function" && !this._options.canForbidUserMicro(i) || !((c = (n = this.selfInfo) == null ? void 0 : n.permission) != null && c.control_other_micro) ? !1 : await this.updateStatus(
|
|
1239
1264
|
q.UserChange,
|
|
1240
|
-
|
|
1265
|
+
H.UserMicroStatus,
|
|
1241
1266
|
{
|
|
1242
1267
|
status: e
|
|
1243
1268
|
},
|
|
@@ -1254,7 +1279,7 @@ class yr extends ue {
|
|
|
1254
1279
|
var n, c;
|
|
1255
1280
|
return typeof this._options.canForbidUserSync == "function" && !this._options.canForbidUserSync(i) || !((c = (n = this.selfInfo) == null ? void 0 : n.permission) != null && c.control_other_sync) ? !1 : await this.updateStatus(
|
|
1256
1281
|
q.UserChange,
|
|
1257
|
-
|
|
1282
|
+
H.UserPermission,
|
|
1258
1283
|
{ sync_frame: e },
|
|
1259
1284
|
i
|
|
1260
1285
|
);
|
|
@@ -1268,7 +1293,7 @@ class yr extends ue {
|
|
|
1268
1293
|
var i, n;
|
|
1269
1294
|
return typeof this._options.canForbidUserKick == "function" && !this._options.canForbidUserKick(e) || !((n = (i = this.selfInfo) == null ? void 0 : i.permission) != null && n.change_other_status) ? !1 : await this.updateStatus(
|
|
1270
1295
|
q.UserChange,
|
|
1271
|
-
|
|
1296
|
+
H.UserStatus,
|
|
1272
1297
|
{
|
|
1273
1298
|
status: "KICK_OUT"
|
|
1274
1299
|
},
|
|
@@ -1287,7 +1312,7 @@ class yr extends ue {
|
|
|
1287
1312
|
if (e.rtc)
|
|
1288
1313
|
return e.rtc;
|
|
1289
1314
|
if (e.rtcType)
|
|
1290
|
-
switch (e.getVoiceSign ||
|
|
1315
|
+
switch (e.getVoiceSign || O.error(
|
|
1291
1316
|
"GetVoiceSign method must be passed when using built-in RTC instances"
|
|
1292
1317
|
), e.rtcType) {
|
|
1293
1318
|
case Q.RealseeVRWebViewRTC: {
|
|
@@ -1296,7 +1321,7 @@ class yr extends ue {
|
|
|
1296
1321
|
jsBridge: this._options.jsBridge,
|
|
1297
1322
|
getVoiceSign: this._options.getVoiceSign
|
|
1298
1323
|
});
|
|
1299
|
-
|
|
1324
|
+
O.error(
|
|
1300
1325
|
"JsBridge instance must be passed when using built-in VRWebViewRTC instances"
|
|
1301
1326
|
);
|
|
1302
1327
|
return;
|
|
@@ -1307,19 +1332,19 @@ class yr extends ue {
|
|
|
1307
1332
|
logLevel: e.__debug__ ? st.DEBUG : st.INFO
|
|
1308
1333
|
});
|
|
1309
1334
|
case Q.RealseeBrowserRTC:
|
|
1310
|
-
return this._options.autoPlayConfirm ||
|
|
1335
|
+
return this._options.autoPlayConfirm || O.error(
|
|
1311
1336
|
"autoPlayConfirm method must be passed when using built-in RealseeBrowserRTC instances"
|
|
1312
1337
|
), new rt({
|
|
1313
1338
|
getVoiceSign: this._options.getVoiceSign,
|
|
1314
1339
|
autoPlayConfirm: this._options.autoPlayConfirm
|
|
1315
1340
|
});
|
|
1316
1341
|
default: {
|
|
1317
|
-
|
|
1342
|
+
O.error("unknown built-in RTC type");
|
|
1318
1343
|
return;
|
|
1319
1344
|
}
|
|
1320
1345
|
}
|
|
1321
1346
|
if (e.useBuiltInRTC) {
|
|
1322
|
-
if (e.getVoiceSign ||
|
|
1347
|
+
if (e.getVoiceSign || O.error(
|
|
1323
1348
|
"GetVoiceSign method must be passed when using built-in RTC instances"
|
|
1324
1349
|
), this._options.jsBridge)
|
|
1325
1350
|
return lr && (ar || cr) || ur ? new nt({
|
|
@@ -1331,12 +1356,12 @@ class yr extends ue {
|
|
|
1331
1356
|
getVoiceSign: this._options.getVoiceSign,
|
|
1332
1357
|
autoPlayConfirm: this._options.autoPlayConfirm
|
|
1333
1358
|
});
|
|
1334
|
-
|
|
1359
|
+
O.error(
|
|
1335
1360
|
"jsBridge instance must be passed when using built-in RTC instances"
|
|
1336
1361
|
);
|
|
1337
1362
|
return;
|
|
1338
1363
|
}
|
|
1339
|
-
})(), this._options.rtc ||
|
|
1364
|
+
})(), this._options.rtc || O.warn("unused rtc"), this._options.url && this._options.getTicket && this.connect(), this._options.__debug__ && Object.assign(window, { $liveController: this._controller, $live: this });
|
|
1340
1365
|
}
|
|
1341
1366
|
get options() {
|
|
1342
1367
|
return Object.freeze(this._options || {});
|
|
@@ -1414,8 +1439,8 @@ class yr extends ue {
|
|
|
1414
1439
|
), d = je(K.BuiltinMsg, u, c);
|
|
1415
1440
|
try {
|
|
1416
1441
|
return this._controller.sendMessage(d), !0;
|
|
1417
|
-
} catch (
|
|
1418
|
-
return
|
|
1442
|
+
} catch (g) {
|
|
1443
|
+
return O.error(g), !1;
|
|
1419
1444
|
}
|
|
1420
1445
|
}
|
|
1421
1446
|
/**
|
|
@@ -1431,16 +1456,16 @@ class yr extends ue {
|
|
|
1431
1456
|
K.CustomEvent,
|
|
1432
1457
|
e,
|
|
1433
1458
|
i
|
|
1434
|
-
),
|
|
1435
|
-
u(new Error("RESPONSE TIMEOUT")), this.off("broadcast",
|
|
1436
|
-
}, n) : void 0,
|
|
1437
|
-
I ===
|
|
1459
|
+
), g = d.front_request_id, v = n ? setTimeout(() => {
|
|
1460
|
+
u(new Error("RESPONSE TIMEOUT")), this.off("broadcast", E);
|
|
1461
|
+
}, n) : void 0, E = (y, I) => {
|
|
1462
|
+
I === g && (v && clearTimeout(v), this.off("broadcast", E), c(y));
|
|
1438
1463
|
};
|
|
1439
|
-
this.on("broadcast",
|
|
1464
|
+
this.on("broadcast", E);
|
|
1440
1465
|
try {
|
|
1441
1466
|
this._controller.sendMessage(d);
|
|
1442
|
-
} catch (
|
|
1443
|
-
u(
|
|
1467
|
+
} catch (y) {
|
|
1468
|
+
u(y);
|
|
1444
1469
|
}
|
|
1445
1470
|
});
|
|
1446
1471
|
}
|
|
@@ -1469,15 +1494,15 @@ function Cr() {
|
|
|
1469
1494
|
return oe;
|
|
1470
1495
|
at = 1;
|
|
1471
1496
|
var r = D, s = Symbol.for("react.element"), e = Symbol.for("react.fragment"), i = Object.prototype.hasOwnProperty, n = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, c = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
1472
|
-
function u(d,
|
|
1473
|
-
var
|
|
1474
|
-
|
|
1475
|
-
for (
|
|
1476
|
-
i.call(
|
|
1497
|
+
function u(d, g, v) {
|
|
1498
|
+
var E, y = {}, I = null, _ = null;
|
|
1499
|
+
v !== void 0 && (I = "" + v), g.key !== void 0 && (I = "" + g.key), g.ref !== void 0 && (_ = g.ref);
|
|
1500
|
+
for (E in g)
|
|
1501
|
+
i.call(g, E) && !c.hasOwnProperty(E) && (y[E] = g[E]);
|
|
1477
1502
|
if (d && d.defaultProps)
|
|
1478
|
-
for (
|
|
1479
|
-
|
|
1480
|
-
return { $$typeof: s, type: d, key: I, ref:
|
|
1503
|
+
for (E in g = d.defaultProps, g)
|
|
1504
|
+
y[E] === void 0 && (y[E] = g[E]);
|
|
1505
|
+
return { $$typeof: s, type: d, key: I, ref: _, props: y, _owner: n.current };
|
|
1481
1506
|
}
|
|
1482
1507
|
return oe.Fragment = e, oe.jsx = u, oe.jsxs = u, oe;
|
|
1483
1508
|
}
|
|
@@ -1494,11 +1519,11 @@ var ae = {};
|
|
|
1494
1519
|
var ct;
|
|
1495
1520
|
function wr() {
|
|
1496
1521
|
return ct || (ct = 1, process.env.NODE_ENV !== "production" && function() {
|
|
1497
|
-
var r = D, s = Symbol.for("react.element"), e = Symbol.for("react.portal"), i = Symbol.for("react.fragment"), n = Symbol.for("react.strict_mode"), c = Symbol.for("react.profiler"), u = Symbol.for("react.provider"), d = Symbol.for("react.context"),
|
|
1522
|
+
var r = D, s = Symbol.for("react.element"), e = Symbol.for("react.portal"), i = Symbol.for("react.fragment"), n = Symbol.for("react.strict_mode"), c = Symbol.for("react.profiler"), u = Symbol.for("react.provider"), d = Symbol.for("react.context"), g = Symbol.for("react.forward_ref"), v = Symbol.for("react.suspense"), E = Symbol.for("react.suspense_list"), y = Symbol.for("react.memo"), I = Symbol.for("react.lazy"), _ = Symbol.for("react.offscreen"), V = Symbol.iterator, C = "@@iterator";
|
|
1498
1523
|
function k(t) {
|
|
1499
1524
|
if (t === null || typeof t != "object")
|
|
1500
1525
|
return null;
|
|
1501
|
-
var a = V && t[V] || t[
|
|
1526
|
+
var a = V && t[V] || t[C];
|
|
1502
1527
|
return typeof a == "function" ? a : null;
|
|
1503
1528
|
}
|
|
1504
1529
|
var U = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
@@ -1511,18 +1536,18 @@ function wr() {
|
|
|
1511
1536
|
}
|
|
1512
1537
|
function fe(t, a, l) {
|
|
1513
1538
|
{
|
|
1514
|
-
var h = U.ReactDebugCurrentFrame,
|
|
1515
|
-
|
|
1516
|
-
var
|
|
1517
|
-
return String(
|
|
1539
|
+
var h = U.ReactDebugCurrentFrame, b = h.getStackAddendum();
|
|
1540
|
+
b !== "" && (a += "%s", l = l.concat([b]));
|
|
1541
|
+
var R = l.map(function(p) {
|
|
1542
|
+
return String(p);
|
|
1518
1543
|
});
|
|
1519
|
-
|
|
1544
|
+
R.unshift("Warning: " + a), Function.prototype.apply.call(console[t], console, R);
|
|
1520
1545
|
}
|
|
1521
1546
|
}
|
|
1522
|
-
var f = !1,
|
|
1547
|
+
var f = !1, w = !1, A = !1, S = !1, N = !1, M;
|
|
1523
1548
|
M = Symbol.for("react.module.reference");
|
|
1524
1549
|
function F(t) {
|
|
1525
|
-
return !!(typeof t == "string" || typeof t == "function" || t === i || t === c || N || t === n || t ===
|
|
1550
|
+
return !!(typeof t == "string" || typeof t == "function" || t === i || t === c || N || t === n || t === v || t === E || S || t === _ || f || w || A || typeof t == "object" && t !== null && (t.$$typeof === I || t.$$typeof === y || t.$$typeof === u || t.$$typeof === d || t.$$typeof === g || // This needs to include all possible module reference object
|
|
1526
1551
|
// types supported by any Flight configuration anywhere since
|
|
1527
1552
|
// we don't know which Flight build this will end up being used
|
|
1528
1553
|
// with.
|
|
@@ -1532,8 +1557,8 @@ function wr() {
|
|
|
1532
1557
|
var h = t.displayName;
|
|
1533
1558
|
if (h)
|
|
1534
1559
|
return h;
|
|
1535
|
-
var
|
|
1536
|
-
return
|
|
1560
|
+
var b = a.displayName || a.name || "";
|
|
1561
|
+
return b !== "" ? l + "(" + b + ")" : l;
|
|
1537
1562
|
}
|
|
1538
1563
|
function ne(t) {
|
|
1539
1564
|
return t.displayName || "Context";
|
|
@@ -1554,9 +1579,9 @@ function wr() {
|
|
|
1554
1579
|
return "Profiler";
|
|
1555
1580
|
case n:
|
|
1556
1581
|
return "StrictMode";
|
|
1557
|
-
case
|
|
1582
|
+
case v:
|
|
1558
1583
|
return "Suspense";
|
|
1559
|
-
case
|
|
1584
|
+
case E:
|
|
1560
1585
|
return "SuspenseList";
|
|
1561
1586
|
}
|
|
1562
1587
|
if (typeof t == "object")
|
|
@@ -1567,30 +1592,30 @@ function wr() {
|
|
|
1567
1592
|
case u:
|
|
1568
1593
|
var l = t;
|
|
1569
1594
|
return ne(l._context) + ".Provider";
|
|
1570
|
-
case
|
|
1595
|
+
case g:
|
|
1571
1596
|
return J(t, t.render, "ForwardRef");
|
|
1572
|
-
case
|
|
1597
|
+
case y:
|
|
1573
1598
|
var h = t.displayName || null;
|
|
1574
1599
|
return h !== null ? h : G(t.type) || "Memo";
|
|
1575
1600
|
case I: {
|
|
1576
|
-
var
|
|
1601
|
+
var b = t, R = b._payload, p = b._init;
|
|
1577
1602
|
try {
|
|
1578
|
-
return G(
|
|
1579
|
-
} catch (
|
|
1603
|
+
return G(p(R));
|
|
1604
|
+
} catch (m) {
|
|
1580
1605
|
return null;
|
|
1581
1606
|
}
|
|
1582
1607
|
}
|
|
1583
1608
|
}
|
|
1584
1609
|
return null;
|
|
1585
1610
|
}
|
|
1586
|
-
var z = Object.assign, ee = 0, T,
|
|
1611
|
+
var z = Object.assign, ee = 0, T, B, te, de, Ve, $e, xe;
|
|
1587
1612
|
function Ue() {
|
|
1588
1613
|
}
|
|
1589
1614
|
Ue.__reactDisabledLog = !0;
|
|
1590
1615
|
function dt() {
|
|
1591
1616
|
{
|
|
1592
1617
|
if (ee === 0) {
|
|
1593
|
-
T = console.log,
|
|
1618
|
+
T = console.log, B = console.info, te = console.warn, de = console.error, Ve = console.group, $e = console.groupCollapsed, xe = console.groupEnd;
|
|
1594
1619
|
var t = {
|
|
1595
1620
|
configurable: !0,
|
|
1596
1621
|
enumerable: !0,
|
|
@@ -1623,7 +1648,7 @@ function wr() {
|
|
|
1623
1648
|
value: T
|
|
1624
1649
|
}),
|
|
1625
1650
|
info: z({}, t, {
|
|
1626
|
-
value:
|
|
1651
|
+
value: B
|
|
1627
1652
|
}),
|
|
1628
1653
|
warn: z({}, t, {
|
|
1629
1654
|
value: te
|
|
@@ -1651,8 +1676,8 @@ function wr() {
|
|
|
1651
1676
|
if (we === void 0)
|
|
1652
1677
|
try {
|
|
1653
1678
|
throw Error();
|
|
1654
|
-
} catch (
|
|
1655
|
-
var h =
|
|
1679
|
+
} catch (b) {
|
|
1680
|
+
var h = b.stack.trim().match(/\n( *(at )?)/);
|
|
1656
1681
|
we = h && h[1] || "";
|
|
1657
1682
|
}
|
|
1658
1683
|
return `
|
|
@@ -1674,63 +1699,63 @@ function wr() {
|
|
|
1674
1699
|
}
|
|
1675
1700
|
var h;
|
|
1676
1701
|
Re = !0;
|
|
1677
|
-
var
|
|
1702
|
+
var b = Error.prepareStackTrace;
|
|
1678
1703
|
Error.prepareStackTrace = void 0;
|
|
1679
|
-
var
|
|
1680
|
-
|
|
1704
|
+
var R;
|
|
1705
|
+
R = Ce.current, Ce.current = null, dt();
|
|
1681
1706
|
try {
|
|
1682
1707
|
if (a) {
|
|
1683
|
-
var
|
|
1708
|
+
var p = function() {
|
|
1684
1709
|
throw Error();
|
|
1685
1710
|
};
|
|
1686
|
-
if (Object.defineProperty(
|
|
1711
|
+
if (Object.defineProperty(p.prototype, "props", {
|
|
1687
1712
|
set: function() {
|
|
1688
1713
|
throw Error();
|
|
1689
1714
|
}
|
|
1690
1715
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
1691
1716
|
try {
|
|
1692
|
-
Reflect.construct(
|
|
1693
|
-
} catch (
|
|
1694
|
-
h =
|
|
1717
|
+
Reflect.construct(p, []);
|
|
1718
|
+
} catch (Y) {
|
|
1719
|
+
h = Y;
|
|
1695
1720
|
}
|
|
1696
|
-
Reflect.construct(t, [],
|
|
1721
|
+
Reflect.construct(t, [], p);
|
|
1697
1722
|
} else {
|
|
1698
1723
|
try {
|
|
1699
|
-
|
|
1700
|
-
} catch (
|
|
1701
|
-
h =
|
|
1724
|
+
p.call();
|
|
1725
|
+
} catch (Y) {
|
|
1726
|
+
h = Y;
|
|
1702
1727
|
}
|
|
1703
|
-
t.call(
|
|
1728
|
+
t.call(p.prototype);
|
|
1704
1729
|
}
|
|
1705
1730
|
} else {
|
|
1706
1731
|
try {
|
|
1707
1732
|
throw Error();
|
|
1708
|
-
} catch (
|
|
1709
|
-
h =
|
|
1733
|
+
} catch (Y) {
|
|
1734
|
+
h = Y;
|
|
1710
1735
|
}
|
|
1711
1736
|
t();
|
|
1712
1737
|
}
|
|
1713
|
-
} catch (
|
|
1714
|
-
if (
|
|
1715
|
-
for (var
|
|
1738
|
+
} catch (Y) {
|
|
1739
|
+
if (Y && h && typeof Y.stack == "string") {
|
|
1740
|
+
for (var m = Y.stack.split(`
|
|
1716
1741
|
`), $ = h.stack.split(`
|
|
1717
|
-
`), j =
|
|
1742
|
+
`), j = m.length - 1, L = $.length - 1; j >= 1 && L >= 0 && m[j] !== $[L]; )
|
|
1718
1743
|
L--;
|
|
1719
1744
|
for (; j >= 1 && L >= 0; j--, L--)
|
|
1720
|
-
if (
|
|
1745
|
+
if (m[j] !== $[L]) {
|
|
1721
1746
|
if (j !== 1 || L !== 1)
|
|
1722
1747
|
do
|
|
1723
|
-
if (j--, L--, L < 0 ||
|
|
1724
|
-
var
|
|
1725
|
-
` +
|
|
1726
|
-
return t.displayName &&
|
|
1748
|
+
if (j--, L--, L < 0 || m[j] !== $[L]) {
|
|
1749
|
+
var W = `
|
|
1750
|
+
` + m[j].replace(" at new ", " at ");
|
|
1751
|
+
return t.displayName && W.includes("<anonymous>") && (W = W.replace("<anonymous>", t.displayName)), typeof t == "function" && _e.set(t, W), W;
|
|
1727
1752
|
}
|
|
1728
1753
|
while (j >= 1 && L >= 0);
|
|
1729
1754
|
break;
|
|
1730
1755
|
}
|
|
1731
1756
|
}
|
|
1732
1757
|
} finally {
|
|
1733
|
-
Re = !1, Ce.current =
|
|
1758
|
+
Re = !1, Ce.current = R, ht(), Error.prepareStackTrace = b;
|
|
1734
1759
|
}
|
|
1735
1760
|
var ie = t ? t.displayName || t.name : "", et = ie ? he(ie) : "";
|
|
1736
1761
|
return typeof t == "function" && _e.set(t, et), et;
|
|
@@ -1750,51 +1775,51 @@ function wr() {
|
|
|
1750
1775
|
if (typeof t == "string")
|
|
1751
1776
|
return he(t);
|
|
1752
1777
|
switch (t) {
|
|
1753
|
-
case
|
|
1778
|
+
case v:
|
|
1754
1779
|
return he("Suspense");
|
|
1755
|
-
case
|
|
1780
|
+
case E:
|
|
1756
1781
|
return he("SuspenseList");
|
|
1757
1782
|
}
|
|
1758
1783
|
if (typeof t == "object")
|
|
1759
1784
|
switch (t.$$typeof) {
|
|
1760
|
-
case
|
|
1785
|
+
case g:
|
|
1761
1786
|
return gt(t.render);
|
|
1762
|
-
case
|
|
1787
|
+
case y:
|
|
1763
1788
|
return ge(t.type, a, l);
|
|
1764
1789
|
case I: {
|
|
1765
|
-
var h = t,
|
|
1790
|
+
var h = t, b = h._payload, R = h._init;
|
|
1766
1791
|
try {
|
|
1767
|
-
return ge(
|
|
1768
|
-
} catch (
|
|
1792
|
+
return ge(R(b), a, l);
|
|
1793
|
+
} catch (p) {
|
|
1769
1794
|
}
|
|
1770
1795
|
}
|
|
1771
1796
|
}
|
|
1772
1797
|
return "";
|
|
1773
1798
|
}
|
|
1774
|
-
var me = Object.prototype.hasOwnProperty,
|
|
1799
|
+
var me = Object.prototype.hasOwnProperty, Be = {}, We = U.ReactDebugCurrentFrame;
|
|
1775
1800
|
function ve(t) {
|
|
1776
1801
|
if (t) {
|
|
1777
1802
|
var a = t._owner, l = ge(t.type, t._source, a ? a.type : null);
|
|
1778
|
-
|
|
1803
|
+
We.setExtraStackFrame(l);
|
|
1779
1804
|
} else
|
|
1780
|
-
|
|
1805
|
+
We.setExtraStackFrame(null);
|
|
1781
1806
|
}
|
|
1782
|
-
function vt(t, a, l, h,
|
|
1807
|
+
function vt(t, a, l, h, b) {
|
|
1783
1808
|
{
|
|
1784
|
-
var
|
|
1785
|
-
for (var
|
|
1786
|
-
if (
|
|
1787
|
-
var
|
|
1809
|
+
var R = Function.call.bind(me);
|
|
1810
|
+
for (var p in t)
|
|
1811
|
+
if (R(t, p)) {
|
|
1812
|
+
var m = void 0;
|
|
1788
1813
|
try {
|
|
1789
|
-
if (typeof t[
|
|
1790
|
-
var $ = Error((h || "React class") + ": " + l + " type `" +
|
|
1814
|
+
if (typeof t[p] != "function") {
|
|
1815
|
+
var $ = Error((h || "React class") + ": " + l + " type `" + p + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof t[p] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
1791
1816
|
throw $.name = "Invariant Violation", $;
|
|
1792
1817
|
}
|
|
1793
|
-
|
|
1818
|
+
m = t[p](a, p, h, l, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
1794
1819
|
} catch (j) {
|
|
1795
|
-
|
|
1820
|
+
m = j;
|
|
1796
1821
|
}
|
|
1797
|
-
|
|
1822
|
+
m && !(m instanceof Error) && (ve(b), P("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", h || "React class", l, p, typeof m), ve(null)), m instanceof Error && !(m.message in Be) && (Be[m.message] = !0, ve(b), P("Failed %s type: %s", l, m.message), ve(null));
|
|
1798
1823
|
}
|
|
1799
1824
|
}
|
|
1800
1825
|
}
|
|
@@ -1827,7 +1852,7 @@ function wr() {
|
|
|
1827
1852
|
ref: !0,
|
|
1828
1853
|
__self: !0,
|
|
1829
1854
|
__source: !0
|
|
1830
|
-
}, Ge,
|
|
1855
|
+
}, Ge, Ye, Ie;
|
|
1831
1856
|
Ie = {};
|
|
1832
1857
|
function St(t) {
|
|
1833
1858
|
if (me.call(t, "ref")) {
|
|
@@ -1865,7 +1890,7 @@ function wr() {
|
|
|
1865
1890
|
function Ot(t, a) {
|
|
1866
1891
|
{
|
|
1867
1892
|
var l = function() {
|
|
1868
|
-
|
|
1893
|
+
Ye || (Ye = !0, P("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", a));
|
|
1869
1894
|
};
|
|
1870
1895
|
l.isReactWarning = !0, Object.defineProperty(t, "ref", {
|
|
1871
1896
|
get: l,
|
|
@@ -1873,60 +1898,60 @@ function wr() {
|
|
|
1873
1898
|
});
|
|
1874
1899
|
}
|
|
1875
1900
|
}
|
|
1876
|
-
var It = function(t, a, l, h,
|
|
1877
|
-
var
|
|
1901
|
+
var It = function(t, a, l, h, b, R, p) {
|
|
1902
|
+
var m = {
|
|
1878
1903
|
// This tag allows us to uniquely identify this as a React Element
|
|
1879
1904
|
$$typeof: s,
|
|
1880
1905
|
// Built-in properties that belong on the element
|
|
1881
1906
|
type: t,
|
|
1882
1907
|
key: a,
|
|
1883
1908
|
ref: l,
|
|
1884
|
-
props:
|
|
1909
|
+
props: p,
|
|
1885
1910
|
// Record the component responsible for creating this element.
|
|
1886
|
-
_owner:
|
|
1911
|
+
_owner: R
|
|
1887
1912
|
};
|
|
1888
|
-
return
|
|
1913
|
+
return m._store = {}, Object.defineProperty(m._store, "validated", {
|
|
1889
1914
|
configurable: !1,
|
|
1890
1915
|
enumerable: !1,
|
|
1891
1916
|
writable: !0,
|
|
1892
1917
|
value: !1
|
|
1893
|
-
}), Object.defineProperty(
|
|
1918
|
+
}), Object.defineProperty(m, "_self", {
|
|
1894
1919
|
configurable: !1,
|
|
1895
1920
|
enumerable: !1,
|
|
1896
1921
|
writable: !1,
|
|
1897
1922
|
value: h
|
|
1898
|
-
}), Object.defineProperty(
|
|
1923
|
+
}), Object.defineProperty(m, "_source", {
|
|
1899
1924
|
configurable: !1,
|
|
1900
1925
|
enumerable: !1,
|
|
1901
1926
|
writable: !1,
|
|
1902
|
-
value:
|
|
1903
|
-
}), Object.freeze && (Object.freeze(
|
|
1927
|
+
value: b
|
|
1928
|
+
}), Object.freeze && (Object.freeze(m.props), Object.freeze(m)), m;
|
|
1904
1929
|
};
|
|
1905
|
-
function Tt(t, a, l, h,
|
|
1930
|
+
function Tt(t, a, l, h, b) {
|
|
1906
1931
|
{
|
|
1907
|
-
var
|
|
1908
|
-
l !== void 0 && (qe(l),
|
|
1909
|
-
for (
|
|
1910
|
-
me.call(a,
|
|
1932
|
+
var R, p = {}, m = null, $ = null;
|
|
1933
|
+
l !== void 0 && (qe(l), m = "" + l), Ct(a) && (qe(a.key), m = "" + a.key), St(a) && ($ = a.ref, wt(a, b));
|
|
1934
|
+
for (R in a)
|
|
1935
|
+
me.call(a, R) && !bt.hasOwnProperty(R) && (p[R] = a[R]);
|
|
1911
1936
|
if (t && t.defaultProps) {
|
|
1912
1937
|
var j = t.defaultProps;
|
|
1913
|
-
for (
|
|
1914
|
-
|
|
1938
|
+
for (R in j)
|
|
1939
|
+
p[R] === void 0 && (p[R] = j[R]);
|
|
1915
1940
|
}
|
|
1916
|
-
if (
|
|
1941
|
+
if (m || $) {
|
|
1917
1942
|
var L = typeof t == "function" ? t.displayName || t.name || "Unknown" : t;
|
|
1918
|
-
|
|
1943
|
+
m && Rt(p, L), $ && Ot(p, L);
|
|
1919
1944
|
}
|
|
1920
|
-
return It(t,
|
|
1945
|
+
return It(t, m, $, b, h, se.current, p);
|
|
1921
1946
|
}
|
|
1922
1947
|
}
|
|
1923
|
-
var Te = U.ReactCurrentOwner,
|
|
1948
|
+
var Te = U.ReactCurrentOwner, He = U.ReactDebugCurrentFrame;
|
|
1924
1949
|
function re(t) {
|
|
1925
1950
|
if (t) {
|
|
1926
1951
|
var a = t._owner, l = ge(t.type, t._source, a ? a.type : null);
|
|
1927
|
-
|
|
1952
|
+
He.setExtraStackFrame(l);
|
|
1928
1953
|
} else
|
|
1929
|
-
|
|
1954
|
+
He.setExtraStackFrame(null);
|
|
1930
1955
|
}
|
|
1931
1956
|
var ke;
|
|
1932
1957
|
ke = !1;
|
|
@@ -1994,10 +2019,10 @@ Check the top-level render call using <` + l + ">.");
|
|
|
1994
2019
|
else if (Pe(t))
|
|
1995
2020
|
t._store && (t._store.validated = !0);
|
|
1996
2021
|
else if (t) {
|
|
1997
|
-
var
|
|
1998
|
-
if (typeof
|
|
1999
|
-
for (var
|
|
2000
|
-
Pe(
|
|
2022
|
+
var b = k(t);
|
|
2023
|
+
if (typeof b == "function" && b !== t.entries)
|
|
2024
|
+
for (var R = b.call(t), p; !(p = R.next()).done; )
|
|
2025
|
+
Pe(p.value) && Xe(p.value, a);
|
|
2001
2026
|
}
|
|
2002
2027
|
}
|
|
2003
2028
|
}
|
|
@@ -2009,9 +2034,9 @@ Check the top-level render call using <` + l + ">.");
|
|
|
2009
2034
|
var l;
|
|
2010
2035
|
if (typeof a == "function")
|
|
2011
2036
|
l = a.propTypes;
|
|
2012
|
-
else if (typeof a == "object" && (a.$$typeof ===
|
|
2037
|
+
else if (typeof a == "object" && (a.$$typeof === g || // Note: Memo only checks outer props here.
|
|
2013
2038
|
// Inner props are checked in the reconciler.
|
|
2014
|
-
a.$$typeof ===
|
|
2039
|
+
a.$$typeof === y))
|
|
2015
2040
|
l = a.propTypes;
|
|
2016
2041
|
else
|
|
2017
2042
|
return;
|
|
@@ -2020,8 +2045,8 @@ Check the top-level render call using <` + l + ">.");
|
|
|
2020
2045
|
vt(l, t.props, "prop", h, t);
|
|
2021
2046
|
} else if (a.PropTypes !== void 0 && !ke) {
|
|
2022
2047
|
ke = !0;
|
|
2023
|
-
var
|
|
2024
|
-
P("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",
|
|
2048
|
+
var b = G(a);
|
|
2049
|
+
P("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", b || "Unknown");
|
|
2025
2050
|
}
|
|
2026
2051
|
typeof a.getDefaultProps == "function" && !a.getDefaultProps.isReactClassApproved && P("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
2027
2052
|
}
|
|
@@ -2038,32 +2063,32 @@ Check the top-level render call using <` + l + ">.");
|
|
|
2038
2063
|
t.ref !== null && (re(t), P("Invalid attribute `ref` supplied to `React.Fragment`."), re(null));
|
|
2039
2064
|
}
|
|
2040
2065
|
}
|
|
2041
|
-
function Qe(t, a, l, h,
|
|
2066
|
+
function Qe(t, a, l, h, b, R) {
|
|
2042
2067
|
{
|
|
2043
|
-
var
|
|
2044
|
-
if (!
|
|
2045
|
-
var
|
|
2046
|
-
(t === void 0 || typeof t == "object" && t !== null && Object.keys(t).length === 0) && (
|
|
2047
|
-
var $ = kt(
|
|
2048
|
-
$ ?
|
|
2068
|
+
var p = F(t);
|
|
2069
|
+
if (!p) {
|
|
2070
|
+
var m = "";
|
|
2071
|
+
(t === void 0 || typeof t == "object" && t !== null && Object.keys(t).length === 0) && (m += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
2072
|
+
var $ = kt(b);
|
|
2073
|
+
$ ? m += $ : m += Je();
|
|
2049
2074
|
var j;
|
|
2050
|
-
t === null ? j = "null" : Oe(t) ? j = "array" : t !== void 0 && t.$$typeof === s ? (j = "<" + (G(t.type) || "Unknown") + " />",
|
|
2075
|
+
t === null ? j = "null" : Oe(t) ? j = "array" : t !== void 0 && t.$$typeof === s ? (j = "<" + (G(t.type) || "Unknown") + " />", m = " Did you accidentally export a JSX literal instead of a component?") : j = typeof t, P("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", j, m);
|
|
2051
2076
|
}
|
|
2052
|
-
var L = Tt(t, a, l,
|
|
2077
|
+
var L = Tt(t, a, l, b, R);
|
|
2053
2078
|
if (L == null)
|
|
2054
2079
|
return L;
|
|
2055
|
-
if (
|
|
2056
|
-
var
|
|
2057
|
-
if (
|
|
2080
|
+
if (p) {
|
|
2081
|
+
var W = a.children;
|
|
2082
|
+
if (W !== void 0)
|
|
2058
2083
|
if (h)
|
|
2059
|
-
if (Oe(
|
|
2060
|
-
for (var ie = 0; ie <
|
|
2061
|
-
Ze(
|
|
2062
|
-
Object.freeze && Object.freeze(
|
|
2084
|
+
if (Oe(W)) {
|
|
2085
|
+
for (var ie = 0; ie < W.length; ie++)
|
|
2086
|
+
Ze(W[ie], t);
|
|
2087
|
+
Object.freeze && Object.freeze(W);
|
|
2063
2088
|
} else
|
|
2064
2089
|
P("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
2065
2090
|
else
|
|
2066
|
-
Ze(
|
|
2091
|
+
Ze(W, t);
|
|
2067
2092
|
}
|
|
2068
2093
|
return t === i ? jt(L) : Nt(L), L;
|
|
2069
2094
|
}
|
|
@@ -2088,51 +2113,51 @@ function jr(r) {
|
|
|
2088
2113
|
if (!f)
|
|
2089
2114
|
throw new Error("LiveProvider never found.");
|
|
2090
2115
|
return f;
|
|
2091
|
-
}, u = () => e, d = () => e.$RTC,
|
|
2092
|
-
function
|
|
2093
|
-
const
|
|
2094
|
-
return D.useEffect(() => (
|
|
2116
|
+
}, u = () => e, d = () => e.$RTC, g = () => d(), v = () => async (f) => await e.connect(f);
|
|
2117
|
+
function E(f, w, A = []) {
|
|
2118
|
+
const S = c(), N = [S, name, ...A], M = () => S.keyframes.off(f, w);
|
|
2119
|
+
return D.useEffect(() => (S.keyframes.on(f, w), M), N), M;
|
|
2095
2120
|
}
|
|
2096
|
-
function
|
|
2121
|
+
function y() {
|
|
2097
2122
|
const f = c();
|
|
2098
2123
|
return {
|
|
2099
2124
|
connect: async (T) => await f.connect(T),
|
|
2100
|
-
broadcast: async (T,
|
|
2125
|
+
broadcast: async (T, B, te = 0) => await f.broadcast(T, B, te),
|
|
2101
2126
|
exit: async () => await f.exit(),
|
|
2102
2127
|
kick: async (T) => await f.kick(T),
|
|
2103
2128
|
toggleMicro: (T) => f.toggleMicro(T),
|
|
2104
|
-
forbidMicro: async (T,
|
|
2105
|
-
forbidSync: (T,
|
|
2106
|
-
sendKeyframe: (T,
|
|
2129
|
+
forbidMicro: async (T, B = []) => await f.forbidMicro(T, B),
|
|
2130
|
+
forbidSync: (T, B = []) => f.forbidSync(T, B),
|
|
2131
|
+
sendKeyframe: (T, B) => f.sendKeyframe(T, B),
|
|
2107
2132
|
getFramesByKey: (T) => f.getFramesByKey(T),
|
|
2108
2133
|
setSelfInfo: (T) => f.setSelfInfo(T),
|
|
2109
|
-
updateStatus: (T,
|
|
2134
|
+
updateStatus: (T, B, te, de) => f.updateStatus(T, B, te, de)
|
|
2110
2135
|
};
|
|
2111
2136
|
}
|
|
2112
2137
|
function I(f) {
|
|
2113
|
-
const
|
|
2138
|
+
const w = c(), [A, S] = D.useState(w.getFramesByKey(f));
|
|
2114
2139
|
D.useEffect(() => {
|
|
2115
|
-
const M = (ne) =>
|
|
2116
|
-
return
|
|
2117
|
-
}, [
|
|
2140
|
+
const M = (ne) => S(ne), F = f, J = M;
|
|
2141
|
+
return w.keyframes.on(F, J), () => w.keyframes.off(F, J);
|
|
2142
|
+
}, [w]);
|
|
2118
2143
|
const N = D.useCallback(
|
|
2119
|
-
(M) =>
|
|
2120
|
-
[
|
|
2144
|
+
(M) => w.sendKeyframe(f, M),
|
|
2145
|
+
[w]
|
|
2121
2146
|
);
|
|
2122
2147
|
return [A, N];
|
|
2123
2148
|
}
|
|
2124
|
-
function
|
|
2125
|
-
const
|
|
2126
|
-
return D.useEffect(() => (
|
|
2149
|
+
function _(f, w, A = []) {
|
|
2150
|
+
const S = c(), N = () => S.off(f, w), M = [S, f, ...A];
|
|
2151
|
+
return D.useEffect(() => (S.on(f, w), N), M), N;
|
|
2127
2152
|
}
|
|
2128
2153
|
function V() {
|
|
2129
|
-
const f = c(), [
|
|
2154
|
+
const f = c(), [w, A] = D.useState(f.state);
|
|
2130
2155
|
return D.useEffect(() => {
|
|
2131
|
-
const
|
|
2132
|
-
return f.on("stateChange",
|
|
2133
|
-
}, [f]),
|
|
2156
|
+
const S = (N) => A(N);
|
|
2157
|
+
return f.on("stateChange", S), () => f.off("stateChange", S);
|
|
2158
|
+
}, [f]), w;
|
|
2134
2159
|
}
|
|
2135
|
-
function
|
|
2160
|
+
function C() {
|
|
2136
2161
|
const f = c();
|
|
2137
2162
|
return {
|
|
2138
2163
|
join: (F) => f.$RTC.join(F),
|
|
@@ -2145,47 +2170,47 @@ function jr(r) {
|
|
|
2145
2170
|
detectMicro: () => f.$RTC.detectMicro()
|
|
2146
2171
|
};
|
|
2147
2172
|
}
|
|
2148
|
-
function k(f,
|
|
2149
|
-
const
|
|
2150
|
-
return D.useEffect(() => (
|
|
2173
|
+
function k(f, w, A = []) {
|
|
2174
|
+
const S = c(), N = () => S.$RTC.off(f, w), M = [S, f, ...A];
|
|
2175
|
+
return D.useEffect(() => (S.$RTC.on(f, w), N), M), N;
|
|
2151
2176
|
}
|
|
2152
2177
|
function U() {
|
|
2153
|
-
const f = c(), [
|
|
2178
|
+
const f = c(), [w, A] = D.useState(
|
|
2154
2179
|
f.selfInfo || {}
|
|
2155
|
-
),
|
|
2156
|
-
D.useEffect(() => (f.on("selfInfoUpdate",
|
|
2180
|
+
), S = (M) => A(M);
|
|
2181
|
+
D.useEffect(() => (f.on("selfInfoUpdate", S), () => f.off("selfInfoUpdate", S)), [f]);
|
|
2157
2182
|
const N = D.useCallback(
|
|
2158
2183
|
async (M) => await f.setSelfInfo(M),
|
|
2159
2184
|
[f]
|
|
2160
2185
|
);
|
|
2161
|
-
return [
|
|
2186
|
+
return [w, N];
|
|
2162
2187
|
}
|
|
2163
2188
|
function P() {
|
|
2164
|
-
const f = c(), [
|
|
2189
|
+
const f = c(), [w, A] = D.useState(
|
|
2165
2190
|
f.snapshot
|
|
2166
2191
|
);
|
|
2167
2192
|
return D.useEffect(() => {
|
|
2168
|
-
const
|
|
2169
|
-
return f.on("keyframes",
|
|
2170
|
-
}),
|
|
2193
|
+
const S = (N) => A(N);
|
|
2194
|
+
return f.on("keyframes", S), () => f.off("keyframes", S);
|
|
2195
|
+
}), w;
|
|
2171
2196
|
}
|
|
2172
2197
|
function fe() {
|
|
2173
|
-
const f = c(), [
|
|
2174
|
-
return D.useEffect(() => (f.on("userListUpdate",
|
|
2198
|
+
const f = c(), [w, A] = D.useState(f.userList), S = (N) => A(N);
|
|
2199
|
+
return D.useEffect(() => (f.on("userListUpdate", S), () => f.off("userListUpdate", S)), [f]), w;
|
|
2175
2200
|
}
|
|
2176
2201
|
return {
|
|
2177
2202
|
live: e,
|
|
2178
2203
|
jsBridge: i,
|
|
2179
2204
|
LiveProvider: n,
|
|
2180
2205
|
unsafe__useLiveInstance: u,
|
|
2181
|
-
unsafe__useRTCInstance:
|
|
2182
|
-
useConnect:
|
|
2206
|
+
unsafe__useRTCInstance: g,
|
|
2207
|
+
useConnect: v,
|
|
2183
2208
|
useKeyframe: I,
|
|
2184
|
-
useKeyframeUpdateCallback:
|
|
2185
|
-
useLiveAction:
|
|
2186
|
-
useLiveEventCallback:
|
|
2209
|
+
useKeyframeUpdateCallback: E,
|
|
2210
|
+
useLiveAction: y,
|
|
2211
|
+
useLiveEventCallback: _,
|
|
2187
2212
|
useLiveState: V,
|
|
2188
|
-
useRTCAction:
|
|
2213
|
+
useRTCAction: C,
|
|
2189
2214
|
useRTCEventCallback: k,
|
|
2190
2215
|
useSelfInfo: U,
|
|
2191
2216
|
useKeyframesSnapshot: P,
|
|
@@ -2196,7 +2221,7 @@ export {
|
|
|
2196
2221
|
rt as BrowserRTC,
|
|
2197
2222
|
it as BrowserRTC4Chime,
|
|
2198
2223
|
ut as BuiltInRTCType,
|
|
2199
|
-
|
|
2224
|
+
H as BuiltinActionType,
|
|
2200
2225
|
q as BuiltinEventType,
|
|
2201
2226
|
K as Command,
|
|
2202
2227
|
Me as CoreRTC,
|