wineater-bot 3.5.1 → 3.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -38,134 +38,134 @@ var $n = { exports: {} };
38
38
  (function(n, s) {
39
39
  s(e);
40
40
  })($e, function(n) {
41
- var s = { getItemSync: function(v) {
41
+ var s = { getItemSync: function(y) {
42
42
  try {
43
- return localStorage.getItem(v) || null;
43
+ return localStorage.getItem(y) || null;
44
44
  } catch {
45
45
  return null;
46
46
  }
47
- }, getItem: function(v, f) {
47
+ }, getItem: function(y, f) {
48
48
  var h = this;
49
49
  return new Promise(function(m, g) {
50
50
  try {
51
- var S = h.getItemSync(v);
51
+ var S = h.getItemSync(y);
52
52
  f == null || f(null, S), m(S);
53
53
  } catch (x) {
54
54
  f && f(x, null), g(x);
55
55
  }
56
56
  });
57
- }, setItem: function(v, f, h) {
57
+ }, setItem: function(y, f, h) {
58
58
  return new Promise(function(m, g) {
59
59
  try {
60
- localStorage.setItem(v, f), h && h(null, f), m(f);
60
+ localStorage.setItem(y, f), h && h(null, f), m(f);
61
61
  } catch (S) {
62
62
  h && h(S, null), g(S);
63
63
  }
64
64
  });
65
65
  } }, i = function() {
66
- return i = Object.assign || function(v) {
66
+ return i = Object.assign || function(y) {
67
67
  for (var f, h = 1, m = arguments.length; h < m; h++)
68
68
  for (var g in f = arguments[h])
69
- Object.prototype.hasOwnProperty.call(f, g) && (v[g] = f[g]);
70
- return v;
69
+ Object.prototype.hasOwnProperty.call(f, g) && (y[g] = f[g]);
70
+ return y;
71
71
  }, i.apply(this, arguments);
72
72
  };
73
- function r(v, f, h, m) {
73
+ function r(y, f, h, m) {
74
74
  return new (h || (h = Promise))(function(g, S) {
75
75
  function x(q) {
76
76
  try {
77
- P(m.next(q));
78
- } catch (N) {
79
- S(N);
77
+ B(m.next(q));
78
+ } catch (O) {
79
+ S(O);
80
80
  }
81
81
  }
82
- function D(q) {
82
+ function A(q) {
83
83
  try {
84
- P(m.throw(q));
85
- } catch (N) {
86
- S(N);
84
+ B(m.throw(q));
85
+ } catch (O) {
86
+ S(O);
87
87
  }
88
88
  }
89
- function P(q) {
90
- var N;
91
- q.done ? g(q.value) : (N = q.value, N instanceof h ? N : new h(function(W) {
92
- W(N);
93
- })).then(x, D);
89
+ function B(q) {
90
+ var O;
91
+ q.done ? g(q.value) : (O = q.value, O instanceof h ? O : new h(function(W) {
92
+ W(O);
93
+ })).then(x, A);
94
94
  }
95
- P((m = m.apply(v, f || [])).next());
95
+ B((m = m.apply(y, f || [])).next());
96
96
  });
97
97
  }
98
- function o(v, f) {
98
+ function o(y, f) {
99
99
  var h, m, g, S, x = { label: 0, sent: function() {
100
100
  if (1 & g[0])
101
101
  throw g[1];
102
102
  return g[1];
103
103
  }, trys: [], ops: [] };
104
- return S = { next: D(0), throw: D(1), return: D(2) }, typeof Symbol == "function" && (S[Symbol.iterator] = function() {
104
+ return S = { next: A(0), throw: A(1), return: A(2) }, typeof Symbol == "function" && (S[Symbol.iterator] = function() {
105
105
  return this;
106
106
  }), S;
107
- function D(P) {
107
+ function A(B) {
108
108
  return function(q) {
109
- return function(N) {
109
+ return function(O) {
110
110
  if (h)
111
111
  throw new TypeError("Generator is already executing.");
112
112
  for (; x; )
113
113
  try {
114
- if (h = 1, m && (g = 2 & N[0] ? m.return : N[0] ? m.throw || ((g = m.return) && g.call(m), 0) : m.next) && !(g = g.call(m, N[1])).done)
114
+ if (h = 1, m && (g = 2 & O[0] ? m.return : O[0] ? m.throw || ((g = m.return) && g.call(m), 0) : m.next) && !(g = g.call(m, O[1])).done)
115
115
  return g;
116
- switch (m = 0, g && (N = [2 & N[0], g.value]), N[0]) {
116
+ switch (m = 0, g && (O = [2 & O[0], g.value]), O[0]) {
117
117
  case 0:
118
118
  case 1:
119
- g = N;
119
+ g = O;
120
120
  break;
121
121
  case 4:
122
- return x.label++, { value: N[1], done: !1 };
122
+ return x.label++, { value: O[1], done: !1 };
123
123
  case 5:
124
- x.label++, m = N[1], N = [0];
124
+ x.label++, m = O[1], O = [0];
125
125
  continue;
126
126
  case 7:
127
- N = x.ops.pop(), x.trys.pop();
127
+ O = x.ops.pop(), x.trys.pop();
128
128
  continue;
129
129
  default:
130
- if (g = x.trys, !((g = g.length > 0 && g[g.length - 1]) || N[0] !== 6 && N[0] !== 2)) {
130
+ if (g = x.trys, !((g = g.length > 0 && g[g.length - 1]) || O[0] !== 6 && O[0] !== 2)) {
131
131
  x = 0;
132
132
  continue;
133
133
  }
134
- if (N[0] === 3 && (!g || N[1] > g[0] && N[1] < g[3])) {
135
- x.label = N[1];
134
+ if (O[0] === 3 && (!g || O[1] > g[0] && O[1] < g[3])) {
135
+ x.label = O[1];
136
136
  break;
137
137
  }
138
- if (N[0] === 6 && x.label < g[1]) {
139
- x.label = g[1], g = N;
138
+ if (O[0] === 6 && x.label < g[1]) {
139
+ x.label = g[1], g = O;
140
140
  break;
141
141
  }
142
142
  if (g && x.label < g[2]) {
143
- x.label = g[2], x.ops.push(N);
143
+ x.label = g[2], x.ops.push(O);
144
144
  break;
145
145
  }
146
146
  g[2] && x.ops.pop(), x.trys.pop();
147
147
  continue;
148
148
  }
149
- N = f.call(v, x);
149
+ O = f.call(y, x);
150
150
  } catch (W) {
151
- N = [6, W], m = 0;
151
+ O = [6, W], m = 0;
152
152
  } finally {
153
153
  h = g = 0;
154
154
  }
155
- if (5 & N[0])
156
- throw N[1];
157
- return { value: N[0] ? N[1] : void 0, done: !0 };
158
- }([P, q]);
155
+ if (5 & O[0])
156
+ throw O[1];
157
+ return { value: O[0] ? O[1] : void 0, done: !0 };
158
+ }([B, q]);
159
159
  };
160
160
  }
161
161
  }
162
- function l(v, f, h) {
162
+ function l(y, f, h) {
163
163
  if (h || arguments.length === 2)
164
164
  for (var m, g = 0, S = f.length; g < S; g++)
165
165
  !m && g in f || (m || (m = Array.prototype.slice.call(f, 0, g)), m[g] = f[g]);
166
- return v.concat(m || Array.prototype.slice.call(f));
166
+ return y.concat(m || Array.prototype.slice.call(f));
167
167
  }
168
- var c = function v(f, h) {
168
+ var c = function y(f, h) {
169
169
  if (f === h)
170
170
  return !0;
171
171
  if (f && h && typeof f == "object" && typeof h == "object") {
@@ -176,7 +176,7 @@ var $n = { exports: {} };
176
176
  if ((m = f.length) != h.length)
177
177
  return !1;
178
178
  for (g = m; g-- != 0; )
179
- if (!v(f[g], h[g]))
179
+ if (!y(f[g], h[g]))
180
180
  return !1;
181
181
  return !0;
182
182
  }
@@ -193,98 +193,98 @@ var $n = { exports: {} };
193
193
  return !1;
194
194
  for (g = m; g-- != 0; ) {
195
195
  var x = S[g];
196
- if (!v(f[x], h[x]))
196
+ if (!y(f[x], h[x]))
197
197
  return !1;
198
198
  }
199
199
  return !0;
200
200
  }
201
201
  return f != f && h != h;
202
202
  };
203
- function u(v, f) {
203
+ function u(y, f) {
204
204
  var h = Object.keys(f || {}).filter(function(m) {
205
- var g = v == null ? void 0 : v[m], S = f == null ? void 0 : f[m];
205
+ var g = y == null ? void 0 : y[m], S = f == null ? void 0 : f[m];
206
206
  return !c(g, S);
207
207
  });
208
- return Object.keys(v || {}).filter(function(m) {
208
+ return Object.keys(y || {}).filter(function(m) {
209
209
  Object.keys(f || {}).includes(m) || h.push(m);
210
210
  }), Object.keys(h).length ? h : null;
211
211
  }
212
212
  var a, d;
213
- function p(v, f, h) {
213
+ function p(y, f, h) {
214
214
  var m = "shortString", g = !0;
215
- typeof h == "number" && (m = "javaDouble", g = !1), v[m] = v[m] || {}, v[m][f] = g ? h + "" : h;
215
+ typeof h == "number" && (m = "javaDouble", g = !1), y[m] = y[m] || {}, y[m][f] = g ? h + "" : h;
216
216
  }
217
- function b(v) {
218
- return !!v && typeof v == "object" && v.value !== void 0;
217
+ function v(y) {
218
+ return !!y && typeof y == "object" && y.value !== void 0;
219
219
  }
220
- function w(v) {
221
- return Object.fromEntries(Object.entries(v).map(function(f) {
220
+ function w(y) {
221
+ return Object.fromEntries(Object.entries(y).map(function(f) {
222
222
  var h = f[0], m = f[1];
223
- return [h, b(m) ? m : { value: m }];
223
+ return [h, v(m) ? m : { value: m }];
224
224
  }));
225
225
  }
226
- function y(v) {
227
- return i(i({}, v), { identity: v.identity ? i(i({}, v.identity), { traits: w(v.identity.traits || {}) }) : void 0 });
226
+ function b(y) {
227
+ return i(i({}, y), { identity: y.identity ? i(i({}, y.identity), { traits: w(y.identity.traits || {}) }) : void 0 });
228
228
  }
229
- (function(v) {
230
- v.NONE = "NONE", v.DEFAULT_FLAGS = "DEFAULT_FLAGS", v.CACHE = "CACHE", v.SERVER = "SERVER";
229
+ (function(y) {
230
+ y.NONE = "NONE", y.DEFAULT_FLAGS = "DEFAULT_FLAGS", y.CACHE = "CACHE", y.SERVER = "SERVER";
231
231
  })(a || (a = {}));
232
- var E, O = null, B = "BULLET_TRAIN_DB", A = "BULLET_TRAIN_EVENT", k = "https://edge.api.flagsmith.com/api/v1/", _ = "flagsmith_value_", R = "flagsmith_enabled_", L = "flagsmith_trait_", I = function() {
233
- function v(f) {
232
+ var T, N = null, M = "BULLET_TRAIN_DB", D = "BULLET_TRAIN_EVENT", k = "https://edge.api.flagsmith.com/api/v1/", _ = "flagsmith_value_", R = "flagsmith_enabled_", L = "flagsmith_trait_", I = function() {
233
+ function y(f) {
234
234
  var h = this;
235
235
  this._trigger = null, this._triggerLoadingState = null, this.timestamp = null, this.isLoading = !1, this.eventSource = null, this.getFlags = function() {
236
236
  var m = h, g = m.api, S = m.evaluationContext;
237
237
  h.log("Get Flags"), h.isLoading = !0, h.loadingState.isFetching || h.setLoadingState(i(i({}, h.loadingState), { isFetching: !0 }));
238
- var x = "".concat(h.getContext().identity), D = function(P) {
239
- var q, N, W, ee;
240
- if (P && x === "".concat(h.getContext().identity)) {
241
- var oe = P.flags, te = P.traits, ne = P.identifier;
238
+ var x = "".concat(h.getContext().identity), A = function(B) {
239
+ var q, O, W, ee;
240
+ if (B && x === "".concat(h.getContext().identity)) {
241
+ var oe = B.flags, te = B.traits, ne = B.identifier;
242
242
  h.isLoading = !1;
243
243
  var ae = {}, ce = {};
244
- te = te || [], (oe = oe || []).forEach(function(K) {
245
- ae[K.feature.name.toLowerCase().replace(/ /g, "_")] = { id: K.feature.id, enabled: K.enabled, value: K.feature_state_value };
246
- }), te.forEach(function(K) {
247
- ce[K.trait_key.toLowerCase().replace(/ /g, "_")] = { transient: K.transient, value: K.trait_value };
244
+ te = te || [], (oe = oe || []).forEach(function(J) {
245
+ ae[J.feature.name.toLowerCase().replace(/ /g, "_")] = { id: J.feature.id, enabled: J.enabled, value: J.feature_state_value };
246
+ }), te.forEach(function(J) {
247
+ ce[J.trait_key.toLowerCase().replace(/ /g, "_")] = { transient: J.transient, value: J.trait_value };
248
248
  }), h.oldFlags = i({}, h.flags);
249
249
  var ge = u(h.oldFlags, ae), Ge = u((q = h.evaluationContext.identity) === null || q === void 0 ? void 0 : q.traits, ce);
250
250
  if ((ne || Object.keys(ce).length) && (h.evaluationContext.identity = { traits: ce }, ne && (h.evaluationContext.identity.identifier = ne)), h.flags = ae, h.updateStorage(), h._onChange(h.oldFlags, { isFromServer: !0, flagsChanged: ge, traitsChanged: Ge }, h._loadedState(null, a.SERVER)), h.datadogRum)
251
251
  try {
252
252
  if (h.datadogRum.trackTraits) {
253
253
  var Ke = {};
254
- Object.keys(((N = h.evaluationContext.identity) === null || N === void 0 ? void 0 : N.traits) || {}).map(function(K) {
255
- Ke[L + K] = h.getTrait(K);
254
+ Object.keys(((O = h.evaluationContext.identity) === null || O === void 0 ? void 0 : O.traits) || {}).map(function(J) {
255
+ Ke[L + J] = h.getTrait(J);
256
256
  });
257
257
  var Le = i(i(i({}, h.datadogRum.client.getUser()), { id: h.datadogRum.client.getUser().id || ((W = h.evaluationContext.identity) === null || W === void 0 ? void 0 : W.identifier) }), Ke);
258
258
  h.log("Setting Datadog user", Le), h.datadogRum.client.setUser(Le);
259
259
  }
260
- } catch (K) {
261
- console.error(K);
260
+ } catch (J) {
261
+ console.error(J);
262
262
  }
263
263
  if (h.dtrum)
264
264
  try {
265
265
  var se = { javaDouble: {}, date: {}, shortString: {}, javaLongOrObject: {} };
266
- Object.keys(h.flags).map(function(K) {
267
- p(se, _ + K, h.getValue(K, { skipAnalytics: !0 })), p(se, R + K, h.hasFeature(K, { skipAnalytics: !0 }));
268
- }), Object.keys(((ee = h.evaluationContext.identity) === null || ee === void 0 ? void 0 : ee.traits) || {}).map(function(K) {
269
- p(se, L + K, h.getTrait(K));
266
+ Object.keys(h.flags).map(function(J) {
267
+ p(se, _ + J, h.getValue(J, { skipAnalytics: !0 })), p(se, R + J, h.hasFeature(J, { skipAnalytics: !0 }));
268
+ }), Object.keys(((ee = h.evaluationContext.identity) === null || ee === void 0 ? void 0 : ee.traits) || {}).map(function(J) {
269
+ p(se, L + J, h.getTrait(J));
270
270
  }), h.log("Sending javaLongOrObject traits to dynatrace", se.javaLongOrObject), h.log("Sending date traits to dynatrace", se.date), h.log("Sending shortString traits to dynatrace", se.shortString), h.log("Sending javaDouble to dynatrace", se.javaDouble), h.dtrum.sendSessionProperties(se.javaLongOrObject, se.date, se.shortString, se.javaDouble);
271
- } catch (K) {
272
- console.error(K);
271
+ } catch (J) {
272
+ console.error(J);
273
273
  }
274
274
  }
275
275
  };
276
- return S.identity ? Promise.all([S.identity.traits && Object.keys(S.identity.traits).length || !S.identity.identifier ? h.getJSON(g + "identities/", "POST", JSON.stringify({ identifier: S.identity.identifier, transient: S.identity.transient, traits: Object.entries(S.identity.traits).map(function(P) {
277
- var q = P[0], N = P[1];
278
- return { trait_key: q, trait_value: N == null ? void 0 : N.value, transient: N == null ? void 0 : N.transient };
279
- }).filter(function(P) {
280
- return P.trait_value !== void 0 || (h.log("Warning - attempted to set an undefined trait value for key", P.trait_key), !1);
281
- }) })) : h.getJSON(g + "identities/?identifier=" + encodeURIComponent(S.identity.identifier) + (S.identity.transient ? "&transient=true" : ""))]).then(function(P) {
282
- return h.evaluationContext.identity = i(i({}, h.evaluationContext.identity), { traits: {} }), D(P == null ? void 0 : P[0]);
283
- }).catch(function(P) {
284
- var q = P.message, N = new Error(q);
285
- return Promise.reject(N);
286
- }) : h.getJSON(g + "flags/").then(function(P) {
287
- return D({ flags: P, traits: void 0 });
276
+ return S.identity ? Promise.all([S.identity.traits && Object.keys(S.identity.traits).length || !S.identity.identifier ? h.getJSON(g + "identities/", "POST", JSON.stringify({ identifier: S.identity.identifier, transient: S.identity.transient, traits: Object.entries(S.identity.traits).map(function(B) {
277
+ var q = B[0], O = B[1];
278
+ return { trait_key: q, trait_value: O == null ? void 0 : O.value, transient: O == null ? void 0 : O.transient };
279
+ }).filter(function(B) {
280
+ return B.trait_value !== void 0 || (h.log("Warning - attempted to set an undefined trait value for key", B.trait_key), !1);
281
+ }) })) : h.getJSON(g + "identities/?identifier=" + encodeURIComponent(S.identity.identifier) + (S.identity.transient ? "&transient=true" : ""))]).then(function(B) {
282
+ return h.evaluationContext.identity = i(i({}, h.evaluationContext.identity), { traits: {} }), A(B == null ? void 0 : B[0]);
283
+ }).catch(function(B) {
284
+ var q = B.message, O = new Error(q);
285
+ return Promise.reject(O);
286
+ }) : h.getJSON(g + "flags/").then(function(B) {
287
+ return A({ flags: B, traits: void 0 });
288
288
  });
289
289
  }, this.analyticsFlags = function() {
290
290
  var m = h.api;
@@ -298,16 +298,16 @@ var $n = { exports: {} };
298
298
  h.log("Exception fetching evaluationEvent", g);
299
299
  }) : void 0;
300
300
  }, this.datadogRum = null, this.loadingState = { isLoading: !0, isFetching: !0, error: null, source: a.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) {
301
- var x = h.flags && h.flags[m.toLowerCase().replace(/ /g, "_")], D = null;
302
- if (x && (D = x.value), g != null && g.skipAnalytics || S || h.evaluateFlag(m, "VALUE"), D === null && (g == null ? void 0 : g.fallback) !== void 0)
301
+ var x = h.flags && h.flags[m.toLowerCase().replace(/ /g, "_")], A = null;
302
+ if (x && (A = x.value), g != null && g.skipAnalytics || S || h.evaluateFlag(m, "VALUE"), A === null && (g == null ? void 0 : g.fallback) !== void 0)
303
303
  return g.fallback;
304
304
  if (g != null && g.json)
305
305
  try {
306
- return D === null ? (h.log("Tried to parse null flag as JSON: " + m), null) : JSON.parse(D);
306
+ return A === null ? (h.log("Tried to parse null flag as JSON: " + m), null) : JSON.parse(A);
307
307
  } catch {
308
308
  return g.fallback;
309
309
  }
310
- return D;
310
+ return A;
311
311
  }, this.getTrait = function(m) {
312
312
  var g, S;
313
313
  return ((g = h.evaluationContext.identity) === null || g === void 0 ? void 0 : g.traits) && ((S = h.evaluationContext.identity.traits[m.toLowerCase().replace(/ /g, "_")]) === null || S === void 0 ? void 0 : S.value);
@@ -318,7 +318,7 @@ var $n = { exports: {} };
318
318
  return [S, x == null ? void 0 : x.value];
319
319
  }));
320
320
  }, this.setContext = function(m) {
321
- var g = y(m);
321
+ var g = b(m);
322
322
  return h.evaluationContext = i(i({}, g), { environment: g.environment || h.evaluationContext.environment }), h.initialised ? h.getFlags() : Promise.resolve();
323
323
  }, this.getContext = function() {
324
324
  return h.evaluationContext;
@@ -332,22 +332,22 @@ var $n = { exports: {} };
332
332
  var g;
333
333
  if (h.api)
334
334
  return h.setContext(i(i({}, h.evaluationContext), { identity: i(i({}, h.evaluationContext.identity), { traits: i(i({}, (g = h.evaluationContext.identity) === null || g === void 0 ? void 0 : g.traits), Object.fromEntries(Object.entries(m).map(function(S) {
335
- var x = S[0], D = S[1];
336
- return [x, b(D) ? D : { value: D }];
335
+ var x = S[0], A = S[1];
336
+ return [x, v(A) ? A : { value: A }];
337
337
  }))) }) }));
338
338
  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.");
339
339
  }, this.hasFeature = function(m, g) {
340
- var S = typeof g == "object", x = h.flags && h.flags[m.toLowerCase().replace(/ /g, "_")], D = !1;
341
- return !x && S && g.fallback !== void 0 ? D = g == null ? void 0 : g.fallback : x && x.enabled && (D = !0), (S && !g.skipAnalytics || !g) && h.evaluateFlag(m, "ENABLED"), D;
340
+ var S = typeof g == "object", x = h.flags && h.flags[m.toLowerCase().replace(/ /g, "_")], A = !1;
341
+ return !x && S && g.fallback !== void 0 ? A = g == null ? void 0 : g.fallback : x && x.enabled && (A = !0), (S && !g.skipAnalytics || !g) && h.evaluateFlag(m, "ENABLED"), A;
342
342
  }, this.getJSON = function(m, g, S) {
343
- var x, D = h;
344
- D.evaluationContext;
345
- var P = D.headers, q = { method: g || "GET", body: S, cache: "no-cache", headers: {} };
346
- h.evaluationContext.environment && (q.headers["X-Environment-Key"] = h.evaluationContext.environment.apiKey), g && g !== "GET" && (q.headers["Content-Type"] = "application/json; charset=utf-8"), P && Object.assign(q.headers, P), d || console.error("Flagsmith: fetch is undefined, please specify a fetch implementation into flagsmith.init to support SSR.");
347
- var N = "".concat((x = h.evaluationContext.identity) === null || x === void 0 ? void 0 : x.identifier);
343
+ var x, A = h;
344
+ A.evaluationContext;
345
+ var B = A.headers, q = { method: g || "GET", body: S, cache: "no-cache", headers: {} };
346
+ h.evaluationContext.environment && (q.headers["X-Environment-Key"] = h.evaluationContext.environment.apiKey), g && g !== "GET" && (q.headers["Content-Type"] = "application/json; charset=utf-8"), B && Object.assign(q.headers, B), d || console.error("Flagsmith: fetch is undefined, please specify a fetch implementation into flagsmith.init to support SSR.");
347
+ var O = "".concat((x = h.evaluationContext.identity) === null || x === void 0 ? void 0 : x.identifier);
348
348
  return d(m, q).then(function(W) {
349
349
  var ee, oe, te = "".concat((ee = h.evaluationContext.identity) === null || ee === void 0 ? void 0 : ee.identifier);
350
- if (N === te) {
350
+ if (O === te) {
351
351
  var ne = (oe = W.headers) === null || oe === void 0 ? void 0 : oe.get("x-flagsmith-document-updated-at");
352
352
  if (ne)
353
353
  try {
@@ -367,7 +367,7 @@ var $n = { exports: {} };
367
367
  return !ge && W.status && (ge = "API Response: ".concat(W.status)), W.status && W.status >= 200 && W.status < 300 ? ge : Promise.reject(new Error(ge));
368
368
  });
369
369
  }
370
- h.log("Received response with identity mismatch, ignoring response. Requested: ".concat(N, ", Current: ").concat(te));
370
+ h.log("Received response with identity mismatch, ignoring response. Requested: ".concat(O, ", Current: ").concat(te));
371
371
  });
372
372
  }, this.evaluateFlag = function(m, g) {
373
373
  if (h.datadogRum && (h.datadogRum.client.addFeatureFlagEvaluation ? g === "VALUE" ? h.datadogRum.client.addFeatureFlagEvaluation(_ + m, h.getValue(m, {}, !0)) : h.datadogRum.client.addFeatureFlagEvaluation(R + m, h.hasFeature(m, !0)) : console.error("Flagsmith: Your datadog RUM client does not support the function addFeatureFlagEvaluation, please update it.")), h.enableAnalytics) {
@@ -377,30 +377,30 @@ var $n = { exports: {} };
377
377
  }
378
378
  h.updateEventStorage();
379
379
  }, this._onChange = function(m, g, S) {
380
- var x, D;
381
- h.setLoadingState(S), (x = h.onChange) === null || x === void 0 || x.call(h, m, g, h.loadingState), (D = h._trigger) === null || D === void 0 || D.call(h);
382
- }, 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 && (E = f.eventSource), f.AsyncStorage && (O = f.AsyncStorage);
380
+ var x, A;
381
+ h.setLoadingState(S), (x = h.onChange) === null || x === void 0 || x.call(h, m, g, h.loadingState), (A = h._trigger) === null || A === void 0 || A.call(h);
382
+ }, 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 && (N = f.AsyncStorage);
383
383
  }
384
- return v.prototype.init = function(f) {
384
+ return y.prototype.init = function(f) {
385
385
  var h, m, g;
386
386
  return r(this, void 0, void 0, function() {
387
- var S, x, D, P, q, N, W, ee, oe, te, ne, ae, ce, ge, Ge, Ke, Le, se, K, Ct, Je, Pn, Xe, _t, Bn, jn, Nt, zn, Ot, Ye, Me, Un, ie = this;
387
+ var S, x, A, B, q, O, W, ee, oe, te, ne, ae, ce, ge, Ge, Ke, Le, se, J, Ct, Je, Pn, Xe, _t, Bn, jn, Nt, zn, Ot, Ye, Me, Un, ie = this;
388
388
  return o(this, function(fe) {
389
389
  switch (fe.label) {
390
390
  case 0:
391
- S = y(f.evaluationContext || this.evaluationContext), fe.label = 1;
391
+ S = b(f.evaluationContext || this.evaluationContext), fe.label = 1;
392
392
  case 1:
393
- if (fe.trys.push([1, 13, , 14]), x = f.environmentID, D = f.api, P = D === void 0 ? k : D, q = f.headers, N = f.onChange, W = f.cacheFlags, ee = f.datadogRum, oe = f.onError, te = f.defaultFlags, ne = f.fetch, ae = f.preventFetch, ce = f.enableLogs, ge = f.enableDynatrace, Ge = f.enableAnalytics, Ke = f.realtime, Le = f.eventSourceUrl, se = Le === void 0 ? "https://realtime.flagsmith.com/" : Le, K = f.AsyncStorage, Ct = f.identity, Je = f.traits, Pn = f.state, Xe = f.cacheOptions, _t = f.angularHttpClient, Bn = f._trigger, jn = f._triggerLoadingState, S.environment = x ? { apiKey: x } : S.environment, !S.environment || !S.environment.apiKey)
393
+ if (fe.trys.push([1, 13, , 14]), x = f.environmentID, A = f.api, B = A === void 0 ? k : A, q = f.headers, O = f.onChange, W = f.cacheFlags, ee = f.datadogRum, oe = f.onError, te = f.defaultFlags, ne = f.fetch, ae = f.preventFetch, ce = f.enableLogs, ge = f.enableDynatrace, Ge = f.enableAnalytics, Ke = f.realtime, Le = f.eventSourceUrl, se = Le === void 0 ? "https://realtime.flagsmith.com/" : Le, J = f.AsyncStorage, Ct = f.identity, Je = f.traits, Pn = f.state, Xe = f.cacheOptions, _t = f.angularHttpClient, Bn = f._trigger, jn = f._triggerLoadingState, S.environment = x ? { apiKey: x } : S.environment, !S.environment || !S.environment.apiKey)
394
394
  throw new Error("Please provide `evaluationContext.environment` with non-empty `apiKey`");
395
395
  if (S.identity = Ct || Je ? { identifier: Ct, traits: Je ? Object.fromEntries(Object.entries(Je).map(function(le) {
396
396
  return [le[0], { value: le[1] }];
397
- })) : {} } : S.identity, this.evaluationContext = S, this.api = P, this.headers = q, this.getFlagInterval = null, this.analyticsInterval = null, this.onChange = N, Nt = "Wrong Flagsmith Configuration: preventFetch is true and no defaulFlags provided", this._trigger = Bn || this._trigger, this._triggerLoadingState = jn || this._triggerLoadingState, this.onError = function(le) {
397
+ })) : {} } : S.identity, this.evaluationContext = S, this.api = B, this.headers = q, this.getFlagInterval = null, this.analyticsInterval = null, this.onChange = O, Nt = "Wrong Flagsmith Configuration: preventFetch is true and no defaulFlags provided", this._trigger = Bn || this._trigger, this._triggerLoadingState = jn || this._triggerLoadingState, this.onError = function(le) {
398
398
  ie.setLoadingState(i(i({}, ie.loadingState), { isFetching: !1, isLoading: !1, error: le })), oe == null || oe(le);
399
- }, this.enableLogs = ce || !1, this.cacheOptions = Xe ? { skipAPI: !!Xe.skipAPI, ttl: Xe.ttl || 0, loadStale: !!Xe.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."), ne && (d = ne), this.enableAnalytics = Ge || !1, this.flags = Object.assign({}, te) || {}, this.datadogRum = ee || null, this.initialised = !0, this.ticks = 1e4, this.timer = this.enableLogs ? (/* @__PURE__ */ new Date()).valueOf() : null, this.cacheFlags = O !== void 0 && !!W, K && (O = K), Ke && typeof window < "u" && this.setupRealtime(se, S.environment.apiKey), Object.keys(this.flags).length && (this.loadingState = i(i({}, this.loadingState), { isLoading: !1, source: a.DEFAULT_FLAGS })), this.setState(Pn), this.log("Initialising with properties", f, this), ge && (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), _t && (d = /* @__PURE__ */ function(le) {
399
+ }, this.enableLogs = ce || !1, this.cacheOptions = Xe ? { skipAPI: !!Xe.skipAPI, ttl: Xe.ttl || 0, loadStale: !!Xe.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."), ne && (d = ne), this.enableAnalytics = Ge || !1, this.flags = Object.assign({}, te) || {}, this.datadogRum = ee || null, this.initialised = !0, this.ticks = 1e4, this.timer = this.enableLogs ? (/* @__PURE__ */ new Date()).valueOf() : null, this.cacheFlags = N !== void 0 && !!W, J && (N = J), Ke && typeof window < "u" && this.setupRealtime(se, S.environment.apiKey), Object.keys(this.flags).length && (this.loadingState = i(i({}, this.loadingState), { isLoading: !1, source: a.DEFAULT_FLAGS })), this.setState(Pn), this.log("Initialising with properties", f, this), ge && (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), _t && (d = /* @__PURE__ */ function(le) {
400
400
  return function(me, ve) {
401
- var Te = ve.headers, X = ve.method, Fe = ve.body;
401
+ var Te = ve.headers, Y = ve.method, Fe = ve.body;
402
402
  return new Promise(function(Oe) {
403
- switch (X) {
403
+ switch (Y) {
404
404
  case "GET":
405
405
  return le.get(me, { headers: Te }).subscribe(function(xe) {
406
406
  Oe({ ok: !0, text: function() {
@@ -417,14 +417,14 @@ var $n = { exports: {} };
417
417
  }
418
418
  });
419
419
  };
420
- }(_t)), O && this.canUseStorage && O.getItem(A).then(function(le) {
420
+ }(_t)), N && this.canUseStorage && N.getItem(D).then(function(le) {
421
421
  try {
422
422
  ie.evaluationEvent = JSON.parse(le) || {};
423
423
  } catch {
424
424
  ie.evaluationEvent = {};
425
425
  }
426
426
  ie.analyticsInterval = setInterval(ie.analyticsFlags, ie.ticks);
427
- }), this.enableAnalytics && (this.analyticsInterval && clearInterval(this.analyticsInterval), O && this.canUseStorage && O.getItem(A, function(le, me) {
427
+ }), this.enableAnalytics && (this.analyticsInterval && clearInterval(this.analyticsInterval), N && this.canUseStorage && N.getItem(D, function(le, me) {
428
428
  if (me && ie.evaluationContext.environment) {
429
429
  var ve = JSON.parse(me);
430
430
  if (ve[ie.evaluationContext.environment.apiKey]) {
@@ -434,11 +434,11 @@ var $n = { exports: {} };
434
434
  }
435
435
  })), !W)
436
436
  return [3, 9];
437
- if (!O || !this.canUseStorage)
437
+ if (!N || !this.canUseStorage)
438
438
  return [3, 8];
439
439
  zn = function(le, me) {
440
440
  return r(ie, void 0, void 0, function() {
441
- var ve, Te, X, Fe, Oe, xe, Rt, Hn, Dt, At, Lt, Mt, Ft, Pt, Bt, jt, zt, Ut, Ht, $t, qt, Wt, Vt, Gt;
441
+ var ve, Te, Y, Fe, Oe, xe, Rt, Hn, Dt, At, Lt, Mt, Ft, Pt, Bt, jt, zt, Ut, Ht, $t, qt, Wt, Vt, Gt;
442
442
  return o(this, function(Ee) {
443
443
  switch (Ee.label) {
444
444
  case 0:
@@ -446,7 +446,7 @@ var $n = { exports: {} };
446
446
  return [3, 7];
447
447
  ve = null, Te = null, Ee.label = 1;
448
448
  case 1:
449
- return Ee.trys.push([1, 5, , 6]), X = JSON.parse(me), Fe = !1, Oe = !1, X && X.api === this.api && ((At = (Dt = X.evaluationContext) === null || Dt === void 0 ? void 0 : Dt.environment) === null || At === void 0 ? void 0 : At.apiKey) === ((Lt = this.evaluationContext.environment) === null || Lt === void 0 ? void 0 : Lt.apiKey) && (xe = !0, this.evaluationContext.identity && ((Ft = (Mt = X.evaluationContext) === null || Mt === void 0 ? void 0 : Mt.identity) === null || Ft === void 0 ? void 0 : Ft.identifier) !== this.evaluationContext.identity.identifier && (this.log("Ignoring cache, identity has changed from " + ((Bt = (Pt = X.evaluationContext) === null || Pt === void 0 ? void 0 : Pt.identity) === null || Bt === void 0 ? void 0 : Bt.identifier) + " to " + this.evaluationContext.identity.identifier), xe = !1), this.cacheOptions.ttl && (!X.ts || (/* @__PURE__ */ new Date()).valueOf() - X.ts > this.cacheOptions.ttl) && (X.ts && !this.cacheOptions.loadStale ? (this.log("Ignoring cache, timestamp is too old ts:" + X.ts + " ttl: " + this.cacheOptions.ttl + " time elapsed since cache: " + ((/* @__PURE__ */ new Date()).valueOf() - X.ts) + "ms"), xe = !1) : X.ts && this.cacheOptions.loadStale && (this.log("Loading stale cache, timestamp ts:" + X.ts + " ttl: " + this.cacheOptions.ttl + " time elapsed since cache: " + ((/* @__PURE__ */ new Date()).valueOf() - X.ts) + "ms"), Oe = !0, xe = !0)), xe && (Fe = !0, Te = u((jt = this.evaluationContext.identity) === null || jt === void 0 ? void 0 : jt.traits, (Ut = (zt = X.evaluationContext) === null || zt === void 0 ? void 0 : zt.identity) === null || Ut === void 0 ? void 0 : Ut.traits), ve = u(this.flags, X.flags), this.setState(i(i({}, X), { evaluationContext: y(i(i({}, X.evaluationContext), { identity: !((Ht = X.evaluationContext) === null || Ht === void 0) && Ht.identity ? i(i({}, ($t = X.evaluationContext) === null || $t === void 0 ? void 0 : $t.identity), { traits: i(i({}, ((Wt = (qt = X.evaluationContext) === null || qt === void 0 ? void 0 : qt.identity) === null || Wt === void 0 ? void 0 : Wt.traits) || {}), Je || {}) }) : void 0 })) })), this.log("Retrieved flags from cache", X))), Fe ? (Rt = !ae && (!this.cacheOptions.skipAPI || Oe), this._onChange(null, { isFromServer: !1, flagsChanged: ve, traitsChanged: Te }, this._loadedState(null, a.CACHE, Rt)), this.oldFlags = this.flags, this.cacheOptions.skipAPI && Fe && !Oe && this.log("Skipping API, using cache"), Rt && this.getFlags(), [3, 4]) : [3, 2];
449
+ return Ee.trys.push([1, 5, , 6]), Y = JSON.parse(me), Fe = !1, Oe = !1, Y && Y.api === this.api && ((At = (Dt = Y.evaluationContext) === null || Dt === void 0 ? void 0 : Dt.environment) === null || At === void 0 ? void 0 : At.apiKey) === ((Lt = this.evaluationContext.environment) === null || Lt === void 0 ? void 0 : Lt.apiKey) && (xe = !0, this.evaluationContext.identity && ((Ft = (Mt = Y.evaluationContext) === null || Mt === void 0 ? void 0 : Mt.identity) === null || Ft === void 0 ? void 0 : Ft.identifier) !== this.evaluationContext.identity.identifier && (this.log("Ignoring cache, identity has changed from " + ((Bt = (Pt = Y.evaluationContext) === null || Pt === void 0 ? void 0 : Pt.identity) === null || Bt === void 0 ? void 0 : Bt.identifier) + " to " + this.evaluationContext.identity.identifier), xe = !1), this.cacheOptions.ttl && (!Y.ts || (/* @__PURE__ */ new Date()).valueOf() - Y.ts > this.cacheOptions.ttl) && (Y.ts && !this.cacheOptions.loadStale ? (this.log("Ignoring cache, timestamp is too old ts:" + Y.ts + " ttl: " + this.cacheOptions.ttl + " time elapsed since cache: " + ((/* @__PURE__ */ new Date()).valueOf() - Y.ts) + "ms"), xe = !1) : Y.ts && this.cacheOptions.loadStale && (this.log("Loading stale cache, timestamp ts:" + Y.ts + " ttl: " + this.cacheOptions.ttl + " time elapsed since cache: " + ((/* @__PURE__ */ new Date()).valueOf() - Y.ts) + "ms"), Oe = !0, xe = !0)), xe && (Fe = !0, Te = u((jt = this.evaluationContext.identity) === null || jt === void 0 ? void 0 : jt.traits, (Ut = (zt = Y.evaluationContext) === null || zt === void 0 ? void 0 : zt.identity) === null || Ut === void 0 ? void 0 : Ut.traits), ve = u(this.flags, Y.flags), this.setState(i(i({}, Y), { evaluationContext: b(i(i({}, Y.evaluationContext), { identity: !((Ht = Y.evaluationContext) === null || Ht === void 0) && Ht.identity ? i(i({}, ($t = Y.evaluationContext) === null || $t === void 0 ? void 0 : $t.identity), { traits: i(i({}, ((Wt = (qt = Y.evaluationContext) === null || qt === void 0 ? void 0 : qt.identity) === null || Wt === void 0 ? void 0 : Wt.traits) || {}), Je || {}) }) : void 0 })) })), this.log("Retrieved flags from cache", Y))), Fe ? (Rt = !ae && (!this.cacheOptions.skipAPI || Oe), this._onChange(null, { isFromServer: !1, flagsChanged: ve, traitsChanged: Te }, this._loadedState(null, a.CACHE, Rt)), this.oldFlags = this.flags, this.cacheOptions.skipAPI && Fe && !Oe && this.log("Skipping API, using cache"), Rt && this.getFlags(), [3, 4]) : [3, 2];
450
450
  case 2:
451
451
  return ae ? [3, 4] : [4, this.getFlags()];
452
452
  case 3:
@@ -477,9 +477,9 @@ var $n = { exports: {} };
477
477
  });
478
478
  }, fe.label = 2;
479
479
  case 2:
480
- return fe.trys.push([2, 7, , 8]), O.getItemSync ? (Ot = O.getItemSync(B), [3, 5]) : [3, 3];
480
+ return fe.trys.push([2, 7, , 8]), N.getItemSync ? (Ot = N.getItemSync(M), [3, 5]) : [3, 3];
481
481
  case 3:
482
- return [4, O.getItem(B)];
482
+ return [4, N.getItem(M)];
483
483
  case 4:
484
484
  Ot = fe.sent(), fe.label = 5;
485
485
  case 5:
@@ -508,93 +508,93 @@ var $n = { exports: {} };
508
508
  }
509
509
  });
510
510
  });
511
- }, v.prototype._loadedState = function(f, h, m) {
511
+ }, y.prototype._loadedState = function(f, h, m) {
512
512
  return f === void 0 && (f = null), m === void 0 && (m = !1), { error: f, isFetching: m, isLoading: !1, source: h };
513
- }, v.prototype.getAllFlags = function() {
513
+ }, y.prototype.getAllFlags = function() {
514
514
  return this.flags;
515
- }, v.prototype.identify = function(f, h, m) {
515
+ }, y.prototype.identify = function(f, h, m) {
516
516
  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), h && (this.evaluationContext.identity.traits = Object.fromEntries(Object.entries(h).map(function(g) {
517
517
  var S = g[0], x = g[1];
518
- return [S, b(x) ? x : { value: x }];
518
+ return [S, v(x) ? x : { value: x }];
519
519
  }))), this.initialised ? this.getFlags() : Promise.resolve();
520
- }, v.prototype.getState = function() {
520
+ }, y.prototype.getState = function() {
521
521
  return { api: this.api, flags: this.flags, ts: this.ts, evaluationContext: this.evaluationContext, evaluationEvent: this.evaluationEvent };
522
- }, v.prototype.setState = function(f) {
522
+ }, y.prototype.setState = function(f) {
523
523
  f && (this.initialised = !0, this.api = f.api || this.api || k, this.flags = f.flags || this.flags, this.evaluationContext = f.evaluationContext || this.evaluationContext, this.evaluationEvent = f.evaluationEvent || this.evaluationEvent, this.log("setState called", this));
524
- }, v.prototype.logout = function() {
524
+ }, y.prototype.logout = function() {
525
525
  return this.evaluationContext.identity = null, this.initialised ? this.getFlags() : Promise.resolve();
526
- }, v.prototype.startListening = function(f) {
526
+ }, y.prototype.startListening = function(f) {
527
527
  f === void 0 && (f = 1e3), this.getFlagInterval && clearInterval(this.getFlagInterval), this.getFlagInterval = setInterval(this.getFlags, f);
528
- }, v.prototype.stopListening = function() {
528
+ }, y.prototype.stopListening = function() {
529
529
  this.getFlagInterval && (clearInterval(this.getFlagInterval), this.getFlagInterval = null);
530
- }, v.prototype.log = function() {
530
+ }, y.prototype.log = function() {
531
531
  for (var f = [], h = 0; h < arguments.length; h++)
532
532
  f[h] = arguments[h];
533
533
  this.enableLogs && console.log.apply(this, l(["FLAGSMITH:", (/* @__PURE__ */ new Date()).valueOf() - (this.timer || 0), "ms"], f, !0));
534
- }, v.prototype.updateStorage = function() {
534
+ }, y.prototype.updateStorage = function() {
535
535
  if (this.cacheFlags) {
536
536
  this.ts = (/* @__PURE__ */ new Date()).valueOf();
537
537
  var f = JSON.stringify(this.getState());
538
- this.log("Setting storage", f), O.setItem(B, f);
538
+ this.log("Setting storage", f), N.setItem(M, f);
539
539
  }
540
- }, v.prototype.updateEventStorage = function() {
540
+ }, y.prototype.updateEventStorage = function() {
541
541
  if (this.enableAnalytics) {
542
542
  var f = JSON.stringify(this.getState().evaluationEvent);
543
- O.setItem(A, f);
543
+ N.setItem(D, f);
544
544
  }
545
- }, v.prototype.setLoadingState = function(f) {
545
+ }, y.prototype.setLoadingState = function(f) {
546
546
  var h;
547
547
  c(f, this.loadingState) || (this.loadingState = i({}, f), this.log("Loading state changed", f), (h = this._triggerLoadingState) === null || h === void 0 || h.call(this));
548
- }, v.prototype.setupRealtime = function(f, h) {
548
+ }, y.prototype.setupRealtime = function(f, h) {
549
549
  var m = this, g = f + "sse/environments/" + h + "/stream";
550
- E ? this.eventSource || (this.log("Creating event source with url " + g), this.eventSource = new E(g), this.eventSource.addEventListener("environment_updated", function(S) {
550
+ T ? this.eventSource || (this.log("Creating event source with url " + g), this.eventSource = new T(g), this.eventSource.addEventListener("environment_updated", function(S) {
551
551
  var x;
552
552
  try {
553
553
  x = JSON.parse(S.data).updated_at;
554
- } catch (D) {
555
- m.log("Could not parse sse event", D);
554
+ } catch (A) {
555
+ m.log("Could not parse sse event", A);
556
556
  }
557
557
  x ? !m.timestamp || x > m.timestamp ? m.isLoading ? m.log("updated_at is new, but flags are loading", S.data, m.timestamp) : (m.log("updated_at is new, fetching flags", S.data, m.timestamp), m.getFlags()) : m.log("updated_at is outdated, skipping get flags", S.data, m.timestamp) : m.log("No updated_at received, fetching flags", S);
558
558
  })) : this.log("Error, EventSource is undefined");
559
- }, v;
559
+ }, y;
560
560
  }();
561
- function T(v) {
562
- var f = v.fetch, h = v.AsyncStorage, m = v.eventSource;
561
+ function E(y) {
562
+ var f = y.fetch, h = y.AsyncStorage, m = y.eventSource;
563
563
  return new I({ fetch: f, AsyncStorage: h, eventSource: m });
564
564
  }
565
- var F, U = (F = function(v, f) {
566
- return F = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(h, m) {
565
+ var P, U = (P = function(y, f) {
566
+ return P = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(h, m) {
567
567
  h.__proto__ = m;
568
568
  } || function(h, m) {
569
569
  for (var g in m)
570
570
  Object.prototype.hasOwnProperty.call(m, g) && (h[g] = m[g]);
571
- }, F(v, f);
572
- }, function(v, f) {
571
+ }, P(y, f);
572
+ }, function(y, f) {
573
573
  if (typeof f != "function" && f !== null)
574
574
  throw new TypeError("Class extends value " + String(f) + " is not a constructor or null");
575
575
  function h() {
576
- this.constructor = v;
576
+ this.constructor = y;
577
577
  }
578
- F(v, f), v.prototype = f === null ? Object.create(f) : (h.prototype = f.prototype, new h());
579
- }), j = function(v) {
580
- var f = typeof Symbol == "function" && Symbol.iterator, h = f && v[f], m = 0;
578
+ P(y, f), y.prototype = f === null ? Object.create(f) : (h.prototype = f.prototype, new h());
579
+ }), j = function(y) {
580
+ var f = typeof Symbol == "function" && Symbol.iterator, h = f && y[f], m = 0;
581
581
  if (h)
582
- return h.call(v);
583
- if (v && typeof v.length == "number")
582
+ return h.call(y);
583
+ if (y && typeof y.length == "number")
584
584
  return { next: function() {
585
- return v && m >= v.length && (v = void 0), { value: v && v[m++], done: !v };
585
+ return y && m >= y.length && (y = void 0), { value: y && y[m++], done: !y };
586
586
  } };
587
587
  throw new TypeError(f ? "Object is not iterable." : "Symbol.iterator is not defined.");
588
- }, z = function(v, f) {
589
- var h = typeof Symbol == "function" && v[Symbol.iterator];
588
+ }, z = function(y, f) {
589
+ var h = typeof Symbol == "function" && y[Symbol.iterator];
590
590
  if (!h)
591
- return v;
592
- var m, g, S = h.call(v), x = [];
591
+ return y;
592
+ var m, g, S = h.call(y), x = [];
593
593
  try {
594
594
  for (; (f === void 0 || f-- > 0) && !(m = S.next()).done; )
595
595
  x.push(m.value);
596
- } catch (D) {
597
- g = { error: D };
596
+ } catch (A) {
597
+ g = { error: A };
598
598
  } finally {
599
599
  try {
600
600
  m && !m.done && (h = S.return) && h.call(S);
@@ -604,44 +604,44 @@ var $n = { exports: {} };
604
604
  }
605
605
  }
606
606
  return x;
607
- }, C = function(v, f, h) {
607
+ }, C = function(y, f, h) {
608
608
  if (h || arguments.length === 2)
609
609
  for (var m, g = 0, S = f.length; g < S; g++)
610
610
  !m && g in f || (m || (m = Array.prototype.slice.call(f, 0, g)), m[g] = f[g]);
611
- return v.concat(m || Array.prototype.slice.call(f));
612
- }, M = function(v) {
611
+ return y.concat(m || Array.prototype.slice.call(f));
612
+ }, F = function(y) {
613
613
  function f() {
614
- return v.call(this, `EventSource not available.
614
+ return y.call(this, `EventSource not available.
615
615
  Consider loading an EventSource polyfill and making it available globally as EventSource, or passing one in as eventSourceClass to the ReconnectingEventSource constructor.`) || this;
616
616
  }
617
- return U(f, v), f;
617
+ return U(f, y), f;
618
618
  }(Error), V = function() {
619
- function v(f, h) {
619
+ function y(f, h) {
620
620
  var m = this;
621
621
  if (this.CONNECTING = 0, this.OPEN = 1, this.CLOSED = 2, this._configuration = h != null ? Object.assign({}, h) : 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")
622
- throw new M();
622
+ throw new F();
623
623
  this._onevent_wrapped = function(g) {
624
624
  m._onevent(g);
625
625
  }, this._start();
626
626
  }
627
- return v.prototype.dispatchEvent = function(f) {
627
+ return y.prototype.dispatchEvent = function(f) {
628
628
  throw new Error("Method not implemented.");
629
- }, v.prototype._start = function() {
629
+ }, y.prototype._start = function() {
630
630
  var f, h, m = this, g = this.url;
631
- this._lastEventId && (g.indexOf("?") === -1 ? g += "?" : g += "&", g += "lastEventId=" + encodeURIComponent(this._lastEventId)), this._eventSource = new this.eventSourceClass(g, this._configuration), this._eventSource.onopen = function(P) {
632
- m._onopen(P);
633
- }, this._eventSource.onerror = function(P) {
634
- m._onerror(P);
635
- }, this._eventSource.onmessage = function(P) {
636
- m.onmessage(P);
631
+ this._lastEventId && (g.indexOf("?") === -1 ? g += "?" : g += "&", g += "lastEventId=" + encodeURIComponent(this._lastEventId)), this._eventSource = new this.eventSourceClass(g, this._configuration), this._eventSource.onopen = function(B) {
632
+ m._onopen(B);
633
+ }, this._eventSource.onerror = function(B) {
634
+ m._onerror(B);
635
+ }, this._eventSource.onmessage = function(B) {
636
+ m.onmessage(B);
637
637
  };
638
638
  try {
639
639
  for (var S = j(Object.keys(this._listeners)), x = S.next(); !x.done; x = S.next()) {
640
- var D = x.value;
641
- this._eventSource.addEventListener(D, this._onevent_wrapped);
640
+ var A = x.value;
641
+ this._eventSource.addEventListener(A, this._onevent_wrapped);
642
642
  }
643
- } catch (P) {
644
- f = { error: P };
643
+ } catch (B) {
644
+ f = { error: B };
645
645
  } finally {
646
646
  try {
647
647
  x && !x.done && (h = S.return) && h.call(S);
@@ -650,9 +650,9 @@ Consider loading an EventSource polyfill and making it available globally as Eve
650
650
  throw f.error;
651
651
  }
652
652
  }
653
- }, v.prototype._onopen = function(f) {
653
+ }, y.prototype._onopen = function(f) {
654
654
  this.readyState === 0 && (this.readyState = 1, this.onopen(f));
655
- }, v.prototype._onerror = function(f) {
655
+ }, y.prototype._onerror = function(f) {
656
656
  var h = this;
657
657
  if (this.readyState === 1 && (this.readyState = 0, this.onerror(f)), this._eventSource) {
658
658
  this._eventSource.close(), this._eventSource = null;
@@ -661,7 +661,7 @@ Consider loading an EventSource polyfill and making it available globally as Eve
661
661
  return h._start();
662
662
  }, m);
663
663
  }
664
- }, v.prototype._onevent = function(f) {
664
+ }, y.prototype._onevent = function(f) {
665
665
  var h, m;
666
666
  f && f.lastEventId && (this._lastEventId = f.lastEventId);
667
667
  var g = this._listeners[f.type];
@@ -669,8 +669,8 @@ Consider loading an EventSource polyfill and making it available globally as Eve
669
669
  try {
670
670
  for (var S = j(C([], z(g), !1)), x = S.next(); !x.done; x = S.next())
671
671
  x.value.call(this, f);
672
- } catch (D) {
673
- h = { error: D };
672
+ } catch (A) {
673
+ h = { error: A };
674
674
  } finally {
675
675
  try {
676
676
  x && !x.done && (m = S.return) && m.call(S);
@@ -680,53 +680,53 @@ Consider loading an EventSource polyfill and making it available globally as Eve
680
680
  }
681
681
  }
682
682
  f.type === "message" && this.onmessage(f);
683
- }, v.prototype.onopen = function(f) {
684
- }, v.prototype.onerror = function(f) {
685
- }, v.prototype.onmessage = function(f) {
686
- }, v.prototype.close = function() {
683
+ }, y.prototype.onopen = function(f) {
684
+ }, y.prototype.onerror = function(f) {
685
+ }, y.prototype.onmessage = function(f) {
686
+ }, y.prototype.close = function() {
687
687
  this._timer && (clearTimeout(this._timer), this._timer = null), this._eventSource && (this._eventSource.close(), this._eventSource = null), this.readyState = 2;
688
- }, v.prototype.addEventListener = function(f, h, m) {
688
+ }, y.prototype.addEventListener = function(f, h, m) {
689
689
  this._listeners[f] == null && (this._listeners[f] = [], this._eventSource != null && this._eventSource.addEventListener(f, this._onevent_wrapped));
690
690
  var g = this._listeners[f];
691
691
  g.includes(h) || (this._listeners[f] = C(C([], z(g), !1), [h], !1));
692
- }, v.prototype.removeEventListener = function(f, h, m) {
692
+ }, y.prototype.removeEventListener = function(f, h, m) {
693
693
  var g = this._listeners[f];
694
694
  this._listeners[f] = g.filter(function(S) {
695
695
  return S !== h;
696
696
  });
697
- }, v;
697
+ }, y;
698
698
  }();
699
699
  globalThis.FlagsmithEventSource = typeof EventSource < "u" ? EventSource : null;
700
- var G = function(v, f) {
700
+ var K = function(y, f) {
701
701
  return f = f || {}, new Promise(function(h, m) {
702
- var g = new XMLHttpRequest(), S = [], x = [], D = {}, P = function() {
702
+ var g = new XMLHttpRequest(), S = [], x = [], A = {}, B = function() {
703
703
  return { ok: (g.status / 100 | 0) == 2, statusText: g.statusText, status: g.status, url: g.responseURL, text: function() {
704
704
  return Promise.resolve(g.responseText);
705
705
  }, json: function() {
706
706
  return Promise.resolve(g.responseText).then(JSON.parse);
707
707
  }, blob: function() {
708
708
  return Promise.resolve(new Blob([g.response]));
709
- }, clone: P, headers: { keys: function() {
709
+ }, clone: B, headers: { keys: function() {
710
710
  return S;
711
711
  }, entries: function() {
712
712
  return x;
713
- }, get: function(N) {
714
- return D[N.toLowerCase()];
715
- }, has: function(N) {
716
- return N.toLowerCase() in D;
713
+ }, get: function(O) {
714
+ return A[O.toLowerCase()];
715
+ }, has: function(O) {
716
+ return O.toLowerCase() in A;
717
717
  } } };
718
718
  };
719
- for (var q in g.open(f.method || "get", v, !0), g.onload = function() {
720
- g.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm, function(N, W, ee) {
721
- S.push(W = W.toLowerCase()), x.push([W, ee]), D[W] = D[W] ? D[W] + "," + ee : ee;
722
- }), h(P());
719
+ for (var q in g.open(f.method || "get", y, !0), g.onload = function() {
720
+ g.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm, function(O, W, ee) {
721
+ S.push(W = W.toLowerCase()), x.push([W, ee]), A[W] = A[W] ? A[W] + "," + ee : ee;
722
+ }), h(B());
723
723
  }, g.onerror = m, g.withCredentials = f.credentials == "include", f.headers)
724
724
  g.setRequestHeader(q, f.headers[q]);
725
725
  g.send(f.body || null);
726
726
  });
727
- }, $ = T({ AsyncStorage: s, fetch: G, eventSource: V });
727
+ }, $ = E({ AsyncStorage: s, fetch: K, eventSource: V });
728
728
  typeof window < "u" && (window.flagsmith = $), n.createFlagsmithInstance = function() {
729
- return T({ AsyncStorage: s, fetch: G, eventSource: V });
729
+ return E({ AsyncStorage: s, fetch: K, eventSource: V });
730
730
  }, n.default = $, Object.defineProperty(n, "__esModule", { value: !0 });
731
731
  });
732
732
  })($n, $n.exports);
@@ -821,9 +821,9 @@ var qn = {}, bi = function(t, e, n, s, i) {
821
821
  }, As = Ds(kt, 2), yi = As.b, dt = As.r;
822
822
  yi[28] = 258, dt[258] = 28;
823
823
  var wi = Ds(Tt, 0), cn = wi.r, ft = new re(32768);
824
- for (var J = 0; J < 32768; ++J) {
825
- var Ie = (J & 43690) >> 1 | (J & 21845) << 1;
826
- Ie = (Ie & 52428) >> 2 | (Ie & 13107) << 2, Ie = (Ie & 61680) >> 4 | (Ie & 3855) << 4, ft[J] = ((Ie & 65280) >> 8 | (Ie & 255) << 8) >> 1;
824
+ for (var X = 0; X < 32768; ++X) {
825
+ var Ie = (X & 43690) >> 1 | (X & 21845) << 1;
826
+ Ie = (Ie & 52428) >> 2 | (Ie & 13107) << 2, Ie = (Ie & 61680) >> 4 | (Ie & 3855) << 4, ft[X] = ((Ie & 65280) >> 8 | (Ie & 255) << 8) >> 1;
827
827
  }
828
828
  var qe = function(t, e, n) {
829
829
  for (var s = t.length, i = 0, r = new re(e); i < s; ++i)
@@ -844,17 +844,17 @@ var qe = function(t, e, n) {
844
844
  t[i] && (l[i] = ft[o[t[i] - 1]++] >> 15 - t[i]);
845
845
  return l;
846
846
  }, Ne = new de(288);
847
- for (var J = 0; J < 144; ++J)
848
- Ne[J] = 8;
849
- for (var J = 144; J < 256; ++J)
850
- Ne[J] = 9;
851
- for (var J = 256; J < 280; ++J)
852
- Ne[J] = 7;
853
- for (var J = 280; J < 288; ++J)
854
- Ne[J] = 8;
847
+ for (var X = 0; X < 144; ++X)
848
+ Ne[X] = 8;
849
+ for (var X = 144; X < 256; ++X)
850
+ Ne[X] = 9;
851
+ for (var X = 256; X < 280; ++X)
852
+ Ne[X] = 7;
853
+ for (var X = 280; X < 288; ++X)
854
+ Ne[X] = 8;
855
855
  var tt = new de(32);
856
- for (var J = 0; J < 32; ++J)
857
- tt[J] = 5;
856
+ for (var X = 0; X < 32; ++X)
857
+ tt[X] = 5;
858
858
  var Ls = /* @__PURE__ */ qe(Ne, 9, 0), Ms = /* @__PURE__ */ qe(tt, 5, 0), Tn = function(t) {
859
859
  return (t + 7) / 8 | 0;
860
860
  }, Fs = function(t, e, n) {
@@ -906,29 +906,29 @@ var Ls = /* @__PURE__ */ qe(Ne, 9, 0), Ms = /* @__PURE__ */ qe(tt, 5, 0), Tn = f
906
906
  l = n[n[u].f < n[d].f ? u++ : d++], c = n[u != a && n[u].f < n[d].f ? u++ : d++], n[a++] = { s: -1, f: l.f + c.f, l, r: c };
907
907
  for (var p = r[0].s, s = 1; s < i; ++s)
908
908
  r[s].s > p && (p = r[s].s);
909
- var b = new re(p + 1), w = pt(n[a - 1], b, 0);
909
+ var v = new re(p + 1), w = pt(n[a - 1], v, 0);
910
910
  if (w > e) {
911
- var s = 0, y = 0, E = w - e, O = 1 << E;
911
+ var s = 0, b = 0, T = w - e, N = 1 << T;
912
912
  for (r.sort(function(R, L) {
913
- return b[L.s] - b[R.s] || R.f - L.f;
913
+ return v[L.s] - v[R.s] || R.f - L.f;
914
914
  }); s < i; ++s) {
915
- var B = r[s].s;
916
- if (b[B] > e)
917
- y += O - (1 << w - b[B]), b[B] = e;
915
+ var M = r[s].s;
916
+ if (v[M] > e)
917
+ b += N - (1 << w - v[M]), v[M] = e;
918
918
  else
919
919
  break;
920
920
  }
921
- for (y >>= E; y > 0; ) {
922
- var A = r[s].s;
923
- b[A] < e ? y -= 1 << e - b[A]++ - 1 : ++s;
921
+ for (b >>= T; b > 0; ) {
922
+ var D = r[s].s;
923
+ v[D] < e ? b -= 1 << e - v[D]++ - 1 : ++s;
924
924
  }
925
- for (; s >= 0 && y; --s) {
925
+ for (; s >= 0 && b; --s) {
926
926
  var k = r[s].s;
927
- b[k] == e && (--b[k], ++y);
927
+ v[k] == e && (--v[k], ++b);
928
928
  }
929
929
  w = e;
930
930
  }
931
- return { t: new de(b), l: w };
931
+ return { t: new de(v), l: w };
932
932
  }, pt = function(t, e, n) {
933
933
  return t.s == -1 ? Math.max(pt(t.l, e, n + 1), pt(t.r, e, n + 1)) : e[t.s] = n;
934
934
  }, ln = function(t) {
@@ -966,90 +966,90 @@ var Ls = /* @__PURE__ */ qe(Ne, 9, 0), Ms = /* @__PURE__ */ qe(tt, 5, 0), Tn = f
966
966
  return (i + 4 + s) * 8;
967
967
  }, un = function(t, e, n, s, i, r, o, l, c, u, a) {
968
968
  be(e, a++, n), ++i[256];
969
- for (var d = ct(i, 15), p = d.t, b = d.l, w = ct(r, 15), y = w.t, E = w.l, O = ln(p), B = O.c, A = O.n, k = ln(y), _ = k.c, R = k.n, L = new re(19), I = 0; I < B.length; ++I)
970
- ++L[B[I] & 31];
969
+ for (var d = ct(i, 15), p = d.t, v = d.l, w = ct(r, 15), b = w.t, T = w.l, N = ln(p), M = N.c, D = N.n, k = ln(b), _ = k.c, R = k.n, L = new re(19), I = 0; I < M.length; ++I)
970
+ ++L[M[I] & 31];
971
971
  for (var I = 0; I < _.length; ++I)
972
972
  ++L[_[I] & 31];
973
- for (var T = ct(L, 7), F = T.t, U = T.l, j = 19; j > 4 && !F[an[j - 1]]; --j)
973
+ for (var E = ct(L, 7), P = E.t, U = E.l, j = 19; j > 4 && !P[an[j - 1]]; --j)
974
974
  ;
975
- var z = u + 5 << 3, C = Ue(i, Ne) + Ue(r, tt) + o, M = Ue(i, p) + Ue(r, y) + o + 14 + 3 * j + Ue(L, F) + 2 * L[16] + 3 * L[17] + 7 * L[18];
976
- if (c >= 0 && z <= C && z <= M)
975
+ var z = u + 5 << 3, C = Ue(i, Ne) + Ue(r, tt) + o, F = Ue(i, p) + Ue(r, b) + o + 14 + 3 * j + Ue(L, P) + 2 * L[16] + 3 * L[17] + 7 * L[18];
976
+ if (c >= 0 && z <= C && z <= F)
977
977
  return En(e, a, t.subarray(c, c + u));
978
- var V, G, $, v;
979
- if (be(e, a, 1 + (M < C)), a += 2, M < C) {
980
- V = qe(p, b, 0), G = p, $ = qe(y, E, 0), v = y;
981
- var f = qe(F, U, 0);
982
- be(e, a, A - 257), be(e, a + 5, R - 1), be(e, a + 10, j - 4), a += 14;
978
+ var V, K, $, y;
979
+ if (be(e, a, 1 + (F < C)), a += 2, F < C) {
980
+ V = qe(p, v, 0), K = p, $ = qe(b, T, 0), y = b;
981
+ var f = qe(P, U, 0);
982
+ be(e, a, D - 257), be(e, a + 5, R - 1), be(e, a + 10, j - 4), a += 14;
983
983
  for (var I = 0; I < j; ++I)
984
- be(e, a + 3 * I, F[an[I]]);
984
+ be(e, a + 3 * I, P[an[I]]);
985
985
  a += 3 * j;
986
- for (var h = [B, _], m = 0; m < 2; ++m)
986
+ for (var h = [M, _], m = 0; m < 2; ++m)
987
987
  for (var g = h[m], I = 0; I < g.length; ++I) {
988
988
  var S = g[I] & 31;
989
- be(e, a, f[S]), a += F[S], S > 15 && (be(e, a, g[I] >> 5 & 127), a += g[I] >> 12);
989
+ be(e, a, f[S]), a += P[S], S > 15 && (be(e, a, g[I] >> 5 & 127), a += g[I] >> 12);
990
990
  }
991
991
  } else
992
- V = Ls, G = Ne, $ = Ms, v = tt;
992
+ V = Ls, K = Ne, $ = Ms, y = tt;
993
993
  for (var I = 0; I < l; ++I) {
994
994
  var x = s[I];
995
995
  if (x > 255) {
996
996
  var S = x >> 18 & 31;
997
- ze(e, a, V[S + 257]), a += G[S + 257], S > 7 && (be(e, a, x >> 23 & 31), a += kt[S]);
998
- var D = x & 31;
999
- ze(e, a, $[D]), a += v[D], D > 3 && (ze(e, a, x >> 5 & 8191), a += Tt[D]);
997
+ ze(e, a, V[S + 257]), a += K[S + 257], S > 7 && (be(e, a, x >> 23 & 31), a += kt[S]);
998
+ var A = x & 31;
999
+ ze(e, a, $[A]), a += y[A], A > 3 && (ze(e, a, x >> 5 & 8191), a += Tt[A]);
1000
1000
  } else
1001
- ze(e, a, V[x]), a += G[x];
1001
+ ze(e, a, V[x]), a += K[x];
1002
1002
  }
1003
- return ze(e, a, V[256]), a + G[256];
1003
+ return ze(e, a, V[256]), a + K[256];
1004
1004
  }, Bs = /* @__PURE__ */ new xt([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]), In = /* @__PURE__ */ new de(0), js = function(t, e, n, s, i, r) {
1005
1005
  var o = r.z || t.length, l = new de(s + o + 5 * (1 + Math.ceil(o / 7e3)) + i), c = l.subarray(s, l.length - i), u = r.l, a = (r.r || 0) & 7;
1006
1006
  if (e) {
1007
1007
  a && (c[0] = r.r >> 3);
1008
- for (var d = Bs[e - 1], p = d >> 13, b = d & 8191, w = (1 << n) - 1, y = r.p || new re(32768), E = r.h || new re(w + 1), O = Math.ceil(n / 3), B = 2 * O, A = function(ne) {
1009
- return (t[ne] ^ t[ne + 1] << O ^ t[ne + 2] << B) & w;
1010
- }, k = new xt(25e3), _ = new re(288), R = new re(32), L = 0, I = 0, T = r.i || 0, F = 0, U = r.w || 0, j = 0; T + 2 < o; ++T) {
1011
- var z = A(T), C = T & 32767, M = E[z];
1012
- if (y[C] = M, E[z] = C, U <= T) {
1013
- var V = o - T;
1014
- if ((L > 7e3 || F > 24576) && (V > 423 || !u)) {
1015
- a = un(t, c, 0, k, _, R, I, F, j, T - j, a), F = L = I = 0, j = T;
1016
- for (var G = 0; G < 286; ++G)
1017
- _[G] = 0;
1018
- for (var G = 0; G < 30; ++G)
1019
- R[G] = 0;
1008
+ for (var d = Bs[e - 1], p = d >> 13, v = d & 8191, w = (1 << n) - 1, b = r.p || new re(32768), T = r.h || new re(w + 1), N = Math.ceil(n / 3), M = 2 * N, D = function(ne) {
1009
+ return (t[ne] ^ t[ne + 1] << N ^ t[ne + 2] << M) & w;
1010
+ }, k = new xt(25e3), _ = new re(288), R = new re(32), L = 0, I = 0, E = r.i || 0, P = 0, U = r.w || 0, j = 0; E + 2 < o; ++E) {
1011
+ var z = D(E), C = E & 32767, F = T[z];
1012
+ if (b[C] = F, T[z] = C, U <= E) {
1013
+ var V = o - E;
1014
+ if ((L > 7e3 || P > 24576) && (V > 423 || !u)) {
1015
+ a = un(t, c, 0, k, _, R, I, P, j, E - j, a), P = L = I = 0, j = E;
1016
+ for (var K = 0; K < 286; ++K)
1017
+ _[K] = 0;
1018
+ for (var K = 0; K < 30; ++K)
1019
+ R[K] = 0;
1020
1020
  }
1021
- var $ = 2, v = 0, f = b, h = C - M & 32767;
1022
- if (V > 2 && z == A(T - h))
1023
- for (var m = Math.min(p, V) - 1, g = Math.min(32767, T), S = Math.min(258, V); h <= g && --f && C != M; ) {
1024
- if (t[T + $] == t[T + $ - h]) {
1025
- for (var x = 0; x < S && t[T + x] == t[T + x - h]; ++x)
1021
+ var $ = 2, y = 0, f = v, h = C - F & 32767;
1022
+ if (V > 2 && z == D(E - h))
1023
+ for (var m = Math.min(p, V) - 1, g = Math.min(32767, E), S = Math.min(258, V); h <= g && --f && C != F; ) {
1024
+ if (t[E + $] == t[E + $ - h]) {
1025
+ for (var x = 0; x < S && t[E + x] == t[E + x - h]; ++x)
1026
1026
  ;
1027
1027
  if (x > $) {
1028
- if ($ = x, v = h, x > m)
1028
+ if ($ = x, y = h, x > m)
1029
1029
  break;
1030
- for (var D = Math.min(h, x - 2), P = 0, G = 0; G < D; ++G) {
1031
- var q = T - h + G & 32767, N = y[q], W = q - N & 32767;
1032
- W > P && (P = W, M = q);
1030
+ for (var A = Math.min(h, x - 2), B = 0, K = 0; K < A; ++K) {
1031
+ var q = E - h + K & 32767, O = b[q], W = q - O & 32767;
1032
+ W > B && (B = W, F = q);
1033
1033
  }
1034
1034
  }
1035
1035
  }
1036
- C = M, M = y[C], h += C - M & 32767;
1036
+ C = F, F = b[C], h += C - F & 32767;
1037
1037
  }
1038
- if (v) {
1039
- k[F++] = 268435456 | dt[$] << 18 | cn[v];
1040
- var ee = dt[$] & 31, oe = cn[v] & 31;
1041
- I += kt[ee] + Tt[oe], ++_[257 + ee], ++R[oe], U = T + $, ++L;
1038
+ if (y) {
1039
+ k[P++] = 268435456 | dt[$] << 18 | cn[y];
1040
+ var ee = dt[$] & 31, oe = cn[y] & 31;
1041
+ I += kt[ee] + Tt[oe], ++_[257 + ee], ++R[oe], U = E + $, ++L;
1042
1042
  } else
1043
- k[F++] = t[T], ++_[t[T]];
1043
+ k[P++] = t[E], ++_[t[E]];
1044
1044
  }
1045
1045
  }
1046
- for (T = Math.max(T, U); T < o; ++T)
1047
- k[F++] = t[T], ++_[t[T]];
1048
- a = un(t, c, u, k, _, R, I, F, j, T - j, a), u || (r.r = a & 7 | c[a / 8 | 0] << 3, a -= 7, r.h = E, r.p = y, r.i = T, r.w = U);
1046
+ for (E = Math.max(E, U); E < o; ++E)
1047
+ k[P++] = t[E], ++_[t[E]];
1048
+ a = un(t, c, u, k, _, R, I, P, j, E - j, a), u || (r.r = a & 7 | c[a / 8 | 0] << 3, a -= 7, r.h = T, r.p = b, r.i = E, r.w = U);
1049
1049
  } else {
1050
- for (var T = r.w || 0; T < o + u; T += 65535) {
1051
- var te = T + 65535;
1052
- te >= o && (c[a / 8 | 0] = u, te = o), a = En(c, a + 1, t.subarray(T, te));
1050
+ for (var E = r.w || 0; E < o + u; E += 65535) {
1051
+ var te = E + 65535;
1052
+ te >= o && (c[a / 8 | 0] = u, te = o), a = En(c, a + 1, t.subarray(E, te));
1053
1053
  }
1054
1054
  r.i = o;
1055
1055
  }
@@ -2501,10 +2501,10 @@ class Wr {
2501
2501
  tasks: []
2502
2502
  }, this.getDurations = () => this.durations, this.setDurations = (d) => {
2503
2503
  this.durations.testStart = d.testStart, this.durations.tasks = d.tasks;
2504
- }, this.signalTask = (d, p, b) => {
2504
+ }, this.signalTask = (d, p, v) => {
2505
2505
  if (!d)
2506
2506
  return console.error("User Testing: No Task ID Given");
2507
- const w = this.durations.tasks.find((O) => O.taskId === d), y = this.getTimestamp(), E = w ? y - w.started : 0;
2507
+ const w = this.durations.tasks.find((N) => N.taskId === d), b = this.getTimestamp(), T = w ? b - w.started : 0;
2508
2508
  return fetch(`${this.ingestPoint}/v1/web/uxt/signals/task`, {
2509
2509
  method: "POST",
2510
2510
  headers: {
@@ -2515,19 +2515,19 @@ class Wr {
2515
2515
  testId: this.testId,
2516
2516
  taskId: d,
2517
2517
  status: p,
2518
- duration: E,
2519
- timestamp: y,
2520
- taskAnswer: b
2518
+ duration: T,
2519
+ timestamp: b,
2520
+ taskAnswer: v
2521
2521
  })
2522
2522
  });
2523
2523
  }, this.signalTest = (d) => {
2524
2524
  const p = this.getTimestamp();
2525
2525
  if (d === "begin" && this.testId) {
2526
- const y = this.getSessionId();
2527
- this.setStorageKey(vn, y), this.setStorageKey(this.storageKey, this.testId.toString()), this.setStorageKey(ut, p.toString());
2526
+ const b = this.getSessionId();
2527
+ this.setStorageKey(vn, b), this.setStorageKey(this.storageKey, this.testId.toString()), this.setStorageKey(ut, p.toString());
2528
2528
  } else
2529
2529
  this.removeStorageKey(this.storageKey), this.removeStorageKey(mn), this.removeStorageKey(ut);
2530
- const b = this.durations.testStart || p, w = p - b;
2530
+ const v = this.durations.testStart || p, w = p - v;
2531
2531
  return fetch(`${this.ingestPoint}/v1/web/uxt/signals/test`, {
2532
2532
  method: "POST",
2533
2533
  headers: {
@@ -2647,11 +2647,11 @@ class Vr {
2647
2647
  }, c.onclick = () => {
2648
2648
  var a, d, p;
2649
2649
  if (u(), this.test) {
2650
- const b = (a = this.signalManager) == null ? void 0 : a.getDurations(), w = b ? b.tasks.findIndex((y) => this.test && y.taskId === this.test.tasks[0].task_id) : null;
2651
- b && w === -1 && (b.tasks.push({
2650
+ const v = (a = this.signalManager) == null ? void 0 : a.getDurations(), w = v ? v.tasks.findIndex((b) => this.test && b.taskId === this.test.tasks[0].task_id) : null;
2651
+ v && w === -1 && (v.tasks.push({
2652
2652
  taskId: this.test.tasks[0].task_id,
2653
2653
  started: this.app.timestamp()
2654
- }), (d = this.signalManager) == null || d.setDurations(b)), (p = this.signalManager) == null || p.signalTask(this.test.tasks[0].task_id, "begin");
2654
+ }), (d = this.signalManager) == null || d.setDurations(v)), (p = this.signalManager) == null || p.signalTask(this.test.tasks[0].task_id, "begin");
2655
2655
  }
2656
2656
  this.showTaskSection(), o.removeChild(c);
2657
2657
  }, n;
@@ -2664,13 +2664,13 @@ class Vr {
2664
2664
  lineHeight: "auto"
2665
2665
  }, "Tasks"), r = H("div", "icon", os, "-"), o = H("div", "content", Be), l = H("div", "pagination", Dr), c = H("div", "taskCard", us), u = H("div", "taskText", hs), a = H("div", "taskDescription", Lr), d = H("div", "taskButtons", Fr), p = H("div", "taskText", hs);
2666
2666
  p.textContent = "Your answer";
2667
- const b = H("textarea", "taskDescription", {
2667
+ const v = H("textarea", "taskDescription", {
2668
2668
  resize: "vertical"
2669
2669
  }), w = H("div", "inputArea", us);
2670
- w.append(p, b);
2671
- const y = H("div", "closePanelButton", Zs, "Collapse Panel"), E = H("div", "nextButton", Mr, "Done, Next");
2672
- s.append(i, r), c.append(u, a), d.append(y, E), o.append(l, c, w, d), n.append(s, o);
2673
- const O = () => {
2670
+ w.append(p, v);
2671
+ const b = H("div", "closePanelButton", Zs, "Collapse Panel"), T = H("div", "nextButton", Mr, "Done, Next");
2672
+ s.append(i, r), c.append(u, a), d.append(b, T), o.append(l, c, w, d), n.append(s, o);
2673
+ const N = () => {
2674
2674
  const k = e[this.currentTaskIndex];
2675
2675
  u.textContent = k.title, a.textContent = k.description, k.allow_typing ? w.style.display = "flex" : w.style.display = "none";
2676
2676
  };
@@ -2688,13 +2688,13 @@ class Vr {
2688
2688
  }, (_ + 1).toString());
2689
2689
  R.id = `or_task_${_}`, l.append(R);
2690
2690
  });
2691
- const B = () => {
2691
+ const M = () => {
2692
2692
  this.widgetTasksVisible = !this.widgetTasksVisible, r.textContent = this.widgetTasksVisible ? "-" : "+", Object.assign(o.style, this.widgetTasksVisible ? Be : { display: "none" });
2693
2693
  };
2694
2694
  this.hideTaskSection = () => (r.textContent = "+", Object.assign(o.style, {
2695
2695
  display: "none"
2696
2696
  }), this.widgetTasksVisible = !1, !1), this.showTaskSection = () => (r.textContent = "-", Object.assign(o.style, Be), this.widgetTasksVisible = !0, !0);
2697
- const A = () => {
2697
+ const D = () => {
2698
2698
  const k = document.getElementById(`or_task_${this.currentTaskIndex}`);
2699
2699
  k && Object.assign(k.style, ls);
2700
2700
  for (let _ = 0; _ < this.currentTaskIndex; _++) {
@@ -2702,22 +2702,22 @@ class Vr {
2702
2702
  R && Object.assign(R.style, Ar);
2703
2703
  }
2704
2704
  };
2705
- return s.onclick = B, y.onclick = this.collapseWidget, E.onclick = () => {
2705
+ return s.onclick = M, b.onclick = this.collapseWidget, T.onclick = () => {
2706
2706
  var _, R, L, I;
2707
- const k = e[this.currentTaskIndex].allow_typing ? b.value : void 0;
2708
- if (b.value = "", (_ = this.signalManager) == null || _.signalTask(e[this.currentTaskIndex].task_id, "done", k), this.currentTaskIndex < e.length - 1) {
2709
- this.currentTaskIndex++, O();
2710
- const T = (R = this.signalManager) == null ? void 0 : R.getDurations();
2711
- T && T.tasks.findIndex((F) => F.taskId === e[this.currentTaskIndex].task_id) === -1 && (T.tasks.push({
2707
+ const k = e[this.currentTaskIndex].allow_typing ? v.value : void 0;
2708
+ if (v.value = "", (_ = this.signalManager) == null || _.signalTask(e[this.currentTaskIndex].task_id, "done", k), this.currentTaskIndex < e.length - 1) {
2709
+ this.currentTaskIndex++, N();
2710
+ const E = (R = this.signalManager) == null ? void 0 : R.getDurations();
2711
+ E && E.tasks.findIndex((P) => P.taskId === e[this.currentTaskIndex].task_id) === -1 && (E.tasks.push({
2712
2712
  taskId: e[this.currentTaskIndex].task_id,
2713
2713
  started: this.app.timestamp()
2714
- }), (L = this.signalManager) == null || L.setDurations(T)), (I = this.signalManager) == null || I.signalTask(e[this.currentTaskIndex].task_id, "begin"), A();
2714
+ }), (L = this.signalManager) == null || L.setDurations(E)), (I = this.signalManager) == null || I.signalTask(e[this.currentTaskIndex].task_id, "begin"), D();
2715
2715
  } else
2716
2716
  this.showEndSection();
2717
2717
  this.app.localStorage.setItem("or_uxt_task_index", this.currentTaskIndex.toString());
2718
2718
  }, setTimeout(() => {
2719
2719
  const k = document.getElementById("or_task_0");
2720
- k && Object.assign(k.style, ls), O(), A();
2720
+ k && Object.assign(k.style, ls), N(), D();
2721
2721
  }, 1), n;
2722
2722
  }
2723
2723
  showEndSection() {
@@ -3521,62 +3521,62 @@ let lo = class {
3521
3521
  const u = (a) => {
3522
3522
  const { data: d } = a;
3523
3523
  if (d.line === ue.iframeSignal) {
3524
- const p = d.domain, b = Array.from(document.querySelectorAll("iframe"));
3525
- this.pageFrames = b, (async () => {
3526
- let y = 0;
3527
- for (; y < 10; ) {
3528
- const E = this.checkNodeId(b, p);
3529
- if (E) {
3524
+ const p = d.domain, v = Array.from(document.querySelectorAll("iframe"));
3525
+ this.pageFrames = v, (async () => {
3526
+ let b = 0;
3527
+ for (; b < 10; ) {
3528
+ const T = this.checkNodeId(v, p);
3529
+ if (T) {
3530
3530
  this.waitStarted().then(() => {
3531
- var A;
3531
+ var D;
3532
3532
  c++;
3533
- const O = this.session.getSessionToken(), B = {
3533
+ const N = this.session.getSessionToken(), M = {
3534
3534
  line: ue.iframeId,
3535
3535
  context: this.contextId,
3536
3536
  domain: p,
3537
- id: E,
3538
- token: O,
3537
+ id: T,
3538
+ token: N,
3539
3539
  frameOrderNumber: c
3540
3540
  };
3541
- this.debug.log("iframe_data", B), (A = a.source) == null || A.postMessage(B, "*");
3542
- }).catch(console.error), y = 10;
3541
+ this.debug.log("iframe_data", M), (D = a.source) == null || D.postMessage(M, "*");
3542
+ }).catch(console.error), b = 10;
3543
3543
  break;
3544
3544
  }
3545
- y++, await co(100);
3545
+ b++, await co(100);
3546
3546
  }
3547
3547
  })();
3548
3548
  }
3549
3549
  if (d.line === ue.iframeBatch) {
3550
- const b = d.messages.map((w) => {
3550
+ const v = d.messages.map((w) => {
3551
3551
  if (w[0] === 20) {
3552
- let y = w;
3553
- return this.pageFrames.forEach((E) => {
3554
- if (E.dataset.domain === a.data.domain) {
3555
- const [O, B, A] = w, { left: k, top: _ } = E.getBoundingClientRect();
3556
- y = [O, B + k, A + _];
3552
+ let b = w;
3553
+ return this.pageFrames.forEach((T) => {
3554
+ if (T.dataset.domain === a.data.domain) {
3555
+ const [N, M, D] = w, { left: k, top: _ } = T.getBoundingClientRect();
3556
+ b = [N, M + k, D + _];
3557
3557
  }
3558
- }), y;
3558
+ }), b;
3559
3559
  }
3560
3560
  if (w[0] === 68) {
3561
- let y = w;
3562
- return this.pageFrames.forEach((E) => {
3563
- if (E.dataset.domain === a.data.domain) {
3564
- const [O, B, A, k, _, R, L] = w, { left: I, top: T, width: F, height: U } = E.getBoundingClientRect(), j = document.documentElement.scrollWidth, z = document.documentElement.scrollHeight, C = R / 100 * F + I, M = L / 100 * U + T, V = C / j, G = M / z;
3565
- y = [
3566
- O,
3567
- B,
3568
- A,
3561
+ let b = w;
3562
+ return this.pageFrames.forEach((T) => {
3563
+ if (T.dataset.domain === a.data.domain) {
3564
+ const [N, M, D, k, _, R, L] = w, { left: I, top: E, width: P, height: U } = T.getBoundingClientRect(), j = document.documentElement.scrollWidth, z = document.documentElement.scrollHeight, C = R / 100 * P + I, F = L / 100 * U + E, V = C / j, K = F / z;
3565
+ b = [
3566
+ N,
3567
+ M,
3568
+ D,
3569
3569
  k,
3570
3570
  _,
3571
3571
  Math.round(V * 1e3) / 10,
3572
- Math.round(G * 1e3) / 10
3572
+ Math.round(K * 1e3) / 10
3573
3573
  ];
3574
3574
  }
3575
- }), y;
3575
+ }), b;
3576
3576
  }
3577
3577
  return w;
3578
3578
  });
3579
- this.messages.push(...b);
3579
+ this.messages.push(...v);
3580
3580
  }
3581
3581
  };
3582
3582
  window.addEventListener("message", u), this.attachStopCallback(() => {
@@ -3837,7 +3837,7 @@ let lo = class {
3837
3837
  }, 30 * s), r();
3838
3838
  }
3839
3839
  async setupConditionalStart(e) {
3840
- var p, b;
3840
+ var p, v;
3841
3841
  this.conditionsManager = new Ai(this, e);
3842
3842
  const n = await fetch(this.options.ingestPoint + "/v1/web/start", {
3843
3843
  method: "POST",
@@ -3878,7 +3878,7 @@ let lo = class {
3878
3878
  userState: u
3879
3879
  });
3880
3880
  const d = { sessionToken: s, userUUID: "", sessionID: "" };
3881
- this.startCallbacks.forEach((w) => w(d)), await ((p = this.conditionsManager) == null ? void 0 : p.fetchConditions(a, s)), await this.featureFlags.reloadFlags(s), await this.tagWatcher.fetchTags(this.options.ingestPoint, s), (b = this.conditionsManager) == null || b.processFlags(this.featureFlags.flags);
3881
+ this.startCallbacks.forEach((w) => w(d)), await ((p = this.conditionsManager) == null ? void 0 : p.fetchConditions(a, s)), await this.featureFlags.reloadFlags(s), await this.tagWatcher.fetchTags(this.options.ingestPoint, s), (v = this.conditionsManager) == null || v.processFlags(this.featureFlags.flags);
3882
3882
  }
3883
3883
  /**
3884
3884
  * Starts offline session recording
@@ -3935,7 +3935,7 @@ let lo = class {
3935
3935
  * @reject {string} - error message
3936
3936
  * */
3937
3937
  async uploadOfflineRecording() {
3938
- var p, b;
3938
+ var p, v;
3939
3939
  this.stop(!1);
3940
3940
  const e = pe();
3941
3941
  (p = this.worker) == null || p.postMessage({
@@ -3965,7 +3965,7 @@ let lo = class {
3965
3965
  timezone: tn()
3966
3966
  })
3967
3967
  }), { token: s, userBrowser: i, userCity: r, userCountry: o, userDevice: l, userOS: c, userState: u, beaconSizeLimit: a, projectID: d } = await n.json();
3968
- for ((b = this.worker) == null || b.postMessage({
3968
+ for ((v = this.worker) == null || v.postMessage({
3969
3969
  type: "auth",
3970
3970
  token: s,
3971
3971
  beaconSizeLimit: a
@@ -4029,8 +4029,8 @@ let lo = class {
4029
4029
  })
4030
4030
  });
4031
4031
  if (c.status !== 200) {
4032
- const C = await c.text(), M = C === Qe ? Qe : `Server error: ${c.status}. ${C}`;
4033
- return Ce(M);
4032
+ const C = await c.text(), F = C === Qe ? Qe : `Server error: ${c.status}. ${C}`;
4033
+ return Ce(F);
4034
4034
  }
4035
4035
  if (!this.worker) {
4036
4036
  const C = "no worker found after start request (this should not happen in real world)";
@@ -4041,48 +4041,48 @@ let lo = class {
4041
4041
  userUUID: a,
4042
4042
  projectID: d,
4043
4043
  beaconSizeLimit: p,
4044
- compressionThreshold: b,
4044
+ compressionThreshold: v,
4045
4045
  // how big the batch should be before we decide to compress it
4046
4046
  delay: w,
4047
4047
  // derived from token
4048
- sessionID: y,
4048
+ sessionID: b,
4049
4049
  // derived from token
4050
- startTimestamp: E,
4050
+ startTimestamp: T,
4051
4051
  // real startTS (server time), derived from sessionID
4052
- userBrowser: O,
4053
- userCity: B,
4054
- userCountry: A,
4052
+ userBrowser: N,
4053
+ userCity: M,
4054
+ userCountry: D,
4055
4055
  userDevice: k,
4056
4056
  userOS: _,
4057
4057
  userState: R,
4058
4058
  canvasEnabled: L,
4059
4059
  canvasQuality: I,
4060
- canvasFPS: T,
4061
- assistOnly: F
4060
+ canvasFPS: E,
4061
+ assistOnly: P
4062
4062
  } = await c.json();
4063
- if (typeof u != "string" || typeof a != "string" || typeof E != "number" && typeof E < "u" || typeof y != "string" || typeof w != "number" || typeof p != "number" && typeof p < "u") {
4063
+ if (typeof u != "string" || typeof a != "string" || typeof T != "number" && typeof T < "u" || typeof b != "string" || typeof w != "number" || typeof p != "number" && typeof p < "u") {
4064
4064
  const C = `Incorrect server response: ${JSON.stringify(c)}`;
4065
4065
  return this.signalError(C, []), Ce(C);
4066
4066
  }
4067
4067
  this.delay = w, this.session.setSessionToken(u), this.session.setUserInfo({
4068
- userBrowser: O,
4069
- userCity: B,
4070
- userCountry: A,
4068
+ userBrowser: N,
4069
+ userCity: M,
4070
+ userCountry: D,
4071
4071
  userDevice: k,
4072
4072
  userOS: _,
4073
4073
  userState: R
4074
4074
  }), this.session.assign({
4075
- sessionID: y,
4076
- timestamp: E || r,
4075
+ sessionID: b,
4076
+ timestamp: T || r,
4077
4077
  projectID: d
4078
- }), F ? (this.socketMode = !0, this.worker.postMessage("stop")) : this.worker.postMessage({
4078
+ }), P ? (this.socketMode = !0, this.worker.postMessage("stop")) : this.worker.postMessage({
4079
4079
  type: "auth",
4080
4080
  token: u,
4081
4081
  beaconSizeLimit: p
4082
- }), !l && u === o && (this.debug.log("continuing session on new tab", this.session.getTabId()), this.send(lt(this.session.getTabId()))), Object.entries(this.session.getInfo().metadata).forEach(([C, M]) => this.send(Qn(C, M))), this.localStorage.setItem(this.options.local_uuid_key, a), this.compressionThreshold = b;
4083
- const U = { sessionToken: u, userUUID: a, sessionID: y };
4082
+ }), !l && u === o && (this.debug.log("continuing session on new tab", this.session.getTabId()), this.send(lt(this.session.getTabId()))), Object.entries(this.session.getInfo().metadata).forEach(([C, F]) => this.send(Qn(C, F))), this.localStorage.setItem(this.options.local_uuid_key, a), this.compressionThreshold = v;
4083
+ const U = { sessionToken: u, userUUID: a, sessionID: b };
4084
4084
  if (this.startCallbacks.forEach((C) => C(U)), this.featureFlags.reloadFlags(), await this.tagWatcher.fetchTags(this.options.ingestPoint, u), this.activityState = Q.Active, L && !this.options.canvas.disableCanvas && (this.canvasRecorder = this.canvasRecorder ?? new Kr(this, {
4085
- fps: T,
4085
+ fps: E,
4086
4086
  quality: I,
4087
4087
  isDebug: this.options.canvas.__save_canvas_locally,
4088
4088
  fixedScaling: this.options.canvas.fixedCanvasScaling,
@@ -4100,12 +4100,12 @@ let lo = class {
4100
4100
  if (z && (j = parseInt(z, 10)), location != null && location.search) {
4101
4101
  const C = new URLSearchParams(location.search);
4102
4102
  if (C.has("oruxt")) {
4103
- const M = C.get("oruxt");
4104
- j = M ? parseInt(M, 10) : void 0;
4103
+ const F = C.get("oruxt");
4104
+ j = F ? parseInt(F, 10) : void 0;
4105
4105
  }
4106
4106
  }
4107
4107
  return j && (this.uxtManager.isActive ? this.onUxtCb.forEach((C) => C(j)) : this.uxtManager.getTest(j, u, !!z).then((C) => {
4108
- C && this.onUxtCb.forEach((M) => M(C));
4108
+ C && this.onUxtCb.forEach((F) => F(C));
4109
4109
  })), ao(U);
4110
4110
  } catch (c) {
4111
4111
  if (this.stop(), this.session.reset(), c === Qe)
@@ -4259,8 +4259,8 @@ function go(t, e) {
4259
4259
  t.attachStartCallback(r), t.ticker.attach(r, 33, !1);
4260
4260
  const o = (c, u) => {
4261
4261
  const a = {
4262
- apply: function(d, p, b) {
4263
- Reflect.apply(d, u, b), i = i + 1, !(i > n.consoleThrottling) && s(d.name, b);
4262
+ apply: function(d, p, v) {
4263
+ Reflect.apply(d, u, v), i = i + 1, !(i > n.consoleThrottling) && s(d.name, v);
4264
4264
  }
4265
4265
  };
4266
4266
  n.consoleMethods.forEach((d) => {
@@ -4280,77 +4280,77 @@ function mo() {
4280
4280
  (function(n, s) {
4281
4281
  t.exports = s();
4282
4282
  })($e, function() {
4283
- function n(y) {
4284
- return !isNaN(parseFloat(y)) && isFinite(y);
4283
+ function n(b) {
4284
+ return !isNaN(parseFloat(b)) && isFinite(b);
4285
4285
  }
4286
- function s(y) {
4287
- return y.charAt(0).toUpperCase() + y.substring(1);
4286
+ function s(b) {
4287
+ return b.charAt(0).toUpperCase() + b.substring(1);
4288
4288
  }
4289
- function i(y) {
4289
+ function i(b) {
4290
4290
  return function() {
4291
- return this[y];
4291
+ return this[b];
4292
4292
  };
4293
4293
  }
4294
4294
  var r = ["isConstructor", "isEval", "isNative", "isToplevel"], o = ["columnNumber", "lineNumber"], l = ["fileName", "functionName", "source"], c = ["args"], u = ["evalOrigin"], a = r.concat(o, l, c, u);
4295
- function d(y) {
4296
- if (y)
4297
- for (var E = 0; E < a.length; E++)
4298
- y[a[E]] !== void 0 && this["set" + s(a[E])](y[a[E]]);
4295
+ function d(b) {
4296
+ if (b)
4297
+ for (var T = 0; T < a.length; T++)
4298
+ b[a[T]] !== void 0 && this["set" + s(a[T])](b[a[T]]);
4299
4299
  }
4300
4300
  d.prototype = {
4301
4301
  getArgs: function() {
4302
4302
  return this.args;
4303
4303
  },
4304
- setArgs: function(y) {
4305
- if (Object.prototype.toString.call(y) !== "[object Array]")
4304
+ setArgs: function(b) {
4305
+ if (Object.prototype.toString.call(b) !== "[object Array]")
4306
4306
  throw new TypeError("Args must be an Array");
4307
- this.args = y;
4307
+ this.args = b;
4308
4308
  },
4309
4309
  getEvalOrigin: function() {
4310
4310
  return this.evalOrigin;
4311
4311
  },
4312
- setEvalOrigin: function(y) {
4313
- if (y instanceof d)
4314
- this.evalOrigin = y;
4315
- else if (y instanceof Object)
4316
- this.evalOrigin = new d(y);
4312
+ setEvalOrigin: function(b) {
4313
+ if (b instanceof d)
4314
+ this.evalOrigin = b;
4315
+ else if (b instanceof Object)
4316
+ this.evalOrigin = new d(b);
4317
4317
  else
4318
4318
  throw new TypeError("Eval Origin must be an Object or StackFrame");
4319
4319
  },
4320
4320
  toString: function() {
4321
- var y = this.getFileName() || "", E = this.getLineNumber() || "", O = this.getColumnNumber() || "", B = this.getFunctionName() || "";
4322
- return this.getIsEval() ? y ? "[eval] (" + y + ":" + E + ":" + O + ")" : "[eval]:" + E + ":" + O : B ? B + " (" + y + ":" + E + ":" + O + ")" : y + ":" + E + ":" + O;
4321
+ var b = this.getFileName() || "", T = this.getLineNumber() || "", N = this.getColumnNumber() || "", M = this.getFunctionName() || "";
4322
+ return this.getIsEval() ? b ? "[eval] (" + b + ":" + T + ":" + N + ")" : "[eval]:" + T + ":" + N : M ? M + " (" + b + ":" + T + ":" + N + ")" : b + ":" + T + ":" + N;
4323
4323
  }
4324
- }, d.fromString = function(E) {
4325
- var O = E.indexOf("("), B = E.lastIndexOf(")"), A = E.substring(0, O), k = E.substring(O + 1, B).split(","), _ = E.substring(B + 1);
4324
+ }, d.fromString = function(T) {
4325
+ var N = T.indexOf("("), M = T.lastIndexOf(")"), D = T.substring(0, N), k = T.substring(N + 1, M).split(","), _ = T.substring(M + 1);
4326
4326
  if (_.indexOf("@") === 0)
4327
- var R = /@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(_, ""), L = R[1], I = R[2], T = R[3];
4327
+ var R = /@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(_, ""), L = R[1], I = R[2], E = R[3];
4328
4328
  return new d({
4329
- functionName: A,
4329
+ functionName: D,
4330
4330
  args: k || void 0,
4331
4331
  fileName: L,
4332
4332
  lineNumber: I || void 0,
4333
- columnNumber: T || void 0
4333
+ columnNumber: E || void 0
4334
4334
  });
4335
4335
  };
4336
4336
  for (var p = 0; p < r.length; p++)
4337
- d.prototype["get" + s(r[p])] = i(r[p]), d.prototype["set" + s(r[p])] = /* @__PURE__ */ function(y) {
4338
- return function(E) {
4339
- this[y] = !!E;
4337
+ d.prototype["get" + s(r[p])] = i(r[p]), d.prototype["set" + s(r[p])] = /* @__PURE__ */ function(b) {
4338
+ return function(T) {
4339
+ this[b] = !!T;
4340
4340
  };
4341
4341
  }(r[p]);
4342
- for (var b = 0; b < o.length; b++)
4343
- d.prototype["get" + s(o[b])] = i(o[b]), d.prototype["set" + s(o[b])] = /* @__PURE__ */ function(y) {
4344
- return function(E) {
4345
- if (!n(E))
4346
- throw new TypeError(y + " must be a Number");
4347
- this[y] = Number(E);
4342
+ for (var v = 0; v < o.length; v++)
4343
+ d.prototype["get" + s(o[v])] = i(o[v]), d.prototype["set" + s(o[v])] = /* @__PURE__ */ function(b) {
4344
+ return function(T) {
4345
+ if (!n(T))
4346
+ throw new TypeError(b + " must be a Number");
4347
+ this[b] = Number(T);
4348
4348
  };
4349
- }(o[b]);
4349
+ }(o[v]);
4350
4350
  for (var w = 0; w < l.length; w++)
4351
- d.prototype["get" + s(l[w])] = i(l[w]), d.prototype["set" + s(l[w])] = /* @__PURE__ */ function(y) {
4352
- return function(E) {
4353
- this[y] = String(E);
4351
+ d.prototype["get" + s(l[w])] = i(l[w]), d.prototype["set" + s(l[w])] = /* @__PURE__ */ function(b) {
4352
+ return function(T) {
4353
+ this[b] = String(T);
4354
4354
  };
4355
4355
  }(l[w]);
4356
4356
  return d;
@@ -4394,12 +4394,12 @@ function mo() {
4394
4394
  a.indexOf("(eval ") > -1 && (a = a.replace(/eval code/g, "eval").replace(/(\(eval at [^()]*)|(,.*$)/g, ""));
4395
4395
  var d = a.replace(/^\s+/, "").replace(/\(eval code/g, "(").replace(/^.*?\s+/, ""), p = d.match(/ (\(.+\)$)/);
4396
4396
  d = p ? d.replace(p[0], "") : d;
4397
- var b = this.extractLocation(p ? p[1] : d), w = p && d || void 0, y = ["eval", "<anonymous>"].indexOf(b[0]) > -1 ? void 0 : b[0];
4397
+ var v = this.extractLocation(p ? p[1] : d), w = p && d || void 0, b = ["eval", "<anonymous>"].indexOf(v[0]) > -1 ? void 0 : v[0];
4398
4398
  return new s({
4399
4399
  functionName: w,
4400
- fileName: y,
4401
- lineNumber: b[1],
4402
- columnNumber: b[2],
4400
+ fileName: b,
4401
+ lineNumber: v[1],
4402
+ columnNumber: v[2],
4403
4403
  source: a
4404
4404
  });
4405
4405
  }, this);
@@ -4414,9 +4414,9 @@ function mo() {
4414
4414
  return new s({
4415
4415
  functionName: a
4416
4416
  });
4417
- var d = /((.*".+"[^@]*)?[^@]*)(?:@)/, p = a.match(d), b = p && p[1] ? p[1] : void 0, w = this.extractLocation(a.replace(d, ""));
4417
+ var d = /((.*".+"[^@]*)?[^@]*)(?:@)/, p = a.match(d), v = p && p[1] ? p[1] : void 0, w = this.extractLocation(a.replace(d, ""));
4418
4418
  return new s({
4419
- functionName: b,
4419
+ functionName: v,
4420
4420
  fileName: w[0],
4421
4421
  lineNumber: w[1],
4422
4422
  columnNumber: w[2],
@@ -4432,7 +4432,7 @@ function mo() {
4432
4432
  },
4433
4433
  parseOpera9: function(c) {
4434
4434
  for (var u = /Line (\d+).*script (?:in )?(\S+)/i, a = c.message.split(`
4435
- `), d = [], p = 2, b = a.length; p < b; p += 2) {
4435
+ `), d = [], p = 2, v = a.length; p < v; p += 2) {
4436
4436
  var w = u.exec(a[p]);
4437
4437
  w && d.push(new s({
4438
4438
  fileName: w[2],
@@ -4444,7 +4444,7 @@ function mo() {
4444
4444
  },
4445
4445
  parseOpera10: function(c) {
4446
4446
  for (var u = /Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i, a = c.stacktrace.split(`
4447
- `), d = [], p = 0, b = a.length; p < b; p += 2) {
4447
+ `), d = [], p = 0, v = a.length; p < v; p += 2) {
4448
4448
  var w = u.exec(a[p]);
4449
4449
  w && d.push(
4450
4450
  new s({
@@ -4464,12 +4464,12 @@ function mo() {
4464
4464
  return !!a.match(i) && !a.match(/^Error created at/);
4465
4465
  }, this);
4466
4466
  return u.map(function(a) {
4467
- var d = a.split("@"), p = this.extractLocation(d.pop()), b = d.shift() || "", w = b.replace(/<anonymous function(: (\w+))?>/, "$2").replace(/\([^)]*\)/g, "") || void 0, y;
4468
- b.match(/\(([^)]*)\)/) && (y = b.replace(/^[^(]+\(([^)]*)\)$/, "$1"));
4469
- var E = y === void 0 || y === "[arguments not available]" ? void 0 : y.split(",");
4467
+ var d = a.split("@"), p = this.extractLocation(d.pop()), v = d.shift() || "", w = v.replace(/<anonymous function(: (\w+))?>/, "$2").replace(/\([^)]*\)/g, "") || void 0, b;
4468
+ v.match(/\(([^)]*)\)/) && (b = v.replace(/^[^(]+\(([^)]*)\)$/, "$1"));
4469
+ var T = b === void 0 || b === "[arguments not available]" ? void 0 : b.split(",");
4470
4470
  return new s({
4471
4471
  functionName: w,
4472
- args: E,
4472
+ args: T,
4473
4473
  fileName: p[0],
4474
4474
  lineNumber: p[1],
4475
4475
  columnNumber: p[2],
@@ -4640,10 +4640,10 @@ function Co(t, e) {
4640
4640
  obscureInputDates: !1
4641
4641
  }, e);
4642
4642
  function s(a, d) {
4643
- let p = d.value, b = n.defaultInputMode;
4644
- d.type === "password" || t.sanitizer.isHidden(a) ? b = je.Hidden : (t.sanitizer.isObscured(a) || b === je.Plain && (n.obscureInputNumbers && d.type !== "date" && /\d\d\d\d/.test(p) || n.obscureInputDates && d.type === "date" || n.obscureInputEmails && (d.type === "email" || ~p.indexOf("@")))) && (b = je.Obscured);
4643
+ let p = d.value, v = n.defaultInputMode;
4644
+ d.type === "password" || t.sanitizer.isHidden(a) ? v = je.Hidden : (t.sanitizer.isObscured(a) || v === je.Plain && (n.obscureInputNumbers && d.type !== "date" && /\d\d\d\d/.test(p) || n.obscureInputDates && d.type === "date" || n.obscureInputEmails && (d.type === "email" || ~p.indexOf("@")))) && (v = je.Obscured);
4645
4645
  let w = 0;
4646
- switch (b) {
4646
+ switch (v) {
4647
4647
  case je.Hidden:
4648
4648
  w = -1, p = "";
4649
4649
  break;
@@ -4654,8 +4654,8 @@ function Co(t, e) {
4654
4654
  return { value: p, mask: w };
4655
4655
  }
4656
4656
  function i(a, d) {
4657
- const { value: p, mask: b } = s(a, d);
4658
- t.send(Zi(a, p, b));
4657
+ const { value: p, mask: v } = s(a, d);
4658
+ t.send(Zi(a, p, v));
4659
4659
  }
4660
4660
  const r = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();
4661
4661
  t.attachStopCallback(() => {
@@ -4680,24 +4680,24 @@ function Co(t, e) {
4680
4680
  c(d, p.checked);
4681
4681
  });
4682
4682
  }, 3);
4683
- function u(a, d, p, b) {
4684
- const { value: w, mask: y } = s(a, d), E = ri(d);
4685
- t.send(vr(a, w, y !== 0, E, p, b));
4683
+ function u(a, d, p, v) {
4684
+ const { value: w, mask: b } = s(a, d), T = ri(d);
4685
+ t.send(vr(a, w, b !== 0, T, p, v));
4686
4686
  }
4687
4687
  t.nodes.attachNodeCallback(t.safe((a) => {
4688
4688
  const d = t.nodes.getID(a);
4689
4689
  if (d !== void 0) {
4690
4690
  if (Z(a, "select") && (i(d, a), t.nodes.attachNodeListener(a, "change", () => i(d, a))), To(a)) {
4691
4691
  l(d, a);
4692
- let p = 0, b = 0, w = 0;
4693
- const y = () => {
4692
+ let p = 0, v = 0, w = 0;
4693
+ const b = () => {
4694
4694
  p = pe();
4695
- }, E = () => {
4696
- b === 0 && p !== 0 && (b = pe() - p);
4697
- }, O = () => {
4698
- p !== 0 && (w = pe() - p), u(d, a, b, w), b = 0, w = 0, p = 0;
4695
+ }, T = () => {
4696
+ v === 0 && p !== 0 && (v = pe() - p);
4697
+ }, N = () => {
4698
+ p !== 0 && (w = pe() - p), u(d, a, v, w), v = 0, w = 0, p = 0;
4699
4699
  };
4700
- t.nodes.attachNodeListener(a, "focus", y), t.nodes.attachNodeListener(a, "input", E), t.nodes.attachNodeListener(a, "change", O);
4700
+ t.nodes.attachNodeListener(a, "focus", b), t.nodes.attachNodeListener(a, "input", T), t.nodes.attachNodeListener(a, "change", N);
4701
4701
  return;
4702
4702
  }
4703
4703
  if (Eo(a)) {
@@ -4934,52 +4934,52 @@ function jo(t, e) {
4934
4934
  }
4935
4935
  return "";
4936
4936
  }
4937
- let i = -1, r = -1, o = !1, l = null, c = 0, u = {}, a = 0, d = 0, p = 0, b = 0, w;
4938
- const y = 8e-3, E = 225;
4939
- function O() {
4940
- const k = b / E;
4937
+ let i = -1, r = -1, o = !1, l = null, c = 0, u = {}, a = 0, d = 0, p = 0, v = 0, w;
4938
+ const b = 8e-3, T = 225;
4939
+ function N() {
4940
+ const k = v / T;
4941
4941
  if (!a) {
4942
4942
  a = k;
4943
4943
  return;
4944
4944
  }
4945
- const _ = (k - a) / E;
4946
- p > 4 && _ > y && t.send(br(pe())), b = 0, p = 0, a = k;
4945
+ const _ = (k - a) / T;
4946
+ p > 4 && _ > b && t.send(br(pe())), v = 0, p = 0, a = k;
4947
4947
  }
4948
4948
  t.attachStartCallback(() => {
4949
- w = setInterval(() => O(), E);
4949
+ w = setInterval(() => N(), T);
4950
4950
  }), t.attachStopCallback(() => {
4951
4951
  i = -1, r = -1, o = !1, l = null, u = {}, w && clearInterval(w);
4952
4952
  });
4953
- const B = () => {
4953
+ const M = () => {
4954
4954
  o && (t.send(tr(i, r)), o = !1);
4955
- }, A = (k, _ = !1) => {
4956
- function R(I, T, F) {
4957
- return u[I] = u[I] || Po(T, k, F);
4955
+ }, D = (k, _ = !1) => {
4956
+ function R(I, E, P) {
4957
+ return u[I] = u[I] || Po(E, k, P);
4958
4958
  }
4959
4959
  const L = _ ? t.attachEventListener.bind(t) : t.nodes.attachNodeListener.bind(t.nodes);
4960
4960
  L(k.documentElement, "mouseover", (I) => {
4961
- const T = Ts(I.target, k);
4962
- T !== l && (l = T, c = performance.now());
4961
+ const E = Ts(I.target, k);
4962
+ E !== l && (l = E, c = performance.now());
4963
4963
  }), L(k, "mousemove", (I) => {
4964
- const [T, F] = t.observer.getDocumentOffset(k);
4965
- i = I.clientX + T, r = I.clientY + F, o = !0;
4964
+ const [E, P] = t.observer.getDocumentOffset(k);
4965
+ i = I.clientX + E, r = I.clientY + P, o = !0;
4966
4966
  const U = Math.sign(I.movementX);
4967
- b += Math.abs(I.movementX) + Math.abs(I.movementY), U !== d && (d = U, p++);
4967
+ v += Math.abs(I.movementX) + Math.abs(I.movementY), U !== d && (d = U, p++);
4968
4968
  }, !1), L(k, "click", (I) => {
4969
- const T = Ts(I.target, k);
4970
- if (!I.clientX && !I.clientY || T === null)
4969
+ const E = Ts(I.target, k);
4970
+ if (!I.clientX && !I.clientY || E === null)
4971
4971
  return;
4972
- const F = t.nodes.getID(T);
4973
- if (F !== void 0) {
4974
- const U = I.pageX, j = I.pageY, z = k.documentElement.scrollWidth, C = k.documentElement.scrollHeight, M = Es(U / z), V = Es(j / C);
4975
- B(), t.send(pr(F, l === T ? Math.round(performance.now() - c) : 0, s(T), xn(T) && !n ? R(F, T, e) : "", M, V), !0);
4972
+ const P = t.nodes.getID(E);
4973
+ if (P !== void 0) {
4974
+ const U = I.pageX, j = I.pageY, z = k.documentElement.scrollWidth, C = k.documentElement.scrollHeight, F = Es(U / z), V = Es(j / C);
4975
+ M(), t.send(pr(P, l === E ? Math.round(performance.now() - c) : 0, s(E), xn(E) && !n ? R(P, E, e) : "", F, V), !0);
4976
4976
  }
4977
4977
  l = null;
4978
4978
  });
4979
4979
  };
4980
4980
  t.nodes.attachNodeCallback((k) => {
4981
- bt(k) && A(k);
4982
- }), A(document, !0), t.ticker.attach(B, (e == null ? void 0 : e.trackingOffset) || 7);
4981
+ bt(k) && D(k);
4982
+ }), D(document, !0), t.ticker.attach(M, (e == null ? void 0 : e.trackingOffset) || 7);
4983
4983
  }
4984
4984
  function Es(t) {
4985
4985
  return Math.round(t * 1e4);
@@ -4992,8 +4992,8 @@ function zo(t) {
4992
4992
  if (Z(r, "img") && (o = r.currentSrc || r.src), !o) {
4993
4993
  const w = getComputedStyle(r).getPropertyValue("background-image");
4994
4994
  if (w) {
4995
- const y = s.exec(w);
4996
- y !== null && (o = y[1], (o.startsWith('"') || o.startsWith("'")) && (o = o.substr(1, o.length - 2)));
4995
+ const b = s.exec(w);
4996
+ b !== null && (o = b[1], (o.startsWith('"') || o.startsWith("'")) && (o = o.substr(1, o.length - 2)));
4997
4997
  }
4998
4998
  }
4999
4999
  if (!o)
@@ -5004,8 +5004,8 @@ function zo(t) {
5004
5004
  const c = r.getBoundingClientRect(), u = Math.max(c.top, 0), a = Math.max(c.left, 0), d = Math.min(c.bottom, window.innerHeight || document.documentElement && document.documentElement.clientHeight || 0), p = Math.min(c.right, window.innerWidth || document.documentElement && document.documentElement.clientWidth || 0);
5005
5005
  if (d <= u || p <= a)
5006
5006
  continue;
5007
- const b = (d - u) * (p - a);
5008
- e.push({ time: l, area: b });
5007
+ const v = (d - u) * (p - a);
5008
+ e.push({ time: l, area: v });
5009
5009
  }
5010
5010
  return e;
5011
5011
  }
@@ -5082,26 +5082,26 @@ function Ho(t, e) {
5082
5082
  navigationStart: a,
5083
5083
  requestStart: d,
5084
5084
  responseStart: p,
5085
- responseEnd: b,
5085
+ responseEnd: v,
5086
5086
  domContentLoadedEventStart: w,
5087
- domContentLoadedEventEnd: y,
5088
- loadEventStart: E,
5089
- loadEventEnd: O
5087
+ domContentLoadedEventEnd: b,
5088
+ loadEventStart: T,
5089
+ loadEventEnd: N
5090
5090
  } = performance.timing;
5091
- t.send(sr(d - a || 0, p - a || 0, b - a || 0, w - a || 0, y - a || 0, E - a || 0, O - a || 0, l, c));
5091
+ t.send(sr(d - a || 0, p - a || 0, v - a || 0, w - a || 0, b - a || 0, T - a || 0, N - a || 0, l, c));
5092
5092
  }
5093
5093
  }, 30);
5094
5094
  }
5095
5095
  if (n.capturePageRenderTimings) {
5096
- let u = 0, a = 0, d = 0, p = null, b = !1;
5096
+ let u = 0, a = 0, d = 0, p = null, v = !1;
5097
5097
  t.ticker.attach(() => {
5098
- if (b)
5098
+ if (v)
5099
5099
  return;
5100
5100
  const w = performance.now();
5101
- if (s !== null && (u = Math.max.apply(null, Object.keys(s).map((y) => s[y])), w - u > 1e3 && (p = zo(s), s = null)), d !== null && (w - d > 50 && (a = w), d = w - a > 5e3 ? null : w), p !== null && d === null || w > 3e4) {
5102
- b = !0, s = null;
5103
- const y = p === null ? 0 : Uo(c || l, p), { domContentLoadedEventEnd: E, navigationStart: O } = performance.timing, B = d === null ? Math.max(a, c, E - O || 0) : 0;
5104
- t.send(ir(y, c > u ? c : u, B));
5101
+ if (s !== null && (u = Math.max.apply(null, Object.keys(s).map((b) => s[b])), w - u > 1e3 && (p = zo(s), s = null)), d !== null && (w - d > 50 && (a = w), d = w - a > 5e3 ? null : w), p !== null && d === null || w > 3e4) {
5102
+ v = !0, s = null;
5103
+ const b = p === null ? 0 : Uo(c || l, p), { domContentLoadedEventEnd: T, navigationStart: N } = performance.timing, M = d === null ? Math.max(a, c, T - N || 0) : 0;
5104
+ t.send(ir(b, c > u ? c : u, M));
5105
5105
  }
5106
5106
  });
5107
5107
  }
@@ -5177,11 +5177,11 @@ function Vo(t) {
5177
5177
  if (a && Symbol.iterator in a)
5178
5178
  for (const d of a) {
5179
5179
  let p = e.get(d);
5180
- const b = !p;
5181
- if (p || (p = hi(), e.set(d, p)), c.includes(p) || t.send(Ys(p, l)), b) {
5180
+ const v = !p;
5181
+ if (p || (p = hi(), e.set(d, p)), c.includes(p) || t.send(Ys(p, l)), v) {
5182
5182
  const w = d.cssRules;
5183
- for (let y = 0; y < w.length; y++)
5184
- t.send(fn(p, w[y].cssText, y, t.getBaseHref()));
5183
+ for (let b = 0; b < w.length; b++)
5184
+ t.send(fn(p, w[b].cssText, b, t.getBaseHref()));
5185
5185
  }
5186
5186
  u.push(p);
5187
5187
  }
@@ -5336,19 +5336,19 @@ function Xo(t, e, n, s, i) {
5336
5336
  t.debug.log("Openreplay: attaching axios spy to instance", e);
5337
5337
  function r(p) {
5338
5338
  t.debug.log("Openreplay: capturing axios response data", p);
5339
- const { headers: b, data: w, method: y, url: E, baseURL: O } = p.config, { data: B, headers: A, status: k, response: _ } = p, { data: R, headers: L, status: I } = _ || {}, T = n.ignoreHeaders, F = Array.isArray(T) ? ($) => T.includes($) : () => T;
5340
- function U($, v) {
5341
- F(v[0]) || ($[v[0]] = v[1]);
5339
+ const { headers: v, data: w, method: b, url: T, baseURL: N } = p.config, { data: M, headers: D, status: k, response: _ } = p, { data: R, headers: L, status: I } = _ || {}, E = n.ignoreHeaders, P = Array.isArray(E) ? ($) => E.includes($) : () => E;
5340
+ function U($, y) {
5341
+ P(y[0]) || ($[y[0]] = y[1]);
5342
5342
  }
5343
5343
  let j = {}, z = {};
5344
- b.toJSON ? j = b.toJSON() : b instanceof Headers ? b.forEach(($, v) => U(j, [v, $])) : Array.isArray(b) ? b.forEach(($) => U(j, $)) : typeof b == "object" && Object.entries(b).forEach(($) => U(j, $));
5345
- const C = L || A;
5346
- C.toJSON ? z = C.toJSON() : C instanceof Headers ? C.forEach(($, v) => U(z, [v, $])) : Array.isArray(C) ? C.forEach(($) => U(z, $)) : typeof C == "object" && Object.entries(C).forEach(([$, v]) => {
5347
- F($) || (z[$] = v);
5344
+ v.toJSON ? j = v.toJSON() : v instanceof Headers ? v.forEach(($, y) => U(j, [y, $])) : Array.isArray(v) ? v.forEach(($) => U(j, $)) : typeof v == "object" && Object.entries(v).forEach(($) => U(j, $));
5345
+ const C = L || D;
5346
+ C.toJSON ? z = C.toJSON() : C instanceof Headers ? C.forEach(($, y) => U(z, [y, $])) : Array.isArray(C) ? C.forEach(($) => U(z, $)) : typeof C == "object" && Object.entries(C).forEach(([$, y]) => {
5347
+ P($) || (z[$] = y);
5348
5348
  });
5349
- const M = s({
5350
- url: E,
5351
- method: y || "",
5349
+ const F = s({
5350
+ url: T,
5351
+ method: b || "",
5352
5352
  status: k || I || 0,
5353
5353
  request: {
5354
5354
  headers: j,
@@ -5356,20 +5356,20 @@ function Xo(t, e, n, s, i) {
5356
5356
  },
5357
5357
  response: {
5358
5358
  headers: z,
5359
- body: R || B
5359
+ body: R || M
5360
5360
  }
5361
5361
  });
5362
- if (!M) {
5362
+ if (!F) {
5363
5363
  t.debug.log("Openreplay: empty request/response info, skipping");
5364
5364
  return;
5365
5365
  }
5366
- const V = p.config.__openreplay_timing, G = performance.now() - V;
5367
- t.debug.log("Openreplay: final req object", M), t.send(vt("xhr", String(y), String(M.url), i(M.request), i(M.response), M.status, V + Ve(), G, 0));
5366
+ const V = p.config.__openreplay_timing, K = performance.now() - V;
5367
+ t.debug.log("Openreplay: final req object", F), t.send(vt("xhr", String(b), String(F.url), i(F.request), i(F.response), F.status, V + Ve(), K, 0));
5368
5368
  }
5369
5369
  function o(p) {
5370
5370
  if (t.debug.log("Openreplay: capturing API request", p), p.__openreplay_timing = performance.now(), n.sessionTokenHeader) {
5371
- const b = typeof n.sessionTokenHeader == "string" ? n.sessionTokenHeader : "X-OpenReplay-Session-Token", w = t.getSessionToken();
5372
- w && p.headers.set(b, w);
5371
+ const v = typeof n.sessionTokenHeader == "string" ? n.sessionTokenHeader : "X-OpenReplay-Session-Token", w = t.getSessionToken();
5372
+ w && p.headers.set(v, w);
5373
5373
  }
5374
5374
  return p;
5375
5375
  }
@@ -5388,8 +5388,8 @@ function Xo(t, e, n, s, i) {
5388
5388
  synchronous: !0
5389
5389
  });
5390
5390
  t.attachStopCallback(() => {
5391
- var p, b, w, y;
5392
- (b = (p = e.interceptors.request).eject) == null || b.call(p, a), (y = (w = e.interceptors.response).eject) == null || y.call(w, d);
5391
+ var p, v, w, b;
5392
+ (v = (p = e.interceptors.request).eject) == null || v.call(p, a), (b = (w = e.interceptors.response).eject) == null || b.call(w, d);
5393
5393
  });
5394
5394
  }
5395
5395
  function Yo(t) {
@@ -5814,90 +5814,90 @@ function la(t, e = {}) {
5814
5814
  }
5815
5815
  const u = (a) => {
5816
5816
  if (n.useProxy)
5817
- return ca(a, n.ignoreHeaders, o, l, (A) => t.send(A), (A) => t.isServiceURL(A), n.tokenUrlMatcher);
5818
- const d = a.fetch.bind(a), p = (A, k = {}) => {
5819
- if (!(typeof A == "string" || A instanceof URL) || t.isServiceURL(String(A)))
5820
- return d(A, k);
5817
+ return ca(a, n.ignoreHeaders, o, l, (D) => t.send(D), (D) => t.isServiceURL(D), n.tokenUrlMatcher);
5818
+ const d = a.fetch.bind(a), p = (D, k = {}) => {
5819
+ if (!(typeof D == "string" || D instanceof URL) || t.isServiceURL(String(D)))
5820
+ return d(D, k);
5821
5821
  o(function(R, L) {
5822
5822
  k.headers === void 0 && (k.headers = {}), k.headers instanceof Headers ? k.headers.append(R, L) : Array.isArray(k.headers) ? k.headers.push([R, L]) : k.headers[R] = L;
5823
5823
  });
5824
5824
  const _ = performance.now();
5825
- return d(A, k).then((R) => {
5825
+ return d(D, k).then((R) => {
5826
5826
  const L = performance.now() - _;
5827
5827
  if (n.failuresOnly && R.status < 400)
5828
5828
  return R;
5829
5829
  const I = R.clone();
5830
- return I.text().then((T) => {
5831
- const F = {}, U = {};
5830
+ return I.text().then((E) => {
5831
+ const P = {}, U = {};
5832
5832
  if (s !== !0) {
5833
- const C = ([M, V]) => {
5834
- i(M) || (F[M] = V);
5833
+ const C = ([F, V]) => {
5834
+ i(F) || (P[F] = V);
5835
5835
  };
5836
- k.headers instanceof Headers ? k.headers.forEach((M, V) => C([V, M])) : Array.isArray(k.headers) ? k.headers.forEach(C) : typeof k.headers == "object" && Object.entries(k.headers).forEach(C), I.headers.forEach((M, V) => {
5837
- i(V) || (U[V] = M);
5836
+ k.headers instanceof Headers ? k.headers.forEach((F, V) => C([V, F])) : Array.isArray(k.headers) ? k.headers.forEach(C) : typeof k.headers == "object" && Object.entries(k.headers).forEach(C), I.headers.forEach((F, V) => {
5837
+ i(V) || (U[V] = F);
5838
5838
  });
5839
5839
  }
5840
5840
  const j = _s(k.method), z = l({
5841
- url: String(A),
5841
+ url: String(D),
5842
5842
  method: j,
5843
5843
  status: I.status,
5844
5844
  request: {
5845
- headers: F,
5845
+ headers: P,
5846
5846
  // @ts-ignore
5847
5847
  body: k.body || null
5848
5848
  },
5849
5849
  response: {
5850
5850
  headers: U,
5851
- body: T
5851
+ body: E
5852
5852
  }
5853
5853
  });
5854
5854
  z && t.send(vt("fetch", j, String(z.url), c(z.request), c(z.response), I.status, _ + Ve(), L, 0));
5855
- }).catch((T) => t.debug.error("Could not process Fetch response:", T)), R;
5855
+ }).catch((E) => t.debug.error("Could not process Fetch response:", E)), R;
5856
5856
  });
5857
5857
  };
5858
5858
  a.fetch = p;
5859
- const b = a.XMLHttpRequest.prototype.open, w = a.XMLHttpRequest.prototype.setRequestHeader, y = a.XMLHttpRequest.prototype.send;
5860
- function E(A, k) {
5859
+ const v = a.XMLHttpRequest.prototype.open, w = a.XMLHttpRequest.prototype.setRequestHeader, b = a.XMLHttpRequest.prototype.send;
5860
+ function T(D, k) {
5861
5861
  const _ = this;
5862
5862
  o((L, I) => _.setRequestHeader(L, I));
5863
5863
  let R = 0;
5864
5864
  return _.addEventListener("loadstart", (L) => {
5865
5865
  R = L.timeStamp;
5866
5866
  }), _.addEventListener("load", t.safe((L) => {
5867
- const { headers: I, body: T } = on(_), F = R > 0 ? L.timeStamp - R : 0, j = (_.getAllResponseHeaders() || "").trim().split(/[\r\n]+/), z = {};
5867
+ const { headers: I, body: E } = on(_), P = R > 0 ? L.timeStamp - R : 0, j = (_.getAllResponseHeaders() || "").trim().split(/[\r\n]+/), z = {};
5868
5868
  j.forEach(function(V) {
5869
- const G = V.split(": "), $ = G.shift();
5870
- i($) || (z[$] = G.join(": "));
5869
+ const K = V.split(": "), $ = K.shift();
5870
+ i($) || (z[$] = K.join(": "));
5871
5871
  });
5872
- const C = _s(A), M = l({
5872
+ const C = _s(D), F = l({
5873
5873
  url: String(k),
5874
5874
  method: C,
5875
5875
  status: _.status,
5876
5876
  request: {
5877
5877
  headers: I,
5878
5878
  // @ts-ignore
5879
- body: T || null
5879
+ body: E || null
5880
5880
  },
5881
5881
  response: {
5882
5882
  headers: z,
5883
5883
  body: _.response
5884
5884
  }
5885
5885
  });
5886
- M && t.send(vt("xhr", C, String(M.url), c(M.request), c(M.response), _.status, R + Ve(), F, 0));
5887
- })), b.apply(this, arguments);
5886
+ F && t.send(vt("xhr", C, String(F.url), c(F.request), c(F.response), _.status, R + Ve(), P, 0));
5887
+ })), v.apply(this, arguments);
5888
5888
  }
5889
- function O(A) {
5889
+ function N(D) {
5890
5890
  const k = on(this);
5891
- return k.body = A, y.apply(this, arguments);
5891
+ return k.body = D, b.apply(this, arguments);
5892
5892
  }
5893
- function B(A, k) {
5894
- if (!i(A)) {
5893
+ function M(D, k) {
5894
+ if (!i(D)) {
5895
5895
  const _ = on(this);
5896
- _.headers[A] = k;
5896
+ _.headers[D] = k;
5897
5897
  }
5898
5898
  return w.apply(this, arguments);
5899
5899
  }
5900
- n.axiosInstances || (a.XMLHttpRequest.prototype.open = E, a.XMLHttpRequest.prototype.send = O, a.XMLHttpRequest.prototype.setRequestHeader = B);
5900
+ n.axiosInstances || (a.XMLHttpRequest.prototype.open = T, a.XMLHttpRequest.prototype.send = N, a.XMLHttpRequest.prototype.setRequestHeader = M);
5901
5901
  };
5902
5902
  u(window), n.axiosInstances && n.axiosInstances.forEach((a) => {
5903
5903
  Xo(t, a, n, l, c);
@@ -7071,7 +7071,7 @@ class fi {
7071
7071
  "Content-Type": "application/json",
7072
7072
  Authorization: `Bearer ${this.token}`
7073
7073
  },
7074
- body: JSON.stringify({ text: e, store: this.store ? this.store.toString().charAt(0).toUpperCase() + this.store.slice(1) : void 0 })
7074
+ body: JSON.stringify({ text: e })
7075
7075
  }), s = await n.json();
7076
7076
  if (!n.ok)
7077
7077
  throw new Error(`API call failed with status ${n.status}: ${s.message || "No additional error information"}`);
@@ -7577,12 +7577,78 @@ class va {
7577
7577
  headerBudget: "бюджет",
7578
7578
  headerOccasion: "случай",
7579
7579
  headerOr: "или"
7580
+ },
7581
+ kz: {
7582
+ lang: "kz",
7583
+ welcomeMessage: "Сіз не жегіңіз келеді? Тағамыңызды сипаттаңыз, мен оған керемет шарап ұсынамын.",
7584
+ noResultsFound: "Нәтижелер табылмады.",
7585
+ somethingWentWrong: "Кешіріңіз, бірдеңе дұрыс болмады.",
7586
+ chatButton1: "Сәйкестік табу",
7587
+ chatButton2: "Шарап таңдау",
7588
+ chatButton3: "Кеңес алу",
7589
+ chatTitle: "Шарап таңдаушы көмекші 🍷",
7590
+ chatSubtitle: "Тағамыңызды сипаттаңыз — 30 секундта ұсыныс алыңыз",
7591
+ inputPlaceholder: "мысалы, тунец салатымен",
7592
+ sendButton: "Таңдау",
7593
+ poweredBy: "Powered by",
7594
+ price: "Бағасы",
7595
+ region: "Өңір",
7596
+ type: "Түрі",
7597
+ reason: "Ұсыныс",
7598
+ moreInfo: "Толығырақ",
7599
+ winePairingIntro: "Бұл шарапқа келесі тағамдар сәйкес келеді:",
7600
+ askForDinner: "Кешкі асқа не қалайсыз?",
7601
+ clearChatButton: "Чатты тазалау",
7602
+ widgetTitle: "КЕРЕМЕТ ШАРАПТЫ ТАБЫҢЫЗ",
7603
+ widgetSubtitle: "Таңдауларыңызды бөлісіңіз — тағам, көңіл-күй, бюджет немесе жағдай — және біздің AI-сомелье сізге бірнеше секундта шарап ұсынады",
7604
+ searchPlaceholder: "Кілт сөзді немесе сипаттаманы енгізіңіз",
7605
+ wineDetails: {
7606
+ price: "Бағасы",
7607
+ region: "Өңір",
7608
+ type: "Түрі",
7609
+ moreInfo: "Толығырақ",
7610
+ reason: "Себебі",
7611
+ sommSelection: "Сомелье таңдауы",
7612
+ code: "Код",
7613
+ buy: "Сатып алу"
7614
+ },
7615
+ searchButton: "Іздеу",
7616
+ priceRange: "Баға диапазоны",
7617
+ wineColor: "Шарап түсі",
7618
+ intensity: "Қанықтылық",
7619
+ red: "Қызыл",
7620
+ white: "Ақ",
7621
+ rose: "Розалық",
7622
+ light: "Жеңіл",
7623
+ medium: "Орташа",
7624
+ full: "Толық",
7625
+ /* -- Барға арналған жаңа кілттер -- */
7626
+ barTitle: "Шарапқа арналған тіскебасарлар",
7627
+ barSubtitle: "Төмендегі тағамдарды таңдаңыз және 'Жіберу' батырмасын басыңыз",
7628
+ barSendButton: "Жіберу",
7629
+ barResetButton: "Қалпына келтіру",
7630
+ barName: "Бар атауы",
7631
+ barNotesPlaceholder: "Мұнда өз тілектеріңізді жазыңыз...",
7632
+ placeholderSuggestions: [
7633
+ "Пастаға арналған шарап",
7634
+ "Балыққа тамаша үйлеседі",
7635
+ "Кешке ұсынуға болады"
7636
+ ],
7637
+ headerLine1: "Ойларыңызбен бөлісіңіз —",
7638
+ headerLine2: "— және бірнеше секундта мінсіз шарап ұсынысын алыңыз",
7639
+ headerMeal: "тағам",
7640
+ headerMood: "көңіл-күй",
7641
+ headerBudget: "бюджет",
7642
+ headerOccasion: "жағдай",
7643
+ headerOr: "немесе"
7580
7644
  }
7581
7645
  };
7582
7646
  }
7583
7647
  async fetchConfig(e) {
7584
7648
  try {
7585
- const n = await this.api.getStoreConfig(e), s = localStorage.getItem("selectedLanguage");
7649
+ const n = await this.api.getStoreConfig(e);
7650
+ this.storeLanguage = n.lang, this.supportedLanguages = n.available_languages;
7651
+ const s = localStorage.getItem("selectedLanguage");
7586
7652
  s && this.translations[s] ? this.language = s : n.lang && this.translations[n.lang] ? (this.language = n.lang, localStorage.setItem("selectedLanguage", n.lang)) : this.language = "en", this.currency = n.currency || "USD";
7587
7653
  } catch {
7588
7654
  this.language = localStorage.getItem("selectedLanguage") || "en", this.currency = "USD";
@@ -7609,10 +7675,44 @@ class va {
7609
7675
  return s;
7610
7676
  }
7611
7677
  getSupportedLanguages() {
7612
- return Object.keys(this.translations);
7678
+ return this.supportedLanguages;
7679
+ }
7680
+ async translateTexts(e) {
7681
+ var u, a, d, p;
7682
+ if (this.storeLanguage === this.language || !this.supportedLanguages)
7683
+ return e;
7684
+ const n = "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", s = "https://api.openai.com/v1/chat/completions", i = {
7685
+ "Content-Type": "application/json",
7686
+ Authorization: `Bearer ${n}`
7687
+ }, o = Object.values(e).join(" ||| "), l = `Translate the following texts to ${this.language}. Return only the translated texts separated by " ||| " in the same order:
7688
+
7689
+ ${o}`, c = JSON.stringify({
7690
+ model: "gpt-3.5-turbo",
7691
+ messages: [
7692
+ { role: "system", content: "You are a professional translator." },
7693
+ { role: "user", content: l }
7694
+ ],
7695
+ temperature: 0.2,
7696
+ max_tokens: 1e3
7697
+ });
7698
+ try {
7699
+ const b = (p = (d = (a = (u = (await (await fetch(s, {
7700
+ method: "POST",
7701
+ headers: i,
7702
+ body: c
7703
+ })).json()).choices) == null ? void 0 : u[0]) == null ? void 0 : a.message) == null ? void 0 : d.content) == null ? void 0 : p.trim();
7704
+ if (!b)
7705
+ throw new Error("No response from OpenAI");
7706
+ const T = b.split(" ||| ").map((M) => M.trim()), N = {};
7707
+ return Object.keys(e).forEach((M, D) => {
7708
+ N[M] = T[D] || e[M];
7709
+ }), N;
7710
+ } catch (v) {
7711
+ return console.error("Error translating texts:", v), e;
7712
+ }
7613
7713
  }
7614
7714
  }
7615
- const Y = new va();
7715
+ const G = new va();
7616
7716
  class ba {
7617
7717
  constructor() {
7618
7718
  var e, n, s, i, r;
@@ -7627,18 +7727,18 @@ class ba {
7627
7727
  }
7628
7728
  getTitle(e) {
7629
7729
  return e ? `<h1 class="wine-widget-big-title">${e}</h1>` : `<h1 class="wine-widget-big-title">
7630
- ${Y.translate("headerLine1")}
7730
+ ${G.translate("headerLine1")}
7631
7731
  <span class="icon icon-meal"></span>
7632
- <span class="icon-label">${Y.translate("headerMeal")}</span>,
7732
+ <span class="icon-label">${G.translate("headerMeal")}</span>,
7633
7733
  <span class="icon icon-mood"></span>
7634
- <span class="icon-label">${Y.translate("headerMood")}</span>
7734
+ <span class="icon-label">${G.translate("headerMood")}</span>
7635
7735
  </br>
7636
7736
  <!-- <span class="icon icon-budget"></span> -->
7637
- <!-- <span class="icon-label">${Y.translate("headerBudget")}</span>, -->
7638
- ${Y.translate("headerOr")}
7737
+ <!-- <span class="icon-label">${G.translate("headerBudget")}</span>, -->
7738
+ ${G.translate("headerOr")}
7639
7739
  <span class="icon icon-occasion"></span>
7640
- <span class="icon-label">${Y.translate("headerOccasion")}</span>
7641
- ${Y.translate("headerLine2")}
7740
+ <span class="icon-label">${G.translate("headerOccasion")}</span>
7741
+ ${G.translate("headerLine2")}
7642
7742
  </h1>`;
7643
7743
  }
7644
7744
  initializeWidget() {
@@ -7657,11 +7757,11 @@ class ba {
7657
7757
  <input
7658
7758
  type="text"
7659
7759
  id="wine-search-input"
7660
- placeholder="${Y.translate("searchPlaceholder")}">
7760
+ placeholder="${G.translate("searchPlaceholder")}">
7661
7761
 
7662
7762
  <!-- Кнопка -->
7663
7763
  <button id="wine-search-button">
7664
- ${Y.translate("searchButton")}
7764
+ ${G.translate("searchButton")}
7665
7765
  </button>
7666
7766
  </div>
7667
7767
  <div id="wine-widget-right">
@@ -7675,9 +7775,9 @@ class ba {
7675
7775
  <div id="powered-by-widget">
7676
7776
  <div class="powered-by-center">
7677
7777
  <a href="https://wineater.com" target="_blank">
7678
- <span>${Y.translate("poweredBy")}</span>
7778
+ <span>${G.translate("poweredBy")}</span>
7679
7779
  <img src="${this.countryCode === "ru" ? "https://czvgkhagwvmknscoerfy.supabase.co/storage/v1/object/public/static-media/divino_logo.svg?x=5" : "https://czvgkhagwvmknscoerfy.supabase.co/storage/v1/object/public/static-media/logo_medium_gray.svg"}" alt="Wineater Logo">
7680
- <span class="powered-by-sommelier">${Y.translate("AI sommelier")}</span>
7780
+ <span class="powered-by-sommelier">${G.translate("AI sommelier")}</span>
7681
7781
  </a>
7682
7782
  </div>
7683
7783
  <div class="powered-by-lang"></div>
@@ -7738,60 +7838,60 @@ class ba {
7738
7838
  function c(u) {
7739
7839
  return typeof u != "number" && (u = Number(u)), u.toLocaleString("en-US");
7740
7840
  }
7741
- e.forEach((u, a) => {
7742
- const d = i(u, "title"), p = i(u, "image"), b = i(u, "total"), w = i(u, "url"), y = u.tags || u.Tags, E = r(u, ["type", "country", "region", "grape"]), O = y ? o(y) : "", B = l(u), A = u["Short Description"], k = u.pairing_recommendation, _ = u.isSommSelection, R = `
7841
+ e.forEach(async (u, a) => {
7842
+ const d = i(u, "title"), p = i(u, "image"), v = i(u, "total"), w = i(u, "url"), b = u.tags || u.Tags, T = r(u, ["type", "country", "region", "grape"]), N = b ? o(b) : "", M = l(u), D = u["Short Description"], k = u.pairing_recommendation, _ = u.isSommSelection, R = `
7743
7843
  <div class="wine-recommendation-tile ${_ ? "somm-selection" : ""}">
7744
- ${_ ? `<div class="somm-selection-badge">${Y.translate("wineDetails.sommSelection")}</div>` : ""}
7844
+ ${_ ? `<div class="somm-selection-badge">${G.translate("wineDetails.sommSelection")}</div>` : ""}
7745
7845
 
7746
7846
  <div class="tile-top">
7747
7847
  ${p ? `<img src="${p}" alt="${d}" class="wine-image" />` : ""}
7748
- <div class="wine-price">${c(b)} ${Y.getCurrency("label")}</div>
7848
+ <div class="wine-price">${c(v)} ${G.getCurrency("label")}</div>
7749
7849
  <h3 class="wine-title">${d}</h3>
7750
7850
  </div>
7751
7851
 
7752
- ${E ? `<div class="wine-params">${E}</div>` : ""}
7852
+ ${T ? `<div class="wine-params">${T}</div>` : ""}
7753
7853
 
7754
7854
  <div class="bottom-row">
7755
- ${w ? `<a class="buy-btn" href="${w}" target="_blank">${Y.translate("wineDetails.buy")}</a>` : `<button class="buy-btn" data-toggle-info>${Y.translate("moreInfo")}</button>`}
7855
+ ${w ? `<a class="buy-btn" href="${w}" target="_blank">${G.translate("wineDetails.buy")}</a>` : `<button class="buy-btn" data-toggle-info>${G.translate("moreInfo")}</button>`}
7756
7856
  </div>
7757
7857
 
7758
- <div class="card-popup hidden">
7759
- <div class="card-popup-header">
7760
- <h2>${d}</h2>
7761
- <span class="card-popup-close">&times;</span>
7762
- </div>
7763
- ${A ? `<p>${A}</p>` : ""}
7764
- ${u.reason ? `<div class="popup-reason">${u.reason}</div>` : k ? `<p>${k}</p>` : ""}
7765
- ${O ? `<div class="popup-tags">${O}</div>` : ""}
7766
- </div>
7858
+ <div class="card-popup hidden" data-wine-index="${a}">
7859
+ <div class="card-popup-header">
7860
+ <h2>${d}</h2>
7861
+ <span class="card-popup-close">&times;</span>
7862
+ </div>
7863
+ ${D ? `<p class="popup-short-desc" data-orig="${D}">${D}</p>` : ""}
7864
+ ${u.reason ? `<div class="popup-reason" data-orig="${u.reason}">${u.reason}</div>` : k ? `<p class="popup-pairing" data-orig="${k}">${k}</p>` : ""}
7865
+ ${N ? `<div class="popup-tags">${N}</div>` : ""}
7866
+ </div>
7767
7867
 
7768
- ${B}
7868
+ ${M}
7769
7869
  </div>
7770
7870
  `;
7771
7871
  s.insertAdjacentHTML("beforeend", R);
7772
7872
  const L = s.children[a];
7773
7873
  if (!w) {
7774
- const I = L.querySelector("[data-toggle-info]"), T = L.querySelector(".card-popup"), F = L.querySelector(".card-popup-close");
7775
- F == null || F.addEventListener("click", (U) => {
7776
- U.stopPropagation(), T.classList.add("hidden");
7874
+ const I = L.querySelector("[data-toggle-info]"), E = L.querySelector(".card-popup"), P = L.querySelector(".card-popup-close");
7875
+ P == null || P.addEventListener("click", (U) => {
7876
+ U.stopPropagation(), E.classList.add("hidden");
7777
7877
  }), document.addEventListener("click", (U) => {
7778
7878
  U.target.closest(".card-popup") || U.target.closest(".mobile-fullscreen-popup") || U.target.closest("[data-toggle-info]") || (document.querySelectorAll(".card-popup").forEach((z) => z.classList.add("hidden")), document.querySelectorAll(".mobile-fullscreen-wrapper").forEach((z) => z.remove()));
7779
7879
  }), I == null || I.addEventListener("click", (U) => {
7780
7880
  var j;
7781
7881
  if (U.stopPropagation(), document.querySelectorAll(".card-popup").forEach((z) => z.classList.add("hidden")), document.querySelectorAll(".mobile-fullscreen-wrapper").forEach((z) => z.remove()), window.innerWidth <= 768) {
7782
- const z = T.innerHTML, C = document.createElement("div");
7882
+ const z = E.innerHTML, C = document.createElement("div");
7783
7883
  C.className = "mobile-fullscreen-wrapper", C.innerHTML = `
7784
7884
  <div class="mobile-fullscreen-overlay"></div>
7785
7885
  <div class="card-popup mobile-fullscreen-popup">${z}</div>
7786
7886
  `, (j = C.querySelector(".card-popup-close")) == null || j.addEventListener("click", () => C.remove()), document.body.appendChild(C);
7787
7887
  } else
7788
- T.classList.remove("hidden");
7888
+ E.classList.remove("hidden");
7789
7889
  });
7790
7890
  }
7791
7891
  setTimeout(() => {
7792
7892
  L.style.opacity = "1", L.style.transform = "translateY(0)";
7793
7893
  }, n ? a * 200 : 0);
7794
- }), this.widgetType === "store" && this.enableHoverPopups();
7894
+ }), this.translatePopupContent(e), this.widgetType === "store" && this.enableHoverPopups();
7795
7895
  }
7796
7896
  animateCardDisappearance() {
7797
7897
  const e = document.querySelectorAll(".wine-recommendation-tile");
@@ -7813,7 +7913,7 @@ class ba {
7813
7913
  const e = document.getElementById("wine-placeholder");
7814
7914
  e.innerHTML = `
7815
7915
  <div class="no-results">
7816
- <p>${Y.translate("noResultsMessage") || "No recommendations found for your query."}</p>
7916
+ <p>${G.translate("noResultsMessage") || "No recommendations found for your query."}</p>
7817
7917
  </div>
7818
7918
  `;
7819
7919
  }
@@ -7821,10 +7921,47 @@ class ba {
7821
7921
  const e = document.getElementById("wine-placeholder");
7822
7922
  e.innerHTML = `
7823
7923
  <div class="error-message">
7824
- <p>${Y.translate("errorMessage") || "Something went wrong. Please try again later."}</p>
7924
+ <p>${G.translate("errorMessage") || "Something went wrong. Please try again later."}</p>
7825
7925
  </div>
7826
7926
  `;
7827
7927
  }
7928
+ async translatePopupContent(e) {
7929
+ if (console.log(G.language, G.storeLanguage), G.language === G.storeLanguage || this.widgetType !== "bar")
7930
+ return;
7931
+ const n = ["Short Description", "reason", "pairing_recommendation", "Tags"];
7932
+ G.language;
7933
+ const s = 4;
7934
+ for (let i = 0; i < e.length; i += s) {
7935
+ const o = e.slice(i, i + s).map(async (l, c) => {
7936
+ const u = i + c, a = {};
7937
+ if (n.forEach((v) => {
7938
+ const w = l[v] || l[v.toLowerCase()];
7939
+ w && (a[v] = Array.isArray(w) ? w.join(", ") : w);
7940
+ }), Object.keys(a).length === 0)
7941
+ return;
7942
+ const d = await G.translateTexts(a), p = document.querySelector(`.card-popup[data-wine-index="${u}"]`);
7943
+ if (p) {
7944
+ if (d["Short Description"]) {
7945
+ const v = p.querySelector(".popup-short-desc");
7946
+ v && (v.textContent = d["Short Description"]);
7947
+ }
7948
+ if (d.reason) {
7949
+ const v = p.querySelector(".popup-reason");
7950
+ v && (v.textContent = d.reason);
7951
+ }
7952
+ if (d.pairing_recommendation) {
7953
+ const v = p.querySelector(".popup-pairing");
7954
+ v && (v.textContent = d.pairing_recommendation);
7955
+ }
7956
+ if (d.Tags) {
7957
+ const w = d.Tags.split(",").map((T) => T.trim()).map((T) => `<span class="popup-tag">${T}</span>`).join(""), b = p.querySelector(".popup-tags");
7958
+ b && (b.innerHTML = w);
7959
+ }
7960
+ }
7961
+ });
7962
+ await Promise.all(o);
7963
+ }
7964
+ }
7828
7965
  async loadInstantRecommendations() {
7829
7966
  this.showLoadingIndicator();
7830
7967
  try {
@@ -7835,7 +7972,7 @@ class ba {
7835
7972
  }
7836
7973
  }
7837
7974
  initializeSearchAnimation() {
7838
- const e = document.getElementById("wine-search-input"), n = Y.translate("placeholderSuggestions");
7975
+ const e = document.getElementById("wine-search-input"), n = G.translate("placeholderSuggestions");
7839
7976
  let s = 0, i = 0, r = !0, o = !1;
7840
7977
  const l = () => {
7841
7978
  o || (r ? (e.placeholder = n[s].substring(0, i++), i > n[s].length ? (r = !1, setTimeout(l, 2e3)) : setTimeout(l, 100)) : (e.placeholder = n[s].substring(0, i--), i < 0 ? (r = !0, s = (s + 1) % n.length, setTimeout(l, 500)) : setTimeout(l, 50)));
@@ -7847,13 +7984,16 @@ class ba {
7847
7984
  });
7848
7985
  }
7849
7986
  createLanguageSwitcher() {
7850
- const e = document.querySelector("#powered-by-widget .powered-by-lang"), n = Y.getSupportedLanguages(), s = Y.language, i = document.createElement("select");
7987
+ const e = document.querySelector("#powered-by-widget .powered-by-lang"), n = G.getSupportedLanguages();
7988
+ if (!n)
7989
+ return;
7990
+ const s = G.language, i = document.createElement("select");
7851
7991
  i.id = "language-dropdown", i.className = "language-dropdown", n.forEach((r) => {
7852
7992
  const o = document.createElement("option");
7853
7993
  o.value = r, o.textContent = r.toUpperCase(), o.selected = r === s, i.appendChild(o);
7854
7994
  }), i.onchange = (r) => {
7855
7995
  const o = r.target.value;
7856
- Y.language = o, localStorage.setItem("selectedLanguage", o), location.reload();
7996
+ G.language = o, localStorage.setItem("selectedLanguage", o), location.reload();
7857
7997
  }, e.appendChild(i);
7858
7998
  }
7859
7999
  }
@@ -7864,7 +8004,7 @@ class wa {
7864
8004
  }
7865
8005
  async initTranslator() {
7866
8006
  const e = this.store ? this.store.charAt(0).toUpperCase() + this.store.slice(1) : "Test";
7867
- await Y.fetchConfig(e || "Test");
8007
+ await G.fetchConfig(e || "Test");
7868
8008
  }
7869
8009
  initCookies() {
7870
8010
  var e;