moonshot-rails 0.0.10 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/moonshot.js +1212 -1044
- data/lib/moonshot-rails/version.rb +1 -1
- metadata +2 -2
@@ -171,8 +171,8 @@ function h(e, t) {
|
|
171
171
|
|
172
172
|
var f = {
|
173
173
|
DEBUG: !1,
|
174
|
-
LIB_VERSION: "1.
|
175
|
-
}, p = Array.isArray,
|
174
|
+
LIB_VERSION: "1.131.3"
|
175
|
+
}, p = Array.isArray, v = Object.prototype, g = v.hasOwnProperty, _ = v.toString, m = p || function(e) {
|
176
176
|
return "[object Array]" === _.call(e);
|
177
177
|
}, y = function(e) {
|
178
178
|
return "function" == typeof e;
|
@@ -180,7 +180,7 @@ var f = {
|
|
180
180
|
return e === Object(e) && !m(e);
|
181
181
|
}, k = function(e) {
|
182
182
|
if (b(e)) {
|
183
|
-
for (var t in e) if (
|
183
|
+
for (var t in e) if (g.call(e, t)) return !1;
|
184
184
|
return !0;
|
185
185
|
}
|
186
186
|
return !1;
|
@@ -190,18 +190,18 @@ var f = {
|
|
190
190
|
return "[object String]" == _.call(e);
|
191
191
|
}, F = function(e) {
|
192
192
|
return null === e;
|
193
|
-
},
|
193
|
+
}, E = function(e) {
|
194
194
|
return w(e) || F(e);
|
195
|
-
},
|
195
|
+
}, R = function(e) {
|
196
196
|
return "[object Number]" == _.call(e);
|
197
197
|
}, x = function(e) {
|
198
198
|
return "[object Boolean]" === _.call(e);
|
199
|
-
},
|
199
|
+
}, I = function(e) {
|
200
200
|
return e instanceof FormData;
|
201
|
-
},
|
201
|
+
}, P = "undefined" != typeof window ? window : void 0, C = "undefined" != typeof globalThis ? globalThis : P, T = Array.prototype, $ = T.forEach, O = T.indexOf, M = null == C ? void 0 : C.navigator, A = null == C ? void 0 : C.document, q = null == C ? void 0 : C.location, L = null == C ? void 0 : C.fetch, D = null != C && C.XMLHttpRequest && "withCredentials" in new C.XMLHttpRequest ? C.XMLHttpRequest : void 0, N = null == C ? void 0 : C.AbortController, B = null == M ? void 0 : M.userAgent, H = null != P ? P : {}, j = "[PostHog.js]", U = {
|
202
202
|
_log: function(e) {
|
203
|
-
if (
|
204
|
-
for (var t = ("__rrweb_original__" in
|
203
|
+
if (P && (f.DEBUG || H.POSTHOG_DEBUG) && !w(P.console) && P.console) {
|
204
|
+
for (var t = ("__rrweb_original__" in P.console[e] ? P.console[e].__rrweb_original__ : P.console[e]), n = arguments.length, i = new Array(n > 1 ? n - 1 : 0), r = 1; r < n; r++) i[r - 1] = arguments[r];
|
205
205
|
t.apply(void 0, [ j ].concat(i));
|
206
206
|
}
|
207
207
|
},
|
@@ -224,18 +224,18 @@ var f = {
|
|
224
224
|
uninitializedWarning: function(e) {
|
225
225
|
U.error("You must initialize PostHog before calling ".concat(e));
|
226
226
|
}
|
227
|
-
}, W = {},
|
227
|
+
}, W = {}, G = function(e) {
|
228
228
|
return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
229
229
|
};
|
230
230
|
|
231
231
|
function z(e, t, n) {
|
232
|
-
if (m(e)) if (
|
232
|
+
if (m(e)) if ($ && e.forEach === $) e.forEach(t, n); else if ("length" in e && e.length === +e.length) for (var i = 0, r = e.length; i < r; i++) if (i in e && t.call(n, e[i], i) === W) return;
|
233
233
|
}
|
234
234
|
|
235
|
-
function
|
236
|
-
if (!
|
235
|
+
function V(e, t, n) {
|
236
|
+
if (!E(e)) {
|
237
237
|
if (m(e)) return z(e, t, n);
|
238
|
-
if (
|
238
|
+
if (I(e)) {
|
239
239
|
var i, r = h(e.entries());
|
240
240
|
try {
|
241
241
|
for (r.s(); !(i = r.n()).done; ) {
|
@@ -247,7 +247,7 @@ function G(e, t, n) {
|
|
247
247
|
} finally {
|
248
248
|
r.f();
|
249
249
|
}
|
250
|
-
} else for (var o in e) if (
|
250
|
+
} else for (var o in e) if (g.call(e, o) && t.call(n, e[o], o) === W) return;
|
251
251
|
}
|
252
252
|
}
|
253
253
|
|
@@ -258,20 +258,20 @@ var Q = function(e) {
|
|
258
258
|
})), e;
|
259
259
|
};
|
260
260
|
|
261
|
-
function
|
261
|
+
function J(e, t) {
|
262
262
|
return -1 !== e.indexOf(t);
|
263
263
|
}
|
264
264
|
|
265
|
-
function
|
265
|
+
function Y(e) {
|
266
266
|
for (var t = Object.keys(e), n = t.length, i = new Array(n); n--; ) i[n] = [ t[n], e[t[n]] ];
|
267
267
|
return i;
|
268
268
|
}
|
269
269
|
|
270
|
-
var
|
270
|
+
var X = function() {
|
271
271
|
return Date.now = Date.now || function() {
|
272
272
|
return +new Date;
|
273
273
|
}, Date.now();
|
274
|
-
},
|
274
|
+
}, K = function(e) {
|
275
275
|
try {
|
276
276
|
return e();
|
277
277
|
} catch (e) {
|
@@ -289,7 +289,7 @@ var K = function() {
|
|
289
289
|
};
|
290
290
|
}, ee = function(e) {
|
291
291
|
var t = {};
|
292
|
-
return
|
292
|
+
return V(e, (function(e, n) {
|
293
293
|
S(e) && e.length > 0 && (t[n] = e);
|
294
294
|
})), t;
|
295
295
|
};
|
@@ -301,7 +301,7 @@ function te(e, t) {
|
|
301
301
|
return t !== Object(t) ? i ? i(t, n) : t : r.has(t) ? void 0 : (r.add(t), m(t) ? (s = [],
|
302
302
|
z(t, (function(t) {
|
303
303
|
s.push(e(t));
|
304
|
-
}))) : (s = {},
|
304
|
+
}))) : (s = {}, V(t, (function(t, n) {
|
305
305
|
r.has(t) || (s[n] = e(t, n));
|
306
306
|
}))), s);
|
307
307
|
var s;
|
@@ -332,7 +332,7 @@ var ne, ie = function(e) {
|
|
332
332
|
var o = "on" + n, a = t[o];
|
333
333
|
t[o] = function(t, n, i) {
|
334
334
|
return function(r) {
|
335
|
-
if (r = r || e(null ==
|
335
|
+
if (r = r || e(null == P ? void 0 : P.event)) {
|
336
336
|
var s, o = !0;
|
337
337
|
y(i) && (s = i(r));
|
338
338
|
var a = n.call(t, r);
|
@@ -346,25 +346,25 @@ var ne, ie = function(e) {
|
|
346
346
|
|
347
347
|
function se(e, t) {
|
348
348
|
var n = function() {
|
349
|
-
if (!
|
350
|
-
var n =
|
349
|
+
if (!A) return t("document not found");
|
350
|
+
var n = A.createElement("script");
|
351
351
|
n.type = "text/javascript", n.src = e, n.onload = function(e) {
|
352
352
|
return t(void 0, e);
|
353
353
|
}, n.onerror = function(e) {
|
354
354
|
return t(e);
|
355
355
|
};
|
356
|
-
var i, r =
|
357
|
-
r.length > 0 ? null === (i = r[0].parentNode) || void 0 === i || i.insertBefore(n, r[0]) :
|
356
|
+
var i, r = A.querySelectorAll("body > script");
|
357
|
+
r.length > 0 ? null === (i = r[0].parentNode) || void 0 === i || i.insertBefore(n, r[0]) : A.body.appendChild(n);
|
358
358
|
};
|
359
|
-
null !=
|
359
|
+
null != A && A.body ? n() : null == A || A.addEventListener("DOMContentLoaded", n);
|
360
360
|
}
|
361
361
|
|
362
362
|
!function(e) {
|
363
363
|
e.GZipJS = "gzip-js", e.Base64 = "base64";
|
364
364
|
}(ne || (ne = {}));
|
365
365
|
|
366
|
-
var oe = "$people_distinct_id", ae = "__alias", ue = "__timers", le = "$autocapture_disabled_server_side", ce = "$
|
367
|
-
var t, n = {}, i = h(
|
366
|
+
var oe = "$people_distinct_id", ae = "__alias", ue = "__timers", le = "$autocapture_disabled_server_side", ce = "$heatmaps_enabled_server_side", de = "$session_recording_enabled_server_side", he = "$console_log_recording_enabled_server_side", fe = "$session_recording_network_payload_capture", pe = "$session_recording_canvas_recording", ve = "$replay_sample_rate", ge = "$replay_minimum_duration", _e = "$sesid", me = "$session_is_sampled", ye = "$enabled_feature_flags", be = "$early_access_features", ke = "$stored_person_properties", we = "$stored_group_properties", Se = "$surveys", Fe = "$flag_call_reported", Ee = "$user_state", Re = "$client_session_props", xe = "$capture_rate_limit", Ie = "$initial_campaign_params", Pe = "$initial_referrer_info", Ce = "$epp", Te = "__POSTHOG_TOOLBAR__", $e = [ oe, ae, "__cmpns", ue, de, ce, _e, ye, Ee, be, we, ke, Se, Fe, Re, xe, Ie, Pe, Ce ], Oe = "$active_feature_flags", Me = "$override_feature_flags", Ae = "$feature_flag_payloads", qe = function(e) {
|
367
|
+
var t, n = {}, i = h(Y(e || {}));
|
368
368
|
try {
|
369
369
|
for (i.s(); !(t = i.n()).done; ) {
|
370
370
|
var r = u(t.value, 2), s = r[0], o = r[1];
|
@@ -376,7 +376,7 @@ var oe = "$people_distinct_id", ae = "__alias", ue = "__timers", le = "$autocapt
|
|
376
376
|
i.f();
|
377
377
|
}
|
378
378
|
return n;
|
379
|
-
},
|
379
|
+
}, Le = function() {
|
380
380
|
function e(t) {
|
381
381
|
i(this, e), this.instance = t, this._override_warning = !1, this.featureFlagEventHandlers = [],
|
382
382
|
this.reloadFeatureFlagsQueued = !1, this.reloadFeatureFlagsInAction = !1;
|
@@ -389,7 +389,7 @@ var oe = "$people_distinct_id", ae = "__alias", ue = "__timers", le = "$autocapt
|
|
389
389
|
}, {
|
390
390
|
key: "getFlagVariants",
|
391
391
|
value: function() {
|
392
|
-
var e = this.instance.get_property(
|
392
|
+
var e = this.instance.get_property(ye), t = this.instance.get_property(Me);
|
393
393
|
if (!t) return e || {};
|
394
394
|
for (var n = Q({}, e), i = Object.keys(t), r = 0; r < i.length; r++) n[i[r]] = t[i[r]];
|
395
395
|
return this._override_warning || (U.warn(" Overriding feature flags!", {
|
@@ -401,7 +401,7 @@ var oe = "$people_distinct_id", ae = "__alias", ue = "__timers", le = "$autocapt
|
|
401
401
|
}, {
|
402
402
|
key: "getFlagPayloads",
|
403
403
|
value: function() {
|
404
|
-
return this.instance.get_property(
|
404
|
+
return this.instance.get_property(Ae) || {};
|
405
405
|
}
|
406
406
|
}, {
|
407
407
|
key: "reloadFeatureFlags",
|
@@ -438,7 +438,7 @@ var oe = "$people_distinct_id", ae = "__alias", ue = "__timers", le = "$autocapt
|
|
438
438
|
var e = this;
|
439
439
|
if (!this.instance.config.advanced_disable_feature_flags) {
|
440
440
|
this.setReloadingPaused(!0);
|
441
|
-
var t = this.instance.config.token, n = this.instance.get_property(
|
441
|
+
var t = this.instance.config.token, n = this.instance.get_property(ke), i = this.instance.get_property(we), r = {
|
442
442
|
token: t,
|
443
443
|
distinct_id: this.instance.get_distinct_id(),
|
444
444
|
groups: this.instance.getGroups(),
|
@@ -468,9 +468,9 @@ var oe = "$people_distinct_id", ae = "__alias", ue = "__timers", le = "$autocapt
|
|
468
468
|
value: function(e) {
|
469
469
|
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
|
470
470
|
if (this.instance.decideEndpointWasHit || this.getFlags() && this.getFlags().length > 0) {
|
471
|
-
var n, i = this.getFlagVariants()[e], r = "".concat(i), s = this.instance.get_property(
|
471
|
+
var n, i = this.getFlagVariants()[e], r = "".concat(i), s = this.instance.get_property(Fe) || {};
|
472
472
|
if (t.send_event || !("send_event" in t)) if (!(e in s) || !s[e].includes(r)) m(s[e]) ? s[e].push(r) : s[e] = [ r ],
|
473
|
-
null === (n = this.instance.persistence) || void 0 === n || n.register(o({},
|
473
|
+
null === (n = this.instance.persistence) || void 0 === n || n.register(o({}, Fe, s)),
|
474
474
|
this.instance.capture("$feature_flag_called", {
|
475
475
|
$feature_flag: e,
|
476
476
|
$feature_flag_response: i
|
@@ -514,11 +514,11 @@ var oe = "$people_distinct_id", ae = "__alias", ue = "__timers", le = "$autocapt
|
|
514
514
|
if (a) if (m(a)) {
|
515
515
|
var l, c = {};
|
516
516
|
if (a) for (var d = 0; d < a.length; d++) c[a[d]] = !0;
|
517
|
-
n && n.register((o(l = {},
|
517
|
+
n && n.register((o(l = {}, Oe, a), o(l, ye, c), l));
|
518
518
|
} else {
|
519
519
|
var h = a, f = u;
|
520
|
-
e.errorsWhileComputingFlags && (h = t(t({}, r), h), f = t(t({}, s), f)), n && n.register((o(i = {},
|
521
|
-
o(i,
|
520
|
+
e.errorsWhileComputingFlags && (h = t(t({}, r), h), f = t(t({}, s), f)), n && n.register((o(i = {}, Oe, Object.keys(qe(h))),
|
521
|
+
o(i, ye, h || {}), o(i, Ae, f || {}), i));
|
522
522
|
}
|
523
523
|
}(e, this.instance.persistence, i, r), this._fireFeatureFlagsCallbacks(n);
|
524
524
|
}
|
@@ -527,10 +527,10 @@ var oe = "$people_distinct_id", ae = "__alias", ue = "__timers", le = "$autocapt
|
|
527
527
|
key: "override",
|
528
528
|
value: function(e) {
|
529
529
|
if (!this.instance.__loaded || !this.instance.persistence) return U.uninitializedWarning("posthog.feature_flags.override");
|
530
|
-
if (this._override_warning = !1, !1 === e) this.instance.persistence.unregister(
|
530
|
+
if (this._override_warning = !1, !1 === e) this.instance.persistence.unregister(Me); else if (m(e)) {
|
531
531
|
for (var t = {}, n = 0; n < e.length; n++) t[e[n]] = !0;
|
532
|
-
this.instance.persistence.register(o({},
|
533
|
-
} else this.instance.persistence.register(o({},
|
532
|
+
this.instance.persistence.register(o({}, Me, t));
|
533
|
+
} else this.instance.persistence.register(o({}, Me, e));
|
534
534
|
}
|
535
535
|
}, {
|
536
536
|
key: "onFeatureFlags",
|
@@ -554,13 +554,13 @@ var oe = "$people_distinct_id", ae = "__alias", ue = "__timers", le = "$autocapt
|
|
554
554
|
$set: s
|
555
555
|
}), this.setPersonPropertiesForFlags(s, !1);
|
556
556
|
var a = t(t({}, this.getFlagVariants()), {}, o({}, e, n));
|
557
|
-
null === (i = this.instance.persistence) || void 0 === i || i.register((o(r = {},
|
558
|
-
o(r,
|
557
|
+
null === (i = this.instance.persistence) || void 0 === i || i.register((o(r = {}, Oe, Object.keys(qe(a))),
|
558
|
+
o(r, ye, a), r)), this._fireFeatureFlagsCallbacks();
|
559
559
|
}
|
560
560
|
}, {
|
561
561
|
key: "getEarlyAccessFeatures",
|
562
562
|
value: function(e) {
|
563
|
-
var t = this, n = arguments.length > 1 && void 0 !== arguments[1] && arguments[1], i = this.instance.get_property(
|
563
|
+
var t = this, n = arguments.length > 1 && void 0 !== arguments[1] && arguments[1], i = this.instance.get_property(be);
|
564
564
|
if (i && !n) return e(i);
|
565
565
|
this.instance._send_request({
|
566
566
|
transport: "XHR",
|
@@ -570,7 +570,7 @@ var oe = "$people_distinct_id", ae = "__alias", ue = "__timers", le = "$autocapt
|
|
570
570
|
var i;
|
571
571
|
if (n.json) {
|
572
572
|
var r = n.json.earlyAccessFeatures;
|
573
|
-
return null === (i = t.instance.persistence) || void 0 === i || i.register(o({},
|
573
|
+
return null === (i = t.instance.persistence) || void 0 === i || i.register(o({}, be, r)),
|
574
574
|
e(r);
|
575
575
|
}
|
576
576
|
}
|
@@ -604,29 +604,29 @@ var oe = "$people_distinct_id", ae = "__alias", ue = "__timers", le = "$autocapt
|
|
604
604
|
}, {
|
605
605
|
key: "setPersonPropertiesForFlags",
|
606
606
|
value: function(e) {
|
607
|
-
var n = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1], i = this.instance.get_property(
|
608
|
-
this.instance.register(o({},
|
607
|
+
var n = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1], i = this.instance.get_property(ke) || {};
|
608
|
+
this.instance.register(o({}, ke, t(t({}, i), e))), n && this.instance.reloadFeatureFlags();
|
609
609
|
}
|
610
610
|
}, {
|
611
611
|
key: "resetPersonPropertiesForFlags",
|
612
612
|
value: function() {
|
613
|
-
this.instance.unregister(
|
613
|
+
this.instance.unregister(ke);
|
614
614
|
}
|
615
615
|
}, {
|
616
616
|
key: "setGroupPropertiesForFlags",
|
617
617
|
value: function(e) {
|
618
|
-
var n = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1], i = this.instance.get_property(
|
618
|
+
var n = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1], i = this.instance.get_property(we) || {};
|
619
619
|
0 !== Object.keys(i).length && Object.keys(i).forEach((function(n) {
|
620
620
|
i[n] = t(t({}, i[n]), e[n]), delete e[n];
|
621
|
-
})), this.instance.register(o({},
|
621
|
+
})), this.instance.register(o({}, we, t(t({}, i), e))), n && this.instance.reloadFeatureFlags();
|
622
622
|
}
|
623
623
|
}, {
|
624
624
|
key: "resetGroupPropertiesForFlags",
|
625
625
|
value: function(e) {
|
626
626
|
if (e) {
|
627
|
-
var n = this.instance.get_property(
|
628
|
-
this.instance.register(o({},
|
629
|
-
} else this.instance.unregister(
|
627
|
+
var n = this.instance.get_property(we) || {};
|
628
|
+
this.instance.register(o({}, we, t(t({}, n), {}, o({}, e, {}))));
|
629
|
+
} else this.instance.unregister(we);
|
630
630
|
}
|
631
631
|
} ]), e;
|
632
632
|
}();
|
@@ -634,17 +634,17 @@ var oe = "$people_distinct_id", ae = "__alias", ue = "__timers", le = "$autocapt
|
|
634
634
|
Math.trunc || (Math.trunc = function(e) {
|
635
635
|
return e < 0 ? Math.ceil(e) : Math.floor(e);
|
636
636
|
}), Number.isInteger || (Number.isInteger = function(e) {
|
637
|
-
return
|
637
|
+
return R(e) && isFinite(e) && Math.floor(e) === e;
|
638
638
|
});
|
639
639
|
|
640
|
-
var
|
640
|
+
var De = "0123456789abcdef", Ne = function() {
|
641
641
|
function e(t) {
|
642
642
|
if (i(this, e), this.bytes = t, 16 !== t.length) throw new TypeError("not 128-bit length");
|
643
643
|
}
|
644
644
|
return s(e, [ {
|
645
645
|
key: "toString",
|
646
646
|
value: function() {
|
647
|
-
for (var e = "", t = 0; t < this.bytes.length; t++) e = e +
|
647
|
+
for (var e = "", t = 0; t < this.bytes.length; t++) e = e + De.charAt(this.bytes[t] >>> 4) + De.charAt(15 & this.bytes[t]),
|
648
648
|
3 !== t && 5 !== t && 7 !== t && 9 !== t || (e += "-");
|
649
649
|
if (36 !== e.length) throw new Error("Invalid UUIDv7 was generated");
|
650
650
|
return e;
|
@@ -679,9 +679,9 @@ var Ae = "0123456789abcdef", De = function() {
|
|
679
679
|
s[13] = r >>> 16, s[14] = r >>> 8, s[15] = r, new e(s);
|
680
680
|
}
|
681
681
|
} ]), e;
|
682
|
-
}(),
|
682
|
+
}(), Be = function() {
|
683
683
|
function e() {
|
684
|
-
i(this, e), o(this, "timestamp", 0), o(this, "counter", 0), o(this, "random", new
|
684
|
+
i(this, e), o(this, "timestamp", 0), o(this, "counter", 0), o(this, "random", new Ue);
|
685
685
|
}
|
686
686
|
return s(e, [ {
|
687
687
|
key: "generate",
|
@@ -703,7 +703,7 @@ var Ae = "0123456789abcdef", De = function() {
|
|
703
703
|
if (!(e + 1e4 > this.timestamp)) return;
|
704
704
|
this.counter++, this.counter > 4398046511103 && (this.timestamp++, this.resetCounter());
|
705
705
|
}
|
706
|
-
return
|
706
|
+
return Ne.fromFieldsV7(this.timestamp, Math.trunc(this.counter / Math.pow(2, 30)), this.counter & Math.pow(2, 30) - 1, this.random.nextUint32());
|
707
707
|
}
|
708
708
|
}, {
|
709
709
|
key: "resetCounter",
|
@@ -711,51 +711,51 @@ var Ae = "0123456789abcdef", De = function() {
|
|
711
711
|
this.counter = 1024 * this.random.nextUint32() + (1023 & this.random.nextUint32());
|
712
712
|
}
|
713
713
|
} ]), e;
|
714
|
-
}(),
|
714
|
+
}(), He = function(e) {
|
715
715
|
if ("undefined" != typeof UUIDV7_DENY_WEAK_RNG && UUIDV7_DENY_WEAK_RNG) throw new Error("no cryptographically strong RNG available");
|
716
716
|
for (var t = 0; t < e.length; t++) e[t] = 65536 * Math.trunc(65536 * Math.random()) + Math.trunc(65536 * Math.random());
|
717
717
|
return e;
|
718
718
|
};
|
719
719
|
|
720
|
-
|
720
|
+
P && !w(P.crypto) && crypto.getRandomValues && (He = function(e) {
|
721
721
|
return crypto.getRandomValues(e);
|
722
722
|
});
|
723
723
|
|
724
|
-
var
|
724
|
+
var je, Ue = function() {
|
725
725
|
function e() {
|
726
726
|
i(this, e), o(this, "buffer", new Uint32Array(8)), o(this, "cursor", 1 / 0);
|
727
727
|
}
|
728
728
|
return s(e, [ {
|
729
729
|
key: "nextUint32",
|
730
730
|
value: function() {
|
731
|
-
return this.cursor >= this.buffer.length && (
|
731
|
+
return this.cursor >= this.buffer.length && (He(this.buffer), this.cursor = 0),
|
732
732
|
this.buffer[this.cursor++];
|
733
733
|
}
|
734
734
|
} ]), e;
|
735
|
-
}(),
|
736
|
-
return
|
737
|
-
},
|
738
|
-
return (
|
739
|
-
},
|
735
|
+
}(), We = function() {
|
736
|
+
return Ge().toString();
|
737
|
+
}, Ge = function() {
|
738
|
+
return (je || (je = new Be)).generate();
|
739
|
+
}, ze = "Thu, 01 Jan 1970 00:00:00 GMT", Ve = "";
|
740
740
|
|
741
|
-
var
|
741
|
+
var Qe = /[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;
|
742
742
|
|
743
|
-
function
|
743
|
+
function Je(e, t) {
|
744
744
|
if (t) {
|
745
745
|
var n = function(e) {
|
746
|
-
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] :
|
746
|
+
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : A;
|
747
747
|
if (Ve) return Ve;
|
748
748
|
if (!t) return "";
|
749
749
|
if ([ "localhost", "127.0.0.1" ].includes(e)) return "";
|
750
|
-
for (var n = e.split("."), i = Math.min(n.length, 8), r = "dmn_chk_" +
|
750
|
+
for (var n = e.split("."), i = Math.min(n.length, 8), r = "dmn_chk_" + We(), s = new RegExp("(^|;)\\s*" + r + "=1"); !Ve && i--; ) {
|
751
751
|
var o = n.slice(i).join("."), a = r + "=1;domain=." + o;
|
752
|
-
t.cookie = a, s.test(t.cookie) && (t.cookie = a + ";expires=" +
|
752
|
+
t.cookie = a, s.test(t.cookie) && (t.cookie = a + ";expires=" + ze, Ve = o);
|
753
753
|
}
|
754
754
|
return Ve;
|
755
755
|
}(e);
|
756
756
|
if (!n) {
|
757
757
|
var i = function(e) {
|
758
|
-
var t = e.match(
|
758
|
+
var t = e.match(Qe);
|
759
759
|
return t ? t[0] : "";
|
760
760
|
}(e);
|
761
761
|
i !== n && U.info("Warning: cookie subdomain discovery mismatch", i, n), n = i;
|
@@ -765,17 +765,17 @@ function Ge(e, t) {
|
|
765
765
|
return "";
|
766
766
|
}
|
767
767
|
|
768
|
-
var
|
768
|
+
var Ye, Xe = {
|
769
769
|
is_supported: function() {
|
770
|
-
return !!
|
770
|
+
return !!A;
|
771
771
|
},
|
772
772
|
error: function(e) {
|
773
773
|
U.error("cookieStore error: " + e);
|
774
774
|
},
|
775
775
|
get: function(e) {
|
776
|
-
if (
|
776
|
+
if (A) {
|
777
777
|
try {
|
778
|
-
for (var t = e + "=", n =
|
778
|
+
for (var t = e + "=", n = A.cookie.split(";").filter((function(e) {
|
779
779
|
return e.length;
|
780
780
|
})), i = 0; i < n.length; i++) {
|
781
781
|
for (var r = n[i]; " " == r.charAt(0); ) r = r.substring(1, r.length);
|
@@ -788,13 +788,13 @@ var Qe, Ye = {
|
|
788
788
|
parse: function(e) {
|
789
789
|
var t;
|
790
790
|
try {
|
791
|
-
t = JSON.parse(
|
791
|
+
t = JSON.parse(Xe.get(e)) || {};
|
792
792
|
} catch (e) {}
|
793
793
|
return t;
|
794
794
|
},
|
795
795
|
set: function(e, t, n, i, r) {
|
796
|
-
if (
|
797
|
-
var s = "", o = "", a =
|
796
|
+
if (A) try {
|
797
|
+
var s = "", o = "", a = Je(A.location.hostname, i);
|
798
798
|
if (n) {
|
799
799
|
var u = new Date;
|
800
800
|
u.setTime(u.getTime() + 24 * n * 60 * 60 * 1e3), s = "; expires=" + u.toUTCString();
|
@@ -802,29 +802,29 @@ var Qe, Ye = {
|
|
802
802
|
r && (o = "; secure");
|
803
803
|
var l = e + "=" + encodeURIComponent(JSON.stringify(t)) + s + "; SameSite=Lax; path=/" + a + o;
|
804
804
|
return l.length > 3686.4 && U.warn("cookieStore warning: large cookie, len=" + l.length),
|
805
|
-
|
805
|
+
A.cookie = l, l;
|
806
806
|
} catch (e) {
|
807
807
|
return;
|
808
808
|
}
|
809
809
|
},
|
810
810
|
remove: function(e, t) {
|
811
811
|
try {
|
812
|
-
|
812
|
+
Xe.set(e, "", -1, t);
|
813
813
|
} catch (e) {
|
814
814
|
return;
|
815
815
|
}
|
816
816
|
}
|
817
|
-
},
|
817
|
+
}, Ke = null, Ze = {
|
818
818
|
is_supported: function() {
|
819
|
-
if (!F(
|
819
|
+
if (!F(Ke)) return Ke;
|
820
820
|
var e = !0;
|
821
|
-
if (w(
|
821
|
+
if (w(P)) e = !1; else try {
|
822
822
|
var t = "__mplssupport__";
|
823
|
-
|
823
|
+
Ze.set(t, "xyz"), '"xyz"' !== Ze.get(t) && (e = !1), Ze.remove(t);
|
824
824
|
} catch (t) {
|
825
825
|
e = !1;
|
826
826
|
}
|
827
|
-
return e || U.error("localStorage unsupported; falling back to cookie store"),
|
827
|
+
return e || U.error("localStorage unsupported; falling back to cookie store"), Ke = e,
|
828
828
|
e;
|
829
829
|
},
|
830
830
|
error: function(e) {
|
@@ -832,63 +832,63 @@ var Qe, Ye = {
|
|
832
832
|
},
|
833
833
|
get: function(e) {
|
834
834
|
try {
|
835
|
-
return null ==
|
835
|
+
return null == P ? void 0 : P.localStorage.getItem(e);
|
836
836
|
} catch (e) {
|
837
|
-
|
837
|
+
Ze.error(e);
|
838
838
|
}
|
839
839
|
return null;
|
840
840
|
},
|
841
841
|
parse: function(e) {
|
842
842
|
try {
|
843
|
-
return JSON.parse(
|
843
|
+
return JSON.parse(Ze.get(e)) || {};
|
844
844
|
} catch (e) {}
|
845
845
|
return null;
|
846
846
|
},
|
847
847
|
set: function(e, t) {
|
848
848
|
try {
|
849
|
-
null ==
|
849
|
+
null == P || P.localStorage.setItem(e, JSON.stringify(t));
|
850
850
|
} catch (e) {
|
851
|
-
|
851
|
+
Ze.error(e);
|
852
852
|
}
|
853
853
|
},
|
854
854
|
remove: function(e) {
|
855
855
|
try {
|
856
|
-
null ==
|
856
|
+
null == P || P.localStorage.removeItem(e);
|
857
857
|
} catch (e) {
|
858
|
-
|
858
|
+
Ze.error(e);
|
859
859
|
}
|
860
860
|
}
|
861
|
-
},
|
861
|
+
}, et = [ "distinct_id", _e, me, Ce ], tt = t(t({}, Ze), {}, {
|
862
862
|
parse: function(e) {
|
863
863
|
try {
|
864
864
|
var t = {};
|
865
865
|
try {
|
866
|
-
t =
|
866
|
+
t = Xe.parse(e) || {};
|
867
867
|
} catch (e) {}
|
868
|
-
var n = Q(t, JSON.parse(
|
869
|
-
return
|
868
|
+
var n = Q(t, JSON.parse(Ze.get(e) || "{}"));
|
869
|
+
return Ze.set(e, n), n;
|
870
870
|
} catch (e) {}
|
871
871
|
return null;
|
872
872
|
},
|
873
873
|
set: function(e, t, n, i, r) {
|
874
874
|
try {
|
875
|
-
|
875
|
+
Ze.set(e, t);
|
876
876
|
var s = {};
|
877
|
-
|
877
|
+
et.forEach((function(e) {
|
878
878
|
t[e] && (s[e] = t[e]);
|
879
|
-
})), Object.keys(s).length &&
|
879
|
+
})), Object.keys(s).length && Xe.set(e, s, n, i, r);
|
880
880
|
} catch (e) {
|
881
|
-
|
881
|
+
Ze.error(e);
|
882
882
|
}
|
883
883
|
},
|
884
884
|
remove: function(e, t) {
|
885
885
|
try {
|
886
|
-
null ==
|
886
|
+
null == P || P.localStorage.removeItem(e), Xe.remove(e, t);
|
887
887
|
} catch (e) {
|
888
|
-
|
888
|
+
Ze.error(e);
|
889
889
|
}
|
890
890
|
}
|
891
|
-
}),
|
891
|
+
}), nt = {}, it = {
|
892
892
|
is_supported: function() {
|
893
893
|
return !0;
|
894
894
|
},
|
@@ -896,63 +896,63 @@ var Qe, Ye = {
|
|
896
896
|
U.error("memoryStorage error: " + e);
|
897
897
|
},
|
898
898
|
get: function(e) {
|
899
|
-
return
|
899
|
+
return nt[e] || null;
|
900
900
|
},
|
901
901
|
parse: function(e) {
|
902
|
-
return
|
902
|
+
return nt[e] || null;
|
903
903
|
},
|
904
904
|
set: function(e, t) {
|
905
|
-
|
905
|
+
nt[e] = t;
|
906
906
|
},
|
907
907
|
remove: function(e) {
|
908
|
-
delete
|
908
|
+
delete nt[e];
|
909
909
|
}
|
910
|
-
},
|
910
|
+
}, rt = null, st = {
|
911
911
|
is_supported: function() {
|
912
|
-
if (!F(
|
913
|
-
if (
|
912
|
+
if (!F(rt)) return rt;
|
913
|
+
if (rt = !0, w(P)) rt = !1; else try {
|
914
914
|
var e = "__support__";
|
915
|
-
|
915
|
+
st.set(e, "xyz"), '"xyz"' !== st.get(e) && (rt = !1), st.remove(e);
|
916
916
|
} catch (e) {
|
917
|
-
|
917
|
+
rt = !1;
|
918
918
|
}
|
919
|
-
return
|
919
|
+
return rt;
|
920
920
|
},
|
921
921
|
error: function(e) {
|
922
922
|
U.error("sessionStorage error: ", e);
|
923
923
|
},
|
924
924
|
get: function(e) {
|
925
925
|
try {
|
926
|
-
return null ==
|
926
|
+
return null == P ? void 0 : P.sessionStorage.getItem(e);
|
927
927
|
} catch (e) {
|
928
|
-
|
928
|
+
st.error(e);
|
929
929
|
}
|
930
930
|
return null;
|
931
931
|
},
|
932
932
|
parse: function(e) {
|
933
933
|
try {
|
934
|
-
return JSON.parse(
|
934
|
+
return JSON.parse(st.get(e)) || null;
|
935
935
|
} catch (e) {}
|
936
936
|
return null;
|
937
937
|
},
|
938
938
|
set: function(e, t) {
|
939
939
|
try {
|
940
|
-
null ==
|
940
|
+
null == P || P.sessionStorage.setItem(e, JSON.stringify(t));
|
941
941
|
} catch (e) {
|
942
|
-
|
942
|
+
st.error(e);
|
943
943
|
}
|
944
944
|
},
|
945
945
|
remove: function(e) {
|
946
946
|
try {
|
947
|
-
null ==
|
947
|
+
null == P || P.sessionStorage.removeItem(e);
|
948
948
|
} catch (e) {
|
949
|
-
|
949
|
+
st.error(e);
|
950
950
|
}
|
951
951
|
}
|
952
|
-
},
|
953
|
-
var t = null ==
|
952
|
+
}, ot = [ "localhost", "127.0.0.1" ], at = function(e) {
|
953
|
+
var t = null == A ? void 0 : A.createElement("a");
|
954
954
|
return w(t) ? null : (t.href = e, t);
|
955
|
-
},
|
955
|
+
}, ut = function(e, t) {
|
956
956
|
return !!function(e) {
|
957
957
|
try {
|
958
958
|
new RegExp(e);
|
@@ -961,14 +961,14 @@ var Qe, Ye = {
|
|
961
961
|
}
|
962
962
|
return !0;
|
963
963
|
}(t) && new RegExp(t).test(e);
|
964
|
-
},
|
964
|
+
}, lt = function(e) {
|
965
965
|
var t, n, i = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "&", r = [];
|
966
|
-
return
|
966
|
+
return V(e, (function(e, i) {
|
967
967
|
w(e) || w(i) || "undefined" === i || (t = encodeURIComponent(function(e) {
|
968
968
|
return e instanceof File;
|
969
969
|
}(e) ? e.name : e.toString()), n = encodeURIComponent(i), r[r.length] = n + "=" + t);
|
970
970
|
})), r.join(i);
|
971
|
-
},
|
971
|
+
}, ct = function(e, t) {
|
972
972
|
for (var n, i = ((e.split("#")[0] || "").split("?")[1] || "").split("&"), r = 0; r < i.length; r++) {
|
973
973
|
var s = i[r].split("=");
|
974
974
|
if (s[0] === t) {
|
@@ -984,10 +984,10 @@ var Qe, Ye = {
|
|
984
984
|
U.error("Skipping decoding for malformed query param: " + o);
|
985
985
|
}
|
986
986
|
return o.replace(/\+/g, " ");
|
987
|
-
},
|
987
|
+
}, dt = function(e, t) {
|
988
988
|
var n = e.match(new RegExp(t + "=([^&]*)"));
|
989
989
|
return n ? n[1] : null;
|
990
|
-
},
|
990
|
+
}, ht = "Mobile", ft = "iOS", pt = "Android", vt = "Tablet", gt = pt + " " + vt, _t = "iPad", mt = "Apple", yt = mt + " Watch", bt = "Safari", kt = "BlackBerry", wt = "Samsung", St = wt + "Browser", Ft = wt + " Internet", Et = "Chrome", Rt = Et + " OS", xt = Et + " " + ft, It = "Internet Explorer", Pt = It + " " + ht, Ct = "Opera", Tt = Ct + " Mini", $t = "Edge", Ot = "Microsoft " + $t, Mt = "Firefox", At = Mt + " " + ft, qt = "Nintendo", Lt = "PlayStation", Dt = "Xbox", Nt = pt + " " + ht, Bt = ht + " " + bt, Ht = "Windows", jt = Ht + " Phone", Ut = "Nokia", Wt = "Ouya", Gt = "Generic", zt = Gt + " " + ht.toLowerCase(), Vt = Gt + " " + vt.toLowerCase(), Qt = "Konqueror", Jt = "(\\d+(\\.\\d+)?)", Yt = new RegExp("Version/" + Jt), Xt = new RegExp(Dt, "i"), Kt = new RegExp(Lt + " \\w+", "i"), Zt = new RegExp(qt + " \\w+", "i"), en = new RegExp(kt + "|PlayBook|BB10", "i"), tn = {
|
991
991
|
"NT3.51": "NT 3.11",
|
992
992
|
"NT4.0": "NT 4.0",
|
993
993
|
"5.0": "2000",
|
@@ -1001,45 +1001,45 @@ var Qe, Ye = {
|
|
1001
1001
|
"10.0": "10"
|
1002
1002
|
};
|
1003
1003
|
|
1004
|
-
var
|
1005
|
-
return t &&
|
1006
|
-
return
|
1004
|
+
var nn = function(e, t) {
|
1005
|
+
return t && J(t, mt) || function(e) {
|
1006
|
+
return J(e, bt) && !J(e, Et) && !J(e, pt);
|
1007
1007
|
}(e);
|
1008
|
-
},
|
1009
|
-
return t = t || "",
|
1010
|
-
},
|
1011
|
-
o(
|
1012
|
-
o(
|
1013
|
-
o(
|
1014
|
-
o(
|
1015
|
-
o(
|
1016
|
-
o(
|
1017
|
-
o(
|
1018
|
-
return [
|
1019
|
-
} ], [ new RegExp(
|
1020
|
-
if (/Phone/.test(t) || /WPDesktop/.test(t)) return [
|
1021
|
-
if (new RegExp(
|
1008
|
+
}, rn = function(e, t) {
|
1009
|
+
return t = t || "", J(e, " OPR/") && J(e, "Mini") ? Tt : J(e, " OPR/") ? Ct : en.test(e) ? kt : J(e, "IE" + ht) || J(e, "WPDesktop") ? Pt : J(e, St) ? Ft : J(e, $t) || J(e, "Edg/") ? Ot : J(e, "FBIOS") ? "Facebook " + ht : J(e, Et) ? Et : J(e, "CriOS") ? xt : J(e, "UCWEB") || J(e, "UCBrowser") ? "UC Browser" : J(e, "FxiOS") ? At : J(e, pt) ? Nt : J(e.toLowerCase(), Qt.toLowerCase()) ? Qt : nn(e, t) ? J(e, ht) ? Bt : bt : J(e, Mt) ? Mt : J(e, "MSIE") || J(e, "Trident/") ? It : J(e, "Gecko") ? Mt : "";
|
1010
|
+
}, sn = (o(Ye = {}, Pt, [ new RegExp("rv:" + Jt) ]), o(Ye, Ot, [ new RegExp($t + "?\\/" + Jt) ]),
|
1011
|
+
o(Ye, Et, [ new RegExp(Et + "/" + Jt) ]), o(Ye, xt, [ new RegExp("CriOS\\/" + Jt) ]),
|
1012
|
+
o(Ye, "UC Browser", [ new RegExp("(UCBrowser|UCWEB)\\/" + Jt) ]), o(Ye, bt, [ Yt ]),
|
1013
|
+
o(Ye, Bt, [ Yt ]), o(Ye, Ct, [ new RegExp("(Opera|OPR)\\/" + Jt) ]), o(Ye, Mt, [ new RegExp(Mt + "\\/" + Jt) ]),
|
1014
|
+
o(Ye, At, [ new RegExp("FxiOS\\/" + Jt) ]), o(Ye, Qt, [ new RegExp("Konqueror[:/]?" + Jt, "i") ]),
|
1015
|
+
o(Ye, kt, [ new RegExp(kt + " " + Jt), Yt ]), o(Ye, Nt, [ new RegExp("android\\s" + Jt) ]),
|
1016
|
+
o(Ye, Ft, [ new RegExp(St + "\\/" + Jt) ]), o(Ye, It, [ new RegExp("(rv:|MSIE )" + Jt) ]),
|
1017
|
+
o(Ye, "Mozilla", [ new RegExp("rv:" + Jt) ]), Ye), on = [ [ new RegExp(Dt + "; " + Dt + " (.*?)[);]", "i"), function(e) {
|
1018
|
+
return [ Dt, e && e[1] || "" ];
|
1019
|
+
} ], [ new RegExp(qt, "i"), [ qt, "" ] ], [ new RegExp(Lt, "i"), [ Lt, "" ] ], [ en, [ kt, "" ] ], [ new RegExp(Ht, "i"), function(e, t) {
|
1020
|
+
if (/Phone/.test(t) || /WPDesktop/.test(t)) return [ jt, "" ];
|
1021
|
+
if (new RegExp(ht).test(t) && !/IEMobile\b/.test(t)) return [ Ht + " " + ht, "" ];
|
1022
1022
|
var n = /Windows NT ([0-9.]+)/i.exec(t);
|
1023
1023
|
if (n && n[1]) {
|
1024
|
-
var i = n[1], r =
|
1025
|
-
return /arm/i.test(t) && (r = "RT"), [
|
1024
|
+
var i = n[1], r = tn[i] || "";
|
1025
|
+
return /arm/i.test(t) && (r = "RT"), [ Ht, r ];
|
1026
1026
|
}
|
1027
|
-
return [
|
1027
|
+
return [ Ht, "" ];
|
1028
1028
|
} ], [ /((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/, function(e) {
|
1029
1029
|
if (e && e[3]) {
|
1030
1030
|
var t = [ e[3], e[4], e[5] || "0" ];
|
1031
|
-
return [
|
1031
|
+
return [ ft, t.join(".") ];
|
1032
1032
|
}
|
1033
|
-
return [
|
1033
|
+
return [ ft, "" ];
|
1034
1034
|
} ], [ /(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i, function(e) {
|
1035
1035
|
var t = "";
|
1036
1036
|
return e && e.length >= 3 && (t = w(e[2]) ? e[3] : e[2]), [ "watchOS", t ];
|
1037
|
-
} ], [ new RegExp("(" +
|
1037
|
+
} ], [ new RegExp("(" + pt + " (\\d+)\\.(\\d+)\\.?(\\d+)?|" + pt + ")", "i"), function(e) {
|
1038
1038
|
if (e && e[2]) {
|
1039
1039
|
var t = [ e[2], e[3], e[4] || "0" ];
|
1040
|
-
return [
|
1040
|
+
return [ pt, t.join(".") ];
|
1041
1041
|
}
|
1042
|
-
return [
|
1042
|
+
return [ pt, "" ];
|
1043
1043
|
} ], [ /Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i, function(e) {
|
1044
1044
|
var t = [ "Mac OS X", "" ];
|
1045
1045
|
if (e && e[1]) {
|
@@ -1047,32 +1047,32 @@ o(Qe, "Mozilla", [ new RegExp("rv:" + Gt) ]), Qe), rn = [ [ new RegExp(At + "; "
|
|
1047
1047
|
t[1] = n.join(".");
|
1048
1048
|
}
|
1049
1049
|
return t;
|
1050
|
-
} ], [ /Mac/i, [ "Mac OS X", "" ] ], [ /CrOS/, [
|
1051
|
-
return
|
1052
|
-
},
|
1050
|
+
} ], [ /Mac/i, [ "Mac OS X", "" ] ], [ /CrOS/, [ Rt, "" ] ], [ /Linux|debian/i, [ "Linux", "" ] ] ], an = function(e) {
|
1051
|
+
return Zt.test(e) ? qt : Kt.test(e) ? Lt : Xt.test(e) ? Dt : new RegExp(Wt, "i").test(e) ? Wt : new RegExp("(" + jt + "|WPDesktop)", "i").test(e) ? jt : /iPad/.test(e) ? _t : /iPod/.test(e) ? "iPod Touch" : /iPhone/.test(e) ? "iPhone" : /(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e) ? yt : en.test(e) ? kt : /(kobo)\s(ereader|touch)/i.test(e) ? "Kobo" : new RegExp(Ut, "i").test(e) ? Ut : /(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e) || /(kf[a-z]+)( bui|\)).+silk\//i.test(e) ? "Kindle Fire" : /(Android|ZTE)/i.test(e) ? !new RegExp(ht).test(e) || /(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e) ? /pixel[\daxl ]{1,6}/i.test(e) && !/pixel c/i.test(e) || /(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e) || /lmy47v/i.test(e) && !/QTAQZ3/i.test(e) ? pt : gt : pt : new RegExp("(pda|" + ht + ")", "i").test(e) ? zt : new RegExp(vt, "i").test(e) && !new RegExp(vt + " pc", "i").test(e) ? Vt : "";
|
1052
|
+
}, un = "https?://(.*)", ln = [ "utm_source", "utm_medium", "utm_campaign", "utm_content", "utm_term", "gclid", "gad_source", "gclsrc", "dclid", "gbraid", "wbraid", "fbclid", "msclkid", "twclid", "li_fat_id", "mc_cid", "igshid", "ttclid" ], cn = {
|
1053
1053
|
campaignParams: function(e) {
|
1054
|
-
var t =
|
1055
|
-
return
|
1056
|
-
var t =
|
1054
|
+
var t = ln.concat(e || []), n = {};
|
1055
|
+
return V(t, (function(e) {
|
1056
|
+
var t = A ? ct(A.URL, e) : "";
|
1057
1057
|
t.length && (n[e] = t);
|
1058
1058
|
})), n;
|
1059
1059
|
},
|
1060
1060
|
searchEngine: function() {
|
1061
|
-
var e = null ==
|
1062
|
-
return e ? 0 === e.search(
|
1061
|
+
var e = null == A ? void 0 : A.referrer;
|
1062
|
+
return e ? 0 === e.search(un + "google.([^/?]*)") ? "google" : 0 === e.search(un + "bing.com") ? "bing" : 0 === e.search(un + "yahoo.com") ? "yahoo" : 0 === e.search(un + "duckduckgo.com") ? "duckduckgo" : null : null;
|
1063
1063
|
},
|
1064
1064
|
searchInfo: function() {
|
1065
|
-
var e =
|
1065
|
+
var e = cn.searchEngine(), t = "yahoo" != e ? "q" : "p", n = {};
|
1066
1066
|
if (!F(e)) {
|
1067
1067
|
n.$search_engine = e;
|
1068
|
-
var i =
|
1068
|
+
var i = A ? ct(A.referrer, t) : "";
|
1069
1069
|
i.length && (n.ph_keyword = i);
|
1070
1070
|
}
|
1071
1071
|
return n;
|
1072
1072
|
},
|
1073
|
-
browser:
|
1073
|
+
browser: rn,
|
1074
1074
|
browserVersion: function(e, t) {
|
1075
|
-
var n =
|
1075
|
+
var n = rn(e, t), i = sn[n];
|
1076
1076
|
if (w(i)) return null;
|
1077
1077
|
for (var r = 0; r < i.length; r++) {
|
1078
1078
|
var s = i[r], o = e.match(s);
|
@@ -1084,23 +1084,23 @@ o(Qe, "Mozilla", [ new RegExp("rv:" + Gt) ]), Qe), rn = [ [ new RegExp(At + "; "
|
|
1084
1084
|
return navigator.language || navigator.userLanguage;
|
1085
1085
|
},
|
1086
1086
|
os: function(e) {
|
1087
|
-
for (var t = 0; t <
|
1088
|
-
var n = u(
|
1087
|
+
for (var t = 0; t < on.length; t++) {
|
1088
|
+
var n = u(on[t], 2), i = n[0], r = n[1], s = i.exec(e), o = s && (y(r) ? r(s, e) : r);
|
1089
1089
|
if (o) return o;
|
1090
1090
|
}
|
1091
1091
|
return [ "", "" ];
|
1092
1092
|
},
|
1093
|
-
device:
|
1093
|
+
device: an,
|
1094
1094
|
deviceType: function(e) {
|
1095
|
-
var t =
|
1096
|
-
return t ===
|
1095
|
+
var t = an(e);
|
1096
|
+
return t === _t || t === gt || "Kobo" === t || "Kindle Fire" === t || t === Vt ? vt : t === qt || t === Dt || t === Lt || t === Wt ? "Console" : t === yt ? "Wearable" : t ? ht : "Desktop";
|
1097
1097
|
},
|
1098
1098
|
referrer: function() {
|
1099
|
-
return (null ==
|
1099
|
+
return (null == A ? void 0 : A.referrer) || "$direct";
|
1100
1100
|
},
|
1101
1101
|
referringDomain: function() {
|
1102
1102
|
var e;
|
1103
|
-
return null !=
|
1103
|
+
return null != A && A.referrer && (null === (e = at(A.referrer)) || void 0 === e ? void 0 : e.host) || "$direct";
|
1104
1104
|
},
|
1105
1105
|
referrerInfo: function() {
|
1106
1106
|
return {
|
@@ -1110,42 +1110,42 @@ o(Qe, "Mozilla", [ new RegExp("rv:" + Gt) ]), Qe), rn = [ [ new RegExp(At + "; "
|
|
1110
1110
|
},
|
1111
1111
|
properties: function() {
|
1112
1112
|
if (!B) return {};
|
1113
|
-
var e = u(
|
1113
|
+
var e = u(cn.os(B), 2), t = e[0], n = e[1];
|
1114
1114
|
return Q(ee({
|
1115
1115
|
$os: t,
|
1116
1116
|
$os_version: n,
|
1117
|
-
$browser:
|
1118
|
-
$device:
|
1119
|
-
$device_type:
|
1117
|
+
$browser: cn.browser(B, navigator.vendor),
|
1118
|
+
$device: cn.device(B),
|
1119
|
+
$device_type: cn.deviceType(B)
|
1120
1120
|
}), {
|
1121
|
-
$current_url: null ==
|
1122
|
-
$host: null ==
|
1123
|
-
$pathname: null ==
|
1121
|
+
$current_url: null == q ? void 0 : q.href,
|
1122
|
+
$host: null == q ? void 0 : q.host,
|
1123
|
+
$pathname: null == q ? void 0 : q.pathname,
|
1124
1124
|
$raw_user_agent: B.length > 1e3 ? B.substring(0, 997) + "..." : B,
|
1125
|
-
$browser_version:
|
1126
|
-
$browser_language:
|
1127
|
-
$screen_height: null ==
|
1128
|
-
$screen_width: null ==
|
1129
|
-
$viewport_height: null ==
|
1130
|
-
$viewport_width: null ==
|
1125
|
+
$browser_version: cn.browserVersion(B, navigator.vendor),
|
1126
|
+
$browser_language: cn.browserLanguage(),
|
1127
|
+
$screen_height: null == P ? void 0 : P.screen.height,
|
1128
|
+
$screen_width: null == P ? void 0 : P.screen.width,
|
1129
|
+
$viewport_height: null == P ? void 0 : P.innerHeight,
|
1130
|
+
$viewport_width: null == P ? void 0 : P.innerWidth,
|
1131
1131
|
$lib: "web",
|
1132
1132
|
$lib_version: f.LIB_VERSION,
|
1133
1133
|
$insert_id: Math.random().toString(36).substring(2, 10) + Math.random().toString(36).substring(2, 10),
|
1134
|
-
$time:
|
1134
|
+
$time: X() / 1e3
|
1135
1135
|
});
|
1136
1136
|
},
|
1137
1137
|
people_properties: function() {
|
1138
1138
|
if (!B) return {};
|
1139
|
-
var e = u(
|
1139
|
+
var e = u(cn.os(B), 2), t = e[0], n = e[1];
|
1140
1140
|
return Q(ee({
|
1141
1141
|
$os: t,
|
1142
1142
|
$os_version: n,
|
1143
|
-
$browser:
|
1143
|
+
$browser: cn.browser(B, navigator.vendor)
|
1144
1144
|
}), {
|
1145
|
-
$browser_version:
|
1145
|
+
$browser_version: cn.browserVersion(B, navigator.vendor)
|
1146
1146
|
});
|
1147
1147
|
}
|
1148
|
-
},
|
1148
|
+
}, dn = [ "cookie", "localstorage", "localstorage+cookie", "sessionstorage", "memory" ], hn = function() {
|
1149
1149
|
function e(t) {
|
1150
1150
|
i(this, e), this.config = t, this.props = {}, this.campaign_params_saved = !1, this.name = function(e) {
|
1151
1151
|
var t = "";
|
@@ -1157,18 +1157,18 @@ o(Qe, "Mozilla", [ new RegExp("rv:" + Gt) ]), Qe), rn = [ [ new RegExp(At + "; "
|
|
1157
1157
|
return s(e, [ {
|
1158
1158
|
key: "buildStorage",
|
1159
1159
|
value: function(e) {
|
1160
|
-
-1 ===
|
1160
|
+
-1 === dn.indexOf(e.persistence.toLowerCase()) && (U.critical("Unknown persistence type " + e.persistence + "; falling back to localStorage+cookie"),
|
1161
1161
|
e.persistence = "localStorage+cookie");
|
1162
1162
|
var t = e.persistence.toLowerCase();
|
1163
|
-
return "localstorage" === t &&
|
1163
|
+
return "localstorage" === t && Ze.is_supported() ? Ze : "localstorage+cookie" === t && tt.is_supported() ? tt : "sessionstorage" === t && st.is_supported() ? st : "memory" === t ? it : "cookie" === t ? Xe : tt.is_supported() ? tt : Xe;
|
1164
1164
|
}
|
1165
1165
|
}, {
|
1166
1166
|
key: "properties",
|
1167
1167
|
value: function() {
|
1168
1168
|
var e = {};
|
1169
|
-
return
|
1170
|
-
if (n ===
|
1171
|
-
a = !1, (F(s =
|
1169
|
+
return V(this.props, (function(t, n) {
|
1170
|
+
if (n === ye && b(t)) for (var i = Object.keys(t), r = 0; r < i.length; r++) e["$feature/".concat(i[r])] = t[i[r]]; else o = n,
|
1171
|
+
a = !1, (F(s = $e) ? a : O && s.indexOf === O ? -1 != s.indexOf(o) : (V(s, (function(e) {
|
1172
1172
|
if (a || (a = e === o)) return W;
|
1173
1173
|
})), a)) || (e[n] = t);
|
1174
1174
|
var s, o, a;
|
@@ -1204,7 +1204,7 @@ o(Qe, "Mozilla", [ new RegExp("rv:" + Gt) ]), Qe), rn = [ [ new RegExp(At + "; "
|
|
1204
1204
|
if (b(e)) {
|
1205
1205
|
w(t) && (t = "None"), this.expire_days = w(n) ? this.default_expiry : n;
|
1206
1206
|
var r = !1;
|
1207
|
-
if (
|
1207
|
+
if (V(e, (function(e, n) {
|
1208
1208
|
i.props.hasOwnProperty(n) && i.props[n] !== t || (i.props[n] = e, r = !0);
|
1209
1209
|
})), r) return this.save(), !0;
|
1210
1210
|
}
|
@@ -1217,7 +1217,7 @@ o(Qe, "Mozilla", [ new RegExp("rv:" + Gt) ]), Qe), rn = [ [ new RegExp(At + "; "
|
|
1217
1217
|
if (b(e)) {
|
1218
1218
|
this.expire_days = w(t) ? this.default_expiry : t;
|
1219
1219
|
var i = !1;
|
1220
|
-
if (
|
1220
|
+
if (V(e, (function(t, r) {
|
1221
1221
|
e.hasOwnProperty(r) && n.props[r] !== t && (n.props[r] = t, i = !0);
|
1222
1222
|
})), i) return this.save(), !0;
|
1223
1223
|
}
|
@@ -1231,28 +1231,28 @@ o(Qe, "Mozilla", [ new RegExp("rv:" + Gt) ]), Qe), rn = [ [ new RegExp(At + "; "
|
|
1231
1231
|
}, {
|
1232
1232
|
key: "update_campaign_params",
|
1233
1233
|
value: function() {
|
1234
|
-
this.campaign_params_saved || (this.register(
|
1234
|
+
this.campaign_params_saved || (this.register(cn.campaignParams(this.config.custom_campaign_params)),
|
1235
1235
|
this.campaign_params_saved = !0);
|
1236
1236
|
}
|
1237
1237
|
}, {
|
1238
1238
|
key: "set_initial_campaign_params",
|
1239
1239
|
value: function() {
|
1240
|
-
this.register_once(o({},
|
1240
|
+
this.register_once(o({}, Ie, cn.campaignParams(this.config.custom_campaign_params)), void 0);
|
1241
1241
|
}
|
1242
1242
|
}, {
|
1243
1243
|
key: "update_search_keyword",
|
1244
1244
|
value: function() {
|
1245
|
-
this.register(
|
1245
|
+
this.register(cn.searchInfo());
|
1246
1246
|
}
|
1247
1247
|
}, {
|
1248
1248
|
key: "update_referrer_info",
|
1249
1249
|
value: function() {
|
1250
|
-
this.register(
|
1250
|
+
this.register(cn.referrerInfo());
|
1251
1251
|
}
|
1252
1252
|
}, {
|
1253
1253
|
key: "set_initial_referrer_info",
|
1254
1254
|
value: function() {
|
1255
|
-
this.register_once(o({},
|
1255
|
+
this.register_once(o({}, Pe, cn.referrerInfo()), void 0);
|
1256
1256
|
}
|
1257
1257
|
}, {
|
1258
1258
|
key: "get_referrer_info",
|
@@ -1266,9 +1266,9 @@ o(Qe, "Mozilla", [ new RegExp("rv:" + Gt) ]), Qe), rn = [ [ new RegExp(At + "; "
|
|
1266
1266
|
key: "get_initial_props",
|
1267
1267
|
value: function() {
|
1268
1268
|
var e = this, t = {};
|
1269
|
-
return
|
1269
|
+
return V([ Pe, Ie ], (function(n) {
|
1270
1270
|
var i = e.props[n];
|
1271
|
-
i &&
|
1271
|
+
i && V(i, (function(e, n) {
|
1272
1272
|
var i;
|
1273
1273
|
t["$initial_" + (i = n, i.replace(/^\$/, ""))] = e;
|
1274
1274
|
}));
|
@@ -1277,7 +1277,7 @@ o(Qe, "Mozilla", [ new RegExp("rv:" + Gt) ]), Qe), rn = [ [ new RegExp(At + "; "
|
|
1277
1277
|
}, {
|
1278
1278
|
key: "safe_merge",
|
1279
1279
|
value: function(e) {
|
1280
|
-
return
|
1280
|
+
return V(this.props, (function(t, n) {
|
1281
1281
|
n in e || (e[n] = t);
|
1282
1282
|
})), e;
|
1283
1283
|
}
|
@@ -1324,29 +1324,19 @@ o(Qe, "Mozilla", [ new RegExp("rv:" + Gt) ]), Qe), rn = [ [ new RegExp(At + "; "
|
|
1324
1324
|
return w(t) || (delete this.props[ue][e], this.save()), t;
|
1325
1325
|
}
|
1326
1326
|
}, {
|
1327
|
-
key: "
|
1328
|
-
value: function() {
|
1329
|
-
return this.props[Fe] || "anonymous";
|
1330
|
-
}
|
1331
|
-
}, {
|
1332
|
-
key: "set_user_state",
|
1327
|
+
key: "get_property",
|
1333
1328
|
value: function(e) {
|
1334
|
-
this.props[
|
1329
|
+
return this.props[e];
|
1335
1330
|
}
|
1336
1331
|
}, {
|
1337
|
-
key: "
|
1338
|
-
value: function() {
|
1339
|
-
|
1340
|
-
}
|
1341
|
-
}, {
|
1342
|
-
key: "set_quota_limits",
|
1343
|
-
value: function(e) {
|
1344
|
-
this.props[Re] = e, this.save();
|
1332
|
+
key: "set_property",
|
1333
|
+
value: function(e, t) {
|
1334
|
+
this.props[e] = t, this.save();
|
1345
1335
|
}
|
1346
1336
|
} ]), e;
|
1347
|
-
}(),
|
1337
|
+
}(), fn = 2, pn = 4;
|
1348
1338
|
|
1349
|
-
var
|
1339
|
+
var vn = s((function e(t) {
|
1350
1340
|
var n, r, s = this, a = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
|
1351
1341
|
i(this, e), o(this, "bucketSize", 100), o(this, "refillRate", 10), o(this, "mutationBuckets", {}),
|
1352
1342
|
o(this, "loggedTracker", {}), o(this, "refillBuckets", (function() {
|
@@ -1381,17 +1371,17 @@ var fn = s((function e(t) {
|
|
1381
1371
|
setInterval((function() {
|
1382
1372
|
s.refillBuckets();
|
1383
1373
|
}), 1e3);
|
1384
|
-
})),
|
1374
|
+
})), gn = function(e) {
|
1385
1375
|
return e[e.DomContentLoaded = 0] = "DomContentLoaded", e[e.Load = 1] = "Load", e[e.FullSnapshot = 2] = "FullSnapshot",
|
1386
1376
|
e[e.IncrementalSnapshot = 3] = "IncrementalSnapshot", e[e.Meta = 4] = "Meta", e[e.Custom = 5] = "Custom",
|
1387
1377
|
e[e.Plugin = 6] = "Plugin", e;
|
1388
|
-
}(
|
1378
|
+
}(gn || {});
|
1389
1379
|
|
1390
|
-
function
|
1391
|
-
return e ?
|
1380
|
+
function _n(e) {
|
1381
|
+
return e ? G(e).split(/\s+/) : [];
|
1392
1382
|
}
|
1393
1383
|
|
1394
|
-
function
|
1384
|
+
function mn(e) {
|
1395
1385
|
var t = "";
|
1396
1386
|
switch (n(e.className)) {
|
1397
1387
|
case "string":
|
@@ -1405,51 +1395,51 @@ function vn(e) {
|
|
1405
1395
|
default:
|
1406
1396
|
t = "";
|
1407
1397
|
}
|
1408
|
-
return
|
1398
|
+
return _n(t);
|
1409
1399
|
}
|
1410
1400
|
|
1411
|
-
function
|
1412
|
-
return
|
1413
|
-
return
|
1401
|
+
function yn(e) {
|
1402
|
+
return E(e) ? null : G(e).split(/(\s+)/).filter((function(e) {
|
1403
|
+
return qn(e);
|
1414
1404
|
})).join("").replace(/[\r\n]/g, " ").replace(/[ ]+/g, " ").substring(0, 255);
|
1415
1405
|
}
|
1416
1406
|
|
1417
|
-
function
|
1407
|
+
function bn(e) {
|
1418
1408
|
var t = "";
|
1419
|
-
return
|
1409
|
+
return In(e) && !Pn(e) && e.childNodes && e.childNodes.length && V(e.childNodes, (function(e) {
|
1420
1410
|
var n;
|
1421
|
-
|
1422
|
-
})),
|
1411
|
+
Sn(e) && e.textContent && (t += null !== (n = yn(e.textContent)) && void 0 !== n ? n : "");
|
1412
|
+
})), G(t);
|
1423
1413
|
}
|
1424
1414
|
|
1425
|
-
function
|
1415
|
+
function kn(e) {
|
1426
1416
|
return !!e && 1 === e.nodeType;
|
1427
1417
|
}
|
1428
1418
|
|
1429
|
-
function
|
1419
|
+
function wn(e, t) {
|
1430
1420
|
return !!e && !!e.tagName && e.tagName.toLowerCase() === t.toLowerCase();
|
1431
1421
|
}
|
1432
1422
|
|
1433
|
-
function
|
1423
|
+
function Sn(e) {
|
1434
1424
|
return !!e && 3 === e.nodeType;
|
1435
1425
|
}
|
1436
1426
|
|
1437
|
-
function
|
1427
|
+
function Fn(e) {
|
1438
1428
|
return !!e && 11 === e.nodeType;
|
1439
1429
|
}
|
1440
1430
|
|
1441
|
-
var
|
1431
|
+
var En = [ "a", "button", "form", "input", "select", "textarea", "label" ];
|
1442
1432
|
|
1443
|
-
function
|
1433
|
+
function Rn(e) {
|
1444
1434
|
var t = e.parentNode;
|
1445
|
-
return !(!t || !
|
1435
|
+
return !(!t || !kn(t)) && t;
|
1446
1436
|
}
|
1447
1437
|
|
1448
|
-
function
|
1438
|
+
function xn(e, t) {
|
1449
1439
|
var i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : void 0, r = arguments.length > 3 ? arguments[3] : void 0, s = arguments.length > 4 ? arguments[4] : void 0;
|
1450
|
-
if (!
|
1440
|
+
if (!P || !e || wn(e, "html") || !kn(e)) return !1;
|
1451
1441
|
if (null != i && i.url_allowlist) {
|
1452
|
-
var o =
|
1442
|
+
var o = P.location.href, a = i.url_allowlist;
|
1453
1443
|
if (a && !a.some((function(e) {
|
1454
1444
|
return o.match(e);
|
1455
1445
|
}))) return !1;
|
@@ -1460,11 +1450,11 @@ function Rn(e, t) {
|
|
1460
1450
|
return t.type === e;
|
1461
1451
|
}))) return !1;
|
1462
1452
|
}
|
1463
|
-
for (var l = !1, c = [ e ], d = !0, f = e; f.parentNode && !
|
1453
|
+
for (var l = !1, c = [ e ], d = !0, f = e; f.parentNode && !wn(f, "body"); ) if (Fn(f.parentNode)) c.push(f.parentNode.host),
|
1464
1454
|
f = f.parentNode.host; else {
|
1465
|
-
if (!(d =
|
1466
|
-
if (r ||
|
1467
|
-
var p =
|
1455
|
+
if (!(d = Rn(f))) break;
|
1456
|
+
if (r || En.indexOf(d.tagName.toLowerCase()) > -1) l = !0; else {
|
1457
|
+
var p = P.getComputedStyle(d);
|
1468
1458
|
p && "pointer" === p.getPropertyValue("cursor") && (l = !0);
|
1469
1459
|
}
|
1470
1460
|
c.push(d), f = d;
|
@@ -1517,10 +1507,10 @@ function Rn(e, t) {
|
|
1517
1507
|
}
|
1518
1508
|
return !1;
|
1519
1509
|
}(c, i)) return !1;
|
1520
|
-
var
|
1521
|
-
if (
|
1522
|
-
var
|
1523
|
-
switch (
|
1510
|
+
var v = P.getComputedStyle(e);
|
1511
|
+
if (v && "pointer" === v.getPropertyValue("cursor") && "click" === t.type) return !0;
|
1512
|
+
var g = e.tagName.toLowerCase();
|
1513
|
+
switch (g) {
|
1524
1514
|
case "html":
|
1525
1515
|
return !1;
|
1526
1516
|
|
@@ -1533,16 +1523,16 @@ function Rn(e, t) {
|
|
1533
1523
|
return (s || [ "change", "click" ]).indexOf(t.type) >= 0;
|
1534
1524
|
|
1535
1525
|
default:
|
1536
|
-
return l ? (s || [ "click" ]).indexOf(t.type) >= 0 : (s || [ "click" ]).indexOf(t.type) >= 0 && (
|
1526
|
+
return l ? (s || [ "click" ]).indexOf(t.type) >= 0 : (s || [ "click" ]).indexOf(t.type) >= 0 && (En.indexOf(g) > -1 || "true" === e.getAttribute("contenteditable"));
|
1537
1527
|
}
|
1538
1528
|
}
|
1539
1529
|
|
1540
|
-
function
|
1541
|
-
for (var t = e; t.parentNode && !
|
1542
|
-
var n =
|
1543
|
-
if (
|
1530
|
+
function In(e) {
|
1531
|
+
for (var t = e; t.parentNode && !wn(t, "body"); t = t.parentNode) {
|
1532
|
+
var n = mn(t);
|
1533
|
+
if (J(n, "ph-sensitive") || J(n, "ph-no-capture")) return !1;
|
1544
1534
|
}
|
1545
|
-
if (
|
1535
|
+
if (J(mn(e), "ph-include")) return !0;
|
1546
1536
|
var i = e.type || "";
|
1547
1537
|
if (S(i)) switch (i.toLowerCase()) {
|
1548
1538
|
case "hidden":
|
@@ -1556,41 +1546,41 @@ function Pn(e) {
|
|
1556
1546
|
return !0;
|
1557
1547
|
}
|
1558
1548
|
|
1559
|
-
function
|
1560
|
-
return !!(
|
1549
|
+
function Pn(e) {
|
1550
|
+
return !!(wn(e, "input") && ![ "button", "checkbox", "submit", "reset" ].includes(e.type) || wn(e, "select") || wn(e, "textarea") || "true" === e.getAttribute("contenteditable"));
|
1561
1551
|
}
|
1562
1552
|
|
1563
|
-
var
|
1553
|
+
var Cn = "(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})", Tn = new RegExp("^(?:".concat(Cn, ")$")), $n = new RegExp(Cn), On = "\\d{3}-?\\d{2}-?\\d{4}", Mn = new RegExp("^(".concat(On, ")$")), An = new RegExp("(".concat(On, ")"));
|
1564
1554
|
|
1565
|
-
function
|
1555
|
+
function qn(e) {
|
1566
1556
|
var t = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1];
|
1567
|
-
if (
|
1557
|
+
if (E(e)) return !1;
|
1568
1558
|
if (S(e)) {
|
1569
|
-
if (e =
|
1570
|
-
if ((t ?
|
1559
|
+
if (e = G(e), (t ? Tn : $n).test((e || "").replace(/[- ]/g, ""))) return !1;
|
1560
|
+
if ((t ? Mn : An).test(e)) return !1;
|
1571
1561
|
}
|
1572
1562
|
return !0;
|
1573
1563
|
}
|
1574
1564
|
|
1575
|
-
function
|
1576
|
-
var t =
|
1577
|
-
return
|
1565
|
+
function Ln(e) {
|
1566
|
+
var t = bn(e);
|
1567
|
+
return qn(t = "".concat(t, " ").concat(Dn(e)).trim()) ? t : "";
|
1578
1568
|
}
|
1579
1569
|
|
1580
|
-
function
|
1570
|
+
function Dn(e) {
|
1581
1571
|
var t = "";
|
1582
|
-
return e && e.childNodes && e.childNodes.length &&
|
1572
|
+
return e && e.childNodes && e.childNodes.length && V(e.childNodes, (function(e) {
|
1583
1573
|
var n;
|
1584
1574
|
if (e && "span" === (null === (n = e.tagName) || void 0 === n ? void 0 : n.toLowerCase())) try {
|
1585
|
-
var i =
|
1586
|
-
t = "".concat(t, " ").concat(i).trim(), e.childNodes && e.childNodes.length && (t = "".concat(t, " ").concat(
|
1575
|
+
var i = bn(e);
|
1576
|
+
t = "".concat(t, " ").concat(i).trim(), e.childNodes && e.childNodes.length && (t = "".concat(t, " ").concat(Dn(e)).trim());
|
1587
1577
|
} catch (e) {
|
1588
1578
|
U.error(e);
|
1589
1579
|
}
|
1590
1580
|
})), t;
|
1591
1581
|
}
|
1592
1582
|
|
1593
|
-
function
|
1583
|
+
function Nn(e) {
|
1594
1584
|
return function(e) {
|
1595
1585
|
var n = e.map((function(e) {
|
1596
1586
|
var n, i, r = "";
|
@@ -1618,13 +1608,13 @@ function Dn(e) {
|
|
1618
1608
|
} : {}), e.attr_id ? {
|
1619
1609
|
attr_id: e.attr_id
|
1620
1610
|
} : {}), e.attributes), c = {};
|
1621
|
-
return
|
1611
|
+
return Y(l).sort((function(e, t) {
|
1622
1612
|
var n = u(e, 1)[0], i = u(t, 1)[0];
|
1623
1613
|
return n.localeCompare(i);
|
1624
1614
|
})).forEach((function(e) {
|
1625
1615
|
var t = u(e, 2), n = t[0], i = t[1];
|
1626
|
-
return c[
|
1627
|
-
})), r += ":", r +=
|
1616
|
+
return c[Bn(n.toString())] = Bn(i.toString());
|
1617
|
+
})), r += ":", r += Y(l).map((function(e) {
|
1628
1618
|
var t = u(e, 2), n = t[0], i = t[1];
|
1629
1619
|
return "".concat(n, '="').concat(i, '"');
|
1630
1620
|
})).join("");
|
@@ -1636,13 +1626,13 @@ function Dn(e) {
|
|
1636
1626
|
text: null === (t = e.$el_text) || void 0 === t ? void 0 : t.slice(0, 400),
|
1637
1627
|
tag_name: e.tag_name,
|
1638
1628
|
href: null === (n = e.attr__href) || void 0 === n ? void 0 : n.slice(0, 2048),
|
1639
|
-
attr_class:
|
1629
|
+
attr_class: Hn(e),
|
1640
1630
|
attr_id: e.attr__id,
|
1641
1631
|
nth_child: e.nth_child,
|
1642
1632
|
nth_of_type: e.nth_of_type,
|
1643
1633
|
attributes: {}
|
1644
1634
|
};
|
1645
|
-
return
|
1635
|
+
return Y(e).filter((function(e) {
|
1646
1636
|
return 0 === u(e, 1)[0].indexOf("attr__");
|
1647
1637
|
})).forEach((function(e) {
|
1648
1638
|
var t = u(e, 2), n = t[0], r = t[1];
|
@@ -1652,16 +1642,16 @@ function Dn(e) {
|
|
1652
1642
|
}(e));
|
1653
1643
|
}
|
1654
1644
|
|
1655
|
-
function
|
1645
|
+
function Bn(e) {
|
1656
1646
|
return e.replace(/"|\\"/g, '\\"');
|
1657
1647
|
}
|
1658
1648
|
|
1659
|
-
function
|
1649
|
+
function Hn(e) {
|
1660
1650
|
var t = e.attr__class;
|
1661
|
-
return t ? m(t) ? t :
|
1651
|
+
return t ? m(t) ? t : _n(t) : void 0;
|
1662
1652
|
}
|
1663
1653
|
|
1664
|
-
var
|
1654
|
+
var jn = "[SessionRecording]", Un = {
|
1665
1655
|
initiatorTypes: [ "audio", "beacon", "body", "css", "early-hint", "embed", "fetch", "frame", "iframe", "icon", "image", "img", "input", "link", "navigation", "object", "ping", "script", "track", "video", "xmlhttprequest" ],
|
1666
1656
|
maskRequestFn: function(e) {
|
1667
1657
|
return e;
|
@@ -1672,29 +1662,29 @@ var Bn = "[SessionRecording]", Hn = {
|
|
1672
1662
|
recordPerformance: !1,
|
1673
1663
|
performanceEntryTypeToObserve: [ "first-input", "navigation", "paint", "resource" ],
|
1674
1664
|
payloadSizeLimitBytes: 1e6
|
1675
|
-
},
|
1665
|
+
}, Wn = [ "authorization", "x-forwarded-for", "authorization", "cookie", "set-cookie", "x-api-key", "x-real-ip", "remote-addr", "forwarded", "proxy-authorization", "x-csrf-token", "x-csrftoken", "x-xsrf-token" ], Gn = [ "password", "secret", "passwd", "api_key", "apikey", "auth", "credentials", "mysql_pwd", "privatekey", "private_key", "token" ], zn = [ "/s/", "/e/", "/i/" ];
|
1676
1666
|
|
1677
1667
|
function Vn(e, t, n, i) {
|
1678
|
-
if (
|
1668
|
+
if (E(e)) return e;
|
1679
1669
|
var r = (null == t ? void 0 : t["content-length"]) || function(e) {
|
1680
1670
|
return new Blob([ e ]).size;
|
1681
1671
|
}(e);
|
1682
|
-
return S(r) && (r = parseInt(r)), r > n ?
|
1672
|
+
return S(r) && (r = parseInt(r)), r > n ? jn + " ".concat(i, " body too large to record (").concat(r, " bytes)") : e;
|
1683
1673
|
}
|
1684
1674
|
|
1685
|
-
function
|
1686
|
-
if (
|
1675
|
+
function Qn(e, t) {
|
1676
|
+
if (E(e)) return e;
|
1687
1677
|
var n = e;
|
1688
|
-
return
|
1678
|
+
return qn(n, !1) || (n = jn + " " + t + " body redacted"), V(Gn, (function(e) {
|
1689
1679
|
var i, r;
|
1690
|
-
null !== (i = n) && void 0 !== i && i.length && -1 !== (null === (r = n) || void 0 === r ? void 0 : r.indexOf(e)) && (n =
|
1680
|
+
null !== (i = n) && void 0 !== i && i.length && -1 !== (null === (r = n) || void 0 === r ? void 0 : r.indexOf(e)) && (n = jn + " " + t + " body redacted as might contain: " + e);
|
1691
1681
|
})), n;
|
1692
1682
|
}
|
1693
1683
|
|
1694
|
-
var
|
1684
|
+
var Jn = function(e, n) {
|
1695
1685
|
var i, r, s, o = {
|
1696
|
-
payloadSizeLimitBytes:
|
1697
|
-
performanceEntryTypeToObserve: l(
|
1686
|
+
payloadSizeLimitBytes: Un.payloadSizeLimitBytes,
|
1687
|
+
performanceEntryTypeToObserve: l(Un.performanceEntryTypeToObserve)
|
1698
1688
|
}, a = !1 !== e.session_recording.recordHeaders && n.recordHeaders, u = !1 !== e.session_recording.recordBody && n.recordBody, c = !1 !== e.capture_performance && n.recordPerformance, d = (i = o,
|
1699
1689
|
s = Math.min(1e6, null !== (r = i.payloadSizeLimitBytes) && void 0 !== r ? r : 1e6),
|
1700
1690
|
function(e) {
|
@@ -1703,13 +1693,13 @@ var Gn = function(e, n) {
|
|
1703
1693
|
e;
|
1704
1694
|
}), h = function(e) {
|
1705
1695
|
return d(function(e) {
|
1706
|
-
var t =
|
1707
|
-
if (!(t && t.pathname &&
|
1696
|
+
var t = at(e.name);
|
1697
|
+
if (!(t && t.pathname && zn.some((function(e) {
|
1708
1698
|
return 0 === t.pathname.indexOf(e);
|
1709
1699
|
})))) return e;
|
1710
|
-
}((t = e,
|
1700
|
+
}((t = e, V(Object.keys(null !== (n = t.requestHeaders) && void 0 !== n ? n : {}), (function(e) {
|
1711
1701
|
var n;
|
1712
|
-
|
1702
|
+
Wn.includes(e.toLowerCase()) && (null === (n = t.requestHeaders) || void 0 === n || delete n[e]);
|
1713
1703
|
})), t)));
|
1714
1704
|
var t, n;
|
1715
1705
|
}, f = y(e.session_recording.maskNetworkRequestFn);
|
@@ -1726,69 +1716,69 @@ var Gn = function(e, n) {
|
|
1726
1716
|
return s && null !== (n = null === (i = (r = e.session_recording).maskCapturedNetworkRequestFn) || void 0 === i ? void 0 : i.call(r, s)) && void 0 !== n ? n : void 0;
|
1727
1717
|
} : function(e) {
|
1728
1718
|
return function(e) {
|
1729
|
-
if (!w(e)) return e.requestBody =
|
1719
|
+
if (!w(e)) return e.requestBody = Qn(e.requestBody, "Request"), e.responseBody = Qn(e.responseBody, "Response"),
|
1730
1720
|
e;
|
1731
1721
|
}(h(e));
|
1732
|
-
}, t(t(t({},
|
1722
|
+
}, t(t(t({}, Un), o), {}, {
|
1733
1723
|
recordHeaders: a,
|
1734
1724
|
recordBody: u,
|
1735
1725
|
recordPerformance: c,
|
1736
1726
|
recordInitialRequests: c
|
1737
1727
|
});
|
1738
|
-
},
|
1728
|
+
}, Yn = "__ph_opt_in_out_";
|
1739
1729
|
|
1740
|
-
function
|
1741
|
-
|
1730
|
+
function Xn(e, t) {
|
1731
|
+
si(!0, e, t);
|
1742
1732
|
}
|
1743
1733
|
|
1744
|
-
function
|
1745
|
-
|
1734
|
+
function Kn(e, t) {
|
1735
|
+
si(!1, e, t);
|
1746
1736
|
}
|
1747
1737
|
|
1748
|
-
function
|
1749
|
-
return "1" ===
|
1738
|
+
function Zn(e, t) {
|
1739
|
+
return "1" === ri(e, t);
|
1750
1740
|
}
|
1751
1741
|
|
1752
|
-
function
|
1742
|
+
function ei(e, t) {
|
1753
1743
|
return !!function(e) {
|
1754
1744
|
if (e && e.respectDnt) {
|
1755
|
-
var t = e && e.window ||
|
1756
|
-
return
|
1757
|
-
|
1745
|
+
var t = e && e.window || P, n = null == t ? void 0 : t.navigator, i = !1;
|
1746
|
+
return V([ null == n ? void 0 : n.doNotTrack, n.msDoNotTrack, t.doNotTrack ], (function(e) {
|
1747
|
+
J([ !0, 1, "1", "yes" ], e) && (i = !0);
|
1758
1748
|
})), i;
|
1759
1749
|
}
|
1760
1750
|
return !1;
|
1761
|
-
}(t) || "0" ===
|
1751
|
+
}(t) || "0" === ri(e, t);
|
1762
1752
|
}
|
1763
1753
|
|
1764
|
-
function
|
1765
|
-
|
1754
|
+
function ti(e, t) {
|
1755
|
+
ni(t = t || {}).remove(ii(e, t), !!t.crossSubdomainCookie);
|
1766
1756
|
}
|
1767
1757
|
|
1768
|
-
function
|
1769
|
-
return "localStorage" === (e = e || {}).persistenceType ?
|
1758
|
+
function ni(e) {
|
1759
|
+
return "localStorage" === (e = e || {}).persistenceType ? Ze : "localStorage+cookie" === e.persistenceType ? tt : Xe;
|
1770
1760
|
}
|
1771
1761
|
|
1772
|
-
function
|
1773
|
-
return ((t = t || {}).persistencePrefix ||
|
1762
|
+
function ii(e, t) {
|
1763
|
+
return ((t = t || {}).persistencePrefix || Yn) + e;
|
1774
1764
|
}
|
1775
1765
|
|
1776
|
-
function
|
1777
|
-
return
|
1766
|
+
function ri(e, t) {
|
1767
|
+
return ni(t).get(ii(e, t));
|
1778
1768
|
}
|
1779
1769
|
|
1780
|
-
function
|
1781
|
-
S(t) && t.length ? (
|
1770
|
+
function si(e, t, n) {
|
1771
|
+
S(t) && t.length ? (ni(n = n || {}).set(ii(t, n), e ? 1 : 0, R(n.cookieExpiration) ? n.cookieExpiration : null, n.crossSubdomainCookie, n.secureCookie),
|
1782
1772
|
n.capture && e && n.capture(n.captureEventName || "$opt_in", n.captureProperties || {}, {
|
1783
1773
|
send_instantly: !0
|
1784
1774
|
})) : U.error("gdpr." + (e ? "optIn" : "optOut") + " called with an invalid token");
|
1785
1775
|
}
|
1786
1776
|
|
1787
|
-
function
|
1777
|
+
function oi(e) {
|
1788
1778
|
var t = !1;
|
1789
1779
|
try {
|
1790
1780
|
var n = e.config.token, i = e.config.respect_dnt, r = e.config.opt_out_capturing_persistence_type, s = e.config.opt_out_capturing_cookie_prefix || void 0, o = e.config.window;
|
1791
|
-
n && (t =
|
1781
|
+
n && (t = ei(n, {
|
1792
1782
|
respectDnt: i,
|
1793
1783
|
persistenceType: r,
|
1794
1784
|
persistencePrefix: s,
|
@@ -1800,7 +1790,7 @@ function ri(e) {
|
|
1800
1790
|
return t;
|
1801
1791
|
}
|
1802
1792
|
|
1803
|
-
var
|
1793
|
+
var ai, ui = 3e5, li = ui;
|
1804
1794
|
|
1805
1795
|
!function(e) {
|
1806
1796
|
e[e.Mutation = 0] = "Mutation", e[e.MouseMove = 1] = "MouseMove", e[e.MouseInteraction = 2] = "MouseInteraction",
|
@@ -1809,34 +1799,34 @@ var si, oi = 3e5, ai = oi;
|
|
1809
1799
|
e[e.StyleSheetRule = 8] = "StyleSheetRule", e[e.CanvasMutation = 9] = "CanvasMutation",
|
1810
1800
|
e[e.Font = 10] = "Font", e[e.Log = 11] = "Log", e[e.Drag = 12] = "Drag", e[e.StyleDeclaration = 13] = "StyleDeclaration",
|
1811
1801
|
e[e.Selection = 14] = "Selection", e[e.AdoptedStyleSheet = 15] = "AdoptedStyleSheet";
|
1812
|
-
}(
|
1802
|
+
}(ai || (ai = {}));
|
1813
1803
|
|
1814
|
-
var
|
1804
|
+
var ci, di = [ ai.MouseMove, ai.MouseInteraction, ai.Scroll, ai.ViewportResize, ai.Input, ai.TouchMove, ai.MediaInteraction, ai.Drag ], hi = function(e) {
|
1815
1805
|
return {
|
1816
1806
|
rrwebMethod: e,
|
1817
1807
|
enqueuedAt: Date.now(),
|
1818
1808
|
attempt: 1
|
1819
1809
|
};
|
1820
|
-
},
|
1810
|
+
}, fi = "[SessionRecording]", pi = function() {
|
1821
1811
|
function e(t) {
|
1822
1812
|
var n = this;
|
1823
1813
|
if (i(this, e), o(this, "queuedRRWebEvents", []), o(this, "isIdle", !1), o(this, "_linkedFlagSeen", !1),
|
1824
1814
|
o(this, "_lastActivityTimestamp", Date.now()), o(this, "windowId", null), o(this, "sessionId", null),
|
1825
1815
|
o(this, "_linkedFlag", null), o(this, "_forceAllowLocalhostNetworkCapture", !1),
|
1826
1816
|
o(this, "_samplingSessionListener", null), this.instance = t, this._captureStarted = !1,
|
1827
|
-
this._endpoint = "/s/", this.stopRrweb = void 0, this.receivedDecide = !1, null ==
|
1817
|
+
this._endpoint = "/s/", this.stopRrweb = void 0, this.receivedDecide = !1, null == P || P.addEventListener("beforeunload", (function() {
|
1828
1818
|
n._flushBuffer();
|
1829
|
-
})), null ==
|
1819
|
+
})), null == P || P.addEventListener("offline", (function() {
|
1830
1820
|
n._tryAddCustomEvent("browser offline", {});
|
1831
|
-
})), null ==
|
1821
|
+
})), null == P || P.addEventListener("online", (function() {
|
1832
1822
|
n._tryAddCustomEvent("browser online", {});
|
1833
|
-
})), null ==
|
1834
|
-
if (null !=
|
1835
|
-
var e = "window " +
|
1823
|
+
})), null == P || P.addEventListener("visibilitychange", (function() {
|
1824
|
+
if (null != A && A.visibilityState) {
|
1825
|
+
var e = "window " + A.visibilityState;
|
1836
1826
|
n._tryAddCustomEvent(e, {});
|
1837
1827
|
}
|
1838
|
-
})), !this.instance.sessionManager) throw U.error(
|
1839
|
-
new Error(
|
1828
|
+
})), !this.instance.sessionManager) throw U.error(fi + " started without valid sessionManager"),
|
1829
|
+
new Error(fi + " started without valid sessionManager. This is a bug.");
|
1840
1830
|
this.buffer = this.clearBuffer(), this._setupSampling();
|
1841
1831
|
}
|
1842
1832
|
return s(e, [ {
|
@@ -1853,14 +1843,14 @@ var ui = [ si.MouseMove, si.MouseInteraction, si.Scroll, si.ViewportResize, si.I
|
|
1853
1843
|
}, {
|
1854
1844
|
key: "sessionManager",
|
1855
1845
|
get: function() {
|
1856
|
-
if (!this.instance.sessionManager) throw U.error(
|
1857
|
-
new Error(
|
1846
|
+
if (!this.instance.sessionManager) throw U.error(fi + " started without valid sessionManager"),
|
1847
|
+
new Error(fi + " started without valid sessionManager. This is a bug.");
|
1858
1848
|
return this.instance.sessionManager;
|
1859
1849
|
}
|
1860
1850
|
}, {
|
1861
1851
|
key: "isSampled",
|
1862
1852
|
get: function() {
|
1863
|
-
var e = this.instance.get_property(
|
1853
|
+
var e = this.instance.get_property(me);
|
1864
1854
|
return x(e) ? e : null;
|
1865
1855
|
}
|
1866
1856
|
}, {
|
@@ -1872,19 +1862,19 @@ var ui = [ si.MouseMove, si.MouseInteraction, si.Scroll, si.ViewportResize, si.I
|
|
1872
1862
|
}, {
|
1873
1863
|
key: "isRecordingEnabled",
|
1874
1864
|
get: function() {
|
1875
|
-
var e = !!this.instance.get_property(
|
1876
|
-
return
|
1865
|
+
var e = !!this.instance.get_property(de), t = !this.instance.config.disable_session_recording;
|
1866
|
+
return P && e && t;
|
1877
1867
|
}
|
1878
1868
|
}, {
|
1879
1869
|
key: "isConsoleLogCaptureEnabled",
|
1880
1870
|
get: function() {
|
1881
|
-
var e = !!this.instance.get_property(
|
1871
|
+
var e = !!this.instance.get_property(he), t = this.instance.config.enable_recording_console_log;
|
1882
1872
|
return null != t ? t : e;
|
1883
1873
|
}
|
1884
1874
|
}, {
|
1885
1875
|
key: "canvasRecording",
|
1886
1876
|
get: function() {
|
1887
|
-
var e = this.instance.get_property(
|
1877
|
+
var e = this.instance.get_property(pe);
|
1888
1878
|
return e && e.fps && e.quality ? {
|
1889
1879
|
enabled: e.enabled,
|
1890
1880
|
fps: e.fps,
|
@@ -1894,7 +1884,7 @@ var ui = [ si.MouseMove, si.MouseInteraction, si.Scroll, si.ViewportResize, si.I
|
|
1894
1884
|
}, {
|
1895
1885
|
key: "networkPayloadCapture",
|
1896
1886
|
get: function() {
|
1897
|
-
var e, t, n = this.instance.get_property(
|
1887
|
+
var e, t, n = this.instance.get_property(fe), i = {
|
1898
1888
|
recordHeaders: null === (e = this.instance.config.session_recording) || void 0 === e ? void 0 : e.recordHeaders,
|
1899
1889
|
recordBody: null === (t = this.instance.config.session_recording) || void 0 === t ? void 0 : t.recordBody
|
1900
1890
|
}, r = (null == i ? void 0 : i.recordHeaders) || (null == n ? void 0 : n.recordHeaders), s = (null == i ? void 0 : i.recordBody) || (null == n ? void 0 : n.recordBody), o = this.instance.config.capture_performance || (null == n ? void 0 : n.capturePerformance);
|
@@ -1907,46 +1897,46 @@ var ui = [ si.MouseMove, si.MouseInteraction, si.Scroll, si.ViewportResize, si.I
|
|
1907
1897
|
}, {
|
1908
1898
|
key: "sampleRate",
|
1909
1899
|
get: function() {
|
1910
|
-
var e = this.instance.get_property(
|
1911
|
-
return
|
1900
|
+
var e = this.instance.get_property(ve);
|
1901
|
+
return R(e) ? e : null;
|
1912
1902
|
}
|
1913
1903
|
}, {
|
1914
1904
|
key: "minimumDuration",
|
1915
1905
|
get: function() {
|
1916
1906
|
var e = this.instance.get_property(ge);
|
1917
|
-
return
|
1907
|
+
return R(e) ? e : null;
|
1918
1908
|
}
|
1919
1909
|
}, {
|
1920
1910
|
key: "status",
|
1921
1911
|
get: function() {
|
1922
|
-
return this.receivedDecide ? this.isRecordingEnabled ?
|
1912
|
+
return this.receivedDecide ? this.isRecordingEnabled ? E(this._linkedFlag) || this._linkedFlagSeen ? x(this.isSampled) ? this.isSampled ? "sampled" : "disabled" : "active" : "buffering" : "disabled" : "buffering";
|
1923
1913
|
}
|
1924
1914
|
}, {
|
1925
|
-
key: "
|
1915
|
+
key: "startIfEnabledOrStop",
|
1926
1916
|
value: function() {
|
1927
|
-
this.isRecordingEnabled ? (this._startCapture(), U.info(
|
1917
|
+
this.isRecordingEnabled ? (this._startCapture(), U.info(fi + " started")) : (this.stopRecording(),
|
1928
1918
|
this.clearBuffer());
|
1929
1919
|
}
|
1930
1920
|
}, {
|
1931
1921
|
key: "stopRecording",
|
1932
1922
|
value: function() {
|
1933
1923
|
this._captureStarted && this.stopRrweb && (this.stopRrweb(), this.stopRrweb = void 0,
|
1934
|
-
this._captureStarted = !1, U.info(
|
1924
|
+
this._captureStarted = !1, U.info(fi + " stopped"));
|
1935
1925
|
}
|
1936
1926
|
}, {
|
1937
1927
|
key: "makeSamplingDecision",
|
1938
1928
|
value: function(e) {
|
1939
1929
|
var t, n = this.sessionId !== e, i = this.sampleRate;
|
1940
|
-
if (
|
1930
|
+
if (R(i)) {
|
1941
1931
|
var r, s = this.isSampled, a = n || !x(s);
|
1942
1932
|
if (a) r = Math.random() < i; else r = s;
|
1943
|
-
!r && a && U.warn(
|
1933
|
+
!r && a && U.warn(fi + " Sample rate (".concat(i, ") has determined that this sessionId (").concat(e, ") will not be sent to the server.")),
|
1944
1934
|
this._tryAddCustomEvent("samplingDecisionMade", {
|
1945
1935
|
sampleRate: i
|
1946
|
-
}), null === (t = this.instance.persistence) || void 0 === t || t.register(o({},
|
1936
|
+
}), null === (t = this.instance.persistence) || void 0 === t || t.register(o({}, me, r));
|
1947
1937
|
} else {
|
1948
1938
|
var u;
|
1949
|
-
null === (u = this.instance.persistence) || void 0 === u || u.register(o({},
|
1939
|
+
null === (u = this.instance.persistence) || void 0 === u || u.register(o({}, me, null));
|
1950
1940
|
}
|
1951
1941
|
}
|
1952
1942
|
}, {
|
@@ -1955,7 +1945,7 @@ var ui = [ si.MouseMove, si.MouseInteraction, si.Scroll, si.ViewportResize, si.I
|
|
1955
1945
|
var t, n, i, r = this;
|
1956
1946
|
(this._persistDecideResponse(e), this._linkedFlag = (null === (t = e.sessionRecording) || void 0 === t ? void 0 : t.linkedFlag) || null,
|
1957
1947
|
null !== (n = e.sessionRecording) && void 0 !== n && n.endpoint) && (this._endpoint = null === (i = e.sessionRecording) || void 0 === i ? void 0 : i.endpoint);
|
1958
|
-
if (this._setupSampling(), !
|
1948
|
+
if (this._setupSampling(), !E(this._linkedFlag)) {
|
1959
1949
|
var s = S(this._linkedFlag) ? this._linkedFlag : this._linkedFlag.flag, o = S(this._linkedFlag) ? null : this._linkedFlag.variant;
|
1960
1950
|
this.instance.onFeatureFlags((function(e, t) {
|
1961
1951
|
var n = b(t) && s in t, i = o ? t[s] === o : n;
|
@@ -1964,18 +1954,18 @@ var ui = [ si.MouseMove, si.MouseInteraction, si.Scroll, si.ViewportResize, si.I
|
|
1964
1954
|
linkedFlag: s,
|
1965
1955
|
linkedVariant: o
|
1966
1956
|
}, u = "linked flag matched";
|
1967
|
-
U.info(
|
1957
|
+
U.info(fi + " " + u, a), r._tryAddCustomEvent(u, a);
|
1968
1958
|
}
|
1969
1959
|
r._linkedFlagSeen = i;
|
1970
1960
|
}));
|
1971
1961
|
}
|
1972
|
-
this.receivedDecide = !0, this.
|
1962
|
+
this.receivedDecide = !0, this.startIfEnabledOrStop();
|
1973
1963
|
}
|
1974
1964
|
}, {
|
1975
1965
|
key: "_setupSampling",
|
1976
1966
|
value: function() {
|
1977
1967
|
var e = this;
|
1978
|
-
|
1968
|
+
R(this.sampleRate) && F(this._samplingSessionListener) && (this._samplingSessionListener = this.sessionManager.onSessionId((function(t) {
|
1979
1969
|
e.makeSamplingDecision(t);
|
1980
1970
|
})));
|
1981
1971
|
}
|
@@ -1984,16 +1974,16 @@ var ui = [ si.MouseMove, si.MouseInteraction, si.Scroll, si.ViewportResize, si.I
|
|
1984
1974
|
value: function(e) {
|
1985
1975
|
if (this.instance.persistence) {
|
1986
1976
|
var n = this.instance.persistence, i = function() {
|
1987
|
-
var i, r, s, a, u, l, c, d, h = null === (i = e.sessionRecording) || void 0 === i ? void 0 : i.sampleRate, f =
|
1988
|
-
n.register((o(d = {},
|
1989
|
-
o(d,
|
1977
|
+
var i, r, s, a, u, l, c, d, h = null === (i = e.sessionRecording) || void 0 === i ? void 0 : i.sampleRate, f = E(h) ? null : parseFloat(h), p = null === (r = e.sessionRecording) || void 0 === r ? void 0 : r.minimumDurationMilliseconds;
|
1978
|
+
n.register((o(d = {}, de, !!e.sessionRecording), o(d, he, null === (s = e.sessionRecording) || void 0 === s ? void 0 : s.consoleLogRecordingEnabled),
|
1979
|
+
o(d, fe, t({
|
1990
1980
|
capturePerformance: e.capturePerformance
|
1991
1981
|
}, null === (a = e.sessionRecording) || void 0 === a ? void 0 : a.networkPayloadCapture)),
|
1992
|
-
o(d,
|
1982
|
+
o(d, pe, {
|
1993
1983
|
enabled: null === (u = e.sessionRecording) || void 0 === u ? void 0 : u.recordCanvas,
|
1994
1984
|
fps: null === (l = e.sessionRecording) || void 0 === l ? void 0 : l.canvasFps,
|
1995
1985
|
quality: null === (c = e.sessionRecording) || void 0 === c ? void 0 : c.canvasQuality
|
1996
|
-
}), o(d,
|
1986
|
+
}), o(d, ve, f), o(d, ge, w(p) ? null : p), d));
|
1997
1987
|
};
|
1998
1988
|
i(), this.sessionManager.onSessionId(i);
|
1999
1989
|
}
|
@@ -2012,34 +2002,34 @@ var ui = [ si.MouseMove, si.MouseInteraction, si.Scroll, si.ViewportResize, si.I
|
|
2012
2002
|
payload: [ JSON.stringify(e) ]
|
2013
2003
|
}
|
2014
2004
|
},
|
2015
|
-
timestamp:
|
2005
|
+
timestamp: X()
|
2016
2006
|
});
|
2017
2007
|
}
|
2018
2008
|
}, {
|
2019
2009
|
key: "_startCapture",
|
2020
2010
|
value: function() {
|
2021
2011
|
var e = this;
|
2022
|
-
w(Object.assign) || this._captureStarted || this.instance.config.disable_session_recording ||
|
2012
|
+
w(Object.assign) || this._captureStarted || this.instance.config.disable_session_recording || oi(this.instance) || (this._captureStarted = !0,
|
2023
2013
|
this.sessionManager.checkAndGetSessionAndWindowId(), this.rrwebRecord ? this._onScriptLoaded() : se(this.instance.requestRouter.endpointFor("assets", "/static/recorder.js?v=".concat(f.LIB_VERSION)), (function(t) {
|
2024
|
-
if (t) return U.error(
|
2014
|
+
if (t) return U.error(fi + " could not load recorder.js", t);
|
2025
2015
|
e._onScriptLoaded();
|
2026
2016
|
})));
|
2027
2017
|
}
|
2028
2018
|
}, {
|
2029
|
-
key: "
|
2019
|
+
key: "isInteractiveEvent",
|
2030
2020
|
value: function(e) {
|
2031
2021
|
var t;
|
2032
|
-
return 3 === e.type && -1 !==
|
2022
|
+
return 3 === e.type && -1 !== di.indexOf(null === (t = e.data) || void 0 === t ? void 0 : t.source);
|
2033
2023
|
}
|
2034
2024
|
}, {
|
2035
2025
|
key: "_updateWindowAndSessionIds",
|
2036
2026
|
value: function(e) {
|
2037
|
-
var t = this.
|
2038
|
-
t || this.isIdle || e.timestamp - this._lastActivityTimestamp >
|
2027
|
+
var t = this.isInteractiveEvent(e);
|
2028
|
+
t || this.isIdle || e.timestamp - this._lastActivityTimestamp > li && (this.isIdle = !0,
|
2039
2029
|
this._tryAddCustomEvent("sessionIdle", {
|
2040
2030
|
reason: "user inactivity",
|
2041
2031
|
timeSinceLastActive: e.timestamp - this._lastActivityTimestamp,
|
2042
|
-
threshold:
|
2032
|
+
threshold: li
|
2043
2033
|
}));
|
2044
2034
|
var n = !1;
|
2045
2035
|
if (t && (this._lastActivityTimestamp = e.timestamp, this.isIdle && (this.isIdle = !1,
|
@@ -2048,7 +2038,7 @@ var ui = [ si.MouseMove, si.MouseInteraction, si.Scroll, si.ViewportResize, si.I
|
|
2048
2038
|
type: e.type
|
2049
2039
|
}), n = !0)), !this.isIdle) {
|
2050
2040
|
var i = this.sessionManager.checkAndGetSessionAndWindowId(!t, e.timestamp), r = i.windowId, s = i.sessionId, o = this.sessionId !== s, a = this.windowId !== r;
|
2051
|
-
this.windowId = r, this.sessionId = s, (n || -1 === [
|
2041
|
+
this.windowId = r, this.sessionId = s, (n || -1 === [ fn, pn ].indexOf(e.type) && (a || o)) && this._tryTakeFullSnapshot();
|
2052
2042
|
}
|
2053
2043
|
}
|
2054
2044
|
}, {
|
@@ -2061,14 +2051,14 @@ var ui = [ si.MouseMove, si.MouseInteraction, si.Scroll, si.ViewportResize, si.I
|
|
2061
2051
|
enqueuedAt: e.enqueuedAt || Date.now(),
|
2062
2052
|
attempt: e.attempt++,
|
2063
2053
|
rrwebMethod: e.rrwebMethod
|
2064
|
-
}) : U.warn(
|
2054
|
+
}) : U.warn(fi + " could not emit queued rrweb event.", t, e), !1;
|
2065
2055
|
}
|
2066
2056
|
}
|
2067
2057
|
}, {
|
2068
2058
|
key: "_tryAddCustomEvent",
|
2069
2059
|
value: function(e, t) {
|
2070
2060
|
var n = this;
|
2071
|
-
return this._tryRRWebMethod(
|
2061
|
+
return this._tryRRWebMethod(hi((function() {
|
2072
2062
|
return n.rrwebRecord.addCustomEvent(e, t);
|
2073
2063
|
})));
|
2074
2064
|
}
|
@@ -2076,7 +2066,7 @@ var ui = [ si.MouseMove, si.MouseInteraction, si.Scroll, si.ViewportResize, si.I
|
|
2076
2066
|
key: "_tryTakeFullSnapshot",
|
2077
2067
|
value: function() {
|
2078
2068
|
var e = this;
|
2079
|
-
return this._tryRRWebMethod(
|
2069
|
+
return this._tryRRWebMethod(hi((function() {
|
2080
2070
|
return e.rrwebRecord.takeFullSnapshot();
|
2081
2071
|
})));
|
2082
2072
|
}
|
@@ -2108,12 +2098,12 @@ var ui = [ si.MouseMove, si.MouseInteraction, si.Scroll, si.ViewportResize, si.I
|
|
2108
2098
|
type: "image/webp",
|
2109
2099
|
quality: this.canvasRecording.quality
|
2110
2100
|
}), this.rrwebRecord) {
|
2111
|
-
this.mutationRateLimiter = null !== (e = this.mutationRateLimiter) && void 0 !== e ? e : new
|
2101
|
+
this.mutationRateLimiter = null !== (e = this.mutationRateLimiter) && void 0 !== e ? e : new vn(this.rrwebRecord, {
|
2112
2102
|
onBlockedNode: function(e, t) {
|
2113
2103
|
var i = "Too many mutations on node '".concat(e, "'. Rate limiting. This could be due to SVG animations or something similar");
|
2114
2104
|
U.info(i, {
|
2115
2105
|
node: t
|
2116
|
-
}), n.log(
|
2106
|
+
}), n.log(fi + " " + i, "warn");
|
2117
2107
|
}
|
2118
2108
|
}), this._scheduleFullSnapshot();
|
2119
2109
|
var d = this._gatherRRWebPlugins();
|
@@ -2125,7 +2115,7 @@ var ui = [ si.MouseMove, si.MouseInteraction, si.Scroll, si.ViewportResize, si.I
|
|
2125
2115
|
}, i)), this.instance._addCaptureHook((function(e) {
|
2126
2116
|
try {
|
2127
2117
|
if ("$pageview" === e) {
|
2128
|
-
var t =
|
2118
|
+
var t = P ? n._maskUrl(P.location.href) : "";
|
2129
2119
|
if (!t) return;
|
2130
2120
|
n._tryAddCustomEvent("$pageview", {
|
2131
2121
|
href: t
|
@@ -2142,7 +2132,7 @@ var ui = [ si.MouseMove, si.MouseInteraction, si.Scroll, si.ViewportResize, si.I
|
|
2142
2132
|
}), this._tryAddCustomEvent("$posthog_config", {
|
2143
2133
|
config: this.instance.config
|
2144
2134
|
});
|
2145
|
-
} else U.error(
|
2135
|
+
} else U.error(fi + "onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.");
|
2146
2136
|
}
|
2147
2137
|
}, {
|
2148
2138
|
key: "_scheduleFullSnapshot",
|
@@ -2150,26 +2140,26 @@ var ui = [ si.MouseMove, si.MouseInteraction, si.Scroll, si.ViewportResize, si.I
|
|
2150
2140
|
var e = this;
|
2151
2141
|
this._fullSnapshotTimer && clearInterval(this._fullSnapshotTimer), this._fullSnapshotTimer = setInterval((function() {
|
2152
2142
|
e._tryTakeFullSnapshot();
|
2153
|
-
}),
|
2143
|
+
}), ui);
|
2154
2144
|
}
|
2155
2145
|
}, {
|
2156
2146
|
key: "_gatherRRWebPlugins",
|
2157
2147
|
value: function() {
|
2158
2148
|
var e = [];
|
2159
2149
|
(H.rrwebConsoleRecord && this.isConsoleLogCaptureEnabled && e.push(H.rrwebConsoleRecord.getRecordConsolePlugin()),
|
2160
|
-
this.networkPayloadCapture && y(H.getRecordNetworkPlugin)) && (!
|
2150
|
+
this.networkPayloadCapture && y(H.getRecordNetworkPlugin)) && (!ot.includes(location.hostname) || this._forceAllowLocalhostNetworkCapture ? e.push(H.getRecordNetworkPlugin(Jn(this.instance.config, this.networkPayloadCapture))) : U.info(fi + " NetworkCapture not started because we are on localhost."));
|
2161
2151
|
return e;
|
2162
2152
|
}
|
2163
2153
|
}, {
|
2164
2154
|
key: "onRRwebEmit",
|
2165
2155
|
value: function(e) {
|
2166
2156
|
if (this._processQueuedEvents(), e && b(e)) {
|
2167
|
-
if (e.type ===
|
2157
|
+
if (e.type === gn.Meta) {
|
2168
2158
|
var t = this._maskUrl(e.data.href);
|
2169
2159
|
if (this._lastHref = t, !t) return;
|
2170
2160
|
e.data.href = t;
|
2171
2161
|
} else this._pageViewFallBack();
|
2172
|
-
e.type ===
|
2162
|
+
e.type === gn.FullSnapshot && this._scheduleFullSnapshot();
|
2173
2163
|
var n = this.mutationRateLimiter ? this.mutationRateLimiter.throttleMutations(e) : e;
|
2174
2164
|
if (n) {
|
2175
2165
|
var i = function(e) {
|
@@ -2182,7 +2172,7 @@ var ui = [ si.MouseMove, si.MouseInteraction, si.Scroll, si.ViewportResize, si.I
|
|
2182
2172
|
}
|
2183
2173
|
return e;
|
2184
2174
|
}(n), r = JSON.stringify(i).length;
|
2185
|
-
if (this._updateWindowAndSessionIds(i), !this.isIdle || i.type ===
|
2175
|
+
if (this._updateWindowAndSessionIds(i), !this.isIdle || i.type === gn.Custom) {
|
2186
2176
|
var s = {
|
2187
2177
|
$snapshot_bytes: r,
|
2188
2178
|
$snapshot_data: i,
|
@@ -2197,8 +2187,8 @@ var ui = [ si.MouseMove, si.MouseInteraction, si.Scroll, si.ViewportResize, si.I
|
|
2197
2187
|
}, {
|
2198
2188
|
key: "_pageViewFallBack",
|
2199
2189
|
value: function() {
|
2200
|
-
if (!this.instance.config.capture_pageview &&
|
2201
|
-
var e = this._maskUrl(
|
2190
|
+
if (!this.instance.config.capture_pageview && P) {
|
2191
|
+
var e = this._maskUrl(P.location.href);
|
2202
2192
|
this._lastHref !== e && (this._tryAddCustomEvent("$url_changed", {
|
2203
2193
|
href: e
|
2204
2194
|
}), this._lastHref = e);
|
@@ -2250,7 +2240,7 @@ var ui = [ si.MouseMove, si.MouseInteraction, si.Scroll, si.ViewportResize, si.I
|
|
2250
2240
|
value: function() {
|
2251
2241
|
var e = this;
|
2252
2242
|
this.flushBufferTimer && (clearTimeout(this.flushBufferTimer), this.flushBufferTimer = void 0);
|
2253
|
-
var t = this.minimumDuration, n = this.sessionDuration, i =
|
2243
|
+
var t = this.minimumDuration, n = this.sessionDuration, i = R(n) && n >= 0, r = R(t) && i && n < t;
|
2254
2244
|
return "buffering" === this.status || r ? (this.flushBufferTimer = setTimeout((function() {
|
2255
2245
|
e._flushBuffer();
|
2256
2246
|
}), 2e3), this.buffer || this.clearBuffer()) : this.buffer && 0 !== this.buffer.data.length ? (this._captureSnapshot({
|
@@ -2277,11 +2267,12 @@ var ui = [ si.MouseMove, si.MouseInteraction, si.Scroll, si.ViewportResize, si.I
|
|
2277
2267
|
this.instance.capture("$snapshot", e, {
|
2278
2268
|
_url: this.instance.requestRouter.endpointFor("api", this._endpoint),
|
2279
2269
|
_noTruncate: !0,
|
2280
|
-
_batchKey: "recordings"
|
2270
|
+
_batchKey: "recordings",
|
2271
|
+
_noHeatmaps: !0
|
2281
2272
|
});
|
2282
2273
|
}
|
2283
2274
|
} ]), e;
|
2284
|
-
}(),
|
2275
|
+
}(), vi = function() {
|
2285
2276
|
function e(t) {
|
2286
2277
|
i(this, e), this.instance = t, this.instance.decideEndpointWasHit = this.instance._hasBootstrappedFeatureFlags();
|
2287
2278
|
}
|
@@ -2292,8 +2283,8 @@ var ui = [ si.MouseMove, si.MouseInteraction, si.Scroll, si.ViewportResize, si.I
|
|
2292
2283
|
token: this.instance.config.token,
|
2293
2284
|
distinct_id: this.instance.get_distinct_id(),
|
2294
2285
|
groups: this.instance.getGroups(),
|
2295
|
-
person_properties: this.instance.get_property(
|
2296
|
-
group_properties: this.instance.get_property(
|
2286
|
+
person_properties: this.instance.get_property(ke),
|
2287
|
+
group_properties: this.instance.get_property(we),
|
2297
2288
|
disable_flags: this.instance.config.advanced_disable_feature_flags || this.instance.config.advanced_disable_feature_flags_on_first_load || void 0
|
2298
2289
|
};
|
2299
2290
|
this.instance._send_request({
|
@@ -2310,79 +2301,81 @@ var ui = [ si.MouseMove, si.MouseInteraction, si.Scroll, si.ViewportResize, si.I
|
|
2310
2301
|
}, {
|
2311
2302
|
key: "parseDecideResponse",
|
2312
2303
|
value: function(e) {
|
2313
|
-
var t
|
2304
|
+
var t = this;
|
2314
2305
|
this.instance.featureFlags.setReloadingPaused(!1), this.instance.featureFlags._startReloadTimer();
|
2315
|
-
var
|
2316
|
-
if (this.instance.config.advanced_disable_feature_flags_on_first_load || this.instance.config.advanced_disable_feature_flags || this.instance.featureFlags.receivedFeatureFlags(null != e ? e : {},
|
2317
|
-
|
2318
|
-
if (!
|
2306
|
+
var n = !e;
|
2307
|
+
if (this.instance.config.advanced_disable_feature_flags_on_first_load || this.instance.config.advanced_disable_feature_flags || this.instance.featureFlags.receivedFeatureFlags(null != e ? e : {}, n),
|
2308
|
+
n) U.error("Failed to fetch feature flags from PostHog."); else {
|
2309
|
+
if (!A || !A.body) return U.info("document not ready yet, trying again in 500 milliseconds..."),
|
2319
2310
|
void setTimeout((function() {
|
2320
|
-
|
2311
|
+
t.parseDecideResponse(e);
|
2321
2312
|
}), 500);
|
2322
|
-
this.instance.toolbar.afterDecideResponse(e), null === (t = this.instance.sessionRecording) || void 0 === t || t.afterDecideResponse(e),
|
2323
|
-
null === (n = this.instance.autocapture) || void 0 === n || n.afterDecideResponse(e),
|
2324
2313
|
this.instance._afterDecideResponse(e);
|
2325
|
-
var
|
2326
|
-
|
2327
|
-
if (
|
2328
|
-
|
2329
|
-
}));
|
2330
|
-
var o = null == I ? void 0 : I.extendPostHogWithExceptionAutoCapture;
|
2331
|
-
if (e.autocaptureExceptions && e.autocaptureExceptions && w(o) && se(this.instance.requestRouter.endpointFor("assets", "/static/exception-autocapture.js"), (function(t) {
|
2332
|
-
if (t) return U.error("Could not load exception autocapture script", t);
|
2333
|
-
I.extendPostHogWithExceptionAutocapture(i.instance, e);
|
2314
|
+
var i = null == P ? void 0 : P.extendPostHogWithExceptionAutoCapture;
|
2315
|
+
if (e.autocaptureExceptions && e.autocaptureExceptions && w(i) && se(this.instance.requestRouter.endpointFor("assets", "/static/exception-autocapture.js"), (function(n) {
|
2316
|
+
if (n) return U.error("Could not load exception autocapture script", n);
|
2317
|
+
P.extendPostHogWithExceptionAutocapture(t.instance, e);
|
2334
2318
|
})), e.siteApps) if (this.instance.config.opt_in_site_apps) {
|
2335
|
-
var
|
2319
|
+
var r, s = h(e.siteApps);
|
2336
2320
|
try {
|
2337
|
-
var
|
2338
|
-
var e =
|
2339
|
-
H["__$$ph_site_app_".concat(
|
2340
|
-
e && U.error("Error while initializing PostHog app with config id ".concat(
|
2321
|
+
var o = function() {
|
2322
|
+
var e = r.value, n = e.id, i = e.url, s = t.instance.requestRouter.endpointFor("api", i);
|
2323
|
+
H["__$$ph_site_app_".concat(n)] = t.instance, se(s, (function(e) {
|
2324
|
+
e && U.error("Error while initializing PostHog app with config id ".concat(n), e);
|
2341
2325
|
}));
|
2342
2326
|
};
|
2343
|
-
for (
|
2327
|
+
for (s.s(); !(r = s.n()).done; ) o();
|
2344
2328
|
} catch (e) {
|
2345
|
-
|
2329
|
+
s.e(e);
|
2346
2330
|
} finally {
|
2347
|
-
|
2331
|
+
s.f();
|
2348
2332
|
}
|
2349
2333
|
} else e.siteApps.length > 0 && U.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');
|
2350
2334
|
}
|
2351
2335
|
}
|
2352
2336
|
} ]), e;
|
2353
|
-
}(),
|
2337
|
+
}(), gi = null != P && P.location ? dt(P.location.hash, "__posthog") || dt(location.hash, "state") : null, _i = "_postHogToolbarParams";
|
2338
|
+
|
2339
|
+
!function(e) {
|
2340
|
+
e[e.UNINITIALIZED = 0] = "UNINITIALIZED", e[e.LOADING = 1] = "LOADING", e[e.LOADED = 2] = "LOADED";
|
2341
|
+
}(ci || (ci = {}));
|
2342
|
+
|
2343
|
+
var mi = function() {
|
2354
2344
|
function e(t) {
|
2355
|
-
i(this, e),
|
2345
|
+
i(this, e), this.instance = t;
|
2356
2346
|
}
|
2357
2347
|
return s(e, [ {
|
2358
|
-
key: "
|
2348
|
+
key: "setToolbarState",
|
2359
2349
|
value: function(e) {
|
2360
|
-
|
2361
|
-
|
2362
|
-
|
2363
|
-
|
2350
|
+
H.ph_toolbar_state = e;
|
2351
|
+
}
|
2352
|
+
}, {
|
2353
|
+
key: "getToolbarState",
|
2354
|
+
value: function() {
|
2355
|
+
var e;
|
2356
|
+
return null !== (e = H.ph_toolbar_state) && void 0 !== e ? e : ci.UNINITIALIZED;
|
2364
2357
|
}
|
2365
2358
|
}, {
|
2366
2359
|
key: "maybeLoadToolbar",
|
2367
2360
|
value: function() {
|
2368
2361
|
var e, t, n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : void 0, i = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : void 0, r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : void 0;
|
2369
|
-
if (!
|
2370
|
-
n = null !== (e = n) && void 0 !== e ? e :
|
2362
|
+
if (!P || !A) return !1;
|
2363
|
+
n = null !== (e = n) && void 0 !== e ? e : P.location, r = null !== (t = r) && void 0 !== t ? t : P.history;
|
2371
2364
|
try {
|
2372
2365
|
if (!i) {
|
2373
2366
|
try {
|
2374
|
-
|
2367
|
+
P.localStorage.setItem("test", "test"), P.localStorage.removeItem("test");
|
2375
2368
|
} catch (e) {
|
2376
2369
|
return !1;
|
2377
2370
|
}
|
2378
|
-
i = null ==
|
2371
|
+
i = null == P ? void 0 : P.localStorage;
|
2379
2372
|
}
|
2380
|
-
var s, o =
|
2373
|
+
var s, o = gi || dt(n.hash, "__posthog") || dt(n.hash, "state"), a = o ? K((function() {
|
2381
2374
|
return JSON.parse(atob(decodeURIComponent(o)));
|
2382
|
-
})) ||
|
2375
|
+
})) || K((function() {
|
2383
2376
|
return JSON.parse(decodeURIComponent(o));
|
2384
2377
|
})) : null;
|
2385
|
-
return a && "ph_authorize" === a.action ? ((s = a).source = "url", s && Object.keys(s).length > 0 && (a.desiredHash ? n.hash = a.desiredHash : r ? r.replaceState("",
|
2378
|
+
return a && "ph_authorize" === a.action ? ((s = a).source = "url", s && Object.keys(s).length > 0 && (a.desiredHash ? n.hash = a.desiredHash : r ? r.replaceState(r.state, "", n.pathname + n.search) : n.hash = "")) : ((s = JSON.parse(i.getItem(_i) || "{}")).source = "localstorage",
|
2386
2379
|
delete s.userIntent), !(!s.token || this.instance.config.token !== s.token) && (this.loadToolbar(s),
|
2387
2380
|
!0);
|
2388
2381
|
} catch (e) {
|
@@ -2397,25 +2390,25 @@ var ui = [ si.MouseMove, si.MouseInteraction, si.Scroll, si.ViewportResize, si.I
|
|
2397
2390
|
}, {
|
2398
2391
|
key: "loadToolbar",
|
2399
2392
|
value: function(e) {
|
2400
|
-
var n = this;
|
2401
|
-
if (!
|
2402
|
-
var
|
2393
|
+
var n = this, i = !(null == A || !A.getElementById(Te));
|
2394
|
+
if (!P || i) return !1;
|
2395
|
+
var r = "custom" === this.instance.requestRouter.region && this.instance.config.advanced_disable_toolbar_metrics, s = t(t({
|
2403
2396
|
token: this.instance.config.token
|
2404
2397
|
}, e), {}, {
|
2405
2398
|
apiURL: this.instance.requestRouter.endpointFor("ui")
|
2406
|
-
},
|
2399
|
+
}, r ? {
|
2407
2400
|
instrument: !1
|
2408
2401
|
} : {});
|
2409
|
-
if (
|
2402
|
+
if (P.localStorage.setItem(_i, JSON.stringify(t(t({}, s), {}, {
|
2410
2403
|
source: void 0
|
2411
|
-
}))), this.
|
2412
|
-
this.
|
2413
|
-
var
|
2414
|
-
se(this.instance.requestRouter.endpointFor("assets", "/static/toolbar.js?t=".concat(
|
2415
|
-
if (e) return U.error("Failed to load toolbar", e), void
|
2416
|
-
n._callLoadToolbar(
|
2417
|
-
})), re(
|
2418
|
-
n.
|
2404
|
+
}))), this.getToolbarState() === ci.LOADED) this._callLoadToolbar(s); else if (this.getToolbarState() === ci.UNINITIALIZED) {
|
2405
|
+
this.setToolbarState(ci.LOADING);
|
2406
|
+
var o = 3e5, a = Math.floor(Date.now() / o) * o;
|
2407
|
+
se(this.instance.requestRouter.endpointFor("assets", "/static/toolbar.js?t=".concat(a)), (function(e) {
|
2408
|
+
if (e) return U.error("Failed to load toolbar", e), void n.setToolbarState(ci.UNINITIALIZED);
|
2409
|
+
n.setToolbarState(ci.LOADED), n._callLoadToolbar(s);
|
2410
|
+
})), re(P, "turbolinks:load", (function() {
|
2411
|
+
n.setToolbarState(ci.UNINITIALIZED), n.loadToolbar(s);
|
2419
2412
|
}));
|
2420
2413
|
}
|
2421
2414
|
return !0;
|
@@ -2432,7 +2425,7 @@ var ui = [ si.MouseMove, si.MouseInteraction, si.Scroll, si.ViewportResize, si.I
|
|
2432
2425
|
return this.maybeLoadToolbar(e, t, n);
|
2433
2426
|
}
|
2434
2427
|
} ]), e;
|
2435
|
-
}(),
|
2428
|
+
}(), yi = function() {
|
2436
2429
|
function e(t) {
|
2437
2430
|
i(this, e), o(this, "isPaused", !0), o(this, "queue", []), o(this, "flushTimeoutMs", 3e3),
|
2438
2431
|
this.sendRequest = t;
|
@@ -2471,7 +2464,7 @@ var ui = [ si.MouseMove, si.MouseInteraction, si.Scroll, si.ViewportResize, si.I
|
|
2471
2464
|
if (e.clearFlushTimeout(), e.queue.length > 0) {
|
2472
2465
|
var t = e.formatQueue(), n = function(n) {
|
2473
2466
|
var i = t[n], r = (new Date).getTime();
|
2474
|
-
i.data && m(i.data) &&
|
2467
|
+
i.data && m(i.data) && V(i.data, (function(e) {
|
2475
2468
|
e.offset = Math.abs(e.timestamp - r), delete e.timestamp;
|
2476
2469
|
})), e.sendRequest(i);
|
2477
2470
|
};
|
@@ -2488,7 +2481,7 @@ var ui = [ si.MouseMove, si.MouseInteraction, si.Scroll, si.ViewportResize, si.I
|
|
2488
2481
|
key: "formatQueue",
|
2489
2482
|
value: function() {
|
2490
2483
|
var e = {};
|
2491
|
-
return
|
2484
|
+
return V(this.queue, (function(n) {
|
2492
2485
|
var i, r = n, s = (r ? r.batchKey : null) || r.url;
|
2493
2486
|
w(e[s]) && (e[s] = t(t({}, r), {}, {
|
2494
2487
|
data: []
|
@@ -2496,68 +2489,68 @@ var ui = [ si.MouseMove, si.MouseInteraction, si.Scroll, si.ViewportResize, si.I
|
|
2496
2489
|
})), this.queue = [], e;
|
2497
2490
|
}
|
2498
2491
|
} ]), e;
|
2499
|
-
}(),
|
2500
|
-
for (var n = new
|
2501
|
-
var r = new
|
2492
|
+
}(), bi = Uint8Array, ki = Uint16Array, wi = Uint32Array, Si = new bi([ 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 0, 0, 0 ]), Fi = new bi([ 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 0, 0 ]), Ei = new bi([ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ]), Ri = function(e, t) {
|
2493
|
+
for (var n = new ki(31), i = 0; i < 31; ++i) n[i] = t += 1 << e[i - 1];
|
2494
|
+
var r = new wi(n[30]);
|
2502
2495
|
for (i = 1; i < 30; ++i) for (var s = n[i]; s < n[i + 1]; ++s) r[s] = s - n[i] << 5 | i;
|
2503
2496
|
return [ n, r ];
|
2504
|
-
},
|
2497
|
+
}, xi = Ri(Si, 2), Ii = xi[0], Pi = xi[1];
|
2505
2498
|
|
2506
|
-
|
2499
|
+
Ii[28] = 258, Pi[258] = 28;
|
2507
2500
|
|
2508
|
-
for (var
|
2509
|
-
var
|
2510
|
-
|
2511
|
-
|
2501
|
+
for (var Ci = Ri(Fi, 0)[1], Ti = new ki(32768), $i = 0; $i < 32768; ++$i) {
|
2502
|
+
var Oi = (43690 & $i) >>> 1 | (21845 & $i) << 1;
|
2503
|
+
Oi = (61680 & (Oi = (52428 & Oi) >>> 2 | (13107 & Oi) << 2)) >>> 4 | (3855 & Oi) << 4,
|
2504
|
+
Ti[$i] = ((65280 & Oi) >>> 8 | (255 & Oi) << 8) >>> 1;
|
2512
2505
|
}
|
2513
2506
|
|
2514
|
-
var
|
2515
|
-
for (var i = e.length, r = 0, s = new
|
2516
|
-
var o, a = new
|
2507
|
+
var Mi = function(e, t, n) {
|
2508
|
+
for (var i = e.length, r = 0, s = new ki(t); r < i; ++r) ++s[e[r] - 1];
|
2509
|
+
var o, a = new ki(t);
|
2517
2510
|
for (r = 0; r < t; ++r) a[r] = a[r - 1] + s[r - 1] << 1;
|
2518
2511
|
if (n) {
|
2519
|
-
o = new
|
2512
|
+
o = new ki(1 << t);
|
2520
2513
|
var u = 15 - t;
|
2521
|
-
for (r = 0; r < i; ++r) if (e[r]) for (var l = r << 4 | e[r], c = t - e[r], d = a[e[r] - 1]++ << c, h = d | (1 << c) - 1; d <= h; ++d) o[
|
2522
|
-
} else for (o = new
|
2514
|
+
for (r = 0; r < i; ++r) if (e[r]) for (var l = r << 4 | e[r], c = t - e[r], d = a[e[r] - 1]++ << c, h = d | (1 << c) - 1; d <= h; ++d) o[Ti[d] >>> u] = l;
|
2515
|
+
} else for (o = new ki(i), r = 0; r < i; ++r) o[r] = Ti[a[e[r] - 1]++] >>> 15 - e[r];
|
2523
2516
|
return o;
|
2524
|
-
},
|
2517
|
+
}, Ai = new bi(288);
|
2525
2518
|
|
2526
|
-
for (
|
2519
|
+
for ($i = 0; $i < 144; ++$i) Ai[$i] = 8;
|
2527
2520
|
|
2528
|
-
for (
|
2521
|
+
for ($i = 144; $i < 256; ++$i) Ai[$i] = 9;
|
2529
2522
|
|
2530
|
-
for (
|
2523
|
+
for ($i = 256; $i < 280; ++$i) Ai[$i] = 7;
|
2531
2524
|
|
2532
|
-
for (
|
2525
|
+
for ($i = 280; $i < 288; ++$i) Ai[$i] = 8;
|
2533
2526
|
|
2534
|
-
var qi = new
|
2527
|
+
var qi = new bi(32);
|
2535
2528
|
|
2536
|
-
for (
|
2529
|
+
for ($i = 0; $i < 32; ++$i) qi[$i] = 5;
|
2537
2530
|
|
2538
|
-
var
|
2531
|
+
var Li = Mi(Ai, 9, 0), Di = Mi(qi, 5, 0), Ni = function(e) {
|
2539
2532
|
return (e / 8 >> 0) + (7 & e && 1);
|
2540
|
-
},
|
2533
|
+
}, Bi = function(e, t, n) {
|
2541
2534
|
(null == t || t < 0) && (t = 0), (null == n || n > e.length) && (n = e.length);
|
2542
|
-
var i = new (e instanceof
|
2535
|
+
var i = new (e instanceof ki ? ki : e instanceof wi ? wi : bi)(n - t);
|
2543
2536
|
return i.set(e.subarray(t, n)), i;
|
2544
|
-
},
|
2537
|
+
}, Hi = function(e, t, n) {
|
2545
2538
|
n <<= 7 & t;
|
2546
2539
|
var i = t / 8 >> 0;
|
2547
2540
|
e[i] |= n, e[i + 1] |= n >>> 8;
|
2548
|
-
},
|
2541
|
+
}, ji = function(e, t, n) {
|
2549
2542
|
n <<= 7 & t;
|
2550
2543
|
var i = t / 8 >> 0;
|
2551
2544
|
e[i] |= n, e[i + 1] |= n >>> 8, e[i + 2] |= n >>> 16;
|
2552
|
-
},
|
2545
|
+
}, Ui = function(e, t) {
|
2553
2546
|
for (var n = [], i = 0; i < e.length; ++i) e[i] && n.push({
|
2554
2547
|
s: i,
|
2555
2548
|
f: e[i]
|
2556
2549
|
});
|
2557
2550
|
var r = n.length, s = n.slice();
|
2558
|
-
if (!r) return [ new
|
2551
|
+
if (!r) return [ new bi(0), 0 ];
|
2559
2552
|
if (1 == r) {
|
2560
|
-
var o = new
|
2553
|
+
var o = new bi(n[0].s + 1);
|
2561
2554
|
return o[n[0].s] = 1, [ o, 1 ];
|
2562
2555
|
}
|
2563
2556
|
n.sort((function(e, t) {
|
@@ -2581,33 +2574,33 @@ var Mi = $i(Ti, 9, 0), Oi = $i(qi, 5, 0), Ai = function(e) {
|
|
2581
2574
|
};
|
2582
2575
|
var h = s[0].s;
|
2583
2576
|
for (i = 1; i < r; ++i) s[i].s > h && (h = s[i].s);
|
2584
|
-
var f = new
|
2577
|
+
var f = new ki(h + 1), p = Wi(n[c - 1], f, 0);
|
2585
2578
|
if (p > t) {
|
2586
2579
|
i = 0;
|
2587
|
-
var
|
2580
|
+
var v = 0, g = p - t, _ = 1 << g;
|
2588
2581
|
for (s.sort((function(e, t) {
|
2589
2582
|
return f[t.s] - f[e.s] || e.f - t.f;
|
2590
2583
|
})); i < r; ++i) {
|
2591
2584
|
var m = s[i].s;
|
2592
2585
|
if (!(f[m] > t)) break;
|
2593
|
-
|
2586
|
+
v += _ - (1 << p - f[m]), f[m] = t;
|
2594
2587
|
}
|
2595
|
-
for (
|
2588
|
+
for (v >>>= g; v > 0; ) {
|
2596
2589
|
var y = s[i].s;
|
2597
|
-
f[y] < t ?
|
2590
|
+
f[y] < t ? v -= 1 << t - f[y]++ - 1 : ++i;
|
2598
2591
|
}
|
2599
|
-
for (;i >= 0 &&
|
2592
|
+
for (;i >= 0 && v; --i) {
|
2600
2593
|
var b = s[i].s;
|
2601
|
-
f[b] == t && (--f[b], ++
|
2594
|
+
f[b] == t && (--f[b], ++v);
|
2602
2595
|
}
|
2603
2596
|
p = t;
|
2604
2597
|
}
|
2605
|
-
return [ new
|
2606
|
-
},
|
2598
|
+
return [ new bi(f), p ];
|
2599
|
+
}, Wi = function e(t, n, i) {
|
2607
2600
|
return -1 == t.s ? Math.max(e(t.l, n, i + 1), e(t.r, n, i + 1)) : n[t.s] = i;
|
2608
|
-
},
|
2601
|
+
}, Gi = function(e) {
|
2609
2602
|
for (var t = e.length; t && !e[--t]; ) ;
|
2610
|
-
for (var n = new
|
2603
|
+
for (var n = new ki(++t), i = 0, r = e[0], s = 1, o = function(e) {
|
2611
2604
|
n[i++] = e;
|
2612
2605
|
}, a = 1; a <= t; ++a) if (e[a] == r && a != t) ++s; else {
|
2613
2606
|
if (!r && s > 2) {
|
@@ -2621,104 +2614,104 @@ var Mi = $i(Ti, 9, 0), Oi = $i(qi, 5, 0), Ai = function(e) {
|
|
2621
2614
|
s = 1, r = e[a];
|
2622
2615
|
}
|
2623
2616
|
return [ n.subarray(0, i), t ];
|
2624
|
-
},
|
2617
|
+
}, zi = function(e, t) {
|
2625
2618
|
for (var n = 0, i = 0; i < t.length; ++i) n += e[i] * t[i];
|
2626
2619
|
return n;
|
2627
|
-
},
|
2628
|
-
var i = n.length, r =
|
2620
|
+
}, Vi = function(e, t, n) {
|
2621
|
+
var i = n.length, r = Ni(t + 2);
|
2629
2622
|
e[r] = 255 & i, e[r + 1] = i >>> 8, e[r + 2] = 255 ^ e[r], e[r + 3] = 255 ^ e[r + 1];
|
2630
2623
|
for (var s = 0; s < i; ++s) e[r + s + 4] = n[s];
|
2631
2624
|
return 8 * (r + 4 + i);
|
2632
|
-
},
|
2633
|
-
|
2634
|
-
for (var d =
|
2625
|
+
}, Qi = function(e, t, n, i, r, s, o, a, u, l, c) {
|
2626
|
+
Hi(t, c++, n), ++r[256];
|
2627
|
+
for (var d = Ui(r, 15), h = d[0], f = d[1], p = Ui(s, 15), v = p[0], g = p[1], _ = Gi(h), m = _[0], y = _[1], b = Gi(v), k = b[0], w = b[1], S = new ki(19), F = 0; F < m.length; ++F) S[31 & m[F]]++;
|
2635
2628
|
for (F = 0; F < k.length; ++F) S[31 & k[F]]++;
|
2636
|
-
for (var
|
2637
|
-
var
|
2638
|
-
if (
|
2639
|
-
if (
|
2640
|
-
|
2641
|
-
var
|
2642
|
-
|
2643
|
-
for (F = 0; F <
|
2644
|
-
c += 3 *
|
2645
|
-
for (var
|
2646
|
-
var N = D
|
2629
|
+
for (var E = Ui(S, 7), R = E[0], x = E[1], I = 19; I > 4 && !R[Ei[I - 1]]; --I) ;
|
2630
|
+
var P, C, T, $, O = l + 5 << 3, M = zi(r, Ai) + zi(s, qi) + o, A = zi(r, h) + zi(s, v) + o + 14 + 3 * I + zi(S, R) + (2 * S[16] + 3 * S[17] + 7 * S[18]);
|
2631
|
+
if (O <= M && O <= A) return Vi(t, c, e.subarray(u, u + l));
|
2632
|
+
if (Hi(t, c, 1 + (A < M)), c += 2, A < M) {
|
2633
|
+
P = Mi(h, f, 0), C = h, T = Mi(v, g, 0), $ = v;
|
2634
|
+
var q = Mi(R, x, 0);
|
2635
|
+
Hi(t, c, y - 257), Hi(t, c + 5, w - 1), Hi(t, c + 10, I - 4), c += 14;
|
2636
|
+
for (F = 0; F < I; ++F) Hi(t, c + 3 * F, R[Ei[F]]);
|
2637
|
+
c += 3 * I;
|
2638
|
+
for (var L = [ m, k ], D = 0; D < 2; ++D) {
|
2639
|
+
var N = L[D];
|
2647
2640
|
for (F = 0; F < N.length; ++F) {
|
2648
2641
|
var B = 31 & N[F];
|
2649
|
-
|
2642
|
+
Hi(t, c, q[B]), c += R[B], B > 15 && (Hi(t, c, N[F] >>> 5 & 127), c += N[F] >>> 12);
|
2650
2643
|
}
|
2651
2644
|
}
|
2652
|
-
} else
|
2645
|
+
} else P = Li, C = Ai, T = Di, $ = qi;
|
2653
2646
|
for (F = 0; F < a; ++F) if (i[F] > 255) {
|
2654
2647
|
B = i[F] >>> 18 & 31;
|
2655
|
-
|
2648
|
+
ji(t, c, P[B + 257]), c += C[B + 257], B > 7 && (Hi(t, c, i[F] >>> 23 & 31), c += Si[B]);
|
2656
2649
|
var H = 31 & i[F];
|
2657
|
-
|
2658
|
-
} else
|
2659
|
-
return
|
2660
|
-
},
|
2661
|
-
for (var e = new
|
2650
|
+
ji(t, c, T[H]), c += $[H], H > 3 && (ji(t, c, i[F] >>> 5 & 8191), c += Fi[H]);
|
2651
|
+
} else ji(t, c, P[i[F]]), c += C[i[F]];
|
2652
|
+
return ji(t, c, P[256]), c + C[256];
|
2653
|
+
}, Ji = new wi([ 65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632 ]), Yi = new bi(0), Xi = function() {
|
2654
|
+
for (var e = new wi(256), t = 0; t < 256; ++t) {
|
2662
2655
|
for (var n = t, i = 9; --i; ) n = (1 & n && 3988292384) ^ n >>> 1;
|
2663
2656
|
e[t] = n;
|
2664
2657
|
}
|
2665
2658
|
return e;
|
2666
|
-
}(),
|
2659
|
+
}(), Ki = function(e, t, n, i, r) {
|
2667
2660
|
return function(e, t, n, i, r, s) {
|
2668
|
-
var o = e.length, a = new
|
2661
|
+
var o = e.length, a = new bi(i + o + 5 * (1 + Math.floor(o / 7e3)) + r), u = a.subarray(i, a.length - r), l = 0;
|
2669
2662
|
if (!t || o < 8) for (var c = 0; c <= o; c += 65535) {
|
2670
2663
|
var d = c + 65535;
|
2671
|
-
d < o ? l =
|
2664
|
+
d < o ? l = Vi(u, l, e.subarray(c, d)) : (u[c] = s, l = Vi(u, l, e.subarray(c, o)));
|
2672
2665
|
} else {
|
2673
|
-
for (var h =
|
2674
|
-
return (e[t] ^ e[t + 1] << m ^ e[t + 2] << y) &
|
2675
|
-
}, k = new
|
2676
|
-
0), x = 0,
|
2677
|
-
var
|
2678
|
-
if (
|
2679
|
-
var
|
2680
|
-
if ((F > 7e3 ||
|
2681
|
-
l =
|
2682
|
-
for (var
|
2683
|
-
for (
|
2666
|
+
for (var h = Ji[t - 1], f = h >>> 13, p = 8191 & h, v = (1 << n) - 1, g = new ki(32768), _ = new ki(v + 1), m = Math.ceil(n / 3), y = 2 * m, b = function(t) {
|
2667
|
+
return (e[t] ^ e[t + 1] << m ^ e[t + 2] << y) & v;
|
2668
|
+
}, k = new wi(25e3), w = new ki(288), S = new ki(32), F = 0, E = 0, R = (c = 0,
|
2669
|
+
0), x = 0, I = 0; c < o; ++c) {
|
2670
|
+
var P = b(c), C = 32767 & c, T = _[P];
|
2671
|
+
if (g[C] = T, _[P] = C, x <= c) {
|
2672
|
+
var $ = o - c;
|
2673
|
+
if ((F > 7e3 || R > 24576) && $ > 423) {
|
2674
|
+
l = Qi(e, u, 0, k, w, S, E, R, I, c - I, l), R = F = E = 0, I = c;
|
2675
|
+
for (var O = 0; O < 286; ++O) w[O] = 0;
|
2676
|
+
for (O = 0; O < 30; ++O) S[O] = 0;
|
2684
2677
|
}
|
2685
|
-
var M = 2,
|
2686
|
-
if (
|
2687
|
-
if (e[c + M] == e[c + M -
|
2688
|
-
for (var H = 0; H < B && e[c + H] == e[c + H -
|
2678
|
+
var M = 2, A = 0, q = p, L = C - T & 32767;
|
2679
|
+
if ($ > 2 && P == b(c - L)) for (var D = Math.min(f, $) - 1, N = Math.min(32767, c), B = Math.min(258, $); L <= N && --q && C != T; ) {
|
2680
|
+
if (e[c + M] == e[c + M - L]) {
|
2681
|
+
for (var H = 0; H < B && e[c + H] == e[c + H - L]; ++H) ;
|
2689
2682
|
if (H > M) {
|
2690
|
-
if (M = H,
|
2691
|
-
var j = Math.min(
|
2692
|
-
for (
|
2693
|
-
var W = c -
|
2694
|
-
|
2683
|
+
if (M = H, A = L, H > D) break;
|
2684
|
+
var j = Math.min(L, H - 2), U = 0;
|
2685
|
+
for (O = 0; O < j; ++O) {
|
2686
|
+
var W = c - L + O + 32768 & 32767, G = W - g[W] + 32768 & 32767;
|
2687
|
+
G > U && (U = G, T = W);
|
2695
2688
|
}
|
2696
2689
|
}
|
2697
2690
|
}
|
2698
|
-
|
2691
|
+
L += (C = T) - (T = g[C]) + 32768 & 32767;
|
2699
2692
|
}
|
2700
|
-
if (
|
2701
|
-
k[
|
2702
|
-
var z = 31 & Pi[M],
|
2703
|
-
|
2704
|
-
} else k[
|
2693
|
+
if (A) {
|
2694
|
+
k[R++] = 268435456 | Pi[M] << 18 | Ci[A];
|
2695
|
+
var z = 31 & Pi[M], V = 31 & Ci[A];
|
2696
|
+
E += Si[z] + Fi[V], ++w[257 + z], ++S[V], x = c + M, ++F;
|
2697
|
+
} else k[R++] = e[c], ++w[e[c]];
|
2705
2698
|
}
|
2706
2699
|
}
|
2707
|
-
l =
|
2700
|
+
l = Qi(e, u, s, k, w, S, E, R, I, c - I, l), s || (l = Vi(u, l, Yi));
|
2708
2701
|
}
|
2709
|
-
return
|
2702
|
+
return Bi(a, 0, i + Ni(l) + r);
|
2710
2703
|
}(e, null == t.level ? 6 : t.level, null == t.mem ? Math.ceil(1.5 * Math.max(8, Math.min(13, Math.log(e.length)))) : 12 + t.mem, n, i, !r);
|
2711
|
-
},
|
2704
|
+
}, Zi = function(e, t, n) {
|
2712
2705
|
for (;n; ++t) e[t] = n, n >>>= 8;
|
2713
2706
|
};
|
2714
2707
|
|
2715
|
-
function
|
2708
|
+
function er(e, t) {
|
2716
2709
|
void 0 === t && (t = {});
|
2717
2710
|
var n = function() {
|
2718
2711
|
var e = 4294967295;
|
2719
2712
|
return {
|
2720
2713
|
p: function(t) {
|
2721
|
-
for (var n = e, i = 0; i < t.length; ++i) n =
|
2714
|
+
for (var n = e, i = 0; i < t.length; ++i) n = Xi[255 & n ^ t[i]] ^ n >>> 8;
|
2722
2715
|
e = n;
|
2723
2716
|
},
|
2724
2717
|
d: function() {
|
@@ -2727,40 +2720,40 @@ function Ki(e, t) {
|
|
2727
2720
|
};
|
2728
2721
|
}(), i = e.length;
|
2729
2722
|
n.p(e);
|
2730
|
-
var r, s =
|
2723
|
+
var r, s = Ki(e, t, 10 + ((r = t).filename && r.filename.length + 1 || 0), 8), o = s.length;
|
2731
2724
|
return function(e, t) {
|
2732
2725
|
var n = t.filename;
|
2733
2726
|
if (e[0] = 31, e[1] = 139, e[2] = 8, e[8] = t.level < 2 ? 4 : 9 == t.level ? 2 : 0,
|
2734
|
-
e[9] = 3, 0 != t.mtime &&
|
2727
|
+
e[9] = 3, 0 != t.mtime && Zi(e, 4, Math.floor(new Date(t.mtime || Date.now()) / 1e3)),
|
2735
2728
|
n) {
|
2736
2729
|
e[3] = 8;
|
2737
2730
|
for (var i = 0; i <= n.length; ++i) e[i + 10] = n.charCodeAt(i);
|
2738
2731
|
}
|
2739
|
-
}(s, t),
|
2732
|
+
}(s, t), Zi(s, o - 8, n.d()), Zi(s, o - 4, i), s;
|
2740
2733
|
}
|
2741
2734
|
|
2742
|
-
var
|
2735
|
+
var tr = !!D || !!L, nr = "text/plain", ir = function(e, n) {
|
2743
2736
|
var i = u(e.split("?"), 2), r = i[0], s = i[1], o = t({}, n);
|
2744
2737
|
null == s || s.split("&").forEach((function(e) {
|
2745
2738
|
var t = u(e.split("="), 1)[0];
|
2746
2739
|
delete o[t];
|
2747
2740
|
}));
|
2748
|
-
var a =
|
2741
|
+
var a = lt(o);
|
2749
2742
|
return a = a ? (s ? s + "&" : "") + a : s, "".concat(r, "?").concat(a);
|
2750
|
-
},
|
2743
|
+
}, rr = function(e) {
|
2751
2744
|
return "data=" + encodeURIComponent("string" == typeof e ? e : JSON.stringify(e));
|
2752
|
-
},
|
2745
|
+
}, sr = function(e) {
|
2753
2746
|
var t = e.data, n = e.compression;
|
2754
2747
|
if (t) {
|
2755
2748
|
if (n === ne.GZipJS) {
|
2756
|
-
var i =
|
2749
|
+
var i = er(function(e, t) {
|
2757
2750
|
var n = e.length;
|
2758
2751
|
if (!t && "undefined" != typeof TextEncoder) return (new TextEncoder).encode(e);
|
2759
|
-
for (var i = new
|
2752
|
+
for (var i = new bi(e.length + (e.length >>> 1)), r = 0, s = function(e) {
|
2760
2753
|
i[r++] = e;
|
2761
2754
|
}, o = 0; o < n; ++o) {
|
2762
2755
|
if (r + 5 > i.length) {
|
2763
|
-
var a = new
|
2756
|
+
var a = new bi(r + 8 + (n - o << 1));
|
2764
2757
|
a.set(i), i = a;
|
2765
2758
|
}
|
2766
2759
|
var u = e.charCodeAt(o);
|
@@ -2768,14 +2761,14 @@ var Xi = !!L || !!D, Zi = "text/plain", er = function(e, n) {
|
|
2768
2761
|
s(128 | u >>> 12 & 63), s(128 | u >>> 6 & 63), s(128 | 63 & u)) : (s(224 | u >>> 12),
|
2769
2762
|
s(128 | u >>> 6 & 63), s(128 | 63 & u));
|
2770
2763
|
}
|
2771
|
-
return
|
2764
|
+
return Bi(i, 0, r);
|
2772
2765
|
}(JSON.stringify(t)), {
|
2773
2766
|
mtime: 0
|
2774
2767
|
});
|
2775
2768
|
return {
|
2776
|
-
contentType:
|
2769
|
+
contentType: nr,
|
2777
2770
|
body: new Blob([ i ], {
|
2778
|
-
type:
|
2771
|
+
type: nr
|
2779
2772
|
})
|
2780
2773
|
};
|
2781
2774
|
}
|
@@ -2800,7 +2793,7 @@ var Xi = !!L || !!D, Zi = "text/plain", er = function(e, n) {
|
|
2800
2793
|
}(JSON.stringify(t));
|
2801
2794
|
return {
|
2802
2795
|
contentType: "application/x-www-form-urlencoded",
|
2803
|
-
body:
|
2796
|
+
body: rr(r)
|
2804
2797
|
};
|
2805
2798
|
}
|
2806
2799
|
return {
|
@@ -2808,96 +2801,101 @@ var Xi = !!L || !!D, Zi = "text/plain", er = function(e, n) {
|
|
2808
2801
|
body: JSON.stringify(t)
|
2809
2802
|
};
|
2810
2803
|
}
|
2811
|
-
},
|
2812
|
-
|
2813
|
-
|
2814
|
-
|
2815
|
-
|
2816
|
-
|
2817
|
-
|
2818
|
-
|
2819
|
-
|
2820
|
-
|
2821
|
-
|
2822
|
-
|
2804
|
+
}, or = [];
|
2805
|
+
|
2806
|
+
D && or.push({
|
2807
|
+
transport: "XHR",
|
2808
|
+
method: function(e) {
|
2809
|
+
var t, n = new D;
|
2810
|
+
n.open(e.method || "GET", e.url, !0);
|
2811
|
+
var i = null !== (t = sr(e)) && void 0 !== t ? t : {}, r = i.contentType, s = i.body;
|
2812
|
+
V(e.headers, (function(e, t) {
|
2813
|
+
n.setRequestHeader(t, e);
|
2814
|
+
})), r && n.setRequestHeader("Content-Type", r), e.timeout && (n.timeout = e.timeout),
|
2815
|
+
n.withCredentials = !0, n.onreadystatechange = function() {
|
2816
|
+
if (4 === n.readyState) {
|
2817
|
+
var t, i = {
|
2818
|
+
statusCode: n.status,
|
2819
|
+
text: n.responseText
|
2820
|
+
};
|
2821
|
+
if (200 === n.status) try {
|
2822
|
+
i.json = JSON.parse(n.responseText);
|
2823
|
+
} catch (e) {}
|
2824
|
+
null === (t = e.callback) || void 0 === t || t.call(e, i);
|
2825
|
+
}
|
2826
|
+
}, n.send(s);
|
2827
|
+
}
|
2828
|
+
}), L && or.push({
|
2829
|
+
transport: "fetch",
|
2830
|
+
method: function(e) {
|
2831
|
+
var t, n, i = null !== (t = sr(e)) && void 0 !== t ? t : {}, r = i.contentType, s = i.body, o = new Headers;
|
2832
|
+
V(o, (function(e, t) {
|
2833
|
+
o.append(t, e);
|
2834
|
+
})), r && o.append("Content-Type", r);
|
2835
|
+
var a = e.url, u = null;
|
2836
|
+
if (N) {
|
2837
|
+
var l = new N;
|
2838
|
+
u = {
|
2839
|
+
signal: l.signal,
|
2840
|
+
timeout: setTimeout((function() {
|
2841
|
+
return l.abort();
|
2842
|
+
}), e.timeout)
|
2823
2843
|
};
|
2824
|
-
if (200 === n.status) try {
|
2825
|
-
i.json = JSON.parse(n.responseText);
|
2826
|
-
} catch (e) {}
|
2827
|
-
null === (t = e.callback) || void 0 === t || t.call(e, i);
|
2828
2844
|
}
|
2829
|
-
|
2830
|
-
|
2831
|
-
|
2832
|
-
|
2833
|
-
|
2834
|
-
|
2835
|
-
|
2836
|
-
|
2837
|
-
|
2838
|
-
|
2839
|
-
|
2840
|
-
|
2841
|
-
|
2842
|
-
|
2843
|
-
|
2844
|
-
|
2845
|
-
|
2846
|
-
|
2847
|
-
|
2848
|
-
|
2849
|
-
|
2850
|
-
|
2851
|
-
|
2852
|
-
|
2853
|
-
|
2854
|
-
|
2855
|
-
|
2856
|
-
};
|
2857
|
-
if (200 === t.status) try {
|
2858
|
-
r.json = JSON.parse(n);
|
2859
|
-
} catch (e) {
|
2860
|
-
U.error(e);
|
2861
|
-
}
|
2862
|
-
null === (i = e.callback) || void 0 === i || i.call(e, r);
|
2845
|
+
L(a, {
|
2846
|
+
method: (null == e ? void 0 : e.method) || "GET",
|
2847
|
+
headers: o,
|
2848
|
+
keepalive: "POST" === e.method,
|
2849
|
+
body: s,
|
2850
|
+
signal: null === (n = u) || void 0 === n ? void 0 : n.signal
|
2851
|
+
}).then((function(t) {
|
2852
|
+
return t.text().then((function(n) {
|
2853
|
+
var i, r = {
|
2854
|
+
statusCode: t.status,
|
2855
|
+
text: n
|
2856
|
+
};
|
2857
|
+
if (200 === t.status) try {
|
2858
|
+
r.json = JSON.parse(n);
|
2859
|
+
} catch (e) {
|
2860
|
+
U.error(e);
|
2861
|
+
}
|
2862
|
+
null === (i = e.callback) || void 0 === i || i.call(e, r);
|
2863
|
+
}));
|
2864
|
+
})).catch((function(t) {
|
2865
|
+
var n;
|
2866
|
+
U.error(t), null === (n = e.callback) || void 0 === n || n.call(e, {
|
2867
|
+
statusCode: 0,
|
2868
|
+
text: t
|
2869
|
+
});
|
2870
|
+
})).finally((function() {
|
2871
|
+
return u ? clearTimeout(u.timeout) : null;
|
2863
2872
|
}));
|
2864
|
-
}
|
2865
|
-
|
2866
|
-
|
2867
|
-
|
2868
|
-
|
2873
|
+
}
|
2874
|
+
}), null != M && M.sendBeacon && or.push({
|
2875
|
+
transport: "sendBeacon",
|
2876
|
+
method: function(e) {
|
2877
|
+
var t = ir(e.url, {
|
2878
|
+
beacon: "1"
|
2869
2879
|
});
|
2870
|
-
|
2871
|
-
|
2872
|
-
|
2873
|
-
}
|
2874
|
-
|
2875
|
-
|
2876
|
-
});
|
2877
|
-
try {
|
2878
|
-
var n, i = null !== (n = nr(e)) && void 0 !== n ? n : {}, r = i.contentType, s = i.body, o = "string" == typeof s ? new Blob([ s ], {
|
2879
|
-
type: r
|
2880
|
-
}) : s;
|
2881
|
-
M.sendBeacon(t, o);
|
2882
|
-
} catch (e) {}
|
2883
|
-
}, or = function(e) {
|
2884
|
-
var t;
|
2885
|
-
if (O) {
|
2886
|
-
var n = O.createElement("script");
|
2887
|
-
n.type = "text/javascript", n.async = !0, n.defer = !0, n.src = e.url;
|
2888
|
-
var i = O.getElementsByTagName("script")[0];
|
2889
|
-
null === (t = i.parentNode) || void 0 === t || t.insertBefore(n, i);
|
2880
|
+
try {
|
2881
|
+
var n, i = null !== (n = sr(e)) && void 0 !== n ? n : {}, r = i.contentType, s = i.body, o = "string" == typeof s ? new Blob([ s ], {
|
2882
|
+
type: r
|
2883
|
+
}) : s;
|
2884
|
+
M.sendBeacon(t, o);
|
2885
|
+
} catch (e) {}
|
2890
2886
|
}
|
2891
|
-
}
|
2887
|
+
});
|
2888
|
+
|
2889
|
+
var ar = [ "retriesPerformedSoFar" ];
|
2892
2890
|
|
2893
2891
|
var ur, lr = function() {
|
2894
2892
|
function e(t) {
|
2895
2893
|
var n = this;
|
2896
2894
|
i(this, e), o(this, "isPolling", !1), o(this, "pollIntervalMs", 3e3), o(this, "queue", []),
|
2897
|
-
this.instance = t, this.queue = [], this.areWeOnline = !0, !w(
|
2898
|
-
|
2895
|
+
this.instance = t, this.queue = [], this.areWeOnline = !0, !w(P) && "onLine" in P.navigator && (this.areWeOnline = P.navigator.onLine,
|
2896
|
+
P.addEventListener("online", (function() {
|
2899
2897
|
n.areWeOnline = !0, n.flush();
|
2900
|
-
})),
|
2898
|
+
})), P.addEventListener("offline", (function() {
|
2901
2899
|
n.areWeOnline = !1;
|
2902
2900
|
})));
|
2903
2901
|
}
|
@@ -2905,7 +2903,7 @@ var ur, lr = function() {
|
|
2905
2903
|
key: "retriableRequest",
|
2906
2904
|
value: function(e) {
|
2907
2905
|
var n = this, i = e.retriesPerformedSoFar, r = a(e, ar);
|
2908
|
-
|
2906
|
+
R(i) && i > 0 && (r.url = ir(r.url, {
|
2909
2907
|
retry_count: i
|
2910
2908
|
})), this.instance._send_request(t(t({}, r), {}, {
|
2911
2909
|
callback: function(e) {
|
@@ -2987,14 +2985,14 @@ var ur, lr = function() {
|
|
2987
2985
|
function e(t, n, r, s) {
|
2988
2986
|
i(this, e), o(this, "_sessionIdChangedHandlers", []), this.config = t, this.persistence = n,
|
2989
2987
|
this._windowId = void 0, this._sessionId = void 0, this._sessionStartTimestamp = null,
|
2990
|
-
this._sessionActivityTimestamp = null, this._sessionIdGenerator = r ||
|
2988
|
+
this._sessionActivityTimestamp = null, this._sessionIdGenerator = r || We, this._windowIdGenerator = s || We;
|
2991
2989
|
var a = t.persistence_name || t.token, u = t.session_idle_timeout_seconds || cr;
|
2992
|
-
if (
|
2990
|
+
if (R(u) ? u > cr ? U.warn("session_idle_timeout_seconds cannot be greater than 30 minutes. Using 30 minutes instead.") : u < 60 && U.warn("session_idle_timeout_seconds cannot be less than 60 seconds. Using 60 seconds instead.") : (U.warn("session_idle_timeout_seconds must be a number. Defaulting to 30 minutes."),
|
2993
2991
|
u = cr), this._sessionTimeoutMs = 1e3 * Math.min(Math.max(u, 60), cr), this._window_id_storage_key = "ph_" + a + "_window_id",
|
2994
2992
|
this._primary_window_exists_storage_key = "ph_" + a + "_primary_window_exists",
|
2995
2993
|
this._canUseSessionStorage()) {
|
2996
|
-
var l =
|
2997
|
-
l && !c ? this._windowId = l :
|
2994
|
+
var l = st.parse(this._window_id_storage_key), c = st.parse(this._primary_window_exists_storage_key);
|
2995
|
+
l && !c ? this._windowId = l : st.remove(this._window_id_storage_key), st.set(this._primary_window_exists_storage_key, !0);
|
2998
2996
|
}
|
2999
2997
|
this._listenToReloadWindow();
|
3000
2998
|
}
|
@@ -3013,29 +3011,29 @@ var ur, lr = function() {
|
|
3013
3011
|
}, {
|
3014
3012
|
key: "_canUseSessionStorage",
|
3015
3013
|
value: function() {
|
3016
|
-
return "memory" !== this.config.persistence && !this.persistence.disabled &&
|
3014
|
+
return "memory" !== this.config.persistence && !this.persistence.disabled && st.is_supported();
|
3017
3015
|
}
|
3018
3016
|
}, {
|
3019
3017
|
key: "_setWindowId",
|
3020
3018
|
value: function(e) {
|
3021
|
-
e !== this._windowId && (this._windowId = e, this._canUseSessionStorage() &&
|
3019
|
+
e !== this._windowId && (this._windowId = e, this._canUseSessionStorage() && st.set(this._window_id_storage_key, e));
|
3022
3020
|
}
|
3023
3021
|
}, {
|
3024
3022
|
key: "_getWindowId",
|
3025
3023
|
value: function() {
|
3026
|
-
return this._windowId ? this._windowId : this._canUseSessionStorage() ?
|
3024
|
+
return this._windowId ? this._windowId : this._canUseSessionStorage() ? st.parse(this._window_id_storage_key) : null;
|
3027
3025
|
}
|
3028
3026
|
}, {
|
3029
3027
|
key: "_setSessionId",
|
3030
3028
|
value: function(e, t, n) {
|
3031
3029
|
e === this._sessionId && t === this._sessionActivityTimestamp && n === this._sessionStartTimestamp || (this._sessionStartTimestamp = n,
|
3032
|
-
this._sessionActivityTimestamp = t, this._sessionId = e, this.persistence.register(o({},
|
3030
|
+
this._sessionActivityTimestamp = t, this._sessionId = e, this.persistence.register(o({}, _e, [ t, e, n ])));
|
3033
3031
|
}
|
3034
3032
|
}, {
|
3035
3033
|
key: "_getSessionId",
|
3036
3034
|
value: function() {
|
3037
3035
|
if (this._sessionId && this._sessionActivityTimestamp && this._sessionStartTimestamp) return [ this._sessionActivityTimestamp, this._sessionId, this._sessionStartTimestamp ];
|
3038
|
-
var e = this.persistence.props[
|
3036
|
+
var e = this.persistence.props[_e];
|
3039
3037
|
return m(e) && 2 === e.length && e.push(e[0]), e || [ 0, null, 0 ];
|
3040
3038
|
}
|
3041
3039
|
}, {
|
@@ -3047,8 +3045,8 @@ var ur, lr = function() {
|
|
3047
3045
|
key: "_listenToReloadWindow",
|
3048
3046
|
value: function() {
|
3049
3047
|
var e = this;
|
3050
|
-
null ==
|
3051
|
-
e._canUseSessionStorage() &&
|
3048
|
+
null == P || P.addEventListener("beforeunload", (function() {
|
3049
|
+
e._canUseSessionStorage() && st.remove(e._primary_window_exists_storage_key);
|
3052
3050
|
}));
|
3053
3051
|
}
|
3054
3052
|
}, {
|
@@ -3143,144 +3141,143 @@ var hr = "i.posthog.com", fr = function() {
|
|
3143
3141
|
t.capture("$exception", f), e;
|
3144
3142
|
}));
|
3145
3143
|
};
|
3146
|
-
}))
|
3144
|
+
}));
|
3145
|
+
|
3146
|
+
function vr(e, t) {
|
3147
|
+
var n = e.config.segment;
|
3148
|
+
if (!n) return t();
|
3149
|
+
!function(e, t) {
|
3150
|
+
var n = e.config.segment;
|
3151
|
+
if (!n) return t();
|
3152
|
+
var i = function(n) {
|
3153
|
+
var i = function() {
|
3154
|
+
return n.anonymousId() || We();
|
3155
|
+
};
|
3156
|
+
e.config.get_device_id = i, n.id() && (e.register({
|
3157
|
+
distinct_id: n.id(),
|
3158
|
+
$device_id: i()
|
3159
|
+
}), e.persistence.set_property(Ee, "identified")), t();
|
3160
|
+
}, r = n.user();
|
3161
|
+
"then" in r && y(r.then) ? r.then((function(e) {
|
3162
|
+
return i(e);
|
3163
|
+
})) : i(r);
|
3164
|
+
}(e, (function() {
|
3165
|
+
n.register(function(e) {
|
3166
|
+
Promise && Promise.resolve || U.warn("This browser does not have Promise support, and can not use the segment integration");
|
3167
|
+
var t = function(t, n) {
|
3168
|
+
var i;
|
3169
|
+
if (!n) return t;
|
3170
|
+
t.event.userId || t.event.anonymousId === e.get_distinct_id() || e.reset(), t.event.userId && t.event.userId !== e.get_distinct_id() && (e.register({
|
3171
|
+
distinct_id: t.event.userId
|
3172
|
+
}), e.reloadFeatureFlags());
|
3173
|
+
var r = e._calculate_event_properties(n, null !== (i = t.event.properties) && void 0 !== i ? i : {});
|
3174
|
+
return t.event.properties = Object.assign({}, r, t.event.properties), t;
|
3175
|
+
};
|
3176
|
+
return {
|
3177
|
+
name: "PostHog JS",
|
3178
|
+
type: "enrichment",
|
3179
|
+
version: "1.0.0",
|
3180
|
+
isLoaded: function() {
|
3181
|
+
return !0;
|
3182
|
+
},
|
3183
|
+
load: function() {
|
3184
|
+
return Promise.resolve();
|
3185
|
+
},
|
3186
|
+
track: function(e) {
|
3187
|
+
return t(e, e.event.event);
|
3188
|
+
},
|
3189
|
+
page: function(e) {
|
3190
|
+
return t(e, "$pageview");
|
3191
|
+
},
|
3192
|
+
identify: function(e) {
|
3193
|
+
return t(e, "$identify");
|
3194
|
+
},
|
3195
|
+
screen: function(e) {
|
3196
|
+
return t(e, "$screen");
|
3197
|
+
}
|
3198
|
+
};
|
3199
|
+
}(e)).then((function() {
|
3200
|
+
t();
|
3201
|
+
}));
|
3202
|
+
}));
|
3203
|
+
}
|
3204
|
+
|
3205
|
+
var gr = function() {
|
3147
3206
|
function e(t) {
|
3148
|
-
|
3149
|
-
i(this, e), o(this, "_hasSeenPageView", !1), o(this, "_updateScrollData", (function() {
|
3150
|
-
var e, t, i, r;
|
3151
|
-
n._pageViewData || (n._pageViewData = n._createPageViewData());
|
3152
|
-
var s = n._pageViewData, o = n._scrollY(), a = n._scrollHeight(), u = n._contentY(), l = n._contentHeight();
|
3153
|
-
s.lastScrollY = o, s.maxScrollY = Math.max(o, null !== (e = s.maxScrollY) && void 0 !== e ? e : 0),
|
3154
|
-
s.maxScrollHeight = Math.max(a, null !== (t = s.maxScrollHeight) && void 0 !== t ? t : 0),
|
3155
|
-
s.lastContentY = u, s.maxContentY = Math.max(u, null !== (i = s.maxContentY) && void 0 !== i ? i : 0),
|
3156
|
-
s.maxContentHeight = Math.max(l, null !== (r = s.maxContentHeight) && void 0 !== r ? r : 0);
|
3157
|
-
})), this._instance = t;
|
3207
|
+
i(this, e), this._instance = t;
|
3158
3208
|
}
|
3159
3209
|
return s(e, [ {
|
3160
|
-
key: "_createPageViewData",
|
3161
|
-
value: function() {
|
3162
|
-
var e;
|
3163
|
-
return {
|
3164
|
-
pathname: null !== (e = null == I ? void 0 : I.location.pathname) && void 0 !== e ? e : ""
|
3165
|
-
};
|
3166
|
-
}
|
3167
|
-
}, {
|
3168
3210
|
key: "doPageView",
|
3169
3211
|
value: function() {
|
3170
|
-
var e,
|
3171
|
-
return this.
|
3172
|
-
|
3173
|
-
setTimeout(this._updateScrollData, 0), t({
|
3174
|
-
$prev_pageview_pathname: null === (e = n) || void 0 === e ? void 0 : e.pathname
|
3175
|
-
}, this._calculatePrevPageScrollProperties(n));
|
3212
|
+
var e, t = this._previousScrollProperties();
|
3213
|
+
return this._currentPath = null !== (e = null == P ? void 0 : P.location.pathname) && void 0 !== e ? e : "",
|
3214
|
+
this._instance.scrollManager.resetContext(), t;
|
3176
3215
|
}
|
3177
3216
|
}, {
|
3178
3217
|
key: "doPageLeave",
|
3179
3218
|
value: function() {
|
3180
|
-
|
3181
|
-
return t({
|
3182
|
-
$prev_pageview_pathname: null == e ? void 0 : e.pathname
|
3183
|
-
}, this._calculatePrevPageScrollProperties(e));
|
3219
|
+
return this._previousScrollProperties();
|
3184
3220
|
}
|
3185
3221
|
}, {
|
3186
|
-
key: "
|
3187
|
-
value: function(e) {
|
3188
|
-
if (!e || null == e.maxScrollHeight || null == e.lastScrollY || null == e.maxScrollY || null == e.maxContentHeight || null == e.lastContentY || null == e.maxContentY) return {};
|
3189
|
-
var t = e.maxScrollHeight, n = e.lastScrollY, i = e.maxScrollY, r = e.maxContentHeight, s = e.lastContentY, o = e.maxContentY;
|
3190
|
-
return t = Math.ceil(t), n = Math.ceil(n), i = Math.ceil(i), r = Math.ceil(r), s = Math.ceil(s),
|
3191
|
-
o = Math.ceil(o), {
|
3192
|
-
$prev_pageview_last_scroll: n,
|
3193
|
-
$prev_pageview_last_scroll_percentage: t <= 1 ? 1 : vr(n / t, 0, 1),
|
3194
|
-
$prev_pageview_max_scroll: i,
|
3195
|
-
$prev_pageview_max_scroll_percentage: t <= 1 ? 1 : vr(i / t, 0, 1),
|
3196
|
-
$prev_pageview_last_content: s,
|
3197
|
-
$prev_pageview_last_content_percentage: r <= 1 ? 1 : vr(s / r, 0, 1),
|
3198
|
-
$prev_pageview_max_content: o,
|
3199
|
-
$prev_pageview_max_content_percentage: r <= 1 ? 1 : vr(o / r, 0, 1)
|
3200
|
-
};
|
3201
|
-
}
|
3202
|
-
}, {
|
3203
|
-
key: "startMeasuringScrollPosition",
|
3222
|
+
key: "_previousScrollProperties",
|
3204
3223
|
value: function() {
|
3205
|
-
|
3206
|
-
|
3207
|
-
|
3208
|
-
|
3209
|
-
|
3210
|
-
|
3211
|
-
|
3212
|
-
|
3213
|
-
|
3214
|
-
|
3215
|
-
|
3216
|
-
|
3217
|
-
|
3218
|
-
|
3219
|
-
|
3220
|
-
for (t.s(); !(e = t.n()).done; ) {
|
3221
|
-
var n = e.value, i = null == I ? void 0 : I.document.querySelector(n);
|
3222
|
-
if (i) return i;
|
3223
|
-
}
|
3224
|
-
} catch (e) {
|
3225
|
-
t.e(e);
|
3226
|
-
} finally {
|
3227
|
-
t.f();
|
3228
|
-
}
|
3229
|
-
}
|
3230
|
-
}, {
|
3231
|
-
key: "_scrollHeight",
|
3232
|
-
value: function() {
|
3233
|
-
var e = this._scrollElement();
|
3234
|
-
return e ? Math.max(0, e.scrollHeight - e.clientHeight) : 0;
|
3235
|
-
}
|
3236
|
-
}, {
|
3237
|
-
key: "_scrollY",
|
3238
|
-
value: function() {
|
3239
|
-
if (this._instance.config.scroll_root_selector) {
|
3240
|
-
var e = this._scrollElement();
|
3241
|
-
return e && e.scrollTop || 0;
|
3242
|
-
}
|
3243
|
-
return I && (I.scrollY || I.pageYOffset || I.document.documentElement.scrollTop) || 0;
|
3244
|
-
}
|
3245
|
-
}, {
|
3246
|
-
key: "_contentHeight",
|
3247
|
-
value: function() {
|
3248
|
-
var e = this._scrollElement();
|
3249
|
-
return (null == e ? void 0 : e.scrollHeight) || 0;
|
3250
|
-
}
|
3251
|
-
}, {
|
3252
|
-
key: "_contentY",
|
3253
|
-
value: function() {
|
3254
|
-
var e = this._scrollElement(), t = (null == e ? void 0 : e.clientHeight) || 0;
|
3255
|
-
return this._scrollY() + t;
|
3224
|
+
var e = this._currentPath, t = this._instance.scrollManager.getContext();
|
3225
|
+
if (!e || !t) return {};
|
3226
|
+
var n = t.maxScrollHeight, i = t.lastScrollY, r = t.maxScrollY, s = t.maxContentHeight, o = t.lastContentY, a = t.maxContentY;
|
3227
|
+
return w(n) || w(i) || w(r) || w(s) || w(o) || w(a) ? {} : (n = Math.ceil(n), i = Math.ceil(i),
|
3228
|
+
r = Math.ceil(r), s = Math.ceil(s), o = Math.ceil(o), a = Math.ceil(a), {
|
3229
|
+
$prev_pageview_pathname: e,
|
3230
|
+
$prev_pageview_last_scroll: i,
|
3231
|
+
$prev_pageview_last_scroll_percentage: n <= 1 ? 1 : _r(i / n, 0, 1),
|
3232
|
+
$prev_pageview_max_scroll: r,
|
3233
|
+
$prev_pageview_max_scroll_percentage: n <= 1 ? 1 : _r(r / n, 0, 1),
|
3234
|
+
$prev_pageview_last_content: o,
|
3235
|
+
$prev_pageview_last_content_percentage: s <= 1 ? 1 : _r(o / s, 0, 1),
|
3236
|
+
$prev_pageview_max_content: a,
|
3237
|
+
$prev_pageview_max_content_percentage: s <= 1 ? 1 : _r(a / s, 0, 1)
|
3238
|
+
});
|
3256
3239
|
}
|
3257
3240
|
} ]), e;
|
3258
3241
|
}();
|
3259
3242
|
|
3260
|
-
function
|
3243
|
+
function _r(e, t, n) {
|
3261
3244
|
return Math.max(t, Math.min(e, n));
|
3262
3245
|
}
|
3263
3246
|
|
3264
|
-
var
|
3247
|
+
var mr = {
|
3265
3248
|
icontains: function(e) {
|
3266
|
-
return !!
|
3249
|
+
return !!P && P.location.href.toLowerCase().indexOf(e.toLowerCase()) > -1;
|
3267
3250
|
},
|
3268
3251
|
regex: function(e) {
|
3269
|
-
return !!
|
3252
|
+
return !!P && ut(P.location.href, e);
|
3270
3253
|
},
|
3271
3254
|
exact: function(e) {
|
3272
|
-
return (null ==
|
3255
|
+
return (null == P ? void 0 : P.location.href) === e;
|
3273
3256
|
}
|
3274
|
-
},
|
3257
|
+
}, yr = function() {
|
3275
3258
|
function e(t) {
|
3276
3259
|
i(this, e), this.instance = t;
|
3277
3260
|
}
|
3278
3261
|
return s(e, [ {
|
3262
|
+
key: "afterDecideResponse",
|
3263
|
+
value: function(e) {
|
3264
|
+
this._decideServerResponse = !!e.surveys, this.loadIfEnabled();
|
3265
|
+
}
|
3266
|
+
}, {
|
3267
|
+
key: "loadIfEnabled",
|
3268
|
+
value: function() {
|
3269
|
+
var e = this, t = null == H ? void 0 : H.extendPostHogWithSurveys;
|
3270
|
+
this.instance.config.disable_surveys || !this._decideServerResponse || t || se(this.instance.requestRouter.endpointFor("assets", "/static/surveys.js"), (function(t) {
|
3271
|
+
if (t) return U.error("Could not load surveys script", t);
|
3272
|
+
H.extendPostHogWithSurveys(e.instance);
|
3273
|
+
}));
|
3274
|
+
}
|
3275
|
+
}, {
|
3279
3276
|
key: "getSurveys",
|
3280
3277
|
value: function(e) {
|
3281
3278
|
var t = this, n = arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
|
3282
3279
|
if (this.instance.config.disable_surveys) return e([]);
|
3283
|
-
var i = this.instance.get_property(
|
3280
|
+
var i = this.instance.get_property(Se);
|
3284
3281
|
if (i && !n) return e(i);
|
3285
3282
|
this.instance._send_request({
|
3286
3283
|
url: this.instance.requestRouter.endpointFor("api", "/api/surveys/?token=".concat(this.instance.config.token)),
|
@@ -3290,7 +3287,7 @@ var _r = {
|
|
3290
3287
|
var i;
|
3291
3288
|
if (200 !== n.statusCode || !n.json) return e([]);
|
3292
3289
|
var r = n.json.surveys || [];
|
3293
|
-
return null === (i = t.instance.persistence) || void 0 === i || i.register(o({},
|
3290
|
+
return null === (i = t.instance.persistence) || void 0 === i || i.register(o({}, Se, r)),
|
3294
3291
|
e(r);
|
3295
3292
|
}
|
3296
3293
|
});
|
@@ -3305,7 +3302,7 @@ var _r = {
|
|
3305
3302
|
})).filter((function(e) {
|
3306
3303
|
var t, n, i, r;
|
3307
3304
|
if (!e.conditions) return !0;
|
3308
|
-
var s = null === (t = e.conditions) || void 0 === t || !t.url ||
|
3305
|
+
var s = null === (t = e.conditions) || void 0 === t || !t.url || mr[null !== (n = null === (i = e.conditions) || void 0 === i ? void 0 : i.urlMatchType) && void 0 !== n ? n : "icontains"](e.conditions.url), o = null === (r = e.conditions) || void 0 === r || !r.selector || (null == A ? void 0 : A.querySelector(e.conditions.selector));
|
3309
3306
|
return s && o;
|
3310
3307
|
})).filter((function(e) {
|
3311
3308
|
if (!e.linked_flag_key && !e.targeting_flag_key) return !0;
|
@@ -3316,35 +3313,56 @@ var _r = {
|
|
3316
3313
|
}), n);
|
3317
3314
|
}
|
3318
3315
|
} ]), e;
|
3319
|
-
}(),
|
3320
|
-
function e() {
|
3321
|
-
var
|
3322
|
-
i(this, e), o(this, "
|
3323
|
-
var
|
3324
|
-
if (
|
3325
|
-
(JSON.parse(
|
3326
|
-
U.info("[RateLimiter] ".concat(e || "events", " is quota limited.")),
|
3316
|
+
}(), br = function() {
|
3317
|
+
function e(t) {
|
3318
|
+
var n, r, s = this;
|
3319
|
+
i(this, e), o(this, "serverLimits", {}), o(this, "lastEventRateLimited", !1), o(this, "checkForLimiting", (function(e) {
|
3320
|
+
var t = e.text;
|
3321
|
+
if (t && t.length) try {
|
3322
|
+
(JSON.parse(t).quota_limited || []).forEach((function(e) {
|
3323
|
+
U.info("[RateLimiter] ".concat(e || "events", " is quota limited.")), s.serverLimits[e] = (new Date).getTime() + 6e4;
|
3327
3324
|
}));
|
3328
3325
|
} catch (e) {
|
3329
3326
|
return void U.warn('[RateLimiter] could not rate limit - continuing. Error: "'.concat(null == e ? void 0 : e.message, '"'), {
|
3330
|
-
text:
|
3327
|
+
text: t
|
3331
3328
|
});
|
3332
3329
|
}
|
3333
|
-
}))
|
3330
|
+
})), this.instance = t, this.captureEventsPerSecond = (null === (n = t.config.rate_limiting) || void 0 === n ? void 0 : n.events_per_second) || 10,
|
3331
|
+
this.captureEventsBurstLimit = Math.max((null === (r = t.config.rate_limiting) || void 0 === r ? void 0 : r.events_burst_limit) || 10 * this.captureEventsPerSecond, this.captureEventsPerSecond),
|
3332
|
+
this.lastEventRateLimited = this.clientRateLimitContext(!0).isRateLimited;
|
3334
3333
|
}
|
3335
3334
|
return s(e, [ {
|
3336
|
-
key: "
|
3335
|
+
key: "clientRateLimitContext",
|
3336
|
+
value: function() {
|
3337
|
+
var e, t, n, i = arguments.length > 0 && void 0 !== arguments[0] && arguments[0], r = (new Date).getTime(), s = null !== (e = null === (t = this.instance.persistence) || void 0 === t ? void 0 : t.get_property(xe)) && void 0 !== e ? e : {
|
3338
|
+
tokens: this.captureEventsBurstLimit,
|
3339
|
+
last: r
|
3340
|
+
};
|
3341
|
+
s.tokens += (r - s.last) / 1e3 * this.captureEventsPerSecond, s.last = r, s.tokens > this.captureEventsBurstLimit && (s.tokens = this.captureEventsBurstLimit);
|
3342
|
+
var o = s.tokens < 1;
|
3343
|
+
return o || i || (s.tokens = Math.max(0, s.tokens - 1)), !o || this.lastEventRateLimited || i || this.instance.capture("$$client_ingestion_warning", {
|
3344
|
+
$$client_ingestion_warning_message: "posthog-js client rate limited. Config is set to ".concat(this.captureEventsPerSecond, " events per second and ").concat(this.captureEventsBurstLimit, " events burst limit.")
|
3345
|
+
}, {
|
3346
|
+
skip_client_rate_limiting: !0
|
3347
|
+
}), this.lastEventRateLimited = o, null === (n = this.instance.persistence) || void 0 === n || n.set_property(xe, s),
|
3348
|
+
{
|
3349
|
+
isRateLimited: o,
|
3350
|
+
remainingTokens: s.tokens
|
3351
|
+
};
|
3352
|
+
}
|
3353
|
+
}, {
|
3354
|
+
key: "isServerRateLimited",
|
3337
3355
|
value: function(e) {
|
3338
|
-
var t = this.
|
3356
|
+
var t = this.serverLimits[e || "events"] || !1;
|
3339
3357
|
return !1 !== t && (new Date).getTime() < t;
|
3340
3358
|
}
|
3341
3359
|
} ]), e;
|
3342
|
-
}(),
|
3360
|
+
}(), kr = function() {
|
3343
3361
|
return t({
|
3344
|
-
initialPathName: (null ==
|
3345
|
-
referringDomain:
|
3346
|
-
},
|
3347
|
-
},
|
3362
|
+
initialPathName: (null == q ? void 0 : q.pathname) || "",
|
3363
|
+
referringDomain: cn.referringDomain()
|
3364
|
+
}, cn.campaignParams());
|
3365
|
+
}, wr = function() {
|
3348
3366
|
function e(t, n, r) {
|
3349
3367
|
var s = this;
|
3350
3368
|
i(this, e), o(this, "_onSessionIdCallback", (function(e) {
|
@@ -3354,15 +3372,15 @@ var _r = {
|
|
3354
3372
|
sessionId: e,
|
3355
3373
|
props: s._sessionSourceParamGenerator()
|
3356
3374
|
};
|
3357
|
-
s._persistence.register(o({},
|
3375
|
+
s._persistence.register(o({}, Re, n));
|
3358
3376
|
}
|
3359
|
-
})), this._sessionIdManager = t, this._persistence = n, this._sessionSourceParamGenerator = r ||
|
3377
|
+
})), this._sessionIdManager = t, this._persistence = n, this._sessionSourceParamGenerator = r || kr,
|
3360
3378
|
this._sessionIdManager.onSessionId(this._onSessionIdCallback);
|
3361
3379
|
}
|
3362
3380
|
return s(e, [ {
|
3363
3381
|
key: "_getStoredProps",
|
3364
3382
|
value: function() {
|
3365
|
-
return this._persistence.props[
|
3383
|
+
return this._persistence.props[Re];
|
3366
3384
|
}
|
3367
3385
|
}, {
|
3368
3386
|
key: "getSessionProps",
|
@@ -3379,14 +3397,194 @@ var _r = {
|
|
3379
3397
|
} : {};
|
3380
3398
|
}
|
3381
3399
|
} ]), e;
|
3382
|
-
}(),
|
3400
|
+
}(), Sr = [ "ahrefsbot", "ahrefssiteaudit", "applebot", "baiduspider", "bingbot", "bingpreview", "bot.htm", "bot.php", "crawler", "deepscan", "duckduckbot", "facebookexternal", "facebookcatalog", "gptbot", "http://yandex.com/bots", "hubspot", "ia_archiver", "linkedinbot", "mj12bot", "msnbot", "nessus", "petalbot", "pinterest", "prerender", "rogerbot", "screaming frog", "semrushbot", "sitebulb", "slurp", "turnitin", "twitterbot", "vercelbot", "yahoo! slurp", "yandexbot", "adsbot-google", "apis-google", "duplexweb-google", "feedfetcher-google", "google favicon", "google web preview", "google-read-aloud", "googlebot", "googleweblight", "mediapartners-google", "storebot-google", "Bytespider;" ], Fr = function(e, t) {
|
3383
3401
|
if (!e) return !1;
|
3384
3402
|
var n = e.toLowerCase();
|
3385
|
-
return
|
3403
|
+
return Sr.concat(t || []).some((function(e) {
|
3386
3404
|
var t = e.toLowerCase();
|
3387
3405
|
return -1 !== n.indexOf(t);
|
3388
3406
|
}));
|
3389
|
-
},
|
3407
|
+
}, Er = function() {
|
3408
|
+
function e() {
|
3409
|
+
i(this, e), this.clicks = [];
|
3410
|
+
}
|
3411
|
+
return s(e, [ {
|
3412
|
+
key: "isRageClick",
|
3413
|
+
value: function(e, t, n) {
|
3414
|
+
var i = this.clicks[this.clicks.length - 1];
|
3415
|
+
if (i && Math.abs(e - i.x) + Math.abs(t - i.y) < 30 && n - i.timestamp < 1e3) {
|
3416
|
+
if (this.clicks.push({
|
3417
|
+
x: e,
|
3418
|
+
y: t,
|
3419
|
+
timestamp: n
|
3420
|
+
}), 3 === this.clicks.length) return !0;
|
3421
|
+
} else this.clicks = [ {
|
3422
|
+
x: e,
|
3423
|
+
y: t,
|
3424
|
+
timestamp: n
|
3425
|
+
} ];
|
3426
|
+
return !1;
|
3427
|
+
}
|
3428
|
+
} ]), e;
|
3429
|
+
}();
|
3430
|
+
|
3431
|
+
function Rr(e) {
|
3432
|
+
var t;
|
3433
|
+
return e.id === Te || !(null === (t = e.closest) || void 0 === t || !t.call(e, "#" + Te));
|
3434
|
+
}
|
3435
|
+
|
3436
|
+
var xr = function() {
|
3437
|
+
function e(t) {
|
3438
|
+
var n;
|
3439
|
+
i(this, e), o(this, "rageclicks", new Er), o(this, "_enabledServerSide", !1), o(this, "_initialized", !1),
|
3440
|
+
this.instance = t, this._enabledServerSide = !(null === (n = this.instance.persistence) || void 0 === n || !n.props[ce]);
|
3441
|
+
}
|
3442
|
+
return s(e, [ {
|
3443
|
+
key: "startIfEnabled",
|
3444
|
+
value: function() {
|
3445
|
+
this.isEnabled && !this._initialized && (U.info("[heatmaps] Heatmaps enabled, starting..."),
|
3446
|
+
this._setupListeners());
|
3447
|
+
}
|
3448
|
+
}, {
|
3449
|
+
key: "isEnabled",
|
3450
|
+
get: function() {
|
3451
|
+
return w(this.instance.config.enable_heatmaps) ? this._enabledServerSide : this.instance.config.enable_heatmaps;
|
3452
|
+
}
|
3453
|
+
}, {
|
3454
|
+
key: "afterDecideResponse",
|
3455
|
+
value: function(e) {
|
3456
|
+
var t = !!e.heatmaps;
|
3457
|
+
this.instance.persistence && this.instance.persistence.register(o({}, ce, t)), this._enabledServerSide = t,
|
3458
|
+
this.startIfEnabled();
|
3459
|
+
}
|
3460
|
+
}, {
|
3461
|
+
key: "getAndClearBuffer",
|
3462
|
+
value: function() {
|
3463
|
+
var e = this.buffer;
|
3464
|
+
return this.buffer = void 0, e;
|
3465
|
+
}
|
3466
|
+
}, {
|
3467
|
+
key: "_setupListeners",
|
3468
|
+
value: function() {
|
3469
|
+
var e = this;
|
3470
|
+
P && A && (re(A, "click", (function(t) {
|
3471
|
+
return e._onClick(t || (null == P ? void 0 : P.event));
|
3472
|
+
}), !1, !0), re(A, "mousemove", (function(t) {
|
3473
|
+
return e._onMouseMove(t || (null == P ? void 0 : P.event));
|
3474
|
+
}), !1, !0), this._initialized = !0);
|
3475
|
+
}
|
3476
|
+
}, {
|
3477
|
+
key: "_getProperties",
|
3478
|
+
value: function(e, t) {
|
3479
|
+
var n = this.instance.scrollManager.scrollY(), i = this.instance.scrollManager.scrollX(), r = this.instance.scrollManager.scrollElement(), s = function(e, t, n) {
|
3480
|
+
for (var i = e; i && !wn(i, "body"); ) {
|
3481
|
+
if (i === n) return !1;
|
3482
|
+
if (J(t, null == P ? void 0 : P.getComputedStyle(i).position)) return !0;
|
3483
|
+
i = Rn(i);
|
3484
|
+
}
|
3485
|
+
return !1;
|
3486
|
+
}(e.target, [ "fixed", "sticky" ], r);
|
3487
|
+
return {
|
3488
|
+
x: e.clientX + (s ? 0 : i),
|
3489
|
+
y: e.clientY + (s ? 0 : n),
|
3490
|
+
target_fixed: s,
|
3491
|
+
type: t
|
3492
|
+
};
|
3493
|
+
}
|
3494
|
+
}, {
|
3495
|
+
key: "_onClick",
|
3496
|
+
value: function(e) {
|
3497
|
+
var n;
|
3498
|
+
if (!Rr(e.target)) {
|
3499
|
+
var i = this._getProperties(e, "click");
|
3500
|
+
null !== (n = this.rageclicks) && void 0 !== n && n.isRageClick(e.clientX, e.clientY, (new Date).getTime()) && this._capture(t(t({}, i), {}, {
|
3501
|
+
type: "rageclick"
|
3502
|
+
})), this._capture(i);
|
3503
|
+
}
|
3504
|
+
}
|
3505
|
+
}, {
|
3506
|
+
key: "_onMouseMove",
|
3507
|
+
value: function(e) {
|
3508
|
+
var t = this;
|
3509
|
+
Rr(e.target) || (clearTimeout(this._mouseMoveTimeout), this._mouseMoveTimeout = setTimeout((function() {
|
3510
|
+
t._capture(t._getProperties(e, "mousemove"));
|
3511
|
+
}), 500));
|
3512
|
+
}
|
3513
|
+
}, {
|
3514
|
+
key: "_capture",
|
3515
|
+
value: function(e) {
|
3516
|
+
if (P) {
|
3517
|
+
var t = P.location.href;
|
3518
|
+
this.buffer = this.buffer || {}, this.buffer[t] || (this.buffer[t] = []), this.buffer[t].push(e);
|
3519
|
+
}
|
3520
|
+
}
|
3521
|
+
} ]), e;
|
3522
|
+
}(), Ir = function() {
|
3523
|
+
function e(t) {
|
3524
|
+
var n = this;
|
3525
|
+
i(this, e), o(this, "_updateScrollData", (function() {
|
3526
|
+
var e, t, i, r;
|
3527
|
+
n.context || (n.context = {});
|
3528
|
+
var s = n.scrollElement(), o = n.scrollY(), a = s ? Math.max(0, s.scrollHeight - s.clientHeight) : 0, u = o + ((null == s ? void 0 : s.clientHeight) || 0), l = (null == s ? void 0 : s.scrollHeight) || 0;
|
3529
|
+
n.context.lastScrollY = Math.ceil(o), n.context.maxScrollY = Math.max(o, null !== (e = n.context.maxScrollY) && void 0 !== e ? e : 0),
|
3530
|
+
n.context.maxScrollHeight = Math.max(a, null !== (t = n.context.maxScrollHeight) && void 0 !== t ? t : 0),
|
3531
|
+
n.context.lastContentY = u, n.context.maxContentY = Math.max(u, null !== (i = n.context.maxContentY) && void 0 !== i ? i : 0),
|
3532
|
+
n.context.maxContentHeight = Math.max(l, null !== (r = n.context.maxContentHeight) && void 0 !== r ? r : 0);
|
3533
|
+
})), this.instance = t;
|
3534
|
+
}
|
3535
|
+
return s(e, [ {
|
3536
|
+
key: "getContext",
|
3537
|
+
value: function() {
|
3538
|
+
return this.context;
|
3539
|
+
}
|
3540
|
+
}, {
|
3541
|
+
key: "resetContext",
|
3542
|
+
value: function() {
|
3543
|
+
var e = this.context;
|
3544
|
+
return setTimeout(this._updateScrollData, 0), e;
|
3545
|
+
}
|
3546
|
+
}, {
|
3547
|
+
key: "startMeasuringScrollPosition",
|
3548
|
+
value: function() {
|
3549
|
+
null == P || P.addEventListener("scroll", this._updateScrollData, !0), null == P || P.addEventListener("scrollend", this._updateScrollData, !0),
|
3550
|
+
null == P || P.addEventListener("resize", this._updateScrollData);
|
3551
|
+
}
|
3552
|
+
}, {
|
3553
|
+
key: "scrollElement",
|
3554
|
+
value: function() {
|
3555
|
+
if (!this.instance.config.scroll_root_selector) return null == P ? void 0 : P.document.documentElement;
|
3556
|
+
var e, t = h(m(this.instance.config.scroll_root_selector) ? this.instance.config.scroll_root_selector : [ this.instance.config.scroll_root_selector ]);
|
3557
|
+
try {
|
3558
|
+
for (t.s(); !(e = t.n()).done; ) {
|
3559
|
+
var n = e.value, i = null == P ? void 0 : P.document.querySelector(n);
|
3560
|
+
if (i) return i;
|
3561
|
+
}
|
3562
|
+
} catch (e) {
|
3563
|
+
t.e(e);
|
3564
|
+
} finally {
|
3565
|
+
t.f();
|
3566
|
+
}
|
3567
|
+
}
|
3568
|
+
}, {
|
3569
|
+
key: "scrollY",
|
3570
|
+
value: function() {
|
3571
|
+
if (this.instance.config.scroll_root_selector) {
|
3572
|
+
var e = this.scrollElement();
|
3573
|
+
return e && e.scrollTop || 0;
|
3574
|
+
}
|
3575
|
+
return P && (P.scrollY || P.pageYOffset || P.document.documentElement.scrollTop) || 0;
|
3576
|
+
}
|
3577
|
+
}, {
|
3578
|
+
key: "scrollX",
|
3579
|
+
value: function() {
|
3580
|
+
if (this.instance.config.scroll_root_selector) {
|
3581
|
+
var e = this.scrollElement();
|
3582
|
+
return e && e.scrollLeft || 0;
|
3583
|
+
}
|
3584
|
+
return P && (P.scrollX || P.pageXOffset || P.document.documentElement.scrollLeft) || 0;
|
3585
|
+
}
|
3586
|
+
} ]), e;
|
3587
|
+
}(), Pr = function() {
|
3390
3588
|
function e() {
|
3391
3589
|
i(this, e), o(this, "events", {}), this.events = {};
|
3392
3590
|
}
|
@@ -3425,38 +3623,16 @@ var _r = {
|
|
3425
3623
|
}
|
3426
3624
|
}
|
3427
3625
|
} ]), e;
|
3428
|
-
}(),
|
3429
|
-
function e() {
|
3430
|
-
i(this, e), this.clicks = [];
|
3431
|
-
}
|
3432
|
-
return s(e, [ {
|
3433
|
-
key: "isRageClick",
|
3434
|
-
value: function(e, t, n) {
|
3435
|
-
var i = this.clicks[this.clicks.length - 1];
|
3436
|
-
if (i && Math.abs(e - i.x) + Math.abs(t - i.y) < 30 && n - i.timestamp < 1e3) {
|
3437
|
-
if (this.clicks.push({
|
3438
|
-
x: e,
|
3439
|
-
y: t,
|
3440
|
-
timestamp: n
|
3441
|
-
}), 3 === this.clicks.length) return !0;
|
3442
|
-
} else this.clicks = [ {
|
3443
|
-
x: e,
|
3444
|
-
y: t,
|
3445
|
-
timestamp: n
|
3446
|
-
} ];
|
3447
|
-
return !1;
|
3448
|
-
}
|
3449
|
-
} ]), e;
|
3450
|
-
}(), Pr = "$copy_autocapture";
|
3626
|
+
}(), Cr = "$copy_autocapture";
|
3451
3627
|
|
3452
|
-
function
|
3628
|
+
function Tr(e, t) {
|
3453
3629
|
return t.length > e ? t.slice(0, e) + "..." : t;
|
3454
3630
|
}
|
3455
3631
|
|
3456
|
-
var
|
3632
|
+
var $r = function() {
|
3457
3633
|
function e(t) {
|
3458
3634
|
i(this, e), o(this, "_initialized", !1), o(this, "_isDisabledServerSide", null),
|
3459
|
-
o(this, "rageclicks", new
|
3635
|
+
o(this, "rageclicks", new Er), o(this, "_elementsChainAsString", !1), this.instance = t;
|
3460
3636
|
}
|
3461
3637
|
return s(e, [ {
|
3462
3638
|
key: "config",
|
@@ -3471,34 +3647,41 @@ var Er = function() {
|
|
3471
3647
|
value: function() {
|
3472
3648
|
var e = this;
|
3473
3649
|
if (this.isBrowserSupported()) {
|
3474
|
-
if (
|
3650
|
+
if (P && A) {
|
3475
3651
|
var t = function(t) {
|
3476
|
-
t = t || (null ==
|
3652
|
+
t = t || (null == P ? void 0 : P.event);
|
3477
3653
|
try {
|
3478
3654
|
e._captureEvent(t);
|
3479
3655
|
} catch (e) {
|
3480
3656
|
U.error("Failed to capture event", e);
|
3481
3657
|
}
|
3482
3658
|
}, n = function(t) {
|
3483
|
-
t = t || (null ==
|
3659
|
+
t = t || (null == P ? void 0 : P.event), e._captureEvent(t, Cr);
|
3484
3660
|
};
|
3485
|
-
re(
|
3486
|
-
this.config.capture_copied_text && (re(
|
3661
|
+
re(A, "submit", t, !1, !0), re(A, "change", t, !1, !0), re(A, "click", t, !1, !0),
|
3662
|
+
this.config.capture_copied_text && (re(A, "copy", n, !1, !0), re(A, "cut", n, !1, !0));
|
3487
3663
|
}
|
3488
3664
|
} else U.info("Disabling Automatic Event Collection because this browser is not supported");
|
3489
3665
|
}
|
3666
|
+
}, {
|
3667
|
+
key: "startIfEnabled",
|
3668
|
+
value: function() {
|
3669
|
+
this.isEnabled && !this._initialized && (this._addDomEventHandlers(), this._initialized = !0);
|
3670
|
+
}
|
3490
3671
|
}, {
|
3491
3672
|
key: "afterDecideResponse",
|
3492
3673
|
value: function(e) {
|
3493
|
-
|
3494
|
-
this.
|
3495
|
-
this.
|
3674
|
+
e.elementsChainAsString && (this._elementsChainAsString = e.elementsChainAsString),
|
3675
|
+
this.instance.persistence && this.instance.persistence.register(o({}, le, !!e.autocapture_opt_out)),
|
3676
|
+
this._isDisabledServerSide = !!e.autocapture_opt_out, this.startIfEnabled();
|
3496
3677
|
}
|
3497
3678
|
}, {
|
3498
3679
|
key: "isEnabled",
|
3499
3680
|
get: function() {
|
3500
|
-
var e, t =
|
3501
|
-
|
3681
|
+
var e, t, n = null === (e = this.instance.persistence) || void 0 === e ? void 0 : e.props[le], i = this._isDisabledServerSide;
|
3682
|
+
if (F(i) && !x(n) && !this.instance.config.advanced_disable_decide) return !1;
|
3683
|
+
var r = null !== (t = this._isDisabledServerSide) && void 0 !== t ? t : !!n;
|
3684
|
+
return !!this.instance.config.autocapture && !r;
|
3502
3685
|
}
|
3503
3686
|
}, {
|
3504
3687
|
key: "_previousElementSibling",
|
@@ -3507,18 +3690,18 @@ var Er = function() {
|
|
3507
3690
|
var t = e;
|
3508
3691
|
do {
|
3509
3692
|
t = t.previousSibling;
|
3510
|
-
} while (t && !
|
3693
|
+
} while (t && !kn(t));
|
3511
3694
|
return t;
|
3512
3695
|
}
|
3513
3696
|
}, {
|
3514
3697
|
key: "_getAugmentPropertiesFromElement",
|
3515
3698
|
value: function(e) {
|
3516
|
-
if (!
|
3699
|
+
if (!In(e)) return {};
|
3517
3700
|
var t = {};
|
3518
|
-
return
|
3701
|
+
return V(e.attributes, (function(e) {
|
3519
3702
|
if (e.name && 0 === e.name.indexOf("data-ph-capture-attribute")) {
|
3520
3703
|
var n = e.name.replace("data-ph-capture-attribute-", ""), i = e.value;
|
3521
|
-
n && i &&
|
3704
|
+
n && i && qn(i) && (t[n] = i);
|
3522
3705
|
}
|
3523
3706
|
})), t;
|
3524
3707
|
}
|
@@ -3528,18 +3711,18 @@ var Er = function() {
|
|
3528
3711
|
var i, r = e.tagName.toLowerCase(), s = {
|
3529
3712
|
tag_name: r
|
3530
3713
|
};
|
3531
|
-
|
3532
|
-
var o =
|
3714
|
+
En.indexOf(r) > -1 && !n && ("a" === r.toLowerCase() || "button" === r.toLowerCase() ? s.$el_text = Tr(1024, Ln(e)) : s.$el_text = Tr(1024, bn(e)));
|
3715
|
+
var o = mn(e);
|
3533
3716
|
o.length > 0 && (s.classes = o.filter((function(e) {
|
3534
3717
|
return "" !== e;
|
3535
3718
|
})));
|
3536
3719
|
var a = null === (i = this.config) || void 0 === i ? void 0 : i.element_attribute_ignorelist;
|
3537
|
-
|
3720
|
+
V(e.attributes, (function(n) {
|
3538
3721
|
var i;
|
3539
|
-
if ((!
|
3722
|
+
if ((!Pn(e) || -1 !== [ "name", "id", "class", "aria-label" ].indexOf(n.name)) && ((null == a || !a.includes(n.name)) && !t && qn(n.value) && (i = n.name,
|
3540
3723
|
!S(i) || "_ngcontent" !== i.substring(0, 10) && "_nghost" !== i.substring(0, 7)))) {
|
3541
3724
|
var r = n.value;
|
3542
|
-
"class" === n.name && (r =
|
3725
|
+
"class" === n.name && (r = _n(r).join(" ")), s["attr__" + n.name] = Tr(1024, r);
|
3543
3726
|
}
|
3544
3727
|
}));
|
3545
3728
|
for (var u = 1, l = 1, c = e; c = this._previousElementSibling(c); ) u++, c.tagName === e.tagName && l++;
|
@@ -3562,73 +3745,73 @@ var Er = function() {
|
|
3562
3745
|
}, {
|
3563
3746
|
key: "_captureEvent",
|
3564
3747
|
value: function(e) {
|
3565
|
-
var t
|
3566
|
-
|
3567
|
-
|
3568
|
-
|
3569
|
-
|
3570
|
-
|
3571
|
-
|
3572
|
-
|
3573
|
-
var
|
3574
|
-
|
3575
|
-
|
3576
|
-
|
3577
|
-
|
3578
|
-
|
3579
|
-
|
3580
|
-
|
3581
|
-
|
3582
|
-
|
3583
|
-
|
3584
|
-
|
3585
|
-
|
3586
|
-
|
3587
|
-
|
3588
|
-
|
3589
|
-
if (
|
3590
|
-
|
3748
|
+
var t = this, n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "$autocapture";
|
3749
|
+
if (this.isEnabled) {
|
3750
|
+
var i, r = this._getEventTarget(e);
|
3751
|
+
if (Sn(r) && (r = r.parentNode || null), "$autocapture" === n && "click" === e.type && e instanceof MouseEvent) this.instance.config.rageclick && null !== (i = this.rageclicks) && void 0 !== i && i.isRageClick(e.clientX, e.clientY, (new Date).getTime()) && this._captureEvent(e, "$rageclick");
|
3752
|
+
var s = n === Cr;
|
3753
|
+
if (r && xn(r, e, this.config, s, s ? [ "copy", "cut" ] : void 0)) {
|
3754
|
+
for (var o, a, u = [ r ], l = r; l.parentNode && !wn(l, "body"); ) Fn(l.parentNode) ? (u.push(l.parentNode.host),
|
3755
|
+
l = l.parentNode.host) : (u.push(l.parentNode), l = l.parentNode);
|
3756
|
+
var c, d = [], h = {}, f = !1;
|
3757
|
+
if (V(u, (function(e) {
|
3758
|
+
var n = In(e);
|
3759
|
+
"a" === e.tagName.toLowerCase() && (c = e.getAttribute("href"), c = n && qn(c) && c),
|
3760
|
+
J(mn(e), "ph-no-capture") && (f = !0), d.push(t._getPropertiesFromElement(e, t.instance.config.mask_all_element_attributes, t.instance.config.mask_all_text));
|
3761
|
+
var i = t._getAugmentPropertiesFromElement(e);
|
3762
|
+
Q(h, i);
|
3763
|
+
})), this.instance.config.mask_all_text || ("a" === r.tagName.toLowerCase() || "button" === r.tagName.toLowerCase() ? d[0].$el_text = Ln(r) : d[0].$el_text = bn(r)),
|
3764
|
+
c && (d[0].attr__href = c), f) return !1;
|
3765
|
+
var p = Q(this._getDefaultProperties(e.type), this._elementsChainAsString ? {
|
3766
|
+
$elements_chain: Nn(d)
|
3767
|
+
} : {
|
3768
|
+
$elements: d
|
3769
|
+
}, null !== (o = d[0]) && void 0 !== o && o.$el_text ? {
|
3770
|
+
$el_text: null === (a = d[0]) || void 0 === a ? void 0 : a.$el_text
|
3771
|
+
} : {}, h);
|
3772
|
+
if (n === Cr) {
|
3773
|
+
var v, g = yn(null == P || null === (v = P.getSelection()) || void 0 === v ? void 0 : v.toString()), _ = e.type || "clipboard";
|
3774
|
+
if (!g) return !1;
|
3775
|
+
p.$selected_content = g, p.$copy_type = _;
|
3776
|
+
}
|
3777
|
+
return this.instance.capture(n, p), !0;
|
3591
3778
|
}
|
3592
|
-
return this.instance.capture(i, p), !0;
|
3593
3779
|
}
|
3594
3780
|
}
|
3595
3781
|
}, {
|
3596
3782
|
key: "isBrowserSupported",
|
3597
3783
|
value: function() {
|
3598
|
-
return y(null ==
|
3784
|
+
return y(null == A ? void 0 : A.querySelectorAll);
|
3599
3785
|
}
|
3600
3786
|
} ]), e;
|
3601
|
-
}(),
|
3787
|
+
}(), Or = {}, Mr = function() {}, Ar = "posthog", qr = !tr && -1 === (null == B ? void 0 : B.indexOf("MSIE")) && -1 === (null == B ? void 0 : B.indexOf("Mozilla")), Lr = function() {
|
3602
3788
|
var e, t, n;
|
3603
3789
|
return {
|
3604
3790
|
api_host: "https://us.i.posthog.com",
|
3605
|
-
api_transport: "XHR",
|
3606
3791
|
ui_host: null,
|
3607
3792
|
token: "",
|
3608
3793
|
autocapture: !0,
|
3609
3794
|
rageclick: !0,
|
3610
|
-
cross_subdomain_cookie: (t = null ==
|
3795
|
+
cross_subdomain_cookie: (t = null == A ? void 0 : A.location, n = null == t ? void 0 : t.hostname,
|
3611
3796
|
!!S(n) && "herokuapp.com" !== n.split(".").slice(-2).join(".")),
|
3612
3797
|
persistence: "localStorage+cookie",
|
3613
3798
|
persistence_name: "",
|
3614
|
-
|
3615
|
-
loaded: Cr,
|
3799
|
+
loaded: Mr,
|
3616
3800
|
store_google: !0,
|
3617
3801
|
custom_campaign_params: [],
|
3618
3802
|
custom_blocked_useragents: [],
|
3619
3803
|
save_referrer: !0,
|
3620
3804
|
capture_pageview: !0,
|
3621
|
-
capture_pageleave:
|
3622
|
-
debug:
|
3805
|
+
capture_pageleave: "if_capture_pageview",
|
3806
|
+
debug: q && S(null == q ? void 0 : q.search) && -1 !== q.search.indexOf("__posthog_debug=true") || !1,
|
3623
3807
|
verbose: !1,
|
3624
3808
|
cookie_expiration: 365,
|
3625
3809
|
upgrade: !1,
|
3626
3810
|
disable_session_recording: !1,
|
3627
3811
|
disable_persistence: !1,
|
3628
|
-
disable_cookie: !1,
|
3629
3812
|
disable_surveys: !1,
|
3630
3813
|
enable_recording_console_log: void 0,
|
3631
|
-
secure_cookie: "https:" === (null ==
|
3814
|
+
secure_cookie: "https:" === (null == P || null === (e = P.location) || void 0 === e ? void 0 : e.protocol),
|
3632
3815
|
ip: !0,
|
3633
3816
|
opt_out_capturing_by_default: !1,
|
3634
3817
|
opt_out_persistence_by_default: !1,
|
@@ -3636,7 +3819,6 @@ var Er = function() {
|
|
3636
3819
|
opt_out_capturing_persistence_type: "localStorage",
|
3637
3820
|
opt_out_capturing_cookie_prefix: null,
|
3638
3821
|
opt_in_site_apps: !1,
|
3639
|
-
property_blacklist: [],
|
3640
3822
|
property_denylist: [],
|
3641
3823
|
respect_dnt: !1,
|
3642
3824
|
sanitize_properties: null,
|
@@ -3660,15 +3842,22 @@ var Er = function() {
|
|
3660
3842
|
get_device_id: function(e) {
|
3661
3843
|
return e;
|
3662
3844
|
},
|
3663
|
-
_onCapture:
|
3845
|
+
_onCapture: Mr,
|
3664
3846
|
capture_performance: void 0,
|
3665
3847
|
name: "posthog",
|
3666
3848
|
bootstrap: {},
|
3667
3849
|
disable_compression: !1,
|
3668
3850
|
session_idle_timeout_seconds: 1800,
|
3669
|
-
|
3851
|
+
person_profiles: "always"
|
3670
3852
|
};
|
3671
|
-
},
|
3853
|
+
}, Dr = function(e) {
|
3854
|
+
var t = {};
|
3855
|
+
w(e.process_person) || (t.person_profiles = e.process_person), w(e.xhr_headers) || (t.request_headers = e.xhr_headers),
|
3856
|
+
w(e.cookie_name) || (t.persistence_name = e.cookie_name), w(e.disable_cookie) || (t.disable_persistence = e.disable_cookie);
|
3857
|
+
var n = Q({}, t, e);
|
3858
|
+
return m(e.property_blacklist) && (w(e.property_denylist) ? n.property_denylist = e.property_blacklist : m(e.property_denylist) ? n.property_denylist = [].concat(l(e.property_blacklist), l(e.property_denylist)) : U.error("Invalid value for property_denylist config: " + e.property_denylist)),
|
3859
|
+
n;
|
3860
|
+
}, Nr = function() {
|
3672
3861
|
function e() {
|
3673
3862
|
i(this, e), o(this, "__forceAllowLocalhost", !1);
|
3674
3863
|
}
|
@@ -3682,49 +3871,15 @@ var Er = function() {
|
|
3682
3871
|
this.__forceAllowLocalhost = e;
|
3683
3872
|
}
|
3684
3873
|
} ]), e;
|
3685
|
-
}(),
|
3874
|
+
}(), Br = function() {
|
3686
3875
|
function e() {
|
3687
3876
|
var t = this;
|
3688
|
-
i(this, e), o(this, "webPerformance", new
|
3689
|
-
this.config =
|
3690
|
-
this.
|
3691
|
-
|
3692
|
-
|
3693
|
-
|
3694
|
-
t.event.userId || t.event.anonymousId === e.get_distinct_id() || e.reset(), t.event.userId && t.event.userId !== e.get_distinct_id() && (e.register({
|
3695
|
-
distinct_id: t.event.userId
|
3696
|
-
}), e.reloadFeatureFlags());
|
3697
|
-
var i = e._calculate_event_properties(n, t.event.properties);
|
3698
|
-
return t.event.properties = Object.assign({}, i, t.event.properties), t;
|
3699
|
-
};
|
3700
|
-
return {
|
3701
|
-
name: "PostHog JS",
|
3702
|
-
type: "enrichment",
|
3703
|
-
version: "1.0.0",
|
3704
|
-
isLoaded: function() {
|
3705
|
-
return !0;
|
3706
|
-
},
|
3707
|
-
load: function() {
|
3708
|
-
return Promise.resolve();
|
3709
|
-
},
|
3710
|
-
track: function(e) {
|
3711
|
-
return t(e, e.event.event);
|
3712
|
-
},
|
3713
|
-
page: function(e) {
|
3714
|
-
return t(e, "$pageview");
|
3715
|
-
},
|
3716
|
-
identify: function(e) {
|
3717
|
-
return t(e, "$identify");
|
3718
|
-
},
|
3719
|
-
screen: function(e) {
|
3720
|
-
return t(e, "$screen");
|
3721
|
-
}
|
3722
|
-
};
|
3723
|
-
}(t);
|
3724
|
-
}, this.__request_queue = [], this.__loaded = !1, this.analyticsDefaultEndpoint = "/e/",
|
3725
|
-
this.featureFlags = new Oe(this), this.toolbar = new gi(this), this.pageViewManager = new gr(this),
|
3726
|
-
this.surveys = new mr(this), this.rateLimiter = new yr, this.requestRouter = new fr(this),
|
3727
|
-
this.people = {
|
3877
|
+
i(this, e), o(this, "webPerformance", new Nr), o(this, "_debugEventEmitter", new Pr),
|
3878
|
+
this.config = Lr(), this.decideEndpointWasHit = !1, this.SentryIntegration = pr,
|
3879
|
+
this.__request_queue = [], this.__loaded = !1, this.analyticsDefaultEndpoint = "/e/",
|
3880
|
+
this.featureFlags = new Le(this), this.toolbar = new mi(this), this.scrollManager = new Ir(this),
|
3881
|
+
this.pageViewManager = new gr(this), this.surveys = new yr(this), this.rateLimiter = new br(this),
|
3882
|
+
this.requestRouter = new fr(this), this.people = {
|
3728
3883
|
set: function(e, n, i) {
|
3729
3884
|
var r = S(e) ? o({}, e, n) : e;
|
3730
3885
|
t.setPersonProperties(r), null == i || i({});
|
@@ -3740,9 +3895,9 @@ var Er = function() {
|
|
3740
3895
|
return s(e, [ {
|
3741
3896
|
key: "init",
|
3742
3897
|
value: function(t, n, i) {
|
3743
|
-
if (i && i !==
|
3744
|
-
var r, s = null !== (r =
|
3745
|
-
return s._init(t, n, i),
|
3898
|
+
if (i && i !== Ar) {
|
3899
|
+
var r, s = null !== (r = Or[i]) && void 0 !== r ? r : new e;
|
3900
|
+
return s._init(t, n, i), Or[i] = s, Or[Ar][i] = s, s;
|
3746
3901
|
}
|
3747
3902
|
return this._init(t, n, i);
|
3748
3903
|
}
|
@@ -3756,26 +3911,22 @@ var Er = function() {
|
|
3756
3911
|
this;
|
3757
3912
|
if (this.__loaded) return U.warn("You have already initialized PostHog! Re-initializing is a no-op"),
|
3758
3913
|
this;
|
3759
|
-
if (this.__loaded = !0, this.config = {}, this._triggered_notifs = [],
|
3760
|
-
this.set_config(Q({}, qr(), s, {
|
3914
|
+
if (this.__loaded = !0, this.config = {}, this._triggered_notifs = [], this.set_config(Q({}, Lr(), Dr(s), {
|
3761
3915
|
name: o,
|
3762
3916
|
token: e
|
3763
|
-
})), this.compression = s.disable_compression ? void 0 : ne.Base64, this.persistence = new
|
3764
|
-
this.sessionPersistence = "sessionStorage" === this.config.persistence ? this.persistence : new
|
3917
|
+
})), this.compression = s.disable_compression ? void 0 : ne.Base64, this.persistence = new hn(this.config),
|
3918
|
+
this.sessionPersistence = "sessionStorage" === this.config.persistence ? this.persistence : new hn(t(t({}, this.config), {}, {
|
3765
3919
|
persistence: "sessionStorage"
|
3766
|
-
})), this._requestQueue = new
|
3767
|
-
return r.
|
3920
|
+
})), this._requestQueue = new yi((function(e) {
|
3921
|
+
return r._send_retriable_request(e);
|
3768
3922
|
})), this._retryQueue = new lr(this), this.__request_queue = [], this.sessionManager = new dr(this.config, this.persistence),
|
3769
|
-
this.sessionPropsManager = new
|
3770
|
-
this.sessionRecording.
|
3771
|
-
this.autocapture = new
|
3772
|
-
|
3773
|
-
|
3774
|
-
|
3775
|
-
|
3776
|
-
}), this.persistence.set_user_state("identified"))), void 0 !== (null === (n = s.bootstrap) || void 0 === n ? void 0 : n.distinctID)) {
|
3777
|
-
var a, u, l = this.config.get_device_id(je()), c = null !== (a = s.bootstrap) && void 0 !== a && a.isIdentifiedID ? l : s.bootstrap.distinctID;
|
3778
|
-
this.persistence.set_user_state(null !== (u = s.bootstrap) && void 0 !== u && u.isIdentifiedID ? "identified" : "anonymous"),
|
3923
|
+
this.sessionPropsManager = new wr(this.sessionManager, this.persistence), this.sessionRecording = new pi(this),
|
3924
|
+
this.sessionRecording.startIfEnabledOrStop(), this.config.disable_scroll_properties || this.scrollManager.startMeasuringScrollPosition(),
|
3925
|
+
this.autocapture = new $r(this), this.autocapture.startIfEnabled(), this.surveys.loadIfEnabled(),
|
3926
|
+
this.heatmaps = new xr(this), this.heatmaps.startIfEnabled(), f.DEBUG = f.DEBUG || this.config.debug,
|
3927
|
+
this._gdpr_init(), void 0 !== (null === (n = s.bootstrap) || void 0 === n ? void 0 : n.distinctID)) {
|
3928
|
+
var a, u, l = this.config.get_device_id(We()), c = null !== (a = s.bootstrap) && void 0 !== a && a.isIdentifiedID ? l : s.bootstrap.distinctID;
|
3929
|
+
this.persistence.set_property(Ee, null !== (u = s.bootstrap) && void 0 !== u && u.isIdentifiedID ? "identified" : "anonymous"),
|
3779
3930
|
this.register({
|
3780
3931
|
distinct_id: s.bootstrap.distinctID,
|
3781
3932
|
$device_id: c
|
@@ -3789,7 +3940,7 @@ var Er = function() {
|
|
3789
3940
|
var n, i;
|
3790
3941
|
return e[t] = (null === (n = s.bootstrap) || void 0 === n || null === (i = n.featureFlags) || void 0 === i ? void 0 : i[t]) || !1,
|
3791
3942
|
e;
|
3792
|
-
}), {}),
|
3943
|
+
}), {}), v = Object.keys((null === (h = s.bootstrap) || void 0 === h ? void 0 : h.featureFlagPayloads) || {}).filter((function(e) {
|
3793
3944
|
return p[e];
|
3794
3945
|
})).reduce((function(e, t) {
|
3795
3946
|
var n, i, r, o;
|
@@ -3798,19 +3949,19 @@ var Er = function() {
|
|
3798
3949
|
}), {});
|
3799
3950
|
this.featureFlags.receivedFeatureFlags({
|
3800
3951
|
featureFlags: p,
|
3801
|
-
featureFlagPayloads:
|
3952
|
+
featureFlagPayloads: v
|
3802
3953
|
});
|
3803
3954
|
}
|
3804
3955
|
if (!this.get_distinct_id()) {
|
3805
|
-
var
|
3956
|
+
var g = this.config.get_device_id(We());
|
3806
3957
|
this.register_once({
|
3807
|
-
distinct_id:
|
3808
|
-
$device_id:
|
3809
|
-
}, ""), this.persistence.
|
3958
|
+
distinct_id: g,
|
3959
|
+
$device_id: g
|
3960
|
+
}, ""), this.persistence.set_property(Ee, "anonymous");
|
3810
3961
|
}
|
3811
|
-
return null ==
|
3812
|
-
this.toolbar.maybeLoadToolbar(), s.segment ?
|
3813
|
-
r._loaded();
|
3962
|
+
return null == P || null === (i = P.addEventListener) || void 0 === i || i.call(P, "onpagehide" in self ? "pagehide" : "unload", this._handle_unload.bind(this)),
|
3963
|
+
this.toolbar.maybeLoadToolbar(), s.segment ? vr(this, (function() {
|
3964
|
+
return r._loaded();
|
3814
3965
|
})) : this._loaded(), y(this.config._onCapture) && this.on("eventCaptured", (function(e) {
|
3815
3966
|
return r.config._onCapture(e.event, e);
|
3816
3967
|
})), this;
|
@@ -3818,9 +3969,12 @@ var Er = function() {
|
|
3818
3969
|
}, {
|
3819
3970
|
key: "_afterDecideResponse",
|
3820
3971
|
value: function(e) {
|
3821
|
-
var t;
|
3822
|
-
this.compression = void 0, e.supportedCompression && !this.config.disable_compression && (this.compression =
|
3823
|
-
null !== (t = e.analytics) && void 0 !== t && t.endpoint && (this.analyticsDefaultEndpoint = e.analytics.endpoint)
|
3972
|
+
var t, n, i, r, s;
|
3973
|
+
this.compression = void 0, e.supportedCompression && !this.config.disable_compression && (this.compression = J(e.supportedCompression, ne.GZipJS) ? ne.GZipJS : J(e.supportedCompression, ne.Base64) ? ne.Base64 : void 0),
|
3974
|
+
null !== (t = e.analytics) && void 0 !== t && t.endpoint && (this.analyticsDefaultEndpoint = e.analytics.endpoint),
|
3975
|
+
null === (n = this.sessionRecording) || void 0 === n || n.afterDecideResponse(e),
|
3976
|
+
null === (i = this.autocapture) || void 0 === i || i.afterDecideResponse(e), null === (r = this.heatmaps) || void 0 === r || r.afterDecideResponse(e),
|
3977
|
+
null === (s = this.surveys) || void 0 === s || s.afterDecideResponse(e);
|
3824
3978
|
}
|
3825
3979
|
}, {
|
3826
3980
|
key: "_loaded",
|
@@ -3833,12 +3987,12 @@ var Er = function() {
|
|
3833
3987
|
U.critical("`loaded` function failed", e);
|
3834
3988
|
}
|
3835
3989
|
this._start_queue_if_opted_in(), this.config.capture_pageview && setTimeout((function() {
|
3836
|
-
|
3837
|
-
title:
|
3990
|
+
A && e.capture("$pageview", {
|
3991
|
+
title: A.title
|
3838
3992
|
}, {
|
3839
3993
|
send_instantly: !0
|
3840
3994
|
});
|
3841
|
-
}), 1), t || (new
|
3995
|
+
}), 1), t || (new vi(this).call(), this.featureFlags.resetRequestQueue());
|
3842
3996
|
}
|
3843
3997
|
}, {
|
3844
3998
|
key: "_start_queue_if_opted_in",
|
@@ -3858,8 +4012,8 @@ var Er = function() {
|
|
3858
4012
|
key: "_handle_unload",
|
3859
4013
|
value: function() {
|
3860
4014
|
var e, t;
|
3861
|
-
this.config.request_batching ? (this.
|
3862
|
-
null === (e = this._requestQueue) || void 0 === e || e.unload(), null === (t = this._retryQueue) || void 0 === t || t.unload()) : this.
|
4015
|
+
this.config.request_batching ? (this._shouldCapturePageleave() && this.capture("$pageleave"),
|
4016
|
+
null === (e = this._requestQueue) || void 0 === e || e.unload(), null === (t = this._retryQueue) || void 0 === t || t.unload()) : this._shouldCapturePageleave() && this.capture("$pageleave", null, {
|
3863
4017
|
transport: "sendBeacon"
|
3864
4018
|
});
|
3865
4019
|
}
|
@@ -3867,17 +4021,24 @@ var Er = function() {
|
|
3867
4021
|
key: "_send_request",
|
3868
4022
|
value: function(e) {
|
3869
4023
|
var n = this;
|
3870
|
-
this.__loaded && (
|
3871
|
-
e.url =
|
4024
|
+
this.__loaded && (qr ? this.__request_queue.push(e) : this.rateLimiter.isServerRateLimited(e.batchKey) || (e.transport = e.transport || this.config.api_transport,
|
4025
|
+
e.url = ir(e.url, {
|
3872
4026
|
ip: this.config.ip ? 1 : 0
|
3873
4027
|
}), e.headers = this.config.request_headers, e.compression = "best-available" === e.compression ? this.compression : e.compression,
|
3874
4028
|
function(e) {
|
3875
|
-
var n = t({}, e);
|
3876
|
-
|
4029
|
+
var n, i, r, s = t({}, e);
|
4030
|
+
s.timeout = s.timeout || 6e4, s.url = ir(s.url, {
|
3877
4031
|
_: (new Date).getTime().toString(),
|
3878
4032
|
ver: f.LIB_VERSION,
|
3879
|
-
compression:
|
3880
|
-
})
|
4033
|
+
compression: s.compression
|
4034
|
+
});
|
4035
|
+
var o = null !== (n = s.transport) && void 0 !== n ? n : "XHR", a = null !== (i = null === (r = function(e, t) {
|
4036
|
+
for (var n = 0; n < e.length; n++) if (t(e[n])) return e[n];
|
4037
|
+
}(or, (function(e) {
|
4038
|
+
return e.transport === o;
|
4039
|
+
}))) || void 0 === r ? void 0 : r.method) && void 0 !== i ? i : or[0].method;
|
4040
|
+
if (!a) throw new Error("No available transport method");
|
4041
|
+
a(s);
|
3881
4042
|
}(t(t({}, e), {}, {
|
3882
4043
|
callback: function(t) {
|
3883
4044
|
var i, r, s;
|
@@ -3902,7 +4063,7 @@ var Er = function() {
|
|
3902
4063
|
z(e, (function(e) {
|
3903
4064
|
if (m(e[0])) {
|
3904
4065
|
var n = t;
|
3905
|
-
|
4066
|
+
V(e, (function(e) {
|
3906
4067
|
n = n[e[0]].apply(n, e.slice(1));
|
3907
4068
|
}));
|
3908
4069
|
} else this[e[0]].apply(this, e.slice(1));
|
@@ -3926,32 +4087,40 @@ var Er = function() {
|
|
3926
4087
|
value: function(e, n, i) {
|
3927
4088
|
var r;
|
3928
4089
|
if (!(this.__loaded && this.persistence && this.sessionPersistence && this._requestQueue)) return U.uninitializedWarning("posthog.capture");
|
3929
|
-
if (!
|
3930
|
-
if (!B || this.config.opt_out_useragent_filter || !
|
3931
|
-
|
3932
|
-
|
3933
|
-
|
3934
|
-
|
3935
|
-
|
3936
|
-
|
3937
|
-
|
3938
|
-
|
3939
|
-
|
3940
|
-
|
3941
|
-
|
3942
|
-
|
3943
|
-
|
3944
|
-
|
3945
|
-
|
3946
|
-
|
3947
|
-
|
3948
|
-
|
3949
|
-
|
3950
|
-
|
3951
|
-
|
3952
|
-
|
3953
|
-
|
3954
|
-
|
4090
|
+
if (!oi(this)) if (!w(e) && S(e)) {
|
4091
|
+
if (!B || this.config.opt_out_useragent_filter || !Fr(B, this.config.custom_blocked_useragents)) {
|
4092
|
+
var s = null != i && i.skip_client_rate_limiting ? void 0 : this.rateLimiter.clientRateLimitContext();
|
4093
|
+
if (null == s || !s.isRateLimited) {
|
4094
|
+
this.sessionPersistence.update_search_keyword(), this.config.store_google && (this.sessionPersistence.update_campaign_params(),
|
4095
|
+
this.persistence.set_initial_campaign_params()), this.config.save_referrer && (this.sessionPersistence.update_referrer_info(),
|
4096
|
+
this.persistence.set_initial_referrer_info());
|
4097
|
+
var o = {
|
4098
|
+
uuid: We(),
|
4099
|
+
event: e,
|
4100
|
+
properties: this._calculate_event_properties(e, n || {})
|
4101
|
+
};
|
4102
|
+
if (null == i || !i._noHeatmaps) {
|
4103
|
+
var a, u = null === (a = this.heatmaps) || void 0 === a ? void 0 : a.getAndClearBuffer();
|
4104
|
+
u && (o.properties.$heatmap_data = u);
|
4105
|
+
}
|
4106
|
+
s && (o.properties.$lib_rate_limit_remaining_tokens = s.remainingTokens), (null == i ? void 0 : i.$set) && (o.$set = null == i ? void 0 : i.$set);
|
4107
|
+
var l = this._calculate_set_once_properties(null == i ? void 0 : i.$set_once);
|
4108
|
+
l && (o.$set_once = l), (o = te(o, null != i && i._noTruncate ? null : this.config.properties_string_max_length)).timestamp = (null == i ? void 0 : i.timestamp) || new Date,
|
4109
|
+
w(null == i ? void 0 : i.timestamp) || (o.properties.$event_time_override_provided = !0,
|
4110
|
+
o.properties.$event_time_override_system_time = new Date);
|
4111
|
+
var c = t(t({}, o.properties.$set), o.$set);
|
4112
|
+
k(c) || this.setPersonPropertiesForFlags(c), this._debugEventEmitter.emit("eventCaptured", o);
|
4113
|
+
var d = {
|
4114
|
+
method: "POST",
|
4115
|
+
url: null !== (r = null == i ? void 0 : i._url) && void 0 !== r ? r : this.requestRouter.endpointFor("api", this.analyticsDefaultEndpoint),
|
4116
|
+
data: o,
|
4117
|
+
compression: "best-available",
|
4118
|
+
batchKey: null == i ? void 0 : i._batchKey
|
4119
|
+
};
|
4120
|
+
return !this.config.request_batching || i && (null == i || !i._batchKey) || null != i && i.send_instantly ? this._send_retriable_request(d) : this._requestQueue.enqueue(d),
|
4121
|
+
o;
|
4122
|
+
}
|
4123
|
+
U.critical("This capture call is ignored due to client rate limiting.");
|
3955
4124
|
}
|
3956
4125
|
} else U.error("No event name provided to posthog.capture");
|
3957
4126
|
}
|
@@ -3971,36 +4140,33 @@ var Er = function() {
|
|
3971
4140
|
var s = t(t({}, this.persistence.properties()), this.sessionPersistence.properties());
|
3972
4141
|
return r.distinct_id = s.distinct_id, r;
|
3973
4142
|
}
|
3974
|
-
var o =
|
4143
|
+
var o = cn.properties();
|
3975
4144
|
if (this.sessionManager) {
|
3976
|
-
var a = this.sessionManager.checkAndGetSessionAndWindowId(), u = a.sessionId,
|
3977
|
-
r.$session_id = u, r.$window_id =
|
4145
|
+
var a = this.sessionManager.checkAndGetSessionAndWindowId(), u = a.sessionId, l = a.windowId;
|
4146
|
+
r.$session_id = u, r.$window_id = l;
|
3978
4147
|
}
|
3979
4148
|
if (this.requestRouter.region === ur.CUSTOM && (r.$lib_custom_api_host = this.config.api_host),
|
3980
4149
|
this.sessionPropsManager && this.config.__preview_send_client_session_params && ("$pageview" === e || "$pageleave" === e || "$autocapture" === e)) {
|
3981
|
-
var
|
3982
|
-
r = Q(r,
|
4150
|
+
var c = this.sessionPropsManager.getSessionProps();
|
4151
|
+
r = Q(r, c);
|
3983
4152
|
}
|
3984
4153
|
if (!this.config.disable_scroll_properties) {
|
3985
|
-
var
|
3986
|
-
"$pageview" === e ?
|
3987
|
-
r = Q(r,
|
3988
|
-
}
|
3989
|
-
if ("$pageview" === e && O && (r.title = O.title), "$performance_event" === e) {
|
3990
|
-
var f = this.persistence.properties();
|
3991
|
-
return r.distinct_id = f.distinct_id, r.$current_url = o.$current_url, r;
|
4154
|
+
var d = {};
|
4155
|
+
"$pageview" === e ? d = this.pageViewManager.doPageView() : "$pageleave" === e && (d = this.pageViewManager.doPageLeave()),
|
4156
|
+
r = Q(r, d);
|
3992
4157
|
}
|
3993
|
-
if (!w(i)) {
|
3994
|
-
var
|
3995
|
-
r.$duration = parseFloat((
|
4158
|
+
if ("$pageview" === e && A && (r.title = A.title), !w(i)) {
|
4159
|
+
var h = (new Date).getTime() - i;
|
4160
|
+
r.$duration = parseFloat((h / 1e3).toFixed(3));
|
3996
4161
|
}
|
3997
|
-
|
3998
|
-
(r = Q({},
|
3999
|
-
m(this.config.property_denylist)
|
4162
|
+
B && this.config.opt_out_useragent_filter && (r.$browser_type = Fr(B, this.config.custom_blocked_useragents) ? "bot" : "browser"),
|
4163
|
+
(r = Q({}, o, this.persistence.properties(), this.sessionPersistence.properties(), r)).$is_identified = this._isIdentified(),
|
4164
|
+
m(this.config.property_denylist) ? V(this.config.property_denylist, (function(e) {
|
4000
4165
|
delete r[e];
|
4001
4166
|
})) : U.error("Invalid value for property_denylist config: " + this.config.property_denylist + " or property_blacklist config: " + this.config.property_blacklist);
|
4002
|
-
var
|
4003
|
-
return
|
4167
|
+
var f = this.config.sanitize_properties;
|
4168
|
+
return f && (r = f(r, e)), r.$process_person_profile = this._hasPersonProcessing(),
|
4169
|
+
r;
|
4004
4170
|
}
|
4005
4171
|
}, {
|
4006
4172
|
key: "_calculate_set_once_properties",
|
@@ -4112,7 +4278,7 @@ var Er = function() {
|
|
4112
4278
|
key: "identify",
|
4113
4279
|
value: function(e, t, n) {
|
4114
4280
|
if (!this.__loaded || !this.persistence) return U.uninitializedWarning("posthog.identify");
|
4115
|
-
if (
|
4281
|
+
if (R(e) && (e = e.toString(), U.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),
|
4116
4282
|
e) {
|
4117
4283
|
if ([ "distinct_id", "distinctid" ].includes(e.toLowerCase())) U.critical('The string "'.concat(e, '" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.')); else if (this._requirePersonProcessing("posthog.identify")) {
|
4118
4284
|
var i = this.get_distinct_id();
|
@@ -4128,8 +4294,8 @@ var Er = function() {
|
|
4128
4294
|
e !== i && e !== this.get_property(ae) && (this.unregister(ae), this.register({
|
4129
4295
|
distinct_id: e
|
4130
4296
|
}));
|
4131
|
-
var s = "anonymous" === this.persistence.
|
4132
|
-
e !== i && s ? (this.persistence.
|
4297
|
+
var s = "anonymous" === (this.persistence.get_property(Ee) || "anonymous");
|
4298
|
+
e !== i && s ? (this.persistence.set_property(Ee, "identified"), this.setPersonPropertiesForFlags(t || {}, !1),
|
4133
4299
|
this.capture("$identify", {
|
4134
4300
|
distinct_id: e,
|
4135
4301
|
$anon_distinct_id: i
|
@@ -4137,7 +4303,7 @@ var Er = function() {
|
|
4137
4303
|
$set: t || {},
|
4138
4304
|
$set_once: n || {}
|
4139
4305
|
}), this.featureFlags.setAnonymousDistinctId(i)) : (t || n) && this.setPersonProperties(t, n),
|
4140
|
-
e !== i && (this.reloadFeatureFlags(), this.unregister(
|
4306
|
+
e !== i && (this.reloadFeatureFlags(), this.unregister(Fe));
|
4141
4307
|
}
|
4142
4308
|
} else U.error("Unique user id has not been set in posthog.identify");
|
4143
4309
|
}
|
@@ -4202,9 +4368,9 @@ var Er = function() {
|
|
4202
4368
|
if (!this.__loaded) return U.uninitializedWarning("posthog.reset");
|
4203
4369
|
var s = this.get_property("$device_id");
|
4204
4370
|
null === (t = this.persistence) || void 0 === t || t.clear(), null === (n = this.sessionPersistence) || void 0 === n || n.clear(),
|
4205
|
-
null === (i = this.persistence) || void 0 === i || i.
|
4371
|
+
null === (i = this.persistence) || void 0 === i || i.set_property(Ee, "anonymous"),
|
4206
4372
|
null === (r = this.sessionManager) || void 0 === r || r.resetSessionId();
|
4207
|
-
var o = this.config.get_device_id(
|
4373
|
+
var o = this.config.get_device_id(We());
|
4208
4374
|
this.register_once({
|
4209
4375
|
distinct_id: o,
|
4210
4376
|
$device_id: e ? o : s
|
@@ -4253,24 +4419,21 @@ var Er = function() {
|
|
4253
4419
|
}, {
|
4254
4420
|
key: "set_config",
|
4255
4421
|
value: function(e) {
|
4256
|
-
var n, i = t({}, this.config);
|
4257
|
-
|
4258
|
-
this.
|
4259
|
-
null === (n = this.persistence) || void 0 === n || n.update_config(this.config, i),
|
4260
|
-
this.sessionPersistence = "sessionStorage" === this.config.persistence ? this.persistence : new cn(t(t({}, this.config), {}, {
|
4422
|
+
var n, i, r, s, o = t({}, this.config);
|
4423
|
+
b(e) && (Q(this.config, Dr(e)), null === (n = this.persistence) || void 0 === n || n.update_config(this.config, o),
|
4424
|
+
this.sessionPersistence = "sessionStorage" === this.config.persistence ? this.persistence : new hn(t(t({}, this.config), {}, {
|
4261
4425
|
persistence: "sessionStorage"
|
4262
|
-
})),
|
4263
|
-
this.config.debug && (f.DEBUG = !0), this.sessionRecording
|
4264
|
-
|
4265
|
-
|
4266
|
-
}
|
4426
|
+
})), Ze.is_supported() && "true" === Ze.get("ph_debug") && (this.config.debug = !0),
|
4427
|
+
this.config.debug && (f.DEBUG = !0), null === (i = this.sessionRecording) || void 0 === i || i.startIfEnabledOrStop(),
|
4428
|
+
null === (r = this.autocapture) || void 0 === r || r.startIfEnabled(), null === (s = this.heatmaps) || void 0 === s || s.startIfEnabled(),
|
4429
|
+
this.surveys.loadIfEnabled());
|
4267
4430
|
}
|
4268
4431
|
}, {
|
4269
4432
|
key: "startSessionRecording",
|
4270
4433
|
value: function(e) {
|
4271
4434
|
if (null != e && e.sampling) {
|
4272
4435
|
var t, n, i = null === (t = this.sessionManager) || void 0 === t ? void 0 : t.checkAndGetSessionAndWindowId();
|
4273
|
-
null === (n = this.persistence) || void 0 === n || n.register(o({},
|
4436
|
+
null === (n = this.persistence) || void 0 === n || n.register(o({}, me, !0)), U.info("Session recording started with sampling override for session: ", null == i ? void 0 : i.sessionId);
|
4274
4437
|
}
|
4275
4438
|
this.set_config({
|
4276
4439
|
disable_session_recording: !1
|
@@ -4309,31 +4472,36 @@ var Er = function() {
|
|
4309
4472
|
}, {
|
4310
4473
|
key: "toString",
|
4311
4474
|
value: function() {
|
4312
|
-
var e, t = null !== (e = this.config.name) && void 0 !== e ? e :
|
4313
|
-
return t !==
|
4475
|
+
var e, t = null !== (e = this.config.name) && void 0 !== e ? e : Ar;
|
4476
|
+
return t !== Ar && (t = Ar + "." + t), t;
|
4314
4477
|
}
|
4315
4478
|
}, {
|
4316
4479
|
key: "_isIdentified",
|
4317
4480
|
value: function() {
|
4318
4481
|
var e, t;
|
4319
|
-
return "identified" === (null === (e = this.persistence) || void 0 === e ? void 0 : e.
|
4482
|
+
return "identified" === (null === (e = this.persistence) || void 0 === e ? void 0 : e.get_property(Ee)) || "identified" === (null === (t = this.sessionPersistence) || void 0 === t ? void 0 : t.get_property(Ee));
|
4320
4483
|
}
|
4321
4484
|
}, {
|
4322
4485
|
key: "_hasPersonProcessing",
|
4323
4486
|
value: function() {
|
4324
4487
|
var e, t, n, i;
|
4325
|
-
return !("never" === this.config.
|
4488
|
+
return !("never" === this.config.person_profiles || "identified_only" === this.config.person_profiles && !this._isIdentified() && k(this.getGroups()) && (null === (e = this.persistence) || void 0 === e || null === (t = e.props) || void 0 === t || !t[ae]) && (null === (n = this.persistence) || void 0 === n || null === (i = n.props) || void 0 === i || !i[Ce]));
|
4489
|
+
}
|
4490
|
+
}, {
|
4491
|
+
key: "_shouldCapturePageleave",
|
4492
|
+
value: function() {
|
4493
|
+
return !0 === this.config.capture_pageleave || "if_capture_pageview" === this.config.capture_pageleave && this.config.capture_pageview;
|
4326
4494
|
}
|
4327
4495
|
}, {
|
4328
4496
|
key: "_requirePersonProcessing",
|
4329
4497
|
value: function(e) {
|
4330
|
-
return "never" === this.config.
|
4331
|
-
!1) : (this._register_single(
|
4498
|
+
return "never" === this.config.person_profiles ? (U.error(e + ' was called, but process_person is set to "never". This call will be ignored.'),
|
4499
|
+
!1) : (this._register_single(Ce, !0), !0);
|
4332
4500
|
}
|
4333
4501
|
}, {
|
4334
4502
|
key: "_gdpr_init",
|
4335
4503
|
value: function() {
|
4336
|
-
"localStorage" === this.config.opt_out_capturing_persistence_type &&
|
4504
|
+
"localStorage" === this.config.opt_out_capturing_persistence_type && Ze.is_supported() && (!this.has_opted_in_capturing() && this.has_opted_in_capturing({
|
4337
4505
|
persistence_type: "cookie"
|
4338
4506
|
}) && this.opt_in_capturing({
|
4339
4507
|
enable_persistence: !1
|
@@ -4346,7 +4514,7 @@ var Er = function() {
|
|
4346
4514
|
enable_persistence: !1
|
4347
4515
|
})), this.has_opted_out_capturing() ? this._gdpr_update_persistence({
|
4348
4516
|
clear_persistence: !0
|
4349
|
-
}) : this.has_opted_in_capturing() || !this.config.opt_out_capturing_by_default && !
|
4517
|
+
}) : this.has_opted_in_capturing() || !this.config.opt_out_capturing_by_default && !Xe.get("ph_optout") || (Xe.remove("ph_optout"),
|
4350
4518
|
this.opt_out_capturing({
|
4351
4519
|
clear_persistence: this.config.opt_out_persistence_by_default
|
4352
4520
|
}));
|
@@ -4372,7 +4540,7 @@ var Er = function() {
|
|
4372
4540
|
cookie_expiration: this.config.cookie_expiration,
|
4373
4541
|
cross_subdomain_cookie: this.config.cross_subdomain_cookie,
|
4374
4542
|
secure_cookie: this.config.secure_cookie
|
4375
|
-
}, t || {}),
|
4543
|
+
}, t || {}), Ze.is_supported() || "localStorage" !== t.persistence_type || (t.persistence_type = "cookie"),
|
4376
4544
|
e(this.config.token, {
|
4377
4545
|
capture: t.capture,
|
4378
4546
|
captureEventName: t.capture_event_name,
|
@@ -4389,7 +4557,7 @@ var Er = function() {
|
|
4389
4557
|
value: function(e) {
|
4390
4558
|
e = Q({
|
4391
4559
|
enable_persistence: !0
|
4392
|
-
}, e || {}), this._gdpr_call_func(
|
4560
|
+
}, e || {}), this._gdpr_call_func(Xn, e), this._gdpr_update_persistence(e);
|
4393
4561
|
}
|
4394
4562
|
}, {
|
4395
4563
|
key: "opt_out_capturing",
|
@@ -4397,17 +4565,17 @@ var Er = function() {
|
|
4397
4565
|
var t = Q({
|
4398
4566
|
clear_persistence: !0
|
4399
4567
|
}, e || {});
|
4400
|
-
this._gdpr_call_func(
|
4568
|
+
this._gdpr_call_func(Kn, t), this._gdpr_update_persistence(t);
|
4401
4569
|
}
|
4402
4570
|
}, {
|
4403
4571
|
key: "has_opted_in_capturing",
|
4404
4572
|
value: function(e) {
|
4405
|
-
return this._gdpr_call_func(
|
4573
|
+
return this._gdpr_call_func(Zn, e);
|
4406
4574
|
}
|
4407
4575
|
}, {
|
4408
4576
|
key: "has_opted_out_capturing",
|
4409
4577
|
value: function(e) {
|
4410
|
-
return this._gdpr_call_func(
|
4578
|
+
return this._gdpr_call_func(ei, e);
|
4411
4579
|
}
|
4412
4580
|
}, {
|
4413
4581
|
key: "clear_opt_in_out_capturing",
|
@@ -4415,15 +4583,15 @@ var Er = function() {
|
|
4415
4583
|
var t = Q({
|
4416
4584
|
enable_persistence: !0
|
4417
4585
|
}, null != e ? e : {});
|
4418
|
-
this._gdpr_call_func(
|
4586
|
+
this._gdpr_call_func(ti, t), this._gdpr_update_persistence(t);
|
4419
4587
|
}
|
4420
4588
|
}, {
|
4421
4589
|
key: "debug",
|
4422
4590
|
value: function(e) {
|
4423
|
-
!1 === e ? (null ==
|
4591
|
+
!1 === e ? (null == P || P.console.log("You've disabled debug mode."), localStorage && localStorage.removeItem("ph_debug"),
|
4424
4592
|
this.set_config({
|
4425
4593
|
debug: !1
|
4426
|
-
})) : (null ==
|
4594
|
+
})) : (null == P || P.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),
|
4427
4595
|
localStorage && localStorage.setItem("ph_debug", "true"), this.set_config({
|
4428
4596
|
debug: !0
|
4429
4597
|
}));
|
@@ -4433,26 +4601,26 @@ var Er = function() {
|
|
4433
4601
|
|
4434
4602
|
!function(e, t) {
|
4435
4603
|
for (var n = 0; n < t.length; n++) e.prototype[t[n]] = Z(e.prototype[t[n]]);
|
4436
|
-
}(
|
4604
|
+
}(Br, [ "identify" ]);
|
4437
4605
|
|
4438
|
-
var
|
4606
|
+
var Hr, jr;
|
4439
4607
|
|
4440
4608
|
!function(e) {
|
4441
4609
|
e.Popover = "popover", e.API = "api", e.Widget = "widget";
|
4442
|
-
}(
|
4610
|
+
}(Hr || (Hr = {})), function(e) {
|
4443
4611
|
e.Open = "open", e.MultipleChoice = "multiple_choice", e.SingleChoice = "single_choice",
|
4444
4612
|
e.Rating = "rating", e.Link = "link";
|
4445
|
-
}(
|
4613
|
+
}(jr || (jr = {}));
|
4446
4614
|
|
4447
|
-
var
|
4615
|
+
var Ur, Wr = (Ur = Or[Ar] = new Br, function() {
|
4448
4616
|
function e() {
|
4449
|
-
e.done || (e.done = !0,
|
4617
|
+
e.done || (e.done = !0, qr = !1, V(Or, (function(e) {
|
4450
4618
|
e._dom_loaded();
|
4451
4619
|
})));
|
4452
4620
|
}
|
4453
|
-
null !=
|
4454
|
-
|
4455
|
-
}(),
|
4621
|
+
null != A && A.addEventListener && ("complete" === A.readyState ? e() : A.addEventListener("DOMContentLoaded", e, !1)),
|
4622
|
+
P && re(P, "load", e, !0);
|
4623
|
+
}(), Ur);
|
4456
4624
|
|
4457
4625
|
class PostHogController extends Controller {
|
4458
4626
|
static values={
|
@@ -4460,7 +4628,7 @@ class PostHogController extends Controller {
|
|
4460
4628
|
identification: Object
|
4461
4629
|
};
|
4462
4630
|
connect() {
|
4463
|
-
|
4631
|
+
Wr.init(this.apiKeyValue, {
|
4464
4632
|
api_host: "https://eu.posthog.com",
|
4465
4633
|
custom_campaign_params: [ "ref" ],
|
4466
4634
|
session_recording: {
|
@@ -4472,7 +4640,7 @@ class PostHogController extends Controller {
|
|
4472
4640
|
});
|
4473
4641
|
if (Object.keys(this.identificationValue).length) {
|
4474
4642
|
const {id: id, email: email, name: name} = this.identificationValue;
|
4475
|
-
|
4643
|
+
Wr.identify(id.toString(), {
|
4476
4644
|
email: email,
|
4477
4645
|
name: name
|
4478
4646
|
});
|