@floe-ai/sdk 0.1.0-dev.30 → 0.1.0-dev.32
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-sdk/floe-sdk.es.js +793 -734
- package/dist-sdk/floe-sdk.es.js.map +1 -1
- package/dist-sdk/floe-sdk.iife.js +32 -32
- package/dist-sdk/floe-sdk.iife.js.map +1 -1
- package/dist-sdk/floe-sdk.umd.js +32 -32
- package/dist-sdk/floe-sdk.umd.js.map +1 -1
- package/dist-sdk/index.d.ts +8 -0
- package/package.json +1 -1
package/dist-sdk/floe-sdk.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var mc = Object.defineProperty;
|
|
2
2
|
var bc = (r, e, t) => e in r ? mc(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
|
-
var
|
|
3
|
+
var M = (r, e, t) => bc(r, typeof e != "symbol" ? e + "" : e, t);
|
|
4
4
|
import Us, { useState as Ue, useEffect as Ye, useRef as wn, useCallback as We, useMemo as yc } from "react";
|
|
5
5
|
import vc from "react-dom/client";
|
|
6
6
|
import { jsx as T, jsxs as G, Fragment as fn } from "react/jsx-runtime";
|
|
@@ -3412,7 +3412,7 @@ class Qe extends qc {
|
|
|
3412
3412
|
this._sendMessage(new we(Y.DISCONNECT_BOT, {}));
|
|
3413
3413
|
}
|
|
3414
3414
|
handleMessage(e) {
|
|
3415
|
-
var t, n, i, o, s, a, c, u, d, h, g,
|
|
3415
|
+
var t, n, i, o, s, a, c, u, d, h, g, b, y, m, v, w, x, C, D, P, R, B, re, se, me, $, j, H, X, N, U, Q, le, Z, Te, ve, $e, l, f, p, S, k, E, A, L, I, K, te, Me, tt, nt, be;
|
|
3416
3416
|
switch (ne.debug("[RTVI Message]", e), e.type) {
|
|
3417
3417
|
case Y.BOT_READY: {
|
|
3418
3418
|
const ee = e.data, Ve = ee.version ? ee.version.split(".").map(Number) : [
|
|
@@ -3441,10 +3441,10 @@ class Qe extends qc {
|
|
|
3441
3441
|
(g = (h = this._options.callbacks) == null ? void 0 : h.onUserStoppedSpeaking) == null || g.call(h);
|
|
3442
3442
|
break;
|
|
3443
3443
|
case Y.BOT_STARTED_SPEAKING:
|
|
3444
|
-
(
|
|
3444
|
+
(y = (b = this._options.callbacks) == null ? void 0 : b.onBotStartedSpeaking) == null || y.call(b);
|
|
3445
3445
|
break;
|
|
3446
3446
|
case Y.BOT_STOPPED_SPEAKING:
|
|
3447
|
-
(
|
|
3447
|
+
(v = (m = this._options.callbacks) == null ? void 0 : m.onBotStoppedSpeaking) == null || v.call(m);
|
|
3448
3448
|
break;
|
|
3449
3449
|
case Y.USER_MUTE_STARTED:
|
|
3450
3450
|
(x = (w = this._options.callbacks) == null ? void 0 : w.onUserMuteStarted) == null || x.call(w);
|
|
@@ -3494,7 +3494,7 @@ class Qe extends qc {
|
|
|
3494
3494
|
}
|
|
3495
3495
|
case Y.LLM_FUNCTION_CALL_IN_PROGRESS: {
|
|
3496
3496
|
const ee = e.data;
|
|
3497
|
-
this._maybeTriggerFunctionCallCallback(ee), (L = (
|
|
3497
|
+
this._maybeTriggerFunctionCallCallback(ee), (L = (A = this._options.callbacks) == null ? void 0 : A.onLLMFunctionCallInProgress) == null || L.call(A, ee), this.emit(z.LLMFunctionCallInProgress, ee);
|
|
3498
3498
|
break;
|
|
3499
3499
|
}
|
|
3500
3500
|
case Y.LLM_FUNCTION_CALL_STOPPED: {
|
|
@@ -3714,8 +3714,8 @@ function Vc(r) {
|
|
|
3714
3714
|
var zi, On = { exports: {} }, jr = function() {
|
|
3715
3715
|
if (zi) return On.exports;
|
|
3716
3716
|
zi = 1;
|
|
3717
|
-
var r, e = typeof Reflect == "object" ? Reflect : null, t = e && typeof e.apply == "function" ? e.apply : function(m,
|
|
3718
|
-
return Function.prototype.apply.call(m,
|
|
3717
|
+
var r, e = typeof Reflect == "object" ? Reflect : null, t = e && typeof e.apply == "function" ? e.apply : function(m, v, w) {
|
|
3718
|
+
return Function.prototype.apply.call(m, v, w);
|
|
3719
3719
|
};
|
|
3720
3720
|
r = e && typeof e.ownKeys == "function" ? e.ownKeys : Object.getOwnPropertySymbols ? function(m) {
|
|
3721
3721
|
return Object.getOwnPropertyNames(m).concat(Object.getOwnPropertySymbols(m));
|
|
@@ -3728,16 +3728,16 @@ var zi, On = { exports: {} }, jr = function() {
|
|
|
3728
3728
|
function i() {
|
|
3729
3729
|
i.init.call(this);
|
|
3730
3730
|
}
|
|
3731
|
-
On.exports = i, On.exports.once = function(m,
|
|
3731
|
+
On.exports = i, On.exports.once = function(m, v) {
|
|
3732
3732
|
return new Promise(function(w, x) {
|
|
3733
3733
|
function C(P) {
|
|
3734
|
-
m.removeListener(
|
|
3734
|
+
m.removeListener(v, D), x(P);
|
|
3735
3735
|
}
|
|
3736
3736
|
function D() {
|
|
3737
3737
|
typeof m.removeListener == "function" && m.removeListener("error", C), w([].slice.call(arguments));
|
|
3738
3738
|
}
|
|
3739
|
-
|
|
3740
|
-
typeof P.on == "function" &&
|
|
3739
|
+
y(m, v, D, { once: !0 }), v !== "error" && function(P, R, B) {
|
|
3740
|
+
typeof P.on == "function" && y(P, "error", R, B);
|
|
3741
3741
|
}(m, C, { once: !0 });
|
|
3742
3742
|
});
|
|
3743
3743
|
}, i.EventEmitter = i, i.prototype._events = void 0, i.prototype._eventsCount = 0, i.prototype._maxListeners = void 0;
|
|
@@ -3748,51 +3748,51 @@ var zi, On = { exports: {} }, jr = function() {
|
|
|
3748
3748
|
function a(m) {
|
|
3749
3749
|
return m._maxListeners === void 0 ? i.defaultMaxListeners : m._maxListeners;
|
|
3750
3750
|
}
|
|
3751
|
-
function c(m,
|
|
3751
|
+
function c(m, v, w, x) {
|
|
3752
3752
|
var C, D, P, R;
|
|
3753
|
-
if (s(w), (D = m._events) === void 0 ? (D = m._events = /* @__PURE__ */ Object.create(null), m._eventsCount = 0) : (D.newListener !== void 0 && (m.emit("newListener",
|
|
3754
|
-
else if (typeof P == "function" ? P = D[
|
|
3753
|
+
if (s(w), (D = m._events) === void 0 ? (D = m._events = /* @__PURE__ */ Object.create(null), m._eventsCount = 0) : (D.newListener !== void 0 && (m.emit("newListener", v, w.listener ? w.listener : w), D = m._events), P = D[v]), P === void 0) P = D[v] = w, ++m._eventsCount;
|
|
3754
|
+
else if (typeof P == "function" ? P = D[v] = x ? [w, P] : [P, w] : x ? P.unshift(w) : P.push(w), (C = a(m)) > 0 && P.length > C && !P.warned) {
|
|
3755
3755
|
P.warned = !0;
|
|
3756
|
-
var B = new Error("Possible EventEmitter memory leak detected. " + P.length + " " + String(
|
|
3757
|
-
B.name = "MaxListenersExceededWarning", B.emitter = m, B.type =
|
|
3756
|
+
var B = new Error("Possible EventEmitter memory leak detected. " + P.length + " " + String(v) + " listeners added. Use emitter.setMaxListeners() to increase limit");
|
|
3757
|
+
B.name = "MaxListenersExceededWarning", B.emitter = m, B.type = v, B.count = P.length, R = B, console && console.warn && console.warn(R);
|
|
3758
3758
|
}
|
|
3759
3759
|
return m;
|
|
3760
3760
|
}
|
|
3761
3761
|
function u() {
|
|
3762
3762
|
if (!this.fired) return this.target.removeListener(this.type, this.wrapFn), this.fired = !0, arguments.length === 0 ? this.listener.call(this.target) : this.listener.apply(this.target, arguments);
|
|
3763
3763
|
}
|
|
3764
|
-
function d(m,
|
|
3765
|
-
var x = { fired: !1, wrapFn: void 0, target: m, type:
|
|
3764
|
+
function d(m, v, w) {
|
|
3765
|
+
var x = { fired: !1, wrapFn: void 0, target: m, type: v, listener: w }, C = u.bind(x);
|
|
3766
3766
|
return C.listener = w, x.wrapFn = C, C;
|
|
3767
3767
|
}
|
|
3768
|
-
function h(m,
|
|
3768
|
+
function h(m, v, w) {
|
|
3769
3769
|
var x = m._events;
|
|
3770
3770
|
if (x === void 0) return [];
|
|
3771
|
-
var C = x[
|
|
3771
|
+
var C = x[v];
|
|
3772
3772
|
return C === void 0 ? [] : typeof C == "function" ? w ? [C.listener || C] : [C] : w ? function(D) {
|
|
3773
3773
|
for (var P = new Array(D.length), R = 0; R < P.length; ++R) P[R] = D[R].listener || D[R];
|
|
3774
3774
|
return P;
|
|
3775
|
-
}(C) :
|
|
3775
|
+
}(C) : b(C, C.length);
|
|
3776
3776
|
}
|
|
3777
3777
|
function g(m) {
|
|
3778
|
-
var
|
|
3779
|
-
if (
|
|
3780
|
-
var w =
|
|
3778
|
+
var v = this._events;
|
|
3779
|
+
if (v !== void 0) {
|
|
3780
|
+
var w = v[m];
|
|
3781
3781
|
if (typeof w == "function") return 1;
|
|
3782
3782
|
if (w !== void 0) return w.length;
|
|
3783
3783
|
}
|
|
3784
3784
|
return 0;
|
|
3785
3785
|
}
|
|
3786
|
-
function
|
|
3787
|
-
for (var w = new Array(
|
|
3786
|
+
function b(m, v) {
|
|
3787
|
+
for (var w = new Array(v), x = 0; x < v; ++x) w[x] = m[x];
|
|
3788
3788
|
return w;
|
|
3789
3789
|
}
|
|
3790
|
-
function
|
|
3791
|
-
if (typeof m.on == "function") x.once ? m.once(
|
|
3790
|
+
function y(m, v, w, x) {
|
|
3791
|
+
if (typeof m.on == "function") x.once ? m.once(v, w) : m.on(v, w);
|
|
3792
3792
|
else {
|
|
3793
3793
|
if (typeof m.addEventListener != "function") throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof m);
|
|
3794
|
-
m.addEventListener(
|
|
3795
|
-
x.once && m.removeEventListener(
|
|
3794
|
+
m.addEventListener(v, function C(D) {
|
|
3795
|
+
x.once && m.removeEventListener(v, C), w(D);
|
|
3796
3796
|
});
|
|
3797
3797
|
}
|
|
3798
3798
|
}
|
|
@@ -3809,39 +3809,39 @@ var zi, On = { exports: {} }, jr = function() {
|
|
|
3809
3809
|
}, i.prototype.getMaxListeners = function() {
|
|
3810
3810
|
return a(this);
|
|
3811
3811
|
}, i.prototype.emit = function(m) {
|
|
3812
|
-
for (var
|
|
3812
|
+
for (var v = [], w = 1; w < arguments.length; w++) v.push(arguments[w]);
|
|
3813
3813
|
var x = m === "error", C = this._events;
|
|
3814
3814
|
if (C !== void 0) x = x && C.error === void 0;
|
|
3815
3815
|
else if (!x) return !1;
|
|
3816
3816
|
if (x) {
|
|
3817
3817
|
var D;
|
|
3818
|
-
if (
|
|
3818
|
+
if (v.length > 0 && (D = v[0]), D instanceof Error) throw D;
|
|
3819
3819
|
var P = new Error("Unhandled error." + (D ? " (" + D.message + ")" : ""));
|
|
3820
3820
|
throw P.context = D, P;
|
|
3821
3821
|
}
|
|
3822
3822
|
var R = C[m];
|
|
3823
3823
|
if (R === void 0) return !1;
|
|
3824
|
-
if (typeof R == "function") t(R, this,
|
|
3824
|
+
if (typeof R == "function") t(R, this, v);
|
|
3825
3825
|
else {
|
|
3826
|
-
var B = R.length, re =
|
|
3827
|
-
for (w = 0; w < B; ++w) t(re[w], this,
|
|
3826
|
+
var B = R.length, re = b(R, B);
|
|
3827
|
+
for (w = 0; w < B; ++w) t(re[w], this, v);
|
|
3828
3828
|
}
|
|
3829
3829
|
return !0;
|
|
3830
|
-
}, i.prototype.addListener = function(m,
|
|
3831
|
-
return c(this, m,
|
|
3832
|
-
}, i.prototype.on = i.prototype.addListener, i.prototype.prependListener = function(m,
|
|
3833
|
-
return c(this, m,
|
|
3834
|
-
}, i.prototype.once = function(m,
|
|
3835
|
-
return s(
|
|
3836
|
-
}, i.prototype.prependOnceListener = function(m,
|
|
3837
|
-
return s(
|
|
3838
|
-
}, i.prototype.removeListener = function(m,
|
|
3830
|
+
}, i.prototype.addListener = function(m, v) {
|
|
3831
|
+
return c(this, m, v, !1);
|
|
3832
|
+
}, i.prototype.on = i.prototype.addListener, i.prototype.prependListener = function(m, v) {
|
|
3833
|
+
return c(this, m, v, !0);
|
|
3834
|
+
}, i.prototype.once = function(m, v) {
|
|
3835
|
+
return s(v), this.on(m, d(this, m, v)), this;
|
|
3836
|
+
}, i.prototype.prependOnceListener = function(m, v) {
|
|
3837
|
+
return s(v), this.prependListener(m, d(this, m, v)), this;
|
|
3838
|
+
}, i.prototype.removeListener = function(m, v) {
|
|
3839
3839
|
var w, x, C, D, P;
|
|
3840
|
-
if (s(
|
|
3840
|
+
if (s(v), (x = this._events) === void 0) return this;
|
|
3841
3841
|
if ((w = x[m]) === void 0) return this;
|
|
3842
|
-
if (w ===
|
|
3842
|
+
if (w === v || w.listener === v) --this._eventsCount == 0 ? this._events = /* @__PURE__ */ Object.create(null) : (delete x[m], x.removeListener && this.emit("removeListener", m, w.listener || v));
|
|
3843
3843
|
else if (typeof w != "function") {
|
|
3844
|
-
for (C = -1, D = w.length - 1; D >= 0; D--) if (w[D] ===
|
|
3844
|
+
for (C = -1, D = w.length - 1; D >= 0; D--) if (w[D] === v || w[D].listener === v) {
|
|
3845
3845
|
P = w[D].listener, C = D;
|
|
3846
3846
|
break;
|
|
3847
3847
|
}
|
|
@@ -3849,11 +3849,11 @@ var zi, On = { exports: {} }, jr = function() {
|
|
|
3849
3849
|
C === 0 ? w.shift() : function(R, B) {
|
|
3850
3850
|
for (; B + 1 < R.length; B++) R[B] = R[B + 1];
|
|
3851
3851
|
R.pop();
|
|
3852
|
-
}(w, C), w.length === 1 && (x[m] = w[0]), x.removeListener !== void 0 && this.emit("removeListener", m, P ||
|
|
3852
|
+
}(w, C), w.length === 1 && (x[m] = w[0]), x.removeListener !== void 0 && this.emit("removeListener", m, P || v);
|
|
3853
3853
|
}
|
|
3854
3854
|
return this;
|
|
3855
3855
|
}, i.prototype.off = i.prototype.removeListener, i.prototype.removeAllListeners = function(m) {
|
|
3856
|
-
var
|
|
3856
|
+
var v, w, x;
|
|
3857
3857
|
if ((w = this._events) === void 0) return this;
|
|
3858
3858
|
if (w.removeListener === void 0) return arguments.length === 0 ? (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0) : w[m] !== void 0 && (--this._eventsCount == 0 ? this._events = /* @__PURE__ */ Object.create(null) : delete w[m]), this;
|
|
3859
3859
|
if (arguments.length === 0) {
|
|
@@ -3861,15 +3861,15 @@ var zi, On = { exports: {} }, jr = function() {
|
|
|
3861
3861
|
for (x = 0; x < D.length; ++x) (C = D[x]) !== "removeListener" && this.removeAllListeners(C);
|
|
3862
3862
|
return this.removeAllListeners("removeListener"), this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0, this;
|
|
3863
3863
|
}
|
|
3864
|
-
if (typeof (
|
|
3865
|
-
else if (
|
|
3864
|
+
if (typeof (v = w[m]) == "function") this.removeListener(m, v);
|
|
3865
|
+
else if (v !== void 0) for (x = v.length - 1; x >= 0; x--) this.removeListener(m, v[x]);
|
|
3866
3866
|
return this;
|
|
3867
3867
|
}, i.prototype.listeners = function(m) {
|
|
3868
3868
|
return h(this, m, !0);
|
|
3869
3869
|
}, i.prototype.rawListeners = function(m) {
|
|
3870
3870
|
return h(this, m, !1);
|
|
3871
|
-
}, i.listenerCount = function(m,
|
|
3872
|
-
return typeof m.listenerCount == "function" ? m.listenerCount(
|
|
3871
|
+
}, i.listenerCount = function(m, v) {
|
|
3872
|
+
return typeof m.listenerCount == "function" ? m.listenerCount(v) : g.call(m, v);
|
|
3873
3873
|
}, i.prototype.listenerCount = g, i.prototype.eventNames = function() {
|
|
3874
3874
|
return this._eventsCount > 0 ? r(this._events) : [];
|
|
3875
3875
|
}, On.exports;
|
|
@@ -5184,13 +5184,13 @@ function pl(r) {
|
|
|
5184
5184
|
const a = Ta(r.spanContext().traceId, e), c = Ci(t), u = c.data || {}, d = u["sentry.sample_rate"];
|
|
5185
5185
|
d != null && (a.sample_rate = `${d}`);
|
|
5186
5186
|
const h = u["sentry.source"], g = c.description;
|
|
5187
|
-
return h !== "url" && g && (a.transaction = g), function(
|
|
5187
|
+
return h !== "url" && g && (a.transaction = g), function(b) {
|
|
5188
5188
|
if (typeof __SENTRY_TRACING__ == "boolean" && !__SENTRY_TRACING__) return !1;
|
|
5189
|
-
const
|
|
5189
|
+
const y = Ce(), m = y && y.getOptions();
|
|
5190
5190
|
return !!m && (m.enableTracing || "tracesSampleRate" in m || "tracesSampler" in m);
|
|
5191
|
-
}() && (a.sampled = String(function(
|
|
5192
|
-
const { traceFlags:
|
|
5193
|
-
return
|
|
5191
|
+
}() && (a.sampled = String(function(b) {
|
|
5192
|
+
const { traceFlags: y } = b.spanContext();
|
|
5193
|
+
return y === 1;
|
|
5194
5194
|
}(t))), e.emit("createDsc", a, t), a;
|
|
5195
5195
|
}
|
|
5196
5196
|
const fl = /^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;
|
|
@@ -5211,8 +5211,8 @@ function gl(r) {
|
|
|
5211
5211
|
let d = "", h = u;
|
|
5212
5212
|
const g = h.split("/");
|
|
5213
5213
|
if (g.length > 1 && (d = g.slice(0, -1).join("/"), h = g.pop()), h) {
|
|
5214
|
-
const
|
|
5215
|
-
|
|
5214
|
+
const b = h.match(/^\d+/);
|
|
5215
|
+
b && (h = b[0]);
|
|
5216
5216
|
}
|
|
5217
5217
|
return ho({ host: a, pass: s, path: d, projectId: h, port: c, protocol: i, publicKey: o });
|
|
5218
5218
|
}(r) : ho(r);
|
|
@@ -5254,26 +5254,26 @@ function Wr(r, e, t = 1 / 0, n = 1 / 0, i = /* @__PURE__ */ function() {
|
|
|
5254
5254
|
}()) {
|
|
5255
5255
|
const [o, s] = i;
|
|
5256
5256
|
if (e == null || ["boolean", "string"].includes(typeof e) || typeof e == "number" && Number.isFinite(e)) return e;
|
|
5257
|
-
const a = function(
|
|
5257
|
+
const a = function(b, y) {
|
|
5258
5258
|
try {
|
|
5259
|
-
if (
|
|
5260
|
-
if (
|
|
5261
|
-
if (typeof global < "u" &&
|
|
5262
|
-
if (typeof window < "u" &&
|
|
5263
|
-
if (typeof document < "u" &&
|
|
5264
|
-
if (Sa(
|
|
5265
|
-
if (Qt(m =
|
|
5266
|
-
if (typeof
|
|
5267
|
-
if (typeof
|
|
5268
|
-
if (typeof
|
|
5269
|
-
if (typeof
|
|
5270
|
-
const
|
|
5259
|
+
if (b === "domain" && y && typeof y == "object" && y._events) return "[Domain]";
|
|
5260
|
+
if (b === "domainEmitter") return "[DomainEmitter]";
|
|
5261
|
+
if (typeof global < "u" && y === global) return "[Global]";
|
|
5262
|
+
if (typeof window < "u" && y === window) return "[Window]";
|
|
5263
|
+
if (typeof document < "u" && y === document) return "[Document]";
|
|
5264
|
+
if (Sa(y)) return "[VueViewModel]";
|
|
5265
|
+
if (Qt(m = y) && "nativeEvent" in m && "preventDefault" in m && "stopPropagation" in m) return "[SyntheticEvent]";
|
|
5266
|
+
if (typeof y == "number" && !Number.isFinite(y)) return `[${y}]`;
|
|
5267
|
+
if (typeof y == "function") return `[Function: ${_t(y)}]`;
|
|
5268
|
+
if (typeof y == "symbol") return `[${String(y)}]`;
|
|
5269
|
+
if (typeof y == "bigint") return `[BigInt: ${String(y)}]`;
|
|
5270
|
+
const v = function(w) {
|
|
5271
5271
|
const x = Object.getPrototypeOf(w);
|
|
5272
5272
|
return x ? x.constructor.name : "null prototype";
|
|
5273
|
-
}(
|
|
5274
|
-
return /^HTML(\w*)Element$/.test(
|
|
5275
|
-
} catch (
|
|
5276
|
-
return `**non-serializable** (${
|
|
5273
|
+
}(y);
|
|
5274
|
+
return /^HTML(\w*)Element$/.test(v) ? `[HTMLElement: ${v}]` : `[object ${v}]`;
|
|
5275
|
+
} catch (v) {
|
|
5276
|
+
return `**non-serializable** (${v})`;
|
|
5277
5277
|
}
|
|
5278
5278
|
var m;
|
|
5279
5279
|
}(r, e);
|
|
@@ -5290,14 +5290,14 @@ function Wr(r, e, t = 1 / 0, n = 1 / 0, i = /* @__PURE__ */ function() {
|
|
|
5290
5290
|
const d = Array.isArray(e) ? [] : {};
|
|
5291
5291
|
let h = 0;
|
|
5292
5292
|
const g = _a(e);
|
|
5293
|
-
for (const
|
|
5294
|
-
if (!Object.prototype.hasOwnProperty.call(g,
|
|
5293
|
+
for (const b in g) {
|
|
5294
|
+
if (!Object.prototype.hasOwnProperty.call(g, b)) continue;
|
|
5295
5295
|
if (h >= n) {
|
|
5296
|
-
d[
|
|
5296
|
+
d[b] = "[MaxProperties ~]";
|
|
5297
5297
|
break;
|
|
5298
5298
|
}
|
|
5299
|
-
const
|
|
5300
|
-
d[
|
|
5299
|
+
const y = g[b];
|
|
5300
|
+
d[b] = Wr(b, y, c - 1, n, i), h++;
|
|
5301
5301
|
}
|
|
5302
5302
|
return s(e), d;
|
|
5303
5303
|
}
|
|
@@ -5383,14 +5383,14 @@ let In, go, wr;
|
|
|
5383
5383
|
function Sl(r, e) {
|
|
5384
5384
|
const { fingerprint: t, span: n, breadcrumbs: i, sdkProcessingMetadata: o } = e;
|
|
5385
5385
|
(function(s, a) {
|
|
5386
|
-
const { extra: c, tags: u, user: d, contexts: h, level: g, transactionName:
|
|
5387
|
-
|
|
5386
|
+
const { extra: c, tags: u, user: d, contexts: h, level: g, transactionName: b } = a, y = He(c);
|
|
5387
|
+
y && Object.keys(y).length && (s.extra = { ...y, ...s.extra });
|
|
5388
5388
|
const m = He(u);
|
|
5389
5389
|
m && Object.keys(m).length && (s.tags = { ...m, ...s.tags });
|
|
5390
|
-
const
|
|
5391
|
-
|
|
5390
|
+
const v = He(d);
|
|
5391
|
+
v && Object.keys(v).length && (s.user = { ...v, ...s.user });
|
|
5392
5392
|
const w = He(h);
|
|
5393
|
-
w && Object.keys(w).length && (s.contexts = { ...w, ...s.contexts }), g && (s.level = g),
|
|
5393
|
+
w && Object.keys(w).length && (s.contexts = { ...w, ...s.contexts }), g && (s.level = g), b && s.type !== "transaction" && (s.transaction = b);
|
|
5394
5394
|
})(r, e), n && function(s, a) {
|
|
5395
5395
|
s.contexts = { trace: ul(a), ...s.contexts }, s.sdkProcessingMetadata = { dynamicSamplingContext: pl(a), ...s.sdkProcessingMetadata };
|
|
5396
5396
|
const c = Ea(a), u = Ci(c).description;
|
|
@@ -5405,25 +5405,25 @@ function Sl(r, e) {
|
|
|
5405
5405
|
}(r, o);
|
|
5406
5406
|
}
|
|
5407
5407
|
function mo(r, e) {
|
|
5408
|
-
const { extra: t, tags: n, user: i, contexts: o, level: s, sdkProcessingMetadata: a, breadcrumbs: c, fingerprint: u, eventProcessors: d, attachments: h, propagationContext: g, transactionName:
|
|
5409
|
-
Rn(r, "extra", t), Rn(r, "tags", n), Rn(r, "user", i), Rn(r, "contexts", o), r.sdkProcessingMetadata = gr(r.sdkProcessingMetadata, a, 2), s && (r.level = s),
|
|
5408
|
+
const { extra: t, tags: n, user: i, contexts: o, level: s, sdkProcessingMetadata: a, breadcrumbs: c, fingerprint: u, eventProcessors: d, attachments: h, propagationContext: g, transactionName: b, span: y } = e;
|
|
5409
|
+
Rn(r, "extra", t), Rn(r, "tags", n), Rn(r, "user", i), Rn(r, "contexts", o), r.sdkProcessingMetadata = gr(r.sdkProcessingMetadata, a, 2), s && (r.level = s), b && (r.transactionName = b), y && (r.span = y), c.length && (r.breadcrumbs = [...r.breadcrumbs, ...c]), u.length && (r.fingerprint = [...r.fingerprint, ...u]), d.length && (r.eventProcessors = [...r.eventProcessors, ...d]), h.length && (r.attachments = [...r.attachments, ...h]), r.propagationContext = { ...r.propagationContext, ...g };
|
|
5410
5410
|
}
|
|
5411
5411
|
function Rn(r, e, t) {
|
|
5412
5412
|
r[e] = gr(r[e], t, 1);
|
|
5413
5413
|
}
|
|
5414
5414
|
function kl(r, e, t, n, i, o) {
|
|
5415
|
-
const { normalizeDepth: s = 3, normalizeMaxBreadth: a = 1e3 } = r, c = { ...e, event_id: e.event_id || t.event_id || ze(), timestamp: e.timestamp || En() }, u = t.integrations || r.integrations.map((
|
|
5416
|
-
(function(
|
|
5417
|
-
const { environment:
|
|
5418
|
-
|
|
5419
|
-
const D =
|
|
5415
|
+
const { normalizeDepth: s = 3, normalizeMaxBreadth: a = 1e3 } = r, c = { ...e, event_id: e.event_id || t.event_id || ze(), timestamp: e.timestamp || En() }, u = t.integrations || r.integrations.map((y) => y.name);
|
|
5416
|
+
(function(y, m) {
|
|
5417
|
+
const { environment: v, release: w, dist: x, maxValueLength: C = 250 } = m;
|
|
5418
|
+
y.environment = y.environment || v || Ei, !y.release && w && (y.release = w), !y.dist && x && (y.dist = x), y.message && (y.message = Gt(y.message, C));
|
|
5419
|
+
const D = y.exception && y.exception.values && y.exception.values[0];
|
|
5420
5420
|
D && D.value && (D.value = Gt(D.value, C));
|
|
5421
|
-
const P =
|
|
5421
|
+
const P = y.request;
|
|
5422
5422
|
P && P.url && (P.url = Gt(P.url, C));
|
|
5423
|
-
})(c, r), function(
|
|
5424
|
-
m.length > 0 && (
|
|
5425
|
-
}(c, u), i && i.emit("applyFrameMetadata", e), e.type === void 0 && function(
|
|
5426
|
-
const
|
|
5423
|
+
})(c, r), function(y, m) {
|
|
5424
|
+
m.length > 0 && (y.sdk = y.sdk || {}, y.sdk.integrations = [...y.sdk.integrations || [], ...m]);
|
|
5425
|
+
}(c, u), i && i.emit("applyFrameMetadata", e), e.type === void 0 && function(y, m) {
|
|
5426
|
+
const v = function(w) {
|
|
5427
5427
|
const x = ce._sentryDebugIds;
|
|
5428
5428
|
if (!x) return {};
|
|
5429
5429
|
const C = Object.keys(x);
|
|
@@ -5445,44 +5445,44 @@ function kl(r, e, t, n, i, o) {
|
|
|
5445
5445
|
}, {})), wr;
|
|
5446
5446
|
}(m);
|
|
5447
5447
|
try {
|
|
5448
|
-
|
|
5448
|
+
y.exception.values.forEach((w) => {
|
|
5449
5449
|
w.stacktrace.frames.forEach((x) => {
|
|
5450
|
-
|
|
5450
|
+
v && x.filename && (x.debug_id = v[x.filename]);
|
|
5451
5451
|
});
|
|
5452
5452
|
});
|
|
5453
5453
|
} catch {
|
|
5454
5454
|
}
|
|
5455
5455
|
}(c, r.stackParser);
|
|
5456
|
-
const d = function(
|
|
5457
|
-
if (!m) return
|
|
5458
|
-
const
|
|
5459
|
-
return
|
|
5456
|
+
const d = function(y, m) {
|
|
5457
|
+
if (!m) return y;
|
|
5458
|
+
const v = y ? y.clone() : new Ct();
|
|
5459
|
+
return v.update(m), v;
|
|
5460
5460
|
}(n, t.captureContext);
|
|
5461
5461
|
t.mechanism && Zt(c, t.mechanism);
|
|
5462
5462
|
const h = i ? i.getEventProcessors() : [], g = Zn("globalScope", () => new Ct()).getScopeData();
|
|
5463
5463
|
o && mo(g, o.getScopeData()), d && mo(g, d.getScopeData());
|
|
5464
|
-
const
|
|
5465
|
-
return
|
|
5466
|
-
const
|
|
5464
|
+
const b = [...t.attachments || [], ...g.attachments];
|
|
5465
|
+
return b.length && (t.attachments = b), Sl(c, g), Gr([...h, ...g.eventProcessors], c, t).then((y) => (y && function(m) {
|
|
5466
|
+
const v = {};
|
|
5467
5467
|
try {
|
|
5468
5468
|
m.exception.values.forEach((x) => {
|
|
5469
5469
|
x.stacktrace.frames.forEach((C) => {
|
|
5470
|
-
C.debug_id && (C.abs_path ?
|
|
5470
|
+
C.debug_id && (C.abs_path ? v[C.abs_path] = C.debug_id : C.filename && (v[C.filename] = C.debug_id), delete C.debug_id);
|
|
5471
5471
|
});
|
|
5472
5472
|
});
|
|
5473
5473
|
} catch {
|
|
5474
5474
|
}
|
|
5475
|
-
if (Object.keys(
|
|
5475
|
+
if (Object.keys(v).length === 0) return;
|
|
5476
5476
|
m.debug_meta = m.debug_meta || {}, m.debug_meta.images = m.debug_meta.images || [];
|
|
5477
5477
|
const w = m.debug_meta.images;
|
|
5478
|
-
Object.entries(
|
|
5478
|
+
Object.entries(v).forEach(([x, C]) => {
|
|
5479
5479
|
w.push({ type: "sourcemap", code_file: x, debug_id: C });
|
|
5480
5480
|
});
|
|
5481
|
-
}(
|
|
5481
|
+
}(y), typeof s == "number" && s > 0 ? function(m, v, w) {
|
|
5482
5482
|
if (!m) return null;
|
|
5483
|
-
const x = { ...m, ...m.breadcrumbs && { breadcrumbs: m.breadcrumbs.map((C) => ({ ...C, ...C.data && { data: lt(C.data,
|
|
5484
|
-
return m.contexts && m.contexts.trace && x.contexts && (x.contexts.trace = m.contexts.trace, m.contexts.trace.data && (x.contexts.trace.data = lt(m.contexts.trace.data,
|
|
5485
|
-
}(
|
|
5483
|
+
const x = { ...m, ...m.breadcrumbs && { breadcrumbs: m.breadcrumbs.map((C) => ({ ...C, ...C.data && { data: lt(C.data, v, w) } })) }, ...m.user && { user: lt(m.user, v, w) }, ...m.contexts && { contexts: lt(m.contexts, v, w) }, ...m.extra && { extra: lt(m.extra, v, w) } };
|
|
5484
|
+
return m.contexts && m.contexts.trace && x.contexts && (x.contexts.trace = m.contexts.trace, m.contexts.trace.data && (x.contexts.trace.data = lt(m.contexts.trace.data, v, w))), m.spans && (x.spans = m.spans.map((C) => ({ ...C, ...C.data && { data: lt(C.data, v, w) } }))), m.contexts && m.contexts.flags && x.contexts && (x.contexts.flags = lt(m.contexts.flags, 3, w)), x;
|
|
5485
|
+
}(y, s, a) : y));
|
|
5486
5486
|
}
|
|
5487
5487
|
function bo(r, e) {
|
|
5488
5488
|
return zt().captureEvent(r, e);
|
|
@@ -5693,19 +5693,19 @@ class _l {
|
|
|
5693
5693
|
});
|
|
5694
5694
|
}
|
|
5695
5695
|
_processEvent(e, t, n) {
|
|
5696
|
-
const i = this.getOptions(), { sampleRate: o } = i, s = Co(e), a = _o(e), c = e.type || "error", u = `before send for type \`${c}\``, d = o === void 0 ? void 0 : function(
|
|
5697
|
-
if (typeof
|
|
5698
|
-
const
|
|
5699
|
-
if (!(typeof
|
|
5700
|
-
ge && J.warn(`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(
|
|
5696
|
+
const i = this.getOptions(), { sampleRate: o } = i, s = Co(e), a = _o(e), c = e.type || "error", u = `before send for type \`${c}\``, d = o === void 0 ? void 0 : function(b) {
|
|
5697
|
+
if (typeof b == "boolean") return Number(b);
|
|
5698
|
+
const y = typeof b == "string" ? parseFloat(b) : b;
|
|
5699
|
+
if (!(typeof y != "number" || isNaN(y) || y < 0 || y > 1)) return y;
|
|
5700
|
+
ge && J.warn(`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(b)} of type ${JSON.stringify(typeof b)}.`);
|
|
5701
5701
|
}(o);
|
|
5702
5702
|
if (a && typeof d == "number" && Math.random() > d) return this.recordDroppedEvent("sample_rate", "error", e), tr(new Je(`Discarding event because it's not included in the random sample (sampling rate = ${o})`, "log"));
|
|
5703
5703
|
const h = c === "replay_event" ? "replay" : c, g = (e.sdkProcessingMetadata || {}).capturedSpanIsolationScope;
|
|
5704
|
-
return this._prepareEvent(e, t, n, g).then((
|
|
5705
|
-
if (
|
|
5706
|
-
if (t.data && t.data.__sentry__ === !0) return
|
|
5707
|
-
const
|
|
5708
|
-
const { beforeSend: C, beforeSendTransaction: D, beforeSendSpan: P } =
|
|
5704
|
+
return this._prepareEvent(e, t, n, g).then((b) => {
|
|
5705
|
+
if (b === null) throw this.recordDroppedEvent("event_processor", h, e), new Je("An event processor returned `null`, will not send event.", "log");
|
|
5706
|
+
if (t.data && t.data.__sentry__ === !0) return b;
|
|
5707
|
+
const y = function(m, v, w, x) {
|
|
5708
|
+
const { beforeSend: C, beforeSendTransaction: D, beforeSendSpan: P } = v;
|
|
5709
5709
|
if (_o(w) && C) return C(w, x);
|
|
5710
5710
|
if (Co(w)) {
|
|
5711
5711
|
if (w.spans && P) {
|
|
@@ -5725,40 +5725,40 @@ class _l {
|
|
|
5725
5725
|
}
|
|
5726
5726
|
}
|
|
5727
5727
|
return w;
|
|
5728
|
-
}(this, i,
|
|
5729
|
-
return function(m,
|
|
5730
|
-
const w = `${
|
|
5728
|
+
}(this, i, b, t);
|
|
5729
|
+
return function(m, v) {
|
|
5730
|
+
const w = `${v} must return \`null\` or a valid event.`;
|
|
5731
5731
|
if (fr(m)) return m.then((x) => {
|
|
5732
5732
|
if (!Qt(x) && x !== null) throw new Je(w);
|
|
5733
5733
|
return x;
|
|
5734
5734
|
}, (x) => {
|
|
5735
|
-
throw new Je(`${
|
|
5735
|
+
throw new Je(`${v} rejected with ${x}`);
|
|
5736
5736
|
});
|
|
5737
5737
|
if (!Qt(m) && m !== null) throw new Je(w);
|
|
5738
5738
|
return m;
|
|
5739
|
-
}(
|
|
5740
|
-
}).then((
|
|
5741
|
-
if (
|
|
5739
|
+
}(y, u);
|
|
5740
|
+
}).then((b) => {
|
|
5741
|
+
if (b === null) {
|
|
5742
5742
|
if (this.recordDroppedEvent("before_send", h, e), s) {
|
|
5743
|
-
const
|
|
5744
|
-
this.recordDroppedEvent("before_send", "span",
|
|
5743
|
+
const v = 1 + (e.spans || []).length;
|
|
5744
|
+
this.recordDroppedEvent("before_send", "span", v);
|
|
5745
5745
|
}
|
|
5746
5746
|
throw new Je(`${u} returned \`null\`, will not send event.`, "log");
|
|
5747
5747
|
}
|
|
5748
|
-
const
|
|
5749
|
-
if (!s &&
|
|
5750
|
-
const
|
|
5751
|
-
|
|
5748
|
+
const y = n && n.getSession();
|
|
5749
|
+
if (!s && y && this._updateSessionFromEvent(y, b), s) {
|
|
5750
|
+
const v = (b.sdkProcessingMetadata && b.sdkProcessingMetadata.spanCountBeforeProcessing || 0) - (b.spans ? b.spans.length : 0);
|
|
5751
|
+
v > 0 && this.recordDroppedEvent("before_send", "span", v);
|
|
5752
5752
|
}
|
|
5753
|
-
const m =
|
|
5754
|
-
if (s && m &&
|
|
5755
|
-
const
|
|
5756
|
-
|
|
5753
|
+
const m = b.transaction_info;
|
|
5754
|
+
if (s && m && b.transaction !== e.transaction) {
|
|
5755
|
+
const v = "custom";
|
|
5756
|
+
b.transaction_info = { ...m, source: v };
|
|
5757
5757
|
}
|
|
5758
|
-
return this.sendEvent(
|
|
5759
|
-
}).then(null, (
|
|
5760
|
-
throw
|
|
5761
|
-
Reason: ${
|
|
5758
|
+
return this.sendEvent(b, t), b;
|
|
5759
|
+
}).then(null, (b) => {
|
|
5760
|
+
throw b instanceof Je ? b : (this.captureException(b, { data: { __sentry__: !0 }, originalException: b }), new Je(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
|
|
5761
|
+
Reason: ${b}`));
|
|
5762
5762
|
});
|
|
5763
5763
|
}
|
|
5764
5764
|
_process(e) {
|
|
@@ -5817,7 +5817,7 @@ function El(r, { statusCode: e, headers: t }, n = Date.now()) {
|
|
|
5817
5817
|
const i = { ...r }, o = t && t["x-sentry-rate-limits"], s = t && t["retry-after"];
|
|
5818
5818
|
if (o) for (const a of o.trim().split(",")) {
|
|
5819
5819
|
const [c, u, , , d] = a.split(":", 5), h = parseInt(c, 10), g = 1e3 * (isNaN(h) ? 60 : h);
|
|
5820
|
-
if (u) for (const
|
|
5820
|
+
if (u) for (const b of u.split(";")) b === "metric_bucket" && d && !d.split(";").includes("custom") || (i[b] = n + g);
|
|
5821
5821
|
else i.all = n + g;
|
|
5822
5822
|
}
|
|
5823
5823
|
else s ? i.all = n + function(a, c = Date.now()) {
|
|
@@ -5834,10 +5834,10 @@ function Tl(r, e, t = Cl(r.bufferSize || 64)) {
|
|
|
5834
5834
|
const o = [];
|
|
5835
5835
|
if (po(i, (c, u) => {
|
|
5836
5836
|
const d = fo(u);
|
|
5837
|
-
if (function(h, g,
|
|
5838
|
-
return function(
|
|
5839
|
-
return
|
|
5840
|
-
}(h, g) >
|
|
5837
|
+
if (function(h, g, b = Date.now()) {
|
|
5838
|
+
return function(y, m) {
|
|
5839
|
+
return y[m] || y.all || 0;
|
|
5840
|
+
}(h, g) > b;
|
|
5841
5841
|
}(n, d)) {
|
|
5842
5842
|
const h = Eo(c, u);
|
|
5843
5843
|
r.recordDroppedEvent("ratelimit_backoff", d, h);
|
|
@@ -6073,8 +6073,8 @@ function Bl(r, e) {
|
|
|
6073
6073
|
const a = new Error(), { method: c, url: u } = function(h) {
|
|
6074
6074
|
if (h.length === 0) return { method: "GET", url: "" };
|
|
6075
6075
|
if (h.length === 2) {
|
|
6076
|
-
const [
|
|
6077
|
-
return { url: Ro(
|
|
6076
|
+
const [b, y] = h;
|
|
6077
|
+
return { url: Ro(b), method: Qr(y, "method") ? String(y.method).toUpperCase() : "GET" };
|
|
6078
6078
|
}
|
|
6079
6079
|
const g = h[0];
|
|
6080
6080
|
return { url: Ro(g), method: Qr(g, "method") ? String(g.method).toUpperCase() : "GET" };
|
|
@@ -6386,8 +6386,8 @@ function Wl() {
|
|
|
6386
6386
|
}
|
|
6387
6387
|
};
|
|
6388
6388
|
return "onreadystatechange" in t && typeof t.onreadystatechange == "function" ? t.onreadystatechange = new Proxy(t.onreadystatechange, { apply: (u, d, h) => (c(), u.apply(d, h)) }) : t.addEventListener("readystatechange", c), t.setRequestHeader = new Proxy(t.setRequestHeader, { apply(u, d, h) {
|
|
6389
|
-
const [g,
|
|
6390
|
-
return
|
|
6389
|
+
const [g, b] = h, y = d[mn];
|
|
6390
|
+
return y && dt(g) && dt(b) && (y.request_headers[g.toLowerCase()] = b), u.apply(d, h);
|
|
6391
6391
|
} }), e.apply(t, n);
|
|
6392
6392
|
} }), r.send = new Proxy(r.send, { apply(e, t, n) {
|
|
6393
6393
|
const i = t[mn];
|
|
@@ -6504,13 +6504,13 @@ const Gl = /^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i, Yl = /^\s*at (?:(.+?\)(?: \
|
|
|
6504
6504
|
let a, c, u = typeof o == "object" ? o.serializeAttribute : void 0, d = typeof o == "object" && typeof o.maxStringLength == "number" ? o.maxStringLength : void 0;
|
|
6505
6505
|
d && d > Uo && (mr && J.warn(`\`dom.maxStringLength\` cannot exceed 1024, but a value of ${d} was configured. Sentry will use 1024 instead.`), d = Uo), typeof u == "string" && (u = [u]);
|
|
6506
6506
|
try {
|
|
6507
|
-
const g = s.event,
|
|
6508
|
-
return !!
|
|
6507
|
+
const g = s.event, b = function(y) {
|
|
6508
|
+
return !!y && !!y.target;
|
|
6509
6509
|
}(g) ? g.target : g;
|
|
6510
|
-
a = ka(
|
|
6510
|
+
a = ka(b, { keyAttrs: u, maxStringLength: d }), c = function(y) {
|
|
6511
6511
|
if (!Si.HTMLElement) return null;
|
|
6512
|
-
let m =
|
|
6513
|
-
for (let
|
|
6512
|
+
let m = y;
|
|
6513
|
+
for (let v = 0; v < 5; v++) {
|
|
6514
6514
|
if (!m) return null;
|
|
6515
6515
|
if (m instanceof HTMLElement) {
|
|
6516
6516
|
if (m.dataset.sentryComponent) return m.dataset.sentryComponent;
|
|
@@ -6519,7 +6519,7 @@ const Gl = /^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i, Yl = /^\s*at (?:(.+?\)(?: \
|
|
|
6519
6519
|
m = m.parentNode;
|
|
6520
6520
|
}
|
|
6521
6521
|
return null;
|
|
6522
|
-
}(
|
|
6522
|
+
}(b);
|
|
6523
6523
|
} catch {
|
|
6524
6524
|
a = "<unknown>";
|
|
6525
6525
|
}
|
|
@@ -6534,8 +6534,8 @@ const Gl = /^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i, Yl = /^\s*at (?:(.+?\)(?: \
|
|
|
6534
6534
|
if (Ce() !== i) return;
|
|
6535
6535
|
const { startTimestamp: s, endTimestamp: a } = o, c = o.xhr[mn];
|
|
6536
6536
|
if (!s || !a || !c) return;
|
|
6537
|
-
const { method: u, url: d, status_code: h, body: g } = c,
|
|
6538
|
-
Tt({ category: "xhr", data:
|
|
6537
|
+
const { method: u, url: d, status_code: h, body: g } = c, b = { method: u, url: d, status_code: h }, y = { xhr: o.xhr, input: g, startTimestamp: s, endTimestamp: a };
|
|
6538
|
+
Tt({ category: "xhr", data: b, type: "http", level: Io(h) }, y);
|
|
6539
6539
|
};
|
|
6540
6540
|
}(t)), e.fetch && Bl(/* @__PURE__ */ function(i) {
|
|
6541
6541
|
return function(o) {
|
|
@@ -6630,15 +6630,15 @@ const au = () => ({ name: "BrowserSession", setupOnce() {
|
|
|
6630
6630
|
})((i) => {
|
|
6631
6631
|
const { stackParser: o, attachStacktrace: s } = qo();
|
|
6632
6632
|
if (Ce() !== n || No()) return;
|
|
6633
|
-
const { msg: a, url: c, line: u, column: d, error: h } = i, g = function(
|
|
6634
|
-
const w =
|
|
6633
|
+
const { msg: a, url: c, line: u, column: d, error: h } = i, g = function(b, y, m, v) {
|
|
6634
|
+
const w = b.exception = b.exception || {}, x = w.values = w.values || [], C = x[0] = x[0] || {}, D = C.stacktrace = C.stacktrace || {}, P = D.frames = D.frames || [], R = v, B = m, re = dt(y) && y.length > 0 ? y : function() {
|
|
6635
6635
|
try {
|
|
6636
6636
|
return Si.document.location.href;
|
|
6637
6637
|
} catch {
|
|
6638
6638
|
return "";
|
|
6639
6639
|
}
|
|
6640
6640
|
}();
|
|
6641
|
-
return P.length === 0 && P.push({ colno: R, filename: re, function: Pt, in_app: !0, lineno: B }),
|
|
6641
|
+
return P.length === 0 && P.push({ colno: R, filename: re, function: Pt, in_app: !0, lineno: B }), b;
|
|
6642
6642
|
}(ei(o, h || a, void 0, s, !1), c, u, d);
|
|
6643
6643
|
g.level = "error", bo(g, { originalException: h, mechanism: { handled: !1, type: "onerror" } });
|
|
6644
6644
|
});
|
|
@@ -7593,8 +7593,8 @@ var Wa = function() {
|
|
|
7593
7593
|
} else {
|
|
7594
7594
|
if (ae(e[o]) !== "object") return [!1, "invalid (non-object) value for field '".concat(o, "' in canReceive")];
|
|
7595
7595
|
for (var u = 0, d = Object.values(e[o]); u < d.length; u++) {
|
|
7596
|
-
var h = d[u], g = Ee(ke.validateJSONObject(h), 2),
|
|
7597
|
-
if (!
|
|
7596
|
+
var h = d[u], g = Ee(ke.validateJSONObject(h), 2), b = g[0], y = g[1];
|
|
7597
|
+
if (!b) return [!1, y];
|
|
7598
7598
|
}
|
|
7599
7599
|
}
|
|
7600
7600
|
}
|
|
@@ -7854,11 +7854,11 @@ var Mt = {}, _s = "video", $d = "voice", Cs = oe() ? { data: {} } : { data: {},
|
|
|
7854
7854
|
break;
|
|
7855
7855
|
case "canAdmin":
|
|
7856
7856
|
if (o instanceof Set || o instanceof Array || Array.isArray(o)) {
|
|
7857
|
-
var
|
|
7857
|
+
var b, y = ["participants", "streaming", "transcription"], m = ks(o);
|
|
7858
7858
|
try {
|
|
7859
|
-
for (m.s(); !(
|
|
7860
|
-
var
|
|
7861
|
-
if (!
|
|
7859
|
+
for (m.s(); !(b = m.n()).done; ) {
|
|
7860
|
+
var v = b.value;
|
|
7861
|
+
if (!y.includes(v)) return !1;
|
|
7862
7862
|
}
|
|
7863
7863
|
} catch (w) {
|
|
7864
7864
|
m.e(w);
|
|
@@ -7893,7 +7893,7 @@ Promise.any || (Promise.any = function() {
|
|
|
7893
7893
|
}());
|
|
7894
7894
|
var jd = function() {
|
|
7895
7895
|
function r(l) {
|
|
7896
|
-
var f, p, S, k, E,
|
|
7896
|
+
var f, p, S, k, E, A, L = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
7897
7897
|
if (Be(this, r), S = this, k = Ze(k = r), ot(p = lr(S, Ja() ? Reflect.construct(k, [], Ze(S).constructor) : k.apply(S, E)), "startListeningForDeviceChanges", function() {
|
|
7898
7898
|
Dd(p.handleDeviceChange);
|
|
7899
7899
|
}), ot(p, "stopListeningForDeviceChanges", function() {
|
|
@@ -7920,7 +7920,7 @@ var jd = function() {
|
|
|
7920
7920
|
if (p.strictMode) throw new Error("Duplicate DailyIframe instances are not allowed");
|
|
7921
7921
|
console.warn("Using strictMode: false to allow multiple call instances is now deprecated. Set `allowMultipleCallInstances: true`");
|
|
7922
7922
|
}
|
|
7923
|
-
if (window._daily || (window._daily = { pendings: [], instances: {} }), p.callClientId = dr(), Mt[(
|
|
7923
|
+
if (window._daily || (window._daily = { pendings: [], instances: {} }), p.callClientId = dr(), Mt[(A = p).callClientId] = A, window._daily.instances[p.callClientId] = {}, p._sharedTracks = {}, window._daily.instances[p.callClientId].tracks = p._sharedTracks, L.dailyJsVersion = r.version(), p._iframe = l, p._callObjectMode = L.layout === "none" && !p._iframe, p._preloadCache = { subscribeToTracksAutomatically: !0, outputDeviceId: null, inputSettings: null, sendSettings: null, videoTrackForNetworkConnectivityTest: null, videoTrackForConnectionQualityTest: null }, L.showLocalVideo !== void 0 ? p._callObjectMode ? console.error("showLocalVideo is not available in call object mode") : p._showLocalVideo = !!L.showLocalVideo : p._showLocalVideo = !0, L.showParticipantsBar !== void 0 ? p._callObjectMode ? console.error("showParticipantsBar is not available in call object mode") : p._showParticipantsBar = !!L.showParticipantsBar : p._showParticipantsBar = !0, L.customIntegrations !== void 0 ? p._callObjectMode ? console.error("customIntegrations is not available in call object mode") : p._customIntegrations = L.customIntegrations : p._customIntegrations = {}, L.customTrayButtons !== void 0 ? p._callObjectMode ? console.error("customTrayButtons is not available in call object mode") : p._customTrayButtons = L.customTrayButtons : p._customTrayButtons = {}, L.activeSpeakerMode !== void 0 ? p._callObjectMode ? console.error("activeSpeakerMode is not available in call object mode") : p._activeSpeakerMode = !!L.activeSpeakerMode : p._activeSpeakerMode = !1, L.receiveSettings ? p._callObjectMode ? p._receiveSettings = L.receiveSettings : console.error("receiveSettings is only available in call object mode") : p._receiveSettings = {}, p.validateProperties(L), p.properties = F({}, L), p._inputSettings || (p._inputSettings = {}), p._callObjectLoader = p._callObjectMode ? new wd(p.callClientId) : null, p._callState = Vo, p._isPreparingToJoin = !1, p._accessState = { access: Tr }, p._meetingSessionSummary = {}, p._finalSummaryOfPrevSession = {}, p._meetingSessionState = Br(Cs, p._callObjectMode), p._nativeInCallAudioMode = _s, p._participants = {}, p._isScreenSharing = !1, p._participantCounts = Es, p._rmpPlayerState = {}, p._waitingParticipants = {}, p._network = { threshold: "good", quality: 100, networkState: "unknown", stats: {} }, p._activeSpeaker = {}, p._localAudioLevel = 0, p._isLocalAudioLevelObserverRunning = !1, p._remoteParticipantsAudioLevel = {}, p._isRemoteParticipantsAudioLevelObserverRunning = !1, p._maxAppMessageSize = Mr, p._messageChannel = oe() ? new yd() : new bd(), p._iframe && (p._iframe.requestFullscreen ? p._iframe.addEventListener("fullscreenchange", function() {
|
|
7924
7924
|
document.fullscreenElement === p._iframe ? (p.emitDailyJSEvent({ action: $n }), p.sendMessageToCallMachine({ action: $n })) : (p.emitDailyJSEvent({ action: jn }), p.sendMessageToCallMachine({ action: jn }));
|
|
7925
7925
|
}) : p._iframe.webkitRequestFullscreen && p._iframe.addEventListener("webkitfullscreenchange", function() {
|
|
7926
7926
|
document.webkitFullscreenElement === p._iframe ? (p.emitDailyJSEvent({ action: $n }), p.sendMessageToCallMachine({ action: $n })) : (p.emitDailyJSEvent({ action: jn }), p.sendMessageToCallMachine({ action: jn }));
|
|
@@ -7998,9 +7998,9 @@ var jd = function() {
|
|
|
7998
7998
|
return Te.apply(this, arguments);
|
|
7999
7999
|
}) }, { key: "requestAccess", value: (Z = W(function* () {
|
|
8000
8000
|
var l = this, f = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, p = f.access, S = p === void 0 ? { level: hu } : p, k = f.name, E = k === void 0 ? "" : k;
|
|
8001
|
-
return Ke(this._callObjectMode, "requestAccess()"), fe(this._callState, "requestAccess()"), new Promise(function(
|
|
8001
|
+
return Ke(this._callObjectMode, "requestAccess()"), fe(this._callState, "requestAccess()"), new Promise(function(A, L) {
|
|
8002
8002
|
l.sendMessageToCallMachine({ action: "daily-method-request-access", access: S, name: E }, function(I) {
|
|
8003
|
-
I.error && L(I.error), I.access || L(new Error("unknown error in requestAccess()")),
|
|
8003
|
+
I.error && L(I.error), I.access || L(new Error("unknown error in requestAccess()")), A({ access: I.access, granted: I.granted });
|
|
8004
8004
|
});
|
|
8005
8005
|
});
|
|
8006
8006
|
}), function() {
|
|
@@ -8058,8 +8058,8 @@ var jd = function() {
|
|
|
8058
8058
|
if (l.audio) {
|
|
8059
8059
|
var S, k, E;
|
|
8060
8060
|
l.audio.settings && (!Object.keys(l.audio.settings).length && f || (p.audio = { settings: F({}, l.audio.settings) })), f && (S = p.audio) !== null && S !== void 0 && (S = S.settings) !== null && S !== void 0 && S.customTrack && (p.audio.settings = { customTrack: this._sharedTracks.audioTrack });
|
|
8061
|
-
var
|
|
8062
|
-
if (l.audio.processor && !
|
|
8061
|
+
var A = ((k = l.audio.processor) === null || k === void 0 ? void 0 : k.type) === "none" && ((E = l.audio.processor) === null || E === void 0 ? void 0 : E._isDefaultWhenNone);
|
|
8062
|
+
if (l.audio.processor && !A) {
|
|
8063
8063
|
var L = F({}, l.audio.processor);
|
|
8064
8064
|
delete L._isDefaultWhenNone, p.audio = F(F({}, p.audio), {}, { processor: L });
|
|
8065
8065
|
}
|
|
@@ -8081,15 +8081,15 @@ var jd = function() {
|
|
|
8081
8081
|
f(l._getInputSettings());
|
|
8082
8082
|
});
|
|
8083
8083
|
} }, { key: "_getInputSettings", value: function() {
|
|
8084
|
-
var l, f, p, S, k, E,
|
|
8085
|
-
this._inputSettings ? (l = ((p = this._inputSettings) === null || p === void 0 ? void 0 : p.video) ||
|
|
8084
|
+
var l, f, p, S, k, E, A = { processor: { type: "none", _isDefaultWhenNone: !0 } };
|
|
8085
|
+
this._inputSettings ? (l = ((p = this._inputSettings) === null || p === void 0 ? void 0 : p.video) || A, f = ((S = this._inputSettings) === null || S === void 0 ? void 0 : S.audio) || A) : (l = ((k = this._preloadCache) === null || k === void 0 || (k = k.inputSettings) === null || k === void 0 ? void 0 : k.video) || A, f = ((E = this._preloadCache) === null || E === void 0 || (E = E.inputSettings) === null || E === void 0 ? void 0 : E.audio) || A);
|
|
8086
8086
|
var L = { audio: f, video: l };
|
|
8087
8087
|
return this._prepInputSettingsForSharing(L, !0);
|
|
8088
8088
|
} }, { key: "_updatePreloadCacheInputSettings", value: function(l, f) {
|
|
8089
8089
|
var p = this._inputSettings || {}, S = {};
|
|
8090
8090
|
if (l.video) {
|
|
8091
|
-
var k, E,
|
|
8092
|
-
S.video = {}, l.video.settings ? (S.video.settings = {}, f || l.video.settings.customTrack || (
|
|
8091
|
+
var k, E, A;
|
|
8092
|
+
S.video = {}, l.video.settings ? (S.video.settings = {}, f || l.video.settings.customTrack || (A = p.video) === null || A === void 0 || !A.settings ? S.video.settings = l.video.settings : S.video.settings = F(F({}, p.video.settings), l.video.settings), Object.keys(S.video.settings).length || delete S.video.settings) : (k = p.video) !== null && k !== void 0 && k.settings && (S.video.settings = p.video.settings), l.video.processor ? S.video.processor = l.video.processor : (E = p.video) !== null && E !== void 0 && E.processor && (S.video.processor = p.video.processor);
|
|
8093
8093
|
} else p.video && (S.video = p.video);
|
|
8094
8094
|
if (l.audio) {
|
|
8095
8095
|
var L, I, K;
|
|
@@ -8283,10 +8283,10 @@ var jd = function() {
|
|
|
8283
8283
|
} }, { key: "setInputDevicesAsync", value: ($ = W(function* (l) {
|
|
8284
8284
|
var f = this, p = l.audioDeviceId, S = l.videoDeviceId, k = l.audioSource, E = l.videoSource;
|
|
8285
8285
|
if (ie(), k !== void 0 && (p = k), E !== void 0 && (S = E), typeof p == "boolean" && (this._setAllowLocalAudio(p), p = void 0), typeof S == "boolean" && (this._setAllowLocalVideo(S), S = void 0), !p && !S) return yield this.getInputDevices();
|
|
8286
|
-
var
|
|
8287
|
-
return p && (p instanceof MediaStreamTrack ? (this._sharedTracks.audioTrack = p, p = ht,
|
|
8286
|
+
var A = {};
|
|
8287
|
+
return p && (p instanceof MediaStreamTrack ? (this._sharedTracks.audioTrack = p, p = ht, A.audio = { settings: { customTrack: p } }) : (delete this._sharedTracks.audioTrack, A.audio = { settings: { deviceId: p } })), S && (S instanceof MediaStreamTrack ? (this._sharedTracks.videoTrack = S, S = ht, A.video = { settings: { customTrack: S } }) : (delete this._sharedTracks.videoTrack, A.video = { settings: { deviceId: S } })), this._callObjectMode && this.needsLoad() ? (this._updatePreloadCacheInputSettings(A, !1), this._devicesFromInputSettings(this._inputSettings)) : new Promise(function(L) {
|
|
8288
8288
|
f.sendMessageToCallMachine({ action: "set-input-devices", audioDeviceId: p, videoDeviceId: S }, function(I) {
|
|
8289
|
-
if (delete I.action, delete I.callbackStamp, I.returnPreloadCache) return f._updatePreloadCacheInputSettings(
|
|
8289
|
+
if (delete I.action, delete I.callbackStamp, I.returnPreloadCache) return f._updatePreloadCacheInputSettings(A, !1), void L(f._devicesFromInputSettings(f._inputSettings));
|
|
8290
8290
|
L(I);
|
|
8291
8291
|
});
|
|
8292
8292
|
});
|
|
@@ -8298,8 +8298,8 @@ var jd = function() {
|
|
|
8298
8298
|
return this._preloadCache.outputDeviceId = p, this._callObjectMode && this.needsLoad() ? this._devicesFromInputSettings(this._inputSettings) : new Promise(function(S, k) {
|
|
8299
8299
|
f.sendMessageToCallMachine({ action: "set-output-device", outputDeviceId: p }, function(E) {
|
|
8300
8300
|
if (delete E.action, delete E.callbackStamp, E.error) {
|
|
8301
|
-
var
|
|
8302
|
-
return
|
|
8301
|
+
var A = new Error(E.error.message);
|
|
8302
|
+
return A.type = E.error.type, void k(A);
|
|
8303
8303
|
}
|
|
8304
8304
|
E.returnPreloadCache ? S(f._devicesFromInputSettings(f._inputSettings)) : S(E);
|
|
8305
8305
|
});
|
|
@@ -8341,8 +8341,8 @@ var jd = function() {
|
|
|
8341
8341
|
var k = Date.now();
|
|
8342
8342
|
f._callObjectLoader.load(f.properties.dailyConfig, function(E) {
|
|
8343
8343
|
f._bundleLoadTime = E ? "no-op" : Date.now() - k, f._updateCallState(Wo), E && f.emitDailyJSEvent({ action: Go }), p();
|
|
8344
|
-
}, function(E,
|
|
8345
|
-
if (f.emitDailyJSEvent({ action: wu }), !
|
|
8344
|
+
}, function(E, A) {
|
|
8345
|
+
if (f.emitDailyJSEvent({ action: wu }), !A) {
|
|
8346
8346
|
f._updateCallState(mt), f.resetMeetingDependentVars();
|
|
8347
8347
|
var L = { action: es, errorMsg: E.msg, error: { type: "connection-error", msg: "Failed to load call object bundle.", details: { on: "load", sourceError: E, bundleUrl: Xn(f.properties.dailyConfig) } } };
|
|
8348
8348
|
f._maybeSendToSentry(L), f.emitDailyJSEvent(L), S(E.msg);
|
|
@@ -8381,17 +8381,17 @@ var jd = function() {
|
|
|
8381
8381
|
return f.showLocalVideo !== void 0 && (this._callObjectMode ? console.error("showLocalVideo is not available in callObject mode") : this._showLocalVideo = !!f.showLocalVideo), f.showParticipantsBar !== void 0 && (this._callObjectMode ? console.error("showParticipantsBar is not available in callObject mode") : this._showParticipantsBar = !!f.showParticipantsBar), this._callState === Lt || this._callState === ni ? (console.warn("already joined meeting, call leave() before joining again"), void this.updateIsPreparingToJoin(!1)) : (this._updateCallState(ni, !1), this.emitDailyJSEvent({ action: xu }), this._preloadCache.inputSettings = this._prepInputSettingsForSharing(this._inputSettings || {}, !1), this.sendMessageToCallMachine({ action: "join-meeting", properties: qt(this.properties, this.callClientId), preloadCache: qt(this._preloadCache, this.callClientId) }, function(k) {
|
|
8382
8382
|
k.error && l._joinedCallback && (l._joinedCallback(null, k.error), l._joinedCallback = null);
|
|
8383
8383
|
}), new Promise(function(k, E) {
|
|
8384
|
-
l._joinedCallback = function(
|
|
8384
|
+
l._joinedCallback = function(A, L) {
|
|
8385
8385
|
if (l._callState !== mt) {
|
|
8386
8386
|
if (L) return l._updateCallState(gt), void E(L);
|
|
8387
|
-
if (l._updateCallState(Lt),
|
|
8387
|
+
if (l._updateCallState(Lt), A) for (var I in A) {
|
|
8388
8388
|
if (l._callObjectMode) {
|
|
8389
8389
|
var K = l._callMachine().store;
|
|
8390
|
-
hs(
|
|
8390
|
+
hs(A[I], K), ps(A[I], K), fs(A[I], l._participants[I], K);
|
|
8391
8391
|
}
|
|
8392
|
-
l._participants[I] = F({},
|
|
8392
|
+
l._participants[I] = F({}, A[I]), l.toggleParticipantAudioBasedOnNativeAudioFocus();
|
|
8393
8393
|
}
|
|
8394
|
-
S && l.loadCss(l.properties), k(
|
|
8394
|
+
S && l.loadCss(l.properties), k(A);
|
|
8395
8395
|
} else E(L);
|
|
8396
8396
|
};
|
|
8397
8397
|
}));
|
|
@@ -8454,7 +8454,7 @@ var jd = function() {
|
|
|
8454
8454
|
for (var E in this._validateEncodingLayerHasValidProperties(k), k) if (Ir.includes(E)) {
|
|
8455
8455
|
if (typeof k[E] != "number") throw new Error("".concat(E, " must be a number"));
|
|
8456
8456
|
if (f) {
|
|
8457
|
-
var
|
|
8457
|
+
var A = f[E], L = A.min, I = A.max;
|
|
8458
8458
|
if (!Ps(k[E], L, I)) throw new Error("".concat(E, " value not in range. valid range: ").concat(L, " to ").concat(I));
|
|
8459
8459
|
}
|
|
8460
8460
|
} else if (!["active", "scalabilityMode"].includes(E)) throw new Error("Invalid key ".concat(E, ", valid keys are:") + Object.values(Ir));
|
|
@@ -8467,7 +8467,7 @@ var jd = function() {
|
|
|
8467
8467
|
(function(E) {
|
|
8468
8468
|
if (typeof E != "string") throw new Error('url parameter must be "string" type');
|
|
8469
8469
|
})(p), Ls(k), function(E) {
|
|
8470
|
-
for (var
|
|
8470
|
+
for (var A in E) if (!Ts.includes(A)) throw new Error("Invalid key ".concat(A, ", valid keys are: ").concat(Ts));
|
|
8471
8471
|
E.simulcastEncodings && this.validateSimulcastEncodings(E.simulcastEncodings, Ga, !0);
|
|
8472
8472
|
}(k);
|
|
8473
8473
|
} catch (E) {
|
|
@@ -8476,9 +8476,9 @@ var jd = function() {
|
|
|
8476
8476
|
settings?:
|
|
8477
8477
|
{state: "play"|"pause", simulcastEncodings?: [{}] } }`), E;
|
|
8478
8478
|
}
|
|
8479
|
-
return new Promise(function(E,
|
|
8479
|
+
return new Promise(function(E, A) {
|
|
8480
8480
|
f.sendMessageToCallMachine({ action: "daily-method-start-remote-media-player", url: p, settings: k }, function(L) {
|
|
8481
|
-
L.error ?
|
|
8481
|
+
L.error ? A({ error: L.error, errorMsg: L.errorMsg }) : E({ session_id: L.session_id, remoteMediaPlayerState: { state: L.state, settings: L.settings } });
|
|
8482
8482
|
});
|
|
8483
8483
|
});
|
|
8484
8484
|
}), function(l) {
|
|
@@ -8503,8 +8503,8 @@ var jd = function() {
|
|
|
8503
8503
|
{ settings?: {state: "play"|"pause"} }`), k;
|
|
8504
8504
|
}
|
|
8505
8505
|
return new Promise(function(k, E) {
|
|
8506
|
-
f.sendMessageToCallMachine({ action: "daily-method-update-remote-media-player", session_id: p, settings: S }, function(
|
|
8507
|
-
|
|
8506
|
+
f.sendMessageToCallMachine({ action: "daily-method-update-remote-media-player", session_id: p, settings: S }, function(A) {
|
|
8507
|
+
A.error ? E({ error: A.error, errorMsg: A.errorMsg }) : k({ session_id: A.session_id, remoteMediaPlayerState: { state: A.state, settings: A.settings } });
|
|
8508
8508
|
});
|
|
8509
8509
|
});
|
|
8510
8510
|
}), function(l) {
|
|
@@ -8520,14 +8520,14 @@ var jd = function() {
|
|
|
8520
8520
|
if (fe(this._callState, "stopTranscription()"), l && ae(l) !== "object") throw new Error("stopTranscription Error: options must be object type");
|
|
8521
8521
|
if (l && !l.instanceId) throw new Error('"instanceId" not provided');
|
|
8522
8522
|
this.sendMessageToCallMachine(F({ action: "daily-method-stop-transcription" }, l));
|
|
8523
|
-
} }, { key: "startDialOut", value: (
|
|
8523
|
+
} }, { key: "startDialOut", value: (v = W(function* (l) {
|
|
8524
8524
|
var f = this;
|
|
8525
8525
|
fe(this._callState, "startDialOut()");
|
|
8526
|
-
var p = function(
|
|
8527
|
-
if (
|
|
8528
|
-
if (!Array.isArray(
|
|
8529
|
-
if (
|
|
8530
|
-
|
|
8526
|
+
var p = function(A) {
|
|
8527
|
+
if (A) {
|
|
8528
|
+
if (!Array.isArray(A)) throw new Error("Error starting dial out: audio codec must be an array");
|
|
8529
|
+
if (A.length <= 0) throw new Error("Error starting dial out: audio codec array specified but empty");
|
|
8530
|
+
A.forEach(function(L) {
|
|
8531
8531
|
if (typeof L != "string") throw new Error("Error starting dial out: audio codec must be a string");
|
|
8532
8532
|
if (L !== "OPUS" && L !== "PCMU" && L !== "PCMA" && L !== "G722") throw new Error("Error starting dial out: audio codec must be one of OPUS, PCMU, PCMA, G722");
|
|
8533
8533
|
});
|
|
@@ -8539,11 +8539,11 @@ var jd = function() {
|
|
|
8539
8539
|
if (typeof l.sipUri != "string") throw new Error("Error starting dial out: sipUri must be a string");
|
|
8540
8540
|
if (!l.sipUri.startsWith("sip:")) throw new Error("Error starting dial out: Invalid SIP URI, must start with 'sip:'");
|
|
8541
8541
|
if (l.video && typeof l.video != "boolean") throw new Error("Error starting dial out: video must be a boolean value");
|
|
8542
|
-
(function(
|
|
8543
|
-
if (
|
|
8544
|
-
if (!Array.isArray(
|
|
8545
|
-
if (
|
|
8546
|
-
|
|
8542
|
+
(function(A) {
|
|
8543
|
+
if (A && (p(A.audio), A.video)) {
|
|
8544
|
+
if (!Array.isArray(A.video)) throw new Error("Error starting dial out: video codec must be an array");
|
|
8545
|
+
if (A.video.length <= 0) throw new Error("Error starting dial out: video codec array specified but empty");
|
|
8546
|
+
A.video.forEach(function(L) {
|
|
8547
8547
|
if (typeof L != "string") throw new Error("Error starting dial out: video codec must be a string");
|
|
8548
8548
|
if (L !== "H264" && L !== "VP8") throw new Error("Error starting dial out: video codec must be H264 or VP8");
|
|
8549
8549
|
});
|
|
@@ -8576,13 +8576,13 @@ var jd = function() {
|
|
|
8576
8576
|
if (l.phoneNumber) throw new Error("Error starting dial out: provider valid only for sipUri, not phoneNumber");
|
|
8577
8577
|
console.warn("(pre-beta) provider=daily is currently in pre-beta, things might break!");
|
|
8578
8578
|
}
|
|
8579
|
-
return new Promise(function(
|
|
8579
|
+
return new Promise(function(A, L) {
|
|
8580
8580
|
f.sendMessageToCallMachine(F({ action: "dialout-start" }, l), function(I) {
|
|
8581
|
-
I.error ? L(I.error) :
|
|
8581
|
+
I.error ? L(I.error) : A(I);
|
|
8582
8582
|
});
|
|
8583
8583
|
});
|
|
8584
8584
|
}), function(l) {
|
|
8585
|
-
return
|
|
8585
|
+
return v.apply(this, arguments);
|
|
8586
8586
|
}) }, { key: "stopDialOut", value: function(l) {
|
|
8587
8587
|
var f = this;
|
|
8588
8588
|
return fe(this._callState, "stopDialOut()"), new Promise(function(p, S) {
|
|
@@ -8600,7 +8600,7 @@ var jd = function() {
|
|
|
8600
8600
|
});
|
|
8601
8601
|
}), function(l) {
|
|
8602
8602
|
return m.apply(this, arguments);
|
|
8603
|
-
}) }, { key: "sipRefer", value: (
|
|
8603
|
+
}) }, { key: "sipRefer", value: (y = W(function* (l) {
|
|
8604
8604
|
var f = this;
|
|
8605
8605
|
if (fe(this._callState, "sipRefer()"), !l) throw new Error("sessionId and toEndPoint are mandatory parameter");
|
|
8606
8606
|
return l.useSipRefer = !0, Ds(l, "sipRefer"), new Promise(function(p, S) {
|
|
@@ -8609,23 +8609,23 @@ var jd = function() {
|
|
|
8609
8609
|
});
|
|
8610
8610
|
});
|
|
8611
8611
|
}), function(l) {
|
|
8612
|
-
return
|
|
8613
|
-
}) }, { key: "sendDTMF", value: (
|
|
8612
|
+
return y.apply(this, arguments);
|
|
8613
|
+
}) }, { key: "sendDTMF", value: (b = W(function* (l) {
|
|
8614
8614
|
var f = this;
|
|
8615
8615
|
return fe(this._callState, "sendDTMF()"), function(p) {
|
|
8616
8616
|
var S = p.sessionId, k = p.tones;
|
|
8617
8617
|
if (!S || !k) throw new Error("sessionId and tones are mandatory parameter");
|
|
8618
8618
|
if (typeof S != "string" || typeof k != "string") throw new Error("sessionId and tones should be of string type");
|
|
8619
8619
|
if (k.length > 20) throw new Error("tones string must be upto 20 characters");
|
|
8620
|
-
var E = /[^0-9A-D*#]/g,
|
|
8621
|
-
if (
|
|
8620
|
+
var E = /[^0-9A-D*#]/g, A = k.match(E);
|
|
8621
|
+
if (A && A[0]) throw new Error("".concat(A[0], " is not valid DTMF tone"));
|
|
8622
8622
|
}(l), new Promise(function(p, S) {
|
|
8623
8623
|
f.sendMessageToCallMachine(F({ action: "send-dtmf" }, l), function(k) {
|
|
8624
8624
|
k.error ? S(k.error) : p(k);
|
|
8625
8625
|
});
|
|
8626
8626
|
});
|
|
8627
8627
|
}), function(l) {
|
|
8628
|
-
return
|
|
8628
|
+
return b.apply(this, arguments);
|
|
8629
8629
|
}) }, { key: "getNetworkStats", value: function() {
|
|
8630
8630
|
var l = this;
|
|
8631
8631
|
return this._callState !== Lt ? Promise.resolve(F({ stats: { latest: {} } }, this._network)) : new Promise(function(f) {
|
|
@@ -8665,7 +8665,7 @@ var jd = function() {
|
|
|
8665
8665
|
}
|
|
8666
8666
|
return new Promise(function(k) {
|
|
8667
8667
|
l.sendMessageToCallMachine({ action: "test-call-quality", dailyJsVersion: l.properties.dailyJsVersion }, function(E) {
|
|
8668
|
-
var
|
|
8668
|
+
var A = E.results, L = A.result, I = $i(A, Bd);
|
|
8669
8669
|
if (L === "failed") {
|
|
8670
8670
|
var K, te = F({}, I);
|
|
8671
8671
|
(K = I.error) !== null && K !== void 0 && K.details ? (I.error.details = JSON.parse(I.error.details), te.error = F(F({}, te.error), {}, { details: F({}, te.error.details) }), te.error.details.duringTest = "testCallQuality") : (te.error = te.error ? F({}, te.error) : {}, te.error.details = { duringTest: "testCallQuality" }), l._maybeSendToSentry(te);
|
|
@@ -8694,8 +8694,8 @@ var jd = function() {
|
|
|
8694
8694
|
var p = l.videoTrack, S = l.duration;
|
|
8695
8695
|
if (!this._validateVideoTrackForNetworkTests(p)) throw new Error("Video track error");
|
|
8696
8696
|
return this._sharedTracks.videoTrackForConnectionQualityTest = p, new Promise(function(k, E) {
|
|
8697
|
-
f.sendMessageToCallMachine({ action: "test-p2p-call-quality", duration: S }, function(
|
|
8698
|
-
|
|
8697
|
+
f.sendMessageToCallMachine({ action: "test-p2p-call-quality", duration: S }, function(A) {
|
|
8698
|
+
A.error ? E(A.error) : k(A.results);
|
|
8699
8699
|
});
|
|
8700
8700
|
});
|
|
8701
8701
|
}), function(l) {
|
|
@@ -8946,10 +8946,10 @@ var jd = function() {
|
|
|
8946
8946
|
E.audio = ((S = l.inputSettings) === null || S === void 0 ? void 0 : S.audio) || {}, E.audio.settings = ((k = l.inputSettings) === null || k === void 0 || (k = k.audio) === null || k === void 0 ? void 0 : k.settings) || {}, E.audio.settings = F(F({}, E.audio.settings), l.dailyConfig.userMediaAudioConstraints), l.inputSettings = E, delete l.dailyConfig.userMediaAudioConstraints;
|
|
8947
8947
|
}
|
|
8948
8948
|
if (l != null && (p = l.dailyConfig) !== null && p !== void 0 && p.userMediaVideoConstraints) {
|
|
8949
|
-
var
|
|
8949
|
+
var A, L;
|
|
8950
8950
|
oe() || console.warn("userMediaVideoConstraints is deprecated. You can override constraints with inputSettings.video.settings, found in DailyCallOptions.");
|
|
8951
8951
|
var I = l.inputSettings || {};
|
|
8952
|
-
I.video = ((
|
|
8952
|
+
I.video = ((A = l.inputSettings) === null || A === void 0 ? void 0 : A.video) || {}, I.video.settings = ((L = l.inputSettings) === null || L === void 0 || (L = L.video) === null || L === void 0 ? void 0 : L.settings) || {}, I.video.settings = F(F({}, I.video.settings), l.dailyConfig.userMediaVideoConstraints), l.inputSettings = I, delete l.dailyConfig.userMediaVideoConstraints;
|
|
8953
8953
|
}
|
|
8954
8954
|
for (var K in l) if (At[K]) {
|
|
8955
8955
|
if (At[K].validate && !At[K].validate(l[K], this)) throw new Error("property '".concat(K, "': ").concat(At[K].help));
|
|
@@ -9008,8 +9008,8 @@ var jd = function() {
|
|
|
9008
9008
|
break;
|
|
9009
9009
|
case Mu:
|
|
9010
9010
|
if (l.participant && l.participant.session_id) {
|
|
9011
|
-
var
|
|
9012
|
-
|
|
9011
|
+
var A = this._participants[l.participant.session_id];
|
|
9012
|
+
A && this.maybeParticipantTracksStopped(A, null), delete this._participants[l.participant.session_id], this.emitDailyJSEvent(l);
|
|
9013
9013
|
}
|
|
9014
9014
|
break;
|
|
9015
9015
|
case Au:
|
|
@@ -9159,15 +9159,15 @@ var jd = function() {
|
|
|
9159
9159
|
} }, { key: "_trackChanged", value: function(l, f) {
|
|
9160
9160
|
return (l == null ? void 0 : l.id) !== (f == null ? void 0 : f.id);
|
|
9161
9161
|
} }, { key: "maybeEventTrackStopped", value: function(l, f, p) {
|
|
9162
|
-
var S, k, E = (S = f == null ? void 0 : f.tracks[l]) !== null && S !== void 0 ? S : null,
|
|
9162
|
+
var S, k, E = (S = f == null ? void 0 : f.tracks[l]) !== null && S !== void 0 ? S : null, A = (k = p == null ? void 0 : p.tracks[l]) !== null && k !== void 0 ? k : null, L = E == null ? void 0 : E.track;
|
|
9163
9163
|
if (L) {
|
|
9164
|
-
var I = this._trackStatePlayable(E), K = this._trackStatePlayable(
|
|
9164
|
+
var I = this._trackStatePlayable(E), K = this._trackStatePlayable(A), te = this._trackChanged(L, A == null ? void 0 : A.track);
|
|
9165
9165
|
I && (K && !te || this.emitDailyJSEvent({ action: Bu, track: L, participant: p ?? f, type: l }));
|
|
9166
9166
|
}
|
|
9167
9167
|
} }, { key: "maybeEventTrackStarted", value: function(l, f, p) {
|
|
9168
|
-
var S, k, E = (S = f == null ? void 0 : f.tracks[l]) !== null && S !== void 0 ? S : null,
|
|
9168
|
+
var S, k, E = (S = f == null ? void 0 : f.tracks[l]) !== null && S !== void 0 ? S : null, A = (k = p == null ? void 0 : p.tracks[l]) !== null && k !== void 0 ? k : null, L = A == null ? void 0 : A.track;
|
|
9169
9169
|
if (L) {
|
|
9170
|
-
var I = this._trackStatePlayable(E), K = this._trackStatePlayable(
|
|
9170
|
+
var I = this._trackStatePlayable(E), K = this._trackStatePlayable(A), te = this._trackChanged(E == null ? void 0 : E.track, L);
|
|
9171
9171
|
K && (I && !te || this.emitDailyJSEvent({ action: Nu, track: L, participant: p, type: l }));
|
|
9172
9172
|
}
|
|
9173
9173
|
} }, { key: "maybeParticipantTracksStopped", value: function(l, f) {
|
|
@@ -9196,8 +9196,8 @@ var jd = function() {
|
|
|
9196
9196
|
this._callState = l, this._isPreparingToJoin = f;
|
|
9197
9197
|
var k = this._callState === Lt;
|
|
9198
9198
|
this.updateShowAndroidOngoingMeetingNotification(k);
|
|
9199
|
-
var E = Yn(p, S),
|
|
9200
|
-
E !==
|
|
9199
|
+
var E = Yn(p, S), A = Yn(this._callState, this._isPreparingToJoin);
|
|
9200
|
+
E !== A && (this.updateKeepDeviceAwake(A), this.updateDeviceAudioMode(A), this.updateNoOpRecordingEnsuringBackgroundContinuity(A));
|
|
9201
9201
|
}
|
|
9202
9202
|
} }, { key: "resetMeetingDependentVars", value: function() {
|
|
9203
9203
|
this._participants = {}, this._participantCounts = Es, this._waitingParticipants = {}, this._activeSpeaker = {}, this._activeSpeakerMode = !1, this._didPreAuth = !1, this._accessState = { access: Tr }, this._finalSummaryOfPrevSession = this._meetingSessionSummary, this._meetingSessionSummary = {}, this._meetingSessionState = Br(Cs, this._callObjectMode), this._isScreenSharing = !1, this._receiveSettings = {}, this._inputSettings = void 0, this._sendSettings = {}, this._localAudioLevel = 0, this._isLocalAudioLevelObserverRunning = !1, this._remoteParticipantsAudioLevel = {}, this._isRemoteParticipantsAudioLevelObserverRunning = !1, this._maxAppMessageSize = Mr, this._callMachineInitialized = !1, this._bundleLoadTime = void 0, this._preloadCache;
|
|
@@ -9257,14 +9257,14 @@ var jd = function() {
|
|
|
9257
9257
|
} }, { key: "_maybeSendToSentry", value: function(l) {
|
|
9258
9258
|
var f, p, S, k;
|
|
9259
9259
|
if (!((f = l.error) !== null && f !== void 0 && f.type && (![gu, fu, Jo].includes(l.error.type) || l.error.type === Jo && l.error.msg.includes("deleted")))) {
|
|
9260
|
-
var E = (p = this.properties) !== null && p !== void 0 && p.url ? new URL(this.properties.url) : void 0,
|
|
9261
|
-
E && E.host.includes(".staging.daily") && (
|
|
9260
|
+
var E = (p = this.properties) !== null && p !== void 0 && p.url ? new URL(this.properties.url) : void 0, A = "production";
|
|
9261
|
+
E && E.host.includes(".staging.daily") && (A = "staging");
|
|
9262
9262
|
var L, I, K, te, Me, tt = function(cn) {
|
|
9263
9263
|
const ln = [Dl(), Al(), ru(), tu(), cu(), uu(), Rl(), lu()];
|
|
9264
9264
|
return cn.autoSessionTracking !== !1 && ln.push(au()), ln;
|
|
9265
9265
|
}({}).filter(function(cn) {
|
|
9266
9266
|
return !["BrowserApiErrors", "Breadcrumbs", "GlobalHandlers"].includes(cn.name);
|
|
9267
|
-
}), nt = new zl({ dsn: "https://f10f1c81e5d44a4098416c0867a8b740@o77906.ingest.sentry.io/168844", transport: Jl, stackParser: eu, integrations: tt, environment:
|
|
9267
|
+
}), nt = new zl({ dsn: "https://f10f1c81e5d44a4098416c0867a8b740@o77906.ingest.sentry.io/168844", transport: Jl, stackParser: eu, integrations: tt, environment: A }), be = new Ct();
|
|
9268
9268
|
if (be.setClient(nt), nt.init(), this.session_id && be.setExtra("sessionId", this.session_id), this.properties) {
|
|
9269
9269
|
var ee = F({}, this.properties);
|
|
9270
9270
|
ee.userName = ee.userName ? "[Filtered]" : void 0, ee.userData = ee.userData ? "[Filtered]" : void 0, ee.token = ee.token ? "[Filtered]" : void 0, be.setExtra("properties", ee);
|
|
@@ -9310,13 +9310,13 @@ var jd = function() {
|
|
|
9310
9310
|
var k = S.iframeStyle;
|
|
9311
9311
|
k || (k = p === document.body ? { position: "fixed", border: "1px solid black", backgroundColor: "white", width: "375px", height: "450px", right: "1em", bottom: "1em" } : { border: 0, width: "100%", height: "100%" });
|
|
9312
9312
|
var E = document.createElement("iframe");
|
|
9313
|
-
window.navigator && window.navigator.userAgent.match(/Chrome\/61\./) ? E.allow = "microphone, camera" : E.allow = "microphone; camera; autoplay; display-capture; screen-wake-lock", E.style.visibility = "hidden", p.appendChild(E), E.style.visibility = null, Object.keys(k).forEach(function(
|
|
9314
|
-
return E.style[
|
|
9313
|
+
window.navigator && window.navigator.userAgent.match(/Chrome\/61\./) ? E.allow = "microphone, camera" : E.allow = "microphone; camera; autoplay; display-capture; screen-wake-lock", E.style.visibility = "hidden", p.appendChild(E), E.style.visibility = null, Object.keys(k).forEach(function(A) {
|
|
9314
|
+
return E.style[A] = k[A];
|
|
9315
9315
|
}), S.layout || (S.customLayout ? S.layout = "custom-v1" : S.layout = "browser");
|
|
9316
9316
|
try {
|
|
9317
9317
|
return new r(E, S);
|
|
9318
|
-
} catch (
|
|
9319
|
-
throw p.removeChild(E),
|
|
9318
|
+
} catch (A) {
|
|
9319
|
+
throw p.removeChild(E), A;
|
|
9320
9320
|
}
|
|
9321
9321
|
} }, { key: "createTransparentFrame", value: function() {
|
|
9322
9322
|
var l = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
@@ -9335,7 +9335,7 @@ var jd = function() {
|
|
|
9335
9335
|
var l = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : void 0;
|
|
9336
9336
|
return l ? Mt[l] : Object.values(Mt)[0];
|
|
9337
9337
|
} }]);
|
|
9338
|
-
var e, t, n, i, o, s, a, c, u, d, h, g,
|
|
9338
|
+
var e, t, n, i, o, s, a, c, u, d, h, g, b, y, m, v, w, x, C, D, P, R, B, re, se, me, $, j, H, X, N, U, Q, le, Z, Te, ve, $e;
|
|
9339
9339
|
}();
|
|
9340
9340
|
function As(r) {
|
|
9341
9341
|
if (r.extension) {
|
|
@@ -9462,8 +9462,8 @@ function Qa(r) {
|
|
|
9462
9462
|
case "audio":
|
|
9463
9463
|
if (ae(o) !== "object") return !1;
|
|
9464
9464
|
for (var h = 0, g = Object.entries(o); h < g.length; h++) {
|
|
9465
|
-
var
|
|
9466
|
-
switch (
|
|
9465
|
+
var b = Ee(g[h], 2), y = b[0], m = b[1];
|
|
9466
|
+
switch (y) {
|
|
9467
9467
|
case "processor":
|
|
9468
9468
|
if (!Ud(m)) return !1;
|
|
9469
9469
|
break;
|
|
@@ -9517,11 +9517,11 @@ function Hd(r) {
|
|
|
9517
9517
|
if (d.protocol === "data:") try {
|
|
9518
9518
|
var g = h.substring(h.indexOf(":") + 1, h.indexOf(";")).split("/")[1];
|
|
9519
9519
|
return Or.includes(g);
|
|
9520
|
-
} catch (
|
|
9521
|
-
return console.error("failed to deduce blob content type",
|
|
9520
|
+
} catch (y) {
|
|
9521
|
+
return console.error("failed to deduce blob content type", y), !1;
|
|
9522
9522
|
}
|
|
9523
|
-
var
|
|
9524
|
-
return Or.includes(
|
|
9523
|
+
var b = h.split(".").at(-1).toLowerCase().trim();
|
|
9524
|
+
return Or.includes(b);
|
|
9525
9525
|
}(s.source) || (console.error("invalid image type; supported types: [".concat(Or.join(", "), "]")), !1);
|
|
9526
9526
|
return a = s.source, c = Number(a), isNaN(c) || !Number.isInteger(c) || c <= 0 || c > 10 ? (console.error("invalid image selection; must be an int, > 0, <= ".concat(10)), !1) : (s.type = "daily-preselect", !0);
|
|
9527
9527
|
var a, c;
|
|
@@ -9805,18 +9805,18 @@ class sn {
|
|
|
9805
9805
|
const a = t / 2, c = 1 / n.length * a;
|
|
9806
9806
|
let u, d, h;
|
|
9807
9807
|
if (i === "music" || i === "voice") {
|
|
9808
|
-
const
|
|
9809
|
-
for (let
|
|
9810
|
-
const w =
|
|
9811
|
-
for (let C =
|
|
9808
|
+
const y = i === "voice" ? Rs : xt, m = Array(y.length).fill(o);
|
|
9809
|
+
for (let v = 0; v < n.length; v++) {
|
|
9810
|
+
const w = v * c, x = n[v];
|
|
9811
|
+
for (let C = y.length - 1; C >= 0; C--) if (w > y[C]) {
|
|
9812
9812
|
m[C] = Math.max(m[C], x);
|
|
9813
9813
|
break;
|
|
9814
9814
|
}
|
|
9815
9815
|
}
|
|
9816
9816
|
u = m, d = i === "voice" ? Rs : xt, h = i === "voice" ? Vd : Li;
|
|
9817
9817
|
} else
|
|
9818
|
-
u = Array.from(n), d = u.map((
|
|
9819
|
-
const g = u.map((
|
|
9818
|
+
u = Array.from(n), d = u.map((y, m) => c * m), h = d.map((y) => `${y.toFixed(2)} Hz`);
|
|
9819
|
+
const g = u.map((y) => Math.max(0, Math.min((y - o) / (s - o), 1)));
|
|
9820
9820
|
return {
|
|
9821
9821
|
values: new Float32Array(g),
|
|
9822
9822
|
frequencies: d,
|
|
@@ -9841,8 +9841,8 @@ class sn {
|
|
|
9841
9841
|
const c = 1 / 60, u = n / i, d = (h) => {
|
|
9842
9842
|
const g = c * h;
|
|
9843
9843
|
g < u && o.suspend(g).then(() => {
|
|
9844
|
-
const
|
|
9845
|
-
a.getFloatFrequencyData(
|
|
9844
|
+
const b = new Float32Array(a.frequencyBinCount);
|
|
9845
|
+
a.getFloatFrequencyData(b), this.fftResults.push(b), d(h + 1);
|
|
9846
9846
|
}), h === 1 ? o.startRendering() : o.resume();
|
|
9847
9847
|
};
|
|
9848
9848
|
s.start(0), d(1), this.audio = e, this.context = o, this.analyser = a, this.sampleRate = i, this.audioBuffer = t;
|
|
@@ -10726,20 +10726,20 @@ class th {
|
|
|
10726
10726
|
const { event: d, id: h, data: g } = u.data;
|
|
10727
10727
|
if (d === "receipt") this.eventReceipts[h] = g;
|
|
10728
10728
|
else if (d === "chunk") {
|
|
10729
|
-
const
|
|
10729
|
+
const b = {
|
|
10730
10730
|
raw: Ns(g.raw, i, this.sampleRate),
|
|
10731
10731
|
mono: Ns(g.mono, i, this.sampleRate)
|
|
10732
10732
|
};
|
|
10733
10733
|
if (this._chunkProcessorSize) {
|
|
10734
|
-
const
|
|
10734
|
+
const y = this._chunkProcessorBuffer;
|
|
10735
10735
|
this._chunkProcessorBuffer = {
|
|
10736
|
-
raw: Ge.mergeBuffers(
|
|
10737
|
-
mono: Ge.mergeBuffers(
|
|
10736
|
+
raw: Ge.mergeBuffers(y.raw, b.raw),
|
|
10737
|
+
mono: Ge.mergeBuffers(y.mono, b.mono)
|
|
10738
10738
|
}, this._chunkProcessorBuffer.mono.byteLength >= this._chunkProcessorSize && (this._chunkProcessor(this._chunkProcessorBuffer), this._chunkProcessorBuffer = {
|
|
10739
10739
|
raw: new ArrayBuffer(0),
|
|
10740
10740
|
mono: new ArrayBuffer(0)
|
|
10741
10741
|
});
|
|
10742
|
-
} else this._chunkProcessor(
|
|
10742
|
+
} else this._chunkProcessor(b);
|
|
10743
10743
|
}
|
|
10744
10744
|
};
|
|
10745
10745
|
const a = o.connect(s), c = n.createAnalyser();
|
|
@@ -11003,17 +11003,17 @@ class ft extends ha {
|
|
|
11003
11003
|
return this._daily.localScreenAudio() || this._daily.localScreenVideo();
|
|
11004
11004
|
}
|
|
11005
11005
|
tracks() {
|
|
11006
|
-
var i, o, s, a, c, u, d, h, g,
|
|
11006
|
+
var i, o, s, a, c, u, d, h, g, b, y, m, v, w, x, C;
|
|
11007
11007
|
const e = this._daily.participants() ?? {}, t = e == null ? void 0 : e[this._botId], n = {
|
|
11008
11008
|
local: {
|
|
11009
11009
|
audio: (s = (o = (i = e == null ? void 0 : e.local) == null ? void 0 : i.tracks) == null ? void 0 : o.audio) == null ? void 0 : s.persistentTrack,
|
|
11010
11010
|
screenAudio: (u = (c = (a = e == null ? void 0 : e.local) == null ? void 0 : a.tracks) == null ? void 0 : c.screenAudio) == null ? void 0 : u.persistentTrack,
|
|
11011
11011
|
screenVideo: (g = (h = (d = e == null ? void 0 : e.local) == null ? void 0 : d.tracks) == null ? void 0 : h.screenVideo) == null ? void 0 : g.persistentTrack,
|
|
11012
|
-
video: (m = (
|
|
11012
|
+
video: (m = (y = (b = e == null ? void 0 : e.local) == null ? void 0 : b.tracks) == null ? void 0 : y.video) == null ? void 0 : m.persistentTrack
|
|
11013
11013
|
}
|
|
11014
11014
|
};
|
|
11015
11015
|
return t && (n.bot = {
|
|
11016
|
-
audio: (w = (
|
|
11016
|
+
audio: (w = (v = t == null ? void 0 : t.tracks) == null ? void 0 : v.audio) == null ? void 0 : w.persistentTrack,
|
|
11017
11017
|
video: (C = (x = t == null ? void 0 : t.tracks) == null ? void 0 : x.video) == null ? void 0 : C.persistentTrack
|
|
11018
11018
|
}), n;
|
|
11019
11019
|
}
|
|
@@ -11031,11 +11031,11 @@ class ft extends ha {
|
|
|
11031
11031
|
this._dailyFactoryOptions = e, await this._daily.preAuth(e);
|
|
11032
11032
|
}
|
|
11033
11033
|
async initDevices() {
|
|
11034
|
-
var s, a, c, u, d, h, g,
|
|
11034
|
+
var s, a, c, u, d, h, g, b, y, m, v, w;
|
|
11035
11035
|
if (!this._daily) throw new Le("Transport instance not initialized");
|
|
11036
11036
|
this.state = "initializing";
|
|
11037
11037
|
const e = await this._daily.startCamera(this._dailyFactoryOptions), { devices: t } = await this._daily.enumerateDevices(), n = t.filter((x) => x.kind === "videoinput"), i = t.filter((x) => x.kind === "audioinput"), o = t.filter((x) => x.kind === "audiooutput");
|
|
11038
|
-
this._selectedCam = e.camera, this._selectedMic = e.mic, this._selectedSpeaker = e.speaker, (a = (s = this._callbacks).onAvailableCamsUpdated) == null || a.call(s, n), (u = (c = this._callbacks).onAvailableMicsUpdated) == null || u.call(c, i), (h = (d = this._callbacks).onAvailableSpeakersUpdated) == null || h.call(d, o), (
|
|
11038
|
+
this._selectedCam = e.camera, this._selectedMic = e.mic, this._selectedSpeaker = e.speaker, (a = (s = this._callbacks).onAvailableCamsUpdated) == null || a.call(s, n), (u = (c = this._callbacks).onAvailableMicsUpdated) == null || u.call(c, i), (h = (d = this._callbacks).onAvailableSpeakersUpdated) == null || h.call(d, o), (b = (g = this._callbacks).onCamUpdated) == null || b.call(g, e.camera), (m = (y = this._callbacks).onMicUpdated) == null || m.call(y, e.mic), (w = (v = this._callbacks).onSpeakerUpdated) == null || w.call(v, e.speaker), this._daily.isLocalAudioLevelObserverRunning() || await this._daily.startLocalAudioLevelObserver(100), this._daily.isRemoteParticipantsAudioLevelObserverRunning() || await this._daily.startRemoteParticipantsAudioLevelObserver(100), this.state = "initialized";
|
|
11039
11039
|
}
|
|
11040
11040
|
_validateConnectionParams(e) {
|
|
11041
11041
|
if (e == null) return;
|
|
@@ -11320,7 +11320,7 @@ const Ot = (r) => ({
|
|
|
11320
11320
|
nudgeAutoHideDelay: u,
|
|
11321
11321
|
nudgeAutoShow: d = !0
|
|
11322
11322
|
}) => {
|
|
11323
|
-
const h = i || o, [g,
|
|
11323
|
+
const h = i || o, [g, b] = Ue(!1), [y, m] = Ue(!1), [v, w] = Ue(!1), x = wn(null), C = We(() => {
|
|
11324
11324
|
try {
|
|
11325
11325
|
const N = localStorage.getItem(Dt);
|
|
11326
11326
|
if (!N) return !0;
|
|
@@ -11364,9 +11364,9 @@ const Ot = (r) => ({
|
|
|
11364
11364
|
}, console.log("[Floe] Nudge sound played"), sessionStorage.setItem(Bs, "true");
|
|
11365
11365
|
} catch {
|
|
11366
11366
|
}
|
|
11367
|
-
}, []), re = a !== void 0 ? a :
|
|
11367
|
+
}, []), re = a !== void 0 ? a : y && !v && !r;
|
|
11368
11368
|
Ye(() => {
|
|
11369
|
-
if (a === void 0 && d && h && !r && !
|
|
11369
|
+
if (a === void 0 && d && h && !r && !v) {
|
|
11370
11370
|
if (!C()) return;
|
|
11371
11371
|
const N = setTimeout(() => {
|
|
11372
11372
|
m(!0), D(), B();
|
|
@@ -11378,7 +11378,7 @@ const Ot = (r) => ({
|
|
|
11378
11378
|
clearTimeout(N), Q && clearTimeout(Q);
|
|
11379
11379
|
};
|
|
11380
11380
|
}
|
|
11381
|
-
}, [h, r,
|
|
11381
|
+
}, [h, r, v, C, D, P, B, a, d, u]);
|
|
11382
11382
|
const se = We(() => {
|
|
11383
11383
|
m(!1), w(!0), P(), c == null || c();
|
|
11384
11384
|
}, [P, c]), me = We(() => {
|
|
@@ -11440,8 +11440,8 @@ const Ot = (r) => ({
|
|
|
11440
11440
|
"aria-label": h ? i ? "Welcome back - Start Floe" : "Start Floe" : "Expand Floe",
|
|
11441
11441
|
onClick: $,
|
|
11442
11442
|
onKeyDown: j,
|
|
11443
|
-
onMouseEnter: () =>
|
|
11444
|
-
onMouseLeave: () =>
|
|
11443
|
+
onMouseEnter: () => b(!0),
|
|
11444
|
+
onMouseLeave: () => b(!1),
|
|
11445
11445
|
style: {
|
|
11446
11446
|
position: "relative",
|
|
11447
11447
|
width: `${X}px`,
|
|
@@ -11509,41 +11509,41 @@ const Ot = (r) => ({
|
|
|
11509
11509
|
const a = Math.ceil(n / 2), [c, u] = Ue(Array(a).fill(0.15)), d = wn(), h = wn(Array(a).fill(0.15));
|
|
11510
11510
|
Ye(() => {
|
|
11511
11511
|
if (s && s.length > 0 && r) {
|
|
11512
|
-
const
|
|
11512
|
+
const y = Array(a).fill(0).map((m, v) => {
|
|
11513
11513
|
let w = 0;
|
|
11514
|
-
if (
|
|
11514
|
+
if (v === 0)
|
|
11515
11515
|
w = s.reduce((C, D) => C + D, 0) / s.length, w = Math.pow(w, 0.7) * 1.3;
|
|
11516
11516
|
else {
|
|
11517
|
-
const x = Math.floor(s.length / (a - 1)), C = (
|
|
11517
|
+
const x = Math.floor(s.length / (a - 1)), C = (v - 1) * x, D = Math.min(C + x, s.length);
|
|
11518
11518
|
let P = 0, R = 0;
|
|
11519
11519
|
for (let B = C; B < D; B++)
|
|
11520
11520
|
P += s[B], R++;
|
|
11521
|
-
w = R > 0 ? P / R : 0, w = w * (1 -
|
|
11521
|
+
w = R > 0 ? P / R : 0, w = w * (1 - v * 0.08);
|
|
11522
11522
|
}
|
|
11523
11523
|
return Math.max(0.15, Math.min(1, 0.15 + w * 0.85));
|
|
11524
11524
|
});
|
|
11525
|
-
h.current =
|
|
11525
|
+
h.current = y;
|
|
11526
11526
|
} else r || (h.current = Array(a).fill(0.15));
|
|
11527
11527
|
}, [s, r, a]), Ye(() => {
|
|
11528
|
-
const
|
|
11529
|
-
u((m) => m.map((
|
|
11528
|
+
const y = () => {
|
|
11529
|
+
u((m) => m.map((v, w) => {
|
|
11530
11530
|
const x = h.current[w] || 0.15, C = r ? 0.35 : 0.15;
|
|
11531
|
-
return
|
|
11532
|
-
})), d.current = requestAnimationFrame(
|
|
11531
|
+
return v + (x - v) * C;
|
|
11532
|
+
})), d.current = requestAnimationFrame(y);
|
|
11533
11533
|
};
|
|
11534
|
-
return d.current = requestAnimationFrame(
|
|
11534
|
+
return d.current = requestAnimationFrame(y), () => {
|
|
11535
11535
|
d.current && cancelAnimationFrame(d.current);
|
|
11536
11536
|
};
|
|
11537
11537
|
}, [r, a]);
|
|
11538
11538
|
const g = Us.useMemo(() => {
|
|
11539
|
-
const
|
|
11539
|
+
const y = [];
|
|
11540
11540
|
for (let m = a - 1; m > 0; m--)
|
|
11541
|
-
|
|
11542
|
-
|
|
11541
|
+
y.push(c[m]);
|
|
11542
|
+
y.push(c[0]);
|
|
11543
11543
|
for (let m = 1; m < a; m++)
|
|
11544
|
-
|
|
11545
|
-
return
|
|
11546
|
-
}, [c, a]),
|
|
11544
|
+
y.push(c[m]);
|
|
11545
|
+
return y;
|
|
11546
|
+
}, [c, a]), b = g.length * i + (g.length - 1) * o;
|
|
11547
11547
|
return /* @__PURE__ */ T(
|
|
11548
11548
|
"div",
|
|
11549
11549
|
{
|
|
@@ -11552,11 +11552,11 @@ const Ot = (r) => ({
|
|
|
11552
11552
|
alignItems: "center",
|
|
11553
11553
|
justifyContent: "center",
|
|
11554
11554
|
height: `${t}px`,
|
|
11555
|
-
width: `${
|
|
11555
|
+
width: `${b}px`,
|
|
11556
11556
|
gap: `${o}px`
|
|
11557
11557
|
},
|
|
11558
|
-
children: g.map((
|
|
11559
|
-
const
|
|
11558
|
+
children: g.map((y, m) => {
|
|
11559
|
+
const v = m === Math.floor(g.length / 2), w = Math.max(4, t * y * (v ? 1.1 : 1));
|
|
11560
11560
|
return /* @__PURE__ */ T(
|
|
11561
11561
|
"div",
|
|
11562
11562
|
{
|
|
@@ -11568,7 +11568,7 @@ const Ot = (r) => ({
|
|
|
11568
11568
|
transition: "none",
|
|
11569
11569
|
// Using requestAnimationFrame for smoother animation
|
|
11570
11570
|
opacity: r ? 1 : 0.4,
|
|
11571
|
-
boxShadow: r &&
|
|
11571
|
+
boxShadow: r && y > 0.3 ? `0 0 ${6 * y}px ${e}50` : "none"
|
|
11572
11572
|
}
|
|
11573
11573
|
},
|
|
11574
11574
|
m
|
|
@@ -11590,10 +11590,10 @@ const Ot = (r) => ({
|
|
|
11590
11590
|
onToggleConnection: d,
|
|
11591
11591
|
onToggleMute: h,
|
|
11592
11592
|
onToggleScreenShare: g,
|
|
11593
|
-
onMinimize:
|
|
11594
|
-
onResume:
|
|
11593
|
+
onMinimize: b,
|
|
11594
|
+
onResume: y,
|
|
11595
11595
|
onStop: m,
|
|
11596
|
-
connectionProgress:
|
|
11596
|
+
connectionProgress: v,
|
|
11597
11597
|
textModeEnabled: w = !1,
|
|
11598
11598
|
onToggleTextMode: x,
|
|
11599
11599
|
onSendText: C,
|
|
@@ -11615,7 +11615,7 @@ const Ot = (r) => ({
|
|
|
11615
11615
|
N || !se.trim() || !C || (C(se.trim()), me(""), (Z = R.current) == null || Z.focus());
|
|
11616
11616
|
}, Q = () => {
|
|
11617
11617
|
if (e === "connecting")
|
|
11618
|
-
return (
|
|
11618
|
+
return (v == null ? void 0 : v.message) || "Connecting...";
|
|
11619
11619
|
if (w && t)
|
|
11620
11620
|
switch (e) {
|
|
11621
11621
|
case "listening":
|
|
@@ -11825,10 +11825,10 @@ const Ot = (r) => ({
|
|
|
11825
11825
|
] })
|
|
11826
11826
|
}
|
|
11827
11827
|
),
|
|
11828
|
-
e === "paused" &&
|
|
11828
|
+
e === "paused" && y && /* @__PURE__ */ T(
|
|
11829
11829
|
pn,
|
|
11830
11830
|
{
|
|
11831
|
-
onClick:
|
|
11831
|
+
onClick: y,
|
|
11832
11832
|
tooltip: "Resume",
|
|
11833
11833
|
ariaLabel: "Resume session",
|
|
11834
11834
|
active: !0,
|
|
@@ -11881,7 +11881,7 @@ const Ot = (r) => ({
|
|
|
11881
11881
|
/* @__PURE__ */ T(
|
|
11882
11882
|
pn,
|
|
11883
11883
|
{
|
|
11884
|
-
onClick:
|
|
11884
|
+
onClick: b,
|
|
11885
11885
|
tooltip: "Minimize",
|
|
11886
11886
|
ariaLabel: "Minimize panel",
|
|
11887
11887
|
children: /* @__PURE__ */ T("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ T("line", { x1: "5", y1: "12", x2: "19", y2: "12" }) })
|
|
@@ -11965,7 +11965,7 @@ const Ot = (r) => ({
|
|
|
11965
11965
|
}
|
|
11966
11966
|
);
|
|
11967
11967
|
})(),
|
|
11968
|
-
e === "connecting" &&
|
|
11968
|
+
e === "connecting" && v && /* @__PURE__ */ G(
|
|
11969
11969
|
"div",
|
|
11970
11970
|
{
|
|
11971
11971
|
style: {
|
|
@@ -11991,12 +11991,12 @@ const Ot = (r) => ({
|
|
|
11991
11991
|
}
|
|
11992
11992
|
),
|
|
11993
11993
|
/* @__PURE__ */ G("div", { style: { display: "flex", flexDirection: "column", gap: "3px", flex: 1 }, children: [
|
|
11994
|
-
/* @__PURE__ */ T("span", { style: { fontSize: "12px", fontWeight: "600", color: "rgba(255, 255, 255, 0.9)" }, children:
|
|
11994
|
+
/* @__PURE__ */ T("span", { style: { fontSize: "12px", fontWeight: "600", color: "rgba(255, 255, 255, 0.9)" }, children: v.message }),
|
|
11995
11995
|
/* @__PURE__ */ T("div", { style: { width: "100%", height: "2px", background: "rgba(255, 255, 255, 0.1)", borderRadius: "2px", overflow: "hidden" }, children: /* @__PURE__ */ T(
|
|
11996
11996
|
"div",
|
|
11997
11997
|
{
|
|
11998
11998
|
style: {
|
|
11999
|
-
width: `${
|
|
11999
|
+
width: `${v.progress}%`,
|
|
12000
12000
|
height: "100%",
|
|
12001
12001
|
background: "linear-gradient(90deg, #fbbf24 0%, #f59e0b 100%)",
|
|
12002
12002
|
borderRadius: "2px",
|
|
@@ -12030,10 +12030,10 @@ const Ot = (r) => ({
|
|
|
12030
12030
|
/* @__PURE__ */ T("span", { style: { color: "#f59e0b", fontSize: "13px", fontWeight: "600" }, children: "Session Paused" })
|
|
12031
12031
|
] }),
|
|
12032
12032
|
/* @__PURE__ */ T("div", { style: { color: "rgba(255, 255, 255, 0.5)", fontSize: "12px", textAlign: "center", lineHeight: "1.4" }, children: "You were inactive. Click Resume to continue." }),
|
|
12033
|
-
|
|
12033
|
+
y && /* @__PURE__ */ G(
|
|
12034
12034
|
"button",
|
|
12035
12035
|
{
|
|
12036
|
-
onClick:
|
|
12036
|
+
onClick: y,
|
|
12037
12037
|
style: {
|
|
12038
12038
|
padding: "8px 20px",
|
|
12039
12039
|
background: "linear-gradient(135deg, #f59e0b 0%, #d97706 100%)",
|
|
@@ -12234,7 +12234,7 @@ const Ot = (r) => ({
|
|
|
12234
12234
|
barCount: 7,
|
|
12235
12235
|
audioLevels: u
|
|
12236
12236
|
}
|
|
12237
|
-
) : e === "connecting" &&
|
|
12237
|
+
) : e === "connecting" && v ? /* @__PURE__ */ G("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
|
|
12238
12238
|
/* @__PURE__ */ T(
|
|
12239
12239
|
"div",
|
|
12240
12240
|
{
|
|
@@ -12249,7 +12249,7 @@ const Ot = (r) => ({
|
|
|
12249
12249
|
}
|
|
12250
12250
|
}
|
|
12251
12251
|
),
|
|
12252
|
-
/* @__PURE__ */ T("span", { style: { fontSize: "12px", color: "#fbbf24", fontWeight: "500" }, children:
|
|
12252
|
+
/* @__PURE__ */ T("span", { style: { fontSize: "12px", color: "#fbbf24", fontWeight: "500" }, children: v.message })
|
|
12253
12253
|
] }) : /* @__PURE__ */ G("div", { style: { display: "flex", alignItems: "center", gap: "6px" }, children: [
|
|
12254
12254
|
!n && t && e !== "speaking" && /* @__PURE__ */ G(
|
|
12255
12255
|
"svg",
|
|
@@ -12573,10 +12573,10 @@ const Ot = (r) => ({
|
|
|
12573
12573
|
onToggleMute: d,
|
|
12574
12574
|
onToggleScreenShare: h,
|
|
12575
12575
|
transcriptHistory: g = [],
|
|
12576
|
-
onResume:
|
|
12577
|
-
pausedSessionId:
|
|
12576
|
+
onResume: b,
|
|
12577
|
+
pausedSessionId: y,
|
|
12578
12578
|
onStop: m,
|
|
12579
|
-
connectionProgress:
|
|
12579
|
+
connectionProgress: v,
|
|
12580
12580
|
isReturningUser: w = !1,
|
|
12581
12581
|
hasSkippedOnboarding: x = !1,
|
|
12582
12582
|
onMinimize: C,
|
|
@@ -12650,9 +12650,9 @@ const Ot = (r) => ({
|
|
|
12650
12650
|
onToggleMute: d,
|
|
12651
12651
|
onToggleScreenShare: h,
|
|
12652
12652
|
onMinimize: Z,
|
|
12653
|
-
onResume:
|
|
12653
|
+
onResume: b,
|
|
12654
12654
|
onStop: m,
|
|
12655
|
-
connectionProgress:
|
|
12655
|
+
connectionProgress: v,
|
|
12656
12656
|
textModeEnabled: P,
|
|
12657
12657
|
onToggleTextMode: R,
|
|
12658
12658
|
onSendText: B,
|
|
@@ -12679,9 +12679,9 @@ const Ot = (r) => ({
|
|
|
12679
12679
|
}, Ie = class Ie {
|
|
12680
12680
|
constructor() {
|
|
12681
12681
|
// Ref counters for generating unique IDs
|
|
12682
|
-
|
|
12682
|
+
M(this, "refCounters", {});
|
|
12683
12683
|
// Cache for last snapshot (for change detection)
|
|
12684
|
-
|
|
12684
|
+
M(this, "lastSnapshotHash", "");
|
|
12685
12685
|
}
|
|
12686
12686
|
// -------------------------------------------------------------------------
|
|
12687
12687
|
// Main Capture Method
|
|
@@ -12830,24 +12830,24 @@ const Ot = (r) => ({
|
|
|
12830
12830
|
for (const h of d) {
|
|
12831
12831
|
if (t.has(h)) continue;
|
|
12832
12832
|
let g = !1;
|
|
12833
|
-
for (const
|
|
12834
|
-
if (h.contains(
|
|
12835
|
-
const
|
|
12836
|
-
if (
|
|
12833
|
+
for (const b of n)
|
|
12834
|
+
if (h.contains(b) && h !== b) {
|
|
12835
|
+
const y = c(h), m = c(b);
|
|
12836
|
+
if (y === "card" || y === "listitem" || y === "option") {
|
|
12837
12837
|
if (!u(h)) {
|
|
12838
12838
|
g = !0;
|
|
12839
12839
|
break;
|
|
12840
12840
|
}
|
|
12841
|
-
} else if (
|
|
12841
|
+
} else if (y === m) {
|
|
12842
12842
|
g = !0;
|
|
12843
12843
|
break;
|
|
12844
12844
|
}
|
|
12845
12845
|
}
|
|
12846
12846
|
if (!g) {
|
|
12847
|
-
for (const
|
|
12848
|
-
if (
|
|
12849
|
-
const
|
|
12850
|
-
if (!
|
|
12847
|
+
for (const b of n)
|
|
12848
|
+
if (b.contains(h) && b !== h) {
|
|
12849
|
+
const y = u(h), m = u(b);
|
|
12850
|
+
if (!y || y === m) {
|
|
12851
12851
|
g = !0;
|
|
12852
12852
|
break;
|
|
12853
12853
|
}
|
|
@@ -12903,7 +12903,7 @@ const Ot = (r) => ({
|
|
|
12903
12903
|
// Accessible Name Computation (W3C accname algorithm - simplified)
|
|
12904
12904
|
// -------------------------------------------------------------------------
|
|
12905
12905
|
computeAccessibleName(e) {
|
|
12906
|
-
var h, g,
|
|
12906
|
+
var h, g, b, y, m, v;
|
|
12907
12907
|
const t = e.getAttribute("aria-labelledby");
|
|
12908
12908
|
if (t) {
|
|
12909
12909
|
const w = t.split(/\s+/).map((x) => {
|
|
@@ -12930,9 +12930,9 @@ const Ot = (r) => ({
|
|
|
12930
12930
|
if (s) return s;
|
|
12931
12931
|
const a = e.querySelector("svg");
|
|
12932
12932
|
if (a) {
|
|
12933
|
-
const w = (
|
|
12933
|
+
const w = (y = (b = a.querySelector("title")) == null ? void 0 : b.textContent) == null ? void 0 : y.trim();
|
|
12934
12934
|
if (w) return w.slice(0, 100);
|
|
12935
|
-
const x = (
|
|
12935
|
+
const x = (v = (m = a.querySelector("desc")) == null ? void 0 : m.textContent) == null ? void 0 : v.trim();
|
|
12936
12936
|
if (x) return x.slice(0, 100);
|
|
12937
12937
|
}
|
|
12938
12938
|
const c = e.getAttribute("data-tooltip") || e.getAttribute("data-tip") || e.getAttribute("data-original-title");
|
|
@@ -13151,39 +13151,39 @@ const Ot = (r) => ({
|
|
|
13151
13151
|
// Context Detection
|
|
13152
13152
|
// -------------------------------------------------------------------------
|
|
13153
13153
|
findContext(e) {
|
|
13154
|
-
var c, u, d, h, g,
|
|
13154
|
+
var c, u, d, h, g, b, y, m;
|
|
13155
13155
|
const t = e.getAttribute("aria-describedby");
|
|
13156
13156
|
if (t) {
|
|
13157
|
-
const
|
|
13158
|
-
if (
|
|
13157
|
+
const v = document.getElementById(t);
|
|
13158
|
+
if (v) return ((c = v.textContent) == null ? void 0 : c.trim().slice(0, 50)) || null;
|
|
13159
13159
|
}
|
|
13160
13160
|
const n = e.closest("fieldset");
|
|
13161
13161
|
if (n) {
|
|
13162
|
-
const
|
|
13163
|
-
if (
|
|
13162
|
+
const v = n.querySelector("legend");
|
|
13163
|
+
if (v) return ((u = v.textContent) == null ? void 0 : u.trim().slice(0, 50)) || null;
|
|
13164
13164
|
}
|
|
13165
13165
|
const i = e.closest('[class*="form-group"], [class*="FormGroup"], [class*="field"]');
|
|
13166
13166
|
if (i) {
|
|
13167
|
-
const
|
|
13168
|
-
if (
|
|
13169
|
-
return ((d =
|
|
13167
|
+
const v = i.querySelector(":scope > label, :scope > .label");
|
|
13168
|
+
if (v && !v.contains(e))
|
|
13169
|
+
return ((d = v.textContent) == null ? void 0 : d.trim().slice(0, 50)) || null;
|
|
13170
13170
|
}
|
|
13171
13171
|
const o = e.closest('section, [role="region"], form, [class*="section"], [class*="Section"]');
|
|
13172
13172
|
if (o) {
|
|
13173
|
-
const
|
|
13174
|
-
if (
|
|
13173
|
+
const v = o.querySelector(':scope > h1, :scope > h2, :scope > h3, :scope > h4, :scope > h5, :scope > h6, :scope > [role="heading"]');
|
|
13174
|
+
if (v) return ((h = v.textContent) == null ? void 0 : h.trim().slice(0, 50)) || null;
|
|
13175
13175
|
const w = o.querySelector(':scope > [class*="title"], :scope > [class*="Title"], :scope > [class*="header"] > *');
|
|
13176
13176
|
if (w) return ((g = w.textContent) == null ? void 0 : g.trim().slice(0, 50)) || null;
|
|
13177
13177
|
}
|
|
13178
13178
|
const s = e.previousElementSibling;
|
|
13179
13179
|
if (s && s.matches('p, label, h1, h2, h3, h4, h5, h6, [class*="label"], [class*="Label"]')) {
|
|
13180
|
-
const
|
|
13181
|
-
if (
|
|
13180
|
+
const v = (b = s.textContent) == null ? void 0 : b.trim();
|
|
13181
|
+
if (v && v.length < 50) return v;
|
|
13182
13182
|
}
|
|
13183
|
-
const a = (
|
|
13183
|
+
const a = (y = e.parentElement) == null ? void 0 : y.previousElementSibling;
|
|
13184
13184
|
if (a && a.matches('p, label, [class*="label"], [class*="Label"]')) {
|
|
13185
|
-
const
|
|
13186
|
-
if (
|
|
13185
|
+
const v = (m = a.textContent) == null ? void 0 : m.trim();
|
|
13186
|
+
if (v && v.length < 50) return v;
|
|
13187
13187
|
}
|
|
13188
13188
|
return null;
|
|
13189
13189
|
}
|
|
@@ -13347,7 +13347,7 @@ const Ot = (r) => ({
|
|
|
13347
13347
|
// Static Configuration
|
|
13348
13348
|
// -------------------------------------------------------------------------
|
|
13349
13349
|
/** Implicit ARIA roles by HTML tag (W3C spec) */
|
|
13350
|
-
|
|
13350
|
+
M(Ie, "IMPLICIT_ROLES", {
|
|
13351
13351
|
button: "button",
|
|
13352
13352
|
a: "link",
|
|
13353
13353
|
input: "textbox",
|
|
@@ -13373,7 +13373,7 @@ A(Ie, "IMPLICIT_ROLES", {
|
|
|
13373
13373
|
progress: "progressbar",
|
|
13374
13374
|
meter: "meter"
|
|
13375
13375
|
}), /** Input type to role mapping */
|
|
13376
|
-
|
|
13376
|
+
M(Ie, "INPUT_TYPE_ROLES", {
|
|
13377
13377
|
button: "button",
|
|
13378
13378
|
submit: "button",
|
|
13379
13379
|
reset: "button",
|
|
@@ -13389,7 +13389,7 @@ A(Ie, "INPUT_TYPE_ROLES", {
|
|
|
13389
13389
|
text: "textbox",
|
|
13390
13390
|
number: "spinbutton"
|
|
13391
13391
|
}), /** Role prefixes for ref generation */
|
|
13392
|
-
|
|
13392
|
+
M(Ie, "ROLE_PREFIXES", {
|
|
13393
13393
|
button: "B",
|
|
13394
13394
|
link: "L",
|
|
13395
13395
|
textbox: "T",
|
|
@@ -13410,7 +13410,7 @@ A(Ie, "ROLE_PREFIXES", {
|
|
|
13410
13410
|
switch: "SW",
|
|
13411
13411
|
navigation: "NAV"
|
|
13412
13412
|
}), /** Interactive element selector */
|
|
13413
|
-
|
|
13413
|
+
M(Ie, "INTERACTIVE_SELECTOR", `
|
|
13414
13414
|
button,
|
|
13415
13415
|
a[href],
|
|
13416
13416
|
input:not([type="hidden"]),
|
|
@@ -13434,7 +13434,7 @@ A(Ie, "INTERACTIVE_SELECTOR", `
|
|
|
13434
13434
|
[contenteditable="true"],
|
|
13435
13435
|
summary
|
|
13436
13436
|
`.replace(/\s+/g, " ").trim()), /** Selectors to skip (our own UI, scripts, etc.) */
|
|
13437
|
-
|
|
13437
|
+
M(Ie, "SKIP_SELECTORS", [
|
|
13438
13438
|
"#onboarding-overlay",
|
|
13439
13439
|
"#onboarding-sdk-react-ui",
|
|
13440
13440
|
"#hse-highlight-element",
|
|
@@ -13509,7 +13509,7 @@ function uh(r) {
|
|
|
13509
13509
|
return !1;
|
|
13510
13510
|
}
|
|
13511
13511
|
function dc(r, e = {}) {
|
|
13512
|
-
var g,
|
|
13512
|
+
var g, b, y, m, v;
|
|
13513
13513
|
const {
|
|
13514
13514
|
focus: t = !0,
|
|
13515
13515
|
includePointerEvents: n = !0,
|
|
@@ -13532,15 +13532,15 @@ function dc(r, e = {}) {
|
|
|
13532
13532
|
), console.warn(
|
|
13533
13533
|
"[humanLikeClick] Expected target:",
|
|
13534
13534
|
r.tagName,
|
|
13535
|
-
(
|
|
13535
|
+
(b = r.className) == null ? void 0 : b.toString().slice(0, 50)
|
|
13536
13536
|
), uh(u)) {
|
|
13537
|
-
const w = `${u.tagName} (${(
|
|
13537
|
+
const w = `${u.tagName} (${(y = u.className) == null ? void 0 : y.toString().slice(0, 80)})`;
|
|
13538
13538
|
throw console.error(
|
|
13539
13539
|
"[humanLikeClick] ❌ BLOCKED: Modal/dialog overlay is covering the target element.",
|
|
13540
13540
|
`Overlay: ${w}`,
|
|
13541
13541
|
`Target: ${r.tagName} "${(m = r.textContent) == null ? void 0 : m.trim().slice(0, 50)}"`
|
|
13542
13542
|
), new Error(
|
|
13543
|
-
`Click blocked by modal overlay: ${w}. Target "${(
|
|
13543
|
+
`Click blocked by modal overlay: ${w}. Target "${(v = r.textContent) == null ? void 0 : v.trim().slice(0, 50)}" is behind the modal. Interact with the modal instead.`
|
|
13544
13544
|
);
|
|
13545
13545
|
}
|
|
13546
13546
|
d = r;
|
|
@@ -13578,17 +13578,17 @@ function dc(r, e = {}) {
|
|
|
13578
13578
|
}
|
|
13579
13579
|
class $s {
|
|
13580
13580
|
constructor() {
|
|
13581
|
-
|
|
13582
|
-
|
|
13583
|
-
|
|
13584
|
-
|
|
13585
|
-
|
|
13586
|
-
|
|
13587
|
-
|
|
13581
|
+
M(this, "audioContext", null);
|
|
13582
|
+
M(this, "analyzerNode", null);
|
|
13583
|
+
M(this, "sourceNode", null);
|
|
13584
|
+
M(this, "dataArray", new Uint8Array(0));
|
|
13585
|
+
M(this, "isRunning", !1);
|
|
13586
|
+
M(this, "onLevelsCallback", null);
|
|
13587
|
+
M(this, "animationId", null);
|
|
13588
13588
|
/**
|
|
13589
13589
|
* Analysis loop - runs via requestAnimationFrame
|
|
13590
13590
|
*/
|
|
13591
|
-
|
|
13591
|
+
M(this, "analyze", () => {
|
|
13592
13592
|
if (!this.isRunning || !this.analyzerNode || this.dataArray.length === 0) return;
|
|
13593
13593
|
this.analyzerNode.getByteFrequencyData(this.dataArray);
|
|
13594
13594
|
const e = [];
|
|
@@ -13624,7 +13624,7 @@ class $s {
|
|
|
13624
13624
|
}
|
|
13625
13625
|
class dh {
|
|
13626
13626
|
constructor() {
|
|
13627
|
-
|
|
13627
|
+
M(this, "events", {});
|
|
13628
13628
|
}
|
|
13629
13629
|
on(e, t) {
|
|
13630
13630
|
return this.events[e] || (this.events[e] = []), this.events[e].push(t), this;
|
|
@@ -13643,13 +13643,13 @@ class dh {
|
|
|
13643
13643
|
}
|
|
13644
13644
|
class hh {
|
|
13645
13645
|
constructor() {
|
|
13646
|
-
|
|
13647
|
-
|
|
13648
|
-
|
|
13649
|
-
|
|
13650
|
-
|
|
13646
|
+
M(this, "lastSnapshot", null);
|
|
13647
|
+
M(this, "lastSnapshotHash", "");
|
|
13648
|
+
M(this, "snapshotInterval", null);
|
|
13649
|
+
M(this, "sendCallback", null);
|
|
13650
|
+
M(this, "correlationCounter", 0);
|
|
13651
13651
|
// For tracking snapshots across client/server
|
|
13652
|
-
|
|
13652
|
+
M(this, "INTERACTIVE_TAGS", /* @__PURE__ */ new Set([
|
|
13653
13653
|
"button",
|
|
13654
13654
|
"a",
|
|
13655
13655
|
"input",
|
|
@@ -13661,7 +13661,7 @@ class hh {
|
|
|
13661
13661
|
"option",
|
|
13662
13662
|
"menuitem"
|
|
13663
13663
|
]));
|
|
13664
|
-
|
|
13664
|
+
M(this, "INTERACTIVE_ROLES", /* @__PURE__ */ new Set([
|
|
13665
13665
|
"button",
|
|
13666
13666
|
"link",
|
|
13667
13667
|
"menuitem",
|
|
@@ -13678,8 +13678,8 @@ class hh {
|
|
|
13678
13678
|
/**
|
|
13679
13679
|
* Setup mutation observer for significant DOM changes
|
|
13680
13680
|
*/
|
|
13681
|
-
|
|
13682
|
-
|
|
13681
|
+
M(this, "mutationObserver", null);
|
|
13682
|
+
M(this, "mutationDebounceTimer", null);
|
|
13683
13683
|
}
|
|
13684
13684
|
/**
|
|
13685
13685
|
* Start periodic DOM snapshots
|
|
@@ -13749,8 +13749,8 @@ class hh {
|
|
|
13749
13749
|
*/
|
|
13750
13750
|
computeSnapshotHash(e) {
|
|
13751
13751
|
const t = e.elements.length, n = e.interactiveCount || 0, i = 30, o = e.elements.slice(0, i), s = Math.max(0, Math.floor(t / 2) - Math.floor(i / 2)), a = e.elements.slice(s, s + i), c = e.elements.slice(-i), u = (h) => h.map((g) => {
|
|
13752
|
-
var
|
|
13753
|
-
return `${g.tag}:${(
|
|
13752
|
+
var b;
|
|
13753
|
+
return `${g.tag}:${(b = g.text) == null ? void 0 : b.slice(0, 20)}:${Math.round(g.rect.x)}:${Math.round(g.rect.y)}`;
|
|
13754
13754
|
}).join("|");
|
|
13755
13755
|
return `count:${t}:${n}|` + u(o) + "||" + u(a) + "||" + u(c);
|
|
13756
13756
|
}
|
|
@@ -13872,15 +13872,15 @@ class hh {
|
|
|
13872
13872
|
var m;
|
|
13873
13873
|
const u = c;
|
|
13874
13874
|
if (this.shouldSkipElement(u)) return;
|
|
13875
|
-
const d = u.getBoundingClientRect(), h = Math.abs(d.x - e.x) <= 10, g = Math.abs(d.y - e.y) <= 10,
|
|
13876
|
-
if (h && g &&
|
|
13877
|
-
let
|
|
13878
|
-
if (t && u.tagName.toLowerCase() === t.toLowerCase() && (
|
|
13875
|
+
const d = u.getBoundingClientRect(), h = Math.abs(d.x - e.x) <= 10, g = Math.abs(d.y - e.y) <= 10, b = Math.abs(d.width - e.width) <= 10 * 2, y = Math.abs(d.height - e.height) <= 10 * 2;
|
|
13876
|
+
if (h && g && b && y) {
|
|
13877
|
+
let v = 100, w = !1;
|
|
13878
|
+
if (t && u.tagName.toLowerCase() === t.toLowerCase() && (v += 30), n) {
|
|
13879
13879
|
const x = ((m = u.innerText) == null ? void 0 : m.trim().toLowerCase()) || "", C = n.toLowerCase();
|
|
13880
|
-
x.length === 0 ? w = !1 : x === C ? (
|
|
13880
|
+
x.length === 0 ? w = !1 : x === C ? (v += 50, w = !0) : (x.includes(C) || C.includes(x)) && (v += 25, w = !0);
|
|
13881
13881
|
} else
|
|
13882
13882
|
w = !0;
|
|
13883
|
-
o.push({ element: u, score:
|
|
13883
|
+
o.push({ element: u, score: v, textMatch: w });
|
|
13884
13884
|
}
|
|
13885
13885
|
}), o.sort((c, u) => u.score - c.score), o.length > 0) {
|
|
13886
13886
|
const c = o[0], u = ((a = c.element.innerText) == null ? void 0 : a.trim().slice(0, 50)) || "";
|
|
@@ -13992,21 +13992,21 @@ function xn(r, e) {
|
|
|
13992
13992
|
if (!e(u) || u.getBoundingClientRect().height < 20) continue;
|
|
13993
13993
|
const h = c.querySelectorAll(gh);
|
|
13994
13994
|
for (const g of h) {
|
|
13995
|
-
const
|
|
13996
|
-
if (
|
|
13995
|
+
const b = g, y = b.className || "";
|
|
13996
|
+
if (y.toLowerCase().includes("singlevalue") || y.toLowerCase().includes("placeholder"))
|
|
13997
13997
|
continue;
|
|
13998
|
-
const m =
|
|
13998
|
+
const m = b.getBoundingClientRect();
|
|
13999
13999
|
if (m.height === 0 || m.width === 0) continue;
|
|
14000
|
-
const
|
|
14001
|
-
if (
|
|
14002
|
-
console.log(`[DropdownHelpers] Found EXACT match for option: "${r}"`), n =
|
|
14000
|
+
const v = ((o = b.textContent) == null ? void 0 : o.trim().toLowerCase()) || "";
|
|
14001
|
+
if (v === t) {
|
|
14002
|
+
console.log(`[DropdownHelpers] Found EXACT match for option: "${r}"`), n = b;
|
|
14003
14003
|
break;
|
|
14004
14004
|
}
|
|
14005
|
-
if (!i &&
|
|
14006
|
-
const w = t.length /
|
|
14005
|
+
if (!i && v.includes(t)) {
|
|
14006
|
+
const w = t.length / v.length;
|
|
14007
14007
|
w > 0.7 && (console.log(
|
|
14008
|
-
`[DropdownHelpers] Found partial match (${(w * 100).toFixed(0)}%): "${
|
|
14009
|
-
), i =
|
|
14008
|
+
`[DropdownHelpers] Found partial match (${(w * 100).toFixed(0)}%): "${v.slice(0, 50)}"`
|
|
14009
|
+
), i = b);
|
|
14010
14010
|
}
|
|
14011
14011
|
}
|
|
14012
14012
|
if (n) break;
|
|
@@ -14135,10 +14135,10 @@ const St = class St {
|
|
|
14135
14135
|
console.log(`[HybridTargetResolver] 🔄 Running ${n.length} strategies in parallel...`);
|
|
14136
14136
|
const i = /* @__PURE__ */ new Map();
|
|
14137
14137
|
for (const g of n) {
|
|
14138
|
-
const
|
|
14139
|
-
for (const
|
|
14140
|
-
Re(
|
|
14141
|
-
element:
|
|
14138
|
+
const b = this.executeStrategyMulti(g, e);
|
|
14139
|
+
for (const y of b)
|
|
14140
|
+
Re(y) || y.isConnected && (i.has(y) ? i.get(y).strategies.push(g) : i.set(y, {
|
|
14141
|
+
element: y,
|
|
14142
14142
|
strategies: [g],
|
|
14143
14143
|
validationScore: 0,
|
|
14144
14144
|
interactable: !1,
|
|
@@ -14155,12 +14155,12 @@ const St = class St {
|
|
|
14155
14155
|
duration: performance.now() - t
|
|
14156
14156
|
};
|
|
14157
14157
|
const o = [];
|
|
14158
|
-
for (const [g,
|
|
14158
|
+
for (const [g, b] of i) {
|
|
14159
14159
|
if (!g.isConnected) {
|
|
14160
14160
|
console.warn("[HybridTargetResolver] ⚠️ Candidate element was removed from DOM, skipping");
|
|
14161
14161
|
continue;
|
|
14162
14162
|
}
|
|
14163
|
-
|
|
14163
|
+
b.validationScore = this.computeValidationScore(g, e), b.interactable = this.checkInteractability(g).ok, b.confidence = this.computeConfidence(b, n.length, e), o.push(b), console.log(`[HybridTargetResolver] <${g.tagName.toLowerCase()}> "${(h = g.textContent) == null ? void 0 : h.slice(0, 25)}..."`), console.log(`[HybridTargetResolver] Strategies: ${b.strategies.join(", ")} (${b.strategies.length}/${n.length})`), console.log(`[HybridTargetResolver] Confidence: ${b.confidence.toFixed(1)}%`);
|
|
14164
14164
|
}
|
|
14165
14165
|
if (o.length === 0)
|
|
14166
14166
|
return {
|
|
@@ -14171,7 +14171,7 @@ const St = class St {
|
|
|
14171
14171
|
ambiguous: !1,
|
|
14172
14172
|
duration: performance.now() - t
|
|
14173
14173
|
};
|
|
14174
|
-
o.sort((g,
|
|
14174
|
+
o.sort((g, b) => b.confidence - g.confidence);
|
|
14175
14175
|
const s = o[0], a = o.length > 1 ? o[1] : void 0, c = performance.now() - t, u = a !== void 0 && s.confidence - a.confidence < 10;
|
|
14176
14176
|
if (u && console.warn("[HybridTargetResolver] ⚠️ AMBIGUOUS: Top candidates have similar confidence"), s.confidence < 30)
|
|
14177
14177
|
return console.warn(`[HybridTargetResolver] ❌ Best candidate confidence too low: ${s.confidence.toFixed(1)}%`), {
|
|
@@ -14183,7 +14183,7 @@ const St = class St {
|
|
|
14183
14183
|
duration: c
|
|
14184
14184
|
};
|
|
14185
14185
|
if (!s.interactable) {
|
|
14186
|
-
const g = o.find((
|
|
14186
|
+
const g = o.find((b) => b.interactable);
|
|
14187
14187
|
if (g && g.confidence > 30)
|
|
14188
14188
|
return console.log(`[HybridTargetResolver] ✅ Using interactable candidate (${g.confidence.toFixed(1)}%)`), {
|
|
14189
14189
|
element: this.getClickableContainer(g.element),
|
|
@@ -14310,7 +14310,7 @@ const St = class St {
|
|
|
14310
14310
|
* Find all elements matching text (not just first)
|
|
14311
14311
|
*/
|
|
14312
14312
|
static findAllByText(e, t) {
|
|
14313
|
-
var
|
|
14313
|
+
var b, y;
|
|
14314
14314
|
const n = [], i = /* @__PURE__ */ new Set();
|
|
14315
14315
|
if (!e) return n;
|
|
14316
14316
|
const o = e.trim();
|
|
@@ -14324,8 +14324,8 @@ const St = class St {
|
|
|
14324
14324
|
XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,
|
|
14325
14325
|
null
|
|
14326
14326
|
);
|
|
14327
|
-
for (let
|
|
14328
|
-
const w = m.snapshotItem(
|
|
14327
|
+
for (let v = 0; v < m.snapshotLength; v++) {
|
|
14328
|
+
const w = m.snapshotItem(v);
|
|
14329
14329
|
w && !this.isDropdownDisplayValue(w) && !i.has(w) && (n.push(w), i.add(w));
|
|
14330
14330
|
}
|
|
14331
14331
|
} catch {
|
|
@@ -14339,8 +14339,8 @@ const St = class St {
|
|
|
14339
14339
|
XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,
|
|
14340
14340
|
null
|
|
14341
14341
|
);
|
|
14342
|
-
for (let
|
|
14343
|
-
const w = m.snapshotItem(
|
|
14342
|
+
for (let v = 0; v < m.snapshotLength; v++) {
|
|
14343
|
+
const w = m.snapshotItem(v);
|
|
14344
14344
|
w && !this.isDropdownDisplayValue(w) && !i.has(w) && (n.push(w), i.add(w));
|
|
14345
14345
|
}
|
|
14346
14346
|
} catch {
|
|
@@ -14348,18 +14348,18 @@ const St = class St {
|
|
|
14348
14348
|
const d = [];
|
|
14349
14349
|
for (const m of n)
|
|
14350
14350
|
if (!this.isInteractiveElement(m)) {
|
|
14351
|
-
const
|
|
14352
|
-
|
|
14351
|
+
const v = this.findNearbyInput(m);
|
|
14352
|
+
v && !i.has(v) && (console.log(`[HybridTargetResolver] → Found nearby input for label "${(b = m.textContent) == null ? void 0 : b.trim().substring(0, 30)}": <${v.tagName.toLowerCase()}>`), d.push(v), i.add(v));
|
|
14353
14353
|
}
|
|
14354
14354
|
n.push(...d);
|
|
14355
14355
|
const h = o.toLowerCase(), g = document.querySelectorAll("input, textarea");
|
|
14356
14356
|
for (const m of g) {
|
|
14357
|
-
const
|
|
14358
|
-
if (Re(
|
|
14359
|
-
const w = ((
|
|
14357
|
+
const v = m;
|
|
14358
|
+
if (Re(v) || i.has(v)) continue;
|
|
14359
|
+
const w = ((y = v.getAttribute("placeholder")) == null ? void 0 : y.trim().toLowerCase()) || "";
|
|
14360
14360
|
if (w === h || w && w.includes(h) && h.length / w.length > 0.6) {
|
|
14361
|
-
const x =
|
|
14362
|
-
x.width > 0 && x.height > 0 && (n.push(
|
|
14361
|
+
const x = v.getBoundingClientRect();
|
|
14362
|
+
x.width > 0 && x.height > 0 && (n.push(v), i.add(v));
|
|
14363
14363
|
}
|
|
14364
14364
|
}
|
|
14365
14365
|
return n;
|
|
@@ -14443,29 +14443,29 @@ const St = class St {
|
|
|
14443
14443
|
else if (g)
|
|
14444
14444
|
o = !0;
|
|
14445
14445
|
else {
|
|
14446
|
-
const
|
|
14447
|
-
|
|
14446
|
+
const b = e.tagName.toLowerCase(), y = typeof e.className == "string" ? e.className : "";
|
|
14447
|
+
b === "div" || b === "span" || e.classList.contains("container") || y.includes("control") || y.includes("wrapper") ? n += 10 : s = !0;
|
|
14448
14448
|
}
|
|
14449
14449
|
}
|
|
14450
14450
|
if (t.role === "combobox" && e.querySelector('[role="combobox"]') && (n += 10, i += 10), t.tag) {
|
|
14451
14451
|
i += 15;
|
|
14452
|
-
const g = e.tagName.toLowerCase(),
|
|
14453
|
-
g ===
|
|
14452
|
+
const g = e.tagName.toLowerCase(), b = t.tag.toLowerCase();
|
|
14453
|
+
g === b ? n += 15 : t.role === "combobox" && (g === "input" || g === "div") && (n += 10);
|
|
14454
14454
|
}
|
|
14455
14455
|
if (t.text && !t.optionText) {
|
|
14456
14456
|
i += 20;
|
|
14457
|
-
const g = (e.textContent || "").toLowerCase().trim(),
|
|
14457
|
+
const g = (e.textContent || "").toLowerCase().trim(), b = t.text.toLowerCase().trim();
|
|
14458
14458
|
if (t.role === "combobox" && e.tagName.toLowerCase() === "input") {
|
|
14459
|
-
const
|
|
14460
|
-
(
|
|
14461
|
-
} else if (g ===
|
|
14459
|
+
const y = (u = e.closest('.css-6lmz24, [class*="value-container"], [class*="placeholder"]')) == null ? void 0 : u.parentElement, m = y == null ? void 0 : y.querySelector('[class*="placeholder"], [id*="placeholder"]'), v = ((d = m == null ? void 0 : m.textContent) == null ? void 0 : d.toLowerCase().trim()) || "";
|
|
14460
|
+
(v === b || v.includes(b)) && (n += 20);
|
|
14461
|
+
} else if (g === b)
|
|
14462
14462
|
n += 20;
|
|
14463
|
-
else if (g.includes(
|
|
14464
|
-
const
|
|
14465
|
-
|
|
14466
|
-
} else if (
|
|
14467
|
-
const
|
|
14468
|
-
n += Math.round(
|
|
14463
|
+
else if (g.includes(b)) {
|
|
14464
|
+
const y = b.length / g.length;
|
|
14465
|
+
y > 0.8 ? n += 15 : y > 0.5 ? n += 8 : (new RegExp(`\\b${St.escapeRegex(b)}\\b`, "i").test(g) ? n += 2 : n += 0, console.log(`[HybridTargetResolver] Text length mismatch: "${b}" (${b.length}) in "${g.slice(0, 30)}..." (${g.length}), ratio=${y.toFixed(2)}, points=${n}`));
|
|
14466
|
+
} else if (b.includes(g)) {
|
|
14467
|
+
const y = g.length / b.length;
|
|
14468
|
+
b.startsWith(g) && g.length >= 15 ? n += Math.round(18 * y) : n += Math.round(10 * y);
|
|
14469
14469
|
}
|
|
14470
14470
|
}
|
|
14471
14471
|
if (t.ariaLabel) {
|
|
@@ -14475,39 +14475,39 @@ const St = class St {
|
|
|
14475
14475
|
}
|
|
14476
14476
|
if (t.placeholder) {
|
|
14477
14477
|
i += 15;
|
|
14478
|
-
const g = e.placeholder || "",
|
|
14479
|
-
if (g.toLowerCase().includes(
|
|
14478
|
+
const g = e.placeholder || "", b = t.placeholder.toLowerCase();
|
|
14479
|
+
if (g.toLowerCase().includes(b))
|
|
14480
14480
|
n += 15;
|
|
14481
14481
|
else if (t.role === "combobox") {
|
|
14482
|
-
const
|
|
14483
|
-
(((h = m == null ? void 0 : m.textContent) == null ? void 0 : h.toLowerCase().trim()) || "").includes(
|
|
14482
|
+
const y = e.closest('[class*="container"]') || e.parentElement, m = y == null ? void 0 : y.querySelector('[class*="placeholder"], [id*="placeholder"]');
|
|
14483
|
+
(((h = m == null ? void 0 : m.textContent) == null ? void 0 : h.toLowerCase().trim()) || "").includes(b) && (n += 15);
|
|
14484
14484
|
}
|
|
14485
14485
|
}
|
|
14486
14486
|
if (t.labelText) {
|
|
14487
14487
|
i += 20;
|
|
14488
14488
|
const g = this.getAssociatedLabelText(e);
|
|
14489
14489
|
if (g) {
|
|
14490
|
-
const
|
|
14491
|
-
|
|
14490
|
+
const b = g.toLowerCase().trim().replace(/\*$/, "").trim(), y = t.labelText.toLowerCase().trim().replace(/\*$/, "").trim();
|
|
14491
|
+
b === y ? n += 20 : (b.includes(y) || y.includes(b)) && (n += 15);
|
|
14492
14492
|
}
|
|
14493
14493
|
}
|
|
14494
14494
|
if (t.optionText) {
|
|
14495
14495
|
i += 15;
|
|
14496
|
-
const
|
|
14497
|
-
|
|
14496
|
+
const b = (e.textContent || "").trim().toLowerCase(), y = t.optionText.toLowerCase().trim();
|
|
14497
|
+
b === y ? n += 15 : b.includes(y) && (n += 10);
|
|
14498
14498
|
}
|
|
14499
14499
|
if (i === 0) return 100;
|
|
14500
14500
|
let a = Math.round(n / i * 100);
|
|
14501
14501
|
if (o ? (a = Math.round(a * 0.3), console.log(`[HybridTargetResolver] Role mismatch penalty (30%): ${e.tagName}[role="${e.getAttribute("role")}"] vs target role="${t.role}"`)) : s && (e.closest('[role="listbox"], [role="menu"], [role="tree"]') || (a = Math.round(a * 0.7), console.log(`[HybridTargetResolver] No role penalty (70%): ${e.tagName} expected role="${t.role}"`))), e.getAttribute("tabindex") === "-1" && (e.closest('[role="listbox"], [role="menu"], [role="combobox"], .select, [class*="dropdown"]') || e.tagName.toLowerCase() === "input" && (a = Math.round(a * 0.85), console.log("[HybridTargetResolver] tabindex=-1 input penalty (85%): likely hidden placeholder"))), t.selector) {
|
|
14502
14502
|
const g = this.extractSelectorContext(t.selector);
|
|
14503
14503
|
if (g.parentTag || g.parentSelector) {
|
|
14504
|
-
const
|
|
14505
|
-
|
|
14504
|
+
const b = this.matchesSelectorContext(e, g);
|
|
14505
|
+
b > 0.5 ? a = Math.min(100, Math.round(a * 1.15)) : b < 0.5 && t.text && (a = Math.round(a * 0.7));
|
|
14506
14506
|
}
|
|
14507
14507
|
}
|
|
14508
14508
|
if (t.text) {
|
|
14509
|
-
const g = e.tagName.toLowerCase(),
|
|
14510
|
-
|
|
14509
|
+
const g = e.tagName.toLowerCase(), b = e.getAttribute("role"), y = ["button", "a", "input", "select", "textarea"].includes(g), m = ["button", "link", "menuitem", "option", "tab", "checkbox", "radio"].includes(b || ""), v = e.onclick !== null || e.hasAttribute("onclick"), w = e.closest('button, a, [role="button"], [role="link"]');
|
|
14510
|
+
y || m ? (a = Math.min(100, Math.round(a * 1.25)), console.log(`[HybridTargetResolver] Interactive element bonus (25%): <${g}> is natively interactive`)) : w ? a = Math.min(100, Math.round(a * 1.15)) : v && (a = Math.min(100, Math.round(a * 1.1)));
|
|
14511
14511
|
}
|
|
14512
14512
|
return a;
|
|
14513
14513
|
}
|
|
@@ -14535,7 +14535,15 @@ const St = class St {
|
|
|
14535
14535
|
if (e.strategies.includes("selector"))
|
|
14536
14536
|
if (n.text) {
|
|
14537
14537
|
const u = (e.element.textContent || "").toLowerCase().trim(), d = n.text.toLowerCase().trim();
|
|
14538
|
-
u === d
|
|
14538
|
+
if (u === d)
|
|
14539
|
+
a = 100, console.log("[HybridTargetResolver] Selector + exact text match bonus applied");
|
|
14540
|
+
else if (u.includes(d))
|
|
14541
|
+
a = 70, console.log("[HybridTargetResolver] Selector + partial text match bonus applied");
|
|
14542
|
+
else if (d.startsWith(u) && u.length >= 15 && u.length / d.length >= 0.3) {
|
|
14543
|
+
const h = u.length / d.length;
|
|
14544
|
+
a = Math.round(70 * h), console.log(`[HybridTargetResolver] Selector + truncated text match bonus: ${a} (${Math.round(h * 100)}% overlap)`);
|
|
14545
|
+
} else
|
|
14546
|
+
a = 20, console.log("[HybridTargetResolver] Selector match but NO text match - reduced bonus");
|
|
14539
14547
|
} else
|
|
14540
14548
|
a = 100, console.log("[HybridTargetResolver] Selector match bonus applied (no text to validate)");
|
|
14541
14549
|
return i * 0.3 + // Reduced from 40% to make room for selector bonus
|
|
@@ -14624,10 +14632,10 @@ const St = class St {
|
|
|
14624
14632
|
var m;
|
|
14625
14633
|
const u = c;
|
|
14626
14634
|
if (Re(u)) return;
|
|
14627
|
-
const d = u.getBoundingClientRect(), h = Math.abs(d.x - e.x), g = Math.abs(d.y - e.y),
|
|
14628
|
-
if (h <= i && g <= i &&
|
|
14629
|
-
let
|
|
14630
|
-
t && u.tagName.toLowerCase() === t.toLowerCase() && (
|
|
14635
|
+
const d = u.getBoundingClientRect(), h = Math.abs(d.x - e.x), g = Math.abs(d.y - e.y), b = Math.abs(d.width - e.width), y = Math.abs(d.height - e.height);
|
|
14636
|
+
if (h <= i && g <= i && b <= i * 2 && y <= i * 2) {
|
|
14637
|
+
let v = 100 - h - g;
|
|
14638
|
+
t && u.tagName.toLowerCase() === t.toLowerCase() && (v += 30), n && (((m = u.innerText) == null ? void 0 : m.trim().toLowerCase()) || "").includes(n.toLowerCase()) && (v += 25), v > a && (a = v, s = u);
|
|
14631
14639
|
}
|
|
14632
14640
|
}), s;
|
|
14633
14641
|
}
|
|
@@ -14736,13 +14744,13 @@ const St = class St {
|
|
|
14736
14744
|
for (const h of d) {
|
|
14737
14745
|
if (e.contains(h) || h.contains(e) || h.querySelector('input, select, textarea, [role="combobox"]')) continue;
|
|
14738
14746
|
if (i.querySelectorAll('input, select, textarea, [role="combobox"]').length === 1) {
|
|
14739
|
-
const
|
|
14740
|
-
if (
|
|
14741
|
-
return
|
|
14747
|
+
const b = (c = h.textContent) == null ? void 0 : c.trim().replace(/\*$/, "").trim();
|
|
14748
|
+
if (b && b.length > 0 && b.length < 50)
|
|
14749
|
+
return b;
|
|
14742
14750
|
} else if (this.isLabelForElement(h, e, i)) {
|
|
14743
|
-
const
|
|
14744
|
-
if (
|
|
14745
|
-
return
|
|
14751
|
+
const b = (u = h.textContent) == null ? void 0 : u.trim().replace(/\*$/, "").trim();
|
|
14752
|
+
if (b && b.length > 0 && b.length < 50)
|
|
14753
|
+
return b;
|
|
14746
14754
|
}
|
|
14747
14755
|
}
|
|
14748
14756
|
i = i.parentElement, o++;
|
|
@@ -14915,8 +14923,8 @@ const St = class St {
|
|
|
14915
14923
|
if (o === 'input[role="combobox"]' || o === '[role="combobox"]') {
|
|
14916
14924
|
const c = document.querySelectorAll(o);
|
|
14917
14925
|
c.length > 1 && (console.warn(`[HybridTargetResolver] ⚠️ AMBIGUOUS SELECTOR: "${o}" matches ${c.length} elements!`), console.warn("[HybridTargetResolver] ⚠️ Bot should send more specific targeting (text, label, boundingBox, domIndex)"), c.forEach((u, d) => {
|
|
14918
|
-
const h = u, g = h.getAttribute("placeholder") || "",
|
|
14919
|
-
console.log(`[HybridTargetResolver] ${d}: id="${
|
|
14926
|
+
const h = u, g = h.getAttribute("placeholder") || "", b = h.getAttribute("aria-label") || "", y = h.id || "";
|
|
14927
|
+
console.log(`[HybridTargetResolver] ${d}: id="${y}" placeholder="${g}" aria-label="${b}"`);
|
|
14920
14928
|
}));
|
|
14921
14929
|
}
|
|
14922
14930
|
const a = document.querySelector(o);
|
|
@@ -15030,9 +15038,9 @@ const St = class St {
|
|
|
15030
15038
|
// Just the icon (if no wrapper)
|
|
15031
15039
|
];
|
|
15032
15040
|
for (const g of h) {
|
|
15033
|
-
const
|
|
15034
|
-
if (
|
|
15035
|
-
return console.log(`[HybridTargetResolver] → Found remove button: <${
|
|
15041
|
+
const b = c.querySelector(g);
|
|
15042
|
+
if (b && this.isVisible(b))
|
|
15043
|
+
return console.log(`[HybridTargetResolver] → Found remove button: <${b.tagName.toLowerCase()}> with selector "${g}"`), b;
|
|
15036
15044
|
}
|
|
15037
15045
|
return console.log("[HybridTargetResolver] → No specific remove button found, returning chip container"), c;
|
|
15038
15046
|
}
|
|
@@ -15096,7 +15104,7 @@ const St = class St {
|
|
|
15096
15104
|
* We want to find the combobox that has "Label" as its label, not some other element with "Label" text
|
|
15097
15105
|
*/
|
|
15098
15106
|
static findElementByLabelText(e, t) {
|
|
15099
|
-
var
|
|
15107
|
+
var b, y, m;
|
|
15100
15108
|
const i = t.replace(/\\"/g, '"').replace(/\\ /g, " ").replace(/\\\\/g, "\\").replace(/\[data-label="[^"]*"\]/g, "").replace(/\[data-option-text="[^"]*"\]/g, "").replace(/\[data-index="[^"]*"\]/g, "").trim(), o = i.toLowerCase().trim(), s = ["*", "div", "span", "p", "a", "li", "ul", "section", "article"], a = /\[role=/.test(i);
|
|
15101
15109
|
if (s.includes(o) && !a)
|
|
15102
15110
|
return null;
|
|
@@ -15110,14 +15118,14 @@ const St = class St {
|
|
|
15110
15118
|
return null;
|
|
15111
15119
|
console.log(`[HybridTargetResolver] → Looking for "${i}" associated with label "${e}"`), console.log(`[HybridTargetResolver] → Found ${c.length} elements matching selector`);
|
|
15112
15120
|
const u = e.toLowerCase().trim();
|
|
15113
|
-
function d(
|
|
15114
|
-
return
|
|
15121
|
+
function d(v) {
|
|
15122
|
+
return v.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
15115
15123
|
}
|
|
15116
|
-
const h = (
|
|
15124
|
+
const h = (v) => v.toLowerCase().trim().replace(/\*$/, "").trim() === u ? !0 : new RegExp(
|
|
15117
15125
|
`(^|\\s)${d(u)}($|\\s|[:\\*\\?\\.\\,\\)\\]\\}\\-])`,
|
|
15118
15126
|
"i"
|
|
15119
|
-
).test(
|
|
15120
|
-
const w =
|
|
15127
|
+
).test(v), g = (v) => {
|
|
15128
|
+
const w = v, x = w.getBoundingClientRect();
|
|
15121
15129
|
if (x.width === 0 || x.height === 0) return !1;
|
|
15122
15130
|
if (!w.offsetParent)
|
|
15123
15131
|
try {
|
|
@@ -15129,45 +15137,45 @@ const St = class St {
|
|
|
15129
15137
|
}
|
|
15130
15138
|
return !0;
|
|
15131
15139
|
};
|
|
15132
|
-
for (const
|
|
15133
|
-
if (!g(
|
|
15134
|
-
const w =
|
|
15140
|
+
for (const v of c) {
|
|
15141
|
+
if (!g(v)) continue;
|
|
15142
|
+
const w = v.getAttribute("id");
|
|
15135
15143
|
if (w)
|
|
15136
15144
|
try {
|
|
15137
15145
|
const B = document.querySelector(`label[for="${CSS.escape(w)}"]`);
|
|
15138
15146
|
if (B && h(B.textContent || ""))
|
|
15139
|
-
return console.log("[HybridTargetResolver] → Found via label[for] attribute"),
|
|
15147
|
+
return console.log("[HybridTargetResolver] → Found via label[for] attribute"), v;
|
|
15140
15148
|
} catch {
|
|
15141
15149
|
}
|
|
15142
|
-
const x =
|
|
15150
|
+
const x = v.getAttribute("aria-labelledby");
|
|
15143
15151
|
if (x) {
|
|
15144
15152
|
const B = x.split(/\s+/).filter((re) => re.length > 0);
|
|
15145
15153
|
for (const re of B) {
|
|
15146
15154
|
const se = document.getElementById(re);
|
|
15147
15155
|
if (se && h(se.textContent || ""))
|
|
15148
|
-
return console.log("[HybridTargetResolver] → Found via aria-labelledby"),
|
|
15156
|
+
return console.log("[HybridTargetResolver] → Found via aria-labelledby"), v;
|
|
15149
15157
|
}
|
|
15150
15158
|
}
|
|
15151
|
-
const C =
|
|
15159
|
+
const C = v.getAttribute("aria-label") || "";
|
|
15152
15160
|
if (C && h(C))
|
|
15153
|
-
return console.log("[HybridTargetResolver] → Found via aria-label"),
|
|
15154
|
-
const D =
|
|
15161
|
+
return console.log("[HybridTargetResolver] → Found via aria-label"), v;
|
|
15162
|
+
const D = v.getAttribute("placeholder") || "";
|
|
15155
15163
|
if (D && h(D))
|
|
15156
|
-
return console.log("[HybridTargetResolver] → Found via placeholder"),
|
|
15157
|
-
let P =
|
|
15164
|
+
return console.log("[HybridTargetResolver] → Found via placeholder"), v;
|
|
15165
|
+
let P = v.parentElement, R = 0;
|
|
15158
15166
|
for (; P && R < 6; ) {
|
|
15159
|
-
const B = P.querySelectorAll('input, select, textarea, [role="combobox"], [role="listbox"]'), re = Array.from(B), se = re.includes(
|
|
15167
|
+
const B = P.querySelectorAll('input, select, textarea, [role="combobox"], [role="listbox"]'), re = Array.from(B), se = re.includes(v), me = P.classList.contains("MuiFormControl-root") || P.tagName === "FIELDSET" || /form(-|_)?(field|group|control|item|row)/i.test(P.className) || // React pattern: div containing both a label-like child and an input wrapper
|
|
15160
15168
|
P.childElementCount >= 2 && P.childElementCount <= 5, $ = P.querySelectorAll(
|
|
15161
15169
|
'label, [class*="label"]:not(input):not(select):not(textarea):not([role="combobox"]), .MuiFormLabel-root, [class*="FormLabel"], [class*="form-label"], [class*="field-label"]'
|
|
15162
15170
|
);
|
|
15163
15171
|
for (const j of $) {
|
|
15164
|
-
if (
|
|
15165
|
-
const H = ((
|
|
15172
|
+
if (v.contains(j) || j.contains(v) || j.querySelector('input, select, textarea, [role="combobox"]')) continue;
|
|
15173
|
+
const H = ((b = j.textContent) == null ? void 0 : b.trim()) || "";
|
|
15166
15174
|
if (!(H.length > 50) && h(H)) {
|
|
15167
15175
|
if (B.length === 1 && se)
|
|
15168
|
-
return console.log(`[HybridTargetResolver] → Found via label in container: "${H}"`),
|
|
15169
|
-
if (se && this.isTextNearElement(j,
|
|
15170
|
-
return console.log(`[HybridTargetResolver] → Found via label position: "${H}"`),
|
|
15176
|
+
return console.log(`[HybridTargetResolver] → Found via label in container: "${H}"`), v;
|
|
15177
|
+
if (se && this.isTextNearElement(j, v, re))
|
|
15178
|
+
return console.log(`[HybridTargetResolver] → Found via label position: "${H}"`), v;
|
|
15171
15179
|
}
|
|
15172
15180
|
}
|
|
15173
15181
|
if (me || R >= 3) {
|
|
@@ -15175,15 +15183,15 @@ const St = class St {
|
|
|
15175
15183
|
":scope > div, :scope > span, :scope > p, :scope > div > div, :scope > div > span, :scope > div > p"
|
|
15176
15184
|
);
|
|
15177
15185
|
for (const H of j) {
|
|
15178
|
-
if (H.querySelector('input, select, textarea, [role="combobox"]') || H.contains(
|
|
15179
|
-
const X =
|
|
15180
|
-
if (X && ((
|
|
15186
|
+
if (H.querySelector('input, select, textarea, [role="combobox"]') || H.contains(v) || v.contains(H)) continue;
|
|
15187
|
+
const X = v.value || "";
|
|
15188
|
+
if (X && ((y = H.textContent) == null ? void 0 : y.trim()) === X) continue;
|
|
15181
15189
|
const N = ((m = H.textContent) == null ? void 0 : m.trim()) || "";
|
|
15182
15190
|
if (N.length > 0 && N.length <= 30 && h(N)) {
|
|
15183
15191
|
if (B.length === 1 && se)
|
|
15184
|
-
return console.log(`[HybridTargetResolver] → Found via nearby text: "${N}"`),
|
|
15185
|
-
if (se && this.isTextNearElement(H,
|
|
15186
|
-
return console.log(`[HybridTargetResolver] → Found via nearby text (position): "${N}"`),
|
|
15192
|
+
return console.log(`[HybridTargetResolver] → Found via nearby text: "${N}"`), v;
|
|
15193
|
+
if (se && this.isTextNearElement(H, v, re))
|
|
15194
|
+
return console.log(`[HybridTargetResolver] → Found via nearby text (position): "${N}"`), v;
|
|
15187
15195
|
}
|
|
15188
15196
|
}
|
|
15189
15197
|
}
|
|
@@ -15314,33 +15322,33 @@ const St = class St {
|
|
|
15314
15322
|
console.log("[HybridTargetResolver] → XPath found nothing, trying fallback...");
|
|
15315
15323
|
const g = document.querySelectorAll(t || "*");
|
|
15316
15324
|
console.log(`[HybridTargetResolver] → Fallback: checking ${g.length} <${t || "*"}> elements for text "${i}"`);
|
|
15317
|
-
const
|
|
15325
|
+
const b = ($) => {
|
|
15318
15326
|
const j = $;
|
|
15319
15327
|
return Re(j) ? !0 : j.id === "root" || j.id === "app" || j.id === "__next" || j.tagName === "BODY" || j.tagName === "HTML";
|
|
15320
15328
|
};
|
|
15321
15329
|
for (const $ of g) {
|
|
15322
|
-
if (
|
|
15330
|
+
if (b($) || (((R = $.textContent) == null ? void 0 : R.trim().toLowerCase()) || "") !== o) continue;
|
|
15323
15331
|
const H = $.getBoundingClientRect();
|
|
15324
15332
|
if (H.width > 0 && H.height > 0 && (((B = $.innerText) == null ? void 0 : B.trim().toLowerCase()) || "") === o)
|
|
15325
15333
|
return console.log("[HybridTargetResolver] → Found via exact text match"), $;
|
|
15326
15334
|
}
|
|
15327
|
-
let
|
|
15335
|
+
let y = null, m = -1 / 0;
|
|
15328
15336
|
for (const $ of g) {
|
|
15329
|
-
if (
|
|
15337
|
+
if (b($)) continue;
|
|
15330
15338
|
const j = ((re = $.textContent) == null ? void 0 : re.trim().toLowerCase()) || "";
|
|
15331
15339
|
if (j.length !== 0 && j.includes(o)) {
|
|
15332
15340
|
const H = o.length / j.length, X = $.getBoundingClientRect(), N = X.width * X.height;
|
|
15333
15341
|
if (N > 0 && N < 5e5) {
|
|
15334
15342
|
const U = Math.max(0, 50 - N / 1e4), Q = H * 50, le = U + Q;
|
|
15335
|
-
le > m && (m = le,
|
|
15343
|
+
le > m && (m = le, y = $);
|
|
15336
15344
|
}
|
|
15337
15345
|
}
|
|
15338
15346
|
}
|
|
15339
|
-
if (
|
|
15340
|
-
const $ =
|
|
15341
|
-
return console.log(`[HybridTargetResolver] → Found via textContent (${$.width.toFixed(0)}x${$.height.toFixed(0)}px, score=${m.toFixed(0)})`),
|
|
15347
|
+
if (y) {
|
|
15348
|
+
const $ = y.getBoundingClientRect();
|
|
15349
|
+
return console.log(`[HybridTargetResolver] → Found via textContent (${$.width.toFixed(0)}x${$.height.toFixed(0)}px, score=${m.toFixed(0)})`), y;
|
|
15342
15350
|
}
|
|
15343
|
-
const
|
|
15351
|
+
const v = t && ["input", "textarea"].includes(t.toLowerCase()) ? t.toLowerCase() : "input, textarea", w = document.querySelectorAll(v);
|
|
15344
15352
|
console.log(`[HybridTargetResolver] → Checking ${w.length} input/textarea elements for placeholder "${i}"`);
|
|
15345
15353
|
for (const $ of w) {
|
|
15346
15354
|
const j = $;
|
|
@@ -15429,14 +15437,14 @@ const St = class St {
|
|
|
15429
15437
|
const g = h;
|
|
15430
15438
|
if (g.id === "root" || g.id === "app" || g.tagName === "BODY" || g.tagName === "HTML" || !St.isVisible(g) || (((i = g.innerText) == null ? void 0 : i.length) || 0) > 200)
|
|
15431
15439
|
continue;
|
|
15432
|
-
const
|
|
15440
|
+
const y = ((o = g.innerText) == null ? void 0 : o.trim()) || "", m = y.toLowerCase();
|
|
15433
15441
|
if (m === a) {
|
|
15434
|
-
console.log(`[HybridTargetResolver] → Found exact match: "${
|
|
15442
|
+
console.log(`[HybridTargetResolver] → Found exact match: "${y.substring(0, 50)}..."`), c = g;
|
|
15435
15443
|
break;
|
|
15436
15444
|
}
|
|
15437
15445
|
if (m.includes(a)) {
|
|
15438
|
-
const
|
|
15439
|
-
|
|
15446
|
+
const v = a.length / m.length;
|
|
15447
|
+
v > 0.7 && v > d && (u = g, d = v);
|
|
15440
15448
|
}
|
|
15441
15449
|
}
|
|
15442
15450
|
if (c)
|
|
@@ -15545,13 +15553,13 @@ const St = class St {
|
|
|
15545
15553
|
}
|
|
15546
15554
|
};
|
|
15547
15555
|
// Static reference to DOMIntrospector for bounding box lookups
|
|
15548
|
-
|
|
15556
|
+
M(St, "domIntrospector", null);
|
|
15549
15557
|
let ue = St;
|
|
15550
15558
|
class wh {
|
|
15551
15559
|
constructor() {
|
|
15552
|
-
|
|
15560
|
+
M(this, "confirmationSound");
|
|
15553
15561
|
/** Last error message from a failed action (e.g., modal overlay blocking click) */
|
|
15554
|
-
|
|
15562
|
+
M(this, "lastError", null);
|
|
15555
15563
|
this.confirmationSound = new Audio("data:audio/wav;base64,UklGRiQAAABXQVZFZm10IBAAAAABAAEARKwAAIhYAQACABAAZGF0YQAAAAA=");
|
|
15556
15564
|
}
|
|
15557
15565
|
/**
|
|
@@ -15818,15 +15826,15 @@ class wh {
|
|
|
15818
15826
|
const g = t.querySelector('input[role="combobox"]');
|
|
15819
15827
|
if (g)
|
|
15820
15828
|
return console.log("[ActionExecutor] Found combobox input via control element"), g;
|
|
15821
|
-
const
|
|
15822
|
-
if (
|
|
15823
|
-
const m =
|
|
15829
|
+
const b = t.parentElement;
|
|
15830
|
+
if (b) {
|
|
15831
|
+
const m = b.querySelector('input[role="combobox"]');
|
|
15824
15832
|
if (m)
|
|
15825
15833
|
return console.log("[ActionExecutor] Found combobox input in parent container"), m;
|
|
15826
15834
|
}
|
|
15827
|
-
const
|
|
15828
|
-
if (
|
|
15829
|
-
return console.log("[ActionExecutor] Found listbox trigger button"),
|
|
15835
|
+
const y = t.querySelector('button[aria-haspopup="listbox"]');
|
|
15836
|
+
if (y)
|
|
15837
|
+
return console.log("[ActionExecutor] Found listbox trigger button"), y;
|
|
15830
15838
|
}
|
|
15831
15839
|
t = t.parentElement, n++;
|
|
15832
15840
|
}
|
|
@@ -16002,7 +16010,7 @@ class wh {
|
|
|
16002
16010
|
let i = e.parentElement, o = e, s = 0;
|
|
16003
16011
|
for (; i && i !== document.body && s < 10; ) {
|
|
16004
16012
|
s++;
|
|
16005
|
-
const c = window.getComputedStyle(i), u = c.cursor === "pointer", d = n(i), h = d.includes("cursor-pointer"), g = (a = i.classList) == null ? void 0 : a.contains("cursor-pointer"),
|
|
16013
|
+
const c = window.getComputedStyle(i), u = c.cursor === "pointer", d = n(i), h = d.includes("cursor-pointer"), g = (a = i.classList) == null ? void 0 : a.contains("cursor-pointer"), b = i.hasAttribute("onclick") || i.hasAttribute("data-onclick") || i.getAttribute("role") === "button" || i.getAttribute("role") === "menuitem", y = i.tagName === "BUTTON" || i.tagName === "A";
|
|
16006
16014
|
if (console.log(
|
|
16007
16015
|
`[ActionExecutor] Checking parent #${s}:`,
|
|
16008
16016
|
i.tagName,
|
|
@@ -16012,11 +16020,11 @@ class wh {
|
|
|
16012
16020
|
h || g,
|
|
16013
16021
|
"classes:",
|
|
16014
16022
|
d.substring(0, 60)
|
|
16015
|
-
), (u || h || g ||
|
|
16023
|
+
), (u || h || g || b || y) && (o = i, console.log(
|
|
16016
16024
|
"[ActionExecutor] ✅ Found clickable parent:",
|
|
16017
16025
|
i.tagName,
|
|
16018
16026
|
d.substring(0, 80)
|
|
16019
|
-
),
|
|
16027
|
+
), y || i.getAttribute("role") === "button"))
|
|
16020
16028
|
break;
|
|
16021
16029
|
i = i.parentElement;
|
|
16022
16030
|
}
|
|
@@ -16128,13 +16136,13 @@ class wh {
|
|
|
16128
16136
|
i.unshift(d), o = o.parentElement;
|
|
16129
16137
|
}
|
|
16130
16138
|
const s = (d) => {
|
|
16131
|
-
var
|
|
16139
|
+
var b;
|
|
16132
16140
|
const h = d.querySelector("span, label, p");
|
|
16133
|
-
if ((
|
|
16141
|
+
if ((b = h == null ? void 0 : h.textContent) != null && b.trim())
|
|
16134
16142
|
return h.textContent.trim().substring(0, 50);
|
|
16135
16143
|
let g = "";
|
|
16136
|
-
for (const
|
|
16137
|
-
|
|
16144
|
+
for (const y of Array.from(d.childNodes))
|
|
16145
|
+
y.nodeType === Node.TEXT_NODE && (g += (y.textContent || "").trim() + " ");
|
|
16138
16146
|
return g = g.trim(), !g && d.textContent && (g = d.textContent.trim().substring(0, 50)), g;
|
|
16139
16147
|
}, a = window.__onboardingSDK, c = (a == null ? void 0 : a._botActionDepth) > 0, u = {
|
|
16140
16148
|
type: "click",
|
|
@@ -16236,11 +16244,11 @@ ${e.description || ""}`;
|
|
|
16236
16244
|
}
|
|
16237
16245
|
class Sh {
|
|
16238
16246
|
constructor() {
|
|
16239
|
-
|
|
16240
|
-
|
|
16241
|
-
|
|
16242
|
-
|
|
16243
|
-
|
|
16247
|
+
M(this, "container", null);
|
|
16248
|
+
M(this, "highlightEl", null);
|
|
16249
|
+
M(this, "tooltipElement", null);
|
|
16250
|
+
M(this, "floeCursor", null);
|
|
16251
|
+
M(this, "cursorHasBeenPositioned", !1);
|
|
16244
16252
|
}
|
|
16245
16253
|
// Track if cursor has been shown at least once
|
|
16246
16254
|
/**
|
|
@@ -16363,8 +16371,8 @@ class Sh {
|
|
|
16363
16371
|
}
|
|
16364
16372
|
this.showFloeCursor();
|
|
16365
16373
|
const o = parseFloat(this.floeCursor.style.top) || 0, s = parseFloat(this.floeCursor.style.left) || 0, a = performance.now(), c = s, u = o, d = (h) => {
|
|
16366
|
-
const g = h - a,
|
|
16367
|
-
this.floeCursor && (this.floeCursor.style.left = `${m}px`, this.floeCursor.style.top = `${
|
|
16374
|
+
const g = h - a, b = Math.min(g / n, 1), y = 1 - Math.pow(1 - b, 3), m = c + (e - c) * y, v = u + (t - u) * y;
|
|
16375
|
+
this.floeCursor && (this.floeCursor.style.left = `${m}px`, this.floeCursor.style.top = `${v}px`), b < 1 ? requestAnimationFrame(d) : i();
|
|
16368
16376
|
};
|
|
16369
16377
|
requestAnimationFrame(d);
|
|
16370
16378
|
});
|
|
@@ -16805,7 +16813,7 @@ class Sh {
|
|
|
16805
16813
|
}
|
|
16806
16814
|
class Pi {
|
|
16807
16815
|
constructor(e) {
|
|
16808
|
-
|
|
16816
|
+
M(this, "piiPatterns");
|
|
16809
16817
|
this.piiPatterns = {
|
|
16810
16818
|
email: /[\w.-]+@[\w.-]+\.\w+/,
|
|
16811
16819
|
phone: /[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4,6}/,
|
|
@@ -16876,7 +16884,9 @@ class Pi {
|
|
|
16876
16884
|
* Get all text nodes in the document
|
|
16877
16885
|
*/
|
|
16878
16886
|
getAllTextNodes() {
|
|
16879
|
-
const e = []
|
|
16887
|
+
const e = [];
|
|
16888
|
+
if (!document.body) return e;
|
|
16889
|
+
const t = document.createTreeWalker(
|
|
16880
16890
|
document.body,
|
|
16881
16891
|
NodeFilter.SHOW_TEXT,
|
|
16882
16892
|
{
|
|
@@ -16914,16 +16924,16 @@ class Pi {
|
|
|
16914
16924
|
for (let s = 0; s < t.height; s++)
|
|
16915
16925
|
for (let a = 0; a < t.width; a++) {
|
|
16916
16926
|
let c = 0, u = 0, d = 0, h = 0, g = 0;
|
|
16917
|
-
for (let
|
|
16927
|
+
for (let y = -o; y <= o; y++)
|
|
16918
16928
|
for (let m = -o; m <= o; m++) {
|
|
16919
|
-
const
|
|
16920
|
-
if (
|
|
16921
|
-
const x = (w * t.width +
|
|
16929
|
+
const v = a + m, w = s + y;
|
|
16930
|
+
if (v >= 0 && v < t.width && w >= 0 && w < t.height) {
|
|
16931
|
+
const x = (w * t.width + v) * 4;
|
|
16922
16932
|
c += i[x], u += i[x + 1], d += i[x + 2], h += i[x + 3], g++;
|
|
16923
16933
|
}
|
|
16924
16934
|
}
|
|
16925
|
-
const
|
|
16926
|
-
i[
|
|
16935
|
+
const b = (s * t.width + a) * 4;
|
|
16936
|
+
i[b] = c / g, i[b + 1] = u / g, i[b + 2] = d / g, i[b + 3] = h / g;
|
|
16927
16937
|
}
|
|
16928
16938
|
e.putImageData(n, t.x, t.y);
|
|
16929
16939
|
}
|
|
@@ -16942,14 +16952,14 @@ class Pi {
|
|
|
16942
16952
|
const s = [];
|
|
16943
16953
|
if (t) {
|
|
16944
16954
|
const h = this.getAllTextNodes();
|
|
16945
|
-
for (const { node: g, rect:
|
|
16946
|
-
const
|
|
16947
|
-
|
|
16948
|
-
x:
|
|
16949
|
-
y:
|
|
16950
|
-
width:
|
|
16951
|
-
height:
|
|
16952
|
-
type:
|
|
16955
|
+
for (const { node: g, rect: b } of h) {
|
|
16956
|
+
const y = this.containsPII(g.textContent || "");
|
|
16957
|
+
y.contains && s.push({
|
|
16958
|
+
x: b.left,
|
|
16959
|
+
y: b.top,
|
|
16960
|
+
width: b.width,
|
|
16961
|
+
height: b.height,
|
|
16962
|
+
type: y.type || "unknown"
|
|
16953
16963
|
});
|
|
16954
16964
|
}
|
|
16955
16965
|
}
|
|
@@ -16958,23 +16968,27 @@ class Pi {
|
|
|
16958
16968
|
return console.error("[ScreenCapture] Failed to get 2D canvas context"), Promise.reject(new Error("[ScreenCapture] Canvas 2D context unavailable"));
|
|
16959
16969
|
const u = window.innerWidth * n, d = window.innerHeight * n;
|
|
16960
16970
|
return a.width = u, a.height = d, new Promise((h, g) => {
|
|
16961
|
-
const
|
|
16962
|
-
|
|
16963
|
-
|
|
16964
|
-
|
|
16965
|
-
|
|
16966
|
-
|
|
16971
|
+
const b = document.createElement("iframe");
|
|
16972
|
+
if (b.style.position = "fixed", b.style.top = "0", b.style.left = "0", b.style.width = "100%", b.style.height = "100%", b.style.border = "none", b.style.zIndex = "-999999", !document.body) {
|
|
16973
|
+
console.warn("[ScreenCapture] Document body became null before iframe append"), this.safeCanvasToDataURL(a, o, i).then(h, g);
|
|
16974
|
+
return;
|
|
16975
|
+
}
|
|
16976
|
+
document.body.appendChild(b);
|
|
16977
|
+
const y = b.contentDocument;
|
|
16978
|
+
if (y.open(), y.write(document.documentElement.outerHTML), y.close(), Pi.sanitizeClonedDocument(y), t && s.length > 0) {
|
|
16979
|
+
const v = y.createElement("style");
|
|
16980
|
+
if (v.textContent = `
|
|
16967
16981
|
.pii-redacted {
|
|
16968
16982
|
filter: blur(5px);
|
|
16969
16983
|
background: #000;
|
|
16970
16984
|
color: transparent !important;
|
|
16971
16985
|
}
|
|
16972
|
-
`,
|
|
16973
|
-
console.warn("[ScreenCapture] Cloned document has no body"), document.body.removeChild(
|
|
16986
|
+
`, y.head.appendChild(v), !y.body) {
|
|
16987
|
+
console.warn("[ScreenCapture] Cloned document has no body"), document.body.removeChild(b), this.safeCanvasToDataURL(a, o, i).then(h, g);
|
|
16974
16988
|
return;
|
|
16975
16989
|
}
|
|
16976
|
-
const w =
|
|
16977
|
-
|
|
16990
|
+
const w = y.createTreeWalker(
|
|
16991
|
+
y.body,
|
|
16978
16992
|
NodeFilter.SHOW_TEXT
|
|
16979
16993
|
);
|
|
16980
16994
|
let x;
|
|
@@ -16983,17 +16997,17 @@ class Pi {
|
|
|
16983
16997
|
}
|
|
16984
16998
|
const m = () => {
|
|
16985
16999
|
try {
|
|
16986
|
-
document.body.removeChild(
|
|
17000
|
+
document.body.removeChild(b);
|
|
16987
17001
|
} catch {
|
|
16988
17002
|
}
|
|
16989
17003
|
};
|
|
16990
17004
|
setTimeout(() => {
|
|
16991
17005
|
try {
|
|
16992
|
-
if (!
|
|
17006
|
+
if (!b.contentWindow) {
|
|
16993
17007
|
console.warn("[ScreenCapture] iframe contentWindow not available"), m(), this.safeCanvasToDataURL(a, o, i).then(h, g);
|
|
16994
17008
|
return;
|
|
16995
17009
|
}
|
|
16996
|
-
const x = new XMLSerializer().serializeToString(
|
|
17010
|
+
const x = new XMLSerializer().serializeToString(y.documentElement), C = `<svg xmlns="http://www.w3.org/2000/svg" width="${window.innerWidth}" height="${window.innerHeight}"><foreignObject width="100%" height="100%">` + x + "</foreignObject></svg>", D = new Blob([C], { type: "image/svg+xml;charset=utf-8" }), P = URL.createObjectURL(D), R = new Image();
|
|
16997
17011
|
R.onload = () => {
|
|
16998
17012
|
if (c.save(), c.scale(n, n), c.drawImage(R, 0, 0), c.restore(), URL.revokeObjectURL(P), t && s.length > 0)
|
|
16999
17013
|
for (const B of s)
|
|
@@ -17007,8 +17021,8 @@ class Pi {
|
|
|
17007
17021
|
}, R.onerror = () => {
|
|
17008
17022
|
URL.revokeObjectURL(P), console.warn("[ScreenCapture] SVG image render failed, returning blank canvas"), m(), this.safeCanvasToDataURL(a, o, i).then(h, g);
|
|
17009
17023
|
}, R.src = P;
|
|
17010
|
-
} catch (
|
|
17011
|
-
console.error("[ScreenCapture] Failed to render iframe content:",
|
|
17024
|
+
} catch (v) {
|
|
17025
|
+
console.error("[ScreenCapture] Failed to render iframe content:", v), m(), this.safeCanvasToDataURL(a, o, i).then(h, g);
|
|
17012
17026
|
}
|
|
17013
17027
|
}, 100);
|
|
17014
17028
|
});
|
|
@@ -17022,22 +17036,22 @@ class Pi {
|
|
|
17022
17036
|
}
|
|
17023
17037
|
class kh {
|
|
17024
17038
|
constructor(e) {
|
|
17025
|
-
|
|
17026
|
-
|
|
17027
|
-
|
|
17028
|
-
|
|
17029
|
-
|
|
17030
|
-
|
|
17031
|
-
|
|
17032
|
-
|
|
17033
|
-
|
|
17034
|
-
|
|
17039
|
+
M(this, "sdk");
|
|
17040
|
+
M(this, "domIntrospector", null);
|
|
17041
|
+
M(this, "lastUrl", "");
|
|
17042
|
+
M(this, "clickHandler", null);
|
|
17043
|
+
M(this, "focusHandler", null);
|
|
17044
|
+
M(this, "blurHandler", null);
|
|
17045
|
+
M(this, "inputHandler", null);
|
|
17046
|
+
M(this, "keydownHandler", null);
|
|
17047
|
+
M(this, "inputDebounceTimers", /* @__PURE__ */ new Map());
|
|
17048
|
+
M(this, "isTracking", !1);
|
|
17035
17049
|
// Scroll tracking for Fast Execution System
|
|
17036
|
-
|
|
17037
|
-
|
|
17050
|
+
M(this, "scrollHandler", null);
|
|
17051
|
+
M(this, "scrollDebounceTimer", null);
|
|
17038
17052
|
// URL tracking for SPAs
|
|
17039
|
-
|
|
17040
|
-
|
|
17053
|
+
M(this, "urlCheckInterval", null);
|
|
17054
|
+
M(this, "popstateHandler", null);
|
|
17041
17055
|
this.sdk = e, this.lastUrl = window.location.href;
|
|
17042
17056
|
}
|
|
17043
17057
|
/**
|
|
@@ -17231,21 +17245,21 @@ class kh {
|
|
|
17231
17245
|
let d = e, h = 0;
|
|
17232
17246
|
for (; d && d !== document.body && h < 5; ) {
|
|
17233
17247
|
let g = d.tagName.toLowerCase();
|
|
17234
|
-
const
|
|
17235
|
-
if (
|
|
17236
|
-
u.unshift(`[data-testid="${
|
|
17248
|
+
const b = d.getAttribute("role"), y = d.getAttribute("data-testid");
|
|
17249
|
+
if (y) {
|
|
17250
|
+
u.unshift(`[data-testid="${y}"]`);
|
|
17237
17251
|
break;
|
|
17238
17252
|
}
|
|
17239
|
-
if (
|
|
17240
|
-
g += `[role="${
|
|
17253
|
+
if (b)
|
|
17254
|
+
g += `[role="${b}"]`;
|
|
17241
17255
|
else if (d.className && typeof d.className == "string") {
|
|
17242
17256
|
const m = d.className.split(" ").filter(
|
|
17243
|
-
(
|
|
17244
|
-
!
|
|
17245
|
-
!
|
|
17246
|
-
!
|
|
17247
|
-
!
|
|
17248
|
-
!
|
|
17257
|
+
(v) => v && !v.startsWith("css-") && // Emotion/styled-components
|
|
17258
|
+
!v.startsWith("sc-") && // styled-components
|
|
17259
|
+
!v.startsWith("ng-") && // Angular
|
|
17260
|
+
!v.startsWith("_") && // Private
|
|
17261
|
+
!v.match(/^[a-z]{6,}$/) && // Random hashes
|
|
17262
|
+
!v.match(/^\d/)
|
|
17249
17263
|
// Starts with number
|
|
17250
17264
|
).slice(0, 2);
|
|
17251
17265
|
m.length > 0 && (g += `.${m.join(".")}`);
|
|
@@ -17259,27 +17273,27 @@ class kh {
|
|
|
17259
17273
|
* This provides all the information needed for multi-strategy element finding
|
|
17260
17274
|
*/
|
|
17261
17275
|
getElementMetadata(e) {
|
|
17262
|
-
var g,
|
|
17276
|
+
var g, b, y, m;
|
|
17263
17277
|
const t = e, n = this.getSelector(e), i = ((g = t.innerText) == null ? void 0 : g.trim().substring(0, 100)) || "", o = e.tagName.toLowerCase(), s = e.getAttribute("role") || void 0, a = e.getAttribute("aria-label") || void 0, c = e.placeholder || void 0;
|
|
17264
17278
|
let u;
|
|
17265
17279
|
const d = e.getAttribute("aria-labelledby");
|
|
17266
17280
|
if (d) {
|
|
17267
|
-
const
|
|
17268
|
-
|
|
17281
|
+
const v = document.getElementById(d.split(/\s+/)[0]);
|
|
17282
|
+
v && (u = (b = v.textContent) == null ? void 0 : b.trim());
|
|
17269
17283
|
}
|
|
17270
17284
|
const h = e.getAttribute("id");
|
|
17271
17285
|
if (!u && h)
|
|
17272
17286
|
try {
|
|
17273
|
-
const
|
|
17274
|
-
|
|
17287
|
+
const v = document.querySelector(`label[for="${CSS.escape(h)}"]`);
|
|
17288
|
+
v && (u = (y = v.textContent) == null ? void 0 : y.trim().replace(/\*$/, "").trim());
|
|
17275
17289
|
} catch {
|
|
17276
17290
|
}
|
|
17277
17291
|
if (!u) {
|
|
17278
|
-
const
|
|
17279
|
-
if (
|
|
17280
|
-
const w =
|
|
17292
|
+
const v = e.closest('.MuiFormControl-root, fieldset, [class*="form-group"], [class*="form-field"], [class*="field-wrapper"]');
|
|
17293
|
+
if (v) {
|
|
17294
|
+
const w = v.querySelector(":scope > label, :scope > .MuiFormLabel-root, :scope > div > label");
|
|
17281
17295
|
if (w) {
|
|
17282
|
-
const x =
|
|
17296
|
+
const x = v.querySelectorAll('input, select, textarea, [role="combobox"]'), C = Array.from(x).some((D) => e.contains(D) || e === D);
|
|
17283
17297
|
(x.length === 1 || C) && (u = (m = w.textContent) == null ? void 0 : m.trim().replace(/\*$/, "").trim());
|
|
17284
17298
|
}
|
|
17285
17299
|
}
|
|
@@ -17297,7 +17311,7 @@ class kh {
|
|
|
17297
17311
|
}
|
|
17298
17312
|
class hc {
|
|
17299
17313
|
constructor() {
|
|
17300
|
-
|
|
17314
|
+
M(this, "loadingSelectors", [
|
|
17301
17315
|
'[role="progressbar"]',
|
|
17302
17316
|
".loading",
|
|
17303
17317
|
".spinner",
|
|
@@ -17310,6 +17324,8 @@ class hc {
|
|
|
17310
17324
|
".MuiCircularProgress-root",
|
|
17311
17325
|
".MuiLinearProgress-root"
|
|
17312
17326
|
]);
|
|
17327
|
+
/** Track last detected selector to avoid flooding logs on every 50ms poll */
|
|
17328
|
+
M(this, "_lastLoggedSelector", null);
|
|
17313
17329
|
}
|
|
17314
17330
|
/**
|
|
17315
17331
|
* Check if page is currently showing loading indicators
|
|
@@ -17319,10 +17335,10 @@ class hc {
|
|
|
17319
17335
|
try {
|
|
17320
17336
|
const t = document.querySelector(e);
|
|
17321
17337
|
if (t && this.isVisible(t))
|
|
17322
|
-
return console.log("[LoadingDetector] Found loading indicator:", e), !0;
|
|
17338
|
+
return this._lastLoggedSelector !== e && (console.log("[LoadingDetector] Found loading indicator:", e), this._lastLoggedSelector = e), !0;
|
|
17323
17339
|
} catch {
|
|
17324
17340
|
}
|
|
17325
|
-
return !1;
|
|
17341
|
+
return this._lastLoggedSelector = null, !1;
|
|
17326
17342
|
}
|
|
17327
17343
|
/**
|
|
17328
17344
|
* Wait for loading indicators to disappear
|
|
@@ -17381,15 +17397,15 @@ class xh {
|
|
|
17381
17397
|
}
|
|
17382
17398
|
class _h {
|
|
17383
17399
|
constructor() {
|
|
17384
|
-
|
|
17385
|
-
|
|
17386
|
-
|
|
17387
|
-
|
|
17388
|
-
|
|
17389
|
-
|
|
17390
|
-
|
|
17391
|
-
|
|
17392
|
-
|
|
17400
|
+
M(this, "lastUrl", "");
|
|
17401
|
+
M(this, "urlChangeCallback", null);
|
|
17402
|
+
M(this, "loadingDetector");
|
|
17403
|
+
M(this, "domStabilityChecker");
|
|
17404
|
+
M(this, "originalPushState", null);
|
|
17405
|
+
M(this, "originalReplaceState", null);
|
|
17406
|
+
M(this, "popstateHandler", null);
|
|
17407
|
+
M(this, "isStarted", !1);
|
|
17408
|
+
M(this, "handleUrlChange", async () => {
|
|
17393
17409
|
const e = window.location.href;
|
|
17394
17410
|
if (e !== this.lastUrl) {
|
|
17395
17411
|
console.log("[NavigationCompleteDetector] URL changed:", e), this.lastUrl = e;
|
|
@@ -17438,10 +17454,10 @@ class _h {
|
|
|
17438
17454
|
}
|
|
17439
17455
|
class Ch {
|
|
17440
17456
|
constructor(e, t) {
|
|
17441
|
-
|
|
17442
|
-
|
|
17443
|
-
|
|
17444
|
-
|
|
17457
|
+
M(this, "overlay");
|
|
17458
|
+
M(this, "loadingDetector");
|
|
17459
|
+
M(this, "domIntrospector", null);
|
|
17460
|
+
M(this, "isExecuting", !1);
|
|
17445
17461
|
this.overlay = e, this.loadingDetector = new hc();
|
|
17446
17462
|
}
|
|
17447
17463
|
/**
|
|
@@ -17513,23 +17529,45 @@ class Ch {
|
|
|
17513
17529
|
let i = null;
|
|
17514
17530
|
const o = 3, s = [300, 500, 800];
|
|
17515
17531
|
for (let g = 0; g <= o; g++)
|
|
17516
|
-
if (g > 0 && (console.log(`[BatchedActionExecutor] Retry ${g}/${o} in ${s[g - 1]}ms...`), await new Promise((
|
|
17517
|
-
const
|
|
17518
|
-
if (t && !
|
|
17519
|
-
|
|
17520
|
-
|
|
17521
|
-
|
|
17522
|
-
|
|
17532
|
+
if (g > 0 && (console.log(`[BatchedActionExecutor] Retry ${g}/${o} in ${s[g - 1]}ms...`), await new Promise((b) => setTimeout(b, s[g - 1]))), i = ue.resolveTarget(e.target), i) {
|
|
17533
|
+
const b = ((d = i.textContent) == null ? void 0 : d.trim().toLowerCase()) || "", y = i.tagName.toLowerCase();
|
|
17534
|
+
if (t && !b.includes(t))
|
|
17535
|
+
if (b.length >= 15 && // Must have enough chars to be meaningful
|
|
17536
|
+
t.startsWith(b) && b.length / t.length >= 0.3) {
|
|
17537
|
+
const v = Array.from(document.querySelectorAll(n || "*")).filter((w) => {
|
|
17538
|
+
var C;
|
|
17539
|
+
if (w === i) return !1;
|
|
17540
|
+
const x = ((C = w.textContent) == null ? void 0 : C.trim().toLowerCase()) || "";
|
|
17541
|
+
return x.length >= b.length && x.startsWith(b) && x !== b;
|
|
17542
|
+
});
|
|
17543
|
+
if (v.length > 0) {
|
|
17544
|
+
console.warn(
|
|
17545
|
+
`[BatchedActionExecutor] ⚠️ Truncated text match is ambiguous - ${v.length} other element(s) share the same prefix "${b.slice(0, 40)}..."`,
|
|
17546
|
+
v.map((w) => {
|
|
17547
|
+
var x;
|
|
17548
|
+
return `${w.tagName}: "${(x = w.textContent) == null ? void 0 : x.trim().slice(0, 60)}"`;
|
|
17549
|
+
})
|
|
17550
|
+
), i = null;
|
|
17551
|
+
continue;
|
|
17552
|
+
}
|
|
17553
|
+
console.log(
|
|
17554
|
+
`[BatchedActionExecutor] ✓ Accepting truncated text match (${b.length}/${t.length} chars, ${Math.round(b.length / t.length * 100)}% overlap)`
|
|
17555
|
+
);
|
|
17556
|
+
} else {
|
|
17557
|
+
console.warn(`[BatchedActionExecutor] ⚠️ Found element text "${b.slice(0, 50)}" doesn't match expected "${t}"`), i = null;
|
|
17558
|
+
continue;
|
|
17559
|
+
}
|
|
17560
|
+
n && y !== n && console.log(`[BatchedActionExecutor] Note: Found ${y} instead of expected ${n} (acceptable if it contains the text)`);
|
|
17523
17561
|
break;
|
|
17524
17562
|
}
|
|
17525
17563
|
if (!i) {
|
|
17526
17564
|
if (console.error("[BatchedActionExecutor] ❌ Could not find matching element after retries:", e.target), t) {
|
|
17527
|
-
const g = Array.from(document.querySelectorAll("*")).filter((
|
|
17528
|
-
var
|
|
17529
|
-
return (
|
|
17530
|
-
}).slice(0, 5).map((
|
|
17531
|
-
var
|
|
17532
|
-
return `${
|
|
17565
|
+
const g = Array.from(document.querySelectorAll("*")).filter((b) => {
|
|
17566
|
+
var y;
|
|
17567
|
+
return (y = b.textContent) == null ? void 0 : y.toLowerCase().includes(t);
|
|
17568
|
+
}).slice(0, 5).map((b) => {
|
|
17569
|
+
var y;
|
|
17570
|
+
return `${b.tagName.toLowerCase()}: "${(y = b.textContent) == null ? void 0 : y.trim().slice(0, 50)}"`;
|
|
17533
17571
|
});
|
|
17534
17572
|
g.length > 0 && console.log("[BatchedActionExecutor] Similar elements found:", g);
|
|
17535
17573
|
}
|
|
@@ -17600,77 +17638,78 @@ class Ch {
|
|
|
17600
17638
|
return !1;
|
|
17601
17639
|
}
|
|
17602
17640
|
}
|
|
17641
|
+
const Eh = 50, Th = 3e4;
|
|
17603
17642
|
class pc extends dh {
|
|
17604
17643
|
constructor(t) {
|
|
17605
17644
|
super();
|
|
17606
|
-
|
|
17607
|
-
|
|
17608
|
-
|
|
17609
|
-
|
|
17610
|
-
|
|
17611
|
-
|
|
17612
|
-
|
|
17613
|
-
|
|
17614
|
-
|
|
17615
|
-
|
|
17616
|
-
|
|
17617
|
-
|
|
17645
|
+
M(this, "config");
|
|
17646
|
+
M(this, "sessionId");
|
|
17647
|
+
M(this, "overlay");
|
|
17648
|
+
M(this, "capture");
|
|
17649
|
+
M(this, "actionExecutor");
|
|
17650
|
+
M(this, "pipecatClient", null);
|
|
17651
|
+
M(this, "transport", null);
|
|
17652
|
+
M(this, "isInitialized", !1);
|
|
17653
|
+
M(this, "reactRoot", null);
|
|
17654
|
+
M(this, "reactContainer", null);
|
|
17655
|
+
M(this, "agentState", "idle");
|
|
17656
|
+
M(this, "pausedSessionId", null);
|
|
17618
17657
|
// UI state only - tracks which session is paused
|
|
17619
|
-
|
|
17658
|
+
M(this, "pendingResumeSessionId", null);
|
|
17620
17659
|
// Explicit resume intent - set only by resumeSession(), cleared after use
|
|
17621
|
-
|
|
17622
|
-
|
|
17623
|
-
|
|
17624
|
-
|
|
17660
|
+
M(this, "botTranscript", "");
|
|
17661
|
+
M(this, "userTranscript", "");
|
|
17662
|
+
M(this, "transcriptHistory", []);
|
|
17663
|
+
M(this, "lastUserTranscript", "");
|
|
17625
17664
|
// Track final user transcript for history
|
|
17626
|
-
|
|
17627
|
-
|
|
17665
|
+
M(this, "isConnected", !1);
|
|
17666
|
+
M(this, "connectInFlight", !1);
|
|
17628
17667
|
// Guard against concurrent connect/cancel races
|
|
17629
|
-
|
|
17668
|
+
M(this, "micEnabled", !0);
|
|
17630
17669
|
// Track actual mute state
|
|
17631
|
-
|
|
17670
|
+
M(this, "userIsSpeaking", !1);
|
|
17632
17671
|
// Track if user is actively speaking
|
|
17633
|
-
|
|
17672
|
+
M(this, "botIsSpeaking", !1);
|
|
17634
17673
|
// Track if bot is actively speaking
|
|
17635
|
-
|
|
17674
|
+
M(this, "audioLevels", []);
|
|
17636
17675
|
// Real-time audio levels for visualization
|
|
17637
|
-
|
|
17676
|
+
M(this, "_discoveryPopupShown", !1);
|
|
17638
17677
|
// Track if discovery popup was shown this session
|
|
17639
|
-
|
|
17678
|
+
M(this, "_pendingDiscoveryStart", !1);
|
|
17640
17679
|
// User chose discovery, waiting to start after connect
|
|
17641
|
-
|
|
17680
|
+
M(this, "botAudioAnalyzer", null);
|
|
17642
17681
|
// Audio analyzer for bot FFT
|
|
17643
|
-
|
|
17682
|
+
M(this, "userAudioAnalyzer", null);
|
|
17644
17683
|
// Audio analyzer for user mic FFT
|
|
17645
|
-
|
|
17684
|
+
M(this, "userMicStream", null);
|
|
17646
17685
|
// User's mic stream for analysis
|
|
17647
|
-
|
|
17686
|
+
M(this, "userMicStreamRequestId", 0);
|
|
17648
17687
|
// Guards async getUserMedia against disconnect races
|
|
17649
|
-
|
|
17650
|
-
|
|
17651
|
-
|
|
17652
|
-
|
|
17653
|
-
|
|
17688
|
+
M(this, "audioElements", []);
|
|
17689
|
+
M(this, "pageTracker");
|
|
17690
|
+
M(this, "screenShareEnabled", !1);
|
|
17691
|
+
M(this, "domIntrospector");
|
|
17692
|
+
M(this, "accessibleSnapshot");
|
|
17654
17693
|
// Fast Execution System
|
|
17655
|
-
|
|
17656
|
-
|
|
17657
|
-
|
|
17694
|
+
M(this, "fastExecutionMode", !1);
|
|
17695
|
+
M(this, "batchedActionExecutor", null);
|
|
17696
|
+
M(this, "navigationCompleteDetector", null);
|
|
17658
17697
|
// Bot Action Tracking - counter for nested/concurrent bot actions
|
|
17659
17698
|
// Use counter instead of boolean to handle nested actions correctly
|
|
17660
|
-
|
|
17699
|
+
M(this, "_botActionDepth", 0);
|
|
17661
17700
|
// EndUser status from API (for skip onboarding logic)
|
|
17662
|
-
|
|
17701
|
+
M(this, "endUserStatus", null);
|
|
17663
17702
|
// UX Polish - Connection progress and returning user tracking
|
|
17664
|
-
|
|
17665
|
-
|
|
17703
|
+
M(this, "connectionProgress", null);
|
|
17704
|
+
M(this, "isReturningUser", !1);
|
|
17666
17705
|
// True only for actual returning users (detected via API or localStorage)
|
|
17667
|
-
|
|
17706
|
+
M(this, "hasSkippedOnboarding", !1);
|
|
17668
17707
|
// True when new user skips the welcome modal
|
|
17669
|
-
|
|
17708
|
+
M(this, "_isMinimized", !1);
|
|
17670
17709
|
// Text mode state
|
|
17671
|
-
|
|
17710
|
+
M(this, "textModeEnabled", !1);
|
|
17672
17711
|
// Plan progress state (sent from bot during guided plan execution)
|
|
17673
|
-
|
|
17712
|
+
M(this, "planProgress", null);
|
|
17674
17713
|
if (!t.clientKey)
|
|
17675
17714
|
throw new Error("Client key is required");
|
|
17676
17715
|
const n = "https://api.dev.floe.so";
|
|
@@ -18066,7 +18105,9 @@ class pc extends dh {
|
|
|
18066
18105
|
}, 500));
|
|
18067
18106
|
},
|
|
18068
18107
|
onUserTranscript: (t) => {
|
|
18069
|
-
console.log("[OnboardingSDK] 🎤 User transcript:", t.text, t.final ? "(final)" : "(interim)"), t.text && (this.userTranscript = t.text), t.final && t.text && (this.lastUserTranscript = t.text), this.emit("userTranscript", t), this.handleUserInput(t.text)
|
|
18108
|
+
console.log("[OnboardingSDK] 🎤 User transcript:", t.text, t.final ? "(final)" : "(interim)"), t.text && (this.userTranscript = t.text), t.final && t.text && (this.lastUserTranscript = t.text), this.emit("userTranscript", t), this.handleUserInput(t.text).catch((n) => {
|
|
18109
|
+
console.warn("[OnboardingSDK] Context capture failed:", n == null ? void 0 : n.message);
|
|
18110
|
+
}), this.renderReactUI();
|
|
18070
18111
|
},
|
|
18071
18112
|
onBotTtsText: (t) => {
|
|
18072
18113
|
this.textModeEnabled || (console.log("[OnboardingSDK] 🤖 Bot TTS text:", t.text), t.text && (this.botTranscript && !this.botTranscript.endsWith(" ") && !t.text.startsWith(" ") && (this.botTranscript += " "), this.botTranscript += t.text, this.renderReactUI()));
|
|
@@ -18083,7 +18124,7 @@ class pc extends dh {
|
|
|
18083
18124
|
role: "assistant",
|
|
18084
18125
|
content: this.botTranscript,
|
|
18085
18126
|
timestamp: Date.now()
|
|
18086
|
-
}), console.log("[OnboardingSDK] 📝 Added assistant message to history (text mode):", this.botTranscript.substring(0, 50) + "...")), this.botTranscript = "", this.renderReactUI());
|
|
18127
|
+
}), this.pruneTranscriptHistory(), console.log("[OnboardingSDK] 📝 Added assistant message to history (text mode):", this.botTranscript.substring(0, 50) + "...")), this.botTranscript = "", this.renderReactUI());
|
|
18087
18128
|
},
|
|
18088
18129
|
onUserStartedSpeaking: () => {
|
|
18089
18130
|
console.log("[OnboardingSDK] 🎤 User started speaking"), this.agentState = "listening", this.userIsSpeaking = !0, this.renderReactUI(), this.emit("userSpeaking", !0);
|
|
@@ -18094,7 +18135,7 @@ class pc extends dh {
|
|
|
18094
18135
|
role: "user",
|
|
18095
18136
|
content: this.lastUserTranscript,
|
|
18096
18137
|
timestamp: Date.now()
|
|
18097
|
-
}), console.log("[OnboardingSDK] 📝 Added user message to history:", this.lastUserTranscript), this.lastUserTranscript = ""), this.userTranscript = "", this.renderReactUI(), this.emit("userSpeaking", !1);
|
|
18138
|
+
}), this.pruneTranscriptHistory(), console.log("[OnboardingSDK] 📝 Added user message to history:", this.lastUserTranscript), this.lastUserTranscript = ""), this.userTranscript = "", this.renderReactUI(), this.emit("userSpeaking", !1);
|
|
18098
18139
|
},
|
|
18099
18140
|
onBotStartedSpeaking: () => {
|
|
18100
18141
|
console.log("[OnboardingSDK] 🔊 Bot started speaking"), this.agentState = "speaking", this.botIsSpeaking = !0, this.userTranscript = "", this.botTranscript = "", this.renderReactUI(), this.emit("botSpeaking", !0);
|
|
@@ -18105,7 +18146,7 @@ class pc extends dh {
|
|
|
18105
18146
|
role: "assistant",
|
|
18106
18147
|
content: this.botTranscript,
|
|
18107
18148
|
timestamp: Date.now()
|
|
18108
|
-
}), console.log("[OnboardingSDK] 📝 Added assistant message to history:", this.botTranscript.substring(0, 50) + "...")), this.botTranscript = "", this.renderReactUI(), this.emit("botSpeaking", !1);
|
|
18149
|
+
}), this.pruneTranscriptHistory(), console.log("[OnboardingSDK] 📝 Added assistant message to history:", this.botTranscript.substring(0, 50) + "...")), this.botTranscript = "", this.renderReactUI(), this.emit("botSpeaking", !1);
|
|
18109
18150
|
},
|
|
18110
18151
|
onServerMessage: (t) => {
|
|
18111
18152
|
console.log("[OnboardingSDK] Server message:", t), this.handleServerMessage(t);
|
|
@@ -18194,6 +18235,24 @@ class pc extends dh {
|
|
|
18194
18235
|
* Handle server messages from bot (via Pipecat ServerMessage events)
|
|
18195
18236
|
* Supports both legacy selector-based commands and new hybrid target format
|
|
18196
18237
|
*
|
|
18238
|
+
/**
|
|
18239
|
+
* Prune transcript history to stay within the configured cap.
|
|
18240
|
+
* When the cap is reached:
|
|
18241
|
+
* 1. Merge rapid sequential same-role messages within MERGE_WINDOW_MS
|
|
18242
|
+
* 2. If still over cap, keep the most recent messages
|
|
18243
|
+
*/
|
|
18244
|
+
pruneTranscriptHistory() {
|
|
18245
|
+
const t = this.config.maxTranscriptMessages ?? Eh;
|
|
18246
|
+
if (this.transcriptHistory.length <= t)
|
|
18247
|
+
return;
|
|
18248
|
+
const n = [];
|
|
18249
|
+
for (let i = 0; i < this.transcriptHistory.length; i++) {
|
|
18250
|
+
const o = this.transcriptHistory[i], s = n[n.length - 1];
|
|
18251
|
+
s && s.role === o.role && o.timestamp - s.timestamp < Th ? (s.content = s.content + " " + o.content, s.timestamp = o.timestamp) : n.push({ ...o });
|
|
18252
|
+
}
|
|
18253
|
+
n.length > t ? this.transcriptHistory = n.slice(-t) : this.transcriptHistory = n;
|
|
18254
|
+
}
|
|
18255
|
+
/**
|
|
18197
18256
|
* Message formats supported:
|
|
18198
18257
|
* 1. RTVIServerMessageFrame: { data: { type: 'ui_action', action: '...', target: {...} } }
|
|
18199
18258
|
* 2. Direct ui_action: { type: 'ui_action', action: '...', target: {...} }
|
|
@@ -18267,14 +18326,14 @@ class pc extends dh {
|
|
|
18267
18326
|
break;
|
|
18268
18327
|
}
|
|
18269
18328
|
ue.scrollIntoView(o), setTimeout(async () => {
|
|
18270
|
-
var g,
|
|
18329
|
+
var g, b;
|
|
18271
18330
|
const a = this.findCollapsedSidebar(o);
|
|
18272
18331
|
if (a) {
|
|
18273
18332
|
console.log("[OnboardingSDK] 🔍 Element is in collapsed sidebar, expanding first...");
|
|
18274
|
-
const
|
|
18333
|
+
const y = a.getBoundingClientRect();
|
|
18275
18334
|
await this.overlay.animateFloeCursorTo(
|
|
18276
|
-
|
|
18277
|
-
|
|
18335
|
+
y.left + y.width / 2,
|
|
18336
|
+
y.top + y.height / 3,
|
|
18278
18337
|
400
|
|
18279
18338
|
), a.dispatchEvent(new MouseEvent("mouseenter", { bubbles: !0 })), a.dispatchEvent(new MouseEvent("mouseover", { bubbles: !0 })), await new Promise((m) => setTimeout(m, 450)), console.log("[OnboardingSDK] 📂 Sidebar expanded");
|
|
18280
18339
|
}
|
|
@@ -18290,7 +18349,7 @@ class pc extends dh {
|
|
|
18290
18349
|
return;
|
|
18291
18350
|
}
|
|
18292
18351
|
const u = ue.reResolveAndVerify(t.target, o);
|
|
18293
|
-
u ? (o = u, console.log("[OnboardingSDK] 🔄 Re-resolved element after stability wait")) : console.warn("[OnboardingSDK] ⚠️ Could not re-resolve element, using original"), await this.overlay.moveToElementAndClick(o), await new Promise((
|
|
18352
|
+
u ? (o = u, console.log("[OnboardingSDK] 🔄 Re-resolved element after stability wait")) : console.warn("[OnboardingSDK] ⚠️ Could not re-resolve element, using original"), await this.overlay.moveToElementAndClick(o), await new Promise((y) => setTimeout(y, 150)), this._botActionDepth++;
|
|
18294
18353
|
const d = {
|
|
18295
18354
|
...t,
|
|
18296
18355
|
target: {
|
|
@@ -18304,7 +18363,7 @@ class pc extends dh {
|
|
|
18304
18363
|
// EXCLUDE: domIndex, boundingBox, confidence - stale after page changes
|
|
18305
18364
|
// Cast to handle server-sent strategy values that may include position-dependent types
|
|
18306
18365
|
strategy: (g = t.target.strategy) == null ? void 0 : g.filter(
|
|
18307
|
-
(
|
|
18366
|
+
(y) => y !== "boundingBox" && y !== "domIndex"
|
|
18308
18367
|
)
|
|
18309
18368
|
}
|
|
18310
18369
|
};
|
|
@@ -18316,16 +18375,16 @@ class pc extends dh {
|
|
|
18316
18375
|
}
|
|
18317
18376
|
if (h) {
|
|
18318
18377
|
console.log("[OnboardingSDK] ✅ Click executed successfully");
|
|
18319
|
-
const
|
|
18378
|
+
const y = (t.target.text || "").toLowerCase().trim(), m = ((b = o == null ? void 0 : o.textContent) == null ? void 0 : b.toLowerCase().trim()) || "", v = (o == null ? void 0 : o.tagName.toLowerCase()) || "unknown";
|
|
18320
18379
|
let w = !1, x = "";
|
|
18321
|
-
|
|
18380
|
+
y && m && !m.includes(y) && !y.includes(m) && (w = !0, x = `Expected "${t.target.text}", but clicked "${m.slice(0, 50)}"`, console.error(`[OnboardingSDK] ❌ CLICK MISMATCH: ${x}`)), this.domIntrospector && (await new Promise((C) => setTimeout(C, 150)), this.domIntrospector.captureAndSendImmediate("post-bot-click"), console.log("[OnboardingSDK] 📸 DOM snapshot sent after bot click")), this.sendMetadata({
|
|
18322
18381
|
type: "bot_action_complete",
|
|
18323
18382
|
action: "click",
|
|
18324
18383
|
success: !w,
|
|
18325
18384
|
// Mark as failure if mismatch detected
|
|
18326
18385
|
target: t.target.text || t.target.selector || "unknown",
|
|
18327
18386
|
actualClicked: w ? m.slice(0, 100) : void 0,
|
|
18328
|
-
clickedTag:
|
|
18387
|
+
clickedTag: v,
|
|
18329
18388
|
mismatch: w,
|
|
18330
18389
|
mismatchDetails: x || void 0,
|
|
18331
18390
|
previousUrl: i,
|
|
@@ -18335,17 +18394,17 @@ class pc extends dh {
|
|
|
18335
18394
|
timestamp: Date.now()
|
|
18336
18395
|
}), w ? console.warn("[OnboardingSDK] ⚠️ Click mismatch reported to server") : console.log("[OnboardingSDK] 📤 Sent bot_action_complete for auto-advance");
|
|
18337
18396
|
} else {
|
|
18338
|
-
const
|
|
18339
|
-
console.warn("[OnboardingSDK] ⚠️ Click action failed:",
|
|
18397
|
+
const y = this.actionExecutor.lastError || "unknown";
|
|
18398
|
+
console.warn("[OnboardingSDK] ⚠️ Click action failed:", y), this.sendMetadata({
|
|
18340
18399
|
type: "bot_action_complete",
|
|
18341
18400
|
action: "click",
|
|
18342
18401
|
success: !1,
|
|
18343
18402
|
target: t.target.text || t.target.selector || "unknown",
|
|
18344
|
-
error:
|
|
18403
|
+
error: y,
|
|
18345
18404
|
timestamp: Date.now()
|
|
18346
18405
|
});
|
|
18347
18406
|
}
|
|
18348
|
-
await new Promise((
|
|
18407
|
+
await new Promise((y) => setTimeout(y, 100)), setTimeout(() => {
|
|
18349
18408
|
this.overlay.cleanup();
|
|
18350
18409
|
}, 800);
|
|
18351
18410
|
}, 350);
|
|
@@ -18449,23 +18508,23 @@ class pc extends dh {
|
|
|
18449
18508
|
beacon: !0
|
|
18450
18509
|
};
|
|
18451
18510
|
try {
|
|
18452
|
-
const
|
|
18453
|
-
|
|
18454
|
-
`${
|
|
18511
|
+
const v = this.config.apiUrl || "";
|
|
18512
|
+
v && navigator.sendBeacon && navigator.sendBeacon(
|
|
18513
|
+
`${v}/api/v1/events/beacon`,
|
|
18455
18514
|
new Blob([JSON.stringify(m)], { type: "application/json" })
|
|
18456
18515
|
);
|
|
18457
18516
|
} catch {
|
|
18458
18517
|
}
|
|
18459
18518
|
};
|
|
18460
18519
|
window.addEventListener("pagehide", g, { once: !0 });
|
|
18461
|
-
let
|
|
18520
|
+
let b = !1;
|
|
18462
18521
|
try {
|
|
18463
18522
|
const m = new URL(c).pathname + new URL(c).search + new URL(c).hash;
|
|
18464
|
-
history.pushState(null, "", m), window.dispatchEvent(new PopStateEvent("popstate", { state: null })),
|
|
18523
|
+
history.pushState(null, "", m), window.dispatchEvent(new PopStateEvent("popstate", { state: null })), b = !0;
|
|
18465
18524
|
} catch {
|
|
18466
18525
|
}
|
|
18467
|
-
|
|
18468
|
-
const
|
|
18526
|
+
b || (window.location.href = c);
|
|
18527
|
+
const y = await this.waitForNavigation(c, 1e4);
|
|
18469
18528
|
window.removeEventListener("pagehide", g);
|
|
18470
18529
|
try {
|
|
18471
18530
|
sessionStorage.removeItem("floe_pending_navigation");
|
|
@@ -18475,10 +18534,10 @@ class pc extends dh {
|
|
|
18475
18534
|
type: "bot_action_complete",
|
|
18476
18535
|
action: "navigate",
|
|
18477
18536
|
target: Vn(c),
|
|
18478
|
-
success:
|
|
18537
|
+
success: y,
|
|
18479
18538
|
previousUrl: Vn(u),
|
|
18480
18539
|
currentUrl: ut(),
|
|
18481
|
-
...
|
|
18540
|
+
...y ? {} : { error: "Navigation timed out waiting for URL change" },
|
|
18482
18541
|
timestamp: d
|
|
18483
18542
|
});
|
|
18484
18543
|
}
|
|
@@ -18506,7 +18565,7 @@ class pc extends dh {
|
|
|
18506
18565
|
a = new URL(t);
|
|
18507
18566
|
} catch {
|
|
18508
18567
|
return console.warn("[OnboardingSDK] ⚠️ waitForNavigation: could not parse expectedUrl, using exact match"), new Promise((g) => {
|
|
18509
|
-
const
|
|
18568
|
+
const b = () => {
|
|
18510
18569
|
if (window.location.href === t) {
|
|
18511
18570
|
g(!0);
|
|
18512
18571
|
return;
|
|
@@ -18515,15 +18574,15 @@ class pc extends dh {
|
|
|
18515
18574
|
g(!1);
|
|
18516
18575
|
return;
|
|
18517
18576
|
}
|
|
18518
|
-
setTimeout(
|
|
18577
|
+
setTimeout(b, o);
|
|
18519
18578
|
};
|
|
18520
|
-
|
|
18579
|
+
b();
|
|
18521
18580
|
});
|
|
18522
18581
|
}
|
|
18523
18582
|
const c = a.origin, u = s(a.pathname), d = a.search, h = a.hash;
|
|
18524
18583
|
return new Promise((g) => {
|
|
18525
|
-
const
|
|
18526
|
-
const
|
|
18584
|
+
const b = () => {
|
|
18585
|
+
const y = Date.now() - i;
|
|
18527
18586
|
try {
|
|
18528
18587
|
const m = new URL(window.location.href);
|
|
18529
18588
|
if (m.origin === c && s(m.pathname) === u && (!d || m.search === d) && (!h || m.hash === h)) {
|
|
@@ -18532,13 +18591,13 @@ class pc extends dh {
|
|
|
18532
18591
|
}
|
|
18533
18592
|
} catch {
|
|
18534
18593
|
}
|
|
18535
|
-
if (
|
|
18594
|
+
if (y >= n) {
|
|
18536
18595
|
console.warn(`[OnboardingSDK] ⏱️ Navigation timeout after ${n}ms. Current: ${window.location.href}, Expected: ${t}`), g(!1);
|
|
18537
18596
|
return;
|
|
18538
18597
|
}
|
|
18539
|
-
setTimeout(
|
|
18598
|
+
setTimeout(b, o);
|
|
18540
18599
|
};
|
|
18541
|
-
|
|
18600
|
+
b();
|
|
18542
18601
|
});
|
|
18543
18602
|
}
|
|
18544
18603
|
/**
|
|
@@ -18758,14 +18817,14 @@ class pc extends dh {
|
|
|
18758
18817
|
else {
|
|
18759
18818
|
this._botActionDepth++;
|
|
18760
18819
|
try {
|
|
18761
|
-
const g = d.getBoundingClientRect(),
|
|
18820
|
+
const g = d.getBoundingClientRect(), b = g.left + g.width / 2, y = g.top + g.height / 2, m = {
|
|
18762
18821
|
bubbles: !0,
|
|
18763
18822
|
cancelable: !0,
|
|
18764
18823
|
view: window,
|
|
18765
|
-
clientX:
|
|
18766
|
-
clientY:
|
|
18824
|
+
clientX: b,
|
|
18825
|
+
clientY: y
|
|
18767
18826
|
};
|
|
18768
|
-
d.dispatchEvent(new MouseEvent("mousedown", m)), d.dispatchEvent(new MouseEvent("mouseup", m)), d.dispatchEvent(new MouseEvent("click", m)), await new Promise((
|
|
18827
|
+
d.dispatchEvent(new MouseEvent("mousedown", m)), d.dispatchEvent(new MouseEvent("mouseup", m)), d.dispatchEvent(new MouseEvent("click", m)), await new Promise((v) => setTimeout(v, 200)), o.push(u), console.log(`[OnboardingSDK] ✅ Selected: "${u}"`);
|
|
18769
18828
|
} finally {
|
|
18770
18829
|
this._botActionDepth--;
|
|
18771
18830
|
}
|
|
@@ -18842,13 +18901,13 @@ class pc extends dh {
|
|
|
18842
18901
|
console.log("[OnboardingSDK] ⚠️ Typing to filter did not reveal the option");
|
|
18843
18902
|
}
|
|
18844
18903
|
if (!o) {
|
|
18845
|
-
ue.scrollIntoView(s), await new Promise((
|
|
18904
|
+
ue.scrollIntoView(s), await new Promise((b) => setTimeout(b, 200)), await this.overlay.moveToElementAndClick(s), console.log("[OnboardingSDK] 📂 Opening dropdown..."), this._botActionDepth++;
|
|
18846
18905
|
try {
|
|
18847
18906
|
this.actionExecutor.openDropdown(s);
|
|
18848
18907
|
} finally {
|
|
18849
18908
|
this._botActionDepth--;
|
|
18850
18909
|
}
|
|
18851
|
-
if (await new Promise((
|
|
18910
|
+
if (await new Promise((b) => setTimeout(b, 300)), i = this.findVisibleDropdownOption(n), i) {
|
|
18852
18911
|
console.log("[OnboardingSDK] ✅ Option visible after opening dropdown"), await this.clickDropdownOption(i, t);
|
|
18853
18912
|
return;
|
|
18854
18913
|
}
|
|
@@ -18874,9 +18933,9 @@ class pc extends dh {
|
|
|
18874
18933
|
}
|
|
18875
18934
|
if (!i) {
|
|
18876
18935
|
console.error("[OnboardingSDK] ❌ All strategies failed for option:", n);
|
|
18877
|
-
const h = document.querySelectorAll('[role="option"], [class*="option"], nz-option-item, .ant-select-item-option'), g = Array.from(h).slice(0, 10).map((
|
|
18878
|
-
var
|
|
18879
|
-
return (
|
|
18936
|
+
const h = document.querySelectorAll('[role="option"], [class*="option"], nz-option-item, .ant-select-item-option'), g = Array.from(h).slice(0, 10).map((b) => {
|
|
18937
|
+
var y;
|
|
18938
|
+
return (y = b.textContent) == null ? void 0 : y.trim().slice(0, 50);
|
|
18880
18939
|
}).filter(Boolean);
|
|
18881
18940
|
g.length > 0 ? console.log("[OnboardingSDK] Available options:", g) : console.log("[OnboardingSDK] No options visible - dropdown may not have opened"), this.sendMetadata({
|
|
18882
18941
|
type: "bot_action_complete",
|
|
@@ -18956,11 +19015,11 @@ class pc extends dh {
|
|
|
18956
19015
|
continue;
|
|
18957
19016
|
}
|
|
18958
19017
|
console.log(`[OnboardingSDK] Found scrollable container (${s}), scrollHeight: ${u.scrollHeight}, clientHeight: ${u.clientHeight}, overflow-y: ${d}`);
|
|
18959
|
-
const h = 150, g = Math.ceil(u.scrollHeight / h) + 2,
|
|
18960
|
-
for (let
|
|
18961
|
-
u.scrollTop =
|
|
18962
|
-
const
|
|
18963
|
-
for (const w of
|
|
19018
|
+
const h = 150, g = Math.ceil(u.scrollHeight / h) + 2, b = u.scrollTop;
|
|
19019
|
+
for (let y = 0; y < g; y++) {
|
|
19020
|
+
u.scrollTop = y * h, await new Promise((w) => setTimeout(w, 120));
|
|
19021
|
+
const v = u.querySelectorAll('[role="option"], [class*="option"]:not([class*="singleValue"]), nz-option-item, .ant-select-item-option, .ant-select-item');
|
|
19022
|
+
for (const w of v) {
|
|
18964
19023
|
const x = w, C = x.getBoundingClientRect();
|
|
18965
19024
|
if (C.height === 0 || C.width === 0) continue;
|
|
18966
19025
|
const D = ((o = x.textContent) == null ? void 0 : o.trim().toLowerCase()) || "";
|
|
@@ -18968,7 +19027,7 @@ class pc extends dh {
|
|
|
18968
19027
|
return console.log(`[OnboardingSDK] ✅ Found option after scrolling to position ${u.scrollTop}: "${t}"`), x.scrollIntoView({ block: "center" }), await new Promise((P) => setTimeout(P, 100)), x;
|
|
18969
19028
|
}
|
|
18970
19029
|
}
|
|
18971
|
-
u.scrollTop =
|
|
19030
|
+
u.scrollTop = b;
|
|
18972
19031
|
}
|
|
18973
19032
|
}
|
|
18974
19033
|
return console.log(`[OnboardingSDK] Option not found after scrolling: "${t}"`), null;
|
|
@@ -19152,23 +19211,23 @@ class pc extends dh {
|
|
|
19152
19211
|
if (u === n || u.includes(n)) {
|
|
19153
19212
|
const d = c;
|
|
19154
19213
|
if (d.tagName === "LABEL" && d.htmlFor) {
|
|
19155
|
-
const
|
|
19156
|
-
if (
|
|
19157
|
-
return this.getClickableDropdownContainer(
|
|
19214
|
+
const b = document.getElementById(d.htmlFor);
|
|
19215
|
+
if (b)
|
|
19216
|
+
return this.getClickableDropdownContainer(b);
|
|
19158
19217
|
}
|
|
19159
19218
|
const h = d.id;
|
|
19160
19219
|
if (h) {
|
|
19161
|
-
const
|
|
19162
|
-
if (
|
|
19163
|
-
return this.getClickableDropdownContainer(
|
|
19220
|
+
const b = document.querySelector(`[aria-labelledby="${h}"]`);
|
|
19221
|
+
if (b)
|
|
19222
|
+
return this.getClickableDropdownContainer(b);
|
|
19164
19223
|
}
|
|
19165
19224
|
const g = d.closest('[class*="field"], [class*="form-group"], [class*="FormControl"]') || d.parentElement;
|
|
19166
19225
|
if (g) {
|
|
19167
|
-
const
|
|
19226
|
+
const b = g.querySelector(
|
|
19168
19227
|
'input[role="combobox"], select, [aria-haspopup="listbox"], [class*="control"]'
|
|
19169
19228
|
);
|
|
19170
|
-
if (
|
|
19171
|
-
return this.getClickableDropdownContainer(
|
|
19229
|
+
if (b)
|
|
19230
|
+
return this.getClickableDropdownContainer(b);
|
|
19172
19231
|
}
|
|
19173
19232
|
}
|
|
19174
19233
|
}
|
|
@@ -19271,7 +19330,7 @@ class pc extends dh {
|
|
|
19271
19330
|
* then reports the result back to the bot.
|
|
19272
19331
|
*/
|
|
19273
19332
|
async handleExecuteApi(t) {
|
|
19274
|
-
var
|
|
19333
|
+
var b;
|
|
19275
19334
|
console.log("[OnboardingSDK] 🔌 Executing API call:", t.method, t.url);
|
|
19276
19335
|
const {
|
|
19277
19336
|
method: n = "GET",
|
|
@@ -19285,16 +19344,16 @@ class pc extends dh {
|
|
|
19285
19344
|
} = t;
|
|
19286
19345
|
let h = i;
|
|
19287
19346
|
if (o && (h = `${o.replace(/\/$/, "")}/${i.replace(/^\//, "")}`), a && n === "GET") {
|
|
19288
|
-
const
|
|
19289
|
-
h = `${h}?${
|
|
19347
|
+
const y = new URLSearchParams(a);
|
|
19348
|
+
h = `${h}?${y.toString()}`;
|
|
19290
19349
|
}
|
|
19291
19350
|
try {
|
|
19292
|
-
const
|
|
19293
|
-
if (
|
|
19294
|
-
console.error("[OnboardingSDK] ❌ Cross-origin API request blocked:",
|
|
19351
|
+
const y = new URL(h, window.location.href);
|
|
19352
|
+
if (y.origin !== window.location.origin) {
|
|
19353
|
+
console.error("[OnboardingSDK] ❌ Cross-origin API request blocked:", y.origin), this.sendMetadata({
|
|
19295
19354
|
type: "api_execution_result",
|
|
19296
19355
|
success: !1,
|
|
19297
|
-
error: `Cross-origin request blocked: ${
|
|
19356
|
+
error: `Cross-origin request blocked: ${y.origin} does not match ${window.location.origin}`,
|
|
19298
19357
|
url: h,
|
|
19299
19358
|
method: n,
|
|
19300
19359
|
timestamp: Date.now()
|
|
@@ -19324,7 +19383,7 @@ class pc extends dh {
|
|
|
19324
19383
|
return;
|
|
19325
19384
|
}
|
|
19326
19385
|
try {
|
|
19327
|
-
const
|
|
19386
|
+
const y = {
|
|
19328
19387
|
method: n.toUpperCase(),
|
|
19329
19388
|
headers: {
|
|
19330
19389
|
"Content-Type": "application/json",
|
|
@@ -19333,34 +19392,34 @@ class pc extends dh {
|
|
|
19333
19392
|
credentials: "include"
|
|
19334
19393
|
// Safe — same-origin validated above
|
|
19335
19394
|
};
|
|
19336
|
-
s && n !== "GET" && (
|
|
19337
|
-
const m = await fetch(h,
|
|
19338
|
-
let
|
|
19395
|
+
s && n !== "GET" && (y.body = JSON.stringify(s)), console.log("[OnboardingSDK] 📤 Making API request:", h);
|
|
19396
|
+
const m = await fetch(h, y);
|
|
19397
|
+
let v;
|
|
19339
19398
|
const w = await m.text();
|
|
19340
19399
|
try {
|
|
19341
|
-
|
|
19400
|
+
v = JSON.parse(w);
|
|
19342
19401
|
} catch {
|
|
19343
|
-
|
|
19402
|
+
v = { raw: w };
|
|
19344
19403
|
}
|
|
19345
|
-
console.log("[OnboardingSDK] 📥 API response:", m.status,
|
|
19346
|
-
const x = m.ok && this.evaluateJsonPathCondition(
|
|
19404
|
+
console.log("[OnboardingSDK] 📥 API response:", m.status, v);
|
|
19405
|
+
const x = m.ok && this.evaluateJsonPathCondition(v, c), C = this.extractJsonPath(v, u);
|
|
19347
19406
|
let D;
|
|
19348
|
-
x || (D = this.extractJsonPath(
|
|
19407
|
+
x || (D = this.extractJsonPath(v, d) || ((b = v.error) == null ? void 0 : b.message) || v.message || `Request failed with status ${m.status}`), this.sendMetadata({
|
|
19349
19408
|
type: "api_execution_result",
|
|
19350
19409
|
success: x,
|
|
19351
19410
|
status_code: m.status,
|
|
19352
|
-
data:
|
|
19411
|
+
data: v,
|
|
19353
19412
|
result_text: C,
|
|
19354
19413
|
error: D,
|
|
19355
19414
|
url: h,
|
|
19356
19415
|
method: n,
|
|
19357
19416
|
timestamp: Date.now()
|
|
19358
19417
|
}), console.log(`[OnboardingSDK] ${x ? "✅" : "❌"} API execution ${x ? "succeeded" : "failed"}:`, C || D);
|
|
19359
|
-
} catch (
|
|
19360
|
-
console.error("[OnboardingSDK] ❌ API execution error:",
|
|
19418
|
+
} catch (y) {
|
|
19419
|
+
console.error("[OnboardingSDK] ❌ API execution error:", y), this.sendMetadata({
|
|
19361
19420
|
type: "api_execution_result",
|
|
19362
19421
|
success: !1,
|
|
19363
|
-
error:
|
|
19422
|
+
error: y instanceof Error ? y.message : "Unknown error",
|
|
19364
19423
|
url: h,
|
|
19365
19424
|
method: n,
|
|
19366
19425
|
timestamp: Date.now()
|
|
@@ -19617,7 +19676,7 @@ class pc extends dh {
|
|
|
19617
19676
|
role: "user",
|
|
19618
19677
|
content: t.trim(),
|
|
19619
19678
|
timestamp: Date.now()
|
|
19620
|
-
}), this.renderReactUI(), this.pipecatClient && this.isConnected && this.pipecatClient.sendClientMessage("text_message", {
|
|
19679
|
+
}), this.pruneTranscriptHistory(), this.renderReactUI(), this.pipecatClient && this.isConnected && this.pipecatClient.sendClientMessage("text_message", {
|
|
19621
19680
|
text: t.trim(),
|
|
19622
19681
|
audio_response: !this.textModeEnabled
|
|
19623
19682
|
// Voice response only if NOT in text mode
|
|
@@ -20010,7 +20069,7 @@ class pc extends dh {
|
|
|
20010
20069
|
}
|
|
20011
20070
|
}
|
|
20012
20071
|
typeof window < "u" && (window.OnboardingSDK = pc);
|
|
20013
|
-
function
|
|
20072
|
+
function Mh(r) {
|
|
20014
20073
|
return {
|
|
20015
20074
|
clientKey: r.clientKey,
|
|
20016
20075
|
// Only include apiUrl if explicitly provided - this allows the SDK constructor
|
|
@@ -20038,16 +20097,16 @@ function Eh(r) {
|
|
|
20038
20097
|
} : void 0
|
|
20039
20098
|
};
|
|
20040
20099
|
}
|
|
20041
|
-
function
|
|
20100
|
+
function Ah(r) {
|
|
20042
20101
|
if (!r.clientKey)
|
|
20043
20102
|
throw new Error("[Floe] clientKey is required");
|
|
20044
|
-
const e =
|
|
20103
|
+
const e = Mh(r), t = new pc(e);
|
|
20045
20104
|
return t.ready = t.init().catch((n) => {
|
|
20046
20105
|
throw console.error("[Floe] Initialization failed:", n), n;
|
|
20047
20106
|
}), t;
|
|
20048
20107
|
}
|
|
20049
|
-
typeof window < "u" && (window.Floe =
|
|
20108
|
+
typeof window < "u" && (window.Floe = Ah);
|
|
20050
20109
|
export {
|
|
20051
|
-
|
|
20110
|
+
Ah as Floe
|
|
20052
20111
|
};
|
|
20053
20112
|
//# sourceMappingURL=floe-sdk.es.js.map
|