@launchdarkly/o11y 1.3.1 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,30 +1,30 @@
1
1
  var Ge = Object.defineProperty, je = Object.defineProperties;
2
2
  var Je = Object.getOwnPropertyDescriptors;
3
3
  var V = Object.getOwnPropertySymbols;
4
- var me = Object.prototype.hasOwnProperty, pe = Object.prototype.propertyIsEnumerable;
5
- var we = (i) => {
6
- throw TypeError(i);
4
+ var me = Object.prototype.hasOwnProperty, we = Object.prototype.propertyIsEnumerable;
5
+ var pe = (s) => {
6
+ throw TypeError(s);
7
7
  };
8
- var G = (i, e, t) => e in i ? Ge(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, w = (i, e) => {
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) && G(i, t, e[t]);
10
+ me.call(e, t) && G(s, t, e[t]);
11
11
  if (V)
12
12
  for (var t of V(e))
13
- pe.call(e, t) && G(i, t, e[t]);
14
- return i;
15
- }, y = (i, e) => je(i, Je(e));
16
- var j = (i, 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 s in i)
19
- me.call(i, s) && e.indexOf(s) < 0 && (t[s] = i[s]);
20
- if (i != null && V)
21
- for (var s of V(i))
22
- e.indexOf(s) < 0 && pe.call(i, s) && (t[s] = i[s]);
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 = (i, e, t) => G(i, typeof e != "symbol" ? e + "" : e, t), Se = (i, e, t) => e.has(i) || we("Cannot " + t);
26
- var ye = (i, e, t) => (Se(i, e, "read from private field"), t ? t.call(i) : e.get(i)), be = (i, e, t) => e.has(i) ? we("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(i) : e.set(i, t), ke = (i, e, t, s) => (Se(i, e, "write to private field"), s ? s.call(i, t) : e.set(i, t), t);
27
- var _ = (i, e, t) => new Promise((s, n) => {
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,21 +37,21 @@ var _ = (i, e, t) => new Promise((s, n) => {
37
37
  } catch (c) {
38
38
  n(c);
39
39
  }
40
- }, l = (d) => d.done ? s(d.value) : Promise.resolve(d.value).then(o, r);
41
- l((t = t.apply(i, e)).next());
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 Qe, M as C, r as J, I as ve, a as _e, S as Ye, C as Xe, F as Ze, b as et, P as tt, c as Re, g as st, p as it, d as nt, e as rt, f as ot, h as at, s as ct, i as lt } from "./record-BZHDLKsW.js";
44
- import { R as ls } from "./record-BZHDLKsW.js";
45
- import { s as K, G as O, g as F, S as E, r as De, a as Q, b as dt, c as ht, d as Y, e as X, f as W, F as Ie, V as gt, P as ut, h as ft, H as Z, M as mt, i as pt, L as We, j as ze, p as wt, k as Le, l as Ce, m as St, n as yt, o as bt, q as kt, t as vt, u as _t, v as Rt, w as Dt, x as It } from "./common-BjaGmQrE.js";
46
- import { X as Lt, F as Ct, A as Et, C as Nt, E as Ot, s as Be, D as Tt, a as Pt, m as Ee, d as Me, b as Ne, c as Oe, r as Fe, e as Ht, p as Ut, f as Wt, g as zt, M as D, h as N, W as Bt, N as Mt, P as Ft, J as $t, i as x, j as A, k as Vt, l as xt, n as At, o as Te } from "./observe-D78YYNE1.js";
47
- import { O as hs } from "./observe-D78YYNE1.js";
48
- import { L as Kt, s as qt, a as T } from "./buffer-BjzLorpP.js";
49
- import { g as Pe } from "./LDObserve-DhF3vCDR.js";
50
- import { L as us } from "./LDObserve-DhF3vCDR.js";
51
- import { LDRecord as ms } from "./LDRecord.js";
52
- const Gt = (i, e, t) => {
53
- const s = window._highlightWebSocketRequestCallback;
54
- window._highlightWebSocketRequestCallback = i;
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-DG2IcHxO.js";
44
+ import { R as ds } from "./record-DG2IcHxO.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-D8kkCWo3.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-BCebRa17.js";
47
+ import { O as gs } from "./observe-BCebRa17.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
57
  const h = o, { message: r, size: l } = h, d = j(h, ["message", "size"]), g = t.some(
@@ -59,13 +59,13 @@ const Gt = (i, e, t) => {
59
59
  ) ? d : o;
60
60
  e(g);
61
61
  }, () => {
62
- window._highlightWebSocketRequestCallback = s, window._highlightWebSocketEventCallback = n;
62
+ window._highlightWebSocketRequestCallback = i, window._highlightWebSocketEventCallback = n;
63
63
  };
64
- }, jt = ({
65
- xhrCallback: i,
64
+ }, Jt = ({
65
+ xhrCallback: s,
66
66
  fetchCallback: e,
67
67
  webSocketRequestCallback: t,
68
- webSocketEventCallback: s,
68
+ webSocketEventCallback: i,
69
69
  disableWebSocketRecording: n,
70
70
  bodyKeysToRedact: o,
71
71
  highlightEndpoints: r,
@@ -74,13 +74,13 @@ const Gt = (i, e, t) => {
74
74
  bodyKeysToRecord: c
75
75
  }) => {
76
76
  const g = Lt(
77
- i,
77
+ s,
78
78
  r,
79
79
  l,
80
80
  d,
81
81
  o,
82
82
  c
83
- ), h = Ct(
83
+ ), h = Et(
84
84
  e,
85
85
  r,
86
86
  l,
@@ -88,9 +88,9 @@ const Gt = (i, e, t) => {
88
88
  o,
89
89
  c
90
90
  ), f = n ? () => {
91
- } : Gt(
91
+ } : jt(
92
92
  t,
93
- s,
93
+ i,
94
94
  d
95
95
  );
96
96
  return () => {
@@ -125,9 +125,9 @@ class I {
125
125
  a(this, "urlBlocklist");
126
126
  a(this, "highlightEndpoints");
127
127
  a(this, "requestResponseSanitizer");
128
- var t, s;
129
- this.options = e, this.disableConsoleRecording = !!e.disableConsoleRecording, this.reportConsoleErrors = (t = e.reportConsoleErrors) != null ? t : !1, this.enablePromisePatch = (s = e.enablePromisePatch) != null ? s : !1, this.consoleMethodsToRecord = e.consoleMethodsToRecord || [
130
- ...Et
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
- Nt(
140
+ Tt(
141
141
  (t) => {
142
- var s, n, o;
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 (Ne.includes(r) || Oe.some(
145
+ if (Ne.includes(r) || Te.some(
146
146
  (l) => r.includes(l)
147
147
  ))
148
148
  return;
@@ -150,7 +150,7 @@ class I {
150
150
  event: r,
151
151
  type: "console.error",
152
152
  url: window.location.href,
153
- source: (s = t.trace[0]) != null && s.fileName ? t.trace[0].fileName : "",
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,
@@ -160,7 +160,7 @@ class I {
160
160
  }
161
161
  e.messages.push(t);
162
162
  },
163
- y(w({}, Me), {
163
+ y(p({}, Me), {
164
164
  level: this.consoleMethodsToRecord,
165
165
  recordLaunchDarklySdkLogs: this.options.recordLaunchDarklySdkLogs
166
166
  })
@@ -168,8 +168,8 @@ class I {
168
168
  ), this.listeners.push(
169
169
  Ot(
170
170
  (t) => {
171
- Ne.includes(t.event) || Oe.some(
172
- (s) => t.event.includes(s)
171
+ Ne.includes(t.event) || Te.some(
172
+ (i) => t.event.includes(i)
173
173
  ) || e.errors.push(t);
174
174
  },
175
175
  { enablePromisePatch: this.enablePromisePatch }
@@ -182,10 +182,10 @@ 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, R, k, L;
186
- const s = (t == null ? void 0 : t.backendUrl) || void 0 || "https://pub.highlight.io", n = t.otlpEndpoint || "https://otel.highlight.io";
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";
187
187
  e.highlightEndpoints = [
188
- s,
188
+ i,
189
189
  `${n}/v1/traces`,
190
190
  `${n}/v1/logs`,
191
191
  `${n}/v1/metrics`
@@ -197,13 +197,13 @@ class I {
197
197
  (S) => S.toLowerCase()
198
198
  )) || [], e.urlBlocklist = [
199
199
  ...e.urlBlocklist,
200
- ...Tt
201
- ], e.requestResponseSanitizer = (R = t.networkRecording) == null ? void 0 : R.requestResponseSanitizer, e.networkHeaderKeysToRecord = (k = t.networkRecording) == null ? void 0 : k.headerKeysToRecord, e.networkHeaderKeysToRecord && (e.networkHeadersToRedact = [], e.networkHeaderKeysToRecord = e.networkHeaderKeysToRecord.map(
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(
202
202
  (S) => S.toLocaleLowerCase()
203
- )), e.networkBodyKeysToRecord = (L = t.networkRecording) == null ? void 0 : L.bodyKeysToRecord, e.networkBodyKeysToRecord && (e.networkBodyKeysToRedact = [], e.networkBodyKeysToRecord = e.networkBodyKeysToRecord.map(
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
- jt({
206
+ Jt({
207
207
  xhrCallback: (S) => {
208
208
  e.xhrNetworkContents.push(S);
209
209
  },
@@ -227,40 +227,40 @@ class I {
227
227
  }
228
228
  static getRecordedNetworkResources(e, t) {
229
229
  var o, r;
230
- let s = [], n = [];
230
+ let i = [], n = [];
231
231
  if (!e.disableNetworkRecording) {
232
232
  const l = ((o = window == null ? void 0 : window.performance) == null ? void 0 : o.timeOrigin) || 0;
233
- s = performance.getEntriesByType(
233
+ i = performance.getEntriesByType(
234
234
  "resource"
235
235
  );
236
236
  const d = (t - l) * 2;
237
- if (s = s.filter((c) => c.responseEnd < e.lastNetworkRequestTimestamp ? !1 : Pt(
237
+ if (i = i.filter((c) => c.responseEnd < e.lastNetworkRequestTimestamp ? !1 : Ht(
238
238
  c.name,
239
239
  e.highlightEndpoints
240
- )).map((c) => y(w({}, c.toJSON()), {
240
+ )).map((c) => y(p({}, c.toJSON()), {
241
241
  offsetStartTime: c.startTime - d,
242
242
  offsetResponseEnd: c.responseEnd - d,
243
243
  offsetFetchStart: c.fetchStart - d
244
- })), e.lastNetworkRequestTimestamp = ((r = s.at(-1)) == null ? void 0 : r.responseEnd) || e.lastNetworkRequestTimestamp, e.enableRecordingNetworkContents) {
244
+ })), e.lastNetworkRequestTimestamp = ((r = i.at(-1)) == null ? void 0 : r.responseEnd) || e.lastNetworkRequestTimestamp, e.enableRecordingNetworkContents) {
245
245
  const c = {
246
246
  headersToRedact: e.networkHeadersToRedact,
247
247
  headersToRecord: e.networkHeaderKeysToRecord,
248
248
  requestResponseSanitizer: e.requestResponseSanitizer
249
249
  };
250
- s = Ee(
251
- s,
250
+ i = Ee(
251
+ i,
252
252
  e.xhrNetworkContents,
253
253
  "xmlhttprequest",
254
254
  c
255
- ), s = Ee(
256
- s,
255
+ ), i = Ee(
256
+ i,
257
257
  e.fetchNetworkContents,
258
258
  "fetch",
259
259
  c
260
260
  );
261
261
  }
262
262
  }
263
- return e.disableRecordingWebSocketContents || (n = e.webSocketNetworkContents || []), [...s, ...n];
263
+ return e.disableRecordingWebSocketContents || (n = e.webSocketNetworkContents || []), [...i, ...n];
264
264
  }
265
265
  static getRecordedWebSocketEvents(e) {
266
266
  let t = [];
@@ -270,8 +270,8 @@ class I {
270
270
  e.disableNetworkRecording || (e.xhrNetworkContents = [], e.fetchNetworkContents = [], e.webSocketNetworkContents = [], e.webSocketEventContents = [], performance.clearResourceTimings());
271
271
  }
272
272
  }
273
- const z = (i, e) => {
274
- T("warn", `Highlight Warning: (${i}): `, { output: e });
273
+ const z = (s, e) => {
274
+ O("warn", `Highlight Warning: (${s}): `, { output: e });
275
275
  };
276
276
  var $;
277
277
  const se = class se {
@@ -331,24 +331,24 @@ const se = class se {
331
331
  a(this, "_up_down_counters", /* @__PURE__ */ new Map());
332
332
  a(this, "_integrations", []);
333
333
  var n, o, r, l, d;
334
- e.sessionSecureID || (e.sessionSecureID = O()), this.options = e, typeof ((n = this.options) == null ? void 0 : n.debug) == "boolean" ? this.debugOptions = this.options.debug ? { clientInteractions: !0 } : {} : this.debugOptions = (r = (o = this.options) == null ? void 0 : o.debug) != null ? r : {}, this.logger = new Kt(this.debugOptions.clientInteractions), e.debug && qt(!0), e.storageMode && (this.logger.log(
334
+ 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(
335
335
  `initializing in ${e.storageMode} session mode`
336
- ), St(e.storageMode)), ze(!!(e != null && e.sessionCookie)), this._worker = new Qe(), this._worker.onmessage = (c) => {
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
337
  var g, h, f;
338
- ((g = c.data.response) == null ? void 0 : g.type) === C.AsyncEvents ? (this._eventBytesSinceSnapshot += c.data.response.eventsSize, this.logger.log(
338
+ ((g = c.data.response) == null ? void 0 : g.type) === L.AsyncEvents ? (this._eventBytesSinceSnapshot += c.data.response.eventsSize, this.logger.log(
339
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}.
340
340
  Total since snapshot: ${(this._eventBytesSinceSnapshot / 1e6).toFixed(1)}MB`
341
- )) : ((h = c.data.response) == null ? void 0 : h.type) === C.CustomEvent ? this.addCustomEvent(
341
+ )) : ((h = c.data.response) == null ? void 0 : h.type) === L.CustomEvent ? this.addCustomEvent(
342
342
  c.data.response.tag,
343
343
  c.data.response.payload
344
- ) : ((f = c.data.response) == null ? void 0 : f.type) === C.Stop && (z(
344
+ ) : ((f = c.data.response) == null ? void 0 : f.type) === L.Stop && (z(
345
345
  "Stopping recording due to worker failure",
346
346
  c.data.response
347
347
  ), this.stopRecording(!1));
348
348
  };
349
- let s = F();
350
- if (this.reloaded = !1, !((l = this.sessionData) != null && l.sessionSecureID) && (s != null && s.sessionSecureID))
351
- this.sessionData = s, this.options.sessionSecureID = s.sessionSecureID, this.reloaded = !0, this.logger.log(
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(
352
352
  `Tab reloaded, continuing previous session: ${this.sessionData.sessionSecureID}`
353
353
  );
354
354
  else {
@@ -372,8 +372,8 @@ const se = class se {
372
372
  return new se(e);
373
373
  }
374
374
  // Start a new session
375
- _reset(s) {
376
- return _(this, arguments, function* ({
375
+ _reset(i) {
376
+ return R(this, arguments, function* ({
377
377
  forceNew: e,
378
378
  sessionKey: t
379
379
  }) {
@@ -390,12 +390,12 @@ const se = class se {
390
390
  }
391
391
  for (const r of Object.values(E))
392
392
  De(r);
393
- this.sessionData.sessionSecureID = t ? O(`${this.organizationID}-${t}`) : O(), this.sessionData.sessionKey = t, this.sessionData.sessionStartTime = Date.now(), this.options.sessionSecureID = this.sessionData.sessionSecureID, this.stopRecording(), this._firstLoadListeners.stopListening(), this._firstLoadListeners = new I(this.options), yield this.initialize(), n && o && this.identify(n, o);
393
+ 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
394
  });
395
395
  }
396
396
  _initMembers(e) {
397
- var o, r, l, d, c, g, h, f, m, R, 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 = w({
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({
399
399
  canvasFactor: 0.5,
400
400
  canvasMaxSnapshotDimension: 360,
401
401
  canvasClearWebGLBuffer: !0,
@@ -403,19 +403,19 @@ const se = class se {
403
403
  }, (f = e.samplingStrategy) != null ? f : {
404
404
  canvas: 2
405
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 bt(`${this._backendUrl}`, {
406
+ const t = new kt(`${this._backendUrl}`, {
407
407
  headers: {}
408
408
  });
409
- ke(this, $, ht(t, yt())), this.environment = (R = e.environment) != null ? R : "production", this.appVersion = e.appVersion, this.serviceName = (k = e.serviceName) != null ? k : "", typeof e.organizationID == "string" ? this.organizationID = e.organizationID : this.organizationID = e.organizationID.toString(), this.isRunningOnHighlight = this.organizationID === "1" || this.organizationID === "1jdkoe52", this.firstloadVersion = e.firstloadVersion || "unknown", this.sessionShortcut = e.sessionShortcut || !1, this._onToggleFeedbackFormVisibility = () => {
409
+ 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 = () => {
410
410
  };
411
- const L = e, { firstloadVersion: s } = L, n = j(L, ["firstloadVersion"]);
411
+ const C = e, { firstloadVersion: i } = C, n = j(C, ["firstloadVersion"]);
412
412
  this._optionsInternal = n, this.listeners = [], this.events = [], this.hasSessionUnloaded = !1, this.hasPushedData = !1, window.Intercom && window.Intercom("onShow", () => {
413
413
  window.Intercom("update", {
414
414
  highlightSessionURL: this.getCurrentSessionURLWithTimestamp()
415
415
  }), this.addProperties({ event: "Intercom onShow" });
416
416
  }), this._eventBytesSinceSnapshot = 0, this._lastSnapshotTime = (/* @__PURE__ */ new Date()).getTime(), this._lastVisibilityChangeTime = (/* @__PURE__ */ new Date()).getTime();
417
417
  }
418
- identify(e, t = {}, s) {
418
+ identify(e, t = {}, i) {
419
419
  if (!e || e === "") {
420
420
  console.warn(
421
421
  "Highlight's identify() call was passed an empty identifier.",
@@ -428,10 +428,10 @@ const se = class se {
428
428
  e.toString()
429
429
  ), Y(E.USER_OBJECT, JSON.stringify(t)), this._worker.postMessage({
430
430
  message: {
431
- type: C.Identify,
431
+ type: L.Identify,
432
432
  userIdentifier: e,
433
433
  userObject: t,
434
- source: s
434
+ source: i
435
435
  }
436
436
  });
437
437
  for (const n of this._integrations)
@@ -439,22 +439,22 @@ const se = class se {
439
439
  this.sessionData.sessionSecureID,
440
440
  e,
441
441
  t,
442
- s
442
+ i
443
443
  );
444
444
  }
445
- log(e, t, s) {
445
+ log(e, t, i) {
446
446
  this._firstLoadListeners.messages.push(
447
- Ht(t, Me, e, s)
447
+ Ut(t, Me, e, i)
448
448
  );
449
449
  }
450
450
  pushCustomError(e, t) {
451
451
  return this.consumeCustomError(new Error(e), void 0, t);
452
452
  }
453
- consumeCustomError(e, t, s) {
453
+ consumeCustomError(e, t, i) {
454
454
  let n = {};
455
- if (s)
455
+ if (i)
456
456
  try {
457
- n = w(w({}, JSON.parse(s)), n);
457
+ n = p(p({}, JSON.parse(i)), n);
458
458
  } catch (o) {
459
459
  }
460
460
  return this.consumeError(e, {
@@ -464,15 +464,15 @@ const se = class se {
464
464
  }
465
465
  consumeError(e, {
466
466
  message: t,
467
- payload: s,
467
+ payload: i,
468
468
  source: n,
469
469
  type: o
470
470
  }) {
471
471
  var c, g, h, f;
472
- e.cause && (s = y(w({}, s), { "exception.cause": e.cause }));
472
+ e.cause && (i = y(p({}, i), { "exception.cause": e.cause }));
473
473
  let r = t ? t + ":" + e.message : e.message;
474
474
  o === "React.ErrorBoundary" && (r = "ErrorBoundary: " + r);
475
- const l = Ut(e), d = {
475
+ const l = Wt(e), d = {
476
476
  event: r,
477
477
  type: o != null ? o : "custom",
478
478
  url: window.location.href,
@@ -481,7 +481,7 @@ const se = class se {
481
481
  columnNumber: (h = l[0]) != null && h.columnNumber ? (f = l[0]) == null ? void 0 : f.columnNumber : 0,
482
482
  stackTrace: l,
483
483
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
484
- payload: JSON.stringify(s),
484
+ payload: JSON.stringify(i),
485
485
  id: Fe()
486
486
  };
487
487
  this._firstLoadListeners.errors.push(d);
@@ -489,30 +489,30 @@ const se = class se {
489
489
  m.error(this.sessionData.sessionSecureID, d);
490
490
  }
491
491
  addProperties(e = {}, t) {
492
- const s = w({}, e);
493
- Object.entries(s).forEach(([n, o]) => {
492
+ const i = p({}, e);
493
+ Object.entries(i).forEach(([n, o]) => {
494
494
  try {
495
495
  structuredClone(o);
496
496
  } catch (r) {
497
- delete s[n];
497
+ delete i[n];
498
498
  }
499
499
  }), this._worker.postMessage({
500
500
  message: {
501
- type: C.Properties,
502
- propertiesObject: s,
501
+ type: L.Properties,
502
+ propertiesObject: i,
503
503
  propertyType: t
504
504
  }
505
505
  });
506
506
  for (const n of this._integrations)
507
- n.track(this.sessionData.sessionSecureID, w({
507
+ n.track(this.sessionData.sessionSecureID, p({
508
508
  sessionSecureID: this.sessionData.sessionSecureID,
509
509
  propertyType: t
510
510
  }, e));
511
511
  }
512
512
  initialize(e) {
513
- return _(this, null, function* () {
514
- var t, s, n, o, r, l, d, c, g, h, f, m, R, k, L, S, ie, ne, re, oe, ae, ce, le, de, he;
515
- if (navigator != null && navigator.webdriver && !window.Cypress || (t = navigator == null ? void 0 : navigator.userAgent) != null && t.includes("Googlebot") || (s = navigator == null ? void 0 : navigator.userAgent) != null && s.includes("AdsBot")) {
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")) {
516
516
  (n = this._firstLoadListeners) == null || n.stopListening();
517
517
  return;
518
518
  }
@@ -522,11 +522,11 @@ const se = class se {
522
522
  return;
523
523
  }
524
524
  if (e != null && e.sessionKey && (e == null ? void 0 : e.sessionKey) !== this.sessionData.sessionKey) {
525
- yield this._reset(y(w({}, e), { forceNew: !0 }));
525
+ yield this._reset(y(p({}, e), { forceNew: !0 }));
526
526
  return;
527
527
  }
528
- const P = new zt();
529
- Wt(
528
+ const P = new Bt();
529
+ zt(
530
530
  {
531
531
  backendUrl: (r = (o = this.options) == null ? void 0 : o.backendUrl) != null ? r : "https://pub.highlight.io",
532
532
  otlpEndpoint: (d = (l = this.options) == null ? void 0 : l.otlpEndpoint) != null ? d : "https://otel.highlight.io",
@@ -534,8 +534,8 @@ const se = class se {
534
534
  sessionSecureId: (g = this.options) == null ? void 0 : g.sessionSecureID,
535
535
  environment: (f = (h = this.options) == null ? void 0 : h.environment) != null ? f : "production",
536
536
  networkRecordingOptions: typeof ((m = this.options) == null ? void 0 : m.networkRecording) == "object" ? this.options.networkRecording : void 0,
537
- tracingOrigins: (R = this.options) == null ? void 0 : R.tracingOrigins,
538
- serviceName: (L = (k = this.options) == null ? void 0 : k.serviceName) != null ? L : "highlight-browser",
537
+ tracingOrigins: (_ = this.options) == null ? void 0 : _.tracingOrigins,
538
+ serviceName: (C = (k = this.options) == null ? void 0 : k.serviceName) != null ? C : "highlight-browser",
539
539
  instrumentations: (ie = (S = this.options) == null ? void 0 : S.otel) == null ? void 0 : ie.instrumentations,
540
540
  getIntegrations: () => [...this._integrations],
541
541
  productAnalyticsEvents: this._productAnalyticsEvents()
@@ -547,8 +547,8 @@ const se = class se {
547
547
  this.sessionData,
548
548
  this.options
549
549
  ), this.sessionData = (ne = F(this.sessionData.sessionSecureID)) != null ? ne : this.sessionData, (re = this.sessionData) != null && re.sessionStartTime ? this._recordingStartTime = (oe = this.sessionData) == null ? void 0 : oe.sessionStartTime : (this._recordingStartTime = (/* @__PURE__ */ new Date()).getTime(), this.sessionData.sessionStartTime = this._recordingStartTime), X(""), W(this.sessionData);
550
- let H = Q(Ce.CLIENT_ID);
551
- H || (H = O(), Y(Ce.CLIENT_ID, H));
550
+ let H = Q(Le.CLIENT_ID);
551
+ H || (H = T(), Y(Le.CLIENT_ID, H));
552
552
  let U;
553
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
554
  let ge = [];
@@ -578,7 +578,7 @@ const se = class se {
578
578
  ), this.sessionData.sessionSecureID = v.initializeSession.secure_id, this.sessionData.projectID = parseInt(
579
579
  ((le = v == null ? void 0 : v.initializeSession) == null ? void 0 : le.project_id) || "0"
580
580
  ), P.setConfig(v.initializeSession.sampling), !this.sessionData.projectID || !this.sessionData.sessionSecureID) {
581
- T(
581
+ O(
582
582
  "error",
583
583
  "Failed to initialize Highlight; an error occurred on our end.",
584
584
  this.sessionData
@@ -593,7 +593,7 @@ Project ID: ${this.sessionData.projectID}
593
593
  SessionSecureID: ${this.sessionData.sessionSecureID}`
594
594
  ), this.options.sessionSecureID = this.sessionData.sessionSecureID, this._worker.postMessage({
595
595
  message: {
596
- type: C.Initialize,
596
+ type: L.Initialize,
597
597
  sessionSecureID: this.sessionData.sessionSecureID,
598
598
  backend: this._backendUrl,
599
599
  debug: !!this.debugOptions.clientInteractions,
@@ -616,7 +616,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
616
616
  ), this.ready = !0, this.state = "Recording", this.manualStopped = !1;
617
617
  return;
618
618
  }
619
- const { getDeviceDetails: ue } = Vt();
619
+ const { getDeviceDetails: ue } = xt();
620
620
  ue && this.recordGauge({
621
621
  name: N.DeviceMemory,
622
622
  value: ue().deviceMemory,
@@ -682,13 +682,13 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
682
682
  { type: "session" }
683
683
  ), this._setupWindowListeners(), this.ready = !0, this.state = "Recording", this.manualStopped = !1;
684
684
  } catch (P) {
685
- this._isOnLocalHost && (T("error", P), z("initializeSession", P));
685
+ this._isOnLocalHost && (O("error", P), z("initializeSession", P));
686
686
  }
687
687
  });
688
688
  }
689
689
  _productAnalyticsEvents() {
690
- var s;
691
- const e = (s = this.options) == null ? void 0 : s.productAnalytics;
690
+ var i;
691
+ const e = (i = this.options) == null ? void 0 : i.productAnalytics;
692
692
  if (e === !1)
693
693
  return {};
694
694
  const t = {
@@ -703,7 +703,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
703
703
  return t;
704
704
  }
705
705
  _visibilityHandler(e) {
706
- return _(this, null, function* () {
706
+ return R(this, null, function* () {
707
707
  if (this.manualStopped) {
708
708
  this.logger.log("Ignoring visibility event due to manual stop.");
709
709
  return;
@@ -712,14 +712,14 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
712
712
  });
713
713
  }
714
714
  _setupCrossOriginIframe() {
715
- return _(this, null, function* () {
715
+ return R(this, null, function* () {
716
716
  this.logger.log("highlight in cross-origin iframe is waiting "), yield new Promise((e) => {
717
- const t = (s) => {
718
- if (s.data.highlight === ve) {
719
- const n = s.data;
717
+ const t = (i) => {
718
+ if (i.data.highlight === ve) {
719
+ const n = i.data;
720
720
  this.logger.log("highlight got window message ", n), this.sessionData.projectID = n.projectID, this.sessionData.sessionSecureID = n.sessionSecureID, window.parent.postMessage(
721
721
  {
722
- highlight: _e
722
+ highlight: Re
723
723
  },
724
724
  "*"
725
725
  ), window.removeEventListener("message", t), e();
@@ -745,13 +745,13 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
745
745
  );
746
746
  });
747
747
  }, Ie), window.addEventListener("message", (e) => {
748
- e.data.highlight === _e && this.logger.log(
748
+ e.data.highlight === Re && this.logger.log(
749
749
  "highlight got response from initialized iframe"
750
750
  );
751
751
  });
752
752
  }
753
753
  _setupWindowListeners() {
754
- var s;
754
+ var i;
755
755
  try {
756
756
  const n = this;
757
757
  this.enableSegmentIntegration && this.listeners.push(
@@ -792,7 +792,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
792
792
  let d = null, c = null;
793
793
  if (l && l.target) {
794
794
  const g = l.target;
795
- d = kt(g), c = g.textContent, c && c.length > 2e3 && (c = c.substring(0, 2e3));
795
+ d = vt(g), c = g.textContent, c && c.length > 2e3 && (c = c.substring(0, 2e3));
796
796
  }
797
797
  this.addCustomEvent("Click", {
798
798
  clickTarget: r,
@@ -805,7 +805,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
805
805
  r && this.addCustomEvent("Focus", r);
806
806
  })
807
807
  ), this.listeners.push(
808
- Bt((r) => {
808
+ Mt((r) => {
809
809
  const { name: l, value: d } = r, c = [], g = (h, f) => {
810
810
  f && c.push({ name: h, value: f });
811
811
  };
@@ -814,7 +814,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
814
814
  const h = r.attribution;
815
815
  g("web_vital.element", h.element), g(
816
816
  "web_vital.attribution.url",
817
- h.url ? xt(h.url) : void 0
817
+ h.url ? At(h.url) : void 0
818
818
  );
819
819
  break;
820
820
  }
@@ -848,7 +848,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
848
848
  });
849
849
  })
850
850
  ), this.listeners.push(
851
- Mt(
851
+ Ft(
852
852
  (r) => {
853
853
  const l = [];
854
854
  r.saveData !== void 0 && l.push({
@@ -861,7 +861,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
861
861
  name: "type",
862
862
  value: r.type.toString()
863
863
  }), Object.entries(r).forEach(([d, c]) => {
864
- vt(c) && this.recordGauge({
864
+ Rt(c) && this.recordGauge({
865
865
  name: d,
866
866
  value: c,
867
867
  category: D.Performance,
@@ -880,7 +880,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
880
880
  );
881
881
  })
882
882
  ), this.enablePerformanceRecording && (this.listeners.push(
883
- Ft((r) => {
883
+ $t((r) => {
884
884
  this.addCustomEvent("Performance", K(r)), Object.entries(r).filter(([l]) => l !== "relativeTimestamp").forEach(
885
885
  ([l, d]) => d && this.recordGauge({
886
886
  name: l,
@@ -891,7 +891,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
891
891
  );
892
892
  }, this._recordingStartTime)
893
893
  ), this.listeners.push(
894
- $t((r) => {
894
+ Vt((r) => {
895
895
  this.addCustomEvent("Jank", K(r)), this.recordGauge({
896
896
  name: "Jank",
897
897
  value: r.jankAmount,
@@ -899,7 +899,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
899
899
  group: r.querySelector
900
900
  });
901
901
  }, this._recordingStartTime)
902
- )), this._hasPreviouslyInitialized || ((s = window.electron) != null && s.ipcRenderer ? (window.electron.ipcRenderer.on(
902
+ )), this._hasPreviouslyInitialized || ((i = window.electron) != null && i.ipcRenderer ? (window.electron.ipcRenderer.on(
903
903
  "highlight.run",
904
904
  ({ visible: r }) => {
905
905
  this._visibilityHandler(!r);
@@ -914,7 +914,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
914
914
  () => window.removeEventListener("beforeunload", o)
915
915
  );
916
916
  } catch (n) {
917
- this._isOnLocalHost && (T("error", n), z("initializeSession _setupWindowListeners", n));
917
+ this._isOnLocalHost && (O("error", n), z("initializeSession _setupWindowListeners", n));
918
918
  }
919
919
  const e = () => {
920
920
  this.addCustomEvent("Page Unload", ""), X(this.sessionData.sessionSecureID), W(this.sessionData);
@@ -933,7 +933,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
933
933
  submitViewportMetrics({
934
934
  height: e,
935
935
  width: t,
936
- availHeight: s,
936
+ availHeight: i,
937
937
  availWidth: n
938
938
  }) {
939
939
  this.recordGauge({
@@ -948,7 +948,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
948
948
  group: window.location.href
949
949
  }), this.recordGauge({
950
950
  name: N.ScreenHeight,
951
- value: s,
951
+ value: i,
952
952
  category: D.Device,
953
953
  group: window.location.href
954
954
  }), this.recordGauge({
@@ -964,16 +964,16 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
964
964
  });
965
965
  }
966
966
  recordGauge(e) {
967
- var s, n;
967
+ var i, n;
968
968
  let t = this._gauges.get(e.name);
969
969
  if (!t) {
970
- if (t = (s = x()) == null ? void 0 : s.createGauge(
970
+ if (t = (i = x()) == null ? void 0 : i.createGauge(
971
971
  e.name,
972
972
  A(e.name, e.unit)
973
973
  ), !t) return;
974
974
  this._gauges.set(e.name, t);
975
975
  }
976
- t.record(e.value, y(w({}, (n = e.tags) == null ? void 0 : n.reduce((o, r) => y(w({}, o), { [r.name]: r.value }), {})), {
976
+ t.record(e.value, y(p({}, (n = e.tags) == null ? void 0 : n.reduce((o, r) => y(p({}, o), { [r.name]: r.value }), {})), {
977
977
  group: e.group,
978
978
  category: e.category,
979
979
  "highlight.session_id": this.sessionData.sessionSecureID
@@ -982,51 +982,51 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
982
982
  o.recordGauge(this.sessionData.sessionSecureID, e);
983
983
  }
984
984
  recordCount(e) {
985
- var s, n;
985
+ var i, n;
986
986
  let t = this._counters.get(e.name);
987
987
  if (!t) {
988
- if (t = (s = x()) == null ? void 0 : s.createCounter(
988
+ if (t = (i = x()) == null ? void 0 : i.createCounter(
989
989
  e.name,
990
990
  A(e.name, e.unit)
991
991
  ), !t) return;
992
992
  this._counters.set(e.name, t);
993
993
  }
994
- t.add(e.value, y(w({}, (n = e.tags) == null ? void 0 : n.reduce((o, r) => y(w({}, o), { [r.name]: r.value }), {})), {
994
+ t.add(e.value, y(p({}, (n = e.tags) == null ? void 0 : n.reduce((o, r) => y(p({}, o), { [r.name]: r.value }), {})), {
995
995
  group: e.group,
996
996
  category: e.category,
997
997
  "highlight.session_id": this.sessionData.sessionSecureID
998
998
  }));
999
999
  }
1000
1000
  recordIncr(e) {
1001
- this.recordCount(y(w({}, e), { value: 1 }));
1001
+ this.recordCount(y(p({}, e), { value: 1 }));
1002
1002
  }
1003
1003
  recordHistogram(e) {
1004
- var s, n;
1004
+ var i, n;
1005
1005
  let t = this._histograms.get(e.name);
1006
1006
  if (!t) {
1007
- if (t = (s = x()) == null ? void 0 : s.createHistogram(
1007
+ if (t = (i = x()) == null ? void 0 : i.createHistogram(
1008
1008
  e.name,
1009
1009
  A(e.name, e.unit)
1010
1010
  ), !t) return;
1011
1011
  this._histograms.set(e.name, t);
1012
1012
  }
1013
- t.record(e.value, y(w({}, (n = e.tags) == null ? void 0 : n.reduce((o, r) => y(w({}, o), { [r.name]: r.value }), {})), {
1013
+ t.record(e.value, y(p({}, (n = e.tags) == null ? void 0 : n.reduce((o, r) => y(p({}, o), { [r.name]: r.value }), {})), {
1014
1014
  group: e.group,
1015
1015
  category: e.category,
1016
1016
  "highlight.session_id": this.sessionData.sessionSecureID
1017
1017
  }));
1018
1018
  }
1019
1019
  recordUpDownCounter(e) {
1020
- var s, n;
1020
+ var i, n;
1021
1021
  let t = this._up_down_counters.get(e.name);
1022
1022
  if (!t) {
1023
- if (t = (s = x()) == null ? void 0 : s.createUpDownCounter(
1023
+ if (t = (i = x()) == null ? void 0 : i.createUpDownCounter(
1024
1024
  e.name,
1025
1025
  A(e.name, e.unit)
1026
1026
  ), !t) return;
1027
1027
  this._up_down_counters.set(e.name, t);
1028
1028
  }
1029
- t.add(e.value, y(w({}, (n = e.tags) == null ? void 0 : n.reduce((o, r) => y(w({}, o), { [r.name]: r.value }), {})), {
1029
+ t.add(e.value, y(p({}, (n = e.tags) == null ? void 0 : n.reduce((o, r) => y(p({}, o), { [r.name]: r.value }), {})), {
1030
1030
  group: e.group,
1031
1031
  category: e.category,
1032
1032
  "highlight.session_id": this.sessionData.sessionSecureID
@@ -1049,50 +1049,36 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
1049
1049
  * Returns the current timestamp for the current session.
1050
1050
  */
1051
1051
  getCurrentSessionURLWithTimestamp() {
1052
- const e = (/* @__PURE__ */ new Date()).getTime(), { projectID: t, sessionSecureID: s } = this.sessionData, n = (e - this._recordingStartTime) / 1e3;
1053
- return `https://${Z}/${t}/sessions/${s}?ts=${n}`;
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}`;
1054
1054
  }
1055
1055
  getCurrentSessionURL() {
1056
1056
  const e = this.sessionData.projectID, t = this.sessionData.sessionSecureID;
1057
1057
  return e && t ? `https://${Z}/${e}/sessions/${t}` : null;
1058
1058
  }
1059
1059
  snapshot(e) {
1060
- return _(this, null, function* () {
1060
+ return R(this, null, function* () {
1061
1061
  yield J.snapshotCanvas(e);
1062
1062
  });
1063
1063
  }
1064
- addSessionFeedback({
1065
- timestamp: e,
1066
- verbatim: t,
1067
- user_email: s,
1068
- user_name: n
1069
- }) {
1070
- var o;
1071
- this._worker.postMessage({
1072
- message: {
1073
- type: C.Feedback,
1074
- verbatim: t,
1075
- timestamp: e,
1076
- userName: n || this.sessionData.userIdentifier,
1077
- userEmail: s || ((o = this.sessionData.userObject) == null ? void 0 : o.name)
1078
- }
1079
- });
1064
+ /** @deprecated Session feedback is no longer supported. This is a no-op. */
1065
+ addSessionFeedback(e) {
1080
1066
  }
1081
1067
  // Reset the events array and push to a backend.
1082
1068
  _save() {
1083
- return _(this, null, function* () {
1069
+ return R(this, null, function* () {
1084
1070
  var e;
1085
1071
  try {
1086
1072
  this.state === "Recording" && this.listeners && !this.sessionData.sessionKey && this.sessionData.sessionStartTime && Date.now() - this.sessionData.sessionStartTime > mt && (this.logger.log("Resetting session", {
1087
1073
  start: this.sessionData.sessionStartTime
1088
1074
  }), yield this._reset({}));
1089
1075
  let t;
1090
- ((e = this.options) == null ? void 0 : e.sendMode) === "local" && (t = (s) => _(this, null, function* () {
1076
+ ((e = this.options) == null ? void 0 : e.sendMode) === "local" && (t = (i) => R(this, null, function* () {
1091
1077
  let n = new Blob(
1092
1078
  [
1093
1079
  JSON.stringify({
1094
- query: wt(_t),
1095
- variables: s
1080
+ query: St(_t),
1081
+ variables: i
1096
1082
  })
1097
1083
  ],
1098
1084
  {
@@ -1105,11 +1091,11 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
1105
1091
  }), 0;
1106
1092
  })), yield this._sendPayload({ sendFn: t }), this.hasPushedData = !0, this.sessionData.lastPushTime = Date.now(), W(this.sessionData);
1107
1093
  } catch (t) {
1108
- this._isOnLocalHost && (T("error", t), z("_save", t));
1094
+ this._isOnLocalHost && (O("error", t), z("_save", t));
1109
1095
  }
1110
1096
  this.state === "Recording" && (this.pushPayloadTimerId && (clearTimeout(this.pushPayloadTimerId), this.pushPayloadTimerId = void 0), this.pushPayloadTimerId = setTimeout(() => {
1111
1097
  this._save();
1112
- }, pt));
1098
+ }, wt));
1113
1099
  });
1114
1100
  }
1115
1101
  /**
@@ -1118,25 +1104,25 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
1118
1104
  */
1119
1105
  addCustomEvent(e, t) {
1120
1106
  if (this.state === "NotRecording") {
1121
- let s;
1107
+ let i;
1122
1108
  const n = () => {
1123
- clearInterval(s), this.state === "Recording" && this.events.length > 0 ? Re(e, t) : s = setTimeout(n, 500);
1109
+ clearInterval(i), this.state === "Recording" && this.events.length > 0 ? _e(e, t) : i = setTimeout(n, 500);
1124
1110
  };
1125
- s = setTimeout(n, 500);
1126
- } else this.state === "Recording" && (this.events.length > 0 || this.hasPushedData) && Re(e, t);
1111
+ i = setTimeout(n, 500);
1112
+ } else this.state === "Recording" && (this.events.length > 0 || this.hasPushedData) && _e(e, t);
1127
1113
  }
1128
1114
  _sendPayload(t) {
1129
- return _(this, arguments, function* ({
1115
+ return R(this, arguments, function* ({
1130
1116
  sendFn: e
1131
1117
  }) {
1132
- const s = I.getRecordedNetworkResources(
1118
+ const i = I.getRecordedNetworkResources(
1133
1119
  this._firstLoadListeners,
1134
1120
  this._recordingStartTime
1135
1121
  ), n = I.getRecordedWebSocketEvents(
1136
1122
  this._firstLoadListeners
1137
- ), o = [...this.events], r = [...this._firstLoadListeners.messages], l = [...this._firstLoadListeners.errors], { bytes: d, time: c } = this.enableCanvasRecording ? Le.canvas : Le.normal;
1123
+ ), o = [...this.events], r = [...this._firstLoadListeners.messages], l = [...this._firstLoadListeners.errors], { bytes: d, time: c } = this.enableCanvasRecording ? Ce.canvas : Ce.normal;
1138
1124
  this._eventBytesSinceSnapshot >= d && (/* @__PURE__ */ new Date()).getTime() - this._lastSnapshotTime >= c && this.takeFullSnapshot(), this.logger.log(
1139
- `Sending: ${o.length} events, ${r.length} messages, ${s.length} network resources, ${l.length} errors
1125
+ `Sending: ${o.length} events, ${r.length} messages, ${i.length} network resources, ${l.length} errors
1140
1126
  To: ${this._backendUrl}
1141
1127
  Org: ${this.organizationID}
1142
1128
  SessionSecureID: ${this.sessionData.sessionSecureID}`
@@ -1148,7 +1134,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
1148
1134
  payload_id: g.toString(),
1149
1135
  events: { events: o },
1150
1136
  messages: K({ messages: r }),
1151
- resources: JSON.stringify({ resources: s }),
1137
+ resources: JSON.stringify({ resources: i }),
1152
1138
  web_socket_events: JSON.stringify({ webSocketEvents: n }),
1153
1139
  errors: l,
1154
1140
  is_beacon: !1,
@@ -1163,12 +1149,12 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
1163
1149
  } else
1164
1150
  this._worker.postMessage({
1165
1151
  message: {
1166
- type: C.AsyncEvents,
1152
+ type: L.AsyncEvents,
1167
1153
  id: g,
1168
1154
  events: o,
1169
1155
  messages: r,
1170
1156
  errors: l,
1171
- resourcesString: JSON.stringify({ resources: s }),
1157
+ resourcesString: JSON.stringify({ resources: i }),
1172
1158
  webSocketEventsString: JSON.stringify({
1173
1159
  webSocketEvents: n
1174
1160
  }),
@@ -1199,24 +1185,24 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
1199
1185
  };
1200
1186
  $ = new WeakMap();
1201
1187
  let ee = se;
1202
- const Jt = () => {
1203
- var i, e;
1204
- typeof chrome != "undefined" && ((i = chrome == null ? void 0 : chrome.runtime) != null && i.onMessage) && ((e = chrome == null ? void 0 : chrome.runtime) == null || e.onMessage.addListener(
1205
- (t, s, n) => {
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) => {
1206
1192
  const o = t.action;
1207
1193
  switch (console.log(
1208
1194
  `[highlight] received '${o}' event from extension.`
1209
1195
  ), o) {
1210
1196
  case "init": {
1211
- p.init(1, {
1197
+ w.init(1, {
1212
1198
  debug: !0
1213
- }), p.getSessionURL().then((r) => {
1199
+ }), w.getSessionURL().then((r) => {
1214
1200
  n({ url: r });
1215
1201
  });
1216
1202
  break;
1217
1203
  }
1218
1204
  case "stop": {
1219
- p.stop(), n({ success: !0 });
1205
+ w.stop(), n({ success: !0 });
1220
1206
  break;
1221
1207
  }
1222
1208
  }
@@ -1224,49 +1210,49 @@ const Jt = () => {
1224
1210
  }
1225
1211
  ));
1226
1212
  };
1227
- function ns(i) {
1213
+ function rs(s) {
1228
1214
  var e;
1229
- i.on && ((e = i.webContents) != null && e.send) && (i.on("focus", () => {
1230
- i.webContents.send("highlight.run", { visible: !0 });
1231
- }), i.on("blur", () => {
1232
- i.webContents.send("highlight.run", { visible: !1 });
1233
- }), i.on("close", () => {
1234
- i.webContents.send("highlight.run", { visible: !1 });
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 });
1235
1221
  }));
1236
1222
  }
1237
- const rs = ({
1238
- next: i,
1223
+ const os = ({
1224
+ next: s,
1239
1225
  payload: e
1240
1226
  }) => {
1241
1227
  if (typeof window != "undefined" && typeof document != "undefined" && "H" in window) {
1242
1228
  if (e.obj.type === "track") {
1243
- const t = e.obj.event, s = e.obj.properties;
1244
- window.H.track(t, s);
1229
+ const t = e.obj.event, i = e.obj.properties;
1230
+ window.H.track(t, i);
1245
1231
  } else if (e.obj.type === "identify") {
1246
1232
  const t = e.obj.userId;
1247
1233
  if (t != null && t.length) {
1248
- const s = e.obj.traits;
1249
- window.H.identify(t, s);
1234
+ const i = e.obj.traits;
1235
+ window.H.identify(t, i);
1250
1236
  }
1251
1237
  }
1252
1238
  }
1253
- i(e);
1239
+ s(e);
1254
1240
  }, $e = () => {
1255
1241
  if (typeof window != "undefined") {
1256
1242
  if (typeof window._highlightFetchPatch != "undefined")
1257
1243
  return;
1258
- window._originalFetch = window.fetch, window._fetchProxy = (i, e) => window._originalFetch(i, e), window._highlightFetchPatch = (i, e) => window._fetchProxy.call(window || global, i, e), window.fetch = window._highlightFetchPatch;
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;
1259
1245
  }
1260
1246
  }, He = () => null, Ve = () => {
1261
1247
  if (typeof window != "undefined") {
1262
1248
  if (typeof window._highlightWebSocketRequestCallback != "undefined")
1263
1249
  return;
1264
1250
  window._highlightWebSocketRequestCallback = He, window._highlightWebSocketEventCallback = He;
1265
- const i = new Proxy(window.WebSocket, {
1251
+ const s = new Proxy(window.WebSocket, {
1266
1252
  construct(e, t) {
1267
- const [, s] = At(), n = new e(...t), o = (g) => {
1253
+ const [, i] = Kt(), n = new e(...t), o = (g) => {
1268
1254
  window._highlightWebSocketRequestCallback({
1269
- socketId: s,
1255
+ socketId: i,
1270
1256
  initiatorType: "websocket",
1271
1257
  type: "open",
1272
1258
  name: n.url,
@@ -1274,7 +1260,7 @@ const rs = ({
1274
1260
  });
1275
1261
  }, r = (g) => {
1276
1262
  window._highlightWebSocketRequestCallback({
1277
- socketId: s,
1263
+ socketId: i,
1278
1264
  initiatorType: "websocket",
1279
1265
  type: "close",
1280
1266
  name: n.url,
@@ -1284,7 +1270,7 @@ const rs = ({
1284
1270
  const { data: h } = g, f = typeof h == "string" ? g.data : void 0;
1285
1271
  let m;
1286
1272
  typeof h == "string" ? m = h.length : h instanceof Blob ? m = h.size : m = h.byteLength || 0, window._highlightWebSocketEventCallback({
1287
- socketId: s,
1273
+ socketId: i,
1288
1274
  type: "received",
1289
1275
  name: n.url,
1290
1276
  timeStamp: performance.timeOrigin + g.timeStamp,
@@ -1293,7 +1279,7 @@ const rs = ({
1293
1279
  });
1294
1280
  }, d = (g) => {
1295
1281
  window._highlightWebSocketEventCallback({
1296
- socketId: s,
1282
+ socketId: i,
1297
1283
  type: "error",
1298
1284
  name: n.url,
1299
1285
  timeStamp: performance.timeOrigin + g.timeStamp,
@@ -1303,193 +1289,177 @@ const rs = ({
1303
1289
  n.addEventListener("open", o), n.addEventListener("error", d), n.addEventListener("message", l), n.addEventListener("close", r);
1304
1290
  const c = new Proxy(n.send, {
1305
1291
  apply: function(g, h, f) {
1306
- const m = f[0], R = typeof m == "string" ? m : void 0;
1292
+ const m = f[0], _ = typeof m == "string" ? m : void 0;
1307
1293
  let k;
1308
1294
  typeof m == "string" ? k = m.length : m instanceof Blob ? k = m.size : k = m.byteLength || 0, window._highlightWebSocketEventCallback({
1309
- socketId: s,
1295
+ socketId: i,
1310
1296
  type: "sent",
1311
1297
  name: n.url,
1312
1298
  timeStamp: performance.timeOrigin + performance.now(),
1313
1299
  size: k,
1314
- message: R
1300
+ message: _
1315
1301
  }), g.apply(h, f);
1316
1302
  }
1317
1303
  });
1318
1304
  return n.send = c, n;
1319
1305
  }
1320
1306
  });
1321
- window.WebSocket = i;
1307
+ window.WebSocket = s;
1322
1308
  }
1323
1309
  };
1324
- var Qt = /* @__PURE__ */ ((i) => (i.Device = "Device", i.WebVital = "WebVital", i.Frontend = "Frontend", i.Backend = "Backend", i))(Qt || {});
1325
- const b = (i, e) => {
1326
- T("warn", `highlight.run warning: (${i}): `, e);
1327
- }, Yt = 200;
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;
1328
1314
  let B = [], q, u, M, Ue = [], te = !1;
1329
- const p = {
1315
+ const w = {
1330
1316
  options: void 0,
1331
- init: (i, e) => {
1332
- var t, s, n, o, r, l, d, c;
1317
+ init: (s, e) => {
1318
+ var t, i, n, o, r, l, d, c;
1333
1319
  try {
1334
- if (p.options = e, typeof window == "undefined" || typeof document == "undefined")
1320
+ if (w.options = e, typeof window == "undefined" || typeof document == "undefined")
1335
1321
  return;
1336
- if (!i) {
1322
+ if (!s) {
1337
1323
  console.info(
1338
1324
  "Highlight is not initializing because projectID was passed undefined."
1339
1325
  );
1340
1326
  return;
1341
1327
  }
1342
- e != null && e.sessionCookie ? Dt() : ze(!1);
1328
+ e != null && e.sessionCookie ? It() : ze(!1);
1343
1329
  const g = F();
1344
- let h = O();
1345
- if (e != null && e.sessionKey ? h = O(
1346
- `${i}-${e.sessionKey}`
1330
+ let h = T();
1331
+ if (e != null && e.sessionKey ? h = T(
1332
+ `${s}-${e.sessionKey}`
1347
1333
  ) : g != null && g.sessionSecureID && (h = g.sessionSecureID), te)
1348
1334
  return { sessionSecureID: h };
1349
1335
  te = !0, $e(), Ve();
1350
- const f = y(w({}, e), {
1351
- organizationID: i,
1352
- firstloadVersion: It,
1336
+ const f = y(p({}, e), {
1337
+ organizationID: s,
1338
+ firstloadVersion: Ct,
1353
1339
  environment: (e == null ? void 0 : e.environment) || "production",
1354
1340
  appVersion: e == null ? void 0 : e.version,
1355
1341
  sessionSecureID: h
1356
1342
  });
1357
- return M = new I(f), e != null && e.manualStart || M.startListening(), u = u != null ? u : new ee(f, M), e != null && e.manualStart || u.initialize(), !((s = (t = e == null ? void 0 : e.integrations) == null ? void 0 : t.mixpanel) != null && s.disabled) && ((o = (n = e == null ? void 0 : e.integrations) == null ? void 0 : n.mixpanel) != null && o.projectToken) && ct(e.integrations.mixpanel), !((l = (r = e == null ? void 0 : e.integrations) == null ? void 0 : r.amplitude) != null && l.disabled) && ((c = (d = e == null ? void 0 : e.integrations) == null ? void 0 : d.amplitude) != null && c.apiKey) && lt(e.integrations.amplitude), { sessionSecureID: h };
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 };
1358
1344
  } catch (g) {
1359
1345
  b("init", g);
1360
1346
  }
1361
1347
  },
1362
- snapshot: (i) => _(void 0, null, function* () {
1348
+ snapshot: (s) => R(void 0, null, function* () {
1363
1349
  try {
1364
1350
  if (u && u.ready)
1365
- return yield u.snapshot(i);
1351
+ return yield u.snapshot(s);
1366
1352
  } catch (e) {
1367
1353
  b("snapshot", e);
1368
1354
  }
1369
1355
  }),
1370
- addSessionFeedback: ({
1371
- verbatim: i,
1372
- userName: e,
1373
- userEmail: t,
1374
- timestampOverride: s
1375
- }) => {
1376
- try {
1377
- p.onHighlightReady(
1378
- () => u.addSessionFeedback({
1379
- verbatim: i,
1380
- timestamp: s || (/* @__PURE__ */ new Date()).toISOString(),
1381
- user_email: t,
1382
- user_name: e
1383
- })
1384
- );
1385
- } catch (n) {
1386
- b("error", n);
1387
- }
1356
+ /** @deprecated Session feedback is no longer supported. This is a no-op. */
1357
+ addSessionFeedback: () => {
1388
1358
  },
1389
- consumeError: (i, e, t) => {
1359
+ consumeError: (s, e, t) => {
1390
1360
  try {
1391
- p.onHighlightReady(
1361
+ w.onHighlightReady(
1392
1362
  () => u.consumeCustomError(
1393
- i,
1363
+ s,
1394
1364
  e,
1395
1365
  JSON.stringify(t)
1396
1366
  )
1397
1367
  );
1398
- } catch (s) {
1399
- b("error", s);
1368
+ } catch (i) {
1369
+ b("error", i);
1400
1370
  }
1401
1371
  },
1402
- consume: (i, e) => {
1372
+ consume: (s, e) => {
1403
1373
  try {
1404
- p.onHighlightReady(() => u.consumeError(i, e));
1374
+ w.onHighlightReady(() => u.consumeError(s, e));
1405
1375
  } catch (t) {
1406
1376
  b("error", t);
1407
1377
  }
1408
1378
  },
1409
- error: (i, e) => {
1379
+ error: (s, e) => {
1410
1380
  try {
1411
- p.onHighlightReady(
1412
- () => u.pushCustomError(i, JSON.stringify(e))
1381
+ w.onHighlightReady(
1382
+ () => u.pushCustomError(s, JSON.stringify(e))
1413
1383
  );
1414
1384
  } catch (t) {
1415
1385
  b("error", t);
1416
1386
  }
1417
1387
  },
1418
- track: (i, e = {}) => {
1419
- var t, s, n, o, r, l, d, c, g, h, f;
1388
+ track: (s, e = {}) => {
1389
+ var t, i, n, o, r, l, d, c, g, h, f;
1420
1390
  try {
1421
- p.onHighlightReady(() => {
1422
- u.addProperties(y(w({}, e), { event: i })), u.log("H.track", "INFO", y(w({}, e != null ? e : {}), {
1423
- event: i
1391
+ w.onHighlightReady(() => {
1392
+ u.addProperties(y(p({}, e), { event: s })), u.log("H.track", "INFO", y(p({}, e != null ? e : {}), {
1393
+ event: s
1424
1394
  }));
1425
1395
  });
1426
1396
  const m = u == null ? void 0 : u.getCurrentSessionURL();
1427
- (n = (s = (t = p.options) == null ? void 0 : t.integrations) == null ? void 0 : s.mixpanel) != null && n.disabled || (o = window.mixpanel) != null && o.track && window.mixpanel.track(i, y(w({}, e), {
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), {
1428
1398
  highlightSessionURL: m
1429
- })), (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(i, y(w({}, e), {
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), {
1430
1400
  highlightSessionURL: m
1431
- })), (f = (h = (g = p.options) == null ? void 0 : g.integrations) == null ? void 0 : h.intercom) != null && f.disabled || window.Intercom && window.Intercom("trackEvent", i, e);
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);
1432
1402
  } catch (m) {
1433
1403
  b("track", m);
1434
1404
  }
1435
1405
  },
1436
- log: (i, e, t) => {
1406
+ log: (s, e, t) => {
1437
1407
  try {
1438
- p.onHighlightReady(
1439
- () => u.log(i, e, t != null ? t : {})
1408
+ w.onHighlightReady(
1409
+ () => u.log(s, e, t != null ? t : {})
1440
1410
  );
1441
- } catch (s) {
1442
- b("log", s);
1411
+ } catch (i) {
1412
+ b("log", i);
1443
1413
  }
1444
1414
  },
1445
- start: (i) => {
1415
+ start: (s) => {
1446
1416
  var e;
1447
- (u == null ? void 0 : u.state) === "Recording" && !(i != null && i.forceNew) ? i != null && i.silent || console.warn(
1417
+ (u == null ? void 0 : u.state) === "Recording" && !(s != null && s.forceNew) ? s != null && s.silent || console.warn(
1448
1418
  "Highlight is already recording. Please `H.stop()` the current session before starting a new one."
1449
- ) : (((e = u == null ? void 0 : u._firstLoadListeners) != null ? e : M).startListening(), p.onHighlightReady(
1450
- () => _(void 0, null, function* () {
1451
- yield u.initialize(i);
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);
1452
1422
  }),
1453
1423
  { waitForReady: !1 }
1454
1424
  ));
1455
1425
  },
1456
- stop: (i) => {
1457
- (u == null ? void 0 : u.state) !== "Recording" ? i != null && i.silent || console.warn(
1426
+ stop: (s) => {
1427
+ (u == null ? void 0 : u.state) !== "Recording" ? s != null && s.silent || console.warn(
1458
1428
  "Highlight is already stopped. Please call `H.start()`."
1459
- ) : p.onHighlightReady(() => u.stopRecording(!0));
1429
+ ) : w.onHighlightReady(() => u.stopRecording(!0));
1460
1430
  },
1461
- identify: (i, e = {}, t) => {
1462
- var s, n, o, r, l, d, c, g;
1431
+ identify: (s, e = {}, t) => {
1432
+ var i, n, o, r, l, d, c, g;
1463
1433
  try {
1464
- p.onHighlightReady(
1465
- () => u.identify(i, e, t)
1434
+ w.onHighlightReady(
1435
+ () => u.identify(s, e, t)
1466
1436
  );
1467
1437
  } catch (h) {
1468
1438
  b("identify", h);
1469
1439
  }
1470
- if ((o = (n = (s = p.options) == null ? void 0 : s.integrations) == null ? void 0 : n.mixpanel) != null && o.disabled || (r = window.mixpanel) != null && r.identify && (window.mixpanel.identify(
1471
- typeof (e == null ? void 0 : e.email) == "string" ? e == null ? void 0 : e.email : i
1472
- ), 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(i), Object.keys(e).length > 0)) {
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)) {
1473
1443
  const h = Object.keys(
1474
1444
  e
1475
1445
  ).reduce((f, m) => (f.set(m, e[m]), f), new window.amplitude.Identify());
1476
1446
  window.amplitude.getInstance().identify(h);
1477
1447
  }
1478
1448
  },
1479
- metrics: (i) => {
1449
+ metrics: (s) => {
1480
1450
  try {
1481
- for (const e of i)
1482
- p.recordMetric(e);
1451
+ for (const e of s)
1452
+ w.recordMetric(e);
1483
1453
  } catch (e) {
1484
1454
  b("metrics", e);
1485
1455
  }
1486
1456
  },
1487
- recordMetric: (i) => {
1457
+ recordMetric: (s) => {
1488
1458
  try {
1489
- p.onHighlightReady(() => {
1459
+ w.onHighlightReady(() => {
1490
1460
  var e;
1491
- u.recordGauge(y(w({}, i), {
1492
- tags: (e = i.tags) != null ? e : [],
1461
+ u.recordGauge(y(p({}, s), {
1462
+ tags: (e = s.tags) != null ? e : [],
1493
1463
  group: window.location.href,
1494
1464
  category: "Frontend"
1495
1465
  /* Frontend */
@@ -1499,108 +1469,108 @@ const p = {
1499
1469
  b("recordMetric", e);
1500
1470
  }
1501
1471
  },
1502
- recordCount: (i) => {
1472
+ recordCount: (s) => {
1503
1473
  try {
1504
- p.onHighlightReady(() => {
1505
- u.recordCount(i);
1474
+ w.onHighlightReady(() => {
1475
+ u.recordCount(s);
1506
1476
  });
1507
1477
  } catch (e) {
1508
1478
  b("recordCount", e);
1509
1479
  }
1510
1480
  },
1511
- recordIncr: (i) => {
1481
+ recordIncr: (s) => {
1512
1482
  try {
1513
- p.onHighlightReady(() => {
1514
- u.recordIncr(i);
1483
+ w.onHighlightReady(() => {
1484
+ u.recordIncr(s);
1515
1485
  });
1516
1486
  } catch (e) {
1517
1487
  b("recordIncr", e);
1518
1488
  }
1519
1489
  },
1520
- recordHistogram: (i) => {
1490
+ recordHistogram: (s) => {
1521
1491
  try {
1522
- p.onHighlightReady(() => {
1523
- u.recordHistogram(i);
1492
+ w.onHighlightReady(() => {
1493
+ u.recordHistogram(s);
1524
1494
  });
1525
1495
  } catch (e) {
1526
1496
  b("recordHistogram", e);
1527
1497
  }
1528
1498
  },
1529
- recordUpDownCounter: (i) => {
1499
+ recordUpDownCounter: (s) => {
1530
1500
  try {
1531
- p.onHighlightReady(() => {
1532
- u.recordUpDownCounter(i);
1501
+ w.onHighlightReady(() => {
1502
+ u.recordUpDownCounter(s);
1533
1503
  });
1534
1504
  } catch (e) {
1535
1505
  b("recordUpDownCounter", e);
1536
1506
  }
1537
1507
  },
1538
- startSpan: (i, e, t, s) => {
1539
- const n = Te();
1508
+ startSpan: (s, e, t, i) => {
1509
+ const n = Oe();
1540
1510
  if (!n) {
1541
1511
  const r = Pe();
1542
- return s === void 0 && t === void 0 ? e(r) : s === void 0 ? t(r) : s(r);
1512
+ return i === void 0 && t === void 0 ? e(r) : i === void 0 ? t(r) : i(r);
1543
1513
  }
1544
1514
  const o = (r, l) => {
1545
1515
  const d = l(r);
1546
1516
  return d instanceof Promise ? d.finally(() => r.end()) : (r.end(), d);
1547
1517
  };
1548
- return s === void 0 && t === void 0 ? n.startActiveSpan(
1549
- i,
1518
+ return i === void 0 && t === void 0 ? n.startActiveSpan(
1519
+ s,
1550
1520
  (r) => o(r, e)
1551
- ) : s === void 0 ? n.startActiveSpan(
1552
- i,
1521
+ ) : i === void 0 ? n.startActiveSpan(
1522
+ s,
1553
1523
  e,
1554
1524
  (r) => o(r, t)
1555
1525
  ) : n.startActiveSpan(
1556
- i,
1526
+ s,
1557
1527
  e,
1558
1528
  t,
1559
- (r) => o(r, s)
1529
+ (r) => o(r, i)
1560
1530
  );
1561
1531
  },
1562
- startManualSpan: (i, e, t, s) => {
1563
- const n = Te();
1532
+ startManualSpan: (s, e, t, i) => {
1533
+ const n = Oe();
1564
1534
  if (!n) {
1565
1535
  const o = Pe();
1566
- return s === void 0 && t === void 0 ? e(o) : s === void 0 ? t(o) : s(o);
1536
+ return i === void 0 && t === void 0 ? e(o) : i === void 0 ? t(o) : i(o);
1567
1537
  }
1568
- return s === void 0 && t === void 0 ? n.startActiveSpan(i, e) : s === void 0 ? n.startActiveSpan(
1569
- i,
1538
+ return i === void 0 && t === void 0 ? n.startActiveSpan(s, e) : i === void 0 ? n.startActiveSpan(
1539
+ s,
1570
1540
  e,
1571
1541
  t
1572
1542
  ) : n.startActiveSpan(
1573
- i,
1543
+ s,
1574
1544
  e,
1575
1545
  t,
1576
- s
1546
+ i
1577
1547
  );
1578
1548
  },
1579
- getSessionURL: () => new Promise((i, e) => {
1580
- p.onHighlightReady(() => {
1581
- const t = u.sessionData.sessionSecureID, s = F(t);
1582
- s ? i(
1583
- `https://${Z}/${s.projectID}/sessions/${t}`
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}`
1584
1554
  ) : e(new Error(`Unable to get session URL: ${t}`));
1585
1555
  });
1586
1556
  }),
1587
- getSessionDetails: () => new Promise((i, e) => {
1588
- p.onHighlightReady(() => _(void 0, null, function* () {
1557
+ getSessionDetails: () => new Promise((s, e) => {
1558
+ w.onHighlightReady(() => R(void 0, null, function* () {
1589
1559
  try {
1590
- const t = yield p.getSessionURL();
1560
+ const t = yield w.getSessionURL();
1591
1561
  if (!t)
1592
1562
  throw new Error("Could not get session URL");
1593
- const s = u.sessionData.sessionSecureID, n = F(s), o = n == null ? void 0 : n.sessionStartTime;
1563
+ const i = u.sessionData.sessionSecureID, n = F(i), o = n == null ? void 0 : n.sessionStartTime;
1594
1564
  if (!o)
1595
1565
  throw new Error("Could not get session start timestamp");
1596
1566
  const r = (/* @__PURE__ */ new Date()).getTime(), l = new URL(t), d = new URL(t);
1597
1567
  d.searchParams.set(
1598
1568
  "ts",
1599
1569
  ((r - o) / 1e3).toString()
1600
- ), i({
1570
+ ), s({
1601
1571
  url: l.toString(),
1602
1572
  urlWithTimestamp: d.toString(),
1603
- sessionSecureID: s
1573
+ sessionSecureID: i
1604
1574
  });
1605
1575
  } catch (t) {
1606
1576
  e(t);
@@ -1608,15 +1578,15 @@ const p = {
1608
1578
  }));
1609
1579
  }),
1610
1580
  getRecordingState: () => {
1611
- var i;
1612
- return (i = u == null ? void 0 : u.state) != null ? i : "NotRecording";
1581
+ var s;
1582
+ return (s = u == null ? void 0 : u.state) != null ? s : "NotRecording";
1613
1583
  },
1614
- onHighlightReady: (i, e) => {
1584
+ onHighlightReady: (s, e) => {
1615
1585
  if (u && u.ready) {
1616
- i();
1586
+ s();
1617
1587
  return;
1618
1588
  }
1619
- if (B.push({ options: e, func: i }), q !== void 0)
1589
+ if (B.push({ options: e, func: s }), q !== void 0)
1620
1590
  return;
1621
1591
  const t = () => {
1622
1592
  B = B.filter((n) => {
@@ -1624,39 +1594,39 @@ const p = {
1624
1594
  return !u || ((o = n.options) == null ? void 0 : o.waitForReady) !== !1 && !u.ready ? !0 : (n.func(), !1);
1625
1595
  }), q = void 0, B.length > 0 && (q = setTimeout(
1626
1596
  t,
1627
- Yt
1597
+ Xt
1628
1598
  ));
1629
1599
  };
1630
1600
  t();
1631
1601
  },
1632
- registerLD(i) {
1633
- Ue.length || (p.onHighlightReady(() => {
1634
- u.registerLD(i);
1635
- }), Rt(this, i, p.options), Ue.push(new We(i)));
1602
+ registerLD(s) {
1603
+ Ue.length || (w.onHighlightReady(() => {
1604
+ u.registerLD(s);
1605
+ }), Dt(this, s, w.options), Ue.push(new We(s)));
1636
1606
  }
1637
1607
  };
1638
- typeof window != "undefined" && (window.H = p);
1639
- Jt();
1608
+ typeof window != "undefined" && (window.H = w);
1609
+ Qt();
1640
1610
  $e();
1641
1611
  Ve();
1642
- const os = {
1612
+ const as = {
1643
1613
  reset: () => {
1644
1614
  te = !1, u = void 0, B = [], q = void 0, M = void 0;
1645
1615
  },
1646
- setHighlightObj: (i) => {
1647
- u = i;
1616
+ setHighlightObj: (s) => {
1617
+ u = s;
1648
1618
  }
1649
1619
  };
1650
1620
  export {
1651
- O as GenerateSecureID,
1652
- p as H,
1653
- rs as HighlightSegmentMiddleware,
1654
- us as LDObserve,
1655
- ms as LDRecord,
1656
- Qt as MetricCategory,
1657
- hs as Observe,
1658
- ls as Record,
1659
- os as __testing,
1660
- ns as configureElectronHighlight
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
1661
1631
  };
1662
1632
  //# sourceMappingURL=index.js.map