@launchdarkly/o11y 1.4.1 → 1.6.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 +26 -0
- package/dist/LDObserve-o8Ro1UV8.js +160 -0
- package/dist/LDObserve-o8Ro1UV8.js.map +1 -0
- package/dist/LDObserve.d.ts +44 -0
- package/dist/LDObserve.js +1 -1
- package/dist/{common-D8kkCWo3.js → common-C6gSg2Rq.js} +704 -675
- package/dist/{common-D8kkCWo3.js.map → common-C6gSg2Rq.js.map} +1 -1
- package/dist/index.d.ts +134 -0
- package/dist/index.js +209 -207
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +115 -115
- package/dist/index.umd.js.map +1 -1
- package/dist/{observe-BCebRa17.js → observe-CL-A2YiL.js} +2429 -2204
- package/dist/observe-CL-A2YiL.js.map +1 -0
- package/dist/observe.d.ts +122 -0
- package/dist/observe.js +3 -3
- package/dist/{record-DG2IcHxO.js → record-BpTfYU5r.js} +489 -487
- package/dist/record-BpTfYU5r.js.map +1 -0
- package/dist/record.d.ts +418 -0
- package/dist/record.js +2 -2
- package/package.json +1 -1
- package/dist/LDObserve-BQr7RYVC.js +0 -130
- package/dist/LDObserve-BQr7RYVC.js.map +0 -1
- package/dist/observe-BCebRa17.js.map +0 -1
- package/dist/record-DG2IcHxO.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var Je = Object.defineProperty, Qe = Object.defineProperties;
|
|
2
|
+
var Ye = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var V = Object.getOwnPropertySymbols;
|
|
4
|
-
var
|
|
5
|
-
var
|
|
4
|
+
var we = Object.prototype.hasOwnProperty, Se = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var ye = (s) => {
|
|
6
6
|
throw TypeError(s);
|
|
7
7
|
};
|
|
8
|
-
var G = (s, e, t) => e in s ?
|
|
8
|
+
var G = (s, e, t) => e in s ? Je(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, w = (s, e) => {
|
|
9
9
|
for (var t in e || (e = {}))
|
|
10
|
-
|
|
10
|
+
we.call(e, t) && G(s, t, e[t]);
|
|
11
11
|
if (V)
|
|
12
12
|
for (var t of V(e))
|
|
13
|
-
|
|
13
|
+
Se.call(e, t) && G(s, t, e[t]);
|
|
14
14
|
return s;
|
|
15
|
-
}, y = (s, e) =>
|
|
15
|
+
}, y = (s, e) => Qe(s, Ye(e));
|
|
16
16
|
var j = (s, e) => {
|
|
17
17
|
var t = {};
|
|
18
18
|
for (var i in s)
|
|
19
|
-
|
|
19
|
+
we.call(s, i) && e.indexOf(i) < 0 && (t[i] = s[i]);
|
|
20
20
|
if (s != null && V)
|
|
21
21
|
for (var i of V(s))
|
|
22
|
-
e.indexOf(i) < 0 &&
|
|
22
|
+
e.indexOf(i) < 0 && Se.call(s, i) && (t[i] = s[i]);
|
|
23
23
|
return t;
|
|
24
24
|
};
|
|
25
|
-
var a = (s, e, t) => G(s, typeof e != "symbol" ? e + "" : e, t),
|
|
26
|
-
var
|
|
27
|
-
var
|
|
25
|
+
var a = (s, e, t) => G(s, typeof e != "symbol" ? e + "" : e, t), be = (s, e, t) => e.has(s) || ye("Cannot " + t);
|
|
26
|
+
var ke = (s, e, t) => (be(s, e, "read from private field"), t ? t.call(s) : e.get(s)), ve = (s, e, t) => e.has(s) ? ye("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(s) : e.set(s, t), _e = (s, e, t, i) => (be(s, e, "write to private field"), i ? i.call(s, t) : e.set(s, t), t);
|
|
27
|
+
var _ = (s, e, t) => new Promise((i, n) => {
|
|
28
28
|
var o = (d) => {
|
|
29
29
|
try {
|
|
30
30
|
l(t.next(d));
|
|
@@ -40,16 +40,16 @@ var R = (s, e, t) => new Promise((i, n) => {
|
|
|
40
40
|
}, l = (d) => d.done ? i(d.value) : Promise.resolve(d.value).then(o, r);
|
|
41
41
|
l((t = t.apply(s, e)).next());
|
|
42
42
|
});
|
|
43
|
-
import { W as
|
|
44
|
-
import { R as
|
|
45
|
-
import { s as K, G as T, g as F, S as E, r 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 Xe, M as L, r as J, I as Re, a as De, S as Ze, C as et, F as tt, b as st, P as it, c as Ie, g as nt, p as rt, E as ot, d as at, e as ct, f as lt, h as dt, s as ht, i as gt } from "./record-BpTfYU5r.js";
|
|
44
|
+
import { R as us } from "./record-BpTfYU5r.js";
|
|
45
|
+
import { s as K, G as T, g as F, S as E, r as Ce, a as Q, b as ut, c as ft, d as Y, e as X, f as W, F as Le, V as mt, P as pt, h as wt, H as Z, M as St, i as yt, L as Be, j as Me, k as bt, p as kt, l as Ee, m as Ne, n as vt, o as _t, q as Rt, t as Dt, u as It, v as Ct, w as Lt, x as Et, y as Nt } from "./common-C6gSg2Rq.js";
|
|
46
|
+
import { X as Tt, F as Ot, A as Pt, C as Ht, E as Ut, s as Fe, D as Wt, a as zt, m as Te, d as $e, b as Oe, c as Pe, r as Ve, e as Bt, p as Mt, f as Ft, g as $t, M as D, h as N, W as Vt, N as xt, P as At, J as Kt, i as x, j as A, k as qt, l as Gt, n as jt, o as He } from "./observe-CL-A2YiL.js";
|
|
47
|
+
import { O as ms } from "./observe-CL-A2YiL.js";
|
|
48
|
+
import { L as Jt, s as Qt, a as O } from "./buffer-CwCRPuMA.js";
|
|
49
|
+
import { g as Ue } from "./LDObserve-o8Ro1UV8.js";
|
|
50
|
+
import { L as ws } from "./LDObserve-o8Ro1UV8.js";
|
|
51
|
+
import { LDRecord as ys } from "./LDRecord.js";
|
|
52
|
+
const Yt = (s, e, t) => {
|
|
53
53
|
const i = window._highlightWebSocketRequestCallback;
|
|
54
54
|
window._highlightWebSocketRequestCallback = s;
|
|
55
55
|
const n = window._highlightWebSocketEventCallback;
|
|
@@ -61,7 +61,7 @@ const jt = (s, e, t) => {
|
|
|
61
61
|
}, () => {
|
|
62
62
|
window._highlightWebSocketRequestCallback = i, window._highlightWebSocketEventCallback = n;
|
|
63
63
|
};
|
|
64
|
-
},
|
|
64
|
+
}, Xt = ({
|
|
65
65
|
xhrCallback: s,
|
|
66
66
|
fetchCallback: e,
|
|
67
67
|
webSocketRequestCallback: t,
|
|
@@ -73,14 +73,14 @@ const jt = (s, e, t) => {
|
|
|
73
73
|
urlBlocklist: d,
|
|
74
74
|
bodyKeysToRecord: c
|
|
75
75
|
}) => {
|
|
76
|
-
const g =
|
|
76
|
+
const g = Tt(
|
|
77
77
|
s,
|
|
78
78
|
r,
|
|
79
79
|
l,
|
|
80
80
|
d,
|
|
81
81
|
o,
|
|
82
82
|
c
|
|
83
|
-
), h =
|
|
83
|
+
), h = Ot(
|
|
84
84
|
e,
|
|
85
85
|
r,
|
|
86
86
|
l,
|
|
@@ -88,7 +88,7 @@ const jt = (s, e, t) => {
|
|
|
88
88
|
o,
|
|
89
89
|
c
|
|
90
90
|
), f = n ? () => {
|
|
91
|
-
} :
|
|
91
|
+
} : Yt(
|
|
92
92
|
t,
|
|
93
93
|
i,
|
|
94
94
|
d
|
|
@@ -127,7 +127,7 @@ class I {
|
|
|
127
127
|
a(this, "requestResponseSanitizer");
|
|
128
128
|
var t, i;
|
|
129
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
|
-
...
|
|
130
|
+
...Pt
|
|
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
|
+
Ht(
|
|
141
141
|
(t) => {
|
|
142
142
|
var i, n, o;
|
|
143
143
|
if (this.reportConsoleErrors && (t.type === "Error" || t.type === "error") && t.value && t.trace) {
|
|
144
144
|
const r = K(t.value);
|
|
145
|
-
if (
|
|
145
|
+
if (Oe.includes(r) || Pe.some(
|
|
146
146
|
(l) => r.includes(l)
|
|
147
147
|
))
|
|
148
148
|
return;
|
|
@@ -155,26 +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: Ve()
|
|
159
159
|
});
|
|
160
160
|
}
|
|
161
161
|
e.messages.push(t);
|
|
162
162
|
},
|
|
163
|
-
y(
|
|
163
|
+
y(w({}, $e), {
|
|
164
164
|
level: this.consoleMethodsToRecord,
|
|
165
165
|
recordLaunchDarklySdkLogs: this.options.recordLaunchDarklySdkLogs
|
|
166
166
|
})
|
|
167
167
|
)
|
|
168
168
|
), this.listeners.push(
|
|
169
|
-
|
|
169
|
+
Ut(
|
|
170
170
|
(t) => {
|
|
171
|
-
|
|
171
|
+
Oe.includes(t.event) || Pe.some(
|
|
172
172
|
(i) => t.event.includes(i)
|
|
173
173
|
) || e.errors.push(t);
|
|
174
174
|
},
|
|
175
175
|
{ enablePromisePatch: this.enablePromisePatch }
|
|
176
176
|
)
|
|
177
|
-
), this.listeners.push(
|
|
177
|
+
), this.listeners.push(Fe), I.setupNetworkListener(this, this.options);
|
|
178
178
|
}
|
|
179
179
|
stopListening() {
|
|
180
180
|
this.listeners.forEach((e) => e()), this.listeners = [];
|
|
@@ -182,7 +182,7 @@ class I {
|
|
|
182
182
|
// We define this as a static method because versions earlier than 4.0.0 (Feb 2022) don't have this code.
|
|
183
183
|
// For those versions, calling this from client will monkey-patch the network listeners onto the old FirstLoadListener object.
|
|
184
184
|
static setupNetworkListener(e, t) {
|
|
185
|
-
var o, r, l, d, c, g, h, f, m,
|
|
185
|
+
var o, r, l, d, c, g, h, f, m, R, k, C;
|
|
186
186
|
const i = (t == null ? void 0 : t.backendUrl) || void 0 || "https://pub.highlight.io", n = t.otlpEndpoint || "https://otel.highlight.io";
|
|
187
187
|
e.highlightEndpoints = [
|
|
188
188
|
i,
|
|
@@ -197,13 +197,13 @@ class I {
|
|
|
197
197
|
(S) => S.toLowerCase()
|
|
198
198
|
)) || [], e.urlBlocklist = [
|
|
199
199
|
...e.urlBlocklist,
|
|
200
|
-
...
|
|
201
|
-
], e.requestResponseSanitizer = (
|
|
200
|
+
...Wt
|
|
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(
|
|
202
202
|
(S) => S.toLocaleLowerCase()
|
|
203
203
|
)), e.networkBodyKeysToRecord = (C = t.networkRecording) == null ? void 0 : C.bodyKeysToRecord, e.networkBodyKeysToRecord && (e.networkBodyKeysToRedact = [], e.networkBodyKeysToRecord = e.networkBodyKeysToRecord.map(
|
|
204
204
|
(S) => S.toLocaleLowerCase()
|
|
205
205
|
))), !e.disableNetworkRecording && e.enableRecordingNetworkContents && (e.hasNetworkRecording = !0, e.listeners.push(
|
|
206
|
-
|
|
206
|
+
Xt({
|
|
207
207
|
xhrCallback: (S) => {
|
|
208
208
|
e.xhrNetworkContents.push(S);
|
|
209
209
|
},
|
|
@@ -234,10 +234,10 @@ class I {
|
|
|
234
234
|
"resource"
|
|
235
235
|
);
|
|
236
236
|
const d = (t - l) * 2;
|
|
237
|
-
if (i = i.filter((c) => c.responseEnd < e.lastNetworkRequestTimestamp ? !1 :
|
|
237
|
+
if (i = i.filter((c) => c.responseEnd < e.lastNetworkRequestTimestamp ? !1 : zt(
|
|
238
238
|
c.name,
|
|
239
239
|
e.highlightEndpoints
|
|
240
|
-
)).map((c) => y(
|
|
240
|
+
)).map((c) => y(w({}, c.toJSON()), {
|
|
241
241
|
offsetStartTime: c.startTime - d,
|
|
242
242
|
offsetResponseEnd: c.responseEnd - d,
|
|
243
243
|
offsetFetchStart: c.fetchStart - d
|
|
@@ -247,12 +247,12 @@ class I {
|
|
|
247
247
|
headersToRecord: e.networkHeaderKeysToRecord,
|
|
248
248
|
requestResponseSanitizer: e.requestResponseSanitizer
|
|
249
249
|
};
|
|
250
|
-
i =
|
|
250
|
+
i = Te(
|
|
251
251
|
i,
|
|
252
252
|
e.xhrNetworkContents,
|
|
253
253
|
"xmlhttprequest",
|
|
254
254
|
c
|
|
255
|
-
), i =
|
|
255
|
+
), i = Te(
|
|
256
256
|
i,
|
|
257
257
|
e.fetchNetworkContents,
|
|
258
258
|
"fetch",
|
|
@@ -284,7 +284,7 @@ const se = class se {
|
|
|
284
284
|
// ECMAScript-private (#) so the internal GraphQL SDK type — which
|
|
285
285
|
// references graphql-request / graphql — does not leak into the published
|
|
286
286
|
// declaration file and break consumer type-checking.
|
|
287
|
-
|
|
287
|
+
ve(this, $);
|
|
288
288
|
a(this, "events");
|
|
289
289
|
a(this, "sessionData");
|
|
290
290
|
a(this, "ready");
|
|
@@ -318,6 +318,7 @@ const se = class se {
|
|
|
318
318
|
a(this, "_isCrossOriginIframe");
|
|
319
319
|
a(this, "_eventBytesSinceSnapshot");
|
|
320
320
|
a(this, "_lastSnapshotTime");
|
|
321
|
+
a(this, "_snapshotPayloadIds");
|
|
321
322
|
a(this, "_lastVisibilityChangeTime");
|
|
322
323
|
a(this, "pushPayloadTimerId");
|
|
323
324
|
a(this, "hasSessionUnloaded");
|
|
@@ -331,11 +332,11 @@ const se = class se {
|
|
|
331
332
|
a(this, "_up_down_counters", /* @__PURE__ */ new Map());
|
|
332
333
|
a(this, "_integrations", []);
|
|
333
334
|
var n, o, r, l, d;
|
|
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
|
|
335
|
+
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 Jt(this.debugOptions.clientInteractions), e.debug && Qt(!0), e.storageMode && (this.logger.log(
|
|
335
336
|
`initializing in ${e.storageMode} session mode`
|
|
336
|
-
),
|
|
337
|
+
), vt(e.storageMode)), Me(!!(e != null && e.sessionCookie)), (e == null ? void 0 : e.sessionCookieDomain) !== void 0 && bt(e.sessionCookieDomain), this._worker = new Xe(), this._worker.onmessage = (c) => {
|
|
337
338
|
var g, h, f;
|
|
338
|
-
((g = c.data.response) == null ? void 0 : g.type) === L.AsyncEvents ? (this._eventBytesSinceSnapshot += c.data.response.eventsSize, this.logger.log(
|
|
339
|
+
((g = c.data.response) == null ? void 0 : g.type) === L.AsyncEvents ? (this._snapshotPayloadIds.delete(c.data.response.id) || (this._eventBytesSinceSnapshot += c.data.response.eventsSize), this.logger.log(
|
|
339
340
|
`Web worker sent payloadID ${c.data.response.id} size ${c.data.response.eventsSize} bytes, compression ratio ${c.data.response.eventsSize / c.data.response.compressedSize}.
|
|
340
341
|
Total since snapshot: ${(this._eventBytesSinceSnapshot / 1e6).toFixed(1)}MB`
|
|
341
342
|
)) : ((h = c.data.response) == null ? void 0 : h.type) === L.CustomEvent ? this.addCustomEvent(
|
|
@@ -353,7 +354,7 @@ const se = class se {
|
|
|
353
354
|
);
|
|
354
355
|
else {
|
|
355
356
|
for (const c of Object.values(E))
|
|
356
|
-
|
|
357
|
+
Ce(c);
|
|
357
358
|
this.sessionData = {
|
|
358
359
|
sessionSecureID: this.options.sessionSecureID,
|
|
359
360
|
projectID: 0,
|
|
@@ -373,7 +374,7 @@ const se = class se {
|
|
|
373
374
|
}
|
|
374
375
|
// Start a new session
|
|
375
376
|
_reset(i) {
|
|
376
|
-
return
|
|
377
|
+
return _(this, arguments, function* ({
|
|
377
378
|
forceNew: e,
|
|
378
379
|
sessionKey: t
|
|
379
380
|
}) {
|
|
@@ -389,31 +390,31 @@ const se = class se {
|
|
|
389
390
|
} catch (r) {
|
|
390
391
|
}
|
|
391
392
|
for (const r of Object.values(E))
|
|
392
|
-
|
|
393
|
+
Ce(r);
|
|
393
394
|
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);
|
|
394
395
|
});
|
|
395
396
|
}
|
|
396
397
|
_initMembers(e) {
|
|
397
|
-
var o, r, l, d, c, g, h, f, m,
|
|
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 =
|
|
398
|
+
var o, r, l, d, c, g, h, f, m, R, k;
|
|
399
|
+
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({
|
|
399
400
|
canvasFactor: 0.5,
|
|
400
401
|
canvasMaxSnapshotDimension: 360,
|
|
401
402
|
canvasClearWebGLBuffer: !0,
|
|
402
|
-
dataUrlOptions:
|
|
403
|
+
dataUrlOptions: ut()
|
|
403
404
|
}, (f = e.samplingStrategy) != null ? f : {
|
|
404
405
|
canvas: 2
|
|
405
406
|
}), 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
|
|
407
|
+
const t = new Rt(`${this._backendUrl}`, {
|
|
407
408
|
headers: {}
|
|
408
409
|
});
|
|
409
|
-
|
|
410
|
+
_e(this, $, ft(t, _t())), 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 = () => {
|
|
410
411
|
};
|
|
411
412
|
const C = e, { firstloadVersion: i } = C, n = j(C, ["firstloadVersion"]);
|
|
412
413
|
this._optionsInternal = n, this.listeners = [], this.events = [], this.hasSessionUnloaded = !1, this.hasPushedData = !1, window.Intercom && window.Intercom("onShow", () => {
|
|
413
414
|
window.Intercom("update", {
|
|
414
415
|
highlightSessionURL: this.getCurrentSessionURLWithTimestamp()
|
|
415
416
|
}), this.addProperties({ event: "Intercom onShow" });
|
|
416
|
-
}), this._eventBytesSinceSnapshot = 0, this._lastSnapshotTime = (/* @__PURE__ */ new Date()).getTime(), this._lastVisibilityChangeTime = (/* @__PURE__ */ new Date()).getTime();
|
|
417
|
+
}), this._eventBytesSinceSnapshot = 0, this._lastSnapshotTime = (/* @__PURE__ */ new Date()).getTime(), this._snapshotPayloadIds = /* @__PURE__ */ new Set(), this._lastVisibilityChangeTime = (/* @__PURE__ */ new Date()).getTime();
|
|
417
418
|
}
|
|
418
419
|
identify(e, t = {}, i) {
|
|
419
420
|
if (!e || e === "") {
|
|
@@ -444,7 +445,7 @@ const se = class se {
|
|
|
444
445
|
}
|
|
445
446
|
log(e, t, i) {
|
|
446
447
|
this._firstLoadListeners.messages.push(
|
|
447
|
-
|
|
448
|
+
Bt(t, $e, e, i)
|
|
448
449
|
);
|
|
449
450
|
}
|
|
450
451
|
pushCustomError(e, t) {
|
|
@@ -454,7 +455,7 @@ const se = class se {
|
|
|
454
455
|
let n = {};
|
|
455
456
|
if (i)
|
|
456
457
|
try {
|
|
457
|
-
n =
|
|
458
|
+
n = w(w({}, JSON.parse(i)), n);
|
|
458
459
|
} catch (o) {
|
|
459
460
|
}
|
|
460
461
|
return this.consumeError(e, {
|
|
@@ -469,10 +470,10 @@ const se = class se {
|
|
|
469
470
|
type: o
|
|
470
471
|
}) {
|
|
471
472
|
var c, g, h, f;
|
|
472
|
-
e.cause && (i = y(
|
|
473
|
+
e.cause && (i = y(w({}, i), { "exception.cause": e.cause }));
|
|
473
474
|
let r = t ? t + ":" + e.message : e.message;
|
|
474
475
|
o === "React.ErrorBoundary" && (r = "ErrorBoundary: " + r);
|
|
475
|
-
const l =
|
|
476
|
+
const l = Mt(e), d = {
|
|
476
477
|
event: r,
|
|
477
478
|
type: o != null ? o : "custom",
|
|
478
479
|
url: window.location.href,
|
|
@@ -482,14 +483,14 @@ const se = class se {
|
|
|
482
483
|
stackTrace: l,
|
|
483
484
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
484
485
|
payload: JSON.stringify(i),
|
|
485
|
-
id:
|
|
486
|
+
id: Ve()
|
|
486
487
|
};
|
|
487
488
|
this._firstLoadListeners.errors.push(d);
|
|
488
489
|
for (const m of this._integrations)
|
|
489
490
|
m.error(this.sessionData.sessionSecureID, d);
|
|
490
491
|
}
|
|
491
492
|
addProperties(e = {}, t) {
|
|
492
|
-
const i =
|
|
493
|
+
const i = w({}, e);
|
|
493
494
|
Object.entries(i).forEach(([n, o]) => {
|
|
494
495
|
try {
|
|
495
496
|
structuredClone(o);
|
|
@@ -504,14 +505,14 @@ const se = class se {
|
|
|
504
505
|
}
|
|
505
506
|
});
|
|
506
507
|
for (const n of this._integrations)
|
|
507
|
-
n.track(this.sessionData.sessionSecureID,
|
|
508
|
+
n.track(this.sessionData.sessionSecureID, w({
|
|
508
509
|
sessionSecureID: this.sessionData.sessionSecureID,
|
|
509
510
|
propertyType: t
|
|
510
511
|
}, e));
|
|
511
512
|
}
|
|
512
513
|
initialize(e) {
|
|
513
|
-
return
|
|
514
|
-
var t, i, n, o, r, l, d, c, g, h, f, m,
|
|
514
|
+
return _(this, null, function* () {
|
|
515
|
+
var t, i, n, o, r, l, d, c, g, h, f, m, R, k, C, S, ie, ne, re, oe, ae, ce, le, de, he, ge, ue;
|
|
515
516
|
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")) {
|
|
516
517
|
(n = this._firstLoadListeners) == null || n.stopListening();
|
|
517
518
|
return;
|
|
@@ -522,11 +523,11 @@ const se = class se {
|
|
|
522
523
|
return;
|
|
523
524
|
}
|
|
524
525
|
if (e != null && e.sessionKey && (e == null ? void 0 : e.sessionKey) !== this.sessionData.sessionKey) {
|
|
525
|
-
yield this._reset(y(
|
|
526
|
+
yield this._reset(y(w({}, e), { forceNew: !0 }));
|
|
526
527
|
return;
|
|
527
528
|
}
|
|
528
|
-
const P = new
|
|
529
|
-
|
|
529
|
+
const P = new $t();
|
|
530
|
+
Ft(
|
|
530
531
|
{
|
|
531
532
|
backendUrl: (r = (o = this.options) == null ? void 0 : o.backendUrl) != null ? r : "https://pub.highlight.io",
|
|
532
533
|
otlpEndpoint: (d = (l = this.options) == null ? void 0 : l.otlpEndpoint) != null ? d : "https://otel.highlight.io",
|
|
@@ -534,9 +535,10 @@ const se = class se {
|
|
|
534
535
|
sessionSecureId: (g = this.options) == null ? void 0 : g.sessionSecureID,
|
|
535
536
|
environment: (f = (h = this.options) == null ? void 0 : h.environment) != null ? f : "production",
|
|
536
537
|
networkRecordingOptions: typeof ((m = this.options) == null ? void 0 : m.networkRecording) == "object" ? this.options.networkRecording : void 0,
|
|
537
|
-
tracingOrigins: (
|
|
538
|
+
tracingOrigins: (R = this.options) == null ? void 0 : R.tracingOrigins,
|
|
538
539
|
serviceName: (C = (k = this.options) == null ? void 0 : k.serviceName) != null ? C : "highlight-browser",
|
|
539
540
|
instrumentations: (ie = (S = this.options) == null ? void 0 : S.otel) == null ? void 0 : ie.instrumentations,
|
|
541
|
+
onHttpRequestSpan: (re = (ne = this.options) == null ? void 0 : ne.otel) == null ? void 0 : re.onHttpRequestSpan,
|
|
540
542
|
getIntegrations: () => [...this._integrations],
|
|
541
543
|
productAnalyticsEvents: this._productAnalyticsEvents()
|
|
542
544
|
},
|
|
@@ -546,16 +548,16 @@ const se = class se {
|
|
|
546
548
|
e,
|
|
547
549
|
this.sessionData,
|
|
548
550
|
this.options
|
|
549
|
-
), this.sessionData = (
|
|
550
|
-
let H = Q(
|
|
551
|
-
H || (H = T(), Y(
|
|
551
|
+
), this.sessionData = (oe = F(this.sessionData.sessionSecureID)) != null ? oe : this.sessionData, (ae = this.sessionData) != null && ae.sessionStartTime ? this._recordingStartTime = (ce = this.sessionData) == null ? void 0 : ce.sessionStartTime : (this._recordingStartTime = (/* @__PURE__ */ new Date()).getTime(), this.sessionData.sessionStartTime = this._recordingStartTime), X(""), W(this.sessionData);
|
|
552
|
+
let H = Q(Ne.CLIENT_ID);
|
|
553
|
+
H || (H = T(), Y(Ne.CLIENT_ID, H));
|
|
552
554
|
let U;
|
|
553
|
-
this.options.disableSessionRecording || this.options.disableNetworkRecording !== void 0 || typeof this.options.networkRecording == "boolean" ? U = !1 : U = ((
|
|
554
|
-
let
|
|
555
|
-
if (typeof this.options.networkRecording == "object" && ((
|
|
555
|
+
this.options.disableSessionRecording || this.options.disableNetworkRecording !== void 0 || typeof this.options.networkRecording == "boolean" ? U = !1 : U = ((le = this.options.networkRecording) == null ? void 0 : le.recordHeadersAndBody) || !1;
|
|
556
|
+
let fe = [];
|
|
557
|
+
if (typeof this.options.networkRecording == "object" && ((de = this.options.networkRecording.destinationDomains) != null && de.length) && (fe = this.options.networkRecording.destinationDomains), this._isCrossOriginIframe)
|
|
556
558
|
yield this._setupCrossOriginIframe();
|
|
557
559
|
else {
|
|
558
|
-
const v = yield
|
|
560
|
+
const v = yield ke(this, $).initializeSession({
|
|
559
561
|
organization_verbose_id: this.organizationID,
|
|
560
562
|
enable_strict_privacy: this.privacySetting === "strict",
|
|
561
563
|
privacy_setting: this.privacySetting,
|
|
@@ -570,13 +572,13 @@ const se = class se {
|
|
|
570
572
|
session_secure_id: this.sessionData.sessionSecureID,
|
|
571
573
|
session_key: this.sessionData.sessionKey,
|
|
572
574
|
client_id: H,
|
|
573
|
-
network_recording_domains:
|
|
575
|
+
network_recording_domains: fe,
|
|
574
576
|
disable_session_recording: this.options.disableSessionRecording
|
|
575
577
|
});
|
|
576
578
|
if (v.initializeSession.secure_id !== this.sessionData.sessionSecureID && this.logger.log(
|
|
577
579
|
`Unexpected secure id returned by initializeSession: ${v.initializeSession.secure_id}, expected ${this.sessionData.sessionSecureID}`
|
|
578
580
|
), this.sessionData.sessionSecureID = v.initializeSession.secure_id, this.sessionData.projectID = parseInt(
|
|
579
|
-
((
|
|
581
|
+
((he = v == null ? void 0 : v.initializeSession) == null ? void 0 : he.project_id) || "0"
|
|
580
582
|
), P.setConfig(v.initializeSession.sampling), !this.sessionData.projectID || !this.sessionData.sessionSecureID) {
|
|
581
583
|
O(
|
|
582
584
|
"error",
|
|
@@ -610,43 +612,43 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
610
612
|
this.options
|
|
611
613
|
) : this._firstLoadListeners.startListening(), this.pushPayloadTimerId && (clearTimeout(this.pushPayloadTimerId), this.pushPayloadTimerId = void 0), this._isCrossOriginIframe || (this.pushPayloadTimerId = setTimeout(() => {
|
|
612
614
|
this._save();
|
|
613
|
-
},
|
|
615
|
+
}, Le)), this.options.disableSessionRecording) {
|
|
614
616
|
this.logger.log(
|
|
615
617
|
"Highlight is NOT RECORDING a session replay per H.init setting."
|
|
616
618
|
), this.ready = !0, this.state = "Recording", this.manualStopped = !1;
|
|
617
619
|
return;
|
|
618
620
|
}
|
|
619
|
-
const { getDeviceDetails:
|
|
620
|
-
|
|
621
|
+
const { getDeviceDetails: me } = qt();
|
|
622
|
+
me && this.recordGauge({
|
|
621
623
|
name: N.DeviceMemory,
|
|
622
|
-
value:
|
|
624
|
+
value: me().deviceMemory,
|
|
623
625
|
category: D.Device,
|
|
624
626
|
group: window.location.href
|
|
625
627
|
});
|
|
626
|
-
const
|
|
627
|
-
|
|
628
|
+
const pe = (v, je) => {
|
|
629
|
+
je && this.logger.log("received isCheckout emit", { event: v }), this.events.push(v);
|
|
628
630
|
};
|
|
629
|
-
|
|
630
|
-
const
|
|
631
|
+
pe.bind(this);
|
|
632
|
+
const Ke = !!this._recordStop;
|
|
631
633
|
this._recordStop && (this._recordStop(), this._recordStop = void 0);
|
|
632
|
-
const [
|
|
634
|
+
const [qe, Ge] = dt(
|
|
633
635
|
this.privacySetting,
|
|
634
636
|
this.options.maskAllInputs,
|
|
635
637
|
this.options.maskInputOptions
|
|
636
638
|
);
|
|
637
639
|
this._recordStop = J({
|
|
638
|
-
ignoreClass: (
|
|
640
|
+
ignoreClass: (ge = this.options.ignoreClass) != null ? ge : "highlight-ignore",
|
|
639
641
|
ignoreSelector: this.options.ignoreSelector,
|
|
640
|
-
blockClass: (
|
|
642
|
+
blockClass: (ue = this.options.blockClass) != null ? ue : "highlight-block",
|
|
641
643
|
blockSelector: this.options.blockSelector,
|
|
642
|
-
emit:
|
|
644
|
+
emit: pe,
|
|
643
645
|
recordCrossOriginIframes: this.options.recordCrossOriginIframe,
|
|
644
|
-
privacySetting:
|
|
646
|
+
privacySetting: lt(
|
|
645
647
|
this.privacySetting,
|
|
646
648
|
this.options.maskPiiText
|
|
647
649
|
),
|
|
648
|
-
maskAllInputs:
|
|
649
|
-
maskInputOptions:
|
|
650
|
+
maskAllInputs: qe,
|
|
651
|
+
maskInputOptions: Ge,
|
|
650
652
|
maskTextClass: this.options.maskTextClass,
|
|
651
653
|
maskTextSelector: this.options.maskTextSelector,
|
|
652
654
|
recordCanvas: this.enableCanvasRecording,
|
|
@@ -667,12 +669,12 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
667
669
|
collectFonts: this.inlineImages,
|
|
668
670
|
inlineStylesheet: this.inlineStylesheet,
|
|
669
671
|
styleSheetResyncInterval: this.styleSheetResyncInterval,
|
|
670
|
-
plugins: [
|
|
672
|
+
plugins: [ct()],
|
|
671
673
|
logger: typeof this.options.debug == "boolean" && this.options.debug || typeof this.options.debug == "object" && this.options.debug.domRecording ? {
|
|
672
674
|
debug: this.logger.log,
|
|
673
675
|
warn: z
|
|
674
676
|
} : void 0
|
|
675
|
-
}),
|
|
677
|
+
}), Ke || this.options.recordCrossOriginIframe && this._setupCrossOriginIframeParent(), document.referrer && (window && document.referrer.includes(window.location.origin) || (this.addCustomEvent("Referrer", document.referrer), this.addProperties(
|
|
676
678
|
{ referrer: document.referrer },
|
|
677
679
|
{ type: "session" }
|
|
678
680
|
))), this.sessionData.sessionKey && this.addProperties(
|
|
@@ -703,23 +705,23 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
703
705
|
return t;
|
|
704
706
|
}
|
|
705
707
|
_visibilityHandler(e) {
|
|
706
|
-
return
|
|
708
|
+
return _(this, null, function* () {
|
|
707
709
|
if (this.manualStopped) {
|
|
708
710
|
this.logger.log("Ignoring visibility event due to manual stop.");
|
|
709
711
|
return;
|
|
710
712
|
}
|
|
711
|
-
(/* @__PURE__ */ new Date()).getTime() - this._lastVisibilityChangeTime <
|
|
713
|
+
(/* @__PURE__ */ new Date()).getTime() - this._lastVisibilityChangeTime < mt || (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)));
|
|
712
714
|
});
|
|
713
715
|
}
|
|
714
716
|
_setupCrossOriginIframe() {
|
|
715
|
-
return
|
|
717
|
+
return _(this, null, function* () {
|
|
716
718
|
this.logger.log("highlight in cross-origin iframe is waiting "), yield new Promise((e) => {
|
|
717
719
|
const t = (i) => {
|
|
718
|
-
if (i.data.highlight ===
|
|
720
|
+
if (i.data.highlight === Re) {
|
|
719
721
|
const n = i.data;
|
|
720
722
|
this.logger.log("highlight got window message ", n), this.sessionData.projectID = n.projectID, this.sessionData.sessionSecureID = n.sessionSecureID, window.parent.postMessage(
|
|
721
723
|
{
|
|
722
|
-
highlight:
|
|
724
|
+
highlight: De
|
|
723
725
|
},
|
|
724
726
|
"*"
|
|
725
727
|
), window.removeEventListener("message", t), e();
|
|
@@ -737,15 +739,15 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
737
739
|
var t;
|
|
738
740
|
(t = e.contentWindow) == null || t.postMessage(
|
|
739
741
|
{
|
|
740
|
-
highlight:
|
|
742
|
+
highlight: Re,
|
|
741
743
|
projectID: this.sessionData.projectID,
|
|
742
744
|
sessionSecureID: this.sessionData.sessionSecureID
|
|
743
745
|
},
|
|
744
746
|
"*"
|
|
745
747
|
);
|
|
746
748
|
});
|
|
747
|
-
},
|
|
748
|
-
e.data.highlight ===
|
|
749
|
+
}, Le), window.addEventListener("message", (e) => {
|
|
750
|
+
e.data.highlight === De && this.logger.log(
|
|
749
751
|
"highlight got response from initialized iframe"
|
|
750
752
|
);
|
|
751
753
|
});
|
|
@@ -755,7 +757,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
755
757
|
try {
|
|
756
758
|
const n = this;
|
|
757
759
|
this.enableSegmentIntegration && this.listeners.push(
|
|
758
|
-
|
|
760
|
+
Ze((r) => {
|
|
759
761
|
if (r.type === "track") {
|
|
760
762
|
const l = {};
|
|
761
763
|
l["segment-event"] = r.event, n.addProperties(l, {
|
|
@@ -775,24 +777,24 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
775
777
|
}
|
|
776
778
|
})
|
|
777
779
|
), this.listeners.push(
|
|
778
|
-
|
|
780
|
+
pt((r) => {
|
|
779
781
|
this.reloaded ? (this.addCustomEvent("Reload", r), this.reloaded = !1, n.addProperties(
|
|
780
782
|
{ reload: !0 },
|
|
781
783
|
{ type: "session" }
|
|
782
784
|
)) : this.addCustomEvent("Navigate", r);
|
|
783
785
|
})
|
|
784
786
|
), this.listeners.push(
|
|
785
|
-
|
|
787
|
+
wt(
|
|
786
788
|
(r) => {
|
|
787
789
|
this.addCustomEvent("Viewport", r), this.submitViewportMetrics(r);
|
|
788
790
|
}
|
|
789
791
|
)
|
|
790
792
|
), this.listeners.push(
|
|
791
|
-
|
|
793
|
+
et((r, l) => {
|
|
792
794
|
let d = null, c = null;
|
|
793
795
|
if (l && l.target) {
|
|
794
796
|
const g = l.target;
|
|
795
|
-
d =
|
|
797
|
+
d = Dt(g), c = g.textContent, c && c.length > 2e3 && (c = c.substring(0, 2e3));
|
|
796
798
|
}
|
|
797
799
|
this.addCustomEvent("Click", {
|
|
798
800
|
clickTarget: r,
|
|
@@ -801,11 +803,11 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
801
803
|
});
|
|
802
804
|
})
|
|
803
805
|
), this.listeners.push(
|
|
804
|
-
|
|
806
|
+
tt((r) => {
|
|
805
807
|
r && this.addCustomEvent("Focus", r);
|
|
806
808
|
})
|
|
807
809
|
), this.listeners.push(
|
|
808
|
-
|
|
810
|
+
Vt((r) => {
|
|
809
811
|
const { name: l, value: d } = r, c = [], g = (h, f) => {
|
|
810
812
|
f && c.push({ name: h, value: f });
|
|
811
813
|
};
|
|
@@ -814,7 +816,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
814
816
|
const h = r.attribution;
|
|
815
817
|
g("web_vital.element", h.element), g(
|
|
816
818
|
"web_vital.attribution.url",
|
|
817
|
-
h.url ?
|
|
819
|
+
h.url ? Gt(h.url) : void 0
|
|
818
820
|
);
|
|
819
821
|
break;
|
|
820
822
|
}
|
|
@@ -848,7 +850,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
848
850
|
});
|
|
849
851
|
})
|
|
850
852
|
), this.listeners.push(
|
|
851
|
-
|
|
853
|
+
xt(
|
|
852
854
|
(r) => {
|
|
853
855
|
const l = [];
|
|
854
856
|
r.saveData !== void 0 && l.push({
|
|
@@ -861,7 +863,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
861
863
|
name: "type",
|
|
862
864
|
value: r.type.toString()
|
|
863
865
|
}), Object.entries(r).forEach(([d, c]) => {
|
|
864
|
-
|
|
866
|
+
It(c) && this.recordGauge({
|
|
865
867
|
name: d,
|
|
866
868
|
value: c,
|
|
867
869
|
category: D.Performance,
|
|
@@ -873,14 +875,14 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
873
875
|
this._recordingStartTime
|
|
874
876
|
)
|
|
875
877
|
), this.sessionShortcut && this.listeners.push(
|
|
876
|
-
|
|
878
|
+
st(this.sessionShortcut, () => {
|
|
877
879
|
window.open(
|
|
878
880
|
this.getCurrentSessionURLWithTimestamp(),
|
|
879
881
|
"_blank"
|
|
880
882
|
);
|
|
881
883
|
})
|
|
882
884
|
), this.enablePerformanceRecording && (this.listeners.push(
|
|
883
|
-
|
|
885
|
+
At((r) => {
|
|
884
886
|
this.addCustomEvent("Performance", K(r)), Object.entries(r).filter(([l]) => l !== "relativeTimestamp").forEach(
|
|
885
887
|
([l, d]) => d && this.recordGauge({
|
|
886
888
|
name: l,
|
|
@@ -891,7 +893,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
891
893
|
);
|
|
892
894
|
}, this._recordingStartTime)
|
|
893
895
|
), this.listeners.push(
|
|
894
|
-
|
|
896
|
+
Kt((r) => {
|
|
895
897
|
this.addCustomEvent("Jank", K(r)), this.recordGauge({
|
|
896
898
|
name: "Jank",
|
|
897
899
|
value: r.jankAmount,
|
|
@@ -904,7 +906,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
904
906
|
({ visible: r }) => {
|
|
905
907
|
this._visibilityHandler(!r);
|
|
906
908
|
}
|
|
907
|
-
), this.logger.log("Set up Electron highlight.run events.")) : (
|
|
909
|
+
), this.logger.log("Set up Electron highlight.run events.")) : (it(
|
|
908
910
|
(r) => this._visibilityHandler(r)
|
|
909
911
|
), this.logger.log("Set up document visibility listener.")), this._hasPreviouslyInitialized = !0);
|
|
910
912
|
const o = () => {
|
|
@@ -973,7 +975,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
973
975
|
), !t) return;
|
|
974
976
|
this._gauges.set(e.name, t);
|
|
975
977
|
}
|
|
976
|
-
t.record(e.value, y(
|
|
978
|
+
t.record(e.value, y(w({}, (n = e.tags) == null ? void 0 : n.reduce((o, r) => y(w({}, o), { [r.name]: r.value }), {})), {
|
|
977
979
|
group: e.group,
|
|
978
980
|
category: e.category,
|
|
979
981
|
"highlight.session_id": this.sessionData.sessionSecureID
|
|
@@ -991,14 +993,14 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
991
993
|
), !t) return;
|
|
992
994
|
this._counters.set(e.name, t);
|
|
993
995
|
}
|
|
994
|
-
t.add(e.value, y(
|
|
996
|
+
t.add(e.value, y(w({}, (n = e.tags) == null ? void 0 : n.reduce((o, r) => y(w({}, o), { [r.name]: r.value }), {})), {
|
|
995
997
|
group: e.group,
|
|
996
998
|
category: e.category,
|
|
997
999
|
"highlight.session_id": this.sessionData.sessionSecureID
|
|
998
1000
|
}));
|
|
999
1001
|
}
|
|
1000
1002
|
recordIncr(e) {
|
|
1001
|
-
this.recordCount(y(
|
|
1003
|
+
this.recordCount(y(w({}, e), { value: 1 }));
|
|
1002
1004
|
}
|
|
1003
1005
|
recordHistogram(e) {
|
|
1004
1006
|
var i, n;
|
|
@@ -1010,7 +1012,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
1010
1012
|
), !t) return;
|
|
1011
1013
|
this._histograms.set(e.name, t);
|
|
1012
1014
|
}
|
|
1013
|
-
t.record(e.value, y(
|
|
1015
|
+
t.record(e.value, y(w({}, (n = e.tags) == null ? void 0 : n.reduce((o, r) => y(w({}, o), { [r.name]: r.value }), {})), {
|
|
1014
1016
|
group: e.group,
|
|
1015
1017
|
category: e.category,
|
|
1016
1018
|
"highlight.session_id": this.sessionData.sessionSecureID
|
|
@@ -1026,7 +1028,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
1026
1028
|
), !t) return;
|
|
1027
1029
|
this._up_down_counters.set(e.name, t);
|
|
1028
1030
|
}
|
|
1029
|
-
t.add(e.value, y(
|
|
1031
|
+
t.add(e.value, y(w({}, (n = e.tags) == null ? void 0 : n.reduce((o, r) => y(w({}, o), { [r.name]: r.value }), {})), {
|
|
1030
1032
|
group: e.group,
|
|
1031
1033
|
category: e.category,
|
|
1032
1034
|
"highlight.session_id": this.sessionData.sessionSecureID
|
|
@@ -1040,7 +1042,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
1040
1042
|
this.manualStopped = !!e, this.manualStopped && this.addCustomEvent(
|
|
1041
1043
|
"Stop",
|
|
1042
1044
|
"H.stop() was called which stops Highlight from recording."
|
|
1043
|
-
), this.state = "NotRecording", e && this._recordStop && (this._recordStop(), this._recordStop = void 0), this.listeners.forEach((t) => t()), this.listeners = [],
|
|
1045
|
+
), this.state = "NotRecording", e && this._recordStop && (this._recordStop(), this._recordStop = void 0), this.listeners.forEach((t) => t()), this.listeners = [], Fe();
|
|
1044
1046
|
}
|
|
1045
1047
|
getCurrentSessionTimestamp() {
|
|
1046
1048
|
return this._recordingStartTime;
|
|
@@ -1057,7 +1059,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
1057
1059
|
return e && t ? `https://${Z}/${e}/sessions/${t}` : null;
|
|
1058
1060
|
}
|
|
1059
1061
|
snapshot(e) {
|
|
1060
|
-
return
|
|
1062
|
+
return _(this, null, function* () {
|
|
1061
1063
|
yield J.snapshotCanvas(e);
|
|
1062
1064
|
});
|
|
1063
1065
|
}
|
|
@@ -1066,18 +1068,18 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
1066
1068
|
}
|
|
1067
1069
|
// Reset the events array and push to a backend.
|
|
1068
1070
|
_save() {
|
|
1069
|
-
return
|
|
1071
|
+
return _(this, null, function* () {
|
|
1070
1072
|
var e;
|
|
1071
1073
|
try {
|
|
1072
|
-
this.state === "Recording" && this.listeners && !this.sessionData.sessionKey && this.sessionData.sessionStartTime && Date.now() - this.sessionData.sessionStartTime >
|
|
1074
|
+
this.state === "Recording" && this.listeners && !this.sessionData.sessionKey && this.sessionData.sessionStartTime && Date.now() - this.sessionData.sessionStartTime > St && (this.logger.log("Resetting session", {
|
|
1073
1075
|
start: this.sessionData.sessionStartTime
|
|
1074
1076
|
}), yield this._reset({}));
|
|
1075
1077
|
let t;
|
|
1076
|
-
((e = this.options) == null ? void 0 : e.sendMode) === "local" && (t = (i) =>
|
|
1078
|
+
((e = this.options) == null ? void 0 : e.sendMode) === "local" && (t = (i) => _(this, null, function* () {
|
|
1077
1079
|
let n = new Blob(
|
|
1078
1080
|
[
|
|
1079
1081
|
JSON.stringify({
|
|
1080
|
-
query:
|
|
1082
|
+
query: kt(Ct),
|
|
1081
1083
|
variables: i
|
|
1082
1084
|
})
|
|
1083
1085
|
],
|
|
@@ -1095,7 +1097,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
1095
1097
|
}
|
|
1096
1098
|
this.state === "Recording" && (this.pushPayloadTimerId && (clearTimeout(this.pushPayloadTimerId), this.pushPayloadTimerId = void 0), this.pushPayloadTimerId = setTimeout(() => {
|
|
1097
1099
|
this._save();
|
|
1098
|
-
},
|
|
1100
|
+
}, yt));
|
|
1099
1101
|
});
|
|
1100
1102
|
}
|
|
1101
1103
|
/**
|
|
@@ -1106,13 +1108,13 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
1106
1108
|
if (this.state === "NotRecording") {
|
|
1107
1109
|
let i;
|
|
1108
1110
|
const n = () => {
|
|
1109
|
-
clearInterval(i), this.state === "Recording" && this.events.length > 0 ?
|
|
1111
|
+
clearInterval(i), this.state === "Recording" && this.events.length > 0 ? Ie(e, t) : i = setTimeout(n, 500);
|
|
1110
1112
|
};
|
|
1111
1113
|
i = setTimeout(n, 500);
|
|
1112
|
-
} else this.state === "Recording" && (this.events.length > 0 || this.hasPushedData) &&
|
|
1114
|
+
} else this.state === "Recording" && (this.events.length > 0 || this.hasPushedData) && Ie(e, t);
|
|
1113
1115
|
}
|
|
1114
1116
|
_sendPayload(t) {
|
|
1115
|
-
return
|
|
1117
|
+
return _(this, arguments, function* ({
|
|
1116
1118
|
sendFn: e
|
|
1117
1119
|
}) {
|
|
1118
1120
|
const i = I.getRecordedNetworkResources(
|
|
@@ -1120,14 +1122,14 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
1120
1122
|
this._recordingStartTime
|
|
1121
1123
|
), n = I.getRecordedWebSocketEvents(
|
|
1122
1124
|
this._firstLoadListeners
|
|
1123
|
-
), o = [...this.events], r = [...this._firstLoadListeners.messages], l = [...this._firstLoadListeners.errors], { bytes: d, time: c } = this.enableCanvasRecording ?
|
|
1125
|
+
), o = [...this.events], r = [...this._firstLoadListeners.messages], l = [...this._firstLoadListeners.errors], { bytes: d, time: c } = this.enableCanvasRecording ? Ee.canvas : Ee.normal;
|
|
1124
1126
|
this._eventBytesSinceSnapshot >= d && (/* @__PURE__ */ new Date()).getTime() - this._lastSnapshotTime >= c && this.takeFullSnapshot(), this.logger.log(
|
|
1125
1127
|
`Sending: ${o.length} events, ${r.length} messages, ${i.length} network resources, ${l.length} errors
|
|
1126
1128
|
To: ${this._backendUrl}
|
|
1127
1129
|
Org: ${this.organizationID}
|
|
1128
1130
|
SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
1129
1131
|
);
|
|
1130
|
-
const g = (/* @__PURE__ */ new Date()).getTime(), h =
|
|
1132
|
+
const g = (/* @__PURE__ */ new Date()).getTime(), h = nt();
|
|
1131
1133
|
if (e) {
|
|
1132
1134
|
const f = {
|
|
1133
1135
|
session_secure_id: this.sessionData.sessionSecureID,
|
|
@@ -1140,14 +1142,14 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
1140
1142
|
is_beacon: !1,
|
|
1141
1143
|
has_session_unloaded: this.hasSessionUnloaded,
|
|
1142
1144
|
highlight_logs: h || void 0
|
|
1143
|
-
}, { compressedBase64: m } = yield
|
|
1145
|
+
}, { compressedBase64: m } = yield rt(f);
|
|
1144
1146
|
yield e({
|
|
1145
1147
|
session_secure_id: this.sessionData.sessionSecureID,
|
|
1146
1148
|
payload_id: (/* @__PURE__ */ new Date()).getTime().toString(),
|
|
1147
1149
|
data: m
|
|
1148
1150
|
});
|
|
1149
1151
|
} else
|
|
1150
|
-
this._worker.postMessage({
|
|
1152
|
+
o.some((f) => f.type === ot.FullSnapshot) && this._snapshotPayloadIds.add(g), this._worker.postMessage({
|
|
1151
1153
|
message: {
|
|
1152
1154
|
type: L.AsyncEvents,
|
|
1153
1155
|
id: g,
|
|
@@ -1166,7 +1168,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
1166
1168
|
this._firstLoadListeners
|
|
1167
1169
|
), this.events = this.events.slice(o.length), this._firstLoadListeners.messages = this._firstLoadListeners.messages.slice(r.length), this._firstLoadListeners.errors = this._firstLoadListeners.errors.slice(
|
|
1168
1170
|
l.length
|
|
1169
|
-
),
|
|
1171
|
+
), at(h);
|
|
1170
1172
|
});
|
|
1171
1173
|
}
|
|
1172
1174
|
takeFullSnapshot() {
|
|
@@ -1180,12 +1182,12 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
1180
1182
|
}), J.takeFullSnapshot(), this._eventBytesSinceSnapshot = 0, this._lastSnapshotTime = (/* @__PURE__ */ new Date()).getTime();
|
|
1181
1183
|
}
|
|
1182
1184
|
registerLD(e) {
|
|
1183
|
-
this._integrations.length || this._integrations.push(new
|
|
1185
|
+
this._integrations.length || this._integrations.push(new Be(e));
|
|
1184
1186
|
}
|
|
1185
1187
|
};
|
|
1186
1188
|
$ = new WeakMap();
|
|
1187
1189
|
let ee = se;
|
|
1188
|
-
const
|
|
1190
|
+
const Zt = () => {
|
|
1189
1191
|
var s, e;
|
|
1190
1192
|
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
1193
|
(t, i, n) => {
|
|
@@ -1194,15 +1196,15 @@ const Qt = () => {
|
|
|
1194
1196
|
`[highlight] received '${o}' event from extension.`
|
|
1195
1197
|
), o) {
|
|
1196
1198
|
case "init": {
|
|
1197
|
-
|
|
1199
|
+
p.init(1, {
|
|
1198
1200
|
debug: !0
|
|
1199
|
-
}),
|
|
1201
|
+
}), p.getSessionURL().then((r) => {
|
|
1200
1202
|
n({ url: r });
|
|
1201
1203
|
});
|
|
1202
1204
|
break;
|
|
1203
1205
|
}
|
|
1204
1206
|
case "stop": {
|
|
1205
|
-
|
|
1207
|
+
p.stop(), n({ success: !0 });
|
|
1206
1208
|
break;
|
|
1207
1209
|
}
|
|
1208
1210
|
}
|
|
@@ -1210,7 +1212,7 @@ const Qt = () => {
|
|
|
1210
1212
|
}
|
|
1211
1213
|
));
|
|
1212
1214
|
};
|
|
1213
|
-
function
|
|
1215
|
+
function cs(s) {
|
|
1214
1216
|
var e;
|
|
1215
1217
|
s.on && ((e = s.webContents) != null && e.send) && (s.on("focus", () => {
|
|
1216
1218
|
s.webContents.send("highlight.run", { visible: !0 });
|
|
@@ -1220,7 +1222,7 @@ function rs(s) {
|
|
|
1220
1222
|
s.webContents.send("highlight.run", { visible: !1 });
|
|
1221
1223
|
}));
|
|
1222
1224
|
}
|
|
1223
|
-
const
|
|
1225
|
+
const ls = ({
|
|
1224
1226
|
next: s,
|
|
1225
1227
|
payload: e
|
|
1226
1228
|
}) => {
|
|
@@ -1237,20 +1239,20 @@ const os = ({
|
|
|
1237
1239
|
}
|
|
1238
1240
|
}
|
|
1239
1241
|
s(e);
|
|
1240
|
-
},
|
|
1242
|
+
}, xe = () => {
|
|
1241
1243
|
if (typeof window != "undefined") {
|
|
1242
1244
|
if (typeof window._highlightFetchPatch != "undefined")
|
|
1243
1245
|
return;
|
|
1244
1246
|
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;
|
|
1245
1247
|
}
|
|
1246
|
-
},
|
|
1248
|
+
}, We = () => null, Ae = () => {
|
|
1247
1249
|
if (typeof window != "undefined") {
|
|
1248
1250
|
if (typeof window._highlightWebSocketRequestCallback != "undefined")
|
|
1249
1251
|
return;
|
|
1250
|
-
window._highlightWebSocketRequestCallback =
|
|
1252
|
+
window._highlightWebSocketRequestCallback = We, window._highlightWebSocketEventCallback = We;
|
|
1251
1253
|
const s = new Proxy(window.WebSocket, {
|
|
1252
1254
|
construct(e, t) {
|
|
1253
|
-
const [, i] =
|
|
1255
|
+
const [, i] = jt(), n = new e(...t), o = (g) => {
|
|
1254
1256
|
window._highlightWebSocketRequestCallback({
|
|
1255
1257
|
socketId: i,
|
|
1256
1258
|
initiatorType: "websocket",
|
|
@@ -1289,7 +1291,7 @@ const os = ({
|
|
|
1289
1291
|
n.addEventListener("open", o), n.addEventListener("error", d), n.addEventListener("message", l), n.addEventListener("close", r);
|
|
1290
1292
|
const c = new Proxy(n.send, {
|
|
1291
1293
|
apply: function(g, h, f) {
|
|
1292
|
-
const m = f[0],
|
|
1294
|
+
const m = f[0], R = typeof m == "string" ? m : void 0;
|
|
1293
1295
|
let k;
|
|
1294
1296
|
typeof m == "string" ? k = m.length : m instanceof Blob ? k = m.size : k = m.byteLength || 0, window._highlightWebSocketEventCallback({
|
|
1295
1297
|
socketId: i,
|
|
@@ -1297,7 +1299,7 @@ const os = ({
|
|
|
1297
1299
|
name: n.url,
|
|
1298
1300
|
timeStamp: performance.timeOrigin + performance.now(),
|
|
1299
1301
|
size: k,
|
|
1300
|
-
message:
|
|
1302
|
+
message: R
|
|
1301
1303
|
}), g.apply(h, f);
|
|
1302
1304
|
}
|
|
1303
1305
|
});
|
|
@@ -1307,17 +1309,17 @@ const os = ({
|
|
|
1307
1309
|
window.WebSocket = s;
|
|
1308
1310
|
}
|
|
1309
1311
|
};
|
|
1310
|
-
var
|
|
1312
|
+
var es = /* @__PURE__ */ ((s) => (s.Device = "Device", s.WebVital = "WebVital", s.Frontend = "Frontend", s.Backend = "Backend", s))(es || {});
|
|
1311
1313
|
const b = (s, e) => {
|
|
1312
1314
|
O("warn", `highlight.run warning: (${s}): `, e);
|
|
1313
|
-
},
|
|
1314
|
-
let B = [], q, u, M,
|
|
1315
|
-
const
|
|
1315
|
+
}, ts = 200;
|
|
1316
|
+
let B = [], q, u, M, ze = [], te = !1;
|
|
1317
|
+
const p = {
|
|
1316
1318
|
options: void 0,
|
|
1317
1319
|
init: (s, e) => {
|
|
1318
1320
|
var t, i, n, o, r, l, d, c;
|
|
1319
1321
|
try {
|
|
1320
|
-
if (
|
|
1322
|
+
if (p.options = e, typeof window == "undefined" || typeof document == "undefined")
|
|
1321
1323
|
return;
|
|
1322
1324
|
if (!s) {
|
|
1323
1325
|
console.info(
|
|
@@ -1325,27 +1327,27 @@ const w = {
|
|
|
1325
1327
|
);
|
|
1326
1328
|
return;
|
|
1327
1329
|
}
|
|
1328
|
-
e != null && e.sessionCookie ?
|
|
1330
|
+
e != null && e.sessionCookie ? Et() : Me(!1);
|
|
1329
1331
|
const g = F();
|
|
1330
1332
|
let h = T();
|
|
1331
1333
|
if (e != null && e.sessionKey ? h = T(
|
|
1332
1334
|
`${s}-${e.sessionKey}`
|
|
1333
1335
|
) : g != null && g.sessionSecureID && (h = g.sessionSecureID), te)
|
|
1334
1336
|
return { sessionSecureID: h };
|
|
1335
|
-
te = !0,
|
|
1336
|
-
const f = y(
|
|
1337
|
+
te = !0, xe(), Ae();
|
|
1338
|
+
const f = y(w({}, e), {
|
|
1337
1339
|
organizationID: s,
|
|
1338
|
-
firstloadVersion:
|
|
1340
|
+
firstloadVersion: Nt,
|
|
1339
1341
|
environment: (e == null ? void 0 : e.environment) || "production",
|
|
1340
1342
|
appVersion: e == null ? void 0 : e.version,
|
|
1341
1343
|
sessionSecureID: h
|
|
1342
1344
|
});
|
|
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) &&
|
|
1345
|
+
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) && ht(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) && gt(e.integrations.amplitude), { sessionSecureID: h };
|
|
1344
1346
|
} catch (g) {
|
|
1345
1347
|
b("init", g);
|
|
1346
1348
|
}
|
|
1347
1349
|
},
|
|
1348
|
-
snapshot: (s) =>
|
|
1350
|
+
snapshot: (s) => _(void 0, null, function* () {
|
|
1349
1351
|
try {
|
|
1350
1352
|
if (u && u.ready)
|
|
1351
1353
|
return yield u.snapshot(s);
|
|
@@ -1358,7 +1360,7 @@ const w = {
|
|
|
1358
1360
|
},
|
|
1359
1361
|
consumeError: (s, e, t) => {
|
|
1360
1362
|
try {
|
|
1361
|
-
|
|
1363
|
+
p.onHighlightReady(
|
|
1362
1364
|
() => u.consumeCustomError(
|
|
1363
1365
|
s,
|
|
1364
1366
|
e,
|
|
@@ -1371,14 +1373,14 @@ const w = {
|
|
|
1371
1373
|
},
|
|
1372
1374
|
consume: (s, e) => {
|
|
1373
1375
|
try {
|
|
1374
|
-
|
|
1376
|
+
p.onHighlightReady(() => u.consumeError(s, e));
|
|
1375
1377
|
} catch (t) {
|
|
1376
1378
|
b("error", t);
|
|
1377
1379
|
}
|
|
1378
1380
|
},
|
|
1379
1381
|
error: (s, e) => {
|
|
1380
1382
|
try {
|
|
1381
|
-
|
|
1383
|
+
p.onHighlightReady(
|
|
1382
1384
|
() => u.pushCustomError(s, JSON.stringify(e))
|
|
1383
1385
|
);
|
|
1384
1386
|
} catch (t) {
|
|
@@ -1388,24 +1390,24 @@ const w = {
|
|
|
1388
1390
|
track: (s, e = {}) => {
|
|
1389
1391
|
var t, i, n, o, r, l, d, c, g, h, f;
|
|
1390
1392
|
try {
|
|
1391
|
-
|
|
1392
|
-
u.addProperties(y(
|
|
1393
|
+
p.onHighlightReady(() => {
|
|
1394
|
+
u.addProperties(y(w({}, e), { event: s })), u.log("H.track", "INFO", y(w({}, e != null ? e : {}), {
|
|
1393
1395
|
event: s
|
|
1394
1396
|
}));
|
|
1395
1397
|
});
|
|
1396
1398
|
const m = u == null ? void 0 : u.getCurrentSessionURL();
|
|
1397
|
-
(n = (i = (t =
|
|
1399
|
+
(n = (i = (t = p.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(w({}, e), {
|
|
1398
1400
|
highlightSessionURL: m
|
|
1399
|
-
})), (d = (l = (r =
|
|
1401
|
+
})), (d = (l = (r = p.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(w({}, e), {
|
|
1400
1402
|
highlightSessionURL: m
|
|
1401
|
-
})), (f = (h = (g =
|
|
1403
|
+
})), (f = (h = (g = p.options) == null ? void 0 : g.integrations) == null ? void 0 : h.intercom) != null && f.disabled || window.Intercom && window.Intercom("trackEvent", s, e);
|
|
1402
1404
|
} catch (m) {
|
|
1403
1405
|
b("track", m);
|
|
1404
1406
|
}
|
|
1405
1407
|
},
|
|
1406
1408
|
log: (s, e, t) => {
|
|
1407
1409
|
try {
|
|
1408
|
-
|
|
1410
|
+
p.onHighlightReady(
|
|
1409
1411
|
() => u.log(s, e, t != null ? t : {})
|
|
1410
1412
|
);
|
|
1411
1413
|
} catch (i) {
|
|
@@ -1416,8 +1418,8 @@ const w = {
|
|
|
1416
1418
|
var e;
|
|
1417
1419
|
(u == null ? void 0 : u.state) === "Recording" && !(s != null && s.forceNew) ? s != null && s.silent || console.warn(
|
|
1418
1420
|
"Highlight is already recording. Please `H.stop()` the current session before starting a new one."
|
|
1419
|
-
) : (((e = u == null ? void 0 : u._firstLoadListeners) != null ? e : M).startListening(),
|
|
1420
|
-
() =>
|
|
1421
|
+
) : (((e = u == null ? void 0 : u._firstLoadListeners) != null ? e : M).startListening(), p.onHighlightReady(
|
|
1422
|
+
() => _(void 0, null, function* () {
|
|
1421
1423
|
yield u.initialize(s);
|
|
1422
1424
|
}),
|
|
1423
1425
|
{ waitForReady: !1 }
|
|
@@ -1426,20 +1428,20 @@ const w = {
|
|
|
1426
1428
|
stop: (s) => {
|
|
1427
1429
|
(u == null ? void 0 : u.state) !== "Recording" ? s != null && s.silent || console.warn(
|
|
1428
1430
|
"Highlight is already stopped. Please call `H.start()`."
|
|
1429
|
-
) :
|
|
1431
|
+
) : p.onHighlightReady(() => u.stopRecording(!0));
|
|
1430
1432
|
},
|
|
1431
1433
|
identify: (s, e = {}, t) => {
|
|
1432
1434
|
var i, n, o, r, l, d, c, g;
|
|
1433
1435
|
try {
|
|
1434
|
-
|
|
1436
|
+
p.onHighlightReady(
|
|
1435
1437
|
() => u.identify(s, e, t)
|
|
1436
1438
|
);
|
|
1437
1439
|
} catch (h) {
|
|
1438
1440
|
b("identify", h);
|
|
1439
1441
|
}
|
|
1440
|
-
if ((o = (n = (i =
|
|
1442
|
+
if ((o = (n = (i = p.options) == null ? void 0 : i.integrations) == null ? void 0 : n.mixpanel) != null && o.disabled || (r = window.mixpanel) != null && r.identify && (window.mixpanel.identify(
|
|
1441
1443
|
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 =
|
|
1444
|
+
), e && (window.mixpanel.track("identify", e), window.mixpanel.people.set(e))), !((c = (d = (l = p.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)) {
|
|
1443
1445
|
const h = Object.keys(
|
|
1444
1446
|
e
|
|
1445
1447
|
).reduce((f, m) => (f.set(m, e[m]), f), new window.amplitude.Identify());
|
|
@@ -1449,16 +1451,16 @@ const w = {
|
|
|
1449
1451
|
metrics: (s) => {
|
|
1450
1452
|
try {
|
|
1451
1453
|
for (const e of s)
|
|
1452
|
-
|
|
1454
|
+
p.recordMetric(e);
|
|
1453
1455
|
} catch (e) {
|
|
1454
1456
|
b("metrics", e);
|
|
1455
1457
|
}
|
|
1456
1458
|
},
|
|
1457
1459
|
recordMetric: (s) => {
|
|
1458
1460
|
try {
|
|
1459
|
-
|
|
1461
|
+
p.onHighlightReady(() => {
|
|
1460
1462
|
var e;
|
|
1461
|
-
u.recordGauge(y(
|
|
1463
|
+
u.recordGauge(y(w({}, s), {
|
|
1462
1464
|
tags: (e = s.tags) != null ? e : [],
|
|
1463
1465
|
group: window.location.href,
|
|
1464
1466
|
category: "Frontend"
|
|
@@ -1471,7 +1473,7 @@ const w = {
|
|
|
1471
1473
|
},
|
|
1472
1474
|
recordCount: (s) => {
|
|
1473
1475
|
try {
|
|
1474
|
-
|
|
1476
|
+
p.onHighlightReady(() => {
|
|
1475
1477
|
u.recordCount(s);
|
|
1476
1478
|
});
|
|
1477
1479
|
} catch (e) {
|
|
@@ -1480,7 +1482,7 @@ const w = {
|
|
|
1480
1482
|
},
|
|
1481
1483
|
recordIncr: (s) => {
|
|
1482
1484
|
try {
|
|
1483
|
-
|
|
1485
|
+
p.onHighlightReady(() => {
|
|
1484
1486
|
u.recordIncr(s);
|
|
1485
1487
|
});
|
|
1486
1488
|
} catch (e) {
|
|
@@ -1489,7 +1491,7 @@ const w = {
|
|
|
1489
1491
|
},
|
|
1490
1492
|
recordHistogram: (s) => {
|
|
1491
1493
|
try {
|
|
1492
|
-
|
|
1494
|
+
p.onHighlightReady(() => {
|
|
1493
1495
|
u.recordHistogram(s);
|
|
1494
1496
|
});
|
|
1495
1497
|
} catch (e) {
|
|
@@ -1498,7 +1500,7 @@ const w = {
|
|
|
1498
1500
|
},
|
|
1499
1501
|
recordUpDownCounter: (s) => {
|
|
1500
1502
|
try {
|
|
1501
|
-
|
|
1503
|
+
p.onHighlightReady(() => {
|
|
1502
1504
|
u.recordUpDownCounter(s);
|
|
1503
1505
|
});
|
|
1504
1506
|
} catch (e) {
|
|
@@ -1506,9 +1508,9 @@ const w = {
|
|
|
1506
1508
|
}
|
|
1507
1509
|
},
|
|
1508
1510
|
startSpan: (s, e, t, i) => {
|
|
1509
|
-
const n =
|
|
1511
|
+
const n = He();
|
|
1510
1512
|
if (!n) {
|
|
1511
|
-
const r =
|
|
1513
|
+
const r = Ue();
|
|
1512
1514
|
return i === void 0 && t === void 0 ? e(r) : i === void 0 ? t(r) : i(r);
|
|
1513
1515
|
}
|
|
1514
1516
|
const o = (r, l) => {
|
|
@@ -1530,9 +1532,9 @@ const w = {
|
|
|
1530
1532
|
);
|
|
1531
1533
|
},
|
|
1532
1534
|
startManualSpan: (s, e, t, i) => {
|
|
1533
|
-
const n =
|
|
1535
|
+
const n = He();
|
|
1534
1536
|
if (!n) {
|
|
1535
|
-
const o =
|
|
1537
|
+
const o = Ue();
|
|
1536
1538
|
return i === void 0 && t === void 0 ? e(o) : i === void 0 ? t(o) : i(o);
|
|
1537
1539
|
}
|
|
1538
1540
|
return i === void 0 && t === void 0 ? n.startActiveSpan(s, e) : i === void 0 ? n.startActiveSpan(
|
|
@@ -1547,7 +1549,7 @@ const w = {
|
|
|
1547
1549
|
);
|
|
1548
1550
|
},
|
|
1549
1551
|
getSessionURL: () => new Promise((s, e) => {
|
|
1550
|
-
|
|
1552
|
+
p.onHighlightReady(() => {
|
|
1551
1553
|
const t = u.sessionData.sessionSecureID, i = F(t);
|
|
1552
1554
|
i ? s(
|
|
1553
1555
|
`https://${Z}/${i.projectID}/sessions/${t}`
|
|
@@ -1555,9 +1557,9 @@ const w = {
|
|
|
1555
1557
|
});
|
|
1556
1558
|
}),
|
|
1557
1559
|
getSessionDetails: () => new Promise((s, e) => {
|
|
1558
|
-
|
|
1560
|
+
p.onHighlightReady(() => _(void 0, null, function* () {
|
|
1559
1561
|
try {
|
|
1560
|
-
const t = yield
|
|
1562
|
+
const t = yield p.getSessionURL();
|
|
1561
1563
|
if (!t)
|
|
1562
1564
|
throw new Error("Could not get session URL");
|
|
1563
1565
|
const i = u.sessionData.sessionSecureID, n = F(i), o = n == null ? void 0 : n.sessionStartTime;
|
|
@@ -1594,22 +1596,22 @@ const w = {
|
|
|
1594
1596
|
return !u || ((o = n.options) == null ? void 0 : o.waitForReady) !== !1 && !u.ready ? !0 : (n.func(), !1);
|
|
1595
1597
|
}), q = void 0, B.length > 0 && (q = setTimeout(
|
|
1596
1598
|
t,
|
|
1597
|
-
|
|
1599
|
+
ts
|
|
1598
1600
|
));
|
|
1599
1601
|
};
|
|
1600
1602
|
t();
|
|
1601
1603
|
},
|
|
1602
1604
|
registerLD(s) {
|
|
1603
|
-
|
|
1605
|
+
ze.length || (p.onHighlightReady(() => {
|
|
1604
1606
|
u.registerLD(s);
|
|
1605
|
-
}),
|
|
1607
|
+
}), Lt(this, s, p.options), ze.push(new Be(s)));
|
|
1606
1608
|
}
|
|
1607
1609
|
};
|
|
1608
|
-
typeof window != "undefined" && (window.H =
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
const
|
|
1610
|
+
typeof window != "undefined" && (window.H = p);
|
|
1611
|
+
Zt();
|
|
1612
|
+
xe();
|
|
1613
|
+
Ae();
|
|
1614
|
+
const ds = {
|
|
1613
1615
|
reset: () => {
|
|
1614
1616
|
te = !1, u = void 0, B = [], q = void 0, M = void 0;
|
|
1615
1617
|
},
|
|
@@ -1619,14 +1621,14 @@ const as = {
|
|
|
1619
1621
|
};
|
|
1620
1622
|
export {
|
|
1621
1623
|
T as GenerateSecureID,
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1624
|
+
p as H,
|
|
1625
|
+
ls as HighlightSegmentMiddleware,
|
|
1626
|
+
ws as LDObserve,
|
|
1627
|
+
ys as LDRecord,
|
|
1628
|
+
es as MetricCategory,
|
|
1629
|
+
ms as Observe,
|
|
1630
|
+
us as Record,
|
|
1631
|
+
ds as __testing,
|
|
1632
|
+
cs as configureElectronHighlight
|
|
1631
1633
|
};
|
|
1632
1634
|
//# sourceMappingURL=index.js.map
|