wineater-bot 2.1.3 → 2.1.4
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/wineater-chatbot.mjs +464 -478
- package/dist/wineater-chatbot.umd.js +25 -25
- package/package.json +1 -1
- package/src/js/auto-open.js +4 -4
|
@@ -711,7 +711,7 @@ var $e = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
711
711
|
function Xn(t) {
|
|
712
712
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
713
713
|
}
|
|
714
|
-
var
|
|
714
|
+
var us = { exports: {} };
|
|
715
715
|
(function(t, e) {
|
|
716
716
|
(function(s, n) {
|
|
717
717
|
n(e);
|
|
@@ -723,33 +723,33 @@ var hs = { exports: {} };
|
|
|
723
723
|
return null;
|
|
724
724
|
}
|
|
725
725
|
}, getItem: function(v, f) {
|
|
726
|
-
var
|
|
726
|
+
var u = this;
|
|
727
727
|
return new Promise(function(m, g) {
|
|
728
728
|
try {
|
|
729
|
-
var S =
|
|
729
|
+
var S = u.getItemSync(v);
|
|
730
730
|
f == null || f(null, S), m(S);
|
|
731
731
|
} catch (x) {
|
|
732
732
|
f && f(x, null), g(x);
|
|
733
733
|
}
|
|
734
734
|
});
|
|
735
|
-
}, setItem: function(v, f,
|
|
735
|
+
}, setItem: function(v, f, u) {
|
|
736
736
|
return new Promise(function(m, g) {
|
|
737
737
|
try {
|
|
738
|
-
localStorage.setItem(v, f),
|
|
738
|
+
localStorage.setItem(v, f), u && u(null, f), m(f);
|
|
739
739
|
} catch (S) {
|
|
740
|
-
|
|
740
|
+
u && u(S, null), g(S);
|
|
741
741
|
}
|
|
742
742
|
});
|
|
743
743
|
} }, i = function() {
|
|
744
744
|
return i = Object.assign || function(v) {
|
|
745
|
-
for (var f,
|
|
746
|
-
for (var g in f = arguments[
|
|
745
|
+
for (var f, u = 1, m = arguments.length; u < m; u++)
|
|
746
|
+
for (var g in f = arguments[u])
|
|
747
747
|
Object.prototype.hasOwnProperty.call(f, g) && (v[g] = f[g]);
|
|
748
748
|
return v;
|
|
749
749
|
}, i.apply(this, arguments);
|
|
750
750
|
};
|
|
751
|
-
function r(v, f,
|
|
752
|
-
return new (
|
|
751
|
+
function r(v, f, u, m) {
|
|
752
|
+
return new (u || (u = Promise))(function(g, S) {
|
|
753
753
|
function x(z) {
|
|
754
754
|
try {
|
|
755
755
|
L(m.next(z));
|
|
@@ -766,7 +766,7 @@ var hs = { exports: {} };
|
|
|
766
766
|
}
|
|
767
767
|
function L(z) {
|
|
768
768
|
var _;
|
|
769
|
-
z.done ? g(z.value) : (_ = z.value, _ instanceof
|
|
769
|
+
z.done ? g(z.value) : (_ = z.value, _ instanceof u ? _ : new u(function($) {
|
|
770
770
|
$(_);
|
|
771
771
|
})).then(x, R);
|
|
772
772
|
}
|
|
@@ -774,7 +774,7 @@ var hs = { exports: {} };
|
|
|
774
774
|
});
|
|
775
775
|
}
|
|
776
776
|
function o(v, f) {
|
|
777
|
-
var
|
|
777
|
+
var u, m, g, S, x = { label: 0, sent: function() {
|
|
778
778
|
if (1 & g[0])
|
|
779
779
|
throw g[1];
|
|
780
780
|
return g[1];
|
|
@@ -785,11 +785,11 @@ var hs = { exports: {} };
|
|
|
785
785
|
function R(L) {
|
|
786
786
|
return function(z) {
|
|
787
787
|
return function(_) {
|
|
788
|
-
if (
|
|
788
|
+
if (u)
|
|
789
789
|
throw new TypeError("Generator is already executing.");
|
|
790
790
|
for (; x; )
|
|
791
791
|
try {
|
|
792
|
-
if (
|
|
792
|
+
if (u = 1, m && (g = 2 & _[0] ? m.return : _[0] ? m.throw || ((g = m.return) && g.call(m), 0) : m.next) && !(g = g.call(m, _[1])).done)
|
|
793
793
|
return g;
|
|
794
794
|
switch (m = 0, g && (_ = [2 & _[0], g.value]), _[0]) {
|
|
795
795
|
case 0:
|
|
@@ -828,7 +828,7 @@ var hs = { exports: {} };
|
|
|
828
828
|
} catch ($) {
|
|
829
829
|
_ = [6, $], m = 0;
|
|
830
830
|
} finally {
|
|
831
|
-
|
|
831
|
+
u = g = 0;
|
|
832
832
|
}
|
|
833
833
|
if (5 & _[0])
|
|
834
834
|
throw _[1];
|
|
@@ -837,68 +837,68 @@ var hs = { exports: {} };
|
|
|
837
837
|
};
|
|
838
838
|
}
|
|
839
839
|
}
|
|
840
|
-
function l(v, f,
|
|
841
|
-
if (
|
|
840
|
+
function l(v, f, u) {
|
|
841
|
+
if (u || arguments.length === 2)
|
|
842
842
|
for (var m, g = 0, S = f.length; g < S; g++)
|
|
843
843
|
!m && g in f || (m || (m = Array.prototype.slice.call(f, 0, g)), m[g] = f[g]);
|
|
844
844
|
return v.concat(m || Array.prototype.slice.call(f));
|
|
845
845
|
}
|
|
846
|
-
var a = function v(f,
|
|
847
|
-
if (f ===
|
|
846
|
+
var a = function v(f, u) {
|
|
847
|
+
if (f === u)
|
|
848
848
|
return !0;
|
|
849
|
-
if (f &&
|
|
850
|
-
if (f.constructor !==
|
|
849
|
+
if (f && u && typeof f == "object" && typeof u == "object") {
|
|
850
|
+
if (f.constructor !== u.constructor)
|
|
851
851
|
return !1;
|
|
852
852
|
var m, g, S;
|
|
853
853
|
if (Array.isArray(f)) {
|
|
854
|
-
if ((m = f.length) !=
|
|
854
|
+
if ((m = f.length) != u.length)
|
|
855
855
|
return !1;
|
|
856
856
|
for (g = m; g-- != 0; )
|
|
857
|
-
if (!v(f[g],
|
|
857
|
+
if (!v(f[g], u[g]))
|
|
858
858
|
return !1;
|
|
859
859
|
return !0;
|
|
860
860
|
}
|
|
861
861
|
if (f.constructor === RegExp)
|
|
862
|
-
return f.source ===
|
|
862
|
+
return f.source === u.source && f.flags === u.flags;
|
|
863
863
|
if (f.valueOf !== Object.prototype.valueOf)
|
|
864
|
-
return f.valueOf() ===
|
|
864
|
+
return f.valueOf() === u.valueOf();
|
|
865
865
|
if (f.toString !== Object.prototype.toString)
|
|
866
|
-
return f.toString() ===
|
|
867
|
-
if ((m = (S = Object.keys(f)).length) !== Object.keys(
|
|
866
|
+
return f.toString() === u.toString();
|
|
867
|
+
if ((m = (S = Object.keys(f)).length) !== Object.keys(u).length)
|
|
868
868
|
return !1;
|
|
869
869
|
for (g = m; g-- != 0; )
|
|
870
|
-
if (!Object.prototype.hasOwnProperty.call(
|
|
870
|
+
if (!Object.prototype.hasOwnProperty.call(u, S[g]))
|
|
871
871
|
return !1;
|
|
872
872
|
for (g = m; g-- != 0; ) {
|
|
873
873
|
var x = S[g];
|
|
874
|
-
if (!v(f[x],
|
|
874
|
+
if (!v(f[x], u[x]))
|
|
875
875
|
return !1;
|
|
876
876
|
}
|
|
877
877
|
return !0;
|
|
878
878
|
}
|
|
879
|
-
return f != f &&
|
|
879
|
+
return f != f && u != u;
|
|
880
880
|
};
|
|
881
|
-
function
|
|
882
|
-
var
|
|
881
|
+
function h(v, f) {
|
|
882
|
+
var u = Object.keys(f || {}).filter(function(m) {
|
|
883
883
|
var g = v == null ? void 0 : v[m], S = f == null ? void 0 : f[m];
|
|
884
884
|
return !a(g, S);
|
|
885
885
|
});
|
|
886
886
|
return Object.keys(v || {}).filter(function(m) {
|
|
887
|
-
Object.keys(f || {}).includes(m) ||
|
|
888
|
-
}), Object.keys(
|
|
887
|
+
Object.keys(f || {}).includes(m) || u.push(m);
|
|
888
|
+
}), Object.keys(u).length ? u : null;
|
|
889
889
|
}
|
|
890
890
|
var c, d;
|
|
891
|
-
function p(v, f,
|
|
891
|
+
function p(v, f, u) {
|
|
892
892
|
var m = "shortString", g = !0;
|
|
893
|
-
typeof
|
|
893
|
+
typeof u == "number" && (m = "javaDouble", g = !1), v[m] = v[m] || {}, v[m][f] = g ? u + "" : u;
|
|
894
894
|
}
|
|
895
895
|
function y(v) {
|
|
896
896
|
return !!v && typeof v == "object" && v.value !== void 0;
|
|
897
897
|
}
|
|
898
898
|
function w(v) {
|
|
899
899
|
return Object.fromEntries(Object.entries(v).map(function(f) {
|
|
900
|
-
var
|
|
901
|
-
return [
|
|
900
|
+
var u = f[0], m = f[1];
|
|
901
|
+
return [u, y(m) ? m : { value: m }];
|
|
902
902
|
}));
|
|
903
903
|
}
|
|
904
904
|
function b(v) {
|
|
@@ -909,185 +909,185 @@ var hs = { exports: {} };
|
|
|
909
909
|
})(c || (c = {}));
|
|
910
910
|
var T, D = null, B = "BULLET_TRAIN_DB", A = "BULLET_TRAIN_EVENT", k = "https://edge.api.flagsmith.com/api/v1/", O = "flagsmith_value_", N = "flagsmith_enabled_", F = "flagsmith_trait_", C = function() {
|
|
911
911
|
function v(f) {
|
|
912
|
-
var
|
|
912
|
+
var u = this;
|
|
913
913
|
this._trigger = null, this._triggerLoadingState = null, this.timestamp = null, this.isLoading = !1, this.eventSource = null, this.getFlags = function() {
|
|
914
|
-
var m =
|
|
915
|
-
|
|
916
|
-
var x = "".concat(
|
|
914
|
+
var m = u, g = m.api, S = m.evaluationContext;
|
|
915
|
+
u.log("Get Flags"), u.isLoading = !0, u.loadingState.isFetching || u.setLoadingState(i(i({}, u.loadingState), { isFetching: !0 }));
|
|
916
|
+
var x = "".concat(u.getContext().identity), R = function(L) {
|
|
917
917
|
var z, _, $, Z;
|
|
918
|
-
if (L && x === "".concat(
|
|
919
|
-
var
|
|
920
|
-
|
|
921
|
-
var
|
|
922
|
-
ee = ee || [], (
|
|
923
|
-
|
|
918
|
+
if (L && x === "".concat(u.getContext().identity)) {
|
|
919
|
+
var oe = L.flags, ee = L.traits, se = L.identifier;
|
|
920
|
+
u.isLoading = !1;
|
|
921
|
+
var ae = {}, ce = {};
|
|
922
|
+
ee = ee || [], (oe = oe || []).forEach(function(K) {
|
|
923
|
+
ae[K.feature.name.toLowerCase().replace(/ /g, "_")] = { id: K.feature.id, enabled: K.enabled, value: K.feature_state_value };
|
|
924
924
|
}), ee.forEach(function(K) {
|
|
925
|
-
|
|
926
|
-
}),
|
|
927
|
-
var me = u
|
|
928
|
-
if ((se || Object.keys(
|
|
925
|
+
ce[K.trait_key.toLowerCase().replace(/ /g, "_")] = { transient: K.transient, value: K.trait_value };
|
|
926
|
+
}), u.oldFlags = i({}, u.flags);
|
|
927
|
+
var me = h(u.oldFlags, ae), Xe = h((z = u.evaluationContext.identity) === null || z === void 0 ? void 0 : z.traits, ce);
|
|
928
|
+
if ((se || Object.keys(ce).length) && (u.evaluationContext.identity = { traits: ce }, se && (u.evaluationContext.identity.identifier = se)), u.flags = ae, u.updateStorage(), u._onChange(u.oldFlags, { isFromServer: !0, flagsChanged: me, traitsChanged: Xe }, u._loadedState(null, c.SERVER)), u.datadogRum)
|
|
929
929
|
try {
|
|
930
|
-
if (
|
|
930
|
+
if (u.datadogRum.trackTraits) {
|
|
931
931
|
var Je = {};
|
|
932
|
-
Object.keys(((_ =
|
|
933
|
-
Je[F + K] =
|
|
932
|
+
Object.keys(((_ = u.evaluationContext.identity) === null || _ === void 0 ? void 0 : _.traits) || {}).map(function(K) {
|
|
933
|
+
Je[F + K] = u.getTrait(K);
|
|
934
934
|
});
|
|
935
|
-
var Me = i(i(i({},
|
|
936
|
-
|
|
935
|
+
var Me = i(i(i({}, u.datadogRum.client.getUser()), { id: u.datadogRum.client.getUser().id || (($ = u.evaluationContext.identity) === null || $ === void 0 ? void 0 : $.identifier) }), Je);
|
|
936
|
+
u.log("Setting Datadog user", Me), u.datadogRum.client.setUser(Me);
|
|
937
937
|
}
|
|
938
938
|
} catch (K) {
|
|
939
939
|
console.error(K);
|
|
940
940
|
}
|
|
941
|
-
if (
|
|
941
|
+
if (u.dtrum)
|
|
942
942
|
try {
|
|
943
943
|
var ne = { javaDouble: {}, date: {}, shortString: {}, javaLongOrObject: {} };
|
|
944
|
-
Object.keys(
|
|
945
|
-
p(ne, O + K,
|
|
946
|
-
}), Object.keys(((Z =
|
|
947
|
-
p(ne, F + K,
|
|
948
|
-
}),
|
|
944
|
+
Object.keys(u.flags).map(function(K) {
|
|
945
|
+
p(ne, O + K, u.getValue(K, { skipAnalytics: !0 })), p(ne, N + K, u.hasFeature(K, { skipAnalytics: !0 }));
|
|
946
|
+
}), Object.keys(((Z = u.evaluationContext.identity) === null || Z === void 0 ? void 0 : Z.traits) || {}).map(function(K) {
|
|
947
|
+
p(ne, F + K, u.getTrait(K));
|
|
948
|
+
}), u.log("Sending javaLongOrObject traits to dynatrace", ne.javaLongOrObject), u.log("Sending date traits to dynatrace", ne.date), u.log("Sending shortString traits to dynatrace", ne.shortString), u.log("Sending javaDouble to dynatrace", ne.javaDouble), u.dtrum.sendSessionProperties(ne.javaLongOrObject, ne.date, ne.shortString, ne.javaDouble);
|
|
949
949
|
} catch (K) {
|
|
950
950
|
console.error(K);
|
|
951
951
|
}
|
|
952
952
|
}
|
|
953
953
|
};
|
|
954
|
-
return S.identity ? Promise.all([S.identity.traits && Object.keys(S.identity.traits).length || !S.identity.identifier ?
|
|
954
|
+
return S.identity ? Promise.all([S.identity.traits && Object.keys(S.identity.traits).length || !S.identity.identifier ? u.getJSON(g + "identities/", "POST", JSON.stringify({ identifier: S.identity.identifier, transient: S.identity.transient, traits: Object.entries(S.identity.traits).map(function(L) {
|
|
955
955
|
var z = L[0], _ = L[1];
|
|
956
956
|
return { trait_key: z, trait_value: _ == null ? void 0 : _.value, transient: _ == null ? void 0 : _.transient };
|
|
957
957
|
}).filter(function(L) {
|
|
958
|
-
return L.trait_value !== void 0 || (
|
|
959
|
-
}) })) :
|
|
960
|
-
return
|
|
958
|
+
return L.trait_value !== void 0 || (u.log("Warning - attempted to set an undefined trait value for key", L.trait_key), !1);
|
|
959
|
+
}) })) : u.getJSON(g + "identities/?identifier=" + encodeURIComponent(S.identity.identifier) + (S.identity.transient ? "&transient=true" : ""))]).then(function(L) {
|
|
960
|
+
return u.evaluationContext.identity = i(i({}, u.evaluationContext.identity), { traits: {} }), R(L == null ? void 0 : L[0]);
|
|
961
961
|
}).catch(function(L) {
|
|
962
962
|
var z = L.message, _ = new Error(z);
|
|
963
963
|
return Promise.reject(_);
|
|
964
|
-
}) :
|
|
964
|
+
}) : u.getJSON(g + "flags/").then(function(L) {
|
|
965
965
|
return R({ flags: L, traits: void 0 });
|
|
966
966
|
});
|
|
967
967
|
}, this.analyticsFlags = function() {
|
|
968
|
-
var m =
|
|
969
|
-
if (
|
|
970
|
-
return
|
|
971
|
-
if (
|
|
972
|
-
var S =
|
|
973
|
-
|
|
968
|
+
var m = u.api;
|
|
969
|
+
if (u.evaluationEvent && u.evaluationContext.environment && u.evaluationEvent[u.evaluationContext.environment.apiKey])
|
|
970
|
+
return u.evaluationEvent && Object.getOwnPropertyNames(u.evaluationEvent).length !== 0 && Object.getOwnPropertyNames(u.evaluationEvent[u.evaluationContext.environment.apiKey]).length !== 0 ? u.getJSON(m + "analytics/flags/", "POST", JSON.stringify(u.evaluationEvent[u.evaluationContext.environment.apiKey])).then(function(g) {
|
|
971
|
+
if (u.evaluationContext.environment) {
|
|
972
|
+
var S = u.getState();
|
|
973
|
+
u.evaluationEvent || (u.evaluationEvent = {}), u.evaluationEvent[u.evaluationContext.environment.apiKey] = {}, u.setState(i(i({}, S), { evaluationEvent: u.evaluationEvent })), u.updateEventStorage();
|
|
974
974
|
}
|
|
975
975
|
}).catch(function(g) {
|
|
976
|
-
|
|
976
|
+
u.log("Exception fetching evaluationEvent", g);
|
|
977
977
|
}) : void 0;
|
|
978
978
|
}, this.datadogRum = null, this.loadingState = { isLoading: !0, isFetching: !0, error: null, source: c.NONE }, this.canUseStorage = !1, this.analyticsInterval = null, this.api = null, this.cacheFlags = !1, this.ts = null, this.enableAnalytics = !1, this.enableLogs = !1, this.evaluationContext = {}, this.evaluationEvent = null, this.flags = null, this.getFlagInterval = null, this.headers = null, this.initialised = !1, this.oldFlags = null, this.onChange = null, this.onError = null, this.ticks = null, this.timer = null, this.dtrum = null, this.withTraits = null, this.cacheOptions = { ttl: 0, skipAPI: !1, loadStale: !1 }, this.getValue = function(m, g, S) {
|
|
979
|
-
var x =
|
|
980
|
-
if (x && (R = x.value), g != null && g.skipAnalytics || S ||
|
|
979
|
+
var x = u.flags && u.flags[m.toLowerCase().replace(/ /g, "_")], R = null;
|
|
980
|
+
if (x && (R = x.value), g != null && g.skipAnalytics || S || u.evaluateFlag(m, "VALUE"), R === null && (g == null ? void 0 : g.fallback) !== void 0)
|
|
981
981
|
return g.fallback;
|
|
982
982
|
if (g != null && g.json)
|
|
983
983
|
try {
|
|
984
|
-
return R === null ? (
|
|
984
|
+
return R === null ? (u.log("Tried to parse null flag as JSON: " + m), null) : JSON.parse(R);
|
|
985
985
|
} catch {
|
|
986
986
|
return g.fallback;
|
|
987
987
|
}
|
|
988
988
|
return R;
|
|
989
989
|
}, this.getTrait = function(m) {
|
|
990
990
|
var g, S;
|
|
991
|
-
return ((g =
|
|
991
|
+
return ((g = u.evaluationContext.identity) === null || g === void 0 ? void 0 : g.traits) && ((S = u.evaluationContext.identity.traits[m.toLowerCase().replace(/ /g, "_")]) === null || S === void 0 ? void 0 : S.value);
|
|
992
992
|
}, this.getAllTraits = function() {
|
|
993
993
|
var m;
|
|
994
|
-
return Object.fromEntries(Object.entries(((m =
|
|
994
|
+
return Object.fromEntries(Object.entries(((m = u.evaluationContext.identity) === null || m === void 0 ? void 0 : m.traits) || {}).map(function(g) {
|
|
995
995
|
var S = g[0], x = g[1];
|
|
996
996
|
return [S, x == null ? void 0 : x.value];
|
|
997
997
|
}));
|
|
998
998
|
}, this.setContext = function(m) {
|
|
999
999
|
var g = b(m);
|
|
1000
|
-
return
|
|
1000
|
+
return u.evaluationContext = i(i({}, g), { environment: g.environment || u.evaluationContext.environment }), u.initialised ? u.getFlags() : Promise.resolve();
|
|
1001
1001
|
}, this.getContext = function() {
|
|
1002
|
-
return
|
|
1002
|
+
return u.evaluationContext;
|
|
1003
1003
|
}, this.updateContext = function(m) {
|
|
1004
|
-
return
|
|
1004
|
+
return u.setContext(i(i({}, u.getContext()), m));
|
|
1005
1005
|
}, this.setTrait = function(m, g) {
|
|
1006
1006
|
var S;
|
|
1007
|
-
if (
|
|
1008
|
-
return
|
|
1007
|
+
if (u.api)
|
|
1008
|
+
return u.setContext(i(i({}, u.evaluationContext), { identity: i(i({}, u.evaluationContext.identity), { traits: i(i({}, (S = u.evaluationContext.identity) === null || S === void 0 ? void 0 : S.traits), w(Object.fromEntries([[m, g]]))) }) }));
|
|
1009
1009
|
}, this.setTraits = function(m) {
|
|
1010
1010
|
var g;
|
|
1011
|
-
if (
|
|
1012
|
-
return
|
|
1011
|
+
if (u.api)
|
|
1012
|
+
return u.setContext(i(i({}, u.evaluationContext), { identity: i(i({}, u.evaluationContext.identity), { traits: i(i({}, (g = u.evaluationContext.identity) === null || g === void 0 ? void 0 : g.traits), Object.fromEntries(Object.entries(m).map(function(S) {
|
|
1013
1013
|
var x = S[0], R = S[1];
|
|
1014
1014
|
return [x, y(R) ? R : { value: R }];
|
|
1015
1015
|
}))) }) }));
|
|
1016
1016
|
console.error("Attempted to setTraits a user before calling flagsmith.init. Call flagsmith.init first, if you wish to prevent it sending a request for flags, call init with preventFetch:true.");
|
|
1017
1017
|
}, this.hasFeature = function(m, g) {
|
|
1018
|
-
var S = typeof g == "object", x =
|
|
1019
|
-
return !x && S && g.fallback !== void 0 ? R = g == null ? void 0 : g.fallback : x && x.enabled && (R = !0), (S && !g.skipAnalytics || !g) &&
|
|
1018
|
+
var S = typeof g == "object", x = u.flags && u.flags[m.toLowerCase().replace(/ /g, "_")], R = !1;
|
|
1019
|
+
return !x && S && g.fallback !== void 0 ? R = g == null ? void 0 : g.fallback : x && x.enabled && (R = !0), (S && !g.skipAnalytics || !g) && u.evaluateFlag(m, "ENABLED"), R;
|
|
1020
1020
|
}, this.getJSON = function(m, g, S) {
|
|
1021
|
-
var x, R =
|
|
1021
|
+
var x, R = u;
|
|
1022
1022
|
R.evaluationContext;
|
|
1023
1023
|
var L = R.headers, z = { method: g || "GET", body: S, cache: "no-cache", headers: {} };
|
|
1024
|
-
|
|
1025
|
-
var _ = "".concat((x =
|
|
1024
|
+
u.evaluationContext.environment && (z.headers["X-Environment-Key"] = u.evaluationContext.environment.apiKey), g && g !== "GET" && (z.headers["Content-Type"] = "application/json; charset=utf-8"), L && Object.assign(z.headers, L), d || console.error("Flagsmith: fetch is undefined, please specify a fetch implementation into flagsmith.init to support SSR.");
|
|
1025
|
+
var _ = "".concat((x = u.evaluationContext.identity) === null || x === void 0 ? void 0 : x.identifier);
|
|
1026
1026
|
return d(m, z).then(function($) {
|
|
1027
|
-
var Z,
|
|
1027
|
+
var Z, oe, ee = "".concat((Z = u.evaluationContext.identity) === null || Z === void 0 ? void 0 : Z.identifier);
|
|
1028
1028
|
if (_ === ee) {
|
|
1029
|
-
var se = (
|
|
1029
|
+
var se = (oe = $.headers) === null || oe === void 0 ? void 0 : oe.get("x-flagsmith-document-updated-at");
|
|
1030
1030
|
if (se)
|
|
1031
1031
|
try {
|
|
1032
|
-
var
|
|
1033
|
-
if (isNaN(
|
|
1032
|
+
var ae = parseFloat(se);
|
|
1033
|
+
if (isNaN(ae))
|
|
1034
1034
|
return Promise.reject("Failed to parse x-flagsmith-document-updated-at");
|
|
1035
|
-
|
|
1036
|
-
} catch (
|
|
1037
|
-
|
|
1035
|
+
u.timestamp = ae;
|
|
1036
|
+
} catch (ce) {
|
|
1037
|
+
u.log(ce, "Failed to parse x-flagsmith-document-updated-at", se);
|
|
1038
1038
|
}
|
|
1039
|
-
return
|
|
1040
|
-
var me =
|
|
1039
|
+
return u.log("Fetch response: " + $.status + " " + (g || "GET") + 0 + m), $.text().then(function(ce) {
|
|
1040
|
+
var me = ce;
|
|
1041
1041
|
try {
|
|
1042
|
-
me = JSON.parse(
|
|
1042
|
+
me = JSON.parse(ce);
|
|
1043
1043
|
} catch {
|
|
1044
1044
|
}
|
|
1045
1045
|
return !me && $.status && (me = "API Response: ".concat($.status)), $.status && $.status >= 200 && $.status < 300 ? me : Promise.reject(new Error(me));
|
|
1046
1046
|
});
|
|
1047
1047
|
}
|
|
1048
|
-
|
|
1048
|
+
u.log("Received response with identity mismatch, ignoring response. Requested: ".concat(_, ", Current: ").concat(ee));
|
|
1049
1049
|
});
|
|
1050
1050
|
}, this.evaluateFlag = function(m, g) {
|
|
1051
|
-
if (
|
|
1052
|
-
if (!
|
|
1051
|
+
if (u.datadogRum && (u.datadogRum.client.addFeatureFlagEvaluation ? g === "VALUE" ? u.datadogRum.client.addFeatureFlagEvaluation(O + m, u.getValue(m, {}, !0)) : u.datadogRum.client.addFeatureFlagEvaluation(N + m, u.hasFeature(m, !0)) : console.error("Flagsmith: Your datadog RUM client does not support the function addFeatureFlagEvaluation, please update it.")), u.enableAnalytics) {
|
|
1052
|
+
if (!u.evaluationEvent || !u.evaluationContext.environment)
|
|
1053
1053
|
return;
|
|
1054
|
-
|
|
1054
|
+
u.evaluationEvent[u.evaluationContext.environment.apiKey] || (u.evaluationEvent[u.evaluationContext.environment.apiKey] = {}), u.evaluationEvent[u.evaluationContext.environment.apiKey][m] === void 0 && (u.evaluationEvent[u.evaluationContext.environment.apiKey][m] = 0), u.evaluationEvent[u.evaluationContext.environment.apiKey][m] += 1;
|
|
1055
1055
|
}
|
|
1056
|
-
|
|
1056
|
+
u.updateEventStorage();
|
|
1057
1057
|
}, this._onChange = function(m, g, S) {
|
|
1058
1058
|
var x, R;
|
|
1059
|
-
|
|
1059
|
+
u.setLoadingState(S), (x = u.onChange) === null || x === void 0 || x.call(u, m, g, u.loadingState), (R = u._trigger) === null || R === void 0 || R.call(u);
|
|
1060
1060
|
}, d = f.fetch ? f.fetch : typeof fetch < "u" ? fetch : $e == null ? void 0 : $e.fetch, this.canUseStorage = typeof window < "u" || !!f.browserlessStorage, this.log("Constructing flagsmith instance " + f), f.eventSource && (T = f.eventSource), f.AsyncStorage && (D = f.AsyncStorage);
|
|
1061
1061
|
}
|
|
1062
1062
|
return v.prototype.init = function(f) {
|
|
1063
|
-
var
|
|
1063
|
+
var u, m, g;
|
|
1064
1064
|
return r(this, void 0, void 0, function() {
|
|
1065
|
-
var S, x, R, L, z, _, $, Z,
|
|
1065
|
+
var S, x, R, L, z, _, $, Z, oe, ee, se, ae, ce, me, Xe, Je, Me, ne, K, Dt, Ye, zs, Qe, At, Ws, $s, Ft, qs, Mt, Ze, Le, Vs, ie = this;
|
|
1066
1066
|
return o(this, function(pe) {
|
|
1067
1067
|
switch (pe.label) {
|
|
1068
1068
|
case 0:
|
|
1069
1069
|
S = b(f.evaluationContext || this.evaluationContext), pe.label = 1;
|
|
1070
1070
|
case 1:
|
|
1071
|
-
if (pe.trys.push([1, 13, , 14]), x = f.environmentID, R = f.api, L = R === void 0 ? k : R, z = f.headers, _ = f.onChange, $ = f.cacheFlags, Z = f.datadogRum,
|
|
1071
|
+
if (pe.trys.push([1, 13, , 14]), x = f.environmentID, R = f.api, L = R === void 0 ? k : R, z = f.headers, _ = f.onChange, $ = f.cacheFlags, Z = f.datadogRum, oe = f.onError, ee = f.defaultFlags, se = f.fetch, ae = f.preventFetch, ce = f.enableLogs, me = f.enableDynatrace, Xe = f.enableAnalytics, Je = f.realtime, Me = f.eventSourceUrl, ne = Me === void 0 ? "https://realtime.flagsmith.com/" : Me, K = f.AsyncStorage, Dt = f.identity, Ye = f.traits, zs = f.state, Qe = f.cacheOptions, At = f.angularHttpClient, Ws = f._trigger, $s = f._triggerLoadingState, S.environment = x ? { apiKey: x } : S.environment, !S.environment || !S.environment.apiKey)
|
|
1072
1072
|
throw new Error("Please provide `evaluationContext.environment` with non-empty `apiKey`");
|
|
1073
|
-
if (S.identity = Dt || Ye ? { identifier: Dt, traits: Ye ? Object.fromEntries(Object.entries(Ye).map(function(
|
|
1074
|
-
return [
|
|
1075
|
-
})) : {} } : S.identity, this.evaluationContext = S, this.api = L, this.headers = z, this.getFlagInterval = null, this.analyticsInterval = null, this.onChange = _, Ft = "Wrong Flagsmith Configuration: preventFetch is true and no defaulFlags provided", this._trigger = Ws || this._trigger, this._triggerLoadingState = $s || this._triggerLoadingState, this.onError = function(
|
|
1076
|
-
ie.setLoadingState(i(i({}, ie.loadingState), { isFetching: !1, isLoading: !1, error:
|
|
1077
|
-
}, this.enableLogs =
|
|
1073
|
+
if (S.identity = Dt || Ye ? { identifier: Dt, traits: Ye ? Object.fromEntries(Object.entries(Ye).map(function(le) {
|
|
1074
|
+
return [le[0], { value: le[1] }];
|
|
1075
|
+
})) : {} } : S.identity, this.evaluationContext = S, this.api = L, this.headers = z, this.getFlagInterval = null, this.analyticsInterval = null, this.onChange = _, Ft = "Wrong Flagsmith Configuration: preventFetch is true and no defaulFlags provided", this._trigger = Ws || this._trigger, this._triggerLoadingState = $s || this._triggerLoadingState, this.onError = function(le) {
|
|
1076
|
+
ie.setLoadingState(i(i({}, ie.loadingState), { isFetching: !1, isLoading: !1, error: le })), oe == null || oe(le);
|
|
1077
|
+
}, this.enableLogs = ce || !1, this.cacheOptions = Qe ? { skipAPI: !!Qe.skipAPI, ttl: Qe.ttl || 0, loadStale: !!Qe.loadStale } : this.cacheOptions, !this.cacheOptions.ttl && this.cacheOptions.skipAPI && console.warn("Flagsmith: you have set a cache ttl of 0 and are skipping API calls, this means the API will not be hit unless you clear local storage."), se && (d = se), this.enableAnalytics = Xe || !1, this.flags = Object.assign({}, ee) || {}, this.datadogRum = Z || null, this.initialised = !0, this.ticks = 1e4, this.timer = this.enableLogs ? (/* @__PURE__ */ new Date()).valueOf() : null, this.cacheFlags = D !== void 0 && !!$, K && (D = K), Je && typeof window < "u" && this.setupRealtime(ne, S.environment.apiKey), Object.keys(this.flags).length && (this.loadingState = i(i({}, this.loadingState), { isLoading: !1, source: c.DEFAULT_FLAGS })), this.setState(zs), this.log("Initialising with properties", f, this), me && (typeof dtrum > "u" ? console.error("You have attempted to enable dynatrace but dtrum is undefined, please check you have the Dynatrace RUM JavaScript API installed.") : this.dtrum = dtrum), At && (d = /* @__PURE__ */ function(le) {
|
|
1078
1078
|
return function(ve, ye) {
|
|
1079
1079
|
var Ee = ye.headers, J = ye.method, Pe = ye.body;
|
|
1080
1080
|
return new Promise(function(Re) {
|
|
1081
1081
|
switch (J) {
|
|
1082
1082
|
case "GET":
|
|
1083
|
-
return
|
|
1083
|
+
return le.get(ve, { headers: Ee }).subscribe(function(ke) {
|
|
1084
1084
|
Re({ ok: !0, text: function() {
|
|
1085
1085
|
return Promise.resolve(ke);
|
|
1086
1086
|
} });
|
|
1087
1087
|
});
|
|
1088
1088
|
case "POST":
|
|
1089
1089
|
case "PUT":
|
|
1090
|
-
return
|
|
1090
|
+
return le.post(ve, Pe, { headers: Ee }).subscribe(function(ke) {
|
|
1091
1091
|
Re({ ok: !0, text: function() {
|
|
1092
1092
|
return Promise.resolve(ke);
|
|
1093
1093
|
} });
|
|
@@ -1095,14 +1095,14 @@ var hs = { exports: {} };
|
|
|
1095
1095
|
}
|
|
1096
1096
|
});
|
|
1097
1097
|
};
|
|
1098
|
-
}(At)), D && this.canUseStorage && D.getItem(A).then(function(
|
|
1098
|
+
}(At)), D && this.canUseStorage && D.getItem(A).then(function(le) {
|
|
1099
1099
|
try {
|
|
1100
|
-
ie.evaluationEvent = JSON.parse(
|
|
1100
|
+
ie.evaluationEvent = JSON.parse(le) || {};
|
|
1101
1101
|
} catch {
|
|
1102
1102
|
ie.evaluationEvent = {};
|
|
1103
1103
|
}
|
|
1104
1104
|
ie.analyticsInterval = setInterval(ie.analyticsFlags, ie.ticks);
|
|
1105
|
-
}), this.enableAnalytics && (this.analyticsInterval && clearInterval(this.analyticsInterval), D && this.canUseStorage && D.getItem(A, function(
|
|
1105
|
+
}), this.enableAnalytics && (this.analyticsInterval && clearInterval(this.analyticsInterval), D && this.canUseStorage && D.getItem(A, function(le, ve) {
|
|
1106
1106
|
if (ve && ie.evaluationContext.environment) {
|
|
1107
1107
|
var ye = JSON.parse(ve);
|
|
1108
1108
|
if (ye[ie.evaluationContext.environment.apiKey]) {
|
|
@@ -1114,7 +1114,7 @@ var hs = { exports: {} };
|
|
|
1114
1114
|
return [3, 9];
|
|
1115
1115
|
if (!D || !this.canUseStorage)
|
|
1116
1116
|
return [3, 8];
|
|
1117
|
-
qs = function(
|
|
1117
|
+
qs = function(le, ve) {
|
|
1118
1118
|
return r(ie, void 0, void 0, function() {
|
|
1119
1119
|
var ye, Ee, J, Pe, Re, ke, Lt, Gs, Pt, Bt, jt, Ut, Ht, zt, Wt, $t, qt, Vt, Gt, Kt, Xt, Jt, Yt, Qt;
|
|
1120
1120
|
return o(this, function(Ce) {
|
|
@@ -1124,9 +1124,9 @@ var hs = { exports: {} };
|
|
|
1124
1124
|
return [3, 7];
|
|
1125
1125
|
ye = null, Ee = null, Ce.label = 1;
|
|
1126
1126
|
case 1:
|
|
1127
|
-
return Ce.trys.push([1, 5, , 6]), J = JSON.parse(ve), Pe = !1, Re = !1, J && J.api === this.api && ((Bt = (Pt = J.evaluationContext) === null || Pt === void 0 ? void 0 : Pt.environment) === null || Bt === void 0 ? void 0 : Bt.apiKey) === ((jt = this.evaluationContext.environment) === null || jt === void 0 ? void 0 : jt.apiKey) && (ke = !0, this.evaluationContext.identity && ((Ht = (Ut = J.evaluationContext) === null || Ut === void 0 ? void 0 : Ut.identity) === null || Ht === void 0 ? void 0 : Ht.identifier) !== this.evaluationContext.identity.identifier && (this.log("Ignoring cache, identity has changed from " + ((Wt = (zt = J.evaluationContext) === null || zt === void 0 ? void 0 : zt.identity) === null || Wt === void 0 ? void 0 : Wt.identifier) + " to " + this.evaluationContext.identity.identifier), ke = !1), this.cacheOptions.ttl && (!J.ts || (/* @__PURE__ */ new Date()).valueOf() - J.ts > this.cacheOptions.ttl) && (J.ts && !this.cacheOptions.loadStale ? (this.log("Ignoring cache, timestamp is too old ts:" + J.ts + " ttl: " + this.cacheOptions.ttl + " time elapsed since cache: " + ((/* @__PURE__ */ new Date()).valueOf() - J.ts) + "ms"), ke = !1) : J.ts && this.cacheOptions.loadStale && (this.log("Loading stale cache, timestamp ts:" + J.ts + " ttl: " + this.cacheOptions.ttl + " time elapsed since cache: " + ((/* @__PURE__ */ new Date()).valueOf() - J.ts) + "ms"), Re = !0, ke = !0)), ke && (Pe = !0, Ee =
|
|
1127
|
+
return Ce.trys.push([1, 5, , 6]), J = JSON.parse(ve), Pe = !1, Re = !1, J && J.api === this.api && ((Bt = (Pt = J.evaluationContext) === null || Pt === void 0 ? void 0 : Pt.environment) === null || Bt === void 0 ? void 0 : Bt.apiKey) === ((jt = this.evaluationContext.environment) === null || jt === void 0 ? void 0 : jt.apiKey) && (ke = !0, this.evaluationContext.identity && ((Ht = (Ut = J.evaluationContext) === null || Ut === void 0 ? void 0 : Ut.identity) === null || Ht === void 0 ? void 0 : Ht.identifier) !== this.evaluationContext.identity.identifier && (this.log("Ignoring cache, identity has changed from " + ((Wt = (zt = J.evaluationContext) === null || zt === void 0 ? void 0 : zt.identity) === null || Wt === void 0 ? void 0 : Wt.identifier) + " to " + this.evaluationContext.identity.identifier), ke = !1), this.cacheOptions.ttl && (!J.ts || (/* @__PURE__ */ new Date()).valueOf() - J.ts > this.cacheOptions.ttl) && (J.ts && !this.cacheOptions.loadStale ? (this.log("Ignoring cache, timestamp is too old ts:" + J.ts + " ttl: " + this.cacheOptions.ttl + " time elapsed since cache: " + ((/* @__PURE__ */ new Date()).valueOf() - J.ts) + "ms"), ke = !1) : J.ts && this.cacheOptions.loadStale && (this.log("Loading stale cache, timestamp ts:" + J.ts + " ttl: " + this.cacheOptions.ttl + " time elapsed since cache: " + ((/* @__PURE__ */ new Date()).valueOf() - J.ts) + "ms"), Re = !0, ke = !0)), ke && (Pe = !0, Ee = h(($t = this.evaluationContext.identity) === null || $t === void 0 ? void 0 : $t.traits, (Vt = (qt = J.evaluationContext) === null || qt === void 0 ? void 0 : qt.identity) === null || Vt === void 0 ? void 0 : Vt.traits), ye = h(this.flags, J.flags), this.setState(i(i({}, J), { evaluationContext: b(i(i({}, J.evaluationContext), { identity: !((Gt = J.evaluationContext) === null || Gt === void 0) && Gt.identity ? i(i({}, (Kt = J.evaluationContext) === null || Kt === void 0 ? void 0 : Kt.identity), { traits: i(i({}, ((Jt = (Xt = J.evaluationContext) === null || Xt === void 0 ? void 0 : Xt.identity) === null || Jt === void 0 ? void 0 : Jt.traits) || {}), Ye || {}) }) : void 0 })) })), this.log("Retrieved flags from cache", J))), Pe ? (Lt = !ae && (!this.cacheOptions.skipAPI || Re), this._onChange(null, { isFromServer: !1, flagsChanged: ye, traitsChanged: Ee }, this._loadedState(null, c.CACHE, Lt)), this.oldFlags = this.flags, this.cacheOptions.skipAPI && Pe && !Re && this.log("Skipping API, using cache"), Lt && this.getFlags(), [3, 4]) : [3, 2];
|
|
1128
1128
|
case 2:
|
|
1129
|
-
return
|
|
1129
|
+
return ae ? [3, 4] : [4, this.getFlags()];
|
|
1130
1130
|
case 3:
|
|
1131
1131
|
Ce.sent(), Ce.label = 4;
|
|
1132
1132
|
case 4:
|
|
@@ -1136,16 +1136,16 @@ var hs = { exports: {} };
|
|
|
1136
1136
|
case 6:
|
|
1137
1137
|
return [3, 10];
|
|
1138
1138
|
case 7:
|
|
1139
|
-
return
|
|
1139
|
+
return ae ? [3, 9] : [4, this.getFlags()];
|
|
1140
1140
|
case 8:
|
|
1141
1141
|
return Ce.sent(), [3, 10];
|
|
1142
1142
|
case 9:
|
|
1143
1143
|
if (ee)
|
|
1144
|
-
this._onChange(null, { isFromServer: !1, flagsChanged:
|
|
1144
|
+
this._onChange(null, { isFromServer: !1, flagsChanged: h({}, this.flags), traitsChanged: h({}, (Yt = this.evaluationContext.identity) === null || Yt === void 0 ? void 0 : Yt.traits) }, this._loadedState(null, c.DEFAULT_FLAGS));
|
|
1145
1145
|
else {
|
|
1146
1146
|
if (!this.flags)
|
|
1147
1147
|
throw new Error(Ft);
|
|
1148
|
-
this._onChange(null, { isFromServer: !1, flagsChanged:
|
|
1148
|
+
this._onChange(null, { isFromServer: !1, flagsChanged: h({}, this.flags), traitsChanged: h({}, (Qt = this.evaluationContext.identity) === null || Qt === void 0 ? void 0 : Qt.traits) }, this._loadedState(null, c.DEFAULT_FLAGS));
|
|
1149
1149
|
}
|
|
1150
1150
|
Ce.label = 10;
|
|
1151
1151
|
case 10:
|
|
@@ -1168,13 +1168,13 @@ var hs = { exports: {} };
|
|
|
1168
1168
|
case 8:
|
|
1169
1169
|
return [3, 12];
|
|
1170
1170
|
case 9:
|
|
1171
|
-
return
|
|
1171
|
+
return ae ? [3, 11] : [4, this.getFlags()];
|
|
1172
1172
|
case 10:
|
|
1173
1173
|
return pe.sent(), [3, 12];
|
|
1174
1174
|
case 11:
|
|
1175
1175
|
if (ee)
|
|
1176
|
-
this._onChange(null, { isFromServer: !1, flagsChanged:
|
|
1177
|
-
else if (this.flags && (Ze = null, Object.keys(this.flags).length === 0 && (Ze = Ft), this._onChange(null, { isFromServer: !1, flagsChanged:
|
|
1176
|
+
this._onChange(null, { isFromServer: !1, flagsChanged: h({}, ee), traitsChanged: h({}, (u = S.identity) === null || u === void 0 ? void 0 : u.traits) }, this._loadedState(null, c.DEFAULT_FLAGS));
|
|
1177
|
+
else if (this.flags && (Ze = null, Object.keys(this.flags).length === 0 && (Ze = Ft), this._onChange(null, { isFromServer: !1, flagsChanged: h({}, this.flags), traitsChanged: h({}, (m = S.identity) === null || m === void 0 ? void 0 : m.traits) }, this._loadedState(Ze, c.DEFAULT_FLAGS)), Ze))
|
|
1178
1178
|
throw new Error(Ze);
|
|
1179
1179
|
pe.label = 12;
|
|
1180
1180
|
case 12:
|
|
@@ -1186,12 +1186,12 @@ var hs = { exports: {} };
|
|
|
1186
1186
|
}
|
|
1187
1187
|
});
|
|
1188
1188
|
});
|
|
1189
|
-
}, v.prototype._loadedState = function(f,
|
|
1190
|
-
return f === void 0 && (f = null), m === void 0 && (m = !1), { error: f, isFetching: m, isLoading: !1, source:
|
|
1189
|
+
}, v.prototype._loadedState = function(f, u, m) {
|
|
1190
|
+
return f === void 0 && (f = null), m === void 0 && (m = !1), { error: f, isFetching: m, isLoading: !1, source: u };
|
|
1191
1191
|
}, v.prototype.getAllFlags = function() {
|
|
1192
1192
|
return this.flags;
|
|
1193
|
-
}, v.prototype.identify = function(f,
|
|
1194
|
-
return this.evaluationContext.identity = { identifier: f, transient: m, traits: this.evaluationContext.identity && this.evaluationContext.identity.identifier == f ? this.evaluationContext.identity.traits : {} }, this.evaluationContext.identity.identifier = f, this.log("Identify: " + this.evaluationContext.identity.identifier),
|
|
1193
|
+
}, v.prototype.identify = function(f, u, m) {
|
|
1194
|
+
return this.evaluationContext.identity = { identifier: f, transient: m, traits: this.evaluationContext.identity && this.evaluationContext.identity.identifier == f ? this.evaluationContext.identity.traits : {} }, this.evaluationContext.identity.identifier = f, this.log("Identify: " + this.evaluationContext.identity.identifier), u && (this.evaluationContext.identity.traits = Object.fromEntries(Object.entries(u).map(function(g) {
|
|
1195
1195
|
var S = g[0], x = g[1];
|
|
1196
1196
|
return [S, y(x) ? x : { value: x }];
|
|
1197
1197
|
}))), this.initialised ? this.getFlags() : Promise.resolve();
|
|
@@ -1206,8 +1206,8 @@ var hs = { exports: {} };
|
|
|
1206
1206
|
}, v.prototype.stopListening = function() {
|
|
1207
1207
|
this.getFlagInterval && (clearInterval(this.getFlagInterval), this.getFlagInterval = null);
|
|
1208
1208
|
}, v.prototype.log = function() {
|
|
1209
|
-
for (var f = [],
|
|
1210
|
-
f[
|
|
1209
|
+
for (var f = [], u = 0; u < arguments.length; u++)
|
|
1210
|
+
f[u] = arguments[u];
|
|
1211
1211
|
this.enableLogs && console.log.apply(this, l(["FLAGSMITH:", (/* @__PURE__ */ new Date()).valueOf() - (this.timer || 0), "ms"], f, !0));
|
|
1212
1212
|
}, v.prototype.updateStorage = function() {
|
|
1213
1213
|
if (this.cacheFlags) {
|
|
@@ -1221,10 +1221,10 @@ var hs = { exports: {} };
|
|
|
1221
1221
|
D.setItem(A, f);
|
|
1222
1222
|
}
|
|
1223
1223
|
}, v.prototype.setLoadingState = function(f) {
|
|
1224
|
-
var
|
|
1225
|
-
a(f, this.loadingState) || (this.loadingState = i({}, f), this.log("Loading state changed", f), (
|
|
1226
|
-
}, v.prototype.setupRealtime = function(f,
|
|
1227
|
-
var m = this, g = f + "sse/environments/" +
|
|
1224
|
+
var u;
|
|
1225
|
+
a(f, this.loadingState) || (this.loadingState = i({}, f), this.log("Loading state changed", f), (u = this._triggerLoadingState) === null || u === void 0 || u.call(this));
|
|
1226
|
+
}, v.prototype.setupRealtime = function(f, u) {
|
|
1227
|
+
var m = this, g = f + "sse/environments/" + u + "/stream";
|
|
1228
1228
|
T ? this.eventSource || (this.log("Creating event source with url " + g), this.eventSource = new T(g), this.eventSource.addEventListener("environment_updated", function(S) {
|
|
1229
1229
|
var x;
|
|
1230
1230
|
try {
|
|
@@ -1237,37 +1237,37 @@ var hs = { exports: {} };
|
|
|
1237
1237
|
}, v;
|
|
1238
1238
|
}();
|
|
1239
1239
|
function E(v) {
|
|
1240
|
-
var f = v.fetch,
|
|
1241
|
-
return new C({ fetch: f, AsyncStorage:
|
|
1240
|
+
var f = v.fetch, u = v.AsyncStorage, m = v.eventSource;
|
|
1241
|
+
return new C({ fetch: f, AsyncStorage: u, eventSource: m });
|
|
1242
1242
|
}
|
|
1243
1243
|
var P, V = (P = function(v, f) {
|
|
1244
|
-
return P = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(
|
|
1245
|
-
|
|
1246
|
-
} || function(
|
|
1244
|
+
return P = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(u, m) {
|
|
1245
|
+
u.__proto__ = m;
|
|
1246
|
+
} || function(u, m) {
|
|
1247
1247
|
for (var g in m)
|
|
1248
|
-
Object.prototype.hasOwnProperty.call(m, g) && (
|
|
1248
|
+
Object.prototype.hasOwnProperty.call(m, g) && (u[g] = m[g]);
|
|
1249
1249
|
}, P(v, f);
|
|
1250
1250
|
}, function(v, f) {
|
|
1251
1251
|
if (typeof f != "function" && f !== null)
|
|
1252
1252
|
throw new TypeError("Class extends value " + String(f) + " is not a constructor or null");
|
|
1253
|
-
function
|
|
1253
|
+
function u() {
|
|
1254
1254
|
this.constructor = v;
|
|
1255
1255
|
}
|
|
1256
|
-
P(v, f), v.prototype = f === null ? Object.create(f) : (
|
|
1256
|
+
P(v, f), v.prototype = f === null ? Object.create(f) : (u.prototype = f.prototype, new u());
|
|
1257
1257
|
}), j = function(v) {
|
|
1258
|
-
var f = typeof Symbol == "function" && Symbol.iterator,
|
|
1259
|
-
if (
|
|
1260
|
-
return
|
|
1258
|
+
var f = typeof Symbol == "function" && Symbol.iterator, u = f && v[f], m = 0;
|
|
1259
|
+
if (u)
|
|
1260
|
+
return u.call(v);
|
|
1261
1261
|
if (v && typeof v.length == "number")
|
|
1262
1262
|
return { next: function() {
|
|
1263
1263
|
return v && m >= v.length && (v = void 0), { value: v && v[m++], done: !v };
|
|
1264
1264
|
} };
|
|
1265
1265
|
throw new TypeError(f ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
1266
1266
|
}, W = function(v, f) {
|
|
1267
|
-
var
|
|
1268
|
-
if (!
|
|
1267
|
+
var u = typeof Symbol == "function" && v[Symbol.iterator];
|
|
1268
|
+
if (!u)
|
|
1269
1269
|
return v;
|
|
1270
|
-
var m, g, S =
|
|
1270
|
+
var m, g, S = u.call(v), x = [];
|
|
1271
1271
|
try {
|
|
1272
1272
|
for (; (f === void 0 || f-- > 0) && !(m = S.next()).done; )
|
|
1273
1273
|
x.push(m.value);
|
|
@@ -1275,15 +1275,15 @@ var hs = { exports: {} };
|
|
|
1275
1275
|
g = { error: R };
|
|
1276
1276
|
} finally {
|
|
1277
1277
|
try {
|
|
1278
|
-
m && !m.done && (
|
|
1278
|
+
m && !m.done && (u = S.return) && u.call(S);
|
|
1279
1279
|
} finally {
|
|
1280
1280
|
if (g)
|
|
1281
1281
|
throw g.error;
|
|
1282
1282
|
}
|
|
1283
1283
|
}
|
|
1284
1284
|
return x;
|
|
1285
|
-
}, I = function(v, f,
|
|
1286
|
-
if (
|
|
1285
|
+
}, I = function(v, f, u) {
|
|
1286
|
+
if (u || arguments.length === 2)
|
|
1287
1287
|
for (var m, g = 0, S = f.length; g < S; g++)
|
|
1288
1288
|
!m && g in f || (m || (m = Array.prototype.slice.call(f, 0, g)), m[g] = f[g]);
|
|
1289
1289
|
return v.concat(m || Array.prototype.slice.call(f));
|
|
@@ -1294,9 +1294,9 @@ Consider loading an EventSource polyfill and making it available globally as Eve
|
|
|
1294
1294
|
}
|
|
1295
1295
|
return V(f, v), f;
|
|
1296
1296
|
}(Error), q = function() {
|
|
1297
|
-
function v(f,
|
|
1297
|
+
function v(f, u) {
|
|
1298
1298
|
var m = this;
|
|
1299
|
-
if (this.CONNECTING = 0, this.OPEN = 1, this.CLOSED = 2, this._configuration =
|
|
1299
|
+
if (this.CONNECTING = 0, this.OPEN = 1, this.CLOSED = 2, this._configuration = u != null ? Object.assign({}, u) : void 0, this.withCredentials = !1, this._eventSource = null, this._lastEventId = null, this._timer = null, this._listeners = { open: [], error: [], message: [] }, this.url = f.toString(), this.readyState = this.CONNECTING, this.max_retry_time = 3e3, this.eventSourceClass = globalThis.FlagsmithEventSource, this._configuration != null && (this._configuration.lastEventId && (this._lastEventId = this._configuration.lastEventId, delete this._configuration.lastEventId), this._configuration.max_retry_time && (this.max_retry_time = this._configuration.max_retry_time, delete this._configuration.max_retry_time), this._configuration.eventSourceClass && (this.eventSourceClass = this._configuration.eventSourceClass, delete this._configuration.eventSourceClass)), this.eventSourceClass == null || typeof this.eventSourceClass != "function")
|
|
1300
1300
|
throw new M();
|
|
1301
1301
|
this._onevent_wrapped = function(g) {
|
|
1302
1302
|
m._onevent(g);
|
|
@@ -1305,7 +1305,7 @@ Consider loading an EventSource polyfill and making it available globally as Eve
|
|
|
1305
1305
|
return v.prototype.dispatchEvent = function(f) {
|
|
1306
1306
|
throw new Error("Method not implemented.");
|
|
1307
1307
|
}, v.prototype._start = function() {
|
|
1308
|
-
var f,
|
|
1308
|
+
var f, u, m = this, g = this.url;
|
|
1309
1309
|
this._lastEventId && (g.indexOf("?") === -1 ? g += "?" : g += "&", g += "lastEventId=" + encodeURIComponent(this._lastEventId)), this._eventSource = new this.eventSourceClass(g, this._configuration), this._eventSource.onopen = function(L) {
|
|
1310
1310
|
m._onopen(L);
|
|
1311
1311
|
}, this._eventSource.onerror = function(L) {
|
|
@@ -1322,7 +1322,7 @@ Consider loading an EventSource polyfill and making it available globally as Eve
|
|
|
1322
1322
|
f = { error: L };
|
|
1323
1323
|
} finally {
|
|
1324
1324
|
try {
|
|
1325
|
-
x && !x.done && (
|
|
1325
|
+
x && !x.done && (u = S.return) && u.call(S);
|
|
1326
1326
|
} finally {
|
|
1327
1327
|
if (f)
|
|
1328
1328
|
throw f.error;
|
|
@@ -1331,16 +1331,16 @@ Consider loading an EventSource polyfill and making it available globally as Eve
|
|
|
1331
1331
|
}, v.prototype._onopen = function(f) {
|
|
1332
1332
|
this.readyState === 0 && (this.readyState = 1, this.onopen(f));
|
|
1333
1333
|
}, v.prototype._onerror = function(f) {
|
|
1334
|
-
var
|
|
1334
|
+
var u = this;
|
|
1335
1335
|
if (this.readyState === 1 && (this.readyState = 0, this.onerror(f)), this._eventSource) {
|
|
1336
1336
|
this._eventSource.close(), this._eventSource = null;
|
|
1337
1337
|
var m = Math.round(this.max_retry_time * Math.random());
|
|
1338
1338
|
this._timer = setTimeout(function() {
|
|
1339
|
-
return
|
|
1339
|
+
return u._start();
|
|
1340
1340
|
}, m);
|
|
1341
1341
|
}
|
|
1342
1342
|
}, v.prototype._onevent = function(f) {
|
|
1343
|
-
var
|
|
1343
|
+
var u, m;
|
|
1344
1344
|
f && f.lastEventId && (this._lastEventId = f.lastEventId);
|
|
1345
1345
|
var g = this._listeners[f.type];
|
|
1346
1346
|
if (g != null)
|
|
@@ -1348,13 +1348,13 @@ Consider loading an EventSource polyfill and making it available globally as Eve
|
|
|
1348
1348
|
for (var S = j(I([], W(g), !1)), x = S.next(); !x.done; x = S.next())
|
|
1349
1349
|
x.value.call(this, f);
|
|
1350
1350
|
} catch (R) {
|
|
1351
|
-
|
|
1351
|
+
u = { error: R };
|
|
1352
1352
|
} finally {
|
|
1353
1353
|
try {
|
|
1354
1354
|
x && !x.done && (m = S.return) && m.call(S);
|
|
1355
1355
|
} finally {
|
|
1356
|
-
if (
|
|
1357
|
-
throw
|
|
1356
|
+
if (u)
|
|
1357
|
+
throw u.error;
|
|
1358
1358
|
}
|
|
1359
1359
|
}
|
|
1360
1360
|
f.type === "message" && this.onmessage(f);
|
|
@@ -1363,20 +1363,20 @@ Consider loading an EventSource polyfill and making it available globally as Eve
|
|
|
1363
1363
|
}, v.prototype.onmessage = function(f) {
|
|
1364
1364
|
}, v.prototype.close = function() {
|
|
1365
1365
|
this._timer && (clearTimeout(this._timer), this._timer = null), this._eventSource && (this._eventSource.close(), this._eventSource = null), this.readyState = 2;
|
|
1366
|
-
}, v.prototype.addEventListener = function(f,
|
|
1366
|
+
}, v.prototype.addEventListener = function(f, u, m) {
|
|
1367
1367
|
this._listeners[f] == null && (this._listeners[f] = [], this._eventSource != null && this._eventSource.addEventListener(f, this._onevent_wrapped));
|
|
1368
1368
|
var g = this._listeners[f];
|
|
1369
|
-
g.includes(
|
|
1370
|
-
}, v.prototype.removeEventListener = function(f,
|
|
1369
|
+
g.includes(u) || (this._listeners[f] = I(I([], W(g), !1), [u], !1));
|
|
1370
|
+
}, v.prototype.removeEventListener = function(f, u, m) {
|
|
1371
1371
|
var g = this._listeners[f];
|
|
1372
1372
|
this._listeners[f] = g.filter(function(S) {
|
|
1373
|
-
return S !==
|
|
1373
|
+
return S !== u;
|
|
1374
1374
|
});
|
|
1375
1375
|
}, v;
|
|
1376
1376
|
}();
|
|
1377
1377
|
globalThis.FlagsmithEventSource = typeof EventSource < "u" ? EventSource : null;
|
|
1378
1378
|
var G = function(v, f) {
|
|
1379
|
-
return f = f || {}, new Promise(function(
|
|
1379
|
+
return f = f || {}, new Promise(function(u, m) {
|
|
1380
1380
|
var g = new XMLHttpRequest(), S = [], x = [], R = {}, L = function() {
|
|
1381
1381
|
return { ok: (g.status / 100 | 0) == 2, statusText: g.statusText, status: g.status, url: g.responseURL, text: function() {
|
|
1382
1382
|
return Promise.resolve(g.responseText);
|
|
@@ -1397,7 +1397,7 @@ Consider loading an EventSource polyfill and making it available globally as Eve
|
|
|
1397
1397
|
for (var z in g.open(f.method || "get", v, !0), g.onload = function() {
|
|
1398
1398
|
g.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm, function(_, $, Z) {
|
|
1399
1399
|
S.push($ = $.toLowerCase()), x.push([$, Z]), R[$] = R[$] ? R[$] + "," + Z : Z;
|
|
1400
|
-
}),
|
|
1400
|
+
}), u(L());
|
|
1401
1401
|
}, g.onerror = m, g.withCredentials = f.credentials == "include", f.headers)
|
|
1402
1402
|
g.setRequestHeader(z, f.headers[z]);
|
|
1403
1403
|
g.send(f.body || null);
|
|
@@ -1407,8 +1407,8 @@ Consider loading an EventSource polyfill and making it available globally as Eve
|
|
|
1407
1407
|
return E({ AsyncStorage: n, fetch: G, eventSource: q });
|
|
1408
1408
|
}, s.default = H, Object.defineProperty(s, "__esModule", { value: !0 });
|
|
1409
1409
|
});
|
|
1410
|
-
})(
|
|
1411
|
-
var Hi =
|
|
1410
|
+
})(us, us.exports);
|
|
1411
|
+
var Hi = us.exports;
|
|
1412
1412
|
const Jn = /* @__PURE__ */ Xn(Hi);
|
|
1413
1413
|
var Ks = {}, zi = function(t, e, s, n, i) {
|
|
1414
1414
|
var r = new Worker(Ks[e] || (Ks[e] = URL.createObjectURL(new Blob([
|
|
@@ -1417,12 +1417,12 @@ var Ks = {}, zi = function(t, e, s, n, i) {
|
|
|
1417
1417
|
return r.onmessage = function(o) {
|
|
1418
1418
|
var l = o.data, a = l.$e$;
|
|
1419
1419
|
if (a) {
|
|
1420
|
-
var
|
|
1421
|
-
|
|
1420
|
+
var h = new Error(a[0]);
|
|
1421
|
+
h.code = a[1], h.stack = a[2], i(h, null);
|
|
1422
1422
|
} else
|
|
1423
1423
|
i(null, l);
|
|
1424
1424
|
}, r.postMessage(s, n), r;
|
|
1425
|
-
}, fe = Uint8Array,
|
|
1425
|
+
}, fe = Uint8Array, re = Uint16Array, It = Int32Array, _t = new fe([
|
|
1426
1426
|
0,
|
|
1427
1427
|
0,
|
|
1428
1428
|
0,
|
|
@@ -1492,7 +1492,7 @@ var Ks = {}, zi = function(t, e, s, n, i) {
|
|
|
1492
1492
|
0,
|
|
1493
1493
|
0
|
|
1494
1494
|
]), ds = new fe([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]), Yn = function(t, e) {
|
|
1495
|
-
for (var s = new
|
|
1495
|
+
for (var s = new re(31), n = 0; n < 31; ++n)
|
|
1496
1496
|
s[n] = e += 1 << t[n - 1];
|
|
1497
1497
|
for (var i = new It(s[30]), n = 1; n < 30; ++n)
|
|
1498
1498
|
for (var r = s[n]; r < s[n + 1]; ++r)
|
|
@@ -1500,27 +1500,27 @@ var Ks = {}, zi = function(t, e, s, n, i) {
|
|
|
1500
1500
|
return { b: s, r: i };
|
|
1501
1501
|
}, Qn = Yn(_t, 2), Wi = Qn.b, vt = Qn.r;
|
|
1502
1502
|
Wi[28] = 258, vt[258] = 28;
|
|
1503
|
-
var $i = Yn(Ot, 0), fs = $i.r, yt = new
|
|
1503
|
+
var $i = Yn(Ot, 0), fs = $i.r, yt = new re(32768);
|
|
1504
1504
|
for (var X = 0; X < 32768; ++X) {
|
|
1505
1505
|
var Ie = (X & 43690) >> 1 | (X & 21845) << 1;
|
|
1506
1506
|
Ie = (Ie & 52428) >> 2 | (Ie & 13107) << 2, Ie = (Ie & 61680) >> 4 | (Ie & 3855) << 4, yt[X] = ((Ie & 65280) >> 8 | (Ie & 255) << 8) >> 1;
|
|
1507
1507
|
}
|
|
1508
1508
|
var qe = function(t, e, s) {
|
|
1509
|
-
for (var n = t.length, i = 0, r = new
|
|
1509
|
+
for (var n = t.length, i = 0, r = new re(e); i < n; ++i)
|
|
1510
1510
|
t[i] && ++r[t[i] - 1];
|
|
1511
|
-
var o = new
|
|
1511
|
+
var o = new re(e);
|
|
1512
1512
|
for (i = 1; i < e; ++i)
|
|
1513
1513
|
o[i] = o[i - 1] + r[i - 1] << 1;
|
|
1514
1514
|
var l;
|
|
1515
1515
|
if (s) {
|
|
1516
|
-
l = new
|
|
1516
|
+
l = new re(1 << e);
|
|
1517
1517
|
var a = 15 - e;
|
|
1518
1518
|
for (i = 0; i < n; ++i)
|
|
1519
1519
|
if (t[i])
|
|
1520
|
-
for (var
|
|
1521
|
-
l[yt[d] >> a] =
|
|
1520
|
+
for (var h = i << 4 | t[i], c = e - t[i], d = o[t[i] - 1]++ << c, p = d | (1 << c) - 1; d <= p; ++d)
|
|
1521
|
+
l[yt[d] >> a] = h;
|
|
1522
1522
|
} else
|
|
1523
|
-
for (l = new
|
|
1523
|
+
for (l = new re(n), i = 0; i < n; ++i)
|
|
1524
1524
|
t[i] && (l[i] = yt[o[t[i] - 1]++] >> 15 - t[i]);
|
|
1525
1525
|
return l;
|
|
1526
1526
|
}, Ne = new fe(288);
|
|
@@ -1568,7 +1568,7 @@ var Zn = /* @__PURE__ */ qe(Ne, 9, 0), ei = /* @__PURE__ */ qe(nt, 5, 0), Os = f
|
|
|
1568
1568
|
s <<= e & 7;
|
|
1569
1569
|
var n = e / 8 | 0;
|
|
1570
1570
|
t[n] |= s, t[n + 1] |= s >> 8, t[n + 2] |= s >> 16;
|
|
1571
|
-
},
|
|
1571
|
+
}, ut = function(t, e) {
|
|
1572
1572
|
for (var s = [], n = 0; n < t.length; ++n)
|
|
1573
1573
|
t[n] && s.push({ s: n, f: t[n] });
|
|
1574
1574
|
var i = s.length, r = s.slice();
|
|
@@ -1581,12 +1581,12 @@ var Zn = /* @__PURE__ */ qe(Ne, 9, 0), ei = /* @__PURE__ */ qe(nt, 5, 0), Os = f
|
|
|
1581
1581
|
s.sort(function(O, N) {
|
|
1582
1582
|
return O.f - N.f;
|
|
1583
1583
|
}), s.push({ s: -1, f: 25001 });
|
|
1584
|
-
var l = s[0], a = s[1],
|
|
1584
|
+
var l = s[0], a = s[1], h = 0, c = 1, d = 2;
|
|
1585
1585
|
for (s[0] = { s: -1, f: l.f + a.f, l, r: a }; c != i - 1; )
|
|
1586
|
-
l = s[s[
|
|
1586
|
+
l = s[s[h].f < s[d].f ? h++ : d++], a = s[h != c && s[h].f < s[d].f ? h++ : d++], s[c++] = { s: -1, f: l.f + a.f, l, r: a };
|
|
1587
1587
|
for (var p = r[0].s, n = 1; n < i; ++n)
|
|
1588
1588
|
r[n].s > p && (p = r[n].s);
|
|
1589
|
-
var y = new
|
|
1589
|
+
var y = new re(p + 1), w = bt(s[c - 1], y, 0);
|
|
1590
1590
|
if (w > e) {
|
|
1591
1591
|
var n = 0, b = 0, T = w - e, D = 1 << T;
|
|
1592
1592
|
for (r.sort(function(N, F) {
|
|
@@ -1614,7 +1614,7 @@ var Zn = /* @__PURE__ */ qe(Ne, 9, 0), ei = /* @__PURE__ */ qe(nt, 5, 0), Os = f
|
|
|
1614
1614
|
}, ps = function(t) {
|
|
1615
1615
|
for (var e = t.length; e && !t[--e]; )
|
|
1616
1616
|
;
|
|
1617
|
-
for (var s = new
|
|
1617
|
+
for (var s = new re(++e), n = 0, i = t[0], r = 1, o = function(a) {
|
|
1618
1618
|
s[n++] = a;
|
|
1619
1619
|
}, l = 1; l <= e; ++l)
|
|
1620
1620
|
if (t[l] == i && l != e)
|
|
@@ -1644,17 +1644,17 @@ var Zn = /* @__PURE__ */ qe(Ne, 9, 0), ei = /* @__PURE__ */ qe(nt, 5, 0), Os = f
|
|
|
1644
1644
|
for (var r = 0; r < n; ++r)
|
|
1645
1645
|
t[i + r + 4] = s[r];
|
|
1646
1646
|
return (i + 4 + n) * 8;
|
|
1647
|
-
}, gs = function(t, e, s, n, i, r, o, l, a,
|
|
1647
|
+
}, gs = function(t, e, s, n, i, r, o, l, a, h, c) {
|
|
1648
1648
|
be(e, c++, s), ++i[256];
|
|
1649
|
-
for (var d =
|
|
1649
|
+
for (var d = ut(i, 15), p = d.t, y = d.l, w = ut(r, 15), b = w.t, T = w.l, D = ps(p), B = D.c, A = D.n, k = ps(b), O = k.c, N = k.n, F = new re(19), C = 0; C < B.length; ++C)
|
|
1650
1650
|
++F[B[C] & 31];
|
|
1651
1651
|
for (var C = 0; C < O.length; ++C)
|
|
1652
1652
|
++F[O[C] & 31];
|
|
1653
|
-
for (var E =
|
|
1653
|
+
for (var E = ut(F, 7), P = E.t, V = E.l, j = 19; j > 4 && !P[ds[j - 1]]; --j)
|
|
1654
1654
|
;
|
|
1655
|
-
var W =
|
|
1655
|
+
var W = h + 5 << 3, I = ze(i, Ne) + ze(r, nt) + o, M = ze(i, p) + ze(r, b) + o + 14 + 3 * j + ze(F, P) + 2 * F[16] + 3 * F[17] + 7 * F[18];
|
|
1656
1656
|
if (a >= 0 && W <= I && W <= M)
|
|
1657
|
-
return Ns(e, c, t.subarray(a, a +
|
|
1657
|
+
return Ns(e, c, t.subarray(a, a + h));
|
|
1658
1658
|
var q, G, H, v;
|
|
1659
1659
|
if (be(e, c, 1 + (M < I)), c += 2, M < I) {
|
|
1660
1660
|
q = qe(p, y, 0), G = p, H = qe(b, T, 0), v = b;
|
|
@@ -1663,8 +1663,8 @@ var Zn = /* @__PURE__ */ qe(Ne, 9, 0), ei = /* @__PURE__ */ qe(nt, 5, 0), Os = f
|
|
|
1663
1663
|
for (var C = 0; C < j; ++C)
|
|
1664
1664
|
be(e, c + 3 * C, P[ds[C]]);
|
|
1665
1665
|
c += 3 * j;
|
|
1666
|
-
for (var
|
|
1667
|
-
for (var g =
|
|
1666
|
+
for (var u = [B, O], m = 0; m < 2; ++m)
|
|
1667
|
+
for (var g = u[m], C = 0; C < g.length; ++C) {
|
|
1668
1668
|
var S = g[C] & 31;
|
|
1669
1669
|
be(e, c, f[S]), c += P[S], S > 15 && (be(e, c, g[C] >> 5 & 127), c += g[C] >> 12);
|
|
1670
1670
|
}
|
|
@@ -1682,54 +1682,54 @@ var Zn = /* @__PURE__ */ qe(Ne, 9, 0), ei = /* @__PURE__ */ qe(nt, 5, 0), Os = f
|
|
|
1682
1682
|
}
|
|
1683
1683
|
return He(e, c, q[256]), c + G[256];
|
|
1684
1684
|
}, ni = /* @__PURE__ */ new It([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]), Rs = /* @__PURE__ */ new fe(0), ii = function(t, e, s, n, i, r) {
|
|
1685
|
-
var o = r.z || t.length, l = new fe(n + o + 5 * (1 + Math.ceil(o / 7e3)) + i), a = l.subarray(n, l.length - i),
|
|
1685
|
+
var o = r.z || t.length, l = new fe(n + o + 5 * (1 + Math.ceil(o / 7e3)) + i), a = l.subarray(n, l.length - i), h = r.l, c = (r.r || 0) & 7;
|
|
1686
1686
|
if (e) {
|
|
1687
1687
|
c && (a[0] = r.r >> 3);
|
|
1688
|
-
for (var d = ni[e - 1], p = d >> 13, y = d & 8191, w = (1 << s) - 1, b = r.p || new
|
|
1688
|
+
for (var d = ni[e - 1], p = d >> 13, y = d & 8191, w = (1 << s) - 1, b = r.p || new re(32768), T = r.h || new re(w + 1), D = Math.ceil(s / 3), B = 2 * D, A = function(se) {
|
|
1689
1689
|
return (t[se] ^ t[se + 1] << D ^ t[se + 2] << B) & w;
|
|
1690
|
-
}, k = new It(25e3), O = new
|
|
1690
|
+
}, k = new It(25e3), O = new re(288), N = new re(32), F = 0, C = 0, E = r.i || 0, P = 0, V = r.w || 0, j = 0; E + 2 < o; ++E) {
|
|
1691
1691
|
var W = A(E), I = E & 32767, M = T[W];
|
|
1692
1692
|
if (b[I] = M, T[W] = I, V <= E) {
|
|
1693
1693
|
var q = o - E;
|
|
1694
|
-
if ((F > 7e3 || P > 24576) && (q > 423 || !
|
|
1694
|
+
if ((F > 7e3 || P > 24576) && (q > 423 || !h)) {
|
|
1695
1695
|
c = gs(t, a, 0, k, O, N, C, P, j, E - j, c), P = F = C = 0, j = E;
|
|
1696
1696
|
for (var G = 0; G < 286; ++G)
|
|
1697
1697
|
O[G] = 0;
|
|
1698
1698
|
for (var G = 0; G < 30; ++G)
|
|
1699
1699
|
N[G] = 0;
|
|
1700
1700
|
}
|
|
1701
|
-
var H = 2, v = 0, f = y,
|
|
1702
|
-
if (q > 2 && W == A(E -
|
|
1703
|
-
for (var m = Math.min(p, q) - 1, g = Math.min(32767, E), S = Math.min(258, q);
|
|
1704
|
-
if (t[E + H] == t[E + H -
|
|
1705
|
-
for (var x = 0; x < S && t[E + x] == t[E + x -
|
|
1701
|
+
var H = 2, v = 0, f = y, u = I - M & 32767;
|
|
1702
|
+
if (q > 2 && W == A(E - u))
|
|
1703
|
+
for (var m = Math.min(p, q) - 1, g = Math.min(32767, E), S = Math.min(258, q); u <= g && --f && I != M; ) {
|
|
1704
|
+
if (t[E + H] == t[E + H - u]) {
|
|
1705
|
+
for (var x = 0; x < S && t[E + x] == t[E + x - u]; ++x)
|
|
1706
1706
|
;
|
|
1707
1707
|
if (x > H) {
|
|
1708
|
-
if (H = x, v =
|
|
1708
|
+
if (H = x, v = u, x > m)
|
|
1709
1709
|
break;
|
|
1710
|
-
for (var R = Math.min(
|
|
1711
|
-
var z = E -
|
|
1710
|
+
for (var R = Math.min(u, x - 2), L = 0, G = 0; G < R; ++G) {
|
|
1711
|
+
var z = E - u + G & 32767, _ = b[z], $ = z - _ & 32767;
|
|
1712
1712
|
$ > L && (L = $, M = z);
|
|
1713
1713
|
}
|
|
1714
1714
|
}
|
|
1715
1715
|
}
|
|
1716
|
-
I = M, M = b[I],
|
|
1716
|
+
I = M, M = b[I], u += I - M & 32767;
|
|
1717
1717
|
}
|
|
1718
1718
|
if (v) {
|
|
1719
1719
|
k[P++] = 268435456 | vt[H] << 18 | fs[v];
|
|
1720
|
-
var Z = vt[H] & 31,
|
|
1721
|
-
C += _t[Z] + Ot[
|
|
1720
|
+
var Z = vt[H] & 31, oe = fs[v] & 31;
|
|
1721
|
+
C += _t[Z] + Ot[oe], ++O[257 + Z], ++N[oe], V = E + H, ++F;
|
|
1722
1722
|
} else
|
|
1723
1723
|
k[P++] = t[E], ++O[t[E]];
|
|
1724
1724
|
}
|
|
1725
1725
|
}
|
|
1726
1726
|
for (E = Math.max(E, V); E < o; ++E)
|
|
1727
1727
|
k[P++] = t[E], ++O[t[E]];
|
|
1728
|
-
c = gs(t, a,
|
|
1728
|
+
c = gs(t, a, h, k, O, N, C, P, j, E - j, c), h || (r.r = c & 7 | a[c / 8 | 0] << 3, c -= 7, r.h = T, r.p = b, r.i = E, r.w = V);
|
|
1729
1729
|
} else {
|
|
1730
|
-
for (var E = r.w || 0; E < o +
|
|
1730
|
+
for (var E = r.w || 0; E < o + h; E += 65535) {
|
|
1731
1731
|
var ee = E + 65535;
|
|
1732
|
-
ee >= o && (a[c / 8 | 0] =
|
|
1732
|
+
ee >= o && (a[c / 8 | 0] = h, ee = o), c = Ns(a, c + 1, t.subarray(E, ee));
|
|
1733
1733
|
}
|
|
1734
1734
|
r.i = o;
|
|
1735
1735
|
}
|
|
@@ -1771,18 +1771,18 @@ var Zn = /* @__PURE__ */ qe(Ne, 9, 0), ei = /* @__PURE__ */ qe(nt, 5, 0), Os = f
|
|
|
1771
1771
|
var l = n[o], a = r[o];
|
|
1772
1772
|
if (typeof l == "function") {
|
|
1773
1773
|
e += ";" + a + "=";
|
|
1774
|
-
var
|
|
1774
|
+
var h = l.toString();
|
|
1775
1775
|
if (l.prototype)
|
|
1776
|
-
if (
|
|
1777
|
-
var c =
|
|
1778
|
-
e +=
|
|
1776
|
+
if (h.indexOf("[native code]") != -1) {
|
|
1777
|
+
var c = h.indexOf(" ", 8) + 1;
|
|
1778
|
+
e += h.slice(c, h.indexOf("(", c));
|
|
1779
1779
|
} else {
|
|
1780
|
-
e +=
|
|
1780
|
+
e += h;
|
|
1781
1781
|
for (var d in l.prototype)
|
|
1782
1782
|
e += ";" + a + ".prototype." + d + "=" + l.prototype[d].toString();
|
|
1783
1783
|
}
|
|
1784
1784
|
else
|
|
1785
|
-
e +=
|
|
1785
|
+
e += h;
|
|
1786
1786
|
} else
|
|
1787
1787
|
s[a] = l;
|
|
1788
1788
|
}
|
|
@@ -1801,7 +1801,7 @@ var Zn = /* @__PURE__ */ qe(Ne, 9, 0), ei = /* @__PURE__ */ qe(nt, 5, 0), Os = f
|
|
|
1801
1801
|
var a = Vi({}, it[s].e);
|
|
1802
1802
|
return zi(it[s].c + ";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage=" + e.toString() + "}", s, a, Gi(a), n);
|
|
1803
1803
|
}, Xi = function() {
|
|
1804
|
-
return [fe,
|
|
1804
|
+
return [fe, re, It, _t, Ot, ds, vt, fs, Zn, Ne, ei, nt, yt, ni, Rs, qe, be, He, ut, bt, ps, ze, Ns, gs, Os, ti, ii, Ds, Qi, ai];
|
|
1805
1805
|
}, Ji = function() {
|
|
1806
1806
|
return [ci, li, St, oi, ri];
|
|
1807
1807
|
}, ai = function(t) {
|
|
@@ -1910,15 +1910,15 @@ class nr {
|
|
|
1910
1910
|
}), { conditions: i } = await n.json(), r = [];
|
|
1911
1911
|
i.forEach((o) => {
|
|
1912
1912
|
o.filters.forEach((a) => {
|
|
1913
|
-
let
|
|
1914
|
-
a.type === "fetch" ? (
|
|
1913
|
+
let h;
|
|
1914
|
+
a.type === "fetch" ? (h = {
|
|
1915
1915
|
type: "network_request",
|
|
1916
1916
|
subConditions: [],
|
|
1917
1917
|
name: o.name
|
|
1918
1918
|
}, a.filters.forEach((c) => {
|
|
1919
1919
|
const d = this.createConditionFromFilter(c);
|
|
1920
|
-
d &&
|
|
1921
|
-
})) :
|
|
1920
|
+
d && h.subConditions.push(d);
|
|
1921
|
+
})) : h = this.createConditionFromFilter(a), h && (h.type === "session_duration" && this.processDuration(h.value[0], o.name), r.push({ ...h, name: o.name }));
|
|
1922
1922
|
});
|
|
1923
1923
|
}), this.conditions = r;
|
|
1924
1924
|
} catch {
|
|
@@ -2187,8 +2187,8 @@ class rr {
|
|
|
2187
2187
|
body: JSON.stringify(o)
|
|
2188
2188
|
});
|
|
2189
2189
|
if (a.status === 200) {
|
|
2190
|
-
const
|
|
2191
|
-
return this.handleFlags(
|
|
2190
|
+
const h = await a.json();
|
|
2191
|
+
return this.handleFlags(h.flags);
|
|
2192
2192
|
}
|
|
2193
2193
|
}
|
|
2194
2194
|
handleFlags(e) {
|
|
@@ -2222,10 +2222,10 @@ function Ge() {
|
|
|
2222
2222
|
return As;
|
|
2223
2223
|
}
|
|
2224
2224
|
const ge = xe && performance.now ? () => Math.round(performance.now() + As) : () => Date.now(), es = "repeat" in String.prototype ? (t) => "*".repeat(t.length) : (t) => t.replace(/./g, "*");
|
|
2225
|
-
function
|
|
2225
|
+
function hi(t) {
|
|
2226
2226
|
return t.trim().replace(/\s+/g, " ");
|
|
2227
2227
|
}
|
|
2228
|
-
function
|
|
2228
|
+
function ui(t) {
|
|
2229
2229
|
return t.startsWith("https://") || t.startsWith("http://");
|
|
2230
2230
|
}
|
|
2231
2231
|
const wt = "https://docs.openreplay.com", Zs = {};
|
|
@@ -2259,7 +2259,7 @@ function lr(t) {
|
|
|
2259
2259
|
const e = new Uint8Array((t || 40) / 2), s = window.crypto || window.msCrypto;
|
|
2260
2260
|
return s ? (s.getRandomValues(e), Array.from(e, en).join("")) : Array.from({ length: t || 40 }, () => en(Math.floor(Math.random() * 16))).join("");
|
|
2261
2261
|
}
|
|
2262
|
-
function
|
|
2262
|
+
function hr() {
|
|
2263
2263
|
try {
|
|
2264
2264
|
return window.self && window.top && window.self !== window.top;
|
|
2265
2265
|
} catch {
|
|
@@ -2300,7 +2300,7 @@ function pi(t, e, s, n) {
|
|
|
2300
2300
|
);
|
|
2301
2301
|
}
|
|
2302
2302
|
}
|
|
2303
|
-
class
|
|
2303
|
+
class ur {
|
|
2304
2304
|
constructor() {
|
|
2305
2305
|
this.taskQueue = [], this.isRunning = !1;
|
|
2306
2306
|
}
|
|
@@ -2326,7 +2326,7 @@ class hr {
|
|
|
2326
2326
|
e();
|
|
2327
2327
|
}
|
|
2328
2328
|
}
|
|
2329
|
-
const dr = new
|
|
2329
|
+
const dr = new ur();
|
|
2330
2330
|
function fr(t) {
|
|
2331
2331
|
dr.addTask(t);
|
|
2332
2332
|
}
|
|
@@ -2684,7 +2684,7 @@ function Wr(t) {
|
|
|
2684
2684
|
t
|
|
2685
2685
|
];
|
|
2686
2686
|
}
|
|
2687
|
-
function vi(t, e, s, n, i, r, o, l, a,
|
|
2687
|
+
function vi(t, e, s, n, i, r, o, l, a, h) {
|
|
2688
2688
|
return [
|
|
2689
2689
|
116,
|
|
2690
2690
|
t,
|
|
@@ -2696,7 +2696,7 @@ function vi(t, e, s, n, i, r, o, l, a, u) {
|
|
|
2696
2696
|
o,
|
|
2697
2697
|
l,
|
|
2698
2698
|
a,
|
|
2699
|
-
|
|
2699
|
+
h
|
|
2700
2700
|
];
|
|
2701
2701
|
}
|
|
2702
2702
|
function dt(t) {
|
|
@@ -2872,7 +2872,7 @@ const Xr = {
|
|
|
2872
2872
|
fontWeight: "500",
|
|
2873
2873
|
lineHeight: "1.5rem",
|
|
2874
2874
|
cursor: "pointer"
|
|
2875
|
-
},
|
|
2875
|
+
}, hn = {
|
|
2876
2876
|
fontFamily: "Verdana, sans-serif",
|
|
2877
2877
|
fontSize: "13px",
|
|
2878
2878
|
fontWeight: "500",
|
|
@@ -2923,7 +2923,7 @@ const Xr = {
|
|
|
2923
2923
|
flexDirection: "column",
|
|
2924
2924
|
alignItems: "center",
|
|
2925
2925
|
gap: "0.625rem"
|
|
2926
|
-
},
|
|
2926
|
+
}, un = {
|
|
2927
2927
|
fontSize: "1.25rem",
|
|
2928
2928
|
fontWeight: "500",
|
|
2929
2929
|
cursor: "pointer",
|
|
@@ -3100,12 +3100,12 @@ function lo(t, e) {
|
|
|
3100
3100
|
e.onmousedown = function(s) {
|
|
3101
3101
|
const n = t.getBoundingClientRect(), i = s.clientX - n.left, r = s.clientY - n.top;
|
|
3102
3102
|
t.style.position = "fixed", t.style.zIndex = 99999999999999, o(s.pageX, s.pageY);
|
|
3103
|
-
function o(
|
|
3104
|
-
let d =
|
|
3103
|
+
function o(h, c) {
|
|
3104
|
+
let d = h - i, p = c - r;
|
|
3105
3105
|
d <= 5 && (d = 5), p <= 5 && (p = 5), d >= window.innerWidth - n.width && (d = window.innerWidth - n.width), p >= window.innerHeight - n.height && (p = window.innerHeight - n.height), t.style.left = `${d}px`, t.style.top = `${p}px`;
|
|
3106
3106
|
}
|
|
3107
|
-
function l(
|
|
3108
|
-
o(
|
|
3107
|
+
function l(h) {
|
|
3108
|
+
o(h.pageX, h.pageY);
|
|
3109
3109
|
}
|
|
3110
3110
|
document.addEventListener("mousemove", l);
|
|
3111
3111
|
const a = () => {
|
|
@@ -3116,7 +3116,7 @@ function lo(t, e) {
|
|
|
3116
3116
|
return !1;
|
|
3117
3117
|
};
|
|
3118
3118
|
}
|
|
3119
|
-
function
|
|
3119
|
+
function ho() {
|
|
3120
3120
|
const t = document.createElement("div");
|
|
3121
3121
|
t.className = "grid";
|
|
3122
3122
|
for (let e = 0; e < 16; e++) {
|
|
@@ -3136,7 +3136,7 @@ function uo() {
|
|
|
3136
3136
|
cursor: "grab"
|
|
3137
3137
|
}), t;
|
|
3138
3138
|
}
|
|
3139
|
-
function
|
|
3139
|
+
function uo() {
|
|
3140
3140
|
const t = document.createElement("div");
|
|
3141
3141
|
Object.assign(t.style, {
|
|
3142
3142
|
width: "0",
|
|
@@ -3175,8 +3175,8 @@ function U(t, e, s, n, i) {
|
|
|
3175
3175
|
}
|
|
3176
3176
|
const ft = "or_uxt_test_start", ws = "or_uxt_task_index", xs = "or_uxt_session_id", go = "or_uxt_test_id";
|
|
3177
3177
|
class mo {
|
|
3178
|
-
constructor(e, s, n, i, r, o, l, a,
|
|
3179
|
-
this.ingestPoint = e, this.getTimestamp = s, this.token = n, this.testId = i, this.storageKey = r, this.setStorageKey = o, this.removeStorageKey = l, this.getStorageKey = a, this.getSessionId =
|
|
3178
|
+
constructor(e, s, n, i, r, o, l, a, h) {
|
|
3179
|
+
this.ingestPoint = e, this.getTimestamp = s, this.token = n, this.testId = i, this.storageKey = r, this.setStorageKey = o, this.removeStorageKey = l, this.getStorageKey = a, this.getSessionId = h, this.durations = {
|
|
3180
3180
|
testStart: 0,
|
|
3181
3181
|
tasks: []
|
|
3182
3182
|
}, this.getDurations = () => this.durations, this.setDurations = (d) => {
|
|
@@ -3230,8 +3230,8 @@ class vo {
|
|
|
3230
3230
|
constructor(e, s) {
|
|
3231
3231
|
this.app = e, this.storageKey = s, this.bg = U("div", "bg", Xr, void 0, "__or_ut_bg"), this.container = U("div", "container", Jr, void 0, "__or_ut_ct"), this.widgetGuidelinesVisible = !0, this.widgetTasksVisible = !1, this.widgetVisible = !0, this.isActive = !1, this.descriptionSection = null, this.taskSection = null, this.endSection = null, this.stopButton = null, this.stopButtonContainer = null, this.test = null, this.testId = null, this.signalManager = null, this.getTest = (o, l, a) => {
|
|
3232
3232
|
this.testId = o;
|
|
3233
|
-
const
|
|
3234
|
-
return fetch(`${
|
|
3233
|
+
const h = this.app.options.ingestPoint;
|
|
3234
|
+
return fetch(`${h}/v1/web/uxt/test/${o}`, {
|
|
3235
3235
|
headers: {
|
|
3236
3236
|
Authorization: `Bearer ${l}`
|
|
3237
3237
|
}
|
|
@@ -3256,10 +3256,10 @@ class vo {
|
|
|
3256
3256
|
📹 We're recording this browser tab to learn from your experience.
|
|
3257
3257
|
🎤 Please enable mic and camera if asked, to give us a complete picture.`), o = U("div", "button", Zr, "Read guidelines to begin");
|
|
3258
3258
|
this.removeGreeting = () => ((s || n) && this.userRecorder.startRecording(30, vn.Standard, s, n), this.container.removeChild(o), this.container.removeChild(r), this.container.removeChild(i), !1), o.onclick = () => {
|
|
3259
|
-
var a,
|
|
3259
|
+
var a, h, c, d;
|
|
3260
3260
|
this.removeGreeting();
|
|
3261
3261
|
const l = (a = this.signalManager) == null ? void 0 : a.getDurations();
|
|
3262
|
-
l && this.signalManager && (l.testStart = this.app.timestamp(), this.signalManager.setDurations(l)), (
|
|
3262
|
+
l && this.signalManager && (l.testStart = this.app.timestamp(), this.signalManager.setDurations(l)), (h = this.signalManager) == null || h.signalTest("begin"), this.container.style.fontFamily = '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"', Object.assign(this.container.style, rt), this.showWidget(((c = this.test) == null ? void 0 : c.guidelines) || "", ((d = this.test) == null ? void 0 : d.tasks) || []);
|
|
3263
3263
|
}, this.container.append(i, r, o), this.bg.appendChild(this.container), document.body.appendChild(this.bg);
|
|
3264
3264
|
}
|
|
3265
3265
|
showWidget(e, s, n) {
|
|
@@ -3280,13 +3280,13 @@ class vo {
|
|
|
3280
3280
|
this.container.style.fontFamily = '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"', Object.assign(this.container.style, rt);
|
|
3281
3281
|
const r = this.createDescriptionSection(e), o = this.createTasksSection(s), l = U("div", "stop_bn_or", fn, "Abort Session"), a = U("div", "stop_ct_or", { fontSize: "13px!important" });
|
|
3282
3282
|
a.style.fontSize = "13px", a.append(l), this.container.append(i, r, o, a), this.taskSection = o, this.descriptionSection = r, this.stopButton = l, this.stopButtonContainer = a, l.onclick = () => {
|
|
3283
|
-
var
|
|
3284
|
-
this.userRecorder.discard(), (
|
|
3283
|
+
var h;
|
|
3284
|
+
this.userRecorder.discard(), (h = this.signalManager) == null || h.signalTest("skipped"), document.body.removeChild(this.bg), window.close();
|
|
3285
3285
|
}, n ? this.toggleDescriptionVisibility() : this.hideTaskSection();
|
|
3286
3286
|
}
|
|
3287
3287
|
createTitleSection() {
|
|
3288
3288
|
var l;
|
|
3289
|
-
const e = U("div", "title", eo), s =
|
|
3289
|
+
const e = U("div", "title", eo), s = ho(), n = U("div", "title_text", {
|
|
3290
3290
|
maxWidth: "19rem",
|
|
3291
3291
|
overflow: "hidden",
|
|
3292
3292
|
textOverflow: "ellipsis",
|
|
@@ -3294,7 +3294,7 @@ class vo {
|
|
|
3294
3294
|
fontSize: 16,
|
|
3295
3295
|
lineHeight: "auto",
|
|
3296
3296
|
cursor: "pointer"
|
|
3297
|
-
}, (l = this.test) == null ? void 0 : l.title), i =
|
|
3297
|
+
}, (l = this.test) == null ? void 0 : l.title), i = uo();
|
|
3298
3298
|
e.append(s, n, i);
|
|
3299
3299
|
const r = (a) => (this.widgetVisible = a, this.container.style.fontFamily = '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"', Object.assign(this.container.style, this.widgetVisible ? rt : { border: "none", background: "none", padding: 0 }), this.taskSection && Object.assign(this.taskSection.style, this.widgetVisible ? We : { display: "none" }), this.descriptionSection && Object.assign(this.descriptionSection.style, this.widgetVisible ? We : { display: "none" }), this.endSection && Object.assign(this.endSection.style, this.widgetVisible ? We : { display: "none" }), this.stopButton && Object.assign(this.stopButton.style, this.widgetVisible ? fn : { display: "none" }), a), o = () => {
|
|
3300
3300
|
Object.assign(i.style, {
|
|
@@ -3304,11 +3304,11 @@ class vo {
|
|
|
3304
3304
|
return n.onclick = o, i.onclick = o, lo(this.bg, s), this.collapseWidget = () => r(!1), e;
|
|
3305
3305
|
}
|
|
3306
3306
|
createDescriptionSection(e) {
|
|
3307
|
-
const s = U("div", "description_section_or", We), n = U("div", "description_s_title_or",
|
|
3307
|
+
const s = U("div", "description_section_or", We), n = U("div", "description_s_title_or", hn), i = U("div", "title", {
|
|
3308
3308
|
fontSize: 13,
|
|
3309
3309
|
fontWeight: 500,
|
|
3310
3310
|
lineHeight: "auto"
|
|
3311
|
-
}, "Introduction & Guidelines"), r = U("div", "icon",
|
|
3311
|
+
}, "Introduction & Guidelines"), r = U("div", "icon", un, "-"), o = U("div", "content", je), l = U("div", "text_description", {
|
|
3312
3312
|
maxHeight: "250px",
|
|
3313
3313
|
overflowY: "auto",
|
|
3314
3314
|
whiteSpace: "pre-wrap",
|
|
@@ -3319,14 +3319,14 @@ class vo {
|
|
|
3319
3319
|
l.innerHTML = e;
|
|
3320
3320
|
const a = U("div", "button_begin_or", dn, "Begin Test");
|
|
3321
3321
|
n.append(i, r), o.append(l, a), s.append(n, o);
|
|
3322
|
-
const
|
|
3322
|
+
const h = () => {
|
|
3323
3323
|
this.widgetGuidelinesVisible = !this.widgetGuidelinesVisible, r.textContent = this.widgetGuidelinesVisible ? "-" : "+", Object.assign(o.style, this.widgetGuidelinesVisible ? je : { display: "none" });
|
|
3324
3324
|
};
|
|
3325
|
-
return n.onclick =
|
|
3325
|
+
return n.onclick = h, this.toggleDescriptionVisibility = () => {
|
|
3326
3326
|
this.widgetGuidelinesVisible = !1, r.textContent = this.widgetGuidelinesVisible ? "-" : "+", Object.assign(o.style, this.widgetGuidelinesVisible ? je : { display: "none" }), o.removeChild(a);
|
|
3327
3327
|
}, a.onclick = () => {
|
|
3328
3328
|
var c, d, p;
|
|
3329
|
-
if (
|
|
3329
|
+
if (h(), this.test) {
|
|
3330
3330
|
const y = (c = this.signalManager) == null ? void 0 : c.getDurations(), w = y ? y.tasks.findIndex((b) => this.test && b.taskId === this.test.tasks[0].task_id) : null;
|
|
3331
3331
|
y && w === -1 && (y.tasks.push({
|
|
3332
3332
|
taskId: this.test.tasks[0].task_id,
|
|
@@ -3338,21 +3338,21 @@ class vo {
|
|
|
3338
3338
|
}
|
|
3339
3339
|
createTasksSection(e) {
|
|
3340
3340
|
this.container.style.fontFamily = '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"', Object.assign(this.container.style, rt);
|
|
3341
|
-
const s = U("div", "task_section_or", We), n = U("div", "description_t_title_or",
|
|
3341
|
+
const s = U("div", "task_section_or", We), n = U("div", "description_t_title_or", hn), i = U("div", "title", {
|
|
3342
3342
|
fontSize: "13px",
|
|
3343
3343
|
fontWeight: "500",
|
|
3344
3344
|
lineHeight: "auto"
|
|
3345
|
-
}, "Tasks"), r = U("div", "icon",
|
|
3345
|
+
}, "Tasks"), r = U("div", "icon", un, "-"), o = U("div", "content", je), l = U("div", "pagination", so), a = U("div", "taskCard", gn), h = U("div", "taskText", mn), c = U("div", "taskDescription", io), d = U("div", "taskButtons", oo), p = U("div", "taskText", mn);
|
|
3346
3346
|
p.textContent = "Your answer";
|
|
3347
3347
|
const y = U("textarea", "taskDescription", {
|
|
3348
3348
|
resize: "vertical"
|
|
3349
3349
|
}), w = U("div", "inputArea", gn);
|
|
3350
3350
|
w.append(p, y);
|
|
3351
3351
|
const b = U("div", "closePanelButton", yi, "Collapse Panel"), T = U("div", "nextButton", ro, "Done, Next");
|
|
3352
|
-
n.append(i, r), a.append(
|
|
3352
|
+
n.append(i, r), a.append(h, c), d.append(b, T), o.append(l, a, w, d), s.append(n, o);
|
|
3353
3353
|
const D = () => {
|
|
3354
3354
|
const k = e[this.currentTaskIndex];
|
|
3355
|
-
|
|
3355
|
+
h.textContent = k.title, c.textContent = k.description, k.allow_typing ? w.style.display = "flex" : w.style.display = "none";
|
|
3356
3356
|
};
|
|
3357
3357
|
e.forEach((k, O) => {
|
|
3358
3358
|
const N = U("span", `or_task_${O}`, {
|
|
@@ -3401,7 +3401,7 @@ class vo {
|
|
|
3401
3401
|
}, 1), s;
|
|
3402
3402
|
}
|
|
3403
3403
|
showEndSection() {
|
|
3404
|
-
var l, a,
|
|
3404
|
+
var l, a, h, c;
|
|
3405
3405
|
let e = !0;
|
|
3406
3406
|
(l = this.signalManager) == null || l.signalTest("done");
|
|
3407
3407
|
const s = U("div", "end_section_or", to), n = U("div", "end_title_or", {
|
|
@@ -3410,7 +3410,7 @@ class vo {
|
|
|
3410
3410
|
}, "Thank you! 👍"), i = U("div", "end_description_or", {}, ((a = this.test) == null ? void 0 : a.conclusion) ?? `Thank you for participating in our usability test. Your feedback has been captured and will be used to enhance our website.
|
|
3411
3411
|
|
|
3412
3412
|
We appreciate your time and valuable input.`), r = U("div", "end_button_or", dn, "Submitting Feedback"), o = po();
|
|
3413
|
-
r.appendChild(o), (
|
|
3413
|
+
r.appendChild(o), (h = this.test) != null && h.reqMic || (c = this.test) != null && c.reqCamera ? this.userRecorder.sendToAPI().then(() => {
|
|
3414
3414
|
r.removeChild(o), r.textContent = "End Session", e = !1;
|
|
3415
3415
|
}).catch((d) => {
|
|
3416
3416
|
console.error(d), r.removeChild(o), r.textContent = "End Session", e = !1;
|
|
@@ -3466,12 +3466,12 @@ class bo {
|
|
|
3466
3466
|
};
|
|
3467
3467
|
const o = $r(i.toString(), r);
|
|
3468
3468
|
this.app.send(o);
|
|
3469
|
-
const l = (
|
|
3470
|
-
So(
|
|
3469
|
+
const l = (h) => {
|
|
3470
|
+
So(h, this.options.quality, this.snapshots[i].dummy, this.options.fixedScaling, this.fileExt, (c) => {
|
|
3471
3471
|
c && (this.snapshots[i].images.push({ id: this.app.timestamp(), data: c }), this.snapshots[i].images.length > 9 && (this.sendSnaps(this.snapshots[i].images, i, this.snapshots[i].createdAt), this.snapshots[i].images = []));
|
|
3472
3472
|
});
|
|
3473
3473
|
}, a = setInterval(() => {
|
|
3474
|
-
const
|
|
3474
|
+
const h = this.app.nodes.getID(n), c = h ? this.app.nodes.getNode(h) : void 0;
|
|
3475
3475
|
!c || !Q(c, "canvas") || c !== n ? (this.app.debug.log("Canvas element not in sync"), clearInterval(a)) : this.snapshots[i].paused || (this.options.useAnimationFrame ? requestAnimationFrame(() => {
|
|
3476
3476
|
l(c);
|
|
3477
3477
|
}) : l(c));
|
|
@@ -3652,8 +3652,8 @@ class Ls {
|
|
|
3652
3652
|
const a = i.attributeName;
|
|
3653
3653
|
if (a === null)
|
|
3654
3654
|
continue;
|
|
3655
|
-
let
|
|
3656
|
-
|
|
3655
|
+
let h = this.attributesMap.get(l);
|
|
3656
|
+
h === void 0 && this.attributesMap.set(l, h = /* @__PURE__ */ new Set()), h.add(a);
|
|
3657
3657
|
continue;
|
|
3658
3658
|
}
|
|
3659
3659
|
if (o === "characterData") {
|
|
@@ -3781,11 +3781,11 @@ class Ls {
|
|
|
3781
3781
|
return !0;
|
|
3782
3782
|
}
|
|
3783
3783
|
o === Se.Removed && i !== void 0 && this.app.send(br(e, i, a));
|
|
3784
|
-
const
|
|
3785
|
-
if (
|
|
3784
|
+
const h = this.attributesMap.get(e);
|
|
3785
|
+
if (h !== void 0) {
|
|
3786
3786
|
if (!Te(s))
|
|
3787
3787
|
throw "commitNode: node is not an element";
|
|
3788
|
-
for (const c of
|
|
3788
|
+
for (const c of h)
|
|
3789
3789
|
this.sendNodeAttribute(e, s, c, s.getAttribute(c));
|
|
3790
3790
|
}
|
|
3791
3791
|
if (this.textSet.has(e)) {
|
|
@@ -4121,14 +4121,14 @@ class Fo {
|
|
|
4121
4121
|
}, this.restartCanvasTracking = () => {
|
|
4122
4122
|
var a;
|
|
4123
4123
|
(a = this.canvasRecorder) == null || a.restartTracking();
|
|
4124
|
-
}, this.flushBuffer = async (a) => new Promise((
|
|
4124
|
+
}, this.flushBuffer = async (a) => new Promise((h) => {
|
|
4125
4125
|
let c = !1;
|
|
4126
4126
|
const d = [a.shift()];
|
|
4127
4127
|
for (; !c; ) {
|
|
4128
4128
|
const p = a[0];
|
|
4129
4129
|
!p || p[0] === 0 ? c = !0 : d.push(a.shift());
|
|
4130
4130
|
}
|
|
4131
|
-
this.postToWorker(d),
|
|
4131
|
+
this.postToWorker(d), h(null);
|
|
4132
4132
|
}), this.onUxtCb = [], this.contextId = Math.random().toString(36).slice(2), this.projectKey = e, Object.keys(n).findIndex((a) => ["fixedCanvasScaling", "disableCanvas"].includes(a)) !== -1 && (console.warn('Openreplay: canvas options are moving to separate key "canvas" in next update. Please update your configuration.'), n = {
|
|
4133
4133
|
...n,
|
|
4134
4134
|
canvas: {
|
|
@@ -4177,8 +4177,8 @@ class Fo {
|
|
|
4177
4177
|
}
|
|
4178
4178
|
this.revID = this.options.revID, this.localStorage = this.options.localStorage ?? window.localStorage, this.sessionStorage = this.options.sessionStorage ?? window.sessionStorage, this.sanitizer = new _o(this, n), this.nodes = new ko(this.options.node_id), this.observer = new Co(this, n), this.ticker = new Ro(this), this.ticker.attach(() => this.commit()), this.debug = new xo(this.options.__debug__), this.session = new Oo(this, this.options), this.attributeSender = new sr(this, !!this.options.disableStringDict), this.featureFlags = new rr(this), this.tagWatcher = new Kr(this.sessionStorage, this.debug.error, (a) => {
|
|
4179
4179
|
this.send(qr(a));
|
|
4180
|
-
}), this.session.attachUpdateCallback(({ userID: a, metadata:
|
|
4181
|
-
a != null && this.send(Nr(a)),
|
|
4180
|
+
}), this.session.attachUpdateCallback(({ userID: a, metadata: h }) => {
|
|
4181
|
+
a != null && this.send(Nr(a)), h != null && Object.entries(h).forEach(([c, d]) => this.send(sn(c, d)));
|
|
4182
4182
|
}), s != null && this.session.applySessionHash(s), this.initWorker();
|
|
4183
4183
|
const l = this.session.getTabId();
|
|
4184
4184
|
if (this.insideIframe) {
|
|
@@ -4189,16 +4189,16 @@ class Fo {
|
|
|
4189
4189
|
window.addEventListener("message", a), this.attachStopCallback(() => {
|
|
4190
4190
|
window.removeEventListener("message", a);
|
|
4191
4191
|
});
|
|
4192
|
-
const
|
|
4192
|
+
const h = this.initialHostName;
|
|
4193
4193
|
window.parent.postMessage({
|
|
4194
4194
|
line: he.iframeSignal,
|
|
4195
4195
|
source: l,
|
|
4196
4196
|
context: this.contextId,
|
|
4197
|
-
domain:
|
|
4197
|
+
domain: h
|
|
4198
4198
|
}, "*");
|
|
4199
4199
|
} else {
|
|
4200
4200
|
let a = 0;
|
|
4201
|
-
const
|
|
4201
|
+
const h = (c) => {
|
|
4202
4202
|
const { data: d } = c;
|
|
4203
4203
|
if (d.line === he.iframeSignal) {
|
|
4204
4204
|
const p = d.domain, y = Array.from(document.querySelectorAll("iframe"));
|
|
@@ -4259,8 +4259,8 @@ class Fo {
|
|
|
4259
4259
|
this.messages.push(...y);
|
|
4260
4260
|
}
|
|
4261
4261
|
};
|
|
4262
|
-
window.addEventListener("message",
|
|
4263
|
-
window.removeEventListener("message",
|
|
4262
|
+
window.addEventListener("message", h), this.attachStopCallback(() => {
|
|
4263
|
+
window.removeEventListener("message", h);
|
|
4264
4264
|
});
|
|
4265
4265
|
}
|
|
4266
4266
|
this.bc !== null && (this.bc.postMessage({
|
|
@@ -4272,18 +4272,18 @@ class Fo {
|
|
|
4272
4272
|
}, 500), this.bc.onmessage = (a) => {
|
|
4273
4273
|
if (a.data.context !== this.contextId) {
|
|
4274
4274
|
if (a.data.line === he.resp) {
|
|
4275
|
-
const
|
|
4276
|
-
this.session.setSessionToken(
|
|
4275
|
+
const h = a.data.token;
|
|
4276
|
+
this.session.setSessionToken(h), this.allowAppStart();
|
|
4277
4277
|
}
|
|
4278
4278
|
if (a.data.line === he.reg) {
|
|
4279
|
-
const
|
|
4280
|
-
this.session.regenerateTabId(), this.session.setSessionToken(
|
|
4279
|
+
const h = a.data.token;
|
|
4280
|
+
this.session.regenerateTabId(), this.session.setSessionToken(h), this.allowAppStart();
|
|
4281
4281
|
}
|
|
4282
4282
|
if (a.data.line === he.ask) {
|
|
4283
|
-
const
|
|
4284
|
-
|
|
4283
|
+
const h = this.session.getSessionToken();
|
|
4284
|
+
h && this.bc && this.bc.postMessage({
|
|
4285
4285
|
line: a.data.source === l ? he.reg : he.resp,
|
|
4286
|
-
token:
|
|
4286
|
+
token: h,
|
|
4287
4287
|
source: l,
|
|
4288
4288
|
context: this.contextId
|
|
4289
4289
|
});
|
|
@@ -4465,8 +4465,8 @@ class Fo {
|
|
|
4465
4465
|
}
|
|
4466
4466
|
const r = this.options.ingestPoint, a = (/api\.openreplay\.com/.test(r) ? "https://app.openreplay.com/ingest" : r).replace(/ingest$/, `${s}/session/${n}`);
|
|
4467
4467
|
if (e != null && e.withCurrentTime) {
|
|
4468
|
-
const
|
|
4469
|
-
return `${a}?jumpto=${
|
|
4468
|
+
const h = ge() - i;
|
|
4469
|
+
return `${a}?jumpto=${h}`;
|
|
4470
4470
|
}
|
|
4471
4471
|
return a;
|
|
4472
4472
|
}
|
|
@@ -4546,7 +4546,7 @@ class Fo {
|
|
|
4546
4546
|
userCountry: o,
|
|
4547
4547
|
userDevice: l,
|
|
4548
4548
|
userOS: a,
|
|
4549
|
-
userState:
|
|
4549
|
+
userState: h,
|
|
4550
4550
|
projectID: c
|
|
4551
4551
|
} = await s.json();
|
|
4552
4552
|
this.session.assign({ projectID: c }), this.session.setUserInfo({
|
|
@@ -4555,7 +4555,7 @@ class Fo {
|
|
|
4555
4555
|
userCountry: o,
|
|
4556
4556
|
userDevice: l,
|
|
4557
4557
|
userOS: a,
|
|
4558
|
-
userState:
|
|
4558
|
+
userState: h
|
|
4559
4559
|
});
|
|
4560
4560
|
const d = { sessionToken: n, userUUID: "", sessionID: "" };
|
|
4561
4561
|
this.startCallbacks.forEach((w) => w(d)), await ((p = this.conditionsManager) == null ? void 0 : p.fetchConditions(c, n)), await this.featureFlags.reloadFlags(n), await this.tagWatcher.fetchTags(this.options.ingestPoint, n), (y = this.conditionsManager) == null || y.processFlags(this.featureFlags.flags);
|
|
@@ -4644,7 +4644,7 @@ class Fo {
|
|
|
4644
4644
|
jsHeapSizeLimit: ss,
|
|
4645
4645
|
timezone: os()
|
|
4646
4646
|
})
|
|
4647
|
-
}), { token: n, userBrowser: i, userCity: r, userCountry: o, userDevice: l, userOS: a, userState:
|
|
4647
|
+
}), { token: n, userBrowser: i, userCity: r, userCountry: o, userDevice: l, userOS: a, userState: h, beaconSizeLimit: c, projectID: d } = await s.json();
|
|
4648
4648
|
for ((y = this.worker) == null || y.postMessage({
|
|
4649
4649
|
type: "auth",
|
|
4650
4650
|
token: n,
|
|
@@ -4655,7 +4655,7 @@ class Fo {
|
|
|
4655
4655
|
userCountry: o,
|
|
4656
4656
|
userDevice: l,
|
|
4657
4657
|
userOS: a,
|
|
4658
|
-
userState:
|
|
4658
|
+
userState: h
|
|
4659
4659
|
}); this.bufferedMessages1.length > 0; )
|
|
4660
4660
|
await this.flushBuffer(this.bufferedMessages1);
|
|
4661
4661
|
this.postToWorker([["q_end"]]), this.clearBuffers();
|
|
@@ -4717,7 +4717,7 @@ class Fo {
|
|
|
4717
4717
|
return this.signalError(I, []), _e(I);
|
|
4718
4718
|
}
|
|
4719
4719
|
const {
|
|
4720
|
-
token:
|
|
4720
|
+
token: h,
|
|
4721
4721
|
userUUID: c,
|
|
4722
4722
|
projectID: d,
|
|
4723
4723
|
beaconSizeLimit: p,
|
|
@@ -4740,11 +4740,11 @@ class Fo {
|
|
|
4740
4740
|
canvasFPS: E,
|
|
4741
4741
|
assistOnly: P
|
|
4742
4742
|
} = await a.json();
|
|
4743
|
-
if (typeof
|
|
4743
|
+
if (typeof h != "string" || typeof c != "string" || typeof T != "number" && typeof T < "u" || typeof b != "string" || typeof w != "number" || typeof p != "number" && typeof p < "u") {
|
|
4744
4744
|
const I = `Incorrect server response: ${JSON.stringify(a)}`;
|
|
4745
4745
|
return this.signalError(I, []), _e(I);
|
|
4746
4746
|
}
|
|
4747
|
-
this.delay = w, this.session.setSessionToken(
|
|
4747
|
+
this.delay = w, this.session.setSessionToken(h), this.session.setUserInfo({
|
|
4748
4748
|
userBrowser: D,
|
|
4749
4749
|
userCity: B,
|
|
4750
4750
|
userCountry: A,
|
|
@@ -4757,11 +4757,11 @@ class Fo {
|
|
|
4757
4757
|
projectID: d
|
|
4758
4758
|
}), P ? (this.socketMode = !0, this.worker.postMessage("stop")) : this.worker.postMessage({
|
|
4759
4759
|
type: "auth",
|
|
4760
|
-
token:
|
|
4760
|
+
token: h,
|
|
4761
4761
|
beaconSizeLimit: p
|
|
4762
|
-
}), !l &&
|
|
4763
|
-
const V = { sessionToken:
|
|
4764
|
-
if (this.startCallbacks.forEach((I) => I(V)), this.featureFlags.reloadFlags(), await this.tagWatcher.fetchTags(this.options.ingestPoint,
|
|
4762
|
+
}), !l && h === o && (this.debug.log("continuing session on new tab", this.session.getTabId()), this.send(dt(this.session.getTabId()))), Object.entries(this.session.getInfo().metadata).forEach(([I, M]) => this.send(sn(I, M))), this.localStorage.setItem(this.options.local_uuid_key, c), this.compressionThreshold = y;
|
|
4763
|
+
const V = { sessionToken: h, userUUID: c, sessionID: b };
|
|
4764
|
+
if (this.startCallbacks.forEach((I) => I(V)), this.featureFlags.reloadFlags(), await this.tagWatcher.fetchTags(this.options.ingestPoint, h), this.activityState = Y.Active, F && !this.options.canvas.disableCanvas && (this.canvasRecorder = this.canvasRecorder ?? new bo(this, {
|
|
4765
4765
|
fps: E,
|
|
4766
4766
|
quality: C,
|
|
4767
4767
|
isDebug: this.options.canvas.__save_canvas_locally,
|
|
@@ -4784,15 +4784,15 @@ class Fo {
|
|
|
4784
4784
|
j = M ? parseInt(M, 10) : void 0;
|
|
4785
4785
|
}
|
|
4786
4786
|
}
|
|
4787
|
-
return j && (this.uxtManager.isActive ? this.onUxtCb.forEach((I) => I(j)) : this.uxtManager.getTest(j,
|
|
4787
|
+
return j && (this.uxtManager.isActive ? this.onUxtCb.forEach((I) => I(j)) : this.uxtManager.getTest(j, h, !!W).then((I) => {
|
|
4788
4788
|
I && this.onUxtCb.forEach((M) => M(I));
|
|
4789
4789
|
})), Do(V);
|
|
4790
4790
|
} catch (a) {
|
|
4791
4791
|
if (this.stop(), this.session.reset(), a === et)
|
|
4792
4792
|
return this.signalError(et, []), _e(et);
|
|
4793
4793
|
this._debug("session_start", a);
|
|
4794
|
-
const
|
|
4795
|
-
return this.signalError(
|
|
4794
|
+
const h = a instanceof Error ? a.message : a.toString();
|
|
4795
|
+
return this.signalError(h, []), _e(h);
|
|
4796
4796
|
}
|
|
4797
4797
|
}
|
|
4798
4798
|
addOnUxtCb(e) {
|
|
@@ -4931,16 +4931,16 @@ function jo(t, e) {
|
|
|
4931
4931
|
}, e);
|
|
4932
4932
|
if (!Array.isArray(s.consoleMethods) || s.consoleMethods.length === 0)
|
|
4933
4933
|
return;
|
|
4934
|
-
const n = t.safe((a,
|
|
4934
|
+
const n = t.safe((a, h) => t.send(Cr(a, Bo(h))));
|
|
4935
4935
|
let i = 0;
|
|
4936
4936
|
const r = () => {
|
|
4937
4937
|
i = 0;
|
|
4938
4938
|
};
|
|
4939
4939
|
t.attachStartCallback(r), t.ticker.attach(r, 33, !1);
|
|
4940
|
-
const o = (a,
|
|
4940
|
+
const o = (a, h) => {
|
|
4941
4941
|
const c = {
|
|
4942
4942
|
apply: function(d, p, y) {
|
|
4943
|
-
Reflect.apply(d,
|
|
4943
|
+
Reflect.apply(d, h, y), i = i + 1, !(i > s.consoleThrottling) && n(d.name, y);
|
|
4944
4944
|
}
|
|
4945
4945
|
};
|
|
4946
4946
|
s.consoleMethods.forEach((d) => {
|
|
@@ -4948,7 +4948,7 @@ function jo(t, e) {
|
|
|
4948
4948
|
t.debug.error(`OpenReplay: unsupported console method "${d}"`);
|
|
4949
4949
|
return;
|
|
4950
4950
|
}
|
|
4951
|
-
const p =
|
|
4951
|
+
const p = h.console[d];
|
|
4952
4952
|
a[d] = new Proxy(p, c);
|
|
4953
4953
|
});
|
|
4954
4954
|
}, l = t.safe((a) => o(a.console, a));
|
|
@@ -4971,7 +4971,7 @@ function Uo() {
|
|
|
4971
4971
|
return this[b];
|
|
4972
4972
|
};
|
|
4973
4973
|
}
|
|
4974
|
-
var r = ["isConstructor", "isEval", "isNative", "isToplevel"], o = ["columnNumber", "lineNumber"], l = ["fileName", "functionName", "source"], a = ["args"],
|
|
4974
|
+
var r = ["isConstructor", "isEval", "isNative", "isToplevel"], o = ["columnNumber", "lineNumber"], l = ["fileName", "functionName", "source"], a = ["args"], h = ["evalOrigin"], c = r.concat(o, l, a, h);
|
|
4975
4975
|
function d(b) {
|
|
4976
4976
|
if (b)
|
|
4977
4977
|
for (var T = 0; T < c.length; T++)
|
|
@@ -5062,15 +5062,15 @@ function Uo() {
|
|
|
5062
5062
|
extractLocation: function(a) {
|
|
5063
5063
|
if (a.indexOf(":") === -1)
|
|
5064
5064
|
return [a];
|
|
5065
|
-
var
|
|
5065
|
+
var h = /(.+?)(?::(\d+))?(?::(\d+))?$/, c = h.exec(a.replace(/[()]/g, ""));
|
|
5066
5066
|
return [c[1], c[2] || void 0, c[3] || void 0];
|
|
5067
5067
|
},
|
|
5068
5068
|
parseV8OrIE: function(a) {
|
|
5069
|
-
var
|
|
5069
|
+
var h = a.stack.split(`
|
|
5070
5070
|
`).filter(function(c) {
|
|
5071
5071
|
return !!c.match(r);
|
|
5072
5072
|
}, this);
|
|
5073
|
-
return
|
|
5073
|
+
return h.map(function(c) {
|
|
5074
5074
|
c.indexOf("(eval ") > -1 && (c = c.replace(/eval code/g, "eval").replace(/(\(eval at [^()]*)|(,.*$)/g, ""));
|
|
5075
5075
|
var d = c.replace(/^\s+/, "").replace(/\(eval code/g, "(").replace(/^.*?\s+/, ""), p = d.match(/ (\(.+\)$)/);
|
|
5076
5076
|
d = p ? d.replace(p[0], "") : d;
|
|
@@ -5085,11 +5085,11 @@ function Uo() {
|
|
|
5085
5085
|
}, this);
|
|
5086
5086
|
},
|
|
5087
5087
|
parseFFOrSafari: function(a) {
|
|
5088
|
-
var
|
|
5088
|
+
var h = a.stack.split(`
|
|
5089
5089
|
`).filter(function(c) {
|
|
5090
5090
|
return !c.match(o);
|
|
5091
5091
|
}, this);
|
|
5092
|
-
return
|
|
5092
|
+
return h.map(function(c) {
|
|
5093
5093
|
if (c.indexOf(" > eval") > -1 && (c = c.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g, ":$1")), c.indexOf("@") === -1 && c.indexOf(":") === -1)
|
|
5094
5094
|
return new n({
|
|
5095
5095
|
functionName: c
|
|
@@ -5111,9 +5111,9 @@ function Uo() {
|
|
|
5111
5111
|
`).length ? this.parseOpera9(a) : a.stack ? this.parseOpera11(a) : this.parseOpera10(a);
|
|
5112
5112
|
},
|
|
5113
5113
|
parseOpera9: function(a) {
|
|
5114
|
-
for (var
|
|
5114
|
+
for (var h = /Line (\d+).*script (?:in )?(\S+)/i, c = a.message.split(`
|
|
5115
5115
|
`), d = [], p = 2, y = c.length; p < y; p += 2) {
|
|
5116
|
-
var w =
|
|
5116
|
+
var w = h.exec(c[p]);
|
|
5117
5117
|
w && d.push(new n({
|
|
5118
5118
|
fileName: w[2],
|
|
5119
5119
|
lineNumber: w[1],
|
|
@@ -5123,9 +5123,9 @@ function Uo() {
|
|
|
5123
5123
|
return d;
|
|
5124
5124
|
},
|
|
5125
5125
|
parseOpera10: function(a) {
|
|
5126
|
-
for (var
|
|
5126
|
+
for (var h = /Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i, c = a.stacktrace.split(`
|
|
5127
5127
|
`), d = [], p = 0, y = c.length; p < y; p += 2) {
|
|
5128
|
-
var w =
|
|
5128
|
+
var w = h.exec(c[p]);
|
|
5129
5129
|
w && d.push(
|
|
5130
5130
|
new n({
|
|
5131
5131
|
functionName: w[3] || void 0,
|
|
@@ -5139,11 +5139,11 @@ function Uo() {
|
|
|
5139
5139
|
},
|
|
5140
5140
|
// Opera 10.65+ Error.stack very similar to FF/Safari
|
|
5141
5141
|
parseOpera11: function(a) {
|
|
5142
|
-
var
|
|
5142
|
+
var h = a.stack.split(`
|
|
5143
5143
|
`).filter(function(c) {
|
|
5144
5144
|
return !!c.match(i) && !c.match(/^Error created at/);
|
|
5145
5145
|
}, this);
|
|
5146
|
-
return
|
|
5146
|
+
return h.map(function(c) {
|
|
5147
5147
|
var d = c.split("@"), p = this.extractLocation(d.pop()), y = d.shift() || "", w = y.replace(/<anonymous function(: (\w+))?>/, "$2").replace(/\([^)]*\)/g, "") || void 0, b;
|
|
5148
5148
|
y.match(/\(([^)]*)\)/) && (b = y.replace(/^[^(]+\(([^)]*)\)$/, "$1"));
|
|
5149
5149
|
var T = b === void 0 || b === "[arguments not available]" ? void 0 : b.split(",");
|
|
@@ -5227,30 +5227,30 @@ const qo = "https://static.openreplay.com/tracker/placeholder.jpeg";
|
|
|
5227
5227
|
function Vo(t) {
|
|
5228
5228
|
function e(l, a) {
|
|
5229
5229
|
t.attributeSender.sendSetAttribute(l, "src", qo);
|
|
5230
|
-
const { width:
|
|
5231
|
-
a.hasAttribute("width") || t.attributeSender.sendSetAttribute(l, "width", String(
|
|
5230
|
+
const { width: h, height: c } = a.getBoundingClientRect();
|
|
5231
|
+
a.hasAttribute("width") || t.attributeSender.sendSetAttribute(l, "width", String(h)), a.hasAttribute("height") || t.attributeSender.sendSetAttribute(l, "height", String(c));
|
|
5232
5232
|
}
|
|
5233
5233
|
const s = function(l, a) {
|
|
5234
|
-
const { srcset:
|
|
5235
|
-
if (!
|
|
5234
|
+
const { srcset: h } = a;
|
|
5235
|
+
if (!h)
|
|
5236
5236
|
return;
|
|
5237
|
-
const c =
|
|
5237
|
+
const c = h.split(h.match(/,\s+/) ? /,\s+/ : ",").map((d) => En(d)).join(", ");
|
|
5238
5238
|
t.attributeSender.sendSetAttribute(l, "srcset", c);
|
|
5239
5239
|
}, n = function(l, a) {
|
|
5240
5240
|
a.src.length > ar && e(l, a), t.send(ms(l, "src", a.src, t.getBaseHref()));
|
|
5241
5241
|
}, i = t.safe(function(l) {
|
|
5242
5242
|
const a = En(l.src || "");
|
|
5243
|
-
|
|
5243
|
+
ui(a) && t.send(vi(t.timestamp(), 0, 0, 0, 0, 0, a, "img", 0, !1));
|
|
5244
5244
|
}), r = t.safe(function(l) {
|
|
5245
5245
|
const a = t.nodes.getID(l);
|
|
5246
5246
|
a !== void 0 && l.complete && (l.naturalHeight === 0 && l.naturalWidth === 0 && !$o(l.src) ? i(l) : t.sanitizer.isHidden(a) || t.sanitizer.isObscured(a) ? e(a, l) : (n(a, l), s(a, l)));
|
|
5247
5247
|
}), o = di(t.safe((l) => {
|
|
5248
5248
|
for (const a of l)
|
|
5249
5249
|
if (a.type === "attributes") {
|
|
5250
|
-
const
|
|
5250
|
+
const h = a.target, c = t.nodes.getID(h);
|
|
5251
5251
|
if (c === void 0)
|
|
5252
5252
|
return;
|
|
5253
|
-
a.attributeName === "src" && n(c,
|
|
5253
|
+
a.attributeName === "src" && n(c, h), a.attributeName === "srcset" && s(c, h);
|
|
5254
5254
|
}
|
|
5255
5255
|
}));
|
|
5256
5256
|
t.attachStopCallback(() => {
|
|
@@ -5305,7 +5305,7 @@ function Ti(t) {
|
|
|
5305
5305
|
const s = Jo(t);
|
|
5306
5306
|
e = s && s.innerText || t.placeholder || t.name || t.id || t.className || t.type;
|
|
5307
5307
|
}
|
|
5308
|
-
return
|
|
5308
|
+
return hi(e).slice(0, 100);
|
|
5309
5309
|
}
|
|
5310
5310
|
const Ue = {
|
|
5311
5311
|
Plain: 0,
|
|
@@ -5360,7 +5360,7 @@ function Yo(t, e) {
|
|
|
5360
5360
|
a(d, p.checked);
|
|
5361
5361
|
});
|
|
5362
5362
|
}, 3);
|
|
5363
|
-
function
|
|
5363
|
+
function h(c, d, p, y) {
|
|
5364
5364
|
const { value: w, mask: b } = n(c, d), T = Ti(d);
|
|
5365
5365
|
t.send(Hr(c, w, b !== 0, T, p, y));
|
|
5366
5366
|
}
|
|
@@ -5375,7 +5375,7 @@ function Yo(t, e) {
|
|
|
5375
5375
|
}, T = () => {
|
|
5376
5376
|
y === 0 && p !== 0 && (y = ge() - p);
|
|
5377
5377
|
}, D = () => {
|
|
5378
|
-
p !== 0 && (w = ge() - p),
|
|
5378
|
+
p !== 0 && (w = ge() - p), h(d, c, y, w), y = 0, w = 0, p = 0;
|
|
5379
5379
|
};
|
|
5380
5380
|
t.nodes.attachNodeListener(c, "focus", b), t.nodes.attachNodeListener(c, "input", T), t.nodes.attachNodeListener(c, "change", D);
|
|
5381
5381
|
return;
|
|
@@ -5423,16 +5423,16 @@ function ot(t, e, s) {
|
|
|
5423
5423
|
if (de.timeoutMs !== void 0 && l > de.timeoutMs)
|
|
5424
5424
|
throw new Error(`Timeout: Can't find a unique selector after ${l}ms`);
|
|
5425
5425
|
let a = ct(ea(r)) || ct(...ta(r)) || ct(...sa(r)) || ct(na(r)) || [_n()];
|
|
5426
|
-
const
|
|
5426
|
+
const h = ia(r);
|
|
5427
5427
|
if (e == "all")
|
|
5428
|
-
|
|
5428
|
+
h && (a = a.concat(a.filter(cs).map((c) => at(c, h))));
|
|
5429
5429
|
else if (e == "two")
|
|
5430
|
-
a = a.slice(0, 1),
|
|
5430
|
+
a = a.slice(0, 1), h && (a = a.concat(a.filter(cs).map((c) => at(c, h))));
|
|
5431
5431
|
else if (e == "one") {
|
|
5432
5432
|
const [c] = a = a.slice(0, 1);
|
|
5433
|
-
|
|
5433
|
+
h && cs(c) && (a = [at(c, h)]);
|
|
5434
5434
|
} else
|
|
5435
|
-
e == "none" && (a = [_n()],
|
|
5435
|
+
e == "none" && (a = [_n()], h && (a = [at(a[0], h)]));
|
|
5436
5436
|
for (let c of a)
|
|
5437
5437
|
c.level = o;
|
|
5438
5438
|
if (i.push(a), i.length >= de.seedMinLength && (n = Cn(i, s), n))
|
|
@@ -5610,11 +5610,11 @@ function la(t, e) {
|
|
|
5610
5610
|
return Ti(k);
|
|
5611
5611
|
if (Is(k)) {
|
|
5612
5612
|
let N = "";
|
|
5613
|
-
return k instanceof HTMLElement && (N = t.sanitizer.getInnerTextSecure(k)), N = N || k.id || k.className,
|
|
5613
|
+
return k instanceof HTMLElement && (N = t.sanitizer.getInnerTextSecure(k)), N = N || k.id || k.className, hi(N).slice(0, 100);
|
|
5614
5614
|
}
|
|
5615
5615
|
return "";
|
|
5616
5616
|
}
|
|
5617
|
-
let i = -1, r = -1, o = !1, l = null, a = 0,
|
|
5617
|
+
let i = -1, r = -1, o = !1, l = null, a = 0, h = {}, c = 0, d = 0, p = 0, y = 0, w;
|
|
5618
5618
|
const b = 8e-3, T = 225;
|
|
5619
5619
|
function D() {
|
|
5620
5620
|
const k = y / T;
|
|
@@ -5628,13 +5628,13 @@ function la(t, e) {
|
|
|
5628
5628
|
t.attachStartCallback(() => {
|
|
5629
5629
|
w = setInterval(() => D(), T);
|
|
5630
5630
|
}), t.attachStopCallback(() => {
|
|
5631
|
-
i = -1, r = -1, o = !1, l = null,
|
|
5631
|
+
i = -1, r = -1, o = !1, l = null, h = {}, w && clearInterval(w);
|
|
5632
5632
|
});
|
|
5633
5633
|
const B = () => {
|
|
5634
5634
|
o && (t.send(Er(i, r)), o = !1);
|
|
5635
5635
|
}, A = (k, O = !1) => {
|
|
5636
5636
|
function N(C, E, P) {
|
|
5637
|
-
return
|
|
5637
|
+
return h[C] = h[C] || aa(E, k, P);
|
|
5638
5638
|
}
|
|
5639
5639
|
const F = O ? t.attachEventListener.bind(t) : t.nodes.attachNodeListener.bind(t.nodes);
|
|
5640
5640
|
F(k.documentElement, "mouseover", (C) => {
|
|
@@ -5664,7 +5664,7 @@ function la(t, e) {
|
|
|
5664
5664
|
function Nn(t) {
|
|
5665
5665
|
return Math.round(t * 1e4);
|
|
5666
5666
|
}
|
|
5667
|
-
function
|
|
5667
|
+
function ha(t) {
|
|
5668
5668
|
const e = [], s = document.getElementsByTagName("*"), n = /url\(("[^"]*"|'[^']*'|[^)]*)\)/i;
|
|
5669
5669
|
for (let i = 0; i < s.length; i++) {
|
|
5670
5670
|
const r = s[i];
|
|
@@ -5681,15 +5681,15 @@ function ua(t) {
|
|
|
5681
5681
|
const l = o.substr(0, 10) === "data:image" ? 0 : t[o];
|
|
5682
5682
|
if (l === void 0)
|
|
5683
5683
|
continue;
|
|
5684
|
-
const a = r.getBoundingClientRect(),
|
|
5685
|
-
if (d <=
|
|
5684
|
+
const a = r.getBoundingClientRect(), h = Math.max(a.top, 0), c = Math.max(a.left, 0), d = Math.min(a.bottom, window.innerHeight || document.documentElement && document.documentElement.clientHeight || 0), p = Math.min(a.right, window.innerWidth || document.documentElement && document.documentElement.clientWidth || 0);
|
|
5685
|
+
if (d <= h || p <= c)
|
|
5686
5686
|
continue;
|
|
5687
|
-
const y = (d -
|
|
5687
|
+
const y = (d - h) * (p - c);
|
|
5688
5688
|
e.push({ time: l, area: y });
|
|
5689
5689
|
}
|
|
5690
5690
|
return e;
|
|
5691
5691
|
}
|
|
5692
|
-
function
|
|
5692
|
+
function ua(t, e) {
|
|
5693
5693
|
let s = Math.max(document.documentElement && document.documentElement.clientWidth || 0, window.innerWidth || 0) * Math.max(document.documentElement && document.documentElement.clientHeight || 0, window.innerHeight || 0) / 10, n = s * t;
|
|
5694
5694
|
for (let i = 0; i < e.length; i++) {
|
|
5695
5695
|
const { time: r, area: o } = e[i];
|
|
@@ -5707,43 +5707,43 @@ function da(t, e) {
|
|
|
5707
5707
|
if ("PerformanceObserver" in window || (s.captureResourceTimings = !1), !s.captureResourceTimings)
|
|
5708
5708
|
return;
|
|
5709
5709
|
let n = {};
|
|
5710
|
-
function i(
|
|
5710
|
+
function i(h) {
|
|
5711
5711
|
var d;
|
|
5712
|
-
if (
|
|
5712
|
+
if (h.duration < 0 || !ui(h.name) || t.isServiceURL(h.name))
|
|
5713
5713
|
return;
|
|
5714
|
-
n !== null && (n[
|
|
5714
|
+
n !== null && (n[h.name] = h.startTime + h.duration);
|
|
5715
5715
|
let c = !1;
|
|
5716
5716
|
(d = s.excludedResourceUrls) == null || d.forEach((p) => {
|
|
5717
|
-
if (
|
|
5717
|
+
if (h.name.startsWith(p)) {
|
|
5718
5718
|
c = !0;
|
|
5719
5719
|
return;
|
|
5720
5720
|
}
|
|
5721
5721
|
}), !c && t.send(vi(
|
|
5722
|
-
|
|
5723
|
-
|
|
5724
|
-
|
|
5725
|
-
|
|
5726
|
-
|
|
5727
|
-
|
|
5728
|
-
|
|
5729
|
-
|
|
5730
|
-
|
|
5722
|
+
h.startTime + Ge(),
|
|
5723
|
+
h.duration,
|
|
5724
|
+
h.responseStart && h.startTime ? h.responseStart - h.startTime : 0,
|
|
5725
|
+
h.transferSize > h.encodedBodySize ? h.transferSize - h.encodedBodySize : 0,
|
|
5726
|
+
h.encodedBodySize || 0,
|
|
5727
|
+
h.decodedBodySize || 0,
|
|
5728
|
+
h.name,
|
|
5729
|
+
h.initiatorType,
|
|
5730
|
+
h.transferSize,
|
|
5731
5731
|
// @ts-ignore
|
|
5732
|
-
|
|
5732
|
+
h.responseStatus && h.responseStatus === 304 || h.transferSize === 0
|
|
5733
5733
|
));
|
|
5734
5734
|
}
|
|
5735
|
-
const r = new PerformanceObserver((
|
|
5735
|
+
const r = new PerformanceObserver((h) => h.getEntries().forEach(i));
|
|
5736
5736
|
let o;
|
|
5737
|
-
t.attachStartCallback(function({ sessionID:
|
|
5738
|
-
|
|
5737
|
+
t.attachStartCallback(function({ sessionID: h }) {
|
|
5738
|
+
h !== o && (performance.getEntriesByType("resource").forEach(i), o = h), r.observe({ entryTypes: ["resource"] });
|
|
5739
5739
|
}), t.attachStopCallback(function() {
|
|
5740
5740
|
r.disconnect();
|
|
5741
5741
|
});
|
|
5742
5742
|
let l = 0, a = 0;
|
|
5743
5743
|
if (s.capturePageLoadTimings) {
|
|
5744
|
-
let
|
|
5744
|
+
let h = !1;
|
|
5745
5745
|
t.ticker.attach(() => {
|
|
5746
|
-
if (!
|
|
5746
|
+
if (!h && ((l === 0 || a === 0) && performance.getEntriesByType("paint").forEach((c) => {
|
|
5747
5747
|
const { name: d, startTime: p } = c;
|
|
5748
5748
|
switch (d) {
|
|
5749
5749
|
case "first-paint":
|
|
@@ -5754,7 +5754,7 @@ function da(t, e) {
|
|
|
5754
5754
|
break;
|
|
5755
5755
|
}
|
|
5756
5756
|
}), performance.timing.loadEventEnd || performance.now() > 3e4)) {
|
|
5757
|
-
|
|
5757
|
+
h = !0;
|
|
5758
5758
|
const {
|
|
5759
5759
|
// should be ok to use here, (https://github.com/mdn/content/issues/4713)
|
|
5760
5760
|
// since it is compared with the values obtained on the page load (before any possible sleep state)
|
|
@@ -5773,15 +5773,15 @@ function da(t, e) {
|
|
|
5773
5773
|
}, 30);
|
|
5774
5774
|
}
|
|
5775
5775
|
if (s.capturePageRenderTimings) {
|
|
5776
|
-
let
|
|
5776
|
+
let h = 0, c = 0, d = 0, p = null, y = !1;
|
|
5777
5777
|
t.ticker.attach(() => {
|
|
5778
5778
|
if (y)
|
|
5779
5779
|
return;
|
|
5780
5780
|
const w = performance.now();
|
|
5781
|
-
if (n !== null && (
|
|
5781
|
+
if (n !== null && (h = Math.max.apply(null, Object.keys(n).map((b) => n[b])), w - h > 1e3 && (p = ha(n), n = null)), d !== null && (w - d > 50 && (c = w), d = w - c > 5e3 ? null : w), p !== null && d === null || w > 3e4) {
|
|
5782
5782
|
y = !0, n = null;
|
|
5783
|
-
const b = p === null ? 0 :
|
|
5784
|
-
t.send(_r(b, a >
|
|
5783
|
+
const b = p === null ? 0 : ua(a || l, p), { domContentLoadedEventEnd: T, navigationStart: D } = performance.timing, B = d === null ? Math.max(c, a, T - D || 0) : 0;
|
|
5784
|
+
t.send(_r(b, a > h ? a : h, B));
|
|
5785
5785
|
}
|
|
5786
5786
|
});
|
|
5787
5787
|
}
|
|
@@ -5802,14 +5802,14 @@ function fa(t, e) {
|
|
|
5802
5802
|
const r = t.safe(() => {
|
|
5803
5803
|
e || t.send(gr(...ls(document)));
|
|
5804
5804
|
}), o = t.safe((l, a) => {
|
|
5805
|
-
const
|
|
5806
|
-
|
|
5805
|
+
const h = t.nodes.getID(a);
|
|
5806
|
+
h !== void 0 && t.send(xr(h, l[0], l[1]));
|
|
5807
5807
|
});
|
|
5808
5808
|
t.attachStartCallback(r), t.attachStopCallback(() => {
|
|
5809
5809
|
s = !1, n.clear();
|
|
5810
5810
|
}), t.nodes.attachNodeCallback((l, a) => {
|
|
5811
|
-
a && (Te(l) && l.scrollLeft + l.scrollTop > 0 ? n.set(l, [l.scrollLeft, l.scrollTop]) : kt(l) && n.set(l, ls(l))), Nt(l) && t.nodes.attachNodeListener(l, "scroll", (
|
|
5812
|
-
i(
|
|
5811
|
+
a && (Te(l) && l.scrollLeft + l.scrollTop > 0 ? n.set(l, [l.scrollLeft, l.scrollTop]) : kt(l) && n.set(l, ls(l))), Nt(l) && t.nodes.attachNodeListener(l, "scroll", (h) => {
|
|
5812
|
+
i(h.target);
|
|
5813
5813
|
});
|
|
5814
5814
|
}), t.attachEventListener(document, "scroll", (l) => {
|
|
5815
5815
|
const a = l.target;
|
|
@@ -5825,11 +5825,11 @@ function fa(t, e) {
|
|
|
5825
5825
|
function pa(t) {
|
|
5826
5826
|
let e, s, n, i, r = document.referrer;
|
|
5827
5827
|
const o = t.safe(() => {
|
|
5828
|
-
const { URL:
|
|
5829
|
-
|
|
5828
|
+
const { URL: h } = document;
|
|
5829
|
+
h !== e && (e = h, t.send(Vr(e, r, i, document.title)), i = 0, r = e);
|
|
5830
5830
|
}), l = t.safe(() => {
|
|
5831
|
-
const { innerWidth:
|
|
5832
|
-
(
|
|
5831
|
+
const { innerWidth: h, innerHeight: c } = window;
|
|
5832
|
+
(h !== s || c !== n) && (s = h, n = c, t.send(pr(s, n)));
|
|
5833
5833
|
}), a = document.hidden === void 0 ? Function.prototype : t.safe(() => t.send(Fr(document.hidden)));
|
|
5834
5834
|
t.attachStartCallback(() => {
|
|
5835
5835
|
e = null, i = Ge(), s = n = -1, o(), l(), a();
|
|
@@ -5853,7 +5853,7 @@ function ma(t) {
|
|
|
5853
5853
|
return;
|
|
5854
5854
|
let a = s.get(l);
|
|
5855
5855
|
a || (a = []);
|
|
5856
|
-
const
|
|
5856
|
+
const h = [], c = o.adoptedStyleSheets;
|
|
5857
5857
|
if (c && Symbol.iterator in c)
|
|
5858
5858
|
for (const d of c) {
|
|
5859
5859
|
let p = e.get(d);
|
|
@@ -5863,20 +5863,20 @@ function ma(t) {
|
|
|
5863
5863
|
for (let b = 0; b < w.length; b++)
|
|
5864
5864
|
t.send(ys(p, w[b].cssText, b, t.getBaseHref()));
|
|
5865
5865
|
}
|
|
5866
|
-
|
|
5866
|
+
h.push(p);
|
|
5867
5867
|
}
|
|
5868
5868
|
if (Symbol.iterator in a)
|
|
5869
5869
|
for (const d of a)
|
|
5870
|
-
|
|
5871
|
-
s.set(l,
|
|
5870
|
+
h.includes(d) || t.send(jr(d, l));
|
|
5871
|
+
s.set(l, h);
|
|
5872
5872
|
}, 20);
|
|
5873
5873
|
function i(o) {
|
|
5874
5874
|
const l = Object.getOwnPropertyDescriptor(o, "adoptedStyleSheets");
|
|
5875
5875
|
l && Object.defineProperty(o, "adoptedStyleSheets", {
|
|
5876
5876
|
...l,
|
|
5877
5877
|
set: function(a) {
|
|
5878
|
-
const
|
|
5879
|
-
return n(this),
|
|
5878
|
+
const h = l.set.call(this, a);
|
|
5879
|
+
return n(this), h;
|
|
5880
5880
|
}
|
|
5881
5881
|
});
|
|
5882
5882
|
}
|
|
@@ -5885,14 +5885,14 @@ function ma(t) {
|
|
|
5885
5885
|
return;
|
|
5886
5886
|
o.__openreplay_adpss_patched__ = !0, i(o.Document.prototype), i(o.ShadowRoot.prototype);
|
|
5887
5887
|
const { replace: l, replaceSync: a } = o.CSSStyleSheet.prototype;
|
|
5888
|
-
o.CSSStyleSheet.prototype.replace = function(
|
|
5889
|
-
return l.call(this,
|
|
5888
|
+
o.CSSStyleSheet.prototype.replace = function(h) {
|
|
5889
|
+
return l.call(this, h).then((c) => {
|
|
5890
5890
|
const d = e.get(this);
|
|
5891
|
-
return d && t.send(on(d,
|
|
5891
|
+
return d && t.send(on(d, h, t.getBaseHref())), c;
|
|
5892
5892
|
});
|
|
5893
|
-
}, o.CSSStyleSheet.prototype.replaceSync = function(
|
|
5893
|
+
}, o.CSSStyleSheet.prototype.replaceSync = function(h) {
|
|
5894
5894
|
const c = e.get(this);
|
|
5895
|
-
return c && t.send(on(c,
|
|
5895
|
+
return c && t.send(on(c, h, t.getBaseHref())), a.call(this, h);
|
|
5896
5896
|
};
|
|
5897
5897
|
};
|
|
5898
5898
|
r(window), t.observer.attachContextCallback(t.safe(r)), t.attachStopCallback(() => {
|
|
@@ -5927,19 +5927,19 @@ function va(t) {
|
|
|
5927
5927
|
t.debug.warn("No sheedID found for", o, lt);
|
|
5928
5928
|
return;
|
|
5929
5929
|
}
|
|
5930
|
-
const a = r.cssText,
|
|
5930
|
+
const a = r.cssText, h = o.cssRules, c = Array.from(h).indexOf(r);
|
|
5931
5931
|
c >= 0 ? (t.send(ys(l, a, c, t.getBaseHref())), t.send(an(l, c + 1))) : t.debug.warn("Rule index not found in", o, r);
|
|
5932
5932
|
}), n = t.safe((i) => {
|
|
5933
5933
|
const { insertRule: r, deleteRule: o } = i.CSSStyleSheet.prototype, { insertRule: l, deleteRule: a } = i.CSSGroupingRule.prototype;
|
|
5934
|
-
i.CSSStyleSheet.prototype.insertRule = function(
|
|
5935
|
-
return e(this, c,
|
|
5936
|
-
}, i.CSSStyleSheet.prototype.deleteRule = function(
|
|
5937
|
-
return e(this,
|
|
5938
|
-
}, i.CSSGroupingRule.prototype.insertRule = function(
|
|
5939
|
-
const d = l.call(this,
|
|
5934
|
+
i.CSSStyleSheet.prototype.insertRule = function(h, c = 0) {
|
|
5935
|
+
return e(this, c, h), r.call(this, h, c);
|
|
5936
|
+
}, i.CSSStyleSheet.prototype.deleteRule = function(h) {
|
|
5937
|
+
return e(this, h), o.call(this, h);
|
|
5938
|
+
}, i.CSSGroupingRule.prototype.insertRule = function(h, c = 0) {
|
|
5939
|
+
const d = l.call(this, h, c);
|
|
5940
5940
|
return s(this), d;
|
|
5941
|
-
}, i.CSSGroupingRule.prototype.deleteRule = function(
|
|
5942
|
-
const c = a.call(this,
|
|
5941
|
+
}, i.CSSGroupingRule.prototype.deleteRule = function(h = 0) {
|
|
5942
|
+
const c = a.call(this, h);
|
|
5943
5943
|
return s(this), c;
|
|
5944
5944
|
};
|
|
5945
5945
|
});
|
|
@@ -5952,8 +5952,8 @@ function va(t) {
|
|
|
5952
5952
|
const o = i.sheet, l = Ni();
|
|
5953
5953
|
lt.set(o, l), t.send(mi(l, r));
|
|
5954
5954
|
const a = o.cssRules;
|
|
5955
|
-
for (let
|
|
5956
|
-
e(o,
|
|
5955
|
+
for (let h = 0; h < a.length; h++)
|
|
5956
|
+
e(o, h, a[h].cssText);
|
|
5957
5957
|
});
|
|
5958
5958
|
}
|
|
5959
5959
|
function ya(t) {
|
|
@@ -5988,8 +5988,8 @@ function ba(t) {
|
|
|
5988
5988
|
o[2] && t.safe(() => {
|
|
5989
5989
|
l = JSON.stringify(o[2]);
|
|
5990
5990
|
});
|
|
5991
|
-
const a = [o[0], o[1], l],
|
|
5992
|
-
|
|
5991
|
+
const a = [o[0], o[1], l], h = e.get(n.document) || [];
|
|
5992
|
+
h.push(a), e.set(n.document, h);
|
|
5993
5993
|
const c = n === window ? 0 : t.nodes.getID(n.document);
|
|
5994
5994
|
if (c === void 0)
|
|
5995
5995
|
return;
|
|
@@ -6059,10 +6059,10 @@ function Sa(t, e, s, n, i) {
|
|
|
6059
6059
|
function a(p) {
|
|
6060
6060
|
return t.debug.log("Openreplay: capturing API request error", p), wa(p) && p.response ? r(p.response) : p instanceof Error && t.send(Et(p, [])), Promise.reject(p);
|
|
6061
6061
|
}
|
|
6062
|
-
function
|
|
6062
|
+
function h(p) {
|
|
6063
6063
|
t.debug.log("Openreplay: failed API request, skipping", p);
|
|
6064
6064
|
}
|
|
6065
|
-
const c = e.interceptors.request.use(o,
|
|
6065
|
+
const c = e.interceptors.request.use(o, h, {
|
|
6066
6066
|
synchronous: !0
|
|
6067
6067
|
}), d = e.interceptors.response.use(l, a, {
|
|
6068
6068
|
synchronous: !0
|
|
@@ -6225,11 +6225,11 @@ class Ca {
|
|
|
6225
6225
|
typeof i != "string" && !(i != null && i.url) || (i instanceof URL || typeof i == "string" ? this.isServiceUrl(String(i)) : this.isServiceUrl(String(i.url))))
|
|
6226
6226
|
return e.apply(window, n);
|
|
6227
6227
|
const l = new Bs(this.ignoredHeaders, this.setSessionTokenHeader, this.sanitize);
|
|
6228
|
-
return this.beforeFetch(l, i, r), this.setSessionTokenHeader((a,
|
|
6228
|
+
return this.beforeFetch(l, i, r), this.setSessionTokenHeader((a, h) => {
|
|
6229
6229
|
if (!(this.tokenUrlMatcher !== void 0 && !this.tokenUrlMatcher(l.url))) {
|
|
6230
6230
|
if (n[1] === void 0 && n[0] instanceof Request)
|
|
6231
|
-
return n[0].headers.append(a,
|
|
6232
|
-
n[1] || (n[1] = {}), n[1].headers === void 0 && (n[1] = { ...n[1], headers: {} }), n[1].headers instanceof Headers ? n[1].headers.append(a,
|
|
6231
|
+
return n[0].headers.append(a, h);
|
|
6232
|
+
n[1] || (n[1] = {}), n[1].headers === void 0 && (n[1] = { ...n[1], headers: {} }), n[1].headers instanceof Headers ? n[1].headers.append(a, h) : Array.isArray(n[1].headers) ? n[1].headers.push([a, h]) : n[1].headers[a] = h;
|
|
6233
6233
|
}
|
|
6234
6234
|
}), e.apply(window, n).then(this.afterFetch(l)).catch((a) => {
|
|
6235
6235
|
throw l.endTime = performance.now(), l.duration = l.endTime - (l.startTime || l.endTime), a;
|
|
@@ -6426,8 +6426,8 @@ class Ra {
|
|
|
6426
6426
|
o.requestData = js(r), o.startTime || (o.startTime = performance.now());
|
|
6427
6427
|
const a = e.apply(s, n);
|
|
6428
6428
|
a ? (o.endTime = performance.now(), o.duration = o.endTime - (o.startTime || o.endTime), o.status = 0, o.statusText = "Sent", o.readyState = 4) : (o.status = 500, o.statusText = "Unknown");
|
|
6429
|
-
const
|
|
6430
|
-
return
|
|
6429
|
+
const h = o.getMessage();
|
|
6430
|
+
return h && this.sendMessage(h), a;
|
|
6431
6431
|
}
|
|
6432
6432
|
}
|
|
6433
6433
|
class Ve {
|
|
@@ -6447,7 +6447,7 @@ function Da(t, e, s, n, i, r, o) {
|
|
|
6447
6447
|
var l;
|
|
6448
6448
|
t.XMLHttpRequest ? t.XMLHttpRequest = Oa.create(e, s, n, i, r, o) : Dn("XMLHttpRequest"), t.fetch ? t.fetch = Ia.create(e, s, n, i, r, o) : Dn("fetch"), (l = t == null ? void 0 : t.navigator) != null && l.sendBeacon && (t.navigator.sendBeacon = Ve.create(e, s, n, i, r));
|
|
6449
6449
|
}
|
|
6450
|
-
function
|
|
6450
|
+
function hs(t) {
|
|
6451
6451
|
return t.__or_req_data__ || (t.__or_req_data__ = { body: void 0, headers: {} }), t.__or_req_data__;
|
|
6452
6452
|
}
|
|
6453
6453
|
function An(t) {
|
|
@@ -6492,7 +6492,7 @@ function Aa(t, e = {}) {
|
|
|
6492
6492
|
}
|
|
6493
6493
|
return JSON.stringify(c);
|
|
6494
6494
|
}
|
|
6495
|
-
const
|
|
6495
|
+
const h = (c) => {
|
|
6496
6496
|
if (s.useProxy)
|
|
6497
6497
|
return Da(c, s.ignoreHeaders, o, l, (A) => t.send(A), (A) => t.isServiceURL(A), s.tokenUrlMatcher);
|
|
6498
6498
|
const d = c.fetch.bind(c), p = (A, k = {}) => {
|
|
@@ -6544,7 +6544,7 @@ function Aa(t, e = {}) {
|
|
|
6544
6544
|
return O.addEventListener("loadstart", (F) => {
|
|
6545
6545
|
N = F.timeStamp;
|
|
6546
6546
|
}), O.addEventListener("load", t.safe((F) => {
|
|
6547
|
-
const { headers: C, body: E } =
|
|
6547
|
+
const { headers: C, body: E } = hs(O), P = N > 0 ? F.timeStamp - N : 0, j = (O.getAllResponseHeaders() || "").trim().split(/[\r\n]+/), W = {};
|
|
6548
6548
|
j.forEach(function(q) {
|
|
6549
6549
|
const G = q.split(": "), H = G.shift();
|
|
6550
6550
|
i(H) || (W[H] = G.join(": "));
|
|
@@ -6567,21 +6567,21 @@ function Aa(t, e = {}) {
|
|
|
6567
6567
|
})), y.apply(this, arguments);
|
|
6568
6568
|
}
|
|
6569
6569
|
function D(A) {
|
|
6570
|
-
const k =
|
|
6570
|
+
const k = hs(this);
|
|
6571
6571
|
return k.body = A, b.apply(this, arguments);
|
|
6572
6572
|
}
|
|
6573
6573
|
function B(A, k) {
|
|
6574
6574
|
if (!i(A)) {
|
|
6575
|
-
const O =
|
|
6575
|
+
const O = hs(this);
|
|
6576
6576
|
O.headers[A] = k;
|
|
6577
6577
|
}
|
|
6578
6578
|
return w.apply(this, arguments);
|
|
6579
6579
|
}
|
|
6580
6580
|
s.axiosInstances || (c.XMLHttpRequest.prototype.open = T, c.XMLHttpRequest.prototype.send = D, c.XMLHttpRequest.prototype.setRequestHeader = B);
|
|
6581
6581
|
};
|
|
6582
|
-
|
|
6582
|
+
h(window), s.axiosInstances && s.axiosInstances.forEach((c) => {
|
|
6583
6583
|
Sa(t, c, s, l, a);
|
|
6584
|
-
}), s.captureInIframes && t.observer.attachContextCallback(t.safe(
|
|
6584
|
+
}), s.captureInIframes && t.observer.attachContextCallback(t.safe(h));
|
|
6585
6585
|
}
|
|
6586
6586
|
function Fa(t) {
|
|
6587
6587
|
t.attachEventListener(document, "selectionchange", () => {
|
|
@@ -6616,27 +6616,27 @@ class Pa {
|
|
|
6616
6616
|
constructor(e) {
|
|
6617
6617
|
var l;
|
|
6618
6618
|
if (this.options = e, this.app = null, this.crossdomainMode = !1, this.checkDoNotTrack = () => this.options.respectDoNotTrack && (navigator.doNotTrack == "1" || // @ts-ignore
|
|
6619
|
-
window.doNotTrack == "1"), this.signalStartIssue = (a,
|
|
6619
|
+
window.doNotTrack == "1"), this.signalStartIssue = (a, h) => {
|
|
6620
6620
|
const c = this.checkDoNotTrack(), d = new XMLHttpRequest(), p = this.options.ingestPoint || Si;
|
|
6621
6621
|
d.open("POST", p + "/v1/web/not-started"), d.send(JSON.stringify({
|
|
6622
6622
|
trackerVersion: "14.0.4",
|
|
6623
6623
|
projectKey: this.options.projectKey,
|
|
6624
6624
|
doNotTrack: c,
|
|
6625
|
-
reason:
|
|
6625
|
+
reason: h.length ? `missing api: ${h.join(",")}` : a
|
|
6626
6626
|
}));
|
|
6627
6627
|
}, this.restartCanvasTracking = () => {
|
|
6628
6628
|
this.app !== null && this.app.restartCanvasTracking();
|
|
6629
|
-
}, this.handleError = (a,
|
|
6629
|
+
}, this.handleError = (a, h = {}) => {
|
|
6630
6630
|
if (this.app !== null) {
|
|
6631
6631
|
if (a instanceof Error) {
|
|
6632
|
-
const c = Et(a, [],
|
|
6632
|
+
const c = Et(a, [], h);
|
|
6633
6633
|
this.app.send(c);
|
|
6634
6634
|
} else if (a instanceof ErrorEvent || "PromiseRejectionEvent" in window && a instanceof PromiseRejectionEvent) {
|
|
6635
|
-
const c = ki(a, void 0,
|
|
6635
|
+
const c = ki(a, void 0, h);
|
|
6636
6636
|
c != null && this.app.send(c);
|
|
6637
6637
|
}
|
|
6638
6638
|
}
|
|
6639
|
-
}, this.crossdomainMode = !!(
|
|
6639
|
+
}, this.crossdomainMode = !!(hr() && ((l = e.crossdomain) != null && l.enabled)), !xe || !La(e))
|
|
6640
6640
|
return;
|
|
6641
6641
|
if (window.__OPENREPLAY__) {
|
|
6642
6642
|
console.error("OpenReplay: one tracker instance has been initialised already");
|
|
@@ -6683,9 +6683,9 @@ class Pa {
|
|
|
6683
6683
|
this.app = r, this.crossdomainMode || (pa(r), Mo(r), Gr(r, e), Ma(r)), la(r, e.mouse), fa(r, this.crossdomainMode), va(r), ma(r), jo(r, e), Wo(r, e), Vo(r), Yo(r, e), da(r, e), ya(r), ba(r), Aa(r, e.network), Fa(r), window.__OPENREPLAY__ = this, e.flags && e.flags.onFlagsLoad && this.onFlagsLoad(e.flags.onFlagsLoad);
|
|
6684
6684
|
const o = window.open;
|
|
6685
6685
|
(e.autoResetOnWindowOpen || e.resetTabOnWindowOpen) && (r.attachStartCallback(() => {
|
|
6686
|
-
const a = r.getTabId(),
|
|
6686
|
+
const a = r.getTabId(), h = r.sessionStorage ?? window.sessionStorage;
|
|
6687
6687
|
window.open = function(...c) {
|
|
6688
|
-
return e.autoResetOnWindowOpen && r.resetNextPageSession(!0), e.resetTabOnWindowOpen &&
|
|
6688
|
+
return e.autoResetOnWindowOpen && r.resetNextPageSession(!0), e.resetTabOnWindowOpen && h.removeItem(e.session_tabid_key || "__openreplay_tabid"), r.resetNextPageSession(!1), h.setItem(e.session_tabid_key || "__openreplay_tabid", a), o.call(window, ...c);
|
|
6689
6689
|
};
|
|
6690
6690
|
}), r.attachStopCallback(() => {
|
|
6691
6691
|
window.open = o;
|
|
@@ -7013,7 +7013,7 @@ class Ua {
|
|
|
7013
7013
|
return this.translations[this.language][e] || e;
|
|
7014
7014
|
}
|
|
7015
7015
|
}
|
|
7016
|
-
const
|
|
7016
|
+
const ue = new Ua(), Ha = 3;
|
|
7017
7017
|
let gt = null;
|
|
7018
7018
|
function Ri() {
|
|
7019
7019
|
const t = document.getElementById("chat-window"), e = document.getElementById("chat-icon");
|
|
@@ -7024,33 +7024,20 @@ function Di() {
|
|
|
7024
7024
|
let e = parseInt(te("chatCloseCount")) || 0;
|
|
7025
7025
|
e += 1, e >= Ha ? (console.log(e), mt("disableAutoOpen", "true", 1), Mi("chatCloseCount")) : (console.log(e), mt("chatCloseCount", e, 1));
|
|
7026
7026
|
}
|
|
7027
|
-
function za(t) {
|
|
7028
|
-
const e = document.getElementById("chat-window"), s = document.getElementById("message-container"), n = document.querySelector("#input-container input");
|
|
7029
|
-
s.innerHTML = "", e.classList.add("visible");
|
|
7030
|
-
const i = document.createElement("div");
|
|
7031
|
-
i.className = "message api", i.textContent = re.translate("winePairingIntro"), s.appendChild(i), t.slice(0, 3).forEach((o) => {
|
|
7032
|
-
const l = document.createElement("div");
|
|
7033
|
-
l.className = "message dish-message", l.textContent = o, l.addEventListener("click", () => {
|
|
7034
|
-
n.value = o;
|
|
7035
|
-
}), s.appendChild(l);
|
|
7036
|
-
});
|
|
7037
|
-
const r = document.createElement("div");
|
|
7038
|
-
r.className = "message api", r.textContent = re.translate("askForDinner"), s.appendChild(r), s.scrollTop = s.scrollHeight;
|
|
7039
|
-
}
|
|
7040
|
-
function Wa(t = null) {
|
|
7027
|
+
function za(t = null) {
|
|
7041
7028
|
t ? Pi(t) : Gn(), document.getElementById("chat-window").classList.add("visible");
|
|
7042
7029
|
}
|
|
7043
7030
|
document.addEventListener("DOMContentLoaded", () => {
|
|
7044
7031
|
setupCloseButton(), setupOutsideClick();
|
|
7045
7032
|
});
|
|
7046
|
-
function
|
|
7033
|
+
function Wa(t) {
|
|
7047
7034
|
gt = t;
|
|
7048
7035
|
}
|
|
7049
7036
|
class Fn {
|
|
7050
7037
|
constructor() {
|
|
7051
7038
|
var s;
|
|
7052
7039
|
this.api = new Hs();
|
|
7053
|
-
const e = ((s = window == null ? void 0 : window.wineaterData) == null ? void 0 : s.FIRST_MESSAGE_TEXT) ||
|
|
7040
|
+
const e = ((s = window == null ? void 0 : window.wineaterData) == null ? void 0 : s.FIRST_MESSAGE_TEXT) || ue.translate("welcomeMessage");
|
|
7054
7041
|
this.displayFirstMessage(e);
|
|
7055
7042
|
}
|
|
7056
7043
|
initialize() {
|
|
@@ -7071,7 +7058,7 @@ class Fn {
|
|
|
7071
7058
|
const n = await this.api.getWineRecommendations(s);
|
|
7072
7059
|
this.hideTypingIndicator(), n && n.length ? this.displayResults(n) : this.displayMessage("No results found.", "api");
|
|
7073
7060
|
} catch {
|
|
7074
|
-
this.hideTypingIndicator(), this.displayMessage(
|
|
7061
|
+
this.hideTypingIndicator(), this.displayMessage(ue.translate("somethingWentWrong"), "api");
|
|
7075
7062
|
}
|
|
7076
7063
|
}
|
|
7077
7064
|
}
|
|
@@ -7101,19 +7088,20 @@ class Fn {
|
|
|
7101
7088
|
const l = document.createElement("div");
|
|
7102
7089
|
l.innerHTML = `
|
|
7103
7090
|
<strong>${n.Title}</strong><br>
|
|
7104
|
-
${
|
|
7105
|
-
${
|
|
7106
|
-
${
|
|
7107
|
-
<a href="${n.Url}" target="_blank">${
|
|
7091
|
+
${ue.translate("price")}: ${n.Price}<br>
|
|
7092
|
+
${ue.translate("region")}: ${n.Region}<br>
|
|
7093
|
+
${ue.translate("type")}: ${n.Type}<br>
|
|
7094
|
+
<a href="${n.Url}" target="_blank">${ue.translate("moreInfo")}</a>
|
|
7108
7095
|
`, l.querySelector("a").addEventListener("click", (c) => {
|
|
7109
7096
|
c.preventDefault(), this.sendAnalytics(n.Title), window.open(n.Url, "_blank");
|
|
7110
7097
|
}), r.appendChild(l);
|
|
7111
|
-
const
|
|
7112
|
-
|
|
7098
|
+
const h = document.createElement("div");
|
|
7099
|
+
h.className = "wine-description", h.innerHTML = n.Reason, i.appendChild(h), console.log(i), s.appendChild(i);
|
|
7113
7100
|
}), s.scrollTop = s.scrollHeight;
|
|
7114
7101
|
}
|
|
7115
7102
|
}
|
|
7116
|
-
|
|
7103
|
+
new Hs();
|
|
7104
|
+
const ht = {
|
|
7117
7105
|
PRODUCT_PAGES: /producto\/[^\/]+\/$/
|
|
7118
7106
|
// Matches any product page like 'producto/any-product-name/'
|
|
7119
7107
|
// CART_PAGE: /carrito\/$/ // Matches the cart page like 'carrito/'
|
|
@@ -7124,56 +7112,54 @@ const qa = new Hs(), ut = {
|
|
|
7124
7112
|
// Matches any URL containing 'tasting'
|
|
7125
7113
|
};
|
|
7126
7114
|
var Hn, zn;
|
|
7127
|
-
const
|
|
7115
|
+
const $a = {
|
|
7128
7116
|
FESTIVAL_PAGES: ((Hn = window.wineaterData) == null ? void 0 : Hn.FESTIVAL_PAGES) || Mn.FESTIVAL_PAGES,
|
|
7129
7117
|
TASTING_PAGES: ((zn = window.wineaterData) == null ? void 0 : zn.TASTING_PAGES) || Mn.TASTING_PAGES
|
|
7130
7118
|
};
|
|
7131
7119
|
var Wn, $n;
|
|
7132
|
-
const
|
|
7133
|
-
PRODUCT_PAGES: ((Wn = window.wineaterData) == null ? void 0 : Wn.PRODUCT_PAGES) ||
|
|
7134
|
-
CART_PAGE: (($n = window.wineaterData) == null ? void 0 : $n.CART_PAGE) || (
|
|
7120
|
+
const qa = {
|
|
7121
|
+
PRODUCT_PAGES: ((Wn = window.wineaterData) == null ? void 0 : Wn.PRODUCT_PAGES) || ht.PRODUCT_PAGES,
|
|
7122
|
+
CART_PAGE: (($n = window.wineaterData) == null ? void 0 : $n.CART_PAGE) || (ht == null ? void 0 : ht.CART_PAGE)
|
|
7135
7123
|
};
|
|
7136
|
-
async function
|
|
7137
|
-
var e, s;
|
|
7124
|
+
async function Va() {
|
|
7138
7125
|
const t = window.location.href;
|
|
7139
|
-
for (const [
|
|
7140
|
-
if (
|
|
7126
|
+
for (const [e, s] of Object.entries($a))
|
|
7127
|
+
if (s.test(t))
|
|
7141
7128
|
return !1;
|
|
7142
|
-
for (const [
|
|
7143
|
-
if (
|
|
7129
|
+
for (const [e, s] of Object.entries(qa))
|
|
7130
|
+
if (s.test(t))
|
|
7144
7131
|
try {
|
|
7145
|
-
|
|
7146
|
-
|
|
7147
|
-
|
|
7148
|
-
za(l);
|
|
7132
|
+
console.log(dishes);
|
|
7133
|
+
const n = setTimeout(() => {
|
|
7134
|
+
openChatWindow();
|
|
7149
7135
|
}, 15e3);
|
|
7150
|
-
return
|
|
7151
|
-
} catch (
|
|
7152
|
-
return console.error("Error fetching dishes:",
|
|
7136
|
+
return Wa(n), !0;
|
|
7137
|
+
} catch (n) {
|
|
7138
|
+
return console.error("Error fetching dishes:", n), !1;
|
|
7153
7139
|
}
|
|
7154
7140
|
return !1;
|
|
7155
7141
|
}
|
|
7156
|
-
const
|
|
7142
|
+
const Ga = new Pa({
|
|
7157
7143
|
projectKey: "PA8j9fAi49i6g2QnvpNs",
|
|
7158
7144
|
__DISABLE_SECURE_MODE: !0
|
|
7159
|
-
}),
|
|
7145
|
+
}), Ka = "tbMTFzLbWcXFgXK8SzyFHA6kIjelFcz5VQABVPbXdXh5XZJCDQH9BcVlrv3DF3kA";
|
|
7160
7146
|
document.addEventListener("DOMContentLoaded", () => {
|
|
7161
|
-
window.toggleChatWindow = Ri, window.closeChatWindow = Di, window.openChatWindow =
|
|
7147
|
+
window.toggleChatWindow = Ri, window.closeChatWindow = Di, window.openChatWindow = za;
|
|
7162
7148
|
});
|
|
7163
7149
|
function Ln() {
|
|
7164
7150
|
var n;
|
|
7165
|
-
|
|
7151
|
+
Ga.start();
|
|
7166
7152
|
const t = Jn.getValue("chat-btn-txt"), s = `
|
|
7167
7153
|
<div id="chatbot-container">
|
|
7168
7154
|
<div id="chat-icon" onclick="toggleChatWindow()">
|
|
7169
7155
|
<img src="https://landing-static.s3.eu-central-1.amazonaws.com/images/chat-icon.svg" alt="Chat Icon"> <!-- Update the path to your logo image -->
|
|
7170
|
-
<span>${((n = window == null ? void 0 : window.wineaterData) == null ? void 0 : n.BUTTON_TEXT) ||
|
|
7156
|
+
<span>${((n = window == null ? void 0 : window.wineaterData) == null ? void 0 : n.BUTTON_TEXT) || ue.translate(`chatButton${t}`)}</span>
|
|
7171
7157
|
</div>
|
|
7172
7158
|
|
|
7173
7159
|
<div id="chat-window" class="hidden">
|
|
7174
7160
|
<div id="chat-header">
|
|
7175
7161
|
<div id="chat-title">
|
|
7176
|
-
<h1>${
|
|
7162
|
+
<h1>${ue.translate("chatTitle")}</h1>
|
|
7177
7163
|
</div>
|
|
7178
7164
|
<div id="close-btn">×</div>
|
|
7179
7165
|
</div>
|
|
@@ -7182,12 +7168,12 @@ function Ln() {
|
|
|
7182
7168
|
<span></span><span></span><span></span>
|
|
7183
7169
|
</div>
|
|
7184
7170
|
<div id="input-container">
|
|
7185
|
-
<input type="text" id="user-input" placeholder="${
|
|
7186
|
-
<button id="send-button">${
|
|
7171
|
+
<input type="text" id="user-input" placeholder="${ue.translate("inputPlaceholder")}">
|
|
7172
|
+
<button id="send-button">${ue.translate("sendButton")}</button>
|
|
7187
7173
|
</div>
|
|
7188
7174
|
<div id="powered-by">
|
|
7189
7175
|
<a href="https://wineater.com" target="_blank">
|
|
7190
|
-
<span>${
|
|
7176
|
+
<span>${ue.translate("poweredBy")}</span>
|
|
7191
7177
|
<img src="https://landing-static.s3.eu-central-1.amazonaws.com/images/logo.svg" alt="Wineater Logo" id="chatbot-logo">
|
|
7192
7178
|
</a>
|
|
7193
7179
|
</div>
|
|
@@ -7211,7 +7197,7 @@ function jn(t) {
|
|
|
7211
7197
|
e.className = "", s.className = "", t === "right-center" ? (e.classList.add("chat-icon-right-center"), s.classList.add("right-center-aligned")) : e.classList.add("chat-icon-bottom-right");
|
|
7212
7198
|
}
|
|
7213
7199
|
document.addEventListener("DOMContentLoaded", () => {
|
|
7214
|
-
te("disableAutoOpen") ||
|
|
7200
|
+
te("disableAutoOpen") || Va();
|
|
7215
7201
|
});
|
|
7216
7202
|
var qn;
|
|
7217
7203
|
if (typeof window < "u") {
|
|
@@ -7220,7 +7206,7 @@ if (typeof window < "u") {
|
|
|
7220
7206
|
var i;
|
|
7221
7207
|
const s = ["climats", "telckel", "biobio", "weinpoint", "vinigrandi"].find((r) => window.location.href.includes(r)) || null;
|
|
7222
7208
|
let n;
|
|
7223
|
-
s && (n = s.charAt(0).toUpperCase() + s.slice(1), n === "Climats" && (t = "right-center")), await
|
|
7209
|
+
s && (n = s.charAt(0).toUpperCase() + s.slice(1), n === "Climats" && (t = "right-center")), await ue.fetchConfig(n || "Climats"), mt("chatbotToken", ((i = window.wineaterData) == null ? void 0 : i.CLIENT_TOKEN) || Ka, 365), Li(), Jn.init({
|
|
7224
7210
|
environmentID: "5RfiDoiqb4dHrNdQvzbkfM",
|
|
7225
7211
|
// api:"http://localhost:8000/api/v1/" set this if you are self hosting, and point it to your API
|
|
7226
7212
|
cacheFlags: !1,
|
|
@@ -7237,6 +7223,6 @@ if (typeof window < "u") {
|
|
|
7237
7223
|
}
|
|
7238
7224
|
export {
|
|
7239
7225
|
Di as closeChatWindow,
|
|
7240
|
-
|
|
7226
|
+
za as openChatWindow,
|
|
7241
7227
|
Ri as toggleChatWindow
|
|
7242
7228
|
};
|