@launchdarkly/o11y 1.2.0 → 1.3.1
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/CHANGELOG.md +19 -0
- package/dist/{LDObserve-CHIjcqIn.js → LDObserve-DhF3vCDR.js} +2 -2
- package/dist/{LDObserve-CHIjcqIn.js.map → LDObserve-DhF3vCDR.js.map} +1 -1
- package/dist/LDObserve.d.ts +5 -0
- package/dist/LDObserve.js +2 -2
- package/dist/LDRecord.d.ts +5 -0
- package/dist/LDRecord.js +1 -1
- package/dist/assets/highlight-client-worker-DrDPRCrv.js.map +1 -0
- package/dist/buffer-BjzLorpP.js +124 -0
- package/dist/buffer-BjzLorpP.js.map +1 -0
- package/dist/{common-DQ61tUu9.js → common-BjaGmQrE.js} +367 -360
- package/dist/{common-DQ61tUu9.js.map → common-BjaGmQrE.js.map} +1 -1
- package/dist/index.d.ts +33 -0
- package/dist/index.js +228 -223
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +87 -87
- package/dist/index.umd.js.map +1 -1
- package/dist/{observe-CFB6c1lu.js → observe-D78YYNE1.js} +2362 -2338
- package/dist/observe-D78YYNE1.js.map +1 -0
- package/dist/observe.d.ts +18 -0
- package/dist/observe.js +4 -4
- package/dist/{record-C_yieA7u.js → record-BZHDLKsW.js} +2733 -2710
- package/dist/record-BZHDLKsW.js.map +1 -0
- package/dist/record.d.ts +33 -0
- package/dist/record.js +3 -3
- package/package.json +1 -1
- package/dist/assets/highlight-client-worker-DsbKMpxq.js.map +0 -1
- package/dist/buffer-DIFxvF2Q.js +0 -102
- package/dist/buffer-DIFxvF2Q.js.map +0 -1
- package/dist/observe-CFB6c1lu.js.map +0 -1
- package/dist/record-C_yieA7u.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
1
|
+
var Ge = Object.defineProperty, je = Object.defineProperties;
|
|
2
|
+
var Je = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var V = Object.getOwnPropertySymbols;
|
|
4
|
+
var me = Object.prototype.hasOwnProperty, pe = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var we = (i) => {
|
|
6
6
|
throw TypeError(i);
|
|
7
7
|
};
|
|
8
|
-
var
|
|
8
|
+
var G = (i, e, t) => e in i ? Ge(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, w = (i, e) => {
|
|
9
9
|
for (var t in e || (e = {}))
|
|
10
|
-
|
|
11
|
-
if (
|
|
12
|
-
for (var t of
|
|
13
|
-
|
|
10
|
+
me.call(e, t) && G(i, t, e[t]);
|
|
11
|
+
if (V)
|
|
12
|
+
for (var t of V(e))
|
|
13
|
+
pe.call(e, t) && G(i, t, e[t]);
|
|
14
14
|
return i;
|
|
15
|
-
}, y = (i, e) =>
|
|
16
|
-
var
|
|
15
|
+
}, y = (i, e) => je(i, Je(e));
|
|
16
|
+
var j = (i, e) => {
|
|
17
17
|
var t = {};
|
|
18
18
|
for (var s in i)
|
|
19
|
-
|
|
20
|
-
if (i != null &&
|
|
21
|
-
for (var s of
|
|
22
|
-
e.indexOf(s) < 0 &&
|
|
19
|
+
me.call(i, s) && e.indexOf(s) < 0 && (t[s] = i[s]);
|
|
20
|
+
if (i != null && V)
|
|
21
|
+
for (var s of V(i))
|
|
22
|
+
e.indexOf(s) < 0 && pe.call(i, s) && (t[s] = i[s]);
|
|
23
23
|
return t;
|
|
24
24
|
};
|
|
25
|
-
var a = (i, e, t) =>
|
|
26
|
-
var
|
|
25
|
+
var a = (i, e, t) => G(i, typeof e != "symbol" ? e + "" : e, t), Se = (i, e, t) => e.has(i) || we("Cannot " + t);
|
|
26
|
+
var ye = (i, e, t) => (Se(i, e, "read from private field"), t ? t.call(i) : e.get(i)), be = (i, e, t) => e.has(i) ? we("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(i) : e.set(i, t), ke = (i, e, t, s) => (Se(i, e, "write to private field"), s ? s.call(i, t) : e.set(i, t), t);
|
|
27
27
|
var _ = (i, e, t) => new Promise((s, n) => {
|
|
28
28
|
var o = (d) => {
|
|
29
29
|
try {
|
|
@@ -40,28 +40,28 @@ var _ = (i, e, t) => new Promise((s, n) => {
|
|
|
40
40
|
}, l = (d) => d.done ? s(d.value) : Promise.resolve(d.value).then(o, r);
|
|
41
41
|
l((t = t.apply(i, e)).next());
|
|
42
42
|
});
|
|
43
|
-
import { W as
|
|
44
|
-
import { R as
|
|
45
|
-
import { s as
|
|
46
|
-
import { X as
|
|
47
|
-
import { O as
|
|
48
|
-
import { L as
|
|
49
|
-
import { g as
|
|
50
|
-
import { L as
|
|
51
|
-
import { LDRecord as
|
|
52
|
-
const
|
|
43
|
+
import { W as Qe, M as C, r as J, I as ve, a as _e, S as Ye, C as Xe, F as Ze, b as et, P as tt, c as Re, g as st, p as it, d as nt, e as rt, f as ot, h as at, s as ct, i as lt } from "./record-BZHDLKsW.js";
|
|
44
|
+
import { R as ls } from "./record-BZHDLKsW.js";
|
|
45
|
+
import { s as K, G as O, g as F, S as E, r as De, a as Q, b as dt, c as ht, d as Y, e as X, f as W, F as Ie, V as gt, P as ut, h as ft, H as Z, M as mt, i as pt, L as We, j as ze, p as wt, k as Le, l as Ce, m as St, n as yt, o as bt, q as kt, t as vt, u as _t, v as Rt, w as Dt, x as It } from "./common-BjaGmQrE.js";
|
|
46
|
+
import { X as Lt, F as Ct, A as Et, C as Nt, E as Ot, s as Be, D as Tt, a as Pt, m as Ee, d as Me, b as Ne, c as Oe, r as Fe, e as Ht, p as Ut, f as Wt, g as zt, M as D, h as N, W as Bt, N as Mt, P as Ft, J as $t, i as x, j as A, k as Vt, l as xt, n as At, o as Te } from "./observe-D78YYNE1.js";
|
|
47
|
+
import { O as hs } from "./observe-D78YYNE1.js";
|
|
48
|
+
import { L as Kt, s as qt, a as T } from "./buffer-BjzLorpP.js";
|
|
49
|
+
import { g as Pe } from "./LDObserve-DhF3vCDR.js";
|
|
50
|
+
import { L as us } from "./LDObserve-DhF3vCDR.js";
|
|
51
|
+
import { LDRecord as ms } from "./LDRecord.js";
|
|
52
|
+
const Gt = (i, e, t) => {
|
|
53
53
|
const s = window._highlightWebSocketRequestCallback;
|
|
54
54
|
window._highlightWebSocketRequestCallback = i;
|
|
55
55
|
const n = window._highlightWebSocketEventCallback;
|
|
56
56
|
return window._highlightWebSocketEventCallback = (o) => {
|
|
57
|
-
const h = o, { message: r, size: l } = h, d =
|
|
57
|
+
const h = o, { message: r, size: l } = h, d = j(h, ["message", "size"]), g = t.some(
|
|
58
58
|
(f) => o.name.toLowerCase().includes(f)
|
|
59
59
|
) ? d : o;
|
|
60
60
|
e(g);
|
|
61
61
|
}, () => {
|
|
62
62
|
window._highlightWebSocketRequestCallback = s, window._highlightWebSocketEventCallback = n;
|
|
63
63
|
};
|
|
64
|
-
},
|
|
64
|
+
}, jt = ({
|
|
65
65
|
xhrCallback: i,
|
|
66
66
|
fetchCallback: e,
|
|
67
67
|
webSocketRequestCallback: t,
|
|
@@ -73,14 +73,14 @@ const xt = (i, e, t) => {
|
|
|
73
73
|
urlBlocklist: d,
|
|
74
74
|
bodyKeysToRecord: c
|
|
75
75
|
}) => {
|
|
76
|
-
const g =
|
|
76
|
+
const g = Lt(
|
|
77
77
|
i,
|
|
78
78
|
r,
|
|
79
79
|
l,
|
|
80
80
|
d,
|
|
81
81
|
o,
|
|
82
82
|
c
|
|
83
|
-
), h =
|
|
83
|
+
), h = Ct(
|
|
84
84
|
e,
|
|
85
85
|
r,
|
|
86
86
|
l,
|
|
@@ -88,7 +88,7 @@ const xt = (i, e, t) => {
|
|
|
88
88
|
o,
|
|
89
89
|
c
|
|
90
90
|
), f = n ? () => {
|
|
91
|
-
} :
|
|
91
|
+
} : Gt(
|
|
92
92
|
t,
|
|
93
93
|
s,
|
|
94
94
|
d
|
|
@@ -127,7 +127,7 @@ class I {
|
|
|
127
127
|
a(this, "requestResponseSanitizer");
|
|
128
128
|
var t, s;
|
|
129
129
|
this.options = e, this.disableConsoleRecording = !!e.disableConsoleRecording, this.reportConsoleErrors = (t = e.reportConsoleErrors) != null ? t : !1, this.enablePromisePatch = (s = e.enablePromisePatch) != null ? s : !1, this.consoleMethodsToRecord = e.consoleMethodsToRecord || [
|
|
130
|
-
...
|
|
130
|
+
...Et
|
|
131
131
|
], this.listeners = [], this.errors = [], this.messages = [], this.lastNetworkRequestTimestamp = 0;
|
|
132
132
|
}
|
|
133
133
|
isListening() {
|
|
@@ -137,12 +137,12 @@ class I {
|
|
|
137
137
|
if (this.isListening()) return;
|
|
138
138
|
const e = this;
|
|
139
139
|
this.disableConsoleRecording || this.listeners.push(
|
|
140
|
-
|
|
140
|
+
Nt(
|
|
141
141
|
(t) => {
|
|
142
142
|
var s, n, o;
|
|
143
143
|
if (this.reportConsoleErrors && (t.type === "Error" || t.type === "error") && t.value && t.trace) {
|
|
144
|
-
const r =
|
|
145
|
-
if (
|
|
144
|
+
const r = K(t.value);
|
|
145
|
+
if (Ne.includes(r) || Oe.some(
|
|
146
146
|
(l) => r.includes(l)
|
|
147
147
|
))
|
|
148
148
|
return;
|
|
@@ -155,25 +155,26 @@ class I {
|
|
|
155
155
|
columnNumber: (o = t.trace[0]) != null && o.columnNumber ? t.trace[0].columnNumber : 0,
|
|
156
156
|
stackTrace: t.trace,
|
|
157
157
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
158
|
-
id:
|
|
158
|
+
id: Fe()
|
|
159
159
|
});
|
|
160
160
|
}
|
|
161
161
|
e.messages.push(t);
|
|
162
162
|
},
|
|
163
|
-
y(w({},
|
|
164
|
-
level: this.consoleMethodsToRecord
|
|
163
|
+
y(w({}, Me), {
|
|
164
|
+
level: this.consoleMethodsToRecord,
|
|
165
|
+
recordLaunchDarklySdkLogs: this.options.recordLaunchDarklySdkLogs
|
|
165
166
|
})
|
|
166
167
|
)
|
|
167
168
|
), this.listeners.push(
|
|
168
|
-
|
|
169
|
+
Ot(
|
|
169
170
|
(t) => {
|
|
170
|
-
|
|
171
|
+
Ne.includes(t.event) || Oe.some(
|
|
171
172
|
(s) => t.event.includes(s)
|
|
172
173
|
) || e.errors.push(t);
|
|
173
174
|
},
|
|
174
175
|
{ enablePromisePatch: this.enablePromisePatch }
|
|
175
176
|
)
|
|
176
|
-
), this.listeners.push(
|
|
177
|
+
), this.listeners.push(Be), I.setupNetworkListener(this, this.options);
|
|
177
178
|
}
|
|
178
179
|
stopListening() {
|
|
179
180
|
this.listeners.forEach((e) => e()), this.listeners = [];
|
|
@@ -181,7 +182,7 @@ class I {
|
|
|
181
182
|
// We define this as a static method because versions earlier than 4.0.0 (Feb 2022) don't have this code.
|
|
182
183
|
// For those versions, calling this from client will monkey-patch the network listeners onto the old FirstLoadListener object.
|
|
183
184
|
static setupNetworkListener(e, t) {
|
|
184
|
-
var o, r, l, d, c, g, h, f, m, R,
|
|
185
|
+
var o, r, l, d, c, g, h, f, m, R, k, L;
|
|
185
186
|
const s = (t == null ? void 0 : t.backendUrl) || void 0 || "https://pub.highlight.io", n = t.otlpEndpoint || "https://otel.highlight.io";
|
|
186
187
|
e.highlightEndpoints = [
|
|
187
188
|
s,
|
|
@@ -196,13 +197,13 @@ class I {
|
|
|
196
197
|
(S) => S.toLowerCase()
|
|
197
198
|
)) || [], e.urlBlocklist = [
|
|
198
199
|
...e.urlBlocklist,
|
|
199
|
-
...
|
|
200
|
-
], e.requestResponseSanitizer = (R = t.networkRecording) == null ? void 0 : R.requestResponseSanitizer, e.networkHeaderKeysToRecord = (
|
|
200
|
+
...Tt
|
|
201
|
+
], e.requestResponseSanitizer = (R = t.networkRecording) == null ? void 0 : R.requestResponseSanitizer, e.networkHeaderKeysToRecord = (k = t.networkRecording) == null ? void 0 : k.headerKeysToRecord, e.networkHeaderKeysToRecord && (e.networkHeadersToRedact = [], e.networkHeaderKeysToRecord = e.networkHeaderKeysToRecord.map(
|
|
201
202
|
(S) => S.toLocaleLowerCase()
|
|
202
|
-
)), e.networkBodyKeysToRecord = (
|
|
203
|
+
)), e.networkBodyKeysToRecord = (L = t.networkRecording) == null ? void 0 : L.bodyKeysToRecord, e.networkBodyKeysToRecord && (e.networkBodyKeysToRedact = [], e.networkBodyKeysToRecord = e.networkBodyKeysToRecord.map(
|
|
203
204
|
(S) => S.toLocaleLowerCase()
|
|
204
205
|
))), !e.disableNetworkRecording && e.enableRecordingNetworkContents && (e.hasNetworkRecording = !0, e.listeners.push(
|
|
205
|
-
|
|
206
|
+
jt({
|
|
206
207
|
xhrCallback: (S) => {
|
|
207
208
|
e.xhrNetworkContents.push(S);
|
|
208
209
|
},
|
|
@@ -233,7 +234,7 @@ class I {
|
|
|
233
234
|
"resource"
|
|
234
235
|
);
|
|
235
236
|
const d = (t - l) * 2;
|
|
236
|
-
if (s = s.filter((c) => c.responseEnd < e.lastNetworkRequestTimestamp ? !1 :
|
|
237
|
+
if (s = s.filter((c) => c.responseEnd < e.lastNetworkRequestTimestamp ? !1 : Pt(
|
|
237
238
|
c.name,
|
|
238
239
|
e.highlightEndpoints
|
|
239
240
|
)).map((c) => y(w({}, c.toJSON()), {
|
|
@@ -246,12 +247,12 @@ class I {
|
|
|
246
247
|
headersToRecord: e.networkHeaderKeysToRecord,
|
|
247
248
|
requestResponseSanitizer: e.requestResponseSanitizer
|
|
248
249
|
};
|
|
249
|
-
s =
|
|
250
|
+
s = Ee(
|
|
250
251
|
s,
|
|
251
252
|
e.xhrNetworkContents,
|
|
252
253
|
"xmlhttprequest",
|
|
253
254
|
c
|
|
254
|
-
), s =
|
|
255
|
+
), s = Ee(
|
|
255
256
|
s,
|
|
256
257
|
e.fetchNetworkContents,
|
|
257
258
|
"fetch",
|
|
@@ -269,11 +270,11 @@ class I {
|
|
|
269
270
|
e.disableNetworkRecording || (e.xhrNetworkContents = [], e.fetchNetworkContents = [], e.webSocketNetworkContents = [], e.webSocketEventContents = [], performance.clearResourceTimings());
|
|
270
271
|
}
|
|
271
272
|
}
|
|
272
|
-
const
|
|
273
|
-
|
|
273
|
+
const z = (i, e) => {
|
|
274
|
+
T("warn", `Highlight Warning: (${i}): `, { output: e });
|
|
274
275
|
};
|
|
275
|
-
var
|
|
276
|
-
const
|
|
276
|
+
var $;
|
|
277
|
+
const se = class se {
|
|
277
278
|
constructor(e, t) {
|
|
278
279
|
a(this, "options");
|
|
279
280
|
/** Determines if the client is running on a Highlight property (e.g. frontend). */
|
|
@@ -283,7 +284,7 @@ const te = class te {
|
|
|
283
284
|
// ECMAScript-private (#) so the internal GraphQL SDK type — which
|
|
284
285
|
// references graphql-request / graphql — does not leak into the published
|
|
285
286
|
// declaration file and break consumer type-checking.
|
|
286
|
-
|
|
287
|
+
be(this, $);
|
|
287
288
|
a(this, "events");
|
|
288
289
|
a(this, "sessionData");
|
|
289
290
|
a(this, "ready");
|
|
@@ -330,29 +331,29 @@ const te = class te {
|
|
|
330
331
|
a(this, "_up_down_counters", /* @__PURE__ */ new Map());
|
|
331
332
|
a(this, "_integrations", []);
|
|
332
333
|
var n, o, r, l, d;
|
|
333
|
-
e.sessionSecureID || (e.sessionSecureID = O()), this.options = e, typeof ((n = this.options) == null ? void 0 : n.debug) == "boolean" ? this.debugOptions = this.options.debug ? { clientInteractions: !0 } : {} : this.debugOptions = (r = (o = this.options) == null ? void 0 : o.debug) != null ? r : {}, this.logger = new
|
|
334
|
+
e.sessionSecureID || (e.sessionSecureID = O()), this.options = e, typeof ((n = this.options) == null ? void 0 : n.debug) == "boolean" ? this.debugOptions = this.options.debug ? { clientInteractions: !0 } : {} : this.debugOptions = (r = (o = this.options) == null ? void 0 : o.debug) != null ? r : {}, this.logger = new Kt(this.debugOptions.clientInteractions), e.debug && qt(!0), e.storageMode && (this.logger.log(
|
|
334
335
|
`initializing in ${e.storageMode} session mode`
|
|
335
|
-
),
|
|
336
|
+
), St(e.storageMode)), ze(!!(e != null && e.sessionCookie)), this._worker = new Qe(), this._worker.onmessage = (c) => {
|
|
336
337
|
var g, h, f;
|
|
337
|
-
((g = c.data.response) == null ? void 0 : g.type) ===
|
|
338
|
+
((g = c.data.response) == null ? void 0 : g.type) === C.AsyncEvents ? (this._eventBytesSinceSnapshot += c.data.response.eventsSize, this.logger.log(
|
|
338
339
|
`Web worker sent payloadID ${c.data.response.id} size ${c.data.response.eventsSize} bytes, compression ratio ${c.data.response.eventsSize / c.data.response.compressedSize}.
|
|
339
340
|
Total since snapshot: ${(this._eventBytesSinceSnapshot / 1e6).toFixed(1)}MB`
|
|
340
|
-
)) : ((h = c.data.response) == null ? void 0 : h.type) ===
|
|
341
|
+
)) : ((h = c.data.response) == null ? void 0 : h.type) === C.CustomEvent ? this.addCustomEvent(
|
|
341
342
|
c.data.response.tag,
|
|
342
343
|
c.data.response.payload
|
|
343
|
-
) : ((f = c.data.response) == null ? void 0 : f.type) ===
|
|
344
|
+
) : ((f = c.data.response) == null ? void 0 : f.type) === C.Stop && (z(
|
|
344
345
|
"Stopping recording due to worker failure",
|
|
345
346
|
c.data.response
|
|
346
347
|
), this.stopRecording(!1));
|
|
347
348
|
};
|
|
348
|
-
let s =
|
|
349
|
+
let s = F();
|
|
349
350
|
if (this.reloaded = !1, !((l = this.sessionData) != null && l.sessionSecureID) && (s != null && s.sessionSecureID))
|
|
350
351
|
this.sessionData = s, this.options.sessionSecureID = s.sessionSecureID, this.reloaded = !0, this.logger.log(
|
|
351
352
|
`Tab reloaded, continuing previous session: ${this.sessionData.sessionSecureID}`
|
|
352
353
|
);
|
|
353
354
|
else {
|
|
354
355
|
for (const c of Object.values(E))
|
|
355
|
-
|
|
356
|
+
De(c);
|
|
356
357
|
this.sessionData = {
|
|
357
358
|
sessionSecureID: this.options.sessionSecureID,
|
|
358
359
|
projectID: 0,
|
|
@@ -368,7 +369,7 @@ const te = class te {
|
|
|
368
369
|
this._initMembers(this.options);
|
|
369
370
|
}
|
|
370
371
|
static create(e) {
|
|
371
|
-
return new
|
|
372
|
+
return new se(e);
|
|
372
373
|
}
|
|
373
374
|
// Start a new session
|
|
374
375
|
_reset(s) {
|
|
@@ -380,34 +381,34 @@ const te = class te {
|
|
|
380
381
|
let n, o;
|
|
381
382
|
if (!e)
|
|
382
383
|
try {
|
|
383
|
-
n =
|
|
384
|
-
const r =
|
|
384
|
+
n = Q(E.USER_IDENTIFIER);
|
|
385
|
+
const r = Q(
|
|
385
386
|
E.USER_OBJECT
|
|
386
387
|
);
|
|
387
388
|
r && (o = JSON.parse(r));
|
|
388
389
|
} catch (r) {
|
|
389
390
|
}
|
|
390
391
|
for (const r of Object.values(E))
|
|
391
|
-
|
|
392
|
+
De(r);
|
|
392
393
|
this.sessionData.sessionSecureID = t ? O(`${this.organizationID}-${t}`) : O(), this.sessionData.sessionKey = t, this.sessionData.sessionStartTime = Date.now(), this.options.sessionSecureID = this.sessionData.sessionSecureID, this.stopRecording(), this._firstLoadListeners.stopListening(), this._firstLoadListeners = new I(this.options), yield this.initialize(), n && o && this.identify(n, o);
|
|
393
394
|
});
|
|
394
395
|
}
|
|
395
396
|
_initMembers(e) {
|
|
396
|
-
var o, r, l, d, c, g, h, f, m, R,
|
|
397
|
+
var o, r, l, d, c, g, h, f, m, R, k;
|
|
397
398
|
this.sessionShortcut = !1, this._recordingStartTime = 0, this._isOnLocalHost = window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1" || window.location.hostname === "", this.ready = !1, this.state = "NotRecording", this.manualStopped = !1, this.enableSegmentIntegration = !!e.enableSegmentIntegration, this.privacySetting = (o = e.privacySetting) != null ? o : "default", this.enableCanvasRecording = (r = e.enableCanvasRecording) != null ? r : !1, this.enablePerformanceRecording = (l = e.enablePerformanceRecording) != null ? l : !0, this.inlineImages = (d = e.inlineImages) != null ? d : this._isOnLocalHost, this.inlineVideos = (c = e.inlineVideos) != null ? c : this._isOnLocalHost, this.inlineStylesheet = (g = e.inlineStylesheet) != null ? g : this._isOnLocalHost, this.styleSheetResyncInterval = (h = e.styleSheetResyncInterval) != null ? h : 2e3, this.samplingStrategy = w({
|
|
398
399
|
canvasFactor: 0.5,
|
|
399
400
|
canvasMaxSnapshotDimension: 360,
|
|
400
401
|
canvasClearWebGLBuffer: !0,
|
|
401
|
-
dataUrlOptions:
|
|
402
|
+
dataUrlOptions: dt()
|
|
402
403
|
}, (f = e.samplingStrategy) != null ? f : {
|
|
403
404
|
canvas: 2
|
|
404
405
|
}), this._backendUrl = (m = e == null ? void 0 : e.backendUrl) != null ? m : "https://pub.highlight.io", this._backendUrl[0] === "/" && (this._backendUrl = new URL(this._backendUrl, document.baseURI).href);
|
|
405
|
-
const t = new
|
|
406
|
+
const t = new bt(`${this._backendUrl}`, {
|
|
406
407
|
headers: {}
|
|
407
408
|
});
|
|
408
|
-
|
|
409
|
+
ke(this, $, ht(t, yt())), this.environment = (R = e.environment) != null ? R : "production", this.appVersion = e.appVersion, this.serviceName = (k = e.serviceName) != null ? k : "", typeof e.organizationID == "string" ? this.organizationID = e.organizationID : this.organizationID = e.organizationID.toString(), this.isRunningOnHighlight = this.organizationID === "1" || this.organizationID === "1jdkoe52", this.firstloadVersion = e.firstloadVersion || "unknown", this.sessionShortcut = e.sessionShortcut || !1, this._onToggleFeedbackFormVisibility = () => {
|
|
409
410
|
};
|
|
410
|
-
const
|
|
411
|
+
const L = e, { firstloadVersion: s } = L, n = j(L, ["firstloadVersion"]);
|
|
411
412
|
this._optionsInternal = n, this.listeners = [], this.events = [], this.hasSessionUnloaded = !1, this.hasPushedData = !1, window.Intercom && window.Intercom("onShow", () => {
|
|
412
413
|
window.Intercom("update", {
|
|
413
414
|
highlightSessionURL: this.getCurrentSessionURLWithTimestamp()
|
|
@@ -422,12 +423,12 @@ const te = class te {
|
|
|
422
423
|
);
|
|
423
424
|
return;
|
|
424
425
|
}
|
|
425
|
-
this.sessionData.userIdentifier = e.toString(), this.sessionData.userObject = t,
|
|
426
|
+
this.sessionData.userIdentifier = e.toString(), this.sessionData.userObject = t, Y(
|
|
426
427
|
E.USER_IDENTIFIER,
|
|
427
428
|
e.toString()
|
|
428
|
-
),
|
|
429
|
+
), Y(E.USER_OBJECT, JSON.stringify(t)), this._worker.postMessage({
|
|
429
430
|
message: {
|
|
430
|
-
type:
|
|
431
|
+
type: C.Identify,
|
|
431
432
|
userIdentifier: e,
|
|
432
433
|
userObject: t,
|
|
433
434
|
source: s
|
|
@@ -443,7 +444,7 @@ const te = class te {
|
|
|
443
444
|
}
|
|
444
445
|
log(e, t, s) {
|
|
445
446
|
this._firstLoadListeners.messages.push(
|
|
446
|
-
|
|
447
|
+
Ht(t, Me, e, s)
|
|
447
448
|
);
|
|
448
449
|
}
|
|
449
450
|
pushCustomError(e, t) {
|
|
@@ -471,7 +472,7 @@ const te = class te {
|
|
|
471
472
|
e.cause && (s = y(w({}, s), { "exception.cause": e.cause }));
|
|
472
473
|
let r = t ? t + ":" + e.message : e.message;
|
|
473
474
|
o === "React.ErrorBoundary" && (r = "ErrorBoundary: " + r);
|
|
474
|
-
const l =
|
|
475
|
+
const l = Ut(e), d = {
|
|
475
476
|
event: r,
|
|
476
477
|
type: o != null ? o : "custom",
|
|
477
478
|
url: window.location.href,
|
|
@@ -481,7 +482,7 @@ const te = class te {
|
|
|
481
482
|
stackTrace: l,
|
|
482
483
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
483
484
|
payload: JSON.stringify(s),
|
|
484
|
-
id:
|
|
485
|
+
id: Fe()
|
|
485
486
|
};
|
|
486
487
|
this._firstLoadListeners.errors.push(d);
|
|
487
488
|
for (const m of this._integrations)
|
|
@@ -497,7 +498,7 @@ const te = class te {
|
|
|
497
498
|
}
|
|
498
499
|
}), this._worker.postMessage({
|
|
499
500
|
message: {
|
|
500
|
-
type:
|
|
501
|
+
type: C.Properties,
|
|
501
502
|
propertiesObject: s,
|
|
502
503
|
propertyType: t
|
|
503
504
|
}
|
|
@@ -510,7 +511,7 @@ const te = class te {
|
|
|
510
511
|
}
|
|
511
512
|
initialize(e) {
|
|
512
513
|
return _(this, null, function* () {
|
|
513
|
-
var t, s, n, o, r, l, d, c, g, h, f, m, R,
|
|
514
|
+
var t, s, n, o, r, l, d, c, g, h, f, m, R, k, L, S, ie, ne, re, oe, ae, ce, le, de, he;
|
|
514
515
|
if (navigator != null && navigator.webdriver && !window.Cypress || (t = navigator == null ? void 0 : navigator.userAgent) != null && t.includes("Googlebot") || (s = navigator == null ? void 0 : navigator.userAgent) != null && s.includes("AdsBot")) {
|
|
515
516
|
(n = this._firstLoadListeners) == null || n.stopListening();
|
|
516
517
|
return;
|
|
@@ -524,8 +525,8 @@ const te = class te {
|
|
|
524
525
|
yield this._reset(y(w({}, e), { forceNew: !0 }));
|
|
525
526
|
return;
|
|
526
527
|
}
|
|
527
|
-
const
|
|
528
|
-
|
|
528
|
+
const P = new zt();
|
|
529
|
+
Wt(
|
|
529
530
|
{
|
|
530
531
|
backendUrl: (r = (o = this.options) == null ? void 0 : o.backendUrl) != null ? r : "https://pub.highlight.io",
|
|
531
532
|
otlpEndpoint: (d = (l = this.options) == null ? void 0 : l.otlpEndpoint) != null ? d : "https://otel.highlight.io",
|
|
@@ -534,50 +535,51 @@ const te = class te {
|
|
|
534
535
|
environment: (f = (h = this.options) == null ? void 0 : h.environment) != null ? f : "production",
|
|
535
536
|
networkRecordingOptions: typeof ((m = this.options) == null ? void 0 : m.networkRecording) == "object" ? this.options.networkRecording : void 0,
|
|
536
537
|
tracingOrigins: (R = this.options) == null ? void 0 : R.tracingOrigins,
|
|
537
|
-
serviceName: (
|
|
538
|
-
instrumentations: (
|
|
538
|
+
serviceName: (L = (k = this.options) == null ? void 0 : k.serviceName) != null ? L : "highlight-browser",
|
|
539
|
+
instrumentations: (ie = (S = this.options) == null ? void 0 : S.otel) == null ? void 0 : ie.instrumentations,
|
|
539
540
|
getIntegrations: () => [...this._integrations],
|
|
540
541
|
productAnalyticsEvents: this._productAnalyticsEvents()
|
|
541
542
|
},
|
|
542
|
-
|
|
543
|
+
P
|
|
543
544
|
), this._gauges.clear(), this._counters.clear(), this._histograms.clear(), this._up_down_counters.clear(), this.logger.log(
|
|
544
545
|
"Initializing...",
|
|
545
546
|
e,
|
|
546
547
|
this.sessionData,
|
|
547
548
|
this.options
|
|
548
|
-
), this.sessionData = (
|
|
549
|
-
let
|
|
550
|
-
|
|
551
|
-
let
|
|
552
|
-
this.options.disableSessionRecording || this.options.disableNetworkRecording !== void 0 || typeof this.options.networkRecording == "boolean" ?
|
|
553
|
-
let
|
|
554
|
-
if (typeof this.options.networkRecording == "object" && ((
|
|
549
|
+
), this.sessionData = (ne = F(this.sessionData.sessionSecureID)) != null ? ne : this.sessionData, (re = this.sessionData) != null && re.sessionStartTime ? this._recordingStartTime = (oe = this.sessionData) == null ? void 0 : oe.sessionStartTime : (this._recordingStartTime = (/* @__PURE__ */ new Date()).getTime(), this.sessionData.sessionStartTime = this._recordingStartTime), X(""), W(this.sessionData);
|
|
550
|
+
let H = Q(Ce.CLIENT_ID);
|
|
551
|
+
H || (H = O(), Y(Ce.CLIENT_ID, H));
|
|
552
|
+
let U;
|
|
553
|
+
this.options.disableSessionRecording || this.options.disableNetworkRecording !== void 0 || typeof this.options.networkRecording == "boolean" ? U = !1 : U = ((ae = this.options.networkRecording) == null ? void 0 : ae.recordHeadersAndBody) || !1;
|
|
554
|
+
let ge = [];
|
|
555
|
+
if (typeof this.options.networkRecording == "object" && ((ce = this.options.networkRecording.destinationDomains) != null && ce.length) && (ge = this.options.networkRecording.destinationDomains), this._isCrossOriginIframe)
|
|
555
556
|
yield this._setupCrossOriginIframe();
|
|
556
557
|
else {
|
|
557
|
-
const
|
|
558
|
+
const v = yield ye(this, $).initializeSession({
|
|
558
559
|
organization_verbose_id: this.organizationID,
|
|
559
560
|
enable_strict_privacy: this.privacySetting === "strict",
|
|
560
561
|
privacy_setting: this.privacySetting,
|
|
561
|
-
enable_recording_network_contents:
|
|
562
|
+
enable_recording_network_contents: U,
|
|
562
563
|
clientVersion: this.firstloadVersion,
|
|
563
564
|
firstloadVersion: this.firstloadVersion,
|
|
564
565
|
clientConfig: JSON.stringify(this._optionsInternal),
|
|
565
566
|
environment: this.environment,
|
|
566
|
-
id:
|
|
567
|
+
id: H,
|
|
567
568
|
appVersion: this.appVersion,
|
|
568
569
|
serviceName: this.serviceName,
|
|
569
570
|
session_secure_id: this.sessionData.sessionSecureID,
|
|
570
571
|
session_key: this.sessionData.sessionKey,
|
|
571
|
-
client_id:
|
|
572
|
-
network_recording_domains:
|
|
572
|
+
client_id: H,
|
|
573
|
+
network_recording_domains: ge,
|
|
573
574
|
disable_session_recording: this.options.disableSessionRecording
|
|
574
575
|
});
|
|
575
|
-
if (
|
|
576
|
-
`Unexpected secure id returned by initializeSession: ${
|
|
577
|
-
), this.sessionData.sessionSecureID =
|
|
578
|
-
((
|
|
579
|
-
),
|
|
580
|
-
|
|
576
|
+
if (v.initializeSession.secure_id !== this.sessionData.sessionSecureID && this.logger.log(
|
|
577
|
+
`Unexpected secure id returned by initializeSession: ${v.initializeSession.secure_id}, expected ${this.sessionData.sessionSecureID}`
|
|
578
|
+
), this.sessionData.sessionSecureID = v.initializeSession.secure_id, this.sessionData.projectID = parseInt(
|
|
579
|
+
((le = v == null ? void 0 : v.initializeSession) == null ? void 0 : le.project_id) || "0"
|
|
580
|
+
), P.setConfig(v.initializeSession.sampling), !this.sessionData.projectID || !this.sessionData.sessionSecureID) {
|
|
581
|
+
T(
|
|
582
|
+
"error",
|
|
581
583
|
"Failed to initialize Highlight; an error occurred on our end.",
|
|
582
584
|
this.sessionData
|
|
583
585
|
);
|
|
@@ -591,15 +593,15 @@ Project ID: ${this.sessionData.projectID}
|
|
|
591
593
|
SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
592
594
|
), this.options.sessionSecureID = this.sessionData.sessionSecureID, this._worker.postMessage({
|
|
593
595
|
message: {
|
|
594
|
-
type:
|
|
596
|
+
type: C.Initialize,
|
|
595
597
|
sessionSecureID: this.sessionData.sessionSecureID,
|
|
596
598
|
backend: this._backendUrl,
|
|
597
599
|
debug: !!this.debugOptions.clientInteractions,
|
|
598
600
|
recordingStartTime: this._recordingStartTime
|
|
599
601
|
}
|
|
600
602
|
});
|
|
601
|
-
for (const
|
|
602
|
-
|
|
603
|
+
for (const v of this._integrations)
|
|
604
|
+
v.init(this.sessionData.sessionSecureID);
|
|
603
605
|
if (this.sessionData.userIdentifier && this.identify(
|
|
604
606
|
this.sessionData.userIdentifier,
|
|
605
607
|
this.sessionData.userObject
|
|
@@ -608,40 +610,43 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
608
610
|
this.options
|
|
609
611
|
) : this._firstLoadListeners.startListening(), this.pushPayloadTimerId && (clearTimeout(this.pushPayloadTimerId), this.pushPayloadTimerId = void 0), this._isCrossOriginIframe || (this.pushPayloadTimerId = setTimeout(() => {
|
|
610
612
|
this._save();
|
|
611
|
-
},
|
|
613
|
+
}, Ie)), this.options.disableSessionRecording) {
|
|
612
614
|
this.logger.log(
|
|
613
615
|
"Highlight is NOT RECORDING a session replay per H.init setting."
|
|
614
616
|
), this.ready = !0, this.state = "Recording", this.manualStopped = !1;
|
|
615
617
|
return;
|
|
616
618
|
}
|
|
617
|
-
const { getDeviceDetails:
|
|
618
|
-
|
|
619
|
+
const { getDeviceDetails: ue } = Vt();
|
|
620
|
+
ue && this.recordGauge({
|
|
619
621
|
name: N.DeviceMemory,
|
|
620
|
-
value:
|
|
622
|
+
value: ue().deviceMemory,
|
|
621
623
|
category: D.Device,
|
|
622
624
|
group: window.location.href
|
|
623
625
|
});
|
|
624
|
-
const
|
|
625
|
-
|
|
626
|
+
const fe = (v, qe) => {
|
|
627
|
+
qe && this.logger.log("received isCheckout emit", { event: v }), this.events.push(v);
|
|
626
628
|
};
|
|
627
|
-
|
|
628
|
-
const
|
|
629
|
+
fe.bind(this);
|
|
630
|
+
const xe = !!this._recordStop;
|
|
629
631
|
this._recordStop && (this._recordStop(), this._recordStop = void 0);
|
|
630
|
-
const [Ae,
|
|
632
|
+
const [Ae, Ke] = at(
|
|
631
633
|
this.privacySetting,
|
|
632
634
|
this.options.maskAllInputs,
|
|
633
635
|
this.options.maskInputOptions
|
|
634
636
|
);
|
|
635
|
-
this._recordStop =
|
|
636
|
-
ignoreClass: (
|
|
637
|
+
this._recordStop = J({
|
|
638
|
+
ignoreClass: (de = this.options.ignoreClass) != null ? de : "highlight-ignore",
|
|
637
639
|
ignoreSelector: this.options.ignoreSelector,
|
|
638
|
-
blockClass: (
|
|
640
|
+
blockClass: (he = this.options.blockClass) != null ? he : "highlight-block",
|
|
639
641
|
blockSelector: this.options.blockSelector,
|
|
640
|
-
emit:
|
|
642
|
+
emit: fe,
|
|
641
643
|
recordCrossOriginIframes: this.options.recordCrossOriginIframe,
|
|
642
|
-
privacySetting:
|
|
644
|
+
privacySetting: ot(
|
|
645
|
+
this.privacySetting,
|
|
646
|
+
this.options.maskPiiText
|
|
647
|
+
),
|
|
643
648
|
maskAllInputs: Ae,
|
|
644
|
-
maskInputOptions:
|
|
649
|
+
maskInputOptions: Ke,
|
|
645
650
|
maskTextClass: this.options.maskTextClass,
|
|
646
651
|
maskTextSelector: this.options.maskTextSelector,
|
|
647
652
|
recordCanvas: this.enableCanvasRecording,
|
|
@@ -656,18 +661,18 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
656
661
|
maxSnapshotDimension: this.samplingStrategy.canvasMaxSnapshotDimension
|
|
657
662
|
}
|
|
658
663
|
},
|
|
659
|
-
keepIframeSrcFn: (
|
|
664
|
+
keepIframeSrcFn: (v) => !this.options.recordCrossOriginIframe,
|
|
660
665
|
inlineImages: this.inlineImages,
|
|
661
666
|
inlineVideos: this.inlineVideos,
|
|
662
667
|
collectFonts: this.inlineImages,
|
|
663
668
|
inlineStylesheet: this.inlineStylesheet,
|
|
664
669
|
styleSheetResyncInterval: this.styleSheetResyncInterval,
|
|
665
|
-
plugins: [
|
|
670
|
+
plugins: [rt()],
|
|
666
671
|
logger: typeof this.options.debug == "boolean" && this.options.debug || typeof this.options.debug == "object" && this.options.debug.domRecording ? {
|
|
667
672
|
debug: this.logger.log,
|
|
668
|
-
warn:
|
|
673
|
+
warn: z
|
|
669
674
|
} : void 0
|
|
670
|
-
}),
|
|
675
|
+
}), xe || this.options.recordCrossOriginIframe && this._setupCrossOriginIframeParent(), document.referrer && (window && document.referrer.includes(window.location.origin) || (this.addCustomEvent("Referrer", document.referrer), this.addProperties(
|
|
671
676
|
{ referrer: document.referrer },
|
|
672
677
|
{ type: "session" }
|
|
673
678
|
))), this.sessionData.sessionKey && this.addProperties(
|
|
@@ -676,8 +681,8 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
676
681
|
},
|
|
677
682
|
{ type: "session" }
|
|
678
683
|
), this._setupWindowListeners(), this.ready = !0, this.state = "Recording", this.manualStopped = !1;
|
|
679
|
-
} catch (
|
|
680
|
-
this._isOnLocalHost && (
|
|
684
|
+
} catch (P) {
|
|
685
|
+
this._isOnLocalHost && (T("error", P), z("initializeSession", P));
|
|
681
686
|
}
|
|
682
687
|
});
|
|
683
688
|
}
|
|
@@ -703,7 +708,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
703
708
|
this.logger.log("Ignoring visibility event due to manual stop.");
|
|
704
709
|
return;
|
|
705
710
|
}
|
|
706
|
-
(/* @__PURE__ */ new Date()).getTime() - this._lastVisibilityChangeTime <
|
|
711
|
+
(/* @__PURE__ */ new Date()).getTime() - this._lastVisibilityChangeTime < gt || (this._lastVisibilityChangeTime = (/* @__PURE__ */ new Date()).getTime(), this.logger.log(`Detected window ${e ? "hidden" : "visible"}.`), e ? (this.addCustomEvent("TabHidden", !0), this.options.disableBackgroundRecording && this.stopRecording()) : (this.options.disableBackgroundRecording && (yield this.initialize()), this.addCustomEvent("TabHidden", !1)));
|
|
707
712
|
});
|
|
708
713
|
}
|
|
709
714
|
_setupCrossOriginIframe() {
|
|
@@ -714,7 +719,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
714
719
|
const n = s.data;
|
|
715
720
|
this.logger.log("highlight got window message ", n), this.sessionData.projectID = n.projectID, this.sessionData.sessionSecureID = n.sessionSecureID, window.parent.postMessage(
|
|
716
721
|
{
|
|
717
|
-
highlight:
|
|
722
|
+
highlight: _e
|
|
718
723
|
},
|
|
719
724
|
"*"
|
|
720
725
|
), window.removeEventListener("message", t), e();
|
|
@@ -739,8 +744,8 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
739
744
|
"*"
|
|
740
745
|
);
|
|
741
746
|
});
|
|
742
|
-
},
|
|
743
|
-
e.data.highlight ===
|
|
747
|
+
}, Ie), window.addEventListener("message", (e) => {
|
|
748
|
+
e.data.highlight === _e && this.logger.log(
|
|
744
749
|
"highlight got response from initialized iframe"
|
|
745
750
|
);
|
|
746
751
|
});
|
|
@@ -750,7 +755,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
750
755
|
try {
|
|
751
756
|
const n = this;
|
|
752
757
|
this.enableSegmentIntegration && this.listeners.push(
|
|
753
|
-
|
|
758
|
+
Ye((r) => {
|
|
754
759
|
if (r.type === "track") {
|
|
755
760
|
const l = {};
|
|
756
761
|
l["segment-event"] = r.event, n.addProperties(l, {
|
|
@@ -770,24 +775,24 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
770
775
|
}
|
|
771
776
|
})
|
|
772
777
|
), this.listeners.push(
|
|
773
|
-
|
|
778
|
+
ut((r) => {
|
|
774
779
|
this.reloaded ? (this.addCustomEvent("Reload", r), this.reloaded = !1, n.addProperties(
|
|
775
780
|
{ reload: !0 },
|
|
776
781
|
{ type: "session" }
|
|
777
782
|
)) : this.addCustomEvent("Navigate", r);
|
|
778
783
|
})
|
|
779
784
|
), this.listeners.push(
|
|
780
|
-
|
|
785
|
+
ft(
|
|
781
786
|
(r) => {
|
|
782
787
|
this.addCustomEvent("Viewport", r), this.submitViewportMetrics(r);
|
|
783
788
|
}
|
|
784
789
|
)
|
|
785
790
|
), this.listeners.push(
|
|
786
|
-
|
|
791
|
+
Xe((r, l) => {
|
|
787
792
|
let d = null, c = null;
|
|
788
793
|
if (l && l.target) {
|
|
789
794
|
const g = l.target;
|
|
790
|
-
d =
|
|
795
|
+
d = kt(g), c = g.textContent, c && c.length > 2e3 && (c = c.substring(0, 2e3));
|
|
791
796
|
}
|
|
792
797
|
this.addCustomEvent("Click", {
|
|
793
798
|
clickTarget: r,
|
|
@@ -796,11 +801,11 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
796
801
|
});
|
|
797
802
|
})
|
|
798
803
|
), this.listeners.push(
|
|
799
|
-
|
|
804
|
+
Ze((r) => {
|
|
800
805
|
r && this.addCustomEvent("Focus", r);
|
|
801
806
|
})
|
|
802
807
|
), this.listeners.push(
|
|
803
|
-
|
|
808
|
+
Bt((r) => {
|
|
804
809
|
const { name: l, value: d } = r, c = [], g = (h, f) => {
|
|
805
810
|
f && c.push({ name: h, value: f });
|
|
806
811
|
};
|
|
@@ -809,7 +814,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
809
814
|
const h = r.attribution;
|
|
810
815
|
g("web_vital.element", h.element), g(
|
|
811
816
|
"web_vital.attribution.url",
|
|
812
|
-
h.url ?
|
|
817
|
+
h.url ? xt(h.url) : void 0
|
|
813
818
|
);
|
|
814
819
|
break;
|
|
815
820
|
}
|
|
@@ -843,7 +848,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
843
848
|
});
|
|
844
849
|
})
|
|
845
850
|
), this.listeners.push(
|
|
846
|
-
|
|
851
|
+
Mt(
|
|
847
852
|
(r) => {
|
|
848
853
|
const l = [];
|
|
849
854
|
r.saveData !== void 0 && l.push({
|
|
@@ -856,7 +861,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
856
861
|
name: "type",
|
|
857
862
|
value: r.type.toString()
|
|
858
863
|
}), Object.entries(r).forEach(([d, c]) => {
|
|
859
|
-
|
|
864
|
+
vt(c) && this.recordGauge({
|
|
860
865
|
name: d,
|
|
861
866
|
value: c,
|
|
862
867
|
category: D.Performance,
|
|
@@ -868,15 +873,15 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
868
873
|
this._recordingStartTime
|
|
869
874
|
)
|
|
870
875
|
), this.sessionShortcut && this.listeners.push(
|
|
871
|
-
|
|
876
|
+
et(this.sessionShortcut, () => {
|
|
872
877
|
window.open(
|
|
873
878
|
this.getCurrentSessionURLWithTimestamp(),
|
|
874
879
|
"_blank"
|
|
875
880
|
);
|
|
876
881
|
})
|
|
877
882
|
), this.enablePerformanceRecording && (this.listeners.push(
|
|
878
|
-
|
|
879
|
-
this.addCustomEvent("Performance",
|
|
883
|
+
Ft((r) => {
|
|
884
|
+
this.addCustomEvent("Performance", K(r)), Object.entries(r).filter(([l]) => l !== "relativeTimestamp").forEach(
|
|
880
885
|
([l, d]) => d && this.recordGauge({
|
|
881
886
|
name: l,
|
|
882
887
|
value: d,
|
|
@@ -886,8 +891,8 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
886
891
|
);
|
|
887
892
|
}, this._recordingStartTime)
|
|
888
893
|
), this.listeners.push(
|
|
889
|
-
|
|
890
|
-
this.addCustomEvent("Jank",
|
|
894
|
+
$t((r) => {
|
|
895
|
+
this.addCustomEvent("Jank", K(r)), this.recordGauge({
|
|
891
896
|
name: "Jank",
|
|
892
897
|
value: r.jankAmount,
|
|
893
898
|
category: D.WebVital,
|
|
@@ -899,7 +904,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
899
904
|
({ visible: r }) => {
|
|
900
905
|
this._visibilityHandler(!r);
|
|
901
906
|
}
|
|
902
|
-
), this.logger.log("Set up Electron highlight.run events.")) : (
|
|
907
|
+
), this.logger.log("Set up Electron highlight.run events.")) : (tt(
|
|
903
908
|
(r) => this._visibilityHandler(r)
|
|
904
909
|
), this.logger.log("Set up document visibility listener.")), this._hasPreviouslyInitialized = !0);
|
|
905
910
|
const o = () => {
|
|
@@ -909,16 +914,16 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
909
914
|
() => window.removeEventListener("beforeunload", o)
|
|
910
915
|
);
|
|
911
916
|
} catch (n) {
|
|
912
|
-
this._isOnLocalHost && (
|
|
917
|
+
this._isOnLocalHost && (T("error", n), z("initializeSession _setupWindowListeners", n));
|
|
913
918
|
}
|
|
914
919
|
const e = () => {
|
|
915
|
-
this.addCustomEvent("Page Unload", ""),
|
|
920
|
+
this.addCustomEvent("Page Unload", ""), X(this.sessionData.sessionSecureID), W(this.sessionData);
|
|
916
921
|
};
|
|
917
922
|
if (window.addEventListener("beforeunload", e), this.listeners.push(
|
|
918
923
|
() => window.removeEventListener("beforeunload", e)
|
|
919
924
|
), navigator.userAgent.match(/iPad/i) || navigator.userAgent.match(/iPhone/i)) {
|
|
920
925
|
const n = () => {
|
|
921
|
-
this.addCustomEvent("Page Unload", ""),
|
|
926
|
+
this.addCustomEvent("Page Unload", ""), X(this.sessionData.sessionSecureID), W(this.sessionData);
|
|
922
927
|
};
|
|
923
928
|
window.addEventListener("pagehide", n), this.listeners.push(
|
|
924
929
|
() => window.removeEventListener("pagehide", n)
|
|
@@ -962,7 +967,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
962
967
|
var s, n;
|
|
963
968
|
let t = this._gauges.get(e.name);
|
|
964
969
|
if (!t) {
|
|
965
|
-
if (t = (s =
|
|
970
|
+
if (t = (s = x()) == null ? void 0 : s.createGauge(
|
|
966
971
|
e.name,
|
|
967
972
|
A(e.name, e.unit)
|
|
968
973
|
), !t) return;
|
|
@@ -980,7 +985,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
980
985
|
var s, n;
|
|
981
986
|
let t = this._counters.get(e.name);
|
|
982
987
|
if (!t) {
|
|
983
|
-
if (t = (s =
|
|
988
|
+
if (t = (s = x()) == null ? void 0 : s.createCounter(
|
|
984
989
|
e.name,
|
|
985
990
|
A(e.name, e.unit)
|
|
986
991
|
), !t) return;
|
|
@@ -999,7 +1004,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
999
1004
|
var s, n;
|
|
1000
1005
|
let t = this._histograms.get(e.name);
|
|
1001
1006
|
if (!t) {
|
|
1002
|
-
if (t = (s =
|
|
1007
|
+
if (t = (s = x()) == null ? void 0 : s.createHistogram(
|
|
1003
1008
|
e.name,
|
|
1004
1009
|
A(e.name, e.unit)
|
|
1005
1010
|
), !t) return;
|
|
@@ -1015,7 +1020,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
1015
1020
|
var s, n;
|
|
1016
1021
|
let t = this._up_down_counters.get(e.name);
|
|
1017
1022
|
if (!t) {
|
|
1018
|
-
if (t = (s =
|
|
1023
|
+
if (t = (s = x()) == null ? void 0 : s.createUpDownCounter(
|
|
1019
1024
|
e.name,
|
|
1020
1025
|
A(e.name, e.unit)
|
|
1021
1026
|
), !t) return;
|
|
@@ -1035,7 +1040,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
1035
1040
|
this.manualStopped = !!e, this.manualStopped && this.addCustomEvent(
|
|
1036
1041
|
"Stop",
|
|
1037
1042
|
"H.stop() was called which stops Highlight from recording."
|
|
1038
|
-
), this.state = "NotRecording", e && this._recordStop && (this._recordStop(), this._recordStop = void 0), this.listeners.forEach((t) => t()), this.listeners = [],
|
|
1043
|
+
), this.state = "NotRecording", e && this._recordStop && (this._recordStop(), this._recordStop = void 0), this.listeners.forEach((t) => t()), this.listeners = [], Be();
|
|
1039
1044
|
}
|
|
1040
1045
|
getCurrentSessionTimestamp() {
|
|
1041
1046
|
return this._recordingStartTime;
|
|
@@ -1045,15 +1050,15 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
1045
1050
|
*/
|
|
1046
1051
|
getCurrentSessionURLWithTimestamp() {
|
|
1047
1052
|
const e = (/* @__PURE__ */ new Date()).getTime(), { projectID: t, sessionSecureID: s } = this.sessionData, n = (e - this._recordingStartTime) / 1e3;
|
|
1048
|
-
return `https://${
|
|
1053
|
+
return `https://${Z}/${t}/sessions/${s}?ts=${n}`;
|
|
1049
1054
|
}
|
|
1050
1055
|
getCurrentSessionURL() {
|
|
1051
1056
|
const e = this.sessionData.projectID, t = this.sessionData.sessionSecureID;
|
|
1052
|
-
return e && t ? `https://${
|
|
1057
|
+
return e && t ? `https://${Z}/${e}/sessions/${t}` : null;
|
|
1053
1058
|
}
|
|
1054
1059
|
snapshot(e) {
|
|
1055
1060
|
return _(this, null, function* () {
|
|
1056
|
-
yield
|
|
1061
|
+
yield J.snapshotCanvas(e);
|
|
1057
1062
|
});
|
|
1058
1063
|
}
|
|
1059
1064
|
addSessionFeedback({
|
|
@@ -1065,7 +1070,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
1065
1070
|
var o;
|
|
1066
1071
|
this._worker.postMessage({
|
|
1067
1072
|
message: {
|
|
1068
|
-
type:
|
|
1073
|
+
type: C.Feedback,
|
|
1069
1074
|
verbatim: t,
|
|
1070
1075
|
timestamp: e,
|
|
1071
1076
|
userName: n || this.sessionData.userIdentifier,
|
|
@@ -1078,7 +1083,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
1078
1083
|
return _(this, null, function* () {
|
|
1079
1084
|
var e;
|
|
1080
1085
|
try {
|
|
1081
|
-
this.state === "Recording" && this.listeners && !this.sessionData.sessionKey && this.sessionData.sessionStartTime && Date.now() - this.sessionData.sessionStartTime >
|
|
1086
|
+
this.state === "Recording" && this.listeners && !this.sessionData.sessionKey && this.sessionData.sessionStartTime && Date.now() - this.sessionData.sessionStartTime > mt && (this.logger.log("Resetting session", {
|
|
1082
1087
|
start: this.sessionData.sessionStartTime
|
|
1083
1088
|
}), yield this._reset({}));
|
|
1084
1089
|
let t;
|
|
@@ -1086,7 +1091,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
1086
1091
|
let n = new Blob(
|
|
1087
1092
|
[
|
|
1088
1093
|
JSON.stringify({
|
|
1089
|
-
query:
|
|
1094
|
+
query: wt(_t),
|
|
1090
1095
|
variables: s
|
|
1091
1096
|
})
|
|
1092
1097
|
],
|
|
@@ -1098,13 +1103,13 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
1098
1103
|
method: "POST",
|
|
1099
1104
|
body: n
|
|
1100
1105
|
}), 0;
|
|
1101
|
-
})), yield this._sendPayload({ sendFn: t }), this.hasPushedData = !0, this.sessionData.lastPushTime = Date.now(),
|
|
1106
|
+
})), yield this._sendPayload({ sendFn: t }), this.hasPushedData = !0, this.sessionData.lastPushTime = Date.now(), W(this.sessionData);
|
|
1102
1107
|
} catch (t) {
|
|
1103
|
-
this._isOnLocalHost && (
|
|
1108
|
+
this._isOnLocalHost && (T("error", t), z("_save", t));
|
|
1104
1109
|
}
|
|
1105
1110
|
this.state === "Recording" && (this.pushPayloadTimerId && (clearTimeout(this.pushPayloadTimerId), this.pushPayloadTimerId = void 0), this.pushPayloadTimerId = setTimeout(() => {
|
|
1106
1111
|
this._save();
|
|
1107
|
-
},
|
|
1112
|
+
}, pt));
|
|
1108
1113
|
});
|
|
1109
1114
|
}
|
|
1110
1115
|
/**
|
|
@@ -1115,10 +1120,10 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
1115
1120
|
if (this.state === "NotRecording") {
|
|
1116
1121
|
let s;
|
|
1117
1122
|
const n = () => {
|
|
1118
|
-
clearInterval(s), this.state === "Recording" && this.events.length > 0 ?
|
|
1123
|
+
clearInterval(s), this.state === "Recording" && this.events.length > 0 ? Re(e, t) : s = setTimeout(n, 500);
|
|
1119
1124
|
};
|
|
1120
1125
|
s = setTimeout(n, 500);
|
|
1121
|
-
} else this.state === "Recording" && (this.events.length > 0 || this.hasPushedData) &&
|
|
1126
|
+
} else this.state === "Recording" && (this.events.length > 0 || this.hasPushedData) && Re(e, t);
|
|
1122
1127
|
}
|
|
1123
1128
|
_sendPayload(t) {
|
|
1124
1129
|
return _(this, arguments, function* ({
|
|
@@ -1129,27 +1134,27 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
1129
1134
|
this._recordingStartTime
|
|
1130
1135
|
), n = I.getRecordedWebSocketEvents(
|
|
1131
1136
|
this._firstLoadListeners
|
|
1132
|
-
), o = [...this.events], r = [...this._firstLoadListeners.messages], l = [...this._firstLoadListeners.errors], { bytes: d, time: c } = this.enableCanvasRecording ?
|
|
1137
|
+
), o = [...this.events], r = [...this._firstLoadListeners.messages], l = [...this._firstLoadListeners.errors], { bytes: d, time: c } = this.enableCanvasRecording ? Le.canvas : Le.normal;
|
|
1133
1138
|
this._eventBytesSinceSnapshot >= d && (/* @__PURE__ */ new Date()).getTime() - this._lastSnapshotTime >= c && this.takeFullSnapshot(), this.logger.log(
|
|
1134
1139
|
`Sending: ${o.length} events, ${r.length} messages, ${s.length} network resources, ${l.length} errors
|
|
1135
1140
|
To: ${this._backendUrl}
|
|
1136
1141
|
Org: ${this.organizationID}
|
|
1137
1142
|
SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
1138
1143
|
);
|
|
1139
|
-
const g = (/* @__PURE__ */ new Date()).getTime(), h =
|
|
1144
|
+
const g = (/* @__PURE__ */ new Date()).getTime(), h = st();
|
|
1140
1145
|
if (e) {
|
|
1141
1146
|
const f = {
|
|
1142
1147
|
session_secure_id: this.sessionData.sessionSecureID,
|
|
1143
1148
|
payload_id: g.toString(),
|
|
1144
1149
|
events: { events: o },
|
|
1145
|
-
messages:
|
|
1150
|
+
messages: K({ messages: r }),
|
|
1146
1151
|
resources: JSON.stringify({ resources: s }),
|
|
1147
1152
|
web_socket_events: JSON.stringify({ webSocketEvents: n }),
|
|
1148
1153
|
errors: l,
|
|
1149
1154
|
is_beacon: !1,
|
|
1150
1155
|
has_session_unloaded: this.hasSessionUnloaded,
|
|
1151
1156
|
highlight_logs: h || void 0
|
|
1152
|
-
}, { compressedBase64: m } = yield
|
|
1157
|
+
}, { compressedBase64: m } = yield it(f);
|
|
1153
1158
|
yield e({
|
|
1154
1159
|
session_secure_id: this.sessionData.sessionSecureID,
|
|
1155
1160
|
payload_id: (/* @__PURE__ */ new Date()).getTime().toString(),
|
|
@@ -1158,7 +1163,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
1158
1163
|
} else
|
|
1159
1164
|
this._worker.postMessage({
|
|
1160
1165
|
message: {
|
|
1161
|
-
type:
|
|
1166
|
+
type: C.AsyncEvents,
|
|
1162
1167
|
id: g,
|
|
1163
1168
|
events: o,
|
|
1164
1169
|
messages: r,
|
|
@@ -1171,11 +1176,11 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
1171
1176
|
highlightLogs: h
|
|
1172
1177
|
}
|
|
1173
1178
|
});
|
|
1174
|
-
|
|
1179
|
+
W(this.sessionData), I.clearRecordedNetworkResources(
|
|
1175
1180
|
this._firstLoadListeners
|
|
1176
1181
|
), this.events = this.events.slice(o.length), this._firstLoadListeners.messages = this._firstLoadListeners.messages.slice(r.length), this._firstLoadListeners.errors = this._firstLoadListeners.errors.slice(
|
|
1177
1182
|
l.length
|
|
1178
|
-
),
|
|
1183
|
+
), nt(h);
|
|
1179
1184
|
});
|
|
1180
1185
|
}
|
|
1181
1186
|
takeFullSnapshot() {
|
|
@@ -1186,15 +1191,15 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
1186
1191
|
this.logger.log("taking full snapshot", {
|
|
1187
1192
|
bytesSinceSnapshot: this._eventBytesSinceSnapshot,
|
|
1188
1193
|
lastSnapshotTime: this._lastSnapshotTime
|
|
1189
|
-
}),
|
|
1194
|
+
}), J.takeFullSnapshot(), this._eventBytesSinceSnapshot = 0, this._lastSnapshotTime = (/* @__PURE__ */ new Date()).getTime();
|
|
1190
1195
|
}
|
|
1191
1196
|
registerLD(e) {
|
|
1192
|
-
this._integrations.length || this._integrations.push(new
|
|
1197
|
+
this._integrations.length || this._integrations.push(new We(e));
|
|
1193
1198
|
}
|
|
1194
1199
|
};
|
|
1195
|
-
|
|
1196
|
-
let
|
|
1197
|
-
const
|
|
1200
|
+
$ = new WeakMap();
|
|
1201
|
+
let ee = se;
|
|
1202
|
+
const Jt = () => {
|
|
1198
1203
|
var i, e;
|
|
1199
1204
|
typeof chrome != "undefined" && ((i = chrome == null ? void 0 : chrome.runtime) != null && i.onMessage) && ((e = chrome == null ? void 0 : chrome.runtime) == null || e.onMessage.addListener(
|
|
1200
1205
|
(t, s, n) => {
|
|
@@ -1219,7 +1224,7 @@ const qt = () => {
|
|
|
1219
1224
|
}
|
|
1220
1225
|
));
|
|
1221
1226
|
};
|
|
1222
|
-
function
|
|
1227
|
+
function ns(i) {
|
|
1223
1228
|
var e;
|
|
1224
1229
|
i.on && ((e = i.webContents) != null && e.send) && (i.on("focus", () => {
|
|
1225
1230
|
i.webContents.send("highlight.run", { visible: !0 });
|
|
@@ -1229,7 +1234,7 @@ function ts(i) {
|
|
|
1229
1234
|
i.webContents.send("highlight.run", { visible: !1 });
|
|
1230
1235
|
}));
|
|
1231
1236
|
}
|
|
1232
|
-
const
|
|
1237
|
+
const rs = ({
|
|
1233
1238
|
next: i,
|
|
1234
1239
|
payload: e
|
|
1235
1240
|
}) => {
|
|
@@ -1246,20 +1251,20 @@ const ss = ({
|
|
|
1246
1251
|
}
|
|
1247
1252
|
}
|
|
1248
1253
|
i(e);
|
|
1249
|
-
},
|
|
1254
|
+
}, $e = () => {
|
|
1250
1255
|
if (typeof window != "undefined") {
|
|
1251
1256
|
if (typeof window._highlightFetchPatch != "undefined")
|
|
1252
1257
|
return;
|
|
1253
1258
|
window._originalFetch = window.fetch, window._fetchProxy = (i, e) => window._originalFetch(i, e), window._highlightFetchPatch = (i, e) => window._fetchProxy.call(window || global, i, e), window.fetch = window._highlightFetchPatch;
|
|
1254
1259
|
}
|
|
1255
|
-
},
|
|
1260
|
+
}, He = () => null, Ve = () => {
|
|
1256
1261
|
if (typeof window != "undefined") {
|
|
1257
1262
|
if (typeof window._highlightWebSocketRequestCallback != "undefined")
|
|
1258
1263
|
return;
|
|
1259
|
-
window._highlightWebSocketRequestCallback =
|
|
1264
|
+
window._highlightWebSocketRequestCallback = He, window._highlightWebSocketEventCallback = He;
|
|
1260
1265
|
const i = new Proxy(window.WebSocket, {
|
|
1261
1266
|
construct(e, t) {
|
|
1262
|
-
const [, s] =
|
|
1267
|
+
const [, s] = At(), n = new e(...t), o = (g) => {
|
|
1263
1268
|
window._highlightWebSocketRequestCallback({
|
|
1264
1269
|
socketId: s,
|
|
1265
1270
|
initiatorType: "websocket",
|
|
@@ -1299,13 +1304,13 @@ const ss = ({
|
|
|
1299
1304
|
const c = new Proxy(n.send, {
|
|
1300
1305
|
apply: function(g, h, f) {
|
|
1301
1306
|
const m = f[0], R = typeof m == "string" ? m : void 0;
|
|
1302
|
-
let
|
|
1303
|
-
typeof m == "string" ?
|
|
1307
|
+
let k;
|
|
1308
|
+
typeof m == "string" ? k = m.length : m instanceof Blob ? k = m.size : k = m.byteLength || 0, window._highlightWebSocketEventCallback({
|
|
1304
1309
|
socketId: s,
|
|
1305
1310
|
type: "sent",
|
|
1306
1311
|
name: n.url,
|
|
1307
1312
|
timeStamp: performance.timeOrigin + performance.now(),
|
|
1308
|
-
size:
|
|
1313
|
+
size: k,
|
|
1309
1314
|
message: R
|
|
1310
1315
|
}), g.apply(h, f);
|
|
1311
1316
|
}
|
|
@@ -1316,11 +1321,11 @@ const ss = ({
|
|
|
1316
1321
|
window.WebSocket = i;
|
|
1317
1322
|
}
|
|
1318
1323
|
};
|
|
1319
|
-
var
|
|
1324
|
+
var Qt = /* @__PURE__ */ ((i) => (i.Device = "Device", i.WebVital = "WebVital", i.Frontend = "Frontend", i.Backend = "Backend", i))(Qt || {});
|
|
1320
1325
|
const b = (i, e) => {
|
|
1321
|
-
|
|
1322
|
-
},
|
|
1323
|
-
let
|
|
1326
|
+
T("warn", `highlight.run warning: (${i}): `, e);
|
|
1327
|
+
}, Yt = 200;
|
|
1328
|
+
let B = [], q, u, M, Ue = [], te = !1;
|
|
1324
1329
|
const p = {
|
|
1325
1330
|
options: void 0,
|
|
1326
1331
|
init: (i, e) => {
|
|
@@ -1334,22 +1339,22 @@ const p = {
|
|
|
1334
1339
|
);
|
|
1335
1340
|
return;
|
|
1336
1341
|
}
|
|
1337
|
-
e != null && e.sessionCookie ?
|
|
1338
|
-
const g =
|
|
1342
|
+
e != null && e.sessionCookie ? Dt() : ze(!1);
|
|
1343
|
+
const g = F();
|
|
1339
1344
|
let h = O();
|
|
1340
1345
|
if (e != null && e.sessionKey ? h = O(
|
|
1341
1346
|
`${i}-${e.sessionKey}`
|
|
1342
|
-
) : g != null && g.sessionSecureID && (h = g.sessionSecureID),
|
|
1347
|
+
) : g != null && g.sessionSecureID && (h = g.sessionSecureID), te)
|
|
1343
1348
|
return { sessionSecureID: h };
|
|
1344
|
-
|
|
1349
|
+
te = !0, $e(), Ve();
|
|
1345
1350
|
const f = y(w({}, e), {
|
|
1346
1351
|
organizationID: i,
|
|
1347
|
-
firstloadVersion:
|
|
1352
|
+
firstloadVersion: It,
|
|
1348
1353
|
environment: (e == null ? void 0 : e.environment) || "production",
|
|
1349
1354
|
appVersion: e == null ? void 0 : e.version,
|
|
1350
1355
|
sessionSecureID: h
|
|
1351
1356
|
});
|
|
1352
|
-
return
|
|
1357
|
+
return M = new I(f), e != null && e.manualStart || M.startListening(), u = u != null ? u : new ee(f, M), e != null && e.manualStart || u.initialize(), !((s = (t = e == null ? void 0 : e.integrations) == null ? void 0 : t.mixpanel) != null && s.disabled) && ((o = (n = e == null ? void 0 : e.integrations) == null ? void 0 : n.mixpanel) != null && o.projectToken) && ct(e.integrations.mixpanel), !((l = (r = e == null ? void 0 : e.integrations) == null ? void 0 : r.amplitude) != null && l.disabled) && ((c = (d = e == null ? void 0 : e.integrations) == null ? void 0 : d.amplitude) != null && c.apiKey) && lt(e.integrations.amplitude), { sessionSecureID: h };
|
|
1353
1358
|
} catch (g) {
|
|
1354
1359
|
b("init", g);
|
|
1355
1360
|
}
|
|
@@ -1441,7 +1446,7 @@ const p = {
|
|
|
1441
1446
|
var e;
|
|
1442
1447
|
(u == null ? void 0 : u.state) === "Recording" && !(i != null && i.forceNew) ? i != null && i.silent || console.warn(
|
|
1443
1448
|
"Highlight is already recording. Please `H.stop()` the current session before starting a new one."
|
|
1444
|
-
) : (((e = u == null ? void 0 : u._firstLoadListeners) != null ? e :
|
|
1449
|
+
) : (((e = u == null ? void 0 : u._firstLoadListeners) != null ? e : M).startListening(), p.onHighlightReady(
|
|
1445
1450
|
() => _(void 0, null, function* () {
|
|
1446
1451
|
yield u.initialize(i);
|
|
1447
1452
|
}),
|
|
@@ -1531,9 +1536,9 @@ const p = {
|
|
|
1531
1536
|
}
|
|
1532
1537
|
},
|
|
1533
1538
|
startSpan: (i, e, t, s) => {
|
|
1534
|
-
const n =
|
|
1539
|
+
const n = Te();
|
|
1535
1540
|
if (!n) {
|
|
1536
|
-
const r =
|
|
1541
|
+
const r = Pe();
|
|
1537
1542
|
return s === void 0 && t === void 0 ? e(r) : s === void 0 ? t(r) : s(r);
|
|
1538
1543
|
}
|
|
1539
1544
|
const o = (r, l) => {
|
|
@@ -1555,9 +1560,9 @@ const p = {
|
|
|
1555
1560
|
);
|
|
1556
1561
|
},
|
|
1557
1562
|
startManualSpan: (i, e, t, s) => {
|
|
1558
|
-
const n =
|
|
1563
|
+
const n = Te();
|
|
1559
1564
|
if (!n) {
|
|
1560
|
-
const o =
|
|
1565
|
+
const o = Pe();
|
|
1561
1566
|
return s === void 0 && t === void 0 ? e(o) : s === void 0 ? t(o) : s(o);
|
|
1562
1567
|
}
|
|
1563
1568
|
return s === void 0 && t === void 0 ? n.startActiveSpan(i, e) : s === void 0 ? n.startActiveSpan(
|
|
@@ -1573,9 +1578,9 @@ const p = {
|
|
|
1573
1578
|
},
|
|
1574
1579
|
getSessionURL: () => new Promise((i, e) => {
|
|
1575
1580
|
p.onHighlightReady(() => {
|
|
1576
|
-
const t = u.sessionData.sessionSecureID, s =
|
|
1581
|
+
const t = u.sessionData.sessionSecureID, s = F(t);
|
|
1577
1582
|
s ? i(
|
|
1578
|
-
`https://${
|
|
1583
|
+
`https://${Z}/${s.projectID}/sessions/${t}`
|
|
1579
1584
|
) : e(new Error(`Unable to get session URL: ${t}`));
|
|
1580
1585
|
});
|
|
1581
1586
|
}),
|
|
@@ -1585,7 +1590,7 @@ const p = {
|
|
|
1585
1590
|
const t = yield p.getSessionURL();
|
|
1586
1591
|
if (!t)
|
|
1587
1592
|
throw new Error("Could not get session URL");
|
|
1588
|
-
const s = u.sessionData.sessionSecureID, n =
|
|
1593
|
+
const s = u.sessionData.sessionSecureID, n = F(s), o = n == null ? void 0 : n.sessionStartTime;
|
|
1589
1594
|
if (!o)
|
|
1590
1595
|
throw new Error("Could not get session start timestamp");
|
|
1591
1596
|
const r = (/* @__PURE__ */ new Date()).getTime(), l = new URL(t), d = new URL(t);
|
|
@@ -1611,32 +1616,32 @@ const p = {
|
|
|
1611
1616
|
i();
|
|
1612
1617
|
return;
|
|
1613
1618
|
}
|
|
1614
|
-
if (
|
|
1619
|
+
if (B.push({ options: e, func: i }), q !== void 0)
|
|
1615
1620
|
return;
|
|
1616
1621
|
const t = () => {
|
|
1617
|
-
|
|
1622
|
+
B = B.filter((n) => {
|
|
1618
1623
|
var o;
|
|
1619
1624
|
return !u || ((o = n.options) == null ? void 0 : o.waitForReady) !== !1 && !u.ready ? !0 : (n.func(), !1);
|
|
1620
|
-
}),
|
|
1625
|
+
}), q = void 0, B.length > 0 && (q = setTimeout(
|
|
1621
1626
|
t,
|
|
1622
|
-
|
|
1627
|
+
Yt
|
|
1623
1628
|
));
|
|
1624
1629
|
};
|
|
1625
1630
|
t();
|
|
1626
1631
|
},
|
|
1627
1632
|
registerLD(i) {
|
|
1628
|
-
|
|
1633
|
+
Ue.length || (p.onHighlightReady(() => {
|
|
1629
1634
|
u.registerLD(i);
|
|
1630
|
-
}),
|
|
1635
|
+
}), Rt(this, i, p.options), Ue.push(new We(i)));
|
|
1631
1636
|
}
|
|
1632
1637
|
};
|
|
1633
1638
|
typeof window != "undefined" && (window.H = p);
|
|
1634
|
-
|
|
1635
|
-
Fe();
|
|
1639
|
+
Jt();
|
|
1636
1640
|
$e();
|
|
1637
|
-
|
|
1641
|
+
Ve();
|
|
1642
|
+
const os = {
|
|
1638
1643
|
reset: () => {
|
|
1639
|
-
|
|
1644
|
+
te = !1, u = void 0, B = [], q = void 0, M = void 0;
|
|
1640
1645
|
},
|
|
1641
1646
|
setHighlightObj: (i) => {
|
|
1642
1647
|
u = i;
|
|
@@ -1645,13 +1650,13 @@ const is = {
|
|
|
1645
1650
|
export {
|
|
1646
1651
|
O as GenerateSecureID,
|
|
1647
1652
|
p as H,
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1653
|
+
rs as HighlightSegmentMiddleware,
|
|
1654
|
+
us as LDObserve,
|
|
1655
|
+
ms as LDRecord,
|
|
1656
|
+
Qt as MetricCategory,
|
|
1657
|
+
hs as Observe,
|
|
1658
|
+
ls as Record,
|
|
1659
|
+
os as __testing,
|
|
1660
|
+
ns as configureElectronHighlight
|
|
1656
1661
|
};
|
|
1657
1662
|
//# sourceMappingURL=index.js.map
|