@byloth/core 1.5.0-rc.8 → 1.5.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  var S = Object.defineProperty;
2
2
  var b = (o, e, t) => e in o ? S(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
3
3
  var u = (o, e, t) => b(o, typeof e != "symbol" ? e + "" : e, t);
4
- class a {
4
+ class c {
5
5
  constructor(e) {
6
6
  u(this, "_iterator");
7
7
  u(this, "return");
@@ -32,7 +32,7 @@ class a {
32
32
  }
33
33
  filter(e) {
34
34
  const t = this._iterator;
35
- return new a(function* () {
35
+ return new c(function* () {
36
36
  let n = 0;
37
37
  for (; ; ) {
38
38
  const r = t.next();
@@ -44,7 +44,7 @@ class a {
44
44
  }
45
45
  map(e) {
46
46
  const t = this._iterator;
47
- return new a(function* () {
47
+ return new c(function* () {
48
48
  let n = 0;
49
49
  for (; ; ) {
50
50
  const r = t.next();
@@ -74,7 +74,7 @@ class a {
74
74
  }
75
75
  unique() {
76
76
  const e = this._iterator;
77
- return new a(function* () {
77
+ return new c(function* () {
78
78
  const t = /* @__PURE__ */ new Set();
79
79
  for (; ; ) {
80
80
  const n = e.next();
@@ -287,7 +287,7 @@ Caused by ${t}`);
287
287
  return "Exception";
288
288
  }
289
289
  }
290
- class P extends f {
290
+ class j extends f {
291
291
  constructor(e, t, n = "FatalErrorException") {
292
292
  e === void 0 && (e = "The routine has encountered an unrecoverable error and cannot continue as expected. Please, refresh the page and try again. If the problem persists, contact the support team."), super(e, t, n);
293
293
  }
@@ -296,6 +296,14 @@ class P extends f {
296
296
  }
297
297
  }
298
298
  class F extends f {
299
+ constructor(e, t, n = "NotImplementedException") {
300
+ e === void 0 && (e = "This feature is not implemented yet. Please, try again later."), super(e, t, n);
301
+ }
302
+ get [Symbol.toStringTag]() {
303
+ return "NotImplementedException";
304
+ }
305
+ }
306
+ class R extends f {
299
307
  constructor(e, t, n = "FileNotFoundException") {
300
308
  super(e, t, n);
301
309
  }
@@ -303,6 +311,22 @@ class F extends f {
303
311
  return "FileNotFoundException";
304
312
  }
305
313
  }
314
+ class q extends f {
315
+ constructor(e, t, n = "NetworkException") {
316
+ super(e, t, n);
317
+ }
318
+ get [Symbol.toStringTag]() {
319
+ return "NetworkException";
320
+ }
321
+ }
322
+ class A extends f {
323
+ constructor(e, t, n = "PermissionException") {
324
+ super(e, t, n);
325
+ }
326
+ get [Symbol.toStringTag]() {
327
+ return "PermissionException";
328
+ }
329
+ }
306
330
  class k extends f {
307
331
  constructor(e, t, n = "ReferenceException") {
308
332
  super(e, t, n);
@@ -311,7 +335,7 @@ class k extends f {
311
335
  return "ReferenceException";
312
336
  }
313
337
  }
314
- class R extends f {
338
+ class O extends f {
315
339
  constructor(e, t, n = "RuntimeException") {
316
340
  super(e, t, n);
317
341
  }
@@ -327,7 +351,7 @@ class T extends f {
327
351
  return "TimeoutException";
328
352
  }
329
353
  }
330
- class M extends f {
354
+ class E extends f {
331
355
  constructor(e, t, n = "TypeException") {
332
356
  super(e, t, n);
333
357
  }
@@ -343,21 +367,21 @@ class m extends f {
343
367
  return "ValueException";
344
368
  }
345
369
  }
346
- class c {
370
+ class a {
347
371
  constructor(e) {
348
372
  u(this, "_elements");
349
- this._elements = new a(e);
373
+ this._elements = new c(e);
350
374
  }
351
375
  filter(e) {
352
376
  const t = this._elements;
353
- return new c(function* () {
377
+ return new a(function* () {
354
378
  for (const [n, [r, s]] of t.enumerate())
355
379
  e(r, s, n) && (yield [r, s]);
356
380
  });
357
381
  }
358
382
  map(e) {
359
383
  const t = this._elements;
360
- return new c(function* () {
384
+ return new a(function* () {
361
385
  for (const [n, [r, s]] of t.enumerate())
362
386
  yield [r, e(r, s, n)];
363
387
  });
@@ -369,7 +393,7 @@ class c {
369
393
  else {
370
394
  const s = this._elements.next();
371
395
  if (s.done)
372
- throw new M("Reduce of empty iterator with no initial value");
396
+ throw new E("Reduce of empty iterator with no initial value");
373
397
  n += 1, r = s.value[1];
374
398
  }
375
399
  for (const [s, i] of this._elements)
@@ -378,7 +402,7 @@ class c {
378
402
  }
379
403
  keys() {
380
404
  const e = this._elements;
381
- return new a(function* () {
405
+ return new c(function* () {
382
406
  for (const [t] of e)
383
407
  yield t;
384
408
  });
@@ -388,7 +412,7 @@ class c {
388
412
  }
389
413
  values() {
390
414
  const e = this._elements;
391
- return new a(function* () {
415
+ return new c(function* () {
392
416
  for (const [t, n] of e)
393
417
  yield n;
394
418
  });
@@ -409,7 +433,7 @@ class c {
409
433
  class d {
410
434
  constructor(e) {
411
435
  u(this, "_elements");
412
- this._elements = new a(e);
436
+ this._elements = new c(e);
413
437
  }
414
438
  every(e) {
415
439
  const t = /* @__PURE__ */ new Map();
@@ -417,7 +441,7 @@ class d {
417
441
  const [s, i] = t.get(n) ?? [0, !0];
418
442
  i && t.set(n, [s + 1, e(n, r, s)]);
419
443
  }
420
- return new c(function* () {
444
+ return new a(function* () {
421
445
  for (const [n, [r, s]] of t)
422
446
  yield [n, s];
423
447
  });
@@ -428,7 +452,7 @@ class d {
428
452
  const [s, i] = t.get(n) ?? [0, !1];
429
453
  i || t.set(n, [s + 1, e(n, r, s)]);
430
454
  }
431
- return new c(function* () {
455
+ return new a(function* () {
432
456
  for (const [n, [r, s]] of t)
433
457
  yield [n, s];
434
458
  });
@@ -467,7 +491,7 @@ class d {
467
491
  }
468
492
  l = e(r, l, s, i), n.set(r, [i, l]);
469
493
  }
470
- return new c(function* () {
494
+ return new a(function* () {
471
495
  for (const [r, [s, i]] of n)
472
496
  yield [r, i];
473
497
  });
@@ -488,7 +512,7 @@ class d {
488
512
  const n = e.get(t) ?? 0;
489
513
  e.set(t, n + 1);
490
514
  }
491
- return new c(function* () {
515
+ return new a(function* () {
492
516
  for (const [t, n] of e)
493
517
  yield [t, n];
494
518
  });
@@ -497,7 +521,7 @@ class d {
497
521
  const e = /* @__PURE__ */ new Map();
498
522
  for (const [t, n] of this._elements)
499
523
  e.has(t) || e.set(t, n);
500
- return new c(function* () {
524
+ return new a(function* () {
501
525
  for (const [t, n] of e)
502
526
  yield [t, n];
503
527
  });
@@ -506,14 +530,14 @@ class d {
506
530
  const e = /* @__PURE__ */ new Map();
507
531
  for (const [t, n] of this._elements)
508
532
  e.set(t, n);
509
- return new c(function* () {
533
+ return new a(function* () {
510
534
  for (const [t, n] of e)
511
535
  yield [t, n];
512
536
  });
513
537
  }
514
538
  keys() {
515
539
  const e = this._elements;
516
- return new a(function* () {
540
+ return new c(function* () {
517
541
  const t = /* @__PURE__ */ new Set();
518
542
  for (const [n] of e)
519
543
  t.has(n) || (t.add(n), yield n);
@@ -524,7 +548,7 @@ class d {
524
548
  }
525
549
  values() {
526
550
  const e = this._elements;
527
- return new a(function* () {
551
+ return new c(function* () {
528
552
  for (const [t, n] of e)
529
553
  yield n;
530
554
  });
@@ -555,7 +579,7 @@ class d {
555
579
  class w {
556
580
  constructor(e) {
557
581
  u(this, "_elements");
558
- this._elements = new a(e);
582
+ this._elements = new c(e);
559
583
  }
560
584
  filter(e) {
561
585
  return new w(this._elements.filter(e));
@@ -584,7 +608,7 @@ class y {
584
608
  const [s, i] = t.get(n) ?? [0, !0];
585
609
  i && t.set(n, [s + 1, await e(n, r, s)]);
586
610
  }
587
- return new c(function* () {
611
+ return new a(function* () {
588
612
  for (const [n, [r, s]] of t)
589
613
  yield [n, s];
590
614
  });
@@ -595,7 +619,7 @@ class y {
595
619
  const [s, i] = t.get(n) ?? [0, !1];
596
620
  i || t.set(n, [s + 1, await e(n, r, s)]);
597
621
  }
598
- return new c(function* () {
622
+ return new a(function* () {
599
623
  for (const [n, [r, s]] of t)
600
624
  yield [n, s];
601
625
  });
@@ -634,7 +658,7 @@ class y {
634
658
  }
635
659
  l = await e(r, l, s, i), n.set(r, [i, l]);
636
660
  }
637
- return new c(function* () {
661
+ return new a(function* () {
638
662
  for (const [r, [s, i]] of n)
639
663
  yield [r, i];
640
664
  });
@@ -655,7 +679,7 @@ class y {
655
679
  const n = e.get(t) ?? 0;
656
680
  e.set(t, n + 1);
657
681
  }
658
- return new c(function* () {
682
+ return new a(function* () {
659
683
  for (const [t, n] of e)
660
684
  yield [t, n];
661
685
  });
@@ -664,7 +688,7 @@ class y {
664
688
  const e = /* @__PURE__ */ new Map();
665
689
  for await (const [t, n] of this._elements)
666
690
  e.has(t) || e.set(t, n);
667
- return new c(function* () {
691
+ return new a(function* () {
668
692
  for (const [t, n] of e)
669
693
  yield [t, n];
670
694
  });
@@ -673,7 +697,7 @@ class y {
673
697
  const e = /* @__PURE__ */ new Map();
674
698
  for await (const [t, n] of this._elements)
675
699
  e.set(t, n);
676
- return new c(function* () {
700
+ return new a(function* () {
677
701
  for (const [t, n] of e)
678
702
  yield [t, n];
679
703
  });
@@ -741,7 +765,7 @@ class _ {
741
765
  return "AsyncAggregator";
742
766
  }
743
767
  }
744
- class q {
768
+ class $ {
745
769
  constructor(e = !0) {
746
770
  u(this, "_preferPersistence");
747
771
  u(this, "_volatile");
@@ -879,7 +903,7 @@ class q {
879
903
  return "JsonStorage";
880
904
  }
881
905
  }
882
- class A {
906
+ class C {
883
907
  constructor() {
884
908
  u(this, "_subscribers");
885
909
  this._subscribers = [];
@@ -934,7 +958,7 @@ class g {
934
958
  return "SmartPromise";
935
959
  }
936
960
  }
937
- class O extends g {
961
+ class N extends g {
938
962
  constructor(t, n) {
939
963
  let r, s;
940
964
  super((i, l) => {
@@ -957,7 +981,7 @@ class O extends g {
957
981
  return "DeferredPromise";
958
982
  }
959
983
  }
960
- class $ extends g {
984
+ class Y extends g {
961
985
  constructor(e, t) {
962
986
  super((n, r) => {
963
987
  const s = (p) => {
@@ -994,34 +1018,41 @@ class v {
994
1018
  constructor() {
995
1019
  }
996
1020
  }
997
- async function C(o) {
1021
+ async function z(o) {
998
1022
  return new Promise((e, t) => setTimeout(e, o));
999
1023
  }
1000
- async function Y() {
1024
+ async function J() {
1001
1025
  return new Promise((o, e) => requestAnimationFrame(() => o()));
1002
1026
  }
1003
- var E = /* @__PURE__ */ ((o) => (o[o.Second = 1e3] = "Second", o[o.Minute = 6e4] = "Minute", o[o.Hour = 36e5] = "Hour", o[o.Day = 864e5] = "Day", o[o.Week = 6048e5] = "Week", o[o.Month = 2592e6] = "Month", o[o.Year = 31536e6] = "Year", o))(E || {});
1004
- function z(o, e, t = 864e5) {
1027
+ var M = /* @__PURE__ */ ((o) => (o[o.Millisecond = 1] = "Millisecond", o[o.Second = 1e3] = "Second", o[o.Minute = 6e4] = "Minute", o[o.Hour = 36e5] = "Hour", o[o.Day = 864e5] = "Day", o[o.Week = 6048e5] = "Week", o[o.Month = 2592e6] = "Month", o[o.Year = 31536e6] = "Year", o))(M || {});
1028
+ function V(o, e, t = 864e5) {
1005
1029
  return Math.floor((e.getTime() - o.getTime()) / t);
1006
1030
  }
1007
- function J(o, e, t = 864e5) {
1008
- return new a(function* () {
1031
+ function B(o, e, t = 864e5) {
1032
+ return new c(function* () {
1009
1033
  const n = e.getTime();
1010
1034
  let r = o.getTime();
1011
1035
  for (; r < n; )
1012
1036
  yield new Date(r), r += t;
1013
1037
  });
1014
1038
  }
1015
- function V(o, e = 864e5) {
1039
+ function H(o, e = 864e5) {
1016
1040
  return new Date(Math.floor(o.getTime() / e) * e);
1017
1041
  }
1018
- function B(o, e = "text/javascript") {
1042
+ function W(o, e = "text/javascript") {
1019
1043
  return new Promise((t, n) => {
1020
1044
  const r = document.createElement("script");
1021
1045
  r.async = !0, r.defer = !0, r.src = o, r.type = e, r.onload = () => t(), r.onerror = () => n(), document.body.appendChild(r);
1022
1046
  });
1023
1047
  }
1024
- function H(o) {
1048
+ function G(...o) {
1049
+ return new c(function* () {
1050
+ for (const e of o)
1051
+ for (const t of e)
1052
+ yield t;
1053
+ });
1054
+ }
1055
+ function K(o) {
1025
1056
  if (Array.isArray(o))
1026
1057
  return o.length;
1027
1058
  let e = 0;
@@ -1029,14 +1060,21 @@ function H(o) {
1029
1060
  e += 1;
1030
1061
  return e;
1031
1062
  }
1032
- function W(o, e, t = 1) {
1033
- return new a(function* () {
1063
+ function L(o) {
1064
+ return new c(function* () {
1065
+ let e = 0;
1066
+ for (const t of o)
1067
+ yield [e, t], e += 1;
1068
+ });
1069
+ }
1070
+ function Q(o, e, t = 1) {
1071
+ return new c(function* () {
1034
1072
  e === void 0 && (e = o, o = 0), o > e && (t = t ?? -1);
1035
1073
  for (let n = o; n < e; n += t)
1036
1074
  yield n;
1037
1075
  });
1038
1076
  }
1039
- function G(o) {
1077
+ function X(o) {
1040
1078
  const e = Array.from(o);
1041
1079
  for (let t = e.length - 1; t > 0; t -= 1) {
1042
1080
  const n = Math.floor(Math.random() * (t + 1));
@@ -1044,15 +1082,15 @@ function G(o) {
1044
1082
  }
1045
1083
  return e;
1046
1084
  }
1047
- function K(o) {
1048
- return new a(function* () {
1085
+ function Z(o) {
1086
+ return new c(function* () {
1049
1087
  const e = /* @__PURE__ */ new Set();
1050
1088
  for (const t of o)
1051
1089
  e.has(t) || (e.add(t), yield t);
1052
1090
  });
1053
1091
  }
1054
- function j(o, e) {
1055
- return new a(function* () {
1092
+ function P(o, e) {
1093
+ return new c(function* () {
1056
1094
  const t = o[Symbol.iterator](), n = e[Symbol.iterator]();
1057
1095
  for (; ; ) {
1058
1096
  const r = t.next(), s = n.next();
@@ -1062,7 +1100,7 @@ function j(o, e) {
1062
1100
  }
1063
1101
  });
1064
1102
  }
1065
- function L(o, e) {
1103
+ function D(o, e) {
1066
1104
  if (e === void 0) {
1067
1105
  let s = 0, i = 0;
1068
1106
  for (const l of o)
@@ -1072,7 +1110,7 @@ function L(o, e) {
1072
1110
  return s / i;
1073
1111
  }
1074
1112
  let t = 0, n = 0, r = 0;
1075
- for (const [s, i] of j(o, e)) {
1113
+ for (const [s, i] of P(o, e)) {
1076
1114
  if (i <= 0)
1077
1115
  throw new m(`The weight for the value #${r} must be greater than zero.`);
1078
1116
  t += s * i, n += i, r += 1;
@@ -1083,7 +1121,7 @@ function L(o, e) {
1083
1121
  throw new m("The sum of weights must be greater than zero.");
1084
1122
  return t / n;
1085
1123
  }
1086
- function N(o) {
1124
+ function U(o) {
1087
1125
  let e = 0;
1088
1126
  for (let t = 0; t < o.length; t += 1) {
1089
1127
  const n = o.charCodeAt(t);
@@ -1091,53 +1129,59 @@ function N(o) {
1091
1129
  }
1092
1130
  return e;
1093
1131
  }
1094
- function Q(o) {
1132
+ function ee(o) {
1095
1133
  let e = 0;
1096
1134
  for (const t of o)
1097
1135
  e += t;
1098
1136
  return e;
1099
1137
  }
1100
- function X(o) {
1138
+ function te(o) {
1101
1139
  return `${o.charAt(0).toUpperCase()}${o.slice(1)}`;
1102
1140
  }
1103
- const Z = "1.5.0-rc.7";
1141
+ const ne = "1.5.1";
1104
1142
  export {
1105
1143
  y as AggregatedAsyncIterator,
1106
1144
  d as AggregatedIterator,
1107
1145
  w as Aggregator,
1108
1146
  _ as AsyncAggregator,
1109
- E as DateUnit,
1110
- O as DeferredPromise,
1147
+ M as DateUnit,
1148
+ N as DeferredPromise,
1111
1149
  f as Exception,
1112
- P as FatalErrorException,
1113
- F as FileNotFoundException,
1114
- q as JsonStorage,
1150
+ j as FatalErrorException,
1151
+ R as FileNotFoundException,
1152
+ $ as JsonStorage,
1153
+ q as NetworkException,
1154
+ F as NotImplementedException,
1155
+ A as PermissionException,
1115
1156
  v as Random,
1116
- c as ReducedIterator,
1117
- R as RuntimeException,
1157
+ a as ReducedIterator,
1158
+ k as ReferenceException,
1159
+ O as RuntimeException,
1118
1160
  h as SmartAsyncIterator,
1119
- a as SmartIterator,
1161
+ c as SmartIterator,
1120
1162
  g as SmartPromise,
1121
- A as Subscribers,
1122
- $ as TimedPromise,
1163
+ C as Subscribers,
1164
+ Y as TimedPromise,
1123
1165
  T as TimeoutException,
1124
- M as TypeException,
1125
- Z as VERSION,
1166
+ E as TypeException,
1167
+ ne as VERSION,
1126
1168
  m as ValueException,
1127
- L as average,
1128
- X as capitalize,
1129
- H as count,
1130
- z as dateDifference,
1131
- J as dateRange,
1132
- V as dateRound,
1133
- C as delay,
1134
- N as hash,
1135
- B as loadScript,
1136
- Y as nextAnimationFrame,
1137
- W as range,
1138
- G as shuffle,
1139
- Q as sum,
1140
- K as unique,
1141
- j as zip
1169
+ D as average,
1170
+ te as capitalize,
1171
+ G as chain,
1172
+ K as count,
1173
+ V as dateDifference,
1174
+ B as dateRange,
1175
+ H as dateRound,
1176
+ z as delay,
1177
+ L as enumerate,
1178
+ U as hash,
1179
+ W as loadScript,
1180
+ J as nextAnimationFrame,
1181
+ Q as range,
1182
+ X as shuffle,
1183
+ ee as sum,
1184
+ Z as unique,
1185
+ P as zip
1142
1186
  };
1143
1187
  //# sourceMappingURL=core.js.map