@firebase/firestore 4.5.1-canary.13ddddf52 → 4.5.1-canary.36b261c65

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/index.cjs.js CHANGED
@@ -70,7 +70,7 @@ User.MOCK_USER = new User("mock-user");
70
70
  * See the License for the specific language governing permissions and
71
71
  * limitations under the License.
72
72
  */
73
- let S = "10.10.0-canary.13ddddf52";
73
+ let S = "10.10.0-canary.36b261c65";
74
74
 
75
75
  /**
76
76
  * @license
@@ -5848,16 +5848,16 @@ class BloomFilter {
5848
5848
  throw new __PRIVATE_BloomFilterError(`Invalid padding when bitmap length is 0: ${t}`);
5849
5849
  this.Te = 8 * e.length - t,
5850
5850
  // Set the bit count in Integer to avoid repetition in mightContain().
5851
- this.de = webchannelWrapper.Integer.fromNumber(this.Te);
5851
+ this.Ee = webchannelWrapper.Integer.fromNumber(this.Te);
5852
5852
  }
5853
5853
  // Calculate the ith hash value based on the hashed 64bit integers,
5854
5854
  // and calculate its corresponding bit index in the bitmap to be checked.
5855
- Ee(e, t, n) {
5855
+ de(e, t, n) {
5856
5856
  // Calculate hashed value h(i) = h1 + (i * h2).
5857
5857
  let r = e.add(t.multiply(webchannelWrapper.Integer.fromNumber(n)));
5858
5858
  // Wrap if hash value overflow 64bit.
5859
5859
  return 1 === r.compare(he) && (r = new webchannelWrapper.Integer([ r.getBits(0), r.getBits(1) ], 0)),
5860
- r.modulo(this.de).toNumber();
5860
+ r.modulo(this.Ee).toNumber();
5861
5861
  }
5862
5862
  // Return whether the bit on the given index in the bitmap is set to 1.
5863
5863
  Ae(e) {
@@ -5868,7 +5868,7 @@ class BloomFilter {
5868
5868
  if (0 === this.Te) return !1;
5869
5869
  const t = __PRIVATE_getMd5HashValue(e), [n, r] = __PRIVATE_get64BitUints(t);
5870
5870
  for (let e = 0; e < this.hashCount; e++) {
5871
- const t = this.Ee(n, r, e);
5871
+ const t = this.de(n, r, e);
5872
5872
  if (!this.Ae(t)) return !1;
5873
5873
  }
5874
5874
  return !0;
@@ -5881,7 +5881,7 @@ class BloomFilter {
5881
5881
  if (0 === this.Te) return;
5882
5882
  const t = __PRIVATE_getMd5HashValue(e), [n, r] = __PRIVATE_get64BitUints(t);
5883
5883
  for (let e = 0; e < this.hashCount; e++) {
5884
- const t = this.Ee(n, r, e);
5884
+ const t = this.de(n, r, e);
5885
5885
  this.Re(t);
5886
5886
  }
5887
5887
  }
@@ -7606,53 +7606,53 @@ class __PRIVATE_FirestoreIndexValueWriter {
7606
7606
  t.Tt();
7607
7607
  }
7608
7608
  It(e, t) {
7609
- if ("nullValue" in e) this.dt(t, 5); else if ("booleanValue" in e) this.dt(t, 10),
7610
- t.Et(e.booleanValue ? 1 : 0); else if ("integerValue" in e) this.dt(t, 15), t.Et(__PRIVATE_normalizeNumber(e.integerValue)); else if ("doubleValue" in e) {
7609
+ if ("nullValue" in e) this.Et(t, 5); else if ("booleanValue" in e) this.Et(t, 10),
7610
+ t.dt(e.booleanValue ? 1 : 0); else if ("integerValue" in e) this.Et(t, 15), t.dt(__PRIVATE_normalizeNumber(e.integerValue)); else if ("doubleValue" in e) {
7611
7611
  const n = __PRIVATE_normalizeNumber(e.doubleValue);
7612
- isNaN(n) ? this.dt(t, 13) : (this.dt(t, 15), __PRIVATE_isNegativeZero(n) ?
7612
+ isNaN(n) ? this.Et(t, 13) : (this.Et(t, 15), __PRIVATE_isNegativeZero(n) ?
7613
7613
  // -0.0, 0 and 0.0 are all considered the same
7614
- t.Et(0) : t.Et(n));
7614
+ t.dt(0) : t.dt(n));
7615
7615
  } else if ("timestampValue" in e) {
7616
7616
  let n = e.timestampValue;
7617
- this.dt(t, 20), "string" == typeof n && (n = __PRIVATE_normalizeTimestamp(n)), t.At(`${n.seconds || ""}`),
7618
- t.Et(n.nanos || 0);
7619
- } else if ("stringValue" in e) this.Rt(e.stringValue, t), this.Vt(t); else if ("bytesValue" in e) this.dt(t, 30),
7617
+ this.Et(t, 20), "string" == typeof n && (n = __PRIVATE_normalizeTimestamp(n)), t.At(`${n.seconds || ""}`),
7618
+ t.dt(n.nanos || 0);
7619
+ } else if ("stringValue" in e) this.Rt(e.stringValue, t), this.Vt(t); else if ("bytesValue" in e) this.Et(t, 30),
7620
7620
  t.ft(__PRIVATE_normalizeByteString(e.bytesValue)), this.Vt(t); else if ("referenceValue" in e) this.gt(e.referenceValue, t); else if ("geoPointValue" in e) {
7621
7621
  const n = e.geoPointValue;
7622
- this.dt(t, 45), t.Et(n.latitude || 0), t.Et(n.longitude || 0);
7623
- } else "mapValue" in e ? __PRIVATE_isMaxValue(e) ? this.dt(t, Number.MAX_SAFE_INTEGER) : (this.yt(e.mapValue, t),
7622
+ this.Et(t, 45), t.dt(n.latitude || 0), t.dt(n.longitude || 0);
7623
+ } else "mapValue" in e ? __PRIVATE_isMaxValue(e) ? this.Et(t, Number.MAX_SAFE_INTEGER) : (this.yt(e.mapValue, t),
7624
7624
  this.Vt(t)) : "arrayValue" in e ? (this.wt(e.arrayValue, t), this.Vt(t)) : fail();
7625
7625
  }
7626
7626
  Rt(e, t) {
7627
- this.dt(t, 25), this.St(e, t);
7627
+ this.Et(t, 25), this.St(e, t);
7628
7628
  }
7629
7629
  St(e, t) {
7630
7630
  t.At(e);
7631
7631
  }
7632
7632
  yt(e, t) {
7633
7633
  const n = e.fields || {};
7634
- this.dt(t, 55);
7634
+ this.Et(t, 55);
7635
7635
  for (const e of Object.keys(n)) this.Rt(e, t), this.It(n[e], t);
7636
7636
  }
7637
7637
  wt(e, t) {
7638
7638
  const n = e.values || [];
7639
- this.dt(t, 50);
7639
+ this.Et(t, 50);
7640
7640
  for (const e of n) this.It(e, t);
7641
7641
  }
7642
7642
  gt(e, t) {
7643
- this.dt(t, 37);
7643
+ this.Et(t, 37);
7644
7644
  DocumentKey.fromName(e).path.forEach((e => {
7645
- this.dt(t, 60), this.St(e, t);
7645
+ this.Et(t, 60), this.St(e, t);
7646
7646
  }));
7647
7647
  }
7648
- dt(e, t) {
7649
- e.Et(t);
7648
+ Et(e, t) {
7649
+ e.dt(t);
7650
7650
  }
7651
7651
  Vt(e) {
7652
7652
  // While the SDK does not implement truncation, the truncation marker is
7653
7653
  // used to terminate all variable length values (which are strings, bytes,
7654
7654
  // references, arrays and maps).
7655
- e.Et(2);
7655
+ e.dt(2);
7656
7656
  }
7657
7657
  }
7658
7658
 
@@ -7842,7 +7842,7 @@ class __PRIVATE_AscendingIndexByteEncoder {
7842
7842
  At(e) {
7843
7843
  this.Gt.Ot(e);
7844
7844
  }
7845
- Et(e) {
7845
+ dt(e) {
7846
7846
  this.Gt.Lt(e);
7847
7847
  }
7848
7848
  Tt() {
@@ -7860,7 +7860,7 @@ class __PRIVATE_DescendingIndexByteEncoder {
7860
7860
  At(e) {
7861
7861
  this.Gt.Nt(e);
7862
7862
  }
7863
- Et(e) {
7863
+ dt(e) {
7864
7864
  this.Gt.qt(e);
7865
7865
  }
7866
7866
  Tt() {
@@ -8377,7 +8377,7 @@ function __PRIVATE_applyDistributionFieldAndCompositeFilters(e, t) {
8377
8377
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8378
8378
  * See the License for the specific language governing permissions and
8379
8379
  * limitations under the License.
8380
- */ const de = new Uint8Array(0);
8380
+ */ const Ee = new Uint8Array(0);
8381
8381
 
8382
8382
  /**
8383
8383
  * A persisted implementation of IndexManager.
@@ -8591,17 +8591,17 @@ class __PRIVATE_IndexedDbIndexManager {
8591
8591
  // combined with the values from the query bounds.
8592
8592
  const _ = (null != t ? t.length : 1) * Math.max(n.length, i.length), a = _ / (null != t ? t.length : 1), u = [];
8593
8593
  for (let c = 0; c < _; ++c) {
8594
- const _ = t ? this.Tn(t[c / a]) : de, l = this.dn(e, _, n[c % a], r), h = this.En(e, _, i[c % a], s), P = o.map((t => this.dn(e, _, t,
8594
+ const _ = t ? this.Tn(t[c / a]) : Ee, l = this.En(e, _, n[c % a], r), h = this.dn(e, _, i[c % a], s), P = o.map((t => this.En(e, _, t,
8595
8595
  /* inclusive= */ !0)));
8596
8596
  u.push(...this.createRange(l, h, P));
8597
8597
  }
8598
8598
  return u;
8599
8599
  }
8600
- /** Generates the lower bound for `arrayValue` and `directionalValue`. */ dn(e, t, n, r) {
8600
+ /** Generates the lower bound for `arrayValue` and `directionalValue`. */ En(e, t, n, r) {
8601
8601
  const i = new __PRIVATE_IndexEntry(e, DocumentKey.empty(), t, n);
8602
8602
  return r ? i : i.Jt();
8603
8603
  }
8604
- /** Generates the upper bound for `arrayValue` and `directionalValue`. */ En(e, t, n, r) {
8604
+ /** Generates the upper bound for `arrayValue` and `directionalValue`. */ dn(e, t, n, r) {
8605
8605
  const i = new __PRIVATE_IndexEntry(e, DocumentKey.empty(), t, n);
8606
8606
  return r ? i.Jt() : i;
8607
8607
  }
@@ -8788,7 +8788,7 @@ class __PRIVATE_IndexedDbIndexManager {
8788
8788
  if (null != i) {
8789
8789
  const s = e.data.field(i.fieldPath);
8790
8790
  if (isArray(s)) for (const i of s.arrayValue.values || []) n = n.add(new __PRIVATE_IndexEntry(t.indexId, e.key, this.Tn(i), r));
8791
- } else n = n.add(new __PRIVATE_IndexEntry(t.indexId, e.key, de, r));
8791
+ } else n = n.add(new __PRIVATE_IndexEntry(t.indexId, e.key, Ee, r));
8792
8792
  return n;
8793
8793
  }
8794
8794
  /**
@@ -8863,7 +8863,7 @@ class __PRIVATE_IndexedDbIndexManager {
8863
8863
  // If we encounter two bounds that will create an unmatchable key range,
8864
8864
  // then we return an empty set of key ranges.
8865
8865
  if (this.Dn(r[e], r[e + 1])) return [];
8866
- const t = [ r[e].indexId, this.uid, r[e].arrayValue, r[e].directionalValue, de, [] ], n = [ r[e + 1].indexId, this.uid, r[e + 1].arrayValue, r[e + 1].directionalValue, de, [] ];
8866
+ const t = [ r[e].indexId, this.uid, r[e].arrayValue, r[e].directionalValue, Ee, [] ], n = [ r[e + 1].indexId, this.uid, r[e + 1].arrayValue, r[e + 1].directionalValue, Ee, [] ];
8867
8867
  i.push(IDBKeyRange.bound(t, n));
8868
8868
  }
8869
8869
  return i;
@@ -8931,7 +8931,7 @@ function __PRIVATE_getMinOffsetFromFieldIndexes(e) {
8931
8931
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8932
8932
  * See the License for the specific language governing permissions and
8933
8933
  * limitations under the License.
8934
- */ const Ee = {
8934
+ */ const de = {
8935
8935
  didRun: !1,
8936
8936
  sequenceNumbersCollected: 0,
8937
8937
  targetsRemoved: 0,
@@ -9664,8 +9664,8 @@ class __PRIVATE_TargetIdGenerator {
9664
9664
  }
9665
9665
  collect(e, t) {
9666
9666
  return -1 === this.params.cacheSizeCollectionThreshold ? (__PRIVATE_logDebug("LruGarbageCollector", "Garbage collection skipped; disabled"),
9667
- PersistencePromise.resolve(Ee)) : this.getCacheSize(e).next((n => n < this.params.cacheSizeCollectionThreshold ? (__PRIVATE_logDebug("LruGarbageCollector", `Garbage collection skipped; Cache size ${n} is lower than threshold ${this.params.cacheSizeCollectionThreshold}`),
9668
- Ee) : this.Yn(e, t)));
9667
+ PersistencePromise.resolve(de)) : this.getCacheSize(e).next((n => n < this.params.cacheSizeCollectionThreshold ? (__PRIVATE_logDebug("LruGarbageCollector", `Garbage collection skipped; Cache size ${n} is lower than threshold ${this.params.cacheSizeCollectionThreshold}`),
9668
+ de) : this.Yn(e, t)));
9669
9669
  }
9670
9670
  getCacheSize(e) {
9671
9671
  return this.jn.getCacheSize(e);
@@ -10708,7 +10708,7 @@ class OverlayedDocument {
10708
10708
  // A set of outstanding references to a document sorted by key.
10709
10709
  this.Pr = new SortedSet(__PRIVATE_DocReference.Ir),
10710
10710
  // A set of outstanding references to a document sorted by target id.
10711
- this.Tr = new SortedSet(__PRIVATE_DocReference.dr);
10711
+ this.Tr = new SortedSet(__PRIVATE_DocReference.Er);
10712
10712
  }
10713
10713
  /** Returns true if the reference set contains no references. */ isEmpty() {
10714
10714
  return this.Pr.isEmpty();
@@ -10717,7 +10717,7 @@ class OverlayedDocument {
10717
10717
  const n = new __PRIVATE_DocReference(e, t);
10718
10718
  this.Pr = this.Pr.add(n), this.Tr = this.Tr.add(n);
10719
10719
  }
10720
- /** Add references to the given document keys for the given ID. */ Er(e, t) {
10720
+ /** Add references to the given document keys for the given ID. */ dr(e, t) {
10721
10721
  e.forEach((e => this.addReference(e, t)));
10722
10722
  }
10723
10723
  /**
@@ -10764,7 +10764,7 @@ class __PRIVATE_DocReference {
10764
10764
  /** Compare by key then by ID */ static Ir(e, t) {
10765
10765
  return DocumentKey.comparator(e.key, t.key) || __PRIVATE_primitiveComparator(e.pr, t.pr);
10766
10766
  }
10767
- /** Compare by ID then by key */ static dr(e, t) {
10767
+ /** Compare by ID then by key */ static Er(e, t) {
10768
10768
  return __PRIVATE_primitiveComparator(e.pr, t.pr) || DocumentKey.comparator(e.key, t.key);
10769
10769
  }
10770
10770
  }
@@ -11143,7 +11143,7 @@ class __PRIVATE_MemoryRemoteDocumentChangeBuffer extends RemoteDocumentChangeBuf
11143
11143
  return PersistencePromise.resolve(n);
11144
11144
  }
11145
11145
  addMatchingKeys(e, t, n) {
11146
- return this.Nr.Er(t, n), PersistencePromise.resolve();
11146
+ return this.Nr.dr(t, n), PersistencePromise.resolve();
11147
11147
  }
11148
11148
  removeMatchingKeys(e, t, n) {
11149
11149
  this.Nr.Rr(t, n);
@@ -11765,10 +11765,10 @@ class __PRIVATE_IndexedDbPersistence {
11765
11765
  /** A listener to notify on primary state changes. */
11766
11766
  this.Ii = e => Promise.resolve(), !__PRIVATE_IndexedDbPersistence.D()) throw new FirestoreError(D.UNIMPLEMENTED, "This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.");
11767
11767
  this.referenceDelegate = new __PRIVATE_IndexedDbLruDelegateImpl(this, r), this.Ti = t + "main",
11768
- this.serializer = new __PRIVATE_LocalSerializer(_), this.di = new __PRIVATE_SimpleDb(this.Ti, this.ui, new __PRIVATE_SchemaConverter(this.serializer)),
11768
+ this.serializer = new __PRIVATE_LocalSerializer(_), this.Ei = new __PRIVATE_SimpleDb(this.Ti, this.ui, new __PRIVATE_SchemaConverter(this.serializer)),
11769
11769
  this.Qr = new __PRIVATE_IndexedDbTargetCache(this.referenceDelegate, this.serializer),
11770
11770
  this.remoteDocumentCache = __PRIVATE_newIndexedDbRemoteDocumentCache(this.serializer),
11771
- this.$r = new __PRIVATE_IndexedDbBundleCache, this.window && this.window.localStorage ? this.Ei = this.window.localStorage : (this.Ei = null,
11771
+ this.$r = new __PRIVATE_IndexedDbBundleCache, this.window && this.window.localStorage ? this.di = this.window.localStorage : (this.di = null,
11772
11772
  !1 === u && __PRIVATE_logError("IndexedDbPersistence", "LocalStorage is unavailable. As a result, persistence may not work reliably. In particular enablePersistence() could fail immediately after refreshing the page."));
11773
11773
  }
11774
11774
  /**
@@ -11789,7 +11789,7 @@ class __PRIVATE_IndexedDbPersistence {
11789
11789
  this.kr = new __PRIVATE_ListenSequence(e, this._i);
11790
11790
  })).then((() => {
11791
11791
  this.qr = !0;
11792
- })).catch((e => (this.di && this.di.close(), Promise.reject(e))));
11792
+ })).catch((e => (this.Ei && this.Ei.close(), Promise.reject(e))));
11793
11793
  }
11794
11794
  /**
11795
11795
  * Registers a listener that gets called when the primary state of the
@@ -11808,7 +11808,7 @@ class __PRIVATE_IndexedDbPersistence {
11808
11808
  *
11809
11809
  * PORTING NOTE: This is only used for Web multi-tab.
11810
11810
  */ setDatabaseDeletedListener(e) {
11811
- this.di.B((async t => {
11811
+ this.Ei.B((async t => {
11812
11812
  // Check if an attempt is made to delete IndexedDB.
11813
11813
  null === t.newVersion && await e();
11814
11814
  }));
@@ -11880,7 +11880,7 @@ class __PRIVATE_IndexedDbPersistence {
11880
11880
  // Ideally we'd delete the IndexedDb and LocalStorage zombie entries for
11881
11881
  // the client atomically, but we can't. So we opt to delete the IndexedDb
11882
11882
  // entries first to avoid potentially reviving a zombied client.
11883
- if (this.Ei) for (const t of e) this.Ei.removeItem(this.Fi(t.clientId));
11883
+ if (this.di) for (const t of e) this.di.removeItem(this.Fi(t.clientId));
11884
11884
  }
11885
11885
  }
11886
11886
  /**
@@ -11946,10 +11946,10 @@ class __PRIVATE_IndexedDbPersistence {
11946
11946
  this.Ni(),
11947
11947
  // Use `SimpleDb.runTransaction` directly to avoid failing if another tab
11948
11948
  // has obtained the primary lease.
11949
- await this.di.runTransaction("shutdown", "readwrite", [ "owner", "clientMetadata" ], (e => {
11949
+ await this.Ei.runTransaction("shutdown", "readwrite", [ "owner", "clientMetadata" ], (e => {
11950
11950
  const t = new __PRIVATE_IndexedDbTransaction(e, __PRIVATE_ListenSequence._e);
11951
11951
  return this.yi(t).next((() => this.bi(t)));
11952
- })), this.di.close(),
11952
+ })), this.Ei.close(),
11953
11953
  // Remove the entry marking the client as zombied from LocalStorage since
11954
11954
  // we successfully deleted its metadata from IndexedDb.
11955
11955
  this.Li();
@@ -12000,7 +12000,7 @@ class __PRIVATE_IndexedDbPersistence {
12000
12000
  let s;
12001
12001
  // Do all transactions as readwrite against all object stores, since we
12002
12002
  // are the only reader/writer.
12003
- return this.di.runTransaction(e, r, i, (r => (s = new __PRIVATE_IndexedDbTransaction(r, this.kr ? this.kr.next() : __PRIVATE_ListenSequence._e),
12003
+ return this.Ei.runTransaction(e, r, i, (r => (s = new __PRIVATE_IndexedDbTransaction(r, this.kr ? this.kr.next() : __PRIVATE_ListenSequence._e),
12004
12004
  "readwrite-primary" === t ? this.gi(s).next((e => !!e || this.pi(s))).next((t => {
12005
12005
  if (!t) throw __PRIVATE_logError(`Failed to obtain primary lease for action '${e}'.`),
12006
12006
  this.isPrimary = !1, this.oi.enqueueRetryable((() => this.Ii(!1))), new FirestoreError(D.FAILED_PRECONDITION, v);
@@ -12087,7 +12087,7 @@ class __PRIVATE_IndexedDbPersistence {
12087
12087
  */ Mi(e) {
12088
12088
  var t;
12089
12089
  try {
12090
- const n = null !== (null === (t = this.Ei) || void 0 === t ? void 0 : t.getItem(this.Fi(e)));
12090
+ const n = null !== (null === (t = this.di) || void 0 === t ? void 0 : t.getItem(this.Fi(e)));
12091
12091
  return __PRIVATE_logDebug("IndexedDbPersistence", `Client '${e}' ${n ? "is" : "is not"} zombied in LocalStorage`),
12092
12092
  n;
12093
12093
  } catch (e) {
@@ -12100,16 +12100,16 @@ class __PRIVATE_IndexedDbPersistence {
12100
12100
  * Record client as zombied (a client that had its tab closed). Zombied
12101
12101
  * clients are ignored during primary tab selection.
12102
12102
  */ xi() {
12103
- if (this.Ei) try {
12104
- this.Ei.setItem(this.Fi(this.clientId), String(Date.now()));
12103
+ if (this.di) try {
12104
+ this.di.setItem(this.Fi(this.clientId), String(Date.now()));
12105
12105
  } catch (e) {
12106
12106
  // Gracefully handle if LocalStorage isn't available / working.
12107
12107
  __PRIVATE_logError("Failed to set zombie client id.", e);
12108
12108
  }
12109
12109
  }
12110
12110
  /** Removes the zombied client entry if it exists. */ Li() {
12111
- if (this.Ei) try {
12112
- this.Ei.removeItem(this.Fi(this.clientId));
12111
+ if (this.di) try {
12112
+ this.di.removeItem(this.Fi(this.clientId));
12113
12113
  } catch (e) {
12114
12114
  // Ignore
12115
12115
  }
@@ -12928,14 +12928,14 @@ class __PRIVATE_MutationMetadata {
12928
12928
  /**
12929
12929
  * Parses a MutationMetadata from its JSON representation in WebStorage.
12930
12930
  * Logs a warning and returns null if the format of the data is not valid.
12931
- */ static ds(e, t, n) {
12931
+ */ static Es(e, t, n) {
12932
12932
  const r = JSON.parse(n);
12933
12933
  let i, s = "object" == typeof r && -1 !== [ "pending", "acknowledged", "rejected" ].indexOf(r.state) && (void 0 === r.error || "object" == typeof r.error);
12934
12934
  return s && r.error && (s = "string" == typeof r.error.message && "string" == typeof r.error.code,
12935
12935
  s && (i = new FirestoreError(r.error.code, r.error.message))), s ? new __PRIVATE_MutationMetadata(e, t, r.state, i) : (__PRIVATE_logError("SharedClientState", `Failed to parse mutation state for ID '${t}': ${n}`),
12936
12936
  null);
12937
12937
  }
12938
- Es() {
12938
+ ds() {
12939
12939
  const e = {
12940
12940
  state: this.state,
12941
12941
  updateTimeMs: Date.now()
@@ -12959,14 +12959,14 @@ class __PRIVATE_QueryTargetMetadata {
12959
12959
  /**
12960
12960
  * Parses a QueryTargetMetadata from its JSON representation in WebStorage.
12961
12961
  * Logs a warning and returns null if the format of the data is not valid.
12962
- */ static ds(e, t) {
12962
+ */ static Es(e, t) {
12963
12963
  const n = JSON.parse(t);
12964
12964
  let r, i = "object" == typeof n && -1 !== [ "not-current", "current", "rejected" ].indexOf(n.state) && (void 0 === n.error || "object" == typeof n.error);
12965
12965
  return i && n.error && (i = "string" == typeof n.error.message && "string" == typeof n.error.code,
12966
12966
  i && (r = new FirestoreError(n.error.code, n.error.message))), i ? new __PRIVATE_QueryTargetMetadata(e, n.state, r) : (__PRIVATE_logError("SharedClientState", `Failed to parse target state for ID '${e}': ${t}`),
12967
12967
  null);
12968
12968
  }
12969
- Es() {
12969
+ ds() {
12970
12970
  const e = {
12971
12971
  state: this.state,
12972
12972
  updateTimeMs: Date.now()
@@ -12988,7 +12988,7 @@ class __PRIVATE_QueryTargetMetadata {
12988
12988
  /**
12989
12989
  * Parses a RemoteClientState from the JSON representation in WebStorage.
12990
12990
  * Logs a warning and returns null if the format of the data is not valid.
12991
- */ static ds(e, t) {
12991
+ */ static Es(e, t) {
12992
12992
  const n = JSON.parse(t);
12993
12993
  let r = "object" == typeof n && n.activeTargetIds instanceof Array, i = __PRIVATE_targetIdSet();
12994
12994
  for (let e = 0; r && e < n.activeTargetIds.length; ++e) r = isSafeInteger(n.activeTargetIds[e]),
@@ -13009,7 +13009,7 @@ class __PRIVATE_QueryTargetMetadata {
13009
13009
  /**
13010
13010
  * Parses a SharedOnlineState from its JSON representation in WebStorage.
13011
13011
  * Logs a warning and returns null if the format of the data is not valid.
13012
- */ static ds(e) {
13012
+ */ static Es(e) {
13013
13013
  const t = JSON.parse(e);
13014
13014
  return "object" == typeof t && -1 !== [ "Unknown", "Online", "Offline" ].indexOf(t.onlineState) && "string" == typeof t.clientId ? new __PRIVATE_SharedOnlineState(t.clientId, t.onlineState) : (__PRIVATE_logError("SharedClientState", `Failed to parse online state: ${e}`),
13015
13015
  null);
@@ -13040,7 +13040,7 @@ class __PRIVATE_LocalClientState {
13040
13040
  /**
13041
13041
  * Converts this entry into a JSON-encoded format we can use for WebStorage.
13042
13042
  * Does not encode `clientId` as it is part of the key in WebStorage.
13043
- */ Es() {
13043
+ */ ds() {
13044
13044
  const e = {
13045
13045
  activeTargetIds: this.activeTargetIds.toArray(),
13046
13046
  updateTimeMs: Date.now()
@@ -13124,7 +13124,7 @@ class __PRIVATE_LocalClientState {
13124
13124
  if (t === this.Vs) continue;
13125
13125
  const e = this.getItem(createWebStorageClientStateKey(this.persistenceKey, t));
13126
13126
  if (e) {
13127
- const n = __PRIVATE_RemoteClientState.ds(t, e);
13127
+ const n = __PRIVATE_RemoteClientState.Es(t, e);
13128
13128
  n && (this.ps = this.ps.insert(n.clientId, n));
13129
13129
  }
13130
13130
  }
@@ -13171,7 +13171,7 @@ class __PRIVATE_LocalClientState {
13171
13171
  if (this.isActiveQueryTarget(e)) {
13172
13172
  const n = this.storage.getItem(createWebStorageQueryTargetMetadataKey(this.persistenceKey, e));
13173
13173
  if (n) {
13174
- const r = __PRIVATE_QueryTargetMetadata.ds(e, n);
13174
+ const r = __PRIVATE_QueryTargetMetadata.Es(e, n);
13175
13175
  r && (t = r.state);
13176
13176
  }
13177
13177
  }
@@ -13277,11 +13277,11 @@ class __PRIVATE_LocalClientState {
13277
13277
  return this.ps.get(this.Vs);
13278
13278
  }
13279
13279
  Ms() {
13280
- this.setItem(this.ws, this.ks.Es());
13280
+ this.setItem(this.ws, this.ks.ds());
13281
13281
  }
13282
13282
  Ls(e, t, n) {
13283
13283
  const r = new __PRIVATE_MutationMetadata(this.currentUser, e, t, n), i = createWebStorageMutationBatchKey(this.persistenceKey, this.currentUser, e);
13284
- this.setItem(i, r.Es());
13284
+ this.setItem(i, r.ds());
13285
13285
  }
13286
13286
  Bs(e) {
13287
13287
  const t = createWebStorageMutationBatchKey(this.persistenceKey, this.currentUser, e);
@@ -13296,7 +13296,7 @@ class __PRIVATE_LocalClientState {
13296
13296
  }
13297
13297
  qs(e, t, n) {
13298
13298
  const r = createWebStorageQueryTargetMetadataKey(this.persistenceKey, e), i = new __PRIVATE_QueryTargetMetadata(e, t, n);
13299
- this.setItem(r, i.Es());
13299
+ this.setItem(r, i.ds());
13300
13300
  }
13301
13301
  Ks(e) {
13302
13302
  const t = JSON.stringify(Array.from(e));
@@ -13314,27 +13314,27 @@ class __PRIVATE_LocalClientState {
13314
13314
  * be parsed.
13315
13315
  */ Ws(e, t) {
13316
13316
  const n = this.$s(e);
13317
- return __PRIVATE_RemoteClientState.ds(n, t);
13317
+ return __PRIVATE_RemoteClientState.Es(n, t);
13318
13318
  }
13319
13319
  /**
13320
13320
  * Parses a mutation batch state in WebStorage. Returns 'null' if the value
13321
13321
  * could not be parsed.
13322
13322
  */ Gs(e, t) {
13323
13323
  const n = this.Ds.exec(e), r = Number(n[1]), i = void 0 !== n[2] ? n[2] : null;
13324
- return __PRIVATE_MutationMetadata.ds(new User(i), r, t);
13324
+ return __PRIVATE_MutationMetadata.Es(new User(i), r, t);
13325
13325
  }
13326
13326
  /**
13327
13327
  * Parses a query target state from WebStorage. Returns 'null' if the value
13328
13328
  * could not be parsed.
13329
13329
  */ js(e, t) {
13330
13330
  const n = this.Cs.exec(e), r = Number(n[1]);
13331
- return __PRIVATE_QueryTargetMetadata.ds(r, t);
13331
+ return __PRIVATE_QueryTargetMetadata.Es(r, t);
13332
13332
  }
13333
13333
  /**
13334
13334
  * Parses an online state from WebStorage. Returns 'null' if the value
13335
13335
  * could not be parsed.
13336
13336
  */ xs(e) {
13337
- return __PRIVATE_SharedOnlineState.ds(e);
13337
+ return __PRIVATE_SharedOnlineState.Es(e);
13338
13338
  }
13339
13339
  Js(e) {
13340
13340
  return JSON.parse(e);
@@ -14392,13 +14392,13 @@ class __PRIVATE_PersistentStream {
14392
14392
  }
14393
14393
  // The first response is always the handshake response
14394
14394
  return __PRIVATE_hardAssert(!e.writeResults || 0 === e.writeResults.length), this.h_ = !0,
14395
- this.listener.d_();
14395
+ this.listener.E_();
14396
14396
  }
14397
14397
  /**
14398
14398
  * Sends an initial streamToken to the server, performing the handshake
14399
14399
  * required to make the StreamingWrite RPC work. Subsequent
14400
14400
  * calls should wait until onHandshakeComplete was called.
14401
- */ E_() {
14401
+ */ d_() {
14402
14402
  // TODO(dimond): Support stream resumption. We intentionally do not set the
14403
14403
  // stream token on the handshake, ignoring any stream token we might have.
14404
14404
  const e = {};
@@ -14921,7 +14921,7 @@ function __PRIVATE_startWriteStream(e) {
14921
14921
  }
14922
14922
 
14923
14923
  async function __PRIVATE_onWriteStreamOpen(e) {
14924
- __PRIVATE_ensureWriteStream(e).E_();
14924
+ __PRIVATE_ensureWriteStream(e).d_();
14925
14925
  }
14926
14926
 
14927
14927
  async function __PRIVATE_onWriteHandshakeComplete(e) {
@@ -15043,7 +15043,7 @@ async function __PRIVATE_remoteStoreHandleCredentialChange(e, t) {
15043
15043
  }(e.datastore, e.asyncQueue, {
15044
15044
  Po: __PRIVATE_onWriteStreamOpen.bind(null, e),
15045
15045
  To: __PRIVATE_onWriteStreamClose.bind(null, e),
15046
- d_: __PRIVATE_onWriteHandshakeComplete.bind(null, e),
15046
+ E_: __PRIVATE_onWriteHandshakeComplete.bind(null, e),
15047
15047
  T_: __PRIVATE_onMutationResult.bind(null, e)
15048
15048
  }), e.F_.push((async t => {
15049
15049
  t ? (e.L_.Zo(),
@@ -15745,7 +15745,7 @@ class __PRIVATE_RemovedLimboDocument {
15745
15745
  * with this set of docs and changes instead of the current view.
15746
15746
  * @returns a new set of docs, changes, and refill flag.
15747
15747
  */ Ta(e, t) {
15748
- const n = t ? t.da : new __PRIVATE_DocumentChangeSet, r = t ? t.Pa : this.Pa;
15748
+ const n = t ? t.Ea : new __PRIVATE_DocumentChangeSet, r = t ? t.Pa : this.Pa;
15749
15749
  let i = t ? t.mutatedKeys : this.mutatedKeys, s = r, o = !1;
15750
15750
  // Track the last doc in a (full) limit. This is necessary, because some
15751
15751
  // update (a delete, or an update moving a doc past the old limit) might
@@ -15768,7 +15768,7 @@ class __PRIVATE_RemovedLimboDocument {
15768
15768
  u.data.isEqual(c.data) ? l !== h && (n.track({
15769
15769
  type: 3 /* ChangeType.Metadata */ ,
15770
15770
  doc: c
15771
- }), P = !0) : this.Ea(u, c) || (n.track({
15771
+ }), P = !0) : this.da(u, c) || (n.track({
15772
15772
  type: 2 /* ChangeType.Modified */ ,
15773
15773
  doc: c
15774
15774
  }), P = !0, (_ && this.ha(c, _) > 0 || a && this.ha(c, a) < 0) && (
@@ -15797,12 +15797,12 @@ class __PRIVATE_RemovedLimboDocument {
15797
15797
  }
15798
15798
  return {
15799
15799
  Pa: s,
15800
- da: n,
15800
+ Ea: n,
15801
15801
  Xi: o,
15802
15802
  mutatedKeys: i
15803
15803
  };
15804
15804
  }
15805
- Ea(e, t) {
15805
+ da(e, t) {
15806
15806
  // We suppress the initial change event for documents that were modified as
15807
15807
  // part of a write acknowledgment (e.g. when the value of a server transform
15808
15808
  // is applied) as Watch will send us the same document again.
@@ -15830,7 +15830,7 @@ class __PRIVATE_RemovedLimboDocument {
15830
15830
  const i = this.Pa;
15831
15831
  this.Pa = e.Pa, this.mutatedKeys = e.mutatedKeys;
15832
15832
  // Sort changes based on type and query comparator
15833
- const s = e.da.k_();
15833
+ const s = e.Ea.k_();
15834
15834
  s.sort(((e, t) => function __PRIVATE_compareChangeType(e, t) {
15835
15835
  const order = e => {
15836
15836
  switch (e) {
@@ -15895,7 +15895,7 @@ class __PRIVATE_RemovedLimboDocument {
15895
15895
  // true once the client is back online.
15896
15896
  this.current = !1, this.applyChanges({
15897
15897
  Pa: this.Pa,
15898
- da: new __PRIVATE_DocumentChangeSet,
15898
+ Ea: new __PRIVATE_DocumentChangeSet,
15899
15899
  mutatedKeys: this.mutatedKeys,
15900
15900
  Xi: !1
15901
15901
  },
@@ -18547,7 +18547,7 @@ function doc(e, t, ...n) {
18547
18547
  /**
18548
18548
  * For Tests: Determine if a delayed operation with a particular TimerId
18549
18549
  * exists.
18550
- */ du(e) {
18550
+ */ Eu(e) {
18551
18551
  for (const t of this.su) if (t.timerId === e) return !0;
18552
18552
  return !1;
18553
18553
  }
@@ -18557,7 +18557,7 @@ function doc(e, t, ...n) {
18557
18557
  * @param lastTimerId - Delayed operations up to and including this TimerId
18558
18558
  * will be drained. Pass TimerId.All to run all delayed operations.
18559
18559
  * @returns a Promise that resolves once all operations have been run.
18560
- */ Eu(e) {
18560
+ */ du(e) {
18561
18561
  // Note that draining may generate more delayed ops, so we do that first.
18562
18562
  return this.Tu().then((() => {
18563
18563
  // Run ops in the same order they'd run if they ran naturally.
@@ -21916,9 +21916,9 @@ let Ce = null;
21916
21916
  return r = Object.assign({
21917
21917
  useFetchStreams: t
21918
21918
  }, r), s._setSettings(r), s;
21919
- }), "PUBLIC").setMultipleInstances(!0)), app.registerVersion(w, "4.5.1-canary.13ddddf52", e),
21919
+ }), "PUBLIC").setMultipleInstances(!0)), app.registerVersion(w, "4.5.1-canary.36b261c65", e),
21920
21920
  // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation
21921
- app.registerVersion(w, "4.5.1-canary.13ddddf52", "cjs2017");
21921
+ app.registerVersion(w, "4.5.1-canary.36b261c65", "cjs2017");
21922
21922
  }();
21923
21923
 
21924
21924
  exports.AbstractUserDataWriter = AbstractUserDataWriter;