@ikonai/sdk 1.0.1 → 1.0.2
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/index.js +372 -352
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _l(t) {
|
|
2
2
|
return t;
|
|
3
3
|
}
|
|
4
4
|
function ue(t) {
|
|
@@ -43,7 +43,7 @@ function Me(t, e, r) {
|
|
|
43
43
|
const i = 27 + s.targetIds.length * 4;
|
|
44
44
|
return n.subarray(i, s.length);
|
|
45
45
|
}
|
|
46
|
-
function
|
|
46
|
+
function F(t, e, r, n, s) {
|
|
47
47
|
const i = s?.trackId ?? 0, o = s?.sequenceId ?? 0, a = s?.flags ?? 0, c = s?.targetIds ?? [], u = s?.payloadType ?? 8, f = 27 + c.length * 4, d = f + e.length, h = new Uint8Array(d), E = new DataView(h.buffer);
|
|
48
48
|
E.setUint32(0, d, !0), E.setUint32(4, t >>> 0, !0), E.setUint32(8, n >>> 0, !0), E.setUint32(12, i >>> 0, !0), E.setUint32(16, o >>> 0, !0), E.setUint32(20, c.length >>> 0, !0), E.setUint8(24, r & 255), E.setUint8(25, u & 255), E.setUint8(26, a & 255);
|
|
49
49
|
let p = 27;
|
|
@@ -238,7 +238,7 @@ class _e {
|
|
|
238
238
|
}
|
|
239
239
|
class Oe {
|
|
240
240
|
constructor(e, r) {
|
|
241
|
-
this.keyType = e, this.valueType = r,
|
|
241
|
+
this.keyType = e, this.valueType = r, Pe(e);
|
|
242
242
|
}
|
|
243
243
|
payload = new H();
|
|
244
244
|
count = 0;
|
|
@@ -484,7 +484,7 @@ class z {
|
|
|
484
484
|
return new Wr(e, n, i);
|
|
485
485
|
}
|
|
486
486
|
}
|
|
487
|
-
class
|
|
487
|
+
class P {
|
|
488
488
|
constructor(e, r) {
|
|
489
489
|
this.type = e, this.payload = r;
|
|
490
490
|
}
|
|
@@ -577,7 +577,7 @@ class F {
|
|
|
577
577
|
throw new Error(`Teleport value has type ${R[this.type]}, expected ${R[e]}`);
|
|
578
578
|
}
|
|
579
579
|
}
|
|
580
|
-
class Wr extends
|
|
580
|
+
class Wr extends P {
|
|
581
581
|
constructor(e, r, n) {
|
|
582
582
|
super(r, n), this.fieldId = e;
|
|
583
583
|
}
|
|
@@ -641,7 +641,7 @@ class Le {
|
|
|
641
641
|
return this.offset = e.offset + r, new q(11, n);
|
|
642
642
|
}
|
|
643
643
|
case 9: {
|
|
644
|
-
const e =
|
|
644
|
+
const e = Fe(this.payload, this.offset), r = this.payload.subarray(this.offset, this.offset + e);
|
|
645
645
|
return this.offset += e, new q(9, r);
|
|
646
646
|
}
|
|
647
647
|
case 10: {
|
|
@@ -653,7 +653,7 @@ class Le {
|
|
|
653
653
|
}
|
|
654
654
|
}
|
|
655
655
|
}
|
|
656
|
-
class q extends
|
|
656
|
+
class q extends P {
|
|
657
657
|
constructor(e, r) {
|
|
658
658
|
super(e, r);
|
|
659
659
|
}
|
|
@@ -670,7 +670,7 @@ class ve {
|
|
|
670
670
|
throw new Error("Dictionary payload too short");
|
|
671
671
|
if (this.keyType = e[0] >> 4 & 15, this.valueType = e[1] >> 4 & 15, (e[0] & 15) !== 0 || (e[1] & 15) !== 0)
|
|
672
672
|
throw new Error("Dictionary key/value flags must be zero");
|
|
673
|
-
|
|
673
|
+
Pe(this.keyType);
|
|
674
674
|
const r = { offset: 2 };
|
|
675
675
|
this.count = U(e, r, "DictMalformed"), this.offset = r.offset;
|
|
676
676
|
}
|
|
@@ -691,13 +691,13 @@ class ve {
|
|
|
691
691
|
if (e >= 0) {
|
|
692
692
|
C(this.payload, this.offset, e);
|
|
693
693
|
const r = this.payload.subarray(this.offset, this.offset + e);
|
|
694
|
-
return this.offset += e, new
|
|
694
|
+
return this.offset += e, new P(this.keyType, r);
|
|
695
695
|
}
|
|
696
696
|
if (this.keyType === 12 || this.keyType === 13) {
|
|
697
697
|
const r = { offset: this.offset }, n = U(this.payload, r, "DictMalformed");
|
|
698
698
|
C(this.payload, r.offset, n);
|
|
699
699
|
const s = this.payload.subarray(r.offset, r.offset + n);
|
|
700
|
-
return this.offset = r.offset + n, new
|
|
700
|
+
return this.offset = r.offset + n, new P(this.keyType, s);
|
|
701
701
|
}
|
|
702
702
|
throw new Error("Unsupported dictionary key type");
|
|
703
703
|
}
|
|
@@ -708,21 +708,21 @@ class ve {
|
|
|
708
708
|
const e = { offset: this.offset }, r = U(this.payload, e, "DictMalformed");
|
|
709
709
|
C(this.payload, e.offset, r);
|
|
710
710
|
const n = this.payload.subarray(e.offset, e.offset + r);
|
|
711
|
-
return this.offset = e.offset + r, new
|
|
711
|
+
return this.offset = e.offset + r, new P(this.valueType, n);
|
|
712
712
|
}
|
|
713
713
|
case 11: {
|
|
714
714
|
const e = { offset: this.offset }, r = U(this.payload, e, "DictMalformed");
|
|
715
715
|
C(this.payload, e.offset, r);
|
|
716
716
|
const n = this.payload.subarray(e.offset, e.offset + r);
|
|
717
|
-
return this.offset = e.offset + r, new
|
|
717
|
+
return this.offset = e.offset + r, new P(11, n);
|
|
718
718
|
}
|
|
719
719
|
case 9: {
|
|
720
|
-
const e =
|
|
721
|
-
return this.offset += e, new
|
|
720
|
+
const e = Fe(this.payload, this.offset), r = this.payload.subarray(this.offset, this.offset + e);
|
|
721
|
+
return this.offset += e, new P(9, r);
|
|
722
722
|
}
|
|
723
723
|
case 10: {
|
|
724
724
|
const e = Be(this.payload, this.offset), r = this.payload.subarray(this.offset, this.offset + e);
|
|
725
|
-
return this.offset += e, new
|
|
725
|
+
return this.offset += e, new P(10, r);
|
|
726
726
|
}
|
|
727
727
|
case 3:
|
|
728
728
|
case 5:
|
|
@@ -736,7 +736,7 @@ class ve {
|
|
|
736
736
|
const e = Y(this.valueType);
|
|
737
737
|
C(this.payload, this.offset, e);
|
|
738
738
|
const r = this.payload.subarray(this.offset, this.offset + e);
|
|
739
|
-
return this.offset += e, new
|
|
739
|
+
return this.offset += e, new P(this.valueType, r);
|
|
740
740
|
}
|
|
741
741
|
default:
|
|
742
742
|
throw new Error(`Unsupported dictionary value type ${R[this.valueType]}`);
|
|
@@ -917,7 +917,7 @@ function Y(t) {
|
|
|
917
917
|
return -1;
|
|
918
918
|
}
|
|
919
919
|
}
|
|
920
|
-
function
|
|
920
|
+
function Pe(t) {
|
|
921
921
|
if (t === 9 || t === 11 || t === 10 || t === 1)
|
|
922
922
|
throw new Error("Dictionary keys must be primitive Teleport types");
|
|
923
923
|
}
|
|
@@ -928,7 +928,7 @@ function C(t, e, r) {
|
|
|
928
928
|
function Yr(t, e) {
|
|
929
929
|
return (t[e] | t[e + 1] << 8 | t[e + 2] << 16 | t[e + 3] << 24) >>> 0;
|
|
930
930
|
}
|
|
931
|
-
function
|
|
931
|
+
function Fe(t, e) {
|
|
932
932
|
if (e >= t.length)
|
|
933
933
|
throw new Error("Array payload exceeds bounds");
|
|
934
934
|
const r = t[e], n = r >> 4 & 15;
|
|
@@ -950,7 +950,7 @@ function Be(t, e) {
|
|
|
950
950
|
const r = t[e] >> 4 & 15, n = t[e + 1] >> 4 & 15;
|
|
951
951
|
if ((t[e] & 15) !== 0 || (t[e + 1] & 15) !== 0)
|
|
952
952
|
throw new Error("Dictionary key/value flags must be zero");
|
|
953
|
-
|
|
953
|
+
Pe(r);
|
|
954
954
|
const s = { offset: e + 2 }, i = U(t, s, "DictMalformed");
|
|
955
955
|
let o = s.offset;
|
|
956
956
|
for (let a = 0; a < i; a++)
|
|
@@ -972,7 +972,7 @@ function ye(t, e, r, n) {
|
|
|
972
972
|
return C(e, i.offset, o), i.offset + o;
|
|
973
973
|
}
|
|
974
974
|
case 9:
|
|
975
|
-
return r +
|
|
975
|
+
return r + Fe(e, r);
|
|
976
976
|
case 10:
|
|
977
977
|
return r + Be(e, r);
|
|
978
978
|
default:
|
|
@@ -996,7 +996,7 @@ function Qr(t, e) {
|
|
|
996
996
|
}
|
|
997
997
|
function Zr(t, e, r) {
|
|
998
998
|
const n = Jr(t);
|
|
999
|
-
return
|
|
999
|
+
return F(jr, n, It, e, r);
|
|
1000
1000
|
}
|
|
1001
1001
|
const qr = 467348717, en = 972460562, tn = 1911490601, rn = 2603556958, nn = 3609695522, sn = 4094837378, on = 4257460908;
|
|
1002
1002
|
function an(t) {
|
|
@@ -1149,7 +1149,7 @@ function gn(t) {
|
|
|
1149
1149
|
e.push(r.asString());
|
|
1150
1150
|
return e;
|
|
1151
1151
|
}
|
|
1152
|
-
const Cn = 76337612, Rn = 185396121, bn = 388632637, kn = 417197284, Un = 469070965, Dn = 470595159, Mn = 781727218, On = 834078886, Ln = 1043273762, vn = 1236999138,
|
|
1152
|
+
const Cn = 76337612, Rn = 185396121, bn = 388632637, kn = 417197284, Un = 469070965, Dn = 470595159, Mn = 781727218, On = 834078886, Ln = 1043273762, vn = 1236999138, Pn = 1368629611, Fn = 1715899485, Bn = 1942830531, Gn = 1999510636, xn = 2079864626, Vn = 2142346422, Wn = 2598291686, Hn = 2719718823, $n = 2810953526, Kn = 2840065720, Yn = 2885165957, jn = 3586157513, zn = 3717933110, Xn = 4062655306;
|
|
1153
1153
|
function Ne(t) {
|
|
1154
1154
|
const e = {};
|
|
1155
1155
|
return wt(e), e;
|
|
@@ -1215,12 +1215,12 @@ function Jn(t, e) {
|
|
|
1215
1215
|
e.ReceiveAllMessages = r.asBool();
|
|
1216
1216
|
break;
|
|
1217
1217
|
}
|
|
1218
|
-
case
|
|
1218
|
+
case Pn: {
|
|
1219
1219
|
if (r.isNull) throw new Error();
|
|
1220
1220
|
e.Description = r.asString();
|
|
1221
1221
|
break;
|
|
1222
1222
|
}
|
|
1223
|
-
case
|
|
1223
|
+
case Fn: {
|
|
1224
1224
|
if (r.isNull) throw new Error();
|
|
1225
1225
|
e.Locale = r.asString();
|
|
1226
1226
|
break;
|
|
@@ -1460,9 +1460,9 @@ function Ls(t, e) {
|
|
|
1460
1460
|
}
|
|
1461
1461
|
function vs(t, e, r) {
|
|
1462
1462
|
const n = Os(t);
|
|
1463
|
-
return
|
|
1463
|
+
return F(bs, n, Nt, e, r);
|
|
1464
1464
|
}
|
|
1465
|
-
const
|
|
1465
|
+
const Ps = 1, Fs = 1048601, Bs = 112005851, Gs = 814454131, xs = 976255570, Vs = 1123310456, Ws = 2885165957, Hs = 3748161056, $s = 4289118421;
|
|
1466
1466
|
function Ks(t) {
|
|
1467
1467
|
const e = {};
|
|
1468
1468
|
return gt(e), e;
|
|
@@ -1520,7 +1520,7 @@ function zs(t, e) {
|
|
|
1520
1520
|
}
|
|
1521
1521
|
}
|
|
1522
1522
|
function Xs(t, e) {
|
|
1523
|
-
const r = Me(t,
|
|
1523
|
+
const r = Me(t, Fs, Ps);
|
|
1524
1524
|
return Ys(r, e);
|
|
1525
1525
|
}
|
|
1526
1526
|
function Js(t) {
|
|
@@ -1582,9 +1582,9 @@ function di(t, e) {
|
|
|
1582
1582
|
}
|
|
1583
1583
|
function fi(t, e, r) {
|
|
1584
1584
|
const n = hi(t);
|
|
1585
|
-
return
|
|
1585
|
+
return F(ni, n, Rt, e, r);
|
|
1586
1586
|
}
|
|
1587
|
-
const xe = 1, Ei = 1048600, bt = 703025676, kt = 814454131, Ut = 972460562, Dt = 976255570, Mt = 1368629611, Ot = 1479280922, Lt = 1533537016, vt = 2274386296,
|
|
1587
|
+
const xe = 1, Ei = 1048600, bt = 703025676, kt = 814454131, Ut = 972460562, Dt = 976255570, Mt = 1368629611, Ot = 1479280922, Lt = 1533537016, vt = 2274386296, Pt = 2603556958, Ft = 2885165957, Bt = 3568439632;
|
|
1588
1588
|
function pi(t) {
|
|
1589
1589
|
const e = {};
|
|
1590
1590
|
return Gt(e), e;
|
|
@@ -1597,7 +1597,7 @@ function Ii(t) {
|
|
|
1597
1597
|
return xt(t, e), e.finish();
|
|
1598
1598
|
}
|
|
1599
1599
|
function xt(t, e) {
|
|
1600
|
-
e.writeStringField(bt, t.ResultTypeName), e.writeStringField(kt, t.FunctionName), e.writeStringField(Ut, t.EnumerableItemTypeName), e.writeGuidField(Dt, t.FunctionId), e.writeStringField(Mt, t.Description), e.writeBoolField(Ot, t.IsCancellable), e.writeBoolField(Lt, t.RequiresInstance), e.writeBoolField(vt, t.LlmInlineResult), e.writeBoolField(
|
|
1600
|
+
e.writeStringField(bt, t.ResultTypeName), e.writeStringField(kt, t.FunctionName), e.writeStringField(Ut, t.EnumerableItemTypeName), e.writeGuidField(Dt, t.FunctionId), e.writeStringField(Mt, t.Description), e.writeBoolField(Ot, t.IsCancellable), e.writeBoolField(Lt, t.RequiresInstance), e.writeBoolField(vt, t.LlmInlineResult), e.writeBoolField(Pt, t.IsEnumerable), e.writeArrayField(Ft, R.Object, (r) => {
|
|
1601
1601
|
for (const n of t.Parameters)
|
|
1602
1602
|
r.writeObject(wi, (s) => {
|
|
1603
1603
|
yi(n, s);
|
|
@@ -1652,12 +1652,12 @@ function _i(t, e) {
|
|
|
1652
1652
|
e.LlmInlineResult = r.asBool();
|
|
1653
1653
|
break;
|
|
1654
1654
|
}
|
|
1655
|
-
case
|
|
1655
|
+
case Pt: {
|
|
1656
1656
|
if (r.isNull) throw new Error();
|
|
1657
1657
|
e.IsEnumerable = r.asBool();
|
|
1658
1658
|
break;
|
|
1659
1659
|
}
|
|
1660
|
-
case
|
|
1660
|
+
case Ft: {
|
|
1661
1661
|
if (r.isNull) throw new Error();
|
|
1662
1662
|
e.Parameters = Si(r.asArray());
|
|
1663
1663
|
break;
|
|
@@ -1671,7 +1671,7 @@ function _i(t, e) {
|
|
|
1671
1671
|
}
|
|
1672
1672
|
function Ti(t, e, r) {
|
|
1673
1673
|
const n = Ii(t);
|
|
1674
|
-
return
|
|
1674
|
+
return F(Ei, n, xe, e, r);
|
|
1675
1675
|
}
|
|
1676
1676
|
function Si(t) {
|
|
1677
1677
|
const e = [];
|
|
@@ -1768,9 +1768,9 @@ function Di(t, e) {
|
|
|
1768
1768
|
}
|
|
1769
1769
|
function Mi(t, e, r) {
|
|
1770
1770
|
const n = Ui(t);
|
|
1771
|
-
return
|
|
1771
|
+
return F(Ci, n, Qt, e, r);
|
|
1772
1772
|
}
|
|
1773
|
-
const Zt = 1, Oi = 1048602, Li = 349453957, vi = 703025676,
|
|
1773
|
+
const Zt = 1, Oi = 1048602, Li = 349453957, vi = 703025676, Pi = 3403385840, Fi = 3748161056, Bi = 4289118421;
|
|
1774
1774
|
function Gi(t) {
|
|
1775
1775
|
const e = {};
|
|
1776
1776
|
return xi(e), t && Object.assign(e, t), e;
|
|
@@ -1783,11 +1783,11 @@ function Vi(t) {
|
|
|
1783
1783
|
return Wi(t, e), e.finish();
|
|
1784
1784
|
}
|
|
1785
1785
|
function Wi(t, e) {
|
|
1786
|
-
e.writeBinaryField(Li, t.ResultData), e.writeStringField(vi, t.ResultTypeName), e.writeStringField(
|
|
1786
|
+
e.writeBinaryField(Li, t.ResultData), e.writeStringField(vi, t.ResultTypeName), e.writeStringField(Pi, t.ResultJson), e.writeGuidField(Fi, t.CallId), e.writeGuidField(Bi, t.InstanceId);
|
|
1787
1787
|
}
|
|
1788
1788
|
function Hi(t, e, r) {
|
|
1789
1789
|
const n = Vi(t);
|
|
1790
|
-
return
|
|
1790
|
+
return F(Oi, n, Zt, e, r);
|
|
1791
1791
|
}
|
|
1792
1792
|
const qt = 1, $i = 65549;
|
|
1793
1793
|
function Xe(t) {
|
|
@@ -1798,7 +1798,7 @@ function Ki(t) {
|
|
|
1798
1798
|
}
|
|
1799
1799
|
function Je(t, e, r) {
|
|
1800
1800
|
const n = Ki();
|
|
1801
|
-
return
|
|
1801
|
+
return F($i, n, qt, e, r);
|
|
1802
1802
|
}
|
|
1803
1803
|
const Yi = 3167053791, ji = 3342364356, zi = 3612929027;
|
|
1804
1804
|
function er(t) {
|
|
@@ -1916,118 +1916,138 @@ function lo(t, e) {
|
|
|
1916
1916
|
}
|
|
1917
1917
|
}
|
|
1918
1918
|
}
|
|
1919
|
-
const uo =
|
|
1920
|
-
function
|
|
1919
|
+
const uo = 4, ho = 65539, fo = 414670648, Eo = 693643444, po = 1144553441, Io = 1497620243, mo = 1559330978, _o = 1999510636, To = 2277643855, So = 2469008121, wo = 3042922213, Ao = 3219210453, yo = 3504054055, No = 3642827795, go = 3678477544, Co = 3696445035, Ro = 3707543140, bo = 3712281496, ko = 3748214980, Uo = 3823842552, Do = 3895362455, Mo = 3897397815, Oo = 4225107827;
|
|
1920
|
+
function Lo(t) {
|
|
1921
1921
|
const e = {};
|
|
1922
1922
|
return or(e), e;
|
|
1923
1923
|
}
|
|
1924
1924
|
function or(t) {
|
|
1925
|
-
return t.Clients = /* @__PURE__ */ Object.create(null), t.UIStreams = /* @__PURE__ */ Object.create(null), t.AudioStreams = /* @__PURE__ */ Object.create(null), t.VideoStreams = /* @__PURE__ */ Object.create(null), t.TrackingStreams = /* @__PURE__ */ Object.create(null), t.SpaceId = "", t.ChannelInstanceId = "", t.FirstUserId = "", t.ChannelUrl = "", t.ChannelId = "", t.PrimaryUserId = "", t.OrganisationName = "", t.SpaceName = "", t.ChannelName = "", t.SessionId = "", t.
|
|
1925
|
+
return t.Clients = /* @__PURE__ */ Object.create(null), t.UIStreams = /* @__PURE__ */ Object.create(null), t.AudioStreams = /* @__PURE__ */ Object.create(null), t.VideoStreams = /* @__PURE__ */ Object.create(null), t.TrackingStreams = /* @__PURE__ */ Object.create(null), t.SpaceId = "", t.ChannelInstanceId = "", t.FirstUserId = "", t.ChannelUrl = "", t.ChannelId = "", t.PrimaryUserId = "", t.OrganisationName = "", t.SpaceName = "", t.ChannelName = "", t.SessionId = "", t.RunnerType = "", t.BootType = "", t.PublicAccess = !1, t.DebugMode = !1, t.IsGitSource = !1, t.Functions = /* @__PURE__ */ Object.create(null), t;
|
|
1926
1926
|
}
|
|
1927
|
-
function
|
|
1927
|
+
function vo(t, e) {
|
|
1928
1928
|
const r = z.create(t);
|
|
1929
|
-
return
|
|
1929
|
+
return Po(r, e);
|
|
1930
1930
|
}
|
|
1931
|
-
function
|
|
1932
|
-
const r = e ??
|
|
1933
|
-
return or(r),
|
|
1931
|
+
function Po(t, e) {
|
|
1932
|
+
const r = e ?? Lo();
|
|
1933
|
+
return or(r), Fo(t, r), r;
|
|
1934
1934
|
}
|
|
1935
|
-
function
|
|
1935
|
+
function Fo(t, e) {
|
|
1936
1936
|
let r;
|
|
1937
1937
|
for (; (r = t.next()) !== null; )
|
|
1938
1938
|
switch (r.fieldId) {
|
|
1939
1939
|
case fo: {
|
|
1940
1940
|
if (r.isNull) throw new Error();
|
|
1941
|
-
e.
|
|
1941
|
+
e.IsGitSource = r.asBool();
|
|
1942
1942
|
break;
|
|
1943
1943
|
}
|
|
1944
1944
|
case Eo: {
|
|
1945
1945
|
if (r.isNull) throw new Error();
|
|
1946
|
-
e.
|
|
1946
|
+
e.FirstUserId = r.asString();
|
|
1947
1947
|
break;
|
|
1948
1948
|
}
|
|
1949
1949
|
case po: {
|
|
1950
1950
|
if (r.isNull) throw new Error();
|
|
1951
|
-
e.
|
|
1951
|
+
e.Clients = Go(r.asDictionary());
|
|
1952
1952
|
break;
|
|
1953
1953
|
}
|
|
1954
1954
|
case Io: {
|
|
1955
1955
|
if (r.isNull) throw new Error();
|
|
1956
|
-
e.
|
|
1956
|
+
e.TrackingStreams = xo(r.asDictionary());
|
|
1957
1957
|
break;
|
|
1958
1958
|
}
|
|
1959
1959
|
case mo: {
|
|
1960
1960
|
if (r.isNull) throw new Error();
|
|
1961
|
-
e.
|
|
1961
|
+
e.ChannelId = r.asString();
|
|
1962
1962
|
break;
|
|
1963
1963
|
}
|
|
1964
1964
|
case _o: {
|
|
1965
1965
|
if (r.isNull) throw new Error();
|
|
1966
|
-
e.
|
|
1966
|
+
e.SessionId = r.asString();
|
|
1967
1967
|
break;
|
|
1968
1968
|
}
|
|
1969
1969
|
case To: {
|
|
1970
1970
|
if (r.isNull) throw new Error();
|
|
1971
|
-
e.
|
|
1971
|
+
e.ChannelUrl = r.asString();
|
|
1972
1972
|
break;
|
|
1973
1973
|
}
|
|
1974
1974
|
case So: {
|
|
1975
1975
|
if (r.isNull) throw new Error();
|
|
1976
|
-
e.
|
|
1976
|
+
e.ChannelName = r.asString();
|
|
1977
1977
|
break;
|
|
1978
1978
|
}
|
|
1979
1979
|
case wo: {
|
|
1980
1980
|
if (r.isNull) throw new Error();
|
|
1981
|
-
e.
|
|
1981
|
+
e.PublicAccess = r.asBool();
|
|
1982
1982
|
break;
|
|
1983
1983
|
}
|
|
1984
1984
|
case Ao: {
|
|
1985
1985
|
if (r.isNull) throw new Error();
|
|
1986
|
-
e.
|
|
1986
|
+
e.OrganisationName = r.asString();
|
|
1987
1987
|
break;
|
|
1988
1988
|
}
|
|
1989
1989
|
case yo: {
|
|
1990
1990
|
if (r.isNull) throw new Error();
|
|
1991
|
-
e.
|
|
1991
|
+
e.DebugMode = r.asBool();
|
|
1992
1992
|
break;
|
|
1993
1993
|
}
|
|
1994
1994
|
case No: {
|
|
1995
1995
|
if (r.isNull) throw new Error();
|
|
1996
|
-
e.
|
|
1996
|
+
e.RunnerType = r.asString();
|
|
1997
1997
|
break;
|
|
1998
1998
|
}
|
|
1999
1999
|
case go: {
|
|
2000
2000
|
if (r.isNull) throw new Error();
|
|
2001
|
-
e.
|
|
2001
|
+
e.Functions = Vo(r.asDictionary());
|
|
2002
2002
|
break;
|
|
2003
2003
|
}
|
|
2004
2004
|
case Co: {
|
|
2005
2005
|
if (r.isNull) throw new Error();
|
|
2006
|
-
e.
|
|
2006
|
+
e.UIStreams = Wo(r.asDictionary());
|
|
2007
2007
|
break;
|
|
2008
2008
|
}
|
|
2009
2009
|
case Ro: {
|
|
2010
2010
|
if (r.isNull) throw new Error();
|
|
2011
|
-
e.
|
|
2011
|
+
e.SpaceId = r.asString();
|
|
2012
2012
|
break;
|
|
2013
2013
|
}
|
|
2014
2014
|
case bo: {
|
|
2015
2015
|
if (r.isNull) throw new Error();
|
|
2016
|
-
e.
|
|
2016
|
+
e.PrimaryUserId = r.asString();
|
|
2017
2017
|
break;
|
|
2018
2018
|
}
|
|
2019
2019
|
case ko: {
|
|
2020
|
+
if (r.isNull) throw new Error();
|
|
2021
|
+
e.BootType = r.asString();
|
|
2022
|
+
break;
|
|
2023
|
+
}
|
|
2024
|
+
case Uo: {
|
|
2025
|
+
if (r.isNull) throw new Error();
|
|
2026
|
+
e.ChannelInstanceId = r.asString();
|
|
2027
|
+
break;
|
|
2028
|
+
}
|
|
2029
|
+
case Do: {
|
|
2030
|
+
if (r.isNull) throw new Error();
|
|
2031
|
+
e.AudioStreams = Ho(r.asDictionary());
|
|
2032
|
+
break;
|
|
2033
|
+
}
|
|
2034
|
+
case Mo: {
|
|
2035
|
+
if (r.isNull) throw new Error();
|
|
2036
|
+
e.VideoStreams = $o(r.asDictionary());
|
|
2037
|
+
break;
|
|
2038
|
+
}
|
|
2039
|
+
case Oo: {
|
|
2020
2040
|
if (r.isNull) throw new Error();
|
|
2021
2041
|
e.SpaceName = r.asString();
|
|
2022
2042
|
break;
|
|
2023
2043
|
}
|
|
2024
2044
|
}
|
|
2025
2045
|
}
|
|
2026
|
-
function
|
|
2046
|
+
function Bo(t, e) {
|
|
2027
2047
|
const r = Me(t, ho, uo);
|
|
2028
|
-
return
|
|
2048
|
+
return vo(r, e);
|
|
2029
2049
|
}
|
|
2030
|
-
function
|
|
2050
|
+
function Go(t) {
|
|
2031
2051
|
const e = /* @__PURE__ */ Object.create(null);
|
|
2032
2052
|
let r;
|
|
2033
2053
|
for (; (r = t.next()) !== null; ) {
|
|
@@ -2036,233 +2056,233 @@ function vo(t) {
|
|
|
2036
2056
|
}
|
|
2037
2057
|
return e;
|
|
2038
2058
|
}
|
|
2039
|
-
function
|
|
2059
|
+
function xo(t) {
|
|
2040
2060
|
const e = /* @__PURE__ */ Object.create(null);
|
|
2041
2061
|
let r;
|
|
2042
2062
|
for (; (r = t.next()) !== null; ) {
|
|
2043
2063
|
const n = r.key.asString();
|
|
2044
|
-
e[n] =
|
|
2064
|
+
e[n] = _a(r.value.asObject());
|
|
2045
2065
|
}
|
|
2046
2066
|
return e;
|
|
2047
2067
|
}
|
|
2048
|
-
function
|
|
2068
|
+
function Vo(t) {
|
|
2049
2069
|
const e = /* @__PURE__ */ Object.create(null);
|
|
2050
2070
|
let r;
|
|
2051
2071
|
for (; (r = t.next()) !== null; ) {
|
|
2052
2072
|
const n = r.key.asInt32();
|
|
2053
|
-
e[n] =
|
|
2073
|
+
e[n] = Ko(r.value.asArray());
|
|
2054
2074
|
}
|
|
2055
2075
|
return e;
|
|
2056
2076
|
}
|
|
2057
|
-
function
|
|
2077
|
+
function Wo(t) {
|
|
2058
2078
|
const e = /* @__PURE__ */ Object.create(null);
|
|
2059
2079
|
let r;
|
|
2060
2080
|
for (; (r = t.next()) !== null; ) {
|
|
2061
2081
|
const n = r.key.asString();
|
|
2062
|
-
e[n] =
|
|
2082
|
+
e[n] = Qo(r.value.asObject());
|
|
2063
2083
|
}
|
|
2064
2084
|
return e;
|
|
2065
2085
|
}
|
|
2066
|
-
function
|
|
2086
|
+
function Ho(t) {
|
|
2067
2087
|
const e = /* @__PURE__ */ Object.create(null);
|
|
2068
2088
|
let r;
|
|
2069
2089
|
for (; (r = t.next()) !== null; ) {
|
|
2070
2090
|
const n = r.key.asString();
|
|
2071
|
-
e[n] =
|
|
2091
|
+
e[n] = sa(r.value.asObject());
|
|
2072
2092
|
}
|
|
2073
2093
|
return e;
|
|
2074
2094
|
}
|
|
2075
|
-
function
|
|
2095
|
+
function $o(t) {
|
|
2076
2096
|
const e = /* @__PURE__ */ Object.create(null);
|
|
2077
2097
|
let r;
|
|
2078
2098
|
for (; (r = t.next()) !== null; ) {
|
|
2079
2099
|
const n = r.key.asString();
|
|
2080
|
-
e[n] =
|
|
2100
|
+
e[n] = ha(r.value.asObject());
|
|
2081
2101
|
}
|
|
2082
2102
|
return e;
|
|
2083
2103
|
}
|
|
2084
|
-
function
|
|
2104
|
+
function Ko(t) {
|
|
2085
2105
|
const e = [];
|
|
2086
2106
|
let r;
|
|
2087
2107
|
for (; (r = t.next()) !== null; )
|
|
2088
2108
|
e.push(mi(r.asObject()));
|
|
2089
2109
|
return e;
|
|
2090
2110
|
}
|
|
2091
|
-
const
|
|
2092
|
-
function
|
|
2111
|
+
const Yo = 161083277, jo = 325678206, zo = 3469892363, Xo = 3645544153;
|
|
2112
|
+
function Jo(t) {
|
|
2093
2113
|
const e = {};
|
|
2094
2114
|
return ar(e), e;
|
|
2095
2115
|
}
|
|
2096
2116
|
function ar(t) {
|
|
2097
2117
|
return t.StreamId = "", t.ClientSessionId = 0, t.TrackId = 0, t.Info = rr(), t;
|
|
2098
2118
|
}
|
|
2099
|
-
function
|
|
2100
|
-
const r = e ??
|
|
2101
|
-
return ar(r),
|
|
2119
|
+
function Qo(t, e) {
|
|
2120
|
+
const r = e ?? Jo();
|
|
2121
|
+
return ar(r), Zo(t, r), r;
|
|
2102
2122
|
}
|
|
2103
|
-
function
|
|
2123
|
+
function Zo(t, e) {
|
|
2104
2124
|
let r;
|
|
2105
2125
|
for (; (r = t.next()) !== null; )
|
|
2106
2126
|
switch (r.fieldId) {
|
|
2107
|
-
case
|
|
2127
|
+
case Yo: {
|
|
2108
2128
|
if (r.isNull) throw new Error();
|
|
2109
2129
|
e.StreamId = r.asString();
|
|
2110
2130
|
break;
|
|
2111
2131
|
}
|
|
2112
|
-
case
|
|
2132
|
+
case jo: {
|
|
2113
2133
|
if (r.isNull) throw new Error();
|
|
2114
2134
|
e.ClientSessionId = r.asInt32();
|
|
2115
2135
|
break;
|
|
2116
2136
|
}
|
|
2117
|
-
case
|
|
2137
|
+
case zo: {
|
|
2118
2138
|
if (r.isNull) throw new Error();
|
|
2119
2139
|
e.TrackId = r.asInt32();
|
|
2120
2140
|
break;
|
|
2121
2141
|
}
|
|
2122
|
-
case
|
|
2142
|
+
case Xo: {
|
|
2123
2143
|
if (r.isNull) throw new Error();
|
|
2124
2144
|
e.Info = qi(r.asObject());
|
|
2125
2145
|
break;
|
|
2126
2146
|
}
|
|
2127
2147
|
}
|
|
2128
2148
|
}
|
|
2129
|
-
const
|
|
2130
|
-
function
|
|
2149
|
+
const qo = 161083277, ea = 325678206, ta = 3469892363, ra = 3645544153;
|
|
2150
|
+
function na(t) {
|
|
2131
2151
|
const e = {};
|
|
2132
2152
|
return cr(e), e;
|
|
2133
2153
|
}
|
|
2134
2154
|
function cr(t) {
|
|
2135
2155
|
return t.StreamId = "", t.ClientSessionId = 0, t.TrackId = 0, t.Info = _t(), t;
|
|
2136
2156
|
}
|
|
2137
|
-
function
|
|
2138
|
-
const r = e ??
|
|
2139
|
-
return cr(r),
|
|
2157
|
+
function sa(t, e) {
|
|
2158
|
+
const r = e ?? na();
|
|
2159
|
+
return cr(r), ia(t, r), r;
|
|
2140
2160
|
}
|
|
2141
|
-
function
|
|
2161
|
+
function ia(t, e) {
|
|
2142
2162
|
let r;
|
|
2143
2163
|
for (; (r = t.next()) !== null; )
|
|
2144
2164
|
switch (r.fieldId) {
|
|
2145
|
-
case
|
|
2165
|
+
case qo: {
|
|
2146
2166
|
if (r.isNull) throw new Error();
|
|
2147
2167
|
e.StreamId = r.asString();
|
|
2148
2168
|
break;
|
|
2149
2169
|
}
|
|
2150
|
-
case
|
|
2170
|
+
case ea: {
|
|
2151
2171
|
if (r.isNull) throw new Error();
|
|
2152
2172
|
e.ClientSessionId = r.asInt32();
|
|
2153
2173
|
break;
|
|
2154
2174
|
}
|
|
2155
|
-
case
|
|
2175
|
+
case ta: {
|
|
2156
2176
|
if (r.isNull) throw new Error();
|
|
2157
2177
|
e.TrackId = r.asInt32();
|
|
2158
2178
|
break;
|
|
2159
2179
|
}
|
|
2160
|
-
case
|
|
2180
|
+
case ra: {
|
|
2161
2181
|
if (r.isNull) throw new Error();
|
|
2162
2182
|
e.Info = In(r.asObject());
|
|
2163
2183
|
break;
|
|
2164
2184
|
}
|
|
2165
2185
|
}
|
|
2166
2186
|
}
|
|
2167
|
-
const
|
|
2168
|
-
function
|
|
2187
|
+
const oa = 161083277, aa = 325678206, ca = 3469892363, la = 3645544153;
|
|
2188
|
+
function ua(t) {
|
|
2169
2189
|
const e = {};
|
|
2170
2190
|
return lr(e), e;
|
|
2171
2191
|
}
|
|
2172
2192
|
function lr(t) {
|
|
2173
2193
|
return t.StreamId = "", t.ClientSessionId = 0, t.TrackId = 0, t.Info = sr(), t;
|
|
2174
2194
|
}
|
|
2175
|
-
function
|
|
2176
|
-
const r = e ??
|
|
2177
|
-
return lr(r),
|
|
2195
|
+
function ha(t, e) {
|
|
2196
|
+
const r = e ?? ua();
|
|
2197
|
+
return lr(r), da(t, r), r;
|
|
2178
2198
|
}
|
|
2179
|
-
function
|
|
2199
|
+
function da(t, e) {
|
|
2180
2200
|
let r;
|
|
2181
2201
|
for (; (r = t.next()) !== null; )
|
|
2182
2202
|
switch (r.fieldId) {
|
|
2183
|
-
case
|
|
2203
|
+
case oa: {
|
|
2184
2204
|
if (r.isNull) throw new Error();
|
|
2185
2205
|
e.StreamId = r.asString();
|
|
2186
2206
|
break;
|
|
2187
2207
|
}
|
|
2188
|
-
case
|
|
2208
|
+
case aa: {
|
|
2189
2209
|
if (r.isNull) throw new Error();
|
|
2190
2210
|
e.ClientSessionId = r.asInt32();
|
|
2191
2211
|
break;
|
|
2192
2212
|
}
|
|
2193
|
-
case
|
|
2213
|
+
case ca: {
|
|
2194
2214
|
if (r.isNull) throw new Error();
|
|
2195
2215
|
e.TrackId = r.asInt32();
|
|
2196
2216
|
break;
|
|
2197
2217
|
}
|
|
2198
|
-
case
|
|
2218
|
+
case la: {
|
|
2199
2219
|
if (r.isNull) throw new Error();
|
|
2200
2220
|
e.Info = co(r.asObject());
|
|
2201
2221
|
break;
|
|
2202
2222
|
}
|
|
2203
2223
|
}
|
|
2204
2224
|
}
|
|
2205
|
-
const
|
|
2206
|
-
function
|
|
2225
|
+
const fa = 161083277, Ea = 325678206, pa = 3469892363, Ia = 3645544153;
|
|
2226
|
+
function ma(t) {
|
|
2207
2227
|
const e = {};
|
|
2208
2228
|
return ur(e), e;
|
|
2209
2229
|
}
|
|
2210
2230
|
function ur(t) {
|
|
2211
2231
|
return t.StreamId = "", t.ClientSessionId = 0, t.TrackId = 0, t.Info = er(), t;
|
|
2212
2232
|
}
|
|
2213
|
-
function
|
|
2214
|
-
const r = e ??
|
|
2215
|
-
return ur(r),
|
|
2233
|
+
function _a(t, e) {
|
|
2234
|
+
const r = e ?? ma();
|
|
2235
|
+
return ur(r), Ta(t, r), r;
|
|
2216
2236
|
}
|
|
2217
|
-
function
|
|
2237
|
+
function Ta(t, e) {
|
|
2218
2238
|
let r;
|
|
2219
2239
|
for (; (r = t.next()) !== null; )
|
|
2220
2240
|
switch (r.fieldId) {
|
|
2221
|
-
case
|
|
2241
|
+
case fa: {
|
|
2222
2242
|
if (r.isNull) throw new Error();
|
|
2223
2243
|
e.StreamId = r.asString();
|
|
2224
2244
|
break;
|
|
2225
2245
|
}
|
|
2226
|
-
case
|
|
2246
|
+
case Ea: {
|
|
2227
2247
|
if (r.isNull) throw new Error();
|
|
2228
2248
|
e.ClientSessionId = r.asInt32();
|
|
2229
2249
|
break;
|
|
2230
2250
|
}
|
|
2231
|
-
case
|
|
2251
|
+
case pa: {
|
|
2232
2252
|
if (r.isNull) throw new Error();
|
|
2233
2253
|
e.TrackId = r.asInt32();
|
|
2234
2254
|
break;
|
|
2235
2255
|
}
|
|
2236
|
-
case
|
|
2256
|
+
case Ia: {
|
|
2237
2257
|
if (r.isNull) throw new Error();
|
|
2238
2258
|
e.Info = Xi(r.asObject());
|
|
2239
2259
|
break;
|
|
2240
2260
|
}
|
|
2241
2261
|
}
|
|
2242
2262
|
}
|
|
2243
|
-
const hr = 1,
|
|
2263
|
+
const hr = 1, Sa = 131074;
|
|
2244
2264
|
function dr(t) {
|
|
2245
2265
|
return {};
|
|
2246
2266
|
}
|
|
2247
|
-
function
|
|
2267
|
+
function wa(t) {
|
|
2248
2268
|
return new D(hr).finish();
|
|
2249
2269
|
}
|
|
2250
2270
|
function fr(t, e, r) {
|
|
2251
|
-
const n =
|
|
2252
|
-
return
|
|
2271
|
+
const n = wa();
|
|
2272
|
+
return F(Sa, n, hr, e, r);
|
|
2253
2273
|
}
|
|
2254
|
-
const Er = 1,
|
|
2255
|
-
function
|
|
2274
|
+
const Er = 1, Aa = 8388612;
|
|
2275
|
+
function ya(t) {
|
|
2256
2276
|
return {};
|
|
2257
2277
|
}
|
|
2258
|
-
function
|
|
2278
|
+
function Na(t) {
|
|
2259
2279
|
return new D(Er).finish();
|
|
2260
2280
|
}
|
|
2261
|
-
function
|
|
2262
|
-
const n =
|
|
2263
|
-
return
|
|
2281
|
+
function ga(t, e, r) {
|
|
2282
|
+
const n = Na();
|
|
2283
|
+
return F(Aa, n, Er, e, r);
|
|
2264
2284
|
}
|
|
2265
|
-
function
|
|
2285
|
+
function Ca(t) {
|
|
2266
2286
|
return new Worker(
|
|
2267
2287
|
"" + new URL("assets/protocol-worker-DKSTqFKg.js", import.meta.url).href,
|
|
2268
2288
|
{
|
|
@@ -2291,27 +2311,27 @@ class We extends W {
|
|
|
2291
2311
|
super(`No keepalive received within ${e}ms`), this.name = "KeepaliveTimeoutError";
|
|
2292
2312
|
}
|
|
2293
2313
|
}
|
|
2294
|
-
class
|
|
2314
|
+
class Ra extends Ve {
|
|
2295
2315
|
constructor(e) {
|
|
2296
2316
|
super(`Maximum reconnection attempts (${e}) exceeded`), this.name = "MaxRetriesExceededError";
|
|
2297
2317
|
}
|
|
2298
2318
|
}
|
|
2299
|
-
class
|
|
2319
|
+
class ba extends y {
|
|
2300
2320
|
constructor(e) {
|
|
2301
2321
|
super(`Channel provisioning timeout after ${e}ms`), this.name = "ProvisioningTimeoutError";
|
|
2302
2322
|
}
|
|
2303
2323
|
}
|
|
2304
|
-
class
|
|
2324
|
+
class Tl extends y {
|
|
2305
2325
|
constructor(e) {
|
|
2306
2326
|
super(`Channel not found: ${e}`), this.name = "ChannelNotFoundError";
|
|
2307
2327
|
}
|
|
2308
2328
|
}
|
|
2309
|
-
class
|
|
2329
|
+
class Sl extends y {
|
|
2310
2330
|
constructor(e) {
|
|
2311
2331
|
super(`Space not found for domain: ${e}`), this.name = "SpaceNotFoundError";
|
|
2312
2332
|
}
|
|
2313
2333
|
}
|
|
2314
|
-
class
|
|
2334
|
+
class wl extends y {
|
|
2315
2335
|
constructor() {
|
|
2316
2336
|
super("No channels available in this space"), this.name = "NoChannelsError";
|
|
2317
2337
|
}
|
|
@@ -2332,30 +2352,30 @@ function pr(t, e) {
|
|
|
2332
2352
|
}
|
|
2333
2353
|
var Ir = /* @__PURE__ */ ((t) => (t[t.DEBUG = 0] = "DEBUG", t[t.INFO = 1] = "INFO", t[t.WARN = 2] = "WARN", t[t.ERROR = 3] = "ERROR", t[t.NONE = 4] = "NONE", t))(Ir || {});
|
|
2334
2354
|
let He = 1, fe = null;
|
|
2335
|
-
function
|
|
2355
|
+
function Al(t) {
|
|
2336
2356
|
He = t;
|
|
2337
2357
|
}
|
|
2338
|
-
function
|
|
2358
|
+
function yl() {
|
|
2339
2359
|
return He;
|
|
2340
2360
|
}
|
|
2341
|
-
function
|
|
2361
|
+
function ka(t) {
|
|
2342
2362
|
fe = t;
|
|
2343
2363
|
}
|
|
2344
|
-
function
|
|
2364
|
+
function Nl() {
|
|
2345
2365
|
return fe;
|
|
2346
2366
|
}
|
|
2347
|
-
const
|
|
2367
|
+
const Ua = {
|
|
2348
2368
|
0: "DEBUG",
|
|
2349
2369
|
1: "INFO",
|
|
2350
2370
|
2: "WARN",
|
|
2351
2371
|
3: "ERROR",
|
|
2352
2372
|
4: "NONE"
|
|
2353
2373
|
};
|
|
2354
|
-
function
|
|
2374
|
+
function Da(t, e) {
|
|
2355
2375
|
return `[${t}] ${e}`;
|
|
2356
2376
|
}
|
|
2357
2377
|
function ie(t, e, r, n) {
|
|
2358
|
-
const s = (/* @__PURE__ */ new Date()).toISOString(), i =
|
|
2378
|
+
const s = (/* @__PURE__ */ new Date()).toISOString(), i = Ua[t];
|
|
2359
2379
|
if (fe && fe({
|
|
2360
2380
|
timestamp: s,
|
|
2361
2381
|
level: t,
|
|
@@ -2364,7 +2384,7 @@ function ie(t, e, r, n) {
|
|
|
2364
2384
|
message: r,
|
|
2365
2385
|
args: n
|
|
2366
2386
|
}), He <= t) {
|
|
2367
|
-
const o =
|
|
2387
|
+
const o = Da(e, r);
|
|
2368
2388
|
switch (t) {
|
|
2369
2389
|
case 0:
|
|
2370
2390
|
console.debug(o, ...n);
|
|
@@ -2397,8 +2417,8 @@ function L(t) {
|
|
|
2397
2417
|
}
|
|
2398
2418
|
};
|
|
2399
2419
|
}
|
|
2400
|
-
const oe = L("WebSocketTransport"),
|
|
2401
|
-
class
|
|
2420
|
+
const oe = L("WebSocketTransport"), Ma = 1e4;
|
|
2421
|
+
class Oa {
|
|
2402
2422
|
ws = null;
|
|
2403
2423
|
keepaliveTimeout = null;
|
|
2404
2424
|
// Pre-allocated keepalive response message to avoid allocation per keepalive
|
|
@@ -2425,7 +2445,7 @@ class ka {
|
|
|
2425
2445
|
clearTimeout(c), this.ws && (this.ws.onopen = null, this.ws.onerror = null, this.ws.onclose = null, this.ws.onmessage = null);
|
|
2426
2446
|
}, c = setTimeout(() => {
|
|
2427
2447
|
o || (o = !0, a(), this.ws?.close(), s(new W("WebSocket connection timeout")));
|
|
2428
|
-
},
|
|
2448
|
+
}, Ma);
|
|
2429
2449
|
this.ws.onopen = () => {
|
|
2430
2450
|
i = !0, clearTimeout(c), this.ws.send(r), this.resetKeepaliveTimeout(), o || (o = !0, n());
|
|
2431
2451
|
}, this.ws.onerror = () => {
|
|
@@ -2474,11 +2494,11 @@ class ka {
|
|
|
2474
2494
|
this.keepaliveTimeout && (clearTimeout(this.keepaliveTimeout), this.keepaliveTimeout = null);
|
|
2475
2495
|
}
|
|
2476
2496
|
}
|
|
2477
|
-
const B = L("WebTransportTransport"), Qe = 4,
|
|
2497
|
+
const B = L("WebTransportTransport"), Qe = 4, La = 65536;
|
|
2478
2498
|
function mr() {
|
|
2479
2499
|
return typeof WebTransport < "u";
|
|
2480
2500
|
}
|
|
2481
|
-
class
|
|
2501
|
+
class va {
|
|
2482
2502
|
transport = null;
|
|
2483
2503
|
stream = null;
|
|
2484
2504
|
reader = null;
|
|
@@ -2486,7 +2506,7 @@ class Da {
|
|
|
2486
2506
|
keepaliveTimeout = null;
|
|
2487
2507
|
readLoopActive = !1;
|
|
2488
2508
|
// Grow-only receive buffer with offset/length tracking to minimize allocations
|
|
2489
|
-
receiveBuffer = new Uint8Array(
|
|
2509
|
+
receiveBuffer = new Uint8Array(La);
|
|
2490
2510
|
receiveBufferOffset = 0;
|
|
2491
2511
|
receiveBufferLength = 0;
|
|
2492
2512
|
// Cached DataView to avoid allocation per message
|
|
@@ -2641,7 +2661,7 @@ class Da {
|
|
|
2641
2661
|
}
|
|
2642
2662
|
}
|
|
2643
2663
|
const ee = L("Channel");
|
|
2644
|
-
class
|
|
2664
|
+
class Pa {
|
|
2645
2665
|
state = "disconnected";
|
|
2646
2666
|
transport = null;
|
|
2647
2667
|
config;
|
|
@@ -2718,13 +2738,13 @@ class Ma {
|
|
|
2718
2738
|
switch (e.Type) {
|
|
2719
2739
|
case k.WebSocket:
|
|
2720
2740
|
case k.WebSocketProxy:
|
|
2721
|
-
this.transport = new
|
|
2741
|
+
this.transport = new Oa(r);
|
|
2722
2742
|
break;
|
|
2723
2743
|
case k.WebTransport:
|
|
2724
2744
|
case k.WebTransportProxy:
|
|
2725
2745
|
if (!mr())
|
|
2726
2746
|
throw new Error("WebTransport is not supported in this browser");
|
|
2727
|
-
this.transport = new
|
|
2747
|
+
this.transport = new va(r);
|
|
2728
2748
|
break;
|
|
2729
2749
|
default:
|
|
2730
2750
|
throw new Error(`Unsupported entrypoint type: ${k[e.Type]}`);
|
|
@@ -2766,7 +2786,7 @@ class Ma {
|
|
|
2766
2786
|
}
|
|
2767
2787
|
}
|
|
2768
2788
|
const G = L("ChannelManager");
|
|
2769
|
-
class
|
|
2789
|
+
class Fa {
|
|
2770
2790
|
channels = /* @__PURE__ */ new Map();
|
|
2771
2791
|
// keyed by opcode group
|
|
2772
2792
|
activeType = null;
|
|
@@ -2868,7 +2888,7 @@ class Oa {
|
|
|
2868
2888
|
* Connect a single channel.
|
|
2869
2889
|
*/
|
|
2870
2890
|
async connectChannel(e) {
|
|
2871
|
-
const r = new
|
|
2891
|
+
const r = new Pa({
|
|
2872
2892
|
entrypoint: e,
|
|
2873
2893
|
sessionId: this.config.sessionId,
|
|
2874
2894
|
keepaliveTimeoutMs: this.config.keepaliveTimeoutMs,
|
|
@@ -2923,7 +2943,7 @@ class Oa {
|
|
|
2923
2943
|
if (!this.shouldReconnect)
|
|
2924
2944
|
return;
|
|
2925
2945
|
if (this.reconnectAttempts >= this.config.maxReconnectAttempts) {
|
|
2926
|
-
G.error(`Max reconnect attempts (${this.config.maxReconnectAttempts}) reached`), this.setState("offline"), this.config.onError?.(new
|
|
2946
|
+
G.error(`Max reconnect attempts (${this.config.maxReconnectAttempts}) reached`), this.setState("offline"), this.config.onError?.(new Ra(this.config.maxReconnectAttempts));
|
|
2927
2947
|
return;
|
|
2928
2948
|
}
|
|
2929
2949
|
this.setState("reconnecting"), this.reconnectAttempts++;
|
|
@@ -2950,7 +2970,7 @@ class Oa {
|
|
|
2950
2970
|
this.state !== e && (this.state = e, this.config.onStateChange?.(e));
|
|
2951
2971
|
}
|
|
2952
2972
|
}
|
|
2953
|
-
const
|
|
2973
|
+
const Ba = 5e3, Ga = 3e4, Ze = 35e3, qe = 500, et = 6, _r = 6e4, Ce = "ikon_device_id";
|
|
2954
2974
|
function $e() {
|
|
2955
2975
|
if (typeof window > "u" || typeof localStorage > "u")
|
|
2956
2976
|
return crypto.randomUUID();
|
|
@@ -2961,14 +2981,14 @@ function $e() {
|
|
|
2961
2981
|
return crypto.randomUUID();
|
|
2962
2982
|
}
|
|
2963
2983
|
}
|
|
2964
|
-
function
|
|
2984
|
+
function gl() {
|
|
2965
2985
|
if (!(typeof localStorage > "u"))
|
|
2966
2986
|
try {
|
|
2967
2987
|
localStorage.removeItem(Ce);
|
|
2968
2988
|
} catch {
|
|
2969
2989
|
}
|
|
2970
2990
|
}
|
|
2971
|
-
function
|
|
2991
|
+
function Cl(t) {
|
|
2972
2992
|
try {
|
|
2973
2993
|
const e = t.split(".");
|
|
2974
2994
|
return e.length !== 3 ? null : JSON.parse(atob(e[1])).id ?? null;
|
|
@@ -2976,22 +2996,22 @@ function Al(t) {
|
|
|
2976
2996
|
return null;
|
|
2977
2997
|
}
|
|
2978
2998
|
}
|
|
2979
|
-
const Ee = {}, Re = "https://api.prod.ikon.live", pe = "https://api.dev.ikon.live", tt = "https://auth.ikonai.com", rt = "https://auth.dev.ikonai.com",
|
|
2999
|
+
const Ee = {}, Re = "https://api.prod.ikon.live", pe = "https://api.dev.ikon.live", tt = "https://auth.ikonai.com", rt = "https://auth.dev.ikonai.com", Rl = "https://auth.ikonai.com";
|
|
2980
3000
|
function Tr(t) {
|
|
2981
3001
|
return t === "development" ? pe : Re;
|
|
2982
3002
|
}
|
|
2983
|
-
function
|
|
3003
|
+
function bl() {
|
|
2984
3004
|
const t = typeof import.meta < "u" ? Ee?.VITE_IKON_BACKEND_URL : void 0;
|
|
2985
3005
|
return t || (typeof window > "u" ? Re : !Ke() || window.location.hostname.includes(".dev.") ? pe : Re);
|
|
2986
3006
|
}
|
|
2987
|
-
function
|
|
3007
|
+
function kl() {
|
|
2988
3008
|
const t = typeof import.meta < "u" ? Ee?.VITE_IKON_BACKEND_TYPE : void 0;
|
|
2989
3009
|
if (t === "development" || t === "production")
|
|
2990
3010
|
return t;
|
|
2991
3011
|
const e = typeof import.meta < "u" ? Ee?.VITE_IKON_BACKEND_URL : void 0;
|
|
2992
3012
|
return e ? e.includes(".dev.") ? "development" : "production" : typeof window > "u" ? "production" : Ke() ? window.location.hostname.includes(".dev.") ? "development" : "production" : "development";
|
|
2993
3013
|
}
|
|
2994
|
-
function
|
|
3014
|
+
function Ul() {
|
|
2995
3015
|
const t = typeof import.meta < "u" ? Ee?.VITE_IKON_AUTH_URL : void 0;
|
|
2996
3016
|
return t || (typeof window > "u" ? tt : !Ke() || window.location.hostname.includes(".dev.") ? rt : tt);
|
|
2997
3017
|
}
|
|
@@ -3003,8 +3023,8 @@ function Sr() {
|
|
|
3003
3023
|
e[r] = n;
|
|
3004
3024
|
return e;
|
|
3005
3025
|
}
|
|
3006
|
-
const
|
|
3007
|
-
function
|
|
3026
|
+
const xa = ["ikon_token", "ikon_provider", "error"];
|
|
3027
|
+
function Dl() {
|
|
3008
3028
|
if (typeof window > "u")
|
|
3009
3029
|
return { parameters: {} };
|
|
3010
3030
|
const t = window.location.pathname;
|
|
@@ -3016,7 +3036,7 @@ function Rl() {
|
|
|
3016
3036
|
throw new Error("URL cannot contain both /s/[sessionId] and /c/[channelKey]");
|
|
3017
3037
|
const i = Sr(), o = {};
|
|
3018
3038
|
for (const [a, c] of Object.entries(i))
|
|
3019
|
-
|
|
3039
|
+
xa.includes(a) || (o[a] = c);
|
|
3020
3040
|
return { sessionId: e, channelKey: r, parameters: o };
|
|
3021
3041
|
}
|
|
3022
3042
|
function Ke() {
|
|
@@ -3031,8 +3051,8 @@ function Ke() {
|
|
|
3031
3051
|
}
|
|
3032
3052
|
return !0;
|
|
3033
3053
|
}
|
|
3034
|
-
const Ie = L("Authenticator"), j = S.GROUP_CORE | S.GROUP_KEEPALIVE | S.GROUP_EVENTS | S.GROUP_ACTIONS | S.GROUP_UI | S.GROUP_AUDIO | S.GROUP_VIDEO,
|
|
3035
|
-
async function
|
|
3054
|
+
const Ie = L("Authenticator"), j = S.GROUP_CORE | S.GROUP_KEEPALIVE | S.GROUP_EVENTS | S.GROUP_ACTIONS | S.GROUP_UI | S.GROUP_AUDIO | S.GROUP_VIDEO, Va = 1e3, Wa = 5e3;
|
|
3055
|
+
async function Ha(t) {
|
|
3036
3056
|
try {
|
|
3037
3057
|
const e = await fetch(`${pe}/users/me`, {
|
|
3038
3058
|
credentials: "include",
|
|
@@ -3068,7 +3088,7 @@ async function Ar(t, e, r, n, s, i, o) {
|
|
|
3068
3088
|
}
|
|
3069
3089
|
return await u.json();
|
|
3070
3090
|
}
|
|
3071
|
-
async function
|
|
3091
|
+
async function $a(t, e, r, n) {
|
|
3072
3092
|
const s = `${t}/rooms/connect`, i = await fetch(s, wr(e, r, n));
|
|
3073
3093
|
if (!i.ok) {
|
|
3074
3094
|
const o = await i.text().catch(() => "Unknown error");
|
|
@@ -3078,17 +3098,17 @@ async function xa(t, e, r, n) {
|
|
|
3078
3098
|
}
|
|
3079
3099
|
async function yr(t, e, r, n, s) {
|
|
3080
3100
|
const i = Date.now();
|
|
3081
|
-
let o =
|
|
3101
|
+
let o = Va;
|
|
3082
3102
|
for (; ; ) {
|
|
3083
3103
|
if (s?.aborted)
|
|
3084
3104
|
throw new y("Connection aborted");
|
|
3085
3105
|
if (Date.now() - i >= r)
|
|
3086
|
-
throw new
|
|
3087
|
-
const c = await
|
|
3106
|
+
throw new ba(r);
|
|
3107
|
+
const c = await $a(t, e, n, s), u = c.state?.toLowerCase();
|
|
3088
3108
|
if (u === "running")
|
|
3089
3109
|
return c;
|
|
3090
3110
|
if (u === "provisioning") {
|
|
3091
|
-
await pr(o, s), o = Math.min(o * 1.5,
|
|
3111
|
+
await pr(o, s), o = Math.min(o * 1.5, Wa);
|
|
3092
3112
|
continue;
|
|
3093
3113
|
}
|
|
3094
3114
|
throw new y(`Unexpected channel state: ${c.state}`);
|
|
@@ -3103,7 +3123,7 @@ async function Ye(t, e) {
|
|
|
3103
3123
|
const n = await r.arrayBuffer(), s = new Uint8Array(n);
|
|
3104
3124
|
return { authResponse: ys(s) };
|
|
3105
3125
|
}
|
|
3106
|
-
function
|
|
3126
|
+
function Ka(t, e) {
|
|
3107
3127
|
return Cs({
|
|
3108
3128
|
ServerSessionId: "",
|
|
3109
3129
|
// Server will fill this in
|
|
@@ -3131,7 +3151,7 @@ function Va(t, e) {
|
|
|
3131
3151
|
Parameters: t.parameters ?? {}
|
|
3132
3152
|
});
|
|
3133
3153
|
}
|
|
3134
|
-
function
|
|
3154
|
+
function Ya(t) {
|
|
3135
3155
|
return {
|
|
3136
3156
|
ServerSessionId: t.ServerSessionId,
|
|
3137
3157
|
ContextType: t.ContextType,
|
|
@@ -3158,13 +3178,13 @@ function Wa(t) {
|
|
|
3158
3178
|
Parameters: t.Parameters
|
|
3159
3179
|
};
|
|
3160
3180
|
}
|
|
3161
|
-
async function
|
|
3181
|
+
async function ja(t, e) {
|
|
3162
3182
|
const r = `https://${t.host}:${t.httpsPort}`;
|
|
3163
3183
|
Ie.debug(`Authenticating with local server: ${r}`);
|
|
3164
3184
|
const s = { ...Sr(), ...t.parameters };
|
|
3165
3185
|
let i = t.userId;
|
|
3166
|
-
i || (i = await
|
|
3167
|
-
const o =
|
|
3186
|
+
i || (i = await Ha(e), i || (i = "local", Ie.warn('Could not determine user ID. Using fallback "local". To fix: either provide userId in config, or log in to the Ikon portal at https://portal.dev.ikon.live')));
|
|
3187
|
+
const o = Ka({ ...t, parameters: s }, i), a = Ya(o), c = await fetch(`${r}/connect-token`, {
|
|
3168
3188
|
method: "POST",
|
|
3169
3189
|
headers: {
|
|
3170
3190
|
"Content-Type": "application/json"
|
|
@@ -3182,7 +3202,7 @@ async function Ha(t, e) {
|
|
|
3182
3202
|
const d = `${r}/connect?token=${encodeURIComponent(f)}`;
|
|
3183
3203
|
return Ye(d, e);
|
|
3184
3204
|
}
|
|
3185
|
-
async function
|
|
3205
|
+
async function za(t, e) {
|
|
3186
3206
|
if (t.sessionId && t.channelKey)
|
|
3187
3207
|
throw new y("Cannot specify both sessionId and channelKey. Use sessionId for precomputed sessions or channelKey to select a channel.");
|
|
3188
3208
|
const r = Tr(t.backendType);
|
|
@@ -3242,7 +3262,7 @@ async function $a(t, e) {
|
|
|
3242
3262
|
const d = f.configuration.url;
|
|
3243
3263
|
return Ye(d, e);
|
|
3244
3264
|
}
|
|
3245
|
-
async function
|
|
3265
|
+
async function Xa(t, e) {
|
|
3246
3266
|
if (t.sessionId && t.channelKey)
|
|
3247
3267
|
throw new y("Cannot specify both sessionId and channelKey. Use sessionId for precomputed sessions or channelKey to select a channel.");
|
|
3248
3268
|
const r = Tr(t.backendType), n = t.token;
|
|
@@ -3283,22 +3303,22 @@ async function Ka(t, e) {
|
|
|
3283
3303
|
const u = c.configuration.url;
|
|
3284
3304
|
return Ye(u, e);
|
|
3285
3305
|
}
|
|
3286
|
-
const Nr = "ikon.theme", be = "ikon.theme-user",
|
|
3306
|
+
const Nr = "ikon.theme", be = "ikon.theme-user", Ja = "ikon.theme-change";
|
|
3287
3307
|
function gr(t) {
|
|
3288
3308
|
typeof document < "u" && document.documentElement && document.documentElement.setAttribute("data-theme", t);
|
|
3289
3309
|
}
|
|
3290
|
-
const
|
|
3310
|
+
const Qa = {
|
|
3291
3311
|
name: "ikon.client.getTheme",
|
|
3292
3312
|
description: "Get the currently selected client theme",
|
|
3293
3313
|
returnType: { kind: "string", nullable: !0 }
|
|
3294
3314
|
};
|
|
3295
|
-
function
|
|
3315
|
+
function Za() {
|
|
3296
3316
|
if (typeof window > "u" || !window.localStorage)
|
|
3297
3317
|
return null;
|
|
3298
3318
|
const t = window.localStorage.getItem(be) ?? window.localStorage.getItem(Nr) ?? "light";
|
|
3299
3319
|
return gr(t), t;
|
|
3300
3320
|
}
|
|
3301
|
-
const
|
|
3321
|
+
const qa = {
|
|
3302
3322
|
name: "ikon.client.setTheme",
|
|
3303
3323
|
description: "Update the client UI theme",
|
|
3304
3324
|
returnType: { kind: "boolean" },
|
|
@@ -3307,7 +3327,7 @@ const Xa = {
|
|
|
3307
3327
|
{ name: "persist", type: { kind: "boolean", nullable: !0 }, description: "Whether to persist as user preference" }
|
|
3308
3328
|
]
|
|
3309
3329
|
};
|
|
3310
|
-
function
|
|
3330
|
+
function ec(t, e) {
|
|
3311
3331
|
if (typeof window > "u" || !window.localStorage || typeof t != "string")
|
|
3312
3332
|
return !1;
|
|
3313
3333
|
const r = t.trim().toLowerCase();
|
|
@@ -3316,40 +3336,40 @@ function Ja(t, e) {
|
|
|
3316
3336
|
const n = e === void 0 ? !0 : !!e, s = window.localStorage;
|
|
3317
3337
|
n ? s.setItem(be, r) : s.removeItem(be), s.setItem(Nr, r);
|
|
3318
3338
|
try {
|
|
3319
|
-
window.dispatchEvent(new CustomEvent(
|
|
3339
|
+
window.dispatchEvent(new CustomEvent(Ja, { detail: { mode: r } }));
|
|
3320
3340
|
} catch {
|
|
3321
3341
|
}
|
|
3322
3342
|
return gr(r), !0;
|
|
3323
3343
|
}
|
|
3324
|
-
const
|
|
3344
|
+
const tc = {
|
|
3325
3345
|
name: "ikon.client.getLanguage",
|
|
3326
3346
|
description: "Get the browser language preference",
|
|
3327
3347
|
returnType: { kind: "string" }
|
|
3328
3348
|
};
|
|
3329
|
-
function
|
|
3349
|
+
function rc() {
|
|
3330
3350
|
return typeof navigator > "u" ? "en-US" : navigator.language || "en-US";
|
|
3331
3351
|
}
|
|
3332
|
-
const
|
|
3352
|
+
const nc = {
|
|
3333
3353
|
name: "ikon.client.getTimezone",
|
|
3334
3354
|
description: "Get the browser timezone (IANA format)",
|
|
3335
3355
|
returnType: { kind: "string" }
|
|
3336
3356
|
};
|
|
3337
|
-
function
|
|
3357
|
+
function sc() {
|
|
3338
3358
|
try {
|
|
3339
3359
|
return Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
3340
3360
|
} catch {
|
|
3341
3361
|
return "UTC";
|
|
3342
3362
|
}
|
|
3343
3363
|
}
|
|
3344
|
-
const
|
|
3364
|
+
const ic = {
|
|
3345
3365
|
name: "ikon.client.getUrl",
|
|
3346
3366
|
description: "Get the current browser URL path and query string",
|
|
3347
3367
|
returnType: { kind: "string", nullable: !0 }
|
|
3348
3368
|
};
|
|
3349
|
-
function
|
|
3369
|
+
function oc() {
|
|
3350
3370
|
return typeof window > "u" ? null : window.location.pathname + window.location.search;
|
|
3351
3371
|
}
|
|
3352
|
-
const
|
|
3372
|
+
const ac = {
|
|
3353
3373
|
name: "ikon.client.setUrl",
|
|
3354
3374
|
description: "Update the browser URL without triggering a page reload",
|
|
3355
3375
|
returnType: { kind: "boolean" },
|
|
@@ -3358,7 +3378,7 @@ const nc = {
|
|
|
3358
3378
|
{ name: "replace", type: { kind: "boolean", nullable: !0 }, description: "If true, replaces current history entry instead of adding new one" }
|
|
3359
3379
|
]
|
|
3360
3380
|
};
|
|
3361
|
-
function
|
|
3381
|
+
function cc(t, e) {
|
|
3362
3382
|
if (typeof window > "u" || !window.history || typeof t != "string")
|
|
3363
3383
|
return !1;
|
|
3364
3384
|
const r = t.trim();
|
|
@@ -3370,13 +3390,13 @@ function sc(t, e) {
|
|
|
3370
3390
|
return !1;
|
|
3371
3391
|
}
|
|
3372
3392
|
}
|
|
3373
|
-
const
|
|
3393
|
+
const lc = {
|
|
3374
3394
|
name: "ikon.client.vibrate",
|
|
3375
3395
|
description: "Trigger haptic feedback on supported devices",
|
|
3376
3396
|
returnType: { kind: "boolean" },
|
|
3377
3397
|
parameters: [{ name: "pattern", type: { kind: "string" }, description: 'Duration in ms, or comma-separated pattern (e.g., "200" or "100,50,100")' }]
|
|
3378
3398
|
};
|
|
3379
|
-
function
|
|
3399
|
+
function uc(t) {
|
|
3380
3400
|
if (typeof navigator > "u" || !navigator.vibrate || typeof t != "string")
|
|
3381
3401
|
return !1;
|
|
3382
3402
|
try {
|
|
@@ -3387,13 +3407,13 @@ function oc(t) {
|
|
|
3387
3407
|
}
|
|
3388
3408
|
}
|
|
3389
3409
|
let te = null;
|
|
3390
|
-
const
|
|
3410
|
+
const hc = {
|
|
3391
3411
|
name: "ikon.client.keepScreenAwake",
|
|
3392
3412
|
description: "Prevent or allow the screen to sleep",
|
|
3393
3413
|
returnType: { kind: "boolean" },
|
|
3394
3414
|
parameters: [{ name: "enabled", type: { kind: "boolean" }, description: "Whether to keep the screen awake" }]
|
|
3395
3415
|
};
|
|
3396
|
-
async function
|
|
3416
|
+
async function dc(t) {
|
|
3397
3417
|
if (typeof navigator > "u" || !("wakeLock" in navigator))
|
|
3398
3418
|
return !1;
|
|
3399
3419
|
try {
|
|
@@ -3402,15 +3422,15 @@ async function cc(t) {
|
|
|
3402
3422
|
return !1;
|
|
3403
3423
|
}
|
|
3404
3424
|
}
|
|
3405
|
-
const
|
|
3425
|
+
const fc = {
|
|
3406
3426
|
name: "ikon.client.getVisibility",
|
|
3407
3427
|
description: "Get the current page visibility state",
|
|
3408
3428
|
returnType: { kind: "string", nullable: !0 }
|
|
3409
3429
|
};
|
|
3410
|
-
function
|
|
3430
|
+
function Ec() {
|
|
3411
3431
|
return typeof document > "u" ? null : document.visibilityState || null;
|
|
3412
3432
|
}
|
|
3413
|
-
const
|
|
3433
|
+
const pc = {
|
|
3414
3434
|
name: "ikon.client.scrollTo",
|
|
3415
3435
|
description: "Scroll the page to a specific position",
|
|
3416
3436
|
returnType: { kind: "boolean" },
|
|
@@ -3420,7 +3440,7 @@ const hc = {
|
|
|
3420
3440
|
{ name: "smooth", type: { kind: "boolean", nullable: !0 }, description: "Whether to animate the scroll" }
|
|
3421
3441
|
]
|
|
3422
3442
|
};
|
|
3423
|
-
function
|
|
3443
|
+
function Ic(t, e, r) {
|
|
3424
3444
|
if (typeof window > "u" || typeof t != "number" || typeof e != "number")
|
|
3425
3445
|
return !1;
|
|
3426
3446
|
try {
|
|
@@ -3433,12 +3453,12 @@ function dc(t, e, r) {
|
|
|
3433
3453
|
return !1;
|
|
3434
3454
|
}
|
|
3435
3455
|
}
|
|
3436
|
-
const
|
|
3456
|
+
const mc = {
|
|
3437
3457
|
name: "ikon.client.getBatteryLevel",
|
|
3438
3458
|
description: "Get the current battery level (0-100)",
|
|
3439
3459
|
returnType: { kind: "number", nullable: !0 }
|
|
3440
3460
|
};
|
|
3441
|
-
async function
|
|
3461
|
+
async function _c() {
|
|
3442
3462
|
if (typeof navigator > "u" || !("getBattery" in navigator))
|
|
3443
3463
|
return null;
|
|
3444
3464
|
try {
|
|
@@ -3448,20 +3468,18 @@ async function Ec() {
|
|
|
3448
3468
|
return null;
|
|
3449
3469
|
}
|
|
3450
3470
|
}
|
|
3451
|
-
const
|
|
3471
|
+
const Tc = {
|
|
3452
3472
|
name: "ikon.client.getNetworkType",
|
|
3453
3473
|
description: "Get the current network connection type",
|
|
3454
3474
|
returnType: { kind: "string", nullable: !0 }
|
|
3455
3475
|
};
|
|
3456
|
-
function
|
|
3476
|
+
function Sc() {
|
|
3457
3477
|
if (typeof navigator > "u")
|
|
3458
3478
|
return null;
|
|
3459
3479
|
const t = navigator.connection;
|
|
3460
3480
|
return t && (t.effectiveType || t.type) || null;
|
|
3461
3481
|
}
|
|
3462
|
-
const
|
|
3463
|
-
{ definition: ja, handler: za },
|
|
3464
|
-
{ definition: Xa, handler: Ja },
|
|
3482
|
+
const wc = [
|
|
3465
3483
|
{ definition: Qa, handler: Za },
|
|
3466
3484
|
{ definition: qa, handler: ec },
|
|
3467
3485
|
{ definition: tc, handler: rc },
|
|
@@ -3471,16 +3489,18 @@ const mc = [
|
|
|
3471
3489
|
{ definition: lc, handler: uc },
|
|
3472
3490
|
{ definition: hc, handler: dc },
|
|
3473
3491
|
{ definition: fc, handler: Ec },
|
|
3474
|
-
{ definition: pc, handler: Ic }
|
|
3492
|
+
{ definition: pc, handler: Ic },
|
|
3493
|
+
{ definition: mc, handler: _c },
|
|
3494
|
+
{ definition: Tc, handler: Sc }
|
|
3475
3495
|
];
|
|
3476
|
-
function
|
|
3477
|
-
const e =
|
|
3496
|
+
function Ac(t) {
|
|
3497
|
+
const e = wc.map(({ definition: r, handler: n }) => t.register(r, n));
|
|
3478
3498
|
return () => e.forEach((r) => r());
|
|
3479
3499
|
}
|
|
3480
3500
|
function nt() {
|
|
3481
3501
|
return typeof window < "u" && typeof navigator < "u";
|
|
3482
3502
|
}
|
|
3483
|
-
const
|
|
3503
|
+
const yc = new Uint8Array(0);
|
|
3484
3504
|
function me(t) {
|
|
3485
3505
|
switch (t.kind) {
|
|
3486
3506
|
case "array":
|
|
@@ -3540,7 +3560,7 @@ function Cr(t, e) {
|
|
|
3540
3560
|
}
|
|
3541
3561
|
return JSON.stringify(t);
|
|
3542
3562
|
}
|
|
3543
|
-
function
|
|
3563
|
+
function Nc(t, e) {
|
|
3544
3564
|
const r = (t.parameters ?? []).map((i) => {
|
|
3545
3565
|
const o = me(i.type), a = Object.prototype.hasOwnProperty.call(i, "defaultValue"), c = a ? Cr(i.defaultValue, o) : "";
|
|
3546
3566
|
return {
|
|
@@ -3567,7 +3587,7 @@ function Sc(t, e) {
|
|
|
3567
3587
|
TypeName: re(i.descriptor),
|
|
3568
3588
|
HasDefaultValue: i.hasDefaultValue,
|
|
3569
3589
|
DefaultValueJson: i.defaultValueJson,
|
|
3570
|
-
DefaultValueData:
|
|
3590
|
+
DefaultValueData: yc,
|
|
3571
3591
|
IsEnumerable: !1,
|
|
3572
3592
|
EnumerableItemTypeName: "",
|
|
3573
3593
|
Description: i.description ?? ""
|
|
@@ -3581,11 +3601,11 @@ function Sc(t, e) {
|
|
|
3581
3601
|
returnType: n
|
|
3582
3602
|
};
|
|
3583
3603
|
}
|
|
3584
|
-
const it = L("FunctionRegistry"),
|
|
3585
|
-
function
|
|
3604
|
+
const it = L("FunctionRegistry"), gc = new Uint8Array(0);
|
|
3605
|
+
function Cc(t) {
|
|
3586
3606
|
return !t || typeof t != "object" ? !1 : t.data instanceof Uint8Array;
|
|
3587
3607
|
}
|
|
3588
|
-
class
|
|
3608
|
+
class Rc {
|
|
3589
3609
|
functions = /* @__PURE__ */ new Map();
|
|
3590
3610
|
config = null;
|
|
3591
3611
|
isConnected = !1;
|
|
@@ -3607,7 +3627,7 @@ class yc {
|
|
|
3607
3627
|
* If already connected, sends registration to server immediately.
|
|
3608
3628
|
*/
|
|
3609
3629
|
register(e, r) {
|
|
3610
|
-
const n =
|
|
3630
|
+
const n = Nc(e, r);
|
|
3611
3631
|
return this.functions.set(e.name, n), this.isConnected && this.config && this.sendRegistration(n), () => this.unregister(e.name);
|
|
3612
3632
|
}
|
|
3613
3633
|
/**
|
|
@@ -3686,8 +3706,8 @@ class yc {
|
|
|
3686
3706
|
h === void 0 || h === "" ? f.hasDefaultValue ? s.push(st(f.defaultValueJson, f.descriptor)) : s.push(void 0) : s.push(st(h, f.descriptor));
|
|
3687
3707
|
}
|
|
3688
3708
|
const i = await e.handler(...s);
|
|
3689
|
-
let o = i, a =
|
|
3690
|
-
|
|
3709
|
+
let o = i, a = gc;
|
|
3710
|
+
Cc(i) && (o = i.value, a = new Uint8Array(i.data));
|
|
3691
3711
|
const c = Cr(o, e.returnType);
|
|
3692
3712
|
this.sendResult(r.CallId, r.InstanceId, n, e, c, a);
|
|
3693
3713
|
} catch (s) {
|
|
@@ -3742,7 +3762,7 @@ class yc {
|
|
|
3742
3762
|
this.config.sendProtocolMessage(i);
|
|
3743
3763
|
}
|
|
3744
3764
|
}
|
|
3745
|
-
function
|
|
3765
|
+
function bc(t, e) {
|
|
3746
3766
|
return { value: t, data: e };
|
|
3747
3767
|
}
|
|
3748
3768
|
function Se(t) {
|
|
@@ -3758,7 +3778,7 @@ const Te = {
|
|
|
3758
3778
|
StartAudioCapture: "ikon.client.startAudioCapture",
|
|
3759
3779
|
StopCapture: "ikon.client.stopCapture",
|
|
3760
3780
|
CaptureImage: "ikon.client.captureImage"
|
|
3761
|
-
},
|
|
3781
|
+
}, kc = {
|
|
3762
3782
|
name: Te.StartVideoCapture,
|
|
3763
3783
|
description: "Start camera or screen capture and stream video frames to the server",
|
|
3764
3784
|
returnType: { kind: "string" },
|
|
@@ -3766,26 +3786,26 @@ const Te = {
|
|
|
3766
3786
|
{ name: "source", type: { kind: "string", nullable: !0 }, description: "camera or screen" },
|
|
3767
3787
|
{ name: "optionsJson", type: { kind: "string", nullable: !0 }, description: "JSON encoded capture options" }
|
|
3768
3788
|
]
|
|
3769
|
-
},
|
|
3789
|
+
}, Uc = {
|
|
3770
3790
|
name: Te.StartAudioCapture,
|
|
3771
3791
|
description: "Start microphone capture and stream audio frames to the server",
|
|
3772
3792
|
returnType: { kind: "string" },
|
|
3773
3793
|
parameters: [{ name: "optionsJson", type: { kind: "string", nullable: !0 }, description: "JSON encoded capture options" }]
|
|
3774
|
-
},
|
|
3794
|
+
}, Dc = {
|
|
3775
3795
|
name: Te.StopCapture,
|
|
3776
3796
|
description: "Stop a previously started capture by captureId",
|
|
3777
3797
|
returnType: { kind: "boolean" },
|
|
3778
3798
|
parameters: [{ name: "captureId", type: { kind: "string" }, description: "Capture ID to stop" }]
|
|
3779
|
-
},
|
|
3799
|
+
}, Mc = {
|
|
3780
3800
|
name: Te.CaptureImage,
|
|
3781
3801
|
description: "Capture a single image from the camera and return metadata (JSON) plus binary image data",
|
|
3782
3802
|
returnType: { kind: "string" },
|
|
3783
3803
|
parameters: [{ name: "optionsJson", type: { kind: "string", nullable: !0 }, description: "JSON encoded capture options" }]
|
|
3784
3804
|
};
|
|
3785
|
-
function
|
|
3805
|
+
function Oc(t, e) {
|
|
3786
3806
|
const r = [];
|
|
3787
3807
|
return r.push(
|
|
3788
|
-
t.register(
|
|
3808
|
+
t.register(kc, async (n, s) => {
|
|
3789
3809
|
const i = e.mediaCapture;
|
|
3790
3810
|
if (!i)
|
|
3791
3811
|
throw new Error("Media capture is not available in this environment");
|
|
@@ -3793,7 +3813,7 @@ function kc(t, e) {
|
|
|
3793
3813
|
return ((typeof n == "string" && n.trim().toLowerCase() === "screen" ? "screen" : "camera") === "screen" ? await i.video.startScreen({ userGesture: !1, options: o, constraints: o?.constraints }) : await i.video.startCamera({ userGesture: !1, options: o, constraints: o?.constraints })).captureId;
|
|
3794
3814
|
})
|
|
3795
3815
|
), r.push(
|
|
3796
|
-
t.register(
|
|
3816
|
+
t.register(Uc, async (n) => {
|
|
3797
3817
|
const s = e.mediaCapture;
|
|
3798
3818
|
if (!s)
|
|
3799
3819
|
throw new Error("Media capture is not available in this environment");
|
|
@@ -3801,7 +3821,7 @@ function kc(t, e) {
|
|
|
3801
3821
|
return (await s.audio.startMic({ userGesture: !1, options: i, constraints: i?.constraints })).captureId;
|
|
3802
3822
|
})
|
|
3803
3823
|
), r.push(
|
|
3804
|
-
t.register(
|
|
3824
|
+
t.register(Dc, async (n) => {
|
|
3805
3825
|
const s = e.mediaCapture;
|
|
3806
3826
|
if (!s || typeof n != "string" || !n.trim())
|
|
3807
3827
|
return !1;
|
|
@@ -3809,7 +3829,7 @@ function kc(t, e) {
|
|
|
3809
3829
|
return i || o;
|
|
3810
3830
|
})
|
|
3811
3831
|
), r.push(
|
|
3812
|
-
t.register(
|
|
3832
|
+
t.register(Mc, async (n) => {
|
|
3813
3833
|
const s = e.mediaCapture;
|
|
3814
3834
|
if (!s)
|
|
3815
3835
|
throw new Error("Media capture is not available in this environment");
|
|
@@ -3821,7 +3841,7 @@ function kc(t, e) {
|
|
|
3821
3841
|
width: i.width,
|
|
3822
3842
|
height: i.height
|
|
3823
3843
|
}), a = JSON.stringify({ mime: o.mime, width: o.width, height: o.height });
|
|
3824
|
-
return
|
|
3844
|
+
return bc(a, o.data);
|
|
3825
3845
|
})
|
|
3826
3846
|
), () => {
|
|
3827
3847
|
for (const n of r)
|
|
@@ -3833,9 +3853,9 @@ const Rr = () => {
|
|
|
3833
3853
|
return !1;
|
|
3834
3854
|
const t = navigator.userAgent, e = /iPad|iPhone|iPod/.test(t), r = t.includes("Macintosh") && typeof navigator.maxTouchPoints == "number" && navigator.maxTouchPoints > 1;
|
|
3835
3855
|
return e || r;
|
|
3836
|
-
},
|
|
3856
|
+
}, Lc = globalThis;
|
|
3837
3857
|
function le() {
|
|
3838
|
-
if (typeof SharedArrayBuffer > "u" || typeof Atomics > "u" ||
|
|
3858
|
+
if (typeof SharedArrayBuffer > "u" || typeof Atomics > "u" || Lc.crossOriginIsolated === !1)
|
|
3839
3859
|
return !1;
|
|
3840
3860
|
try {
|
|
3841
3861
|
new SharedArrayBuffer(1);
|
|
@@ -3847,7 +3867,7 @@ function le() {
|
|
|
3847
3867
|
function br(t) {
|
|
3848
3868
|
return typeof AudioWorkletNode != "function" ? !1 : typeof t.audioWorklet?.addModule == "function";
|
|
3849
3869
|
}
|
|
3850
|
-
function
|
|
3870
|
+
function vc(t) {
|
|
3851
3871
|
return new Worker(
|
|
3852
3872
|
"" + new URL("assets/audio-playback-worker-Cwm3GaAx.js", import.meta.url).href,
|
|
3853
3873
|
{
|
|
@@ -3856,7 +3876,7 @@ function Dc(t) {
|
|
|
3856
3876
|
}
|
|
3857
3877
|
);
|
|
3858
3878
|
}
|
|
3859
|
-
const ae = 48e3, b = 2, kr = 1500, ot = 512, at = "playback",
|
|
3879
|
+
const ae = 48e3, b = 2, kr = 1500, ot = 512, at = "playback", Pc = 120, Fc = 300, Bc = 4, Gc = 200, xc = 100, Vc = 8e3, Wc = 10, Ur = 100, ke = 50, Dr = 128, Hc = 20, $c = !0, x = 1500, Kc = -20, Yc = -100, jc = 200, g = L("IkonAudioPlayback"), zc = () => {
|
|
3860
3880
|
if (typeof navigator > "u" || typeof window > "u")
|
|
3861
3881
|
return !1;
|
|
3862
3882
|
const t = navigator.userAgent, e = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(t), r = t.includes("Macintosh") && typeof navigator.maxTouchPoints == "number" && navigator.maxTouchPoints > 1;
|
|
@@ -3868,19 +3888,19 @@ const ae = 48e3, b = 2, kr = 1500, ot = 512, at = "playback", Mc = 120, Oc = 300
|
|
|
3868
3888
|
function K(t) {
|
|
3869
3889
|
return t instanceof Error ? `${t.name}: ${t.message}` : String(t);
|
|
3870
3890
|
}
|
|
3871
|
-
function
|
|
3891
|
+
function Xc(t) {
|
|
3872
3892
|
return `
|
|
3873
3893
|
// Audio buffer constants
|
|
3874
3894
|
const OUTPUT_SAMPLE_RATE_HZ = ${t.outputSampleRateHz};
|
|
3875
3895
|
const DEFAULT_FRAME_SAMPLES_PER_CHANNEL = Math.max(1, Math.round(OUTPUT_SAMPLE_RATE_HZ * 0.02));
|
|
3876
|
-
const BUFFER_TARGET_MIN_MS = ${
|
|
3877
|
-
const BUFFER_TARGET_MAX_MS = ${
|
|
3878
|
-
const JITTER_MULTIPLIER = ${
|
|
3896
|
+
const BUFFER_TARGET_MIN_MS = ${Pc};
|
|
3897
|
+
const BUFFER_TARGET_MAX_MS = ${Fc};
|
|
3898
|
+
const JITTER_MULTIPLIER = ${Bc};
|
|
3879
3899
|
const LOCAL_BUFFER_MAX_MS = ${kr};
|
|
3880
|
-
const CONTROL_PERIOD_MS = ${
|
|
3881
|
-
const UNDERRUN_JUMP_MS = ${
|
|
3882
|
-
const STABLE_TIME_TO_DECREASE_MS = ${
|
|
3883
|
-
const DECREASE_STEP_MS = ${
|
|
3900
|
+
const CONTROL_PERIOD_MS = ${Gc};
|
|
3901
|
+
const UNDERRUN_JUMP_MS = ${xc};
|
|
3902
|
+
const STABLE_TIME_TO_DECREASE_MS = ${Vc};
|
|
3903
|
+
const DECREASE_STEP_MS = ${Wc};
|
|
3884
3904
|
const DEFAULT_STATS_INTERVAL_SAMPLES = OUTPUT_SAMPLE_RATE_HZ;
|
|
3885
3905
|
|
|
3886
3906
|
// Pre-computed reciprocals for division-free calculations
|
|
@@ -3899,7 +3919,7 @@ const FADE_OUT_INCREMENT = 1.0 / FADE_OUT_DURATION_SAMPLES;
|
|
|
3899
3919
|
const RENDER_QUANTUM_SIZE = ${Dr};
|
|
3900
3920
|
|
|
3901
3921
|
// Buffer reduction crossfade constants (align to quantum boundary to avoid partial quanta)
|
|
3902
|
-
const BUFFER_REDUCTION_CROSSFADE_MS = ${
|
|
3922
|
+
const BUFFER_REDUCTION_CROSSFADE_MS = ${Hc};
|
|
3903
3923
|
const BUFFER_REDUCTION_CROSSFADE_SAMPLES_RAW = Math.round(OUTPUT_SAMPLE_RATE_HZ * BUFFER_REDUCTION_CROSSFADE_MS / 1000);
|
|
3904
3924
|
const BUFFER_REDUCTION_CROSSFADE_SAMPLES = Math.ceil(BUFFER_REDUCTION_CROSSFADE_SAMPLES_RAW / RENDER_QUANTUM_SIZE) * RENDER_QUANTUM_SIZE;
|
|
3905
3925
|
|
|
@@ -4110,7 +4130,7 @@ class IkonAudioPlayerProcessor extends AudioWorkletProcessor {
|
|
|
4110
4130
|
this.statsIntervalSamples = Math.max(1, Math.round((OUTPUT_SAMPLE_RATE_HZ * statusIntervalMs) / 1000));
|
|
4111
4131
|
|
|
4112
4132
|
// Normalization config (hardcoded)
|
|
4113
|
-
this.normalizationEnabled = ${
|
|
4133
|
+
this.normalizationEnabled = ${$c};
|
|
4114
4134
|
|
|
4115
4135
|
// Stream states for audio buffer
|
|
4116
4136
|
this.streams = new Map();
|
|
@@ -4786,7 +4806,7 @@ class je {
|
|
|
4786
4806
|
config;
|
|
4787
4807
|
enabled = !1;
|
|
4788
4808
|
stateUnsubscribe = null;
|
|
4789
|
-
isMobile =
|
|
4809
|
+
isMobile = zc();
|
|
4790
4810
|
boundVisibilityChange = null;
|
|
4791
4811
|
boundPageHide = null;
|
|
4792
4812
|
unlockHandler = null;
|
|
@@ -5220,7 +5240,7 @@ class je {
|
|
|
5220
5240
|
URL.revokeObjectURL(this.workletModuleUrl);
|
|
5221
5241
|
} catch {
|
|
5222
5242
|
}
|
|
5223
|
-
this.workletModuleKey = i, this.workletReady = null, this.workletModuleUrl = URL.createObjectURL(new Blob([
|
|
5243
|
+
this.workletModuleKey = i, this.workletReady = null, this.workletModuleUrl = URL.createObjectURL(new Blob([Xc({ outputSampleRateHz: this.outputSampleRateHz, outputChannels: b })], { type: "text/javascript" }));
|
|
5224
5244
|
}
|
|
5225
5245
|
this.workletReady || (this.workletReady = e.audioWorklet.addModule(this.workletModuleUrl).catch((f) => {
|
|
5226
5246
|
throw g.warn(`Failed to load AudioWorklet module, falling back: ${K(f)}`), f;
|
|
@@ -5466,7 +5486,7 @@ class je {
|
|
|
5466
5486
|
}
|
|
5467
5487
|
this.protocolPort = e;
|
|
5468
5488
|
try {
|
|
5469
|
-
this.audioWorker = new
|
|
5489
|
+
this.audioWorker = new vc();
|
|
5470
5490
|
} catch (d) {
|
|
5471
5491
|
g.warn(`Failed to create audio worker: ${K(d)}`), this.protocolPort.close(), this.protocolPort = null;
|
|
5472
5492
|
return;
|
|
@@ -5550,7 +5570,7 @@ class je {
|
|
|
5550
5570
|
s.epochTimestampSamples = e.timestampInterleavedSamples;
|
|
5551
5571
|
const c = this.audioContext;
|
|
5552
5572
|
if (c) {
|
|
5553
|
-
const u = (c.outputLatency ?? 0) + (c.baseLatency ?? 0), f =
|
|
5573
|
+
const u = (c.outputLatency ?? 0) + (c.baseLatency ?? 0), f = Kc + u * 1e3, d = Math.min(jc, Math.max(Yc, f));
|
|
5554
5574
|
s.playbackStartContextTime = c.currentTime + d / 1e3;
|
|
5555
5575
|
}
|
|
5556
5576
|
s.timingEstablished = !0;
|
|
@@ -5673,7 +5693,7 @@ class je {
|
|
|
5673
5693
|
}));
|
|
5674
5694
|
}
|
|
5675
5695
|
}
|
|
5676
|
-
function
|
|
5696
|
+
function Jc(t) {
|
|
5677
5697
|
return new Worker(
|
|
5678
5698
|
"" + new URL("assets/video-playback-worker-Bfm3r5xW.js", import.meta.url).href,
|
|
5679
5699
|
{
|
|
@@ -5686,7 +5706,7 @@ const V = L("IkonVideoPlayback");
|
|
|
5686
5706
|
function we(t) {
|
|
5687
5707
|
return t instanceof Error ? `${t.name}: ${t.message}` : String(t);
|
|
5688
5708
|
}
|
|
5689
|
-
class
|
|
5709
|
+
class Qc {
|
|
5690
5710
|
client;
|
|
5691
5711
|
config;
|
|
5692
5712
|
enabled = !0;
|
|
@@ -5761,7 +5781,7 @@ class jc {
|
|
|
5761
5781
|
}
|
|
5762
5782
|
let e;
|
|
5763
5783
|
try {
|
|
5764
|
-
e = new
|
|
5784
|
+
e = new Jc();
|
|
5765
5785
|
} catch (r) {
|
|
5766
5786
|
V.warn(`Failed to create video worker: ${we(r)}`);
|
|
5767
5787
|
return;
|
|
@@ -5850,7 +5870,7 @@ class jc {
|
|
|
5850
5870
|
const r = this.parseStreamId(e);
|
|
5851
5871
|
if (!r)
|
|
5852
5872
|
return;
|
|
5853
|
-
const n =
|
|
5873
|
+
const n = ga(ya(), this.client.sessionId ?? 0, {
|
|
5854
5874
|
trackId: r.trackId,
|
|
5855
5875
|
targetIds: [r.senderId]
|
|
5856
5876
|
});
|
|
@@ -5910,11 +5930,11 @@ class jc {
|
|
|
5910
5930
|
}));
|
|
5911
5931
|
}
|
|
5912
5932
|
}
|
|
5913
|
-
class
|
|
5933
|
+
class Zc {
|
|
5914
5934
|
audio;
|
|
5915
5935
|
video;
|
|
5916
5936
|
constructor(e, r) {
|
|
5917
|
-
this.audio = new je(e, r?.audio), this.video = new
|
|
5937
|
+
this.audio = new je(e, r?.audio), this.video = new Qc(e, r?.video), r?.mediaSession && this.audio.setMediaSession(r.mediaSession);
|
|
5918
5938
|
}
|
|
5919
5939
|
/**
|
|
5920
5940
|
* Releases media resources (workers, audio graph, decoders).
|
|
@@ -5925,7 +5945,7 @@ class zc {
|
|
|
5925
5945
|
this.audio.dispose(), this.video.dispose();
|
|
5926
5946
|
}
|
|
5927
5947
|
}
|
|
5928
|
-
class
|
|
5948
|
+
class qc {
|
|
5929
5949
|
static getStorageForCapacity(e, r) {
|
|
5930
5950
|
const n = Int32Array.BYTES_PER_ELEMENT * 2, s = r.BYTES_PER_ELEMENT * e;
|
|
5931
5951
|
return new SharedArrayBuffer(n + s);
|
|
@@ -5979,7 +5999,7 @@ class Xc {
|
|
|
5979
5999
|
return n = (n + r) % this.capacity, Atomics.store(this.readWrite, 0, n), r;
|
|
5980
6000
|
}
|
|
5981
6001
|
}
|
|
5982
|
-
function
|
|
6002
|
+
function el(t) {
|
|
5983
6003
|
return new Worker(
|
|
5984
6004
|
"" + new URL("assets/audio-capture-worker-kpORDYGU.js", import.meta.url).href,
|
|
5985
6005
|
{
|
|
@@ -5988,12 +6008,12 @@ function Jc(t) {
|
|
|
5988
6008
|
}
|
|
5989
6009
|
);
|
|
5990
6010
|
}
|
|
5991
|
-
const
|
|
5992
|
-
function
|
|
6011
|
+
const tl = L("IkonAudioCapture");
|
|
6012
|
+
function rl() {
|
|
5993
6013
|
const t = globalThis.crypto;
|
|
5994
6014
|
return t?.randomUUID ? t.randomUUID() : `cap_${Date.now()}_${Math.floor(Math.random() * 1e9)}`;
|
|
5995
6015
|
}
|
|
5996
|
-
function
|
|
6016
|
+
function nl() {
|
|
5997
6017
|
return `
|
|
5998
6018
|
class RingBuffer {
|
|
5999
6019
|
static getStorageForCapacity(capacity, type) {
|
|
@@ -6122,7 +6142,7 @@ class IkonAudioCaptureProcessor extends AudioWorkletProcessor {
|
|
|
6122
6142
|
registerProcessor('ikon-audio-capture', IkonAudioCaptureProcessor);
|
|
6123
6143
|
`;
|
|
6124
6144
|
}
|
|
6125
|
-
class
|
|
6145
|
+
class sl {
|
|
6126
6146
|
constructor(e, r) {
|
|
6127
6147
|
this.client = e, this.config = r ?? {};
|
|
6128
6148
|
}
|
|
@@ -6142,12 +6162,12 @@ class el {
|
|
|
6142
6162
|
ensureWorker() {
|
|
6143
6163
|
if (this.worker)
|
|
6144
6164
|
return this.worker;
|
|
6145
|
-
const e = new
|
|
6165
|
+
const e = new el();
|
|
6146
6166
|
return this.worker = e, e.addEventListener("message", (r) => {
|
|
6147
6167
|
const n = r.data;
|
|
6148
6168
|
if (n?.type === "error") {
|
|
6149
6169
|
const s = n.error;
|
|
6150
|
-
|
|
6170
|
+
tl.warn(`Audio capture worker error: ${s?.name ?? "Error"} ${s?.message ?? ""}`);
|
|
6151
6171
|
}
|
|
6152
6172
|
}), e;
|
|
6153
6173
|
}
|
|
@@ -6185,7 +6205,7 @@ class el {
|
|
|
6185
6205
|
async ensureWorklet(e) {
|
|
6186
6206
|
if (!br(e))
|
|
6187
6207
|
throw new Error("AudioWorklet is not supported in this browser");
|
|
6188
|
-
this.workletModuleUrl || (this.workletModuleUrl = URL.createObjectURL(new Blob([
|
|
6208
|
+
this.workletModuleUrl || (this.workletModuleUrl = URL.createObjectURL(new Blob([nl()], { type: "text/javascript" }))), (!this.workletReady || this.workletContext !== e) && (this.workletContext = e, this.workletReady = e.audioWorklet.addModule(this.workletModuleUrl));
|
|
6189
6209
|
try {
|
|
6190
6210
|
await this.workletReady;
|
|
6191
6211
|
} catch (r) {
|
|
@@ -6201,13 +6221,13 @@ class el {
|
|
|
6201
6221
|
if (!i)
|
|
6202
6222
|
throw s.getTracks().forEach((_) => _.stop()), new Error("No audio track available");
|
|
6203
6223
|
await this.ensureWorklet(n);
|
|
6204
|
-
const o =
|
|
6224
|
+
const o = rl(), a = this.allocateTrackId(), c = n.createMediaStreamSource(s), u = n.createGain();
|
|
6205
6225
|
u.gain.value = 0, u.connect(n.destination);
|
|
6206
6226
|
const h = le() ? "sab" : "pcm";
|
|
6207
6227
|
let E;
|
|
6208
6228
|
if (h === "sab") {
|
|
6209
6229
|
const _ = Math.floor(n.sampleRate * 2);
|
|
6210
|
-
E =
|
|
6230
|
+
E = qc.getStorageForCapacity(_, Float32Array);
|
|
6211
6231
|
}
|
|
6212
6232
|
const p = this.ensureWorker();
|
|
6213
6233
|
p.postMessage({
|
|
@@ -6348,9 +6368,9 @@ class el {
|
|
|
6348
6368
|
}
|
|
6349
6369
|
}
|
|
6350
6370
|
}
|
|
6351
|
-
const Mr = 1280, Or = 720,
|
|
6352
|
-
async function
|
|
6353
|
-
const r = e.mime ?? Lr, n = e.quality ??
|
|
6371
|
+
const Mr = 1280, Or = 720, il = 30, Lr = "image/jpeg", ol = 0.92;
|
|
6372
|
+
async function al(t, e) {
|
|
6373
|
+
const r = e.mime ?? Lr, n = e.quality ?? ol;
|
|
6354
6374
|
if (typeof OffscreenCanvas < "u" && t instanceof OffscreenCanvas)
|
|
6355
6375
|
try {
|
|
6356
6376
|
return await t.convertToBlob({ type: r, quality: n });
|
|
@@ -6367,7 +6387,7 @@ async function nl(t, e) {
|
|
|
6367
6387
|
);
|
|
6368
6388
|
});
|
|
6369
6389
|
}
|
|
6370
|
-
class
|
|
6390
|
+
class cl {
|
|
6371
6391
|
async acquireCameraStream(e) {
|
|
6372
6392
|
if (!navigator.mediaDevices)
|
|
6373
6393
|
throw new Error("Media devices are not available in this environment");
|
|
@@ -6404,7 +6424,7 @@ class sl {
|
|
|
6404
6424
|
if (!f)
|
|
6405
6425
|
throw new Error("2D canvas context unavailable");
|
|
6406
6426
|
f.drawImage(s, 0, 0, a, c);
|
|
6407
|
-
const d = await
|
|
6427
|
+
const d = await al(u, e), h = await d.arrayBuffer();
|
|
6408
6428
|
return {
|
|
6409
6429
|
mime: d.type || e.mime || Lr,
|
|
6410
6430
|
width: a,
|
|
@@ -6431,7 +6451,7 @@ class sl {
|
|
|
6431
6451
|
}
|
|
6432
6452
|
}
|
|
6433
6453
|
}
|
|
6434
|
-
function
|
|
6454
|
+
function ll(t) {
|
|
6435
6455
|
return new Worker(
|
|
6436
6456
|
"" + new URL("assets/video-capture-worker-BBs_62Fq.js", import.meta.url).href,
|
|
6437
6457
|
{
|
|
@@ -6441,17 +6461,17 @@ function il(t) {
|
|
|
6441
6461
|
);
|
|
6442
6462
|
}
|
|
6443
6463
|
const lt = L("IkonVideoCapture");
|
|
6444
|
-
function
|
|
6464
|
+
function ul() {
|
|
6445
6465
|
const t = globalThis.crypto;
|
|
6446
6466
|
return t?.randomUUID ? t.randomUUID() : `cap_${Date.now()}_${Math.floor(Math.random() * 1e9)}`;
|
|
6447
6467
|
}
|
|
6448
|
-
function
|
|
6468
|
+
function hl() {
|
|
6449
6469
|
const t = globalThis.MediaStreamTrackProcessor;
|
|
6450
6470
|
if (!t)
|
|
6451
6471
|
throw new Error("MediaStreamTrackProcessor is not available in this browser");
|
|
6452
6472
|
return t;
|
|
6453
6473
|
}
|
|
6454
|
-
class
|
|
6474
|
+
class dl {
|
|
6455
6475
|
constructor(e) {
|
|
6456
6476
|
this.client = e;
|
|
6457
6477
|
}
|
|
@@ -6467,7 +6487,7 @@ class cl {
|
|
|
6467
6487
|
ensureWorker() {
|
|
6468
6488
|
if (this.worker)
|
|
6469
6489
|
return this.worker;
|
|
6470
|
-
const e = new
|
|
6490
|
+
const e = new ll();
|
|
6471
6491
|
return this.worker = e, e.addEventListener("message", (r) => {
|
|
6472
6492
|
const n = r.data;
|
|
6473
6493
|
if (n?.type === "error") {
|
|
@@ -6494,7 +6514,7 @@ class cl {
|
|
|
6494
6514
|
async getMediaStream(e) {
|
|
6495
6515
|
if (!navigator.mediaDevices)
|
|
6496
6516
|
throw new Error("Media devices are not available in this environment");
|
|
6497
|
-
const r = e.constraints ?? {}, n = e.options?.framerate ??
|
|
6517
|
+
const r = e.constraints ?? {}, n = e.options?.framerate ?? il, s = {
|
|
6498
6518
|
...r,
|
|
6499
6519
|
frameRate: r.frameRate ?? { ideal: n }
|
|
6500
6520
|
};
|
|
@@ -6505,10 +6525,10 @@ class cl {
|
|
|
6505
6525
|
if (!r)
|
|
6506
6526
|
throw new Error("Cannot start video capture before client is connected");
|
|
6507
6527
|
this.ensurePorts();
|
|
6508
|
-
const n =
|
|
6528
|
+
const n = ul(), s = await this.getMediaStream(e), i = s.getVideoTracks()[0];
|
|
6509
6529
|
if (!i)
|
|
6510
6530
|
throw s.getTracks().forEach((I) => I.stop()), new Error("No video track available");
|
|
6511
|
-
const o = i.getSettings(), a = e.options?.width ?? o.width ?? Mr, c = e.options?.height ?? o.height ?? Or, u =
|
|
6531
|
+
const o = i.getSettings(), a = e.options?.width ?? o.width ?? Mr, c = e.options?.height ?? o.height ?? Or, u = hl(), d = new u({ track: i }).readable, h = this.allocateTrackId(), E = this.ensureWorker();
|
|
6512
6532
|
E.postMessage(
|
|
6513
6533
|
{
|
|
6514
6534
|
type: "start",
|
|
@@ -6576,12 +6596,12 @@ class cl {
|
|
|
6576
6596
|
this.protocolPort?.close(), this.protocolPort = null, this.sendPort?.close(), this.sendPort = null;
|
|
6577
6597
|
}
|
|
6578
6598
|
}
|
|
6579
|
-
class
|
|
6599
|
+
class fl {
|
|
6580
6600
|
audio;
|
|
6581
6601
|
video;
|
|
6582
6602
|
image;
|
|
6583
6603
|
constructor(e, r) {
|
|
6584
|
-
this.audio = new
|
|
6604
|
+
this.audio = new sl(e, r?.audio), this.video = new dl(e), this.image = new cl();
|
|
6585
6605
|
}
|
|
6586
6606
|
dispose() {
|
|
6587
6607
|
this.audio.dispose(), this.video.dispose();
|
|
@@ -6593,7 +6613,7 @@ const ut = {
|
|
|
6593
6613
|
[k.WebTransportProxy]: 2,
|
|
6594
6614
|
[k.WebSocketProxy]: 3
|
|
6595
6615
|
}, Ae = "ikon_endpoint_type";
|
|
6596
|
-
class
|
|
6616
|
+
class El {
|
|
6597
6617
|
isLocal;
|
|
6598
6618
|
workingEndpointType = null;
|
|
6599
6619
|
constructor(e) {
|
|
@@ -6655,7 +6675,7 @@ class ul {
|
|
|
6655
6675
|
}
|
|
6656
6676
|
}
|
|
6657
6677
|
const A = L("IkonClient");
|
|
6658
|
-
class
|
|
6678
|
+
class Ml {
|
|
6659
6679
|
channelManager = null;
|
|
6660
6680
|
protocolWorker = null;
|
|
6661
6681
|
workerManagerState = null;
|
|
@@ -6710,27 +6730,27 @@ class bl {
|
|
|
6710
6730
|
return this._mediaCapture;
|
|
6711
6731
|
}
|
|
6712
6732
|
constructor(e) {
|
|
6713
|
-
this.config = e, this.slowConnectionThresholdMs = e.timeouts?.slowConnectionThresholdMs ??
|
|
6733
|
+
this.config = e, this.slowConnectionThresholdMs = e.timeouts?.slowConnectionThresholdMs ?? Ba, this.connectionTimeoutMs = e.timeouts?.connectionTimeoutMs ?? Ga;
|
|
6714
6734
|
const r = [e.local, e.apiKey, e.sessionToken].filter(Boolean).length;
|
|
6715
6735
|
if (r === 0)
|
|
6716
6736
|
throw new Error('IkonClient requires one of: "local", "apiKey", or "sessionToken" configuration');
|
|
6717
6737
|
if (r > 1)
|
|
6718
6738
|
throw new Error('IkonClient accepts only one of: "local", "apiKey", or "sessionToken" configuration');
|
|
6719
|
-
this.endpointSelector = new
|
|
6739
|
+
this.endpointSelector = new El({
|
|
6720
6740
|
local: e.local
|
|
6721
|
-
}), this._functionRegistry = new
|
|
6741
|
+
}), this._functionRegistry = new Rc(), nt() && !e.disableBrowserFunctions && (this.unregisterBrowserFunctions = Ac(this._functionRegistry));
|
|
6722
6742
|
const n = e.audio ? {
|
|
6723
6743
|
performance: e.audio.performance,
|
|
6724
6744
|
background: e.audio.background,
|
|
6725
6745
|
diagnostics: e.audio.diagnostics
|
|
6726
6746
|
} : void 0, s = e.video ? { performance: e.video.performance } : void 0;
|
|
6727
|
-
this._media = new
|
|
6747
|
+
this._media = new Zc(this, { audio: n, video: s, mediaSession: e.mediaSession }), this._media.audio.setEnabled(!0), this._media.video.setEnabled(!0), nt() && (this._mediaCapture = new fl(this, {
|
|
6728
6748
|
audio: {
|
|
6729
6749
|
performance: {
|
|
6730
6750
|
preferWebCodecs: e.audio?.performance?.preferWebCodecs
|
|
6731
6751
|
}
|
|
6732
6752
|
}
|
|
6733
|
-
}), this.unregisterMediaCaptureFunctions =
|
|
6753
|
+
}), this.unregisterMediaCaptureFunctions = Oc(this._functionRegistry, this));
|
|
6734
6754
|
}
|
|
6735
6755
|
_lastError = void 0;
|
|
6736
6756
|
/**
|
|
@@ -6971,11 +6991,11 @@ class bl {
|
|
|
6971
6991
|
async authenticate() {
|
|
6972
6992
|
const e = this.abortController?.signal;
|
|
6973
6993
|
if (this.config.local)
|
|
6974
|
-
return
|
|
6994
|
+
return ja(this.config.local, e);
|
|
6975
6995
|
if (this.config.apiKey)
|
|
6976
|
-
return
|
|
6996
|
+
return za(this.config.apiKey, e);
|
|
6977
6997
|
if (this.config.sessionToken)
|
|
6978
|
-
return
|
|
6998
|
+
return Xa(this.config.sessionToken, e);
|
|
6979
6999
|
throw new Error("No connection configuration provided (need local, apiKey, or sessionToken)");
|
|
6980
7000
|
}
|
|
6981
7001
|
/**
|
|
@@ -6989,7 +7009,7 @@ class bl {
|
|
|
6989
7009
|
}
|
|
6990
7010
|
if (r === S.CORE_GLOBAL_STATE)
|
|
6991
7011
|
try {
|
|
6992
|
-
this._globalState =
|
|
7012
|
+
this._globalState = Bo(e), this._globalStateReceived || (this._globalStateReceived = !0, this.tryHandleJoined());
|
|
6993
7013
|
} catch (s) {
|
|
6994
7014
|
A.error("Failed to parse GlobalState:", s);
|
|
6995
7015
|
}
|
|
@@ -7077,7 +7097,7 @@ class bl {
|
|
|
7077
7097
|
}
|
|
7078
7098
|
let r;
|
|
7079
7099
|
try {
|
|
7080
|
-
r = new
|
|
7100
|
+
r = new Ca();
|
|
7081
7101
|
} catch (f) {
|
|
7082
7102
|
A.warn(`Failed to create protocol worker, falling back to main thread: ${f}`), await this.connectProtocolOnMainThread(e);
|
|
7083
7103
|
return;
|
|
@@ -7126,7 +7146,7 @@ class bl {
|
|
|
7126
7146
|
}
|
|
7127
7147
|
}
|
|
7128
7148
|
async connectProtocolOnMainThread(e) {
|
|
7129
|
-
this.workerManagerState = null, this.protocolWorker = null, this.channelManager = new
|
|
7149
|
+
this.workerManagerState = null, this.protocolWorker = null, this.channelManager = new Fa({
|
|
7130
7150
|
sessionId: this._sessionId,
|
|
7131
7151
|
keepaliveTimeoutMs: this.config.timeouts?.keepaliveTimeoutMs ?? Ze,
|
|
7132
7152
|
reconnectBackoffMs: this.config.timeouts?.reconnectBackoffMs ?? qe,
|
|
@@ -7257,121 +7277,121 @@ class bl {
|
|
|
7257
7277
|
}
|
|
7258
7278
|
}
|
|
7259
7279
|
}
|
|
7260
|
-
function
|
|
7280
|
+
function Ol(t) {
|
|
7261
7281
|
return t === "connecting" || t === "connectingSlow" || t === "reconnecting";
|
|
7262
7282
|
}
|
|
7263
|
-
function
|
|
7283
|
+
function Ll(t) {
|
|
7264
7284
|
return t === "connected";
|
|
7265
7285
|
}
|
|
7266
|
-
function
|
|
7286
|
+
function vl(t) {
|
|
7267
7287
|
return t === "offline" || t === "offlineError" || t === "idle";
|
|
7268
7288
|
}
|
|
7269
|
-
function
|
|
7289
|
+
function Pl(t) {
|
|
7270
7290
|
return t === "offlineError";
|
|
7271
7291
|
}
|
|
7272
7292
|
const vr = /* @__PURE__ */ new Map();
|
|
7273
7293
|
for (const [t, e] of Object.entries(S))
|
|
7274
7294
|
typeof e == "number" && vr.set(e, t);
|
|
7275
|
-
function
|
|
7295
|
+
function Fl(t) {
|
|
7276
7296
|
return vr.get(t) ?? `UNKNOWN_${t}`;
|
|
7277
7297
|
}
|
|
7278
|
-
const
|
|
7279
|
-
let O = [], Ue =
|
|
7280
|
-
function
|
|
7298
|
+
const Pr = 1e3, Fr = Ir.INFO;
|
|
7299
|
+
let O = [], Ue = Pr, Br = Fr, De = null;
|
|
7300
|
+
function pl(t) {
|
|
7281
7301
|
t.level < Br || (O.push(t), O.length > Ue && (O = O.slice(-Ue)));
|
|
7282
7302
|
}
|
|
7283
|
-
function
|
|
7284
|
-
Ue = t?.maxBufferSize ??
|
|
7303
|
+
function Il(t) {
|
|
7304
|
+
Ue = t?.maxBufferSize ?? Pr, Br = t?.minLevel ?? Fr, O = [], ka(pl);
|
|
7285
7305
|
}
|
|
7286
|
-
function
|
|
7306
|
+
function Bl(t) {
|
|
7287
7307
|
De = t;
|
|
7288
7308
|
}
|
|
7289
|
-
function
|
|
7309
|
+
function Gl() {
|
|
7290
7310
|
return O;
|
|
7291
7311
|
}
|
|
7292
|
-
function
|
|
7312
|
+
function ml() {
|
|
7293
7313
|
const t = O;
|
|
7294
7314
|
return O = [], t;
|
|
7295
7315
|
}
|
|
7296
|
-
function
|
|
7316
|
+
function xl() {
|
|
7297
7317
|
if (!De || O.length === 0)
|
|
7298
7318
|
return 0;
|
|
7299
|
-
const t =
|
|
7319
|
+
const t = ml();
|
|
7300
7320
|
return De(t), t.length;
|
|
7301
7321
|
}
|
|
7302
|
-
function
|
|
7322
|
+
function Vl() {
|
|
7303
7323
|
O = [];
|
|
7304
7324
|
}
|
|
7305
|
-
function
|
|
7325
|
+
function Wl() {
|
|
7306
7326
|
return O.length;
|
|
7307
7327
|
}
|
|
7308
|
-
|
|
7328
|
+
Il();
|
|
7309
7329
|
export {
|
|
7310
7330
|
y as AuthenticationError,
|
|
7311
|
-
|
|
7312
|
-
|
|
7313
|
-
|
|
7331
|
+
Pa as Channel,
|
|
7332
|
+
Fa as ChannelManager,
|
|
7333
|
+
Tl as ChannelNotFoundError,
|
|
7314
7334
|
X as ClientType,
|
|
7315
7335
|
Ve as ConnectionError,
|
|
7316
7336
|
J as ContextType,
|
|
7317
|
-
|
|
7337
|
+
El as EndpointSelector,
|
|
7318
7338
|
k as EntrypointType,
|
|
7319
|
-
|
|
7320
|
-
|
|
7339
|
+
Rc as FunctionRegistry,
|
|
7340
|
+
Rl as IKON_AUTH_BASE_URL,
|
|
7321
7341
|
rt as IKON_AUTH_URL_DEV,
|
|
7322
7342
|
tt as IKON_AUTH_URL_PROD,
|
|
7323
7343
|
pe as IKON_BACKEND_URL_DEV,
|
|
7324
7344
|
Re as IKON_BACKEND_URL_PROD,
|
|
7325
|
-
|
|
7345
|
+
sl as IkonAudioCapture,
|
|
7326
7346
|
je as IkonAudioPlayback,
|
|
7327
|
-
|
|
7328
|
-
|
|
7329
|
-
|
|
7330
|
-
|
|
7331
|
-
|
|
7332
|
-
|
|
7347
|
+
Ml as IkonClient,
|
|
7348
|
+
cl as IkonImageCapture,
|
|
7349
|
+
Zc as IkonMedia,
|
|
7350
|
+
fl as IkonMediaCapture,
|
|
7351
|
+
dl as IkonVideoCapture,
|
|
7352
|
+
Qc as IkonVideoPlayback,
|
|
7333
7353
|
We as KeepaliveTimeoutError,
|
|
7334
7354
|
Ir as LogLevel,
|
|
7335
|
-
|
|
7336
|
-
|
|
7355
|
+
Ra as MaxRetriesExceededError,
|
|
7356
|
+
wl as NoChannelsError,
|
|
7337
7357
|
S as Opcode,
|
|
7338
|
-
|
|
7339
|
-
|
|
7358
|
+
ba as ProvisioningTimeoutError,
|
|
7359
|
+
Sl as SpaceNotFoundError,
|
|
7340
7360
|
W as TransportError,
|
|
7341
7361
|
Z as UserType,
|
|
7342
|
-
|
|
7343
|
-
|
|
7344
|
-
|
|
7362
|
+
_l as asProtocolMessage,
|
|
7363
|
+
gl as clearDeviceId,
|
|
7364
|
+
Vl as clearLogBuffer,
|
|
7345
7365
|
L as createLogger,
|
|
7346
|
-
|
|
7347
|
-
|
|
7348
|
-
|
|
7349
|
-
|
|
7350
|
-
|
|
7351
|
-
|
|
7352
|
-
|
|
7353
|
-
|
|
7354
|
-
|
|
7355
|
-
|
|
7366
|
+
Ul as deriveAuthUrl,
|
|
7367
|
+
kl as deriveBackendType,
|
|
7368
|
+
bl as deriveBackendUrl,
|
|
7369
|
+
Cl as extractUserIdFromToken,
|
|
7370
|
+
xl as flushLogs,
|
|
7371
|
+
Gl as getBufferedLogs,
|
|
7372
|
+
Wl as getLogBufferSize,
|
|
7373
|
+
yl as getLogLevel,
|
|
7374
|
+
Nl as getLogSink,
|
|
7375
|
+
Fl as getOpcodeName,
|
|
7356
7376
|
$e as getOrCreateDeviceId,
|
|
7357
|
-
|
|
7377
|
+
Il as initializeLogSink,
|
|
7358
7378
|
br as isAudioWorkletSupported,
|
|
7359
7379
|
nt as isBrowserEnvironment,
|
|
7360
7380
|
Ke as isCloudEnvironment,
|
|
7361
|
-
|
|
7362
|
-
|
|
7363
|
-
|
|
7364
|
-
|
|
7381
|
+
Ll as isConnected,
|
|
7382
|
+
Ol as isConnecting,
|
|
7383
|
+
Pl as isError,
|
|
7384
|
+
vl as isOffline,
|
|
7365
7385
|
le as isSharedArrayBufferSupported,
|
|
7366
7386
|
mr as isWebTransportSupported,
|
|
7367
|
-
|
|
7387
|
+
Dl as parseUrlParams,
|
|
7368
7388
|
ue as readOpcode,
|
|
7369
7389
|
ce as readOpcodeGroup,
|
|
7370
7390
|
ne as readProtocolMessageHeaders,
|
|
7371
|
-
|
|
7372
|
-
|
|
7373
|
-
|
|
7374
|
-
|
|
7375
|
-
|
|
7376
|
-
|
|
7391
|
+
Ac as registerBrowserFunctions,
|
|
7392
|
+
Al as setLogLevel,
|
|
7393
|
+
ka as setLogSink,
|
|
7394
|
+
Bl as setSendLogsCallback,
|
|
7395
|
+
ml as takeBufferedLogs,
|
|
7396
|
+
bc as withResultData
|
|
7377
7397
|
};
|