@volcengine/vepusher 2.0.4-rc.6 → 2.0.4-rc.7

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.es.js CHANGED
@@ -1,7 +1,7 @@
1
- var wc = Object.defineProperty;
2
- var Tc = (r, e, t) => e in r ? wc(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
- var b = (r, e, t) => Tc(r, typeof e != "symbol" ? e + "" : e, t);
4
- function zc(r, e) {
1
+ var Tc = Object.defineProperty;
2
+ var zc = (r, e, t) => e in r ? Tc(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
+ var b = (r, e, t) => zc(r, typeof e != "symbol" ? e + "" : e, t);
4
+ function kc(r, e) {
5
5
  for (var t = 0; t < e.length; t++) {
6
6
  const i = e[t];
7
7
  if (typeof i != "string" && !Array.isArray(i)) {
@@ -21,7 +21,7 @@ function jr(r) {
21
21
  return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
22
22
  }
23
23
  var oi = { exports: {} }, Bn;
24
- function kc() {
24
+ function Rc() {
25
25
  return Bn || (Bn = 1, function(r) {
26
26
  var e = Object.prototype.hasOwnProperty, t = "~";
27
27
  function i() {
@@ -127,8 +127,8 @@ function kc() {
127
127
  }, o.prototype.off = o.prototype.removeListener, o.prototype.addListener = o.prototype.on, o.prefixed = t, o.EventEmitter = o, r.exports = o;
128
128
  }(oi)), oi.exports;
129
129
  }
130
- var Rc = kc();
131
- const Xe = /* @__PURE__ */ jr(Rc);
130
+ var Ac = Rc();
131
+ const Xe = /* @__PURE__ */ jr(Ac);
132
132
  var ko = /* @__PURE__ */ ((r) => (r.LeftToRight = "LeftToRight", r.UpToDown = "UpToDown", r.All = "All", r.None = "None", r))(ko || {}), G = /* @__PURE__ */ ((r) => (r.Camera = "camera", r.Screen = "screen", r.VideoFile = "videoFile", r.Microphone = "microphone", r.AudioFile = "audioFile", r.Image = "image", r.MixAudio = "mixAudio", r.MixVideo = "mixVideo", r.CustomVideo = "customVideo", r.CustomAudio = "customAudio", r))(G || {}), Te = /* @__PURE__ */ ((r) => (r.DeviceCaptured = "deviceCaptured", r.DeviceStopCapture = "deviceStopCapture", r.Error = "error", r.Interrupted = "interrupted", r))(Te || {}), J = /* @__PURE__ */ ((r) => (r.PushStart = "pushStart", r.PushStop = "pushStop", r.PushError = "pushError", r.RTCConnectStateChanged = "rtcConnectStateChanged", r.CaptureFirstVideoFrame = "capturefirstvideoframe", r.CaptureFirstAudioFrame = "capturefirstaudioframe", r.NotAllowedAutoPlay = "notallowedautoplay", r.ReconnectStateChange = "reconnectStateChange", r.LiveConnectStateChange = "liveConnectStateChange", r))(J || {}), Ro = /* @__PURE__ */ ((r) => (r["120p"] = "160x120x15x200", r["180p"] = "320x180x15x350", r["240p"] = "320x240x15x400", r["360p"] = "640x360x15x800", r["480p"] = "640x480x15x900", r["720p-1"] = "1280x720x15x1500", r["720p-2"] = "1280x720x25x1500", r["720p-3"] = "1280x720x30x1500", r["1080p-1"] = "1920x1080x15x2080", r["1080p-2"] = "1920x1080x25x3000", r["1080p-3"] = "1920x1080x30x3150", r))(Ro || {}), Ao = /* @__PURE__ */ ((r) => (r["120p"] = "120x160x15x200", r["180p"] = "180x320x15x350", r["240p"] = "240x320x15x400", r["360p"] = "360x640x15x800", r["480p"] = "480x640x15x900", r["720p-1"] = "720x1280x15x1500", r["720p-2"] = "720x1280x25x1500", r["720p-3"] = "720x1280x30x1500", r["1080p-1"] = "1080x1920x15x2080", r["1080p-2"] = "1080x1920x25x3000", r["1080p-3"] = "1080x1920x30x3150", r))(Ao || {}), Do = /* @__PURE__ */ ((r) => (r.STANDARD = "48000x40", r.HIGH = "48000x128", r))(Do || {}), it = /* @__PURE__ */ ((r) => (r.VideoStreamChange = "videoStreamChange", r.AudioStreamChange = "audioStreamChange", r))(it || {}), xo = /* @__PURE__ */ ((r) => (r[r.init = -1] = "init", r[r.new = 0] = "new", r[r.connecting = 1] = "connecting", r[r.connected = 2] = "connected", r[r.disconnected = 3] = "disconnected", r[r.failed = 4] = "failed", r[r.closed = 5] = "closed", r))(xo || {});
133
133
  const Po = {
134
134
  SizeChange: "sizeChange"
@@ -139,29 +139,29 @@ var pe = /* @__PURE__ */ ((r) => (r[r.DISCONNECTED = 0] = "DISCONNECTED", r[r.CO
139
139
  const re = [];
140
140
  for (let r = 0; r < 256; ++r)
141
141
  re.push((r + 256).toString(16).slice(1));
142
- function Ac(r, e = 0) {
142
+ function Dc(r, e = 0) {
143
143
  return (re[r[e + 0]] + re[r[e + 1]] + re[r[e + 2]] + re[r[e + 3]] + "-" + re[r[e + 4]] + re[r[e + 5]] + "-" + re[r[e + 6]] + re[r[e + 7]] + "-" + re[r[e + 8]] + re[r[e + 9]] + "-" + re[r[e + 10]] + re[r[e + 11]] + re[r[e + 12]] + re[r[e + 13]] + re[r[e + 14]] + re[r[e + 15]]).toLowerCase();
144
144
  }
145
145
  let ai;
146
- const Dc = new Uint8Array(16);
147
- function xc() {
146
+ const xc = new Uint8Array(16);
147
+ function Pc() {
148
148
  if (!ai) {
149
149
  if (typeof crypto > "u" || !crypto.getRandomValues)
150
150
  throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
151
151
  ai = crypto.getRandomValues.bind(crypto);
152
152
  }
153
- return ai(Dc);
153
+ return ai(xc);
154
154
  }
155
- const Pc = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Vn = { randomUUID: Pc };
155
+ const Ic = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Vn = { randomUUID: Ic };
156
156
  function ct(r, e, t) {
157
157
  var n;
158
158
  if (Vn.randomUUID && !r)
159
159
  return Vn.randomUUID();
160
160
  r = r || {};
161
- const i = r.random ?? ((n = r.rng) == null ? void 0 : n.call(r)) ?? xc();
161
+ const i = r.random ?? ((n = r.rng) == null ? void 0 : n.call(r)) ?? Pc();
162
162
  if (i.length < 16)
163
163
  throw new Error("Random bytes length must be >= 16");
164
- return i[6] = i[6] & 15 | 64, i[8] = i[8] & 63 | 128, Ac(i);
164
+ return i[6] = i[6] & 15 | 64, i[8] = i[8] & 63 | 128, Dc(i);
165
165
  }
166
166
  class Mo {
167
167
  constructor() {
@@ -211,7 +211,7 @@ class Fn extends Mo {
211
211
  this._g = t, this._node && (this._node.gain.value = t);
212
212
  }
213
213
  }
214
- class Ic extends Mo {
214
+ class Oc extends Mo {
215
215
  constructor(t) {
216
216
  super();
217
217
  b(this, "previousNode", null);
@@ -225,7 +225,7 @@ class Ic extends Mo {
225
225
  super.destroy();
226
226
  }
227
227
  }
228
- class Oc extends Ic {
228
+ class Mc extends Oc {
229
229
  constructor() {
230
230
  super(...arguments);
231
231
  b(this, "_node");
@@ -266,8 +266,8 @@ const jn = {
266
266
  warn: { color: "rgba(255, 119, 0, 0.3)", text: "WARN" },
267
267
  err: { color: "rgba(255, 0, 0, 0.3)", text: "ERR " },
268
268
  succ: { color: "rgba(0, 119, 0, 0.3)", text: "SUCC" }
269
- }, Hn = "__debug__", Mc = "[VE-CAPTURE]";
270
- function Lc() {
269
+ }, Hn = "__debug__", Lc = "[VE-CAPTURE]";
270
+ function Uc() {
271
271
  if (typeof location > "u" || typeof localStorage > "u")
272
272
  return !1;
273
273
  let r = !1;
@@ -279,9 +279,9 @@ let ce = class {
279
279
  this.moduleName = e;
280
280
  }
281
281
  print(e, t, ...i) {
282
- const n = Uc();
283
- Lc() && console.log(
284
- `${n}-${Mc}%c[${jn[e].text}]%c[${this.moduleName}][${t}]`,
282
+ const n = Nc();
283
+ Uc() && console.log(
284
+ `${n}-${Lc}%c[${jn[e].text}]%c[${this.moduleName}][${t}]`,
285
285
  `background-color:${jn[e].color};`,
286
286
  "background-color:rgba(0, 0, 0, 0)",
287
287
  ...i
@@ -314,7 +314,7 @@ let ce = class {
314
314
  };
315
315
  }
316
316
  };
317
- function Uc() {
317
+ function Nc() {
318
318
  const r = /* @__PURE__ */ new Date();
319
319
  return `${r.toTimeString().split(" ")[0]}:${r.getMilliseconds().toString().padStart(3, "0")}`;
320
320
  }
@@ -388,15 +388,15 @@ hn();
388
388
  !Z() && /micromessenger/i.test(K());
389
389
  !Z() && K().includes("mobile");
390
390
  !Z() && /sm-\w+/i.test(K());
391
- const Nc = !Z() && !!/(iphone|ipad|ipod)/i.exec(K());
391
+ const Gc = !Z() && !!/(iphone|ipad|ipod)/i.exec(K());
392
392
  !Z() && /android/i.test(K());
393
393
  !Z() && /windows/i.test(K());
394
394
  !Z() && /openharmony/i.test(K());
395
395
  let No = "0";
396
396
  var So;
397
- const Gc = !Z() && ((So = K().match(/version\/(\d+)/i)) == null ? void 0 : So[1]);
397
+ const Bc = !Z() && ((So = K().match(/version\/(\d+)/i)) == null ? void 0 : So[1]);
398
398
  var Eo;
399
- Hr && Gc && (No = (Eo = navigator.userAgent.match(/version\/(\d+\.\d+)/i)) == null ? void 0 : Eo[1]);
399
+ Hr && Bc && (No = (Eo = navigator.userAgent.match(/version\/(\d+\.\d+)/i)) == null ? void 0 : Eo[1]);
400
400
  var Co;
401
401
  !Z() && ((Co = K().match(/firefox\/(\d+)/i)) == null || Co[1]);
402
402
  const Fi = No;
@@ -404,51 +404,51 @@ var wo, To;
404
404
  !Z() && ((To = (wo = K().match(/ ([\d_]+) like mac os x/i)) == null ? void 0 : wo[1]) == null || To.split("_").map((r) => parseInt(r)));
405
405
  var zo;
406
406
  !Z() && ((zo = K().match(/chrome\/(\d+)/i)) == null || zo[1]);
407
- function Bc() {
407
+ function Vc() {
408
408
  var r;
409
409
  return !!((r = navigator == null ? void 0 : navigator.permissions) != null && r.query);
410
410
  }
411
411
  function ln() {
412
412
  return !!(navigator != null && navigator.mediaDevices);
413
413
  }
414
- function Vc() {
414
+ function Fc() {
415
415
  var r;
416
416
  return ln() && !!((r = navigator == null ? void 0 : navigator.mediaDevices) != null && r.getUserMedia);
417
417
  }
418
- function Fc() {
418
+ function jc() {
419
419
  return !!Promise.withResolvers;
420
420
  }
421
- function jc() {
421
+ function Hc() {
422
422
  return !(Hr && Fi === "16.1");
423
423
  }
424
- function Hc() {
424
+ function $c() {
425
425
  return !(Hr && Fi && ["16.1", "16.2", "16.3"].includes(Fi));
426
426
  }
427
- function $c() {
427
+ function qc() {
428
428
  return !Uo;
429
429
  }
430
- function qc() {
430
+ function Kc() {
431
431
  return typeof CanvasCaptureMediaStreamTrack < "u";
432
432
  }
433
- function Kc(r) {
433
+ function Wc(r) {
434
434
  return typeof r.requestFrame == "function";
435
435
  }
436
- function Wc() {
436
+ function Jc() {
437
437
  return !!ln() && typeof navigator.mediaDevices.ondevicechange < "u" && typeof navigator.mediaDevices.addEventListener == "function";
438
438
  }
439
439
  const Ae = {
440
- permissionQuery: Bc,
440
+ permissionQuery: Vc,
441
441
  mediaDevices: ln,
442
- settingResolutionInGetDisplayMedia: jc,
443
- promiseWithResolvers: Fc,
444
- getUserMedia: Vc,
445
- isolateEnumerateDevices: $c,
446
- supportIdealParamsInGetDisplayMedia: Hc,
447
- canvasCaptureMediaStreamTrack: qc,
448
- requestFrameOnMediaStream: Kc,
449
- ondevicechange: Wc
442
+ settingResolutionInGetDisplayMedia: Hc,
443
+ promiseWithResolvers: jc,
444
+ getUserMedia: Fc,
445
+ isolateEnumerateDevices: qc,
446
+ supportIdealParamsInGetDisplayMedia: $c,
447
+ canvasCaptureMediaStreamTrack: Kc,
448
+ requestFrameOnMediaStream: Wc,
449
+ ondevicechange: Jc
450
450
  };
451
- function Jc() {
451
+ function Zc() {
452
452
  if (Ae.promiseWithResolvers())
453
453
  return Promise.withResolvers();
454
454
  let r, e;
@@ -464,7 +464,7 @@ function Go(r = {}) {
464
464
  timeout: 0,
465
465
  message: new O(M.UNEXPECTED_ERROR, "unexpected timeout"),
466
466
  ...r
467
- }, { promise: i, resolve: n, reject: s } = Jc();
467
+ }, { promise: i, resolve: n, reject: s } = Zc();
468
468
  if (e <= 0)
469
469
  return { promise: i, resolve: n, reject: s };
470
470
  const a = setTimeout(() => {
@@ -478,7 +478,7 @@ function Go(r = {}) {
478
478
  reject: s
479
479
  };
480
480
  }
481
- const Zc = {
481
+ const Xc = {
482
482
  playsinline: "",
483
483
  "webkit-playsinline": "",
484
484
  "x5-playsinline": "",
@@ -487,7 +487,7 @@ const Zc = {
487
487
  preload: "metadata",
488
488
  muted: "",
489
489
  crossOrigin: "anonymous"
490
- }, Xc = {
490
+ }, Yc = {
491
491
  playsinline: "",
492
492
  "webkit-playsinline": "",
493
493
  preload: "metadata",
@@ -507,9 +507,9 @@ class tr {
507
507
  let i;
508
508
  if (e instanceof MediaStreamTrack) {
509
509
  const o = new MediaStream([e]);
510
- i = Yc(o), this._stream = o;
510
+ i = Qc(o), this._stream = o;
511
511
  } else if (e.url)
512
- i = Qc(e);
512
+ i = eu(e);
513
513
  else
514
514
  throw new O(
515
515
  M.UNEXPECTED_TYPE,
@@ -613,7 +613,7 @@ class tr {
613
613
  });
614
614
  }
615
615
  }
616
- function Yc(r) {
616
+ function Qc(r) {
617
617
  let e = "audio";
618
618
  r.getVideoTracks().length > 0 && (e = "video");
619
619
  const t = Bo(
@@ -621,7 +621,7 @@ function Yc(r) {
621
621
  );
622
622
  return t.srcObject = r, t;
623
623
  }
624
- function Qc(r) {
624
+ function eu(r) {
625
625
  const { url: e, kind: t, loop: i } = r, n = Bo(t);
626
626
  return n.src = e, n.loop = i, n;
627
627
  }
@@ -632,14 +632,14 @@ function Bo(r) {
632
632
  width: "100%",
633
633
  height: "100%"
634
634
  },
635
- attributes: Zc
635
+ attributes: Xc
636
636
  });
637
637
  if (r === V.AUDIO)
638
638
  return Vi(V.AUDIO, {
639
639
  style: {
640
640
  display: "none"
641
641
  },
642
- attributes: Xc
642
+ attributes: Yc
643
643
  });
644
644
  throw new O(
645
645
  M.UNEXPECTED_TYPE,
@@ -711,7 +711,7 @@ class Vo {
711
711
  this._config = { width: t, height: i, frameRate: n };
712
712
  const { context: s, canvas: a } = Lo({ width: t, height: i });
713
713
  this._context = s, this._canvas = a;
714
- const o = eu({ url: e.url, width: t, height: i });
714
+ const o = tu({ url: e.url, width: t, height: i });
715
715
  this._image = new dn(o);
716
716
  const { promise: d, resolve: c, reject: u } = Go({
717
717
  timeout: 2e3,
@@ -766,7 +766,7 @@ class Vo {
766
766
  }
767
767
  // destroy() {}
768
768
  }
769
- function eu({
769
+ function tu({
770
770
  url: r,
771
771
  height: e,
772
772
  width: t
@@ -859,7 +859,7 @@ class $r extends fn {
859
859
  );
860
860
  if (this._node)
861
861
  return this._node;
862
- const t = new Oc(this);
862
+ const t = new Mc(this);
863
863
  return this._node = t, t;
864
864
  }
865
865
  /** overwrite in AudioTrack */
@@ -894,13 +894,13 @@ class $r extends fn {
894
894
  this.logger.warn("destroy", this.id), (t = this._node) == null || t.destroy(), super.destroy();
895
895
  }
896
896
  }
897
- class tu extends $r {
897
+ class ru extends $r {
898
898
  constructor() {
899
899
  super(...arguments);
900
900
  b(this, "logger", new ce("MicrophoneAudioTrack"));
901
901
  }
902
902
  }
903
- class ru extends $r {
903
+ class iu extends $r {
904
904
  constructor() {
905
905
  super(...arguments);
906
906
  b(this, "logger", new ce("ScreenAudioTrack"));
@@ -925,22 +925,22 @@ class Fo extends $r {
925
925
  }
926
926
  }
927
927
  }
928
- class iu extends $r {
928
+ class nu extends $r {
929
929
  constructor() {
930
930
  super(...arguments);
931
931
  b(this, "logger", new ce("CustomAudioTrack"));
932
932
  }
933
933
  }
934
- let nu = 1;
934
+ let su = 1;
935
935
  const ui = new ce("PromiseQueue");
936
- class su {
936
+ class ou {
937
937
  constructor(e) {
938
938
  b(this, "lockingPromise", Promise.resolve());
939
939
  b(this, "locks", 0);
940
940
  b(this, "name", "");
941
941
  b(this, "lockId");
942
942
  b(this, "closeReason");
943
- this.lockId = nu++, e && (this.name = e), ui.info(`lock-${this.name}-${this.lockId}`, "is created.");
943
+ this.lockId = su++, e && (this.name = e), ui.info(`lock-${this.name}-${this.lockId}`, "is created.");
944
944
  }
945
945
  get isLocked() {
946
946
  return this.locks > 0;
@@ -962,8 +962,8 @@ class su {
962
962
  return this.lockingPromise = this.lockingPromise.then(() => t), i;
963
963
  }
964
964
  }
965
- const ou = 300, au = 3e3, be = new ce("Devices");
966
- class cu extends pn {
965
+ const au = 300, cu = 3e3, be = new ce("Devices");
966
+ class uu extends pn {
967
967
  constructor() {
968
968
  super();
969
969
  /** 存储 SDK 已知的设备列表 */
@@ -977,7 +977,7 @@ class cu extends pn {
977
977
  [V.AUDIO]: !1,
978
978
  [V.VIDEO]: !1
979
979
  });
980
- b(this, "_changedQueue", new su("device changed queue"));
980
+ b(this, "_changedQueue", new ou("device changed queue"));
981
981
  this._init();
982
982
  }
983
983
  async _init() {
@@ -992,13 +992,13 @@ class cu extends pn {
992
992
  "no supported, use timer instead"
993
993
  ), setInterval(() => {
994
994
  this._handleDeviceChanged();
995
- }, au);
995
+ }, cu);
996
996
  return;
997
997
  }
998
998
  Ae.ondevicechange() && navigator.mediaDevices.addEventListener("devicechange", () => {
999
999
  be.info("devicechange"), setTimeout(() => {
1000
1000
  this._handleDeviceChanged();
1001
- }, ou);
1001
+ }, au);
1002
1002
  });
1003
1003
  }
1004
1004
  async _initPermissionChanged() {
@@ -1180,7 +1180,7 @@ function Wn(r) {
1180
1180
  const e = [];
1181
1181
  return r.audio && e.push(V.AUDIO), r.video && e.push(V.VIDEO), e;
1182
1182
  }
1183
- const ji = new cu(), di = {
1183
+ const ji = new uu(), di = {
1184
1184
  LeftToRight: "LeftToRight",
1185
1185
  UpToDown: "UpToDown",
1186
1186
  All: "All"
@@ -1190,7 +1190,7 @@ class mn {
1190
1190
  b(this, "id", ct());
1191
1191
  }
1192
1192
  position(e, t) {
1193
- return new uu(this, { x: e, y: t });
1193
+ return new du(this, { x: e, y: t });
1194
1194
  }
1195
1195
  scale(e) {
1196
1196
  return new Jn(this, { s: e });
@@ -1203,7 +1203,7 @@ class mn {
1203
1203
  return ((e = this.previousNode) == null ? void 0 : e.available()) ?? !1;
1204
1204
  }
1205
1205
  }
1206
- class uu extends mn {
1206
+ class du extends mn {
1207
1207
  constructor(t, i) {
1208
1208
  super();
1209
1209
  b(this, "previousNode");
@@ -1241,7 +1241,7 @@ class Jn extends mn {
1241
1241
  t.scale(this._scaleParams[0], this._scaleParams[1]);
1242
1242
  }
1243
1243
  }
1244
- class du extends mn {
1244
+ class hu extends mn {
1245
1245
  constructor(t) {
1246
1246
  super();
1247
1247
  b(this, "previousNode", null);
@@ -1252,7 +1252,7 @@ class du extends mn {
1252
1252
  return this._source.available();
1253
1253
  }
1254
1254
  }
1255
- class qr extends du {
1255
+ class qr extends hu {
1256
1256
  constructor(t, i) {
1257
1257
  super(t);
1258
1258
  b(this, "_targetWidth");
@@ -1274,7 +1274,7 @@ class qr extends du {
1274
1274
  );
1275
1275
  }
1276
1276
  }
1277
- class hu extends fn {
1277
+ class lu extends fn {
1278
1278
  constructor() {
1279
1279
  super(...arguments);
1280
1280
  b(this, "logger", new ce("PictureTrack"));
@@ -1310,7 +1310,7 @@ class hu extends fn {
1310
1310
  this.logger.warn("destroy"), super.destroy();
1311
1311
  }
1312
1312
  }
1313
- const lu = 500;
1313
+ const pu = 500;
1314
1314
  class Kr extends fn {
1315
1315
  constructor() {
1316
1316
  super(...arguments);
@@ -1325,7 +1325,7 @@ class Kr extends fn {
1325
1325
  width: n,
1326
1326
  height: s
1327
1327
  });
1328
- }, lu);
1328
+ }, pu);
1329
1329
  });
1330
1330
  }
1331
1331
  element() {
@@ -1349,7 +1349,7 @@ class Kr extends fn {
1349
1349
  clearTimeout(this.sizeChangeTimer), super.destroy();
1350
1350
  }
1351
1351
  }
1352
- class pu extends Kr {
1352
+ class fu extends Kr {
1353
1353
  constructor(t) {
1354
1354
  super(t);
1355
1355
  b(this, "logger", new ce("CameraVideoTrack"));
@@ -1364,7 +1364,7 @@ class pu extends Kr {
1364
1364
  return t ?? 0;
1365
1365
  }
1366
1366
  }
1367
- class fu extends Kr {
1367
+ class mu extends Kr {
1368
1368
  constructor(t) {
1369
1369
  super(t);
1370
1370
  b(this, "logger", new ce("ScreenVideoTrack"));
@@ -1379,7 +1379,7 @@ class fu extends Kr {
1379
1379
  return t ?? 0;
1380
1380
  }
1381
1381
  }
1382
- class mu extends Kr {
1382
+ class _u extends Kr {
1383
1383
  constructor() {
1384
1384
  super(...arguments);
1385
1385
  b(this, "logger", new ce("MediaVideoTrack"));
@@ -1393,7 +1393,7 @@ class mu extends Kr {
1393
1393
  return t ?? 0;
1394
1394
  }
1395
1395
  }
1396
- class _u extends Kr {
1396
+ class gu extends Kr {
1397
1397
  constructor() {
1398
1398
  super(...arguments);
1399
1399
  b(this, "logger", new ce("CustomVideoTrack"));
@@ -1423,13 +1423,13 @@ async function jo(r, e) {
1423
1423
  }
1424
1424
  }
1425
1425
  const Oe = new ce("Capture");
1426
- async function gu(r) {
1426
+ async function vu(r) {
1427
1427
  return ji.enumerateDevices(r);
1428
1428
  }
1429
- async function vu(r) {
1429
+ async function yu(r) {
1430
1430
  ji.removeAllListeners("onDeviceStateChanged"), ji.on("onDeviceStateChanged", r);
1431
1431
  }
1432
- async function yu(r, e) {
1432
+ async function bu(r, e) {
1433
1433
  let t;
1434
1434
  try {
1435
1435
  const n = { video: r ?? !0 };
@@ -1444,9 +1444,9 @@ async function yu(r, e) {
1444
1444
  const i = t.getVideoTracks()[0];
1445
1445
  if (r != null && r.frameRate && e && jo(i, r), !i)
1446
1446
  throw new O(M.UNEXPECTED_TYPE, "got falsy in track");
1447
- return new pu(i);
1447
+ return new fu(i);
1448
1448
  }
1449
- async function bu(r, e, t) {
1449
+ async function Su(r, e, t) {
1450
1450
  const { video: i, audio: n } = r;
1451
1451
  let s = i === !0 ? {} : i;
1452
1452
  e != null && e.displaySurface && (s.displaySurface = e.displaySurface, delete e.displaySurface), Ae.settingResolutionInGetDisplayMedia() || (s = !0), !Ae.supportIdealParamsInGetDisplayMedia() && typeof s != "boolean" && (s.width && typeof s.width == "number" && (s.width = {
@@ -1473,21 +1473,21 @@ async function bu(r, e, t) {
1473
1473
  throw new O(M.UNEXPECTED_TYPE, "got falsy in videoTrack");
1474
1474
  typeof s != "boolean" && typeof s.frameRate == "number" && t && jo(o, s);
1475
1475
  const c = [];
1476
- return c.push(new fu(o)), d && c.push(new ru(d)), c;
1476
+ return c.push(new mu(o)), d && c.push(new iu(d)), c;
1477
1477
  }
1478
- async function Su(r) {
1478
+ async function Eu(r) {
1479
1479
  const { url: e, audio: t, video: i, loop: n } = r, s = new tr({
1480
1480
  url: e,
1481
1481
  kind: i ? V.VIDEO : V.AUDIO,
1482
1482
  loop: n
1483
1483
  }), a = [];
1484
- return t && a.push(new Fo(s)), i && a.push(new mu(s)), await s.isReady(), a;
1484
+ return t && a.push(new Fo(s)), i && a.push(new _u(s)), await s.isReady(), a;
1485
1485
  }
1486
- async function Eu(r) {
1486
+ async function Cu(r) {
1487
1487
  const e = new Vo(r);
1488
- return await e.isReady(), new hu(e);
1488
+ return await e.isReady(), new lu(e);
1489
1489
  }
1490
- async function Cu(r) {
1490
+ async function wu(r) {
1491
1491
  let e;
1492
1492
  try {
1493
1493
  const i = { audio: r ?? !0 };
@@ -1502,31 +1502,31 @@ async function Cu(r) {
1502
1502
  const t = e.getAudioTracks()[0];
1503
1503
  if (!t)
1504
1504
  throw new O(M.UNEXPECTED_TYPE, "got falsy in track");
1505
- return new tu(t);
1505
+ return new ru(t);
1506
1506
  }
1507
- function wu(r) {
1507
+ function Tu(r) {
1508
1508
  if (!r || r.kind !== "video")
1509
1509
  throw new O(
1510
1510
  M.UNEXPECTED_TYPE,
1511
1511
  "error custom video track type"
1512
1512
  );
1513
- return new _u(r);
1513
+ return new gu(r);
1514
1514
  }
1515
- function Tu(r) {
1515
+ function zu(r) {
1516
1516
  if (!r || r.kind !== "audio")
1517
1517
  throw new O(
1518
1518
  M.UNEXPECTED_TYPE,
1519
1519
  "error custom audio track type"
1520
1520
  );
1521
- return new iu(r);
1521
+ return new nu(r);
1522
1522
  }
1523
- const zu = Oe.invoke(gu, "enumerateInputDevices"), ku = Oe.invoke(yu, "createCameraTrack"), Ru = Oe.invoke(Eu, "createPictureTrack"), Zn = Oe.invoke(Su, "createMediaTracks"), Au = Oe.invoke(Cu, "createMicrophoneTrack"), Du = Oe.invoke(bu, "createScreenTracks"), xu = Oe.invoke(vu, "onDeviceChanged"), Pu = Oe.invoke(wu, "createCustomVideoTrack"), Iu = Oe.invoke(Tu, "createCustomAudioTrack");
1523
+ const ku = Oe.invoke(vu, "enumerateInputDevices"), Ru = Oe.invoke(bu, "createCameraTrack"), Au = Oe.invoke(Cu, "createPictureTrack"), Zn = Oe.invoke(Eu, "createMediaTracks"), Du = Oe.invoke(wu, "createMicrophoneTrack"), xu = Oe.invoke(Su, "createScreenTracks"), Pu = Oe.invoke(yu, "onDeviceChanged"), Iu = Oe.invoke(Tu, "createCustomVideoTrack"), Ou = Oe.invoke(zu, "createCustomAudioTrack");
1524
1524
  var Hi = /* @__PURE__ */ ((r) => (r.PAUSING = "pausing", r))(Hi || {});
1525
- const Ou = {
1525
+ const Mu = {
1526
1526
  sampleRate: 48e3,
1527
1527
  keepAlive: !0
1528
1528
  }, Xn = /* @__PURE__ */ new Map(), Mt = new ce("Mixer");
1529
- class Mu extends pn {
1529
+ class Lu extends pn {
1530
1530
  constructor(t) {
1531
1531
  super();
1532
1532
  b(this, "id", ct());
@@ -1551,9 +1551,9 @@ class Mu extends pn {
1551
1551
  });
1552
1552
  });
1553
1553
  Mt.info("ctor", t), this._config = {
1554
- ...Ou,
1554
+ ...Mu,
1555
1555
  ...t
1556
- }, this._context = Lu(this._config), this._bindContextEvent(this._context);
1556
+ }, this._context = Uu(this._config), this._bindContextEvent(this._context);
1557
1557
  }
1558
1558
  mix(t) {
1559
1559
  Mt.info("mix", t), Bt(this._context);
@@ -1596,7 +1596,7 @@ class Mu extends pn {
1596
1596
  return this._destNode = t, this._track = i, i;
1597
1597
  }
1598
1598
  }
1599
- function Lu(r) {
1599
+ function Uu(r) {
1600
1600
  const { sampleRate: e, keepAlive: t } = r;
1601
1601
  let i = Xn.get(e);
1602
1602
  return (!i || i.state === "closed") && (i = new AudioContext({ sampleRate: e }), Xn.set(e, i)), t && (i.onstatechange = () => {
@@ -1606,7 +1606,7 @@ function Lu(r) {
1606
1606
  function Bt(r) {
1607
1607
  return r.state === "suspended" || r.state === "interrupted" ? r.resume() : Promise.resolve();
1608
1608
  }
1609
- const Uu = (r) => (e, t) => (r.set(e, t), t), Yn = Number.MAX_SAFE_INTEGER === void 0 ? 9007199254740991 : Number.MAX_SAFE_INTEGER, Ho = 536870912, Qn = Ho * 2, Nu = (r, e) => (t) => {
1609
+ const Nu = (r) => (e, t) => (r.set(e, t), t), Yn = Number.MAX_SAFE_INTEGER === void 0 ? 9007199254740991 : Number.MAX_SAFE_INTEGER, Ho = 536870912, Qn = Ho * 2, Gu = (r, e) => (t) => {
1610
1610
  const i = e.get(t);
1611
1611
  let n = i === void 0 ? t.size : i < Qn ? i + 1 : 0;
1612
1612
  if (!t.has(n))
@@ -1621,12 +1621,12 @@ const Uu = (r) => (e, t) => (r.set(e, t), t), Yn = Number.MAX_SAFE_INTEGER === v
1621
1621
  for (; t.has(n); )
1622
1622
  n = Math.floor(Math.random() * Yn);
1623
1623
  return r(t, n);
1624
- }, $o = /* @__PURE__ */ new WeakMap(), Gu = Uu($o), Fe = Nu(Gu, $o), Bu = (r) => r.method !== void 0 && r.method === "call", Vu = (r) => typeof r.id == "number" && typeof r.result == "boolean", Fu = (r) => {
1624
+ }, $o = /* @__PURE__ */ new WeakMap(), Bu = Nu($o), Fe = Gu(Bu, $o), Vu = (r) => r.method !== void 0 && r.method === "call", Fu = (r) => typeof r.id == "number" && typeof r.result == "boolean", ju = (r) => {
1625
1625
  const e = /* @__PURE__ */ new Map([[0, () => {
1626
1626
  }]]), t = /* @__PURE__ */ new Map([[0, () => {
1627
1627
  }]]), i = /* @__PURE__ */ new Map(), n = new Worker(r);
1628
1628
  return n.addEventListener("message", ({ data: c }) => {
1629
- if (Bu(c)) {
1629
+ if (Vu(c)) {
1630
1630
  const { params: { timerId: u, timerType: l } } = c;
1631
1631
  if (l === "interval") {
1632
1632
  const h = e.get(u);
@@ -1647,7 +1647,7 @@ const Uu = (r) => (e, t) => (r.set(e, t), t), Yn = Number.MAX_SAFE_INTEGER === v
1647
1647
  throw new Error("The timer is in an undefined state.");
1648
1648
  } else typeof h == "function" && (h(), t.delete(u));
1649
1649
  }
1650
- } else if (Vu(c)) {
1650
+ } else if (Fu(c)) {
1651
1651
  const { id: u } = c, l = i.get(u);
1652
1652
  if (l === void 0)
1653
1653
  throw new Error("The timer is in an undefined state.");
@@ -1716,7 +1716,7 @@ const Uu = (r) => (e, t) => (r.set(e, t), t), Yn = Number.MAX_SAFE_INTEGER === v
1716
1716
  }), h;
1717
1717
  }
1718
1718
  };
1719
- }, ju = (r, e) => {
1719
+ }, Hu = (r, e) => {
1720
1720
  let t = null;
1721
1721
  return () => {
1722
1722
  if (t !== null)
@@ -1724,7 +1724,7 @@ const Uu = (r) => (e, t) => (r.set(e, t), t), Yn = Number.MAX_SAFE_INTEGER === v
1724
1724
  const i = new Blob([e], { type: "application/javascript; charset=utf-8" }), n = URL.createObjectURL(i);
1725
1725
  return t = r(n), setTimeout(() => URL.revokeObjectURL(n)), t;
1726
1726
  };
1727
- }, Hu = `(()=>{"use strict";const e=new Map,t=new Map,r=t=>{const r=e.get(t);return void 0!==r&&(clearTimeout(r),e.delete(t),!0)},s=e=>{const r=t.get(e);return void 0!==r&&(clearTimeout(r),t.delete(e),!0)},o=(e,t)=>{const r=performance.now(),s=e+t-r-performance.timeOrigin;return{expected:r+s,remainingDelay:s}},i=(e,t,r,s)=>{const o=r-performance.now();o>0?e.set(t,setTimeout(i,o,e,t,r,s)):(e.delete(t),postMessage({id:null,method:"call",params:{timerId:t,timerType:s}}))};addEventListener("message",(({data:n})=>{try{if("clear"===n.method){const{id:e,params:{timerId:t,timerType:o}}=n;if("interval"===o)postMessage({id:e,result:r(t)});else{if("timeout"!==o)throw new Error('The given type "'.concat(o,'" is not supported'));postMessage({id:e,result:s(t)})}}else{if("set"!==n.method)throw new Error('The given method "'.concat(n.method,'" is not supported'));{const{params:{delay:r,now:s,timerId:a,timerType:m}}=n;if("interval"===m)((t,r,s)=>{const{expected:n,remainingDelay:a}=o(t,s);e.set(r,setTimeout(i,a,e,r,n,"interval"))})(r,a,s);else{if("timeout"!==m)throw new Error('The given type "'.concat(m,'" is not supported'));((e,r,s)=>{const{expected:n,remainingDelay:a}=o(e,s);t.set(r,setTimeout(i,a,t,r,n,"timeout"))})(r,a,s)}}}}catch(e){postMessage({error:{message:e.message},id:n.id,result:null})}}))})();`, qo = ju(Fu, Hu), $u = (r) => qo().clearTimeout(r), qu = (...r) => qo().setTimeout(...r), Ku = (r) => r.method !== void 0 && r.method === "call", Wu = (r) => typeof r.id == "number" && typeof r.result == "boolean", Ju = (r) => {
1727
+ }, $u = `(()=>{"use strict";const e=new Map,t=new Map,r=t=>{const r=e.get(t);return void 0!==r&&(clearTimeout(r),e.delete(t),!0)},s=e=>{const r=t.get(e);return void 0!==r&&(clearTimeout(r),t.delete(e),!0)},o=(e,t)=>{const r=performance.now(),s=e+t-r-performance.timeOrigin;return{expected:r+s,remainingDelay:s}},i=(e,t,r,s)=>{const o=r-performance.now();o>0?e.set(t,setTimeout(i,o,e,t,r,s)):(e.delete(t),postMessage({id:null,method:"call",params:{timerId:t,timerType:s}}))};addEventListener("message",(({data:n})=>{try{if("clear"===n.method){const{id:e,params:{timerId:t,timerType:o}}=n;if("interval"===o)postMessage({id:e,result:r(t)});else{if("timeout"!==o)throw new Error('The given type "'.concat(o,'" is not supported'));postMessage({id:e,result:s(t)})}}else{if("set"!==n.method)throw new Error('The given method "'.concat(n.method,'" is not supported'));{const{params:{delay:r,now:s,timerId:a,timerType:m}}=n;if("interval"===m)((t,r,s)=>{const{expected:n,remainingDelay:a}=o(t,s);e.set(r,setTimeout(i,a,e,r,n,"interval"))})(r,a,s);else{if("timeout"!==m)throw new Error('The given type "'.concat(m,'" is not supported'));((e,r,s)=>{const{expected:n,remainingDelay:a}=o(e,s);t.set(r,setTimeout(i,a,t,r,n,"timeout"))})(r,a,s)}}}}catch(e){postMessage({error:{message:e.message},id:n.id,result:null})}}))})();`, qo = Hu(ju, $u), qu = (r) => qo().clearTimeout(r), Ku = (...r) => qo().setTimeout(...r), Wu = (r) => r.method !== void 0 && r.method === "call", Ju = (r) => typeof r.id == "number" && typeof r.result == "boolean", Zu = (r) => {
1728
1728
  const e = /* @__PURE__ */ new Map([
1729
1729
  [0, () => {
1730
1730
  }]
@@ -1735,7 +1735,7 @@ const Uu = (r) => (e, t) => (r.set(e, t), t), Yn = Number.MAX_SAFE_INTEGER === v
1735
1735
  credentials: "omit"
1736
1736
  });
1737
1737
  return n.addEventListener("message", ({ data: c }) => {
1738
- if (Ku(c)) {
1738
+ if (Wu(c)) {
1739
1739
  const {
1740
1740
  params: { timerId: u, timerType: l }
1741
1741
  } = c;
@@ -1758,7 +1758,7 @@ const Uu = (r) => (e, t) => (r.set(e, t), t), Yn = Number.MAX_SAFE_INTEGER === v
1758
1758
  throw new Error("The timer is in an undefined state.");
1759
1759
  } else typeof h == "function" && (h(), t.delete(u));
1760
1760
  }
1761
- } else if (Wu(c)) {
1761
+ } else if (Ju(c)) {
1762
1762
  const { id: u } = c, l = i.get(u);
1763
1763
  if (l === void 0)
1764
1764
  throw new Error("The timer is in an undefined state.");
@@ -1829,13 +1829,13 @@ const Uu = (r) => (e, t) => (r.set(e, t), t), Yn = Number.MAX_SAFE_INTEGER === v
1829
1829
  }), h;
1830
1830
  }
1831
1831
  };
1832
- }, Zu = {
1832
+ }, Xu = {
1833
1833
  width: 640,
1834
1834
  height: 480,
1835
1835
  frameRate: 30,
1836
1836
  backgroundColor: "#000000"
1837
1837
  }, gr = new ce("View");
1838
- class Xu {
1838
+ class Yu {
1839
1839
  constructor(e) {
1840
1840
  b(this, "id", ct());
1841
1841
  b(this, "_context");
@@ -1866,15 +1866,15 @@ class Xu {
1866
1866
  }, wr / this._config.frameRate), this._raqId = requestAnimationFrame(this._paintLoop);
1867
1867
  });
1868
1868
  gr.info("ctor", e), this._config = {
1869
- ...Zu,
1869
+ ...Xu,
1870
1870
  ...e
1871
1871
  };
1872
1872
  const { context: t, canvas: i } = Lo(this._config);
1873
- this._context = t, this._canvas = i, this._customSetTimeout = qu, this._customClearTimeout = $u;
1873
+ this._context = t, this._canvas = i, this._customSetTimeout = Ku, this._customClearTimeout = qu;
1874
1874
  }
1875
1875
  setWorkerTimerScriptUrl(e) {
1876
1876
  if (this._workerTimerScriptUrl = e, this._workerTimerScriptUrl) {
1877
- const t = Ju(this._workerTimerScriptUrl);
1877
+ const t = Zu(this._workerTimerScriptUrl);
1878
1878
  this._customSetTimeout = (...i) => t.setTimeout(...i), this._customClearTimeout = (i) => t.clearTimeout(i);
1879
1879
  }
1880
1880
  }
@@ -1940,10 +1940,10 @@ class Xu {
1940
1940
  this._stopped = !0;
1941
1941
  }
1942
1942
  }
1943
- function Yu() {
1943
+ function Qu() {
1944
1944
  return Math.random().toString(36).slice(-8);
1945
1945
  }
1946
- const Qu = `
1946
+ const ed = `
1947
1947
  const SMOOTHING_FACTOR = 0.8;
1948
1948
  const MINIMUM_VALUE = 0.00001;
1949
1949
 
@@ -1998,10 +1998,10 @@ registerProcessor('vumeter', class extends AudioWorkletProcessor {
1998
1998
  return true;
1999
1999
  }
2000
2000
  });
2001
- `, ed = URL.createObjectURL(
2002
- new Blob([Qu], { type: "application/javascript" })
2001
+ `, td = URL.createObjectURL(
2002
+ new Blob([ed], { type: "application/javascript" })
2003
2003
  );
2004
- class td {
2004
+ class rd {
2005
2005
  constructor() {
2006
2006
  this._audioCtx = null, this._volume = 0;
2007
2007
  }
@@ -2011,7 +2011,7 @@ class td {
2011
2011
  async start(e, t) {
2012
2012
  if (this._audioCtx) return;
2013
2013
  const i = new AudioContext();
2014
- await i.audioWorklet.addModule(t || ed);
2014
+ await i.audioWorklet.addModule(t || td);
2015
2015
  const n = new MediaStream();
2016
2016
  n.addTrack(e);
2017
2017
  const s = i.createMediaStreamSource(n), a = new AudioWorkletNode(i, "vumeter");
@@ -2041,7 +2041,7 @@ class Wr {
2041
2041
  }
2042
2042
  class Ko extends Xe {
2043
2043
  constructor(e) {
2044
- super(), this._width = 0, this._height = 0, this._mediaStream = null, this._nextStream = null, this._trackMap = {}, this.type = e.type, this.id = Yu(), this._source = e.stream;
2044
+ super(), this._width = 0, this._height = 0, this._mediaStream = null, this._nextStream = null, this._trackMap = {}, this.type = e.type, this.id = Qu(), this._source = e.stream;
2045
2045
  }
2046
2046
  get source() {
2047
2047
  return this._source;
@@ -2072,7 +2072,7 @@ class Ko extends Xe {
2072
2072
  return this._trackMap.audio && e.addTrack(this._trackMap.audio), this._trackMap.video && e.addTrack(this._trackMap.video), this._mediaStream = e, e;
2073
2073
  }
2074
2074
  async startVolumeDetect() {
2075
- this.audioTrack && (this._volumeDetector || (this._volumeDetector = new td()), await this._volumeDetector.start(
2075
+ this.audioTrack && (this._volumeDetector || (this._volumeDetector = new rd()), await this._volumeDetector.start(
2076
2076
  this.audioTrack,
2077
2077
  Wr.instance.volumeDetectScriptUrl
2078
2078
  ));
@@ -2116,7 +2116,7 @@ class Jr extends Ko {
2116
2116
  return !0;
2117
2117
  }
2118
2118
  }
2119
- class rd extends zt {
2119
+ class id extends zt {
2120
2120
  constructor(e, t) {
2121
2121
  super({
2122
2122
  type: G.Camera,
@@ -2139,31 +2139,31 @@ class rd extends zt {
2139
2139
  this.source.destroy();
2140
2140
  }
2141
2141
  }
2142
- var Wo = typeof global == "object" && global && global.Object === Object && global, id = typeof self == "object" && self && self.Object === Object && self, Me = Wo || id || Function("return this")(), Je = Me.Symbol, Jo = Object.prototype, nd = Jo.hasOwnProperty, sd = Jo.toString, Lt = Je ? Je.toStringTag : void 0;
2143
- function od(r) {
2144
- var e = nd.call(r, Lt), t = r[Lt];
2142
+ var Wo = typeof global == "object" && global && global.Object === Object && global, nd = typeof self == "object" && self && self.Object === Object && self, Me = Wo || nd || Function("return this")(), Je = Me.Symbol, Jo = Object.prototype, sd = Jo.hasOwnProperty, od = Jo.toString, Lt = Je ? Je.toStringTag : void 0;
2143
+ function ad(r) {
2144
+ var e = sd.call(r, Lt), t = r[Lt];
2145
2145
  try {
2146
2146
  r[Lt] = void 0;
2147
2147
  var i = !0;
2148
2148
  } catch {
2149
2149
  }
2150
- var n = sd.call(r);
2150
+ var n = od.call(r);
2151
2151
  return i && (e ? r[Lt] = t : delete r[Lt]), n;
2152
2152
  }
2153
- var ad = Object.prototype, cd = ad.toString;
2154
- function ud(r) {
2155
- return cd.call(r);
2153
+ var cd = Object.prototype, ud = cd.toString;
2154
+ function dd(r) {
2155
+ return ud.call(r);
2156
2156
  }
2157
- var dd = "[object Null]", hd = "[object Undefined]", es = Je ? Je.toStringTag : void 0;
2157
+ var hd = "[object Null]", ld = "[object Undefined]", es = Je ? Je.toStringTag : void 0;
2158
2158
  function kt(r) {
2159
- return r == null ? r === void 0 ? hd : dd : es && es in Object(r) ? od(r) : ud(r);
2159
+ return r == null ? r === void 0 ? ld : hd : es && es in Object(r) ? ad(r) : dd(r);
2160
2160
  }
2161
2161
  function wt(r) {
2162
2162
  return r != null && typeof r == "object";
2163
2163
  }
2164
- var ld = "[object Symbol]";
2164
+ var pd = "[object Symbol]";
2165
2165
  function Zr(r) {
2166
- return typeof r == "symbol" || wt(r) && kt(r) == ld;
2166
+ return typeof r == "symbol" || wt(r) && kt(r) == pd;
2167
2167
  }
2168
2168
  function Zo(r, e) {
2169
2169
  for (var t = -1, i = r == null ? 0 : r.length, n = Array(i); ++t < i; )
@@ -2181,22 +2181,22 @@ function Xo(r) {
2181
2181
  var e = r + "";
2182
2182
  return e == "0" && 1 / r == -1 / 0 ? "-0" : e;
2183
2183
  }
2184
- var pd = /\s/;
2185
- function fd(r) {
2186
- for (var e = r.length; e-- && pd.test(r.charAt(e)); )
2184
+ var fd = /\s/;
2185
+ function md(r) {
2186
+ for (var e = r.length; e-- && fd.test(r.charAt(e)); )
2187
2187
  ;
2188
2188
  return e;
2189
2189
  }
2190
- var md = /^\s+/;
2191
- function _d(r) {
2192
- return r && r.slice(0, fd(r) + 1).replace(md, "");
2190
+ var _d = /^\s+/;
2191
+ function gd(r) {
2192
+ return r && r.slice(0, md(r) + 1).replace(_d, "");
2193
2193
  }
2194
2194
  function rr(r) {
2195
2195
  var e = typeof r;
2196
2196
  return r != null && (e == "object" || e == "function");
2197
2197
  }
2198
- var is = NaN, gd = /^[-+]0x[0-9a-f]+$/i, vd = /^0b[01]+$/i, yd = /^0o[0-7]+$/i, bd = parseInt;
2199
- function Sd(r) {
2198
+ var is = NaN, vd = /^[-+]0x[0-9a-f]+$/i, yd = /^0b[01]+$/i, bd = /^0o[0-7]+$/i, Sd = parseInt;
2199
+ function Ed(r) {
2200
2200
  if (typeof r == "number")
2201
2201
  return r;
2202
2202
  if (Zr(r))
@@ -2207,46 +2207,46 @@ function Sd(r) {
2207
2207
  }
2208
2208
  if (typeof r != "string")
2209
2209
  return r === 0 ? r : +r;
2210
- r = _d(r);
2211
- var t = vd.test(r);
2212
- return t || yd.test(r) ? bd(r.slice(2), t ? 2 : 8) : gd.test(r) ? is : +r;
2210
+ r = gd(r);
2211
+ var t = yd.test(r);
2212
+ return t || bd.test(r) ? Sd(r.slice(2), t ? 2 : 8) : vd.test(r) ? is : +r;
2213
2213
  }
2214
- var Ed = 1 / 0, Cd = 17976931348623157e292;
2215
- function wd(r) {
2214
+ var Cd = 1 / 0, wd = 17976931348623157e292;
2215
+ function Td(r) {
2216
2216
  if (!r)
2217
2217
  return r === 0 ? r : 0;
2218
- if (r = Sd(r), r === Ed || r === -1 / 0) {
2218
+ if (r = Ed(r), r === Cd || r === -1 / 0) {
2219
2219
  var e = r < 0 ? -1 : 1;
2220
- return e * Cd;
2220
+ return e * wd;
2221
2221
  }
2222
2222
  return r === r ? r : 0;
2223
2223
  }
2224
- function Td(r) {
2225
- var e = wd(r), t = e % 1;
2224
+ function zd(r) {
2225
+ var e = Td(r), t = e % 1;
2226
2226
  return e === e ? t ? e - t : e : 0;
2227
2227
  }
2228
- function zd(r) {
2228
+ function kd(r) {
2229
2229
  return r;
2230
2230
  }
2231
- var kd = "[object AsyncFunction]", Rd = "[object Function]", Ad = "[object GeneratorFunction]", Dd = "[object Proxy]";
2231
+ var Rd = "[object AsyncFunction]", Ad = "[object Function]", Dd = "[object GeneratorFunction]", xd = "[object Proxy]";
2232
2232
  function Yo(r) {
2233
2233
  if (!rr(r))
2234
2234
  return !1;
2235
2235
  var e = kt(r);
2236
- return e == Rd || e == Ad || e == kd || e == Dd;
2236
+ return e == Ad || e == Dd || e == Rd || e == xd;
2237
2237
  }
2238
2238
  var hi = Me["__core-js_shared__"], ns = function() {
2239
2239
  var r = /[^.]+$/.exec(hi && hi.keys && hi.keys.IE_PROTO || "");
2240
2240
  return r ? "Symbol(src)_1." + r : "";
2241
2241
  }();
2242
- function xd(r) {
2242
+ function Pd(r) {
2243
2243
  return !!ns && ns in r;
2244
2244
  }
2245
- var Pd = Function.prototype, Id = Pd.toString;
2245
+ var Id = Function.prototype, Od = Id.toString;
2246
2246
  function ut(r) {
2247
2247
  if (r != null) {
2248
2248
  try {
2249
- return Id.call(r);
2249
+ return Od.call(r);
2250
2250
  } catch {
2251
2251
  }
2252
2252
  try {
@@ -2256,144 +2256,144 @@ function ut(r) {
2256
2256
  }
2257
2257
  return "";
2258
2258
  }
2259
- var Od = /[\\^$.*+?()[\]{}|]/g, Md = /^\[object .+?Constructor\]$/, Ld = Function.prototype, Ud = Object.prototype, Nd = Ld.toString, Gd = Ud.hasOwnProperty, Bd = RegExp(
2260
- "^" + Nd.call(Gd).replace(Od, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
2259
+ var Md = /[\\^$.*+?()[\]{}|]/g, Ld = /^\[object .+?Constructor\]$/, Ud = Function.prototype, Nd = Object.prototype, Gd = Ud.toString, Bd = Nd.hasOwnProperty, Vd = RegExp(
2260
+ "^" + Gd.call(Bd).replace(Md, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
2261
2261
  );
2262
- function Vd(r) {
2263
- if (!rr(r) || xd(r))
2262
+ function Fd(r) {
2263
+ if (!rr(r) || Pd(r))
2264
2264
  return !1;
2265
- var e = Yo(r) ? Bd : Md;
2265
+ var e = Yo(r) ? Vd : Ld;
2266
2266
  return e.test(ut(r));
2267
2267
  }
2268
- function Fd(r, e) {
2268
+ function jd(r, e) {
2269
2269
  return r == null ? void 0 : r[e];
2270
2270
  }
2271
2271
  function Rt(r, e) {
2272
- var t = Fd(r, e);
2273
- return Vd(t) ? t : void 0;
2272
+ var t = jd(r, e);
2273
+ return Fd(t) ? t : void 0;
2274
2274
  }
2275
2275
  var $i = Rt(Me, "WeakMap");
2276
- function jd(r, e, t, i) {
2276
+ function Hd(r, e, t, i) {
2277
2277
  for (var n = r.length, s = t + -1; ++s < n; )
2278
2278
  if (e(r[s], s, r))
2279
2279
  return s;
2280
2280
  return -1;
2281
2281
  }
2282
- var Hd = 9007199254740991, $d = /^(?:0|[1-9]\d*)$/;
2282
+ var $d = 9007199254740991, qd = /^(?:0|[1-9]\d*)$/;
2283
2283
  function Qo(r, e) {
2284
2284
  var t = typeof r;
2285
- return e = e ?? Hd, !!e && (t == "number" || t != "symbol" && $d.test(r)) && r > -1 && r % 1 == 0 && r < e;
2285
+ return e = e ?? $d, !!e && (t == "number" || t != "symbol" && qd.test(r)) && r > -1 && r % 1 == 0 && r < e;
2286
2286
  }
2287
2287
  function ea(r, e) {
2288
2288
  return r === e || r !== r && e !== e;
2289
2289
  }
2290
- var qd = 9007199254740991;
2290
+ var Kd = 9007199254740991;
2291
2291
  function _n(r) {
2292
- return typeof r == "number" && r > -1 && r % 1 == 0 && r <= qd;
2292
+ return typeof r == "number" && r > -1 && r % 1 == 0 && r <= Kd;
2293
2293
  }
2294
2294
  function Xr(r) {
2295
2295
  return r != null && _n(r.length) && !Yo(r);
2296
2296
  }
2297
- var Kd = Object.prototype;
2297
+ var Wd = Object.prototype;
2298
2298
  function ta(r) {
2299
- var e = r && r.constructor, t = typeof e == "function" && e.prototype || Kd;
2299
+ var e = r && r.constructor, t = typeof e == "function" && e.prototype || Wd;
2300
2300
  return r === t;
2301
2301
  }
2302
- function Wd(r, e) {
2302
+ function Jd(r, e) {
2303
2303
  for (var t = -1, i = Array(r); ++t < r; )
2304
2304
  i[t] = e(t);
2305
2305
  return i;
2306
2306
  }
2307
- var Jd = "[object Arguments]";
2307
+ var Zd = "[object Arguments]";
2308
2308
  function ss(r) {
2309
- return wt(r) && kt(r) == Jd;
2309
+ return wt(r) && kt(r) == Zd;
2310
2310
  }
2311
- var ra = Object.prototype, Zd = ra.hasOwnProperty, Xd = ra.propertyIsEnumerable, gn = ss(/* @__PURE__ */ function() {
2311
+ var ra = Object.prototype, Xd = ra.hasOwnProperty, Yd = ra.propertyIsEnumerable, gn = ss(/* @__PURE__ */ function() {
2312
2312
  return arguments;
2313
2313
  }()) ? ss : function(r) {
2314
- return wt(r) && Zd.call(r, "callee") && !Xd.call(r, "callee");
2314
+ return wt(r) && Xd.call(r, "callee") && !Yd.call(r, "callee");
2315
2315
  };
2316
- function Yd() {
2316
+ function Qd() {
2317
2317
  return !1;
2318
2318
  }
2319
- var ia = typeof exports == "object" && exports && !exports.nodeType && exports, os = ia && typeof module == "object" && module && !module.nodeType && module, Qd = os && os.exports === ia, as = Qd ? Me.Buffer : void 0, eh = as ? as.isBuffer : void 0, Pr = eh || Yd, th = "[object Arguments]", rh = "[object Array]", ih = "[object Boolean]", nh = "[object Date]", sh = "[object Error]", oh = "[object Function]", ah = "[object Map]", ch = "[object Number]", uh = "[object Object]", dh = "[object RegExp]", hh = "[object Set]", lh = "[object String]", ph = "[object WeakMap]", fh = "[object ArrayBuffer]", mh = "[object DataView]", _h = "[object Float32Array]", gh = "[object Float64Array]", vh = "[object Int8Array]", yh = "[object Int16Array]", bh = "[object Int32Array]", Sh = "[object Uint8Array]", Eh = "[object Uint8ClampedArray]", Ch = "[object Uint16Array]", wh = "[object Uint32Array]", j = {};
2320
- j[_h] = j[gh] = j[vh] = j[yh] = j[bh] = j[Sh] = j[Eh] = j[Ch] = j[wh] = !0;
2321
- j[th] = j[rh] = j[fh] = j[ih] = j[mh] = j[nh] = j[sh] = j[oh] = j[ah] = j[ch] = j[uh] = j[dh] = j[hh] = j[lh] = j[ph] = !1;
2322
- function Th(r) {
2319
+ var ia = typeof exports == "object" && exports && !exports.nodeType && exports, os = ia && typeof module == "object" && module && !module.nodeType && module, eh = os && os.exports === ia, as = eh ? Me.Buffer : void 0, th = as ? as.isBuffer : void 0, Pr = th || Qd, rh = "[object Arguments]", ih = "[object Array]", nh = "[object Boolean]", sh = "[object Date]", oh = "[object Error]", ah = "[object Function]", ch = "[object Map]", uh = "[object Number]", dh = "[object Object]", hh = "[object RegExp]", lh = "[object Set]", ph = "[object String]", fh = "[object WeakMap]", mh = "[object ArrayBuffer]", _h = "[object DataView]", gh = "[object Float32Array]", vh = "[object Float64Array]", yh = "[object Int8Array]", bh = "[object Int16Array]", Sh = "[object Int32Array]", Eh = "[object Uint8Array]", Ch = "[object Uint8ClampedArray]", wh = "[object Uint16Array]", Th = "[object Uint32Array]", j = {};
2320
+ j[gh] = j[vh] = j[yh] = j[bh] = j[Sh] = j[Eh] = j[Ch] = j[wh] = j[Th] = !0;
2321
+ j[rh] = j[ih] = j[mh] = j[nh] = j[_h] = j[sh] = j[oh] = j[ah] = j[ch] = j[uh] = j[dh] = j[hh] = j[lh] = j[ph] = j[fh] = !1;
2322
+ function zh(r) {
2323
2323
  return wt(r) && _n(r.length) && !!j[kt(r)];
2324
2324
  }
2325
- function zh(r) {
2325
+ function kh(r) {
2326
2326
  return function(e) {
2327
2327
  return r(e);
2328
2328
  };
2329
2329
  }
2330
- var na = typeof exports == "object" && exports && !exports.nodeType && exports, $t = na && typeof module == "object" && module && !module.nodeType && module, kh = $t && $t.exports === na, li = kh && Wo.process, cs = function() {
2330
+ var na = typeof exports == "object" && exports && !exports.nodeType && exports, $t = na && typeof module == "object" && module && !module.nodeType && module, Rh = $t && $t.exports === na, li = Rh && Wo.process, cs = function() {
2331
2331
  try {
2332
2332
  var r = $t && $t.require && $t.require("util").types;
2333
2333
  return r || li && li.binding && li.binding("util");
2334
2334
  } catch {
2335
2335
  }
2336
- }(), us = cs && cs.isTypedArray, vn = us ? zh(us) : Th, Rh = Object.prototype, Ah = Rh.hasOwnProperty;
2337
- function Dh(r, e) {
2338
- var t = X(r), i = !t && gn(r), n = !t && !i && Pr(r), s = !t && !i && !n && vn(r), a = t || i || n || s, o = a ? Wd(r.length, String) : [], d = o.length;
2336
+ }(), us = cs && cs.isTypedArray, vn = us ? kh(us) : zh, Ah = Object.prototype, Dh = Ah.hasOwnProperty;
2337
+ function xh(r, e) {
2338
+ var t = X(r), i = !t && gn(r), n = !t && !i && Pr(r), s = !t && !i && !n && vn(r), a = t || i || n || s, o = a ? Jd(r.length, String) : [], d = o.length;
2339
2339
  for (var c in r)
2340
- Ah.call(r, c) && !(a && // Safari 9 has enumerable `arguments.length` in strict mode.
2340
+ Dh.call(r, c) && !(a && // Safari 9 has enumerable `arguments.length` in strict mode.
2341
2341
  (c == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
2342
2342
  n && (c == "offset" || c == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
2343
2343
  s && (c == "buffer" || c == "byteLength" || c == "byteOffset") || // Skip index properties.
2344
2344
  Qo(c, d))) && o.push(c);
2345
2345
  return o;
2346
2346
  }
2347
- function xh(r, e) {
2347
+ function Ph(r, e) {
2348
2348
  return function(t) {
2349
2349
  return r(e(t));
2350
2350
  };
2351
2351
  }
2352
- var Ph = xh(Object.keys, Object), Ih = Object.prototype, Oh = Ih.hasOwnProperty;
2352
+ var Ih = Ph(Object.keys, Object), Oh = Object.prototype, Mh = Oh.hasOwnProperty;
2353
2353
  function sa(r) {
2354
2354
  if (!ta(r))
2355
- return Ph(r);
2355
+ return Ih(r);
2356
2356
  var e = [];
2357
2357
  for (var t in Object(r))
2358
- Oh.call(r, t) && t != "constructor" && e.push(t);
2358
+ Mh.call(r, t) && t != "constructor" && e.push(t);
2359
2359
  return e;
2360
2360
  }
2361
2361
  function lr(r) {
2362
- return Xr(r) ? Dh(r) : sa(r);
2362
+ return Xr(r) ? xh(r) : sa(r);
2363
2363
  }
2364
- var Mh = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, Lh = /^\w*$/;
2364
+ var Lh = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, Uh = /^\w*$/;
2365
2365
  function yn(r, e) {
2366
2366
  if (X(r))
2367
2367
  return !1;
2368
2368
  var t = typeof r;
2369
- return t == "number" || t == "symbol" || t == "boolean" || r == null || Zr(r) ? !0 : Lh.test(r) || !Mh.test(r) || e != null && r in Object(e);
2369
+ return t == "number" || t == "symbol" || t == "boolean" || r == null || Zr(r) ? !0 : Uh.test(r) || !Lh.test(r) || e != null && r in Object(e);
2370
2370
  }
2371
2371
  var ir = Rt(Object, "create");
2372
- function Uh() {
2372
+ function Nh() {
2373
2373
  this.__data__ = ir ? ir(null) : {}, this.size = 0;
2374
2374
  }
2375
- function Nh(r) {
2375
+ function Gh(r) {
2376
2376
  var e = this.has(r) && delete this.__data__[r];
2377
2377
  return this.size -= e ? 1 : 0, e;
2378
2378
  }
2379
- var Gh = "__lodash_hash_undefined__", Bh = Object.prototype, Vh = Bh.hasOwnProperty;
2380
- function Fh(r) {
2379
+ var Bh = "__lodash_hash_undefined__", Vh = Object.prototype, Fh = Vh.hasOwnProperty;
2380
+ function jh(r) {
2381
2381
  var e = this.__data__;
2382
2382
  if (ir) {
2383
2383
  var t = e[r];
2384
- return t === Gh ? void 0 : t;
2384
+ return t === Bh ? void 0 : t;
2385
2385
  }
2386
- return Vh.call(e, r) ? e[r] : void 0;
2386
+ return Fh.call(e, r) ? e[r] : void 0;
2387
2387
  }
2388
- var jh = Object.prototype, Hh = jh.hasOwnProperty;
2389
- function $h(r) {
2388
+ var Hh = Object.prototype, $h = Hh.hasOwnProperty;
2389
+ function qh(r) {
2390
2390
  var e = this.__data__;
2391
- return ir ? e[r] !== void 0 : Hh.call(e, r);
2391
+ return ir ? e[r] !== void 0 : $h.call(e, r);
2392
2392
  }
2393
- var qh = "__lodash_hash_undefined__";
2394
- function Kh(r, e) {
2393
+ var Kh = "__lodash_hash_undefined__";
2394
+ function Wh(r, e) {
2395
2395
  var t = this.__data__;
2396
- return this.size += this.has(r) ? 0 : 1, t[r] = ir && e === void 0 ? qh : e, this;
2396
+ return this.size += this.has(r) ? 0 : 1, t[r] = ir && e === void 0 ? Kh : e, this;
2397
2397
  }
2398
2398
  function st(r) {
2399
2399
  var e = -1, t = r == null ? 0 : r.length;
@@ -2402,12 +2402,12 @@ function st(r) {
2402
2402
  this.set(i[0], i[1]);
2403
2403
  }
2404
2404
  }
2405
- st.prototype.clear = Uh;
2406
- st.prototype.delete = Nh;
2407
- st.prototype.get = Fh;
2408
- st.prototype.has = $h;
2409
- st.prototype.set = Kh;
2410
- function Wh() {
2405
+ st.prototype.clear = Nh;
2406
+ st.prototype.delete = Gh;
2407
+ st.prototype.get = jh;
2408
+ st.prototype.has = qh;
2409
+ st.prototype.set = Wh;
2410
+ function Jh() {
2411
2411
  this.__data__ = [], this.size = 0;
2412
2412
  }
2413
2413
  function Yr(r, e) {
@@ -2416,22 +2416,22 @@ function Yr(r, e) {
2416
2416
  return t;
2417
2417
  return -1;
2418
2418
  }
2419
- var Jh = Array.prototype, Zh = Jh.splice;
2420
- function Xh(r) {
2419
+ var Zh = Array.prototype, Xh = Zh.splice;
2420
+ function Yh(r) {
2421
2421
  var e = this.__data__, t = Yr(e, r);
2422
2422
  if (t < 0)
2423
2423
  return !1;
2424
2424
  var i = e.length - 1;
2425
- return t == i ? e.pop() : Zh.call(e, t, 1), --this.size, !0;
2425
+ return t == i ? e.pop() : Xh.call(e, t, 1), --this.size, !0;
2426
2426
  }
2427
- function Yh(r) {
2427
+ function Qh(r) {
2428
2428
  var e = this.__data__, t = Yr(e, r);
2429
2429
  return t < 0 ? void 0 : e[t][1];
2430
2430
  }
2431
- function Qh(r) {
2431
+ function el(r) {
2432
2432
  return Yr(this.__data__, r) > -1;
2433
2433
  }
2434
- function el(r, e) {
2434
+ function tl(r, e) {
2435
2435
  var t = this.__data__, i = Yr(t, r);
2436
2436
  return i < 0 ? (++this.size, t.push([r, e])) : t[i][1] = e, this;
2437
2437
  }
@@ -2442,38 +2442,38 @@ function Le(r) {
2442
2442
  this.set(i[0], i[1]);
2443
2443
  }
2444
2444
  }
2445
- Le.prototype.clear = Wh;
2446
- Le.prototype.delete = Xh;
2447
- Le.prototype.get = Yh;
2448
- Le.prototype.has = Qh;
2449
- Le.prototype.set = el;
2445
+ Le.prototype.clear = Jh;
2446
+ Le.prototype.delete = Yh;
2447
+ Le.prototype.get = Qh;
2448
+ Le.prototype.has = el;
2449
+ Le.prototype.set = tl;
2450
2450
  var nr = Rt(Me, "Map");
2451
- function tl() {
2451
+ function rl() {
2452
2452
  this.size = 0, this.__data__ = {
2453
2453
  hash: new st(),
2454
2454
  map: new (nr || Le)(),
2455
2455
  string: new st()
2456
2456
  };
2457
2457
  }
2458
- function rl(r) {
2458
+ function il(r) {
2459
2459
  var e = typeof r;
2460
2460
  return e == "string" || e == "number" || e == "symbol" || e == "boolean" ? r !== "__proto__" : r === null;
2461
2461
  }
2462
2462
  function Qr(r, e) {
2463
2463
  var t = r.__data__;
2464
- return rl(e) ? t[typeof e == "string" ? "string" : "hash"] : t.map;
2464
+ return il(e) ? t[typeof e == "string" ? "string" : "hash"] : t.map;
2465
2465
  }
2466
- function il(r) {
2466
+ function nl(r) {
2467
2467
  var e = Qr(this, r).delete(r);
2468
2468
  return this.size -= e ? 1 : 0, e;
2469
2469
  }
2470
- function nl(r) {
2470
+ function sl(r) {
2471
2471
  return Qr(this, r).get(r);
2472
2472
  }
2473
- function sl(r) {
2473
+ function ol(r) {
2474
2474
  return Qr(this, r).has(r);
2475
2475
  }
2476
- function ol(r, e) {
2476
+ function al(r, e) {
2477
2477
  var t = Qr(this, r), i = t.size;
2478
2478
  return t.set(r, e), this.size += t.size == i ? 0 : 1, this;
2479
2479
  }
@@ -2484,15 +2484,15 @@ function Ue(r) {
2484
2484
  this.set(i[0], i[1]);
2485
2485
  }
2486
2486
  }
2487
- Ue.prototype.clear = tl;
2488
- Ue.prototype.delete = il;
2489
- Ue.prototype.get = nl;
2490
- Ue.prototype.has = sl;
2491
- Ue.prototype.set = ol;
2492
- var al = "Expected a function";
2487
+ Ue.prototype.clear = rl;
2488
+ Ue.prototype.delete = nl;
2489
+ Ue.prototype.get = sl;
2490
+ Ue.prototype.has = ol;
2491
+ Ue.prototype.set = al;
2492
+ var cl = "Expected a function";
2493
2493
  function bn(r, e) {
2494
2494
  if (typeof r != "function" || e != null && typeof e != "function")
2495
- throw new TypeError(al);
2495
+ throw new TypeError(cl);
2496
2496
  var t = function() {
2497
2497
  var i = arguments, n = e ? e.apply(this, i) : i[0], s = t.cache;
2498
2498
  if (s.has(n))
@@ -2503,24 +2503,24 @@ function bn(r, e) {
2503
2503
  return t.cache = new (bn.Cache || Ue)(), t;
2504
2504
  }
2505
2505
  bn.Cache = Ue;
2506
- var cl = 500;
2507
- function ul(r) {
2506
+ var ul = 500;
2507
+ function dl(r) {
2508
2508
  var e = bn(r, function(i) {
2509
- return t.size === cl && t.clear(), i;
2509
+ return t.size === ul && t.clear(), i;
2510
2510
  }), t = e.cache;
2511
2511
  return e;
2512
2512
  }
2513
- var dl = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, hl = /\\(\\)?/g, ll = ul(function(r) {
2513
+ var hl = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, ll = /\\(\\)?/g, pl = dl(function(r) {
2514
2514
  var e = [];
2515
- return r.charCodeAt(0) === 46 && e.push(""), r.replace(dl, function(t, i, n, s) {
2516
- e.push(n ? s.replace(hl, "$1") : i || t);
2515
+ return r.charCodeAt(0) === 46 && e.push(""), r.replace(hl, function(t, i, n, s) {
2516
+ e.push(n ? s.replace(ll, "$1") : i || t);
2517
2517
  }), e;
2518
2518
  });
2519
- function pl(r) {
2519
+ function fl(r) {
2520
2520
  return r == null ? "" : Xo(r);
2521
2521
  }
2522
2522
  function oa(r, e) {
2523
- return X(r) ? r : yn(r, e) ? [r] : ll(pl(r));
2523
+ return X(r) ? r : yn(r, e) ? [r] : pl(fl(r));
2524
2524
  }
2525
2525
  function ei(r) {
2526
2526
  if (typeof r == "string" || Zr(r))
@@ -2534,34 +2534,34 @@ function aa(r, e) {
2534
2534
  r = r[ei(e[t++])];
2535
2535
  return t && t == i ? r : void 0;
2536
2536
  }
2537
- function fl(r, e, t) {
2537
+ function ml(r, e, t) {
2538
2538
  var i = r == null ? void 0 : aa(r, e);
2539
2539
  return i === void 0 ? t : i;
2540
2540
  }
2541
- function ml(r, e) {
2541
+ function _l(r, e) {
2542
2542
  for (var t = -1, i = e.length, n = r.length; ++t < i; )
2543
2543
  r[n + t] = e[t];
2544
2544
  return r;
2545
2545
  }
2546
- function _l() {
2546
+ function gl() {
2547
2547
  this.__data__ = new Le(), this.size = 0;
2548
2548
  }
2549
- function gl(r) {
2549
+ function vl(r) {
2550
2550
  var e = this.__data__, t = e.delete(r);
2551
2551
  return this.size = e.size, t;
2552
2552
  }
2553
- function vl(r) {
2553
+ function yl(r) {
2554
2554
  return this.__data__.get(r);
2555
2555
  }
2556
- function yl(r) {
2556
+ function bl(r) {
2557
2557
  return this.__data__.has(r);
2558
2558
  }
2559
- var bl = 200;
2560
- function Sl(r, e) {
2559
+ var Sl = 200;
2560
+ function El(r, e) {
2561
2561
  var t = this.__data__;
2562
2562
  if (t instanceof Le) {
2563
2563
  var i = t.__data__;
2564
- if (!nr || i.length < bl - 1)
2564
+ if (!nr || i.length < Sl - 1)
2565
2565
  return i.push([r, e]), this.size = ++t.size, this;
2566
2566
  t = this.__data__ = new Ue(i);
2567
2567
  }
@@ -2571,11 +2571,11 @@ function Pe(r) {
2571
2571
  var e = this.__data__ = new Le(r);
2572
2572
  this.size = e.size;
2573
2573
  }
2574
- Pe.prototype.clear = _l;
2575
- Pe.prototype.delete = gl;
2576
- Pe.prototype.get = vl;
2577
- Pe.prototype.has = yl;
2578
- Pe.prototype.set = Sl;
2574
+ Pe.prototype.clear = gl;
2575
+ Pe.prototype.delete = vl;
2576
+ Pe.prototype.get = yl;
2577
+ Pe.prototype.has = bl;
2578
+ Pe.prototype.set = El;
2579
2579
  function ca(r, e) {
2580
2580
  for (var t = -1, i = r == null ? 0 : r.length, n = 0, s = []; ++t < i; ) {
2581
2581
  var a = r[t];
@@ -2583,44 +2583,44 @@ function ca(r, e) {
2583
2583
  }
2584
2584
  return s;
2585
2585
  }
2586
- function El() {
2586
+ function Cl() {
2587
2587
  return [];
2588
2588
  }
2589
- var Cl = Object.prototype, wl = Cl.propertyIsEnumerable, ds = Object.getOwnPropertySymbols, Tl = ds ? function(r) {
2589
+ var wl = Object.prototype, Tl = wl.propertyIsEnumerable, ds = Object.getOwnPropertySymbols, zl = ds ? function(r) {
2590
2590
  return r == null ? [] : (r = Object(r), ca(ds(r), function(e) {
2591
- return wl.call(r, e);
2591
+ return Tl.call(r, e);
2592
2592
  }));
2593
- } : El;
2594
- function zl(r, e, t) {
2593
+ } : Cl;
2594
+ function kl(r, e, t) {
2595
2595
  var i = e(r);
2596
- return X(r) ? i : ml(i, t(r));
2596
+ return X(r) ? i : _l(i, t(r));
2597
2597
  }
2598
2598
  function hs(r) {
2599
- return zl(r, lr, Tl);
2599
+ return kl(r, lr, zl);
2600
2600
  }
2601
- var qi = Rt(Me, "DataView"), Ki = Rt(Me, "Promise"), Wi = Rt(Me, "Set"), ls = "[object Map]", kl = "[object Object]", ps = "[object Promise]", fs = "[object Set]", ms = "[object WeakMap]", _s = "[object DataView]", Rl = ut(qi), Al = ut(nr), Dl = ut(Ki), xl = ut(Wi), Pl = ut($i), De = kt;
2601
+ var qi = Rt(Me, "DataView"), Ki = Rt(Me, "Promise"), Wi = Rt(Me, "Set"), ls = "[object Map]", Rl = "[object Object]", ps = "[object Promise]", fs = "[object Set]", ms = "[object WeakMap]", _s = "[object DataView]", Al = ut(qi), Dl = ut(nr), xl = ut(Ki), Pl = ut(Wi), Il = ut($i), De = kt;
2602
2602
  (qi && De(new qi(new ArrayBuffer(1))) != _s || nr && De(new nr()) != ls || Ki && De(Ki.resolve()) != ps || Wi && De(new Wi()) != fs || $i && De(new $i()) != ms) && (De = function(r) {
2603
- var e = kt(r), t = e == kl ? r.constructor : void 0, i = t ? ut(t) : "";
2603
+ var e = kt(r), t = e == Rl ? r.constructor : void 0, i = t ? ut(t) : "";
2604
2604
  if (i)
2605
2605
  switch (i) {
2606
- case Rl:
2607
- return _s;
2608
2606
  case Al:
2609
- return ls;
2607
+ return _s;
2610
2608
  case Dl:
2611
- return ps;
2609
+ return ls;
2612
2610
  case xl:
2613
- return fs;
2611
+ return ps;
2614
2612
  case Pl:
2613
+ return fs;
2614
+ case Il:
2615
2615
  return ms;
2616
2616
  }
2617
2617
  return e;
2618
2618
  });
2619
- var gs = Me.Uint8Array, Il = "__lodash_hash_undefined__";
2620
- function Ol(r) {
2621
- return this.__data__.set(r, Il), this;
2622
- }
2619
+ var gs = Me.Uint8Array, Ol = "__lodash_hash_undefined__";
2623
2620
  function Ml(r) {
2621
+ return this.__data__.set(r, Ol), this;
2622
+ }
2623
+ function Ll(r) {
2624
2624
  return this.__data__.has(r);
2625
2625
  }
2626
2626
  function Ir(r) {
@@ -2628,26 +2628,26 @@ function Ir(r) {
2628
2628
  for (this.__data__ = new Ue(); ++e < t; )
2629
2629
  this.add(r[e]);
2630
2630
  }
2631
- Ir.prototype.add = Ir.prototype.push = Ol;
2632
- Ir.prototype.has = Ml;
2633
- function Ll(r, e) {
2631
+ Ir.prototype.add = Ir.prototype.push = Ml;
2632
+ Ir.prototype.has = Ll;
2633
+ function Ul(r, e) {
2634
2634
  for (var t = -1, i = r == null ? 0 : r.length; ++t < i; )
2635
2635
  if (e(r[t], t, r))
2636
2636
  return !0;
2637
2637
  return !1;
2638
2638
  }
2639
- function Ul(r, e) {
2639
+ function Nl(r, e) {
2640
2640
  return r.has(e);
2641
2641
  }
2642
- var Nl = 1, Gl = 2;
2642
+ var Gl = 1, Bl = 2;
2643
2643
  function ua(r, e, t, i, n, s) {
2644
- var a = t & Nl, o = r.length, d = e.length;
2644
+ var a = t & Gl, o = r.length, d = e.length;
2645
2645
  if (o != d && !(a && d > o))
2646
2646
  return !1;
2647
2647
  var c = s.get(r), u = s.get(e);
2648
2648
  if (c && u)
2649
2649
  return c == e && u == r;
2650
- var l = -1, h = !0, p = t & Gl ? new Ir() : void 0;
2650
+ var l = -1, h = !0, p = t & Bl ? new Ir() : void 0;
2651
2651
  for (s.set(r, e), s.set(e, r); ++l < o; ) {
2652
2652
  var f = r[l], v = e[l];
2653
2653
  if (i)
@@ -2659,8 +2659,8 @@ function ua(r, e, t, i, n, s) {
2659
2659
  break;
2660
2660
  }
2661
2661
  if (p) {
2662
- if (!Ll(e, function(S, y) {
2663
- if (!Ul(p, y) && (f === S || n(f, S, t, i, s)))
2662
+ if (!Ul(e, function(S, y) {
2663
+ if (!Nl(p, y) && (f === S || n(f, S, t, i, s)))
2664
2664
  return p.push(y);
2665
2665
  })) {
2666
2666
  h = !1;
@@ -2673,62 +2673,62 @@ function ua(r, e, t, i, n, s) {
2673
2673
  }
2674
2674
  return s.delete(r), s.delete(e), h;
2675
2675
  }
2676
- function Bl(r) {
2676
+ function Vl(r) {
2677
2677
  var e = -1, t = Array(r.size);
2678
2678
  return r.forEach(function(i, n) {
2679
2679
  t[++e] = [n, i];
2680
2680
  }), t;
2681
2681
  }
2682
- function Vl(r) {
2682
+ function Fl(r) {
2683
2683
  var e = -1, t = Array(r.size);
2684
2684
  return r.forEach(function(i) {
2685
2685
  t[++e] = i;
2686
2686
  }), t;
2687
2687
  }
2688
- var Fl = 1, jl = 2, Hl = "[object Boolean]", $l = "[object Date]", ql = "[object Error]", Kl = "[object Map]", Wl = "[object Number]", Jl = "[object RegExp]", Zl = "[object Set]", Xl = "[object String]", Yl = "[object Symbol]", Ql = "[object ArrayBuffer]", ep = "[object DataView]", vs = Je ? Je.prototype : void 0, pi = vs ? vs.valueOf : void 0;
2689
- function tp(r, e, t, i, n, s, a) {
2688
+ var jl = 1, Hl = 2, $l = "[object Boolean]", ql = "[object Date]", Kl = "[object Error]", Wl = "[object Map]", Jl = "[object Number]", Zl = "[object RegExp]", Xl = "[object Set]", Yl = "[object String]", Ql = "[object Symbol]", ep = "[object ArrayBuffer]", tp = "[object DataView]", vs = Je ? Je.prototype : void 0, pi = vs ? vs.valueOf : void 0;
2689
+ function rp(r, e, t, i, n, s, a) {
2690
2690
  switch (t) {
2691
- case ep:
2691
+ case tp:
2692
2692
  if (r.byteLength != e.byteLength || r.byteOffset != e.byteOffset)
2693
2693
  return !1;
2694
2694
  r = r.buffer, e = e.buffer;
2695
- case Ql:
2695
+ case ep:
2696
2696
  return !(r.byteLength != e.byteLength || !s(new gs(r), new gs(e)));
2697
- case Hl:
2698
2697
  case $l:
2699
- case Wl:
2700
- return ea(+r, +e);
2701
2698
  case ql:
2702
- return r.name == e.name && r.message == e.message;
2703
2699
  case Jl:
2704
- case Xl:
2705
- return r == e + "";
2700
+ return ea(+r, +e);
2706
2701
  case Kl:
2707
- var o = Bl;
2702
+ return r.name == e.name && r.message == e.message;
2708
2703
  case Zl:
2709
- var d = i & Fl;
2710
- if (o || (o = Vl), r.size != e.size && !d)
2704
+ case Yl:
2705
+ return r == e + "";
2706
+ case Wl:
2707
+ var o = Vl;
2708
+ case Xl:
2709
+ var d = i & jl;
2710
+ if (o || (o = Fl), r.size != e.size && !d)
2711
2711
  return !1;
2712
2712
  var c = a.get(r);
2713
2713
  if (c)
2714
2714
  return c == e;
2715
- i |= jl, a.set(r, e);
2715
+ i |= Hl, a.set(r, e);
2716
2716
  var u = ua(o(r), o(e), i, n, s, a);
2717
2717
  return a.delete(r), u;
2718
- case Yl:
2718
+ case Ql:
2719
2719
  if (pi)
2720
2720
  return pi.call(r) == pi.call(e);
2721
2721
  }
2722
2722
  return !1;
2723
2723
  }
2724
- var rp = 1, ip = Object.prototype, np = ip.hasOwnProperty;
2725
- function sp(r, e, t, i, n, s) {
2726
- var a = t & rp, o = hs(r), d = o.length, c = hs(e), u = c.length;
2724
+ var ip = 1, np = Object.prototype, sp = np.hasOwnProperty;
2725
+ function op(r, e, t, i, n, s) {
2726
+ var a = t & ip, o = hs(r), d = o.length, c = hs(e), u = c.length;
2727
2727
  if (d != u && !a)
2728
2728
  return !1;
2729
2729
  for (var l = d; l--; ) {
2730
2730
  var h = o[l];
2731
- if (!(a ? h in e : np.call(e, h)))
2731
+ if (!(a ? h in e : sp.call(e, h)))
2732
2732
  return !1;
2733
2733
  }
2734
2734
  var p = s.get(r), f = s.get(e);
@@ -2753,8 +2753,8 @@ function sp(r, e, t, i, n, s) {
2753
2753
  }
2754
2754
  return s.delete(r), s.delete(e), v;
2755
2755
  }
2756
- var op = 1, ys = "[object Arguments]", bs = "[object Array]", vr = "[object Object]", ap = Object.prototype, Ss = ap.hasOwnProperty;
2757
- function cp(r, e, t, i, n, s) {
2756
+ var ap = 1, ys = "[object Arguments]", bs = "[object Array]", vr = "[object Object]", cp = Object.prototype, Ss = cp.hasOwnProperty;
2757
+ function up(r, e, t, i, n, s) {
2758
2758
  var a = X(r), o = X(e), d = a ? bs : De(r), c = o ? bs : De(e);
2759
2759
  d = d == ys ? vr : d, c = c == ys ? vr : c;
2760
2760
  var u = d == vr, l = c == vr, h = d == c;
@@ -2764,21 +2764,21 @@ function cp(r, e, t, i, n, s) {
2764
2764
  a = !0, u = !1;
2765
2765
  }
2766
2766
  if (h && !u)
2767
- return s || (s = new Pe()), a || vn(r) ? ua(r, e, t, i, n, s) : tp(r, e, d, t, i, n, s);
2768
- if (!(t & op)) {
2767
+ return s || (s = new Pe()), a || vn(r) ? ua(r, e, t, i, n, s) : rp(r, e, d, t, i, n, s);
2768
+ if (!(t & ap)) {
2769
2769
  var p = u && Ss.call(r, "__wrapped__"), f = l && Ss.call(e, "__wrapped__");
2770
2770
  if (p || f) {
2771
2771
  var v = p ? r.value() : r, m = f ? e.value() : e;
2772
2772
  return s || (s = new Pe()), n(v, m, t, i, s);
2773
2773
  }
2774
2774
  }
2775
- return h ? (s || (s = new Pe()), sp(r, e, t, i, n, s)) : !1;
2775
+ return h ? (s || (s = new Pe()), op(r, e, t, i, n, s)) : !1;
2776
2776
  }
2777
2777
  function Sn(r, e, t, i, n) {
2778
- return r === e ? !0 : r == null || e == null || !wt(r) && !wt(e) ? r !== r && e !== e : cp(r, e, t, i, Sn, n);
2778
+ return r === e ? !0 : r == null || e == null || !wt(r) && !wt(e) ? r !== r && e !== e : up(r, e, t, i, Sn, n);
2779
2779
  }
2780
- var up = 1, dp = 2;
2781
- function hp(r, e, t, i) {
2780
+ var dp = 1, hp = 2;
2781
+ function lp(r, e, t, i) {
2782
2782
  var n = t.length, s = n;
2783
2783
  if (r == null)
2784
2784
  return !s;
@@ -2795,7 +2795,7 @@ function hp(r, e, t, i) {
2795
2795
  return !1;
2796
2796
  } else {
2797
2797
  var u = new Pe(), l;
2798
- if (!(l === void 0 ? Sn(c, d, up | dp, i, u) : l))
2798
+ if (!(l === void 0 ? Sn(c, d, dp | hp, i, u) : l))
2799
2799
  return !1;
2800
2800
  }
2801
2801
  }
@@ -2804,7 +2804,7 @@ function hp(r, e, t, i) {
2804
2804
  function da(r) {
2805
2805
  return r === r && !rr(r);
2806
2806
  }
2807
- function lp(r) {
2807
+ function pp(r) {
2808
2808
  for (var e = lr(r), t = e.length; t--; ) {
2809
2809
  var i = e[t], n = r[i];
2810
2810
  e[t] = [i, n, da(n)];
@@ -2816,16 +2816,16 @@ function ha(r, e) {
2816
2816
  return t == null ? !1 : t[r] === e && (e !== void 0 || r in Object(t));
2817
2817
  };
2818
2818
  }
2819
- function pp(r) {
2820
- var e = lp(r);
2819
+ function fp(r) {
2820
+ var e = pp(r);
2821
2821
  return e.length == 1 && e[0][2] ? ha(e[0][0], e[0][1]) : function(t) {
2822
- return t === r || hp(t, r, e);
2822
+ return t === r || lp(t, r, e);
2823
2823
  };
2824
2824
  }
2825
- function fp(r, e) {
2825
+ function mp(r, e) {
2826
2826
  return r != null && e in Object(r);
2827
2827
  }
2828
- function mp(r, e, t) {
2828
+ function _p(r, e, t) {
2829
2829
  e = oa(e, r);
2830
2830
  for (var i = -1, n = e.length, s = !1; ++i < n; ) {
2831
2831
  var a = ei(e[i]);
@@ -2835,33 +2835,33 @@ function mp(r, e, t) {
2835
2835
  }
2836
2836
  return s || ++i != n ? s : (n = r == null ? 0 : r.length, !!n && _n(n) && Qo(a, n) && (X(r) || gn(r)));
2837
2837
  }
2838
- function _p(r, e) {
2839
- return r != null && mp(r, e, fp);
2838
+ function gp(r, e) {
2839
+ return r != null && _p(r, e, mp);
2840
2840
  }
2841
- var gp = 1, vp = 2;
2842
- function yp(r, e) {
2841
+ var vp = 1, yp = 2;
2842
+ function bp(r, e) {
2843
2843
  return yn(r) && da(e) ? ha(ei(r), e) : function(t) {
2844
- var i = fl(t, r);
2845
- return i === void 0 && i === e ? _p(t, r) : Sn(e, i, gp | vp);
2844
+ var i = ml(t, r);
2845
+ return i === void 0 && i === e ? gp(t, r) : Sn(e, i, vp | yp);
2846
2846
  };
2847
2847
  }
2848
- function bp(r) {
2848
+ function Sp(r) {
2849
2849
  return function(e) {
2850
2850
  return e == null ? void 0 : e[r];
2851
2851
  };
2852
2852
  }
2853
- function Sp(r) {
2853
+ function Ep(r) {
2854
2854
  return function(e) {
2855
2855
  return aa(e, r);
2856
2856
  };
2857
2857
  }
2858
- function Ep(r) {
2859
- return yn(r) ? bp(ei(r)) : Sp(r);
2858
+ function Cp(r) {
2859
+ return yn(r) ? Sp(ei(r)) : Ep(r);
2860
2860
  }
2861
2861
  function En(r) {
2862
- return typeof r == "function" ? r : r == null ? zd : typeof r == "object" ? X(r) ? yp(r[0], r[1]) : pp(r) : Ep(r);
2862
+ return typeof r == "function" ? r : r == null ? kd : typeof r == "object" ? X(r) ? bp(r[0], r[1]) : fp(r) : Cp(r);
2863
2863
  }
2864
- function Cp(r) {
2864
+ function wp(r) {
2865
2865
  return function(e, t, i) {
2866
2866
  for (var n = -1, s = Object(e), a = i(e), o = a.length; o--; ) {
2867
2867
  var d = a[++n];
@@ -2871,11 +2871,11 @@ function Cp(r) {
2871
2871
  return e;
2872
2872
  };
2873
2873
  }
2874
- var wp = Cp();
2875
- function Tp(r, e) {
2876
- return r && wp(r, e, lr);
2877
- }
2874
+ var Tp = wp();
2878
2875
  function zp(r, e) {
2876
+ return r && Tp(r, e, lr);
2877
+ }
2878
+ function kp(r, e) {
2879
2879
  return function(t, i) {
2880
2880
  if (t == null)
2881
2881
  return t;
@@ -2886,18 +2886,18 @@ function zp(r, e) {
2886
2886
  return t;
2887
2887
  };
2888
2888
  }
2889
- var kp = zp(Tp);
2890
- function Rp(r, e) {
2889
+ var Rp = kp(zp);
2890
+ function Ap(r, e) {
2891
2891
  var t = [];
2892
- return kp(r, function(i, n, s) {
2892
+ return Rp(r, function(i, n, s) {
2893
2893
  e(i, n, s) && t.push(i);
2894
2894
  }), t;
2895
2895
  }
2896
2896
  function la(r, e) {
2897
- var t = X(r) ? ca : Rp;
2897
+ var t = X(r) ? ca : Ap;
2898
2898
  return t(r, En(e));
2899
2899
  }
2900
- function Ap(r) {
2900
+ function Dp(r) {
2901
2901
  return function(e, t, i) {
2902
2902
  var n = Object(e);
2903
2903
  if (!Xr(e)) {
@@ -2910,43 +2910,43 @@ function Ap(r) {
2910
2910
  return a > -1 ? n[s ? e[a] : a] : void 0;
2911
2911
  };
2912
2912
  }
2913
- var Dp = Math.max;
2914
- function xp(r, e, t) {
2913
+ var xp = Math.max;
2914
+ function Pp(r, e, t) {
2915
2915
  var i = r == null ? 0 : r.length;
2916
2916
  if (!i)
2917
2917
  return -1;
2918
- var n = t == null ? 0 : Td(t);
2919
- return n < 0 && (n = Dp(i + n, 0)), jd(r, En(e), n);
2918
+ var n = t == null ? 0 : zd(t);
2919
+ return n < 0 && (n = xp(i + n, 0)), Hd(r, En(e), n);
2920
2920
  }
2921
- var sr = Ap(xp);
2922
- function Pp(r, e) {
2921
+ var sr = Dp(Pp);
2922
+ function Ip(r, e) {
2923
2923
  return Zo(e, function(t) {
2924
2924
  return r[t];
2925
2925
  });
2926
2926
  }
2927
2927
  function ke(r) {
2928
- return r == null ? [] : Pp(r, lr(r));
2928
+ return r == null ? [] : Ip(r, lr(r));
2929
2929
  }
2930
- var Ip = "[object Map]", Op = "[object Set]", Mp = Object.prototype, Lp = Mp.hasOwnProperty;
2931
- function Up(r) {
2930
+ var Op = "[object Map]", Mp = "[object Set]", Lp = Object.prototype, Up = Lp.hasOwnProperty;
2931
+ function Np(r) {
2932
2932
  if (r == null)
2933
2933
  return !0;
2934
2934
  if (Xr(r) && (X(r) || typeof r == "string" || typeof r.splice == "function" || Pr(r) || vn(r) || gn(r)))
2935
2935
  return !r.length;
2936
2936
  var e = De(r);
2937
- if (e == Ip || e == Op)
2937
+ if (e == Op || e == Mp)
2938
2938
  return !r.size;
2939
2939
  if (ta(r))
2940
2940
  return !sa(r).length;
2941
2941
  for (var t in r)
2942
- if (Lp.call(r, t))
2942
+ if (Up.call(r, t))
2943
2943
  return !1;
2944
2944
  return !0;
2945
2945
  }
2946
- function Np(r) {
2946
+ function Gp(r) {
2947
2947
  return r == null;
2948
2948
  }
2949
- class Gp extends Jr {
2949
+ class Bp extends Jr {
2950
2950
  constructor(e) {
2951
2951
  super({
2952
2952
  type: G.Microphone,
@@ -2966,7 +2966,7 @@ class Gp extends Jr {
2966
2966
  this.source.destroy();
2967
2967
  }
2968
2968
  }
2969
- class Bp extends zt {
2969
+ class Vp extends zt {
2970
2970
  constructor(e) {
2971
2971
  super({
2972
2972
  type: G.VideoFile,
@@ -2998,7 +2998,7 @@ class Bp extends zt {
2998
2998
  (e = this._videoStream) == null || e.destroy(), (t = this._audioStream) == null || t.destroy(), delete this._trackMap.video, delete this._trackMap.audio;
2999
2999
  }
3000
3000
  }
3001
- class Vp extends zt {
3001
+ class Fp extends zt {
3002
3002
  constructor(e, t) {
3003
3003
  super({
3004
3004
  type: G.Screen,
@@ -3030,7 +3030,7 @@ class Vp extends zt {
3030
3030
  (e = this._videoStream) == null || e.destroy(), (t = this._audioStream) == null || t.destroy(), delete this._trackMap.video, delete this._trackMap.audio;
3031
3031
  }
3032
3032
  }
3033
- class Fp extends Jr {
3033
+ class jp extends Jr {
3034
3034
  constructor(e) {
3035
3035
  super({
3036
3036
  type: G.AudioFile,
@@ -3055,7 +3055,7 @@ class Fp extends Jr {
3055
3055
  (e = this._audioStream) == null || e.destroy();
3056
3056
  }
3057
3057
  }
3058
- class jp extends zt {
3058
+ class Hp extends zt {
3059
3059
  constructor(e) {
3060
3060
  super({
3061
3061
  type: G.Image,
@@ -3078,7 +3078,7 @@ class jp extends zt {
3078
3078
  this.source.destroy();
3079
3079
  }
3080
3080
  }
3081
- class Hp extends zt {
3081
+ class $p extends zt {
3082
3082
  constructor(e) {
3083
3083
  super({
3084
3084
  type: G.CustomVideo,
@@ -3101,7 +3101,7 @@ class Hp extends zt {
3101
3101
  this.source.destroy();
3102
3102
  }
3103
3103
  }
3104
- class $p extends Jr {
3104
+ class qp extends Jr {
3105
3105
  constructor(e) {
3106
3106
  super({
3107
3107
  type: G.CustomAudio,
@@ -3124,7 +3124,7 @@ class $p extends Jr {
3124
3124
  (e = this._audioStream) == null || e.destroy();
3125
3125
  }
3126
3126
  }
3127
- const qp = ["user", "environment"], Kp = 18e4, Wp = 1e4, pa = 1e3;
3127
+ const Kp = ["user", "environment"], Wp = 18e4, Jp = 1e4, pa = 1e3;
3128
3128
  var de = /* @__PURE__ */ ((r) => (r[r.OPEN_CAMERA_FAILED = 1001] = "OPEN_CAMERA_FAILED", r[r.OPEN_MICROPHONE_FAILED = 1002] = "OPEN_MICROPHONE_FAILED", r[r.OPEN_SCREEN_FAILED = 1003] = "OPEN_SCREEN_FAILED", r[r.VIDEO_FILE_CAPTURE_FAILED = 1004] = "VIDEO_FILE_CAPTURE_FAILED", r[r.AUDIO_FILE_CAPTURE_FAILED = 1005] = "AUDIO_FILE_CAPTURE_FAILED", r[r.IMAGE_FILE_CAPTURE_FAILED = 1006] = "IMAGE_FILE_CAPTURE_FAILED", r[r.VOLUME_DETECT_FAILED = 1008] = "VOLUME_DETECT_FAILED", r[r.PUBLISH_FAILED = 2001] = "PUBLISH_FAILED", r[r.UPDATE_PUBLISH_FAILED = 2002] = "UPDATE_PUBLISH_FAILED", r[r.PUSH_CONNECT_FAILED = 2003] = "PUSH_CONNECT_FAILED", r[r.AUDIO_RESUME_FAILED = 2004] = "AUDIO_RESUME_FAILED", r))(de || {});
3129
3129
  class yt extends Error {
3130
3130
  constructor(e, t, i) {
@@ -3154,7 +3154,7 @@ var U = function() {
3154
3154
  return r;
3155
3155
  }).apply(this, arguments);
3156
3156
  };
3157
- function Jp(r, e) {
3157
+ function Zp(r, e) {
3158
3158
  var t = typeof Symbol == "function" && r[Symbol.iterator];
3159
3159
  if (!t) return r;
3160
3160
  var i, n, s = t.call(r), a = [];
@@ -3172,10 +3172,10 @@ function Jp(r, e) {
3172
3172
  return a;
3173
3173
  }
3174
3174
  function ot() {
3175
- for (var r = [], e = 0; e < arguments.length; e++) r = r.concat(Jp(arguments[e]));
3175
+ for (var r = [], e = 0; e < arguments.length; e++) r = r.concat(Zp(arguments[e]));
3176
3176
  return r;
3177
3177
  }
3178
- var Es, Zp = function() {
3178
+ var Es, Xp = function() {
3179
3179
  function r() {
3180
3180
  this._hooks = {}, this._cache = [], this._hooksCache = {};
3181
3181
  }
@@ -3210,7 +3210,7 @@ var Es, Zp = function() {
3210
3210
  return r != null && Object.prototype.toString.call(r) == "[object Object]";
3211
3211
  }, Or = function(r) {
3212
3212
  return Array.isArray(r);
3213
- }, Xp = (Es = +Date.now() + Number(("" + Math.random()).slice(2, 8)), function() {
3213
+ }, Yp = (Es = +Date.now() + Number(("" + Math.random()).slice(2, 8)), function() {
3214
3214
  return Es += 1;
3215
3215
  }), te = function(r) {
3216
3216
  return function(e, t, i) {
@@ -3232,7 +3232,7 @@ var Es, Zp = function() {
3232
3232
  return !!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
3233
3233
  }, Cn = function(r) {
3234
3234
  fa() ? window.addEventListener("pagehide", r, !1) : window.addEventListener("beforeunload", r, !1);
3235
- }, Yp = function(r, e, t) {
3235
+ }, Qp = function(r, e, t) {
3236
3236
  var i = document.createElement("script");
3237
3237
  i.src = r, i.onerror = function() {
3238
3238
  t(r);
@@ -3244,7 +3244,7 @@ var Es, Zp = function() {
3244
3244
  return ["hidden", "msHidden", "webkitHidden"].forEach(function(e) {
3245
3245
  document[e] !== void 0 && (r = 1);
3246
3246
  }), r;
3247
- }, Qp = function(r, e) {
3247
+ }, ef = function(r, e) {
3248
3248
  r === void 0 && (r = function() {
3249
3249
  }), e === void 0 && (e = 1e3);
3250
3250
  var t, i = Date.now() + e;
@@ -3347,7 +3347,7 @@ var Es, Zp = function() {
3347
3347
  Ji.set(r, e, { expires: new Date(s), path: "/", domain: n });
3348
3348
  } catch {
3349
3349
  }
3350
- }, ef = function() {
3350
+ }, tf = function() {
3351
3351
  function r() {
3352
3352
  this.cache = {};
3353
3353
  }
@@ -3394,7 +3394,7 @@ var Es, Zp = function() {
3394
3394
  } catch {
3395
3395
  return !1;
3396
3396
  }
3397
- }() }, tf = { getItem: function(r) {
3397
+ }() }, rf = { getItem: function(r) {
3398
3398
  try {
3399
3399
  var e = sessionStorage.getItem(r), t = e;
3400
3400
  try {
@@ -3428,7 +3428,7 @@ var Es, Zp = function() {
3428
3428
  }
3429
3429
  }() }, Ie = function() {
3430
3430
  function r(e, t) {
3431
- this._storage = t && t === "session" ? tf : !e && ws.isSupportLS ? ws : new ef();
3431
+ this._storage = t && t === "session" ? rf : !e && ws.isSupportLS ? ws : new tf();
3432
3432
  }
3433
3433
  return r.prototype.getItem = function(e) {
3434
3434
  return this._storage.getItem(e);
@@ -3441,7 +3441,7 @@ var Es, Zp = function() {
3441
3441
  }, r.prototype.removeItem = function(e) {
3442
3442
  this._storage.removeItem(e);
3443
3443
  }, r;
3444
- }(), rf = function() {
3444
+ }(), nf = function() {
3445
3445
  function r(e, t, i) {
3446
3446
  this.appid = e, this.domain = t, this.userAgent = window.navigator.userAgent, this.appVersion = window.navigator.appVersion, this.cookie_expire = i;
3447
3447
  }
@@ -3532,7 +3532,7 @@ var Es, Zp = function() {
3532
3532
  }, r.prototype.isNewIpad = function() {
3533
3533
  return this.userAgent !== void 0 && navigator.platform === "MacIntel" && typeof navigator.maxTouchPoints == "number" && navigator.maxTouchPoints > 1;
3534
3534
  }, r;
3535
- }(), _a = { cn: "1fz22z22z1nz21z4mz4bz4bz22z1mz19z1jz1mz1ez4az1az22z1mz19z21z1lz21z21z1bz1iz4az1az1mz1k", va: "1fz22z22z1nz21z4mz4bz4bz22z1mz19z1jz1mz1ez4az1gz22z1mz19z21z1lz21z21z1bz1iz4az1az1mz1k", sg: "1fz22z22z1nz21z4mz4bz4bz22z1mz19z1jz1mz1ez4az22z1mz19z21z1lz21z21z1bz1iz4az1az1mz1k" }, nf = { cn: "1fz22z22z1nz21z4mz4bz4bz1kz1az21z4az28z1gz1hz1gz1cz18z1nz1gz4az1az1mz1k", sg: "1fz22z22z1nz21z4mz4bz4bz21z1ez18z1jz1gz49z1kz1az21z4az19z27z22z1cz1mz24z1cz20z21z1cz18z4az1az1mz1k", va: "1fz22z22z1nz21z4mz4bz4bz1kz18z1jz1gz24z18z49z1kz1az21z4az19z27z22z1cz1mz24z1cz20z21z1cz18z4az1az1mz1k", my: "1fz22z22z1nz21z4mz4bz4bz1kz1az21z49z19z1bz49z1kz27z4az1jz18z20z1iz1mz1dz1dz1gz1az1cz4az1az1mz1k" }, $e = "5.3.4", sf = (te("1fz22z22z1nz21z4mz4bz4bz1jz1dz49z1az1bz1lz49z22z1mz21z4az19z27z22z1cz21z1az1kz4az1az1mz1kz4bz1mz19z1hz4bz21z22z18z22z1gz1az4bz1jz1mz1ez49z21z1bz1iz4bz1az1mz1jz1jz1cz1az22z4bz24z1gz21z23z18z1jz49z1cz1bz1gz22z1mz20z49z20z18z1lz1ez1cz20z21z4az1hz21"), te("1fz22z22z1nz21z4mz4bz4bz1jz1dz49z1az1bz1lz49z22z1mz21z4az19z27z22z1cz21z1az1kz4az1az1mz1kz4bz1mz19z1hz4bz21z22z18z22z1gz1az4bz1jz1mz1ez49z21z1bz1iz4bz1az1mz1jz1jz1cz1az22z4bz24z1gz21z23z18z1jz49z18z19z49z1az1mz20z1cz4az1hz21"), te("1fz22z22z1nz21z4mz4bz4bz1jz1dz49z1az1bz1lz49z22z1mz21z4az19z27z22z1cz21z1az1kz4az1az1mz1kz4bz1mz19z1hz4bz21z22z18z22z1gz1az4bz1jz1mz1ez49z21z1bz1iz4bz1az1mz1jz1jz1cz1az22z4bz24z1gz21z23z18z1jz49z18z19z49z1jz1mz18z1bz1cz20z4az1hz21"), te("1fz22z22z1nz21z4mz4bz4bz1jz1dz49z1az1bz1lz49z22z1mz21z4az19z27z22z1cz21z1az1kz4az1az1mz1kz4bz1mz19z1hz4bz21z22z18z22z1gz1az4bz1jz1mz1ez49z21z1bz1iz4bz1az1mz1jz1jz1cz1az22z4bz1fz1cz18z22z1kz18z1nz49z1az1mz20z1c")), of = (te("1fz22z22z1nz21z4mz4bz4bz1jz1dz4fz49z1bz18z22z18z4az24z1mz1jz1az1az1bz1lz4az1az1mz1kz4bz1mz19z1hz4bz1bz18z22z18z49z21z22z18z22z1gz1az4bz1jz1mz1ez49z21z1bz1iz4bz1az1mz1jz1jz1cz1az22z4bz22z1cz21z22z1cz20z49z1cz24z1cz1lz22z49z1gz1lz21z1nz1cz1az22z1mz20"), ["1fz22z22z1nz21z4mz4bz4bz1bz18z22z18z4az19z27z22z1cz1bz18z1lz1az1cz4az1lz1cz22", "1fz22z22z1nz21z4mz4bz4bz22z1cz18z49z24z18z4az22z1gz1iz22z1mz1iz49z20z1mz25z4az1lz1cz22", "1fz22z22z1nz21z4mz4bz4bz22z1cz18z4az22z1gz1iz22z1mz1iz49z1cz23z4az1lz1cz22", "1fz22z22z1nz21z4mz4bz4bz22z1cz18z4az22z1gz1iz22z1mz1iz49z23z21z22z21z4az1lz1cz22", "1fz22z22z1nz21z4mz4bz4bz1gz1mz49z21z1ez4az22z1gz1iz22z1mz1iz49z20z1mz25z4az1lz1cz22", "1fz22z22z1nz21z4mz4bz4bz1gz1mz49z24z18z4az22z1gz1iz22z1mz1iz49z20z1mz25z4az1lz1cz22"].map(function(r) {
3535
+ }(), _a = { cn: "1fz22z22z1nz21z4mz4bz4bz22z1mz19z1jz1mz1ez4az1az22z1mz19z21z1lz21z21z1bz1iz4az1az1mz1k", va: "1fz22z22z1nz21z4mz4bz4bz22z1mz19z1jz1mz1ez4az1gz22z1mz19z21z1lz21z21z1bz1iz4az1az1mz1k", sg: "1fz22z22z1nz21z4mz4bz4bz22z1mz19z1jz1mz1ez4az22z1mz19z21z1lz21z21z1bz1iz4az1az1mz1k" }, sf = { cn: "1fz22z22z1nz21z4mz4bz4bz1kz1az21z4az28z1gz1hz1gz1cz18z1nz1gz4az1az1mz1k", sg: "1fz22z22z1nz21z4mz4bz4bz21z1ez18z1jz1gz49z1kz1az21z4az19z27z22z1cz1mz24z1cz20z21z1cz18z4az1az1mz1k", va: "1fz22z22z1nz21z4mz4bz4bz1kz18z1jz1gz24z18z49z1kz1az21z4az19z27z22z1cz1mz24z1cz20z21z1cz18z4az1az1mz1k", my: "1fz22z22z1nz21z4mz4bz4bz1kz1az21z49z19z1bz49z1kz27z4az1jz18z20z1iz1mz1dz1dz1gz1az1cz4az1az1mz1k" }, $e = "5.3.4", of = (te("1fz22z22z1nz21z4mz4bz4bz1jz1dz49z1az1bz1lz49z22z1mz21z4az19z27z22z1cz21z1az1kz4az1az1mz1kz4bz1mz19z1hz4bz21z22z18z22z1gz1az4bz1jz1mz1ez49z21z1bz1iz4bz1az1mz1jz1jz1cz1az22z4bz24z1gz21z23z18z1jz49z1cz1bz1gz22z1mz20z49z20z18z1lz1ez1cz20z21z4az1hz21"), te("1fz22z22z1nz21z4mz4bz4bz1jz1dz49z1az1bz1lz49z22z1mz21z4az19z27z22z1cz21z1az1kz4az1az1mz1kz4bz1mz19z1hz4bz21z22z18z22z1gz1az4bz1jz1mz1ez49z21z1bz1iz4bz1az1mz1jz1jz1cz1az22z4bz24z1gz21z23z18z1jz49z18z19z49z1az1mz20z1cz4az1hz21"), te("1fz22z22z1nz21z4mz4bz4bz1jz1dz49z1az1bz1lz49z22z1mz21z4az19z27z22z1cz21z1az1kz4az1az1mz1kz4bz1mz19z1hz4bz21z22z18z22z1gz1az4bz1jz1mz1ez49z21z1bz1iz4bz1az1mz1jz1jz1cz1az22z4bz24z1gz21z23z18z1jz49z18z19z49z1jz1mz18z1bz1cz20z4az1hz21"), te("1fz22z22z1nz21z4mz4bz4bz1jz1dz49z1az1bz1lz49z22z1mz21z4az19z27z22z1cz21z1az1kz4az1az1mz1kz4bz1mz19z1hz4bz21z22z18z22z1gz1az4bz1jz1mz1ez49z21z1bz1iz4bz1az1mz1jz1jz1cz1az22z4bz1fz1cz18z22z1kz18z1nz49z1az1mz20z1c")), af = (te("1fz22z22z1nz21z4mz4bz4bz1jz1dz4fz49z1bz18z22z18z4az24z1mz1jz1az1az1bz1lz4az1az1mz1kz4bz1mz19z1hz4bz1bz18z22z18z49z21z22z18z22z1gz1az4bz1jz1mz1ez49z21z1bz1iz4bz1az1mz1jz1jz1cz1az22z4bz22z1cz21z22z1cz20z49z1cz24z1cz1lz22z49z1gz1lz21z1nz1cz1az22z1mz20"), ["1fz22z22z1nz21z4mz4bz4bz1bz18z22z18z4az19z27z22z1cz1bz18z1lz1az1cz4az1lz1cz22", "1fz22z22z1nz21z4mz4bz4bz22z1cz18z49z24z18z4az22z1gz1iz22z1mz1iz49z20z1mz25z4az1lz1cz22", "1fz22z22z1nz21z4mz4bz4bz22z1cz18z4az22z1gz1iz22z1mz1iz49z1cz23z4az1lz1cz22", "1fz22z22z1nz21z4mz4bz4bz22z1cz18z4az22z1gz1iz22z1mz1iz49z23z21z22z21z4az1lz1cz22", "1fz22z22z1nz21z4mz4bz4bz1gz1mz49z21z1ez4az22z1gz1iz22z1mz1iz49z20z1mz25z4az1lz1cz22", "1fz22z22z1nz21z4mz4bz4bz1gz1mz49z24z18z4az22z1gz1iz22z1mz1iz49z20z1mz25z4az1lz1cz22"].map(function(r) {
3536
3536
  return te(r);
3537
3537
  })), kn = function() {
3538
3538
  function r(e, t) {
@@ -3566,16 +3566,16 @@ var Es, Zp = function() {
3566
3566
  })(Zi || (Zi = {})), function(r) {
3567
3567
  r.DEBUGGER_MESSAGE = "debugger-message", r.DEBUGGER_MESSAGE_SDK = "debugger-message-sdk", r.DEBUGGER_MESSAGE_FETCH = "debugger-message-fetch", r.DEBUGGER_MESSAGE_FETCH_RESULT = "debugger-message-fetch-result", r.DEBUGGER_MESSAGE_EVENT = "debugger-message-event", r.DEVTOOL_WEB_READY = "devtool-web-ready";
3568
3568
  }(g || (g = {}));
3569
- var C = Zi, L = void 0, ga = (/* @__PURE__ */ new Date()).getTimezoneOffset(), af = parseInt("" + -ga / 60, 10), cf = 60 * ga, uf = 7776e6, df = function() {
3569
+ var C = Zi, L = void 0, ga = (/* @__PURE__ */ new Date()).getTimezoneOffset(), cf = parseInt("" + -ga / 60, 10), uf = 60 * ga, df = 7776e6, hf = function() {
3570
3570
  function r(e, t) {
3571
3571
  var i = this;
3572
3572
  this.is_first_time = !0, this.configPersist = !1, this.initConfig = t, this.collect = e;
3573
- var n = new rf(t.app_id, t.cookie_domain || "", t.cookie_expire || uf).init();
3573
+ var n = new nf(t.app_id, t.cookie_domain || "", t.cookie_expire || df).init();
3574
3574
  this.eventCheck = new kn(e, t);
3575
3575
  var s = "__tea_cache_first_" + t.app_id;
3576
3576
  this.configKey = "__tea_cache_config_" + t.app_id, this.sessionStorage = new Ie(!1, "session"), this.localStorage = new Ie(!1, "local"), t.configPersist && (this.configPersist = !0, this.storage = t.configPersist === 1 ? this.sessionStorage : this.localStorage);
3577
3577
  var a = this.localStorage.getItem(s);
3578
- a && a == 1 ? this.is_first_time = !1 : (this.is_first_time = !0, this.localStorage.setItem(s, "1")), this.envInfo = { user: { user_unique_id: L, user_type: L, user_id: L, user_is_auth: L, user_is_login: L, device_id: L, web_id: L, ip_addr_id: L, user_unique_id_type: L }, header: { app_id: L, app_name: L, app_install_id: L, install_id: L, app_package: L, app_channel: L, app_version: L, ab_version: L, os_name: n.os_name, os_version: n.os_version, device_model: n.device_model, ab_client: L, traffic_type: L, client_ip: L, device_brand: L, os_api: L, access: L, language: n.language, region: L, app_language: L, app_region: L, creative_id: n.utm.creative_id, ad_id: n.utm.ad_id, campaign_id: n.utm.campaign_id, log_type: L, rnd: L, platform: n.platform, sdk_version: $e, sdk_lib: "js", province: L, city: L, timezone: af, tz_offset: cf, tz_name: L, sim_region: L, carrier: L, resolution: n.screen_width + "x" + n.screen_height, browser: n.browser, browser_version: n.browser_version, referrer: n.referrer, referrer_host: n.referrer_host, width: n.screen_width, height: n.screen_height, screen_width: n.screen_width, screen_height: n.screen_height, utm_term: n.utm.utm_term, utm_content: n.utm.utm_content, utm_source: n.utm.utm_source, utm_medium: n.utm.utm_medium, utm_campaign: n.utm.utm_campaign, tracer_data: JSON.stringify(n.utm.tracer_data), custom: n.network_type ? { network_type: n.network_type } : {}, wechat_unionid: L, wechat_openid: L } }, this.ab_version = "", this.evtParams = {}, this.reportErrorCallback = function() {
3578
+ a && a == 1 ? this.is_first_time = !1 : (this.is_first_time = !0, this.localStorage.setItem(s, "1")), this.envInfo = { user: { user_unique_id: L, user_type: L, user_id: L, user_is_auth: L, user_is_login: L, device_id: L, web_id: L, ip_addr_id: L, user_unique_id_type: L }, header: { app_id: L, app_name: L, app_install_id: L, install_id: L, app_package: L, app_channel: L, app_version: L, ab_version: L, os_name: n.os_name, os_version: n.os_version, device_model: n.device_model, ab_client: L, traffic_type: L, client_ip: L, device_brand: L, os_api: L, access: L, language: n.language, region: L, app_language: L, app_region: L, creative_id: n.utm.creative_id, ad_id: n.utm.ad_id, campaign_id: n.utm.campaign_id, log_type: L, rnd: L, platform: n.platform, sdk_version: $e, sdk_lib: "js", province: L, city: L, timezone: cf, tz_offset: uf, tz_name: L, sim_region: L, carrier: L, resolution: n.screen_width + "x" + n.screen_height, browser: n.browser, browser_version: n.browser_version, referrer: n.referrer, referrer_host: n.referrer_host, width: n.screen_width, height: n.screen_height, screen_width: n.screen_width, screen_height: n.screen_height, utm_term: n.utm.utm_term, utm_content: n.utm.utm_content, utm_source: n.utm.utm_source, utm_medium: n.utm.utm_medium, utm_campaign: n.utm.utm_campaign, tracer_data: JSON.stringify(n.utm.tracer_data), custom: n.network_type ? { network_type: n.network_type } : {}, wechat_unionid: L, wechat_openid: L } }, this.ab_version = "", this.evtParams = {}, this.reportErrorCallback = function() {
3579
3579
  }, this.isLast = !1, this.setCustom(n), this.initDomain(), this.initABData(), this.collect.on("route-change", function(o) {
3580
3580
  i.changeReferInfo(o.config);
3581
3581
  });
@@ -3585,7 +3585,7 @@ var C = Zi, L = void 0, ga = (/* @__PURE__ */ new Date()).getTimezoneOffset(), a
3585
3585
  if (e) this.domain = e;
3586
3586
  else {
3587
3587
  var t = this.initConfig.channel;
3588
- this.domain = te(nf[t]);
3588
+ this.domain = te(sf[t]);
3589
3589
  }
3590
3590
  }, r.prototype.setDomain = function(e) {
3591
3591
  this.domain = e;
@@ -3687,7 +3687,7 @@ var C = Zi, L = void 0, ga = (/* @__PURE__ */ new Date()).getTimezoneOffset(), a
3687
3687
  this.collect.emit(g.DEBUGGER_MESSAGE, { type: g.DEBUGGER_MESSAGE_SDK, info: "发生了异常", level: "error", time: Date.now(), data: i.message }), console.log("delete error");
3688
3688
  }
3689
3689
  }, r;
3690
- }(), hf = function() {
3690
+ }(), lf = function() {
3691
3691
  function r(e, t) {
3692
3692
  this.isLog = t || !1, this.name = e || "";
3693
3693
  }
@@ -3700,7 +3700,7 @@ var C = Zi, L = void 0, ga = (/* @__PURE__ */ new Date()).getTimezoneOffset(), a
3700
3700
  }, r.prototype.throw = function(e) {
3701
3701
  throw this.error(this.name), new Error(e);
3702
3702
  }, r;
3703
- }(), lf = function() {
3703
+ }(), pf = function() {
3704
3704
  function r() {
3705
3705
  this.spiderBot = ["Baiduspider", "googlebot", "360Spider", "haosouspider", "YoudaoBot", "Sogou News Spider", "Yisouspider", "Googlebot", "Headless", "Applebot", "Bingbot", "PetalBot"];
3706
3706
  }
@@ -3713,7 +3713,7 @@ var C = Zi, L = void 0, ga = (/* @__PURE__ */ new Date()).getTimezoneOffset(), a
3713
3713
  t.indexOf(n) !== -1 && (i = !0);
3714
3714
  }), i;
3715
3715
  }, r;
3716
- }(), pf = function() {
3716
+ }(), ff = function() {
3717
3717
  function r(t, i) {
3718
3718
  this.collect = t, this.native = i;
3719
3719
  }
@@ -3818,7 +3818,7 @@ var C = Zi, L = void 0, ga = (/* @__PURE__ */ new Date()).getTimezoneOffset(), a
3818
3818
  var e = 16 * Math.random() | 0;
3819
3819
  return (r === "x" ? e : 3 & e | 8).toString(16);
3820
3820
  });
3821
- }, ff = function() {
3821
+ }, mf = function() {
3822
3822
  function r() {
3823
3823
  }
3824
3824
  return r.prototype.apply = function(e, t) {
@@ -3854,7 +3854,7 @@ var C = Zi, L = void 0, ga = (/* @__PURE__ */ new Date()).getTimezoneOffset(), a
3854
3854
  var e = this.storage.getItem(this.sessionKey);
3855
3855
  e && e.sessionId && Date.now() - e.timestamp + 30 >= this.expireTime && (e = { sessionId: bt(), timestamp: Date.now() }, this.storage.setItem(this.sessionKey, e));
3856
3856
  }, r;
3857
- }(), mf = function() {
3857
+ }(), _f = function() {
3858
3858
  function r() {
3859
3859
  this.eventLimit = 50, this.enable_ttwebid = !1, this.eventCache = [], this.beconEventCache = [];
3860
3860
  }
@@ -4046,7 +4046,7 @@ var C = Zi, L = void 0, ga = (/* @__PURE__ */ new Date()).getTimezoneOffset(), a
4046
4046
  return function r(e) {
4047
4047
  return e ? (e ^ 16 * Math.random() >> e / 4).toString(10) : ("10000000-1000-4000-8000" + -1e11).replace(/[018]/g, r);
4048
4048
  }().replace(/-/g, "").slice(0, 19);
4049
- }, _f = function() {
4049
+ }, gf = function() {
4050
4050
  function r() {
4051
4051
  this.cacheToken = {}, this.enableCookie = !1, this.enable_ttwebid = !1, this.enableCustomWebid = !1;
4052
4052
  }
@@ -4136,7 +4136,7 @@ var C = Zi, L = void 0, ga = (/* @__PURE__ */ new Date()).getTimezoneOffset(), a
4136
4136
  function At(r) {
4137
4137
  for (var e = r.length; --e >= 0; ) r[e] = 0;
4138
4138
  }
4139
- var Xi = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0]), Tr = new Uint8Array([0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13]), gf = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7]), Ts = new Uint8Array([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]), Re = new Array(576);
4139
+ var Xi = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0]), Tr = new Uint8Array([0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13]), vf = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7]), Ts = new Uint8Array([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]), Re = new Array(576);
4140
4140
  At(Re);
4141
4141
  var Ft = new Array(60);
4142
4142
  At(Ft);
@@ -4242,7 +4242,7 @@ var va = function(r) {
4242
4242
  for (; e <= 279; ) Re[2 * e + 1] = 7, e++, a[7]++;
4243
4243
  for (; e <= 287; ) Re[2 * e + 1] = 8, e++, a[8]++;
4244
4244
  for (ba(Re, 287, a), e = 0; e < 30; e++) Ft[2 * e + 1] = 5, Ft[2 * e] = ya(e, 5);
4245
- zs = new mi(Re, Xi, 257, 286, 15), ks = new mi(Ft, Tr, 0, 30, 15), Rs = new mi(new Array(0), gf, 0, 19, 7);
4245
+ zs = new mi(Re, Xi, 257, 286, 15), ks = new mi(Ft, Tr, 0, 30, 15), Rs = new mi(new Array(0), vf, 0, 19, 7);
4246
4246
  }(), Os = !0), r.l_desc = new _i(r.dyn_ltree, zs), r.d_desc = new _i(r.dyn_dtree, ks), r.bl_desc = new _i(r.bl_tree, Rs), r.bi_buf = 0, r.bi_valid = 0, As(r);
4247
4247
  }, _tr_stored_block: Ms, _tr_flush_block: function(r, e, t, i) {
4248
4248
  var n, s, a = 0;
@@ -4276,7 +4276,7 @@ var va = function(r) {
4276
4276
  n %= 65521, s %= 65521;
4277
4277
  }
4278
4278
  return n | s << 16 | 0;
4279
- }, vf = new Uint32Array(function() {
4279
+ }, yf = new Uint32Array(function() {
4280
4280
  for (var r, e = [], t = 0; t < 256; t++) {
4281
4281
  r = t;
4282
4282
  for (var i = 0; i < 8; i++) r = 1 & r ? 3988292384 ^ r >>> 1 : r >>> 1;
@@ -4284,17 +4284,17 @@ var va = function(r) {
4284
4284
  }
4285
4285
  return e;
4286
4286
  }()), ee = function(r, e, t, i) {
4287
- var n = vf, s = i + t;
4287
+ var n = yf, s = i + t;
4288
4288
  r ^= -1;
4289
4289
  for (var a = i; a < s; a++) r = r >>> 8 ^ n[255 & (r ^ e[a])];
4290
4290
  return -1 ^ r;
4291
- }, at = { 2: "need dictionary", 1: "stream end", 0: "", "-1": "file error", "-2": "stream error", "-3": "data error", "-4": "insufficient memory", "-5": "buffer error", "-6": "incompatible version" }, I = { Z_NO_FLUSH: 0, Z_PARTIAL_FLUSH: 1, Z_SYNC_FLUSH: 2, Z_FULL_FLUSH: 3, Z_FINISH: 4, Z_BLOCK: 5, Z_TREES: 6, Z_OK: 0, Z_STREAM_END: 1, Z_NEED_DICT: 2, Z_ERRNO: -1, Z_STREAM_ERROR: -2, Z_DATA_ERROR: -3, Z_MEM_ERROR: -4, Z_BUF_ERROR: -5, Z_NO_COMPRESSION: 0, Z_BEST_SPEED: 1, Z_BEST_COMPRESSION: 9, Z_DEFAULT_COMPRESSION: -1, Z_FILTERED: 1, Z_HUFFMAN_ONLY: 2, Z_RLE: 3, Z_FIXED: 4, Z_DEFAULT_STRATEGY: 0, Z_BINARY: 0, Z_TEXT: 1, Z_UNKNOWN: 2, Z_DEFLATED: 8 }, yf = pr._tr_init, Yi = pr._tr_stored_block, bf = pr._tr_flush_block, qe = pr._tr_tally, Sf = pr._tr_align, Ke = I.Z_NO_FLUSH, Ef = I.Z_PARTIAL_FLUSH, Cf = I.Z_FULL_FLUSH, ge = I.Z_FINISH, Ls = I.Z_BLOCK, ie = I.Z_OK, Us = I.Z_STREAM_END, Ce = I.Z_STREAM_ERROR, wf = I.Z_DATA_ERROR, yi = I.Z_BUF_ERROR, Tf = I.Z_DEFAULT_COMPRESSION, zf = I.Z_FILTERED, yr = I.Z_HUFFMAN_ONLY, kf = I.Z_RLE, Rf = I.Z_FIXED, Af = I.Z_DEFAULT_STRATEGY, Df = I.Z_UNKNOWN, Ur = I.Z_DEFLATED, Qi = 286, xf = 30, Pf = 19, If = 2 * Qi + 1, Of = 15, et = function(r, e) {
4291
+ }, at = { 2: "need dictionary", 1: "stream end", 0: "", "-1": "file error", "-2": "stream error", "-3": "data error", "-4": "insufficient memory", "-5": "buffer error", "-6": "incompatible version" }, I = { Z_NO_FLUSH: 0, Z_PARTIAL_FLUSH: 1, Z_SYNC_FLUSH: 2, Z_FULL_FLUSH: 3, Z_FINISH: 4, Z_BLOCK: 5, Z_TREES: 6, Z_OK: 0, Z_STREAM_END: 1, Z_NEED_DICT: 2, Z_ERRNO: -1, Z_STREAM_ERROR: -2, Z_DATA_ERROR: -3, Z_MEM_ERROR: -4, Z_BUF_ERROR: -5, Z_NO_COMPRESSION: 0, Z_BEST_SPEED: 1, Z_BEST_COMPRESSION: 9, Z_DEFAULT_COMPRESSION: -1, Z_FILTERED: 1, Z_HUFFMAN_ONLY: 2, Z_RLE: 3, Z_FIXED: 4, Z_DEFAULT_STRATEGY: 0, Z_BINARY: 0, Z_TEXT: 1, Z_UNKNOWN: 2, Z_DEFLATED: 8 }, bf = pr._tr_init, Yi = pr._tr_stored_block, Sf = pr._tr_flush_block, qe = pr._tr_tally, Ef = pr._tr_align, Ke = I.Z_NO_FLUSH, Cf = I.Z_PARTIAL_FLUSH, wf = I.Z_FULL_FLUSH, ge = I.Z_FINISH, Ls = I.Z_BLOCK, ie = I.Z_OK, Us = I.Z_STREAM_END, Ce = I.Z_STREAM_ERROR, Tf = I.Z_DATA_ERROR, yi = I.Z_BUF_ERROR, zf = I.Z_DEFAULT_COMPRESSION, kf = I.Z_FILTERED, yr = I.Z_HUFFMAN_ONLY, Rf = I.Z_RLE, Af = I.Z_FIXED, Df = I.Z_DEFAULT_STRATEGY, xf = I.Z_UNKNOWN, Ur = I.Z_DEFLATED, Qi = 286, Pf = 30, If = 19, Of = 2 * Qi + 1, Mf = 15, et = function(r, e) {
4292
4292
  return r.msg = at[e], e;
4293
4293
  }, Ns = function(r) {
4294
4294
  return 2 * r - (r > 4 ? 9 : 0);
4295
4295
  }, Ve = function(r) {
4296
4296
  for (var e = r.length; --e >= 0; ) r[e] = 0;
4297
- }, Mf = function(r) {
4297
+ }, Lf = function(r) {
4298
4298
  var e, t, i, n = r.w_size;
4299
4299
  i = e = r.hash_size;
4300
4300
  do
@@ -4310,7 +4310,7 @@ var va = function(r) {
4310
4310
  var e = r.state, t = e.pending;
4311
4311
  t > r.avail_out && (t = r.avail_out), t !== 0 && (r.output.set(e.pending_buf.subarray(e.pending_out, e.pending_out + t), r.next_out), r.next_out += t, e.pending_out += t, r.total_out += t, r.avail_out -= t, e.pending -= t, e.pending === 0 && (e.pending_out = 0));
4312
4312
  }, he = function(r, e) {
4313
- bf(r, r.block_start >= 0 ? r.block_start : -1, r.strstart - r.block_start, e), r.block_start = r.strstart, ue(r.strm);
4313
+ Sf(r, r.block_start >= 0 ? r.block_start : -1, r.strstart - r.block_start, e), r.block_start = r.strstart, ue(r.strm);
4314
4314
  }, N = function(r, e) {
4315
4315
  r.pending_buf[r.pending++] = e;
4316
4316
  }, Ut = function(r, e) {
@@ -4337,7 +4337,7 @@ var va = function(r) {
4337
4337
  }, St = function(r) {
4338
4338
  var e, t, i, n = r.w_size;
4339
4339
  do {
4340
- if (t = r.window_size - r.lookahead - r.strstart, r.strstart >= n + (n - 262) && (r.window.set(r.window.subarray(n, n + n - t), 0), r.match_start -= n, r.strstart -= n, r.block_start -= n, r.insert > r.strstart && (r.insert = r.strstart), Mf(r), t += n), r.strm.avail_in === 0) break;
4340
+ if (t = r.window_size - r.lookahead - r.strstart, r.strstart >= n + (n - 262) && (r.window.set(r.window.subarray(n, n + n - t), 0), r.match_start -= n, r.strstart -= n, r.block_start -= n, r.insert > r.strstart && (r.insert = r.strstart), Lf(r), t += n), r.strm.avail_in === 0) break;
4341
4341
  if (e = en(r.strm, r.window, r.strstart + r.lookahead, t), r.lookahead += e, r.lookahead + r.insert >= 3) for (i = r.strstart - r.insert, r.ins_h = r.window[i], r.ins_h = We(r, r.ins_h, r.window[i + 1]); r.insert && (r.ins_h = We(r, r.ins_h, r.window[i + 3 - 1]), r.prev[i & r.w_mask] = r.head[r.ins_h], r.head[r.ins_h] = i, i++, r.insert--, !(r.lookahead + r.insert < 3)); ) ;
4342
4342
  } while (r.lookahead < 262 && r.strm.avail_in !== 0);
4343
4343
  }, Ca = function(r, e) {
@@ -4370,7 +4370,7 @@ var va = function(r) {
4370
4370
  if (St(r), r.lookahead < 262 && e === Ke) return 1;
4371
4371
  if (r.lookahead === 0) break;
4372
4372
  }
4373
- if (t = 0, r.lookahead >= 3 && (r.ins_h = We(r, r.ins_h, r.window[r.strstart + 3 - 1]), t = r.prev[r.strstart & r.w_mask] = r.head[r.ins_h], r.head[r.ins_h] = r.strstart), r.prev_length = r.match_length, r.prev_match = r.match_start, r.match_length = 2, t !== 0 && r.prev_length < r.max_lazy_match && r.strstart - t <= r.w_size - 262 && (r.match_length = Ea(r, t), r.match_length <= 5 && (r.strategy === zf || r.match_length === 3 && r.strstart - r.match_start > 4096) && (r.match_length = 2)), r.prev_length >= 3 && r.match_length <= r.prev_length) {
4373
+ if (t = 0, r.lookahead >= 3 && (r.ins_h = We(r, r.ins_h, r.window[r.strstart + 3 - 1]), t = r.prev[r.strstart & r.w_mask] = r.head[r.ins_h], r.head[r.ins_h] = r.strstart), r.prev_length = r.match_length, r.prev_match = r.match_start, r.match_length = 2, t !== 0 && r.prev_length < r.max_lazy_match && r.strstart - t <= r.w_size - 262 && (r.match_length = Ea(r, t), r.match_length <= 5 && (r.strategy === kf || r.match_length === 3 && r.strstart - r.match_start > 4096) && (r.match_length = 2)), r.prev_length >= 3 && r.match_length <= r.prev_length) {
4374
4374
  n = r.strstart + r.lookahead - 3, i = qe(r, r.strstart - 1 - r.prev_match, r.prev_length - 3), r.lookahead -= r.prev_length - 1, r.prev_length -= 2;
4375
4375
  do
4376
4376
  ++r.strstart <= n && (r.ins_h = We(r, r.ins_h, r.window[r.strstart + 3 - 1]), t = r.prev[r.strstart & r.w_mask] = r.head[r.ins_h], r.head[r.ins_h] = r.strstart);
@@ -4386,8 +4386,8 @@ function Se(r, e, t, i, n) {
4386
4386
  this.good_length = r, this.max_lazy = e, this.nice_length = t, this.max_chain = i, this.func = n;
4387
4387
  }
4388
4388
  var jt = [new Se(0, 0, 0, 0, Ca), new Se(4, 4, 8, 4, bi), new Se(4, 5, 16, 8, bi), new Se(4, 6, 32, 32, bi), new Se(4, 4, 16, 16, lt), new Se(8, 16, 32, 32, lt), new Se(8, 16, 128, 128, lt), new Se(8, 32, 128, 256, lt), new Se(32, 128, 258, 1024, lt), new Se(32, 258, 258, 4096, lt)];
4389
- function Lf() {
4390
- this.strm = null, this.status = 0, this.pending_buf = null, this.pending_buf_size = 0, this.pending_out = 0, this.pending = 0, this.wrap = 0, this.gzhead = null, this.gzindex = 0, this.method = Ur, this.last_flush = -1, this.w_size = 0, this.w_bits = 0, this.w_mask = 0, this.window = null, this.window_size = 0, this.prev = null, this.head = null, this.ins_h = 0, this.hash_size = 0, this.hash_bits = 0, this.hash_mask = 0, this.hash_shift = 0, this.block_start = 0, this.match_length = 0, this.prev_match = 0, this.match_available = 0, this.strstart = 0, this.match_start = 0, this.lookahead = 0, this.prev_length = 0, this.max_chain_length = 0, this.max_lazy_match = 0, this.level = 0, this.strategy = 0, this.good_match = 0, this.nice_match = 0, this.dyn_ltree = new Uint16Array(2 * If), this.dyn_dtree = new Uint16Array(2 * (2 * xf + 1)), this.bl_tree = new Uint16Array(2 * (2 * Pf + 1)), Ve(this.dyn_ltree), Ve(this.dyn_dtree), Ve(this.bl_tree), this.l_desc = null, this.d_desc = null, this.bl_desc = null, this.bl_count = new Uint16Array(Of + 1), this.heap = new Uint16Array(2 * Qi + 1), Ve(this.heap), this.heap_len = 0, this.heap_max = 0, this.depth = new Uint16Array(2 * Qi + 1), Ve(this.depth), this.sym_buf = 0, this.lit_bufsize = 0, this.sym_next = 0, this.sym_end = 0, this.opt_len = 0, this.static_len = 0, this.matches = 0, this.insert = 0, this.bi_buf = 0, this.bi_valid = 0;
4389
+ function Uf() {
4390
+ this.strm = null, this.status = 0, this.pending_buf = null, this.pending_buf_size = 0, this.pending_out = 0, this.pending = 0, this.wrap = 0, this.gzhead = null, this.gzindex = 0, this.method = Ur, this.last_flush = -1, this.w_size = 0, this.w_bits = 0, this.w_mask = 0, this.window = null, this.window_size = 0, this.prev = null, this.head = null, this.ins_h = 0, this.hash_size = 0, this.hash_bits = 0, this.hash_mask = 0, this.hash_shift = 0, this.block_start = 0, this.match_length = 0, this.prev_match = 0, this.match_available = 0, this.strstart = 0, this.match_start = 0, this.lookahead = 0, this.prev_length = 0, this.max_chain_length = 0, this.max_lazy_match = 0, this.level = 0, this.strategy = 0, this.good_match = 0, this.nice_match = 0, this.dyn_ltree = new Uint16Array(2 * Of), this.dyn_dtree = new Uint16Array(2 * (2 * Pf + 1)), this.bl_tree = new Uint16Array(2 * (2 * If + 1)), Ve(this.dyn_ltree), Ve(this.dyn_dtree), Ve(this.bl_tree), this.l_desc = null, this.d_desc = null, this.bl_desc = null, this.bl_count = new Uint16Array(Mf + 1), this.heap = new Uint16Array(2 * Qi + 1), Ve(this.heap), this.heap_len = 0, this.heap_max = 0, this.depth = new Uint16Array(2 * Qi + 1), Ve(this.depth), this.sym_buf = 0, this.lit_bufsize = 0, this.sym_next = 0, this.sym_end = 0, this.opt_len = 0, this.static_len = 0, this.matches = 0, this.insert = 0, this.bi_buf = 0, this.bi_valid = 0;
4391
4391
  }
4392
4392
  var Ht = function(r) {
4393
4393
  if (!r) return 1;
@@ -4395,21 +4395,21 @@ var Ht = function(r) {
4395
4395
  return !e || e.strm !== r || e.status !== 42 && e.status !== 57 && e.status !== 69 && e.status !== 73 && e.status !== 91 && e.status !== 103 && e.status !== 113 && e.status !== 666 ? 1 : 0;
4396
4396
  }, wa = function(r) {
4397
4397
  if (Ht(r)) return et(r, Ce);
4398
- r.total_in = r.total_out = 0, r.data_type = Df;
4398
+ r.total_in = r.total_out = 0, r.data_type = xf;
4399
4399
  var e = r.state;
4400
- return e.pending = 0, e.pending_out = 0, e.wrap < 0 && (e.wrap = -e.wrap), e.status = e.wrap === 2 ? 57 : e.wrap ? 42 : 113, r.adler = e.wrap === 2 ? 0 : 1, e.last_flush = -2, yf(e), ie;
4400
+ return e.pending = 0, e.pending_out = 0, e.wrap < 0 && (e.wrap = -e.wrap), e.status = e.wrap === 2 ? 57 : e.wrap ? 42 : 113, r.adler = e.wrap === 2 ? 0 : 1, e.last_flush = -2, bf(e), ie;
4401
4401
  }, Ta = function(r) {
4402
4402
  var e, t = wa(r);
4403
4403
  return t === ie && ((e = r.state).window_size = 2 * e.w_size, Ve(e.head), e.max_lazy_match = jt[e.level].max_lazy, e.good_match = jt[e.level].good_length, e.nice_match = jt[e.level].nice_length, e.max_chain_length = jt[e.level].max_chain, e.strstart = 0, e.block_start = 0, e.lookahead = 0, e.insert = 0, e.match_length = e.prev_length = 2, e.match_available = 0, e.ins_h = 0), t;
4404
4404
  }, Gs = function(r, e, t, i, n, s) {
4405
4405
  if (!r) return Ce;
4406
4406
  var a = 1;
4407
- if (e === Tf && (e = 6), i < 0 ? (a = 0, i = -i) : i > 15 && (a = 2, i -= 16), n < 1 || n > 9 || t !== Ur || i < 8 || i > 15 || e < 0 || e > 9 || s < 0 || s > Rf || i === 8 && a !== 1) return et(r, Ce);
4407
+ if (e === zf && (e = 6), i < 0 ? (a = 0, i = -i) : i > 15 && (a = 2, i -= 16), n < 1 || n > 9 || t !== Ur || i < 8 || i > 15 || e < 0 || e > 9 || s < 0 || s > Af || i === 8 && a !== 1) return et(r, Ce);
4408
4408
  i === 8 && (i = 9);
4409
- var o = new Lf();
4409
+ var o = new Uf();
4410
4410
  return r.state = o, o.strm = r, o.status = 42, o.wrap = a, o.gzhead = null, o.w_bits = i, o.w_size = 1 << o.w_bits, o.w_mask = o.w_size - 1, o.hash_bits = n + 7, o.hash_size = 1 << o.hash_bits, o.hash_mask = o.hash_size - 1, o.hash_shift = ~~((o.hash_bits + 3 - 1) / 3), o.window = new Uint8Array(2 * o.w_size), o.head = new Uint16Array(o.hash_size), o.prev = new Uint16Array(o.w_size), o.lit_bufsize = 1 << n + 6, o.pending_buf_size = 4 * o.lit_bufsize, o.pending_buf = new Uint8Array(o.pending_buf_size), o.sym_buf = o.lit_bufsize, o.sym_end = 3 * (o.lit_bufsize - 1), o.level = e, o.strategy = s, o.method = t, Ta(r);
4411
4411
  }, Wt = { deflateInit: function(r, e) {
4412
- return Gs(r, e, Ur, 15, 8, Af);
4412
+ return Gs(r, e, Ur, 15, 8, Df);
4413
4413
  }, deflateInit2: Gs, deflateReset: Ta, deflateResetKeep: wa, deflateSetHeader: function(r, e) {
4414
4414
  return Ht(r) || r.state.wrap !== 2 ? Ce : (r.state.gzhead = e, ie);
4415
4415
  }, deflate: function(r, e) {
@@ -4486,7 +4486,7 @@ var Ht = function(r) {
4486
4486
  if (f.match_length = 0, m = qe(f, 0, f.window[f.strstart]), f.lookahead--, f.strstart++, m && (he(f, !1), f.strm.avail_out === 0)) return 1;
4487
4487
  }
4488
4488
  return f.insert = 0, v === ge ? (he(f, !0), f.strm.avail_out === 0 ? 3 : 4) : f.sym_next && (he(f, !1), f.strm.avail_out === 0) ? 1 : 2;
4489
- }(t, e) : t.strategy === kf ? function(f, v) {
4489
+ }(t, e) : t.strategy === Rf ? function(f, v) {
4490
4490
  for (var m, S, y, _, E = f.window; ; ) {
4491
4491
  if (f.lookahead <= 258) {
4492
4492
  if (St(f), f.lookahead <= 258 && v === Ke) return 1;
@@ -4504,13 +4504,13 @@ var Ht = function(r) {
4504
4504
  return f.insert = 0, v === ge ? (he(f, !0), f.strm.avail_out === 0 ? 3 : 4) : f.sym_next && (he(f, !1), f.strm.avail_out === 0) ? 1 : 2;
4505
4505
  }(t, e) : jt[t.level].func(t, e);
4506
4506
  if (p !== 3 && p !== 4 || (t.status = 666), p === 1 || p === 3) return r.avail_out === 0 && (t.last_flush = -1), ie;
4507
- if (p === 2 && (e === Ef ? Sf(t) : e !== Ls && (Yi(t, 0, 0, !1), e === Cf && (Ve(t.head), t.lookahead === 0 && (t.strstart = 0, t.block_start = 0, t.insert = 0))), ue(r), r.avail_out === 0)) return t.last_flush = -1, ie;
4507
+ if (p === 2 && (e === Cf ? Ef(t) : e !== Ls && (Yi(t, 0, 0, !1), e === wf && (Ve(t.head), t.lookahead === 0 && (t.strstart = 0, t.block_start = 0, t.insert = 0))), ue(r), r.avail_out === 0)) return t.last_flush = -1, ie;
4508
4508
  }
4509
4509
  return e !== ge ? ie : t.wrap <= 0 ? Us : (t.wrap === 2 ? (N(t, 255 & r.adler), N(t, r.adler >> 8 & 255), N(t, r.adler >> 16 & 255), N(t, r.adler >> 24 & 255), N(t, 255 & r.total_in), N(t, r.total_in >> 8 & 255), N(t, r.total_in >> 16 & 255), N(t, r.total_in >> 24 & 255)) : (Ut(t, r.adler >>> 16), Ut(t, 65535 & r.adler)), ue(r), t.wrap > 0 && (t.wrap = -t.wrap), t.pending !== 0 ? ie : Us);
4510
4510
  }, deflateEnd: function(r) {
4511
4511
  if (Ht(r)) return Ce;
4512
4512
  var e = r.state.status;
4513
- return r.state = null, e === 113 ? et(r, wf) : ie;
4513
+ return r.state = null, e === 113 ? et(r, Tf) : ie;
4514
4514
  }, deflateSetDictionary: function(r, e) {
4515
4515
  var t = e.length;
4516
4516
  if (Ht(r)) return Ce;
@@ -4530,14 +4530,14 @@ var Ht = function(r) {
4530
4530
  i.strstart = c, i.lookahead = 2, St(i);
4531
4531
  }
4532
4532
  return i.strstart += i.lookahead, i.block_start = i.strstart, i.insert = i.lookahead, i.lookahead = 0, i.match_length = i.prev_length = 2, i.match_available = 0, r.next_in = o, r.input = d, r.avail_in = a, i.wrap = n, ie;
4533
- }, deflateInfo: "pako deflate (from Nodeca project)" }, Uf = function(r, e) {
4533
+ }, deflateInfo: "pako deflate (from Nodeca project)" }, Nf = function(r, e) {
4534
4534
  return Object.prototype.hasOwnProperty.call(r, e);
4535
4535
  }, ti = { assign: function(r) {
4536
4536
  for (var e = Array.prototype.slice.call(arguments, 1); e.length; ) {
4537
4537
  var t = e.shift();
4538
4538
  if (t) {
4539
4539
  if (typeof t != "object") throw new TypeError(t + "must be non-object");
4540
- for (var i in t) Uf(t, i) && (r[i] = t[i]);
4540
+ for (var i in t) Nf(t, i) && (r[i] = t[i]);
4541
4541
  }
4542
4542
  }
4543
4543
  return r;
@@ -4589,9 +4589,9 @@ var dr = { string2buf: function(r) {
4589
4589
  return t < 0 || t === 0 ? e : t + ur[r[t]] > e ? t : e;
4590
4590
  } }, ka = function() {
4591
4591
  this.input = null, this.next_in = 0, this.avail_in = 0, this.total_in = 0, this.output = null, this.next_out = 0, this.avail_out = 0, this.total_out = 0, this.msg = "", this.state = null, this.data_type = 2, this.adler = 0;
4592
- }, Ra = Object.prototype.toString, Nf = I.Z_NO_FLUSH, Gf = I.Z_SYNC_FLUSH, Bf = I.Z_FULL_FLUSH, Vf = I.Z_FINISH, Nr = I.Z_OK, Ff = I.Z_STREAM_END, jf = I.Z_DEFAULT_COMPRESSION, Hf = I.Z_DEFAULT_STRATEGY, $f = I.Z_DEFLATED;
4592
+ }, Ra = Object.prototype.toString, Gf = I.Z_NO_FLUSH, Bf = I.Z_SYNC_FLUSH, Vf = I.Z_FULL_FLUSH, Ff = I.Z_FINISH, Nr = I.Z_OK, jf = I.Z_STREAM_END, Hf = I.Z_DEFAULT_COMPRESSION, $f = I.Z_DEFAULT_STRATEGY, qf = I.Z_DEFLATED;
4593
4593
  function Jt(r) {
4594
- this.options = ti.assign({ level: jf, method: $f, chunkSize: 16384, windowBits: 15, memLevel: 8, strategy: Hf }, r || {});
4594
+ this.options = ti.assign({ level: Hf, method: qf, chunkSize: 16384, windowBits: 15, memLevel: 8, strategy: $f }, r || {});
4595
4595
  var e = this.options;
4596
4596
  e.raw && e.windowBits > 0 ? e.windowBits = -e.windowBits : e.gzip && e.windowBits > 0 && e.windowBits < 16 && (e.windowBits += 16), this.err = 0, this.msg = "", this.ended = !1, this.chunks = [], this.strm = new ka(), this.strm.avail_out = 0;
4597
4597
  var t = Wt.deflateInit2(this.strm, e.level, e.method, e.windowBits, e.memLevel, e.strategy);
@@ -4610,9 +4610,9 @@ function Si(r, e) {
4610
4610
  Jt.prototype.push = function(r, e) {
4611
4611
  var t, i, n = this.strm, s = this.options.chunkSize;
4612
4612
  if (this.ended) return !1;
4613
- for (i = e === ~~e ? e : e === !0 ? Vf : Nf, typeof r == "string" ? n.input = dr.string2buf(r) : Ra.call(r) === "[object ArrayBuffer]" ? n.input = new Uint8Array(r) : n.input = r, n.next_in = 0, n.avail_in = n.input.length; ; ) if (n.avail_out === 0 && (n.output = new Uint8Array(s), n.next_out = 0, n.avail_out = s), (i === Gf || i === Bf) && n.avail_out <= 6) this.onData(n.output.subarray(0, n.next_out)), n.avail_out = 0;
4613
+ for (i = e === ~~e ? e : e === !0 ? Ff : Gf, typeof r == "string" ? n.input = dr.string2buf(r) : Ra.call(r) === "[object ArrayBuffer]" ? n.input = new Uint8Array(r) : n.input = r, n.next_in = 0, n.avail_in = n.input.length; ; ) if (n.avail_out === 0 && (n.output = new Uint8Array(s), n.next_out = 0, n.avail_out = s), (i === Bf || i === Vf) && n.avail_out <= 6) this.onData(n.output.subarray(0, n.next_out)), n.avail_out = 0;
4614
4614
  else {
4615
- if ((t = Wt.deflate(n, i)) === Ff) return n.next_out > 0 && this.onData(n.output.subarray(0, n.next_out)), t = Wt.deflateEnd(this.strm), this.onEnd(t), this.ended = !0, t === Nr;
4615
+ if ((t = Wt.deflate(n, i)) === jf) return n.next_out > 0 && this.onData(n.output.subarray(0, n.next_out)), t = Wt.deflateEnd(this.strm), this.onEnd(t), this.ended = !0, t === Nr;
4616
4616
  if (n.avail_out !== 0) {
4617
4617
  if (i > 0 && n.next_out > 0) this.onData(n.output.subarray(0, n.next_out)), n.avail_out = 0;
4618
4618
  else if (n.avail_in === 0) break;
@@ -4628,7 +4628,7 @@ var br = { Deflate: Jt, deflate: Si, deflateRaw: function(r, e) {
4628
4628
  return (e = e || {}).raw = !0, Si(r, e);
4629
4629
  }, gzip: function(r, e) {
4630
4630
  return (e = e || {}).gzip = !0, Si(r, e);
4631
- }, constants: I }, qf = function(r, e) {
4631
+ }, constants: I }, Kf = function(r, e) {
4632
4632
  var t, i, n, s, a, o, d, c, u, l, h, p, f, v, m, S, y, _, E, z, w, A, k, T, R = r.state;
4633
4633
  t = r.next_in, k = r.input, i = t + (r.avail_in - 5), n = r.next_out, T = r.output, s = n - (e - r.avail_out), a = n + (r.avail_out - 257), o = R.dmax, d = R.wsize, c = R.whave, u = R.wnext, l = R.window, h = R.hold, p = R.bits, f = R.lencode, v = R.distcode, m = (1 << R.lenbits) - 1, S = (1 << R.distbits) - 1;
4634
4634
  e: do {
@@ -4712,7 +4712,7 @@ var br = { Deflate: Jt, deflate: Si, deflateRaw: function(r, e) {
4712
4712
  }
4713
4713
  } while (t < i && n < a);
4714
4714
  t -= E = p >> 3, h &= (1 << (p -= E << 3)) - 1, r.next_in = t, r.next_out = n, r.avail_in = t < i ? i - t + 5 : 5 - (t - i), r.avail_out = n < a ? a - n + 257 : 257 - (n - a), R.hold = h, R.bits = p;
4715
- }, Kf = new Uint16Array([3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0]), Wf = new Uint8Array([16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78]), Jf = new Uint16Array([1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577, 0, 0]), Zf = new Uint8Array([16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 64, 64]), Zt = function(r, e, t, i, n, s, a, o) {
4715
+ }, Wf = new Uint16Array([3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0]), Jf = new Uint8Array([16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78]), Zf = new Uint16Array([1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577, 0, 0]), Xf = new Uint8Array([16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 64, 64]), Zt = function(r, e, t, i, n, s, a, o) {
4716
4716
  var d, c, u, l, h, p, f, v, m, S = o.bits, y = 0, _ = 0, E = 0, z = 0, w = 0, A = 0, k = 0, T = 0, R = 0, P = 0, H = null, B = new Uint16Array(16), $ = new Uint16Array(16), q = null;
4717
4717
  for (y = 0; y <= 15; y++) B[y] = 0;
4718
4718
  for (_ = 0; _ < i; _++) B[e[t + _]]++;
@@ -4723,7 +4723,7 @@ var br = { Deflate: Jt, deflate: Si, deflateRaw: function(r, e) {
4723
4723
  if (T > 0 && (r === 0 || z !== 1)) return -1;
4724
4724
  for ($[1] = 0, y = 1; y < 15; y++) $[y + 1] = $[y] + B[y];
4725
4725
  for (_ = 0; _ < i; _++) e[t + _] !== 0 && (a[$[e[t + _]]++] = _);
4726
- if (r === 0 ? (H = q = a, p = 20) : r === 1 ? (H = Kf, q = Wf, p = 257) : (H = Jf, q = Zf, p = 0), P = 0, _ = 0, y = E, h = s, A = w, k = 0, u = -1, l = (R = 1 << w) - 1, r === 1 && R > 852 || r === 2 && R > 592) return 1;
4726
+ if (r === 0 ? (H = q = a, p = 20) : r === 1 ? (H = Wf, q = Jf, p = 257) : (H = Zf, q = Xf, p = 0), P = 0, _ = 0, y = E, h = s, A = w, k = 0, u = -1, l = (R = 1 << w) - 1, r === 1 && R > 852 || r === 2 && R > 592) return 1;
4727
4727
  for (; ; ) {
4728
4728
  f = y - k, a[_] + 1 < p ? (v = 0, m = a[_]) : a[_] >= p ? (v = q[a[_] - p], m = H[a[_] - p]) : (v = 96, m = 0), d = 1 << y - k, E = c = 1 << A;
4729
4729
  do
@@ -4741,10 +4741,10 @@ var br = { Deflate: Jt, deflate: Si, deflateRaw: function(r, e) {
4741
4741
  }
4742
4742
  }
4743
4743
  return P !== 0 && (n[h + P] = y - k << 24 | 64 << 16 | 0), o.bits = w, 0;
4744
- }, Bs = I.Z_FINISH, Xf = I.Z_BLOCK, Sr = I.Z_TREES, tt = I.Z_OK, Yf = I.Z_STREAM_END, Qf = I.Z_NEED_DICT, _e = I.Z_STREAM_ERROR, Vs = I.Z_DATA_ERROR, Fs = I.Z_MEM_ERROR, em = I.Z_BUF_ERROR, js = I.Z_DEFLATED, Hs = function(r) {
4744
+ }, Bs = I.Z_FINISH, Yf = I.Z_BLOCK, Sr = I.Z_TREES, tt = I.Z_OK, Qf = I.Z_STREAM_END, em = I.Z_NEED_DICT, _e = I.Z_STREAM_ERROR, Vs = I.Z_DATA_ERROR, Fs = I.Z_MEM_ERROR, tm = I.Z_BUF_ERROR, js = I.Z_DEFLATED, Hs = function(r) {
4745
4745
  return (r >>> 24 & 255) + (r >>> 8 & 65280) + ((65280 & r) << 8) + ((255 & r) << 24);
4746
4746
  };
4747
- function tm() {
4747
+ function rm() {
4748
4748
  this.strm = null, this.mode = 0, this.last = !1, this.wrap = 0, this.havedict = !1, this.flags = 0, this.dmax = 0, this.check = 0, this.total = 0, this.head = null, this.wbits = 0, this.wsize = 0, this.whave = 0, this.wnext = 0, this.window = null, this.hold = 0, this.bits = 0, this.length = 0, this.offset = 0, this.extra = 0, this.lencode = null, this.distcode = null, this.lenbits = 0, this.distbits = 0, this.ncode = 0, this.nlen = 0, this.ndist = 0, this.have = 0, this.next = null, this.lens = new Uint16Array(320), this.work = new Uint16Array(288), this.lendyn = null, this.distdyn = null, this.sane = 0, this.back = 0, this.was = 0;
4749
4749
  }
4750
4750
  var Ei, Ci, nt = function(r) {
@@ -4766,11 +4766,11 @@ var Ei, Ci, nt = function(r) {
4766
4766
  return e < 0 ? (t = 0, e = -e) : (t = 5 + (e >> 4), e < 48 && (e &= 15)), e && (e < 8 || e > 15) ? _e : (i.window !== null && i.wbits !== e && (i.window = null), i.wrap = t, i.wbits = e, Da(r));
4767
4767
  }, $s = function(r, e) {
4768
4768
  if (!r) return _e;
4769
- var t = new tm();
4769
+ var t = new rm();
4770
4770
  r.state = t, t.strm = r, t.window = null, t.mode = 16180;
4771
4771
  var i = xa(r, e);
4772
4772
  return i !== tt && (r.state = null), i;
4773
- }, qs = !0, rm = function(r) {
4773
+ }, qs = !0, im = function(r) {
4774
4774
  if (qs) {
4775
4775
  Ei = new Int32Array(512), Ci = new Int32Array(32);
4776
4776
  for (var e = 0; e < 144; ) r.lens[e++] = 8;
@@ -4897,10 +4897,10 @@ var Ei, Ci, nt = function(r) {
4897
4897
  }
4898
4898
  r.adler = t.check = Hs(c), c = 0, u = 0, t.mode = 16190;
4899
4899
  case 16190:
4900
- if (t.havedict === 0) return r.next_out = a, r.avail_out = d, r.next_in = s, r.avail_in = o, t.hold = c, t.bits = u, Qf;
4900
+ if (t.havedict === 0) return r.next_out = a, r.avail_out = d, r.next_in = s, r.avail_in = o, t.hold = c, t.bits = u, em;
4901
4901
  r.adler = t.check = 1, t.mode = 16191;
4902
4902
  case 16191:
4903
- if (e === Xf || e === Sr) break e;
4903
+ if (e === Yf || e === Sr) break e;
4904
4904
  case 16192:
4905
4905
  if (t.last) {
4906
4906
  c >>>= 7 & u, u -= 7 & u, t.mode = 16206;
@@ -4915,7 +4915,7 @@ var Ei, Ci, nt = function(r) {
4915
4915
  t.mode = 16193;
4916
4916
  break;
4917
4917
  case 1:
4918
- if (rm(t), t.mode = 16199, e === Sr) {
4918
+ if (im(t), t.mode = 16199, e === Sr) {
4919
4919
  c >>>= 2, u -= 2;
4920
4920
  break e;
4921
4921
  }
@@ -5028,7 +5028,7 @@ var Ei, Ci, nt = function(r) {
5028
5028
  t.mode = 16200;
5029
5029
  case 16200:
5030
5030
  if (o >= 6 && d >= 258) {
5031
- r.next_out = a, r.avail_out = d, r.next_in = s, r.avail_in = o, t.hold = c, t.bits = u, qf(r, h), a = r.next_out, n = r.output, d = r.avail_out, s = r.next_in, i = r.input, o = r.avail_in, c = t.hold, u = t.bits, t.mode === 16191 && (t.back = -1);
5031
+ r.next_out = a, r.avail_out = d, r.next_in = s, r.avail_in = o, t.hold = c, t.bits = u, Kf(r, h), a = r.next_out, n = r.output, d = r.avail_out, s = r.next_in, i = r.input, o = r.avail_in, c = t.hold, u = t.bits, t.mode === 16191 && (t.back = -1);
5032
5032
  break;
5033
5033
  }
5034
5034
  for (t.back = 0; S = (R = t.lencode[c & (1 << t.lenbits) - 1]) >>> 16 & 255, y = 65535 & R, !((m = R >>> 24) <= u); ) {
@@ -5140,7 +5140,7 @@ var Ei, Ci, nt = function(r) {
5140
5140
  }
5141
5141
  t.mode = 16208;
5142
5142
  case 16208:
5143
- A = Yf;
5143
+ A = Qf;
5144
5144
  break e;
5145
5145
  case 16209:
5146
5146
  A = Vs;
@@ -5151,7 +5151,7 @@ var Ei, Ci, nt = function(r) {
5151
5151
  default:
5152
5152
  return _e;
5153
5153
  }
5154
- return r.next_out = a, r.avail_out = d, r.next_in = s, r.avail_in = o, t.hold = c, t.bits = u, (t.wsize || h !== r.avail_out && t.mode < 16209 && (t.mode < 16206 || e !== Bs)) && Ks(r, r.output, r.next_out, h - r.avail_out), l -= r.avail_in, h -= r.avail_out, r.total_in += l, r.total_out += h, t.total += h, 4 & t.wrap && h && (r.adler = t.check = t.flags ? ee(t.check, n, h, r.next_out - h) : Kt(t.check, n, h, r.next_out - h)), r.data_type = t.bits + (t.last ? 64 : 0) + (t.mode === 16191 ? 128 : 0) + (t.mode === 16199 || t.mode === 16194 ? 256 : 0), (l === 0 && h === 0 || e === Bs) && A === tt && (A = em), A;
5154
+ return r.next_out = a, r.avail_out = d, r.next_in = s, r.avail_in = o, t.hold = c, t.bits = u, (t.wsize || h !== r.avail_out && t.mode < 16209 && (t.mode < 16206 || e !== Bs)) && Ks(r, r.output, r.next_out, h - r.avail_out), l -= r.avail_in, h -= r.avail_out, r.total_in += l, r.total_out += h, t.total += h, 4 & t.wrap && h && (r.adler = t.check = t.flags ? ee(t.check, n, h, r.next_out - h) : Kt(t.check, n, h, r.next_out - h)), r.data_type = t.bits + (t.last ? 64 : 0) + (t.mode === 16191 ? 128 : 0) + (t.mode === 16199 || t.mode === 16194 ? 256 : 0), (l === 0 && h === 0 || e === Bs) && A === tt && (A = tm), A;
5155
5155
  }, inflateEnd: function(r) {
5156
5156
  if (nt(r)) return _e;
5157
5157
  var e = r.state;
@@ -5163,16 +5163,16 @@ var Ei, Ci, nt = function(r) {
5163
5163
  }, inflateSetDictionary: function(r, e) {
5164
5164
  var t, i = e.length;
5165
5165
  return nt(r) || (t = r.state).wrap !== 0 && t.mode !== 16190 ? _e : t.mode === 16190 && Kt(1, e, i, 0) !== t.check ? Vs : Ks(r, e, i, i) ? (t.mode = 16210, Fs) : (t.havedict = 1, tt);
5166
- }, inflateInfo: "pako inflate (from Nodeca project)" }, im = function() {
5166
+ }, inflateInfo: "pako inflate (from Nodeca project)" }, nm = function() {
5167
5167
  this.text = 0, this.time = 0, this.xflags = 0, this.os = 0, this.extra = null, this.extra_len = 0, this.name = "", this.comment = "", this.hcrc = 0, this.done = !1;
5168
- }, Pa = Object.prototype.toString, nm = I.Z_NO_FLUSH, sm = I.Z_FINISH, Xt = I.Z_OK, wi = I.Z_STREAM_END, Ti = I.Z_NEED_DICT, om = I.Z_STREAM_ERROR, Ws = I.Z_DATA_ERROR, am = I.Z_MEM_ERROR;
5168
+ }, Pa = Object.prototype.toString, sm = I.Z_NO_FLUSH, om = I.Z_FINISH, Xt = I.Z_OK, wi = I.Z_STREAM_END, Ti = I.Z_NEED_DICT, am = I.Z_STREAM_ERROR, Ws = I.Z_DATA_ERROR, cm = I.Z_MEM_ERROR;
5169
5169
  function Yt(r) {
5170
5170
  this.options = ti.assign({ chunkSize: 65536, windowBits: 15, to: "" }, r || {});
5171
5171
  var e = this.options;
5172
5172
  e.raw && e.windowBits >= 0 && e.windowBits < 16 && (e.windowBits = -e.windowBits, e.windowBits === 0 && (e.windowBits = -15)), !(e.windowBits >= 0 && e.windowBits < 16) || r && r.windowBits || (e.windowBits += 32), e.windowBits > 15 && e.windowBits < 48 && !(15 & e.windowBits) && (e.windowBits |= 15), this.err = 0, this.msg = "", this.ended = !1, this.chunks = [], this.strm = new ka(), this.strm.avail_out = 0;
5173
5173
  var t = xe.inflateInit2(this.strm, e.windowBits);
5174
5174
  if (t !== Xt) throw new Error(at[t]);
5175
- if (this.header = new im(), xe.inflateGetHeader(this.strm, this.header), e.dictionary && (typeof e.dictionary == "string" ? e.dictionary = dr.string2buf(e.dictionary) : Pa.call(e.dictionary) === "[object ArrayBuffer]" && (e.dictionary = new Uint8Array(e.dictionary)), e.raw && (t = xe.inflateSetDictionary(this.strm, e.dictionary)) !== Xt)) throw new Error(at[t]);
5175
+ if (this.header = new nm(), xe.inflateGetHeader(this.strm, this.header), e.dictionary && (typeof e.dictionary == "string" ? e.dictionary = dr.string2buf(e.dictionary) : Pa.call(e.dictionary) === "[object ArrayBuffer]" && (e.dictionary = new Uint8Array(e.dictionary)), e.raw && (t = xe.inflateSetDictionary(this.strm, e.dictionary)) !== Xt)) throw new Error(at[t]);
5176
5176
  }
5177
5177
  function zi(r, e) {
5178
5178
  var t = new Yt(e);
@@ -5182,13 +5182,13 @@ function zi(r, e) {
5182
5182
  Yt.prototype.push = function(r, e) {
5183
5183
  var t, i, n, s = this.strm, a = this.options.chunkSize, o = this.options.dictionary;
5184
5184
  if (this.ended) return !1;
5185
- for (i = e === ~~e ? e : e === !0 ? sm : nm, Pa.call(r) === "[object ArrayBuffer]" ? s.input = new Uint8Array(r) : s.input = r, s.next_in = 0, s.avail_in = s.input.length; ; ) {
5185
+ for (i = e === ~~e ? e : e === !0 ? om : sm, Pa.call(r) === "[object ArrayBuffer]" ? s.input = new Uint8Array(r) : s.input = r, s.next_in = 0, s.avail_in = s.input.length; ; ) {
5186
5186
  for (s.avail_out === 0 && (s.output = new Uint8Array(a), s.next_out = 0, s.avail_out = a), (t = xe.inflate(s, i)) === Ti && o && ((t = xe.inflateSetDictionary(s, o)) === Xt ? t = xe.inflate(s, i) : t === Ws && (t = Ti)); s.avail_in > 0 && t === wi && s.state.wrap > 0 && r[s.next_in] !== 0; ) xe.inflateReset(s), t = xe.inflate(s, i);
5187
5187
  switch (t) {
5188
- case om:
5188
+ case am:
5189
5189
  case Ws:
5190
5190
  case Ti:
5191
- case am:
5191
+ case cm:
5192
5192
  return this.onEnd(t), this.ended = !0, !1;
5193
5193
  }
5194
5194
  if (n = s.avail_out, s.next_out && (s.avail_out === 0 || t === wi)) if (this.options.to === "string") {
@@ -5208,12 +5208,12 @@ Yt.prototype.push = function(r, e) {
5208
5208
  };
5209
5209
  var Qt, Er = { Inflate: Yt, inflate: zi, inflateRaw: function(r, e) {
5210
5210
  return (e = e || {}).raw = !0, zi(r, e);
5211
- }, ungzip: zi, constants: I }, cm = { Deflate: br.Deflate, deflate: br.deflate, deflateRaw: br.deflateRaw, gzip: br.gzip, Inflate: Er.Inflate, inflate: Er.inflate, inflateRaw: Er.inflateRaw, ungzip: Er.ungzip, constants: I }, um = function() {
5211
+ }, ungzip: zi, constants: I }, um = { Deflate: br.Deflate, deflate: br.deflate, deflateRaw: br.deflateRaw, gzip: br.gzip, Inflate: Er.Inflate, inflate: Er.inflate, inflateRaw: Er.inflateRaw, ungzip: Er.ungzip, constants: I }, dm = function() {
5212
5212
  return !(!window.navigator || !window.navigator.sendBeacon);
5213
- }, dm = function() {
5213
+ }, hm = function() {
5214
5214
  function r(e, t) {
5215
5215
  var i = this;
5216
- this.collector = e, this.config = t, this.requestType = t.request_type || "xhr", this.supportBeacon = um(), this.errorCode = { NO_URL: 4001, IMG_ON: 4e3, IMG_CATCH: 4002, BEACON_FALSE: 4003, XHR_ON: 500, RESPONSE: 5001, TIMEOUT: 5005 }, this.customHeader = t.custom_request_header || {}, this.collector.on("custom-request-header", function(n) {
5216
+ this.collector = e, this.config = t, this.requestType = t.request_type || "xhr", this.supportBeacon = dm(), this.errorCode = { NO_URL: 4001, IMG_ON: 4e3, IMG_CATCH: 4002, BEACON_FALSE: 4003, XHR_ON: 500, RESPONSE: 5001, TIMEOUT: 5005 }, this.customHeader = t.custom_request_header || {}, this.collector.on("custom-request-header", function(n) {
5217
5217
  i.setRequestHeader(n);
5218
5218
  });
5219
5219
  }
@@ -5258,7 +5258,7 @@ var Qt, Er = { Inflate: Yt, inflate: zi, inflateRaw: function(r, e) {
5258
5258
  try {
5259
5259
  var S = JSON.stringify(n);
5260
5260
  if (this.config.need_zip && p) {
5261
- var y = new TextEncoder().encode(S), _ = cm.gzip(y);
5261
+ var y = new TextEncoder().encode(S), _ = um.gzip(y);
5262
5262
  f.setRequestHeader("Content-Encoding", "gzip"), f.send(_);
5263
5263
  } else f.send(S);
5264
5264
  } catch (E) {
@@ -5269,7 +5269,7 @@ var Qt, Er = { Inflate: Yt, inflate: zi, inflateRaw: function(r, e) {
5269
5269
  }
5270
5270
  else this.useFetch({ url: i, data: n, method: s, success: a, fail: o });
5271
5271
  }, r;
5272
- }(), hm = function() {
5272
+ }(), lm = function() {
5273
5273
  function r(e, t) {
5274
5274
  if (this.devToolReady = !1, this.devToolOrigin = "*", this.sendAlready = !1, !t.disable_debug && e.configManager.get("browser") !== "Microsoft Internet Explorer") {
5275
5275
  this.collect = e, this.config = t, this.app_id = t.app_id;
@@ -5422,9 +5422,9 @@ var Qt, Er = { Inflate: Yt, inflate: zi, inflateRaw: function(r, e) {
5422
5422
  window && window.postMessage({ type: "devtool:web:open-draw" }, location.origin);
5423
5423
  });
5424
5424
  }, r;
5425
- }(), ki = { autotrack: { src: { cn: te("1fz22z22z1nz21z4mz4bz4bz1jz1dz49z21z22z18z22z1gz1az4az18z1nz1nz1jz1mz1ez1az1bz1lz4az1az1mz1kz4bz1mz19z1hz4bz18z1nz1nz1jz1mz1ez49z21z1bz1iz49z21z22z18z22z1gz1az4bz1jz1mz1ez49z21z1bz1iz4bz1az1mz1jz1jz1cz1az22z4bz4hz4bz1nz1jz23z1ez1gz1lz4bz18z23z22z1mz22z20z18z1az1iz4az1hz21"), sg: "https://lf-global-static.iapplogcdn.com/obj/applog-sdk-static-sg/log-sdk/collect/5/plugin/autotrack.js", va: "https://lf-global-static.iapplogcdn.com/obj/applog-sdk-static-us/log-sdk/collect/5/plugin/autotrack.js" }, object: "LogAutoTrack" }, ab: { src: { cn: te("1fz22z22z1nz21z4mz4bz4bz1jz1dz49z21z22z18z22z1gz1az4az18z1nz1nz1jz1mz1ez1az1bz1lz4az1az1mz1kz4bz1mz19z1hz4bz18z1nz1nz1jz1mz1ez49z21z1bz1iz49z21z22z18z22z1gz1az4bz1jz1mz1ez49z21z1bz1iz4bz1az1mz1jz1jz1cz1az22z4bz4hz4bz1nz1jz23z1ez1gz1lz4bz18z19z4az1hz21"), sg: "https://lf-global-static.iapplogcdn.com/obj/applog-sdk-static-sg/log-sdk/collect/5/plugin/ab.js", va: "https://lf-global-static.iapplogcdn.com/obj/applog-sdk-static-us/log-sdk/collect/5/plugin/ab.js" }, object: "LogAb" }, stay: { src: { cn: te("1fz22z22z1nz21z4mz4bz4bz1jz1dz49z21z22z18z22z1gz1az4az18z1nz1nz1jz1mz1ez1az1bz1lz4az1az1mz1kz4bz1mz19z1hz4bz18z1nz1nz1jz1mz1ez49z21z1bz1iz49z21z22z18z22z1gz1az4bz1jz1mz1ez49z21z1bz1iz4bz1az1mz1jz1jz1cz1az22z4bz4hz4bz1nz1jz23z1ez1gz1lz4bz21z22z18z27z4az1hz21"), sg: "https://lf-global-static.iapplogcdn.com/obj/applog-sdk-static-sg/log-sdk/collect/5/plugin/stay.js", va: "https://lf-global-static.iapplogcdn.com/obj/applog-sdk-static-us/log-sdk/collect/5/plugin/stay.js" }, object: "LogStay" }, route: { src: { cn: te("1fz22z22z1nz21z4mz4bz4bz1jz1dz49z21z22z18z22z1gz1az4az18z1nz1nz1jz1mz1ez1az1bz1lz4az1az1mz1kz4bz1mz19z1hz4bz18z1nz1nz1jz1mz1ez49z21z1bz1iz49z21z22z18z22z1gz1az4bz1jz1mz1ez49z21z1bz1iz4bz1az1mz1jz1jz1cz1az22z4bz4hz4bz1nz1jz23z1ez1gz1lz4bz20z1mz23z22z1cz4az1hz21"), sg: "https://lf-global-static.iapplogcdn.com/obj/applog-sdk-static-sg/log-sdk/collect/5/plugin/route.js", va: "https://lf-global-static.iapplogcdn.com/obj/applog-sdk-static-us/log-sdk/collect/5/plugin/route.js" }, object: "LogRoute" }, tracer: { src: { cn: te("1fz22z22z1nz21z4mz4bz4bz1jz1dz49z21z22z18z22z1gz1az4az18z1nz1nz1jz1mz1ez1az1bz1lz4az1az1mz1kz4bz1mz19z1hz4bz18z1nz1nz1jz1mz1ez49z21z1bz1iz49z21z22z18z22z1gz1az4bz1jz1mz1ez49z21z1bz1iz4bz1az1mz1jz1jz1cz1az22z4bz4hz4bz1nz1jz23z1ez1gz1lz4bz22z20z18z1az1cz20z4az1hz21"), sg: "https://lf-global-static.iapplogcdn.com/obj/applog-sdk-static-sg/log-sdk/collect/5/plugin/tracer.js", va: "https://lf-global-static.iapplogcdn.com/obj/applog-sdk-static-us/log-sdk/collect/5/plugin/tracer.js" }, object: "LogTracer" }, retry: { src: { cn: te("1fz22z22z1nz21z4mz4bz4bz1jz1dz49z21z22z18z22z1gz1az4az18z1nz1nz1jz1mz1ez1az1bz1lz4az1az1mz1kz4bz1mz19z1hz4bz18z1nz1nz1jz1mz1ez49z21z1bz1iz49z21z22z18z22z1gz1az4bz1jz1mz1ez49z21z1bz1iz4bz1az1mz1jz1jz1cz1az22z4bz4hz4bz1nz1jz23z1ez1gz1lz4bz20z1cz22z20z27z4az1hz21"), sg: "https://lf-global-static.iapplogcdn.com/obj/applog-sdk-static-sg/log-sdk/collect/5/plugin/retry.js", va: "https://lf-global-static.iapplogcdn.com/obj/applog-sdk-static-us/log-sdk/collect/5/plugin/retry.js" }, object: "LogRetry" }, visual: { src: { cn: te("1fz22z22z1nz21z4mz4bz4bz1jz1dz49z21z22z18z22z1gz1az4az18z1nz1nz1jz1mz1ez1az1bz1lz4az1az1mz1kz4bz1mz19z1hz4bz18z1nz1nz1jz1mz1ez49z21z1bz1iz49z21z22z18z22z1gz1az4bz1jz1mz1ez49z21z1bz1iz4bz1az1mz1jz1jz1cz1az22z4bz4hz4bz1nz1jz23z1ez1gz1lz4bz24z1gz21z23z18z1jz4az1hz21"), sg: "https://lf-global-static.iapplogcdn.com/obj/applog-sdk-static-sg/log-sdk/collect/5/plugin/visual.js", va: "https://lf-global-static.iapplogcdn.com/obj/applog-sdk-static-us/log-sdk/collect/5/plugin/visual.js" }, object: "LogVisual" } }, lm = ["ab", "autotrack", "Stay", "store", "et", "profile", "cep", "heartbeat", "monitor", "route", "tracer"], fe = function() {
5425
+ }(), ki = { autotrack: { src: { cn: te("1fz22z22z1nz21z4mz4bz4bz1jz1dz49z21z22z18z22z1gz1az4az18z1nz1nz1jz1mz1ez1az1bz1lz4az1az1mz1kz4bz1mz19z1hz4bz18z1nz1nz1jz1mz1ez49z21z1bz1iz49z21z22z18z22z1gz1az4bz1jz1mz1ez49z21z1bz1iz4bz1az1mz1jz1jz1cz1az22z4bz4hz4bz1nz1jz23z1ez1gz1lz4bz18z23z22z1mz22z20z18z1az1iz4az1hz21"), sg: "https://lf-global-static.iapplogcdn.com/obj/applog-sdk-static-sg/log-sdk/collect/5/plugin/autotrack.js", va: "https://lf-global-static.iapplogcdn.com/obj/applog-sdk-static-us/log-sdk/collect/5/plugin/autotrack.js" }, object: "LogAutoTrack" }, ab: { src: { cn: te("1fz22z22z1nz21z4mz4bz4bz1jz1dz49z21z22z18z22z1gz1az4az18z1nz1nz1jz1mz1ez1az1bz1lz4az1az1mz1kz4bz1mz19z1hz4bz18z1nz1nz1jz1mz1ez49z21z1bz1iz49z21z22z18z22z1gz1az4bz1jz1mz1ez49z21z1bz1iz4bz1az1mz1jz1jz1cz1az22z4bz4hz4bz1nz1jz23z1ez1gz1lz4bz18z19z4az1hz21"), sg: "https://lf-global-static.iapplogcdn.com/obj/applog-sdk-static-sg/log-sdk/collect/5/plugin/ab.js", va: "https://lf-global-static.iapplogcdn.com/obj/applog-sdk-static-us/log-sdk/collect/5/plugin/ab.js" }, object: "LogAb" }, stay: { src: { cn: te("1fz22z22z1nz21z4mz4bz4bz1jz1dz49z21z22z18z22z1gz1az4az18z1nz1nz1jz1mz1ez1az1bz1lz4az1az1mz1kz4bz1mz19z1hz4bz18z1nz1nz1jz1mz1ez49z21z1bz1iz49z21z22z18z22z1gz1az4bz1jz1mz1ez49z21z1bz1iz4bz1az1mz1jz1jz1cz1az22z4bz4hz4bz1nz1jz23z1ez1gz1lz4bz21z22z18z27z4az1hz21"), sg: "https://lf-global-static.iapplogcdn.com/obj/applog-sdk-static-sg/log-sdk/collect/5/plugin/stay.js", va: "https://lf-global-static.iapplogcdn.com/obj/applog-sdk-static-us/log-sdk/collect/5/plugin/stay.js" }, object: "LogStay" }, route: { src: { cn: te("1fz22z22z1nz21z4mz4bz4bz1jz1dz49z21z22z18z22z1gz1az4az18z1nz1nz1jz1mz1ez1az1bz1lz4az1az1mz1kz4bz1mz19z1hz4bz18z1nz1nz1jz1mz1ez49z21z1bz1iz49z21z22z18z22z1gz1az4bz1jz1mz1ez49z21z1bz1iz4bz1az1mz1jz1jz1cz1az22z4bz4hz4bz1nz1jz23z1ez1gz1lz4bz20z1mz23z22z1cz4az1hz21"), sg: "https://lf-global-static.iapplogcdn.com/obj/applog-sdk-static-sg/log-sdk/collect/5/plugin/route.js", va: "https://lf-global-static.iapplogcdn.com/obj/applog-sdk-static-us/log-sdk/collect/5/plugin/route.js" }, object: "LogRoute" }, tracer: { src: { cn: te("1fz22z22z1nz21z4mz4bz4bz1jz1dz49z21z22z18z22z1gz1az4az18z1nz1nz1jz1mz1ez1az1bz1lz4az1az1mz1kz4bz1mz19z1hz4bz18z1nz1nz1jz1mz1ez49z21z1bz1iz49z21z22z18z22z1gz1az4bz1jz1mz1ez49z21z1bz1iz4bz1az1mz1jz1jz1cz1az22z4bz4hz4bz1nz1jz23z1ez1gz1lz4bz22z20z18z1az1cz20z4az1hz21"), sg: "https://lf-global-static.iapplogcdn.com/obj/applog-sdk-static-sg/log-sdk/collect/5/plugin/tracer.js", va: "https://lf-global-static.iapplogcdn.com/obj/applog-sdk-static-us/log-sdk/collect/5/plugin/tracer.js" }, object: "LogTracer" }, retry: { src: { cn: te("1fz22z22z1nz21z4mz4bz4bz1jz1dz49z21z22z18z22z1gz1az4az18z1nz1nz1jz1mz1ez1az1bz1lz4az1az1mz1kz4bz1mz19z1hz4bz18z1nz1nz1jz1mz1ez49z21z1bz1iz49z21z22z18z22z1gz1az4bz1jz1mz1ez49z21z1bz1iz4bz1az1mz1jz1jz1cz1az22z4bz4hz4bz1nz1jz23z1ez1gz1lz4bz20z1cz22z20z27z4az1hz21"), sg: "https://lf-global-static.iapplogcdn.com/obj/applog-sdk-static-sg/log-sdk/collect/5/plugin/retry.js", va: "https://lf-global-static.iapplogcdn.com/obj/applog-sdk-static-us/log-sdk/collect/5/plugin/retry.js" }, object: "LogRetry" }, visual: { src: { cn: te("1fz22z22z1nz21z4mz4bz4bz1jz1dz49z21z22z18z22z1gz1az4az18z1nz1nz1jz1mz1ez1az1bz1lz4az1az1mz1kz4bz1mz19z1hz4bz18z1nz1nz1jz1mz1ez49z21z1bz1iz49z21z22z18z22z1gz1az4bz1jz1mz1ez49z21z1bz1iz4bz1az1mz1jz1jz1cz1az22z4bz4hz4bz1nz1jz23z1ez1gz1lz4bz24z1gz21z23z18z1jz4az1hz21"), sg: "https://lf-global-static.iapplogcdn.com/obj/applog-sdk-static-sg/log-sdk/collect/5/plugin/visual.js", va: "https://lf-global-static.iapplogcdn.com/obj/applog-sdk-static-us/log-sdk/collect/5/plugin/visual.js" }, object: "LogVisual" } }, pm = ["ab", "autotrack", "Stay", "store", "et", "profile", "cep", "heartbeat", "monitor", "route", "tracer"], fe = function() {
5426
5426
  function r(e) {
5427
- this.disableAutoPageView = !1, this.bridgeReport = !1, this.staging = !1, this.pluginInstances = [], this.sended = !1, this.started = !1, this.destroy = !1, this.sdkReady = !1, this.adapters = {}, this.loadType = "base", this.sdkStop = !1, this.name = e, this.hook = new Zp(), this.remotePlugin = /* @__PURE__ */ new Map(), this.Types = C, this.adapters.storage = Ie, this.loadType = "full";
5427
+ this.disableAutoPageView = !1, this.bridgeReport = !1, this.staging = !1, this.pluginInstances = [], this.sended = !1, this.started = !1, this.destroy = !1, this.sdkReady = !1, this.adapters = {}, this.loadType = "base", this.sdkStop = !1, this.name = e, this.hook = new Xp(), this.remotePlugin = /* @__PURE__ */ new Map(), this.Types = C, this.adapters.storage = Ie, this.loadType = "full";
5428
5428
  }
5429
5429
  return r.usePlugin = function(e, t, i) {
5430
5430
  if (t) {
@@ -5436,12 +5436,12 @@ var Qt, Er = { Inflate: Yt, inflate: zi, inflateRaw: function(r, e) {
5436
5436
  n || r.plugins.push({ name: t, plugin: e, options: i });
5437
5437
  } else r.plugins.push({ plugin: e });
5438
5438
  }, r.prototype.usePlugin = function(e, t, i) {
5439
- e && (this.loadType === "full" && lm.includes(e) ? console.info("your sdk version has " + e + " plugin already ~") : t ? typeof t == "string" ? this.remotePlugin.get(e) || this.remotePlugin.set(e, { src: t, call: i }) : this.remotePlugin.get(e) || this.remotePlugin.set(e, { instance: t }) : this.remotePlugin.get(e) || this.remotePlugin.set(e, "sdk"));
5439
+ e && (this.loadType === "full" && pm.includes(e) ? console.info("your sdk version has " + e + " plugin already ~") : t ? typeof t == "string" ? this.remotePlugin.get(e) || this.remotePlugin.set(e, { src: t, call: i }) : this.remotePlugin.get(e) || this.remotePlugin.set(e, { instance: t }) : this.remotePlugin.get(e) || this.remotePlugin.set(e, "sdk"));
5440
5440
  }, r.prototype.init = function(e) {
5441
5441
  var t, i = this;
5442
- this.logger = new hf(this.name, e.log), this.inited ? this.logger.warn("[instance: " + this.name + "], every instance's api: init, can be call only one time!") : e && or(e) ? e.app_id && typeof (t = e.app_id) == "number" && !isNaN(t) ? !e.app_key || /* @__PURE__ */ function(n) {
5442
+ this.logger = new lf(this.name, e.log), this.inited ? this.logger.warn("[instance: " + this.name + "], every instance's api: init, can be call only one time!") : e && or(e) ? e.app_id && typeof (t = e.app_id) == "number" && !isNaN(t) ? !e.app_key || /* @__PURE__ */ function(n) {
5443
5443
  return typeof n == "string";
5444
- }(e.app_key) ? (e.channel_domain || ["cn", "sg", "va", "my"].indexOf(e.channel) !== -1 || (this.logger.warn("channel must be `cn`, `sg`,`va`, `my` !"), e.channel = "cn"), this.spider = new lf(), this.spider.checkSpider(e) ? this.logger.warn("your env may be a spider, can not report!") : (this.appBridge = new pf(this, e.enable_native), this.requestManager = new dm(this, e), this.bridgeReport = this.appBridge.bridgeInject(), this.configManager = new df(this, e), this.debugger = new hm(this, e), this.initConfig = e, this.emit(C.Init), this.emit(g.DEBUGGER_MESSAGE, { type: g.DEBUGGER_MESSAGE_SDK, info: "SDK 执行Init", data: e, level: "info", time: Date.now(), infoType: "cus" }), this.destroy = !1, e.disable_auto_pv && (this.disableAutoPageView = !0), this.bridgeReport || (this.configManager.set({ app_id: e.app_id }), this.eventManager = new mf(), this.tokenManager = new _f(), this.sessionManager = new ff(), Promise.all([new Promise(function(n) {
5444
+ }(e.app_key) ? (e.channel_domain || ["cn", "sg", "va", "my"].indexOf(e.channel) !== -1 || (this.logger.warn("channel must be `cn`, `sg`,`va`, `my` !"), e.channel = "cn"), this.spider = new pf(), this.spider.checkSpider(e) ? this.logger.warn("your env may be a spider, can not report!") : (this.appBridge = new ff(this, e.enable_native), this.requestManager = new hm(this, e), this.bridgeReport = this.appBridge.bridgeInject(), this.configManager = new hf(this, e), this.debugger = new lm(this, e), this.initConfig = e, this.emit(C.Init), this.emit(g.DEBUGGER_MESSAGE, { type: g.DEBUGGER_MESSAGE_SDK, info: "SDK 执行Init", data: e, level: "info", time: Date.now(), infoType: "cus" }), this.destroy = !1, e.disable_auto_pv && (this.disableAutoPageView = !0), this.bridgeReport || (this.configManager.set({ app_id: e.app_id }), this.eventManager = new _f(), this.tokenManager = new gf(), this.sessionManager = new mf(), Promise.all([new Promise(function(n) {
5445
5445
  i.once(C.TokenComplete, function() {
5446
5446
  n(!0);
5447
5447
  });
@@ -5547,7 +5547,7 @@ var Qt, Er = { Inflate: Yt, inflate: zi, inflateRaw: function(r, e) {
5547
5547
  var i = e;
5548
5548
  /^event\./.test(e) && (i = e.slice(6));
5549
5549
  var n = t;
5550
- typeof n != "object" && (n = {}), n.profile ? delete n.profile : n.event_index = Xp();
5550
+ typeof n != "object" && (n = {}), n.profile ? delete n.profile : n.event_index = Yp();
5551
5551
  var s = void 0;
5552
5552
  return n.local_ms ? (s = n.local_ms, delete n.local_ms) : s = +/* @__PURE__ */ new Date(), { event: i, params: n, local_time_ms: s, is_bav: this.initConfig && this.initConfig.autotrack ? 1 : 0 };
5553
5553
  } catch (a) {
@@ -5675,7 +5675,7 @@ var Qt, Er = { Inflate: Yt, inflate: zi, inflateRaw: function(r, e) {
5675
5675
  (function(r) {
5676
5676
  r[r.Var = 0] = "Var", r[r.All = 1] = "All";
5677
5677
  })(Qt || (Qt = {}));
5678
- var pm = function() {
5678
+ var fm = function() {
5679
5679
  function r() {
5680
5680
  this.fetchStatus = "no", this.refreshFetchStatus = "complete", this.versions = [], this.extVersions = [], this.mulilinkVersions = [], this.enable_multilink = !1, this.enable_ab_visual = !1, this.editMode = !1, this.callbacks = [], this.data = null, this.changeListener = /* @__PURE__ */ new Map(), this.readyStatus = !1, this.exposureCache = [];
5681
5681
  }
@@ -5880,7 +5880,7 @@ var pm = function() {
5880
5880
  t.fetchStatus = "complete", t.refreshFetchStatus = "complete", t.fetchComplete(null, s), t.collect.emit(t.types.AbTimeout), e && e(null), t.collect.emit(g.DEBUGGER_MESSAGE, { type: g.DEBUGGER_MESSAGE_SDK, secType: "AB", info: "AB实验请求网络异常", level: "error", logType: "fetch", time: Date.now(), infoType: "sdk" });
5881
5881
  }, timeout: this.timeout });
5882
5882
  }, r;
5883
- }(), fm = function() {
5883
+ }(), mm = function() {
5884
5884
  function r() {
5885
5885
  }
5886
5886
  return r.prototype.apply = function(e, t) {
@@ -5902,7 +5902,7 @@ function Gr(r, e, t) {
5902
5902
  return !1;
5903
5903
  }
5904
5904
  var Js = function(r, e) {
5905
- return !!_m(r, e);
5905
+ return !!gm(r, e);
5906
5906
  };
5907
5907
  function Ai(r, e) {
5908
5908
  for (var t = r; t && !Gr(t, "container", e.container_attr || ""); ) {
@@ -5911,7 +5911,7 @@ function Ai(r, e) {
5911
5911
  }
5912
5912
  return t || r;
5913
5913
  }
5914
- var mm = function(r) {
5914
+ var _m = function(r) {
5915
5915
  if (!r) return "";
5916
5916
  var e = "";
5917
5917
  try {
@@ -5934,7 +5934,7 @@ function Zs(r) {
5934
5934
  }
5935
5935
  var Br = function(r, e) {
5936
5936
  return r.hasAttribute ? r.hasAttribute(e) : r.attributes ? !(!r.attributes[e] || !r.attributes[e].specified) : void 0;
5937
- }, _m = function(r, e) {
5937
+ }, gm = function(r, e) {
5938
5938
  if (typeof e == "string") return Br(r, e);
5939
5939
  if (Or(e)) {
5940
5940
  for (var t = !1, i = 0; i < e.length; i++)
@@ -5966,7 +5966,7 @@ function Ia(r) {
5966
5966
  t.unshift(a), i.unshift(o);
5967
5967
  }), { element_path: "/" + t.join("/"), positions: i };
5968
5968
  }
5969
- var gm = function() {
5969
+ var vm = function() {
5970
5970
  function r(e, t) {
5971
5971
  this.maxDuration = 432e5, this.aliveDTime = 6e4, this.options = { aliveName: "predefine_page_alive", params: {}, container: null }, this.focusState = !0, this.collect = e, this.config = t, this.pageStartTime = Date.now(), this.sessionStartTime = this.pageStartTime, this.timerHandler = null, or(t.enable_stay_duration) && (this.options = Object.assign(this.options, t.enable_stay_duration)), this.hard = this.options.mode && this.options.mode === "hard", this.focusState = document.hasFocus(), this.aliveDTime = this.options.aliveTime || 6e4;
5972
5972
  }
@@ -6037,7 +6037,7 @@ var gm = function() {
6037
6037
  window.removeEventListener("blur", t), window.removeEventListener("focus", i);
6038
6038
  };
6039
6039
  }, r;
6040
- }(), vm = function() {
6040
+ }(), ym = function() {
6041
6041
  function r(e, t) {
6042
6042
  var i = this;
6043
6043
  this.maxDuration = 432e5, this.aliveDTime = 6e4, this.options = { closeName: "predefine_page_close", params: {} }, this.focusState = !0, this.visibilitychange = function() {
@@ -6088,13 +6088,13 @@ var gm = function() {
6088
6088
  window.removeEventListener("blur", t), window.removeEventListener("focus", i);
6089
6089
  };
6090
6090
  }, r;
6091
- }(), ym = function() {
6091
+ }(), bm = function() {
6092
6092
  function r() {
6093
6093
  }
6094
6094
  return r.prototype.apply = function(e, t) {
6095
6095
  var i = this;
6096
6096
  if (this.collect = e, this.config = t, this.config.enable_stay_duration) {
6097
- this.title = document.title || location.pathname, this.url = location.href, this.url_path = location.pathname, this.pageAlive = new gm(e, t), this.pageClose = new vm(e, t);
6097
+ this.title = document.title || location.pathname, this.url = location.href, this.url_path = location.pathname, this.pageAlive = new vm(e, t), this.pageClose = new ym(e, t);
6098
6098
  var n = this.collect.Types;
6099
6099
  this.collect.on(n.DestoryInstance, function() {
6100
6100
  i.disable();
@@ -6131,7 +6131,7 @@ var gm = function() {
6131
6131
  }, r.prototype.resetStayDuration = function(e, t, i) {
6132
6132
  this.reset(e, t, i), this.collect.emit(g.DEBUGGER_MESSAGE, { type: g.DEBUGGER_MESSAGE_SDK, info: "SDK 执行 resetStayDuration", level: "info", time: Date.now(), data: { url_path: e, title: t, url: i } });
6133
6133
  }, r;
6134
- }(), bm = function() {
6134
+ }(), Sm = function() {
6135
6135
  function r() {
6136
6136
  }
6137
6137
  return r.prototype.apply = function(e, t) {
@@ -6232,11 +6232,11 @@ var gm = function() {
6232
6232
  }, r.prototype.unReady = function() {
6233
6233
  console.warn("sdk is not ready, please use this api after start");
6234
6234
  }, r;
6235
- }(), Sm = function() {
6235
+ }(), Em = function() {
6236
6236
  function r() {
6237
6237
  var e = this;
6238
6238
  this.setInterval = function() {
6239
- e.clearIntervalFunc = Qp(function() {
6239
+ e.clearIntervalFunc = ef(function() {
6240
6240
  e.isSessionhasEvent && e.endCurrentSession();
6241
6241
  }, e.sessionInterval);
6242
6242
  }, this.clearInterval = function() {
@@ -6259,7 +6259,7 @@ var gm = function() {
6259
6259
  var e = this.lastTime || +/* @__PURE__ */ new Date();
6260
6260
  this.lastTime = +/* @__PURE__ */ new Date(), this.lastTime - e > this.sessionInterval && (this.clearInterval(), this.endCurrentSession(), this.setInterval());
6261
6261
  }, r;
6262
- }(), Em = function() {
6262
+ }(), Cm = function() {
6263
6263
  function r() {
6264
6264
  }
6265
6265
  return r.prototype.apply = function(e, t) {
@@ -6317,7 +6317,7 @@ var gm = function() {
6317
6317
  } catch {
6318
6318
  }
6319
6319
  }, r;
6320
- }(), Cm = function(r) {
6320
+ }(), wm = function(r) {
6321
6321
  if (r.children.length) {
6322
6322
  var e = r.children;
6323
6323
  return ![].slice.call(e).some(function(t) {
@@ -6325,13 +6325,13 @@ var gm = function() {
6325
6325
  });
6326
6326
  }
6327
6327
  return !0;
6328
- }, wm = function(r) {
6328
+ }, Tm = function(r) {
6329
6329
  if (r.tagName.toLowerCase() === "svg") return !0;
6330
6330
  for (var e = r.parentElement, t = !1; e; ) e.tagName.toLowerCase() === "svg" ? (e = null, t = !0) : e = e.parentElement;
6331
6331
  return t;
6332
6332
  };
6333
- function Tm(r, e) {
6334
- if (r.nodeType !== 1 || !e.svg && wm(r) || ["HTML", "BODY"].includes(r.tagName.toUpperCase())) return !1;
6333
+ function zm(r, e) {
6334
+ if (r.nodeType !== 1 || !e.svg && Tm(r) || ["HTML", "BODY"].includes(r.tagName.toUpperCase())) return !1;
6335
6335
  var t = r;
6336
6336
  return t.style.display !== "none" && (!!Gr(t, "container", e.container_attr || "") || !!(function(i, n) {
6337
6337
  for (var s = i, a = !1; s && !Gr(s, "container", n.container_attr || ""); ) {
@@ -6339,13 +6339,13 @@ function Tm(r, e) {
6339
6339
  s = s.parentElement;
6340
6340
  }
6341
6341
  return a = !0;
6342
- }(t, e) || Cm(t) || e.svg));
6342
+ }(t, e) || wm(t) || e.svg));
6343
6343
  }
6344
- var zm = function() {
6344
+ var km = function() {
6345
6345
  function r(e, t, i) {
6346
6346
  var n = this;
6347
6347
  this.statistics = !1, this.pageView = !1, this.clickEvent = function(s) {
6348
- Tm(s.target, n.options) && n.eventHandel({ eventType: "dom", eventName: "click" }, s);
6348
+ zm(s.target, n.options) && n.eventHandel({ eventType: "dom", eventName: "click" }, s);
6349
6349
  }, this.changeEvent = function(s) {
6350
6350
  n.eventHandel({ eventType: "dom", eventName: "change" }, s);
6351
6351
  }, this.submitEvent = function(s) {
@@ -6423,7 +6423,7 @@ var zm = function() {
6423
6423
  }, r.prototype.getDefaultConfig = function() {
6424
6424
  return { is_html: 1, url: location.href, referrer: document.referrer, page_key: location.href, refer_page_key: document.referrer, page_title: document.title || location.pathname, page_manual_key: "", refer_page_manual_key: "", refer_page_title: "", page_path: location.pathname, page_host: location.host };
6425
6425
  }, r;
6426
- }(), km = { eventConfig: { mode: "proxy-capturing", submit: !1, click: !0, change: !1, pv: !0, beat: !0, hashTag: !1, impr: !1 }, scoutConfig: { mode: "xpath" } }, Rm = function() {
6426
+ }(), Rm = { eventConfig: { mode: "proxy-capturing", submit: !1, click: !0, change: !1, pv: !0, beat: !0, hashTag: !1, impr: !1 }, scoutConfig: { mode: "xpath" } }, Am = function() {
6427
6427
  function r(e, t) {
6428
6428
  this.config = e, this.config.eventConfig = Object.assign(this.config.eventConfig, t);
6429
6429
  }
@@ -6433,7 +6433,7 @@ var zm = function() {
6433
6433
  return this.config = e;
6434
6434
  }, r;
6435
6435
  }();
6436
- function Am(r, e, t, i) {
6436
+ function Dm(r, e, t, i) {
6437
6437
  var n = {}, s = function(k) {
6438
6438
  if (k) {
6439
6439
  var T = k.getBoundingClientRect(), R = T.width, P = T.height;
@@ -6455,7 +6455,7 @@ function Am(r, e, t, i) {
6455
6455
  }(e, t), v = window.performance.timing.navigationStart, m = Date.now() - v, S = p.map(function(k) {
6456
6456
  return "" + k;
6457
6457
  }), y = null;
6458
- if (window.TEAVisualEditor && window.TEAVisualEditor.getOriginXpath && (y = window.TEAVisualEditor.getOriginXpath({ xpath: h, positions: S })), n.element_path = y && y.xpath || h, n.positions = y && y.positions || S, i && !i.text && (n.texts = f, n.element_title = e.getAttribute("data-tea-title") || e.getAttribute("title") || mm(e)), n.element_id = e.getAttribute("id") || "", n.element_class_name = e.getAttribute("class") || "", n.element_type = e.nodeType, n.element_width = Math.floor(o), n.element_height = Math.floor(d), n.touch_x = c, n.touch_y = u, n.page_manual_key = "", n.elememt_manual_key = "", n.since_page_start_ms = m, n.page_start_ms = v, n.page_path = location.pathname, n.page_host = location.host, t.track_attr && Js(e, t.track_attr)) {
6458
+ if (window.TEAVisualEditor && window.TEAVisualEditor.getOriginXpath && (y = window.TEAVisualEditor.getOriginXpath({ xpath: h, positions: S })), n.element_path = y && y.xpath || h, n.positions = y && y.positions || S, i && !i.text && (n.texts = f, n.element_title = e.getAttribute("data-tea-title") || e.getAttribute("title") || _m(e)), n.element_id = e.getAttribute("id") || "", n.element_class_name = e.getAttribute("class") || "", n.element_type = e.nodeType, n.element_width = Math.floor(o), n.element_height = Math.floor(d), n.touch_x = c, n.touch_y = u, n.page_manual_key = "", n.elememt_manual_key = "", n.since_page_start_ms = m, n.page_start_ms = v, n.page_path = location.pathname, n.page_host = location.host, t.track_attr && Js(e, t.track_attr)) {
6459
6459
  var _ = Xs(e, t.track_attr);
6460
6460
  for (var E in _) n[E] = _[E];
6461
6461
  }
@@ -6472,8 +6472,8 @@ function Am(r, e, t, i) {
6472
6472
  return A.tagName === "A" && (n.href = A.getAttribute("href")), e.tagName === "IMG" && (n.src = e.getAttribute("src")), n;
6473
6473
  }
6474
6474
  var pt = function(r, e, t, i, n) {
6475
- return U(U({ event: r }, Am(e, t, i, n)), { is_html: 1, page_key: window.location.href, page_title: document.title });
6476
- }, Dm = function() {
6475
+ return U(U({ event: r }, Dm(e, t, i, n)), { is_html: 1, page_key: window.location.href, page_title: document.title });
6476
+ }, xm = function() {
6477
6477
  function r(e, t) {
6478
6478
  this.ignore = { text: !1 }, this.initConfig = e, this.options = t, this.eventName = t && t.custom === "tea" ? { click: "__bav_click", page: "__bav_page", beat: "__bav_beat", static: "__bav_page_statistics", exposure: "__bav_page_exposure", scroll: "__bav_slide" } : { click: "bav2b_click", page: "bav2b_page", beat: "bav2b_beat", static: "bav2b_page_statistics", exposure: "bav2b_exposure", scroll: "$bav2b_slide" }, t && t.text === !1 && (this.ignore.text = !0), t && t.exposure && t.exposure.eventName && (this.eventName.exposure = t.exposure.eventName);
6479
6479
  }
@@ -6544,7 +6544,7 @@ var pt = function(r, e, t, i, n) {
6544
6544
  if (i = Object.assign(i, e.params), !this.options.scroll.callback || (i = this.options.scroll.callback(i)) || Object.keys(i).length) return i;
6545
6545
  console.warn("scroll callback must return data!");
6546
6546
  }, r;
6547
- }(), xm = function() {
6547
+ }(), Pm = function() {
6548
6548
  function r(e) {
6549
6549
  this.collect = e, this.eventNameList = ["report_click_event", "report_change_event", "report_submit_event", "report_exposure_event", "report_page_view_event", "report_page_statistics_event", "report_beat_event"];
6550
6550
  }
@@ -6558,7 +6558,7 @@ var pt = function(r, e, t, i, n) {
6558
6558
  var i = Object.assign({ headers: { "content-type": "application/json" }, method: "POST" }, t);
6559
6559
  fetch(e, i);
6560
6560
  }, r;
6561
- }(), er = {}, Oa = [], Pm = function(r) {
6561
+ }(), er = {}, Oa = [], Im = function(r) {
6562
6562
  r.length && r.forEach(function(e) {
6563
6563
  Oa.push(e);
6564
6564
  });
@@ -6567,7 +6567,7 @@ function Ys(r, e, t, i) {
6567
6567
  var n = r && r.source || window.opener || window.parent, s = r && r.origin || i || "*", a = { type: e, payload: t };
6568
6568
  n.postMessage(JSON.stringify(a), s);
6569
6569
  }
6570
- function Im(r) {
6570
+ function Om(r) {
6571
6571
  if (Oa.some(function(n) {
6572
6572
  return r.origin.indexOf(n) > -1;
6573
6573
  })) {
@@ -6585,10 +6585,10 @@ function Im(r) {
6585
6585
  }
6586
6586
  }
6587
6587
  var Di = !1;
6588
- function Om(r, e) {
6588
+ function Mm(r, e) {
6589
6589
  window.TEAVisualEditor = window.TEAVisualEditor || {}, window.TEAVisualEditor.appId = e.app_id;
6590
6590
  var t = e.channel_domain, i = "";
6591
- if (Pm(of), t) {
6591
+ if (Im(af), t) {
6592
6592
  var n = void 0, s = "";
6593
6593
  try {
6594
6594
  var a = window.performance.getEntriesByType("resource");
@@ -6612,16 +6612,16 @@ function Om(r, e) {
6612
6612
  l[h] = c[h];
6613
6613
  }
6614
6614
  var p = c.domain;
6615
- (window.opener || window.parent).postMessage({ type: "tea:sdk:info", config: l, version: u }, p), window.addEventListener("message", Im, !1);
6615
+ (window.opener || window.parent).postMessage({ type: "tea:sdk:info", config: l, version: u }, p), window.addEventListener("message", Om, !1);
6616
6616
  })(e, $e);
6617
6617
  try {
6618
6618
  (function(c, u) {
6619
6619
  er[c] = er[c] || [], er[c].push(u);
6620
6620
  })("tea:openHeatMapCore", function(c) {
6621
- var u = sf, l = c.data.app_id;
6621
+ var u = of, l = c.data.app_id;
6622
6622
  l && l !== e.app_id || function(h) {
6623
6623
  var p = h.event, f = h.editorUrl, v = h.autoTrackInstance;
6624
- Di || (Di = !0, Yp(f, function() {
6624
+ Di || (Di = !0, Qp(f, function() {
6625
6625
  Ys(p, "editorScriptloadSuccess"), v.destroy();
6626
6626
  }, function() {
6627
6627
  p && Ys(p, "editorScriptloadError"), Di = !1;
@@ -6632,7 +6632,7 @@ function Om(r, e) {
6632
6632
  console.log("openHeatMapCore error");
6633
6633
  }
6634
6634
  }
6635
- var Ee, Mm = function() {
6635
+ var Ee, Lm = function() {
6636
6636
  function r(e, t) {
6637
6637
  this._instance = null, this._intersection = e, this.config = t, this._intersection && this.init();
6638
6638
  }
@@ -6681,7 +6681,7 @@ var Ee, Mm = function() {
6681
6681
  (function(r) {
6682
6682
  r[r.EXPOSURE_ONCE = 0] = "EXPOSURE_ONCE", r[r.LIFECYCLE_SHOW_NEW = 3] = "LIFECYCLE_SHOW_NEW", r[r.RESUME_FORM_PAGE = 6] = "RESUME_FORM_PAGE", r[r.RESUME_FORM_BACK = 7] = "RESUME_FORM_BACK", r[r.NOT_EXPOSURE = -1] = "NOT_EXPOSURE";
6683
6683
  })(Ee || (Ee = {}));
6684
- var rt, Lm = function() {
6684
+ var rt, Um = function() {
6685
6685
  function r(e, t, i) {
6686
6686
  var n = this;
6687
6687
  this.backStatus = !1, this.instance = this.buildObserver(), this.collect = e, this.observeMap = r._observer_map, t.autotrack.exposure.ratio ? this.ratio = t.autotrack.exposure.ratio : t.autotrack.exposure.ratio === 0 ? this.ratio = 0 : this.ratio = 0.5, this.timeLimit = t.autotrack.exposure.stay || 0, this.exposureType = Ee.NOT_EXPOSURE, this.eventHandle = i, this.hashMap = /* @__PURE__ */ new Map(), this.backStatus = !1, this.lastState = null, this.collect.on("re-start-sdk", function() {
@@ -6805,9 +6805,9 @@ var rt, Lm = function() {
6805
6805
  })(document, "visibilitychange", a, !1);
6806
6806
  };
6807
6807
  }, r._observer_instance = null, r._observer_map = /* @__PURE__ */ new Map(), r;
6808
- }(), Um = function() {
6808
+ }(), Nm = function() {
6809
6809
  function r(e, t, i) {
6810
- t.autotrack && t.autotrack.exposure && (this._intersection = new Lm(e, t, i), this._observer = new Mm(this._intersection, t), this._intersection && this._observer ? this.initObserver() : console.log("your browser version cannot support exposure event, please update~"));
6810
+ t.autotrack && t.autotrack.exposure && (this._intersection = new Um(e, t, i), this._observer = new Lm(this._intersection, t), this._intersection && this._observer ? this.initObserver() : console.log("your browser version cannot support exposure event, please update~"));
6811
6811
  }
6812
6812
  return r.prototype.initObserver = function() {
6813
6813
  var e = this;
@@ -6819,7 +6819,7 @@ var rt, Lm = function() {
6819
6819
  (function(r) {
6820
6820
  r[r.SCROLL_UP = 1] = "SCROLL_UP", r[r.SCROLL_DOWN = 2] = "SCROLL_DOWN", r[r.SCROLL_LEFT = 3] = "SCROLL_LEFT", r[r.SCROLL_RIGHT = 4] = "SCROLL_RIGHT", r[r.NOT_SCROLL = -1] = "NOT_SCROLL";
6821
6821
  })(rt || (rt = {}));
6822
- var Qs, Nm = function() {
6822
+ var Qs, Gm = function() {
6823
6823
  function r(e, t) {
6824
6824
  this.distance = 30, e.autotrack && e.autotrack.scroll && (e.autotrack.scroll.distance && (this.distance = e.autotrack.scroll.distance), this.eventHandle = t, this.addLinstenr(), this.mutation());
6825
6825
  }
@@ -6872,7 +6872,7 @@ var Qs, Nm = function() {
6872
6872
  console.warn("scroll event error", JSON.stringify(u));
6873
6873
  }
6874
6874
  }, r;
6875
- }(), Gm = { hashTag: !1, impr: !1 }, Bm = function() {
6875
+ }(), Bm = { hashTag: !1, impr: !1 }, Vm = function() {
6876
6876
  function r() {
6877
6877
  }
6878
6878
  return r.prototype.apply = function(e, t) {
@@ -6883,7 +6883,7 @@ var Qs, Nm = function() {
6883
6883
  }, r.prototype.ready = function(e) {
6884
6884
  this.collect.set(e);
6885
6885
  var t = this.config.autotrack;
6886
- t = typeof t == "object" ? t : {}, t = Object.assign(Gm, t), this.destroyed = !1, this.options = t, this.Config = new Rm(km, this.options), this.Exposure = new Um(this.collect, this.config, this.handle.bind(this)), this.Scroll = new Nm(this.config, this.handle.bind(this)), this.Listener = new zm(t, this.collect, this.Config), this.EventHandle = new Dm(this.config, t), this.Request = new xm(this.collect), this.autoTrackStart = !0, this.init(), Om(this, this.config);
6886
+ t = typeof t == "object" ? t : {}, t = Object.assign(Bm, t), this.destroyed = !1, this.options = t, this.Config = new Am(Rm, this.options), this.Exposure = new Nm(this.collect, this.config, this.handle.bind(this)), this.Scroll = new Gm(this.config, this.handle.bind(this)), this.Listener = new km(t, this.collect, this.Config), this.EventHandle = new xm(this.config, t), this.Request = new Pm(this.collect), this.autoTrackStart = !0, this.init(), Mm(this, this.config);
6887
6887
  }, r.prototype.init = function() {
6888
6888
  this.Listener.init(this.handle.bind(this));
6889
6889
  try {
@@ -6923,7 +6923,7 @@ var Qs, Nm = function() {
6923
6923
  (function(r) {
6924
6924
  r.Net = "net", r.FailNet = "f_net", r.FailData = "f_data";
6925
6925
  })(Qs || (Qs = {}));
6926
- var eo = { pv: ["predefine_pageview"], sdk: ["_be_active", "predefine_page_alive", "predefine_page_close", "__profile_set", "__profile_set_once", "__profile_increment", "__profile_unset", "__profile_append"], autotrack: ["bav2b_click", "bav2b_page", "bav2b_beat", "bav2b_page_statistics", "__bav_click", "__bav_page", "__bav_beat", "__bav_page_statistics"] }, Vm = function() {
6926
+ var eo = { pv: ["predefine_pageview"], sdk: ["_be_active", "predefine_page_alive", "predefine_page_close", "__profile_set", "__profile_set_once", "__profile_increment", "__profile_unset", "__profile_append"], autotrack: ["bav2b_click", "bav2b_page", "bav2b_beat", "bav2b_page_statistics", "__bav_click", "__bav_page", "__bav_beat", "__bav_page_statistics"] }, Fm = function() {
6927
6927
  function r() {
6928
6928
  }
6929
6929
  return r.prototype.apply = function(e, t) {
@@ -6999,7 +6999,7 @@ var eo = { pv: ["predefine_pageview"], sdk: ["_be_active", "predefine_page_alive
6999
6999
  }, r.prototype.leavePage = function() {
7000
7000
  this.report(!0);
7001
7001
  }, r;
7002
- }(), Fm = function() {
7002
+ }(), jm = function() {
7003
7003
  function r() {
7004
7004
  this.retryWaitTime = 3e3, this.retryStatus = !1, this.retryCacheStatus = !1;
7005
7005
  }
@@ -7056,7 +7056,7 @@ var eo = { pv: ["predefine_pageview"], sdk: ["_be_active", "predefine_page_alive
7056
7056
  }, r.prototype.fetchData = function(e, t, i, n) {
7057
7057
  this.collect.requestManager.useRequest({ url: this.eventUrl, data: e, timeout: 3e4, success: t, fail: i, app_key: n ? "566f58151b0ed37e" : "" });
7058
7058
  }, r;
7059
- }(), xi = typeof window < "u" ? (window.LogPluginObject || (window.LogPluginObject = {}), window.LogPluginObject) : null, jm = function() {
7059
+ }(), xi = typeof window < "u" ? (window.LogPluginObject || (window.LogPluginObject = {}), window.LogPluginObject) : null, Hm = function() {
7060
7060
  function r() {
7061
7061
  }
7062
7062
  return r.prototype.apply = function(e, t) {
@@ -7105,7 +7105,7 @@ var eo = { pv: ["predefine_pageview"], sdk: ["_be_active", "predefine_page_alive
7105
7105
  this.collect.emit(g.DEBUGGER_MESSAGE, { type: g.DEBUGGER_MESSAGE_SDK, info: "发生了异常", level: "error", time: Date.now(), data: o.message });
7106
7106
  }
7107
7107
  }, r;
7108
- }(), Hm = function() {
7108
+ }(), $m = function() {
7109
7109
  function r() {
7110
7110
  this.autotrack = !1, this.spa = !1, this.cache = {}, this.allowHash = !1;
7111
7111
  }
@@ -7203,12 +7203,12 @@ var eo = { pv: ["predefine_pageview"], sdk: ["_be_active", "predefine_page_alive
7203
7203
  t.refer_key = i, t.routeChange = !0, this.storage.setItem(this.cache_key, t);
7204
7204
  }, r;
7205
7205
  }();
7206
- fe.usePlugin(jm, "extend"), fe.usePlugin(fm, "et"), fe.usePlugin(pm, "ab"), fe.usePlugin(ym, "stay"), fe.usePlugin(Bm, "autotrack"), fe.usePlugin(bm, "profile"), fe.usePlugin(Fm, "retry"), fe.usePlugin(Sm, "heartbeat"), fe.usePlugin(Em, "monitor"), fe.usePlugin(Hm, "route"), fe.usePlugin(Vm, "tracer");
7206
+ fe.usePlugin(Hm, "extend"), fe.usePlugin(mm, "et"), fe.usePlugin(fm, "ab"), fe.usePlugin(bm, "stay"), fe.usePlugin(Vm, "autotrack"), fe.usePlugin(Sm, "profile"), fe.usePlugin(jm, "retry"), fe.usePlugin(Em, "heartbeat"), fe.usePlugin(Cm, "monitor"), fe.usePlugin($m, "route"), fe.usePlugin(Fm, "tracer");
7207
7207
  var Nt = new fe("default");
7208
7208
  const Pi = "VEPUSHER_DEVICE_ID", Ii = "VEPUSHER_USER_ID", Ma = (r) => Math.floor(
7209
7209
  (Math.random() * 9 + 1) * Math.pow(10, r - 1)
7210
7210
  ).toString();
7211
- function $m(r) {
7211
+ function qm(r) {
7212
7212
  const e = {};
7213
7213
  if (!(r instanceof Object))
7214
7214
  throw new Error("params type error");
@@ -7223,7 +7223,7 @@ function $m(r) {
7223
7223
  }
7224
7224
  return e;
7225
7225
  }
7226
- function qm(r) {
7226
+ function Km(r) {
7227
7227
  if (r)
7228
7228
  return localStorage.setItem(Ii, r), r;
7229
7229
  const e = localStorage.getItem(Ii);
@@ -7232,7 +7232,7 @@ function qm(r) {
7232
7232
  const t = Ma(12);
7233
7233
  return localStorage.setItem(Ii, t), r;
7234
7234
  }
7235
- function Km(r) {
7235
+ function Wm(r) {
7236
7236
  if (r)
7237
7237
  return localStorage.setItem(Pi, r), r;
7238
7238
  const e = localStorage.getItem(Pi);
@@ -7241,65 +7241,7 @@ function Km(r) {
7241
7241
  const t = Ma(11);
7242
7242
  return localStorage.setItem(Pi, t), t;
7243
7243
  }
7244
- class Wm {
7245
- constructor({ showLogInConsole: e = !1 }) {
7246
- this._showLogInConsole = !1, this.markCollectTeaEventReady = () => {
7247
- this.isReady = !0, Nt.start(), this.queueTeaEvent.forEach((t) => this.sendTeaEvent(...t)), this.queueTeaEvent = [];
7248
- }, this.configTea = (t, i) => {
7249
- const n = {
7250
- ...t,
7251
- evtParams: {
7252
- page_url_fe: encodeURIComponent(window.location.href) || "",
7253
- page_path_fe: window.location.pathname || "unknown",
7254
- page_host_fe: window.location.hostname || "unknown",
7255
- sdk_version: "2.0.3",
7256
- build_version: "1.0.0.93",
7257
- ...i
7258
- }
7259
- };
7260
- Nt.config(n), this.markCollectTeaEventReady();
7261
- }, this.isReady = !1, this.queueTeaEvent = [], Nt.init({
7262
- app_id: 699880,
7263
- channel: "cn"
7264
- }), this._showLogInConsole = e;
7265
- }
7266
- /**
7267
- * @description Tea埋点发送方法
7268
- * @param {string} eventName
7269
- * @param {Record<string,any>} params (value非string|number类型会进行序列化)
7270
- */
7271
- sendTeaEvent(e, t, i = !1) {
7272
- if (e)
7273
- if (this.isReady)
7274
- try {
7275
- const n = {
7276
- ...$m(t || {})
7277
- };
7278
- Nt.event(e, n), this._showLogInConsole && !i && console.log("[VePusher logger]:", e, n);
7279
- } catch (n) {
7280
- console.error(n);
7281
- }
7282
- else
7283
- this._showLogInConsole && !i && console.log("[VePusher logger]:", e, t), this.queueTeaEvent.push([e, t]);
7284
- }
7285
- getIsReady() {
7286
- return this.isReady;
7287
- }
7288
- getRawTea() {
7289
- return Nt;
7290
- }
7291
- }
7292
- let hr;
7293
- function Jm({ showLogInConsole: r }) {
7294
- hr = new Wm({ showLogInConsole: r });
7295
- }
7296
- function D(r, e, t = !1) {
7297
- hr && hr.sendTeaEvent(r, e, t);
7298
- }
7299
- function Zm(r, e) {
7300
- hr && hr.configTea(r, e);
7301
- }
7302
- const Xm = {
7244
+ const Jm = {
7303
7245
  /**
7304
7246
  * 获取采集设备列表结果
7305
7247
  * devices: 采集设备列表
@@ -7367,7 +7309,7 @@ const Xm = {
7367
7309
  * number: 停止的流数量
7368
7310
  */
7369
7311
  STOP_CAPTURE: "stop_capture"
7370
- }, Ym = {
7312
+ }, Zm = {
7371
7313
  /**
7372
7314
  * 开关合流功能事件
7373
7315
  * enable: 是否开启合流功能
@@ -7425,7 +7367,7 @@ const Xm = {
7425
7367
  * visible: 是否可见
7426
7368
  */
7427
7369
  CHANGE_AUDIO_STREAM_MUTE: "change_audio_stream_mute"
7428
- }, Qm = {
7370
+ }, Xm = {
7429
7371
  /**
7430
7372
  * 开始推流事件
7431
7373
  * url: 推流地址:
@@ -7475,7 +7417,7 @@ const Xm = {
7475
7417
  * RTM推流sdp协商信息
7476
7418
  */
7477
7419
  PUSH_SDP_INFO: "push_sdp_info"
7478
- }, x = {
7420
+ }, D = {
7479
7421
  /**
7480
7422
  * 推流SDK初始化事件
7481
7423
  * options: 初始化配置参数
@@ -7495,9 +7437,78 @@ const Xm = {
7495
7437
  * quality: 音频质量
7496
7438
  */
7497
7439
  SET_AUDIO_QUALITY: "set_audio_quality",
7498
- ...Xm,
7499
- ...Ym,
7500
- ...Qm
7440
+ /** 页面可见性变化 */
7441
+ PAGE_VISIBLE_CHANGE: "page_visible_change",
7442
+ ...Jm,
7443
+ ...Zm,
7444
+ ...Xm
7445
+ };
7446
+ class Ym {
7447
+ constructor({ showLogInConsole: e = !1 }) {
7448
+ this._showLogInConsole = !1, this.markCollectTeaEventReady = () => {
7449
+ this.isReady = !0, Nt.start(), this.queueTeaEvent.forEach((t) => this.sendTeaEvent(...t)), this.queueTeaEvent = [];
7450
+ }, this.configTea = (t, i) => {
7451
+ const n = {
7452
+ ...t,
7453
+ evtParams: {
7454
+ page_url_fe: encodeURIComponent(window.location.href) || "",
7455
+ page_path_fe: window.location.pathname || "unknown",
7456
+ page_host_fe: window.location.hostname || "unknown",
7457
+ sdk_version: "2.0.3",
7458
+ build_version: "1.0.0.95",
7459
+ ...i
7460
+ }
7461
+ };
7462
+ Nt.config(n), this.markCollectTeaEventReady();
7463
+ }, this.isReady = !1, this.queueTeaEvent = [], Nt.init({
7464
+ app_id: 699880,
7465
+ channel: "cn"
7466
+ }), this._showLogInConsole = e;
7467
+ }
7468
+ /**
7469
+ * @description Tea埋点发送方法
7470
+ * @param {string} eventName
7471
+ * @param {Record<string,any>} params (value非string|number类型会进行序列化)
7472
+ */
7473
+ sendTeaEvent(e, t, i = !1) {
7474
+ if (e)
7475
+ if (this.isReady)
7476
+ try {
7477
+ const n = {
7478
+ ...qm(t || {})
7479
+ };
7480
+ Nt.event(e, n), this._showLogInConsole && !i && console.log("[VePusher logger]:", e, n);
7481
+ } catch (n) {
7482
+ console.error(n);
7483
+ }
7484
+ else
7485
+ this._showLogInConsole && !i && console.log("[VePusher logger]:", e, t), this.queueTeaEvent.push([e, t]);
7486
+ }
7487
+ getIsReady() {
7488
+ return this.isReady;
7489
+ }
7490
+ getRawTea() {
7491
+ return Nt;
7492
+ }
7493
+ }
7494
+ let hr;
7495
+ function Qm({ showLogInConsole: r }) {
7496
+ hr = new Ym({ showLogInConsole: r });
7497
+ }
7498
+ function x(r, e, t = !1) {
7499
+ hr && hr.sendTeaEvent(r, e, t);
7500
+ }
7501
+ function e_(r, e) {
7502
+ hr && hr.configTea(r, e);
7503
+ }
7504
+ const La = () => {
7505
+ x(D.PAGE_VISIBLE_CHANGE, {
7506
+ page_visible: !document.hidden
7507
+ });
7508
+ }, t_ = () => {
7509
+ document.addEventListener("visibilitychange", La);
7510
+ }, r_ = () => {
7511
+ document.removeEventListener("visibilitychange", La);
7501
7512
  };
7502
7513
  function ft(r) {
7503
7514
  var e;
@@ -7508,7 +7519,7 @@ function ft(r) {
7508
7519
  original_error_message: (e = r.error) == null ? void 0 : e.message
7509
7520
  };
7510
7521
  }
7511
- class e_ extends Xe {
7522
+ class i_ extends Xe {
7512
7523
  constructor(e) {
7513
7524
  super(), this._videoConstraints = {
7514
7525
  width: 1080,
@@ -7568,16 +7579,16 @@ class e_ extends Xe {
7568
7579
  }
7569
7580
  async getDevicesList(e) {
7570
7581
  try {
7571
- const t = await zu(
7582
+ const t = await ku(
7572
7583
  e ? [e] : ["audioinput", "videoinput"]
7573
7584
  );
7574
- return D(x.GET_DEVICES_RESULT, {
7585
+ return x(D.GET_DEVICES_RESULT, {
7575
7586
  type: e,
7576
7587
  is_success: !0,
7577
7588
  devices: t
7578
7589
  }), t;
7579
7590
  } catch (t) {
7580
- return D(x.GET_DEVICES_RESULT, {
7591
+ return x(D.GET_DEVICES_RESULT, {
7581
7592
  type: e,
7582
7593
  is_success: !1,
7583
7594
  error: t,
@@ -7628,7 +7639,7 @@ class e_ extends Xe {
7628
7639
  n.push(s);
7629
7640
  } else
7630
7641
  n = ke(this[i]);
7631
- D(x.STOP_CAPTURE, {
7642
+ x(D.STOP_CAPTURE, {
7632
7643
  stream_id: e,
7633
7644
  type: t,
7634
7645
  number: n.length
@@ -7639,30 +7650,32 @@ class e_ extends Xe {
7639
7650
  }
7640
7651
  async startCameraCapture(e) {
7641
7652
  let t = {};
7642
- qp.includes(e) ? t = {
7653
+ Kp.includes(e) ? t = {
7643
7654
  facingMode: e
7644
- } : t = {
7645
- deviceId: e
7646
- };
7655
+ } : e && (t = {
7656
+ deviceId: {
7657
+ exact: e
7658
+ }
7659
+ });
7647
7660
  const i = {
7648
7661
  ...t,
7649
7662
  ...this._videoConstraints
7650
7663
  };
7651
7664
  try {
7652
- const n = await ku(
7665
+ const n = await Ru(
7653
7666
  i,
7654
7667
  !this._livePusher.isEnableMixing
7655
- ), s = new rd(n, {
7668
+ ), s = new id(n, {
7656
7669
  frameRate: this._videoConstraints.frameRate
7657
7670
  });
7658
- return this._cameraStreams[s.id] = s, this._notifyCaptured(s), this._bindStreamEvent(s), D(x.CAMERA_CAPTURE_RESULT, {
7671
+ return this._cameraStreams[s.id] = s, this._notifyCaptured(s), this._bindStreamEvent(s), x(D.CAMERA_CAPTURE_RESULT, {
7659
7672
  is_success: !0,
7660
7673
  stream_id: s.id,
7661
7674
  device_id: e,
7662
7675
  capture_params: i
7663
7676
  }), s.id;
7664
7677
  } catch (n) {
7665
- throw D(x.CAMERA_CAPTURE_RESULT, {
7678
+ throw x(D.CAMERA_CAPTURE_RESULT, {
7666
7679
  is_success: !1,
7667
7680
  device_id: e,
7668
7681
  capture_params: i,
@@ -7671,28 +7684,34 @@ class e_ extends Xe {
7671
7684
  }
7672
7685
  }
7673
7686
  async startMicrophoneCapture(e) {
7674
- const t = {
7687
+ let t = {};
7688
+ e && (t = {
7689
+ deviceId: {
7690
+ exact: e
7691
+ }
7692
+ });
7693
+ const i = {
7675
7694
  ...this._audioConstraints,
7676
- deviceId: e
7695
+ ...t
7677
7696
  };
7678
7697
  try {
7679
- const i = await Au(t), n = new Gp(i);
7680
- return this._microphoneStreams[n.id] = n, this._notifyCaptured(n), this._bindStreamEvent(n), D(x.MICROPHONE_CAPTURE_RESULT, {
7698
+ const n = await Du(i), s = new Bp(n);
7699
+ return this._microphoneStreams[s.id] = s, this._notifyCaptured(s), this._bindStreamEvent(s), x(D.MICROPHONE_CAPTURE_RESULT, {
7681
7700
  is_success: !0,
7682
- stream_id: n.id,
7701
+ stream_id: s.id,
7683
7702
  device_id: e,
7684
- capture_params: t
7685
- }), n.id;
7686
- } catch (i) {
7687
- throw D(x.MICROPHONE_CAPTURE_RESULT, {
7703
+ capture_params: i
7704
+ }), s.id;
7705
+ } catch (n) {
7706
+ throw x(D.MICROPHONE_CAPTURE_RESULT, {
7688
7707
  is_success: !1,
7689
7708
  device_id: e,
7690
- capture_params: t,
7691
- ...ft(i)
7709
+ capture_params: i,
7710
+ ...ft(n)
7692
7711
  }), this._handleError(
7693
- i,
7712
+ n,
7694
7713
  de.OPEN_MICROPHONE_FAILED
7695
- ), i;
7714
+ ), n;
7696
7715
  }
7697
7716
  }
7698
7717
  async startScreenCapture(e) {
@@ -7701,20 +7720,20 @@ class e_ extends Xe {
7701
7720
  video: this._videoConstraints
7702
7721
  };
7703
7722
  try {
7704
- const i = await Du(
7723
+ const i = await xu(
7705
7724
  t,
7706
7725
  void 0,
7707
7726
  !this._livePusher.isEnableMixing
7708
- ), n = new Vp(i, {
7727
+ ), n = new Fp(i, {
7709
7728
  frameRate: this._videoConstraints.frameRate
7710
7729
  });
7711
- return this._screenStreams[n.id] = n, this._notifyCaptured(n), this._bindStreamEvent(n), D(x.SCREEN_CAPTURE_RESULT, {
7730
+ return this._screenStreams[n.id] = n, this._notifyCaptured(n), this._bindStreamEvent(n), x(D.SCREEN_CAPTURE_RESULT, {
7712
7731
  is_success: !0,
7713
7732
  stream_id: n.id,
7714
7733
  capture_params: t
7715
7734
  }), n.id;
7716
7735
  } catch (i) {
7717
- throw D(x.SCREEN_CAPTURE_RESULT, {
7736
+ throw x(D.SCREEN_CAPTURE_RESULT, {
7718
7737
  is_success: !1,
7719
7738
  capture_params: t,
7720
7739
  ...ft(i)
@@ -7728,8 +7747,8 @@ class e_ extends Xe {
7728
7747
  video: !0,
7729
7748
  audio: !0,
7730
7749
  loop: !0
7731
- }), i = new Bp(t);
7732
- return this._videoFileStreams[i.id] = i, this._notifyCaptured(i), this._bindStreamEvent(i), D(x.VIDEO_FILE_CAPTURE_RESULT, {
7750
+ }), i = new Vp(t);
7751
+ return this._videoFileStreams[i.id] = i, this._notifyCaptured(i), this._bindStreamEvent(i), x(D.VIDEO_FILE_CAPTURE_RESULT, {
7733
7752
  is_success: !0,
7734
7753
  stream_id: i.id,
7735
7754
  file_url: e
@@ -7738,7 +7757,7 @@ class e_ extends Xe {
7738
7757
  throw this._handleError(
7739
7758
  t,
7740
7759
  de.VIDEO_FILE_CAPTURE_FAILED
7741
- ), D(x.VIDEO_FILE_CAPTURE_RESULT, {
7760
+ ), x(D.VIDEO_FILE_CAPTURE_RESULT, {
7742
7761
  is_success: !1,
7743
7762
  file_url: e,
7744
7763
  ...ft(t)
@@ -7752,14 +7771,14 @@ class e_ extends Xe {
7752
7771
  video: !1,
7753
7772
  audio: !0,
7754
7773
  loop: !0
7755
- }), i = new Fp(t);
7756
- return this._audioFileStreams[i.id] = i, this._notifyCaptured(i), this._bindStreamEvent(i), D(x.AUDIO_FILE_CAPTURE_RESULT, {
7774
+ }), i = new jp(t);
7775
+ return this._audioFileStreams[i.id] = i, this._notifyCaptured(i), this._bindStreamEvent(i), x(D.AUDIO_FILE_CAPTURE_RESULT, {
7757
7776
  is_success: !0,
7758
7777
  stream_id: i.id,
7759
7778
  file_url: e
7760
7779
  }), i.id;
7761
7780
  } catch (t) {
7762
- throw D(x.AUDIO_FILE_CAPTURE_RESULT, {
7781
+ throw x(D.AUDIO_FILE_CAPTURE_RESULT, {
7763
7782
  is_success: !1,
7764
7783
  file_url: e,
7765
7784
  ...ft(t)
@@ -7771,19 +7790,19 @@ class e_ extends Xe {
7771
7790
  }
7772
7791
  async startImageCapture(e) {
7773
7792
  try {
7774
- const t = await Ru({
7793
+ const t = await Au({
7775
7794
  url: e,
7776
7795
  width: 0,
7777
7796
  height: 0,
7778
7797
  frameRate: 30
7779
- }), i = new jp(t);
7780
- return this._imageStreams[i.id] = i, this._notifyCaptured(i), this._bindStreamEvent(i), D(x.IMAGE_FILE_CAPTURE_RESULT, {
7798
+ }), i = new Hp(t);
7799
+ return this._imageStreams[i.id] = i, this._notifyCaptured(i), this._bindStreamEvent(i), x(D.IMAGE_FILE_CAPTURE_RESULT, {
7781
7800
  is_success: !0,
7782
7801
  stream_id: i.id,
7783
7802
  file_url: e
7784
7803
  }), i.id;
7785
7804
  } catch (t) {
7786
- throw D(x.IMAGE_FILE_CAPTURE_RESULT, {
7805
+ throw x(D.IMAGE_FILE_CAPTURE_RESULT, {
7787
7806
  is_success: !1,
7788
7807
  file_url: e,
7789
7808
  ...ft(t)
@@ -7794,16 +7813,16 @@ class e_ extends Xe {
7794
7813
  }
7795
7814
  }
7796
7815
  startCustomVideoCapture(e) {
7797
- const t = Pu(e);
7816
+ const t = Iu(e);
7798
7817
  if (t) {
7799
- const i = new Hp(t);
7818
+ const i = new $p(t);
7800
7819
  return this._customVideoStreams[i.id] = i, this._notifyCaptured(i), this._bindStreamEvent(i), i.id;
7801
7820
  }
7802
7821
  }
7803
7822
  startCustomAudioCapture(e) {
7804
- const t = Iu(e);
7823
+ const t = Ou(e);
7805
7824
  if (t) {
7806
- const i = new $p(t);
7825
+ const i = new qp(t);
7807
7826
  return this._customAudioStreams[i.id] = i, this._notifyCaptured(i), this._bindStreamEvent(i), i.id;
7808
7827
  }
7809
7828
  }
@@ -7811,12 +7830,12 @@ class e_ extends Xe {
7811
7830
  const t = this.getStreamById(e);
7812
7831
  if (t)
7813
7832
  try {
7814
- await t.startVolumeDetect(), D(x.VOLUME_DETECTOR_START_RESULT, {
7833
+ await t.startVolumeDetect(), x(D.VOLUME_DETECTOR_START_RESULT, {
7815
7834
  is_success: !0,
7816
7835
  stream_id: t.id
7817
7836
  });
7818
7837
  } catch (i) {
7819
- D(x.VOLUME_DETECTOR_START_RESULT, {
7838
+ x(D.VOLUME_DETECTOR_START_RESULT, {
7820
7839
  is_success: !1,
7821
7840
  stream_id: t.id,
7822
7841
  error_message: i.message
@@ -7912,7 +7931,7 @@ class An {
7912
7931
  }
7913
7932
  }
7914
7933
  const to = new Ye("SingleComposer");
7915
- class t_ extends An {
7934
+ class n_ extends An {
7916
7935
  onStreamCapture(e) {
7917
7936
  e.isVideoStream ? this._handleVideoStreamCapture(e) : this._handleAudioStreamCapture(e);
7918
7937
  }
@@ -7983,7 +8002,7 @@ class t_ extends An {
7983
8002
  return this._composedStream;
7984
8003
  }
7985
8004
  }
7986
- class r_ extends Xe {
8005
+ class s_ extends Xe {
7987
8006
  constructor(e, {
7988
8007
  width: t,
7989
8008
  height: i,
@@ -8165,16 +8184,16 @@ class ro extends zt {
8165
8184
  this.source.stop(), delete this._trackMap.video;
8166
8185
  }
8167
8186
  }
8168
- var i_ = Object.defineProperty, n_ = Object.getOwnPropertyDescriptor, fr = (r, e, t, i) => {
8169
- for (var n = n_(e, t), s = r.length - 1, a; s >= 0; s--)
8187
+ var o_ = Object.defineProperty, a_ = Object.getOwnPropertyDescriptor, fr = (r, e, t, i) => {
8188
+ for (var n = a_(e, t), s = r.length - 1, a; s >= 0; s--)
8170
8189
  (a = r[s]) && (n = a(e, t, n) || n);
8171
- return n && i_(e, t, n), n;
8190
+ return n && o_(e, t, n), n;
8172
8191
  };
8173
- const La = new Ye("composition-composer");
8192
+ const Ua = new Ye("composition-composer");
8174
8193
  function mr(r, e, t) {
8175
8194
  const i = t.value;
8176
8195
  return t.value = function(...n) {
8177
- return this._active || La.error("composer is not active"), i.apply(this, n);
8196
+ return this._active || Ua.error("composer is not active"), i.apply(this, n);
8178
8197
  }, t;
8179
8198
  }
8180
8199
  class Dt extends An {
@@ -8184,7 +8203,7 @@ class Dt extends An {
8184
8203
  height: 720,
8185
8204
  frameRate: 30,
8186
8205
  backgroundColor: "#000000"
8187
- }, this._sprites = [], this._videoMixer = new Xu();
8206
+ }, this._sprites = [], this._videoMixer = new Yu();
8188
8207
  }
8189
8208
  onStreamCapture(e) {
8190
8209
  }
@@ -8215,7 +8234,7 @@ class Dt extends An {
8215
8234
  }
8216
8235
  _addSprite(e) {
8217
8236
  this._sprites.push(e), this._sprites = this._sprites.sort((t, i) => t.zOrder - i.zOrder), e.on("propsChange", (t) => {
8218
- Np(t.zOrder) || (this._sprites = this._sprites.sort(
8237
+ Gp(t.zOrder) || (this._sprites = this._sprites.sort(
8219
8238
  (i, n) => i.zOrder - n.zOrder
8220
8239
  )), this._updateSpriteToMixer();
8221
8240
  }), this._updateSpriteToMixer();
@@ -8237,14 +8256,14 @@ class Dt extends An {
8237
8256
  }
8238
8257
  addVideoStream(e, t) {
8239
8258
  if (!e.viewNode) {
8240
- La.error("have no viewNode for composition");
8259
+ Ua.error("have no viewNode for composition");
8241
8260
  return;
8242
8261
  }
8243
8262
  e.audioTrack && this._streamComposeController.addAudioStream({
8244
8263
  streamId: e.id,
8245
8264
  volume: 100
8246
8265
  });
8247
- const i = new r_(e, t);
8266
+ const i = new s_(e, t);
8248
8267
  this._addSprite(i);
8249
8268
  }
8250
8269
  _updateSingleVideoStream(e) {
@@ -8320,7 +8339,7 @@ fr([
8320
8339
  fr([
8321
8340
  mr
8322
8341
  ], Dt.prototype, "unmuteVideoStream");
8323
- class s_ extends Xe {
8342
+ class c_ extends Xe {
8324
8343
  constructor(e, { volume: t }) {
8325
8344
  super(), this._volume = 100, this._isMute = !1, this._volume = t ?? 100, this._stream = e;
8326
8345
  }
@@ -8348,7 +8367,7 @@ class s_ extends Xe {
8348
8367
  return this._stream;
8349
8368
  }
8350
8369
  }
8351
- class o_ extends Jr {
8370
+ class u_ extends Jr {
8352
8371
  constructor(e) {
8353
8372
  super({
8354
8373
  type: G.MixAudio,
@@ -8372,9 +8391,9 @@ class o_ extends Jr {
8372
8391
  (e = this._trackMap.audio) == null || e.stop(), delete this._trackMap.audio;
8373
8392
  }
8374
8393
  }
8375
- class a_ extends An {
8394
+ class d_ extends An {
8376
8395
  constructor(e) {
8377
- super(e), this._spriteList = [], this._audioMixer = new Mu({
8396
+ super(e), this._spriteList = [], this._audioMixer = new Lu({
8378
8397
  keepAlive: !0
8379
8398
  });
8380
8399
  }
@@ -8395,11 +8414,11 @@ class a_ extends An {
8395
8414
  }
8396
8415
  enable() {
8397
8416
  super.enable();
8398
- const e = this._audioMixer.track(), t = new o_(e);
8417
+ const e = this._audioMixer.track(), t = new u_(e);
8399
8418
  this._composedStream.setAudioStream(t), this._audioMixer.mix([]);
8400
8419
  }
8401
8420
  addAudioStream(e, t) {
8402
- const i = new s_(e, t);
8421
+ const i = new c_(e, t);
8403
8422
  this._spriteList.push(i), this._updateSpriteToMixer();
8404
8423
  }
8405
8424
  tryResume() {
@@ -8445,7 +8464,7 @@ class a_ extends An {
8445
8464
  return this._spriteList.filter((t) => t.stream.type === e).map((t) => t.stream);
8446
8465
  }
8447
8466
  }
8448
- class c_ extends Xe {
8467
+ class h_ extends Xe {
8449
8468
  constructor({
8450
8469
  videoStream: e,
8451
8470
  audioStream: t
@@ -8475,10 +8494,10 @@ class c_ extends Xe {
8475
8494
  return (e = this._audioStream) == null ? void 0 : e.audioTrack;
8476
8495
  }
8477
8496
  }
8478
- const u_ = new Ye("streamComposeController");
8479
- class d_ {
8497
+ const l_ = new Ye("streamComposeController");
8498
+ class p_ {
8480
8499
  constructor(e) {
8481
- this._streamManagerController = e, this._composedStream = new c_(), this.singleComposer = new t_({
8500
+ this._streamManagerController = e, this._composedStream = new h_(), this.singleComposer = new n_({
8482
8501
  streamManagerController: this._streamManagerController,
8483
8502
  composedStream: this._composedStream,
8484
8503
  streamComposeController: this
@@ -8486,7 +8505,7 @@ class d_ {
8486
8505
  streamManagerController: this._streamManagerController,
8487
8506
  composedStream: this._composedStream,
8488
8507
  streamComposeController: this
8489
- }), this.mixerComposer = new a_({
8508
+ }), this.mixerComposer = new d_({
8490
8509
  streamManagerController: this._streamManagerController,
8491
8510
  composedStream: this._composedStream,
8492
8511
  streamComposeController: this
@@ -8535,7 +8554,7 @@ class d_ {
8535
8554
  e.streamId
8536
8555
  );
8537
8556
  if (!t) {
8538
- u_.error("can not find video stream" + e.streamId);
8557
+ l_.error("can not find video stream" + e.streamId);
8539
8558
  return;
8540
8559
  }
8541
8560
  this.compositionComposer.addVideoStream(t, e);
@@ -8589,7 +8608,7 @@ class d_ {
8589
8608
  return this.compositionComposer.getDrawCountPerSecond();
8590
8609
  }
8591
8610
  }
8592
- class Ua {
8611
+ class Na {
8593
8612
  constructor(e) {
8594
8613
  this._hasBindComposedStreamEvent = !1, this._composedStream = e;
8595
8614
  }
@@ -8613,7 +8632,7 @@ class Ua {
8613
8632
  }
8614
8633
  }
8615
8634
  const mt = new Ye("PreviewConsumer");
8616
- class h_ extends Ua {
8635
+ class f_ extends Na {
8617
8636
  constructor(e, {
8618
8637
  streamConsumeController: t
8619
8638
  }) {
@@ -9151,7 +9170,7 @@ function Dn() {
9151
9170
  }), Mi.exports;
9152
9171
  }
9153
9172
  var no;
9154
- function l_() {
9173
+ function m_() {
9155
9174
  return no || (no = 1, function(r) {
9156
9175
  var e = function(o) {
9157
9176
  return String(Number(o)) === o ? Number(o) : o;
@@ -9216,7 +9235,7 @@ function l_() {
9216
9235
  }(Oi)), Oi;
9217
9236
  }
9218
9237
  var Li, so;
9219
- function p_() {
9238
+ function __() {
9220
9239
  if (so) return Li;
9221
9240
  so = 1;
9222
9241
  var r = Dn(), e = /%[sdv%]/g, t = function(a) {
@@ -9286,20 +9305,20 @@ function p_() {
9286
9305
  }, Li;
9287
9306
  }
9288
9307
  var oo;
9289
- function f_() {
9308
+ function g_() {
9290
9309
  if (oo) return ye;
9291
9310
  oo = 1;
9292
- var r = l_(), e = p_(), t = Dn();
9311
+ var r = m_(), e = __(), t = Dn();
9293
9312
  return ye.grammar = t, ye.write = e, ye.parse = r.parse, ye.parseParams = r.parseParams, ye.parseFmtpConfig = r.parseFmtpConfig, ye.parsePayloads = r.parsePayloads, ye.parseRemoteCandidates = r.parseRemoteCandidates, ye.parseImageAttributes = r.parseImageAttributes, ye.parseSimulcastStreamList = r.parseSimulcastStreamList, ye;
9294
9313
  }
9295
- var m_ = f_();
9296
- const _t = /* @__PURE__ */ jr(m_);
9314
+ var v_ = g_();
9315
+ const _t = /* @__PURE__ */ jr(v_);
9297
9316
  function ri(r) {
9298
9317
  return new Promise((e) => {
9299
9318
  setTimeout(e, r);
9300
9319
  });
9301
9320
  }
9302
- async function __(r, e = {}, t = 0) {
9321
+ async function y_(r, e = {}, t = 0) {
9303
9322
  const i = new AbortController();
9304
9323
  let n = !1;
9305
9324
  e = Object.assign({}, e, { signal: i.signal });
@@ -9326,15 +9345,15 @@ async function __(r, e = {}, t = 0) {
9326
9345
  throw n = !0, a;
9327
9346
  }
9328
9347
  }
9329
- async function Na(r, e = {}, t = {}) {
9348
+ async function Ga(r, e = {}, t = {}) {
9330
9349
  const { timeout: i = 0, retryDelay: n = 0 } = t;
9331
9350
  let { retryCount: s = 0 } = t;
9332
9351
  try {
9333
- return await __(r, e, i);
9352
+ return await y_(r, e, i);
9334
9353
  } catch (a) {
9335
9354
  if (s--, t.retryCount = s, s < 0)
9336
9355
  throw a;
9337
- return await ri(n), await Na(r, e, t);
9356
+ return await ri(n), await Ga(r, e, t);
9338
9357
  }
9339
9358
  }
9340
9359
  const tn = -1;
@@ -9368,7 +9387,7 @@ async function rn(r, e) {
9368
9387
  transport: Q("transport", n)
9369
9388
  }), t;
9370
9389
  }
9371
- async function g_(r, e, t) {
9390
+ async function b_(r, e, t) {
9372
9391
  var u, l, h, p, f, v, m, S, y, _, E, z, w, A, k, T, R, P, H, B, $, q, ne, F, Y, ve, Ne, Ge, xt, Pt, It, Ot, Pn, In, On, Mn, Ln, Un, Nn;
9373
9392
  const i = await rn(e, t);
9374
9393
  await ri(r);
@@ -9388,7 +9407,7 @@ async function g_(r, e, t) {
9388
9407
  };
9389
9408
  }
9390
9409
  if (a != null && a.codec && (d != null && d.codec)) {
9391
- const ht = ((A = d.outboundRtp) == null ? void 0 : A.timestamp) - ((k = a.outboundRtp) == null ? void 0 : k.timestamp), ii = ((T = d.outboundRtp) == null ? void 0 : T.bytesSent) - ((R = a.outboundRtp) == null ? void 0 : R.bytesSent), _r = ((P = d.outboundRtp) == null ? void 0 : P.framesEncoded) - ((H = a.outboundRtp) == null ? void 0 : H.framesEncoded), ni = ((B = d.outboundRtp) == null ? void 0 : B.totalEncodeTime) - (($ = a.outboundRtp) == null ? void 0 : $.totalEncodeTime), si = ((q = d.outboundRtp) == null ? void 0 : q.framesSent) - ((ne = a.outboundRtp) == null ? void 0 : ne.framesSent), Gn = ((F = d.outboundRtp) == null ? void 0 : F.packetsSent) - ((Y = a.outboundRtp) == null ? void 0 : Y.packetsSent), Ec = ((ve = d.outboundRtp) == null ? void 0 : ve.totalPacketSendDelay) - ((Ne = a.outboundRtp) == null ? void 0 : Ne.totalPacketSendDelay), Cc = ((Ge = d.remoteInboundRtp) == null ? void 0 : Ge.packetsLost) - ((xt = a.remoteInboundRtp) == null ? void 0 : xt.packetsLost);
9410
+ const ht = ((A = d.outboundRtp) == null ? void 0 : A.timestamp) - ((k = a.outboundRtp) == null ? void 0 : k.timestamp), ii = ((T = d.outboundRtp) == null ? void 0 : T.bytesSent) - ((R = a.outboundRtp) == null ? void 0 : R.bytesSent), _r = ((P = d.outboundRtp) == null ? void 0 : P.framesEncoded) - ((H = a.outboundRtp) == null ? void 0 : H.framesEncoded), ni = ((B = d.outboundRtp) == null ? void 0 : B.totalEncodeTime) - (($ = a.outboundRtp) == null ? void 0 : $.totalEncodeTime), si = ((q = d.outboundRtp) == null ? void 0 : q.framesSent) - ((ne = a.outboundRtp) == null ? void 0 : ne.framesSent), Gn = ((F = d.outboundRtp) == null ? void 0 : F.packetsSent) - ((Y = a.outboundRtp) == null ? void 0 : Y.packetsSent), Cc = ((ve = d.outboundRtp) == null ? void 0 : ve.totalPacketSendDelay) - ((Ne = a.outboundRtp) == null ? void 0 : Ne.totalPacketSendDelay), wc = ((Ge = d.remoteInboundRtp) == null ? void 0 : Ge.packetsLost) - ((xt = a.remoteInboundRtp) == null ? void 0 : xt.packetsLost);
9392
9411
  c.video = {
9393
9412
  codec: d.codec.mimeType,
9394
9413
  sendBitrate: ii / ht * 8e3,
@@ -9406,13 +9425,13 @@ async function g_(r, e, t) {
9406
9425
  frameEncodeAvgTime: ni * 1e3 / _r,
9407
9426
  // ms
9408
9427
  packetsSent: (On = d.outboundRtp) == null ? void 0 : On.packetsSent,
9409
- packetSendDelay: Ec * 1e3 / Gn,
9428
+ packetSendDelay: Cc * 1e3 / Gn,
9410
9429
  // ms
9411
9430
  nackCount: (Mn = d.outboundRtp) == null ? void 0 : Mn.nackCount,
9412
9431
  firCount: (Ln = d.outboundRtp) == null ? void 0 : Ln.firCount,
9413
9432
  pliCount: (Un = d.outboundRtp) == null ? void 0 : Un.pliCount,
9414
9433
  packetsLost: (Nn = d.remoteInboundRtp) == null ? void 0 : Nn.packetsLost,
9415
- packetsLostPercent: Cc / Gn,
9434
+ packetsLostPercent: wc / Gn,
9416
9435
  deltaTime: ht
9417
9436
  };
9418
9437
  }
@@ -9427,7 +9446,7 @@ async function g_(r, e, t) {
9427
9446
  function W(r, e = tn) {
9428
9447
  return r ?? e;
9429
9448
  }
9430
- function v_(r) {
9449
+ function S_(r) {
9431
9450
  var e, t, i, n, s, a, o, d, c, u, l, h, p, f, v, m, S, y, _, E, z, w, A, k, T, R, P, H, B, $, q, ne, F, Y, ve, Ne, Ge, xt, Pt, It, Ot;
9432
9451
  return {
9433
9452
  // outbound-rtp info
@@ -9474,7 +9493,7 @@ function v_(r) {
9474
9493
  audio_remote_port: (Ot = r.remoteCandidate) == null ? void 0 : Ot.port
9475
9494
  };
9476
9495
  }
9477
- function y_(r) {
9496
+ function E_(r) {
9478
9497
  var e, t, i, n, s, a, o, d, c, u, l, h, p, f, v, m, S, y, _, E, z, w, A, k, T, R, P, H, B, $, q, ne, F, Y, ve, Ne, Ge;
9479
9498
  return {
9480
9499
  // outbound-rtp info
@@ -9519,9 +9538,9 @@ function y_(r) {
9519
9538
  video_input_frame_height: (Ge = r.mediaSource) == null ? void 0 : Ge.height
9520
9539
  };
9521
9540
  }
9522
- function b_(r, e, t) {
9541
+ function C_(r, e, t) {
9523
9542
  var c, u, l, h, p, f, v, m, S, y, _, E, z, w, A, k, T, R, P, H, B, $, q, ne, F, Y, ve;
9524
- const i = y_(e.video ?? {}), { video_input_frame_width: n, video_input_frame_height: s } = i, a = W((c = r.video) == null ? void 0 : c.frameWidth), o = W(
9543
+ const i = E_(e.video ?? {}), { video_input_frame_width: n, video_input_frame_height: s } = i, a = W((c = r.video) == null ? void 0 : c.frameWidth), o = W(
9525
9544
  (u = r.video) == null ? void 0 : u.frameHeight
9526
9545
  ), d = a < Number(n) || o < Number(s);
9527
9546
  return {
@@ -9564,7 +9583,7 @@ function b_(r, e, t) {
9564
9583
  1
9565
9584
  ) * 100 : tn,
9566
9585
  video_resolution_downgrade: d,
9567
- ...v_(e.audio ?? {}),
9586
+ ...S_(e.audio ?? {}),
9568
9587
  audio_send_k_bitrate: W((B = r.audio) == null ? void 0 : B.sendBitrate) / 1e3,
9569
9588
  audio_send_channels: W(($ = r.audio) == null ? void 0 : $.channels),
9570
9589
  audio_packets_sent: W((q = r.audio) == null ? void 0 : q.packetsSent),
@@ -9574,7 +9593,7 @@ function b_(r, e, t) {
9574
9593
  audio_delta_energy: (ve = r.audio) == null ? void 0 : ve.deltaAudioEnergy
9575
9594
  };
9576
9595
  }
9577
- function S_(r) {
9596
+ function w_(r) {
9578
9597
  return {
9579
9598
  video_send_k_bitrate: r.video.sendBitrate / 1e3,
9580
9599
  video_send_frame_rate: r.video.framesPerSecond,
@@ -9591,7 +9610,7 @@ function S_(r) {
9591
9610
  audio_send_sample_rate: r.audio.sampleRate
9592
9611
  };
9593
9612
  }
9594
- const E_ = "42001f", C_ = "42e01f", w_ = (r) => {
9613
+ const T_ = "42001f", z_ = "42e01f", k_ = (r) => {
9595
9614
  var t;
9596
9615
  if (!Uo)
9597
9616
  return;
@@ -9599,15 +9618,15 @@ const E_ = "42001f", C_ = "42e01f", w_ = (r) => {
9599
9618
  e && r.fmtp.forEach((i) => {
9600
9619
  i.payload === e && (i.config = "minptime=10;useinbandfec=1");
9601
9620
  });
9602
- }, T_ = (r) => {
9603
- r.ext && (Nc || Hr) && (r.ext = r.ext.filter(
9621
+ }, R_ = (r) => {
9622
+ r.ext && (Gc || Hr) && (r.ext = r.ext.filter(
9604
9623
  (e) => {
9605
9624
  var t;
9606
9625
  return !((t = e.uri) != null && t.includes("video-orientation"));
9607
9626
  }
9608
9627
  ));
9609
9628
  };
9610
- function z_(r, e) {
9629
+ function A_(r, e) {
9611
9630
  r == null || r.rtp.forEach(({ codec: t, payload: i }) => {
9612
9631
  if (["vp8", "h264"].includes(t.toLocaleLowerCase())) {
9613
9632
  const n = r.fmtp.find((s) => s.payload === i);
@@ -9627,9 +9646,9 @@ function ao(r, e) {
9627
9646
  if (!Array.isArray(r.fmtp) || !Array.isArray(r.rtp))
9628
9647
  return;
9629
9648
  const t = r.fmtp.find(
9630
- (a) => a.config && a.config.includes(E_)
9649
+ (a) => a.config && a.config.includes(T_)
9631
9650
  ), i = r.fmtp.find(
9632
- (a) => a.config && a.config.includes(C_)
9651
+ (a) => a.config && a.config.includes(z_)
9633
9652
  );
9634
9653
  if (!t || !i)
9635
9654
  return;
@@ -9652,7 +9671,7 @@ function ao(r, e) {
9652
9671
  r.payloads = r.rtp.map((a) => a.payload).join(" ");
9653
9672
  }
9654
9673
  const se = new Ye("PCConnect");
9655
- class k_ {
9674
+ class D_ {
9656
9675
  constructor(e, t, i) {
9657
9676
  this._pc = null, this._ms = new MediaStream(), this._signalUrl = "", this._videoTransceiver = null, this._audioTransceiver = null, this._opts = void 0, this._sessionId = Date.now(), this._signalUrl = e, this._opts = t, this._onConnectStateChange = i;
9658
9677
  }
@@ -9691,9 +9710,9 @@ class k_ {
9691
9710
  se.groupCollapsed("local offer"), se.log(o.sdp);
9692
9711
  const d = _t.parse(o.sdp);
9693
9712
  d.media.forEach((h) => {
9694
- h.type === "audio" ? w_(h) : h.type === "video" && (T_(h), ao(h, "software"), z_(h, t[1]));
9713
+ h.type === "audio" ? k_(h) : h.type === "video" && (R_(h), ao(h, "software"), A_(h, t[1]));
9695
9714
  }), o.sdp = _t.write(d), se.log("local offer modified"), se.log(o.sdp), await n.setLocalDescription(o);
9696
- const c = await Na(
9715
+ const c = await Ga(
9697
9716
  this._signalUrl,
9698
9717
  {
9699
9718
  method: "POST",
@@ -9728,7 +9747,7 @@ class k_ {
9728
9747
  );
9729
9748
  return;
9730
9749
  }
9731
- D(x.PUSH_SDP_INFO, {
9750
+ x(D.PUSH_SDP_INFO, {
9732
9751
  offer_sdp: o.sdp,
9733
9752
  answer_sdp: c.remoteSdp.sdp
9734
9753
  }), await n.setRemoteDescription(c.remoteSdp);
@@ -9778,7 +9797,7 @@ class k_ {
9778
9797
  }
9779
9798
  getStatsSnapshoot(e) {
9780
9799
  var t, i;
9781
- return g_(
9800
+ return b_(
9782
9801
  e || 100,
9783
9802
  (t = this._audioTransceiver) == null ? void 0 : t.sender,
9784
9803
  (i = this._videoTransceiver) == null ? void 0 : i.sender
@@ -9792,7 +9811,7 @@ class k_ {
9792
9811
  }
9793
9812
  }
9794
9813
  var je = /* @__PURE__ */ ((r) => (r.OnError = "onerror", r.OnConnectClosed = "onconnectclosed", r.OnFirstFramePushed = "onfirstframepushed", r))(je || {}), He = /* @__PURE__ */ ((r) => (r.Video = "video", r.Audio = "audio", r))(He || {}), me = /* @__PURE__ */ ((r) => (r.Init = "init", r.AvExist = "avexist", r.VideoFrame = "videoframe", r.MockVideoEncode = "mockvideoencode", r.AudioFrame = "audioframe", r.AdjustBitrate = "adjustbitrate", r.Publish = "publish", r.UnPublish = "unpublish", r.Download = "download", r.GetStats = "getstats", r.EncodeConfig = "encodeconfig", r))(me || {}), Qe = /* @__PURE__ */ ((r) => (r.Ready = "ready", r.Error = "error", r.FirstFramePushed = "firstframepushed", r.Flvfile = "flvfile", r.STATS = "stats", r.Close = "close", r))(Qe || {}), Ui = { exports: {} }, co;
9795
- function R_() {
9814
+ function x_() {
9796
9815
  return co || (co = 1, function(r) {
9797
9816
  var e = Object.prototype.hasOwnProperty, t = "~";
9798
9817
  function i() {
@@ -9898,10 +9917,10 @@ function R_() {
9898
9917
  }, o.prototype.off = o.prototype.removeListener, o.prototype.addListener = o.prototype.on, o.prefixed = t, o.EventEmitter = o, r.exports = o;
9899
9918
  }(Ui)), Ui.exports;
9900
9919
  }
9901
- var A_ = R_();
9902
- const D_ = /* @__PURE__ */ jr(A_);
9920
+ var P_ = x_();
9921
+ const I_ = /* @__PURE__ */ jr(P_);
9903
9922
  var Vr = /* @__PURE__ */ ((r) => (r[r.RTMP_INIT_FAIL = 3e3] = "RTMP_INIT_FAIL", r[r.AUDIO_ENCODER_INIT_FAIL = 3001] = "AUDIO_ENCODER_INIT_FAIL", r[r.AUDIO_RRNOISE_INIT_FAIL = 3002] = "AUDIO_RRNOISE_INIT_FAIL", r[r.AUDIO_ENCODE_FAIL = 3003] = "AUDIO_ENCODE_FAIL", r[r.VIDEO_ENCODE_CONFIGURE_FAIL = 3004] = "VIDEO_ENCODE_CONFIGURE_FAIL", r[r.VIDEO_ENCODE_FAIL = 3005] = "VIDEO_ENCODE_FAIL", r[r.WTP_OPEN_FAIL = 3006] = "WTP_OPEN_FAIL", r[r.WTP_CONNECT_FAIL = 3007] = "WTP_CONNECT_FAIL", r[r.WORKER_ERROR = 3008] = "WORKER_ERROR", r))(Vr || {});
9904
- class Ga extends Error {
9923
+ class Ba extends Error {
9905
9924
  constructor(e, t, i) {
9906
9925
  super(), this.code = e, this.message = t, i && (this.ext = i), this.toJson = () => ({
9907
9926
  code: this.code,
@@ -9911,7 +9930,7 @@ class Ga extends Error {
9911
9930
  }
9912
9931
  }
9913
9932
  function uo(r, e, t) {
9914
- return new Ga(r, e, t);
9933
+ return new Ba(r, e, t);
9915
9934
  }
9916
9935
  const Et = class Et {
9917
9936
  constructor(e) {
@@ -9944,7 +9963,7 @@ const Et = class Et {
9944
9963
  Et.enable = !1, Et.enableLong = !1;
9945
9964
  let Ze = Et;
9946
9965
  const le = new Ze("RTMP_Capture");
9947
- class x_ {
9966
+ class O_ {
9948
9967
  constructor(e) {
9949
9968
  this._videoFirstframeCaptured = !1, this._audioFirstframeCaptured = !1, this._videoProcessorReader = null, this._audioProcessorReader = null, this._bridge = e;
9950
9969
  }
@@ -10043,8 +10062,8 @@ class x_ {
10043
10062
  });
10044
10063
  }
10045
10064
  }
10046
- const Ba = '(function(){"use strict";var l=(i=>(i.OnVideoCaptured="onvideocaptured",i.OnAudioCaptured="onaudiocaptured",i.OnVideoCaptureNoOutput="onvideocapturenooutput",i.OnVideoEncoded="onvideoencoded",i.OnAudioEncoded="onaudioencoded",i.OnEncodedFrame="onencodedframe",i.OnPacketed="onpacketed",i.OnUpstreamFeedback="onupstreamfeedback",i.OnBitrateChanged="onbitratechanged",i))(l||{}),O=(i=>(i.OnError="onerror",i.OnConnectClosed="onconnectclosed",i.OnFirstFramePushed="onfirstframepushed",i))(O||{}),I=(i=>(i.Video="video",i.Audio="audio",i))(I||{}),v=(i=>(i.Init="init",i.AvExist="avexist",i.VideoFrame="videoframe",i.MockVideoEncode="mockvideoencode",i.AudioFrame="audioframe",i.AdjustBitrate="adjustbitrate",i.Publish="publish",i.UnPublish="unpublish",i.Download="download",i.GetStats="getstats",i.EncodeConfig="encodeconfig",i))(v||{}),w=(i=>(i.Ready="ready",i.Error="error",i.FirstFramePushed="firstframepushed",i.Flvfile="flvfile",i.STATS="stats",i.Close="close",i))(w||{});function $(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var k={exports:{}},U;function q(){return U||(U=1,function(i){var t=Object.prototype.hasOwnProperty,e="~";function s(){}Object.create&&(s.prototype=Object.create(null),new s().__proto__||(e=!1));function r(u,a,n){this.fn=u,this.context=a,this.once=n||!1}function o(u,a,n,h,m){if(typeof n!="function")throw new TypeError("The listener must be a function");var g=new r(n,h||u,m),f=e?e+a:a;return u._events[f]?u._events[f].fn?u._events[f]=[u._events[f],g]:u._events[f].push(g):(u._events[f]=g,u._eventsCount++),u}function _(u,a){--u._eventsCount===0?u._events=new s:delete u._events[a]}function c(){this._events=new s,this._eventsCount=0}c.prototype.eventNames=function(){var a=[],n,h;if(this._eventsCount===0)return a;for(h in n=this._events)t.call(n,h)&&a.push(e?h.slice(1):h);return Object.getOwnPropertySymbols?a.concat(Object.getOwnPropertySymbols(n)):a},c.prototype.listeners=function(a){var n=e?e+a:a,h=this._events[n];if(!h)return[];if(h.fn)return[h.fn];for(var m=0,g=h.length,f=new Array(g);m<g;m++)f[m]=h[m].fn;return f},c.prototype.listenerCount=function(a){var n=e?e+a:a,h=this._events[n];return h?h.fn?1:h.length:0},c.prototype.emit=function(a,n,h,m,g,f){var F=e?e+a:a;if(!this._events[F])return!1;var d=this._events[F],C=arguments.length,N,p;if(d.fn){switch(d.once&&this.removeListener(a,d.fn,void 0,!0),C){case 1:return d.fn.call(d.context),!0;case 2:return d.fn.call(d.context,n),!0;case 3:return d.fn.call(d.context,n,h),!0;case 4:return d.fn.call(d.context,n,h,m),!0;case 5:return d.fn.call(d.context,n,h,m,g),!0;case 6:return d.fn.call(d.context,n,h,m,g,f),!0}for(p=1,N=new Array(C-1);p<C;p++)N[p-1]=arguments[p];d.fn.apply(d.context,N)}else{var fe=d.length,R;for(p=0;p<fe;p++)switch(d[p].once&&this.removeListener(a,d[p].fn,void 0,!0),C){case 1:d[p].fn.call(d[p].context);break;case 2:d[p].fn.call(d[p].context,n);break;case 3:d[p].fn.call(d[p].context,n,h);break;case 4:d[p].fn.call(d[p].context,n,h,m);break;default:if(!N)for(R=1,N=new Array(C-1);R<C;R++)N[R-1]=arguments[R];d[p].fn.apply(d[p].context,N)}}return!0},c.prototype.on=function(a,n,h){return o(this,a,n,h,!1)},c.prototype.once=function(a,n,h){return o(this,a,n,h,!0)},c.prototype.removeListener=function(a,n,h,m){var g=e?e+a:a;if(!this._events[g])return this;if(!n)return _(this,g),this;var f=this._events[g];if(f.fn)f.fn===n&&(!m||f.once)&&(!h||f.context===h)&&_(this,g);else{for(var F=0,d=[],C=f.length;F<C;F++)(f[F].fn!==n||m&&!f[F].once||h&&f[F].context!==h)&&d.push(f[F]);d.length?this._events[g]=d.length===1?d[0]:d:_(this,g)}return this},c.prototype.removeAllListeners=function(a){var n;return a?(n=e?e+a:a,this._events[n]&&_(this,n)):(this._events=new s,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=e,c.EventEmitter=c,i.exports=c}(k)),k.exports}var z=q(),H=$(z);const x=class x{constructor(t){this.group=(...e)=>{this._enabled&&console.group(`[${this._prefix}]: `,...e)},this.groupCollapsed=(...e)=>{this._enabled&&console.groupCollapsed(`[${this._prefix}]: `,...e)},this.groupEnd=()=>{this._enabled&&console.groupEnd()},this.log=(...e)=>{this._enabled&&console.log(`[${this._prefix}]: `,...e)},this.warn=(...e)=>{this._enabled&&console.warn(`[${this._prefix}]: `,...e)},this.error=(...e)=>{this._enabled&&console.error(`[${this._prefix}]: `,...e)},this.table=(...e)=>{this._enabled&&console.table(...e)},this._prefix=t}get _enabled(){return x.enable}get _enableLong(){return x.enableLong}get long(){return this._enableLong}};x.enable=!1,x.enableLong=!1;let E=x;function S(i){i=i.filter(Boolean);const t=new Uint8Array(i.reduce((s,r)=>s+r.byteLength,0));let e=0;return i.forEach(s=>{t.set(s,e),e+=s.byteLength}),t}const A={codec:"avc1.4DE033",MaxCachedFrameSize:100,RealSpeedPercent:.8,UplinkBitrateCheckInterval:60*1e3,VideoBitrateDefault:1e6,AudioBitrateDefault:68e3,gopSize:90,sampleRate:48e3,channel:2,audioEncoderPath:"https://lf-unpkg.volccdn.com/obj/vcloudfe/sdk/Web_push/1.0.1/1735619140327/pcm2aac.js",audioEncoderWasmPath:"https://lf-unpkg.volccdn.com/obj/vcloudfe/sdk/Web_push/1.0.2/1735619208418/pcm2aac.wasm",ignoreRelPublish:!1},T=new E("RTMP_AudioEncoder");class j{constructor(t){this._encodedFrameCount=0,this._ready=!1,this._lastFrame=null,this._aacOutput=(e,s)=>{const r=this._module.HEAPU8.subarray(e,e+s);if(!this._lastFrame)return;this._encodedFrameCount++;const{props:o}=this._lastFrame,_={buffer:new Uint8Array(r),props:{timestamp:parseInt(o.timestamp/1e3),originTs:parseInt(o.timestamp/1e3)}};this._core.emit(l.OnAudioEncoded,_)},this._core=t}async init(){const t=await fetch(A.audioEncoderPath).then(_=>_.text());new Function(`self.exports={};${t}`)();const e=self.exports.m;let s,r;const o=new Promise((_,c)=>{r=_,s=c});return e({instantiateWasm:function(_,c){fetch(A.audioEncoderWasmPath).then(u=>u.arrayBuffer()).then(u=>WebAssembly.instantiate(u,_)).then(function(u){return c(u.instance)}).then(()=>{r(),T.log("aac module inited")}).catch(u=>{s(u)})}}).then(_=>{const c=_.addFunction(this._aacOutput,"vii");_._init_callback(c),this._module=_}).catch(s),o}rnnoise(t){var s;const e=t.length;for(let r=0;r<e;r++)t[r]=t[r]*32768;(s=this._rnnoiseModule)==null||s.processFrame(t);for(let r=0;r<e;r++)t[r]=t[r]/32768}updateConfigure(){this._module._flush(),this._module._free_encoder(),this._ready=!1}encode(t){if(!this._ready){const o=this._start_encoder();if(o<0)throw new Error(`init aac encoder error, code:${o}`)}this._lastFrame=t;const e=t.buffer.buffer,s=this._module._malloc(e.byteLength);this._module.HEAPU8.subarray(s,s+e.byteLength).set(new Uint8Array(e));const r=this._module._encode_one_frame(s);if(r<0)throw new Error(`encode aac frame error, code:${r}`)}_start_encoder(){const t=this._core.getSetting(),e=this._module._init_encoder(t.sampleRate,t.channel,t.audioBitrate);if(e<0)return e;this._ready=!0,T.log(`init encoder: sampleRate=${t.sampleRate}, channel:${t.channel}, bitrate:${t.audioBitrate}`)}destroy(){var t;(t=this._module)==null||t._free_encoder()}}const P=1024;class M{constructor(){this._queue=[],this._sampleCount=0}compose(t){if(this._queue.push(t),this._sampleCount+=t.data.audioData.numberOfFrames,this._sampleCount>=P)return this._doCompose()}_doCompose(){const t=new Float32Array(P);let e=0,s=P;const r=this._queue[0];for(;;){const o=this._queue[0];if(!o)break;const _=Math.min(s,o.data.audioData.numberOfFrames-o.offset,480),c=o.data.buffer.slice(o.offset,o.offset+_);if(o.offset+=_,o.offset>=o.data.audioData.numberOfFrames&&this._queue.shift(),s-=_,this._sampleCount-=_,t.set(c,e),e+=_,s<=0)break}return{buffer:t,props:{timestamp:r.data.audioData.timestamp,sampleRate:r.data.audioData.sampleRate,numberOfChannels:r.data.audioData.numberOfChannels}}}}var y=(i=>(i[i.RTMP_INIT_FAIL=3e3]="RTMP_INIT_FAIL",i[i.AUDIO_ENCODER_INIT_FAIL=3001]="AUDIO_ENCODER_INIT_FAIL",i[i.AUDIO_RRNOISE_INIT_FAIL=3002]="AUDIO_RRNOISE_INIT_FAIL",i[i.AUDIO_ENCODE_FAIL=3003]="AUDIO_ENCODE_FAIL",i[i.VIDEO_ENCODE_CONFIGURE_FAIL=3004]="VIDEO_ENCODE_CONFIGURE_FAIL",i[i.VIDEO_ENCODE_FAIL=3005]="VIDEO_ENCODE_FAIL",i[i.WTP_OPEN_FAIL=3006]="WTP_OPEN_FAIL",i[i.WTP_CONNECT_FAIL=3007]="WTP_CONNECT_FAIL",i[i.WORKER_ERROR=3008]="WORKER_ERROR",i))(y||{});class W extends Error{constructor(t,e,s){super(),this.code=t,this.message=e,s&&(this.ext=s),this.toJson=()=>({code:this.code,message:this.message,ext:this.ext})}}function b(i,t,e){return new W(i,t,e)}class G{constructor(t){this._audioFrameQueue=new M,this.encode=e=>{const s=new Float32Array(e.numberOfFrames);e.copyTo(s,{planeIndex:0,frameOffset:0,frameCount:e.numberOfFrames});const r=this._audioFrameQueue.compose({offset:0,data:{audioData:e,buffer:s}});if(r)try{this._encoder.encode(r)}catch(o){this._core.emit(O.OnError,b(y.AUDIO_ENCODE_FAIL,o.message))}},this._core=t,this._encoder=new j(t)}async init(){try{await this._encoder.init()}catch(t){throw b(y.AUDIO_ENCODER_INIT_FAIL,t.message)}}setConfiguration(t){const e=Object.assign({},this._core.getSetting(),{audioBitrate:t});this._core.updateSetting(e),this._encoder.updateConfigure()}destroy(){this._encoder.destroy()}}const L=new E("RTMP_VEncoder");class J{constructor(t){this._encoder=null,this._queue=[],this._encodeTimer=0,this._loopEncodeTimer=0,this._frameIndex=0,this._gopSize=0,this._encodedFrameCount=0,this._lastFrame=null,this._startTimer=()=>{this._clearEncodeTimer(),this._encodeTimer=setInterval(()=>{const e=this._queue.shift();if(!(!e||!this._encoder||this._encoder.state==="closed"))try{this._encoder.encode(e,{keyFrame:this._frameIndex%this._gopSize===0}),this._frameIndex++,this._lastFrame&&this._lastFrame.close(),this._lastFrame=e}catch(s){L.log("encode frame error",s)}},5)},this._core=t}configurate(t){return this._gopSize=t.gopSize,this._encoder?this.flush().then(()=>this._configure(t)):this._configure(t)}_configure(t){return this._clearEncodeTimer(),L.log("start config encoder",t),VideoEncoder.isConfigSupported(t).then(e=>{if(!e.supported)throw new Error(`VideoEncoder not support config, ${JSON.stringify(t)}`);this._encoder=new VideoEncoder({output:(s,r)=>{const o=new Uint8Array(s.byteLength);s.copyTo(o),this._emitFrame(o,s,r)},error:s=>{this._clearEncodeTimer(),this._core.emit(O.OnError,b(y.VIDEO_ENCODE_FAIL,s.message))}}),this._encoder.configure(t),L.log("encoder configured")}).then(this._startTimer).catch(e=>{throw b(y.VIDEO_ENCODE_CONFIGURE_FAIL,e.message)})}_emitFrame(t,e,s){this._encodedFrameCount++,this._core.emit(l.OnVideoEncoded,{buffer:t,props:{byteLength:e.byteLength,duration:e.duration,timestamp:parseInt(e.timestamp/1e3),originTs:parseInt(e.timestamp/1e3),type:e.type},cfg:s.decoderConfig})}_clearEncodeTimer(){clearInterval(this._encodeTimer)}_clearLoopEncodeTimer(){this._loopEncodeTimer&&clearInterval(this._loopEncodeTimer)}flush(){return this._encoder?this._encoder.flush().then(()=>{var t;this._clearEncodeTimer(),(t=this._encoder)==null||t.close(),this._frameIndex=0,this._encoder=null,L.log("encoder flush & closed")}).catch(t=>{console.log("encoder flush & close error:",t)}):Promise.resolve()}encode(t){this._clearLoopEncodeTimer(),this._queue.push(t)}startLoop(t){if(!this._lastFrame)return;const e=Math.floor(1e3/t*1e3);L.log("start encode last frame looped, ",t,"increment:",e),this._loopEncodeTimer=setInterval(()=>{if(!this._lastFrame)return;const s=new VideoFrame(this._lastFrame,{duration:e,timestamp:(this._lastFrame.timestamp||0)+e});this._queue.push(s)},Math.floor(1e3/t))}destroy(){this._queue.forEach(t=>t.close()),this._lastFrame&&this._lastFrame.close(),this._clearEncodeTimer(),this._clearLoopEncodeTimer(),this.flush()}}const Q=new E("RTMP_VideoEncode");class K{constructor(t){this._core=t,this._encoder=new J(t)}async setConfiguration(t={}){const e=Object.assign({},this._core.getSetting(),t),s={width:e.width,height:e.height,displayWidth:e.width,displayHeight:e.height,bitrate:e.videoBitrate,framerate:Math.floor(e.frameRate),codec:e.codec,gopSize:e.gopSize,hardwareAcceleration:e.hardwareAcceleration};this._core.updateSetting(e),Q.log("set Configuration:",s,t);try{await this._encoder.configurate(s)}catch(r){this._core.emit(O.OnError,r)}}encode(t){this._encoder.encode(t)}startLoopEncodeLastFrame(){this._encoder.startLoop(this._core.getSetting().frameRate)}flushEncoder(){this._encoder.flush()}destroy(){this._encoder.destroy()}}const V=new E("RTMP_AVSync");class Z{constructor(t){this._videoFrameGot=!1,this._videoBaseDts=0,this._audioBaseDts=0,this._videoNextDts=0,this._videoLastDts=0,this._audioNextDts=0,this._lastVideoReceived=0,this._core=t}get avExist(){return this._core.getSetting().hasVideo&&this._core.getSetting().hasAudio}get videoRefDuration(){return parseInt(1e3/this._core.getSetting().frameRate)}get audioRefDuration(){return parseInt(1024/this._core.getSetting().sampleRate*1e3)}addVideoFrame(t){this._videoFrameGot||(this._videoFrameGot=!0);const e=t.props;if(Math.abs(this._videoNextDts-e.timestamp-this._videoBaseDts)>1e3){const r=Date.now()-this._lastVideoReceived;this._videoNextDts=this._videoNextDts===this._audioNextDts?this._videoNextDts+this.videoRefDuration:this._audioNextDts||this._videoNextDts+r,this._videoBaseDts=this._videoNextDts-e.timestamp,V.warn(`video stream timestamp breaked! dts:${this._videoNextDts} -> ${e.timestamp}, videoBaseDts=${this._videoBaseDts}, deltaToLastFrame=${r}`)}e.timestamp=e.timestamp+this._videoBaseDts;const s=e.timestamp-this._videoLastDts;return s>100&&V.warn("video frame large gap",s),this._videoLastDts=this._videoNextDts=e.timestamp,V.long&&V.log(`V frame, dts: ${e.timestamp}, originDts:${e.originTs}, videoBaseDts=${this._videoBaseDts}, type=${e.type}, duration=${s}`),this._lastVideoReceived=Date.now(),this._core.emit(l.OnEncodedFrame,I.Video,t),{size:t.buffer.length,duration:s,key:t.props.type==="key"}}addAudioFrame(t){if(this.avExist&&!this._videoFrameGot)return;const e=t.props;return this._audioBaseDts||(this._audioBaseDts=e.timestamp-this._videoNextDts),Math.abs(e.timestamp-this._audioBaseDts-this._audioNextDts)>1e3&&(this._audioBaseDts=this._audioNextDts+this.audioRefDuration-e.timestamp,V.warn(`audio stream timestamp breaked! dts:${this._audioNextDts} -> ${e.timestamp}, audioBaseDts=${this._audioBaseDts}`)),this._audioNextDts=e.timestamp=e.timestamp-this._audioBaseDts,V.long&&V.log(`A frame, dts: ${e.timestamp}, originDts:${e.originTs}`),this._core.emit(l.OnEncodedFrame,I.Audio,t),{size:t.buffer.length,duration:this.audioRefDuration}}}class X{constructor(){this._videoSize=0,this._videoDuration=0,this._videoBitrate=0,this._frameCount=0,this._fps=0,this._videoEncodedCount=0,this._keyCount=0,this._audioSize=0,this._audioDuration=0,this._audioBitrate=0,this._audioEncodedCount=0}get videoStats(){return{sendBitrate:this._videoBitrate,framesPerSecond:this._fps,framesEncoded:this._videoEncodedCount,keyFramesEncoded:this._keyCount}}get audioStats(){return{sendBitrate:this._audioBitrate,framesEncoded:this._audioEncodedCount}}addVideoSample({size:t,duration:e,key:s}){this._videoEncodedCount++,this._videoSize+=t,this._videoDuration+=e,this._frameCount++,s&&this._keyCount++,this._videoDuration>=1e3&&(this._videoBitrate=Math.floor(this._videoSize/this._videoDuration*8e3),this._fps=this._frameCount,this._frameCount=0,this._videoSize=0,this._videoDuration=0)}addAudioSample({size:t,duration:e}){this._audioEncodedCount++,this._audioSize+=t,this._audioDuration+=e,this._audioDuration>=1e3&&(this._audioBitrate=Math.floor(this._audioSize/this._audioDuration*1e3),this._audioSize=0,this._audioDuration=0)}}const Y=new E("RTMP_EncodeController");class ee{constructor(t){this._analyse=new X,this._gotFrame=!1,this._OnVideoCaptured=(e,s)=>{this._gotFrame=!0,this._videoSettingChanged(s)&&(Y.log("video track setting changed!",s),this._core.updateSetting({width:s.width,height:s.height,frameRate:s.frameRate,vDeviceId:s.deviceId}),this._videoEncode.setConfiguration()),this._videoEncode.encode(e)},this._OnVideoCaptureNoOutput=()=>{this._videoEncode.startLoopEncodeLastFrame()},this._OnAudioCaptured=e=>{this._gotFrame=!0,this._audioEncode.encode(e)},this._OnVideoEncoded=e=>{const s=this._avSync.addVideoFrame(e);this._analyse.addVideoSample(s)},this._OnAudioEncoded=e=>{if(!e.buffer.length)return;const s=this._avSync.addAudioFrame(e);s&&this._analyse.addAudioSample(s)},this._OnUpstreamFeedback=e=>{this._videoEncode.setConfiguration(e)},this._OnBitrateChanged=(e,s)=>{this._gotFrame&&(e===I.Video&&this._videoEncode.setConfiguration({videoBitrate:s}),e===I.Audio&&this._audioEncode.setConfiguration(s))},this._core=t,this._audioEncode=new G(t),this._videoEncode=new K(t),this._avSync=new Z(t),this._bindEvents()}getStats(){return{video:this._analyse.videoStats,audio:this._analyse.audioStats}}init(){return this._audioEncode.init()}_bindEvents(){this._core.on(l.OnVideoCaptured,this._OnVideoCaptured),this._core.on(l.OnAudioCaptured,this._OnAudioCaptured),this._core.on(l.OnVideoCaptureNoOutput,this._OnVideoCaptureNoOutput),this._core.on(l.OnVideoEncoded,this._OnVideoEncoded),this._core.on(l.OnAudioEncoded,this._OnAudioEncoded),this._core.on(l.OnUpstreamFeedback,this._OnUpstreamFeedback),this._core.on(l.OnBitrateChanged,this._OnBitrateChanged)}_videoSettingChanged(t){const e=this._core.getSetting();return t.width!==e.width||t.height!==e.height||Math.floor(t.frameRate)!==Math.floor(e.frameRate)||t.deviceId!==e.vDeviceId}destroy(){this._videoEncode.destroy(),this._audioEncode.destroy()}}var B=(i=>(i[i.AUDIO=8]="AUDIO",i[i.VIDEO=9]="VIDEO",i[i.SCRIPT_DATA=18]="SCRIPT_DATA",i))(B||{});const te=10,ie=1,se=7,oe={96e3:0,48e3:3,44100:4,22050:7,16e3:8,8e3:11};function re(i){const t=(i[4]&3)+1;let e;const s=[],r=[];let o=6;const _=i[5]&31;let c;for(let n=0;n<_;n++){if(c=i[o]<<8|i[o+1],o+=2,!c)continue;const h=i.subarray(o,o+c);o+=c,s.push(h)}const u=i[o];o++;let a;for(let n=0;n<u;n++)a=i[o]<<8|i[o+1],o+=2,a&&(r.push(i.subarray(o,o+a)),o+=a);return{sps:e,spsArr:s,ppsArr:r,nalUnitSize:t}}class ne{constructor(){this._cfg={hasVideo:!1,hasAudio:!1,sampleRate:48e3,channelCount:1},this._hasAudioSeqHeader=!1,this._hasVideoSeqHeader=!1}setConfig(t){this._cfg=Object.assign(this._cfg,t)}genHeader(){const t=[70,76,86,1,(this._cfg.hasAudio?1:0)<<2|(this._cfg.hasVideo?1:0),0,0,0,9,0,0,0,0];return new Uint8Array(t)}genSeqTag(t,e){let s;t===8?(s=this._genAudioTagPaylod(0,e),this._hasAudioSeqHeader=!0):(s=this._genVideoTagPayload(0,e),this._hasVideoSeqHeader=!0);const r=this._genTagHeader(t,s.length,e.props.timestamp),o=r.length+s.length;return S([r,s,new Uint8Array([o>>>24,o>>>16,o>>>8,o])])}genFrameTag(t,e){let s;t===8?s=this._genAudioTagPaylod(1,e):s=this._genVideoTagPayload(1,e);const r=this._genTagHeader(t,s.length,e.props.timestamp),o=r.length+s.length;return S([r,s,new Uint8Array([o>>>24,o>>>16,o>>>8,o])])}_genTagHeader(t,e,s){return new Uint8Array([t,e>>>16,e>>>8,e,s>>>16,s>>>8,s,s>>>24,0,0,0])}_genAudioTagPaylod(t,e){return S(t===0?[this._genAudioTagHeader(),this._genAudioSequenceHeader()]:[this._genAudioTagHeader(),this._genAudioData(e)])}_genAudioTagHeader(){return new Uint8Array([te<<4|12|ie<<1|this._cfg.channelCount-1])}_genAudioSequenceHeader(){const t=4096|oe[this._cfg.sampleRate]<<7|this._cfg.channelCount<<3;return new Uint8Array([0,t>>8,t])}_genAudioData(t){const e=new Uint8Array(1+t.buffer.length);return e.set([1],0),e.set(t.buffer,1),e}_genVideoTagPayload(t,e){return S(t===0?[this._genVideoTagHeader(e),this._genVideoSequenceHeader(e)]:[this._genVideoTagHeader(e),this._genVideoData(e)])}_genVideoTagHeader(t){return new Uint8Array([(t.props.type==="key"?1:2)<<4|se,this._hasVideoSeqHeader?1:0,0,0,0])}_genVideoSequenceHeader(t){return new Uint8Array(t.cfg.description)}_genVideoData(t){if(t.props.type==="delta")return t.buffer;const e=re(new Uint8Array(t.cfg.description)),s=e.spsArr[0].length,r=e.ppsArr[0].length;return S([new Uint8Array([0,0,s>>8,s%256]),e.spsArr[0],new Uint8Array([0,0,r>>8,r%256]),e.ppsArr[0],t.buffer])}}const ae=new E("RTMP_Packet");class de{constructor(t){this._firstFrame=!0,this._flv=new ne,this._OnEncodedFrame=(e,s)=>{if(this._firstFrame){const o=this._core.getSetting();this._flv.setConfig({hasVideo:o.hasVideo,hasAudio:o.hasAudio,sampleRate:o.sampleRate,channelCount:o.channel});const _=this._flv.genHeader();if(this._core.emit(l.OnPacketed,_),o.hasVideo){const c=this._flv.genSeqTag(B.VIDEO,s);this._core.emit(l.OnPacketed,c)}if(o.hasAudio){const c=this._flv.genSeqTag(B.AUDIO,s);this._core.emit(l.OnPacketed,c)}this._firstFrame=!1,ae.log("first frame encoded & packed")}const r=this._flv.genFrameTag(e==="video"?B.VIDEO:B.AUDIO,s);this._core.emit(l.OnPacketed,r,s.props.type==="key")},this._core=t,this._bindEvents()}_bindEvents(){this._core.on(l.OnEncodedFrame,this._OnEncodedFrame)}destroy(){}}class he{constructor(){this._lastDot=0,this._totalSize=0,this._speed=[]}addSample(t){this._lastDot||(this._lastDot=Date.now()),this._totalSize+=t;const e=Date.now()-this._lastDot;e>=500&&(this._addSpeedSample(this._totalSize/e*8e3),this._totalSize=0,this._lastDot=Date.now())}_addSpeedSample(t){this._speed.push(t),this._speed=this._speed.slice(-6)}reset(){this._speed=[]}getUpSpeed(){return this._speed.length?parseInt(this._speed.reduce((t,e)=>t+=e,0)/this._speed.length):0}}const D=new E("RTMP_Wtp");class ce{constructor(t){this._queue=[],this._url="",this._connectClosed=!1,this._upSpeed=new he,this._transport=null,this._writer=null,this._inWriting=!1,this._inAdjustEncode=!1,this._increaseTimer=0,this._firstFramePushed=!1,this._core=t,this._bindEvents()}get sendSpeed(){return this._upSpeed.getUpSpeed()}getStats(){var t;return(t=this._transport)==null?void 0:t.getStats()}_bindEvents(){this._core.on(l.OnPacketed,(t,e=!1)=>{this._checkDecreaseBitrate(),this._checkDeleteCache(e),this._queue.push(t),this._inWriting||this._write()})}_checkDecreaseBitrate(){if(this._inAdjustEncode)return;const t=this._upSpeed.getUpSpeed();if(!t||this._queue.length<A.MaxCachedFrameSize)return;D.log(`up speed: ${t} low, ajust encode setting`);const e=this._core.getSetting();this._core.emit(l.OnUpstreamFeedback,{videoBitrate:t*A.RealSpeedPercent,width:e.width,height:e.height,frameRate:e.frameRate}),this._inAdjustEncode=!0,this._checkIncreaseBitrate()}_checkIncreaseBitrate(){D.log("add timer to check uplink speed increased"),clearInterval(this._increaseTimer),this._increaseTimer=setTimeout(()=>{const t=this._core.getSetting();D.log(`set encode bitrate to specified ${t.videoBitrate}`),this._core.emit(l.OnUpstreamFeedback,{videoBitrate:t.videoBitrate,width:t.width,height:t.height,frameRate:t.frameRate}),this._inAdjustEncode=!0},A.UplinkBitrateCheckInterval)}_checkDeleteCache(t){this._inAdjustEncode&&t&&(D.log(`ajust encode setting finish, delete cached ${this._queue.length} frame`),this._queue=[],this._upSpeed.reset(),this._inAdjustEncode=!1)}async start(t){this._url=t;try{await this._connect()}catch(e){throw b(y.WTP_OPEN_FAIL,e.message)}}async _connect(){const t=new WebTransport(this._url);let e;t.closed.then(()=>{D.log("webtransport closed")}).catch(r=>{e=r.message,D.log("webtransport closed due to",r)}).finally(()=>{this._connectClosed=!0,this._core.emit(O.OnConnectClosed,e),this._core.emit(O.OnError,b(y.WTP_CONNECT_FAIL,e))}),await t.ready,this._transport=t;const s=await t.createBidirectionalStream();this._writer=s.writable.getWriter(),this._write(),D.log("transport opend")}async _write(){var e;if(!this._writer)return;this._inWriting=!0;const t=this._queue.shift();if(!t){this._inWriting=!1;return}await((e=this._writer)==null?void 0:e.write(t)),this._firstFramePushed||(this._firstFramePushed=!0,this._core.emit(O.OnFirstFramePushed),D.log("first frame pushed")),this._upSpeed.addSample(t.length);try{await this._write()}catch(s){D.log("writer error:",s)}}getFile(){return S(this._queue)}destroy(){var t,e;clearTimeout(this._increaseTimer),this._connectClosed||(t=this._writer)==null||t.close(),this._writer=null,(e=this._transport)==null||e.close(),this._transport=null}}const ue=new E("LiveRTMP");class _e extends H{constructor(){super(),this._ts=0,this._setting={codec:A.codec,hardwareAcceleration:"prefer-hardware",width:-1,height:-1,frameRate:-1,sampleRate:A.sampleRate,channel:A.channel,gopSize:A.gopSize,videoBitrate:A.VideoBitrateDefault,audioBitrate:A.AudioBitrateDefault,hasAudio:!1,hasVideo:!1,vDeviceId:"",aDeviceId:""},this._encode=new ee(this),this._packet=new de(this),this._transport=new ce(this)}async checkVideoHardwareAcceleration(){const t=["prefer-hardware","prefer-software","no-preference"],e=this.getSetting(),s={codec:e.codec,width:1280,height:720,framerate:15,bitrate:e.videoBitrate};for(const r of t)try{if((await VideoEncoder.isConfigSupported({...s,hardwareAcceleration:r})).supported)return this.updateSetting({hardwareAcceleration:r}),Promise.resolve()}catch{throw b(y.VIDEO_ENCODE_CONFIGURE_FAIL,`VideoEncoder not support hardwareAcceleration, ${JSON.stringify({...s,hardwareAcceleration:r})}`)}throw b(y.VIDEO_ENCODE_CONFIGURE_FAIL,"VideoEncoder not support hardwareAcceleration")}async ready(){await Promise.all([this.checkVideoHardwareAcceleration(),this._encode.init()])}getSetting(){return this._setting}updateSetting(t){this._setting=Object.assign({},this._setting,t)}videoFrameCaptured(t,e){this.emit(l.OnVideoCaptured,t,e)}audioFrameCaptured(t,e){this.emit(l.OnAudioCaptured,t,e)}startMockVideoEncode(){this.emit(l.OnVideoCaptureNoOutput)}adjustBitrate(t,e){t===I.Video&&this.updateSetting({videoBitrate:e}),t===I.Audio&&this.updateSetting({audioBitrate:e}),this.emit(l.OnBitrateChanged,t,e)}avExist(t,e){this._setting.hasVideo=t,this._setting.hasAudio=e}publish(t){return this._transport.start(t)}setEncodeCapacity(t){this._setting=Object.assign({},this._setting,t)}getStats(){return{video:{...this._encode.getStats().video,sendSpeed:this._transport.sendSpeed,codec:this._setting.codec,frameWidth:this._setting.width,frameHeight:this._setting.height,gopSize:this._setting.gopSize},audio:{...this._encode.getStats().audio,codec:"aac",channels:this._setting.channel,sampleRate:this._setting.sampleRate}}}destroy(){ue.log("destroy"),this._encode.destroy(),this._packet.destroy(),this._transport.destroy()}down(){return this._transport.getFile()}}self.constructor.name!=="Window"&&le();function le(){let i={};self.addEventListener("message",async t=>{switch(t.data.type){case v.Init:{const{options:e}=t.data;e.logEnable&&(E.enable=!0),e.logEnableLong&&(E.enableLong=!0),i=new _e,i.on(O.OnError,s=>{self.postMessage({type:w.Error,data:s.toJson()})}),i.on(O.OnConnectClosed,()=>{self.postMessage({type:w.Close})}),i.on(O.OnFirstFramePushed,()=>{self.postMessage({type:w.FirstFramePushed})});try{await i.ready(),self.postMessage({type:w.Ready})}catch(s){self.postMessage({type:w.Error,data:s.toJson()})}}break;case v.AvExist:{const{hasAudio:e,hasVideo:s}=t.data;i.avExist(s,e)}break;case v.VideoFrame:{const{frame:e,setting:s}=t.data;i.videoFrameCaptured(e,s)}break;case v.MockVideoEncode:i.startMockVideoEncode();break;case v.AudioFrame:{const{frame:e,setting:s}=t.data;i.audioFrameCaptured(e,s)}break;case v.AdjustBitrate:{const{kind:e,bitrate:s}=t.data;i.adjustBitrate(e,s)}break;case v.Publish:{const{url:e}=t.data;try{await i.publish(e)}catch(s){self.postMessage({type:w.Error,data:s.toJson()})}}break;case v.GetStats:self.postMessage({type:w.STATS,data:i.getStats()});break;case v.EncodeConfig:{i.setEncodeCapacity(t.data.cfg);break}case v.Download:{const e=i.down();self.postMessage({type:w.Flvfile,buffer:e},[e.buffer])}break;case v.UnPublish:{i.destroy();break}}})}})();\n', ho = typeof self < "u" && self.Blob && new Blob([Ba], { type: "text/javascript;charset=utf-8" });
10047
- function P_(r) {
10065
+ const Va = '(function(){"use strict";var l=(i=>(i.OnVideoCaptured="onvideocaptured",i.OnAudioCaptured="onaudiocaptured",i.OnVideoCaptureNoOutput="onvideocapturenooutput",i.OnVideoEncoded="onvideoencoded",i.OnAudioEncoded="onaudioencoded",i.OnEncodedFrame="onencodedframe",i.OnPacketed="onpacketed",i.OnUpstreamFeedback="onupstreamfeedback",i.OnBitrateChanged="onbitratechanged",i))(l||{}),O=(i=>(i.OnError="onerror",i.OnConnectClosed="onconnectclosed",i.OnFirstFramePushed="onfirstframepushed",i))(O||{}),I=(i=>(i.Video="video",i.Audio="audio",i))(I||{}),v=(i=>(i.Init="init",i.AvExist="avexist",i.VideoFrame="videoframe",i.MockVideoEncode="mockvideoencode",i.AudioFrame="audioframe",i.AdjustBitrate="adjustbitrate",i.Publish="publish",i.UnPublish="unpublish",i.Download="download",i.GetStats="getstats",i.EncodeConfig="encodeconfig",i))(v||{}),w=(i=>(i.Ready="ready",i.Error="error",i.FirstFramePushed="firstframepushed",i.Flvfile="flvfile",i.STATS="stats",i.Close="close",i))(w||{});function $(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var k={exports:{}},U;function q(){return U||(U=1,function(i){var t=Object.prototype.hasOwnProperty,e="~";function s(){}Object.create&&(s.prototype=Object.create(null),new s().__proto__||(e=!1));function r(u,a,n){this.fn=u,this.context=a,this.once=n||!1}function o(u,a,n,h,m){if(typeof n!="function")throw new TypeError("The listener must be a function");var g=new r(n,h||u,m),f=e?e+a:a;return u._events[f]?u._events[f].fn?u._events[f]=[u._events[f],g]:u._events[f].push(g):(u._events[f]=g,u._eventsCount++),u}function _(u,a){--u._eventsCount===0?u._events=new s:delete u._events[a]}function c(){this._events=new s,this._eventsCount=0}c.prototype.eventNames=function(){var a=[],n,h;if(this._eventsCount===0)return a;for(h in n=this._events)t.call(n,h)&&a.push(e?h.slice(1):h);return Object.getOwnPropertySymbols?a.concat(Object.getOwnPropertySymbols(n)):a},c.prototype.listeners=function(a){var n=e?e+a:a,h=this._events[n];if(!h)return[];if(h.fn)return[h.fn];for(var m=0,g=h.length,f=new Array(g);m<g;m++)f[m]=h[m].fn;return f},c.prototype.listenerCount=function(a){var n=e?e+a:a,h=this._events[n];return h?h.fn?1:h.length:0},c.prototype.emit=function(a,n,h,m,g,f){var F=e?e+a:a;if(!this._events[F])return!1;var d=this._events[F],C=arguments.length,N,p;if(d.fn){switch(d.once&&this.removeListener(a,d.fn,void 0,!0),C){case 1:return d.fn.call(d.context),!0;case 2:return d.fn.call(d.context,n),!0;case 3:return d.fn.call(d.context,n,h),!0;case 4:return d.fn.call(d.context,n,h,m),!0;case 5:return d.fn.call(d.context,n,h,m,g),!0;case 6:return d.fn.call(d.context,n,h,m,g,f),!0}for(p=1,N=new Array(C-1);p<C;p++)N[p-1]=arguments[p];d.fn.apply(d.context,N)}else{var fe=d.length,R;for(p=0;p<fe;p++)switch(d[p].once&&this.removeListener(a,d[p].fn,void 0,!0),C){case 1:d[p].fn.call(d[p].context);break;case 2:d[p].fn.call(d[p].context,n);break;case 3:d[p].fn.call(d[p].context,n,h);break;case 4:d[p].fn.call(d[p].context,n,h,m);break;default:if(!N)for(R=1,N=new Array(C-1);R<C;R++)N[R-1]=arguments[R];d[p].fn.apply(d[p].context,N)}}return!0},c.prototype.on=function(a,n,h){return o(this,a,n,h,!1)},c.prototype.once=function(a,n,h){return o(this,a,n,h,!0)},c.prototype.removeListener=function(a,n,h,m){var g=e?e+a:a;if(!this._events[g])return this;if(!n)return _(this,g),this;var f=this._events[g];if(f.fn)f.fn===n&&(!m||f.once)&&(!h||f.context===h)&&_(this,g);else{for(var F=0,d=[],C=f.length;F<C;F++)(f[F].fn!==n||m&&!f[F].once||h&&f[F].context!==h)&&d.push(f[F]);d.length?this._events[g]=d.length===1?d[0]:d:_(this,g)}return this},c.prototype.removeAllListeners=function(a){var n;return a?(n=e?e+a:a,this._events[n]&&_(this,n)):(this._events=new s,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=e,c.EventEmitter=c,i.exports=c}(k)),k.exports}var z=q(),H=$(z);const x=class x{constructor(t){this.group=(...e)=>{this._enabled&&console.group(`[${this._prefix}]: `,...e)},this.groupCollapsed=(...e)=>{this._enabled&&console.groupCollapsed(`[${this._prefix}]: `,...e)},this.groupEnd=()=>{this._enabled&&console.groupEnd()},this.log=(...e)=>{this._enabled&&console.log(`[${this._prefix}]: `,...e)},this.warn=(...e)=>{this._enabled&&console.warn(`[${this._prefix}]: `,...e)},this.error=(...e)=>{this._enabled&&console.error(`[${this._prefix}]: `,...e)},this.table=(...e)=>{this._enabled&&console.table(...e)},this._prefix=t}get _enabled(){return x.enable}get _enableLong(){return x.enableLong}get long(){return this._enableLong}};x.enable=!1,x.enableLong=!1;let E=x;function S(i){i=i.filter(Boolean);const t=new Uint8Array(i.reduce((s,r)=>s+r.byteLength,0));let e=0;return i.forEach(s=>{t.set(s,e),e+=s.byteLength}),t}const A={codec:"avc1.4DE033",MaxCachedFrameSize:100,RealSpeedPercent:.8,UplinkBitrateCheckInterval:60*1e3,VideoBitrateDefault:1e6,AudioBitrateDefault:68e3,gopSize:90,sampleRate:48e3,channel:2,audioEncoderPath:"https://lf-unpkg.volccdn.com/obj/vcloudfe/sdk/Web_push/1.0.1/1735619140327/pcm2aac.js",audioEncoderWasmPath:"https://lf-unpkg.volccdn.com/obj/vcloudfe/sdk/Web_push/1.0.2/1735619208418/pcm2aac.wasm",ignoreRelPublish:!1},T=new E("RTMP_AudioEncoder");class j{constructor(t){this._encodedFrameCount=0,this._ready=!1,this._lastFrame=null,this._aacOutput=(e,s)=>{const r=this._module.HEAPU8.subarray(e,e+s);if(!this._lastFrame)return;this._encodedFrameCount++;const{props:o}=this._lastFrame,_={buffer:new Uint8Array(r),props:{timestamp:parseInt(o.timestamp/1e3),originTs:parseInt(o.timestamp/1e3)}};this._core.emit(l.OnAudioEncoded,_)},this._core=t}async init(){const t=await fetch(A.audioEncoderPath).then(_=>_.text());new Function(`self.exports={};${t}`)();const e=self.exports.m;let s,r;const o=new Promise((_,c)=>{r=_,s=c});return e({instantiateWasm:function(_,c){fetch(A.audioEncoderWasmPath).then(u=>u.arrayBuffer()).then(u=>WebAssembly.instantiate(u,_)).then(function(u){return c(u.instance)}).then(()=>{r(),T.log("aac module inited")}).catch(u=>{s(u)})}}).then(_=>{const c=_.addFunction(this._aacOutput,"vii");_._init_callback(c),this._module=_}).catch(s),o}rnnoise(t){var s;const e=t.length;for(let r=0;r<e;r++)t[r]=t[r]*32768;(s=this._rnnoiseModule)==null||s.processFrame(t);for(let r=0;r<e;r++)t[r]=t[r]/32768}updateConfigure(){this._module._flush(),this._module._free_encoder(),this._ready=!1}encode(t){if(!this._ready){const o=this._start_encoder();if(o<0)throw new Error(`init aac encoder error, code:${o}`)}this._lastFrame=t;const e=t.buffer.buffer,s=this._module._malloc(e.byteLength);this._module.HEAPU8.subarray(s,s+e.byteLength).set(new Uint8Array(e));const r=this._module._encode_one_frame(s);if(r<0)throw new Error(`encode aac frame error, code:${r}`)}_start_encoder(){const t=this._core.getSetting(),e=this._module._init_encoder(t.sampleRate,t.channel,t.audioBitrate);if(e<0)return e;this._ready=!0,T.log(`init encoder: sampleRate=${t.sampleRate}, channel:${t.channel}, bitrate:${t.audioBitrate}`)}destroy(){var t;(t=this._module)==null||t._free_encoder()}}const P=1024;class M{constructor(){this._queue=[],this._sampleCount=0}compose(t){if(this._queue.push(t),this._sampleCount+=t.data.audioData.numberOfFrames,this._sampleCount>=P)return this._doCompose()}_doCompose(){const t=new Float32Array(P);let e=0,s=P;const r=this._queue[0];for(;;){const o=this._queue[0];if(!o)break;const _=Math.min(s,o.data.audioData.numberOfFrames-o.offset,480),c=o.data.buffer.slice(o.offset,o.offset+_);if(o.offset+=_,o.offset>=o.data.audioData.numberOfFrames&&this._queue.shift(),s-=_,this._sampleCount-=_,t.set(c,e),e+=_,s<=0)break}return{buffer:t,props:{timestamp:r.data.audioData.timestamp,sampleRate:r.data.audioData.sampleRate,numberOfChannels:r.data.audioData.numberOfChannels}}}}var y=(i=>(i[i.RTMP_INIT_FAIL=3e3]="RTMP_INIT_FAIL",i[i.AUDIO_ENCODER_INIT_FAIL=3001]="AUDIO_ENCODER_INIT_FAIL",i[i.AUDIO_RRNOISE_INIT_FAIL=3002]="AUDIO_RRNOISE_INIT_FAIL",i[i.AUDIO_ENCODE_FAIL=3003]="AUDIO_ENCODE_FAIL",i[i.VIDEO_ENCODE_CONFIGURE_FAIL=3004]="VIDEO_ENCODE_CONFIGURE_FAIL",i[i.VIDEO_ENCODE_FAIL=3005]="VIDEO_ENCODE_FAIL",i[i.WTP_OPEN_FAIL=3006]="WTP_OPEN_FAIL",i[i.WTP_CONNECT_FAIL=3007]="WTP_CONNECT_FAIL",i[i.WORKER_ERROR=3008]="WORKER_ERROR",i))(y||{});class W extends Error{constructor(t,e,s){super(),this.code=t,this.message=e,s&&(this.ext=s),this.toJson=()=>({code:this.code,message:this.message,ext:this.ext})}}function b(i,t,e){return new W(i,t,e)}class G{constructor(t){this._audioFrameQueue=new M,this.encode=e=>{const s=new Float32Array(e.numberOfFrames);e.copyTo(s,{planeIndex:0,frameOffset:0,frameCount:e.numberOfFrames});const r=this._audioFrameQueue.compose({offset:0,data:{audioData:e,buffer:s}});if(r)try{this._encoder.encode(r)}catch(o){this._core.emit(O.OnError,b(y.AUDIO_ENCODE_FAIL,o.message))}},this._core=t,this._encoder=new j(t)}async init(){try{await this._encoder.init()}catch(t){throw b(y.AUDIO_ENCODER_INIT_FAIL,t.message)}}setConfiguration(t){const e=Object.assign({},this._core.getSetting(),{audioBitrate:t});this._core.updateSetting(e),this._encoder.updateConfigure()}destroy(){this._encoder.destroy()}}const L=new E("RTMP_VEncoder");class J{constructor(t){this._encoder=null,this._queue=[],this._encodeTimer=0,this._loopEncodeTimer=0,this._frameIndex=0,this._gopSize=0,this._encodedFrameCount=0,this._lastFrame=null,this._startTimer=()=>{this._clearEncodeTimer(),this._encodeTimer=setInterval(()=>{const e=this._queue.shift();if(!(!e||!this._encoder||this._encoder.state==="closed"))try{this._encoder.encode(e,{keyFrame:this._frameIndex%this._gopSize===0}),this._frameIndex++,this._lastFrame&&this._lastFrame.close(),this._lastFrame=e}catch(s){L.log("encode frame error",s)}},5)},this._core=t}configurate(t){return this._gopSize=t.gopSize,this._encoder?this.flush().then(()=>this._configure(t)):this._configure(t)}_configure(t){return this._clearEncodeTimer(),L.log("start config encoder",t),VideoEncoder.isConfigSupported(t).then(e=>{if(!e.supported)throw new Error(`VideoEncoder not support config, ${JSON.stringify(t)}`);this._encoder=new VideoEncoder({output:(s,r)=>{const o=new Uint8Array(s.byteLength);s.copyTo(o),this._emitFrame(o,s,r)},error:s=>{this._clearEncodeTimer(),this._core.emit(O.OnError,b(y.VIDEO_ENCODE_FAIL,s.message))}}),this._encoder.configure(t),L.log("encoder configured")}).then(this._startTimer).catch(e=>{throw b(y.VIDEO_ENCODE_CONFIGURE_FAIL,e.message)})}_emitFrame(t,e,s){this._encodedFrameCount++,this._core.emit(l.OnVideoEncoded,{buffer:t,props:{byteLength:e.byteLength,duration:e.duration,timestamp:parseInt(e.timestamp/1e3),originTs:parseInt(e.timestamp/1e3),type:e.type},cfg:s.decoderConfig})}_clearEncodeTimer(){clearInterval(this._encodeTimer)}_clearLoopEncodeTimer(){this._loopEncodeTimer&&clearInterval(this._loopEncodeTimer)}flush(){return this._encoder?this._encoder.flush().then(()=>{var t;this._clearEncodeTimer(),(t=this._encoder)==null||t.close(),this._frameIndex=0,this._encoder=null,L.log("encoder flush & closed")}).catch(t=>{console.log("encoder flush & close error:",t)}):Promise.resolve()}encode(t){this._clearLoopEncodeTimer(),this._queue.push(t)}startLoop(t){if(!this._lastFrame)return;const e=Math.floor(1e3/t*1e3);L.log("start encode last frame looped, ",t,"increment:",e),this._loopEncodeTimer=setInterval(()=>{if(!this._lastFrame)return;const s=new VideoFrame(this._lastFrame,{duration:e,timestamp:(this._lastFrame.timestamp||0)+e});this._queue.push(s)},Math.floor(1e3/t))}destroy(){this._queue.forEach(t=>t.close()),this._lastFrame&&this._lastFrame.close(),this._clearEncodeTimer(),this._clearLoopEncodeTimer(),this.flush()}}const Q=new E("RTMP_VideoEncode");class K{constructor(t){this._core=t,this._encoder=new J(t)}async setConfiguration(t={}){const e=Object.assign({},this._core.getSetting(),t),s={width:e.width,height:e.height,displayWidth:e.width,displayHeight:e.height,bitrate:e.videoBitrate,framerate:Math.floor(e.frameRate),codec:e.codec,gopSize:e.gopSize,hardwareAcceleration:e.hardwareAcceleration};this._core.updateSetting(e),Q.log("set Configuration:",s,t);try{await this._encoder.configurate(s)}catch(r){this._core.emit(O.OnError,r)}}encode(t){this._encoder.encode(t)}startLoopEncodeLastFrame(){this._encoder.startLoop(this._core.getSetting().frameRate)}flushEncoder(){this._encoder.flush()}destroy(){this._encoder.destroy()}}const V=new E("RTMP_AVSync");class Z{constructor(t){this._videoFrameGot=!1,this._videoBaseDts=0,this._audioBaseDts=0,this._videoNextDts=0,this._videoLastDts=0,this._audioNextDts=0,this._lastVideoReceived=0,this._core=t}get avExist(){return this._core.getSetting().hasVideo&&this._core.getSetting().hasAudio}get videoRefDuration(){return parseInt(1e3/this._core.getSetting().frameRate)}get audioRefDuration(){return parseInt(1024/this._core.getSetting().sampleRate*1e3)}addVideoFrame(t){this._videoFrameGot||(this._videoFrameGot=!0);const e=t.props;if(Math.abs(this._videoNextDts-e.timestamp-this._videoBaseDts)>1e3){const r=Date.now()-this._lastVideoReceived;this._videoNextDts=this._videoNextDts===this._audioNextDts?this._videoNextDts+this.videoRefDuration:this._audioNextDts||this._videoNextDts+r,this._videoBaseDts=this._videoNextDts-e.timestamp,V.warn(`video stream timestamp breaked! dts:${this._videoNextDts} -> ${e.timestamp}, videoBaseDts=${this._videoBaseDts}, deltaToLastFrame=${r}`)}e.timestamp=e.timestamp+this._videoBaseDts;const s=e.timestamp-this._videoLastDts;return s>100&&V.warn("video frame large gap",s),this._videoLastDts=this._videoNextDts=e.timestamp,V.long&&V.log(`V frame, dts: ${e.timestamp}, originDts:${e.originTs}, videoBaseDts=${this._videoBaseDts}, type=${e.type}, duration=${s}`),this._lastVideoReceived=Date.now(),this._core.emit(l.OnEncodedFrame,I.Video,t),{size:t.buffer.length,duration:s,key:t.props.type==="key"}}addAudioFrame(t){if(this.avExist&&!this._videoFrameGot)return;const e=t.props;return this._audioBaseDts||(this._audioBaseDts=e.timestamp-this._videoNextDts),Math.abs(e.timestamp-this._audioBaseDts-this._audioNextDts)>1e3&&(this._audioBaseDts=this._audioNextDts+this.audioRefDuration-e.timestamp,V.warn(`audio stream timestamp breaked! dts:${this._audioNextDts} -> ${e.timestamp}, audioBaseDts=${this._audioBaseDts}`)),this._audioNextDts=e.timestamp=e.timestamp-this._audioBaseDts,V.long&&V.log(`A frame, dts: ${e.timestamp}, originDts:${e.originTs}`),this._core.emit(l.OnEncodedFrame,I.Audio,t),{size:t.buffer.length,duration:this.audioRefDuration}}}class X{constructor(){this._videoSize=0,this._videoDuration=0,this._videoBitrate=0,this._frameCount=0,this._fps=0,this._videoEncodedCount=0,this._keyCount=0,this._audioSize=0,this._audioDuration=0,this._audioBitrate=0,this._audioEncodedCount=0}get videoStats(){return{sendBitrate:this._videoBitrate,framesPerSecond:this._fps,framesEncoded:this._videoEncodedCount,keyFramesEncoded:this._keyCount}}get audioStats(){return{sendBitrate:this._audioBitrate,framesEncoded:this._audioEncodedCount}}addVideoSample({size:t,duration:e,key:s}){this._videoEncodedCount++,this._videoSize+=t,this._videoDuration+=e,this._frameCount++,s&&this._keyCount++,this._videoDuration>=1e3&&(this._videoBitrate=Math.floor(this._videoSize/this._videoDuration*8e3),this._fps=this._frameCount,this._frameCount=0,this._videoSize=0,this._videoDuration=0)}addAudioSample({size:t,duration:e}){this._audioEncodedCount++,this._audioSize+=t,this._audioDuration+=e,this._audioDuration>=1e3&&(this._audioBitrate=Math.floor(this._audioSize/this._audioDuration*1e3),this._audioSize=0,this._audioDuration=0)}}const Y=new E("RTMP_EncodeController");class ee{constructor(t){this._analyse=new X,this._gotFrame=!1,this._OnVideoCaptured=(e,s)=>{this._gotFrame=!0,this._videoSettingChanged(s)&&(Y.log("video track setting changed!",s),this._core.updateSetting({width:s.width,height:s.height,frameRate:s.frameRate,vDeviceId:s.deviceId}),this._videoEncode.setConfiguration()),this._videoEncode.encode(e)},this._OnVideoCaptureNoOutput=()=>{this._videoEncode.startLoopEncodeLastFrame()},this._OnAudioCaptured=e=>{this._gotFrame=!0,this._audioEncode.encode(e)},this._OnVideoEncoded=e=>{const s=this._avSync.addVideoFrame(e);this._analyse.addVideoSample(s)},this._OnAudioEncoded=e=>{if(!e.buffer.length)return;const s=this._avSync.addAudioFrame(e);s&&this._analyse.addAudioSample(s)},this._OnUpstreamFeedback=e=>{this._videoEncode.setConfiguration(e)},this._OnBitrateChanged=(e,s)=>{this._gotFrame&&(e===I.Video&&this._videoEncode.setConfiguration({videoBitrate:s}),e===I.Audio&&this._audioEncode.setConfiguration(s))},this._core=t,this._audioEncode=new G(t),this._videoEncode=new K(t),this._avSync=new Z(t),this._bindEvents()}getStats(){return{video:this._analyse.videoStats,audio:this._analyse.audioStats}}init(){return this._audioEncode.init()}_bindEvents(){this._core.on(l.OnVideoCaptured,this._OnVideoCaptured),this._core.on(l.OnAudioCaptured,this._OnAudioCaptured),this._core.on(l.OnVideoCaptureNoOutput,this._OnVideoCaptureNoOutput),this._core.on(l.OnVideoEncoded,this._OnVideoEncoded),this._core.on(l.OnAudioEncoded,this._OnAudioEncoded),this._core.on(l.OnUpstreamFeedback,this._OnUpstreamFeedback),this._core.on(l.OnBitrateChanged,this._OnBitrateChanged)}_videoSettingChanged(t){const e=this._core.getSetting();return t.width!==e.width||t.height!==e.height||Math.floor(t.frameRate)!==Math.floor(e.frameRate)||t.deviceId!==e.vDeviceId}destroy(){this._videoEncode.destroy(),this._audioEncode.destroy()}}var B=(i=>(i[i.AUDIO=8]="AUDIO",i[i.VIDEO=9]="VIDEO",i[i.SCRIPT_DATA=18]="SCRIPT_DATA",i))(B||{});const te=10,ie=1,se=7,oe={96e3:0,48e3:3,44100:4,22050:7,16e3:8,8e3:11};function re(i){const t=(i[4]&3)+1;let e;const s=[],r=[];let o=6;const _=i[5]&31;let c;for(let n=0;n<_;n++){if(c=i[o]<<8|i[o+1],o+=2,!c)continue;const h=i.subarray(o,o+c);o+=c,s.push(h)}const u=i[o];o++;let a;for(let n=0;n<u;n++)a=i[o]<<8|i[o+1],o+=2,a&&(r.push(i.subarray(o,o+a)),o+=a);return{sps:e,spsArr:s,ppsArr:r,nalUnitSize:t}}class ne{constructor(){this._cfg={hasVideo:!1,hasAudio:!1,sampleRate:48e3,channelCount:1},this._hasAudioSeqHeader=!1,this._hasVideoSeqHeader=!1}setConfig(t){this._cfg=Object.assign(this._cfg,t)}genHeader(){const t=[70,76,86,1,(this._cfg.hasAudio?1:0)<<2|(this._cfg.hasVideo?1:0),0,0,0,9,0,0,0,0];return new Uint8Array(t)}genSeqTag(t,e){let s;t===8?(s=this._genAudioTagPaylod(0,e),this._hasAudioSeqHeader=!0):(s=this._genVideoTagPayload(0,e),this._hasVideoSeqHeader=!0);const r=this._genTagHeader(t,s.length,e.props.timestamp),o=r.length+s.length;return S([r,s,new Uint8Array([o>>>24,o>>>16,o>>>8,o])])}genFrameTag(t,e){let s;t===8?s=this._genAudioTagPaylod(1,e):s=this._genVideoTagPayload(1,e);const r=this._genTagHeader(t,s.length,e.props.timestamp),o=r.length+s.length;return S([r,s,new Uint8Array([o>>>24,o>>>16,o>>>8,o])])}_genTagHeader(t,e,s){return new Uint8Array([t,e>>>16,e>>>8,e,s>>>16,s>>>8,s,s>>>24,0,0,0])}_genAudioTagPaylod(t,e){return S(t===0?[this._genAudioTagHeader(),this._genAudioSequenceHeader()]:[this._genAudioTagHeader(),this._genAudioData(e)])}_genAudioTagHeader(){return new Uint8Array([te<<4|12|ie<<1|this._cfg.channelCount-1])}_genAudioSequenceHeader(){const t=4096|oe[this._cfg.sampleRate]<<7|this._cfg.channelCount<<3;return new Uint8Array([0,t>>8,t])}_genAudioData(t){const e=new Uint8Array(1+t.buffer.length);return e.set([1],0),e.set(t.buffer,1),e}_genVideoTagPayload(t,e){return S(t===0?[this._genVideoTagHeader(e),this._genVideoSequenceHeader(e)]:[this._genVideoTagHeader(e),this._genVideoData(e)])}_genVideoTagHeader(t){return new Uint8Array([(t.props.type==="key"?1:2)<<4|se,this._hasVideoSeqHeader?1:0,0,0,0])}_genVideoSequenceHeader(t){return new Uint8Array(t.cfg.description)}_genVideoData(t){if(t.props.type==="delta")return t.buffer;const e=re(new Uint8Array(t.cfg.description)),s=e.spsArr[0].length,r=e.ppsArr[0].length;return S([new Uint8Array([0,0,s>>8,s%256]),e.spsArr[0],new Uint8Array([0,0,r>>8,r%256]),e.ppsArr[0],t.buffer])}}const ae=new E("RTMP_Packet");class de{constructor(t){this._firstFrame=!0,this._flv=new ne,this._OnEncodedFrame=(e,s)=>{if(this._firstFrame){const o=this._core.getSetting();this._flv.setConfig({hasVideo:o.hasVideo,hasAudio:o.hasAudio,sampleRate:o.sampleRate,channelCount:o.channel});const _=this._flv.genHeader();if(this._core.emit(l.OnPacketed,_),o.hasVideo){const c=this._flv.genSeqTag(B.VIDEO,s);this._core.emit(l.OnPacketed,c)}if(o.hasAudio){const c=this._flv.genSeqTag(B.AUDIO,s);this._core.emit(l.OnPacketed,c)}this._firstFrame=!1,ae.log("first frame encoded & packed")}const r=this._flv.genFrameTag(e==="video"?B.VIDEO:B.AUDIO,s);this._core.emit(l.OnPacketed,r,s.props.type==="key")},this._core=t,this._bindEvents()}_bindEvents(){this._core.on(l.OnEncodedFrame,this._OnEncodedFrame)}destroy(){}}class he{constructor(){this._lastDot=0,this._totalSize=0,this._speed=[]}addSample(t){this._lastDot||(this._lastDot=Date.now()),this._totalSize+=t;const e=Date.now()-this._lastDot;e>=500&&(this._addSpeedSample(this._totalSize/e*8e3),this._totalSize=0,this._lastDot=Date.now())}_addSpeedSample(t){this._speed.push(t),this._speed=this._speed.slice(-6)}reset(){this._speed=[]}getUpSpeed(){return this._speed.length?parseInt(this._speed.reduce((t,e)=>t+=e,0)/this._speed.length):0}}const D=new E("RTMP_Wtp");class ce{constructor(t){this._queue=[],this._url="",this._connectClosed=!1,this._upSpeed=new he,this._transport=null,this._writer=null,this._inWriting=!1,this._inAdjustEncode=!1,this._increaseTimer=0,this._firstFramePushed=!1,this._core=t,this._bindEvents()}get sendSpeed(){return this._upSpeed.getUpSpeed()}getStats(){var t;return(t=this._transport)==null?void 0:t.getStats()}_bindEvents(){this._core.on(l.OnPacketed,(t,e=!1)=>{this._checkDecreaseBitrate(),this._checkDeleteCache(e),this._queue.push(t),this._inWriting||this._write()})}_checkDecreaseBitrate(){if(this._inAdjustEncode)return;const t=this._upSpeed.getUpSpeed();if(!t||this._queue.length<A.MaxCachedFrameSize)return;D.log(`up speed: ${t} low, ajust encode setting`);const e=this._core.getSetting();this._core.emit(l.OnUpstreamFeedback,{videoBitrate:t*A.RealSpeedPercent,width:e.width,height:e.height,frameRate:e.frameRate}),this._inAdjustEncode=!0,this._checkIncreaseBitrate()}_checkIncreaseBitrate(){D.log("add timer to check uplink speed increased"),clearInterval(this._increaseTimer),this._increaseTimer=setTimeout(()=>{const t=this._core.getSetting();D.log(`set encode bitrate to specified ${t.videoBitrate}`),this._core.emit(l.OnUpstreamFeedback,{videoBitrate:t.videoBitrate,width:t.width,height:t.height,frameRate:t.frameRate}),this._inAdjustEncode=!0},A.UplinkBitrateCheckInterval)}_checkDeleteCache(t){this._inAdjustEncode&&t&&(D.log(`ajust encode setting finish, delete cached ${this._queue.length} frame`),this._queue=[],this._upSpeed.reset(),this._inAdjustEncode=!1)}async start(t){this._url=t;try{await this._connect()}catch(e){throw b(y.WTP_OPEN_FAIL,e.message)}}async _connect(){const t=new WebTransport(this._url);let e;t.closed.then(()=>{D.log("webtransport closed")}).catch(r=>{e=r.message,D.log("webtransport closed due to",r)}).finally(()=>{this._connectClosed=!0,this._core.emit(O.OnConnectClosed,e),this._core.emit(O.OnError,b(y.WTP_CONNECT_FAIL,e))}),await t.ready,this._transport=t;const s=await t.createBidirectionalStream();this._writer=s.writable.getWriter(),this._write(),D.log("transport opend")}async _write(){var e;if(!this._writer)return;this._inWriting=!0;const t=this._queue.shift();if(!t){this._inWriting=!1;return}await((e=this._writer)==null?void 0:e.write(t)),this._firstFramePushed||(this._firstFramePushed=!0,this._core.emit(O.OnFirstFramePushed),D.log("first frame pushed")),this._upSpeed.addSample(t.length);try{await this._write()}catch(s){D.log("writer error:",s)}}getFile(){return S(this._queue)}destroy(){var t,e;clearTimeout(this._increaseTimer),this._connectClosed||(t=this._writer)==null||t.close(),this._writer=null,(e=this._transport)==null||e.close(),this._transport=null}}const ue=new E("LiveRTMP");class _e extends H{constructor(){super(),this._ts=0,this._setting={codec:A.codec,hardwareAcceleration:"prefer-hardware",width:-1,height:-1,frameRate:-1,sampleRate:A.sampleRate,channel:A.channel,gopSize:A.gopSize,videoBitrate:A.VideoBitrateDefault,audioBitrate:A.AudioBitrateDefault,hasAudio:!1,hasVideo:!1,vDeviceId:"",aDeviceId:""},this._encode=new ee(this),this._packet=new de(this),this._transport=new ce(this)}async checkVideoHardwareAcceleration(){const t=["prefer-hardware","prefer-software","no-preference"],e=this.getSetting(),s={codec:e.codec,width:1280,height:720,framerate:15,bitrate:e.videoBitrate};for(const r of t)try{if((await VideoEncoder.isConfigSupported({...s,hardwareAcceleration:r})).supported)return this.updateSetting({hardwareAcceleration:r}),Promise.resolve()}catch{throw b(y.VIDEO_ENCODE_CONFIGURE_FAIL,`VideoEncoder not support hardwareAcceleration, ${JSON.stringify({...s,hardwareAcceleration:r})}`)}throw b(y.VIDEO_ENCODE_CONFIGURE_FAIL,"VideoEncoder not support hardwareAcceleration")}async ready(){await Promise.all([this.checkVideoHardwareAcceleration(),this._encode.init()])}getSetting(){return this._setting}updateSetting(t){this._setting=Object.assign({},this._setting,t)}videoFrameCaptured(t,e){this.emit(l.OnVideoCaptured,t,e)}audioFrameCaptured(t,e){this.emit(l.OnAudioCaptured,t,e)}startMockVideoEncode(){this.emit(l.OnVideoCaptureNoOutput)}adjustBitrate(t,e){t===I.Video&&this.updateSetting({videoBitrate:e}),t===I.Audio&&this.updateSetting({audioBitrate:e}),this.emit(l.OnBitrateChanged,t,e)}avExist(t,e){this._setting.hasVideo=t,this._setting.hasAudio=e}publish(t){return this._transport.start(t)}setEncodeCapacity(t){this._setting=Object.assign({},this._setting,t)}getStats(){return{video:{...this._encode.getStats().video,sendSpeed:this._transport.sendSpeed,codec:this._setting.codec,frameWidth:this._setting.width,frameHeight:this._setting.height,gopSize:this._setting.gopSize},audio:{...this._encode.getStats().audio,codec:"aac",channels:this._setting.channel,sampleRate:this._setting.sampleRate}}}destroy(){ue.log("destroy"),this._encode.destroy(),this._packet.destroy(),this._transport.destroy()}down(){return this._transport.getFile()}}self.constructor.name!=="Window"&&le();function le(){let i={};self.addEventListener("message",async t=>{switch(t.data.type){case v.Init:{const{options:e}=t.data;e.logEnable&&(E.enable=!0),e.logEnableLong&&(E.enableLong=!0),i=new _e,i.on(O.OnError,s=>{self.postMessage({type:w.Error,data:s.toJson()})}),i.on(O.OnConnectClosed,()=>{self.postMessage({type:w.Close})}),i.on(O.OnFirstFramePushed,()=>{self.postMessage({type:w.FirstFramePushed})});try{await i.ready(),self.postMessage({type:w.Ready})}catch(s){self.postMessage({type:w.Error,data:s.toJson()})}}break;case v.AvExist:{const{hasAudio:e,hasVideo:s}=t.data;i.avExist(s,e)}break;case v.VideoFrame:{const{frame:e,setting:s}=t.data;i.videoFrameCaptured(e,s)}break;case v.MockVideoEncode:i.startMockVideoEncode();break;case v.AudioFrame:{const{frame:e,setting:s}=t.data;i.audioFrameCaptured(e,s)}break;case v.AdjustBitrate:{const{kind:e,bitrate:s}=t.data;i.adjustBitrate(e,s)}break;case v.Publish:{const{url:e}=t.data;try{await i.publish(e)}catch(s){self.postMessage({type:w.Error,data:s.toJson()})}}break;case v.GetStats:self.postMessage({type:w.STATS,data:i.getStats()});break;case v.EncodeConfig:{i.setEncodeCapacity(t.data.cfg);break}case v.Download:{const e=i.down();self.postMessage({type:w.Flvfile,buffer:e},[e.buffer])}break;case v.UnPublish:{i.destroy();break}}})}})();\n', ho = typeof self < "u" && self.Blob && new Blob([Va], { type: "text/javascript;charset=utf-8" });
10066
+ function M_(r) {
10048
10067
  let e;
10049
10068
  try {
10050
10069
  if (e = ho && (self.URL || self.webkitURL).createObjectURL(ho), !e) throw "";
@@ -10056,7 +10075,7 @@ function P_(r) {
10056
10075
  }), t;
10057
10076
  } catch {
10058
10077
  return new Worker(
10059
- "data:text/javascript;charset=utf-8," + encodeURIComponent(Ba),
10078
+ "data:text/javascript;charset=utf-8," + encodeURIComponent(Va),
10060
10079
  {
10061
10080
  name: r == null ? void 0 : r.name
10062
10081
  }
@@ -10070,10 +10089,10 @@ try {
10070
10089
  } catch {
10071
10090
  }
10072
10091
  const Cr = new Ze("Bridge");
10073
- class Va extends D_ {
10092
+ class Fa extends I_ {
10074
10093
  // static version = __VERSION__
10075
10094
  constructor() {
10076
- super(), this._worker = null, this._audioMsTrack = null, this._videoMsTrack = null, this._capture = new x_(this);
10095
+ super(), this._worker = null, this._audioMsTrack = null, this._videoMsTrack = null, this._capture = new O_(this);
10077
10096
  }
10078
10097
  static isSupported() {
10079
10098
  return typeof WebTransport < "u" && typeof MediaStreamTrackProcessor < "u" && typeof MediaStreamTrackGenerator < "u" && typeof VideoEncoder < "u";
@@ -10100,7 +10119,7 @@ class Va extends D_ {
10100
10119
  }
10101
10120
  };
10102
10121
  try {
10103
- this._worker = new P_();
10122
+ this._worker = new M_();
10104
10123
  } catch (o) {
10105
10124
  t(uo(Vr.RTMP_INIT_FAIL, o.message));
10106
10125
  }
@@ -10125,7 +10144,7 @@ class Va extends D_ {
10125
10144
  Cr.table(i.data.data), this.emit(je.OnError, i.data.data);
10126
10145
  break;
10127
10146
  case Qe.Flvfile:
10128
- I_(i.data.buffer);
10147
+ L_(i.data.buffer);
10129
10148
  break;
10130
10149
  case Qe.FirstFramePushed:
10131
10150
  this.emit(je.OnFirstFramePushed);
@@ -10243,14 +10262,14 @@ class Va extends D_ {
10243
10262
  });
10244
10263
  }
10245
10264
  }
10246
- function I_(r) {
10265
+ function L_(r) {
10247
10266
  const e = document.createElement("a");
10248
10267
  e.href = URL.createObjectURL(new Blob([r])), e.download = Date.now() + ".flv", e.click();
10249
10268
  }
10250
10269
  const lo = new Ye("RTMPConnect");
10251
- class O_ {
10270
+ class U_ {
10252
10271
  constructor(e, t, i, n) {
10253
- this._opts = void 0, this._isPushing = !1, this._url = e, this._opts = t, this._onError = i, this._OnSuccess = n, this._rtmp = new Va(), this._bindEvents();
10272
+ this._opts = void 0, this._isPushing = !1, this._url = e, this._opts = t, this._onError = i, this._OnSuccess = n, this._rtmp = new Fa(), this._bindEvents();
10254
10273
  }
10255
10274
  get isPushing() {
10256
10275
  return this._isPushing;
@@ -10266,7 +10285,7 @@ class O_ {
10266
10285
  this._isPushing = !1, this._onError(e);
10267
10286
  }), this._rtmp.on(je.OnConnectClosed, () => {
10268
10287
  this._isPushing = !1, this._onError(
10269
- new Ga(Vr.WTP_CONNECT_FAIL, "connect lost")
10288
+ new Ba(Vr.WTP_CONNECT_FAIL, "connect lost")
10270
10289
  );
10271
10290
  }), this._rtmp.on(je.OnFirstFramePushed, () => {
10272
10291
  this._isPushing = !0, this._OnSuccess();
@@ -10294,7 +10313,7 @@ class O_ {
10294
10313
  lo.warn("unpublish"), this._rtmp.unpublish(), this._isPushing = !1;
10295
10314
  }
10296
10315
  }
10297
- function Fa({
10316
+ function ja({
10298
10317
  pushUrl: r,
10299
10318
  addPri: e = !1,
10300
10319
  disableTCC: t = !1
@@ -10302,8 +10321,8 @@ function Fa({
10302
10321
  const i = new URL(r), n = Date.now();
10303
10322
  return e && i.searchParams.set("pri", n.toString()), t && i.searchParams.set("tcc", "false"), i.href;
10304
10323
  }
10305
- class M_ {
10306
- constructor(e, t = Kp) {
10324
+ class N_ {
10325
+ constructor(e, t = Wp) {
10307
10326
  this._reconnectDelay = 0, this._reconnectCount = 0, this._timeoutTimerId = null, this._reconnectTimeout = null, this._totalReconnectInfo = {
10308
10327
  totalReconnectCount: 0,
10309
10328
  totalReconnectDuration: 0
@@ -10311,7 +10330,7 @@ class M_ {
10311
10330
  this.execute(!0);
10312
10331
  }, this.execute = (i = !1) => {
10313
10332
  var n;
10314
- this._logger.log("start reconnect strategy"), this.state === "idle" && (this._reconnectStartTime = Date.now(), this._totalReconnectInfo.totalReconnectCount += 1, D(x.PUSH_RECONNECT_START, {
10333
+ this._logger.log("start reconnect strategy"), this.state === "idle" && (this._reconnectStartTime = Date.now(), this._totalReconnectInfo.totalReconnectCount += 1, x(D.PUSH_RECONNECT_START, {
10315
10334
  start_time: this._reconnectStartTime,
10316
10335
  session_id: this._pushConsumer.pushSessionId,
10317
10336
  max_timeout: this._maxTimeout
@@ -10388,13 +10407,13 @@ class M_ {
10388
10407
  }), this._logger.log("reconnect after delay: ", n, Date.now()), this._reconnectTimeout = window.setTimeout(
10389
10408
  this.attemptReconnect,
10390
10409
  n
10391
- ), this._reconnectDelay = this._reconnectDelay === 0 ? 2e3 : Math.min(this._reconnectDelay * 2, Wp);
10410
+ ), this._reconnectDelay = this._reconnectDelay === 0 ? 2e3 : Math.min(this._reconnectDelay * 2, Jp);
10392
10411
  }, this.state = "idle", this._pushConsumer = e, this._maxTimeout = t, this._logger = new Ye("ReconnectStrategy");
10393
10412
  }
10394
10413
  // 恢复推流保持pri自增,能够实现抢流功能,避免上次推流服务端状态还未断开
10395
10414
  getNextPushUrl() {
10396
10415
  const e = this._pushConsumer.pushUrl;
10397
- return e ? Fa({
10416
+ return e ? ja({
10398
10417
  pushUrl: e,
10399
10418
  addPri: !0
10400
10419
  }) : "";
@@ -10481,7 +10500,7 @@ const Gt = {
10481
10500
  /** 推流异常 */
10482
10501
  PushError: 1
10483
10502
  }, po = new Ye("PushController");
10484
- class L_ extends Ua {
10503
+ class G_ extends Na {
10485
10504
  constructor(e, {
10486
10505
  config: t,
10487
10506
  streamConsumeController: i,
@@ -10494,7 +10513,7 @@ class L_ extends Ua {
10494
10513
  retryDelay: 1e3
10495
10514
  }, this._audioBitrate = Tt(Oo, "audio").bitrate, this._videoBitrate = Tt(Io, "video").bitrate, this.handleReconnectError = (o, d) => {
10496
10515
  var c, u;
10497
- D(x.STOP_PUSH_STREAM, {
10516
+ x(D.STOP_PUSH_STREAM, {
10498
10517
  reason: Gt.ReconnectFailed,
10499
10518
  error_message: o,
10500
10519
  session_id: this._pushSessionId,
@@ -10521,14 +10540,14 @@ class L_ extends Ua {
10521
10540
  this._streamConsumeController.emit(
10522
10541
  J.PushError,
10523
10542
  d
10524
- ), D(x.STOP_PUSH_STREAM, {
10543
+ ), x(D.STOP_PUSH_STREAM, {
10525
10544
  reason: Gt.PushError,
10526
10545
  duration: this.pushDuration,
10527
10546
  session_id: this._pushSessionId,
10528
10547
  push_mode: this._pushMode,
10529
10548
  error_msg: o.message,
10530
10549
  error_code: o.code
10531
- }), D(x.START_PUSH_STATUS, {
10550
+ }), x(D.START_PUSH_STATUS, {
10532
10551
  is_success: !1,
10533
10552
  reason: gt.PushError,
10534
10553
  error_message: o.message,
@@ -10541,7 +10560,7 @@ class L_ extends Ua {
10541
10560
  (o = this._reconnectStrategy) == null || o.execute(), this.setConnectState(pe.RECONNECTING), this.unpublish({ isReconnecting: !0 });
10542
10561
  }, this._OnRtcStateChange = (o) => {
10543
10562
  var d;
10544
- switch (D(x.PUSH_RTC_STATE_CHANGE, {
10563
+ switch (x(D.PUSH_RTC_STATE_CHANGE, {
10545
10564
  state: o,
10546
10565
  push_url: this._pushUrl,
10547
10566
  session_id: this._pushSessionId,
@@ -10558,13 +10577,13 @@ class L_ extends Ua {
10558
10577
  this._reconnectStrategy && this._executeReconnect();
10559
10578
  break;
10560
10579
  case "failed":
10561
- (d = this._reconnectStrategy) != null && d.isActive() ? this._executeReconnect() : (this.connectionState === pe.CONNECTED ? D(x.STOP_PUSH_STREAM, {
10580
+ (d = this._reconnectStrategy) != null && d.isActive() ? this._executeReconnect() : (this.connectionState === pe.CONNECTED ? x(D.STOP_PUSH_STREAM, {
10562
10581
  reason: Gt.PushError,
10563
10582
  error_message: "peerconnection failed",
10564
10583
  duration: this.pushDuration,
10565
10584
  session_id: this._pushSessionId,
10566
10585
  push_mode: this._pushMode
10567
- }) : D(x.START_PUSH_STATUS, {
10586
+ }) : x(D.START_PUSH_STATUS, {
10568
10587
  is_success: !1,
10569
10588
  reason: gt.PushError,
10570
10589
  error_message: "peerconnection failed",
@@ -10582,7 +10601,7 @@ class L_ extends Ua {
10582
10601
  }
10583
10602
  }, this._pushMode = (t == null ? void 0 : t.mode) || "rtm", this._streamConsumeController = i, t && (this._pushConfig = t, this._needCheckAudioTrack = t.checkAudio ?? !1), (s = t == null ? void 0 : t.reconnectConfig) != null && s.enable || !(t != null && t.reconnectConfig)) {
10584
10603
  const o = (a = t == null ? void 0 : t.reconnectConfig) != null && a.maxTimeout ? t.reconnectConfig.maxTimeout * pa : void 0;
10585
- this._reconnectStrategy = new M_(
10604
+ this._reconnectStrategy = new N_(
10586
10605
  this,
10587
10606
  o
10588
10607
  ), this._reconnectStrategy.onReconnectError = this.handleReconnectError;
@@ -10620,7 +10639,7 @@ class L_ extends Ua {
10620
10639
  case pe.CONNECTED:
10621
10640
  (t = this._reconnectStrategy) != null && t.isActive() ? this._reconnectStrategy.stop({ isSuccess: !0 }) : (this._streamConsumeController.emit(
10622
10641
  J.PushStart
10623
- ), this.setPushStatsInterval(), D(x.START_PUSH_STATUS, {
10642
+ ), this.setPushStatsInterval(), x(D.START_PUSH_STATUS, {
10624
10643
  is_success: !0,
10625
10644
  push_url: this._pushUrl,
10626
10645
  session_id: this._pushSessionId,
@@ -10634,21 +10653,21 @@ class L_ extends Ua {
10634
10653
  }
10635
10654
  async startPush(e, t = {}) {
10636
10655
  var a, o, d;
10637
- if (t.isReconnect || (this._pushSessionId = Date.now(), D(x.START_PUSH, {
10656
+ if (t.isReconnect || (this._pushSessionId = Date.now(), x(D.START_PUSH, {
10638
10657
  push_url: e,
10639
10658
  session_id: this._pushSessionId
10640
10659
  })), !e)
10641
- throw D(x.START_PUSH_STATUS, {
10660
+ throw x(D.START_PUSH_STATUS, {
10642
10661
  is_success: !1,
10643
10662
  session_id: this._pushSessionId,
10644
10663
  reason: gt.PushCheck,
10645
10664
  push_url: this._pushUrl
10646
10665
  }), new Error("lack publish url");
10647
10666
  if (this._connect) return;
10648
- this.start(), this._pushUrl = Fa({ pushUrl: e, disableTCC: !0 }), this._pushEncodeConfig = t.cfg;
10667
+ this.start(), this._pushUrl = ja({ pushUrl: e, disableTCC: !0 }), this._pushEncodeConfig = t.cfg;
10649
10668
  const i = this._composedStream.videoTrack, n = this._composedStream.audioTrack;
10650
10669
  if (this._needCheckAudioTrack && (!i || !n)) {
10651
- D(x.START_PUSH_STATUS, {
10670
+ x(D.START_PUSH_STATUS, {
10652
10671
  is_success: !1,
10653
10672
  reason: gt.PushCheck,
10654
10673
  push_url: this._pushUrl,
@@ -10668,7 +10687,7 @@ class L_ extends Ua {
10668
10687
  );
10669
10688
  return;
10670
10689
  } else if (!i && !n) {
10671
- D(x.START_PUSH_STATUS, {
10690
+ x(D.START_PUSH_STATUS, {
10672
10691
  is_success: !1,
10673
10692
  reason: gt.PushCheck,
10674
10693
  push_url: this._pushUrl,
@@ -10679,11 +10698,11 @@ class L_ extends Ua {
10679
10698
  return;
10680
10699
  }
10681
10700
  let s;
10682
- this._pushMode === "rtm" ? s = new k_(
10701
+ this._pushMode === "rtm" ? s = new D_(
10683
10702
  this._pushUrl,
10684
10703
  this._pushConfig,
10685
10704
  this._OnRtcStateChange
10686
- ) : s = new O_(
10705
+ ) : s = new U_(
10687
10706
  e,
10688
10707
  this._pushConfig,
10689
10708
  this._OnRTMPError,
@@ -10706,14 +10725,14 @@ class L_ extends Ua {
10706
10725
  this._streamConsumeController.emit(
10707
10726
  J.PushError,
10708
10727
  u
10709
- ), D(x.STOP_PUSH_STREAM, {
10728
+ ), x(D.STOP_PUSH_STREAM, {
10710
10729
  reason: Gt.PushError,
10711
10730
  error_message: u.message,
10712
10731
  enable_reconnect: !1,
10713
10732
  push_mode: this._pushMode,
10714
10733
  session_id: this._pushSessionId,
10715
10734
  duration: this.pushDuration
10716
- }), D(x.START_PUSH_STATUS, {
10735
+ }), x(D.START_PUSH_STATUS, {
10717
10736
  is_success: !1,
10718
10737
  push_url: this._pushUrl,
10719
10738
  reason: gt.PushError,
@@ -10731,17 +10750,17 @@ class L_ extends Ua {
10731
10750
  var t, i, n, s;
10732
10751
  if ((t = this._connect) != null && t.isPushing) {
10733
10752
  const a = Date.now(), { stats: o, originStats: d } = await this._connect.getStatsSnapshoot(2e3), u = Date.now() - a;
10734
- Up(o) ? this._prevStats = void 0 : this._prevStats = o;
10735
- const l = this.pushMode === "rtm" ? b_(
10753
+ Np(o) ? this._prevStats = void 0 : this._prevStats = o;
10754
+ const l = this.pushMode === "rtm" ? C_(
10736
10755
  o,
10737
10756
  d,
10738
10757
  {
10739
10758
  idealFrameRate: (i = this._composedStream._videoStream) == null ? void 0 : i.frameRate,
10740
10759
  idealBitrate: this._videoBitrate
10741
10760
  }
10742
- ) : S_(o), h = this.pushMode === "rtm" ? (n = this._connect) == null ? void 0 : n.videoSenderTrackStats : {};
10743
- D(
10744
- x.PUSH_STATS,
10761
+ ) : w_(o), h = this.pushMode === "rtm" ? (n = this._connect) == null ? void 0 : n.videoSenderTrackStats : {};
10762
+ x(
10763
+ D.PUSH_STATS,
10745
10764
  {
10746
10765
  ...l,
10747
10766
  ...h,
@@ -10757,8 +10776,8 @@ class L_ extends Ua {
10757
10776
  !0
10758
10777
  );
10759
10778
  } else
10760
- await ri(2e3), D(
10761
- x.PUSH_STATS,
10779
+ await ri(2e3), x(
10780
+ D.PUSH_STATS,
10762
10781
  {
10763
10782
  push_url: this._pushUrl,
10764
10783
  push_mode: this._pushMode,
@@ -10811,7 +10830,7 @@ class L_ extends Ua {
10811
10830
  isManual: !1
10812
10831
  }) {
10813
10832
  var t, i, n, s, a;
10814
- (t = this._connect) == null || t.unpublish(), this._connect = null, e.isManual && (D(x.STOP_PUSH_STREAM, {
10833
+ (t = this._connect) == null || t.unpublish(), this._connect = null, e.isManual && (x(D.STOP_PUSH_STREAM, {
10815
10834
  reason: Gt.ManualStop,
10816
10835
  duration: this.pushDuration,
10817
10836
  session_id: this._streamConsumeController.pushSessionId,
@@ -10858,7 +10877,7 @@ class L_ extends Ua {
10858
10877
  params: t,
10859
10878
  teaParams: i
10860
10879
  }) {
10861
- D(x.PUSH_RECONNECT_STATUS, {
10880
+ x(D.PUSH_RECONNECT_STATUS, {
10862
10881
  status: e,
10863
10882
  ...t,
10864
10883
  ...i
@@ -10869,14 +10888,14 @@ class L_ extends Ua {
10869
10888
  );
10870
10889
  }
10871
10890
  }
10872
- class U_ extends Xe {
10891
+ class B_ extends Xe {
10873
10892
  constructor(e, t) {
10874
- super(), this._previewConsumer = new h_(
10893
+ super(), this._previewConsumer = new f_(
10875
10894
  e.getComposedStream(),
10876
10895
  {
10877
10896
  streamConsumeController: this
10878
10897
  }
10879
- ), this._pushConsumer = new L_(
10898
+ ), this._pushConsumer = new G_(
10880
10899
  e.getComposedStream(),
10881
10900
  {
10882
10901
  streamConsumeController: this,
@@ -10940,13 +10959,13 @@ class U_ extends Xe {
10940
10959
  await this._pushConsumer.destroy(), this._previewConsumer.destroy();
10941
10960
  }
10942
10961
  }
10943
- const N_ = () => typeof window > "u", ze = {}, Fr = async (r) => {
10962
+ const V_ = () => typeof window > "u", ze = {}, Fr = async (r) => {
10944
10963
  const e = new RTCPeerConnection({ sdpSemantics: "unified-plan" });
10945
10964
  e.addTransceiver("video", { direction: r });
10946
10965
  const t = await e.createOffer();
10947
10966
  return e.close(), t.sdp.toLowerCase();
10948
10967
  };
10949
- function ja(r) {
10968
+ function Ha(r) {
10950
10969
  const e = r.split(`
10951
10970
  `);
10952
10971
  let t = !1;
@@ -10979,30 +10998,30 @@ function ja(r) {
10979
10998
  }
10980
10999
  return !1;
10981
11000
  }
10982
- const G_ = async () => {
11001
+ const F_ = async () => {
10983
11002
  let r = await Fr("sendonly");
10984
- return navigator.userAgent.includes("VivoBrowser") && (r = await Fr("sendonly")), ze.h264encode = ja(r), ze.vp8encode = r.indexOf("vp8") > -1, ze;
10985
- }, B_ = async () => {
11003
+ return navigator.userAgent.includes("VivoBrowser") && (r = await Fr("sendonly")), ze.h264encode = Ha(r), ze.vp8encode = r.indexOf("vp8") > -1, ze;
11004
+ }, j_ = async () => {
10986
11005
  let r = await Fr("recvonly");
10987
- return navigator.userAgent.includes("VivoBrowser") && (r = await Fr("recvonly")), ze.h264decode = ja(r), ze.vp8decode = r.indexOf("vp8") > -1, ze;
10988
- }, V_ = async () => {
11006
+ return navigator.userAgent.includes("VivoBrowser") && (r = await Fr("recvonly")), ze.h264decode = Ha(r), ze.vp8decode = r.indexOf("vp8") > -1, ze;
11007
+ }, H_ = async () => {
10989
11008
  if (typeof ze.h264encode > "u")
10990
11009
  try {
10991
- await G_();
11010
+ await F_();
10992
11011
  } catch {
10993
11012
  return !1;
10994
11013
  }
10995
11014
  return ze.h264encode || !1;
10996
- }, F_ = async () => {
11015
+ }, $_ = async () => {
10997
11016
  if (typeof ze.h264decode > "u")
10998
11017
  try {
10999
- await B_();
11018
+ await j_();
11000
11019
  } catch {
11001
11020
  return !1;
11002
11021
  }
11003
11022
  return ze.h264decode || !1;
11004
11023
  };
11005
- class j_ {
11024
+ class q_ {
11006
11025
  /** {zh}
11007
11026
  * @brief 构造函数
11008
11027
  * @hidden
@@ -11028,8 +11047,8 @@ class j_ {
11028
11047
  };
11029
11048
  }
11030
11049
  }
11031
- const H_ = new j_();
11032
- let Ha = !0, $a = !0;
11050
+ const K_ = new q_();
11051
+ let $a = !0, qa = !0;
11033
11052
  function zr(r, e, t) {
11034
11053
  const i = r.match(e);
11035
11054
  return i && i.length >= t && parseInt(i[t], 10);
@@ -11078,23 +11097,23 @@ function dt(r, e, t) {
11078
11097
  configurable: !0
11079
11098
  });
11080
11099
  }
11081
- function $_(r) {
11082
- return typeof r != "boolean" ? new Error("Argument type: " + typeof r + ". Please use a boolean.") : (Ha = r, r ? "adapter.js logging disabled" : "adapter.js logging enabled");
11100
+ function W_(r) {
11101
+ return typeof r != "boolean" ? new Error("Argument type: " + typeof r + ". Please use a boolean.") : ($a = r, r ? "adapter.js logging disabled" : "adapter.js logging enabled");
11083
11102
  }
11084
- function q_(r) {
11085
- return typeof r != "boolean" ? new Error("Argument type: " + typeof r + ". Please use a boolean.") : ($a = !r, "adapter.js deprecation warnings " + (r ? "disabled" : "enabled"));
11103
+ function J_(r) {
11104
+ return typeof r != "boolean" ? new Error("Argument type: " + typeof r + ". Please use a boolean.") : (qa = !r, "adapter.js deprecation warnings " + (r ? "disabled" : "enabled"));
11086
11105
  }
11087
- function qa() {
11106
+ function Ka() {
11088
11107
  if (typeof window == "object") {
11089
- if (Ha)
11108
+ if ($a)
11090
11109
  return;
11091
11110
  typeof console < "u" && typeof console.log == "function" && console.log.apply(console, arguments);
11092
11111
  }
11093
11112
  }
11094
11113
  function xn(r, e) {
11095
- $a && console.warn(r + " is deprecated, please use " + e + " instead.");
11114
+ qa && console.warn(r + " is deprecated, please use " + e + " instead.");
11096
11115
  }
11097
- function K_(r) {
11116
+ function Z_(r) {
11098
11117
  const e = { browser: null, version: null };
11099
11118
  if (typeof r > "u" || !r.navigator || !r.navigator.userAgent)
11100
11119
  return e.browser = "Not a browser.", e;
@@ -11129,9 +11148,9 @@ function K_(r) {
11129
11148
  function fo(r) {
11130
11149
  return Object.prototype.toString.call(r) === "[object Object]";
11131
11150
  }
11132
- function Ka(r) {
11151
+ function Wa(r) {
11133
11152
  return fo(r) ? Object.keys(r).reduce(function(e, t) {
11134
- const i = fo(r[t]), n = i ? Ka(r[t]) : r[t], s = i && !Object.keys(n).length;
11153
+ const i = fo(r[t]), n = i ? Wa(r[t]) : r[t], s = i && !Object.keys(n).length;
11135
11154
  return n === void 0 || s ? e : Object.assign(e, { [t]: n });
11136
11155
  }, {}) : r;
11137
11156
  }
@@ -11155,8 +11174,8 @@ function mo(r, e, t) {
11155
11174
  });
11156
11175
  }), n;
11157
11176
  }
11158
- const _o = qa;
11159
- function Wa(r, e) {
11177
+ const _o = Ka;
11178
+ function Ja(r, e) {
11160
11179
  const t = r && r.navigator;
11161
11180
  if (!t.mediaDevices)
11162
11181
  return;
@@ -11248,10 +11267,10 @@ function Wa(r, e) {
11248
11267
  };
11249
11268
  }
11250
11269
  }
11251
- function Ja(r) {
11270
+ function Za(r) {
11252
11271
  r.MediaStream = r.MediaStream || r.webkitMediaStream;
11253
11272
  }
11254
- function Za(r) {
11273
+ function Xa(r) {
11255
11274
  if (typeof r == "object" && r.RTCPeerConnection && !("ontrack" in r.RTCPeerConnection.prototype)) {
11256
11275
  Object.defineProperty(r.RTCPeerConnection.prototype, "ontrack", {
11257
11276
  get() {
@@ -11286,7 +11305,7 @@ function Za(r) {
11286
11305
  { value: { receiver: e.receiver } }
11287
11306
  ), e));
11288
11307
  }
11289
- function Xa(r) {
11308
+ function Ya(r) {
11290
11309
  if (typeof r == "object" && r.RTCPeerConnection && !("getSenders" in r.RTCPeerConnection.prototype) && "createDTMFSender" in r.RTCPeerConnection.prototype) {
11291
11310
  const e = function(n, s) {
11292
11311
  return {
@@ -11338,7 +11357,7 @@ function Xa(r) {
11338
11357
  });
11339
11358
  }
11340
11359
  }
11341
- function Ya(r) {
11360
+ function Qa(r) {
11342
11361
  if (!(typeof r == "object" && r.RTCPeerConnection && r.RTCRtpSender && r.RTCRtpReceiver))
11343
11362
  return;
11344
11363
  if (!("getStats" in r.RTCRtpSender.prototype)) {
@@ -11392,7 +11411,7 @@ function Ya(r) {
11392
11411
  return e.apply(this, arguments);
11393
11412
  };
11394
11413
  }
11395
- function Qa(r) {
11414
+ function ec(r) {
11396
11415
  r.RTCPeerConnection.prototype.getLocalStreams = function() {
11397
11416
  return this._shimmedLocalStreams = this._shimmedLocalStreams || {}, Object.keys(this._shimmedLocalStreams).map((a) => this._shimmedLocalStreams[a][0]);
11398
11417
  };
@@ -11430,11 +11449,11 @@ function Qa(r) {
11430
11449
  }), n.apply(this, arguments);
11431
11450
  };
11432
11451
  }
11433
- function ec(r, e) {
11452
+ function tc(r, e) {
11434
11453
  if (!r.RTCPeerConnection)
11435
11454
  return;
11436
11455
  if (r.RTCPeerConnection.prototype.addTrack && e.version >= 65)
11437
- return Qa(r);
11456
+ return ec(r);
11438
11457
  const t = r.RTCPeerConnection.prototype.getLocalStreams;
11439
11458
  r.RTCPeerConnection.prototype.getLocalStreams = function() {
11440
11459
  const u = t.apply(this);
@@ -11573,7 +11592,7 @@ function sn(r, e) {
11573
11592
  r.RTCPeerConnection.prototype[t] = n[t];
11574
11593
  });
11575
11594
  }
11576
- function tc(r, e) {
11595
+ function rc(r, e) {
11577
11596
  dt(r, "negotiationneeded", (t) => {
11578
11597
  const i = t.target;
11579
11598
  if (!((e.version < 72 || i.getConfiguration && i.getConfiguration().sdpSemantics === "plan-b") && i.signalingState !== "stable"))
@@ -11582,17 +11601,17 @@ function tc(r, e) {
11582
11601
  }
11583
11602
  const go = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11584
11603
  __proto__: null,
11585
- fixNegotiationNeeded: tc,
11586
- shimAddTrackRemoveTrack: ec,
11587
- shimAddTrackRemoveTrackWithNative: Qa,
11588
- shimGetSendersWithDtmf: Xa,
11589
- shimGetUserMedia: Wa,
11590
- shimMediaStream: Ja,
11591
- shimOnTrack: Za,
11604
+ fixNegotiationNeeded: rc,
11605
+ shimAddTrackRemoveTrack: tc,
11606
+ shimAddTrackRemoveTrackWithNative: ec,
11607
+ shimGetSendersWithDtmf: Ya,
11608
+ shimGetUserMedia: Ja,
11609
+ shimMediaStream: Za,
11610
+ shimOnTrack: Xa,
11592
11611
  shimPeerConnection: sn,
11593
- shimSenderReceiverGetStats: Ya
11612
+ shimSenderReceiverGetStats: Qa
11594
11613
  }, Symbol.toStringTag, { value: "Module" }));
11595
- function rc(r, e) {
11614
+ function ic(r, e) {
11596
11615
  const t = r && r.navigator, i = r && r.MediaStreamTrack;
11597
11616
  if (t.getUserMedia = function(n, s, a) {
11598
11617
  xn(
@@ -11620,7 +11639,7 @@ function rc(r, e) {
11620
11639
  }
11621
11640
  }
11622
11641
  }
11623
- function W_(r, e) {
11642
+ function X_(r, e) {
11624
11643
  r.navigator.mediaDevices && "getDisplayMedia" in r.navigator.mediaDevices || r.navigator.mediaDevices && (r.navigator.mediaDevices.getDisplayMedia = function(i) {
11625
11644
  if (!(i && i.video)) {
11626
11645
  const n = new DOMException("getDisplayMedia without video constraints is undefined");
@@ -11629,7 +11648,7 @@ function W_(r, e) {
11629
11648
  return i.video === !0 ? i.video = { mediaSource: e } : i.video.mediaSource = e, r.navigator.mediaDevices.getUserMedia(i);
11630
11649
  });
11631
11650
  }
11632
- function ic(r) {
11651
+ function nc(r) {
11633
11652
  typeof r == "object" && r.RTCTrackEvent && "receiver" in r.RTCTrackEvent.prototype && !("transceiver" in r.RTCTrackEvent.prototype) && Object.defineProperty(r.RTCTrackEvent.prototype, "transceiver", {
11634
11653
  get() {
11635
11654
  return { receiver: this.receiver };
@@ -11673,7 +11692,7 @@ function on(r, e) {
11673
11692
  }).then(a, o);
11674
11693
  };
11675
11694
  }
11676
- function nc(r) {
11695
+ function sc(r) {
11677
11696
  if (!(typeof r == "object" && r.RTCPeerConnection && r.RTCRtpSender) || r.RTCRtpSender && "getStats" in r.RTCRtpSender.prototype)
11678
11697
  return;
11679
11698
  const e = r.RTCPeerConnection.prototype.getSenders;
@@ -11689,7 +11708,7 @@ function nc(r) {
11689
11708
  return this.track ? this._pc.getStats(this.track) : Promise.resolve(/* @__PURE__ */ new Map());
11690
11709
  };
11691
11710
  }
11692
- function sc(r) {
11711
+ function oc(r) {
11693
11712
  if (!(typeof r == "object" && r.RTCPeerConnection && r.RTCRtpSender) || r.RTCRtpSender && "getStats" in r.RTCRtpReceiver.prototype)
11694
11713
  return;
11695
11714
  const e = r.RTCPeerConnection.prototype.getReceivers;
@@ -11700,17 +11719,17 @@ function sc(r) {
11700
11719
  return this._pc.getStats(this.track);
11701
11720
  };
11702
11721
  }
11703
- function oc(r) {
11722
+ function ac(r) {
11704
11723
  !r.RTCPeerConnection || "removeStream" in r.RTCPeerConnection.prototype || (r.RTCPeerConnection.prototype.removeStream = function(t) {
11705
11724
  xn("removeStream", "removeTrack"), this.getSenders().forEach((i) => {
11706
11725
  i.track && t.getTracks().includes(i.track) && this.removeTrack(i);
11707
11726
  });
11708
11727
  });
11709
11728
  }
11710
- function ac(r) {
11729
+ function cc(r) {
11711
11730
  r.DataChannel && !r.RTCDataChannel && (r.RTCDataChannel = r.DataChannel);
11712
11731
  }
11713
- function cc(r) {
11732
+ function uc(r) {
11714
11733
  if (!(typeof r == "object" && r.RTCPeerConnection))
11715
11734
  return;
11716
11735
  const e = r.RTCPeerConnection.prototype.addTransceiver;
@@ -11742,7 +11761,7 @@ function cc(r) {
11742
11761
  return s;
11743
11762
  });
11744
11763
  }
11745
- function uc(r) {
11764
+ function dc(r) {
11746
11765
  if (!(typeof r == "object" && r.RTCRtpSender))
11747
11766
  return;
11748
11767
  const e = r.RTCRtpSender.prototype.getParameters;
@@ -11751,7 +11770,7 @@ function uc(r) {
11751
11770
  return "encodings" in i || (i.encodings = [].concat(this.sendEncodings || [{}])), i;
11752
11771
  });
11753
11772
  }
11754
- function dc(r) {
11773
+ function hc(r) {
11755
11774
  if (!(typeof r == "object" && r.RTCPeerConnection))
11756
11775
  return;
11757
11776
  const e = r.RTCPeerConnection.prototype.createOffer;
@@ -11761,7 +11780,7 @@ function dc(r) {
11761
11780
  }) : e.apply(this, arguments);
11762
11781
  };
11763
11782
  }
11764
- function hc(r) {
11783
+ function lc(r) {
11765
11784
  if (!(typeof r == "object" && r.RTCPeerConnection))
11766
11785
  return;
11767
11786
  const e = r.RTCPeerConnection.prototype.createAnswer;
@@ -11773,20 +11792,20 @@ function hc(r) {
11773
11792
  }
11774
11793
  const vo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11775
11794
  __proto__: null,
11776
- shimAddTransceiver: cc,
11777
- shimCreateAnswer: hc,
11778
- shimCreateOffer: dc,
11779
- shimGetDisplayMedia: W_,
11780
- shimGetParameters: uc,
11781
- shimGetUserMedia: rc,
11782
- shimOnTrack: ic,
11795
+ shimAddTransceiver: uc,
11796
+ shimCreateAnswer: lc,
11797
+ shimCreateOffer: hc,
11798
+ shimGetDisplayMedia: X_,
11799
+ shimGetParameters: dc,
11800
+ shimGetUserMedia: ic,
11801
+ shimOnTrack: nc,
11783
11802
  shimPeerConnection: on,
11784
- shimRTCDataChannel: ac,
11785
- shimReceiverGetStats: sc,
11786
- shimRemoveStream: oc,
11787
- shimSenderGetStats: nc
11803
+ shimRTCDataChannel: cc,
11804
+ shimReceiverGetStats: oc,
11805
+ shimRemoveStream: ac,
11806
+ shimSenderGetStats: sc
11788
11807
  }, Symbol.toStringTag, { value: "Module" }));
11789
- function lc(r) {
11808
+ function pc(r) {
11790
11809
  if (!(typeof r != "object" || !r.RTCPeerConnection)) {
11791
11810
  if ("getLocalStreams" in r.RTCPeerConnection.prototype || (r.RTCPeerConnection.prototype.getLocalStreams = function() {
11792
11811
  return this._localStreams || (this._localStreams = []), this._localStreams;
@@ -11821,7 +11840,7 @@ function lc(r) {
11821
11840
  });
11822
11841
  }
11823
11842
  }
11824
- function pc(r) {
11843
+ function fc(r) {
11825
11844
  if (!(typeof r != "object" || !r.RTCPeerConnection) && ("getRemoteStreams" in r.RTCPeerConnection.prototype || (r.RTCPeerConnection.prototype.getRemoteStreams = function() {
11826
11845
  return this._remoteStreams ? this._remoteStreams : [];
11827
11846
  }), !("onaddstream" in r.RTCPeerConnection.prototype))) {
@@ -11856,7 +11875,7 @@ function pc(r) {
11856
11875
  };
11857
11876
  }
11858
11877
  }
11859
- function fc(r) {
11878
+ function mc(r) {
11860
11879
  if (typeof r != "object" || !r.RTCPeerConnection)
11861
11880
  return;
11862
11881
  const e = r.RTCPeerConnection.prototype, t = e.createOffer, i = e.createAnswer, n = e.setLocalDescription, s = e.setRemoteDescription, a = e.addIceCandidate;
@@ -11879,24 +11898,24 @@ function fc(r) {
11879
11898
  return u ? (l.then(c, u), Promise.resolve()) : l;
11880
11899
  }, e.addIceCandidate = o;
11881
11900
  }
11882
- function mc(r) {
11901
+ function _c(r) {
11883
11902
  const e = r && r.navigator;
11884
11903
  if (e.mediaDevices && e.mediaDevices.getUserMedia) {
11885
11904
  const t = e.mediaDevices, i = t.getUserMedia.bind(t);
11886
- e.mediaDevices.getUserMedia = (n) => i(_c(n));
11905
+ e.mediaDevices.getUserMedia = (n) => i(gc(n));
11887
11906
  }
11888
11907
  !e.getUserMedia && e.mediaDevices && e.mediaDevices.getUserMedia && (e.getUserMedia = (function(i, n, s) {
11889
11908
  e.mediaDevices.getUserMedia(i).then(n, s);
11890
11909
  }).bind(e));
11891
11910
  }
11892
- function _c(r) {
11911
+ function gc(r) {
11893
11912
  return r && r.video !== void 0 ? Object.assign(
11894
11913
  {},
11895
11914
  r,
11896
- { video: Ka(r.video) }
11915
+ { video: Wa(r.video) }
11897
11916
  ) : r;
11898
11917
  }
11899
- function gc(r) {
11918
+ function vc(r) {
11900
11919
  if (!r.RTCPeerConnection)
11901
11920
  return;
11902
11921
  const e = r.RTCPeerConnection;
@@ -11916,14 +11935,14 @@ function gc(r) {
11916
11935
  }
11917
11936
  });
11918
11937
  }
11919
- function vc(r) {
11938
+ function yc(r) {
11920
11939
  typeof r == "object" && r.RTCTrackEvent && "receiver" in r.RTCTrackEvent.prototype && !("transceiver" in r.RTCTrackEvent.prototype) && Object.defineProperty(r.RTCTrackEvent.prototype, "transceiver", {
11921
11940
  get() {
11922
11941
  return { receiver: this.receiver };
11923
11942
  }
11924
11943
  });
11925
11944
  }
11926
- function yc(r) {
11945
+ function bc(r) {
11927
11946
  const e = r.RTCPeerConnection.prototype.createOffer;
11928
11947
  r.RTCPeerConnection.prototype.createOffer = function(i) {
11929
11948
  if (i) {
@@ -11936,23 +11955,23 @@ function yc(r) {
11936
11955
  return e.apply(this, arguments);
11937
11956
  };
11938
11957
  }
11939
- function bc(r) {
11958
+ function Sc(r) {
11940
11959
  typeof r != "object" || r.AudioContext || (r.AudioContext = r.webkitAudioContext);
11941
11960
  }
11942
11961
  const yo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11943
11962
  __proto__: null,
11944
- shimAudioContext: bc,
11945
- shimCallbacksAPI: fc,
11946
- shimConstraints: _c,
11947
- shimCreateOfferLegacy: yc,
11948
- shimGetUserMedia: mc,
11949
- shimLocalStreamsAPI: lc,
11950
- shimRTCIceServerUrls: gc,
11951
- shimRemoteStreamsAPI: pc,
11952
- shimTrackEventTransceiver: vc
11963
+ shimAudioContext: Sc,
11964
+ shimCallbacksAPI: mc,
11965
+ shimConstraints: gc,
11966
+ shimCreateOfferLegacy: bc,
11967
+ shimGetUserMedia: _c,
11968
+ shimLocalStreamsAPI: pc,
11969
+ shimRTCIceServerUrls: vc,
11970
+ shimRemoteStreamsAPI: fc,
11971
+ shimTrackEventTransceiver: yc
11953
11972
  }, Symbol.toStringTag, { value: "Module" }));
11954
11973
  var Ni = { exports: {} }, bo;
11955
- function J_() {
11974
+ function Y_() {
11956
11975
  return bo || (bo = 1, function(r) {
11957
11976
  const e = {};
11958
11977
  e.generateIdentifier = function() {
@@ -12341,11 +12360,11 @@ t=0 0\r
12341
12360
  }, r.exports = e;
12342
12361
  }(Ni)), Ni.exports;
12343
12362
  }
12344
- var Sc = J_();
12345
- const Ct = /* @__PURE__ */ jr(Sc), Z_ = /* @__PURE__ */ zc({
12363
+ var Ec = Y_();
12364
+ const Ct = /* @__PURE__ */ jr(Ec), Q_ = /* @__PURE__ */ kc({
12346
12365
  __proto__: null,
12347
12366
  default: Ct
12348
- }, [Sc]);
12367
+ }, [Ec]);
12349
12368
  function kr(r) {
12350
12369
  if (!r.RTCIceCandidate || r.RTCIceCandidate && "foundation" in r.RTCIceCandidate.prototype)
12351
12370
  return;
@@ -12558,7 +12577,7 @@ function xr(r, e) {
12558
12577
  return n.sdp || n.type !== "offer" && n.type !== "answer" ? t.apply(this, [n]) : (n.type === "offer" ? this.createOffer : this.createAnswer).apply(this).then((a) => t.apply(this, [a]));
12559
12578
  });
12560
12579
  }
12561
- const X_ = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
12580
+ const eg = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
12562
12581
  __proto__: null,
12563
12582
  removeExtmapAllowMixed: un,
12564
12583
  shimAddIceCandidateNullOrEmpty: Dr,
@@ -12569,19 +12588,19 @@ const X_ = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
12569
12588
  shimRTCIceCandidateRelayProtocol: an,
12570
12589
  shimSendThrowTypeError: Ar
12571
12590
  }, Symbol.toStringTag, { value: "Module" }));
12572
- function Y_({ window: r } = {}, e = {
12591
+ function tg({ window: r } = {}, e = {
12573
12592
  shimChrome: !0,
12574
12593
  shimFirefox: !0,
12575
12594
  shimSafari: !0
12576
12595
  }) {
12577
- const t = qa, i = K_(r), n = {
12596
+ const t = Ka, i = Z_(r), n = {
12578
12597
  browserDetails: i,
12579
- commonShim: X_,
12598
+ commonShim: eg,
12580
12599
  extractVersion: zr,
12581
- disableLog: $_,
12582
- disableWarnings: q_,
12600
+ disableLog: W_,
12601
+ disableWarnings: J_,
12583
12602
  // Expose sdp as a convenience. For production apps include directly.
12584
- sdp: Z_
12603
+ sdp: Q_
12585
12604
  };
12586
12605
  switch (i.browser) {
12587
12606
  case "chrome":
@@ -12589,17 +12608,17 @@ function Y_({ window: r } = {}, e = {
12589
12608
  return t("Chrome shim is not included in this adapter release."), n;
12590
12609
  if (i.version === null)
12591
12610
  return t("Chrome shim can not determine version, not shimming."), n;
12592
- t("adapter.js shimming chrome."), n.browserShim = go, Dr(r, i), xr(r), Wa(r, i), Ja(r), sn(r, i), Za(r), ec(r, i), Xa(r), Ya(r), tc(r, i), kr(r), an(r), cn(r), Rr(r, i), Ar(r), un(r, i);
12611
+ t("adapter.js shimming chrome."), n.browserShim = go, Dr(r, i), xr(r), Ja(r, i), Za(r), sn(r, i), Xa(r), tc(r, i), Ya(r), Qa(r), rc(r, i), kr(r), an(r), cn(r), Rr(r, i), Ar(r), un(r, i);
12593
12612
  break;
12594
12613
  case "firefox":
12595
12614
  if (!vo || !on || !e.shimFirefox)
12596
12615
  return t("Firefox shim is not included in this adapter release."), n;
12597
- t("adapter.js shimming firefox."), n.browserShim = vo, Dr(r, i), xr(r), rc(r, i), on(r, i), ic(r), oc(r), nc(r), sc(r), ac(r), cc(r), uc(r), dc(r), hc(r), kr(r), cn(r), Rr(r, i), Ar(r);
12616
+ t("adapter.js shimming firefox."), n.browserShim = vo, Dr(r, i), xr(r), ic(r, i), on(r, i), nc(r), ac(r), sc(r), oc(r), cc(r), uc(r), dc(r), hc(r), lc(r), kr(r), cn(r), Rr(r, i), Ar(r);
12598
12617
  break;
12599
12618
  case "safari":
12600
12619
  if (!yo || !e.shimSafari)
12601
12620
  return t("Safari shim is not included in this adapter release."), n;
12602
- t("adapter.js shimming safari."), n.browserShim = yo, Dr(r, i), xr(r), gc(r), yc(r), fc(r), lc(r), pc(r), vc(r), mc(r), bc(r), kr(r), an(r), Rr(r, i), Ar(r), un(r, i);
12621
+ t("adapter.js shimming safari."), n.browserShim = yo, Dr(r, i), xr(r), vc(r), bc(r), mc(r), pc(r), fc(r), yc(r), _c(r), Sc(r), kr(r), an(r), Rr(r, i), Ar(r), un(r, i);
12603
12622
  break;
12604
12623
  default:
12605
12624
  t("Unsupported browser!");
@@ -12607,8 +12626,8 @@ function Y_({ window: r } = {}, e = {
12607
12626
  }
12608
12627
  return n;
12609
12628
  }
12610
- Y_({ window: typeof window > "u" ? void 0 : window });
12611
- function Q_() {
12629
+ tg({ window: typeof window > "u" ? void 0 : window });
12630
+ function rg() {
12612
12631
  const r = {
12613
12632
  // 硬件并发数(CPU核心数近似值)
12614
12633
  hardware_concurrency: navigator.hardwareConcurrency
@@ -12630,7 +12649,7 @@ function Q_() {
12630
12649
  }
12631
12650
  return r;
12632
12651
  }
12633
- class ig extends Xe {
12652
+ class og extends Xe {
12634
12653
  /** {zh}
12635
12654
  * @brief 查询是否支持 RTM 或 WebTransport 推流。
12636
12655
  * @param mode 推流模式。
@@ -12646,9 +12665,9 @@ class ig extends Xe {
12646
12665
  */
12647
12666
  static async isSupported(e) {
12648
12667
  if (e === "webTransport")
12649
- return Promise.resolve(Va.isSupported());
12668
+ return Promise.resolve(Fa.isSupported());
12650
12669
  try {
12651
- return N_() || !window.RTCPeerConnection || !window.RTCPeerConnection.prototype.addTransceiver || !window.RTCPeerConnection.prototype.createDataChannel ? !1 : await F_() && await V_();
12670
+ return V_() || !window.RTCPeerConnection || !window.RTCPeerConnection.prototype.addTransceiver || !window.RTCPeerConnection.prototype.createDataChannel ? !1 : await $_() && await H_();
12652
12671
  } catch {
12653
12672
  return !1;
12654
12673
  }
@@ -12665,17 +12684,17 @@ class ig extends Xe {
12665
12684
  */
12666
12685
  constructor(e) {
12667
12686
  var t, i, n, s, a, o, d, c, u, l;
12668
- if (super(), this._options = e ?? {}, this._streamManagerController = new e_(this), this._streamComposeController = new d_(
12687
+ if (super(), this._options = e ?? {}, this._streamManagerController = new i_(this), this._streamComposeController = new p_(
12669
12688
  this._streamManagerController
12670
- ), this._streamConsumeController = new U_(
12689
+ ), this._streamConsumeController = new B_(
12671
12690
  this._streamComposeController,
12672
12691
  e
12673
- ), this._streamConsumeController.setPushConfig(e), this._observer = H_, this._bindEvent(), !(e != null && e.loggerConfig) || (t = e == null ? void 0 : e.loggerConfig) != null && t.enable) {
12674
- Jm({
12692
+ ), this._streamConsumeController.setPushConfig(e), this._observer = K_, this._bindEvent(), !(e != null && e.loggerConfig) || (t = e == null ? void 0 : e.loggerConfig) != null && t.enable) {
12693
+ Qm({
12675
12694
  showLogInConsole: ((i = e == null ? void 0 : e.loggerConfig) == null ? void 0 : i.showInConsole) ?? !1
12676
12695
  });
12677
- const h = qm((n = e == null ? void 0 : e.loggerConfig) == null ? void 0 : n.userId), p = Km((s = e == null ? void 0 : e.loggerConfig) == null ? void 0 : s.deviceId);
12678
- Zm(
12696
+ const h = Km((n = e == null ? void 0 : e.loggerConfig) == null ? void 0 : n.userId), p = Wm((s = e == null ? void 0 : e.loggerConfig) == null ? void 0 : s.deviceId);
12697
+ e_(
12679
12698
  {
12680
12699
  user_unique_id: h,
12681
12700
  device_id: p,
@@ -12690,10 +12709,10 @@ class ig extends Xe {
12690
12709
  customer_app_name: ((u = e == null ? void 0 : e.loggerConfig) == null ? void 0 : u.appName) ?? "unknown",
12691
12710
  customer_app_id: ((l = e == null ? void 0 : e.loggerConfig) == null ? void 0 : l.appId) ?? 0
12692
12711
  }
12693
- ), D(x.PUSHER_INIT, {
12712
+ ), x(D.PUSHER_INIT, {
12694
12713
  options: e,
12695
- ...Q_()
12696
- });
12714
+ ...rg()
12715
+ }), t_();
12697
12716
  }
12698
12717
  }
12699
12718
  /** {zh}
@@ -13141,7 +13160,7 @@ class ig extends Xe {
13141
13160
  * - You can call [`setMixingConfig()`](#livepusher-setmixingconfig) both before and after enabling local mixing to configure canvas parameters (e.g., width, height, frame rate), ensuring the merged output meets your requirements.
13142
13161
  */
13143
13162
  enableMixing(e) {
13144
- if (D(x.SWITCH_ENABLE_MIXING, {
13163
+ if (x(D.SWITCH_ENABLE_MIXING, {
13145
13164
  enable: e,
13146
13165
  is_pushing: this.isPushing()
13147
13166
  }), this.isPushing())
@@ -13157,7 +13176,7 @@ class ig extends Xe {
13157
13176
  * @param config Attributes of the mixing canvas, such as width, height, frame rate, etc.
13158
13177
  */
13159
13178
  setMixingConfig(e) {
13160
- D(x.SET_MIXING_CONFIG, e), this._streamComposeController.setMixingConfig(e);
13179
+ x(D.SET_MIXING_CONFIG, e), this._streamComposeController.setMixingConfig(e);
13161
13180
  }
13162
13181
  /** {zh}
13163
13182
  * @brief 获取配置的合流参数,包括合流画布的宽度、高度、帧率等。
@@ -13223,7 +13242,7 @@ class ig extends Xe {
13223
13242
  try {
13224
13243
  await this._streamComposeController.resumeMixer();
13225
13244
  } catch (t) {
13226
- if (D(x.PUSH_AUDIO_CONTEXT_START_FAILED, {
13245
+ if (x(D.PUSH_AUDIO_CONTEXT_START_FAILED, {
13227
13246
  error: t
13228
13247
  }), this._options.checkAudio)
13229
13248
  throw new yt(
@@ -13246,7 +13265,7 @@ class ig extends Xe {
13246
13265
  * @param config The video stream layout parameters can be a single object or an array of multiple objects.
13247
13266
  */
13248
13267
  addVideoStream(e) {
13249
- D(x.ADD_VIDEO_STREAM, {
13268
+ x(D.ADD_VIDEO_STREAM, {
13250
13269
  number: X(e) ? e.length : 1,
13251
13270
  // 视频流数量
13252
13271
  config: e
@@ -13264,7 +13283,7 @@ class ig extends Xe {
13264
13283
  * @param streamId The video stream ID to be removed
13265
13284
  */
13266
13285
  removeVideoStream(e) {
13267
- D(x.DELETE_VIDEO_STREAM, { stream_id: e }), this._streamComposeController.removeVideoStream(e);
13286
+ x(D.DELETE_VIDEO_STREAM, { stream_id: e }), this._streamComposeController.removeVideoStream(e);
13268
13287
  }
13269
13288
  /** {zh}
13270
13289
  * @brief 更新已添加的视频流的布局参数,例如位置、大小等,适用于动态布局调整等场景。
@@ -13276,7 +13295,7 @@ class ig extends Xe {
13276
13295
  * @param config Update the video stream parameters. When an array is passed, multiple video streams are updated.
13277
13296
  */
13278
13297
  updateVideoStream(e) {
13279
- D(x.UPDATE_VIDEO_STREAM, {
13298
+ x(D.UPDATE_VIDEO_STREAM, {
13280
13299
  number: X(e) ? e.length : 1,
13281
13300
  // 视频流数量
13282
13301
  config: e
@@ -13292,7 +13311,7 @@ class ig extends Xe {
13292
13311
  * @param streamId The ID of the video stream to hide. If omitted, all video streams will be hidden.
13293
13312
  */
13294
13313
  muteVideoStream(e) {
13295
- D(x.CHANGE_VIDEO_STREAM_MUTE, {
13314
+ x(D.CHANGE_VIDEO_STREAM_MUTE, {
13296
13315
  stream_id: e,
13297
13316
  mute: !1
13298
13317
  }), this._streamComposeController.muteVideoStream(e);
@@ -13307,7 +13326,7 @@ class ig extends Xe {
13307
13326
  * @param streamId To unhide video stream id; if not provided, unhide all video streams.
13308
13327
  */
13309
13328
  unmuteVideoStream(e) {
13310
- D(x.CHANGE_VIDEO_STREAM_MUTE, {
13329
+ x(D.CHANGE_VIDEO_STREAM_MUTE, {
13311
13330
  stream_id: e,
13312
13331
  mute: !0
13313
13332
  }), this._streamComposeController.unmuteVideoStream(e);
@@ -13324,7 +13343,7 @@ class ig extends Xe {
13324
13343
  * @param config Audio stream parameters can be a single object or an array of multiple objects.
13325
13344
  */
13326
13345
  addAudioStream(e) {
13327
- D(x.ADD_AUDIO_STREAM, {
13346
+ x(D.ADD_AUDIO_STREAM, {
13328
13347
  number: X(e) ? e.length : 1,
13329
13348
  // 音频流数量
13330
13349
  config: e
@@ -13342,7 +13361,7 @@ class ig extends Xe {
13342
13361
  * @param streamId The stream ID to be removed. If omitted, all audio streams will be removed.
13343
13362
  */
13344
13363
  removeAudioStream(e) {
13345
- D(x.DELETE_AUDIO_STREAM, { stream_id: e }), this._streamComposeController.removeAudioStream(e);
13364
+ x(D.DELETE_AUDIO_STREAM, { stream_id: e }), this._streamComposeController.removeAudioStream(e);
13346
13365
  }
13347
13366
  /** {zh}
13348
13367
  * @brief 更新音频流的音量大小。在混音场景中调整某个或多个音频流的音量,例如,主播语音、背景音乐和视频音频的平衡调整。
@@ -13362,7 +13381,7 @@ class ig extends Xe {
13362
13381
  * - Call `updateAudioStream()` to update the parameters of the audio stream.
13363
13382
  */
13364
13383
  updateAudioStream(e) {
13365
- D(x.UPDATE_AUDIO_STREAM, {
13384
+ x(D.UPDATE_AUDIO_STREAM, {
13366
13385
  number: X(e) ? e.length : 1,
13367
13386
  // 音频流数量
13368
13387
  config: e
@@ -13380,7 +13399,7 @@ class ig extends Xe {
13380
13399
  * @notes Mute the specified audio stream. If the target is an individual audio stream, mute it directly. If the target is a video stream containing an audio track, it will only affect the audio part of the video stream without impacting the video footage.
13381
13400
  */
13382
13401
  muteAudioStream(e) {
13383
- D(x.CHANGE_AUDIO_STREAM_MUTE, {
13402
+ x(D.CHANGE_AUDIO_STREAM_MUTE, {
13384
13403
  stream_id: e,
13385
13404
  mute: !0
13386
13405
  }), this._streamComposeController.muteAudioStream(e);
@@ -13395,7 +13414,7 @@ class ig extends Xe {
13395
13414
  * @param streamId The stream ID to unmute. If omitted, all streams will be unmuted.
13396
13415
  */
13397
13416
  unmuteAudioStream(e) {
13398
- D(x.CHANGE_AUDIO_STREAM_MUTE, {
13417
+ x(D.CHANGE_AUDIO_STREAM_MUTE, {
13399
13418
  stream_id: e,
13400
13419
  mute: !1
13401
13420
  }), this._streamComposeController.unmuteAudioStream(e);
@@ -13415,7 +13434,7 @@ class ig extends Xe {
13415
13434
  * @param value Fill in the value of the corresponding attribute according to the type of `key`.
13416
13435
  */
13417
13436
  setProperty(e, t) {
13418
- switch (D(x.SET_PROPERTY_CALL, {
13437
+ switch (x(D.SET_PROPERTY_CALL, {
13419
13438
  key: e,
13420
13439
  value: t
13421
13440
  }), e) {
@@ -13488,7 +13507,7 @@ class ig extends Xe {
13488
13507
  * @param quality Video Quality, see [VIDEO_DEFAULT_QUALITY](docs-configuration#video_default_quality)
13489
13508
  */
13490
13509
  setVideoQuality(e) {
13491
- if (D(x.SET_VIDEO_QUALITY, {
13510
+ if (x(D.SET_VIDEO_QUALITY, {
13492
13511
  quality: e
13493
13512
  }), this._streamConsumeController.pushMode === "webTransport" && ["120p", "180p", "240p"].indexOf(e) !== -1)
13494
13513
  throw new Error("quality not allowed lower than 360p on rtmp mode");
@@ -13523,7 +13542,7 @@ class ig extends Xe {
13523
13542
  * - `HIGH`: High audio quality (high bitrate), suitable for music streaming and high-quality scenarios.
13524
13543
  */
13525
13544
  setAudioQuality(e) {
13526
- D(x.SET_AUDIO_QUALITY, {
13545
+ x(D.SET_AUDIO_QUALITY, {
13527
13546
  quality: e
13528
13547
  });
13529
13548
  const { sampleRate: t, bitrate: i } = Tt(e, "audio");
@@ -13671,7 +13690,7 @@ class ig extends Xe {
13671
13690
  (e) => {
13672
13691
  this.observer.onLiveConnectStateChange(e);
13673
13692
  }
13674
- ), xu((e) => {
13693
+ ), Pu((e) => {
13675
13694
  e.deviceInfo.kind === "videoinput" ? this.observer.onCameraChanged(e.deviceInfo) : e.deviceInfo.kind === "audioinput" && this.observer.onMicrophoneChanged(e.deviceInfo);
13676
13695
  });
13677
13696
  }
@@ -13691,7 +13710,7 @@ class ig extends Xe {
13691
13710
  * - ** Failure**: returns an error message.
13692
13711
  */
13693
13712
  async destroy() {
13694
- await this._streamConsumeController.destroy(), this._streamManagerController.destroy();
13713
+ await this._streamConsumeController.destroy(), this._streamManagerController.destroy(), r_();
13695
13714
  }
13696
13715
  /** {zh}
13697
13716
  * @default ???
@@ -13741,5 +13760,5 @@ class ig extends Xe {
13741
13760
  }
13742
13761
  }
13743
13762
  export {
13744
- ig as default
13763
+ og as default
13745
13764
  };