@byloth/core 2.0.0-rc.4 → 2.0.0-rc.6
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/dist/core.js +334 -267
- package/dist/core.js.map +1 -1
- package/dist/core.umd.cjs +2 -2
- package/dist/core.umd.cjs.map +1 -1
- package/package.json +4 -4
- package/src/index.ts +2 -1
- package/src/models/aggregators/aggregated-async-iterator.ts +1 -6
- package/src/models/aggregators/aggregated-iterator.ts +1 -6
- package/src/models/game-loop.ts +7 -9
- package/src/models/index.ts +1 -1
- package/src/models/promises/index.ts +2 -1
- package/src/models/promises/thenable.ts +97 -0
- package/src/models/timers/clock.ts +23 -6
- package/src/models/timers/countdown.ts +50 -14
package/dist/core.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var a = (i, t, e) =>
|
|
4
|
-
const
|
|
5
|
-
var F;
|
|
6
|
-
const Je = typeof process < "u" && ((F = process.versions) == null ? void 0 : F.node);
|
|
1
|
+
var Ae = Object.defineProperty;
|
|
2
|
+
var Oe = (i, t, e) => t in i ? Ae(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
3
|
+
var a = (i, t, e) => Oe(i, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
const Re = typeof window < "u" && typeof window.document < "u";
|
|
7
5
|
var P;
|
|
8
|
-
const Ve = typeof
|
|
9
|
-
var
|
|
10
|
-
|
|
6
|
+
const Ve = typeof process < "u" && ((P = process.versions) == null ? void 0 : P.node);
|
|
7
|
+
var I;
|
|
8
|
+
const We = typeof self == "object" && ((I = self.constructor) == null ? void 0 : I.name) === "DedicatedWorkerGlobalScope";
|
|
9
|
+
var j, A;
|
|
10
|
+
class c extends (A = Error, j = Symbol.toStringTag, A) {
|
|
11
11
|
constructor(e, n, r = "Exception") {
|
|
12
12
|
super(e);
|
|
13
13
|
a(this, j, "Exception");
|
|
@@ -27,120 +27,120 @@ Caused by ${n}`);
|
|
|
27
27
|
return new c(`${e}`);
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
var
|
|
31
|
-
class
|
|
30
|
+
var O, C;
|
|
31
|
+
class g extends (C = c, O = Symbol.toStringTag, C) {
|
|
32
32
|
constructor(e, n, r = "FatalErrorException") {
|
|
33
33
|
e === void 0 && (e = "The program has encountered an unrecoverable error and cannot continue as expected. Please, try again later. If the problem persists, contact the support team.");
|
|
34
34
|
super(e, n, r);
|
|
35
|
-
a(this,
|
|
35
|
+
a(this, O, "FatalErrorException");
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
var D,
|
|
39
|
-
class
|
|
38
|
+
var D, q;
|
|
39
|
+
class Ye extends (q = g, D = Symbol.toStringTag, q) {
|
|
40
40
|
constructor(e, n, r = "NotImplementedException") {
|
|
41
41
|
e === void 0 && (e = "This feature is not implemented yet. Please, try again later.");
|
|
42
42
|
super(e, n, r);
|
|
43
43
|
a(this, D, "NotImplementedException");
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
var
|
|
47
|
-
class
|
|
46
|
+
var N, $;
|
|
47
|
+
class Pe extends ($ = c, N = Symbol.toStringTag, $) {
|
|
48
48
|
constructor(e, n, r = "FileException") {
|
|
49
49
|
super(e, n, r);
|
|
50
|
-
a(this,
|
|
50
|
+
a(this, N, "FileException");
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
var
|
|
54
|
-
class
|
|
53
|
+
var J, V;
|
|
54
|
+
class ze extends (V = Pe, J = Symbol.toStringTag, V) {
|
|
55
55
|
constructor(e, n, r = "FileExistsException") {
|
|
56
56
|
super(e, n, r);
|
|
57
|
-
a(this,
|
|
57
|
+
a(this, J, "FileExistsException");
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
var
|
|
61
|
-
class
|
|
60
|
+
var W, Y;
|
|
61
|
+
class Be extends (Y = Pe, W = Symbol.toStringTag, Y) {
|
|
62
62
|
constructor(e, n, r = "FileNotFoundException") {
|
|
63
63
|
super(e, n, r);
|
|
64
|
-
a(this,
|
|
64
|
+
a(this, W, "FileNotFoundException");
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
|
-
var
|
|
68
|
-
class
|
|
67
|
+
var z, B;
|
|
68
|
+
class Ge extends (B = c, z = Symbol.toStringTag, B) {
|
|
69
69
|
constructor(e, n, r = "KeyException") {
|
|
70
70
|
super(e, n, r);
|
|
71
|
-
a(this,
|
|
71
|
+
a(this, z, "KeyException");
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
-
var
|
|
75
|
-
class
|
|
74
|
+
var G, K;
|
|
75
|
+
class Ke extends (K = c, G = Symbol.toStringTag, K) {
|
|
76
76
|
constructor(e, n, r = "NetworkException") {
|
|
77
77
|
super(e, n, r);
|
|
78
|
-
a(this,
|
|
78
|
+
a(this, G, "NetworkException");
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
-
var
|
|
82
|
-
class
|
|
81
|
+
var H, L;
|
|
82
|
+
class He extends (L = c, H = Symbol.toStringTag, L) {
|
|
83
83
|
constructor(e, n, r = "PermissionException") {
|
|
84
84
|
super(e, n, r);
|
|
85
|
-
a(this,
|
|
85
|
+
a(this, H, "PermissionException");
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
-
var
|
|
89
|
-
class Ce extends (
|
|
88
|
+
var Q, X;
|
|
89
|
+
class Ce extends (X = c, Q = Symbol.toStringTag, X) {
|
|
90
90
|
constructor(e, n, r = "ReferenceException") {
|
|
91
91
|
super(e, n, r);
|
|
92
|
-
a(this,
|
|
92
|
+
a(this, Q, "ReferenceException");
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
|
-
var
|
|
96
|
-
class p extends (
|
|
95
|
+
var Z, U;
|
|
96
|
+
class p extends (U = c, Z = Symbol.toStringTag, U) {
|
|
97
97
|
constructor(e, n, r = "RuntimeException") {
|
|
98
98
|
super(e, n, r);
|
|
99
|
-
a(this,
|
|
99
|
+
a(this, Z, "RuntimeException");
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
|
-
var
|
|
103
|
-
class De extends (
|
|
102
|
+
var ee, te;
|
|
103
|
+
class De extends (te = p, ee = Symbol.toStringTag, te) {
|
|
104
104
|
constructor(e, n, r = "EnvironmentException") {
|
|
105
105
|
super(e, n, r);
|
|
106
|
-
a(this,
|
|
106
|
+
a(this, ee, "EnvironmentException");
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
|
-
var
|
|
110
|
-
class
|
|
109
|
+
var ne, re;
|
|
110
|
+
class qe extends (re = c, ne = Symbol.toStringTag, re) {
|
|
111
111
|
constructor(e, n, r = "TimeoutException") {
|
|
112
112
|
super(e, n, r);
|
|
113
|
-
a(this,
|
|
113
|
+
a(this, ne, "TimeoutException");
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
|
-
var
|
|
117
|
-
class
|
|
116
|
+
var se, ie;
|
|
117
|
+
class Le extends (ie = c, se = Symbol.toStringTag, ie) {
|
|
118
118
|
constructor(e, n, r = "TypeException") {
|
|
119
119
|
super(e, n, r);
|
|
120
|
-
a(this,
|
|
120
|
+
a(this, se, "TypeException");
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
|
-
var
|
|
124
|
-
class d extends (
|
|
123
|
+
var oe, ae;
|
|
124
|
+
class d extends (ae = c, oe = Symbol.toStringTag, ae) {
|
|
125
125
|
constructor(e, n, r = "ValueException") {
|
|
126
126
|
super(e, n, r);
|
|
127
|
-
a(this,
|
|
127
|
+
a(this, oe, "ValueException");
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
|
-
var
|
|
131
|
-
class
|
|
130
|
+
var ue, le;
|
|
131
|
+
class Ie extends (le = d, ue = Symbol.toStringTag, le) {
|
|
132
132
|
constructor(e, n, r = "RangeException") {
|
|
133
133
|
super(e, n, r);
|
|
134
|
-
a(this,
|
|
134
|
+
a(this, ue, "RangeException");
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
|
-
var
|
|
138
|
-
class
|
|
137
|
+
var ce;
|
|
138
|
+
class u {
|
|
139
139
|
constructor(t) {
|
|
140
140
|
a(this, "_iterator");
|
|
141
141
|
a(this, "return");
|
|
142
142
|
a(this, "throw");
|
|
143
|
-
a(this,
|
|
143
|
+
a(this, ce, "SmartIterator");
|
|
144
144
|
t instanceof Function ? this._iterator = t() : Symbol.iterator in t ? this._iterator = t[Symbol.iterator]() : this._iterator = t, this._iterator.return && (this.return = (e) => this._iterator.return(e)), this._iterator.throw && (this.throw = (e) => this._iterator.throw(e));
|
|
145
145
|
}
|
|
146
146
|
every(t) {
|
|
@@ -167,7 +167,7 @@ class l {
|
|
|
167
167
|
}
|
|
168
168
|
filter(t) {
|
|
169
169
|
const e = this._iterator;
|
|
170
|
-
return new
|
|
170
|
+
return new u(function* () {
|
|
171
171
|
let n = 0;
|
|
172
172
|
for (; ; ) {
|
|
173
173
|
const r = e.next();
|
|
@@ -179,7 +179,7 @@ class l {
|
|
|
179
179
|
}
|
|
180
180
|
map(t) {
|
|
181
181
|
const e = this._iterator;
|
|
182
|
-
return new
|
|
182
|
+
return new u(function* () {
|
|
183
183
|
let n = 0;
|
|
184
184
|
for (; ; ) {
|
|
185
185
|
const r = e.next();
|
|
@@ -206,7 +206,7 @@ class l {
|
|
|
206
206
|
}
|
|
207
207
|
flatMap(t) {
|
|
208
208
|
const e = this._iterator;
|
|
209
|
-
return new
|
|
209
|
+
return new u(function* () {
|
|
210
210
|
let n = 0;
|
|
211
211
|
for (; ; ) {
|
|
212
212
|
const r = e.next();
|
|
@@ -221,7 +221,7 @@ class l {
|
|
|
221
221
|
}
|
|
222
222
|
drop(t) {
|
|
223
223
|
const e = this._iterator;
|
|
224
|
-
return new
|
|
224
|
+
return new u(function* () {
|
|
225
225
|
let n = 0;
|
|
226
226
|
for (; n < t; ) {
|
|
227
227
|
if (e.next().done)
|
|
@@ -238,7 +238,7 @@ class l {
|
|
|
238
238
|
}
|
|
239
239
|
take(t) {
|
|
240
240
|
const e = this._iterator;
|
|
241
|
-
return new
|
|
241
|
+
return new u(function* () {
|
|
242
242
|
let n = 0;
|
|
243
243
|
for (; n < t; ) {
|
|
244
244
|
const r = e.next();
|
|
@@ -264,7 +264,7 @@ class l {
|
|
|
264
264
|
}
|
|
265
265
|
unique() {
|
|
266
266
|
const t = this._iterator;
|
|
267
|
-
return new
|
|
267
|
+
return new u(function* () {
|
|
268
268
|
const e = /* @__PURE__ */ new Set();
|
|
269
269
|
for (; ; ) {
|
|
270
270
|
const n = t.next();
|
|
@@ -295,22 +295,22 @@ class l {
|
|
|
295
295
|
return this._iterator.next(...t);
|
|
296
296
|
}
|
|
297
297
|
groupBy(t) {
|
|
298
|
-
return new
|
|
298
|
+
return new v(this.map((e, n) => [t(e, n), e]));
|
|
299
299
|
}
|
|
300
300
|
toArray() {
|
|
301
301
|
return Array.from(this);
|
|
302
302
|
}
|
|
303
|
-
[(
|
|
303
|
+
[(ce = Symbol.toStringTag, Symbol.iterator)]() {
|
|
304
304
|
return this;
|
|
305
305
|
}
|
|
306
306
|
}
|
|
307
|
-
var
|
|
308
|
-
|
|
309
|
-
const
|
|
307
|
+
var fe;
|
|
308
|
+
fe = Symbol.toStringTag;
|
|
309
|
+
const _ = class _ {
|
|
310
310
|
constructor(t) {
|
|
311
311
|
a(this, "_elements");
|
|
312
|
-
a(this,
|
|
313
|
-
this._elements = new
|
|
312
|
+
a(this, fe, "ReducedIterator");
|
|
313
|
+
this._elements = new u(t);
|
|
314
314
|
}
|
|
315
315
|
every(t) {
|
|
316
316
|
for (const [e, [n, r]] of this._elements.enumerate())
|
|
@@ -326,14 +326,14 @@ const y = class y {
|
|
|
326
326
|
}
|
|
327
327
|
filter(t) {
|
|
328
328
|
const e = this._elements.enumerate();
|
|
329
|
-
return new
|
|
329
|
+
return new _(function* () {
|
|
330
330
|
for (const [n, [r, s]] of e)
|
|
331
331
|
t(r, s, n) && (yield [r, s]);
|
|
332
332
|
});
|
|
333
333
|
}
|
|
334
334
|
map(t) {
|
|
335
335
|
const e = this._elements.enumerate();
|
|
336
|
-
return new
|
|
336
|
+
return new _(function* () {
|
|
337
337
|
for (const [n, [r, s]] of e)
|
|
338
338
|
yield [r, t(r, s, n)];
|
|
339
339
|
});
|
|
@@ -352,7 +352,7 @@ const y = class y {
|
|
|
352
352
|
}
|
|
353
353
|
flatMap(t) {
|
|
354
354
|
const e = this._elements.enumerate();
|
|
355
|
-
return new
|
|
355
|
+
return new v(function* () {
|
|
356
356
|
for (const [n, [r, s]] of e)
|
|
357
357
|
for (const o of t(r, s, n))
|
|
358
358
|
yield [r, o];
|
|
@@ -360,14 +360,14 @@ const y = class y {
|
|
|
360
360
|
}
|
|
361
361
|
drop(t) {
|
|
362
362
|
const e = this._elements.enumerate();
|
|
363
|
-
return new
|
|
363
|
+
return new _(function* () {
|
|
364
364
|
for (const [n, [r, s]] of e)
|
|
365
365
|
n >= t && (yield [r, s]);
|
|
366
366
|
});
|
|
367
367
|
}
|
|
368
368
|
take(t) {
|
|
369
369
|
const e = this._elements.enumerate();
|
|
370
|
-
return new
|
|
370
|
+
return new _(function* () {
|
|
371
371
|
for (const [n, [r, s]] of e) {
|
|
372
372
|
if (n >= t)
|
|
373
373
|
break;
|
|
@@ -380,7 +380,7 @@ const y = class y {
|
|
|
380
380
|
}
|
|
381
381
|
unique() {
|
|
382
382
|
const t = this._elements;
|
|
383
|
-
return new
|
|
383
|
+
return new _(function* () {
|
|
384
384
|
const e = /* @__PURE__ */ new Set();
|
|
385
385
|
for (const [n, r] of t)
|
|
386
386
|
e.has(r) || (e.add(r), yield [n, r]);
|
|
@@ -398,7 +398,7 @@ const y = class y {
|
|
|
398
398
|
}
|
|
399
399
|
keys() {
|
|
400
400
|
const t = this._elements;
|
|
401
|
-
return new
|
|
401
|
+
return new u(function* () {
|
|
402
402
|
for (const [e] of t)
|
|
403
403
|
yield e;
|
|
404
404
|
});
|
|
@@ -408,7 +408,7 @@ const y = class y {
|
|
|
408
408
|
}
|
|
409
409
|
values() {
|
|
410
410
|
const t = this._elements;
|
|
411
|
-
return new
|
|
411
|
+
return new u(function* () {
|
|
412
412
|
for (const [e, n] of t)
|
|
413
413
|
yield n;
|
|
414
414
|
});
|
|
@@ -423,13 +423,13 @@ const y = class y {
|
|
|
423
423
|
return Object.fromEntries(this.items());
|
|
424
424
|
}
|
|
425
425
|
};
|
|
426
|
-
let f =
|
|
427
|
-
var
|
|
428
|
-
|
|
426
|
+
let f = _;
|
|
427
|
+
var he;
|
|
428
|
+
he = Symbol.toStringTag;
|
|
429
429
|
const m = class m {
|
|
430
430
|
constructor(t) {
|
|
431
431
|
a(this, "_elements");
|
|
432
|
-
a(this,
|
|
432
|
+
a(this, he, "AggregatedAsyncIterator");
|
|
433
433
|
this._elements = new h(t);
|
|
434
434
|
}
|
|
435
435
|
async every(t) {
|
|
@@ -477,16 +477,16 @@ const m = class m {
|
|
|
477
477
|
async reduce(t, e) {
|
|
478
478
|
const n = /* @__PURE__ */ new Map();
|
|
479
479
|
for await (const [r, s] of this._elements) {
|
|
480
|
-
let o,
|
|
480
|
+
let o, l;
|
|
481
481
|
if (n.has(r))
|
|
482
|
-
[o,
|
|
482
|
+
[o, l] = n.get(r);
|
|
483
483
|
else if (e !== void 0)
|
|
484
|
-
o = 0,
|
|
484
|
+
o = 0, l = await e(r);
|
|
485
485
|
else {
|
|
486
486
|
n.set(r, [0, s]);
|
|
487
487
|
continue;
|
|
488
488
|
}
|
|
489
|
-
n.set(r, [o + 1, await t(r,
|
|
489
|
+
n.set(r, [o + 1, await t(r, l, s, o)]);
|
|
490
490
|
}
|
|
491
491
|
return new f(function* () {
|
|
492
492
|
for (const [r, [s, o]] of n)
|
|
@@ -498,9 +498,9 @@ const m = class m {
|
|
|
498
498
|
return new m(async function* () {
|
|
499
499
|
const n = /* @__PURE__ */ new Map();
|
|
500
500
|
for await (const [r, s] of e) {
|
|
501
|
-
const o = n.get(r) ?? 0,
|
|
502
|
-
for await (const
|
|
503
|
-
yield [r,
|
|
501
|
+
const o = n.get(r) ?? 0, l = await t(r, s, o);
|
|
502
|
+
for await (const x of l)
|
|
503
|
+
yield [r, x];
|
|
504
504
|
n.set(r, o + 1);
|
|
505
505
|
}
|
|
506
506
|
});
|
|
@@ -525,12 +525,7 @@ const m = class m {
|
|
|
525
525
|
const n = /* @__PURE__ */ new Map();
|
|
526
526
|
for await (const [r, s] of e) {
|
|
527
527
|
const o = n.get(r) ?? 0;
|
|
528
|
-
|
|
529
|
-
if (n.values().every((u) => u >= t))
|
|
530
|
-
break;
|
|
531
|
-
continue;
|
|
532
|
-
}
|
|
533
|
-
yield [r, s], n.set(r, o + 1);
|
|
528
|
+
o >= t || (yield [r, s], n.set(r, o + 1));
|
|
534
529
|
}
|
|
535
530
|
});
|
|
536
531
|
}
|
|
@@ -613,13 +608,13 @@ const m = class m {
|
|
|
613
608
|
}
|
|
614
609
|
};
|
|
615
610
|
let S = m;
|
|
616
|
-
var
|
|
611
|
+
var de;
|
|
617
612
|
class h {
|
|
618
613
|
constructor(t) {
|
|
619
614
|
a(this, "_iterator");
|
|
620
615
|
a(this, "return");
|
|
621
616
|
a(this, "throw");
|
|
622
|
-
a(this,
|
|
617
|
+
a(this, de, "SmartAsyncIterator");
|
|
623
618
|
if (t instanceof Function) {
|
|
624
619
|
const e = t();
|
|
625
620
|
Symbol.asyncIterator in e ? this._iterator = e : this._iterator = async function* () {
|
|
@@ -812,17 +807,17 @@ class h {
|
|
|
812
807
|
toArray() {
|
|
813
808
|
return Array.fromAsync(this);
|
|
814
809
|
}
|
|
815
|
-
[(
|
|
810
|
+
[(de = Symbol.toStringTag, Symbol.asyncIterator)]() {
|
|
816
811
|
return this;
|
|
817
812
|
}
|
|
818
813
|
}
|
|
819
|
-
var
|
|
820
|
-
|
|
814
|
+
var me;
|
|
815
|
+
me = Symbol.toStringTag;
|
|
821
816
|
const w = class w {
|
|
822
817
|
constructor(t) {
|
|
823
818
|
a(this, "_elements");
|
|
824
|
-
a(this,
|
|
825
|
-
this._elements = new
|
|
819
|
+
a(this, me, "AggregatedIterator");
|
|
820
|
+
this._elements = new u(t);
|
|
826
821
|
}
|
|
827
822
|
every(t) {
|
|
828
823
|
const e = /* @__PURE__ */ new Map();
|
|
@@ -869,16 +864,16 @@ const w = class w {
|
|
|
869
864
|
reduce(t, e) {
|
|
870
865
|
const n = /* @__PURE__ */ new Map();
|
|
871
866
|
for (const [r, s] of this._elements) {
|
|
872
|
-
let o,
|
|
867
|
+
let o, l;
|
|
873
868
|
if (n.has(r))
|
|
874
|
-
[o,
|
|
869
|
+
[o, l] = n.get(r);
|
|
875
870
|
else if (e !== void 0)
|
|
876
|
-
o = 0,
|
|
871
|
+
o = 0, l = e(r);
|
|
877
872
|
else {
|
|
878
873
|
n.set(r, [0, s]);
|
|
879
874
|
continue;
|
|
880
875
|
}
|
|
881
|
-
n.set(r, [o + 1, t(r,
|
|
876
|
+
n.set(r, [o + 1, t(r, l, s, o)]);
|
|
882
877
|
}
|
|
883
878
|
return new f(function* () {
|
|
884
879
|
for (const [r, [s, o]] of n)
|
|
@@ -890,9 +885,9 @@ const w = class w {
|
|
|
890
885
|
return new w(function* () {
|
|
891
886
|
const n = /* @__PURE__ */ new Map();
|
|
892
887
|
for (const [r, s] of e) {
|
|
893
|
-
const o = n.get(r) ?? 0,
|
|
894
|
-
for (const
|
|
895
|
-
yield [r,
|
|
888
|
+
const o = n.get(r) ?? 0, l = t(r, s, o);
|
|
889
|
+
for (const x of l)
|
|
890
|
+
yield [r, x];
|
|
896
891
|
n.set(r, o + 1);
|
|
897
892
|
}
|
|
898
893
|
});
|
|
@@ -917,12 +912,7 @@ const w = class w {
|
|
|
917
912
|
const n = /* @__PURE__ */ new Map();
|
|
918
913
|
for (const [r, s] of e) {
|
|
919
914
|
const o = n.get(r) ?? 0;
|
|
920
|
-
|
|
921
|
-
if (n.values().every((u) => u >= t))
|
|
922
|
-
break;
|
|
923
|
-
continue;
|
|
924
|
-
}
|
|
925
|
-
yield [r, s], n.set(r, o + 1);
|
|
915
|
+
o >= t || (yield [r, s], n.set(r, o + 1));
|
|
926
916
|
}
|
|
927
917
|
});
|
|
928
918
|
}
|
|
@@ -970,7 +960,7 @@ const w = class w {
|
|
|
970
960
|
}
|
|
971
961
|
keys() {
|
|
972
962
|
const t = this._elements;
|
|
973
|
-
return new
|
|
963
|
+
return new u(function* () {
|
|
974
964
|
const e = /* @__PURE__ */ new Set();
|
|
975
965
|
for (const [n] of t)
|
|
976
966
|
e.has(n) || (e.add(n), yield n);
|
|
@@ -981,7 +971,7 @@ const w = class w {
|
|
|
981
971
|
}
|
|
982
972
|
values() {
|
|
983
973
|
const t = this._elements;
|
|
984
|
-
return new
|
|
974
|
+
return new u(function* () {
|
|
985
975
|
for (const [e, n] of t)
|
|
986
976
|
yield n;
|
|
987
977
|
});
|
|
@@ -1007,39 +997,23 @@ const w = class w {
|
|
|
1007
997
|
return t;
|
|
1008
998
|
}
|
|
1009
999
|
};
|
|
1010
|
-
let
|
|
1011
|
-
var
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
function Qe(i, t, e = 864e5) {
|
|
1016
|
-
return i = new Date(i), t = new Date(t), new l(function* () {
|
|
1017
|
-
const n = t.getTime();
|
|
1018
|
-
let r = i.getTime();
|
|
1019
|
-
for (; r < n; )
|
|
1020
|
-
yield new Date(r), r += e;
|
|
1021
|
-
});
|
|
1022
|
-
}
|
|
1023
|
-
function Xe(i, t = 864e5) {
|
|
1024
|
-
return i = new Date(i), new Date(Math.floor(i.getTime() / t) * t);
|
|
1025
|
-
}
|
|
1026
|
-
var me;
|
|
1027
|
-
me = Symbol.toStringTag;
|
|
1028
|
-
class Pe {
|
|
1029
|
-
constructor(t, e = 30) {
|
|
1000
|
+
let v = w;
|
|
1001
|
+
var we;
|
|
1002
|
+
we = Symbol.toStringTag;
|
|
1003
|
+
class je {
|
|
1004
|
+
constructor(t, e = 40) {
|
|
1030
1005
|
a(this, "_handle");
|
|
1031
1006
|
a(this, "_startTime");
|
|
1032
1007
|
a(this, "_isRunning");
|
|
1033
1008
|
a(this, "_start");
|
|
1034
1009
|
a(this, "_stop");
|
|
1035
|
-
a(this,
|
|
1036
|
-
this._startTime = 0, this._isRunning = !1,
|
|
1010
|
+
a(this, we, "GameLoop");
|
|
1011
|
+
this._startTime = 0, this._isRunning = !1, Re ? (this._start = () => {
|
|
1037
1012
|
t(this.elapsedTime), this._handle = window.requestAnimationFrame(this._start);
|
|
1038
1013
|
}, this._stop = () => window.cancelAnimationFrame(this._handle)) : (console.warn(
|
|
1039
|
-
`Not a browser environment detected. Using setInterval@${e}
|
|
1014
|
+
`Not a browser environment detected. Using setInterval@${e}ms instead of requestAnimationFrame...`
|
|
1040
1015
|
), this._start = () => {
|
|
1041
|
-
|
|
1042
|
-
this._handle = setInterval(() => t(this.elapsedTime), n);
|
|
1016
|
+
this._handle = setInterval(() => t(this.elapsedTime), e);
|
|
1043
1017
|
}, this._stop = () => clearInterval(this._handle));
|
|
1044
1018
|
}
|
|
1045
1019
|
get startTime() {
|
|
@@ -1060,19 +1034,19 @@ class Pe {
|
|
|
1060
1034
|
if (!this._isRunning)
|
|
1061
1035
|
throw new p("The game loop hadn't yet started.");
|
|
1062
1036
|
if (!this._handle)
|
|
1063
|
-
throw new
|
|
1037
|
+
throw new g();
|
|
1064
1038
|
this._stop(), this._handle = void 0, this._isRunning = !1;
|
|
1065
1039
|
}
|
|
1066
1040
|
}
|
|
1067
|
-
var
|
|
1068
|
-
|
|
1069
|
-
class
|
|
1041
|
+
var _e;
|
|
1042
|
+
_e = Symbol.toStringTag;
|
|
1043
|
+
class Qe {
|
|
1070
1044
|
constructor(t = !0) {
|
|
1071
1045
|
a(this, "_preferPersistence");
|
|
1072
1046
|
a(this, "_volatile");
|
|
1073
1047
|
a(this, "_persistent");
|
|
1074
|
-
a(this,
|
|
1075
|
-
if (this._preferPersistence = t, !
|
|
1048
|
+
a(this, _e, "JSONStorage");
|
|
1049
|
+
if (this._preferPersistence = t, !Re)
|
|
1076
1050
|
throw new De(
|
|
1077
1051
|
"The `JSONStorage` class can only be instantiated within a browser environment."
|
|
1078
1052
|
);
|
|
@@ -1208,7 +1182,7 @@ class Ze {
|
|
|
1208
1182
|
}
|
|
1209
1183
|
var ye;
|
|
1210
1184
|
ye = Symbol.toStringTag;
|
|
1211
|
-
const
|
|
1185
|
+
const T = class T {
|
|
1212
1186
|
constructor(t) {
|
|
1213
1187
|
a(this, "_isPending");
|
|
1214
1188
|
a(this, "_isFulfilled");
|
|
@@ -1222,7 +1196,7 @@ const E = class E {
|
|
|
1222
1196
|
this._promise = new Promise(t).then(e, n);
|
|
1223
1197
|
}
|
|
1224
1198
|
static FromPromise(t) {
|
|
1225
|
-
return new
|
|
1199
|
+
return new T((e, n) => t.then(e, n));
|
|
1226
1200
|
}
|
|
1227
1201
|
get isPending() {
|
|
1228
1202
|
return this._isPending;
|
|
@@ -1243,13 +1217,13 @@ const E = class E {
|
|
|
1243
1217
|
return this._promise.finally(t);
|
|
1244
1218
|
}
|
|
1245
1219
|
};
|
|
1246
|
-
let
|
|
1247
|
-
var pe,
|
|
1248
|
-
class
|
|
1220
|
+
let b = T;
|
|
1221
|
+
var pe, xe;
|
|
1222
|
+
class Ne extends (xe = b, pe = Symbol.toStringTag, xe) {
|
|
1249
1223
|
constructor(e, n) {
|
|
1250
1224
|
let r, s;
|
|
1251
|
-
super((o,
|
|
1252
|
-
r = o, s =
|
|
1225
|
+
super((o, l) => {
|
|
1226
|
+
r = o, s = l;
|
|
1253
1227
|
});
|
|
1254
1228
|
a(this, "_resolve");
|
|
1255
1229
|
a(this, "_reject");
|
|
@@ -1266,26 +1240,80 @@ class qe extends (_e = v, pe = Symbol.toStringTag, _e) {
|
|
|
1266
1240
|
return e.then(this.resolve, this.reject), this;
|
|
1267
1241
|
}
|
|
1268
1242
|
}
|
|
1269
|
-
var
|
|
1270
|
-
|
|
1243
|
+
var ge;
|
|
1244
|
+
ge = Symbol.toStringTag;
|
|
1245
|
+
class Xe {
|
|
1246
|
+
constructor() {
|
|
1247
|
+
a(this, "_onFulfilled");
|
|
1248
|
+
a(this, ge, "Thenable");
|
|
1249
|
+
this._onFulfilled = (t) => t;
|
|
1250
|
+
}
|
|
1251
|
+
_resolve(t) {
|
|
1252
|
+
return this._onFulfilled(t);
|
|
1253
|
+
}
|
|
1254
|
+
then(t, e) {
|
|
1255
|
+
if (e) {
|
|
1256
|
+
const n = this._onFulfilled;
|
|
1257
|
+
this._onFulfilled = (r) => {
|
|
1258
|
+
try {
|
|
1259
|
+
return r = n(r), t(r);
|
|
1260
|
+
} catch (s) {
|
|
1261
|
+
return e(s);
|
|
1262
|
+
}
|
|
1263
|
+
};
|
|
1264
|
+
} else if (t) {
|
|
1265
|
+
const n = this._onFulfilled;
|
|
1266
|
+
this._onFulfilled = (r) => (r = n(r), t(r));
|
|
1267
|
+
}
|
|
1268
|
+
return this;
|
|
1269
|
+
}
|
|
1270
|
+
catch(t) {
|
|
1271
|
+
if (t) {
|
|
1272
|
+
const e = this._onFulfilled;
|
|
1273
|
+
this._onFulfilled = (n) => {
|
|
1274
|
+
try {
|
|
1275
|
+
return e(n);
|
|
1276
|
+
} catch (r) {
|
|
1277
|
+
return t(r);
|
|
1278
|
+
}
|
|
1279
|
+
};
|
|
1280
|
+
}
|
|
1281
|
+
return this;
|
|
1282
|
+
}
|
|
1283
|
+
finally(t) {
|
|
1284
|
+
if (t) {
|
|
1285
|
+
const e = this._onFulfilled;
|
|
1286
|
+
this._onFulfilled = (n) => {
|
|
1287
|
+
try {
|
|
1288
|
+
return e(n);
|
|
1289
|
+
} finally {
|
|
1290
|
+
t();
|
|
1291
|
+
}
|
|
1292
|
+
};
|
|
1293
|
+
}
|
|
1294
|
+
return this;
|
|
1295
|
+
}
|
|
1296
|
+
}
|
|
1297
|
+
var ve, be;
|
|
1298
|
+
class Ze extends (be = b, ve = Symbol.toStringTag, be) {
|
|
1271
1299
|
constructor(e, n) {
|
|
1272
1300
|
super((r, s) => {
|
|
1273
1301
|
const o = (k) => {
|
|
1274
|
-
clearTimeout(
|
|
1275
|
-
},
|
|
1276
|
-
clearTimeout(
|
|
1277
|
-
},
|
|
1278
|
-
e(o,
|
|
1302
|
+
clearTimeout(F), r(k);
|
|
1303
|
+
}, l = (k) => {
|
|
1304
|
+
clearTimeout(F), s(k);
|
|
1305
|
+
}, F = setTimeout(() => l(new qe("The operation has timed out.")), n);
|
|
1306
|
+
e(o, l);
|
|
1279
1307
|
});
|
|
1280
|
-
a(this,
|
|
1308
|
+
a(this, ve, "TimedPromise");
|
|
1281
1309
|
}
|
|
1282
1310
|
}
|
|
1283
|
-
var
|
|
1284
|
-
|
|
1285
|
-
class
|
|
1311
|
+
var ke;
|
|
1312
|
+
ke = Symbol.toStringTag;
|
|
1313
|
+
class y {
|
|
1286
1314
|
constructor() {
|
|
1287
1315
|
a(this, "_subscribers");
|
|
1288
|
-
a(this,
|
|
1316
|
+
a(this, ke, "Publisher");
|
|
1289
1317
|
this._subscribers = [];
|
|
1290
1318
|
}
|
|
1291
1319
|
subscribe(t) {
|
|
@@ -1300,47 +1328,73 @@ class je {
|
|
|
1300
1328
|
return this._subscribers.slice().map((e) => e(...t));
|
|
1301
1329
|
}
|
|
1302
1330
|
}
|
|
1303
|
-
var
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1331
|
+
var E = /* @__PURE__ */ ((i) => (i[i.Millisecond = 1] = "Millisecond", i[i.Second = 1e3] = "Second", i[i.Minute = 6e4] = "Minute", i[i.Hour = 36e5] = "Hour", i[i.Day = 864e5] = "Day", i[i.Week = 6048e5] = "Week", i[i.Month = 2592e6] = "Month", i[i.Year = 31536e6] = "Year", i))(E || {});
|
|
1332
|
+
function Ue(i, t, e = 864e5) {
|
|
1333
|
+
return i = new Date(i), t = new Date(t), Math.floor((t.getTime() - i.getTime()) / e);
|
|
1334
|
+
}
|
|
1335
|
+
function et(i, t, e = 864e5) {
|
|
1336
|
+
return i = new Date(i), t = new Date(t), new u(function* () {
|
|
1337
|
+
const n = t.getTime();
|
|
1338
|
+
let r = i.getTime();
|
|
1339
|
+
for (; r < n; )
|
|
1340
|
+
yield new Date(r), r += e;
|
|
1341
|
+
});
|
|
1342
|
+
}
|
|
1343
|
+
function tt(i, t = 864e5) {
|
|
1344
|
+
return i = new Date(i), new Date(Math.floor(i.getTime() / t) * t);
|
|
1345
|
+
}
|
|
1346
|
+
var Se, Ee;
|
|
1347
|
+
class nt extends (Ee = je, Se = Symbol.toStringTag, Ee) {
|
|
1348
|
+
constructor(e = E.Second) {
|
|
1349
|
+
super((n) => this._ticker.publish(n), e);
|
|
1350
|
+
a(this, "_starter");
|
|
1351
|
+
a(this, "_stopper");
|
|
1352
|
+
a(this, "_ticker");
|
|
1353
|
+
a(this, Se, "Clock");
|
|
1354
|
+
this._starter = new y(), this._stopper = new y(), this._ticker = new y();
|
|
1310
1355
|
}
|
|
1311
1356
|
start(e = 0) {
|
|
1312
1357
|
if (this._isRunning)
|
|
1313
1358
|
throw new p("The clock has already been started.");
|
|
1314
|
-
super.start(e);
|
|
1359
|
+
super.start(e), this._starter.publish();
|
|
1315
1360
|
}
|
|
1316
1361
|
stop() {
|
|
1317
1362
|
if (!this._isRunning)
|
|
1318
1363
|
throw new p("The clock hadn't yet started.");
|
|
1319
|
-
super.stop();
|
|
1364
|
+
super.stop(), this._stopper.publish();
|
|
1365
|
+
}
|
|
1366
|
+
onStart(e) {
|
|
1367
|
+
return this._starter.subscribe(e);
|
|
1368
|
+
}
|
|
1369
|
+
onStop(e) {
|
|
1370
|
+
return this._stopper.subscribe(e);
|
|
1320
1371
|
}
|
|
1321
1372
|
onTick(e, n = 0) {
|
|
1322
1373
|
if (n < 0)
|
|
1323
|
-
throw new
|
|
1374
|
+
throw new Ie("The tick step must be a non-negative number.");
|
|
1324
1375
|
if (n === 0)
|
|
1325
|
-
return this.
|
|
1376
|
+
return this._ticker.subscribe(e);
|
|
1326
1377
|
let r = 0;
|
|
1327
|
-
return this.
|
|
1378
|
+
return this._ticker.subscribe((s) => {
|
|
1328
1379
|
s - r < n || (e(s), r = s);
|
|
1329
1380
|
});
|
|
1330
1381
|
}
|
|
1331
1382
|
}
|
|
1332
|
-
var
|
|
1333
|
-
class
|
|
1334
|
-
constructor(e, n =
|
|
1383
|
+
var Te, Me;
|
|
1384
|
+
class rt extends (Me = je, Te = Symbol.toStringTag, Me) {
|
|
1385
|
+
constructor(e, n = E.Second) {
|
|
1335
1386
|
super(() => {
|
|
1336
1387
|
const s = this.remainingTime;
|
|
1337
|
-
this.
|
|
1388
|
+
this._ticker.publish(s), s <= 0 && (this._deferrerStop(), this._expirer.publish());
|
|
1338
1389
|
}, n);
|
|
1339
1390
|
a(this, "_deferrer");
|
|
1340
|
-
a(this, "
|
|
1391
|
+
a(this, "_expirer");
|
|
1392
|
+
a(this, "_starter");
|
|
1393
|
+
a(this, "_stopper");
|
|
1394
|
+
a(this, "_ticker");
|
|
1341
1395
|
a(this, "_duration");
|
|
1342
|
-
a(this,
|
|
1343
|
-
this.
|
|
1396
|
+
a(this, Te, "Countdown");
|
|
1397
|
+
this._expirer = new y(), this._starter = new y(), this._stopper = new y(), this._ticker = new y(), this._duration = e;
|
|
1344
1398
|
}
|
|
1345
1399
|
get duration() {
|
|
1346
1400
|
return this._duration;
|
|
@@ -1348,36 +1402,48 @@ class tt extends (Ee = Pe, Se = Symbol.toStringTag, Ee) {
|
|
|
1348
1402
|
get remainingTime() {
|
|
1349
1403
|
return this._duration - this.elapsedTime;
|
|
1350
1404
|
}
|
|
1405
|
+
_deferrerStop(e) {
|
|
1406
|
+
if (!this._isRunning)
|
|
1407
|
+
throw new p("The countdown hadn't yet started.");
|
|
1408
|
+
if (!this._deferrer)
|
|
1409
|
+
throw new g();
|
|
1410
|
+
super.stop(), e !== void 0 ? this._deferrer.reject(e) : this._deferrer.resolve(), this._deferrer = void 0;
|
|
1411
|
+
}
|
|
1351
1412
|
start(e = this.duration) {
|
|
1352
1413
|
if (this._isRunning)
|
|
1353
1414
|
throw new p("The countdown has already been started.");
|
|
1354
1415
|
if (this._deferrer)
|
|
1355
|
-
throw new
|
|
1356
|
-
return this._deferrer = new
|
|
1416
|
+
throw new g();
|
|
1417
|
+
return this._deferrer = new Ne(), super.start(this.duration - e), this._starter.publish(), this._deferrer;
|
|
1357
1418
|
}
|
|
1358
1419
|
stop(e) {
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1420
|
+
this._deferrerStop(e), this._stopper.publish(e);
|
|
1421
|
+
}
|
|
1422
|
+
onExpire(e) {
|
|
1423
|
+
return this._expirer.subscribe(e);
|
|
1424
|
+
}
|
|
1425
|
+
onStart(e) {
|
|
1426
|
+
return this._starter.subscribe(e);
|
|
1427
|
+
}
|
|
1428
|
+
onStop(e) {
|
|
1429
|
+
return this._stopper.subscribe(e);
|
|
1364
1430
|
}
|
|
1365
1431
|
onTick(e, n = 0) {
|
|
1366
1432
|
if (n < 0)
|
|
1367
|
-
throw new
|
|
1433
|
+
throw new Ie("The tick step must be a non-negative number.");
|
|
1368
1434
|
if (n === 0)
|
|
1369
|
-
return this.
|
|
1435
|
+
return this._ticker.subscribe(e);
|
|
1370
1436
|
let r = 0;
|
|
1371
|
-
return this.
|
|
1437
|
+
return this._ticker.subscribe((s) => {
|
|
1372
1438
|
r - s < n || (e(s), r = s);
|
|
1373
1439
|
});
|
|
1374
1440
|
}
|
|
1375
1441
|
}
|
|
1376
|
-
var
|
|
1377
|
-
|
|
1378
|
-
const
|
|
1442
|
+
var Fe;
|
|
1443
|
+
Fe = Symbol.toStringTag;
|
|
1444
|
+
const M = class M {
|
|
1379
1445
|
constructor() {
|
|
1380
|
-
a(this,
|
|
1446
|
+
a(this, Fe, "Random");
|
|
1381
1447
|
}
|
|
1382
1448
|
static Boolean(t = 0.5) {
|
|
1383
1449
|
return Math.random() < t;
|
|
@@ -1394,30 +1460,30 @@ const T = class T {
|
|
|
1394
1460
|
return this.Integer(t.length);
|
|
1395
1461
|
}
|
|
1396
1462
|
static Choice(t) {
|
|
1397
|
-
return t[
|
|
1463
|
+
return t[M.Index(t)];
|
|
1398
1464
|
}
|
|
1399
1465
|
};
|
|
1400
|
-
let R =
|
|
1401
|
-
function
|
|
1466
|
+
let R = M;
|
|
1467
|
+
function st(i) {
|
|
1402
1468
|
return new Promise((t) => setTimeout(t, i));
|
|
1403
1469
|
}
|
|
1404
|
-
function
|
|
1470
|
+
function it() {
|
|
1405
1471
|
return new Promise((i) => requestAnimationFrame(() => i()));
|
|
1406
1472
|
}
|
|
1407
|
-
function
|
|
1473
|
+
function ot(i, t = "text/javascript") {
|
|
1408
1474
|
return new Promise((e, n) => {
|
|
1409
1475
|
const r = document.createElement("script");
|
|
1410
1476
|
r.async = !0, r.defer = !0, r.src = i, r.type = t, r.onload = () => e(), r.onerror = () => n(), document.body.appendChild(r);
|
|
1411
1477
|
});
|
|
1412
1478
|
}
|
|
1413
|
-
function
|
|
1414
|
-
return new
|
|
1479
|
+
function at(...i) {
|
|
1480
|
+
return new u(function* () {
|
|
1415
1481
|
for (const t of i)
|
|
1416
1482
|
for (const e of t)
|
|
1417
1483
|
yield e;
|
|
1418
1484
|
});
|
|
1419
1485
|
}
|
|
1420
|
-
function
|
|
1486
|
+
function ut(i) {
|
|
1421
1487
|
if (Array.isArray(i))
|
|
1422
1488
|
return i.length;
|
|
1423
1489
|
let t = 0;
|
|
@@ -1425,21 +1491,21 @@ function ot(i) {
|
|
|
1425
1491
|
t += 1;
|
|
1426
1492
|
return t;
|
|
1427
1493
|
}
|
|
1428
|
-
function
|
|
1429
|
-
return new
|
|
1494
|
+
function lt(i) {
|
|
1495
|
+
return new u(function* () {
|
|
1430
1496
|
let t = 0;
|
|
1431
1497
|
for (const e of i)
|
|
1432
1498
|
yield [t, e], t += 1;
|
|
1433
1499
|
});
|
|
1434
1500
|
}
|
|
1435
|
-
function
|
|
1436
|
-
return new
|
|
1501
|
+
function ct(i, t, e = 1) {
|
|
1502
|
+
return new u(function* () {
|
|
1437
1503
|
t === void 0 && (t = i, i = 0), i > t && (e = e ?? -1);
|
|
1438
1504
|
for (let n = i; n < t; n += e)
|
|
1439
1505
|
yield n;
|
|
1440
1506
|
});
|
|
1441
1507
|
}
|
|
1442
|
-
function
|
|
1508
|
+
function ft(i) {
|
|
1443
1509
|
const t = Array.from(i);
|
|
1444
1510
|
for (let e = t.length - 1; e > 0; e -= 1) {
|
|
1445
1511
|
const n = Math.floor(Math.random() * (e + 1));
|
|
@@ -1447,15 +1513,15 @@ function lt(i) {
|
|
|
1447
1513
|
}
|
|
1448
1514
|
return t;
|
|
1449
1515
|
}
|
|
1450
|
-
function
|
|
1451
|
-
return new
|
|
1516
|
+
function ht(i) {
|
|
1517
|
+
return new u(function* () {
|
|
1452
1518
|
const t = /* @__PURE__ */ new Set();
|
|
1453
1519
|
for (const e of i)
|
|
1454
1520
|
t.has(e) || (t.add(e), yield e);
|
|
1455
1521
|
});
|
|
1456
1522
|
}
|
|
1457
|
-
function
|
|
1458
|
-
return new
|
|
1523
|
+
function $e(i, t) {
|
|
1524
|
+
return new u(function* () {
|
|
1459
1525
|
const e = i[Symbol.iterator](), n = t[Symbol.iterator]();
|
|
1460
1526
|
for (; ; ) {
|
|
1461
1527
|
const r = e.next(), s = n.next();
|
|
@@ -1465,17 +1531,17 @@ function Ne(i, t) {
|
|
|
1465
1531
|
}
|
|
1466
1532
|
});
|
|
1467
1533
|
}
|
|
1468
|
-
function
|
|
1534
|
+
function dt(i, t) {
|
|
1469
1535
|
if (t === void 0) {
|
|
1470
1536
|
let s = 0, o = 0;
|
|
1471
|
-
for (const
|
|
1472
|
-
s +=
|
|
1537
|
+
for (const l of i)
|
|
1538
|
+
s += l, o += 1;
|
|
1473
1539
|
if (o === 0)
|
|
1474
1540
|
throw new d("You must provide at least one value.");
|
|
1475
1541
|
return s / o;
|
|
1476
1542
|
}
|
|
1477
1543
|
let e = 0, n = 0, r = 0;
|
|
1478
|
-
for (const [s, o] of
|
|
1544
|
+
for (const [s, o] of $e(i, t)) {
|
|
1479
1545
|
if (o <= 0)
|
|
1480
1546
|
throw new d(`The weight for the value #${r} must be greater than zero.`);
|
|
1481
1547
|
e += s * o, n += o, r += 1;
|
|
@@ -1486,7 +1552,7 @@ function ft(i, t) {
|
|
|
1486
1552
|
throw new d("The sum of weights must be greater than zero.");
|
|
1487
1553
|
return e / n;
|
|
1488
1554
|
}
|
|
1489
|
-
function
|
|
1555
|
+
function mt(i) {
|
|
1490
1556
|
let t = 0;
|
|
1491
1557
|
for (let e = 0; e < i.length; e += 1) {
|
|
1492
1558
|
const n = i.charCodeAt(e);
|
|
@@ -1494,67 +1560,68 @@ function ht(i) {
|
|
|
1494
1560
|
}
|
|
1495
1561
|
return t;
|
|
1496
1562
|
}
|
|
1497
|
-
function
|
|
1563
|
+
function wt(i) {
|
|
1498
1564
|
let t = 0;
|
|
1499
1565
|
for (const e of i)
|
|
1500
1566
|
t += e;
|
|
1501
1567
|
return t;
|
|
1502
1568
|
}
|
|
1503
|
-
function
|
|
1569
|
+
function _t(i) {
|
|
1504
1570
|
return `${i.charAt(0).toUpperCase()}${i.slice(1)}`;
|
|
1505
1571
|
}
|
|
1506
|
-
const
|
|
1572
|
+
const yt = "2.0.0-rc.6";
|
|
1507
1573
|
export {
|
|
1508
1574
|
S as AggregatedAsyncIterator,
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1575
|
+
v as AggregatedIterator,
|
|
1576
|
+
nt as Clock,
|
|
1577
|
+
rt as Countdown,
|
|
1578
|
+
Ne as DeferredPromise,
|
|
1513
1579
|
c as Exception,
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1580
|
+
g as FatalErrorException,
|
|
1581
|
+
Pe as FileException,
|
|
1582
|
+
ze as FileExistsException,
|
|
1583
|
+
Be as FileNotFoundException,
|
|
1584
|
+
je as GameLoop,
|
|
1585
|
+
Qe as JSONStorage,
|
|
1586
|
+
Ge as KeyException,
|
|
1587
|
+
Ke as NetworkException,
|
|
1588
|
+
Ye as NotImplementedException,
|
|
1589
|
+
He as PermissionException,
|
|
1590
|
+
y as Publisher,
|
|
1525
1591
|
R as Random,
|
|
1526
|
-
|
|
1592
|
+
Ie as RangeException,
|
|
1527
1593
|
f as ReducedIterator,
|
|
1528
1594
|
Ce as ReferenceException,
|
|
1529
1595
|
p as RuntimeException,
|
|
1530
1596
|
h as SmartAsyncIterator,
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1597
|
+
u as SmartIterator,
|
|
1598
|
+
b as SmartPromise,
|
|
1599
|
+
Xe as Thenable,
|
|
1600
|
+
E as TimeUnit,
|
|
1601
|
+
Ze as TimedPromise,
|
|
1602
|
+
qe as TimeoutException,
|
|
1603
|
+
Le as TypeException,
|
|
1604
|
+
yt as VERSION,
|
|
1538
1605
|
d as ValueException,
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1606
|
+
dt as average,
|
|
1607
|
+
_t as capitalize,
|
|
1608
|
+
at as chain,
|
|
1609
|
+
ut as count,
|
|
1610
|
+
Ue as dateDifference,
|
|
1611
|
+
et as dateRange,
|
|
1612
|
+
tt as dateRound,
|
|
1613
|
+
st as delay,
|
|
1614
|
+
lt as enumerate,
|
|
1615
|
+
mt as hash,
|
|
1616
|
+
Re as isBrowser,
|
|
1617
|
+
Ve as isNode,
|
|
1618
|
+
We as isWebWorker,
|
|
1619
|
+
ot as loadScript,
|
|
1620
|
+
it as nextAnimationFrame,
|
|
1621
|
+
ct as range,
|
|
1622
|
+
ft as shuffle,
|
|
1623
|
+
wt as sum,
|
|
1624
|
+
ht as unique,
|
|
1625
|
+
$e as zip
|
|
1559
1626
|
};
|
|
1560
1627
|
//# sourceMappingURL=core.js.map
|