@streamlayer/sdk-web 1.2.7 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/lib/cjs/index.js +7 -7
  2. package/lib/es/index.js +1074 -1137
  3. package/package.json +12 -12
package/lib/es/index.js CHANGED
@@ -1,28 +1,28 @@
1
- import { pino as yi } from "pino";
2
- import { QuestionType as F, QuestionStatus as H, NotificationEnabled as gi, SilenceSetting as mi, PromotionType as Te } from "@streamlayer/sl-eslib/interactive/interactive.common_pb";
3
- import { PickHistoryStatus as lt } from "@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb";
1
+ import { pino as mi } from "pino";
2
+ import { QuestionType as _, QuestionStatus as W, NotificationEnabled as gi, SilenceSetting as vi, PromotionType as Te } from "@streamlayer/sl-eslib/interactive/interactive.common_pb";
3
+ import { PickHistoryStatus as ct } from "@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb";
4
4
  import { SdkOverlayType as D } from "@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb";
5
5
  import { InvitationCategory as Dr, InvitationFrom as Rr } from "@streamlayer/sl-eslib/analytics/v1/invitations/invitations_pb";
6
- import { computed as vi, map as bi, atom as Ct, batched as Vr, onMount as nt } from "nanostores";
6
+ import { computed as bi, map as Si, atom as Ct, batched as Vr, onMount as Lt } from "nanostores";
7
7
  import { nanoid as nr } from "nanoid";
8
- import { ConnectError as tt, Code as se, createContextKey as $r, createPromiseClient as Mr, createContextValues as Si } from "@connectrpc/connect";
8
+ import { ConnectError as tt, Code as oe, createContextKey as $r, createPromiseClient as Mr, createContextValues as wi } from "@connectrpc/connect";
9
9
  import { createGrpcWebTransport as jr } from "@connectrpc/connect-web";
10
10
  import { nanoquery as Ur } from "@nanostores/query";
11
11
  import { Events as wn } from "@streamlayer/sl-eslib/sports/events/events_connect";
12
- import { Client as it } from "@streamlayer/sl-eslib/sdkSettings/client/client_connect";
12
+ import { Client as nt } from "@streamlayer/sl-eslib/sdkSettings/client/client_connect";
13
13
  import { Users as vr } from "@streamlayer/sl-eslib/users/users_connect";
14
- import { Feed as ne } from "@streamlayer/sl-eslib/interactive/feed/interactive.feed_connect";
14
+ import { Feed as re } from "@streamlayer/sl-eslib/interactive/feed/interactive.feed_connect";
15
15
  import { Leaderboard as An } from "@streamlayer/sl-eslib/interactive/leaderboard/interactive.leaderboard_connect";
16
16
  import "@streamlayer/sl-eslib/interactive/leaderboard/interactive.leaderboard_pb";
17
- import { LinksClient as wi } from "@streamlayer/sl-eslib/shortLinks/linksClient_connect";
18
- import { Kind as x, TopicSubType as we, TopicType as z, PollOpenedFrom as ee, Category as G, ScreenOrientation as Br } from "@streamlayer/sl-eslib/analytics/v1/common/analytics.common_pb";
17
+ import { LinksClient as Ai } from "@streamlayer/sl-eslib/shortLinks/linksClient_connect";
18
+ import { Kind as q, TopicSubType as we, TopicType as z, PollOpenedFrom as ee, Category as G, ScreenOrientation as Br } from "@streamlayer/sl-eslib/analytics/v1/common/analytics.common_pb";
19
19
  import { AnalyticsService as En } from "@streamlayer/sl-eslib/analytics/v2/streaming/streaming_connect";
20
20
  import { InteractionActionType as qr } from "@streamlayer/sl-eslib/analytics/v1/interactions/interactions_pb";
21
- import { NotificationKind as he, NotificationType as xr } from "@streamlayer/sl-eslib/analytics/v1/notifications/notifications_pb";
22
- function Ai(t) {
21
+ import { NotificationKind as fe, NotificationType as xr } from "@streamlayer/sl-eslib/analytics/v1/notifications/notifications_pb";
22
+ function Ei(t) {
23
23
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
24
24
  }
25
- var In = { exports: {} }, $ = In.exports = {}, ae, ue;
25
+ var In = { exports: {} }, $ = In.exports = {}, se, ae;
26
26
  function ir() {
27
27
  throw new Error("setTimeout has not been defined");
28
28
  }
@@ -31,60 +31,60 @@ function or() {
31
31
  }
32
32
  (function() {
33
33
  try {
34
- typeof setTimeout == "function" ? ae = setTimeout : ae = ir;
34
+ typeof setTimeout == "function" ? se = setTimeout : se = ir;
35
35
  } catch {
36
- ae = ir;
36
+ se = ir;
37
37
  }
38
38
  try {
39
- typeof clearTimeout == "function" ? ue = clearTimeout : ue = or;
39
+ typeof clearTimeout == "function" ? ae = clearTimeout : ae = or;
40
40
  } catch {
41
- ue = or;
41
+ ae = or;
42
42
  }
43
43
  })();
44
44
  function Tn(t) {
45
- if (ae === setTimeout)
45
+ if (se === setTimeout)
46
46
  return setTimeout(t, 0);
47
- if ((ae === ir || !ae) && setTimeout)
48
- return ae = setTimeout, setTimeout(t, 0);
47
+ if ((se === ir || !se) && setTimeout)
48
+ return se = setTimeout, setTimeout(t, 0);
49
49
  try {
50
- return ae(t, 0);
50
+ return se(t, 0);
51
51
  } catch {
52
52
  try {
53
- return ae.call(null, t, 0);
53
+ return se.call(null, t, 0);
54
54
  } catch {
55
- return ae.call(this, t, 0);
55
+ return se.call(this, t, 0);
56
56
  }
57
57
  }
58
58
  }
59
- function Ei(t) {
60
- if (ue === clearTimeout)
59
+ function Ii(t) {
60
+ if (ae === clearTimeout)
61
61
  return clearTimeout(t);
62
- if ((ue === or || !ue) && clearTimeout)
63
- return ue = clearTimeout, clearTimeout(t);
62
+ if ((ae === or || !ae) && clearTimeout)
63
+ return ae = clearTimeout, clearTimeout(t);
64
64
  try {
65
- return ue(t);
65
+ return ae(t);
66
66
  } catch {
67
67
  try {
68
- return ue.call(null, t);
68
+ return ae.call(null, t);
69
69
  } catch {
70
- return ue.call(this, t);
70
+ return ae.call(this, t);
71
71
  }
72
72
  }
73
73
  }
74
- var ve = [], xe = !1, _e, ht = -1;
75
- function Ii() {
76
- !xe || !_e || (xe = !1, _e.length ? ve = _e.concat(ve) : ht = -1, ve.length && On());
74
+ var ge = [], xe = !1, _e, ft = -1;
75
+ function Ti() {
76
+ !xe || !_e || (xe = !1, _e.length ? ge = _e.concat(ge) : ft = -1, ge.length && On());
77
77
  }
78
78
  function On() {
79
79
  if (!xe) {
80
- var t = Tn(Ii);
80
+ var t = Tn(Ti);
81
81
  xe = !0;
82
- for (var e = ve.length; e; ) {
83
- for (_e = ve, ve = []; ++ht < e; )
84
- _e && _e[ht].run();
85
- ht = -1, e = ve.length;
82
+ for (var e = ge.length; e; ) {
83
+ for (_e = ge, ge = []; ++ft < e; )
84
+ _e && _e[ft].run();
85
+ ft = -1, e = ge.length;
86
86
  }
87
- _e = null, xe = !1, Ei(t);
87
+ _e = null, xe = !1, Ii(t);
88
88
  }
89
89
  }
90
90
  $.nextTick = function(t) {
@@ -92,7 +92,7 @@ $.nextTick = function(t) {
92
92
  if (arguments.length > 1)
93
93
  for (var r = 1; r < arguments.length; r++)
94
94
  e[r - 1] = arguments[r];
95
- ve.push(new _n(t, e)), ve.length === 1 && !xe && Tn(On);
95
+ ge.push(new _n(t, e)), ge.length === 1 && !xe && Tn(On);
96
96
  };
97
97
  function _n(t, e) {
98
98
  this.fun = t, this.array = e;
@@ -106,17 +106,17 @@ $.env = {};
106
106
  $.argv = [];
107
107
  $.version = "";
108
108
  $.versions = {};
109
- function be() {
109
+ function ve() {
110
110
  }
111
- $.on = be;
112
- $.addListener = be;
113
- $.once = be;
114
- $.off = be;
115
- $.removeListener = be;
116
- $.removeAllListeners = be;
117
- $.emit = be;
118
- $.prependListener = be;
119
- $.prependOnceListener = be;
111
+ $.on = ve;
112
+ $.addListener = ve;
113
+ $.once = ve;
114
+ $.off = ve;
115
+ $.removeListener = ve;
116
+ $.removeAllListeners = ve;
117
+ $.emit = ve;
118
+ $.prependListener = ve;
119
+ $.prependOnceListener = ve;
120
120
  $.listeners = function(t) {
121
121
  return [];
122
122
  };
@@ -132,8 +132,8 @@ $.chdir = function(t) {
132
132
  $.umask = function() {
133
133
  return 0;
134
134
  };
135
- var Ti = In.exports;
136
- const A = /* @__PURE__ */ Ai(Ti), Oi = yi({
135
+ var Oi = In.exports;
136
+ const w = /* @__PURE__ */ Ei(Oi), _i = mi({
137
137
  level: "trace",
138
138
  enabled: typeof window < "u" && !!window.localStorage.getItem("SL_DEBUG"),
139
139
  browser: {
@@ -141,22 +141,22 @@ const A = /* @__PURE__ */ Ai(Ti), Oi = yi({
141
141
  console.log(t);
142
142
  }
143
143
  }
144
- }), le = (t, e) => Oi.child({ name: t }, e);
145
- class _i extends Event {
144
+ }), be = (t, e) => _i.child({ name: t }, e);
145
+ class Ci extends Event {
146
146
  slEventBus;
147
147
  constructor(e, r) {
148
148
  super(e), this.slEventBus = r;
149
149
  }
150
150
  }
151
- const Li = le("event-bus");
152
- class Ci {
151
+ const Li = be("event-bus");
152
+ class ki {
153
153
  name;
154
154
  listeners;
155
155
  constructor(e = "sl-event-bus") {
156
156
  this.name = e, this.listeners = /* @__PURE__ */ new Set();
157
157
  }
158
158
  emit = (e, r) => {
159
- const n = new _i(this.name, { ...r, type: e });
159
+ const n = new Ci(this.name, { ...r, type: e });
160
160
  Li.debug(n, "Emitting event"), window.dispatchEvent(n);
161
161
  };
162
162
  listen(e) {
@@ -173,7 +173,7 @@ class Ci {
173
173
  }), this.listeners.clear();
174
174
  };
175
175
  }
176
- class ki {
176
+ class Pi {
177
177
  }
178
178
  window.slStore = /* @__PURE__ */ Object.create(null);
179
179
  class kt {
@@ -192,23 +192,23 @@ class kt {
192
192
  return this.store;
193
193
  }
194
194
  }
195
- const Pi = (t) => {
195
+ const Ni = (t) => {
196
196
  const e = Object.keys(t);
197
- return vi(e.map((r) => t[r].getStore()), (...r) => Object.fromEntries(e.map((n, i) => [n, r[i]])));
197
+ return bi(e.map((r) => t[r].getStore()), (...r) => Object.fromEntries(e.map((n, i) => [n, r[i]])));
198
198
  };
199
- class Le extends kt {
199
+ class Ce extends kt {
200
200
  getValues = () => this.getStore().get();
201
201
  getValue = (e) => this.getStore().get()[e];
202
202
  setValue = (e, r) => this.getStore().setKey(e, r);
203
203
  subscribe = (...e) => this.getStore().subscribe(...e);
204
204
  unsubscribe = () => this.getStore().off();
205
205
  }
206
- const te = (t) => bi(t);
207
- var ye;
206
+ const te = (t) => Si(t);
207
+ var pe;
208
208
  (function(t) {
209
209
  t.ORGANIZATION = "ORGANIZATION", t.STREAM = "STREAM";
210
- })(ye || (ye = {}));
211
- const Ni = {
210
+ })(pe || (pe = {}));
211
+ const Fi = {
212
212
  [D.BETTING]: "betting",
213
213
  [D.GAMES]: "games",
214
214
  [D.PUBLIC_CHAT]: "publicChat",
@@ -218,7 +218,7 @@ var Xe;
218
218
  (function(t) {
219
219
  t.Ready = "ready", t.Suspended = "suspended";
220
220
  })(Xe || (Xe = {}));
221
- class Ln {
221
+ class Cn {
222
222
  status;
223
223
  source;
224
224
  config;
@@ -226,7 +226,7 @@ class Ln {
226
226
  listeners = /* @__PURE__ */ new Set();
227
227
  settingsKey;
228
228
  constructor({ settings: e, ...r }, n) {
229
- this.settingsKey = Ni[r.type], this.status = Ct(Xe.Suspended), this.config = new Le(te(r), `feature:config:${this.settingsKey}`), this.settingsKey !== void 0 && e?.overlaySettings.case === this.settingsKey ? this.settings = new Le(te(e.overlaySettings.value), `feature:settings:${this.settingsKey}`) : this.settings = new Le(te({}), `feature:settings:${this.settingsKey}`), this.source = n;
229
+ this.settingsKey = Fi[r.type], this.status = Ct(Xe.Suspended), this.config = new Ce(te(r), `feature:config:${this.settingsKey}`), this.settingsKey !== void 0 && e?.overlaySettings.case === this.settingsKey ? this.settings = new Ce(te(e.overlaySettings.value), `feature:settings:${this.settingsKey}`) : this.settings = new Ce(te({}), `feature:settings:${this.settingsKey}`), this.source = n;
230
230
  }
231
231
  get featureConfig() {
232
232
  return this.config.getStore();
@@ -257,7 +257,7 @@ class Ln {
257
257
  }
258
258
  };
259
259
  update = (e, r) => {
260
- this.source === ye.STREAM && r === ye.ORGANIZATION || (this.setFeatureConfig(e), this.source = r);
260
+ this.source === pe.STREAM && r === pe.ORGANIZATION || (this.setFeatureConfig(e), this.source = r);
261
261
  };
262
262
  fireEvent(e) {
263
263
  for (const r of this.listeners.values())
@@ -283,8 +283,8 @@ class Y extends kt {
283
283
  return this.getStore().get();
284
284
  }
285
285
  }
286
- const B = (t) => Ct(t);
287
- class re extends kt {
286
+ const x = (t) => Ct(t);
287
+ class ce extends kt {
288
288
  atomStore;
289
289
  constructor(e, r, n) {
290
290
  super(e, `api:${r}`), this.atomStore = Ct(), n && e.subscribe((i) => {
@@ -315,10 +315,10 @@ class re extends kt {
315
315
  key = () => this.getStore().key;
316
316
  off = () => this.getStore().off();
317
317
  }
318
- const J = new Ci();
319
- async function* Fi(t, e) {
318
+ const J = new ki();
319
+ async function* Di(t, e) {
320
320
  for await (const r of e) {
321
- t.response.message = r, t.received_at = Date.now(), t.id = Cn++;
321
+ t.response.message = r, t.received_at = Date.now(), t.id = Ln++;
322
322
  const n = {
323
323
  type: "__GRPC_DEVTOOLS_EXTENSION__",
324
324
  data: t
@@ -326,10 +326,10 @@ async function* Fi(t, e) {
326
326
  window.postMessage(n), yield r;
327
327
  }
328
328
  }
329
- let Cn = 0;
330
- const Di = () => (t) => async (e) => {
329
+ let Ln = 0;
330
+ const Ri = () => (t) => async (e) => {
331
331
  const r = {
332
- id: Cn++,
332
+ id: Ln++,
333
333
  name: e.url,
334
334
  stream: e.stream,
335
335
  sent_at: Date.now(),
@@ -356,7 +356,7 @@ const Di = () => (t) => async (e) => {
356
356
  };
357
357
  return window.postMessage(i), {
358
358
  ...n,
359
- message: Fi(r, n.message)
359
+ message: Di(r, n.message)
360
360
  };
361
361
  } else {
362
362
  r.response.message = n.message, r.latency = r.received_at - r.sent_at;
@@ -420,7 +420,7 @@ var Z;
420
420
  (function(t) {
421
421
  t.Init = "init", t.Ready = "ready", t.Connecting = "connecting", t.Connected = "connected", t.Disconnected = "disconnected", t.Failed = "failed", t.Reconnect = "reconnect", t.Reconnecting = "reconnecting";
422
422
  })(Z || (Z = {}));
423
- class Ri {
423
+ class Vi {
424
424
  params;
425
425
  streamCancel;
426
426
  method;
@@ -438,13 +438,13 @@ class Ri {
438
438
  ts: /* @__PURE__ */ new Date(),
439
439
  log: []
440
440
  };
441
- this.state = new Le(te(o), `subscription:${i.name}:state`), this.options = {
441
+ this.state = new Ce(te(o), `subscription:${i.name}:state`), this.options = {
442
442
  ...i,
443
443
  reconnectDelay: i.reconnectDelay ?? 1e3,
444
444
  reconnectMaxDelay: i.reconnectMaxDelay ?? 3e4,
445
445
  reconnectMaxAttempts: i.reconnectMaxAttempts ?? 10,
446
446
  withStore: i.withStore ?? !1
447
- }, this.headers = e, this.listeners = /* @__PURE__ */ new Map(), this.params = n, this.method = r, i.withStore && (this.store = new Y(B(null), `subscription:${i.name}:store`)), "subscribe" in n && typeof n.subscribe == "function" && (this.paramsListener = n.subscribe((s) => {
447
+ }, this.headers = e, this.listeners = /* @__PURE__ */ new Map(), this.params = n, this.method = r, i.withStore && (this.store = new Y(x(null), `subscription:${i.name}:store`)), "subscribe" in n && typeof n.subscribe == "function" && (this.paramsListener = n.subscribe((s) => {
448
448
  this.state.getValue("status") === Z.Connected && (this.addStateLog(`params updated, reconnect => ${JSON.stringify(s)}`), this.reconnect());
449
449
  })), this.updateState(Z.Ready);
450
450
  }
@@ -479,7 +479,7 @@ class Ri {
479
479
  for await (const o of i)
480
480
  this.attempt = 0, this.onData(o);
481
481
  } catch (n) {
482
- n instanceof tt && n.code != se.Canceled && this.onStreamError(n);
482
+ n instanceof tt && n.code != oe.Canceled && this.onStreamError(n);
483
483
  }
484
484
  })(), this.updateState(Z.Connected);
485
485
  };
@@ -519,7 +519,7 @@ class Ri {
519
519
  */
520
520
  onStreamError = (e) => {
521
521
  if (this.addStateLog(`error => ${e ? JSON.stringify(e) : "undefined"}}`), e !== void 0) {
522
- if (e instanceof tt && e.code !== se.Canceled) {
522
+ if (e instanceof tt && e.code !== oe.Canceled) {
523
523
  this.updateState(Z.Failed), this.state.setValue("error", e), this.reconnect();
524
524
  return;
525
525
  }
@@ -527,15 +527,15 @@ class Ri {
527
527
  }
528
528
  };
529
529
  }
530
- const Vi = /* @__PURE__ */ new Set([
531
- se.Unknown,
532
- se.Internal,
533
- se.DeadlineExceeded,
534
- se.ResourceExhausted,
535
- se.FailedPrecondition,
536
- se.Unavailable,
537
- se.DataLoss
538
- ]), Qr = le("grpc:retry"), $i = (t) => async (e) => {
530
+ const $i = /* @__PURE__ */ new Set([
531
+ oe.Unknown,
532
+ oe.Internal,
533
+ oe.DeadlineExceeded,
534
+ oe.ResourceExhausted,
535
+ oe.FailedPrecondition,
536
+ oe.Unavailable,
537
+ oe.DataLoss
538
+ ]), Qr = be("grpc:retry"), Mi = (t) => async (e) => {
539
539
  const r = e.contextValues.get(sr.retryAttempts), n = 300, i = e.contextValues.get(sr.retryDelay);
540
540
  if (e.stream || r === 0)
541
541
  return t(e);
@@ -546,7 +546,7 @@ const Vi = /* @__PURE__ */ new Set([
546
546
  } catch (s) {
547
547
  Qr.trace({ attempt: o, error: s }, "retry attempt");
548
548
  const a = tt.from(s);
549
- if (o >= r || !(a instanceof tt) || !Vi.has(a.code))
549
+ if (o >= r || !(a instanceof tt) || !$i.has(a.code))
550
550
  throw s;
551
551
  const u = Math.min(i, Math.pow(2, o) * n), f = Math.round(u * (1 + Math.random()) / 2);
552
552
  await new Promise((c) => setTimeout(c, f));
@@ -554,13 +554,13 @@ const Vi = /* @__PURE__ */ new Set([
554
554
  }, sr = {
555
555
  retryAttempts: $r(10, { description: "Number of attempts to retry" }),
556
556
  retryDelay: $r(3e4, { description: "Max delay between retries in milliseconds" })
557
- }, Mi = () => {
557
+ }, ji = () => {
558
558
  const t = localStorage.getItem("sl-device-id");
559
559
  if (t)
560
560
  return t;
561
561
  const e = nr();
562
562
  return localStorage.setItem("sl-device-id", e), e;
563
- }, ji = () => navigator.userAgentData?.platform || navigator.platform;
563
+ }, Ui = () => navigator.userAgentData?.platform || navigator.platform;
564
564
  class Gr {
565
565
  toJsonOptions = {
566
566
  emitDefaultValues: !1,
@@ -580,9 +580,9 @@ class Gr {
580
580
  subscriptions;
581
581
  opts;
582
582
  constructor(e, r) {
583
- this.host = e, this.opts = r, this.$headers = new Le(te({
584
- "sl-device-id": Mi(),
585
- "sl-device-os": ji()
583
+ this.host = e, this.opts = r, this.$headers = new Ce(te({
584
+ "sl-device-id": ji(),
585
+ "sl-device-os": Ui()
586
586
  }), "transport:headers"), this.initInterceptors(), this.clients = /* @__PURE__ */ new Map(), this.streamClients = /* @__PURE__ */ new Map(), this.subscriptions = /* @__PURE__ */ new Map();
587
587
  const [n, i, o] = Ur({
588
588
  dedupeTime: r?.dedupeTime,
@@ -606,7 +606,7 @@ class Gr {
606
606
  const i = this.subscriptions.get(r);
607
607
  if (i)
608
608
  return i;
609
- const o = new Ri(this.$headers, e, r, n);
609
+ const o = new Vi(this.$headers, e, r, n);
610
610
  return this.subscriptions.set(r, o), o;
611
611
  };
612
612
  removeSubscription = (e) => {
@@ -651,10 +651,10 @@ class Gr {
651
651
  ...Array.isArray(r) ? r : [r]
652
652
  ], a = [e.typeName, o.charAt(0).toLowerCase() + o.slice(1)];
653
653
  return { client: i, createRequestOptions: (f) => {
654
- const c = Si();
655
- for (const h in f) {
656
- const l = sr[h];
657
- c.set(l, f[h]);
654
+ const c = wi();
655
+ for (const l in f) {
656
+ const h = sr[l];
657
+ c.set(h, f[l]);
658
658
  }
659
659
  return c;
660
660
  }, queryKey: s, queryKeyStr: a.join("") };
@@ -679,10 +679,10 @@ class Gr {
679
679
  n.header.set(o, i[o]);
680
680
  return r(n);
681
681
  };
682
- this.interceptors.push(e), this.interceptors.push(Di()), this.opts?.retryable && this.interceptors.push($i);
682
+ this.interceptors.push(e), this.interceptors.push(Ri()), this.opts?.retryable && this.interceptors.push(Mi);
683
683
  };
684
684
  }
685
- const Ui = (t, e) => {
685
+ const Bi = (t, e) => {
686
686
  const { client: r, queryKey: n } = e.createPromiseClient(wn, {
687
687
  method: "retrieveEventId",
688
688
  params: [t]
@@ -700,22 +700,22 @@ const Ui = (t, e) => {
700
700
  }
701
701
  }
702
702
  });
703
- }, Bi = (t, e) => {
704
- const { client: r, queryKey: n } = e.createPromiseClient(it, { method: "getStream", params: [t] });
703
+ }, qi = (t, e) => {
704
+ const { client: r, queryKey: n } = e.createPromiseClient(nt, { method: "getStream", params: [t] });
705
705
  return e.nanoquery.createFetcherStore(n, {
706
706
  fetcher: async (i, o, s) => s ? (await r.getStream({
707
707
  id: s
708
708
  // we are sure that id is a string
709
709
  })).data?.attributes : void 0
710
710
  });
711
- }, qi = (t, e) => {
711
+ }, xi = (t, e) => {
712
712
  const { client: r, queryKey: n } = e.createPromiseClient(wn, { method: "summary", params: [t] });
713
713
  return e.nanoquery.createFetcherStore(n, {
714
714
  fetcher: async (i, o, s) => s ? (await r.summary({
715
715
  id: s
716
716
  })).data?.attributes : void 0
717
717
  });
718
- }, xi = (t, e) => {
718
+ }, Qi = (t, e) => {
719
719
  const { queryKey: r, client: n } = e.createPromiseClient(vr, { method: "me", params: [t] });
720
720
  return e.nanoquery.createFetcherStore(r, {
721
721
  fetcher: async () => {
@@ -723,16 +723,16 @@ const Ui = (t, e) => {
723
723
  return { data: i };
724
724
  }
725
725
  });
726
- }, Qi = (t) => {
726
+ }, Gi = (t) => {
727
727
  const { client: e, createRequestOptions: r } = t.createPromiseClient(vr, { method: "bypassAuth" }), n = r({ retryAttempts: 0 });
728
728
  return ({ userKey: i, schema: o, init: s, inviterKey: a }) => e.bypassAuth({ userKey: i, schema: o, init: s, inviterKey: a }, { contextValues: n });
729
- }, Gi = (t, e) => {
730
- const { client: r, queryKey: n } = e.createPromiseClient(it, { method: "get", params: [t] });
729
+ }, Ki = (t, e) => {
730
+ const { client: r, queryKey: n } = e.createPromiseClient(nt, { method: "get", params: [t] });
731
731
  return e.nanoquery.createFetcherStore(n, {
732
732
  fetcher: async () => (await r.get({})).data?.attributes
733
733
  });
734
- }, Ki = (t, e) => {
735
- const { client: r, queryKey: n } = e.createPromiseClient(it, { method: "getOrganization", params: [t] });
734
+ }, zi = (t, e) => {
735
+ const { client: r, queryKey: n } = e.createPromiseClient(nt, { method: "getOrganization", params: [t] });
736
736
  return e.nanoquery.createFetcherStore(n, {
737
737
  fetcher: async () => {
738
738
  const i = await r.getOrganization({});
@@ -742,15 +742,15 @@ const Ui = (t, e) => {
742
742
  } : void 0;
743
743
  }
744
744
  });
745
- }, zi = (t, e) => {
746
- const { client: r, queryKey: n } = e.createPromiseClient(it, {
745
+ }, Hi = (t, e) => {
746
+ const { client: r, queryKey: n } = e.createPromiseClient(nt, {
747
747
  method: "getOrganizationAdvertising",
748
748
  params: [t]
749
749
  });
750
750
  return e.nanoquery.createFetcherStore(n, {
751
751
  fetcher: async () => (await r.getOrganizationAdvertising({})).data?.attributes
752
752
  });
753
- }, Hi = (t, e, r) => {
753
+ }, Wi = (t, e, r) => {
754
754
  t.transport = new Gr(e.host, {
755
755
  dedupeTime: 1e3 * 60 * 5,
756
756
  refetchInterval: 1e3 * 60 * 5,
@@ -761,50 +761,50 @@ const Ui = (t, e) => {
761
761
  t.transport.disconnect(), t.analyticsTransport.disconnect();
762
762
  }), r();
763
763
  };
764
- var pe;
764
+ var he;
765
765
  (function(t) {
766
766
  t.SCHEMA = "schema", t.EXTERNAL_TOKEN = "eToken", t.TOKEN = "token";
767
- })(pe || (pe = {}));
767
+ })(he || (he = {}));
768
768
  class Ue extends He {
769
769
  constructor() {
770
770
  super("user");
771
771
  }
772
772
  // Schema
773
773
  setSchema = (e) => {
774
- this.write(pe.SCHEMA, e);
774
+ this.write(he.SCHEMA, e);
775
775
  };
776
- getSchema = () => this.read(pe.SCHEMA);
776
+ getSchema = () => this.read(he.SCHEMA);
777
777
  // Token
778
778
  setToken = (e) => {
779
- this.write(pe.TOKEN, e);
779
+ this.write(he.TOKEN, e);
780
780
  };
781
- getToken = () => this.read(pe.TOKEN);
781
+ getToken = () => this.read(he.TOKEN);
782
782
  // External Token
783
783
  setExternalToken = (e) => {
784
- this.write(pe.EXTERNAL_TOKEN, e);
784
+ this.write(he.EXTERNAL_TOKEN, e);
785
785
  };
786
- getExternalToken = () => this.read(pe.EXTERNAL_TOKEN);
786
+ getExternalToken = () => this.read(he.EXTERNAL_TOKEN);
787
787
  removeToken = () => {
788
- this.remove(pe.TOKEN);
788
+ this.remove(he.TOKEN);
789
789
  };
790
790
  }
791
- var ge;
791
+ var ye;
792
792
  (function(t) {
793
793
  t.DISABLED = "disabled", t.INITIALIZATION = "initialization", t.READY = "ready", t.FAILED = "failed", t.SUSPENDED = "suspended";
794
- })(ge || (ge = {}));
795
- const Wi = (t) => {
796
- const e = new Ue(), r = new Y(B(e.getExternalToken()), "userKey"), n = new Y(B(e.getToken()), "userToken"), i = new re(xi(n.getStore(), t), "user", ({ data: s, error: a, loading: u }, f) => {
794
+ })(ye || (ye = {}));
795
+ const Yi = (t) => {
796
+ const e = new Ue(), r = new Y(x(e.getExternalToken()), "userKey"), n = new Y(x(e.getToken()), "userToken"), i = new ce(Qi(n.getStore(), t), "user", ({ data: s, error: a, loading: u }, f) => {
797
797
  if (!a)
798
798
  return s?.data?.id ? s.data.id : u === !1 ? void 0 : f;
799
- }), o = new re(Gi(n.getStore(), t), "userSettings");
799
+ }), o = new ce(Ki(n.getStore(), t), "userSettings");
800
800
  return {
801
801
  userKey: r,
802
802
  userToken: n,
803
803
  user: i,
804
804
  userSettings: o
805
805
  };
806
- }, Yi = (t) => {
807
- const e = new Y(B(void 0), "providerStreamId"), r = new re(Ui(e.getStore(), t), "slStreamId", (o) => o?.data), n = new re(Bi(r.getAtomStore(), t), "streamSettings"), i = new re(qi(r.getAtomStore(), t), "streamSettings");
806
+ }, Ji = (t) => {
807
+ const e = new Y(x(void 0), "providerStreamId"), r = new ce(Bi(e.getStore(), t), "slStreamId", (o) => o?.data), n = new ce(qi(r.getAtomStore(), t), "streamSettings"), i = new ce(xi(r.getAtomStore(), t), "streamSettings");
808
808
  return r.getAtomStore().listen((o) => {
809
809
  (o === "" || o === void 0) && (n.getStore().mutate(void 0), i.getStore().mutate(void 0));
810
810
  }), {
@@ -813,8 +813,8 @@ const Wi = (t) => {
813
813
  streamSettings: n,
814
814
  streamSummary: i
815
815
  };
816
- }, Ji = (t) => {
817
- const e = new Y(B(void 0), "enabled"), r = new Y(B(ge.DISABLED), "status"), n = new re(Ki(e.getStore(), t), "organizationSettings", (a) => a?.data?.id), i = new re(zi(n.getAtomStore(), t), "organizationAdvertising"), o = Wi(t), s = Yi(t);
816
+ }, Xi = (t) => {
817
+ const e = new Y(x(void 0), "enabled"), r = new Y(x(ye.DISABLED), "status"), n = new ce(zi(e.getStore(), t), "organizationSettings", (a) => a?.data?.id), i = new ce(Hi(n.getAtomStore(), t), "organizationAdvertising"), o = Yi(t), s = Ji(t);
818
818
  return {
819
819
  enabled: e,
820
820
  status: r,
@@ -830,10 +830,10 @@ const Wi = (t) => {
830
830
  organizationAdvertising: i
831
831
  };
832
832
  };
833
- class Xi extends kt {
833
+ class Zi extends kt {
834
834
  stores;
835
835
  constructor(e) {
836
- const r = Ji(e), n = Pi(r);
836
+ const r = Xi(e), n = Ni(r);
837
837
  super(n, "core"), this.stores = r;
838
838
  }
839
839
  getValue() {
@@ -854,17 +854,17 @@ class Xi extends kt {
854
854
  };
855
855
  unsubscribe = () => this.getStore().off();
856
856
  }
857
- const Zi = (t, e, r) => {
858
- t.store = new Xi(t.transport), t.stores = t.store.getValues(), t.sdk.enabled = t.stores.enabled.getStore(), t.sdk.status = t.stores.status.getStore(), t.sdk.sdkStore = Object.fromEntries(Object.entries(t.stores).map(([n, i]) => [n, i.getStore()])), t.sdk.organizationStore = () => t.stores.organizationSettings.getStore(), t.sdk.streamStore = () => t.stores.streamSettings.getStore(), t.sdk.streamSummary = () => t.stores.streamSummary.getStore(), t.storeUnsubscribe = () => {
857
+ const eo = (t, e, r) => {
858
+ t.store = new Zi(t.transport), t.stores = t.store.getValues(), t.sdk.enabled = t.stores.enabled.getStore(), t.sdk.status = t.stores.status.getStore(), t.sdk.sdkStore = Object.fromEntries(Object.entries(t.stores).map(([n, i]) => [n, i.getStore()])), t.sdk.organizationStore = () => t.stores.organizationSettings.getStore(), t.sdk.streamStore = () => t.stores.streamSettings.getStore(), t.sdk.streamSummary = () => t.stores.streamSummary.getStore(), t.storeUnsubscribe = () => {
859
859
  t.store.unsubscribe();
860
860
  }, r();
861
- }, eo = (t) => {
861
+ }, to = (t) => {
862
862
  const { client: e } = t.createPromiseClient(An, { method: "list" });
863
863
  return (r) => e.list(r);
864
864
  }, Pn = (t) => {
865
865
  const { client: e } = t.createPromiseClient(An, { method: "summary" });
866
866
  return (r) => e.summary(r);
867
- }, to = (t, e) => {
867
+ }, ro = (t, e) => {
868
868
  const { client: r, queryKey: n } = e.createPromiseClient(vr, {
869
869
  method: "getFriends",
870
870
  params: [t]
@@ -880,8 +880,8 @@ const Zi = (t, e, r) => {
880
880
  }
881
881
  }
882
882
  });
883
- }, ro = (t, e) => {
884
- const { client: r, queryKey: n } = e.createPromiseClient(ne, { method: "get", params: [t] });
883
+ }, no = (t, e) => {
884
+ const { client: r, queryKey: n } = e.createPromiseClient(re, { method: "get", params: [t] });
885
885
  return e.nanoquery.createFetcherStore(n, {
886
886
  fetcher: async (i, o, s) => (await r.get({
887
887
  eventId: s
@@ -889,8 +889,8 @@ const Zi = (t, e, r) => {
889
889
  refetchInterval: 0,
890
890
  dedupeTime: 1e3 * 60 * 60
891
891
  });
892
- }, no = (t, e) => {
893
- const { client: r, queryKey: n } = e.createPromiseClient(ne, { method: "syncQuestion", params: [t] });
892
+ }, io = (t, e) => {
893
+ const { client: r, queryKey: n } = e.createPromiseClient(re, { method: "syncQuestion", params: [t] });
894
894
  return e.nanoquery.createFetcherStore(n, {
895
895
  fetcher: async (i, o, s) => s ? (await r.syncQuestion({
896
896
  filter: {
@@ -901,36 +901,39 @@ const Zi = (t, e, r) => {
901
901
  // 10 minutes
902
902
  refetchInterval: 0
903
903
  });
904
- }, io = async (t, e) => {
905
- const { client: r } = e.createPromiseClient(ne, { method: "item", params: [t] });
904
+ }, oo = async (t, e) => {
905
+ const { client: r } = e.createPromiseClient(re, { method: "item", params: [t] });
906
906
  return (await r.item({
907
907
  id: t
908
908
  })).data;
909
- }, oo = (t, e) => {
910
- const { client: r } = e.createStreamClient(ne), n = Ct({ eventId: t.get() || "", feedId: "" });
909
+ }, so = (t, e) => {
910
+ const { client: r } = e.createStreamClient(re), n = Ct({ eventId: t.get() || "", feedId: "" });
911
911
  return t.subscribe((o = "") => {
912
912
  n.set({ eventId: o, feedId: "" });
913
913
  }), e.addSubscription(r.subscription, n, { name: "feedSubscription" });
914
- }, so = (t, e) => {
915
- const { client: r } = e.createStreamClient(ne);
914
+ }, ao = (t, e) => {
915
+ const { client: r } = e.createStreamClient(re);
916
916
  return e.addSubscription(r.questionSubscription, { questionId: t }, { name: "questionSubscription" });
917
917
  }, ar = (t, e) => {
918
- const { client: r, queryKey: n } = e.createPromiseClient(ne, { method: "questionByUser", params: [t] });
918
+ const { client: r, queryKey: n } = e.createPromiseClient(re, { method: "questionByUser", params: [t] });
919
919
  return e.nanoquery.createFetcherStore(n, {
920
920
  fetcher: async (i, o, s) => (await r.questionByUser({
921
921
  questionId: s
922
922
  })).data?.attributes?.question,
923
923
  dedupeTime: 1e3 * 60 * 5
924
924
  });
925
- }, ao = async (t, e) => {
925
+ }, Nn = async (t, e) => {
926
926
  if (!t)
927
927
  return;
928
- const { client: r } = e.createPromiseClient(ne, { method: "getQuestion", params: [t] }), n = await r.getQuestion({
928
+ const { client: r } = e.createPromiseClient(re, { method: "getQuestion", params: [t] }), n = await r.getQuestion({
929
929
  id: t
930
- }), i = n.data?.attributes?.options?.options.case === "promotion" ? n.data?.attributes?.options?.options.value : void 0;
931
- return i ? { promotions: i, notification: n.data?.attributes?.notification } : void 0;
930
+ });
931
+ if (!n.data?.attributes)
932
+ return;
933
+ const { options: i, notification: o, ...s } = n.data.attributes, a = i?.options.case === "promotion" ? i?.options.value : void 0;
934
+ return a ? { id: s.id, question: s, promotion: a, notification: o } : void 0;
932
935
  }, uo = (t, e, r) => {
933
- const { client: n, queryKey: i } = r.createPromiseClient(ne, {
936
+ const { client: n, queryKey: i } = r.createPromiseClient(re, {
934
937
  method: "list",
935
938
  params: [t, e]
936
939
  });
@@ -938,32 +941,36 @@ const Zi = (t, e, r) => {
938
941
  fetcher: async (o, s, a, u) => a ? (await n.list({
939
942
  eventId: a,
940
943
  filter: {
941
- types: u === Ce.ALLOWED ? [] : [F.FACTOID, F.PROMOTION, F.TWEET],
942
- statuses: [H.ACTIVE, H.RESOLVED]
944
+ types: u === Le.ALLOWED ? [] : [_.FACTOID, _.PROMOTION, _.TWEET],
945
+ statuses: [W.ACTIVE, W.RESOLVED]
943
946
  }
944
947
  })).data : [],
945
948
  dedupeTime: 0,
946
949
  refetchInterval: 0
947
950
  });
948
951
  }, co = (t, e) => {
949
- const { client: r, queryKey: n } = e.createPromiseClient(ne, {
952
+ const { client: r, queryKey: n } = e.createPromiseClient(re, {
950
953
  method: "list",
951
954
  params: [t]
952
955
  });
953
956
  return e.nanoquery.createFetcherStore(n, {
954
- fetcher: async (i, o, s) => s ? (await r.list({
955
- eventId: s,
956
- filter: {
957
- types: [F.PROMOTION],
958
- statuses: [H.ACTIVE]
959
- }
960
- })).data.map(({ attributes: u }) => {
961
- if (!(!u || u.attributes.case !== "promotion"))
962
- return {
963
- ...u,
964
- attributes: u.attributes.value
965
- };
966
- }).filter(Boolean) : [],
957
+ fetcher: async (i, o, s) => {
958
+ if (!s)
959
+ return;
960
+ const u = (await r.list({
961
+ eventId: s,
962
+ filter: {
963
+ types: [_.PROMOTION],
964
+ statuses: [W.ACTIVE]
965
+ },
966
+ pagination: {
967
+ page: 0,
968
+ pageSize: 1
969
+ }
970
+ })).data?.[0];
971
+ if (u.type === "promotion")
972
+ return Nn(u.id, e);
973
+ },
967
974
  dedupeTime: 0,
968
975
  refetchInterval: 0
969
976
  });
@@ -976,19 +983,19 @@ const Zi = (t, e, r) => {
976
983
  return u ? (u.openedFrom = f, u) : a.question;
977
984
  }), i = Vr(n, (a) => a && a.type === "question" ? a.id : void 0), o = ar(i, t);
978
985
  return { $store: n, $extendedStore: o, updateExtendedQuestion: (a) => {
979
- const u = o.get().data, f = (c, h) => {
980
- if (!c || !h)
981
- return c || h || [];
982
- const l = [];
986
+ const u = o.get().data, f = (c, l) => {
987
+ if (!c || !l)
988
+ return c || l || [];
989
+ const h = [];
983
990
  for (let g = 0; g < c.length; g++)
984
- l.push({
991
+ h.push({
985
992
  ...c[g],
986
- ...h[g],
993
+ ...l[g],
987
994
  correct: c[g].correct,
988
995
  youVoted: c[g].youVoted,
989
996
  pointsEarned: c[g].pointsEarned
990
997
  });
991
- return l;
998
+ return h;
992
999
  };
993
1000
  o.mutate({
994
1001
  ...a,
@@ -999,202 +1006,101 @@ const Zi = (t, e, r) => {
999
1006
  });
1000
1007
  } };
1001
1008
  };
1002
- var St;
1009
+ var bt;
1003
1010
  (function(t) {
1004
1011
  t.SHOWED = "showed";
1005
- })(St || (St = {}));
1012
+ })(bt || (bt = {}));
1006
1013
  class fo extends He {
1007
1014
  constructor() {
1008
1015
  super("advertisement");
1009
1016
  }
1010
1017
  setShowed = (e) => {
1011
- this.write(St.SHOWED, e, "true");
1018
+ this.write(bt.SHOWED, e, "true");
1012
1019
  };
1013
- isShowed = (e) => this.read(St.SHOWED, e);
1020
+ isViewed = (e) => this.read(bt.SHOWED, e);
1014
1021
  }
1015
- class ho {
1016
- advertisementList;
1017
- store;
1018
- timeouts;
1019
- waitingQueue;
1020
- activeQueue;
1021
- options;
1022
- logger;
1023
- constructor(e) {
1024
- this.options = e, this.logger = le("advertisement_queue"), this.store = /* @__PURE__ */ new Map(), this.timeouts = /* @__PURE__ */ new Map(), this.waitingQueue = /* @__PURE__ */ new Set(), this.activeQueue = /* @__PURE__ */ new Set(), this.advertisementList = B(/* @__PURE__ */ new Map());
1025
- }
1026
- addToQueue = (e) => {
1027
- if (this.store.has(e.id)) {
1028
- this.logger.debug({ advertisement: e }, "skip existed advertisement: %o");
1029
- return;
1030
- }
1031
- const r = e.close, n = e.action;
1032
- if (this.store.set(e.id, {
1033
- ...e,
1034
- close: (...i) => {
1035
- r && r(...i), this.closeAdvertisement(e.id);
1036
- },
1037
- action: (...i) => {
1038
- n && n(...i), this.closeAdvertisement(e.id, { animateHiding: !1 });
1039
- }
1040
- }), this.waitingQueue.add(e.id), this.activeQueue.size === this.options.concurrency) {
1041
- const [i] = this.activeQueue;
1042
- this.closeAdvertisement(i);
1043
- } else
1044
- this.tickWaitingQueue();
1045
- };
1046
- tickWaitingQueue = () => {
1047
- if (this.activeQueue.size < this.options.concurrency) {
1048
- const [e] = this.waitingQueue;
1049
- if (!e)
1050
- return;
1051
- this.activeQueue.add(e), this.waitingQueue.delete(e), this.logger.debug({ job: e }, "waiting queue tick"), this.tickActiveQueue(e);
1052
- } else
1053
- this.logger.debug({ queueSize: this.activeQueue.size, concurrency: this.options.concurrency }, "waiting queue tick skipped");
1054
- };
1055
- tickActiveQueue = (e) => {
1056
- if (!e)
1057
- return;
1058
- const r = this.store.get(e);
1059
- if (!r) {
1060
- this.logger.debug({ advertisementId: e }, "active queue tick skipped, advertisement not exist");
1061
- return;
1062
- }
1063
- const n = setTimeout(() => {
1064
- const i = e, o = new Map(this.advertisementList.get());
1065
- if (o.set(r.id, r), this.advertisementList.set(o), r.autoHideDuration !== 1 / 0) {
1066
- const s = setTimeout(() => {
1067
- this.logger.debug({ advertisementId: i, delay: r.autoHideDuration || 5e3 }, "advertisement hiding by autoHideDuration"), this.closeAdvertisement(i);
1068
- }, r.autoHideDuration || 5e3);
1069
- this.timeouts.set(i, s);
1070
- }
1071
- this.logger.debug({ advertisementId: i, queue: [...o.values()] }, "advertisement displayed");
1072
- }, r.delay || 0);
1073
- this.timeouts.set(e, n), this.logger.debug({ advertisementId: e }, "active queue tick completed"), this.tickWaitingQueue();
1074
- };
1075
- removeFromList = (e) => {
1076
- const r = new Map(this.advertisementList.get());
1077
- r.delete(e), this.advertisementList.set(r), this.store.delete(e), this.activeQueue.delete(e), this.waitingQueue.delete(e), this.logger.debug({ advertisementId: e }, "advertisement removed from list");
1078
- };
1079
- closeAdvertisement = (e, { animateHiding: r = !0 } = {}) => {
1080
- const n = new Map(this.advertisementList.get()), i = n.get(e);
1081
- if (i) {
1082
- i.hiding = !(this.waitingQueue.size >= this.options.concurrency) && r, this.advertisementList.set(n);
1083
- const o = setTimeout(() => {
1084
- const s = new Map(this.advertisementList.get());
1085
- s.delete(e), this.advertisementList.set(s);
1086
- const a = this.timeouts.get(e);
1087
- a !== void 0 && (clearTimeout(a), this.timeouts.delete(e)), this.logger.debug({ advertisementId: e }, "advertisement hidden");
1088
- }, r && this.options.animationDelay || 0);
1089
- this.timeouts.set(e, o);
1090
- }
1091
- return this.store.delete(e), this.activeQueue.delete(e), this.waitingQueue.delete(e), this.tickWaitingQueue(), this.logger.debug({ advertisementId: e }, "advertisement hiding"), i;
1092
- };
1093
- drain = () => {
1094
- this.store.clear(), this.timeouts.clear(), this.waitingQueue.clear(), this.activeQueue.clear(), this.advertisementList.off(), this.advertisementList.set(/* @__PURE__ */ new Map());
1022
+ const ho = (t) => {
1023
+ const e = t.data?.attributes?.question;
1024
+ if ((t.data?.attributes?.feedItem?.attributes?.attributes?.case === "promotion" ? t.data.attributes.feedItem.attributes : void 0) === void 0 || !e)
1025
+ return;
1026
+ const { options: n, notification: i, ...o } = e, s = n?.options.case === "promotion" ? n.options.value : void 0;
1027
+ if (s)
1028
+ return {
1029
+ id: o.id,
1030
+ question: o,
1031
+ notification: i,
1032
+ promotion: s
1033
+ };
1034
+ }, po = (t, e, r) => {
1035
+ const n = r.transport, i = be("advertisement"), o = new fo(), s = te({}), a = co(t, n), u = (l, h) => {
1036
+ h ? s.set({
1037
+ loading: !1,
1038
+ error: void 0,
1039
+ data: h,
1040
+ close: () => c(h.question.id),
1041
+ isViewed: !!o.isViewed(h.question.id)
1042
+ }) : (s.setKey("loading", !0), Nn(l, n).then((g) => s.set({
1043
+ loading: !1,
1044
+ error: void 0,
1045
+ data: g,
1046
+ close: () => c(g?.question.id),
1047
+ isViewed: g && !!o.isViewed(g.question.id)
1048
+ })).catch((g) => s.set({
1049
+ loading: !1,
1050
+ error: g,
1051
+ data: void 0
1052
+ })));
1095
1053
  };
1096
- }
1097
- const po = (t, e, r) => {
1098
- const n = r.transport, i = le("advertisement_queue"), o = new ho({ concurrency: 1, animationDelay: 1e3 }), s = new fo(), a = new re(co(t, n), "gamification:promotionList"), u = (l, g) => {
1099
- J.emit("advertisement", {
1054
+ a.subscribe((l, h) => {
1055
+ l.data && (J.emit("advertisement", {
1100
1056
  action: "received",
1101
1057
  payload: {
1102
- advertisementId: l,
1103
- advertisementType: g?.promotions.type
1104
- }
1105
- }), o.addToQueue({
1106
- id: l,
1107
- autoHideDuration: 1 / 0,
1108
- data: te({ loading: !1, error: void 0, data: void 0 }),
1109
- close: () => c(l),
1110
- promise: async function() {
1111
- this.data.setKey("loading", !0);
1112
- try {
1113
- const v = g || await ao(l, n);
1114
- r.sdk.onAdvertisementActivate({
1115
- stage: "activate",
1116
- id: l,
1117
- hasNotification: v?.notification?.enabled === gi.NOTIFICATION_ENABLED,
1118
- isShowed: !!s.isShowed(l)
1119
- }), v ? this.data.setKey("data", v) : this.data.setKey("error", new Error("No promotion found"));
1120
- } catch (v) {
1121
- this.data.setKey("error", v);
1122
- } finally {
1123
- this.data.setKey("loading", !1);
1124
- }
1058
+ advertisementId: l.data.question.id,
1059
+ advertisementType: l.data?.promotion.type
1125
1060
  }
1126
- });
1127
- }, f = (l) => {
1128
- i.debug({ notificationId: l }, "markAsViewed: %o"), s.setShowed(l);
1129
- }, c = (l) => {
1130
- o.closeAdvertisement(l), f(l), r.sdk.onAdvertisementActivate({
1131
- stage: "deactivate",
1132
- id: l
1133
- });
1134
- }, h = (l) => {
1135
- const g = o.advertisementList.get();
1136
- if (!g?.size)
1137
- return null;
1138
- const v = g.values().next().value, w = v.data.get();
1139
- return !l && s.isShowed(v.id) ? (o.removeFromList(v.id), h(l)) : (!w.data && !w.error && !w.loading && v.promise(), J.emit("advertisement", {
1061
+ }), (!h?.data || l.data.id !== h.data.id) && u(l.data.question.id, l.data));
1062
+ }), s.subscribe((l, h) => {
1063
+ l.data && (r.sdk.onAdvertisementActivate({
1064
+ stage: "activate",
1065
+ id: l.data.question.id,
1066
+ hasNotification: l.data.notification?.enabled === gi.NOTIFICATION_ENABLED,
1067
+ isViewed: !!o.isViewed(l.data.question.id)
1068
+ }), J.emit("advertisement", {
1140
1069
  action: "opened",
1141
1070
  payload: {
1142
- advertisementId: v.id,
1143
- advertisementType: w.data?.promotions.type
1071
+ advertisementId: l.data.question.id,
1072
+ advertisementType: l.data?.promotion.type
1144
1073
  }
1145
- }), v);
1074
+ })), !l?.data && h?.data && r.sdk.onAdvertisementActivate({
1075
+ stage: "deactivate",
1076
+ id: h.data.question.id,
1077
+ isViewed: !!o.isViewed(h.data.question.id)
1078
+ });
1079
+ });
1080
+ const f = (l) => {
1081
+ i.debug({ notificationId: l }, "markAsViewed: %o"), o.setShowed(l);
1082
+ }, c = (l) => {
1083
+ (!l || s.get()?.data?.question.id === l) && s.set({}), l && f(l);
1146
1084
  };
1147
- return a.subscribe((l) => {
1148
- if (l.data) {
1149
- const g = l.data[l.data.length - 1];
1150
- g && u(g.id);
1151
- }
1152
- }), e.addListener("promotion cb", (l) => {
1153
- const g = l.data?.attributes?.feedItem?.attributes?.attributes?.case === "promotion" ? l.data.attributes.feedItem.attributes : void 0, v = l.data?.attributes?.question?.options?.options.case === "promotion" ? l.data.attributes.question.options.options.value : void 0;
1154
- if (g === void 0 || v === void 0) {
1155
- i.debug("not promotion");
1156
- return;
1157
- }
1158
- if (g.status === H.RESOLVED) {
1159
- c(g.id), i.debug({ feedItem: g }, "resolved: %o");
1160
- return;
1161
- }
1162
- if (g.status === H.ACTIVE) {
1163
- i.debug({ feedItem: g }, "active: %o"), u(g.id);
1164
- return;
1165
- }
1166
- i.debug({ feedItem: g }, "skip: %o");
1167
- }), nt(o.advertisementList, () => {
1168
- a.subscribe((l) => {
1169
- if (l.data) {
1170
- const g = l.data[l.data.length - 1];
1171
- g && u(g.id);
1172
- }
1173
- }), e.addListener("promotion", (l) => {
1174
- const g = l.data?.attributes?.feedItem?.attributes?.attributes?.case === "promotion" ? l.data.attributes.feedItem.attributes : void 0, v = l.data?.attributes?.question?.options?.options.case === "promotion" ? l.data.attributes.question.options.options.value : void 0;
1175
- if (g === void 0 || v === void 0) {
1176
- i.debug("not promotion");
1085
+ return e.addListener("promotion", (l) => {
1086
+ const h = ho(l);
1087
+ if (h) {
1088
+ if (h.question.status === W.RESOLVED) {
1089
+ c(h.question.id), i.debug({ promotion: h }, "resolved: %o");
1177
1090
  return;
1178
1091
  }
1179
- if (g.status === H.RESOLVED) {
1180
- c(g.id), i.debug({ feedItem: g }, "resolved: %o");
1092
+ if (h.question.status === W.ACTIVE) {
1093
+ i.debug({ promotion: h }, "active: %o"), u(h.question.id, h);
1181
1094
  return;
1182
1095
  }
1183
- if (g.status === H.ACTIVE) {
1184
- i.debug({ feedItem: g }, "active: %o"), u(g.id, {
1185
- promotions: v,
1186
- notification: l.data?.attributes?.question?.notification
1187
- });
1188
- return;
1189
- }
1190
- i.debug({ feedItem: g }, "skip: %o");
1191
- });
1192
- }), { hide: c, show: u, $list: o.advertisementList, getActiveAdvertisement: h };
1096
+ i.debug({ promotion: h }, "skip: %o");
1097
+ }
1098
+ }), { hide: c, show: u, $store: s };
1193
1099
  };
1194
- var Ce;
1100
+ var Le;
1195
1101
  (function(t) {
1196
1102
  t.ALLOWED = "allowed", t.DISALLOWED = "disallowed";
1197
- })(Ce || (Ce = {}));
1103
+ })(Le || (Le = {}));
1198
1104
  class yo {
1199
1105
  /** sl event id */
1200
1106
  slStreamId;
@@ -1228,17 +1134,37 @@ class yo {
1228
1134
  transport;
1229
1135
  cancels = /* @__PURE__ */ new Set();
1230
1136
  constructor(e) {
1231
- this.transport = e.transport, this.log = le("gamification-background"), this.slStreamId = e.stores.slStreamId.getAtomStore(), this.organizationId = e.stores.organizationSettings.getAtomStore(), this.userId = e.stores.user.getAtomStore(), this.moderationId = new Y(B(void 0), "moderationId").getStore(), this.interactiveAllowed = new Y(B(Ce.DISALLOWED), "interactiveAllowed").getStore(), this.openedQuestionId = new Y(B(void 0), "openedQuestionId").getStore(), this.notifications = e.notifications, this.moderation = new re(ro(this.slStreamId, e.transport), "gamification:moderation"), this.feedList = new re(uo(this.slStreamId, this.interactiveAllowed, e.transport), "gamification:feedList"), this.activeQuestionId = no(this.slStreamId, e.transport), this.openedQuestion = lo(e.transport, this.openedQuestionId, this.feedList.getStore()), this.cancels.add(this.openedQuestionId.listen((r) => {
1232
- this.log.debug({ item: r }, "received question"), r?.questionId ? (this.questionSubscription = so(r.questionId, e.transport), this.questionSubscription.addListener("feed-subscription-opened-question", (n) => {
1137
+ this.transport = e.transport, this.log = be("gamification-background"), this.slStreamId = e.stores.slStreamId.getAtomStore(), this.organizationId = e.stores.organizationSettings.getAtomStore(), this.userId = e.stores.user.getAtomStore(), this.moderationId = new Y(x(void 0), "moderationId").getStore(), this.interactiveAllowed = new Y(x(Le.DISALLOWED), "interactiveAllowed").getStore(), this.openedQuestionId = new Y(x(void 0), "openedQuestionId").getStore(), this.notifications = e.notifications, this.moderation = new ce(no(this.slStreamId, e.transport), "gamification:moderation"), this.feedList = new ce(uo(this.slStreamId, this.interactiveAllowed, e.transport), "gamification:feedList"), this.activeQuestionId = io(this.slStreamId, e.transport), this.openedQuestion = lo(e.transport, this.openedQuestionId, this.feedList.getStore()), this.cancels.add(this.openedQuestionId.listen((r) => {
1138
+ this.log.debug({ item: r }, "received question"), r?.questionId ? (this.questionSubscription = ao(r.questionId, e.transport), this.questionSubscription.addListener("feed-subscription-opened-question", (n) => {
1233
1139
  this.openedQuestion.updateExtendedQuestion(n.data?.attributes?.question);
1234
1140
  }), this.questionSubscription.connect()) : (this.log.info("cleanup on close question"), this.questionSubscription !== void 0 && (e.transport.removeSubscription(this.questionSubscription), this.questionSubscription = void 0));
1235
- })), this.feedSubscription = oo(this.slStreamId, e.transport), this.cancels.add(this.feedSubscription.addListener("feed-subscription-active-question", (r) => {
1141
+ })), this.feedSubscription = so(this.slStreamId, e.transport), this.cancels.add(this.feedSubscription.addListener("feed-subscription-active-question", (r) => {
1236
1142
  const n = this.activeQuestionId.get().data?.question?.id, i = r.data?.attributes?.question;
1237
- !i || i.type === F.PROMOTION || n && i.status === H.RESOLVED && i.id !== n || this.activeQuestionId.mutate(r.data?.attributes);
1143
+ if (!(!i || i.type === _.PROMOTION)) {
1144
+ if (i.status === W.RESOLVED) {
1145
+ n === i.id && this.activeQuestionId.mutate(void 0);
1146
+ return;
1147
+ }
1148
+ this.activeQuestionId.mutate(r.data?.attributes);
1149
+ }
1238
1150
  })), this.cancels.add(this.feedSubscription.addListener("moderation update", (r) => {
1239
1151
  window.requestAnimationFrame(() => {
1240
1152
  r.data?.attributes?.question === void 0 && r.data?.attributes?.moderation && this.moderation.invalidate();
1241
1153
  });
1154
+ })), this.cancels.add(this.activeQuestionId.subscribe((r, n) => {
1155
+ r.data?.feedItem && e.sdk.onQuestionActivate({
1156
+ stage: "activate",
1157
+ id: r.data.feedItem.id,
1158
+ isViewed: !!this.notifications.isViewed(r.data.feedItem.id),
1159
+ hasNotification: !0,
1160
+ type: r.data.feedItem.type
1161
+ }), !r.data?.feedItem && n?.data?.feedItem && e.sdk.onQuestionActivate({
1162
+ stage: "deactivate",
1163
+ id: n.data.feedItem.id,
1164
+ isViewed: !!this.notifications.isViewed(n.data.feedItem.id),
1165
+ hasNotification: !0,
1166
+ type: n.data.feedItem.type
1167
+ });
1242
1168
  })), this.feedSubscription.connect(), this.cancels.add(this.interactiveAllowed.listen(() => {
1243
1169
  window.requestAnimationFrame(() => {
1244
1170
  this.activeQuestionId.invalidate();
@@ -1277,7 +1203,7 @@ class yo {
1277
1203
  this.openedQuestionId.set(void 0), e && this.notifications.markAsViewed(this.getCurrentSessionId({ prefix: "notification", entity: e }));
1278
1204
  };
1279
1205
  }
1280
- class go {
1206
+ class mo {
1281
1207
  notificationsList;
1282
1208
  store;
1283
1209
  timeouts;
@@ -1286,7 +1212,7 @@ class go {
1286
1212
  options;
1287
1213
  logger;
1288
1214
  constructor(e) {
1289
- this.options = e, this.logger = le("notifications"), this.store = /* @__PURE__ */ new Map(), this.timeouts = /* @__PURE__ */ new Map(), this.waitingQueue = /* @__PURE__ */ new Set(), this.activeQueue = /* @__PURE__ */ new Set(), this.notificationsList = B(/* @__PURE__ */ new Map());
1215
+ this.options = e, this.logger = be("notifications"), this.store = /* @__PURE__ */ new Map(), this.timeouts = /* @__PURE__ */ new Map(), this.waitingQueue = /* @__PURE__ */ new Set(), this.activeQueue = /* @__PURE__ */ new Set(), this.notificationsList = x(/* @__PURE__ */ new Map());
1290
1216
  }
1291
1217
  addToQueue = (e) => {
1292
1218
  if (this.store.has(e.id)) {
@@ -1358,18 +1284,18 @@ class go {
1358
1284
  this.store.clear(), this.timeouts.clear(), this.waitingQueue.clear(), this.activeQueue.clear(), this.notificationsList.off(), this.notificationsList.set(/* @__PURE__ */ new Map());
1359
1285
  };
1360
1286
  }
1361
- var wt;
1287
+ var St;
1362
1288
  (function(t) {
1363
1289
  t.OPENED = "opened";
1364
- })(wt || (wt = {}));
1365
- class mo extends He {
1290
+ })(St || (St = {}));
1291
+ class go extends He {
1366
1292
  constructor() {
1367
1293
  super("notification");
1368
1294
  }
1369
1295
  setOpened = (e) => {
1370
- this.write(wt.OPENED, e, "true");
1296
+ this.write(St.OPENED, e, "true");
1371
1297
  };
1372
- isOpened = (e) => this.read(wt.OPENED, e);
1298
+ isOpened = (e) => this.read(St.OPENED, e);
1373
1299
  clearNotification = () => {
1374
1300
  this.clear();
1375
1301
  };
@@ -1382,7 +1308,7 @@ class vo {
1382
1308
  queue;
1383
1309
  storage;
1384
1310
  constructor(e = {}) {
1385
- this.storage = new mo(), this.queue = new go({ concurrency: 1, animationDelay: 1600, ...e });
1311
+ this.storage = new go(), this.queue = new mo({ concurrency: 1, animationDelay: 1600, ...e });
1386
1312
  }
1387
1313
  isViewed = (e) => this.storage.isOpened(e);
1388
1314
  add = (e) => {
@@ -1429,14 +1355,14 @@ var rt;
1429
1355
  t.UNKNOWN = "unknown", t.ALREADY_VOTED = "already_voted";
1430
1356
  })(rt || (rt = {}));
1431
1357
  const So = async (t, e) => {
1432
- const { client: r, createRequestOptions: n } = t.createPromiseClient(ne, { method: "submitAnswer" }), i = n({ retryAttempts: 0 });
1358
+ const { client: r, createRequestOptions: n } = t.createPromiseClient(re, { method: "submitAnswer" }), i = n({ retryAttempts: 0 });
1433
1359
  try {
1434
1360
  return await r.submitAnswer({ data: e }, { contextValues: i });
1435
1361
  } catch (o) {
1436
- throw tt.from(o)?.code === se.AlreadyExists ? new Error(rt.ALREADY_VOTED) : new Error(rt.UNKNOWN);
1362
+ throw tt.from(o)?.code === oe.AlreadyExists ? new Error(rt.ALREADY_VOTED) : new Error(rt.UNKNOWN);
1437
1363
  }
1438
1364
  }, wo = (t, e) => {
1439
- const { client: r, createRequestOptions: n } = t.createPromiseClient(ne, { method: "submitInplay" }), i = n({ retryAttempts: 0 });
1365
+ const { client: r, createRequestOptions: n } = t.createPromiseClient(re, { method: "submitInplay" }), i = n({ retryAttempts: 0 });
1440
1366
  return r.submitInplay({ data: { eventId: +e } }, { contextValues: i });
1441
1367
  };
1442
1368
  var Be;
@@ -1452,7 +1378,7 @@ class Ao extends He {
1452
1378
  };
1453
1379
  readValue = (e) => this.read(...e);
1454
1380
  }
1455
- class Nn extends He {
1381
+ class Fn extends He {
1456
1382
  sessionStorage;
1457
1383
  constructor() {
1458
1384
  super("gamification"), this.sessionStorage = new Ao();
@@ -1470,19 +1396,19 @@ const Eo = {
1470
1396
  pageSize: 10
1471
1397
  }, Io = (t, e, r, n, i) => {
1472
1398
  let o = 0;
1473
- const s = B({ pageSize: Eo.pageSize, page: 0 }), a = te({
1399
+ const s = x({ pageSize: Eo.pageSize, page: 0 }), a = te({
1474
1400
  data: [],
1475
1401
  key: Date.now(),
1476
1402
  hasMore: !0,
1477
1403
  loading: void 0,
1478
1404
  error: void 0
1479
- }), u = eo(t), f = async () => {
1480
- const l = e.get(), g = n.getStore().get().data?.map((v) => v.slId) || [];
1481
- if (l && g?.length) {
1405
+ }), u = to(t), f = async () => {
1406
+ const h = e.get(), g = n.getStore().get().data?.map((v) => v.slId) || [];
1407
+ if (h && g?.length) {
1482
1408
  const v = r.get();
1483
1409
  v && g.push(v), a.setKey("loading", !0), a.setKey("data", []);
1484
1410
  const b = await u({
1485
- eventId: l,
1411
+ eventId: h,
1486
1412
  usersIds: g
1487
1413
  });
1488
1414
  a.set({
@@ -1497,16 +1423,16 @@ const Eo = {
1497
1423
  }
1498
1424
  }, c = () => {
1499
1425
  f();
1500
- }, h = (l) => {
1501
- const g = s.get(), v = l || g.page + 1;
1426
+ }, l = (h) => {
1427
+ const g = s.get(), v = h || g.page + 1;
1502
1428
  v <= o && s.set({ ...g, page: v });
1503
1429
  };
1504
- return nt(a, () => {
1505
- const l = e.listen(f), g = n.listen(f);
1430
+ return Lt(a, () => {
1431
+ const h = e.listen(f), g = n.listen(f);
1506
1432
  return () => {
1507
- l(), g();
1433
+ h(), g();
1508
1434
  };
1509
- }), { $store: a, fetchMore: h, invalidate: c };
1435
+ }), { $store: a, fetchMore: l, invalidate: c };
1510
1436
  };
1511
1437
  class To extends He {
1512
1438
  get = this.read;
@@ -1516,7 +1442,7 @@ class To extends He {
1516
1442
  super("deep-link-context", window.sessionStorage);
1517
1443
  }
1518
1444
  }
1519
- const Kr = "sldl", Pt = "sldl_uid", Fn = "sldl_eid", Dn = "sldl_e_eid", Oo = /* @__PURE__ */ new Set([Pt, Fn, Dn]), zr = (t) => {
1445
+ const Kr = "sldl", Pt = "sldl_uid", Dn = "sldl_eid", Rn = "sldl_e_eid", Oo = /* @__PURE__ */ new Set([Pt, Dn, Rn]), zr = (t) => {
1520
1446
  const e = {}, r = {};
1521
1447
  for (const [n, i] of t)
1522
1448
  Oo.has(n) ? e[n] = i : r[n] = i;
@@ -1531,53 +1457,53 @@ const Kr = "sldl", Pt = "sldl_uid", Fn = "sldl_eid", Dn = "sldl_e_eid", Oo = /*
1531
1457
  return { search: zr(r) };
1532
1458
  }
1533
1459
  return null;
1534
- }, Hr = le("deep_link"), ce = {
1460
+ }, Hr = be("deep_link"), ue = {
1535
1461
  debug: (...t) => {
1536
1462
  Hr.debug(...t), localStorage.getItem("SL_DEBUG") && console.log(...t);
1537
1463
  },
1538
1464
  trace: (...t) => {
1539
1465
  Hr.trace(...t), localStorage.getItem("SL_DEBUG") && console.log(...t);
1540
1466
  }
1541
- }, Lo = (t, e) => {
1467
+ }, Co = (t, e) => {
1542
1468
  const { hash: r, search: n } = window.location;
1543
- if (ce.debug({ hash: r, search: n }, "get deep link data from"), r || n) {
1469
+ if (ue.debug({ hash: r, search: n }, "get deep link data from"), r || n) {
1544
1470
  const i = _o({ hash: r, search: n });
1545
- if (ce.debug(i, "parse deep link result"), i) {
1471
+ if (ue.debug(i, "parse deep link result"), i) {
1546
1472
  const { hash: o, search: s } = i, { result: a, remain: u } = o || s;
1547
1473
  if (Object.keys(a).length !== 0) {
1548
1474
  t.setValue("data", a);
1549
1475
  const f = Object.keys(u).length !== 0;
1550
1476
  if (o) {
1551
1477
  let c = "";
1552
- f && (c = `#${new URLSearchParams(u).toString()}`, ce.debug({ updatedHash: c }, "update hash")), window.history.replaceState(null, "", window.location.pathname + window.location.search + c);
1478
+ f && (c = `#${new URLSearchParams(u).toString()}`, ue.debug({ updatedHash: c }, "update hash")), window.history.replaceState(null, "", window.location.pathname + window.location.search + c);
1553
1479
  }
1554
1480
  if (s) {
1555
1481
  let c = "";
1556
- f && (c = `?${new URLSearchParams(u).toString()}`, ce.debug({ updatedSearch: c }, "update search")), window.history.replaceState(null, "", window.location.pathname + c + window.location.hash);
1482
+ f && (c = `?${new URLSearchParams(u).toString()}`, ue.debug({ updatedSearch: c }, "update search")), window.history.replaceState(null, "", window.location.pathname + c + window.location.hash);
1557
1483
  }
1558
1484
  e(a);
1559
1485
  }
1560
1486
  }
1561
1487
  }
1562
1488
  t.setValue("parsed", !0);
1563
- }, Co = (t, e, r) => {
1489
+ }, Lo = (t, e, r) => {
1564
1490
  const n = new To(), i = n.get("sl-deep-link-store");
1565
1491
  let o = {};
1566
1492
  if (i)
1567
1493
  try {
1568
1494
  o = JSON.parse(i);
1569
1495
  } catch (a) {
1570
- ce.debug(a);
1496
+ ue.debug(a);
1571
1497
  }
1572
1498
  t.deepLink = {
1573
- $store: new Le(te(o), "deep-link-context"),
1499
+ $store: new Ce(te(o), "deep-link-context"),
1574
1500
  getDeepLinkData: () => {
1575
1501
  const { data: a, used: u } = t.deepLink.$store.getValues();
1576
1502
  return { data: a, used: u };
1577
1503
  },
1578
1504
  // we are logged in with inviter id
1579
1505
  deepLinkUsed: (a) => {
1580
- ce.debug(`logged in with inviterId: ${a}`), t.deepLink.$store.setValue("used", !0);
1506
+ ue.debug(`logged in with inviterId: ${a}`), t.deepLink.$store.setValue("used", !0);
1581
1507
  },
1582
1508
  onDeepLinkHandlers: /* @__PURE__ */ new Set()
1583
1509
  }, t.sdk.getInviter = () => {
@@ -1586,28 +1512,28 @@ const Kr = "sldl", Pt = "sldl_uid", Fn = "sldl_eid", Dn = "sldl_e_eid", Oo = /*
1586
1512
  }, t.sdk.inviteDisplayed = () => {
1587
1513
  t.deepLink.$store.getStore().set({}), t.deepLink.$store.getStore().off(), n.del("sl-deep-link-store");
1588
1514
  }, t.deepLink.$store.subscribe((a) => n.set("sl-deep-link-store", JSON.stringify(a))), t.sdk.addDeepLinkHandler = (a) => {
1589
- localStorage.getItem("SL_DEBUG") && ce.trace("adding deep link handler"), t.deepLink.onDeepLinkHandlers.add(a);
1515
+ localStorage.getItem("SL_DEBUG") && ue.trace("adding deep link handler"), t.deepLink.onDeepLinkHandlers.add(a);
1590
1516
  }, e.onDeepLinkHandled && t.sdk.addDeepLinkHandler(e.onDeepLinkHandled), t.sdk.removeDeepLinkHandler = (a) => {
1591
- ce.trace("removing deep link handler"), t.deepLink.onDeepLinkHandlers.delete(a);
1517
+ ue.trace("removing deep link handler"), t.deepLink.onDeepLinkHandlers.delete(a);
1592
1518
  };
1593
1519
  const s = (a) => {
1594
- t.deepLink.$store.setValue("handled", !0), ce.trace({ size: t.deepLink.onDeepLinkHandlers.size }, "deep link handled, call callbacks");
1520
+ t.deepLink.$store.setValue("handled", !0), ue.trace({ size: t.deepLink.onDeepLinkHandlers.size }, "deep link handled, call callbacks");
1595
1521
  for (const u of t.deepLink.onDeepLinkHandlers)
1596
1522
  try {
1597
- ce.trace("called handler"), u(a);
1523
+ ue.trace("called handler"), u(a);
1598
1524
  } catch (f) {
1599
1525
  console.error(f);
1600
1526
  }
1601
1527
  };
1602
- Lo(t.deepLink.$store, s), r();
1603
- }, ko = le("bypass");
1604
- class Po extends ki {
1528
+ Co(t.deepLink.$store, s), r();
1529
+ }, ko = be("bypass");
1530
+ class Po extends Pi {
1605
1531
  $coreStore;
1606
1532
  deepLink;
1607
1533
  transport;
1608
1534
  bypassLogin;
1609
1535
  constructor(e, r, n) {
1610
- super(), this.$coreStore = e, this.deepLink = n, this.transport = r, this.bypassLogin = Qi(this.transport), this.connect();
1536
+ super(), this.$coreStore = e, this.deepLink = n, this.transport = r, this.bypassLogin = Gi(this.transport), this.connect();
1611
1537
  }
1612
1538
  me = async () => (this.$coreStore.getValues().user.invalidate(), (await this.$coreStore.getValues().user.getValue())?.data);
1613
1539
  /**
@@ -1690,7 +1616,7 @@ class Po extends ki {
1690
1616
  }
1691
1617
  const Je = new Ue(), No = (t, e, r) => {
1692
1618
  t.auth = new Po(t.store, t.transport, t.deepLink), t.stores.status.listen((n) => {
1693
- n === ge.READY && t.auth.reLogin();
1619
+ n === ye.READY && t.auth.reLogin();
1694
1620
  }), t.sdk.userId = t.stores.user.getAtomStore, t.sdk.authorizationBypass = async (n, i) => {
1695
1621
  if (!(Je.getSchema() === n && Je.getExternalToken() === i && t.transport.getHeader("authorization")))
1696
1622
  try {
@@ -1701,7 +1627,7 @@ const Je = new Ue(), No = (t, e, r) => {
1701
1627
  }, t.sdk.logout = () => {
1702
1628
  t.auth.logout(), Je.clear();
1703
1629
  }, t.sdk.getUserStore = () => t.stores.user.getStore(), t.sdk.isUserAuthorized = () => t.auth.isAuthenticated(), r();
1704
- }, Wr = le("video_player"), dt = {
1630
+ }, Wr = be("video_player"), lt = {
1705
1631
  debug: (...t) => {
1706
1632
  Wr.debug(...t), localStorage.getItem("SL_DEBUG") && console.log(...t);
1707
1633
  },
@@ -1712,13 +1638,13 @@ const Je = new Ue(), No = (t, e, r) => {
1712
1638
  t.videoPlayer = {
1713
1639
  controllers: /* @__PURE__ */ new Set()
1714
1640
  }, t.sdk.addVideoPlayerController = (n) => {
1715
- dt.trace("adding video player controller"), t.videoPlayer.controllers.add(n);
1641
+ lt.trace("adding video player controller"), t.videoPlayer.controllers.add(n);
1716
1642
  }, e.videoPlayerController && t.sdk.addVideoPlayerController(e.videoPlayerController), t.sdk.removeVideoPlayerController = (n) => {
1717
- dt.trace("removing video player controller"), t.videoPlayer.controllers.delete(n);
1643
+ lt.trace("removing video player controller"), t.videoPlayer.controllers.delete(n);
1718
1644
  }, t.sdk.controlVideoPlayer = (n) => {
1719
- dt.trace("controlling video player");
1645
+ lt.trace("controlling video player");
1720
1646
  for (const i of t.videoPlayer.controllers) {
1721
- dt.trace("calling video player controller");
1647
+ lt.trace("calling video player controller");
1722
1648
  try {
1723
1649
  i(n);
1724
1650
  } catch (o) {
@@ -1726,13 +1652,24 @@ const Je = new Ue(), No = (t, e, r) => {
1726
1652
  }
1727
1653
  }
1728
1654
  }, r();
1729
- }, Do = (t, e, r) => {
1655
+ }, Do = {
1656
+ [_.FACTOID]: "insight",
1657
+ [_.POLL]: "poll",
1658
+ [_.TRIVIA]: "trivia",
1659
+ [_.PREDICTION]: "prediction",
1660
+ [_.TWEET]: "tweet"
1661
+ }, Ro = (t, e, r) => {
1730
1662
  t.ui = {
1731
1663
  state: /* @__PURE__ */ new Set()
1732
1664
  }, e.onContentActivate && (t.ui.onContentActivate = e.onContentActivate), t.sdk.onAdvertisementActivate = (n) => {
1733
1665
  t.ui.onContentActivate && t.ui.onContentActivate({ ...n, type: "advertisement" });
1666
+ }, t.sdk.onQuestionActivate = ({ questionType: n, ...i }) => {
1667
+ if (t.ui.onContentActivate) {
1668
+ const o = i.type || n && Do[n] || "question";
1669
+ o === "insight" && t.ui.onContentActivate({ ...i, type: o });
1670
+ }
1734
1671
  }, r();
1735
- }, Ro = (t, e, r) => {
1672
+ }, Vo = (t, e, r) => {
1736
1673
  const n = { onMountedFired: !1 }, i = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();
1737
1674
  t.sdk = /* @__PURE__ */ Object.create(null), t.sdk.onMount = ({ name: s, clear: a }, u) => {
1738
1675
  if (i.has(s)) {
@@ -1747,20 +1684,20 @@ const Je = new Ue(), No = (t, e, r) => {
1747
1684
  }, t.sdk.initializeApp = async (s) => {
1748
1685
  if (t.contextConfig = s, t.stores.enabled.get() === "on")
1749
1686
  return { enabled: !0 };
1750
- t.storeSubscribe(), t.stores.enabled.setValue("on"), t.stores.status.setValue(ge.INITIALIZATION);
1687
+ t.storeSubscribe(), t.stores.enabled.setValue("on"), t.stores.status.setValue(ye.INITIALIZATION);
1751
1688
  try {
1752
1689
  const a = await t.stores.organizationSettings.getValue();
1753
- return a ? (t.stores.status.setValue(ge.READY), { enabled: !!a }) : (t.stores.status.setValue(ge.FAILED), { err: "failed" });
1690
+ return a ? (t.stores.status.setValue(ye.READY), { enabled: !!a }) : (t.stores.status.setValue(ye.FAILED), { err: "failed" });
1754
1691
  } catch (a) {
1755
- return t.stores.enabled.setValue(), t.stores.status.setValue(ge.FAILED), { err: `${a}` };
1692
+ return t.stores.enabled.setValue(), t.stores.status.setValue(ye.FAILED), { err: `${a}` };
1756
1693
  }
1757
1694
  }, t.sdk.disableApp = () => {
1758
- t.stores.enabled.get() === "on" && (t.stores.enabled.setValue(), t.stores.status.setValue(ge.DISABLED), t.stores.slStreamId.setValue(), t.stores.providerStreamId.setValue(), t.sdk.closeFeature(!0), t.storeUnsubscribe(), t.transport.disconnect());
1695
+ t.stores.enabled.get() === "on" && (t.stores.enabled.setValue(), t.stores.status.setValue(ye.DISABLED), t.stores.slStreamId.setValue(), t.stores.providerStreamId.setValue(), t.sdk.closeFeature(!0), t.storeUnsubscribe(), t.transport.disconnect());
1759
1696
  }, t.sdk.createEventSession = (s) => {
1760
1697
  t.stores.providerStreamId.setValue(s);
1761
1698
  }, r();
1762
- }, Vo = (t, e) => {
1763
- const { client: r, queryKey: n } = t.createPromiseClient(it, {
1699
+ }, $o = (t, e) => {
1700
+ const { client: r, queryKey: n } = t.createPromiseClient(nt, {
1764
1701
  method: "generateDeepLink",
1765
1702
  params: e
1766
1703
  });
@@ -1780,29 +1717,29 @@ const Je = new Ue(), No = (t, e, r) => {
1780
1717
  // 24 hours
1781
1718
  refetchInterval: 0
1782
1719
  });
1783
- }, $o = (t, { web: e, mobile: r }) => {
1784
- const { client: n } = t.createPromiseClient(wi, { method: "generate" });
1720
+ }, Mo = (t, { web: e, mobile: r }) => {
1721
+ const { client: n } = t.createPromiseClient(Ai, { method: "generate" });
1785
1722
  return n.generate({ web: e, mobile: r });
1786
1723
  }, Yr = (t, e) => {
1787
1724
  const r = new URLSearchParams(t);
1788
1725
  for (const [n, i] of Object.entries(e))
1789
1726
  r.append(n, i);
1790
1727
  return r.toString();
1791
- }, Mo = (t, e, r, n) => {
1728
+ }, jo = (t, e, r, n) => {
1792
1729
  const i = te({});
1793
- return nt(i, () => Vo(t, [e, r]).subscribe(async ({ data: a, error: u, loading: f }) => {
1794
- const c = u ? "https://masters.com" : a?.url, h = n.get() || "", l = e.get() || "", g = r.get() || "", v = {
1795
- [Pt]: h,
1796
- [Fn]: l,
1797
- [Dn]: g
1730
+ return Lt(i, () => $o(t, [e, r]).subscribe(async ({ data: a, error: u, loading: f }) => {
1731
+ const c = u ? "https://masters.com" : a?.url, l = n.get() || "", h = e.get() || "", g = r.get() || "", v = {
1732
+ [Pt]: l,
1733
+ [Dn]: h,
1734
+ [Rn]: g
1798
1735
  };
1799
1736
  if (!f && c) {
1800
1737
  i.setKey("loading", !0);
1801
- let w = window.location.search, b = window.location.hash;
1802
- w && b || b ? w = `?${Yr(w, v)}` : b = `#${Yr("", v)}`;
1803
- const L = window.location.origin + window.location.pathname + w + b;
1738
+ let I = window.location.search, b = window.location.hash;
1739
+ I && b || b ? I = `?${Yr(I, v)}` : b = `#${Yr("", v)}`;
1740
+ const L = window.location.origin + window.location.pathname + I + b;
1804
1741
  try {
1805
- const R = await $o(t, { web: L, mobile: c });
1742
+ const R = await Mo(t, { web: L, mobile: c });
1806
1743
  i.set({
1807
1744
  data: R.data?.link,
1808
1745
  loading: !1
@@ -1822,7 +1759,7 @@ var U;
1822
1759
  (function(t) {
1823
1760
  t.Unset = "unset", t.Required = "required", t.Optional = "optional", t.Completed = "completed", t.Disabled = "disabled", t.Unavailable = "unavailable";
1824
1761
  })(U || (U = {}));
1825
- const jo = (t, e, r, n) => {
1762
+ const Uo = (t, e, r, n) => {
1826
1763
  const { inplayGame: i } = t.featureSettings.get(), o = e.getCurrentSessionId({ prefix: "onboarding" });
1827
1764
  i && r.add({
1828
1765
  type: Ae.ONBOARDING,
@@ -1832,7 +1769,7 @@ const jo = (t, e, r, n) => {
1832
1769
  autoHideDuration: 1e6,
1833
1770
  data: {
1834
1771
  questionId: "onboarding",
1835
- questionType: F.UNSET,
1772
+ questionType: _.UNSET,
1836
1773
  onboarding: {
1837
1774
  ...i,
1838
1775
  instantOpen: !n.getOnboardingInstantOpen({
@@ -1843,7 +1780,7 @@ const jo = (t, e, r, n) => {
1843
1780
  }
1844
1781
  }
1845
1782
  });
1846
- }, ft = (t, e, r, n, i, o) => {
1783
+ }, dt = (t, e, r, n, i, o) => {
1847
1784
  try {
1848
1785
  const s = e.userId.get();
1849
1786
  if (!s)
@@ -1854,35 +1791,35 @@ const jo = (t, e, r, n) => {
1854
1791
  eventId: e.slStreamId.get() || ""
1855
1792
  }) === U.Completed) {
1856
1793
  t.set(U.Completed);
1857
- for (const l of o)
1858
- l();
1794
+ for (const h of o)
1795
+ h();
1859
1796
  return;
1860
1797
  }
1861
1798
  const u = e.moderation.getStore().value?.data, f = r.featureSettings.get().inplayGame;
1862
1799
  if (u === void 0 || f === void 0)
1863
1800
  return;
1864
- const c = u?.options?.onboardingEnabled, h = f?.titleCard?.optIn;
1865
- c ? h ? t.set(U.Required) : t.set(U.Optional) : (h ? t.set(U.Unavailable) : t.set(U.Disabled), n.close(e.getCurrentSessionId({ prefix: "onboarding" }), { markAsViewed: !1 }));
1801
+ const c = u?.options?.onboardingEnabled, l = f?.titleCard?.optIn;
1802
+ c ? l ? t.set(U.Required) : t.set(U.Optional) : (l ? t.set(U.Unavailable) : t.set(U.Disabled), n.close(e.getCurrentSessionId({ prefix: "onboarding" }), { markAsViewed: !1 }));
1866
1803
  } catch (s) {
1867
1804
  console.error(s);
1868
1805
  }
1869
- }, Uo = (t, e, r, n) => {
1806
+ }, Bo = (t, e, r, n) => {
1870
1807
  let i = !1;
1871
- const o = new Nn(), s = B(U.Unset);
1808
+ const o = new Fn(), s = x(U.Unset);
1872
1809
  s.subscribe((f) => {
1873
- f !== U.Unset && ((f === U.Optional || f === U.Required) && i === !1 && (jo(t, e, n, o), i = !0), f === U.Completed && e.activeQuestionId.invalidate(), o.setOnboardingInstantOpen({
1810
+ f !== U.Unset && ((f === U.Optional || f === U.Required) && i === !1 && (Uo(t, e, n, o), i = !0), f === U.Completed && e.activeQuestionId.invalidate(), o.setOnboardingInstantOpen({
1874
1811
  userId: e.userId.get() || "",
1875
1812
  organizationId: e.organizationId.get() || "",
1876
1813
  eventId: e.slStreamId.get() || ""
1877
1814
  }));
1878
1815
  });
1879
1816
  const a = [];
1880
- return ft(s, e, t, n, o, a), s.get() !== U.Completed && (a.push(e.userId.listen((f) => {
1881
- f && ft(s, e, t, n, o, a);
1817
+ return dt(s, e, t, n, o, a), s.get() !== U.Completed && (a.push(e.userId.listen((f) => {
1818
+ f && dt(s, e, t, n, o, a);
1882
1819
  })), a.push(e.moderation.listen((f) => {
1883
- f.data && ft(s, e, t, n, o, a);
1820
+ f.data && dt(s, e, t, n, o, a);
1884
1821
  })), a.push(t.featureSettings.listen((f) => {
1885
- f && ft(s, e, t, n, o, a);
1822
+ f && dt(s, e, t, n, o, a);
1886
1823
  }))), { $store: s, submitInplay: async () => {
1887
1824
  const f = e.slStreamId.get();
1888
1825
  if (f) {
@@ -1898,35 +1835,35 @@ const jo = (t, e, r, n) => {
1898
1835
  n.close(c);
1899
1836
  }
1900
1837
  } };
1901
- }, Bo = (t, e, r, n) => {
1838
+ }, qo = (t, e, r, n) => {
1902
1839
  const i = te(void 0), o = Pn(n), s = async () => {
1903
1840
  const u = t.get(), f = e.get(), c = r.getStore().get().data?.map((g) => g.slId);
1904
1841
  if (!c)
1905
1842
  return;
1906
- const h = {
1843
+ const l = {
1907
1844
  eventId: u,
1908
1845
  userId: f,
1909
1846
  usersIds: [...c, f]
1910
- }, l = await o(h);
1911
- i.set(l.data?.attributes);
1847
+ }, h = await o(l);
1848
+ i.set(h.data?.attributes);
1912
1849
  }, a = () => {
1913
1850
  s();
1914
1851
  };
1915
- return nt(i, () => {
1852
+ return Lt(i, () => {
1916
1853
  const u = t.listen(s), f = r.listen(s), c = e.listen(s);
1917
1854
  return () => {
1918
1855
  u(), f(), c();
1919
1856
  };
1920
1857
  }), { $store: i, invalidate: a };
1921
- }, qo = async (t, e, r, n, i) => {
1922
- const o = Pn(i), s = t.get(), a = e.get(), u = r.getStore().get().data?.map((l) => l.slId) || [], f = {
1858
+ }, xo = async (t, e, r, n, i) => {
1859
+ const o = Pn(i), s = t.get(), a = e.get(), u = r.getStore().get().data?.map((h) => h.slId) || [], f = {
1923
1860
  eventId: s,
1924
1861
  userId: n,
1925
1862
  usersIds: [...u, a]
1926
1863
  };
1927
1864
  return (await o(f)).data?.attributes?.summary;
1928
- }, xo = /* @__PURE__ */ new Set([F.POLL, F.PREDICTION, F.TRIVIA]);
1929
- class Qo extends Ln {
1865
+ }, Qo = /* @__PURE__ */ new Set([_.POLL, _.PREDICTION, _.TRIVIA]);
1866
+ class Go extends Cn {
1930
1867
  /** user statistics (leaderboard panel) */
1931
1868
  userSummary;
1932
1869
  /** feed list (pick history) */
@@ -1961,9 +1898,9 @@ class Qo extends Ln {
1961
1898
  submitAnswerTimeout;
1962
1899
  cancels = /* @__PURE__ */ new Set();
1963
1900
  constructor(e, r, n) {
1964
- super(e, r), this.background = new yo(n), this.advertisement = this.background.advertisement, this.feedSubscription = this.background.feedSubscription, this.activeQuestionId = this.background.activeQuestionId, this.openedQuestionId = this.background.openedQuestionId, this.storage = new Nn(), this.feedList = this.background.feedList, this.friends = new re(to(this.background.userId, n.transport), "gamification:friends"), this.currentUserId = this.background.userId, this.openedUser = B(void 0), this.leaderboardId = new Y(B(this.settings.getValue("pinnedLeaderboardId")), "pinnedLeaderboardId").getStore(), this.onboardingStatus = Uo(this, this.background, n.transport, n.notifications), this.notifications = n.notifications, this.transport = n.transport, this.closeFeature = () => n.sdk.closeFeature(!0), this.openFeature = () => n.sdk.openFeature(D.GAMES), this.openedQuestion = this.background.openedQuestion, this.deepLink = Mo(this.transport, this.background.slStreamId, n.stores.providerStreamId.getStore(), this.background.userId), this.userSummary = Bo(this.background.slStreamId, this.background.userId, this.friends, this.transport), this.leaderboardList = Io(this.transport, this.background.slStreamId, this.background.userId, this.friends), this.connect(), this.cancels.add(this.userSummary.$store.listen((i, o) => {
1901
+ super(e, r), this.background = new yo(n), this.advertisement = this.background.advertisement, this.feedSubscription = this.background.feedSubscription, this.activeQuestionId = this.background.activeQuestionId, this.openedQuestionId = this.background.openedQuestionId, this.storage = new Fn(), this.feedList = this.background.feedList, this.friends = new ce(ro(this.background.userId, n.transport), "gamification:friends"), this.currentUserId = this.background.userId, this.openedUser = x(void 0), this.leaderboardId = new Y(x(this.settings.getValue("pinnedLeaderboardId")), "pinnedLeaderboardId").getStore(), this.onboardingStatus = Bo(this, this.background, n.transport, n.notifications), this.notifications = n.notifications, this.transport = n.transport, this.closeFeature = () => n.sdk.closeFeature(!0), this.openFeature = () => n.sdk.openFeature(D.GAMES), this.openedQuestion = this.background.openedQuestion, this.deepLink = jo(this.transport, this.background.slStreamId, n.stores.providerStreamId.getStore(), this.background.userId), this.userSummary = qo(this.background.slStreamId, this.background.userId, this.friends, this.transport), this.leaderboardList = Io(this.transport, this.background.slStreamId, this.background.userId, this.friends), this.connect(), this.cancels.add(this.userSummary.$store.listen((i, o) => {
1965
1902
  o?.summary && i?.summary && this.leaderboardList.invalidate();
1966
- })), 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)), nt(this.background.activeQuestionId, () => {
1903
+ })), 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)), Lt(this.background.activeQuestionId, () => {
1967
1904
  this.background.activeQuestionId.listen(this.showInApp);
1968
1905
  }), n.sdk.onMount({ name: "gamification", clear: !0 }, () => () => {
1969
1906
  for (const i of this.cancels)
@@ -1971,11 +1908,11 @@ class Qo extends Ln {
1971
1908
  });
1972
1909
  }
1973
1910
  get isInteractiveAllowed() {
1974
- return this.background.interactiveAllowed.get() === Ce.ALLOWED;
1911
+ return this.background.interactiveAllowed.get() === Le.ALLOWED;
1975
1912
  }
1976
1913
  checkInteractiveFlag = () => {
1977
1914
  const e = this.onboardingStatus.$store.get(), r = this.background.moderation.getStore().value?.data?.options?.onboardingEnabled, n = this.settings.getValues().inplayGame?.titleCard?.optIn, i = e === U.Completed, o = !r || i || n !== !0;
1978
- this.background.interactiveAllowed.set(o ? Ce.ALLOWED : Ce.DISALLOWED);
1915
+ this.background.interactiveAllowed.set(o ? Le.ALLOWED : Le.DISALLOWED);
1979
1916
  };
1980
1917
  connect = () => {
1981
1918
  this.cancels.add(this.background.feedSubscription.addListener("feed-subscription-prediction-close", async (e) => {
@@ -1985,22 +1922,22 @@ class Qo extends Ln {
1985
1922
  if (!r || !n?.attributes)
1986
1923
  return;
1987
1924
  const { status: i, type: o, id: s, answers: a } = r;
1988
- if (i === H.RESOLVED && o === F.PREDICTION) {
1925
+ if (i === W.RESOLVED && o === _.PREDICTION) {
1989
1926
  const u = this.background.getCurrentSessionId({
1990
1927
  prefix: `notification-id:${s}`
1991
- }), f = [...this.feedList.getValues().data || []], c = f.findIndex((Q) => Q.id === s), h = f[c];
1992
- let l = h?.attributes?.attributes?.value?.answerId;
1928
+ }), f = [...this.feedList.getValues().data || []], c = f.findIndex((Q) => Q.id === s), l = f[c];
1929
+ let h = l?.attributes?.attributes?.value?.answerId;
1993
1930
  const g = ar(s, this.transport), v = g.subscribe(() => {
1994
1931
  });
1995
1932
  await g.get().promise;
1996
- const w = g.get().data;
1933
+ const I = g.get().data;
1997
1934
  v(), window.requestAnimationFrame(() => {
1998
1935
  g.invalidate();
1999
- }), l || (l = w?.answers.find(({ youVoted: Q }) => Q)?.id);
2000
- const b = a.find(({ correct: Q }) => Q), L = l ? a.find(({ id: Q }) => Q === l) : void 0, R = !!L?.correct;
2001
- if (h && f[c]?.attributes?.attributes.case === "question") {
1936
+ }), h || (h = I?.answers.find(({ youVoted: Q }) => Q)?.id);
1937
+ const b = a.find(({ correct: Q }) => Q), L = h ? a.find(({ id: Q }) => Q === h) : void 0, R = !!L?.correct;
1938
+ if (l && f[c]?.attributes?.attributes.case === "question") {
2002
1939
  try {
2003
- f[c].attributes.attributes.value.answerId = l, f[c].attributes.attributes.value.openForVoting = !1, l && (f[c].attributes.attributes.value.status = R ? lt.WON : lt.LOST);
1940
+ f[c].attributes.attributes.value.answerId = h, f[c].attributes.attributes.value.openForVoting = !1, h && (f[c].attributes.attributes.value.status = R ? ct.WON : ct.LOST);
2004
1941
  } catch {
2005
1942
  }
2006
1943
  this.feedList.getStore().mutate(f);
@@ -2016,7 +1953,7 @@ class Qo extends Ln {
2016
1953
  emitEvent: !1,
2017
1954
  data: {
2018
1955
  questionId: s,
2019
- questionType: F.PREDICTION,
1956
+ questionType: _.PREDICTION,
2020
1957
  question: {
2021
1958
  title: R ? `Congratulations! You answered correctly! You won ${b.points} pts!` : `Better luck next time! Correct: ${b?.text}!`,
2022
1959
  votedAnswer: {
@@ -2025,7 +1962,7 @@ class Qo extends Ln {
2025
1962
  },
2026
1963
  correctAnswerTitle: b?.text,
2027
1964
  correct: !!R,
2028
- predictionResult: i === H.RESOLVED,
1965
+ predictionResult: i === W.RESOLVED,
2029
1966
  questionTitle: r?.subject
2030
1967
  }
2031
1968
  }
@@ -2033,7 +1970,7 @@ class Qo extends Ln {
2033
1970
  }
2034
1971
  })), this.cancels.add(this.background.feedSubscription.addListener("feed-subscription-questions-list", (e) => {
2035
1972
  const r = [...this.feedList.getStore().value?.data || []], n = e.data?.attributes?.feedItem, i = r.findIndex((o) => o.id === n?.id);
2036
- if (n?.attributes && n.attributes.attributes.case !== "promotion" && !(n.attributes.status !== H.ACTIVE && n.attributes.status !== H.RESOLVED)) {
1973
+ if (n?.attributes && n.attributes.attributes.case !== "promotion" && !(n.attributes.status !== W.ACTIVE && n.attributes.status !== W.RESOLVED)) {
2037
1974
  if (i !== -1)
2038
1975
  if (n.attributes.attributes.case === "question" && r[i].attributes?.attributes.case === "question") {
2039
1976
  const o = r[i];
@@ -2099,7 +2036,7 @@ class Qo extends Ln {
2099
2036
  const a = this.feedList.getValues().data;
2100
2037
  if (!a)
2101
2038
  return;
2102
- const u = a.findIndex((h) => h.id === e), f = a[u], c = f?.attributes?.attributes.case === "question" && f.attributes.attributes.value;
2039
+ const u = a.findIndex((l) => l.id === e), f = a[u], c = f?.attributes?.attributes.case === "question" && f.attributes.attributes.value;
2103
2040
  if (c) {
2104
2041
  J.emit("poll", {
2105
2042
  action: "voted",
@@ -2108,12 +2045,12 @@ class Qo extends Ln {
2108
2045
  questionType: c.questionType
2109
2046
  }
2110
2047
  });
2111
- const h = n.get().data;
2112
- if (i(), h) {
2113
- const l = h.answers.find((b) => b.correct === !0), g = h.answers.findIndex((b) => b.id === r), v = h.answers[g], w = h.answers.every(({ percentageDecimal: b }, L) => b === o?.answers[L].percentageDecimal);
2114
- a[u].attributes.attributes.value.answerId = r, a[u].attributes.attributes.value.openForVoting = !1, a[u].attributes.attributes.value.text = v?.text || "", l && (a[u].attributes.attributes.value.status = l.id === r ? lt.WON : lt.LOST), this.feedList.getStore().mutate([...a]), h.answers[g].correct = l?.id === r, h.answers[g].youVoted = !0, w && h.answers.forEach((b) => {
2048
+ const l = n.get().data;
2049
+ if (i(), l) {
2050
+ const h = l.answers.find((b) => b.correct === !0), g = l.answers.findIndex((b) => b.id === r), v = l.answers[g], I = l.answers.every(({ percentageDecimal: b }, L) => b === o?.answers[L].percentageDecimal);
2051
+ a[u].attributes.attributes.value.answerId = r, a[u].attributes.attributes.value.openForVoting = !1, a[u].attributes.attributes.value.text = v?.text || "", h && (a[u].attributes.attributes.value.status = h.id === r ? ct.WON : ct.LOST), this.feedList.getStore().mutate([...a]), l.answers[g].correct = h?.id === r, l.answers[g].youVoted = !0, I && l.answers.forEach((b) => {
2115
2052
  b.percentageDecimal = 0;
2116
- }), l?.id === r && (h.answers[g].pointsEarned = h.status === H.RESOLVED ? 0 : l.points), n.mutate({ ...h });
2053
+ }), h?.id === r && (l.answers[g].pointsEarned = l.status === W.RESOLVED ? 0 : h.points), n.mutate({ ...l });
2117
2054
  }
2118
2055
  this.submitAnswerTimeout && clearTimeout(this.submitAnswerTimeout), this.submitAnswerTimeout = setTimeout(() => {
2119
2056
  this.userSummary.invalidate();
@@ -2152,8 +2089,8 @@ class Qo extends Ln {
2152
2089
  }
2153
2090
  }), this.background.openQuestion(e, r);
2154
2091
  };
2155
- getFeedItem = (e) => io(e, this.transport);
2156
- isOpenedQuestion = (e) => this.notifications.isViewed(e);
2092
+ getFeedItem = (e) => oo(e, this.transport);
2093
+ isOpenedQuestion = (e) => !!this.notifications.isViewed(e);
2157
2094
  closeQuestion = (e) => this.background.closeQuestion(e);
2158
2095
  openUser = async (e) => {
2159
2096
  const r = this.leaderboardList.$store.get().data?.find((i) => i.userId === e);
@@ -2167,7 +2104,7 @@ class Qo extends Ln {
2167
2104
  }
2168
2105
  const n = { ...r };
2169
2106
  try {
2170
- const i = await qo(this.background.slStreamId, this.background.userId, this.friends, e, this.transport);
2107
+ const i = await xo(this.background.slStreamId, this.background.userId, this.friends, e, this.transport);
2171
2108
  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);
2172
2109
  } catch (i) {
2173
2110
  console.error(i);
@@ -2185,8 +2122,8 @@ class Qo extends Ln {
2185
2122
  */
2186
2123
  showInApp = (e) => {
2187
2124
  const r = this.onboardingStatus.$store.get();
2188
- if (e && e.data && r && r !== U.Unset && e.data.question?.id !== void 0 && e.data.question.notification !== void 0 && e.data.question?.bypassNotifications?.inAppSilence !== mi.ON && e.data.question.status === H.ACTIVE && !e.data.question.marketClosed) {
2189
- if (xo.has(e.data.question.type))
2125
+ if (e && e.data && r && r !== U.Unset && e.data.question?.id !== void 0 && e.data.question.notification !== void 0 && e.data.question?.bypassNotifications?.inAppSilence !== vi.ON && e.data.question.status === W.ACTIVE && !e.data.question.marketClosed) {
2126
+ if (Qo.has(e.data.question.type))
2190
2127
  this.isInteractiveAllowed && this.notifications.add({
2191
2128
  type: Ae.QUESTION,
2192
2129
  action: () => this.openQuestion(e.data?.question?.id, e.data?.feedItem),
@@ -2205,7 +2142,7 @@ class Qo extends Ln {
2205
2142
  }
2206
2143
  }
2207
2144
  });
2208
- else if (e.data.question.type === F.FACTOID) {
2145
+ else if (e.data.question.type === _.FACTOID) {
2209
2146
  const n = e.data.question.options?.options.value, i = {
2210
2147
  heading: e.data.question.notification.title,
2211
2148
  body: e.data.question.notification.body,
@@ -2234,7 +2171,7 @@ class Qo extends Ln {
2234
2171
  insight: i
2235
2172
  }
2236
2173
  });
2237
- } else if (e.data.question.type === F.TWEET) {
2174
+ } else if (e.data.question.type === _.TWEET) {
2238
2175
  const n = e.data.question.options?.options.value, i = {
2239
2176
  title: e.data.question.notification?.title,
2240
2177
  body: e.data.question.notification?.body,
@@ -2261,16 +2198,16 @@ class Qo extends Ln {
2261
2198
  }
2262
2199
  };
2263
2200
  }
2264
- const Go = {
2201
+ const Ko = {
2265
2202
  [D.GAMES]: !0
2266
2203
  };
2267
- class Ko extends Ln {
2204
+ class zo extends Cn {
2268
2205
  constructor(e, r) {
2269
2206
  super(e, r);
2270
2207
  }
2271
2208
  }
2272
- const zo = (t, e, r) => t.type === D.GAMES ? new Qo(t, e, r) : new Ko(t, e), Ho = (t, e, r) => {
2273
- t.features = /* @__PURE__ */ new Map(), t.sdk.featuresList = new Y(B(/* @__PURE__ */ new Set()), "features-list"), t.activeFeature = new Y(B(D.UNSET), "activeFeature"), t.sdk.getFeatures = () => t.features, t.sdk.getFeature = (n) => t.features.get(n), t.sdk.getActiveFeature = () => t.activeFeature.getStore(), t.sdk.openFeature = (n) => {
2209
+ const Ho = (t, e, r) => t.type === D.GAMES ? new Go(t, e, r) : new zo(t, e), Wo = (t, e, r) => {
2210
+ t.features = /* @__PURE__ */ new Map(), t.sdk.featuresList = new Y(x(/* @__PURE__ */ new Set()), "features-list"), t.activeFeature = new Y(x(D.UNSET), "activeFeature"), t.sdk.getFeatures = () => t.features, t.sdk.getFeature = (n) => t.features.get(n), t.sdk.getActiveFeature = () => t.activeFeature.getStore(), t.sdk.openFeature = (n) => {
2274
2211
  t.activeFeature.setValue(n);
2275
2212
  }, t.sdk.closeFeature = (n = !1) => {
2276
2213
  const i = t.activeFeature.getValue();
@@ -2279,9 +2216,9 @@ const zo = (t, e, r) => t.type === D.GAMES ? new Qo(t, e, r) : new Ko(t, e), Ho
2279
2216
  const o = t.sdk.featuresList.getValue();
2280
2217
  o && o.delete(i), t.sdk.featuresList.setValue(o);
2281
2218
  }
2282
- }, t.initFeature = (n, i = ye.ORGANIZATION) => {
2283
- if (n.type in Go && !t.features.has(n.type)) {
2284
- const o = zo(n, i, t);
2219
+ }, t.initFeature = (n, i = pe.ORGANIZATION) => {
2220
+ if (n.type in Ko && !t.features.has(n.type)) {
2221
+ const o = Ho(n, i, t);
2285
2222
  t.features.set(n.type, o);
2286
2223
  let s = t.sdk.featuresList.getValue();
2287
2224
  s ? s.add(n.type) : s = /* @__PURE__ */ new Set([n.type]), t.sdk.featuresList.setValue(new Set(s));
@@ -2296,12 +2233,12 @@ const zo = (t, e, r) => t.type === D.GAMES ? new Qo(t, e, r) : new Ko(t, e), Ho
2296
2233
  const n = await t.stores.organizationSettings.getValue();
2297
2234
  t.features.clear(), t.sdk.featuresList.setValue(/* @__PURE__ */ new Set());
2298
2235
  for (const i of n?.overlays || [])
2299
- t.initFeature(i, ye.ORGANIZATION);
2236
+ t.initFeature(i, pe.ORGANIZATION);
2300
2237
  }, t.stores.providerStreamId.listen((n) => {
2301
2238
  n || t.reinitializeFeatures();
2302
2239
  }), t.storeSubscribe = () => {
2303
2240
  const n = (o, s) => {
2304
- if (s?.overlays && !(t.contextConfig?.skipOrganizationSettings && o === ye.ORGANIZATION))
2241
+ if (s?.overlays && !(t.contextConfig?.skipOrganizationSettings && o === pe.ORGANIZATION))
2305
2242
  for (const a of s.overlays)
2306
2243
  a.sdkEnable === !0 && (t.features.has(a.type) ? t.updateFeature(a, o) : t.initFeature(a, o));
2307
2244
  }, i = {
@@ -2317,7 +2254,7 @@ const zo = (t, e, r) => t.type === D.GAMES ? new Qo(t, e, r) : new Ko(t, e), Ho
2317
2254
  organizationSettings: (o) => {
2318
2255
  if (o.data)
2319
2256
  try {
2320
- n(ye.ORGANIZATION, o.data);
2257
+ n(pe.ORGANIZATION, o.data);
2321
2258
  } catch (s) {
2322
2259
  console.log(s);
2323
2260
  }
@@ -2325,7 +2262,7 @@ const zo = (t, e, r) => t.type === D.GAMES ? new Qo(t, e, r) : new Ko(t, e), Ho
2325
2262
  streamSettings: (o) => {
2326
2263
  if (o.data)
2327
2264
  try {
2328
- n(ye.STREAM, o.data);
2265
+ n(pe.STREAM, o.data);
2329
2266
  } catch (s) {
2330
2267
  console.log(s);
2331
2268
  }
@@ -2334,7 +2271,7 @@ const zo = (t, e, r) => t.type === D.GAMES ? new Qo(t, e, r) : new Ko(t, e), Ho
2334
2271
  t.store.subscribe(i);
2335
2272
  }, r();
2336
2273
  };
2337
- class Wo {
2274
+ class Yo {
2338
2275
  analytics;
2339
2276
  constructor(e) {
2340
2277
  this.analytics = e, this.analytics.onConnect(() => {
@@ -2353,7 +2290,7 @@ class Wo {
2353
2290
  this.analytics.write("invitation", {
2354
2291
  common: {
2355
2292
  ...this.analytics.commonStore.getValues(),
2356
- kind: x.INVITATION_ACCEPTED
2293
+ kind: q.INVITATION_ACCEPTED
2357
2294
  },
2358
2295
  category: Dr.GAMES,
2359
2296
  from: Rr.UNSET
@@ -2363,14 +2300,14 @@ class Wo {
2363
2300
  this.analytics.write("invitation", {
2364
2301
  common: {
2365
2302
  ...this.analytics.commonStore.getValues(),
2366
- kind: x.INVITATION_SENT
2303
+ kind: q.INVITATION_SENT
2367
2304
  },
2368
2305
  category: Dr.GAMES,
2369
2306
  from: e || Rr.UNSET
2370
2307
  });
2371
2308
  };
2372
2309
  }
2373
- class Yo {
2310
+ class Jo {
2374
2311
  analytics;
2375
2312
  constructor(e) {
2376
2313
  this.analytics = e, this.analytics.onConnect(() => {
@@ -2392,7 +2329,7 @@ class Yo {
2392
2329
  this.analytics.write("interactions", {
2393
2330
  common: {
2394
2331
  ...this.analytics.commonStore.getValues(),
2395
- kind: x.INTERACTIONS
2332
+ kind: q.INTERACTIONS
2396
2333
  },
2397
2334
  actionType: qr.TAP
2398
2335
  });
@@ -2401,13 +2338,13 @@ class Yo {
2401
2338
  this.analytics.write("interactions", {
2402
2339
  common: {
2403
2340
  ...this.analytics.commonStore.getValues(),
2404
- kind: x.INTERACTIONS
2341
+ kind: q.INTERACTIONS
2405
2342
  },
2406
2343
  actionType: qr.SCROLL
2407
2344
  });
2408
2345
  };
2409
2346
  }
2410
- const Jo = {
2347
+ const Xo = {
2411
2348
  [Te.UNSET]: we.UNSET,
2412
2349
  [Te.INGAME_IAB21]: we.PROMOTION_INGAME_IAB21,
2413
2350
  [Te.INGAME_IAB11_LBAR]: we.PROMOTION_INGAME_IAB11_LBAR,
@@ -2416,13 +2353,13 @@ const Jo = {
2416
2353
  [Te.INGAME_IAB61]: we.PROMOTION_INGAME_IAB61,
2417
2354
  [Te.EXTERNAL_AD]: we.PROMOTION_GAM
2418
2355
  };
2419
- class Xo {
2356
+ class Zo {
2420
2357
  analytics;
2421
2358
  constructor(e) {
2422
2359
  this.analytics = e, this.analytics.onConnect(() => {
2423
2360
  const r = (n) => {
2424
2361
  if (n.slEventBus?.type === "advertisement") {
2425
- const i = n.slEventBus.payload.advertisementType ? Jo[n.slEventBus.payload.advertisementType] : we.UNSET;
2362
+ const i = n.slEventBus.payload.advertisementType ? Xo[n.slEventBus.payload.advertisementType] : we.UNSET;
2426
2363
  switch (n.slEventBus.action) {
2427
2364
  case "videoPlay":
2428
2365
  this.videoPlay(n.slEventBus.payload, { topicSubType: i });
@@ -2449,7 +2386,7 @@ class Xo {
2449
2386
  this.analytics.write("games", {
2450
2387
  common: {
2451
2388
  ...this.analytics.commonStore.getValues(),
2452
- kind: x.POLLS_RECEIVED,
2389
+ kind: q.POLLS_RECEIVED,
2453
2390
  topicId: e,
2454
2391
  topicType: z.POLLS_PROMOTION,
2455
2392
  topicSubType: r
@@ -2461,7 +2398,7 @@ class Xo {
2461
2398
  this.analytics.write("games", {
2462
2399
  common: {
2463
2400
  ...this.analytics.commonStore.getValues(),
2464
- kind: x.POLLS_OPENED,
2401
+ kind: q.POLLS_OPENED,
2465
2402
  topicId: e,
2466
2403
  topicType: z.POLLS_PROMOTION,
2467
2404
  topicSubType: r
@@ -2474,7 +2411,7 @@ class Xo {
2474
2411
  common: {
2475
2412
  ...this.analytics.commonStore.getValues(),
2476
2413
  topicId: e,
2477
- kind: x.AD_VIDEO_PLAYED,
2414
+ kind: q.AD_VIDEO_PLAYED,
2478
2415
  topicSubType: r
2479
2416
  },
2480
2417
  pollOpenedFrom: ee.UNSET
@@ -2485,7 +2422,7 @@ class Xo {
2485
2422
  common: {
2486
2423
  ...this.analytics.commonStore.getValues(),
2487
2424
  topicId: e,
2488
- kind: x.AD_BUTTON_NAVIGATED,
2425
+ kind: q.AD_BUTTON_NAVIGATED,
2489
2426
  topicSubType: r
2490
2427
  },
2491
2428
  pollOpenedFrom: ee.UNSET
@@ -2496,7 +2433,7 @@ class Xo {
2496
2433
  common: {
2497
2434
  ...this.analytics.commonStore.getValues(),
2498
2435
  topicId: e,
2499
- kind: x.AD_BANNER_NAVIGATED,
2436
+ kind: q.AD_BANNER_NAVIGATED,
2500
2437
  topicSubType: r
2501
2438
  },
2502
2439
  pollOpenedFrom: ee.UNSET
@@ -2504,16 +2441,16 @@ class Xo {
2504
2441
  };
2505
2442
  }
2506
2443
  const Ze = {
2507
- [F.UNSET]: z.UNSET,
2508
- [F.FACTOID]: z.POLLS_INSIGHT,
2509
- [F.POLL]: z.POLLS_POLL,
2510
- [F.PREDICTION]: z.POLLS_PREDICTION,
2511
- [F.PROMOTION]: z.POLLS_PROMOTION,
2512
- [F.TRIVIA]: z.POLLS_TRIVIA,
2513
- [F.TWEET]: z.POLLS_TWITTER
2444
+ [_.UNSET]: z.UNSET,
2445
+ [_.FACTOID]: z.POLLS_INSIGHT,
2446
+ [_.POLL]: z.POLLS_POLL,
2447
+ [_.PREDICTION]: z.POLLS_PREDICTION,
2448
+ [_.PROMOTION]: z.POLLS_PROMOTION,
2449
+ [_.TRIVIA]: z.POLLS_TRIVIA,
2450
+ [_.TWEET]: z.POLLS_TWITTER
2514
2451
  };
2515
- F.UNSET + "", he.UNSET, F.FACTOID + "", he.POLLS, F.POLL + "", he.POLLS, F.PREDICTION + "", he.POLLS, F.PROMOTION + "", he.POLLS, F.TRIVIA + "", he.POLLS, F.TWEET + "", he.POLLS;
2516
- const Zo = {
2452
+ _.UNSET + "", fe.UNSET, _.FACTOID + "", fe.POLLS, _.POLL + "", fe.POLLS, _.PREDICTION + "", fe.POLLS, _.PROMOTION + "", fe.POLLS, _.TRIVIA + "", fe.POLLS, _.TWEET + "", fe.POLLS;
2453
+ const es = {
2517
2454
  [D.UNSET]: G.UNSET,
2518
2455
  [D.INPLAY]: G.INPLAY,
2519
2456
  [D.MESSAGING]: G.MESSAGING,
@@ -2533,7 +2470,7 @@ const Zo = {
2533
2470
  [D.HIGHLIGHTS]: G.HIGHLIGHTS,
2534
2471
  [D.PUBLIC_CHAT]: G.PUBLIC_CHAT
2535
2472
  };
2536
- class es {
2473
+ class ts {
2537
2474
  analytics;
2538
2475
  constructor(e) {
2539
2476
  this.analytics = e, this.analytics.onConnect(() => {
@@ -2555,11 +2492,11 @@ class es {
2555
2492
  this.analytics.write("notification", {
2556
2493
  common: {
2557
2494
  ...this.analytics.commonStore.getValues(),
2558
- kind: x.NOTIFICATION_RECEIVED,
2495
+ kind: q.NOTIFICATION_RECEIVED,
2559
2496
  topicId: e,
2560
2497
  topicType: r ? Ze[r] : z.UNSET
2561
2498
  },
2562
- notificationKind: he.POLLS,
2499
+ notificationKind: fe.POLLS,
2563
2500
  notificationType: xr.IN_APP
2564
2501
  });
2565
2502
  };
@@ -2567,16 +2504,16 @@ class es {
2567
2504
  this.analytics.write("notification", {
2568
2505
  common: {
2569
2506
  ...this.analytics.commonStore.getValues(),
2570
- kind: x.NOTIFICATION_OPENED,
2507
+ kind: q.NOTIFICATION_OPENED,
2571
2508
  topicId: e,
2572
2509
  topicType: r ? Ze[r] : z.UNSET
2573
2510
  },
2574
- notificationKind: he.POLLS,
2511
+ notificationKind: fe.POLLS,
2575
2512
  notificationType: xr.IN_APP
2576
2513
  });
2577
2514
  };
2578
2515
  }
2579
- class ts {
2516
+ class rs {
2580
2517
  analytics;
2581
2518
  constructor(e) {
2582
2519
  this.analytics = e, this.analytics.onConnect(() => {
@@ -2608,7 +2545,7 @@ class ts {
2608
2545
  this.analytics.write("games", {
2609
2546
  common: {
2610
2547
  ...this.analytics.commonStore.getValues(),
2611
- kind: x.POLLS_RECEIVED,
2548
+ kind: q.POLLS_RECEIVED,
2612
2549
  topicId: e,
2613
2550
  topicType: r ? Ze[r] : z.UNSET
2614
2551
  },
@@ -2620,7 +2557,7 @@ class ts {
2620
2557
  this.analytics.write("games", {
2621
2558
  common: {
2622
2559
  ...this.analytics.commonStore.getValues(),
2623
- kind: x.POLLS_OPENED,
2560
+ kind: q.POLLS_OPENED,
2624
2561
  topicId: e,
2625
2562
  topicType: r ? Ze[r] : z.UNSET
2626
2563
  },
@@ -2632,7 +2569,7 @@ class ts {
2632
2569
  this.analytics.write("games", {
2633
2570
  common: {
2634
2571
  ...this.analytics.commonStore.getValues(),
2635
- kind: x.POLLS_VOTE,
2572
+ kind: q.POLLS_VOTE,
2636
2573
  topicId: e,
2637
2574
  topicType: r ? Ze[r] : z.UNSET
2638
2575
  },
@@ -2644,7 +2581,7 @@ class ts {
2644
2581
  this.analytics.write("games", {
2645
2582
  common: {
2646
2583
  ...this.analytics.commonStore.getValues(),
2647
- kind: x.GAMES_JOINED
2584
+ kind: q.GAMES_JOINED
2648
2585
  },
2649
2586
  pollOpenedFrom: ee.UNSET
2650
2587
  });
@@ -2654,28 +2591,28 @@ class ts {
2654
2591
  this.analytics.write("games", {
2655
2592
  common: {
2656
2593
  ...this.analytics.commonStore.getValues(),
2657
- kind: x.POLLS_NAVIGATED
2594
+ kind: q.POLLS_NAVIGATED
2658
2595
  },
2659
2596
  pollOpenedFrom: ee.UNSET
2660
2597
  });
2661
2598
  };
2662
2599
  }
2663
- const rs = ({ transport: t, $commonStore: e }) => {
2600
+ const ns = ({ transport: t, $commonStore: e }) => {
2664
2601
  let r;
2665
- const n = B(!1), i = 5e3, { client: o, queryKey: s } = t.createPromiseClient(En, {
2602
+ const n = x(!1), i = 5e3, { client: o, queryKey: s } = t.createPromiseClient(En, {
2666
2603
  method: "send",
2667
2604
  params: [n]
2668
2605
  }), a = t.nanoquery.createFetcherStore(s, {
2669
2606
  fetcher: async () => {
2670
- const l = e.getStore().get();
2607
+ const h = e.getStore().get();
2671
2608
  try {
2672
2609
  await o.unary({
2673
2610
  message: {
2674
2611
  case: "heartbeat",
2675
2612
  value: {
2676
2613
  common: {
2677
- ...l,
2678
- kind: x.SESSION_HEARTBEAT
2614
+ ...h,
2615
+ kind: q.SESSION_HEARTBEAT
2679
2616
  }
2680
2617
  }
2681
2618
  }
@@ -2697,8 +2634,8 @@ const rs = ({ transport: t, $commonStore: e }) => {
2697
2634
  return { enable: f, disable: c, mount: u, unmount: () => {
2698
2635
  me.debug("unmounted heartbeat"), a.off(), r?.(), r = void 0, c();
2699
2636
  } };
2700
- }, me = le("analytics");
2701
- class ns {
2637
+ }, me = be("analytics");
2638
+ class is {
2702
2639
  commonStore;
2703
2640
  notifications;
2704
2641
  polls;
@@ -2711,7 +2648,7 @@ class ns {
2711
2648
  listenersCancels;
2712
2649
  connected = !1;
2713
2650
  constructor(e) {
2714
- this.listeners = /* @__PURE__ */ new Set(), this.listenersCancels = /* @__PURE__ */ new Set(), this.commonStore = new Le(te({}), "common-analytics"), this.connectToSDK(e), this.heartbeat = rs({ transport: e.analyticsTransport, $commonStore: this.commonStore }), this.notifications = new es(this), this.polls = new ts(this), this.invitation = new Wo(this), this.interactions = new Yo(this), this.advertisement = new Xo(this);
2651
+ this.listeners = /* @__PURE__ */ new Set(), this.listenersCancels = /* @__PURE__ */ new Set(), this.commonStore = new Ce(te({}), "common-analytics"), this.connectToSDK(e), this.heartbeat = ns({ transport: e.analyticsTransport, $commonStore: this.commonStore }), this.notifications = new ts(this), this.polls = new rs(this), this.invitation = new Yo(this), this.interactions = new Jo(this), this.advertisement = new Zo(this);
2715
2652
  const { client: r } = e.analyticsTransport.createPromiseClient(En, {
2716
2653
  method: "send"
2717
2654
  });
@@ -2741,7 +2678,7 @@ class ns {
2741
2678
  this.onConnect(() => e.stores.slStreamId.getAtomStore().subscribe((r) => {
2742
2679
  this.writeCommon("eventId", r);
2743
2680
  })), this.onConnect(() => e.sdk.getActiveFeature().subscribe((r) => {
2744
- r && this.writeCommon("category", Zo[r]), r !== D.UNSET ? this.writeCommon("overlaySessionId", nr()) : this.writeCommon("overlaySessionId", "");
2681
+ r && this.writeCommon("category", es[r]), r !== D.UNSET ? this.writeCommon("overlaySessionId", nr()) : this.writeCommon("overlaySessionId", "");
2745
2682
  })), this.onConnect(() => {
2746
2683
  const r = window.matchMedia("(orientation: portrait)"), n = (i) => {
2747
2684
  this.writeCommon("screenOrientation", i.matches ? Br.PORTRAIT : Br.LANDSCAPE);
@@ -2754,17 +2691,17 @@ class ns {
2754
2691
  }));
2755
2692
  };
2756
2693
  }
2757
- const is = (t, e, r) => {
2758
- t.analytics = new ns(t), t.sdk.onMount({ name: "analytics" }, () => (t.analytics.connect(), () => {
2694
+ const os = (t, e, r) => {
2695
+ t.analytics = new is(t), t.sdk.onMount({ name: "analytics" }, () => (t.analytics.connect(), () => {
2759
2696
  t.analytics.disconnect();
2760
2697
  })), r();
2761
2698
  };
2762
2699
  var br = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
2763
- function os(t) {
2700
+ function ss(t) {
2764
2701
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
2765
2702
  }
2766
2703
  var Sr = { exports: {} }, wr = { exports: {} };
2767
- function ss(t) {
2704
+ function as(t) {
2768
2705
  var e = new t(), r = e;
2769
2706
  function n() {
2770
2707
  var o = e;
@@ -2778,33 +2715,33 @@ function ss(t) {
2778
2715
  release: i
2779
2716
  };
2780
2717
  }
2781
- var as = ss, us = as;
2782
- function Rn(t, e, r) {
2718
+ var us = as, cs = us;
2719
+ function Vn(t, e, r) {
2783
2720
  if (typeof t == "function" && (r = e, e = t, t = null), !(r >= 1))
2784
2721
  throw new Error("fastqueue concurrency must be equal to or greater than 1");
2785
- var n = us(cs), i = null, o = null, s = 0, a = null, u = {
2786
- push: w,
2787
- drain: W,
2788
- saturated: W,
2722
+ var n = cs(ls), i = null, o = null, s = 0, a = null, u = {
2723
+ push: I,
2724
+ drain: H,
2725
+ saturated: H,
2789
2726
  pause: c,
2790
2727
  paused: !1,
2791
2728
  get concurrency() {
2792
2729
  return r;
2793
2730
  },
2794
- set concurrency(k) {
2795
- if (!(k >= 1))
2731
+ set concurrency(P) {
2732
+ if (!(P >= 1))
2796
2733
  throw new Error("fastqueue concurrency must be equal to or greater than 1");
2797
- if (r = k, !u.paused)
2734
+ if (r = P, !u.paused)
2798
2735
  for (; i && s < r; )
2799
2736
  s++, L();
2800
2737
  },
2801
2738
  running: f,
2802
2739
  resume: g,
2803
2740
  idle: v,
2804
- length: h,
2805
- getQueue: l,
2741
+ length: l,
2742
+ getQueue: h,
2806
2743
  unshift: b,
2807
- empty: W,
2744
+ empty: H,
2808
2745
  kill: R,
2809
2746
  killAndDrain: Q,
2810
2747
  error: X
@@ -2816,14 +2753,14 @@ function Rn(t, e, r) {
2816
2753
  function c() {
2817
2754
  u.paused = !0;
2818
2755
  }
2819
- function h() {
2820
- for (var k = i, V = 0; k; )
2821
- k = k.next, V++;
2756
+ function l() {
2757
+ for (var P = i, V = 0; P; )
2758
+ P = P.next, V++;
2822
2759
  return V;
2823
2760
  }
2824
- function l() {
2825
- for (var k = i, V = []; k; )
2826
- V.push(k.value), k = k.next;
2761
+ function h() {
2762
+ for (var P = i, V = []; P; )
2763
+ V.push(P.value), P = P.next;
2827
2764
  return V;
2828
2765
  }
2829
2766
  function g() {
@@ -2839,141 +2776,141 @@ function Rn(t, e, r) {
2839
2776
  function v() {
2840
2777
  return s === 0 && u.length() === 0;
2841
2778
  }
2842
- function w(k, V) {
2779
+ function I(P, V) {
2843
2780
  var T = n.get();
2844
- T.context = t, T.release = L, T.value = k, T.callback = V || W, T.errorHandler = a, s >= r || u.paused ? o ? (o.next = T, o = T) : (i = T, o = T, u.saturated()) : (s++, e.call(t, T.value, T.worked));
2781
+ T.context = t, T.release = L, T.value = P, T.callback = V || H, T.errorHandler = a, s >= r || u.paused ? o ? (o.next = T, o = T) : (i = T, o = T, u.saturated()) : (s++, e.call(t, T.value, T.worked));
2845
2782
  }
2846
- function b(k, V) {
2783
+ function b(P, V) {
2847
2784
  var T = n.get();
2848
- T.context = t, T.release = L, T.value = k, T.callback = V || W, T.errorHandler = a, s >= r || u.paused ? i ? (T.next = i, i = T) : (i = T, o = T, u.saturated()) : (s++, e.call(t, T.value, T.worked));
2785
+ T.context = t, T.release = L, T.value = P, T.callback = V || H, T.errorHandler = a, s >= r || u.paused ? i ? (T.next = i, i = T) : (i = T, o = T, u.saturated()) : (s++, e.call(t, T.value, T.worked));
2849
2786
  }
2850
- function L(k) {
2851
- k && n.release(k);
2787
+ function L(P) {
2788
+ P && n.release(P);
2852
2789
  var V = i;
2853
2790
  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();
2854
2791
  }
2855
2792
  function R() {
2856
- i = null, o = null, u.drain = W;
2793
+ i = null, o = null, u.drain = H;
2857
2794
  }
2858
2795
  function Q() {
2859
- i = null, o = null, u.drain(), u.drain = W;
2796
+ i = null, o = null, u.drain(), u.drain = H;
2860
2797
  }
2861
- function X(k) {
2862
- a = k;
2798
+ function X(P) {
2799
+ a = P;
2863
2800
  }
2864
2801
  }
2865
- function W() {
2802
+ function H() {
2866
2803
  }
2867
- function cs() {
2868
- this.value = null, this.callback = W, this.next = null, this.release = W, this.context = null, this.errorHandler = null;
2804
+ function ls() {
2805
+ this.value = null, this.callback = H, this.next = null, this.release = H, this.context = null, this.errorHandler = null;
2869
2806
  var t = this;
2870
2807
  this.worked = function(r, n) {
2871
2808
  var i = t.callback, o = t.errorHandler, s = t.value;
2872
- t.value = null, t.callback = W, t.errorHandler && o(r, s), i.call(t.context, r, n), t.release(t);
2809
+ t.value = null, t.callback = H, t.errorHandler && o(r, s), i.call(t.context, r, n), t.release(t);
2873
2810
  };
2874
2811
  }
2875
- function ls(t, e, r) {
2812
+ function ds(t, e, r) {
2876
2813
  typeof t == "function" && (r = e, e = t, t = null);
2877
- function n(c, h) {
2878
- e.call(this, c).then(function(l) {
2879
- h(null, l);
2880
- }, h);
2814
+ function n(c, l) {
2815
+ e.call(this, c).then(function(h) {
2816
+ l(null, h);
2817
+ }, l);
2881
2818
  }
2882
- var i = Rn(t, n, r), o = i.push, s = i.unshift;
2819
+ var i = Vn(t, n, r), o = i.push, s = i.unshift;
2883
2820
  return i.push = a, i.unshift = u, i.drained = f, i;
2884
2821
  function a(c) {
2885
- var h = new Promise(function(l, g) {
2886
- o(c, function(v, w) {
2822
+ var l = new Promise(function(h, g) {
2823
+ o(c, function(v, I) {
2887
2824
  if (v) {
2888
2825
  g(v);
2889
2826
  return;
2890
2827
  }
2891
- l(w);
2828
+ h(I);
2892
2829
  });
2893
2830
  });
2894
- return h.catch(W), h;
2831
+ return l.catch(H), l;
2895
2832
  }
2896
2833
  function u(c) {
2897
- var h = new Promise(function(l, g) {
2898
- s(c, function(v, w) {
2834
+ var l = new Promise(function(h, g) {
2835
+ s(c, function(v, I) {
2899
2836
  if (v) {
2900
2837
  g(v);
2901
2838
  return;
2902
2839
  }
2903
- l(w);
2840
+ h(I);
2904
2841
  });
2905
2842
  });
2906
- return h.catch(W), h;
2843
+ return l.catch(H), l;
2907
2844
  }
2908
2845
  function f() {
2909
2846
  if (i.idle())
2910
- return new Promise(function(l) {
2911
- l();
2847
+ return new Promise(function(h) {
2848
+ h();
2912
2849
  });
2913
- var c = i.drain, h = new Promise(function(l) {
2850
+ var c = i.drain, l = new Promise(function(h) {
2914
2851
  i.drain = function() {
2915
- c(), l();
2852
+ c(), h();
2916
2853
  };
2917
2854
  });
2918
- return h;
2855
+ return l;
2919
2856
  }
2920
2857
  }
2921
- wr.exports = Rn;
2922
- wr.exports.promise = ls;
2923
- var Vn = wr.exports, Ar = { exports: {} }, Qe = typeof Reflect == "object" ? Reflect : null, Jr = Qe && typeof Qe.apply == "function" ? Qe.apply : function(e, r, n) {
2858
+ wr.exports = Vn;
2859
+ wr.exports.promise = ds;
2860
+ var $n = wr.exports, Ar = { exports: {} }, Qe = typeof Reflect == "object" ? Reflect : null, Jr = Qe && typeof Qe.apply == "function" ? Qe.apply : function(e, r, n) {
2924
2861
  return Function.prototype.apply.call(e, r, n);
2925
- }, pt;
2926
- Qe && typeof Qe.ownKeys == "function" ? pt = Qe.ownKeys : Object.getOwnPropertySymbols ? pt = function(e) {
2862
+ }, ht;
2863
+ Qe && typeof Qe.ownKeys == "function" ? ht = Qe.ownKeys : Object.getOwnPropertySymbols ? ht = function(e) {
2927
2864
  return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e));
2928
- } : pt = function(e) {
2865
+ } : ht = function(e) {
2929
2866
  return Object.getOwnPropertyNames(e);
2930
2867
  };
2931
- function ds(t) {
2868
+ function fs(t) {
2932
2869
  console && console.warn && console.warn(t);
2933
2870
  }
2934
- var $n = Number.isNaN || function(e) {
2871
+ var Mn = Number.isNaN || function(e) {
2935
2872
  return e !== e;
2936
2873
  };
2937
- function P() {
2938
- P.init.call(this);
2874
+ function N() {
2875
+ N.init.call(this);
2939
2876
  }
2940
- Ar.exports = P;
2941
- Ar.exports.once = ys;
2942
- P.EventEmitter = P;
2943
- P.prototype._events = void 0;
2944
- P.prototype._eventsCount = 0;
2945
- P.prototype._maxListeners = void 0;
2877
+ Ar.exports = N;
2878
+ Ar.exports.once = ms;
2879
+ N.EventEmitter = N;
2880
+ N.prototype._events = void 0;
2881
+ N.prototype._eventsCount = 0;
2882
+ N.prototype._maxListeners = void 0;
2946
2883
  var Xr = 10;
2947
2884
  function Nt(t) {
2948
2885
  if (typeof t != "function")
2949
2886
  throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof t);
2950
2887
  }
2951
- Object.defineProperty(P, "defaultMaxListeners", {
2888
+ Object.defineProperty(N, "defaultMaxListeners", {
2952
2889
  enumerable: !0,
2953
2890
  get: function() {
2954
2891
  return Xr;
2955
2892
  },
2956
2893
  set: function(t) {
2957
- if (typeof t != "number" || t < 0 || $n(t))
2894
+ if (typeof t != "number" || t < 0 || Mn(t))
2958
2895
  throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + t + ".");
2959
2896
  Xr = t;
2960
2897
  }
2961
2898
  });
2962
- P.init = function() {
2899
+ N.init = function() {
2963
2900
  (this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) && (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0;
2964
2901
  };
2965
- P.prototype.setMaxListeners = function(e) {
2966
- if (typeof e != "number" || e < 0 || $n(e))
2902
+ N.prototype.setMaxListeners = function(e) {
2903
+ if (typeof e != "number" || e < 0 || Mn(e))
2967
2904
  throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + e + ".");
2968
2905
  return this._maxListeners = e, this;
2969
2906
  };
2970
- function Mn(t) {
2971
- return t._maxListeners === void 0 ? P.defaultMaxListeners : t._maxListeners;
2907
+ function jn(t) {
2908
+ return t._maxListeners === void 0 ? N.defaultMaxListeners : t._maxListeners;
2972
2909
  }
2973
- P.prototype.getMaxListeners = function() {
2974
- return Mn(this);
2910
+ N.prototype.getMaxListeners = function() {
2911
+ return jn(this);
2975
2912
  };
2976
- P.prototype.emit = function(e) {
2913
+ N.prototype.emit = function(e) {
2977
2914
  for (var r = [], n = 1; n < arguments.length; n++) r.push(arguments[n]);
2978
2915
  var i = e === "error", o = this._events;
2979
2916
  if (o !== void 0)
@@ -2993,11 +2930,11 @@ P.prototype.emit = function(e) {
2993
2930
  if (typeof u == "function")
2994
2931
  Jr(u, this, r);
2995
2932
  else
2996
- for (var f = u.length, c = xn(u, f), n = 0; n < f; ++n)
2933
+ for (var f = u.length, c = Qn(u, f), n = 0; n < f; ++n)
2997
2934
  Jr(c[n], this, r);
2998
2935
  return !0;
2999
2936
  };
3000
- function jn(t, e, r, n) {
2937
+ function Un(t, e, r, n) {
3001
2938
  var i, o, s;
3002
2939
  if (Nt(r), o = t._events, o === void 0 ? (o = t._events = /* @__PURE__ */ Object.create(null), t._eventsCount = 0) : (o.newListener !== void 0 && (t.emit(
3003
2940
  "newListener",
@@ -3005,35 +2942,35 @@ function jn(t, e, r, n) {
3005
2942
  r.listener ? r.listener : r
3006
2943
  ), o = t._events), s = o[e]), s === void 0)
3007
2944
  s = o[e] = r, ++t._eventsCount;
3008
- else if (typeof s == "function" ? s = o[e] = n ? [r, s] : [s, r] : n ? s.unshift(r) : s.push(r), i = Mn(t), i > 0 && s.length > i && !s.warned) {
2945
+ else if (typeof s == "function" ? s = o[e] = n ? [r, s] : [s, r] : n ? s.unshift(r) : s.push(r), i = jn(t), i > 0 && s.length > i && !s.warned) {
3009
2946
  s.warned = !0;
3010
2947
  var a = new Error("Possible EventEmitter memory leak detected. " + s.length + " " + String(e) + " listeners added. Use emitter.setMaxListeners() to increase limit");
3011
- a.name = "MaxListenersExceededWarning", a.emitter = t, a.type = e, a.count = s.length, ds(a);
2948
+ a.name = "MaxListenersExceededWarning", a.emitter = t, a.type = e, a.count = s.length, fs(a);
3012
2949
  }
3013
2950
  return t;
3014
2951
  }
3015
- P.prototype.addListener = function(e, r) {
3016
- return jn(this, e, r, !1);
2952
+ N.prototype.addListener = function(e, r) {
2953
+ return Un(this, e, r, !1);
3017
2954
  };
3018
- P.prototype.on = P.prototype.addListener;
3019
- P.prototype.prependListener = function(e, r) {
3020
- return jn(this, e, r, !0);
2955
+ N.prototype.on = N.prototype.addListener;
2956
+ N.prototype.prependListener = function(e, r) {
2957
+ return Un(this, e, r, !0);
3021
2958
  };
3022
- function fs() {
2959
+ function hs() {
3023
2960
  if (!this.fired)
3024
2961
  return this.target.removeListener(this.type, this.wrapFn), this.fired = !0, arguments.length === 0 ? this.listener.call(this.target) : this.listener.apply(this.target, arguments);
3025
2962
  }
3026
- function Un(t, e, r) {
3027
- var n = { fired: !1, wrapFn: void 0, target: t, type: e, listener: r }, i = fs.bind(n);
2963
+ function Bn(t, e, r) {
2964
+ var n = { fired: !1, wrapFn: void 0, target: t, type: e, listener: r }, i = hs.bind(n);
3028
2965
  return i.listener = r, n.wrapFn = i, i;
3029
2966
  }
3030
- P.prototype.once = function(e, r) {
3031
- return Nt(r), this.on(e, Un(this, e, r)), this;
2967
+ N.prototype.once = function(e, r) {
2968
+ return Nt(r), this.on(e, Bn(this, e, r)), this;
3032
2969
  };
3033
- P.prototype.prependOnceListener = function(e, r) {
3034
- return Nt(r), this.prependListener(e, Un(this, e, r)), this;
2970
+ N.prototype.prependOnceListener = function(e, r) {
2971
+ return Nt(r), this.prependListener(e, Bn(this, e, r)), this;
3035
2972
  };
3036
- P.prototype.removeListener = function(e, r) {
2973
+ N.prototype.removeListener = function(e, r) {
3037
2974
  var n, i, o, s, a;
3038
2975
  if (Nt(r), i = this._events, i === void 0)
3039
2976
  return this;
@@ -3049,12 +2986,12 @@ P.prototype.removeListener = function(e, r) {
3049
2986
  }
3050
2987
  if (o < 0)
3051
2988
  return this;
3052
- o === 0 ? n.shift() : hs(n, o), n.length === 1 && (i[e] = n[0]), i.removeListener !== void 0 && this.emit("removeListener", e, a || r);
2989
+ o === 0 ? n.shift() : ps(n, o), n.length === 1 && (i[e] = n[0]), i.removeListener !== void 0 && this.emit("removeListener", e, a || r);
3053
2990
  }
3054
2991
  return this;
3055
2992
  };
3056
- P.prototype.off = P.prototype.removeListener;
3057
- P.prototype.removeAllListeners = function(e) {
2993
+ N.prototype.off = N.prototype.removeListener;
2994
+ N.prototype.removeAllListeners = function(e) {
3058
2995
  var r, n, i;
3059
2996
  if (n = this._events, n === void 0)
3060
2997
  return this;
@@ -3073,24 +3010,24 @@ P.prototype.removeAllListeners = function(e) {
3073
3010
  this.removeListener(e, r[i]);
3074
3011
  return this;
3075
3012
  };
3076
- function Bn(t, e, r) {
3013
+ function qn(t, e, r) {
3077
3014
  var n = t._events;
3078
3015
  if (n === void 0)
3079
3016
  return [];
3080
3017
  var i = n[e];
3081
- return i === void 0 ? [] : typeof i == "function" ? r ? [i.listener || i] : [i] : r ? ps(i) : xn(i, i.length);
3018
+ return i === void 0 ? [] : typeof i == "function" ? r ? [i.listener || i] : [i] : r ? ys(i) : Qn(i, i.length);
3082
3019
  }
3083
- P.prototype.listeners = function(e) {
3084
- return Bn(this, e, !0);
3020
+ N.prototype.listeners = function(e) {
3021
+ return qn(this, e, !0);
3085
3022
  };
3086
- P.prototype.rawListeners = function(e) {
3087
- return Bn(this, e, !1);
3023
+ N.prototype.rawListeners = function(e) {
3024
+ return qn(this, e, !1);
3088
3025
  };
3089
- P.listenerCount = function(t, e) {
3090
- return typeof t.listenerCount == "function" ? t.listenerCount(e) : qn.call(t, e);
3026
+ N.listenerCount = function(t, e) {
3027
+ return typeof t.listenerCount == "function" ? t.listenerCount(e) : xn.call(t, e);
3091
3028
  };
3092
- P.prototype.listenerCount = qn;
3093
- function qn(t) {
3029
+ N.prototype.listenerCount = xn;
3030
+ function xn(t) {
3094
3031
  var e = this._events;
3095
3032
  if (e !== void 0) {
3096
3033
  var r = e[t];
@@ -3101,25 +3038,25 @@ function qn(t) {
3101
3038
  }
3102
3039
  return 0;
3103
3040
  }
3104
- P.prototype.eventNames = function() {
3105
- return this._eventsCount > 0 ? pt(this._events) : [];
3041
+ N.prototype.eventNames = function() {
3042
+ return this._eventsCount > 0 ? ht(this._events) : [];
3106
3043
  };
3107
- function xn(t, e) {
3044
+ function Qn(t, e) {
3108
3045
  for (var r = new Array(e), n = 0; n < e; ++n)
3109
3046
  r[n] = t[n];
3110
3047
  return r;
3111
3048
  }
3112
- function hs(t, e) {
3049
+ function ps(t, e) {
3113
3050
  for (; e + 1 < t.length; e++)
3114
3051
  t[e] = t[e + 1];
3115
3052
  t.pop();
3116
3053
  }
3117
- function ps(t) {
3054
+ function ys(t) {
3118
3055
  for (var e = new Array(t.length), r = 0; r < e.length; ++r)
3119
3056
  e[r] = t[r].listener || t[r];
3120
3057
  return e;
3121
3058
  }
3122
- function ys(t, e) {
3059
+ function ms(t, e) {
3123
3060
  return new Promise(function(r, n) {
3124
3061
  function i(s) {
3125
3062
  t.removeListener(e, o), n(s);
@@ -3127,13 +3064,13 @@ function ys(t, e) {
3127
3064
  function o() {
3128
3065
  typeof t.removeListener == "function" && t.removeListener("error", i), r([].slice.call(arguments));
3129
3066
  }
3130
- Qn(t, e, o, { once: !0 }), e !== "error" && gs(t, i, { once: !0 });
3067
+ Gn(t, e, o, { once: !0 }), e !== "error" && gs(t, i, { once: !0 });
3131
3068
  });
3132
3069
  }
3133
3070
  function gs(t, e, r) {
3134
- typeof t.on == "function" && Qn(t, "error", e, r);
3071
+ typeof t.on == "function" && Gn(t, "error", e, r);
3135
3072
  }
3136
- function Qn(t, e, r, n) {
3073
+ function Gn(t, e, r, n) {
3137
3074
  if (typeof t.on == "function")
3138
3075
  n.once ? t.once(e, r) : t.on(e, r);
3139
3076
  else if (typeof t.addEventListener == "function")
@@ -3143,7 +3080,7 @@ function Qn(t, e, r, n) {
3143
3080
  else
3144
3081
  throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof t);
3145
3082
  }
3146
- var Gn = Ar.exports, Ft = {}, Kn = {}, zn = function() {
3083
+ var Kn = Ar.exports, Ft = {}, zn = {}, Hn = function() {
3147
3084
  if (typeof Symbol != "function" || typeof Object.getOwnPropertySymbols != "function")
3148
3085
  return !1;
3149
3086
  if (typeof Symbol.iterator == "symbol")
@@ -3166,34 +3103,34 @@ var Gn = Ar.exports, Ft = {}, Kn = {}, zn = function() {
3166
3103
  return !1;
3167
3104
  }
3168
3105
  return !0;
3169
- }, ms = zn, Dt = function() {
3170
- return ms() && !!Symbol.toStringTag;
3171
- }, vs = Error, bs = EvalError, Ss = RangeError, ws = ReferenceError, Hn = SyntaxError, Rt = TypeError, As = URIError, Zr = typeof Symbol < "u" && Symbol, Es = zn, Is = function() {
3172
- return typeof Zr != "function" || typeof Symbol != "function" || typeof Zr("foo") != "symbol" || typeof Symbol("bar") != "symbol" ? !1 : Es();
3106
+ }, vs = Hn, Dt = function() {
3107
+ return vs() && !!Symbol.toStringTag;
3108
+ }, bs = Error, Ss = EvalError, ws = RangeError, As = ReferenceError, Wn = SyntaxError, Rt = TypeError, Es = URIError, Zr = typeof Symbol < "u" && Symbol, Is = Hn, Ts = function() {
3109
+ return typeof Zr != "function" || typeof Symbol != "function" || typeof Zr("foo") != "symbol" || typeof Symbol("bar") != "symbol" ? !1 : Is();
3173
3110
  }, Ut = {
3174
3111
  __proto__: null,
3175
3112
  foo: {}
3176
- }, Ts = Object, Os = function() {
3177
- return { __proto__: Ut }.foo === Ut.foo && !(Ut instanceof Ts);
3178
- }, _s = "Function.prototype.bind called on incompatible ", Ls = Object.prototype.toString, Cs = Math.max, ks = "[object Function]", en = function(e, r) {
3113
+ }, Os = Object, _s = function() {
3114
+ return { __proto__: Ut }.foo === Ut.foo && !(Ut instanceof Os);
3115
+ }, Cs = "Function.prototype.bind called on incompatible ", Ls = Object.prototype.toString, ks = Math.max, Ps = "[object Function]", en = function(e, r) {
3179
3116
  for (var n = [], i = 0; i < e.length; i += 1)
3180
3117
  n[i] = e[i];
3181
3118
  for (var o = 0; o < r.length; o += 1)
3182
3119
  n[o + e.length] = r[o];
3183
3120
  return n;
3184
- }, Ps = function(e, r) {
3121
+ }, Ns = function(e, r) {
3185
3122
  for (var n = [], i = r, o = 0; i < e.length; i += 1, o += 1)
3186
3123
  n[o] = e[i];
3187
3124
  return n;
3188
- }, Ns = function(t, e) {
3125
+ }, Fs = function(t, e) {
3189
3126
  for (var r = "", n = 0; n < t.length; n += 1)
3190
3127
  r += t[n], n + 1 < t.length && (r += e);
3191
3128
  return r;
3192
- }, Fs = function(e) {
3129
+ }, Ds = function(e) {
3193
3130
  var r = this;
3194
- if (typeof r != "function" || Ls.apply(r) !== ks)
3195
- throw new TypeError(_s + r);
3196
- for (var n = Ps(arguments, 1), i, o = function() {
3131
+ if (typeof r != "function" || Ls.apply(r) !== Ps)
3132
+ throw new TypeError(Cs + r);
3133
+ for (var n = Ns(arguments, 1), i, o = function() {
3197
3134
  if (this instanceof i) {
3198
3135
  var c = r.apply(
3199
3136
  this,
@@ -3205,17 +3142,17 @@ var Gn = Ar.exports, Ft = {}, Kn = {}, zn = function() {
3205
3142
  e,
3206
3143
  en(n, arguments)
3207
3144
  );
3208
- }, s = Cs(0, r.length - n.length), a = [], u = 0; u < s; u++)
3145
+ }, s = ks(0, r.length - n.length), a = [], u = 0; u < s; u++)
3209
3146
  a[u] = "$" + u;
3210
- if (i = Function("binder", "return function (" + Ns(a, ",") + "){ return binder.apply(this,arguments); }")(o), r.prototype) {
3147
+ if (i = Function("binder", "return function (" + Fs(a, ",") + "){ return binder.apply(this,arguments); }")(o), r.prototype) {
3211
3148
  var f = function() {
3212
3149
  };
3213
3150
  f.prototype = r.prototype, i.prototype = new f(), f.prototype = null;
3214
3151
  }
3215
3152
  return i;
3216
- }, Ds = Fs, Er = Function.prototype.bind || Ds, Rs = Function.prototype.call, Vs = Object.prototype.hasOwnProperty, $s = Er, Ms = $s.call(Rs, Vs), I, js = vs, Us = bs, Bs = Ss, qs = ws, Ke = Hn, Ge = Rt, xs = As, Wn = Function, Bt = function(t) {
3153
+ }, Rs = Ds, Er = Function.prototype.bind || Rs, Vs = Function.prototype.call, $s = Object.prototype.hasOwnProperty, Ms = Er, js = Ms.call(Vs, $s), E, Us = bs, Bs = Ss, qs = ws, xs = As, Ke = Wn, Ge = Rt, Qs = Es, Yn = Function, Bt = function(t) {
3217
3154
  try {
3218
- return Wn('"use strict"; return (' + t + ").constructor;")();
3155
+ return Yn('"use strict"; return (' + t + ").constructor;")();
3219
3156
  } catch {
3220
3157
  }
3221
3158
  }, ke = Object.getOwnPropertyDescriptor;
@@ -3227,7 +3164,7 @@ if (ke)
3227
3164
  }
3228
3165
  var qt = function() {
3229
3166
  throw new Ge();
3230
- }, Qs = ke ? function() {
3167
+ }, Gs = ke ? function() {
3231
3168
  try {
3232
3169
  return arguments.callee, qt;
3233
3170
  } catch {
@@ -3237,86 +3174,86 @@ var qt = function() {
3237
3174
  return qt;
3238
3175
  }
3239
3176
  }
3240
- }() : qt, $e = Is(), Gs = Os(), M = Object.getPrototypeOf || (Gs ? function(t) {
3177
+ }() : qt, $e = Ts(), Ks = _s(), M = Object.getPrototypeOf || (Ks ? function(t) {
3241
3178
  return t.__proto__;
3242
- } : null), je = {}, Ks = typeof Uint8Array > "u" || !M ? I : M(Uint8Array), Pe = {
3179
+ } : null), je = {}, zs = typeof Uint8Array > "u" || !M ? E : M(Uint8Array), Pe = {
3243
3180
  __proto__: null,
3244
- "%AggregateError%": typeof AggregateError > "u" ? I : AggregateError,
3181
+ "%AggregateError%": typeof AggregateError > "u" ? E : AggregateError,
3245
3182
  "%Array%": Array,
3246
- "%ArrayBuffer%": typeof ArrayBuffer > "u" ? I : ArrayBuffer,
3247
- "%ArrayIteratorPrototype%": $e && M ? M([][Symbol.iterator]()) : I,
3248
- "%AsyncFromSyncIteratorPrototype%": I,
3183
+ "%ArrayBuffer%": typeof ArrayBuffer > "u" ? E : ArrayBuffer,
3184
+ "%ArrayIteratorPrototype%": $e && M ? M([][Symbol.iterator]()) : E,
3185
+ "%AsyncFromSyncIteratorPrototype%": E,
3249
3186
  "%AsyncFunction%": je,
3250
3187
  "%AsyncGenerator%": je,
3251
3188
  "%AsyncGeneratorFunction%": je,
3252
3189
  "%AsyncIteratorPrototype%": je,
3253
- "%Atomics%": typeof Atomics > "u" ? I : Atomics,
3254
- "%BigInt%": typeof BigInt > "u" ? I : BigInt,
3255
- "%BigInt64Array%": typeof BigInt64Array > "u" ? I : BigInt64Array,
3256
- "%BigUint64Array%": typeof BigUint64Array > "u" ? I : BigUint64Array,
3190
+ "%Atomics%": typeof Atomics > "u" ? E : Atomics,
3191
+ "%BigInt%": typeof BigInt > "u" ? E : BigInt,
3192
+ "%BigInt64Array%": typeof BigInt64Array > "u" ? E : BigInt64Array,
3193
+ "%BigUint64Array%": typeof BigUint64Array > "u" ? E : BigUint64Array,
3257
3194
  "%Boolean%": Boolean,
3258
- "%DataView%": typeof DataView > "u" ? I : DataView,
3195
+ "%DataView%": typeof DataView > "u" ? E : DataView,
3259
3196
  "%Date%": Date,
3260
3197
  "%decodeURI%": decodeURI,
3261
3198
  "%decodeURIComponent%": decodeURIComponent,
3262
3199
  "%encodeURI%": encodeURI,
3263
3200
  "%encodeURIComponent%": encodeURIComponent,
3264
- "%Error%": js,
3201
+ "%Error%": Us,
3265
3202
  "%eval%": eval,
3266
3203
  // eslint-disable-line no-eval
3267
- "%EvalError%": Us,
3268
- "%Float32Array%": typeof Float32Array > "u" ? I : Float32Array,
3269
- "%Float64Array%": typeof Float64Array > "u" ? I : Float64Array,
3270
- "%FinalizationRegistry%": typeof FinalizationRegistry > "u" ? I : FinalizationRegistry,
3271
- "%Function%": Wn,
3204
+ "%EvalError%": Bs,
3205
+ "%Float32Array%": typeof Float32Array > "u" ? E : Float32Array,
3206
+ "%Float64Array%": typeof Float64Array > "u" ? E : Float64Array,
3207
+ "%FinalizationRegistry%": typeof FinalizationRegistry > "u" ? E : FinalizationRegistry,
3208
+ "%Function%": Yn,
3272
3209
  "%GeneratorFunction%": je,
3273
- "%Int8Array%": typeof Int8Array > "u" ? I : Int8Array,
3274
- "%Int16Array%": typeof Int16Array > "u" ? I : Int16Array,
3275
- "%Int32Array%": typeof Int32Array > "u" ? I : Int32Array,
3210
+ "%Int8Array%": typeof Int8Array > "u" ? E : Int8Array,
3211
+ "%Int16Array%": typeof Int16Array > "u" ? E : Int16Array,
3212
+ "%Int32Array%": typeof Int32Array > "u" ? E : Int32Array,
3276
3213
  "%isFinite%": isFinite,
3277
3214
  "%isNaN%": isNaN,
3278
- "%IteratorPrototype%": $e && M ? M(M([][Symbol.iterator]())) : I,
3279
- "%JSON%": typeof JSON == "object" ? JSON : I,
3280
- "%Map%": typeof Map > "u" ? I : Map,
3281
- "%MapIteratorPrototype%": typeof Map > "u" || !$e || !M ? I : M((/* @__PURE__ */ new Map())[Symbol.iterator]()),
3215
+ "%IteratorPrototype%": $e && M ? M(M([][Symbol.iterator]())) : E,
3216
+ "%JSON%": typeof JSON == "object" ? JSON : E,
3217
+ "%Map%": typeof Map > "u" ? E : Map,
3218
+ "%MapIteratorPrototype%": typeof Map > "u" || !$e || !M ? E : M((/* @__PURE__ */ new Map())[Symbol.iterator]()),
3282
3219
  "%Math%": Math,
3283
3220
  "%Number%": Number,
3284
3221
  "%Object%": Object,
3285
3222
  "%parseFloat%": parseFloat,
3286
3223
  "%parseInt%": parseInt,
3287
- "%Promise%": typeof Promise > "u" ? I : Promise,
3288
- "%Proxy%": typeof Proxy > "u" ? I : Proxy,
3289
- "%RangeError%": Bs,
3290
- "%ReferenceError%": qs,
3291
- "%Reflect%": typeof Reflect > "u" ? I : Reflect,
3224
+ "%Promise%": typeof Promise > "u" ? E : Promise,
3225
+ "%Proxy%": typeof Proxy > "u" ? E : Proxy,
3226
+ "%RangeError%": qs,
3227
+ "%ReferenceError%": xs,
3228
+ "%Reflect%": typeof Reflect > "u" ? E : Reflect,
3292
3229
  "%RegExp%": RegExp,
3293
- "%Set%": typeof Set > "u" ? I : Set,
3294
- "%SetIteratorPrototype%": typeof Set > "u" || !$e || !M ? I : M((/* @__PURE__ */ new Set())[Symbol.iterator]()),
3295
- "%SharedArrayBuffer%": typeof SharedArrayBuffer > "u" ? I : SharedArrayBuffer,
3230
+ "%Set%": typeof Set > "u" ? E : Set,
3231
+ "%SetIteratorPrototype%": typeof Set > "u" || !$e || !M ? E : M((/* @__PURE__ */ new Set())[Symbol.iterator]()),
3232
+ "%SharedArrayBuffer%": typeof SharedArrayBuffer > "u" ? E : SharedArrayBuffer,
3296
3233
  "%String%": String,
3297
- "%StringIteratorPrototype%": $e && M ? M(""[Symbol.iterator]()) : I,
3298
- "%Symbol%": $e ? Symbol : I,
3234
+ "%StringIteratorPrototype%": $e && M ? M(""[Symbol.iterator]()) : E,
3235
+ "%Symbol%": $e ? Symbol : E,
3299
3236
  "%SyntaxError%": Ke,
3300
- "%ThrowTypeError%": Qs,
3301
- "%TypedArray%": Ks,
3237
+ "%ThrowTypeError%": Gs,
3238
+ "%TypedArray%": zs,
3302
3239
  "%TypeError%": Ge,
3303
- "%Uint8Array%": typeof Uint8Array > "u" ? I : Uint8Array,
3304
- "%Uint8ClampedArray%": typeof Uint8ClampedArray > "u" ? I : Uint8ClampedArray,
3305
- "%Uint16Array%": typeof Uint16Array > "u" ? I : Uint16Array,
3306
- "%Uint32Array%": typeof Uint32Array > "u" ? I : Uint32Array,
3307
- "%URIError%": xs,
3308
- "%WeakMap%": typeof WeakMap > "u" ? I : WeakMap,
3309
- "%WeakRef%": typeof WeakRef > "u" ? I : WeakRef,
3310
- "%WeakSet%": typeof WeakSet > "u" ? I : WeakSet
3240
+ "%Uint8Array%": typeof Uint8Array > "u" ? E : Uint8Array,
3241
+ "%Uint8ClampedArray%": typeof Uint8ClampedArray > "u" ? E : Uint8ClampedArray,
3242
+ "%Uint16Array%": typeof Uint16Array > "u" ? E : Uint16Array,
3243
+ "%Uint32Array%": typeof Uint32Array > "u" ? E : Uint32Array,
3244
+ "%URIError%": Qs,
3245
+ "%WeakMap%": typeof WeakMap > "u" ? E : WeakMap,
3246
+ "%WeakRef%": typeof WeakRef > "u" ? E : WeakRef,
3247
+ "%WeakSet%": typeof WeakSet > "u" ? E : WeakSet
3311
3248
  };
3312
3249
  if (M)
3313
3250
  try {
3314
3251
  null.error;
3315
3252
  } catch (t) {
3316
- var zs = M(M(t));
3317
- Pe["%Error.prototype%"] = zs;
3253
+ var Hs = M(M(t));
3254
+ Pe["%Error.prototype%"] = Hs;
3318
3255
  }
3319
- var Hs = function t(e) {
3256
+ var Ws = function t(e) {
3320
3257
  var r;
3321
3258
  if (e === "%AsyncFunction%")
3322
3259
  r = Bt("async function () {}");
@@ -3385,21 +3322,21 @@ var Hs = function t(e) {
3385
3322
  "%URIErrorPrototype%": ["URIError", "prototype"],
3386
3323
  "%WeakMapPrototype%": ["WeakMap", "prototype"],
3387
3324
  "%WeakSetPrototype%": ["WeakSet", "prototype"]
3388
- }, ot = Er, At = Ms, Ws = ot.call(Function.call, Array.prototype.concat), Ys = ot.call(Function.apply, Array.prototype.splice), rn = ot.call(Function.call, String.prototype.replace), Et = ot.call(Function.call, String.prototype.slice), Js = ot.call(Function.call, RegExp.prototype.exec), Xs = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, Zs = /\\(\\)?/g, ea = function(e) {
3389
- var r = Et(e, 0, 1), n = Et(e, -1);
3325
+ }, it = Er, wt = js, Ys = it.call(Function.call, Array.prototype.concat), Js = it.call(Function.apply, Array.prototype.splice), rn = it.call(Function.call, String.prototype.replace), At = it.call(Function.call, String.prototype.slice), Xs = it.call(Function.call, RegExp.prototype.exec), Zs = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, ea = /\\(\\)?/g, ta = function(e) {
3326
+ var r = At(e, 0, 1), n = At(e, -1);
3390
3327
  if (r === "%" && n !== "%")
3391
3328
  throw new Ke("invalid intrinsic syntax, expected closing `%`");
3392
3329
  if (n === "%" && r !== "%")
3393
3330
  throw new Ke("invalid intrinsic syntax, expected opening `%`");
3394
3331
  var i = [];
3395
- return rn(e, Xs, function(o, s, a, u) {
3396
- i[i.length] = a ? rn(u, Zs, "$1") : s || o;
3332
+ return rn(e, Zs, function(o, s, a, u) {
3333
+ i[i.length] = a ? rn(u, ea, "$1") : s || o;
3397
3334
  }), i;
3398
- }, ta = function(e, r) {
3335
+ }, ra = function(e, r) {
3399
3336
  var n = e, i;
3400
- if (At(tn, n) && (i = tn[n], n = "%" + i[0] + "%"), At(Pe, n)) {
3337
+ if (wt(tn, n) && (i = tn[n], n = "%" + i[0] + "%"), wt(Pe, n)) {
3401
3338
  var o = Pe[n];
3402
- if (o === je && (o = Hs(n)), typeof o > "u" && !r)
3339
+ if (o === je && (o = Ws(n)), typeof o > "u" && !r)
3403
3340
  throw new Ge("intrinsic " + e + " exists, but is not available. Please file an issue!");
3404
3341
  return {
3405
3342
  alias: i,
@@ -3408,41 +3345,41 @@ var Hs = function t(e) {
3408
3345
  };
3409
3346
  }
3410
3347
  throw new Ke("intrinsic " + e + " does not exist!");
3411
- }, st = function(e, r) {
3348
+ }, ot = function(e, r) {
3412
3349
  if (typeof e != "string" || e.length === 0)
3413
3350
  throw new Ge("intrinsic name must be a non-empty string");
3414
3351
  if (arguments.length > 1 && typeof r != "boolean")
3415
3352
  throw new Ge('"allowMissing" argument must be a boolean');
3416
- if (Js(/^%?[^%]*%?$/, e) === null)
3353
+ if (Xs(/^%?[^%]*%?$/, e) === null)
3417
3354
  throw new Ke("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
3418
- var n = ea(e), i = n.length > 0 ? n[0] : "", o = ta("%" + i + "%", r), s = o.name, a = o.value, u = !1, f = o.alias;
3419
- f && (i = f[0], Ys(n, Ws([0, 1], f)));
3420
- for (var c = 1, h = !0; c < n.length; c += 1) {
3421
- var l = n[c], g = Et(l, 0, 1), v = Et(l, -1);
3355
+ var n = ta(e), i = n.length > 0 ? n[0] : "", o = ra("%" + i + "%", r), s = o.name, a = o.value, u = !1, f = o.alias;
3356
+ f && (i = f[0], Js(n, Ys([0, 1], f)));
3357
+ for (var c = 1, l = !0; c < n.length; c += 1) {
3358
+ var h = n[c], g = At(h, 0, 1), v = At(h, -1);
3422
3359
  if ((g === '"' || g === "'" || g === "`" || v === '"' || v === "'" || v === "`") && g !== v)
3423
3360
  throw new Ke("property names with quotes must have matching quotes");
3424
- if ((l === "constructor" || !h) && (u = !0), i += "." + l, s = "%" + i + "%", At(Pe, s))
3361
+ if ((h === "constructor" || !l) && (u = !0), i += "." + h, s = "%" + i + "%", wt(Pe, s))
3425
3362
  a = Pe[s];
3426
3363
  else if (a != null) {
3427
- if (!(l in a)) {
3364
+ if (!(h in a)) {
3428
3365
  if (!r)
3429
3366
  throw new Ge("base intrinsic for " + e + " exists, but the property is not available.");
3430
3367
  return;
3431
3368
  }
3432
3369
  if (ke && c + 1 >= n.length) {
3433
- var w = ke(a, l);
3434
- h = !!w, h && "get" in w && !("originalValue" in w.get) ? a = w.get : a = a[l];
3370
+ var I = ke(a, h);
3371
+ l = !!I, l && "get" in I && !("originalValue" in I.get) ? a = I.get : a = a[h];
3435
3372
  } else
3436
- h = At(a, l), a = a[l];
3437
- h && !u && (Pe[s] = a);
3373
+ l = wt(a, h), a = a[h];
3374
+ l && !u && (Pe[s] = a);
3438
3375
  }
3439
3376
  }
3440
3377
  return a;
3441
- }, Yn = { exports: {} }, xt, nn;
3378
+ }, Jn = { exports: {} }, xt, nn;
3442
3379
  function Ir() {
3443
3380
  if (nn) return xt;
3444
3381
  nn = 1;
3445
- var t = st, e = t("%Object.defineProperty%", !0) || !1;
3382
+ var t = ot, e = t("%Object.defineProperty%", !0) || !1;
3446
3383
  if (e)
3447
3384
  try {
3448
3385
  e({}, "a", { value: 1 });
@@ -3451,14 +3388,14 @@ function Ir() {
3451
3388
  }
3452
3389
  return xt = e, xt;
3453
3390
  }
3454
- var ra = st, yt = ra("%Object.getOwnPropertyDescriptor%", !0);
3455
- if (yt)
3391
+ var na = ot, pt = na("%Object.getOwnPropertyDescriptor%", !0);
3392
+ if (pt)
3456
3393
  try {
3457
- yt([], "length");
3394
+ pt([], "length");
3458
3395
  } catch {
3459
- yt = null;
3396
+ pt = null;
3460
3397
  }
3461
- var Vt = yt, on = Ir(), na = Hn, Me = Rt, sn = Vt, ia = function(e, r, n) {
3398
+ var Vt = pt, on = Ir(), ia = Wn, Me = Rt, sn = Vt, oa = function(e, r, n) {
3462
3399
  if (!e || typeof e != "object" && typeof e != "function")
3463
3400
  throw new Me("`obj` must be an object or a function`");
3464
3401
  if (typeof r != "string" && typeof r != "symbol")
@@ -3482,11 +3419,11 @@ var Vt = yt, on = Ir(), na = Hn, Me = Rt, sn = Vt, ia = function(e, r, n) {
3482
3419
  else if (a || !i && !o && !s)
3483
3420
  e[r] = n;
3484
3421
  else
3485
- throw new na("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");
3486
- }, ur = Ir(), Jn = function() {
3422
+ throw new ia("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");
3423
+ }, ur = Ir(), Xn = function() {
3487
3424
  return !!ur;
3488
3425
  };
3489
- Jn.hasArrayLengthDefineBug = function() {
3426
+ Xn.hasArrayLengthDefineBug = function() {
3490
3427
  if (!ur)
3491
3428
  return null;
3492
3429
  try {
@@ -3495,17 +3432,17 @@ Jn.hasArrayLengthDefineBug = function() {
3495
3432
  return !0;
3496
3433
  }
3497
3434
  };
3498
- var oa = Jn, sa = st, an = ia, aa = oa(), un = Vt, cn = Rt, ua = sa("%Math.floor%"), ca = function(e, r) {
3435
+ var sa = Xn, aa = ot, an = oa, ua = sa(), un = Vt, cn = Rt, ca = aa("%Math.floor%"), la = function(e, r) {
3499
3436
  if (typeof e != "function")
3500
3437
  throw new cn("`fn` is not a function");
3501
- if (typeof r != "number" || r < 0 || r > 4294967295 || ua(r) !== r)
3438
+ if (typeof r != "number" || r < 0 || r > 4294967295 || ca(r) !== r)
3502
3439
  throw new cn("`length` must be a positive 32-bit integer");
3503
3440
  var n = arguments.length > 2 && !!arguments[2], i = !0, o = !0;
3504
3441
  if ("length" in e && un) {
3505
3442
  var s = un(e, "length");
3506
3443
  s && !s.configurable && (i = !1), s && !s.writable && (o = !1);
3507
3444
  }
3508
- return (i || o || !n) && (aa ? an(
3445
+ return (i || o || !n) && (ua ? an(
3509
3446
  /** @type {Parameters<define>[0]} */
3510
3447
  e,
3511
3448
  "length",
@@ -3520,14 +3457,14 @@ var oa = Jn, sa = st, an = ia, aa = oa(), un = Vt, cn = Rt, ua = sa("%Math.floor
3520
3457
  )), e;
3521
3458
  };
3522
3459
  (function(t) {
3523
- var e = Er, r = st, n = ca, i = Rt, o = r("%Function.prototype.apply%"), s = r("%Function.prototype.call%"), a = r("%Reflect.apply%", !0) || e.call(s, o), u = Ir(), f = r("%Math.max%");
3524
- t.exports = function(l) {
3525
- if (typeof l != "function")
3460
+ var e = Er, r = ot, n = la, i = Rt, o = r("%Function.prototype.apply%"), s = r("%Function.prototype.call%"), a = r("%Reflect.apply%", !0) || e.call(s, o), u = Ir(), f = r("%Math.max%");
3461
+ t.exports = function(h) {
3462
+ if (typeof h != "function")
3526
3463
  throw new i("a function is required");
3527
3464
  var g = a(e, s, arguments);
3528
3465
  return n(
3529
3466
  g,
3530
- 1 + f(0, l.length - (arguments.length - 1)),
3467
+ 1 + f(0, h.length - (arguments.length - 1)),
3531
3468
  !0
3532
3469
  );
3533
3470
  };
@@ -3535,85 +3472,85 @@ var oa = Jn, sa = st, an = ia, aa = oa(), un = Vt, cn = Rt, ua = sa("%Math.floor
3535
3472
  return a(e, o, arguments);
3536
3473
  };
3537
3474
  u ? u(t.exports, "apply", { value: c }) : t.exports.apply = c;
3538
- })(Yn);
3539
- var Tr = Yn.exports, Xn = st, Zn = Tr, la = Zn(Xn("String.prototype.indexOf")), Or = function(e, r) {
3540
- var n = Xn(e, !!r);
3541
- return typeof n == "function" && la(e, ".prototype.") > -1 ? Zn(n) : n;
3542
- }, da = Dt(), fa = Or, cr = fa("Object.prototype.toString"), $t = function(e) {
3543
- return da && e && typeof e == "object" && Symbol.toStringTag in e ? !1 : cr(e) === "[object Arguments]";
3544
- }, ei = function(e) {
3475
+ })(Jn);
3476
+ var Tr = Jn.exports, Zn = ot, ei = Tr, da = ei(Zn("String.prototype.indexOf")), Or = function(e, r) {
3477
+ var n = Zn(e, !!r);
3478
+ return typeof n == "function" && da(e, ".prototype.") > -1 ? ei(n) : n;
3479
+ }, fa = Dt(), ha = Or, cr = ha("Object.prototype.toString"), $t = function(e) {
3480
+ return fa && e && typeof e == "object" && Symbol.toStringTag in e ? !1 : cr(e) === "[object Arguments]";
3481
+ }, ti = function(e) {
3545
3482
  return $t(e) ? !0 : e !== null && typeof e == "object" && typeof e.length == "number" && e.length >= 0 && cr(e) !== "[object Array]" && cr(e.callee) === "[object Function]";
3546
- }, ha = function() {
3483
+ }, pa = function() {
3547
3484
  return $t(arguments);
3548
3485
  }();
3549
- $t.isLegacyArguments = ei;
3550
- var pa = ha ? $t : ei, ya = Object.prototype.toString, ga = Function.prototype.toString, ma = /^\s*(?:function)?\*/, ti = Dt(), Qt = Object.getPrototypeOf, va = function() {
3551
- if (!ti)
3486
+ $t.isLegacyArguments = ti;
3487
+ var ya = pa ? $t : ti, ma = Object.prototype.toString, ga = Function.prototype.toString, va = /^\s*(?:function)?\*/, ri = Dt(), Qt = Object.getPrototypeOf, ba = function() {
3488
+ if (!ri)
3552
3489
  return !1;
3553
3490
  try {
3554
3491
  return Function("return function*() {}")();
3555
3492
  } catch {
3556
3493
  }
3557
- }, Gt, ba = function(e) {
3494
+ }, Gt, Sa = function(e) {
3558
3495
  if (typeof e != "function")
3559
3496
  return !1;
3560
- if (ma.test(ga.call(e)))
3497
+ if (va.test(ga.call(e)))
3561
3498
  return !0;
3562
- if (!ti) {
3563
- var r = ya.call(e);
3499
+ if (!ri) {
3500
+ var r = ma.call(e);
3564
3501
  return r === "[object GeneratorFunction]";
3565
3502
  }
3566
3503
  if (!Qt)
3567
3504
  return !1;
3568
3505
  if (typeof Gt > "u") {
3569
- var n = va();
3506
+ var n = ba();
3570
3507
  Gt = n ? Qt(n) : !1;
3571
3508
  }
3572
3509
  return Qt(e) === Gt;
3573
- }, ri = Function.prototype.toString, qe = typeof Reflect == "object" && Reflect !== null && Reflect.apply, lr, gt;
3510
+ }, ni = Function.prototype.toString, qe = typeof Reflect == "object" && Reflect !== null && Reflect.apply, lr, yt;
3574
3511
  if (typeof qe == "function" && typeof Object.defineProperty == "function")
3575
3512
  try {
3576
3513
  lr = Object.defineProperty({}, "length", {
3577
3514
  get: function() {
3578
- throw gt;
3515
+ throw yt;
3579
3516
  }
3580
- }), gt = {}, qe(function() {
3517
+ }), yt = {}, qe(function() {
3581
3518
  throw 42;
3582
3519
  }, null, lr);
3583
3520
  } catch (t) {
3584
- t !== gt && (qe = null);
3521
+ t !== yt && (qe = null);
3585
3522
  }
3586
3523
  else
3587
3524
  qe = null;
3588
- var Sa = /^\s*class\b/, dr = function(e) {
3525
+ var wa = /^\s*class\b/, dr = function(e) {
3589
3526
  try {
3590
- var r = ri.call(e);
3591
- return Sa.test(r);
3527
+ var r = ni.call(e);
3528
+ return wa.test(r);
3592
3529
  } catch {
3593
3530
  return !1;
3594
3531
  }
3595
3532
  }, Kt = function(e) {
3596
3533
  try {
3597
- return dr(e) ? !1 : (ri.call(e), !0);
3534
+ return dr(e) ? !1 : (ni.call(e), !0);
3598
3535
  } catch {
3599
3536
  return !1;
3600
3537
  }
3601
- }, mt = Object.prototype.toString, wa = "[object Object]", Aa = "[object Function]", Ea = "[object GeneratorFunction]", Ia = "[object HTMLAllCollection]", Ta = "[object HTML document.all class]", Oa = "[object HTMLCollection]", _a = typeof Symbol == "function" && !!Symbol.toStringTag, La = !(0 in [,]), fr = function() {
3538
+ }, mt = Object.prototype.toString, Aa = "[object Object]", Ea = "[object Function]", Ia = "[object GeneratorFunction]", Ta = "[object HTMLAllCollection]", Oa = "[object HTML document.all class]", _a = "[object HTMLCollection]", Ca = typeof Symbol == "function" && !!Symbol.toStringTag, La = !(0 in [,]), fr = function() {
3602
3539
  return !1;
3603
3540
  };
3604
3541
  if (typeof document == "object") {
3605
- var Ca = document.all;
3606
- mt.call(Ca) === mt.call(document.all) && (fr = function(e) {
3542
+ var ka = document.all;
3543
+ mt.call(ka) === mt.call(document.all) && (fr = function(e) {
3607
3544
  if ((La || !e) && (typeof e > "u" || typeof e == "object"))
3608
3545
  try {
3609
3546
  var r = mt.call(e);
3610
- return (r === Ia || r === Ta || r === Oa || r === wa) && e("") == null;
3547
+ return (r === Ta || r === Oa || r === _a || r === Aa) && e("") == null;
3611
3548
  } catch {
3612
3549
  }
3613
3550
  return !1;
3614
3551
  });
3615
3552
  }
3616
- var ka = qe ? function(e) {
3553
+ var Pa = qe ? function(e) {
3617
3554
  if (fr(e))
3618
3555
  return !0;
3619
3556
  if (!e || typeof e != "function" && typeof e != "object")
@@ -3621,7 +3558,7 @@ var ka = qe ? function(e) {
3621
3558
  try {
3622
3559
  qe(e, null, lr);
3623
3560
  } catch (r) {
3624
- if (r !== gt)
3561
+ if (r !== yt)
3625
3562
  return !1;
3626
3563
  }
3627
3564
  return !dr(e) && Kt(e);
@@ -3630,27 +3567,27 @@ var ka = qe ? function(e) {
3630
3567
  return !0;
3631
3568
  if (!e || typeof e != "function" && typeof e != "object")
3632
3569
  return !1;
3633
- if (_a)
3570
+ if (Ca)
3634
3571
  return Kt(e);
3635
3572
  if (dr(e))
3636
3573
  return !1;
3637
3574
  var r = mt.call(e);
3638
- return r !== Aa && r !== Ea && !/^\[object HTML/.test(r) ? !1 : Kt(e);
3639
- }, Pa = ka, Na = Object.prototype.toString, ni = Object.prototype.hasOwnProperty, Fa = function(e, r, n) {
3575
+ return r !== Ea && r !== Ia && !/^\[object HTML/.test(r) ? !1 : Kt(e);
3576
+ }, Na = Pa, Fa = Object.prototype.toString, ii = Object.prototype.hasOwnProperty, Da = function(e, r, n) {
3640
3577
  for (var i = 0, o = e.length; i < o; i++)
3641
- ni.call(e, i) && (n == null ? r(e[i], i, e) : r.call(n, e[i], i, e));
3642
- }, Da = function(e, r, n) {
3578
+ ii.call(e, i) && (n == null ? r(e[i], i, e) : r.call(n, e[i], i, e));
3579
+ }, Ra = function(e, r, n) {
3643
3580
  for (var i = 0, o = e.length; i < o; i++)
3644
3581
  n == null ? r(e.charAt(i), i, e) : r.call(n, e.charAt(i), i, e);
3645
- }, Ra = function(e, r, n) {
3646
- for (var i in e)
3647
- ni.call(e, i) && (n == null ? r(e[i], i, e) : r.call(n, e[i], i, e));
3648
3582
  }, Va = function(e, r, n) {
3649
- if (!Pa(r))
3583
+ for (var i in e)
3584
+ ii.call(e, i) && (n == null ? r(e[i], i, e) : r.call(n, e[i], i, e));
3585
+ }, $a = function(e, r, n) {
3586
+ if (!Na(r))
3650
3587
  throw new TypeError("iterator must be a function");
3651
3588
  var i;
3652
- arguments.length >= 3 && (i = n), Na.call(e) === "[object Array]" ? Fa(e, r, i) : typeof e == "string" ? Da(e, r, i) : Ra(e, r, i);
3653
- }, ii = Va, $a = [
3589
+ arguments.length >= 3 && (i = n), Fa.call(e) === "[object Array]" ? Da(e, r, i) : typeof e == "string" ? Ra(e, r, i) : Va(e, r, i);
3590
+ }, oi = $a, Ma = [
3654
3591
  "Float32Array",
3655
3592
  "Float64Array",
3656
3593
  "Int8Array",
@@ -3662,83 +3599,83 @@ var ka = qe ? function(e) {
3662
3599
  "Uint32Array",
3663
3600
  "BigInt64Array",
3664
3601
  "BigUint64Array"
3665
- ], zt = $a, Ma = typeof globalThis > "u" ? br : globalThis, oi = function() {
3602
+ ], zt = Ma, ja = typeof globalThis > "u" ? br : globalThis, si = function() {
3666
3603
  for (var e = [], r = 0; r < zt.length; r++)
3667
- typeof Ma[zt[r]] == "function" && (e[e.length] = zt[r]);
3604
+ typeof ja[zt[r]] == "function" && (e[e.length] = zt[r]);
3668
3605
  return e;
3669
- }, It = ii, ja = oi, ln = Tr, _r = Or, vt = Vt, Ua = _r("Object.prototype.toString"), si = Dt(), dn = typeof globalThis > "u" ? br : globalThis, hr = ja(), Lr = _r("String.prototype.slice"), Ht = Object.getPrototypeOf, Ba = _r("Array.prototype.indexOf", !0) || function(e, r) {
3606
+ }, Et = oi, Ua = si, ln = Tr, _r = Or, gt = Vt, Ba = _r("Object.prototype.toString"), ai = Dt(), dn = typeof globalThis > "u" ? br : globalThis, hr = Ua(), Cr = _r("String.prototype.slice"), Ht = Object.getPrototypeOf, qa = _r("Array.prototype.indexOf", !0) || function(e, r) {
3670
3607
  for (var n = 0; n < e.length; n += 1)
3671
3608
  if (e[n] === r)
3672
3609
  return n;
3673
3610
  return -1;
3674
- }, Tt = { __proto__: null };
3675
- si && vt && Ht ? It(hr, function(t) {
3611
+ }, It = { __proto__: null };
3612
+ ai && gt && Ht ? Et(hr, function(t) {
3676
3613
  var e = new dn[t]();
3677
3614
  if (Symbol.toStringTag in e) {
3678
- var r = Ht(e), n = vt(r, Symbol.toStringTag);
3615
+ var r = Ht(e), n = gt(r, Symbol.toStringTag);
3679
3616
  if (!n) {
3680
3617
  var i = Ht(r);
3681
- n = vt(i, Symbol.toStringTag);
3618
+ n = gt(i, Symbol.toStringTag);
3682
3619
  }
3683
- Tt["$" + t] = ln(n.get);
3620
+ It["$" + t] = ln(n.get);
3684
3621
  }
3685
- }) : It(hr, function(t) {
3622
+ }) : Et(hr, function(t) {
3686
3623
  var e = new dn[t](), r = e.slice || e.set;
3687
- r && (Tt["$" + t] = ln(r));
3624
+ r && (It["$" + t] = ln(r));
3688
3625
  });
3689
- var qa = function(e) {
3626
+ var xa = function(e) {
3690
3627
  var r = !1;
3691
- return It(Tt, function(n, i) {
3628
+ return Et(It, function(n, i) {
3692
3629
  if (!r)
3693
3630
  try {
3694
- "$" + n(e) === i && (r = Lr(i, 1));
3631
+ "$" + n(e) === i && (r = Cr(i, 1));
3695
3632
  } catch {
3696
3633
  }
3697
3634
  }), r;
3698
- }, xa = function(e) {
3635
+ }, Qa = function(e) {
3699
3636
  var r = !1;
3700
- return It(Tt, function(n, i) {
3637
+ return Et(It, function(n, i) {
3701
3638
  if (!r)
3702
3639
  try {
3703
- n(e), r = Lr(i, 1);
3640
+ n(e), r = Cr(i, 1);
3704
3641
  } catch {
3705
3642
  }
3706
3643
  }), r;
3707
- }, Qa = function(e) {
3644
+ }, Ga = function(e) {
3708
3645
  if (!e || typeof e != "object")
3709
3646
  return !1;
3710
- if (!si) {
3711
- var r = Lr(Ua(e), 8, -1);
3712
- return Ba(hr, r) > -1 ? r : r !== "Object" ? !1 : xa(e);
3647
+ if (!ai) {
3648
+ var r = Cr(Ba(e), 8, -1);
3649
+ return qa(hr, r) > -1 ? r : r !== "Object" ? !1 : Qa(e);
3713
3650
  }
3714
- return vt ? qa(e) : null;
3715
- }, Ot = ii, Ga = oi, fn = Tr, Cr = Or, bt = Vt, Ka = Cr("Object.prototype.toString"), ai = Dt(), hn = typeof globalThis > "u" ? br : globalThis, pr = Ga(), kr = Cr("String.prototype.slice"), Wt = Object.getPrototypeOf, za = Cr("Array.prototype.indexOf", !0) || function(e, r) {
3651
+ return gt ? xa(e) : null;
3652
+ }, Tt = oi, Ka = si, fn = Tr, Lr = Or, vt = Vt, za = Lr("Object.prototype.toString"), ui = Dt(), hn = typeof globalThis > "u" ? br : globalThis, pr = Ka(), kr = Lr("String.prototype.slice"), Wt = Object.getPrototypeOf, Ha = Lr("Array.prototype.indexOf", !0) || function(e, r) {
3716
3653
  for (var n = 0; n < e.length; n += 1)
3717
3654
  if (e[n] === r)
3718
3655
  return n;
3719
3656
  return -1;
3720
- }, _t = { __proto__: null };
3721
- ai && bt && Wt ? Ot(pr, function(t) {
3657
+ }, Ot = { __proto__: null };
3658
+ ui && vt && Wt ? Tt(pr, function(t) {
3722
3659
  var e = new hn[t]();
3723
3660
  if (Symbol.toStringTag in e) {
3724
- var r = Wt(e), n = bt(r, Symbol.toStringTag);
3661
+ var r = Wt(e), n = vt(r, Symbol.toStringTag);
3725
3662
  if (!n) {
3726
3663
  var i = Wt(r);
3727
- n = bt(i, Symbol.toStringTag);
3664
+ n = vt(i, Symbol.toStringTag);
3728
3665
  }
3729
- _t["$" + t] = fn(n.get);
3666
+ Ot["$" + t] = fn(n.get);
3730
3667
  }
3731
- }) : Ot(pr, function(t) {
3668
+ }) : Tt(pr, function(t) {
3732
3669
  var e = new hn[t](), r = e.slice || e.set;
3733
- r && (_t["$" + t] = fn(r));
3670
+ r && (Ot["$" + t] = fn(r));
3734
3671
  });
3735
- var Ha = function(e) {
3672
+ var Wa = function(e) {
3736
3673
  var r = !1;
3737
- return Ot(
3674
+ return Tt(
3738
3675
  // eslint-disable-next-line no-extra-parens
3739
3676
  /** @type {Record<`\$${TypedArrayName}`, Getter>} */
3740
3677
  /** @type {any} */
3741
- _t,
3678
+ Ot,
3742
3679
  /** @type {(getter: Getter, name: `\$${import('.').TypedArrayName}`) => void} */
3743
3680
  function(n, i) {
3744
3681
  if (!r)
@@ -3748,13 +3685,13 @@ var Ha = function(e) {
3748
3685
  }
3749
3686
  }
3750
3687
  ), r;
3751
- }, Wa = function(e) {
3688
+ }, Ya = function(e) {
3752
3689
  var r = !1;
3753
- return Ot(
3690
+ return Tt(
3754
3691
  // eslint-disable-next-line no-extra-parens
3755
3692
  /** @type {Record<`\$${TypedArrayName}`, Getter>} */
3756
3693
  /** @type {any} */
3757
- _t,
3694
+ Ot,
3758
3695
  /** @type {(getter: typeof cache, name: `\$${import('.').TypedArrayName}`) => void} */
3759
3696
  function(n, i) {
3760
3697
  if (!r)
@@ -3764,41 +3701,41 @@ var Ha = function(e) {
3764
3701
  }
3765
3702
  }
3766
3703
  ), r;
3767
- }, Ya = function(e) {
3704
+ }, Ja = function(e) {
3768
3705
  if (!e || typeof e != "object")
3769
3706
  return !1;
3770
- if (!ai) {
3771
- var r = kr(Ka(e), 8, -1);
3772
- return za(pr, r) > -1 ? r : r !== "Object" ? !1 : Wa(e);
3707
+ if (!ui) {
3708
+ var r = kr(za(e), 8, -1);
3709
+ return Ha(pr, r) > -1 ? r : r !== "Object" ? !1 : Ya(e);
3773
3710
  }
3774
- return bt ? Ha(e) : null;
3775
- }, Ja = Ya, Xa = function(e) {
3776
- return !!Ja(e);
3711
+ return vt ? Wa(e) : null;
3712
+ }, Xa = Ja, Za = function(e) {
3713
+ return !!Xa(e);
3777
3714
  };
3778
3715
  (function(t) {
3779
- var e = pa, r = ba, n = Qa, i = Xa;
3716
+ var e = ya, r = Sa, n = Ga, i = Za;
3780
3717
  function o(y) {
3781
3718
  return y.call.bind(y);
3782
3719
  }
3783
- var s = typeof BigInt < "u", a = typeof Symbol < "u", u = o(Object.prototype.toString), f = o(Number.prototype.valueOf), c = o(String.prototype.valueOf), h = o(Boolean.prototype.valueOf);
3720
+ var s = typeof BigInt < "u", a = typeof Symbol < "u", u = o(Object.prototype.toString), f = o(Number.prototype.valueOf), c = o(String.prototype.valueOf), l = o(Boolean.prototype.valueOf);
3784
3721
  if (s)
3785
- var l = o(BigInt.prototype.valueOf);
3722
+ var h = o(BigInt.prototype.valueOf);
3786
3723
  if (a)
3787
3724
  var g = o(Symbol.prototype.valueOf);
3788
- function v(y, pi) {
3725
+ function v(y, yi) {
3789
3726
  if (typeof y != "object")
3790
3727
  return !1;
3791
3728
  try {
3792
- return pi(y), !0;
3729
+ return yi(y), !0;
3793
3730
  } catch {
3794
3731
  return !1;
3795
3732
  }
3796
3733
  }
3797
3734
  t.isArgumentsObject = e, t.isGeneratorFunction = r, t.isTypedArray = i;
3798
- function w(y) {
3735
+ function I(y) {
3799
3736
  return typeof Promise < "u" && y instanceof Promise || y !== null && typeof y == "object" && typeof y.then == "function" && typeof y.catch == "function";
3800
3737
  }
3801
- t.isPromise = w;
3738
+ t.isPromise = I;
3802
3739
  function b(y) {
3803
3740
  return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? ArrayBuffer.isView(y) : i(y) || p(y);
3804
3741
  }
@@ -3819,10 +3756,10 @@ var Ha = function(e) {
3819
3756
  return n(y) === "Uint32Array";
3820
3757
  }
3821
3758
  t.isUint32Array = X;
3822
- function k(y) {
3759
+ function P(y) {
3823
3760
  return n(y) === "Int8Array";
3824
3761
  }
3825
- t.isInt8Array = k;
3762
+ t.isInt8Array = P;
3826
3763
  function V(y) {
3827
3764
  return n(y) === "Int16Array";
3828
3765
  }
@@ -3831,14 +3768,14 @@ var Ha = function(e) {
3831
3768
  return n(y) === "Int32Array";
3832
3769
  }
3833
3770
  t.isInt32Array = T;
3834
- function ie(y) {
3771
+ function ne(y) {
3835
3772
  return n(y) === "Float32Array";
3836
3773
  }
3837
- t.isFloat32Array = ie;
3838
- function oe(y) {
3774
+ t.isFloat32Array = ne;
3775
+ function ie(y) {
3839
3776
  return n(y) === "Float64Array";
3840
3777
  }
3841
- t.isFloat64Array = oe;
3778
+ t.isFloat64Array = ie;
3842
3779
  function Ne(y) {
3843
3780
  return n(y) === "BigInt64Array";
3844
3781
  }
@@ -3847,12 +3784,12 @@ var Ha = function(e) {
3847
3784
  return n(y) === "BigUint64Array";
3848
3785
  }
3849
3786
  t.isBigUint64Array = Ee;
3850
- function de(y) {
3787
+ function le(y) {
3851
3788
  return u(y) === "[object Map]";
3852
3789
  }
3853
- de.working = typeof Map < "u" && de(/* @__PURE__ */ new Map());
3790
+ le.working = typeof Map < "u" && le(/* @__PURE__ */ new Map());
3854
3791
  function Mt(y) {
3855
- return typeof Map > "u" ? !1 : de.working ? de(y) : y instanceof Map;
3792
+ return typeof Map > "u" ? !1 : le.working ? le(y) : y instanceof Map;
3856
3793
  }
3857
3794
  t.isMap = Mt;
3858
3795
  function Se(y) {
@@ -3875,18 +3812,18 @@ var Ha = function(e) {
3875
3812
  return u(y) === "[object WeakSet]";
3876
3813
  }
3877
3814
  De.working = typeof WeakSet < "u" && De(/* @__PURE__ */ new WeakSet());
3878
- function fe(y) {
3815
+ function de(y) {
3879
3816
  return De(y);
3880
3817
  }
3881
- t.isWeakSet = fe;
3818
+ t.isWeakSet = de;
3882
3819
  function Re(y) {
3883
3820
  return u(y) === "[object ArrayBuffer]";
3884
3821
  }
3885
3822
  Re.working = typeof ArrayBuffer < "u" && Re(new ArrayBuffer());
3886
- function at(y) {
3823
+ function st(y) {
3887
3824
  return typeof ArrayBuffer > "u" ? !1 : Re.working ? Re(y) : y instanceof ArrayBuffer;
3888
3825
  }
3889
- t.isArrayBuffer = at;
3826
+ t.isArrayBuffer = st;
3890
3827
  function d(y) {
3891
3828
  return u(y) === "[object DataView]";
3892
3829
  }
@@ -3899,26 +3836,26 @@ var Ha = function(e) {
3899
3836
  function S(y) {
3900
3837
  return u(y) === "[object SharedArrayBuffer]";
3901
3838
  }
3902
- function _(y) {
3839
+ function C(y) {
3903
3840
  return typeof m > "u" ? !1 : (typeof S.working > "u" && (S.working = S(new m())), S.working ? S(y) : y instanceof m);
3904
3841
  }
3905
- t.isSharedArrayBuffer = _;
3906
- function C(y) {
3842
+ t.isSharedArrayBuffer = C;
3843
+ function k(y) {
3907
3844
  return u(y) === "[object AsyncFunction]";
3908
3845
  }
3909
- t.isAsyncFunction = C;
3910
- function E(y) {
3846
+ t.isAsyncFunction = k;
3847
+ function A(y) {
3911
3848
  return u(y) === "[object Map Iterator]";
3912
3849
  }
3913
- t.isMapIterator = E;
3850
+ t.isMapIterator = A;
3914
3851
  function O(y) {
3915
3852
  return u(y) === "[object Set Iterator]";
3916
3853
  }
3917
3854
  t.isSetIterator = O;
3918
- function N(y) {
3855
+ function F(y) {
3919
3856
  return u(y) === "[object Generator]";
3920
3857
  }
3921
- t.isGeneratorObject = N;
3858
+ t.isGeneratorObject = F;
3922
3859
  function K(y) {
3923
3860
  return u(y) === "[object WebAssembly.Module]";
3924
3861
  }
@@ -3927,30 +3864,30 @@ var Ha = function(e) {
3927
3864
  return v(y, f);
3928
3865
  }
3929
3866
  t.isNumberObject = Ie;
3930
- function ut(y) {
3867
+ function at(y) {
3931
3868
  return v(y, c);
3932
3869
  }
3933
- t.isStringObject = ut;
3870
+ t.isStringObject = at;
3934
3871
  function Ve(y) {
3935
- return v(y, h);
3872
+ return v(y, l);
3936
3873
  }
3937
3874
  t.isBooleanObject = Ve;
3938
- function ct(y) {
3939
- return s && v(y, l);
3875
+ function ut(y) {
3876
+ return s && v(y, h);
3940
3877
  }
3941
- t.isBigIntObject = ct;
3878
+ t.isBigIntObject = ut;
3942
3879
  function Fr(y) {
3943
3880
  return a && v(y, g);
3944
3881
  }
3945
3882
  t.isSymbolObject = Fr;
3946
- function fi(y) {
3947
- return Ie(y) || ut(y) || Ve(y) || ct(y) || Fr(y);
3948
- }
3949
- t.isBoxedPrimitive = fi;
3950
3883
  function hi(y) {
3951
- return typeof Uint8Array < "u" && (at(y) || _(y));
3884
+ return Ie(y) || at(y) || Ve(y) || ut(y) || Fr(y);
3885
+ }
3886
+ t.isBoxedPrimitive = hi;
3887
+ function pi(y) {
3888
+ return typeof Uint8Array < "u" && (st(y) || C(y));
3952
3889
  }
3953
- t.isAnyArrayBuffer = hi, ["isProxy", "isExternal", "isModuleNamespaceObject"].forEach(function(y) {
3890
+ t.isAnyArrayBuffer = pi, ["isProxy", "isExternal", "isModuleNamespaceObject"].forEach(function(y) {
3954
3891
  Object.defineProperty(t, y, {
3955
3892
  enumerable: !1,
3956
3893
  value: function() {
@@ -3958,8 +3895,8 @@ var Ha = function(e) {
3958
3895
  }
3959
3896
  });
3960
3897
  });
3961
- })(Kn);
3962
- var Za = function(e) {
3898
+ })(zn);
3899
+ var eu = function(e) {
3963
3900
  return e && typeof e == "object" && typeof e.copy == "function" && typeof e.fill == "function" && typeof e.readUInt8 == "function";
3964
3901
  }, yr = { exports: {} };
3965
3902
  typeof Object.create == "function" ? yr.exports = function(e, r) {
@@ -3979,22 +3916,22 @@ typeof Object.create == "function" ? yr.exports = function(e, r) {
3979
3916
  n.prototype = r.prototype, e.prototype = new n(), e.prototype.constructor = e;
3980
3917
  }
3981
3918
  };
3982
- var eu = yr.exports;
3919
+ var tu = yr.exports;
3983
3920
  (function(t) {
3984
3921
  var e = Object.getOwnPropertyDescriptors || function(p) {
3985
- for (var m = Object.keys(p), S = {}, _ = 0; _ < m.length; _++)
3986
- S[m[_]] = Object.getOwnPropertyDescriptor(p, m[_]);
3922
+ for (var m = Object.keys(p), S = {}, C = 0; C < m.length; C++)
3923
+ S[m[C]] = Object.getOwnPropertyDescriptor(p, m[C]);
3987
3924
  return S;
3988
3925
  }, r = /%[sdj%]/g;
3989
3926
  t.format = function(d) {
3990
- if (!k(d)) {
3927
+ if (!P(d)) {
3991
3928
  for (var p = [], m = 0; m < arguments.length; m++)
3992
3929
  p.push(s(arguments[m]));
3993
3930
  return p.join(" ");
3994
3931
  }
3995
- for (var m = 1, S = arguments, _ = S.length, C = String(d).replace(r, function(O) {
3932
+ for (var m = 1, S = arguments, C = S.length, k = String(d).replace(r, function(O) {
3996
3933
  if (O === "%%") return "%";
3997
- if (m >= _) return O;
3934
+ if (m >= C) return O;
3998
3935
  switch (O) {
3999
3936
  case "%s":
4000
3937
  return String(S[m++]);
@@ -4009,36 +3946,36 @@ var eu = yr.exports;
4009
3946
  default:
4010
3947
  return O;
4011
3948
  }
4012
- }), E = S[m]; m < _; E = S[++m])
4013
- R(E) || !oe(E) ? C += " " + E : C += " " + s(E);
4014
- return C;
3949
+ }), A = S[m]; m < C; A = S[++m])
3950
+ R(A) || !ie(A) ? k += " " + A : k += " " + s(A);
3951
+ return k;
4015
3952
  }, t.deprecate = function(d, p) {
4016
- if (typeof A < "u" && A.noDeprecation === !0)
3953
+ if (typeof w < "u" && w.noDeprecation === !0)
4017
3954
  return d;
4018
- if (typeof A > "u")
3955
+ if (typeof w > "u")
4019
3956
  return function() {
4020
3957
  return t.deprecate(d, p).apply(this, arguments);
4021
3958
  };
4022
3959
  var m = !1;
4023
3960
  function S() {
4024
3961
  if (!m) {
4025
- if (A.throwDeprecation)
3962
+ if (w.throwDeprecation)
4026
3963
  throw new Error(p);
4027
- A.traceDeprecation ? console.trace(p) : console.error(p), m = !0;
3964
+ w.traceDeprecation ? console.trace(p) : console.error(p), m = !0;
4028
3965
  }
4029
3966
  return d.apply(this, arguments);
4030
3967
  }
4031
3968
  return S;
4032
3969
  };
4033
3970
  var n = {}, i = /^$/;
4034
- if (A.env.NODE_DEBUG) {
4035
- var o = A.env.NODE_DEBUG;
3971
+ if (w.env.NODE_DEBUG) {
3972
+ var o = w.env.NODE_DEBUG;
4036
3973
  o = o.replace(/[|\\{}()[\]^$+?.]/g, "\\$&").replace(/\*/g, ".*").replace(/,/g, "$|^").toUpperCase(), i = new RegExp("^" + o + "$", "i");
4037
3974
  }
4038
3975
  t.debuglog = function(d) {
4039
3976
  if (d = d.toUpperCase(), !n[d])
4040
3977
  if (i.test(d)) {
4041
- var p = A.pid;
3978
+ var p = w.pid;
4042
3979
  n[d] = function() {
4043
3980
  var m = t.format.apply(t, arguments);
4044
3981
  console.error("%s %d: %s", d, p, m);
@@ -4094,49 +4031,49 @@ var eu = yr.exports;
4094
4031
  }), p;
4095
4032
  }
4096
4033
  function c(d, p, m) {
4097
- if (d.customInspect && p && de(p.inspect) && // Filter out the util module, it's inspect function is special
4034
+ if (d.customInspect && p && le(p.inspect) && // Filter out the util module, it's inspect function is special
4098
4035
  p.inspect !== t.inspect && // Also filter out any prototype objects using the circular check.
4099
4036
  !(p.constructor && p.constructor.prototype === p)) {
4100
4037
  var S = p.inspect(m, d);
4101
- return k(S) || (S = c(d, S, m)), S;
4038
+ return P(S) || (S = c(d, S, m)), S;
4102
4039
  }
4103
- var _ = h(d, p);
4104
- if (_)
4105
- return _;
4106
- var C = Object.keys(p), E = f(C);
4107
- if (d.showHidden && (C = Object.getOwnPropertyNames(p)), Ee(p) && (C.indexOf("message") >= 0 || C.indexOf("description") >= 0))
4108
- return l(p);
4109
- if (C.length === 0) {
4110
- if (de(p)) {
4040
+ var C = l(d, p);
4041
+ if (C)
4042
+ return C;
4043
+ var k = Object.keys(p), A = f(k);
4044
+ if (d.showHidden && (k = Object.getOwnPropertyNames(p)), Ee(p) && (k.indexOf("message") >= 0 || k.indexOf("description") >= 0))
4045
+ return h(p);
4046
+ if (k.length === 0) {
4047
+ if (le(p)) {
4111
4048
  var O = p.name ? ": " + p.name : "";
4112
4049
  return d.stylize("[Function" + O + "]", "special");
4113
4050
  }
4114
- if (ie(p))
4051
+ if (ne(p))
4115
4052
  return d.stylize(RegExp.prototype.toString.call(p), "regexp");
4116
4053
  if (Ne(p))
4117
4054
  return d.stylize(Date.prototype.toString.call(p), "date");
4118
4055
  if (Ee(p))
4119
- return l(p);
4056
+ return h(p);
4120
4057
  }
4121
- var N = "", K = !1, Ie = ["{", "}"];
4122
- if (b(p) && (K = !0, Ie = ["[", "]"]), de(p)) {
4123
- var ut = p.name ? ": " + p.name : "";
4124
- N = " [Function" + ut + "]";
4058
+ var F = "", K = !1, Ie = ["{", "}"];
4059
+ if (b(p) && (K = !0, Ie = ["[", "]"]), le(p)) {
4060
+ var at = p.name ? ": " + p.name : "";
4061
+ F = " [Function" + at + "]";
4125
4062
  }
4126
- if (ie(p) && (N = " " + RegExp.prototype.toString.call(p)), Ne(p) && (N = " " + Date.prototype.toUTCString.call(p)), Ee(p) && (N = " " + l(p)), C.length === 0 && (!K || p.length == 0))
4127
- return Ie[0] + N + Ie[1];
4063
+ if (ne(p) && (F = " " + RegExp.prototype.toString.call(p)), Ne(p) && (F = " " + Date.prototype.toUTCString.call(p)), Ee(p) && (F = " " + h(p)), k.length === 0 && (!K || p.length == 0))
4064
+ return Ie[0] + F + Ie[1];
4128
4065
  if (m < 0)
4129
- return ie(p) ? d.stylize(RegExp.prototype.toString.call(p), "regexp") : d.stylize("[Object]", "special");
4066
+ return ne(p) ? d.stylize(RegExp.prototype.toString.call(p), "regexp") : d.stylize("[Object]", "special");
4130
4067
  d.seen.push(p);
4131
4068
  var Ve;
4132
- return K ? Ve = g(d, p, m, E, C) : Ve = C.map(function(ct) {
4133
- return v(d, p, m, E, ct, K);
4134
- }), d.seen.pop(), w(Ve, N, Ie);
4069
+ return K ? Ve = g(d, p, m, A, k) : Ve = k.map(function(ut) {
4070
+ return v(d, p, m, A, ut, K);
4071
+ }), d.seen.pop(), I(Ve, F, Ie);
4135
4072
  }
4136
- function h(d, p) {
4073
+ function l(d, p) {
4137
4074
  if (T(p))
4138
4075
  return d.stylize("undefined", "undefined");
4139
- if (k(p)) {
4076
+ if (P(p)) {
4140
4077
  var m = "'" + JSON.stringify(p).replace(/^"|"$/g, "").replace(/'/g, "\\'").replace(/\\"/g, '"') + "'";
4141
4078
  return d.stylize(m, "string");
4142
4079
  }
@@ -4147,34 +4084,34 @@ var eu = yr.exports;
4147
4084
  if (R(p))
4148
4085
  return d.stylize("null", "null");
4149
4086
  }
4150
- function l(d) {
4087
+ function h(d) {
4151
4088
  return "[" + Error.prototype.toString.call(d) + "]";
4152
4089
  }
4153
- function g(d, p, m, S, _) {
4154
- for (var C = [], E = 0, O = p.length; E < O; ++E)
4155
- De(p, String(E)) ? C.push(v(
4090
+ function g(d, p, m, S, C) {
4091
+ for (var k = [], A = 0, O = p.length; A < O; ++A)
4092
+ De(p, String(A)) ? k.push(v(
4156
4093
  d,
4157
4094
  p,
4158
4095
  m,
4159
4096
  S,
4160
- String(E),
4097
+ String(A),
4161
4098
  !0
4162
- )) : C.push("");
4163
- return _.forEach(function(N) {
4164
- N.match(/^\d+$/) || C.push(v(
4099
+ )) : k.push("");
4100
+ return C.forEach(function(F) {
4101
+ F.match(/^\d+$/) || k.push(v(
4165
4102
  d,
4166
4103
  p,
4167
4104
  m,
4168
4105
  S,
4169
- N,
4106
+ F,
4170
4107
  !0
4171
4108
  ));
4172
- }), C;
4109
+ }), k;
4173
4110
  }
4174
- function v(d, p, m, S, _, C) {
4175
- var E, O, N;
4176
- if (N = Object.getOwnPropertyDescriptor(p, _) || { value: p[_] }, N.get ? N.set ? O = d.stylize("[Getter/Setter]", "special") : O = d.stylize("[Getter]", "special") : N.set && (O = d.stylize("[Setter]", "special")), De(S, _) || (E = "[" + _ + "]"), O || (d.seen.indexOf(N.value) < 0 ? (R(m) ? O = c(d, N.value, null) : O = c(d, N.value, m - 1), O.indexOf(`
4177
- `) > -1 && (C ? O = O.split(`
4111
+ function v(d, p, m, S, C, k) {
4112
+ var A, O, F;
4113
+ if (F = Object.getOwnPropertyDescriptor(p, C) || { value: p[C] }, F.get ? F.set ? O = d.stylize("[Getter/Setter]", "special") : O = d.stylize("[Getter]", "special") : F.set && (O = d.stylize("[Setter]", "special")), De(S, C) || (A = "[" + C + "]"), O || (d.seen.indexOf(F.value) < 0 ? (R(m) ? O = c(d, F.value, null) : O = c(d, F.value, m - 1), O.indexOf(`
4114
+ `) > -1 && (k ? O = O.split(`
4178
4115
  `).map(function(K) {
4179
4116
  return " " + K;
4180
4117
  }).join(`
@@ -4183,23 +4120,23 @@ var eu = yr.exports;
4183
4120
  `).map(function(K) {
4184
4121
  return " " + K;
4185
4122
  }).join(`
4186
- `))) : O = d.stylize("[Circular]", "special")), T(E)) {
4187
- if (C && _.match(/^\d+$/))
4123
+ `))) : O = d.stylize("[Circular]", "special")), T(A)) {
4124
+ if (k && C.match(/^\d+$/))
4188
4125
  return O;
4189
- E = JSON.stringify("" + _), E.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/) ? (E = E.slice(1, -1), E = d.stylize(E, "name")) : (E = E.replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'"), E = d.stylize(E, "string"));
4126
+ A = JSON.stringify("" + C), A.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/) ? (A = A.slice(1, -1), A = d.stylize(A, "name")) : (A = A.replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'"), A = d.stylize(A, "string"));
4190
4127
  }
4191
- return E + ": " + O;
4128
+ return A + ": " + O;
4192
4129
  }
4193
- function w(d, p, m) {
4194
- var S = d.reduce(function(_, C) {
4195
- return C.indexOf(`
4196
- `) >= 0, _ + C.replace(/\u001b\[\d\d?m/g, "").length + 1;
4130
+ function I(d, p, m) {
4131
+ var S = d.reduce(function(C, k) {
4132
+ return k.indexOf(`
4133
+ `) >= 0, C + k.replace(/\u001b\[\d\d?m/g, "").length + 1;
4197
4134
  }, 0);
4198
4135
  return S > 60 ? m[0] + (p === "" ? "" : p + `
4199
4136
  `) + " " + d.join(`,
4200
4137
  `) + " " + m[1] : m[0] + p + " " + d.join(", ") + " " + m[1];
4201
4138
  }
4202
- t.types = Kn;
4139
+ t.types = zn;
4203
4140
  function b(d) {
4204
4141
  return Array.isArray(d);
4205
4142
  }
@@ -4220,10 +4157,10 @@ var eu = yr.exports;
4220
4157
  return typeof d == "number";
4221
4158
  }
4222
4159
  t.isNumber = X;
4223
- function k(d) {
4160
+ function P(d) {
4224
4161
  return typeof d == "string";
4225
4162
  }
4226
- t.isString = k;
4163
+ t.isString = P;
4227
4164
  function V(d) {
4228
4165
  return typeof d == "symbol";
4229
4166
  }
@@ -4232,31 +4169,31 @@ var eu = yr.exports;
4232
4169
  return d === void 0;
4233
4170
  }
4234
4171
  t.isUndefined = T;
4235
- function ie(d) {
4236
- return oe(d) && Se(d) === "[object RegExp]";
4172
+ function ne(d) {
4173
+ return ie(d) && Se(d) === "[object RegExp]";
4237
4174
  }
4238
- t.isRegExp = ie, t.types.isRegExp = ie;
4239
- function oe(d) {
4175
+ t.isRegExp = ne, t.types.isRegExp = ne;
4176
+ function ie(d) {
4240
4177
  return typeof d == "object" && d !== null;
4241
4178
  }
4242
- t.isObject = oe;
4179
+ t.isObject = ie;
4243
4180
  function Ne(d) {
4244
- return oe(d) && Se(d) === "[object Date]";
4181
+ return ie(d) && Se(d) === "[object Date]";
4245
4182
  }
4246
4183
  t.isDate = Ne, t.types.isDate = Ne;
4247
4184
  function Ee(d) {
4248
- return oe(d) && (Se(d) === "[object Error]" || d instanceof Error);
4185
+ return ie(d) && (Se(d) === "[object Error]" || d instanceof Error);
4249
4186
  }
4250
4187
  t.isError = Ee, t.types.isNativeError = Ee;
4251
- function de(d) {
4188
+ function le(d) {
4252
4189
  return typeof d == "function";
4253
4190
  }
4254
- t.isFunction = de;
4191
+ t.isFunction = le;
4255
4192
  function Mt(d) {
4256
4193
  return d === null || typeof d == "boolean" || typeof d == "number" || typeof d == "string" || typeof d == "symbol" || // ES6 symbol
4257
4194
  typeof d > "u";
4258
4195
  }
4259
- t.isPrimitive = Mt, t.isBuffer = Za;
4196
+ t.isPrimitive = Mt, t.isBuffer = eu;
4260
4197
  function Se(d) {
4261
4198
  return Object.prototype.toString.call(d);
4262
4199
  }
@@ -4287,8 +4224,8 @@ var eu = yr.exports;
4287
4224
  }
4288
4225
  t.log = function() {
4289
4226
  console.log("%s - %s", jt(), t.format.apply(t, arguments));
4290
- }, t.inherits = eu, t._extend = function(d, p) {
4291
- if (!p || !oe(p)) return d;
4227
+ }, t.inherits = tu, t._extend = function(d, p) {
4228
+ if (!p || !ie(p)) return d;
4292
4229
  for (var m = Object.keys(p), S = m.length; S--; )
4293
4230
  d[m[S]] = p[m[S]];
4294
4231
  return d;
@@ -4296,15 +4233,15 @@ var eu = yr.exports;
4296
4233
  function De(d, p) {
4297
4234
  return Object.prototype.hasOwnProperty.call(d, p);
4298
4235
  }
4299
- var fe = typeof Symbol < "u" ? Symbol("util.promisify.custom") : void 0;
4236
+ var de = typeof Symbol < "u" ? Symbol("util.promisify.custom") : void 0;
4300
4237
  t.promisify = function(p) {
4301
4238
  if (typeof p != "function")
4302
4239
  throw new TypeError('The "original" argument must be of type Function');
4303
- if (fe && p[fe]) {
4304
- var m = p[fe];
4240
+ if (de && p[de]) {
4241
+ var m = p[de];
4305
4242
  if (typeof m != "function")
4306
4243
  throw new TypeError('The "util.promisify.custom" argument must be of type Function');
4307
- return Object.defineProperty(m, fe, {
4244
+ return Object.defineProperty(m, de, {
4308
4245
  value: m,
4309
4246
  enumerable: !1,
4310
4247
  writable: !1,
@@ -4312,21 +4249,21 @@ var eu = yr.exports;
4312
4249
  }), m;
4313
4250
  }
4314
4251
  function m() {
4315
- for (var S, _, C = new Promise(function(N, K) {
4316
- S = N, _ = K;
4317
- }), E = [], O = 0; O < arguments.length; O++)
4318
- E.push(arguments[O]);
4319
- E.push(function(N, K) {
4320
- N ? _(N) : S(K);
4252
+ for (var S, C, k = new Promise(function(F, K) {
4253
+ S = F, C = K;
4254
+ }), A = [], O = 0; O < arguments.length; O++)
4255
+ A.push(arguments[O]);
4256
+ A.push(function(F, K) {
4257
+ F ? C(F) : S(K);
4321
4258
  });
4322
4259
  try {
4323
- p.apply(this, E);
4324
- } catch (N) {
4325
- _(N);
4260
+ p.apply(this, A);
4261
+ } catch (F) {
4262
+ C(F);
4326
4263
  }
4327
- return C;
4264
+ return k;
4328
4265
  }
4329
- return Object.setPrototypeOf(m, Object.getPrototypeOf(p)), fe && Object.defineProperty(m, fe, {
4266
+ return Object.setPrototypeOf(m, Object.getPrototypeOf(p)), de && Object.defineProperty(m, de, {
4330
4267
  value: m,
4331
4268
  enumerable: !1,
4332
4269
  writable: !1,
@@ -4335,7 +4272,7 @@ var eu = yr.exports;
4335
4272
  m,
4336
4273
  e(p)
4337
4274
  );
4338
- }, t.promisify.custom = fe;
4275
+ }, t.promisify.custom = de;
4339
4276
  function Re(d, p) {
4340
4277
  if (!d) {
4341
4278
  var m = new Error("Promise was rejected with a falsy value");
@@ -4343,24 +4280,24 @@ var eu = yr.exports;
4343
4280
  }
4344
4281
  return p(d);
4345
4282
  }
4346
- function at(d) {
4283
+ function st(d) {
4347
4284
  if (typeof d != "function")
4348
4285
  throw new TypeError('The "original" argument must be of type Function');
4349
4286
  function p() {
4350
4287
  for (var m = [], S = 0; S < arguments.length; S++)
4351
4288
  m.push(arguments[S]);
4352
- var _ = m.pop();
4353
- if (typeof _ != "function")
4289
+ var C = m.pop();
4290
+ if (typeof C != "function")
4354
4291
  throw new TypeError("The last argument must be of type Function");
4355
- var C = this, E = function() {
4356
- return _.apply(C, arguments);
4292
+ var k = this, A = function() {
4293
+ return C.apply(k, arguments);
4357
4294
  };
4358
4295
  d.apply(this, m).then(
4359
4296
  function(O) {
4360
- A.nextTick(E.bind(null, null, O));
4297
+ w.nextTick(A.bind(null, null, O));
4361
4298
  },
4362
4299
  function(O) {
4363
- A.nextTick(Re.bind(null, O, E));
4300
+ w.nextTick(Re.bind(null, O, A));
4364
4301
  }
4365
4302
  );
4366
4303
  }
@@ -4369,9 +4306,9 @@ var eu = yr.exports;
4369
4306
  e(d)
4370
4307
  ), p;
4371
4308
  }
4372
- t.callbackify = at;
4309
+ t.callbackify = st;
4373
4310
  })(Ft);
4374
- const { inherits: tu, format: Yt } = Ft;
4311
+ const { inherits: ru, format: Yt } = Ft;
4375
4312
  function Oe(t, e, r = Error) {
4376
4313
  if (!t) throw new Error("Avvio error code must not be empty");
4377
4314
  if (!e) throw new Error("Avvio base error message must not be empty");
@@ -4382,9 +4319,9 @@ function Oe(t, e, r = Error) {
4382
4319
  }
4383
4320
  return n.prototype[Symbol.toStringTag] = "Error", n.prototype.toString = function() {
4384
4321
  return `${this.name} [${this.code}]: ${this.message}`;
4385
- }, tu(n, r), n;
4322
+ }, ru(n, r), n;
4386
4323
  }
4387
- var ui = {
4324
+ var ci = {
4388
4325
  createError: Oe,
4389
4326
  AVV_ERR_EXPOSE_ALREADY_DEFINED: Oe(
4390
4327
  "AVV_ERR_EXPOSE_ALREADY_DEFINED",
@@ -4410,7 +4347,7 @@ var ui = {
4410
4347
  "AVV_ERR_READY_TIMEOUT",
4411
4348
  "Plugin did not start in time: '%s'. You may have forgotten to call 'done' function or to resolve a Promise"
4412
4349
  )
4413
- }, ru = function t(e, r, n) {
4350
+ }, nu = function t(e, r, n) {
4414
4351
  r === void 0 && (r = ""), n || (n = {});
4415
4352
  var i = function(u) {
4416
4353
  var f = {
@@ -4428,12 +4365,12 @@ var ui = {
4428
4365
  ` + r + (o.length ? i("│") : " ") + " ";
4429
4366
  return r + s.join(a) + `
4430
4367
  ` + o.map(function(u, f) {
4431
- var c = f === o.length - 1, h = u.nodes && u.nodes.length, l = r + (c ? " " : i("│")) + " ";
4432
- return r + i(c ? "└" : "├") + i("─") + i(h ? "┬" : "─") + " " + t(u, l, n).slice(r.length + 2);
4368
+ var c = f === o.length - 1, l = u.nodes && u.nodes.length, h = r + (c ? " " : i("│")) + " ";
4369
+ return r + i(c ? "└" : "├") + i("─") + i(l ? "┬" : "─") + " " + t(u, h, n).slice(r.length + 2);
4433
4370
  }).join("");
4434
4371
  };
4435
- const nu = ru, pn = Symbol("avvio.TimeTree.untrackNode"), Jt = Symbol("avvio.TimeTree.trackNode"), yn = Symbol("avvio.TimeTree.getParent"), gn = Symbol("avvio.TimeTree.getNode"), mn = Symbol("avvio.TimeTree.addNode");
4436
- let iu = class {
4372
+ const iu = nu, pn = Symbol("avvio.TimeTree.untrackNode"), Jt = Symbol("avvio.TimeTree.trackNode"), yn = Symbol("avvio.TimeTree.getParent"), mn = Symbol("avvio.TimeTree.getNode"), gn = Symbol("avvio.TimeTree.addNode");
4373
+ let ou = class {
4437
4374
  constructor() {
4438
4375
  this.root = null, this.tableId = /* @__PURE__ */ new Map(), this.tableLabel = /* @__PURE__ */ new Map();
4439
4376
  }
@@ -4455,10 +4392,10 @@ let iu = class {
4455
4392
  const r = this.tableLabel.get(e);
4456
4393
  return r.id ? r : r[r.length - 1];
4457
4394
  }
4458
- [gn](e) {
4395
+ [mn](e) {
4459
4396
  return this.tableId.get(e);
4460
4397
  }
4461
- [mn](e, r, n) {
4398
+ [gn](e, r, n) {
4462
4399
  if (e === null)
4463
4400
  return this.root = {
4464
4401
  id: "root",
@@ -4476,10 +4413,10 @@ let iu = class {
4476
4413
  return o.nodes.push(a), this[Jt](a), s;
4477
4414
  }
4478
4415
  start(e, r, n = Date.now()) {
4479
- return this[mn](e, r, n);
4416
+ return this[gn](e, r, n);
4480
4417
  }
4481
4418
  stop(e, r = Date.now()) {
4482
- const n = this[gn](e);
4419
+ const n = this[mn](e);
4483
4420
  n && (n.stop = r, n.diff = n.stop - n.start || 0, this[pn](n));
4484
4421
  }
4485
4422
  toJSON() {
@@ -4487,71 +4424,71 @@ let iu = class {
4487
4424
  }
4488
4425
  prittyPrint() {
4489
4426
  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());
4490
- return nu(r);
4427
+ return iu(r);
4491
4428
  }
4492
4429
  };
4493
- var ou = iu, Pr = { exports: {} }, gr = { exports: {} }, Xt, vn;
4494
- function su() {
4430
+ var su = ou, Pr = { exports: {} }, mr = { exports: {} }, Xt, vn;
4431
+ function au() {
4495
4432
  if (vn) return Xt;
4496
4433
  vn = 1;
4497
4434
  var t = 1e3, e = t * 60, r = e * 60, n = r * 24, i = n * 7, o = n * 365.25;
4498
- Xt = function(c, h) {
4499
- h = h || {};
4500
- var l = typeof c;
4501
- if (l === "string" && c.length > 0)
4435
+ Xt = function(c, l) {
4436
+ l = l || {};
4437
+ var h = typeof c;
4438
+ if (h === "string" && c.length > 0)
4502
4439
  return s(c);
4503
- if (l === "number" && isFinite(c))
4504
- return h.long ? u(c) : a(c);
4440
+ if (h === "number" && isFinite(c))
4441
+ return l.long ? u(c) : a(c);
4505
4442
  throw new Error(
4506
4443
  "val is not a non-empty string or a valid number. val=" + JSON.stringify(c)
4507
4444
  );
4508
4445
  };
4509
4446
  function s(c) {
4510
4447
  if (c = String(c), !(c.length > 100)) {
4511
- var h = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
4448
+ var l = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
4512
4449
  c
4513
4450
  );
4514
- if (h) {
4515
- var l = parseFloat(h[1]), g = (h[2] || "ms").toLowerCase();
4451
+ if (l) {
4452
+ var h = parseFloat(l[1]), g = (l[2] || "ms").toLowerCase();
4516
4453
  switch (g) {
4517
4454
  case "years":
4518
4455
  case "year":
4519
4456
  case "yrs":
4520
4457
  case "yr":
4521
4458
  case "y":
4522
- return l * o;
4459
+ return h * o;
4523
4460
  case "weeks":
4524
4461
  case "week":
4525
4462
  case "w":
4526
- return l * i;
4463
+ return h * i;
4527
4464
  case "days":
4528
4465
  case "day":
4529
4466
  case "d":
4530
- return l * n;
4467
+ return h * n;
4531
4468
  case "hours":
4532
4469
  case "hour":
4533
4470
  case "hrs":
4534
4471
  case "hr":
4535
4472
  case "h":
4536
- return l * r;
4473
+ return h * r;
4537
4474
  case "minutes":
4538
4475
  case "minute":
4539
4476
  case "mins":
4540
4477
  case "min":
4541
4478
  case "m":
4542
- return l * e;
4479
+ return h * e;
4543
4480
  case "seconds":
4544
4481
  case "second":
4545
4482
  case "secs":
4546
4483
  case "sec":
4547
4484
  case "s":
4548
- return l * t;
4485
+ return h * t;
4549
4486
  case "milliseconds":
4550
4487
  case "millisecond":
4551
4488
  case "msecs":
4552
4489
  case "msec":
4553
4490
  case "ms":
4554
- return l;
4491
+ return h;
4555
4492
  default:
4556
4493
  return;
4557
4494
  }
@@ -4559,86 +4496,86 @@ function su() {
4559
4496
  }
4560
4497
  }
4561
4498
  function a(c) {
4562
- var h = Math.abs(c);
4563
- return h >= n ? Math.round(c / n) + "d" : h >= r ? Math.round(c / r) + "h" : h >= e ? Math.round(c / e) + "m" : h >= t ? Math.round(c / t) + "s" : c + "ms";
4499
+ var l = Math.abs(c);
4500
+ return l >= n ? Math.round(c / n) + "d" : l >= r ? Math.round(c / r) + "h" : l >= e ? Math.round(c / e) + "m" : l >= t ? Math.round(c / t) + "s" : c + "ms";
4564
4501
  }
4565
4502
  function u(c) {
4566
- var h = Math.abs(c);
4567
- return h >= n ? f(c, h, n, "day") : h >= r ? f(c, h, r, "hour") : h >= e ? f(c, h, e, "minute") : h >= t ? f(c, h, t, "second") : c + " ms";
4503
+ var l = Math.abs(c);
4504
+ return l >= n ? f(c, l, n, "day") : l >= r ? f(c, l, r, "hour") : l >= e ? f(c, l, e, "minute") : l >= t ? f(c, l, t, "second") : c + " ms";
4568
4505
  }
4569
- function f(c, h, l, g) {
4570
- var v = h >= l * 1.5;
4571
- return Math.round(c / l) + " " + g + (v ? "s" : "");
4506
+ function f(c, l, h, g) {
4507
+ var v = l >= h * 1.5;
4508
+ return Math.round(c / h) + " " + g + (v ? "s" : "");
4572
4509
  }
4573
4510
  return Xt;
4574
4511
  }
4575
- function au(t) {
4576
- r.debug = r, r.default = r, r.coerce = u, r.disable = o, r.enable = i, r.enabled = s, r.humanize = su(), r.destroy = f, Object.keys(t).forEach((c) => {
4512
+ function uu(t) {
4513
+ r.debug = r, r.default = r, r.coerce = u, r.disable = o, r.enable = i, r.enabled = s, r.humanize = au(), r.destroy = f, Object.keys(t).forEach((c) => {
4577
4514
  r[c] = t[c];
4578
4515
  }), r.names = [], r.skips = [], r.formatters = {};
4579
4516
  function e(c) {
4580
- let h = 0;
4581
- for (let l = 0; l < c.length; l++)
4582
- h = (h << 5) - h + c.charCodeAt(l), h |= 0;
4583
- return r.colors[Math.abs(h) % r.colors.length];
4517
+ let l = 0;
4518
+ for (let h = 0; h < c.length; h++)
4519
+ l = (l << 5) - l + c.charCodeAt(h), l |= 0;
4520
+ return r.colors[Math.abs(l) % r.colors.length];
4584
4521
  }
4585
4522
  r.selectColor = e;
4586
4523
  function r(c) {
4587
- let h, l = null, g, v;
4588
- function w(...b) {
4589
- if (!w.enabled)
4524
+ let l, h = null, g, v;
4525
+ function I(...b) {
4526
+ if (!I.enabled)
4590
4527
  return;
4591
- const L = w, R = Number(/* @__PURE__ */ new Date()), Q = R - (h || R);
4592
- L.diff = Q, L.prev = h, L.curr = R, h = R, b[0] = r.coerce(b[0]), typeof b[0] != "string" && b.unshift("%O");
4528
+ const L = I, R = Number(/* @__PURE__ */ new Date()), Q = R - (l || R);
4529
+ L.diff = Q, L.prev = l, L.curr = R, l = R, b[0] = r.coerce(b[0]), typeof b[0] != "string" && b.unshift("%O");
4593
4530
  let X = 0;
4594
4531
  b[0] = b[0].replace(/%([a-zA-Z%])/g, (V, T) => {
4595
4532
  if (V === "%%")
4596
4533
  return "%";
4597
4534
  X++;
4598
- const ie = r.formatters[T];
4599
- if (typeof ie == "function") {
4600
- const oe = b[X];
4601
- V = ie.call(L, oe), b.splice(X, 1), X--;
4535
+ const ne = r.formatters[T];
4536
+ if (typeof ne == "function") {
4537
+ const ie = b[X];
4538
+ V = ne.call(L, ie), b.splice(X, 1), X--;
4602
4539
  }
4603
4540
  return V;
4604
4541
  }), r.formatArgs.call(L, b), (L.log || r.log).apply(L, b);
4605
4542
  }
4606
- return w.namespace = c, w.useColors = r.useColors(), w.color = r.selectColor(c), w.extend = n, w.destroy = r.destroy, Object.defineProperty(w, "enabled", {
4543
+ return I.namespace = c, I.useColors = r.useColors(), I.color = r.selectColor(c), I.extend = n, I.destroy = r.destroy, Object.defineProperty(I, "enabled", {
4607
4544
  enumerable: !0,
4608
4545
  configurable: !1,
4609
- get: () => l !== null ? l : (g !== r.namespaces && (g = r.namespaces, v = r.enabled(c)), v),
4546
+ get: () => h !== null ? h : (g !== r.namespaces && (g = r.namespaces, v = r.enabled(c)), v),
4610
4547
  set: (b) => {
4611
- l = b;
4548
+ h = b;
4612
4549
  }
4613
- }), typeof r.init == "function" && r.init(w), w;
4550
+ }), typeof r.init == "function" && r.init(I), I;
4614
4551
  }
4615
- function n(c, h) {
4616
- const l = r(this.namespace + (typeof h > "u" ? ":" : h) + c);
4617
- return l.log = this.log, l;
4552
+ function n(c, l) {
4553
+ const h = r(this.namespace + (typeof l > "u" ? ":" : l) + c);
4554
+ return h.log = this.log, h;
4618
4555
  }
4619
4556
  function i(c) {
4620
4557
  r.save(c), r.namespaces = c, r.names = [], r.skips = [];
4621
- let h;
4622
- const l = (typeof c == "string" ? c : "").split(/[\s,]+/), g = l.length;
4623
- for (h = 0; h < g; h++)
4624
- l[h] && (c = l[h].replace(/\*/g, ".*?"), c[0] === "-" ? r.skips.push(new RegExp("^" + c.slice(1) + "$")) : r.names.push(new RegExp("^" + c + "$")));
4558
+ let l;
4559
+ const h = (typeof c == "string" ? c : "").split(/[\s,]+/), g = h.length;
4560
+ for (l = 0; l < g; l++)
4561
+ h[l] && (c = h[l].replace(/\*/g, ".*?"), c[0] === "-" ? r.skips.push(new RegExp("^" + c.slice(1) + "$")) : r.names.push(new RegExp("^" + c + "$")));
4625
4562
  }
4626
4563
  function o() {
4627
4564
  const c = [
4628
4565
  ...r.names.map(a),
4629
- ...r.skips.map(a).map((h) => "-" + h)
4566
+ ...r.skips.map(a).map((l) => "-" + l)
4630
4567
  ].join(",");
4631
4568
  return r.enable(""), c;
4632
4569
  }
4633
4570
  function s(c) {
4634
4571
  if (c[c.length - 1] === "*")
4635
4572
  return !0;
4636
- let h, l;
4637
- for (h = 0, l = r.skips.length; h < l; h++)
4638
- if (r.skips[h].test(c))
4573
+ let l, h;
4574
+ for (l = 0, h = r.skips.length; l < h; l++)
4575
+ if (r.skips[l].test(c))
4639
4576
  return !1;
4640
- for (h = 0, l = r.names.length; h < l; h++)
4641
- if (r.names[h].test(c))
4577
+ for (l = 0, h = r.names.length; l < h; l++)
4578
+ if (r.names[l].test(c))
4642
4579
  return !0;
4643
4580
  return !1;
4644
4581
  }
@@ -4653,7 +4590,7 @@ function au(t) {
4653
4590
  }
4654
4591
  return r.enable(r.load()), r;
4655
4592
  }
4656
- var uu = au;
4593
+ var cu = uu;
4657
4594
  (function(t, e) {
4658
4595
  e.formatArgs = n, e.save = i, e.load = o, e.useColors = r, e.storage = s(), e.destroy = /* @__PURE__ */ (() => {
4659
4596
  let u = !1;
@@ -4750,10 +4687,10 @@ var uu = au;
4750
4687
  return;
4751
4688
  const f = "color: " + this.color;
4752
4689
  u.splice(1, 0, f, "color: inherit");
4753
- let c = 0, h = 0;
4754
- u[0].replace(/%[a-zA-Z%]/g, (l) => {
4755
- l !== "%%" && (c++, l === "%c" && (h = c));
4756
- }), u.splice(h, 0, f);
4690
+ let c = 0, l = 0;
4691
+ u[0].replace(/%[a-zA-Z%]/g, (h) => {
4692
+ h !== "%%" && (c++, h === "%c" && (l = c));
4693
+ }), u.splice(l, 0, f);
4757
4694
  }
4758
4695
  e.log = console.debug || console.log || (() => {
4759
4696
  });
@@ -4769,7 +4706,7 @@ var uu = au;
4769
4706
  u = e.storage.getItem("debug");
4770
4707
  } catch {
4771
4708
  }
4772
- return !u && typeof A < "u" && "env" in A && (u = A.env.DEBUG), u;
4709
+ return !u && typeof w < "u" && "env" in w && (u = w.env.DEBUG), u;
4773
4710
  }
4774
4711
  function s() {
4775
4712
  try {
@@ -4777,7 +4714,7 @@ var uu = au;
4777
4714
  } catch {
4778
4715
  }
4779
4716
  }
4780
- t.exports = uu(e);
4717
+ t.exports = cu(e);
4781
4718
  const { formatters: a } = t.exports;
4782
4719
  a.j = function(u) {
4783
4720
  try {
@@ -4786,29 +4723,29 @@ var uu = au;
4786
4723
  return "[UnexpectedJSONParseError]: " + f.message;
4787
4724
  }
4788
4725
  };
4789
- })(gr, gr.exports);
4790
- var ci = gr.exports;
4791
- const cu = Vn, lu = Gn.EventEmitter, du = Ft.inherits, j = ci("avvio"), { AVV_ERR_READY_TIMEOUT: fu } = ui, Zt = Symbol.for("plugin-meta");
4792
- function hu(t, e) {
4726
+ })(mr, mr.exports);
4727
+ var li = mr.exports;
4728
+ const lu = $n, du = Kn.EventEmitter, fu = Ft.inherits, j = li("avvio"), { AVV_ERR_READY_TIMEOUT: hu } = ci, Zt = Symbol.for("plugin-meta");
4729
+ function pu(t, e) {
4793
4730
  return t[Zt] && t[Zt].name ? t[Zt].name : typeof e < "u" && typeof e != "function" && e.name ? e.name : t.name ? t.name : t.toString().split(`
4794
4731
  `).slice(0, 2).map((r) => r.trim()).join(" -- ");
4795
4732
  }
4796
- function pu() {
4733
+ function yu() {
4797
4734
  const t = {};
4798
4735
  return t.promise = new Promise((e, r) => {
4799
4736
  t.resolve = e, t.reject = r;
4800
4737
  }), t;
4801
4738
  }
4802
4739
  function We(t, e, r, n, i) {
4803
- this.started = !1, this.func = e, this.opts = r, this.onFinish = null, this.parent = t, this.timeout = i === void 0 ? t._timeout : i, this.name = hu(e, r), this.isAfter = n, this.q = cu(t, yu, 1), this.q.pause(), this._error = null, this.loaded = !1, this._promise = null;
4740
+ this.started = !1, this.func = e, this.opts = r, this.onFinish = null, this.parent = t, this.timeout = i === void 0 ? t._timeout : i, this.name = pu(e, r), this.isAfter = n, this.q = lu(t, mu, 1), this.q.pause(), this._error = null, this.loaded = !1, this._promise = null;
4804
4741
  }
4805
- du(We, lu);
4742
+ fu(We, du);
4806
4743
  We.prototype.exec = function(t, e) {
4807
4744
  const r = this.func;
4808
4745
  let n = !1;
4809
4746
  const i = this.name;
4810
4747
  if (this.parent._error && !this.isAfter) {
4811
- j("skipping loading of plugin as parent errored and it is not an after", i), A.nextTick(e);
4748
+ j("skipping loading of plugin as parent errored and it is not an after", i), w.nextTick(e);
4812
4749
  return;
4813
4750
  }
4814
4751
  if (this.isAfter)
@@ -4830,13 +4767,13 @@ We.prototype.exec = function(t, e) {
4830
4767
  };
4831
4768
  this.timeout > 0 && (j("setting up timeout", i, this.timeout), o = setTimeout(function() {
4832
4769
  j("timed out", i), o = null;
4833
- const u = new fu(i);
4770
+ const u = new hu(i);
4834
4771
  u.fn = r, s(u);
4835
4772
  }, this.timeout)), this.started = !0, this.emit("start", this.server ? this.server.name : null, this.name, Date.now());
4836
4773
  const a = r(this.server, this.opts, s);
4837
4774
  a && typeof a.then == "function" && (j("exec: resolving promise", i), a.then(
4838
- () => A.nextTick(s),
4839
- (u) => A.nextTick(s, u)
4775
+ () => w.nextTick(s),
4776
+ (u) => w.nextTick(s, u)
4840
4777
  ));
4841
4778
  };
4842
4779
  We.prototype.loadedSoFar = function() {
@@ -4844,11 +4781,11 @@ We.prototype.loadedSoFar = function() {
4844
4781
  return Promise.resolve();
4845
4782
  const t = () => {
4846
4783
  this.server.after((r, n) => {
4847
- this._error = r, this.q.pause(), r ? (j("rejecting promise", this.name, r), this._promise.reject(r)) : (j("resolving promise", this.name), this._promise.resolve()), this._promise = null, A.nextTick(n, r);
4784
+ this._error = r, this.q.pause(), r ? (j("rejecting promise", this.name, r), this._promise.reject(r)) : (j("resolving promise", this.name), this._promise.resolve()), this._promise = null, w.nextTick(n, r);
4848
4785
  }), this.q.resume();
4849
4786
  };
4850
4787
  let e;
4851
- return this._promise ? e = Promise.resolve() : (this._promise = pu(), e = this._promise.promise, this.server ? t() : this.on("start", t)), e;
4788
+ return this._promise ? e = Promise.resolve() : (this._promise = yu(), e = this._promise.promise, this.server ? t() : this.on("start", t)), e;
4852
4789
  };
4853
4790
  We.prototype.enqueue = function(t, e) {
4854
4791
  j("enqueue", this.name, t.name), this.emit("enqueue", this.server ? this.server.name : null, this.name, Date.now()), this.q.push(t, e);
@@ -4878,9 +4815,9 @@ We.prototype.finish = function(t, e) {
4878
4815
  };
4879
4816
  queueMicrotask(n), this.q.resume();
4880
4817
  };
4881
- function yu(t, e) {
4818
+ function mu(t, e) {
4882
4819
  const r = this;
4883
- A.nextTick(Nr.bind(r), t, e);
4820
+ w.nextTick(Nr.bind(r), t, e);
4884
4821
  }
4885
4822
  function Nr(t, e) {
4886
4823
  if (typeof t.func.then == "function") {
@@ -4900,15 +4837,15 @@ function gu() {
4900
4837
  }
4901
4838
  Pr.exports = We;
4902
4839
  Pr.exports.loadPlugin = Nr;
4903
- var mu = Pr.exports;
4904
- const bn = Vn, vu = Gn.EventEmitter, bu = Ft.inherits, {
4840
+ var vu = Pr.exports;
4841
+ const bn = $n, bu = Kn.EventEmitter, Su = Ft.inherits, {
4905
4842
  AVV_ERR_EXPOSE_ALREADY_DEFINED: er,
4906
4843
  AVV_ERR_CALLBACK_NOT_FN: et,
4907
- AVV_ERR_PLUGIN_NOT_VALID: Su,
4908
- AVV_ERR_ROOT_PLG_BOOTED: wu,
4909
- AVV_ERR_READY_TIMEOUT: Au
4910
- } = ui, Eu = ou, mr = mu, ze = ci("avvio"), Lt = Symbol("kAvvio"), tr = Symbol("kThenifyDoNotWrap");
4911
- function Iu(t, e, r) {
4844
+ AVV_ERR_PLUGIN_NOT_VALID: wu,
4845
+ AVV_ERR_ROOT_PLG_BOOTED: Au,
4846
+ AVV_ERR_READY_TIMEOUT: Eu
4847
+ } = ci, Iu = su, gr = vu, ze = li("avvio"), _t = Symbol("kAvvio"), tr = Symbol("kThenifyDoNotWrap");
4848
+ function Tu(t, e, r) {
4912
4849
  const n = e.expose || {}, i = n.use || "use", o = n.after || "after", s = n.ready || "ready", a = n.onClose || "onClose", u = n.close || "close";
4913
4850
  if (t[i])
4914
4851
  throw new er(i);
@@ -4918,7 +4855,7 @@ function Iu(t, e, r) {
4918
4855
  throw new er(s);
4919
4856
  t[i] = function(f, c) {
4920
4857
  return r.use(f, c), this;
4921
- }, Object.defineProperty(t, "then", { get: li.bind(r) }), t[Lt] = !0, t[o] = function(f) {
4858
+ }, Object.defineProperty(t, "then", { get: di.bind(r) }), t[_t] = !0, t[o] = function(f) {
4922
4859
  return typeof f != "function" ? r._loadRegistered() : (r.after(rr(f, this)), this);
4923
4860
  }, t[s] = function(f) {
4924
4861
  if (f && typeof f != "function")
@@ -4927,28 +4864,28 @@ function Iu(t, e, r) {
4927
4864
  }, t[a] = function(f) {
4928
4865
  if (typeof f != "function")
4929
4866
  throw new et(a, typeof f);
4930
- return r.onClose(Cu(f, this)), this;
4867
+ return r.onClose(ku(f, this)), this;
4931
4868
  }, t[u] = function(f) {
4932
4869
  if (f && typeof f != "function")
4933
4870
  throw new et(u, typeof f);
4934
4871
  return f ? (r.close(rr(f, this)), this) : r.close();
4935
4872
  };
4936
4873
  }
4937
- function q(t, e, r) {
4938
- if (typeof t == "function" && arguments.length === 1 && (r = t, e = {}, t = null), typeof e == "function" && (r = e, e = {}), e = e || {}, !(this instanceof q)) {
4939
- const n = new q(t, e, r);
4940
- return t && Iu(t, e, n), n;
4874
+ function B(t, e, r) {
4875
+ if (typeof t == "function" && arguments.length === 1 && (r = t, e = {}, t = null), typeof e == "function" && (r = e, e = {}), e = e || {}, !(this instanceof B)) {
4876
+ const n = new B(t, e, r);
4877
+ return t && Tu(t, e, n), n;
4941
4878
  }
4942
- 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 Eu(), this._readyQ = bn(this, di, 1), this._readyQ.pause(), this._readyQ.drain = () => {
4879
+ 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 Iu(), this._readyQ = bn(this, fi, 1), this._readyQ.pause(), this._readyQ.drain = () => {
4943
4880
  this.emit("start"), this._readyQ.drain = Sn;
4944
4881
  }, this._closeQ = bn(this, Lu, 1), this._closeQ.pause(), this._closeQ.drain = () => {
4945
4882
  this.emit("close"), this._closeQ.drain = Sn;
4946
- }, this._doStart = null, this._root = new mr(this, Tu.bind(this), e, !1, 0), this._root.once("start", (n, i, o) => {
4883
+ }, this._doStart = null, this._root = new gr(this, Ou.bind(this), e, !1, 0), this._root.once("start", (n, i, o) => {
4947
4884
  const s = this.pluginTree.start(null, i, o);
4948
4885
  this._root.once("loaded", (a, u, f) => {
4949
4886
  this.pluginTree.stop(s, f);
4950
4887
  });
4951
- }), mr.loadPlugin.call(this, this._root, (n) => {
4888
+ }), gr.loadPlugin.call(this, this._root, (n) => {
4952
4889
  ze("root plugin ready");
4953
4890
  try {
4954
4891
  this.emit("preReady"), this._root = null;
@@ -4963,38 +4900,38 @@ function q(t, e, r) {
4963
4900
  this._readyQ.resume();
4964
4901
  });
4965
4902
  }
4966
- function Tu(t, e, r) {
4903
+ function Ou(t, e, r) {
4967
4904
  this._doStart = r, e.autostart && this.start();
4968
4905
  }
4969
- bu(q, vu);
4970
- q.prototype.start = function() {
4971
- return this.started = !0, A.nextTick(this._doStart), this;
4906
+ Su(B, bu);
4907
+ B.prototype.start = function() {
4908
+ return this.started = !0, w.nextTick(this._doStart), this;
4972
4909
  };
4973
- q.prototype.override = function(t, e, r) {
4910
+ B.prototype.override = function(t, e, r) {
4974
4911
  return t;
4975
4912
  };
4976
- function Ou(t) {
4913
+ function _u(t) {
4977
4914
  if (t && typeof t == "object" && typeof t.default == "function" && (t = t.default), !(t && (typeof t == "function" || typeof t.then == "function")))
4978
- throw new Su(typeof t);
4915
+ throw new wu(typeof t);
4979
4916
  return t;
4980
4917
  }
4981
- q.prototype[Lt] = !0;
4982
- q.prototype.use = function(t, e) {
4918
+ B.prototype[_t] = !0;
4919
+ B.prototype.use = function(t, e) {
4983
4920
  return this._lastUsed = this._addPlugin(t, e, !1), this;
4984
4921
  };
4985
- q.prototype._loadRegistered = function() {
4922
+ B.prototype._loadRegistered = function() {
4986
4923
  const t = this._current[0];
4987
- return !this.started && !this.booted && A.nextTick(() => this._root.q.resume()), t ? t.loadedSoFar() : Promise.resolve();
4924
+ return !this.started && !this.booted && w.nextTick(() => this._root.q.resume()), t ? t.loadedSoFar() : Promise.resolve();
4988
4925
  };
4989
- Object.defineProperty(q.prototype, "then", { get: li });
4990
- q.prototype._addPlugin = function(t, e, r) {
4991
- if (t = Ou(t), e = e || {}, this.booted)
4992
- throw new wu();
4993
- const n = this._current[0], i = new mr(this, t, e, r);
4926
+ Object.defineProperty(B.prototype, "then", { get: di });
4927
+ B.prototype._addPlugin = function(t, e, r) {
4928
+ if (t = _u(t), e = e || {}, this.booted)
4929
+ throw new Au();
4930
+ const n = this._current[0], i = new gr(this, t, e, r);
4994
4931
  if (i.once("start", (o, s, a) => {
4995
4932
  const u = this.pluginTree.start(n.name, s, a);
4996
- i.once("loaded", (f, c, h) => {
4997
- this.pluginTree.stop(u, h);
4933
+ i.once("loaded", (f, c, l) => {
4934
+ this.pluginTree.stop(u, l);
4998
4935
  });
4999
4936
  }), n.loaded)
5000
4937
  throw new Error(i.name, n.name);
@@ -5002,16 +4939,16 @@ q.prototype._addPlugin = function(t, e, r) {
5002
4939
  o && (this._error = o);
5003
4940
  }), i;
5004
4941
  };
5005
- q.prototype.after = function(t) {
4942
+ B.prototype.after = function(t) {
5006
4943
  if (!t)
5007
4944
  return this._loadRegistered();
5008
4945
  this._addPlugin(e.bind(this), {}, !0);
5009
4946
  function e(r, n, i) {
5010
- di.call(this, t, i);
4947
+ fi.call(this, t, i);
5011
4948
  }
5012
4949
  return this;
5013
4950
  };
5014
- q.prototype.onClose = function(t) {
4951
+ B.prototype.onClose = function(t) {
5015
4952
  if (typeof t != "function")
5016
4953
  throw new Error("not a function");
5017
4954
  t[this._isOnCloseHandlerKey] = !0, this._closeQ.unshift(t, e.bind(this));
@@ -5020,7 +4957,7 @@ q.prototype.onClose = function(t) {
5020
4957
  }
5021
4958
  return this;
5022
4959
  };
5023
- q.prototype.close = function(t) {
4960
+ B.prototype.close = function(t) {
5024
4961
  let e;
5025
4962
  if (t) {
5026
4963
  if (typeof t != "function")
@@ -5034,10 +4971,10 @@ q.prototype.close = function(t) {
5034
4971
  };
5035
4972
  });
5036
4973
  return this.ready(() => {
5037
- this._error = null, this._closeQ.push(t), A.nextTick(this._closeQ.resume.bind(this._closeQ));
4974
+ this._error = null, this._closeQ.push(t), w.nextTick(this._closeQ.resume.bind(this._closeQ));
5038
4975
  }), e;
5039
4976
  };
5040
- q.prototype.ready = function(t) {
4977
+ B.prototype.ready = function(t) {
5041
4978
  if (t) {
5042
4979
  if (typeof t != "function")
5043
4980
  throw new et("ready", typeof t);
@@ -5048,19 +4985,19 @@ q.prototype.ready = function(t) {
5048
4985
  this._readyQ.push(i), this.start();
5049
4986
  const n = this._current[0].server;
5050
4987
  function i(o, s, a) {
5051
- o ? r(o) : e(n), A.nextTick(a);
4988
+ o ? r(o) : e(n), w.nextTick(a);
5052
4989
  }
5053
4990
  });
5054
4991
  };
5055
- q.prototype.prettyPrint = function() {
4992
+ B.prototype.prettyPrint = function() {
5056
4993
  return this.pluginTree.prittyPrint();
5057
4994
  };
5058
- q.prototype.toJSON = function() {
4995
+ B.prototype.toJSON = function() {
5059
4996
  return this.pluginTree.toJSON();
5060
4997
  };
5061
4998
  function Sn() {
5062
4999
  }
5063
- function li() {
5000
+ function di() {
5064
5001
  if (this.booted) {
5065
5002
  ze("thenify returning null because we are already booted");
5066
5003
  return;
@@ -5071,27 +5008,27 @@ function li() {
5071
5008
  }
5072
5009
  return ze("thenify"), (t, e) => this._loadRegistered().then(() => (this[tr] = !0, t(this._server)), e);
5073
5010
  }
5074
- function di(t, e) {
5011
+ function fi(t, e) {
5075
5012
  const r = this._server, n = this._error;
5076
5013
  let i;
5077
5014
  if (this._error = null, t.length === 0)
5078
- this._error = n, i = t(), i && !i[Lt] && typeof i.then == "function" ? i.then(() => A.nextTick(e), (o) => A.nextTick(e, o)) : A.nextTick(e);
5015
+ this._error = n, i = t(), i && !i[_t] && typeof i.then == "function" ? i.then(() => w.nextTick(e), (o) => w.nextTick(e, o)) : w.nextTick(e);
5079
5016
  else if (t.length === 1)
5080
- i = t(n), i && !i[Lt] && typeof i.then == "function" ? i.then(() => A.nextTick(e), (o) => A.nextTick(e, o)) : A.nextTick(e);
5017
+ i = t(n), i && !i[_t] && typeof i.then == "function" ? i.then(() => w.nextTick(e), (o) => w.nextTick(e, o)) : w.nextTick(e);
5081
5018
  else if (this._timeout === 0) {
5082
5019
  const o = (s) => {
5083
5020
  this._error = s, e(this._error);
5084
5021
  };
5085
5022
  t.length === 2 ? t(n, o) : t(n, r, o);
5086
5023
  } else
5087
- _u.call(this, t, n, r, e);
5024
+ Cu.call(this, t, n, r, e);
5088
5025
  }
5089
- function _u(t, e, r, n) {
5026
+ function Cu(t, e, r, n) {
5090
5027
  const i = t.name;
5091
5028
  ze("setting up ready timeout", i, this._timeout);
5092
5029
  let o = setTimeout(() => {
5093
5030
  ze("timed out", i), o = null;
5094
- const a = new Au(i);
5031
+ const a = new Eu(i);
5095
5032
  a.fn = t, this._error = a, n(a);
5096
5033
  }, this._timeout);
5097
5034
  t.length === 2 ? t(e, s.bind(this)) : t(e, r, s.bind(this));
@@ -5104,20 +5041,20 @@ function Lu(t, e) {
5104
5041
  if (t.length === 0 || t.length === 1) {
5105
5042
  let i;
5106
5043
  n ? i = t(r) : i = t(this._error), i && typeof i.then == "function" ? (ze("resolving close/onClose promise"), i.then(
5107
- () => A.nextTick(e),
5108
- (o) => A.nextTick(e, o)
5109
- )) : A.nextTick(e);
5044
+ () => w.nextTick(e),
5045
+ (o) => w.nextTick(e, o)
5046
+ )) : w.nextTick(e);
5110
5047
  } else t.length === 2 ? t(n ? r : this._error, e) : n ? t(r, e) : t(this._error, r, e);
5111
5048
  }
5112
- function Cu(t, e) {
5049
+ function ku(t, e) {
5113
5050
  return r.bind(e);
5114
5051
  function r(n, i) {
5115
5052
  let o;
5116
5053
  t.length === 0 ? (o = t(), o && o.then ? o.then(function() {
5117
- A.nextTick(i);
5118
- }, i) : A.nextTick(i)) : t.length === 1 ? (o = t(this), o && o.then ? o.then(function() {
5119
- A.nextTick(i);
5120
- }, i) : A.nextTick(i)) : t(this, i);
5054
+ w.nextTick(i);
5055
+ }, i) : w.nextTick(i)) : t.length === 1 ? (o = t(this), o && o.then ? o.then(function() {
5056
+ w.nextTick(i);
5057
+ }, i) : w.nextTick(i)) : t(this, i);
5121
5058
  }
5122
5059
  }
5123
5060
  function rr(t, e) {
@@ -5125,22 +5062,22 @@ function rr(t, e) {
5125
5062
  function r(n, i) {
5126
5063
  let o;
5127
5064
  t ? t.length === 0 ? (o = t(), o && o.then ? o.then(function() {
5128
- A.nextTick(i, n);
5129
- }, i) : A.nextTick(i, n)) : t.length === 1 ? (o = t(n), o && o.then ? o.then(function() {
5130
- A.nextTick(i);
5131
- }, i) : A.nextTick(i)) : t.length === 2 ? t(n, i) : t(n, this, i) : A.nextTick(i);
5065
+ w.nextTick(i, n);
5066
+ }, i) : w.nextTick(i, n)) : t.length === 1 ? (o = t(n), o && o.then ? o.then(function() {
5067
+ w.nextTick(i);
5068
+ }, i) : w.nextTick(i)) : t.length === 2 ? t(n, i) : t(n, this, i) : w.nextTick(i);
5132
5069
  }
5133
5070
  }
5134
- Sr.exports = q;
5071
+ Sr.exports = B;
5135
5072
  Sr.exports.express = function(t) {
5136
- return q(t, {
5073
+ return B(t, {
5137
5074
  expose: {
5138
5075
  use: "load"
5139
5076
  }
5140
5077
  });
5141
5078
  };
5142
- var ku = Sr.exports;
5143
- const Pu = /* @__PURE__ */ os(ku);
5079
+ var Pu = Sr.exports;
5080
+ const Nu = /* @__PURE__ */ ss(Pu);
5144
5081
  (function() {
5145
5082
  if (window.requestAnimationFrame && window.cancelAnimationFrame)
5146
5083
  return;
@@ -5158,9 +5095,9 @@ const Pu = /* @__PURE__ */ os(ku);
5158
5095
  }, window.cancelAnimationFrame = clearTimeout;
5159
5096
  }
5160
5097
  })();
5161
- function tc(t, e = !0, r = !0, n) {
5162
- 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 = Pu(/* @__PURE__ */ Object.create({}), { autostart: !1 });
5163
- return s.use(Ro), s.use(Co, { onDeepLinkHandled: n?.onDeepLinkHandled }), s.use(Fo, { videoPlayerController: n?.videoPlayerController }), s.use(Do, { onContentActivate: n?.onContentActivate }), s.use(Hi, { sdkKey: t, host: i, analyticsHost: o, version: n?.version }), s.use(Zi), s.use(No), s.use(Ho), s.use(bo), s.use(is), s.after((a, u, f) => {
5098
+ function rc(t, e = !0, r = !0, n) {
5099
+ 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 = Nu(/* @__PURE__ */ Object.create({}), { autostart: !1 });
5100
+ return s.use(Vo), s.use(Lo, { onDeepLinkHandled: n?.onDeepLinkHandled }), s.use(Fo, { videoPlayerController: n?.videoPlayerController }), s.use(Ro, { onContentActivate: n?.onContentActivate }), s.use(Wi, { sdkKey: t, host: i, analyticsHost: o, version: n?.version }), s.use(eo), s.use(No), s.use(Wo), s.use(bo), s.use(os), s.after((a, u, f) => {
5164
5101
  if (a)
5165
5102
  throw a;
5166
5103
  u.ready(), f();
@@ -5173,5 +5110,5 @@ function tc(t, e = !0, r = !0, n) {
5173
5110
  }), s;
5174
5111
  }
5175
5112
  export {
5176
- tc as StreamLayer
5113
+ rc as StreamLayer
5177
5114
  };