configcat-vue 1.2.2 → 1.3.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.
@@ -1,75 +1,30 @@
1
- import { openBlock as se, createElementBlock as ae, renderSlot as de } from "vue";
2
- const Be = (t, e) => {
3
- const r = t.__vccOpts || t;
4
- for (const [n, i] of e)
5
- r[n] = i;
6
- return r;
7
- }, Ge = {
8
- emits: ["flagValueChanged"],
9
- props: {
10
- featureKey: {
11
- type: String,
12
- required: !0
13
- },
14
- userObject: {
15
- type: Object,
16
- required: !1,
17
- default: {}
18
- }
19
- },
20
- data() {
21
- return {
22
- isFeatureFlagEnabled: !1
23
- };
24
- },
25
- mounted() {
26
- this.configCatClient.getValueAsync(this.featureKey, !1, this.userObject).then((t) => {
27
- this.isFeatureFlagEnabled = t;
28
- }), this.configCatClient.on("configChanged", (t) => {
29
- const e = t.settings[this.featureKey].value;
30
- this.isFeatureFlagEnabled = e, this.$emit("flagValueChanged", e);
31
- });
32
- },
33
- unmounted() {
34
- this.configCatClient.dispose();
35
- }
36
- }, Je = { key: 0 }, $e = { key: 1 };
37
- function Ye(t, e, r, n, i, o) {
38
- return se(), ae("div", null, [
39
- i.isFeatureFlagEnabled ? (se(), ae("div", Je, [
40
- de(t.$slots, "default")
41
- ])) : (se(), ae("div", $e, [
42
- de(t.$slots, "else")
43
- ]))
44
- ]);
45
- }
46
- const Ut = /* @__PURE__ */ Be(Ge, [["render", Ye]]);
47
- var ue = function(t, e) {
48
- return ue = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(r, n) {
1
+ import { openBlock as Q, createElementBlock as ee, renderSlot as ge } from "vue";
2
+ var pe = function(t, e) {
3
+ return pe = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(r, n) {
49
4
  r.__proto__ = n;
50
5
  } || function(r, n) {
51
6
  for (var i in n)
52
7
  Object.prototype.hasOwnProperty.call(n, i) && (r[i] = n[i]);
53
- }, ue(t, e);
8
+ }, pe(t, e);
54
9
  };
55
- function z(t, e) {
10
+ function B(t, e) {
56
11
  if (typeof e != "function" && e !== null)
57
12
  throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
58
- ue(t, e);
13
+ pe(t, e);
59
14
  function r() {
60
15
  this.constructor = t;
61
16
  }
62
17
  t.prototype = e === null ? Object.create(e) : (r.prototype = e.prototype, new r());
63
18
  }
64
- var q = function() {
65
- return q = Object.assign || function(e) {
19
+ var k = function() {
20
+ return k = Object.assign || function(e) {
66
21
  for (var r, n = 1, i = arguments.length; n < i; n++) {
67
22
  r = arguments[n];
68
23
  for (var o in r)
69
24
  Object.prototype.hasOwnProperty.call(r, o) && (e[o] = r[o]);
70
25
  }
71
26
  return e;
72
- }, q.apply(this, arguments);
27
+ }, k.apply(this, arguments);
73
28
  };
74
29
  function S(t, e, r, n) {
75
30
  function i(o) {
@@ -80,22 +35,22 @@ function S(t, e, r, n) {
80
35
  return new (r || (r = Promise))(function(o, s) {
81
36
  function a(l) {
82
37
  try {
83
- c(n.next(l));
84
- } catch (g) {
85
- s(g);
38
+ u(n.next(l));
39
+ } catch (h) {
40
+ s(h);
86
41
  }
87
42
  }
88
- function u(l) {
43
+ function c(l) {
89
44
  try {
90
- c(n.throw(l));
91
- } catch (g) {
92
- s(g);
45
+ u(n.throw(l));
46
+ } catch (h) {
47
+ s(h);
93
48
  }
94
49
  }
95
- function c(l) {
96
- l.done ? o(l.value) : i(l.value).then(a, u);
50
+ function u(l) {
51
+ l.done ? o(l.value) : i(l.value).then(a, c);
97
52
  }
98
- c((n = n.apply(t, e || [])).next());
53
+ u((n = n.apply(t, e || [])).next());
99
54
  });
100
55
  }
101
56
  function O(t, e) {
@@ -107,76 +62,78 @@ function O(t, e) {
107
62
  return s = { next: a(0), throw: a(1), return: a(2) }, typeof Symbol == "function" && (s[Symbol.iterator] = function() {
108
63
  return this;
109
64
  }), s;
110
- function a(c) {
65
+ function a(u) {
111
66
  return function(l) {
112
- return u([c, l]);
67
+ return c([u, l]);
113
68
  };
114
69
  }
115
- function u(c) {
70
+ function c(u) {
116
71
  if (n)
117
72
  throw new TypeError("Generator is already executing.");
118
- for (; s && (s = 0, c[0] && (r = 0)), r; )
73
+ for (; s && (s = 0, u[0] && (r = 0)), r; )
119
74
  try {
120
- if (n = 1, i && (o = c[0] & 2 ? i.return : c[0] ? i.throw || ((o = i.return) && o.call(i), 0) : i.next) && !(o = o.call(i, c[1])).done)
75
+ if (n = 1, i && (o = u[0] & 2 ? i.return : u[0] ? i.throw || ((o = i.return) && o.call(i), 0) : i.next) && !(o = o.call(i, u[1])).done)
121
76
  return o;
122
- switch (i = 0, o && (c = [c[0] & 2, o.value]), c[0]) {
77
+ switch (i = 0, o && (u = [u[0] & 2, o.value]), u[0]) {
123
78
  case 0:
124
79
  case 1:
125
- o = c;
80
+ o = u;
126
81
  break;
127
82
  case 4:
128
- return r.label++, { value: c[1], done: !1 };
83
+ return r.label++, { value: u[1], done: !1 };
129
84
  case 5:
130
- r.label++, i = c[1], c = [0];
85
+ r.label++, i = u[1], u = [0];
131
86
  continue;
132
87
  case 7:
133
- c = r.ops.pop(), r.trys.pop();
88
+ u = r.ops.pop(), r.trys.pop();
134
89
  continue;
135
90
  default:
136
- if (o = r.trys, !(o = o.length > 0 && o[o.length - 1]) && (c[0] === 6 || c[0] === 2)) {
91
+ if (o = r.trys, !(o = o.length > 0 && o[o.length - 1]) && (u[0] === 6 || u[0] === 2)) {
137
92
  r = 0;
138
93
  continue;
139
94
  }
140
- if (c[0] === 3 && (!o || c[1] > o[0] && c[1] < o[3])) {
141
- r.label = c[1];
95
+ if (u[0] === 3 && (!o || u[1] > o[0] && u[1] < o[3])) {
96
+ r.label = u[1];
142
97
  break;
143
98
  }
144
- if (c[0] === 6 && r.label < o[1]) {
145
- r.label = o[1], o = c;
99
+ if (u[0] === 6 && r.label < o[1]) {
100
+ r.label = o[1], o = u;
146
101
  break;
147
102
  }
148
103
  if (o && r.label < o[2]) {
149
- r.label = o[2], r.ops.push(c);
104
+ r.label = o[2], r.ops.push(u);
150
105
  break;
151
106
  }
152
107
  o[2] && r.ops.pop(), r.trys.pop();
153
108
  continue;
154
109
  }
155
- c = e.call(t, r);
110
+ u = e.call(t, r);
156
111
  } catch (l) {
157
- c = [6, l], i = 0;
112
+ u = [6, l], i = 0;
158
113
  } finally {
159
114
  n = o = 0;
160
115
  }
161
- if (c[0] & 5)
162
- throw c[1];
163
- return { value: c[0] ? c[1] : void 0, done: !0 };
116
+ if (u[0] & 5)
117
+ throw u[1];
118
+ return { value: u[0] ? u[1] : void 0, done: !0 };
164
119
  }
165
120
  }
166
- function Xe(t, e, r) {
167
- if (r || arguments.length === 2)
168
- for (var n = 0, i = e.length, o; n < i; n++)
169
- (o || !(n in e)) && (o || (o = Array.prototype.slice.call(e, 0, n)), o[n] = e[n]);
170
- return t.concat(o || Array.prototype.slice.call(e));
121
+ function $e() {
122
+ for (var t = 0, e = 0, r = arguments.length; e < r; e++)
123
+ t += arguments[e].length;
124
+ for (var n = Array(t), i = 0, e = 0; e < r; e++)
125
+ for (var o = arguments[e], s = 0, a = o.length; s < a; s++, i++)
126
+ n[i] = o[s];
127
+ return n;
171
128
  }
172
- function A(t, e) {
129
+ function C(t, e) {
173
130
  return Object.defineProperty ? Object.defineProperty(t, "raw", { value: e }) : t.raw = e, t;
174
131
  }
175
132
  var K;
176
133
  (function(t) {
177
134
  t[t.Fetched = 0] = "Fetched", t[t.NotModified = 1] = "NotModified", t[t.Errored = 2] = "Errored";
178
135
  })(K || (K = {}));
179
- var x = function() {
136
+ var q = function() {
180
137
  function t(e, r, n, i) {
181
138
  this.status = e, this.config = r, this.errorMessage = n, this.errorException = i;
182
139
  }
@@ -187,35 +144,35 @@ var x = function() {
187
144
  }, t.error = function(e, r, n) {
188
145
  return new t(K.Errored, e, r ?? "Unknown error.", n);
189
146
  }, t;
190
- }(), ee = function(t) {
191
- z(e, t);
147
+ }(), ie = function(t) {
148
+ B(e, t);
192
149
  function e(r) {
193
150
  for (var n = [], i = 1; i < arguments.length; i++)
194
151
  n[i - 1] = arguments[i];
195
- var o = this, s;
196
- switch (r) {
197
- case "abort":
198
- s = "Request was aborted.";
199
- break;
200
- case "timeout":
201
- var a = n[0];
202
- s = "Request timed out. Timeout value: ".concat(a, "ms");
203
- break;
204
- case "failure":
205
- var u = n[0];
206
- s = "Request failed due to a network or protocol error.", u && (s += " " + (u instanceof Error ? u.message : u + ""));
207
- break;
208
- }
209
- return o = t.call(this, s) || this, o.cause = r, o instanceof e || (Object.setPrototypeOf || function(c, l) {
210
- return c.__proto__ = l;
152
+ var o = t.call(this, function(s, a) {
153
+ switch (s) {
154
+ case "abort":
155
+ return "Request was aborted.";
156
+ case "timeout":
157
+ var c = a[0];
158
+ return "Request timed out. Timeout value: " + c + "ms";
159
+ case "failure":
160
+ var u = a[0], l = "Request failed due to a network or protocol error.";
161
+ return u ? l + " " + (u instanceof Error ? u.message : u + "") : l;
162
+ }
163
+ }(r, n)) || this;
164
+ return o.cause = r, o instanceof e || (Object.setPrototypeOf || function(s, a) {
165
+ return s.__proto__ = a;
211
166
  })(o, e.prototype), o.args = n, o;
212
167
  }
213
168
  return e;
214
- }(Error), P = function() {
169
+ }(Error), M = function() {
215
170
  function t(e, r, n, i) {
216
171
  this.configJson = e, this.config = r, this.timestamp = n, this.httpETag = i;
217
172
  }
218
- return t.prototype.with = function(e) {
173
+ return t.equals = function(e, r) {
174
+ return e.httpETag && r.httpETag ? e.httpETag === r.httpETag : e.configJson === r.configJson;
175
+ }, t.prototype.with = function(e) {
219
176
  return new t(this.configJson, this.config, e, this.httpETag);
220
177
  }, Object.defineProperty(t.prototype, "isEmpty", {
221
178
  get: function() {
@@ -243,47 +200,47 @@ var x = function() {
243
200
  if (isNaN(a))
244
201
  throw new Error("Invalid fetch time: " + s);
245
202
  n = o + 1, o = r[1], s = e.substring(n, o);
246
- var u = s.length > 0 ? s : void 0;
203
+ var c = s.length > 0 ? s : void 0;
247
204
  n = o + 1, s = e.substring(n);
248
- var c, l;
205
+ var u, l;
249
206
  if (s.length > 0) {
250
207
  try {
251
- c = new le(JSON.parse(s));
208
+ u = new de(JSON.parse(s));
252
209
  } catch {
253
210
  throw new Error("Invalid config JSON content: " + s);
254
211
  }
255
212
  l = s;
256
213
  }
257
- return new t(l, c, a, u);
214
+ return new t(l, u, a, c);
258
215
  }, t.serializationFormatVersion = "v2", t.empty = new t(void 0, void 0, 0, void 0), t;
259
- }(), le = function() {
216
+ }(), de = function() {
260
217
  function t(e) {
261
218
  this.settings = e.f ? Object.fromEntries(Object.entries(e.f).map(function(r) {
262
219
  var n = r[0], i = r[1];
263
- return [n, new Qe(i)];
264
- })) : {}, this.preferences = e.p ? new Ze(e.p) : void 0;
220
+ return [n, new ze(i)];
221
+ })) : {}, this.preferences = e.p ? new Ye(e.p) : void 0;
265
222
  }
266
223
  return t;
267
- }(), J;
224
+ }(), X;
268
225
  (function(t) {
269
226
  t[t.No = 0] = "No", t[t.Should = 1] = "Should", t[t.Force = 2] = "Force";
270
- })(J || (J = {}));
271
- var Ze = function() {
227
+ })(X || (X = {}));
228
+ var Ye = function() {
272
229
  function t(e) {
273
230
  this.baseUrl = e.u, this.redirectMode = e.r;
274
231
  }
275
232
  return t;
276
- }(), ye;
233
+ }(), Se;
277
234
  (function(t) {
278
235
  t[t.Boolean = 0] = "Boolean", t[t.String = 1] = "String", t[t.Int = 2] = "Int", t[t.Double = 3] = "Double";
279
- })(ye || (ye = {}));
280
- var Qe = function() {
236
+ })(Se || (Se = {}));
237
+ var ze = function() {
281
238
  function t(e) {
282
239
  var r, n, i, o;
283
240
  this.value = e.v, this.type = e.t, this.percentageOptions = (n = (r = e.p) === null || r === void 0 ? void 0 : r.map(function(s) {
284
- return new tt(s);
241
+ return new Ze(s);
285
242
  })) !== null && n !== void 0 ? n : [], this.targetingRules = (o = (i = e.r) === null || i === void 0 ? void 0 : i.map(function(s) {
286
- return new et(s);
243
+ return new Xe(s);
287
244
  })) !== null && o !== void 0 ? o : [], this.variationId = e.i;
288
245
  }
289
246
  return t.fromValue = function(e) {
@@ -292,21 +249,21 @@ var Qe = function() {
292
249
  v: e
293
250
  });
294
251
  }, t;
295
- }(), h;
252
+ }(), g;
296
253
  (function(t) {
297
254
  t[t.In = 0] = "In", t[t.NotIn = 1] = "NotIn", t[t.Contains = 2] = "Contains", t[t.NotContains = 3] = "NotContains", t[t.SemVerIn = 4] = "SemVerIn", t[t.SemVerNotIn = 5] = "SemVerNotIn", t[t.SemVerLessThan = 6] = "SemVerLessThan", t[t.SemVerLessThanEqual = 7] = "SemVerLessThanEqual", t[t.SemVerGreaterThan = 8] = "SemVerGreaterThan", t[t.SemVerGreaterThanEqual = 9] = "SemVerGreaterThanEqual", t[t.NumberEqual = 10] = "NumberEqual", t[t.NumberNotEqual = 11] = "NumberNotEqual", t[t.NumberLessThan = 12] = "NumberLessThan", t[t.NumberLessThanEqual = 13] = "NumberLessThanEqual", t[t.NumberGreaterThan = 14] = "NumberGreaterThan", t[t.NumberGreaterThanEqual = 15] = "NumberGreaterThanEqual", t[t.SensitiveOneOf = 16] = "SensitiveOneOf", t[t.SensitiveNotOneOf = 17] = "SensitiveNotOneOf";
298
- })(h || (h = {}));
299
- var et = function() {
255
+ })(g || (g = {}));
256
+ var Xe = function() {
300
257
  function t(e) {
301
258
  this.order = e.o, this.comparisonAttribute = e.a, this.comparator = e.t, this.comparisonValue = e.c, this.value = e.v, this.variationId = e.i;
302
259
  }
303
260
  return t;
304
- }(), tt = function() {
261
+ }(), Ze = function() {
305
262
  function t(e) {
306
263
  this.order = e.o, this.percentage = e.p, this.value = e.v, this.variationId = e.i;
307
264
  }
308
265
  return t;
309
- }(), ne = function() {
266
+ }(), ae = function() {
310
267
  function t(e, r) {
311
268
  this.errorMessage = e, this.errorException = r;
312
269
  }
@@ -323,19 +280,19 @@ var et = function() {
323
280
  }, t.failure = function(e, r) {
324
281
  return new t(e, r);
325
282
  }, t;
326
- }(), I;
283
+ }(), T;
327
284
  (function(t) {
328
285
  t[t.Online = 0] = "Online", t[t.Offline = 1] = "Offline", t[t.Disposed = 2] = "Disposed";
329
- })(I || (I = {}));
330
- var ge = function() {
286
+ })(T || (T = {}));
287
+ var me = function() {
331
288
  function t(e, r) {
332
- this.configFetcher = e, this.options = r, this.pendingFetch = null, this.cacheKey = r.getCacheKey(), this.configFetcher = e, this.options = r, this.status = r.offline ? I.Offline : I.Online;
289
+ this.configFetcher = e, this.options = r, this.pendingFetch = null, this.cacheKey = r.getCacheKey(), this.configFetcher = e, this.options = r, this.status = r.offline ? T.Offline : T.Online;
333
290
  }
334
291
  return t.prototype.dispose = function() {
335
- this.status = I.Disposed;
292
+ this.status = T.Disposed;
336
293
  }, Object.defineProperty(t.prototype, "disposed", {
337
294
  get: function() {
338
- return this.status === I.Disposed;
295
+ return this.status === T.Disposed;
339
296
  },
340
297
  enumerable: !1,
341
298
  configurable: !0
@@ -349,9 +306,9 @@ var ge = function() {
349
306
  case 1:
350
307
  return e = s.sent(), this.isOffline ? [3, 3] : [4, this.refreshConfigCoreAsync(e)];
351
308
  case 2:
352
- return r = s.sent(), n = r[0], i = r[1], [2, [ne.from(n), i]];
309
+ return r = s.sent(), n = r[0], i = r[1], [2, [ae.from(n), i]];
353
310
  case 3:
354
- return o = this.options.logger.configServiceCannotInitiateHttpCalls().toString(), [2, [ne.failure(o), e]];
311
+ return o = this.options.logger.configServiceCannotInitiateHttpCalls().toString(), [2, [ae.failure(o), e]];
355
312
  }
356
313
  });
357
314
  });
@@ -365,7 +322,7 @@ var ge = function() {
365
322
  case 1:
366
323
  return r = i.sent(), n = r.status === K.Fetched, n || r.config.timestamp > e.timestamp && (!r.config.isEmpty || e.isEmpty) ? [4, this.options.cache.set(this.cacheKey, r.config)] : [3, 3];
367
324
  case 2:
368
- i.sent(), this.onConfigUpdated(r.config), n && (r.config.httpETag != e.httpETag || r.config.configJson != e.configJson) && this.onConfigChanged(r.config), e = r.config, i.label = 3;
325
+ i.sent(), this.onConfigUpdated(r.config), n && !M.equals(r.config, e) && this.onConfigChanged(r.config), e = r.config, i.label = 3;
369
326
  case 3:
370
327
  return [2, [r, e]];
371
328
  }
@@ -374,7 +331,7 @@ var ge = function() {
374
331
  }, t.prototype.onConfigUpdated = function(e) {
375
332
  }, t.prototype.onConfigChanged = function(e) {
376
333
  var r;
377
- this.options.logger.debug("config changed"), this.options.hooks.emit("configChanged", (r = e.config) !== null && r !== void 0 ? r : new le({}));
334
+ this.options.logger.debug("config changed"), this.options.hooks.emit("configChanged", (r = e.config) !== null && r !== void 0 ? r : new de({}));
378
335
  }, t.prototype.fetchAsync = function(e) {
379
336
  var r = this, n;
380
337
  return (n = this.pendingFetch) !== null && n !== void 0 ? n : this.pendingFetch = function() {
@@ -396,28 +353,28 @@ var ge = function() {
396
353
  }, t.prototype.fetchLogicAsync = function(e) {
397
354
  var r;
398
355
  return S(this, void 0, void 0, function() {
399
- var n, i, o, s, a, u;
400
- return O(this, function(c) {
401
- switch (c.label) {
356
+ var n, i, o, s, a, c;
357
+ return O(this, function(u) {
358
+ switch (u.label) {
402
359
  case 0:
403
- n = this.options, n.logger.debug("ConfigServiceBase.fetchLogicAsync() - called."), c.label = 1;
360
+ n = this.options, n.logger.debug("ConfigServiceBase.fetchLogicAsync() - called."), u.label = 1;
404
361
  case 1:
405
- return c.trys.push([1, 3, , 4]), [4, this.fetchRequestAsync((r = e.httpETag) !== null && r !== void 0 ? r : null)];
362
+ return u.trys.push([1, 3, , 4]), [4, this.fetchRequestAsync((r = e.httpETag) !== null && r !== void 0 ? r : null)];
406
363
  case 2:
407
- switch (o = c.sent(), s = o[0], a = o[1], s.statusCode) {
364
+ switch (o = u.sent(), s = o[0], a = o[1], s.statusCode) {
408
365
  case 200:
409
- return a ? (n.logger.debug("ConfigServiceBase.fetchLogicAsync(): fetch was successful. Returning new config."), [2, x.success(new P(s.body, a, P.generateTimestamp(), s.eTag))]) : (i = n.logger.fetchReceived200WithInvalidBody().toString(), n.logger.debug("ConfigServiceBase.fetchLogicAsync(): ".concat(s.statusCode, " ").concat(s.reasonPhrase, " was received but the HTTP response content was invalid. Returning null.")), [2, x.error(e, i)]);
366
+ return a ? (n.logger.debug("ConfigServiceBase.fetchLogicAsync(): fetch was successful. Returning new config."), [2, q.success(new M(s.body, a, M.generateTimestamp(), s.eTag))]) : (i = n.logger.fetchReceived200WithInvalidBody().toString(), n.logger.debug("ConfigServiceBase.fetchLogicAsync(): " + s.statusCode + " " + s.reasonPhrase + " was received but the HTTP response content was invalid. Returning null."), [2, q.error(e, i)]);
410
367
  case 304:
411
- return e ? (n.logger.debug("ConfigServiceBase.fetchLogicAsync(): content was not modified. Returning last config with updated timestamp."), [2, x.notModified(e.with(P.generateTimestamp()))]) : (i = n.logger.fetchReceived304WhenLocalCacheIsEmpty(s.statusCode, s.reasonPhrase).toString(), n.logger.debug("ConfigServiceBase.fetchLogicAsync(): ".concat(s.statusCode, " ").concat(s.reasonPhrase, " was received when no config is cached locally. Returning null.")), [2, x.error(e, i)]);
368
+ return e ? (n.logger.debug("ConfigServiceBase.fetchLogicAsync(): content was not modified. Returning last config with updated timestamp."), [2, q.notModified(e.with(M.generateTimestamp()))]) : (i = n.logger.fetchReceived304WhenLocalCacheIsEmpty(s.statusCode, s.reasonPhrase).toString(), n.logger.debug("ConfigServiceBase.fetchLogicAsync(): " + s.statusCode + " " + s.reasonPhrase + " was received when no config is cached locally. Returning null."), [2, q.error(e, i)]);
412
369
  case 403:
413
370
  case 404:
414
- return i = n.logger.fetchFailedDueToInvalidSdkKey().toString(), n.logger.debug("ConfigServiceBase.fetchLogicAsync(): fetch was unsuccessful. Returning last config (if any) with updated timestamp."), [2, x.error(e.with(P.generateTimestamp()), i)];
371
+ return i = n.logger.fetchFailedDueToInvalidSdkKey().toString(), n.logger.debug("ConfigServiceBase.fetchLogicAsync(): fetch was unsuccessful. Returning last config (if any) with updated timestamp."), [2, q.error(e.with(M.generateTimestamp()), i)];
415
372
  default:
416
- return i = n.logger.fetchFailedDueToUnexpectedHttpResponse(s.statusCode, s.reasonPhrase).toString(), n.logger.debug("ConfigServiceBase.fetchLogicAsync(): fetch was unsuccessful. Returning null."), [2, x.error(e, i)];
373
+ return i = n.logger.fetchFailedDueToUnexpectedHttpResponse(s.statusCode, s.reasonPhrase).toString(), n.logger.debug("ConfigServiceBase.fetchLogicAsync(): fetch was unsuccessful. Returning null."), [2, q.error(e, i)];
417
374
  }
418
375
  return [3, 4];
419
376
  case 3:
420
- return u = c.sent(), i = (u instanceof ee && u.cause === "timeout" ? n.logger.fetchFailedDueToRequestTimeout(u.args[0], u) : n.logger.fetchFailedDueToUnexpectedError(u)).toString(), n.logger.debug("ConfigServiceBase.fetchLogicAsync(): fetch was unsuccessful. Returning null."), [2, x.error(e, i, u)];
377
+ return c = u.sent(), i = (c instanceof ie && c.cause === "timeout" ? n.logger.fetchFailedDueToRequestTimeout(c.args[0], c) : n.logger.fetchFailedDueToUnexpectedError(c)).toString(), n.logger.debug("ConfigServiceBase.fetchLogicAsync(): fetch was unsuccessful. Returning null."), [2, q.error(e, i, c)];
421
378
  case 4:
422
379
  return [2];
423
380
  }
@@ -425,13 +382,13 @@ var ge = function() {
425
382
  });
426
383
  }, t.prototype.fetchRequestAsync = function(e, r) {
427
384
  return r === void 0 && (r = 2), S(this, void 0, void 0, function() {
428
- var n, i, o, s, a, u, c;
385
+ var n, i, o, s, a, c, u;
429
386
  return O(this, function(l) {
430
387
  switch (l.label) {
431
388
  case 0:
432
389
  n = this.options, n.logger.debug("ConfigServiceBase.fetchRequestAsync() - called."), i = 0, l.label = 1;
433
390
  case 1:
434
- return n.logger.debug("ConfigServiceBase.fetchRequestAsync(): calling fetchLogic()".concat(i > 0 ? ", retry ".concat(i, "/").concat(r) : "")), [4, this.configFetcher.fetchLogic(n, e)];
391
+ return n.logger.debug("ConfigServiceBase.fetchRequestAsync(): calling fetchLogic()" + (i > 0 ? ", retry " + i + "/" + r : "")), [4, this.configFetcher.fetchLogic(n, e)];
435
392
  case 2:
436
393
  if (o = l.sent(), o.statusCode !== 200)
437
394
  return [2, [o]];
@@ -439,19 +396,19 @@ var ge = function() {
439
396
  return n.logger.debug("ConfigServiceBase.fetchRequestAsync(): no response body."), [2, [o]];
440
397
  s = void 0;
441
398
  try {
442
- s = new le(JSON.parse(o.body));
399
+ s = new de(JSON.parse(o.body));
443
400
  } catch {
444
401
  return n.logger.debug("ConfigServiceBase.fetchRequestAsync(): invalid response body."), [2, [o]];
445
402
  }
446
403
  if (a = s.preferences, !a)
447
404
  return n.logger.debug("ConfigServiceBase.fetchRequestAsync(): preferences is empty."), [2, [o, s]];
448
- if (u = a.baseUrl, !u || u === n.baseUrl)
405
+ if (c = a.baseUrl, !c || c === n.baseUrl)
449
406
  return n.logger.debug("ConfigServiceBase.fetchRequestAsync(): baseUrl OK."), [2, [o, s]];
450
- if (c = a.redirectMode, n.baseUrlOverriden && c !== J.Force)
407
+ if (u = a.redirectMode, n.baseUrlOverriden && u !== X.Force)
451
408
  return n.logger.debug("ConfigServiceBase.fetchRequestAsync(): options.baseUrlOverriden && redirect !== 2."), [2, [o, s]];
452
- if (n.baseUrl = u, c === J.No)
409
+ if (n.baseUrl = c, u === X.No)
453
410
  return [2, [o, s]];
454
- if (c === J.Should && n.logger.dataGovernanceIsOutOfSync(), i >= r)
411
+ if (u === X.Should && n.logger.dataGovernanceIsOutOfSync(), i >= r)
455
412
  return n.logger.fetchFailedDueToRedirectLoop(), [2, [o, s]];
456
413
  l.label = 3;
457
414
  case 3:
@@ -463,25 +420,88 @@ var ge = function() {
463
420
  });
464
421
  }, Object.defineProperty(t.prototype, "isOfflineExactly", {
465
422
  get: function() {
466
- return this.status === I.Offline;
423
+ return this.status === T.Offline;
467
424
  },
468
425
  enumerable: !1,
469
426
  configurable: !0
470
427
  }), Object.defineProperty(t.prototype, "isOffline", {
471
428
  get: function() {
472
- return this.status !== I.Online;
429
+ return this.status !== T.Online;
473
430
  },
474
431
  enumerable: !1,
475
432
  configurable: !0
476
433
  }), t.prototype.setOnlineCore = function() {
477
434
  }, t.prototype.setOnline = function() {
478
- this.status === I.Offline ? (this.setOnlineCore(), this.status = I.Online, this.options.logger.configServiceStatusChanged(I[this.status])) : this.disposed && this.options.logger.configServiceMethodHasNoEffectDueToDisposedClient("setOnline");
435
+ this.status === T.Offline ? (this.setOnlineCore(), this.status = T.Online, this.options.logger.configServiceStatusChanged(T[this.status])) : this.disposed && this.options.logger.configServiceMethodHasNoEffectDueToDisposedClient("setOnline");
479
436
  }, t.prototype.setOfflineCore = function() {
480
437
  }, t.prototype.setOffline = function() {
481
- this.status === I.Online ? (this.setOfflineCore(), this.status = I.Offline, this.options.logger.configServiceStatusChanged(I[this.status])) : this.disposed && this.options.logger.configServiceMethodHasNoEffectDueToDisposedClient("setOffline");
438
+ this.status === T.Online ? (this.setOfflineCore(), this.status = T.Offline, this.options.logger.configServiceStatusChanged(T[this.status])) : this.disposed && this.options.logger.configServiceMethodHasNoEffectDueToDisposedClient("setOffline");
439
+ }, t.prototype.syncUpWithCache = function() {
440
+ return S(this, void 0, void 0, function() {
441
+ var e;
442
+ return O(this, function(r) {
443
+ switch (r.label) {
444
+ case 0:
445
+ return [4, this.options.cache.get(this.cacheKey)];
446
+ case 1:
447
+ return e = r.sent(), this.options.hooks.emit("clientReady", this.getReadyState(e)), [2];
448
+ }
449
+ });
450
+ });
451
+ }, t;
452
+ }(), Qe = function() {
453
+ function t() {
454
+ this.addListener = this.on, this.off = this.removeListener;
455
+ }
456
+ return t.prototype.on = function() {
457
+ return this;
458
+ }, t.prototype.once = function() {
459
+ return this;
460
+ }, t.prototype.removeListener = function() {
461
+ return this;
462
+ }, t.prototype.removeAllListeners = function() {
463
+ return this;
464
+ }, t.prototype.listeners = function() {
465
+ return [];
466
+ }, t.prototype.listenerCount = function() {
467
+ return 0;
468
+ }, t.prototype.eventNames = function() {
469
+ return [];
470
+ }, t.prototype.emit = function() {
471
+ return !1;
472
+ }, t;
473
+ }(), L;
474
+ (function(t) {
475
+ t[t.NoFlagData = 0] = "NoFlagData", t[t.HasLocalOverrideFlagDataOnly = 1] = "HasLocalOverrideFlagDataOnly", t[t.HasCachedFlagDataOnly = 2] = "HasCachedFlagDataOnly", t[t.HasUpToDateFlagData = 3] = "HasUpToDateFlagData";
476
+ })(L || (L = {}));
477
+ var Oe = new Qe(), et = function() {
478
+ function t(e) {
479
+ this.addListener = this.on, this.off = this.removeListener, this.eventEmitter = e;
480
+ }
481
+ return t.prototype.tryDisconnect = function() {
482
+ var e = this.eventEmitter;
483
+ return this.eventEmitter = Oe, e !== Oe;
484
+ }, t.prototype.on = function(e, r) {
485
+ return this.eventEmitter.on(e, r), this;
486
+ }, t.prototype.once = function(e, r) {
487
+ return this.eventEmitter.once(e, r), this;
488
+ }, t.prototype.removeListener = function(e, r) {
489
+ return this.eventEmitter.removeListener(e, r), this;
490
+ }, t.prototype.removeAllListeners = function(e) {
491
+ return this.eventEmitter.removeAllListeners(e), this;
492
+ }, t.prototype.listeners = function(e) {
493
+ return this.eventEmitter.listeners(e);
494
+ }, t.prototype.listenerCount = function(e) {
495
+ return this.eventEmitter.listenerCount(e);
496
+ }, t.prototype.eventNames = function() {
497
+ return this.eventEmitter.eventNames();
498
+ }, t.prototype.emit = function(e) {
499
+ for (var r, n = [], i = 1; i < arguments.length; i++)
500
+ n[i - 1] = arguments[i];
501
+ return (r = this.eventEmitter).emit.apply(r, $e([e], n));
482
502
  }, t;
483
503
  }();
484
- function rt(t, e) {
504
+ function tt(t, e) {
485
505
  var r, n = new Promise(function(i) {
486
506
  return r = setTimeout(i, t);
487
507
  });
@@ -489,11 +509,11 @@ function rt(t, e) {
489
509
  return clearTimeout(r);
490
510
  }), n;
491
511
  }
492
- function $(t, e) {
512
+ function z(t, e) {
493
513
  return e === void 0 && (e = !1), t instanceof Error ? e && t.stack ? t.stack : t.toString() : t + "";
494
514
  }
495
- var nt = function(t) {
496
- z(e, t);
515
+ var rt = function(t) {
516
+ B(e, t);
497
517
  function e(r, n) {
498
518
  var i = t.call(this, r, n) || this;
499
519
  return i.signalInitialization = function() {
@@ -502,10 +522,10 @@ var nt = function(t) {
502
522
  i.initialized = !0, o();
503
523
  };
504
524
  }), i.initialization.then(function() {
505
- return !i.disposed && n.hooks.emit("clientReady");
525
+ return n.hooks.emit("clientReady", i.getReadyState(n.cache.getInMemory()));
506
526
  }), n.maxInitWaitTimeSeconds > 0 && setTimeout(function() {
507
527
  return i.signalInitialization();
508
- }, n.maxInitWaitTimeSeconds * 1e3)) : (i.initialized = !0, i.initialization = Promise.resolve(), n.hooks.emit("clientReady")), n.offline || i.startRefreshWorker(), i;
528
+ }, n.maxInitWaitTimeSeconds * 1e3)) : (i.initialized = !0, i.initialization = Promise.resolve(), n.hooks.emit("clientReady", i.getReadyState(n.cache.getInMemory()))), n.offline || i.startRefreshWorker(), i;
509
529
  }
510
530
  return e.prototype.waitForInitializationAsync = function() {
511
531
  return S(this, void 0, void 0, function() {
@@ -530,7 +550,7 @@ var nt = function(t) {
530
550
  });
531
551
  });
532
552
  }(),
533
- rt(this.options.maxInitWaitTimeSeconds * 1e3, function(s) {
553
+ tt(this.options.maxInitWaitTimeSeconds * 1e3, function(s) {
534
554
  return r = s;
535
555
  })
536
556
  ])];
@@ -612,19 +632,23 @@ var nt = function(t) {
612
632
  }
613
633
  });
614
634
  });
635
+ }, e.prototype.getReadyState = function(r) {
636
+ return r.isEmpty ? L.NoFlagData : r.isExpired(this.pollIntervalMs) ? L.HasCachedFlagDataOnly : L.HasUpToDateFlagData;
615
637
  }, e;
616
- }(ge), it = function() {
638
+ }(me), nt = function() {
617
639
  function t() {
618
- this.cachedConfig = P.empty;
640
+ this.cachedConfig = M.empty;
619
641
  }
620
642
  return t.prototype.set = function(e, r) {
621
643
  this.cachedConfig = r;
622
644
  }, t.prototype.get = function(e) {
623
645
  return this.cachedConfig;
646
+ }, t.prototype.getInMemory = function() {
647
+ return this.cachedConfig;
624
648
  }, t;
625
- }(), qe = function() {
649
+ }(), _e = function() {
626
650
  function t(e, r) {
627
- this.cache = e, this.logger = r, this.cachedConfig = P.empty;
651
+ this.cache = e, this.logger = r, this.cachedConfig = M.empty;
628
652
  }
629
653
  return t.prototype.set = function(e, r) {
630
654
  return S(this, void 0, void 0, function() {
@@ -633,7 +657,7 @@ var nt = function(t) {
633
657
  switch (i.label) {
634
658
  case 0:
635
659
  if (i.trys.push([0, 2, , 3]), !r.isEmpty)
636
- this.cachedSerializedConfig = P.serialize(r), this.cachedConfig = r;
660
+ this.cachedSerializedConfig = M.serialize(r), this.cachedConfig = r;
637
661
  else
638
662
  return this.cachedSerializedConfig = void 0, this.cachedConfig = r, [2];
639
663
  return [4, this.cache.set(e, this.cachedSerializedConfig)];
@@ -654,7 +678,7 @@ var nt = function(t) {
654
678
  case 0:
655
679
  return i.trys.push([0, 2, , 3]), [4, this.cache.get(e)];
656
680
  case 1:
657
- return r = i.sent(), r == null || r === this.cachedSerializedConfig ? [2, this.cachedConfig] : (this.cachedConfig = P.deserialize(r), this.cachedSerializedConfig = r, [3, 3]);
681
+ return r = i.sent(), r == null || r === this.cachedSerializedConfig ? [2, this.cachedConfig] : (this.cachedConfig = M.deserialize(r), this.cachedSerializedConfig = r, [3, 3]);
658
682
  case 2:
659
683
  return n = i.sent(), this.logger.configServiceCacheReadError(n), [3, 3];
660
684
  case 3:
@@ -662,12 +686,14 @@ var nt = function(t) {
662
686
  }
663
687
  });
664
688
  });
689
+ }, t.prototype.getInMemory = function() {
690
+ return this.cachedConfig;
665
691
  }, t;
666
- }(), d;
692
+ }(), v;
667
693
  (function(t) {
668
694
  t[t.Debug = 4] = "Debug", t[t.Info = 3] = "Info", t[t.Warn = 2] = "Warn", t[t.Error = 1] = "Error", t[t.Off = -1] = "Off";
669
- })(d || (d = {}));
670
- var C = function() {
695
+ })(v || (v = {}));
696
+ var A = function() {
671
697
  function t(e, r, n) {
672
698
  this.strings = e, this.argNames = r, this.argValues = n;
673
699
  }
@@ -695,14 +721,14 @@ var C = function() {
695
721
  }), t.prototype.toString = function() {
696
722
  return this.defaultFormattedMessage;
697
723
  }, t;
698
- }(), ot = function() {
724
+ }(), it = function() {
699
725
  function t(e, r) {
700
726
  this.logger = e, this.hooks = r;
701
727
  }
702
728
  return Object.defineProperty(t.prototype, "level", {
703
729
  get: function() {
704
730
  var e;
705
- return (e = this.logger.level) !== null && e !== void 0 ? e : d.Warn;
731
+ return (e = this.logger.level) !== null && e !== void 0 ? e : v.Warn;
706
732
  },
707
733
  enumerable: !1,
708
734
  configurable: !0
@@ -710,72 +736,72 @@ var C = function() {
710
736
  return this.level >= e;
711
737
  }, t.prototype.log = function(e, r, n, i) {
712
738
  var o;
713
- return this.isLogLevelEnabled(e) && this.logger.log(e, r, n, i), e === d.Error && ((o = this.hooks) === null || o === void 0 || o.emit("clientError", n.toString(), i)), n;
739
+ return this.isLogLevelEnabled(e) && this.logger.log(e, r, n, i), e === v.Error && ((o = this.hooks) === null || o === void 0 || o.emit("clientError", n.toString(), i)), n;
714
740
  }, t.prototype.debug = function(e) {
715
- this.log(d.Debug, 0, e);
741
+ this.log(v.Debug, 0, e);
716
742
  }, t.prototype.configJsonIsNotPresent = function(e) {
717
- return this.log(d.Error, 1e3, C.from("DEFAULT_RETURN_VALUE")(me || (me = A(["Config JSON is not present. Returning ", "."], ["Config JSON is not present. Returning ", "."])), e));
743
+ return this.log(v.Error, 1e3, A.from("DEFAULT_RETURN_VALUE")(Ce || (Ce = C(["Config JSON is not present. Returning ", "."], ["Config JSON is not present. Returning ", "."])), e));
718
744
  }, t.prototype.configJsonIsNotPresentSingle = function(e, r, n) {
719
- return this.log(d.Error, 1e3, C.from("KEY", "DEFAULT_PARAM_NAME", "DEFAULT_PARAM_VALUE")(Ee || (Ee = A(["Config JSON is not present when evaluating setting '", "'. Returning the `", "` parameter that you specified in your application: '", "'."], ["Config JSON is not present when evaluating setting '", "'. Returning the \\`", "\\` parameter that you specified in your application: '", "'."])), e, r, n));
745
+ return this.log(v.Error, 1e3, A.from("KEY", "DEFAULT_PARAM_NAME", "DEFAULT_PARAM_VALUE")(Ae || (Ae = C(["Config JSON is not present when evaluating setting '", "'. Returning the `", "` parameter that you specified in your application: '", "'."], ["Config JSON is not present when evaluating setting '", "'. Returning the \\`", "\\` parameter that you specified in your application: '", "'."])), e, r, n));
720
746
  }, t.prototype.settingEvaluationFailedDueToMissingKey = function(e, r, n, i) {
721
- return this.log(d.Error, 1001, C.from("KEY", "DEFAULT_PARAM_NAME", "DEFAULT_PARAM_VALUE", "AVAILABLE_KEYS")(be || (be = A(["Failed to evaluate setting '", "' (the key was not found in config JSON). Returning the `", "` parameter that you specified in your application: '", "'. Available keys: [", "]."], ["Failed to evaluate setting '", "' (the key was not found in config JSON). Returning the \\`", "\\` parameter that you specified in your application: '", "'. Available keys: [", "]."])), e, r, n, i));
747
+ return this.log(v.Error, 1001, A.from("KEY", "DEFAULT_PARAM_NAME", "DEFAULT_PARAM_VALUE", "AVAILABLE_KEYS")(we || (we = C(["Failed to evaluate setting '", "' (the key was not found in config JSON). Returning the `", "` parameter that you specified in your application: '", "'. Available keys: [", "]."], ["Failed to evaluate setting '", "' (the key was not found in config JSON). Returning the \\`", "\\` parameter that you specified in your application: '", "'. Available keys: [", "]."])), e, r, n, i));
722
748
  }, t.prototype.settingEvaluationError = function(e, r, n) {
723
- return this.log(d.Error, 1002, C.from("METHOD_NAME", "DEFAULT_RETURN_VALUE")(Se || (Se = A(["Error occurred in the `", "` method. Returning ", "."], ["Error occurred in the \\`", "\\` method. Returning ", "."])), e, r), n);
749
+ return this.log(v.Error, 1002, A.from("METHOD_NAME", "DEFAULT_RETURN_VALUE")(Te || (Te = C(["Error occurred in the `", "` method. Returning ", "."], ["Error occurred in the \\`", "\\` method. Returning ", "."])), e, r), n);
724
750
  }, t.prototype.settingEvaluationErrorSingle = function(e, r, n, i, o) {
725
- return this.log(d.Error, 1002, C.from("METHOD_NAME", "KEY", "DEFAULT_PARAM_NAME", "DEFAULT_PARAM_VALUE")(Oe || (Oe = A(["Error occurred in the `", "` method while evaluating setting '", "'. Returning the `", "` parameter that you specified in your application: '", "'."], ["Error occurred in the \\`", "\\` method while evaluating setting '", "'. Returning the \\`", "\\` parameter that you specified in your application: '", "'."])), e, r, n, i), o);
751
+ return this.log(v.Error, 1002, A.from("METHOD_NAME", "KEY", "DEFAULT_PARAM_NAME", "DEFAULT_PARAM_VALUE")(Ie || (Ie = C(["Error occurred in the `", "` method while evaluating setting '", "'. Returning the `", "` parameter that you specified in your application: '", "'."], ["Error occurred in the \\`", "\\` method while evaluating setting '", "'. Returning the \\`", "\\` parameter that you specified in your application: '", "'."])), e, r, n, i), o);
726
752
  }, t.prototype.forceRefreshError = function(e, r) {
727
- return this.log(d.Error, 1003, C.from("METHOD_NAME")(Ae || (Ae = A(["Error occurred in the `", "` method."], ["Error occurred in the \\`", "\\` method."])), e), r);
753
+ return this.log(v.Error, 1003, A.from("METHOD_NAME")(Ne || (Ne = C(["Error occurred in the `", "` method."], ["Error occurred in the \\`", "\\` method."])), e), r);
728
754
  }, t.prototype.fetchFailedDueToInvalidSdkKey = function() {
729
- return this.log(d.Error, 1100, "Your SDK Key seems to be wrong. You can find the valid SDK Key at https://app.configcat.com/sdkkey");
755
+ return this.log(v.Error, 1100, "Your SDK Key seems to be wrong. You can find the valid SDK Key at https://app.configcat.com/sdkkey");
730
756
  }, t.prototype.fetchFailedDueToUnexpectedHttpResponse = function(e, r) {
731
- return this.log(d.Error, 1101, C.from("STATUS_CODE", "REASON_PHRASE")(Ce || (Ce = A(["Unexpected HTTP response was received while trying to fetch config JSON: ", " ", ""], ["Unexpected HTTP response was received while trying to fetch config JSON: ", " ", ""])), e, r));
757
+ return this.log(v.Error, 1101, A.from("STATUS_CODE", "REASON_PHRASE")(Re || (Re = C(["Unexpected HTTP response was received while trying to fetch config JSON: ", " ", ""], ["Unexpected HTTP response was received while trying to fetch config JSON: ", " ", ""])), e, r));
732
758
  }, t.prototype.fetchFailedDueToRequestTimeout = function(e, r) {
733
- return this.log(d.Error, 1102, C.from("TIMEOUT")(we || (we = A(["Request timed out while trying to fetch config JSON. Timeout value: ", "ms"], ["Request timed out while trying to fetch config JSON. Timeout value: ", "ms"])), e), r);
759
+ return this.log(v.Error, 1102, A.from("TIMEOUT")(Le || (Le = C(["Request timed out while trying to fetch config JSON. Timeout value: ", "ms"], ["Request timed out while trying to fetch config JSON. Timeout value: ", "ms"])), e), r);
734
760
  }, t.prototype.fetchFailedDueToUnexpectedError = function(e) {
735
- return this.log(d.Error, 1103, "Unexpected error occurred while trying to fetch config JSON.", e);
761
+ return this.log(v.Error, 1103, "Unexpected error occurred while trying to fetch config JSON.", e);
736
762
  }, t.prototype.fetchFailedDueToRedirectLoop = function() {
737
- return this.log(d.Error, 1104, "Redirection loop encountered while trying to fetch config JSON. Please contact us at https://configcat.com/support/");
763
+ return this.log(v.Error, 1104, "Redirection loop encountered while trying to fetch config JSON. Please contact us at https://configcat.com/support/");
738
764
  }, t.prototype.fetchReceived200WithInvalidBody = function() {
739
- return this.log(d.Error, 1105, "Fetching config JSON was successful but the HTTP response content was invalid.");
765
+ return this.log(v.Error, 1105, "Fetching config JSON was successful but the HTTP response content was invalid.");
740
766
  }, t.prototype.fetchReceived304WhenLocalCacheIsEmpty = function(e, r) {
741
- return this.log(d.Error, 1106, C.from("STATUS_CODE", "REASON_PHRASE")(Ie || (Ie = A(["Unexpected HTTP response was received when no config JSON is cached locally: ", " ", ""], ["Unexpected HTTP response was received when no config JSON is cached locally: ", " ", ""])), e, r));
767
+ return this.log(v.Error, 1106, A.from("STATUS_CODE", "REASON_PHRASE")(De || (De = C(["Unexpected HTTP response was received when no config JSON is cached locally: ", " ", ""], ["Unexpected HTTP response was received when no config JSON is cached locally: ", " ", ""])), e, r));
742
768
  }, t.prototype.settingForVariationIdIsNotPresent = function(e) {
743
- return this.log(d.Error, 2011, C.from("VARIATION_ID")(Te || (Te = A(["Could not find the setting for the specified variation ID: '", "'."], ["Could not find the setting for the specified variation ID: '", "'."])), e));
769
+ return this.log(v.Error, 2011, A.from("VARIATION_ID")(Fe || (Fe = C(["Could not find the setting for the specified variation ID: '", "'."], ["Could not find the setting for the specified variation ID: '", "'."])), e));
744
770
  }, t.prototype.configServiceCacheReadError = function(e) {
745
- return this.log(d.Error, 2200, "Error occurred while reading the cache.", e);
771
+ return this.log(v.Error, 2200, "Error occurred while reading the cache.", e);
746
772
  }, t.prototype.configServiceCacheWriteError = function(e) {
747
- return this.log(d.Error, 2201, "Error occurred while writing the cache.", e);
773
+ return this.log(v.Error, 2201, "Error occurred while writing the cache.", e);
748
774
  }, t.prototype.clientIsAlreadyCreated = function(e) {
749
- return this.log(d.Warn, 3e3, C.from("SDK_KEY")(Ne || (Ne = A(["There is an existing client instance for the specified SDK Key. No new client instance will be created and the specified options are ignored. Returning the existing client instance. SDK Key: '", "'."], ["There is an existing client instance for the specified SDK Key. No new client instance will be created and the specified options are ignored. Returning the existing client instance. SDK Key: '", "'."])), e));
775
+ return this.log(v.Warn, 3e3, A.from("SDK_KEY")(Pe || (Pe = C(["There is an existing client instance for the specified SDK Key. No new client instance will be created and the specified options are ignored. Returning the existing client instance. SDK Key: '", "'."], ["There is an existing client instance for the specified SDK Key. No new client instance will be created and the specified options are ignored. Returning the existing client instance. SDK Key: '", "'."])), e));
750
776
  }, t.prototype.targetingIsNotPossible = function(e) {
751
- return this.log(d.Warn, 3001, C.from("KEY")(Le || (Le = A(["Cannot evaluate targeting rules and % options for setting '", "' (User Object is missing). You should pass a User Object to the evaluation methods like `getValueAsync()` in order to make targeting work properly. Read more: https://configcat.com/docs/advanced/user-object/"], ["Cannot evaluate targeting rules and % options for setting '", "' (User Object is missing). You should pass a User Object to the evaluation methods like \\`getValueAsync()\\` in order to make targeting work properly. Read more: https://configcat.com/docs/advanced/user-object/"])), e));
777
+ return this.log(v.Warn, 3001, A.from("KEY")(Ue || (Ue = C(["Cannot evaluate targeting rules and % options for setting '", "' (User Object is missing). You should pass a User Object to the evaluation methods like `getValueAsync()` in order to make targeting work properly. Read more: https://configcat.com/docs/advanced/user-object/"], ["Cannot evaluate targeting rules and % options for setting '", "' (User Object is missing). You should pass a User Object to the evaluation methods like \\`getValueAsync()\\` in order to make targeting work properly. Read more: https://configcat.com/docs/advanced/user-object/"])), e));
752
778
  }, t.prototype.dataGovernanceIsOutOfSync = function() {
753
- return this.log(d.Warn, 3002, "The `dataGovernance` parameter specified at the client initialization is not in sync with the preferences on the ConfigCat Dashboard. Read more: https://configcat.com/docs/advanced/data-governance/");
779
+ return this.log(v.Warn, 3002, "The `dataGovernance` parameter specified at the client initialization is not in sync with the preferences on the ConfigCat Dashboard. Read more: https://configcat.com/docs/advanced/data-governance/");
754
780
  }, t.prototype.configServiceCannotInitiateHttpCalls = function() {
755
- return this.log(d.Warn, 3200, "Client is in offline mode, it cannot initiate HTTP calls.");
781
+ return this.log(v.Warn, 3200, "Client is in offline mode, it cannot initiate HTTP calls.");
756
782
  }, t.prototype.configServiceMethodHasNoEffectDueToDisposedClient = function(e) {
757
- return this.log(d.Warn, 3201, C.from("METHOD_NAME")(Re || (Re = A(["The client object is already disposed, thus `", "()` has no effect."], ["The client object is already disposed, thus \\`", "()\\` has no effect."])), e));
783
+ return this.log(v.Warn, 3201, A.from("METHOD_NAME")(ke || (ke = C(["The client object is already disposed, thus `", "()` has no effect."], ["The client object is already disposed, thus \\`", "()\\` has no effect."])), e));
758
784
  }, t.prototype.configServiceMethodHasNoEffectDueToOverrideBehavior = function(e, r) {
759
- return this.log(d.Warn, 3202, C.from("OVERRIDE_BEHAVIOR", "METHOD_NAME")(De || (De = A(["Client is configured to use the `", "` override behavior, thus `", "()` has no effect."], ["Client is configured to use the \\`", "\\` override behavior, thus \\`", "()\\` has no effect."])), e, r));
785
+ return this.log(v.Warn, 3202, A.from("OVERRIDE_BEHAVIOR", "METHOD_NAME")(Me || (Me = C(["Client is configured to use the `", "` override behavior, thus `", "()` has no effect."], ["Client is configured to use the \\`", "\\` override behavior, thus \\`", "()\\` has no effect."])), e, r));
760
786
  }, t.prototype.settingEvaluated = function(e) {
761
- return this.log(d.Info, 5e3, C.from("EVALUATE_LOG")(Fe || (Fe = A(["", ""], ["", ""])), e));
787
+ return this.log(v.Info, 5e3, A.from("EVALUATE_LOG")(Ve || (Ve = C(["", ""], ["", ""])), e));
762
788
  }, t.prototype.configServiceStatusChanged = function(e) {
763
- return this.log(d.Info, 5200, C.from("MODE")(ke || (ke = A(["Switched to ", " mode."], ["Switched to ", " mode."])), e.toUpperCase()));
789
+ return this.log(v.Info, 5200, A.from("MODE")(xe || (xe = C(["Switched to ", " mode."], ["Switched to ", " mode."])), e.toUpperCase()));
764
790
  }, t;
765
- }(), st = function() {
791
+ }(), Be = function() {
766
792
  function t(e) {
767
- e === void 0 && (e = d.Warn), this.level = e, this.SOURCE = "ConfigCat";
793
+ e === void 0 && (e = v.Warn), this.level = e, this.SOURCE = "ConfigCat";
768
794
  }
769
795
  return t.prototype.log = function(e, r, n, i) {
770
- var o = e === d.Debug ? [console.info, "DEBUG"] : e === d.Info ? [console.info, "INFO"] : e === d.Warn ? [console.warn, "WARN"] : e === d.Error ? [console.error, "ERROR"] : [console.log, d[e].toUpperCase()], s = o[0], a = o[1], u = i !== void 0 ? `
771
- ` + $(i, !0) : "";
772
- s("".concat(this.SOURCE, " - ").concat(a, " - [").concat(r, "] ").concat(n).concat(u));
796
+ var o = e === v.Debug ? [console.info, "DEBUG"] : e === v.Info ? [console.info, "INFO"] : e === v.Warn ? [console.warn, "WARN"] : e === v.Error ? [console.error, "ERROR"] : [console.log, v[e].toUpperCase()], s = o[0], a = o[1], c = i !== void 0 ? `
797
+ ` + z(i, !0) : "";
798
+ s(this.SOURCE + " - " + a + " - [" + r + "] " + n + c);
773
799
  }, t;
774
- }(), me, Ee, be, Se, Oe, Ae, Ce, we, Ie, Te, Ne, Le, Re, De, Fe, ke;
775
- function _(t) {
800
+ }(), Ce, Ae, we, Te, Ie, Ne, Re, Le, De, Fe, Pe, Ue, ke, Me, Ve, xe;
801
+ function J(t) {
776
802
  return !!t.fn;
777
803
  }
778
- var at = function() {
804
+ var ot = function() {
779
805
  function t() {
780
806
  this.events = {}, this.eventCount = 0, this.addListener = this.on, this.off = this.removeListener;
781
807
  }
@@ -783,12 +809,12 @@ var at = function() {
783
809
  if (typeof r != "function")
784
810
  throw new TypeError("Listener must be a function");
785
811
  var i = this.events[e], o = { fn: r, once: n };
786
- return i ? _(i) ? this.events[e] = [i, o] : i.push(o) : (this.events[e] = o, this.eventCount++), this;
812
+ return i ? J(i) ? this.events[e] = [i, o] : i.push(o) : (this.events[e] = o, this.eventCount++), this;
787
813
  }, t.prototype.removeListenerCore = function(e, r, n) {
788
814
  var i = this.events[e];
789
815
  if (!i)
790
816
  return this;
791
- if (_(i))
817
+ if (J(i))
792
818
  n(i, r) && this.removeEvent(e);
793
819
  else
794
820
  for (var o = i.length - 1; o >= 0; o--)
@@ -815,14 +841,14 @@ var at = function() {
815
841
  var r = this.events[e];
816
842
  if (!r)
817
843
  return [];
818
- if (_(r))
844
+ if (J(r))
819
845
  return [r.fn];
820
846
  for (var n = r.length, i = new Array(n), o = 0; o < n; o++)
821
847
  i[o] = r[o].fn;
822
848
  return i;
823
849
  }, t.prototype.listenerCount = function(e) {
824
850
  var r = this.events[e];
825
- return r ? _(r) ? 1 : r.length : 0;
851
+ return r ? J(r) ? 1 : r.length : 0;
826
852
  }, t.prototype.eventNames = function() {
827
853
  var e = [];
828
854
  if (this.eventCount === 0)
@@ -832,228 +858,200 @@ var at = function() {
832
858
  Object.prototype.hasOwnProperty.call(r, n) && e.push(n);
833
859
  return Object.getOwnPropertySymbols ? e.concat(Object.getOwnPropertySymbols(r)) : e;
834
860
  }, t.prototype.emit = function(e, r, n, i, o) {
835
- var s, a, u = this.events[e];
836
- if (!u)
861
+ var s, a, c = this.events[e];
862
+ if (!c)
837
863
  return !1;
838
- var c, l;
839
- _(u) ? (s = [u, 1], c = s[0], l = s[1]) : (u = u.slice(), a = [u[0], u.length], c = a[0], l = a[1]);
840
- for (var g = arguments.length - 1, v = 0; ; ) {
841
- switch (c.once && this.removeListenerCore(e, c, function(y, E) {
864
+ var u, l;
865
+ J(c) ? (s = [c, 1], u = s[0], l = s[1]) : (c = c.slice(), a = [c[0], c.length], u = a[0], l = a[1]);
866
+ for (var h = arguments.length - 1, p = 0; ; ) {
867
+ switch (u.once && this.removeListenerCore(e, u, function(y, E) {
842
868
  return y === E;
843
- }), g) {
869
+ }), h) {
844
870
  case 0:
845
- c.fn.call(this);
871
+ u.fn.call(this);
846
872
  break;
847
873
  case 1:
848
- c.fn.call(this, r);
874
+ u.fn.call(this, r);
849
875
  break;
850
876
  case 2:
851
- c.fn.call(this, r, n);
877
+ u.fn.call(this, r, n);
852
878
  break;
853
879
  case 3:
854
- c.fn.call(this, r, n, i);
880
+ u.fn.call(this, r, n, i);
855
881
  break;
856
882
  case 4:
857
- c.fn.call(this, r, n, i, o);
883
+ u.fn.call(this, r, n, i, o);
858
884
  break;
859
885
  default:
860
- for (var f = new Array(g), p = 0; p < g; p++)
861
- f[p] = arguments[p + 1];
862
- c.fn.apply(this, f);
886
+ for (var f = new Array(h), d = 0; d < h; d++)
887
+ f[d] = arguments[d + 1];
888
+ u.fn.apply(this, f);
863
889
  break;
864
890
  }
865
- if (++v >= l)
891
+ if (++p >= l)
866
892
  break;
867
- c = u[v];
893
+ u = c[p];
868
894
  }
869
895
  return !0;
870
896
  }, t;
871
- }(), ct = function() {
872
- function t() {
873
- this.addListener = this.on, this.off = this.removeListener;
874
- }
875
- return t.prototype.on = function() {
876
- return this;
877
- }, t.prototype.once = function() {
878
- return this;
879
- }, t.prototype.removeListener = function() {
880
- return this;
881
- }, t.prototype.removeAllListeners = function() {
882
- return this;
883
- }, t.prototype.listeners = function() {
884
- return [];
885
- }, t.prototype.listenerCount = function() {
886
- return 0;
887
- }, t.prototype.eventNames = function() {
888
- return [];
889
- }, t.prototype.emit = function() {
890
- return !1;
891
- }, t;
892
- }(), Pe = new ct(), ut = function() {
893
- function t(e) {
894
- this.addListener = this.on, this.off = this.removeListener, this.eventEmitter = e;
895
- }
896
- return t.prototype.tryDisconnect = function() {
897
- var e = this.eventEmitter;
898
- return this.eventEmitter = Pe, e !== Pe;
899
- }, t.prototype.on = function(e, r) {
900
- return this.eventEmitter.on(e, r), this;
901
- }, t.prototype.once = function(e, r) {
902
- return this.eventEmitter.once(e, r), this;
903
- }, t.prototype.removeListener = function(e, r) {
904
- return this.eventEmitter.removeListener(e, r), this;
905
- }, t.prototype.removeAllListeners = function(e) {
906
- return this.eventEmitter.removeAllListeners(e), this;
907
- }, t.prototype.listeners = function(e) {
908
- return this.eventEmitter.listeners(e);
909
- }, t.prototype.listenerCount = function(e) {
910
- return this.eventEmitter.listenerCount(e);
911
- }, t.prototype.eventNames = function() {
912
- return this.eventEmitter.eventNames();
913
- }, t.prototype.emit = function(e) {
914
- for (var r, n = [], i = 1; i < arguments.length; i++)
915
- n[i - 1] = arguments[i];
916
- return (r = this.eventEmitter).emit.apply(r, Xe([e], n, !1));
917
- }, t;
918
897
  }();
919
- function te(t) {
920
- function e(k, N) {
921
- var V = k << N | k >>> 32 - N;
922
- return V;
898
+ function oe(t) {
899
+ function e(V, N) {
900
+ var H = V << N | V >>> 32 - N;
901
+ return H;
923
902
  }
924
- function r(k) {
925
- for (var N = "", V, L = 7; L >= 0; L--)
926
- V = k >>> L * 4 & 15, N += V.toString(16);
903
+ function r(V) {
904
+ for (var N = "", H, R = 7; R >= 0; R--)
905
+ H = V >>> R * 4 & 15, N += H.toString(16);
927
906
  return N;
928
907
  }
929
- function n(k) {
930
- k = k.replace(/\r\n/g, `
908
+ function n(V) {
909
+ V = V.replace(/\r\n/g, `
931
910
  `);
932
- for (var N = "", V = 0; V < k.length; V++) {
933
- var L = k.charCodeAt(V);
934
- L < 128 ? N += String.fromCharCode(L) : L > 127 && L < 2048 ? (N += String.fromCharCode(L >> 6 | 192), N += String.fromCharCode(L & 63 | 128)) : (N += String.fromCharCode(L >> 12 | 224), N += String.fromCharCode(L >> 6 & 63 | 128), N += String.fromCharCode(L & 63 | 128));
911
+ for (var N = "", H = 0; H < V.length; H++) {
912
+ var R = V.charCodeAt(H);
913
+ R < 128 ? N += String.fromCharCode(R) : R > 127 && R < 2048 ? (N += String.fromCharCode(R >> 6 | 192), N += String.fromCharCode(R & 63 | 128)) : (N += String.fromCharCode(R >> 12 | 224), N += String.fromCharCode(R >> 6 & 63 | 128), N += String.fromCharCode(R & 63 | 128));
935
914
  }
936
915
  return N;
937
916
  }
938
- var i, o, s, a = new Array(80), u = 1732584193, c = 4023233417, l = 2562383102, g = 271733878, v = 3285377520, f, p, y, E, T, F;
917
+ var i, o, s, a = new Array(80), c = 1732584193, u = 4023233417, l = 2562383102, h = 271733878, p = 3285377520, f, d, y, E, I, U;
939
918
  t = n(t);
940
- var R = t.length, D = new Array();
941
- for (o = 0; o < R - 3; o += 4)
942
- s = t.charCodeAt(o) << 24 | t.charCodeAt(o + 1) << 16 | t.charCodeAt(o + 2) << 8 | t.charCodeAt(o + 3), D.push(s);
943
- switch (R % 4) {
919
+ var D = t.length, F = new Array();
920
+ for (o = 0; o < D - 3; o += 4)
921
+ s = t.charCodeAt(o) << 24 | t.charCodeAt(o + 1) << 16 | t.charCodeAt(o + 2) << 8 | t.charCodeAt(o + 3), F.push(s);
922
+ switch (D % 4) {
944
923
  case 0:
945
924
  o = 2147483648;
946
925
  break;
947
926
  case 1:
948
- o = t.charCodeAt(R - 1) << 24 | 8388608;
927
+ o = t.charCodeAt(D - 1) << 24 | 8388608;
949
928
  break;
950
929
  case 2:
951
- o = t.charCodeAt(R - 2) << 24 | t.charCodeAt(R - 1) << 16 | 32768;
930
+ o = t.charCodeAt(D - 2) << 24 | t.charCodeAt(D - 1) << 16 | 32768;
952
931
  break;
953
932
  case 3:
954
- o = t.charCodeAt(R - 3) << 24 | t.charCodeAt(R - 2) << 16 | t.charCodeAt(R - 1) << 8 | 128;
933
+ o = t.charCodeAt(D - 3) << 24 | t.charCodeAt(D - 2) << 16 | t.charCodeAt(D - 1) << 8 | 128;
955
934
  break;
956
935
  }
957
- for (D.push(o); D.length % 16 != 14; )
958
- D.push(0);
959
- for (D.push(R >>> 29), D.push(R << 3 & 4294967295), i = 0; i < D.length; i += 16) {
936
+ for (F.push(o); F.length % 16 != 14; )
937
+ F.push(0);
938
+ for (F.push(D >>> 29), F.push(D << 3 & 4294967295), i = 0; i < F.length; i += 16) {
960
939
  for (o = 0; o < 16; o++)
961
- a[o] = D[i + o];
940
+ a[o] = F[i + o];
962
941
  for (o = 16; o <= 79; o++)
963
942
  a[o] = e(a[o - 3] ^ a[o - 8] ^ a[o - 14] ^ a[o - 16], 1);
964
- for (f = u, p = c, y = l, E = g, T = v, o = 0; o <= 19; o++)
965
- F = e(f, 5) + (p & y | ~p & E) + T + a[o] + 1518500249 & 4294967295, T = E, E = y, y = e(p, 30), p = f, f = F;
943
+ for (f = c, d = u, y = l, E = h, I = p, o = 0; o <= 19; o++)
944
+ U = e(f, 5) + (d & y | ~d & E) + I + a[o] + 1518500249 & 4294967295, I = E, E = y, y = e(d, 30), d = f, f = U;
966
945
  for (o = 20; o <= 39; o++)
967
- F = e(f, 5) + (p ^ y ^ E) + T + a[o] + 1859775393 & 4294967295, T = E, E = y, y = e(p, 30), p = f, f = F;
946
+ U = e(f, 5) + (d ^ y ^ E) + I + a[o] + 1859775393 & 4294967295, I = E, E = y, y = e(d, 30), d = f, f = U;
968
947
  for (o = 40; o <= 59; o++)
969
- F = e(f, 5) + (p & y | p & E | y & E) + T + a[o] + 2400959708 & 4294967295, T = E, E = y, y = e(p, 30), p = f, f = F;
948
+ U = e(f, 5) + (d & y | d & E | y & E) + I + a[o] + 2400959708 & 4294967295, I = E, E = y, y = e(d, 30), d = f, f = U;
970
949
  for (o = 60; o <= 79; o++)
971
- F = e(f, 5) + (p ^ y ^ E) + T + a[o] + 3395469782 & 4294967295, T = E, E = y, y = e(p, 30), p = f, f = F;
972
- u = u + f & 4294967295, c = c + p & 4294967295, l = l + y & 4294967295, g = g + E & 4294967295, v = v + T & 4294967295;
950
+ U = e(f, 5) + (d ^ y ^ E) + I + a[o] + 3395469782 & 4294967295, I = E, E = y, y = e(d, 30), d = f, f = U;
951
+ c = c + f & 4294967295, u = u + d & 4294967295, l = l + y & 4294967295, h = h + E & 4294967295, p = p + I & 4294967295;
973
952
  }
974
- return (r(u) + r(c) + r(l) + r(g) + r(v)).toLowerCase();
953
+ return (r(c) + r(u) + r(l) + r(h) + r(p)).toLowerCase();
975
954
  }
976
- var U;
955
+ var j;
977
956
  (function(t) {
978
957
  t[t.AutoPoll = 0] = "AutoPoll", t[t.LazyLoad = 1] = "LazyLoad", t[t.ManualPoll = 2] = "ManualPoll";
979
- })(U || (U = {}));
980
- var ie;
958
+ })(j || (j = {}));
959
+ var ue;
981
960
  (function(t) {
982
961
  t[t.Global = 0] = "Global", t[t.EuOnly = 1] = "EuOnly";
983
- })(ie || (ie = {}));
984
- var pe = function() {
962
+ })(ue || (ue = {}));
963
+ var Ee = function() {
985
964
  function t(e, r, n, i, o) {
986
- var s, a, u;
965
+ var s = this, a, c, u;
987
966
  if (this.requestTimeoutMs = 3e4, this.baseUrlOverriden = !1, this.proxy = "", this.offline = !1, !e)
988
967
  throw new Error("Invalid 'apiKey' value");
989
- switch (this.apiKey = e, this.clientVersion = r, this.dataGovernance = (s = n == null ? void 0 : n.dataGovernance) !== null && s !== void 0 ? s : ie.Global, this.dataGovernance) {
990
- case ie.EuOnly:
968
+ switch (this.apiKey = e, this.clientVersion = r, this.dataGovernance = (a = n == null ? void 0 : n.dataGovernance) !== null && a !== void 0 ? a : ue.Global, this.dataGovernance) {
969
+ case ue.EuOnly:
991
970
  this.baseUrl = "https://cdn-eu.configcat.com";
992
971
  break;
993
972
  default:
994
973
  this.baseUrl = "https://cdn-global.configcat.com";
995
974
  break;
996
975
  }
997
- var c = (a = o == null ? void 0 : o()) !== null && a !== void 0 ? a : new at();
998
- this.hooks = new ut(c);
999
- var l, g;
976
+ var l = (c = o == null ? void 0 : o()) !== null && c !== void 0 ? c : new ot();
977
+ this.hooks = new et(l), this.readyPromise = new Promise(function(f) {
978
+ return s.hooks.once("clientReady", f);
979
+ });
980
+ var h, p;
1000
981
  if (n) {
1001
- if (l = n.logger, g = n.cache, n.requestTimeoutMs) {
982
+ if (h = n.logger, p = n.cache, n.requestTimeoutMs) {
1002
983
  if (n.requestTimeoutMs < 0)
1003
984
  throw new Error("Invalid 'requestTimeoutMs' value");
1004
985
  this.requestTimeoutMs = n.requestTimeoutMs;
1005
986
  }
1006
987
  n.baseUrl && (this.baseUrl = n.baseUrl, this.baseUrlOverriden = !0), n.proxy && (this.proxy = n.proxy), n.flagOverrides && (this.flagOverrides = n.flagOverrides), n.defaultUser && (this.defaultUser = n.defaultUser), n.offline && (this.offline = n.offline), (u = n.setupHooks) === null || u === void 0 || u.call(n, this.hooks);
1007
988
  }
1008
- this.logger = new ot(l ?? new st(), this.hooks), this.cache = g ? new qe(g, this.logger) : i ? i(this) : new it();
989
+ this.logger = new it(h ?? new Be(), this.hooks), this.cache = p ? new _e(p, this.logger) : i ? i(this) : new nt();
1009
990
  }
1010
991
  return t.prototype.getUrl = function() {
1011
992
  return this.baseUrl + "/configuration-files/" + this.apiKey + "/" + t.configFileName + "?sdk=" + this.clientVersion;
1012
993
  }, t.prototype.getCacheKey = function() {
1013
- return te("".concat(this.apiKey, "_").concat(t.configFileName, "_").concat(P.serializationFormatVersion));
994
+ return oe(this.apiKey + "_" + t.configFileName + "_" + M.serializationFormatVersion);
1014
995
  }, t.configFileName = "config_v5.json", t;
1015
- }(), Ue = function(t) {
1016
- z(e, t);
996
+ }(), He = function(t) {
997
+ B(e, t);
1017
998
  function e(r, n, i, o, s, a) {
1018
- var u = t.call(this, r, n + "/a-" + i, o, s, a) || this;
1019
- u.pollIntervalSeconds = 60, u.maxInitWaitTimeSeconds = 5, o && (o.pollIntervalSeconds !== void 0 && o.pollIntervalSeconds !== null && (u.pollIntervalSeconds = o.pollIntervalSeconds), o.maxInitWaitTimeSeconds !== void 0 && o.maxInitWaitTimeSeconds !== null && (u.maxInitWaitTimeSeconds = o.maxInitWaitTimeSeconds));
1020
- var c = 2147483;
1021
- if (!(typeof u.pollIntervalSeconds == "number" && 1 <= u.pollIntervalSeconds && u.pollIntervalSeconds <= c))
999
+ var c = t.call(this, r, n + "/a-" + i, o, s, a) || this;
1000
+ c.pollIntervalSeconds = 60, c.maxInitWaitTimeSeconds = 5, o && (o.pollIntervalSeconds !== void 0 && o.pollIntervalSeconds !== null && (c.pollIntervalSeconds = o.pollIntervalSeconds), o.maxInitWaitTimeSeconds !== void 0 && o.maxInitWaitTimeSeconds !== null && (c.maxInitWaitTimeSeconds = o.maxInitWaitTimeSeconds));
1001
+ var u = 2147483;
1002
+ if (!(typeof c.pollIntervalSeconds == "number" && 1 <= c.pollIntervalSeconds && c.pollIntervalSeconds <= u))
1022
1003
  throw new Error("Invalid 'pollIntervalSeconds' value");
1023
- if (!(typeof u.maxInitWaitTimeSeconds == "number" && u.maxInitWaitTimeSeconds <= c))
1004
+ if (!(typeof c.maxInitWaitTimeSeconds == "number" && c.maxInitWaitTimeSeconds <= u))
1024
1005
  throw new Error("Invalid 'maxInitWaitTimeSeconds' value");
1025
- return u;
1006
+ return c;
1026
1007
  }
1027
1008
  return e;
1028
- }(pe), Ve = function(t) {
1029
- z(e, t);
1009
+ }(Ee), je = function(t) {
1010
+ B(e, t);
1030
1011
  function e(r, n, i, o, s, a) {
1031
1012
  return t.call(this, r, n + "/m-" + i, o, s, a) || this;
1032
1013
  }
1033
1014
  return e;
1034
- }(pe), Me = function(t) {
1035
- z(e, t);
1015
+ }(Ee), qe = function(t) {
1016
+ B(e, t);
1036
1017
  function e(r, n, i, o, s, a) {
1037
- var u = t.call(this, r, n + "/l-" + i, o, s, a) || this;
1038
- if (u.cacheTimeToLiveSeconds = 60, o && o.cacheTimeToLiveSeconds !== void 0 && o.cacheTimeToLiveSeconds !== null && (u.cacheTimeToLiveSeconds = o.cacheTimeToLiveSeconds), !(typeof u.cacheTimeToLiveSeconds == "number" && 1 <= u.cacheTimeToLiveSeconds && u.cacheTimeToLiveSeconds <= 2147483647))
1018
+ var c = t.call(this, r, n + "/l-" + i, o, s, a) || this;
1019
+ if (c.cacheTimeToLiveSeconds = 60, o && o.cacheTimeToLiveSeconds !== void 0 && o.cacheTimeToLiveSeconds !== null && (c.cacheTimeToLiveSeconds = o.cacheTimeToLiveSeconds), !(typeof c.cacheTimeToLiveSeconds == "number" && 1 <= c.cacheTimeToLiveSeconds && c.cacheTimeToLiveSeconds <= 2147483647))
1039
1020
  throw new Error("Invalid 'cacheTimeToLiveSeconds' value");
1040
- return u;
1021
+ return c;
1041
1022
  }
1042
1023
  return e;
1043
- }(pe), M;
1024
+ }(Ee), P;
1044
1025
  (function(t) {
1045
1026
  t[t.LocalOnly = 0] = "LocalOnly", t[t.LocalOverRemote = 1] = "LocalOverRemote", t[t.RemoteOverLocal = 2] = "RemoteOverLocal";
1046
- })(M || (M = {}));
1047
- var lt = function(t) {
1048
- z(e, t);
1027
+ })(P || (P = {}));
1028
+ var st = function() {
1029
+ function t(e) {
1030
+ this.map = {}, this.map = Object.fromEntries(Object.entries(e).map(function(r) {
1031
+ var n = r[0], i = r[1];
1032
+ return [n, ze.fromValue(i)];
1033
+ }));
1034
+ }
1035
+ return t.prototype.getOverrides = function() {
1036
+ return Promise.resolve(this.map);
1037
+ }, t.prototype.getOverridesSync = function() {
1038
+ return this.map;
1039
+ }, t;
1040
+ }(), at = function() {
1041
+ function t(e, r) {
1042
+ this.dataSource = e, this.behaviour = r;
1043
+ }
1044
+ return t;
1045
+ }(), ut = function(t) {
1046
+ B(e, t);
1049
1047
  function e(r, n) {
1050
1048
  var i = t.call(this, r, n) || this;
1051
- return i.cacheTimeToLiveMs = n.cacheTimeToLiveSeconds * 1e3, n.hooks.emit("clientReady"), i;
1049
+ return i.cacheTimeToLiveMs = n.cacheTimeToLiveSeconds * 1e3, t.prototype.syncUpWithCache.call(i), i;
1052
1050
  }
1053
1051
  return e.prototype.getConfig = function() {
1054
1052
  return S(this, void 0, void 0, function() {
1055
1053
  function r(o, s) {
1056
- s === void 0 && (s = ""), o.debug("LazyLoadConfigService.getConfig(): cache is empty or expired".concat(s, "."));
1054
+ s === void 0 && (s = ""), o.debug("LazyLoadConfigService.getConfig(): cache is empty or expired" + s + ".");
1057
1055
  }
1058
1056
  var n, i;
1059
1057
  return O(this, function(o) {
@@ -1075,14 +1073,18 @@ var lt = function(t) {
1075
1073
  });
1076
1074
  }, e.prototype.refreshConfigAsync = function() {
1077
1075
  return this.options.logger.debug("LazyLoadConfigService.refreshConfigAsync() called."), t.prototype.refreshConfigAsync.call(this);
1076
+ }, e.prototype.getReadyState = function(r) {
1077
+ return r.isEmpty ? L.NoFlagData : r.isExpired(this.cacheTimeToLiveMs) ? L.HasCachedFlagDataOnly : L.HasUpToDateFlagData;
1078
1078
  }, e;
1079
- }(ge), ft = function(t) {
1080
- z(e, t);
1079
+ }(me), ct = function(t) {
1080
+ B(e, t);
1081
1081
  function e(r, n) {
1082
1082
  var i = t.call(this, r, n) || this;
1083
- return n.hooks.emit("clientReady"), i;
1083
+ return t.prototype.syncUpWithCache.call(i), i;
1084
1084
  }
1085
- return e.prototype.getConfig = function() {
1085
+ return e.prototype.getReadyState = function(r) {
1086
+ return r.isEmpty ? L.NoFlagData : L.HasCachedFlagDataOnly;
1087
+ }, e.prototype.getConfig = function() {
1086
1088
  return S(this, void 0, void 0, function() {
1087
1089
  return O(this, function(r) {
1088
1090
  switch (r.label) {
@@ -1096,25 +1098,25 @@ var lt = function(t) {
1096
1098
  }, e.prototype.refreshConfigAsync = function() {
1097
1099
  return this.options.logger.debug("ManualPollService.refreshConfigAsync() called."), t.prototype.refreshConfigAsync.call(this);
1098
1100
  }, e;
1099
- }(ge);
1100
- function ht() {
1101
- typeof Object.values > "u" && (Object.values = gt), typeof Object.entries > "u" && (Object.entries = pt), typeof Object.fromEntries > "u" && (Object.fromEntries = vt);
1101
+ }(me);
1102
+ function lt() {
1103
+ typeof Object.values > "u" && (Object.values = ft), typeof Object.entries > "u" && (Object.entries = ht), typeof Object.fromEntries > "u" && (Object.fromEntries = gt);
1102
1104
  }
1103
- function gt(t) {
1105
+ function ft(t) {
1104
1106
  for (var e = [], r = 0, n = Object.keys(t); r < n.length; r++) {
1105
1107
  var i = n[r];
1106
1108
  e.push(t[i]);
1107
1109
  }
1108
1110
  return e;
1109
1111
  }
1110
- function pt(t) {
1112
+ function ht(t) {
1111
1113
  for (var e = [], r = 0, n = Object.keys(t); r < n.length; r++) {
1112
1114
  var i = n[r];
1113
1115
  e.push([i, t[i]]);
1114
1116
  }
1115
1117
  return e;
1116
1118
  }
1117
- function vt(t) {
1119
+ function gt(t) {
1118
1120
  var e, r = {};
1119
1121
  if (Array.isArray(t))
1120
1122
  for (var n = 0, i = t; n < i.length; n++) {
@@ -1122,15 +1124,15 @@ function vt(t) {
1122
1124
  r[s] = a;
1123
1125
  }
1124
1126
  else if (typeof Symbol < "u" && (t == null ? void 0 : t[Symbol.iterator]))
1125
- for (var u = t[Symbol.iterator](), c = void 0, l = void 0; e = u.next(), c = e.value, l = e.done, !l; ) {
1126
- var s = c[0], a = c[1];
1127
+ for (var c = t[Symbol.iterator](), u = void 0, l = void 0; e = c.next(), u = e.value, l = e.done, !l; ) {
1128
+ var s = u[0], a = u[1];
1127
1129
  r[s] = a;
1128
1130
  }
1129
1131
  else
1130
1132
  throw new TypeError("Object.fromEntries() requires a single iterable argument");
1131
1133
  return r;
1132
1134
  }
1133
- function dt() {
1135
+ function pt() {
1134
1136
  var t = function(e) {
1135
1137
  this.target = e;
1136
1138
  };
@@ -1138,31 +1140,31 @@ function dt() {
1138
1140
  return this.target;
1139
1141
  }, t.isFallback = !0, t;
1140
1142
  }
1141
- var yt = function() {
1143
+ var dt = function() {
1142
1144
  return typeof WeakRef == "function";
1143
- }, xe = /^[0-9]+$/, B = function(t, e) {
1144
- var r = xe.test(t), n = xe.test(e);
1145
+ }, We = /^[0-9]+$/, $ = function(t, e) {
1146
+ var r = We.test(t), n = We.test(e);
1145
1147
  return r && n && (t = +t, e = +e), t === e ? 0 : r && !n ? -1 : n && !r ? 1 : t < e ? -1 : 1;
1146
- }, fe = 256, Z = Number.MAX_SAFE_INTEGER || 9007199254740991, Y = [], b = [], m = {}, mt = 0, w = function(t, e) {
1147
- var r = mt++;
1148
- m[t] = r, b[r] = e, Y[r] = new RegExp(e);
1148
+ }, ve = 256, te = Number.MAX_SAFE_INTEGER || 9007199254740991, Z = [], b = [], m = {}, vt = 0, w = function(t, e) {
1149
+ var r = vt++;
1150
+ m[t] = r, b[r] = e, Z[r] = new RegExp(e);
1149
1151
  };
1150
1152
  w("NUMERICIDENTIFIER", "0|[1-9]\\d*");
1151
1153
  w("NUMERICIDENTIFIERLOOSE", "[0-9]+");
1152
1154
  w("NONNUMERICIDENTIFIER", "\\d*[a-zA-Z-][a-zA-Z0-9-]*");
1153
- w("MAINVERSION", "(".concat(b[m.NUMERICIDENTIFIER], ")\\.") + "(".concat(b[m.NUMERICIDENTIFIER], ")\\.") + "(".concat(b[m.NUMERICIDENTIFIER], ")"));
1154
- w("MAINVERSIONLOOSE", "(".concat(b[m.NUMERICIDENTIFIERLOOSE], ")\\.") + "(".concat(b[m.NUMERICIDENTIFIERLOOSE], ")\\.") + "(".concat(b[m.NUMERICIDENTIFIERLOOSE], ")"));
1155
- w("PRERELEASEIDENTIFIER", "(?:".concat(b[m.NUMERICIDENTIFIER], "|").concat(b[m.NONNUMERICIDENTIFIER], ")"));
1156
- w("PRERELEASEIDENTIFIERLOOSE", "(?:".concat(b[m.NUMERICIDENTIFIERLOOSE], "|").concat(b[m.NONNUMERICIDENTIFIER], ")"));
1157
- w("PRERELEASE", "(?:-(".concat(b[m.PRERELEASEIDENTIFIER], "(?:\\.").concat(b[m.PRERELEASEIDENTIFIER], ")*))"));
1158
- w("PRERELEASELOOSE", "(?:-?(".concat(b[m.PRERELEASEIDENTIFIERLOOSE], "(?:\\.").concat(b[m.PRERELEASEIDENTIFIERLOOSE], ")*))"));
1155
+ w("MAINVERSION", "(" + b[m.NUMERICIDENTIFIER] + ")\\." + ("(" + b[m.NUMERICIDENTIFIER] + ")\\.") + ("(" + b[m.NUMERICIDENTIFIER] + ")"));
1156
+ w("MAINVERSIONLOOSE", "(" + b[m.NUMERICIDENTIFIERLOOSE] + ")\\." + ("(" + b[m.NUMERICIDENTIFIERLOOSE] + ")\\.") + ("(" + b[m.NUMERICIDENTIFIERLOOSE] + ")"));
1157
+ w("PRERELEASEIDENTIFIER", "(?:" + b[m.NUMERICIDENTIFIER] + "|" + b[m.NONNUMERICIDENTIFIER] + ")");
1158
+ w("PRERELEASEIDENTIFIERLOOSE", "(?:" + b[m.NUMERICIDENTIFIERLOOSE] + "|" + b[m.NONNUMERICIDENTIFIER] + ")");
1159
+ w("PRERELEASE", "(?:-(" + b[m.PRERELEASEIDENTIFIER] + "(?:\\." + b[m.PRERELEASEIDENTIFIER] + ")*))");
1160
+ w("PRERELEASELOOSE", "(?:-?(" + b[m.PRERELEASEIDENTIFIERLOOSE] + "(?:\\." + b[m.PRERELEASEIDENTIFIERLOOSE] + ")*))");
1159
1161
  w("BUILDIDENTIFIER", "[0-9A-Za-z-]+");
1160
- w("BUILD", "(?:\\+(".concat(b[m.BUILDIDENTIFIER], "(?:\\.").concat(b[m.BUILDIDENTIFIER], ")*))"));
1161
- w("FULLPLAIN", "v?".concat(b[m.MAINVERSION]).concat(b[m.PRERELEASE], "?").concat(b[m.BUILD], "?"));
1162
- w("FULL", "^".concat(b[m.FULLPLAIN], "$"));
1163
- w("LOOSEPLAIN", "[v=\\s]*".concat(b[m.MAINVERSIONLOOSE]).concat(b[m.PRERELEASELOOSE], "?").concat(b[m.BUILD], "?"));
1164
- w("LOOSE", "^".concat(b[m.LOOSEPLAIN], "$"));
1165
- var oe = function() {
1162
+ w("BUILD", "(?:\\+(" + b[m.BUILDIDENTIFIER] + "(?:\\." + b[m.BUILDIDENTIFIER] + ")*))");
1163
+ w("FULLPLAIN", "v?" + b[m.MAINVERSION] + b[m.PRERELEASE] + "?" + b[m.BUILD] + "?");
1164
+ w("FULL", "^" + b[m.FULLPLAIN] + "$");
1165
+ w("LOOSEPLAIN", "[v=\\s]*" + b[m.MAINVERSIONLOOSE] + b[m.PRERELEASELOOSE] + "?" + b[m.BUILD] + "?");
1166
+ w("LOOSE", "^" + b[m.LOOSEPLAIN] + "$");
1167
+ var ce = function() {
1166
1168
  function t(e, r) {
1167
1169
  if ((!r || typeof r != "object") && (r = {
1168
1170
  loose: !!r,
@@ -1172,30 +1174,30 @@ var oe = function() {
1172
1174
  return e;
1173
1175
  e = e.version;
1174
1176
  } else if (typeof e != "string")
1175
- throw new TypeError("Invalid Version: ".concat(e));
1176
- if (e.length > fe)
1177
- throw new TypeError("version is longer than ".concat(fe, " characters"));
1177
+ throw new TypeError("Invalid Version: " + e);
1178
+ if (e.length > ve)
1179
+ throw new TypeError("version is longer than " + ve + " characters");
1178
1180
  this.options = r, this.loose = !!r.loose, this.includePrerelease = !!r.includePrerelease;
1179
- var n = e.trim().match(r.loose ? Y[m.LOOSE] : Y[m.FULL]);
1181
+ var n = e.trim().match(r.loose ? Z[m.LOOSE] : Z[m.FULL]);
1180
1182
  if (!n)
1181
- throw new TypeError("Invalid Version: ".concat(e));
1182
- if (this.raw = e, this.major = +n[1], this.minor = +n[2], this.patch = +n[3], this.major > Z || this.major < 0)
1183
+ throw new TypeError("Invalid Version: " + e);
1184
+ if (this.raw = e, this.major = +n[1], this.minor = +n[2], this.patch = +n[3], this.major > te || this.major < 0)
1183
1185
  throw new TypeError("Invalid major version");
1184
- if (this.minor > Z || this.minor < 0)
1186
+ if (this.minor > te || this.minor < 0)
1185
1187
  throw new TypeError("Invalid minor version");
1186
- if (this.patch > Z || this.patch < 0)
1188
+ if (this.patch > te || this.patch < 0)
1187
1189
  throw new TypeError("Invalid patch version");
1188
1190
  n[4] ? this.prerelease = n[4].split(".").map(function(i) {
1189
1191
  if (/^[0-9]+$/.test(i)) {
1190
1192
  var o = +i;
1191
- if (o >= 0 && o < Z)
1193
+ if (o >= 0 && o < te)
1192
1194
  return o;
1193
1195
  }
1194
1196
  return i;
1195
1197
  }) : this.prerelease = [], this.build = n[5] ? n[5].split(".") : [], this.format();
1196
1198
  }
1197
1199
  return t.prototype.format = function() {
1198
- return this.version = "".concat(this.major, ".").concat(this.minor, ".").concat(this.patch), this.prerelease.length && (this.version += "-".concat(this.prerelease.join("."))), this.version;
1200
+ return this.version = this.major + "." + this.minor + "." + this.patch, this.prerelease.length && (this.version += "-" + this.prerelease.join(".")), this.version;
1199
1201
  }, t.prototype.toString = function() {
1200
1202
  return this.version;
1201
1203
  }, t.prototype.compare = function(e) {
@@ -1206,7 +1208,7 @@ var oe = function() {
1206
1208
  }
1207
1209
  return e.version === this.version ? 0 : this.compareMain(e) || this.comparePre(e);
1208
1210
  }, t.prototype.compareMain = function(e) {
1209
- return e instanceof t || (e = new t(e, this.options)), B(this.major, e.major) || B(this.minor, e.minor) || B(this.patch, e.patch);
1211
+ return e instanceof t || (e = new t(e, this.options)), $(this.major, e.major) || $(this.minor, e.minor) || $(this.patch, e.patch);
1210
1212
  }, t.prototype.comparePre = function(e) {
1211
1213
  if (e instanceof t || (e = new t(e, this.options)), this.prerelease.length && !e.prerelease.length)
1212
1214
  return -1;
@@ -1225,7 +1227,7 @@ var oe = function() {
1225
1227
  return -1;
1226
1228
  if (n === i)
1227
1229
  continue;
1228
- return B(n, i);
1230
+ return $(n, i);
1229
1231
  } while (++r);
1230
1232
  }, t.prototype.compareBuild = function(e) {
1231
1233
  e instanceof t || (e = new t(e, this.options));
@@ -1240,7 +1242,7 @@ var oe = function() {
1240
1242
  return -1;
1241
1243
  if (n === i)
1242
1244
  continue;
1243
- return B(n, i);
1245
+ return $(n, i);
1244
1246
  } while (++r);
1245
1247
  }, t.prototype.inc = function(e, r) {
1246
1248
  switch (e) {
@@ -1276,51 +1278,56 @@ var oe = function() {
1276
1278
  r && (this.prerelease[0] === r ? isNaN(this.prerelease[1]) && (this.prerelease = [r, 0]) : this.prerelease = [r, 0]);
1277
1279
  break;
1278
1280
  default:
1279
- throw new Error("invalid increment argument: ".concat(e));
1281
+ throw new Error("invalid increment argument: " + e);
1280
1282
  }
1281
1283
  return this.format(), this.raw = this.version, this;
1282
1284
  }, t;
1283
- }(), Et = function(t, e) {
1285
+ }(), yt = function(t, e) {
1284
1286
  if ((!e || typeof e != "object") && (e = {
1285
1287
  loose: !!e,
1286
1288
  includePrerelease: !1
1287
- }), t instanceof oe)
1289
+ }), t instanceof ce)
1288
1290
  return t;
1289
- if (typeof t != "string" || t.length > fe)
1291
+ if (typeof t != "string" || t.length > ve)
1290
1292
  return null;
1291
- var r = e.loose ? Y[m.LOOSE] : Y[m.FULL];
1293
+ var r = e.loose ? Z[m.LOOSE] : Z[m.FULL];
1292
1294
  if (!r.test(t))
1293
1295
  return null;
1294
1296
  try {
1295
- return new oe(t, e);
1297
+ return new ce(t, e);
1296
1298
  } catch {
1297
1299
  return null;
1298
1300
  }
1299
- }, H = function(t, e, r) {
1300
- return new oe(t, r).compare(new oe(e, r));
1301
- }, j = function(t) {
1302
- var e = Et(t, !1);
1301
+ }, G = function(t, e, r) {
1302
+ return new ce(t, r).compare(new ce(e, r));
1303
+ }, W = function(t) {
1304
+ var e = yt(t, !1);
1303
1305
  return e ? e.version : null;
1306
+ }, mt = function(t, e) {
1307
+ return G(t, e, !0) === 0;
1308
+ }, Et = function(t, e) {
1309
+ return G(t, e, !1) === 0;
1304
1310
  }, bt = function(t, e) {
1305
- return H(t, e, !0) === 0;
1311
+ return G(t, e, !1) < 0;
1306
1312
  }, St = function(t, e) {
1307
- return H(t, e, !1) === 0;
1313
+ return G(t, e, !1) <= 0;
1308
1314
  }, Ot = function(t, e) {
1309
- return H(t, e, !1) < 0;
1310
- }, At = function(t, e) {
1311
- return H(t, e, !1) <= 0;
1315
+ return G(t, e, !1) > 0;
1312
1316
  }, Ct = function(t, e) {
1313
- return H(t, e, !1) > 0;
1314
- }, wt = function(t, e) {
1315
- return H(t, e, !1) >= 0;
1316
- }, It = function() {
1317
+ return G(t, e, !1) >= 0;
1318
+ }, jt = function() {
1319
+ function t(e, r, n, i) {
1320
+ this.custom = {}, this.identifier = e, this.email = r, this.country = n, this.custom = i || {};
1321
+ }
1322
+ return t;
1323
+ }(), At = function() {
1317
1324
  function t(e) {
1318
1325
  this.logger = e;
1319
1326
  }
1320
1327
  return t.prototype.evaluate = function(e, r, n, i, o) {
1321
- if (this.logger.debug("RolloutEvaluator.Evaluate() called."), e.type < 0 && !_e(e.value))
1322
- throw new TypeError(e.value === null ? "Setting value is null." : e.value === void 0 ? "Setting value is undefined." : "Setting value '".concat(e.value, "' is of an unsupported type (").concat(typeof e.value, ")."));
1323
- var s = new Tt();
1328
+ if (this.logger.debug("RolloutEvaluator.Evaluate() called."), e.type < 0 && !Je(e.value))
1329
+ throw new TypeError(e.value === null ? "Setting value is null." : e.value === void 0 ? "Setting value is undefined." : "Setting value '" + e.value + "' is of an unsupported type (" + typeof e.value + ").");
1330
+ var s = new wt();
1324
1331
  s.user = i, s.keyName = r, s.returnValue = n;
1325
1332
  var a;
1326
1333
  try {
@@ -1338,72 +1345,72 @@ var oe = function() {
1338
1345
  }
1339
1346
  }, t.prototype.evaluateRules = function(e, r, n) {
1340
1347
  if (this.logger.debug("RolloutEvaluator.EvaluateRules() called."), e && e.length > 0)
1341
- for (var i = function(u) {
1342
- var c = e[u], l = o.getUserAttribute(r, c.comparisonAttribute), g = c.comparator, v = c.comparisonValue, f = "Evaluating rule: '" + l + "' " + o.ruleToString(g) + " '" + v + "' => ";
1348
+ for (var i = function(c) {
1349
+ var u = e[c], l = o.getUserAttribute(r, u.comparisonAttribute), h = u.comparator, p = u.comparisonValue, f = "Evaluating rule: '" + l + "' " + o.ruleToString(h) + " '" + p + "' => ";
1343
1350
  if (!l)
1344
1351
  return f += "NO MATCH (Attribute is not defined on the user object)", n.opAppendLine(f), "continue";
1345
- var p = {
1346
- value: c.value,
1347
- variationId: c.variationId,
1348
- matchedTargetingRule: c
1352
+ var d = {
1353
+ value: u.value,
1354
+ variationId: u.variationId,
1355
+ matchedTargetingRule: u
1349
1356
  };
1350
- switch (g) {
1351
- case h.In:
1352
- for (var y = v.split(","), E = 0; E < y.length; E++)
1357
+ switch (h) {
1358
+ case g.In:
1359
+ for (var y = p.split(","), E = 0; E < y.length; E++)
1353
1360
  if (y[E].trim() === l)
1354
- return f += "MATCH", n.opAppendLine(f), { value: p };
1361
+ return f += "MATCH", n.opAppendLine(f), { value: d };
1355
1362
  f += "no match";
1356
1363
  break;
1357
- case h.NotIn:
1358
- if (!v.split(",").some(function(D) {
1359
- return D.trim() === l;
1364
+ case g.NotIn:
1365
+ if (!p.split(",").some(function(F) {
1366
+ return F.trim() === l;
1360
1367
  }))
1361
- return f += "MATCH", n.opAppendLine(f), { value: p };
1368
+ return f += "MATCH", n.opAppendLine(f), { value: d };
1362
1369
  f += "no match";
1363
1370
  break;
1364
- case h.Contains:
1365
- if (l.indexOf(v) !== -1)
1366
- return f += "MATCH", n.opAppendLine(f), { value: p };
1371
+ case g.Contains:
1372
+ if (l.indexOf(p) !== -1)
1373
+ return f += "MATCH", n.opAppendLine(f), { value: d };
1367
1374
  f += "no match";
1368
1375
  break;
1369
- case h.NotContains:
1370
- if (l.indexOf(v) === -1)
1371
- return f += "MATCH", n.opAppendLine(f), { value: p };
1376
+ case g.NotContains:
1377
+ if (l.indexOf(p) === -1)
1378
+ return f += "MATCH", n.opAppendLine(f), { value: d };
1372
1379
  f += "no match";
1373
1380
  break;
1374
- case h.SemVerIn:
1375
- case h.SemVerNotIn:
1376
- case h.SemVerLessThan:
1377
- case h.SemVerLessThanEqual:
1378
- case h.SemVerGreaterThan:
1379
- case h.SemVerGreaterThanEqual:
1380
- if (o.evaluateSemver(l, v, g))
1381
- return f += "MATCH", n.opAppendLine(f), { value: p };
1381
+ case g.SemVerIn:
1382
+ case g.SemVerNotIn:
1383
+ case g.SemVerLessThan:
1384
+ case g.SemVerLessThanEqual:
1385
+ case g.SemVerGreaterThan:
1386
+ case g.SemVerGreaterThanEqual:
1387
+ if (o.evaluateSemver(l, p, h))
1388
+ return f += "MATCH", n.opAppendLine(f), { value: d };
1382
1389
  f += "no match";
1383
1390
  break;
1384
- case h.NumberEqual:
1385
- case h.NumberNotEqual:
1386
- case h.NumberLessThan:
1387
- case h.NumberLessThanEqual:
1388
- case h.NumberGreaterThan:
1389
- case h.NumberGreaterThanEqual:
1390
- if (o.evaluateNumber(l, v, g))
1391
- return f += "MATCH", n.opAppendLine(f), { value: p };
1391
+ case g.NumberEqual:
1392
+ case g.NumberNotEqual:
1393
+ case g.NumberLessThan:
1394
+ case g.NumberLessThanEqual:
1395
+ case g.NumberGreaterThan:
1396
+ case g.NumberGreaterThanEqual:
1397
+ if (o.evaluateNumber(l, p, h))
1398
+ return f += "MATCH", n.opAppendLine(f), { value: d };
1392
1399
  f += "no match";
1393
1400
  break;
1394
- case h.SensitiveOneOf: {
1395
- for (var T = v.split(","), F = te(l), E = 0; E < T.length; E++)
1396
- if (T[E].trim() === F)
1397
- return f += "MATCH", n.opAppendLine(f), { value: p };
1401
+ case g.SensitiveOneOf: {
1402
+ for (var I = p.split(","), U = oe(l), E = 0; E < I.length; E++)
1403
+ if (I[E].trim() === U)
1404
+ return f += "MATCH", n.opAppendLine(f), { value: d };
1398
1405
  f += "no match";
1399
1406
  break;
1400
1407
  }
1401
- case h.SensitiveNotOneOf: {
1402
- var R = te(l);
1403
- if (!v.split(",").some(function(D) {
1404
- return D.trim() === R;
1408
+ case g.SensitiveNotOneOf: {
1409
+ var D = oe(l);
1410
+ if (!p.split(",").some(function(F) {
1411
+ return F.trim() === D;
1405
1412
  }))
1406
- return f += "MATCH", n.opAppendLine(f), { value: p };
1413
+ return f += "MATCH", n.opAppendLine(f), { value: d };
1407
1414
  f += "no match";
1408
1415
  break;
1409
1416
  }
@@ -1417,13 +1424,13 @@ var oe = function() {
1417
1424
  return null;
1418
1425
  }, t.prototype.evaluatePercentageRules = function(e, r, n) {
1419
1426
  if (this.logger.debug("RolloutEvaluator.EvaluateVariations() called."), e && e.length > 0)
1420
- for (var i = r + (n.identifier === null || n.identifier === void 0 ? "" : n.identifier), o = te(i).substring(0, 7), s = parseInt(o, 16) % 100, a = 0, u = 0; u < e.length; u++) {
1421
- var c = e[u];
1422
- if (a += +c.percentage, s < a)
1427
+ for (var i = r + (n.identifier === null || n.identifier === void 0 ? "" : n.identifier), o = oe(i).substring(0, 7), s = parseInt(o, 16) % 100, a = 0, c = 0; c < e.length; c++) {
1428
+ var u = e[c];
1429
+ if (a += +u.percentage, s < a)
1423
1430
  return {
1424
- value: c.value,
1425
- variationId: c.variationId,
1426
- matchedPercentageOption: c
1431
+ value: u.value,
1432
+ variationId: u.variationId,
1433
+ matchedPercentageOption: u
1427
1434
  };
1428
1435
  }
1429
1436
  return null;
@@ -1439,44 +1446,44 @@ var oe = function() {
1439
1446
  else
1440
1447
  return !1;
1441
1448
  switch (n) {
1442
- case h.NumberEqual:
1449
+ case g.NumberEqual:
1443
1450
  return i === o;
1444
- case h.NumberNotEqual:
1451
+ case g.NumberNotEqual:
1445
1452
  return i !== o;
1446
- case h.NumberLessThan:
1453
+ case g.NumberLessThan:
1447
1454
  return i < o;
1448
- case h.NumberLessThanEqual:
1455
+ case g.NumberLessThanEqual:
1449
1456
  return i <= o;
1450
- case h.NumberGreaterThan:
1457
+ case g.NumberGreaterThan:
1451
1458
  return i > o;
1452
- case h.NumberGreaterThanEqual:
1459
+ case g.NumberGreaterThanEqual:
1453
1460
  return i >= o;
1454
1461
  }
1455
1462
  return !1;
1456
1463
  }, t.prototype.evaluateSemver = function(e, r, n) {
1457
- if (this.logger.debug("RolloutEvaluator.EvaluateSemver() called."), j(e) == null || r === void 0)
1464
+ if (this.logger.debug("RolloutEvaluator.EvaluateSemver() called."), W(e) == null || r === void 0)
1458
1465
  return !1;
1459
1466
  switch (r = r.trim(), n) {
1460
- case h.SemVerIn:
1467
+ case g.SemVerIn:
1461
1468
  for (var i = r.split(","), o = !1, s = 0; s < i.length; s++)
1462
1469
  if (!(!i[s] || i[s].trim() === "")) {
1463
- if (j(i[s].trim()) == null)
1470
+ if (W(i[s].trim()) == null)
1464
1471
  return !1;
1465
- o || (o = bt(e, i[s].trim()));
1472
+ o || (o = mt(e, i[s].trim()));
1466
1473
  }
1467
1474
  return o;
1468
- case h.SemVerNotIn:
1475
+ case g.SemVerNotIn:
1469
1476
  return !r.split(",").some(function(a) {
1470
- return !a || a.trim() === "" || (a = j(a.trim()), a == null) ? !1 : St(e, a);
1477
+ return !a || a.trim() === "" || (a = W(a.trim()), a == null) ? !1 : Et(e, a);
1471
1478
  });
1472
- case h.SemVerLessThan:
1473
- return j(r) == null ? !1 : Ot(e, r);
1474
- case h.SemVerLessThanEqual:
1475
- return j(r) == null ? !1 : At(e, r);
1476
- case h.SemVerGreaterThan:
1477
- return j(r) == null ? !1 : Ct(e, r);
1478
- case h.SemVerGreaterThanEqual:
1479
- return j(r) == null ? !1 : wt(e, r);
1479
+ case g.SemVerLessThan:
1480
+ return W(r) == null ? !1 : bt(e, r);
1481
+ case g.SemVerLessThanEqual:
1482
+ return W(r) == null ? !1 : St(e, r);
1483
+ case g.SemVerGreaterThan:
1484
+ return W(r) == null ? !1 : Ot(e, r);
1485
+ case g.SemVerGreaterThanEqual:
1486
+ return W(r) == null ? !1 : Ct(e, r);
1480
1487
  }
1481
1488
  return !1;
1482
1489
  }, t.prototype.getUserAttribute = function(e, r) {
@@ -1492,47 +1499,47 @@ var oe = function() {
1492
1499
  }
1493
1500
  }, t.prototype.ruleToString = function(e) {
1494
1501
  switch (e) {
1495
- case h.In:
1502
+ case g.In:
1496
1503
  return "IS ONE OF";
1497
- case h.NotIn:
1504
+ case g.NotIn:
1498
1505
  return "IS NOT ONE OF";
1499
- case h.Contains:
1506
+ case g.Contains:
1500
1507
  return "CONTAINS";
1501
- case h.NotContains:
1508
+ case g.NotContains:
1502
1509
  return "DOES NOT CONTAIN";
1503
- case h.SemVerIn:
1510
+ case g.SemVerIn:
1504
1511
  return "IS ONE OF (SemVer)";
1505
- case h.SemVerNotIn:
1512
+ case g.SemVerNotIn:
1506
1513
  return "IS NOT ONE OF (SemVer)";
1507
- case h.SemVerLessThan:
1514
+ case g.SemVerLessThan:
1508
1515
  return "< (SemVer)";
1509
- case h.SemVerLessThanEqual:
1516
+ case g.SemVerLessThanEqual:
1510
1517
  return "<= (SemVer)";
1511
- case h.SemVerGreaterThan:
1518
+ case g.SemVerGreaterThan:
1512
1519
  return "> (SemVer)";
1513
- case h.SemVerGreaterThanEqual:
1520
+ case g.SemVerGreaterThanEqual:
1514
1521
  return ">= (SemVer)";
1515
- case h.NumberEqual:
1522
+ case g.NumberEqual:
1516
1523
  return "= (Number)";
1517
- case h.NumberNotEqual:
1524
+ case g.NumberNotEqual:
1518
1525
  return "!= (Number)";
1519
- case h.NumberLessThan:
1526
+ case g.NumberLessThan:
1520
1527
  return "< (Number)";
1521
- case h.NumberLessThanEqual:
1528
+ case g.NumberLessThanEqual:
1522
1529
  return "<= (Number)";
1523
- case h.NumberGreaterThan:
1530
+ case g.NumberGreaterThan:
1524
1531
  return "> (Number)";
1525
- case h.NumberGreaterThanEqual:
1532
+ case g.NumberGreaterThanEqual:
1526
1533
  return ">= (Number)";
1527
- case h.SensitiveOneOf:
1534
+ case g.SensitiveOneOf:
1528
1535
  return "IS ONE OF (Sensitive)";
1529
- case h.SensitiveNotOneOf:
1536
+ case g.SensitiveNotOneOf:
1530
1537
  return "IS NOT ONE OF (Sensitive)";
1531
1538
  default:
1532
1539
  return e + "";
1533
1540
  }
1534
1541
  }, t;
1535
- }(), Tt = function() {
1542
+ }(), wt = function() {
1536
1543
  function t() {
1537
1544
  this.operations = "";
1538
1545
  }
@@ -1545,7 +1552,7 @@ var oe = function() {
1545
1552
  ` + this.operations + " Returning value : " + this.returnValue;
1546
1553
  }, t;
1547
1554
  }();
1548
- function He(t, e, r, n) {
1555
+ function Ge(t, e, r, n) {
1549
1556
  return {
1550
1557
  key: t,
1551
1558
  value: e.value,
@@ -1557,7 +1564,7 @@ function He(t, e, r, n) {
1557
1564
  matchedEvaluationPercentageRule: e.matchedPercentageOption
1558
1565
  };
1559
1566
  }
1560
- function X(t, e, r, n, i, o) {
1567
+ function _(t, e, r, n, i, o) {
1561
1568
  return {
1562
1569
  key: t,
1563
1570
  value: e,
@@ -1568,51 +1575,51 @@ function X(t, e, r, n, i, o) {
1568
1575
  errorException: o
1569
1576
  };
1570
1577
  }
1571
- function je(t, e, r, n, i, o, s) {
1578
+ function le(t, e, r, n, i, o, s) {
1572
1579
  var a;
1573
1580
  if (!e)
1574
- return a = s.configJsonIsNotPresentSingle(r, "defaultValue", n).toString(), X(r, n, W(o), i, a);
1575
- var u = e[r];
1576
- if (!u)
1577
- return a = s.settingEvaluationFailedDueToMissingKey(r, "defaultValue", n, Nt(e)).toString(), X(r, n, W(o), i, a);
1578
- var c = t.evaluate(u, r, n, i, o);
1579
- if (n != null && typeof n != typeof c.value)
1581
+ return a = s.configJsonIsNotPresentSingle(r, "defaultValue", n).toString(), _(r, n, x(o), i, a);
1582
+ var c = e[r];
1583
+ if (!c)
1584
+ return a = s.settingEvaluationFailedDueToMissingKey(r, "defaultValue", n, Tt(e)).toString(), _(r, n, x(o), i, a);
1585
+ var u = t.evaluate(c, r, n, i, o);
1586
+ if (n != null && typeof n != typeof u.value)
1580
1587
  throw new TypeError(`The type of a setting must match the type of the given default value.
1581
- The setting's type was `.concat(typeof n, ", the given default value's type was ").concat(typeof c.value, `.
1582
- Please pass a corresponding default value type.`));
1583
- return He(r, c, W(o), i);
1588
+ The setting's type was ` + typeof n + ", the given default value's type was " + typeof u.value + `.
1589
+ Please pass a corresponding default value type.`);
1590
+ return Ge(r, u, x(o), i);
1584
1591
  }
1585
1592
  function Ke(t, e, r, n, i, o) {
1586
1593
  var s;
1587
- if (!he(e, i, o))
1594
+ if (!ye(e, i, o))
1588
1595
  return [[], s];
1589
- for (var a = [], u = 0, c = Object.entries(e); u < c.length; u++) {
1590
- var l = c[u], g = l[0], v = l[1], f = void 0;
1596
+ for (var a = [], c = 0, u = Object.entries(e); c < u.length; c++) {
1597
+ var l = u[c], h = l[0], p = l[1], f = void 0;
1591
1598
  try {
1592
- var p = t.evaluate(v, g, null, r, n);
1593
- f = He(g, p, W(n), r);
1599
+ var d = t.evaluate(p, h, null, r, n);
1600
+ f = Ge(h, d, x(n), r);
1594
1601
  } catch (y) {
1595
- s ?? (s = []), s.push(y), f = X(g, null, W(n), r, $(y), y);
1602
+ s ?? (s = []), s.push(y), f = _(h, null, x(n), r, z(y), y);
1596
1603
  }
1597
1604
  a.push(f);
1598
1605
  }
1599
1606
  return [a, s];
1600
1607
  }
1601
- function he(t, e, r) {
1608
+ function ye(t, e, r) {
1602
1609
  return t ? !0 : (e.configJsonIsNotPresent(r), !1);
1603
1610
  }
1604
- function _e(t) {
1611
+ function Je(t) {
1605
1612
  return t == null || typeof t == "boolean" || typeof t == "number" || typeof t == "string";
1606
1613
  }
1607
- function W(t) {
1614
+ function x(t) {
1608
1615
  return t ? new Date(t.timestamp) : void 0;
1609
1616
  }
1610
- function Nt(t) {
1617
+ function Tt(t) {
1611
1618
  return Object.keys(t).map(function(e) {
1612
- return "'".concat(e, "'");
1619
+ return "'" + e + "'";
1613
1620
  }).join(", ");
1614
1621
  }
1615
- var Lt = function() {
1622
+ var It = function() {
1616
1623
  function t() {
1617
1624
  this.instances = {};
1618
1625
  }
@@ -1624,8 +1631,8 @@ var Lt = function() {
1624
1631
  return [n, !0];
1625
1632
  }
1626
1633
  var s = {};
1627
- n = new ve(e, r, s);
1628
- var a = yt() ? WeakRef : dt();
1634
+ n = new be(e, r, s);
1635
+ var a = dt() ? WeakRef : pt();
1629
1636
  return this.instances[e.apiKey] = [new a(n), s], [n, !1];
1630
1637
  }, t.prototype.remove = function(e, r) {
1631
1638
  var n = this.instances[e];
@@ -1642,7 +1649,7 @@ var Lt = function() {
1642
1649
  }
1643
1650
  return e;
1644
1651
  }, t;
1645
- }(), G = new Lt(), ve = function() {
1652
+ }(), Y = new It(), be = function() {
1646
1653
  function t(e, r, n) {
1647
1654
  var i;
1648
1655
  if (this.cacheToken = n, this.addListener = this.on, this.off = this.removeListener, !e)
@@ -1651,38 +1658,33 @@ var Lt = function() {
1651
1658
  throw new Error("Invalid 'configCatKernel' value");
1652
1659
  if (!r.configFetcher)
1653
1660
  throw new Error("Invalid 'configCatKernel.configFetcher' value");
1654
- if (e.defaultUser && this.setDefaultUser(e.defaultUser), this.evaluator = new It(e.logger), ((i = e.flagOverrides) === null || i === void 0 ? void 0 : i.behaviour) !== M.LocalOnly) {
1655
- var o = e instanceof Ue ? nt : e instanceof Ve ? ft : e instanceof Me ? lt : function() {
1656
- throw new Error("Invalid 'options' value");
1657
- }();
1658
- this.configService = new o(r.configFetcher, e);
1659
- } else
1660
- this.options.hooks.emit("clientReady");
1661
- this.suppressFinalize = re(this, { sdkKey: e.apiKey, cacheToken: n, configService: this.configService, logger: e.logger });
1661
+ e.defaultUser && this.setDefaultUser(e.defaultUser), this.evaluator = new At(e.logger), ((i = e.flagOverrides) === null || i === void 0 ? void 0 : i.behaviour) !== P.LocalOnly ? this.configService = e instanceof He ? new rt(r.configFetcher, e) : e instanceof je ? new ct(r.configFetcher, e) : e instanceof qe ? new ut(r.configFetcher, e) : function() {
1662
+ throw new Error("Invalid 'options' value");
1663
+ }() : this.options.hooks.emit("clientReady", L.HasLocalOverrideFlagDataOnly), this.suppressFinalize = se(this, { sdkKey: e.apiKey, cacheToken: n, configService: this.configService, logger: e.logger });
1662
1664
  }
1663
1665
  return Object.defineProperty(t, "instanceCache", {
1664
1666
  get: function() {
1665
- return G;
1667
+ return Y;
1666
1668
  },
1667
1669
  enumerable: !1,
1668
1670
  configurable: !0
1669
1671
  }), t.get = function(e, r, n, i) {
1670
1672
  if (!e)
1671
1673
  throw new Error("Invalid 'sdkKey' value");
1672
- var o = r === U.AutoPoll ? Ue : r === U.ManualPoll ? Ve : r === U.LazyLoad ? Me : function() {
1674
+ var o = r === j.AutoPoll ? He : r === j.ManualPoll ? je : r === j.LazyLoad ? qe : function() {
1673
1675
  throw new Error("Invalid 'pollingMode' value");
1674
- }(), s = new o(e, i.sdkType, i.sdkVersion, n, i.defaultCacheFactory, i.eventEmitterFactory), a = G.getOrCreate(s, i), u = a[0], c = a[1];
1675
- return c && n && s.logger.clientIsAlreadyCreated(e), u;
1676
+ }(), s = new o(e, i.sdkType, i.sdkVersion, n, i.defaultCacheFactory, i.eventEmitterFactory), a = Y.getOrCreate(s, i), c = a[0], u = a[1];
1677
+ return u && n && s.logger.clientIsAlreadyCreated(e), c;
1676
1678
  }, t.finalize = function(e) {
1677
1679
  var r;
1678
- (r = e.logger) === null || r === void 0 || r.debug("finalize() called"), e.cacheToken && G.remove(e.sdkKey, e.cacheToken), t.close(e.configService, e.logger);
1680
+ (r = e.logger) === null || r === void 0 || r.debug("finalize() called"), e.cacheToken && Y.remove(e.sdkKey, e.cacheToken), t.close(e.configService, e.logger);
1679
1681
  }, t.close = function(e, r, n) {
1680
1682
  r == null || r.debug("close() called"), n == null || n.tryDisconnect(), e == null || e.dispose();
1681
1683
  }, t.prototype.dispose = function() {
1682
1684
  var e = this.options;
1683
- e.logger.debug("dispose() called"), this.cacheToken && G.remove(e.apiKey, this.cacheToken), t.close(this.configService, e.logger, e.hooks), this.suppressFinalize();
1685
+ e.logger.debug("dispose() called"), this.cacheToken && Y.remove(e.apiKey, this.cacheToken), t.close(this.configService, e.logger, e.hooks), this.suppressFinalize();
1684
1686
  }, t.disposeAll = function() {
1685
- for (var e = G.clear(), r, n = 0, i = e; n < i.length; n++) {
1687
+ for (var e = Y.clear(), r, n = 0, i = e; n < i.length; n++) {
1686
1688
  var o = i[n];
1687
1689
  try {
1688
1690
  t.close(o.configService, o.options.logger, o.options.hooks), o.suppressFinalize();
@@ -1694,17 +1696,17 @@ var Lt = function() {
1694
1696
  throw typeof AggregateError < "u" ? new AggregateError(r) : r.pop();
1695
1697
  }, t.prototype.getValueAsync = function(e, r, n) {
1696
1698
  return S(this, void 0, void 0, function() {
1697
- var i, o, s, a, u, c;
1699
+ var i, o, s, a, c, u;
1698
1700
  return O(this, function(l) {
1699
1701
  switch (l.label) {
1700
1702
  case 0:
1701
- this.options.logger.debug("getValueAsync() called."), We(e), ze(r), s = null, n ?? (n = this.defaultUser), l.label = 1;
1703
+ this.options.logger.debug("getValueAsync() called."), fe(e), he(r), s = null, n ?? (n = this.defaultUser), l.label = 1;
1702
1704
  case 1:
1703
1705
  return l.trys.push([1, 3, , 4]), a = void 0, [4, this.getSettingsAsync()];
1704
1706
  case 2:
1705
- return c = l.sent(), a = c[0], s = c[1], o = je(this.evaluator, a, e, r, n, s, this.options.logger), i = o.value, [3, 4];
1707
+ return u = l.sent(), a = u[0], s = u[1], o = le(this.evaluator, a, e, r, n, s, this.options.logger), i = o.value, [3, 4];
1706
1708
  case 3:
1707
- return u = l.sent(), this.options.logger.settingEvaluationErrorSingle("getValueAsync", e, "defaultValue", r, u), o = X(e, r, W(s), n, $(u), u), i = r, [3, 4];
1709
+ return c = l.sent(), this.options.logger.settingEvaluationErrorSingle("getValueAsync", e, "defaultValue", r, c), o = _(e, r, x(s), n, z(c), c), i = r, [3, 4];
1708
1710
  case 4:
1709
1711
  return this.options.hooks.emit("flagEvaluated", o), [2, i];
1710
1712
  }
@@ -1712,17 +1714,17 @@ var Lt = function() {
1712
1714
  });
1713
1715
  }, t.prototype.getValueDetailsAsync = function(e, r, n) {
1714
1716
  return S(this, void 0, void 0, function() {
1715
- var i, o, s, a, u;
1716
- return O(this, function(c) {
1717
- switch (c.label) {
1717
+ var i, o, s, a, c;
1718
+ return O(this, function(u) {
1719
+ switch (u.label) {
1718
1720
  case 0:
1719
- this.options.logger.debug("getValueDetailsAsync() called."), We(e), ze(r), o = null, n ?? (n = this.defaultUser), c.label = 1;
1721
+ this.options.logger.debug("getValueDetailsAsync() called."), fe(e), he(r), o = null, n ?? (n = this.defaultUser), u.label = 1;
1720
1722
  case 1:
1721
- return c.trys.push([1, 3, , 4]), s = void 0, [4, this.getSettingsAsync()];
1723
+ return u.trys.push([1, 3, , 4]), s = void 0, [4, this.getSettingsAsync()];
1722
1724
  case 2:
1723
- return u = c.sent(), s = u[0], o = u[1], i = je(this.evaluator, s, e, r, n, o, this.options.logger), [3, 4];
1725
+ return c = u.sent(), s = c[0], o = c[1], i = le(this.evaluator, s, e, r, n, o, this.options.logger), [3, 4];
1724
1726
  case 3:
1725
- return a = c.sent(), this.options.logger.settingEvaluationErrorSingle("getValueDetailsAsync", e, "defaultValue", r, a), i = X(e, r, W(o), n, $(a), a), [3, 4];
1727
+ return a = u.sent(), this.options.logger.settingEvaluationErrorSingle("getValueDetailsAsync", e, "defaultValue", r, a), i = _(e, r, x(o), n, z(a), a), [3, 4];
1726
1728
  case 4:
1727
1729
  return this.options.hooks.emit("flagEvaluated", i), [2, i];
1728
1730
  }
@@ -1738,7 +1740,7 @@ var Lt = function() {
1738
1740
  case 1:
1739
1741
  return i.trys.push([1, 3, , 4]), [4, this.getSettingsAsync()];
1740
1742
  case 2:
1741
- return r = i.sent()[0], he(r, this.options.logger, e) ? [2, Object.keys(r)] : [2, []];
1743
+ return r = i.sent()[0], ye(r, this.options.logger, e) ? [2, Object.keys(r)] : [2, []];
1742
1744
  case 3:
1743
1745
  return n = i.sent(), this.options.logger.settingEvaluationError("getAllKeysAsync", e, n), [2, []];
1744
1746
  case 4:
@@ -1748,31 +1750,29 @@ var Lt = function() {
1748
1750
  });
1749
1751
  }, t.prototype.getAllValuesAsync = function(e) {
1750
1752
  return S(this, void 0, void 0, function() {
1751
- var r, n, i, o, s, a, u, c, l, g, v, f;
1752
- return O(this, function(p) {
1753
- switch (p.label) {
1753
+ var r, n, i, o, s, a, c, u, l, h, p, f;
1754
+ return O(this, function(d) {
1755
+ switch (d.label) {
1754
1756
  case 0:
1755
- this.options.logger.debug("getAllValuesAsync() called."), r = "empty array", e ?? (e = this.defaultUser), p.label = 1;
1757
+ this.options.logger.debug("getAllValuesAsync() called."), r = "empty array", e ?? (e = this.defaultUser), d.label = 1;
1756
1758
  case 1:
1757
- return p.trys.push([1, 3, , 4]), [4, this.getSettingsAsync()];
1759
+ return d.trys.push([1, 3, , 4]), [4, this.getSettingsAsync()];
1758
1760
  case 2:
1759
- if (i = p.sent(), o = i[0], s = i[1], a = void 0, f = Ke(this.evaluator, o, e, s, this.options.logger, r), n = f[0], a = f[1], a != null && a.length)
1760
- throw typeof AggregateError < "u" ? new AggregateError(a) : a.pop();
1761
- return [3, 4];
1761
+ return s = d.sent(), a = s[0], c = s[1], f = Ke(this.evaluator, a, e, c, this.options.logger, r), i = f[0], o = f[1], n = i.map(function(y) {
1762
+ return new ne(y.key, y.value);
1763
+ }), [3, 4];
1762
1764
  case 3:
1763
- return u = p.sent(), this.options.logger.settingEvaluationError("getAllValuesAsync", r, u), n ?? (n = []), [3, 4];
1765
+ return u = d.sent(), this.options.logger.settingEvaluationError("getAllValuesAsync", r, u), [2, []];
1764
1766
  case 4:
1765
- for (c = n.map(function(y) {
1766
- return new Q(y.key, y.value);
1767
- }), l = 0, g = n; l < g.length; l++)
1768
- v = g[l], this.options.hooks.emit("flagEvaluated", v);
1769
- return [2, c];
1767
+ for (o != null && o.length && this.options.logger.settingEvaluationError("getAllValuesAsync", "evaluation result", typeof AggregateError < "u" ? new AggregateError(o) : o.pop()), l = 0, h = i; l < h.length; l++)
1768
+ p = h[l], this.options.hooks.emit("flagEvaluated", p);
1769
+ return [2, n];
1770
1770
  }
1771
1771
  });
1772
1772
  });
1773
1773
  }, t.prototype.getAllValueDetailsAsync = function(e) {
1774
1774
  return S(this, void 0, void 0, function() {
1775
- var r, n, i, o, s, a, u, c, l, g, v;
1775
+ var r, n, i, o, s, a, c, u, l, h, p;
1776
1776
  return O(this, function(f) {
1777
1777
  switch (f.label) {
1778
1778
  case 0:
@@ -1780,21 +1780,19 @@ var Lt = function() {
1780
1780
  case 1:
1781
1781
  return f.trys.push([1, 3, , 4]), [4, this.getSettingsAsync()];
1782
1782
  case 2:
1783
- if (i = f.sent(), o = i[0], s = i[1], a = void 0, v = Ke(this.evaluator, o, e, s, this.options.logger, r), n = v[0], a = v[1], a != null && a.length)
1784
- throw typeof AggregateError < "u" ? new AggregateError(a) : a.pop();
1785
- return [3, 4];
1783
+ return o = f.sent(), s = o[0], a = o[1], p = Ke(this.evaluator, s, e, a, this.options.logger, r), n = p[0], i = p[1], [3, 4];
1786
1784
  case 3:
1787
- return u = f.sent(), this.options.logger.settingEvaluationError("getAllValueDetailsAsync", r, u), n ?? (n = []), [3, 4];
1785
+ return c = f.sent(), this.options.logger.settingEvaluationError("getAllValueDetailsAsync", r, c), [2, []];
1788
1786
  case 4:
1789
- for (c = 0, l = n; c < l.length; c++)
1790
- g = l[c], this.options.hooks.emit("flagEvaluated", g);
1787
+ for (i != null && i.length && this.options.logger.settingEvaluationError("getAllValueDetailsAsync", "evaluation result", typeof AggregateError < "u" ? new AggregateError(i) : i.pop()), u = 0, l = n; u < l.length; u++)
1788
+ h = l[u], this.options.hooks.emit("flagEvaluated", h);
1791
1789
  return [2, n];
1792
1790
  }
1793
1791
  });
1794
1792
  });
1795
1793
  }, t.prototype.getKeyAndValueAsync = function(e) {
1796
1794
  return S(this, void 0, void 0, function() {
1797
- var r, n, i, o, s, a, u, c, v, l, g, v, f, p;
1795
+ var r, n, i, o, s, a, c, u, p, l, h, p, f, d;
1798
1796
  return O(this, function(y) {
1799
1797
  switch (y.label) {
1800
1798
  case 0:
@@ -1802,25 +1800,25 @@ var Lt = function() {
1802
1800
  case 1:
1803
1801
  return y.trys.push([1, 3, , 4]), [4, this.getSettingsAsync()];
1804
1802
  case 2:
1805
- if (n = y.sent()[0], !he(n, this.options.logger, r))
1803
+ if (n = y.sent()[0], !ye(n, this.options.logger, r))
1806
1804
  return [2, null];
1807
1805
  for (i = 0, o = Object.entries(n); i < o.length; i++) {
1808
- if (s = o[i], a = s[0], u = s[1], e === u.variationId)
1809
- return [2, new Q(a, u.value)];
1810
- if (c = n[a].targetingRules, c && c.length > 0) {
1811
- for (v = 0; v < c.length; v++)
1812
- if (l = c[v], e === l.variationId)
1813
- return [2, new Q(a, l.value)];
1806
+ if (s = o[i], a = s[0], c = s[1], e === c.variationId)
1807
+ return [2, new ne(a, c.value)];
1808
+ if (u = n[a].targetingRules, u && u.length > 0) {
1809
+ for (p = 0; p < u.length; p++)
1810
+ if (l = u[p], e === l.variationId)
1811
+ return [2, new ne(a, l.value)];
1814
1812
  }
1815
- if (g = n[a].percentageOptions, g && g.length > 0) {
1816
- for (v = 0; v < g.length; v++)
1817
- if (f = g[v], e === f.variationId)
1818
- return [2, new Q(a, f.value)];
1813
+ if (h = n[a].percentageOptions, h && h.length > 0) {
1814
+ for (p = 0; p < h.length; p++)
1815
+ if (f = h[p], e === f.variationId)
1816
+ return [2, new ne(a, f.value)];
1819
1817
  }
1820
1818
  }
1821
1819
  return this.options.logger.settingForVariationIdIsNotPresent(e), [3, 4];
1822
1820
  case 3:
1823
- return p = y.sent(), this.options.logger.settingEvaluationError("getKeyAndValueAsync", r, p), [3, 4];
1821
+ return d = y.sent(), this.options.logger.settingEvaluationError("getKeyAndValueAsync", r, d), [3, 4];
1824
1822
  case 4:
1825
1823
  return [2, null];
1826
1824
  }
@@ -1840,11 +1838,11 @@ var Lt = function() {
1840
1838
  case 2:
1841
1839
  return e = n.sent()[0], [2, e];
1842
1840
  case 3:
1843
- return r = n.sent(), this.options.logger.forceRefreshError("forceRefreshAsync", r), [2, ne.failure($(r), r)];
1841
+ return r = n.sent(), this.options.logger.forceRefreshError("forceRefreshAsync", r), [2, ae.failure(z(r), r)];
1844
1842
  case 4:
1845
1843
  return [3, 6];
1846
1844
  case 5:
1847
- return [2, ne.failure("Client is configured to use the LocalOnly override behavior, which prevents making HTTP requests.")];
1845
+ return [2, ae.failure("Client is configured to use the LocalOnly override behavior, which prevents making HTTP requests.")];
1848
1846
  case 6:
1849
1847
  return [2];
1850
1848
  }
@@ -1862,37 +1860,56 @@ var Lt = function() {
1862
1860
  enumerable: !1,
1863
1861
  configurable: !0
1864
1862
  }), t.prototype.setOnline = function() {
1865
- this.configService ? this.configService.setOnline() : this.options.logger.configServiceMethodHasNoEffectDueToOverrideBehavior(M[M.LocalOnly], "setOnline");
1863
+ this.configService ? this.configService.setOnline() : this.options.logger.configServiceMethodHasNoEffectDueToOverrideBehavior(P[P.LocalOnly], "setOnline");
1866
1864
  }, t.prototype.setOffline = function() {
1867
1865
  var e;
1868
1866
  (e = this.configService) === null || e === void 0 || e.setOffline();
1867
+ }, t.prototype.waitForReady = function() {
1868
+ return this.options.readyPromise;
1869
+ }, t.prototype.snapshot = function() {
1870
+ var e, r, n, i = this, o, s = function() {
1871
+ var h = i.options.cache.getInMemory(), p = h.isEmpty ? null : h.config.settings;
1872
+ return [p, h];
1873
+ }, a, c, u = (o = this.options) === null || o === void 0 ? void 0 : o.flagOverrides;
1874
+ if (u) {
1875
+ var l = u.dataSource.getOverridesSync();
1876
+ switch (u.behaviour) {
1877
+ case P.LocalOnly:
1878
+ return new re(l, null, this);
1879
+ case P.LocalOverRemote:
1880
+ return e = s(), a = e[0], c = e[1], new re(k(k({}, a ?? {}), l), c, this);
1881
+ case P.RemoteOverLocal:
1882
+ return r = s(), a = r[0], c = r[1], new re(k(k({}, l), a ?? {}), c, this);
1883
+ }
1884
+ }
1885
+ return n = s(), a = n[0], c = n[1], new re(a, c, this);
1869
1886
  }, t.prototype.getSettingsAsync = function() {
1870
1887
  var e;
1871
1888
  return S(this, void 0, void 0, function() {
1872
- var r, n, i, o, s, a, u, c, l = this;
1873
- return O(this, function(g) {
1874
- switch (g.label) {
1889
+ var r, n, i, o, s, a, c, u, l = this;
1890
+ return O(this, function(h) {
1891
+ switch (h.label) {
1875
1892
  case 0:
1876
1893
  return this.options.logger.debug("getSettingsAsync() called."), r = function() {
1877
1894
  return S(l, void 0, void 0, function() {
1878
- var v, f;
1879
- return O(this, function(p) {
1880
- switch (p.label) {
1895
+ var p, f;
1896
+ return O(this, function(d) {
1897
+ switch (d.label) {
1881
1898
  case 0:
1882
1899
  return [4, this.configService.getConfig()];
1883
1900
  case 1:
1884
- return v = p.sent(), f = v.isEmpty ? null : v.config.settings, [2, [f, v]];
1901
+ return p = d.sent(), f = p.isEmpty ? null : p.config.settings, [2, [f, p]];
1885
1902
  }
1886
1903
  });
1887
1904
  });
1888
1905
  }, n = (e = this.options) === null || e === void 0 ? void 0 : e.flagOverrides, n ? (i = void 0, o = void 0, [4, n.dataSource.getOverrides()]) : [3, 7];
1889
1906
  case 1:
1890
- switch (s = g.sent(), a = n.behaviour, a) {
1891
- case M.LocalOnly:
1907
+ switch (s = h.sent(), a = n.behaviour, a) {
1908
+ case P.LocalOnly:
1892
1909
  return [3, 2];
1893
- case M.LocalOverRemote:
1910
+ case P.LocalOverRemote:
1894
1911
  return [3, 3];
1895
- case M.RemoteOverLocal:
1912
+ case P.RemoteOverLocal:
1896
1913
  return [3, 5];
1897
1914
  }
1898
1915
  return [3, 7];
@@ -1901,15 +1918,15 @@ var Lt = function() {
1901
1918
  case 3:
1902
1919
  return [4, r()];
1903
1920
  case 4:
1904
- return u = g.sent(), i = u[0], o = u[1], [2, [q(q({}, i ?? {}), s), o]];
1921
+ return c = h.sent(), i = c[0], o = c[1], [2, [k(k({}, i ?? {}), s), o]];
1905
1922
  case 5:
1906
1923
  return [4, r()];
1907
1924
  case 6:
1908
- return c = g.sent(), i = c[0], o = c[1], [2, [q(q({}, s), i ?? {}), o]];
1925
+ return u = h.sent(), i = u[0], o = u[1], [2, [k(k({}, s), i ?? {}), o]];
1909
1926
  case 7:
1910
1927
  return [4, r()];
1911
1928
  case 8:
1912
- return [2, g.sent()];
1929
+ return [2, h.sent()];
1913
1930
  }
1914
1931
  });
1915
1932
  });
@@ -1928,126 +1945,227 @@ var Lt = function() {
1928
1945
  }, t.prototype.eventNames = function() {
1929
1946
  return this.options.hooks.eventNames();
1930
1947
  }, t;
1931
- }(), Q = function() {
1948
+ }(), re = function() {
1949
+ function t(e, r, n) {
1950
+ this.mergedSettings = e, this.remoteConfig = r, this.defaultUser = n.defaultUser, this.evaluator = n.evaluator, this.options = n.options;
1951
+ }
1952
+ return Object.defineProperty(t.prototype, "fetchedConfig", {
1953
+ get: function() {
1954
+ var e = this.remoteConfig;
1955
+ return e && !e.isEmpty ? e.config : null;
1956
+ },
1957
+ enumerable: !1,
1958
+ configurable: !0
1959
+ }), t.prototype.getAllKeys = function() {
1960
+ return this.mergedSettings ? Object.keys(this.mergedSettings) : [];
1961
+ }, t.prototype.getValue = function(e, r, n) {
1962
+ this.options.logger.debug("Snapshot.getValue() called."), fe(e), he(r);
1963
+ var i, o;
1964
+ n ?? (n = this.defaultUser);
1965
+ try {
1966
+ o = le(this.evaluator, this.mergedSettings, e, r, n, this.remoteConfig, this.options.logger), i = o.value;
1967
+ } catch (s) {
1968
+ this.options.logger.settingEvaluationErrorSingle("Snapshot.getValue", e, "defaultValue", r, s), o = _(e, r, x(this.remoteConfig), n, z(s), s), i = r;
1969
+ }
1970
+ return this.options.hooks.emit("flagEvaluated", o), i;
1971
+ }, t.prototype.getValueDetails = function(e, r, n) {
1972
+ this.options.logger.debug("Snapshot.getValueDetails() called."), fe(e), he(r);
1973
+ var i;
1974
+ n ?? (n = this.defaultUser);
1975
+ try {
1976
+ i = le(this.evaluator, this.mergedSettings, e, r, n, this.remoteConfig, this.options.logger);
1977
+ } catch (o) {
1978
+ this.options.logger.settingEvaluationErrorSingle("Snapshot.getValueDetails", e, "defaultValue", r, o), i = _(e, r, x(this.remoteConfig), n, z(o), o);
1979
+ }
1980
+ return this.options.hooks.emit("flagEvaluated", i), i;
1981
+ }, t;
1982
+ }(), ne = function() {
1932
1983
  function t(e, r) {
1933
1984
  this.settingKey = e, this.settingValue = r;
1934
1985
  }
1935
1986
  return t;
1936
1987
  }();
1937
- function We(t) {
1988
+ function fe(t) {
1938
1989
  if (!t)
1939
1990
  throw new Error("Invalid 'key' value");
1940
1991
  }
1941
- function ze(t) {
1942
- if (!_e(t))
1992
+ function he(t) {
1993
+ if (!Je(t))
1943
1994
  throw new TypeError("The default value must be boolean, number, string, null or undefined.");
1944
1995
  }
1945
- var re = function(t, e) {
1996
+ var se = function(t, e) {
1946
1997
  if (typeof FinalizationRegistry < "u") {
1947
1998
  var r = new FinalizationRegistry(function(n) {
1948
- return ve.finalize(n);
1999
+ return be.finalize(n);
1949
2000
  });
1950
- re = function(n, i) {
2001
+ se = function(n, i) {
1951
2002
  var o = {};
1952
2003
  return r.register(n, i, o), function() {
1953
2004
  return r.unregister(o);
1954
2005
  };
1955
2006
  };
1956
2007
  } else
1957
- re = function() {
2008
+ se = function() {
1958
2009
  return function() {
1959
2010
  };
1960
2011
  };
1961
- return re(t, e);
2012
+ return se(t, e);
1962
2013
  };
1963
- ht();
1964
- function Rt(t, e, r, n) {
1965
- return ve.get(t, e, r, n);
2014
+ lt();
2015
+ function Nt(t, e, r, n) {
2016
+ return be.get(t, e, r, n);
1966
2017
  }
1967
- var Dt = function() {
1968
- function t() {
1969
- }
1970
- return t.prototype.set = function(e, r) {
1971
- try {
1972
- localStorage.setItem(e, btoa(r));
1973
- } catch {
1974
- }
1975
- }, t.prototype.get = function(e) {
1976
- try {
1977
- var r = localStorage.getItem(e);
1978
- if (r)
1979
- return atob(r);
1980
- } catch {
2018
+ function Rt(t) {
2019
+ return new Be(t);
2020
+ }
2021
+ const Lt = (t, e) => {
2022
+ const r = t.__vccOpts || t;
2023
+ for (const [n, i] of e)
2024
+ r[n] = i;
2025
+ return r;
2026
+ }, Dt = {
2027
+ emits: ["flagValueChanged"],
2028
+ props: {
2029
+ featureKey: {
2030
+ type: String,
2031
+ required: !0
2032
+ },
2033
+ userObject: {
2034
+ type: Object,
2035
+ required: !1,
2036
+ default: {}
1981
2037
  }
1982
- }, t;
1983
- }(), Ft = function() {
1984
- function t() {
2038
+ },
2039
+ data() {
2040
+ return {
2041
+ isFeatureFlagEnabled: null
2042
+ };
2043
+ },
2044
+ beforeMount() {
2045
+ this.configChangedHandler = () => {
2046
+ const r = this.$configCat.client.snapshot().getValue(this.featureKey, !1, this.userObject);
2047
+ this.isFeatureFlagEnabled !== r && (this.isFeatureFlagEnabled = r, this.$emit("flagValueChanged", r));
2048
+ };
2049
+ const t = this.$configCat.clientReadyState;
2050
+ if (t == L.HasUpToDateFlagData || t == L.HasLocalOverrideFlagDataOnly) {
2051
+ const e = this.$configCat.client.snapshot();
2052
+ this.isFeatureFlagEnabled = e.getValue(this.featureKey, !1, this.userObject), this.$configCat.client.on("configChanged", this.configChangedHandler);
2053
+ } else
2054
+ this.$configCat.client.getValueAsync(this.featureKey, !1, this.userObject).then((e) => {
2055
+ const r = this.configChangedHandler;
2056
+ !r || (this.isFeatureFlagEnabled = e, this.$configCat.client.on("configChanged", r));
2057
+ });
2058
+ },
2059
+ unmounted() {
2060
+ const t = this.configChangedHandler;
2061
+ delete this.configChangedHandler, this.$configCat.client.off("configChanged", t);
1985
2062
  }
1986
- return t.prototype.handleStateChange = function(e, r, n) {
1987
- var i;
2063
+ }, Ft = { key: 0 }, Pt = { key: 1 }, Ut = { key: 2 };
2064
+ function kt(t, e, r, n, i, o) {
2065
+ return Q(), ee("div", null, [
2066
+ i.isFeatureFlagEnabled === !0 ? (Q(), ee("div", Ft, [
2067
+ ge(t.$slots, "default")
2068
+ ])) : i.isFeatureFlagEnabled === !1 ? (Q(), ee("div", Pt, [
2069
+ ge(t.$slots, "else")
2070
+ ])) : (Q(), ee("div", Ut, [
2071
+ ge(t.$slots, "loading")
2072
+ ]))
2073
+ ]);
2074
+ }
2075
+ const qt = /* @__PURE__ */ Lt(Dt, [["render", kt]]);
2076
+ class Mt {
2077
+ handleStateChange(e, r, n) {
1988
2078
  try {
1989
2079
  if (e.readyState === 4) {
1990
- var o = e.status, s = e.statusText;
1991
- if (o === 200) {
1992
- var a = (i = e.getResponseHeader("ETag")) !== null && i !== void 0 ? i : void 0;
1993
- r({ statusCode: o, reasonPhrase: s, eTag: a, body: e.responseText });
2080
+ const { status: i, statusText: o } = e;
2081
+ if (i === 200) {
2082
+ const s = e.getResponseHeader("ETag") ?? void 0;
2083
+ r({ statusCode: i, reasonPhrase: o, eTag: s, body: e.responseText });
1994
2084
  } else
1995
- o && r({ statusCode: o, reasonPhrase: s });
2085
+ i && r({ statusCode: i, reasonPhrase: o });
1996
2086
  }
1997
- } catch (u) {
1998
- n(u);
2087
+ } catch (i) {
2088
+ n(i);
1999
2089
  }
2000
- }, t.prototype.fetchLogic = function(e, r) {
2001
- var n = this;
2002
- return new Promise(function(i, o) {
2090
+ }
2091
+ fetchLogic(e) {
2092
+ return new Promise((r, n) => {
2003
2093
  try {
2004
2094
  e.logger.debug("HttpConfigFetcher.fetchLogic() called.");
2005
- var s = new XMLHttpRequest();
2006
- s.onreadystatechange = function() {
2007
- return n.handleStateChange(s, i, o);
2008
- }, s.ontimeout = function() {
2009
- return o(new ee("timeout", e.requestTimeoutMs));
2010
- }, s.onabort = function() {
2011
- return o(new ee("abort"));
2012
- }, s.onerror = function() {
2013
- return o(new ee("failure"));
2014
- }, s.open("GET", e.getUrl(), !0), s.timeout = e.requestTimeoutMs, s.send(null);
2015
- } catch (a) {
2016
- o(a);
2095
+ const i = new XMLHttpRequest();
2096
+ i.onreadystatechange = () => this.handleStateChange(i, r, n), i.ontimeout = () => n(new ie("timeout", e.requestTimeoutMs)), i.onabort = () => n(new ie("abort")), i.onerror = () => n(new ie("failure")), i.open("GET", e.getUrl(), !0), i.timeout = e.requestTimeoutMs, i.send(null);
2097
+ } catch (i) {
2098
+ n(i);
2017
2099
  }
2018
2100
  });
2019
- }, t;
2020
- }();
2021
- const kt = "8.0.2";
2022
- function ce(t, e, r) {
2023
- return Rt(t, e ?? U.AutoPoll, r, {
2024
- configFetcher: new Ft(),
2025
- sdkType: "ConfigCat-JS",
2026
- sdkVersion: kt,
2027
- defaultCacheFactory: function(n) {
2028
- return new qe(new Dt(), n.logger);
2101
+ }
2102
+ }
2103
+ class Vt {
2104
+ set(e, r) {
2105
+ try {
2106
+ localStorage.setItem(e, btoa(r));
2107
+ } catch {
2029
2108
  }
2030
- });
2109
+ }
2110
+ get(e) {
2111
+ try {
2112
+ const r = localStorage.getItem(e);
2113
+ if (r)
2114
+ return atob(r);
2115
+ } catch {
2116
+ }
2117
+ }
2031
2118
  }
2032
- const Vt = {
2119
+ const xt = "1.3.0", Wt = {
2033
2120
  install: (t, e) => {
2034
- let r = ce(
2035
- e.SDKKey,
2036
- U.AutoPoll,
2037
- e.clientOptions
2038
- );
2039
- e.pollingMode == "manual" && (r = ce(
2040
- e.SDKKey,
2041
- U.ManualPoll,
2042
- e.clientOptions
2043
- )), e.pollingMode == "lazy" && (r = ce(
2121
+ var a;
2122
+ const r = {
2123
+ client: void 0,
2124
+ clientReadyState: void 0
2125
+ }, n = (a = e.clientOptions) == null ? void 0 : a.setupHooks, i = {
2126
+ ...e.clientOptions,
2127
+ setupHooks: (c) => {
2128
+ c.once("clientReady", (u) => r.clientReadyState = u), n == null || n(c);
2129
+ }
2130
+ };
2131
+ let o = e.pollingMode === "manual" ? j.ManualPoll : e.pollingMode === "lazy" ? j.LazyLoad : j.AutoPoll;
2132
+ r.client = Nt(
2044
2133
  e.SDKKey,
2045
- U.LazyLoad,
2046
- e.clientOptions
2047
- )), t.config.globalProperties.configCatClient = r;
2134
+ o,
2135
+ i,
2136
+ {
2137
+ sdkType: "ConfigCat-Vue",
2138
+ sdkVersion: xt,
2139
+ configFetcher: new Mt(),
2140
+ defaultCacheFactory: (c) => new _e(new Vt(), c.logger)
2141
+ }
2142
+ ), t.config.globalProperties.$configCat = r;
2143
+ const s = t.unmount;
2144
+ t.unmount = function() {
2145
+ s.apply(this, arguments), configCatClient.close();
2146
+ };
2048
2147
  }
2049
2148
  };
2149
+ function Kt(t) {
2150
+ return Rt(t);
2151
+ }
2152
+ function zt(t, e) {
2153
+ return new at(new st(t), e);
2154
+ }
2050
2155
  export {
2051
- Vt as ConfigCatPlugin,
2052
- Ut as FeatureWrapper
2156
+ L as ClientReadyState,
2157
+ g as Comparator,
2158
+ Wt as ConfigCatPlugin,
2159
+ ue as DataGovernance,
2160
+ qt as FeatureWrapper,
2161
+ A as FormattableLogMessage,
2162
+ v as LogLevel,
2163
+ P as OverrideBehaviour,
2164
+ j as PollingMode,
2165
+ ae as RefreshResult,
2166
+ ne as SettingKeyValue,
2167
+ Se as SettingType,
2168
+ jt as User,
2169
+ Kt as createConsoleLogger,
2170
+ zt as createFlagOverridesFromMap
2053
2171
  };