entropic-bond 1.53.9 → 1.53.11

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.
@@ -1,4 +1,4 @@
1
- class N {
1
+ class I {
2
2
  constructor() {
3
3
  this.subscribers = /* @__PURE__ */ new Set();
4
4
  }
@@ -43,41 +43,46 @@ class N {
43
43
  return this.subscribers.size;
44
44
  }
45
45
  }
46
- var f = [];
47
- for (var A = 0; A < 256; ++A)
48
- f.push((A + 256).toString(16).slice(1));
49
- function Y(i, e = 0) {
46
+ const f = [];
47
+ for (let i = 0; i < 256; ++i)
48
+ f.push((i + 256).toString(16).slice(1));
49
+ function q(i, e = 0) {
50
50
  return (f[i[e + 0]] + f[i[e + 1]] + f[i[e + 2]] + f[i[e + 3]] + "-" + f[i[e + 4]] + f[i[e + 5]] + "-" + f[i[e + 6]] + f[i[e + 7]] + "-" + f[i[e + 8]] + f[i[e + 9]] + "-" + f[i[e + 10]] + f[i[e + 11]] + f[i[e + 12]] + f[i[e + 13]] + f[i[e + 14]] + f[i[e + 15]]).toLowerCase();
51
51
  }
52
- var E, z = new Uint8Array(16);
53
- function H() {
54
- if (!E && (E = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !E))
55
- throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
56
- return E(z);
52
+ let U;
53
+ const Y = new Uint8Array(16);
54
+ function z() {
55
+ if (!U) {
56
+ if (typeof crypto > "u" || !crypto.getRandomValues)
57
+ throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
58
+ U = crypto.getRandomValues.bind(crypto);
59
+ }
60
+ return U(Y);
57
61
  }
58
- var J = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
59
- const k = {
60
- randomUUID: J
61
- };
62
- function Z(i, e, t) {
63
- if (k.randomUUID && !e && !i)
64
- return k.randomUUID();
62
+ const H = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), L = { randomUUID: H };
63
+ function J(i, e, t) {
64
+ var s;
65
+ if (L.randomUUID && !e && !i)
66
+ return L.randomUUID();
65
67
  i = i || {};
66
- var r = i.random || (i.rng || H)();
68
+ const r = i.random ?? ((s = i.rng) == null ? void 0 : s.call(i)) ?? z();
69
+ if (r.length < 16)
70
+ throw new Error("Random bytes length must be >= 16");
67
71
  if (r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, e) {
68
- t = t || 0;
69
- for (var s = 0; s < 16; ++s)
70
- e[t + s] = r[s];
72
+ if (t = t || 0, t < 0 || t + 16 > e.length)
73
+ throw new RangeError(`UUID byte range ${t}:${t + 15} is out of buffer bounds`);
74
+ for (let n = 0; n < 16; ++n)
75
+ e[t + n] = r[n];
71
76
  return e;
72
77
  }
73
- return Y(r);
78
+ return q(r);
74
79
  }
75
- var G = Object.defineProperty, K = Object.getOwnPropertyDescriptor, X = (i, e, t, r) => {
76
- for (var s = r > 1 ? void 0 : r ? K(e, t) : e, n = i.length - 1, o; n >= 0; n--)
80
+ var Z = Object.defineProperty, G = Object.getOwnPropertyDescriptor, K = (i, e, t, r) => {
81
+ for (var s = r > 1 ? void 0 : r ? G(e, t) : e, n = i.length - 1, o; n >= 0; n--)
77
82
  (o = i[n]) && (s = (r ? o(e, t, s) : o(s)) || s);
78
- return r && s && G(e, t, s), s;
83
+ return r && s && Z(e, t, s), s;
79
84
  }, d;
80
- const W = (d = class {
85
+ const B = (d = class {
81
86
  /**
82
87
  * Registers a class to be used by the persistence engine.
83
88
  * @param className the name of the class to be registered
@@ -139,7 +144,7 @@ const W = (d = class {
139
144
  * Returns a new instance of Persistent class.
140
145
  * @param className the initial id of this instance. If not provided, a new id will be generated
141
146
  */
142
- constructor(e = Z()) {
147
+ constructor(e = J()) {
143
148
  this._id = e;
144
149
  }
145
150
  /**
@@ -386,14 +391,14 @@ const W = (d = class {
386
391
  }, {});
387
392
  }
388
393
  }, d._factoryMap = {}, d);
389
- X([
390
- j
391
- ], W.prototype, "_id", 2);
392
- let l = W;
393
- function j(i, e) {
394
+ K([
395
+ R
396
+ ], B.prototype, "_id", 2);
397
+ let l = B;
398
+ function R(i, e) {
394
399
  return y()(i, e);
395
400
  }
396
- function ue(i) {
401
+ function ce(i) {
397
402
  return function(e, t) {
398
403
  return y({
399
404
  storeInCollection: i,
@@ -401,10 +406,10 @@ function ue(i) {
401
406
  })(e, t);
402
407
  };
403
408
  }
404
- function he(i, e) {
409
+ function ue(i, e) {
405
410
  return y({ isReference: !0 })(i, e);
406
411
  }
407
- function le(i, e, t) {
412
+ function he(i, e, t) {
408
413
  const r = Array.isArray(i) ? { cachedProps: i } : i;
409
414
  return function(s, n) {
410
415
  return y({
@@ -415,10 +420,10 @@ function le(i, e, t) {
415
420
  })(s, n);
416
421
  };
417
422
  }
418
- function de(i, e, t) {
423
+ function le(i, e, t) {
419
424
  return y({ isReference: !0, isPureReference: !0, storeInCollection: t })(i, e);
420
425
  }
421
- function fe(i, e, t) {
426
+ function de(i, e, t) {
422
427
  return function(r, s) {
423
428
  const n = Array.isArray(i) ? { cachedProps: i } : i;
424
429
  return y({
@@ -440,30 +445,30 @@ function y(i) {
440
445
  });
441
446
  };
442
447
  }
443
- function ee(i, e) {
448
+ function X(i, e) {
444
449
  return (t) => {
445
450
  l.registerFactory(i, t, e), t.prototype.__className = i;
446
451
  };
447
452
  }
448
- function pe(i) {
453
+ function fe(i) {
449
454
  return (e) => {
450
455
  l.registerFactory(i, e);
451
456
  };
452
457
  }
453
- function me(i, e) {
458
+ function pe(i, e) {
454
459
  return y({ searchableArray: !0 })(i, e);
455
460
  }
456
- function ge(i, e) {
461
+ function me(i, e) {
457
462
  return y({ validator: (t) => t != null })(i, e);
458
463
  }
459
- function _e(i = (e) => e != null) {
464
+ function ge(i = (e) => e != null) {
460
465
  return function(e, t) {
461
466
  return y({ validator: i })(e, t);
462
467
  };
463
468
  }
464
- class ye extends l {
469
+ class _e extends l {
465
470
  constructor() {
466
- super(...arguments), this._onChange = new N();
471
+ super(...arguments), this._onChange = new I();
467
472
  }
468
473
  /**
469
474
  * Subscribes a listener callback function. Every time a property is changed,
@@ -546,11 +551,11 @@ class ye extends l {
546
551
  return this.notify({ [e]: this[e] }), t;
547
552
  }
548
553
  }
549
- const U = class U {
554
+ const E = class E {
550
555
  constructor(e, t, r) {
551
556
  if (r) {
552
557
  if (!(t instanceof l))
553
- throw new Error(U.error.persistentNeedForSubCollection);
558
+ throw new Error(E.error.persistentNeedForSubCollection);
554
559
  this.collectionName = `${t.className}/${t.id}/${r}`;
555
560
  } else
556
561
  this.collectionName = t instanceof l ? t.className : t;
@@ -599,7 +604,7 @@ const U = class U {
599
604
  * @returns a Query object
600
605
  */
601
606
  find() {
602
- return new te(this);
607
+ return new ee(this);
603
608
  }
604
609
  /**
605
610
  * Define the search conditions. You pass query operations and how the query
@@ -705,12 +710,12 @@ const U = class U {
705
710
  };
706
711
  }
707
712
  };
708
- U.error = {
713
+ E.error = {
709
714
  persistentNeedForSubCollection: "The document parameter for a sub-collection should be a Persistent instace",
710
715
  invalidQueryOrder: "Cannot add where calls after or calls"
711
716
  };
712
- let D = U;
713
- class te {
717
+ let D = E;
718
+ class ee {
714
719
  constructor(e) {
715
720
  this.queryObject = { operations: [] }, this.model = e;
716
721
  }
@@ -1008,7 +1013,7 @@ const P = class P {
1008
1013
  }
1009
1014
  };
1010
1015
  P.error = { shouldBeRegistered: "You should register a data source before using the data Store." };
1011
- let I = P;
1016
+ let F = P;
1012
1017
  class O {
1013
1018
  installCachedPropsUpdaters(e = {}) {
1014
1019
  O.onUpdate = e.onUpdate;
@@ -1087,11 +1092,11 @@ class O {
1087
1092
  if (e.before)
1088
1093
  return t.map(async (r) => {
1089
1094
  var c, h;
1090
- const s = I.getModel(r.collectionPropOwner);
1095
+ const s = F.getModel(r.collectionPropOwner);
1091
1096
  let n = s.find();
1092
1097
  (h = (c = r.prop.cachedPropsConfig) == null ? void 0 : c.cachedProps) == null || h.forEach((a) => {
1093
- var v, R;
1094
- const u = (v = e.before) == null ? void 0 : v[a], g = (R = e.after) == null ? void 0 : R[a];
1098
+ var v, S;
1099
+ const u = (v = e.before) == null ? void 0 : v[a], g = (S = e.after) == null ? void 0 : S[a];
1095
1100
  u !== g && (n = n.orDeepProp(`${r.prop.name}.${a}`, "==", u));
1096
1101
  });
1097
1102
  const o = await n.get();
@@ -1099,16 +1104,16 @@ class O {
1099
1104
  o.map(async (a) => {
1100
1105
  var u, g;
1101
1106
  (g = (u = r.prop.cachedPropsConfig) == null ? void 0 : u.cachedProps) == null || g.forEach(async (v) => {
1102
- var M, V, L;
1103
- const R = (M = e.before) == null ? void 0 : M[v], $ = (V = e.after) == null ? void 0 : V[v];
1104
- R !== $ && (a[`_${r.prop.name}`][`_${v}`] = $, await s.save(a), (L = this.onUpdate) == null || L.call(this, a, r.prop));
1107
+ var $, M, V;
1108
+ const S = ($ = e.before) == null ? void 0 : $[v], N = (M = e.after) == null ? void 0 : M[v];
1109
+ S !== N && (a[`_${r.prop.name}`][`_${v}`] = N, await s.save(a), (V = this.onUpdate) == null || V.call(this, a, r.prop));
1105
1110
  });
1106
1111
  })
1107
1112
  ]);
1108
1113
  });
1109
1114
  }
1110
1115
  }
1111
- class ve extends O {
1116
+ class ye extends O {
1112
1117
  /**
1113
1118
  * @param jsonRawData the JSON object to be used as data store
1114
1119
  */
@@ -1308,17 +1313,17 @@ const b = class b {
1308
1313
  };
1309
1314
  b._cloudStorageFactoryMap = {};
1310
1315
  let w = b;
1311
- function re(i, e) {
1316
+ function te(i, e) {
1312
1317
  return w.registerCloudStorage(i, e), (t) => {
1313
1318
  t.prototype.__className = i;
1314
1319
  };
1315
1320
  }
1316
- var se = Object.defineProperty, ie = Object.getOwnPropertyDescriptor, ne = (i, e, t, r) => {
1317
- for (var s = r > 1 ? void 0 : r ? ie(e, t) : e, n = i.length - 1, o; n >= 0; n--)
1321
+ var re = Object.defineProperty, se = Object.getOwnPropertyDescriptor, ie = (i, e, t, r) => {
1322
+ for (var s = r > 1 ? void 0 : r ? se(e, t) : e, n = i.length - 1, o; n >= 0; n--)
1318
1323
  (o = i[n]) && (s = (r ? o(e, t, s) : o(s)) || s);
1319
- return r && s && se(e, t, s), s;
1324
+ return r && s && re(e, t, s), s;
1320
1325
  };
1321
- let F = class extends w {
1326
+ let A = class extends w {
1322
1327
  constructor(i = "") {
1323
1328
  super(), this._simulateDelay = 0, this._pendingPromises = [], this.mockFileSystem = {}, this._pathToMockFiles = i;
1324
1329
  }
@@ -1367,17 +1372,17 @@ let F = class extends w {
1367
1372
  return delete this.mockFileSystem[i], this.resolveWithDelay();
1368
1373
  }
1369
1374
  };
1370
- F = ne([
1371
- re("MockCloudStorage", () => new F())
1372
- ], F);
1373
- var oe = Object.defineProperty, ae = Object.getOwnPropertyDescriptor, S = (i, e, t, r) => {
1374
- for (var s = r > 1 ? void 0 : r ? ae(e, t) : e, n = i.length - 1, o; n >= 0; n--)
1375
+ A = ie([
1376
+ te("MockCloudStorage", () => new A())
1377
+ ], A);
1378
+ var ne = Object.defineProperty, oe = Object.getOwnPropertyDescriptor, j = (i, e, t, r) => {
1379
+ for (var s = r > 1 ? void 0 : r ? oe(e, t) : e, n = i.length - 1, o; n >= 0; n--)
1375
1380
  (o = i[n]) && (s = (r ? o(e, t, s) : o(s)) || s);
1376
- return r && s && oe(e, t, s), s;
1377
- }, ce = /* @__PURE__ */ ((i) => (i[i.stored = 0] = "stored", i[i.pendingDataSet = 1] = "pendingDataSet", i[i.deleted = 2] = "deleted", i))(ce || {});
1381
+ return r && s && ne(e, t, s), s;
1382
+ }, ae = /* @__PURE__ */ ((i) => (i[i.stored = 0] = "stored", i[i.pendingDataSet = 1] = "pendingDataSet", i[i.deleted = 2] = "deleted", i))(ae || {});
1378
1383
  let C = class extends l {
1379
1384
  constructor() {
1380
- super(...arguments), this._onChange = new N();
1385
+ super(...arguments), this._onChange = new I();
1381
1386
  }
1382
1387
  async save({ data: i, fileName: e, progress: t, cloudStorageProvider: r } = {}) {
1383
1388
  const s = i || this._pendingData;
@@ -1423,29 +1428,29 @@ let C = class extends l {
1423
1428
  return this._onChange.subscribe(i);
1424
1429
  }
1425
1430
  };
1426
- S([
1427
- j
1431
+ j([
1432
+ R
1428
1433
  ], C.prototype, "_reference", 2);
1429
- S([
1430
- j
1434
+ j([
1435
+ R
1431
1436
  ], C.prototype, "_url", 2);
1432
- S([
1433
- j
1437
+ j([
1438
+ R
1434
1439
  ], C.prototype, "_cloudStorageProviderName", 2);
1435
- S([
1436
- j
1440
+ j([
1441
+ R
1437
1442
  ], C.prototype, "_originalFileName", 2);
1438
- S([
1439
- j
1443
+ j([
1444
+ R
1440
1445
  ], C.prototype, "_mimeType", 2);
1441
- C = S([
1442
- ee("StoredFile")
1446
+ C = j([
1447
+ X("StoredFile")
1443
1448
  ], C);
1444
- class Q {
1449
+ class W {
1445
1450
  }
1446
- const p = class p extends Q {
1451
+ const p = class p extends W {
1447
1452
  constructor() {
1448
- if (super(), this._onAuthStateChange = new N(), !p._authService)
1453
+ if (super(), this._onAuthStateChange = new I(), !p._authService)
1449
1454
  throw new Error(p.error.shouldBeRegistered);
1450
1455
  p._authService.onAuthStateChange(
1451
1456
  (e) => this.authStateChanged(e)
@@ -1570,8 +1575,8 @@ const p = class p extends Q {
1570
1575
  }
1571
1576
  };
1572
1577
  p.error = { shouldBeRegistered: "You should register an auth service before using Auth." }, p._instance = void 0;
1573
- let T = p;
1574
- class Pe extends Q {
1578
+ let k = p;
1579
+ class ve extends W {
1575
1580
  constructor() {
1576
1581
  super(...arguments), this.pendingPromises = [], this._fakeRegisteredUsers = {};
1577
1582
  }
@@ -1676,8 +1681,8 @@ const _ = class _ {
1676
1681
  }
1677
1682
  };
1678
1683
  _.error = { shouldBeRegistered: "You should register a cloud functions service with useCloudFunctionsService static method before using CloudFunctions." };
1679
- let x = _;
1680
- class be {
1684
+ let T = _;
1685
+ class Pe {
1681
1686
  constructor(e) {
1682
1687
  this._registeredFunctions = e;
1683
1688
  }
@@ -1691,9 +1696,9 @@ class be {
1691
1696
  return e(t);
1692
1697
  }
1693
1698
  }
1694
- class q {
1699
+ class Q {
1695
1700
  }
1696
- const m = class m extends q {
1701
+ const m = class m extends Q {
1697
1702
  constructor() {
1698
1703
  super();
1699
1704
  }
@@ -1719,8 +1724,8 @@ const m = class m extends q {
1719
1724
  }
1720
1725
  };
1721
1726
  m.error = { shouldBeRegistered: "You should register a Server Auth service before using the Server Auth." }, m._instance = void 0;
1722
- let B = m;
1723
- class we extends q {
1727
+ let x = m;
1728
+ class be extends Q {
1724
1729
  constructor(e) {
1725
1730
  super(), this._userCredentials = e;
1726
1731
  }
@@ -1747,63 +1752,63 @@ class we extends q {
1747
1752
  return this._userCredentials;
1748
1753
  }
1749
1754
  }
1750
- function Ce(i, e) {
1755
+ function we(i, e) {
1751
1756
  return i ? i.replace(/\${\s*(\w*)\s*}/g, function(t, r) {
1752
1757
  return e[r] || "";
1753
1758
  }) : "";
1754
1759
  }
1755
- function Oe(i) {
1760
+ function Ce(i) {
1756
1761
  return i ? i.replace(
1757
1762
  /([-_ ][\w])/g,
1758
1763
  (e) => e.toUpperCase().replace("-", "").replace("_", "").replace(" ", "")
1759
1764
  ) : "";
1760
1765
  }
1761
- function De(i, e = "-") {
1766
+ function Oe(i, e = "-") {
1762
1767
  if (!i)
1763
1768
  return "";
1764
1769
  const t = i.slice(1).replace(/( |[A-Z])/g, (r) => r === " " ? "-" : e + r[0].toLowerCase());
1765
1770
  return i[0].toLocaleLowerCase() + t.replace(/--/g, "-");
1766
1771
  }
1767
- function je(i, e) {
1772
+ function De(i, e) {
1768
1773
  return e.split(".").reduce((t, r) => t[r], i);
1769
1774
  }
1770
1775
  export {
1771
- T as Auth,
1772
- Pe as AuthMock,
1773
- Q as AuthService,
1774
- x as CloudFunctions,
1775
- be as CloudFunctionsMock,
1776
+ k as Auth,
1777
+ ve as AuthMock,
1778
+ W as AuthService,
1779
+ T as CloudFunctions,
1780
+ Pe as CloudFunctionsMock,
1776
1781
  w as CloudStorage,
1777
1782
  O as DataSource,
1778
- ye as EntropicComponent,
1779
- ve as JsonDataSource,
1780
- F as MockCloudStorage,
1783
+ _e as EntropicComponent,
1784
+ ye as JsonDataSource,
1785
+ A as MockCloudStorage,
1781
1786
  D as Model,
1782
- N as Observable,
1787
+ I as Observable,
1783
1788
  l as Persistent,
1784
- te as Query,
1785
- B as ServerAuth,
1786
- we as ServerAuthMock,
1787
- q as ServerAuthService,
1788
- I as Store,
1789
+ ee as Query,
1790
+ x as ServerAuth,
1791
+ be as ServerAuthMock,
1792
+ Q as ServerAuthService,
1793
+ F as Store,
1789
1794
  C as StoredFile,
1790
- ce as StoredFileEvent,
1791
- Oe as camelCase,
1792
- je as getDeepValue,
1793
- j as persistent,
1795
+ ae as StoredFileEvent,
1796
+ Ce as camelCase,
1797
+ De as getDeepValue,
1798
+ R as persistent,
1794
1799
  y as persistentParser,
1795
- de as persistentPureReference,
1796
- fe as persistentPureReferenceWithCachedProps,
1797
- he as persistentReference,
1798
- ue as persistentReferenceAt,
1799
- le as persistentReferenceWithCachedProps,
1800
- re as registerCloudStorage,
1801
- pe as registerLegacyClassName,
1802
- ee as registerPersistentClass,
1803
- Ce as replaceValue,
1804
- ge as required,
1805
- _e as requiredWithValidator,
1806
- me as searchableArray,
1807
- De as snakeCase
1800
+ le as persistentPureReference,
1801
+ de as persistentPureReferenceWithCachedProps,
1802
+ ue as persistentReference,
1803
+ ce as persistentReferenceAt,
1804
+ he as persistentReferenceWithCachedProps,
1805
+ te as registerCloudStorage,
1806
+ fe as registerLegacyClassName,
1807
+ X as registerPersistentClass,
1808
+ we as replaceValue,
1809
+ me as required,
1810
+ ge as requiredWithValidator,
1811
+ pe as searchableArray,
1812
+ Oe as snakeCase
1808
1813
  };
1809
1814
  //# sourceMappingURL=entropic-bond.js.map