@streamlayer/sdk-web 1.10.0 → 1.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +5 -5
- package/lib/es/index.js +382 -371
- package/package.json +11 -11
package/lib/es/index.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { pino as
|
|
2
|
-
import { QuestionType as I, QuestionStatus as G, PromotionType as q, NotificationEnabled as Br, SilenceSetting as
|
|
1
|
+
import { pino as Ii } from "pino";
|
|
2
|
+
import { QuestionType as I, QuestionStatus as G, PromotionType as q, NotificationEnabled as Br, SilenceSetting as Oi, UseAsNotification as Ti } from "@streamlayer/sl-eslib/interactive/interactive.common_pb";
|
|
3
3
|
import { PickHistoryStatus as lt } from "@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb";
|
|
4
4
|
import { SdkOverlayType as R } from "@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb";
|
|
5
5
|
import { InvitationCategory as Mr, InvitationFrom as Ur } from "@streamlayer/sl-eslib/analytics/v1/invitations/invitations_pb";
|
|
6
|
-
import { computed as
|
|
6
|
+
import { computed as _i, map as ki, atom as Lt, batched as qr, onMount as wr } from "nanostores";
|
|
7
7
|
import { v4 as or } from "uuid";
|
|
8
|
-
import { ConnectError as
|
|
8
|
+
import { ConnectError as it, Code as oe, createContextKey as jr, createClient as xr, createContextValues as Pi } from "@connectrpc/connect";
|
|
9
9
|
import { createGrpcWebTransport as Qr } from "@connectrpc/connect-web";
|
|
10
10
|
import { nanoquery as Gr } from "@nanostores/query";
|
|
11
|
-
import { Events as
|
|
11
|
+
import { Events as Cn } from "@streamlayer/sl-eslib/sports/events/events_connect";
|
|
12
12
|
import { Client as ot } from "@streamlayer/sl-eslib/sdkSettings/client/client_connect";
|
|
13
13
|
import { Users as Ar } from "@streamlayer/sl-eslib/users/users_connect";
|
|
14
14
|
import { Feed as ee } from "@streamlayer/sl-eslib/interactive/feed/interactive.feed_connect";
|
|
15
|
-
import { Leaderboard as
|
|
15
|
+
import { Leaderboard as Ln } from "@streamlayer/sl-eslib/interactive/leaderboard/interactive.leaderboard_connect";
|
|
16
16
|
import "@streamlayer/sl-eslib/interactive/leaderboard/interactive.leaderboard_pb";
|
|
17
|
-
import { LinksClient as
|
|
17
|
+
import { LinksClient as Ci } from "@streamlayer/sl-eslib/shortLinks/linksClient_connect";
|
|
18
18
|
import { Kind as K, TopicSubType as J, TopicType as Q, PollOpenedFrom as X, Category as W, ScreenOrientation as Kr } from "@streamlayer/sl-eslib/analytics/v1/common/analytics.common_pb";
|
|
19
|
-
import { AnalyticsService as
|
|
19
|
+
import { AnalyticsService as Nn } from "@streamlayer/sl-eslib/analytics/v2/streaming/streaming_connect";
|
|
20
20
|
import { InteractionActionType as zr } from "@streamlayer/sl-eslib/analytics/v1/interactions/interactions_pb";
|
|
21
21
|
import { NotificationKind as me, NotificationType as Hr } from "@streamlayer/sl-eslib/analytics/v1/notifications/notifications_pb";
|
|
22
|
-
function
|
|
22
|
+
function Li(t) {
|
|
23
23
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
24
24
|
}
|
|
25
|
-
var
|
|
25
|
+
var Fn = { exports: {} }, M = Fn.exports = {}, de, le;
|
|
26
26
|
function sr() {
|
|
27
27
|
throw new Error("setTimeout has not been defined");
|
|
28
28
|
}
|
|
@@ -41,7 +41,7 @@ function ar() {
|
|
|
41
41
|
le = ar;
|
|
42
42
|
}
|
|
43
43
|
})();
|
|
44
|
-
function
|
|
44
|
+
function Dn(t) {
|
|
45
45
|
if (de === setTimeout)
|
|
46
46
|
return setTimeout(t, 0);
|
|
47
47
|
if ((de === sr || !de) && setTimeout)
|
|
@@ -56,7 +56,7 @@ function Fn(t) {
|
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function Ni(t) {
|
|
60
60
|
if (le === clearTimeout)
|
|
61
61
|
return clearTimeout(t);
|
|
62
62
|
if ((le === ar || !le) && clearTimeout)
|
|
@@ -72,19 +72,19 @@ function Li(t) {
|
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
var we = [], Qe = !1, Pe, yt = -1;
|
|
75
|
-
function
|
|
76
|
-
!Qe || !Pe || (Qe = !1, Pe.length ? we = Pe.concat(we) : yt = -1, we.length &&
|
|
75
|
+
function Fi() {
|
|
76
|
+
!Qe || !Pe || (Qe = !1, Pe.length ? we = Pe.concat(we) : yt = -1, we.length && Rn());
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function Rn() {
|
|
79
79
|
if (!Qe) {
|
|
80
|
-
var t =
|
|
80
|
+
var t = Dn(Fi);
|
|
81
81
|
Qe = !0;
|
|
82
82
|
for (var e = we.length; e; ) {
|
|
83
83
|
for (Pe = we, we = []; ++yt < e; )
|
|
84
84
|
Pe && Pe[yt].run();
|
|
85
85
|
yt = -1, e = we.length;
|
|
86
86
|
}
|
|
87
|
-
Pe = null, Qe = !1,
|
|
87
|
+
Pe = null, Qe = !1, Ni(t);
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
M.nextTick = function(t) {
|
|
@@ -92,12 +92,12 @@ M.nextTick = function(t) {
|
|
|
92
92
|
if (arguments.length > 1)
|
|
93
93
|
for (var r = 1; r < arguments.length; r++)
|
|
94
94
|
e[r - 1] = arguments[r];
|
|
95
|
-
we.push(new
|
|
95
|
+
we.push(new Vn(t, e)), we.length === 1 && !Qe && Dn(Rn);
|
|
96
96
|
};
|
|
97
|
-
function
|
|
97
|
+
function Vn(t, e) {
|
|
98
98
|
this.fun = t, this.array = e;
|
|
99
99
|
}
|
|
100
|
-
|
|
100
|
+
Vn.prototype.run = function() {
|
|
101
101
|
this.fun.apply(null, this.array);
|
|
102
102
|
};
|
|
103
103
|
M.title = "browser";
|
|
@@ -132,8 +132,8 @@ M.chdir = function(t) {
|
|
|
132
132
|
M.umask = function() {
|
|
133
133
|
return 0;
|
|
134
134
|
};
|
|
135
|
-
var
|
|
136
|
-
const E = /* @__PURE__ */
|
|
135
|
+
var Di = Fn.exports;
|
|
136
|
+
const E = /* @__PURE__ */ Li(Di), Ri = Ii({
|
|
137
137
|
level: "trace",
|
|
138
138
|
enabled: typeof window < "u" && !!window.localStorage.getItem("SL_DEBUG"),
|
|
139
139
|
browser: {
|
|
@@ -141,23 +141,23 @@ const E = /* @__PURE__ */ Ci(Fi), Di = Ei({
|
|
|
141
141
|
console.log(t);
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
|
-
}), pe = (t, e) =>
|
|
145
|
-
class
|
|
144
|
+
}), pe = (t, e) => Ri.child({ name: t }, e);
|
|
145
|
+
class Vi extends Event {
|
|
146
146
|
slEventBus;
|
|
147
147
|
constructor(e, r) {
|
|
148
148
|
super(e), this.slEventBus = r;
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
|
-
const
|
|
152
|
-
class
|
|
151
|
+
const $i = pe("event-bus");
|
|
152
|
+
class Bi {
|
|
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
|
|
160
|
-
|
|
159
|
+
const n = new Vi(this.name, { ...r, type: e });
|
|
160
|
+
$i.debug(n, "Emitting event"), window.dispatchEvent(n);
|
|
161
161
|
};
|
|
162
162
|
listen(e) {
|
|
163
163
|
return window.addEventListener(this.name, e), this.listeners.add(e), () => {
|
|
@@ -173,7 +173,7 @@ class $i {
|
|
|
173
173
|
}), this.listeners.clear();
|
|
174
174
|
};
|
|
175
175
|
}
|
|
176
|
-
class
|
|
176
|
+
class Mi {
|
|
177
177
|
}
|
|
178
178
|
var Ae;
|
|
179
179
|
(function(t) {
|
|
@@ -196,9 +196,9 @@ class Nt {
|
|
|
196
196
|
return this.store;
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
|
-
const
|
|
199
|
+
const Ui = (t) => {
|
|
200
200
|
const e = Object.keys(t);
|
|
201
|
-
return
|
|
201
|
+
return _i(e.map((r) => t[r].getStore()), (...r) => Object.fromEntries(e.map((n, i) => [n, r[i]])));
|
|
202
202
|
};
|
|
203
203
|
class Ce extends Nt {
|
|
204
204
|
getValues = () => this.getStore().get();
|
|
@@ -207,22 +207,22 @@ class Ce extends Nt {
|
|
|
207
207
|
subscribe = (...e) => this.getStore().subscribe(...e);
|
|
208
208
|
unsubscribe = () => this.getStore().off();
|
|
209
209
|
}
|
|
210
|
-
const Z = (t) =>
|
|
210
|
+
const Z = (t) => ki(t);
|
|
211
211
|
var be;
|
|
212
212
|
(function(t) {
|
|
213
213
|
t.ORGANIZATION = "ORGANIZATION", t.STREAM = "STREAM";
|
|
214
214
|
})(be || (be = {}));
|
|
215
|
-
const
|
|
215
|
+
const qi = {
|
|
216
216
|
[R.BETTING]: "betting",
|
|
217
217
|
[R.GAMES]: "games",
|
|
218
218
|
[R.PUBLIC_CHAT]: "publicChat",
|
|
219
219
|
[R.TWITTER]: "twitter"
|
|
220
220
|
};
|
|
221
|
-
var
|
|
221
|
+
var tt;
|
|
222
222
|
(function(t) {
|
|
223
223
|
t.Ready = "ready", t.Suspended = "suspended";
|
|
224
|
-
})(
|
|
225
|
-
class
|
|
224
|
+
})(tt || (tt = {}));
|
|
225
|
+
class $n {
|
|
226
226
|
status;
|
|
227
227
|
source;
|
|
228
228
|
config;
|
|
@@ -230,7 +230,7 @@ class Vn {
|
|
|
230
230
|
listeners = /* @__PURE__ */ new Set();
|
|
231
231
|
settingsKey;
|
|
232
232
|
constructor({ settings: e, ...r }, n) {
|
|
233
|
-
this.settingsKey =
|
|
233
|
+
this.settingsKey = qi[r.type], this.status = Lt(tt.Suspended), this.config = new Ce(Z(r), `feature:config:${this.settingsKey}`), this.settingsKey !== void 0 && e?.overlaySettings.case === this.settingsKey ? this.settings = new Ce(Z(e.overlaySettings.value), `feature:settings:${this.settingsKey}`) : this.settings = new Ce(Z({}), `feature:settings:${this.settingsKey}`), this.source = n;
|
|
234
234
|
}
|
|
235
235
|
get featureConfig() {
|
|
236
236
|
return this.config.getStore();
|
|
@@ -242,10 +242,10 @@ class Vn {
|
|
|
242
242
|
this.listeners.add(e);
|
|
243
243
|
}
|
|
244
244
|
enable = () => {
|
|
245
|
-
this.status.set(
|
|
245
|
+
this.status.set(tt.Ready);
|
|
246
246
|
};
|
|
247
247
|
disable = () => {
|
|
248
|
-
this.status.set(
|
|
248
|
+
this.status.set(tt.Suspended);
|
|
249
249
|
};
|
|
250
250
|
setFeatureConfig = ({ settings: e, ...r }) => {
|
|
251
251
|
let n;
|
|
@@ -319,8 +319,8 @@ class se extends Nt {
|
|
|
319
319
|
key = () => this.getStore().key;
|
|
320
320
|
off = () => this.getStore().off();
|
|
321
321
|
}
|
|
322
|
-
const B = new
|
|
323
|
-
async function*
|
|
322
|
+
const B = new Bi();
|
|
323
|
+
async function* ji(t, e) {
|
|
324
324
|
for await (const r of e) {
|
|
325
325
|
t.response.message = r, t.received_at = Date.now(), t.id = Date.now();
|
|
326
326
|
const n = {
|
|
@@ -330,7 +330,7 @@ async function* qi(t, e) {
|
|
|
330
330
|
window.postMessage(n), yield r;
|
|
331
331
|
}
|
|
332
332
|
}
|
|
333
|
-
const
|
|
333
|
+
const xi = () => (t) => async (e) => {
|
|
334
334
|
const r = {
|
|
335
335
|
id: Date.now(),
|
|
336
336
|
name: e.url,
|
|
@@ -359,7 +359,7 @@ const ji = () => (t) => async (e) => {
|
|
|
359
359
|
};
|
|
360
360
|
return window.postMessage(i), {
|
|
361
361
|
...n,
|
|
362
|
-
message:
|
|
362
|
+
message: ji(r, n.message)
|
|
363
363
|
};
|
|
364
364
|
} else {
|
|
365
365
|
r.response.message = n.message, r.latency = r.received_at - r.sent_at;
|
|
@@ -383,7 +383,7 @@ const ji = () => (t) => async (e) => {
|
|
|
383
383
|
}
|
|
384
384
|
};
|
|
385
385
|
window.dispatchEvent(new CustomEvent("grpc_devtools_loaded"));
|
|
386
|
-
function
|
|
386
|
+
function Bn(t) {
|
|
387
387
|
return t instanceof DOMException && // everything except Firefox
|
|
388
388
|
(t.code === 22 || // Firefox
|
|
389
389
|
t.code === 1014 || // test name field too, because code might not be present
|
|
@@ -391,7 +391,7 @@ function $n(t) {
|
|
|
391
391
|
t.name === "QuotaExceededError" || // Firefox
|
|
392
392
|
t.name === "NS_ERROR_DOM_QUOTA_REACHED");
|
|
393
393
|
}
|
|
394
|
-
class
|
|
394
|
+
class Je {
|
|
395
395
|
delimiter = ":";
|
|
396
396
|
prefix;
|
|
397
397
|
storage;
|
|
@@ -408,7 +408,7 @@ class We {
|
|
|
408
408
|
try {
|
|
409
409
|
this.storage.setItem(n, r);
|
|
410
410
|
} catch (i) {
|
|
411
|
-
|
|
411
|
+
Bn(i) && this.storage === window.sessionStorage && (window.sessionStorage.removeItem("slstreamlogs"), this.storage.setItem(n, r));
|
|
412
412
|
}
|
|
413
413
|
};
|
|
414
414
|
read = (...e) => {
|
|
@@ -424,7 +424,7 @@ var ie;
|
|
|
424
424
|
t.Init = "init", t.Ready = "ready", t.Connecting = "connecting", t.Connected = "connected", t.Disconnected = "disconnected", t.Failed = "failed", t.Reconnect = "reconnect", t.Reconnecting = "reconnecting";
|
|
425
425
|
})(ie || (ie = {}));
|
|
426
426
|
const Wr = pe("grpc:stream");
|
|
427
|
-
class
|
|
427
|
+
class Qi {
|
|
428
428
|
params;
|
|
429
429
|
streamCancel;
|
|
430
430
|
method;
|
|
@@ -463,7 +463,7 @@ class xi {
|
|
|
463
463
|
window.sessionStorage.setItem("slstreamlogs", window.sessionStorage.getItem("slstreamlogs") + `
|
|
464
464
|
` + n);
|
|
465
465
|
} catch (i) {
|
|
466
|
-
|
|
466
|
+
Bn(i) && window.sessionStorage.removeItem("slstreamlogs"), window.sessionStorage.setItem("slstreamlogs", n);
|
|
467
467
|
}
|
|
468
468
|
}
|
|
469
469
|
};
|
|
@@ -485,7 +485,7 @@ class xi {
|
|
|
485
485
|
for await (const o of i)
|
|
486
486
|
this.attempt = 0, this.onData(o);
|
|
487
487
|
} catch (n) {
|
|
488
|
-
n instanceof
|
|
488
|
+
n instanceof it && n.code != oe.Canceled && this.onStreamError(n);
|
|
489
489
|
}
|
|
490
490
|
})(), this.updateState(ie.Connected);
|
|
491
491
|
};
|
|
@@ -525,7 +525,7 @@ class xi {
|
|
|
525
525
|
*/
|
|
526
526
|
onStreamError = (e) => {
|
|
527
527
|
if (this.addStateLog(`error => ${e ? JSON.stringify(e) : "undefined"}}`), e !== void 0) {
|
|
528
|
-
if (e instanceof
|
|
528
|
+
if (e instanceof it && e.code !== oe.Canceled) {
|
|
529
529
|
this.updateState(ie.Failed), this.state.setValue("error", e), e.code === oe.Unknown && e.cause === "missing trailer" && (this.attempt = 0), this.reconnect();
|
|
530
530
|
return;
|
|
531
531
|
}
|
|
@@ -533,7 +533,7 @@ class xi {
|
|
|
533
533
|
}
|
|
534
534
|
};
|
|
535
535
|
}
|
|
536
|
-
const
|
|
536
|
+
const Gi = /* @__PURE__ */ new Set([
|
|
537
537
|
oe.Unknown,
|
|
538
538
|
oe.Internal,
|
|
539
539
|
oe.DeadlineExceeded,
|
|
@@ -541,7 +541,7 @@ const Qi = /* @__PURE__ */ new Set([
|
|
|
541
541
|
oe.FailedPrecondition,
|
|
542
542
|
oe.Unavailable,
|
|
543
543
|
oe.DataLoss
|
|
544
|
-
]), Yr = pe("grpc:retry"),
|
|
544
|
+
]), Yr = pe("grpc:retry"), Ki = (t) => async (e) => {
|
|
545
545
|
const r = e.contextValues.get(ur.retryAttempts), n = 300, i = e.contextValues.get(ur.retryDelay);
|
|
546
546
|
if (e.stream || r === 0)
|
|
547
547
|
return t(e);
|
|
@@ -551,8 +551,8 @@ const Qi = /* @__PURE__ */ new Set([
|
|
|
551
551
|
return await t(e);
|
|
552
552
|
} catch (s) {
|
|
553
553
|
Yr.trace({ attempt: o, error: s, url: e.url }, "retry attempt");
|
|
554
|
-
const a =
|
|
555
|
-
if (o >= r || !(a instanceof
|
|
554
|
+
const a = it.from(s);
|
|
555
|
+
if (o >= r || !(a instanceof it) || !Gi.has(a.code))
|
|
556
556
|
throw s;
|
|
557
557
|
const u = Math.min(i, Math.pow(2, o) * n), d = Math.round(u * (1 + Math.random()) / 2);
|
|
558
558
|
await new Promise((c) => setTimeout(c, d));
|
|
@@ -560,13 +560,13 @@ const Qi = /* @__PURE__ */ new Set([
|
|
|
560
560
|
}, ur = {
|
|
561
561
|
retryAttempts: jr(10, { description: "Number of attempts to retry" }),
|
|
562
562
|
retryDelay: jr(3e4, { description: "Max delay between retries in milliseconds" })
|
|
563
|
-
},
|
|
563
|
+
}, zi = () => {
|
|
564
564
|
const t = localStorage.getItem("sl-device-id");
|
|
565
565
|
if (t)
|
|
566
566
|
return t;
|
|
567
567
|
const e = or();
|
|
568
568
|
return localStorage.setItem("sl-device-id", e), e;
|
|
569
|
-
},
|
|
569
|
+
}, Hi = () => navigator.userAgentData?.platform || navigator.platform;
|
|
570
570
|
class Jr {
|
|
571
571
|
toJsonOptions = {
|
|
572
572
|
emitDefaultValues: !1,
|
|
@@ -587,8 +587,8 @@ class Jr {
|
|
|
587
587
|
opts;
|
|
588
588
|
constructor(e, r) {
|
|
589
589
|
this.host = e, this.opts = r, this.$headers = new Ce(Z({
|
|
590
|
-
"sl-device-id":
|
|
591
|
-
"sl-device-os":
|
|
590
|
+
"sl-device-id": zi(),
|
|
591
|
+
"sl-device-os": Hi()
|
|
592
592
|
}), "transport:headers"), this.initInterceptors(), this.clients = /* @__PURE__ */ new Map(), this.streamClients = /* @__PURE__ */ new Map(), this.subscriptions = /* @__PURE__ */ new Map();
|
|
593
593
|
const [n, i, o] = Gr({
|
|
594
594
|
dedupeTime: r?.dedupeTime,
|
|
@@ -612,7 +612,7 @@ class Jr {
|
|
|
612
612
|
const i = this.subscriptions.get(r);
|
|
613
613
|
if (i)
|
|
614
614
|
return i;
|
|
615
|
-
const o = new
|
|
615
|
+
const o = new Qi(this.$headers, e, r, n);
|
|
616
616
|
return this.subscriptions.set(r, o), o;
|
|
617
617
|
};
|
|
618
618
|
removeSubscription = (e) => {
|
|
@@ -657,7 +657,7 @@ class Jr {
|
|
|
657
657
|
...Array.isArray(r) ? r : [r]
|
|
658
658
|
], a = [e.typeName, o.charAt(0).toLowerCase() + o.slice(1)];
|
|
659
659
|
return { client: i, createRequestOptions: (d) => {
|
|
660
|
-
const c =
|
|
660
|
+
const c = Pi();
|
|
661
661
|
for (const f in d) {
|
|
662
662
|
const p = ur[f];
|
|
663
663
|
c.set(p, d[f]);
|
|
@@ -685,11 +685,11 @@ class Jr {
|
|
|
685
685
|
n.header.set(o, i[o]);
|
|
686
686
|
return r(n);
|
|
687
687
|
};
|
|
688
|
-
this.interceptors.push(e), this.interceptors.push(
|
|
688
|
+
this.interceptors.push(e), this.interceptors.push(xi()), this.opts?.retryable && this.interceptors.push(Ki);
|
|
689
689
|
};
|
|
690
690
|
}
|
|
691
|
-
const
|
|
692
|
-
const { client: r, queryKey: n } = e.createPromiseClient(
|
|
691
|
+
const Wi = (t, e) => {
|
|
692
|
+
const { client: r, queryKey: n } = e.createPromiseClient(Cn, {
|
|
693
693
|
method: "retrieveEventId",
|
|
694
694
|
params: [t]
|
|
695
695
|
});
|
|
@@ -706,7 +706,7 @@ const Hi = (t, e) => {
|
|
|
706
706
|
}
|
|
707
707
|
}
|
|
708
708
|
});
|
|
709
|
-
},
|
|
709
|
+
}, Yi = (t, e) => {
|
|
710
710
|
const { client: r, queryKey: n } = e.createPromiseClient(ot, { method: "getStream", params: [t] });
|
|
711
711
|
return e.nanoquery.createFetcherStore(n, {
|
|
712
712
|
fetcher: async (i, o, s) => s ? (await r.getStream({
|
|
@@ -714,30 +714,32 @@ const Hi = (t, e) => {
|
|
|
714
714
|
// we are sure that id is a string
|
|
715
715
|
})).data?.attributes : void 0
|
|
716
716
|
});
|
|
717
|
-
},
|
|
718
|
-
const { client: r, queryKey: n } = e.createPromiseClient(
|
|
717
|
+
}, Ji = (t, e) => {
|
|
718
|
+
const { client: r, queryKey: n } = e.createPromiseClient(Cn, { method: "summary", params: [t] });
|
|
719
719
|
return e.nanoquery.createFetcherStore(n, {
|
|
720
720
|
fetcher: async (i, o, s) => s ? (await r.summary({
|
|
721
721
|
id: s
|
|
722
722
|
})).data?.attributes : void 0
|
|
723
723
|
});
|
|
724
|
-
},
|
|
724
|
+
}, Xi = (t, e) => {
|
|
725
725
|
const { queryKey: r, client: n } = e.createPromiseClient(Ar, { method: "me", params: [t] });
|
|
726
726
|
return e.nanoquery.createFetcherStore(r, {
|
|
727
727
|
fetcher: async () => {
|
|
728
|
-
|
|
729
|
-
|
|
728
|
+
if (!e.getHeader("authorization"))
|
|
729
|
+
return { data: void 0 };
|
|
730
|
+
const { data: o } = await n.me({});
|
|
731
|
+
return { data: o };
|
|
730
732
|
}
|
|
731
733
|
});
|
|
732
|
-
},
|
|
734
|
+
}, Zi = (t) => {
|
|
733
735
|
const { client: e, createRequestOptions: r } = t.createPromiseClient(Ar, { method: "bypassAuth" }), n = r({ retryAttempts: 0 });
|
|
734
736
|
return ({ userKey: i, schema: o, init: s, inviterKey: a }) => e.bypassAuth({ userKey: i, schema: o, init: s, inviterKey: a }, { contextValues: n });
|
|
735
|
-
},
|
|
737
|
+
}, eo = (t, e) => {
|
|
736
738
|
const { client: r, queryKey: n } = e.createPromiseClient(ot, { method: "get", params: [t] });
|
|
737
739
|
return e.nanoquery.createFetcherStore(n, {
|
|
738
740
|
fetcher: async () => (await r.get({})).data?.attributes
|
|
739
741
|
});
|
|
740
|
-
},
|
|
742
|
+
}, to = (t, e) => {
|
|
741
743
|
const { client: r, queryKey: n } = e.createPromiseClient(ot, { method: "getOrganization", params: [t] });
|
|
742
744
|
return e.nanoquery.createFetcherStore(n, {
|
|
743
745
|
fetcher: async () => {
|
|
@@ -748,7 +750,7 @@ const Hi = (t, e) => {
|
|
|
748
750
|
} : void 0;
|
|
749
751
|
}
|
|
750
752
|
});
|
|
751
|
-
},
|
|
753
|
+
}, ro = (t, e) => {
|
|
752
754
|
const { client: r, queryKey: n } = e.createPromiseClient(ot, {
|
|
753
755
|
method: "getOrganizationAdvertising",
|
|
754
756
|
params: [t]
|
|
@@ -756,7 +758,7 @@ const Hi = (t, e) => {
|
|
|
756
758
|
return e.nanoquery.createFetcherStore(n, {
|
|
757
759
|
fetcher: async () => (await r.getOrganizationAdvertising({})).data?.attributes
|
|
758
760
|
});
|
|
759
|
-
},
|
|
761
|
+
}, no = (t, e, r) => {
|
|
760
762
|
t.transport = new Jr(e.host, {
|
|
761
763
|
dedupeTime: 1e3 * 60 * 5,
|
|
762
764
|
refetchInterval: 1e3 * 60 * 5,
|
|
@@ -771,7 +773,7 @@ var ge;
|
|
|
771
773
|
(function(t) {
|
|
772
774
|
t.SCHEMA = "schema", t.EXTERNAL_TOKEN = "eToken", t.TOKEN = "token";
|
|
773
775
|
})(ge || (ge = {}));
|
|
774
|
-
class je extends
|
|
776
|
+
class je extends Je {
|
|
775
777
|
constructor() {
|
|
776
778
|
super("user");
|
|
777
779
|
}
|
|
@@ -798,19 +800,19 @@ var ve;
|
|
|
798
800
|
(function(t) {
|
|
799
801
|
t.DISABLED = "disabled", t.INITIALIZATION = "initialization", t.READY = "ready", t.FAILED = "failed", t.SUSPENDED = "suspended";
|
|
800
802
|
})(ve || (ve = {}));
|
|
801
|
-
const
|
|
802
|
-
const e = new je(), r = new re(U(e.getExternalToken()), "userKey"), n = new re(U(e.getToken()), "userToken"), i = new se(
|
|
803
|
+
const io = (t) => {
|
|
804
|
+
const e = new je(), r = new re(U(e.getExternalToken()), "userKey"), n = new re(U(e.getToken()), "userToken"), i = new se(Xi(n.getStore(), t), "user", ({ data: s, error: a, loading: u }, d) => {
|
|
803
805
|
if (!a)
|
|
804
806
|
return s?.data?.id ? s.data.id : u === !1 ? void 0 : d;
|
|
805
|
-
}), o = new se(
|
|
807
|
+
}), o = new se(eo(n.getStore(), t), "userSettings");
|
|
806
808
|
return {
|
|
807
809
|
userKey: r,
|
|
808
810
|
userToken: n,
|
|
809
811
|
user: i,
|
|
810
812
|
userSettings: o
|
|
811
813
|
};
|
|
812
|
-
},
|
|
813
|
-
const e = new re(U(void 0), "providerStreamId"), r = new se(
|
|
814
|
+
}, oo = (t) => {
|
|
815
|
+
const e = new re(U(void 0), "providerStreamId"), r = new se(Wi(e.getStore(), t), "slStreamId", (o) => o?.data), n = new se(Yi(r.getAtomStore(), t), "streamSettings"), i = new se(Ji(r.getAtomStore(), t), "streamSettings");
|
|
814
816
|
return r.getAtomStore().listen((o) => {
|
|
815
817
|
(o === "" || o === void 0) && (n.getStore().mutate(void 0), i.getStore().mutate(void 0));
|
|
816
818
|
}), {
|
|
@@ -819,8 +821,8 @@ const no = (t) => {
|
|
|
819
821
|
streamSettings: n,
|
|
820
822
|
streamSummary: i
|
|
821
823
|
};
|
|
822
|
-
},
|
|
823
|
-
const e = new re(U(void 0), "enabled"), r = new re(U(ve.DISABLED), "status"), n = new se(
|
|
824
|
+
}, so = (t) => {
|
|
825
|
+
const e = new re(U(void 0), "enabled"), r = new re(U(ve.DISABLED), "status"), n = new se(to(e.getStore(), t), "organizationSettings", (a) => a?.data?.id), i = new se(ro(n.getAtomStore(), t), "organizationAdvertising"), o = io(t), s = oo(t);
|
|
824
826
|
return {
|
|
825
827
|
enabled: e,
|
|
826
828
|
status: r,
|
|
@@ -836,10 +838,10 @@ const no = (t) => {
|
|
|
836
838
|
organizationAdvertising: i
|
|
837
839
|
};
|
|
838
840
|
};
|
|
839
|
-
class
|
|
841
|
+
class ao extends Nt {
|
|
840
842
|
stores;
|
|
841
843
|
constructor(e) {
|
|
842
|
-
const r =
|
|
844
|
+
const r = so(e), n = Ui(r);
|
|
843
845
|
super(n, "core"), this.stores = r;
|
|
844
846
|
}
|
|
845
847
|
getValue() {
|
|
@@ -860,17 +862,17 @@ class so extends Nt {
|
|
|
860
862
|
};
|
|
861
863
|
unsubscribe = () => this.getStore().off();
|
|
862
864
|
}
|
|
863
|
-
const
|
|
864
|
-
t.store = new
|
|
865
|
+
const uo = (t, e, r) => {
|
|
866
|
+
t.store = new ao(t.transport), t.stores = t.store.getValues(), t.sdk.enabled = t.stores.enabled.getStore(), t.sdk.status = t.stores.status.getStore(), t.sdk.sdkStore = Object.fromEntries(Object.entries(t.stores).map(([n, i]) => [n, i.getStore()])), t.sdk.organizationStore = () => t.stores.organizationSettings.getStore(), t.sdk.streamStore = () => t.stores.streamSettings.getStore(), t.sdk.streamSummary = () => t.stores.streamSummary.getStore(), t.storeUnsubscribe = () => {
|
|
865
867
|
t.store.unsubscribe();
|
|
866
868
|
}, r();
|
|
867
|
-
},
|
|
868
|
-
const { client: e } = t.createPromiseClient(
|
|
869
|
+
}, co = (t) => {
|
|
870
|
+
const { client: e } = t.createPromiseClient(Ln, { method: "list" });
|
|
869
871
|
return (r) => e.list(r);
|
|
870
|
-
},
|
|
871
|
-
const { client: e } = t.createPromiseClient(
|
|
872
|
+
}, Mn = (t) => {
|
|
873
|
+
const { client: e } = t.createPromiseClient(Ln, { method: "summary" });
|
|
872
874
|
return (r) => e.summary(r);
|
|
873
|
-
},
|
|
875
|
+
}, lo = (t, e) => {
|
|
874
876
|
const { client: r, queryKey: n } = e.createPromiseClient(Ar, {
|
|
875
877
|
method: "getFriends",
|
|
876
878
|
params: [t]
|
|
@@ -886,7 +888,7 @@ const ao = (t, e, r) => {
|
|
|
886
888
|
}
|
|
887
889
|
}
|
|
888
890
|
});
|
|
889
|
-
},
|
|
891
|
+
}, fo = (t, e) => {
|
|
890
892
|
const { client: r, queryKey: n } = e.createPromiseClient(ee, { method: "get", params: [t] });
|
|
891
893
|
return e.nanoquery.createFetcherStore(n, {
|
|
892
894
|
fetcher: async (i, o, s) => (await r.get({
|
|
@@ -895,7 +897,7 @@ const ao = (t, e, r) => {
|
|
|
895
897
|
refetchInterval: 0,
|
|
896
898
|
dedupeTime: 1e3 * 60 * 60
|
|
897
899
|
});
|
|
898
|
-
},
|
|
900
|
+
}, po = (t, e, r) => {
|
|
899
901
|
const { client: n, queryKey: i } = r.createPromiseClient(ee, {
|
|
900
902
|
method: "syncQuestion",
|
|
901
903
|
params: [t, e ? "true" : ""]
|
|
@@ -916,17 +918,17 @@ const ao = (t, e, r) => {
|
|
|
916
918
|
// 10 minutes
|
|
917
919
|
refetchInterval: 0
|
|
918
920
|
});
|
|
919
|
-
},
|
|
921
|
+
}, ho = async (t, e) => {
|
|
920
922
|
const { client: r } = e.createPromiseClient(ee, { method: "item", params: [t] });
|
|
921
923
|
return (await r.item({
|
|
922
924
|
id: t
|
|
923
925
|
})).data;
|
|
924
|
-
},
|
|
926
|
+
}, yo = (t, e) => {
|
|
925
927
|
const { client: r } = e.createStreamClient(ee), n = Lt({ eventId: t.get() || "", feedId: "" });
|
|
926
928
|
return t.subscribe((o = "") => {
|
|
927
929
|
n.set({ eventId: o, feedId: "" });
|
|
928
930
|
}), e.addSubscription(r.subscription, n, { name: "feedSubscription" });
|
|
929
|
-
},
|
|
931
|
+
}, mo = (t, e) => {
|
|
930
932
|
const { client: r } = e.createStreamClient(ee);
|
|
931
933
|
return e.addSubscription(r.questionSubscription, { questionId: t }, { name: "questionSubscription" });
|
|
932
934
|
}, cr = async (t, e) => {
|
|
@@ -934,7 +936,7 @@ const ao = (t, e, r) => {
|
|
|
934
936
|
return (await r.questionByUser({
|
|
935
937
|
questionId: t
|
|
936
938
|
})).data?.attributes?.question;
|
|
937
|
-
},
|
|
939
|
+
}, Ge = (t, e) => {
|
|
938
940
|
const { client: r, queryKey: n } = e.createPromiseClient(ee, { method: "questionByUser", params: [t] });
|
|
939
941
|
return e.nanoquery.createFetcherStore(n, {
|
|
940
942
|
fetcher: async (i, o, s) => (await r.questionByUser({
|
|
@@ -942,7 +944,7 @@ const ao = (t, e, r) => {
|
|
|
942
944
|
})).data?.attributes?.question,
|
|
943
945
|
dedupeTime: 1e3 * 60 * 5
|
|
944
946
|
});
|
|
945
|
-
},
|
|
947
|
+
}, Un = async (t, e) => {
|
|
946
948
|
if (!t)
|
|
947
949
|
return;
|
|
948
950
|
const { client: r } = e.createPromiseClient(ee, { method: "getQuestion", params: [t] }), n = await r.getQuestion({
|
|
@@ -952,7 +954,7 @@ const ao = (t, e, r) => {
|
|
|
952
954
|
return;
|
|
953
955
|
const { options: i, notification: o, ...s } = n.data.attributes, a = i?.options.case === "promotion" ? i?.options.value : void 0;
|
|
954
956
|
return { id: s.id, question: s, promotion: a, notification: o };
|
|
955
|
-
},
|
|
957
|
+
}, go = (t, e, r, n) => {
|
|
956
958
|
const { client: i, queryKey: o } = n.createPromiseClient(ee, {
|
|
957
959
|
method: "list",
|
|
958
960
|
params: [t, e, r ? "true" : ""]
|
|
@@ -968,7 +970,7 @@ const ao = (t, e, r) => {
|
|
|
968
970
|
dedupeTime: 0,
|
|
969
971
|
refetchInterval: 0
|
|
970
972
|
});
|
|
971
|
-
},
|
|
973
|
+
}, bo = (t, e) => {
|
|
972
974
|
const { client: r, queryKey: n } = e.createPromiseClient(ee, {
|
|
973
975
|
method: "list",
|
|
974
976
|
params: [t]
|
|
@@ -989,12 +991,12 @@ const ao = (t, e, r) => {
|
|
|
989
991
|
}
|
|
990
992
|
})).data?.[0];
|
|
991
993
|
if (u.type === "promotion")
|
|
992
|
-
return
|
|
994
|
+
return Un(u.id, e);
|
|
993
995
|
},
|
|
994
996
|
dedupeTime: 0,
|
|
995
997
|
refetchInterval: 0
|
|
996
998
|
});
|
|
997
|
-
},
|
|
999
|
+
}, vo = (t, e, r, n, i) => {
|
|
998
1000
|
const { client: o, queryKey: s } = i.createPromiseClient(ee, {
|
|
999
1001
|
method: "betPack",
|
|
1000
1002
|
params: [t, e, r]
|
|
@@ -1034,14 +1036,14 @@ const ao = (t, e, r) => {
|
|
|
1034
1036
|
dedupeTime: 0,
|
|
1035
1037
|
refetchInterval: 0
|
|
1036
1038
|
});
|
|
1037
|
-
},
|
|
1039
|
+
}, So = (t, e, r) => {
|
|
1038
1040
|
const n = qr([e, r], () => {
|
|
1039
1041
|
const a = e.get();
|
|
1040
1042
|
if (!a)
|
|
1041
1043
|
return;
|
|
1042
1044
|
const u = r.get().data?.find((c) => c.id === a?.questionId), d = a?.question?.openedFrom;
|
|
1043
1045
|
return u ? (u.openedFrom = d, u) : a.question;
|
|
1044
|
-
}), i = qr(n, (a) => a && a.type === "question" ? a.id : void 0), o =
|
|
1046
|
+
}), i = qr(n, (a) => a && a.type === "question" ? a.id : void 0), o = Ge(i, t);
|
|
1045
1047
|
return { $store: n, $extendedStore: o, updateExtendedQuestion: (a) => {
|
|
1046
1048
|
const u = o.get().data, d = (c, f) => {
|
|
1047
1049
|
if (!c || !f)
|
|
@@ -1070,7 +1072,7 @@ var At;
|
|
|
1070
1072
|
(function(t) {
|
|
1071
1073
|
t.SHOWED = "showed";
|
|
1072
1074
|
})(At || (At = {}));
|
|
1073
|
-
class
|
|
1075
|
+
class wo extends Je {
|
|
1074
1076
|
constructor() {
|
|
1075
1077
|
super("advertisement");
|
|
1076
1078
|
}
|
|
@@ -1079,7 +1081,7 @@ class So extends We {
|
|
|
1079
1081
|
};
|
|
1080
1082
|
isViewed = (e) => this.read(At.SHOWED, e);
|
|
1081
1083
|
}
|
|
1082
|
-
const
|
|
1084
|
+
const Ao = (t) => {
|
|
1083
1085
|
const e = t.data?.attributes?.question;
|
|
1084
1086
|
if ((t.data?.attributes?.feedItem?.type === "promotion" ? t.data.attributes.feedItem : void 0) === void 0 || !e)
|
|
1085
1087
|
return;
|
|
@@ -1090,7 +1092,7 @@ const wo = (t) => {
|
|
|
1090
1092
|
notification: i,
|
|
1091
1093
|
promotion: s
|
|
1092
1094
|
};
|
|
1093
|
-
}, ft = (t) => t.startsWith("http://") || t.startsWith("https://") ? new URL(t).toString() : t,
|
|
1095
|
+
}, ft = (t) => t.startsWith("http://") || t.startsWith("https://") ? new URL(t).toString() : t, Eo = ({ gamOptions: t, gamBaseUrl: e }) => {
|
|
1094
1096
|
const r = `${e}?`, n = [];
|
|
1095
1097
|
for (const i in t) {
|
|
1096
1098
|
const o = i.replace(/([a-zA-Z])(?=[A-Z])/g, "$1_").toLowerCase(), s = t[i];
|
|
@@ -1105,9 +1107,9 @@ const wo = (t) => {
|
|
|
1105
1107
|
}
|
|
1106
1108
|
}
|
|
1107
1109
|
return r + n.join("&");
|
|
1108
|
-
}, Be = (t) => (t?.promotion?.type === q.INGAME_IAB11_LBAR || t?.promotion?.type === q.INGAME_IAB21_LBAR) && !!t.promotion.additionalBanner?.imageUrl,
|
|
1110
|
+
}, Be = (t) => (t?.promotion?.type === q.INGAME_IAB11_LBAR || t?.promotion?.type === q.INGAME_IAB21_LBAR) && !!t.promotion.additionalBanner?.imageUrl, Io = (t, e, r) => {
|
|
1109
1111
|
let n = !1;
|
|
1110
|
-
const i = r.transport, o = pe("advertisement"), s = new
|
|
1112
|
+
const i = r.transport, o = pe("advertisement"), s = new wo(), a = Z({}), u = bo(t, i), d = (m) => {
|
|
1111
1113
|
const g = a.get(), S = g.data?.question.id, F = g.data?.promotion?.type;
|
|
1112
1114
|
S && (B.emit("advertisement", {
|
|
1113
1115
|
action: "opened",
|
|
@@ -1144,7 +1146,7 @@ const wo = (t) => {
|
|
|
1144
1146
|
close: () => p(g.question.id),
|
|
1145
1147
|
togglePause: (S) => v(g.question.id, S),
|
|
1146
1148
|
isViewed: !!s.isViewed(g.question.id)
|
|
1147
|
-
}) : (a.setKey("loading", !0),
|
|
1149
|
+
}) : (a.setKey("loading", !0), Un(m, i).then((S) => a.set({
|
|
1148
1150
|
loading: !1,
|
|
1149
1151
|
error: void 0,
|
|
1150
1152
|
data: S,
|
|
@@ -1161,7 +1163,7 @@ const wo = (t) => {
|
|
|
1161
1163
|
a.subscribe((m, g) => {
|
|
1162
1164
|
if (!(m.data?.id === g?.data?.id && m.isPaused !== g?.isPaused)) {
|
|
1163
1165
|
if (m.data?.promotion?.type === q.EXTERNAL_AD && !m?.externalAd && m.data.promotion.adCampaigns?.gamOptions && m.data.promotion.adCampaigns?.gamBaseUrl) {
|
|
1164
|
-
const S =
|
|
1166
|
+
const S = Eo(m.data.promotion.adCampaigns);
|
|
1165
1167
|
a.setKey("externalAd", { type: "gam", url: S });
|
|
1166
1168
|
}
|
|
1167
1169
|
m.data?.promotion && !m.isOpened && (B.emit("advertisement", {
|
|
@@ -1204,7 +1206,7 @@ const wo = (t) => {
|
|
|
1204
1206
|
n || (n = !0, u.subscribe((m, g) => {
|
|
1205
1207
|
m.data && (!g?.data || m.data.id !== g.data.id) && f(m.data.question.id, m.data);
|
|
1206
1208
|
}), e.addListener("promotion", (m) => {
|
|
1207
|
-
const g =
|
|
1209
|
+
const g = Ao(m);
|
|
1208
1210
|
if (g) {
|
|
1209
1211
|
if (g.question.status === G.RESOLVED) {
|
|
1210
1212
|
p(g.question.id), o.debug({ promotion: g }, "resolved: %o");
|
|
@@ -1223,7 +1225,7 @@ var ce;
|
|
|
1223
1225
|
(function(t) {
|
|
1224
1226
|
t.ONBOARDING = "onboarding", t.ONBOARDING_IO = "onboarding_io", t.BET_PACK_ITEM_RECEIVED = "bp-item-received", t.QUESTION_OPENED = "q-opened";
|
|
1225
1227
|
})(ce || (ce = {}));
|
|
1226
|
-
class
|
|
1228
|
+
class Oo extends Je {
|
|
1227
1229
|
constructor() {
|
|
1228
1230
|
super("gamification-session", window.sessionStorage);
|
|
1229
1231
|
}
|
|
@@ -1232,10 +1234,10 @@ class Io extends We {
|
|
|
1232
1234
|
};
|
|
1233
1235
|
readValue = (e) => this.read(...e);
|
|
1234
1236
|
}
|
|
1235
|
-
class
|
|
1237
|
+
class To extends Je {
|
|
1236
1238
|
sessionStorage;
|
|
1237
1239
|
constructor() {
|
|
1238
|
-
super("gamification"), this.sessionStorage = new
|
|
1240
|
+
super("gamification"), this.sessionStorage = new Oo();
|
|
1239
1241
|
}
|
|
1240
1242
|
saveBetPackQuestionReceived = ({ userId: e, eventId: r, organizationId: n }, i) => {
|
|
1241
1243
|
this.write(ce.BET_PACK_ITEM_RECEIVED, n, e, r, i);
|
|
@@ -1258,7 +1260,7 @@ var Oe;
|
|
|
1258
1260
|
(function(t) {
|
|
1259
1261
|
t.ALLOWED = "allowed", t.DISALLOWED = "disallowed";
|
|
1260
1262
|
})(Oe || (Oe = {}));
|
|
1261
|
-
class
|
|
1263
|
+
class _o {
|
|
1262
1264
|
/** sl event id */
|
|
1263
1265
|
slStreamId;
|
|
1264
1266
|
/** organization id */
|
|
@@ -1293,15 +1295,15 @@ class To {
|
|
|
1293
1295
|
transport;
|
|
1294
1296
|
cancels = /* @__PURE__ */ new Set();
|
|
1295
1297
|
constructor(e) {
|
|
1296
|
-
this.transport = e.transport, this.log = pe("gamification-background"), this.storage = new
|
|
1298
|
+
this.transport = e.transport, this.log = pe("gamification-background"), this.storage = new To(), this.slStreamId = e.stores.slStreamId.getAtomStore(), this.organizationId = e.stores.organizationSettings.getAtomStore(), this.userId = e.stores.user.getAtomStore(), this.moderationId = new re(U(void 0), "moderationId").getStore(), this.interactiveAllowed = new re(U(Oe.DISALLOWED), "interactiveAllowed").getStore(), this.openedQuestionId = new re(U(void 0), "openedQuestionId").getStore(), this.notifications = e.notifications, this.moderation = new se(fo(this.slStreamId, e.transport), "gamification:moderation");
|
|
1297
1299
|
const r = !!e.sdk.options.get().betPack;
|
|
1298
|
-
this.feedList = new se(
|
|
1299
|
-
this.log.debug({ item: n }, "received question"), n?.questionId ? (this.questionSubscription =
|
|
1300
|
+
this.feedList = new se(go(this.slStreamId, this.interactiveAllowed, r, e.transport), "gamification:feedList"), this.betPack = new se(vo(this.slStreamId, this.userId, this.organizationId, this.storage, e.transport), "gamification:betPack"), this.activeQuestionId = po(this.slStreamId, r, e.transport), this.openedQuestion = So(e.transport, this.openedQuestionId, this.feedList.getStore()), this.cancels.add(this.openedQuestionId.listen((n) => {
|
|
1301
|
+
this.log.debug({ item: n }, "received question"), n?.questionId ? (this.questionSubscription = mo(n.questionId, e.transport), this.questionSubscription.addListener("feed-subscription-opened-question", async (i) => {
|
|
1300
1302
|
const o = i.data?.attributes?.question;
|
|
1301
1303
|
if (this.openedQuestion.updateExtendedQuestion(o), o?.type === I.PREDICTION && (o.status === G.ACTIVE || o.status === G.RESOLVED)) {
|
|
1302
1304
|
const s = this.betPack.getValues().data || {};
|
|
1303
1305
|
if (s?.[o.id] || Object.keys(s).length < 5) {
|
|
1304
|
-
const u =
|
|
1306
|
+
const u = Ge(o.id, this.transport), d = u.subscribe(() => {
|
|
1305
1307
|
});
|
|
1306
1308
|
await u.get().promise;
|
|
1307
1309
|
let c = u.get().data;
|
|
@@ -1314,12 +1316,12 @@ class To {
|
|
|
1314
1316
|
}
|
|
1315
1317
|
}
|
|
1316
1318
|
}), this.questionSubscription.connect()) : (this.log.info("cleanup on close question"), this.questionSubscription !== void 0 && (e.transport.removeSubscription(this.questionSubscription), this.questionSubscription = void 0));
|
|
1317
|
-
})), this.feedSubscription =
|
|
1319
|
+
})), this.feedSubscription = yo(this.slStreamId, e.transport), this.cancels.add(this.feedSubscription.addListener("bet-pack-update", async (n) => {
|
|
1318
1320
|
const i = n.data?.attributes?.question;
|
|
1319
1321
|
if (i?.type === I.PREDICTION && (i.status === G.ACTIVE || i.status === G.RESOLVED)) {
|
|
1320
1322
|
const o = this.betPack.getValues().data || {};
|
|
1321
1323
|
if (o?.[i.id] || Object.keys(o).length < 5) {
|
|
1322
|
-
const a =
|
|
1324
|
+
const a = Ge(i.id, this.transport), u = a.subscribe(() => {
|
|
1323
1325
|
});
|
|
1324
1326
|
await a.get().promise;
|
|
1325
1327
|
let d = a.get().data;
|
|
@@ -1374,7 +1376,7 @@ class To {
|
|
|
1374
1376
|
this.activeQuestionId.off();
|
|
1375
1377
|
for (const n of this.cancels)
|
|
1376
1378
|
n(), this.cancels.delete(n);
|
|
1377
|
-
}), r || (this.advertisement =
|
|
1379
|
+
}), r || (this.advertisement = Io(this.slStreamId, this.feedSubscription, e));
|
|
1378
1380
|
}
|
|
1379
1381
|
/**
|
|
1380
1382
|
* Get id for notifications and link with current session
|
|
@@ -1404,7 +1406,7 @@ class To {
|
|
|
1404
1406
|
this.openedQuestionId.set(void 0), e && this.notifications.markAsViewed(this.getCurrentSessionId({ prefix: "notification", entity: e }));
|
|
1405
1407
|
};
|
|
1406
1408
|
}
|
|
1407
|
-
class
|
|
1409
|
+
class ko {
|
|
1408
1410
|
notificationsList;
|
|
1409
1411
|
store;
|
|
1410
1412
|
timeouts;
|
|
@@ -1504,7 +1506,7 @@ var Et;
|
|
|
1504
1506
|
(function(t) {
|
|
1505
1507
|
t.OPENED = "opened";
|
|
1506
1508
|
})(Et || (Et = {}));
|
|
1507
|
-
class
|
|
1509
|
+
class Po extends Je {
|
|
1508
1510
|
constructor() {
|
|
1509
1511
|
super("notification");
|
|
1510
1512
|
}
|
|
@@ -1516,11 +1518,11 @@ class ko extends We {
|
|
|
1516
1518
|
this.clear();
|
|
1517
1519
|
};
|
|
1518
1520
|
}
|
|
1519
|
-
class
|
|
1521
|
+
class Co {
|
|
1520
1522
|
queue;
|
|
1521
1523
|
storage;
|
|
1522
1524
|
constructor(e = {}) {
|
|
1523
|
-
this.storage = new
|
|
1525
|
+
this.storage = new Po(), this.queue = new ko({ concurrency: 1, animationDelay: 1600, ...e });
|
|
1524
1526
|
}
|
|
1525
1527
|
isViewed = (e) => this.storage.isOpened(e);
|
|
1526
1528
|
add = (e) => {
|
|
@@ -1557,36 +1559,36 @@ class Po {
|
|
|
1557
1559
|
this.storage.setOpened(e);
|
|
1558
1560
|
};
|
|
1559
1561
|
}
|
|
1560
|
-
const
|
|
1561
|
-
t.notifications = new
|
|
1562
|
+
const Lo = (t, e, r) => {
|
|
1563
|
+
t.notifications = new Co(void 0), t.addNotification = t.notifications.add, t.sdk.getNotificationsStore = () => t.notifications.getQueueStore(), t.sdk.getActiveNotification = () => t.notifications.getActiveNotification(), t.sdk.onMount({ name: "notifications" }, () => () => {
|
|
1562
1564
|
t.notifications.queue.drain();
|
|
1563
1565
|
}), r();
|
|
1564
1566
|
};
|
|
1565
|
-
var
|
|
1567
|
+
var He;
|
|
1566
1568
|
(function(t) {
|
|
1567
1569
|
t.UNKNOWN = "unknown", t.ALREADY_VOTED = "already_voted";
|
|
1568
|
-
})(
|
|
1570
|
+
})(He || (He = {}));
|
|
1569
1571
|
const Xr = async (t, e) => {
|
|
1570
1572
|
const { client: r, createRequestOptions: n } = t.createPromiseClient(ee, { method: "submitAnswer" }), i = n({ retryAttempts: 0 });
|
|
1571
1573
|
try {
|
|
1572
1574
|
return await r.submitAnswer({ data: e }, { contextValues: i });
|
|
1573
1575
|
} catch (o) {
|
|
1574
|
-
throw
|
|
1576
|
+
throw it.from(o)?.code === oe.AlreadyExists ? new Error(He.ALREADY_VOTED) : new Error(He.UNKNOWN);
|
|
1575
1577
|
}
|
|
1576
|
-
},
|
|
1578
|
+
}, qn = (t, e) => {
|
|
1577
1579
|
const { client: r, createRequestOptions: n } = t.createPromiseClient(ee, { method: "submitInplay" }), i = n({ retryAttempts: 0 });
|
|
1578
1580
|
return r.submitInplay({ data: { eventId: +e } }, { contextValues: i });
|
|
1579
|
-
},
|
|
1581
|
+
}, No = {
|
|
1580
1582
|
pageSize: 10
|
|
1581
|
-
},
|
|
1583
|
+
}, Fo = (t, e, r, n, i) => {
|
|
1582
1584
|
let o = 0;
|
|
1583
|
-
const s = U({ pageSize:
|
|
1585
|
+
const s = U({ pageSize: No.pageSize, page: 0 }), a = Z({
|
|
1584
1586
|
data: [],
|
|
1585
1587
|
key: Date.now(),
|
|
1586
1588
|
hasMore: !0,
|
|
1587
1589
|
loading: void 0,
|
|
1588
1590
|
error: void 0
|
|
1589
|
-
}), u =
|
|
1591
|
+
}), u = co(t), d = async () => {
|
|
1590
1592
|
const p = e.get(), v = n?.getStore().get().data?.map((w) => w.slId) || [];
|
|
1591
1593
|
if (p && v?.length) {
|
|
1592
1594
|
const w = r.get();
|
|
@@ -1618,7 +1620,7 @@ const Xr = async (t, e) => {
|
|
|
1618
1620
|
};
|
|
1619
1621
|
}), { $store: a, fetchMore: f, invalidate: c };
|
|
1620
1622
|
};
|
|
1621
|
-
class
|
|
1623
|
+
class Do extends Je {
|
|
1622
1624
|
get = this.read;
|
|
1623
1625
|
set = this.write;
|
|
1624
1626
|
del = this.remove;
|
|
@@ -1626,12 +1628,12 @@ class Fo extends We {
|
|
|
1626
1628
|
super("deep-link-context", window.sessionStorage);
|
|
1627
1629
|
}
|
|
1628
1630
|
}
|
|
1629
|
-
const Zr = "sldl", Ft = "sldl_uid",
|
|
1631
|
+
const Zr = "sldl", Ft = "sldl_uid", jn = "sldl_eid", xn = "sldl_e_eid", Ro = /* @__PURE__ */ new Set([Ft, jn, xn]), en = (t) => {
|
|
1630
1632
|
const e = {}, r = {};
|
|
1631
1633
|
for (const [n, i] of t)
|
|
1632
|
-
|
|
1634
|
+
Ro.has(n) ? e[n] = i : r[n] = i;
|
|
1633
1635
|
return { result: e, remain: r };
|
|
1634
|
-
},
|
|
1636
|
+
}, Vo = ({ hash: t, search: e }) => {
|
|
1635
1637
|
if (t && t.includes(Zr)) {
|
|
1636
1638
|
const r = new URLSearchParams(t.substr(1));
|
|
1637
1639
|
return { hash: en(r) };
|
|
@@ -1648,10 +1650,10 @@ const Zr = "sldl", Ft = "sldl_uid", qn = "sldl_eid", jn = "sldl_e_eid", Do = /*
|
|
|
1648
1650
|
trace: (...t) => {
|
|
1649
1651
|
tn.trace(...t), localStorage.getItem("SL_DEBUG") && console.log(...t);
|
|
1650
1652
|
}
|
|
1651
|
-
},
|
|
1653
|
+
}, $o = (t, e) => {
|
|
1652
1654
|
const { hash: r, search: n } = window.location;
|
|
1653
1655
|
if (fe.debug({ hash: r, search: n }, "get deep link data from"), r || n) {
|
|
1654
|
-
const i =
|
|
1656
|
+
const i = Vo({ hash: r, search: n });
|
|
1655
1657
|
if (fe.debug(i, "parse deep link result"), i) {
|
|
1656
1658
|
const { hash: o, search: s } = i, { result: a, remain: u } = o || s;
|
|
1657
1659
|
if (Object.keys(a).length !== 0) {
|
|
@@ -1670,8 +1672,8 @@ const Zr = "sldl", Ft = "sldl_uid", qn = "sldl_eid", jn = "sldl_e_eid", Do = /*
|
|
|
1670
1672
|
}
|
|
1671
1673
|
}
|
|
1672
1674
|
t.setValue("parsed", !0);
|
|
1673
|
-
},
|
|
1674
|
-
const n = new
|
|
1675
|
+
}, Bo = (t, e, r) => {
|
|
1676
|
+
const n = new Do(), i = n.get("sl-deep-link-store");
|
|
1675
1677
|
let o = {};
|
|
1676
1678
|
if (i)
|
|
1677
1679
|
try {
|
|
@@ -1709,15 +1711,15 @@ const Zr = "sldl", Ft = "sldl_uid", qn = "sldl_eid", jn = "sldl_e_eid", Do = /*
|
|
|
1709
1711
|
console.error(d);
|
|
1710
1712
|
}
|
|
1711
1713
|
};
|
|
1712
|
-
|
|
1713
|
-
},
|
|
1714
|
-
class
|
|
1714
|
+
$o(t.deepLink.$store, s), r();
|
|
1715
|
+
}, Mo = pe("bypass");
|
|
1716
|
+
class Uo extends Mi {
|
|
1715
1717
|
$coreStore;
|
|
1716
1718
|
deepLink;
|
|
1717
1719
|
transport;
|
|
1718
1720
|
bypassLogin;
|
|
1719
1721
|
constructor(e, r, n) {
|
|
1720
|
-
super(), this.$coreStore = e, this.deepLink = n, this.transport = r, this.bypassLogin =
|
|
1722
|
+
super(), this.$coreStore = e, this.deepLink = n, this.transport = r, this.bypassLogin = Zi(this.transport), this.connect();
|
|
1721
1723
|
}
|
|
1722
1724
|
me = async () => (this.$coreStore.getValues().user.invalidate(), (await this.$coreStore.getValues().user.getValue())?.data);
|
|
1723
1725
|
/**
|
|
@@ -1729,7 +1731,7 @@ class Mo extends Bi {
|
|
|
1729
1731
|
login = async (e, r) => {
|
|
1730
1732
|
this.$coreStore.getValues().userKey.setValue(r);
|
|
1731
1733
|
const { used: n, data: i } = this.deepLink.getDeepLinkData(), o = n ? "" : i?.[Ft];
|
|
1732
|
-
|
|
1734
|
+
Mo.debug({ inviterKey: o }, "login with inviterKey");
|
|
1733
1735
|
const s = await this.bypassLogin({
|
|
1734
1736
|
schema: e,
|
|
1735
1737
|
userKey: r,
|
|
@@ -1799,18 +1801,18 @@ class Mo extends Bi {
|
|
|
1799
1801
|
});
|
|
1800
1802
|
};
|
|
1801
1803
|
}
|
|
1802
|
-
const
|
|
1803
|
-
t.auth = new
|
|
1804
|
+
const et = new je(), qo = (t, e, r) => {
|
|
1805
|
+
t.auth = new Uo(t.store, t.transport, t.deepLink), t.stores.status.listen((n) => {
|
|
1804
1806
|
n === ve.READY && t.auth.reLogin();
|
|
1805
1807
|
}), t.sdk.userId = t.stores.user.getAtomStore, t.sdk.authorizationBypass = async (n, i) => {
|
|
1806
|
-
if (!(
|
|
1808
|
+
if (!(et.getSchema() === n && et.getExternalToken() === i && t.transport.getHeader("authorization")))
|
|
1807
1809
|
try {
|
|
1808
|
-
await t.auth.login(n, i),
|
|
1810
|
+
await t.auth.login(n, i), et.setSchema(n), et.setExternalToken(i);
|
|
1809
1811
|
} catch {
|
|
1810
1812
|
t.sdk.logout();
|
|
1811
1813
|
}
|
|
1812
1814
|
}, t.sdk.logout = () => {
|
|
1813
|
-
t.auth.logout(),
|
|
1815
|
+
t.auth.logout(), et.clear();
|
|
1814
1816
|
}, t.sdk.getUserStore = () => t.stores.user.getStore(), t.sdk.isUserAuthorized = () => t.auth.isAuthenticated(), r();
|
|
1815
1817
|
}, rn = pe("video_player"), pt = {
|
|
1816
1818
|
debug: (...t) => {
|
|
@@ -1819,7 +1821,7 @@ const Xe = new je(), Uo = (t, e, r) => {
|
|
|
1819
1821
|
trace: (...t) => {
|
|
1820
1822
|
rn.trace(...t), localStorage.getItem("SL_DEBUG") && console.log(...t);
|
|
1821
1823
|
}
|
|
1822
|
-
},
|
|
1824
|
+
}, jo = (t, e, r) => {
|
|
1823
1825
|
t.videoPlayer = {
|
|
1824
1826
|
controllers: /* @__PURE__ */ new Set()
|
|
1825
1827
|
}, t.sdk.addVideoPlayerController = (n) => {
|
|
@@ -1837,13 +1839,13 @@ const Xe = new je(), Uo = (t, e, r) => {
|
|
|
1837
1839
|
}
|
|
1838
1840
|
}
|
|
1839
1841
|
}, r();
|
|
1840
|
-
},
|
|
1842
|
+
}, xo = {
|
|
1841
1843
|
[I.FACTOID]: "insight",
|
|
1842
1844
|
[I.POLL]: "poll",
|
|
1843
1845
|
[I.TRIVIA]: "trivia",
|
|
1844
1846
|
[I.PREDICTION]: "prediction",
|
|
1845
1847
|
[I.TWEET]: "tweet"
|
|
1846
|
-
},
|
|
1848
|
+
}, Qo = (t, e, r) => {
|
|
1847
1849
|
t.sdk.uiState = Z({}), t.ui = {
|
|
1848
1850
|
enableAppNotification: function() {
|
|
1849
1851
|
t.sdk.uiState.setKey("appNotification", !0);
|
|
@@ -1877,7 +1879,7 @@ const Xe = new je(), Uo = (t, e, r) => {
|
|
|
1877
1879
|
};
|
|
1878
1880
|
t.onQuestionActivate = ({ questionType: i, ...o }) => {
|
|
1879
1881
|
if (t.ui.onContentActivate) {
|
|
1880
|
-
const s = o.type || i &&
|
|
1882
|
+
const s = o.type || i && xo[i] || "question";
|
|
1881
1883
|
t.ui.enableAppNotification(), t.ui.onContentActivate({ ...o, type: s });
|
|
1882
1884
|
}
|
|
1883
1885
|
}, t.sdk.onMount({ name: "ui" }, () => {
|
|
@@ -1977,7 +1979,7 @@ const Xe = new je(), Uo = (t, e, r) => {
|
|
|
1977
1979
|
o(), s();
|
|
1978
1980
|
};
|
|
1979
1981
|
}), r();
|
|
1980
|
-
},
|
|
1982
|
+
}, Go = (t, e, r) => {
|
|
1981
1983
|
const n = { onMountedFired: !1 }, i = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();
|
|
1982
1984
|
t.sdk = /* @__PURE__ */ Object.create(null), t.sdk.options = Z(e), t.sdk.withAuth = !1, t.sdk.onMount = ({ name: s, clear: a }, u) => {
|
|
1983
1985
|
if (i.has(s)) {
|
|
@@ -2004,7 +2006,7 @@ const Xe = new je(), Uo = (t, e, r) => {
|
|
|
2004
2006
|
}, t.sdk.createEventSession = (s) => {
|
|
2005
2007
|
t.stores.providerStreamId.setValue(s);
|
|
2006
2008
|
}, r();
|
|
2007
|
-
},
|
|
2009
|
+
}, Ko = (t, e) => {
|
|
2008
2010
|
const { client: r, queryKey: n } = t.createPromiseClient(ot, {
|
|
2009
2011
|
method: "generateDeepLink",
|
|
2010
2012
|
params: e
|
|
@@ -2025,21 +2027,21 @@ const Xe = new je(), Uo = (t, e, r) => {
|
|
|
2025
2027
|
// 24 hours
|
|
2026
2028
|
refetchInterval: 0
|
|
2027
2029
|
});
|
|
2028
|
-
},
|
|
2029
|
-
const { client: n } = t.createPromiseClient(
|
|
2030
|
+
}, zo = (t, { web: e, mobile: r }) => {
|
|
2031
|
+
const { client: n } = t.createPromiseClient(Ci, { method: "generate" });
|
|
2030
2032
|
return n.generate({ web: e, mobile: r });
|
|
2031
2033
|
}, nn = (t, e) => {
|
|
2032
2034
|
const r = new URLSearchParams(t);
|
|
2033
2035
|
for (const [n, i] of Object.entries(e))
|
|
2034
2036
|
r.append(n, i);
|
|
2035
2037
|
return r.toString();
|
|
2036
|
-
},
|
|
2038
|
+
}, Ho = (t, e, r, n) => {
|
|
2037
2039
|
const i = Z({});
|
|
2038
|
-
return wr(i, () =>
|
|
2040
|
+
return wr(i, () => Ko(t, [e, r]).subscribe(async ({ data: a, loading: u }) => {
|
|
2039
2041
|
const d = a === void 0 && u === !1 ? "https://streamlayer.io" : a?.url, c = n.get() || "", f = e.get() || "", p = r.get() || "", v = {
|
|
2040
2042
|
[Ft]: c,
|
|
2041
|
-
[
|
|
2042
|
-
[
|
|
2043
|
+
[jn]: f,
|
|
2044
|
+
[xn]: p
|
|
2043
2045
|
};
|
|
2044
2046
|
if (!u && d) {
|
|
2045
2047
|
i.setKey("loading", !0);
|
|
@@ -2047,7 +2049,7 @@ const Xe = new je(), Uo = (t, e, r) => {
|
|
|
2047
2049
|
w && m || m ? w = `?${nn(w, v)}` : m = `#${nn("", v)}`;
|
|
2048
2050
|
const g = window.location.origin + window.location.pathname + w + m;
|
|
2049
2051
|
try {
|
|
2050
|
-
const S = await
|
|
2052
|
+
const S = await zo(t, { web: g, mobile: d });
|
|
2051
2053
|
i.set({
|
|
2052
2054
|
data: S.data?.link,
|
|
2053
2055
|
loading: !1
|
|
@@ -2067,7 +2069,7 @@ var $;
|
|
|
2067
2069
|
(function(t) {
|
|
2068
2070
|
t.Unset = "unset", t.Required = "required", t.Optional = "optional", t.Completed = "completed", t.Disabled = "disabled", t.Unavailable = "unavailable";
|
|
2069
2071
|
})($ || ($ = {}));
|
|
2070
|
-
const
|
|
2072
|
+
const Wo = (t, e, r, n) => {
|
|
2071
2073
|
const { inplayGame: i } = t.featureSettings.get(), o = e.getCurrentSessionId({ prefix: "onboarding" });
|
|
2072
2074
|
i && r.add({
|
|
2073
2075
|
type: Ae.ONBOARDING,
|
|
@@ -2109,7 +2111,7 @@ const Ho = (t, e, r, n) => {
|
|
|
2109
2111
|
organizationId: d,
|
|
2110
2112
|
userId: u,
|
|
2111
2113
|
eventId: c
|
|
2112
|
-
}, $.Completed),
|
|
2114
|
+
}, $.Completed), qn(s, c));
|
|
2113
2115
|
return;
|
|
2114
2116
|
}
|
|
2115
2117
|
const p = e.moderation.getStore().value?.data, v = r.featureSettings.get().inplayGame;
|
|
@@ -2124,7 +2126,7 @@ const Ho = (t, e, r, n) => {
|
|
|
2124
2126
|
let o = !!i?.skipOnboarding;
|
|
2125
2127
|
const s = e.storage, a = U($.Unset);
|
|
2126
2128
|
a.subscribe((c) => {
|
|
2127
|
-
c !== $.Unset && (c === $.Optional || c === $.Required ? o === !1 && (
|
|
2129
|
+
c !== $.Unset && (c === $.Optional || c === $.Required ? o === !1 && (Wo(t, e, n, s), o = !0) : t.onboardingProcessed.set(!0), c === $.Completed && e.activeQuestionId.invalidate(), s.setOnboardingInstantOpen({
|
|
2128
2130
|
userId: e.userId.get() || "",
|
|
2129
2131
|
organizationId: e.organizationId.get() || "",
|
|
2130
2132
|
eventId: e.slStreamId.get() || ""
|
|
@@ -2140,7 +2142,7 @@ const Ho = (t, e, r, n) => {
|
|
|
2140
2142
|
}))), ht(a, e, t, n, s, u, r, i), { $store: a, submitInplay: async () => {
|
|
2141
2143
|
const c = e.slStreamId.get();
|
|
2142
2144
|
if (c) {
|
|
2143
|
-
await
|
|
2145
|
+
await qn(r, c), a.set($.Completed), s.saveOnboardingStatus({
|
|
2144
2146
|
organizationId: e.organizationId.get() || "",
|
|
2145
2147
|
userId: e.userId.get() || "",
|
|
2146
2148
|
eventId: c
|
|
@@ -2152,8 +2154,8 @@ const Ho = (t, e, r, n) => {
|
|
|
2152
2154
|
n.close(f);
|
|
2153
2155
|
}
|
|
2154
2156
|
} };
|
|
2155
|
-
},
|
|
2156
|
-
const i = Z(void 0), o =
|
|
2157
|
+
}, Yo = (t, e, r, n) => {
|
|
2158
|
+
const i = Z(void 0), o = Mn(n), s = async () => {
|
|
2157
2159
|
const u = t.get(), d = e.get(), c = r ? r.getStore().get().data?.map((v) => v.slId) : [];
|
|
2158
2160
|
if (!c || !u || !d)
|
|
2159
2161
|
return;
|
|
@@ -2173,15 +2175,15 @@ const Ho = (t, e, r, n) => {
|
|
|
2173
2175
|
u(), d?.(), c();
|
|
2174
2176
|
};
|
|
2175
2177
|
}), { $store: i, invalidate: a };
|
|
2176
|
-
},
|
|
2177
|
-
const o =
|
|
2178
|
+
}, Jo = async (t, e, r, n, i) => {
|
|
2179
|
+
const o = Mn(i), s = t.get(), a = e.get(), u = r?.getStore().get().data?.map((p) => p.slId) || [], d = {
|
|
2178
2180
|
eventId: s,
|
|
2179
2181
|
userId: n,
|
|
2180
2182
|
usersIds: [...u, a]
|
|
2181
2183
|
};
|
|
2182
2184
|
return (await o(d)).data?.attributes?.summary;
|
|
2183
|
-
},
|
|
2184
|
-
class Xo extends
|
|
2185
|
+
}, sn = /* @__PURE__ */ new Set([I.POLL, I.PREDICTION, I.TRIVIA]);
|
|
2186
|
+
class Xo extends $n {
|
|
2185
2187
|
/** user statistics (leaderboard panel) */
|
|
2186
2188
|
userSummary;
|
|
2187
2189
|
/** feed list (pick history) */
|
|
@@ -2222,9 +2224,9 @@ class Xo extends Vn {
|
|
|
2222
2224
|
cancels = /* @__PURE__ */ new Set();
|
|
2223
2225
|
onQuestionActivate;
|
|
2224
2226
|
constructor(e, r, n) {
|
|
2225
|
-
if (super(e, r), this.background = new
|
|
2226
|
-
this.friends = new se(
|
|
2227
|
-
const i = this.leaderboardList =
|
|
2227
|
+
if (super(e, r), this.background = new _o(n), this.advertisement = this.background.advertisement, this.onQuestionActivate = n.onQuestionActivate, this.feedSubscription = this.background.feedSubscription, this.activeQuestionId = this.background.activeQuestionId, this.openedQuestionId = this.background.openedQuestionId, this.storage = this.background.storage, this.feedList = this.background.feedList, this.betPack = this.background.betPack, this.currentUserId = this.background.userId, this.onboardingProcessed = U(!n.sdk.withAuth), this.leaderboardId = new re(U(this.settings.getValue("pinnedLeaderboardId")), "pinnedLeaderboardId").getStore(), this.notifications = n.notifications, this.transport = n.transport, this.closeFeature = (i = !0) => n.sdk.closeFeature(i), this.openFeature = () => n.sdk.openFeature(R.GAMES), this.openedQuestion = this.background.openedQuestion, this.deepLink = Ho(this.transport, this.background.slStreamId, n.stores.providerStreamId.getStore(), this.background.userId), this.userSummary = Yo(this.background.slStreamId, this.background.userId, this.friends, this.transport), !n.sdk.options.get().hideFriends) {
|
|
2228
|
+
this.friends = new se(lo(this.background.userId, n.transport), "gamification:friends"), this.openedUser = U(void 0);
|
|
2229
|
+
const i = this.leaderboardList = Fo(this.transport, this.background.slStreamId, this.background.userId, this.friends);
|
|
2228
2230
|
this.cancels.add(this.userSummary.$store.listen((o, s) => {
|
|
2229
2231
|
s?.summary && o?.summary && i.invalidate();
|
|
2230
2232
|
}));
|
|
@@ -2270,7 +2272,7 @@ class Xo extends Vn {
|
|
|
2270
2272
|
prefix: `notification-id:${s}`
|
|
2271
2273
|
}), d = [...this.feedList.getValues().data || []], c = d.findIndex((H) => H.id === s), f = d[c];
|
|
2272
2274
|
let p = f?.attributes?.attributes?.value?.answerId;
|
|
2273
|
-
const v =
|
|
2275
|
+
const v = Ge(s, this.transport), w = v.subscribe(() => {
|
|
2274
2276
|
});
|
|
2275
2277
|
await v.get().promise;
|
|
2276
2278
|
let m = v.get().data;
|
|
@@ -2313,7 +2315,7 @@ class Xo extends Vn {
|
|
|
2313
2315
|
}
|
|
2314
2316
|
})), this.cancels.add(this.background.feedSubscription.addListener("feed-subscription-questions-list", (e) => {
|
|
2315
2317
|
const r = [...this.feedList.getStore().value?.data || []], n = e.data?.attributes?.feedItem, i = r.findIndex((o) => o.id === n?.id);
|
|
2316
|
-
if (n?.attributes && n.attributes.attributes.case !== "promotion" && !(n.attributes.status !== G.ACTIVE && n.attributes.status !== G.RESOLVED)) {
|
|
2318
|
+
if (n?.attributes && n.attributes.attributes.case !== "promotion" && !(n.attributes.status !== G.ACTIVE && n.attributes.status !== G.RESOLVED) && !(!this.isInteractiveAllowed && sn.has(n.attributes.type))) {
|
|
2317
2319
|
if (i !== -1)
|
|
2318
2320
|
if (n.attributes.attributes.case === "question" && r[i].attributes?.attributes.case === "question") {
|
|
2319
2321
|
const o = r[i];
|
|
@@ -2374,7 +2376,16 @@ class Xo extends Vn {
|
|
|
2374
2376
|
this.background.feedSubscription.removeListener("feed-subscription-prediction-close"), this.background.feedSubscription.removeListener("feed-subscription-questions-list");
|
|
2375
2377
|
};
|
|
2376
2378
|
betPackVote = async (e, r) => {
|
|
2377
|
-
|
|
2379
|
+
try {
|
|
2380
|
+
await Xr(this.transport, { questionId: e, answerId: r });
|
|
2381
|
+
} catch (o) {
|
|
2382
|
+
if (o.message === He.ALREADY_VOTED) {
|
|
2383
|
+
const s = Ge(e, this.transport), a = s.subscribe(() => {
|
|
2384
|
+
});
|
|
2385
|
+
s.invalidate(), a();
|
|
2386
|
+
}
|
|
2387
|
+
throw o;
|
|
2388
|
+
}
|
|
2378
2389
|
const n = { ...this.betPack.getValues().data }, i = n?.[e];
|
|
2379
2390
|
i && (B.emit("poll", {
|
|
2380
2391
|
action: "voted",
|
|
@@ -2388,7 +2399,7 @@ class Xo extends Vn {
|
|
|
2388
2399
|
} : o), this.betPack.getStore().mutate(n));
|
|
2389
2400
|
};
|
|
2390
2401
|
submitAnswer = async (e, r) => {
|
|
2391
|
-
const n =
|
|
2402
|
+
const n = Ge(e, this.transport), i = n.subscribe(() => {
|
|
2392
2403
|
}), o = { ...n.get().data || {} }, s = () => {
|
|
2393
2404
|
const a = this.feedList.getValues().data;
|
|
2394
2405
|
if (!a)
|
|
@@ -2417,7 +2428,7 @@ class Xo extends Vn {
|
|
|
2417
2428
|
try {
|
|
2418
2429
|
await Xr(this.transport, { questionId: e, answerId: r }), s();
|
|
2419
2430
|
} catch (a) {
|
|
2420
|
-
if (a.message ===
|
|
2431
|
+
if (a.message === He.ALREADY_VOTED) {
|
|
2421
2432
|
this.userSummary.invalidate();
|
|
2422
2433
|
const u = n.subscribe(() => {
|
|
2423
2434
|
});
|
|
@@ -2456,7 +2467,7 @@ class Xo extends Vn {
|
|
|
2456
2467
|
openedFrom: r?.openedFrom === "bet-pack" ? "list" : r?.openedFrom
|
|
2457
2468
|
} : void 0);
|
|
2458
2469
|
};
|
|
2459
|
-
getFeedItem = (e) =>
|
|
2470
|
+
getFeedItem = (e) => ho(e, this.transport);
|
|
2460
2471
|
isOpenedQuestion = (e) => !!this.notifications.isViewed(e);
|
|
2461
2472
|
closeQuestion = (e) => (e && this.onQuestionActivate({
|
|
2462
2473
|
stage: "deactivate",
|
|
@@ -2480,7 +2491,7 @@ class Xo extends Vn {
|
|
|
2480
2491
|
}
|
|
2481
2492
|
const n = { ...r };
|
|
2482
2493
|
try {
|
|
2483
|
-
const i = await
|
|
2494
|
+
const i = await Jo(this.background.slStreamId, this.background.userId, this.friends, e, this.transport);
|
|
2484
2495
|
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);
|
|
2485
2496
|
} catch (i) {
|
|
2486
2497
|
console.error(i);
|
|
@@ -2498,8 +2509,8 @@ class Xo extends Vn {
|
|
|
2498
2509
|
*/
|
|
2499
2510
|
showInApp = (e) => {
|
|
2500
2511
|
const r = this.onboardingStatus.$store.get();
|
|
2501
|
-
if (e && e.data && r && r !== $.Unset && e.data.question?.id !== void 0 && e.data.question?.bypassNotifications?.inAppSilence !==
|
|
2502
|
-
if (
|
|
2512
|
+
if (e && e.data && r && r !== $.Unset && e.data.question?.id !== void 0 && e.data.question?.bypassNotifications?.inAppSilence !== Oi.ON && e.data.question.status === G.ACTIVE && !e.data.question.marketClosed) {
|
|
2513
|
+
if (sn.has(e.data.question.type))
|
|
2503
2514
|
this.isInteractiveAllowed && e.data.question.notification !== void 0 && this.notifications.add({
|
|
2504
2515
|
type: Ae.QUESTION,
|
|
2505
2516
|
action: () => this.openQuestion(e.data?.question?.id, e.data?.feedItem),
|
|
@@ -2551,7 +2562,7 @@ class Xo extends Vn {
|
|
|
2551
2562
|
questionType: e.data.question.type,
|
|
2552
2563
|
insight: s,
|
|
2553
2564
|
inApp: {
|
|
2554
|
-
useMediaFromContent: n?.useAsNotification ===
|
|
2565
|
+
useMediaFromContent: n?.useAsNotification === Ti.ENABLED,
|
|
2555
2566
|
notification: e.data.question.notification,
|
|
2556
2567
|
appearance: e.data.question.appearance,
|
|
2557
2568
|
sponsorship: e.data.question.sponsorship
|
|
@@ -2605,7 +2616,7 @@ class Xo extends Vn {
|
|
|
2605
2616
|
const Zo = {
|
|
2606
2617
|
[R.GAMES]: !0
|
|
2607
2618
|
};
|
|
2608
|
-
class es extends
|
|
2619
|
+
class es extends $n {
|
|
2609
2620
|
constructor(e, r) {
|
|
2610
2621
|
super(e, r);
|
|
2611
2622
|
}
|
|
@@ -2869,7 +2880,7 @@ class ss {
|
|
|
2869
2880
|
});
|
|
2870
2881
|
};
|
|
2871
2882
|
}
|
|
2872
|
-
const
|
|
2883
|
+
const rt = {
|
|
2873
2884
|
[I.UNSET]: Q.UNSET,
|
|
2874
2885
|
[I.FACTOID]: Q.POLLS_INSIGHT,
|
|
2875
2886
|
[I.POLL]: Q.POLLS_POLL,
|
|
@@ -2940,7 +2951,7 @@ class us {
|
|
|
2940
2951
|
...this.analytics.commonStore.getValues(),
|
|
2941
2952
|
kind: K.NOTIFICATION_RECEIVED,
|
|
2942
2953
|
topicId: e,
|
|
2943
|
-
topicType: r ?
|
|
2954
|
+
topicType: r ? rt[r] : Q.UNSET,
|
|
2944
2955
|
topicSubType: n
|
|
2945
2956
|
},
|
|
2946
2957
|
notificationKind: me.POLLS,
|
|
@@ -2953,7 +2964,7 @@ class us {
|
|
|
2953
2964
|
...this.analytics.commonStore.getValues(),
|
|
2954
2965
|
kind: K.NOTIFICATION_OPENED,
|
|
2955
2966
|
topicId: e,
|
|
2956
|
-
topicType: r ?
|
|
2967
|
+
topicType: r ? rt[r] : Q.UNSET,
|
|
2957
2968
|
topicSubType: n
|
|
2958
2969
|
},
|
|
2959
2970
|
notificationKind: me.POLLS,
|
|
@@ -2995,7 +3006,7 @@ class cs {
|
|
|
2995
3006
|
...this.analytics.commonStore.getValues(),
|
|
2996
3007
|
kind: K.POLLS_RECEIVED,
|
|
2997
3008
|
topicId: e,
|
|
2998
|
-
topicType: r ?
|
|
3009
|
+
topicType: r ? rt[r] : Q.UNSET
|
|
2999
3010
|
},
|
|
3000
3011
|
pollOpenedFrom: X.UNSET
|
|
3001
3012
|
});
|
|
@@ -3007,7 +3018,7 @@ class cs {
|
|
|
3007
3018
|
...this.analytics.commonStore.getValues(),
|
|
3008
3019
|
kind: K.POLLS_OPENED,
|
|
3009
3020
|
topicId: e,
|
|
3010
|
-
topicType: r ?
|
|
3021
|
+
topicType: r ? rt[r] : Q.UNSET
|
|
3011
3022
|
},
|
|
3012
3023
|
pollOpenedFrom: n === "list" ? X.PICK_HISTORY : X.IN_APP
|
|
3013
3024
|
});
|
|
@@ -3019,7 +3030,7 @@ class cs {
|
|
|
3019
3030
|
...this.analytics.commonStore.getValues(),
|
|
3020
3031
|
kind: K.POLLS_VOTE,
|
|
3021
3032
|
topicId: e,
|
|
3022
|
-
topicType: r ?
|
|
3033
|
+
topicType: r ? rt[r] : Q.UNSET
|
|
3023
3034
|
},
|
|
3024
3035
|
pollOpenedFrom: X.UNSET
|
|
3025
3036
|
});
|
|
@@ -3047,7 +3058,7 @@ class cs {
|
|
|
3047
3058
|
}
|
|
3048
3059
|
const ds = ({ transport: t, $commonStore: e }) => {
|
|
3049
3060
|
let r;
|
|
3050
|
-
const n = U(!1), i = 3e4, { client: o, queryKey: s } = t.createPromiseClient(
|
|
3061
|
+
const n = U(!1), i = 3e4, { client: o, queryKey: s } = t.createPromiseClient(Nn, {
|
|
3051
3062
|
method: "send",
|
|
3052
3063
|
params: [n]
|
|
3053
3064
|
}), a = t.nanoquery.createFetcherStore(s, {
|
|
@@ -3097,7 +3108,7 @@ class ls {
|
|
|
3097
3108
|
connected = !1;
|
|
3098
3109
|
constructor(e) {
|
|
3099
3110
|
this.listeners = /* @__PURE__ */ new Set(), this.listenersCancels = /* @__PURE__ */ new Set(), this.commonStore = new Ce(Z({}), "common-analytics"), this.connectToSDK(e), this.heartbeat = ds({ transport: e.analyticsTransport, $commonStore: this.commonStore }), this.notifications = new us(this), this.polls = new cs(this), this.invitation = new ns(this), this.interactions = new is(this), this.advertisement = new ss(this);
|
|
3100
|
-
const { client: r } = e.analyticsTransport.createPromiseClient(
|
|
3111
|
+
const { client: r } = e.analyticsTransport.createPromiseClient(Nn, {
|
|
3101
3112
|
method: "send"
|
|
3102
3113
|
});
|
|
3103
3114
|
this.analyticsClient = r;
|
|
@@ -3164,7 +3175,7 @@ function hs(t) {
|
|
|
3164
3175
|
};
|
|
3165
3176
|
}
|
|
3166
3177
|
var ys = hs, ms = ys;
|
|
3167
|
-
function
|
|
3178
|
+
function Qn(t, e, r) {
|
|
3168
3179
|
if (typeof t == "function" && (r = e, e = t, t = null), !(r >= 1))
|
|
3169
3180
|
throw new Error("fastqueue concurrency must be equal to or greater than 1");
|
|
3170
3181
|
var n = ms(gs), i = null, o = null, s = 0, a = null, u = {
|
|
@@ -3264,7 +3275,7 @@ function bs(t, e, r) {
|
|
|
3264
3275
|
f(null, p);
|
|
3265
3276
|
}, f);
|
|
3266
3277
|
}
|
|
3267
|
-
var i =
|
|
3278
|
+
var i = Qn(t, n, r), o = i.push, s = i.unshift;
|
|
3268
3279
|
return i.push = a, i.unshift = u, i.drained = d, i;
|
|
3269
3280
|
function a(c) {
|
|
3270
3281
|
var f = new Promise(function(p, v) {
|
|
@@ -3303,12 +3314,12 @@ function bs(t, e, r) {
|
|
|
3303
3314
|
return f;
|
|
3304
3315
|
}
|
|
3305
3316
|
}
|
|
3306
|
-
Or.exports =
|
|
3317
|
+
Or.exports = Qn;
|
|
3307
3318
|
Or.exports.promise = bs;
|
|
3308
|
-
var
|
|
3319
|
+
var Gn = Or.exports, Tr = { exports: {} }, Ke = typeof Reflect == "object" ? Reflect : null, an = Ke && typeof Ke.apply == "function" ? Ke.apply : function(e, r, n) {
|
|
3309
3320
|
return Function.prototype.apply.call(e, r, n);
|
|
3310
3321
|
}, mt;
|
|
3311
|
-
|
|
3322
|
+
Ke && typeof Ke.ownKeys == "function" ? mt = Ke.ownKeys : Object.getOwnPropertySymbols ? mt = function(e) {
|
|
3312
3323
|
return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e));
|
|
3313
3324
|
} : mt = function(e) {
|
|
3314
3325
|
return Object.getOwnPropertyNames(e);
|
|
@@ -3316,7 +3327,7 @@ Ge && typeof Ge.ownKeys == "function" ? mt = Ge.ownKeys : Object.getOwnPropertyS
|
|
|
3316
3327
|
function vs(t) {
|
|
3317
3328
|
console && console.warn && console.warn(t);
|
|
3318
3329
|
}
|
|
3319
|
-
var
|
|
3330
|
+
var Kn = Number.isNaN || function(e) {
|
|
3320
3331
|
return e !== e;
|
|
3321
3332
|
};
|
|
3322
3333
|
function N() {
|
|
@@ -3328,7 +3339,7 @@ N.EventEmitter = N;
|
|
|
3328
3339
|
N.prototype._events = void 0;
|
|
3329
3340
|
N.prototype._eventsCount = 0;
|
|
3330
3341
|
N.prototype._maxListeners = void 0;
|
|
3331
|
-
var
|
|
3342
|
+
var un = 10;
|
|
3332
3343
|
function Dt(t) {
|
|
3333
3344
|
if (typeof t != "function")
|
|
3334
3345
|
throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof t);
|
|
@@ -3336,27 +3347,27 @@ function Dt(t) {
|
|
|
3336
3347
|
Object.defineProperty(N, "defaultMaxListeners", {
|
|
3337
3348
|
enumerable: !0,
|
|
3338
3349
|
get: function() {
|
|
3339
|
-
return
|
|
3350
|
+
return un;
|
|
3340
3351
|
},
|
|
3341
3352
|
set: function(t) {
|
|
3342
|
-
if (typeof t != "number" || t < 0 ||
|
|
3353
|
+
if (typeof t != "number" || t < 0 || Kn(t))
|
|
3343
3354
|
throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + t + ".");
|
|
3344
|
-
|
|
3355
|
+
un = t;
|
|
3345
3356
|
}
|
|
3346
3357
|
});
|
|
3347
3358
|
N.init = function() {
|
|
3348
3359
|
(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;
|
|
3349
3360
|
};
|
|
3350
3361
|
N.prototype.setMaxListeners = function(e) {
|
|
3351
|
-
if (typeof e != "number" || e < 0 ||
|
|
3362
|
+
if (typeof e != "number" || e < 0 || Kn(e))
|
|
3352
3363
|
throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + e + ".");
|
|
3353
3364
|
return this._maxListeners = e, this;
|
|
3354
3365
|
};
|
|
3355
|
-
function
|
|
3366
|
+
function zn(t) {
|
|
3356
3367
|
return t._maxListeners === void 0 ? N.defaultMaxListeners : t._maxListeners;
|
|
3357
3368
|
}
|
|
3358
3369
|
N.prototype.getMaxListeners = function() {
|
|
3359
|
-
return
|
|
3370
|
+
return zn(this);
|
|
3360
3371
|
};
|
|
3361
3372
|
N.prototype.emit = function(e) {
|
|
3362
3373
|
for (var r = [], n = 1; n < arguments.length; n++) r.push(arguments[n]);
|
|
@@ -3376,13 +3387,13 @@ N.prototype.emit = function(e) {
|
|
|
3376
3387
|
if (u === void 0)
|
|
3377
3388
|
return !1;
|
|
3378
3389
|
if (typeof u == "function")
|
|
3379
|
-
|
|
3390
|
+
an(u, this, r);
|
|
3380
3391
|
else
|
|
3381
|
-
for (var d = u.length, c =
|
|
3382
|
-
|
|
3392
|
+
for (var d = u.length, c = Xn(u, d), n = 0; n < d; ++n)
|
|
3393
|
+
an(c[n], this, r);
|
|
3383
3394
|
return !0;
|
|
3384
3395
|
};
|
|
3385
|
-
function
|
|
3396
|
+
function Hn(t, e, r, n) {
|
|
3386
3397
|
var i, o, s;
|
|
3387
3398
|
if (Dt(r), o = t._events, o === void 0 ? (o = t._events = /* @__PURE__ */ Object.create(null), t._eventsCount = 0) : (o.newListener !== void 0 && (t.emit(
|
|
3388
3399
|
"newListener",
|
|
@@ -3390,7 +3401,7 @@ function zn(t, e, r, n) {
|
|
|
3390
3401
|
r.listener ? r.listener : r
|
|
3391
3402
|
), o = t._events), s = o[e]), s === void 0)
|
|
3392
3403
|
s = o[e] = r, ++t._eventsCount;
|
|
3393
|
-
else if (typeof s == "function" ? s = o[e] = n ? [r, s] : [s, r] : n ? s.unshift(r) : s.push(r), i =
|
|
3404
|
+
else if (typeof s == "function" ? s = o[e] = n ? [r, s] : [s, r] : n ? s.unshift(r) : s.push(r), i = zn(t), i > 0 && s.length > i && !s.warned) {
|
|
3394
3405
|
s.warned = !0;
|
|
3395
3406
|
var a = new Error("Possible EventEmitter memory leak detected. " + s.length + " " + String(e) + " listeners added. Use emitter.setMaxListeners() to increase limit");
|
|
3396
3407
|
a.name = "MaxListenersExceededWarning", a.emitter = t, a.type = e, a.count = s.length, vs(a);
|
|
@@ -3398,25 +3409,25 @@ function zn(t, e, r, n) {
|
|
|
3398
3409
|
return t;
|
|
3399
3410
|
}
|
|
3400
3411
|
N.prototype.addListener = function(e, r) {
|
|
3401
|
-
return
|
|
3412
|
+
return Hn(this, e, r, !1);
|
|
3402
3413
|
};
|
|
3403
3414
|
N.prototype.on = N.prototype.addListener;
|
|
3404
3415
|
N.prototype.prependListener = function(e, r) {
|
|
3405
|
-
return
|
|
3416
|
+
return Hn(this, e, r, !0);
|
|
3406
3417
|
};
|
|
3407
3418
|
function Ss() {
|
|
3408
3419
|
if (!this.fired)
|
|
3409
3420
|
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);
|
|
3410
3421
|
}
|
|
3411
|
-
function
|
|
3422
|
+
function Wn(t, e, r) {
|
|
3412
3423
|
var n = { fired: !1, wrapFn: void 0, target: t, type: e, listener: r }, i = Ss.bind(n);
|
|
3413
3424
|
return i.listener = r, n.wrapFn = i, i;
|
|
3414
3425
|
}
|
|
3415
3426
|
N.prototype.once = function(e, r) {
|
|
3416
|
-
return Dt(r), this.on(e,
|
|
3427
|
+
return Dt(r), this.on(e, Wn(this, e, r)), this;
|
|
3417
3428
|
};
|
|
3418
3429
|
N.prototype.prependOnceListener = function(e, r) {
|
|
3419
|
-
return Dt(r), this.prependListener(e,
|
|
3430
|
+
return Dt(r), this.prependListener(e, Wn(this, e, r)), this;
|
|
3420
3431
|
};
|
|
3421
3432
|
N.prototype.removeListener = function(e, r) {
|
|
3422
3433
|
var n, i, o, s, a;
|
|
@@ -3458,24 +3469,24 @@ N.prototype.removeAllListeners = function(e) {
|
|
|
3458
3469
|
this.removeListener(e, r[i]);
|
|
3459
3470
|
return this;
|
|
3460
3471
|
};
|
|
3461
|
-
function
|
|
3472
|
+
function Yn(t, e, r) {
|
|
3462
3473
|
var n = t._events;
|
|
3463
3474
|
if (n === void 0)
|
|
3464
3475
|
return [];
|
|
3465
3476
|
var i = n[e];
|
|
3466
|
-
return i === void 0 ? [] : typeof i == "function" ? r ? [i.listener || i] : [i] : r ? As(i) :
|
|
3477
|
+
return i === void 0 ? [] : typeof i == "function" ? r ? [i.listener || i] : [i] : r ? As(i) : Xn(i, i.length);
|
|
3467
3478
|
}
|
|
3468
3479
|
N.prototype.listeners = function(e) {
|
|
3469
|
-
return
|
|
3480
|
+
return Yn(this, e, !0);
|
|
3470
3481
|
};
|
|
3471
3482
|
N.prototype.rawListeners = function(e) {
|
|
3472
|
-
return
|
|
3483
|
+
return Yn(this, e, !1);
|
|
3473
3484
|
};
|
|
3474
3485
|
N.listenerCount = function(t, e) {
|
|
3475
|
-
return typeof t.listenerCount == "function" ? t.listenerCount(e) :
|
|
3486
|
+
return typeof t.listenerCount == "function" ? t.listenerCount(e) : Jn.call(t, e);
|
|
3476
3487
|
};
|
|
3477
|
-
N.prototype.listenerCount =
|
|
3478
|
-
function
|
|
3488
|
+
N.prototype.listenerCount = Jn;
|
|
3489
|
+
function Jn(t) {
|
|
3479
3490
|
var e = this._events;
|
|
3480
3491
|
if (e !== void 0) {
|
|
3481
3492
|
var r = e[t];
|
|
@@ -3489,7 +3500,7 @@ function Yn(t) {
|
|
|
3489
3500
|
N.prototype.eventNames = function() {
|
|
3490
3501
|
return this._eventsCount > 0 ? mt(this._events) : [];
|
|
3491
3502
|
};
|
|
3492
|
-
function
|
|
3503
|
+
function Xn(t, e) {
|
|
3493
3504
|
for (var r = new Array(e), n = 0; n < e; ++n)
|
|
3494
3505
|
r[n] = t[n];
|
|
3495
3506
|
return r;
|
|
@@ -3512,13 +3523,13 @@ function Es(t, e) {
|
|
|
3512
3523
|
function o() {
|
|
3513
3524
|
typeof t.removeListener == "function" && t.removeListener("error", i), r([].slice.call(arguments));
|
|
3514
3525
|
}
|
|
3515
|
-
|
|
3526
|
+
Zn(t, e, o, { once: !0 }), e !== "error" && Is(t, i, { once: !0 });
|
|
3516
3527
|
});
|
|
3517
3528
|
}
|
|
3518
3529
|
function Is(t, e, r) {
|
|
3519
|
-
typeof t.on == "function" &&
|
|
3530
|
+
typeof t.on == "function" && Zn(t, "error", e, r);
|
|
3520
3531
|
}
|
|
3521
|
-
function
|
|
3532
|
+
function Zn(t, e, r, n) {
|
|
3522
3533
|
if (typeof t.on == "function")
|
|
3523
3534
|
n.once ? t.once(e, r) : t.on(e, r);
|
|
3524
3535
|
else if (typeof t.addEventListener == "function")
|
|
@@ -3528,7 +3539,7 @@ function Xn(t, e, r, n) {
|
|
|
3528
3539
|
else
|
|
3529
3540
|
throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof t);
|
|
3530
3541
|
}
|
|
3531
|
-
var
|
|
3542
|
+
var ei = Tr.exports, Rt = {}, ti = {}, ri = function() {
|
|
3532
3543
|
if (typeof Symbol != "function" || typeof Object.getOwnPropertySymbols != "function")
|
|
3533
3544
|
return !1;
|
|
3534
3545
|
if (typeof Symbol.iterator == "symbol")
|
|
@@ -3551,16 +3562,16 @@ var Zn = Tr.exports, Rt = {}, ei = {}, ti = function() {
|
|
|
3551
3562
|
return !1;
|
|
3552
3563
|
}
|
|
3553
3564
|
return !0;
|
|
3554
|
-
}, Os =
|
|
3565
|
+
}, Os = ri, Vt = function() {
|
|
3555
3566
|
return Os() && !!Symbol.toStringTag;
|
|
3556
|
-
}, Ts = Error, _s = EvalError, ks = RangeError, Ps = ReferenceError,
|
|
3557
|
-
return typeof
|
|
3567
|
+
}, Ts = Error, _s = EvalError, ks = RangeError, Ps = ReferenceError, ni = SyntaxError, $t = TypeError, Cs = URIError, cn = typeof Symbol < "u" && Symbol, Ls = ri, Ns = function() {
|
|
3568
|
+
return typeof cn != "function" || typeof Symbol != "function" || typeof cn("foo") != "symbol" || typeof Symbol("bar") != "symbol" ? !1 : Ls();
|
|
3558
3569
|
}, jt = {
|
|
3559
3570
|
__proto__: null,
|
|
3560
3571
|
foo: {}
|
|
3561
3572
|
}, Fs = Object, Ds = function() {
|
|
3562
3573
|
return { __proto__: jt }.foo === jt.foo && !(jt instanceof Fs);
|
|
3563
|
-
}, Rs = "Function.prototype.bind called on incompatible ", Vs = Object.prototype.toString, $s = Math.max, Bs = "[object Function]",
|
|
3574
|
+
}, Rs = "Function.prototype.bind called on incompatible ", Vs = Object.prototype.toString, $s = Math.max, Bs = "[object Function]", dn = function(e, r) {
|
|
3564
3575
|
for (var n = [], i = 0; i < e.length; i += 1)
|
|
3565
3576
|
n[i] = e[i];
|
|
3566
3577
|
for (var o = 0; o < r.length; o += 1)
|
|
@@ -3582,13 +3593,13 @@ var Zn = Tr.exports, Rt = {}, ei = {}, ti = function() {
|
|
|
3582
3593
|
if (this instanceof i) {
|
|
3583
3594
|
var c = r.apply(
|
|
3584
3595
|
this,
|
|
3585
|
-
|
|
3596
|
+
dn(n, arguments)
|
|
3586
3597
|
);
|
|
3587
3598
|
return Object(c) === c ? c : this;
|
|
3588
3599
|
}
|
|
3589
3600
|
return r.apply(
|
|
3590
3601
|
e,
|
|
3591
|
-
|
|
3602
|
+
dn(n, arguments)
|
|
3592
3603
|
);
|
|
3593
3604
|
}, s = $s(0, r.length - n.length), a = [], u = 0; u < s; u++)
|
|
3594
3605
|
a[u] = "$" + u;
|
|
@@ -3598,9 +3609,9 @@ var Zn = Tr.exports, Rt = {}, ei = {}, ti = function() {
|
|
|
3598
3609
|
d.prototype = r.prototype, i.prototype = new d(), d.prototype = null;
|
|
3599
3610
|
}
|
|
3600
3611
|
return i;
|
|
3601
|
-
}, js = qs, _r = Function.prototype.bind || js, xs = Function.prototype.call, Qs = Object.prototype.hasOwnProperty, Gs = _r, Ks = Gs.call(xs, Qs), T, zs = Ts, Hs = _s, Ws = ks, Ys = Ps,
|
|
3612
|
+
}, js = qs, _r = Function.prototype.bind || js, xs = Function.prototype.call, Qs = Object.prototype.hasOwnProperty, Gs = _r, Ks = Gs.call(xs, Qs), T, zs = Ts, Hs = _s, Ws = ks, Ys = Ps, We = ni, ze = $t, Js = Cs, ii = Function, xt = function(t) {
|
|
3602
3613
|
try {
|
|
3603
|
-
return
|
|
3614
|
+
return ii('"use strict"; return (' + t + ").constructor;")();
|
|
3604
3615
|
} catch {
|
|
3605
3616
|
}
|
|
3606
3617
|
}, Le = Object.getOwnPropertyDescriptor;
|
|
@@ -3611,7 +3622,7 @@ if (Le)
|
|
|
3611
3622
|
Le = null;
|
|
3612
3623
|
}
|
|
3613
3624
|
var Qt = function() {
|
|
3614
|
-
throw new
|
|
3625
|
+
throw new ze();
|
|
3615
3626
|
}, Xs = Le ? function() {
|
|
3616
3627
|
try {
|
|
3617
3628
|
return arguments.callee, Qt;
|
|
@@ -3653,7 +3664,7 @@ var Qt = function() {
|
|
|
3653
3664
|
"%Float32Array%": typeof Float32Array > "u" ? T : Float32Array,
|
|
3654
3665
|
"%Float64Array%": typeof Float64Array > "u" ? T : Float64Array,
|
|
3655
3666
|
"%FinalizationRegistry%": typeof FinalizationRegistry > "u" ? T : FinalizationRegistry,
|
|
3656
|
-
"%Function%":
|
|
3667
|
+
"%Function%": ii,
|
|
3657
3668
|
"%GeneratorFunction%": qe,
|
|
3658
3669
|
"%Int8Array%": typeof Int8Array > "u" ? T : Int8Array,
|
|
3659
3670
|
"%Int16Array%": typeof Int16Array > "u" ? T : Int16Array,
|
|
@@ -3681,10 +3692,10 @@ var Qt = function() {
|
|
|
3681
3692
|
"%String%": String,
|
|
3682
3693
|
"%StringIteratorPrototype%": Me && j ? j(""[Symbol.iterator]()) : T,
|
|
3683
3694
|
"%Symbol%": Me ? Symbol : T,
|
|
3684
|
-
"%SyntaxError%":
|
|
3695
|
+
"%SyntaxError%": We,
|
|
3685
3696
|
"%ThrowTypeError%": Xs,
|
|
3686
3697
|
"%TypedArray%": ea,
|
|
3687
|
-
"%TypeError%":
|
|
3698
|
+
"%TypeError%": ze,
|
|
3688
3699
|
"%Uint8Array%": typeof Uint8Array > "u" ? T : Uint8Array,
|
|
3689
3700
|
"%Uint8ClampedArray%": typeof Uint8ClampedArray > "u" ? T : Uint8ClampedArray,
|
|
3690
3701
|
"%Uint16Array%": typeof Uint16Array > "u" ? T : Uint16Array,
|
|
@@ -3717,7 +3728,7 @@ var ra = function t(e) {
|
|
|
3717
3728
|
i && j && (r = j(i.prototype));
|
|
3718
3729
|
}
|
|
3719
3730
|
return Ne[e] = r, r;
|
|
3720
|
-
},
|
|
3731
|
+
}, ln = {
|
|
3721
3732
|
__proto__: null,
|
|
3722
3733
|
"%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"],
|
|
3723
3734
|
"%ArrayPrototype%": ["Array", "prototype"],
|
|
@@ -3770,48 +3781,48 @@ var ra = function t(e) {
|
|
|
3770
3781
|
"%URIErrorPrototype%": ["URIError", "prototype"],
|
|
3771
3782
|
"%WeakMapPrototype%": ["WeakMap", "prototype"],
|
|
3772
3783
|
"%WeakSetPrototype%": ["WeakSet", "prototype"]
|
|
3773
|
-
}, st = _r, It = Ks, na = st.call(Function.call, Array.prototype.concat), ia = st.call(Function.apply, Array.prototype.splice),
|
|
3784
|
+
}, st = _r, It = Ks, na = st.call(Function.call, Array.prototype.concat), ia = st.call(Function.apply, Array.prototype.splice), fn = st.call(Function.call, String.prototype.replace), Ot = st.call(Function.call, String.prototype.slice), oa = st.call(Function.call, RegExp.prototype.exec), sa = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, aa = /\\(\\)?/g, ua = function(e) {
|
|
3774
3785
|
var r = Ot(e, 0, 1), n = Ot(e, -1);
|
|
3775
3786
|
if (r === "%" && n !== "%")
|
|
3776
|
-
throw new
|
|
3787
|
+
throw new We("invalid intrinsic syntax, expected closing `%`");
|
|
3777
3788
|
if (n === "%" && r !== "%")
|
|
3778
|
-
throw new
|
|
3789
|
+
throw new We("invalid intrinsic syntax, expected opening `%`");
|
|
3779
3790
|
var i = [];
|
|
3780
|
-
return
|
|
3781
|
-
i[i.length] = a ?
|
|
3791
|
+
return fn(e, sa, function(o, s, a, u) {
|
|
3792
|
+
i[i.length] = a ? fn(u, aa, "$1") : s || o;
|
|
3782
3793
|
}), i;
|
|
3783
3794
|
}, ca = function(e, r) {
|
|
3784
3795
|
var n = e, i;
|
|
3785
|
-
if (It(
|
|
3796
|
+
if (It(ln, n) && (i = ln[n], n = "%" + i[0] + "%"), It(Ne, n)) {
|
|
3786
3797
|
var o = Ne[n];
|
|
3787
3798
|
if (o === qe && (o = ra(n)), typeof o > "u" && !r)
|
|
3788
|
-
throw new
|
|
3799
|
+
throw new ze("intrinsic " + e + " exists, but is not available. Please file an issue!");
|
|
3789
3800
|
return {
|
|
3790
3801
|
alias: i,
|
|
3791
3802
|
name: n,
|
|
3792
3803
|
value: o
|
|
3793
3804
|
};
|
|
3794
3805
|
}
|
|
3795
|
-
throw new
|
|
3806
|
+
throw new We("intrinsic " + e + " does not exist!");
|
|
3796
3807
|
}, at = function(e, r) {
|
|
3797
3808
|
if (typeof e != "string" || e.length === 0)
|
|
3798
|
-
throw new
|
|
3809
|
+
throw new ze("intrinsic name must be a non-empty string");
|
|
3799
3810
|
if (arguments.length > 1 && typeof r != "boolean")
|
|
3800
|
-
throw new
|
|
3811
|
+
throw new ze('"allowMissing" argument must be a boolean');
|
|
3801
3812
|
if (oa(/^%?[^%]*%?$/, e) === null)
|
|
3802
|
-
throw new
|
|
3813
|
+
throw new We("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
|
|
3803
3814
|
var n = ua(e), i = n.length > 0 ? n[0] : "", o = ca("%" + i + "%", r), s = o.name, a = o.value, u = !1, d = o.alias;
|
|
3804
3815
|
d && (i = d[0], ia(n, na([0, 1], d)));
|
|
3805
3816
|
for (var c = 1, f = !0; c < n.length; c += 1) {
|
|
3806
3817
|
var p = n[c], v = Ot(p, 0, 1), w = Ot(p, -1);
|
|
3807
3818
|
if ((v === '"' || v === "'" || v === "`" || w === '"' || w === "'" || w === "`") && v !== w)
|
|
3808
|
-
throw new
|
|
3819
|
+
throw new We("property names with quotes must have matching quotes");
|
|
3809
3820
|
if ((p === "constructor" || !f) && (u = !0), i += "." + p, s = "%" + i + "%", It(Ne, s))
|
|
3810
3821
|
a = Ne[s];
|
|
3811
3822
|
else if (a != null) {
|
|
3812
3823
|
if (!(p in a)) {
|
|
3813
3824
|
if (!r)
|
|
3814
|
-
throw new
|
|
3825
|
+
throw new ze("base intrinsic for " + e + " exists, but the property is not available.");
|
|
3815
3826
|
return;
|
|
3816
3827
|
}
|
|
3817
3828
|
if (Le && c + 1 >= n.length) {
|
|
@@ -3823,10 +3834,10 @@ var ra = function t(e) {
|
|
|
3823
3834
|
}
|
|
3824
3835
|
}
|
|
3825
3836
|
return a;
|
|
3826
|
-
},
|
|
3837
|
+
}, oi = { exports: {} }, Gt, pn;
|
|
3827
3838
|
function kr() {
|
|
3828
|
-
if (
|
|
3829
|
-
|
|
3839
|
+
if (pn) return Gt;
|
|
3840
|
+
pn = 1;
|
|
3830
3841
|
var t = at, e = t("%Object.defineProperty%", !0) || !1;
|
|
3831
3842
|
if (e)
|
|
3832
3843
|
try {
|
|
@@ -3843,7 +3854,7 @@ if (gt)
|
|
|
3843
3854
|
} catch {
|
|
3844
3855
|
gt = null;
|
|
3845
3856
|
}
|
|
3846
|
-
var Bt = gt,
|
|
3857
|
+
var Bt = gt, hn = kr(), la = ni, Ue = $t, yn = Bt, fa = function(e, r, n) {
|
|
3847
3858
|
if (!e || typeof e != "object" && typeof e != "function")
|
|
3848
3859
|
throw new Ue("`obj` must be an object or a function`");
|
|
3849
3860
|
if (typeof r != "string" && typeof r != "symbol")
|
|
@@ -3856,9 +3867,9 @@ var Bt = gt, pn = kr(), la = ri, Ue = $t, hn = Bt, fa = function(e, r, n) {
|
|
|
3856
3867
|
throw new Ue("`nonConfigurable`, if provided, must be a boolean or null");
|
|
3857
3868
|
if (arguments.length > 6 && typeof arguments[6] != "boolean")
|
|
3858
3869
|
throw new Ue("`loose`, if provided, must be a boolean");
|
|
3859
|
-
var i = arguments.length > 3 ? arguments[3] : null, o = arguments.length > 4 ? arguments[4] : null, s = arguments.length > 5 ? arguments[5] : null, a = arguments.length > 6 ? arguments[6] : !1, u = !!
|
|
3860
|
-
if (
|
|
3861
|
-
|
|
3870
|
+
var i = arguments.length > 3 ? arguments[3] : null, o = arguments.length > 4 ? arguments[4] : null, s = arguments.length > 5 ? arguments[5] : null, a = arguments.length > 6 ? arguments[6] : !1, u = !!yn && yn(e, r);
|
|
3871
|
+
if (hn)
|
|
3872
|
+
hn(e, r, {
|
|
3862
3873
|
configurable: s === null && u ? u.configurable : !s,
|
|
3863
3874
|
enumerable: i === null && u ? u.enumerable : !i,
|
|
3864
3875
|
value: n,
|
|
@@ -3868,10 +3879,10 @@ var Bt = gt, pn = kr(), la = ri, Ue = $t, hn = Bt, fa = function(e, r, n) {
|
|
|
3868
3879
|
e[r] = n;
|
|
3869
3880
|
else
|
|
3870
3881
|
throw new la("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");
|
|
3871
|
-
}, lr = kr(),
|
|
3882
|
+
}, lr = kr(), si = function() {
|
|
3872
3883
|
return !!lr;
|
|
3873
3884
|
};
|
|
3874
|
-
|
|
3885
|
+
si.hasArrayLengthDefineBug = function() {
|
|
3875
3886
|
if (!lr)
|
|
3876
3887
|
return null;
|
|
3877
3888
|
try {
|
|
@@ -3880,24 +3891,24 @@ oi.hasArrayLengthDefineBug = function() {
|
|
|
3880
3891
|
return !0;
|
|
3881
3892
|
}
|
|
3882
3893
|
};
|
|
3883
|
-
var pa =
|
|
3894
|
+
var pa = si, ha = at, mn = fa, ya = pa(), gn = Bt, bn = $t, ma = ha("%Math.floor%"), ga = function(e, r) {
|
|
3884
3895
|
if (typeof e != "function")
|
|
3885
|
-
throw new
|
|
3896
|
+
throw new bn("`fn` is not a function");
|
|
3886
3897
|
if (typeof r != "number" || r < 0 || r > 4294967295 || ma(r) !== r)
|
|
3887
|
-
throw new
|
|
3898
|
+
throw new bn("`length` must be a positive 32-bit integer");
|
|
3888
3899
|
var n = arguments.length > 2 && !!arguments[2], i = !0, o = !0;
|
|
3889
|
-
if ("length" in e &&
|
|
3890
|
-
var s =
|
|
3900
|
+
if ("length" in e && gn) {
|
|
3901
|
+
var s = gn(e, "length");
|
|
3891
3902
|
s && !s.configurable && (i = !1), s && !s.writable && (o = !1);
|
|
3892
3903
|
}
|
|
3893
|
-
return (i || o || !n) && (ya ?
|
|
3904
|
+
return (i || o || !n) && (ya ? mn(
|
|
3894
3905
|
/** @type {Parameters<define>[0]} */
|
|
3895
3906
|
e,
|
|
3896
3907
|
"length",
|
|
3897
3908
|
r,
|
|
3898
3909
|
!0,
|
|
3899
3910
|
!0
|
|
3900
|
-
) :
|
|
3911
|
+
) : mn(
|
|
3901
3912
|
/** @type {Parameters<define>[0]} */
|
|
3902
3913
|
e,
|
|
3903
3914
|
"length",
|
|
@@ -3920,20 +3931,20 @@ var pa = oi, ha = at, yn = fa, ya = pa(), mn = Bt, gn = $t, ma = ha("%Math.floor
|
|
|
3920
3931
|
return a(e, o, arguments);
|
|
3921
3932
|
};
|
|
3922
3933
|
u ? u(t.exports, "apply", { value: c }) : t.exports.apply = c;
|
|
3923
|
-
})(
|
|
3924
|
-
var Pr =
|
|
3925
|
-
var n =
|
|
3926
|
-
return typeof n == "function" && ba(e, ".prototype.") > -1 ?
|
|
3934
|
+
})(oi);
|
|
3935
|
+
var Pr = oi.exports, ai = at, ui = Pr, ba = ui(ai("String.prototype.indexOf")), Cr = function(e, r) {
|
|
3936
|
+
var n = ai(e, !!r);
|
|
3937
|
+
return typeof n == "function" && ba(e, ".prototype.") > -1 ? ui(n) : n;
|
|
3927
3938
|
}, va = Vt(), Sa = Cr, fr = Sa("Object.prototype.toString"), Mt = function(e) {
|
|
3928
3939
|
return va && e && typeof e == "object" && Symbol.toStringTag in e ? !1 : fr(e) === "[object Arguments]";
|
|
3929
|
-
},
|
|
3940
|
+
}, ci = function(e) {
|
|
3930
3941
|
return Mt(e) ? !0 : e !== null && typeof e == "object" && typeof e.length == "number" && e.length >= 0 && fr(e) !== "[object Array]" && fr(e.callee) === "[object Function]";
|
|
3931
3942
|
}, wa = function() {
|
|
3932
3943
|
return Mt(arguments);
|
|
3933
3944
|
}();
|
|
3934
|
-
Mt.isLegacyArguments =
|
|
3935
|
-
var Aa = wa ? Mt :
|
|
3936
|
-
if (!
|
|
3945
|
+
Mt.isLegacyArguments = ci;
|
|
3946
|
+
var Aa = wa ? Mt : ci, Ea = Object.prototype.toString, Ia = Function.prototype.toString, Oa = /^\s*(?:function)?\*/, di = Vt(), Kt = Object.getPrototypeOf, Ta = function() {
|
|
3947
|
+
if (!di)
|
|
3937
3948
|
return !1;
|
|
3938
3949
|
try {
|
|
3939
3950
|
return Function("return function*() {}")();
|
|
@@ -3944,7 +3955,7 @@ var Aa = wa ? Mt : ui, Ea = Object.prototype.toString, Ia = Function.prototype.t
|
|
|
3944
3955
|
return !1;
|
|
3945
3956
|
if (Oa.test(Ia.call(e)))
|
|
3946
3957
|
return !0;
|
|
3947
|
-
if (!
|
|
3958
|
+
if (!di) {
|
|
3948
3959
|
var r = Ea.call(e);
|
|
3949
3960
|
return r === "[object GeneratorFunction]";
|
|
3950
3961
|
}
|
|
@@ -3955,7 +3966,7 @@ var Aa = wa ? Mt : ui, Ea = Object.prototype.toString, Ia = Function.prototype.t
|
|
|
3955
3966
|
zt = n ? Kt(n) : !1;
|
|
3956
3967
|
}
|
|
3957
3968
|
return Kt(e) === zt;
|
|
3958
|
-
},
|
|
3969
|
+
}, li = Function.prototype.toString, xe = typeof Reflect == "object" && Reflect !== null && Reflect.apply, pr, bt;
|
|
3959
3970
|
if (typeof xe == "function" && typeof Object.defineProperty == "function")
|
|
3960
3971
|
try {
|
|
3961
3972
|
pr = Object.defineProperty({}, "length", {
|
|
@@ -3972,14 +3983,14 @@ else
|
|
|
3972
3983
|
xe = null;
|
|
3973
3984
|
var ka = /^\s*class\b/, hr = function(e) {
|
|
3974
3985
|
try {
|
|
3975
|
-
var r =
|
|
3986
|
+
var r = li.call(e);
|
|
3976
3987
|
return ka.test(r);
|
|
3977
3988
|
} catch {
|
|
3978
3989
|
return !1;
|
|
3979
3990
|
}
|
|
3980
3991
|
}, Ht = function(e) {
|
|
3981
3992
|
try {
|
|
3982
|
-
return hr(e) ? !1 : (
|
|
3993
|
+
return hr(e) ? !1 : (li.call(e), !0);
|
|
3983
3994
|
} catch {
|
|
3984
3995
|
return !1;
|
|
3985
3996
|
}
|
|
@@ -4021,21 +4032,21 @@ var Ba = xe ? function(e) {
|
|
|
4021
4032
|
return !1;
|
|
4022
4033
|
var r = vt.call(e);
|
|
4023
4034
|
return r !== Ca && r !== La && !/^\[object HTML/.test(r) ? !1 : Ht(e);
|
|
4024
|
-
}, Ma = Ba, Ua = Object.prototype.toString,
|
|
4035
|
+
}, Ma = Ba, Ua = Object.prototype.toString, fi = Object.prototype.hasOwnProperty, qa = function(e, r, n) {
|
|
4025
4036
|
for (var i = 0, o = e.length; i < o; i++)
|
|
4026
|
-
|
|
4037
|
+
fi.call(e, i) && (n == null ? r(e[i], i, e) : r.call(n, e[i], i, e));
|
|
4027
4038
|
}, ja = function(e, r, n) {
|
|
4028
4039
|
for (var i = 0, o = e.length; i < o; i++)
|
|
4029
4040
|
n == null ? r(e.charAt(i), i, e) : r.call(n, e.charAt(i), i, e);
|
|
4030
4041
|
}, xa = function(e, r, n) {
|
|
4031
4042
|
for (var i in e)
|
|
4032
|
-
|
|
4043
|
+
fi.call(e, i) && (n == null ? r(e[i], i, e) : r.call(n, e[i], i, e));
|
|
4033
4044
|
}, Qa = function(e, r, n) {
|
|
4034
4045
|
if (!Ma(r))
|
|
4035
4046
|
throw new TypeError("iterator must be a function");
|
|
4036
4047
|
var i;
|
|
4037
4048
|
arguments.length >= 3 && (i = n), Ua.call(e) === "[object Array]" ? qa(e, r, i) : typeof e == "string" ? ja(e, r, i) : xa(e, r, i);
|
|
4038
|
-
},
|
|
4049
|
+
}, pi = Qa, Ga = [
|
|
4039
4050
|
"Float32Array",
|
|
4040
4051
|
"Float64Array",
|
|
4041
4052
|
"Int8Array",
|
|
@@ -4047,29 +4058,29 @@ var Ba = xe ? function(e) {
|
|
|
4047
4058
|
"Uint32Array",
|
|
4048
4059
|
"BigInt64Array",
|
|
4049
4060
|
"BigUint64Array"
|
|
4050
|
-
], Wt = Ga, Ka = typeof globalThis > "u" ? Er : globalThis,
|
|
4061
|
+
], Wt = Ga, Ka = typeof globalThis > "u" ? Er : globalThis, hi = function() {
|
|
4051
4062
|
for (var e = [], r = 0; r < Wt.length; r++)
|
|
4052
4063
|
typeof Ka[Wt[r]] == "function" && (e[e.length] = Wt[r]);
|
|
4053
4064
|
return e;
|
|
4054
|
-
}, Tt =
|
|
4065
|
+
}, Tt = pi, za = hi, vn = Pr, Lr = Cr, St = Bt, Ha = Lr("Object.prototype.toString"), yi = Vt(), Sn = typeof globalThis > "u" ? Er : globalThis, mr = za(), Nr = Lr("String.prototype.slice"), Yt = Object.getPrototypeOf, Wa = Lr("Array.prototype.indexOf", !0) || function(e, r) {
|
|
4055
4066
|
for (var n = 0; n < e.length; n += 1)
|
|
4056
4067
|
if (e[n] === r)
|
|
4057
4068
|
return n;
|
|
4058
4069
|
return -1;
|
|
4059
4070
|
}, _t = { __proto__: null };
|
|
4060
|
-
|
|
4061
|
-
var e = new
|
|
4071
|
+
yi && St && Yt ? Tt(mr, function(t) {
|
|
4072
|
+
var e = new Sn[t]();
|
|
4062
4073
|
if (Symbol.toStringTag in e) {
|
|
4063
4074
|
var r = Yt(e), n = St(r, Symbol.toStringTag);
|
|
4064
4075
|
if (!n) {
|
|
4065
4076
|
var i = Yt(r);
|
|
4066
4077
|
n = St(i, Symbol.toStringTag);
|
|
4067
4078
|
}
|
|
4068
|
-
_t["$" + t] =
|
|
4079
|
+
_t["$" + t] = vn(n.get);
|
|
4069
4080
|
}
|
|
4070
4081
|
}) : Tt(mr, function(t) {
|
|
4071
|
-
var e = new
|
|
4072
|
-
r && (_t["$" + t] =
|
|
4082
|
+
var e = new Sn[t](), r = e.slice || e.set;
|
|
4083
|
+
r && (_t["$" + t] = vn(r));
|
|
4073
4084
|
});
|
|
4074
4085
|
var Ya = function(e) {
|
|
4075
4086
|
var r = !1;
|
|
@@ -4092,30 +4103,30 @@ var Ya = function(e) {
|
|
|
4092
4103
|
}, Xa = function(e) {
|
|
4093
4104
|
if (!e || typeof e != "object")
|
|
4094
4105
|
return !1;
|
|
4095
|
-
if (!
|
|
4106
|
+
if (!yi) {
|
|
4096
4107
|
var r = Nr(Ha(e), 8, -1);
|
|
4097
4108
|
return Wa(mr, r) > -1 ? r : r !== "Object" ? !1 : Ja(e);
|
|
4098
4109
|
}
|
|
4099
4110
|
return St ? Ya(e) : null;
|
|
4100
|
-
}, kt =
|
|
4111
|
+
}, kt = pi, Za = hi, wn = Pr, Fr = Cr, wt = Bt, eu = Fr("Object.prototype.toString"), mi = Vt(), An = typeof globalThis > "u" ? Er : globalThis, gr = Za(), Dr = Fr("String.prototype.slice"), Jt = Object.getPrototypeOf, tu = Fr("Array.prototype.indexOf", !0) || function(e, r) {
|
|
4101
4112
|
for (var n = 0; n < e.length; n += 1)
|
|
4102
4113
|
if (e[n] === r)
|
|
4103
4114
|
return n;
|
|
4104
4115
|
return -1;
|
|
4105
4116
|
}, Pt = { __proto__: null };
|
|
4106
|
-
|
|
4107
|
-
var e = new
|
|
4117
|
+
mi && wt && Jt ? kt(gr, function(t) {
|
|
4118
|
+
var e = new An[t]();
|
|
4108
4119
|
if (Symbol.toStringTag in e) {
|
|
4109
4120
|
var r = Jt(e), n = wt(r, Symbol.toStringTag);
|
|
4110
4121
|
if (!n) {
|
|
4111
4122
|
var i = Jt(r);
|
|
4112
4123
|
n = wt(i, Symbol.toStringTag);
|
|
4113
4124
|
}
|
|
4114
|
-
Pt["$" + t] =
|
|
4125
|
+
Pt["$" + t] = wn(n.get);
|
|
4115
4126
|
}
|
|
4116
4127
|
}) : kt(gr, function(t) {
|
|
4117
|
-
var e = new
|
|
4118
|
-
r && (Pt["$" + t] =
|
|
4128
|
+
var e = new An[t](), r = e.slice || e.set;
|
|
4129
|
+
r && (Pt["$" + t] = wn(r));
|
|
4119
4130
|
});
|
|
4120
4131
|
var ru = function(e) {
|
|
4121
4132
|
var r = !1;
|
|
@@ -4152,7 +4163,7 @@ var ru = function(e) {
|
|
|
4152
4163
|
}, iu = function(e) {
|
|
4153
4164
|
if (!e || typeof e != "object")
|
|
4154
4165
|
return !1;
|
|
4155
|
-
if (!
|
|
4166
|
+
if (!mi) {
|
|
4156
4167
|
var r = Dr(eu(e), 8, -1);
|
|
4157
4168
|
return tu(gr, r) > -1 ? r : r !== "Object" ? !1 : nu(e);
|
|
4158
4169
|
}
|
|
@@ -4170,11 +4181,11 @@ var ru = function(e) {
|
|
|
4170
4181
|
var p = o(BigInt.prototype.valueOf);
|
|
4171
4182
|
if (a)
|
|
4172
4183
|
var v = o(Symbol.prototype.valueOf);
|
|
4173
|
-
function w(y,
|
|
4184
|
+
function w(y, Ei) {
|
|
4174
4185
|
if (typeof y != "object")
|
|
4175
4186
|
return !1;
|
|
4176
4187
|
try {
|
|
4177
|
-
return
|
|
4188
|
+
return Ei(y), !0;
|
|
4178
4189
|
} catch {
|
|
4179
4190
|
return !1;
|
|
4180
4191
|
}
|
|
@@ -4244,10 +4255,10 @@ var ru = function(e) {
|
|
|
4244
4255
|
return u(y) === "[object Set]";
|
|
4245
4256
|
}
|
|
4246
4257
|
Ie.working = typeof Set < "u" && Ie(/* @__PURE__ */ new Set());
|
|
4247
|
-
function
|
|
4258
|
+
function Ze(y) {
|
|
4248
4259
|
return typeof Set > "u" ? !1 : Ie.working ? Ie(y) : y instanceof Set;
|
|
4249
4260
|
}
|
|
4250
|
-
t.isSet =
|
|
4261
|
+
t.isSet = Ze;
|
|
4251
4262
|
function De(y) {
|
|
4252
4263
|
return u(y) === "[object WeakMap]";
|
|
4253
4264
|
}
|
|
@@ -4328,14 +4339,14 @@ var ru = function(e) {
|
|
|
4328
4339
|
return a && w(y, v);
|
|
4329
4340
|
}
|
|
4330
4341
|
t.isSymbolObject = $r;
|
|
4331
|
-
function
|
|
4342
|
+
function wi(y) {
|
|
4332
4343
|
return _e(y) || ct(y) || $e(y) || dt(y) || $r(y);
|
|
4333
4344
|
}
|
|
4334
|
-
t.isBoxedPrimitive =
|
|
4335
|
-
function
|
|
4345
|
+
t.isBoxedPrimitive = wi;
|
|
4346
|
+
function Ai(y) {
|
|
4336
4347
|
return typeof Uint8Array < "u" && (ut(y) || P(y));
|
|
4337
4348
|
}
|
|
4338
|
-
t.isAnyArrayBuffer =
|
|
4349
|
+
t.isAnyArrayBuffer = Ai, ["isProxy", "isExternal", "isModuleNamespaceObject"].forEach(function(y) {
|
|
4339
4350
|
Object.defineProperty(t, y, {
|
|
4340
4351
|
enumerable: !1,
|
|
4341
4352
|
value: function() {
|
|
@@ -4343,7 +4354,7 @@ var ru = function(e) {
|
|
|
4343
4354
|
}
|
|
4344
4355
|
});
|
|
4345
4356
|
});
|
|
4346
|
-
})(
|
|
4357
|
+
})(ti);
|
|
4347
4358
|
var au = function(e) {
|
|
4348
4359
|
return e && typeof e == "object" && typeof e.copy == "function" && typeof e.fill == "function" && typeof e.readUInt8 == "function";
|
|
4349
4360
|
}, br = { exports: {} };
|
|
@@ -4584,7 +4595,7 @@ var uu = br.exports;
|
|
|
4584
4595
|
`) + " " + l.join(`,
|
|
4585
4596
|
`) + " " + b[1] : b[0] + h + " " + l.join(", ") + " " + b[1];
|
|
4586
4597
|
}
|
|
4587
|
-
t.types =
|
|
4598
|
+
t.types = ti;
|
|
4588
4599
|
function g(l) {
|
|
4589
4600
|
return Array.isArray(l);
|
|
4590
4601
|
}
|
|
@@ -4645,7 +4656,7 @@ var uu = br.exports;
|
|
|
4645
4656
|
function Ie(l) {
|
|
4646
4657
|
return Object.prototype.toString.call(l);
|
|
4647
4658
|
}
|
|
4648
|
-
function
|
|
4659
|
+
function Ze(l) {
|
|
4649
4660
|
return l < 10 ? "0" + l.toString(10) : l.toString(10);
|
|
4650
4661
|
}
|
|
4651
4662
|
var De = [
|
|
@@ -4664,9 +4675,9 @@ var uu = br.exports;
|
|
|
4664
4675
|
];
|
|
4665
4676
|
function qt() {
|
|
4666
4677
|
var l = /* @__PURE__ */ new Date(), h = [
|
|
4667
|
-
|
|
4668
|
-
|
|
4669
|
-
|
|
4678
|
+
Ze(l.getHours()),
|
|
4679
|
+
Ze(l.getMinutes()),
|
|
4680
|
+
Ze(l.getSeconds())
|
|
4670
4681
|
].join(":");
|
|
4671
4682
|
return [l.getDate(), De[l.getMonth()], h].join(" ");
|
|
4672
4683
|
}
|
|
@@ -4769,7 +4780,7 @@ function ke(t, e, r = Error) {
|
|
|
4769
4780
|
return `${this.name} [${this.code}]: ${this.message}`;
|
|
4770
4781
|
}, cu(n, r), n;
|
|
4771
4782
|
}
|
|
4772
|
-
var
|
|
4783
|
+
var gi = {
|
|
4773
4784
|
createError: ke,
|
|
4774
4785
|
AVV_ERR_EXPOSE_ALREADY_DEFINED: ke(
|
|
4775
4786
|
"AVV_ERR_EXPOSE_ALREADY_DEFINED",
|
|
@@ -4817,7 +4828,7 @@ var mi = {
|
|
|
4817
4828
|
return r + i(c ? "└" : "├") + i("─") + i(f ? "┬" : "─") + " " + t(u, p, n).slice(r.length + 2);
|
|
4818
4829
|
}).join("");
|
|
4819
4830
|
};
|
|
4820
|
-
const lu = du,
|
|
4831
|
+
const lu = du, En = Symbol("avvio.TimeTree.untrackNode"), Zt = Symbol("avvio.TimeTree.trackNode"), In = Symbol("avvio.TimeTree.getParent"), On = Symbol("avvio.TimeTree.getNode"), Tn = Symbol("avvio.TimeTree.addNode");
|
|
4821
4832
|
let fu = class {
|
|
4822
4833
|
constructor() {
|
|
4823
4834
|
this.root = null, this.tableId = /* @__PURE__ */ new Map(), this.tableLabel = /* @__PURE__ */ new Map();
|
|
@@ -4825,7 +4836,7 @@ let fu = class {
|
|
|
4825
4836
|
[Zt](e) {
|
|
4826
4837
|
this.tableId.set(e.id, e), this.tableLabel.has(e.label) ? this.tableLabel.get(e.label).push(e) : this.tableLabel.set(e.label, [e]);
|
|
4827
4838
|
}
|
|
4828
|
-
[
|
|
4839
|
+
[En](e) {
|
|
4829
4840
|
this.tableId.delete(e.id);
|
|
4830
4841
|
const r = this.tableLabel.get(e.label);
|
|
4831
4842
|
if (r.id) {
|
|
@@ -4834,16 +4845,16 @@ let fu = class {
|
|
|
4834
4845
|
}
|
|
4835
4846
|
r.pop(), r.length === 0 && this.tableLabel.delete(e.label);
|
|
4836
4847
|
}
|
|
4837
|
-
[
|
|
4848
|
+
[In](e) {
|
|
4838
4849
|
if (e === null)
|
|
4839
4850
|
return this.root;
|
|
4840
4851
|
const r = this.tableLabel.get(e);
|
|
4841
4852
|
return r.id ? r : r[r.length - 1];
|
|
4842
4853
|
}
|
|
4843
|
-
[
|
|
4854
|
+
[On](e) {
|
|
4844
4855
|
return this.tableId.get(e);
|
|
4845
4856
|
}
|
|
4846
|
-
[
|
|
4857
|
+
[Tn](e, r, n) {
|
|
4847
4858
|
if (e === null)
|
|
4848
4859
|
return this.root = {
|
|
4849
4860
|
id: "root",
|
|
@@ -4851,7 +4862,7 @@ let fu = class {
|
|
|
4851
4862
|
start: n,
|
|
4852
4863
|
nodes: []
|
|
4853
4864
|
}, this[Zt](this.root), this.root.id;
|
|
4854
|
-
const o = this[
|
|
4865
|
+
const o = this[In](e), s = `${r}-${Math.random()}`, a = {
|
|
4855
4866
|
id: s,
|
|
4856
4867
|
parent: e,
|
|
4857
4868
|
start: n,
|
|
@@ -4861,11 +4872,11 @@ let fu = class {
|
|
|
4861
4872
|
return o.nodes.push(a), this[Zt](a), s;
|
|
4862
4873
|
}
|
|
4863
4874
|
start(e, r, n = Date.now()) {
|
|
4864
|
-
return this[
|
|
4875
|
+
return this[Tn](e, r, n);
|
|
4865
4876
|
}
|
|
4866
4877
|
stop(e, r = Date.now()) {
|
|
4867
|
-
const n = this[
|
|
4868
|
-
n && (n.stop = r, n.diff = n.stop - n.start || 0, this[
|
|
4878
|
+
const n = this[On](e);
|
|
4879
|
+
n && (n.stop = r, n.diff = n.stop - n.start || 0, this[En](n));
|
|
4869
4880
|
}
|
|
4870
4881
|
toJSON() {
|
|
4871
4882
|
return Object.assign({}, this.root);
|
|
@@ -4875,10 +4886,10 @@ let fu = class {
|
|
|
4875
4886
|
return lu(r);
|
|
4876
4887
|
}
|
|
4877
4888
|
};
|
|
4878
|
-
var pu = fu, Rr = { exports: {} }, vr = { exports: {} }, er,
|
|
4889
|
+
var pu = fu, Rr = { exports: {} }, vr = { exports: {} }, er, _n;
|
|
4879
4890
|
function hu() {
|
|
4880
|
-
if (
|
|
4881
|
-
|
|
4891
|
+
if (_n) return er;
|
|
4892
|
+
_n = 1;
|
|
4882
4893
|
var t = 1e3, e = t * 60, r = e * 60, n = r * 24, i = n * 7, o = n * 365.25;
|
|
4883
4894
|
er = function(c, f) {
|
|
4884
4895
|
f = f || {};
|
|
@@ -5172,8 +5183,8 @@ var mu = yu;
|
|
|
5172
5183
|
}
|
|
5173
5184
|
};
|
|
5174
5185
|
})(vr, vr.exports);
|
|
5175
|
-
var
|
|
5176
|
-
const gu =
|
|
5186
|
+
var bi = vr.exports;
|
|
5187
|
+
const gu = Gn, bu = ei.EventEmitter, vu = Rt.inherits, x = bi("avvio"), { AVV_ERR_READY_TIMEOUT: Su } = gi, tr = Symbol.for("plugin-meta");
|
|
5177
5188
|
function wu(t, e) {
|
|
5178
5189
|
return t[tr] && t[tr].name ? t[tr].name : typeof e < "u" && typeof e != "function" && e.name ? e.name : t.name ? t.name : t.toString().split(`
|
|
5179
5190
|
`).slice(0, 2).map((r) => r.trim()).join(" -- ");
|
|
@@ -5184,11 +5195,11 @@ function Au() {
|
|
|
5184
5195
|
t.resolve = e, t.reject = r;
|
|
5185
5196
|
}), t;
|
|
5186
5197
|
}
|
|
5187
|
-
function
|
|
5198
|
+
function Xe(t, e, r, n, i) {
|
|
5188
5199
|
this.started = !1, this.func = e, this.opts = r, this.onFinish = null, this.parent = t, this.timeout = i === void 0 ? t._timeout : i, this.name = wu(e, r), this.isAfter = n, this.q = gu(t, Eu, 1), this.q.pause(), this._error = null, this.loaded = !1, this._promise = null;
|
|
5189
5200
|
}
|
|
5190
|
-
vu(
|
|
5191
|
-
|
|
5201
|
+
vu(Xe, bu);
|
|
5202
|
+
Xe.prototype.exec = function(t, e) {
|
|
5192
5203
|
const r = this.func;
|
|
5193
5204
|
let n = !1;
|
|
5194
5205
|
const i = this.name;
|
|
@@ -5224,7 +5235,7 @@ Ye.prototype.exec = function(t, e) {
|
|
|
5224
5235
|
(u) => E.nextTick(s, u)
|
|
5225
5236
|
));
|
|
5226
5237
|
};
|
|
5227
|
-
|
|
5238
|
+
Xe.prototype.loadedSoFar = function() {
|
|
5228
5239
|
if (this.loaded)
|
|
5229
5240
|
return Promise.resolve();
|
|
5230
5241
|
const t = () => {
|
|
@@ -5235,10 +5246,10 @@ Ye.prototype.loadedSoFar = function() {
|
|
|
5235
5246
|
let e;
|
|
5236
5247
|
return this._promise ? e = Promise.resolve() : (this._promise = Au(), e = this._promise.promise, this.server ? t() : this.on("start", t)), e;
|
|
5237
5248
|
};
|
|
5238
|
-
|
|
5249
|
+
Xe.prototype.enqueue = function(t, e) {
|
|
5239
5250
|
x("enqueue", this.name, t.name), this.emit("enqueue", this.server ? this.server.name : null, this.name, Date.now()), this.q.push(t, e);
|
|
5240
5251
|
};
|
|
5241
|
-
|
|
5252
|
+
Xe.prototype.finish = function(t, e) {
|
|
5242
5253
|
x("finish", this.name, t);
|
|
5243
5254
|
const r = () => {
|
|
5244
5255
|
this.loaded || (x("loaded", this.name), this.emit("loaded", this.server ? this.server.name : null, this.name, Date.now()), this.loaded = !0, e(t));
|
|
@@ -5283,16 +5294,16 @@ function Vr(t, e) {
|
|
|
5283
5294
|
}
|
|
5284
5295
|
function Iu() {
|
|
5285
5296
|
}
|
|
5286
|
-
Rr.exports =
|
|
5297
|
+
Rr.exports = Xe;
|
|
5287
5298
|
Rr.exports.loadPlugin = Vr;
|
|
5288
5299
|
var Ou = Rr.exports;
|
|
5289
|
-
const
|
|
5300
|
+
const kn = Gn, Tu = ei.EventEmitter, _u = Rt.inherits, {
|
|
5290
5301
|
AVV_ERR_EXPOSE_ALREADY_DEFINED: rr,
|
|
5291
|
-
AVV_ERR_CALLBACK_NOT_FN:
|
|
5302
|
+
AVV_ERR_CALLBACK_NOT_FN: nt,
|
|
5292
5303
|
AVV_ERR_PLUGIN_NOT_VALID: ku,
|
|
5293
5304
|
AVV_ERR_ROOT_PLG_BOOTED: Pu,
|
|
5294
5305
|
AVV_ERR_READY_TIMEOUT: Cu
|
|
5295
|
-
} =
|
|
5306
|
+
} = gi, Lu = pu, Sr = Ou, Ye = bi("avvio"), Ct = Symbol("kAvvio"), nr = Symbol("kThenifyDoNotWrap");
|
|
5296
5307
|
function Nu(t, e, r) {
|
|
5297
5308
|
const n = e.expose || {}, i = n.use || "use", o = n.after || "after", s = n.ready || "ready", a = n.onClose || "onClose", u = n.close || "close";
|
|
5298
5309
|
if (t[i])
|
|
@@ -5303,19 +5314,19 @@ function Nu(t, e, r) {
|
|
|
5303
5314
|
throw new rr(s);
|
|
5304
5315
|
t[i] = function(d, c) {
|
|
5305
5316
|
return r.use(d, c), this;
|
|
5306
|
-
}, Object.defineProperty(t, "then", { get:
|
|
5317
|
+
}, Object.defineProperty(t, "then", { get: vi.bind(r) }), t[Ct] = !0, t[o] = function(d) {
|
|
5307
5318
|
return typeof d != "function" ? r._loadRegistered() : (r.after(ir(d, this)), this);
|
|
5308
5319
|
}, t[s] = function(d) {
|
|
5309
5320
|
if (d && typeof d != "function")
|
|
5310
|
-
throw new
|
|
5321
|
+
throw new nt(s, typeof d);
|
|
5311
5322
|
return r.ready(d ? ir(d, this) : void 0);
|
|
5312
5323
|
}, t[a] = function(d) {
|
|
5313
5324
|
if (typeof d != "function")
|
|
5314
|
-
throw new
|
|
5325
|
+
throw new nt(a, typeof d);
|
|
5315
5326
|
return r.onClose($u(d, this)), this;
|
|
5316
5327
|
}, t[u] = function(d) {
|
|
5317
5328
|
if (d && typeof d != "function")
|
|
5318
|
-
throw new
|
|
5329
|
+
throw new nt(u, typeof d);
|
|
5319
5330
|
return d ? (r.close(ir(d, this)), this) : r.close();
|
|
5320
5331
|
};
|
|
5321
5332
|
}
|
|
@@ -5324,17 +5335,17 @@ function z(t, e, r) {
|
|
|
5324
5335
|
const n = new z(t, e, r);
|
|
5325
5336
|
return t && Nu(t, e, n), n;
|
|
5326
5337
|
}
|
|
5327
|
-
e.autostart !== !1 && (e.autostart = !0), t = t || this, this._timeout = Number(e.timeout) || 0, this._server = t, this._current = [], this._error = null, this._isOnCloseHandlerKey = Symbol("isOnCloseHandler"), this._lastUsed = null, this.setMaxListeners(0), r && this.once("start", r), this.started = !1, this.booted = !1, this.pluginTree = new Lu(), this._readyQ =
|
|
5328
|
-
this.emit("start"), this._readyQ.drain =
|
|
5329
|
-
}, this._closeQ =
|
|
5330
|
-
this.emit("close"), this._closeQ.drain =
|
|
5338
|
+
e.autostart !== !1 && (e.autostart = !0), t = t || this, this._timeout = Number(e.timeout) || 0, this._server = t, this._current = [], this._error = null, this._isOnCloseHandlerKey = Symbol("isOnCloseHandler"), this._lastUsed = null, this.setMaxListeners(0), r && this.once("start", r), this.started = !1, this.booted = !1, this.pluginTree = new Lu(), this._readyQ = kn(this, Si, 1), this._readyQ.pause(), this._readyQ.drain = () => {
|
|
5339
|
+
this.emit("start"), this._readyQ.drain = Pn;
|
|
5340
|
+
}, this._closeQ = kn(this, Vu, 1), this._closeQ.pause(), this._closeQ.drain = () => {
|
|
5341
|
+
this.emit("close"), this._closeQ.drain = Pn;
|
|
5331
5342
|
}, this._doStart = null, this._root = new Sr(this, Fu.bind(this), e, !1, 0), this._root.once("start", (n, i, o) => {
|
|
5332
5343
|
const s = this.pluginTree.start(null, i, o);
|
|
5333
5344
|
this._root.once("loaded", (a, u, d) => {
|
|
5334
5345
|
this.pluginTree.stop(s, d);
|
|
5335
5346
|
});
|
|
5336
5347
|
}), Sr.loadPlugin.call(this, this._root, (n) => {
|
|
5337
|
-
|
|
5348
|
+
Ye("root plugin ready");
|
|
5338
5349
|
try {
|
|
5339
5350
|
this.emit("preReady"), this._root = null;
|
|
5340
5351
|
} catch (i) {
|
|
@@ -5371,7 +5382,7 @@ z.prototype._loadRegistered = function() {
|
|
|
5371
5382
|
const t = this._current[0];
|
|
5372
5383
|
return !this.started && !this.booted && E.nextTick(() => this._root.q.resume()), t ? t.loadedSoFar() : Promise.resolve();
|
|
5373
5384
|
};
|
|
5374
|
-
Object.defineProperty(z.prototype, "then", { get:
|
|
5385
|
+
Object.defineProperty(z.prototype, "then", { get: vi });
|
|
5375
5386
|
z.prototype._addPlugin = function(t, e, r) {
|
|
5376
5387
|
if (t = Du(t), e = e || {}, this.booted)
|
|
5377
5388
|
throw new Pu();
|
|
@@ -5392,7 +5403,7 @@ z.prototype.after = function(t) {
|
|
|
5392
5403
|
return this._loadRegistered();
|
|
5393
5404
|
this._addPlugin(e.bind(this), {}, !0);
|
|
5394
5405
|
function e(r, n, i) {
|
|
5395
|
-
|
|
5406
|
+
Si.call(this, t, i);
|
|
5396
5407
|
}
|
|
5397
5408
|
return this;
|
|
5398
5409
|
};
|
|
@@ -5409,7 +5420,7 @@ z.prototype.close = function(t) {
|
|
|
5409
5420
|
let e;
|
|
5410
5421
|
if (t) {
|
|
5411
5422
|
if (typeof t != "function")
|
|
5412
|
-
throw new
|
|
5423
|
+
throw new nt("close", typeof t);
|
|
5413
5424
|
} else
|
|
5414
5425
|
e = new Promise(function(r, n) {
|
|
5415
5426
|
t = function(i) {
|
|
@@ -5425,7 +5436,7 @@ z.prototype.close = function(t) {
|
|
|
5425
5436
|
z.prototype.ready = function(t) {
|
|
5426
5437
|
if (t) {
|
|
5427
5438
|
if (typeof t != "function")
|
|
5428
|
-
throw new
|
|
5439
|
+
throw new nt("ready", typeof t);
|
|
5429
5440
|
this._readyQ.push(t), queueMicrotask(this.start.bind(this));
|
|
5430
5441
|
return;
|
|
5431
5442
|
}
|
|
@@ -5443,20 +5454,20 @@ z.prototype.prettyPrint = function() {
|
|
|
5443
5454
|
z.prototype.toJSON = function() {
|
|
5444
5455
|
return this.pluginTree.toJSON();
|
|
5445
5456
|
};
|
|
5446
|
-
function
|
|
5457
|
+
function Pn() {
|
|
5447
5458
|
}
|
|
5448
|
-
function
|
|
5459
|
+
function vi() {
|
|
5449
5460
|
if (this.booted) {
|
|
5450
|
-
|
|
5461
|
+
Ye("thenify returning null because we are already booted");
|
|
5451
5462
|
return;
|
|
5452
5463
|
}
|
|
5453
5464
|
if (this[nr]) {
|
|
5454
5465
|
this[nr] = !1;
|
|
5455
5466
|
return;
|
|
5456
5467
|
}
|
|
5457
|
-
return
|
|
5468
|
+
return Ye("thenify"), (t, e) => this._loadRegistered().then(() => (this[nr] = !0, t(this._server)), e);
|
|
5458
5469
|
}
|
|
5459
|
-
function
|
|
5470
|
+
function Si(t, e) {
|
|
5460
5471
|
const r = this._server, n = this._error;
|
|
5461
5472
|
let i;
|
|
5462
5473
|
if (this._error = null, t.length === 0)
|
|
@@ -5473,9 +5484,9 @@ function vi(t, e) {
|
|
|
5473
5484
|
}
|
|
5474
5485
|
function Ru(t, e, r, n) {
|
|
5475
5486
|
const i = t.name;
|
|
5476
|
-
|
|
5487
|
+
Ye("setting up ready timeout", i, this._timeout);
|
|
5477
5488
|
let o = setTimeout(() => {
|
|
5478
|
-
|
|
5489
|
+
Ye("timed out", i), o = null;
|
|
5479
5490
|
const a = new Cu(i);
|
|
5480
5491
|
a.fn = t, this._error = a, n(a);
|
|
5481
5492
|
}, this._timeout);
|
|
@@ -5488,7 +5499,7 @@ function Vu(t, e) {
|
|
|
5488
5499
|
const r = this._server, n = t[this._isOnCloseHandlerKey];
|
|
5489
5500
|
if (t.length === 0 || t.length === 1) {
|
|
5490
5501
|
let i;
|
|
5491
|
-
n ? i = t(r) : i = t(this._error), i && typeof i.then == "function" ? (
|
|
5502
|
+
n ? i = t(r) : i = t(this._error), i && typeof i.then == "function" ? (Ye("resolving close/onClose promise"), i.then(
|
|
5492
5503
|
() => E.nextTick(e),
|
|
5493
5504
|
(o) => E.nextTick(e, o)
|
|
5494
5505
|
)) : E.nextTick(e);
|
|
@@ -5545,18 +5556,18 @@ const Mu = /* @__PURE__ */ ps(Bu);
|
|
|
5545
5556
|
})();
|
|
5546
5557
|
function cc(t, e = !0, r = !0, n = { friendsTab: "enabled" }) {
|
|
5547
5558
|
const i = e ? "https://grpc-sdk.streamlayer.io:443" : "https://grpc-sdk.next.streamlayer.io:443", o = e ? "https://grpc.streamlayer.io:443" : "https://grpc.next.streamlayer.io:443", s = Mu(/* @__PURE__ */ Object.create({}), { autostart: !1 });
|
|
5548
|
-
return s.use(
|
|
5559
|
+
return s.use(Go, {
|
|
5549
5560
|
hideFriends: n.hideFriends,
|
|
5550
5561
|
skipOnboarding: n.skipOnboarding,
|
|
5551
5562
|
betPack: n.betPack,
|
|
5552
5563
|
friendsTab: n.friendsTab,
|
|
5553
5564
|
theme: n.theme,
|
|
5554
5565
|
themeMode: n.themeMode
|
|
5555
|
-
}), s.use(
|
|
5566
|
+
}), s.use(Bo, { onDeepLinkHandled: n?.onDeepLinkHandled }), s.use(jo, { videoPlayerController: n?.videoPlayerController }), s.use(Qo, {
|
|
5556
5567
|
onContentActivate: n?.onContentActivate,
|
|
5557
5568
|
withAd: n?.withAd,
|
|
5558
5569
|
withAdNotification: n?.withAdNotification
|
|
5559
|
-
}), s.use(
|
|
5570
|
+
}), s.use(no, { sdkKey: t, host: i, analyticsHost: o, version: n?.version }), s.use(uo), s.use(qo), s.use(rs), s.use(Lo), s.use(fs), s.after((a, u, d) => {
|
|
5560
5571
|
if (a)
|
|
5561
5572
|
throw a;
|
|
5562
5573
|
u.ready(), d();
|