@streamlayer/sdk-web 1.9.1 → 1.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/es/index.js CHANGED
@@ -1,28 +1,28 @@
1
- import { pino as wi } from "pino";
2
- import { QuestionType as I, QuestionStatus as Y, PromotionType as U, NotificationEnabled as Br, SilenceSetting as Ai, UseAsNotification as Ei } from "@streamlayer/sl-eslib/interactive/interactive.common_pb";
1
+ import { pino as Ei } from "pino";
2
+ import { QuestionType as I, QuestionStatus as G, PromotionType as q, NotificationEnabled as Br, SilenceSetting as Ii, UseAsNotification as Oi } from "@streamlayer/sl-eslib/interactive/interactive.common_pb";
3
3
  import { PickHistoryStatus as lt } from "@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb";
4
4
  import { SdkOverlayType as R } from "@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb";
5
- import { InvitationCategory as Mr, InvitationFrom as qr } from "@streamlayer/sl-eslib/analytics/v1/invitations/invitations_pb";
6
- import { computed as Ii, map as Oi, atom as Lt, batched as Ur, onMount as wr } from "nanostores";
7
- import { nanoid as or } from "nanoid";
8
- import { ConnectError as rt, Code as oe, createContextKey as jr, createClient as xr, createContextValues as Ti } from "@connectrpc/connect";
5
+ import { InvitationCategory as Mr, InvitationFrom as Ur } from "@streamlayer/sl-eslib/analytics/v1/invitations/invitations_pb";
6
+ import { computed as Ti, map as _i, atom as Lt, batched as qr, onMount as wr } from "nanostores";
7
+ import { v4 as or } from "uuid";
8
+ import { ConnectError as it, Code as oe, createContextKey as jr, createClient as xr, createContextValues as ki } from "@connectrpc/connect";
9
9
  import { createGrpcWebTransport as Qr } from "@connectrpc/connect-web";
10
10
  import { nanoquery as Gr } from "@nanostores/query";
11
- import { Events as _n } from "@streamlayer/sl-eslib/sports/events/events_connect";
11
+ import { Events as Pn } from "@streamlayer/sl-eslib/sports/events/events_connect";
12
12
  import { Client as ot } from "@streamlayer/sl-eslib/sdkSettings/client/client_connect";
13
13
  import { Users as Ar } from "@streamlayer/sl-eslib/users/users_connect";
14
14
  import { Feed as ee } from "@streamlayer/sl-eslib/interactive/feed/interactive.feed_connect";
15
- import { Leaderboard as kn } from "@streamlayer/sl-eslib/interactive/leaderboard/interactive.leaderboard_connect";
15
+ import { Leaderboard as Cn } from "@streamlayer/sl-eslib/interactive/leaderboard/interactive.leaderboard_connect";
16
16
  import "@streamlayer/sl-eslib/interactive/leaderboard/interactive.leaderboard_pb";
17
- import { LinksClient as _i } from "@streamlayer/sl-eslib/shortLinks/linksClient_connect";
18
- import { Kind as G, TopicSubType as J, TopicType as Q, PollOpenedFrom as X, Category as H, ScreenOrientation as Kr } from "@streamlayer/sl-eslib/analytics/v1/common/analytics.common_pb";
19
- import { AnalyticsService as Cn } from "@streamlayer/sl-eslib/analytics/v2/streaming/streaming_connect";
17
+ import { LinksClient as Pi } from "@streamlayer/sl-eslib/shortLinks/linksClient_connect";
18
+ import { Kind as K, TopicSubType as J, TopicType as Q, PollOpenedFrom as X, Category as W, ScreenOrientation as Kr } from "@streamlayer/sl-eslib/analytics/v1/common/analytics.common_pb";
19
+ import { AnalyticsService as Ln } from "@streamlayer/sl-eslib/analytics/v2/streaming/streaming_connect";
20
20
  import { InteractionActionType as zr } from "@streamlayer/sl-eslib/analytics/v1/interactions/interactions_pb";
21
21
  import { NotificationKind as me, NotificationType as Hr } from "@streamlayer/sl-eslib/analytics/v1/notifications/notifications_pb";
22
- function ki(t) {
22
+ function Ci(t) {
23
23
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
24
24
  }
25
- var Pn = { exports: {} }, M = Pn.exports = {}, de, le;
25
+ var Nn = { exports: {} }, M = Nn.exports = {}, de, le;
26
26
  function sr() {
27
27
  throw new Error("setTimeout has not been defined");
28
28
  }
@@ -41,7 +41,7 @@ function ar() {
41
41
  le = ar;
42
42
  }
43
43
  })();
44
- function Ln(t) {
44
+ function Fn(t) {
45
45
  if (de === setTimeout)
46
46
  return setTimeout(t, 0);
47
47
  if ((de === sr || !de) && setTimeout)
@@ -56,7 +56,7 @@ function Ln(t) {
56
56
  }
57
57
  }
58
58
  }
59
- function Ci(t) {
59
+ function Li(t) {
60
60
  if (le === clearTimeout)
61
61
  return clearTimeout(t);
62
62
  if ((le === ar || !le) && clearTimeout)
@@ -71,20 +71,20 @@ function Ci(t) {
71
71
  }
72
72
  }
73
73
  }
74
- var we = [], Qe = !1, ke, yt = -1;
75
- function Pi() {
76
- !Qe || !ke || (Qe = !1, ke.length ? we = ke.concat(we) : yt = -1, we.length && Nn());
74
+ var we = [], Qe = !1, Pe, yt = -1;
75
+ function Ni() {
76
+ !Qe || !Pe || (Qe = !1, Pe.length ? we = Pe.concat(we) : yt = -1, we.length && Dn());
77
77
  }
78
- function Nn() {
78
+ function Dn() {
79
79
  if (!Qe) {
80
- var t = Ln(Pi);
80
+ var t = Fn(Ni);
81
81
  Qe = !0;
82
82
  for (var e = we.length; e; ) {
83
- for (ke = we, we = []; ++yt < e; )
84
- ke && ke[yt].run();
83
+ for (Pe = we, we = []; ++yt < e; )
84
+ Pe && Pe[yt].run();
85
85
  yt = -1, e = we.length;
86
86
  }
87
- ke = null, Qe = !1, Ci(t);
87
+ Pe = null, Qe = !1, Li(t);
88
88
  }
89
89
  }
90
90
  M.nextTick = function(t) {
@@ -92,12 +92,12 @@ M.nextTick = function(t) {
92
92
  if (arguments.length > 1)
93
93
  for (var r = 1; r < arguments.length; r++)
94
94
  e[r - 1] = arguments[r];
95
- we.push(new Fn(t, e)), we.length === 1 && !Qe && Ln(Nn);
95
+ we.push(new Rn(t, e)), we.length === 1 && !Qe && Fn(Dn);
96
96
  };
97
- function Fn(t, e) {
97
+ function Rn(t, e) {
98
98
  this.fun = t, this.array = e;
99
99
  }
100
- Fn.prototype.run = function() {
100
+ Rn.prototype.run = function() {
101
101
  this.fun.apply(null, this.array);
102
102
  };
103
103
  M.title = "browser";
@@ -132,8 +132,8 @@ M.chdir = function(t) {
132
132
  M.umask = function() {
133
133
  return 0;
134
134
  };
135
- var Li = Pn.exports;
136
- const E = /* @__PURE__ */ ki(Li), Ni = wi({
135
+ var Fi = Nn.exports;
136
+ const E = /* @__PURE__ */ Ci(Fi), Di = Ei({
137
137
  level: "trace",
138
138
  enabled: typeof window < "u" && !!window.localStorage.getItem("SL_DEBUG"),
139
139
  browser: {
@@ -141,23 +141,23 @@ const E = /* @__PURE__ */ ki(Li), Ni = wi({
141
141
  console.log(t);
142
142
  }
143
143
  }
144
- }), pe = (t, e) => Ni.child({ name: t }, e);
145
- class Fi extends Event {
144
+ }), pe = (t, e) => Di.child({ name: t }, e);
145
+ class Ri extends Event {
146
146
  slEventBus;
147
147
  constructor(e, r) {
148
148
  super(e), this.slEventBus = r;
149
149
  }
150
150
  }
151
- const Di = pe("event-bus");
152
- class Ri {
151
+ const Vi = pe("event-bus");
152
+ class $i {
153
153
  name;
154
154
  listeners;
155
155
  constructor(e = "sl-event-bus") {
156
156
  this.name = e, this.listeners = /* @__PURE__ */ new Set();
157
157
  }
158
158
  emit = (e, r) => {
159
- const n = new Fi(this.name, { ...r, type: e });
160
- Di.debug(n, "Emitting event"), window.dispatchEvent(n);
159
+ const n = new Ri(this.name, { ...r, type: e });
160
+ Vi.debug(n, "Emitting event"), window.dispatchEvent(n);
161
161
  };
162
162
  listen(e) {
163
163
  return window.addEventListener(this.name, e), this.listeners.add(e), () => {
@@ -173,7 +173,7 @@ class Ri {
173
173
  }), this.listeners.clear();
174
174
  };
175
175
  }
176
- class Vi {
176
+ class Bi {
177
177
  }
178
178
  var Ae;
179
179
  (function(t) {
@@ -196,9 +196,9 @@ class Nt {
196
196
  return this.store;
197
197
  }
198
198
  }
199
- const $i = (t) => {
199
+ const Mi = (t) => {
200
200
  const e = Object.keys(t);
201
- return Ii(e.map((r) => t[r].getStore()), (...r) => Object.fromEntries(e.map((n, i) => [n, r[i]])));
201
+ return Ti(e.map((r) => t[r].getStore()), (...r) => Object.fromEntries(e.map((n, i) => [n, r[i]])));
202
202
  };
203
203
  class Ce extends Nt {
204
204
  getValues = () => this.getStore().get();
@@ -207,22 +207,22 @@ class Ce extends Nt {
207
207
  subscribe = (...e) => this.getStore().subscribe(...e);
208
208
  unsubscribe = () => this.getStore().off();
209
209
  }
210
- const Z = (t) => Oi(t);
210
+ const Z = (t) => _i(t);
211
211
  var be;
212
212
  (function(t) {
213
213
  t.ORGANIZATION = "ORGANIZATION", t.STREAM = "STREAM";
214
214
  })(be || (be = {}));
215
- const Bi = {
215
+ const Ui = {
216
216
  [R.BETTING]: "betting",
217
217
  [R.GAMES]: "games",
218
218
  [R.PUBLIC_CHAT]: "publicChat",
219
219
  [R.TWITTER]: "twitter"
220
220
  };
221
- var Ze;
221
+ var tt;
222
222
  (function(t) {
223
223
  t.Ready = "ready", t.Suspended = "suspended";
224
- })(Ze || (Ze = {}));
225
- class Dn {
224
+ })(tt || (tt = {}));
225
+ class Vn {
226
226
  status;
227
227
  source;
228
228
  config;
@@ -230,7 +230,7 @@ class Dn {
230
230
  listeners = /* @__PURE__ */ new Set();
231
231
  settingsKey;
232
232
  constructor({ settings: e, ...r }, n) {
233
- this.settingsKey = Bi[r.type], this.status = Lt(Ze.Suspended), this.config = new Ce(Z(r), `feature:config:${this.settingsKey}`), this.settingsKey !== void 0 && e?.overlaySettings.case === this.settingsKey ? this.settings = new Ce(Z(e.overlaySettings.value), `feature:settings:${this.settingsKey}`) : this.settings = new Ce(Z({}), `feature:settings:${this.settingsKey}`), this.source = n;
233
+ this.settingsKey = Ui[r.type], this.status = Lt(tt.Suspended), this.config = new Ce(Z(r), `feature:config:${this.settingsKey}`), this.settingsKey !== void 0 && e?.overlaySettings.case === this.settingsKey ? this.settings = new Ce(Z(e.overlaySettings.value), `feature:settings:${this.settingsKey}`) : this.settings = new Ce(Z({}), `feature:settings:${this.settingsKey}`), this.source = n;
234
234
  }
235
235
  get featureConfig() {
236
236
  return this.config.getStore();
@@ -242,10 +242,10 @@ class Dn {
242
242
  this.listeners.add(e);
243
243
  }
244
244
  enable = () => {
245
- this.status.set(Ze.Ready);
245
+ this.status.set(tt.Ready);
246
246
  };
247
247
  disable = () => {
248
- this.status.set(Ze.Suspended);
248
+ this.status.set(tt.Suspended);
249
249
  };
250
250
  setFeatureConfig = ({ settings: e, ...r }) => {
251
251
  let n;
@@ -287,7 +287,7 @@ class re extends Nt {
287
287
  return this.getStore().get();
288
288
  }
289
289
  }
290
- const q = (t) => Lt(t);
290
+ const U = (t) => Lt(t);
291
291
  class se extends Nt {
292
292
  atomStore;
293
293
  constructor(e, r, n) {
@@ -319,8 +319,8 @@ class se extends Nt {
319
319
  key = () => this.getStore().key;
320
320
  off = () => this.getStore().off();
321
321
  }
322
- const B = new Ri();
323
- async function* Mi(t, e) {
322
+ const B = new $i();
323
+ async function* qi(t, e) {
324
324
  for await (const r of e) {
325
325
  t.response.message = r, t.received_at = Date.now(), t.id = Date.now();
326
326
  const n = {
@@ -330,7 +330,7 @@ async function* Mi(t, e) {
330
330
  window.postMessage(n), yield r;
331
331
  }
332
332
  }
333
- const qi = () => (t) => async (e) => {
333
+ const ji = () => (t) => async (e) => {
334
334
  const r = {
335
335
  id: Date.now(),
336
336
  name: e.url,
@@ -359,7 +359,7 @@ const qi = () => (t) => async (e) => {
359
359
  };
360
360
  return window.postMessage(i), {
361
361
  ...n,
362
- message: Mi(r, n.message)
362
+ message: qi(r, n.message)
363
363
  };
364
364
  } else {
365
365
  r.response.message = n.message, r.latency = r.received_at - r.sent_at;
@@ -383,7 +383,7 @@ const qi = () => (t) => async (e) => {
383
383
  }
384
384
  };
385
385
  window.dispatchEvent(new CustomEvent("grpc_devtools_loaded"));
386
- function Rn(t) {
386
+ function $n(t) {
387
387
  return t instanceof DOMException && // everything except Firefox
388
388
  (t.code === 22 || // Firefox
389
389
  t.code === 1014 || // test name field too, because code might not be present
@@ -391,7 +391,7 @@ function Rn(t) {
391
391
  t.name === "QuotaExceededError" || // Firefox
392
392
  t.name === "NS_ERROR_DOM_QUOTA_REACHED");
393
393
  }
394
- class We {
394
+ class Je {
395
395
  delimiter = ":";
396
396
  prefix;
397
397
  storage;
@@ -408,7 +408,7 @@ class We {
408
408
  try {
409
409
  this.storage.setItem(n, r);
410
410
  } catch (i) {
411
- Rn(i) && this.storage === window.sessionStorage && (window.sessionStorage.removeItem("slstreamlogs"), this.storage.setItem(n, r));
411
+ $n(i) && this.storage === window.sessionStorage && (window.sessionStorage.removeItem("slstreamlogs"), this.storage.setItem(n, r));
412
412
  }
413
413
  };
414
414
  read = (...e) => {
@@ -424,7 +424,7 @@ var ie;
424
424
  t.Init = "init", t.Ready = "ready", t.Connecting = "connecting", t.Connected = "connected", t.Disconnected = "disconnected", t.Failed = "failed", t.Reconnect = "reconnect", t.Reconnecting = "reconnecting";
425
425
  })(ie || (ie = {}));
426
426
  const Wr = pe("grpc:stream");
427
- class Ui {
427
+ class xi {
428
428
  params;
429
429
  streamCancel;
430
430
  method;
@@ -448,7 +448,7 @@ class Ui {
448
448
  reconnectMaxDelay: i.reconnectMaxDelay ?? 3e4,
449
449
  reconnectMaxAttempts: i.reconnectMaxAttempts ?? 10,
450
450
  withStore: i.withStore ?? !1
451
- }, this.headers = e, this.listeners = /* @__PURE__ */ new Map(), this.params = n, this.method = r, i.withStore && (this.store = new re(q(null), `subscription:${i.name}:store`)), "subscribe" in n && typeof n.subscribe == "function" && (this.paramsListener = n.subscribe((s) => {
451
+ }, this.headers = e, this.listeners = /* @__PURE__ */ new Map(), this.params = n, this.method = r, i.withStore && (this.store = new re(U(null), `subscription:${i.name}:store`)), "subscribe" in n && typeof n.subscribe == "function" && (this.paramsListener = n.subscribe((s) => {
452
452
  this.state.getValue("status") === ie.Connected && (this.addStateLog(`params updated, reconnect => ${JSON.stringify(s)}`), this.reconnect());
453
453
  })), this.updateState(ie.Ready);
454
454
  }
@@ -463,7 +463,7 @@ class Ui {
463
463
  window.sessionStorage.setItem("slstreamlogs", window.sessionStorage.getItem("slstreamlogs") + `
464
464
  ` + n);
465
465
  } catch (i) {
466
- Rn(i) && window.sessionStorage.removeItem("slstreamlogs"), window.sessionStorage.setItem("slstreamlogs", n);
466
+ $n(i) && window.sessionStorage.removeItem("slstreamlogs"), window.sessionStorage.setItem("slstreamlogs", n);
467
467
  }
468
468
  }
469
469
  };
@@ -485,7 +485,7 @@ class Ui {
485
485
  for await (const o of i)
486
486
  this.attempt = 0, this.onData(o);
487
487
  } catch (n) {
488
- n instanceof rt && n.code != oe.Canceled && this.onStreamError(n);
488
+ n instanceof it && n.code != oe.Canceled && this.onStreamError(n);
489
489
  }
490
490
  })(), this.updateState(ie.Connected);
491
491
  };
@@ -525,7 +525,7 @@ class Ui {
525
525
  */
526
526
  onStreamError = (e) => {
527
527
  if (this.addStateLog(`error => ${e ? JSON.stringify(e) : "undefined"}}`), e !== void 0) {
528
- if (e instanceof rt && e.code !== oe.Canceled) {
528
+ if (e instanceof it && e.code !== oe.Canceled) {
529
529
  this.updateState(ie.Failed), this.state.setValue("error", e), e.code === oe.Unknown && e.cause === "missing trailer" && (this.attempt = 0), this.reconnect();
530
530
  return;
531
531
  }
@@ -533,7 +533,7 @@ class Ui {
533
533
  }
534
534
  };
535
535
  }
536
- const ji = /* @__PURE__ */ new Set([
536
+ const Qi = /* @__PURE__ */ new Set([
537
537
  oe.Unknown,
538
538
  oe.Internal,
539
539
  oe.DeadlineExceeded,
@@ -541,7 +541,7 @@ const ji = /* @__PURE__ */ new Set([
541
541
  oe.FailedPrecondition,
542
542
  oe.Unavailable,
543
543
  oe.DataLoss
544
- ]), Yr = pe("grpc:retry"), xi = (t) => async (e) => {
544
+ ]), Yr = pe("grpc:retry"), Gi = (t) => async (e) => {
545
545
  const r = e.contextValues.get(ur.retryAttempts), n = 300, i = e.contextValues.get(ur.retryDelay);
546
546
  if (e.stream || r === 0)
547
547
  return t(e);
@@ -550,23 +550,23 @@ const ji = /* @__PURE__ */ new Set([
550
550
  try {
551
551
  return await t(e);
552
552
  } catch (s) {
553
- Yr.trace({ attempt: o, error: s }, "retry attempt");
554
- const a = rt.from(s);
555
- if (o >= r || !(a instanceof rt) || !ji.has(a.code))
553
+ Yr.trace({ attempt: o, error: s, url: e.url }, "retry attempt");
554
+ const a = it.from(s);
555
+ if (o >= r || !(a instanceof it) || !Qi.has(a.code))
556
556
  throw s;
557
- const u = Math.min(i, Math.pow(2, o) * n), l = Math.round(u * (1 + Math.random()) / 2);
558
- await new Promise((c) => setTimeout(c, l));
557
+ const u = Math.min(i, Math.pow(2, o) * n), d = Math.round(u * (1 + Math.random()) / 2);
558
+ await new Promise((c) => setTimeout(c, d));
559
559
  }
560
560
  }, ur = {
561
561
  retryAttempts: jr(10, { description: "Number of attempts to retry" }),
562
562
  retryDelay: jr(3e4, { description: "Max delay between retries in milliseconds" })
563
- }, Qi = () => {
563
+ }, Ki = () => {
564
564
  const t = localStorage.getItem("sl-device-id");
565
565
  if (t)
566
566
  return t;
567
567
  const e = or();
568
568
  return localStorage.setItem("sl-device-id", e), e;
569
- }, Gi = () => navigator.userAgentData?.platform || navigator.platform;
569
+ }, zi = () => navigator.userAgentData?.platform || navigator.platform;
570
570
  class Jr {
571
571
  toJsonOptions = {
572
572
  emitDefaultValues: !1,
@@ -587,8 +587,8 @@ class Jr {
587
587
  opts;
588
588
  constructor(e, r) {
589
589
  this.host = e, this.opts = r, this.$headers = new Ce(Z({
590
- "sl-device-id": Qi(),
591
- "sl-device-os": Gi()
590
+ "sl-device-id": Ki(),
591
+ "sl-device-os": zi()
592
592
  }), "transport:headers"), this.initInterceptors(), this.clients = /* @__PURE__ */ new Map(), this.streamClients = /* @__PURE__ */ new Map(), this.subscriptions = /* @__PURE__ */ new Map();
593
593
  const [n, i, o] = Gr({
594
594
  dedupeTime: r?.dedupeTime,
@@ -612,7 +612,7 @@ class Jr {
612
612
  const i = this.subscriptions.get(r);
613
613
  if (i)
614
614
  return i;
615
- const o = new Ui(this.$headers, e, r, n);
615
+ const o = new xi(this.$headers, e, r, n);
616
616
  return this.subscriptions.set(r, o), o;
617
617
  };
618
618
  removeSubscription = (e) => {
@@ -656,11 +656,11 @@ class Jr {
656
656
  o.charAt(0).toLowerCase() + o.slice(1),
657
657
  ...Array.isArray(r) ? r : [r]
658
658
  ], a = [e.typeName, o.charAt(0).toLowerCase() + o.slice(1)];
659
- return { client: i, createRequestOptions: (l) => {
660
- const c = Ti();
661
- for (const f in l) {
659
+ return { client: i, createRequestOptions: (d) => {
660
+ const c = ki();
661
+ for (const f in d) {
662
662
  const p = ur[f];
663
- c.set(p, l[f]);
663
+ c.set(p, d[f]);
664
664
  }
665
665
  return c;
666
666
  }, queryKey: s, queryKeyStr: a.join("") };
@@ -685,11 +685,11 @@ class Jr {
685
685
  n.header.set(o, i[o]);
686
686
  return r(n);
687
687
  };
688
- this.interceptors.push(e), this.interceptors.push(qi()), this.opts?.retryable && this.interceptors.push(xi);
688
+ this.interceptors.push(e), this.interceptors.push(ji()), this.opts?.retryable && this.interceptors.push(Gi);
689
689
  };
690
690
  }
691
- const Ki = (t, e) => {
692
- const { client: r, queryKey: n } = e.createPromiseClient(_n, {
691
+ const Hi = (t, e) => {
692
+ const { client: r, queryKey: n } = e.createPromiseClient(Pn, {
693
693
  method: "retrieveEventId",
694
694
  params: [t]
695
695
  });
@@ -706,7 +706,7 @@ const Ki = (t, e) => {
706
706
  }
707
707
  }
708
708
  });
709
- }, zi = (t, e) => {
709
+ }, Wi = (t, e) => {
710
710
  const { client: r, queryKey: n } = e.createPromiseClient(ot, { method: "getStream", params: [t] });
711
711
  return e.nanoquery.createFetcherStore(n, {
712
712
  fetcher: async (i, o, s) => s ? (await r.getStream({
@@ -714,14 +714,14 @@ const Ki = (t, e) => {
714
714
  // we are sure that id is a string
715
715
  })).data?.attributes : void 0
716
716
  });
717
- }, Hi = (t, e) => {
718
- const { client: r, queryKey: n } = e.createPromiseClient(_n, { method: "summary", params: [t] });
717
+ }, Yi = (t, e) => {
718
+ const { client: r, queryKey: n } = e.createPromiseClient(Pn, { method: "summary", params: [t] });
719
719
  return e.nanoquery.createFetcherStore(n, {
720
720
  fetcher: async (i, o, s) => s ? (await r.summary({
721
721
  id: s
722
722
  })).data?.attributes : void 0
723
723
  });
724
- }, Wi = (t, e) => {
724
+ }, Ji = (t, e) => {
725
725
  const { queryKey: r, client: n } = e.createPromiseClient(Ar, { method: "me", params: [t] });
726
726
  return e.nanoquery.createFetcherStore(r, {
727
727
  fetcher: async () => {
@@ -729,15 +729,15 @@ const Ki = (t, e) => {
729
729
  return { data: i };
730
730
  }
731
731
  });
732
- }, Yi = (t) => {
732
+ }, Xi = (t) => {
733
733
  const { client: e, createRequestOptions: r } = t.createPromiseClient(Ar, { method: "bypassAuth" }), n = r({ retryAttempts: 0 });
734
734
  return ({ userKey: i, schema: o, init: s, inviterKey: a }) => e.bypassAuth({ userKey: i, schema: o, init: s, inviterKey: a }, { contextValues: n });
735
- }, Ji = (t, e) => {
735
+ }, Zi = (t, e) => {
736
736
  const { client: r, queryKey: n } = e.createPromiseClient(ot, { method: "get", params: [t] });
737
737
  return e.nanoquery.createFetcherStore(n, {
738
738
  fetcher: async () => (await r.get({})).data?.attributes
739
739
  });
740
- }, Xi = (t, e) => {
740
+ }, eo = (t, e) => {
741
741
  const { client: r, queryKey: n } = e.createPromiseClient(ot, { method: "getOrganization", params: [t] });
742
742
  return e.nanoquery.createFetcherStore(n, {
743
743
  fetcher: async () => {
@@ -748,7 +748,7 @@ const Ki = (t, e) => {
748
748
  } : void 0;
749
749
  }
750
750
  });
751
- }, Zi = (t, e) => {
751
+ }, to = (t, e) => {
752
752
  const { client: r, queryKey: n } = e.createPromiseClient(ot, {
753
753
  method: "getOrganizationAdvertising",
754
754
  params: [t]
@@ -756,7 +756,7 @@ const Ki = (t, e) => {
756
756
  return e.nanoquery.createFetcherStore(n, {
757
757
  fetcher: async () => (await r.getOrganizationAdvertising({})).data?.attributes
758
758
  });
759
- }, eo = (t, e, r) => {
759
+ }, ro = (t, e, r) => {
760
760
  t.transport = new Jr(e.host, {
761
761
  dedupeTime: 1e3 * 60 * 5,
762
762
  refetchInterval: 1e3 * 60 * 5,
@@ -771,7 +771,7 @@ var ge;
771
771
  (function(t) {
772
772
  t.SCHEMA = "schema", t.EXTERNAL_TOKEN = "eToken", t.TOKEN = "token";
773
773
  })(ge || (ge = {}));
774
- class je extends We {
774
+ class je extends Je {
775
775
  constructor() {
776
776
  super("user");
777
777
  }
@@ -798,19 +798,19 @@ var ve;
798
798
  (function(t) {
799
799
  t.DISABLED = "disabled", t.INITIALIZATION = "initialization", t.READY = "ready", t.FAILED = "failed", t.SUSPENDED = "suspended";
800
800
  })(ve || (ve = {}));
801
- const to = (t) => {
802
- const e = new je(), r = new re(q(e.getExternalToken()), "userKey"), n = new re(q(e.getToken()), "userToken"), i = new se(Wi(n.getStore(), t), "user", ({ data: s, error: a, loading: u }, l) => {
801
+ const no = (t) => {
802
+ const e = new je(), r = new re(U(e.getExternalToken()), "userKey"), n = new re(U(e.getToken()), "userToken"), i = new se(Ji(n.getStore(), t), "user", ({ data: s, error: a, loading: u }, d) => {
803
803
  if (!a)
804
- return s?.data?.id ? s.data.id : u === !1 ? void 0 : l;
805
- }), o = new se(Ji(n.getStore(), t), "userSettings");
804
+ return s?.data?.id ? s.data.id : u === !1 ? void 0 : d;
805
+ }), o = new se(Zi(n.getStore(), t), "userSettings");
806
806
  return {
807
807
  userKey: r,
808
808
  userToken: n,
809
809
  user: i,
810
810
  userSettings: o
811
811
  };
812
- }, ro = (t) => {
813
- const e = new re(q(void 0), "providerStreamId"), r = new se(Ki(e.getStore(), t), "slStreamId", (o) => o?.data), n = new se(zi(r.getAtomStore(), t), "streamSettings"), i = new se(Hi(r.getAtomStore(), t), "streamSettings");
812
+ }, io = (t) => {
813
+ const e = new re(U(void 0), "providerStreamId"), r = new se(Hi(e.getStore(), t), "slStreamId", (o) => o?.data), n = new se(Wi(r.getAtomStore(), t), "streamSettings"), i = new se(Yi(r.getAtomStore(), t), "streamSettings");
814
814
  return r.getAtomStore().listen((o) => {
815
815
  (o === "" || o === void 0) && (n.getStore().mutate(void 0), i.getStore().mutate(void 0));
816
816
  }), {
@@ -819,8 +819,8 @@ const to = (t) => {
819
819
  streamSettings: n,
820
820
  streamSummary: i
821
821
  };
822
- }, no = (t) => {
823
- const e = new re(q(void 0), "enabled"), r = new re(q(ve.DISABLED), "status"), n = new se(Xi(e.getStore(), t), "organizationSettings", (a) => a?.data?.id), i = new se(Zi(n.getAtomStore(), t), "organizationAdvertising"), o = to(t), s = ro(t);
822
+ }, oo = (t) => {
823
+ const e = new re(U(void 0), "enabled"), r = new re(U(ve.DISABLED), "status"), n = new se(eo(e.getStore(), t), "organizationSettings", (a) => a?.data?.id), i = new se(to(n.getAtomStore(), t), "organizationAdvertising"), o = no(t), s = io(t);
824
824
  return {
825
825
  enabled: e,
826
826
  status: r,
@@ -836,10 +836,10 @@ const to = (t) => {
836
836
  organizationAdvertising: i
837
837
  };
838
838
  };
839
- class io extends Nt {
839
+ class so extends Nt {
840
840
  stores;
841
841
  constructor(e) {
842
- const r = no(e), n = $i(r);
842
+ const r = oo(e), n = Mi(r);
843
843
  super(n, "core"), this.stores = r;
844
844
  }
845
845
  getValue() {
@@ -860,17 +860,17 @@ class io extends Nt {
860
860
  };
861
861
  unsubscribe = () => this.getStore().off();
862
862
  }
863
- const oo = (t, e, r) => {
864
- t.store = new io(t.transport), t.stores = t.store.getValues(), t.sdk.enabled = t.stores.enabled.getStore(), t.sdk.status = t.stores.status.getStore(), t.sdk.sdkStore = Object.fromEntries(Object.entries(t.stores).map(([n, i]) => [n, i.getStore()])), t.sdk.organizationStore = () => t.stores.organizationSettings.getStore(), t.sdk.streamStore = () => t.stores.streamSettings.getStore(), t.sdk.streamSummary = () => t.stores.streamSummary.getStore(), t.storeUnsubscribe = () => {
863
+ const ao = (t, e, r) => {
864
+ t.store = new so(t.transport), t.stores = t.store.getValues(), t.sdk.enabled = t.stores.enabled.getStore(), t.sdk.status = t.stores.status.getStore(), t.sdk.sdkStore = Object.fromEntries(Object.entries(t.stores).map(([n, i]) => [n, i.getStore()])), t.sdk.organizationStore = () => t.stores.organizationSettings.getStore(), t.sdk.streamStore = () => t.stores.streamSettings.getStore(), t.sdk.streamSummary = () => t.stores.streamSummary.getStore(), t.storeUnsubscribe = () => {
865
865
  t.store.unsubscribe();
866
866
  }, r();
867
- }, so = (t) => {
868
- const { client: e } = t.createPromiseClient(kn, { method: "list" });
867
+ }, uo = (t) => {
868
+ const { client: e } = t.createPromiseClient(Cn, { method: "list" });
869
869
  return (r) => e.list(r);
870
- }, Vn = (t) => {
871
- const { client: e } = t.createPromiseClient(kn, { method: "summary" });
870
+ }, Bn = (t) => {
871
+ const { client: e } = t.createPromiseClient(Cn, { method: "summary" });
872
872
  return (r) => e.summary(r);
873
- }, ao = (t, e) => {
873
+ }, co = (t, e) => {
874
874
  const { client: r, queryKey: n } = e.createPromiseClient(Ar, {
875
875
  method: "getFriends",
876
876
  params: [t]
@@ -886,7 +886,7 @@ const oo = (t, e, r) => {
886
886
  }
887
887
  }
888
888
  });
889
- }, uo = (t, e) => {
889
+ }, lo = (t, e) => {
890
890
  const { client: r, queryKey: n } = e.createPromiseClient(ee, { method: "get", params: [t] });
891
891
  return e.nanoquery.createFetcherStore(n, {
892
892
  fetcher: async (i, o, s) => (await r.get({
@@ -895,35 +895,38 @@ const oo = (t, e, r) => {
895
895
  refetchInterval: 0,
896
896
  dedupeTime: 1e3 * 60 * 60
897
897
  });
898
- }, co = (t, e) => {
899
- const { client: r, queryKey: n } = e.createPromiseClient(ee, { method: "syncQuestion", params: [t] });
900
- return e.nanoquery.createFetcherStore(n, {
901
- fetcher: async (i, o, s) => {
902
- if (!s)
898
+ }, fo = (t, e, r) => {
899
+ const { client: n, queryKey: i } = r.createPromiseClient(ee, {
900
+ method: "syncQuestion",
901
+ params: [t, e ? "true" : ""]
902
+ });
903
+ return r.nanoquery.createFetcherStore(i, {
904
+ fetcher: async (o, s, a, u) => {
905
+ if (!a || u)
903
906
  return;
904
- const a = await r.syncQuestion({
907
+ const d = await n.syncQuestion({
905
908
  filter: {
906
- eventId: s
909
+ eventId: a
907
910
  }
908
911
  });
909
- if (a.data?.attributes?.question?.type !== I.PROMOTION)
910
- return a.data?.attributes;
912
+ if (d.data?.attributes?.question?.type !== I.PROMOTION)
913
+ return d.data?.attributes;
911
914
  },
912
915
  dedupeTime: 1e3 * 60 * 10,
913
916
  // 10 minutes
914
917
  refetchInterval: 0
915
918
  });
916
- }, lo = async (t, e) => {
919
+ }, po = async (t, e) => {
917
920
  const { client: r } = e.createPromiseClient(ee, { method: "item", params: [t] });
918
921
  return (await r.item({
919
922
  id: t
920
923
  })).data;
921
- }, fo = (t, e) => {
924
+ }, ho = (t, e) => {
922
925
  const { client: r } = e.createStreamClient(ee), n = Lt({ eventId: t.get() || "", feedId: "" });
923
926
  return t.subscribe((o = "") => {
924
927
  n.set({ eventId: o, feedId: "" });
925
928
  }), e.addSubscription(r.subscription, n, { name: "feedSubscription" });
926
- }, po = (t, e) => {
929
+ }, yo = (t, e) => {
927
930
  const { client: r } = e.createStreamClient(ee);
928
931
  return e.addSubscription(r.questionSubscription, { questionId: t }, { name: "questionSubscription" });
929
932
  }, cr = async (t, e) => {
@@ -931,7 +934,7 @@ const oo = (t, e, r) => {
931
934
  return (await r.questionByUser({
932
935
  questionId: t
933
936
  })).data?.attributes?.question;
934
- }, nt = (t, e) => {
937
+ }, Ge = (t, e) => {
935
938
  const { client: r, queryKey: n } = e.createPromiseClient(ee, { method: "questionByUser", params: [t] });
936
939
  return e.nanoquery.createFetcherStore(n, {
937
940
  fetcher: async (i, o, s) => (await r.questionByUser({
@@ -939,7 +942,7 @@ const oo = (t, e, r) => {
939
942
  })).data?.attributes?.question,
940
943
  dedupeTime: 1e3 * 60 * 5
941
944
  });
942
- }, $n = async (t, e) => {
945
+ }, Mn = async (t, e) => {
943
946
  if (!t)
944
947
  return;
945
948
  const { client: r } = e.createPromiseClient(ee, { method: "getQuestion", params: [t] }), n = await r.getQuestion({
@@ -949,23 +952,23 @@ const oo = (t, e, r) => {
949
952
  return;
950
953
  const { options: i, notification: o, ...s } = n.data.attributes, a = i?.options.case === "promotion" ? i?.options.value : void 0;
951
954
  return { id: s.id, question: s, promotion: a, notification: o };
952
- }, ho = (t, e, r) => {
953
- const { client: n, queryKey: i } = r.createPromiseClient(ee, {
955
+ }, mo = (t, e, r, n) => {
956
+ const { client: i, queryKey: o } = n.createPromiseClient(ee, {
954
957
  method: "list",
955
- params: [t, e]
958
+ params: [t, e, r ? "true" : ""]
956
959
  });
957
- return r.nanoquery.createFetcherStore(i, {
958
- fetcher: async (o, s, a, u) => a ? (await n.list({
959
- eventId: a,
960
+ return n.nanoquery.createFetcherStore(o, {
961
+ fetcher: async (s, a, u, d, c) => !u || c ? [] : (await i.list({
962
+ eventId: u,
960
963
  filter: {
961
- types: u === Pe.ALLOWED ? [] : [I.FACTOID, I.PROMOTION, I.TWEET],
962
- statuses: [Y.ACTIVE, Y.RESOLVED]
964
+ types: d === Oe.ALLOWED ? [] : [I.FACTOID, I.PROMOTION, I.TWEET],
965
+ statuses: [G.ACTIVE, G.RESOLVED]
963
966
  }
964
- })).data : [],
967
+ })).data,
965
968
  dedupeTime: 0,
966
969
  refetchInterval: 0
967
970
  });
968
- }, yo = (t, e) => {
971
+ }, go = (t, e) => {
969
972
  const { client: r, queryKey: n } = e.createPromiseClient(ee, {
970
973
  method: "list",
971
974
  params: [t]
@@ -978,7 +981,7 @@ const oo = (t, e, r) => {
978
981
  eventId: s,
979
982
  filter: {
980
983
  types: [I.PROMOTION],
981
- statuses: [Y.ACTIVE]
984
+ statuses: [G.ACTIVE]
982
985
  },
983
986
  pagination: {
984
987
  page: 0,
@@ -986,24 +989,24 @@ const oo = (t, e, r) => {
986
989
  }
987
990
  })).data?.[0];
988
991
  if (u.type === "promotion")
989
- return $n(u.id, e);
992
+ return Mn(u.id, e);
990
993
  },
991
994
  dedupeTime: 0,
992
995
  refetchInterval: 0
993
996
  });
994
- }, mo = (t, e, r, n, i) => {
997
+ }, bo = (t, e, r, n, i) => {
995
998
  const { client: o, queryKey: s } = i.createPromiseClient(ee, {
996
999
  method: "betPack",
997
1000
  params: [t, e, r]
998
1001
  });
999
1002
  return i.nanoquery.createFetcherStore(s, {
1000
- fetcher: async (a, u, l, c, f) => {
1001
- if (!l || !c || !f)
1003
+ fetcher: async (a, u, d, c, f) => {
1004
+ if (!d || !c || !f)
1002
1005
  return null;
1003
1006
  const p = await o.betPack({
1004
- eventId: l,
1007
+ eventId: d,
1005
1008
  types: [I.PREDICTION],
1006
- statuses: [Y.ACTIVE, Y.RESOLVED],
1009
+ statuses: [G.ACTIVE, G.RESOLVED],
1007
1010
  limit: 5,
1008
1011
  sort: {
1009
1012
  field: "activated_at",
@@ -1015,7 +1018,7 @@ const oo = (t, e, r) => {
1015
1018
  if (!m?.id)
1016
1019
  return v;
1017
1020
  const g = {
1018
- eventId: l,
1021
+ eventId: d,
1019
1022
  userId: c,
1020
1023
  organizationId: f
1021
1024
  };
@@ -1031,16 +1034,16 @@ const oo = (t, e, r) => {
1031
1034
  dedupeTime: 0,
1032
1035
  refetchInterval: 0
1033
1036
  });
1034
- }, go = (t, e, r) => {
1035
- const n = Ur([e, r], () => {
1037
+ }, vo = (t, e, r) => {
1038
+ const n = qr([e, r], () => {
1036
1039
  const a = e.get();
1037
1040
  if (!a)
1038
1041
  return;
1039
- const u = r.get().data?.find((c) => c.id === a?.questionId), l = a?.question?.openedFrom;
1040
- return u ? (u.openedFrom = l, u) : a.question;
1041
- }), i = Ur(n, (a) => a && a.type === "question" ? a.id : void 0), o = nt(i, t);
1042
+ const u = r.get().data?.find((c) => c.id === a?.questionId), d = a?.question?.openedFrom;
1043
+ return u ? (u.openedFrom = d, u) : a.question;
1044
+ }), i = qr(n, (a) => a && a.type === "question" ? a.id : void 0), o = Ge(i, t);
1042
1045
  return { $store: n, $extendedStore: o, updateExtendedQuestion: (a) => {
1043
- const u = o.get().data, l = (c, f) => {
1046
+ const u = o.get().data, d = (c, f) => {
1044
1047
  if (!c || !f)
1045
1048
  return c || f || [];
1046
1049
  const p = [];
@@ -1059,7 +1062,7 @@ const oo = (t, e, r) => {
1059
1062
  options: u?.options,
1060
1063
  subject: u?.subject,
1061
1064
  appearance: u?.appearance,
1062
- answers: l(u?.answers, a?.answers)
1065
+ answers: d(u?.answers, a?.answers)
1063
1066
  });
1064
1067
  } };
1065
1068
  };
@@ -1067,7 +1070,7 @@ var At;
1067
1070
  (function(t) {
1068
1071
  t.SHOWED = "showed";
1069
1072
  })(At || (At = {}));
1070
- class bo extends We {
1073
+ class So extends Je {
1071
1074
  constructor() {
1072
1075
  super("advertisement");
1073
1076
  }
@@ -1076,7 +1079,7 @@ class bo extends We {
1076
1079
  };
1077
1080
  isViewed = (e) => this.read(At.SHOWED, e);
1078
1081
  }
1079
- const vo = (t) => {
1082
+ const wo = (t) => {
1080
1083
  const e = t.data?.attributes?.question;
1081
1084
  if ((t.data?.attributes?.feedItem?.type === "promotion" ? t.data.attributes.feedItem : void 0) === void 0 || !e)
1082
1085
  return;
@@ -1087,7 +1090,7 @@ const vo = (t) => {
1087
1090
  notification: i,
1088
1091
  promotion: s
1089
1092
  };
1090
- }, ft = (t) => t.startsWith("http://") || t.startsWith("https://") ? new URL(t).toString() : t, So = ({ gamOptions: t, gamBaseUrl: e }) => {
1093
+ }, ft = (t) => t.startsWith("http://") || t.startsWith("https://") ? new URL(t).toString() : t, Ao = ({ gamOptions: t, gamBaseUrl: e }) => {
1091
1094
  const r = `${e}?`, n = [];
1092
1095
  for (const i in t) {
1093
1096
  const o = i.replace(/([a-zA-Z])(?=[A-Z])/g, "$1_").toLowerCase(), s = t[i];
@@ -1097,14 +1100,14 @@ const vo = (t) => {
1097
1100
  else if (Array.isArray(s))
1098
1101
  n.push(`${o}=${s.map(ft).join(",")}`);
1099
1102
  else {
1100
- const a = Object.entries(s).map(([u, l]) => Array.isArray(l) ? `${u}=${l.map(ft).join(",")}` : typeof l == "string" ? `${u}=${ft(l)}` : `${u}=${l}`).join("&").replaceAll("=", "%3D").replaceAll("&", "%26").replaceAll(",", "%2C");
1103
+ const a = Object.entries(s).map(([u, d]) => Array.isArray(d) ? `${u}=${d.map(ft).join(",")}` : typeof d == "string" ? `${u}=${ft(d)}` : `${u}=${d}`).join("&").replaceAll("=", "%3D").replaceAll("&", "%26").replaceAll(",", "%2C");
1101
1104
  n.push(`${o}=${a}`);
1102
1105
  }
1103
1106
  }
1104
1107
  return r + n.join("&");
1105
- }, Be = (t) => (t?.promotion?.type === U.INGAME_IAB11_LBAR || t?.promotion?.type === U.INGAME_IAB21_LBAR) && !!t.promotion.additionalBanner?.imageUrl, wo = (t, e, r) => {
1108
+ }, Be = (t) => (t?.promotion?.type === q.INGAME_IAB11_LBAR || t?.promotion?.type === q.INGAME_IAB21_LBAR) && !!t.promotion.additionalBanner?.imageUrl, Eo = (t, e, r) => {
1106
1109
  let n = !1;
1107
- const i = r.transport, o = pe("advertisement"), s = new bo(), a = Z({}), u = yo(t, i), l = (m) => {
1110
+ const i = r.transport, o = pe("advertisement"), s = new So(), a = Z({}), u = go(t, i), d = (m) => {
1108
1111
  const g = a.get(), S = g.data?.question.id, F = g.data?.promotion?.type;
1109
1112
  S && (B.emit("advertisement", {
1110
1113
  action: "opened",
@@ -1141,7 +1144,7 @@ const vo = (t) => {
1141
1144
  close: () => p(g.question.id),
1142
1145
  togglePause: (S) => v(g.question.id, S),
1143
1146
  isViewed: !!s.isViewed(g.question.id)
1144
- }) : (a.setKey("loading", !0), $n(m, i).then((S) => a.set({
1147
+ }) : (a.setKey("loading", !0), Mn(m, i).then((S) => a.set({
1145
1148
  loading: !1,
1146
1149
  error: void 0,
1147
1150
  data: S,
@@ -1157,8 +1160,8 @@ const vo = (t) => {
1157
1160
  };
1158
1161
  a.subscribe((m, g) => {
1159
1162
  if (!(m.data?.id === g?.data?.id && m.isPaused !== g?.isPaused)) {
1160
- if (m.data?.promotion?.type === U.EXTERNAL_AD && !m?.externalAd && m.data.promotion.adCampaigns?.gamOptions && m.data.promotion.adCampaigns?.gamBaseUrl) {
1161
- const S = So(m.data.promotion.adCampaigns);
1163
+ if (m.data?.promotion?.type === q.EXTERNAL_AD && !m?.externalAd && m.data.promotion.adCampaigns?.gamOptions && m.data.promotion.adCampaigns?.gamBaseUrl) {
1164
+ const S = Ao(m.data.promotion.adCampaigns);
1162
1165
  a.setKey("externalAd", { type: "gam", url: S });
1163
1166
  }
1164
1167
  m.data?.promotion && !m.isOpened && (B.emit("advertisement", {
@@ -1201,26 +1204,26 @@ const vo = (t) => {
1201
1204
  n || (n = !0, u.subscribe((m, g) => {
1202
1205
  m.data && (!g?.data || m.data.id !== g.data.id) && f(m.data.question.id, m.data);
1203
1206
  }), e.addListener("promotion", (m) => {
1204
- const g = vo(m);
1207
+ const g = wo(m);
1205
1208
  if (g) {
1206
- if (g.question.status === Y.RESOLVED) {
1209
+ if (g.question.status === G.RESOLVED) {
1207
1210
  p(g.question.id), o.debug({ promotion: g }, "resolved: %o");
1208
1211
  return;
1209
1212
  }
1210
- if (g.question.status === Y.ACTIVE) {
1213
+ if (g.question.status === G.ACTIVE) {
1211
1214
  o.debug({ promotion: g }, "active: %o"), f(g.question.id, g);
1212
1215
  return;
1213
1216
  }
1214
1217
  o.debug({ promotion: g }, "skip: %o");
1215
1218
  }
1216
1219
  }));
1217
- }, hide: p, show: f, open: l, markAsViewed: c, $store: a };
1220
+ }, hide: p, show: f, open: d, markAsViewed: c, $store: a };
1218
1221
  };
1219
1222
  var ce;
1220
1223
  (function(t) {
1221
1224
  t.ONBOARDING = "onboarding", t.ONBOARDING_IO = "onboarding_io", t.BET_PACK_ITEM_RECEIVED = "bp-item-received", t.QUESTION_OPENED = "q-opened";
1222
1225
  })(ce || (ce = {}));
1223
- class Ao extends We {
1226
+ class Io extends Je {
1224
1227
  constructor() {
1225
1228
  super("gamification-session", window.sessionStorage);
1226
1229
  }
@@ -1229,10 +1232,10 @@ class Ao extends We {
1229
1232
  };
1230
1233
  readValue = (e) => this.read(...e);
1231
1234
  }
1232
- class Eo extends We {
1235
+ class Oo extends Je {
1233
1236
  sessionStorage;
1234
1237
  constructor() {
1235
- super("gamification"), this.sessionStorage = new Ao();
1238
+ super("gamification"), this.sessionStorage = new Io();
1236
1239
  }
1237
1240
  saveBetPackQuestionReceived = ({ userId: e, eventId: r, organizationId: n }, i) => {
1238
1241
  this.write(ce.BET_PACK_ITEM_RECEIVED, n, e, r, i);
@@ -1251,11 +1254,11 @@ class Eo extends We {
1251
1254
  };
1252
1255
  getOnboardingInstantOpen = ({ userId: e, eventId: r, organizationId: n }) => this.sessionStorage.readValue([ce.ONBOARDING_IO, n, e, r]);
1253
1256
  }
1254
- var Pe;
1257
+ var Oe;
1255
1258
  (function(t) {
1256
1259
  t.ALLOWED = "allowed", t.DISALLOWED = "disallowed";
1257
- })(Pe || (Pe = {}));
1258
- class Io {
1260
+ })(Oe || (Oe = {}));
1261
+ class To {
1259
1262
  /** sl event id */
1260
1263
  slStreamId;
1261
1264
  /** organization id */
@@ -1290,76 +1293,78 @@ class Io {
1290
1293
  transport;
1291
1294
  cancels = /* @__PURE__ */ new Set();
1292
1295
  constructor(e) {
1293
- this.transport = e.transport, this.log = pe("gamification-background"), this.storage = new Eo(), this.slStreamId = e.stores.slStreamId.getAtomStore(), this.organizationId = e.stores.organizationSettings.getAtomStore(), this.userId = e.stores.user.getAtomStore(), this.moderationId = new re(q(void 0), "moderationId").getStore(), this.interactiveAllowed = new re(q(Pe.DISALLOWED), "interactiveAllowed").getStore(), this.openedQuestionId = new re(q(void 0), "openedQuestionId").getStore(), this.notifications = e.notifications, this.moderation = new se(uo(this.slStreamId, e.transport), "gamification:moderation"), this.feedList = new se(ho(this.slStreamId, this.interactiveAllowed, e.transport), "gamification:feedList"), this.betPack = new se(mo(this.slStreamId, this.userId, this.organizationId, this.storage, e.transport), "gamification:betPack"), this.activeQuestionId = co(this.slStreamId, e.transport), this.openedQuestion = go(e.transport, this.openedQuestionId, this.feedList.getStore()), this.cancels.add(this.openedQuestionId.listen((r) => {
1294
- this.log.debug({ item: r }, "received question"), r?.questionId ? (this.questionSubscription = po(r.questionId, e.transport), this.questionSubscription.addListener("feed-subscription-opened-question", async (n) => {
1295
- const i = n.data?.attributes?.question;
1296
- if (this.openedQuestion.updateExtendedQuestion(i), i?.type === I.PREDICTION) {
1297
- const o = this.betPack.getValues().data || {};
1298
- if (o?.[i.id] || Object.keys(o).length < 5) {
1299
- const a = nt(i.id, this.transport), u = a.subscribe(() => {
1296
+ this.transport = e.transport, this.log = pe("gamification-background"), this.storage = new Oo(), this.slStreamId = e.stores.slStreamId.getAtomStore(), this.organizationId = e.stores.organizationSettings.getAtomStore(), this.userId = e.stores.user.getAtomStore(), this.moderationId = new re(U(void 0), "moderationId").getStore(), this.interactiveAllowed = new re(U(Oe.DISALLOWED), "interactiveAllowed").getStore(), this.openedQuestionId = new re(U(void 0), "openedQuestionId").getStore(), this.notifications = e.notifications, this.moderation = new se(lo(this.slStreamId, e.transport), "gamification:moderation");
1297
+ const r = !!e.sdk.options.get().betPack;
1298
+ this.feedList = new se(mo(this.slStreamId, this.interactiveAllowed, r, e.transport), "gamification:feedList"), this.betPack = new se(bo(this.slStreamId, this.userId, this.organizationId, this.storage, e.transport), "gamification:betPack"), this.activeQuestionId = fo(this.slStreamId, r, e.transport), this.openedQuestion = vo(e.transport, this.openedQuestionId, this.feedList.getStore()), this.cancels.add(this.openedQuestionId.listen((n) => {
1299
+ this.log.debug({ item: n }, "received question"), n?.questionId ? (this.questionSubscription = yo(n.questionId, e.transport), this.questionSubscription.addListener("feed-subscription-opened-question", async (i) => {
1300
+ const o = i.data?.attributes?.question;
1301
+ if (this.openedQuestion.updateExtendedQuestion(o), o?.type === I.PREDICTION && (o.status === G.ACTIVE || o.status === G.RESOLVED)) {
1302
+ const s = this.betPack.getValues().data || {};
1303
+ if (s?.[o.id] || Object.keys(s).length < 5) {
1304
+ const u = Ge(o.id, this.transport), d = u.subscribe(() => {
1300
1305
  });
1301
- await a.get().promise;
1302
- const l = await cr(i.id, this.transport);
1303
- u(), window.requestAnimationFrame(() => {
1304
- a.invalidate();
1306
+ await u.get().promise;
1307
+ let c = u.get().data;
1308
+ c || (c = await cr(o.id, this.transport)), d(), window.requestAnimationFrame(() => {
1309
+ u.invalidate();
1305
1310
  }), this.betPack.getStore().mutate({
1306
- ...o,
1307
- [i.id]: l
1311
+ ...s,
1312
+ [o.id]: c
1308
1313
  });
1309
1314
  }
1310
1315
  }
1311
1316
  }), this.questionSubscription.connect()) : (this.log.info("cleanup on close question"), this.questionSubscription !== void 0 && (e.transport.removeSubscription(this.questionSubscription), this.questionSubscription = void 0));
1312
- })), this.feedSubscription = fo(this.slStreamId, e.transport), this.cancels.add(this.feedSubscription.addListener("bet-pack-update", async (r) => {
1313
- const n = r.data?.attributes?.question;
1314
- if (n?.type === I.PREDICTION) {
1315
- const i = this.betPack.getValues().data || {};
1316
- if (i?.[n.id] || Object.keys(i).length < 5) {
1317
- const s = nt(n.id, this.transport), a = s.subscribe(() => {
1317
+ })), this.feedSubscription = ho(this.slStreamId, e.transport), this.cancels.add(this.feedSubscription.addListener("bet-pack-update", async (n) => {
1318
+ const i = n.data?.attributes?.question;
1319
+ if (i?.type === I.PREDICTION && (i.status === G.ACTIVE || i.status === G.RESOLVED)) {
1320
+ const o = this.betPack.getValues().data || {};
1321
+ if (o?.[i.id] || Object.keys(o).length < 5) {
1322
+ const a = Ge(i.id, this.transport), u = a.subscribe(() => {
1318
1323
  });
1319
- await s.get().promise;
1320
- let u = s.get().data;
1321
- u || (u = await cr(n.id, this.transport)), a(), window.requestAnimationFrame(() => {
1322
- s.invalidate();
1324
+ await a.get().promise;
1325
+ let d = a.get().data;
1326
+ d || (d = await cr(i.id, this.transport)), u(), window.requestAnimationFrame(() => {
1327
+ a.invalidate();
1323
1328
  }), this.betPack.getStore().mutate({
1324
- ...i,
1325
- [n.id]: u
1329
+ ...o,
1330
+ [i.id]: d
1326
1331
  });
1327
1332
  }
1328
1333
  }
1329
- })), this.cancels.add(this.feedSubscription.addListener("feed-subscription-active-question", (r) => {
1330
- const n = this.activeQuestionId.get().data?.question?.id, i = r.data?.attributes?.question;
1331
- if (!(!i || i.type === I.PROMOTION)) {
1332
- if (i.status === Y.RESOLVED) {
1333
- n === i.id && this.activeQuestionId.mutate(void 0);
1334
+ })), this.cancels.add(this.feedSubscription.addListener("feed-subscription-active-question", (n) => {
1335
+ const i = this.activeQuestionId.get().data?.question?.id, o = n.data?.attributes?.question;
1336
+ if (!(!o || o.type === I.PROMOTION)) {
1337
+ if (o.status === G.RESOLVED) {
1338
+ i === o.id && this.activeQuestionId.mutate(void 0);
1334
1339
  return;
1335
1340
  }
1336
1341
  window.requestAnimationFrame(() => {
1337
- this.activeQuestionId.mutate(r.data?.attributes);
1342
+ this.activeQuestionId.mutate(n.data?.attributes);
1338
1343
  });
1339
1344
  }
1340
- })), this.cancels.add(this.feedSubscription.addListener("moderation update", (r) => {
1345
+ })), this.cancels.add(this.feedSubscription.addListener("moderation update", (n) => {
1341
1346
  window.requestAnimationFrame(() => {
1342
- r.data?.attributes?.question === void 0 && r.data?.attributes?.moderation && this.moderation.invalidate();
1347
+ n.data?.attributes?.question === void 0 && n.data?.attributes?.moderation && this.moderation.invalidate();
1343
1348
  });
1344
- })), this.cancels.add(this.activeQuestionId.subscribe((r, n) => {
1345
- r.data?.feedItem && r.data?.feedItem?.id !== n?.data?.feedItem?.id && e.onQuestionActivate({
1349
+ })), this.cancels.add(this.activeQuestionId.subscribe((n, i) => {
1350
+ n.data?.feedItem && n.data?.feedItem?.id !== i?.data?.feedItem?.id && e.onQuestionActivate({
1346
1351
  stage: "activate",
1347
- id: r.data.feedItem.id,
1352
+ id: n.data.feedItem.id,
1348
1353
  isViewed: !!this.notifications.isViewed(this.getCurrentSessionId({
1349
1354
  prefix: "notification",
1350
- entity: r.data.feedItem.id
1355
+ entity: n.data.feedItem.id
1351
1356
  })),
1352
1357
  hasNotification: !0,
1353
- type: r.data.feedItem.type
1354
- }), !r.data?.feedItem && n?.data?.feedItem && e.onQuestionActivate({
1358
+ type: n.data.feedItem.type
1359
+ }), !n.data?.feedItem && i?.data?.feedItem && e.onQuestionActivate({
1355
1360
  stage: "deactivate",
1356
- id: n.data.feedItem.id,
1361
+ id: i.data.feedItem.id,
1357
1362
  isViewed: !!this.notifications.isViewed(this.getCurrentSessionId({
1358
1363
  prefix: "notification",
1359
- entity: n.data.feedItem.id
1364
+ entity: i.data.feedItem.id
1360
1365
  })),
1361
1366
  hasNotification: !0,
1362
- type: n.data.feedItem.type
1367
+ type: i.data.feedItem.type
1363
1368
  });
1364
1369
  })), this.feedSubscription.connect(), this.cancels.add(this.interactiveAllowed.listen(() => {
1365
1370
  window.requestAnimationFrame(() => {
@@ -1367,9 +1372,9 @@ class Io {
1367
1372
  });
1368
1373
  })), e.sdk.onMount({ name: "gamification-background" }, () => () => {
1369
1374
  this.activeQuestionId.off();
1370
- for (const r of this.cancels)
1371
- r(), this.cancels.delete(r);
1372
- }), this.advertisement = wo(this.slStreamId, this.feedSubscription, e);
1375
+ for (const n of this.cancels)
1376
+ n(), this.cancels.delete(n);
1377
+ }), r || (this.advertisement = Eo(this.slStreamId, this.feedSubscription, e));
1373
1378
  }
1374
1379
  /**
1375
1380
  * Get id for notifications and link with current session
@@ -1399,7 +1404,7 @@ class Io {
1399
1404
  this.openedQuestionId.set(void 0), e && this.notifications.markAsViewed(this.getCurrentSessionId({ prefix: "notification", entity: e }));
1400
1405
  };
1401
1406
  }
1402
- class Oo {
1407
+ class _o {
1403
1408
  notificationsList;
1404
1409
  store;
1405
1410
  timeouts;
@@ -1408,7 +1413,7 @@ class Oo {
1408
1413
  options;
1409
1414
  logger;
1410
1415
  constructor(e) {
1411
- this.options = e, this.logger = pe("notifications"), this.store = /* @__PURE__ */ new Map(), this.timeouts = /* @__PURE__ */ new Map(), this.waitingQueue = /* @__PURE__ */ new Set(), this.activeQueue = /* @__PURE__ */ new Set(), this.notificationsList = q(/* @__PURE__ */ new Map());
1416
+ this.options = e, this.logger = pe("notifications"), this.store = /* @__PURE__ */ new Map(), this.timeouts = /* @__PURE__ */ new Map(), this.waitingQueue = /* @__PURE__ */ new Set(), this.activeQueue = /* @__PURE__ */ new Set(), this.notificationsList = U(/* @__PURE__ */ new Map());
1412
1417
  }
1413
1418
  addToQueue = (e) => {
1414
1419
  if (this.store.has(e.id)) {
@@ -1499,7 +1504,7 @@ var Et;
1499
1504
  (function(t) {
1500
1505
  t.OPENED = "opened";
1501
1506
  })(Et || (Et = {}));
1502
- class To extends We {
1507
+ class ko extends Je {
1503
1508
  constructor() {
1504
1509
  super("notification");
1505
1510
  }
@@ -1511,11 +1516,11 @@ class To extends We {
1511
1516
  this.clear();
1512
1517
  };
1513
1518
  }
1514
- class _o {
1519
+ class Po {
1515
1520
  queue;
1516
1521
  storage;
1517
1522
  constructor(e = {}) {
1518
- this.storage = new To(), this.queue = new Oo({ concurrency: 1, animationDelay: 1600, ...e });
1523
+ this.storage = new ko(), this.queue = new _o({ concurrency: 1, animationDelay: 1600, ...e });
1519
1524
  }
1520
1525
  isViewed = (e) => this.storage.isOpened(e);
1521
1526
  add = (e) => {
@@ -1552,36 +1557,36 @@ class _o {
1552
1557
  this.storage.setOpened(e);
1553
1558
  };
1554
1559
  }
1555
- const ko = (t, e, r) => {
1556
- t.notifications = new _o(void 0), t.addNotification = t.notifications.add, t.sdk.getNotificationsStore = () => t.notifications.getQueueStore(), t.sdk.getActiveNotification = () => t.notifications.getActiveNotification(), t.sdk.onMount({ name: "notifications" }, () => () => {
1560
+ const Co = (t, e, r) => {
1561
+ t.notifications = new Po(void 0), t.addNotification = t.notifications.add, t.sdk.getNotificationsStore = () => t.notifications.getQueueStore(), t.sdk.getActiveNotification = () => t.notifications.getActiveNotification(), t.sdk.onMount({ name: "notifications" }, () => () => {
1557
1562
  t.notifications.queue.drain();
1558
1563
  }), r();
1559
1564
  };
1560
- var it;
1565
+ var He;
1561
1566
  (function(t) {
1562
1567
  t.UNKNOWN = "unknown", t.ALREADY_VOTED = "already_voted";
1563
- })(it || (it = {}));
1564
- const Co = async (t, e) => {
1568
+ })(He || (He = {}));
1569
+ const Xr = async (t, e) => {
1565
1570
  const { client: r, createRequestOptions: n } = t.createPromiseClient(ee, { method: "submitAnswer" }), i = n({ retryAttempts: 0 });
1566
1571
  try {
1567
1572
  return await r.submitAnswer({ data: e }, { contextValues: i });
1568
1573
  } catch (o) {
1569
- throw rt.from(o)?.code === oe.AlreadyExists ? new Error(it.ALREADY_VOTED) : new Error(it.UNKNOWN);
1574
+ throw it.from(o)?.code === oe.AlreadyExists ? new Error(He.ALREADY_VOTED) : new Error(He.UNKNOWN);
1570
1575
  }
1571
- }, Bn = (t, e) => {
1576
+ }, Un = (t, e) => {
1572
1577
  const { client: r, createRequestOptions: n } = t.createPromiseClient(ee, { method: "submitInplay" }), i = n({ retryAttempts: 0 });
1573
1578
  return r.submitInplay({ data: { eventId: +e } }, { contextValues: i });
1574
- }, Po = {
1579
+ }, Lo = {
1575
1580
  pageSize: 10
1576
- }, Lo = (t, e, r, n, i) => {
1581
+ }, No = (t, e, r, n, i) => {
1577
1582
  let o = 0;
1578
- const s = q({ pageSize: Po.pageSize, page: 0 }), a = Z({
1583
+ const s = U({ pageSize: Lo.pageSize, page: 0 }), a = Z({
1579
1584
  data: [],
1580
1585
  key: Date.now(),
1581
1586
  hasMore: !0,
1582
1587
  loading: void 0,
1583
1588
  error: void 0
1584
- }), u = so(t), l = async () => {
1589
+ }), u = uo(t), d = async () => {
1585
1590
  const p = e.get(), v = n?.getStore().get().data?.map((w) => w.slId) || [];
1586
1591
  if (p && v?.length) {
1587
1592
  const w = r.get();
@@ -1601,19 +1606,19 @@ const Co = async (t, e) => {
1601
1606
  }), g.meta && (o = Math.round(g.meta.count / g.meta.pageSize));
1602
1607
  }
1603
1608
  }, c = () => {
1604
- l();
1609
+ d();
1605
1610
  }, f = (p) => {
1606
1611
  const v = s.get(), w = p || v.page + 1;
1607
1612
  w <= o && s.set({ ...v, page: w });
1608
1613
  };
1609
1614
  return wr(a, () => {
1610
- const p = e.listen(l), v = n?.listen(l);
1615
+ const p = e.listen(d), v = n?.listen(d);
1611
1616
  return () => {
1612
1617
  p(), v?.();
1613
1618
  };
1614
1619
  }), { $store: a, fetchMore: f, invalidate: c };
1615
1620
  };
1616
- class No extends We {
1621
+ class Fo extends Je {
1617
1622
  get = this.read;
1618
1623
  set = this.write;
1619
1624
  del = this.remove;
@@ -1621,52 +1626,52 @@ class No extends We {
1621
1626
  super("deep-link-context", window.sessionStorage);
1622
1627
  }
1623
1628
  }
1624
- const Xr = "sldl", Ft = "sldl_uid", Mn = "sldl_eid", qn = "sldl_e_eid", Fo = /* @__PURE__ */ new Set([Ft, Mn, qn]), Zr = (t) => {
1629
+ const Zr = "sldl", Ft = "sldl_uid", qn = "sldl_eid", jn = "sldl_e_eid", Do = /* @__PURE__ */ new Set([Ft, qn, jn]), en = (t) => {
1625
1630
  const e = {}, r = {};
1626
1631
  for (const [n, i] of t)
1627
- Fo.has(n) ? e[n] = i : r[n] = i;
1632
+ Do.has(n) ? e[n] = i : r[n] = i;
1628
1633
  return { result: e, remain: r };
1629
- }, Do = ({ hash: t, search: e }) => {
1630
- if (t && t.includes(Xr)) {
1634
+ }, Ro = ({ hash: t, search: e }) => {
1635
+ if (t && t.includes(Zr)) {
1631
1636
  const r = new URLSearchParams(t.substr(1));
1632
- return { hash: Zr(r) };
1637
+ return { hash: en(r) };
1633
1638
  }
1634
- if (e && e.includes(Xr)) {
1639
+ if (e && e.includes(Zr)) {
1635
1640
  const r = new URLSearchParams(e);
1636
- return { search: Zr(r) };
1641
+ return { search: en(r) };
1637
1642
  }
1638
1643
  return null;
1639
- }, en = pe("deep_link"), fe = {
1644
+ }, tn = pe("deep_link"), fe = {
1640
1645
  debug: (...t) => {
1641
- en.debug(...t), localStorage.getItem("SL_DEBUG") && console.log(...t);
1646
+ tn.debug(...t), localStorage.getItem("SL_DEBUG") && console.log(...t);
1642
1647
  },
1643
1648
  trace: (...t) => {
1644
- en.trace(...t), localStorage.getItem("SL_DEBUG") && console.log(...t);
1649
+ tn.trace(...t), localStorage.getItem("SL_DEBUG") && console.log(...t);
1645
1650
  }
1646
- }, Ro = (t, e) => {
1651
+ }, Vo = (t, e) => {
1647
1652
  const { hash: r, search: n } = window.location;
1648
1653
  if (fe.debug({ hash: r, search: n }, "get deep link data from"), r || n) {
1649
- const i = Do({ hash: r, search: n });
1654
+ const i = Ro({ hash: r, search: n });
1650
1655
  if (fe.debug(i, "parse deep link result"), i) {
1651
1656
  const { hash: o, search: s } = i, { result: a, remain: u } = o || s;
1652
1657
  if (Object.keys(a).length !== 0) {
1653
1658
  t.setValue("data", a);
1654
- const l = Object.keys(u).length !== 0;
1659
+ const d = Object.keys(u).length !== 0;
1655
1660
  if (o) {
1656
1661
  let c = "";
1657
- l && (c = `#${new URLSearchParams(u).toString()}`, fe.debug({ updatedHash: c }, "update hash")), window.history.replaceState(null, "", window.location.pathname + window.location.search + c);
1662
+ d && (c = `#${new URLSearchParams(u).toString()}`, fe.debug({ updatedHash: c }, "update hash")), window.history.replaceState(null, "", window.location.pathname + window.location.search + c);
1658
1663
  }
1659
1664
  if (s) {
1660
1665
  let c = "";
1661
- l && (c = `?${new URLSearchParams(u).toString()}`, fe.debug({ updatedSearch: c }, "update search")), window.history.replaceState(null, "", window.location.pathname + c + window.location.hash);
1666
+ d && (c = `?${new URLSearchParams(u).toString()}`, fe.debug({ updatedSearch: c }, "update search")), window.history.replaceState(null, "", window.location.pathname + c + window.location.hash);
1662
1667
  }
1663
1668
  e(a);
1664
1669
  }
1665
1670
  }
1666
1671
  }
1667
1672
  t.setValue("parsed", !0);
1668
- }, Vo = (t, e, r) => {
1669
- const n = new No(), i = n.get("sl-deep-link-store");
1673
+ }, $o = (t, e, r) => {
1674
+ const n = new Fo(), i = n.get("sl-deep-link-store");
1670
1675
  let o = {};
1671
1676
  if (i)
1672
1677
  try {
@@ -1700,19 +1705,19 @@ const Xr = "sldl", Ft = "sldl_uid", Mn = "sldl_eid", qn = "sldl_e_eid", Fo = /*
1700
1705
  for (const u of t.deepLink.onDeepLinkHandlers)
1701
1706
  try {
1702
1707
  fe.trace("called handler"), u(a);
1703
- } catch (l) {
1704
- console.error(l);
1708
+ } catch (d) {
1709
+ console.error(d);
1705
1710
  }
1706
1711
  };
1707
- Ro(t.deepLink.$store, s), r();
1708
- }, $o = pe("bypass");
1709
- class Bo extends Vi {
1712
+ Vo(t.deepLink.$store, s), r();
1713
+ }, Bo = pe("bypass");
1714
+ class Mo extends Bi {
1710
1715
  $coreStore;
1711
1716
  deepLink;
1712
1717
  transport;
1713
1718
  bypassLogin;
1714
1719
  constructor(e, r, n) {
1715
- super(), this.$coreStore = e, this.deepLink = n, this.transport = r, this.bypassLogin = Yi(this.transport), this.connect();
1720
+ super(), this.$coreStore = e, this.deepLink = n, this.transport = r, this.bypassLogin = Xi(this.transport), this.connect();
1716
1721
  }
1717
1722
  me = async () => (this.$coreStore.getValues().user.invalidate(), (await this.$coreStore.getValues().user.getValue())?.data);
1718
1723
  /**
@@ -1724,7 +1729,7 @@ class Bo extends Vi {
1724
1729
  login = async (e, r) => {
1725
1730
  this.$coreStore.getValues().userKey.setValue(r);
1726
1731
  const { used: n, data: i } = this.deepLink.getDeepLinkData(), o = n ? "" : i?.[Ft];
1727
- $o.debug({ inviterKey: o }, "login with inviterKey");
1732
+ Bo.debug({ inviterKey: o }, "login with inviterKey");
1728
1733
  const s = await this.bypassLogin({
1729
1734
  schema: e,
1730
1735
  userKey: r,
@@ -1794,25 +1799,25 @@ class Bo extends Vi {
1794
1799
  });
1795
1800
  };
1796
1801
  }
1797
- const Xe = new je(), Mo = (t, e, r) => {
1798
- t.auth = new Bo(t.store, t.transport, t.deepLink), t.stores.status.listen((n) => {
1802
+ const et = new je(), Uo = (t, e, r) => {
1803
+ t.auth = new Mo(t.store, t.transport, t.deepLink), t.stores.status.listen((n) => {
1799
1804
  n === ve.READY && t.auth.reLogin();
1800
1805
  }), t.sdk.userId = t.stores.user.getAtomStore, t.sdk.authorizationBypass = async (n, i) => {
1801
- if (!(Xe.getSchema() === n && Xe.getExternalToken() === i && t.transport.getHeader("authorization")))
1806
+ if (!(et.getSchema() === n && et.getExternalToken() === i && t.transport.getHeader("authorization")))
1802
1807
  try {
1803
- await t.auth.login(n, i), Xe.setSchema(n), Xe.setExternalToken(i);
1808
+ await t.auth.login(n, i), et.setSchema(n), et.setExternalToken(i);
1804
1809
  } catch {
1805
1810
  t.sdk.logout();
1806
1811
  }
1807
1812
  }, t.sdk.logout = () => {
1808
- t.auth.logout(), Xe.clear();
1813
+ t.auth.logout(), et.clear();
1809
1814
  }, t.sdk.getUserStore = () => t.stores.user.getStore(), t.sdk.isUserAuthorized = () => t.auth.isAuthenticated(), r();
1810
- }, tn = pe("video_player"), pt = {
1815
+ }, rn = pe("video_player"), pt = {
1811
1816
  debug: (...t) => {
1812
- tn.debug(...t), localStorage.getItem("SL_DEBUG") && console.log(...t);
1817
+ rn.debug(...t), localStorage.getItem("SL_DEBUG") && console.log(...t);
1813
1818
  },
1814
1819
  trace: (...t) => {
1815
- tn.trace(...t), localStorage.getItem("SL_DEBUG") && console.log(...t);
1820
+ rn.trace(...t), localStorage.getItem("SL_DEBUG") && console.log(...t);
1816
1821
  }
1817
1822
  }, qo = (t, e, r) => {
1818
1823
  t.videoPlayer = {
@@ -1832,13 +1837,13 @@ const Xe = new je(), Mo = (t, e, r) => {
1832
1837
  }
1833
1838
  }
1834
1839
  }, r();
1835
- }, Uo = {
1840
+ }, jo = {
1836
1841
  [I.FACTOID]: "insight",
1837
1842
  [I.POLL]: "poll",
1838
1843
  [I.TRIVIA]: "trivia",
1839
1844
  [I.PREDICTION]: "prediction",
1840
1845
  [I.TWEET]: "tweet"
1841
- }, jo = (t, e, r) => {
1846
+ }, xo = (t, e, r) => {
1842
1847
  t.sdk.uiState = Z({}), t.ui = {
1843
1848
  enableAppNotification: function() {
1844
1849
  t.sdk.uiState.setKey("appNotification", !0);
@@ -1872,11 +1877,20 @@ const Xe = new je(), Mo = (t, e, r) => {
1872
1877
  };
1873
1878
  t.onQuestionActivate = ({ questionType: i, ...o }) => {
1874
1879
  if (t.ui.onContentActivate) {
1875
- const s = o.type || i && Uo[i] || "question";
1876
- t.ui.onContentActivate({ ...o, type: s });
1880
+ const s = o.type || i && jo[i] || "question";
1881
+ t.ui.enableAppNotification(), t.ui.onContentActivate({ ...o, type: s });
1877
1882
  }
1878
1883
  }, t.sdk.onMount({ name: "ui" }, () => {
1879
1884
  const i = (a) => {
1885
+ if (a.slEventBus?.type === "app")
1886
+ switch (a.slEventBus.action) {
1887
+ case "open":
1888
+ t.ui.enableApp();
1889
+ break;
1890
+ case "close":
1891
+ t.ui.disableApp();
1892
+ break;
1893
+ }
1880
1894
  if (a.slEventBus?.type === "notification") {
1881
1895
  const u = a.slEventBus.action;
1882
1896
  if (a.slEventBus.payload.type === Ae.ONBOARDING)
@@ -1899,11 +1913,11 @@ const Xe = new je(), Mo = (t, e, r) => {
1899
1913
  }
1900
1914
  }
1901
1915
  if (a.slEventBus?.type === "advertisement" && e.withAd) {
1902
- const u = a.slEventBus, { hasNotification: l, hasBanner: c, id: f, isViewed: p, type: v } = u.payload;
1916
+ const u = a.slEventBus, { hasNotification: d, hasBanner: c, id: f, isViewed: p, type: v } = u.payload;
1903
1917
  switch (u.action) {
1904
1918
  case "notification-opened":
1905
1919
  t.sdk.uiState.set({
1906
- promotionExternalAd: v === U.EXTERNAL_AD,
1920
+ promotionExternalAd: v === q.EXTERNAL_AD,
1907
1921
  promotionBanner: c,
1908
1922
  promotionNotification: !1,
1909
1923
  promotionOverlay: !0,
@@ -1914,7 +1928,7 @@ const Xe = new je(), Mo = (t, e, r) => {
1914
1928
  if (t.sdk.closeFeature(), n({
1915
1929
  stage: "activate",
1916
1930
  id: f,
1917
- hasNotification: l,
1931
+ hasNotification: d,
1918
1932
  hasBanner: c,
1919
1933
  isViewed: p
1920
1934
  }), !e.withAdNotification) {
@@ -1923,11 +1937,11 @@ const Xe = new je(), Mo = (t, e, r) => {
1923
1937
  onboardingNotification: t.sdk.uiState.get().onboardingNotification,
1924
1938
  promotionOverlay: !0,
1925
1939
  promotionSidebar: !0,
1926
- promotionExternalAd: v === U.EXTERNAL_AD
1940
+ promotionExternalAd: v === q.EXTERNAL_AD
1927
1941
  });
1928
1942
  break;
1929
1943
  }
1930
- l ? t.sdk.uiState.set({
1944
+ d ? t.sdk.uiState.set({
1931
1945
  onboardingNotification: t.sdk.uiState.get().onboardingNotification,
1932
1946
  promotionNotification: !0
1933
1947
  }) : t.sdk.uiState.set({
@@ -1935,7 +1949,7 @@ const Xe = new je(), Mo = (t, e, r) => {
1935
1949
  promotionBanner: c,
1936
1950
  promotionOverlay: !0,
1937
1951
  promotionSidebar: !0,
1938
- promotionExternalAd: v === U.EXTERNAL_AD
1952
+ promotionExternalAd: v === q.EXTERNAL_AD
1939
1953
  });
1940
1954
  break;
1941
1955
  case "closed":
@@ -1949,7 +1963,7 @@ const Xe = new je(), Mo = (t, e, r) => {
1949
1963
  }), n({
1950
1964
  stage: "deactivate",
1951
1965
  id: f,
1952
- hasNotification: l,
1966
+ hasNotification: d,
1953
1967
  hasBanner: c,
1954
1968
  isViewed: p
1955
1969
  });
@@ -1963,12 +1977,12 @@ const Xe = new je(), Mo = (t, e, r) => {
1963
1977
  o(), s();
1964
1978
  };
1965
1979
  }), r();
1966
- }, xo = (t, e, r) => {
1980
+ }, Qo = (t, e, r) => {
1967
1981
  const n = { onMountedFired: !1 }, i = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();
1968
1982
  t.sdk = /* @__PURE__ */ Object.create(null), t.sdk.options = Z(e), t.sdk.withAuth = !1, t.sdk.onMount = ({ name: s, clear: a }, u) => {
1969
1983
  if (i.has(s)) {
1970
- const l = o.get(s);
1971
- l && l(), i.delete(s), o.delete(s);
1984
+ const d = o.get(s);
1985
+ d && d(), i.delete(s), o.delete(s);
1972
1986
  }
1973
1987
  i.set(s, { cb: u, clear: a }), t?.stores?.enabled?.get() === "on" && o.set(s, u());
1974
1988
  }, t.ready = () => {
@@ -1990,7 +2004,7 @@ const Xe = new je(), Mo = (t, e, r) => {
1990
2004
  }, t.sdk.createEventSession = (s) => {
1991
2005
  t.stores.providerStreamId.setValue(s);
1992
2006
  }, r();
1993
- }, Qo = (t, e) => {
2007
+ }, Go = (t, e) => {
1994
2008
  const { client: r, queryKey: n } = t.createPromiseClient(ot, {
1995
2009
  method: "generateDeepLink",
1996
2010
  params: e
@@ -2011,29 +2025,29 @@ const Xe = new je(), Mo = (t, e, r) => {
2011
2025
  // 24 hours
2012
2026
  refetchInterval: 0
2013
2027
  });
2014
- }, Go = (t, { web: e, mobile: r }) => {
2015
- const { client: n } = t.createPromiseClient(_i, { method: "generate" });
2028
+ }, Ko = (t, { web: e, mobile: r }) => {
2029
+ const { client: n } = t.createPromiseClient(Pi, { method: "generate" });
2016
2030
  return n.generate({ web: e, mobile: r });
2017
- }, rn = (t, e) => {
2031
+ }, nn = (t, e) => {
2018
2032
  const r = new URLSearchParams(t);
2019
2033
  for (const [n, i] of Object.entries(e))
2020
2034
  r.append(n, i);
2021
2035
  return r.toString();
2022
- }, Ko = (t, e, r, n) => {
2036
+ }, zo = (t, e, r, n) => {
2023
2037
  const i = Z({});
2024
- return wr(i, () => Qo(t, [e, r]).subscribe(async ({ data: a, loading: u }) => {
2025
- const l = a === void 0 && u === !1 ? "https://streamlayer.io" : a?.url, c = n.get() || "", f = e.get() || "", p = r.get() || "", v = {
2038
+ return wr(i, () => Go(t, [e, r]).subscribe(async ({ data: a, loading: u }) => {
2039
+ const d = a === void 0 && u === !1 ? "https://streamlayer.io" : a?.url, c = n.get() || "", f = e.get() || "", p = r.get() || "", v = {
2026
2040
  [Ft]: c,
2027
- [Mn]: f,
2028
- [qn]: p
2041
+ [qn]: f,
2042
+ [jn]: p
2029
2043
  };
2030
- if (!u && l) {
2044
+ if (!u && d) {
2031
2045
  i.setKey("loading", !0);
2032
2046
  let w = window.location.search, m = window.location.hash;
2033
- w && m || m ? w = `?${rn(w, v)}` : m = `#${rn("", v)}`;
2047
+ w && m || m ? w = `?${nn(w, v)}` : m = `#${nn("", v)}`;
2034
2048
  const g = window.location.origin + window.location.pathname + w + m;
2035
2049
  try {
2036
- const S = await Go(t, { web: g, mobile: l });
2050
+ const S = await Ko(t, { web: g, mobile: d });
2037
2051
  i.set({
2038
2052
  data: S.data?.link,
2039
2053
  loading: !1
@@ -2053,7 +2067,7 @@ var $;
2053
2067
  (function(t) {
2054
2068
  t.Unset = "unset", t.Required = "required", t.Optional = "optional", t.Completed = "completed", t.Disabled = "disabled", t.Unavailable = "unavailable";
2055
2069
  })($ || ($ = {}));
2056
- const zo = (t, e, r, n) => {
2070
+ const Ho = (t, e, r, n) => {
2057
2071
  const { inplayGame: i } = t.featureSettings.get(), o = e.getCurrentSessionId({ prefix: "onboarding" });
2058
2072
  i && r.add({
2059
2073
  type: Ae.ONBOARDING,
@@ -2079,12 +2093,12 @@ const zo = (t, e, r, n) => {
2079
2093
  });
2080
2094
  }, ht = (t, e, r, n, i, o, s, a) => {
2081
2095
  try {
2082
- const u = e.userId.get(), l = e.organizationId.get(), c = e.slStreamId.get();
2083
- if (!u || !l || !c)
2096
+ const u = e.userId.get(), d = e.organizationId.get(), c = e.slStreamId.get();
2097
+ if (!u || !d || !c)
2084
2098
  return;
2085
2099
  const f = i.getOnboardingStatus({
2086
2100
  userId: u,
2087
- organizationId: l,
2101
+ organizationId: d,
2088
2102
  eventId: c
2089
2103
  });
2090
2104
  if (f === $.Completed || a?.skipOnboarding) {
@@ -2092,10 +2106,10 @@ const zo = (t, e, r, n) => {
2092
2106
  for (const g of o)
2093
2107
  g();
2094
2108
  a?.skipOnboarding && f !== $.Completed && (i.saveOnboardingStatus({
2095
- organizationId: l,
2109
+ organizationId: d,
2096
2110
  userId: u,
2097
2111
  eventId: c
2098
- }, $.Completed), Bn(s, e.slStreamId.get() || ""));
2112
+ }, $.Completed), Un(s, c));
2099
2113
  return;
2100
2114
  }
2101
2115
  const p = e.moderation.getStore().value?.data, v = r.featureSettings.get().inplayGame;
@@ -2106,11 +2120,11 @@ const zo = (t, e, r, n) => {
2106
2120
  } catch (u) {
2107
2121
  console.error(u);
2108
2122
  }
2109
- }, Ho = (t, e, r, n, i) => {
2123
+ }, on = (t, e, r, n, i) => {
2110
2124
  let o = !!i?.skipOnboarding;
2111
- const s = e.storage, a = q($.Unset);
2125
+ const s = e.storage, a = U($.Unset);
2112
2126
  a.subscribe((c) => {
2113
- c !== $.Unset && (c === $.Optional || c === $.Required ? o === !1 && (zo(t, e, n, s), o = !0) : t.onboardingProcessed.set(!0), c === $.Completed && e.activeQuestionId.invalidate(), s.setOnboardingInstantOpen({
2127
+ c !== $.Unset && (c === $.Optional || c === $.Required ? o === !1 && (Ho(t, e, n, s), o = !0) : t.onboardingProcessed.set(!0), c === $.Completed && e.activeQuestionId.invalidate(), s.setOnboardingInstantOpen({
2114
2128
  userId: e.userId.get() || "",
2115
2129
  organizationId: e.organizationId.get() || "",
2116
2130
  eventId: e.slStreamId.get() || ""
@@ -2126,7 +2140,7 @@ const zo = (t, e, r, n) => {
2126
2140
  }))), ht(a, e, t, n, s, u, r, i), { $store: a, submitInplay: async () => {
2127
2141
  const c = e.slStreamId.get();
2128
2142
  if (c) {
2129
- await Bn(r, c), a.set($.Completed), s.saveOnboardingStatus({
2143
+ await Un(r, c), a.set($.Completed), s.saveOnboardingStatus({
2130
2144
  organizationId: e.organizationId.get() || "",
2131
2145
  userId: e.userId.get() || "",
2132
2146
  eventId: c
@@ -2139,14 +2153,14 @@ const zo = (t, e, r, n) => {
2139
2153
  }
2140
2154
  } };
2141
2155
  }, Wo = (t, e, r, n) => {
2142
- const i = Z(void 0), o = Vn(n), s = async () => {
2143
- const u = t.get(), l = e.get(), c = r ? r.getStore().get().data?.map((v) => v.slId) : [];
2144
- if (!c)
2156
+ const i = Z(void 0), o = Bn(n), s = async () => {
2157
+ const u = t.get(), d = e.get(), c = r ? r.getStore().get().data?.map((v) => v.slId) : [];
2158
+ if (!c || !u || !d)
2145
2159
  return;
2146
2160
  const f = {
2147
2161
  eventId: u,
2148
- userId: l,
2149
- usersIds: [...c, l]
2162
+ userId: d,
2163
+ usersIds: [...c, d]
2150
2164
  }, p = await o(f);
2151
2165
  i.set(p.data?.attributes);
2152
2166
  }, a = () => {
@@ -2154,20 +2168,20 @@ const zo = (t, e, r, n) => {
2154
2168
  };
2155
2169
  return wr(i, () => {
2156
2170
  a();
2157
- const u = t.listen(s), l = r?.listen(s), c = e.listen(s);
2171
+ const u = t.listen(s), d = r?.listen(s), c = e.listen(s);
2158
2172
  return () => {
2159
- u(), l?.(), c();
2173
+ u(), d?.(), c();
2160
2174
  };
2161
2175
  }), { $store: i, invalidate: a };
2162
2176
  }, Yo = async (t, e, r, n, i) => {
2163
- const o = Vn(i), s = t.get(), a = e.get(), u = r?.getStore().get().data?.map((p) => p.slId) || [], l = {
2177
+ const o = Bn(i), s = t.get(), a = e.get(), u = r?.getStore().get().data?.map((p) => p.slId) || [], d = {
2164
2178
  eventId: s,
2165
2179
  userId: n,
2166
2180
  usersIds: [...u, a]
2167
2181
  };
2168
- return (await o(l)).data?.attributes?.summary;
2182
+ return (await o(d)).data?.attributes?.summary;
2169
2183
  }, Jo = /* @__PURE__ */ new Set([I.POLL, I.PREDICTION, I.TRIVIA]);
2170
- class Xo extends Dn {
2184
+ class Xo extends Vn {
2171
2185
  /** user statistics (leaderboard panel) */
2172
2186
  userSummary;
2173
2187
  /** feed list (pick history) */
@@ -2197,6 +2211,7 @@ class Xo extends Dn {
2197
2211
  advertisement;
2198
2212
  onboardingProcessed;
2199
2213
  friendsTabEnabled;
2214
+ skipOnboarding;
2200
2215
  notifications;
2201
2216
  transport;
2202
2217
  /** gamification background class, handle subscriptions and notifications for closed overlay */
@@ -2207,18 +2222,20 @@ class Xo extends Dn {
2207
2222
  cancels = /* @__PURE__ */ new Set();
2208
2223
  onQuestionActivate;
2209
2224
  constructor(e, r, n) {
2210
- if (super(e, r), this.background = new Io(n), this.advertisement = this.background.advertisement, this.onQuestionActivate = n.onQuestionActivate, this.feedSubscription = this.background.feedSubscription, this.activeQuestionId = this.background.activeQuestionId, this.openedQuestionId = this.background.openedQuestionId, this.storage = this.background.storage, this.feedList = this.background.feedList, this.betPack = this.background.betPack, this.currentUserId = this.background.userId, this.onboardingProcessed = q(!n.sdk.withAuth), this.leaderboardId = new re(q(this.settings.getValue("pinnedLeaderboardId")), "pinnedLeaderboardId").getStore(), this.onboardingStatus = Ho(this, this.background, n.transport, n.notifications, {
2211
- skipOnboarding: n.sdk.options.get().skipOnboarding
2212
- }), this.notifications = n.notifications, this.transport = n.transport, this.closeFeature = (i = !0) => n.sdk.closeFeature(i), this.openFeature = () => n.sdk.openFeature(R.GAMES), this.openedQuestion = this.background.openedQuestion, this.deepLink = Ko(this.transport, this.background.slStreamId, n.stores.providerStreamId.getStore(), this.background.userId), this.userSummary = Wo(this.background.slStreamId, this.background.userId, this.friends, this.transport), !n.sdk.options.get().hideFriends) {
2213
- this.friends = new se(ao(this.background.userId, n.transport), "gamification:friends"), this.openedUser = q(void 0);
2214
- const i = this.leaderboardList = Lo(this.transport, this.background.slStreamId, this.background.userId, this.friends);
2225
+ if (super(e, r), this.background = new To(n), this.advertisement = this.background.advertisement, this.onQuestionActivate = n.onQuestionActivate, this.feedSubscription = this.background.feedSubscription, this.activeQuestionId = this.background.activeQuestionId, this.openedQuestionId = this.background.openedQuestionId, this.storage = this.background.storage, this.feedList = this.background.feedList, this.betPack = this.background.betPack, this.currentUserId = this.background.userId, this.onboardingProcessed = U(!n.sdk.withAuth), this.leaderboardId = new re(U(this.settings.getValue("pinnedLeaderboardId")), "pinnedLeaderboardId").getStore(), this.notifications = n.notifications, this.transport = n.transport, this.closeFeature = (i = !0) => n.sdk.closeFeature(i), this.openFeature = () => n.sdk.openFeature(R.GAMES), this.openedQuestion = this.background.openedQuestion, this.deepLink = zo(this.transport, this.background.slStreamId, n.stores.providerStreamId.getStore(), this.background.userId), this.userSummary = Wo(this.background.slStreamId, this.background.userId, this.friends, this.transport), !n.sdk.options.get().hideFriends) {
2226
+ this.friends = new se(co(this.background.userId, n.transport), "gamification:friends"), this.openedUser = U(void 0);
2227
+ const i = this.leaderboardList = No(this.transport, this.background.slStreamId, this.background.userId, this.friends);
2215
2228
  this.cancels.add(this.userSummary.$store.listen((o, s) => {
2216
2229
  s?.summary && o?.summary && i.invalidate();
2217
2230
  }));
2218
2231
  }
2219
- this.connect(), this.cancels.add(this.onboardingStatus.$store.listen(this.checkInteractiveFlag)), this.cancels.add(this.background.moderation.getStore().listen(this.checkInteractiveFlag)), this.cancels.add(this.settings.subscribe(this.checkInteractiveFlag)), this.cancels.add(this.onboardingStatus.$store.listen((i, o) => {
2232
+ this.connect(), this.skipOnboarding = !!n.sdk.options.get().skipOnboarding, this.onboardingStatus = on(this, this.background, n.transport, n.notifications, {
2233
+ skipOnboarding: n.sdk.options.get().skipOnboarding
2234
+ }), n.sdk.options.get().skipOnboarding || (this.onboardingStatus = on(this, this.background, n.transport, n.notifications, {
2235
+ skipOnboarding: n.sdk.options.get().skipOnboarding
2236
+ })), this.cancels.add(this.onboardingStatus.$store.listen(this.checkInteractiveFlag)), this.cancels.add(this.background.moderation.getStore().listen(this.checkInteractiveFlag)), this.cancels.add(this.settings.subscribe(this.checkInteractiveFlag)), this.cancels.add(this.onboardingStatus.$store.listen((i, o) => {
2220
2237
  (o === void 0 || i !== $.Unset) && this.background.activeQuestionId.invalidate();
2221
- })), this.background.activeQuestionId.listen(this.showInApp), this.friendsTabEnabled = q(!1), this.cancels.add(n.sdk.options.subscribe((i) => {
2238
+ })), this.background.activeQuestionId.listen(this.showInApp), this.friendsTabEnabled = U(!1), this.cancels.add(n.sdk.options.subscribe((i) => {
2222
2239
  i.friendsTab === "disabled" ? this.friendsTabEnabled.set(!1) : i.friendsTab === "enabled" && this.friendsTabEnabled.set(!0);
2223
2240
  })), this.cancels.add(this.settings.subscribe((i) => {
2224
2241
  n.sdk.options.get().friendsTab === "activatedGame" && this.friendsTabEnabled.set(!!i.inplayGame?.titleCard?.optIn);
@@ -2228,15 +2245,19 @@ class Xo extends Dn {
2228
2245
  });
2229
2246
  }
2230
2247
  get isInteractiveAllowed() {
2231
- return this.background.interactiveAllowed.get() === Pe.ALLOWED;
2248
+ return this.background.interactiveAllowed.get() === Oe.ALLOWED;
2232
2249
  }
2233
2250
  checkInteractiveFlag = () => {
2234
- const e = this.onboardingStatus.$store.get(), r = this.background.moderation.getStore().value?.data?.options?.onboardingEnabled, n = this.settings.getValues().inplayGame?.titleCard?.optIn, i = e === $.Completed, o = !r || i || n !== !0;
2235
- this.background.interactiveAllowed.set(o ? Pe.ALLOWED : Pe.DISALLOWED);
2251
+ if (this.skipOnboarding)
2252
+ this.background.interactiveAllowed.set(Oe.ALLOWED);
2253
+ else {
2254
+ const e = this.onboardingStatus.$store.get(), r = this.background.moderation.getStore().value?.data?.options?.onboardingEnabled, n = this.settings.getValues().inplayGame?.titleCard?.optIn, i = e === $.Completed, o = !r || i || n !== !0;
2255
+ this.background.interactiveAllowed.set(o ? Oe.ALLOWED : Oe.DISALLOWED);
2256
+ }
2236
2257
  };
2237
2258
  connect = () => {
2238
2259
  this.onboardingProcessed.subscribe((e) => {
2239
- e && this.advertisement.connect();
2260
+ e && this.advertisement && this.advertisement.connect();
2240
2261
  }), this.cancels.add(this.background.feedSubscription.addListener("feed-subscription-prediction-close", async (e) => {
2241
2262
  if (!this.isInteractiveAllowed)
2242
2263
  return;
@@ -2244,25 +2265,25 @@ class Xo extends Dn {
2244
2265
  if (!r || !n?.attributes)
2245
2266
  return;
2246
2267
  const { status: i, type: o, id: s, answers: a } = r;
2247
- if (i === Y.RESOLVED && o === I.PREDICTION) {
2268
+ if (i === G.RESOLVED && o === I.PREDICTION) {
2248
2269
  const u = this.background.getCurrentSessionId({
2249
2270
  prefix: `notification-id:${s}`
2250
- }), l = [...this.feedList.getValues().data || []], c = l.findIndex((z) => z.id === s), f = l[c];
2271
+ }), d = [...this.feedList.getValues().data || []], c = d.findIndex((H) => H.id === s), f = d[c];
2251
2272
  let p = f?.attributes?.attributes?.value?.answerId;
2252
- const v = nt(s, this.transport), w = v.subscribe(() => {
2273
+ const v = Ge(s, this.transport), w = v.subscribe(() => {
2253
2274
  });
2254
2275
  await v.get().promise;
2255
2276
  let m = v.get().data;
2256
2277
  m || (m = await cr(s, this.transport)), w(), window.requestAnimationFrame(() => {
2257
2278
  v.invalidate();
2258
- }), p || (p = m?.answers.find(({ youVoted: z }) => z)?.id);
2259
- const g = a.find(({ correct: z }) => z), S = p ? a.find(({ id: z }) => z === p) : void 0, F = !!S?.correct;
2260
- if (f && l[c]?.attributes?.attributes.case === "question") {
2279
+ }), p || (p = m?.answers.find(({ youVoted: H }) => H)?.id);
2280
+ const g = a.find(({ correct: H }) => H), S = p ? a.find(({ id: H }) => H === p) : void 0, F = !!S?.correct;
2281
+ if (f && d[c]?.attributes?.attributes.case === "question") {
2261
2282
  try {
2262
- l[c].attributes.attributes.value.answerId = p, l[c].attributes.attributes.value.openForVoting = !1, p && (l[c].attributes.attributes.value.status = F ? lt.WON : lt.LOST);
2283
+ d[c].attributes.attributes.value.answerId = p, d[c].attributes.attributes.value.openForVoting = !1, p && (d[c].attributes.attributes.value.status = F ? lt.WON : lt.LOST);
2263
2284
  } catch {
2264
2285
  }
2265
- this.feedList.getStore().mutate(l);
2286
+ this.feedList.getStore().mutate(d);
2266
2287
  }
2267
2288
  if (!S || !g)
2268
2289
  return;
@@ -2284,7 +2305,7 @@ class Xo extends Dn {
2284
2305
  },
2285
2306
  correctAnswerTitle: g?.text,
2286
2307
  correct: !!F,
2287
- predictionResult: i === Y.RESOLVED,
2308
+ predictionResult: i === G.RESOLVED,
2288
2309
  questionTitle: r?.subject
2289
2310
  }
2290
2311
  }
@@ -2292,7 +2313,7 @@ class Xo extends Dn {
2292
2313
  }
2293
2314
  })), this.cancels.add(this.background.feedSubscription.addListener("feed-subscription-questions-list", (e) => {
2294
2315
  const r = [...this.feedList.getStore().value?.data || []], n = e.data?.attributes?.feedItem, i = r.findIndex((o) => o.id === n?.id);
2295
- if (n?.attributes && n.attributes.attributes.case !== "promotion" && !(n.attributes.status !== Y.ACTIVE && n.attributes.status !== Y.RESOLVED)) {
2316
+ if (n?.attributes && n.attributes.attributes.case !== "promotion" && !(n.attributes.status !== G.ACTIVE && n.attributes.status !== G.RESOLVED)) {
2296
2317
  if (i !== -1)
2297
2318
  if (n.attributes.attributes.case === "question" && r[i].attributes?.attributes.case === "question") {
2298
2319
  const o = r[i];
@@ -2353,23 +2374,35 @@ class Xo extends Dn {
2353
2374
  this.background.feedSubscription.removeListener("feed-subscription-prediction-close"), this.background.feedSubscription.removeListener("feed-subscription-questions-list");
2354
2375
  };
2355
2376
  betPackVote = async (e, r) => {
2356
- await this.submitAnswer(e, r);
2357
- const i = { ...this.betPack.getValues().data }?.[e];
2358
- i && B.emit("poll", {
2377
+ try {
2378
+ await Xr(this.transport, { questionId: e, answerId: r });
2379
+ } catch (o) {
2380
+ if (o.message === He.ALREADY_VOTED) {
2381
+ const s = Ge(e, this.transport), a = s.subscribe(() => {
2382
+ });
2383
+ s.invalidate(), a();
2384
+ }
2385
+ throw o;
2386
+ }
2387
+ const n = { ...this.betPack.getValues().data }, i = n?.[e];
2388
+ i && (B.emit("poll", {
2359
2389
  action: "voted",
2360
2390
  payload: {
2361
2391
  questionId: e,
2362
2392
  questionType: i.type
2363
2393
  }
2364
- });
2394
+ }), i.answers = i.answers.map((o) => o.id === r ? {
2395
+ ...o,
2396
+ youVoted: !0
2397
+ } : o), this.betPack.getStore().mutate(n));
2365
2398
  };
2366
2399
  submitAnswer = async (e, r) => {
2367
- const n = nt(e, this.transport), i = n.subscribe(() => {
2400
+ const n = Ge(e, this.transport), i = n.subscribe(() => {
2368
2401
  }), o = { ...n.get().data || {} }, s = () => {
2369
2402
  const a = this.feedList.getValues().data;
2370
2403
  if (!a)
2371
2404
  return;
2372
- const u = a.findIndex((f) => f.id === e), l = a[u], c = l?.attributes?.attributes.case === "question" && l.attributes.attributes.value;
2405
+ const u = a.findIndex((f) => f.id === e), d = a[u], c = d?.attributes?.attributes.case === "question" && d.attributes.attributes.value;
2373
2406
  if (c) {
2374
2407
  B.emit("poll", {
2375
2408
  action: "voted",
@@ -2383,7 +2416,7 @@ class Xo extends Dn {
2383
2416
  const p = f.answers.find((g) => g.correct === !0), v = f.answers.findIndex((g) => g.id === r), w = f.answers[v], m = f.answers.every(({ percentageDecimal: g }, S) => g === o?.answers[S].percentageDecimal);
2384
2417
  a[u].attributes.attributes.value.answerId = r, a[u].attributes.attributes.value.openForVoting = !1, a[u].attributes.attributes.value.text = w?.text || "", p && (a[u].attributes.attributes.value.status = p.id === r ? lt.WON : lt.LOST), this.feedList.getStore().mutate([...a]), f.answers[v].correct = p?.id === r, f.answers[v].youVoted = !0, m && f.answers.forEach((g) => {
2385
2418
  g.percentageDecimal = 0;
2386
- }), p?.id === r && (f.answers[v].pointsEarned = f.status === Y.RESOLVED ? 0 : p.points), n.mutate({ ...f });
2419
+ }), p?.id === r && (f.answers[v].pointsEarned = f.status === G.RESOLVED ? 0 : p.points), n.mutate({ ...f });
2387
2420
  }
2388
2421
  this.submitAnswerTimeout && clearTimeout(this.submitAnswerTimeout), this.submitAnswerTimeout = setTimeout(() => {
2389
2422
  this.userSummary.invalidate();
@@ -2391,9 +2424,9 @@ class Xo extends Dn {
2391
2424
  }
2392
2425
  };
2393
2426
  try {
2394
- await Co(this.transport, { questionId: e, answerId: r }), s();
2427
+ await Xr(this.transport, { questionId: e, answerId: r }), s();
2395
2428
  } catch (a) {
2396
- if (a.message === it.ALREADY_VOTED) {
2429
+ if (a.message === He.ALREADY_VOTED) {
2397
2430
  this.userSummary.invalidate();
2398
2431
  const u = n.subscribe(() => {
2399
2432
  });
@@ -2406,29 +2439,33 @@ class Xo extends Dn {
2406
2439
  if (!e)
2407
2440
  return () => {
2408
2441
  };
2409
- this.notifications.close(this.background.getCurrentSessionId({
2442
+ const n = r?.openedFrom === "bet-pack";
2443
+ n && this.notifications.close(this.background.getCurrentSessionId({
2410
2444
  prefix: "notification",
2411
2445
  entity: e
2412
2446
  }), {
2413
2447
  animateHiding: !1
2414
2448
  });
2415
- let n = r?.attributes?.type;
2416
- n || (n = (this.feedList.getStore().value?.data || []).find((s) => s.id === e)?.attributes?.type);
2417
- const i = {
2449
+ let i = r?.attributes?.type;
2450
+ !i && !n && (i = (this.feedList.getStore().value?.data || []).find((a) => a.id === e)?.attributes?.type);
2451
+ const o = {
2418
2452
  eventId: this.background.slStreamId.get() || "",
2419
2453
  userId: this.background.userId.get() || "",
2420
2454
  organizationId: this.background.organizationId.get() || ""
2421
2455
  };
2422
- return this.storage.isQuestionOpened(i, e) || (B.emit("poll", {
2456
+ return this.storage.isQuestionOpened(o, e) || (B.emit("poll", {
2423
2457
  action: "opened",
2424
2458
  payload: {
2425
2459
  questionId: e,
2426
- questionType: n,
2427
- questionOpenedFrom: r?.openedFrom
2460
+ questionType: i,
2461
+ questionOpenedFrom: r?.openedFrom === "bet-pack" ? "list" : r?.openedFrom
2428
2462
  }
2429
- }), this.storage.saveQuestionOpened(i, e)), this.openFeature(), this.background.openQuestion(e, r);
2463
+ }), this.storage.saveQuestionOpened(o, e)), n || this.openFeature(), this.background.openQuestion(e, r ? {
2464
+ ...r,
2465
+ openedFrom: r?.openedFrom === "bet-pack" ? "list" : r?.openedFrom
2466
+ } : void 0);
2430
2467
  };
2431
- getFeedItem = (e) => lo(e, this.transport);
2468
+ getFeedItem = (e) => po(e, this.transport);
2432
2469
  isOpenedQuestion = (e) => !!this.notifications.isViewed(e);
2433
2470
  closeQuestion = (e) => (e && this.onQuestionActivate({
2434
2471
  stage: "deactivate",
@@ -2470,7 +2507,7 @@ class Xo extends Dn {
2470
2507
  */
2471
2508
  showInApp = (e) => {
2472
2509
  const r = this.onboardingStatus.$store.get();
2473
- if (e && e.data && r && r !== $.Unset && e.data.question?.id !== void 0 && e.data.question?.bypassNotifications?.inAppSilence !== Ai.ON && e.data.question.status === Y.ACTIVE && !e.data.question.marketClosed) {
2510
+ if (e && e.data && r && r !== $.Unset && e.data.question?.id !== void 0 && e.data.question?.bypassNotifications?.inAppSilence !== Ii.ON && e.data.question.status === G.ACTIVE && !e.data.question.marketClosed) {
2474
2511
  if (Jo.has(e.data.question.type))
2475
2512
  this.isInteractiveAllowed && e.data.question.notification !== void 0 && this.notifications.add({
2476
2513
  type: Ae.QUESTION,
@@ -2523,7 +2560,7 @@ class Xo extends Dn {
2523
2560
  questionType: e.data.question.type,
2524
2561
  insight: s,
2525
2562
  inApp: {
2526
- useMediaFromContent: n.useAsNotification === Ei.ENABLED,
2563
+ useMediaFromContent: n?.useAsNotification === Oi.ENABLED,
2527
2564
  notification: e.data.question.notification,
2528
2565
  appearance: e.data.question.appearance,
2529
2566
  sponsorship: e.data.question.sponsorship
@@ -2577,14 +2614,16 @@ class Xo extends Dn {
2577
2614
  const Zo = {
2578
2615
  [R.GAMES]: !0
2579
2616
  };
2580
- class es extends Dn {
2617
+ class es extends Vn {
2581
2618
  constructor(e, r) {
2582
2619
  super(e, r);
2583
2620
  }
2584
2621
  }
2585
2622
  const ts = (t, e, r) => t.type === R.GAMES ? new Xo(t, e, r) : new es(t, e), rs = (t, e, r) => {
2586
- t.features = /* @__PURE__ */ new Map(), t.sdk.featuresList = new re(q(/* @__PURE__ */ new Set()), "features-list"), t.activeFeature = new re(q(R.UNSET), "activeFeature"), t.sdk.getFeatures = () => t.features, t.sdk.getFeature = (n) => t.features.get(n), t.sdk.getActiveFeature = () => t.activeFeature.getStore(), t.sdk.openFeature = (n) => {
2587
- t.activeFeature.setValue(n);
2623
+ t.features = /* @__PURE__ */ new Map(), t.sdk.featuresList = new re(U(/* @__PURE__ */ new Set()), "features-list"), t.activeFeature = new re(U(R.UNSET), "activeFeature"), t.sdk.getFeatures = () => t.features, t.sdk.getFeature = (n) => t.features.get(n), t.sdk.getActiveFeature = () => t.activeFeature.getStore(), t.sdk.openFeature = (n) => {
2624
+ t.sdk.initializeApp().then(() => {
2625
+ t.activeFeature.setValue(n);
2626
+ });
2588
2627
  }, t.sdk.closeFeature = (n = !1) => {
2589
2628
  const i = t.activeFeature.getValue();
2590
2629
  if (t.activeFeature.setValue(R.UNSET), n && i) {
@@ -2666,20 +2705,20 @@ class ns {
2666
2705
  this.analytics.write("invitation", {
2667
2706
  common: {
2668
2707
  ...this.analytics.commonStore.getValues(),
2669
- kind: G.INVITATION_ACCEPTED
2708
+ kind: K.INVITATION_ACCEPTED
2670
2709
  },
2671
2710
  category: Mr.GAMES,
2672
- from: qr.UNSET
2711
+ from: Ur.UNSET
2673
2712
  });
2674
2713
  };
2675
2714
  sent = ({ from: e }) => {
2676
2715
  this.analytics.write("invitation", {
2677
2716
  common: {
2678
2717
  ...this.analytics.commonStore.getValues(),
2679
- kind: G.INVITATION_SENT
2718
+ kind: K.INVITATION_SENT
2680
2719
  },
2681
2720
  category: Mr.GAMES,
2682
- from: e || qr.UNSET
2721
+ from: e || Ur.UNSET
2683
2722
  });
2684
2723
  };
2685
2724
  }
@@ -2705,7 +2744,7 @@ class is {
2705
2744
  this.analytics.write("interactions", {
2706
2745
  common: {
2707
2746
  ...this.analytics.commonStore.getValues(),
2708
- kind: G.INTERACTIONS
2747
+ kind: K.INTERACTIONS
2709
2748
  },
2710
2749
  actionType: zr.TAP
2711
2750
  });
@@ -2714,25 +2753,25 @@ class is {
2714
2753
  this.analytics.write("interactions", {
2715
2754
  common: {
2716
2755
  ...this.analytics.commonStore.getValues(),
2717
- kind: G.INTERACTIONS
2756
+ kind: K.INTERACTIONS
2718
2757
  },
2719
2758
  actionType: zr.SCROLL
2720
2759
  });
2721
2760
  };
2722
2761
  }
2723
2762
  const os = {
2724
- [U.UNSET]: J.UNSET,
2725
- [U.INGAME_IAB21]: J.PROMOTION_INGAME_IAB21,
2726
- [U.INGAME_IAB11_LBAR]: J.PROMOTION_INGAME_IAB11_LBAR,
2727
- [U.INGAME_IAB11]: J.PROMOTION_INGAME_IAB11,
2728
- [U.INGAME_IAB21_LBAR]: J.PROMOTION_INGAME_IAB21_LBAR,
2729
- [U.INGAME_IAB61]: J.PROMOTION_INGAME_IAB61,
2730
- [U.EXTERNAL_AD]: J.PROMOTION_GAM,
2731
- [U.VIDEO_SIDE_BY_SIDE]: J.PROMOTION_VIDEO_SIDE_BY_SIDE,
2732
- [U.PICTURE_IN_PICTURE]: J.PROMOTION_PICTURE_IN_PICTURE,
2733
- [U.SHOP_LBAR]: J.PROMOTION_SHOP_LBAR,
2734
- [U.SHOP_OVERLAY]: J.PROMOTION_SHOP_OVERLAY,
2735
- [U.SHOP_SIDEBAR]: J.PROMOTION_SHOP_SIDEBAR
2763
+ [q.UNSET]: J.UNSET,
2764
+ [q.INGAME_IAB21]: J.PROMOTION_INGAME_IAB21,
2765
+ [q.INGAME_IAB11_LBAR]: J.PROMOTION_INGAME_IAB11_LBAR,
2766
+ [q.INGAME_IAB11]: J.PROMOTION_INGAME_IAB11,
2767
+ [q.INGAME_IAB21_LBAR]: J.PROMOTION_INGAME_IAB21_LBAR,
2768
+ [q.INGAME_IAB61]: J.PROMOTION_INGAME_IAB61,
2769
+ [q.EXTERNAL_AD]: J.PROMOTION_GAM,
2770
+ [q.VIDEO_SIDE_BY_SIDE]: J.PROMOTION_VIDEO_SIDE_BY_SIDE,
2771
+ [q.PICTURE_IN_PICTURE]: J.PROMOTION_PICTURE_IN_PICTURE,
2772
+ [q.SHOP_LBAR]: J.PROMOTION_SHOP_LBAR,
2773
+ [q.SHOP_OVERLAY]: J.PROMOTION_SHOP_OVERLAY,
2774
+ [q.SHOP_SIDEBAR]: J.PROMOTION_SHOP_SIDEBAR
2736
2775
  }, dr = (t) => t ? os[t] : J.UNSET;
2737
2776
  class ss {
2738
2777
  analytics;
@@ -2770,7 +2809,7 @@ class ss {
2770
2809
  this.analytics.write("games", {
2771
2810
  common: {
2772
2811
  ...this.analytics.commonStore.getValues(),
2773
- kind: G.POLLS_RECEIVED,
2812
+ kind: K.POLLS_RECEIVED,
2774
2813
  topicId: e,
2775
2814
  topicType: Q.POLLS_PROMOTION,
2776
2815
  topicSubType: r
@@ -2782,7 +2821,7 @@ class ss {
2782
2821
  this.analytics.write("games", {
2783
2822
  common: {
2784
2823
  ...this.analytics.commonStore.getValues(),
2785
- kind: G.POLLS_OPENED,
2824
+ kind: K.POLLS_OPENED,
2786
2825
  topicId: e,
2787
2826
  topicType: Q.POLLS_PROMOTION,
2788
2827
  topicSubType: n
@@ -2794,7 +2833,7 @@ class ss {
2794
2833
  this.analytics.write("games", {
2795
2834
  common: {
2796
2835
  ...this.analytics.commonStore.getValues(),
2797
- kind: G.POLLS_OPENED,
2836
+ kind: K.POLLS_OPENED,
2798
2837
  topicId: e,
2799
2838
  topicType: Q.POLLS_PROMOTION,
2800
2839
  topicSubType: r
@@ -2807,7 +2846,7 @@ class ss {
2807
2846
  common: {
2808
2847
  ...this.analytics.commonStore.getValues(),
2809
2848
  topicId: e,
2810
- kind: G.AD_VIDEO_PLAYED,
2849
+ kind: K.AD_VIDEO_PLAYED,
2811
2850
  topicType: Q.POLLS_PROMOTION,
2812
2851
  topicSubType: r
2813
2852
  },
@@ -2819,7 +2858,7 @@ class ss {
2819
2858
  common: {
2820
2859
  ...this.analytics.commonStore.getValues(),
2821
2860
  topicId: e,
2822
- kind: G.AD_BUTTON_NAVIGATED,
2861
+ kind: K.AD_BUTTON_NAVIGATED,
2823
2862
  topicType: Q.POLLS_PROMOTION,
2824
2863
  topicSubType: r
2825
2864
  },
@@ -2831,7 +2870,7 @@ class ss {
2831
2870
  common: {
2832
2871
  ...this.analytics.commonStore.getValues(),
2833
2872
  topicId: e,
2834
- kind: G.AD_BANNER_NAVIGATED,
2873
+ kind: K.AD_BANNER_NAVIGATED,
2835
2874
  topicType: Q.POLLS_PROMOTION,
2836
2875
  topicSubType: r
2837
2876
  },
@@ -2839,7 +2878,7 @@ class ss {
2839
2878
  });
2840
2879
  };
2841
2880
  }
2842
- const et = {
2881
+ const rt = {
2843
2882
  [I.UNSET]: Q.UNSET,
2844
2883
  [I.FACTOID]: Q.POLLS_INSIGHT,
2845
2884
  [I.POLL]: Q.POLLS_POLL,
@@ -2850,24 +2889,24 @@ const et = {
2850
2889
  };
2851
2890
  I.UNSET + "", me.UNSET, I.FACTOID + "", me.POLLS, I.POLL + "", me.POLLS, I.PREDICTION + "", me.POLLS, I.PROMOTION + "", me.POLLS, I.TRIVIA + "", me.POLLS, I.TWEET + "", me.POLLS;
2852
2891
  const as = {
2853
- [R.UNSET]: H.UNSET,
2854
- [R.INPLAY]: H.INPLAY,
2855
- [R.MESSAGING]: H.MESSAGING,
2856
- [R.STATISTICS]: H.STATS,
2857
- [R.BETTING]: H.BETTING,
2858
- [R.TWITTER]: H.TWITTER,
2859
- [R.MERCHANDISE]: H.MERCHANDISE,
2860
- [R.CONTESTS]: H.CONTESTS,
2861
- [R.VOICE_CHAT]: H.CALLING,
2862
- [R.TICKETS]: H.TICKETS,
2863
- [R.WHOIS_WATCHING]: H.WHOISWATCHING,
2864
- [R.PROFILE]: H.PROFILE,
2865
- [R.GAMES]: H.POLLS,
2892
+ [R.UNSET]: W.UNSET,
2893
+ [R.INPLAY]: W.INPLAY,
2894
+ [R.MESSAGING]: W.MESSAGING,
2895
+ [R.STATISTICS]: W.STATS,
2896
+ [R.BETTING]: W.BETTING,
2897
+ [R.TWITTER]: W.TWITTER,
2898
+ [R.MERCHANDISE]: W.MERCHANDISE,
2899
+ [R.CONTESTS]: W.CONTESTS,
2900
+ [R.VOICE_CHAT]: W.CALLING,
2901
+ [R.TICKETS]: W.TICKETS,
2902
+ [R.WHOIS_WATCHING]: W.WHOISWATCHING,
2903
+ [R.PROFILE]: W.PROFILE,
2904
+ [R.GAMES]: W.POLLS,
2866
2905
  // ??
2867
- [R.GOLF_STATISTICS]: H.STATS,
2906
+ [R.GOLF_STATISTICS]: W.STATS,
2868
2907
  // ??
2869
- [R.HIGHLIGHTS]: H.HIGHLIGHTS,
2870
- [R.PUBLIC_CHAT]: H.PUBLIC_CHAT
2908
+ [R.HIGHLIGHTS]: W.HIGHLIGHTS,
2909
+ [R.PUBLIC_CHAT]: W.PUBLIC_CHAT
2871
2910
  };
2872
2911
  class us {
2873
2912
  analytics;
@@ -2908,9 +2947,9 @@ class us {
2908
2947
  this.analytics.write("notification", {
2909
2948
  common: {
2910
2949
  ...this.analytics.commonStore.getValues(),
2911
- kind: G.NOTIFICATION_RECEIVED,
2950
+ kind: K.NOTIFICATION_RECEIVED,
2912
2951
  topicId: e,
2913
- topicType: r ? et[r] : Q.UNSET,
2952
+ topicType: r ? rt[r] : Q.UNSET,
2914
2953
  topicSubType: n
2915
2954
  },
2916
2955
  notificationKind: me.POLLS,
@@ -2921,9 +2960,9 @@ class us {
2921
2960
  this.analytics.write("notification", {
2922
2961
  common: {
2923
2962
  ...this.analytics.commonStore.getValues(),
2924
- kind: G.NOTIFICATION_OPENED,
2963
+ kind: K.NOTIFICATION_OPENED,
2925
2964
  topicId: e,
2926
- topicType: r ? et[r] : Q.UNSET,
2965
+ topicType: r ? rt[r] : Q.UNSET,
2927
2966
  topicSubType: n
2928
2967
  },
2929
2968
  notificationKind: me.POLLS,
@@ -2963,9 +3002,9 @@ class cs {
2963
3002
  this.analytics.write("games", {
2964
3003
  common: {
2965
3004
  ...this.analytics.commonStore.getValues(),
2966
- kind: G.POLLS_RECEIVED,
3005
+ kind: K.POLLS_RECEIVED,
2967
3006
  topicId: e,
2968
- topicType: r ? et[r] : Q.UNSET
3007
+ topicType: r ? rt[r] : Q.UNSET
2969
3008
  },
2970
3009
  pollOpenedFrom: X.UNSET
2971
3010
  });
@@ -2975,9 +3014,9 @@ class cs {
2975
3014
  this.analytics.write("games", {
2976
3015
  common: {
2977
3016
  ...this.analytics.commonStore.getValues(),
2978
- kind: G.POLLS_OPENED,
3017
+ kind: K.POLLS_OPENED,
2979
3018
  topicId: e,
2980
- topicType: r ? et[r] : Q.UNSET
3019
+ topicType: r ? rt[r] : Q.UNSET
2981
3020
  },
2982
3021
  pollOpenedFrom: n === "list" ? X.PICK_HISTORY : X.IN_APP
2983
3022
  });
@@ -2987,9 +3026,9 @@ class cs {
2987
3026
  this.analytics.write("games", {
2988
3027
  common: {
2989
3028
  ...this.analytics.commonStore.getValues(),
2990
- kind: G.POLLS_VOTE,
3029
+ kind: K.POLLS_VOTE,
2991
3030
  topicId: e,
2992
- topicType: r ? et[r] : Q.UNSET
3031
+ topicType: r ? rt[r] : Q.UNSET
2993
3032
  },
2994
3033
  pollOpenedFrom: X.UNSET
2995
3034
  });
@@ -2999,7 +3038,7 @@ class cs {
2999
3038
  this.analytics.write("games", {
3000
3039
  common: {
3001
3040
  ...this.analytics.commonStore.getValues(),
3002
- kind: G.GAMES_JOINED
3041
+ kind: K.GAMES_JOINED
3003
3042
  },
3004
3043
  pollOpenedFrom: X.UNSET
3005
3044
  });
@@ -3009,7 +3048,7 @@ class cs {
3009
3048
  this.analytics.write("games", {
3010
3049
  common: {
3011
3050
  ...this.analytics.commonStore.getValues(),
3012
- kind: G.POLLS_NAVIGATED
3051
+ kind: K.POLLS_NAVIGATED
3013
3052
  },
3014
3053
  pollOpenedFrom: X.UNSET
3015
3054
  });
@@ -3017,7 +3056,7 @@ class cs {
3017
3056
  }
3018
3057
  const ds = ({ transport: t, $commonStore: e }) => {
3019
3058
  let r;
3020
- const n = q(!1), i = 5e3, { client: o, queryKey: s } = t.createPromiseClient(Cn, {
3059
+ const n = U(!1), i = 3e4, { client: o, queryKey: s } = t.createPromiseClient(Ln, {
3021
3060
  method: "send",
3022
3061
  params: [n]
3023
3062
  }), a = t.nanoquery.createFetcherStore(s, {
@@ -3030,7 +3069,7 @@ const ds = ({ transport: t, $commonStore: e }) => {
3030
3069
  value: {
3031
3070
  common: {
3032
3071
  ...p,
3033
- kind: G.SESSION_HEARTBEAT
3072
+ kind: K.SESSION_HEARTBEAT
3034
3073
  }
3035
3074
  }
3036
3075
  }
@@ -3044,12 +3083,12 @@ const ds = ({ transport: t, $commonStore: e }) => {
3044
3083
  }), u = () => {
3045
3084
  Se.debug("mounted heartbeat"), r = a.subscribe(() => {
3046
3085
  });
3047
- }, l = () => {
3086
+ }, d = () => {
3048
3087
  Se.debug("enabled heartbeat"), n.set(!0), a.lc === 0 && u();
3049
3088
  }, c = () => {
3050
3089
  Se.debug("disabled heartbeat"), n.set(!1);
3051
3090
  };
3052
- return { enable: l, disable: c, mount: u, unmount: () => {
3091
+ return { enable: d, disable: c, mount: u, unmount: () => {
3053
3092
  Se.debug("unmounted heartbeat"), a.off(), r?.(), r = void 0, c();
3054
3093
  } };
3055
3094
  }, Se = pe("analytics");
@@ -3067,7 +3106,7 @@ class ls {
3067
3106
  connected = !1;
3068
3107
  constructor(e) {
3069
3108
  this.listeners = /* @__PURE__ */ new Set(), this.listenersCancels = /* @__PURE__ */ new Set(), this.commonStore = new Ce(Z({}), "common-analytics"), this.connectToSDK(e), this.heartbeat = ds({ transport: e.analyticsTransport, $commonStore: this.commonStore }), this.notifications = new us(this), this.polls = new cs(this), this.invitation = new ns(this), this.interactions = new is(this), this.advertisement = new ss(this);
3070
- const { client: r } = e.analyticsTransport.createPromiseClient(Cn, {
3109
+ const { client: r } = e.analyticsTransport.createPromiseClient(Ln, {
3071
3110
  method: "send"
3072
3111
  });
3073
3112
  this.analyticsClient = r;
@@ -3134,7 +3173,7 @@ function hs(t) {
3134
3173
  };
3135
3174
  }
3136
3175
  var ys = hs, ms = ys;
3137
- function Un(t, e, r) {
3176
+ function xn(t, e, r) {
3138
3177
  if (typeof t == "function" && (r = e, e = t, t = null), !(r >= 1))
3139
3178
  throw new Error("fastqueue concurrency must be equal to or greater than 1");
3140
3179
  var n = ms(gs), i = null, o = null, s = 0, a = null, u = {
@@ -3153,7 +3192,7 @@ function Un(t, e, r) {
3153
3192
  for (; i && s < r; )
3154
3193
  s++, S();
3155
3194
  },
3156
- running: l,
3195
+ running: d,
3157
3196
  resume: v,
3158
3197
  idle: w,
3159
3198
  length: f,
@@ -3161,11 +3200,11 @@ function Un(t, e, r) {
3161
3200
  unshift: g,
3162
3201
  empty: te,
3163
3202
  kill: F,
3164
- killAndDrain: z,
3203
+ killAndDrain: H,
3165
3204
  error: ne
3166
3205
  };
3167
3206
  return u;
3168
- function l() {
3207
+ function d() {
3169
3208
  return s;
3170
3209
  }
3171
3210
  function c() {
@@ -3210,7 +3249,7 @@ function Un(t, e, r) {
3210
3249
  function F() {
3211
3250
  i = null, o = null, u.drain = te;
3212
3251
  }
3213
- function z() {
3252
+ function H() {
3214
3253
  i = null, o = null, u.drain(), u.drain = te;
3215
3254
  }
3216
3255
  function ne(L) {
@@ -3234,8 +3273,8 @@ function bs(t, e, r) {
3234
3273
  f(null, p);
3235
3274
  }, f);
3236
3275
  }
3237
- var i = Un(t, n, r), o = i.push, s = i.unshift;
3238
- return i.push = a, i.unshift = u, i.drained = l, i;
3276
+ var i = xn(t, n, r), o = i.push, s = i.unshift;
3277
+ return i.push = a, i.unshift = u, i.drained = d, i;
3239
3278
  function a(c) {
3240
3279
  var f = new Promise(function(p, v) {
3241
3280
  o(c, function(w, m) {
@@ -3260,7 +3299,7 @@ function bs(t, e, r) {
3260
3299
  });
3261
3300
  return f.catch(te), f;
3262
3301
  }
3263
- function l() {
3302
+ function d() {
3264
3303
  if (i.idle())
3265
3304
  return new Promise(function(p) {
3266
3305
  p();
@@ -3273,12 +3312,12 @@ function bs(t, e, r) {
3273
3312
  return f;
3274
3313
  }
3275
3314
  }
3276
- Or.exports = Un;
3315
+ Or.exports = xn;
3277
3316
  Or.exports.promise = bs;
3278
- var jn = Or.exports, Tr = { exports: {} }, Ge = typeof Reflect == "object" ? Reflect : null, nn = Ge && typeof Ge.apply == "function" ? Ge.apply : function(e, r, n) {
3317
+ var Qn = Or.exports, Tr = { exports: {} }, Ke = typeof Reflect == "object" ? Reflect : null, sn = Ke && typeof Ke.apply == "function" ? Ke.apply : function(e, r, n) {
3279
3318
  return Function.prototype.apply.call(e, r, n);
3280
3319
  }, mt;
3281
- Ge && typeof Ge.ownKeys == "function" ? mt = Ge.ownKeys : Object.getOwnPropertySymbols ? mt = function(e) {
3320
+ Ke && typeof Ke.ownKeys == "function" ? mt = Ke.ownKeys : Object.getOwnPropertySymbols ? mt = function(e) {
3282
3321
  return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e));
3283
3322
  } : mt = function(e) {
3284
3323
  return Object.getOwnPropertyNames(e);
@@ -3286,7 +3325,7 @@ Ge && typeof Ge.ownKeys == "function" ? mt = Ge.ownKeys : Object.getOwnPropertyS
3286
3325
  function vs(t) {
3287
3326
  console && console.warn && console.warn(t);
3288
3327
  }
3289
- var xn = Number.isNaN || function(e) {
3328
+ var Gn = Number.isNaN || function(e) {
3290
3329
  return e !== e;
3291
3330
  };
3292
3331
  function N() {
@@ -3298,7 +3337,7 @@ N.EventEmitter = N;
3298
3337
  N.prototype._events = void 0;
3299
3338
  N.prototype._eventsCount = 0;
3300
3339
  N.prototype._maxListeners = void 0;
3301
- var on = 10;
3340
+ var an = 10;
3302
3341
  function Dt(t) {
3303
3342
  if (typeof t != "function")
3304
3343
  throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof t);
@@ -3306,27 +3345,27 @@ function Dt(t) {
3306
3345
  Object.defineProperty(N, "defaultMaxListeners", {
3307
3346
  enumerable: !0,
3308
3347
  get: function() {
3309
- return on;
3348
+ return an;
3310
3349
  },
3311
3350
  set: function(t) {
3312
- if (typeof t != "number" || t < 0 || xn(t))
3351
+ if (typeof t != "number" || t < 0 || Gn(t))
3313
3352
  throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + t + ".");
3314
- on = t;
3353
+ an = t;
3315
3354
  }
3316
3355
  });
3317
3356
  N.init = function() {
3318
3357
  (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;
3319
3358
  };
3320
3359
  N.prototype.setMaxListeners = function(e) {
3321
- if (typeof e != "number" || e < 0 || xn(e))
3360
+ if (typeof e != "number" || e < 0 || Gn(e))
3322
3361
  throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + e + ".");
3323
3362
  return this._maxListeners = e, this;
3324
3363
  };
3325
- function Qn(t) {
3364
+ function Kn(t) {
3326
3365
  return t._maxListeners === void 0 ? N.defaultMaxListeners : t._maxListeners;
3327
3366
  }
3328
3367
  N.prototype.getMaxListeners = function() {
3329
- return Qn(this);
3368
+ return Kn(this);
3330
3369
  };
3331
3370
  N.prototype.emit = function(e) {
3332
3371
  for (var r = [], n = 1; n < arguments.length; n++) r.push(arguments[n]);
@@ -3346,13 +3385,13 @@ N.prototype.emit = function(e) {
3346
3385
  if (u === void 0)
3347
3386
  return !1;
3348
3387
  if (typeof u == "function")
3349
- nn(u, this, r);
3388
+ sn(u, this, r);
3350
3389
  else
3351
- for (var l = u.length, c = Wn(u, l), n = 0; n < l; ++n)
3352
- nn(c[n], this, r);
3390
+ for (var d = u.length, c = Jn(u, d), n = 0; n < d; ++n)
3391
+ sn(c[n], this, r);
3353
3392
  return !0;
3354
3393
  };
3355
- function Gn(t, e, r, n) {
3394
+ function zn(t, e, r, n) {
3356
3395
  var i, o, s;
3357
3396
  if (Dt(r), o = t._events, o === void 0 ? (o = t._events = /* @__PURE__ */ Object.create(null), t._eventsCount = 0) : (o.newListener !== void 0 && (t.emit(
3358
3397
  "newListener",
@@ -3360,7 +3399,7 @@ function Gn(t, e, r, n) {
3360
3399
  r.listener ? r.listener : r
3361
3400
  ), o = t._events), s = o[e]), s === void 0)
3362
3401
  s = o[e] = r, ++t._eventsCount;
3363
- else if (typeof s == "function" ? s = o[e] = n ? [r, s] : [s, r] : n ? s.unshift(r) : s.push(r), i = Qn(t), i > 0 && s.length > i && !s.warned) {
3402
+ else if (typeof s == "function" ? s = o[e] = n ? [r, s] : [s, r] : n ? s.unshift(r) : s.push(r), i = Kn(t), i > 0 && s.length > i && !s.warned) {
3364
3403
  s.warned = !0;
3365
3404
  var a = new Error("Possible EventEmitter memory leak detected. " + s.length + " " + String(e) + " listeners added. Use emitter.setMaxListeners() to increase limit");
3366
3405
  a.name = "MaxListenersExceededWarning", a.emitter = t, a.type = e, a.count = s.length, vs(a);
@@ -3368,25 +3407,25 @@ function Gn(t, e, r, n) {
3368
3407
  return t;
3369
3408
  }
3370
3409
  N.prototype.addListener = function(e, r) {
3371
- return Gn(this, e, r, !1);
3410
+ return zn(this, e, r, !1);
3372
3411
  };
3373
3412
  N.prototype.on = N.prototype.addListener;
3374
3413
  N.prototype.prependListener = function(e, r) {
3375
- return Gn(this, e, r, !0);
3414
+ return zn(this, e, r, !0);
3376
3415
  };
3377
3416
  function Ss() {
3378
3417
  if (!this.fired)
3379
3418
  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);
3380
3419
  }
3381
- function Kn(t, e, r) {
3420
+ function Hn(t, e, r) {
3382
3421
  var n = { fired: !1, wrapFn: void 0, target: t, type: e, listener: r }, i = Ss.bind(n);
3383
3422
  return i.listener = r, n.wrapFn = i, i;
3384
3423
  }
3385
3424
  N.prototype.once = function(e, r) {
3386
- return Dt(r), this.on(e, Kn(this, e, r)), this;
3425
+ return Dt(r), this.on(e, Hn(this, e, r)), this;
3387
3426
  };
3388
3427
  N.prototype.prependOnceListener = function(e, r) {
3389
- return Dt(r), this.prependListener(e, Kn(this, e, r)), this;
3428
+ return Dt(r), this.prependListener(e, Hn(this, e, r)), this;
3390
3429
  };
3391
3430
  N.prototype.removeListener = function(e, r) {
3392
3431
  var n, i, o, s, a;
@@ -3428,24 +3467,24 @@ N.prototype.removeAllListeners = function(e) {
3428
3467
  this.removeListener(e, r[i]);
3429
3468
  return this;
3430
3469
  };
3431
- function zn(t, e, r) {
3470
+ function Wn(t, e, r) {
3432
3471
  var n = t._events;
3433
3472
  if (n === void 0)
3434
3473
  return [];
3435
3474
  var i = n[e];
3436
- return i === void 0 ? [] : typeof i == "function" ? r ? [i.listener || i] : [i] : r ? As(i) : Wn(i, i.length);
3475
+ return i === void 0 ? [] : typeof i == "function" ? r ? [i.listener || i] : [i] : r ? As(i) : Jn(i, i.length);
3437
3476
  }
3438
3477
  N.prototype.listeners = function(e) {
3439
- return zn(this, e, !0);
3478
+ return Wn(this, e, !0);
3440
3479
  };
3441
3480
  N.prototype.rawListeners = function(e) {
3442
- return zn(this, e, !1);
3481
+ return Wn(this, e, !1);
3443
3482
  };
3444
3483
  N.listenerCount = function(t, e) {
3445
- return typeof t.listenerCount == "function" ? t.listenerCount(e) : Hn.call(t, e);
3484
+ return typeof t.listenerCount == "function" ? t.listenerCount(e) : Yn.call(t, e);
3446
3485
  };
3447
- N.prototype.listenerCount = Hn;
3448
- function Hn(t) {
3486
+ N.prototype.listenerCount = Yn;
3487
+ function Yn(t) {
3449
3488
  var e = this._events;
3450
3489
  if (e !== void 0) {
3451
3490
  var r = e[t];
@@ -3459,7 +3498,7 @@ function Hn(t) {
3459
3498
  N.prototype.eventNames = function() {
3460
3499
  return this._eventsCount > 0 ? mt(this._events) : [];
3461
3500
  };
3462
- function Wn(t, e) {
3501
+ function Jn(t, e) {
3463
3502
  for (var r = new Array(e), n = 0; n < e; ++n)
3464
3503
  r[n] = t[n];
3465
3504
  return r;
@@ -3482,13 +3521,13 @@ function Es(t, e) {
3482
3521
  function o() {
3483
3522
  typeof t.removeListener == "function" && t.removeListener("error", i), r([].slice.call(arguments));
3484
3523
  }
3485
- Yn(t, e, o, { once: !0 }), e !== "error" && Is(t, i, { once: !0 });
3524
+ Xn(t, e, o, { once: !0 }), e !== "error" && Is(t, i, { once: !0 });
3486
3525
  });
3487
3526
  }
3488
3527
  function Is(t, e, r) {
3489
- typeof t.on == "function" && Yn(t, "error", e, r);
3528
+ typeof t.on == "function" && Xn(t, "error", e, r);
3490
3529
  }
3491
- function Yn(t, e, r, n) {
3530
+ function Xn(t, e, r, n) {
3492
3531
  if (typeof t.on == "function")
3493
3532
  n.once ? t.once(e, r) : t.on(e, r);
3494
3533
  else if (typeof t.addEventListener == "function")
@@ -3498,7 +3537,7 @@ function Yn(t, e, r, n) {
3498
3537
  else
3499
3538
  throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof t);
3500
3539
  }
3501
- var Jn = Tr.exports, Rt = {}, Xn = {}, Zn = function() {
3540
+ var Zn = Tr.exports, Rt = {}, ei = {}, ti = function() {
3502
3541
  if (typeof Symbol != "function" || typeof Object.getOwnPropertySymbols != "function")
3503
3542
  return !1;
3504
3543
  if (typeof Symbol.iterator == "symbol")
@@ -3521,16 +3560,16 @@ var Jn = Tr.exports, Rt = {}, Xn = {}, Zn = function() {
3521
3560
  return !1;
3522
3561
  }
3523
3562
  return !0;
3524
- }, Os = Zn, Vt = function() {
3563
+ }, Os = ti, Vt = function() {
3525
3564
  return Os() && !!Symbol.toStringTag;
3526
- }, Ts = Error, _s = EvalError, ks = RangeError, Cs = ReferenceError, ei = SyntaxError, $t = TypeError, Ps = URIError, sn = typeof Symbol < "u" && Symbol, Ls = Zn, Ns = function() {
3527
- return typeof sn != "function" || typeof Symbol != "function" || typeof sn("foo") != "symbol" || typeof Symbol("bar") != "symbol" ? !1 : Ls();
3565
+ }, Ts = Error, _s = EvalError, ks = RangeError, Ps = ReferenceError, ri = SyntaxError, $t = TypeError, Cs = URIError, un = typeof Symbol < "u" && Symbol, Ls = ti, Ns = function() {
3566
+ return typeof un != "function" || typeof Symbol != "function" || typeof un("foo") != "symbol" || typeof Symbol("bar") != "symbol" ? !1 : Ls();
3528
3567
  }, jt = {
3529
3568
  __proto__: null,
3530
3569
  foo: {}
3531
3570
  }, Fs = Object, Ds = function() {
3532
3571
  return { __proto__: jt }.foo === jt.foo && !(jt instanceof Fs);
3533
- }, Rs = "Function.prototype.bind called on incompatible ", Vs = Object.prototype.toString, $s = Math.max, Bs = "[object Function]", an = function(e, r) {
3572
+ }, Rs = "Function.prototype.bind called on incompatible ", Vs = Object.prototype.toString, $s = Math.max, Bs = "[object Function]", cn = function(e, r) {
3534
3573
  for (var n = [], i = 0; i < e.length; i += 1)
3535
3574
  n[i] = e[i];
3536
3575
  for (var o = 0; o < r.length; o += 1)
@@ -3540,11 +3579,11 @@ var Jn = Tr.exports, Rt = {}, Xn = {}, Zn = function() {
3540
3579
  for (var n = [], i = r, o = 0; i < e.length; i += 1, o += 1)
3541
3580
  n[o] = e[i];
3542
3581
  return n;
3543
- }, qs = function(t, e) {
3582
+ }, Us = function(t, e) {
3544
3583
  for (var r = "", n = 0; n < t.length; n += 1)
3545
3584
  r += t[n], n + 1 < t.length && (r += e);
3546
3585
  return r;
3547
- }, Us = function(e) {
3586
+ }, qs = function(e) {
3548
3587
  var r = this;
3549
3588
  if (typeof r != "function" || Vs.apply(r) !== Bs)
3550
3589
  throw new TypeError(Rs + r);
@@ -3552,25 +3591,25 @@ var Jn = Tr.exports, Rt = {}, Xn = {}, Zn = function() {
3552
3591
  if (this instanceof i) {
3553
3592
  var c = r.apply(
3554
3593
  this,
3555
- an(n, arguments)
3594
+ cn(n, arguments)
3556
3595
  );
3557
3596
  return Object(c) === c ? c : this;
3558
3597
  }
3559
3598
  return r.apply(
3560
3599
  e,
3561
- an(n, arguments)
3600
+ cn(n, arguments)
3562
3601
  );
3563
3602
  }, s = $s(0, r.length - n.length), a = [], u = 0; u < s; u++)
3564
3603
  a[u] = "$" + u;
3565
- if (i = Function("binder", "return function (" + qs(a, ",") + "){ return binder.apply(this,arguments); }")(o), r.prototype) {
3566
- var l = function() {
3604
+ if (i = Function("binder", "return function (" + Us(a, ",") + "){ return binder.apply(this,arguments); }")(o), r.prototype) {
3605
+ var d = function() {
3567
3606
  };
3568
- l.prototype = r.prototype, i.prototype = new l(), l.prototype = null;
3607
+ d.prototype = r.prototype, i.prototype = new d(), d.prototype = null;
3569
3608
  }
3570
3609
  return i;
3571
- }, js = Us, _r = Function.prototype.bind || js, xs = Function.prototype.call, Qs = Object.prototype.hasOwnProperty, Gs = _r, Ks = Gs.call(xs, Qs), T, zs = Ts, Hs = _s, Ws = ks, Ys = Cs, ze = ei, Ke = $t, Js = Ps, ti = Function, xt = function(t) {
3610
+ }, js = qs, _r = Function.prototype.bind || js, xs = Function.prototype.call, Qs = Object.prototype.hasOwnProperty, Gs = _r, Ks = Gs.call(xs, Qs), T, zs = Ts, Hs = _s, Ws = ks, Ys = Ps, We = ri, ze = $t, Js = Cs, ni = Function, xt = function(t) {
3572
3611
  try {
3573
- return ti('"use strict"; return (' + t + ").constructor;")();
3612
+ return ni('"use strict"; return (' + t + ").constructor;")();
3574
3613
  } catch {
3575
3614
  }
3576
3615
  }, Le = Object.getOwnPropertyDescriptor;
@@ -3581,7 +3620,7 @@ if (Le)
3581
3620
  Le = null;
3582
3621
  }
3583
3622
  var Qt = function() {
3584
- throw new Ke();
3623
+ throw new ze();
3585
3624
  }, Xs = Le ? function() {
3586
3625
  try {
3587
3626
  return arguments.callee, Qt;
@@ -3594,17 +3633,17 @@ var Qt = function() {
3594
3633
  }
3595
3634
  }() : Qt, Me = Ns(), Zs = Ds(), j = Object.getPrototypeOf || (Zs ? function(t) {
3596
3635
  return t.__proto__;
3597
- } : null), Ue = {}, ea = typeof Uint8Array > "u" || !j ? T : j(Uint8Array), Ne = {
3636
+ } : null), qe = {}, ea = typeof Uint8Array > "u" || !j ? T : j(Uint8Array), Ne = {
3598
3637
  __proto__: null,
3599
3638
  "%AggregateError%": typeof AggregateError > "u" ? T : AggregateError,
3600
3639
  "%Array%": Array,
3601
3640
  "%ArrayBuffer%": typeof ArrayBuffer > "u" ? T : ArrayBuffer,
3602
3641
  "%ArrayIteratorPrototype%": Me && j ? j([][Symbol.iterator]()) : T,
3603
3642
  "%AsyncFromSyncIteratorPrototype%": T,
3604
- "%AsyncFunction%": Ue,
3605
- "%AsyncGenerator%": Ue,
3606
- "%AsyncGeneratorFunction%": Ue,
3607
- "%AsyncIteratorPrototype%": Ue,
3643
+ "%AsyncFunction%": qe,
3644
+ "%AsyncGenerator%": qe,
3645
+ "%AsyncGeneratorFunction%": qe,
3646
+ "%AsyncIteratorPrototype%": qe,
3608
3647
  "%Atomics%": typeof Atomics > "u" ? T : Atomics,
3609
3648
  "%BigInt%": typeof BigInt > "u" ? T : BigInt,
3610
3649
  "%BigInt64Array%": typeof BigInt64Array > "u" ? T : BigInt64Array,
@@ -3623,8 +3662,8 @@ var Qt = function() {
3623
3662
  "%Float32Array%": typeof Float32Array > "u" ? T : Float32Array,
3624
3663
  "%Float64Array%": typeof Float64Array > "u" ? T : Float64Array,
3625
3664
  "%FinalizationRegistry%": typeof FinalizationRegistry > "u" ? T : FinalizationRegistry,
3626
- "%Function%": ti,
3627
- "%GeneratorFunction%": Ue,
3665
+ "%Function%": ni,
3666
+ "%GeneratorFunction%": qe,
3628
3667
  "%Int8Array%": typeof Int8Array > "u" ? T : Int8Array,
3629
3668
  "%Int16Array%": typeof Int16Array > "u" ? T : Int16Array,
3630
3669
  "%Int32Array%": typeof Int32Array > "u" ? T : Int32Array,
@@ -3651,10 +3690,10 @@ var Qt = function() {
3651
3690
  "%String%": String,
3652
3691
  "%StringIteratorPrototype%": Me && j ? j(""[Symbol.iterator]()) : T,
3653
3692
  "%Symbol%": Me ? Symbol : T,
3654
- "%SyntaxError%": ze,
3693
+ "%SyntaxError%": We,
3655
3694
  "%ThrowTypeError%": Xs,
3656
3695
  "%TypedArray%": ea,
3657
- "%TypeError%": Ke,
3696
+ "%TypeError%": ze,
3658
3697
  "%Uint8Array%": typeof Uint8Array > "u" ? T : Uint8Array,
3659
3698
  "%Uint8ClampedArray%": typeof Uint8ClampedArray > "u" ? T : Uint8ClampedArray,
3660
3699
  "%Uint16Array%": typeof Uint16Array > "u" ? T : Uint16Array,
@@ -3687,7 +3726,7 @@ var ra = function t(e) {
3687
3726
  i && j && (r = j(i.prototype));
3688
3727
  }
3689
3728
  return Ne[e] = r, r;
3690
- }, un = {
3729
+ }, dn = {
3691
3730
  __proto__: null,
3692
3731
  "%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"],
3693
3732
  "%ArrayPrototype%": ["Array", "prototype"],
@@ -3740,48 +3779,48 @@ var ra = function t(e) {
3740
3779
  "%URIErrorPrototype%": ["URIError", "prototype"],
3741
3780
  "%WeakMapPrototype%": ["WeakMap", "prototype"],
3742
3781
  "%WeakSetPrototype%": ["WeakSet", "prototype"]
3743
- }, st = _r, It = Ks, na = st.call(Function.call, Array.prototype.concat), ia = st.call(Function.apply, Array.prototype.splice), cn = st.call(Function.call, String.prototype.replace), Ot = st.call(Function.call, String.prototype.slice), oa = st.call(Function.call, RegExp.prototype.exec), sa = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, aa = /\\(\\)?/g, ua = function(e) {
3782
+ }, st = _r, It = Ks, na = st.call(Function.call, Array.prototype.concat), ia = st.call(Function.apply, Array.prototype.splice), ln = st.call(Function.call, String.prototype.replace), Ot = st.call(Function.call, String.prototype.slice), oa = st.call(Function.call, RegExp.prototype.exec), sa = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, aa = /\\(\\)?/g, ua = function(e) {
3744
3783
  var r = Ot(e, 0, 1), n = Ot(e, -1);
3745
3784
  if (r === "%" && n !== "%")
3746
- throw new ze("invalid intrinsic syntax, expected closing `%`");
3785
+ throw new We("invalid intrinsic syntax, expected closing `%`");
3747
3786
  if (n === "%" && r !== "%")
3748
- throw new ze("invalid intrinsic syntax, expected opening `%`");
3787
+ throw new We("invalid intrinsic syntax, expected opening `%`");
3749
3788
  var i = [];
3750
- return cn(e, sa, function(o, s, a, u) {
3751
- i[i.length] = a ? cn(u, aa, "$1") : s || o;
3789
+ return ln(e, sa, function(o, s, a, u) {
3790
+ i[i.length] = a ? ln(u, aa, "$1") : s || o;
3752
3791
  }), i;
3753
3792
  }, ca = function(e, r) {
3754
3793
  var n = e, i;
3755
- if (It(un, n) && (i = un[n], n = "%" + i[0] + "%"), It(Ne, n)) {
3794
+ if (It(dn, n) && (i = dn[n], n = "%" + i[0] + "%"), It(Ne, n)) {
3756
3795
  var o = Ne[n];
3757
- if (o === Ue && (o = ra(n)), typeof o > "u" && !r)
3758
- throw new Ke("intrinsic " + e + " exists, but is not available. Please file an issue!");
3796
+ if (o === qe && (o = ra(n)), typeof o > "u" && !r)
3797
+ throw new ze("intrinsic " + e + " exists, but is not available. Please file an issue!");
3759
3798
  return {
3760
3799
  alias: i,
3761
3800
  name: n,
3762
3801
  value: o
3763
3802
  };
3764
3803
  }
3765
- throw new ze("intrinsic " + e + " does not exist!");
3804
+ throw new We("intrinsic " + e + " does not exist!");
3766
3805
  }, at = function(e, r) {
3767
3806
  if (typeof e != "string" || e.length === 0)
3768
- throw new Ke("intrinsic name must be a non-empty string");
3807
+ throw new ze("intrinsic name must be a non-empty string");
3769
3808
  if (arguments.length > 1 && typeof r != "boolean")
3770
- throw new Ke('"allowMissing" argument must be a boolean');
3809
+ throw new ze('"allowMissing" argument must be a boolean');
3771
3810
  if (oa(/^%?[^%]*%?$/, e) === null)
3772
- throw new ze("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
3773
- var n = ua(e), i = n.length > 0 ? n[0] : "", o = ca("%" + i + "%", r), s = o.name, a = o.value, u = !1, l = o.alias;
3774
- l && (i = l[0], ia(n, na([0, 1], l)));
3811
+ throw new We("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
3812
+ var n = ua(e), i = n.length > 0 ? n[0] : "", o = ca("%" + i + "%", r), s = o.name, a = o.value, u = !1, d = o.alias;
3813
+ d && (i = d[0], ia(n, na([0, 1], d)));
3775
3814
  for (var c = 1, f = !0; c < n.length; c += 1) {
3776
3815
  var p = n[c], v = Ot(p, 0, 1), w = Ot(p, -1);
3777
3816
  if ((v === '"' || v === "'" || v === "`" || w === '"' || w === "'" || w === "`") && v !== w)
3778
- throw new ze("property names with quotes must have matching quotes");
3817
+ throw new We("property names with quotes must have matching quotes");
3779
3818
  if ((p === "constructor" || !f) && (u = !0), i += "." + p, s = "%" + i + "%", It(Ne, s))
3780
3819
  a = Ne[s];
3781
3820
  else if (a != null) {
3782
3821
  if (!(p in a)) {
3783
3822
  if (!r)
3784
- throw new Ke("base intrinsic for " + e + " exists, but the property is not available.");
3823
+ throw new ze("base intrinsic for " + e + " exists, but the property is not available.");
3785
3824
  return;
3786
3825
  }
3787
3826
  if (Le && c + 1 >= n.length) {
@@ -3793,10 +3832,10 @@ var ra = function t(e) {
3793
3832
  }
3794
3833
  }
3795
3834
  return a;
3796
- }, ri = { exports: {} }, Gt, dn;
3835
+ }, ii = { exports: {} }, Gt, fn;
3797
3836
  function kr() {
3798
- if (dn) return Gt;
3799
- dn = 1;
3837
+ if (fn) return Gt;
3838
+ fn = 1;
3800
3839
  var t = at, e = t("%Object.defineProperty%", !0) || !1;
3801
3840
  if (e)
3802
3841
  try {
@@ -3813,22 +3852,22 @@ if (gt)
3813
3852
  } catch {
3814
3853
  gt = null;
3815
3854
  }
3816
- var Bt = gt, ln = kr(), la = ei, qe = $t, fn = Bt, fa = function(e, r, n) {
3855
+ var Bt = gt, pn = kr(), la = ri, Ue = $t, hn = Bt, fa = function(e, r, n) {
3817
3856
  if (!e || typeof e != "object" && typeof e != "function")
3818
- throw new qe("`obj` must be an object or a function`");
3857
+ throw new Ue("`obj` must be an object or a function`");
3819
3858
  if (typeof r != "string" && typeof r != "symbol")
3820
- throw new qe("`property` must be a string or a symbol`");
3859
+ throw new Ue("`property` must be a string or a symbol`");
3821
3860
  if (arguments.length > 3 && typeof arguments[3] != "boolean" && arguments[3] !== null)
3822
- throw new qe("`nonEnumerable`, if provided, must be a boolean or null");
3861
+ throw new Ue("`nonEnumerable`, if provided, must be a boolean or null");
3823
3862
  if (arguments.length > 4 && typeof arguments[4] != "boolean" && arguments[4] !== null)
3824
- throw new qe("`nonWritable`, if provided, must be a boolean or null");
3863
+ throw new Ue("`nonWritable`, if provided, must be a boolean or null");
3825
3864
  if (arguments.length > 5 && typeof arguments[5] != "boolean" && arguments[5] !== null)
3826
- throw new qe("`nonConfigurable`, if provided, must be a boolean or null");
3865
+ throw new Ue("`nonConfigurable`, if provided, must be a boolean or null");
3827
3866
  if (arguments.length > 6 && typeof arguments[6] != "boolean")
3828
- throw new qe("`loose`, if provided, must be a boolean");
3829
- var i = arguments.length > 3 ? arguments[3] : null, o = arguments.length > 4 ? arguments[4] : null, s = arguments.length > 5 ? arguments[5] : null, a = arguments.length > 6 ? arguments[6] : !1, u = !!fn && fn(e, r);
3830
- if (ln)
3831
- ln(e, r, {
3867
+ throw new Ue("`loose`, if provided, must be a boolean");
3868
+ var i = arguments.length > 3 ? arguments[3] : null, o = arguments.length > 4 ? arguments[4] : null, s = arguments.length > 5 ? arguments[5] : null, a = arguments.length > 6 ? arguments[6] : !1, u = !!hn && hn(e, r);
3869
+ if (pn)
3870
+ pn(e, r, {
3832
3871
  configurable: s === null && u ? u.configurable : !s,
3833
3872
  enumerable: i === null && u ? u.enumerable : !i,
3834
3873
  value: n,
@@ -3838,10 +3877,10 @@ var Bt = gt, ln = kr(), la = ei, qe = $t, fn = Bt, fa = function(e, r, n) {
3838
3877
  e[r] = n;
3839
3878
  else
3840
3879
  throw new la("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");
3841
- }, lr = kr(), ni = function() {
3880
+ }, lr = kr(), oi = function() {
3842
3881
  return !!lr;
3843
3882
  };
3844
- ni.hasArrayLengthDefineBug = function() {
3883
+ oi.hasArrayLengthDefineBug = function() {
3845
3884
  if (!lr)
3846
3885
  return null;
3847
3886
  try {
@@ -3850,24 +3889,24 @@ ni.hasArrayLengthDefineBug = function() {
3850
3889
  return !0;
3851
3890
  }
3852
3891
  };
3853
- var pa = ni, ha = at, pn = fa, ya = pa(), hn = Bt, yn = $t, ma = ha("%Math.floor%"), ga = function(e, r) {
3892
+ var pa = oi, ha = at, yn = fa, ya = pa(), mn = Bt, gn = $t, ma = ha("%Math.floor%"), ga = function(e, r) {
3854
3893
  if (typeof e != "function")
3855
- throw new yn("`fn` is not a function");
3894
+ throw new gn("`fn` is not a function");
3856
3895
  if (typeof r != "number" || r < 0 || r > 4294967295 || ma(r) !== r)
3857
- throw new yn("`length` must be a positive 32-bit integer");
3896
+ throw new gn("`length` must be a positive 32-bit integer");
3858
3897
  var n = arguments.length > 2 && !!arguments[2], i = !0, o = !0;
3859
- if ("length" in e && hn) {
3860
- var s = hn(e, "length");
3898
+ if ("length" in e && mn) {
3899
+ var s = mn(e, "length");
3861
3900
  s && !s.configurable && (i = !1), s && !s.writable && (o = !1);
3862
3901
  }
3863
- return (i || o || !n) && (ya ? pn(
3902
+ return (i || o || !n) && (ya ? yn(
3864
3903
  /** @type {Parameters<define>[0]} */
3865
3904
  e,
3866
3905
  "length",
3867
3906
  r,
3868
3907
  !0,
3869
3908
  !0
3870
- ) : pn(
3909
+ ) : yn(
3871
3910
  /** @type {Parameters<define>[0]} */
3872
3911
  e,
3873
3912
  "length",
@@ -3875,14 +3914,14 @@ var pa = ni, ha = at, pn = fa, ya = pa(), hn = Bt, yn = $t, ma = ha("%Math.floor
3875
3914
  )), e;
3876
3915
  };
3877
3916
  (function(t) {
3878
- var e = _r, r = at, n = ga, i = $t, o = r("%Function.prototype.apply%"), s = r("%Function.prototype.call%"), a = r("%Reflect.apply%", !0) || e.call(s, o), u = kr(), l = r("%Math.max%");
3917
+ var e = _r, r = at, n = ga, i = $t, o = r("%Function.prototype.apply%"), s = r("%Function.prototype.call%"), a = r("%Reflect.apply%", !0) || e.call(s, o), u = kr(), d = r("%Math.max%");
3879
3918
  t.exports = function(p) {
3880
3919
  if (typeof p != "function")
3881
3920
  throw new i("a function is required");
3882
3921
  var v = a(e, s, arguments);
3883
3922
  return n(
3884
3923
  v,
3885
- 1 + l(0, p.length - (arguments.length - 1)),
3924
+ 1 + d(0, p.length - (arguments.length - 1)),
3886
3925
  !0
3887
3926
  );
3888
3927
  };
@@ -3890,20 +3929,20 @@ var pa = ni, ha = at, pn = fa, ya = pa(), hn = Bt, yn = $t, ma = ha("%Math.floor
3890
3929
  return a(e, o, arguments);
3891
3930
  };
3892
3931
  u ? u(t.exports, "apply", { value: c }) : t.exports.apply = c;
3893
- })(ri);
3894
- var Cr = ri.exports, ii = at, oi = Cr, ba = oi(ii("String.prototype.indexOf")), Pr = function(e, r) {
3895
- var n = ii(e, !!r);
3896
- return typeof n == "function" && ba(e, ".prototype.") > -1 ? oi(n) : n;
3897
- }, va = Vt(), Sa = Pr, fr = Sa("Object.prototype.toString"), Mt = function(e) {
3932
+ })(ii);
3933
+ var Pr = ii.exports, si = at, ai = Pr, ba = ai(si("String.prototype.indexOf")), Cr = function(e, r) {
3934
+ var n = si(e, !!r);
3935
+ return typeof n == "function" && ba(e, ".prototype.") > -1 ? ai(n) : n;
3936
+ }, va = Vt(), Sa = Cr, fr = Sa("Object.prototype.toString"), Mt = function(e) {
3898
3937
  return va && e && typeof e == "object" && Symbol.toStringTag in e ? !1 : fr(e) === "[object Arguments]";
3899
- }, si = function(e) {
3938
+ }, ui = function(e) {
3900
3939
  return Mt(e) ? !0 : e !== null && typeof e == "object" && typeof e.length == "number" && e.length >= 0 && fr(e) !== "[object Array]" && fr(e.callee) === "[object Function]";
3901
3940
  }, wa = function() {
3902
3941
  return Mt(arguments);
3903
3942
  }();
3904
- Mt.isLegacyArguments = si;
3905
- var Aa = wa ? Mt : si, Ea = Object.prototype.toString, Ia = Function.prototype.toString, Oa = /^\s*(?:function)?\*/, ai = Vt(), Kt = Object.getPrototypeOf, Ta = function() {
3906
- if (!ai)
3943
+ Mt.isLegacyArguments = ui;
3944
+ var Aa = wa ? Mt : ui, Ea = Object.prototype.toString, Ia = Function.prototype.toString, Oa = /^\s*(?:function)?\*/, ci = Vt(), Kt = Object.getPrototypeOf, Ta = function() {
3945
+ if (!ci)
3907
3946
  return !1;
3908
3947
  try {
3909
3948
  return Function("return function*() {}")();
@@ -3914,7 +3953,7 @@ var Aa = wa ? Mt : si, Ea = Object.prototype.toString, Ia = Function.prototype.t
3914
3953
  return !1;
3915
3954
  if (Oa.test(Ia.call(e)))
3916
3955
  return !0;
3917
- if (!ai) {
3956
+ if (!ci) {
3918
3957
  var r = Ea.call(e);
3919
3958
  return r === "[object GeneratorFunction]";
3920
3959
  }
@@ -3925,7 +3964,7 @@ var Aa = wa ? Mt : si, Ea = Object.prototype.toString, Ia = Function.prototype.t
3925
3964
  zt = n ? Kt(n) : !1;
3926
3965
  }
3927
3966
  return Kt(e) === zt;
3928
- }, ui = Function.prototype.toString, xe = typeof Reflect == "object" && Reflect !== null && Reflect.apply, pr, bt;
3967
+ }, di = Function.prototype.toString, xe = typeof Reflect == "object" && Reflect !== null && Reflect.apply, pr, bt;
3929
3968
  if (typeof xe == "function" && typeof Object.defineProperty == "function")
3930
3969
  try {
3931
3970
  pr = Object.defineProperty({}, "length", {
@@ -3942,18 +3981,18 @@ else
3942
3981
  xe = null;
3943
3982
  var ka = /^\s*class\b/, hr = function(e) {
3944
3983
  try {
3945
- var r = ui.call(e);
3984
+ var r = di.call(e);
3946
3985
  return ka.test(r);
3947
3986
  } catch {
3948
3987
  return !1;
3949
3988
  }
3950
3989
  }, Ht = function(e) {
3951
3990
  try {
3952
- return hr(e) ? !1 : (ui.call(e), !0);
3991
+ return hr(e) ? !1 : (di.call(e), !0);
3953
3992
  } catch {
3954
3993
  return !1;
3955
3994
  }
3956
- }, vt = Object.prototype.toString, Ca = "[object Object]", Pa = "[object Function]", La = "[object GeneratorFunction]", Na = "[object HTMLAllCollection]", Fa = "[object HTML document.all class]", Da = "[object HTMLCollection]", Ra = typeof Symbol == "function" && !!Symbol.toStringTag, Va = !(0 in [,]), yr = function() {
3995
+ }, vt = Object.prototype.toString, Pa = "[object Object]", Ca = "[object Function]", La = "[object GeneratorFunction]", Na = "[object HTMLAllCollection]", Fa = "[object HTML document.all class]", Da = "[object HTMLCollection]", Ra = typeof Symbol == "function" && !!Symbol.toStringTag, Va = !(0 in [,]), yr = function() {
3957
3996
  return !1;
3958
3997
  };
3959
3998
  if (typeof document == "object") {
@@ -3962,7 +4001,7 @@ if (typeof document == "object") {
3962
4001
  if ((Va || !e) && (typeof e > "u" || typeof e == "object"))
3963
4002
  try {
3964
4003
  var r = vt.call(e);
3965
- return (r === Na || r === Fa || r === Da || r === Ca) && e("") == null;
4004
+ return (r === Na || r === Fa || r === Da || r === Pa) && e("") == null;
3966
4005
  } catch {
3967
4006
  }
3968
4007
  return !1;
@@ -3990,22 +4029,22 @@ var Ba = xe ? function(e) {
3990
4029
  if (hr(e))
3991
4030
  return !1;
3992
4031
  var r = vt.call(e);
3993
- return r !== Pa && r !== La && !/^\[object HTML/.test(r) ? !1 : Ht(e);
3994
- }, Ma = Ba, qa = Object.prototype.toString, ci = Object.prototype.hasOwnProperty, Ua = function(e, r, n) {
4032
+ return r !== Ca && r !== La && !/^\[object HTML/.test(r) ? !1 : Ht(e);
4033
+ }, Ma = Ba, Ua = Object.prototype.toString, li = Object.prototype.hasOwnProperty, qa = function(e, r, n) {
3995
4034
  for (var i = 0, o = e.length; i < o; i++)
3996
- ci.call(e, i) && (n == null ? r(e[i], i, e) : r.call(n, e[i], i, e));
4035
+ li.call(e, i) && (n == null ? r(e[i], i, e) : r.call(n, e[i], i, e));
3997
4036
  }, ja = function(e, r, n) {
3998
4037
  for (var i = 0, o = e.length; i < o; i++)
3999
4038
  n == null ? r(e.charAt(i), i, e) : r.call(n, e.charAt(i), i, e);
4000
4039
  }, xa = function(e, r, n) {
4001
4040
  for (var i in e)
4002
- ci.call(e, i) && (n == null ? r(e[i], i, e) : r.call(n, e[i], i, e));
4041
+ li.call(e, i) && (n == null ? r(e[i], i, e) : r.call(n, e[i], i, e));
4003
4042
  }, Qa = function(e, r, n) {
4004
4043
  if (!Ma(r))
4005
4044
  throw new TypeError("iterator must be a function");
4006
4045
  var i;
4007
- arguments.length >= 3 && (i = n), qa.call(e) === "[object Array]" ? Ua(e, r, i) : typeof e == "string" ? ja(e, r, i) : xa(e, r, i);
4008
- }, di = Qa, Ga = [
4046
+ arguments.length >= 3 && (i = n), Ua.call(e) === "[object Array]" ? qa(e, r, i) : typeof e == "string" ? ja(e, r, i) : xa(e, r, i);
4047
+ }, fi = Qa, Ga = [
4009
4048
  "Float32Array",
4010
4049
  "Float64Array",
4011
4050
  "Int8Array",
@@ -4017,29 +4056,29 @@ var Ba = xe ? function(e) {
4017
4056
  "Uint32Array",
4018
4057
  "BigInt64Array",
4019
4058
  "BigUint64Array"
4020
- ], Wt = Ga, Ka = typeof globalThis > "u" ? Er : globalThis, li = function() {
4059
+ ], Wt = Ga, Ka = typeof globalThis > "u" ? Er : globalThis, pi = function() {
4021
4060
  for (var e = [], r = 0; r < Wt.length; r++)
4022
4061
  typeof Ka[Wt[r]] == "function" && (e[e.length] = Wt[r]);
4023
4062
  return e;
4024
- }, Tt = di, za = li, mn = Cr, Lr = Pr, St = Bt, Ha = Lr("Object.prototype.toString"), fi = Vt(), gn = typeof globalThis > "u" ? Er : globalThis, mr = za(), Nr = Lr("String.prototype.slice"), Yt = Object.getPrototypeOf, Wa = Lr("Array.prototype.indexOf", !0) || function(e, r) {
4063
+ }, Tt = fi, za = pi, bn = Pr, Lr = Cr, St = Bt, Ha = Lr("Object.prototype.toString"), hi = Vt(), vn = typeof globalThis > "u" ? Er : globalThis, mr = za(), Nr = Lr("String.prototype.slice"), Yt = Object.getPrototypeOf, Wa = Lr("Array.prototype.indexOf", !0) || function(e, r) {
4025
4064
  for (var n = 0; n < e.length; n += 1)
4026
4065
  if (e[n] === r)
4027
4066
  return n;
4028
4067
  return -1;
4029
4068
  }, _t = { __proto__: null };
4030
- fi && St && Yt ? Tt(mr, function(t) {
4031
- var e = new gn[t]();
4069
+ hi && St && Yt ? Tt(mr, function(t) {
4070
+ var e = new vn[t]();
4032
4071
  if (Symbol.toStringTag in e) {
4033
4072
  var r = Yt(e), n = St(r, Symbol.toStringTag);
4034
4073
  if (!n) {
4035
4074
  var i = Yt(r);
4036
4075
  n = St(i, Symbol.toStringTag);
4037
4076
  }
4038
- _t["$" + t] = mn(n.get);
4077
+ _t["$" + t] = bn(n.get);
4039
4078
  }
4040
4079
  }) : Tt(mr, function(t) {
4041
- var e = new gn[t](), r = e.slice || e.set;
4042
- r && (_t["$" + t] = mn(r));
4080
+ var e = new vn[t](), r = e.slice || e.set;
4081
+ r && (_t["$" + t] = bn(r));
4043
4082
  });
4044
4083
  var Ya = function(e) {
4045
4084
  var r = !1;
@@ -4062,30 +4101,30 @@ var Ya = function(e) {
4062
4101
  }, Xa = function(e) {
4063
4102
  if (!e || typeof e != "object")
4064
4103
  return !1;
4065
- if (!fi) {
4104
+ if (!hi) {
4066
4105
  var r = Nr(Ha(e), 8, -1);
4067
4106
  return Wa(mr, r) > -1 ? r : r !== "Object" ? !1 : Ja(e);
4068
4107
  }
4069
4108
  return St ? Ya(e) : null;
4070
- }, kt = di, Za = li, bn = Cr, Fr = Pr, wt = Bt, eu = Fr("Object.prototype.toString"), pi = Vt(), vn = typeof globalThis > "u" ? Er : globalThis, gr = Za(), Dr = Fr("String.prototype.slice"), Jt = Object.getPrototypeOf, tu = Fr("Array.prototype.indexOf", !0) || function(e, r) {
4109
+ }, kt = fi, Za = pi, Sn = Pr, Fr = Cr, wt = Bt, eu = Fr("Object.prototype.toString"), yi = Vt(), wn = typeof globalThis > "u" ? Er : globalThis, gr = Za(), Dr = Fr("String.prototype.slice"), Jt = Object.getPrototypeOf, tu = Fr("Array.prototype.indexOf", !0) || function(e, r) {
4071
4110
  for (var n = 0; n < e.length; n += 1)
4072
4111
  if (e[n] === r)
4073
4112
  return n;
4074
4113
  return -1;
4075
- }, Ct = { __proto__: null };
4076
- pi && wt && Jt ? kt(gr, function(t) {
4077
- var e = new vn[t]();
4114
+ }, Pt = { __proto__: null };
4115
+ yi && wt && Jt ? kt(gr, function(t) {
4116
+ var e = new wn[t]();
4078
4117
  if (Symbol.toStringTag in e) {
4079
4118
  var r = Jt(e), n = wt(r, Symbol.toStringTag);
4080
4119
  if (!n) {
4081
4120
  var i = Jt(r);
4082
4121
  n = wt(i, Symbol.toStringTag);
4083
4122
  }
4084
- Ct["$" + t] = bn(n.get);
4123
+ Pt["$" + t] = Sn(n.get);
4085
4124
  }
4086
4125
  }) : kt(gr, function(t) {
4087
- var e = new vn[t](), r = e.slice || e.set;
4088
- r && (Ct["$" + t] = bn(r));
4126
+ var e = new wn[t](), r = e.slice || e.set;
4127
+ r && (Pt["$" + t] = Sn(r));
4089
4128
  });
4090
4129
  var ru = function(e) {
4091
4130
  var r = !1;
@@ -4093,7 +4132,7 @@ var ru = function(e) {
4093
4132
  // eslint-disable-next-line no-extra-parens
4094
4133
  /** @type {Record<`\$${TypedArrayName}`, Getter>} */
4095
4134
  /** @type {any} */
4096
- Ct,
4135
+ Pt,
4097
4136
  /** @type {(getter: Getter, name: `\$${import('.').TypedArrayName}`) => void} */
4098
4137
  function(n, i) {
4099
4138
  if (!r)
@@ -4109,7 +4148,7 @@ var ru = function(e) {
4109
4148
  // eslint-disable-next-line no-extra-parens
4110
4149
  /** @type {Record<`\$${TypedArrayName}`, Getter>} */
4111
4150
  /** @type {any} */
4112
- Ct,
4151
+ Pt,
4113
4152
  /** @type {(getter: typeof cache, name: `\$${import('.').TypedArrayName}`) => void} */
4114
4153
  function(n, i) {
4115
4154
  if (!r)
@@ -4122,7 +4161,7 @@ var ru = function(e) {
4122
4161
  }, iu = function(e) {
4123
4162
  if (!e || typeof e != "object")
4124
4163
  return !1;
4125
- if (!pi) {
4164
+ if (!yi) {
4126
4165
  var r = Dr(eu(e), 8, -1);
4127
4166
  return tu(gr, r) > -1 ? r : r !== "Object" ? !1 : nu(e);
4128
4167
  }
@@ -4135,16 +4174,16 @@ var ru = function(e) {
4135
4174
  function o(y) {
4136
4175
  return y.call.bind(y);
4137
4176
  }
4138
- var s = typeof BigInt < "u", a = typeof Symbol < "u", u = o(Object.prototype.toString), l = o(Number.prototype.valueOf), c = o(String.prototype.valueOf), f = o(Boolean.prototype.valueOf);
4177
+ var s = typeof BigInt < "u", a = typeof Symbol < "u", u = o(Object.prototype.toString), d = o(Number.prototype.valueOf), c = o(String.prototype.valueOf), f = o(Boolean.prototype.valueOf);
4139
4178
  if (s)
4140
4179
  var p = o(BigInt.prototype.valueOf);
4141
4180
  if (a)
4142
4181
  var v = o(Symbol.prototype.valueOf);
4143
- function w(y, Si) {
4182
+ function w(y, Ai) {
4144
4183
  if (typeof y != "object")
4145
4184
  return !1;
4146
4185
  try {
4147
- return Si(y), !0;
4186
+ return Ai(y), !0;
4148
4187
  } catch {
4149
4188
  return !1;
4150
4189
  }
@@ -4166,10 +4205,10 @@ var ru = function(e) {
4166
4205
  return n(y) === "Uint8ClampedArray";
4167
4206
  }
4168
4207
  t.isUint8ClampedArray = F;
4169
- function z(y) {
4208
+ function H(y) {
4170
4209
  return n(y) === "Uint16Array";
4171
4210
  }
4172
- t.isUint16Array = z;
4211
+ t.isUint16Array = H;
4173
4212
  function ne(y) {
4174
4213
  return n(y) === "Uint32Array";
4175
4214
  }
@@ -4198,34 +4237,34 @@ var ru = function(e) {
4198
4237
  return n(y) === "BigInt64Array";
4199
4238
  }
4200
4239
  t.isBigInt64Array = Fe;
4201
- function Oe(y) {
4240
+ function Te(y) {
4202
4241
  return n(y) === "BigUint64Array";
4203
4242
  }
4204
- t.isBigUint64Array = Oe;
4243
+ t.isBigUint64Array = Te;
4205
4244
  function he(y) {
4206
4245
  return u(y) === "[object Map]";
4207
4246
  }
4208
4247
  he.working = typeof Map < "u" && he(/* @__PURE__ */ new Map());
4209
- function qt(y) {
4248
+ function Ut(y) {
4210
4249
  return typeof Map > "u" ? !1 : he.working ? he(y) : y instanceof Map;
4211
4250
  }
4212
- t.isMap = qt;
4251
+ t.isMap = Ut;
4213
4252
  function Ie(y) {
4214
4253
  return u(y) === "[object Set]";
4215
4254
  }
4216
4255
  Ie.working = typeof Set < "u" && Ie(/* @__PURE__ */ new Set());
4217
- function Je(y) {
4256
+ function Ze(y) {
4218
4257
  return typeof Set > "u" ? !1 : Ie.working ? Ie(y) : y instanceof Set;
4219
4258
  }
4220
- t.isSet = Je;
4259
+ t.isSet = Ze;
4221
4260
  function De(y) {
4222
4261
  return u(y) === "[object WeakMap]";
4223
4262
  }
4224
4263
  De.working = typeof WeakMap < "u" && De(/* @__PURE__ */ new WeakMap());
4225
- function Ut(y) {
4264
+ function qt(y) {
4226
4265
  return typeof WeakMap > "u" ? !1 : De.working ? De(y) : y instanceof WeakMap;
4227
4266
  }
4228
- t.isWeakMap = Ut;
4267
+ t.isWeakMap = qt;
4229
4268
  function Re(y) {
4230
4269
  return u(y) === "[object WeakSet]";
4231
4270
  }
@@ -4242,26 +4281,26 @@ var ru = function(e) {
4242
4281
  return typeof ArrayBuffer > "u" ? !1 : Ve.working ? Ve(y) : y instanceof ArrayBuffer;
4243
4282
  }
4244
4283
  t.isArrayBuffer = ut;
4245
- function d(y) {
4284
+ function l(y) {
4246
4285
  return u(y) === "[object DataView]";
4247
4286
  }
4248
- d.working = typeof ArrayBuffer < "u" && typeof DataView < "u" && d(new DataView(new ArrayBuffer(1), 0, 1));
4287
+ l.working = typeof ArrayBuffer < "u" && typeof DataView < "u" && l(new DataView(new ArrayBuffer(1), 0, 1));
4249
4288
  function h(y) {
4250
- return typeof DataView > "u" ? !1 : d.working ? d(y) : y instanceof DataView;
4289
+ return typeof DataView > "u" ? !1 : l.working ? l(y) : y instanceof DataView;
4251
4290
  }
4252
4291
  t.isDataView = h;
4253
4292
  var b = typeof SharedArrayBuffer < "u" ? SharedArrayBuffer : void 0;
4254
4293
  function A(y) {
4255
4294
  return u(y) === "[object SharedArrayBuffer]";
4256
4295
  }
4257
- function C(y) {
4296
+ function P(y) {
4258
4297
  return typeof b > "u" ? !1 : (typeof A.working > "u" && (A.working = A(new b())), A.working ? A(y) : y instanceof b);
4259
4298
  }
4260
- t.isSharedArrayBuffer = C;
4261
- function P(y) {
4299
+ t.isSharedArrayBuffer = P;
4300
+ function C(y) {
4262
4301
  return u(y) === "[object AsyncFunction]";
4263
4302
  }
4264
- t.isAsyncFunction = P;
4303
+ t.isAsyncFunction = C;
4265
4304
  function O(y) {
4266
4305
  return u(y) === "[object Map Iterator]";
4267
4306
  }
@@ -4274,14 +4313,14 @@ var ru = function(e) {
4274
4313
  return u(y) === "[object Generator]";
4275
4314
  }
4276
4315
  t.isGeneratorObject = D;
4277
- function W(y) {
4316
+ function Y(y) {
4278
4317
  return u(y) === "[object WebAssembly.Module]";
4279
4318
  }
4280
- t.isWebAssemblyCompiledModule = W;
4281
- function Te(y) {
4282
- return w(y, l);
4319
+ t.isWebAssemblyCompiledModule = Y;
4320
+ function _e(y) {
4321
+ return w(y, d);
4283
4322
  }
4284
- t.isNumberObject = Te;
4323
+ t.isNumberObject = _e;
4285
4324
  function ct(y) {
4286
4325
  return w(y, c);
4287
4326
  }
@@ -4298,14 +4337,14 @@ var ru = function(e) {
4298
4337
  return a && w(y, v);
4299
4338
  }
4300
4339
  t.isSymbolObject = $r;
4301
- function bi(y) {
4302
- return Te(y) || ct(y) || $e(y) || dt(y) || $r(y);
4340
+ function Si(y) {
4341
+ return _e(y) || ct(y) || $e(y) || dt(y) || $r(y);
4303
4342
  }
4304
- t.isBoxedPrimitive = bi;
4305
- function vi(y) {
4306
- return typeof Uint8Array < "u" && (ut(y) || C(y));
4343
+ t.isBoxedPrimitive = Si;
4344
+ function wi(y) {
4345
+ return typeof Uint8Array < "u" && (ut(y) || P(y));
4307
4346
  }
4308
- t.isAnyArrayBuffer = vi, ["isProxy", "isExternal", "isModuleNamespaceObject"].forEach(function(y) {
4347
+ t.isAnyArrayBuffer = wi, ["isProxy", "isExternal", "isModuleNamespaceObject"].forEach(function(y) {
4309
4348
  Object.defineProperty(t, y, {
4310
4349
  enumerable: !1,
4311
4350
  value: function() {
@@ -4313,7 +4352,7 @@ var ru = function(e) {
4313
4352
  }
4314
4353
  });
4315
4354
  });
4316
- })(Xn);
4355
+ })(ei);
4317
4356
  var au = function(e) {
4318
4357
  return e && typeof e == "object" && typeof e.copy == "function" && typeof e.fill == "function" && typeof e.readUInt8 == "function";
4319
4358
  }, br = { exports: {} };
@@ -4337,19 +4376,19 @@ typeof Object.create == "function" ? br.exports = function(e, r) {
4337
4376
  var uu = br.exports;
4338
4377
  (function(t) {
4339
4378
  var e = Object.getOwnPropertyDescriptors || function(h) {
4340
- for (var b = Object.keys(h), A = {}, C = 0; C < b.length; C++)
4341
- A[b[C]] = Object.getOwnPropertyDescriptor(h, b[C]);
4379
+ for (var b = Object.keys(h), A = {}, P = 0; P < b.length; P++)
4380
+ A[b[P]] = Object.getOwnPropertyDescriptor(h, b[P]);
4342
4381
  return A;
4343
4382
  }, r = /%[sdj%]/g;
4344
- t.format = function(d) {
4345
- if (!L(d)) {
4383
+ t.format = function(l) {
4384
+ if (!L(l)) {
4346
4385
  for (var h = [], b = 0; b < arguments.length; b++)
4347
4386
  h.push(s(arguments[b]));
4348
4387
  return h.join(" ");
4349
4388
  }
4350
- for (var b = 1, A = arguments, C = A.length, P = String(d).replace(r, function(k) {
4389
+ for (var b = 1, A = arguments, P = A.length, C = String(l).replace(r, function(k) {
4351
4390
  if (k === "%%") return "%";
4352
- if (b >= C) return k;
4391
+ if (b >= P) return k;
4353
4392
  switch (k) {
4354
4393
  case "%s":
4355
4394
  return String(A[b++]);
@@ -4364,15 +4403,15 @@ var uu = br.exports;
4364
4403
  default:
4365
4404
  return k;
4366
4405
  }
4367
- }), O = A[b]; b < C; O = A[++b])
4368
- F(O) || !ue(O) ? P += " " + O : P += " " + s(O);
4369
- return P;
4370
- }, t.deprecate = function(d, h) {
4406
+ }), O = A[b]; b < P; O = A[++b])
4407
+ F(O) || !ue(O) ? C += " " + O : C += " " + s(O);
4408
+ return C;
4409
+ }, t.deprecate = function(l, h) {
4371
4410
  if (typeof E < "u" && E.noDeprecation === !0)
4372
- return d;
4411
+ return l;
4373
4412
  if (typeof E > "u")
4374
4413
  return function() {
4375
- return t.deprecate(d, h).apply(this, arguments);
4414
+ return t.deprecate(l, h).apply(this, arguments);
4376
4415
  };
4377
4416
  var b = !1;
4378
4417
  function A() {
@@ -4381,7 +4420,7 @@ var uu = br.exports;
4381
4420
  throw new Error(h);
4382
4421
  E.traceDeprecation ? console.trace(h) : console.error(h), b = !0;
4383
4422
  }
4384
- return d.apply(this, arguments);
4423
+ return l.apply(this, arguments);
4385
4424
  }
4386
4425
  return A;
4387
4426
  };
@@ -4390,25 +4429,25 @@ var uu = br.exports;
4390
4429
  var o = E.env.NODE_DEBUG;
4391
4430
  o = o.replace(/[|\\{}()[\]^$+?.]/g, "\\$&").replace(/\*/g, ".*").replace(/,/g, "$|^").toUpperCase(), i = new RegExp("^" + o + "$", "i");
4392
4431
  }
4393
- t.debuglog = function(d) {
4394
- if (d = d.toUpperCase(), !n[d])
4395
- if (i.test(d)) {
4432
+ t.debuglog = function(l) {
4433
+ if (l = l.toUpperCase(), !n[l])
4434
+ if (i.test(l)) {
4396
4435
  var h = E.pid;
4397
- n[d] = function() {
4436
+ n[l] = function() {
4398
4437
  var b = t.format.apply(t, arguments);
4399
- console.error("%s %d: %s", d, h, b);
4438
+ console.error("%s %d: %s", l, h, b);
4400
4439
  };
4401
4440
  } else
4402
- n[d] = function() {
4441
+ n[l] = function() {
4403
4442
  };
4404
- return n[d];
4443
+ return n[l];
4405
4444
  };
4406
- function s(d, h) {
4445
+ function s(l, h) {
4407
4446
  var b = {
4408
4447
  seen: [],
4409
4448
  stylize: u
4410
4449
  };
4411
- return arguments.length >= 3 && (b.depth = arguments[2]), arguments.length >= 4 && (b.colors = arguments[3]), S(h) ? b.showHidden = h : h && t._extend(b, h), _(b.showHidden) && (b.showHidden = !1), _(b.depth) && (b.depth = 2), _(b.colors) && (b.colors = !1), _(b.customInspect) && (b.customInspect = !0), b.colors && (b.stylize = a), c(b, d, b.depth);
4450
+ return arguments.length >= 3 && (b.depth = arguments[2]), arguments.length >= 4 && (b.colors = arguments[3]), S(h) ? b.showHidden = h : h && t._extend(b, h), _(b.showHidden) && (b.showHidden = !1), _(b.depth) && (b.depth = 2), _(b.colors) && (b.colors = !1), _(b.customInspect) && (b.customInspect = !0), b.colors && (b.stylize = a), c(b, l, b.depth);
4412
4451
  }
4413
4452
  t.inspect = s, s.colors = {
4414
4453
  bold: [1, 22],
@@ -4435,188 +4474,188 @@ var uu = br.exports;
4435
4474
  // "name": intentionally not styling
4436
4475
  regexp: "red"
4437
4476
  };
4438
- function a(d, h) {
4477
+ function a(l, h) {
4439
4478
  var b = s.styles[h];
4440
- return b ? "\x1B[" + s.colors[b][0] + "m" + d + "\x1B[" + s.colors[b][1] + "m" : d;
4479
+ return b ? "\x1B[" + s.colors[b][0] + "m" + l + "\x1B[" + s.colors[b][1] + "m" : l;
4441
4480
  }
4442
- function u(d, h) {
4443
- return d;
4481
+ function u(l, h) {
4482
+ return l;
4444
4483
  }
4445
- function l(d) {
4484
+ function d(l) {
4446
4485
  var h = {};
4447
- return d.forEach(function(b, A) {
4486
+ return l.forEach(function(b, A) {
4448
4487
  h[b] = !0;
4449
4488
  }), h;
4450
4489
  }
4451
- function c(d, h, b) {
4452
- if (d.customInspect && h && he(h.inspect) && // Filter out the util module, it's inspect function is special
4490
+ function c(l, h, b) {
4491
+ if (l.customInspect && h && he(h.inspect) && // Filter out the util module, it's inspect function is special
4453
4492
  h.inspect !== t.inspect && // Also filter out any prototype objects using the circular check.
4454
4493
  !(h.constructor && h.constructor.prototype === h)) {
4455
- var A = h.inspect(b, d);
4456
- return L(A) || (A = c(d, A, b)), A;
4494
+ var A = h.inspect(b, l);
4495
+ return L(A) || (A = c(l, A, b)), A;
4457
4496
  }
4458
- var C = f(d, h);
4459
- if (C)
4460
- return C;
4461
- var P = Object.keys(h), O = l(P);
4462
- if (d.showHidden && (P = Object.getOwnPropertyNames(h)), Oe(h) && (P.indexOf("message") >= 0 || P.indexOf("description") >= 0))
4497
+ var P = f(l, h);
4498
+ if (P)
4499
+ return P;
4500
+ var C = Object.keys(h), O = d(C);
4501
+ if (l.showHidden && (C = Object.getOwnPropertyNames(h)), Te(h) && (C.indexOf("message") >= 0 || C.indexOf("description") >= 0))
4463
4502
  return p(h);
4464
- if (P.length === 0) {
4503
+ if (C.length === 0) {
4465
4504
  if (he(h)) {
4466
4505
  var k = h.name ? ": " + h.name : "";
4467
- return d.stylize("[Function" + k + "]", "special");
4506
+ return l.stylize("[Function" + k + "]", "special");
4468
4507
  }
4469
4508
  if (ae(h))
4470
- return d.stylize(RegExp.prototype.toString.call(h), "regexp");
4509
+ return l.stylize(RegExp.prototype.toString.call(h), "regexp");
4471
4510
  if (Fe(h))
4472
- return d.stylize(Date.prototype.toString.call(h), "date");
4473
- if (Oe(h))
4511
+ return l.stylize(Date.prototype.toString.call(h), "date");
4512
+ if (Te(h))
4474
4513
  return p(h);
4475
4514
  }
4476
- var D = "", W = !1, Te = ["{", "}"];
4477
- if (g(h) && (W = !0, Te = ["[", "]"]), he(h)) {
4515
+ var D = "", Y = !1, _e = ["{", "}"];
4516
+ if (g(h) && (Y = !0, _e = ["[", "]"]), he(h)) {
4478
4517
  var ct = h.name ? ": " + h.name : "";
4479
4518
  D = " [Function" + ct + "]";
4480
4519
  }
4481
- if (ae(h) && (D = " " + RegExp.prototype.toString.call(h)), Fe(h) && (D = " " + Date.prototype.toUTCString.call(h)), Oe(h) && (D = " " + p(h)), P.length === 0 && (!W || h.length == 0))
4482
- return Te[0] + D + Te[1];
4520
+ if (ae(h) && (D = " " + RegExp.prototype.toString.call(h)), Fe(h) && (D = " " + Date.prototype.toUTCString.call(h)), Te(h) && (D = " " + p(h)), C.length === 0 && (!Y || h.length == 0))
4521
+ return _e[0] + D + _e[1];
4483
4522
  if (b < 0)
4484
- return ae(h) ? d.stylize(RegExp.prototype.toString.call(h), "regexp") : d.stylize("[Object]", "special");
4485
- d.seen.push(h);
4523
+ return ae(h) ? l.stylize(RegExp.prototype.toString.call(h), "regexp") : l.stylize("[Object]", "special");
4524
+ l.seen.push(h);
4486
4525
  var $e;
4487
- return W ? $e = v(d, h, b, O, P) : $e = P.map(function(dt) {
4488
- return w(d, h, b, O, dt, W);
4489
- }), d.seen.pop(), m($e, D, Te);
4526
+ return Y ? $e = v(l, h, b, O, C) : $e = C.map(function(dt) {
4527
+ return w(l, h, b, O, dt, Y);
4528
+ }), l.seen.pop(), m($e, D, _e);
4490
4529
  }
4491
- function f(d, h) {
4530
+ function f(l, h) {
4492
4531
  if (_(h))
4493
- return d.stylize("undefined", "undefined");
4532
+ return l.stylize("undefined", "undefined");
4494
4533
  if (L(h)) {
4495
4534
  var b = "'" + JSON.stringify(h).replace(/^"|"$/g, "").replace(/'/g, "\\'").replace(/\\"/g, '"') + "'";
4496
- return d.stylize(b, "string");
4535
+ return l.stylize(b, "string");
4497
4536
  }
4498
4537
  if (ne(h))
4499
- return d.stylize("" + h, "number");
4538
+ return l.stylize("" + h, "number");
4500
4539
  if (S(h))
4501
- return d.stylize("" + h, "boolean");
4540
+ return l.stylize("" + h, "boolean");
4502
4541
  if (F(h))
4503
- return d.stylize("null", "null");
4542
+ return l.stylize("null", "null");
4504
4543
  }
4505
- function p(d) {
4506
- return "[" + Error.prototype.toString.call(d) + "]";
4544
+ function p(l) {
4545
+ return "[" + Error.prototype.toString.call(l) + "]";
4507
4546
  }
4508
- function v(d, h, b, A, C) {
4509
- for (var P = [], O = 0, k = h.length; O < k; ++O)
4510
- Re(h, String(O)) ? P.push(w(
4511
- d,
4547
+ function v(l, h, b, A, P) {
4548
+ for (var C = [], O = 0, k = h.length; O < k; ++O)
4549
+ Re(h, String(O)) ? C.push(w(
4550
+ l,
4512
4551
  h,
4513
4552
  b,
4514
4553
  A,
4515
4554
  String(O),
4516
4555
  !0
4517
- )) : P.push("");
4518
- return C.forEach(function(D) {
4519
- D.match(/^\d+$/) || P.push(w(
4520
- d,
4556
+ )) : C.push("");
4557
+ return P.forEach(function(D) {
4558
+ D.match(/^\d+$/) || C.push(w(
4559
+ l,
4521
4560
  h,
4522
4561
  b,
4523
4562
  A,
4524
4563
  D,
4525
4564
  !0
4526
4565
  ));
4527
- }), P;
4566
+ }), C;
4528
4567
  }
4529
- function w(d, h, b, A, C, P) {
4568
+ function w(l, h, b, A, P, C) {
4530
4569
  var O, k, D;
4531
- if (D = Object.getOwnPropertyDescriptor(h, C) || { value: h[C] }, D.get ? D.set ? k = d.stylize("[Getter/Setter]", "special") : k = d.stylize("[Getter]", "special") : D.set && (k = d.stylize("[Setter]", "special")), Re(A, C) || (O = "[" + C + "]"), k || (d.seen.indexOf(D.value) < 0 ? (F(b) ? k = c(d, D.value, null) : k = c(d, D.value, b - 1), k.indexOf(`
4532
- `) > -1 && (P ? k = k.split(`
4533
- `).map(function(W) {
4534
- return " " + W;
4570
+ if (D = Object.getOwnPropertyDescriptor(h, P) || { value: h[P] }, D.get ? D.set ? k = l.stylize("[Getter/Setter]", "special") : k = l.stylize("[Getter]", "special") : D.set && (k = l.stylize("[Setter]", "special")), Re(A, P) || (O = "[" + P + "]"), k || (l.seen.indexOf(D.value) < 0 ? (F(b) ? k = c(l, D.value, null) : k = c(l, D.value, b - 1), k.indexOf(`
4571
+ `) > -1 && (C ? k = k.split(`
4572
+ `).map(function(Y) {
4573
+ return " " + Y;
4535
4574
  }).join(`
4536
4575
  `).slice(2) : k = `
4537
4576
  ` + k.split(`
4538
- `).map(function(W) {
4539
- return " " + W;
4577
+ `).map(function(Y) {
4578
+ return " " + Y;
4540
4579
  }).join(`
4541
- `))) : k = d.stylize("[Circular]", "special")), _(O)) {
4542
- if (P && C.match(/^\d+$/))
4580
+ `))) : k = l.stylize("[Circular]", "special")), _(O)) {
4581
+ if (C && P.match(/^\d+$/))
4543
4582
  return k;
4544
- O = JSON.stringify("" + C), O.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/) ? (O = O.slice(1, -1), O = d.stylize(O, "name")) : (O = O.replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'"), O = d.stylize(O, "string"));
4583
+ O = JSON.stringify("" + P), O.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/) ? (O = O.slice(1, -1), O = l.stylize(O, "name")) : (O = O.replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'"), O = l.stylize(O, "string"));
4545
4584
  }
4546
4585
  return O + ": " + k;
4547
4586
  }
4548
- function m(d, h, b) {
4549
- var A = d.reduce(function(C, P) {
4550
- return P.indexOf(`
4551
- `) >= 0, C + P.replace(/\u001b\[\d\d?m/g, "").length + 1;
4587
+ function m(l, h, b) {
4588
+ var A = l.reduce(function(P, C) {
4589
+ return C.indexOf(`
4590
+ `) >= 0, P + C.replace(/\u001b\[\d\d?m/g, "").length + 1;
4552
4591
  }, 0);
4553
4592
  return A > 60 ? b[0] + (h === "" ? "" : h + `
4554
- `) + " " + d.join(`,
4555
- `) + " " + b[1] : b[0] + h + " " + d.join(", ") + " " + b[1];
4593
+ `) + " " + l.join(`,
4594
+ `) + " " + b[1] : b[0] + h + " " + l.join(", ") + " " + b[1];
4556
4595
  }
4557
- t.types = Xn;
4558
- function g(d) {
4559
- return Array.isArray(d);
4596
+ t.types = ei;
4597
+ function g(l) {
4598
+ return Array.isArray(l);
4560
4599
  }
4561
4600
  t.isArray = g;
4562
- function S(d) {
4563
- return typeof d == "boolean";
4601
+ function S(l) {
4602
+ return typeof l == "boolean";
4564
4603
  }
4565
4604
  t.isBoolean = S;
4566
- function F(d) {
4567
- return d === null;
4605
+ function F(l) {
4606
+ return l === null;
4568
4607
  }
4569
4608
  t.isNull = F;
4570
- function z(d) {
4571
- return d == null;
4609
+ function H(l) {
4610
+ return l == null;
4572
4611
  }
4573
- t.isNullOrUndefined = z;
4574
- function ne(d) {
4575
- return typeof d == "number";
4612
+ t.isNullOrUndefined = H;
4613
+ function ne(l) {
4614
+ return typeof l == "number";
4576
4615
  }
4577
4616
  t.isNumber = ne;
4578
- function L(d) {
4579
- return typeof d == "string";
4617
+ function L(l) {
4618
+ return typeof l == "string";
4580
4619
  }
4581
4620
  t.isString = L;
4582
- function V(d) {
4583
- return typeof d == "symbol";
4621
+ function V(l) {
4622
+ return typeof l == "symbol";
4584
4623
  }
4585
4624
  t.isSymbol = V;
4586
- function _(d) {
4587
- return d === void 0;
4625
+ function _(l) {
4626
+ return l === void 0;
4588
4627
  }
4589
4628
  t.isUndefined = _;
4590
- function ae(d) {
4591
- return ue(d) && Ie(d) === "[object RegExp]";
4629
+ function ae(l) {
4630
+ return ue(l) && Ie(l) === "[object RegExp]";
4592
4631
  }
4593
4632
  t.isRegExp = ae, t.types.isRegExp = ae;
4594
- function ue(d) {
4595
- return typeof d == "object" && d !== null;
4633
+ function ue(l) {
4634
+ return typeof l == "object" && l !== null;
4596
4635
  }
4597
4636
  t.isObject = ue;
4598
- function Fe(d) {
4599
- return ue(d) && Ie(d) === "[object Date]";
4637
+ function Fe(l) {
4638
+ return ue(l) && Ie(l) === "[object Date]";
4600
4639
  }
4601
4640
  t.isDate = Fe, t.types.isDate = Fe;
4602
- function Oe(d) {
4603
- return ue(d) && (Ie(d) === "[object Error]" || d instanceof Error);
4641
+ function Te(l) {
4642
+ return ue(l) && (Ie(l) === "[object Error]" || l instanceof Error);
4604
4643
  }
4605
- t.isError = Oe, t.types.isNativeError = Oe;
4606
- function he(d) {
4607
- return typeof d == "function";
4644
+ t.isError = Te, t.types.isNativeError = Te;
4645
+ function he(l) {
4646
+ return typeof l == "function";
4608
4647
  }
4609
4648
  t.isFunction = he;
4610
- function qt(d) {
4611
- return d === null || typeof d == "boolean" || typeof d == "number" || typeof d == "string" || typeof d == "symbol" || // ES6 symbol
4612
- typeof d > "u";
4649
+ function Ut(l) {
4650
+ return l === null || typeof l == "boolean" || typeof l == "number" || typeof l == "string" || typeof l == "symbol" || // ES6 symbol
4651
+ typeof l > "u";
4613
4652
  }
4614
- t.isPrimitive = qt, t.isBuffer = au;
4615
- function Ie(d) {
4616
- return Object.prototype.toString.call(d);
4653
+ t.isPrimitive = Ut, t.isBuffer = au;
4654
+ function Ie(l) {
4655
+ return Object.prototype.toString.call(l);
4617
4656
  }
4618
- function Je(d) {
4619
- return d < 10 ? "0" + d.toString(10) : d.toString(10);
4657
+ function Ze(l) {
4658
+ return l < 10 ? "0" + l.toString(10) : l.toString(10);
4620
4659
  }
4621
4660
  var De = [
4622
4661
  "Jan",
@@ -4632,24 +4671,24 @@ var uu = br.exports;
4632
4671
  "Nov",
4633
4672
  "Dec"
4634
4673
  ];
4635
- function Ut() {
4636
- var d = /* @__PURE__ */ new Date(), h = [
4637
- Je(d.getHours()),
4638
- Je(d.getMinutes()),
4639
- Je(d.getSeconds())
4674
+ function qt() {
4675
+ var l = /* @__PURE__ */ new Date(), h = [
4676
+ Ze(l.getHours()),
4677
+ Ze(l.getMinutes()),
4678
+ Ze(l.getSeconds())
4640
4679
  ].join(":");
4641
- return [d.getDate(), De[d.getMonth()], h].join(" ");
4680
+ return [l.getDate(), De[l.getMonth()], h].join(" ");
4642
4681
  }
4643
4682
  t.log = function() {
4644
- console.log("%s - %s", Ut(), t.format.apply(t, arguments));
4645
- }, t.inherits = uu, t._extend = function(d, h) {
4646
- if (!h || !ue(h)) return d;
4683
+ console.log("%s - %s", qt(), t.format.apply(t, arguments));
4684
+ }, t.inherits = uu, t._extend = function(l, h) {
4685
+ if (!h || !ue(h)) return l;
4647
4686
  for (var b = Object.keys(h), A = b.length; A--; )
4648
- d[b[A]] = h[b[A]];
4649
- return d;
4687
+ l[b[A]] = h[b[A]];
4688
+ return l;
4650
4689
  };
4651
- function Re(d, h) {
4652
- return Object.prototype.hasOwnProperty.call(d, h);
4690
+ function Re(l, h) {
4691
+ return Object.prototype.hasOwnProperty.call(l, h);
4653
4692
  }
4654
4693
  var ye = typeof Symbol < "u" ? Symbol("util.promisify.custom") : void 0;
4655
4694
  t.promisify = function(h) {
@@ -4667,19 +4706,19 @@ var uu = br.exports;
4667
4706
  }), b;
4668
4707
  }
4669
4708
  function b() {
4670
- for (var A, C, P = new Promise(function(D, W) {
4671
- A = D, C = W;
4709
+ for (var A, P, C = new Promise(function(D, Y) {
4710
+ A = D, P = Y;
4672
4711
  }), O = [], k = 0; k < arguments.length; k++)
4673
4712
  O.push(arguments[k]);
4674
- O.push(function(D, W) {
4675
- D ? C(D) : A(W);
4713
+ O.push(function(D, Y) {
4714
+ D ? P(D) : A(Y);
4676
4715
  });
4677
4716
  try {
4678
4717
  h.apply(this, O);
4679
4718
  } catch (D) {
4680
- C(D);
4719
+ P(D);
4681
4720
  }
4682
- return P;
4721
+ return C;
4683
4722
  }
4684
4723
  return Object.setPrototypeOf(b, Object.getPrototypeOf(h)), ye && Object.defineProperty(b, ye, {
4685
4724
  value: b,
@@ -4691,26 +4730,26 @@ var uu = br.exports;
4691
4730
  e(h)
4692
4731
  );
4693
4732
  }, t.promisify.custom = ye;
4694
- function Ve(d, h) {
4695
- if (!d) {
4733
+ function Ve(l, h) {
4734
+ if (!l) {
4696
4735
  var b = new Error("Promise was rejected with a falsy value");
4697
- b.reason = d, d = b;
4736
+ b.reason = l, l = b;
4698
4737
  }
4699
- return h(d);
4738
+ return h(l);
4700
4739
  }
4701
- function ut(d) {
4702
- if (typeof d != "function")
4740
+ function ut(l) {
4741
+ if (typeof l != "function")
4703
4742
  throw new TypeError('The "original" argument must be of type Function');
4704
4743
  function h() {
4705
4744
  for (var b = [], A = 0; A < arguments.length; A++)
4706
4745
  b.push(arguments[A]);
4707
- var C = b.pop();
4708
- if (typeof C != "function")
4746
+ var P = b.pop();
4747
+ if (typeof P != "function")
4709
4748
  throw new TypeError("The last argument must be of type Function");
4710
- var P = this, O = function() {
4711
- return C.apply(P, arguments);
4749
+ var C = this, O = function() {
4750
+ return P.apply(C, arguments);
4712
4751
  };
4713
- d.apply(this, b).then(
4752
+ l.apply(this, b).then(
4714
4753
  function(k) {
4715
4754
  E.nextTick(O.bind(null, null, k));
4716
4755
  },
@@ -4719,15 +4758,15 @@ var uu = br.exports;
4719
4758
  }
4720
4759
  );
4721
4760
  }
4722
- return Object.setPrototypeOf(h, Object.getPrototypeOf(d)), Object.defineProperties(
4761
+ return Object.setPrototypeOf(h, Object.getPrototypeOf(l)), Object.defineProperties(
4723
4762
  h,
4724
- e(d)
4763
+ e(l)
4725
4764
  ), h;
4726
4765
  }
4727
4766
  t.callbackify = ut;
4728
4767
  })(Rt);
4729
4768
  const { inherits: cu, format: Xt } = Rt;
4730
- function _e(t, e, r = Error) {
4769
+ function ke(t, e, r = Error) {
4731
4770
  if (!t) throw new Error("Avvio error code must not be empty");
4732
4771
  if (!e) throw new Error("Avvio base error message must not be empty");
4733
4772
  function n(i, o, s) {
@@ -4739,55 +4778,55 @@ function _e(t, e, r = Error) {
4739
4778
  return `${this.name} [${this.code}]: ${this.message}`;
4740
4779
  }, cu(n, r), n;
4741
4780
  }
4742
- var hi = {
4743
- createError: _e,
4744
- AVV_ERR_EXPOSE_ALREADY_DEFINED: _e(
4781
+ var mi = {
4782
+ createError: ke,
4783
+ AVV_ERR_EXPOSE_ALREADY_DEFINED: ke(
4745
4784
  "AVV_ERR_EXPOSE_ALREADY_DEFINED",
4746
4785
  "'%s' () is already defined, specify an expose option"
4747
4786
  ),
4748
- AVV_ERR_CALLBACK_NOT_FN: _e(
4787
+ AVV_ERR_CALLBACK_NOT_FN: ke(
4749
4788
  "AVV_ERR_CALLBACK_NOT_FN",
4750
4789
  "Callback for '%s' hook is not a function. Received: '%s'"
4751
4790
  ),
4752
- AVV_ERR_PLUGIN_NOT_VALID: _e(
4791
+ AVV_ERR_PLUGIN_NOT_VALID: ke(
4753
4792
  "AVV_ERR_PLUGIN_NOT_VALID",
4754
4793
  "Plugin must be a function or a promise. Received: '%s'"
4755
4794
  ),
4756
- AVV_ERR_ROOT_PLG_BOOTED: _e(
4795
+ AVV_ERR_ROOT_PLG_BOOTED: ke(
4757
4796
  "AVV_ERR_PLUGIN_NOT_VALID",
4758
4797
  "Root plugin has already booted"
4759
4798
  ),
4760
- AVV_ERR_PARENT_PLG_LOADED: _e(
4799
+ AVV_ERR_PARENT_PLG_LOADED: ke(
4761
4800
  "AVV_ERR_PARENT_PLG_LOADED",
4762
4801
  "Impossible to load '%s' plugin because the parent '%s' was already loaded"
4763
4802
  ),
4764
- AVV_ERR_READY_TIMEOUT: _e(
4803
+ AVV_ERR_READY_TIMEOUT: ke(
4765
4804
  "AVV_ERR_READY_TIMEOUT",
4766
4805
  "Plugin did not start in time: '%s'. You may have forgotten to call 'done' function or to resolve a Promise"
4767
4806
  )
4768
4807
  }, du = function t(e, r, n) {
4769
4808
  r === void 0 && (r = ""), n || (n = {});
4770
4809
  var i = function(u) {
4771
- var l = {
4810
+ var d = {
4772
4811
  "│": "|",
4773
4812
  "└": "`",
4774
4813
  "├": "+",
4775
4814
  "─": "-",
4776
4815
  "┬": "-"
4777
4816
  };
4778
- return n.unicode === !1 ? l[u] : u;
4817
+ return n.unicode === !1 ? d[u] : u;
4779
4818
  };
4780
4819
  typeof e == "string" && (e = { label: e });
4781
4820
  var o = e.nodes || [], s = (e.label || "").split(`
4782
4821
  `), a = `
4783
4822
  ` + r + (o.length ? i("│") : " ") + " ";
4784
4823
  return r + s.join(a) + `
4785
- ` + o.map(function(u, l) {
4786
- var c = l === o.length - 1, f = u.nodes && u.nodes.length, p = r + (c ? " " : i("│")) + " ";
4824
+ ` + o.map(function(u, d) {
4825
+ var c = d === o.length - 1, f = u.nodes && u.nodes.length, p = r + (c ? " " : i("│")) + " ";
4787
4826
  return r + i(c ? "└" : "├") + i("─") + i(f ? "┬" : "─") + " " + t(u, p, n).slice(r.length + 2);
4788
4827
  }).join("");
4789
4828
  };
4790
- const lu = du, Sn = Symbol("avvio.TimeTree.untrackNode"), Zt = Symbol("avvio.TimeTree.trackNode"), wn = Symbol("avvio.TimeTree.getParent"), An = Symbol("avvio.TimeTree.getNode"), En = Symbol("avvio.TimeTree.addNode");
4829
+ const lu = du, An = Symbol("avvio.TimeTree.untrackNode"), Zt = Symbol("avvio.TimeTree.trackNode"), En = Symbol("avvio.TimeTree.getParent"), In = Symbol("avvio.TimeTree.getNode"), On = Symbol("avvio.TimeTree.addNode");
4791
4830
  let fu = class {
4792
4831
  constructor() {
4793
4832
  this.root = null, this.tableId = /* @__PURE__ */ new Map(), this.tableLabel = /* @__PURE__ */ new Map();
@@ -4795,7 +4834,7 @@ let fu = class {
4795
4834
  [Zt](e) {
4796
4835
  this.tableId.set(e.id, e), this.tableLabel.has(e.label) ? this.tableLabel.get(e.label).push(e) : this.tableLabel.set(e.label, [e]);
4797
4836
  }
4798
- [Sn](e) {
4837
+ [An](e) {
4799
4838
  this.tableId.delete(e.id);
4800
4839
  const r = this.tableLabel.get(e.label);
4801
4840
  if (r.id) {
@@ -4804,16 +4843,16 @@ let fu = class {
4804
4843
  }
4805
4844
  r.pop(), r.length === 0 && this.tableLabel.delete(e.label);
4806
4845
  }
4807
- [wn](e) {
4846
+ [En](e) {
4808
4847
  if (e === null)
4809
4848
  return this.root;
4810
4849
  const r = this.tableLabel.get(e);
4811
4850
  return r.id ? r : r[r.length - 1];
4812
4851
  }
4813
- [An](e) {
4852
+ [In](e) {
4814
4853
  return this.tableId.get(e);
4815
4854
  }
4816
- [En](e, r, n) {
4855
+ [On](e, r, n) {
4817
4856
  if (e === null)
4818
4857
  return this.root = {
4819
4858
  id: "root",
@@ -4821,7 +4860,7 @@ let fu = class {
4821
4860
  start: n,
4822
4861
  nodes: []
4823
4862
  }, this[Zt](this.root), this.root.id;
4824
- const o = this[wn](e), s = `${r}-${Math.random()}`, a = {
4863
+ const o = this[En](e), s = `${r}-${Math.random()}`, a = {
4825
4864
  id: s,
4826
4865
  parent: e,
4827
4866
  start: n,
@@ -4831,11 +4870,11 @@ let fu = class {
4831
4870
  return o.nodes.push(a), this[Zt](a), s;
4832
4871
  }
4833
4872
  start(e, r, n = Date.now()) {
4834
- return this[En](e, r, n);
4873
+ return this[On](e, r, n);
4835
4874
  }
4836
4875
  stop(e, r = Date.now()) {
4837
- const n = this[An](e);
4838
- n && (n.stop = r, n.diff = n.stop - n.start || 0, this[Sn](n));
4876
+ const n = this[In](e);
4877
+ n && (n.stop = r, n.diff = n.stop - n.start || 0, this[An](n));
4839
4878
  }
4840
4879
  toJSON() {
4841
4880
  return Object.assign({}, this.root);
@@ -4845,10 +4884,10 @@ let fu = class {
4845
4884
  return lu(r);
4846
4885
  }
4847
4886
  };
4848
- var pu = fu, Rr = { exports: {} }, vr = { exports: {} }, er, In;
4887
+ var pu = fu, Rr = { exports: {} }, vr = { exports: {} }, er, Tn;
4849
4888
  function hu() {
4850
- if (In) return er;
4851
- In = 1;
4889
+ if (Tn) return er;
4890
+ Tn = 1;
4852
4891
  var t = 1e3, e = t * 60, r = e * 60, n = r * 24, i = n * 7, o = n * 365.25;
4853
4892
  er = function(c, f) {
4854
4893
  f = f || {};
@@ -4919,16 +4958,16 @@ function hu() {
4919
4958
  }
4920
4959
  function u(c) {
4921
4960
  var f = Math.abs(c);
4922
- return f >= n ? l(c, f, n, "day") : f >= r ? l(c, f, r, "hour") : f >= e ? l(c, f, e, "minute") : f >= t ? l(c, f, t, "second") : c + " ms";
4961
+ return f >= n ? d(c, f, n, "day") : f >= r ? d(c, f, r, "hour") : f >= e ? d(c, f, e, "minute") : f >= t ? d(c, f, t, "second") : c + " ms";
4923
4962
  }
4924
- function l(c, f, p, v) {
4963
+ function d(c, f, p, v) {
4925
4964
  var w = f >= p * 1.5;
4926
4965
  return Math.round(c / p) + " " + v + (w ? "s" : "");
4927
4966
  }
4928
4967
  return er;
4929
4968
  }
4930
4969
  function yu(t) {
4931
- r.debug = r, r.default = r, r.coerce = u, r.disable = o, r.enable = i, r.enabled = s, r.humanize = hu(), r.destroy = l, Object.keys(t).forEach((c) => {
4970
+ r.debug = r, r.default = r, r.coerce = u, r.disable = o, r.enable = i, r.enabled = s, r.humanize = hu(), r.destroy = d, Object.keys(t).forEach((c) => {
4932
4971
  r[c] = t[c];
4933
4972
  }), r.names = [], r.skips = [], r.formatters = {};
4934
4973
  function e(c) {
@@ -4943,8 +4982,8 @@ function yu(t) {
4943
4982
  function m(...g) {
4944
4983
  if (!m.enabled)
4945
4984
  return;
4946
- const S = m, F = Number(/* @__PURE__ */ new Date()), z = F - (f || F);
4947
- S.diff = z, S.prev = f, S.curr = F, f = F, g[0] = r.coerce(g[0]), typeof g[0] != "string" && g.unshift("%O");
4985
+ const S = m, F = Number(/* @__PURE__ */ new Date()), H = F - (f || F);
4986
+ S.diff = H, S.prev = f, S.curr = F, f = F, g[0] = r.coerce(g[0]), typeof g[0] != "string" && g.unshift("%O");
4948
4987
  let ne = 0;
4949
4988
  g[0] = g[0].replace(/%([a-zA-Z%])/g, (V, _) => {
4950
4989
  if (V === "%%")
@@ -5003,7 +5042,7 @@ function yu(t) {
5003
5042
  function u(c) {
5004
5043
  return c instanceof Error ? c.stack || c.message : c;
5005
5044
  }
5006
- function l() {
5045
+ function d() {
5007
5046
  console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
5008
5047
  }
5009
5048
  return r.enable(r.load()), r;
@@ -5103,12 +5142,12 @@ var mu = yu;
5103
5142
  function n(u) {
5104
5143
  if (u[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + u[0] + (this.useColors ? "%c " : " ") + "+" + t.exports.humanize(this.diff), !this.useColors)
5105
5144
  return;
5106
- const l = "color: " + this.color;
5107
- u.splice(1, 0, l, "color: inherit");
5145
+ const d = "color: " + this.color;
5146
+ u.splice(1, 0, d, "color: inherit");
5108
5147
  let c = 0, f = 0;
5109
5148
  u[0].replace(/%[a-zA-Z%]/g, (p) => {
5110
5149
  p !== "%%" && (c++, p === "%c" && (f = c));
5111
- }), u.splice(f, 0, l);
5150
+ }), u.splice(f, 0, d);
5112
5151
  }
5113
5152
  e.log = console.debug || console.log || (() => {
5114
5153
  });
@@ -5137,13 +5176,13 @@ var mu = yu;
5137
5176
  a.j = function(u) {
5138
5177
  try {
5139
5178
  return JSON.stringify(u);
5140
- } catch (l) {
5141
- return "[UnexpectedJSONParseError]: " + l.message;
5179
+ } catch (d) {
5180
+ return "[UnexpectedJSONParseError]: " + d.message;
5142
5181
  }
5143
5182
  };
5144
5183
  })(vr, vr.exports);
5145
- var yi = vr.exports;
5146
- const gu = jn, bu = Jn.EventEmitter, vu = Rt.inherits, x = yi("avvio"), { AVV_ERR_READY_TIMEOUT: Su } = hi, tr = Symbol.for("plugin-meta");
5184
+ var gi = vr.exports;
5185
+ const gu = Qn, bu = Zn.EventEmitter, vu = Rt.inherits, x = gi("avvio"), { AVV_ERR_READY_TIMEOUT: Su } = mi, tr = Symbol.for("plugin-meta");
5147
5186
  function wu(t, e) {
5148
5187
  return t[tr] && t[tr].name ? t[tr].name : typeof e < "u" && typeof e != "function" && e.name ? e.name : t.name ? t.name : t.toString().split(`
5149
5188
  `).slice(0, 2).map((r) => r.trim()).join(" -- ");
@@ -5154,11 +5193,11 @@ function Au() {
5154
5193
  t.resolve = e, t.reject = r;
5155
5194
  }), t;
5156
5195
  }
5157
- function Ye(t, e, r, n, i) {
5196
+ function Xe(t, e, r, n, i) {
5158
5197
  this.started = !1, this.func = e, this.opts = r, this.onFinish = null, this.parent = t, this.timeout = i === void 0 ? t._timeout : i, this.name = wu(e, r), this.isAfter = n, this.q = gu(t, Eu, 1), this.q.pause(), this._error = null, this.loaded = !1, this._promise = null;
5159
5198
  }
5160
- vu(Ye, bu);
5161
- Ye.prototype.exec = function(t, e) {
5199
+ vu(Xe, bu);
5200
+ Xe.prototype.exec = function(t, e) {
5162
5201
  const r = this.func;
5163
5202
  let n = !1;
5164
5203
  const i = this.name;
@@ -5194,7 +5233,7 @@ Ye.prototype.exec = function(t, e) {
5194
5233
  (u) => E.nextTick(s, u)
5195
5234
  ));
5196
5235
  };
5197
- Ye.prototype.loadedSoFar = function() {
5236
+ Xe.prototype.loadedSoFar = function() {
5198
5237
  if (this.loaded)
5199
5238
  return Promise.resolve();
5200
5239
  const t = () => {
@@ -5205,10 +5244,10 @@ Ye.prototype.loadedSoFar = function() {
5205
5244
  let e;
5206
5245
  return this._promise ? e = Promise.resolve() : (this._promise = Au(), e = this._promise.promise, this.server ? t() : this.on("start", t)), e;
5207
5246
  };
5208
- Ye.prototype.enqueue = function(t, e) {
5247
+ Xe.prototype.enqueue = function(t, e) {
5209
5248
  x("enqueue", this.name, t.name), this.emit("enqueue", this.server ? this.server.name : null, this.name, Date.now()), this.q.push(t, e);
5210
5249
  };
5211
- Ye.prototype.finish = function(t, e) {
5250
+ Xe.prototype.finish = function(t, e) {
5212
5251
  x("finish", this.name, t);
5213
5252
  const r = () => {
5214
5253
  this.loaded || (x("loaded", this.name), this.emit("loaded", this.server ? this.server.name : null, this.name, Date.now()), this.loaded = !0, e(t));
@@ -5253,16 +5292,16 @@ function Vr(t, e) {
5253
5292
  }
5254
5293
  function Iu() {
5255
5294
  }
5256
- Rr.exports = Ye;
5295
+ Rr.exports = Xe;
5257
5296
  Rr.exports.loadPlugin = Vr;
5258
5297
  var Ou = Rr.exports;
5259
- const On = jn, Tu = Jn.EventEmitter, _u = Rt.inherits, {
5298
+ const _n = Qn, Tu = Zn.EventEmitter, _u = Rt.inherits, {
5260
5299
  AVV_ERR_EXPOSE_ALREADY_DEFINED: rr,
5261
- AVV_ERR_CALLBACK_NOT_FN: tt,
5300
+ AVV_ERR_CALLBACK_NOT_FN: nt,
5262
5301
  AVV_ERR_PLUGIN_NOT_VALID: ku,
5263
- AVV_ERR_ROOT_PLG_BOOTED: Cu,
5264
- AVV_ERR_READY_TIMEOUT: Pu
5265
- } = hi, Lu = pu, Sr = Ou, He = yi("avvio"), Pt = Symbol("kAvvio"), nr = Symbol("kThenifyDoNotWrap");
5302
+ AVV_ERR_ROOT_PLG_BOOTED: Pu,
5303
+ AVV_ERR_READY_TIMEOUT: Cu
5304
+ } = mi, Lu = pu, Sr = Ou, Ye = gi("avvio"), Ct = Symbol("kAvvio"), nr = Symbol("kThenifyDoNotWrap");
5266
5305
  function Nu(t, e, r) {
5267
5306
  const n = e.expose || {}, i = n.use || "use", o = n.after || "after", s = n.ready || "ready", a = n.onClose || "onClose", u = n.close || "close";
5268
5307
  if (t[i])
@@ -5271,40 +5310,40 @@ function Nu(t, e, r) {
5271
5310
  throw new rr(o);
5272
5311
  if (t[s])
5273
5312
  throw new rr(s);
5274
- t[i] = function(l, c) {
5275
- return r.use(l, c), this;
5276
- }, Object.defineProperty(t, "then", { get: mi.bind(r) }), t[Pt] = !0, t[o] = function(l) {
5277
- return typeof l != "function" ? r._loadRegistered() : (r.after(ir(l, this)), this);
5278
- }, t[s] = function(l) {
5279
- if (l && typeof l != "function")
5280
- throw new tt(s, typeof l);
5281
- return r.ready(l ? ir(l, this) : void 0);
5282
- }, t[a] = function(l) {
5283
- if (typeof l != "function")
5284
- throw new tt(a, typeof l);
5285
- return r.onClose($u(l, this)), this;
5286
- }, t[u] = function(l) {
5287
- if (l && typeof l != "function")
5288
- throw new tt(u, typeof l);
5289
- return l ? (r.close(ir(l, this)), this) : r.close();
5313
+ t[i] = function(d, c) {
5314
+ return r.use(d, c), this;
5315
+ }, Object.defineProperty(t, "then", { get: bi.bind(r) }), t[Ct] = !0, t[o] = function(d) {
5316
+ return typeof d != "function" ? r._loadRegistered() : (r.after(ir(d, this)), this);
5317
+ }, t[s] = function(d) {
5318
+ if (d && typeof d != "function")
5319
+ throw new nt(s, typeof d);
5320
+ return r.ready(d ? ir(d, this) : void 0);
5321
+ }, t[a] = function(d) {
5322
+ if (typeof d != "function")
5323
+ throw new nt(a, typeof d);
5324
+ return r.onClose($u(d, this)), this;
5325
+ }, t[u] = function(d) {
5326
+ if (d && typeof d != "function")
5327
+ throw new nt(u, typeof d);
5328
+ return d ? (r.close(ir(d, this)), this) : r.close();
5290
5329
  };
5291
5330
  }
5292
- function K(t, e, r) {
5293
- if (typeof t == "function" && arguments.length === 1 && (r = t, e = {}, t = null), typeof e == "function" && (r = e, e = {}), e = e || {}, !(this instanceof K)) {
5294
- const n = new K(t, e, r);
5331
+ function z(t, e, r) {
5332
+ if (typeof t == "function" && arguments.length === 1 && (r = t, e = {}, t = null), typeof e == "function" && (r = e, e = {}), e = e || {}, !(this instanceof z)) {
5333
+ const n = new z(t, e, r);
5295
5334
  return t && Nu(t, e, n), n;
5296
5335
  }
5297
- e.autostart !== !1 && (e.autostart = !0), t = t || this, this._timeout = Number(e.timeout) || 0, this._server = t, this._current = [], this._error = null, this._isOnCloseHandlerKey = Symbol("isOnCloseHandler"), this._lastUsed = null, this.setMaxListeners(0), r && this.once("start", r), this.started = !1, this.booted = !1, this.pluginTree = new Lu(), this._readyQ = On(this, gi, 1), this._readyQ.pause(), this._readyQ.drain = () => {
5298
- this.emit("start"), this._readyQ.drain = Tn;
5299
- }, this._closeQ = On(this, Vu, 1), this._closeQ.pause(), this._closeQ.drain = () => {
5300
- this.emit("close"), this._closeQ.drain = Tn;
5336
+ e.autostart !== !1 && (e.autostart = !0), t = t || this, this._timeout = Number(e.timeout) || 0, this._server = t, this._current = [], this._error = null, this._isOnCloseHandlerKey = Symbol("isOnCloseHandler"), this._lastUsed = null, this.setMaxListeners(0), r && this.once("start", r), this.started = !1, this.booted = !1, this.pluginTree = new Lu(), this._readyQ = _n(this, vi, 1), this._readyQ.pause(), this._readyQ.drain = () => {
5337
+ this.emit("start"), this._readyQ.drain = kn;
5338
+ }, this._closeQ = _n(this, Vu, 1), this._closeQ.pause(), this._closeQ.drain = () => {
5339
+ this.emit("close"), this._closeQ.drain = kn;
5301
5340
  }, this._doStart = null, this._root = new Sr(this, Fu.bind(this), e, !1, 0), this._root.once("start", (n, i, o) => {
5302
5341
  const s = this.pluginTree.start(null, i, o);
5303
- this._root.once("loaded", (a, u, l) => {
5304
- this.pluginTree.stop(s, l);
5342
+ this._root.once("loaded", (a, u, d) => {
5343
+ this.pluginTree.stop(s, d);
5305
5344
  });
5306
5345
  }), Sr.loadPlugin.call(this, this._root, (n) => {
5307
- He("root plugin ready");
5346
+ Ye("root plugin ready");
5308
5347
  try {
5309
5348
  this.emit("preReady"), this._root = null;
5310
5349
  } catch (i) {
@@ -5321,11 +5360,11 @@ function K(t, e, r) {
5321
5360
  function Fu(t, e, r) {
5322
5361
  this._doStart = r, e.autostart && this.start();
5323
5362
  }
5324
- _u(K, Tu);
5325
- K.prototype.start = function() {
5363
+ _u(z, Tu);
5364
+ z.prototype.start = function() {
5326
5365
  return this.started = !0, E.nextTick(this._doStart), this;
5327
5366
  };
5328
- K.prototype.override = function(t, e, r) {
5367
+ z.prototype.override = function(t, e, r) {
5329
5368
  return t;
5330
5369
  };
5331
5370
  function Du(t) {
@@ -5333,22 +5372,22 @@ function Du(t) {
5333
5372
  throw new ku(typeof t);
5334
5373
  return t;
5335
5374
  }
5336
- K.prototype[Pt] = !0;
5337
- K.prototype.use = function(t, e) {
5375
+ z.prototype[Ct] = !0;
5376
+ z.prototype.use = function(t, e) {
5338
5377
  return this._lastUsed = this._addPlugin(t, e, !1), this;
5339
5378
  };
5340
- K.prototype._loadRegistered = function() {
5379
+ z.prototype._loadRegistered = function() {
5341
5380
  const t = this._current[0];
5342
5381
  return !this.started && !this.booted && E.nextTick(() => this._root.q.resume()), t ? t.loadedSoFar() : Promise.resolve();
5343
5382
  };
5344
- Object.defineProperty(K.prototype, "then", { get: mi });
5345
- K.prototype._addPlugin = function(t, e, r) {
5383
+ Object.defineProperty(z.prototype, "then", { get: bi });
5384
+ z.prototype._addPlugin = function(t, e, r) {
5346
5385
  if (t = Du(t), e = e || {}, this.booted)
5347
- throw new Cu();
5386
+ throw new Pu();
5348
5387
  const n = this._current[0], i = new Sr(this, t, e, r);
5349
5388
  if (i.once("start", (o, s, a) => {
5350
5389
  const u = this.pluginTree.start(n.name, s, a);
5351
- i.once("loaded", (l, c, f) => {
5390
+ i.once("loaded", (d, c, f) => {
5352
5391
  this.pluginTree.stop(u, f);
5353
5392
  });
5354
5393
  }), n.loaded)
@@ -5357,16 +5396,16 @@ K.prototype._addPlugin = function(t, e, r) {
5357
5396
  o && (this._error = o);
5358
5397
  }), i;
5359
5398
  };
5360
- K.prototype.after = function(t) {
5399
+ z.prototype.after = function(t) {
5361
5400
  if (!t)
5362
5401
  return this._loadRegistered();
5363
5402
  this._addPlugin(e.bind(this), {}, !0);
5364
5403
  function e(r, n, i) {
5365
- gi.call(this, t, i);
5404
+ vi.call(this, t, i);
5366
5405
  }
5367
5406
  return this;
5368
5407
  };
5369
- K.prototype.onClose = function(t) {
5408
+ z.prototype.onClose = function(t) {
5370
5409
  if (typeof t != "function")
5371
5410
  throw new Error("not a function");
5372
5411
  t[this._isOnCloseHandlerKey] = !0, this._closeQ.unshift(t, e.bind(this));
@@ -5375,11 +5414,11 @@ K.prototype.onClose = function(t) {
5375
5414
  }
5376
5415
  return this;
5377
5416
  };
5378
- K.prototype.close = function(t) {
5417
+ z.prototype.close = function(t) {
5379
5418
  let e;
5380
5419
  if (t) {
5381
5420
  if (typeof t != "function")
5382
- throw new tt("close", typeof t);
5421
+ throw new nt("close", typeof t);
5383
5422
  } else
5384
5423
  e = new Promise(function(r, n) {
5385
5424
  t = function(i) {
@@ -5392,10 +5431,10 @@ K.prototype.close = function(t) {
5392
5431
  this._error = null, this._closeQ.push(t), E.nextTick(this._closeQ.resume.bind(this._closeQ));
5393
5432
  }), e;
5394
5433
  };
5395
- K.prototype.ready = function(t) {
5434
+ z.prototype.ready = function(t) {
5396
5435
  if (t) {
5397
5436
  if (typeof t != "function")
5398
- throw new tt("ready", typeof t);
5437
+ throw new nt("ready", typeof t);
5399
5438
  this._readyQ.push(t), queueMicrotask(this.start.bind(this));
5400
5439
  return;
5401
5440
  }
@@ -5407,32 +5446,32 @@ K.prototype.ready = function(t) {
5407
5446
  }
5408
5447
  });
5409
5448
  };
5410
- K.prototype.prettyPrint = function() {
5449
+ z.prototype.prettyPrint = function() {
5411
5450
  return this.pluginTree.prittyPrint();
5412
5451
  };
5413
- K.prototype.toJSON = function() {
5452
+ z.prototype.toJSON = function() {
5414
5453
  return this.pluginTree.toJSON();
5415
5454
  };
5416
- function Tn() {
5455
+ function kn() {
5417
5456
  }
5418
- function mi() {
5457
+ function bi() {
5419
5458
  if (this.booted) {
5420
- He("thenify returning null because we are already booted");
5459
+ Ye("thenify returning null because we are already booted");
5421
5460
  return;
5422
5461
  }
5423
5462
  if (this[nr]) {
5424
5463
  this[nr] = !1;
5425
5464
  return;
5426
5465
  }
5427
- return He("thenify"), (t, e) => this._loadRegistered().then(() => (this[nr] = !0, t(this._server)), e);
5466
+ return Ye("thenify"), (t, e) => this._loadRegistered().then(() => (this[nr] = !0, t(this._server)), e);
5428
5467
  }
5429
- function gi(t, e) {
5468
+ function vi(t, e) {
5430
5469
  const r = this._server, n = this._error;
5431
5470
  let i;
5432
5471
  if (this._error = null, t.length === 0)
5433
- this._error = n, i = t(), i && !i[Pt] && typeof i.then == "function" ? i.then(() => E.nextTick(e), (o) => E.nextTick(e, o)) : E.nextTick(e);
5472
+ this._error = n, i = t(), i && !i[Ct] && typeof i.then == "function" ? i.then(() => E.nextTick(e), (o) => E.nextTick(e, o)) : E.nextTick(e);
5434
5473
  else if (t.length === 1)
5435
- i = t(n), i && !i[Pt] && typeof i.then == "function" ? i.then(() => E.nextTick(e), (o) => E.nextTick(e, o)) : E.nextTick(e);
5474
+ i = t(n), i && !i[Ct] && typeof i.then == "function" ? i.then(() => E.nextTick(e), (o) => E.nextTick(e, o)) : E.nextTick(e);
5436
5475
  else if (this._timeout === 0) {
5437
5476
  const o = (s) => {
5438
5477
  this._error = s, e(this._error);
@@ -5443,10 +5482,10 @@ function gi(t, e) {
5443
5482
  }
5444
5483
  function Ru(t, e, r, n) {
5445
5484
  const i = t.name;
5446
- He("setting up ready timeout", i, this._timeout);
5485
+ Ye("setting up ready timeout", i, this._timeout);
5447
5486
  let o = setTimeout(() => {
5448
- He("timed out", i), o = null;
5449
- const a = new Pu(i);
5487
+ Ye("timed out", i), o = null;
5488
+ const a = new Cu(i);
5450
5489
  a.fn = t, this._error = a, n(a);
5451
5490
  }, this._timeout);
5452
5491
  t.length === 2 ? t(e, s.bind(this)) : t(e, r, s.bind(this));
@@ -5458,7 +5497,7 @@ function Vu(t, e) {
5458
5497
  const r = this._server, n = t[this._isOnCloseHandlerKey];
5459
5498
  if (t.length === 0 || t.length === 1) {
5460
5499
  let i;
5461
- n ? i = t(r) : i = t(this._error), i && typeof i.then == "function" ? (He("resolving close/onClose promise"), i.then(
5500
+ n ? i = t(r) : i = t(this._error), i && typeof i.then == "function" ? (Ye("resolving close/onClose promise"), i.then(
5462
5501
  () => E.nextTick(e),
5463
5502
  (o) => E.nextTick(e, o)
5464
5503
  )) : E.nextTick(e);
@@ -5486,9 +5525,9 @@ function ir(t, e) {
5486
5525
  }, i) : E.nextTick(i)) : t.length === 2 ? t(n, i) : t(n, this, i) : E.nextTick(i);
5487
5526
  }
5488
5527
  }
5489
- Ir.exports = K;
5528
+ Ir.exports = z;
5490
5529
  Ir.exports.express = function(t) {
5491
- return K(t, {
5530
+ return z(t, {
5492
5531
  expose: {
5493
5532
  use: "load"
5494
5533
  }
@@ -5515,24 +5554,25 @@ const Mu = /* @__PURE__ */ ps(Bu);
5515
5554
  })();
5516
5555
  function cc(t, e = !0, r = !0, n = { friendsTab: "enabled" }) {
5517
5556
  const i = e ? "https://grpc-sdk.streamlayer.io:443" : "https://grpc-sdk.next.streamlayer.io:443", o = e ? "https://grpc.streamlayer.io:443" : "https://grpc.next.streamlayer.io:443", s = Mu(/* @__PURE__ */ Object.create({}), { autostart: !1 });
5518
- return s.use(xo, {
5557
+ return s.use(Qo, {
5519
5558
  hideFriends: n.hideFriends,
5520
5559
  skipOnboarding: n.skipOnboarding,
5560
+ betPack: n.betPack,
5521
5561
  friendsTab: n.friendsTab,
5522
5562
  theme: n.theme,
5523
5563
  themeMode: n.themeMode
5524
- }), s.use(Vo, { onDeepLinkHandled: n?.onDeepLinkHandled }), s.use(qo, { videoPlayerController: n?.videoPlayerController }), s.use(jo, {
5564
+ }), s.use($o, { onDeepLinkHandled: n?.onDeepLinkHandled }), s.use(qo, { videoPlayerController: n?.videoPlayerController }), s.use(xo, {
5525
5565
  onContentActivate: n?.onContentActivate,
5526
5566
  withAd: n?.withAd,
5527
5567
  withAdNotification: n?.withAdNotification
5528
- }), s.use(eo, { sdkKey: t, host: i, analyticsHost: o, version: n?.version }), s.use(oo), s.use(Mo), s.use(rs), s.use(ko), s.use(fs), s.after((a, u, l) => {
5568
+ }), s.use(ro, { sdkKey: t, host: i, analyticsHost: o, version: n?.version }), s.use(ao), s.use(Uo), s.use(rs), s.use(Co), s.use(fs), s.after((a, u, d) => {
5529
5569
  if (a)
5530
5570
  throw a;
5531
- u.ready(), l();
5532
- }), r && s.after(async (a, u, l) => {
5571
+ u.ready(), d();
5572
+ }), r && s.after(async (a, u, d) => {
5533
5573
  if (a)
5534
5574
  throw a;
5535
- await u.sdk.initializeApp(), l();
5575
+ await u.sdk.initializeApp(), d();
5536
5576
  }), s.onClose(() => {
5537
5577
  console.log("close");
5538
5578
  }), s;