@launchdarkly/o11y 1.3.0 → 1.4.0
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 +22 -0
- package/dist/LDObserve-BQr7RYVC.js +130 -0
- package/dist/LDObserve-BQr7RYVC.js.map +1 -0
- package/dist/LDObserve.d.ts +78 -1
- package/dist/LDObserve.js +2 -2
- package/dist/LDRecord.d.ts +78 -1
- package/dist/LDRecord.js +43 -24
- package/dist/LDRecord.js.map +1 -1
- package/dist/assets/highlight-client-worker-DrDPRCrv.js.map +1 -0
- package/dist/buffer-CwCRPuMA.js +248 -0
- package/dist/buffer-CwCRPuMA.js.map +1 -0
- package/dist/{common-BkAGcE30.js → common-7gIdCuSo.js} +771 -732
- package/dist/{common-BkAGcE30.js.map → common-7gIdCuSo.js.map} +1 -1
- package/dist/index.d.ts +126 -5
- package/dist/index.js +466 -494
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +74 -74
- package/dist/index.umd.js.map +1 -1
- package/dist/{observe-xxoYHNEh.js → observe-DVzqBVcI.js} +2938 -2904
- package/dist/observe-DVzqBVcI.js.map +1 -0
- package/dist/observe.d.ts +30 -1
- package/dist/observe.js +4 -4
- package/dist/{record-DTawahUk.js → record-CwkFdJT0.js} +1738 -1743
- package/dist/{record-DTawahUk.js.map → record-CwkFdJT0.js.map} +1 -1
- package/dist/record.d.ts +47 -2
- package/dist/record.js +3 -3
- package/package.json +1 -1
- package/dist/LDObserve-CHIjcqIn.js +0 -92
- package/dist/LDObserve-CHIjcqIn.js.map +0 -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-xxoYHNEh.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var me = Object.prototype.hasOwnProperty,
|
|
5
|
-
var pe = (
|
|
6
|
-
throw TypeError(
|
|
1
|
+
var Ge = Object.defineProperty, je = Object.defineProperties;
|
|
2
|
+
var Je = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var V = Object.getOwnPropertySymbols;
|
|
4
|
+
var me = Object.prototype.hasOwnProperty, we = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var pe = (s) => {
|
|
6
|
+
throw TypeError(s);
|
|
7
7
|
};
|
|
8
|
-
var
|
|
8
|
+
var G = (s, e, t) => e in s ? Ge(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, p = (s, e) => {
|
|
9
9
|
for (var t in e || (e = {}))
|
|
10
|
-
me.call(e, t) &&
|
|
11
|
-
if (
|
|
12
|
-
for (var t of
|
|
13
|
-
|
|
14
|
-
return
|
|
15
|
-
}, y = (
|
|
16
|
-
var
|
|
10
|
+
me.call(e, t) && G(s, t, e[t]);
|
|
11
|
+
if (V)
|
|
12
|
+
for (var t of V(e))
|
|
13
|
+
we.call(e, t) && G(s, t, e[t]);
|
|
14
|
+
return s;
|
|
15
|
+
}, y = (s, e) => je(s, Je(e));
|
|
16
|
+
var j = (s, e) => {
|
|
17
17
|
var t = {};
|
|
18
|
-
for (var
|
|
19
|
-
me.call(
|
|
20
|
-
if (
|
|
21
|
-
for (var
|
|
22
|
-
e.indexOf(
|
|
18
|
+
for (var i in s)
|
|
19
|
+
me.call(s, i) && e.indexOf(i) < 0 && (t[i] = s[i]);
|
|
20
|
+
if (s != null && V)
|
|
21
|
+
for (var i of V(s))
|
|
22
|
+
e.indexOf(i) < 0 && we.call(s, i) && (t[i] = s[i]);
|
|
23
23
|
return t;
|
|
24
24
|
};
|
|
25
|
-
var a = (
|
|
26
|
-
var
|
|
27
|
-
var
|
|
25
|
+
var a = (s, e, t) => G(s, typeof e != "symbol" ? e + "" : e, t), Se = (s, e, t) => e.has(s) || pe("Cannot " + t);
|
|
26
|
+
var ye = (s, e, t) => (Se(s, e, "read from private field"), t ? t.call(s) : e.get(s)), be = (s, e, t) => e.has(s) ? pe("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(s) : e.set(s, t), ke = (s, e, t, i) => (Se(s, e, "write to private field"), i ? i.call(s, t) : e.set(s, t), t);
|
|
27
|
+
var R = (s, e, t) => new Promise((i, n) => {
|
|
28
28
|
var o = (d) => {
|
|
29
29
|
try {
|
|
30
30
|
l(t.next(d));
|
|
@@ -37,35 +37,35 @@ var _ = (i, e, t) => new Promise((s, n) => {
|
|
|
37
37
|
} catch (c) {
|
|
38
38
|
n(c);
|
|
39
39
|
}
|
|
40
|
-
}, l = (d) => d.done ?
|
|
41
|
-
l((t = t.apply(
|
|
40
|
+
}, l = (d) => d.done ? i(d.value) : Promise.resolve(d.value).then(o, r);
|
|
41
|
+
l((t = t.apply(s, 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
|
|
53
|
-
const
|
|
54
|
-
window._highlightWebSocketRequestCallback =
|
|
43
|
+
import { W as Qe, M as L, r as J, I as ve, a as Re, S as Ye, C as Xe, F as Ze, b as et, P as tt, c as _e, 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-CwkFdJT0.js";
|
|
44
|
+
import { R as ds } from "./record-CwkFdJT0.js";
|
|
45
|
+
import { s as K, G as T, 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 wt, L as We, j as ze, k as pt, p as St, l as Ce, m as Le, n as yt, o as bt, q as kt, t as vt, u as Rt, v as _t, w as Dt, x as It, y as Ct } from "./common-7gIdCuSo.js";
|
|
46
|
+
import { X as Lt, F as Et, A as Nt, C as Tt, E as Ot, s as Be, D as Pt, a as Ht, m as Ee, d as Me, b as Ne, c as Te, r as Fe, e as Ut, p as Wt, f as zt, g as Bt, M as D, h as N, W as Mt, N as Ft, P as $t, J as Vt, i as x, j as A, k as xt, l as At, n as Kt, o as Oe } from "./observe-DVzqBVcI.js";
|
|
47
|
+
import { O as gs } from "./observe-DVzqBVcI.js";
|
|
48
|
+
import { L as qt, s as Gt, a as O } from "./buffer-CwCRPuMA.js";
|
|
49
|
+
import { g as Pe } from "./LDObserve-BQr7RYVC.js";
|
|
50
|
+
import { L as fs } from "./LDObserve-BQr7RYVC.js";
|
|
51
|
+
import { LDRecord as ws } from "./LDRecord.js";
|
|
52
|
+
const jt = (s, e, t) => {
|
|
53
|
+
const i = window._highlightWebSocketRequestCallback;
|
|
54
|
+
window._highlightWebSocketRequestCallback = s;
|
|
55
55
|
const n = window._highlightWebSocketEventCallback;
|
|
56
56
|
return window._highlightWebSocketEventCallback = (o) => {
|
|
57
|
-
const h = o, { message: r, size: l } = h, d =
|
|
58
|
-
(
|
|
57
|
+
const h = o, { message: r, size: l } = h, d = j(h, ["message", "size"]), g = t.some(
|
|
58
|
+
(f) => o.name.toLowerCase().includes(f)
|
|
59
59
|
) ? d : o;
|
|
60
60
|
e(g);
|
|
61
61
|
}, () => {
|
|
62
|
-
window._highlightWebSocketRequestCallback =
|
|
62
|
+
window._highlightWebSocketRequestCallback = i, window._highlightWebSocketEventCallback = n;
|
|
63
63
|
};
|
|
64
|
-
},
|
|
65
|
-
xhrCallback:
|
|
64
|
+
}, Jt = ({
|
|
65
|
+
xhrCallback: s,
|
|
66
66
|
fetchCallback: e,
|
|
67
67
|
webSocketRequestCallback: t,
|
|
68
|
-
webSocketEventCallback:
|
|
68
|
+
webSocketEventCallback: i,
|
|
69
69
|
disableWebSocketRecording: n,
|
|
70
70
|
bodyKeysToRedact: o,
|
|
71
71
|
highlightEndpoints: r,
|
|
@@ -73,28 +73,28 @@ const Kt = (i, e, t) => {
|
|
|
73
73
|
urlBlocklist: d,
|
|
74
74
|
bodyKeysToRecord: c
|
|
75
75
|
}) => {
|
|
76
|
-
const g =
|
|
77
|
-
|
|
76
|
+
const g = Lt(
|
|
77
|
+
s,
|
|
78
78
|
r,
|
|
79
79
|
l,
|
|
80
80
|
d,
|
|
81
81
|
o,
|
|
82
82
|
c
|
|
83
|
-
), h =
|
|
83
|
+
), h = Et(
|
|
84
84
|
e,
|
|
85
85
|
r,
|
|
86
86
|
l,
|
|
87
87
|
d,
|
|
88
88
|
o,
|
|
89
89
|
c
|
|
90
|
-
),
|
|
91
|
-
} :
|
|
90
|
+
), f = n ? () => {
|
|
91
|
+
} : jt(
|
|
92
92
|
t,
|
|
93
|
-
|
|
93
|
+
i,
|
|
94
94
|
d
|
|
95
95
|
);
|
|
96
96
|
return () => {
|
|
97
|
-
g(), h(),
|
|
97
|
+
g(), h(), f();
|
|
98
98
|
};
|
|
99
99
|
};
|
|
100
100
|
class I {
|
|
@@ -125,9 +125,9 @@ class I {
|
|
|
125
125
|
a(this, "urlBlocklist");
|
|
126
126
|
a(this, "highlightEndpoints");
|
|
127
127
|
a(this, "requestResponseSanitizer");
|
|
128
|
-
var t,
|
|
129
|
-
this.options = e, this.disableConsoleRecording = !!e.disableConsoleRecording, this.reportConsoleErrors = (t = e.reportConsoleErrors) != null ? t : !1, this.enablePromisePatch = (
|
|
130
|
-
...
|
|
128
|
+
var t, i;
|
|
129
|
+
this.options = e, this.disableConsoleRecording = !!e.disableConsoleRecording, this.reportConsoleErrors = (t = e.reportConsoleErrors) != null ? t : !1, this.enablePromisePatch = (i = e.enablePromisePatch) != null ? i : !1, this.consoleMethodsToRecord = e.consoleMethodsToRecord || [
|
|
130
|
+
...Nt
|
|
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
|
+
Tt(
|
|
141
141
|
(t) => {
|
|
142
|
-
var
|
|
142
|
+
var i, 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) || Te.some(
|
|
146
146
|
(l) => r.includes(l)
|
|
147
147
|
))
|
|
148
148
|
return;
|
|
@@ -150,30 +150,31 @@ class I {
|
|
|
150
150
|
event: r,
|
|
151
151
|
type: "console.error",
|
|
152
152
|
url: window.location.href,
|
|
153
|
-
source: (
|
|
153
|
+
source: (i = t.trace[0]) != null && i.fileName ? t.trace[0].fileName : "",
|
|
154
154
|
lineNumber: (n = t.trace[0]) != null && n.lineNumber ? t.trace[0].lineNumber : 0,
|
|
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(
|
|
164
|
-
level: this.consoleMethodsToRecord
|
|
163
|
+
y(p({}, 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
|
-
(
|
|
171
|
+
Ne.includes(t.event) || Te.some(
|
|
172
|
+
(i) => t.event.includes(i)
|
|
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,10 +182,10 @@ 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,
|
|
185
|
-
const
|
|
185
|
+
var o, r, l, d, c, g, h, f, m, _, k, C;
|
|
186
|
+
const i = (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
|
+
i,
|
|
188
189
|
`${n}/v1/traces`,
|
|
189
190
|
`${n}/v1/logs`,
|
|
190
191
|
`${n}/v1/metrics`
|
|
@@ -192,17 +193,17 @@ class I {
|
|
|
192
193
|
(S) => S.toLowerCase()
|
|
193
194
|
)) || [], e.networkBodyKeysToRedact = ((h = (g = t.networkRecording) == null ? void 0 : g.networkBodyKeysToRedact) == null ? void 0 : h.map(
|
|
194
195
|
(S) => S.toLowerCase()
|
|
195
|
-
)) || [], e.urlBlocklist = ((
|
|
196
|
+
)) || [], e.urlBlocklist = ((m = (f = t.networkRecording) == null ? void 0 : f.urlBlocklist) == null ? void 0 : m.map(
|
|
196
197
|
(S) => S.toLowerCase()
|
|
197
198
|
)) || [], e.urlBlocklist = [
|
|
198
199
|
...e.urlBlocklist,
|
|
199
|
-
...
|
|
200
|
-
], e.requestResponseSanitizer = (
|
|
200
|
+
...Pt
|
|
201
|
+
], e.requestResponseSanitizer = (_ = t.networkRecording) == null ? void 0 : _.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
203
|
)), e.networkBodyKeysToRecord = (C = t.networkRecording) == null ? void 0 : C.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
|
},
|
|
@@ -226,40 +227,40 @@ class I {
|
|
|
226
227
|
}
|
|
227
228
|
static getRecordedNetworkResources(e, t) {
|
|
228
229
|
var o, r;
|
|
229
|
-
let
|
|
230
|
+
let i = [], n = [];
|
|
230
231
|
if (!e.disableNetworkRecording) {
|
|
231
232
|
const l = ((o = window == null ? void 0 : window.performance) == null ? void 0 : o.timeOrigin) || 0;
|
|
232
|
-
|
|
233
|
+
i = performance.getEntriesByType(
|
|
233
234
|
"resource"
|
|
234
235
|
);
|
|
235
236
|
const d = (t - l) * 2;
|
|
236
|
-
if (
|
|
237
|
+
if (i = i.filter((c) => c.responseEnd < e.lastNetworkRequestTimestamp ? !1 : Ht(
|
|
237
238
|
c.name,
|
|
238
239
|
e.highlightEndpoints
|
|
239
|
-
)).map((c) => y(
|
|
240
|
+
)).map((c) => y(p({}, c.toJSON()), {
|
|
240
241
|
offsetStartTime: c.startTime - d,
|
|
241
242
|
offsetResponseEnd: c.responseEnd - d,
|
|
242
243
|
offsetFetchStart: c.fetchStart - d
|
|
243
|
-
})), e.lastNetworkRequestTimestamp = ((r =
|
|
244
|
+
})), e.lastNetworkRequestTimestamp = ((r = i.at(-1)) == null ? void 0 : r.responseEnd) || e.lastNetworkRequestTimestamp, e.enableRecordingNetworkContents) {
|
|
244
245
|
const c = {
|
|
245
246
|
headersToRedact: e.networkHeadersToRedact,
|
|
246
247
|
headersToRecord: e.networkHeaderKeysToRecord,
|
|
247
248
|
requestResponseSanitizer: e.requestResponseSanitizer
|
|
248
249
|
};
|
|
249
|
-
|
|
250
|
-
|
|
250
|
+
i = Ee(
|
|
251
|
+
i,
|
|
251
252
|
e.xhrNetworkContents,
|
|
252
253
|
"xmlhttprequest",
|
|
253
254
|
c
|
|
254
|
-
),
|
|
255
|
-
|
|
255
|
+
), i = Ee(
|
|
256
|
+
i,
|
|
256
257
|
e.fetchNetworkContents,
|
|
257
258
|
"fetch",
|
|
258
259
|
c
|
|
259
260
|
);
|
|
260
261
|
}
|
|
261
262
|
}
|
|
262
|
-
return e.disableRecordingWebSocketContents || (n = e.webSocketNetworkContents || []), [...
|
|
263
|
+
return e.disableRecordingWebSocketContents || (n = e.webSocketNetworkContents || []), [...i, ...n];
|
|
263
264
|
}
|
|
264
265
|
static getRecordedWebSocketEvents(e) {
|
|
265
266
|
let t = [];
|
|
@@ -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 = (s, e) => {
|
|
274
|
+
O("warn", `Highlight Warning: (${s}): `, { 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 =
|
|
334
|
+
e.sessionSecureID || (e.sessionSecureID = T()), 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 qt(this.debugOptions.clientInteractions), e.debug && Gt(!0), e.storageMode && (this.logger.log(
|
|
334
335
|
`initializing in ${e.storageMode} session mode`
|
|
335
|
-
),
|
|
336
|
-
var g, h,
|
|
336
|
+
), yt(e.storageMode)), ze(!!(e != null && e.sessionCookie)), (e == null ? void 0 : e.sessionCookieDomain) !== void 0 && pt(e.sessionCookieDomain), this._worker = new Qe(), this._worker.onmessage = (c) => {
|
|
337
|
+
var g, h, f;
|
|
337
338
|
((g = c.data.response) == null ? void 0 : g.type) === L.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
341
|
)) : ((h = c.data.response) == null ? void 0 : h.type) === L.CustomEvent ? this.addCustomEvent(
|
|
341
342
|
c.data.response.tag,
|
|
342
343
|
c.data.response.payload
|
|
343
|
-
) : ((
|
|
344
|
+
) : ((f = c.data.response) == null ? void 0 : f.type) === L.Stop && (z(
|
|
344
345
|
"Stopping recording due to worker failure",
|
|
345
346
|
c.data.response
|
|
346
347
|
), this.stopRecording(!1));
|
|
347
348
|
};
|
|
348
|
-
let
|
|
349
|
-
if (this.reloaded = !1, !((l = this.sessionData) != null && l.sessionSecureID) && (
|
|
350
|
-
this.sessionData =
|
|
349
|
+
let i = F();
|
|
350
|
+
if (this.reloaded = !1, !((l = this.sessionData) != null && l.sessionSecureID) && (i != null && i.sessionSecureID))
|
|
351
|
+
this.sessionData = i, this.options.sessionSecureID = i.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,11 +369,11 @@ 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
|
-
_reset(
|
|
375
|
-
return
|
|
375
|
+
_reset(i) {
|
|
376
|
+
return R(this, arguments, function* ({
|
|
376
377
|
forceNew: e,
|
|
377
378
|
sessionKey: t
|
|
378
379
|
}) {
|
|
@@ -380,41 +381,41 @@ 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
|
-
this.sessionData.sessionSecureID = t ?
|
|
392
|
+
De(r);
|
|
393
|
+
this.sessionData.sessionSecureID = t ? T(`${this.organizationID}-${t}`) : T(), 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,
|
|
397
|
-
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 =
|
|
397
|
+
var o, r, l, d, c, g, h, f, m, _, k;
|
|
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 = p({
|
|
398
399
|
canvasFactor: 0.5,
|
|
399
400
|
canvasMaxSnapshotDimension: 360,
|
|
400
401
|
canvasClearWebGLBuffer: !0,
|
|
401
|
-
dataUrlOptions:
|
|
402
|
-
}, (
|
|
402
|
+
dataUrlOptions: dt()
|
|
403
|
+
}, (f = e.samplingStrategy) != null ? f : {
|
|
403
404
|
canvas: 2
|
|
404
|
-
}), this._backendUrl = (
|
|
405
|
-
const t = new
|
|
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);
|
|
406
|
+
const t = new kt(`${this._backendUrl}`, {
|
|
406
407
|
headers: {}
|
|
407
408
|
});
|
|
408
|
-
|
|
409
|
+
ke(this, $, ht(t, bt())), this.environment = (_ = e.environment) != null ? _ : "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 C = e, { firstloadVersion:
|
|
411
|
+
const C = e, { firstloadVersion: i } = C, n = j(C, ["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()
|
|
414
415
|
}), this.addProperties({ event: "Intercom onShow" });
|
|
415
416
|
}), this._eventBytesSinceSnapshot = 0, this._lastSnapshotTime = (/* @__PURE__ */ new Date()).getTime(), this._lastVisibilityChangeTime = (/* @__PURE__ */ new Date()).getTime();
|
|
416
417
|
}
|
|
417
|
-
identify(e, t = {},
|
|
418
|
+
identify(e, t = {}, i) {
|
|
418
419
|
if (!e || e === "") {
|
|
419
420
|
console.warn(
|
|
420
421
|
"Highlight's identify() call was passed an empty identifier.",
|
|
@@ -422,15 +423,15 @@ 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
431
|
type: L.Identify,
|
|
431
432
|
userIdentifier: e,
|
|
432
433
|
userObject: t,
|
|
433
|
-
source:
|
|
434
|
+
source: i
|
|
434
435
|
}
|
|
435
436
|
});
|
|
436
437
|
for (const n of this._integrations)
|
|
@@ -438,22 +439,22 @@ const te = class te {
|
|
|
438
439
|
this.sessionData.sessionSecureID,
|
|
439
440
|
e,
|
|
440
441
|
t,
|
|
441
|
-
|
|
442
|
+
i
|
|
442
443
|
);
|
|
443
444
|
}
|
|
444
|
-
log(e, t,
|
|
445
|
+
log(e, t, i) {
|
|
445
446
|
this._firstLoadListeners.messages.push(
|
|
446
|
-
|
|
447
|
+
Ut(t, Me, e, i)
|
|
447
448
|
);
|
|
448
449
|
}
|
|
449
450
|
pushCustomError(e, t) {
|
|
450
451
|
return this.consumeCustomError(new Error(e), void 0, t);
|
|
451
452
|
}
|
|
452
|
-
consumeCustomError(e, t,
|
|
453
|
+
consumeCustomError(e, t, i) {
|
|
453
454
|
let n = {};
|
|
454
|
-
if (
|
|
455
|
+
if (i)
|
|
455
456
|
try {
|
|
456
|
-
n =
|
|
457
|
+
n = p(p({}, JSON.parse(i)), n);
|
|
457
458
|
} catch (o) {
|
|
458
459
|
}
|
|
459
460
|
return this.consumeError(e, {
|
|
@@ -463,55 +464,55 @@ const te = class te {
|
|
|
463
464
|
}
|
|
464
465
|
consumeError(e, {
|
|
465
466
|
message: t,
|
|
466
|
-
payload:
|
|
467
|
+
payload: i,
|
|
467
468
|
source: n,
|
|
468
469
|
type: o
|
|
469
470
|
}) {
|
|
470
|
-
var c, g, h,
|
|
471
|
-
e.cause && (
|
|
471
|
+
var c, g, h, f;
|
|
472
|
+
e.cause && (i = y(p({}, i), { "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 = Wt(e), d = {
|
|
475
476
|
event: r,
|
|
476
477
|
type: o != null ? o : "custom",
|
|
477
478
|
url: window.location.href,
|
|
478
479
|
source: n != null ? n : "",
|
|
479
480
|
lineNumber: (c = l[0]) != null && c.lineNumber ? (g = l[0]) == null ? void 0 : g.lineNumber : 0,
|
|
480
|
-
columnNumber: (h = l[0]) != null && h.columnNumber ? (
|
|
481
|
+
columnNumber: (h = l[0]) != null && h.columnNumber ? (f = l[0]) == null ? void 0 : f.columnNumber : 0,
|
|
481
482
|
stackTrace: l,
|
|
482
483
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
483
|
-
payload: JSON.stringify(
|
|
484
|
-
id:
|
|
484
|
+
payload: JSON.stringify(i),
|
|
485
|
+
id: Fe()
|
|
485
486
|
};
|
|
486
487
|
this._firstLoadListeners.errors.push(d);
|
|
487
|
-
for (const
|
|
488
|
-
|
|
488
|
+
for (const m of this._integrations)
|
|
489
|
+
m.error(this.sessionData.sessionSecureID, d);
|
|
489
490
|
}
|
|
490
491
|
addProperties(e = {}, t) {
|
|
491
|
-
const
|
|
492
|
-
Object.entries(
|
|
492
|
+
const i = p({}, e);
|
|
493
|
+
Object.entries(i).forEach(([n, o]) => {
|
|
493
494
|
try {
|
|
494
495
|
structuredClone(o);
|
|
495
496
|
} catch (r) {
|
|
496
|
-
delete
|
|
497
|
+
delete i[n];
|
|
497
498
|
}
|
|
498
499
|
}), this._worker.postMessage({
|
|
499
500
|
message: {
|
|
500
501
|
type: L.Properties,
|
|
501
|
-
propertiesObject:
|
|
502
|
+
propertiesObject: i,
|
|
502
503
|
propertyType: t
|
|
503
504
|
}
|
|
504
505
|
});
|
|
505
506
|
for (const n of this._integrations)
|
|
506
|
-
n.track(this.sessionData.sessionSecureID,
|
|
507
|
+
n.track(this.sessionData.sessionSecureID, p({
|
|
507
508
|
sessionSecureID: this.sessionData.sessionSecureID,
|
|
508
509
|
propertyType: t
|
|
509
510
|
}, e));
|
|
510
511
|
}
|
|
511
512
|
initialize(e) {
|
|
512
|
-
return
|
|
513
|
-
var t,
|
|
514
|
-
if (navigator != null && navigator.webdriver && !window.Cypress || (t = navigator == null ? void 0 : navigator.userAgent) != null && t.includes("Googlebot") || (
|
|
513
|
+
return R(this, null, function* () {
|
|
514
|
+
var t, i, n, o, r, l, d, c, g, h, f, m, _, k, C, S, ie, ne, re, oe, ae, ce, le, de, he;
|
|
515
|
+
if (navigator != null && navigator.webdriver && !window.Cypress || (t = navigator == null ? void 0 : navigator.userAgent) != null && t.includes("Googlebot") || (i = navigator == null ? void 0 : navigator.userAgent) != null && i.includes("AdsBot")) {
|
|
515
516
|
(n = this._firstLoadListeners) == null || n.stopListening();
|
|
516
517
|
return;
|
|
517
518
|
}
|
|
@@ -521,63 +522,64 @@ const te = class te {
|
|
|
521
522
|
return;
|
|
522
523
|
}
|
|
523
524
|
if (e != null && e.sessionKey && (e == null ? void 0 : e.sessionKey) !== this.sessionData.sessionKey) {
|
|
524
|
-
yield this._reset(y(
|
|
525
|
+
yield this._reset(y(p({}, e), { forceNew: !0 }));
|
|
525
526
|
return;
|
|
526
527
|
}
|
|
527
|
-
const
|
|
528
|
-
|
|
528
|
+
const P = new Bt();
|
|
529
|
+
zt(
|
|
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",
|
|
532
533
|
projectId: (c = this.options) == null ? void 0 : c.organizationID,
|
|
533
534
|
sessionSecureId: (g = this.options) == null ? void 0 : g.sessionSecureID,
|
|
534
|
-
environment: (
|
|
535
|
-
networkRecordingOptions: typeof ((
|
|
536
|
-
tracingOrigins: (
|
|
537
|
-
serviceName: (C = (
|
|
538
|
-
instrumentations: (
|
|
535
|
+
environment: (f = (h = this.options) == null ? void 0 : h.environment) != null ? f : "production",
|
|
536
|
+
networkRecordingOptions: typeof ((m = this.options) == null ? void 0 : m.networkRecording) == "object" ? this.options.networkRecording : void 0,
|
|
537
|
+
tracingOrigins: (_ = this.options) == null ? void 0 : _.tracingOrigins,
|
|
538
|
+
serviceName: (C = (k = this.options) == null ? void 0 : k.serviceName) != null ? C : "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(Le.CLIENT_ID);
|
|
551
|
+
H || (H = T(), Y(Le.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
|
+
O(
|
|
582
|
+
"error",
|
|
581
583
|
"Failed to initialize Highlight; an error occurred on our end.",
|
|
582
584
|
this.sessionData
|
|
583
585
|
);
|
|
@@ -598,8 +600,8 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
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,43 +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 } = xt();
|
|
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 [
|
|
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(
|
|
643
645
|
this.privacySetting,
|
|
644
646
|
this.options.maskPiiText
|
|
645
647
|
),
|
|
646
|
-
maskAllInputs:
|
|
647
|
-
maskInputOptions:
|
|
648
|
+
maskAllInputs: Ae,
|
|
649
|
+
maskInputOptions: Ke,
|
|
648
650
|
maskTextClass: this.options.maskTextClass,
|
|
649
651
|
maskTextSelector: this.options.maskTextSelector,
|
|
650
652
|
recordCanvas: this.enableCanvasRecording,
|
|
@@ -659,18 +661,18 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
659
661
|
maxSnapshotDimension: this.samplingStrategy.canvasMaxSnapshotDimension
|
|
660
662
|
}
|
|
661
663
|
},
|
|
662
|
-
keepIframeSrcFn: (
|
|
664
|
+
keepIframeSrcFn: (v) => !this.options.recordCrossOriginIframe,
|
|
663
665
|
inlineImages: this.inlineImages,
|
|
664
666
|
inlineVideos: this.inlineVideos,
|
|
665
667
|
collectFonts: this.inlineImages,
|
|
666
668
|
inlineStylesheet: this.inlineStylesheet,
|
|
667
669
|
styleSheetResyncInterval: this.styleSheetResyncInterval,
|
|
668
|
-
plugins: [
|
|
670
|
+
plugins: [rt()],
|
|
669
671
|
logger: typeof this.options.debug == "boolean" && this.options.debug || typeof this.options.debug == "object" && this.options.debug.domRecording ? {
|
|
670
672
|
debug: this.logger.log,
|
|
671
|
-
warn:
|
|
673
|
+
warn: z
|
|
672
674
|
} : void 0
|
|
673
|
-
}),
|
|
675
|
+
}), xe || this.options.recordCrossOriginIframe && this._setupCrossOriginIframeParent(), document.referrer && (window && document.referrer.includes(window.location.origin) || (this.addCustomEvent("Referrer", document.referrer), this.addProperties(
|
|
674
676
|
{ referrer: document.referrer },
|
|
675
677
|
{ type: "session" }
|
|
676
678
|
))), this.sessionData.sessionKey && this.addProperties(
|
|
@@ -679,14 +681,14 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
679
681
|
},
|
|
680
682
|
{ type: "session" }
|
|
681
683
|
), this._setupWindowListeners(), this.ready = !0, this.state = "Recording", this.manualStopped = !1;
|
|
682
|
-
} catch (
|
|
683
|
-
this._isOnLocalHost && (
|
|
684
|
+
} catch (P) {
|
|
685
|
+
this._isOnLocalHost && (O("error", P), z("initializeSession", P));
|
|
684
686
|
}
|
|
685
687
|
});
|
|
686
688
|
}
|
|
687
689
|
_productAnalyticsEvents() {
|
|
688
|
-
var
|
|
689
|
-
const e = (
|
|
690
|
+
var i;
|
|
691
|
+
const e = (i = this.options) == null ? void 0 : i.productAnalytics;
|
|
690
692
|
if (e === !1)
|
|
691
693
|
return {};
|
|
692
694
|
const t = {
|
|
@@ -701,23 +703,23 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
701
703
|
return t;
|
|
702
704
|
}
|
|
703
705
|
_visibilityHandler(e) {
|
|
704
|
-
return
|
|
706
|
+
return R(this, null, function* () {
|
|
705
707
|
if (this.manualStopped) {
|
|
706
708
|
this.logger.log("Ignoring visibility event due to manual stop.");
|
|
707
709
|
return;
|
|
708
710
|
}
|
|
709
|
-
(/* @__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)));
|
|
710
712
|
});
|
|
711
713
|
}
|
|
712
714
|
_setupCrossOriginIframe() {
|
|
713
|
-
return
|
|
715
|
+
return R(this, null, function* () {
|
|
714
716
|
this.logger.log("highlight in cross-origin iframe is waiting "), yield new Promise((e) => {
|
|
715
|
-
const t = (
|
|
716
|
-
if (
|
|
717
|
-
const n =
|
|
717
|
+
const t = (i) => {
|
|
718
|
+
if (i.data.highlight === ve) {
|
|
719
|
+
const n = i.data;
|
|
718
720
|
this.logger.log("highlight got window message ", n), this.sessionData.projectID = n.projectID, this.sessionData.sessionSecureID = n.sessionSecureID, window.parent.postMessage(
|
|
719
721
|
{
|
|
720
|
-
highlight:
|
|
722
|
+
highlight: Re
|
|
721
723
|
},
|
|
722
724
|
"*"
|
|
723
725
|
), window.removeEventListener("message", t), e();
|
|
@@ -742,18 +744,18 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
742
744
|
"*"
|
|
743
745
|
);
|
|
744
746
|
});
|
|
745
|
-
},
|
|
746
|
-
e.data.highlight ===
|
|
747
|
+
}, Ie), window.addEventListener("message", (e) => {
|
|
748
|
+
e.data.highlight === Re && this.logger.log(
|
|
747
749
|
"highlight got response from initialized iframe"
|
|
748
750
|
);
|
|
749
751
|
});
|
|
750
752
|
}
|
|
751
753
|
_setupWindowListeners() {
|
|
752
|
-
var
|
|
754
|
+
var i;
|
|
753
755
|
try {
|
|
754
756
|
const n = this;
|
|
755
757
|
this.enableSegmentIntegration && this.listeners.push(
|
|
756
|
-
|
|
758
|
+
Ye((r) => {
|
|
757
759
|
if (r.type === "track") {
|
|
758
760
|
const l = {};
|
|
759
761
|
l["segment-event"] = r.event, n.addProperties(l, {
|
|
@@ -773,24 +775,24 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
773
775
|
}
|
|
774
776
|
})
|
|
775
777
|
), this.listeners.push(
|
|
776
|
-
|
|
778
|
+
ut((r) => {
|
|
777
779
|
this.reloaded ? (this.addCustomEvent("Reload", r), this.reloaded = !1, n.addProperties(
|
|
778
780
|
{ reload: !0 },
|
|
779
781
|
{ type: "session" }
|
|
780
782
|
)) : this.addCustomEvent("Navigate", r);
|
|
781
783
|
})
|
|
782
784
|
), this.listeners.push(
|
|
783
|
-
|
|
785
|
+
ft(
|
|
784
786
|
(r) => {
|
|
785
787
|
this.addCustomEvent("Viewport", r), this.submitViewportMetrics(r);
|
|
786
788
|
}
|
|
787
789
|
)
|
|
788
790
|
), this.listeners.push(
|
|
789
|
-
|
|
791
|
+
Xe((r, l) => {
|
|
790
792
|
let d = null, c = null;
|
|
791
793
|
if (l && l.target) {
|
|
792
794
|
const g = l.target;
|
|
793
|
-
d =
|
|
795
|
+
d = vt(g), c = g.textContent, c && c.length > 2e3 && (c = c.substring(0, 2e3));
|
|
794
796
|
}
|
|
795
797
|
this.addCustomEvent("Click", {
|
|
796
798
|
clickTarget: r,
|
|
@@ -799,20 +801,20 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
799
801
|
});
|
|
800
802
|
})
|
|
801
803
|
), this.listeners.push(
|
|
802
|
-
|
|
804
|
+
Ze((r) => {
|
|
803
805
|
r && this.addCustomEvent("Focus", r);
|
|
804
806
|
})
|
|
805
807
|
), this.listeners.push(
|
|
806
|
-
|
|
807
|
-
const { name: l, value: d } = r, c = [], g = (h,
|
|
808
|
-
|
|
808
|
+
Mt((r) => {
|
|
809
|
+
const { name: l, value: d } = r, c = [], g = (h, f) => {
|
|
810
|
+
f && c.push({ name: h, value: f });
|
|
809
811
|
};
|
|
810
812
|
switch (r.name) {
|
|
811
813
|
case "LCP": {
|
|
812
814
|
const h = r.attribution;
|
|
813
815
|
g("web_vital.element", h.element), g(
|
|
814
816
|
"web_vital.attribution.url",
|
|
815
|
-
h.url ?
|
|
817
|
+
h.url ? At(h.url) : void 0
|
|
816
818
|
);
|
|
817
819
|
break;
|
|
818
820
|
}
|
|
@@ -846,7 +848,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
846
848
|
});
|
|
847
849
|
})
|
|
848
850
|
), this.listeners.push(
|
|
849
|
-
|
|
851
|
+
Ft(
|
|
850
852
|
(r) => {
|
|
851
853
|
const l = [];
|
|
852
854
|
r.saveData !== void 0 && l.push({
|
|
@@ -859,7 +861,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
859
861
|
name: "type",
|
|
860
862
|
value: r.type.toString()
|
|
861
863
|
}), Object.entries(r).forEach(([d, c]) => {
|
|
862
|
-
|
|
864
|
+
Rt(c) && this.recordGauge({
|
|
863
865
|
name: d,
|
|
864
866
|
value: c,
|
|
865
867
|
category: D.Performance,
|
|
@@ -871,15 +873,15 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
871
873
|
this._recordingStartTime
|
|
872
874
|
)
|
|
873
875
|
), this.sessionShortcut && this.listeners.push(
|
|
874
|
-
|
|
876
|
+
et(this.sessionShortcut, () => {
|
|
875
877
|
window.open(
|
|
876
878
|
this.getCurrentSessionURLWithTimestamp(),
|
|
877
879
|
"_blank"
|
|
878
880
|
);
|
|
879
881
|
})
|
|
880
882
|
), this.enablePerformanceRecording && (this.listeners.push(
|
|
881
|
-
|
|
882
|
-
this.addCustomEvent("Performance",
|
|
883
|
+
$t((r) => {
|
|
884
|
+
this.addCustomEvent("Performance", K(r)), Object.entries(r).filter(([l]) => l !== "relativeTimestamp").forEach(
|
|
883
885
|
([l, d]) => d && this.recordGauge({
|
|
884
886
|
name: l,
|
|
885
887
|
value: d,
|
|
@@ -889,20 +891,20 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
889
891
|
);
|
|
890
892
|
}, this._recordingStartTime)
|
|
891
893
|
), this.listeners.push(
|
|
892
|
-
|
|
893
|
-
this.addCustomEvent("Jank",
|
|
894
|
+
Vt((r) => {
|
|
895
|
+
this.addCustomEvent("Jank", K(r)), this.recordGauge({
|
|
894
896
|
name: "Jank",
|
|
895
897
|
value: r.jankAmount,
|
|
896
898
|
category: D.WebVital,
|
|
897
899
|
group: r.querySelector
|
|
898
900
|
});
|
|
899
901
|
}, this._recordingStartTime)
|
|
900
|
-
)), this._hasPreviouslyInitialized || ((
|
|
902
|
+
)), this._hasPreviouslyInitialized || ((i = window.electron) != null && i.ipcRenderer ? (window.electron.ipcRenderer.on(
|
|
901
903
|
"highlight.run",
|
|
902
904
|
({ visible: r }) => {
|
|
903
905
|
this._visibilityHandler(!r);
|
|
904
906
|
}
|
|
905
|
-
), this.logger.log("Set up Electron highlight.run events.")) : (
|
|
907
|
+
), this.logger.log("Set up Electron highlight.run events.")) : (tt(
|
|
906
908
|
(r) => this._visibilityHandler(r)
|
|
907
909
|
), this.logger.log("Set up document visibility listener.")), this._hasPreviouslyInitialized = !0);
|
|
908
910
|
const o = () => {
|
|
@@ -912,16 +914,16 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
912
914
|
() => window.removeEventListener("beforeunload", o)
|
|
913
915
|
);
|
|
914
916
|
} catch (n) {
|
|
915
|
-
this._isOnLocalHost && (
|
|
917
|
+
this._isOnLocalHost && (O("error", n), z("initializeSession _setupWindowListeners", n));
|
|
916
918
|
}
|
|
917
919
|
const e = () => {
|
|
918
|
-
this.addCustomEvent("Page Unload", ""),
|
|
920
|
+
this.addCustomEvent("Page Unload", ""), X(this.sessionData.sessionSecureID), W(this.sessionData);
|
|
919
921
|
};
|
|
920
922
|
if (window.addEventListener("beforeunload", e), this.listeners.push(
|
|
921
923
|
() => window.removeEventListener("beforeunload", e)
|
|
922
924
|
), navigator.userAgent.match(/iPad/i) || navigator.userAgent.match(/iPhone/i)) {
|
|
923
925
|
const n = () => {
|
|
924
|
-
this.addCustomEvent("Page Unload", ""),
|
|
926
|
+
this.addCustomEvent("Page Unload", ""), X(this.sessionData.sessionSecureID), W(this.sessionData);
|
|
925
927
|
};
|
|
926
928
|
window.addEventListener("pagehide", n), this.listeners.push(
|
|
927
929
|
() => window.removeEventListener("pagehide", n)
|
|
@@ -931,7 +933,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
931
933
|
submitViewportMetrics({
|
|
932
934
|
height: e,
|
|
933
935
|
width: t,
|
|
934
|
-
availHeight:
|
|
936
|
+
availHeight: i,
|
|
935
937
|
availWidth: n
|
|
936
938
|
}) {
|
|
937
939
|
this.recordGauge({
|
|
@@ -946,7 +948,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
946
948
|
group: window.location.href
|
|
947
949
|
}), this.recordGauge({
|
|
948
950
|
name: N.ScreenHeight,
|
|
949
|
-
value:
|
|
951
|
+
value: i,
|
|
950
952
|
category: D.Device,
|
|
951
953
|
group: window.location.href
|
|
952
954
|
}), this.recordGauge({
|
|
@@ -962,16 +964,16 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
962
964
|
});
|
|
963
965
|
}
|
|
964
966
|
recordGauge(e) {
|
|
965
|
-
var
|
|
967
|
+
var i, n;
|
|
966
968
|
let t = this._gauges.get(e.name);
|
|
967
969
|
if (!t) {
|
|
968
|
-
if (t = (
|
|
970
|
+
if (t = (i = x()) == null ? void 0 : i.createGauge(
|
|
969
971
|
e.name,
|
|
970
|
-
|
|
972
|
+
A(e.name, e.unit)
|
|
971
973
|
), !t) return;
|
|
972
974
|
this._gauges.set(e.name, t);
|
|
973
975
|
}
|
|
974
|
-
t.record(e.value, y(
|
|
976
|
+
t.record(e.value, y(p({}, (n = e.tags) == null ? void 0 : n.reduce((o, r) => y(p({}, o), { [r.name]: r.value }), {})), {
|
|
975
977
|
group: e.group,
|
|
976
978
|
category: e.category,
|
|
977
979
|
"highlight.session_id": this.sessionData.sessionSecureID
|
|
@@ -980,51 +982,51 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
980
982
|
o.recordGauge(this.sessionData.sessionSecureID, e);
|
|
981
983
|
}
|
|
982
984
|
recordCount(e) {
|
|
983
|
-
var
|
|
985
|
+
var i, n;
|
|
984
986
|
let t = this._counters.get(e.name);
|
|
985
987
|
if (!t) {
|
|
986
|
-
if (t = (
|
|
988
|
+
if (t = (i = x()) == null ? void 0 : i.createCounter(
|
|
987
989
|
e.name,
|
|
988
|
-
|
|
990
|
+
A(e.name, e.unit)
|
|
989
991
|
), !t) return;
|
|
990
992
|
this._counters.set(e.name, t);
|
|
991
993
|
}
|
|
992
|
-
t.add(e.value, y(
|
|
994
|
+
t.add(e.value, y(p({}, (n = e.tags) == null ? void 0 : n.reduce((o, r) => y(p({}, o), { [r.name]: r.value }), {})), {
|
|
993
995
|
group: e.group,
|
|
994
996
|
category: e.category,
|
|
995
997
|
"highlight.session_id": this.sessionData.sessionSecureID
|
|
996
998
|
}));
|
|
997
999
|
}
|
|
998
1000
|
recordIncr(e) {
|
|
999
|
-
this.recordCount(y(
|
|
1001
|
+
this.recordCount(y(p({}, e), { value: 1 }));
|
|
1000
1002
|
}
|
|
1001
1003
|
recordHistogram(e) {
|
|
1002
|
-
var
|
|
1004
|
+
var i, n;
|
|
1003
1005
|
let t = this._histograms.get(e.name);
|
|
1004
1006
|
if (!t) {
|
|
1005
|
-
if (t = (
|
|
1007
|
+
if (t = (i = x()) == null ? void 0 : i.createHistogram(
|
|
1006
1008
|
e.name,
|
|
1007
|
-
|
|
1009
|
+
A(e.name, e.unit)
|
|
1008
1010
|
), !t) return;
|
|
1009
1011
|
this._histograms.set(e.name, t);
|
|
1010
1012
|
}
|
|
1011
|
-
t.record(e.value, y(
|
|
1013
|
+
t.record(e.value, y(p({}, (n = e.tags) == null ? void 0 : n.reduce((o, r) => y(p({}, o), { [r.name]: r.value }), {})), {
|
|
1012
1014
|
group: e.group,
|
|
1013
1015
|
category: e.category,
|
|
1014
1016
|
"highlight.session_id": this.sessionData.sessionSecureID
|
|
1015
1017
|
}));
|
|
1016
1018
|
}
|
|
1017
1019
|
recordUpDownCounter(e) {
|
|
1018
|
-
var
|
|
1020
|
+
var i, n;
|
|
1019
1021
|
let t = this._up_down_counters.get(e.name);
|
|
1020
1022
|
if (!t) {
|
|
1021
|
-
if (t = (
|
|
1023
|
+
if (t = (i = x()) == null ? void 0 : i.createUpDownCounter(
|
|
1022
1024
|
e.name,
|
|
1023
|
-
|
|
1025
|
+
A(e.name, e.unit)
|
|
1024
1026
|
), !t) return;
|
|
1025
1027
|
this._up_down_counters.set(e.name, t);
|
|
1026
1028
|
}
|
|
1027
|
-
t.add(e.value, y(
|
|
1029
|
+
t.add(e.value, y(p({}, (n = e.tags) == null ? void 0 : n.reduce((o, r) => y(p({}, o), { [r.name]: r.value }), {})), {
|
|
1028
1030
|
group: e.group,
|
|
1029
1031
|
category: e.category,
|
|
1030
1032
|
"highlight.session_id": this.sessionData.sessionSecureID
|
|
@@ -1038,7 +1040,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
1038
1040
|
this.manualStopped = !!e, this.manualStopped && this.addCustomEvent(
|
|
1039
1041
|
"Stop",
|
|
1040
1042
|
"H.stop() was called which stops Highlight from recording."
|
|
1041
|
-
), 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();
|
|
1042
1044
|
}
|
|
1043
1045
|
getCurrentSessionTimestamp() {
|
|
1044
1046
|
return this._recordingStartTime;
|
|
@@ -1047,50 +1049,36 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
1047
1049
|
* Returns the current timestamp for the current session.
|
|
1048
1050
|
*/
|
|
1049
1051
|
getCurrentSessionURLWithTimestamp() {
|
|
1050
|
-
const e = (/* @__PURE__ */ new Date()).getTime(), { projectID: t, sessionSecureID:
|
|
1051
|
-
return `https://${
|
|
1052
|
+
const e = (/* @__PURE__ */ new Date()).getTime(), { projectID: t, sessionSecureID: i } = this.sessionData, n = (e - this._recordingStartTime) / 1e3;
|
|
1053
|
+
return `https://${Z}/${t}/sessions/${i}?ts=${n}`;
|
|
1052
1054
|
}
|
|
1053
1055
|
getCurrentSessionURL() {
|
|
1054
1056
|
const e = this.sessionData.projectID, t = this.sessionData.sessionSecureID;
|
|
1055
|
-
return e && t ? `https://${
|
|
1057
|
+
return e && t ? `https://${Z}/${e}/sessions/${t}` : null;
|
|
1056
1058
|
}
|
|
1057
1059
|
snapshot(e) {
|
|
1058
|
-
return
|
|
1059
|
-
yield
|
|
1060
|
+
return R(this, null, function* () {
|
|
1061
|
+
yield J.snapshotCanvas(e);
|
|
1060
1062
|
});
|
|
1061
1063
|
}
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
verbatim: t,
|
|
1065
|
-
user_email: s,
|
|
1066
|
-
user_name: n
|
|
1067
|
-
}) {
|
|
1068
|
-
var o;
|
|
1069
|
-
this._worker.postMessage({
|
|
1070
|
-
message: {
|
|
1071
|
-
type: L.Feedback,
|
|
1072
|
-
verbatim: t,
|
|
1073
|
-
timestamp: e,
|
|
1074
|
-
userName: n || this.sessionData.userIdentifier,
|
|
1075
|
-
userEmail: s || ((o = this.sessionData.userObject) == null ? void 0 : o.name)
|
|
1076
|
-
}
|
|
1077
|
-
});
|
|
1064
|
+
/** @deprecated Session feedback is no longer supported. This is a no-op. */
|
|
1065
|
+
addSessionFeedback(e) {
|
|
1078
1066
|
}
|
|
1079
1067
|
// Reset the events array and push to a backend.
|
|
1080
1068
|
_save() {
|
|
1081
|
-
return
|
|
1069
|
+
return R(this, null, function* () {
|
|
1082
1070
|
var e;
|
|
1083
1071
|
try {
|
|
1084
1072
|
this.state === "Recording" && this.listeners && !this.sessionData.sessionKey && this.sessionData.sessionStartTime && Date.now() - this.sessionData.sessionStartTime > mt && (this.logger.log("Resetting session", {
|
|
1085
1073
|
start: this.sessionData.sessionStartTime
|
|
1086
1074
|
}), yield this._reset({}));
|
|
1087
1075
|
let t;
|
|
1088
|
-
((e = this.options) == null ? void 0 : e.sendMode) === "local" && (t = (
|
|
1076
|
+
((e = this.options) == null ? void 0 : e.sendMode) === "local" && (t = (i) => R(this, null, function* () {
|
|
1089
1077
|
let n = new Blob(
|
|
1090
1078
|
[
|
|
1091
1079
|
JSON.stringify({
|
|
1092
|
-
query:
|
|
1093
|
-
variables:
|
|
1080
|
+
query: St(_t),
|
|
1081
|
+
variables: i
|
|
1094
1082
|
})
|
|
1095
1083
|
],
|
|
1096
1084
|
{
|
|
@@ -1101,13 +1089,13 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
1101
1089
|
method: "POST",
|
|
1102
1090
|
body: n
|
|
1103
1091
|
}), 0;
|
|
1104
|
-
})), yield this._sendPayload({ sendFn: t }), this.hasPushedData = !0, this.sessionData.lastPushTime = Date.now(),
|
|
1092
|
+
})), yield this._sendPayload({ sendFn: t }), this.hasPushedData = !0, this.sessionData.lastPushTime = Date.now(), W(this.sessionData);
|
|
1105
1093
|
} catch (t) {
|
|
1106
|
-
this._isOnLocalHost && (
|
|
1094
|
+
this._isOnLocalHost && (O("error", t), z("_save", t));
|
|
1107
1095
|
}
|
|
1108
1096
|
this.state === "Recording" && (this.pushPayloadTimerId && (clearTimeout(this.pushPayloadTimerId), this.pushPayloadTimerId = void 0), this.pushPayloadTimerId = setTimeout(() => {
|
|
1109
1097
|
this._save();
|
|
1110
|
-
},
|
|
1098
|
+
}, wt));
|
|
1111
1099
|
});
|
|
1112
1100
|
}
|
|
1113
1101
|
/**
|
|
@@ -1116,47 +1104,47 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
1116
1104
|
*/
|
|
1117
1105
|
addCustomEvent(e, t) {
|
|
1118
1106
|
if (this.state === "NotRecording") {
|
|
1119
|
-
let
|
|
1107
|
+
let i;
|
|
1120
1108
|
const n = () => {
|
|
1121
|
-
clearInterval(
|
|
1109
|
+
clearInterval(i), this.state === "Recording" && this.events.length > 0 ? _e(e, t) : i = setTimeout(n, 500);
|
|
1122
1110
|
};
|
|
1123
|
-
|
|
1111
|
+
i = setTimeout(n, 500);
|
|
1124
1112
|
} else this.state === "Recording" && (this.events.length > 0 || this.hasPushedData) && _e(e, t);
|
|
1125
1113
|
}
|
|
1126
1114
|
_sendPayload(t) {
|
|
1127
|
-
return
|
|
1115
|
+
return R(this, arguments, function* ({
|
|
1128
1116
|
sendFn: e
|
|
1129
1117
|
}) {
|
|
1130
|
-
const
|
|
1118
|
+
const i = I.getRecordedNetworkResources(
|
|
1131
1119
|
this._firstLoadListeners,
|
|
1132
1120
|
this._recordingStartTime
|
|
1133
1121
|
), n = I.getRecordedWebSocketEvents(
|
|
1134
1122
|
this._firstLoadListeners
|
|
1135
|
-
), o = [...this.events], r = [...this._firstLoadListeners.messages], l = [...this._firstLoadListeners.errors], { bytes: d, time: c } = this.enableCanvasRecording ?
|
|
1123
|
+
), o = [...this.events], r = [...this._firstLoadListeners.messages], l = [...this._firstLoadListeners.errors], { bytes: d, time: c } = this.enableCanvasRecording ? Ce.canvas : Ce.normal;
|
|
1136
1124
|
this._eventBytesSinceSnapshot >= d && (/* @__PURE__ */ new Date()).getTime() - this._lastSnapshotTime >= c && this.takeFullSnapshot(), this.logger.log(
|
|
1137
|
-
`Sending: ${o.length} events, ${r.length} messages, ${
|
|
1125
|
+
`Sending: ${o.length} events, ${r.length} messages, ${i.length} network resources, ${l.length} errors
|
|
1138
1126
|
To: ${this._backendUrl}
|
|
1139
1127
|
Org: ${this.organizationID}
|
|
1140
1128
|
SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
1141
1129
|
);
|
|
1142
|
-
const g = (/* @__PURE__ */ new Date()).getTime(), h =
|
|
1130
|
+
const g = (/* @__PURE__ */ new Date()).getTime(), h = st();
|
|
1143
1131
|
if (e) {
|
|
1144
|
-
const
|
|
1132
|
+
const f = {
|
|
1145
1133
|
session_secure_id: this.sessionData.sessionSecureID,
|
|
1146
1134
|
payload_id: g.toString(),
|
|
1147
1135
|
events: { events: o },
|
|
1148
|
-
messages:
|
|
1149
|
-
resources: JSON.stringify({ resources:
|
|
1136
|
+
messages: K({ messages: r }),
|
|
1137
|
+
resources: JSON.stringify({ resources: i }),
|
|
1150
1138
|
web_socket_events: JSON.stringify({ webSocketEvents: n }),
|
|
1151
1139
|
errors: l,
|
|
1152
1140
|
is_beacon: !1,
|
|
1153
1141
|
has_session_unloaded: this.hasSessionUnloaded,
|
|
1154
1142
|
highlight_logs: h || void 0
|
|
1155
|
-
}, { compressedBase64:
|
|
1143
|
+
}, { compressedBase64: m } = yield it(f);
|
|
1156
1144
|
yield e({
|
|
1157
1145
|
session_secure_id: this.sessionData.sessionSecureID,
|
|
1158
1146
|
payload_id: (/* @__PURE__ */ new Date()).getTime().toString(),
|
|
1159
|
-
data:
|
|
1147
|
+
data: m
|
|
1160
1148
|
});
|
|
1161
1149
|
} else
|
|
1162
1150
|
this._worker.postMessage({
|
|
@@ -1166,7 +1154,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
1166
1154
|
events: o,
|
|
1167
1155
|
messages: r,
|
|
1168
1156
|
errors: l,
|
|
1169
|
-
resourcesString: JSON.stringify({ resources:
|
|
1157
|
+
resourcesString: JSON.stringify({ resources: i }),
|
|
1170
1158
|
webSocketEventsString: JSON.stringify({
|
|
1171
1159
|
webSocketEvents: n
|
|
1172
1160
|
}),
|
|
@@ -1174,11 +1162,11 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
1174
1162
|
highlightLogs: h
|
|
1175
1163
|
}
|
|
1176
1164
|
});
|
|
1177
|
-
|
|
1165
|
+
W(this.sessionData), I.clearRecordedNetworkResources(
|
|
1178
1166
|
this._firstLoadListeners
|
|
1179
1167
|
), this.events = this.events.slice(o.length), this._firstLoadListeners.messages = this._firstLoadListeners.messages.slice(r.length), this._firstLoadListeners.errors = this._firstLoadListeners.errors.slice(
|
|
1180
1168
|
l.length
|
|
1181
|
-
),
|
|
1169
|
+
), nt(h);
|
|
1182
1170
|
});
|
|
1183
1171
|
}
|
|
1184
1172
|
takeFullSnapshot() {
|
|
@@ -1189,32 +1177,32 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
1189
1177
|
this.logger.log("taking full snapshot", {
|
|
1190
1178
|
bytesSinceSnapshot: this._eventBytesSinceSnapshot,
|
|
1191
1179
|
lastSnapshotTime: this._lastSnapshotTime
|
|
1192
|
-
}),
|
|
1180
|
+
}), J.takeFullSnapshot(), this._eventBytesSinceSnapshot = 0, this._lastSnapshotTime = (/* @__PURE__ */ new Date()).getTime();
|
|
1193
1181
|
}
|
|
1194
1182
|
registerLD(e) {
|
|
1195
|
-
this._integrations.length || this._integrations.push(new
|
|
1183
|
+
this._integrations.length || this._integrations.push(new We(e));
|
|
1196
1184
|
}
|
|
1197
1185
|
};
|
|
1198
|
-
|
|
1199
|
-
let
|
|
1200
|
-
const
|
|
1201
|
-
var
|
|
1202
|
-
typeof chrome != "undefined" && ((
|
|
1203
|
-
(t,
|
|
1186
|
+
$ = new WeakMap();
|
|
1187
|
+
let ee = se;
|
|
1188
|
+
const Qt = () => {
|
|
1189
|
+
var s, e;
|
|
1190
|
+
typeof chrome != "undefined" && ((s = chrome == null ? void 0 : chrome.runtime) != null && s.onMessage) && ((e = chrome == null ? void 0 : chrome.runtime) == null || e.onMessage.addListener(
|
|
1191
|
+
(t, i, n) => {
|
|
1204
1192
|
const o = t.action;
|
|
1205
1193
|
switch (console.log(
|
|
1206
1194
|
`[highlight] received '${o}' event from extension.`
|
|
1207
1195
|
), o) {
|
|
1208
1196
|
case "init": {
|
|
1209
|
-
|
|
1197
|
+
w.init(1, {
|
|
1210
1198
|
debug: !0
|
|
1211
|
-
}),
|
|
1199
|
+
}), w.getSessionURL().then((r) => {
|
|
1212
1200
|
n({ url: r });
|
|
1213
1201
|
});
|
|
1214
1202
|
break;
|
|
1215
1203
|
}
|
|
1216
1204
|
case "stop": {
|
|
1217
|
-
|
|
1205
|
+
w.stop(), n({ success: !0 });
|
|
1218
1206
|
break;
|
|
1219
1207
|
}
|
|
1220
1208
|
}
|
|
@@ -1222,49 +1210,49 @@ const Gt = () => {
|
|
|
1222
1210
|
}
|
|
1223
1211
|
));
|
|
1224
1212
|
};
|
|
1225
|
-
function
|
|
1213
|
+
function rs(s) {
|
|
1226
1214
|
var e;
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
}),
|
|
1230
|
-
|
|
1231
|
-
}),
|
|
1232
|
-
|
|
1215
|
+
s.on && ((e = s.webContents) != null && e.send) && (s.on("focus", () => {
|
|
1216
|
+
s.webContents.send("highlight.run", { visible: !0 });
|
|
1217
|
+
}), s.on("blur", () => {
|
|
1218
|
+
s.webContents.send("highlight.run", { visible: !1 });
|
|
1219
|
+
}), s.on("close", () => {
|
|
1220
|
+
s.webContents.send("highlight.run", { visible: !1 });
|
|
1233
1221
|
}));
|
|
1234
1222
|
}
|
|
1235
|
-
const
|
|
1236
|
-
next:
|
|
1223
|
+
const os = ({
|
|
1224
|
+
next: s,
|
|
1237
1225
|
payload: e
|
|
1238
1226
|
}) => {
|
|
1239
1227
|
if (typeof window != "undefined" && typeof document != "undefined" && "H" in window) {
|
|
1240
1228
|
if (e.obj.type === "track") {
|
|
1241
|
-
const t = e.obj.event,
|
|
1242
|
-
window.H.track(t,
|
|
1229
|
+
const t = e.obj.event, i = e.obj.properties;
|
|
1230
|
+
window.H.track(t, i);
|
|
1243
1231
|
} else if (e.obj.type === "identify") {
|
|
1244
1232
|
const t = e.obj.userId;
|
|
1245
1233
|
if (t != null && t.length) {
|
|
1246
|
-
const
|
|
1247
|
-
window.H.identify(t,
|
|
1234
|
+
const i = e.obj.traits;
|
|
1235
|
+
window.H.identify(t, i);
|
|
1248
1236
|
}
|
|
1249
1237
|
}
|
|
1250
1238
|
}
|
|
1251
|
-
|
|
1252
|
-
},
|
|
1239
|
+
s(e);
|
|
1240
|
+
}, $e = () => {
|
|
1253
1241
|
if (typeof window != "undefined") {
|
|
1254
1242
|
if (typeof window._highlightFetchPatch != "undefined")
|
|
1255
1243
|
return;
|
|
1256
|
-
window._originalFetch = window.fetch, window._fetchProxy = (
|
|
1244
|
+
window._originalFetch = window.fetch, window._fetchProxy = (s, e) => window._originalFetch(s, e), window._highlightFetchPatch = (s, e) => window._fetchProxy.call(window || global, s, e), window.fetch = window._highlightFetchPatch;
|
|
1257
1245
|
}
|
|
1258
|
-
},
|
|
1246
|
+
}, He = () => null, Ve = () => {
|
|
1259
1247
|
if (typeof window != "undefined") {
|
|
1260
1248
|
if (typeof window._highlightWebSocketRequestCallback != "undefined")
|
|
1261
1249
|
return;
|
|
1262
|
-
window._highlightWebSocketRequestCallback =
|
|
1263
|
-
const
|
|
1250
|
+
window._highlightWebSocketRequestCallback = He, window._highlightWebSocketEventCallback = He;
|
|
1251
|
+
const s = new Proxy(window.WebSocket, {
|
|
1264
1252
|
construct(e, t) {
|
|
1265
|
-
const [,
|
|
1253
|
+
const [, i] = Kt(), n = new e(...t), o = (g) => {
|
|
1266
1254
|
window._highlightWebSocketRequestCallback({
|
|
1267
|
-
socketId:
|
|
1255
|
+
socketId: i,
|
|
1268
1256
|
initiatorType: "websocket",
|
|
1269
1257
|
type: "open",
|
|
1270
1258
|
name: n.url,
|
|
@@ -1272,26 +1260,26 @@ const is = ({
|
|
|
1272
1260
|
});
|
|
1273
1261
|
}, r = (g) => {
|
|
1274
1262
|
window._highlightWebSocketRequestCallback({
|
|
1275
|
-
socketId:
|
|
1263
|
+
socketId: i,
|
|
1276
1264
|
initiatorType: "websocket",
|
|
1277
1265
|
type: "close",
|
|
1278
1266
|
name: n.url,
|
|
1279
1267
|
responseEndAbs: performance.timeOrigin + g.timeStamp
|
|
1280
1268
|
}), n.removeEventListener("open", o), n.removeEventListener("error", d), n.removeEventListener("message", l), n.removeEventListener("close", r);
|
|
1281
1269
|
}, l = (g) => {
|
|
1282
|
-
const { data: h } = g,
|
|
1283
|
-
let
|
|
1284
|
-
typeof h == "string" ?
|
|
1285
|
-
socketId:
|
|
1270
|
+
const { data: h } = g, f = typeof h == "string" ? g.data : void 0;
|
|
1271
|
+
let m;
|
|
1272
|
+
typeof h == "string" ? m = h.length : h instanceof Blob ? m = h.size : m = h.byteLength || 0, window._highlightWebSocketEventCallback({
|
|
1273
|
+
socketId: i,
|
|
1286
1274
|
type: "received",
|
|
1287
1275
|
name: n.url,
|
|
1288
1276
|
timeStamp: performance.timeOrigin + g.timeStamp,
|
|
1289
|
-
size:
|
|
1290
|
-
message:
|
|
1277
|
+
size: m,
|
|
1278
|
+
message: f
|
|
1291
1279
|
});
|
|
1292
1280
|
}, d = (g) => {
|
|
1293
1281
|
window._highlightWebSocketEventCallback({
|
|
1294
|
-
socketId:
|
|
1282
|
+
socketId: i,
|
|
1295
1283
|
type: "error",
|
|
1296
1284
|
name: n.url,
|
|
1297
1285
|
timeStamp: performance.timeOrigin + g.timeStamp,
|
|
@@ -1300,194 +1288,178 @@ const is = ({
|
|
|
1300
1288
|
};
|
|
1301
1289
|
n.addEventListener("open", o), n.addEventListener("error", d), n.addEventListener("message", l), n.addEventListener("close", r);
|
|
1302
1290
|
const c = new Proxy(n.send, {
|
|
1303
|
-
apply: function(g, h,
|
|
1304
|
-
const
|
|
1305
|
-
let
|
|
1306
|
-
typeof
|
|
1307
|
-
socketId:
|
|
1291
|
+
apply: function(g, h, f) {
|
|
1292
|
+
const m = f[0], _ = typeof m == "string" ? m : void 0;
|
|
1293
|
+
let k;
|
|
1294
|
+
typeof m == "string" ? k = m.length : m instanceof Blob ? k = m.size : k = m.byteLength || 0, window._highlightWebSocketEventCallback({
|
|
1295
|
+
socketId: i,
|
|
1308
1296
|
type: "sent",
|
|
1309
1297
|
name: n.url,
|
|
1310
1298
|
timeStamp: performance.timeOrigin + performance.now(),
|
|
1311
|
-
size:
|
|
1312
|
-
message:
|
|
1313
|
-
}), g.apply(h,
|
|
1299
|
+
size: k,
|
|
1300
|
+
message: _
|
|
1301
|
+
}), g.apply(h, f);
|
|
1314
1302
|
}
|
|
1315
1303
|
});
|
|
1316
1304
|
return n.send = c, n;
|
|
1317
1305
|
}
|
|
1318
1306
|
});
|
|
1319
|
-
window.WebSocket =
|
|
1307
|
+
window.WebSocket = s;
|
|
1320
1308
|
}
|
|
1321
1309
|
};
|
|
1322
|
-
var
|
|
1323
|
-
const b = (
|
|
1324
|
-
|
|
1325
|
-
},
|
|
1326
|
-
let
|
|
1327
|
-
const
|
|
1310
|
+
var Yt = /* @__PURE__ */ ((s) => (s.Device = "Device", s.WebVital = "WebVital", s.Frontend = "Frontend", s.Backend = "Backend", s))(Yt || {});
|
|
1311
|
+
const b = (s, e) => {
|
|
1312
|
+
O("warn", `highlight.run warning: (${s}): `, e);
|
|
1313
|
+
}, Xt = 200;
|
|
1314
|
+
let B = [], q, u, M, Ue = [], te = !1;
|
|
1315
|
+
const w = {
|
|
1328
1316
|
options: void 0,
|
|
1329
|
-
init: (
|
|
1330
|
-
var t,
|
|
1317
|
+
init: (s, e) => {
|
|
1318
|
+
var t, i, n, o, r, l, d, c;
|
|
1331
1319
|
try {
|
|
1332
|
-
if (
|
|
1320
|
+
if (w.options = e, typeof window == "undefined" || typeof document == "undefined")
|
|
1333
1321
|
return;
|
|
1334
|
-
if (!
|
|
1322
|
+
if (!s) {
|
|
1335
1323
|
console.info(
|
|
1336
1324
|
"Highlight is not initializing because projectID was passed undefined."
|
|
1337
1325
|
);
|
|
1338
1326
|
return;
|
|
1339
1327
|
}
|
|
1340
|
-
e != null && e.sessionCookie ?
|
|
1341
|
-
const g =
|
|
1342
|
-
let h =
|
|
1343
|
-
if (e != null && e.sessionKey ? h =
|
|
1344
|
-
`${
|
|
1345
|
-
) : g != null && g.sessionSecureID && (h = g.sessionSecureID),
|
|
1328
|
+
e != null && e.sessionCookie ? It() : ze(!1);
|
|
1329
|
+
const g = F();
|
|
1330
|
+
let h = T();
|
|
1331
|
+
if (e != null && e.sessionKey ? h = T(
|
|
1332
|
+
`${s}-${e.sessionKey}`
|
|
1333
|
+
) : g != null && g.sessionSecureID && (h = g.sessionSecureID), te)
|
|
1346
1334
|
return { sessionSecureID: h };
|
|
1347
|
-
|
|
1348
|
-
const
|
|
1349
|
-
organizationID:
|
|
1350
|
-
firstloadVersion:
|
|
1335
|
+
te = !0, $e(), Ve();
|
|
1336
|
+
const f = y(p({}, e), {
|
|
1337
|
+
organizationID: s,
|
|
1338
|
+
firstloadVersion: Ct,
|
|
1351
1339
|
environment: (e == null ? void 0 : e.environment) || "production",
|
|
1352
1340
|
appVersion: e == null ? void 0 : e.version,
|
|
1353
1341
|
sessionSecureID: h
|
|
1354
1342
|
});
|
|
1355
|
-
return
|
|
1343
|
+
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(), !((i = (t = e == null ? void 0 : e.integrations) == null ? void 0 : t.mixpanel) != null && i.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 };
|
|
1356
1344
|
} catch (g) {
|
|
1357
1345
|
b("init", g);
|
|
1358
1346
|
}
|
|
1359
1347
|
},
|
|
1360
|
-
snapshot: (
|
|
1348
|
+
snapshot: (s) => R(void 0, null, function* () {
|
|
1361
1349
|
try {
|
|
1362
1350
|
if (u && u.ready)
|
|
1363
|
-
return yield u.snapshot(
|
|
1351
|
+
return yield u.snapshot(s);
|
|
1364
1352
|
} catch (e) {
|
|
1365
1353
|
b("snapshot", e);
|
|
1366
1354
|
}
|
|
1367
1355
|
}),
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
userName: e,
|
|
1371
|
-
userEmail: t,
|
|
1372
|
-
timestampOverride: s
|
|
1373
|
-
}) => {
|
|
1374
|
-
try {
|
|
1375
|
-
p.onHighlightReady(
|
|
1376
|
-
() => u.addSessionFeedback({
|
|
1377
|
-
verbatim: i,
|
|
1378
|
-
timestamp: s || (/* @__PURE__ */ new Date()).toISOString(),
|
|
1379
|
-
user_email: t,
|
|
1380
|
-
user_name: e
|
|
1381
|
-
})
|
|
1382
|
-
);
|
|
1383
|
-
} catch (n) {
|
|
1384
|
-
b("error", n);
|
|
1385
|
-
}
|
|
1356
|
+
/** @deprecated Session feedback is no longer supported. This is a no-op. */
|
|
1357
|
+
addSessionFeedback: () => {
|
|
1386
1358
|
},
|
|
1387
|
-
consumeError: (
|
|
1359
|
+
consumeError: (s, e, t) => {
|
|
1388
1360
|
try {
|
|
1389
|
-
|
|
1361
|
+
w.onHighlightReady(
|
|
1390
1362
|
() => u.consumeCustomError(
|
|
1391
|
-
|
|
1363
|
+
s,
|
|
1392
1364
|
e,
|
|
1393
1365
|
JSON.stringify(t)
|
|
1394
1366
|
)
|
|
1395
1367
|
);
|
|
1396
|
-
} catch (
|
|
1397
|
-
b("error",
|
|
1368
|
+
} catch (i) {
|
|
1369
|
+
b("error", i);
|
|
1398
1370
|
}
|
|
1399
1371
|
},
|
|
1400
|
-
consume: (
|
|
1372
|
+
consume: (s, e) => {
|
|
1401
1373
|
try {
|
|
1402
|
-
|
|
1374
|
+
w.onHighlightReady(() => u.consumeError(s, e));
|
|
1403
1375
|
} catch (t) {
|
|
1404
1376
|
b("error", t);
|
|
1405
1377
|
}
|
|
1406
1378
|
},
|
|
1407
|
-
error: (
|
|
1379
|
+
error: (s, e) => {
|
|
1408
1380
|
try {
|
|
1409
|
-
|
|
1410
|
-
() => u.pushCustomError(
|
|
1381
|
+
w.onHighlightReady(
|
|
1382
|
+
() => u.pushCustomError(s, JSON.stringify(e))
|
|
1411
1383
|
);
|
|
1412
1384
|
} catch (t) {
|
|
1413
1385
|
b("error", t);
|
|
1414
1386
|
}
|
|
1415
1387
|
},
|
|
1416
|
-
track: (
|
|
1417
|
-
var t,
|
|
1388
|
+
track: (s, e = {}) => {
|
|
1389
|
+
var t, i, n, o, r, l, d, c, g, h, f;
|
|
1418
1390
|
try {
|
|
1419
|
-
|
|
1420
|
-
u.addProperties(y(
|
|
1421
|
-
event:
|
|
1391
|
+
w.onHighlightReady(() => {
|
|
1392
|
+
u.addProperties(y(p({}, e), { event: s })), u.log("H.track", "INFO", y(p({}, e != null ? e : {}), {
|
|
1393
|
+
event: s
|
|
1422
1394
|
}));
|
|
1423
1395
|
});
|
|
1424
|
-
const
|
|
1425
|
-
(n = (
|
|
1426
|
-
highlightSessionURL:
|
|
1427
|
-
})), (d = (l = (r =
|
|
1428
|
-
highlightSessionURL:
|
|
1429
|
-
})), (
|
|
1430
|
-
} catch (
|
|
1431
|
-
b("track",
|
|
1396
|
+
const m = u == null ? void 0 : u.getCurrentSessionURL();
|
|
1397
|
+
(n = (i = (t = w.options) == null ? void 0 : t.integrations) == null ? void 0 : i.mixpanel) != null && n.disabled || (o = window.mixpanel) != null && o.track && window.mixpanel.track(s, y(p({}, e), {
|
|
1398
|
+
highlightSessionURL: m
|
|
1399
|
+
})), (d = (l = (r = w.options) == null ? void 0 : r.integrations) == null ? void 0 : l.amplitude) != null && d.disabled || (c = window.amplitude) != null && c.getInstance && window.amplitude.getInstance().logEvent(s, y(p({}, e), {
|
|
1400
|
+
highlightSessionURL: m
|
|
1401
|
+
})), (f = (h = (g = w.options) == null ? void 0 : g.integrations) == null ? void 0 : h.intercom) != null && f.disabled || window.Intercom && window.Intercom("trackEvent", s, e);
|
|
1402
|
+
} catch (m) {
|
|
1403
|
+
b("track", m);
|
|
1432
1404
|
}
|
|
1433
1405
|
},
|
|
1434
|
-
log: (
|
|
1406
|
+
log: (s, e, t) => {
|
|
1435
1407
|
try {
|
|
1436
|
-
|
|
1437
|
-
() => u.log(
|
|
1408
|
+
w.onHighlightReady(
|
|
1409
|
+
() => u.log(s, e, t != null ? t : {})
|
|
1438
1410
|
);
|
|
1439
|
-
} catch (
|
|
1440
|
-
b("log",
|
|
1411
|
+
} catch (i) {
|
|
1412
|
+
b("log", i);
|
|
1441
1413
|
}
|
|
1442
1414
|
},
|
|
1443
|
-
start: (
|
|
1415
|
+
start: (s) => {
|
|
1444
1416
|
var e;
|
|
1445
|
-
(u == null ? void 0 : u.state) === "Recording" && !(
|
|
1417
|
+
(u == null ? void 0 : u.state) === "Recording" && !(s != null && s.forceNew) ? s != null && s.silent || console.warn(
|
|
1446
1418
|
"Highlight is already recording. Please `H.stop()` the current session before starting a new one."
|
|
1447
|
-
) : (((e = u == null ? void 0 : u._firstLoadListeners) != null ? e :
|
|
1448
|
-
() =>
|
|
1449
|
-
yield u.initialize(
|
|
1419
|
+
) : (((e = u == null ? void 0 : u._firstLoadListeners) != null ? e : M).startListening(), w.onHighlightReady(
|
|
1420
|
+
() => R(void 0, null, function* () {
|
|
1421
|
+
yield u.initialize(s);
|
|
1450
1422
|
}),
|
|
1451
1423
|
{ waitForReady: !1 }
|
|
1452
1424
|
));
|
|
1453
1425
|
},
|
|
1454
|
-
stop: (
|
|
1455
|
-
(u == null ? void 0 : u.state) !== "Recording" ?
|
|
1426
|
+
stop: (s) => {
|
|
1427
|
+
(u == null ? void 0 : u.state) !== "Recording" ? s != null && s.silent || console.warn(
|
|
1456
1428
|
"Highlight is already stopped. Please call `H.start()`."
|
|
1457
|
-
) :
|
|
1429
|
+
) : w.onHighlightReady(() => u.stopRecording(!0));
|
|
1458
1430
|
},
|
|
1459
|
-
identify: (
|
|
1460
|
-
var
|
|
1431
|
+
identify: (s, e = {}, t) => {
|
|
1432
|
+
var i, n, o, r, l, d, c, g;
|
|
1461
1433
|
try {
|
|
1462
|
-
|
|
1463
|
-
() => u.identify(
|
|
1434
|
+
w.onHighlightReady(
|
|
1435
|
+
() => u.identify(s, e, t)
|
|
1464
1436
|
);
|
|
1465
1437
|
} catch (h) {
|
|
1466
1438
|
b("identify", h);
|
|
1467
1439
|
}
|
|
1468
|
-
if ((o = (n = (
|
|
1469
|
-
typeof (e == null ? void 0 : e.email) == "string" ? e == null ? void 0 : e.email :
|
|
1470
|
-
), e && (window.mixpanel.track("identify", e), window.mixpanel.people.set(e))), !((c = (d = (l =
|
|
1440
|
+
if ((o = (n = (i = w.options) == null ? void 0 : i.integrations) == null ? void 0 : n.mixpanel) != null && o.disabled || (r = window.mixpanel) != null && r.identify && (window.mixpanel.identify(
|
|
1441
|
+
typeof (e == null ? void 0 : e.email) == "string" ? e == null ? void 0 : e.email : s
|
|
1442
|
+
), e && (window.mixpanel.track("identify", e), window.mixpanel.people.set(e))), !((c = (d = (l = w.options) == null ? void 0 : l.integrations) == null ? void 0 : d.amplitude) != null && c.disabled) && (g = window.amplitude) != null && g.getInstance && (window.amplitude.getInstance().setUserId(s), Object.keys(e).length > 0)) {
|
|
1471
1443
|
const h = Object.keys(
|
|
1472
1444
|
e
|
|
1473
|
-
).reduce((
|
|
1445
|
+
).reduce((f, m) => (f.set(m, e[m]), f), new window.amplitude.Identify());
|
|
1474
1446
|
window.amplitude.getInstance().identify(h);
|
|
1475
1447
|
}
|
|
1476
1448
|
},
|
|
1477
|
-
metrics: (
|
|
1449
|
+
metrics: (s) => {
|
|
1478
1450
|
try {
|
|
1479
|
-
for (const e of
|
|
1480
|
-
|
|
1451
|
+
for (const e of s)
|
|
1452
|
+
w.recordMetric(e);
|
|
1481
1453
|
} catch (e) {
|
|
1482
1454
|
b("metrics", e);
|
|
1483
1455
|
}
|
|
1484
1456
|
},
|
|
1485
|
-
recordMetric: (
|
|
1457
|
+
recordMetric: (s) => {
|
|
1486
1458
|
try {
|
|
1487
|
-
|
|
1459
|
+
w.onHighlightReady(() => {
|
|
1488
1460
|
var e;
|
|
1489
|
-
u.recordGauge(y(
|
|
1490
|
-
tags: (e =
|
|
1461
|
+
u.recordGauge(y(p({}, s), {
|
|
1462
|
+
tags: (e = s.tags) != null ? e : [],
|
|
1491
1463
|
group: window.location.href,
|
|
1492
1464
|
category: "Frontend"
|
|
1493
1465
|
/* Frontend */
|
|
@@ -1497,108 +1469,108 @@ const p = {
|
|
|
1497
1469
|
b("recordMetric", e);
|
|
1498
1470
|
}
|
|
1499
1471
|
},
|
|
1500
|
-
recordCount: (
|
|
1472
|
+
recordCount: (s) => {
|
|
1501
1473
|
try {
|
|
1502
|
-
|
|
1503
|
-
u.recordCount(
|
|
1474
|
+
w.onHighlightReady(() => {
|
|
1475
|
+
u.recordCount(s);
|
|
1504
1476
|
});
|
|
1505
1477
|
} catch (e) {
|
|
1506
1478
|
b("recordCount", e);
|
|
1507
1479
|
}
|
|
1508
1480
|
},
|
|
1509
|
-
recordIncr: (
|
|
1481
|
+
recordIncr: (s) => {
|
|
1510
1482
|
try {
|
|
1511
|
-
|
|
1512
|
-
u.recordIncr(
|
|
1483
|
+
w.onHighlightReady(() => {
|
|
1484
|
+
u.recordIncr(s);
|
|
1513
1485
|
});
|
|
1514
1486
|
} catch (e) {
|
|
1515
1487
|
b("recordIncr", e);
|
|
1516
1488
|
}
|
|
1517
1489
|
},
|
|
1518
|
-
recordHistogram: (
|
|
1490
|
+
recordHistogram: (s) => {
|
|
1519
1491
|
try {
|
|
1520
|
-
|
|
1521
|
-
u.recordHistogram(
|
|
1492
|
+
w.onHighlightReady(() => {
|
|
1493
|
+
u.recordHistogram(s);
|
|
1522
1494
|
});
|
|
1523
1495
|
} catch (e) {
|
|
1524
1496
|
b("recordHistogram", e);
|
|
1525
1497
|
}
|
|
1526
1498
|
},
|
|
1527
|
-
recordUpDownCounter: (
|
|
1499
|
+
recordUpDownCounter: (s) => {
|
|
1528
1500
|
try {
|
|
1529
|
-
|
|
1530
|
-
u.recordUpDownCounter(
|
|
1501
|
+
w.onHighlightReady(() => {
|
|
1502
|
+
u.recordUpDownCounter(s);
|
|
1531
1503
|
});
|
|
1532
1504
|
} catch (e) {
|
|
1533
1505
|
b("recordUpDownCounter", e);
|
|
1534
1506
|
}
|
|
1535
1507
|
},
|
|
1536
|
-
startSpan: (
|
|
1508
|
+
startSpan: (s, e, t, i) => {
|
|
1537
1509
|
const n = Oe();
|
|
1538
1510
|
if (!n) {
|
|
1539
|
-
const r =
|
|
1540
|
-
return
|
|
1511
|
+
const r = Pe();
|
|
1512
|
+
return i === void 0 && t === void 0 ? e(r) : i === void 0 ? t(r) : i(r);
|
|
1541
1513
|
}
|
|
1542
1514
|
const o = (r, l) => {
|
|
1543
1515
|
const d = l(r);
|
|
1544
1516
|
return d instanceof Promise ? d.finally(() => r.end()) : (r.end(), d);
|
|
1545
1517
|
};
|
|
1546
|
-
return
|
|
1547
|
-
|
|
1518
|
+
return i === void 0 && t === void 0 ? n.startActiveSpan(
|
|
1519
|
+
s,
|
|
1548
1520
|
(r) => o(r, e)
|
|
1549
|
-
) :
|
|
1550
|
-
|
|
1521
|
+
) : i === void 0 ? n.startActiveSpan(
|
|
1522
|
+
s,
|
|
1551
1523
|
e,
|
|
1552
1524
|
(r) => o(r, t)
|
|
1553
1525
|
) : n.startActiveSpan(
|
|
1554
|
-
|
|
1526
|
+
s,
|
|
1555
1527
|
e,
|
|
1556
1528
|
t,
|
|
1557
|
-
(r) => o(r,
|
|
1529
|
+
(r) => o(r, i)
|
|
1558
1530
|
);
|
|
1559
1531
|
},
|
|
1560
|
-
startManualSpan: (
|
|
1532
|
+
startManualSpan: (s, e, t, i) => {
|
|
1561
1533
|
const n = Oe();
|
|
1562
1534
|
if (!n) {
|
|
1563
|
-
const o =
|
|
1564
|
-
return
|
|
1535
|
+
const o = Pe();
|
|
1536
|
+
return i === void 0 && t === void 0 ? e(o) : i === void 0 ? t(o) : i(o);
|
|
1565
1537
|
}
|
|
1566
|
-
return
|
|
1567
|
-
|
|
1538
|
+
return i === void 0 && t === void 0 ? n.startActiveSpan(s, e) : i === void 0 ? n.startActiveSpan(
|
|
1539
|
+
s,
|
|
1568
1540
|
e,
|
|
1569
1541
|
t
|
|
1570
1542
|
) : n.startActiveSpan(
|
|
1571
|
-
|
|
1543
|
+
s,
|
|
1572
1544
|
e,
|
|
1573
1545
|
t,
|
|
1574
|
-
|
|
1546
|
+
i
|
|
1575
1547
|
);
|
|
1576
1548
|
},
|
|
1577
|
-
getSessionURL: () => new Promise((
|
|
1578
|
-
|
|
1579
|
-
const t = u.sessionData.sessionSecureID,
|
|
1580
|
-
|
|
1581
|
-
`https://${
|
|
1549
|
+
getSessionURL: () => new Promise((s, e) => {
|
|
1550
|
+
w.onHighlightReady(() => {
|
|
1551
|
+
const t = u.sessionData.sessionSecureID, i = F(t);
|
|
1552
|
+
i ? s(
|
|
1553
|
+
`https://${Z}/${i.projectID}/sessions/${t}`
|
|
1582
1554
|
) : e(new Error(`Unable to get session URL: ${t}`));
|
|
1583
1555
|
});
|
|
1584
1556
|
}),
|
|
1585
|
-
getSessionDetails: () => new Promise((
|
|
1586
|
-
|
|
1557
|
+
getSessionDetails: () => new Promise((s, e) => {
|
|
1558
|
+
w.onHighlightReady(() => R(void 0, null, function* () {
|
|
1587
1559
|
try {
|
|
1588
|
-
const t = yield
|
|
1560
|
+
const t = yield w.getSessionURL();
|
|
1589
1561
|
if (!t)
|
|
1590
1562
|
throw new Error("Could not get session URL");
|
|
1591
|
-
const
|
|
1563
|
+
const i = u.sessionData.sessionSecureID, n = F(i), o = n == null ? void 0 : n.sessionStartTime;
|
|
1592
1564
|
if (!o)
|
|
1593
1565
|
throw new Error("Could not get session start timestamp");
|
|
1594
1566
|
const r = (/* @__PURE__ */ new Date()).getTime(), l = new URL(t), d = new URL(t);
|
|
1595
1567
|
d.searchParams.set(
|
|
1596
1568
|
"ts",
|
|
1597
1569
|
((r - o) / 1e3).toString()
|
|
1598
|
-
),
|
|
1570
|
+
), s({
|
|
1599
1571
|
url: l.toString(),
|
|
1600
1572
|
urlWithTimestamp: d.toString(),
|
|
1601
|
-
sessionSecureID:
|
|
1573
|
+
sessionSecureID: i
|
|
1602
1574
|
});
|
|
1603
1575
|
} catch (t) {
|
|
1604
1576
|
e(t);
|
|
@@ -1606,55 +1578,55 @@ const p = {
|
|
|
1606
1578
|
}));
|
|
1607
1579
|
}),
|
|
1608
1580
|
getRecordingState: () => {
|
|
1609
|
-
var
|
|
1610
|
-
return (
|
|
1581
|
+
var s;
|
|
1582
|
+
return (s = u == null ? void 0 : u.state) != null ? s : "NotRecording";
|
|
1611
1583
|
},
|
|
1612
|
-
onHighlightReady: (
|
|
1584
|
+
onHighlightReady: (s, e) => {
|
|
1613
1585
|
if (u && u.ready) {
|
|
1614
|
-
|
|
1586
|
+
s();
|
|
1615
1587
|
return;
|
|
1616
1588
|
}
|
|
1617
|
-
if (
|
|
1589
|
+
if (B.push({ options: e, func: s }), q !== void 0)
|
|
1618
1590
|
return;
|
|
1619
1591
|
const t = () => {
|
|
1620
|
-
|
|
1592
|
+
B = B.filter((n) => {
|
|
1621
1593
|
var o;
|
|
1622
1594
|
return !u || ((o = n.options) == null ? void 0 : o.waitForReady) !== !1 && !u.ready ? !0 : (n.func(), !1);
|
|
1623
|
-
}),
|
|
1595
|
+
}), q = void 0, B.length > 0 && (q = setTimeout(
|
|
1624
1596
|
t,
|
|
1625
|
-
|
|
1597
|
+
Xt
|
|
1626
1598
|
));
|
|
1627
1599
|
};
|
|
1628
1600
|
t();
|
|
1629
1601
|
},
|
|
1630
|
-
registerLD(
|
|
1631
|
-
|
|
1632
|
-
u.registerLD(
|
|
1633
|
-
}),
|
|
1602
|
+
registerLD(s) {
|
|
1603
|
+
Ue.length || (w.onHighlightReady(() => {
|
|
1604
|
+
u.registerLD(s);
|
|
1605
|
+
}), Dt(this, s, w.options), Ue.push(new We(s)));
|
|
1634
1606
|
}
|
|
1635
1607
|
};
|
|
1636
|
-
typeof window != "undefined" && (window.H =
|
|
1637
|
-
|
|
1638
|
-
Fe();
|
|
1608
|
+
typeof window != "undefined" && (window.H = w);
|
|
1609
|
+
Qt();
|
|
1639
1610
|
$e();
|
|
1640
|
-
|
|
1611
|
+
Ve();
|
|
1612
|
+
const as = {
|
|
1641
1613
|
reset: () => {
|
|
1642
|
-
|
|
1614
|
+
te = !1, u = void 0, B = [], q = void 0, M = void 0;
|
|
1643
1615
|
},
|
|
1644
|
-
setHighlightObj: (
|
|
1645
|
-
u =
|
|
1616
|
+
setHighlightObj: (s) => {
|
|
1617
|
+
u = s;
|
|
1646
1618
|
}
|
|
1647
1619
|
};
|
|
1648
1620
|
export {
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1621
|
+
T as GenerateSecureID,
|
|
1622
|
+
w as H,
|
|
1623
|
+
os as HighlightSegmentMiddleware,
|
|
1624
|
+
fs as LDObserve,
|
|
1625
|
+
ws as LDRecord,
|
|
1626
|
+
Yt as MetricCategory,
|
|
1627
|
+
gs as Observe,
|
|
1628
|
+
ds as Record,
|
|
1629
|
+
as as __testing,
|
|
1630
|
+
rs as configureElectronHighlight
|
|
1659
1631
|
};
|
|
1660
1632
|
//# sourceMappingURL=index.js.map
|