@byloth/core 2.2.7 → 2.2.8
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.cjs +1 -1
- package/dist/core.cjs.map +1 -1
- package/dist/core.esm.js +121 -118
- package/dist/core.esm.js.map +1 -1
- package/dist/core.global.js +1 -1
- package/dist/core.global.js.map +1 -1
- package/dist/core.umd.cjs +1 -1
- package/dist/core.umd.cjs.map +1 -1
- package/package.json +6 -6
- package/src/index.ts +1 -1
- package/src/models/callbacks/switchable-callback.ts +65 -8
package/dist/core.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var j = typeof window < "u" && typeof window.document < "u", W = typeof process < "u" && !!process.versions?.node, U = typeof self == "object" && self.constructor?.name === "DedicatedWorkerGlobalScope", m = class M extends Error {
|
|
2
2
|
static FromUnknown(e) {
|
|
3
3
|
if (e instanceof M) return e;
|
|
4
4
|
if (e instanceof Error) {
|
|
@@ -16,22 +16,22 @@ var P = typeof window < "u" && typeof window.document < "u", Z = typeof process
|
|
|
16
16
|
r === void 0 && (r = "The program has encountered an unrecoverable error and cannot continue as expected. Please, try again later. If the problem persists, contact the support team."), super(r, e, t);
|
|
17
17
|
}
|
|
18
18
|
[Symbol.toStringTag] = "FatalErrorException";
|
|
19
|
-
},
|
|
19
|
+
}, B = class extends E {
|
|
20
20
|
constructor(r, e, t = "NotImplementedException") {
|
|
21
21
|
r === void 0 && (r = "This feature isn't implemented yet. Please, try again later."), super(r, e, t);
|
|
22
22
|
}
|
|
23
23
|
[Symbol.toStringTag] = "NotImplementedException";
|
|
24
|
-
},
|
|
24
|
+
}, D = class extends m {
|
|
25
25
|
constructor(r, e, t = "FileException") {
|
|
26
26
|
super(r, e, t);
|
|
27
27
|
}
|
|
28
28
|
[Symbol.toStringTag] = "FileException";
|
|
29
|
-
},
|
|
29
|
+
}, ee = class extends D {
|
|
30
30
|
constructor(r, e, t = "FileExistsException") {
|
|
31
31
|
super(r, e, t);
|
|
32
32
|
}
|
|
33
33
|
[Symbol.toStringTag] = "FileExistsException";
|
|
34
|
-
},
|
|
34
|
+
}, te = class extends D {
|
|
35
35
|
constructor(r, e, t = "FileNotFoundException") {
|
|
36
36
|
super(r, e, t);
|
|
37
37
|
}
|
|
@@ -41,18 +41,18 @@ var P = typeof window < "u" && typeof window.document < "u", Z = typeof process
|
|
|
41
41
|
super(r, e, t);
|
|
42
42
|
}
|
|
43
43
|
[Symbol.toStringTag] = "KeyException";
|
|
44
|
-
},
|
|
44
|
+
}, Y = class extends m {
|
|
45
45
|
constructor(r, e, t = "NetworkException") {
|
|
46
46
|
super(r, e, t);
|
|
47
47
|
}
|
|
48
48
|
[Symbol.toStringTag] = "NetworkException";
|
|
49
|
-
},
|
|
49
|
+
}, ne = class extends Y {
|
|
50
50
|
response;
|
|
51
51
|
constructor(r, e, t = "ResponseException") {
|
|
52
52
|
super(`The request failed with the status code ${r.status} (${r.statusText}).`, e, t), this.response = r;
|
|
53
53
|
}
|
|
54
54
|
[Symbol.toStringTag] = "ResponseException";
|
|
55
|
-
},
|
|
55
|
+
}, re = class extends m {
|
|
56
56
|
constructor(r, e, t = "PermissionException") {
|
|
57
57
|
super(r, e, t);
|
|
58
58
|
}
|
|
@@ -67,17 +67,17 @@ var P = typeof window < "u" && typeof window.document < "u", Z = typeof process
|
|
|
67
67
|
super(r, e, t);
|
|
68
68
|
}
|
|
69
69
|
[Symbol.toStringTag] = "RuntimeException";
|
|
70
|
-
},
|
|
70
|
+
}, V = class extends w {
|
|
71
71
|
constructor(r, e, t = "EnvironmentException") {
|
|
72
72
|
super(r, e, t);
|
|
73
73
|
}
|
|
74
74
|
[Symbol.toStringTag] = "EnvironmentException";
|
|
75
|
-
},
|
|
75
|
+
}, J = class extends m {
|
|
76
76
|
constructor(r, e, t = "TimeoutException") {
|
|
77
77
|
super(r, e, t);
|
|
78
78
|
}
|
|
79
79
|
[Symbol.toStringTag] = "TimeoutException";
|
|
80
|
-
},
|
|
80
|
+
}, se = class extends m {
|
|
81
81
|
constructor(r, e, t = "TypeException") {
|
|
82
82
|
super(r, e, t);
|
|
83
83
|
}
|
|
@@ -365,7 +365,7 @@ var P = typeof window < "u" && typeof window.document < "u", Z = typeof process
|
|
|
365
365
|
return Object.fromEntries(this.entries());
|
|
366
366
|
}
|
|
367
367
|
[Symbol.toStringTag] = "ReducedIterator";
|
|
368
|
-
},
|
|
368
|
+
}, L = class p {
|
|
369
369
|
_elements;
|
|
370
370
|
constructor(e) {
|
|
371
371
|
this._elements = new R(e);
|
|
@@ -729,7 +729,7 @@ var P = typeof window < "u" && typeof window.document < "u", Z = typeof process
|
|
|
729
729
|
throw e;
|
|
730
730
|
}
|
|
731
731
|
groupBy(e) {
|
|
732
|
-
return new
|
|
732
|
+
return new L(this.map(async (t, n) => [await e(t, n), t]));
|
|
733
733
|
}
|
|
734
734
|
toArray() {
|
|
735
735
|
return Array.fromAsync(this);
|
|
@@ -924,14 +924,14 @@ var P = typeof window < "u" && typeof window.document < "u", Z = typeof process
|
|
|
924
924
|
return e;
|
|
925
925
|
}
|
|
926
926
|
[Symbol.toStringTag] = "AggregatedIterator";
|
|
927
|
-
},
|
|
927
|
+
}, G = Function, z = class extends G {
|
|
928
928
|
constructor() {
|
|
929
929
|
super("return this._invoke(...arguments);");
|
|
930
930
|
const r = this.bind(this);
|
|
931
931
|
return Object.setPrototypeOf(this, r), r;
|
|
932
932
|
}
|
|
933
933
|
[Symbol.toStringTag] = "CallableObject";
|
|
934
|
-
},
|
|
934
|
+
}, ie = class extends z {
|
|
935
935
|
_callbacks;
|
|
936
936
|
get size() {
|
|
937
937
|
return this._callbacks.length;
|
|
@@ -955,13 +955,13 @@ var P = typeof window < "u" && typeof window.document < "u", Z = typeof process
|
|
|
955
955
|
this._callbacks.length = 0;
|
|
956
956
|
}
|
|
957
957
|
[Symbol.toStringTag] = "CallbackChain";
|
|
958
|
-
}, I = class
|
|
958
|
+
}, I = class N {
|
|
959
959
|
_subscribers;
|
|
960
960
|
constructor() {
|
|
961
961
|
this._subscribers = /* @__PURE__ */ new Map();
|
|
962
962
|
}
|
|
963
963
|
createScope() {
|
|
964
|
-
const e = new
|
|
964
|
+
const e = new N();
|
|
965
965
|
return this.subscribe("__internals__:clear", () => e.clear()), this.subscribe("*", (t, ...n) => {
|
|
966
966
|
e.publish(t, ...n);
|
|
967
967
|
}), e;
|
|
@@ -997,8 +997,10 @@ var P = typeof window < "u" && typeof window.document < "u", Z = typeof process
|
|
|
997
997
|
this.publish("__internals__:clear"), this._subscribers.clear();
|
|
998
998
|
}
|
|
999
999
|
[Symbol.toStringTag] = "Publisher";
|
|
1000
|
-
},
|
|
1001
|
-
},
|
|
1000
|
+
}, H = () => {
|
|
1001
|
+
}, P = () => {
|
|
1002
|
+
throw new B("The `SwitchableCallback` has no callback defined yet. Did you forget to call the `register` method?");
|
|
1003
|
+
}, oe = class extends z {
|
|
1002
1004
|
_callback;
|
|
1003
1005
|
_callbacks;
|
|
1004
1006
|
_isEnabled;
|
|
@@ -1011,9 +1013,7 @@ var P = typeof window < "u" && typeof window.document < "u", Z = typeof process
|
|
|
1011
1013
|
}
|
|
1012
1014
|
_invoke;
|
|
1013
1015
|
constructor(r, e = "default") {
|
|
1014
|
-
super(), this._callbacks = /* @__PURE__ */ new Map(), this._isEnabled = !0, r ? this._callbacks.set(e, r) : (e = "", r = (
|
|
1015
|
-
throw new $("The `SwitchableCallback` has no callback defined yet. Did you forget to call the `register` method?");
|
|
1016
|
-
})), this._key = e, this._callback = r, this._invoke = (...t) => this._callback(...t);
|
|
1016
|
+
super(), this._callbacks = /* @__PURE__ */ new Map(), this._isEnabled = !0, r ? this._callbacks.set(e, r) : (e = "", r = P), this._key = e, this._callback = r, this._invoke = (...t) => this._callback(...t);
|
|
1017
1017
|
}
|
|
1018
1018
|
enable(r) {
|
|
1019
1019
|
if (r === void 0) {
|
|
@@ -1027,7 +1027,7 @@ var P = typeof window < "u" && typeof window.document < "u", Z = typeof process
|
|
|
1027
1027
|
}
|
|
1028
1028
|
disable() {
|
|
1029
1029
|
if (!this._isEnabled) throw new w("The `SwitchableCallback` is already disabled.");
|
|
1030
|
-
this._callback =
|
|
1030
|
+
this._callback = H, this._isEnabled = !1;
|
|
1031
1031
|
}
|
|
1032
1032
|
register(r, e) {
|
|
1033
1033
|
if (this._callbacks.size === 0)
|
|
@@ -1044,8 +1044,11 @@ var P = typeof window < "u" && typeof window.document < "u", Z = typeof process
|
|
|
1044
1044
|
if (!this._callbacks.has(r)) throw new g(`The key '${r}' doesn't yet have any associated callback.`);
|
|
1045
1045
|
this._key !== r && (this._key = r, this._isEnabled && (this._callback = this._callbacks.get(r)));
|
|
1046
1046
|
}
|
|
1047
|
+
reset(r, e = "default") {
|
|
1048
|
+
this._callbacks.clear(), this._isEnabled = !0, r ? this._callbacks.set(e, r) : (e = "", r = P), this._key = e, this._callback = r;
|
|
1049
|
+
}
|
|
1047
1050
|
[Symbol.toStringTag] = "SwitchableCallback";
|
|
1048
|
-
},
|
|
1051
|
+
}, ae = class extends Array {
|
|
1049
1052
|
_publisher;
|
|
1050
1053
|
constructor(...r) {
|
|
1051
1054
|
super(...r), this._publisher = new I();
|
|
@@ -1092,7 +1095,7 @@ var P = typeof window < "u" && typeof window.document < "u", Z = typeof process
|
|
|
1092
1095
|
}
|
|
1093
1096
|
[Symbol.toStringTag] = "ArrayView";
|
|
1094
1097
|
static [Symbol.species] = Array;
|
|
1095
|
-
},
|
|
1098
|
+
}, le = class extends Map {
|
|
1096
1099
|
_publisher;
|
|
1097
1100
|
constructor(r) {
|
|
1098
1101
|
if (super(), this._publisher = new I(), r) for (const [e, t] of r) super.set(e, t);
|
|
@@ -1118,7 +1121,7 @@ var P = typeof window < "u" && typeof window.document < "u", Z = typeof process
|
|
|
1118
1121
|
return this._publisher.subscribe("clear", r);
|
|
1119
1122
|
}
|
|
1120
1123
|
[Symbol.toStringTag] = "MapView";
|
|
1121
|
-
},
|
|
1124
|
+
}, ue = class extends Set {
|
|
1122
1125
|
_publisher;
|
|
1123
1126
|
constructor(r) {
|
|
1124
1127
|
if (super(), this._publisher = new I(), r) for (const e of r) super.add(e);
|
|
@@ -1144,12 +1147,12 @@ var P = typeof window < "u" && typeof window.document < "u", Z = typeof process
|
|
|
1144
1147
|
return this._publisher.subscribe("clear", r);
|
|
1145
1148
|
}
|
|
1146
1149
|
[Symbol.toStringTag] = "SetView";
|
|
1147
|
-
},
|
|
1150
|
+
}, ce = class {
|
|
1148
1151
|
_preferPersistence;
|
|
1149
1152
|
_volatile;
|
|
1150
1153
|
_persistent;
|
|
1151
1154
|
constructor(r = !0) {
|
|
1152
|
-
if (!
|
|
1155
|
+
if (!j) throw new V("The `JSONStorage` class can only be instantiated within a browser environment.");
|
|
1153
1156
|
this._preferPersistence = r, this._volatile = window.sessionStorage, this._persistent = window.localStorage;
|
|
1154
1157
|
}
|
|
1155
1158
|
_get(r, e, t) {
|
|
@@ -1213,9 +1216,9 @@ var P = typeof window < "u" && typeof window.document < "u", Z = typeof process
|
|
|
1213
1216
|
this._volatile.removeItem(r), this._persistent.removeItem(r);
|
|
1214
1217
|
}
|
|
1215
1218
|
[Symbol.toStringTag] = "JSONStorage";
|
|
1216
|
-
}, b = class
|
|
1219
|
+
}, b = class q {
|
|
1217
1220
|
static FromPromise(e) {
|
|
1218
|
-
return new
|
|
1221
|
+
return new q((t, n) => e.then(t, n));
|
|
1219
1222
|
}
|
|
1220
1223
|
_isPending;
|
|
1221
1224
|
get isPending() {
|
|
@@ -1247,7 +1250,7 @@ var P = typeof window < "u" && typeof window.document < "u", Z = typeof process
|
|
|
1247
1250
|
return this._promise.finally(e);
|
|
1248
1251
|
}
|
|
1249
1252
|
[Symbol.toStringTag] = "SmartPromise";
|
|
1250
|
-
},
|
|
1253
|
+
}, O = class extends b {
|
|
1251
1254
|
_resolve;
|
|
1252
1255
|
get resolve() {
|
|
1253
1256
|
return this._resolve;
|
|
@@ -1266,19 +1269,19 @@ var P = typeof window < "u" && typeof window.document < "u", Z = typeof process
|
|
|
1266
1269
|
return r.then(this.resolve, this.reject), this;
|
|
1267
1270
|
}
|
|
1268
1271
|
[Symbol.toStringTag] = "DeferredPromise";
|
|
1269
|
-
},
|
|
1272
|
+
}, K = class extends b {
|
|
1270
1273
|
constructor(r, e) {
|
|
1271
1274
|
super((t, n) => {
|
|
1272
1275
|
const s = (a) => {
|
|
1273
1276
|
clearTimeout(l), t(a);
|
|
1274
1277
|
}, i = (a) => {
|
|
1275
1278
|
clearTimeout(l), n(a);
|
|
1276
|
-
}, l = setTimeout(() => i(new
|
|
1279
|
+
}, l = setTimeout(() => i(new J("The operation has timed out.")), e);
|
|
1277
1280
|
r(s, i);
|
|
1278
1281
|
});
|
|
1279
1282
|
}
|
|
1280
1283
|
[Symbol.toStringTag] = "TimedPromise";
|
|
1281
|
-
},
|
|
1284
|
+
}, he = class extends b {
|
|
1282
1285
|
_count;
|
|
1283
1286
|
get isPending() {
|
|
1284
1287
|
return this._count > 0;
|
|
@@ -1293,7 +1296,7 @@ var P = typeof window < "u" && typeof window.document < "u", Z = typeof process
|
|
|
1293
1296
|
super((r) => r()), this._count = 0, this._isPending = !1, this._isFulfilled = !1, this._isRejected = !1;
|
|
1294
1297
|
}
|
|
1295
1298
|
enqueue(r, e) {
|
|
1296
|
-
if (this._count += 1, r instanceof
|
|
1299
|
+
if (this._count += 1, r instanceof O) {
|
|
1297
1300
|
const n = r;
|
|
1298
1301
|
r = () => (n.resolve(), n);
|
|
1299
1302
|
}
|
|
@@ -1304,19 +1307,19 @@ var P = typeof window < "u" && typeof window.document < "u", Z = typeof process
|
|
|
1304
1307
|
this._count -= 1, s(i);
|
|
1305
1308
|
});
|
|
1306
1309
|
};
|
|
1307
|
-
return e ? new
|
|
1310
|
+
return e ? new K(t, e) : new b(t);
|
|
1308
1311
|
}
|
|
1309
1312
|
[Symbol.toStringTag] = "PromiseQueue";
|
|
1310
1313
|
}, y = /* @__PURE__ */ (function(r) {
|
|
1311
1314
|
return r[r.Millisecond = 1] = "Millisecond", r[r.Second = 1e3] = "Second", r[r.Minute = 60 * r.Second] = "Minute", r[r.Hour = 60 * r.Minute] = "Hour", r[r.Day = 24 * r.Hour] = "Day", r[r.Week = 7 * r.Day] = "Week", r[r.Month = 30 * r.Day] = "Month", r[r.Year = 365 * r.Day] = "Year", r;
|
|
1312
|
-
})({}),
|
|
1315
|
+
})({}), Q = /* @__PURE__ */ (function(r) {
|
|
1313
1316
|
return r[r.Sunday = 0] = "Sunday", r[r.Monday = 1] = "Monday", r[r.Tuesday = 2] = "Tuesday", r[r.Wednesday = 3] = "Wednesday", r[r.Thursday = 4] = "Thursday", r[r.Friday = 5] = "Friday", r[r.Saturday = 6] = "Saturday", r;
|
|
1314
1317
|
})({});
|
|
1315
|
-
function
|
|
1318
|
+
function fe(r, e, t = y.Day) {
|
|
1316
1319
|
let n;
|
|
1317
1320
|
return r = new Date(r), e = new Date(e), r < e ? n = Math.floor : n = Math.ceil, n((e.getTime() - r.getTime()) / t);
|
|
1318
1321
|
}
|
|
1319
|
-
function
|
|
1322
|
+
function de(r, e, t = y.Day) {
|
|
1320
1323
|
if (r = new Date(r), e = new Date(e), r >= e) throw new k("The end date must be greater than the start date.");
|
|
1321
1324
|
return new h(function* () {
|
|
1322
1325
|
const n = e.getTime();
|
|
@@ -1325,17 +1328,17 @@ function fe(r, e, t = y.Day) {
|
|
|
1325
1328
|
yield new Date(s), s += t;
|
|
1326
1329
|
});
|
|
1327
1330
|
}
|
|
1328
|
-
function
|
|
1331
|
+
function X(r, e = y.Day) {
|
|
1329
1332
|
if (e <= y.Millisecond) throw new k("Rounding a timestamp by milliseconds or less makes no sense.Use the timestamp value directly instead.");
|
|
1330
1333
|
if (e > y.Day) throw new k("Rounding by more than a day leads to unexpected results. Consider using other methods to round dates by weeks, months or years.");
|
|
1331
1334
|
return r = new Date(r), new Date(Math.floor(r.getTime() / e) * e);
|
|
1332
1335
|
}
|
|
1333
|
-
function
|
|
1336
|
+
function me(r, e = Q.Sunday) {
|
|
1334
1337
|
r = new Date(r);
|
|
1335
1338
|
const t = 7 - e, n = (r.getUTCDay() + t) % 7, s = r.getTime() - y.Day * n;
|
|
1336
|
-
return
|
|
1339
|
+
return X(new Date(s));
|
|
1337
1340
|
}
|
|
1338
|
-
var
|
|
1341
|
+
var $ = class {
|
|
1339
1342
|
_handle;
|
|
1340
1343
|
_startTime;
|
|
1341
1344
|
get startTime() {
|
|
@@ -1352,7 +1355,7 @@ var O = class {
|
|
|
1352
1355
|
_start;
|
|
1353
1356
|
_stop;
|
|
1354
1357
|
constructor(r, e = 40) {
|
|
1355
|
-
this._startTime = 0, this._isRunning = !1,
|
|
1358
|
+
this._startTime = 0, this._isRunning = !1, j ? (this._start = () => {
|
|
1356
1359
|
r(this.elapsedTime), this._handle = window.requestAnimationFrame(this._start);
|
|
1357
1360
|
}, this._stop = () => window.cancelAnimationFrame(this._handle)) : (console.warn(`Not a browser environment detected. Using setInterval@${e}ms instead of requestAnimationFrame...`), this._start = () => {
|
|
1358
1361
|
this._handle = setInterval(() => r(this.elapsedTime), e);
|
|
@@ -1374,7 +1377,7 @@ var O = class {
|
|
|
1374
1377
|
return this._publisher.subscribe("stop", r);
|
|
1375
1378
|
}
|
|
1376
1379
|
[Symbol.toStringTag] = "GameLoop";
|
|
1377
|
-
},
|
|
1380
|
+
}, we = class extends $ {
|
|
1378
1381
|
constructor(r = y.Second) {
|
|
1379
1382
|
super((e) => this._publisher.publish("tick", e), r);
|
|
1380
1383
|
}
|
|
@@ -1396,7 +1399,7 @@ var O = class {
|
|
|
1396
1399
|
});
|
|
1397
1400
|
}
|
|
1398
1401
|
[Symbol.toStringTag] = "Clock";
|
|
1399
|
-
},
|
|
1402
|
+
}, pe = class extends $ {
|
|
1400
1403
|
_duration;
|
|
1401
1404
|
get duration() {
|
|
1402
1405
|
return this._duration;
|
|
@@ -1420,7 +1423,7 @@ var O = class {
|
|
|
1420
1423
|
start(r = this.duration) {
|
|
1421
1424
|
if (this._isRunning) throw new w("The countdown had already stopped or hadn't yet started.");
|
|
1422
1425
|
if (this._deferrer) throw new E();
|
|
1423
|
-
return this._deferrer = new
|
|
1426
|
+
return this._deferrer = new O(), super.start(this.duration - r), this._publisher.publish("start"), this._deferrer;
|
|
1424
1427
|
}
|
|
1425
1428
|
stop(r) {
|
|
1426
1429
|
this._deferrerStop(r), this._publisher.publish("stop", r);
|
|
@@ -1437,7 +1440,7 @@ var O = class {
|
|
|
1437
1440
|
return this._publisher.subscribe("expire", r);
|
|
1438
1441
|
}
|
|
1439
1442
|
[Symbol.toStringTag] = "Countdown";
|
|
1440
|
-
},
|
|
1443
|
+
}, _e = class {
|
|
1441
1444
|
static Linear(r) {
|
|
1442
1445
|
const e = r - 1;
|
|
1443
1446
|
return new h(function* () {
|
|
@@ -1454,7 +1457,7 @@ var O = class {
|
|
|
1454
1457
|
constructor() {
|
|
1455
1458
|
}
|
|
1456
1459
|
[Symbol.toStringTag] = "Curve";
|
|
1457
|
-
},
|
|
1460
|
+
}, ye = class u {
|
|
1458
1461
|
static #t(e) {
|
|
1459
1462
|
let t = e | 0;
|
|
1460
1463
|
return () => {
|
|
@@ -1588,40 +1591,40 @@ var O = class {
|
|
|
1588
1591
|
}
|
|
1589
1592
|
[Symbol.toStringTag] = "Random";
|
|
1590
1593
|
};
|
|
1591
|
-
function
|
|
1594
|
+
function be(r) {
|
|
1592
1595
|
return new b((e) => setTimeout(e, r));
|
|
1593
1596
|
}
|
|
1594
|
-
function
|
|
1597
|
+
function ge() {
|
|
1595
1598
|
return new b((r) => requestAnimationFrame(() => r()));
|
|
1596
1599
|
}
|
|
1597
|
-
function
|
|
1600
|
+
function xe() {
|
|
1598
1601
|
return new b((r) => setTimeout(r));
|
|
1599
1602
|
}
|
|
1600
|
-
function
|
|
1603
|
+
function ve(r, e = "text/javascript") {
|
|
1601
1604
|
return new b((t, n) => {
|
|
1602
1605
|
const s = document.createElement("script");
|
|
1603
1606
|
s.async = !0, s.defer = !0, s.src = r, s.type = e, s.onload = (i) => t(), s.onerror = (i) => n(i), document.body.appendChild(s);
|
|
1604
1607
|
});
|
|
1605
1608
|
}
|
|
1606
|
-
function
|
|
1609
|
+
function Se(...r) {
|
|
1607
1610
|
return new h(function* () {
|
|
1608
1611
|
for (const e of r) for (const t of e) yield t;
|
|
1609
1612
|
});
|
|
1610
1613
|
}
|
|
1611
|
-
function
|
|
1614
|
+
function ke(r) {
|
|
1612
1615
|
if (r instanceof Array) return r.length;
|
|
1613
1616
|
let e = 0;
|
|
1614
1617
|
for (const t of r) e += 1;
|
|
1615
1618
|
return e;
|
|
1616
1619
|
}
|
|
1617
|
-
function
|
|
1620
|
+
function Te(r) {
|
|
1618
1621
|
return new h(function* () {
|
|
1619
1622
|
let e = 0;
|
|
1620
1623
|
for (const t of r)
|
|
1621
1624
|
yield [e, t], e += 1;
|
|
1622
1625
|
});
|
|
1623
1626
|
}
|
|
1624
|
-
function
|
|
1627
|
+
function Ee(r, e, t = 1) {
|
|
1625
1628
|
if (t <= 0) throw new k("Step must be always a positive number, even when generating numbers in reverse order.");
|
|
1626
1629
|
return e === void 0 && (e = r, r = 0), r > e ? new h(function* () {
|
|
1627
1630
|
for (let n = r; n > e; n -= t) yield n;
|
|
@@ -1629,7 +1632,7 @@ function Te(r, e, t = 1) {
|
|
|
1629
1632
|
for (let n = r; n < e; n += t) yield n;
|
|
1630
1633
|
});
|
|
1631
1634
|
}
|
|
1632
|
-
function
|
|
1635
|
+
function Me(r) {
|
|
1633
1636
|
const e = Array.from(r);
|
|
1634
1637
|
for (let t = e.length - 1; t > 0; t -= 1) {
|
|
1635
1638
|
const n = Math.floor(Math.random() * (t + 1));
|
|
@@ -1637,14 +1640,14 @@ function Ee(r) {
|
|
|
1637
1640
|
}
|
|
1638
1641
|
return e;
|
|
1639
1642
|
}
|
|
1640
|
-
function
|
|
1643
|
+
function Ie(r) {
|
|
1641
1644
|
return new h(function* () {
|
|
1642
1645
|
const e = /* @__PURE__ */ new Set();
|
|
1643
1646
|
for (const t of r)
|
|
1644
1647
|
e.has(t) || (e.add(t), yield t);
|
|
1645
1648
|
});
|
|
1646
1649
|
}
|
|
1647
|
-
function
|
|
1650
|
+
function Z(r, e) {
|
|
1648
1651
|
const t = r[Symbol.iterator](), n = e[Symbol.iterator]();
|
|
1649
1652
|
return new h(function* () {
|
|
1650
1653
|
for (; ; ) {
|
|
@@ -1654,7 +1657,7 @@ function X(r, e) {
|
|
|
1654
1657
|
}
|
|
1655
1658
|
});
|
|
1656
1659
|
}
|
|
1657
|
-
function
|
|
1660
|
+
function Ae(r, e) {
|
|
1658
1661
|
if (e === void 0) {
|
|
1659
1662
|
let i = 0, o = 0;
|
|
1660
1663
|
for (const l of r)
|
|
@@ -1663,7 +1666,7 @@ function Ie(r, e) {
|
|
|
1663
1666
|
return i / o;
|
|
1664
1667
|
}
|
|
1665
1668
|
let t = 0, n = 0, s = 0;
|
|
1666
|
-
for (const [i, o] of
|
|
1669
|
+
for (const [i, o] of Z(r, e)) {
|
|
1667
1670
|
if (o <= 0) throw new c(`The weight for the value #${s} must be greater than zero.`);
|
|
1668
1671
|
t += i * o, n += o, s += 1;
|
|
1669
1672
|
}
|
|
@@ -1671,11 +1674,11 @@ function Ie(r, e) {
|
|
|
1671
1674
|
if (n <= 0) throw new c("The sum of weights must be greater than zero.");
|
|
1672
1675
|
return t / n;
|
|
1673
1676
|
}
|
|
1674
|
-
function
|
|
1677
|
+
function Re(r, e, t) {
|
|
1675
1678
|
if (e > t) throw new c("The minimum bound must be less than or equal to the maximum bound.");
|
|
1676
1679
|
return r < e ? e : r > t ? t : r;
|
|
1677
1680
|
}
|
|
1678
|
-
function
|
|
1681
|
+
function Fe(r) {
|
|
1679
1682
|
let e = 0;
|
|
1680
1683
|
for (let t = 0; t < r.length; t += 1) {
|
|
1681
1684
|
const n = r.charCodeAt(t);
|
|
@@ -1683,81 +1686,81 @@ function Re(r) {
|
|
|
1683
1686
|
}
|
|
1684
1687
|
return e;
|
|
1685
1688
|
}
|
|
1686
|
-
function
|
|
1689
|
+
function Ce(r) {
|
|
1687
1690
|
let e = 0;
|
|
1688
1691
|
for (const t of r) e += t;
|
|
1689
1692
|
return e;
|
|
1690
1693
|
}
|
|
1691
|
-
function
|
|
1694
|
+
function Pe(r) {
|
|
1692
1695
|
return `${r.charAt(0).toUpperCase()}${r.slice(1)}`;
|
|
1693
1696
|
}
|
|
1694
|
-
var
|
|
1697
|
+
var je = "2.2.8";
|
|
1695
1698
|
export {
|
|
1696
|
-
|
|
1699
|
+
L as AggregatedAsyncIterator,
|
|
1697
1700
|
F as AggregatedIterator,
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1701
|
+
ae as ArrayView,
|
|
1702
|
+
z as CallableObject,
|
|
1703
|
+
ie as CallbackChain,
|
|
1704
|
+
we as Clock,
|
|
1705
|
+
pe as Countdown,
|
|
1706
|
+
_e as Curve,
|
|
1707
|
+
O as DeferredPromise,
|
|
1708
|
+
V as EnvironmentException,
|
|
1706
1709
|
m as Exception,
|
|
1707
1710
|
E as FatalErrorException,
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1711
|
+
D as FileException,
|
|
1712
|
+
ee as FileExistsException,
|
|
1713
|
+
te as FileNotFoundException,
|
|
1714
|
+
$ as GameLoop,
|
|
1715
|
+
ce as JSONStorage,
|
|
1713
1716
|
g as KeyException,
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1717
|
+
le as MapView,
|
|
1718
|
+
Y as NetworkException,
|
|
1719
|
+
B as NotImplementedException,
|
|
1720
|
+
re as PermissionException,
|
|
1721
|
+
he as PromiseQueue,
|
|
1719
1722
|
I as Publisher,
|
|
1720
|
-
|
|
1723
|
+
ye as Random,
|
|
1721
1724
|
k as RangeException,
|
|
1722
1725
|
d as ReducedIterator,
|
|
1723
1726
|
A as ReferenceException,
|
|
1724
|
-
|
|
1727
|
+
ne as ResponseException,
|
|
1725
1728
|
w as RuntimeException,
|
|
1726
|
-
|
|
1729
|
+
ue as SetView,
|
|
1727
1730
|
R as SmartAsyncIterator,
|
|
1728
1731
|
h as SmartIterator,
|
|
1729
1732
|
b as SmartPromise,
|
|
1730
|
-
|
|
1733
|
+
oe as SwitchableCallback,
|
|
1731
1734
|
y as TimeUnit,
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1735
|
+
K as TimedPromise,
|
|
1736
|
+
J as TimeoutException,
|
|
1737
|
+
se as TypeException,
|
|
1738
|
+
je as VERSION,
|
|
1736
1739
|
c as ValueException,
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1740
|
+
Q as WeekDay,
|
|
1741
|
+
Ae as average,
|
|
1742
|
+
Pe as capitalize,
|
|
1743
|
+
Se as chain,
|
|
1744
|
+
Re as clamp,
|
|
1745
|
+
ke as count,
|
|
1746
|
+
fe as dateDifference,
|
|
1747
|
+
de as dateRange,
|
|
1748
|
+
X as dateRound,
|
|
1749
|
+
be as delay,
|
|
1750
|
+
Te as enumerate,
|
|
1751
|
+
me as getWeek,
|
|
1752
|
+
Fe as hash,
|
|
1753
|
+
j as isBrowser,
|
|
1754
|
+
W as isNode,
|
|
1755
|
+
U as isWorker,
|
|
1756
|
+
ve as loadScript,
|
|
1757
|
+
ge as nextAnimationFrame,
|
|
1758
|
+
Ee as range,
|
|
1759
|
+
Me as shuffle,
|
|
1760
|
+
Ce as sum,
|
|
1761
|
+
Ie as unique,
|
|
1762
|
+
xe as yieldToEventLoop,
|
|
1763
|
+
Z as zip
|
|
1761
1764
|
};
|
|
1762
1765
|
|
|
1763
1766
|
//# sourceMappingURL=core.esm.js.map
|