@floe-ai/sdk 0.1.0-dev.23 → 0.1.0-dev.25
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 +554 -359
- package/dist-sdk/floe-sdk.es.js.map +1 -1
- package/dist-sdk/floe-sdk.iife.js +31 -31
- package/dist-sdk/floe-sdk.iife.js.map +1 -1
- package/dist-sdk/floe-sdk.umd.js +31 -31
- package/dist-sdk/floe-sdk.umd.js.map +1 -1
- package/dist-sdk/index.d.ts +20 -0
- package/package.json +1 -1
package/dist-sdk/floe-sdk.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var fc = Object.defineProperty;
|
|
2
2
|
var gc = (r, e, t) => e in r ? fc(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
|
-
var
|
|
3
|
+
var A = (r, e, t) => gc(r, typeof e != "symbol" ? e + "" : e, t);
|
|
4
4
|
import $s, { useState as Ue, useEffect as Ye, useRef as wn, useCallback as We, useMemo as mc } from "react";
|
|
5
5
|
import bc from "react-dom/client";
|
|
6
6
|
import { jsx as T, jsxs as G, Fragment as fn } from "react/jsx-runtime";
|
|
@@ -21,21 +21,21 @@ function vc(r) {
|
|
|
21
21
|
var js = Number.isNaN || function(e) {
|
|
22
22
|
return e !== e;
|
|
23
23
|
};
|
|
24
|
-
function
|
|
25
|
-
|
|
24
|
+
function de() {
|
|
25
|
+
de.init.call(this);
|
|
26
26
|
}
|
|
27
|
-
di.exports =
|
|
27
|
+
di.exports = de;
|
|
28
28
|
di.exports.once = xc;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
de.EventEmitter = de;
|
|
30
|
+
de.prototype._events = void 0;
|
|
31
|
+
de.prototype._eventsCount = 0;
|
|
32
|
+
de.prototype._maxListeners = void 0;
|
|
33
33
|
var Ri = 10;
|
|
34
34
|
function sr(r) {
|
|
35
35
|
if (typeof r != "function")
|
|
36
36
|
throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof r);
|
|
37
37
|
}
|
|
38
|
-
Object.defineProperty(
|
|
38
|
+
Object.defineProperty(de, "defaultMaxListeners", {
|
|
39
39
|
enumerable: !0,
|
|
40
40
|
get: function() {
|
|
41
41
|
return Ri;
|
|
@@ -46,21 +46,21 @@ Object.defineProperty(ue, "defaultMaxListeners", {
|
|
|
46
46
|
Ri = r;
|
|
47
47
|
}
|
|
48
48
|
});
|
|
49
|
-
|
|
49
|
+
de.init = function() {
|
|
50
50
|
(this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) && (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0;
|
|
51
51
|
};
|
|
52
|
-
|
|
52
|
+
de.prototype.setMaxListeners = function(e) {
|
|
53
53
|
if (typeof e != "number" || e < 0 || js(e))
|
|
54
54
|
throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + e + ".");
|
|
55
55
|
return this._maxListeners = e, this;
|
|
56
56
|
};
|
|
57
57
|
function Us(r) {
|
|
58
|
-
return r._maxListeners === void 0 ?
|
|
58
|
+
return r._maxListeners === void 0 ? de.defaultMaxListeners : r._maxListeners;
|
|
59
59
|
}
|
|
60
|
-
|
|
60
|
+
de.prototype.getMaxListeners = function() {
|
|
61
61
|
return Us(this);
|
|
62
62
|
};
|
|
63
|
-
|
|
63
|
+
de.prototype.emit = function(e) {
|
|
64
64
|
for (var t = [], n = 1; n < arguments.length; n++) t.push(arguments[n]);
|
|
65
65
|
var i = e === "error", o = this._events;
|
|
66
66
|
if (o !== void 0)
|
|
@@ -99,11 +99,11 @@ function Hs(r, e, t, n) {
|
|
|
99
99
|
}
|
|
100
100
|
return r;
|
|
101
101
|
}
|
|
102
|
-
|
|
102
|
+
de.prototype.addListener = function(e, t) {
|
|
103
103
|
return Hs(this, e, t, !1);
|
|
104
104
|
};
|
|
105
|
-
|
|
106
|
-
|
|
105
|
+
de.prototype.on = de.prototype.addListener;
|
|
106
|
+
de.prototype.prependListener = function(e, t) {
|
|
107
107
|
return Hs(this, e, t, !0);
|
|
108
108
|
};
|
|
109
109
|
function wc() {
|
|
@@ -114,13 +114,13 @@ function zs(r, e, t) {
|
|
|
114
114
|
var n = { fired: !1, wrapFn: void 0, target: r, type: e, listener: t }, i = wc.bind(n);
|
|
115
115
|
return i.listener = t, n.wrapFn = i, i;
|
|
116
116
|
}
|
|
117
|
-
|
|
117
|
+
de.prototype.once = function(e, t) {
|
|
118
118
|
return sr(t), this.on(e, zs(this, e, t)), this;
|
|
119
119
|
};
|
|
120
|
-
|
|
120
|
+
de.prototype.prependOnceListener = function(e, t) {
|
|
121
121
|
return sr(t), this.prependListener(e, zs(this, e, t)), this;
|
|
122
122
|
};
|
|
123
|
-
|
|
123
|
+
de.prototype.removeListener = function(e, t) {
|
|
124
124
|
var n, i, o, s, a;
|
|
125
125
|
if (sr(t), i = this._events, i === void 0)
|
|
126
126
|
return this;
|
|
@@ -140,8 +140,8 @@ ue.prototype.removeListener = function(e, t) {
|
|
|
140
140
|
}
|
|
141
141
|
return this;
|
|
142
142
|
};
|
|
143
|
-
|
|
144
|
-
|
|
143
|
+
de.prototype.off = de.prototype.removeListener;
|
|
144
|
+
de.prototype.removeAllListeners = function(e) {
|
|
145
145
|
var t, n, i;
|
|
146
146
|
if (n = this._events, n === void 0)
|
|
147
147
|
return this;
|
|
@@ -167,16 +167,16 @@ function qs(r, e, t) {
|
|
|
167
167
|
var i = n[e];
|
|
168
168
|
return i === void 0 ? [] : typeof i == "function" ? t ? [i.listener || i] : [i] : t ? kc(i) : Ks(i, i.length);
|
|
169
169
|
}
|
|
170
|
-
|
|
170
|
+
de.prototype.listeners = function(e) {
|
|
171
171
|
return qs(this, e, !0);
|
|
172
172
|
};
|
|
173
|
-
|
|
173
|
+
de.prototype.rawListeners = function(e) {
|
|
174
174
|
return qs(this, e, !1);
|
|
175
175
|
};
|
|
176
|
-
|
|
176
|
+
de.listenerCount = function(r, e) {
|
|
177
177
|
return typeof r.listenerCount == "function" ? r.listenerCount(e) : Vs.call(r, e);
|
|
178
178
|
};
|
|
179
|
-
|
|
179
|
+
de.prototype.listenerCount = Vs;
|
|
180
180
|
function Vs(r) {
|
|
181
181
|
var e = this._events;
|
|
182
182
|
if (e !== void 0) {
|
|
@@ -188,7 +188,7 @@ function Vs(r) {
|
|
|
188
188
|
}
|
|
189
189
|
return 0;
|
|
190
190
|
}
|
|
191
|
-
|
|
191
|
+
de.prototype.eventNames = function() {
|
|
192
192
|
return this._eventsCount > 0 ? Vn(this._events) : [];
|
|
193
193
|
};
|
|
194
194
|
function Ks(r, e) {
|
|
@@ -2604,30 +2604,30 @@ function st(r, e) {
|
|
|
2604
2604
|
function Fc(r) {
|
|
2605
2605
|
return r && r.__esModule ? r.default : r;
|
|
2606
2606
|
}
|
|
2607
|
-
function
|
|
2607
|
+
function he(r, e, t, n) {
|
|
2608
2608
|
Object.defineProperty(r, e, { get: t, set: n, enumerable: !0, configurable: !0 });
|
|
2609
2609
|
}
|
|
2610
2610
|
var rn = {}, Gs = {};
|
|
2611
|
-
|
|
2611
|
+
he(Gs, "PipecatClient", () => Qe);
|
|
2612
2612
|
var Xt = {};
|
|
2613
2613
|
Xt = JSON.parse('{"name":"@pipecat-ai/client-js","version":"1.6.0","license":"BSD-2-Clause","main":"dist/index.js","module":"dist/index.module.js","types":"dist/index.d.ts","source":"index.ts","repository":{"type":"git","url":"git+https://github.com/pipecat-ai/pipecat-client-web.git"},"files":["dist","package.json","README.md"],"scripts":{"build":"jest --silent --passWithNoTests && parcel build --no-cache","dev":"parcel watch","lint":"eslint . --report-unused-disable-directives --max-warnings 0","test":"jest"},"jest":{"preset":"ts-jest","testEnvironment":"jsdom","setupFilesAfterEnv":["<rootDir>/tests/jest.setup.ts"]},"devDependencies":{"@jest/globals":"^29.7.0","@types/clone-deep":"^4.0.4","@types/jest":"^29.5.12","@types/uuid":"^10.0.0","eslint":"^9.11.1","eslint-config-prettier":"^9.1.0","eslint-plugin-simple-import-sort":"^12.1.1","jest":"^29.7.0","jest-environment-jsdom":"^30.0.2","ts-jest":"^29.2.5","whatwg-fetch":"^3.6.20"},"dependencies":{"@types/events":"^3.0.3","bowser":"^2.11.0","clone-deep":"^4.0.1","events":"^3.3.0","typed-emitter":"^2.1.0","uuid":"^10.0.0"}}');
|
|
2614
2614
|
var ar = {}, Ys = {};
|
|
2615
|
-
|
|
2615
|
+
he(Ys, "TransportStateEnum", () => Br);
|
|
2616
2616
|
var Br;
|
|
2617
2617
|
(function(r) {
|
|
2618
2618
|
r.DISCONNECTED = "disconnected", r.INITIALIZING = "initializing", r.INITIALIZED = "initialized", r.AUTHENTICATING = "authenticating", r.AUTHENTICATED = "authenticated", r.CONNECTING = "connecting", r.CONNECTED = "connected", r.READY = "ready", r.DISCONNECTING = "disconnecting", r.ERROR = "error";
|
|
2619
2619
|
})(Br || (Br = {}));
|
|
2620
2620
|
var et = {};
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2621
|
+
he(et, "RTVIError", () => Le);
|
|
2622
|
+
he(et, "ConnectionTimeoutError", () => $c);
|
|
2623
|
+
he(et, "StartBotError", () => Xs);
|
|
2624
|
+
he(et, "TransportStartError", () => Qs);
|
|
2625
|
+
he(et, "InvalidTransportParamsError", () => jc);
|
|
2626
|
+
he(et, "BotNotReadyError", () => Zs);
|
|
2627
|
+
he(et, "BotAlreadyStartedError", () => ea);
|
|
2628
|
+
he(et, "UnsupportedFeatureError", () => Uc);
|
|
2629
|
+
he(et, "MessageTooLargeError", () => ta);
|
|
2630
|
+
he(et, "DeviceError", () => at);
|
|
2631
2631
|
class Le extends Error {
|
|
2632
2632
|
constructor(e, t) {
|
|
2633
2633
|
super(e), this.status = t;
|
|
@@ -2680,18 +2680,18 @@ class at extends Le {
|
|
|
2680
2680
|
}
|
|
2681
2681
|
}
|
|
2682
2682
|
var na = {};
|
|
2683
|
-
|
|
2683
|
+
he(na, "RTVIEvent", () => z);
|
|
2684
2684
|
var z;
|
|
2685
2685
|
(function(r) {
|
|
2686
2686
|
r.Connected = "connected", r.Disconnected = "disconnected", r.TransportStateChanged = "transportStateChanged", r.BotStarted = "botStarted", r.BotConnected = "botConnected", r.BotReady = "botReady", r.BotDisconnected = "botDisconnected", r.Error = "error", r.ServerMessage = "serverMessage", r.ServerResponse = "serverResponse", r.MessageError = "messageError", r.Metrics = "metrics", r.BotStartedSpeaking = "botStartedSpeaking", r.BotStoppedSpeaking = "botStoppedSpeaking", r.UserStartedSpeaking = "userStartedSpeaking", r.UserStoppedSpeaking = "userStoppedSpeaking", r.UserMuteStarted = "userMuteStarted", r.UserMuteStopped = "userMuteStopped", r.UserTranscript = "userTranscript", r.BotOutput = "botOutput", r.BotTranscript = "botTranscript", r.BotLlmText = "botLlmText", r.BotLlmStarted = "botLlmStarted", r.BotLlmStopped = "botLlmStopped", r.LLMFunctionCall = "llmFunctionCall", r.LLMFunctionCallStarted = "llmFunctionCallStarted", r.LLMFunctionCallInProgress = "llmFunctionCallInProgress", r.LLMFunctionCallStopped = "llmFunctionCallStopped", r.BotLlmSearchResponse = "botLlmSearchResponse", r.BotTtsText = "botTtsText", r.BotTtsStarted = "botTtsStarted", r.BotTtsStopped = "botTtsStopped", r.ParticipantConnected = "participantConnected", r.ParticipantLeft = "participantLeft", r.TrackStarted = "trackStarted", r.TrackStopped = "trackStopped", r.ScreenTrackStarted = "screenTrackStarted", r.ScreenTrackStopped = "screenTrackStopped", r.ScreenShareError = "screenShareError", r.LocalAudioLevel = "localAudioLevel", r.RemoteAudioLevel = "remoteAudioLevel", r.AvailableCamsUpdated = "availableCamsUpdated", r.AvailableMicsUpdated = "availableMicsUpdated", r.AvailableSpeakersUpdated = "availableSpeakersUpdated", r.CamUpdated = "camUpdated", r.MicUpdated = "micUpdated", r.SpeakerUpdated = "speakerUpdated", r.DeviceError = "deviceError";
|
|
2687
2687
|
})(z || (z = {}));
|
|
2688
2688
|
var Ut = {};
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2689
|
+
he(Ut, "RTVI_PROTOCOL_VERSION", () => ra);
|
|
2690
|
+
he(Ut, "RTVI_MESSAGE_LABEL", () => ia);
|
|
2691
|
+
he(Ut, "RTVIMessageType", () => Y);
|
|
2692
|
+
he(Ut, "AggregationType", () => Fr);
|
|
2693
|
+
he(Ut, "setAboutClient", () => oa);
|
|
2694
|
+
he(Ut, "RTVIMessage", () => we);
|
|
2695
2695
|
const ra = "1.2.0", ia = "rtvi-ai";
|
|
2696
2696
|
var Y;
|
|
2697
2697
|
(function(r) {
|
|
@@ -2756,10 +2756,10 @@ function hi(r, e, t) {
|
|
|
2756
2756
|
}, t;
|
|
2757
2757
|
}
|
|
2758
2758
|
var sa = {};
|
|
2759
|
-
|
|
2759
|
+
he(sa, "MessageDispatcher", () => aa);
|
|
2760
2760
|
var pi = {};
|
|
2761
|
-
|
|
2762
|
-
|
|
2761
|
+
he(pi, "LogLevel", () => kt);
|
|
2762
|
+
he(pi, "logger", () => ne);
|
|
2763
2763
|
var kt;
|
|
2764
2764
|
(function(r) {
|
|
2765
2765
|
r[r.NONE = 0] = "NONE", r[r.ERROR = 1] = "ERROR", r[r.WARN = 2] = "WARN", r[r.INFO = 3] = "INFO", r[r.DEBUG = 4] = "DEBUG";
|
|
@@ -2845,8 +2845,8 @@ class aa {
|
|
|
2845
2845
|
}
|
|
2846
2846
|
}
|
|
2847
2847
|
var fi = {};
|
|
2848
|
-
|
|
2849
|
-
|
|
2848
|
+
he(fi, "isAPIRequest", () => ca);
|
|
2849
|
+
he(fi, "makeRequest", () => la);
|
|
2850
2850
|
function ca(r) {
|
|
2851
2851
|
if (typeof r == "object" && r !== null && Object.keys(r).includes("endpoint")) {
|
|
2852
2852
|
const e = r.endpoint;
|
|
@@ -2891,8 +2891,8 @@ async function la(r, e) {
|
|
|
2891
2891
|
});
|
|
2892
2892
|
}
|
|
2893
2893
|
var gi = {};
|
|
2894
|
-
|
|
2895
|
-
|
|
2894
|
+
he(gi, "Transport", () => ua);
|
|
2895
|
+
he(gi, "TransportWrapper", () => da);
|
|
2896
2896
|
class ua {
|
|
2897
2897
|
constructor() {
|
|
2898
2898
|
this._state = "disconnected", this._maxMessageSize = 65536;
|
|
@@ -2986,8 +2986,8 @@ class da {
|
|
|
2986
2986
|
}
|
|
2987
2987
|
}
|
|
2988
2988
|
var mi = {};
|
|
2989
|
-
|
|
2990
|
-
|
|
2989
|
+
he(mi, "learnAboutClient", () => ha);
|
|
2990
|
+
he(mi, "messageSizeWithinLimit", () => pa);
|
|
2991
2991
|
function ha() {
|
|
2992
2992
|
var t, n, i, o, s, a;
|
|
2993
2993
|
let r = {
|
|
@@ -3917,7 +3917,7 @@ function Oe(r, e) {
|
|
|
3917
3917
|
return r != r && e != e;
|
|
3918
3918
|
}
|
|
3919
3919
|
const qc = { "Amazon Silk": "amazon_silk", "Android Browser": "android", Bada: "bada", BlackBerry: "blackberry", Chrome: "chrome", Chromium: "chromium", Electron: "electron", Epiphany: "epiphany", Firefox: "firefox", Focus: "focus", Generic: "generic", "Google Search": "google_search", Googlebot: "googlebot", "Internet Explorer": "ie", "K-Meleon": "k_meleon", Maxthon: "maxthon", "Microsoft Edge": "edge", "MZ Browser": "mz", "NAVER Whale Browser": "naver", Opera: "opera", "Opera Coast": "opera_coast", PhantomJS: "phantomjs", Puffin: "puffin", QupZilla: "qupzilla", QQ: "qq", QQLite: "qqlite", Safari: "safari", Sailfish: "sailfish", "Samsung Internet for Android": "samsung_internet", SeaMonkey: "seamonkey", Sleipnir: "sleipnir", Swing: "swing", Tizen: "tizen", "UC Browser": "uc", Vivaldi: "vivaldi", "WebOS Browser": "webos", WeChat: "wechat", "Yandex Browser": "yandex", Roku: "roku" }, ga = { amazon_silk: "Amazon Silk", android: "Android Browser", bada: "Bada", blackberry: "BlackBerry", chrome: "Chrome", chromium: "Chromium", electron: "Electron", epiphany: "Epiphany", firefox: "Firefox", focus: "Focus", generic: "Generic", googlebot: "Googlebot", google_search: "Google Search", ie: "Internet Explorer", k_meleon: "K-Meleon", maxthon: "Maxthon", edge: "Microsoft Edge", mz: "MZ Browser", naver: "NAVER Whale Browser", opera: "Opera", opera_coast: "Opera Coast", phantomjs: "PhantomJS", puffin: "Puffin", qupzilla: "QupZilla", qq: "QQ Browser", qqlite: "QQ Browser Lite", safari: "Safari", sailfish: "Sailfish", samsung_internet: "Samsung Internet for Android", seamonkey: "SeaMonkey", sleipnir: "Sleipnir", swing: "Swing", tizen: "Tizen", uc: "UC Browser", vivaldi: "Vivaldi", webos: "WebOS Browser", wechat: "WeChat", yandex: "Yandex Browser" }, ye = { tablet: "tablet", mobile: "mobile", desktop: "desktop", tv: "tv" }, Ae = { WindowsPhone: "Windows Phone", Windows: "Windows", MacOS: "macOS", iOS: "iOS", Android: "Android", WebOS: "WebOS", BlackBerry: "BlackBerry", Bada: "Bada", Tizen: "Tizen", Linux: "Linux", ChromeOS: "Chrome OS", PlayStation4: "PlayStation 4", Roku: "Roku" }, vt = { EdgeHTML: "EdgeHTML", Blink: "Blink", Trident: "Trident", Presto: "Presto", Gecko: "Gecko", WebKit: "WebKit" };
|
|
3920
|
-
class
|
|
3920
|
+
class O {
|
|
3921
3921
|
static getFirstMatch(e, t) {
|
|
3922
3922
|
const n = t.match(e);
|
|
3923
3923
|
return n && n.length > 0 && n[1] || "";
|
|
@@ -3991,11 +3991,11 @@ class A {
|
|
|
3991
3991
|
return e.split(".").length;
|
|
3992
3992
|
}
|
|
3993
3993
|
static compareVersions(e, t, n = !1) {
|
|
3994
|
-
const i =
|
|
3994
|
+
const i = O.getVersionPrecision(e), o = O.getVersionPrecision(t);
|
|
3995
3995
|
let s = Math.max(i, o), a = 0;
|
|
3996
|
-
const c =
|
|
3997
|
-
const d = s -
|
|
3998
|
-
return
|
|
3996
|
+
const c = O.map([e, t], (u) => {
|
|
3997
|
+
const d = s - O.getVersionPrecision(u), h = u + new Array(d + 1).join(".0");
|
|
3998
|
+
return O.map(h.split("."), (g) => new Array(20 - g.length).join("0") + g).reverse();
|
|
3999
3999
|
});
|
|
4000
4000
|
for (n && (a = s - Math.min(i, o)), s -= 1; s >= a; ) {
|
|
4001
4001
|
if (c[0][s] > c[1][s]) return 1;
|
|
@@ -4039,208 +4039,208 @@ class A {
|
|
|
4039
4039
|
return ga[e] || "";
|
|
4040
4040
|
}
|
|
4041
4041
|
}
|
|
4042
|
-
const
|
|
4043
|
-
const e = { name: "Googlebot" }, t =
|
|
4042
|
+
const pe = /version\/(\d+(\.?_?\d+)+)/i, Vc = [{ test: [/googlebot/i], describe(r) {
|
|
4043
|
+
const e = { name: "Googlebot" }, t = O.getFirstMatch(/googlebot\/(\d+(\.\d+))/i, r) || O.getFirstMatch(pe, r);
|
|
4044
4044
|
return t && (e.version = t), e;
|
|
4045
4045
|
} }, { test: [/opera/i], describe(r) {
|
|
4046
|
-
const e = { name: "Opera" }, t =
|
|
4046
|
+
const e = { name: "Opera" }, t = O.getFirstMatch(pe, r) || O.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i, r);
|
|
4047
4047
|
return t && (e.version = t), e;
|
|
4048
4048
|
} }, { test: [/opr\/|opios/i], describe(r) {
|
|
4049
|
-
const e = { name: "Opera" }, t =
|
|
4049
|
+
const e = { name: "Opera" }, t = O.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i, r) || O.getFirstMatch(pe, r);
|
|
4050
4050
|
return t && (e.version = t), e;
|
|
4051
4051
|
} }, { test: [/SamsungBrowser/i], describe(r) {
|
|
4052
|
-
const e = { name: "Samsung Internet for Android" }, t =
|
|
4052
|
+
const e = { name: "Samsung Internet for Android" }, t = O.getFirstMatch(pe, r) || O.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i, r);
|
|
4053
4053
|
return t && (e.version = t), e;
|
|
4054
4054
|
} }, { test: [/Whale/i], describe(r) {
|
|
4055
|
-
const e = { name: "NAVER Whale Browser" }, t =
|
|
4055
|
+
const e = { name: "NAVER Whale Browser" }, t = O.getFirstMatch(pe, r) || O.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i, r);
|
|
4056
4056
|
return t && (e.version = t), e;
|
|
4057
4057
|
} }, { test: [/MZBrowser/i], describe(r) {
|
|
4058
|
-
const e = { name: "MZ Browser" }, t =
|
|
4058
|
+
const e = { name: "MZ Browser" }, t = O.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i, r) || O.getFirstMatch(pe, r);
|
|
4059
4059
|
return t && (e.version = t), e;
|
|
4060
4060
|
} }, { test: [/focus/i], describe(r) {
|
|
4061
|
-
const e = { name: "Focus" }, t =
|
|
4061
|
+
const e = { name: "Focus" }, t = O.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i, r) || O.getFirstMatch(pe, r);
|
|
4062
4062
|
return t && (e.version = t), e;
|
|
4063
4063
|
} }, { test: [/swing/i], describe(r) {
|
|
4064
|
-
const e = { name: "Swing" }, t =
|
|
4064
|
+
const e = { name: "Swing" }, t = O.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i, r) || O.getFirstMatch(pe, r);
|
|
4065
4065
|
return t && (e.version = t), e;
|
|
4066
4066
|
} }, { test: [/coast/i], describe(r) {
|
|
4067
|
-
const e = { name: "Opera Coast" }, t =
|
|
4067
|
+
const e = { name: "Opera Coast" }, t = O.getFirstMatch(pe, r) || O.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i, r);
|
|
4068
4068
|
return t && (e.version = t), e;
|
|
4069
4069
|
} }, { test: [/opt\/\d+(?:.?_?\d+)+/i], describe(r) {
|
|
4070
|
-
const e = { name: "Opera Touch" }, t =
|
|
4070
|
+
const e = { name: "Opera Touch" }, t = O.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i, r) || O.getFirstMatch(pe, r);
|
|
4071
4071
|
return t && (e.version = t), e;
|
|
4072
4072
|
} }, { test: [/yabrowser/i], describe(r) {
|
|
4073
|
-
const e = { name: "Yandex Browser" }, t =
|
|
4073
|
+
const e = { name: "Yandex Browser" }, t = O.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i, r) || O.getFirstMatch(pe, r);
|
|
4074
4074
|
return t && (e.version = t), e;
|
|
4075
4075
|
} }, { test: [/ucbrowser/i], describe(r) {
|
|
4076
|
-
const e = { name: "UC Browser" }, t =
|
|
4076
|
+
const e = { name: "UC Browser" }, t = O.getFirstMatch(pe, r) || O.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i, r);
|
|
4077
4077
|
return t && (e.version = t), e;
|
|
4078
4078
|
} }, { test: [/Maxthon|mxios/i], describe(r) {
|
|
4079
|
-
const e = { name: "Maxthon" }, t =
|
|
4079
|
+
const e = { name: "Maxthon" }, t = O.getFirstMatch(pe, r) || O.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i, r);
|
|
4080
4080
|
return t && (e.version = t), e;
|
|
4081
4081
|
} }, { test: [/epiphany/i], describe(r) {
|
|
4082
|
-
const e = { name: "Epiphany" }, t =
|
|
4082
|
+
const e = { name: "Epiphany" }, t = O.getFirstMatch(pe, r) || O.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i, r);
|
|
4083
4083
|
return t && (e.version = t), e;
|
|
4084
4084
|
} }, { test: [/puffin/i], describe(r) {
|
|
4085
|
-
const e = { name: "Puffin" }, t =
|
|
4085
|
+
const e = { name: "Puffin" }, t = O.getFirstMatch(pe, r) || O.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i, r);
|
|
4086
4086
|
return t && (e.version = t), e;
|
|
4087
4087
|
} }, { test: [/sleipnir/i], describe(r) {
|
|
4088
|
-
const e = { name: "Sleipnir" }, t =
|
|
4088
|
+
const e = { name: "Sleipnir" }, t = O.getFirstMatch(pe, r) || O.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i, r);
|
|
4089
4089
|
return t && (e.version = t), e;
|
|
4090
4090
|
} }, { test: [/k-meleon/i], describe(r) {
|
|
4091
|
-
const e = { name: "K-Meleon" }, t =
|
|
4091
|
+
const e = { name: "K-Meleon" }, t = O.getFirstMatch(pe, r) || O.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i, r);
|
|
4092
4092
|
return t && (e.version = t), e;
|
|
4093
4093
|
} }, { test: [/micromessenger/i], describe(r) {
|
|
4094
|
-
const e = { name: "WeChat" }, t =
|
|
4094
|
+
const e = { name: "WeChat" }, t = O.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i, r) || O.getFirstMatch(pe, r);
|
|
4095
4095
|
return t && (e.version = t), e;
|
|
4096
4096
|
} }, { test: [/qqbrowser/i], describe(r) {
|
|
4097
|
-
const e = { name: /qqbrowserlite/i.test(r) ? "QQ Browser Lite" : "QQ Browser" }, t =
|
|
4097
|
+
const e = { name: /qqbrowserlite/i.test(r) ? "QQ Browser Lite" : "QQ Browser" }, t = O.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i, r) || O.getFirstMatch(pe, r);
|
|
4098
4098
|
return t && (e.version = t), e;
|
|
4099
4099
|
} }, { test: [/msie|trident/i], describe(r) {
|
|
4100
|
-
const e = { name: "Internet Explorer" }, t =
|
|
4100
|
+
const e = { name: "Internet Explorer" }, t = O.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i, r);
|
|
4101
4101
|
return t && (e.version = t), e;
|
|
4102
4102
|
} }, { test: [/\sedg\//i], describe(r) {
|
|
4103
|
-
const e = { name: "Microsoft Edge" }, t =
|
|
4103
|
+
const e = { name: "Microsoft Edge" }, t = O.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i, r);
|
|
4104
4104
|
return t && (e.version = t), e;
|
|
4105
4105
|
} }, { test: [/edg([ea]|ios)/i], describe(r) {
|
|
4106
|
-
const e = { name: "Microsoft Edge" }, t =
|
|
4106
|
+
const e = { name: "Microsoft Edge" }, t = O.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i, r);
|
|
4107
4107
|
return t && (e.version = t), e;
|
|
4108
4108
|
} }, { test: [/vivaldi/i], describe(r) {
|
|
4109
|
-
const e = { name: "Vivaldi" }, t =
|
|
4109
|
+
const e = { name: "Vivaldi" }, t = O.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i, r);
|
|
4110
4110
|
return t && (e.version = t), e;
|
|
4111
4111
|
} }, { test: [/seamonkey/i], describe(r) {
|
|
4112
|
-
const e = { name: "SeaMonkey" }, t =
|
|
4112
|
+
const e = { name: "SeaMonkey" }, t = O.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i, r);
|
|
4113
4113
|
return t && (e.version = t), e;
|
|
4114
4114
|
} }, { test: [/sailfish/i], describe(r) {
|
|
4115
|
-
const e = { name: "Sailfish" }, t =
|
|
4115
|
+
const e = { name: "Sailfish" }, t = O.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i, r);
|
|
4116
4116
|
return t && (e.version = t), e;
|
|
4117
4117
|
} }, { test: [/silk/i], describe(r) {
|
|
4118
|
-
const e = { name: "Amazon Silk" }, t =
|
|
4118
|
+
const e = { name: "Amazon Silk" }, t = O.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i, r);
|
|
4119
4119
|
return t && (e.version = t), e;
|
|
4120
4120
|
} }, { test: [/phantom/i], describe(r) {
|
|
4121
|
-
const e = { name: "PhantomJS" }, t =
|
|
4121
|
+
const e = { name: "PhantomJS" }, t = O.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i, r);
|
|
4122
4122
|
return t && (e.version = t), e;
|
|
4123
4123
|
} }, { test: [/slimerjs/i], describe(r) {
|
|
4124
|
-
const e = { name: "SlimerJS" }, t =
|
|
4124
|
+
const e = { name: "SlimerJS" }, t = O.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i, r);
|
|
4125
4125
|
return t && (e.version = t), e;
|
|
4126
4126
|
} }, { test: [/blackberry|\bbb\d+/i, /rim\stablet/i], describe(r) {
|
|
4127
|
-
const e = { name: "BlackBerry" }, t =
|
|
4127
|
+
const e = { name: "BlackBerry" }, t = O.getFirstMatch(pe, r) || O.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i, r);
|
|
4128
4128
|
return t && (e.version = t), e;
|
|
4129
4129
|
} }, { test: [/(web|hpw)[o0]s/i], describe(r) {
|
|
4130
|
-
const e = { name: "WebOS Browser" }, t =
|
|
4130
|
+
const e = { name: "WebOS Browser" }, t = O.getFirstMatch(pe, r) || O.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i, r);
|
|
4131
4131
|
return t && (e.version = t), e;
|
|
4132
4132
|
} }, { test: [/bada/i], describe(r) {
|
|
4133
|
-
const e = { name: "Bada" }, t =
|
|
4133
|
+
const e = { name: "Bada" }, t = O.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i, r);
|
|
4134
4134
|
return t && (e.version = t), e;
|
|
4135
4135
|
} }, { test: [/tizen/i], describe(r) {
|
|
4136
|
-
const e = { name: "Tizen" }, t =
|
|
4136
|
+
const e = { name: "Tizen" }, t = O.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i, r) || O.getFirstMatch(pe, r);
|
|
4137
4137
|
return t && (e.version = t), e;
|
|
4138
4138
|
} }, { test: [/qupzilla/i], describe(r) {
|
|
4139
|
-
const e = { name: "QupZilla" }, t =
|
|
4139
|
+
const e = { name: "QupZilla" }, t = O.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i, r) || O.getFirstMatch(pe, r);
|
|
4140
4140
|
return t && (e.version = t), e;
|
|
4141
4141
|
} }, { test: [/firefox|iceweasel|fxios/i], describe(r) {
|
|
4142
|
-
const e = { name: "Firefox" }, t =
|
|
4142
|
+
const e = { name: "Firefox" }, t = O.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i, r);
|
|
4143
4143
|
return t && (e.version = t), e;
|
|
4144
4144
|
} }, { test: [/electron/i], describe(r) {
|
|
4145
|
-
const e = { name: "Electron" }, t =
|
|
4145
|
+
const e = { name: "Electron" }, t = O.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i, r);
|
|
4146
4146
|
return t && (e.version = t), e;
|
|
4147
4147
|
} }, { test: [/MiuiBrowser/i], describe(r) {
|
|
4148
|
-
const e = { name: "Miui" }, t =
|
|
4148
|
+
const e = { name: "Miui" }, t = O.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i, r);
|
|
4149
4149
|
return t && (e.version = t), e;
|
|
4150
4150
|
} }, { test: [/chromium/i], describe(r) {
|
|
4151
|
-
const e = { name: "Chromium" }, t =
|
|
4151
|
+
const e = { name: "Chromium" }, t = O.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i, r) || O.getFirstMatch(pe, r);
|
|
4152
4152
|
return t && (e.version = t), e;
|
|
4153
4153
|
} }, { test: [/chrome|crios|crmo/i], describe(r) {
|
|
4154
|
-
const e = { name: "Chrome" }, t =
|
|
4154
|
+
const e = { name: "Chrome" }, t = O.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i, r);
|
|
4155
4155
|
return t && (e.version = t), e;
|
|
4156
4156
|
} }, { test: [/GSA/i], describe(r) {
|
|
4157
|
-
const e = { name: "Google Search" }, t =
|
|
4157
|
+
const e = { name: "Google Search" }, t = O.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i, r);
|
|
4158
4158
|
return t && (e.version = t), e;
|
|
4159
4159
|
} }, { test(r) {
|
|
4160
4160
|
const e = !r.test(/like android/i), t = r.test(/android/i);
|
|
4161
4161
|
return e && t;
|
|
4162
4162
|
}, describe(r) {
|
|
4163
|
-
const e = { name: "Android Browser" }, t =
|
|
4163
|
+
const e = { name: "Android Browser" }, t = O.getFirstMatch(pe, r);
|
|
4164
4164
|
return t && (e.version = t), e;
|
|
4165
4165
|
} }, { test: [/playstation 4/i], describe(r) {
|
|
4166
|
-
const e = { name: "PlayStation 4" }, t =
|
|
4166
|
+
const e = { name: "PlayStation 4" }, t = O.getFirstMatch(pe, r);
|
|
4167
4167
|
return t && (e.version = t), e;
|
|
4168
4168
|
} }, { test: [/safari|applewebkit/i], describe(r) {
|
|
4169
|
-
const e = { name: "Safari" }, t =
|
|
4169
|
+
const e = { name: "Safari" }, t = O.getFirstMatch(pe, r);
|
|
4170
4170
|
return t && (e.version = t), e;
|
|
4171
4171
|
} }, { test: [/.*/i], describe(r) {
|
|
4172
4172
|
const e = r.search("\\(") !== -1 ? /^(.*)\/(.*)[ \t]\((.*)/ : /^(.*)\/(.*) /;
|
|
4173
|
-
return { name:
|
|
4173
|
+
return { name: O.getFirstMatch(e, r), version: O.getSecondMatch(e, r) };
|
|
4174
4174
|
} }];
|
|
4175
4175
|
var Kc = [{ test: [/Roku\/DVP/], describe(r) {
|
|
4176
|
-
const e =
|
|
4176
|
+
const e = O.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i, r);
|
|
4177
4177
|
return { name: Ae.Roku, version: e };
|
|
4178
4178
|
} }, { test: [/windows phone/i], describe(r) {
|
|
4179
|
-
const e =
|
|
4179
|
+
const e = O.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i, r);
|
|
4180
4180
|
return { name: Ae.WindowsPhone, version: e };
|
|
4181
4181
|
} }, { test: [/windows /i], describe(r) {
|
|
4182
|
-
const e =
|
|
4182
|
+
const e = O.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i, r), t = O.getWindowsVersionName(e);
|
|
4183
4183
|
return { name: Ae.Windows, version: e, versionName: t };
|
|
4184
4184
|
} }, { test: [/Macintosh(.*?) FxiOS(.*?)\//], describe(r) {
|
|
4185
|
-
const e = { name: Ae.iOS }, t =
|
|
4185
|
+
const e = { name: Ae.iOS }, t = O.getSecondMatch(/(Version\/)(\d[\d.]+)/, r);
|
|
4186
4186
|
return t && (e.version = t), e;
|
|
4187
4187
|
} }, { test: [/macintosh/i], describe(r) {
|
|
4188
|
-
const e =
|
|
4188
|
+
const e = O.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i, r).replace(/[_\s]/g, "."), t = O.getMacOSVersionName(e), n = { name: Ae.MacOS, version: e };
|
|
4189
4189
|
return t && (n.versionName = t), n;
|
|
4190
4190
|
} }, { test: [/(ipod|iphone|ipad)/i], describe(r) {
|
|
4191
|
-
const e =
|
|
4191
|
+
const e = O.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i, r).replace(/[_\s]/g, ".");
|
|
4192
4192
|
return { name: Ae.iOS, version: e };
|
|
4193
4193
|
} }, { test(r) {
|
|
4194
4194
|
const e = !r.test(/like android/i), t = r.test(/android/i);
|
|
4195
4195
|
return e && t;
|
|
4196
4196
|
}, describe(r) {
|
|
4197
|
-
const e =
|
|
4197
|
+
const e = O.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i, r), t = O.getAndroidVersionName(e), n = { name: Ae.Android, version: e };
|
|
4198
4198
|
return t && (n.versionName = t), n;
|
|
4199
4199
|
} }, { test: [/(web|hpw)[o0]s/i], describe(r) {
|
|
4200
|
-
const e =
|
|
4200
|
+
const e = O.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i, r), t = { name: Ae.WebOS };
|
|
4201
4201
|
return e && e.length && (t.version = e), t;
|
|
4202
4202
|
} }, { test: [/blackberry|\bbb\d+/i, /rim\stablet/i], describe(r) {
|
|
4203
|
-
const e =
|
|
4203
|
+
const e = O.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i, r) || O.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i, r) || O.getFirstMatch(/\bbb(\d+)/i, r);
|
|
4204
4204
|
return { name: Ae.BlackBerry, version: e };
|
|
4205
4205
|
} }, { test: [/bada/i], describe(r) {
|
|
4206
|
-
const e =
|
|
4206
|
+
const e = O.getFirstMatch(/bada\/(\d+(\.\d+)*)/i, r);
|
|
4207
4207
|
return { name: Ae.Bada, version: e };
|
|
4208
4208
|
} }, { test: [/tizen/i], describe(r) {
|
|
4209
|
-
const e =
|
|
4209
|
+
const e = O.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i, r);
|
|
4210
4210
|
return { name: Ae.Tizen, version: e };
|
|
4211
4211
|
} }, { test: [/linux/i], describe: () => ({ name: Ae.Linux }) }, { test: [/CrOS/], describe: () => ({ name: Ae.ChromeOS }) }, { test: [/PlayStation 4/], describe(r) {
|
|
4212
|
-
const e =
|
|
4212
|
+
const e = O.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i, r);
|
|
4213
4213
|
return { name: Ae.PlayStation4, version: e };
|
|
4214
4214
|
} }], Wc = [{ test: [/googlebot/i], describe: () => ({ type: "bot", vendor: "Google" }) }, { test: [/huawei/i], describe(r) {
|
|
4215
|
-
const e =
|
|
4215
|
+
const e = O.getFirstMatch(/(can-l01)/i, r) && "Nova", t = { type: ye.mobile, vendor: "Huawei" };
|
|
4216
4216
|
return e && (t.model = e), t;
|
|
4217
4217
|
} }, { test: [/nexus\s*(?:7|8|9|10).*/i], describe: () => ({ type: ye.tablet, vendor: "Nexus" }) }, { test: [/ipad/i], describe: () => ({ type: ye.tablet, vendor: "Apple", model: "iPad" }) }, { test: [/Macintosh(.*?) FxiOS(.*?)\//], describe: () => ({ type: ye.tablet, vendor: "Apple", model: "iPad" }) }, { test: [/kftt build/i], describe: () => ({ type: ye.tablet, vendor: "Amazon", model: "Kindle Fire HD 7" }) }, { test: [/silk/i], describe: () => ({ type: ye.tablet, vendor: "Amazon" }) }, { test: [/tablet(?! pc)/i], describe: () => ({ type: ye.tablet }) }, { test(r) {
|
|
4218
4218
|
const e = r.test(/ipod|iphone/i), t = r.test(/like (ipod|iphone)/i);
|
|
4219
4219
|
return e && !t;
|
|
4220
4220
|
}, describe(r) {
|
|
4221
|
-
const e =
|
|
4221
|
+
const e = O.getFirstMatch(/(ipod|iphone)/i, r);
|
|
4222
4222
|
return { type: ye.mobile, vendor: "Apple", model: e };
|
|
4223
4223
|
} }, { test: [/nexus\s*[0-6].*/i, /galaxy nexus/i], describe: () => ({ type: ye.mobile, vendor: "Nexus" }) }, { test: [/[^-]mobi/i], describe: () => ({ type: ye.mobile }) }, { test: (r) => r.getBrowserName(!0) === "blackberry", describe: () => ({ type: ye.mobile, vendor: "BlackBerry" }) }, { test: (r) => r.getBrowserName(!0) === "bada", describe: () => ({ type: ye.mobile }) }, { test: (r) => r.getBrowserName() === "windows phone", describe: () => ({ type: ye.mobile, vendor: "Microsoft" }) }, { test(r) {
|
|
4224
4224
|
const e = Number(String(r.getOSVersion()).split(".")[0]);
|
|
4225
4225
|
return r.getOSName(!0) === "android" && e >= 3;
|
|
4226
4226
|
}, describe: () => ({ type: ye.tablet }) }, { test: (r) => r.getOSName(!0) === "android", describe: () => ({ type: ye.mobile }) }, { test: (r) => r.getOSName(!0) === "macos", describe: () => ({ type: ye.desktop, vendor: "Apple" }) }, { test: (r) => r.getOSName(!0) === "windows", describe: () => ({ type: ye.desktop }) }, { test: (r) => r.getOSName(!0) === "linux", describe: () => ({ type: ye.desktop }) }, { test: (r) => r.getOSName(!0) === "playstation 4", describe: () => ({ type: ye.tv }) }, { test: (r) => r.getOSName(!0) === "roku", describe: () => ({ type: ye.tv }) }], Jc = [{ test: (r) => r.getBrowserName(!0) === "microsoft edge", describe(r) {
|
|
4227
4227
|
if (/\sedg\//i.test(r)) return { name: vt.Blink };
|
|
4228
|
-
const e =
|
|
4228
|
+
const e = O.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i, r);
|
|
4229
4229
|
return { name: vt.EdgeHTML, version: e };
|
|
4230
4230
|
} }, { test: [/trident/i], describe(r) {
|
|
4231
|
-
const e = { name: vt.Trident }, t =
|
|
4231
|
+
const e = { name: vt.Trident }, t = O.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i, r);
|
|
4232
4232
|
return t && (e.version = t), e;
|
|
4233
4233
|
} }, { test: (r) => r.test(/presto/i), describe(r) {
|
|
4234
|
-
const e = { name: vt.Presto }, t =
|
|
4234
|
+
const e = { name: vt.Presto }, t = O.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i, r);
|
|
4235
4235
|
return t && (e.version = t), e;
|
|
4236
4236
|
} }, { test(r) {
|
|
4237
4237
|
const e = r.test(/gecko/i), t = r.test(/like gecko/i);
|
|
4238
4238
|
return e && !t;
|
|
4239
4239
|
}, describe(r) {
|
|
4240
|
-
const e = { name: vt.Gecko }, t =
|
|
4240
|
+
const e = { name: vt.Gecko }, t = O.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i, r);
|
|
4241
4241
|
return t && (e.version = t), e;
|
|
4242
4242
|
} }, { test: [/(apple)?webkit\/537\.36/i], describe: () => ({ name: vt.Blink }) }, { test: [/(apple)?webkit/i], describe(r) {
|
|
4243
|
-
const e = { name: vt.WebKit }, t =
|
|
4243
|
+
const e = { name: vt.WebKit }, t = O.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i, r);
|
|
4244
4244
|
return t && (e.version = t), e;
|
|
4245
4245
|
} }];
|
|
4246
4246
|
class Vi {
|
|
@@ -4256,7 +4256,7 @@ class Vi {
|
|
|
4256
4256
|
}
|
|
4257
4257
|
parseBrowser() {
|
|
4258
4258
|
this.parsedResult.browser = {};
|
|
4259
|
-
const e =
|
|
4259
|
+
const e = O.find(Vc, (t) => {
|
|
4260
4260
|
if (typeof t.test == "function") return t.test(this);
|
|
4261
4261
|
if (t.test instanceof Array) return t.test.some((n) => this.test(n));
|
|
4262
4262
|
throw new Error("Browser's test function is not valid");
|
|
@@ -4277,7 +4277,7 @@ class Vi {
|
|
|
4277
4277
|
}
|
|
4278
4278
|
parseOS() {
|
|
4279
4279
|
this.parsedResult.os = {};
|
|
4280
|
-
const e =
|
|
4280
|
+
const e = O.find(Kc, (t) => {
|
|
4281
4281
|
if (typeof t.test == "function") return t.test(this);
|
|
4282
4282
|
if (t.test instanceof Array) return t.test.some((n) => this.test(n));
|
|
4283
4283
|
throw new Error("Browser's test function is not valid");
|
|
@@ -4300,7 +4300,7 @@ class Vi {
|
|
|
4300
4300
|
}
|
|
4301
4301
|
parsePlatform() {
|
|
4302
4302
|
this.parsedResult.platform = {};
|
|
4303
|
-
const e =
|
|
4303
|
+
const e = O.find(Wc, (t) => {
|
|
4304
4304
|
if (typeof t.test == "function") return t.test(this);
|
|
4305
4305
|
if (t.test instanceof Array) return t.test.some((n) => this.test(n));
|
|
4306
4306
|
throw new Error("Browser's test function is not valid");
|
|
@@ -4315,7 +4315,7 @@ class Vi {
|
|
|
4315
4315
|
}
|
|
4316
4316
|
parseEngine() {
|
|
4317
4317
|
this.parsedResult.engine = {};
|
|
4318
|
-
const e =
|
|
4318
|
+
const e = O.find(Jc, (t) => {
|
|
4319
4319
|
if (typeof t.test == "function") return t.test(this);
|
|
4320
4320
|
if (t.test instanceof Array) return t.test.some((n) => this.test(n));
|
|
4321
4321
|
throw new Error("Browser's test function is not valid");
|
|
@@ -4326,7 +4326,7 @@ class Vi {
|
|
|
4326
4326
|
return this.parseBrowser(), this.parseOS(), this.parsePlatform(), this.parseEngine(), this;
|
|
4327
4327
|
}
|
|
4328
4328
|
getResult() {
|
|
4329
|
-
return
|
|
4329
|
+
return O.assign({}, this.parsedResult);
|
|
4330
4330
|
}
|
|
4331
4331
|
satisfies(e) {
|
|
4332
4332
|
const t = {};
|
|
@@ -4337,32 +4337,32 @@ class Vi {
|
|
|
4337
4337
|
const a = e[s];
|
|
4338
4338
|
typeof a == "string" ? (i[s] = a, o += 1) : typeof a == "object" && (t[s] = a, n += 1);
|
|
4339
4339
|
}), n > 0) {
|
|
4340
|
-
const s = Object.keys(t), a =
|
|
4340
|
+
const s = Object.keys(t), a = O.find(s, (u) => this.isOS(u));
|
|
4341
4341
|
if (a) {
|
|
4342
4342
|
const u = this.satisfies(t[a]);
|
|
4343
4343
|
if (u !== void 0) return u;
|
|
4344
4344
|
}
|
|
4345
|
-
const c =
|
|
4345
|
+
const c = O.find(s, (u) => this.isPlatform(u));
|
|
4346
4346
|
if (c) {
|
|
4347
4347
|
const u = this.satisfies(t[c]);
|
|
4348
4348
|
if (u !== void 0) return u;
|
|
4349
4349
|
}
|
|
4350
4350
|
}
|
|
4351
4351
|
if (o > 0) {
|
|
4352
|
-
const s = Object.keys(i), a =
|
|
4352
|
+
const s = Object.keys(i), a = O.find(s, (c) => this.isBrowser(c, !0));
|
|
4353
4353
|
if (a !== void 0) return this.compareVersion(i[a]);
|
|
4354
4354
|
}
|
|
4355
4355
|
}
|
|
4356
4356
|
isBrowser(e, t = !1) {
|
|
4357
4357
|
const n = this.getBrowserName().toLowerCase();
|
|
4358
4358
|
let i = e.toLowerCase();
|
|
4359
|
-
const o =
|
|
4359
|
+
const o = O.getBrowserTypeByAlias(i);
|
|
4360
4360
|
return t && o && (i = o.toLowerCase()), i === n;
|
|
4361
4361
|
}
|
|
4362
4362
|
compareVersion(e) {
|
|
4363
4363
|
let t = [0], n = e, i = !1;
|
|
4364
4364
|
const o = this.getBrowserVersion();
|
|
4365
|
-
if (typeof o == "string") return e[0] === ">" || e[0] === "<" ? (n = e.substr(1), e[1] === "=" ? (i = !0, n = e.substr(2)) : t = [], e[0] === ">" ? t.push(1) : t.push(-1)) : e[0] === "=" ? n = e.substr(1) : e[0] === "~" && (i = !0, n = e.substr(1)), t.indexOf(
|
|
4365
|
+
if (typeof o == "string") return e[0] === ">" || e[0] === "<" ? (n = e.substr(1), e[1] === "=" ? (i = !0, n = e.substr(2)) : t = [], e[0] === ">" ? t.push(1) : t.push(-1)) : e[0] === "=" ? n = e.substr(1) : e[0] === "~" && (i = !0, n = e.substr(1)), t.indexOf(O.compareVersions(o, n, i)) > -1;
|
|
4366
4366
|
}
|
|
4367
4367
|
isOS(e) {
|
|
4368
4368
|
return this.getOSName(!0) === String(e).toLowerCase();
|
|
@@ -7978,7 +7978,7 @@ var Fd = function() {
|
|
|
7978
7978
|
return this.sendMessageToCallMachine({ action: "update-participants", participants: l }), this;
|
|
7979
7979
|
} }, { key: "updateWaitingParticipant", value: (ve = W(function* () {
|
|
7980
7980
|
var l = this, f = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "", p = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
7981
|
-
if (Ke(this._callObjectMode, "updateWaitingParticipant()"),
|
|
7981
|
+
if (Ke(this._callObjectMode, "updateWaitingParticipant()"), fe(this._callState, "updateWaitingParticipant()"), typeof f != "string" || ae(p) !== "object") throw new Error("updateWaitingParticipant() must take an id string and a updates object");
|
|
7982
7982
|
return new Promise(function(S, k) {
|
|
7983
7983
|
l.sendMessageToCallMachine({ action: "daily-method-update-waiting-participant", id: f, updates: p }, function(E) {
|
|
7984
7984
|
E.error && k(E.error), E.id || k(new Error("unknown error in updateWaitingParticipant()")), S({ id: E.id });
|
|
@@ -7988,7 +7988,7 @@ var Fd = function() {
|
|
|
7988
7988
|
return ve.apply(this, arguments);
|
|
7989
7989
|
}) }, { key: "updateWaitingParticipants", value: (Te = W(function* () {
|
|
7990
7990
|
var l = this, f = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
7991
|
-
if (Ke(this._callObjectMode, "updateWaitingParticipants()"),
|
|
7991
|
+
if (Ke(this._callObjectMode, "updateWaitingParticipants()"), fe(this._callState, "updateWaitingParticipants()"), ae(f) !== "object") throw new Error("updateWaitingParticipants() must take a mapping between ids and update objects");
|
|
7992
7992
|
return new Promise(function(p, S) {
|
|
7993
7993
|
l.sendMessageToCallMachine({ action: "daily-method-update-waiting-participants", updatesById: f }, function(k) {
|
|
7994
7994
|
k.error && S(k.error), k.ids || S(new Error("unknown error in updateWaitingParticipants()")), p({ ids: k.ids });
|
|
@@ -7998,7 +7998,7 @@ var Fd = 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: uu } : p, k = f.name, E = k === void 0 ? "" : k;
|
|
8001
|
-
return Ke(this._callObjectMode, "requestAccess()"),
|
|
8001
|
+
return Ke(this._callObjectMode, "requestAccess()"), fe(this._callState, "requestAccess()"), new Promise(function(M, L) {
|
|
8002
8002
|
l.sendMessageToCallMachine({ action: "daily-method-request-access", access: S, name: E }, function(I) {
|
|
8003
8003
|
I.error && L(I.error), I.access || L(new Error("unknown error in requestAccess()")), M({ access: I.access, granted: I.granted });
|
|
8004
8004
|
});
|
|
@@ -8045,7 +8045,7 @@ var Fd = function() {
|
|
|
8045
8045
|
}) }, { key: "updateReceiveSettings", value: (Q = W(function* (l) {
|
|
8046
8046
|
var f = this;
|
|
8047
8047
|
if (Ke(this._callObjectMode, "updateReceiveSettings()"), !Ga(l, { allowAllParticipantsKey: !0 })) throw new Error(Qa({ allowAllParticipantsKey: !0 }));
|
|
8048
|
-
return
|
|
8048
|
+
return fe(this._callState, "updateReceiveSettings()", "To specify receive settings earlier, use the receiveSettings config property."), new Promise(function(p) {
|
|
8049
8049
|
f.sendMessageToCallMachine({ action: "update-receive-settings", receiveSettings: l }, function(S) {
|
|
8050
8050
|
p({ receiveSettings: S.receiveSettings });
|
|
8051
8051
|
});
|
|
@@ -8132,7 +8132,7 @@ var Fd = function() {
|
|
|
8132
8132
|
return [gt, mt].includes(this._callState) ? this._finalSummaryOfPrevSession : this._meetingSessionSummary;
|
|
8133
8133
|
} }, { key: "getMeetingSession", value: (N = W(function* () {
|
|
8134
8134
|
var l = this;
|
|
8135
|
-
return console.warn("getMeetingSession() is deprecated: use meetingSessionSummary(), which will return immediately"),
|
|
8135
|
+
return console.warn("getMeetingSession() is deprecated: use meetingSessionSummary(), which will return immediately"), fe(this._callState, "getMeetingSession()"), new Promise(function(f) {
|
|
8136
8136
|
l.sendMessageToCallMachine({ action: "get-meeting-session" }, function(p) {
|
|
8137
8137
|
delete p.action, delete p.callbackStamp, f(p);
|
|
8138
8138
|
});
|
|
@@ -8140,10 +8140,10 @@ var Fd = function() {
|
|
|
8140
8140
|
}), function() {
|
|
8141
8141
|
return N.apply(this, arguments);
|
|
8142
8142
|
}) }, { key: "meetingSessionState", value: function() {
|
|
8143
|
-
return
|
|
8143
|
+
return fe(this._callState, "meetingSessionState"), this._meetingSessionState;
|
|
8144
8144
|
} }, { key: "setMeetingSessionData", value: function(l) {
|
|
8145
8145
|
var f = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "replace";
|
|
8146
|
-
Ke(this._callObjectMode, "setMeetingSessionData()"),
|
|
8146
|
+
Ke(this._callObjectMode, "setMeetingSessionData()"), fe(this._callState, "setMeetingSessionData");
|
|
8147
8147
|
try {
|
|
8148
8148
|
(function(p, S) {
|
|
8149
8149
|
new bd({ data: p, mergeStrategy: S });
|
|
@@ -8236,14 +8236,14 @@ var Fd = function() {
|
|
|
8236
8236
|
if (!(l instanceof MediaStreamTrack)) throw new Error("Custom tracks provided must be instances of MediaStreamTrack");
|
|
8237
8237
|
} }, { key: "startCustomTrack", value: function() {
|
|
8238
8238
|
var l = this, f = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : { track, mode, trackName, ignoreAudioLevel };
|
|
8239
|
-
return ie(),
|
|
8239
|
+
return ie(), fe(this._callState, "startCustomTrack()"), this.validateCustomTrack(f.track, f.mode, f.trackName), new Promise(function(p, S) {
|
|
8240
8240
|
l._sharedTracks.customTrack = f.track, f.track = ht, l.sendMessageToCallMachine({ action: "start-custom-track", properties: f }, function(k) {
|
|
8241
8241
|
k.error ? S({ error: k.error }) : p(k.mediaTag);
|
|
8242
8242
|
});
|
|
8243
8243
|
});
|
|
8244
8244
|
} }, { key: "stopCustomTrack", value: function(l) {
|
|
8245
8245
|
var f = this;
|
|
8246
|
-
return ie(),
|
|
8246
|
+
return ie(), fe(this._callState, "stopCustomTrack()"), new Promise(function(p) {
|
|
8247
8247
|
f.sendMessageToCallMachine({ action: "stop-custom-track", mediaTag: l }, function(S) {
|
|
8248
8248
|
p(S.mediaTag);
|
|
8249
8249
|
});
|
|
@@ -8510,19 +8510,19 @@ var Fd = function() {
|
|
|
8510
8510
|
}), function(l) {
|
|
8511
8511
|
return w.apply(this, arguments);
|
|
8512
8512
|
}) }, { key: "startTranscription", value: function(l) {
|
|
8513
|
-
|
|
8513
|
+
fe(this._callState, "startTranscription()"), this.sendMessageToCallMachine(F({ action: "daily-method-start-transcription" }, l));
|
|
8514
8514
|
} }, { key: "updateTranscription", value: function(l) {
|
|
8515
|
-
if (
|
|
8515
|
+
if (fe(this._callState, "updateTranscription()"), !l) throw new Error("updateTranscription Error: options is mandatory");
|
|
8516
8516
|
if (ae(l) !== "object") throw new Error("updateTranscription Error: options must be object type");
|
|
8517
8517
|
if (l.participants && !Array.isArray(l.participants)) throw new Error("updateTranscription Error: participants must be an array");
|
|
8518
8518
|
this.sendMessageToCallMachine(F({ action: "daily-method-update-transcription" }, l));
|
|
8519
8519
|
} }, { key: "stopTranscription", value: function(l) {
|
|
8520
|
-
if (
|
|
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
8523
|
} }, { key: "startDialOut", value: (y = W(function* (l) {
|
|
8524
8524
|
var f = this;
|
|
8525
|
-
|
|
8525
|
+
fe(this._callState, "startDialOut()");
|
|
8526
8526
|
var p = function(M) {
|
|
8527
8527
|
if (M) {
|
|
8528
8528
|
if (!Array.isArray(M)) throw new Error("Error starting dial out: audio codec must be an array");
|
|
@@ -8585,14 +8585,14 @@ var Fd = function() {
|
|
|
8585
8585
|
return y.apply(this, arguments);
|
|
8586
8586
|
}) }, { key: "stopDialOut", value: function(l) {
|
|
8587
8587
|
var f = this;
|
|
8588
|
-
return
|
|
8588
|
+
return fe(this._callState, "stopDialOut()"), new Promise(function(p, S) {
|
|
8589
8589
|
f.sendMessageToCallMachine(F({ action: "dialout-stop" }, l), function(k) {
|
|
8590
8590
|
k.error ? S(k.error) : p(k);
|
|
8591
8591
|
});
|
|
8592
8592
|
});
|
|
8593
8593
|
} }, { key: "sipCallTransfer", value: (m = W(function* (l) {
|
|
8594
8594
|
var f = this;
|
|
8595
|
-
if (
|
|
8595
|
+
if (fe(this._callState, "sipCallTransfer()"), !l) throw new Error("sipCallTransfer() requires a sessionId and toEndPoint");
|
|
8596
8596
|
return l.useSipRefer = !1, Os(l, "sipCallTransfer"), Ms(l), new Promise(function(p, S) {
|
|
8597
8597
|
f.sendMessageToCallMachine(F({ action: rs }, l), function(k) {
|
|
8598
8598
|
k.error ? S(k.error) : p(k);
|
|
@@ -8602,7 +8602,7 @@ var Fd = function() {
|
|
|
8602
8602
|
return m.apply(this, arguments);
|
|
8603
8603
|
}) }, { key: "sipRefer", value: (b = W(function* (l) {
|
|
8604
8604
|
var f = this;
|
|
8605
|
-
if (
|
|
8605
|
+
if (fe(this._callState, "sipRefer()"), !l) throw new Error("sessionId and toEndPoint are mandatory parameter");
|
|
8606
8606
|
return l.useSipRefer = !0, Os(l, "sipRefer"), new Promise(function(p, S) {
|
|
8607
8607
|
f.sendMessageToCallMachine(F({ action: rs }, l), function(k) {
|
|
8608
8608
|
k.error ? S(k.error) : p(k);
|
|
@@ -8612,7 +8612,7 @@ var Fd = function() {
|
|
|
8612
8612
|
return b.apply(this, arguments);
|
|
8613
8613
|
}) }, { key: "sendDTMF", value: (v = W(function* (l) {
|
|
8614
8614
|
var f = this;
|
|
8615
|
-
return
|
|
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");
|
|
@@ -8787,7 +8787,7 @@ var Fd = function() {
|
|
|
8787
8787
|
} }, { key: "subscribeToTracksAutomatically", value: function() {
|
|
8788
8788
|
return this._preloadCache.subscribeToTracksAutomatically;
|
|
8789
8789
|
} }, { key: "setSubscribeToTracksAutomatically", value: function(l) {
|
|
8790
|
-
return
|
|
8790
|
+
return fe(this._callState, "setSubscribeToTracksAutomatically()", "Use the subscribeToTracksAutomatically configuration property."), this._preloadCache.subscribeToTracksAutomatically = l, this.sendMessageToCallMachine({ action: "daily-method-subscribe-to-tracks-automatically", enabled: l }), this;
|
|
8791
8791
|
} }, { key: "enumerateDevices", value: (a = W(function* () {
|
|
8792
8792
|
var l = this;
|
|
8793
8793
|
if (this._callObjectMode) {
|
|
@@ -8812,29 +8812,29 @@ var Fd = function() {
|
|
|
8812
8812
|
return a.apply(this, arguments);
|
|
8813
8813
|
}) }, { key: "sendAppMessage", value: function(l) {
|
|
8814
8814
|
var f = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "*";
|
|
8815
|
-
if (
|
|
8815
|
+
if (fe(this._callState, "sendAppMessage()"), JSON.stringify(l).length > this._maxAppMessageSize) throw new Error("Message data too large. Max size is " + this._maxAppMessageSize);
|
|
8816
8816
|
return this.sendMessageToCallMachine({ action: "app-msg", data: l, to: f }), this;
|
|
8817
8817
|
} }, { key: "addFakeParticipant", value: function(l) {
|
|
8818
|
-
return ie(),
|
|
8818
|
+
return ie(), fe(this._callState, "addFakeParticipant()"), this.sendMessageToCallMachine(F({ action: "add-fake-participant" }, l)), this;
|
|
8819
8819
|
} }, { key: "setShowNamesMode", value: function(l) {
|
|
8820
8820
|
return Pe(this._callObjectMode, "setShowNamesMode()"), ie(), l && l !== "always" && l !== "never" ? (console.error('setShowNamesMode argument should be "always", "never", or false'), this) : (this.sendMessageToCallMachine({ action: "set-show-names", mode: l }), this);
|
|
8821
8821
|
} }, { key: "setShowLocalVideo", value: function() {
|
|
8822
8822
|
var l = !(arguments.length > 0 && arguments[0] !== void 0) || arguments[0];
|
|
8823
|
-
return Pe(this._callObjectMode, "setShowLocalVideo()"), ie(),
|
|
8823
|
+
return Pe(this._callObjectMode, "setShowLocalVideo()"), ie(), fe(this._callState, "setShowLocalVideo()"), typeof l != "boolean" ? (console.error("setShowLocalVideo only accepts a boolean value"), this) : (this.sendMessageToCallMachine({ action: "set-show-local-video", show: l }), this._showLocalVideo = l, this);
|
|
8824
8824
|
} }, { key: "showLocalVideo", value: function() {
|
|
8825
8825
|
return Pe(this._callObjectMode, "showLocalVideo()"), ie(), this._showLocalVideo;
|
|
8826
8826
|
} }, { key: "setShowParticipantsBar", value: function() {
|
|
8827
8827
|
var l = !(arguments.length > 0 && arguments[0] !== void 0) || arguments[0];
|
|
8828
|
-
return Pe(this._callObjectMode, "setShowParticipantsBar()"), ie(),
|
|
8828
|
+
return Pe(this._callObjectMode, "setShowParticipantsBar()"), ie(), fe(this._callState, "setShowParticipantsBar()"), typeof l != "boolean" ? (console.error("setShowParticipantsBar only accepts a boolean value"), this) : (this.sendMessageToCallMachine({ action: "set-show-participants-bar", show: l }), this._showParticipantsBar = l, this);
|
|
8829
8829
|
} }, { key: "showParticipantsBar", value: function() {
|
|
8830
8830
|
return Pe(this._callObjectMode, "showParticipantsBar()"), ie(), this._showParticipantsBar;
|
|
8831
8831
|
} }, { key: "customIntegrations", value: function() {
|
|
8832
8832
|
return ie(), Pe(this._callObjectMode, "customIntegrations()"), this._customIntegrations;
|
|
8833
8833
|
} }, { key: "setCustomIntegrations", value: function(l) {
|
|
8834
|
-
return ie(), Pe(this._callObjectMode, "setCustomIntegrations()"),
|
|
8834
|
+
return ie(), Pe(this._callObjectMode, "setCustomIntegrations()"), fe(this._callState, "setCustomIntegrations()"), tc(l) ? (this.sendMessageToCallMachine({ action: "set-custom-integrations", integrations: l }), this._customIntegrations = l, this) : this;
|
|
8835
8835
|
} }, { key: "startCustomIntegrations", value: function(l) {
|
|
8836
8836
|
var f = this;
|
|
8837
|
-
if (ie(), Pe(this._callObjectMode, "startCustomIntegrations()"),
|
|
8837
|
+
if (ie(), Pe(this._callObjectMode, "startCustomIntegrations()"), fe(this._callState, "startCustomIntegrations()"), Array.isArray(l) && l.some(function(k) {
|
|
8838
8838
|
return typeof k != "string";
|
|
8839
8839
|
}) || !Array.isArray(l) && typeof l != "string") return console.error("startCustomIntegrations() only accepts string | string[]"), this;
|
|
8840
8840
|
var p = typeof l == "string" ? [l] : l, S = p.filter(function(k) {
|
|
@@ -8843,7 +8843,7 @@ var Fd = function() {
|
|
|
8843
8843
|
return S.length ? (console.error(`Can't find custom integration(s): "`.concat(S.join(", "), '"')), this) : (this.sendMessageToCallMachine({ action: "start-custom-integrations", ids: p }), this);
|
|
8844
8844
|
} }, { key: "stopCustomIntegrations", value: function(l) {
|
|
8845
8845
|
var f = this;
|
|
8846
|
-
if (ie(), Pe(this._callObjectMode, "stopCustomIntegrations()"),
|
|
8846
|
+
if (ie(), Pe(this._callObjectMode, "stopCustomIntegrations()"), fe(this._callState, "stopCustomIntegrations()"), Array.isArray(l) && l.some(function(k) {
|
|
8847
8847
|
return typeof k != "string";
|
|
8848
8848
|
}) || !Array.isArray(l) && typeof l != "string") return console.error("stopCustomIntegrations() only accepts string | string[]"), this;
|
|
8849
8849
|
var p = typeof l == "string" ? [l] : l, S = p.filter(function(k) {
|
|
@@ -8853,7 +8853,7 @@ var Fd = function() {
|
|
|
8853
8853
|
} }, { key: "customTrayButtons", value: function() {
|
|
8854
8854
|
return Pe(this._callObjectMode, "customTrayButtons()"), ie(), this._customTrayButtons;
|
|
8855
8855
|
} }, { key: "updateCustomTrayButtons", value: function(l) {
|
|
8856
|
-
return Pe(this._callObjectMode, "updateCustomTrayButtons()"), ie(),
|
|
8856
|
+
return Pe(this._callObjectMode, "updateCustomTrayButtons()"), ie(), fe(this._callState, "updateCustomTrayButtons()"), ec(l) ? (this.sendMessageToCallMachine({ action: "update-custom-tray-buttons", btns: l }), this._customTrayButtons = l, this) : (console.error("updateCustomTrayButtons only accepts a dictionary of the type ".concat(JSON.stringify(ir))), this);
|
|
8857
8857
|
} }, { key: "theme", value: function() {
|
|
8858
8858
|
return Pe(this._callObjectMode, "theme()"), this.properties.theme;
|
|
8859
8859
|
} }, { key: "setTheme", value: function(l) {
|
|
@@ -8912,7 +8912,7 @@ var Fd = function() {
|
|
|
8912
8912
|
return n.apply(this, arguments);
|
|
8913
8913
|
}) }, { key: "setNetworkTopology", value: (t = W(function* (l) {
|
|
8914
8914
|
var f = this;
|
|
8915
|
-
return ie(),
|
|
8915
|
+
return ie(), fe(this._callState, "setNetworkTopology()"), new Promise(function(p, S) {
|
|
8916
8916
|
f.sendMessageToCallMachine({ action: "set-network-topology", opts: l }, function(k) {
|
|
8917
8917
|
k.error ? S({ error: k.error }) : p({ workerId: k.workerId });
|
|
8918
8918
|
});
|
|
@@ -9364,7 +9364,7 @@ function qt(r, e) {
|
|
|
9364
9364
|
} else t[n] = r[n];
|
|
9365
9365
|
return t;
|
|
9366
9366
|
}
|
|
9367
|
-
function
|
|
9367
|
+
function fe(r) {
|
|
9368
9368
|
var e = arguments.length > 2 ? arguments[2] : void 0;
|
|
9369
9369
|
if (r !== Lt) {
|
|
9370
9370
|
var t = "".concat(arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "This daily-js method", " only supported after join.");
|
|
@@ -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
|
+
A(this, "refCounters", {});
|
|
12683
12683
|
// Cache for last snapshot (for change detection)
|
|
12684
|
-
|
|
12684
|
+
A(this, "lastSnapshotHash", "");
|
|
12685
12685
|
}
|
|
12686
12686
|
// -------------------------------------------------------------------------
|
|
12687
12687
|
// Main Capture Method
|
|
@@ -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
|
+
A(Ie, "IMPLICIT_ROLES", {
|
|
13351
13351
|
button: "button",
|
|
13352
13352
|
a: "link",
|
|
13353
13353
|
input: "textbox",
|
|
@@ -13373,7 +13373,7 @@ O(Ie, "IMPLICIT_ROLES", {
|
|
|
13373
13373
|
progress: "progressbar",
|
|
13374
13374
|
meter: "meter"
|
|
13375
13375
|
}), /** Input type to role mapping */
|
|
13376
|
-
|
|
13376
|
+
A(Ie, "INPUT_TYPE_ROLES", {
|
|
13377
13377
|
button: "button",
|
|
13378
13378
|
submit: "button",
|
|
13379
13379
|
reset: "button",
|
|
@@ -13389,7 +13389,7 @@ O(Ie, "INPUT_TYPE_ROLES", {
|
|
|
13389
13389
|
text: "textbox",
|
|
13390
13390
|
number: "spinbutton"
|
|
13391
13391
|
}), /** Role prefixes for ref generation */
|
|
13392
|
-
|
|
13392
|
+
A(Ie, "ROLE_PREFIXES", {
|
|
13393
13393
|
button: "B",
|
|
13394
13394
|
link: "L",
|
|
13395
13395
|
textbox: "T",
|
|
@@ -13410,7 +13410,7 @@ O(Ie, "ROLE_PREFIXES", {
|
|
|
13410
13410
|
switch: "SW",
|
|
13411
13411
|
navigation: "NAV"
|
|
13412
13412
|
}), /** Interactive element selector */
|
|
13413
|
-
|
|
13413
|
+
A(Ie, "INTERACTIVE_SELECTOR", `
|
|
13414
13414
|
button,
|
|
13415
13415
|
a[href],
|
|
13416
13416
|
input:not([type="hidden"]),
|
|
@@ -13434,7 +13434,7 @@ O(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
|
+
A(Ie, "SKIP_SELECTORS", [
|
|
13438
13438
|
"#onboarding-overlay",
|
|
13439
13439
|
"#onboarding-sdk-react-ui",
|
|
13440
13440
|
"#hse-highlight-element",
|
|
@@ -13578,17 +13578,17 @@ function lc(r, e = {}) {
|
|
|
13578
13578
|
}
|
|
13579
13579
|
class Fs {
|
|
13580
13580
|
constructor() {
|
|
13581
|
-
|
|
13582
|
-
|
|
13583
|
-
|
|
13584
|
-
|
|
13585
|
-
|
|
13586
|
-
|
|
13587
|
-
|
|
13581
|
+
A(this, "audioContext", null);
|
|
13582
|
+
A(this, "analyzerNode", null);
|
|
13583
|
+
A(this, "sourceNode", null);
|
|
13584
|
+
A(this, "dataArray", new Uint8Array(0));
|
|
13585
|
+
A(this, "isRunning", !1);
|
|
13586
|
+
A(this, "onLevelsCallback", null);
|
|
13587
|
+
A(this, "animationId", null);
|
|
13588
13588
|
/**
|
|
13589
13589
|
* Analysis loop - runs via requestAnimationFrame
|
|
13590
13590
|
*/
|
|
13591
|
-
|
|
13591
|
+
A(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 Fs {
|
|
|
13624
13624
|
}
|
|
13625
13625
|
class lh {
|
|
13626
13626
|
constructor() {
|
|
13627
|
-
|
|
13627
|
+
A(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 lh {
|
|
|
13643
13643
|
}
|
|
13644
13644
|
class uh {
|
|
13645
13645
|
constructor() {
|
|
13646
|
-
|
|
13647
|
-
|
|
13648
|
-
|
|
13649
|
-
|
|
13650
|
-
|
|
13646
|
+
A(this, "lastSnapshot", null);
|
|
13647
|
+
A(this, "lastSnapshotHash", "");
|
|
13648
|
+
A(this, "snapshotInterval", null);
|
|
13649
|
+
A(this, "sendCallback", null);
|
|
13650
|
+
A(this, "correlationCounter", 0);
|
|
13651
13651
|
// For tracking snapshots across client/server
|
|
13652
|
-
|
|
13652
|
+
A(this, "INTERACTIVE_TAGS", /* @__PURE__ */ new Set([
|
|
13653
13653
|
"button",
|
|
13654
13654
|
"a",
|
|
13655
13655
|
"input",
|
|
@@ -13661,7 +13661,7 @@ class uh {
|
|
|
13661
13661
|
"option",
|
|
13662
13662
|
"menuitem"
|
|
13663
13663
|
]));
|
|
13664
|
-
|
|
13664
|
+
A(this, "INTERACTIVE_ROLES", /* @__PURE__ */ new Set([
|
|
13665
13665
|
"button",
|
|
13666
13666
|
"link",
|
|
13667
13667
|
"menuitem",
|
|
@@ -13678,8 +13678,8 @@ class uh {
|
|
|
13678
13678
|
/**
|
|
13679
13679
|
* Setup mutation observer for significant DOM changes
|
|
13680
13680
|
*/
|
|
13681
|
-
|
|
13682
|
-
|
|
13681
|
+
A(this, "mutationObserver", null);
|
|
13682
|
+
A(this, "mutationDebounceTimer", null);
|
|
13683
13683
|
}
|
|
13684
13684
|
/**
|
|
13685
13685
|
* Start periodic DOM snapshots
|
|
@@ -15453,13 +15453,13 @@ const St = class St {
|
|
|
15453
15453
|
}
|
|
15454
15454
|
};
|
|
15455
15455
|
// Static reference to DOMIntrospector for bounding box lookups
|
|
15456
|
-
|
|
15457
|
-
let
|
|
15456
|
+
A(St, "domIntrospector", null);
|
|
15457
|
+
let ue = St;
|
|
15458
15458
|
class dh {
|
|
15459
15459
|
constructor() {
|
|
15460
|
-
|
|
15460
|
+
A(this, "confirmationSound");
|
|
15461
15461
|
/** Last error message from a failed action (e.g., modal overlay blocking click) */
|
|
15462
|
-
|
|
15462
|
+
A(this, "lastError", null);
|
|
15463
15463
|
this.confirmationSound = new Audio("data:audio/wav;base64,UklGRiQAAABXQVZFZm10IBAAAAABAAEARKwAAIhYAQACABAAZGF0YQAAAAA=");
|
|
15464
15464
|
}
|
|
15465
15465
|
/**
|
|
@@ -15506,7 +15506,7 @@ class dh {
|
|
|
15506
15506
|
}
|
|
15507
15507
|
if (e.target.optionText && e.action === "click") {
|
|
15508
15508
|
console.log("[ActionExecutor] 🔽 Dropdown option click detected:", e.target.optionText);
|
|
15509
|
-
let s =
|
|
15509
|
+
let s = ue.resolveTarget(e.target);
|
|
15510
15510
|
if (!s) {
|
|
15511
15511
|
console.log("[ActionExecutor] Option not visible - dropdown may be closed, attempting to open...");
|
|
15512
15512
|
let a = !1;
|
|
@@ -15522,23 +15522,23 @@ class dh {
|
|
|
15522
15522
|
}
|
|
15523
15523
|
if (!a && e.target.selector) {
|
|
15524
15524
|
console.log("[ActionExecutor] Trying to find dropdown by selector:", e.target.selector);
|
|
15525
|
-
const c = { ...e.target, optionText: void 0 }, u =
|
|
15525
|
+
const c = { ...e.target, optionText: void 0 }, u = ue.resolveTarget(c);
|
|
15526
15526
|
if (u) {
|
|
15527
15527
|
const d = this.findComboboxInput(u);
|
|
15528
15528
|
d && (this.handleComboboxClick(d), a = !0);
|
|
15529
15529
|
}
|
|
15530
15530
|
}
|
|
15531
15531
|
if (a) {
|
|
15532
|
-
if (console.log("[ActionExecutor] Waiting for dropdown to open..."), await new Promise((c) => setTimeout(c, 300)), s =
|
|
15532
|
+
if (console.log("[ActionExecutor] Waiting for dropdown to open..."), await new Promise((c) => setTimeout(c, 300)), s = ue.resolveTarget(e.target), !s)
|
|
15533
15533
|
return console.warn("[ActionExecutor] ❌ Option still not found after opening dropdown:", e.target.optionText), !1;
|
|
15534
15534
|
console.log("[ActionExecutor] ✅ Found option after opening dropdown");
|
|
15535
15535
|
} else
|
|
15536
15536
|
return console.warn("[ActionExecutor] ❌ Could not open dropdown - no trigger found. Add a separate task to open the dropdown first."), !1;
|
|
15537
15537
|
}
|
|
15538
|
-
return t && this.isHybridActionDestructive(e) && !await this.getHybridConsent(e) ? !1 : (
|
|
15538
|
+
return t && this.isHybridActionDestructive(e) && !await this.getHybridConsent(e) ? !1 : (ue.scrollIntoView(s), await new Promise((a) => setTimeout(a, 100)), this.performClick(s), this.confirmationSound.play().catch(() => {
|
|
15539
15539
|
}), console.log(`[ActionExecutor] ✅ Successfully clicked dropdown option: "${e.target.optionText}"`), !0);
|
|
15540
15540
|
}
|
|
15541
|
-
const n =
|
|
15541
|
+
const n = ue.resolveTarget(e.target);
|
|
15542
15542
|
if (!n)
|
|
15543
15543
|
return console.warn("[ActionExecutor] Could not resolve target:", e.target), !1;
|
|
15544
15544
|
if (t && this.isHybridActionDestructive(e) && !await this.getHybridConsent(e))
|
|
@@ -15558,7 +15558,7 @@ class dh {
|
|
|
15558
15558
|
* @param selector - Optional selector for special dropdown handling
|
|
15559
15559
|
*/
|
|
15560
15560
|
async executeOnElement(e, t, n, i) {
|
|
15561
|
-
switch (
|
|
15561
|
+
switch (ue.scrollIntoView(t), await new Promise((o) => setTimeout(o, 300)), e) {
|
|
15562
15562
|
case "click":
|
|
15563
15563
|
await this.expandCollapsedContainer(t), this.simulateClick(t, i);
|
|
15564
15564
|
break;
|
|
@@ -15852,7 +15852,7 @@ class dh {
|
|
|
15852
15852
|
for (const i of t) {
|
|
15853
15853
|
const o = document.querySelectorAll(i);
|
|
15854
15854
|
for (const s of o) {
|
|
15855
|
-
if (!
|
|
15855
|
+
if (!ue.isVisible(s)) continue;
|
|
15856
15856
|
const a = [
|
|
15857
15857
|
'[role="option"]',
|
|
15858
15858
|
'[class*="option"]',
|
|
@@ -16183,11 +16183,13 @@ ${e.description || ""}`;
|
|
|
16183
16183
|
}
|
|
16184
16184
|
class hh {
|
|
16185
16185
|
constructor() {
|
|
16186
|
-
|
|
16187
|
-
|
|
16188
|
-
|
|
16189
|
-
|
|
16186
|
+
A(this, "container", null);
|
|
16187
|
+
A(this, "highlightEl", null);
|
|
16188
|
+
A(this, "tooltipElement", null);
|
|
16189
|
+
A(this, "floeCursor", null);
|
|
16190
|
+
A(this, "cursorHasBeenPositioned", !1);
|
|
16190
16191
|
}
|
|
16192
|
+
// Track if cursor has been shown at least once
|
|
16191
16193
|
/**
|
|
16192
16194
|
* Inject overlay into the page
|
|
16193
16195
|
*/
|
|
@@ -16279,9 +16281,17 @@ class hh {
|
|
|
16279
16281
|
}
|
|
16280
16282
|
/**
|
|
16281
16283
|
* Show the Floe cursor
|
|
16284
|
+
* On first appearance, positions the cursor at the bot floating icon (bottom-right)
|
|
16285
|
+
* so the initial animation starts from a natural origin point.
|
|
16282
16286
|
*/
|
|
16283
16287
|
showFloeCursor() {
|
|
16284
|
-
|
|
16288
|
+
if (this.floeCursor) {
|
|
16289
|
+
if (!this.cursorHasBeenPositioned) {
|
|
16290
|
+
const e = window.innerWidth - 50, t = window.innerHeight - 50;
|
|
16291
|
+
this.floeCursor.style.left = `${e}px`, this.floeCursor.style.top = `${t}px`, this.cursorHasBeenPositioned = !0, console.log("[OverlaySystem] Cursor initial position set to bot icon:", e, t);
|
|
16292
|
+
}
|
|
16293
|
+
this.floeCursor.style.opacity = "1", this.floeCursor.style.transform = "scale(1)";
|
|
16294
|
+
}
|
|
16285
16295
|
}
|
|
16286
16296
|
/**
|
|
16287
16297
|
* Hide the Floe cursor
|
|
@@ -16541,7 +16551,7 @@ class hh {
|
|
|
16541
16551
|
*/
|
|
16542
16552
|
highlightTarget(e, t = {}) {
|
|
16543
16553
|
console.log("╔══════════════════════════════════════════════════════════════╗"), console.log("║ [OverlaySystem] 💡 HIGHLIGHT TARGET CALLED ║"), console.log("╚══════════════════════════════════════════════════════════════╝"), console.log("[OverlaySystem] Target:", JSON.stringify(e, null, 2)), console.log("[OverlaySystem] Options:", t);
|
|
16544
|
-
const n =
|
|
16554
|
+
const n = ue.resolveTarget(e);
|
|
16545
16555
|
return n ? (console.log("[OverlaySystem] ✅ Element found, applying highlight..."), console.log("[OverlaySystem] Element details:"), console.log(" • tagName:", n.tagName), console.log(" • id:", n.id || "(none)"), console.log(" • classes:", n.className || "(none)"), console.log(" • innerText:", (n.innerText || "").substring(0, 50) + "..."), this.highlightElement(n, t), console.log("[OverlaySystem] 🎨 Highlight applied successfully!"), !0) : (console.warn("[OverlaySystem] ❌ Element not found for target"), !1);
|
|
16546
16556
|
}
|
|
16547
16557
|
/**
|
|
@@ -16575,7 +16585,7 @@ class hh {
|
|
|
16575
16585
|
const h = c.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);
|
|
16576
16586
|
h && (o = parseInt(h[1]), s = parseInt(h[2]), a = parseInt(h[3]));
|
|
16577
16587
|
}
|
|
16578
|
-
if (this.highlightEl || (console.log("[OverlaySystem] Creating new highlight element"), this.highlightEl = document.createElement("div"), this.highlightEl.id = "hse-highlight-element", this.highlightEl.setAttribute(Wt, "highlight"), (d = this.container) == null || d.appendChild(this.highlightEl)), console.log("[OverlaySystem] Scrolling element into view..."),
|
|
16588
|
+
if (this.highlightEl || (console.log("[OverlaySystem] Creating new highlight element"), this.highlightEl = document.createElement("div"), this.highlightEl.id = "hse-highlight-element", this.highlightEl.setAttribute(Wt, "highlight"), (d = this.container) == null || d.appendChild(this.highlightEl)), console.log("[OverlaySystem] Scrolling element into view..."), ue.scrollIntoView(e), console.log("[OverlaySystem] Waiting 300ms for scroll to complete..."), setTimeout(() => {
|
|
16579
16589
|
const h = e.getBoundingClientRect();
|
|
16580
16590
|
console.log("[OverlaySystem] Element position after scroll:"), console.log(" • top:", h.top), console.log(" • left:", h.left), console.log(" • width:", h.width), console.log(" • height:", h.height), this.highlightEl && (this.highlightEl.style.cssText = `
|
|
16581
16591
|
position: fixed;
|
|
@@ -16714,6 +16724,21 @@ class hh {
|
|
|
16714
16724
|
hideTooltip() {
|
|
16715
16725
|
this.tooltipElement && (this.tooltipElement.remove(), this.tooltipElement = null);
|
|
16716
16726
|
}
|
|
16727
|
+
/**
|
|
16728
|
+
* Clean up all overlays: hide cursor, clear highlight, hide tooltip.
|
|
16729
|
+
* Call this on disconnect/errors/navigation to remove all visual guidance from screen.
|
|
16730
|
+
* Does NOT destroy DOM elements (unlike remove()), so overlay can be reused.
|
|
16731
|
+
*/
|
|
16732
|
+
cleanup() {
|
|
16733
|
+
this.clearHighlight(), this.hideFloeCursor(), this.hideTooltip(), console.log("[OverlaySystem] Cleaned up all overlays");
|
|
16734
|
+
}
|
|
16735
|
+
/**
|
|
16736
|
+
* Reset cursor tracking state so next show starts from the bot icon again.
|
|
16737
|
+
* Call this on full disconnect to ensure fresh start on reconnect.
|
|
16738
|
+
*/
|
|
16739
|
+
resetCursorState() {
|
|
16740
|
+
this.cursorHasBeenPositioned = !1, this.floeCursor && (this.floeCursor.style.top = "-100px", this.floeCursor.style.left = "-100px", this.floeCursor.style.opacity = "0", this.floeCursor.style.transform = "scale(0.8)"), console.log("[OverlaySystem] Cursor state reset");
|
|
16741
|
+
}
|
|
16717
16742
|
/**
|
|
16718
16743
|
* Remove overlay and all injected style elements
|
|
16719
16744
|
*/
|
|
@@ -16722,12 +16747,12 @@ class hh {
|
|
|
16722
16747
|
const e = document.getElementById("floe-cursor-styles");
|
|
16723
16748
|
e && e.remove();
|
|
16724
16749
|
const t = document.getElementById("onboarding-animations");
|
|
16725
|
-
t && t.remove(), (n = this.container) == null || n.remove(), this.container = null, this.highlightEl = null, this.tooltipElement = null;
|
|
16750
|
+
t && t.remove(), this.floeCursor && (this.floeCursor.remove(), this.floeCursor = null), this.cursorHasBeenPositioned = !1, (n = this.container) == null || n.remove(), this.container = null, this.highlightEl = null, this.tooltipElement = null;
|
|
16726
16751
|
}
|
|
16727
16752
|
}
|
|
16728
16753
|
class Li {
|
|
16729
16754
|
constructor(e) {
|
|
16730
|
-
|
|
16755
|
+
A(this, "piiPatterns");
|
|
16731
16756
|
this.piiPatterns = {
|
|
16732
16757
|
email: /[\w.-]+@[\w.-]+\.\w+/,
|
|
16733
16758
|
phone: /[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4,6}/,
|
|
@@ -16944,22 +16969,22 @@ class Li {
|
|
|
16944
16969
|
}
|
|
16945
16970
|
class ph {
|
|
16946
16971
|
constructor(e) {
|
|
16947
|
-
|
|
16948
|
-
|
|
16949
|
-
|
|
16950
|
-
|
|
16951
|
-
|
|
16952
|
-
|
|
16953
|
-
|
|
16954
|
-
|
|
16955
|
-
|
|
16956
|
-
|
|
16972
|
+
A(this, "sdk");
|
|
16973
|
+
A(this, "domIntrospector", null);
|
|
16974
|
+
A(this, "lastUrl", "");
|
|
16975
|
+
A(this, "clickHandler", null);
|
|
16976
|
+
A(this, "focusHandler", null);
|
|
16977
|
+
A(this, "blurHandler", null);
|
|
16978
|
+
A(this, "inputHandler", null);
|
|
16979
|
+
A(this, "keydownHandler", null);
|
|
16980
|
+
A(this, "inputDebounceTimers", /* @__PURE__ */ new Map());
|
|
16981
|
+
A(this, "isTracking", !1);
|
|
16957
16982
|
// Scroll tracking for Fast Execution System
|
|
16958
|
-
|
|
16959
|
-
|
|
16983
|
+
A(this, "scrollHandler", null);
|
|
16984
|
+
A(this, "scrollDebounceTimer", null);
|
|
16960
16985
|
// URL tracking for SPAs
|
|
16961
|
-
|
|
16962
|
-
|
|
16986
|
+
A(this, "urlCheckInterval", null);
|
|
16987
|
+
A(this, "popstateHandler", null);
|
|
16963
16988
|
this.sdk = e, this.lastUrl = window.location.href;
|
|
16964
16989
|
}
|
|
16965
16990
|
/**
|
|
@@ -17219,7 +17244,7 @@ class ph {
|
|
|
17219
17244
|
}
|
|
17220
17245
|
class uc {
|
|
17221
17246
|
constructor() {
|
|
17222
|
-
|
|
17247
|
+
A(this, "loadingSelectors", [
|
|
17223
17248
|
'[role="progressbar"]',
|
|
17224
17249
|
".loading",
|
|
17225
17250
|
".spinner",
|
|
@@ -17303,15 +17328,15 @@ class fh {
|
|
|
17303
17328
|
}
|
|
17304
17329
|
class gh {
|
|
17305
17330
|
constructor() {
|
|
17306
|
-
|
|
17307
|
-
|
|
17308
|
-
|
|
17309
|
-
|
|
17310
|
-
|
|
17311
|
-
|
|
17312
|
-
|
|
17313
|
-
|
|
17314
|
-
|
|
17331
|
+
A(this, "lastUrl", "");
|
|
17332
|
+
A(this, "urlChangeCallback", null);
|
|
17333
|
+
A(this, "loadingDetector");
|
|
17334
|
+
A(this, "domStabilityChecker");
|
|
17335
|
+
A(this, "originalPushState", null);
|
|
17336
|
+
A(this, "originalReplaceState", null);
|
|
17337
|
+
A(this, "popstateHandler", null);
|
|
17338
|
+
A(this, "isStarted", !1);
|
|
17339
|
+
A(this, "handleUrlChange", async () => {
|
|
17315
17340
|
const e = window.location.href;
|
|
17316
17341
|
if (e !== this.lastUrl) {
|
|
17317
17342
|
console.log("[NavigationCompleteDetector] URL changed:", e), this.lastUrl = e;
|
|
@@ -17360,10 +17385,10 @@ class gh {
|
|
|
17360
17385
|
}
|
|
17361
17386
|
class mh {
|
|
17362
17387
|
constructor(e, t) {
|
|
17363
|
-
|
|
17364
|
-
|
|
17365
|
-
|
|
17366
|
-
|
|
17388
|
+
A(this, "overlay");
|
|
17389
|
+
A(this, "loadingDetector");
|
|
17390
|
+
A(this, "domIntrospector", null);
|
|
17391
|
+
A(this, "isExecuting", !1);
|
|
17367
17392
|
this.overlay = e, this.loadingDetector = new uc();
|
|
17368
17393
|
}
|
|
17369
17394
|
/**
|
|
@@ -17399,7 +17424,7 @@ class mh {
|
|
|
17399
17424
|
}
|
|
17400
17425
|
return console.log("[BatchedActionExecutor] ✅ Batch completed successfully"), e.completionCallback && e.completionCallback(), { success: !0, completedSteps: t };
|
|
17401
17426
|
} finally {
|
|
17402
|
-
this.isExecuting = !1, this.overlay.clearHighlight();
|
|
17427
|
+
this.isExecuting = !1, this.overlay.clearHighlight(), this.overlay.hideFloeCursor();
|
|
17403
17428
|
}
|
|
17404
17429
|
}
|
|
17405
17430
|
async executeStep(e) {
|
|
@@ -17435,7 +17460,7 @@ class mh {
|
|
|
17435
17460
|
let i = null;
|
|
17436
17461
|
const o = 3, s = [300, 500, 800];
|
|
17437
17462
|
for (let g = 0; g <= o; g++)
|
|
17438
|
-
if (g > 0 && (console.log(`[BatchedActionExecutor] Retry ${g}/${o} in ${s[g - 1]}ms...`), await new Promise((v) => setTimeout(v, s[g - 1]))), i =
|
|
17463
|
+
if (g > 0 && (console.log(`[BatchedActionExecutor] Retry ${g}/${o} in ${s[g - 1]}ms...`), await new Promise((v) => setTimeout(v, s[g - 1]))), i = ue.resolveTarget(e.target), i) {
|
|
17439
17464
|
const v = ((d = i.textContent) == null ? void 0 : d.trim().toLowerCase()) || "", b = i.tagName.toLowerCase();
|
|
17440
17465
|
if (t && !v.includes(t)) {
|
|
17441
17466
|
console.warn(`[BatchedActionExecutor] ⚠️ Found element text "${v.slice(0, 50)}" doesn't match expected "${t}"`), i = null;
|
|
@@ -17510,13 +17535,13 @@ class mh {
|
|
|
17510
17535
|
async executeScrollStep(e) {
|
|
17511
17536
|
if (!e.target)
|
|
17512
17537
|
return console.warn("[BatchedActionExecutor] Scroll step has no target"), !1;
|
|
17513
|
-
const t =
|
|
17538
|
+
const t = ue.resolveTarget(e.target);
|
|
17514
17539
|
return t ? (t.scrollIntoView({ behavior: "auto", block: "center" }), await new Promise((n) => setTimeout(n, 100)), !0) : (console.warn("[BatchedActionExecutor] Scroll target not found:", e.target), !0);
|
|
17515
17540
|
}
|
|
17516
17541
|
async waitForElement(e, t) {
|
|
17517
17542
|
const n = Date.now();
|
|
17518
17543
|
for (; Date.now() - n < t; ) {
|
|
17519
|
-
if (
|
|
17544
|
+
if (ue.resolveTarget(e)) return !0;
|
|
17520
17545
|
await new Promise((o) => setTimeout(o, 100));
|
|
17521
17546
|
}
|
|
17522
17547
|
return !1;
|
|
@@ -17525,74 +17550,74 @@ class mh {
|
|
|
17525
17550
|
class dc extends lh {
|
|
17526
17551
|
constructor(t) {
|
|
17527
17552
|
super();
|
|
17528
|
-
|
|
17529
|
-
|
|
17530
|
-
|
|
17531
|
-
|
|
17532
|
-
|
|
17533
|
-
|
|
17534
|
-
|
|
17535
|
-
|
|
17536
|
-
|
|
17537
|
-
|
|
17538
|
-
|
|
17539
|
-
|
|
17553
|
+
A(this, "config");
|
|
17554
|
+
A(this, "sessionId");
|
|
17555
|
+
A(this, "overlay");
|
|
17556
|
+
A(this, "capture");
|
|
17557
|
+
A(this, "actionExecutor");
|
|
17558
|
+
A(this, "pipecatClient", null);
|
|
17559
|
+
A(this, "transport", null);
|
|
17560
|
+
A(this, "isInitialized", !1);
|
|
17561
|
+
A(this, "reactRoot", null);
|
|
17562
|
+
A(this, "reactContainer", null);
|
|
17563
|
+
A(this, "agentState", "idle");
|
|
17564
|
+
A(this, "pausedSessionId", null);
|
|
17540
17565
|
// UI state only - tracks which session is paused
|
|
17541
|
-
|
|
17566
|
+
A(this, "pendingResumeSessionId", null);
|
|
17542
17567
|
// Explicit resume intent - set only by resumeSession(), cleared after use
|
|
17543
|
-
|
|
17544
|
-
|
|
17545
|
-
|
|
17546
|
-
|
|
17568
|
+
A(this, "botTranscript", "");
|
|
17569
|
+
A(this, "userTranscript", "");
|
|
17570
|
+
A(this, "transcriptHistory", []);
|
|
17571
|
+
A(this, "lastUserTranscript", "");
|
|
17547
17572
|
// Track final user transcript for history
|
|
17548
|
-
|
|
17549
|
-
|
|
17573
|
+
A(this, "isConnected", !1);
|
|
17574
|
+
A(this, "connectInFlight", !1);
|
|
17550
17575
|
// Guard against concurrent connect/cancel races
|
|
17551
|
-
|
|
17576
|
+
A(this, "micEnabled", !0);
|
|
17552
17577
|
// Track actual mute state
|
|
17553
|
-
|
|
17578
|
+
A(this, "userIsSpeaking", !1);
|
|
17554
17579
|
// Track if user is actively speaking
|
|
17555
|
-
|
|
17580
|
+
A(this, "botIsSpeaking", !1);
|
|
17556
17581
|
// Track if bot is actively speaking
|
|
17557
|
-
|
|
17582
|
+
A(this, "audioLevels", []);
|
|
17558
17583
|
// Real-time audio levels for visualization
|
|
17559
|
-
|
|
17584
|
+
A(this, "_discoveryPopupShown", !1);
|
|
17560
17585
|
// Track if discovery popup was shown this session
|
|
17561
|
-
|
|
17586
|
+
A(this, "_pendingDiscoveryStart", !1);
|
|
17562
17587
|
// User chose discovery, waiting to start after connect
|
|
17563
|
-
|
|
17588
|
+
A(this, "botAudioAnalyzer", null);
|
|
17564
17589
|
// Audio analyzer for bot FFT
|
|
17565
|
-
|
|
17590
|
+
A(this, "userAudioAnalyzer", null);
|
|
17566
17591
|
// Audio analyzer for user mic FFT
|
|
17567
|
-
|
|
17592
|
+
A(this, "userMicStream", null);
|
|
17568
17593
|
// User's mic stream for analysis
|
|
17569
|
-
|
|
17594
|
+
A(this, "userMicStreamRequestId", 0);
|
|
17570
17595
|
// Guards async getUserMedia against disconnect races
|
|
17571
|
-
|
|
17572
|
-
|
|
17573
|
-
|
|
17574
|
-
|
|
17575
|
-
|
|
17596
|
+
A(this, "audioElements", []);
|
|
17597
|
+
A(this, "pageTracker");
|
|
17598
|
+
A(this, "screenShareEnabled", !1);
|
|
17599
|
+
A(this, "domIntrospector");
|
|
17600
|
+
A(this, "accessibleSnapshot");
|
|
17576
17601
|
// Fast Execution System
|
|
17577
|
-
|
|
17578
|
-
|
|
17579
|
-
|
|
17602
|
+
A(this, "fastExecutionMode", !1);
|
|
17603
|
+
A(this, "batchedActionExecutor", null);
|
|
17604
|
+
A(this, "navigationCompleteDetector", null);
|
|
17580
17605
|
// Bot Action Tracking - counter for nested/concurrent bot actions
|
|
17581
17606
|
// Use counter instead of boolean to handle nested actions correctly
|
|
17582
|
-
|
|
17607
|
+
A(this, "_botActionDepth", 0);
|
|
17583
17608
|
// EndUser status from API (for skip onboarding logic)
|
|
17584
|
-
|
|
17609
|
+
A(this, "endUserStatus", null);
|
|
17585
17610
|
// UX Polish - Connection progress and returning user tracking
|
|
17586
|
-
|
|
17587
|
-
|
|
17611
|
+
A(this, "connectionProgress", null);
|
|
17612
|
+
A(this, "isReturningUser", !1);
|
|
17588
17613
|
// True only for actual returning users (detected via API or localStorage)
|
|
17589
|
-
|
|
17614
|
+
A(this, "hasSkippedOnboarding", !1);
|
|
17590
17615
|
// True when new user skips the welcome modal
|
|
17591
|
-
|
|
17616
|
+
A(this, "_isMinimized", !1);
|
|
17592
17617
|
// Text mode state
|
|
17593
|
-
|
|
17618
|
+
A(this, "textModeEnabled", !1);
|
|
17594
17619
|
// Plan progress state (sent from bot during guided plan execution)
|
|
17595
|
-
|
|
17620
|
+
A(this, "planProgress", null);
|
|
17596
17621
|
if (!t.clientKey)
|
|
17597
17622
|
throw new Error("Client key is required");
|
|
17598
17623
|
const n = "https://api.dev.floe.so";
|
|
@@ -17610,7 +17635,7 @@ class dc extends lh {
|
|
|
17610
17635
|
localStorage.getItem("floe_text_mode") === "true" && (this.textModeEnabled = !0);
|
|
17611
17636
|
} catch {
|
|
17612
17637
|
}
|
|
17613
|
-
this.sessionId = this.generateSessionId(), this.overlay = new hh(), this.capture = new Li(this.config.redactionPatterns), this.actionExecutor = new dh(), this.pageTracker = new ph(this), this.domIntrospector = new uh(),
|
|
17638
|
+
this.sessionId = this.generateSessionId(), this.overlay = new hh(), this.capture = new Li(this.config.redactionPatterns), this.actionExecutor = new dh(), this.pageTracker = new ph(this), this.domIntrospector = new uh(), ue.setDOMIntrospector(this.domIntrospector), this.accessibleSnapshot = new ui(), this.batchedActionExecutor = new mh(this.overlay, this.actionExecutor), this.batchedActionExecutor.setDOMIntrospector(this.domIntrospector), window.__onboardingSDK = this, this.config.debug && console.log("[OnboardingSDK] Initialized with config:", this.config);
|
|
17614
17639
|
}
|
|
17615
17640
|
/**
|
|
17616
17641
|
* Generate unique session ID
|
|
@@ -17732,7 +17757,7 @@ class dc extends lh {
|
|
|
17732
17757
|
*/
|
|
17733
17758
|
setupNavigationDetection() {
|
|
17734
17759
|
this.navigationCompleteDetector || (this.navigationCompleteDetector = new gh()), this.navigationCompleteDetector.start((t) => {
|
|
17735
|
-
console.log("[OnboardingSDK] Navigation complete detected:", t), this.sendMetadata({
|
|
17760
|
+
console.log("[OnboardingSDK] Navigation complete detected:", t), this.overlay.clearHighlight(), this.overlay.hideFloeCursor(), this.sendMetadata({
|
|
17736
17761
|
type: "navigation_complete",
|
|
17737
17762
|
url: t,
|
|
17738
17763
|
timestamp: Date.now()
|
|
@@ -17897,7 +17922,7 @@ class dc extends lh {
|
|
|
17897
17922
|
* Disconnect and minimize the UI (instead of removing it)
|
|
17898
17923
|
*/
|
|
17899
17924
|
async disconnectAndMinimize() {
|
|
17900
|
-
this.pageTracker.stop(), this.domIntrospector.stopCapturing(), this.navigationCompleteDetector && this.navigationCompleteDetector.stop(), this.overlay.
|
|
17925
|
+
this.pageTracker.stop(), this.domIntrospector.stopCapturing(), this.navigationCompleteDetector && this.navigationCompleteDetector.stop(), this.overlay.cleanup(), this.overlay.resetCursorState(), this.pipecatClient && (await this.pipecatClient.disconnect(), this.pipecatClient = null), this.transport && (this.transport = null), this.audioElements && (this.audioElements.forEach((t) => {
|
|
17901
17926
|
t.pause(), t.remove();
|
|
17902
17927
|
}), this.audioElements = []), this.botAudioAnalyzer && (this.botAudioAnalyzer.destroy(), this.botAudioAnalyzer = null), this.userAudioAnalyzer && (this.userAudioAnalyzer.destroy(), this.userAudioAnalyzer = null), this.userMicStreamRequestId++, this.userMicStream && (this.userMicStream.getTracks().forEach((t) => t.stop()), this.userMicStream = null), this.audioLevels = [], this.isConnected = !1, this.agentState = "idle", this._isMinimized = !0, this.botTranscript = "", this.userTranscript = "", this.renderReactUI(), console.log("[OnboardingSDK] Disconnected and minimized"), this.emit("disconnected"), this.emit("minimized");
|
|
17903
17928
|
}
|
|
@@ -17964,7 +17989,7 @@ class dc extends lh {
|
|
|
17964
17989
|
console.log("[OnboardingSDK] Connected to Pipecat"), this.isConnected = !0, this.agentState = "listening", this.micEnabled = ((t = this.pipecatClient) == null ? void 0 : t.isMicEnabled) ?? this.config.enableAudio !== !1, console.log("[OnboardingSDK] 🎤 Mic state on connect:", this.micEnabled ? "ON" : "MUTED"), this.textModeEnabled && this.pipecatClient && (this.pipecatClient.enableMic(!1), this.micEnabled = !1, console.log("[OnboardingSDK] ⌨️ Text mode active — mic muted on connect")), this.clearConnectionProgress(), this.renderReactUI(), this.emit("connected");
|
|
17965
17990
|
},
|
|
17966
17991
|
onDisconnected: () => {
|
|
17967
|
-
console.log("[OnboardingSDK] Disconnected from Pipecat"), this.isConnected = !1, this.agentState = "idle", this.pageTracker.stop(), this.domIntrospector.stopCapturing(), this.navigationCompleteDetector && this.navigationCompleteDetector.stop(), this.overlay.
|
|
17992
|
+
console.log("[OnboardingSDK] Disconnected from Pipecat"), this.isConnected = !1, this.agentState = "idle", this.pageTracker.stop(), this.domIntrospector.stopCapturing(), this.navigationCompleteDetector && this.navigationCompleteDetector.stop(), this.overlay.cleanup(), this.overlay.resetCursorState(), this.audioElements && (this.audioElements.forEach((t) => {
|
|
17968
17993
|
t.pause(), t.remove();
|
|
17969
17994
|
}), this.audioElements = []), this.botAudioAnalyzer && (this.botAudioAnalyzer.destroy(), this.botAudioAnalyzer = null), this.userAudioAnalyzer && (this.userAudioAnalyzer.destroy(), this.userAudioAnalyzer = null), this.userMicStreamRequestId++, this.userMicStream && (console.log("[OnboardingSDK] 🎤 Stopping user microphone stream"), this.userMicStream.getTracks().forEach((t) => t.stop()), this.userMicStream = null), this.audioLevels = [], this.renderReactUI(), this.emit("disconnected");
|
|
17970
17995
|
},
|
|
@@ -18139,13 +18164,13 @@ class dc extends lh {
|
|
|
18139
18164
|
console.log("[OnboardingSDK] 🎯 Received direct hybrid action:", n.action), this.handleHybridAction(n);
|
|
18140
18165
|
return;
|
|
18141
18166
|
}
|
|
18142
|
-
n.type === "highlight" ? (console.log("[OnboardingSDK] Handling highlight command"), n.target ? this.overlay.highlightTarget(n.target, n.options) : n.selector && this.overlay.highlight(n.selector, n.options)) : n.type === "tooltip" && n.text ? this.overlay.showTooltip(n.text, n.options) : n.type === "action" ? n.target ? this.handleHybridAction(n) : this.actionExecutor.executeWithConsent(n.action) : n.type === "clear_highlight" ? this.overlay.clearHighlight() : n.type === "batched_navigation" ? this.handleBatchedNavigation(n) : n.type === "fast_action" ? this.executeActionFast(n) : n.type === "execute_api" || n.action === "execute_api" ? this.handleExecuteApi(n) : n.type === "session_paused" ? (console.log("[OnboardingSDK] Session paused:", n), this.agentState = "paused", this.pausedSessionId = n.session_id || null, this.overlay.clearHighlight(), this.renderReactUI(), this.emit("sessionPaused", n)) : n.type === "plan_progress" ? (console.log("[OnboardingSDK] Plan progress:", n), this.planProgress = {
|
|
18167
|
+
n.type === "highlight" ? (console.log("[OnboardingSDK] Handling highlight command"), n.target ? this.overlay.highlightTarget(n.target, n.options) : n.selector && this.overlay.highlight(n.selector, n.options)) : n.type === "tooltip" && n.text ? this.overlay.showTooltip(n.text, n.options) : n.type === "action" ? n.target ? this.handleHybridAction(n) : this.actionExecutor.executeWithConsent(n.action) : n.type === "clear_highlight" ? this.overlay.clearHighlight() : n.type === "batched_navigation" ? this.handleBatchedNavigation(n) : n.type === "fast_action" ? this.executeActionFast(n) : n.type === "execute_api" || n.action === "execute_api" ? this.handleExecuteApi(n) : n.type === "session_paused" ? (console.log("[OnboardingSDK] Session paused:", n), this.agentState = "paused", this.pausedSessionId = n.session_id || null, this.overlay.clearHighlight(), this.overlay.hideFloeCursor(), this.renderReactUI(), this.emit("sessionPaused", n)) : n.type === "plan_progress" ? (console.log("[OnboardingSDK] Plan progress:", n), this.planProgress = {
|
|
18143
18168
|
planName: n.planName || "",
|
|
18144
18169
|
currentStep: n.currentStep || 0,
|
|
18145
18170
|
totalSteps: n.totalSteps || 0,
|
|
18146
18171
|
progressPercent: n.progressPercent || 0,
|
|
18147
18172
|
currentTaskTitle: n.currentTaskTitle || ""
|
|
18148
|
-
}, this.renderReactUI(), this.emit("planProgress", this.planProgress)) : n.type === "plan_started" ? (console.log("[OnboardingSDK] Plan started:", n), this.emit("planStarted", { planName: n.planName, totalSteps: n.totalSteps })) : n.type === "plan_complete" ? (console.log("[OnboardingSDK] Plan complete:", n), this.planProgress = null, this.renderReactUI(), this.emit("planComplete", { planName: n.planName })) : console.log("[OnboardingSDK] Unhandled server message type:", n.type || "unknown");
|
|
18173
|
+
}, this.renderReactUI(), this.emit("planProgress", this.planProgress)) : n.type === "plan_started" ? (console.log("[OnboardingSDK] Plan started:", n), this.emit("planStarted", { planName: n.planName, totalSteps: n.totalSteps })) : n.type === "plan_complete" ? (console.log("[OnboardingSDK] Plan complete:", n), this.planProgress = null, this.overlay.clearHighlight(), this.overlay.hideFloeCursor(), this.renderReactUI(), this.emit("planComplete", { planName: n.planName })) : console.log("[OnboardingSDK] Unhandled server message type:", n.type || "unknown");
|
|
18149
18174
|
}
|
|
18150
18175
|
/**
|
|
18151
18176
|
* Handle hybrid UI action from bot
|
|
@@ -18175,9 +18200,9 @@ class dc extends lh {
|
|
|
18175
18200
|
console.log("[OnboardingSDK] 🎯 Dropdown option selection detected:", t.target.optionText), await this.handleDropdownOptionClick(t);
|
|
18176
18201
|
break;
|
|
18177
18202
|
}
|
|
18178
|
-
let o =
|
|
18203
|
+
let o = ue.resolveTarget(t.target);
|
|
18179
18204
|
if (!o) {
|
|
18180
|
-
console.warn("[OnboardingSDK] ⚠️ Click target not found"), this.sendMetadata({
|
|
18205
|
+
console.warn("[OnboardingSDK] ⚠️ Click target not found"), this.overlay.clearHighlight(), this.overlay.hideFloeCursor(), this.sendMetadata({
|
|
18181
18206
|
type: "bot_action_complete",
|
|
18182
18207
|
action: "click",
|
|
18183
18208
|
success: !1,
|
|
@@ -18187,7 +18212,7 @@ class dc extends lh {
|
|
|
18187
18212
|
});
|
|
18188
18213
|
break;
|
|
18189
18214
|
}
|
|
18190
|
-
|
|
18215
|
+
ue.scrollIntoView(o), setTimeout(async () => {
|
|
18191
18216
|
var g, v;
|
|
18192
18217
|
const a = this.findCollapsedSidebar(o);
|
|
18193
18218
|
if (a) {
|
|
@@ -18199,8 +18224,8 @@ class dc extends lh {
|
|
|
18199
18224
|
400
|
|
18200
18225
|
), 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");
|
|
18201
18226
|
}
|
|
18202
|
-
if (!await
|
|
18203
|
-
console.error("[OnboardingSDK] ❌ Element disappeared during stability wait"), this.sendMetadata({
|
|
18227
|
+
if (!await ue.waitForPositionStability(o, 800)) {
|
|
18228
|
+
console.error("[OnboardingSDK] ❌ Element disappeared during stability wait"), this.overlay.clearHighlight(), this.overlay.hideFloeCursor(), this.sendMetadata({
|
|
18204
18229
|
type: "bot_action_complete",
|
|
18205
18230
|
action: "click",
|
|
18206
18231
|
success: !1,
|
|
@@ -18210,7 +18235,7 @@ class dc extends lh {
|
|
|
18210
18235
|
});
|
|
18211
18236
|
return;
|
|
18212
18237
|
}
|
|
18213
|
-
const u =
|
|
18238
|
+
const u = ue.reResolveAndVerify(t.target, o);
|
|
18214
18239
|
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((b) => setTimeout(b, 150)), this._botActionDepth++;
|
|
18215
18240
|
const d = {
|
|
18216
18241
|
...t,
|
|
@@ -18273,7 +18298,7 @@ class dc extends lh {
|
|
|
18273
18298
|
break;
|
|
18274
18299
|
case "type":
|
|
18275
18300
|
console.log("[OnboardingSDK] ⌨️ Executing TYPE action, value:", t.value);
|
|
18276
|
-
const s =
|
|
18301
|
+
const s = ue.resolveTarget(t.target);
|
|
18277
18302
|
s && this.overlay.highlightResolvedElement(s, {
|
|
18278
18303
|
color: "rgba(76, 175, 80, 0.6)",
|
|
18279
18304
|
// Green for input
|
|
@@ -18295,7 +18320,7 @@ class dc extends lh {
|
|
|
18295
18320
|
console.log("[OnboardingSDK] 📋 Executing MULTI_SELECT action"), await this.handleMultiSelectAction(t);
|
|
18296
18321
|
break;
|
|
18297
18322
|
case "navigate":
|
|
18298
|
-
console.log("[OnboardingSDK] 🧭 Executing NAVIGATE action to URL:", t.value);
|
|
18323
|
+
console.log("[OnboardingSDK] 🧭 Executing NAVIGATE action to URL:", t.value), this.overlay.clearHighlight(), this.overlay.hideFloeCursor();
|
|
18299
18324
|
{
|
|
18300
18325
|
const a = t.value;
|
|
18301
18326
|
if (!a) {
|
|
@@ -18568,7 +18593,7 @@ class dc extends lh {
|
|
|
18568
18593
|
c = `Invalid selector for element_visible: "${u}"`;
|
|
18569
18594
|
break;
|
|
18570
18595
|
}
|
|
18571
|
-
a = !!(d &&
|
|
18596
|
+
a = !!(d && ue.isVisible(d)), c = a ? `Element "${u}" is visible` : `Element "${u}" is NOT visible or not found`;
|
|
18572
18597
|
}
|
|
18573
18598
|
break;
|
|
18574
18599
|
case "element_enabled":
|
|
@@ -18632,7 +18657,7 @@ class dc extends lh {
|
|
|
18632
18657
|
});
|
|
18633
18658
|
return;
|
|
18634
18659
|
}
|
|
18635
|
-
|
|
18660
|
+
ue.scrollIntoView(i), await new Promise((c) => setTimeout(c, 200)), await this.overlay.moveToElementAndClick(i), console.log("[OnboardingSDK] 📂 Opening multi-select dropdown..."), this._botActionDepth++;
|
|
18636
18661
|
try {
|
|
18637
18662
|
this.actionExecutor.openDropdown(i);
|
|
18638
18663
|
} finally {
|
|
@@ -18715,9 +18740,10 @@ class dc extends lh {
|
|
|
18715
18740
|
console.log("[OnboardingSDK] ✅ Option already visible, clicking directly"), await this.clickDropdownOption(i, t);
|
|
18716
18741
|
return;
|
|
18717
18742
|
}
|
|
18718
|
-
|
|
18719
|
-
|
|
18720
|
-
|
|
18743
|
+
const o = this.isDropdownCurrentlyOpen();
|
|
18744
|
+
console.log("[OnboardingSDK] 🔍 Option not visible, dropdown already open:", o);
|
|
18745
|
+
const s = this.findDropdownTrigger(t.target);
|
|
18746
|
+
if (!s) {
|
|
18721
18747
|
console.error("[OnboardingSDK] ❌ Could not find dropdown trigger"), this.sendMetadata({
|
|
18722
18748
|
type: "bot_action_complete",
|
|
18723
18749
|
action: "click",
|
|
@@ -18728,29 +18754,60 @@ class dc extends lh {
|
|
|
18728
18754
|
});
|
|
18729
18755
|
return;
|
|
18730
18756
|
}
|
|
18731
|
-
|
|
18732
|
-
|
|
18733
|
-
this.
|
|
18734
|
-
|
|
18735
|
-
|
|
18757
|
+
if (o) {
|
|
18758
|
+
console.log("[OnboardingSDK] 📜 Dropdown open but option not visible — trying scroll first");
|
|
18759
|
+
const h = await this.scrollToDropdownOption(n);
|
|
18760
|
+
if (h) {
|
|
18761
|
+
console.log("[OnboardingSDK] ✅ Found option after scrolling"), await this.clickDropdownOption(h, t);
|
|
18762
|
+
return;
|
|
18763
|
+
}
|
|
18736
18764
|
}
|
|
18737
|
-
|
|
18738
|
-
|
|
18739
|
-
|
|
18740
|
-
|
|
18765
|
+
const a = this.findDropdownSearchInput(s);
|
|
18766
|
+
if (a) {
|
|
18767
|
+
if (console.log("[OnboardingSDK] ⌨️ Typing to filter dropdown:", n), i = await this.typeToFilterDropdown(a, n), i) {
|
|
18768
|
+
console.log("[OnboardingSDK] ✅ Found option after typing to filter"), await this.clickDropdownOption(i, t);
|
|
18769
|
+
return;
|
|
18770
|
+
}
|
|
18771
|
+
console.log("[OnboardingSDK] ⚠️ Typing to filter did not reveal the option");
|
|
18772
|
+
}
|
|
18773
|
+
if (!o) {
|
|
18774
|
+
ue.scrollIntoView(s), await new Promise((v) => setTimeout(v, 200)), await this.overlay.moveToElementAndClick(s), console.log("[OnboardingSDK] 📂 Opening dropdown..."), this._botActionDepth++;
|
|
18775
|
+
try {
|
|
18776
|
+
this.actionExecutor.openDropdown(s);
|
|
18777
|
+
} finally {
|
|
18778
|
+
this._botActionDepth--;
|
|
18779
|
+
}
|
|
18780
|
+
if (await new Promise((v) => setTimeout(v, 300)), i = this.findVisibleDropdownOption(n), i) {
|
|
18781
|
+
console.log("[OnboardingSDK] ✅ Option visible after opening dropdown"), await this.clickDropdownOption(i, t);
|
|
18782
|
+
return;
|
|
18783
|
+
}
|
|
18784
|
+
const h = this.findDropdownSearchInput(s);
|
|
18785
|
+
if (h && (console.log("[OnboardingSDK] ⌨️ Typing to filter after opening dropdown:", n), i = await this.typeToFilterDropdown(h, n), i)) {
|
|
18786
|
+
console.log("[OnboardingSDK] ✅ Found option after typing to filter"), await this.clickDropdownOption(i, t);
|
|
18787
|
+
return;
|
|
18788
|
+
}
|
|
18789
|
+
const g = await this.scrollToDropdownOption(n);
|
|
18790
|
+
if (g) {
|
|
18791
|
+
console.log("[OnboardingSDK] ✅ Found option after scrolling"), await this.clickDropdownOption(g, t);
|
|
18792
|
+
return;
|
|
18793
|
+
}
|
|
18794
|
+
}
|
|
18795
|
+
const c = 1500, u = 150;
|
|
18796
|
+
let d = 0;
|
|
18797
|
+
for (; d < c; ) {
|
|
18741
18798
|
if (i = this.findVisibleDropdownOption(n), i) {
|
|
18742
|
-
console.log("[OnboardingSDK] ✅ Option appeared after",
|
|
18799
|
+
console.log("[OnboardingSDK] ✅ Option appeared after", d, "ms (final poll)");
|
|
18743
18800
|
break;
|
|
18744
18801
|
}
|
|
18745
|
-
await new Promise((
|
|
18802
|
+
await new Promise((h) => setTimeout(h, u)), d += u;
|
|
18746
18803
|
}
|
|
18747
18804
|
if (!i) {
|
|
18748
|
-
console.error("[OnboardingSDK] ❌
|
|
18749
|
-
const
|
|
18750
|
-
var
|
|
18751
|
-
return (
|
|
18805
|
+
console.error("[OnboardingSDK] ❌ All strategies failed for option:", n);
|
|
18806
|
+
const h = document.querySelectorAll('[role="option"], [class*="option"], nz-option-item, .ant-select-item-option'), g = Array.from(h).slice(0, 10).map((v) => {
|
|
18807
|
+
var b;
|
|
18808
|
+
return (b = v.textContent) == null ? void 0 : b.trim().slice(0, 50);
|
|
18752
18809
|
}).filter(Boolean);
|
|
18753
|
-
|
|
18810
|
+
g.length > 0 ? console.log("[OnboardingSDK] Available options:", g) : console.log("[OnboardingSDK] No options visible - dropdown may not have opened"), this.sendMetadata({
|
|
18754
18811
|
type: "bot_action_complete",
|
|
18755
18812
|
action: "click",
|
|
18756
18813
|
success: !1,
|
|
@@ -18762,12 +18819,111 @@ class dc extends lh {
|
|
|
18762
18819
|
}
|
|
18763
18820
|
await this.clickDropdownOption(i, t);
|
|
18764
18821
|
}
|
|
18822
|
+
/**
|
|
18823
|
+
* Check if a dropdown/listbox is currently open on the page.
|
|
18824
|
+
* Detects Angular NZ Select, CDK overlays, React Select, and generic dropdowns.
|
|
18825
|
+
*/
|
|
18826
|
+
isDropdownCurrentlyOpen() {
|
|
18827
|
+
const t = [
|
|
18828
|
+
// Angular NZ Select: overlay pane with dropdown content
|
|
18829
|
+
".cdk-overlay-pane nz-option-container",
|
|
18830
|
+
".cdk-overlay-pane .ant-select-dropdown",
|
|
18831
|
+
// Angular CDK overlay with listbox
|
|
18832
|
+
'.cdk-overlay-pane [role="listbox"]',
|
|
18833
|
+
// Generic open dropdowns
|
|
18834
|
+
'[role="listbox"]:not([aria-hidden="true"])',
|
|
18835
|
+
// React Select open menu
|
|
18836
|
+
'[class*="menu"][class*="--is-open"]',
|
|
18837
|
+
'[class*="MenuList"]',
|
|
18838
|
+
// Ant Design dropdown visible
|
|
18839
|
+
".ant-select-dropdown:not(.ant-select-dropdown-hidden)",
|
|
18840
|
+
// Expanded combobox
|
|
18841
|
+
'input[role="combobox"][aria-expanded="true"]'
|
|
18842
|
+
];
|
|
18843
|
+
for (const n of t)
|
|
18844
|
+
try {
|
|
18845
|
+
const i = document.querySelector(n);
|
|
18846
|
+
if (i && ue.isVisible(i)) {
|
|
18847
|
+
const o = i.getBoundingClientRect();
|
|
18848
|
+
if (o.height > 20 && o.width > 20)
|
|
18849
|
+
return console.log("[OnboardingSDK] Dropdown detected as open via:", n), !0;
|
|
18850
|
+
}
|
|
18851
|
+
} catch {
|
|
18852
|
+
continue;
|
|
18853
|
+
}
|
|
18854
|
+
return !1;
|
|
18855
|
+
}
|
|
18856
|
+
/**
|
|
18857
|
+
* Find the search input within or associated with a dropdown.
|
|
18858
|
+
* Works with Angular NZ Select, React Select, and generic combobox patterns.
|
|
18859
|
+
*/
|
|
18860
|
+
findDropdownSearchInput(t) {
|
|
18861
|
+
if (t instanceof HTMLInputElement && (t.getAttribute("role") === "combobox" || t.classList.contains("ant-select-selection-search-input") || t.type === "search"))
|
|
18862
|
+
return console.log("[OnboardingSDK] 🔍 Trigger itself is search input"), t;
|
|
18863
|
+
const n = [
|
|
18864
|
+
"input.ant-select-selection-search-input",
|
|
18865
|
+
// Angular NZ Select
|
|
18866
|
+
'input[role="combobox"]',
|
|
18867
|
+
// Generic combobox
|
|
18868
|
+
'input[type="search"]',
|
|
18869
|
+
// Search input
|
|
18870
|
+
'input[class*="search"]',
|
|
18871
|
+
// Search class
|
|
18872
|
+
'input[class*="Search"]',
|
|
18873
|
+
// Search class (camel)
|
|
18874
|
+
'input[aria-autocomplete="list"]'
|
|
18875
|
+
// Autocomplete combobox
|
|
18876
|
+
], o = t.closest('nz-select, [class*="select-container"], [class*="Select"], [class*="combobox"]') || t.parentElement;
|
|
18877
|
+
if (o)
|
|
18878
|
+
for (const c of n) {
|
|
18879
|
+
const u = o.querySelector(c);
|
|
18880
|
+
if (u)
|
|
18881
|
+
return console.log("[OnboardingSDK] 🔍 Found search input via:", c), u;
|
|
18882
|
+
}
|
|
18883
|
+
const s = document.querySelectorAll(".cdk-overlay-pane");
|
|
18884
|
+
for (const c of s)
|
|
18885
|
+
if (ue.isVisible(c))
|
|
18886
|
+
for (const u of n) {
|
|
18887
|
+
const d = c.querySelector(u);
|
|
18888
|
+
if (d)
|
|
18889
|
+
return console.log("[OnboardingSDK] 🔍 Found search input in CDK overlay via:", u), d;
|
|
18890
|
+
}
|
|
18891
|
+
const a = document.activeElement;
|
|
18892
|
+
return a instanceof HTMLInputElement && (a.getAttribute("role") === "combobox" || a.classList.contains("ant-select-selection-search-input")) ? (console.log("[OnboardingSDK] 🔍 Found search input as active element"), a) : (console.log("[OnboardingSDK] ⚠️ No search input found for dropdown"), null);
|
|
18893
|
+
}
|
|
18894
|
+
/**
|
|
18895
|
+
* Type text into a dropdown search input to filter options, then find the target option.
|
|
18896
|
+
* Uses progressive typing: tries the first word first, then adds more if needed.
|
|
18897
|
+
*/
|
|
18898
|
+
async typeToFilterDropdown(t, n) {
|
|
18899
|
+
const i = this.getSearchTermsForOption(n);
|
|
18900
|
+
for (const o of i) {
|
|
18901
|
+
console.log(`[OnboardingSDK] ⌨️ Typing search term: "${o}"`), t.focus(), await new Promise((a) => setTimeout(a, 50)), t.value = "", t.dispatchEvent(new Event("input", { bubbles: !0 })), t.dispatchEvent(new Event("change", { bubbles: !0 })), await new Promise((a) => setTimeout(a, 100));
|
|
18902
|
+
for (let a = 0; a < o.length; a++) {
|
|
18903
|
+
const c = o[a];
|
|
18904
|
+
t.value = o.substring(0, a + 1), t.dispatchEvent(new KeyboardEvent("keydown", { key: c, bubbles: !0 })), t.dispatchEvent(new KeyboardEvent("keypress", { key: c, bubbles: !0 })), t.dispatchEvent(new Event("input", { bubbles: !0 })), t.dispatchEvent(new KeyboardEvent("keyup", { key: c, bubbles: !0 })), await new Promise((u) => setTimeout(u, 30));
|
|
18905
|
+
}
|
|
18906
|
+
t.dispatchEvent(new Event("change", { bubbles: !0 })), await new Promise((a) => setTimeout(a, 400));
|
|
18907
|
+
let s = this.findVisibleDropdownOption(n);
|
|
18908
|
+
if (s || (await new Promise((a) => setTimeout(a, 300)), s = this.findVisibleDropdownOption(n), s))
|
|
18909
|
+
return s;
|
|
18910
|
+
}
|
|
18911
|
+
return t.value = "", t.dispatchEvent(new Event("input", { bubbles: !0 })), t.dispatchEvent(new Event("change", { bubbles: !0 })), await new Promise((o) => setTimeout(o, 200)), null;
|
|
18912
|
+
}
|
|
18913
|
+
/**
|
|
18914
|
+
* Generate search terms to try for a given option text.
|
|
18915
|
+
* Returns progressively more specific terms: ["Brandon", "Brandon Mora"]
|
|
18916
|
+
*/
|
|
18917
|
+
getSearchTermsForOption(t) {
|
|
18918
|
+
const n = [], i = t.match(/^([^(]+)/), o = i ? i[1].trim() : t, s = o.split(/\s+/)[0];
|
|
18919
|
+
return s && s.length >= 2 && n.push(s), o !== s && n.push(o), n.length === 0 && n.push(t), n;
|
|
18920
|
+
}
|
|
18765
18921
|
/**
|
|
18766
18922
|
* Find a visible dropdown option by text
|
|
18767
18923
|
* Uses STRICT matching to avoid selecting wrong options
|
|
18768
18924
|
*/
|
|
18769
18925
|
findVisibleDropdownOption(t) {
|
|
18770
|
-
var
|
|
18926
|
+
var c;
|
|
18771
18927
|
const n = t.toLowerCase().trim(), i = [
|
|
18772
18928
|
'[role="listbox"]',
|
|
18773
18929
|
'[role="menu"]',
|
|
@@ -18778,40 +18934,52 @@ class dc extends lh {
|
|
|
18778
18934
|
// Angular NZ Select dropdown
|
|
18779
18935
|
"nz-option-container",
|
|
18780
18936
|
// Angular NZ Select option container
|
|
18781
|
-
".cdk-overlay-pane"
|
|
18937
|
+
".cdk-overlay-pane",
|
|
18782
18938
|
// Angular CDK overlay
|
|
18783
|
-
|
|
18784
|
-
|
|
18785
|
-
|
|
18786
|
-
|
|
18939
|
+
".cdk-virtual-scroll-content-wrapper"
|
|
18940
|
+
// CDK virtual scroll content (items rendered here)
|
|
18941
|
+
], o = [
|
|
18942
|
+
'[role="option"]',
|
|
18943
|
+
'[class*="option"]:not([class*="singleValue"]):not([class*="placeholder"])',
|
|
18944
|
+
"nz-option-item",
|
|
18945
|
+
".ant-select-item-option",
|
|
18946
|
+
".ant-select-item-option-content",
|
|
18947
|
+
".ant-select-item"
|
|
18948
|
+
// Generic Ant Design item
|
|
18949
|
+
].join(", ");
|
|
18950
|
+
let s = null, a = null;
|
|
18951
|
+
for (const u of i) {
|
|
18952
|
+
let d;
|
|
18787
18953
|
try {
|
|
18788
|
-
|
|
18954
|
+
d = document.querySelectorAll(u);
|
|
18789
18955
|
} catch {
|
|
18790
18956
|
continue;
|
|
18791
18957
|
}
|
|
18792
|
-
for (const
|
|
18793
|
-
const
|
|
18794
|
-
if (!
|
|
18795
|
-
const
|
|
18796
|
-
for (const
|
|
18797
|
-
const
|
|
18798
|
-
if (
|
|
18958
|
+
for (const h of d) {
|
|
18959
|
+
const g = h;
|
|
18960
|
+
if (!ue.isVisible(g) || g.getBoundingClientRect().height < 20) continue;
|
|
18961
|
+
const b = h.querySelectorAll(o);
|
|
18962
|
+
for (const m of b) {
|
|
18963
|
+
const y = m, w = y.className || "";
|
|
18964
|
+
if (w.toLowerCase().includes("singlevalue") || w.toLowerCase().includes("placeholder"))
|
|
18799
18965
|
continue;
|
|
18800
|
-
const
|
|
18801
|
-
if (
|
|
18802
|
-
|
|
18966
|
+
const x = y.getBoundingClientRect();
|
|
18967
|
+
if (x.height === 0 || x.width === 0) continue;
|
|
18968
|
+
const C = ((c = y.textContent) == null ? void 0 : c.trim().toLowerCase()) || "";
|
|
18969
|
+
if (C === n) {
|
|
18970
|
+
console.log(`[OnboardingSDK] Found EXACT match for option: "${t}"`), s = y;
|
|
18803
18971
|
break;
|
|
18804
18972
|
}
|
|
18805
|
-
if (!
|
|
18806
|
-
const
|
|
18807
|
-
|
|
18973
|
+
if (!a && C.includes(n)) {
|
|
18974
|
+
const D = n.length / C.length;
|
|
18975
|
+
D > 0.7 && (console.log(`[OnboardingSDK] Found partial match (${(D * 100).toFixed(0)}%): "${C.slice(0, 50)}"`), a = y);
|
|
18808
18976
|
}
|
|
18809
18977
|
}
|
|
18810
|
-
if (
|
|
18978
|
+
if (s) break;
|
|
18811
18979
|
}
|
|
18812
|
-
if (
|
|
18980
|
+
if (s) break;
|
|
18813
18981
|
}
|
|
18814
|
-
return
|
|
18982
|
+
return s || (a ? (console.warn(`[OnboardingSDK] ⚠️ Using partial match for "${t}" - verify this is correct`), a) : (console.log(`[OnboardingSDK] No option found for: "${t}"`), null));
|
|
18815
18983
|
}
|
|
18816
18984
|
/**
|
|
18817
18985
|
* Try to scroll within the dropdown to find an option that might be off-screen.
|
|
@@ -18821,22 +18989,49 @@ class dc extends lh {
|
|
|
18821
18989
|
var o;
|
|
18822
18990
|
const n = t.toLowerCase().trim();
|
|
18823
18991
|
console.log(`[OnboardingSDK] 🔍 Scrolling dropdown to find: "${t}"`);
|
|
18824
|
-
const i =
|
|
18825
|
-
|
|
18826
|
-
|
|
18992
|
+
const i = [
|
|
18993
|
+
"cdk-virtual-scroll-viewport",
|
|
18994
|
+
// Angular CDK virtual scroll (tag)
|
|
18995
|
+
".cdk-virtual-scroll-viewport",
|
|
18996
|
+
// CDK virtual scroll (class)
|
|
18997
|
+
'[role="listbox"]',
|
|
18998
|
+
// Generic listbox
|
|
18999
|
+
'[class*="-menu"] [class*="menu-list"]',
|
|
19000
|
+
// React Select menu list
|
|
19001
|
+
'[class*="options-container"]',
|
|
19002
|
+
// Generic options container
|
|
19003
|
+
'[class*="virtual-list"]'
|
|
19004
|
+
// Virtual list
|
|
19005
|
+
];
|
|
18827
19006
|
for (const s of i) {
|
|
18828
|
-
|
|
18829
|
-
|
|
18830
|
-
|
|
18831
|
-
|
|
18832
|
-
|
|
18833
|
-
|
|
18834
|
-
|
|
18835
|
-
|
|
18836
|
-
|
|
18837
|
-
|
|
18838
|
-
|
|
19007
|
+
let a;
|
|
19008
|
+
try {
|
|
19009
|
+
a = document.querySelectorAll(s);
|
|
19010
|
+
} catch {
|
|
19011
|
+
continue;
|
|
19012
|
+
}
|
|
19013
|
+
for (const c of a) {
|
|
19014
|
+
const u = c;
|
|
19015
|
+
if (!ue.isVisible(u) || u.scrollHeight <= u.clientHeight + 5) continue;
|
|
19016
|
+
const d = window.getComputedStyle(u).overflowY;
|
|
19017
|
+
if (d === "visible" || d === "hidden") {
|
|
19018
|
+
console.log(`[OnboardingSDK] Skipping non-scrollable container (${s}), overflow-y: ${d}`);
|
|
19019
|
+
continue;
|
|
19020
|
+
}
|
|
19021
|
+
console.log(`[OnboardingSDK] Found scrollable container (${s}), scrollHeight: ${u.scrollHeight}, clientHeight: ${u.clientHeight}, overflow-y: ${d}`);
|
|
19022
|
+
const h = 150, g = Math.ceil(u.scrollHeight / h) + 2, v = u.scrollTop;
|
|
19023
|
+
for (let b = 0; b < g; b++) {
|
|
19024
|
+
u.scrollTop = b * h, await new Promise((w) => setTimeout(w, 120));
|
|
19025
|
+
const y = u.querySelectorAll('[role="option"], [class*="option"]:not([class*="singleValue"]), nz-option-item, .ant-select-item-option, .ant-select-item');
|
|
19026
|
+
for (const w of y) {
|
|
19027
|
+
const x = w, C = x.getBoundingClientRect();
|
|
19028
|
+
if (C.height === 0 || C.width === 0) continue;
|
|
19029
|
+
const D = ((o = x.textContent) == null ? void 0 : o.trim().toLowerCase()) || "";
|
|
19030
|
+
if (D === n || D.includes(n))
|
|
19031
|
+
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;
|
|
19032
|
+
}
|
|
18839
19033
|
}
|
|
19034
|
+
u.scrollTop = v;
|
|
18840
19035
|
}
|
|
18841
19036
|
}
|
|
18842
19037
|
return console.log(`[OnboardingSDK] Option not found after scrolling: "${t}"`), null;
|
|
@@ -19116,8 +19311,8 @@ class dc extends lh {
|
|
|
19116
19311
|
*/
|
|
19117
19312
|
async executeActionFast(t) {
|
|
19118
19313
|
console.log("[OnboardingSDK] ⚡ Fast executing action:", t.action);
|
|
19119
|
-
let n =
|
|
19120
|
-
if (!n && (await new Promise((o) => setTimeout(o, 150)), n =
|
|
19314
|
+
let n = ue.resolveTarget(t.target);
|
|
19315
|
+
if (!n && (await new Promise((o) => setTimeout(o, 150)), n = ue.resolveTarget(t.target), !n))
|
|
19121
19316
|
return console.warn("[OnboardingSDK] ⚠️ Fast action target not found"), !1;
|
|
19122
19317
|
n.scrollIntoView({ behavior: "auto", block: "center" }), await new Promise((o) => setTimeout(o, 50)), this.overlay.highlightResolvedElement(n, {
|
|
19123
19318
|
color: "rgba(124, 58, 237, 0.4)",
|
|
@@ -19870,7 +20065,7 @@ class dc extends lh {
|
|
|
19870
20065
|
* Disconnect and cleanup
|
|
19871
20066
|
*/
|
|
19872
20067
|
async disconnect() {
|
|
19873
|
-
this.pageTracker.stop(), this.domIntrospector.stopCapturing(), this.navigationCompleteDetector && this.navigationCompleteDetector.stop(), this.overlay.
|
|
20068
|
+
this.pageTracker.stop(), this.domIntrospector.stopCapturing(), this.navigationCompleteDetector && this.navigationCompleteDetector.stop(), this.overlay.cleanup(), this.pipecatClient && (await this.pipecatClient.disconnect(), this.pipecatClient = null), this.transport && (this.transport = null), this.audioElements && (this.audioElements.forEach((t) => {
|
|
19874
20069
|
t.pause(), t.remove();
|
|
19875
20070
|
}), this.audioElements = []), this.botAudioAnalyzer && (this.botAudioAnalyzer.destroy(), this.botAudioAnalyzer = null), this.userAudioAnalyzer && (this.userAudioAnalyzer.destroy(), this.userAudioAnalyzer = null), this.userMicStreamRequestId++, this.userMicStream && (this.userMicStream.getTracks().forEach((t) => t.stop()), this.userMicStream = null), this.audioLevels = [], this.reactRoot && (this.reactRoot.unmount(), this.reactRoot = null), this.reactContainer && (this.reactContainer.remove(), this.reactContainer = null), this.overlay.remove(), this.isInitialized = !1, this.isConnected = !1, this.agentState = "idle", console.log("[OnboardingSDK] Disconnected"), this.emit("disconnected");
|
|
19876
20071
|
}
|