@streamlayer/sdk-web 1.8.0 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/es/index.js CHANGED
@@ -1,28 +1,28 @@
1
1
  import { pino as wi } from "pino";
2
- import { QuestionType as I, QuestionStatus as Y, PromotionType as U, NotificationEnabled as $r, SilenceSetting as Ai, UseAsNotification as Ei } from "@streamlayer/sl-eslib/interactive/interactive.common_pb";
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";
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 Br } from "@streamlayer/sl-eslib/analytics/v1/invitations/invitations_pb";
6
- import { computed as Ii, map as Oi, atom as kt, batched as qr, onMount as Sr } from "nanostores";
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
7
  import { nanoid as or } from "nanoid";
8
- import { ConnectError as rt, Code as oe, createContextKey as Ur, createClient as jr, createContextValues as Ti } from "@connectrpc/connect";
9
- import { createGrpcWebTransport as xr } from "@connectrpc/connect-web";
10
- import { nanoquery as Qr } from "@nanostores/query";
11
- import { Events as Tn } from "@streamlayer/sl-eslib/sports/events/events_connect";
12
- import { Client as it } from "@streamlayer/sl-eslib/sdkSettings/client/client_connect";
13
- import { Users as wr } from "@streamlayer/sl-eslib/users/users_connect";
8
+ import { ConnectError as rt, Code as oe, createContextKey as jr, createClient as xr, createContextValues as Ti } from "@connectrpc/connect";
9
+ import { createGrpcWebTransport as Qr } from "@connectrpc/connect-web";
10
+ import { nanoquery as Gr } from "@nanostores/query";
11
+ import { Events as _n } from "@streamlayer/sl-eslib/sports/events/events_connect";
12
+ import { Client as ot } from "@streamlayer/sl-eslib/sdkSettings/client/client_connect";
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 _n } from "@streamlayer/sl-eslib/interactive/leaderboard/interactive.leaderboard_connect";
15
+ import { Leaderboard as kn } from "@streamlayer/sl-eslib/interactive/leaderboard/interactive.leaderboard_connect";
16
16
  import "@streamlayer/sl-eslib/interactive/leaderboard/interactive.leaderboard_pb";
17
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 Gr } 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
- import { InteractionActionType as Kr } from "@streamlayer/sl-eslib/analytics/v1/interactions/interactions_pb";
21
- import { NotificationKind as ye, NotificationType as zr } from "@streamlayer/sl-eslib/analytics/v1/notifications/notifications_pb";
22
- function Li(t) {
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";
20
+ import { InteractionActionType as zr } from "@streamlayer/sl-eslib/analytics/v1/interactions/interactions_pb";
21
+ import { NotificationKind as me, NotificationType as Hr } from "@streamlayer/sl-eslib/analytics/v1/notifications/notifications_pb";
22
+ function ki(t) {
23
23
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
24
24
  }
25
- var Cn = { exports: {} }, $ = Cn.exports = {}, ce, le;
25
+ var Pn = { exports: {} }, M = Pn.exports = {}, de, le;
26
26
  function sr() {
27
27
  throw new Error("setTimeout has not been defined");
28
28
  }
@@ -31,9 +31,9 @@ function ar() {
31
31
  }
32
32
  (function() {
33
33
  try {
34
- typeof setTimeout == "function" ? ce = setTimeout : ce = sr;
34
+ typeof setTimeout == "function" ? de = setTimeout : de = sr;
35
35
  } catch {
36
- ce = sr;
36
+ de = sr;
37
37
  }
38
38
  try {
39
39
  typeof clearTimeout == "function" ? le = clearTimeout : le = ar;
@@ -41,18 +41,18 @@ function ar() {
41
41
  le = ar;
42
42
  }
43
43
  })();
44
- function Pn(t) {
45
- if (ce === setTimeout)
44
+ function Ln(t) {
45
+ if (de === setTimeout)
46
46
  return setTimeout(t, 0);
47
- if ((ce === sr || !ce) && setTimeout)
48
- return ce = setTimeout, setTimeout(t, 0);
47
+ if ((de === sr || !de) && setTimeout)
48
+ return de = setTimeout, setTimeout(t, 0);
49
49
  try {
50
- return ce(t, 0);
50
+ return de(t, 0);
51
51
  } catch {
52
52
  try {
53
- return ce.call(null, t, 0);
53
+ return de.call(null, t, 0);
54
54
  } catch {
55
- return ce.call(this, t, 0);
55
+ return de.call(this, t, 0);
56
56
  }
57
57
  }
58
58
  }
@@ -71,69 +71,69 @@ function Ci(t) {
71
71
  }
72
72
  }
73
73
  }
74
- var Se = [], Qe = !1, _e, ht = -1;
74
+ var we = [], Qe = !1, ke, yt = -1;
75
75
  function Pi() {
76
- !Qe || !_e || (Qe = !1, _e.length ? Se = _e.concat(Se) : ht = -1, Se.length && kn());
76
+ !Qe || !ke || (Qe = !1, ke.length ? we = ke.concat(we) : yt = -1, we.length && Nn());
77
77
  }
78
- function kn() {
78
+ function Nn() {
79
79
  if (!Qe) {
80
- var t = Pn(Pi);
80
+ var t = Ln(Pi);
81
81
  Qe = !0;
82
- for (var e = Se.length; e; ) {
83
- for (_e = Se, Se = []; ++ht < e; )
84
- _e && _e[ht].run();
85
- ht = -1, e = Se.length;
82
+ for (var e = we.length; e; ) {
83
+ for (ke = we, we = []; ++yt < e; )
84
+ ke && ke[yt].run();
85
+ yt = -1, e = we.length;
86
86
  }
87
- _e = null, Qe = !1, Ci(t);
87
+ ke = null, Qe = !1, Ci(t);
88
88
  }
89
89
  }
90
- $.nextTick = function(t) {
90
+ M.nextTick = function(t) {
91
91
  var e = new Array(arguments.length - 1);
92
92
  if (arguments.length > 1)
93
93
  for (var r = 1; r < arguments.length; r++)
94
94
  e[r - 1] = arguments[r];
95
- Se.push(new Nn(t, e)), Se.length === 1 && !Qe && Pn(kn);
95
+ we.push(new Fn(t, e)), we.length === 1 && !Qe && Ln(Nn);
96
96
  };
97
- function Nn(t, e) {
97
+ function Fn(t, e) {
98
98
  this.fun = t, this.array = e;
99
99
  }
100
- Nn.prototype.run = function() {
100
+ Fn.prototype.run = function() {
101
101
  this.fun.apply(null, this.array);
102
102
  };
103
- $.title = "browser";
104
- $.browser = !0;
105
- $.env = {};
106
- $.argv = [];
107
- $.version = "";
108
- $.versions = {};
109
- function we() {
103
+ M.title = "browser";
104
+ M.browser = !0;
105
+ M.env = {};
106
+ M.argv = [];
107
+ M.version = "";
108
+ M.versions = {};
109
+ function Ee() {
110
110
  }
111
- $.on = we;
112
- $.addListener = we;
113
- $.once = we;
114
- $.off = we;
115
- $.removeListener = we;
116
- $.removeAllListeners = we;
117
- $.emit = we;
118
- $.prependListener = we;
119
- $.prependOnceListener = we;
120
- $.listeners = function(t) {
111
+ M.on = Ee;
112
+ M.addListener = Ee;
113
+ M.once = Ee;
114
+ M.off = Ee;
115
+ M.removeListener = Ee;
116
+ M.removeAllListeners = Ee;
117
+ M.emit = Ee;
118
+ M.prependListener = Ee;
119
+ M.prependOnceListener = Ee;
120
+ M.listeners = function(t) {
121
121
  return [];
122
122
  };
123
- $.binding = function(t) {
123
+ M.binding = function(t) {
124
124
  throw new Error("process.binding is not supported");
125
125
  };
126
- $.cwd = function() {
126
+ M.cwd = function() {
127
127
  return "/";
128
128
  };
129
- $.chdir = function(t) {
129
+ M.chdir = function(t) {
130
130
  throw new Error("process.chdir is not supported");
131
131
  };
132
- $.umask = function() {
132
+ M.umask = function() {
133
133
  return 0;
134
134
  };
135
- var ki = Cn.exports;
136
- const E = /* @__PURE__ */ Li(ki), Ni = wi({
135
+ var Li = Pn.exports;
136
+ const E = /* @__PURE__ */ ki(Li), Ni = wi({
137
137
  level: "trace",
138
138
  enabled: typeof window < "u" && !!window.localStorage.getItem("SL_DEBUG"),
139
139
  browser: {
@@ -141,14 +141,14 @@ const E = /* @__PURE__ */ Li(ki), Ni = wi({
141
141
  console.log(t);
142
142
  }
143
143
  }
144
- }), fe = (t, e) => Ni.child({ name: t }, e);
144
+ }), pe = (t, e) => Ni.child({ name: t }, e);
145
145
  class Fi extends Event {
146
146
  slEventBus;
147
147
  constructor(e, r) {
148
148
  super(e), this.slEventBus = r;
149
149
  }
150
150
  }
151
- const Di = fe("event-bus");
151
+ const Di = pe("event-bus");
152
152
  class Ri {
153
153
  name;
154
154
  listeners;
@@ -175,6 +175,10 @@ class Ri {
175
175
  }
176
176
  class Vi {
177
177
  }
178
+ var Ae;
179
+ (function(t) {
180
+ t[t.ONBOARDING = 1] = "ONBOARDING", t[t.QUESTION = 2] = "QUESTION", t[t.QUESTION_RESOLVED = 3] = "QUESTION_RESOLVED";
181
+ })(Ae || (Ae = {}));
178
182
  window.slStore = /* @__PURE__ */ Object.create(null);
179
183
  class Nt {
180
184
  /**
@@ -196,7 +200,7 @@ const $i = (t) => {
196
200
  const e = Object.keys(t);
197
201
  return Ii(e.map((r) => t[r].getStore()), (...r) => Object.fromEntries(e.map((n, i) => [n, r[i]])));
198
202
  };
199
- class Le extends Nt {
203
+ class Ce extends Nt {
200
204
  getValues = () => this.getStore().get();
201
205
  getValue = (e) => this.getStore().get()[e];
202
206
  setValue = (e, r) => this.getStore().setKey(e, r);
@@ -204,11 +208,11 @@ class Le extends Nt {
204
208
  unsubscribe = () => this.getStore().off();
205
209
  }
206
210
  const Z = (t) => Oi(t);
207
- var ge;
211
+ var be;
208
212
  (function(t) {
209
213
  t.ORGANIZATION = "ORGANIZATION", t.STREAM = "STREAM";
210
- })(ge || (ge = {}));
211
- const Mi = {
214
+ })(be || (be = {}));
215
+ const Bi = {
212
216
  [R.BETTING]: "betting",
213
217
  [R.GAMES]: "games",
214
218
  [R.PUBLIC_CHAT]: "publicChat",
@@ -218,7 +222,7 @@ var Ze;
218
222
  (function(t) {
219
223
  t.Ready = "ready", t.Suspended = "suspended";
220
224
  })(Ze || (Ze = {}));
221
- class Fn {
225
+ class Dn {
222
226
  status;
223
227
  source;
224
228
  config;
@@ -226,7 +230,7 @@ class Fn {
226
230
  listeners = /* @__PURE__ */ new Set();
227
231
  settingsKey;
228
232
  constructor({ settings: e, ...r }, n) {
229
- this.settingsKey = Mi[r.type], this.status = kt(Ze.Suspended), this.config = new Le(Z(r), `feature:config:${this.settingsKey}`), this.settingsKey !== void 0 && e?.overlaySettings.case === this.settingsKey ? this.settings = new Le(Z(e.overlaySettings.value), `feature:settings:${this.settingsKey}`) : this.settings = new Le(Z({}), `feature:settings:${this.settingsKey}`), this.source = 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;
230
234
  }
231
235
  get featureConfig() {
232
236
  return this.config.getStore();
@@ -257,7 +261,7 @@ class Fn {
257
261
  }
258
262
  };
259
263
  update = (e, r) => {
260
- this.source === ge.STREAM && r === ge.ORGANIZATION || (this.setFeatureConfig(e), this.source = r);
264
+ this.source === be.STREAM && r === be.ORGANIZATION || (this.setFeatureConfig(e), this.source = r);
261
265
  };
262
266
  fireEvent(e) {
263
267
  for (const r of this.listeners.values())
@@ -283,11 +287,11 @@ class re extends Nt {
283
287
  return this.getStore().get();
284
288
  }
285
289
  }
286
- const q = (t) => kt(t);
290
+ const q = (t) => Lt(t);
287
291
  class se extends Nt {
288
292
  atomStore;
289
293
  constructor(e, r, n) {
290
- super(e, `api:${r}`), this.atomStore = kt(), n && e.subscribe((i) => {
294
+ super(e, `api:${r}`), this.atomStore = Lt(), n && e.subscribe((i) => {
291
295
  const o = this.atomStore.get(), s = n(i, o);
292
296
  o !== s && this.atomStore.set(s);
293
297
  });
@@ -315,8 +319,8 @@ class se extends Nt {
315
319
  key = () => this.getStore().key;
316
320
  off = () => this.getStore().off();
317
321
  }
318
- const M = new Ri();
319
- async function* Bi(t, e) {
322
+ const B = new Ri();
323
+ async function* Mi(t, e) {
320
324
  for await (const r of e) {
321
325
  t.response.message = r, t.received_at = Date.now(), t.id = Date.now();
322
326
  const n = {
@@ -355,7 +359,7 @@ const qi = () => (t) => async (e) => {
355
359
  };
356
360
  return window.postMessage(i), {
357
361
  ...n,
358
- message: Bi(r, n.message)
362
+ message: Mi(r, n.message)
359
363
  };
360
364
  } else {
361
365
  r.response.message = n.message, r.latency = r.received_at - r.sent_at;
@@ -379,7 +383,7 @@ const qi = () => (t) => async (e) => {
379
383
  }
380
384
  };
381
385
  window.dispatchEvent(new CustomEvent("grpc_devtools_loaded"));
382
- function Dn(t) {
386
+ function Rn(t) {
383
387
  return t instanceof DOMException && // everything except Firefox
384
388
  (t.code === 22 || // Firefox
385
389
  t.code === 1014 || // test name field too, because code might not be present
@@ -404,7 +408,7 @@ class We {
404
408
  try {
405
409
  this.storage.setItem(n, r);
406
410
  } catch (i) {
407
- Dn(i) && this.storage === window.sessionStorage && (window.sessionStorage.removeItem("slstreamlogs"), this.storage.setItem(n, r));
411
+ Rn(i) && this.storage === window.sessionStorage && (window.sessionStorage.removeItem("slstreamlogs"), this.storage.setItem(n, r));
408
412
  }
409
413
  };
410
414
  read = (...e) => {
@@ -419,7 +423,7 @@ var ie;
419
423
  (function(t) {
420
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";
421
425
  })(ie || (ie = {}));
422
- const Hr = fe("grpc:stream");
426
+ const Wr = pe("grpc:stream");
423
427
  class Ui {
424
428
  params;
425
429
  streamCancel;
@@ -438,7 +442,7 @@ class Ui {
438
442
  ts: /* @__PURE__ */ new Date(),
439
443
  log: []
440
444
  };
441
- this.state = new Le(Z(o), `subscription:${i.name}:state`), this.options = {
445
+ this.state = new Ce(Z(o), `subscription:${i.name}:state`), this.options = {
442
446
  ...i,
443
447
  reconnectDelay: i.reconnectDelay ?? 1e3,
444
448
  reconnectMaxDelay: i.reconnectMaxDelay ?? 3e4,
@@ -454,12 +458,12 @@ class Ui {
454
458
  addStateLog = (e) => {
455
459
  const r = this.state.getStore().get().log, n = `${this.options.name} ${(/* @__PURE__ */ new Date()).toISOString()}: ${e}`;
456
460
  if (r.push(n), this.state.setValue("log", r), localStorage.getItem("SL_DEBUG")) {
457
- e.startsWith("received data") ? Hr.trace({ name: this.options.name, attempt: this.attempt }, "received data") : Hr.trace({ name: this.options.name, attempt: this.attempt }, e);
461
+ e.startsWith("received data") ? Wr.trace({ name: this.options.name, attempt: this.attempt }, "received data") : Wr.trace({ name: this.options.name, attempt: this.attempt }, e);
458
462
  try {
459
463
  window.sessionStorage.setItem("slstreamlogs", window.sessionStorage.getItem("slstreamlogs") + `
460
464
  ` + n);
461
465
  } catch (i) {
462
- Dn(i) && window.sessionStorage.removeItem("slstreamlogs"), window.sessionStorage.setItem("slstreamlogs", n);
466
+ Rn(i) && window.sessionStorage.removeItem("slstreamlogs"), window.sessionStorage.setItem("slstreamlogs", n);
463
467
  }
464
468
  }
465
469
  };
@@ -537,16 +541,16 @@ const ji = /* @__PURE__ */ new Set([
537
541
  oe.FailedPrecondition,
538
542
  oe.Unavailable,
539
543
  oe.DataLoss
540
- ]), Wr = fe("grpc:retry"), xi = (t) => async (e) => {
544
+ ]), Yr = pe("grpc:retry"), xi = (t) => async (e) => {
541
545
  const r = e.contextValues.get(ur.retryAttempts), n = 300, i = e.contextValues.get(ur.retryDelay);
542
546
  if (e.stream || r === 0)
543
547
  return t(e);
544
- Wr.trace({ url: e.url, attempts: r, maxDelay: i }, "retry options");
548
+ Yr.trace({ url: e.url, attempts: r, maxDelay: i }, "retry options");
545
549
  for (let o = 0; ; o++)
546
550
  try {
547
551
  return await t(e);
548
552
  } catch (s) {
549
- Wr.trace({ attempt: o, error: s }, "retry attempt");
553
+ Yr.trace({ attempt: o, error: s }, "retry attempt");
550
554
  const a = rt.from(s);
551
555
  if (o >= r || !(a instanceof rt) || !ji.has(a.code))
552
556
  throw s;
@@ -554,8 +558,8 @@ const ji = /* @__PURE__ */ new Set([
554
558
  await new Promise((c) => setTimeout(c, l));
555
559
  }
556
560
  }, ur = {
557
- retryAttempts: Ur(10, { description: "Number of attempts to retry" }),
558
- retryDelay: Ur(3e4, { description: "Max delay between retries in milliseconds" })
561
+ retryAttempts: jr(10, { description: "Number of attempts to retry" }),
562
+ retryDelay: jr(3e4, { description: "Max delay between retries in milliseconds" })
559
563
  }, Qi = () => {
560
564
  const t = localStorage.getItem("sl-device-id");
561
565
  if (t)
@@ -563,7 +567,7 @@ const ji = /* @__PURE__ */ new Set([
563
567
  const e = or();
564
568
  return localStorage.setItem("sl-device-id", e), e;
565
569
  }, Gi = () => navigator.userAgentData?.platform || navigator.platform;
566
- class Yr {
570
+ class Jr {
567
571
  toJsonOptions = {
568
572
  emitDefaultValues: !1,
569
573
  enumAsInteger: !0,
@@ -582,20 +586,20 @@ class Yr {
582
586
  subscriptions;
583
587
  opts;
584
588
  constructor(e, r) {
585
- this.host = e, this.opts = r, this.$headers = new Le(Z({
589
+ this.host = e, this.opts = r, this.$headers = new Ce(Z({
586
590
  "sl-device-id": Qi(),
587
591
  "sl-device-os": Gi()
588
592
  }), "transport:headers"), this.initInterceptors(), this.clients = /* @__PURE__ */ new Map(), this.streamClients = /* @__PURE__ */ new Map(), this.subscriptions = /* @__PURE__ */ new Map();
589
- const [n, i, o] = Qr({
593
+ const [n, i, o] = Gr({
590
594
  dedupeTime: r?.dedupeTime,
591
595
  refetchInterval: r?.refetchInterval
592
596
  });
593
- this.nanoquery = { createFetcherStore: n, createMutatorStore: i, utils: o }, this.transport = xr({
597
+ this.nanoquery = { createFetcherStore: n, createMutatorStore: i, utils: o }, this.transport = Qr({
594
598
  baseUrl: e,
595
599
  defaultTimeoutMs: 1e4,
596
600
  interceptors: this.interceptors
597
601
  // useBinaryFormat: true,
598
- }), this.streamTransport = xr({
602
+ }), this.streamTransport = Qr({
599
603
  baseUrl: e,
600
604
  interceptors: this.interceptors
601
605
  // useBinaryFormat: true,
@@ -619,7 +623,7 @@ class Yr {
619
623
  for (const [i, o] of this.subscriptions)
620
624
  o.disconnect(), this.subscriptions.delete(i);
621
625
  this.clients.clear(), this.streamClients.clear(), this.subscriptions.clear();
622
- const [e, r, n] = Qr({
626
+ const [e, r, n] = Gr({
623
627
  dedupeTime: this.opts?.dedupeTime,
624
628
  refetchInterval: this.opts?.refetchInterval
625
629
  });
@@ -635,14 +639,14 @@ class Yr {
635
639
  const r = e.typeName;
636
640
  if (this.clients.has(r))
637
641
  return this.clients.get(r);
638
- const n = jr(e, this.transport);
642
+ const n = xr(e, this.transport);
639
643
  return this.clients.set(r, n), n;
640
644
  };
641
645
  getStreamClient = (e) => {
642
646
  const r = `stream-${e.typeName}`;
643
647
  if (this.clients.has(r))
644
648
  return this.clients.get(r);
645
- const n = jr(e, this.streamTransport);
649
+ const n = xr(e, this.streamTransport);
646
650
  return this.clients.set(r, n), n;
647
651
  };
648
652
  // create unary client, used for query request
@@ -685,7 +689,7 @@ class Yr {
685
689
  };
686
690
  }
687
691
  const Ki = (t, e) => {
688
- const { client: r, queryKey: n } = e.createPromiseClient(Tn, {
692
+ const { client: r, queryKey: n } = e.createPromiseClient(_n, {
689
693
  method: "retrieveEventId",
690
694
  params: [t]
691
695
  });
@@ -703,7 +707,7 @@ const Ki = (t, e) => {
703
707
  }
704
708
  });
705
709
  }, zi = (t, e) => {
706
- const { client: r, queryKey: n } = e.createPromiseClient(it, { method: "getStream", params: [t] });
710
+ const { client: r, queryKey: n } = e.createPromiseClient(ot, { method: "getStream", params: [t] });
707
711
  return e.nanoquery.createFetcherStore(n, {
708
712
  fetcher: async (i, o, s) => s ? (await r.getStream({
709
713
  id: s
@@ -711,14 +715,14 @@ const Ki = (t, e) => {
711
715
  })).data?.attributes : void 0
712
716
  });
713
717
  }, Hi = (t, e) => {
714
- const { client: r, queryKey: n } = e.createPromiseClient(Tn, { method: "summary", params: [t] });
718
+ const { client: r, queryKey: n } = e.createPromiseClient(_n, { method: "summary", params: [t] });
715
719
  return e.nanoquery.createFetcherStore(n, {
716
720
  fetcher: async (i, o, s) => s ? (await r.summary({
717
721
  id: s
718
722
  })).data?.attributes : void 0
719
723
  });
720
724
  }, Wi = (t, e) => {
721
- const { queryKey: r, client: n } = e.createPromiseClient(wr, { method: "me", params: [t] });
725
+ const { queryKey: r, client: n } = e.createPromiseClient(Ar, { method: "me", params: [t] });
722
726
  return e.nanoquery.createFetcherStore(r, {
723
727
  fetcher: async () => {
724
728
  const { data: i } = await n.me({});
@@ -726,15 +730,15 @@ const Ki = (t, e) => {
726
730
  }
727
731
  });
728
732
  }, Yi = (t) => {
729
- const { client: e, createRequestOptions: r } = t.createPromiseClient(wr, { method: "bypassAuth" }), n = r({ retryAttempts: 0 });
733
+ const { client: e, createRequestOptions: r } = t.createPromiseClient(Ar, { method: "bypassAuth" }), n = r({ retryAttempts: 0 });
730
734
  return ({ userKey: i, schema: o, init: s, inviterKey: a }) => e.bypassAuth({ userKey: i, schema: o, init: s, inviterKey: a }, { contextValues: n });
731
735
  }, Ji = (t, e) => {
732
- const { client: r, queryKey: n } = e.createPromiseClient(it, { method: "get", params: [t] });
736
+ const { client: r, queryKey: n } = e.createPromiseClient(ot, { method: "get", params: [t] });
733
737
  return e.nanoquery.createFetcherStore(n, {
734
738
  fetcher: async () => (await r.get({})).data?.attributes
735
739
  });
736
740
  }, Xi = (t, e) => {
737
- const { client: r, queryKey: n } = e.createPromiseClient(it, { method: "getOrganization", params: [t] });
741
+ const { client: r, queryKey: n } = e.createPromiseClient(ot, { method: "getOrganization", params: [t] });
738
742
  return e.nanoquery.createFetcherStore(n, {
739
743
  fetcher: async () => {
740
744
  const i = await r.getOrganization({});
@@ -745,7 +749,7 @@ const Ki = (t, e) => {
745
749
  }
746
750
  });
747
751
  }, Zi = (t, e) => {
748
- const { client: r, queryKey: n } = e.createPromiseClient(it, {
752
+ const { client: r, queryKey: n } = e.createPromiseClient(ot, {
749
753
  method: "getOrganizationAdvertising",
750
754
  params: [t]
751
755
  });
@@ -753,49 +757,49 @@ const Ki = (t, e) => {
753
757
  fetcher: async () => (await r.getOrganizationAdvertising({})).data?.attributes
754
758
  });
755
759
  }, eo = (t, e, r) => {
756
- t.transport = new Yr(e.host, {
760
+ t.transport = new Jr(e.host, {
757
761
  dedupeTime: 1e3 * 60 * 5,
758
762
  refetchInterval: 1e3 * 60 * 5,
759
763
  retryable: !0
760
- }), t.analyticsTransport = new Yr(e.analyticsHost), t.sdk.host = t.transport.host, t.transport.setSdkKey(e.sdkKey), t.transport.setHeader("sl-sdk-version", e.version || "-"), t.transport.$headers.subscribe((n) => {
764
+ }), t.analyticsTransport = new Jr(e.analyticsHost), t.sdk.host = t.transport.host, t.transport.setSdkKey(e.sdkKey), t.transport.setHeader("sl-sdk-version", e.version || "-"), t.transport.$headers.subscribe((n) => {
761
765
  t.analyticsTransport.$headers.getStore().set(n);
762
766
  }), t.sdk.onMount({ name: "transport" }, () => () => {
763
767
  t.transport.disconnect(), t.analyticsTransport.disconnect();
764
768
  }), r();
765
769
  };
766
- var me;
770
+ var ge;
767
771
  (function(t) {
768
772
  t.SCHEMA = "schema", t.EXTERNAL_TOKEN = "eToken", t.TOKEN = "token";
769
- })(me || (me = {}));
770
- class Ue extends We {
773
+ })(ge || (ge = {}));
774
+ class je extends We {
771
775
  constructor() {
772
776
  super("user");
773
777
  }
774
778
  // Schema
775
779
  setSchema = (e) => {
776
- this.write(me.SCHEMA, e);
780
+ this.write(ge.SCHEMA, e);
777
781
  };
778
- getSchema = () => this.read(me.SCHEMA);
782
+ getSchema = () => this.read(ge.SCHEMA);
779
783
  // Token
780
784
  setToken = (e) => {
781
- this.write(me.TOKEN, e);
785
+ this.write(ge.TOKEN, e);
782
786
  };
783
- getToken = () => this.read(me.TOKEN);
787
+ getToken = () => this.read(ge.TOKEN);
784
788
  // External Token
785
789
  setExternalToken = (e) => {
786
- this.write(me.EXTERNAL_TOKEN, e);
790
+ this.write(ge.EXTERNAL_TOKEN, e);
787
791
  };
788
- getExternalToken = () => this.read(me.EXTERNAL_TOKEN);
792
+ getExternalToken = () => this.read(ge.EXTERNAL_TOKEN);
789
793
  removeToken = () => {
790
- this.remove(me.TOKEN);
794
+ this.remove(ge.TOKEN);
791
795
  };
792
796
  }
793
- var be;
797
+ var ve;
794
798
  (function(t) {
795
799
  t.DISABLED = "disabled", t.INITIALIZATION = "initialization", t.READY = "ready", t.FAILED = "failed", t.SUSPENDED = "suspended";
796
- })(be || (be = {}));
800
+ })(ve || (ve = {}));
797
801
  const to = (t) => {
798
- const e = new Ue(), 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) => {
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) => {
799
803
  if (!a)
800
804
  return s?.data?.id ? s.data.id : u === !1 ? void 0 : l;
801
805
  }), o = new se(Ji(n.getStore(), t), "userSettings");
@@ -816,7 +820,7 @@ const to = (t) => {
816
820
  streamSummary: i
817
821
  };
818
822
  }, no = (t) => {
819
- const e = new re(q(void 0), "enabled"), r = new re(q(be.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);
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);
820
824
  return {
821
825
  enabled: e,
822
826
  status: r,
@@ -861,13 +865,13 @@ const oo = (t, e, r) => {
861
865
  t.store.unsubscribe();
862
866
  }, r();
863
867
  }, so = (t) => {
864
- const { client: e } = t.createPromiseClient(_n, { method: "list" });
868
+ const { client: e } = t.createPromiseClient(kn, { method: "list" });
865
869
  return (r) => e.list(r);
866
- }, Rn = (t) => {
867
- const { client: e } = t.createPromiseClient(_n, { method: "summary" });
870
+ }, Vn = (t) => {
871
+ const { client: e } = t.createPromiseClient(kn, { method: "summary" });
868
872
  return (r) => e.summary(r);
869
873
  }, ao = (t, e) => {
870
- const { client: r, queryKey: n } = e.createPromiseClient(wr, {
874
+ const { client: r, queryKey: n } = e.createPromiseClient(Ar, {
871
875
  method: "getFriends",
872
876
  params: [t]
873
877
  });
@@ -915,19 +919,19 @@ const oo = (t, e, r) => {
915
919
  id: t
916
920
  })).data;
917
921
  }, fo = (t, e) => {
918
- const { client: r } = e.createStreamClient(ee), n = kt({ eventId: t.get() || "", feedId: "" });
922
+ const { client: r } = e.createStreamClient(ee), n = Lt({ eventId: t.get() || "", feedId: "" });
919
923
  return t.subscribe((o = "") => {
920
924
  n.set({ eventId: o, feedId: "" });
921
925
  }), e.addSubscription(r.subscription, n, { name: "feedSubscription" });
922
926
  }, po = (t, e) => {
923
927
  const { client: r } = e.createStreamClient(ee);
924
928
  return e.addSubscription(r.questionSubscription, { questionId: t }, { name: "questionSubscription" });
925
- }, Vn = async (t, e) => {
929
+ }, cr = async (t, e) => {
926
930
  const { client: r } = e.createPromiseClient(ee, { method: "questionByUser", params: [t] });
927
931
  return (await r.questionByUser({
928
932
  questionId: t
929
933
  })).data?.attributes?.question;
930
- }, wt = (t, e) => {
934
+ }, nt = (t, e) => {
931
935
  const { client: r, queryKey: n } = e.createPromiseClient(ee, { method: "questionByUser", params: [t] });
932
936
  return e.nanoquery.createFetcherStore(n, {
933
937
  fetcher: async (i, o, s) => (await r.questionByUser({
@@ -954,7 +958,7 @@ const oo = (t, e, r) => {
954
958
  fetcher: async (o, s, a, u) => a ? (await n.list({
955
959
  eventId: a,
956
960
  filter: {
957
- types: u === Ce.ALLOWED ? [] : [I.FACTOID, I.PROMOTION, I.TWEET],
961
+ types: u === Pe.ALLOWED ? [] : [I.FACTOID, I.PROMOTION, I.TWEET],
958
962
  statuses: [Y.ACTIVE, Y.RESOLVED]
959
963
  }
960
964
  })).data : [],
@@ -987,17 +991,17 @@ const oo = (t, e, r) => {
987
991
  dedupeTime: 0,
988
992
  refetchInterval: 0
989
993
  });
990
- }, mo = (t, e) => {
991
- const { client: r, queryKey: n } = e.createPromiseClient(ee, {
994
+ }, mo = (t, e, r, n, i) => {
995
+ const { client: o, queryKey: s } = i.createPromiseClient(ee, {
992
996
  method: "betPack",
993
- params: [t]
997
+ params: [t, e, r]
994
998
  });
995
- return e.nanoquery.createFetcherStore(n, {
996
- fetcher: async (i, o, s) => {
997
- if (!s)
999
+ return i.nanoquery.createFetcherStore(s, {
1000
+ fetcher: async (a, u, l, c, f) => {
1001
+ if (!l || !c || !f)
998
1002
  return null;
999
- const a = await r.betPack({
1000
- eventId: s,
1003
+ const p = await o.betPack({
1004
+ eventId: l,
1001
1005
  types: [I.PREDICTION],
1002
1006
  statuses: [Y.ACTIVE, Y.RESOLVED],
1003
1007
  limit: 5,
@@ -1006,19 +1010,35 @@ const oo = (t, e, r) => {
1006
1010
  order: "asc"
1007
1011
  }
1008
1012
  });
1009
- return !a.data || !a.data.length ? null : a.data?.reduce((u, l) => l?.attributes?.question?.id ? { ...u, [l.attributes.question.id]: l.attributes.question } : u, {});
1013
+ return !p.data || !p.data.length ? null : p.data?.reduce((v, w) => {
1014
+ const m = w?.attributes?.question;
1015
+ if (!m?.id)
1016
+ return v;
1017
+ const g = {
1018
+ eventId: l,
1019
+ userId: c,
1020
+ organizationId: f
1021
+ };
1022
+ return n.isBetPackQuestionReceived(g, m.id) || (B.emit("poll", {
1023
+ action: "received",
1024
+ payload: {
1025
+ questionId: m.id,
1026
+ questionType: m.type
1027
+ }
1028
+ }), n.saveBetPackQuestionReceived(g, m.id)), { ...v, [m.id]: m };
1029
+ }, {});
1010
1030
  },
1011
1031
  dedupeTime: 0,
1012
1032
  refetchInterval: 0
1013
1033
  });
1014
1034
  }, go = (t, e, r) => {
1015
- const n = qr([e, r], () => {
1035
+ const n = Ur([e, r], () => {
1016
1036
  const a = e.get();
1017
1037
  if (!a)
1018
1038
  return;
1019
1039
  const u = r.get().data?.find((c) => c.id === a?.questionId), l = a?.question?.openedFrom;
1020
1040
  return u ? (u.openedFrom = l, u) : a.question;
1021
- }), i = qr(n, (a) => a && a.type === "question" ? a.id : void 0), o = wt(i, t);
1041
+ }), i = Ur(n, (a) => a && a.type === "question" ? a.id : void 0), o = nt(i, t);
1022
1042
  return { $store: n, $extendedStore: o, updateExtendedQuestion: (a) => {
1023
1043
  const u = o.get().data, l = (c, f) => {
1024
1044
  if (!c || !f)
@@ -1067,65 +1087,65 @@ const vo = (t) => {
1067
1087
  notification: i,
1068
1088
  promotion: s
1069
1089
  };
1070
- }, dt = (t) => t.startsWith("http://") || t.startsWith("https://") ? new URL(t).toString() : t, So = ({ gamOptions: t, gamBaseUrl: e }) => {
1090
+ }, ft = (t) => t.startsWith("http://") || t.startsWith("https://") ? new URL(t).toString() : t, So = ({ gamOptions: t, gamBaseUrl: e }) => {
1071
1091
  const r = `${e}?`, n = [];
1072
1092
  for (const i in t) {
1073
1093
  const o = i.replace(/([a-zA-Z])(?=[A-Z])/g, "$1_").toLowerCase(), s = t[i];
1074
1094
  if (s)
1075
1095
  if (typeof s == "string")
1076
- n.push(`${o}=${dt(s)}`);
1096
+ n.push(`${o}=${ft(s)}`);
1077
1097
  else if (Array.isArray(s))
1078
- n.push(`${o}=${s.map(dt).join(",")}`);
1098
+ n.push(`${o}=${s.map(ft).join(",")}`);
1079
1099
  else {
1080
- const a = Object.entries(s).map(([u, l]) => Array.isArray(l) ? `${u}=${l.map(dt).join(",")}` : typeof l == "string" ? `${u}=${dt(l)}` : `${u}=${l}`).join("&").replaceAll("=", "%3D").replaceAll("&", "%26").replaceAll(",", "%2C");
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");
1081
1101
  n.push(`${o}=${a}`);
1082
1102
  }
1083
1103
  }
1084
1104
  return r + n.join("&");
1085
- }, $e = (t) => (t?.promotion?.type === U.INGAME_IAB11_LBAR || t?.promotion?.type === U.INGAME_IAB21_LBAR) && !!t.promotion.additionalBanner?.imageUrl, wo = (t, e, r) => {
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) => {
1086
1106
  let n = !1;
1087
- const i = r.transport, o = fe("advertisement"), s = new bo(), a = Z({}), u = yo(t, i), l = (b) => {
1107
+ const i = r.transport, o = pe("advertisement"), s = new bo(), a = Z({}), u = yo(t, i), l = (m) => {
1088
1108
  const g = a.get(), S = g.data?.question.id, F = g.data?.promotion?.type;
1089
- S && (M.emit("advertisement", {
1109
+ S && (B.emit("advertisement", {
1090
1110
  action: "opened",
1091
1111
  payload: {
1092
1112
  id: S,
1093
1113
  type: F,
1094
- hasBanner: $e(g.data),
1095
- openedFrom: b?.fromNotification ? "notification" : "auto"
1114
+ hasBanner: Be(g.data),
1115
+ openedFrom: m?.fromNotification ? "notification" : "auto"
1096
1116
  }
1097
- }), b?.fromNotification && (a.setKey("hasNotification", !1), M.emit("advertisement", {
1117
+ }), m?.fromNotification && (a.setKey("hasNotification", !1), B.emit("advertisement", {
1098
1118
  action: "notification-opened",
1099
1119
  payload: {
1100
1120
  id: S,
1101
1121
  type: F,
1102
- hasBanner: $e(g.data)
1122
+ hasBanner: Be(g.data)
1103
1123
  }
1104
1124
  })));
1105
1125
  }, c = () => {
1106
- const b = a.get(), g = b.data?.question.id, S = b.data?.promotion?.type, F = a.get()?.isOpened;
1107
- g && !F && (o.debug({ id: g }, "markAsViewed: %o"), s.setShowed(g), a.setKey("isOpened", !0), M.emit("advertisement", {
1126
+ const m = a.get(), g = m.data?.question.id, S = m.data?.promotion?.type, F = a.get()?.isOpened;
1127
+ g && !F && (o.debug({ id: g }, "markAsViewed: %o"), s.setShowed(g), a.setKey("isOpened", !0), B.emit("advertisement", {
1108
1128
  action: "viewed",
1109
1129
  payload: {
1110
1130
  id: g,
1111
1131
  type: S,
1112
- hasBanner: $e(b.data)
1132
+ hasBanner: Be(m.data)
1113
1133
  }
1114
1134
  }));
1115
- }, f = (b, g) => {
1135
+ }, f = (m, g) => {
1116
1136
  g ? a.set({
1117
1137
  loading: !1,
1118
1138
  error: void 0,
1119
1139
  data: g,
1120
- hasNotification: g?.notification?.enabled === $r.NOTIFICATION_ENABLED,
1140
+ hasNotification: g?.notification?.enabled === Br.NOTIFICATION_ENABLED,
1121
1141
  close: () => p(g.question.id),
1122
1142
  togglePause: (S) => v(g.question.id, S),
1123
1143
  isViewed: !!s.isViewed(g.question.id)
1124
- }) : (a.setKey("loading", !0), $n(b, i).then((S) => a.set({
1144
+ }) : (a.setKey("loading", !0), $n(m, i).then((S) => a.set({
1125
1145
  loading: !1,
1126
1146
  error: void 0,
1127
1147
  data: S,
1128
- hasNotification: S?.notification?.enabled === $r.NOTIFICATION_ENABLED,
1148
+ hasNotification: S?.notification?.enabled === Br.NOTIFICATION_ENABLED,
1129
1149
  close: () => p(S?.question.id),
1130
1150
  togglePause: (F) => v(S?.question.id, F),
1131
1151
  isViewed: S && !!s.isViewed(S.question.id)
@@ -1135,53 +1155,53 @@ const vo = (t) => {
1135
1155
  data: void 0
1136
1156
  })));
1137
1157
  };
1138
- a.subscribe((b, g) => {
1139
- if (!(b.data?.id === g?.data?.id && b.isPaused !== g?.isPaused)) {
1140
- if (b.data?.promotion?.type === U.EXTERNAL_AD && !b?.externalAd && b.data.promotion.adCampaigns?.gamOptions && b.data.promotion.adCampaigns?.gamBaseUrl) {
1141
- const S = So(b.data.promotion.adCampaigns);
1158
+ a.subscribe((m, g) => {
1159
+ 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);
1142
1162
  a.setKey("externalAd", { type: "gam", url: S });
1143
1163
  }
1144
- b.data?.promotion && !b.isOpened && (M.emit("advertisement", {
1164
+ m.data?.promotion && !m.isOpened && (B.emit("advertisement", {
1145
1165
  action: "received",
1146
1166
  payload: {
1147
- id: b.data.question.id,
1148
- type: b.data.promotion.type,
1149
- hasNotification: !!b.hasNotification,
1150
- hasBanner: $e(b.data),
1151
- isViewed: !!s.isViewed(b.data.question.id)
1167
+ id: m.data.question.id,
1168
+ type: m.data.promotion.type,
1169
+ hasNotification: !!m.hasNotification,
1170
+ hasBanner: Be(m.data),
1171
+ isViewed: !!s.isViewed(m.data.question.id)
1152
1172
  },
1153
- skipAnalytics: b.data.question.id === g?.data?.question.id
1154
- }), b.data.question.id !== g?.data?.question.id && !s.isViewed(b.data.question.id) && M.emit("advertisement", {
1173
+ skipAnalytics: m.data.question.id === g?.data?.question.id
1174
+ }), m.data.question.id !== g?.data?.question.id && !s.isViewed(m.data.question.id) && B.emit("advertisement", {
1155
1175
  action: "notification-received",
1156
1176
  payload: {
1157
- id: b.data.question.id,
1158
- type: b.data.promotion.type,
1177
+ id: m.data.question.id,
1178
+ type: m.data.promotion.type,
1159
1179
  hasNotification: !0,
1160
- hasBanner: $e(b.data),
1180
+ hasBanner: Be(m.data),
1161
1181
  isViewed: !1
1162
1182
  }
1163
- })), !b?.data && g?.data && M.emit("advertisement", {
1183
+ })), !m?.data && g?.data && B.emit("advertisement", {
1164
1184
  action: "closed",
1165
1185
  payload: {
1166
1186
  id: g.data.question.id,
1167
1187
  type: g.data.promotion?.type,
1168
1188
  hasNotification: !!g.hasNotification,
1169
- hasBanner: $e(g.data),
1189
+ hasBanner: Be(g.data),
1170
1190
  isViewed: !!s.isViewed(g.data.question.id)
1171
1191
  }
1172
1192
  });
1173
1193
  }
1174
1194
  });
1175
- const p = (b) => {
1176
- (!b || a.get()?.data?.question.id === b) && a.set({});
1177
- }, v = (b, g) => {
1178
- a.get()?.data?.question.id === b && a.setKey("isPaused", g);
1195
+ const p = (m) => {
1196
+ (!m || a.get()?.data?.question.id === m) && a.set({});
1197
+ }, v = (m, g) => {
1198
+ a.get()?.data?.question.id === m && a.setKey("isPaused", g);
1179
1199
  };
1180
1200
  return { connect: () => {
1181
- n || (n = !0, u.subscribe((b, g) => {
1182
- b.data && (!g?.data || b.data.id !== g.data.id) && f(b.data.question.id, b.data);
1183
- }), e.addListener("promotion", (b) => {
1184
- const g = vo(b);
1201
+ n || (n = !0, u.subscribe((m, g) => {
1202
+ m.data && (!g?.data || m.data.id !== g.data.id) && f(m.data.question.id, m.data);
1203
+ }), e.addListener("promotion", (m) => {
1204
+ const g = vo(m);
1185
1205
  if (g) {
1186
1206
  if (g.question.status === Y.RESOLVED) {
1187
1207
  p(g.question.id), o.debug({ promotion: g }, "resolved: %o");
@@ -1196,11 +1216,46 @@ const vo = (t) => {
1196
1216
  }));
1197
1217
  }, hide: p, show: f, open: l, markAsViewed: c, $store: a };
1198
1218
  };
1199
- var Ce;
1219
+ var ce;
1220
+ (function(t) {
1221
+ t.ONBOARDING = "onboarding", t.ONBOARDING_IO = "onboarding_io", t.BET_PACK_ITEM_RECEIVED = "bp-item-received", t.QUESTION_OPENED = "q-opened";
1222
+ })(ce || (ce = {}));
1223
+ class Ao extends We {
1224
+ constructor() {
1225
+ super("gamification-session", window.sessionStorage);
1226
+ }
1227
+ writeValue = (e, r) => {
1228
+ this.write(...e, r);
1229
+ };
1230
+ readValue = (e) => this.read(...e);
1231
+ }
1232
+ class Eo extends We {
1233
+ sessionStorage;
1234
+ constructor() {
1235
+ super("gamification"), this.sessionStorage = new Ao();
1236
+ }
1237
+ saveBetPackQuestionReceived = ({ userId: e, eventId: r, organizationId: n }, i) => {
1238
+ this.write(ce.BET_PACK_ITEM_RECEIVED, n, e, r, i);
1239
+ };
1240
+ isBetPackQuestionReceived = ({ userId: e, eventId: r, organizationId: n }, i) => !!this.read(ce.BET_PACK_ITEM_RECEIVED, n, e, r, i);
1241
+ saveQuestionOpened = ({ userId: e, eventId: r, organizationId: n }, i) => {
1242
+ this.write(ce.QUESTION_OPENED, n, e, r, i);
1243
+ };
1244
+ isQuestionOpened = ({ userId: e, eventId: r, organizationId: n }, i) => !!this.read(ce.QUESTION_OPENED, n, e, r, i);
1245
+ saveOnboardingStatus = ({ userId: e, eventId: r, organizationId: n }, i) => {
1246
+ this.write(ce.ONBOARDING, n, e, r, i);
1247
+ };
1248
+ getOnboardingStatus = ({ userId: e, eventId: r, organizationId: n }) => this.read(ce.ONBOARDING, n, e, r);
1249
+ setOnboardingInstantOpen = ({ userId: e, eventId: r, organizationId: n }) => {
1250
+ this.sessionStorage.writeValue([ce.ONBOARDING_IO, n, e, r], "1");
1251
+ };
1252
+ getOnboardingInstantOpen = ({ userId: e, eventId: r, organizationId: n }) => this.sessionStorage.readValue([ce.ONBOARDING_IO, n, e, r]);
1253
+ }
1254
+ var Pe;
1200
1255
  (function(t) {
1201
1256
  t.ALLOWED = "allowed", t.DISALLOWED = "disallowed";
1202
- })(Ce || (Ce = {}));
1203
- class Ao {
1257
+ })(Pe || (Pe = {}));
1258
+ class Io {
1204
1259
  /** sl event id */
1205
1260
  slStreamId;
1206
1261
  /** organization id */
@@ -1229,25 +1284,41 @@ class Ao {
1229
1284
  /** subscription to opened question (vote percentage) */
1230
1285
  questionSubscription;
1231
1286
  advertisement;
1287
+ storage;
1232
1288
  notifications;
1233
1289
  log;
1234
1290
  transport;
1235
1291
  cancels = /* @__PURE__ */ new Set();
1236
1292
  constructor(e) {
1237
- this.transport = e.transport, this.log = fe("gamification-background"), 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(Ce.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, 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) => {
1238
- this.log.debug({ item: r }, "received question"), r?.questionId ? (this.questionSubscription = po(r.questionId, e.transport), this.questionSubscription.addListener("feed-subscription-opened-question", (n) => {
1239
- this.openedQuestion.updateExtendedQuestion(n.data?.attributes?.question);
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(() => {
1300
+ });
1301
+ await a.get().promise;
1302
+ const l = await cr(i.id, this.transport);
1303
+ u(), window.requestAnimationFrame(() => {
1304
+ a.invalidate();
1305
+ }), this.betPack.getStore().mutate({
1306
+ ...o,
1307
+ [i.id]: l
1308
+ });
1309
+ }
1310
+ }
1240
1311
  }), this.questionSubscription.connect()) : (this.log.info("cleanup on close question"), this.questionSubscription !== void 0 && (e.transport.removeSubscription(this.questionSubscription), this.questionSubscription = void 0));
1241
1312
  })), this.feedSubscription = fo(this.slStreamId, e.transport), this.cancels.add(this.feedSubscription.addListener("bet-pack-update", async (r) => {
1242
1313
  const n = r.data?.attributes?.question;
1243
1314
  if (n?.type === I.PREDICTION) {
1244
1315
  const i = this.betPack.getValues().data || {};
1245
1316
  if (i?.[n.id] || Object.keys(i).length < 5) {
1246
- const s = wt(n.id, this.transport), a = s.subscribe(() => {
1317
+ const s = nt(n.id, this.transport), a = s.subscribe(() => {
1247
1318
  });
1248
1319
  await s.get().promise;
1249
1320
  let u = s.get().data;
1250
- u || (u = await Vn(n.id, this.transport)), a(), window.requestAnimationFrame(() => {
1321
+ u || (u = await cr(n.id, this.transport)), a(), window.requestAnimationFrame(() => {
1251
1322
  s.invalidate();
1252
1323
  }), this.betPack.getStore().mutate({
1253
1324
  ...i,
@@ -1328,7 +1399,7 @@ class Ao {
1328
1399
  this.openedQuestionId.set(void 0), e && this.notifications.markAsViewed(this.getCurrentSessionId({ prefix: "notification", entity: e }));
1329
1400
  };
1330
1401
  }
1331
- class Eo {
1402
+ class Oo {
1332
1403
  notificationsList;
1333
1404
  store;
1334
1405
  timeouts;
@@ -1337,7 +1408,7 @@ class Eo {
1337
1408
  options;
1338
1409
  logger;
1339
1410
  constructor(e) {
1340
- this.options = e, this.logger = fe("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());
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());
1341
1412
  }
1342
1413
  addToQueue = (e) => {
1343
1414
  if (this.store.has(e.id)) {
@@ -1381,9 +1452,10 @@ class Eo {
1381
1452
  this.logger.debug({ notificationId: e }, "active queue tick skipped, notification not exist");
1382
1453
  return;
1383
1454
  }
1384
- M.emit("notification", {
1455
+ B.emit("notification", {
1385
1456
  action: "received",
1386
1457
  payload: {
1458
+ type: r.type,
1387
1459
  questionId: r.data.questionId,
1388
1460
  questionType: r.data.questionType
1389
1461
  }
@@ -1406,9 +1478,10 @@ class Eo {
1406
1478
  const s = new Map(this.notificationsList.get());
1407
1479
  s.delete(e), this.notificationsList.set(s);
1408
1480
  const a = this.timeouts.get(e);
1409
- a !== void 0 && (clearTimeout(a), this.timeouts.delete(e)), this.logger.debug({ notificationId: e }, "notification hidden"), i.hiding && M.emit("notification", {
1481
+ a !== void 0 && (clearTimeout(a), this.timeouts.delete(e)), this.logger.debug({ notificationId: e }, "notification hidden"), i.hiding && B.emit("notification", {
1410
1482
  action: "closed",
1411
1483
  payload: {
1484
+ type: i.type,
1412
1485
  questionId: i.data.questionId,
1413
1486
  questionType: i.data.questionType
1414
1487
  }
@@ -1426,7 +1499,7 @@ var Et;
1426
1499
  (function(t) {
1427
1500
  t.OPENED = "opened";
1428
1501
  })(Et || (Et = {}));
1429
- class Io extends We {
1502
+ class To extends We {
1430
1503
  constructor() {
1431
1504
  super("notification");
1432
1505
  }
@@ -1438,15 +1511,11 @@ class Io extends We {
1438
1511
  this.clear();
1439
1512
  };
1440
1513
  }
1441
- var Ee;
1442
- (function(t) {
1443
- t[t.ONBOARDING = 1] = "ONBOARDING", t[t.QUESTION = 2] = "QUESTION", t[t.QUESTION_RESOLVED = 3] = "QUESTION_RESOLVED";
1444
- })(Ee || (Ee = {}));
1445
- class Oo {
1514
+ class _o {
1446
1515
  queue;
1447
1516
  storage;
1448
1517
  constructor(e = {}) {
1449
- this.storage = new Io(), this.queue = new Eo({ concurrency: 1, animationDelay: 1600, ...e });
1518
+ this.storage = new To(), this.queue = new Oo({ concurrency: 1, animationDelay: 1600, ...e });
1450
1519
  }
1451
1520
  isViewed = (e) => this.storage.isOpened(e);
1452
1521
  add = (e) => {
@@ -1454,7 +1523,7 @@ class Oo {
1454
1523
  if (e.data && e.emitEvent) {
1455
1524
  const n = e.action;
1456
1525
  e.action = (...i) => {
1457
- n && n(...i), M.emit("notification", {
1526
+ n && n(...i), B.emit("notification", {
1458
1527
  action: "opened",
1459
1528
  payload: {
1460
1529
  questionId: e.data.questionId,
@@ -1474,7 +1543,7 @@ class Oo {
1474
1543
  if (!e?.size)
1475
1544
  return null;
1476
1545
  for (const n of e.values())
1477
- if (n.type === Ee.ONBOARDING)
1546
+ if (n.type === Ae.ONBOARDING)
1478
1547
  return n;
1479
1548
  return e.values().next().value;
1480
1549
  };
@@ -1483,56 +1552,28 @@ class Oo {
1483
1552
  this.storage.setOpened(e);
1484
1553
  };
1485
1554
  }
1486
- const To = (t, e, r) => {
1487
- t.notifications = new Oo(void 0), t.addNotification = t.notifications.add, t.sdk.getNotificationsStore = () => t.notifications.getQueueStore(), t.sdk.getActiveNotification = () => t.notifications.getActiveNotification(), t.sdk.onMount({ name: "notifications" }, () => () => {
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" }, () => () => {
1488
1557
  t.notifications.queue.drain();
1489
1558
  }), r();
1490
1559
  };
1491
- var nt;
1560
+ var it;
1492
1561
  (function(t) {
1493
1562
  t.UNKNOWN = "unknown", t.ALREADY_VOTED = "already_voted";
1494
- })(nt || (nt = {}));
1495
- const _o = async (t, e) => {
1563
+ })(it || (it = {}));
1564
+ const Co = async (t, e) => {
1496
1565
  const { client: r, createRequestOptions: n } = t.createPromiseClient(ee, { method: "submitAnswer" }), i = n({ retryAttempts: 0 });
1497
1566
  try {
1498
1567
  return await r.submitAnswer({ data: e }, { contextValues: i });
1499
1568
  } catch (o) {
1500
- throw rt.from(o)?.code === oe.AlreadyExists ? new Error(nt.ALREADY_VOTED) : new Error(nt.UNKNOWN);
1569
+ throw rt.from(o)?.code === oe.AlreadyExists ? new Error(it.ALREADY_VOTED) : new Error(it.UNKNOWN);
1501
1570
  }
1502
- }, Lo = (t, e) => {
1571
+ }, Bn = (t, e) => {
1503
1572
  const { client: r, createRequestOptions: n } = t.createPromiseClient(ee, { method: "submitInplay" }), i = n({ retryAttempts: 0 });
1504
1573
  return r.submitInplay({ data: { eventId: +e } }, { contextValues: i });
1505
- };
1506
- var je;
1507
- (function(t) {
1508
- t.ONBOARDING = "onboarding", t.ONBOARDING_IO = "onboarding_io";
1509
- })(je || (je = {}));
1510
- class Co extends We {
1511
- constructor() {
1512
- super("gamification-session", window.sessionStorage);
1513
- }
1514
- writeValue = (e, r) => {
1515
- this.write(...e, r);
1516
- };
1517
- readValue = (e) => this.read(...e);
1518
- }
1519
- class Mn extends We {
1520
- sessionStorage;
1521
- constructor() {
1522
- super("gamification"), this.sessionStorage = new Co();
1523
- }
1524
- saveOnboardingStatus = ({ userId: e, eventId: r, organizationId: n }, i) => {
1525
- this.write(je.ONBOARDING, n, e, r, i);
1526
- };
1527
- getOnboardingStatus = ({ userId: e, eventId: r, organizationId: n }) => this.read(je.ONBOARDING, n, e, r);
1528
- setOnboardingInstantOpen = ({ userId: e, eventId: r, organizationId: n }) => {
1529
- this.sessionStorage.writeValue([je.ONBOARDING_IO, n, e, r], "1");
1530
- };
1531
- getOnboardingInstantOpen = ({ userId: e, eventId: r, organizationId: n }) => this.sessionStorage.readValue([je.ONBOARDING_IO, n, e, r]);
1532
- }
1533
- const Po = {
1574
+ }, Po = {
1534
1575
  pageSize: 10
1535
- }, ko = (t, e, r, n, i) => {
1576
+ }, Lo = (t, e, r, n, i) => {
1536
1577
  let o = 0;
1537
1578
  const s = q({ pageSize: Po.pageSize, page: 0 }), a = Z({
1538
1579
  data: [],
@@ -1541,7 +1582,7 @@ const Po = {
1541
1582
  loading: void 0,
1542
1583
  error: void 0
1543
1584
  }), u = so(t), l = async () => {
1544
- const p = e.get(), v = n.getStore().get().data?.map((w) => w.slId) || [];
1585
+ const p = e.get(), v = n?.getStore().get().data?.map((w) => w.slId) || [];
1545
1586
  if (p && v?.length) {
1546
1587
  const w = r.get();
1547
1588
  w && v.push(w), a.setKey("loading", !0), a.setKey("data", []);
@@ -1565,10 +1606,10 @@ const Po = {
1565
1606
  const v = s.get(), w = p || v.page + 1;
1566
1607
  w <= o && s.set({ ...v, page: w });
1567
1608
  };
1568
- return Sr(a, () => {
1569
- const p = e.listen(l), v = n.listen(l);
1609
+ return wr(a, () => {
1610
+ const p = e.listen(l), v = n?.listen(l);
1570
1611
  return () => {
1571
- p(), v();
1612
+ p(), v?.();
1572
1613
  };
1573
1614
  }), { $store: a, fetchMore: f, invalidate: c };
1574
1615
  };
@@ -1580,44 +1621,44 @@ class No extends We {
1580
1621
  super("deep-link-context", window.sessionStorage);
1581
1622
  }
1582
1623
  }
1583
- const Jr = "sldl", Ft = "sldl_uid", Bn = "sldl_eid", qn = "sldl_e_eid", Fo = /* @__PURE__ */ new Set([Ft, Bn, qn]), Xr = (t) => {
1624
+ const Xr = "sldl", Ft = "sldl_uid", Mn = "sldl_eid", qn = "sldl_e_eid", Fo = /* @__PURE__ */ new Set([Ft, Mn, qn]), Zr = (t) => {
1584
1625
  const e = {}, r = {};
1585
1626
  for (const [n, i] of t)
1586
1627
  Fo.has(n) ? e[n] = i : r[n] = i;
1587
1628
  return { result: e, remain: r };
1588
1629
  }, Do = ({ hash: t, search: e }) => {
1589
- if (t && t.includes(Jr)) {
1630
+ if (t && t.includes(Xr)) {
1590
1631
  const r = new URLSearchParams(t.substr(1));
1591
- return { hash: Xr(r) };
1632
+ return { hash: Zr(r) };
1592
1633
  }
1593
- if (e && e.includes(Jr)) {
1634
+ if (e && e.includes(Xr)) {
1594
1635
  const r = new URLSearchParams(e);
1595
- return { search: Xr(r) };
1636
+ return { search: Zr(r) };
1596
1637
  }
1597
1638
  return null;
1598
- }, Zr = fe("deep_link"), de = {
1639
+ }, en = pe("deep_link"), fe = {
1599
1640
  debug: (...t) => {
1600
- Zr.debug(...t), localStorage.getItem("SL_DEBUG") && console.log(...t);
1641
+ en.debug(...t), localStorage.getItem("SL_DEBUG") && console.log(...t);
1601
1642
  },
1602
1643
  trace: (...t) => {
1603
- Zr.trace(...t), localStorage.getItem("SL_DEBUG") && console.log(...t);
1644
+ en.trace(...t), localStorage.getItem("SL_DEBUG") && console.log(...t);
1604
1645
  }
1605
1646
  }, Ro = (t, e) => {
1606
1647
  const { hash: r, search: n } = window.location;
1607
- if (de.debug({ hash: r, search: n }, "get deep link data from"), r || n) {
1648
+ if (fe.debug({ hash: r, search: n }, "get deep link data from"), r || n) {
1608
1649
  const i = Do({ hash: r, search: n });
1609
- if (de.debug(i, "parse deep link result"), i) {
1650
+ if (fe.debug(i, "parse deep link result"), i) {
1610
1651
  const { hash: o, search: s } = i, { result: a, remain: u } = o || s;
1611
1652
  if (Object.keys(a).length !== 0) {
1612
1653
  t.setValue("data", a);
1613
1654
  const l = Object.keys(u).length !== 0;
1614
1655
  if (o) {
1615
1656
  let c = "";
1616
- l && (c = `#${new URLSearchParams(u).toString()}`, de.debug({ updatedHash: c }, "update hash")), window.history.replaceState(null, "", window.location.pathname + window.location.search + 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);
1617
1658
  }
1618
1659
  if (s) {
1619
1660
  let c = "";
1620
- l && (c = `?${new URLSearchParams(u).toString()}`, de.debug({ updatedSearch: c }, "update search")), window.history.replaceState(null, "", window.location.pathname + c + window.location.hash);
1661
+ l && (c = `?${new URLSearchParams(u).toString()}`, fe.debug({ updatedSearch: c }, "update search")), window.history.replaceState(null, "", window.location.pathname + c + window.location.hash);
1621
1662
  }
1622
1663
  e(a);
1623
1664
  }
@@ -1631,17 +1672,17 @@ const Jr = "sldl", Ft = "sldl_uid", Bn = "sldl_eid", qn = "sldl_e_eid", Fo = /*
1631
1672
  try {
1632
1673
  o = JSON.parse(i);
1633
1674
  } catch (a) {
1634
- de.debug(a);
1675
+ fe.debug(a);
1635
1676
  }
1636
1677
  t.deepLink = {
1637
- $store: new Le(Z(o), "deep-link-context"),
1678
+ $store: new Ce(Z(o), "deep-link-context"),
1638
1679
  getDeepLinkData: () => {
1639
1680
  const { data: a, used: u } = t.deepLink.$store.getValues();
1640
1681
  return { data: a, used: u };
1641
1682
  },
1642
1683
  // we are logged in with inviter id
1643
1684
  deepLinkUsed: (a) => {
1644
- de.debug(`logged in with inviterId: ${a}`), t.deepLink.$store.setValue("used", !0);
1685
+ fe.debug(`logged in with inviterId: ${a}`), t.deepLink.$store.setValue("used", !0);
1645
1686
  },
1646
1687
  onDeepLinkHandlers: /* @__PURE__ */ new Set()
1647
1688
  }, t.sdk.getInviter = () => {
@@ -1650,22 +1691,22 @@ const Jr = "sldl", Ft = "sldl_uid", Bn = "sldl_eid", qn = "sldl_e_eid", Fo = /*
1650
1691
  }, t.sdk.inviteDisplayed = () => {
1651
1692
  t.deepLink.$store.getStore().set({}), t.deepLink.$store.getStore().off(), n.del("sl-deep-link-store");
1652
1693
  }, t.deepLink.$store.subscribe((a) => n.set("sl-deep-link-store", JSON.stringify(a))), t.sdk.addDeepLinkHandler = (a) => {
1653
- localStorage.getItem("SL_DEBUG") && de.trace("adding deep link handler"), t.deepLink.onDeepLinkHandlers.add(a);
1694
+ localStorage.getItem("SL_DEBUG") && fe.trace("adding deep link handler"), t.deepLink.onDeepLinkHandlers.add(a);
1654
1695
  }, e.onDeepLinkHandled && t.sdk.addDeepLinkHandler(e.onDeepLinkHandled), t.sdk.removeDeepLinkHandler = (a) => {
1655
- de.trace("removing deep link handler"), t.deepLink.onDeepLinkHandlers.delete(a);
1696
+ fe.trace("removing deep link handler"), t.deepLink.onDeepLinkHandlers.delete(a);
1656
1697
  };
1657
1698
  const s = (a) => {
1658
- t.deepLink.$store.setValue("handled", !0), de.trace({ size: t.deepLink.onDeepLinkHandlers.size }, "deep link handled, call callbacks");
1699
+ t.deepLink.$store.setValue("handled", !0), fe.trace({ size: t.deepLink.onDeepLinkHandlers.size }, "deep link handled, call callbacks");
1659
1700
  for (const u of t.deepLink.onDeepLinkHandlers)
1660
1701
  try {
1661
- de.trace("called handler"), u(a);
1702
+ fe.trace("called handler"), u(a);
1662
1703
  } catch (l) {
1663
1704
  console.error(l);
1664
1705
  }
1665
1706
  };
1666
1707
  Ro(t.deepLink.$store, s), r();
1667
- }, $o = fe("bypass");
1668
- class Mo extends Vi {
1708
+ }, $o = pe("bypass");
1709
+ class Bo extends Vi {
1669
1710
  $coreStore;
1670
1711
  deepLink;
1671
1712
  transport;
@@ -1699,14 +1740,14 @@ class Mo extends Vi {
1699
1740
  * Logout user. Clears the all user data from the store.
1700
1741
  */
1701
1742
  logout = () => {
1702
- this.$coreStore.getValues().user.setValue(), this.$coreStore.getValues().userKey.setValue(), this.$coreStore.getValues().userToken.setValue(), this.transport.setAuth("", ""), new Ue().clear();
1743
+ this.$coreStore.getValues().user.setValue(), this.$coreStore.getValues().userKey.setValue(), this.$coreStore.getValues().userToken.setValue(), this.transport.setAuth("", ""), new je().clear();
1703
1744
  };
1704
1745
  /**
1705
1746
  * Soft logout, only clears the StreamLayer user data from the store.
1706
1747
  * Does not clear the external token. And automatically tries to re-login by external token.
1707
1748
  */
1708
1749
  softLogout = () => {
1709
- const e = new Ue();
1750
+ const e = new je();
1710
1751
  this.transport.setAuth("", ""), e.setToken(""), this.reLogin();
1711
1752
  };
1712
1753
  /**
@@ -1717,7 +1758,7 @@ class Mo extends Vi {
1717
1758
  * - If no one of the above is true, then logout.
1718
1759
  */
1719
1760
  reLogin = ({ skipLogin: e } = { skipLogin: !1 }) => {
1720
- const r = new Ue(), n = r.getToken(), i = r.getExternalToken();
1761
+ const r = new je(), n = r.getToken(), i = r.getExternalToken();
1721
1762
  if (this.$coreStore.getValues().userKey.setValue(i), n)
1722
1763
  return this.saveUser(n, ""), this.me().then((o) => {
1723
1764
  if (o?.id) {
@@ -1737,7 +1778,7 @@ class Mo extends Vi {
1737
1778
  * Write token to the Transport and UserStore
1738
1779
  */
1739
1780
  saveUser = (e, r) => {
1740
- this.transport.setAuth(e, r), this.$coreStore.getValues().userToken.setValue(e), new Ue().setToken(e);
1781
+ this.transport.setAuth(e, r), this.$coreStore.getValues().userToken.setValue(e), new je().setToken(e);
1741
1782
  };
1742
1783
  /**
1743
1784
  * Add interceptor to the Transport to handle 401 and 403 errors.
@@ -1753,9 +1794,9 @@ class Mo extends Vi {
1753
1794
  });
1754
1795
  };
1755
1796
  }
1756
- const Xe = new Ue(), Bo = (t, e, r) => {
1757
- t.auth = new Mo(t.store, t.transport, t.deepLink), t.stores.status.listen((n) => {
1758
- n === be.READY && t.auth.reLogin();
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) => {
1799
+ n === ve.READY && t.auth.reLogin();
1759
1800
  }), t.sdk.userId = t.stores.user.getAtomStore, t.sdk.authorizationBypass = async (n, i) => {
1760
1801
  if (!(Xe.getSchema() === n && Xe.getExternalToken() === i && t.transport.getHeader("authorization")))
1761
1802
  try {
@@ -1766,24 +1807,24 @@ const Xe = new Ue(), Bo = (t, e, r) => {
1766
1807
  }, t.sdk.logout = () => {
1767
1808
  t.auth.logout(), Xe.clear();
1768
1809
  }, t.sdk.getUserStore = () => t.stores.user.getStore(), t.sdk.isUserAuthorized = () => t.auth.isAuthenticated(), r();
1769
- }, en = fe("video_player"), ft = {
1810
+ }, tn = pe("video_player"), pt = {
1770
1811
  debug: (...t) => {
1771
- en.debug(...t), localStorage.getItem("SL_DEBUG") && console.log(...t);
1812
+ tn.debug(...t), localStorage.getItem("SL_DEBUG") && console.log(...t);
1772
1813
  },
1773
1814
  trace: (...t) => {
1774
- en.trace(...t), localStorage.getItem("SL_DEBUG") && console.log(...t);
1815
+ tn.trace(...t), localStorage.getItem("SL_DEBUG") && console.log(...t);
1775
1816
  }
1776
1817
  }, qo = (t, e, r) => {
1777
1818
  t.videoPlayer = {
1778
1819
  controllers: /* @__PURE__ */ new Set()
1779
1820
  }, t.sdk.addVideoPlayerController = (n) => {
1780
- ft.trace("adding video player controller"), t.videoPlayer.controllers.add(n);
1821
+ pt.trace("adding video player controller"), t.videoPlayer.controllers.add(n);
1781
1822
  }, e.videoPlayerController && t.sdk.addVideoPlayerController(e.videoPlayerController), t.sdk.removeVideoPlayerController = (n) => {
1782
- ft.trace("removing video player controller"), t.videoPlayer.controllers.delete(n);
1823
+ pt.trace("removing video player controller"), t.videoPlayer.controllers.delete(n);
1783
1824
  }, t.sdk.controlVideoPlayer = (n) => {
1784
- ft.trace("controlling video player");
1825
+ pt.trace("controlling video player");
1785
1826
  for (const i of t.videoPlayer.controllers) {
1786
- ft.trace("calling video player controller");
1827
+ pt.trace("calling video player controller");
1787
1828
  try {
1788
1829
  i(n);
1789
1830
  } catch (o) {
@@ -1805,6 +1846,12 @@ const Xe = new Ue(), Bo = (t, e, r) => {
1805
1846
  disableAppNotification: function() {
1806
1847
  t.sdk.uiState.get().app || t.sdk.uiState.setKey("appNotification", !1);
1807
1848
  },
1849
+ enableOnboardingNotification: function() {
1850
+ t.sdk.uiState.setKey("onboardingNotification", !0);
1851
+ },
1852
+ disableOnboardingNotification: function() {
1853
+ t.sdk.uiState.setKey("onboardingNotification", !1);
1854
+ },
1808
1855
  enableApp: function() {
1809
1856
  t.sdk.uiState.set({
1810
1857
  app: !0,
@@ -1814,6 +1861,7 @@ const Xe = new Ue(), Bo = (t, e, r) => {
1814
1861
  disableApp: function() {
1815
1862
  t.sdk.uiState.set({
1816
1863
  ...t.sdk.uiState.get(),
1864
+ onboardingNotification: !1,
1817
1865
  appNotification: !1,
1818
1866
  app: !1
1819
1867
  });
@@ -1829,15 +1877,27 @@ const Xe = new Ue(), Bo = (t, e, r) => {
1829
1877
  }
1830
1878
  }, t.sdk.onMount({ name: "ui" }, () => {
1831
1879
  const i = (a) => {
1832
- if (a.slEventBus?.type === "notification")
1833
- switch (a.slEventBus.action) {
1834
- case "received":
1835
- t.ui.enableAppNotification();
1836
- break;
1837
- case "closed":
1838
- t.ui.disableAppNotification();
1839
- break;
1840
- }
1880
+ if (a.slEventBus?.type === "notification") {
1881
+ const u = a.slEventBus.action;
1882
+ if (a.slEventBus.payload.type === Ae.ONBOARDING)
1883
+ switch (u) {
1884
+ case "received":
1885
+ t.ui.enableOnboardingNotification();
1886
+ break;
1887
+ case "closed":
1888
+ t.ui.disableOnboardingNotification();
1889
+ break;
1890
+ }
1891
+ else
1892
+ switch (u) {
1893
+ case "received":
1894
+ t.ui.enableAppNotification();
1895
+ break;
1896
+ case "closed":
1897
+ t.ui.disableAppNotification();
1898
+ break;
1899
+ }
1900
+ }
1841
1901
  if (a.slEventBus?.type === "advertisement" && e.withAd) {
1842
1902
  const u = a.slEventBus, { hasNotification: l, hasBanner: c, id: f, isViewed: p, type: v } = u.payload;
1843
1903
  switch (u.action) {
@@ -1860,6 +1920,7 @@ const Xe = new Ue(), Bo = (t, e, r) => {
1860
1920
  }), !e.withAdNotification) {
1861
1921
  t.sdk.uiState.set({
1862
1922
  promotionBanner: c,
1923
+ onboardingNotification: t.sdk.uiState.get().onboardingNotification,
1863
1924
  promotionOverlay: !0,
1864
1925
  promotionSidebar: !0,
1865
1926
  promotionExternalAd: v === U.EXTERNAL_AD
@@ -1867,8 +1928,10 @@ const Xe = new Ue(), Bo = (t, e, r) => {
1867
1928
  break;
1868
1929
  }
1869
1930
  l ? t.sdk.uiState.set({
1931
+ onboardingNotification: t.sdk.uiState.get().onboardingNotification,
1870
1932
  promotionNotification: !0
1871
1933
  }) : t.sdk.uiState.set({
1934
+ onboardingNotification: t.sdk.uiState.get().onboardingNotification,
1872
1935
  promotionBanner: c,
1873
1936
  promotionOverlay: !0,
1874
1937
  promotionSidebar: !0,
@@ -1893,7 +1956,7 @@ const Xe = new Ue(), Bo = (t, e, r) => {
1893
1956
  break;
1894
1957
  }
1895
1958
  }
1896
- }, o = M.listen(i), s = t.activeFeature.subscribe((a) => {
1959
+ }, o = B.listen(i), s = t.activeFeature.subscribe((a) => {
1897
1960
  a ? (t.ui.enableApp(), t.sdk.uiState.set({ app: !0 })) : t.ui.disableApp();
1898
1961
  });
1899
1962
  return () => {
@@ -1915,20 +1978,20 @@ const Xe = new Ue(), Bo = (t, e, r) => {
1915
1978
  }, t.sdk.initializeApp = async (s) => {
1916
1979
  if (t.contextConfig = s, t.stores.enabled.get() === "on")
1917
1980
  return { enabled: !0 };
1918
- t.storeSubscribe(), t.stores.enabled.setValue("on"), t.stores.status.setValue(be.INITIALIZATION);
1981
+ t.storeSubscribe(), t.stores.enabled.setValue("on"), t.stores.status.setValue(ve.INITIALIZATION);
1919
1982
  try {
1920
1983
  const a = await t.stores.organizationSettings.getValue();
1921
- return a ? (t.stores.status.setValue(be.READY), { enabled: !!a }) : (t.stores.status.setValue(be.FAILED), { err: "failed" });
1984
+ return a ? (t.stores.status.setValue(ve.READY), { enabled: !!a }) : (t.stores.status.setValue(ve.FAILED), { err: "failed" });
1922
1985
  } catch (a) {
1923
- return t.stores.enabled.setValue(), t.stores.status.setValue(be.FAILED), { err: `${a}` };
1986
+ return t.stores.enabled.setValue(), t.stores.status.setValue(ve.FAILED), { err: `${a}` };
1924
1987
  }
1925
1988
  }, t.sdk.disableApp = () => {
1926
- t.stores.enabled.get() === "on" && (t.stores.enabled.setValue(), t.stores.status.setValue(be.DISABLED), t.stores.slStreamId.setValue(), t.stores.providerStreamId.setValue(), t.sdk.closeFeature(!0), t.storeUnsubscribe(), t.transport.disconnect());
1989
+ t.stores.enabled.get() === "on" && (t.stores.enabled.setValue(), t.stores.status.setValue(ve.DISABLED), t.stores.slStreamId.setValue(), t.stores.providerStreamId.setValue(), t.sdk.closeFeature(!0), t.storeUnsubscribe(), t.transport.disconnect());
1927
1990
  }, t.sdk.createEventSession = (s) => {
1928
1991
  t.stores.providerStreamId.setValue(s);
1929
1992
  }, r();
1930
1993
  }, Qo = (t, e) => {
1931
- const { client: r, queryKey: n } = t.createPromiseClient(it, {
1994
+ const { client: r, queryKey: n } = t.createPromiseClient(ot, {
1932
1995
  method: "generateDeepLink",
1933
1996
  params: e
1934
1997
  });
@@ -1951,24 +2014,24 @@ const Xe = new Ue(), Bo = (t, e, r) => {
1951
2014
  }, Go = (t, { web: e, mobile: r }) => {
1952
2015
  const { client: n } = t.createPromiseClient(_i, { method: "generate" });
1953
2016
  return n.generate({ web: e, mobile: r });
1954
- }, tn = (t, e) => {
2017
+ }, rn = (t, e) => {
1955
2018
  const r = new URLSearchParams(t);
1956
2019
  for (const [n, i] of Object.entries(e))
1957
2020
  r.append(n, i);
1958
2021
  return r.toString();
1959
2022
  }, Ko = (t, e, r, n) => {
1960
2023
  const i = Z({});
1961
- return Sr(i, () => Qo(t, [e, r]).subscribe(async ({ data: a, loading: u }) => {
2024
+ return wr(i, () => Qo(t, [e, r]).subscribe(async ({ data: a, loading: u }) => {
1962
2025
  const l = a === void 0 && u === !1 ? "https://streamlayer.io" : a?.url, c = n.get() || "", f = e.get() || "", p = r.get() || "", v = {
1963
2026
  [Ft]: c,
1964
- [Bn]: f,
2027
+ [Mn]: f,
1965
2028
  [qn]: p
1966
2029
  };
1967
2030
  if (!u && l) {
1968
2031
  i.setKey("loading", !0);
1969
- let w = window.location.search, b = window.location.hash;
1970
- w && b || b ? w = `?${tn(w, v)}` : b = `#${tn("", v)}`;
1971
- const g = window.location.origin + window.location.pathname + w + b;
2032
+ let w = window.location.search, m = window.location.hash;
2033
+ w && m || m ? w = `?${rn(w, v)}` : m = `#${rn("", v)}`;
2034
+ const g = window.location.origin + window.location.pathname + w + m;
1972
2035
  try {
1973
2036
  const S = await Go(t, { web: g, mobile: l });
1974
2037
  i.set({
@@ -1986,14 +2049,14 @@ const Xe = new Ue(), Bo = (t, e, r) => {
1986
2049
  i.setKey("loading", !0);
1987
2050
  })), { $store: i, fetch };
1988
2051
  };
1989
- var B;
2052
+ var $;
1990
2053
  (function(t) {
1991
2054
  t.Unset = "unset", t.Required = "required", t.Optional = "optional", t.Completed = "completed", t.Disabled = "disabled", t.Unavailable = "unavailable";
1992
- })(B || (B = {}));
2055
+ })($ || ($ = {}));
1993
2056
  const zo = (t, e, r, n) => {
1994
2057
  const { inplayGame: i } = t.featureSettings.get(), o = e.getCurrentSessionId({ prefix: "onboarding" });
1995
2058
  i && r.add({
1996
- type: Ee.ONBOARDING,
2059
+ type: Ae.ONBOARDING,
1997
2060
  id: o,
1998
2061
  action: t.openFeature,
1999
2062
  close: () => {
@@ -2014,64 +2077,70 @@ const zo = (t, e, r, n) => {
2014
2077
  }
2015
2078
  }
2016
2079
  });
2017
- }, pt = (t, e, r, n, i, o) => {
2080
+ }, ht = (t, e, r, n, i, o, s, a) => {
2018
2081
  try {
2019
- const s = e.userId.get();
2020
- if (!s)
2082
+ const u = e.userId.get(), l = e.organizationId.get(), c = e.slStreamId.get();
2083
+ if (!u || !l || !c)
2021
2084
  return;
2022
- if (i.getOnboardingStatus({
2023
- userId: s,
2024
- organizationId: e.organizationId.get() || "",
2025
- eventId: e.slStreamId.get() || ""
2026
- }) === B.Completed) {
2027
- t.set(B.Completed);
2028
- for (const p of o)
2029
- p();
2085
+ const f = i.getOnboardingStatus({
2086
+ userId: u,
2087
+ organizationId: l,
2088
+ eventId: c
2089
+ });
2090
+ if (f === $.Completed || a?.skipOnboarding) {
2091
+ t.set($.Completed);
2092
+ for (const g of o)
2093
+ g();
2094
+ a?.skipOnboarding && f !== $.Completed && (i.saveOnboardingStatus({
2095
+ organizationId: l,
2096
+ userId: u,
2097
+ eventId: c
2098
+ }, $.Completed), Bn(s, e.slStreamId.get() || ""));
2030
2099
  return;
2031
2100
  }
2032
- const u = e.moderation.getStore().value?.data, l = r.featureSettings.get().inplayGame;
2033
- if (u === void 0 || l === void 0)
2101
+ const p = e.moderation.getStore().value?.data, v = r.featureSettings.get().inplayGame;
2102
+ if (p === void 0 || v === void 0)
2034
2103
  return;
2035
- const c = u?.options?.onboardingEnabled, f = l?.titleCard?.optIn;
2036
- c ? f ? t.set(B.Required) : t.set(B.Optional) : (f ? t.set(B.Unavailable) : t.set(B.Disabled), n.close(e.getCurrentSessionId({ prefix: "onboarding" }), { markAsViewed: !1 }));
2037
- } catch (s) {
2038
- console.error(s);
2039
- }
2040
- }, Ho = (t, e, r, n) => {
2041
- let i = !1;
2042
- const o = new Mn(), s = q(B.Unset);
2043
- s.subscribe((l) => {
2044
- l !== B.Unset && (l === B.Optional || l === B.Required ? i === !1 && (zo(t, e, n, o), i = !0) : t.onboardingProcessed.set(!0), l === B.Completed && e.activeQuestionId.invalidate(), o.setOnboardingInstantOpen({
2104
+ const w = p?.options?.onboardingEnabled, m = v?.titleCard?.optIn;
2105
+ w ? m ? t.set($.Required) : t.set($.Optional) : (m ? t.set($.Unavailable) : t.set($.Disabled), n.close(e.getCurrentSessionId({ prefix: "onboarding" }), { markAsViewed: !1 }));
2106
+ } catch (u) {
2107
+ console.error(u);
2108
+ }
2109
+ }, Ho = (t, e, r, n, i) => {
2110
+ let o = !!i?.skipOnboarding;
2111
+ const s = e.storage, a = q($.Unset);
2112
+ 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({
2045
2114
  userId: e.userId.get() || "",
2046
2115
  organizationId: e.organizationId.get() || "",
2047
2116
  eventId: e.slStreamId.get() || ""
2048
2117
  }));
2049
2118
  });
2050
- const a = [];
2051
- return pt(s, e, t, n, o, a), s.get() !== B.Completed && (a.push(e.userId.listen((l) => {
2052
- l && pt(s, e, t, n, o, a);
2053
- })), a.push(e.moderation.listen((l) => {
2054
- l.data && pt(s, e, t, n, o, a);
2055
- })), a.push(t.featureSettings.listen((l) => {
2056
- l && pt(s, e, t, n, o, a);
2057
- }))), { $store: s, submitInplay: async () => {
2058
- const l = e.slStreamId.get();
2059
- if (l) {
2060
- await Lo(r, l), s.set(B.Completed), o.saveOnboardingStatus({
2119
+ const u = [];
2120
+ return a.get() !== $.Completed && (u.push(e.userId.listen((c) => {
2121
+ c && ht(a, e, t, n, s, u, r, i);
2122
+ })), u.push(e.moderation.listen((c) => {
2123
+ c.data && ht(a, e, t, n, s, u, r, i);
2124
+ })), u.push(t.featureSettings.listen((c) => {
2125
+ c && ht(a, e, t, n, s, u, r, i);
2126
+ }))), ht(a, e, t, n, s, u, r, i), { $store: a, submitInplay: async () => {
2127
+ const c = e.slStreamId.get();
2128
+ if (c) {
2129
+ await Bn(r, c), a.set($.Completed), s.saveOnboardingStatus({
2061
2130
  organizationId: e.organizationId.get() || "",
2062
2131
  userId: e.userId.get() || "",
2063
- eventId: l
2064
- }, B.Completed), M.emit("poll", {
2132
+ eventId: c
2133
+ }, $.Completed), B.emit("poll", {
2065
2134
  action: "onboardingPassed",
2066
2135
  payload: {}
2067
2136
  }), t.openFeature();
2068
- const c = e.getCurrentSessionId({ prefix: "onboarding" });
2069
- n.close(c);
2137
+ const f = e.getCurrentSessionId({ prefix: "onboarding" });
2138
+ n.close(f);
2070
2139
  }
2071
2140
  } };
2072
2141
  }, Wo = (t, e, r, n) => {
2073
- const i = Z(void 0), o = Rn(n), s = async () => {
2074
- const u = t.get(), l = e.get(), c = r.getStore().get().data?.map((v) => v.slId);
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) : [];
2075
2144
  if (!c)
2076
2145
  return;
2077
2146
  const f = {
@@ -2083,21 +2152,22 @@ const zo = (t, e, r, n) => {
2083
2152
  }, a = () => {
2084
2153
  s();
2085
2154
  };
2086
- return Sr(i, () => {
2087
- const u = t.listen(s), l = r.listen(s), c = e.listen(s);
2155
+ return wr(i, () => {
2156
+ a();
2157
+ const u = t.listen(s), l = r?.listen(s), c = e.listen(s);
2088
2158
  return () => {
2089
- u(), l(), c();
2159
+ u(), l?.(), c();
2090
2160
  };
2091
2161
  }), { $store: i, invalidate: a };
2092
2162
  }, Yo = async (t, e, r, n, i) => {
2093
- const o = Rn(i), s = t.get(), a = e.get(), u = r.getStore().get().data?.map((p) => p.slId) || [], l = {
2163
+ const o = Vn(i), s = t.get(), a = e.get(), u = r?.getStore().get().data?.map((p) => p.slId) || [], l = {
2094
2164
  eventId: s,
2095
2165
  userId: n,
2096
2166
  usersIds: [...u, a]
2097
2167
  };
2098
2168
  return (await o(l)).data?.attributes?.summary;
2099
2169
  }, Jo = /* @__PURE__ */ new Set([I.POLL, I.PREDICTION, I.TRIVIA]);
2100
- class Xo extends Fn {
2170
+ class Xo extends Dn {
2101
2171
  /** user statistics (leaderboard panel) */
2102
2172
  userSummary;
2103
2173
  /** feed list (pick history) */
@@ -2137,10 +2207,17 @@ class Xo extends Fn {
2137
2207
  cancels = /* @__PURE__ */ new Set();
2138
2208
  onQuestionActivate;
2139
2209
  constructor(e, r, n) {
2140
- super(e, r), this.background = new Ao(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 = new Mn(), this.feedList = this.background.feedList, this.betPack = this.background.betPack, this.friends = new se(ao(this.background.userId, n.transport), "gamification:friends"), this.currentUserId = this.background.userId, this.openedUser = q(void 0), 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), 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), this.leaderboardList = ko(this.transport, this.background.slStreamId, this.background.userId, this.friends), this.connect(), this.cancels.add(this.userSummary.$store.listen((i, o) => {
2141
- o?.summary && i?.summary && this.leaderboardList.invalidate();
2142
- })), 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) => {
2143
- (o === void 0 || i !== B.Unset) && this.background.activeQuestionId.invalidate();
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);
2215
+ this.cancels.add(this.userSummary.$store.listen((o, s) => {
2216
+ s?.summary && o?.summary && i.invalidate();
2217
+ }));
2218
+ }
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) => {
2220
+ (o === void 0 || i !== $.Unset) && this.background.activeQuestionId.invalidate();
2144
2221
  })), this.background.activeQuestionId.listen(this.showInApp), this.friendsTabEnabled = q(!1), this.cancels.add(n.sdk.options.subscribe((i) => {
2145
2222
  i.friendsTab === "disabled" ? this.friendsTabEnabled.set(!1) : i.friendsTab === "enabled" && this.friendsTabEnabled.set(!0);
2146
2223
  })), this.cancels.add(this.settings.subscribe((i) => {
@@ -2151,11 +2228,11 @@ class Xo extends Fn {
2151
2228
  });
2152
2229
  }
2153
2230
  get isInteractiveAllowed() {
2154
- return this.background.interactiveAllowed.get() === Ce.ALLOWED;
2231
+ return this.background.interactiveAllowed.get() === Pe.ALLOWED;
2155
2232
  }
2156
2233
  checkInteractiveFlag = () => {
2157
- const e = this.onboardingStatus.$store.get(), r = this.background.moderation.getStore().value?.data?.options?.onboardingEnabled, n = this.settings.getValues().inplayGame?.titleCard?.optIn, i = e === B.Completed, o = !r || i || n !== !0;
2158
- this.background.interactiveAllowed.set(o ? Ce.ALLOWED : Ce.DISALLOWED);
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);
2159
2236
  };
2160
2237
  connect = () => {
2161
2238
  this.onboardingProcessed.subscribe((e) => {
@@ -2172,13 +2249,13 @@ class Xo extends Fn {
2172
2249
  prefix: `notification-id:${s}`
2173
2250
  }), l = [...this.feedList.getValues().data || []], c = l.findIndex((z) => z.id === s), f = l[c];
2174
2251
  let p = f?.attributes?.attributes?.value?.answerId;
2175
- const v = wt(s, this.transport), w = v.subscribe(() => {
2252
+ const v = nt(s, this.transport), w = v.subscribe(() => {
2176
2253
  });
2177
2254
  await v.get().promise;
2178
- let b = v.get().data;
2179
- b || (b = await Vn(s, this.transport)), w(), window.requestAnimationFrame(() => {
2255
+ let m = v.get().data;
2256
+ m || (m = await cr(s, this.transport)), w(), window.requestAnimationFrame(() => {
2180
2257
  v.invalidate();
2181
- }), p || (p = b?.answers.find(({ youVoted: z }) => z)?.id);
2258
+ }), p || (p = m?.answers.find(({ youVoted: z }) => z)?.id);
2182
2259
  const g = a.find(({ correct: z }) => z), S = p ? a.find(({ id: z }) => z === p) : void 0, F = !!S?.correct;
2183
2260
  if (f && l[c]?.attributes?.attributes.case === "question") {
2184
2261
  try {
@@ -2190,7 +2267,7 @@ class Xo extends Fn {
2190
2267
  if (!S || !g)
2191
2268
  return;
2192
2269
  this.openedQuestionId.get()?.questionId !== r.id && this.notifications.add({
2193
- type: Ee.QUESTION_RESOLVED,
2270
+ type: Ae.QUESTION_RESOLVED,
2194
2271
  action: () => this.openQuestion(r.id, n),
2195
2272
  close: () => this.closeQuestion(s),
2196
2273
  autoHideDuration: F ? 15e3 : 12e3,
@@ -2261,7 +2338,7 @@ class Xo extends Fn {
2261
2338
  }
2262
2339
  });
2263
2340
  }
2264
- i === -1 && (r.unshift(n), M.emit("poll", {
2341
+ i === -1 && (r.unshift(n), B.emit("poll", {
2265
2342
  action: "received",
2266
2343
  payload: {
2267
2344
  questionId: n.id,
@@ -2277,30 +2354,24 @@ class Xo extends Fn {
2277
2354
  };
2278
2355
  betPackVote = async (e, r) => {
2279
2356
  await this.submitAnswer(e, r);
2280
- const n = { ...this.betPack.getValues().data }, i = n?.[e];
2281
- i && (i.answers = n[e].answers.map((o) => o.id === r ? {
2282
- ...o,
2283
- youVoted: !0
2284
- } : o), M.emit("poll", {
2357
+ const i = { ...this.betPack.getValues().data }?.[e];
2358
+ i && B.emit("poll", {
2285
2359
  action: "voted",
2286
2360
  payload: {
2287
2361
  questionId: e,
2288
2362
  questionType: i.type
2289
2363
  }
2290
- }), this.betPack.getStore().mutate({
2291
- ...n,
2292
- [e]: i
2293
- }));
2364
+ });
2294
2365
  };
2295
2366
  submitAnswer = async (e, r) => {
2296
- const n = wt(e, this.transport), i = n.subscribe(() => {
2367
+ const n = nt(e, this.transport), i = n.subscribe(() => {
2297
2368
  }), o = { ...n.get().data || {} }, s = () => {
2298
2369
  const a = this.feedList.getValues().data;
2299
2370
  if (!a)
2300
2371
  return;
2301
2372
  const u = a.findIndex((f) => f.id === e), l = a[u], c = l?.attributes?.attributes.case === "question" && l.attributes.attributes.value;
2302
2373
  if (c) {
2303
- M.emit("poll", {
2374
+ B.emit("poll", {
2304
2375
  action: "voted",
2305
2376
  payload: {
2306
2377
  questionId: e,
@@ -2309,8 +2380,8 @@ class Xo extends Fn {
2309
2380
  });
2310
2381
  const f = n.get().data;
2311
2382
  if (i(), f) {
2312
- const p = f.answers.find((g) => g.correct === !0), v = f.answers.findIndex((g) => g.id === r), w = f.answers[v], b = f.answers.every(({ percentageDecimal: g }, S) => g === o?.answers[S].percentageDecimal);
2313
- 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, b && f.answers.forEach((g) => {
2383
+ 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
+ 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) => {
2314
2385
  g.percentageDecimal = 0;
2315
2386
  }), p?.id === r && (f.answers[v].pointsEarned = f.status === Y.RESOLVED ? 0 : p.points), n.mutate({ ...f });
2316
2387
  }
@@ -2320,9 +2391,9 @@ class Xo extends Fn {
2320
2391
  }
2321
2392
  };
2322
2393
  try {
2323
- await _o(this.transport, { questionId: e, answerId: r }), s();
2394
+ await Co(this.transport, { questionId: e, answerId: r }), s();
2324
2395
  } catch (a) {
2325
- if (a.message === nt.ALREADY_VOTED) {
2396
+ if (a.message === it.ALREADY_VOTED) {
2326
2397
  this.userSummary.invalidate();
2327
2398
  const u = n.subscribe(() => {
2328
2399
  });
@@ -2342,14 +2413,20 @@ class Xo extends Fn {
2342
2413
  animateHiding: !1
2343
2414
  });
2344
2415
  let n = r?.attributes?.type;
2345
- return n || (n = (this.feedList.getStore().value?.data || []).find((o) => o.id === e)?.attributes?.type), M.emit("poll", {
2416
+ n || (n = (this.feedList.getStore().value?.data || []).find((s) => s.id === e)?.attributes?.type);
2417
+ const i = {
2418
+ eventId: this.background.slStreamId.get() || "",
2419
+ userId: this.background.userId.get() || "",
2420
+ organizationId: this.background.organizationId.get() || ""
2421
+ };
2422
+ return this.storage.isQuestionOpened(i, e) || (B.emit("poll", {
2346
2423
  action: "opened",
2347
2424
  payload: {
2348
2425
  questionId: e,
2349
2426
  questionType: n,
2350
2427
  questionOpenedFrom: r?.openedFrom
2351
2428
  }
2352
- }), this.openFeature(), this.background.openQuestion(e, r);
2429
+ }), this.storage.saveQuestionOpened(i, e)), this.openFeature(), this.background.openQuestion(e, r);
2353
2430
  };
2354
2431
  getFeedItem = (e) => lo(e, this.transport);
2355
2432
  isOpenedQuestion = (e) => !!this.notifications.isViewed(e);
@@ -2362,26 +2439,28 @@ class Xo extends Fn {
2362
2439
  }))
2363
2440
  }), this.background.closeQuestion(e));
2364
2441
  openUser = async (e) => {
2365
- const r = this.leaderboardList.$store.get().data?.find((i) => i.userId === e);
2442
+ if (!this.leaderboardList)
2443
+ return;
2444
+ const r = this.leaderboardList?.$store.get().data?.find((i) => i.userId === e);
2366
2445
  if (!r) {
2367
- this.openedUser.set(r);
2446
+ this.openedUser?.set(r);
2368
2447
  return;
2369
2448
  }
2370
2449
  if (r.summaryLoaded) {
2371
- this.openedUser.set(r);
2450
+ this.openedUser?.set(r);
2372
2451
  return;
2373
2452
  }
2374
2453
  const n = { ...r };
2375
2454
  try {
2376
2455
  const i = await Yo(this.background.slStreamId, this.background.userId, this.friends, e, this.transport);
2377
- i?.inTop !== void 0 && (this.leaderboardList.$store.setKey("data", this.leaderboardList.$store.get().data?.map((o) => (o.userId === e && (o.inTop = i.inTop), o))), n.inTop = i.inTop);
2456
+ i?.inTop !== void 0 && (this.leaderboardList?.$store.setKey("data", this.leaderboardList.$store.get().data?.map((o) => (o.userId === e && (o.inTop = i.inTop), o))), n.inTop = i.inTop);
2378
2457
  } catch (i) {
2379
2458
  console.error(i);
2380
2459
  }
2381
2460
  this.openedUser.set(n);
2382
2461
  };
2383
2462
  closeUser = () => {
2384
- this.openedUser.set(void 0);
2463
+ this.openedUser?.set(void 0);
2385
2464
  };
2386
2465
  /**
2387
2466
  * Show in-app notification for active question
@@ -2391,10 +2470,10 @@ class Xo extends Fn {
2391
2470
  */
2392
2471
  showInApp = (e) => {
2393
2472
  const r = this.onboardingStatus.$store.get();
2394
- if (e && e.data && r && r !== B.Unset && e.data.question?.id !== void 0 && e.data.question?.bypassNotifications?.inAppSilence !== Ai.ON && e.data.question.status === Y.ACTIVE && !e.data.question.marketClosed) {
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) {
2395
2474
  if (Jo.has(e.data.question.type))
2396
2475
  this.isInteractiveAllowed && e.data.question.notification !== void 0 && this.notifications.add({
2397
- type: Ee.QUESTION,
2476
+ type: Ae.QUESTION,
2398
2477
  action: () => this.openQuestion(e.data?.question?.id, e.data?.feedItem),
2399
2478
  close: () => this.closeQuestion(e.data?.question?.id),
2400
2479
  autoHideDuration: 1e3 * 60,
@@ -2433,7 +2512,7 @@ class Xo extends Fn {
2433
2512
  }
2434
2513
  };
2435
2514
  this.notifications.add({
2436
- type: Ee.QUESTION,
2515
+ type: Ae.QUESTION,
2437
2516
  action: () => this.openQuestion(e?.data?.question?.id, e?.data?.feedItem),
2438
2517
  close: () => this.closeQuestion(e?.data?.question?.id),
2439
2518
  autoHideDuration: 1e3 * 120,
@@ -2474,7 +2553,7 @@ class Xo extends Fn {
2474
2553
  tweetMedia: i
2475
2554
  };
2476
2555
  this.notifications.add({
2477
- type: Ee.QUESTION,
2556
+ type: Ae.QUESTION,
2478
2557
  action: () => this.openQuestion(e.data?.question?.id, e.data?.feedItem),
2479
2558
  close: () => this.closeQuestion(e.data?.question?.id),
2480
2559
  autoHideDuration: 1e3 * 120,
@@ -2498,7 +2577,7 @@ class Xo extends Fn {
2498
2577
  const Zo = {
2499
2578
  [R.GAMES]: !0
2500
2579
  };
2501
- class es extends Fn {
2580
+ class es extends Dn {
2502
2581
  constructor(e, r) {
2503
2582
  super(e, r);
2504
2583
  }
@@ -2513,7 +2592,7 @@ const ts = (t, e, r) => t.type === R.GAMES ? new Xo(t, e, r) : new es(t, e), rs
2513
2592
  const o = t.sdk.featuresList.getValue();
2514
2593
  o && o.delete(i), t.sdk.featuresList.setValue(o);
2515
2594
  }
2516
- }, t.initFeature = (n, i = ge.ORGANIZATION) => {
2595
+ }, t.initFeature = (n, i = be.ORGANIZATION) => {
2517
2596
  if (n.type in Zo && !t.features.has(n.type)) {
2518
2597
  const o = ts(n, i, t);
2519
2598
  t.features.set(n.type, o);
@@ -2530,12 +2609,12 @@ const ts = (t, e, r) => t.type === R.GAMES ? new Xo(t, e, r) : new es(t, e), rs
2530
2609
  const n = await t.stores.organizationSettings.getValue();
2531
2610
  t.features.clear(), t.sdk.featuresList.setValue(/* @__PURE__ */ new Set());
2532
2611
  for (const i of n?.overlays || [])
2533
- t.initFeature(i, ge.ORGANIZATION);
2612
+ t.initFeature(i, be.ORGANIZATION);
2534
2613
  }, t.stores.providerStreamId.listen((n) => {
2535
2614
  n || t.reinitializeFeatures();
2536
2615
  }), t.storeSubscribe = () => {
2537
2616
  const n = (o, s) => {
2538
- if (s?.overlays && !(t.contextConfig?.skipOrganizationSettings && o === ge.ORGANIZATION))
2617
+ if (s?.overlays && !(t.contextConfig?.skipOrganizationSettings && o === be.ORGANIZATION))
2539
2618
  for (const a of s.overlays)
2540
2619
  a.sdkEnable === !0 && (t.features.has(a.type) ? t.updateFeature(a, o) : t.initFeature(a, o));
2541
2620
  }, i = {
@@ -2551,7 +2630,7 @@ const ts = (t, e, r) => t.type === R.GAMES ? new Xo(t, e, r) : new es(t, e), rs
2551
2630
  organizationSettings: (o) => {
2552
2631
  if (o.data)
2553
2632
  try {
2554
- n(ge.ORGANIZATION, o.data);
2633
+ n(be.ORGANIZATION, o.data);
2555
2634
  } catch (s) {
2556
2635
  console.log(s);
2557
2636
  }
@@ -2559,7 +2638,7 @@ const ts = (t, e, r) => t.type === R.GAMES ? new Xo(t, e, r) : new es(t, e), rs
2559
2638
  streamSettings: (o) => {
2560
2639
  if (o.data)
2561
2640
  try {
2562
- n(ge.STREAM, o.data);
2641
+ n(be.STREAM, o.data);
2563
2642
  } catch (s) {
2564
2643
  console.log(s);
2565
2644
  }
@@ -2580,7 +2659,7 @@ class ns {
2580
2659
  break;
2581
2660
  }
2582
2661
  };
2583
- return M.listen(r);
2662
+ return B.listen(r);
2584
2663
  });
2585
2664
  }
2586
2665
  accepted = () => {
@@ -2590,7 +2669,7 @@ class ns {
2590
2669
  kind: G.INVITATION_ACCEPTED
2591
2670
  },
2592
2671
  category: Mr.GAMES,
2593
- from: Br.UNSET
2672
+ from: qr.UNSET
2594
2673
  });
2595
2674
  };
2596
2675
  sent = ({ from: e }) => {
@@ -2600,7 +2679,7 @@ class ns {
2600
2679
  kind: G.INVITATION_SENT
2601
2680
  },
2602
2681
  category: Mr.GAMES,
2603
- from: e || Br.UNSET
2682
+ from: e || qr.UNSET
2604
2683
  });
2605
2684
  };
2606
2685
  }
@@ -2619,7 +2698,7 @@ class is {
2619
2698
  break;
2620
2699
  }
2621
2700
  };
2622
- return M.listen(r);
2701
+ return B.listen(r);
2623
2702
  });
2624
2703
  }
2625
2704
  tap = () => {
@@ -2628,7 +2707,7 @@ class is {
2628
2707
  ...this.analytics.commonStore.getValues(),
2629
2708
  kind: G.INTERACTIONS
2630
2709
  },
2631
- actionType: Kr.TAP
2710
+ actionType: zr.TAP
2632
2711
  });
2633
2712
  };
2634
2713
  scroll = () => {
@@ -2637,7 +2716,7 @@ class is {
2637
2716
  ...this.analytics.commonStore.getValues(),
2638
2717
  kind: G.INTERACTIONS
2639
2718
  },
2640
- actionType: Kr.SCROLL
2719
+ actionType: zr.SCROLL
2641
2720
  });
2642
2721
  };
2643
2722
  }
@@ -2654,14 +2733,14 @@ const os = {
2654
2733
  [U.SHOP_LBAR]: J.PROMOTION_SHOP_LBAR,
2655
2734
  [U.SHOP_OVERLAY]: J.PROMOTION_SHOP_OVERLAY,
2656
2735
  [U.SHOP_SIDEBAR]: J.PROMOTION_SHOP_SIDEBAR
2657
- }, cr = (t) => t ? os[t] : J.UNSET;
2736
+ }, dr = (t) => t ? os[t] : J.UNSET;
2658
2737
  class ss {
2659
2738
  analytics;
2660
2739
  constructor(e) {
2661
2740
  this.analytics = e, this.analytics.onConnect(() => {
2662
2741
  const r = (n) => {
2663
2742
  if (!n.slEventBus?.skipAnalytics && n.slEventBus?.type === "advertisement") {
2664
- const i = cr(n.slEventBus.payload.type);
2743
+ const i = dr(n.slEventBus.payload.type);
2665
2744
  switch (n.slEventBus.action) {
2666
2745
  case "videoPlay":
2667
2746
  this.videoPlay(n.slEventBus.payload, { topicSubType: i });
@@ -2684,7 +2763,7 @@ class ss {
2684
2763
  }
2685
2764
  }
2686
2765
  };
2687
- return M.listen(r);
2766
+ return B.listen(r);
2688
2767
  });
2689
2768
  }
2690
2769
  received = ({ id: e }, { topicSubType: r }) => {
@@ -2769,7 +2848,7 @@ const et = {
2769
2848
  [I.TRIVIA]: Q.POLLS_TRIVIA,
2770
2849
  [I.TWEET]: Q.POLLS_TWITTER
2771
2850
  };
2772
- I.UNSET + "", ye.UNSET, I.FACTOID + "", ye.POLLS, I.POLL + "", ye.POLLS, I.PREDICTION + "", ye.POLLS, I.PROMOTION + "", ye.POLLS, I.TRIVIA + "", ye.POLLS, I.TWEET + "", ye.POLLS;
2851
+ 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;
2773
2852
  const as = {
2774
2853
  [R.UNSET]: H.UNSET,
2775
2854
  [R.INPLAY]: H.INPLAY,
@@ -2810,19 +2889,19 @@ class us {
2810
2889
  this.received({
2811
2890
  questionId: n.slEventBus.payload.id,
2812
2891
  questionType: I.PROMOTION,
2813
- topicSubType: cr(n.slEventBus.payload.type)
2892
+ topicSubType: dr(n.slEventBus.payload.type)
2814
2893
  });
2815
2894
  break;
2816
2895
  case "notification-opened":
2817
2896
  this.opened({
2818
2897
  questionId: n.slEventBus.payload.id,
2819
2898
  questionType: I.PROMOTION,
2820
- topicSubType: cr(n.slEventBus.payload.type)
2899
+ topicSubType: dr(n.slEventBus.payload.type)
2821
2900
  });
2822
2901
  break;
2823
2902
  }
2824
2903
  };
2825
- return M.listen(r);
2904
+ return B.listen(r);
2826
2905
  });
2827
2906
  }
2828
2907
  received = ({ questionId: e, questionType: r, topicSubType: n }) => {
@@ -2834,8 +2913,8 @@ class us {
2834
2913
  topicType: r ? et[r] : Q.UNSET,
2835
2914
  topicSubType: n
2836
2915
  },
2837
- notificationKind: ye.POLLS,
2838
- notificationType: zr.IN_APP
2916
+ notificationKind: me.POLLS,
2917
+ notificationType: Hr.IN_APP
2839
2918
  });
2840
2919
  };
2841
2920
  opened = ({ questionId: e, questionType: r, topicSubType: n }) => {
@@ -2847,8 +2926,8 @@ class us {
2847
2926
  topicType: r ? et[r] : Q.UNSET,
2848
2927
  topicSubType: n
2849
2928
  },
2850
- notificationKind: ye.POLLS,
2851
- notificationType: zr.IN_APP
2929
+ notificationKind: me.POLLS,
2930
+ notificationType: Hr.IN_APP
2852
2931
  });
2853
2932
  };
2854
2933
  }
@@ -2876,7 +2955,7 @@ class cs {
2876
2955
  break;
2877
2956
  }
2878
2957
  };
2879
- return M.listen(r);
2958
+ return B.listen(r);
2880
2959
  });
2881
2960
  }
2882
2961
  // event when a poll is received from subscription or active question request
@@ -2936,9 +3015,9 @@ class cs {
2936
3015
  });
2937
3016
  };
2938
3017
  }
2939
- const ls = ({ transport: t, $commonStore: e }) => {
3018
+ const ds = ({ transport: t, $commonStore: e }) => {
2940
3019
  let r;
2941
- const n = q(!1), i = 5e3, { client: o, queryKey: s } = t.createPromiseClient(Ln, {
3020
+ const n = q(!1), i = 5e3, { client: o, queryKey: s } = t.createPromiseClient(Cn, {
2942
3021
  method: "send",
2943
3022
  params: [n]
2944
3023
  }), a = t.nanoquery.createFetcherStore(s, {
@@ -2957,24 +3036,24 @@ const ls = ({ transport: t, $commonStore: e }) => {
2957
3036
  }
2958
3037
  });
2959
3038
  } catch (v) {
2960
- ve.error(v, "send heartbeat failed");
3039
+ Se.error(v, "send heartbeat failed");
2961
3040
  }
2962
3041
  return Date.now();
2963
3042
  },
2964
3043
  refetchInterval: i
2965
3044
  }), u = () => {
2966
- ve.debug("mounted heartbeat"), r = a.subscribe(() => {
3045
+ Se.debug("mounted heartbeat"), r = a.subscribe(() => {
2967
3046
  });
2968
3047
  }, l = () => {
2969
- ve.debug("enabled heartbeat"), n.set(!0), a.lc === 0 && u();
3048
+ Se.debug("enabled heartbeat"), n.set(!0), a.lc === 0 && u();
2970
3049
  }, c = () => {
2971
- ve.debug("disabled heartbeat"), n.set(!1);
3050
+ Se.debug("disabled heartbeat"), n.set(!1);
2972
3051
  };
2973
3052
  return { enable: l, disable: c, mount: u, unmount: () => {
2974
- ve.debug("unmounted heartbeat"), a.off(), r?.(), r = void 0, c();
3053
+ Se.debug("unmounted heartbeat"), a.off(), r?.(), r = void 0, c();
2975
3054
  } };
2976
- }, ve = fe("analytics");
2977
- class ds {
3055
+ }, Se = pe("analytics");
3056
+ class ls {
2978
3057
  commonStore;
2979
3058
  notifications;
2980
3059
  polls;
@@ -2987,23 +3066,23 @@ class ds {
2987
3066
  listenersCancels;
2988
3067
  connected = !1;
2989
3068
  constructor(e) {
2990
- this.listeners = /* @__PURE__ */ new Set(), this.listenersCancels = /* @__PURE__ */ new Set(), this.commonStore = new Le(Z({}), "common-analytics"), this.connectToSDK(e), this.heartbeat = ls({ 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);
2991
- const { client: r } = e.analyticsTransport.createPromiseClient(Ln, {
3069
+ 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, {
2992
3071
  method: "send"
2993
3072
  });
2994
3073
  this.analyticsClient = r;
2995
3074
  }
2996
3075
  connect = () => {
2997
- this.writeCommon("sessionId", or()), this.heartbeat.enable(), this.listeners.forEach((e) => this.listenersCancels.add(e())), this.connected = !0, ve.debug("analytics connected");
3076
+ this.writeCommon("sessionId", or()), this.heartbeat.enable(), this.listeners.forEach((e) => this.listenersCancels.add(e())), this.connected = !0, Se.debug("analytics connected");
2998
3077
  };
2999
3078
  disconnect = () => {
3000
- this.writeCommon("sessionId", ""), this.writeCommon("overlaySessionId", ""), this.heartbeat.unmount(), this.listenersCancels.forEach((e) => e()), this.connected = !1, ve.debug("analytics disconnected");
3079
+ this.writeCommon("sessionId", ""), this.writeCommon("overlaySessionId", ""), this.heartbeat.unmount(), this.listenersCancels.forEach((e) => e()), this.connected = !1, Se.debug("analytics disconnected");
3001
3080
  };
3002
3081
  write = (e, r) => {
3003
3082
  r && this.analyticsClient.unary({ message: { case: e, value: r } }).then(() => {
3004
- ve.trace("send analytics success", e, r);
3083
+ Se.trace("send analytics success", e, r);
3005
3084
  }).catch((n) => {
3006
- ve.error(n, "send analytics failed");
3085
+ Se.error(n, "send analytics failed");
3007
3086
  });
3008
3087
  };
3009
3088
  writeCommon = (e, r) => {
@@ -3020,7 +3099,7 @@ class ds {
3020
3099
  r && this.writeCommon("category", as[r]), r !== R.UNSET ? this.writeCommon("overlaySessionId", or()) : this.writeCommon("overlaySessionId", "");
3021
3100
  })), this.onConnect(() => {
3022
3101
  const r = window.matchMedia("(orientation: portrait)"), n = (i) => {
3023
- this.writeCommon("screenOrientation", i.matches ? Gr.PORTRAIT : Gr.LANDSCAPE);
3102
+ this.writeCommon("screenOrientation", i.matches ? Kr.PORTRAIT : Kr.LANDSCAPE);
3024
3103
  };
3025
3104
  return r.addEventListener("change", n), () => {
3026
3105
  r.removeEventListener("change", n);
@@ -3031,15 +3110,15 @@ class ds {
3031
3110
  };
3032
3111
  }
3033
3112
  const fs = (t, e, r) => {
3034
- t.analytics = new ds(t), t.sdk.onMount({ name: "analytics" }, () => (t.analytics.connect(), () => {
3113
+ t.analytics = new ls(t), t.sdk.onMount({ name: "analytics" }, () => (t.analytics.connect(), () => {
3035
3114
  t.analytics.disconnect();
3036
3115
  })), r();
3037
3116
  };
3038
- var Ar = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
3117
+ var Er = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
3039
3118
  function ps(t) {
3040
3119
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
3041
3120
  }
3042
- var Er = { exports: {} }, Ir = { exports: {} };
3121
+ var Ir = { exports: {} }, Or = { exports: {} };
3043
3122
  function hs(t) {
3044
3123
  var e = new t(), r = e;
3045
3124
  function n() {
@@ -3059,7 +3138,7 @@ function Un(t, e, r) {
3059
3138
  if (typeof t == "function" && (r = e, e = t, t = null), !(r >= 1))
3060
3139
  throw new Error("fastqueue concurrency must be equal to or greater than 1");
3061
3140
  var n = ms(gs), i = null, o = null, s = 0, a = null, u = {
3062
- push: b,
3141
+ push: m,
3063
3142
  drain: te,
3064
3143
  saturated: te,
3065
3144
  pause: c,
@@ -3067,10 +3146,10 @@ function Un(t, e, r) {
3067
3146
  get concurrency() {
3068
3147
  return r;
3069
3148
  },
3070
- set concurrency(k) {
3071
- if (!(k >= 1))
3149
+ set concurrency(L) {
3150
+ if (!(L >= 1))
3072
3151
  throw new Error("fastqueue concurrency must be equal to or greater than 1");
3073
- if (r = k, !u.paused)
3152
+ if (r = L, !u.paused)
3074
3153
  for (; i && s < r; )
3075
3154
  s++, S();
3076
3155
  },
@@ -3093,13 +3172,13 @@ function Un(t, e, r) {
3093
3172
  u.paused = !0;
3094
3173
  }
3095
3174
  function f() {
3096
- for (var k = i, V = 0; k; )
3097
- k = k.next, V++;
3175
+ for (var L = i, V = 0; L; )
3176
+ L = L.next, V++;
3098
3177
  return V;
3099
3178
  }
3100
3179
  function p() {
3101
- for (var k = i, V = []; k; )
3102
- V.push(k.value), k = k.next;
3180
+ for (var L = i, V = []; L; )
3181
+ V.push(L.value), L = L.next;
3103
3182
  return V;
3104
3183
  }
3105
3184
  function v() {
@@ -3115,16 +3194,16 @@ function Un(t, e, r) {
3115
3194
  function w() {
3116
3195
  return s === 0 && u.length() === 0;
3117
3196
  }
3118
- function b(k, V) {
3197
+ function m(L, V) {
3119
3198
  var _ = n.get();
3120
- _.context = t, _.release = S, _.value = k, _.callback = V || te, _.errorHandler = a, s >= r || u.paused ? o ? (o.next = _, o = _) : (i = _, o = _, u.saturated()) : (s++, e.call(t, _.value, _.worked));
3199
+ _.context = t, _.release = S, _.value = L, _.callback = V || te, _.errorHandler = a, s >= r || u.paused ? o ? (o.next = _, o = _) : (i = _, o = _, u.saturated()) : (s++, e.call(t, _.value, _.worked));
3121
3200
  }
3122
- function g(k, V) {
3201
+ function g(L, V) {
3123
3202
  var _ = n.get();
3124
- _.context = t, _.release = S, _.value = k, _.callback = V || te, _.errorHandler = a, s >= r || u.paused ? i ? (_.next = i, i = _) : (i = _, o = _, u.saturated()) : (s++, e.call(t, _.value, _.worked));
3203
+ _.context = t, _.release = S, _.value = L, _.callback = V || te, _.errorHandler = a, s >= r || u.paused ? i ? (_.next = i, i = _) : (i = _, o = _, u.saturated()) : (s++, e.call(t, _.value, _.worked));
3125
3204
  }
3126
- function S(k) {
3127
- k && n.release(k);
3205
+ function S(L) {
3206
+ L && n.release(L);
3128
3207
  var V = i;
3129
3208
  V && s <= r ? u.paused ? s-- : (o === i && (o = null), i = V.next, V.next = null, e.call(t, V.value, V.worked), o === null && u.empty()) : --s === 0 && u.drain();
3130
3209
  }
@@ -3134,8 +3213,8 @@ function Un(t, e, r) {
3134
3213
  function z() {
3135
3214
  i = null, o = null, u.drain(), u.drain = te;
3136
3215
  }
3137
- function ne(k) {
3138
- a = k;
3216
+ function ne(L) {
3217
+ a = L;
3139
3218
  }
3140
3219
  }
3141
3220
  function te() {
@@ -3159,24 +3238,24 @@ function bs(t, e, r) {
3159
3238
  return i.push = a, i.unshift = u, i.drained = l, i;
3160
3239
  function a(c) {
3161
3240
  var f = new Promise(function(p, v) {
3162
- o(c, function(w, b) {
3241
+ o(c, function(w, m) {
3163
3242
  if (w) {
3164
3243
  v(w);
3165
3244
  return;
3166
3245
  }
3167
- p(b);
3246
+ p(m);
3168
3247
  });
3169
3248
  });
3170
3249
  return f.catch(te), f;
3171
3250
  }
3172
3251
  function u(c) {
3173
3252
  var f = new Promise(function(p, v) {
3174
- s(c, function(w, b) {
3253
+ s(c, function(w, m) {
3175
3254
  if (w) {
3176
3255
  v(w);
3177
3256
  return;
3178
3257
  }
3179
- p(b);
3258
+ p(m);
3180
3259
  });
3181
3260
  });
3182
3261
  return f.catch(te), f;
@@ -3194,14 +3273,14 @@ function bs(t, e, r) {
3194
3273
  return f;
3195
3274
  }
3196
3275
  }
3197
- Ir.exports = Un;
3198
- Ir.exports.promise = bs;
3199
- var jn = Ir.exports, Or = { exports: {} }, Ge = typeof Reflect == "object" ? Reflect : null, rn = Ge && typeof Ge.apply == "function" ? Ge.apply : function(e, r, n) {
3276
+ Or.exports = Un;
3277
+ 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) {
3200
3279
  return Function.prototype.apply.call(e, r, n);
3201
- }, yt;
3202
- Ge && typeof Ge.ownKeys == "function" ? yt = Ge.ownKeys : Object.getOwnPropertySymbols ? yt = function(e) {
3280
+ }, mt;
3281
+ Ge && typeof Ge.ownKeys == "function" ? mt = Ge.ownKeys : Object.getOwnPropertySymbols ? mt = function(e) {
3203
3282
  return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e));
3204
- } : yt = function(e) {
3283
+ } : mt = function(e) {
3205
3284
  return Object.getOwnPropertyNames(e);
3206
3285
  };
3207
3286
  function vs(t) {
@@ -3213,13 +3292,13 @@ var xn = Number.isNaN || function(e) {
3213
3292
  function N() {
3214
3293
  N.init.call(this);
3215
3294
  }
3216
- Or.exports = N;
3217
- Or.exports.once = Es;
3295
+ Tr.exports = N;
3296
+ Tr.exports.once = Es;
3218
3297
  N.EventEmitter = N;
3219
3298
  N.prototype._events = void 0;
3220
3299
  N.prototype._eventsCount = 0;
3221
3300
  N.prototype._maxListeners = void 0;
3222
- var nn = 10;
3301
+ var on = 10;
3223
3302
  function Dt(t) {
3224
3303
  if (typeof t != "function")
3225
3304
  throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof t);
@@ -3227,12 +3306,12 @@ function Dt(t) {
3227
3306
  Object.defineProperty(N, "defaultMaxListeners", {
3228
3307
  enumerable: !0,
3229
3308
  get: function() {
3230
- return nn;
3309
+ return on;
3231
3310
  },
3232
3311
  set: function(t) {
3233
3312
  if (typeof t != "number" || t < 0 || xn(t))
3234
3313
  throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + t + ".");
3235
- nn = t;
3314
+ on = t;
3236
3315
  }
3237
3316
  });
3238
3317
  N.init = function() {
@@ -3267,10 +3346,10 @@ N.prototype.emit = function(e) {
3267
3346
  if (u === void 0)
3268
3347
  return !1;
3269
3348
  if (typeof u == "function")
3270
- rn(u, this, r);
3349
+ nn(u, this, r);
3271
3350
  else
3272
3351
  for (var l = u.length, c = Wn(u, l), n = 0; n < l; ++n)
3273
- rn(c[n], this, r);
3352
+ nn(c[n], this, r);
3274
3353
  return !0;
3275
3354
  };
3276
3355
  function Gn(t, e, r, n) {
@@ -3378,7 +3457,7 @@ function Hn(t) {
3378
3457
  return 0;
3379
3458
  }
3380
3459
  N.prototype.eventNames = function() {
3381
- return this._eventsCount > 0 ? yt(this._events) : [];
3460
+ return this._eventsCount > 0 ? mt(this._events) : [];
3382
3461
  };
3383
3462
  function Wn(t, e) {
3384
3463
  for (var r = new Array(e), n = 0; n < e; ++n)
@@ -3419,7 +3498,7 @@ function Yn(t, e, r, n) {
3419
3498
  else
3420
3499
  throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof t);
3421
3500
  }
3422
- var Jn = Or.exports, Rt = {}, Xn = {}, Zn = function() {
3501
+ var Jn = Tr.exports, Rt = {}, Xn = {}, Zn = function() {
3423
3502
  if (typeof Symbol != "function" || typeof Object.getOwnPropertySymbols != "function")
3424
3503
  return !1;
3425
3504
  if (typeof Symbol.iterator == "symbol")
@@ -3444,20 +3523,20 @@ var Jn = Or.exports, Rt = {}, Xn = {}, Zn = function() {
3444
3523
  return !0;
3445
3524
  }, Os = Zn, Vt = function() {
3446
3525
  return Os() && !!Symbol.toStringTag;
3447
- }, Ts = Error, _s = EvalError, Ls = RangeError, Cs = ReferenceError, ei = SyntaxError, $t = TypeError, Ps = URIError, on = typeof Symbol < "u" && Symbol, ks = Zn, Ns = function() {
3448
- return typeof on != "function" || typeof Symbol != "function" || typeof on("foo") != "symbol" || typeof Symbol("bar") != "symbol" ? !1 : ks();
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();
3449
3528
  }, jt = {
3450
3529
  __proto__: null,
3451
3530
  foo: {}
3452
3531
  }, Fs = Object, Ds = function() {
3453
3532
  return { __proto__: jt }.foo === jt.foo && !(jt instanceof Fs);
3454
- }, Rs = "Function.prototype.bind called on incompatible ", Vs = Object.prototype.toString, $s = Math.max, Ms = "[object Function]", sn = function(e, r) {
3533
+ }, Rs = "Function.prototype.bind called on incompatible ", Vs = Object.prototype.toString, $s = Math.max, Bs = "[object Function]", an = function(e, r) {
3455
3534
  for (var n = [], i = 0; i < e.length; i += 1)
3456
3535
  n[i] = e[i];
3457
3536
  for (var o = 0; o < r.length; o += 1)
3458
3537
  n[o + e.length] = r[o];
3459
3538
  return n;
3460
- }, Bs = function(e, r) {
3539
+ }, Ms = function(e, r) {
3461
3540
  for (var n = [], i = r, o = 0; i < e.length; i += 1, o += 1)
3462
3541
  n[o] = e[i];
3463
3542
  return n;
@@ -3467,19 +3546,19 @@ var Jn = Or.exports, Rt = {}, Xn = {}, Zn = function() {
3467
3546
  return r;
3468
3547
  }, Us = function(e) {
3469
3548
  var r = this;
3470
- if (typeof r != "function" || Vs.apply(r) !== Ms)
3549
+ if (typeof r != "function" || Vs.apply(r) !== Bs)
3471
3550
  throw new TypeError(Rs + r);
3472
- for (var n = Bs(arguments, 1), i, o = function() {
3551
+ for (var n = Ms(arguments, 1), i, o = function() {
3473
3552
  if (this instanceof i) {
3474
3553
  var c = r.apply(
3475
3554
  this,
3476
- sn(n, arguments)
3555
+ an(n, arguments)
3477
3556
  );
3478
3557
  return Object(c) === c ? c : this;
3479
3558
  }
3480
3559
  return r.apply(
3481
3560
  e,
3482
- sn(n, arguments)
3561
+ an(n, arguments)
3483
3562
  );
3484
3563
  }, s = $s(0, r.length - n.length), a = [], u = 0; u < s; u++)
3485
3564
  a[u] = "$" + u;
@@ -3489,43 +3568,43 @@ var Jn = Or.exports, Rt = {}, Xn = {}, Zn = function() {
3489
3568
  l.prototype = r.prototype, i.prototype = new l(), l.prototype = null;
3490
3569
  }
3491
3570
  return i;
3492
- }, js = Us, Tr = Function.prototype.bind || js, xs = Function.prototype.call, Qs = Object.prototype.hasOwnProperty, Gs = Tr, Ks = Gs.call(xs, Qs), T, zs = Ts, Hs = _s, Ws = Ls, Ys = Cs, ze = ei, Ke = $t, Js = Ps, ti = Function, xt = function(t) {
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) {
3493
3572
  try {
3494
3573
  return ti('"use strict"; return (' + t + ").constructor;")();
3495
3574
  } catch {
3496
3575
  }
3497
- }, Pe = Object.getOwnPropertyDescriptor;
3498
- if (Pe)
3576
+ }, Le = Object.getOwnPropertyDescriptor;
3577
+ if (Le)
3499
3578
  try {
3500
- Pe({}, "");
3579
+ Le({}, "");
3501
3580
  } catch {
3502
- Pe = null;
3581
+ Le = null;
3503
3582
  }
3504
3583
  var Qt = function() {
3505
3584
  throw new Ke();
3506
- }, Xs = Pe ? function() {
3585
+ }, Xs = Le ? function() {
3507
3586
  try {
3508
3587
  return arguments.callee, Qt;
3509
3588
  } catch {
3510
3589
  try {
3511
- return Pe(arguments, "callee").get;
3590
+ return Le(arguments, "callee").get;
3512
3591
  } catch {
3513
3592
  return Qt;
3514
3593
  }
3515
3594
  }
3516
3595
  }() : Qt, Me = Ns(), Zs = Ds(), j = Object.getPrototypeOf || (Zs ? function(t) {
3517
3596
  return t.__proto__;
3518
- } : null), qe = {}, ea = typeof Uint8Array > "u" || !j ? T : j(Uint8Array), ke = {
3597
+ } : null), Ue = {}, ea = typeof Uint8Array > "u" || !j ? T : j(Uint8Array), Ne = {
3519
3598
  __proto__: null,
3520
3599
  "%AggregateError%": typeof AggregateError > "u" ? T : AggregateError,
3521
3600
  "%Array%": Array,
3522
3601
  "%ArrayBuffer%": typeof ArrayBuffer > "u" ? T : ArrayBuffer,
3523
3602
  "%ArrayIteratorPrototype%": Me && j ? j([][Symbol.iterator]()) : T,
3524
3603
  "%AsyncFromSyncIteratorPrototype%": T,
3525
- "%AsyncFunction%": qe,
3526
- "%AsyncGenerator%": qe,
3527
- "%AsyncGeneratorFunction%": qe,
3528
- "%AsyncIteratorPrototype%": qe,
3604
+ "%AsyncFunction%": Ue,
3605
+ "%AsyncGenerator%": Ue,
3606
+ "%AsyncGeneratorFunction%": Ue,
3607
+ "%AsyncIteratorPrototype%": Ue,
3529
3608
  "%Atomics%": typeof Atomics > "u" ? T : Atomics,
3530
3609
  "%BigInt%": typeof BigInt > "u" ? T : BigInt,
3531
3610
  "%BigInt64Array%": typeof BigInt64Array > "u" ? T : BigInt64Array,
@@ -3545,7 +3624,7 @@ var Qt = function() {
3545
3624
  "%Float64Array%": typeof Float64Array > "u" ? T : Float64Array,
3546
3625
  "%FinalizationRegistry%": typeof FinalizationRegistry > "u" ? T : FinalizationRegistry,
3547
3626
  "%Function%": ti,
3548
- "%GeneratorFunction%": qe,
3627
+ "%GeneratorFunction%": Ue,
3549
3628
  "%Int8Array%": typeof Int8Array > "u" ? T : Int8Array,
3550
3629
  "%Int16Array%": typeof Int16Array > "u" ? T : Int16Array,
3551
3630
  "%Int32Array%": typeof Int32Array > "u" ? T : Int32Array,
@@ -3590,7 +3669,7 @@ if (j)
3590
3669
  null.error;
3591
3670
  } catch (t) {
3592
3671
  var ta = j(j(t));
3593
- ke["%Error.prototype%"] = ta;
3672
+ Ne["%Error.prototype%"] = ta;
3594
3673
  }
3595
3674
  var ra = function t(e) {
3596
3675
  var r;
@@ -3607,8 +3686,8 @@ var ra = function t(e) {
3607
3686
  var i = t("%AsyncGenerator%");
3608
3687
  i && j && (r = j(i.prototype));
3609
3688
  }
3610
- return ke[e] = r, r;
3611
- }, an = {
3689
+ return Ne[e] = r, r;
3690
+ }, un = {
3612
3691
  __proto__: null,
3613
3692
  "%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"],
3614
3693
  "%ArrayPrototype%": ["Array", "prototype"],
@@ -3661,21 +3740,21 @@ var ra = function t(e) {
3661
3740
  "%URIErrorPrototype%": ["URIError", "prototype"],
3662
3741
  "%WeakMapPrototype%": ["WeakMap", "prototype"],
3663
3742
  "%WeakSetPrototype%": ["WeakSet", "prototype"]
3664
- }, ot = Tr, It = Ks, na = ot.call(Function.call, Array.prototype.concat), ia = ot.call(Function.apply, Array.prototype.splice), un = ot.call(Function.call, String.prototype.replace), Ot = ot.call(Function.call, String.prototype.slice), oa = ot.call(Function.call, RegExp.prototype.exec), sa = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, aa = /\\(\\)?/g, ua = function(e) {
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) {
3665
3744
  var r = Ot(e, 0, 1), n = Ot(e, -1);
3666
3745
  if (r === "%" && n !== "%")
3667
3746
  throw new ze("invalid intrinsic syntax, expected closing `%`");
3668
3747
  if (n === "%" && r !== "%")
3669
3748
  throw new ze("invalid intrinsic syntax, expected opening `%`");
3670
3749
  var i = [];
3671
- return un(e, sa, function(o, s, a, u) {
3672
- i[i.length] = a ? un(u, aa, "$1") : s || o;
3750
+ return cn(e, sa, function(o, s, a, u) {
3751
+ i[i.length] = a ? cn(u, aa, "$1") : s || o;
3673
3752
  }), i;
3674
3753
  }, ca = function(e, r) {
3675
3754
  var n = e, i;
3676
- if (It(an, n) && (i = an[n], n = "%" + i[0] + "%"), It(ke, n)) {
3677
- var o = ke[n];
3678
- if (o === qe && (o = ra(n)), typeof o > "u" && !r)
3755
+ if (It(un, n) && (i = un[n], n = "%" + i[0] + "%"), It(Ne, n)) {
3756
+ var o = Ne[n];
3757
+ if (o === Ue && (o = ra(n)), typeof o > "u" && !r)
3679
3758
  throw new Ke("intrinsic " + e + " exists, but is not available. Please file an issue!");
3680
3759
  return {
3681
3760
  alias: i,
@@ -3684,7 +3763,7 @@ var ra = function t(e) {
3684
3763
  };
3685
3764
  }
3686
3765
  throw new ze("intrinsic " + e + " does not exist!");
3687
- }, st = function(e, r) {
3766
+ }, at = function(e, r) {
3688
3767
  if (typeof e != "string" || e.length === 0)
3689
3768
  throw new Ke("intrinsic name must be a non-empty string");
3690
3769
  if (arguments.length > 1 && typeof r != "boolean")
@@ -3697,28 +3776,28 @@ var ra = function t(e) {
3697
3776
  var p = n[c], v = Ot(p, 0, 1), w = Ot(p, -1);
3698
3777
  if ((v === '"' || v === "'" || v === "`" || w === '"' || w === "'" || w === "`") && v !== w)
3699
3778
  throw new ze("property names with quotes must have matching quotes");
3700
- if ((p === "constructor" || !f) && (u = !0), i += "." + p, s = "%" + i + "%", It(ke, s))
3701
- a = ke[s];
3779
+ if ((p === "constructor" || !f) && (u = !0), i += "." + p, s = "%" + i + "%", It(Ne, s))
3780
+ a = Ne[s];
3702
3781
  else if (a != null) {
3703
3782
  if (!(p in a)) {
3704
3783
  if (!r)
3705
3784
  throw new Ke("base intrinsic for " + e + " exists, but the property is not available.");
3706
3785
  return;
3707
3786
  }
3708
- if (Pe && c + 1 >= n.length) {
3709
- var b = Pe(a, p);
3710
- f = !!b, f && "get" in b && !("originalValue" in b.get) ? a = b.get : a = a[p];
3787
+ if (Le && c + 1 >= n.length) {
3788
+ var m = Le(a, p);
3789
+ f = !!m, f && "get" in m && !("originalValue" in m.get) ? a = m.get : a = a[p];
3711
3790
  } else
3712
3791
  f = It(a, p), a = a[p];
3713
- f && !u && (ke[s] = a);
3792
+ f && !u && (Ne[s] = a);
3714
3793
  }
3715
3794
  }
3716
3795
  return a;
3717
- }, ri = { exports: {} }, Gt, cn;
3718
- function _r() {
3719
- if (cn) return Gt;
3720
- cn = 1;
3721
- var t = st, e = t("%Object.defineProperty%", !0) || !1;
3796
+ }, ri = { exports: {} }, Gt, dn;
3797
+ function kr() {
3798
+ if (dn) return Gt;
3799
+ dn = 1;
3800
+ var t = at, e = t("%Object.defineProperty%", !0) || !1;
3722
3801
  if (e)
3723
3802
  try {
3724
3803
  e({}, "a", { value: 1 });
@@ -3727,27 +3806,27 @@ function _r() {
3727
3806
  }
3728
3807
  return Gt = e, Gt;
3729
3808
  }
3730
- var la = st, mt = la("%Object.getOwnPropertyDescriptor%", !0);
3731
- if (mt)
3809
+ var da = at, gt = da("%Object.getOwnPropertyDescriptor%", !0);
3810
+ if (gt)
3732
3811
  try {
3733
- mt([], "length");
3812
+ gt([], "length");
3734
3813
  } catch {
3735
- mt = null;
3814
+ gt = null;
3736
3815
  }
3737
- var Mt = mt, ln = _r(), da = ei, Be = $t, dn = Mt, fa = function(e, r, n) {
3816
+ var Bt = gt, ln = kr(), la = ei, qe = $t, fn = Bt, fa = function(e, r, n) {
3738
3817
  if (!e || typeof e != "object" && typeof e != "function")
3739
- throw new Be("`obj` must be an object or a function`");
3818
+ throw new qe("`obj` must be an object or a function`");
3740
3819
  if (typeof r != "string" && typeof r != "symbol")
3741
- throw new Be("`property` must be a string or a symbol`");
3820
+ throw new qe("`property` must be a string or a symbol`");
3742
3821
  if (arguments.length > 3 && typeof arguments[3] != "boolean" && arguments[3] !== null)
3743
- throw new Be("`nonEnumerable`, if provided, must be a boolean or null");
3822
+ throw new qe("`nonEnumerable`, if provided, must be a boolean or null");
3744
3823
  if (arguments.length > 4 && typeof arguments[4] != "boolean" && arguments[4] !== null)
3745
- throw new Be("`nonWritable`, if provided, must be a boolean or null");
3824
+ throw new qe("`nonWritable`, if provided, must be a boolean or null");
3746
3825
  if (arguments.length > 5 && typeof arguments[5] != "boolean" && arguments[5] !== null)
3747
- throw new Be("`nonConfigurable`, if provided, must be a boolean or null");
3826
+ throw new qe("`nonConfigurable`, if provided, must be a boolean or null");
3748
3827
  if (arguments.length > 6 && typeof arguments[6] != "boolean")
3749
- throw new Be("`loose`, if provided, must be a boolean");
3750
- 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 = !!dn && dn(e, r);
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);
3751
3830
  if (ln)
3752
3831
  ln(e, r, {
3753
3832
  configurable: s === null && u ? u.configurable : !s,
@@ -3758,8 +3837,8 @@ var Mt = mt, ln = _r(), da = ei, Be = $t, dn = Mt, fa = function(e, r, n) {
3758
3837
  else if (a || !i && !o && !s)
3759
3838
  e[r] = n;
3760
3839
  else
3761
- throw new da("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");
3762
- }, lr = _r(), ni = function() {
3840
+ throw new la("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");
3841
+ }, lr = kr(), ni = function() {
3763
3842
  return !!lr;
3764
3843
  };
3765
3844
  ni.hasArrayLengthDefineBug = function() {
@@ -3771,24 +3850,24 @@ ni.hasArrayLengthDefineBug = function() {
3771
3850
  return !0;
3772
3851
  }
3773
3852
  };
3774
- var pa = ni, ha = st, fn = fa, ya = pa(), pn = Mt, hn = $t, ma = ha("%Math.floor%"), ga = function(e, r) {
3853
+ var pa = ni, ha = at, pn = fa, ya = pa(), hn = Bt, yn = $t, ma = ha("%Math.floor%"), ga = function(e, r) {
3775
3854
  if (typeof e != "function")
3776
- throw new hn("`fn` is not a function");
3855
+ throw new yn("`fn` is not a function");
3777
3856
  if (typeof r != "number" || r < 0 || r > 4294967295 || ma(r) !== r)
3778
- throw new hn("`length` must be a positive 32-bit integer");
3857
+ throw new yn("`length` must be a positive 32-bit integer");
3779
3858
  var n = arguments.length > 2 && !!arguments[2], i = !0, o = !0;
3780
- if ("length" in e && pn) {
3781
- var s = pn(e, "length");
3859
+ if ("length" in e && hn) {
3860
+ var s = hn(e, "length");
3782
3861
  s && !s.configurable && (i = !1), s && !s.writable && (o = !1);
3783
3862
  }
3784
- return (i || o || !n) && (ya ? fn(
3863
+ return (i || o || !n) && (ya ? pn(
3785
3864
  /** @type {Parameters<define>[0]} */
3786
3865
  e,
3787
3866
  "length",
3788
3867
  r,
3789
3868
  !0,
3790
3869
  !0
3791
- ) : fn(
3870
+ ) : pn(
3792
3871
  /** @type {Parameters<define>[0]} */
3793
3872
  e,
3794
3873
  "length",
@@ -3796,7 +3875,7 @@ var pa = ni, ha = st, fn = fa, ya = pa(), pn = Mt, hn = $t, ma = ha("%Math.floor
3796
3875
  )), e;
3797
3876
  };
3798
3877
  (function(t) {
3799
- var e = Tr, r = st, n = ga, i = $t, o = r("%Function.prototype.apply%"), s = r("%Function.prototype.call%"), a = r("%Reflect.apply%", !0) || e.call(s, o), u = _r(), l = r("%Math.max%");
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%");
3800
3879
  t.exports = function(p) {
3801
3880
  if (typeof p != "function")
3802
3881
  throw new i("a function is required");
@@ -3812,18 +3891,18 @@ var pa = ni, ha = st, fn = fa, ya = pa(), pn = Mt, hn = $t, ma = ha("%Math.floor
3812
3891
  };
3813
3892
  u ? u(t.exports, "apply", { value: c }) : t.exports.apply = c;
3814
3893
  })(ri);
3815
- var Lr = ri.exports, ii = st, oi = Lr, ba = oi(ii("String.prototype.indexOf")), Cr = function(e, r) {
3894
+ var Cr = ri.exports, ii = at, oi = Cr, ba = oi(ii("String.prototype.indexOf")), Pr = function(e, r) {
3816
3895
  var n = ii(e, !!r);
3817
3896
  return typeof n == "function" && ba(e, ".prototype.") > -1 ? oi(n) : n;
3818
- }, va = Vt(), Sa = Cr, dr = Sa("Object.prototype.toString"), Bt = function(e) {
3819
- return va && e && typeof e == "object" && Symbol.toStringTag in e ? !1 : dr(e) === "[object Arguments]";
3897
+ }, va = Vt(), Sa = Pr, fr = Sa("Object.prototype.toString"), Mt = function(e) {
3898
+ return va && e && typeof e == "object" && Symbol.toStringTag in e ? !1 : fr(e) === "[object Arguments]";
3820
3899
  }, si = function(e) {
3821
- return Bt(e) ? !0 : e !== null && typeof e == "object" && typeof e.length == "number" && e.length >= 0 && dr(e) !== "[object Array]" && dr(e.callee) === "[object Function]";
3900
+ 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]";
3822
3901
  }, wa = function() {
3823
- return Bt(arguments);
3902
+ return Mt(arguments);
3824
3903
  }();
3825
- Bt.isLegacyArguments = si;
3826
- var Aa = wa ? Bt : si, Ea = Object.prototype.toString, Ia = Function.prototype.toString, Oa = /^\s*(?:function)?\*/, ai = Vt(), Kt = Object.getPrototypeOf, Ta = function() {
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() {
3827
3906
  if (!ai)
3828
3907
  return !1;
3829
3908
  try {
@@ -3846,73 +3925,73 @@ var Aa = wa ? Bt : si, Ea = Object.prototype.toString, Ia = Function.prototype.t
3846
3925
  zt = n ? Kt(n) : !1;
3847
3926
  }
3848
3927
  return Kt(e) === zt;
3849
- }, ui = Function.prototype.toString, xe = typeof Reflect == "object" && Reflect !== null && Reflect.apply, fr, gt;
3928
+ }, ui = Function.prototype.toString, xe = typeof Reflect == "object" && Reflect !== null && Reflect.apply, pr, bt;
3850
3929
  if (typeof xe == "function" && typeof Object.defineProperty == "function")
3851
3930
  try {
3852
- fr = Object.defineProperty({}, "length", {
3931
+ pr = Object.defineProperty({}, "length", {
3853
3932
  get: function() {
3854
- throw gt;
3933
+ throw bt;
3855
3934
  }
3856
- }), gt = {}, xe(function() {
3935
+ }), bt = {}, xe(function() {
3857
3936
  throw 42;
3858
- }, null, fr);
3937
+ }, null, pr);
3859
3938
  } catch (t) {
3860
- t !== gt && (xe = null);
3939
+ t !== bt && (xe = null);
3861
3940
  }
3862
3941
  else
3863
3942
  xe = null;
3864
- var La = /^\s*class\b/, pr = function(e) {
3943
+ var ka = /^\s*class\b/, hr = function(e) {
3865
3944
  try {
3866
3945
  var r = ui.call(e);
3867
- return La.test(r);
3946
+ return ka.test(r);
3868
3947
  } catch {
3869
3948
  return !1;
3870
3949
  }
3871
3950
  }, Ht = function(e) {
3872
3951
  try {
3873
- return pr(e) ? !1 : (ui.call(e), !0);
3952
+ return hr(e) ? !1 : (ui.call(e), !0);
3874
3953
  } catch {
3875
3954
  return !1;
3876
3955
  }
3877
- }, bt = Object.prototype.toString, Ca = "[object Object]", Pa = "[object Function]", ka = "[object GeneratorFunction]", Na = "[object HTMLAllCollection]", Fa = "[object HTML document.all class]", Da = "[object HTMLCollection]", Ra = typeof Symbol == "function" && !!Symbol.toStringTag, Va = !(0 in [,]), hr = function() {
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() {
3878
3957
  return !1;
3879
3958
  };
3880
3959
  if (typeof document == "object") {
3881
3960
  var $a = document.all;
3882
- bt.call($a) === bt.call(document.all) && (hr = function(e) {
3961
+ vt.call($a) === vt.call(document.all) && (yr = function(e) {
3883
3962
  if ((Va || !e) && (typeof e > "u" || typeof e == "object"))
3884
3963
  try {
3885
- var r = bt.call(e);
3964
+ var r = vt.call(e);
3886
3965
  return (r === Na || r === Fa || r === Da || r === Ca) && e("") == null;
3887
3966
  } catch {
3888
3967
  }
3889
3968
  return !1;
3890
3969
  });
3891
3970
  }
3892
- var Ma = xe ? function(e) {
3893
- if (hr(e))
3971
+ var Ba = xe ? function(e) {
3972
+ if (yr(e))
3894
3973
  return !0;
3895
3974
  if (!e || typeof e != "function" && typeof e != "object")
3896
3975
  return !1;
3897
3976
  try {
3898
- xe(e, null, fr);
3977
+ xe(e, null, pr);
3899
3978
  } catch (r) {
3900
- if (r !== gt)
3979
+ if (r !== bt)
3901
3980
  return !1;
3902
3981
  }
3903
- return !pr(e) && Ht(e);
3982
+ return !hr(e) && Ht(e);
3904
3983
  } : function(e) {
3905
- if (hr(e))
3984
+ if (yr(e))
3906
3985
  return !0;
3907
3986
  if (!e || typeof e != "function" && typeof e != "object")
3908
3987
  return !1;
3909
3988
  if (Ra)
3910
3989
  return Ht(e);
3911
- if (pr(e))
3990
+ if (hr(e))
3912
3991
  return !1;
3913
- var r = bt.call(e);
3914
- return r !== Pa && r !== ka && !/^\[object HTML/.test(r) ? !1 : Ht(e);
3915
- }, Ba = Ma, qa = Object.prototype.toString, ci = Object.prototype.hasOwnProperty, Ua = function(e, r, n) {
3992
+ 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) {
3916
3995
  for (var i = 0, o = e.length; i < o; i++)
3917
3996
  ci.call(e, i) && (n == null ? r(e[i], i, e) : r.call(n, e[i], i, e));
3918
3997
  }, ja = function(e, r, n) {
@@ -3922,11 +4001,11 @@ var Ma = xe ? function(e) {
3922
4001
  for (var i in e)
3923
4002
  ci.call(e, i) && (n == null ? r(e[i], i, e) : r.call(n, e[i], i, e));
3924
4003
  }, Qa = function(e, r, n) {
3925
- if (!Ba(r))
4004
+ if (!Ma(r))
3926
4005
  throw new TypeError("iterator must be a function");
3927
4006
  var i;
3928
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);
3929
- }, li = Qa, Ga = [
4008
+ }, di = Qa, Ga = [
3930
4009
  "Float32Array",
3931
4010
  "Float64Array",
3932
4011
  "Int8Array",
@@ -3938,36 +4017,36 @@ var Ma = xe ? function(e) {
3938
4017
  "Uint32Array",
3939
4018
  "BigInt64Array",
3940
4019
  "BigUint64Array"
3941
- ], Wt = Ga, Ka = typeof globalThis > "u" ? Ar : globalThis, di = function() {
4020
+ ], Wt = Ga, Ka = typeof globalThis > "u" ? Er : globalThis, li = function() {
3942
4021
  for (var e = [], r = 0; r < Wt.length; r++)
3943
4022
  typeof Ka[Wt[r]] == "function" && (e[e.length] = Wt[r]);
3944
4023
  return e;
3945
- }, Tt = li, za = di, yn = Lr, Pr = Cr, vt = Mt, Ha = Pr("Object.prototype.toString"), fi = Vt(), mn = typeof globalThis > "u" ? Ar : globalThis, yr = za(), kr = Pr("String.prototype.slice"), Yt = Object.getPrototypeOf, Wa = Pr("Array.prototype.indexOf", !0) || function(e, r) {
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) {
3946
4025
  for (var n = 0; n < e.length; n += 1)
3947
4026
  if (e[n] === r)
3948
4027
  return n;
3949
4028
  return -1;
3950
4029
  }, _t = { __proto__: null };
3951
- fi && vt && Yt ? Tt(yr, function(t) {
3952
- var e = new mn[t]();
4030
+ fi && St && Yt ? Tt(mr, function(t) {
4031
+ var e = new gn[t]();
3953
4032
  if (Symbol.toStringTag in e) {
3954
- var r = Yt(e), n = vt(r, Symbol.toStringTag);
4033
+ var r = Yt(e), n = St(r, Symbol.toStringTag);
3955
4034
  if (!n) {
3956
4035
  var i = Yt(r);
3957
- n = vt(i, Symbol.toStringTag);
4036
+ n = St(i, Symbol.toStringTag);
3958
4037
  }
3959
- _t["$" + t] = yn(n.get);
4038
+ _t["$" + t] = mn(n.get);
3960
4039
  }
3961
- }) : Tt(yr, function(t) {
3962
- var e = new mn[t](), r = e.slice || e.set;
3963
- r && (_t["$" + t] = yn(r));
4040
+ }) : Tt(mr, function(t) {
4041
+ var e = new gn[t](), r = e.slice || e.set;
4042
+ r && (_t["$" + t] = mn(r));
3964
4043
  });
3965
4044
  var Ya = function(e) {
3966
4045
  var r = !1;
3967
4046
  return Tt(_t, function(n, i) {
3968
4047
  if (!r)
3969
4048
  try {
3970
- "$" + n(e) === i && (r = kr(i, 1));
4049
+ "$" + n(e) === i && (r = Nr(i, 1));
3971
4050
  } catch {
3972
4051
  }
3973
4052
  }), r;
@@ -3976,7 +4055,7 @@ var Ya = function(e) {
3976
4055
  return Tt(_t, function(n, i) {
3977
4056
  if (!r)
3978
4057
  try {
3979
- n(e), r = kr(i, 1);
4058
+ n(e), r = Nr(i, 1);
3980
4059
  } catch {
3981
4060
  }
3982
4061
  }), r;
@@ -3984,33 +4063,33 @@ var Ya = function(e) {
3984
4063
  if (!e || typeof e != "object")
3985
4064
  return !1;
3986
4065
  if (!fi) {
3987
- var r = kr(Ha(e), 8, -1);
3988
- return Wa(yr, r) > -1 ? r : r !== "Object" ? !1 : Ja(e);
4066
+ var r = Nr(Ha(e), 8, -1);
4067
+ return Wa(mr, r) > -1 ? r : r !== "Object" ? !1 : Ja(e);
3989
4068
  }
3990
- return vt ? Ya(e) : null;
3991
- }, Lt = li, Za = di, gn = Lr, Nr = Cr, St = Mt, eu = Nr("Object.prototype.toString"), pi = Vt(), bn = typeof globalThis > "u" ? Ar : globalThis, mr = Za(), Fr = Nr("String.prototype.slice"), Jt = Object.getPrototypeOf, tu = Nr("Array.prototype.indexOf", !0) || function(e, r) {
4069
+ 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) {
3992
4071
  for (var n = 0; n < e.length; n += 1)
3993
4072
  if (e[n] === r)
3994
4073
  return n;
3995
4074
  return -1;
3996
4075
  }, Ct = { __proto__: null };
3997
- pi && St && Jt ? Lt(mr, function(t) {
3998
- var e = new bn[t]();
4076
+ pi && wt && Jt ? kt(gr, function(t) {
4077
+ var e = new vn[t]();
3999
4078
  if (Symbol.toStringTag in e) {
4000
- var r = Jt(e), n = St(r, Symbol.toStringTag);
4079
+ var r = Jt(e), n = wt(r, Symbol.toStringTag);
4001
4080
  if (!n) {
4002
4081
  var i = Jt(r);
4003
- n = St(i, Symbol.toStringTag);
4082
+ n = wt(i, Symbol.toStringTag);
4004
4083
  }
4005
- Ct["$" + t] = gn(n.get);
4084
+ Ct["$" + t] = bn(n.get);
4006
4085
  }
4007
- }) : Lt(mr, function(t) {
4008
- var e = new bn[t](), r = e.slice || e.set;
4009
- r && (Ct["$" + t] = gn(r));
4086
+ }) : kt(gr, function(t) {
4087
+ var e = new vn[t](), r = e.slice || e.set;
4088
+ r && (Ct["$" + t] = bn(r));
4010
4089
  });
4011
4090
  var ru = function(e) {
4012
4091
  var r = !1;
4013
- return Lt(
4092
+ return kt(
4014
4093
  // eslint-disable-next-line no-extra-parens
4015
4094
  /** @type {Record<`\$${TypedArrayName}`, Getter>} */
4016
4095
  /** @type {any} */
@@ -4019,14 +4098,14 @@ var ru = function(e) {
4019
4098
  function(n, i) {
4020
4099
  if (!r)
4021
4100
  try {
4022
- "$" + n(e) === i && (r = Fr(i, 1));
4101
+ "$" + n(e) === i && (r = Dr(i, 1));
4023
4102
  } catch {
4024
4103
  }
4025
4104
  }
4026
4105
  ), r;
4027
4106
  }, nu = function(e) {
4028
4107
  var r = !1;
4029
- return Lt(
4108
+ return kt(
4030
4109
  // eslint-disable-next-line no-extra-parens
4031
4110
  /** @type {Record<`\$${TypedArrayName}`, Getter>} */
4032
4111
  /** @type {any} */
@@ -4035,7 +4114,7 @@ var ru = function(e) {
4035
4114
  function(n, i) {
4036
4115
  if (!r)
4037
4116
  try {
4038
- n(e), r = Fr(i, 1);
4117
+ n(e), r = Dr(i, 1);
4039
4118
  } catch {
4040
4119
  }
4041
4120
  }
@@ -4044,10 +4123,10 @@ var ru = function(e) {
4044
4123
  if (!e || typeof e != "object")
4045
4124
  return !1;
4046
4125
  if (!pi) {
4047
- var r = Fr(eu(e), 8, -1);
4048
- return tu(mr, r) > -1 ? r : r !== "Object" ? !1 : nu(e);
4126
+ var r = Dr(eu(e), 8, -1);
4127
+ return tu(gr, r) > -1 ? r : r !== "Object" ? !1 : nu(e);
4049
4128
  }
4050
- return St ? ru(e) : null;
4129
+ return wt ? ru(e) : null;
4051
4130
  }, ou = iu, su = function(e) {
4052
4131
  return !!ou(e);
4053
4132
  };
@@ -4071,10 +4150,10 @@ var ru = function(e) {
4071
4150
  }
4072
4151
  }
4073
4152
  t.isArgumentsObject = e, t.isGeneratorFunction = r, t.isTypedArray = i;
4074
- function b(y) {
4153
+ function m(y) {
4075
4154
  return typeof Promise < "u" && y instanceof Promise || y !== null && typeof y == "object" && typeof y.then == "function" && typeof y.catch == "function";
4076
4155
  }
4077
- t.isPromise = b;
4156
+ t.isPromise = m;
4078
4157
  function g(y) {
4079
4158
  return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? ArrayBuffer.isView(y) : i(y) || h(y);
4080
4159
  }
@@ -4095,10 +4174,10 @@ var ru = function(e) {
4095
4174
  return n(y) === "Uint32Array";
4096
4175
  }
4097
4176
  t.isUint32Array = ne;
4098
- function k(y) {
4177
+ function L(y) {
4099
4178
  return n(y) === "Int8Array";
4100
4179
  }
4101
- t.isInt8Array = k;
4180
+ t.isInt8Array = L;
4102
4181
  function V(y) {
4103
4182
  return n(y) === "Int16Array";
4104
4183
  }
@@ -4115,54 +4194,54 @@ var ru = function(e) {
4115
4194
  return n(y) === "Float64Array";
4116
4195
  }
4117
4196
  t.isFloat64Array = ue;
4118
- function Ne(y) {
4197
+ function Fe(y) {
4119
4198
  return n(y) === "BigInt64Array";
4120
4199
  }
4121
- t.isBigInt64Array = Ne;
4122
- function Ie(y) {
4200
+ t.isBigInt64Array = Fe;
4201
+ function Oe(y) {
4123
4202
  return n(y) === "BigUint64Array";
4124
4203
  }
4125
- t.isBigUint64Array = Ie;
4126
- function pe(y) {
4204
+ t.isBigUint64Array = Oe;
4205
+ function he(y) {
4127
4206
  return u(y) === "[object Map]";
4128
4207
  }
4129
- pe.working = typeof Map < "u" && pe(/* @__PURE__ */ new Map());
4208
+ he.working = typeof Map < "u" && he(/* @__PURE__ */ new Map());
4130
4209
  function qt(y) {
4131
- return typeof Map > "u" ? !1 : pe.working ? pe(y) : y instanceof Map;
4210
+ return typeof Map > "u" ? !1 : he.working ? he(y) : y instanceof Map;
4132
4211
  }
4133
4212
  t.isMap = qt;
4134
- function Ae(y) {
4213
+ function Ie(y) {
4135
4214
  return u(y) === "[object Set]";
4136
4215
  }
4137
- Ae.working = typeof Set < "u" && Ae(/* @__PURE__ */ new Set());
4216
+ Ie.working = typeof Set < "u" && Ie(/* @__PURE__ */ new Set());
4138
4217
  function Je(y) {
4139
- return typeof Set > "u" ? !1 : Ae.working ? Ae(y) : y instanceof Set;
4218
+ return typeof Set > "u" ? !1 : Ie.working ? Ie(y) : y instanceof Set;
4140
4219
  }
4141
4220
  t.isSet = Je;
4142
- function Fe(y) {
4221
+ function De(y) {
4143
4222
  return u(y) === "[object WeakMap]";
4144
4223
  }
4145
- Fe.working = typeof WeakMap < "u" && Fe(/* @__PURE__ */ new WeakMap());
4224
+ De.working = typeof WeakMap < "u" && De(/* @__PURE__ */ new WeakMap());
4146
4225
  function Ut(y) {
4147
- return typeof WeakMap > "u" ? !1 : Fe.working ? Fe(y) : y instanceof WeakMap;
4226
+ return typeof WeakMap > "u" ? !1 : De.working ? De(y) : y instanceof WeakMap;
4148
4227
  }
4149
4228
  t.isWeakMap = Ut;
4150
- function De(y) {
4229
+ function Re(y) {
4151
4230
  return u(y) === "[object WeakSet]";
4152
4231
  }
4153
- De.working = typeof WeakSet < "u" && De(/* @__PURE__ */ new WeakSet());
4154
- function he(y) {
4155
- return De(y);
4232
+ Re.working = typeof WeakSet < "u" && Re(/* @__PURE__ */ new WeakSet());
4233
+ function ye(y) {
4234
+ return Re(y);
4156
4235
  }
4157
- t.isWeakSet = he;
4158
- function Re(y) {
4236
+ t.isWeakSet = ye;
4237
+ function Ve(y) {
4159
4238
  return u(y) === "[object ArrayBuffer]";
4160
4239
  }
4161
- Re.working = typeof ArrayBuffer < "u" && Re(new ArrayBuffer());
4162
- function at(y) {
4163
- return typeof ArrayBuffer > "u" ? !1 : Re.working ? Re(y) : y instanceof ArrayBuffer;
4240
+ Ve.working = typeof ArrayBuffer < "u" && Ve(new ArrayBuffer());
4241
+ function ut(y) {
4242
+ return typeof ArrayBuffer > "u" ? !1 : Ve.working ? Ve(y) : y instanceof ArrayBuffer;
4164
4243
  }
4165
- t.isArrayBuffer = at;
4244
+ t.isArrayBuffer = ut;
4166
4245
  function d(y) {
4167
4246
  return u(y) === "[object DataView]";
4168
4247
  }
@@ -4171,12 +4250,12 @@ var ru = function(e) {
4171
4250
  return typeof DataView > "u" ? !1 : d.working ? d(y) : y instanceof DataView;
4172
4251
  }
4173
4252
  t.isDataView = h;
4174
- var m = typeof SharedArrayBuffer < "u" ? SharedArrayBuffer : void 0;
4253
+ var b = typeof SharedArrayBuffer < "u" ? SharedArrayBuffer : void 0;
4175
4254
  function A(y) {
4176
4255
  return u(y) === "[object SharedArrayBuffer]";
4177
4256
  }
4178
4257
  function C(y) {
4179
- return typeof m > "u" ? !1 : (typeof A.working > "u" && (A.working = A(new m())), A.working ? A(y) : y instanceof m);
4258
+ return typeof b > "u" ? !1 : (typeof A.working > "u" && (A.working = A(new b())), A.working ? A(y) : y instanceof b);
4180
4259
  }
4181
4260
  t.isSharedArrayBuffer = C;
4182
4261
  function P(y) {
@@ -4187,10 +4266,10 @@ var ru = function(e) {
4187
4266
  return u(y) === "[object Map Iterator]";
4188
4267
  }
4189
4268
  t.isMapIterator = O;
4190
- function L(y) {
4269
+ function k(y) {
4191
4270
  return u(y) === "[object Set Iterator]";
4192
4271
  }
4193
- t.isSetIterator = L;
4272
+ t.isSetIterator = k;
4194
4273
  function D(y) {
4195
4274
  return u(y) === "[object Generator]";
4196
4275
  }
@@ -4199,32 +4278,32 @@ var ru = function(e) {
4199
4278
  return u(y) === "[object WebAssembly.Module]";
4200
4279
  }
4201
4280
  t.isWebAssemblyCompiledModule = W;
4202
- function Oe(y) {
4281
+ function Te(y) {
4203
4282
  return w(y, l);
4204
4283
  }
4205
- t.isNumberObject = Oe;
4206
- function ut(y) {
4284
+ t.isNumberObject = Te;
4285
+ function ct(y) {
4207
4286
  return w(y, c);
4208
4287
  }
4209
- t.isStringObject = ut;
4210
- function Ve(y) {
4288
+ t.isStringObject = ct;
4289
+ function $e(y) {
4211
4290
  return w(y, f);
4212
4291
  }
4213
- t.isBooleanObject = Ve;
4214
- function ct(y) {
4292
+ t.isBooleanObject = $e;
4293
+ function dt(y) {
4215
4294
  return s && w(y, p);
4216
4295
  }
4217
- t.isBigIntObject = ct;
4218
- function Vr(y) {
4296
+ t.isBigIntObject = dt;
4297
+ function $r(y) {
4219
4298
  return a && w(y, v);
4220
4299
  }
4221
- t.isSymbolObject = Vr;
4300
+ t.isSymbolObject = $r;
4222
4301
  function bi(y) {
4223
- return Oe(y) || ut(y) || Ve(y) || ct(y) || Vr(y);
4302
+ return Te(y) || ct(y) || $e(y) || dt(y) || $r(y);
4224
4303
  }
4225
4304
  t.isBoxedPrimitive = bi;
4226
4305
  function vi(y) {
4227
- return typeof Uint8Array < "u" && (at(y) || C(y));
4306
+ return typeof Uint8Array < "u" && (ut(y) || C(y));
4228
4307
  }
4229
4308
  t.isAnyArrayBuffer = vi, ["isProxy", "isExternal", "isModuleNamespaceObject"].forEach(function(y) {
4230
4309
  Object.defineProperty(t, y, {
@@ -4237,8 +4316,8 @@ var ru = function(e) {
4237
4316
  })(Xn);
4238
4317
  var au = function(e) {
4239
4318
  return e && typeof e == "object" && typeof e.copy == "function" && typeof e.fill == "function" && typeof e.readUInt8 == "function";
4240
- }, gr = { exports: {} };
4241
- typeof Object.create == "function" ? gr.exports = function(e, r) {
4319
+ }, br = { exports: {} };
4320
+ typeof Object.create == "function" ? br.exports = function(e, r) {
4242
4321
  r && (e.super_ = r, e.prototype = Object.create(r.prototype, {
4243
4322
  constructor: {
4244
4323
  value: e,
@@ -4247,7 +4326,7 @@ typeof Object.create == "function" ? gr.exports = function(e, r) {
4247
4326
  configurable: !0
4248
4327
  }
4249
4328
  }));
4250
- } : gr.exports = function(e, r) {
4329
+ } : br.exports = function(e, r) {
4251
4330
  if (r) {
4252
4331
  e.super_ = r;
4253
4332
  var n = function() {
@@ -4255,37 +4334,37 @@ typeof Object.create == "function" ? gr.exports = function(e, r) {
4255
4334
  n.prototype = r.prototype, e.prototype = new n(), e.prototype.constructor = e;
4256
4335
  }
4257
4336
  };
4258
- var uu = gr.exports;
4337
+ var uu = br.exports;
4259
4338
  (function(t) {
4260
4339
  var e = Object.getOwnPropertyDescriptors || function(h) {
4261
- for (var m = Object.keys(h), A = {}, C = 0; C < m.length; C++)
4262
- A[m[C]] = Object.getOwnPropertyDescriptor(h, m[C]);
4340
+ for (var b = Object.keys(h), A = {}, C = 0; C < b.length; C++)
4341
+ A[b[C]] = Object.getOwnPropertyDescriptor(h, b[C]);
4263
4342
  return A;
4264
4343
  }, r = /%[sdj%]/g;
4265
4344
  t.format = function(d) {
4266
- if (!k(d)) {
4267
- for (var h = [], m = 0; m < arguments.length; m++)
4268
- h.push(s(arguments[m]));
4345
+ if (!L(d)) {
4346
+ for (var h = [], b = 0; b < arguments.length; b++)
4347
+ h.push(s(arguments[b]));
4269
4348
  return h.join(" ");
4270
4349
  }
4271
- for (var m = 1, A = arguments, C = A.length, P = String(d).replace(r, function(L) {
4272
- if (L === "%%") return "%";
4273
- if (m >= C) return L;
4274
- switch (L) {
4350
+ for (var b = 1, A = arguments, C = A.length, P = String(d).replace(r, function(k) {
4351
+ if (k === "%%") return "%";
4352
+ if (b >= C) return k;
4353
+ switch (k) {
4275
4354
  case "%s":
4276
- return String(A[m++]);
4355
+ return String(A[b++]);
4277
4356
  case "%d":
4278
- return Number(A[m++]);
4357
+ return Number(A[b++]);
4279
4358
  case "%j":
4280
4359
  try {
4281
- return JSON.stringify(A[m++]);
4360
+ return JSON.stringify(A[b++]);
4282
4361
  } catch {
4283
4362
  return "[Circular]";
4284
4363
  }
4285
4364
  default:
4286
- return L;
4365
+ return k;
4287
4366
  }
4288
- }), O = A[m]; m < C; O = A[++m])
4367
+ }), O = A[b]; b < C; O = A[++b])
4289
4368
  F(O) || !ue(O) ? P += " " + O : P += " " + s(O);
4290
4369
  return P;
4291
4370
  }, t.deprecate = function(d, h) {
@@ -4295,12 +4374,12 @@ var uu = gr.exports;
4295
4374
  return function() {
4296
4375
  return t.deprecate(d, h).apply(this, arguments);
4297
4376
  };
4298
- var m = !1;
4377
+ var b = !1;
4299
4378
  function A() {
4300
- if (!m) {
4379
+ if (!b) {
4301
4380
  if (E.throwDeprecation)
4302
4381
  throw new Error(h);
4303
- E.traceDeprecation ? console.trace(h) : console.error(h), m = !0;
4382
+ E.traceDeprecation ? console.trace(h) : console.error(h), b = !0;
4304
4383
  }
4305
4384
  return d.apply(this, arguments);
4306
4385
  }
@@ -4316,8 +4395,8 @@ var uu = gr.exports;
4316
4395
  if (i.test(d)) {
4317
4396
  var h = E.pid;
4318
4397
  n[d] = function() {
4319
- var m = t.format.apply(t, arguments);
4320
- console.error("%s %d: %s", d, h, m);
4398
+ var b = t.format.apply(t, arguments);
4399
+ console.error("%s %d: %s", d, h, b);
4321
4400
  };
4322
4401
  } else
4323
4402
  n[d] = function() {
@@ -4325,11 +4404,11 @@ var uu = gr.exports;
4325
4404
  return n[d];
4326
4405
  };
4327
4406
  function s(d, h) {
4328
- var m = {
4407
+ var b = {
4329
4408
  seen: [],
4330
4409
  stylize: u
4331
4410
  };
4332
- return arguments.length >= 3 && (m.depth = arguments[2]), arguments.length >= 4 && (m.colors = arguments[3]), S(h) ? m.showHidden = h : h && t._extend(m, h), _(m.showHidden) && (m.showHidden = !1), _(m.depth) && (m.depth = 2), _(m.colors) && (m.colors = !1), _(m.customInspect) && (m.customInspect = !0), m.colors && (m.stylize = a), c(m, d, m.depth);
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);
4333
4412
  }
4334
4413
  t.inspect = s, s.colors = {
4335
4414
  bold: [1, 22],
@@ -4357,64 +4436,64 @@ var uu = gr.exports;
4357
4436
  regexp: "red"
4358
4437
  };
4359
4438
  function a(d, h) {
4360
- var m = s.styles[h];
4361
- return m ? "\x1B[" + s.colors[m][0] + "m" + d + "\x1B[" + s.colors[m][1] + "m" : d;
4439
+ var b = s.styles[h];
4440
+ return b ? "\x1B[" + s.colors[b][0] + "m" + d + "\x1B[" + s.colors[b][1] + "m" : d;
4362
4441
  }
4363
4442
  function u(d, h) {
4364
4443
  return d;
4365
4444
  }
4366
4445
  function l(d) {
4367
4446
  var h = {};
4368
- return d.forEach(function(m, A) {
4369
- h[m] = !0;
4447
+ return d.forEach(function(b, A) {
4448
+ h[b] = !0;
4370
4449
  }), h;
4371
4450
  }
4372
- function c(d, h, m) {
4373
- if (d.customInspect && h && pe(h.inspect) && // Filter out the util module, it's inspect function is special
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
4374
4453
  h.inspect !== t.inspect && // Also filter out any prototype objects using the circular check.
4375
4454
  !(h.constructor && h.constructor.prototype === h)) {
4376
- var A = h.inspect(m, d);
4377
- return k(A) || (A = c(d, A, m)), A;
4455
+ var A = h.inspect(b, d);
4456
+ return L(A) || (A = c(d, A, b)), A;
4378
4457
  }
4379
4458
  var C = f(d, h);
4380
4459
  if (C)
4381
4460
  return C;
4382
4461
  var P = Object.keys(h), O = l(P);
4383
- if (d.showHidden && (P = Object.getOwnPropertyNames(h)), Ie(h) && (P.indexOf("message") >= 0 || P.indexOf("description") >= 0))
4462
+ if (d.showHidden && (P = Object.getOwnPropertyNames(h)), Oe(h) && (P.indexOf("message") >= 0 || P.indexOf("description") >= 0))
4384
4463
  return p(h);
4385
4464
  if (P.length === 0) {
4386
- if (pe(h)) {
4387
- var L = h.name ? ": " + h.name : "";
4388
- return d.stylize("[Function" + L + "]", "special");
4465
+ if (he(h)) {
4466
+ var k = h.name ? ": " + h.name : "";
4467
+ return d.stylize("[Function" + k + "]", "special");
4389
4468
  }
4390
4469
  if (ae(h))
4391
4470
  return d.stylize(RegExp.prototype.toString.call(h), "regexp");
4392
- if (Ne(h))
4471
+ if (Fe(h))
4393
4472
  return d.stylize(Date.prototype.toString.call(h), "date");
4394
- if (Ie(h))
4473
+ if (Oe(h))
4395
4474
  return p(h);
4396
4475
  }
4397
- var D = "", W = !1, Oe = ["{", "}"];
4398
- if (g(h) && (W = !0, Oe = ["[", "]"]), pe(h)) {
4399
- var ut = h.name ? ": " + h.name : "";
4400
- D = " [Function" + ut + "]";
4476
+ var D = "", W = !1, Te = ["{", "}"];
4477
+ if (g(h) && (W = !0, Te = ["[", "]"]), he(h)) {
4478
+ var ct = h.name ? ": " + h.name : "";
4479
+ D = " [Function" + ct + "]";
4401
4480
  }
4402
- if (ae(h) && (D = " " + RegExp.prototype.toString.call(h)), Ne(h) && (D = " " + Date.prototype.toUTCString.call(h)), Ie(h) && (D = " " + p(h)), P.length === 0 && (!W || h.length == 0))
4403
- return Oe[0] + D + Oe[1];
4404
- if (m < 0)
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];
4483
+ if (b < 0)
4405
4484
  return ae(h) ? d.stylize(RegExp.prototype.toString.call(h), "regexp") : d.stylize("[Object]", "special");
4406
4485
  d.seen.push(h);
4407
- var Ve;
4408
- return W ? Ve = v(d, h, m, O, P) : Ve = P.map(function(ct) {
4409
- return w(d, h, m, O, ct, W);
4410
- }), d.seen.pop(), b(Ve, D, Oe);
4486
+ 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);
4411
4490
  }
4412
4491
  function f(d, h) {
4413
4492
  if (_(h))
4414
4493
  return d.stylize("undefined", "undefined");
4415
- if (k(h)) {
4416
- var m = "'" + JSON.stringify(h).replace(/^"|"$/g, "").replace(/'/g, "\\'").replace(/\\"/g, '"') + "'";
4417
- return d.stylize(m, "string");
4494
+ if (L(h)) {
4495
+ var b = "'" + JSON.stringify(h).replace(/^"|"$/g, "").replace(/'/g, "\\'").replace(/\\"/g, '"') + "'";
4496
+ return d.stylize(b, "string");
4418
4497
  }
4419
4498
  if (ne(h))
4420
4499
  return d.stylize("" + h, "number");
@@ -4426,12 +4505,12 @@ var uu = gr.exports;
4426
4505
  function p(d) {
4427
4506
  return "[" + Error.prototype.toString.call(d) + "]";
4428
4507
  }
4429
- function v(d, h, m, A, C) {
4430
- for (var P = [], O = 0, L = h.length; O < L; ++O)
4431
- De(h, String(O)) ? P.push(w(
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(
4432
4511
  d,
4433
4512
  h,
4434
- m,
4513
+ b,
4435
4514
  A,
4436
4515
  String(O),
4437
4516
  !0
@@ -4440,40 +4519,40 @@ var uu = gr.exports;
4440
4519
  D.match(/^\d+$/) || P.push(w(
4441
4520
  d,
4442
4521
  h,
4443
- m,
4522
+ b,
4444
4523
  A,
4445
4524
  D,
4446
4525
  !0
4447
4526
  ));
4448
4527
  }), P;
4449
4528
  }
4450
- function w(d, h, m, A, C, P) {
4451
- var O, L, D;
4452
- if (D = Object.getOwnPropertyDescriptor(h, C) || { value: h[C] }, D.get ? D.set ? L = d.stylize("[Getter/Setter]", "special") : L = d.stylize("[Getter]", "special") : D.set && (L = d.stylize("[Setter]", "special")), De(A, C) || (O = "[" + C + "]"), L || (d.seen.indexOf(D.value) < 0 ? (F(m) ? L = c(d, D.value, null) : L = c(d, D.value, m - 1), L.indexOf(`
4453
- `) > -1 && (P ? L = L.split(`
4529
+ function w(d, h, b, A, C, P) {
4530
+ 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(`
4454
4533
  `).map(function(W) {
4455
4534
  return " " + W;
4456
4535
  }).join(`
4457
- `).slice(2) : L = `
4458
- ` + L.split(`
4536
+ `).slice(2) : k = `
4537
+ ` + k.split(`
4459
4538
  `).map(function(W) {
4460
4539
  return " " + W;
4461
4540
  }).join(`
4462
- `))) : L = d.stylize("[Circular]", "special")), _(O)) {
4541
+ `))) : k = d.stylize("[Circular]", "special")), _(O)) {
4463
4542
  if (P && C.match(/^\d+$/))
4464
- return L;
4543
+ return k;
4465
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"));
4466
4545
  }
4467
- return O + ": " + L;
4546
+ return O + ": " + k;
4468
4547
  }
4469
- function b(d, h, m) {
4548
+ function m(d, h, b) {
4470
4549
  var A = d.reduce(function(C, P) {
4471
4550
  return P.indexOf(`
4472
4551
  `) >= 0, C + P.replace(/\u001b\[\d\d?m/g, "").length + 1;
4473
4552
  }, 0);
4474
- return A > 60 ? m[0] + (h === "" ? "" : h + `
4553
+ return A > 60 ? b[0] + (h === "" ? "" : h + `
4475
4554
  `) + " " + d.join(`,
4476
- `) + " " + m[1] : m[0] + h + " " + d.join(", ") + " " + m[1];
4555
+ `) + " " + b[1] : b[0] + h + " " + d.join(", ") + " " + b[1];
4477
4556
  }
4478
4557
  t.types = Xn;
4479
4558
  function g(d) {
@@ -4496,10 +4575,10 @@ var uu = gr.exports;
4496
4575
  return typeof d == "number";
4497
4576
  }
4498
4577
  t.isNumber = ne;
4499
- function k(d) {
4578
+ function L(d) {
4500
4579
  return typeof d == "string";
4501
4580
  }
4502
- t.isString = k;
4581
+ t.isString = L;
4503
4582
  function V(d) {
4504
4583
  return typeof d == "symbol";
4505
4584
  }
@@ -4509,37 +4588,37 @@ var uu = gr.exports;
4509
4588
  }
4510
4589
  t.isUndefined = _;
4511
4590
  function ae(d) {
4512
- return ue(d) && Ae(d) === "[object RegExp]";
4591
+ return ue(d) && Ie(d) === "[object RegExp]";
4513
4592
  }
4514
4593
  t.isRegExp = ae, t.types.isRegExp = ae;
4515
4594
  function ue(d) {
4516
4595
  return typeof d == "object" && d !== null;
4517
4596
  }
4518
4597
  t.isObject = ue;
4519
- function Ne(d) {
4520
- return ue(d) && Ae(d) === "[object Date]";
4598
+ function Fe(d) {
4599
+ return ue(d) && Ie(d) === "[object Date]";
4521
4600
  }
4522
- t.isDate = Ne, t.types.isDate = Ne;
4523
- function Ie(d) {
4524
- return ue(d) && (Ae(d) === "[object Error]" || d instanceof Error);
4601
+ t.isDate = Fe, t.types.isDate = Fe;
4602
+ function Oe(d) {
4603
+ return ue(d) && (Ie(d) === "[object Error]" || d instanceof Error);
4525
4604
  }
4526
- t.isError = Ie, t.types.isNativeError = Ie;
4527
- function pe(d) {
4605
+ t.isError = Oe, t.types.isNativeError = Oe;
4606
+ function he(d) {
4528
4607
  return typeof d == "function";
4529
4608
  }
4530
- t.isFunction = pe;
4609
+ t.isFunction = he;
4531
4610
  function qt(d) {
4532
4611
  return d === null || typeof d == "boolean" || typeof d == "number" || typeof d == "string" || typeof d == "symbol" || // ES6 symbol
4533
4612
  typeof d > "u";
4534
4613
  }
4535
4614
  t.isPrimitive = qt, t.isBuffer = au;
4536
- function Ae(d) {
4615
+ function Ie(d) {
4537
4616
  return Object.prototype.toString.call(d);
4538
4617
  }
4539
4618
  function Je(d) {
4540
4619
  return d < 10 ? "0" + d.toString(10) : d.toString(10);
4541
4620
  }
4542
- var Fe = [
4621
+ var De = [
4543
4622
  "Jan",
4544
4623
  "Feb",
4545
4624
  "Mar",
@@ -4559,39 +4638,39 @@ var uu = gr.exports;
4559
4638
  Je(d.getMinutes()),
4560
4639
  Je(d.getSeconds())
4561
4640
  ].join(":");
4562
- return [d.getDate(), Fe[d.getMonth()], h].join(" ");
4641
+ return [d.getDate(), De[d.getMonth()], h].join(" ");
4563
4642
  }
4564
4643
  t.log = function() {
4565
4644
  console.log("%s - %s", Ut(), t.format.apply(t, arguments));
4566
4645
  }, t.inherits = uu, t._extend = function(d, h) {
4567
4646
  if (!h || !ue(h)) return d;
4568
- for (var m = Object.keys(h), A = m.length; A--; )
4569
- d[m[A]] = h[m[A]];
4647
+ for (var b = Object.keys(h), A = b.length; A--; )
4648
+ d[b[A]] = h[b[A]];
4570
4649
  return d;
4571
4650
  };
4572
- function De(d, h) {
4651
+ function Re(d, h) {
4573
4652
  return Object.prototype.hasOwnProperty.call(d, h);
4574
4653
  }
4575
- var he = typeof Symbol < "u" ? Symbol("util.promisify.custom") : void 0;
4654
+ var ye = typeof Symbol < "u" ? Symbol("util.promisify.custom") : void 0;
4576
4655
  t.promisify = function(h) {
4577
4656
  if (typeof h != "function")
4578
4657
  throw new TypeError('The "original" argument must be of type Function');
4579
- if (he && h[he]) {
4580
- var m = h[he];
4581
- if (typeof m != "function")
4658
+ if (ye && h[ye]) {
4659
+ var b = h[ye];
4660
+ if (typeof b != "function")
4582
4661
  throw new TypeError('The "util.promisify.custom" argument must be of type Function');
4583
- return Object.defineProperty(m, he, {
4584
- value: m,
4662
+ return Object.defineProperty(b, ye, {
4663
+ value: b,
4585
4664
  enumerable: !1,
4586
4665
  writable: !1,
4587
4666
  configurable: !0
4588
- }), m;
4667
+ }), b;
4589
4668
  }
4590
- function m() {
4669
+ function b() {
4591
4670
  for (var A, C, P = new Promise(function(D, W) {
4592
4671
  A = D, C = W;
4593
- }), O = [], L = 0; L < arguments.length; L++)
4594
- O.push(arguments[L]);
4672
+ }), O = [], k = 0; k < arguments.length; k++)
4673
+ O.push(arguments[k]);
4595
4674
  O.push(function(D, W) {
4596
4675
  D ? C(D) : A(W);
4597
4676
  });
@@ -4602,41 +4681,41 @@ var uu = gr.exports;
4602
4681
  }
4603
4682
  return P;
4604
4683
  }
4605
- return Object.setPrototypeOf(m, Object.getPrototypeOf(h)), he && Object.defineProperty(m, he, {
4606
- value: m,
4684
+ return Object.setPrototypeOf(b, Object.getPrototypeOf(h)), ye && Object.defineProperty(b, ye, {
4685
+ value: b,
4607
4686
  enumerable: !1,
4608
4687
  writable: !1,
4609
4688
  configurable: !0
4610
4689
  }), Object.defineProperties(
4611
- m,
4690
+ b,
4612
4691
  e(h)
4613
4692
  );
4614
- }, t.promisify.custom = he;
4615
- function Re(d, h) {
4693
+ }, t.promisify.custom = ye;
4694
+ function Ve(d, h) {
4616
4695
  if (!d) {
4617
- var m = new Error("Promise was rejected with a falsy value");
4618
- m.reason = d, d = m;
4696
+ var b = new Error("Promise was rejected with a falsy value");
4697
+ b.reason = d, d = b;
4619
4698
  }
4620
4699
  return h(d);
4621
4700
  }
4622
- function at(d) {
4701
+ function ut(d) {
4623
4702
  if (typeof d != "function")
4624
4703
  throw new TypeError('The "original" argument must be of type Function');
4625
4704
  function h() {
4626
- for (var m = [], A = 0; A < arguments.length; A++)
4627
- m.push(arguments[A]);
4628
- var C = m.pop();
4705
+ for (var b = [], A = 0; A < arguments.length; A++)
4706
+ b.push(arguments[A]);
4707
+ var C = b.pop();
4629
4708
  if (typeof C != "function")
4630
4709
  throw new TypeError("The last argument must be of type Function");
4631
4710
  var P = this, O = function() {
4632
4711
  return C.apply(P, arguments);
4633
4712
  };
4634
- d.apply(this, m).then(
4635
- function(L) {
4636
- E.nextTick(O.bind(null, null, L));
4713
+ d.apply(this, b).then(
4714
+ function(k) {
4715
+ E.nextTick(O.bind(null, null, k));
4637
4716
  },
4638
- function(L) {
4639
- E.nextTick(Re.bind(null, L, O));
4717
+ function(k) {
4718
+ E.nextTick(Ve.bind(null, k, O));
4640
4719
  }
4641
4720
  );
4642
4721
  }
@@ -4645,10 +4724,10 @@ var uu = gr.exports;
4645
4724
  e(d)
4646
4725
  ), h;
4647
4726
  }
4648
- t.callbackify = at;
4727
+ t.callbackify = ut;
4649
4728
  })(Rt);
4650
4729
  const { inherits: cu, format: Xt } = Rt;
4651
- function Te(t, e, r = Error) {
4730
+ function _e(t, e, r = Error) {
4652
4731
  if (!t) throw new Error("Avvio error code must not be empty");
4653
4732
  if (!e) throw new Error("Avvio base error message must not be empty");
4654
4733
  function n(i, o, s) {
@@ -4661,32 +4740,32 @@ function Te(t, e, r = Error) {
4661
4740
  }, cu(n, r), n;
4662
4741
  }
4663
4742
  var hi = {
4664
- createError: Te,
4665
- AVV_ERR_EXPOSE_ALREADY_DEFINED: Te(
4743
+ createError: _e,
4744
+ AVV_ERR_EXPOSE_ALREADY_DEFINED: _e(
4666
4745
  "AVV_ERR_EXPOSE_ALREADY_DEFINED",
4667
4746
  "'%s' () is already defined, specify an expose option"
4668
4747
  ),
4669
- AVV_ERR_CALLBACK_NOT_FN: Te(
4748
+ AVV_ERR_CALLBACK_NOT_FN: _e(
4670
4749
  "AVV_ERR_CALLBACK_NOT_FN",
4671
4750
  "Callback for '%s' hook is not a function. Received: '%s'"
4672
4751
  ),
4673
- AVV_ERR_PLUGIN_NOT_VALID: Te(
4752
+ AVV_ERR_PLUGIN_NOT_VALID: _e(
4674
4753
  "AVV_ERR_PLUGIN_NOT_VALID",
4675
4754
  "Plugin must be a function or a promise. Received: '%s'"
4676
4755
  ),
4677
- AVV_ERR_ROOT_PLG_BOOTED: Te(
4756
+ AVV_ERR_ROOT_PLG_BOOTED: _e(
4678
4757
  "AVV_ERR_PLUGIN_NOT_VALID",
4679
4758
  "Root plugin has already booted"
4680
4759
  ),
4681
- AVV_ERR_PARENT_PLG_LOADED: Te(
4760
+ AVV_ERR_PARENT_PLG_LOADED: _e(
4682
4761
  "AVV_ERR_PARENT_PLG_LOADED",
4683
4762
  "Impossible to load '%s' plugin because the parent '%s' was already loaded"
4684
4763
  ),
4685
- AVV_ERR_READY_TIMEOUT: Te(
4764
+ AVV_ERR_READY_TIMEOUT: _e(
4686
4765
  "AVV_ERR_READY_TIMEOUT",
4687
4766
  "Plugin did not start in time: '%s'. You may have forgotten to call 'done' function or to resolve a Promise"
4688
4767
  )
4689
- }, lu = function t(e, r, n) {
4768
+ }, du = function t(e, r, n) {
4690
4769
  r === void 0 && (r = ""), n || (n = {});
4691
4770
  var i = function(u) {
4692
4771
  var l = {
@@ -4708,7 +4787,7 @@ var hi = {
4708
4787
  return r + i(c ? "└" : "├") + i("─") + i(f ? "┬" : "─") + " " + t(u, p, n).slice(r.length + 2);
4709
4788
  }).join("");
4710
4789
  };
4711
- const du = lu, vn = Symbol("avvio.TimeTree.untrackNode"), Zt = Symbol("avvio.TimeTree.trackNode"), Sn = Symbol("avvio.TimeTree.getParent"), wn = Symbol("avvio.TimeTree.getNode"), An = Symbol("avvio.TimeTree.addNode");
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");
4712
4791
  let fu = class {
4713
4792
  constructor() {
4714
4793
  this.root = null, this.tableId = /* @__PURE__ */ new Map(), this.tableLabel = /* @__PURE__ */ new Map();
@@ -4716,7 +4795,7 @@ let fu = class {
4716
4795
  [Zt](e) {
4717
4796
  this.tableId.set(e.id, e), this.tableLabel.has(e.label) ? this.tableLabel.get(e.label).push(e) : this.tableLabel.set(e.label, [e]);
4718
4797
  }
4719
- [vn](e) {
4798
+ [Sn](e) {
4720
4799
  this.tableId.delete(e.id);
4721
4800
  const r = this.tableLabel.get(e.label);
4722
4801
  if (r.id) {
@@ -4725,16 +4804,16 @@ let fu = class {
4725
4804
  }
4726
4805
  r.pop(), r.length === 0 && this.tableLabel.delete(e.label);
4727
4806
  }
4728
- [Sn](e) {
4807
+ [wn](e) {
4729
4808
  if (e === null)
4730
4809
  return this.root;
4731
4810
  const r = this.tableLabel.get(e);
4732
4811
  return r.id ? r : r[r.length - 1];
4733
4812
  }
4734
- [wn](e) {
4813
+ [An](e) {
4735
4814
  return this.tableId.get(e);
4736
4815
  }
4737
- [An](e, r, n) {
4816
+ [En](e, r, n) {
4738
4817
  if (e === null)
4739
4818
  return this.root = {
4740
4819
  id: "root",
@@ -4742,7 +4821,7 @@ let fu = class {
4742
4821
  start: n,
4743
4822
  nodes: []
4744
4823
  }, this[Zt](this.root), this.root.id;
4745
- const o = this[Sn](e), s = `${r}-${Math.random()}`, a = {
4824
+ const o = this[wn](e), s = `${r}-${Math.random()}`, a = {
4746
4825
  id: s,
4747
4826
  parent: e,
4748
4827
  start: n,
@@ -4752,24 +4831,24 @@ let fu = class {
4752
4831
  return o.nodes.push(a), this[Zt](a), s;
4753
4832
  }
4754
4833
  start(e, r, n = Date.now()) {
4755
- return this[An](e, r, n);
4834
+ return this[En](e, r, n);
4756
4835
  }
4757
4836
  stop(e, r = Date.now()) {
4758
- const n = this[wn](e);
4759
- n && (n.stop = r, n.diff = n.stop - n.start || 0, this[vn](n));
4837
+ const n = this[An](e);
4838
+ n && (n.stop = r, n.diff = n.stop - n.start || 0, this[Sn](n));
4760
4839
  }
4761
4840
  toJSON() {
4762
4841
  return Object.assign({}, this.root);
4763
4842
  }
4764
4843
  prittyPrint() {
4765
4844
  const e = (n) => (n.label = `${n.label} ${n.diff} ms`, n.nodes.length > 0 && (n.nodes = n.nodes.map((i) => e(i))), n), r = e(this.toJSON());
4766
- return du(r);
4845
+ return lu(r);
4767
4846
  }
4768
4847
  };
4769
- var pu = fu, Dr = { exports: {} }, br = { exports: {} }, er, En;
4848
+ var pu = fu, Rr = { exports: {} }, vr = { exports: {} }, er, In;
4770
4849
  function hu() {
4771
- if (En) return er;
4772
- En = 1;
4850
+ if (In) return er;
4851
+ In = 1;
4773
4852
  var t = 1e3, e = t * 60, r = e * 60, n = r * 24, i = n * 7, o = n * 365.25;
4774
4853
  er = function(c, f) {
4775
4854
  f = f || {};
@@ -4861,10 +4940,10 @@ function yu(t) {
4861
4940
  r.selectColor = e;
4862
4941
  function r(c) {
4863
4942
  let f, p = null, v, w;
4864
- function b(...g) {
4865
- if (!b.enabled)
4943
+ function m(...g) {
4944
+ if (!m.enabled)
4866
4945
  return;
4867
- const S = b, F = Number(/* @__PURE__ */ new Date()), z = F - (f || F);
4946
+ const S = m, F = Number(/* @__PURE__ */ new Date()), z = F - (f || F);
4868
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");
4869
4948
  let ne = 0;
4870
4949
  g[0] = g[0].replace(/%([a-zA-Z%])/g, (V, _) => {
@@ -4879,14 +4958,14 @@ function yu(t) {
4879
4958
  return V;
4880
4959
  }), r.formatArgs.call(S, g), (S.log || r.log).apply(S, g);
4881
4960
  }
4882
- return b.namespace = c, b.useColors = r.useColors(), b.color = r.selectColor(c), b.extend = n, b.destroy = r.destroy, Object.defineProperty(b, "enabled", {
4961
+ return m.namespace = c, m.useColors = r.useColors(), m.color = r.selectColor(c), m.extend = n, m.destroy = r.destroy, Object.defineProperty(m, "enabled", {
4883
4962
  enumerable: !0,
4884
4963
  configurable: !1,
4885
4964
  get: () => p !== null ? p : (v !== r.namespaces && (v = r.namespaces, w = r.enabled(c)), w),
4886
4965
  set: (g) => {
4887
4966
  p = g;
4888
4967
  }
4889
- }), typeof r.init == "function" && r.init(b), b;
4968
+ }), typeof r.init == "function" && r.init(m), m;
4890
4969
  }
4891
4970
  function n(c, f) {
4892
4971
  const p = r(this.namespace + (typeof f > "u" ? ":" : f) + c);
@@ -5062,8 +5141,8 @@ var mu = yu;
5062
5141
  return "[UnexpectedJSONParseError]: " + l.message;
5063
5142
  }
5064
5143
  };
5065
- })(br, br.exports);
5066
- var yi = br.exports;
5144
+ })(vr, vr.exports);
5145
+ var yi = vr.exports;
5067
5146
  const gu = jn, bu = Jn.EventEmitter, vu = Rt.inherits, x = yi("avvio"), { AVV_ERR_READY_TIMEOUT: Su } = hi, tr = Symbol.for("plugin-meta");
5068
5147
  function wu(t, e) {
5069
5148
  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(`
@@ -5156,12 +5235,12 @@ Ye.prototype.finish = function(t, e) {
5156
5235
  };
5157
5236
  function Eu(t, e) {
5158
5237
  const r = this;
5159
- E.nextTick(Rr.bind(r), t, e);
5238
+ E.nextTick(Vr.bind(r), t, e);
5160
5239
  }
5161
- function Rr(t, e) {
5240
+ function Vr(t, e) {
5162
5241
  if (typeof t.func.then == "function") {
5163
5242
  t.func.then((n) => {
5164
- typeof n.default == "function" && (n = n.default), t.func = n, Rr.call(this, t, e);
5243
+ typeof n.default == "function" && (n = n.default), t.func = n, Vr.call(this, t, e);
5165
5244
  }, e);
5166
5245
  return;
5167
5246
  }
@@ -5174,16 +5253,16 @@ function Rr(t, e) {
5174
5253
  }
5175
5254
  function Iu() {
5176
5255
  }
5177
- Dr.exports = Ye;
5178
- Dr.exports.loadPlugin = Rr;
5179
- var Ou = Dr.exports;
5180
- const In = jn, Tu = Jn.EventEmitter, _u = Rt.inherits, {
5256
+ Rr.exports = Ye;
5257
+ Rr.exports.loadPlugin = Vr;
5258
+ var Ou = Rr.exports;
5259
+ const On = jn, Tu = Jn.EventEmitter, _u = Rt.inherits, {
5181
5260
  AVV_ERR_EXPOSE_ALREADY_DEFINED: rr,
5182
5261
  AVV_ERR_CALLBACK_NOT_FN: tt,
5183
- AVV_ERR_PLUGIN_NOT_VALID: Lu,
5262
+ AVV_ERR_PLUGIN_NOT_VALID: ku,
5184
5263
  AVV_ERR_ROOT_PLG_BOOTED: Cu,
5185
5264
  AVV_ERR_READY_TIMEOUT: Pu
5186
- } = hi, ku = pu, vr = Ou, He = yi("avvio"), Pt = Symbol("kAvvio"), nr = Symbol("kThenifyDoNotWrap");
5265
+ } = hi, Lu = pu, Sr = Ou, He = yi("avvio"), Pt = Symbol("kAvvio"), nr = Symbol("kThenifyDoNotWrap");
5187
5266
  function Nu(t, e, r) {
5188
5267
  const n = e.expose || {}, i = n.use || "use", o = n.after || "after", s = n.ready || "ready", a = n.onClose || "onClose", u = n.close || "close";
5189
5268
  if (t[i])
@@ -5215,16 +5294,16 @@ function K(t, e, r) {
5215
5294
  const n = new K(t, e, r);
5216
5295
  return t && Nu(t, e, n), n;
5217
5296
  }
5218
- 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 ku(), this._readyQ = In(this, gi, 1), this._readyQ.pause(), this._readyQ.drain = () => {
5219
- this.emit("start"), this._readyQ.drain = On;
5220
- }, this._closeQ = In(this, Vu, 1), this._closeQ.pause(), this._closeQ.drain = () => {
5221
- this.emit("close"), this._closeQ.drain = On;
5222
- }, this._doStart = null, this._root = new vr(this, Fu.bind(this), e, !1, 0), this._root.once("start", (n, i, o) => {
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;
5301
+ }, this._doStart = null, this._root = new Sr(this, Fu.bind(this), e, !1, 0), this._root.once("start", (n, i, o) => {
5223
5302
  const s = this.pluginTree.start(null, i, o);
5224
5303
  this._root.once("loaded", (a, u, l) => {
5225
5304
  this.pluginTree.stop(s, l);
5226
5305
  });
5227
- }), vr.loadPlugin.call(this, this._root, (n) => {
5306
+ }), Sr.loadPlugin.call(this, this._root, (n) => {
5228
5307
  He("root plugin ready");
5229
5308
  try {
5230
5309
  this.emit("preReady"), this._root = null;
@@ -5251,7 +5330,7 @@ K.prototype.override = function(t, e, r) {
5251
5330
  };
5252
5331
  function Du(t) {
5253
5332
  if (t && typeof t == "object" && typeof t.default == "function" && (t = t.default), !(t && (typeof t == "function" || typeof t.then == "function")))
5254
- throw new Lu(typeof t);
5333
+ throw new ku(typeof t);
5255
5334
  return t;
5256
5335
  }
5257
5336
  K.prototype[Pt] = !0;
@@ -5266,7 +5345,7 @@ Object.defineProperty(K.prototype, "then", { get: mi });
5266
5345
  K.prototype._addPlugin = function(t, e, r) {
5267
5346
  if (t = Du(t), e = e || {}, this.booted)
5268
5347
  throw new Cu();
5269
- const n = this._current[0], i = new vr(this, t, e, r);
5348
+ const n = this._current[0], i = new Sr(this, t, e, r);
5270
5349
  if (i.once("start", (o, s, a) => {
5271
5350
  const u = this.pluginTree.start(n.name, s, a);
5272
5351
  i.once("loaded", (l, c, f) => {
@@ -5334,7 +5413,7 @@ K.prototype.prettyPrint = function() {
5334
5413
  K.prototype.toJSON = function() {
5335
5414
  return this.pluginTree.toJSON();
5336
5415
  };
5337
- function On() {
5416
+ function Tn() {
5338
5417
  }
5339
5418
  function mi() {
5340
5419
  if (this.booted) {
@@ -5407,16 +5486,16 @@ function ir(t, e) {
5407
5486
  }, i) : E.nextTick(i)) : t.length === 2 ? t(n, i) : t(n, this, i) : E.nextTick(i);
5408
5487
  }
5409
5488
  }
5410
- Er.exports = K;
5411
- Er.exports.express = function(t) {
5489
+ Ir.exports = K;
5490
+ Ir.exports.express = function(t) {
5412
5491
  return K(t, {
5413
5492
  expose: {
5414
5493
  use: "load"
5415
5494
  }
5416
5495
  });
5417
5496
  };
5418
- var Mu = Er.exports;
5419
- const Bu = /* @__PURE__ */ ps(Mu);
5497
+ var Bu = Ir.exports;
5498
+ const Mu = /* @__PURE__ */ ps(Bu);
5420
5499
  (function() {
5421
5500
  if (window.requestAnimationFrame && window.cancelAnimationFrame)
5422
5501
  return;
@@ -5435,12 +5514,18 @@ const Bu = /* @__PURE__ */ ps(Mu);
5435
5514
  }
5436
5515
  })();
5437
5516
  function cc(t, e = !0, r = !0, n = { friendsTab: "enabled" }) {
5438
- 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 = Bu(/* @__PURE__ */ Object.create({}), { autostart: !1 });
5439
- return s.use(xo, { friendsTab: n.friendsTab, theme: n.theme, themeMode: n.themeMode }), s.use(Vo, { onDeepLinkHandled: n?.onDeepLinkHandled }), s.use(qo, { videoPlayerController: n?.videoPlayerController }), s.use(jo, {
5517
+ 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, {
5519
+ hideFriends: n.hideFriends,
5520
+ skipOnboarding: n.skipOnboarding,
5521
+ friendsTab: n.friendsTab,
5522
+ theme: n.theme,
5523
+ themeMode: n.themeMode
5524
+ }), s.use(Vo, { onDeepLinkHandled: n?.onDeepLinkHandled }), s.use(qo, { videoPlayerController: n?.videoPlayerController }), s.use(jo, {
5440
5525
  onContentActivate: n?.onContentActivate,
5441
5526
  withAd: n?.withAd,
5442
5527
  withAdNotification: n?.withAdNotification
5443
- }), s.use(eo, { sdkKey: t, host: i, analyticsHost: o, version: n?.version }), s.use(oo), s.use(Bo), s.use(rs), s.use(To), s.use(fs), s.after((a, u, l) => {
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) => {
5444
5529
  if (a)
5445
5530
  throw a;
5446
5531
  u.ready(), l();