@twick/timeline 0.15.8 → 0.15.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +143 -121
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +143 -121
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -3405,7 +3405,7 @@ if (typeof window !== "undefined") {
|
|
|
3405
3405
|
var t = "undefined" != typeof window ? window : void 0, i = "undefined" != typeof globalThis ? globalThis : t;
|
|
3406
3406
|
"undefined" == typeof self && (i.self = i), "undefined" == typeof File && (i.File = function() {
|
|
3407
3407
|
});
|
|
3408
|
-
var e = Array.prototype, r = e.forEach, s = e.indexOf, n = null == i ? void 0 : i.navigator, o = null == i ? void 0 : i.document, a = null == i ? void 0 : i.location, l = null == i ? void 0 : i.fetch, u = null != i && i.XMLHttpRequest && "withCredentials" in new i.XMLHttpRequest() ? i.XMLHttpRequest : void 0, h = null == i ? void 0 : i.AbortController, d = null == n ? void 0 : n.userAgent, v = null != t ? t : {}, c = { DEBUG: false, LIB_VERSION: "1.
|
|
3408
|
+
var e = Array.prototype, r = e.forEach, s = e.indexOf, n = null == i ? void 0 : i.navigator, o = null == i ? void 0 : i.document, a = null == i ? void 0 : i.location, l = null == i ? void 0 : i.fetch, u = null != i && i.XMLHttpRequest && "withCredentials" in new i.XMLHttpRequest() ? i.XMLHttpRequest : void 0, h = null == i ? void 0 : i.AbortController, d = null == n ? void 0 : n.userAgent, v = null != t ? t : {}, c = { DEBUG: false, LIB_VERSION: "1.335.5" };
|
|
3409
3409
|
function f(t2, i2, e2, r2, s2, n2, o2) {
|
|
3410
3410
|
try {
|
|
3411
3411
|
var a2 = t2[n2](o2), l2 = a2.value;
|
|
@@ -3892,8 +3892,12 @@ var Ei = function(i2, e2) {
|
|
|
3892
3892
|
if (r3.type = "text/javascript", r3.crossOrigin = "anonymous", r3.src = i2, r3.onload = (t3) => {
|
|
3893
3893
|
r3.__posthog_loading_callback_fired = true, e2(void 0, t3);
|
|
3894
3894
|
}, r3.onerror = (t3) => e2(t3), t2.config.prepare_external_dependency_script && (r3 = t2.config.prepare_external_dependency_script(r3)), !r3) return e2("prepare_external_dependency_script returned null");
|
|
3895
|
-
|
|
3896
|
-
|
|
3895
|
+
if ("head" === t2.config.external_scripts_inject_target) o.head.appendChild(r3);
|
|
3896
|
+
else {
|
|
3897
|
+
var s3, n3 = o.querySelectorAll("body > script");
|
|
3898
|
+
if (n3.length > 0) null == (s3 = n3[0].parentNode) || s3.insertBefore(r3, n3[0]);
|
|
3899
|
+
else o.body.appendChild(r3);
|
|
3900
|
+
}
|
|
3897
3901
|
};
|
|
3898
3902
|
null != o && o.body ? l2() : null == o || o.addEventListener("DOMContentLoaded", l2);
|
|
3899
3903
|
};
|
|
@@ -5036,8 +5040,10 @@ class ms {
|
|
|
5036
5040
|
else this.N.url !== r2 && (this.Pt(), this.Tt = setTimeout(this.Pt, this.flushToCaptureTimeoutMs)), M(this.N.url) && (this.N.url = r2), this.N.firstMetricTimestamp = M(this.N.firstMetricTimestamp) ? Date.now() : this.N.firstMetricTimestamp, t3.attribution && t3.attribution.interactionTargetElement && (t3.attribution.interactionTargetElement = void 0), this.N.metrics.push(g({}, t3, { $current_url: r2, $session_id: e2.sessionId, $window_id: e2.windowId, timestamp: Date.now() })), this.N.metrics.length === this.allowedMetrics.length && this.Pt();
|
|
5037
5041
|
}
|
|
5038
5042
|
}, this.rt = () => {
|
|
5039
|
-
|
|
5040
|
-
|
|
5043
|
+
if (!this.P) {
|
|
5044
|
+
var t3, i3, e2, r2, s2 = v.__PosthogExtensions__;
|
|
5045
|
+
M(s2) || M(s2.postHogWebVitalsCallbacks) || ({ onLCP: t3, onCLS: i3, onFCP: e2, onINP: r2 } = s2.postHogWebVitalsCallbacks), t3 && i3 && e2 && r2 ? (this.allowedMetrics.indexOf("LCP") > -1 && t3(this.It.bind(this)), this.allowedMetrics.indexOf("CLS") > -1 && i3(this.It.bind(this)), this.allowedMetrics.indexOf("FCP") > -1 && e2(this.It.bind(this)), this.allowedMetrics.indexOf("INP") > -1 && r2(this.It.bind(this)), this.P = true) : gs.error("web vitals callbacks not loaded - not starting");
|
|
5046
|
+
}
|
|
5041
5047
|
}, this._instance = t2, this.kt = !(null == (i2 = this._instance.persistence) || !i2.props[Yi]), this.startIfEnabled();
|
|
5042
5048
|
}
|
|
5043
5049
|
get allowedMetrics() {
|
|
@@ -5047,6 +5053,10 @@ class ms {
|
|
|
5047
5053
|
get flushToCaptureTimeoutMs() {
|
|
5048
5054
|
return (R(this._instance.config.capture_performance) ? this._instance.config.capture_performance.web_vitals_delayed_flush_ms : void 0) || 5e3;
|
|
5049
5055
|
}
|
|
5056
|
+
get useAttribution() {
|
|
5057
|
+
var t2 = R(this._instance.config.capture_performance) ? this._instance.config.capture_performance.web_vitals_attribution : void 0;
|
|
5058
|
+
return null == t2 || t2;
|
|
5059
|
+
}
|
|
5050
5060
|
get Rt() {
|
|
5051
5061
|
var t2 = R(this._instance.config.capture_performance) && L(this._instance.config.capture_performance.__web_vitals_max_value) ? this._instance.config.capture_performance.__web_vitals_max_value : _s;
|
|
5052
5062
|
return 0 < t2 && t2 <= 6e4 ? _s : t2;
|
|
@@ -5066,8 +5076,13 @@ class ms {
|
|
|
5066
5076
|
}
|
|
5067
5077
|
it(t2) {
|
|
5068
5078
|
var i2, e2;
|
|
5069
|
-
null != (i2 = v.__PosthogExtensions__) && i2.postHogWebVitalsCallbacks
|
|
5070
|
-
|
|
5079
|
+
null != (i2 = v.__PosthogExtensions__) && i2.postHogWebVitalsCallbacks ? t2() : null == (e2 = v.__PosthogExtensions__) || null == e2.loadExternalDependency || e2.loadExternalDependency(this._instance, "web-vitals", (i3) => {
|
|
5080
|
+
var e3;
|
|
5081
|
+
if (i3) gs.error("failed to load script", i3);
|
|
5082
|
+
else {
|
|
5083
|
+
var r2 = null == (e3 = v.__PosthogExtensions__) ? void 0 : e3.loadWebVitalsCallbacks;
|
|
5084
|
+
r2 ? (r2(this.useAttribution), t2()) : t2();
|
|
5085
|
+
}
|
|
5071
5086
|
});
|
|
5072
5087
|
}
|
|
5073
5088
|
Ct() {
|
|
@@ -5623,23 +5638,23 @@ var bn = Si("[FeatureFlags]"), wn = Si("[FeatureFlags]", { debugEnabled: true })
|
|
|
5623
5638
|
}({});
|
|
5624
5639
|
class Rn {
|
|
5625
5640
|
constructor(t2) {
|
|
5626
|
-
this.oi = false, this.ai = false, this.li = false, this.ui = false, this.hi = false, this.di = false, this.vi = false, this._instance = t2, this.featureFlagEventHandlers = [];
|
|
5641
|
+
this.oi = false, this.ai = false, this.li = false, this.ui = false, this.hi = false, this.di = false, this.vi = false, this.ci = false, this._instance = t2, this.featureFlagEventHandlers = [];
|
|
5627
5642
|
}
|
|
5628
|
-
|
|
5629
|
-
var t2 = this._instance.config.evaluation_environments;
|
|
5630
|
-
return null !=
|
|
5631
|
-
var
|
|
5632
|
-
return
|
|
5643
|
+
fi() {
|
|
5644
|
+
var t2, i2 = null !== (t2 = this._instance.config.evaluation_contexts) && void 0 !== t2 ? t2 : this._instance.config.evaluation_environments;
|
|
5645
|
+
return !this._instance.config.evaluation_environments || this._instance.config.evaluation_contexts || this.ci || (bn.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."), this.ci = true), null != i2 && i2.length ? i2.filter((t3) => {
|
|
5646
|
+
var i3 = t3 && "string" == typeof t3 && t3.trim().length > 0;
|
|
5647
|
+
return i3 || bn.error("Invalid evaluation context found:", t3, "Expected non-empty string"), i3;
|
|
5633
5648
|
}) : [];
|
|
5634
5649
|
}
|
|
5635
|
-
|
|
5636
|
-
return this.
|
|
5650
|
+
pi() {
|
|
5651
|
+
return this.fi().length > 0;
|
|
5637
5652
|
}
|
|
5638
5653
|
flags() {
|
|
5639
5654
|
if (this._instance.config.__preview_remote_config) this.di = true;
|
|
5640
5655
|
else {
|
|
5641
|
-
var t2 = !this.
|
|
5642
|
-
this.
|
|
5656
|
+
var t2 = !this.gi && (this._instance.config.advanced_disable_feature_flags || this._instance.config.advanced_disable_feature_flags_on_first_load);
|
|
5657
|
+
this.mi({ disableFlags: t2 });
|
|
5643
5658
|
}
|
|
5644
5659
|
}
|
|
5645
5660
|
get hasLoadedFlags() {
|
|
@@ -5672,15 +5687,15 @@ class Rn {
|
|
|
5672
5687
|
return this.oi || (bn.warn(" Overriding feature flag payloads!", { flagPayloads: t2, overriddenPayloads: i2, finalPayloads: e2 }), this.oi = true), e2;
|
|
5673
5688
|
}
|
|
5674
5689
|
reloadFeatureFlags() {
|
|
5675
|
-
this.ui || this._instance.config.advanced_disable_feature_flags || this.
|
|
5676
|
-
this.
|
|
5690
|
+
this.ui || this._instance.config.advanced_disable_feature_flags || this.gi || (this.gi = setTimeout(() => {
|
|
5691
|
+
this.mi();
|
|
5677
5692
|
}, 5));
|
|
5678
5693
|
}
|
|
5679
|
-
|
|
5680
|
-
clearTimeout(this.
|
|
5694
|
+
yi() {
|
|
5695
|
+
clearTimeout(this.gi), this.gi = void 0;
|
|
5681
5696
|
}
|
|
5682
5697
|
ensureFlagsLoaded() {
|
|
5683
|
-
this.ai || this.li || this.
|
|
5698
|
+
this.ai || this.li || this.gi || this.reloadFeatureFlags();
|
|
5684
5699
|
}
|
|
5685
5700
|
setAnonymousDistinctId(t2) {
|
|
5686
5701
|
this.$anon_distinct_id = t2;
|
|
@@ -5688,21 +5703,21 @@ class Rn {
|
|
|
5688
5703
|
setReloadingPaused(t2) {
|
|
5689
5704
|
this.ui = t2;
|
|
5690
5705
|
}
|
|
5691
|
-
|
|
5706
|
+
mi(t2) {
|
|
5692
5707
|
var i2;
|
|
5693
|
-
if (this.
|
|
5708
|
+
if (this.yi(), !this._instance.O()) if (this.li) this.hi = true;
|
|
5694
5709
|
else {
|
|
5695
5710
|
var e2 = this._instance.config.token, r2 = this._instance.get_property("$device_id"), s2 = { token: e2, distinct_id: this._instance.get_distinct_id(), groups: this._instance.getGroups(), $anon_distinct_id: this.$anon_distinct_id, person_properties: g({}, (null == (i2 = this._instance.persistence) ? void 0 : i2.get_initial_props()) || {}, this._instance.get_property(oe) || {}), group_properties: this._instance.get_property(ae) };
|
|
5696
|
-
D(r2) || M(r2) || (s2.$device_id = r2), (null != t2 && t2.disableFlags || this._instance.config.advanced_disable_feature_flags) && (s2.disable_flags = true), this.
|
|
5711
|
+
D(r2) || M(r2) || (s2.$device_id = r2), (null != t2 && t2.disableFlags || this._instance.config.advanced_disable_feature_flags) && (s2.disable_flags = true), this.pi() && (s2.evaluation_contexts = this.fi());
|
|
5697
5712
|
var n2 = this._instance.config.__preview_remote_config, o2 = n2 ? "/flags/?v=2" : "/flags/?v=2&config=true", a2 = this._instance.config.advanced_only_evaluate_survey_feature_flags ? "&only_evaluate_survey_feature_flags=true" : "", l2 = this._instance.requestRouter.endpointFor("flags", o2 + a2);
|
|
5698
5713
|
n2 && (s2.timezone = cs()), this.li = true, this._instance._send_request({ method: "POST", url: l2, data: s2, compression: this._instance.config.disable_compression ? void 0 : $s.Base64, timeout: this._instance.config.feature_flag_request_timeout_ms, callback: (t3) => {
|
|
5699
5714
|
var i3, e3, r3 = true;
|
|
5700
|
-
(200 === t3.statusCode && (this.hi || (this.$anon_distinct_id = void 0), r3 = false), this.li = false, this.di) || (this.di = true, this._instance.
|
|
5715
|
+
(200 === t3.statusCode && (this.hi || (this.$anon_distinct_id = void 0), r3 = false), this.li = false, this.di) || (this.di = true, this._instance.bi(null !== (e3 = t3.json) && void 0 !== e3 ? e3 : {}));
|
|
5701
5716
|
if (!s2.disable_flags || this.hi) if (this.vi = !r3, t3.json && null != (i3 = t3.json.quotaLimited) && i3.includes(Cn.FeatureFlags)) bn.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");
|
|
5702
5717
|
else {
|
|
5703
5718
|
var n3;
|
|
5704
5719
|
if (!s2.disable_flags) this.receivedFeatureFlags(null !== (n3 = t3.json) && void 0 !== n3 ? n3 : {}, r3);
|
|
5705
|
-
this.hi && (this.hi = false, this.
|
|
5720
|
+
this.hi && (this.hi = false, this.mi());
|
|
5706
5721
|
}
|
|
5707
5722
|
} });
|
|
5708
5723
|
}
|
|
@@ -5731,7 +5746,7 @@ class Rn {
|
|
|
5731
5746
|
}
|
|
5732
5747
|
getRemoteConfigPayload(t2, i2) {
|
|
5733
5748
|
var e2 = this._instance.config.token, r2 = { distinct_id: this._instance.get_distinct_id(), token: e2 };
|
|
5734
|
-
this.
|
|
5749
|
+
this.pi() && (r2.evaluation_contexts = this.fi()), this._instance._send_request({ method: "POST", url: this._instance.requestRouter.endpointFor("flags", "/flags/?v=2&config=true"), data: r2, compression: this._instance.config.disable_compression ? void 0 : $s.Base64, timeout: this._instance.config.feature_flag_request_timeout_ms, callback: (e3) => {
|
|
5735
5750
|
var r3, s2 = null == (r3 = e3.json) ? void 0 : r3.featureFlagPayloads;
|
|
5736
5751
|
i2((null == s2 ? void 0 : s2[t2]) || void 0);
|
|
5737
5752
|
} });
|
|
@@ -5768,7 +5783,7 @@ class Rn {
|
|
|
5768
5783
|
t3.errorsWhileComputingFlags && (c2 = g({}, e3, c2), f2 = g({}, r3, f2), p2 = g({}, s3, p2)), i3 && i3.register(g({ [xn]: Object.keys(Tn(c2)), [re]: c2 || {}, [$n]: f2 || {}, [ne]: p2 || {} }, u2 ? { [kn]: u2 } : {}, h2 ? { [Pn]: h2 } : {}));
|
|
5769
5784
|
}
|
|
5770
5785
|
}
|
|
5771
|
-
}(t2, this._instance.persistence, e2, r2, s2), this.
|
|
5786
|
+
}(t2, this._instance.persistence, e2, r2, s2), this.wi(i2);
|
|
5772
5787
|
}
|
|
5773
5788
|
}
|
|
5774
5789
|
override(t2, i2) {
|
|
@@ -5776,7 +5791,7 @@ class Rn {
|
|
|
5776
5791
|
}
|
|
5777
5792
|
overrideFeatureFlags(t2) {
|
|
5778
5793
|
if (!this._instance.__loaded || !this._instance.persistence) return bn.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");
|
|
5779
|
-
if (false === t2) return this._instance.persistence.unregister(En), this._instance.persistence.unregister(Sn), this.
|
|
5794
|
+
if (false === t2) return this._instance.persistence.unregister(En), this._instance.persistence.unregister(Sn), this.wi(), wn.info("All overrides cleared");
|
|
5780
5795
|
if (t2 && "object" == typeof t2 && ("flags" in t2 || "payloads" in t2)) {
|
|
5781
5796
|
var i2, e2 = t2;
|
|
5782
5797
|
if (this.oi = Boolean(null !== (i2 = e2.suppressWarning) && void 0 !== i2 && i2), "flags" in e2) {
|
|
@@ -5789,13 +5804,13 @@ class Rn {
|
|
|
5789
5804
|
wn.info("Flag overrides set", { flags: e2.flags });
|
|
5790
5805
|
}
|
|
5791
5806
|
}
|
|
5792
|
-
return "payloads" in e2 && (false === e2.payloads ? (this._instance.persistence.unregister(Sn), wn.info("Payload overrides cleared")) : e2.payloads && (this._instance.persistence.register({ [Sn]: e2.payloads }), wn.info("Payload overrides set", { payloads: e2.payloads }))), void this.
|
|
5807
|
+
return "payloads" in e2 && (false === e2.payloads ? (this._instance.persistence.unregister(Sn), wn.info("Payload overrides cleared")) : e2.payloads && (this._instance.persistence.register({ [Sn]: e2.payloads }), wn.info("Payload overrides set", { payloads: e2.payloads }))), void this.wi();
|
|
5793
5808
|
}
|
|
5794
|
-
this.
|
|
5809
|
+
this.wi();
|
|
5795
5810
|
}
|
|
5796
5811
|
onFeatureFlags(t2) {
|
|
5797
5812
|
if (this.addFeatureFlagsHandler(t2), this.ai) {
|
|
5798
|
-
var { flags: i2, flagVariants: e2 } = this.
|
|
5813
|
+
var { flags: i2, flagVariants: e2 } = this.xi();
|
|
5799
5814
|
t2(i2, e2);
|
|
5800
5815
|
}
|
|
5801
5816
|
return () => this.removeFeatureFlagsHandler(t2);
|
|
@@ -5804,7 +5819,7 @@ class Rn {
|
|
|
5804
5819
|
var r2, s2 = (this._instance.get_property(se) || []).find((i3) => i3.flagKey === t2), n2 = { ["$feature_enrollment/" + t2]: i2 }, o2 = { $feature_flag: t2, $feature_enrollment: i2, $set: n2 };
|
|
5805
5820
|
s2 && (o2.$early_access_feature_name = s2.name), e2 && (o2.$feature_enrollment_stage = e2), this._instance.capture("$feature_enrollment_update", o2), this.setPersonPropertiesForFlags(n2, false);
|
|
5806
5821
|
var a2 = g({}, this.getFlagVariants(), { [t2]: i2 });
|
|
5807
|
-
null == (r2 = this._instance.persistence) || r2.register({ [xn]: Object.keys(Tn(a2)), [re]: a2 }), this.
|
|
5822
|
+
null == (r2 = this._instance.persistence) || r2.register({ [xn]: Object.keys(Tn(a2)), [re]: a2 }), this.wi();
|
|
5808
5823
|
}
|
|
5809
5824
|
getEarlyAccessFeatures(t2, i2, e2) {
|
|
5810
5825
|
void 0 === i2 && (i2 = false);
|
|
@@ -5818,12 +5833,12 @@ class Rn {
|
|
|
5818
5833
|
}
|
|
5819
5834
|
} });
|
|
5820
5835
|
}
|
|
5821
|
-
|
|
5836
|
+
xi() {
|
|
5822
5837
|
var t2 = this.getFlags(), i2 = this.getFlagVariants();
|
|
5823
5838
|
return { flags: t2.filter((t3) => i2[t3]), flagVariants: Object.keys(i2).filter((t3) => i2[t3]).reduce((t3, e2) => (t3[e2] = i2[e2], t3), {}) };
|
|
5824
5839
|
}
|
|
5825
|
-
|
|
5826
|
-
var { flags: i2, flagVariants: e2 } = this.
|
|
5840
|
+
wi(t2) {
|
|
5841
|
+
var { flags: i2, flagVariants: e2 } = this.xi();
|
|
5827
5842
|
this.featureFlagEventHandlers.forEach((r2) => r2(i2, e2, { errorsLoading: t2 }));
|
|
5828
5843
|
}
|
|
5829
5844
|
setPersonPropertiesForFlags(t2, i2) {
|
|
@@ -5848,21 +5863,21 @@ class Rn {
|
|
|
5848
5863
|
} else this._instance.unregister(ae);
|
|
5849
5864
|
}
|
|
5850
5865
|
reset() {
|
|
5851
|
-
this.ai = false, this.li = false, this.ui = false, this.hi = false, this.di = false, this.vi = false, this.$anon_distinct_id = void 0, this.
|
|
5866
|
+
this.ai = false, this.li = false, this.ui = false, this.hi = false, this.di = false, this.vi = false, this.$anon_distinct_id = void 0, this.yi(), this.oi = false;
|
|
5852
5867
|
}
|
|
5853
5868
|
}
|
|
5854
5869
|
var Fn = ["cookie", "localstorage", "localstorage+cookie", "sessionstorage", "memory"];
|
|
5855
5870
|
class Mn {
|
|
5856
5871
|
constructor(t2, i2) {
|
|
5857
|
-
this.R = t2, this.props = {}, this.
|
|
5872
|
+
this.R = t2, this.props = {}, this.Ei = false, this.$i = ((t3) => {
|
|
5858
5873
|
var i3 = "";
|
|
5859
5874
|
return t3.token && (i3 = t3.token.replace(/\+/g, "PL").replace(/\//g, "SL").replace(/=/g, "EQ")), t3.persistence_name ? "ph_" + t3.persistence_name : "ph_" + i3 + "_posthog";
|
|
5860
|
-
})(t2), this.Y = this
|
|
5875
|
+
})(t2), this.Y = this.Si(t2), this.load(), t2.debug && $i.info("Persistence loaded", t2.persistence, g({}, this.props)), this.update_config(t2, t2, i2), this.save();
|
|
5861
5876
|
}
|
|
5862
5877
|
isDisabled() {
|
|
5863
|
-
return !!this.
|
|
5878
|
+
return !!this.ki;
|
|
5864
5879
|
}
|
|
5865
|
-
|
|
5880
|
+
Si(i2) {
|
|
5866
5881
|
-1 === Fn.indexOf(i2.persistence.toLowerCase()) && ($i.critical("Unknown persistence type " + i2.persistence + "; falling back to localStorage+cookie"), i2.persistence = "localStorage+cookie");
|
|
5867
5882
|
var e2 = function(i3) {
|
|
5868
5883
|
void 0 === i3 && (i3 = []);
|
|
@@ -5910,23 +5925,23 @@ class Mn {
|
|
|
5910
5925
|
}), t2;
|
|
5911
5926
|
}
|
|
5912
5927
|
load() {
|
|
5913
|
-
if (!this.
|
|
5914
|
-
var t2 = this.Y.W(this
|
|
5928
|
+
if (!this.ki) {
|
|
5929
|
+
var t2 = this.Y.W(this.$i);
|
|
5915
5930
|
t2 && (this.props = Ri({}, t2));
|
|
5916
5931
|
}
|
|
5917
5932
|
}
|
|
5918
5933
|
save() {
|
|
5919
|
-
this.
|
|
5934
|
+
this.ki || this.Y.G(this.$i, this.props, this.Pi, this.Ti, this.Ii, this.R.debug);
|
|
5920
5935
|
}
|
|
5921
5936
|
remove() {
|
|
5922
|
-
this.Y.V(this
|
|
5937
|
+
this.Y.V(this.$i, false), this.Y.V(this.$i, true);
|
|
5923
5938
|
}
|
|
5924
5939
|
clear() {
|
|
5925
5940
|
this.remove(), this.props = {};
|
|
5926
5941
|
}
|
|
5927
5942
|
register_once(t2, i2, e2) {
|
|
5928
5943
|
if (R(t2)) {
|
|
5929
|
-
M(i2) && (i2 = "None"), this.
|
|
5944
|
+
M(i2) && (i2 = "None"), this.Pi = M(e2) ? this.Ci : e2;
|
|
5930
5945
|
var r2 = false;
|
|
5931
5946
|
if (Ci(t2, (t3, e3) => {
|
|
5932
5947
|
this.props.hasOwnProperty(e3) && this.props[e3] !== i2 || (this.props[e3] = t3, r2 = true);
|
|
@@ -5936,7 +5951,7 @@ class Mn {
|
|
|
5936
5951
|
}
|
|
5937
5952
|
register(t2, i2) {
|
|
5938
5953
|
if (R(t2)) {
|
|
5939
|
-
this.
|
|
5954
|
+
this.Pi = M(i2) ? this.Ci : i2;
|
|
5940
5955
|
var e2 = false;
|
|
5941
5956
|
if (Ci(t2, (i3, r2) => {
|
|
5942
5957
|
t2.hasOwnProperty(r2) && this.props[r2] !== i3 && (this.props[r2] = i3, e2 = true);
|
|
@@ -5948,9 +5963,9 @@ class Mn {
|
|
|
5948
5963
|
t2 in this.props && (delete this.props[t2], this.save());
|
|
5949
5964
|
}
|
|
5950
5965
|
update_campaign_params() {
|
|
5951
|
-
if (!this.
|
|
5966
|
+
if (!this.Ei) {
|
|
5952
5967
|
var t2 = os(this.R.custom_campaign_params, this.R.mask_personal_data_properties, this.R.custom_personal_data_properties);
|
|
5953
|
-
F(Di(t2)) || this.register(t2), this.
|
|
5968
|
+
F(Di(t2)) || this.register(t2), this.Ei = true;
|
|
5954
5969
|
}
|
|
5955
5970
|
}
|
|
5956
5971
|
update_search_keyword() {
|
|
@@ -5987,23 +6002,23 @@ class Mn {
|
|
|
5987
6002
|
}), t2;
|
|
5988
6003
|
}
|
|
5989
6004
|
update_config(t2, i2, e2) {
|
|
5990
|
-
if (this.
|
|
6005
|
+
if (this.Ci = this.Pi = t2.cookie_expiration, this.set_disabled(t2.disable_persistence || !!e2), this.set_cross_subdomain(t2.cross_subdomain_cookie), this.set_secure(t2.secure_cookie), t2.persistence !== i2.persistence || !((t3, i3) => {
|
|
5991
6006
|
if (t3.length !== i3.length) return false;
|
|
5992
6007
|
var e3 = [...t3].sort(), r3 = [...i3].sort();
|
|
5993
6008
|
return e3.every((t4, i4) => t4 === r3[i4]);
|
|
5994
6009
|
})(t2.cookie_persisted_properties || [], i2.cookie_persisted_properties || [])) {
|
|
5995
|
-
var r2 = this
|
|
6010
|
+
var r2 = this.Si(t2), s2 = this.props;
|
|
5996
6011
|
this.clear(), this.Y = r2, this.props = s2, this.save();
|
|
5997
6012
|
}
|
|
5998
6013
|
}
|
|
5999
6014
|
set_disabled(t2) {
|
|
6000
|
-
this.
|
|
6015
|
+
this.ki = t2, this.ki ? this.remove() : this.save();
|
|
6001
6016
|
}
|
|
6002
6017
|
set_cross_subdomain(t2) {
|
|
6003
|
-
t2 !== this.
|
|
6018
|
+
t2 !== this.Ti && (this.Ti = t2, this.remove(), this.save());
|
|
6004
6019
|
}
|
|
6005
6020
|
set_secure(t2) {
|
|
6006
|
-
t2 !== this.
|
|
6021
|
+
t2 !== this.Ii && (this.Ii = t2, this.remove(), this.save());
|
|
6007
6022
|
}
|
|
6008
6023
|
set_event_timer(t2, i2) {
|
|
6009
6024
|
var e2 = this.props[qi] || {};
|
|
@@ -6023,14 +6038,14 @@ class Mn {
|
|
|
6023
6038
|
var On = Si("[Product Tours]"), An = "ph_product_tours";
|
|
6024
6039
|
class Dn {
|
|
6025
6040
|
constructor(t2) {
|
|
6026
|
-
this.
|
|
6041
|
+
this.Ri = null, this.Fi = null, this._instance = t2;
|
|
6027
6042
|
}
|
|
6028
6043
|
onRemoteConfig(t2) {
|
|
6029
6044
|
this._instance.persistence && this._instance.persistence.register({ [Qi]: !(null == t2 || !t2.productTours) }), this.loadIfEnabled();
|
|
6030
6045
|
}
|
|
6031
6046
|
loadIfEnabled() {
|
|
6032
6047
|
var t2, i2;
|
|
6033
|
-
this.
|
|
6048
|
+
this.Ri || ((t2 = this._instance).config.disable_product_tours || null == (i2 = t2.persistence) || !i2.get_property(Qi)) || this.it(() => this.Mi());
|
|
6034
6049
|
}
|
|
6035
6050
|
it(t2) {
|
|
6036
6051
|
var i2, e2;
|
|
@@ -6038,16 +6053,16 @@ class Dn {
|
|
|
6038
6053
|
i3 ? On.error("Could not load product tours script", i3) : t2();
|
|
6039
6054
|
});
|
|
6040
6055
|
}
|
|
6041
|
-
|
|
6056
|
+
Mi() {
|
|
6042
6057
|
var t2;
|
|
6043
|
-
!this.
|
|
6058
|
+
!this.Ri && null != (t2 = v.__PosthogExtensions__) && t2.generateProductTours && (this.Ri = v.__PosthogExtensions__.generateProductTours(this._instance, true));
|
|
6044
6059
|
}
|
|
6045
6060
|
getProductTours(t2, i2) {
|
|
6046
|
-
if (void 0 === i2 && (i2 = false), !I(this.
|
|
6061
|
+
if (void 0 === i2 && (i2 = false), !I(this.Fi) || i2) {
|
|
6047
6062
|
var e2 = this._instance.persistence;
|
|
6048
6063
|
if (e2) {
|
|
6049
6064
|
var r2 = e2.props[An];
|
|
6050
|
-
if (I(r2) && !i2) return this.
|
|
6065
|
+
if (I(r2) && !i2) return this.Fi = r2, void t2(r2, { isLoaded: true });
|
|
6051
6066
|
}
|
|
6052
6067
|
this._instance._send_request({ url: this._instance.requestRouter.endpointFor("api", "/api/product_tours/?token=" + this._instance.config.token), method: "GET", callback: (i3) => {
|
|
6053
6068
|
var r3 = i3.statusCode;
|
|
@@ -6056,50 +6071,50 @@ class Dn {
|
|
|
6056
6071
|
return On.error(s2), void t2([], { isLoaded: false, error: s2 });
|
|
6057
6072
|
}
|
|
6058
6073
|
var n2 = I(i3.json.product_tours) ? i3.json.product_tours : [];
|
|
6059
|
-
this.
|
|
6074
|
+
this.Fi = n2, e2 && e2.register({ [An]: n2 }), t2(n2, { isLoaded: true });
|
|
6060
6075
|
} });
|
|
6061
|
-
} else t2(this.
|
|
6076
|
+
} else t2(this.Fi, { isLoaded: true });
|
|
6062
6077
|
}
|
|
6063
6078
|
getActiveProductTours(t2) {
|
|
6064
|
-
j(this.
|
|
6079
|
+
j(this.Ri) ? t2([], { isLoaded: false, error: "Product tours not loaded" }) : this.Ri.getActiveProductTours(t2);
|
|
6065
6080
|
}
|
|
6066
6081
|
showProductTour(t2) {
|
|
6067
6082
|
var i2;
|
|
6068
|
-
null == (i2 = this.
|
|
6083
|
+
null == (i2 = this.Ri) || i2.showTourById(t2);
|
|
6069
6084
|
}
|
|
6070
6085
|
previewTour(t2) {
|
|
6071
|
-
this.
|
|
6086
|
+
this.Ri ? this.Ri.previewTour(t2) : this.it(() => {
|
|
6072
6087
|
var i2;
|
|
6073
|
-
this.
|
|
6088
|
+
this.Mi(), null == (i2 = this.Ri) || i2.previewTour(t2);
|
|
6074
6089
|
});
|
|
6075
6090
|
}
|
|
6076
6091
|
dismissProductTour() {
|
|
6077
6092
|
var t2;
|
|
6078
|
-
null == (t2 = this.
|
|
6093
|
+
null == (t2 = this.Ri) || t2.dismissTour("user_clicked_skip");
|
|
6079
6094
|
}
|
|
6080
6095
|
nextStep() {
|
|
6081
6096
|
var t2;
|
|
6082
|
-
null == (t2 = this.
|
|
6097
|
+
null == (t2 = this.Ri) || t2.nextStep();
|
|
6083
6098
|
}
|
|
6084
6099
|
previousStep() {
|
|
6085
6100
|
var t2;
|
|
6086
|
-
null == (t2 = this.
|
|
6101
|
+
null == (t2 = this.Ri) || t2.previousStep();
|
|
6087
6102
|
}
|
|
6088
6103
|
clearCache() {
|
|
6089
6104
|
var t2;
|
|
6090
|
-
this.
|
|
6105
|
+
this.Fi = null, null == (t2 = this._instance.persistence) || t2.unregister(An);
|
|
6091
6106
|
}
|
|
6092
6107
|
resetTour(t2) {
|
|
6093
6108
|
var i2;
|
|
6094
|
-
null == (i2 = this.
|
|
6109
|
+
null == (i2 = this.Ri) || i2.resetTour(t2);
|
|
6095
6110
|
}
|
|
6096
6111
|
resetAllTours() {
|
|
6097
6112
|
var t2;
|
|
6098
|
-
null == (t2 = this.
|
|
6113
|
+
null == (t2 = this.Ri) || t2.resetAllTours();
|
|
6099
6114
|
}
|
|
6100
6115
|
cancelPendingTour(t2) {
|
|
6101
6116
|
var i2;
|
|
6102
|
-
null == (i2 = this.
|
|
6117
|
+
null == (i2 = this.Ri) || i2.cancelPendingTour(t2);
|
|
6103
6118
|
}
|
|
6104
6119
|
}
|
|
6105
6120
|
var jn = function(t2) {
|
|
@@ -6142,16 +6157,16 @@ var Kn = "seenSurvey_", Yn = (t2, i2) => {
|
|
|
6142
6157
|
})(Kn, t2), Qn = [zn.Popover, zn.Widget, zn.API], Zn = { ignoreConditions: false, ignoreDelay: false, displayType: Vn.Popover };
|
|
6143
6158
|
class to {
|
|
6144
6159
|
constructor() {
|
|
6145
|
-
this.
|
|
6160
|
+
this.Oi = {}, this.Oi = {};
|
|
6146
6161
|
}
|
|
6147
6162
|
on(t2, i2) {
|
|
6148
|
-
return this.
|
|
6149
|
-
this.
|
|
6163
|
+
return this.Oi[t2] || (this.Oi[t2] = []), this.Oi[t2].push(i2), () => {
|
|
6164
|
+
this.Oi[t2] = this.Oi[t2].filter((t3) => t3 !== i2);
|
|
6150
6165
|
};
|
|
6151
6166
|
}
|
|
6152
6167
|
emit(t2, i2) {
|
|
6153
|
-
for (var e2 of this.
|
|
6154
|
-
for (var r2 of this.
|
|
6168
|
+
for (var e2 of this.Oi[t2] || []) e2(i2);
|
|
6169
|
+
for (var r2 of this.Oi["*"] || []) r2(t2, i2);
|
|
6155
6170
|
}
|
|
6156
6171
|
}
|
|
6157
6172
|
function io(t2, i2, e2) {
|
|
@@ -6174,24 +6189,24 @@ function io(t2, i2, e2) {
|
|
|
6174
6189
|
}
|
|
6175
6190
|
class eo {
|
|
6176
6191
|
constructor(t2) {
|
|
6177
|
-
this.
|
|
6192
|
+
this.Ai = new to(), this.Di = (t3, i2) => this.ji(t3, i2) && this.Li(t3, i2) && this.Ni(t3, i2) && this.Ui(t3, i2), this.ji = (t3, i2) => null == i2 || !i2.event || (null == t3 ? void 0 : t3.event) === (null == i2 ? void 0 : i2.event), this._instance = t2, this.zi = /* @__PURE__ */ new Set(), this.Hi = /* @__PURE__ */ new Set();
|
|
6178
6193
|
}
|
|
6179
6194
|
init() {
|
|
6180
6195
|
var t2;
|
|
6181
|
-
if (!M(null == (t2 = this._instance) ? void 0 : t2.
|
|
6196
|
+
if (!M(null == (t2 = this._instance) ? void 0 : t2._addCaptureHook)) {
|
|
6182
6197
|
var i2;
|
|
6183
|
-
null == (i2 = this._instance) || i2.
|
|
6198
|
+
null == (i2 = this._instance) || i2._addCaptureHook((t3, i3) => {
|
|
6184
6199
|
this.on(t3, i3);
|
|
6185
6200
|
});
|
|
6186
6201
|
}
|
|
6187
6202
|
}
|
|
6188
6203
|
register(t2) {
|
|
6189
6204
|
var i2, e2;
|
|
6190
|
-
if (!M(null == (i2 = this._instance) ? void 0 : i2.
|
|
6205
|
+
if (!M(null == (i2 = this._instance) ? void 0 : i2._addCaptureHook) && (t2.forEach((t3) => {
|
|
6191
6206
|
var i3, e3;
|
|
6192
|
-
null == (i3 = this.
|
|
6207
|
+
null == (i3 = this.Hi) || i3.add(t3), null == (e3 = t3.steps) || e3.forEach((t4) => {
|
|
6193
6208
|
var i4;
|
|
6194
|
-
null == (i4 = this.
|
|
6209
|
+
null == (i4 = this.zi) || i4.add((null == t4 ? void 0 : t4.event) || "");
|
|
6195
6210
|
});
|
|
6196
6211
|
}), null != (e2 = this._instance) && e2.autocapture)) {
|
|
6197
6212
|
var r2, s2 = /* @__PURE__ */ new Set();
|
|
@@ -6205,8 +6220,8 @@ class eo {
|
|
|
6205
6220
|
}
|
|
6206
6221
|
on(t2, i2) {
|
|
6207
6222
|
var e2;
|
|
6208
|
-
null != i2 && 0 != t2.length && (this.
|
|
6209
|
-
this.Bi(i2, t3) && this.
|
|
6223
|
+
null != i2 && 0 != t2.length && (this.zi.has(t2) || this.zi.has(null == i2 ? void 0 : i2.event)) && this.Hi && (null == (e2 = this.Hi) ? void 0 : e2.size) > 0 && this.Hi.forEach((t3) => {
|
|
6224
|
+
this.Bi(i2, t3) && this.Ai.emit("actionCaptured", t3.name);
|
|
6210
6225
|
});
|
|
6211
6226
|
}
|
|
6212
6227
|
qi(t2) {
|
|
@@ -6214,13 +6229,13 @@ class eo {
|
|
|
6214
6229
|
}
|
|
6215
6230
|
Bi(t2, i2) {
|
|
6216
6231
|
if (null == (null == i2 ? void 0 : i2.steps)) return false;
|
|
6217
|
-
for (var e2 of i2.steps) if (this.
|
|
6232
|
+
for (var e2 of i2.steps) if (this.Di(t2, e2)) return true;
|
|
6218
6233
|
return false;
|
|
6219
6234
|
}
|
|
6220
6235
|
onAction(t2, i2) {
|
|
6221
|
-
return this.
|
|
6236
|
+
return this.Ai.on(t2, i2);
|
|
6222
6237
|
}
|
|
6223
|
-
|
|
6238
|
+
Li(t2, i2) {
|
|
6224
6239
|
if (null != i2 && i2.url) {
|
|
6225
6240
|
var e2, r2 = null == t2 || null == (e2 = t2.properties) ? void 0 : e2.$current_url;
|
|
6226
6241
|
if (!r2 || "string" != typeof r2) return false;
|
|
@@ -6228,7 +6243,7 @@ class eo {
|
|
|
6228
6243
|
}
|
|
6229
6244
|
return true;
|
|
6230
6245
|
}
|
|
6231
|
-
|
|
6246
|
+
Ni(t2, i2) {
|
|
6232
6247
|
return !!this.Wi(t2, i2) && (!!this.Gi(t2, i2) && !!this.Vi(t2, i2));
|
|
6233
6248
|
}
|
|
6234
6249
|
Wi(t2, i2) {
|
|
@@ -6267,7 +6282,7 @@ class eo {
|
|
|
6267
6282
|
var i2;
|
|
6268
6283
|
return null == (null == t2 || null == (i2 = t2.properties) ? void 0 : i2.$elements) ? [] : null == t2 ? void 0 : t2.properties.$elements;
|
|
6269
6284
|
}
|
|
6270
|
-
|
|
6285
|
+
Ui(t2, i2) {
|
|
6271
6286
|
return null == i2 || !i2.properties || 0 === i2.properties.length || _n(i2.properties.reduce((t3, i3) => {
|
|
6272
6287
|
var e2 = I(i3.value) ? i3.value.map(String) : null != i3.value ? [String(i3.value)] : [];
|
|
6273
6288
|
return t3[i3.key] = { values: e2, operator: i3.operator || "exact" }, t3;
|
|
@@ -6304,7 +6319,7 @@ class ro {
|
|
|
6304
6319
|
}
|
|
6305
6320
|
register(t2) {
|
|
6306
6321
|
var i2;
|
|
6307
|
-
M(null == (i2 = this._instance) ? void 0 : i2.
|
|
6322
|
+
M(null == (i2 = this._instance) ? void 0 : i2._addCaptureHook) || (this.ee(t2), this.re(t2));
|
|
6308
6323
|
}
|
|
6309
6324
|
re(t2) {
|
|
6310
6325
|
var i2 = t2.filter((t3) => {
|
|
@@ -6338,7 +6353,7 @@ class ro {
|
|
|
6338
6353
|
return (null == (i3 = t3.conditions) ? void 0 : i3.cancelEvents) && (null == (e3 = t3.conditions) || null == (e3 = e3.cancelEvents) || null == (e3 = e3.values) ? void 0 : e3.length) > 0;
|
|
6339
6354
|
});
|
|
6340
6355
|
if (0 !== e2.length || 0 !== r2.length) {
|
|
6341
|
-
null == (i2 = this._instance) || i2.
|
|
6356
|
+
null == (i2 = this._instance) || i2._addCaptureHook((t3, i3) => {
|
|
6342
6357
|
this.onEvent(t3, i3);
|
|
6343
6358
|
}), this.Ki = this.Zi(t2, jn.Activation), this.Yi = this.Zi(t2, jn.Cancellation);
|
|
6344
6359
|
}
|
|
@@ -6573,11 +6588,11 @@ class no {
|
|
|
6573
6588
|
var r2 = this.ye(t2);
|
|
6574
6589
|
if (r2) {
|
|
6575
6590
|
var s2 = r2;
|
|
6576
|
-
if (null != (e2 = r2.appearance) && e2.surveyPopupDelaySeconds && i2.ignoreDelay && (s2 = g({}, r2, { appearance: g({}, r2.appearance, { surveyPopupDelaySeconds: 0 }) })), false === i2.ignoreConditions) {
|
|
6591
|
+
if (null != (e2 = r2.appearance) && e2.surveyPopupDelaySeconds && i2.ignoreDelay && (s2 = g({}, r2, { appearance: g({}, r2.appearance, { surveyPopupDelaySeconds: 0 }) })), i2.displayType !== Vn.Popover && i2.initialResponses && Jn.warn("initialResponses is only supported for popover surveys. prefill will not be applied."), false === i2.ignoreConditions) {
|
|
6577
6592
|
var n2 = this.canRenderSurvey(r2);
|
|
6578
6593
|
if (!n2.visible) return void Jn.warn("Survey is not eligible to be displayed: ", n2.disabledReason);
|
|
6579
6594
|
}
|
|
6580
|
-
i2.displayType !== Vn.Inline ? this._surveyManager.handlePopoverSurvey(s2, i2
|
|
6595
|
+
i2.displayType !== Vn.Inline ? this._surveyManager.handlePopoverSurvey(s2, i2) : this.renderSurvey(s2, i2.selector, i2.properties);
|
|
6581
6596
|
} else Jn.warn("Survey not found");
|
|
6582
6597
|
}
|
|
6583
6598
|
}
|
|
@@ -6707,25 +6722,32 @@ class lo {
|
|
|
6707
6722
|
var uo = Si("[RateLimiter]");
|
|
6708
6723
|
class ho {
|
|
6709
6724
|
constructor(t2) {
|
|
6710
|
-
var i2, e2;
|
|
6711
6725
|
this.serverLimits = {}, this.lastEventRateLimited = false, this.checkForLimiting = (t3) => {
|
|
6712
|
-
var
|
|
6713
|
-
if (
|
|
6714
|
-
(JSON.parse(
|
|
6726
|
+
var i2 = t3.text;
|
|
6727
|
+
if (i2 && i2.length) try {
|
|
6728
|
+
(JSON.parse(i2).quota_limited || []).forEach((t4) => {
|
|
6715
6729
|
uo.info((t4 || "events") + " is quota limited."), this.serverLimits[t4] = (/* @__PURE__ */ new Date()).getTime() + 6e4;
|
|
6716
6730
|
});
|
|
6717
6731
|
} catch (t4) {
|
|
6718
|
-
return void uo.warn('could not rate limit - continuing. Error: "' + (null == t4 ? void 0 : t4.message) + '"', { text:
|
|
6732
|
+
return void uo.warn('could not rate limit - continuing. Error: "' + (null == t4 ? void 0 : t4.message) + '"', { text: i2 });
|
|
6719
6733
|
}
|
|
6720
|
-
}, this.instance = t2, this.
|
|
6734
|
+
}, this.instance = t2, this.lastEventRateLimited = this.clientRateLimitContext(true).isRateLimited;
|
|
6735
|
+
}
|
|
6736
|
+
get captureEventsPerSecond() {
|
|
6737
|
+
var t2;
|
|
6738
|
+
return (null == (t2 = this.instance.config.rate_limiting) ? void 0 : t2.events_per_second) || 10;
|
|
6739
|
+
}
|
|
6740
|
+
get captureEventsBurstLimit() {
|
|
6741
|
+
var t2;
|
|
6742
|
+
return Math.max((null == (t2 = this.instance.config.rate_limiting) ? void 0 : t2.events_burst_limit) || 10 * this.captureEventsPerSecond, this.captureEventsPerSecond);
|
|
6721
6743
|
}
|
|
6722
6744
|
clientRateLimitContext(t2) {
|
|
6723
6745
|
var i2, e2, r2;
|
|
6724
6746
|
void 0 === t2 && (t2 = false);
|
|
6725
|
-
var s2 = (/* @__PURE__ */ new Date()).getTime(),
|
|
6726
|
-
|
|
6727
|
-
var
|
|
6728
|
-
return
|
|
6747
|
+
var { captureEventsBurstLimit: s2, captureEventsPerSecond: n2 } = this, o2 = (/* @__PURE__ */ new Date()).getTime(), a2 = null !== (i2 = null == (e2 = this.instance.persistence) ? void 0 : e2.get_property(ve)) && void 0 !== i2 ? i2 : { tokens: s2, last: o2 };
|
|
6748
|
+
a2.tokens += (o2 - a2.last) / 1e3 * n2, a2.last = o2, a2.tokens > s2 && (a2.tokens = s2);
|
|
6749
|
+
var l2 = a2.tokens < 1;
|
|
6750
|
+
return l2 || t2 || (a2.tokens = Math.max(0, a2.tokens - 1)), !l2 || this.lastEventRateLimited || t2 || this.instance.capture("$$client_ingestion_warning", { $$client_ingestion_warning_message: "posthog-js client rate limited. Config is set to " + n2 + " events per second and " + s2 + " events burst limit." }, { skip_client_rate_limiting: true }), this.lastEventRateLimited = l2, null == (r2 = this.instance.persistence) || r2.set_property(ve, a2), { isRateLimited: l2, remainingTokens: a2.tokens };
|
|
6729
6751
|
}
|
|
6730
6752
|
isServerRateLimited(t2) {
|
|
6731
6753
|
var i2 = this.serverLimits[t2 || "events"] || false;
|
|
@@ -6752,20 +6774,20 @@ class co {
|
|
|
6752
6774
|
}
|
|
6753
6775
|
load() {
|
|
6754
6776
|
try {
|
|
6755
|
-
if (this.remoteConfig) return vo.info("Using preloaded remote config", this.remoteConfig), void this.
|
|
6777
|
+
if (this.remoteConfig) return vo.info("Using preloaded remote config", this.remoteConfig), void this.bi(this.remoteConfig);
|
|
6756
6778
|
if (this._instance.O()) return void vo.warn("Remote config is disabled. Falling back to local config.");
|
|
6757
6779
|
this.Te((t2) => {
|
|
6758
6780
|
if (!t2) return vo.info("No config found after loading remote JS config. Falling back to JSON."), void this.Ie((t3) => {
|
|
6759
|
-
this.
|
|
6781
|
+
this.bi(t3);
|
|
6760
6782
|
});
|
|
6761
|
-
this.
|
|
6783
|
+
this.bi(t2);
|
|
6762
6784
|
});
|
|
6763
6785
|
} catch (t2) {
|
|
6764
6786
|
vo.error("Error loading remote config", t2);
|
|
6765
6787
|
}
|
|
6766
6788
|
}
|
|
6767
|
-
|
|
6768
|
-
t2 ? this._instance.config.__preview_remote_config ? (this._instance.
|
|
6789
|
+
bi(t2) {
|
|
6790
|
+
t2 ? this._instance.config.__preview_remote_config ? (this._instance.bi(t2), false !== t2.hasFeatureFlags && this._instance.featureFlags.ensureFlagsLoaded()) : vo.info("__preview_remote_config is disabled. Logging config instead", t2) : vo.error("Failed to fetch remote config from PostHog.");
|
|
6769
6791
|
}
|
|
6770
6792
|
}
|
|
6771
6793
|
var fo = 3e3;
|
|
@@ -6963,7 +6985,7 @@ class xo {
|
|
|
6963
6985
|
};
|
|
6964
6986
|
}
|
|
6965
6987
|
dr() {
|
|
6966
|
-
return "memory" !== this.R.persistence && !this.Xe.
|
|
6988
|
+
return "memory" !== this.R.persistence && !this.Xe.ki && Fr.H();
|
|
6967
6989
|
}
|
|
6968
6990
|
pr(t2) {
|
|
6969
6991
|
t2 !== this.rr && (this.rr = t2, this.dr() && Fr.G(this.ur, t2));
|
|
@@ -7026,7 +7048,7 @@ class So {
|
|
|
7026
7048
|
}
|
|
7027
7049
|
init() {
|
|
7028
7050
|
if (this.isEnabled) {
|
|
7029
|
-
var t2 = this._instance.
|
|
7051
|
+
var t2 = this._instance._addCaptureHook(this.br.bind(this));
|
|
7030
7052
|
this.wr = () => {
|
|
7031
7053
|
t2(), this.yr = [], this.wr = void 0;
|
|
7032
7054
|
};
|
|
@@ -7366,7 +7388,7 @@ var Lo = {}, No = () => {
|
|
|
7366
7388
|
return g({ api_host: "https://us.i.posthog.com", flags_api_host: null, ui_host: null, token: "", autocapture: true, cross_subdomain_cookie: Ni(null == o ? void 0 : o.location), persistence: "localStorage+cookie", persistence_name: "", cookie_persisted_properties: [], loaded: No, save_campaign_params: true, custom_campaign_params: [], custom_blocked_useragents: [], save_referrer: true, capture_pageleave: "if_capture_pageview", defaults: null != i2 ? i2 : "unset", __preview_deferred_init_extensions: false, debug: a && O(null == a ? void 0 : a.search) && -1 !== a.search.indexOf("__posthog_debug=true") || false, cookie_expiration: 365, upgrade: false, disable_session_recording: false, disable_persistence: false, disable_web_experiments: true, disable_surveys: false, disable_surveys_automatic_display: false, disable_conversations: false, disable_product_tours: true, disable_external_dependency_loading: false, enable_recording_console_log: void 0, secure_cookie: "https:" === (null == t || null == (e2 = t.location) ? void 0 : e2.protocol), ip: false, opt_out_capturing_by_default: false, opt_out_persistence_by_default: false, opt_out_useragent_filter: false, opt_out_capturing_persistence_type: "localStorage", consent_persistence_name: null, opt_out_capturing_cookie_prefix: null, opt_in_site_apps: false, property_denylist: [], respect_dnt: false, sanitize_properties: null, request_headers: {}, request_batching: true, properties_string_max_length: 65535, mask_all_element_attributes: false, mask_all_text: false, mask_personal_data_properties: false, custom_personal_data_properties: [], advanced_disable_flags: false, advanced_disable_decide: false, advanced_disable_feature_flags: false, advanced_disable_feature_flags_on_first_load: false, advanced_only_evaluate_survey_feature_flags: false, advanced_enable_surveys: false, advanced_disable_toolbar_metrics: false, feature_flag_request_timeout_ms: 3e3, surveys_request_timeout_ms: 1e4, on_request_error: (t2) => {
|
|
7367
7389
|
var i3 = "Bad HTTP status: " + t2.statusCode + " " + t2.text;
|
|
7368
7390
|
$i.error(i3);
|
|
7369
|
-
}, get_device_id: (t2) => t2, capture_performance: void 0, name: "posthog", bootstrap: {}, disable_compression: false, session_idle_timeout_seconds: 1800, person_profiles: "identified_only", before_send: void 0, request_queue_config: { flush_interval_ms: fo }, error_tracking: {}, _onCapture: No, __preview_eager_load_replay: false }, ((t2) => ({ rageclick: !(t2 && t2 >= "2025-11-30") || { content_ignorelist: true }, capture_pageview: !(t2 && t2 >= "2025-05-24") || "history_change", session_recording: t2 && t2 >= "2025-11-30" ? { strictMinimumDuration: true } : {} }))(i2));
|
|
7391
|
+
}, get_device_id: (t2) => t2, capture_performance: void 0, name: "posthog", bootstrap: {}, disable_compression: false, session_idle_timeout_seconds: 1800, person_profiles: "identified_only", before_send: void 0, request_queue_config: { flush_interval_ms: fo }, error_tracking: {}, _onCapture: No, __preview_eager_load_replay: false }, ((t2) => ({ rageclick: !(t2 && t2 >= "2025-11-30") || { content_ignorelist: true }, capture_pageview: !(t2 && t2 >= "2025-05-24") || "history_change", session_recording: t2 && t2 >= "2025-11-30" ? { strictMinimumDuration: true } : {}, external_scripts_inject_target: t2 && t2 >= "2026-01-30" ? "head" : "body" }))(i2));
|
|
7370
7392
|
}, Bo = (t2) => {
|
|
7371
7393
|
var i2 = {};
|
|
7372
7394
|
M(t2.process_person) || (i2.person_profiles = t2.process_person), M(t2.xhr_headers) || (i2.request_headers = t2.xhr_headers), M(t2.cookie_name) || (i2.persistence_name = t2.cookie_name), M(t2.disable_cookie) || (i2.disable_persistence = t2.disable_cookie), M(t2.store_google) || (i2.save_campaign_params = t2.store_google), M(t2.verbose) || (i2.debug = t2.verbose);
|
|
@@ -7483,7 +7505,7 @@ class Wo {
|
|
|
7483
7505
|
}), e2.push(() => {
|
|
7484
7506
|
if (this.os) {
|
|
7485
7507
|
var t3 = this.os;
|
|
7486
|
-
this.os = void 0, this.
|
|
7508
|
+
this.os = void 0, this.bi(t3);
|
|
7487
7509
|
}
|
|
7488
7510
|
}), this.ls(e2, i2);
|
|
7489
7511
|
}
|
|
@@ -7504,10 +7526,10 @@ class Wo {
|
|
|
7504
7526
|
var r2 = Math.round(performance.now() - i2);
|
|
7505
7527
|
this.register_for_session({ $sdk_debug_extensions_init_method: this.config.__preview_deferred_init_extensions ? "deferred" : "synchronous", $sdk_debug_extensions_init_time_ms: r2 }), this.config.__preview_deferred_init_extensions && $i.info("PostHog extensions initialized (" + r2 + "ms)");
|
|
7506
7528
|
}
|
|
7507
|
-
|
|
7529
|
+
bi(t2) {
|
|
7508
7530
|
var i2, e2, r2, s2, n2, a2, l2, u2, h2;
|
|
7509
7531
|
if (!o || !o.body) return $i.info("document not ready yet, trying again in 500 milliseconds..."), void setTimeout(() => {
|
|
7510
|
-
this.
|
|
7532
|
+
this.bi(t2);
|
|
7511
7533
|
}, 500);
|
|
7512
7534
|
this.config.__preview_deferred_init_extensions && (this.os = t2), this.compression = void 0, t2.supportedCompression && !this.config.disable_compression && (this.compression = w(t2.supportedCompression, $s.GZipJS) ? $s.GZipJS : w(t2.supportedCompression, $s.Base64) ? $s.Base64 : void 0), null != (i2 = t2.analytics) && i2.endpoint && (this.analyticsDefaultEndpoint = t2.analytics.endpoint), this.set_config({ person_profiles: this.Vr ? this.Vr : "identified_only" }), null == (e2 = this.siteApps) || e2.onRemoteConfig(t2), null == (r2 = this.sessionRecording) || r2.onRemoteConfig(t2), null == (s2 = this.autocapture) || s2.onRemoteConfig(t2), null == (n2 = this.heatmaps) || n2.onRemoteConfig(t2), this.surveys.onRemoteConfig(t2), this.logs.onRemoteConfig(t2), this.conversations.onRemoteConfig(t2), null == (a2 = this.productTours) || a2.onRemoteConfig(t2), null == (l2 = this.webVitalsAutocapture) || l2.onRemoteConfig(t2), null == (u2 = this.exceptionObserver) || u2.onRemoteConfig(t2), this.exceptions.onRemoteConfig(t2), null == (h2 = this.deadClicksAutocapture) || h2.onRemoteConfig(t2);
|
|
7513
7535
|
}
|
|
@@ -7603,7 +7625,7 @@ class Wo {
|
|
|
7603
7625
|
} else $i.error("No event name provided to posthog.capture");
|
|
7604
7626
|
} else $i.uninitializedWarning("posthog.capture");
|
|
7605
7627
|
}
|
|
7606
|
-
|
|
7628
|
+
_addCaptureHook(t2) {
|
|
7607
7629
|
return this.on("eventCaptured", (i2) => t2(i2.event, i2));
|
|
7608
7630
|
}
|
|
7609
7631
|
calculateEventProperties(t2, i2, e2, r2, s2) {
|
|
@@ -7889,8 +7911,8 @@ class Wo {
|
|
|
7889
7911
|
}
|
|
7890
7912
|
_s() {
|
|
7891
7913
|
var t2, i2, e2, r2, s2 = this.Qr();
|
|
7892
|
-
(null == (t2 = this.persistence) ? void 0 : t2.
|
|
7893
|
-
(null == (i2 = this.sessionPersistence) ? void 0 : i2.
|
|
7914
|
+
(null == (t2 = this.persistence) ? void 0 : t2.ki) !== s2 && (null == (e2 = this.persistence) || e2.set_disabled(s2));
|
|
7915
|
+
(null == (i2 = this.sessionPersistence) ? void 0 : i2.ki) !== s2 && (null == (r2 = this.sessionPersistence) || r2.set_disabled(s2));
|
|
7894
7916
|
return s2;
|
|
7895
7917
|
}
|
|
7896
7918
|
opt_in_capturing(t2) {
|
|
@@ -8133,7 +8155,7 @@ var __POSTHOG_ERROR_MESSAGES = {
|
|
|
8133
8155
|
return PostHogErrorBoundary;
|
|
8134
8156
|
})(React.Component);
|
|
8135
8157
|
const name = "@twick/timeline";
|
|
8136
|
-
const version = "0.15.
|
|
8158
|
+
const version = "0.15.10";
|
|
8137
8159
|
const packageJson = {
|
|
8138
8160
|
name,
|
|
8139
8161
|
version
|