@firebase/firestore 4.4.2 → 4.4.3-canary.245dd26e1

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.8.0";
73
+ let S = "10.8.1-canary.245dd26e1";
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.Ee = webchannelWrapper.Integer.fromNumber(this.Te);
5851
+ this.de = 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
- de(e, t, n) {
5855
+ Ee(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(le) && (r = new webchannelWrapper.Integer([ r.getBits(0), r.getBits(1) ], 0)),
5860
- r.modulo(this.Ee).toNumber();
5860
+ r.modulo(this.de).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.de(n, r, e);
5871
+ const t = this.Ee(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.de(n, r, e);
5884
+ const t = this.Ee(n, r, e);
5885
5885
  this.Re(t);
5886
5886
  }
5887
5887
  }
@@ -7602,52 +7602,52 @@ class __PRIVATE_FirestoreIndexValueWriter {
7602
7602
  t.Tt();
7603
7603
  }
7604
7604
  It(e, t) {
7605
- if ("nullValue" in e) this.Et(t, 5); else if ("booleanValue" in e) this.Et(t, 10),
7606
- 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) {
7605
+ if ("nullValue" in e) this.dt(t, 5); else if ("booleanValue" in e) this.dt(t, 10),
7606
+ 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) {
7607
7607
  const n = __PRIVATE_normalizeNumber(e.doubleValue);
7608
- isNaN(n) ? this.Et(t, 13) : (this.Et(t, 15), __PRIVATE_isNegativeZero(n) ?
7608
+ isNaN(n) ? this.dt(t, 13) : (this.dt(t, 15), __PRIVATE_isNegativeZero(n) ?
7609
7609
  // -0.0, 0 and 0.0 are all considered the same
7610
- t.dt(0) : t.dt(n));
7610
+ t.Et(0) : t.Et(n));
7611
7611
  } else if ("timestampValue" in e) {
7612
7612
  const n = e.timestampValue;
7613
- this.Et(t, 20), "string" == typeof n ? t.At(n) : (t.At(`${n.seconds || ""}`), t.dt(n.nanos || 0));
7614
- } else if ("stringValue" in e) this.Rt(e.stringValue, t), this.Vt(t); else if ("bytesValue" in e) this.Et(t, 30),
7613
+ this.dt(t, 20), "string" == typeof n ? t.At(n) : (t.At(`${n.seconds || ""}`), t.Et(n.nanos || 0));
7614
+ } else if ("stringValue" in e) this.Rt(e.stringValue, t), this.Vt(t); else if ("bytesValue" in e) this.dt(t, 30),
7615
7615
  t.ft(__PRIVATE_normalizeByteString(e.bytesValue)), this.Vt(t); else if ("referenceValue" in e) this.gt(e.referenceValue, t); else if ("geoPointValue" in e) {
7616
7616
  const n = e.geoPointValue;
7617
- this.Et(t, 45), t.dt(n.latitude || 0), t.dt(n.longitude || 0);
7618
- } else "mapValue" in e ? __PRIVATE_isMaxValue(e) ? this.Et(t, Number.MAX_SAFE_INTEGER) : (this.yt(e.mapValue, t),
7617
+ this.dt(t, 45), t.Et(n.latitude || 0), t.Et(n.longitude || 0);
7618
+ } else "mapValue" in e ? __PRIVATE_isMaxValue(e) ? this.dt(t, Number.MAX_SAFE_INTEGER) : (this.yt(e.mapValue, t),
7619
7619
  this.Vt(t)) : "arrayValue" in e ? (this.wt(e.arrayValue, t), this.Vt(t)) : fail();
7620
7620
  }
7621
7621
  Rt(e, t) {
7622
- this.Et(t, 25), this.St(e, t);
7622
+ this.dt(t, 25), this.St(e, t);
7623
7623
  }
7624
7624
  St(e, t) {
7625
7625
  t.At(e);
7626
7626
  }
7627
7627
  yt(e, t) {
7628
7628
  const n = e.fields || {};
7629
- this.Et(t, 55);
7629
+ this.dt(t, 55);
7630
7630
  for (const e of Object.keys(n)) this.Rt(e, t), this.It(n[e], t);
7631
7631
  }
7632
7632
  wt(e, t) {
7633
7633
  const n = e.values || [];
7634
- this.Et(t, 50);
7634
+ this.dt(t, 50);
7635
7635
  for (const e of n) this.It(e, t);
7636
7636
  }
7637
7637
  gt(e, t) {
7638
- this.Et(t, 37);
7638
+ this.dt(t, 37);
7639
7639
  DocumentKey.fromName(e).path.forEach((e => {
7640
- this.Et(t, 60), this.St(e, t);
7640
+ this.dt(t, 60), this.St(e, t);
7641
7641
  }));
7642
7642
  }
7643
- Et(e, t) {
7644
- e.dt(t);
7643
+ dt(e, t) {
7644
+ e.Et(t);
7645
7645
  }
7646
7646
  Vt(e) {
7647
7647
  // While the SDK does not implement truncation, the truncation marker is
7648
7648
  // used to terminate all variable length values (which are strings, bytes,
7649
7649
  // references, arrays and maps).
7650
- e.dt(2);
7650
+ e.Et(2);
7651
7651
  }
7652
7652
  }
7653
7653
 
@@ -7837,7 +7837,7 @@ class __PRIVATE_AscendingIndexByteEncoder {
7837
7837
  At(e) {
7838
7838
  this.Gt.Ot(e);
7839
7839
  }
7840
- dt(e) {
7840
+ Et(e) {
7841
7841
  this.Gt.Bt(e);
7842
7842
  }
7843
7843
  Tt() {
@@ -7855,7 +7855,7 @@ class __PRIVATE_DescendingIndexByteEncoder {
7855
7855
  At(e) {
7856
7856
  this.Gt.Nt(e);
7857
7857
  }
7858
- dt(e) {
7858
+ Et(e) {
7859
7859
  this.Gt.qt(e);
7860
7860
  }
7861
7861
  Tt() {
@@ -8586,17 +8586,17 @@ class __PRIVATE_IndexedDbIndexManager {
8586
8586
  // combined with the values from the query bounds.
8587
8587
  const _ = (null != t ? t.length : 1) * Math.max(n.length, i.length), a = _ / (null != t ? t.length : 1), u = [];
8588
8588
  for (let c = 0; c < _; ++c) {
8589
- const _ = t ? this.Tn(t[c / a]) : Te, l = this.En(e, _, n[c % a], r), h = this.dn(e, _, i[c % a], s), P = o.map((t => this.En(e, _, t,
8589
+ const _ = t ? this.Tn(t[c / a]) : Te, l = this.dn(e, _, n[c % a], r), h = this.En(e, _, i[c % a], s), P = o.map((t => this.dn(e, _, t,
8590
8590
  /* inclusive= */ !0)));
8591
8591
  u.push(...this.createRange(l, h, P));
8592
8592
  }
8593
8593
  return u;
8594
8594
  }
8595
- /** Generates the lower bound for `arrayValue` and `directionalValue`. */ En(e, t, n, r) {
8595
+ /** Generates the lower bound for `arrayValue` and `directionalValue`. */ dn(e, t, n, r) {
8596
8596
  const i = new __PRIVATE_IndexEntry(e, DocumentKey.empty(), t, n);
8597
8597
  return r ? i : i.Jt();
8598
8598
  }
8599
- /** Generates the upper bound for `arrayValue` and `directionalValue`. */ dn(e, t, n, r) {
8599
+ /** Generates the upper bound for `arrayValue` and `directionalValue`. */ En(e, t, n, r) {
8600
8600
  const i = new __PRIVATE_IndexEntry(e, DocumentKey.empty(), t, n);
8601
8601
  return r ? i.Jt() : i;
8602
8602
  }
@@ -8926,7 +8926,7 @@ function __PRIVATE_getMinOffsetFromFieldIndexes(e) {
8926
8926
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8927
8927
  * See the License for the specific language governing permissions and
8928
8928
  * limitations under the License.
8929
- */ const Ee = {
8929
+ */ const de = {
8930
8930
  didRun: !1,
8931
8931
  sequenceNumbersCollected: 0,
8932
8932
  targetsRemoved: 0,
@@ -9659,8 +9659,8 @@ class __PRIVATE_TargetIdGenerator {
9659
9659
  }
9660
9660
  collect(e, t) {
9661
9661
  return -1 === this.params.cacheSizeCollectionThreshold ? (__PRIVATE_logDebug("LruGarbageCollector", "Garbage collection skipped; disabled"),
9662
- 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}`),
9663
- Ee) : this.Yn(e, t)));
9662
+ 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}`),
9663
+ de) : this.Yn(e, t)));
9664
9664
  }
9665
9665
  getCacheSize(e) {
9666
9666
  return this.jn.getCacheSize(e);
@@ -10702,7 +10702,7 @@ class OverlayedDocument {
10702
10702
  // A set of outstanding references to a document sorted by key.
10703
10703
  this.Pr = new SortedSet(__PRIVATE_DocReference.Ir),
10704
10704
  // A set of outstanding references to a document sorted by target id.
10705
- this.Tr = new SortedSet(__PRIVATE_DocReference.Er);
10705
+ this.Tr = new SortedSet(__PRIVATE_DocReference.dr);
10706
10706
  }
10707
10707
  /** Returns true if the reference set contains no references. */ isEmpty() {
10708
10708
  return this.Pr.isEmpty();
@@ -10711,7 +10711,7 @@ class OverlayedDocument {
10711
10711
  const n = new __PRIVATE_DocReference(e, t);
10712
10712
  this.Pr = this.Pr.add(n), this.Tr = this.Tr.add(n);
10713
10713
  }
10714
- /** Add references to the given document keys for the given ID. */ dr(e, t) {
10714
+ /** Add references to the given document keys for the given ID. */ Er(e, t) {
10715
10715
  e.forEach((e => this.addReference(e, t)));
10716
10716
  }
10717
10717
  /**
@@ -10758,7 +10758,7 @@ class __PRIVATE_DocReference {
10758
10758
  /** Compare by key then by ID */ static Ir(e, t) {
10759
10759
  return DocumentKey.comparator(e.key, t.key) || __PRIVATE_primitiveComparator(e.pr, t.pr);
10760
10760
  }
10761
- /** Compare by ID then by key */ static Er(e, t) {
10761
+ /** Compare by ID then by key */ static dr(e, t) {
10762
10762
  return __PRIVATE_primitiveComparator(e.pr, t.pr) || DocumentKey.comparator(e.key, t.key);
10763
10763
  }
10764
10764
  }
@@ -11137,7 +11137,7 @@ class __PRIVATE_MemoryRemoteDocumentChangeBuffer extends RemoteDocumentChangeBuf
11137
11137
  return PersistencePromise.resolve(n);
11138
11138
  }
11139
11139
  addMatchingKeys(e, t, n) {
11140
- return this.Nr.dr(t, n), PersistencePromise.resolve();
11140
+ return this.Nr.Er(t, n), PersistencePromise.resolve();
11141
11141
  }
11142
11142
  removeMatchingKeys(e, t, n) {
11143
11143
  this.Nr.Rr(t, n);
@@ -11675,7 +11675,7 @@ function __PRIVATE_createQueryCache(e) {
11675
11675
  }), e.createObjectStore("targetGlobal");
11676
11676
  }
11677
11677
 
11678
- const de = "Failed to obtain exclusive access to the persistence layer. To allow shared access, multi-tab synchronization has to be enabled in all tabs. If you are using `experimentalForceOwningTab:true`, make sure that only one tab has persistence enabled at any given time.";
11678
+ const Ee = "Failed to obtain exclusive access to the persistence layer. To allow shared access, multi-tab synchronization has to be enabled in all tabs. If you are using `experimentalForceOwningTab:true`, make sure that only one tab has persistence enabled at any given time.";
11679
11679
 
11680
11680
  /**
11681
11681
  * Oldest acceptable age in milliseconds for client metadata before the client
@@ -11753,10 +11753,10 @@ class __PRIVATE_IndexedDbPersistence {
11753
11753
  /** A listener to notify on primary state changes. */
11754
11754
  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.");
11755
11755
  this.referenceDelegate = new __PRIVATE_IndexedDbLruDelegateImpl(this, r), this.Ti = t + "main",
11756
- this.serializer = new __PRIVATE_LocalSerializer(_), this.Ei = new __PRIVATE_SimpleDb(this.Ti, this.ui, new __PRIVATE_SchemaConverter(this.serializer)),
11756
+ this.serializer = new __PRIVATE_LocalSerializer(_), this.di = new __PRIVATE_SimpleDb(this.Ti, this.ui, new __PRIVATE_SchemaConverter(this.serializer)),
11757
11757
  this.Qr = new __PRIVATE_IndexedDbTargetCache(this.referenceDelegate, this.serializer),
11758
11758
  this.remoteDocumentCache = __PRIVATE_newIndexedDbRemoteDocumentCache(this.serializer),
11759
- this.$r = new __PRIVATE_IndexedDbBundleCache, this.window && this.window.localStorage ? this.di = this.window.localStorage : (this.di = null,
11759
+ this.$r = new __PRIVATE_IndexedDbBundleCache, this.window && this.window.localStorage ? this.Ei = this.window.localStorage : (this.Ei = null,
11760
11760
  !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."));
11761
11761
  }
11762
11762
  /**
@@ -11771,13 +11771,13 @@ class __PRIVATE_IndexedDbPersistence {
11771
11771
  if (!this.isPrimary && !this.allowTabSynchronization)
11772
11772
  // Fail `start()` if `synchronizeTabs` is disabled and we cannot
11773
11773
  // obtain the primary lease.
11774
- throw new FirestoreError(D.FAILED_PRECONDITION, de);
11774
+ throw new FirestoreError(D.FAILED_PRECONDITION, Ee);
11775
11775
  return this.Ri(), this.Vi(), this.mi(), this.runTransaction("getHighestListenSequenceNumber", "readonly", (e => this.Qr.getHighestSequenceNumber(e)));
11776
11776
  })).then((e => {
11777
11777
  this.kr = new __PRIVATE_ListenSequence(e, this._i);
11778
11778
  })).then((() => {
11779
11779
  this.qr = !0;
11780
- })).catch((e => (this.Ei && this.Ei.close(), Promise.reject(e))));
11780
+ })).catch((e => (this.di && this.di.close(), Promise.reject(e))));
11781
11781
  }
11782
11782
  /**
11783
11783
  * Registers a listener that gets called when the primary state of the
@@ -11796,7 +11796,7 @@ class __PRIVATE_IndexedDbPersistence {
11796
11796
  *
11797
11797
  * PORTING NOTE: This is only used for Web multi-tab.
11798
11798
  */ setDatabaseDeletedListener(e) {
11799
- this.Ei.L((async t => {
11799
+ this.di.L((async t => {
11800
11800
  // Check if an attempt is made to delete IndexedDB.
11801
11801
  null === t.newVersion && await e();
11802
11802
  }));
@@ -11868,7 +11868,7 @@ class __PRIVATE_IndexedDbPersistence {
11868
11868
  // Ideally we'd delete the IndexedDb and LocalStorage zombie entries for
11869
11869
  // the client atomically, but we can't. So we opt to delete the IndexedDb
11870
11870
  // entries first to avoid potentially reviving a zombied client.
11871
- if (this.di) for (const t of e) this.di.removeItem(this.Fi(t.clientId));
11871
+ if (this.Ei) for (const t of e) this.Ei.removeItem(this.Fi(t.clientId));
11872
11872
  }
11873
11873
  }
11874
11874
  /**
@@ -11913,7 +11913,7 @@ class __PRIVATE_IndexedDbPersistence {
11913
11913
  // settings is not supported.
11914
11914
  // TODO(b/114226234): Remove this check when `synchronizeTabs` can
11915
11915
  // no longer be turned off.
11916
- throw new FirestoreError(D.FAILED_PRECONDITION, de);
11916
+ throw new FirestoreError(D.FAILED_PRECONDITION, Ee);
11917
11917
  return !1;
11918
11918
  }
11919
11919
  }
@@ -11934,10 +11934,10 @@ class __PRIVATE_IndexedDbPersistence {
11934
11934
  this.Ni(),
11935
11935
  // Use `SimpleDb.runTransaction` directly to avoid failing if another tab
11936
11936
  // has obtained the primary lease.
11937
- await this.Ei.runTransaction("shutdown", "readwrite", [ "owner", "clientMetadata" ], (e => {
11937
+ await this.di.runTransaction("shutdown", "readwrite", [ "owner", "clientMetadata" ], (e => {
11938
11938
  const t = new __PRIVATE_IndexedDbTransaction(e, __PRIVATE_ListenSequence._e);
11939
11939
  return this.yi(t).next((() => this.bi(t)));
11940
- })), this.Ei.close(),
11940
+ })), this.di.close(),
11941
11941
  // Remove the entry marking the client as zombied from LocalStorage since
11942
11942
  // we successfully deleted its metadata from IndexedDb.
11943
11943
  this.Bi();
@@ -11988,7 +11988,7 @@ class __PRIVATE_IndexedDbPersistence {
11988
11988
  let s;
11989
11989
  // Do all transactions as readwrite against all object stores, since we
11990
11990
  // are the only reader/writer.
11991
- return this.Ei.runTransaction(e, r, i, (r => (s = new __PRIVATE_IndexedDbTransaction(r, this.kr ? this.kr.next() : __PRIVATE_ListenSequence._e),
11991
+ return this.di.runTransaction(e, r, i, (r => (s = new __PRIVATE_IndexedDbTransaction(r, this.kr ? this.kr.next() : __PRIVATE_ListenSequence._e),
11992
11992
  "readwrite-primary" === t ? this.gi(s).next((e => !!e || this.pi(s))).next((t => {
11993
11993
  if (!t) throw __PRIVATE_logError(`Failed to obtain primary lease for action '${e}'.`),
11994
11994
  this.isPrimary = !1, this.oi.enqueueRetryable((() => this.Ii(!1))), new FirestoreError(D.FAILED_PRECONDITION, v);
@@ -12004,7 +12004,7 @@ class __PRIVATE_IndexedDbPersistence {
12004
12004
  // be turned off.
12005
12005
  ki(e) {
12006
12006
  return __PRIVATE_primaryClientStore(e).get("owner").next((e => {
12007
- if (null !== e && this.Ci(e.leaseTimestampMs, 5e3) && !this.Mi(e.ownerId) && !this.Si(e) && !(this.ai || this.allowTabSynchronization && e.allowTabSynchronization)) throw new FirestoreError(D.FAILED_PRECONDITION, de);
12007
+ if (null !== e && this.Ci(e.leaseTimestampMs, 5e3) && !this.Mi(e.ownerId) && !this.Si(e) && !(this.ai || this.allowTabSynchronization && e.allowTabSynchronization)) throw new FirestoreError(D.FAILED_PRECONDITION, Ee);
12008
12008
  }));
12009
12009
  }
12010
12010
  /**
@@ -12075,7 +12075,7 @@ class __PRIVATE_IndexedDbPersistence {
12075
12075
  */ Mi(e) {
12076
12076
  var t;
12077
12077
  try {
12078
- const n = null !== (null === (t = this.di) || void 0 === t ? void 0 : t.getItem(this.Fi(e)));
12078
+ const n = null !== (null === (t = this.Ei) || void 0 === t ? void 0 : t.getItem(this.Fi(e)));
12079
12079
  return __PRIVATE_logDebug("IndexedDbPersistence", `Client '${e}' ${n ? "is" : "is not"} zombied in LocalStorage`),
12080
12080
  n;
12081
12081
  } catch (e) {
@@ -12088,16 +12088,16 @@ class __PRIVATE_IndexedDbPersistence {
12088
12088
  * Record client as zombied (a client that had its tab closed). Zombied
12089
12089
  * clients are ignored during primary tab selection.
12090
12090
  */ xi() {
12091
- if (this.di) try {
12092
- this.di.setItem(this.Fi(this.clientId), String(Date.now()));
12091
+ if (this.Ei) try {
12092
+ this.Ei.setItem(this.Fi(this.clientId), String(Date.now()));
12093
12093
  } catch (e) {
12094
12094
  // Gracefully handle if LocalStorage isn't available / working.
12095
12095
  __PRIVATE_logError("Failed to set zombie client id.", e);
12096
12096
  }
12097
12097
  }
12098
12098
  /** Removes the zombied client entry if it exists. */ Bi() {
12099
- if (this.di) try {
12100
- this.di.removeItem(this.Fi(this.clientId));
12099
+ if (this.Ei) try {
12100
+ this.Ei.removeItem(this.Fi(this.clientId));
12101
12101
  } catch (e) {
12102
12102
  // Ignore
12103
12103
  }
@@ -12916,14 +12916,14 @@ class __PRIVATE_MutationMetadata {
12916
12916
  /**
12917
12917
  * Parses a MutationMetadata from its JSON representation in WebStorage.
12918
12918
  * Logs a warning and returns null if the format of the data is not valid.
12919
- */ static Es(e, t, n) {
12919
+ */ static ds(e, t, n) {
12920
12920
  const r = JSON.parse(n);
12921
12921
  let i, s = "object" == typeof r && -1 !== [ "pending", "acknowledged", "rejected" ].indexOf(r.state) && (void 0 === r.error || "object" == typeof r.error);
12922
12922
  return s && r.error && (s = "string" == typeof r.error.message && "string" == typeof r.error.code,
12923
12923
  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}`),
12924
12924
  null);
12925
12925
  }
12926
- ds() {
12926
+ Es() {
12927
12927
  const e = {
12928
12928
  state: this.state,
12929
12929
  updateTimeMs: Date.now()
@@ -12947,14 +12947,14 @@ class __PRIVATE_QueryTargetMetadata {
12947
12947
  /**
12948
12948
  * Parses a QueryTargetMetadata from its JSON representation in WebStorage.
12949
12949
  * Logs a warning and returns null if the format of the data is not valid.
12950
- */ static Es(e, t) {
12950
+ */ static ds(e, t) {
12951
12951
  const n = JSON.parse(t);
12952
12952
  let r, i = "object" == typeof n && -1 !== [ "not-current", "current", "rejected" ].indexOf(n.state) && (void 0 === n.error || "object" == typeof n.error);
12953
12953
  return i && n.error && (i = "string" == typeof n.error.message && "string" == typeof n.error.code,
12954
12954
  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}`),
12955
12955
  null);
12956
12956
  }
12957
- ds() {
12957
+ Es() {
12958
12958
  const e = {
12959
12959
  state: this.state,
12960
12960
  updateTimeMs: Date.now()
@@ -12976,7 +12976,7 @@ class __PRIVATE_QueryTargetMetadata {
12976
12976
  /**
12977
12977
  * Parses a RemoteClientState from the JSON representation in WebStorage.
12978
12978
  * Logs a warning and returns null if the format of the data is not valid.
12979
- */ static Es(e, t) {
12979
+ */ static ds(e, t) {
12980
12980
  const n = JSON.parse(t);
12981
12981
  let r = "object" == typeof n && n.activeTargetIds instanceof Array, i = __PRIVATE_targetIdSet();
12982
12982
  for (let e = 0; r && e < n.activeTargetIds.length; ++e) r = isSafeInteger(n.activeTargetIds[e]),
@@ -12997,7 +12997,7 @@ class __PRIVATE_QueryTargetMetadata {
12997
12997
  /**
12998
12998
  * Parses a SharedOnlineState from its JSON representation in WebStorage.
12999
12999
  * Logs a warning and returns null if the format of the data is not valid.
13000
- */ static Es(e) {
13000
+ */ static ds(e) {
13001
13001
  const t = JSON.parse(e);
13002
13002
  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}`),
13003
13003
  null);
@@ -13028,7 +13028,7 @@ class __PRIVATE_LocalClientState {
13028
13028
  /**
13029
13029
  * Converts this entry into a JSON-encoded format we can use for WebStorage.
13030
13030
  * Does not encode `clientId` as it is part of the key in WebStorage.
13031
- */ ds() {
13031
+ */ Es() {
13032
13032
  const e = {
13033
13033
  activeTargetIds: this.activeTargetIds.toArray(),
13034
13034
  updateTimeMs: Date.now()
@@ -13112,7 +13112,7 @@ class __PRIVATE_LocalClientState {
13112
13112
  if (t === this.Vs) continue;
13113
13113
  const e = this.getItem(createWebStorageClientStateKey(this.persistenceKey, t));
13114
13114
  if (e) {
13115
- const n = __PRIVATE_RemoteClientState.Es(t, e);
13115
+ const n = __PRIVATE_RemoteClientState.ds(t, e);
13116
13116
  n && (this.ps = this.ps.insert(n.clientId, n));
13117
13117
  }
13118
13118
  }
@@ -13159,7 +13159,7 @@ class __PRIVATE_LocalClientState {
13159
13159
  if (this.isActiveQueryTarget(e)) {
13160
13160
  const n = this.storage.getItem(createWebStorageQueryTargetMetadataKey(this.persistenceKey, e));
13161
13161
  if (n) {
13162
- const r = __PRIVATE_QueryTargetMetadata.Es(e, n);
13162
+ const r = __PRIVATE_QueryTargetMetadata.ds(e, n);
13163
13163
  r && (t = r.state);
13164
13164
  }
13165
13165
  }
@@ -13265,11 +13265,11 @@ class __PRIVATE_LocalClientState {
13265
13265
  return this.ps.get(this.Vs);
13266
13266
  }
13267
13267
  Ms() {
13268
- this.setItem(this.ws, this.ks.ds());
13268
+ this.setItem(this.ws, this.ks.Es());
13269
13269
  }
13270
13270
  Bs(e, t, n) {
13271
13271
  const r = new __PRIVATE_MutationMetadata(this.currentUser, e, t, n), i = createWebStorageMutationBatchKey(this.persistenceKey, this.currentUser, e);
13272
- this.setItem(i, r.ds());
13272
+ this.setItem(i, r.Es());
13273
13273
  }
13274
13274
  Ls(e) {
13275
13275
  const t = createWebStorageMutationBatchKey(this.persistenceKey, this.currentUser, e);
@@ -13284,7 +13284,7 @@ class __PRIVATE_LocalClientState {
13284
13284
  }
13285
13285
  qs(e, t, n) {
13286
13286
  const r = createWebStorageQueryTargetMetadataKey(this.persistenceKey, e), i = new __PRIVATE_QueryTargetMetadata(e, t, n);
13287
- this.setItem(r, i.ds());
13287
+ this.setItem(r, i.Es());
13288
13288
  }
13289
13289
  Ks(e) {
13290
13290
  const t = JSON.stringify(Array.from(e));
@@ -13302,27 +13302,27 @@ class __PRIVATE_LocalClientState {
13302
13302
  * be parsed.
13303
13303
  */ Ws(e, t) {
13304
13304
  const n = this.$s(e);
13305
- return __PRIVATE_RemoteClientState.Es(n, t);
13305
+ return __PRIVATE_RemoteClientState.ds(n, t);
13306
13306
  }
13307
13307
  /**
13308
13308
  * Parses a mutation batch state in WebStorage. Returns 'null' if the value
13309
13309
  * could not be parsed.
13310
13310
  */ Gs(e, t) {
13311
13311
  const n = this.Ds.exec(e), r = Number(n[1]), i = void 0 !== n[2] ? n[2] : null;
13312
- return __PRIVATE_MutationMetadata.Es(new User(i), r, t);
13312
+ return __PRIVATE_MutationMetadata.ds(new User(i), r, t);
13313
13313
  }
13314
13314
  /**
13315
13315
  * Parses a query target state from WebStorage. Returns 'null' if the value
13316
13316
  * could not be parsed.
13317
13317
  */ js(e, t) {
13318
13318
  const n = this.Cs.exec(e), r = Number(n[1]);
13319
- return __PRIVATE_QueryTargetMetadata.Es(r, t);
13319
+ return __PRIVATE_QueryTargetMetadata.ds(r, t);
13320
13320
  }
13321
13321
  /**
13322
13322
  * Parses an online state from WebStorage. Returns 'null' if the value
13323
13323
  * could not be parsed.
13324
13324
  */ xs(e) {
13325
- return __PRIVATE_SharedOnlineState.Es(e);
13325
+ return __PRIVATE_SharedOnlineState.ds(e);
13326
13326
  }
13327
13327
  Js(e) {
13328
13328
  return JSON.parse(e);
@@ -14380,13 +14380,13 @@ class __PRIVATE_PersistentStream {
14380
14380
  }
14381
14381
  // The first response is always the handshake response
14382
14382
  return __PRIVATE_hardAssert(!e.writeResults || 0 === e.writeResults.length), this.h_ = !0,
14383
- this.listener.E_();
14383
+ this.listener.d_();
14384
14384
  }
14385
14385
  /**
14386
14386
  * Sends an initial streamToken to the server, performing the handshake
14387
14387
  * required to make the StreamingWrite RPC work. Subsequent
14388
14388
  * calls should wait until onHandshakeComplete was called.
14389
- */ d_() {
14389
+ */ E_() {
14390
14390
  // TODO(dimond): Support stream resumption. We intentionally do not set the
14391
14391
  // stream token on the handshake, ignoring any stream token we might have.
14392
14392
  const e = {};
@@ -14909,7 +14909,7 @@ function __PRIVATE_startWriteStream(e) {
14909
14909
  }
14910
14910
 
14911
14911
  async function __PRIVATE_onWriteStreamOpen(e) {
14912
- __PRIVATE_ensureWriteStream(e).d_();
14912
+ __PRIVATE_ensureWriteStream(e).E_();
14913
14913
  }
14914
14914
 
14915
14915
  async function __PRIVATE_onWriteHandshakeComplete(e) {
@@ -15031,7 +15031,7 @@ async function __PRIVATE_remoteStoreHandleCredentialChange(e, t) {
15031
15031
  }(e.datastore, e.asyncQueue, {
15032
15032
  Po: __PRIVATE_onWriteStreamOpen.bind(null, e),
15033
15033
  To: __PRIVATE_onWriteStreamClose.bind(null, e),
15034
- E_: __PRIVATE_onWriteHandshakeComplete.bind(null, e),
15034
+ d_: __PRIVATE_onWriteHandshakeComplete.bind(null, e),
15035
15035
  T_: __PRIVATE_onMutationResult.bind(null, e)
15036
15036
  }), e.F_.push((async t => {
15037
15037
  t ? (e.B_.Zo(),
@@ -15805,19 +15805,19 @@ class __PRIVATE_RemovedLimboDocument {
15805
15805
  * See the License for the specific language governing permissions and
15806
15806
  * limitations under the License.
15807
15807
  */ (e.type, t.type) || this.ua(e.doc, t.doc))), this.Ta(n), r = null != r && r;
15808
- const o = t && !r ? this.Ea() : [], _ = 0 === this.aa.size && this.current && !r ? 1 /* SyncState.Synced */ : 0 /* SyncState.Local */ , a = _ !== this._a;
15808
+ const o = t && !r ? this.da() : [], _ = 0 === this.aa.size && this.current && !r ? 1 /* SyncState.Synced */ : 0 /* SyncState.Local */ , a = _ !== this._a;
15809
15809
  // We are at synced state if there is no limbo docs are waiting to be resolved, view is current
15810
15810
  // with the backend, and the query is not pending to reset due to existence filter mismatch.
15811
15811
  if (this._a = _, 0 !== s.length || a) {
15812
15812
  return {
15813
15813
  snapshot: new ViewSnapshot(this.query, e.ca, i, s, e.mutatedKeys, 0 /* SyncState.Local */ === _, a,
15814
15814
  /* excludesMetadataChanges= */ !1, !!n && n.resumeToken.approximateByteSize() > 0),
15815
- da: o
15815
+ Ea: o
15816
15816
  };
15817
15817
  }
15818
15818
  // no changes
15819
15819
  return {
15820
- da: o
15820
+ Ea: o
15821
15821
  };
15822
15822
  }
15823
15823
  /**
@@ -15836,7 +15836,7 @@ class __PRIVATE_RemovedLimboDocument {
15836
15836
  Xi: !1
15837
15837
  },
15838
15838
  /* limboResolutionEnabled= */ !1)) : {
15839
- da: []
15839
+ Ea: []
15840
15840
  };
15841
15841
  }
15842
15842
  /**
@@ -15854,7 +15854,7 @@ class __PRIVATE_RemovedLimboDocument {
15854
15854
  e && (e.addedDocuments.forEach((e => this.oa = this.oa.add(e))), e.modifiedDocuments.forEach((e => {})),
15855
15855
  e.removedDocuments.forEach((e => this.oa = this.oa.delete(e))), this.current = e.current);
15856
15856
  }
15857
- Ea() {
15857
+ da() {
15858
15858
  // We can only determine limbo documents when we're in-sync with the server.
15859
15859
  if (!this.current) return [];
15860
15860
  // TODO(klimt): Do this incrementally so that it's not quadratic when
@@ -16040,12 +16040,12 @@ async function __PRIVATE_syncEngineListen(e, t) {
16040
16040
  /* usePreviousResults= */ !1).then((({documents: e}) => t.view.ha(e, i))));
16041
16041
  const s = r && r.targetChanges.get(t.targetId), o = r && null != r.targetMismatches.get(t.targetId), _ = t.view.applyChanges(i,
16042
16042
  /* limboResolutionEnabled= */ e.isPrimaryClient, s, o);
16043
- return __PRIVATE_updateTrackedLimbos(e, t.targetId, _.da), _.snapshot;
16043
+ return __PRIVATE_updateTrackedLimbos(e, t.targetId, _.Ea), _.snapshot;
16044
16044
  }(e, t, n, r);
16045
16045
  const s = await __PRIVATE_localStoreExecuteQuery(e.localStore, t,
16046
16046
  /* usePreviousResults= */ !0), o = new __PRIVATE_View(t, s.hs), _ = o.ha(s.documents), a = TargetChange.createSynthesizedTargetChangeForCurrentChange(n, r && "Offline" /* OnlineState.Offline */ !== e.onlineState, i), u = o.applyChanges(_,
16047
16047
  /* limboResolutionEnabled= */ e.isPrimaryClient, a);
16048
- __PRIVATE_updateTrackedLimbos(e, n, u.da);
16048
+ __PRIVATE_updateTrackedLimbos(e, n, u.Ea);
16049
16049
  const c = new __PRIVATE_QueryView(t, n, o);
16050
16050
  return e.ga.set(t, c), e.pa.has(n) ? e.pa.get(n).push(t) : e.pa.set(n, [ t ]), u.snapshot;
16051
16051
  }
@@ -16447,7 +16447,7 @@ function __PRIVATE_syncEngineGetRemoteKeysForTarget(e, t) {
16447
16447
  */ async function __PRIVATE_synchronizeViewAndComputeSnapshot(e, t) {
16448
16448
  const n = __PRIVATE_debugCast(e), r = await __PRIVATE_localStoreExecuteQuery(n.localStore, t.query,
16449
16449
  /* usePreviousResults= */ !0), i = t.view.Ra(r);
16450
- return n.isPrimaryClient && __PRIVATE_updateTrackedLimbos(n, t.targetId, i.da),
16450
+ return n.isPrimaryClient && __PRIVATE_updateTrackedLimbos(n, t.targetId, i.Ea),
16451
16451
  i;
16452
16452
  }
16453
16453
 
@@ -19305,13 +19305,13 @@ function __PRIVATE_isWrite(e) {
19305
19305
  this.settings = e, this.databaseId = t, this.serializer = n, this.ignoreUndefinedProperties = r,
19306
19306
  // Minor hack: If fieldTransforms is undefined, we assume this is an
19307
19307
  // external call and we need to validate the entire path.
19308
- void 0 === i && this.Eu(), this.fieldTransforms = i || [], this.fieldMask = s || [];
19308
+ void 0 === i && this.du(), this.fieldTransforms = i || [], this.fieldMask = s || [];
19309
19309
  }
19310
19310
  get path() {
19311
19311
  return this.settings.path;
19312
19312
  }
19313
- get du() {
19314
- return this.settings.du;
19313
+ get Eu() {
19314
+ return this.settings.Eu;
19315
19315
  }
19316
19316
  /** Returns a new context with the specified settings overwritten. */ Au(e) {
19317
19317
  return new __PRIVATE_ParseContextImpl(Object.assign(Object.assign({}, this.settings), e), this.databaseId, this.serializer, this.ignoreUndefinedProperties, this.fieldTransforms, this.fieldMask);
@@ -19330,7 +19330,7 @@ function __PRIVATE_isWrite(e) {
19330
19330
  path: n,
19331
19331
  Vu: !1
19332
19332
  });
19333
- return r.Eu(), r;
19333
+ return r.du(), r;
19334
19334
  }
19335
19335
  gu(e) {
19336
19336
  // TODO(b/34871131): We don't support array paths right now; so make path
@@ -19346,14 +19346,14 @@ function __PRIVATE_isWrite(e) {
19346
19346
  /** Returns 'true' if 'fieldPath' was traversed when creating this context. */ contains(e) {
19347
19347
  return void 0 !== this.fieldMask.find((t => e.isPrefixOf(t))) || void 0 !== this.fieldTransforms.find((t => e.isPrefixOf(t.field)));
19348
19348
  }
19349
- Eu() {
19349
+ du() {
19350
19350
  // TODO(b/34871131): Remove null check once we have proper paths for fields
19351
19351
  // within arrays.
19352
19352
  if (this.path) for (let e = 0; e < this.path.length; e++) this.mu(this.path.get(e));
19353
19353
  }
19354
19354
  mu(e) {
19355
19355
  if (0 === e.length) throw this.pu("Document fields must not be empty");
19356
- if (__PRIVATE_isWrite(this.du) && ge.test(e)) throw this.pu('Document fields cannot begin and end with "__"');
19356
+ if (__PRIVATE_isWrite(this.Eu) && ge.test(e)) throw this.pu('Document fields cannot begin and end with "__"');
19357
19357
  }
19358
19358
  }
19359
19359
 
@@ -19366,7 +19366,7 @@ function __PRIVATE_isWrite(e) {
19366
19366
  }
19367
19367
  /** Creates a new top-level parse context. */ Su(e, t, n, r = !1) {
19368
19368
  return new __PRIVATE_ParseContextImpl({
19369
- du: e,
19369
+ Eu: e,
19370
19370
  methodName: t,
19371
19371
  wu: n,
19372
19372
  path: FieldPath$1.emptyPath(),
@@ -19400,7 +19400,7 @@ function __PRIVATE_newUserDataReader(e) {
19400
19400
 
19401
19401
  class __PRIVATE_DeleteFieldValueImpl extends FieldValue {
19402
19402
  _toFieldTransform(e) {
19403
- if (2 /* UserDataSource.MergeSet */ !== e.du) throw 1 /* UserDataSource.Update */ === e.du ? e.pu(`${this._methodName}() can only appear at the top level of your update data`) : e.pu(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);
19403
+ if (2 /* UserDataSource.MergeSet */ !== e.Eu) throw 1 /* UserDataSource.Update */ === e.Eu ? e.pu(`${this._methodName}() can only appear at the top level of your update data`) : e.pu(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);
19404
19404
  // No transform to add for a delete, but we need to add it to our
19405
19405
  // fieldMask so it gets deleted.
19406
19406
  return e.fieldMask.push(e.path), null;
@@ -19427,7 +19427,7 @@ class __PRIVATE_DeleteFieldValueImpl extends FieldValue {
19427
19427
  * @param arrayElement - Whether or not the FieldValue has an array.
19428
19428
  */ function __PRIVATE_createSentinelChildContext(e, t, n) {
19429
19429
  return new __PRIVATE_ParseContextImpl({
19430
- du: 3 /* UserDataSource.Argument */ ,
19430
+ Eu: 3 /* UserDataSource.Argument */ ,
19431
19431
  wu: t.settings.wu,
19432
19432
  methodName: e._methodName,
19433
19433
  Vu: n
@@ -19567,7 +19567,7 @@ class __PRIVATE_NumericIncrementFieldValueImpl extends FieldValue {
19567
19567
  */
19568
19568
  return function __PRIVATE_parseSentinelFieldValue(e, t) {
19569
19569
  // Sentinels are only supported with writes, and not within arrays.
19570
- if (!__PRIVATE_isWrite(t.du)) throw t.pu(`${e._methodName}() can only be used with update() and set()`);
19570
+ if (!__PRIVATE_isWrite(t.Eu)) throw t.pu(`${e._methodName}() can only be used with update() and set()`);
19571
19571
  if (!t.path) throw t.pu(`${e._methodName}() is not currently supported inside arrays`);
19572
19572
  const n = e._toFieldTransform(t);
19573
19573
  n && t.fieldTransforms.push(n);
@@ -19592,7 +19592,7 @@ class __PRIVATE_NumericIncrementFieldValueImpl extends FieldValue {
19592
19592
  // the set of values to be included for the IN query) that may directly
19593
19593
  // contain additional arrays (each representing an individual field
19594
19594
  // value), so we disable this validation.
19595
- if (t.settings.Vu && 4 /* UserDataSource.ArrayArgument */ !== t.du) throw t.pu("Nested arrays are not supported");
19595
+ if (t.settings.Vu && 4 /* UserDataSource.ArrayArgument */ !== t.Eu) throw t.pu("Nested arrays are not supported");
19596
19596
  return function __PRIVATE_parseArray(e, t) {
19597
19597
  const n = [];
19598
19598
  let r = 0;
@@ -21831,9 +21831,9 @@ let Se = null;
21831
21831
  return r = Object.assign({
21832
21832
  useFetchStreams: t
21833
21833
  }, r), s._setSettings(r), s;
21834
- }), "PUBLIC").setMultipleInstances(!0)), app.registerVersion(w, "4.4.2", e),
21834
+ }), "PUBLIC").setMultipleInstances(!0)), app.registerVersion(w, "4.4.3-canary.245dd26e1", e),
21835
21835
  // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation
21836
- app.registerVersion(w, "4.4.2", "cjs2017");
21836
+ app.registerVersion(w, "4.4.3-canary.245dd26e1", "cjs2017");
21837
21837
  }();
21838
21838
 
21839
21839
  exports.AbstractUserDataWriter = AbstractUserDataWriter;