fansunited-frontend-components 0.0.82 → 0.0.83

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.
@@ -0,0 +1,1043 @@
1
+ var Et = Object.create, Z = Object.defineProperty, pt = Object.getOwnPropertyDescriptor, ft = Object.getOwnPropertyNames, mt = Object.getPrototypeOf, Ot = Object.prototype.hasOwnProperty, Tt = (t, e) => () => (t && (e = t(t = 0)), e), q = (t, e) => () => (e || t((e = { exports: {} }).exports, e), e.exports), Rt = (t, e) => {
2
+ for (var s in e) Z(t, s, { get: e[s], enumerable: !0 });
3
+ }, At = (t, e, s, i) => {
4
+ if (e && typeof e == "object" || typeof e == "function") for (let l of ft(e)) !Ot.call(t, l) && l !== s && Z(t, l, { get: () => e[l], enumerable: !(i = pt(e, l)) || i.enumerable });
5
+ return t;
6
+ }, at = (t, e, s) => (s = t != null ? Et(mt(t)) : {}, At(!t || !t.__esModule ? Z(s, "default", { value: t, enumerable: !0 }) : s, t)), nt = {};
7
+ Rt(nt, { default: () => ot });
8
+ var st, ot, yt = Tt(() => {
9
+ st = { getItem: async () => null, setItem: async () => null, removeItem: async () => null, clear: async () => null, getAllKeys: async () => [], multiGet: async () => [], multiSet: async () => null, multiRemove: async () => null, mergeItem: async () => null, multiMerge: async () => null }, ot = st;
10
+ }), It = q((t, e) => {
11
+ var s = function() {
12
+ function i(_, f) {
13
+ return f != null && _ instanceof f;
14
+ }
15
+ var l;
16
+ try {
17
+ l = Map;
18
+ } catch {
19
+ l = function() {
20
+ };
21
+ }
22
+ var o;
23
+ try {
24
+ o = Set;
25
+ } catch {
26
+ o = function() {
27
+ };
28
+ }
29
+ var d;
30
+ try {
31
+ d = Promise;
32
+ } catch {
33
+ d = function() {
34
+ };
35
+ }
36
+ function r(_, f, I, v, L) {
37
+ typeof f == "object" && (I = f.depth, v = f.prototype, L = f.includeNonEnumerable, f = f.circular);
38
+ var S = [], D = [], V = typeof Buffer < "u";
39
+ typeof f > "u" && (f = !0), typeof I > "u" && (I = 1 / 0);
40
+ function g(a, u) {
41
+ if (a === null) return null;
42
+ if (u === 0) return a;
43
+ var h, m;
44
+ if (typeof a != "object") return a;
45
+ if (i(a, l)) h = new l();
46
+ else if (i(a, o)) h = new o();
47
+ else if (i(a, d)) h = new d(function(G, F) {
48
+ a.then(function(x) {
49
+ G(g(x, u - 1));
50
+ }, function(x) {
51
+ F(g(x, u - 1));
52
+ });
53
+ });
54
+ else if (r.__isArray(a)) h = [];
55
+ else if (r.__isRegExp(a)) h = new RegExp(a.source, O(a)), a.lastIndex && (h.lastIndex = a.lastIndex);
56
+ else if (r.__isDate(a)) h = new Date(a.getTime());
57
+ else {
58
+ if (V && Buffer.isBuffer(a)) return Buffer.allocUnsafe ? h = Buffer.allocUnsafe(a.length) : h = new Buffer(a.length), a.copy(h), h;
59
+ i(a, Error) ? h = Object.create(a) : typeof v > "u" ? (m = Object.getPrototypeOf(a), h = Object.create(m)) : (h = Object.create(v), m = v);
60
+ }
61
+ if (f) {
62
+ var R = S.indexOf(a);
63
+ if (R != -1) return D[R];
64
+ S.push(a), D.push(h);
65
+ }
66
+ i(a, l) && a.forEach(function(G, F) {
67
+ var x = g(F, u - 1), X = g(G, u - 1);
68
+ h.set(x, X);
69
+ }), i(a, o) && a.forEach(function(G) {
70
+ var F = g(G, u - 1);
71
+ h.add(F);
72
+ });
73
+ for (var T in a) {
74
+ var y;
75
+ m && (y = Object.getOwnPropertyDescriptor(m, T)), !(y && y.set == null) && (h[T] = g(a[T], u - 1));
76
+ }
77
+ if (Object.getOwnPropertySymbols) for (var C = Object.getOwnPropertySymbols(a), T = 0; T < C.length; T++) {
78
+ var P = C[T], b = Object.getOwnPropertyDescriptor(a, P);
79
+ b && !b.enumerable && !L || (h[P] = g(a[P], u - 1), b.enumerable || Object.defineProperty(h, P, { enumerable: !1 }));
80
+ }
81
+ if (L) for (var B = Object.getOwnPropertyNames(a), T = 0; T < B.length; T++) {
82
+ var H = B[T], b = Object.getOwnPropertyDescriptor(a, H);
83
+ b && b.enumerable || (h[H] = g(a[H], u - 1), Object.defineProperty(h, H, { enumerable: !1 }));
84
+ }
85
+ return h;
86
+ }
87
+ return g(_, I);
88
+ }
89
+ r.clonePrototype = function(_) {
90
+ if (_ === null) return null;
91
+ var f = function() {
92
+ };
93
+ return f.prototype = _, new f();
94
+ };
95
+ function p(_) {
96
+ return Object.prototype.toString.call(_);
97
+ }
98
+ r.__objToStr = p;
99
+ function n(_) {
100
+ return typeof _ == "object" && p(_) === "[object Date]";
101
+ }
102
+ r.__isDate = n;
103
+ function c(_) {
104
+ return typeof _ == "object" && p(_) === "[object Array]";
105
+ }
106
+ r.__isArray = c;
107
+ function E(_) {
108
+ return typeof _ == "object" && p(_) === "[object RegExp]";
109
+ }
110
+ r.__isRegExp = E;
111
+ function O(_) {
112
+ var f = "";
113
+ return _.global && (f += "g"), _.ignoreCase && (f += "i"), _.multiline && (f += "m"), f;
114
+ }
115
+ return r.__getRegExpFlags = O, r;
116
+ }();
117
+ typeof e == "object" && e.exports && (e.exports = s);
118
+ }), vt = q((t, e) => {
119
+ var s = typeof Reflect == "object" ? Reflect : null, i = s && typeof s.apply == "function" ? s.apply : function(a, u, h) {
120
+ return Function.prototype.apply.call(a, u, h);
121
+ }, l;
122
+ s && typeof s.ownKeys == "function" ? l = s.ownKeys : Object.getOwnPropertySymbols ? l = function(a) {
123
+ return Object.getOwnPropertyNames(a).concat(Object.getOwnPropertySymbols(a));
124
+ } : l = function(a) {
125
+ return Object.getOwnPropertyNames(a);
126
+ };
127
+ function o(a) {
128
+ console && console.warn && console.warn(a);
129
+ }
130
+ var d = Number.isNaN || function(a) {
131
+ return a !== a;
132
+ };
133
+ function r() {
134
+ r.init.call(this);
135
+ }
136
+ e.exports = r, e.exports.once = D, r.EventEmitter = r, r.prototype._events = void 0, r.prototype._eventsCount = 0, r.prototype._maxListeners = void 0;
137
+ var p = 10;
138
+ function n(a) {
139
+ if (typeof a != "function") throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof a);
140
+ }
141
+ Object.defineProperty(r, "defaultMaxListeners", { enumerable: !0, get: function() {
142
+ return p;
143
+ }, set: function(a) {
144
+ if (typeof a != "number" || a < 0 || d(a)) throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + a + ".");
145
+ p = a;
146
+ } }), r.init = function() {
147
+ (this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) && (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0;
148
+ }, r.prototype.setMaxListeners = function(a) {
149
+ if (typeof a != "number" || a < 0 || d(a)) throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + a + ".");
150
+ return this._maxListeners = a, this;
151
+ };
152
+ function c(a) {
153
+ return a._maxListeners === void 0 ? r.defaultMaxListeners : a._maxListeners;
154
+ }
155
+ r.prototype.getMaxListeners = function() {
156
+ return c(this);
157
+ }, r.prototype.emit = function(a) {
158
+ for (var u = [], h = 1; h < arguments.length; h++) u.push(arguments[h]);
159
+ var m = a === "error", R = this._events;
160
+ if (R !== void 0) m = m && R.error === void 0;
161
+ else if (!m) return !1;
162
+ if (m) {
163
+ var T;
164
+ if (u.length > 0 && (T = u[0]), T instanceof Error) throw T;
165
+ var y = new Error("Unhandled error." + (T ? " (" + T.message + ")" : ""));
166
+ throw y.context = T, y;
167
+ }
168
+ var C = R[a];
169
+ if (C === void 0) return !1;
170
+ if (typeof C == "function") i(C, this, u);
171
+ else for (var P = C.length, b = v(C, P), h = 0; h < P; ++h) i(b[h], this, u);
172
+ return !0;
173
+ };
174
+ function E(a, u, h, m) {
175
+ var R, T, y;
176
+ if (n(h), T = a._events, T === void 0 ? (T = a._events = /* @__PURE__ */ Object.create(null), a._eventsCount = 0) : (T.newListener !== void 0 && (a.emit("newListener", u, h.listener ? h.listener : h), T = a._events), y = T[u]), y === void 0) y = T[u] = h, ++a._eventsCount;
177
+ else if (typeof y == "function" ? y = T[u] = m ? [h, y] : [y, h] : m ? y.unshift(h) : y.push(h), R = c(a), R > 0 && y.length > R && !y.warned) {
178
+ y.warned = !0;
179
+ var C = new Error("Possible EventEmitter memory leak detected. " + y.length + " " + String(u) + " listeners added. Use emitter.setMaxListeners() to increase limit");
180
+ C.name = "MaxListenersExceededWarning", C.emitter = a, C.type = u, C.count = y.length, o(C);
181
+ }
182
+ return a;
183
+ }
184
+ r.prototype.addListener = function(a, u) {
185
+ return E(this, a, u, !1);
186
+ }, r.prototype.on = r.prototype.addListener, r.prototype.prependListener = function(a, u) {
187
+ return E(this, a, u, !0);
188
+ };
189
+ function O() {
190
+ if (!this.fired) return this.target.removeListener(this.type, this.wrapFn), this.fired = !0, arguments.length === 0 ? this.listener.call(this.target) : this.listener.apply(this.target, arguments);
191
+ }
192
+ function _(a, u, h) {
193
+ var m = { fired: !1, wrapFn: void 0, target: a, type: u, listener: h }, R = O.bind(m);
194
+ return R.listener = h, m.wrapFn = R, R;
195
+ }
196
+ r.prototype.once = function(a, u) {
197
+ return n(u), this.on(a, _(this, a, u)), this;
198
+ }, r.prototype.prependOnceListener = function(a, u) {
199
+ return n(u), this.prependListener(a, _(this, a, u)), this;
200
+ }, r.prototype.removeListener = function(a, u) {
201
+ var h, m, R, T, y;
202
+ if (n(u), m = this._events, m === void 0) return this;
203
+ if (h = m[a], h === void 0) return this;
204
+ if (h === u || h.listener === u) --this._eventsCount === 0 ? this._events = /* @__PURE__ */ Object.create(null) : (delete m[a], m.removeListener && this.emit("removeListener", a, h.listener || u));
205
+ else if (typeof h != "function") {
206
+ for (R = -1, T = h.length - 1; T >= 0; T--) if (h[T] === u || h[T].listener === u) {
207
+ y = h[T].listener, R = T;
208
+ break;
209
+ }
210
+ if (R < 0) return this;
211
+ R === 0 ? h.shift() : L(h, R), h.length === 1 && (m[a] = h[0]), m.removeListener !== void 0 && this.emit("removeListener", a, y || u);
212
+ }
213
+ return this;
214
+ }, r.prototype.off = r.prototype.removeListener, r.prototype.removeAllListeners = function(a) {
215
+ var u, h, m;
216
+ if (h = this._events, h === void 0) return this;
217
+ if (h.removeListener === void 0) return arguments.length === 0 ? (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0) : h[a] !== void 0 && (--this._eventsCount === 0 ? this._events = /* @__PURE__ */ Object.create(null) : delete h[a]), this;
218
+ if (arguments.length === 0) {
219
+ var R = Object.keys(h), T;
220
+ for (m = 0; m < R.length; ++m) T = R[m], T !== "removeListener" && this.removeAllListeners(T);
221
+ return this.removeAllListeners("removeListener"), this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0, this;
222
+ }
223
+ if (u = h[a], typeof u == "function") this.removeListener(a, u);
224
+ else if (u !== void 0) for (m = u.length - 1; m >= 0; m--) this.removeListener(a, u[m]);
225
+ return this;
226
+ };
227
+ function f(a, u, h) {
228
+ var m = a._events;
229
+ if (m === void 0) return [];
230
+ var R = m[u];
231
+ return R === void 0 ? [] : typeof R == "function" ? h ? [R.listener || R] : [R] : h ? S(R) : v(R, R.length);
232
+ }
233
+ r.prototype.listeners = function(a) {
234
+ return f(this, a, !0);
235
+ }, r.prototype.rawListeners = function(a) {
236
+ return f(this, a, !1);
237
+ }, r.listenerCount = function(a, u) {
238
+ return typeof a.listenerCount == "function" ? a.listenerCount(u) : I.call(a, u);
239
+ }, r.prototype.listenerCount = I;
240
+ function I(a) {
241
+ var u = this._events;
242
+ if (u !== void 0) {
243
+ var h = u[a];
244
+ if (typeof h == "function") return 1;
245
+ if (h !== void 0) return h.length;
246
+ }
247
+ return 0;
248
+ }
249
+ r.prototype.eventNames = function() {
250
+ return this._eventsCount > 0 ? l(this._events) : [];
251
+ };
252
+ function v(a, u) {
253
+ for (var h = new Array(u), m = 0; m < u; ++m) h[m] = a[m];
254
+ return h;
255
+ }
256
+ function L(a, u) {
257
+ for (; u + 1 < a.length; u++) a[u] = a[u + 1];
258
+ a.pop();
259
+ }
260
+ function S(a) {
261
+ for (var u = new Array(a.length), h = 0; h < u.length; ++h) u[h] = a[h].listener || a[h];
262
+ return u;
263
+ }
264
+ function D(a, u) {
265
+ return new Promise(function(h, m) {
266
+ function R(y) {
267
+ a.removeListener(u, T), m(y);
268
+ }
269
+ function T() {
270
+ typeof a.removeListener == "function" && a.removeListener("error", R), h([].slice.call(arguments));
271
+ }
272
+ g(a, u, T, { once: !0 }), u !== "error" && V(a, R, { once: !0 });
273
+ });
274
+ }
275
+ function V(a, u, h) {
276
+ typeof a.on == "function" && g(a, "error", u, h);
277
+ }
278
+ function g(a, u, h, m) {
279
+ if (typeof a.on == "function") m.once ? a.once(u, h) : a.on(u, h);
280
+ else if (typeof a.addEventListener == "function") a.addEventListener(u, function R(T) {
281
+ m.once && a.removeEventListener(u, R), h(T);
282
+ });
283
+ else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof a);
284
+ }
285
+ }), gt = q((t, e) => {
286
+ (function() {
287
+ var s, i, l = [].splice, o = function(r, p) {
288
+ if (!(r instanceof p)) throw new Error("Bound instance method accessed before binding");
289
+ }, d = [].indexOf;
290
+ i = It(), s = vt().EventEmitter, e.exports = (function() {
291
+ class r extends s {
292
+ constructor(n = {}) {
293
+ super(), this.get = this.get.bind(this), this.mget = this.mget.bind(this), this.set = this.set.bind(this), this.mset = this.mset.bind(this), this.del = this.del.bind(this), this.take = this.take.bind(this), this.ttl = this.ttl.bind(this), this.getTtl = this.getTtl.bind(this), this.keys = this.keys.bind(this), this.has = this.has.bind(this), this.getStats = this.getStats.bind(this), this.flushAll = this.flushAll.bind(this), this.flushStats = this.flushStats.bind(this), this.close = this.close.bind(this), this._checkData = this._checkData.bind(this), this._check = this._check.bind(this), this._isInvalidKey = this._isInvalidKey.bind(this), this._wrap = this._wrap.bind(this), this._getValLength = this._getValLength.bind(this), this._error = this._error.bind(this), this._initErrors = this._initErrors.bind(this), this.options = n, this._initErrors(), this.data = {}, this.options = Object.assign({ forceString: !1, objectValueSize: 80, promiseValueSize: 80, arrayValueSize: 40, stdTTL: 0, checkperiod: 600, useClones: !0, deleteOnExpire: !0, enableLegacyCallbacks: !1, maxKeys: -1 }, this.options), this.options.enableLegacyCallbacks && (console.warn("WARNING! node-cache legacy callback support will drop in v6.x"), ["get", "mget", "set", "del", "ttl", "getTtl", "keys", "has"].forEach((c) => {
294
+ var E;
295
+ E = this[c], this[c] = function(...O) {
296
+ var _, f, I, v;
297
+ if (I = O, [...O] = I, [_] = l.call(O, -1), typeof _ == "function") try {
298
+ v = E(...O), _(null, v);
299
+ } catch (L) {
300
+ f = L, _(f);
301
+ }
302
+ else return E(...O, _);
303
+ };
304
+ })), this.stats = { hits: 0, misses: 0, keys: 0, ksize: 0, vsize: 0 }, this.validKeyTypes = ["string", "number"], this._checkData();
305
+ }
306
+ get(n) {
307
+ var c, E;
308
+ if (o(this, r), (E = this._isInvalidKey(n)) != null) throw E;
309
+ if (this.data[n] != null && this._check(n, this.data[n])) return this.stats.hits++, c = this._unwrap(this.data[n]), c;
310
+ this.stats.misses++;
311
+ }
312
+ mget(n) {
313
+ var c, E, O, _, f, I;
314
+ if (o(this, r), !Array.isArray(n)) throw c = this._error("EKEYSTYPE"), c;
315
+ for (I = {}, O = 0, f = n.length; O < f; O++) {
316
+ if (_ = n[O], (E = this._isInvalidKey(_)) != null) throw E;
317
+ this.data[_] != null && this._check(_, this.data[_]) ? (this.stats.hits++, I[_] = this._unwrap(this.data[_])) : this.stats.misses++;
318
+ }
319
+ return I;
320
+ }
321
+ set(n, c, E) {
322
+ var O, _, f;
323
+ if (o(this, r), this.options.maxKeys > -1 && this.stats.keys >= this.options.maxKeys) throw O = this._error("ECACHEFULL"), O;
324
+ if (this.options.forceString, E == null && (E = this.options.stdTTL), (_ = this._isInvalidKey(n)) != null) throw _;
325
+ return f = !1, this.data[n] && (f = !0, this.stats.vsize -= this._getValLength(this._unwrap(this.data[n], !1))), this.data[n] = this._wrap(c, E), this.stats.vsize += this._getValLength(c), f || (this.stats.ksize += this._getKeyLength(n), this.stats.keys++), this.emit("set", n, c), !0;
326
+ }
327
+ mset(n) {
328
+ var c, E, O, _, f, I, v, L, S, D;
329
+ if (o(this, r), this.options.maxKeys > -1 && this.stats.keys + n.length >= this.options.maxKeys) throw c = this._error("ECACHEFULL"), c;
330
+ for (O = 0, v = n.length; O < v; O++) {
331
+ if (I = n[O], { key: f, val: D, ttl: S } = I, S && typeof S != "number") throw c = this._error("ETTLTYPE"), c;
332
+ if ((E = this._isInvalidKey(f)) != null) throw E;
333
+ }
334
+ for (_ = 0, L = n.length; _ < L; _++) I = n[_], { key: f, val: D, ttl: S } = I, this.set(f, D, S);
335
+ return !0;
336
+ }
337
+ del(n) {
338
+ var c, E, O, _, f, I;
339
+ for (o(this, r), Array.isArray(n) || (n = [n]), c = 0, O = 0, f = n.length; O < f; O++) {
340
+ if (_ = n[O], (E = this._isInvalidKey(_)) != null) throw E;
341
+ this.data[_] != null && (this.stats.vsize -= this._getValLength(this._unwrap(this.data[_], !1)), this.stats.ksize -= this._getKeyLength(_), this.stats.keys--, c++, I = this.data[_], delete this.data[_], this.emit("del", _, I.v));
342
+ }
343
+ return c;
344
+ }
345
+ take(n) {
346
+ var c;
347
+ return o(this, r), c = this.get(n), c != null && this.del(n), c;
348
+ }
349
+ ttl(n, c) {
350
+ var E;
351
+ if (o(this, r), c || (c = this.options.stdTTL), !n) return !1;
352
+ if ((E = this._isInvalidKey(n)) != null) throw E;
353
+ return this.data[n] != null && this._check(n, this.data[n]) ? (c >= 0 ? this.data[n] = this._wrap(this.data[n].v, c, !1) : this.del(n), !0) : !1;
354
+ }
355
+ getTtl(n) {
356
+ var c, E;
357
+ if (o(this, r), !!n) {
358
+ if ((E = this._isInvalidKey(n)) != null) throw E;
359
+ if (this.data[n] != null && this._check(n, this.data[n])) return c = this.data[n].t, c;
360
+ }
361
+ }
362
+ keys() {
363
+ var n;
364
+ return o(this, r), n = Object.keys(this.data), n;
365
+ }
366
+ has(n) {
367
+ var c;
368
+ return o(this, r), c = this.data[n] != null && this._check(n, this.data[n]), c;
369
+ }
370
+ getStats() {
371
+ return o(this, r), this.stats;
372
+ }
373
+ flushAll(n = !0) {
374
+ o(this, r), this.data = {}, this.stats = { hits: 0, misses: 0, keys: 0, ksize: 0, vsize: 0 }, this._killCheckPeriod(), this._checkData(n), this.emit("flush");
375
+ }
376
+ flushStats() {
377
+ o(this, r), this.stats = { hits: 0, misses: 0, keys: 0, ksize: 0, vsize: 0 }, this.emit("flush_stats");
378
+ }
379
+ close() {
380
+ o(this, r), this._killCheckPeriod();
381
+ }
382
+ _checkData(n = !0) {
383
+ var c, E, O;
384
+ o(this, r), E = this.data;
385
+ for (c in E) O = E[c], this._check(c, O);
386
+ n && this.options.checkperiod > 0 && (this.checkTimeout = setTimeout(this._checkData, this.options.checkperiod * 1e3, n), this.checkTimeout != null && this.checkTimeout.unref != null && this.checkTimeout.unref());
387
+ }
388
+ _killCheckPeriod() {
389
+ if (this.checkTimeout != null) return clearTimeout(this.checkTimeout);
390
+ }
391
+ _check(n, c) {
392
+ var E;
393
+ return o(this, r), E = !0, c.t !== 0 && c.t < Date.now() && (this.options.deleteOnExpire && (E = !1, this.del(n)), this.emit("expired", n, this._unwrap(c))), E;
394
+ }
395
+ _isInvalidKey(n) {
396
+ var c;
397
+ if (o(this, r), c = typeof n, d.call(this.validKeyTypes, c) < 0) return this._error("EKEYTYPE", { type: typeof n });
398
+ }
399
+ _wrap(n, c, E = !0) {
400
+ var O, _, f;
401
+ return o(this, r), this.options.useClones || (E = !1), _ = Date.now(), O = 0, f = 1e3, c === 0 ? O = 0 : c ? O = _ + c * f : this.options.stdTTL === 0 ? O = this.options.stdTTL : O = _ + this.options.stdTTL * f, { t: O, v: E ? i(n) : n };
402
+ }
403
+ _unwrap(n, c = !0) {
404
+ return this.options.useClones || (c = !1), n.v != null ? c ? i(n.v) : n.v : null;
405
+ }
406
+ _getKeyLength(n) {
407
+ return n.toString().length;
408
+ }
409
+ _getValLength(n) {
410
+ return o(this, r), typeof n == "string" ? n.length : this.options.forceString ? JSON.stringify(n).length : Array.isArray(n) ? this.options.arrayValueSize * n.length : typeof n == "number" ? 8 : typeof (n == null ? void 0 : n.then) == "function" ? this.options.promiseValueSize : typeof Buffer < "u" && Buffer !== null && Buffer.isBuffer(n) ? n.length : n != null && typeof n == "object" ? this.options.objectValueSize * Object.keys(n).length : typeof n == "boolean" ? 8 : 0;
411
+ }
412
+ _error(n, c = {}) {
413
+ var E;
414
+ return o(this, r), E = new Error(), E.name = n, E.errorcode = n, E.message = this.ERRORS[n] != null ? this.ERRORS[n](c) : "-", E.data = c, E;
415
+ }
416
+ _initErrors() {
417
+ var n, c, E;
418
+ o(this, r), this.ERRORS = {}, E = this._ERRORS;
419
+ for (c in E) n = E[c], this.ERRORS[c] = this.createErrorMessage(n);
420
+ }
421
+ createErrorMessage(n) {
422
+ return function(c) {
423
+ return n.replace("__key", c.type);
424
+ };
425
+ }
426
+ }
427
+ return r.prototype._ERRORS = { ENOTFOUND: "Key `__key` not found", ECACHEFULL: "Cache max keys amount exceeded", EKEYTYPE: "The key argument has to be of type `string` or `number`. Found: `__key`", EKEYSTYPE: "The keys argument has to be an array.", ETTLTYPE: "The ttl argument has to be a number." }, r;
428
+ }).call(this);
429
+ }).call(t);
430
+ }), lt = q((t, e) => {
431
+ (function() {
432
+ var s;
433
+ s = e.exports = gt(), s.version = "5.1.2";
434
+ }).call(t);
435
+ }), Ct = ((t) => (t.EN = "en", t.BG = "bg", t.RO = "ro", t.EL = "el", t.SK = "sk", t.PT = "pt", t.SR = "sr", t.HU = "hu", t.SV = "sv", t.ES = "es", t.FR = "fr", t.NL = "nl", t.DE = "de", t.IT = "it", t.AR = "ar", t))(Ct || {}), Lt = ((t) => (t.DEV = "dev", t.PROD = "prod", t.STAGING = "staging", t))(Lt || {}), St = ((t) => (t.NATIVE = "native", t.ENETPULSE = "enetpulse", t.SPORTRADAR = "sportradar", t.SPORTAL_365 = "sportal365", t.API_FOOTBALL = "api_football", t.STATSCORE = "statscore", t))(St || {}), Nt = ((t) => (t.DEFAULT = "default", t.STANDARD = "standard", t))(Nt || {}), Dt = (t) => {
436
+ var o;
437
+ if (!t) return "";
438
+ let e = [];
439
+ typeof document > "u" ? e = (((o = t.requestHeaders) == null ? void 0 : o.get("cookie")) || "").split(";") : e = document.cookie.split(";");
440
+ let s = e.find((d) => d.trim().startsWith(`${t.name}=`));
441
+ if (!s) return "";
442
+ let i = s.split("=")[1].trim(), l = decodeURIComponent(i);
443
+ try {
444
+ let d = JSON.parse(l);
445
+ return d.token || d || "";
446
+ } catch {
447
+ return l;
448
+ }
449
+ }, wt = ((t) => (t.FT_1X2 = "FT_1X2", t.HT_1X2 = "HT_1X2", t.BOTH_TEAMS_SCORE = "BOTH_TEAMS_SCORE", t.DOUBLE_CHANCE = "DOUBLE_CHANCE", t.HT_FT = "HT_FT", t.PLAYER_SCORE = "PLAYER_SCORE", t.PLAYER_YELLOW_CARD = "PLAYER_YELLOW_CARD", t.PLAYER_RED_CARD = "PLAYER_RED_CARD", t.RED_CARD_MATCH = "RED_CARD_MATCH", t.PENALTY_MATCH = "PENALTY_MATCH", t.PLAYER_SCORE_FIRST_GOAL = "PLAYER_SCORE_FIRST_GOAL", t.CORNERS_MATCH = "CORNERS_MATCH", t.CORRECT_SCORE = "CORRECT_SCORE", t.CORRECT_SCORE_ADVANCED = "CORRECT_SCORE_ADVANCED", t.CORRECT_SCORE_HT = "CORRECT_SCORE_HT", t.PLAYER_SCORE_HATTRICK = "PLAYER_SCORE_HATTRICK", t.PLAYER_SCORE_TWICE = "PLAYER_SCORE_TWICE", t.OVER_GOALS_0_5 = "OVER_GOALS_0_5", t.OVER_GOALS_1_5 = "OVER_GOALS_1_5", t.OVER_GOALS_2_5 = "OVER_GOALS_2_5", t.OVER_GOALS_3_5 = "OVER_GOALS_3_5", t.OVER_GOALS_4_5 = "OVER_GOALS_4_5", t.OVER_GOALS_5_5 = "OVER_GOALS_5_5", t.OVER_GOALS_6_5 = "OVER_GOALS_6_5", t.OVER_CORNERS_6_5 = "OVER_CORNERS_6_5", t.OVER_CORNERS_7_5 = "OVER_CORNERS_7_5", t.OVER_CORNERS_8_5 = "OVER_CORNERS_8_5", t.OVER_CORNERS_9_5 = "OVER_CORNERS_9_5", t.OVER_CORNERS_10_5 = "OVER_CORNERS_10_5", t.OVER_CORNERS_11_5 = "OVER_CORNERS_11_5", t.OVER_CORNERS_12_5 = "OVER_CORNERS_12_5", t.OVER_CORNERS_13_5 = "OVER_CORNERS_13_5", t))(wt || {});
450
+ function Q(t) {
451
+ this.message = t;
452
+ }
453
+ Q.prototype = new Error(), Q.prototype.name = "InvalidCharacterError";
454
+ var it = typeof window < "u" && window.atob && window.atob.bind(window) || function(t) {
455
+ var e = String(t).replace(/=+$/, "");
456
+ if (e.length % 4 == 1) throw new Q("'atob' failed: The string to be decoded is not correctly encoded.");
457
+ for (var s, i, l = 0, o = 0, d = ""; i = e.charAt(o++); ~i && (s = l % 4 ? 64 * s + i : i, l++ % 4) ? d += String.fromCharCode(255 & s >> (-2 * l & 6)) : 0) i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(i);
458
+ return d;
459
+ };
460
+ function bt(t) {
461
+ var e = t.replace(/-/g, "+").replace(/_/g, "/");
462
+ switch (e.length % 4) {
463
+ case 0:
464
+ break;
465
+ case 2:
466
+ e += "==";
467
+ break;
468
+ case 3:
469
+ e += "=";
470
+ break;
471
+ default:
472
+ throw "Illegal base64url string!";
473
+ }
474
+ try {
475
+ return function(s) {
476
+ return decodeURIComponent(it(s).replace(/(.)/g, function(i, l) {
477
+ var o = l.charCodeAt(0).toString(16).toUpperCase();
478
+ return o.length < 2 && (o = "0" + o), "%" + o;
479
+ }));
480
+ }(e);
481
+ } catch {
482
+ return it(e);
483
+ }
484
+ }
485
+ function z(t) {
486
+ this.message = t;
487
+ }
488
+ function Pt(t, e) {
489
+ if (typeof t != "string") throw new z("Invalid token specified");
490
+ var s = (e = e || {}).header === !0 ? 0 : 1;
491
+ try {
492
+ return JSON.parse(bt(t.split(".")[s]));
493
+ } catch (i) {
494
+ throw new z("Invalid token specified: " + i.message);
495
+ }
496
+ }
497
+ z.prototype = new Error(), z.prototype.name = "InvalidTokenError";
498
+ var rt = Pt, Mt = ((t) => (t[t.BAD_METHOD_CALL = 400] = "BAD_METHOD_CALL", t[t.UNAUTHORIZED = 401] = "UNAUTHORIZED", t[t.NOT_FOUND = 404] = "NOT_FOUND", t[t.PRECONDITION_FAILED = 412] = "PRECONDITION_FAILED", t))(Mt || {}), Vt = ((t) => (t.INVALID_TEMPLATE = "INVALID_TEMPLATE", t.INVALID_PREDICTION = "INVALID_PREDICTION", t.INVALID_MARKET = "INVALID_MARKET", t.INVALID_FIELD = "INVALID_FIELD", t.INVALID_TYPE = "INVALID_TYPE", t.EXCEEDED_LENGTH = "EXCEEDED_LENGTH", t.INVALID_TOKEN = "invalid_token", t.UNAUTHORIZED = "unauthorized", t.INVALID_FILTERS = "invalid_filters", t.INVALID_AVATAR = "invalid_avatar", t.INVALID_METHOD_CALL = "invalid_method_call", t.INVALID_LIMIT = "invalid_limit", t.INVALID_TEMPLATE_GROUP_ID = "invalid_template_group_id", t.INVALID_TEMPLATE_GROUP_FILTERS = "invalid_template_group_filters", t.INVALID_PAGE_NUMBER = "invalid_page_number", t.INVALID_DISCUSSION_IDS = "invalid_discussion_ids", t.ID_MAPPING_NOT_FOUND = "id_mapping_not_found", t.INVALID_COMPETITION_ID = "invalid_competition_id", t.INVALID_TEAM_ID = "invalid_team_id", t.INVALID_IDS = "invalid_ids", t.INVALID_INPUT_PROVIDER = "invalid_input_provider", t.INVALID_OUTPUT_PROVIDER = "invalid_output_provider", t.INVALID_MATCH_SUMMARY = "invalid_match_summary", t.INVALID_MATCH_SUMMARY_PREDICTIONS = "invalid_match_summary_predictions", t.INVALID_MATCH_SUMMARY_PREDICTIONS_KEYS = "invalid_match_summary_predictions_keys", t.ENTITY_IDS_NOT_FOUND = "entity_ids_not_found", t.MATCH_IDS_NOT_FOUND = "match_ids_not_found", t.INVALID_MATCH_IDS = "invalid_match_ids", t.INVALID_MATCH_ID = "invalid_match_id", t.INVALID_DATE_RANGE = "invalid_date_range", t.ODDS_NOT_FOUND = "odds_not_found", t))(Vt || {}), W = { native: "id", sportradar: "sportradar_id", sportal365: "sportal365_id", enetpulse: "enetpulse_id", api_football: "api_football_id", statscore: "statscore_id" };
499
+ (/* @__PURE__ */ new Map()).set("FT_1X2", "fullTimeOneXTwo").set("HT_1X2", "halfTimeOneXTwo").set("BOTH_TEAMS_SCORE", "bothTeamsScore").set("DOUBLE_CHANCE", "doubleChance").set("HT_FT", "halfTimeFullTime").set("PLAYER_SCORE", "playerScore").set("PLAYER_YELLOW_CARD", "playerYellowCard").set("PLAYER_RED_CARD", "playerRedCard").set("RED_CARD_MATCH", "redCardMatch").set("PENALTY_MATCH", "penaltyMatch").set("PLAYER_SCORE_FIRST_GOAL", "playerScoreFirstGoal").set("CORNERS_MATCH", "cornersMatch").set("CORRECT_SCORE", "correctScore").set("CORRECT_SCORE_ADVANCED", "correctScoreAdvanced").set("CORRECT_SCORE_HT", "correctScoreHalfTime").set("PLAYER_SCORE_HATTRICK", "playerScoreHattrick").set("PLAYER_SCORE_TWICE", "playerScoreTwice").set("OVER_GOALS_0_5", "overZeroPointFiveGoals").set("OVER_GOALS_1_5", "overOnePointFiveGoals").set("OVER_GOALS_2_5", "overTwoPointFiveGoals").set("OVER_GOALS_3_5", "overThreePointFiveGoals").set("OVER_GOALS_4_5", "overFourPointFiveGoals").set("OVER_GOALS_5_5", "overFivePointFiveGoals").set("OVER_GOALS_6_5", "overSixPointFiveGoals").set("OVER_CORNERS_6_5", "overSixPointFiveCorners").set("OVER_CORNERS_7_5", "overSevenPointFiveCorners").set("OVER_CORNERS_8_5", "overEightPointFiveCorners").set("OVER_CORNERS_9_5", "overNinePointFiveCorners").set("OVER_CORNERS_10_5", "overTenPointFiveCorners").set("OVER_CORNERS_11_5", "overElevenPointFiveCorners").set("OVER_CORNERS_12_5", "overTwelvePointFiveCorners").set("OVER_CORNERS_13_5", "overThirteenPointFiveCorners");
500
+ var kt = ((t) => (t.INVALID_MATCH_ID = "Match id is invalid!", t.INVALID_PLAYER_ID = "Player id is invalid!", t.QUERY_PARAM_MATCH_IDS_EXCEEDED = "Maximum matchIds in PredictionFilters should be 10 or less.", t.QUERY_PARAM_FILTERS_LIMIT_EXCEEDED = "Maximum limit for filtering games is 50 or less.", t.INVALID_FIXTURES_FIELD = "Fixtures field is invalid. For more information please visit our documentation", t.INVALID_TOKEN = "Invalid JWT token is provided", t.EXPIRED_TOKEN = "The provided JWT token is expired", t.ENTITIES_NEEDED = "At least one of footballCompetitions, footballTeams or footballPlayers properties should be provided for filters.", t.ENTITIES_FOLLOWS_FILTERS_EXCEEDED = "Maximum length per entity should be 24 or less.", t.INVALID_TYPE = "You have provided invalid type. The valid type is ", t.INVALID_VALUE = "You have provided invalid value. The valid value is ", t.INVALID_AVATAR = "Invalid URL syntax for avatar image.", t.INVALID_GET_PROFILES_METHOD_CALL = "The method 'getByIds' from Profile namespace is not called correctly. You need to provide 'profileIds' OR 'search' parameters to the method, but you can't use both of them or neither of them.", t.INVALID_LIMIT = "Invalid limit. The maximum limit is: ", t.INVALID_LIMIT_TYPE = "Invalid limit type. The proper type is number.", t.FILTER_COMBINATION_ERROR = "You need to use both 'entityIds' and 'entityType' filters together", t.INVALID_ENTITY_TYPE = "Invalid 'entityType' filter. Please use one of the following valid options: competition, team, or player", t.INVALID_TEMPLATE_GROUP_ID = "There is no group in this template with the provided groupId", t.INVALID_TEMPLATE_GROUP_FILTERS = "The provided template group has no filters", t.INVALID_PAGE_NUMBER = "Invalid page number provided. Use number between 1 and max number of pages.", t.INVALID_DISCUSSION_IDS = "Invalid discussion ids argument. Please provide at least one discussion id in an array", t.EXCEEDED_DISCUSSION_IDS = "Maximum number of discussion ids exceeded. The maximum number of discussion ids is 50. You can use 'getPostsCountExtended' method for more than 50 discussion ids.", t.EXCEEDED_EXTENDED_DISCUSSION_IDS = "Maximum number of discussion ids exceeded. The maximum number of discussion ids is: ", t.ID_MAPPING_NOT_FOUND = "No ID mappings are available for the provided ID. ID argument: ", t.INVALID_PARAM = "Invalid parameter provided. Please check the following parameter: ", t.INVALID_COMPETITION_ID = "Invalid competition ID provided. Please provide a valid competition ID.", t.INVALID_TEAM_ID = "Invalid team ID provided. Please provide a valid team ID.", t.INVALID_OR_EMPTY_IDS = "Invalid or empty IDs provided. Please provide at least one ID.", t.INVALID_PROVIDER = "Invalid provider. The valid providers are: 'native', 'enetpulse', 'sportal365', 'sportradar' and 'api_football'.", t.INVALID_OUTPUT_PROVIDER = "Invalid output provider. The output can not be the same as the input provider.", t.MATCH_SUMMARY_REQUIRED = "Match summary is required.", t.MATCH_SUMMARY_PREDICTIONS_REQUIRED = "Predictions in match summary are required.", t.INVALID_MATCH_SUMMARY_PREDICTIONS_KEYS = "Keys in predictions in match summary are invalid. The valid ones are: ", t.INVALID_COLLECT_LEAD_METHOD_CALL = "The method 'collectLead' from Profile namespace is not called correctly. You need to provide 'requestBody' parameter to the method.", t.REQUIRED_FIXTURES_FIELD = "Fixtures field is required and should contain at least one fixtures object. For more information please visit our documentation", t.INVALID_TIEBREAKER_FIELD = "Tiebreaker field is invalid. It should contain statTotal key with integer value. For more information please visit our documentation", t.ENTITY_IDS_NOT_FOUND = "Some of the sport entity IDs were not found for the provided id schema", t.MATCH_IDS_NOT_FOUND = "Some of the match IDs were not found for the provided id schema", t.INVALID_STANDING_PREDICTION_ARGUMENT = "The prediction argument is invalid. For more information please visit our documentation", t.INVALID_MAP_PLAYERS_ROLES_KEYS = "The keys in the players roles map are not part of the valid keys. The valid keys are: ", t.INVALID_MAP_PLAYERS_ROLES_VALUES = "The values in the map are not valid. The valid ones are: ", t.INVALID_MATCH_IDS = "Match IDs are invalid!", t.MISSING_ODDS_DATE_RANGE = "The filters 'dateFrom' and 'dateTo' are required when fetching odds by date range", t.INVALID_ODDS_DATE_RANGE = "The odds date range is invalid. 'dateFrom' and 'dateTo' must be ISO 8601 datetimes and 'dateTo' must be after 'dateFrom'", t.ODDS_DATE_RANGE_EXCEEDED = "The odds date range must not exceed 7 days", t.ODDS_NOT_FOUND = "No odds found for the given event_id", t.INVALID_COLLECT_CONSENTS_METHOD_CALL = "The method 'collectConsents' from Profile namespace is not called correctly. You need to provide 'consents' parameter to the method.", t))(kt || {}), $ = class {
501
+ constructor(t, e) {
502
+ this.data = { error: { code: 0, status: "", message: "" } }, this.status = 0, this.statusText = "", this.headers = null, this.errorMessage = () => this.data.error.message, this.data.error.code = e.code, this.data.error.status = e.status, this.data.error.message = e.message, this.status = t.status, this.statusText = t.statusText, this.headers = t.headers;
503
+ }
504
+ }, J = class {
505
+ constructor(t, e, s) {
506
+ this.error = { code: 0, status: "", message: "" }, this.error.code = t, this.error.status = e, this.error.message = s;
507
+ }
508
+ }, Y;
509
+ Y = class {
510
+ constructor(e, s) {
511
+ this.baseUrl = null, this.apiSignInUrl = null, this.jwtToken = null, this.idSchema = null, this.retryRequest = !1, this.headers = null, this.authHeaders = null, this.errorHandlingMode = null, this.configuration = null, this.getJwtToken = () => {
512
+ var i;
513
+ return this.configuration.cookieToken ? Dt(this.configuration.cookieToken) : ((i = this.configuration.authProvider) == null ? void 0 : i.getIdToken()) || "";
514
+ }, this.getAuthHeaders = () => ({ "Content-Type": "application/json", Authorization: `Bearer ${this.getJwtToken()}` }), this.fetchWithoutAuth = async (i, l, o, d) => {
515
+ let r = null;
516
+ d ? r = await fetch(this.baseUrl + i, { headers: this.headers, method: o || "GET", body: JSON.stringify(d) }) : r = await fetch(this.baseUrl + i, { headers: this.headers, method: o || "GET" });
517
+ let p = await r.json();
518
+ if (!r.ok) {
519
+ let n = this.transformFetchException(r, p);
520
+ throw console.warn(l, n), n;
521
+ }
522
+ return p;
523
+ }, this.fetchConditional = async (i, l, o) => {
524
+ let d = { ...this.headers };
525
+ o != null && o.lastModified && (d["If-Modified-Since"] = o.lastModified);
526
+ let r = await fetch(this.baseUrl + i, { headers: d }), p = this.computeExpiresAt(r), n = r.headers.get("last-modified");
527
+ if (r.status === 304) return { status: 304, data: null, lastModified: n || (o == null ? void 0 : o.lastModified) || null, expiresAt: p };
528
+ let c = await r.json();
529
+ if (!r.ok) {
530
+ let E = this.transformFetchException(r, c);
531
+ throw console.warn(l, E), E;
532
+ }
533
+ return { status: r.status, data: c, lastModified: n, expiresAt: p };
534
+ }, this.computeExpiresAt = (i) => {
535
+ let l = Date.now(), o = i.headers.get("expires"), d = i.headers.get("date");
536
+ if (o) {
537
+ let r = Date.parse(o), p = d ? Date.parse(d) : NaN;
538
+ if (!isNaN(r)) {
539
+ let n = isNaN(p) ? r - l : r - p;
540
+ if (n > 0) return l + n;
541
+ }
542
+ }
543
+ return l + Y.DEFAULT_TTL_MS;
544
+ }, this.fetchWithoutAuthAdditionalHeaders = async (i, l, o) => {
545
+ let d = await fetch(this.baseUrl + i, { headers: { ...this.headers, ...o } }), r = await d.json();
546
+ if (!d.ok) {
547
+ let p = this.transformFetchException(d, r);
548
+ throw console.warn(l, p), p;
549
+ }
550
+ return r;
551
+ }, this.fetchWithAuth = async (i, l, o, d) => {
552
+ this.validateJWTToken();
553
+ let r = null, p = null;
554
+ if (o && d ? r = await fetch(this.baseUrl + i, { method: o, headers: this.getAuthHeaders(), body: JSON.stringify(d) }) : o && !d ? r = await fetch(this.baseUrl + i, { method: o, headers: this.getAuthHeaders() }) : r = await fetch(this.baseUrl + i, { headers: this.getAuthHeaders() }), o !== "DELETE" && (p = await r.json()), !r.ok) {
555
+ (r.status === 401 || r.status === 403) && !this.retryRequest && (this.retryRequest = !0, await this.fetchWithAuth(i, l, o, d)), this.retryRequest = !1;
556
+ let n = this.transformFetchException(r, p || await r.json());
557
+ throw console.warn(l, n), n;
558
+ }
559
+ return this.retryRequest = !1, p;
560
+ }, this.fetchWithAuthNewBaseURL = async (i, l, o, d, r) => {
561
+ this.validateJWTToken();
562
+ let p = null, n = null;
563
+ if (d && r ? p = await fetch(i + l, { method: d, headers: this.getAuthHeaders(), body: JSON.stringify(r) }) : d && !r ? p = await fetch(i + l, { method: d, headers: this.getAuthHeaders() }) : p = await fetch(i + l, { headers: this.getAuthHeaders() }), d !== "DELETE" && (n = await p.json()), !p.ok) {
564
+ (p.status === 401 || p.status === 403) && !this.retryRequest && (this.retryRequest = !0, await this.fetchWithAuthNewBaseURL(i, l, o, d, r)), this.retryRequest = !1;
565
+ let c = this.transformFetchException(p, n || await p.json());
566
+ throw console.warn(o, c), c;
567
+ }
568
+ return this.retryRequest = !1, n;
569
+ }, this.transformFetchException = (i, l) => {
570
+ if (!l && i.status === 401) {
571
+ if (this.errorHandlingMode === "standard") return new J(401, "unauthorized", "Invalid JWT token is provided");
572
+ let p = { code: 401, status: "unauthorized", message: "Invalid JWT token is provided" };
573
+ return new $(i, p);
574
+ }
575
+ let { code: o, status: d, message: r } = l.error;
576
+ return this.errorHandlingMode === "standard" ? new J(o, d, r) : new $(i, l.error);
577
+ }, this.validateJWTToken = () => {
578
+ let i = null;
579
+ try {
580
+ i = rt(this.getJwtToken());
581
+ } catch (l) {
582
+ if (this.errorHandlingMode === "default") {
583
+ let o = { status: 401, statusText: l.message, headers: {} }, d = { code: 401, status: "invalid_token", message: "Invalid JWT token is provided" };
584
+ throw new $(o, d);
585
+ } else if (this.errorHandlingMode === "standard") throw new J(401, "invalid_token", "Invalid JWT token is provided");
586
+ }
587
+ if (Date.now() > i.exp * 1e3) {
588
+ if (this.errorHandlingMode === "default") {
589
+ let l = { status: 401, statusText: "", headers: {} }, o = { code: 401, status: "invalid_token", message: "The provided JWT token is expired" };
590
+ throw new $(l, o);
591
+ } else if (this.errorHandlingMode === "standard") throw new J(401, "invalid_token", "The provided JWT token is expired");
592
+ }
593
+ }, this.extractUserIdFromToken = () => {
594
+ var i;
595
+ try {
596
+ return ((i = rt(this.getJwtToken())) == null ? void 0 : i.sub) || "";
597
+ } catch (l) {
598
+ return console.error(l), "";
599
+ }
600
+ }, this.baseUrl = s, this.configuration = e, this.apiSignInUrl = `?key=${e.apiKey}&client_id=${e.clientId}`, this.errorHandlingMode = e.errorHandlingMode, this.idSchema = e.idSchema, this.headers = { "Content-Type": "application/json" };
601
+ }
602
+ }, Y.DEFAULT_TTL_MS = 6e5;
603
+ var Gt = ((t) => (t.LIKE = "like", t.DISLIKE = "dislike", t.PAGE_VIEW = "page_view", t.CONTENT_CONSUMED = "content_consumed", t.SHARE = "share", t.COMMENT = "comment", t.CLICK_AD = "click_ad", t.PREDICTION_MADE = "prediction_made", t.CONVERT = "convert", t.MANAGE_INTERESTS = "manage_interests", t.GAME_PARTICIPATION = "game_participation", t.ARTICLE_CONSUMED = "article_consumed", t.VIDEO_CONSUMED = "video_consumed", t.SHORT_VIDEO_CONSUMED = "short_video_consumed", t.LONG_VIDEO_CONSUMED = "long_video_consumed", t.AUDIO_CONSUMED = "audio_consumed", t.GALLERY_CONSUMED = "gallery_consumed", t.IMAGE_CONSUMED = "image_consumed", t.POLL_PARTICIPATION = "poll_participation", t))(Gt || {}), Ft = at(lt()), A;
604
+ A = class {
605
+ constructor(e) {
606
+ this.profileTTL = 600, this.clientTTL = 14400, this.profileBadgesTTL = 3600, this.idMappingsExpiration = 0, this.idSchema = "", this.clearData = async () => A.nodeCache.flushAll(), this.getEntityById = async (s, i) => {
607
+ let l = A.nodeCache.get("ids");
608
+ return l ? l.find((o) => {
609
+ let d = W[this.idSchema];
610
+ return o && `${o[d]}` === i && o.resource === s;
611
+ }) : null;
612
+ }, this.getEntity = async (s, i, l) => {
613
+ let o = A.nodeCache.get("ids");
614
+ return o ? Array.isArray(s) ? [] : null : Array.isArray(s) ? o.filter((d) => {
615
+ let r = W[l];
616
+ return d && s.includes(`${d[r]}`) && d.resource === i;
617
+ }) : o.find((d) => {
618
+ let r = W[l];
619
+ return d && `${d[r]}` === s && d.resource === i;
620
+ });
621
+ }, this.checkForExistingIdObjs = async (s, i) => {
622
+ let l = W[i], o = {};
623
+ for (let d of Object.keys(s)) {
624
+ let r = s[d], p = (await this.getEntity(r, d, i)).map((c) => c[l]), n = s[d].filter((c) => !p.includes(c));
625
+ o[d] = r.map((c) => n.includes(c) ? { id: c, exists: !1 } : { id: c, exists: !0 });
626
+ }
627
+ return o;
628
+ }, this.getIdsByType = async (s, i, l) => {
629
+ let o = W[l], d = W[i], r = A.nodeCache.get("ids"), p = {};
630
+ return r ? (Object.keys(s).forEach((n) => {
631
+ let c = s[n], E = [];
632
+ r.forEach((O) => {
633
+ c.forEach((_, f) => {
634
+ _ === O[d] && n === O.resource && (E[f] = O[o]);
635
+ });
636
+ }), p[n] = E;
637
+ }), p) : null;
638
+ }, this.addIdMapping = async (s) => {
639
+ let i = A.nodeCache.get("ids");
640
+ i.push(s), A.nodeCache.set("ids", i);
641
+ }, this.addIdMappings = async (s) => {
642
+ let i = A.nodeCache.get("ids");
643
+ i = [...i, ...s], A.nodeCache.set("ids", i);
644
+ }, this.addTopIdMappings = async (s) => {
645
+ let i = A.nodeCache.get("ids"), l = 604800;
646
+ if (i) {
647
+ let o = JSON.parse(JSON.stringify(i));
648
+ o = o.filter((d) => d.resource !== "match"), s = s.filter((d) => d.resource === "match"), o = [...o, ...s], A.nodeCache.set("ids", o);
649
+ } else A.nodeCache.set("ids", s);
650
+ this.idMappingsExpiration = Math.floor(Date.now() / 1e3) + l;
651
+ }, this.setOwnProfile = async (s) => {
652
+ A.nodeCache.set("profile", s, this.profileTTL);
653
+ }, this.getOwnProfile = async () => A.nodeCache.get("profile"), this.getProfileCountries = async () => A.nodeCache.get("profile_countries"), this.setProfileCountries = async (s) => {
654
+ A.nodeCache.set("profile_countries", s);
655
+ }, this.getProfileStats = async () => A.nodeCache.get("profile_stats"), this.setProfileStats = async (s) => {
656
+ A.nodeCache.set("profile_stats", s, this.profileTTL);
657
+ }, this.getProfileBadges = async () => A.nodeCache.get("profile_badges"), this.setProfileBadges = async (s) => {
658
+ A.nodeCache.set("profile_badges", s, this.profileBadgesTTL);
659
+ }, this.getFootballCountries = async () => A.nodeCache.get("football_countries"), this.setFootballCountries = async (s) => {
660
+ A.nodeCache.set("football_countries", s);
661
+ }, this.getCompetitions = async (s) => {
662
+ let i = A.nodeCache.get("football_competitions");
663
+ return i ? s ? s.competitionSearchFilter(i) : i : null;
664
+ }, this.setCompetitions = async (s) => {
665
+ A.nodeCache.set("football_competitions", s);
666
+ }, this.getCompetitionsLength = async () => {
667
+ let s = A.nodeCache.get("football_competitions");
668
+ return s ? s.length : 0;
669
+ }, this.getClientFeatures = async () => A.nodeCache.get("client"), this.setClientFeatures = async (s) => {
670
+ A.nodeCache.set("client", s, this.clientTTL);
671
+ }, this.deleteClientFeatures = async () => {
672
+ A.nodeCache.del("client");
673
+ }, this.getExpiration = async (s, i) => {
674
+ let l = this.getKeyFromExpirationType(i);
675
+ return l === "ids" ? this.idMappingsExpiration : A.nodeCache.getTtl(l);
676
+ }, this.getKeyFromExpirationType = (s) => {
677
+ switch (s) {
678
+ case "profile":
679
+ return "profile";
680
+ case "statistics":
681
+ return "profile_stats";
682
+ case "badges":
683
+ return "profile_badges";
684
+ case "features":
685
+ return "client";
686
+ case "ids":
687
+ return "ids";
688
+ }
689
+ };
690
+ }
691
+ static getInstance(e) {
692
+ return A.instance || (A.instance = new A(e), A.nodeCache.options.useClones = !1), A.instance;
693
+ }
694
+ }, A.nodeCache = new Ft.default();
695
+ var xt = ((t) => (t.ACTIVE = "ACTIVE", t.WON = "WON", t.LOST = "LOST", t.PARTIALLY_WON = "PARTIALLY_WON", t.CANCELED = "CANCELED", t))(xt || {}), Ut = ((t) => (t.ACTIVE = "ACTIVE", t.WON = "WON", t.LOST = "LOST", t.PARTIALLY_WON = "PARTIALLY_WON", t.CANCELED = "CANCELED", t))(Ut || {}), _e = class {
696
+ constructor() {
697
+ this.id = null, this.title = null, this.description = null, this.images = null, this.rules = null, this.customFields = null, this.type = "EVENT", this.status = null, this.related = [], this.tiebreaker = null, this.predictionsCutoff = null, this.fixtures = [], this.flags = null, this.language = null, this.branding = null, this.brandingId = null, this.createdAt = null, this.updatedAt = null;
698
+ }
699
+ }, Ht = ((t) => (t.BOOLEAN = "BOOLEAN", t.NUMBER = "NUMBER", t.ENUM = "ENUM", t.FREE_INPUT = "FREE_INPUT", t))(Ht || {}), Yt = ((t) => (t.PARTICIPANT_ONE = "PARTICIPANT_ONE", t.PARTICIPANT_TWO = "PARTICIPANT_TWO", t.DRAW = "DRAW", t))(Yt || {}), jt = ((t) => (t.OPEN = "OPEN", t.LIVE = "LIVE", t.PENDING = "PENDING", t.CANCELED = "CANCELED", t.CLOSED = "CLOSED", t.SETTLED = "SETTLED", t))(jt || {}), Ee = class {
700
+ constructor() {
701
+ this.fixtures = [];
702
+ }
703
+ }, Wt = class {
704
+ constructor() {
705
+ this.minutesPlayed = null, this.yellowCards = null, this.redCards = null, this.goals = null, this.penaltyGoals = null, this.penaltyCommitted = null, this.penaltyWon = null, this.penaltyMissed = null, this.penaltySaved = null, this.penaltyReceived = null, this.ownGoals = null, this.assists = null, this.cleanSheets = null, this.shots = null, this.shotsOn = null, this.shotsBlocked = null, this.offsides = null, this.foulsCommitted = null, this.foulsWon = null, this.tackles = null, this.tacklesBlocks = null, this.tacklesInterceptions = null, this.concededGoals = null, this.caughtBall = null, this.saves = null, this.passes = null, this.crosses = null, this.interceptions = null, this.keyPasses = null, this.passesAccuracy = null, this.duels = null, this.duelsWon = null, this.dribblesAttempts = null, this.dribblesSuccess = null, this.dribblesPast = null;
706
+ }
707
+ }, pe = class {
708
+ constructor(t) {
709
+ this.countryIds = null, this.competitionIds = null, this.matchIds = null, this.status = null, this.teamIds = null, this.fromDate = null, this.toDate = null, this.limit = null, this.page = null, this.sortField = null, this.sortOrder = null, this.constructFilterUrl = (e) => {
710
+ let s = "";
711
+ return this.countryIds && (s = s + "&", s = s + `countries=${this.countryIds.join(",")}`), this.competitionIds && this.competitionIds.length > 0 && (s = s + "&", s = s + `competitions=${this.competitionIds.join(",")}`), this.matchIds && this.matchIds.length > 0 && (s = s + "&", s = s + `matches=${this.matchIds.join(",")}`), this.status && (s = s + "&", s = s + `status=${this.status}`), this.teamIds && this.teamIds.length > 0 && (s = s + "&", s = s + `teams=${this.teamIds.join(",")}`), this.fromDate && (s = s + "&", s = s + `from_date=${this.fromDate}`), this.toDate && (s = s + "&", s = s + `to_date=${this.toDate}`), this.limit && !e && (s = s + "&", s = s + `limit=${this.limit}`), this.page && !e && (s = s + "&", s = s + `page=${this.page}`), this.sortField && (s = s + "&", s = s + `sort_field=${this.sortField}`), this.sortOrder && (s = s + "&", s = s + `sort_order=${this.sortOrder}`), s;
712
+ }, this.countryIds = t.countryIds ? t.countryIds : null, this.competitionIds = t.competitionIds ? t.competitionIds : null, this.matchIds = t.matchIds ? t.matchIds : null, this.status = t.status ? t.status : null, this.teamIds = t.teamIds ? t.teamIds : null, this.fromDate = t.fromDate ? t.fromDate : null, this.toDate = t.toDate ? t.toDate : null, this.limit = t.limit ? t.limit : null, this.page = t.page ? t.page : null, this.sortField = t.sortField ? t.sortField : null, this.sortOrder = t.sortOrder ? t.sortOrder : null;
713
+ }
714
+ }, K = class {
715
+ constructor() {
716
+ this.main = null, this.cover = null, this.mobile = null;
717
+ }
718
+ }, Bt = class {
719
+ constructor() {
720
+ this.timeTiebreaker = !1;
721
+ }
722
+ }, Kt = class {
723
+ constructor() {
724
+ this.id = null, this.title = null, this.alternativeTitle = null, this.description = null, this.type = null, this.images = new K(), this.participationCount = null, this.questionsCount = null, this.status = null, this.language = null, this.authRequirement = null, this.flags = null, this.customFields = null, this.labels = null, this.branding = null, this.brandingId = null, this.related = [], this.time = null, this.points = null, this.scored = !1, this.maxAttempts = null, this.averageScore = null, this.perfectScore = null, this.adContent = null, this.context = null, this.createdAt = null, this.updatedAt = null;
725
+ }
726
+ }, fe = class extends Kt {
727
+ constructor() {
728
+ super(...arguments), this.rules = null, this.questions = [];
729
+ }
730
+ }, me = class {
731
+ constructor() {
732
+ this.classicQuizId = null, this.classicQuizModel = null, this.correct = null, this.classicQuizQuestions = null, this.personalBest = null, this.points = null, this.answers = [], this.attempts = 0;
733
+ }
734
+ }, Xt = class {
735
+ constructor() {
736
+ this.id = "", this.title = "", this.alternativeTitle = "", this.description = "", this.images = new K(), this.flags = [], this.status = "", this.language = "", this.authRequirement = null, this.winningCondition = "", this.lives = 0, this.time = 0, this.points = [], this.customFields = null, this.branding = null, this.brandingId = null, this.labels = null, this.adContent = "", this.context = null, this.type = "", this.related = [], this.totalParticipationsCount = 0, this.totalUsersCount = 0, this.finishedParticipationsCount = 0, this.averageStartedParticipationsCount = 0, this.averageFinishedParticipationsCount = 0, this.createdAt = "", this.updatedAt = "";
737
+ }
738
+ }, Oe = class extends Xt {
739
+ constructor() {
740
+ super(...arguments), this.rules = "";
741
+ }
742
+ }, $t = class {
743
+ constructor() {
744
+ this.id = null, this.title = null, this.alternativeTitle = null, this.description = null, this.images = new K(), this.participationCount = null, this.status = null, this.language = null, this.authRequirement = null, this.flags = null, this.customFields = null, this.labels = null, this.branding = null, this.brandingId = null, this.related = [], this.time = null, this.preferencesEnabled = !1, this.maxAttempts = null, this.adContent = null, this.context = null, this.createdAt = null, this.updatedAt = null;
745
+ }
746
+ }, Te = class extends $t {
747
+ constructor() {
748
+ super(...arguments), this.rules = null, this.questions = [], this.personaResults = [];
749
+ }
750
+ }, Re = class {
751
+ constructor() {
752
+ this.personalityQuizId = null, this.userId = null, this.questions = [], this.personas = [], this.attempts = null;
753
+ }
754
+ }, Jt = ((t) => (t.PRE_EVENT = "PRE_EVENT", t.LIVE = "LIVE", t.ALL = "ALL", t))(Jt || {}), ht = ((t) => (t.ORDINARY_TIME = "ORDINARY_TIME", t.FULL_TIME = "FULL_TIME", t))(ht || {}), ct = ((t) => (t.DECIMAL = "DECIMAL", t.MONEYLINE = "MONEYLINE", t.FRACTIONAL = "FRACTIONAL", t))(ct || {}), ut = ((t) => (t.FT_1X2 = "FT_1X2", t.HT_1X2 = "HT_1X2", t.DOUBLE_CHANCE = "DOUBLE_CHANCE", t.DRAW_NO_BET = "DRAW_NO_BET", t.HT_FT = "HT_FT", t.BOTH_TEAMS_SCORE = "BOTH_TEAMS_SCORE", t.CORRECT_SCORE = "CORRECT_SCORE", t.TEAM_SCORE_FIRST_GOAL = "TEAM_SCORE_FIRST_GOAL", t.PLAYER_SCORE_FIRST_GOAL = "PLAYER_SCORE_FIRST_GOAL", t.PLAYER_SCORE = "PLAYER_SCORE", t.PLAYER_RED_CARD = "PLAYER_RED_CARD", t.PLAYER_YELLOW_CARD = "PLAYER_YELLOW_CARD", t.OVER_GOALS_0_5 = "OVER_GOALS_0_5", t.OVER_GOALS_1_5 = "OVER_GOALS_1_5", t.OVER_GOALS_2_5 = "OVER_GOALS_2_5", t.OVER_GOALS_3_5 = "OVER_GOALS_3_5", t.OVER_GOALS_4_5 = "OVER_GOALS_4_5", t.OVER_GOALS_5_5 = "OVER_GOALS_5_5", t.OVER_GOALS_6_5 = "OVER_GOALS_6_5", t.OVER_CORNERS_6_5 = "OVER_CORNERS_6_5", t.OVER_CORNERS_7_5 = "OVER_CORNERS_7_5", t.OVER_CORNERS_8_5 = "OVER_CORNERS_8_5", t.OVER_CORNERS_9_5 = "OVER_CORNERS_9_5", t.OVER_CORNERS_10_5 = "OVER_CORNERS_10_5", t.OVER_CORNERS_11_5 = "OVER_CORNERS_11_5", t.OVER_CORNERS_12_5 = "OVER_CORNERS_12_5", t.OVER_CORNERS_13_5 = "OVER_CORNERS_13_5", t))(ut || {}), Ae = class {
755
+ constructor(t) {
756
+ this.oddType = "PRE_EVENT", this.scopeType = "ORDINARY_TIME", this.oddFormat = "DECIMAL", this.marketTypes = ["FT_1X2"], this.operators = null, this.affiliateId = null, this.affiliateIds = null, this.language = null, this.validateFilters(t);
757
+ }
758
+ constructFiltersUrl() {
759
+ let t = `&odds_format=${this.oddFormat}`;
760
+ this.operators && this.operators.length > 0 && (t += `&operators=${this.operators.join(",")}`);
761
+ let e = this.constructAffiliateIds();
762
+ return e && (t += `&affiliate_ids=${e}`), this.affiliateId && (t += `&affiliate_id=${encodeURIComponent(this.affiliateId)}`), this.language && (t += `&language=${encodeURIComponent(this.language)}`), t;
763
+ }
764
+ constructAffiliateIds() {
765
+ return this.affiliateIds ? Object.keys(this.affiliateIds).filter((t) => t && this.affiliateIds[t]).map((t) => `${encodeURIComponent(t)}:${encodeURIComponent(this.affiliateIds[t])}`).join(",") : "";
766
+ }
767
+ validateFilters(t) {
768
+ let e = Object.values(ht), s = Object.values(ct), i = Object.values(ut);
769
+ if (t != null && t.oddType && console.warn('The filter "oddType" is ignored: the odds API has no odd type request parameter, so pre-event and live odds cannot be requested separately. Whichever applies is reported on each MatchOddsModel.type ("PRE_EVENT" or "LIVE"), derived from the match status.'), t != null && t.scopeType && (e.includes(t.scopeType) ? this.scopeType = t.scopeType : console.warn(`The filter "scopeType" is NOT valid and therefore it will be set to ORDINARY_TIME. The VALID values are : ${e.join(", ")}`)), t != null && t.oddFormat && (t.oddFormat === "MONEYLINE" ? console.warn('The odd format "MONEYLINE" is not supported by the odds provider and therefore it will be set to DECIMAL.') : s.includes(t.oddFormat) ? this.oddFormat = t.oddFormat : console.warn(`The filter "oddFormat" is NOT valid and therefore it will be set to DECIMAL. The VALID values are : ${s.join(", ")}`)), (t == null ? void 0 : t.marketTypes) && Array.isArray(t.marketTypes) && t.marketTypes.length > 0) {
770
+ let l = t.marketTypes.filter((o) => !i.includes(o));
771
+ l.length > 0 && console.warn(`The following market types are not known to this SDK version and will be matched against the API response as-is: ${l.join(", ")}`), this.marketTypes = t.marketTypes;
772
+ }
773
+ t != null && t.operators && Array.isArray(t.operators) && (this.operators = t.operators), t != null && t.affiliateId && (this.affiliateId = t.affiliateId), (t == null ? void 0 : t.affiliateIds) instanceof Object && !Array.isArray(t.affiliateIds) && (this.affiliateIds = t.affiliateIds), t != null && t.language && (this.language = t.language);
774
+ }
775
+ }, zt = ((t) => (t.FOOTBALL = "FOOTBALL", t.BASKETBALL = "BASKETBALL", t.TENNIS = "TENNIS", t.AMERICAN_FOOTBALL = "AMERICAN_FOOTBALL", t.FORMULA_1 = "FORMULA_1", t.HOCKEY = "HOCKEY", t))(zt || {}), ye = class {
776
+ constructor() {
777
+ this.gameInstanceId = null, this.fixtures = null;
778
+ }
779
+ }, qt = ((t) => (t.ACTIVE = "ACTIVE", t.WON = "WON", t.LOST = "LOST", t.PARTIALLY_WON = "PARTIALLY_WON", t.CANCELED = "CANCELED", t))(qt || {}), Qt = class {
780
+ constructor() {
781
+ this.id = null, this.title = null, this.description = null, this.type = null, this.status = null, this.authRequirement = null, this.scheduleOpenAt = null, this.predictionsCutoff = null, this.fixtures = [], this.tiebreaker = new Bt(), this.participantsCount = 0, this.related = [], this.excludedProfileIds = null, this.rules = null, this.labels = null, this.customFields = null, this.branding = null, this.brandingId = null, this.flags = null, this.language = null, this.images = new K(), this.createdAt = null, this.updatedAt = null;
782
+ }
783
+ }, Ie = class extends Qt {
784
+ constructor() {
785
+ super(...arguments), this.adContent = null;
786
+ }
787
+ }, Zt = class {
788
+ constructor() {
789
+ this.id = null, this.title = null, this.alternativeTitle = null, this.description = null, this.type = null, this.images = new K(), this.status = null, this.language = null, this.authRequirement = null, this.totalVotes = null, this.flags = [], this.customFields = null, this.branding = null, this.brandingId = null, this.embedCode = null, this.labels = null, this.adContent = null, this.context = null, this.options = [], this.related = [], this.preferencesEnabled = !1, this.multipleChoice = !1, this.maxMultipleChoiceOptions = null, this.participationCount = 0, this.maxAttempts = 0, this.externalActivity = null, this.createdAt = null, this.updatedAt = null;
790
+ }
791
+ }, ve = class extends Zt {
792
+ constructor() {
793
+ super(...arguments), this.rules = null;
794
+ }
795
+ }, te = class {
796
+ constructor() {
797
+ this.id = null, this.pollId = null, this.optionId = null, this.optionIds = [], this.userId = null, this.createdAt = null;
798
+ }
799
+ }, ge = class extends te {
800
+ constructor() {
801
+ super(...arguments), this.previousVotes = [], this.attempts = null;
802
+ }
803
+ }, ee = ((t) => (t.LIKE = "like", t.DISLIKE = "dislike", t.SHARE = "share", t.COMMENT = "comment", t.PREDICTION_MADE = "prediction_made", t))(ee || {}), se = ((t) => (t.CORRECT = "CORRECT", t.INCORRECT = "INCORRECT", t.PARTIALLY_CORRECT = "PARTIALLY_CORRECT", t.NOT_VERIFIED = "NOT_VERIFIED", t))(se || {}), ie = ((t) => (t.ONE = "1", t.X = "x", t.TWO = "2", t))(ie || {}), re = ((t) => (t.ONE_X = "1x", t.X_TWO = "x2", t.ONE_TWO = "12", t))(re || {}), ae = ((t) => (t.ONE_ONE = "1/1", t.ONE_X = "1/x", t.ONE_TWO = "1/2", t.X_ONE = "x/1", t.X_X = "x/x", t.X_TWO = "x/2", t.TWO_ONE = "2/1", t.TWO_X = "2/x", t.TWO_TWO = "2/2", t))(ae || {}), ne = ((t) => (t.NONE = "none", t.FINISHED = "finished", t.CANCELLED = "cancelled", t.POSTPONED = "postponed", t.NOT_STARTED = "not_started", t.FIRST_HALF = "1st_half", t.SECOND_HALF = "2nd_half", t.FINISHED_AFTER_AWARDED_WIN = "finished_after_awarded_win", t.TO_FINISH = "to_finish", t.FINISHED_AET = "finished_aet", t.HALFTIME = "halftime", t.FINISHED_AP = "finished_ap", t.INTERRUPTED = "interrupted", t.KICK_OFF_DELAYED = "kick_off_delayed", t.ABANDONED = "abandoned", t.WAITING_FOR_PENALTY = "waiting_for_penalty", t.PENALTY = "penalty", t.PAUSE = "pause", t.EXTRA_TIME_1ST_HALF = "extra_time_1st_half", t.EXTRA_TIME_END_OF_1ST_HALF = "extra_time_end_of_1st_half", t.EXTRA_TIME_2ND_HALF = "extra_time_2nd_half", t.WAITING_FOR_EXTRA_TIME = "waiting_for_extra_time", t.NO_INFO_YET = "no_info_yet", t.AWAITING_INFO = "awaiting_info", t.FINISHED_ASG = "finished_asg", t))(ne || {}), w;
804
+ w = class {
805
+ constructor() {
806
+ }
807
+ static createMatchMarketsResultsModel(e, s) {
808
+ var i, l, o, d, r, p, n, c, E, O, _, f, I, v, L, S, D, V, g, a, u, h, m, R, T, y, C, P, b, B, H, G, F, x, X, et;
809
+ return { FT_1X2: this.createOneXTwoResult(e.scores, "full_time"), HT_1X2: this.createOneXTwoResult(e.scores, "half_time"), BOTH_TEAMS_SCORE: e.scores.ftScore.homeGoals > 0 && e.scores.ftScore.awayGoals > 0, DOUBLE_CHANCE: this.createDoubleChanceResult(e.scores), HT_FT: this.createHalfTimeFullTimeResult(e.scores), RED_CARD_MATCH: this.createMarketResultByCriteria(e, "red_card"), PENALTY_MATCH: this.createMarketResultByCriteria(e, "penalty"), CORNERS_MATCH: isNaN(((l = (i = e.stats) == null ? void 0 : i.corners) == null ? void 0 : l.homeTeam) + ((d = (o = e.stats) == null ? void 0 : o.corners) == null ? void 0 : d.awayTeam)) ? null : e.stats.corners.homeTeam + e.stats.corners.awayTeam, PLAYER_YELLOW_CARD: this.createPlayersMarketsResults(e, s, "yellow_card"), PLAYER_RED_CARD: this.createPlayersMarketsResults(e, s, "red_card"), PLAYER_SCORE_FIRST_GOAL: this.createPlayersMarketsResults(e, s, "first_goal"), PLAYER_SCORE: this.createPlayersMarketsResults(e, s, "one_goal"), PLAYER_SCORE_TWICE: this.createPlayersMarketsResults(e, s, "two_goals"), PLAYER_SCORE_HATTRICK: this.createPlayersMarketsResults(e, s, "hattrick"), CORRECT_SCORE: { homeGoals: e.scores.ftScore.homeGoals, awayGoals: e.scores.ftScore.awayGoals }, CORRECT_SCORE_ADVANCED: { homeGoals: e.scores.ftScore.homeGoals, awayGoals: e.scores.ftScore.awayGoals }, CORRECT_SCORE_HT: { homeGoals: e.scores.htScore.homeGoals, awayGoals: e.scores.htScore.awayGoals }, OVER_GOALS_0_5: e.scores.ftScore.homeGoals + e.scores.ftScore.awayGoals > 0, OVER_GOALS_1_5: e.scores.ftScore.homeGoals + e.scores.ftScore.awayGoals > 1, OVER_GOALS_2_5: e.scores.ftScore.homeGoals + e.scores.ftScore.awayGoals > 2, OVER_GOALS_3_5: e.scores.ftScore.homeGoals + e.scores.ftScore.awayGoals > 3, OVER_GOALS_4_5: e.scores.ftScore.homeGoals + e.scores.ftScore.awayGoals > 4, OVER_GOALS_5_5: e.scores.ftScore.homeGoals + e.scores.ftScore.awayGoals > 5, OVER_GOALS_6_5: e.scores.ftScore.homeGoals + e.scores.ftScore.awayGoals > 6, OVER_CORNERS_6_5: isNaN(((p = (r = e.stats) == null ? void 0 : r.corners) == null ? void 0 : p.homeTeam) + ((c = (n = e.stats) == null ? void 0 : n.corners) == null ? void 0 : c.awayTeam)) ? null : e.stats.corners.homeTeam + e.stats.corners.awayTeam > 6, OVER_CORNERS_7_5: isNaN(((O = (E = e.stats) == null ? void 0 : E.corners) == null ? void 0 : O.homeTeam) + ((f = (_ = e.stats) == null ? void 0 : _.corners) == null ? void 0 : f.awayTeam)) ? null : e.stats.corners.homeTeam + e.stats.corners.awayTeam > 7, OVER_CORNERS_8_5: isNaN(((v = (I = e.stats) == null ? void 0 : I.corners) == null ? void 0 : v.homeTeam) + ((S = (L = e.stats) == null ? void 0 : L.corners) == null ? void 0 : S.awayTeam)) ? null : e.stats.corners.homeTeam + e.stats.corners.awayTeam > 8, OVER_CORNERS_9_5: isNaN(((V = (D = e.stats) == null ? void 0 : D.corners) == null ? void 0 : V.homeTeam) + ((a = (g = e.stats) == null ? void 0 : g.corners) == null ? void 0 : a.awayTeam)) ? null : e.stats.corners.homeTeam + e.stats.corners.awayTeam > 9, OVER_CORNERS_10_5: isNaN(((h = (u = e.stats) == null ? void 0 : u.corners) == null ? void 0 : h.homeTeam) + ((R = (m = e.stats) == null ? void 0 : m.corners) == null ? void 0 : R.awayTeam)) ? null : e.stats.corners.homeTeam + e.stats.corners.awayTeam > 10, OVER_CORNERS_11_5: isNaN(((y = (T = e.stats) == null ? void 0 : T.corners) == null ? void 0 : y.homeTeam) + ((P = (C = e.stats) == null ? void 0 : C.corners) == null ? void 0 : P.awayTeam)) ? null : e.stats.corners.homeTeam + e.stats.corners.awayTeam > 11, OVER_CORNERS_12_5: isNaN(((B = (b = e.stats) == null ? void 0 : b.corners) == null ? void 0 : B.homeTeam) + ((G = (H = e.stats) == null ? void 0 : H.corners) == null ? void 0 : G.awayTeam)) ? null : e.stats.corners.homeTeam + e.stats.corners.awayTeam > 12, OVER_CORNERS_13_5: isNaN(((x = (F = e.stats) == null ? void 0 : F.corners) == null ? void 0 : x.homeTeam) + ((et = (X = e.stats) == null ? void 0 : X.corners) == null ? void 0 : et.awayTeam)) ? null : e.stats.corners.homeTeam + e.stats.corners.awayTeam > 13 };
810
+ }
811
+ }, w.createOneXTwoResult = (e, s) => {
812
+ var i, l, o, d;
813
+ return s === "full_time" ? e.ftScore.homeGoals > e.ftScore.awayGoals ? "1" : e.ftScore.homeGoals === e.ftScore.awayGoals ? "x" : "2" : ((i = e == null ? void 0 : e.htScore) == null ? void 0 : i.homeGoals) > ((l = e == null ? void 0 : e.htScore) == null ? void 0 : l.awayGoals) ? "1" : ((o = e == null ? void 0 : e.htScore) == null ? void 0 : o.homeGoals) === ((d = e == null ? void 0 : e.htScore) == null ? void 0 : d.awayGoals) ? "x" : "2";
814
+ }, w.createDoubleChanceResult = (e) => {
815
+ var s, i, l, o;
816
+ return ((s = e == null ? void 0 : e.ftScore) == null ? void 0 : s.homeGoals) > ((i = e == null ? void 0 : e.ftScore) == null ? void 0 : i.awayGoals) ? ["1x", "12"] : ((l = e == null ? void 0 : e.ftScore) == null ? void 0 : l.homeGoals) === ((o = e == null ? void 0 : e.ftScore) == null ? void 0 : o.awayGoals) ? ["1x", "x2"] : ["x2", "12"];
817
+ }, w.createHalfTimeFullTimeResult = (e) => {
818
+ var s, i, l, o, d, r, p, n, c, E, O, _, f, I, v, L, S, D, V, g, a, u, h, m;
819
+ if (((s = e == null ? void 0 : e.htScore) == null ? void 0 : s.homeGoals) > ((i = e == null ? void 0 : e.htScore) == null ? void 0 : i.awayGoals)) {
820
+ if (((l = e == null ? void 0 : e.ftScore) == null ? void 0 : l.homeGoals) > ((o = e == null ? void 0 : e.ftScore) == null ? void 0 : o.awayGoals)) return "1/1";
821
+ if (((d = e == null ? void 0 : e.ftScore) == null ? void 0 : d.homeGoals) === ((r = e == null ? void 0 : e.ftScore) == null ? void 0 : r.awayGoals)) return "1/x";
822
+ if (((p = e == null ? void 0 : e.ftScore) == null ? void 0 : p.homeGoals) < ((n = e == null ? void 0 : e.ftScore) == null ? void 0 : n.awayGoals)) return "1/2";
823
+ }
824
+ if (((c = e == null ? void 0 : e.htScore) == null ? void 0 : c.homeGoals) === ((E = e == null ? void 0 : e.htScore) == null ? void 0 : E.awayGoals)) {
825
+ if (((O = e == null ? void 0 : e.ftScore) == null ? void 0 : O.homeGoals) > ((_ = e == null ? void 0 : e.ftScore) == null ? void 0 : _.awayGoals)) return "x/1";
826
+ if (((f = e == null ? void 0 : e.ftScore) == null ? void 0 : f.homeGoals) === ((I = e == null ? void 0 : e.ftScore) == null ? void 0 : I.awayGoals)) return "x/x";
827
+ if (((v = e == null ? void 0 : e.ftScore) == null ? void 0 : v.homeGoals) < ((L = e == null ? void 0 : e.ftScore) == null ? void 0 : L.awayGoals)) return "x/2";
828
+ }
829
+ if (((S = e == null ? void 0 : e.htScore) == null ? void 0 : S.homeGoals) < ((D = e == null ? void 0 : e.htScore) == null ? void 0 : D.awayGoals)) {
830
+ if (((V = e == null ? void 0 : e.ftScore) == null ? void 0 : V.homeGoals) > ((g = e == null ? void 0 : e.ftScore) == null ? void 0 : g.awayGoals)) return "2/1";
831
+ if (((a = e == null ? void 0 : e.ftScore) == null ? void 0 : a.homeGoals) === ((u = e == null ? void 0 : e.ftScore) == null ? void 0 : u.awayGoals)) return "2/x";
832
+ if (((h = e == null ? void 0 : e.ftScore) == null ? void 0 : h.homeGoals) < ((m = e == null ? void 0 : e.ftScore) == null ? void 0 : m.awayGoals)) return "2/2";
833
+ }
834
+ }, w.createMarketResultByCriteria = (e, s) => !e.timeline || !e.timeline.length ? null : s === "red_card" ? e.timeline.filter((i) => Number(i.minute) <= 90).some((i) => i.type === "red_card") : e.timeline.filter((i) => Number(i.minute) <= 90).some((i) => i.type.startsWith(s)), w.createPlayersMarketsResults = (e, s, i) => {
835
+ if (!e.timeline || !e.timeline.length) return i === "first_goal" ? null : [];
836
+ if (i === "first_goal") {
837
+ let r = e.timeline.find((p) => p.type === "goal" || p.type === "penalty_goal" || p.type === "own_goal") || null;
838
+ if (r) {
839
+ let p = s[r.player.id];
840
+ return { playerId: r.type === "goal" || r.type === "penalty_goal" ? r.player.id : "OWN_GOAL", playerModel: p };
841
+ }
842
+ return null;
843
+ }
844
+ if (i === "yellow_card" || i === "red_card") return w.transformPlayerMarketResult(e.timeline.filter((r) => Number(r.minute) <= 90).filter((r) => r.type === i).map((r) => s[r.player.id]));
845
+ let l = /* @__PURE__ */ new Map(), o = i === "one_goal" ? 1 : i === "two_goals" ? 2 : 3, d = [];
846
+ return e.timeline.filter((r) => Number(r.minute) <= 90).filter((r) => r.type === "goal" || r.type === "penalty_goal").forEach((r) => {
847
+ let p = s[r.player.id];
848
+ if (l.has(r.player.id)) {
849
+ let n = l.get(r.player.id);
850
+ n.push(p), l.set(r.player.id, n);
851
+ } else l.set(r.player.id, [p]);
852
+ }), l.forEach((r) => {
853
+ r.length >= o && d.push(r[0]);
854
+ }), w.transformPlayerMarketResult(d);
855
+ }, w.transformPlayerMarketResult = (e) => e.map((s) => ({ playerId: s.id, playerModel: s }));
856
+ Object.keys(new Wt());
857
+ (/* @__PURE__ */ new Map()).set("minutesPlayed", "Minutes Played").set("cleanSheets", "Clean Sheets").set("concededGoals", "Goals Conceded").set("saves", "Saves").set("penaltySaved", "Penalties Saved").set("penaltyCommitted", "Penalties Committed").set("yellowCards", "Yellow Cards").set("redCards", "Red Cards").set("assists", "Assists").set("foulsCommitted", "Fouls Committed").set("ownGoals", "Own Goals").set("goals", "Goals").set("tackles", "Tackles").set("shotsOn", "Shots On Target").set("penaltyGoals", "Penalty Goals").set("penaltyWon", "Penalty Won").set("penaltyMissed", "Penalty Missed").set("penaltySaved", "Penalty Saved").set("penaltyReceived", "Penalty Received").set("shots", "Shots").set("shotsBlocked", "Shots Blocked").set("offsides", "Offsides").set("foulsWon", "Fouls Won").set("tacklesBlocks", "Tackles Blocks").set("tacklesInterceptions", "Tackles Interceptions").set("caughtBall", "Caught Ball").set("passes", "Passes").set("crosses", "Crosses").set("interceptions", "Interceptions").set("keyPasses", "Key Passes").set("passesAccuracy", "Passes Accuracy").set("duels", "Duels").set("duelsWon", "Duels Won").set("dribblesAttempts", "Dribbles Attempts").set("dribblesSuccess", "Dribbles Success").set("dribblesPast", "Dribbles Past");
858
+ var tt = class dt {
859
+ constructor(e, s, i = null, l = Date.now(), o = null) {
860
+ this.data = e, this.expiresAt = s, this.lastModified = i, this.storedAt = l, this.hardExpiresAt = o;
861
+ }
862
+ isFresh(e = Date.now()) {
863
+ return e < this.expiresAt;
864
+ }
865
+ isExpired(e = Date.now()) {
866
+ return this.hardExpiresAt !== null && e >= this.hardExpiresAt;
867
+ }
868
+ toPlain() {
869
+ return { data: this.data, expiresAt: this.expiresAt, hardExpiresAt: this.hardExpiresAt, lastModified: this.lastModified, storedAt: this.storedAt };
870
+ }
871
+ static fromPlain(e) {
872
+ return !e || typeof e.expiresAt != "number" ? null : new dt(e.data, e.expiresAt, e.lastModified || null, e.storedAt || Date.now(), typeof e.hardExpiresAt == "number" ? e.hardExpiresAt : null);
873
+ }
874
+ }, oe = class {
875
+ constructor(t, e) {
876
+ this.dbPromise = null, this.isSupported = () => typeof indexedDB < "u" && indexedDB !== null, this.openDb = () => this.dbPromise ? this.dbPromise : (this.dbPromise = new Promise((s) => {
877
+ if (!this.isSupported()) {
878
+ s(null);
879
+ return;
880
+ }
881
+ try {
882
+ let i = indexedDB.open(this.dbName, 1);
883
+ i.onupgradeneeded = () => {
884
+ let l = i.result;
885
+ l.objectStoreNames.contains(this.storeName) || l.createObjectStore(this.storeName);
886
+ }, i.onsuccess = () => s(i.result), i.onerror = () => s(null);
887
+ } catch {
888
+ s(null);
889
+ }
890
+ }), this.dbPromise), this.runTransaction = (s, i) => this.openDb().then((l) => new Promise((o) => {
891
+ if (!l) {
892
+ o(null);
893
+ return;
894
+ }
895
+ try {
896
+ let d = l.transaction(this.storeName, s), r = i(d.objectStore(this.storeName));
897
+ r.onsuccess = () => o(r.result !== void 0 ? r.result : null), r.onerror = () => o(null);
898
+ } catch {
899
+ o(null);
900
+ }
901
+ })), this.get = (s) => this.runTransaction("readonly", (i) => i.get(s)), this.set = (s, i) => this.runTransaction("readwrite", (l) => l.put(i, s)).then(() => {
902
+ }), this.delete = (s) => this.runTransaction("readwrite", (i) => i.delete(s)).then(() => {
903
+ }), this.clear = () => this.runTransaction("readwrite", (s) => s.clear()).then(() => {
904
+ }), this.dbName = t, this.storeName = e;
905
+ }
906
+ }, _t = class {
907
+ constructor() {
908
+ this.store = /* @__PURE__ */ new Map(), this.get = async (t) => this.store.get(t) || null, this.set = async (t, e) => {
909
+ this.store.set(t, e);
910
+ }, this.delete = async (t) => {
911
+ this.store.delete(t);
912
+ }, this.clear = async () => {
913
+ this.store.clear();
914
+ };
915
+ }
916
+ }, k, le = (k = class {
917
+ constructor() {
918
+ this.l1 = new _t(), this.get = async (e) => {
919
+ let s = await this.l1.get(e);
920
+ if (s) return s;
921
+ let i = await this.l2.get(e), l = tt.fromPlain(i);
922
+ return l && await this.l1.set(e, l), l;
923
+ }, this.set = async (e, s) => {
924
+ await this.l1.set(e, s), await this.l2.set(e, s.toPlain());
925
+ }, this.delete = async (e) => {
926
+ await this.l1.delete(e), await this.l2.delete(e);
927
+ }, this.clear = async () => {
928
+ await this.l1.clear(), await this.l2.clear();
929
+ }, this.l2 = new oe(k.DB_NAME, k.STORE_NAME);
930
+ }
931
+ }, k.DB_NAME = "fansunited-sdk-cache", k.STORE_NAME = "http-responses", k), U, he = (U = class {
932
+ constructor() {
933
+ this.l1 = new _t(), this.loadStorage = async () => {
934
+ try {
935
+ return (await Promise.resolve().then(() => (yt(), nt))).default;
936
+ } catch (e) {
937
+ return console.warn("AsyncStorage unavailable, HTTP cache will run memory-only", e), null;
938
+ }
939
+ }, this.getStorage = () => this.storagePromise, this.storageKey = (e) => `${U.KEY_PREFIX}${e}`, this.get = async (e) => {
940
+ let s = await this.l1.get(e);
941
+ if (s) return s;
942
+ let i = await this.getStorage();
943
+ if (!i) return null;
944
+ try {
945
+ let l = await i.getItem(this.storageKey(e)), o = l ? tt.fromPlain(JSON.parse(l)) : null;
946
+ return o && await this.l1.set(e, o), o;
947
+ } catch {
948
+ return null;
949
+ }
950
+ }, this.set = async (e, s) => {
951
+ await this.l1.set(e, s);
952
+ let i = await this.getStorage();
953
+ if (i) try {
954
+ await i.setItem(this.storageKey(e), JSON.stringify(s.toPlain()));
955
+ } catch {
956
+ }
957
+ }, this.delete = async (e) => {
958
+ await this.l1.delete(e);
959
+ let s = await this.getStorage();
960
+ if (s) try {
961
+ await s.removeItem(this.storageKey(e));
962
+ } catch {
963
+ }
964
+ }, this.clear = async () => {
965
+ await this.l1.clear();
966
+ let e = await this.getStorage();
967
+ if (e) try {
968
+ let s = (await e.getAllKeys()).filter((i) => i.startsWith(U.KEY_PREFIX));
969
+ s.length > 0 && await e.multiRemove(s);
970
+ } catch {
971
+ }
972
+ }, this.storagePromise = this.loadStorage();
973
+ }
974
+ }, U.KEY_PREFIX = "fansunited-sdk-cache:", U), ce = at(lt()), j, ue = (j = class {
975
+ constructor() {
976
+ this.get = async (e) => this.cache.get(e) || null, this.set = async (e, s) => {
977
+ this.cache.set(e, s);
978
+ }, this.delete = async (e) => {
979
+ this.cache.del(e);
980
+ }, this.clear = async () => {
981
+ this.cache.flushAll();
982
+ }, this.cache = new ce.default({ stdTTL: j.MAX_RETENTION_SECONDS, useClones: !1 });
983
+ }
984
+ }, j.MAX_RETENTION_SECONDS = 86400, j), N, de = (N = class {
985
+ }, N.instance = null, N.getInstance = () => N.instance ? N.instance : typeof window > "u" ? (N.instance = new ue(), N.instance) : typeof __DEV__ < "u" ? (N.instance = new he(), N.instance) : (N.instance = new le(), N.instance), N), M;
986
+ M = class {
987
+ constructor(e) {
988
+ this.inFlight = /* @__PURE__ */ new Set(), this.getOrRevalidate = async (s, i) => {
989
+ let l = await this.safeGet(s), o = l && !l.isExpired() ? l : null;
990
+ if (o && o.isFresh()) return o.data;
991
+ if (o) return this.revalidateInBackground(s, o, i), o.data;
992
+ let d = await i();
993
+ return await this.store(s, d), d.data;
994
+ }, this.forceFetch = async (s, i) => {
995
+ let l = await i();
996
+ return await this.store(s, l), l.data;
997
+ }, this.revalidateInBackground = (s, i, l) => {
998
+ this.inFlight.has(s) || (this.inFlight.add(s), l({ lastModified: i.lastModified }).then(async (o) => {
999
+ if (o.status === 304) {
1000
+ i.expiresAt = o.expiresAt, i.hardExpiresAt = o.hardExpiresAt || null, i.storedAt = Date.now(), await this.cache.set(s, i);
1001
+ return;
1002
+ }
1003
+ await this.store(s, o);
1004
+ }).catch(() => {
1005
+ }).finally(() => {
1006
+ this.inFlight.delete(s);
1007
+ }));
1008
+ }, this.store = async (s, i) => {
1009
+ let l = new tt(i.data, i.expiresAt, i.lastModified, Date.now(), i.hardExpiresAt || null);
1010
+ await this.cache.set(s, l);
1011
+ }, this.safeGet = async (s) => {
1012
+ try {
1013
+ return await this.cache.get(s);
1014
+ } catch {
1015
+ return null;
1016
+ }
1017
+ }, this.cache = e;
1018
+ }
1019
+ static getInstance() {
1020
+ return M.shared || (M.shared = new M(de.getInstance())), M.shared;
1021
+ }
1022
+ }, M.shared = null;
1023
+ export {
1024
+ me as D,
1025
+ Re as I,
1026
+ ge as L,
1027
+ Te as M,
1028
+ ve as O,
1029
+ fe as W,
1030
+ Oe as a,
1031
+ ye as b,
1032
+ ht as c,
1033
+ ct as d,
1034
+ Ht as e,
1035
+ Ie as f,
1036
+ Ee as g,
1037
+ _e as k,
1038
+ pe as l,
1039
+ wt as n,
1040
+ Jt as p,
1041
+ Ae as t,
1042
+ ut as u
1043
+ };