@telnyx/ai-agent-lib 0.2.11 → 0.2.12
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.js +204 -205
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -26,8 +26,8 @@ function O(t, e, n, i) {
|
|
|
26
26
|
}
|
|
27
27
|
function d(h) {
|
|
28
28
|
var f;
|
|
29
|
-
h.done ? s(h.value) : (f = h.value, f instanceof n ? f : new n((function(
|
|
30
|
-
|
|
29
|
+
h.done ? s(h.value) : (f = h.value, f instanceof n ? f : new n((function(v) {
|
|
30
|
+
v(f);
|
|
31
31
|
}))).then(o, l);
|
|
32
32
|
}
|
|
33
33
|
d((i = i.apply(t, [])).next());
|
|
@@ -39,7 +39,7 @@ function Ln() {
|
|
|
39
39
|
return gt(xn);
|
|
40
40
|
}
|
|
41
41
|
for (var Ht = [], xe = 0; xe < 256; ++xe) Ht[xe] = (xe + 256).toString(16).substr(1);
|
|
42
|
-
function
|
|
42
|
+
function me(t, e, n) {
|
|
43
43
|
var i = e && n || 0;
|
|
44
44
|
typeof t == "string" && (e = t === "binary" ? new Array(16) : null, t = null);
|
|
45
45
|
var s = (t = t || {}).random || (t.rng || Ln)();
|
|
@@ -49,7 +49,7 @@ function ve(t, e, n) {
|
|
|
49
49
|
return [h[o[d++]], h[o[d++]], h[o[d++]], h[o[d++]], "-", h[o[d++]], h[o[d++]], "-", h[o[d++]], h[o[d++]], "-", h[o[d++]], h[o[d++]], "-", h[o[d++]], h[o[d++]], h[o[d++]], h[o[d++]], h[o[d++]], h[o[d++]]].join("");
|
|
50
50
|
})(s);
|
|
51
51
|
}
|
|
52
|
-
const
|
|
52
|
+
const vt = "wss://rtc.telnyx.com", qt = { urls: "stun:stun.l.google.com:19302" }, On = [{ urls: "stun:stun.telnyx.com:3478" }, qt, { urls: "turn:turn.telnyx.com:3478?transport=tcp", username: "testuser", credential: "testpassword" }], Mn = [{ urls: "stun:stundev.telnyx.com:3478" }, qt, { urls: "turn:turndev.telnyx.com:3478?transport=tcp", username: "testuser", credential: "testpassword" }];
|
|
53
53
|
var L;
|
|
54
54
|
(function(t) {
|
|
55
55
|
t.SocketOpen = "telnyx.socket.open", t.SocketClose = "telnyx.socket.close", t.SocketError = "telnyx.socket.error", t.SocketMessage = "telnyx.socket.message", t.SpeedTest = "telnyx.internal.speedtest", t.Ready = "telnyx.ready", t.Error = "telnyx.error", t.Notification = "telnyx.notification", t.StatsFrame = "telnyx.stats.frame", t.StatsReport = "telnyx.stats.report", t.Messages = "telnyx.messages", t.Calls = "telnyx.calls", t.MediaError = "telnyx.rtc.mediaError", t.PeerConnectionFailureError = "telnyx.rtc.peerConnectionFailureError";
|
|
@@ -89,7 +89,7 @@ var Dn = Jt((function(t) {
|
|
|
89
89
|
typeof console !== s && (h.call(this, _, A), this[p].apply(this, arguments));
|
|
90
90
|
};
|
|
91
91
|
}
|
|
92
|
-
function
|
|
92
|
+
function v(p, _, A) {
|
|
93
93
|
return (function(E) {
|
|
94
94
|
return E === "debug" && (E = "log"), typeof console !== s && (E === "trace" && a ? d : console[E] !== void 0 ? l(console, E) : console.log !== void 0 ? l(console, "log") : i);
|
|
95
95
|
})(p) || f.apply(this, arguments);
|
|
@@ -113,7 +113,7 @@ var Dn = Jt((function(t) {
|
|
|
113
113
|
return P.levels[x] === void 0 && (x = void 0), x;
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
|
-
typeof p == "string" ? D += ":" + p : typeof p == "symbol" && (D = void 0), P.name = p, P.levels = { TRACE: 0, DEBUG: 1, INFO: 2, WARN: 3, ERROR: 4, SILENT: 5 }, P.methodFactory = A ||
|
|
116
|
+
typeof p == "string" ? D += ":" + p : typeof p == "symbol" && (D = void 0), P.name = p, P.levels = { TRACE: 0, DEBUG: 1, INFO: 2, WARN: 3, ERROR: 4, SILENT: 5 }, P.methodFactory = A || v, P.getLevel = function() {
|
|
117
117
|
return E;
|
|
118
118
|
}, P.setLevel = function(x, r) {
|
|
119
119
|
if (typeof x == "string" && P.levels[x.toUpperCase()] !== void 0 && (x = P.levels[x.toUpperCase()]), !(typeof x == "number" && x >= 0 && x <= P.levels.SILENT)) throw "log.setLevel() called with invalid level: " + x;
|
|
@@ -204,7 +204,7 @@ const Le = (t) => {
|
|
|
204
204
|
let l = "", d = "";
|
|
205
205
|
return !((n = (e = t?.result) === null || e === void 0 ? void 0 : e.params) === null || n === void 0) && n.state && (l = (s = (i = t?.result) === null || i === void 0 ? void 0 : i.params) === null || s === void 0 ? void 0 : s.state), !((a = t?.params) === null || a === void 0) && a.state && (d = (o = t?.params) === null || o === void 0 ? void 0 : o.state), l || d;
|
|
206
206
|
};
|
|
207
|
-
function
|
|
207
|
+
function mt({ debounceTime: t }) {
|
|
208
208
|
let e, n;
|
|
209
209
|
return { promise: new Promise(((i, s) => {
|
|
210
210
|
e = t ? jn(i, t) : i, n = s;
|
|
@@ -277,9 +277,9 @@ let $n = typeof WebSocket < "u" ? WebSocket : null;
|
|
|
277
277
|
const Bn = 0, Vn = 1, Gn = 2, Wn = 3;
|
|
278
278
|
class yt {
|
|
279
279
|
constructor(e) {
|
|
280
|
-
this.session = e, this.previousGatewayState = "", this._wsClient = null, this._host =
|
|
280
|
+
this.session = e, this.previousGatewayState = "", this._wsClient = null, this._host = vt, this._timers = {}, this._useCanaryRtcServer = !1, this._hasCanaryBeenUsed = !1, this.upDur = null, this.downDur = null;
|
|
281
281
|
const { host: n, env: i, region: s, trickleIce: a, useCanaryRtcServer: o } = e.options;
|
|
282
|
-
i && (this._host = i === "development" ? "wss://rtcdev.telnyx.com" :
|
|
282
|
+
i && (this._host = i === "development" ? "wss://rtcdev.telnyx.com" : vt), n && (this._host = ((l) => `${Un.test(l) ? "" : "wss://"}${l}`)(n)), s && (this._host = this._host.replace(/rtc(dev)?/, `${s}.rtc$1`)), (a || o) && (this._useCanaryRtcServer = !0);
|
|
283
283
|
}
|
|
284
284
|
get connected() {
|
|
285
285
|
return this._wsClient && this._wsClient.readyState === Vn;
|
|
@@ -350,7 +350,7 @@ class yt {
|
|
|
350
350
|
}
|
|
351
351
|
class Re {
|
|
352
352
|
buildRequest(e) {
|
|
353
|
-
this.request = Object.assign({ jsonrpc: "2.0", id:
|
|
353
|
+
this.request = Object.assign({ jsonrpc: "2.0", id: me() }, e);
|
|
354
354
|
}
|
|
355
355
|
}
|
|
356
356
|
const bt = { id: "callID", destinationNumber: "destination_number", remoteCallerName: "remote_caller_id_name", remoteCallerNumber: "remote_caller_id_number", callerName: "caller_id_name", callerNumber: "caller_id_number", customHeaders: "custom_headers" };
|
|
@@ -375,10 +375,10 @@ class Hn {
|
|
|
375
375
|
n.id === this.pendingRequestId && this.gatewayStateTask.resolve(ht(n));
|
|
376
376
|
})), this.getIsRegistered = () => O(this, void 0, void 0, (function* () {
|
|
377
377
|
const n = new Zt(fe());
|
|
378
|
-
this.pendingRequestId = n.request.id, this.gatewayStateTask =
|
|
378
|
+
this.pendingRequestId = n.request.id, this.gatewayStateTask = mt({}), this.session.execute(n);
|
|
379
379
|
const i = yield this.gatewayStateTask.promise;
|
|
380
380
|
return !!i && [te.REGISTER, te.REGED].includes(i);
|
|
381
|
-
})), this.session = e, this.gatewayStateTask =
|
|
381
|
+
})), this.session = e, this.gatewayStateTask = mt({}), this.session.on("telnyx.socket.message", this.onSocketMessage);
|
|
382
382
|
}
|
|
383
383
|
}
|
|
384
384
|
class en extends Z {
|
|
@@ -388,7 +388,7 @@ class en extends Z {
|
|
|
388
388
|
}
|
|
389
389
|
class qn {
|
|
390
390
|
constructor(e) {
|
|
391
|
-
if (this.options = e, this.uuid =
|
|
391
|
+
if (this.options = e, this.uuid = me(), this.sessionid = "", this.subscriptions = {}, this.signature = null, this.relayProtocol = null, this.contexts = [], this.timeoutErrorCode = -32e3, this.invalidMethodErrorCode = -32601, this.authenticationRequiredErrorCode = -32e3, this.connection = null, this._jwtAuth = !1, this._autoReconnect = !0, this._idle = !1, this._executeQueue = [], !this.validateOptions()) throw new Error("Invalid init options");
|
|
392
392
|
y.setLevel(e.debug ? "debug" : "info"), this._onSocketOpen = this._onSocketOpen.bind(this), this.onNetworkClose = this.onNetworkClose.bind(this), this._onSocketMessage = this._onSocketMessage.bind(this), this._handleLoginError = this._handleLoginError.bind(this), this._attachListeners(), this.connection = new yt(this), this.registerAgent = new Hn(this);
|
|
393
393
|
}
|
|
394
394
|
get __logger() {
|
|
@@ -487,7 +487,7 @@ class qn {
|
|
|
487
487
|
ue(e);
|
|
488
488
|
}
|
|
489
489
|
static uuid() {
|
|
490
|
-
return
|
|
490
|
+
return me();
|
|
491
491
|
}
|
|
492
492
|
clearConnection() {
|
|
493
493
|
this.connection = null;
|
|
@@ -555,7 +555,7 @@ const tt = (t) => navigator.mediaDevices.getUserMedia(t), ge = (t) => t && t ins
|
|
|
555
555
|
return Object.keys(e).forEach(((n) => {
|
|
556
556
|
e[n] = t[`${n}Channels`] || [];
|
|
557
557
|
})), e;
|
|
558
|
-
},
|
|
558
|
+
}, ve = (t, e = null, n = null) => {
|
|
559
559
|
if (!ge(t)) return null;
|
|
560
560
|
let i = [];
|
|
561
561
|
switch (e) {
|
|
@@ -583,11 +583,11 @@ const tt = (t) => navigator.mediaDevices.getUserMedia(t), ge = (t) => t && t ins
|
|
|
583
583
|
}
|
|
584
584
|
}));
|
|
585
585
|
}, _t = (t) => {
|
|
586
|
-
|
|
586
|
+
ve(t, "audio", !0);
|
|
587
587
|
}, st = (t) => {
|
|
588
|
-
|
|
588
|
+
ve(t, "audio", !1);
|
|
589
589
|
}, wt = (t) => {
|
|
590
|
-
|
|
590
|
+
ve(t, "audio", null);
|
|
591
591
|
}, zn = (t) => ((e, n = null) => {
|
|
592
592
|
if (!ge(e)) return null;
|
|
593
593
|
let i = [];
|
|
@@ -608,20 +608,20 @@ function Kn() {
|
|
|
608
608
|
const { browserInfo: t, name: e, version: n, supportAudio: i, supportVideo: s } = (function() {
|
|
609
609
|
if (!window || !window.navigator || !window.navigator.userAgent) throw new Error("You should use @telnyx/webrtc in a web browser such as Chrome|Firefox|Safari");
|
|
610
610
|
if (navigator.userAgent.match(/chrom(e|ium)/gim) && !navigator.userAgent.match(/OPR\/[0-9]{2}/gi) && !navigator.userAgent.match(/edg/gim)) {
|
|
611
|
-
const f = navigator.userAgent.match(/chrom(e|ium)\/[0-9]+\./gim)[0].split("/"),
|
|
612
|
-
return { browserInfo: navigator.userAgent, name:
|
|
611
|
+
const f = navigator.userAgent.match(/chrom(e|ium)\/[0-9]+\./gim)[0].split("/"), v = f[0], S = parseInt(f[1], 10);
|
|
612
|
+
return { browserInfo: navigator.userAgent, name: v, version: S, supportAudio: !0, supportVideo: !0 };
|
|
613
613
|
}
|
|
614
614
|
if (navigator.userAgent.match(/firefox/gim) && !navigator.userAgent.match(/OPR\/[0-9]{2}/gi) && !navigator.userAgent.match(/edg/gim)) {
|
|
615
|
-
const f = navigator.userAgent.match(/firefox\/[0-9]+\./gim)[0].split("/"),
|
|
616
|
-
return { browserInfo: navigator.userAgent, name:
|
|
615
|
+
const f = navigator.userAgent.match(/firefox\/[0-9]+\./gim)[0].split("/"), v = f[0], S = parseInt(f[1], 10);
|
|
616
|
+
return { browserInfo: navigator.userAgent, name: v, version: S, supportAudio: !0, supportVideo: !1 };
|
|
617
617
|
}
|
|
618
618
|
if (navigator.userAgent.match(/safari/gim) && !navigator.userAgent.match(/OPR\/[0-9]{2}/gi) && !navigator.userAgent.match(/edg/gim)) {
|
|
619
|
-
const f = navigator.userAgent.match(/safari/gim)[0],
|
|
619
|
+
const f = navigator.userAgent.match(/safari/gim)[0], v = navigator.userAgent.match(/version\/[0-9]+\./gim)[0].split("/"), S = parseInt(v[1], 10);
|
|
620
620
|
return { browserInfo: navigator.userAgent, name: f, version: S, supportAudio: !0, supportVideo: !0 };
|
|
621
621
|
}
|
|
622
622
|
if (navigator.userAgent.match(/edg/gim) && !navigator.userAgent.match(/OPR\/[0-9]{2}/gi)) {
|
|
623
|
-
const f = navigator.userAgent.match(/edg\/[0-9]+\./gim)[0].split("/"),
|
|
624
|
-
return { browserInfo: navigator.userAgent, name:
|
|
623
|
+
const f = navigator.userAgent.match(/edg\/[0-9]+\./gim)[0].split("/"), v = f[0], S = parseInt(f[1], 10);
|
|
624
|
+
return { browserInfo: navigator.userAgent, name: v, version: S, supportAudio: !0, supportVideo: !0 };
|
|
625
625
|
}
|
|
626
626
|
throw new Error("This browser does not support @telnyx/webrtc. To see browser support list: `TelnyxRTC.webRTCSupportedBrowserList()`");
|
|
627
627
|
})(), a = window.RTCPeerConnection, o = window.RTCSessionDescription, l = window.RTCIceCandidate, d = window.navigator && window.navigator.mediaDevices, h = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.msGetUserMedia || navigator.mozGetUserMedia;
|
|
@@ -727,7 +727,7 @@ class ni extends Z {
|
|
|
727
727
|
}
|
|
728
728
|
class ii extends Re {
|
|
729
729
|
constructor(e, n) {
|
|
730
|
-
super(), this.method = "ai_conversation", this.buildRequest({ method: this.method, params: { type: "conversation.item.create", previous_item_id: null, item: { id:
|
|
730
|
+
super(), this.method = "ai_conversation", this.buildRequest({ method: this.method, params: { type: "conversation.item.create", previous_item_id: null, item: { id: me(), type: "message", role: "user", content: [{ type: "input_text", text: e }, ...n?.map(((i) => ({ type: "image_url", image_url: { url: i } })))] } } });
|
|
731
731
|
}
|
|
732
732
|
}
|
|
733
733
|
var Oe, rn = Jt((function(t, e) {
|
|
@@ -797,33 +797,33 @@ var Oe, rn = Jt((function(t, e) {
|
|
|
797
797
|
var ne = typeof u == "function";
|
|
798
798
|
switch (g = arguments.length) {
|
|
799
799
|
case 1:
|
|
800
|
-
(function(G,
|
|
801
|
-
if (
|
|
800
|
+
(function(G, m, M) {
|
|
801
|
+
if (m) G.call(M);
|
|
802
802
|
else for (var U = G.length, V = h(G, U), Y = 0; Y < U; ++Y) V[Y].call(M);
|
|
803
803
|
})(u, ne, this);
|
|
804
804
|
break;
|
|
805
805
|
case 2:
|
|
806
|
-
(function(G,
|
|
807
|
-
if (
|
|
806
|
+
(function(G, m, M, U) {
|
|
807
|
+
if (m) G.call(M, U);
|
|
808
808
|
else for (var V = G.length, Y = h(G, V), Q = 0; Q < V; ++Q) Y[Q].call(M, U);
|
|
809
809
|
})(u, ne, this, arguments[1]);
|
|
810
810
|
break;
|
|
811
811
|
case 3:
|
|
812
|
-
(function(G,
|
|
813
|
-
if (
|
|
812
|
+
(function(G, m, M, U, V) {
|
|
813
|
+
if (m) G.call(M, U, V);
|
|
814
814
|
else for (var Y = G.length, Q = h(G, Y), W = 0; W < Y; ++W) Q[W].call(M, U, V);
|
|
815
815
|
})(u, ne, this, arguments[1], arguments[2]);
|
|
816
816
|
break;
|
|
817
817
|
case 4:
|
|
818
|
-
(function(G,
|
|
819
|
-
if (
|
|
818
|
+
(function(G, m, M, U, V, Y) {
|
|
819
|
+
if (m) G.call(M, U, V, Y);
|
|
820
820
|
else for (var Q = G.length, W = h(G, Q), re = 0; re < Q; ++re) W[re].call(M, U, V, Y);
|
|
821
821
|
})(u, ne, this, arguments[1], arguments[2], arguments[3]);
|
|
822
822
|
break;
|
|
823
823
|
default:
|
|
824
824
|
for (b = Array(g - 1), T = 1; T < g; T++) b[T - 1] = arguments[T];
|
|
825
|
-
(function(G,
|
|
826
|
-
if (
|
|
825
|
+
(function(G, m, M, U) {
|
|
826
|
+
if (m) G.apply(M, U);
|
|
827
827
|
else for (var V = G.length, Y = h(G, V), Q = 0; Q < V; ++Q) Y[Q].apply(M, U);
|
|
828
828
|
})(u, ne, this, b);
|
|
829
829
|
}
|
|
@@ -884,10 +884,10 @@ var Oe, rn = Jt((function(t, e) {
|
|
|
884
884
|
}, s.prototype.listenerCount = d, s.prototype.eventNames = function() {
|
|
885
885
|
return 0 < this._eventsCount ? Reflect.ownKeys(this._events) : [];
|
|
886
886
|
};
|
|
887
|
-
var f,
|
|
887
|
+
var f, v = new Uint8Array(16);
|
|
888
888
|
function S() {
|
|
889
889
|
if (!f && !(f = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto < "u" && typeof msCrypto.getRandomValues == "function" && msCrypto.getRandomValues.bind(msCrypto))) throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
890
|
-
return f(
|
|
890
|
+
return f(v);
|
|
891
891
|
}
|
|
892
892
|
for (var w = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i, C = [], k = 0; 256 > k; ++k) C.push((k + 256).toString(16).substr(1));
|
|
893
893
|
function p(r) {
|
|
@@ -1132,7 +1132,7 @@ var Oe, rn = Jt((function(t, e) {
|
|
|
1132
1132
|
if (I && !this.checkIfConnectionIsClosed(g, b, I)) try {
|
|
1133
1133
|
const R = this.getTimestamp(), j = I.getStats(null);
|
|
1134
1134
|
if (j) {
|
|
1135
|
-
const ee = await j, ne = this.getTimestamp(), G = P(ee),
|
|
1135
|
+
const ee = await j, ne = this.getTimestamp(), G = P(ee), m = { remote: T.options.remote }, M = D(ee, T.stats.parsed, m), U = { event: "stats", tag: "stats", peerId: g, connectionId: b, timeTaken: ne - R, data: M };
|
|
1136
1136
|
this.rawStats === !0 && (U.rawStats = ee), this.statsObject === !0 && (U.statsObject = G), this.filteredStats === !0 && (U.filteredStats = this.filteroutStats(G)), u.push(U), T.stats.parsed = M;
|
|
1137
1137
|
} else this.logger.error(`PeerConnection from peer ${g} did not return any stats data`);
|
|
1138
1138
|
} catch (R) {
|
|
@@ -1308,10 +1308,10 @@ var Oe, rn = Jt((function(t, e) {
|
|
|
1308
1308
|
var si = rn.WebRTCStats;
|
|
1309
1309
|
function oi(t) {
|
|
1310
1310
|
const { packetsLost: e, packetsReceived: n, jitter: i, rtt: s } = t, a = (function(h) {
|
|
1311
|
-
const { jitter: f, rtt:
|
|
1311
|
+
const { jitter: f, rtt: v } = h, S = f + v / 2;
|
|
1312
1312
|
return 0.024 * S + 0.11 * (S - 177.3) * (S > 177.3 ? 1 : 0);
|
|
1313
1313
|
})({ rtt: s, jitter: i }), o = (function(h) {
|
|
1314
|
-
const { packetsLost: f, packetsReceived:
|
|
1314
|
+
const { packetsLost: f, packetsReceived: v } = h, S = f / (v + f) * 100;
|
|
1315
1315
|
return 20 * Math.log(1 + S);
|
|
1316
1316
|
})({ packetsLost: e, packetsReceived: n }), l = 93.2 - a - o + 0, d = 1 + 0.035 * l + 7e-6 * l * (l - 60) * (100 - l);
|
|
1317
1317
|
return Math.min(Math.max(d, 1), 5);
|
|
@@ -1339,10 +1339,10 @@ function Rt(t, e) {
|
|
|
1339
1339
|
return { errorCode: t.errorCode, errorText: t.errorText, url: t.url, address: t.address, port: t.port, connectionState: e.connectionState, iceConnectionState: e.iceConnectionState, iceGatheringState: e.iceGatheringState, signalingState: e.signalingState, localDescriptionType: (n = e.localDescription) === null || n === void 0 ? void 0 : n.type, remoteDescriptionType: (i = e.remoteDescription) === null || i === void 0 ? void 0 : i.type };
|
|
1340
1340
|
}
|
|
1341
1341
|
function di(t, e) {
|
|
1342
|
-
const n =
|
|
1342
|
+
const n = me(), i = new si({ getStatsInterval: 1e3, rawStats: !1, statsObject: !0, filteredStats: !1, remote: !0, debug: !1, logLevel: "warn" }), s = (a) => O(this, void 0, void 0, (function* () {
|
|
1343
1343
|
a.event === "stats" && F(L.StatsFrame, (function({ data: o }) {
|
|
1344
|
-
var l, d, h, f,
|
|
1345
|
-
const { audio: k, remote: p } = o, { audio: _ } = p, A = (d = (l = _.inbound[0]) === null || l === void 0 ? void 0 : l.jitter) !== null && d !== void 0 ? d : 1 / 0, E = (f = (h = _.inbound[0]) === null || h === void 0 ? void 0 : h.roundTripTime) !== null && f !== void 0 ? f : 1 / 0, P = (S = (
|
|
1344
|
+
var l, d, h, f, v, S, w, C;
|
|
1345
|
+
const { audio: k, remote: p } = o, { audio: _ } = p, A = (d = (l = _.inbound[0]) === null || l === void 0 ? void 0 : l.jitter) !== null && d !== void 0 ? d : 1 / 0, E = (f = (h = _.inbound[0]) === null || h === void 0 ? void 0 : h.roundTripTime) !== null && f !== void 0 ? f : 1 / 0, P = (S = (v = k.inbound[0]) === null || v === void 0 ? void 0 : v.packetsReceived) !== null && S !== void 0 ? S : -1, D = (C = (w = k.inbound[0]) === null || w === void 0 ? void 0 : w.packetsLost) !== null && C !== void 0 ? C : -1, q = oi({ jitter: 1e3 * A, rtt: 1e3 * E, packetsLost: D, packetsReceived: P });
|
|
1346
1346
|
return { jitter: A, rtt: E, mos: q, quality: ri(q), inboundAudio: k.inbound[0], outboundAudio: k.outbound[0], remoteInboundAudio: _.inbound[0], remoteOutboundAudio: _.outbound[0] };
|
|
1347
1347
|
})(a), t.uuid), yield t.execute(new li(n, a));
|
|
1348
1348
|
}));
|
|
@@ -1351,8 +1351,8 @@ function di(t, e) {
|
|
|
1351
1351
|
})), stop: (a) => O(this, void 0, void 0, (function* () {
|
|
1352
1352
|
const o = i.getTimeline();
|
|
1353
1353
|
F(L.StatsReport, o, t.uuid), a === "file" && (function(l, d) {
|
|
1354
|
-
const h = new Blob([JSON.stringify(l)], { type: "application/json" }), f = URL.createObjectURL(h),
|
|
1355
|
-
|
|
1354
|
+
const h = new Blob([JSON.stringify(l)], { type: "application/json" }), f = URL.createObjectURL(h), v = document.createElement("a");
|
|
1355
|
+
v.href = f, v.download = `${d}.json`, v.click(), URL.revokeObjectURL(f);
|
|
1356
1356
|
})(o, `webrtc-stats-${n}-${Date.now()}`), yield t.execute(new ci(n, e)), i.removeAllPeers(), i.destroy();
|
|
1357
1357
|
})), reportConnectionStateChange: (a) => {
|
|
1358
1358
|
const o = { event: "connectionstatechange-detailed", tag: "connection", timestamp: (/* @__PURE__ */ new Date()).toISOString(), data: a };
|
|
@@ -1389,9 +1389,9 @@ class xt {
|
|
|
1389
1389
|
if (y.info(`[${(/* @__PURE__ */ new Date()).toISOString()}] Connection State changed: ${this._prevConnectionState} -> ${l}`), l === "failed" || l === "disconnected") {
|
|
1390
1390
|
const d = () => O(this, void 0, void 0, (function* () {
|
|
1391
1391
|
if (this.isDebugEnabled && this.statsReporter) {
|
|
1392
|
-
const h = yield (function(f,
|
|
1392
|
+
const h = yield (function(f, v) {
|
|
1393
1393
|
return O(this, void 0, void 0, (function* () {
|
|
1394
|
-
const S = { connectionState: f.connectionState, previousConnectionState:
|
|
1394
|
+
const S = { connectionState: f.connectionState, previousConnectionState: v, iceConnectionState: f.iceConnectionState, iceGatheringState: f.iceGatheringState, signalingState: f.signalingState }, w = f.getTransceivers();
|
|
1395
1395
|
if (w.length > 0) {
|
|
1396
1396
|
const C = w[0].sender, k = C?.transport;
|
|
1397
1397
|
k && (S.dtlsState = k.state);
|
|
@@ -1503,18 +1503,18 @@ class xt {
|
|
|
1503
1503
|
}));
|
|
1504
1504
|
}
|
|
1505
1505
|
const { audioCodecs: l, videoCodecs: d } = ((h) => {
|
|
1506
|
-
const f = [],
|
|
1506
|
+
const f = [], v = [];
|
|
1507
1507
|
return h && h.length !== 0 ? (h.forEach(((S) => {
|
|
1508
1508
|
const w = S.mimeType.toLocaleLowerCase();
|
|
1509
|
-
w.startsWith("audio/") ? f.push(S) : w.startsWith("video/") &&
|
|
1510
|
-
})), { audioCodecs: f, videoCodecs:
|
|
1509
|
+
w.startsWith("audio/") ? f.push(S) : w.startsWith("video/") && v.push(S);
|
|
1510
|
+
})), { audioCodecs: f, videoCodecs: v }) : { audioCodecs: f, videoCodecs: v };
|
|
1511
1511
|
})(this.options.preferred_codecs);
|
|
1512
1512
|
if (this.isOffer && typeof this.instance.addTransceiver == "function") {
|
|
1513
1513
|
const h = { direction: "sendrecv", streams: [i] };
|
|
1514
1514
|
o.forEach(((f) => {
|
|
1515
1515
|
f.kind === "audio" && (this.options.userVariables.microphoneLabel = f.label), f.kind === "video" && (this.options.userVariables.cameraLabel = f.label);
|
|
1516
|
-
const
|
|
1517
|
-
f.kind === "audio" && l.length > 0 && this._setCodecs(
|
|
1516
|
+
const v = this.instance.addTransceiver(f, h);
|
|
1517
|
+
f.kind === "audio" && l.length > 0 && this._setCodecs(v, l), f.kind === "video" && d.length > 0 && this._setCodecs(v, d);
|
|
1518
1518
|
}));
|
|
1519
1519
|
} else typeof this.instance.addTrack == "function" ? (o.forEach(((h) => {
|
|
1520
1520
|
h.kind === "audio" && (this.options.userVariables.microphoneLabel = h.label), h.kind === "video" && (this.options.userVariables.cameraLabel = h.label), this.instance.addTrack(h, i);
|
|
@@ -1652,8 +1652,8 @@ class cn {
|
|
|
1652
1652
|
}));
|
|
1653
1653
|
}));
|
|
1654
1654
|
};
|
|
1655
|
-
const { iceServers: i, speaker: s, micId: a, micLabel: o, camId: l, camLabel: d, localElement: h, remoteElement: f, options:
|
|
1656
|
-
this.options = Object.assign({}, Fn, { audio: S, video: w, iceServers: n?.iceServers && Array.isArray(n.iceServers) ? n.iceServers : i, localElement: h, remoteElement: f, micId: a, micLabel: o, camId: l, camLabel: d, speakerId: s, ringtoneFile: C, ringbackFile: k, debug:
|
|
1655
|
+
const { iceServers: i, speaker: s, micId: a, micLabel: o, camId: l, camLabel: d, localElement: h, remoteElement: f, options: v, mediaConstraints: { audio: S, video: w }, ringtoneFile: C, ringbackFile: k } = e;
|
|
1656
|
+
this.options = Object.assign({}, Fn, { audio: S, video: w, iceServers: n?.iceServers && Array.isArray(n.iceServers) ? n.iceServers : i, localElement: h, remoteElement: f, micId: a, micLabel: o, camId: l, camLabel: d, speakerId: s, ringtoneFile: C, ringbackFile: k, debug: v.debug, debugOutput: v.debugOutput, trickleIce: v.trickleIce, prefetchIceCandidates: v.prefetchIceCandidates, keepConnectionAliveOnSocketClose: v.keepConnectionAliveOnSocketClose, mutedMicOnStart: v.mutedMicOnStart }, n), this._onMediaError = this._onMediaError.bind(this), this._onPeerConnectionFailureError = this._onPeerConnectionFailureError.bind(this), this._onTrickleIceSdp = this._onTrickleIceSdp.bind(this), this._registerPeerEvents = this._registerPeerEvents.bind(this), this._registerTrickleIcePeerEvents = this._registerTrickleIcePeerEvents.bind(this), this._init(), this.options && (this._ringtone = Ct(this.options.ringtoneFile, "_ringtone"), this._ringback = Ct(this.options.ringbackFile, "_ringback"));
|
|
1657
1657
|
}
|
|
1658
1658
|
get performanceMetrics() {
|
|
1659
1659
|
const e = performance.measure("peer-creation", "peer-creation-start", "peer-creation-end"), n = performance.measure("ice-gathering", "ice-gathering-start", "ice-gathering-end"), i = performance.measure("sdp-send", "sdp-send-start", "sdp-send-end"), s = performance.measure("total-duration", "peer-creation-start", "sdp-send-end"), a = (o) => `${o.toFixed(2)}ms`;
|
|
@@ -1763,15 +1763,15 @@ class cn {
|
|
|
1763
1763
|
}
|
|
1764
1764
|
muteVideo() {
|
|
1765
1765
|
var e;
|
|
1766
|
-
e = this.options.localStream,
|
|
1766
|
+
e = this.options.localStream, ve(e, "video", !1);
|
|
1767
1767
|
}
|
|
1768
1768
|
unmuteVideo() {
|
|
1769
1769
|
var e;
|
|
1770
|
-
e = this.options.localStream,
|
|
1770
|
+
e = this.options.localStream, ve(e, "video", !0);
|
|
1771
1771
|
}
|
|
1772
1772
|
toggleVideoMute() {
|
|
1773
1773
|
var e;
|
|
1774
|
-
e = this.options.localStream,
|
|
1774
|
+
e = this.options.localStream, ve(e, "video", null);
|
|
1775
1775
|
}
|
|
1776
1776
|
setVideoDevice(e) {
|
|
1777
1777
|
return O(this, void 0, void 0, (function* () {
|
|
@@ -1876,8 +1876,8 @@ class cn {
|
|
|
1876
1876
|
switch (i) {
|
|
1877
1877
|
case "bootObj": {
|
|
1878
1878
|
this._lastSerno = 0;
|
|
1879
|
-
const { chatChannel: l, infoChannel: d, modChannel: h, laName: f, conferenceMemberID:
|
|
1880
|
-
this._dispatchConferenceUpdate({ action: se.Join, conferenceName: f, participantId: Number(
|
|
1879
|
+
const { chatChannel: l, infoChannel: d, modChannel: h, laName: f, conferenceMemberID: v, role: S } = n;
|
|
1880
|
+
this._dispatchConferenceUpdate({ action: se.Join, conferenceName: f, participantId: Number(v), role: S }), l && (yield this._subscribeConferenceChat(l)), d && (yield this._subscribeConferenceInfo(d));
|
|
1881
1881
|
const w = [];
|
|
1882
1882
|
for (const C in s) w.push(Object.assign({ callId: s[C][0], index: Number(C) }, Le(s[C][1])));
|
|
1883
1883
|
this._dispatchConferenceUpdate({ action: se.Bootstrap, participants: w });
|
|
@@ -2095,7 +2095,7 @@ class cn {
|
|
|
2095
2095
|
_init() {
|
|
2096
2096
|
const { id: e, userVariables: n, remoteCallerNumber: i, onNotification: s } = this.options;
|
|
2097
2097
|
var a;
|
|
2098
|
-
this.options.id = e ? e.toString() :
|
|
2098
|
+
this.options.id = e ? e.toString() : me(), this.id = this.options.id, n && (a = n, Object.keys(a).length !== 0) || (this.options.userVariables = this.session.options.userVariables || {}), i || (this.options.remoteCallerNumber = this.options.destinationNumber), this.session.calls[this.id] = this, de(L.MediaError, this._onMediaError, this.id), de(L.PeerConnectionFailureError, this._onPeerConnectionFailureError, this.id), ye(s) && de(L.Notification, s.bind(this), this.id), this.setState(N.New), y.info("New Call with Options:", this.options);
|
|
2099
2099
|
}
|
|
2100
2100
|
_finalize() {
|
|
2101
2101
|
var e;
|
|
@@ -2287,7 +2287,7 @@ class hi extends qn {
|
|
|
2287
2287
|
return Yn(s), this._audioConstraints = yield ((a, o, l, d) => O(void 0, void 0, void 0, (function* () {
|
|
2288
2288
|
const { deviceId: h } = d;
|
|
2289
2289
|
if (h === void 0 && (a || o)) {
|
|
2290
|
-
const f = yield je(a, o, l).catch(((
|
|
2290
|
+
const f = yield je(a, o, l).catch(((v) => null));
|
|
2291
2291
|
f && (d.deviceId = { exact: f });
|
|
2292
2292
|
}
|
|
2293
2293
|
return d;
|
|
@@ -2397,17 +2397,17 @@ class J {
|
|
|
2397
2397
|
}
|
|
2398
2398
|
handleMessage(e) {
|
|
2399
2399
|
var n;
|
|
2400
|
-
const { session: i } = this, { id: s, method: a, params: o = {}, voice_sdk_id: l } = e, d = o?.callID, h = o?.eventChannel, f = o?.eventType,
|
|
2400
|
+
const { session: i } = this, { id: s, method: a, params: o = {}, voice_sdk_id: l } = e, d = o?.callID, h = o?.eventChannel, f = o?.eventType, v = a === $.Attach, S = a === $.Punt;
|
|
2401
2401
|
let w = !1;
|
|
2402
2402
|
if (f === "channelPvtData") return this._handlePvtEvent(o.pvtData);
|
|
2403
2403
|
if (d && i.calls.hasOwnProperty(d)) {
|
|
2404
|
-
if (!
|
|
2404
|
+
if (!v) return i.calls[d].handleMessage(e), void this._ack(s, a);
|
|
2405
2405
|
w = (i.options.keepConnectionAliveOnSocketClose || i.calls[d].options.keepConnectionAliveOnSocketClose) && !!(!((n = this.session.calls[d].peer) === null || n === void 0) && n.instance), w ? y.info(`[${(/* @__PURE__ */ new Date()).toISOString()}][${d}] re-attaching call due to ATTACH and keepConnectionAliveOnSocketClose`) : (y.info(`[${(/* @__PURE__ */ new Date()).toISOString()}][${d}] Hanging up the call due to ATTACH`), i.calls[d].hangup({}, !1));
|
|
2406
2406
|
}
|
|
2407
2407
|
if (S && i.options.keepConnectionAliveOnSocketClose) return y.info(`[${(/* @__PURE__ */ new Date()).toISOString()}][${d}] keeping call alive due to PUNT and keepConnectionAliveOnSocketClose. Disconnecting base session...`), this.session.socketDisconnect(), void this._ack(s, a);
|
|
2408
2408
|
const C = () => {
|
|
2409
2409
|
var _, A, E, P, D, q;
|
|
2410
|
-
const B = { id: d, audio: !0, video: i.options.video, remoteSdp: o.sdp, destinationNumber: o.callee_id_number, remoteCallerName: o.caller_id_name, remoteCallerNumber: o.caller_id_number, callerName: o.callee_id_name, callerNumber: o.callee_id_number, attach:
|
|
2410
|
+
const B = { id: d, audio: !0, video: i.options.video, remoteSdp: o.sdp, destinationNumber: o.callee_id_number, remoteCallerName: o.caller_id_name, remoteCallerNumber: o.caller_id_number, callerName: o.callee_id_name, callerNumber: o.callee_id_number, attach: v, mediaSettings: o.mediaSettings, debug: (_ = i.options.debug) !== null && _ !== void 0 && _, debugOutput: (A = i.options.debugOutput) !== null && A !== void 0 ? A : "socket", trickleIce: (E = i.options.trickleIce) !== null && E !== void 0 && E, prefetchIceCandidates: (P = i.options.prefetchIceCandidates) !== null && P !== void 0 && P, forceRelayCandidate: (D = i.options.forceRelayCandidate) !== null && D !== void 0 && D, keepConnectionAliveOnSocketClose: (q = i.options.keepConnectionAliveOnSocketClose) !== null && q !== void 0 && q };
|
|
2411
2411
|
o.telnyx_call_control_id && (B.telnyxCallControlId = o.telnyx_call_control_id), o.telnyx_session_id && (B.telnyxSessionId = o.telnyx_session_id), o.telnyx_leg_id && (B.telnyxLegId = o.telnyx_leg_id), o.client_state && (B.clientState = o.client_state), o.dialogParams && o.dialogParams.custom_headers && o.dialogParams.custom_headers.length && (B.customHeaders = o.dialogParams.custom_headers);
|
|
2412
2412
|
const x = new he(i, B);
|
|
2413
2413
|
return x.nodeId = this.nodeId, x;
|
|
@@ -2506,7 +2506,7 @@ class J {
|
|
|
2506
2506
|
}
|
|
2507
2507
|
_handlePvtEvent(e) {
|
|
2508
2508
|
return O(this, void 0, void 0, (function* () {
|
|
2509
|
-
const { session: n } = this, i = n.relayProtocol, { action: s, laChannel: a, laName: o, chatChannel: l, infoChannel: d, modChannel: h, conferenceMemberID: f, role:
|
|
2509
|
+
const { session: n } = this, i = n.relayProtocol, { action: s, laChannel: a, laName: o, chatChannel: l, infoChannel: d, modChannel: h, conferenceMemberID: f, role: v, callID: S } = e;
|
|
2510
2510
|
switch (s) {
|
|
2511
2511
|
case "conference-liveArray-join": {
|
|
2512
2512
|
const w = () => {
|
|
@@ -2530,7 +2530,7 @@ class J {
|
|
|
2530
2530
|
if (a && n._existsSubscription(i, a)) {
|
|
2531
2531
|
const { callId: k = null } = n.subscriptions[i][a];
|
|
2532
2532
|
if (w = n.calls[k] || null, k !== null) {
|
|
2533
|
-
const p = { type: oe.conferenceUpdate, action: se.Leave, conferenceName: o, participantId: Number(f), role:
|
|
2533
|
+
const p = { type: oe.conferenceUpdate, action: se.Leave, conferenceName: o, participantId: Number(f), role: v };
|
|
2534
2534
|
F(L.Notification, p, k, !1) || F(L.Notification, p, n.uuid), w === null && ue(L.Notification, null, k);
|
|
2535
2535
|
}
|
|
2536
2536
|
}
|
|
@@ -2624,7 +2624,7 @@ function dn(t) {
|
|
|
2624
2624
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
2625
2625
|
}
|
|
2626
2626
|
var Xe = { exports: {} }, Mt;
|
|
2627
|
-
function
|
|
2627
|
+
function vi() {
|
|
2628
2628
|
return Mt || (Mt = 1, (function(t) {
|
|
2629
2629
|
var e = Object.prototype.hasOwnProperty, n = "~";
|
|
2630
2630
|
function i() {
|
|
@@ -2633,10 +2633,10 @@ function mi() {
|
|
|
2633
2633
|
function s(d, h, f) {
|
|
2634
2634
|
this.fn = d, this.context = h, this.once = f || !1;
|
|
2635
2635
|
}
|
|
2636
|
-
function a(d, h, f,
|
|
2636
|
+
function a(d, h, f, v, S) {
|
|
2637
2637
|
if (typeof f != "function")
|
|
2638
2638
|
throw new TypeError("The listener must be a function");
|
|
2639
|
-
var w = new s(f,
|
|
2639
|
+
var w = new s(f, v || d, S), C = n ? n + h : h;
|
|
2640
2640
|
return d._events[C] ? d._events[C].fn ? d._events[C] = [d._events[C], w] : d._events[C].push(w) : (d._events[C] = w, d._eventsCount++), d;
|
|
2641
2641
|
}
|
|
2642
2642
|
function o(d, h) {
|
|
@@ -2646,22 +2646,22 @@ function mi() {
|
|
|
2646
2646
|
this._events = new i(), this._eventsCount = 0;
|
|
2647
2647
|
}
|
|
2648
2648
|
l.prototype.eventNames = function() {
|
|
2649
|
-
var h = [], f,
|
|
2649
|
+
var h = [], f, v;
|
|
2650
2650
|
if (this._eventsCount === 0) return h;
|
|
2651
|
-
for (
|
|
2652
|
-
e.call(f,
|
|
2651
|
+
for (v in f = this._events)
|
|
2652
|
+
e.call(f, v) && h.push(n ? v.slice(1) : v);
|
|
2653
2653
|
return Object.getOwnPropertySymbols ? h.concat(Object.getOwnPropertySymbols(f)) : h;
|
|
2654
2654
|
}, l.prototype.listeners = function(h) {
|
|
2655
|
-
var f = n ? n + h : h,
|
|
2656
|
-
if (!
|
|
2657
|
-
if (
|
|
2658
|
-
for (var S = 0, w =
|
|
2659
|
-
C[S] =
|
|
2655
|
+
var f = n ? n + h : h, v = this._events[f];
|
|
2656
|
+
if (!v) return [];
|
|
2657
|
+
if (v.fn) return [v.fn];
|
|
2658
|
+
for (var S = 0, w = v.length, C = new Array(w); S < w; S++)
|
|
2659
|
+
C[S] = v[S].fn;
|
|
2660
2660
|
return C;
|
|
2661
2661
|
}, l.prototype.listenerCount = function(h) {
|
|
2662
|
-
var f = n ? n + h : h,
|
|
2663
|
-
return
|
|
2664
|
-
}, l.prototype.emit = function(h, f,
|
|
2662
|
+
var f = n ? n + h : h, v = this._events[f];
|
|
2663
|
+
return v ? v.fn ? 1 : v.length : 0;
|
|
2664
|
+
}, l.prototype.emit = function(h, f, v, S, w, C) {
|
|
2665
2665
|
var k = n ? n + h : h;
|
|
2666
2666
|
if (!this._events[k]) return !1;
|
|
2667
2667
|
var p = this._events[k], _ = arguments.length, A, E;
|
|
@@ -2672,13 +2672,13 @@ function mi() {
|
|
|
2672
2672
|
case 2:
|
|
2673
2673
|
return p.fn.call(p.context, f), !0;
|
|
2674
2674
|
case 3:
|
|
2675
|
-
return p.fn.call(p.context, f,
|
|
2675
|
+
return p.fn.call(p.context, f, v), !0;
|
|
2676
2676
|
case 4:
|
|
2677
|
-
return p.fn.call(p.context, f,
|
|
2677
|
+
return p.fn.call(p.context, f, v, S), !0;
|
|
2678
2678
|
case 5:
|
|
2679
|
-
return p.fn.call(p.context, f,
|
|
2679
|
+
return p.fn.call(p.context, f, v, S, w), !0;
|
|
2680
2680
|
case 6:
|
|
2681
|
-
return p.fn.call(p.context, f,
|
|
2681
|
+
return p.fn.call(p.context, f, v, S, w, C), !0;
|
|
2682
2682
|
}
|
|
2683
2683
|
for (E = 1, A = new Array(_ - 1); E < _; E++)
|
|
2684
2684
|
A[E - 1] = arguments[E];
|
|
@@ -2694,10 +2694,10 @@ function mi() {
|
|
|
2694
2694
|
p[E].fn.call(p[E].context, f);
|
|
2695
2695
|
break;
|
|
2696
2696
|
case 3:
|
|
2697
|
-
p[E].fn.call(p[E].context, f,
|
|
2697
|
+
p[E].fn.call(p[E].context, f, v);
|
|
2698
2698
|
break;
|
|
2699
2699
|
case 4:
|
|
2700
|
-
p[E].fn.call(p[E].context, f,
|
|
2700
|
+
p[E].fn.call(p[E].context, f, v, S);
|
|
2701
2701
|
break;
|
|
2702
2702
|
default:
|
|
2703
2703
|
if (!A) for (D = 1, A = new Array(_ - 1); D < _; D++)
|
|
@@ -2706,21 +2706,21 @@ function mi() {
|
|
|
2706
2706
|
}
|
|
2707
2707
|
}
|
|
2708
2708
|
return !0;
|
|
2709
|
-
}, l.prototype.on = function(h, f,
|
|
2710
|
-
return a(this, h, f,
|
|
2711
|
-
}, l.prototype.once = function(h, f,
|
|
2712
|
-
return a(this, h, f,
|
|
2713
|
-
}, l.prototype.removeListener = function(h, f,
|
|
2709
|
+
}, l.prototype.on = function(h, f, v) {
|
|
2710
|
+
return a(this, h, f, v, !1);
|
|
2711
|
+
}, l.prototype.once = function(h, f, v) {
|
|
2712
|
+
return a(this, h, f, v, !0);
|
|
2713
|
+
}, l.prototype.removeListener = function(h, f, v, S) {
|
|
2714
2714
|
var w = n ? n + h : h;
|
|
2715
2715
|
if (!this._events[w]) return this;
|
|
2716
2716
|
if (!f)
|
|
2717
2717
|
return o(this, w), this;
|
|
2718
2718
|
var C = this._events[w];
|
|
2719
2719
|
if (C.fn)
|
|
2720
|
-
C.fn === f && (!S || C.once) && (!
|
|
2720
|
+
C.fn === f && (!S || C.once) && (!v || C.context === v) && o(this, w);
|
|
2721
2721
|
else {
|
|
2722
2722
|
for (var k = 0, p = [], _ = C.length; k < _; k++)
|
|
2723
|
-
(C[k].fn !== f || S && !C[k].once ||
|
|
2723
|
+
(C[k].fn !== f || S && !C[k].once || v && C[k].context !== v) && p.push(C[k]);
|
|
2724
2724
|
p.length ? this._events[w] = p.length === 1 ? p[0] : p : o(this, w);
|
|
2725
2725
|
}
|
|
2726
2726
|
return this;
|
|
@@ -2730,8 +2730,8 @@ function mi() {
|
|
|
2730
2730
|
}, l.prototype.off = l.prototype.removeListener, l.prototype.addListener = l.prototype.on, l.prefixed = n, l.EventEmitter = l, t.exports = l;
|
|
2731
2731
|
})(Xe)), Xe.exports;
|
|
2732
2732
|
}
|
|
2733
|
-
var
|
|
2734
|
-
const ft = /* @__PURE__ */ dn(
|
|
2733
|
+
var mi = vi();
|
|
2734
|
+
const ft = /* @__PURE__ */ dn(mi), Fe = new ft();
|
|
2735
2735
|
var Pe = { exports: {} }, yi = Pe.exports, Pt;
|
|
2736
2736
|
function bi() {
|
|
2737
2737
|
return Pt || (Pt = 1, (function(t) {
|
|
@@ -2772,13 +2772,13 @@ function bi() {
|
|
|
2772
2772
|
if (this.log = this.debug, typeof console === n && k < this.levels.SILENT)
|
|
2773
2773
|
return "No console available for logging";
|
|
2774
2774
|
}
|
|
2775
|
-
function
|
|
2775
|
+
function v(k) {
|
|
2776
2776
|
return function() {
|
|
2777
2777
|
typeof console !== n && (f.call(this), this[k].apply(this, arguments));
|
|
2778
2778
|
};
|
|
2779
2779
|
}
|
|
2780
2780
|
function S(k, p, _) {
|
|
2781
|
-
return h(k) ||
|
|
2781
|
+
return h(k) || v.apply(this, arguments);
|
|
2782
2782
|
}
|
|
2783
2783
|
function w(k, p) {
|
|
2784
2784
|
var _ = this, A, E, P, D = "loglevel";
|
|
@@ -3116,8 +3116,7 @@ class Nt extends ft {
|
|
|
3116
3116
|
activeCall;
|
|
3117
3117
|
constructor(e) {
|
|
3118
3118
|
super(), this.agentId = e.agentId, this.versionId = e.versionId || "main", this.debug = e.debug || !1, this.activeCall = null, z.setLevel(this.debug ? "debug" : "info"), this.telnyxRTC = new gi({
|
|
3119
|
-
|
|
3120
|
-
environment: e.environment || "production",
|
|
3119
|
+
env: e.environment || "production",
|
|
3121
3120
|
anonymous_login: {
|
|
3122
3121
|
target_id: e.agentId,
|
|
3123
3122
|
target_type: "ai_assistant",
|
|
@@ -3284,12 +3283,12 @@ var _e = {};
|
|
|
3284
3283
|
var jt;
|
|
3285
3284
|
function Ui() {
|
|
3286
3285
|
return jt || (jt = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
3287
|
-
function t(
|
|
3288
|
-
if (
|
|
3289
|
-
if (typeof
|
|
3290
|
-
return
|
|
3291
|
-
if (typeof
|
|
3292
|
-
switch (
|
|
3286
|
+
function t(m) {
|
|
3287
|
+
if (m == null) return null;
|
|
3288
|
+
if (typeof m == "function")
|
|
3289
|
+
return m.$$typeof === u ? null : m.displayName || m.name || null;
|
|
3290
|
+
if (typeof m == "string") return m;
|
|
3291
|
+
switch (m) {
|
|
3293
3292
|
case p:
|
|
3294
3293
|
return "Fragment";
|
|
3295
3294
|
case A:
|
|
@@ -3303,141 +3302,141 @@ function Ui() {
|
|
|
3303
3302
|
case c:
|
|
3304
3303
|
return "Activity";
|
|
3305
3304
|
}
|
|
3306
|
-
if (typeof
|
|
3307
|
-
switch (typeof
|
|
3305
|
+
if (typeof m == "object")
|
|
3306
|
+
switch (typeof m.tag == "number" && console.error(
|
|
3308
3307
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
3309
|
-
),
|
|
3308
|
+
), m.$$typeof) {
|
|
3310
3309
|
case k:
|
|
3311
3310
|
return "Portal";
|
|
3312
3311
|
case P:
|
|
3313
|
-
return
|
|
3312
|
+
return m.displayName || "Context";
|
|
3314
3313
|
case E:
|
|
3315
|
-
return (
|
|
3314
|
+
return (m._context.displayName || "Context") + ".Consumer";
|
|
3316
3315
|
case D:
|
|
3317
|
-
var M =
|
|
3318
|
-
return
|
|
3316
|
+
var M = m.render;
|
|
3317
|
+
return m = m.displayName, m || (m = M.displayName || M.name || "", m = m !== "" ? "ForwardRef(" + m + ")" : "ForwardRef"), m;
|
|
3319
3318
|
case x:
|
|
3320
|
-
return M =
|
|
3319
|
+
return M = m.displayName || null, M !== null ? M : t(m.type) || "Memo";
|
|
3321
3320
|
case r:
|
|
3322
|
-
M =
|
|
3321
|
+
M = m._payload, m = m._init;
|
|
3323
3322
|
try {
|
|
3324
|
-
return t(
|
|
3323
|
+
return t(m(M));
|
|
3325
3324
|
} catch {
|
|
3326
3325
|
}
|
|
3327
3326
|
}
|
|
3328
3327
|
return null;
|
|
3329
3328
|
}
|
|
3330
|
-
function e(
|
|
3331
|
-
return "" +
|
|
3329
|
+
function e(m) {
|
|
3330
|
+
return "" + m;
|
|
3332
3331
|
}
|
|
3333
|
-
function n(
|
|
3332
|
+
function n(m) {
|
|
3334
3333
|
try {
|
|
3335
|
-
e(
|
|
3334
|
+
e(m);
|
|
3336
3335
|
var M = !1;
|
|
3337
3336
|
} catch {
|
|
3338
3337
|
M = !0;
|
|
3339
3338
|
}
|
|
3340
3339
|
if (M) {
|
|
3341
3340
|
M = console;
|
|
3342
|
-
var U = M.error, V = typeof Symbol == "function" && Symbol.toStringTag &&
|
|
3341
|
+
var U = M.error, V = typeof Symbol == "function" && Symbol.toStringTag && m[Symbol.toStringTag] || m.constructor.name || "Object";
|
|
3343
3342
|
return U.call(
|
|
3344
3343
|
M,
|
|
3345
3344
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
3346
3345
|
V
|
|
3347
|
-
), e(
|
|
3346
|
+
), e(m);
|
|
3348
3347
|
}
|
|
3349
3348
|
}
|
|
3350
|
-
function i(
|
|
3351
|
-
if (
|
|
3352
|
-
if (typeof
|
|
3349
|
+
function i(m) {
|
|
3350
|
+
if (m === p) return "<>";
|
|
3351
|
+
if (typeof m == "object" && m !== null && m.$$typeof === r)
|
|
3353
3352
|
return "<...>";
|
|
3354
3353
|
try {
|
|
3355
|
-
var M = t(
|
|
3354
|
+
var M = t(m);
|
|
3356
3355
|
return M ? "<" + M + ">" : "<...>";
|
|
3357
3356
|
} catch {
|
|
3358
3357
|
return "<...>";
|
|
3359
3358
|
}
|
|
3360
3359
|
}
|
|
3361
3360
|
function s() {
|
|
3362
|
-
var
|
|
3363
|
-
return
|
|
3361
|
+
var m = g.A;
|
|
3362
|
+
return m === null ? null : m.getOwner();
|
|
3364
3363
|
}
|
|
3365
3364
|
function a() {
|
|
3366
3365
|
return Error("react-stack-top-frame");
|
|
3367
3366
|
}
|
|
3368
|
-
function o(
|
|
3369
|
-
if (b.call(
|
|
3370
|
-
var M = Object.getOwnPropertyDescriptor(
|
|
3367
|
+
function o(m) {
|
|
3368
|
+
if (b.call(m, "key")) {
|
|
3369
|
+
var M = Object.getOwnPropertyDescriptor(m, "key").get;
|
|
3371
3370
|
if (M && M.isReactWarning) return !1;
|
|
3372
3371
|
}
|
|
3373
|
-
return
|
|
3372
|
+
return m.key !== void 0;
|
|
3374
3373
|
}
|
|
3375
|
-
function l(
|
|
3374
|
+
function l(m, M) {
|
|
3376
3375
|
function U() {
|
|
3377
3376
|
R || (R = !0, console.error(
|
|
3378
3377
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
3379
3378
|
M
|
|
3380
3379
|
));
|
|
3381
3380
|
}
|
|
3382
|
-
U.isReactWarning = !0, Object.defineProperty(
|
|
3381
|
+
U.isReactWarning = !0, Object.defineProperty(m, "key", {
|
|
3383
3382
|
get: U,
|
|
3384
3383
|
configurable: !0
|
|
3385
3384
|
});
|
|
3386
3385
|
}
|
|
3387
3386
|
function d() {
|
|
3388
|
-
var
|
|
3389
|
-
return j[
|
|
3387
|
+
var m = t(this.type);
|
|
3388
|
+
return j[m] || (j[m] = !0, console.error(
|
|
3390
3389
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
3391
|
-
)),
|
|
3390
|
+
)), m = this.props.ref, m !== void 0 ? m : null;
|
|
3392
3391
|
}
|
|
3393
|
-
function h(
|
|
3392
|
+
function h(m, M, U, V, Y, Q) {
|
|
3394
3393
|
var W = U.ref;
|
|
3395
|
-
return
|
|
3394
|
+
return m = {
|
|
3396
3395
|
$$typeof: C,
|
|
3397
|
-
type:
|
|
3396
|
+
type: m,
|
|
3398
3397
|
key: M,
|
|
3399
3398
|
props: U,
|
|
3400
3399
|
_owner: V
|
|
3401
|
-
}, (W !== void 0 ? W : null) !== null ? Object.defineProperty(
|
|
3400
|
+
}, (W !== void 0 ? W : null) !== null ? Object.defineProperty(m, "ref", {
|
|
3402
3401
|
enumerable: !1,
|
|
3403
3402
|
get: d
|
|
3404
|
-
}) : Object.defineProperty(
|
|
3403
|
+
}) : Object.defineProperty(m, "ref", { enumerable: !1, value: null }), m._store = {}, Object.defineProperty(m._store, "validated", {
|
|
3405
3404
|
configurable: !1,
|
|
3406
3405
|
enumerable: !1,
|
|
3407
3406
|
writable: !0,
|
|
3408
3407
|
value: 0
|
|
3409
|
-
}), Object.defineProperty(
|
|
3408
|
+
}), Object.defineProperty(m, "_debugInfo", {
|
|
3410
3409
|
configurable: !1,
|
|
3411
3410
|
enumerable: !1,
|
|
3412
3411
|
writable: !0,
|
|
3413
3412
|
value: null
|
|
3414
|
-
}), Object.defineProperty(
|
|
3413
|
+
}), Object.defineProperty(m, "_debugStack", {
|
|
3415
3414
|
configurable: !1,
|
|
3416
3415
|
enumerable: !1,
|
|
3417
3416
|
writable: !0,
|
|
3418
3417
|
value: Y
|
|
3419
|
-
}), Object.defineProperty(
|
|
3418
|
+
}), Object.defineProperty(m, "_debugTask", {
|
|
3420
3419
|
configurable: !1,
|
|
3421
3420
|
enumerable: !1,
|
|
3422
3421
|
writable: !0,
|
|
3423
3422
|
value: Q
|
|
3424
|
-
}), Object.freeze && (Object.freeze(
|
|
3423
|
+
}), Object.freeze && (Object.freeze(m.props), Object.freeze(m)), m;
|
|
3425
3424
|
}
|
|
3426
|
-
function f(
|
|
3425
|
+
function f(m, M, U, V, Y, Q) {
|
|
3427
3426
|
var W = M.children;
|
|
3428
3427
|
if (W !== void 0)
|
|
3429
3428
|
if (V)
|
|
3430
3429
|
if (T(W)) {
|
|
3431
3430
|
for (V = 0; V < W.length; V++)
|
|
3432
|
-
|
|
3431
|
+
v(W[V]);
|
|
3433
3432
|
Object.freeze && Object.freeze(W);
|
|
3434
3433
|
} else
|
|
3435
3434
|
console.error(
|
|
3436
3435
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
3437
3436
|
);
|
|
3438
|
-
else
|
|
3437
|
+
else v(W);
|
|
3439
3438
|
if (b.call(M, "key")) {
|
|
3440
|
-
W = t(
|
|
3439
|
+
W = t(m);
|
|
3441
3440
|
var re = Object.keys(M).filter(function(In) {
|
|
3442
3441
|
return In !== "key";
|
|
3443
3442
|
});
|
|
@@ -3461,9 +3460,9 @@ React keys must be passed directly to JSX without using spread:
|
|
|
3461
3460
|
} else U = M;
|
|
3462
3461
|
return W && l(
|
|
3463
3462
|
U,
|
|
3464
|
-
typeof
|
|
3463
|
+
typeof m == "function" ? m.displayName || m.name || "Unknown" : m
|
|
3465
3464
|
), h(
|
|
3466
|
-
|
|
3465
|
+
m,
|
|
3467
3466
|
W,
|
|
3468
3467
|
U,
|
|
3469
3468
|
s(),
|
|
@@ -3471,43 +3470,43 @@ React keys must be passed directly to JSX without using spread:
|
|
|
3471
3470
|
Q
|
|
3472
3471
|
);
|
|
3473
3472
|
}
|
|
3474
|
-
function m
|
|
3475
|
-
S(
|
|
3473
|
+
function v(m) {
|
|
3474
|
+
S(m) ? m._store && (m._store.validated = 1) : typeof m == "object" && m !== null && m.$$typeof === r && (m._payload.status === "fulfilled" ? S(m._payload.value) && m._payload.value._store && (m._payload.value._store.validated = 1) : m._store && (m._store.validated = 1));
|
|
3476
3475
|
}
|
|
3477
|
-
function S(
|
|
3478
|
-
return typeof
|
|
3476
|
+
function S(m) {
|
|
3477
|
+
return typeof m == "object" && m !== null && m.$$typeof === C;
|
|
3479
3478
|
}
|
|
3480
3479
|
var w = ut, C = Symbol.for("react.transitional.element"), k = Symbol.for("react.portal"), p = Symbol.for("react.fragment"), _ = Symbol.for("react.strict_mode"), A = Symbol.for("react.profiler"), E = Symbol.for("react.consumer"), P = Symbol.for("react.context"), D = Symbol.for("react.forward_ref"), q = Symbol.for("react.suspense"), B = Symbol.for("react.suspense_list"), x = Symbol.for("react.memo"), r = Symbol.for("react.lazy"), c = Symbol.for("react.activity"), u = Symbol.for("react.client.reference"), g = w.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, b = Object.prototype.hasOwnProperty, T = Array.isArray, I = console.createTask ? console.createTask : function() {
|
|
3481
3480
|
return null;
|
|
3482
3481
|
};
|
|
3483
3482
|
w = {
|
|
3484
|
-
react_stack_bottom_frame: function(
|
|
3485
|
-
return
|
|
3483
|
+
react_stack_bottom_frame: function(m) {
|
|
3484
|
+
return m();
|
|
3486
3485
|
}
|
|
3487
3486
|
};
|
|
3488
3487
|
var R, j = {}, ee = w.react_stack_bottom_frame.bind(
|
|
3489
3488
|
w,
|
|
3490
3489
|
a
|
|
3491
3490
|
)(), ne = I(i(a)), G = {};
|
|
3492
|
-
_e.Fragment = p, _e.jsx = function(
|
|
3491
|
+
_e.Fragment = p, _e.jsx = function(m, M, U) {
|
|
3493
3492
|
var V = 1e4 > g.recentlyCreatedOwnerStacks++;
|
|
3494
3493
|
return f(
|
|
3495
|
-
|
|
3494
|
+
m,
|
|
3496
3495
|
M,
|
|
3497
3496
|
U,
|
|
3498
3497
|
!1,
|
|
3499
3498
|
V ? Error("react-stack-top-frame") : ee,
|
|
3500
|
-
V ? I(i(
|
|
3499
|
+
V ? I(i(m)) : ne
|
|
3501
3500
|
);
|
|
3502
|
-
}, _e.jsxs = function(
|
|
3501
|
+
}, _e.jsxs = function(m, M, U) {
|
|
3503
3502
|
var V = 1e4 > g.recentlyCreatedOwnerStacks++;
|
|
3504
3503
|
return f(
|
|
3505
|
-
|
|
3504
|
+
m,
|
|
3506
3505
|
M,
|
|
3507
3506
|
U,
|
|
3508
3507
|
!0,
|
|
3509
3508
|
V ? Error("react-stack-top-frame") : ee,
|
|
3510
|
-
V ? I(i(
|
|
3509
|
+
V ? I(i(m)) : ne
|
|
3511
3510
|
);
|
|
3512
3511
|
};
|
|
3513
3512
|
})()), _e;
|
|
@@ -3594,26 +3593,26 @@ const $i = (t, e, ...n) => e.read(...n), Bi = (t, e, ...n) => e.write(...n), Vi
|
|
|
3594
3593
|
const e = X(t), n = e[1], i = e[3], s = e[4], a = e[5], o = e[6], l = e[13], d = [], h = (f) => {
|
|
3595
3594
|
try {
|
|
3596
3595
|
f();
|
|
3597
|
-
} catch (
|
|
3598
|
-
d.push(
|
|
3596
|
+
} catch (v) {
|
|
3597
|
+
d.push(v);
|
|
3599
3598
|
}
|
|
3600
3599
|
};
|
|
3601
3600
|
do {
|
|
3602
3601
|
o.f && h(o.f);
|
|
3603
|
-
const f = /* @__PURE__ */ new Set(),
|
|
3602
|
+
const f = /* @__PURE__ */ new Set(), v = f.add.bind(f);
|
|
3604
3603
|
i.forEach((S) => {
|
|
3605
3604
|
var w;
|
|
3606
|
-
return (w = n.get(S)) == null ? void 0 : w.l.forEach(
|
|
3607
|
-
}), i.clear(), a.forEach(
|
|
3605
|
+
return (w = n.get(S)) == null ? void 0 : w.l.forEach(v);
|
|
3606
|
+
}), i.clear(), a.forEach(v), a.clear(), s.forEach(v), s.clear(), f.forEach(h), i.size && l(t);
|
|
3608
3607
|
} while (i.size || a.size || s.size);
|
|
3609
3608
|
if (d.length)
|
|
3610
3609
|
throw new AggregateError(d);
|
|
3611
3610
|
}, qi = (t) => {
|
|
3612
|
-
const e = X(t), n = e[1], i = e[2], s = e[3], a = e[11], o = e[14], l = e[17], d = [], h = /* @__PURE__ */ new WeakSet(), f = /* @__PURE__ */ new WeakSet(),
|
|
3613
|
-
for (;
|
|
3614
|
-
const S =
|
|
3611
|
+
const e = X(t), n = e[1], i = e[2], s = e[3], a = e[11], o = e[14], l = e[17], d = [], h = /* @__PURE__ */ new WeakSet(), f = /* @__PURE__ */ new WeakSet(), v = Array.from(s);
|
|
3612
|
+
for (; v.length; ) {
|
|
3613
|
+
const S = v[v.length - 1], w = a(t, S);
|
|
3615
3614
|
if (f.has(S)) {
|
|
3616
|
-
|
|
3615
|
+
v.pop();
|
|
3617
3616
|
continue;
|
|
3618
3617
|
}
|
|
3619
3618
|
if (h.has(S)) {
|
|
@@ -3621,12 +3620,12 @@ const $i = (t, e, ...n) => e.read(...n), Bi = (t, e, ...n) => e.write(...n), Vi
|
|
|
3621
3620
|
d.push([S, w]);
|
|
3622
3621
|
else if ((ce ? "production" : void 0) !== "production" && i.has(S))
|
|
3623
3622
|
throw new Error("[Bug] invalidated atom exists");
|
|
3624
|
-
f.add(S),
|
|
3623
|
+
f.add(S), v.pop();
|
|
3625
3624
|
continue;
|
|
3626
3625
|
}
|
|
3627
3626
|
h.add(S);
|
|
3628
3627
|
for (const C of fn(S, w, n))
|
|
3629
|
-
h.has(C) ||
|
|
3628
|
+
h.has(C) || v.push(C);
|
|
3630
3629
|
}
|
|
3631
3630
|
for (let S = d.length - 1; S >= 0; --S) {
|
|
3632
3631
|
const [w, C] = d[S];
|
|
@@ -3640,7 +3639,7 @@ const $i = (t, e, ...n) => e.read(...n), Bi = (t, e, ...n) => e.write(...n), Vi
|
|
|
3640
3639
|
}
|
|
3641
3640
|
}, ct = /* @__PURE__ */ new WeakSet(), Ji = (t, e) => {
|
|
3642
3641
|
var n, i;
|
|
3643
|
-
const s = X(t), a = s[1], o = s[2], l = s[3], d = s[6], h = s[7], f = s[11],
|
|
3642
|
+
const s = X(t), a = s[1], o = s[2], l = s[3], d = s[6], h = s[7], f = s[11], v = s[12], S = s[13], w = s[14], C = s[16], k = s[17], p = f(t, e);
|
|
3644
3643
|
if ($t(p)) {
|
|
3645
3644
|
if (a.has(e) && o.get(e) !== p.n)
|
|
3646
3645
|
return p;
|
|
@@ -3656,7 +3655,7 @@ const $i = (t, e, ...n) => e.read(...n), Bi = (t, e, ...n) => e.write(...n), Vi
|
|
|
3656
3655
|
p.d.clear();
|
|
3657
3656
|
let _ = !0;
|
|
3658
3657
|
function A() {
|
|
3659
|
-
a.has(e) && (k(t, e), S(t),
|
|
3658
|
+
a.has(e) && (k(t, e), S(t), v(t));
|
|
3660
3659
|
}
|
|
3661
3660
|
function E(x) {
|
|
3662
3661
|
var r;
|
|
@@ -3687,7 +3686,7 @@ const $i = (t, e, ...n) => e.read(...n), Bi = (t, e, ...n) => e.write(...n), Vi
|
|
|
3687
3686
|
try {
|
|
3688
3687
|
return C(t, e, ...x);
|
|
3689
3688
|
} finally {
|
|
3690
|
-
S(t),
|
|
3689
|
+
S(t), v(t);
|
|
3691
3690
|
}
|
|
3692
3691
|
}), D;
|
|
3693
3692
|
}
|
|
@@ -3713,7 +3712,7 @@ const $i = (t, e, ...n) => e.read(...n), Bi = (t, e, ...n) => e.write(...n), Vi
|
|
|
3713
3712
|
}
|
|
3714
3713
|
}
|
|
3715
3714
|
}, gn = (t, e, ...n) => {
|
|
3716
|
-
const i = X(t), s = i[3], a = i[6], o = i[8], l = i[11], d = i[12], h = i[13], f = i[14],
|
|
3715
|
+
const i = X(t), s = i[3], a = i[6], o = i[8], l = i[11], d = i[12], h = i[13], f = i[14], v = i[15], S = i[17];
|
|
3717
3716
|
let w = !0;
|
|
3718
3717
|
const C = (p) => $e(f(t, p)), k = (p, ..._) => {
|
|
3719
3718
|
var A;
|
|
@@ -3724,7 +3723,7 @@ const $i = (t, e, ...n) => e.read(...n), Bi = (t, e, ...n) => e.write(...n), Vi
|
|
|
3724
3723
|
throw new Error("atom not writable");
|
|
3725
3724
|
(ce ? "production" : void 0) !== "production" && ct.add(t);
|
|
3726
3725
|
const P = E.n, D = _[0];
|
|
3727
|
-
Ge(t, p, D), S(t, p), P !== E.n && (s.add(p),
|
|
3726
|
+
Ge(t, p, D), S(t, p), P !== E.n && (s.add(p), v(t, p), (A = a.c) == null || A.call(a, p));
|
|
3728
3727
|
return;
|
|
3729
3728
|
} else
|
|
3730
3729
|
return gn(t, p, ..._);
|
|
@@ -3739,28 +3738,28 @@ const $i = (t, e, ...n) => e.read(...n), Bi = (t, e, ...n) => e.write(...n), Vi
|
|
|
3739
3738
|
}
|
|
3740
3739
|
}, zi = (t, e) => {
|
|
3741
3740
|
var n;
|
|
3742
|
-
const i = X(t), s = i[1], a = i[3], o = i[6], l = i[11], d = i[15], h = i[18], f = i[19],
|
|
3743
|
-
if (S && !hn(
|
|
3744
|
-
for (const [w, C] of
|
|
3741
|
+
const i = X(t), s = i[1], a = i[3], o = i[6], l = i[11], d = i[15], h = i[18], f = i[19], v = l(t, e), S = s.get(e);
|
|
3742
|
+
if (S && !hn(v.v)) {
|
|
3743
|
+
for (const [w, C] of v.d)
|
|
3745
3744
|
if (!S.d.has(w)) {
|
|
3746
3745
|
const k = l(t, w);
|
|
3747
3746
|
h(t, w).t.add(e), S.d.add(w), C !== k.n && (a.add(w), d(t, w), (n = o.c) == null || n.call(o, w));
|
|
3748
3747
|
}
|
|
3749
3748
|
for (const w of S.d)
|
|
3750
|
-
if (!
|
|
3749
|
+
if (!v.d.has(w)) {
|
|
3751
3750
|
S.d.delete(w);
|
|
3752
3751
|
const C = f(t, w);
|
|
3753
3752
|
C?.t.delete(e);
|
|
3754
3753
|
}
|
|
3755
3754
|
}
|
|
3756
|
-
},
|
|
3755
|
+
}, vn = (t, e) => {
|
|
3757
3756
|
var n;
|
|
3758
|
-
const i = X(t), s = i[1], a = i[4], o = i[6], l = i[10], d = i[11], h = i[12], f = i[13],
|
|
3757
|
+
const i = X(t), s = i[1], a = i[4], o = i[6], l = i[10], d = i[11], h = i[12], f = i[13], v = i[14], S = i[16], w = d(t, e);
|
|
3759
3758
|
let C = s.get(e);
|
|
3760
3759
|
if (!C) {
|
|
3761
|
-
|
|
3760
|
+
v(t, e);
|
|
3762
3761
|
for (const k of w.d.keys())
|
|
3763
|
-
|
|
3762
|
+
vn(t, k).t.add(e);
|
|
3764
3763
|
if (C = {
|
|
3765
3764
|
l: /* @__PURE__ */ new Set(),
|
|
3766
3765
|
d: new Set(w.d.keys()),
|
|
@@ -3797,17 +3796,17 @@ const $i = (t, e, ...n) => e.read(...n), Bi = (t, e, ...n) => e.write(...n), Vi
|
|
|
3797
3796
|
}, Ki = (t, e) => {
|
|
3798
3797
|
var n, i;
|
|
3799
3798
|
const s = X(t), a = s[1], o = s[5], l = s[6], d = s[11], h = s[19], f = d(t, e);
|
|
3800
|
-
let
|
|
3801
|
-
if (!
|
|
3802
|
-
return
|
|
3799
|
+
let v = a.get(e);
|
|
3800
|
+
if (!v || v.l.size)
|
|
3801
|
+
return v;
|
|
3803
3802
|
let S = !1;
|
|
3804
|
-
for (const w of
|
|
3803
|
+
for (const w of v.t)
|
|
3805
3804
|
if ((n = a.get(w)) != null && n.d.has(e)) {
|
|
3806
3805
|
S = !0;
|
|
3807
3806
|
break;
|
|
3808
3807
|
}
|
|
3809
3808
|
if (!S) {
|
|
3810
|
-
|
|
3809
|
+
v.u && o.add(v.u), v = void 0, a.delete(e);
|
|
3811
3810
|
for (const w of f.d.keys()) {
|
|
3812
3811
|
const C = h(t, w);
|
|
3813
3812
|
C?.t.delete(e);
|
|
@@ -3815,7 +3814,7 @@ const $i = (t, e, ...n) => e.read(...n), Bi = (t, e, ...n) => e.write(...n), Vi
|
|
|
3815
3814
|
(i = l.u) == null || i.call(l, e);
|
|
3816
3815
|
return;
|
|
3817
3816
|
}
|
|
3818
|
-
return
|
|
3817
|
+
return v;
|
|
3819
3818
|
}, Ge = (t, e, n) => {
|
|
3820
3819
|
const i = X(t)[11], s = i(t, e), a = "v" in s, o = s.v;
|
|
3821
3820
|
if (Ve(n))
|
|
@@ -3841,8 +3840,8 @@ const $i = (t, e, ...n) => e.read(...n), Bi = (t, e, ...n) => e.write(...n), Vi
|
|
|
3841
3840
|
return d.add(n), s(t), () => {
|
|
3842
3841
|
d.delete(n), o(t, e), s(t);
|
|
3843
3842
|
};
|
|
3844
|
-
},
|
|
3845
|
-
const e =
|
|
3843
|
+
}, mn = /* @__PURE__ */ new WeakMap(), X = (t) => {
|
|
3844
|
+
const e = mn.get(t);
|
|
3846
3845
|
if ((ce ? "production" : void 0) !== "production" && !e)
|
|
3847
3846
|
throw new Error(
|
|
3848
3847
|
"Store must be created by buildStore to read its building blocks"
|
|
@@ -3892,7 +3891,7 @@ function es(...t) {
|
|
|
3892
3891
|
Yi,
|
|
3893
3892
|
gn,
|
|
3894
3893
|
zi,
|
|
3895
|
-
|
|
3894
|
+
vn,
|
|
3896
3895
|
Ki,
|
|
3897
3896
|
Ge,
|
|
3898
3897
|
Qi,
|
|
@@ -3900,7 +3899,7 @@ function es(...t) {
|
|
|
3900
3899
|
Zi,
|
|
3901
3900
|
void 0
|
|
3902
3901
|
].map((i, s) => t[s] || i);
|
|
3903
|
-
return
|
|
3902
|
+
return mn.set(e, Object.freeze(n)), e;
|
|
3904
3903
|
}
|
|
3905
3904
|
const yn = {};
|
|
3906
3905
|
let ts = 0;
|
|
@@ -3974,8 +3973,8 @@ const lt = (t) => typeof t?.then == "function", dt = (t) => {
|
|
|
3974
3973
|
function qe(t, e) {
|
|
3975
3974
|
const { delay: n, unstable_promiseStatus: i = !ut.use } = {}, s = bn(), [[a, o, l], d] = En(
|
|
3976
3975
|
(f) => {
|
|
3977
|
-
const
|
|
3978
|
-
return Object.is(f[0],
|
|
3976
|
+
const v = s.get(t);
|
|
3977
|
+
return Object.is(f[0], v) && f[1] === s && f[2] === t ? f : [v, s, t];
|
|
3979
3978
|
},
|
|
3980
3979
|
void 0,
|
|
3981
3980
|
() => [s.get(t), s, t]
|
|
@@ -3985,9 +3984,9 @@ function qe(t, e) {
|
|
|
3985
3984
|
const f = s.sub(t, () => {
|
|
3986
3985
|
if (i)
|
|
3987
3986
|
try {
|
|
3988
|
-
const
|
|
3989
|
-
lt(
|
|
3990
|
-
Bt(
|
|
3987
|
+
const v = s.get(t);
|
|
3988
|
+
lt(v) && dt(
|
|
3989
|
+
Bt(v, () => s.get(t))
|
|
3991
3990
|
);
|
|
3992
3991
|
} catch {
|
|
3993
3992
|
}
|
|
@@ -4077,7 +4076,7 @@ function _s() {
|
|
|
4077
4076
|
function gs() {
|
|
4078
4077
|
return Je(Cn);
|
|
4079
4078
|
}
|
|
4080
|
-
function
|
|
4079
|
+
function vs() {
|
|
4081
4080
|
const t = Ye(), e = gs();
|
|
4082
4081
|
return pe(() => {
|
|
4083
4082
|
const n = (i) => {
|
|
@@ -4110,7 +4109,7 @@ const kn = Gt(null), ws = ({
|
|
|
4110
4109
|
/* @__PURE__ */ we.jsx(ds, {}),
|
|
4111
4110
|
/* @__PURE__ */ we.jsx(hs, {}),
|
|
4112
4111
|
/* @__PURE__ */ we.jsx(fs, {}),
|
|
4113
|
-
/* @__PURE__ */ we.jsx(
|
|
4112
|
+
/* @__PURE__ */ we.jsx(vs, {}),
|
|
4114
4113
|
t
|
|
4115
4114
|
] });
|
|
4116
4115
|
};
|