@firebase/firestore 4.7.8 → 4.7.9

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.
Files changed (36) hide show
  1. package/dist/firestore/src/global_index.d.ts +9 -2
  2. package/dist/firestore/src/lite-api/database.d.ts +4 -0
  3. package/dist/firestore/src/lite-api/settings.d.ts +4 -0
  4. package/dist/firestore/src/lite-api/vector_value.d.ts +2 -2
  5. package/dist/firestore/test/integration/util/settings.d.ts +1 -0
  6. package/dist/index.cjs.js +108 -98
  7. package/dist/index.cjs.js.map +1 -1
  8. package/dist/index.d.ts +2 -2
  9. package/dist/index.esm2017.js +109 -99
  10. package/dist/index.esm2017.js.map +1 -1
  11. package/dist/index.node.cjs.js +17 -5
  12. package/dist/index.node.cjs.js.map +1 -1
  13. package/dist/index.node.mjs +18 -6
  14. package/dist/index.node.mjs.map +1 -1
  15. package/dist/index.rn.js +44 -34
  16. package/dist/index.rn.js.map +1 -1
  17. package/dist/internal.d.ts +9 -2
  18. package/dist/lite/firestore/src/lite-api/database.d.ts +4 -0
  19. package/dist/lite/firestore/src/lite-api/settings.d.ts +4 -0
  20. package/dist/lite/firestore/src/lite-api/vector_value.d.ts +2 -2
  21. package/dist/lite/firestore/test/integration/util/settings.d.ts +1 -0
  22. package/dist/lite/index.browser.esm2017.js +23 -13
  23. package/dist/lite/index.browser.esm2017.js.map +1 -1
  24. package/dist/lite/index.cjs.js +23 -13
  25. package/dist/lite/index.cjs.js.map +1 -1
  26. package/dist/lite/index.d.ts +2 -2
  27. package/dist/lite/index.node.cjs.js +17 -5
  28. package/dist/lite/index.node.cjs.js.map +1 -1
  29. package/dist/lite/index.node.mjs +18 -6
  30. package/dist/lite/index.node.mjs.map +1 -1
  31. package/dist/lite/index.rn.esm2017.js +43 -33
  32. package/dist/lite/index.rn.esm2017.js.map +1 -1
  33. package/dist/lite/internal.d.ts +9 -2
  34. package/dist/lite/private.d.ts +6 -2
  35. package/dist/private.d.ts +6 -2
  36. package/package.json +6 -6
package/dist/index.cjs.js CHANGED
@@ -9,7 +9,7 @@ var util = require('@firebase/util');
9
9
  var bloomBlob = require('@firebase/webchannel-wrapper/bloom-blob');
10
10
  var webchannelBlob = require('@firebase/webchannel-wrapper/webchannel-blob');
11
11
 
12
- const S = "@firebase/firestore", b = "4.7.8";
12
+ const b = "@firebase/firestore", S = "4.7.9";
13
13
 
14
14
  /**
15
15
  * @license
@@ -71,7 +71,7 @@ User.MOCK_USER = new User("mock-user");
71
71
  * See the License for the specific language governing permissions and
72
72
  * limitations under the License.
73
73
  */
74
- let D = "11.3.1";
74
+ let D = "11.4.0";
75
75
 
76
76
  /**
77
77
  * @license
@@ -2359,7 +2359,7 @@ function __PRIVATE_newDbDocumentMutationPrefixForPath(e, t) {
2359
2359
  * there is no useful information to store as the value. The raw (unencoded)
2360
2360
  * path cannot be stored because IndexedDb doesn't store prototype
2361
2361
  * information.
2362
- */ const Z = {}, X = "documentMutations", ee = "remoteDocumentsV14", te = [ "prefixPath", "collectionGroup", "readTime", "documentId" ], ne = "documentKeyIndex", re = [ "prefixPath", "collectionGroup", "documentId" ], ie = "collectionGroupIndex", se = [ "collectionGroup", "readTime", "prefixPath", "documentId" ], oe = "remoteDocumentGlobal", _e = "remoteDocumentGlobalKey", ae = "targets", ue = "queryTargetsIndex", ce = [ "canonicalId", "targetId" ], le = "targetDocuments", he = [ "targetId", "path" ], Pe = "documentTargetsIndex", Te = [ "path", "targetId" ], Ie = "targetGlobalKey", Ee = "targetGlobal", de = "collectionParents", Ae = [ "collectionId", "parent" ], Re = "clientMetadata", Ve = "clientId", me = "bundles", fe = "bundleId", ge = "namedQueries", pe = "name", ye = "indexConfiguration", we = "indexId", Se = "collectionGroupIndex", be = "collectionGroup", De = "indexState", ve = [ "indexId", "uid" ], Ce = "sequenceNumberIndex", Fe = [ "uid", "sequenceNumber" ], Me = "indexEntries", xe = [ "indexId", "uid", "arrayValue", "directionalValue", "orderedDocumentKey", "documentKey" ], Oe = "documentKeyIndex", Ne = [ "indexId", "uid", "orderedDocumentKey" ], Be = "documentOverlays", Le = [ "userId", "collectionPath", "documentId" ], ke = "collectionPathOverlayIndex", qe = [ "userId", "collectionPath", "largestBatchId" ], Qe = "collectionGroupOverlayIndex", $e = [ "userId", "collectionGroup", "largestBatchId" ], Ke = "globals", Ue = "name", We = [ ...[ ...[ ...[ ...[ G, j, X, K, ae, U, Ee, le ], Re ], oe ], de ], me, ge ], Ge = [ ...We, Be ], ze = [ G, j, X, ee, ae, U, Ee, le, Re, oe, de, me, ge, Be ], je = ze, He = [ ...je, ye, De, Me ], Je = He, Ye = [ ...He, Ke ];
2362
+ */ const Z = {}, X = "documentMutations", ee = "remoteDocumentsV14", te = [ "prefixPath", "collectionGroup", "readTime", "documentId" ], ne = "documentKeyIndex", re = [ "prefixPath", "collectionGroup", "documentId" ], ie = "collectionGroupIndex", se = [ "collectionGroup", "readTime", "prefixPath", "documentId" ], oe = "remoteDocumentGlobal", _e = "remoteDocumentGlobalKey", ae = "targets", ue = "queryTargetsIndex", ce = [ "canonicalId", "targetId" ], le = "targetDocuments", he = [ "targetId", "path" ], Pe = "documentTargetsIndex", Te = [ "path", "targetId" ], Ie = "targetGlobalKey", Ee = "targetGlobal", de = "collectionParents", Ae = [ "collectionId", "parent" ], Re = "clientMetadata", Ve = "clientId", me = "bundles", fe = "bundleId", ge = "namedQueries", pe = "name", ye = "indexConfiguration", we = "indexId", be = "collectionGroupIndex", Se = "collectionGroup", De = "indexState", ve = [ "indexId", "uid" ], Ce = "sequenceNumberIndex", Fe = [ "uid", "sequenceNumber" ], Me = "indexEntries", xe = [ "indexId", "uid", "arrayValue", "directionalValue", "orderedDocumentKey", "documentKey" ], Oe = "documentKeyIndex", Ne = [ "indexId", "uid", "orderedDocumentKey" ], Be = "documentOverlays", Le = [ "userId", "collectionPath", "documentId" ], ke = "collectionPathOverlayIndex", qe = [ "userId", "collectionPath", "largestBatchId" ], Qe = "collectionGroupOverlayIndex", $e = [ "userId", "collectionGroup", "largestBatchId" ], Ke = "globals", Ue = "name", We = [ ...[ ...[ ...[ ...[ G, j, X, K, ae, U, Ee, le ], Re ], oe ], de ], me, ge ], Ge = [ ...We, Be ], ze = [ G, j, X, ee, ae, U, Ee, le, Re, oe, de, me, ge, Be ], je = ze, He = [ ...je, ye, De, Me ], Je = He, Ye = [ ...He, Ke ];
2363
2363
 
2364
2364
  /**
2365
2365
  * @license
@@ -6187,13 +6187,13 @@ class __PRIVATE_WatchTargetChange {
6187
6187
  */
6188
6188
  this.ye = __PRIVATE_snapshotChangesMap(),
6189
6189
  /** See public getters for explanations of these fields. */
6190
- this.we = ByteString.EMPTY_BYTE_STRING, this.Se = !1,
6190
+ this.we = ByteString.EMPTY_BYTE_STRING, this.be = !1,
6191
6191
  /**
6192
6192
  * Whether this target state should be included in the next snapshot. We
6193
6193
  * initialize to true so that newly-added targets are included in the next
6194
6194
  * RemoteEvent.
6195
6195
  */
6196
- this.be = !0;
6196
+ this.Se = !0;
6197
6197
  }
6198
6198
  /**
6199
6199
  * Whether this target has been marked 'current'.
@@ -6203,7 +6203,7 @@ class __PRIVATE_WatchTargetChange {
6203
6203
  * was added and that the target is consistent with the rest of the watch
6204
6204
  * stream.
6205
6205
  */ get current() {
6206
- return this.Se;
6206
+ return this.be;
6207
6207
  }
6208
6208
  /** The last resume token sent to us for this target. */ get resumeToken() {
6209
6209
  return this.we;
@@ -6212,13 +6212,13 @@ class __PRIVATE_WatchTargetChange {
6212
6212
  return 0 !== this.pe;
6213
6213
  }
6214
6214
  /** Whether we have modified any state that should trigger a snapshot. */ get ve() {
6215
- return this.be;
6215
+ return this.Se;
6216
6216
  }
6217
6217
  /**
6218
6218
  * Applies the resume token to the TargetChange, but only when it has a new
6219
6219
  * value. Empty resumeTokens are discarded.
6220
6220
  */ Ce(e) {
6221
- e.approximateByteSize() > 0 && (this.be = !0, this.we = e);
6221
+ e.approximateByteSize() > 0 && (this.Se = !0, this.we = e);
6222
6222
  }
6223
6223
  /**
6224
6224
  * Creates a target change from the current set of changes.
@@ -6244,18 +6244,18 @@ class __PRIVATE_WatchTargetChange {
6244
6244
  default:
6245
6245
  fail();
6246
6246
  }
6247
- })), new TargetChange(this.we, this.Se, e, t, n);
6247
+ })), new TargetChange(this.we, this.be, e, t, n);
6248
6248
  }
6249
6249
  /**
6250
6250
  * Resets the document changes and sets `hasPendingChanges` to false.
6251
6251
  */ Me() {
6252
- this.be = !1, this.ye = __PRIVATE_snapshotChangesMap();
6252
+ this.Se = !1, this.ye = __PRIVATE_snapshotChangesMap();
6253
6253
  }
6254
6254
  xe(e, t) {
6255
- this.be = !0, this.ye = this.ye.insert(e, t);
6255
+ this.Se = !0, this.ye = this.ye.insert(e, t);
6256
6256
  }
6257
6257
  Oe(e) {
6258
- this.be = !0, this.ye = this.ye.remove(e);
6258
+ this.Se = !0, this.ye = this.ye.remove(e);
6259
6259
  }
6260
6260
  Ne() {
6261
6261
  this.pe += 1;
@@ -6264,7 +6264,7 @@ class __PRIVATE_WatchTargetChange {
6264
6264
  this.pe -= 1, __PRIVATE_hardAssert(this.pe >= 0);
6265
6265
  }
6266
6266
  Le() {
6267
- this.be = !0, this.Se = !0;
6267
+ this.Se = !0, this.be = !0;
6268
6268
  }
6269
6269
  }
6270
6270
 
@@ -7794,12 +7794,12 @@ class __PRIVATE_FirestoreIndexValueWriter {
7794
7794
  let n = e.timestampValue;
7795
7795
  this.ft(t, 20), "string" == typeof n && (n = __PRIVATE_normalizeTimestamp(n)), t.yt(`${n.seconds || ""}`),
7796
7796
  t.gt(n.nanos || 0);
7797
- } else if ("stringValue" in e) this.wt(e.stringValue, t), this.St(t); else if ("bytesValue" in e) this.ft(t, 30),
7798
- t.bt(__PRIVATE_normalizeByteString(e.bytesValue)), this.St(t); else if ("referenceValue" in e) this.Dt(e.referenceValue, t); else if ("geoPointValue" in e) {
7797
+ } else if ("stringValue" in e) this.wt(e.stringValue, t), this.bt(t); else if ("bytesValue" in e) this.ft(t, 30),
7798
+ t.St(__PRIVATE_normalizeByteString(e.bytesValue)), this.bt(t); else if ("referenceValue" in e) this.Dt(e.referenceValue, t); else if ("geoPointValue" in e) {
7799
7799
  const n = e.geoPointValue;
7800
7800
  this.ft(t, 45), t.gt(n.latitude || 0), t.gt(n.longitude || 0);
7801
7801
  } else "mapValue" in e ? __PRIVATE_isMaxValue(e) ? this.ft(t, Number.MAX_SAFE_INTEGER) : __PRIVATE_isVectorValue(e) ? this.vt(e.mapValue, t) : (this.Ct(e.mapValue, t),
7802
- this.St(t)) : "arrayValue" in e ? (this.Ft(e.arrayValue, t), this.St(t)) : fail();
7802
+ this.bt(t)) : "arrayValue" in e ? (this.Ft(e.arrayValue, t), this.bt(t)) : fail();
7803
7803
  }
7804
7804
  wt(e, t) {
7805
7805
  this.ft(t, 25), this.Mt(e, t);
@@ -7836,7 +7836,7 @@ class __PRIVATE_FirestoreIndexValueWriter {
7836
7836
  ft(e, t) {
7837
7837
  e.gt(t);
7838
7838
  }
7839
- St(e) {
7839
+ bt(e) {
7840
7840
  // While the SDK does not implement truncation, the truncation marker is
7841
7841
  // used to terminate all variable length values (which are strings, bytes,
7842
7842
  // references, arrays and maps).
@@ -8043,7 +8043,7 @@ class __PRIVATE_AscendingIndexByteEncoder {
8043
8043
  constructor(e) {
8044
8044
  this.Zt = e;
8045
8045
  }
8046
- bt(e) {
8046
+ St(e) {
8047
8047
  this.Zt.Ot(e);
8048
8048
  }
8049
8049
  yt(e) {
@@ -8061,7 +8061,7 @@ class __PRIVATE_DescendingIndexByteEncoder {
8061
8061
  constructor(e) {
8062
8062
  this.Zt = e;
8063
8063
  }
8064
- bt(e) {
8064
+ St(e) {
8065
8065
  this.Zt.Lt(e);
8066
8066
  }
8067
8067
  yt(e) {
@@ -8891,7 +8891,7 @@ class __PRIVATE_IndexedDbIndexManager {
8891
8891
  let i = 0;
8892
8892
  for (const s of __PRIVATE_fieldIndexGetDirectionalSegments(e)) {
8893
8893
  const e = n[i++];
8894
- for (const n of r) if (this.Sn(t, s.fieldPath) && isArray(e)) r = this.bn(r, s, e); else {
8894
+ for (const n of r) if (this.bn(t, s.fieldPath) && isArray(e)) r = this.Sn(r, s, e); else {
8895
8895
  const t = n.tn(s.kind);
8896
8896
  __PRIVATE_FirestoreIndexValueWriter.xt.At(e, t);
8897
8897
  }
@@ -8915,7 +8915,7 @@ class __PRIVATE_IndexedDbIndexManager {
8915
8915
  * The method appends each value to all existing encoders (e.g. filter("a",
8916
8916
  * "==", "a1").filter("b", "in", ["b1", "b2"]) becomes ["a1,b1", "a1,b2"]). A
8917
8917
  * list of new encoders is returned.
8918
- */ bn(e, t, n) {
8918
+ */ Sn(e, t, n) {
8919
8919
  const r = [ ...e ], i = [];
8920
8920
  for (const e of n.arrayValue.values || []) for (const n of r) {
8921
8921
  const r = new __PRIVATE_IndexByteEncoder;
@@ -8923,12 +8923,12 @@ class __PRIVATE_IndexedDbIndexManager {
8923
8923
  }
8924
8924
  return i;
8925
8925
  }
8926
- Sn(e, t) {
8926
+ bn(e, t) {
8927
8927
  return !!e.filters.find((e => e instanceof FieldFilter && e.field.isEqual(t) && ("in" /* Operator.IN */ === e.op || "not-in" /* Operator.NOT_IN */ === e.op)));
8928
8928
  }
8929
8929
  getFieldIndexes(e, t) {
8930
8930
  const n = __PRIVATE_indexConfigurationStore(e), r = __PRIVATE_indexStateStore(e);
8931
- return (t ? n.G(Se, IDBKeyRange.bound(t, t)) : n.G()).next((e => {
8931
+ return (t ? n.G(be, IDBKeyRange.bound(t, t)) : n.G()).next((e => {
8932
8932
  const t = [];
8933
8933
  return PersistencePromise.forEach(e, (e => r.get([ e.indexId, this.uid ]).next((n => {
8934
8934
  t.push(function __PRIVATE_fromDbIndexConfiguration(e, t) {
@@ -8946,7 +8946,7 @@ class __PRIVATE_IndexedDbIndexManager {
8946
8946
  }
8947
8947
  updateCollectionGroup(e, t, n) {
8948
8948
  const r = __PRIVATE_indexConfigurationStore(e), i = __PRIVATE_indexStateStore(e);
8949
- return this.vn(e).next((e => r.G(Se, IDBKeyRange.bound(t, t)).next((t => PersistencePromise.forEach(t, (t => i.put(__PRIVATE_toDbIndexState(t.indexId, this.uid, e, n))))))));
8949
+ return this.vn(e).next((e => r.G(be, IDBKeyRange.bound(t, t)).next((t => PersistencePromise.forEach(t, (t => i.put(__PRIVATE_toDbIndexState(t.indexId, this.uid, e, n))))))));
8950
8950
  }
8951
8951
  updateIndexEntries(e, t) {
8952
8952
  // Porting Note: `getFieldIndexes()` on Web does not cache index lookups as
@@ -9143,7 +9143,7 @@ function __PRIVATE_getMinOffsetFromFieldIndexes(e) {
9143
9143
  sequenceNumbersCollected: 0,
9144
9144
  targetsRemoved: 0,
9145
9145
  documentsRemoved: 0
9146
- }, St = 41943040;
9146
+ }, bt = 41943040;
9147
9147
 
9148
9148
  class LruParams {
9149
9149
  static withCacheSize(e) {
@@ -9228,7 +9228,7 @@ function removeMutationBatch(e, t, n) {
9228
9228
  * limitations under the License.
9229
9229
  */
9230
9230
  /** A mutation queue for a specific user, backed by IndexedDB. */ LruParams.DEFAULT_COLLECTION_PERCENTILE = 10,
9231
- LruParams.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT = 1e3, LruParams.DEFAULT = new LruParams(St, LruParams.DEFAULT_COLLECTION_PERCENTILE, LruParams.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT),
9231
+ LruParams.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT = 1e3, LruParams.DEFAULT = new LruParams(bt, LruParams.DEFAULT_COLLECTION_PERCENTILE, LruParams.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT),
9232
9232
  LruParams.DISABLED = new LruParams(-1, 0, 0);
9233
9233
 
9234
9234
  class __PRIVATE_IndexedDbMutationQueue {
@@ -9785,7 +9785,7 @@ class __PRIVATE_TargetIdGenerator {
9785
9785
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9786
9786
  * See the License for the specific language governing permissions and
9787
9787
  * limitations under the License.
9788
- */ const bt = "LruGarbageCollector", Dt = 1048576;
9788
+ */ const St = "LruGarbageCollector", Dt = 1048576;
9789
9789
 
9790
9790
  function __PRIVATE_bufferEntryComparator([e, t], [n, r]) {
9791
9791
  const i = __PRIVATE_primitiveComparator(e, n);
@@ -9838,12 +9838,12 @@ function __PRIVATE_bufferEntryComparator([e, t], [n, r]) {
9838
9838
  return null !== this.Xn;
9839
9839
  }
9840
9840
  er(e) {
9841
- __PRIVATE_logDebug(bt, `Garbage collection scheduled in ${e}ms`), this.Xn = this.asyncQueue.enqueueAfterDelay("lru_garbage_collection" /* TimerId.LruGarbageCollection */ , e, (async () => {
9841
+ __PRIVATE_logDebug(St, `Garbage collection scheduled in ${e}ms`), this.Xn = this.asyncQueue.enqueueAfterDelay("lru_garbage_collection" /* TimerId.LruGarbageCollection */ , e, (async () => {
9842
9842
  this.Xn = null;
9843
9843
  try {
9844
9844
  await this.localStore.collectGarbage(this.garbageCollector);
9845
9845
  } catch (e) {
9846
- __PRIVATE_isIndexedDbTransactionError(e) ? __PRIVATE_logDebug(bt, "Ignoring IndexedDB error during garbage collection: ", e) : await __PRIVATE_ignoreIfPrimaryLeaseLoss(e);
9846
+ __PRIVATE_isIndexedDbTransactionError(e) ? __PRIVATE_logDebug(St, "Ignoring IndexedDB error during garbage collection: ", e) : await __PRIVATE_ignoreIfPrimaryLeaseLoss(e);
9847
9847
  }
9848
9848
  await this.er(3e5);
9849
9849
  }));
@@ -10961,13 +10961,13 @@ class OverlayedDocument {
10961
10961
  */ removeReference(e, t) {
10962
10962
  this.wr(new __PRIVATE_DocReference(e, t));
10963
10963
  }
10964
- Sr(e, t) {
10964
+ br(e, t) {
10965
10965
  e.forEach((e => this.removeReference(e, t)));
10966
10966
  }
10967
10967
  /**
10968
10968
  * Clears all references with a given ID. Calls removeRef() for each key
10969
10969
  * removed.
10970
- */ br(e) {
10970
+ */ Sr(e) {
10971
10971
  const t = new DocumentKey(new ResourcePath([])), n = new __PRIVATE_DocReference(t, e), r = new __PRIVATE_DocReference(t, e + 1), i = [];
10972
10972
  return this.gr.forEachInRange([ n, r ], (e => {
10973
10973
  this.wr(e), i.push(e.key);
@@ -11365,7 +11365,7 @@ class __PRIVATE_MemoryRemoteDocumentChangeBuffer extends RemoteDocumentChangeBuf
11365
11365
  return this.zn(t), PersistencePromise.resolve();
11366
11366
  }
11367
11367
  removeTargetData(e, t) {
11368
- return this.Qr.delete(t.target), this.Kr.br(t.targetId), this.targetCount -= 1,
11368
+ return this.Qr.delete(t.target), this.Kr.Sr(t.targetId), this.targetCount -= 1,
11369
11369
  PersistencePromise.resolve();
11370
11370
  }
11371
11371
  removeTargets(e, t, n) {
@@ -11387,14 +11387,14 @@ class __PRIVATE_MemoryRemoteDocumentChangeBuffer extends RemoteDocumentChangeBuf
11387
11387
  return this.Kr.yr(t, n), PersistencePromise.resolve();
11388
11388
  }
11389
11389
  removeMatchingKeys(e, t, n) {
11390
- this.Kr.Sr(t, n);
11390
+ this.Kr.br(t, n);
11391
11391
  const r = this.persistence.referenceDelegate, i = [];
11392
11392
  return r && t.forEach((t => {
11393
11393
  i.push(r.markPotentiallyOrphaned(e, t));
11394
11394
  })), PersistencePromise.waitFor(i);
11395
11395
  }
11396
11396
  removeMatchingKeysForTargetId(e, t) {
11397
- return this.Kr.br(t), PersistencePromise.resolve();
11397
+ return this.Kr.Sr(t), PersistencePromise.resolve();
11398
11398
  }
11399
11399
  getMatchingKeysForTargetId(e, t) {
11400
11400
  const n = this.Kr.vr(t);
@@ -11529,7 +11529,7 @@ class __PRIVATE_MemoryEagerDelegate {
11529
11529
  return this.ii.add(t.toString()), PersistencePromise.resolve();
11530
11530
  }
11531
11531
  removeTarget(e, t) {
11532
- this.ti.br(t.targetId).forEach((e => this.ii.add(e.toString())));
11532
+ this.ti.Sr(t.targetId).forEach((e => this.ii.add(e.toString())));
11533
11533
  const n = this.persistence.getTargetCache();
11534
11534
  return n.getMatchingKeysForTargetId(e, t.targetId).next((e => {
11535
11535
  e.forEach((e => this.ii.add(e.toString())));
@@ -11773,7 +11773,7 @@ class __PRIVATE_MemoryLruDelegate {
11773
11773
  keyPath: we,
11774
11774
  autoIncrement: !0
11775
11775
  });
11776
- t.createIndex(Se, be, {
11776
+ t.createIndex(be, Se, {
11777
11777
  unique: !1
11778
11778
  });
11779
11779
  const n = e.createObjectStore(De, {
@@ -12040,7 +12040,7 @@ class __PRIVATE_IndexedDbPersistence {
12040
12040
  // Fail `start()` if `synchronizeTabs` is disabled and we cannot
12041
12041
  // obtain the primary lease.
12042
12042
  throw new FirestoreError(C.FAILED_PRECONDITION, Mt);
12043
- return this.Si(), this.bi(), this.Di(), this.runTransaction("getHighestListenSequenceNumber", "readonly", (e => this.Hr.getHighestSequenceNumber(e)));
12043
+ return this.bi(), this.Si(), this.Di(), this.runTransaction("getHighestListenSequenceNumber", "readonly", (e => this.Hr.getHighestSequenceNumber(e)));
12044
12044
  })).then((e => {
12045
12045
  this.Gr = new __PRIVATE_ListenSequence(e, this.Ii);
12046
12046
  })).then((() => {
@@ -12301,7 +12301,7 @@ class __PRIVATE_IndexedDbPersistence {
12301
12301
  return !(e < n - t) && (!(e > n) || (__PRIVATE_logError(`Detected an update time that is in the future: ${e} > ${n}`),
12302
12302
  !1));
12303
12303
  }
12304
- Si() {
12304
+ bi() {
12305
12305
  null !== this.document && "function" == typeof this.document.addEventListener && (this.Ri = () => {
12306
12306
  this.Ti.enqueueAndForget((() => (this.inForeground = "visible" === this.document.visibilityState,
12307
12307
  this.wi())));
@@ -12319,7 +12319,7 @@ class __PRIVATE_IndexedDbPersistence {
12319
12319
  * primary lease). LocalStorage is used for this rather than IndexedDb because
12320
12320
  * it is a synchronous API and so can be used reliably from an unload
12321
12321
  * handler.
12322
- */ bi() {
12322
+ */ Si() {
12323
12323
  var e;
12324
12324
  "function" == typeof (null === (e = this.window) || void 0 === e ? void 0 : e.addEventListener) && (this.Ai = () => {
12325
12325
  // Note: In theory, this should be scheduled on the AsyncQueue since it
@@ -13234,14 +13234,14 @@ class __PRIVATE_MutationMetadata {
13234
13234
  /**
13235
13235
  * Parses a MutationMetadata from its JSON representation in WebStorage.
13236
13236
  * Logs a warning and returns null if the format of the data is not valid.
13237
- */ static Ss(e, t, n) {
13237
+ */ static bs(e, t, n) {
13238
13238
  const r = JSON.parse(n);
13239
13239
  let i, s = "object" == typeof r && -1 !== [ "pending", "acknowledged", "rejected" ].indexOf(r.state) && (void 0 === r.error || "object" == typeof r.error);
13240
13240
  return s && r.error && (s = "string" == typeof r.error.message && "string" == typeof r.error.code,
13241
13241
  s && (i = new FirestoreError(r.error.code, r.error.message))), s ? new __PRIVATE_MutationMetadata(e, t, r.state, i) : (__PRIVATE_logError(qt, `Failed to parse mutation state for ID '${t}': ${n}`),
13242
13242
  null);
13243
13243
  }
13244
- bs() {
13244
+ Ss() {
13245
13245
  const e = {
13246
13246
  state: this.state,
13247
13247
  updateTimeMs: Date.now()
@@ -13265,14 +13265,14 @@ class __PRIVATE_QueryTargetMetadata {
13265
13265
  /**
13266
13266
  * Parses a QueryTargetMetadata from its JSON representation in WebStorage.
13267
13267
  * Logs a warning and returns null if the format of the data is not valid.
13268
- */ static Ss(e, t) {
13268
+ */ static bs(e, t) {
13269
13269
  const n = JSON.parse(t);
13270
13270
  let r, i = "object" == typeof n && -1 !== [ "not-current", "current", "rejected" ].indexOf(n.state) && (void 0 === n.error || "object" == typeof n.error);
13271
13271
  return i && n.error && (i = "string" == typeof n.error.message && "string" == typeof n.error.code,
13272
13272
  i && (r = new FirestoreError(n.error.code, n.error.message))), i ? new __PRIVATE_QueryTargetMetadata(e, n.state, r) : (__PRIVATE_logError(qt, `Failed to parse target state for ID '${e}': ${t}`),
13273
13273
  null);
13274
13274
  }
13275
- bs() {
13275
+ Ss() {
13276
13276
  const e = {
13277
13277
  state: this.state,
13278
13278
  updateTimeMs: Date.now()
@@ -13294,7 +13294,7 @@ class __PRIVATE_QueryTargetMetadata {
13294
13294
  /**
13295
13295
  * Parses a RemoteClientState from the JSON representation in WebStorage.
13296
13296
  * Logs a warning and returns null if the format of the data is not valid.
13297
- */ static Ss(e, t) {
13297
+ */ static bs(e, t) {
13298
13298
  const n = JSON.parse(t);
13299
13299
  let r = "object" == typeof n && n.activeTargetIds instanceof Array, i = __PRIVATE_targetIdSet();
13300
13300
  for (let e = 0; r && e < n.activeTargetIds.length; ++e) r = isSafeInteger(n.activeTargetIds[e]),
@@ -13315,7 +13315,7 @@ class __PRIVATE_QueryTargetMetadata {
13315
13315
  /**
13316
13316
  * Parses a SharedOnlineState from its JSON representation in WebStorage.
13317
13317
  * Logs a warning and returns null if the format of the data is not valid.
13318
- */ static Ss(e) {
13318
+ */ static bs(e) {
13319
13319
  const t = JSON.parse(e);
13320
13320
  return "object" == typeof t && -1 !== [ "Unknown", "Online", "Offline" ].indexOf(t.onlineState) && "string" == typeof t.clientId ? new __PRIVATE_SharedOnlineState(t.clientId, t.onlineState) : (__PRIVATE_logError(qt, `Failed to parse online state: ${e}`),
13321
13321
  null);
@@ -13346,7 +13346,7 @@ class __PRIVATE_LocalClientState {
13346
13346
  /**
13347
13347
  * Converts this entry into a JSON-encoded format we can use for WebStorage.
13348
13348
  * Does not encode `clientId` as it is part of the key in WebStorage.
13349
- */ bs() {
13349
+ */ Ss() {
13350
13350
  const e = {
13351
13351
  activeTargetIds: this.activeTargetIds.toArray(),
13352
13352
  updateTimeMs: Date.now()
@@ -13414,7 +13414,7 @@ class __PRIVATE_LocalClientState {
13414
13414
  if (t === this.Cs) continue;
13415
13415
  const e = this.getItem(createWebStorageClientStateKey(this.persistenceKey, t));
13416
13416
  if (e) {
13417
- const n = __PRIVATE_RemoteClientState.Ss(t, e);
13417
+ const n = __PRIVATE_RemoteClientState.bs(t, e);
13418
13418
  n && (this.xs = this.xs.insert(n.clientId, n));
13419
13419
  }
13420
13420
  }
@@ -13461,7 +13461,7 @@ class __PRIVATE_LocalClientState {
13461
13461
  if (this.isActiveQueryTarget(e)) {
13462
13462
  const t = this.storage.getItem(createWebStorageQueryTargetMetadataKey(this.persistenceKey, e));
13463
13463
  if (t) {
13464
- const r = __PRIVATE_QueryTargetMetadata.Ss(e, t);
13464
+ const r = __PRIVATE_QueryTargetMetadata.bs(e, t);
13465
13465
  r && (n = r.state);
13466
13466
  }
13467
13467
  }
@@ -13569,11 +13569,11 @@ class __PRIVATE_LocalClientState {
13569
13569
  return this.xs.get(this.Cs);
13570
13570
  }
13571
13571
  Ks() {
13572
- this.setItem(this.Ns, this.Hs.bs());
13572
+ this.setItem(this.Ns, this.Hs.Ss());
13573
13573
  }
13574
13574
  zs(e, t, n) {
13575
13575
  const r = new __PRIVATE_MutationMetadata(this.currentUser, e, t, n), i = createWebStorageMutationBatchKey(this.persistenceKey, this.currentUser, e);
13576
- this.setItem(i, r.bs());
13576
+ this.setItem(i, r.Ss());
13577
13577
  }
13578
13578
  js(e) {
13579
13579
  const t = createWebStorageMutationBatchKey(this.persistenceKey, this.currentUser, e);
@@ -13588,7 +13588,7 @@ class __PRIVATE_LocalClientState {
13588
13588
  }
13589
13589
  Js(e, t, n) {
13590
13590
  const r = createWebStorageQueryTargetMetadataKey(this.persistenceKey, e), i = new __PRIVATE_QueryTargetMetadata(e, t, n);
13591
- this.setItem(r, i.bs());
13591
+ this.setItem(r, i.Ss());
13592
13592
  }
13593
13593
  Zs(e) {
13594
13594
  const t = JSON.stringify(Array.from(e));
@@ -13606,27 +13606,27 @@ class __PRIVATE_LocalClientState {
13606
13606
  * be parsed.
13607
13607
  */ no(e, t) {
13608
13608
  const n = this.Xs(e);
13609
- return __PRIVATE_RemoteClientState.Ss(n, t);
13609
+ return __PRIVATE_RemoteClientState.bs(n, t);
13610
13610
  }
13611
13611
  /**
13612
13612
  * Parses a mutation batch state in WebStorage. Returns 'null' if the value
13613
13613
  * could not be parsed.
13614
13614
  */ ro(e, t) {
13615
13615
  const n = this.ks.exec(e), r = Number(n[1]), i = void 0 !== n[2] ? n[2] : null;
13616
- return __PRIVATE_MutationMetadata.Ss(new User(i), r, t);
13616
+ return __PRIVATE_MutationMetadata.bs(new User(i), r, t);
13617
13617
  }
13618
13618
  /**
13619
13619
  * Parses a query target state from WebStorage. Returns 'null' if the value
13620
13620
  * could not be parsed.
13621
13621
  */ so(e, t) {
13622
13622
  const n = this.qs.exec(e), r = Number(n[1]);
13623
- return __PRIVATE_QueryTargetMetadata.Ss(r, t);
13623
+ return __PRIVATE_QueryTargetMetadata.bs(r, t);
13624
13624
  }
13625
13625
  /**
13626
13626
  * Parses an online state from WebStorage. Returns 'null' if the value
13627
13627
  * could not be parsed.
13628
13628
  */ Us(e) {
13629
- return __PRIVATE_SharedOnlineState.Ss(e);
13629
+ return __PRIVATE_SharedOnlineState.bs(e);
13630
13630
  }
13631
13631
  _o(e) {
13632
13632
  return JSON.parse(e);
@@ -13877,8 +13877,8 @@ class __PRIVATE_RestConnection {
13877
13877
  const t = e.ssl ? "https" : "http", n = encodeURIComponent(this.databaseId.projectId), r = encodeURIComponent(this.databaseId.database);
13878
13878
  this.po = t + "://" + e.host, this.yo = `projects/${n}/databases/${r}`, this.wo = this.databaseId.database === rt ? `project_id=${n}` : `project_id=${n}&database_id=${r}`;
13879
13879
  }
13880
- So(e, t, n, r, i) {
13881
- const s = __PRIVATE_generateUniqueDebugId(), o = this.bo(e, t.toUriEncodedString());
13880
+ bo(e, t, n, r, i) {
13881
+ const s = __PRIVATE_generateUniqueDebugId(), o = this.So(e, t.toUriEncodedString());
13882
13882
  __PRIVATE_logDebug(Kt, `Sending RPC '${e}' ${s}:`, o, n);
13883
13883
  const _ = {
13884
13884
  "google-cloud-resource-prefix": this.yo,
@@ -13893,7 +13893,7 @@ class __PRIVATE_RestConnection {
13893
13893
  Co(e, t, n, r, i, s) {
13894
13894
  // The REST API automatically aggregates all of the streamed results, so we
13895
13895
  // can just use the normal invoke() method.
13896
- return this.So(e, t, n, r, i);
13896
+ return this.bo(e, t, n, r, i);
13897
13897
  }
13898
13898
  /**
13899
13899
  * Modifies the headers for a request, adding any authorization token if
@@ -13912,7 +13912,7 @@ class __PRIVATE_RestConnection {
13912
13912
  e["Content-Type"] = "text/plain", this.databaseInfo.appId && (e["X-Firebase-GMPID"] = this.databaseInfo.appId),
13913
13913
  t && t.headers.forEach(((t, n) => e[n] = t)), n && n.headers.forEach(((t, n) => e[n] = t));
13914
13914
  }
13915
- bo(e, t) {
13915
+ So(e, t) {
13916
13916
  const n = Ut[e];
13917
13917
  return `${this.po}/v1/${t}:${n}`;
13918
13918
  }
@@ -14674,7 +14674,7 @@ class __PRIVATE_PersistentStream {
14674
14674
  /**
14675
14675
  * Tracks whether or not a handshake has been successfully exchanged and
14676
14676
  * the stream is ready to accept mutations.
14677
- */ get S_() {
14677
+ */ get b_() {
14678
14678
  return this.__ > 0;
14679
14679
  }
14680
14680
  // Override of PersistentStream.start
@@ -14682,7 +14682,7 @@ class __PRIVATE_PersistentStream {
14682
14682
  this.lastStreamToken = void 0, super.start();
14683
14683
  }
14684
14684
  A_() {
14685
- this.S_ && this.b_([]);
14685
+ this.b_ && this.S_([]);
14686
14686
  }
14687
14687
  f_(e, t) {
14688
14688
  return this.connection.Wo("Write", e, t);
@@ -14713,7 +14713,7 @@ class __PRIVATE_PersistentStream {
14713
14713
  const e = {};
14714
14714
  e.database = __PRIVATE_getEncodedDatabaseId(this.serializer), this.I_(e);
14715
14715
  }
14716
- /** Sends a group of mutations to the Firestore backend to apply. */ b_(e) {
14716
+ /** Sends a group of mutations to the Firestore backend to apply. */ S_(e) {
14717
14717
  const t = {
14718
14718
  streamToken: this.lastStreamToken,
14719
14719
  writes: e.map((e => toMutation(this.serializer, e)))
@@ -14755,8 +14755,8 @@ class __PRIVATE_PersistentStream {
14755
14755
  M_() {
14756
14756
  if (this.F_) throw new FirestoreError(C.FAILED_PRECONDITION, "The client has already been terminated.");
14757
14757
  }
14758
- /** Invokes the provided RPC with auth and AppCheck tokens. */ So(e, t, n, r) {
14759
- return this.M_(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([i, s]) => this.connection.So(e, __PRIVATE_toResourcePath(t, n), r, i, s))).catch((e => {
14758
+ /** Invokes the provided RPC with auth and AppCheck tokens. */ bo(e, t, n, r) {
14759
+ return this.M_(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([i, s]) => this.connection.bo(e, __PRIVATE_toResourcePath(t, n), r, i, s))).catch((e => {
14760
14760
  throw "FirebaseError" === e.name ? (e.code === C.UNAUTHENTICATED && (this.authCredentials.invalidateToken(),
14761
14761
  this.appCheckCredentials.invalidateToken()), e) : new FirestoreError(C.UNKNOWN, e.toString());
14762
14762
  }));
@@ -15171,7 +15171,7 @@ async function __PRIVATE_fillWritePipeline(e) {
15171
15171
  */ function __PRIVATE_addToWritePipeline(e, t) {
15172
15172
  e.K_.push(t);
15173
15173
  const n = __PRIVATE_ensureWriteStream(e);
15174
- n.c_() && n.S_ && n.b_(t.mutations);
15174
+ n.c_() && n.b_ && n.S_(t.mutations);
15175
15175
  }
15176
15176
 
15177
15177
  function __PRIVATE_shouldStartWriteStream(e) {
@@ -15189,7 +15189,7 @@ async function __PRIVATE_onWriteStreamOpen(e) {
15189
15189
  async function __PRIVATE_onWriteHandshakeComplete(e) {
15190
15190
  const t = __PRIVATE_ensureWriteStream(e);
15191
15191
  // Send the write pipeline now that the stream is established.
15192
- for (const n of e.K_) t.b_(n.mutations);
15192
+ for (const n of e.K_) t.S_(n.mutations);
15193
15193
  }
15194
15194
 
15195
15195
  async function __PRIVATE_onMutationResult(e, t, n) {
@@ -15203,7 +15203,7 @@ async function __PRIVATE_onMutationResult(e, t, n) {
15203
15203
  async function __PRIVATE_onWriteStreamClose(e, t) {
15204
15204
  // If the write stream closed after the write handshake completes, a write
15205
15205
  // operation failed and we fail the pending operation.
15206
- t && __PRIVATE_ensureWriteStream(e).S_ &&
15206
+ t && __PRIVATE_ensureWriteStream(e).b_ &&
15207
15207
  // This error affects the actual write.
15208
15208
  await async function __PRIVATE_handleWriteError(e, t) {
15209
15209
  // Only handle permanent errors here. If it's transient, just let the retry
@@ -16010,7 +16010,7 @@ class __PRIVATE_RemovedLimboDocument {
16010
16010
  /**
16011
16011
  * The set of remote documents that the server has told us belongs to the target associated with
16012
16012
  * this view.
16013
- */ get Sa() {
16013
+ */ get ba() {
16014
16014
  return this.fa;
16015
16015
  }
16016
16016
  /**
@@ -16022,7 +16022,7 @@ class __PRIVATE_RemovedLimboDocument {
16022
16022
  * @param previousChanges - If this is being called with a refill, then start
16023
16023
  * with this set of docs and changes instead of the current view.
16024
16024
  * @returns a new set of docs, changes, and refill flag.
16025
- */ ba(e, t) {
16025
+ */ Sa(e, t) {
16026
16026
  const n = t ? t.Da : new __PRIVATE_DocumentChangeSet, r = t ? t.wa : this.wa;
16027
16027
  let i = t ? t.mutatedKeys : this.mutatedKeys, s = r, o = !1;
16028
16028
  // Track the last doc in a (full) limit. This is necessary, because some
@@ -16235,7 +16235,7 @@ class __PRIVATE_RemovedLimboDocument {
16235
16235
  // PORTING NOTE: Multi-tab only.
16236
16236
  Oa(e) {
16237
16237
  this.fa = e.gs, this.pa = __PRIVATE_documentKeySet();
16238
- const t = this.ba(e.documents);
16238
+ const t = this.Sa(e.documents);
16239
16239
  return this.applyChanges(t, /* limboResolutionEnabled= */ !0);
16240
16240
  }
16241
16241
  /**
@@ -16384,19 +16384,19 @@ async function __PRIVATE_allocateTargetAndMaybeListen(e, t, n, r) {
16384
16384
  // targets based on view changes. This allows us to only depend on Limbo
16385
16385
  // changes when user code includes queries.
16386
16386
  e.Ha = (t, n, r) => async function __PRIVATE_applyDocChanges(e, t, n, r) {
16387
- let i = t.view.ba(n);
16387
+ let i = t.view.Sa(n);
16388
16388
  i.ls && (
16389
16389
  // The query has a limit and some docs were removed, so we need
16390
16390
  // to re-run the query against the local store to make sure we
16391
16391
  // didn't lose any good docs that had been past the limit.
16392
16392
  i = await __PRIVATE_localStoreExecuteQuery(e.localStore, t.query,
16393
- /* usePreviousResults= */ !1).then((({documents: e}) => t.view.ba(e, i))));
16393
+ /* usePreviousResults= */ !1).then((({documents: e}) => t.view.Sa(e, i))));
16394
16394
  const s = r && r.targetChanges.get(t.targetId), o = r && null != r.targetMismatches.get(t.targetId), _ = t.view.applyChanges(i,
16395
16395
  /* limboResolutionEnabled= */ e.isPrimaryClient, s, o);
16396
16396
  return __PRIVATE_updateTrackedLimbos(e, t.targetId, _.Ma), _.snapshot;
16397
16397
  }(e, t, n, r);
16398
16398
  const s = await __PRIVATE_localStoreExecuteQuery(e.localStore, t,
16399
- /* usePreviousResults= */ !0), o = new __PRIVATE_View(t, s.gs), _ = o.ba(s.documents), a = TargetChange.createSynthesizedTargetChangeForCurrentChange(n, r && "Offline" /* OnlineState.Offline */ !== e.onlineState, i), u = o.applyChanges(_,
16399
+ /* usePreviousResults= */ !0), o = new __PRIVATE_View(t, s.gs), _ = o.Sa(s.documents), a = TargetChange.createSynthesizedTargetChangeForCurrentChange(n, r && "Offline" /* OnlineState.Offline */ !== e.onlineState, i), u = o.applyChanges(_,
16400
16400
  /* limboResolutionEnabled= */ e.isPrimaryClient, a);
16401
16401
  __PRIVATE_updateTrackedLimbos(e, n, u.Ma);
16402
16402
  const c = new __PRIVATE_QueryView(t, n, o);
@@ -16681,7 +16681,7 @@ function __PRIVATE_removeAndCleanupTarget(e, t, n = null) {
16681
16681
  e.sharedClientState.removeLocalQueryTarget(t);
16682
16682
  for (const r of e.qa.get(t)) e.ka.delete(r), n && e.La.Ja(r, n);
16683
16683
  if (e.qa.delete(t), e.isPrimaryClient) {
16684
- e.Ua.br(t).forEach((t => {
16684
+ e.Ua.Sr(t).forEach((t => {
16685
16685
  e.Ua.containsKey(t) ||
16686
16686
  // We removed the last reference for this key
16687
16687
  __PRIVATE_removeLimboTarget(e, t);
@@ -16802,7 +16802,7 @@ function __PRIVATE_syncEngineGetRemoteKeysForTarget(e, t) {
16802
16802
  if (!r) return e;
16803
16803
  for (const t of r) {
16804
16804
  const r = n.ka.get(t);
16805
- e = e.unionWith(r.view.Sa);
16805
+ e = e.unionWith(r.view.ba);
16806
16806
  }
16807
16807
  return e;
16808
16808
  }
@@ -17588,7 +17588,7 @@ class Transaction$2 {
17588
17588
  const n = __PRIVATE_debugCast(e), r = {
17589
17589
  writes: t.map((e => toMutation(n.serializer, e)))
17590
17590
  };
17591
- await n.So("Commit", n.serializer.databaseId, ResourcePath.emptyPath(), r);
17591
+ await n.bo("Commit", n.serializer.databaseId, ResourcePath.emptyPath(), r);
17592
17592
  }(this.datastore, this.mutations), this.committed = !0;
17593
17593
  }
17594
17594
  recordVersion(e) {
@@ -17950,7 +17950,7 @@ function __PRIVATE_firestoreClientGetDocumentsFromLocalCache(e, t) {
17950
17950
  return e.asyncQueue.enqueueAndForget((async () => async function __PRIVATE_executeQueryFromCache(e, t, n) {
17951
17951
  try {
17952
17952
  const r = await __PRIVATE_localStoreExecuteQuery(e, t,
17953
- /* usePreviousResults= */ !0), i = new __PRIVATE_View(t, r.gs), s = i.ba(r.documents), o = i.applyChanges(s,
17953
+ /* usePreviousResults= */ !0), i = new __PRIVATE_View(t, r.gs), s = i.Sa(r.documents), o = i.applyChanges(s,
17954
17954
  /* limboResolutionEnabled= */ !1);
17955
17955
  n.resolve(o.snapshot);
17956
17956
  } catch (e) {
@@ -18323,7 +18323,7 @@ class FirestoreSettingsImpl {
18323
18323
  this.host = Xt, this.ssl = en;
18324
18324
  } else this.host = e.host, this.ssl = null !== (t = e.ssl) && void 0 !== t ? t : en;
18325
18325
  if (this.credentials = e.credentials, this.ignoreUndefinedProperties = !!e.ignoreUndefinedProperties,
18326
- this.localCache = e.localCache, void 0 === e.cacheSizeBytes) this.cacheSizeBytes = St; else {
18326
+ this.localCache = e.localCache, void 0 === e.cacheSizeBytes) this.cacheSizeBytes = bt; else {
18327
18327
  if (-1 !== e.cacheSizeBytes && e.cacheSizeBytes < Dt) throw new FirestoreError(C.INVALID_ARGUMENT, "cacheSizeBytes must be at least 1048576");
18328
18328
  this.cacheSizeBytes = e.cacheSizeBytes;
18329
18329
  }
@@ -18379,7 +18379,7 @@ class Firestore$1 {
18379
18379
  * Whether it's a Firestore or Firestore Lite instance.
18380
18380
  */
18381
18381
  this.type = "firestore-lite", this._persistenceKey = "(lite)", this._settings = new FirestoreSettingsImpl({}),
18382
- this._settingsFrozen = !1,
18382
+ this._settingsFrozen = !1, this._emulatorOptions = {},
18383
18383
  // A task that is assigned when the terminate() is invoked and resolved when
18384
18384
  // all components have shut down. Otherwise, Firestore is not terminated,
18385
18385
  // which can mean either the FirestoreClient is in the process of starting,
@@ -18401,7 +18401,8 @@ class Firestore$1 {
18401
18401
  }
18402
18402
  _setSettings(e) {
18403
18403
  if (this._settingsFrozen) throw new FirestoreError(C.FAILED_PRECONDITION, "Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");
18404
- this._settings = new FirestoreSettingsImpl(e), void 0 !== e.credentials && (this._authCredentials = function __PRIVATE_makeAuthCredentialsProvider(e) {
18404
+ this._settings = new FirestoreSettingsImpl(e), this._emulatorOptions = e.emulatorOptions || {},
18405
+ void 0 !== e.credentials && (this._authCredentials = function __PRIVATE_makeAuthCredentialsProvider(e) {
18405
18406
  if (!e) return new __PRIVATE_EmptyAuthCredentialsProvider;
18406
18407
  switch (e.type) {
18407
18408
  case "firstParty":
@@ -18418,6 +18419,9 @@ class Firestore$1 {
18418
18419
  _getSettings() {
18419
18420
  return this._settings;
18420
18421
  }
18422
+ _getEmulatorOptions() {
18423
+ return this._emulatorOptions;
18424
+ }
18421
18425
  _freezeSettings() {
18422
18426
  return this._settingsFrozen = !0, this._settings;
18423
18427
  }
@@ -18473,12 +18477,18 @@ class Firestore$1 {
18473
18477
  * Security Rules.
18474
18478
  */ function connectFirestoreEmulator(e, t, n, r = {}) {
18475
18479
  var i;
18476
- const s = (e = __PRIVATE_cast(e, Firestore$1))._getSettings(), o = `${t}:${n}`;
18477
- if (s.host !== Xt && s.host !== o && __PRIVATE_logWarn("Host has been set in both settings() and connectFirestoreEmulator(), emulator host will be used."),
18478
- e._setSettings(Object.assign(Object.assign({}, s), {
18479
- host: o,
18480
- ssl: !1
18481
- })), r.mockUserToken) {
18480
+ const s = (e = __PRIVATE_cast(e, Firestore$1))._getSettings(), o = Object.assign(Object.assign({}, s), {
18481
+ emulatorOptions: e._getEmulatorOptions()
18482
+ }), _ = `${t}:${n}`;
18483
+ s.host !== Xt && s.host !== _ && __PRIVATE_logWarn("Host has been set in both settings() and connectFirestoreEmulator(), emulator host will be used.");
18484
+ const a = Object.assign(Object.assign({}, s), {
18485
+ host: _,
18486
+ ssl: !1,
18487
+ emulatorOptions: r
18488
+ });
18489
+ // No-op if the new configuration matches the current configuration. This supports SSR
18490
+ // enviornments which might call `connectFirestoreEmulator` multiple times as a standard practice.
18491
+ if (!util.deepEqual(a, o) && (e._setSettings(a), r.mockUserToken)) {
18482
18492
  let t, n;
18483
18493
  if ("string" == typeof r.mockUserToken) t = r.mockUserToken, n = User.MOCK_USER; else {
18484
18494
  // Let createMockUserToken validate first (catches common mistakes like
@@ -18715,13 +18725,13 @@ class __PRIVATE_AsyncQueueImpl {
18715
18725
  // Visibility handler that triggers an immediate retry of all retryable
18716
18726
  // operations. Meant to speed up recovery when we regain file system access
18717
18727
  // after page comes into foreground.
18718
- this.Su = () => {
18728
+ this.bu = () => {
18719
18729
  const e = getDocument();
18720
18730
  e && __PRIVATE_logDebug(tn, "Visibility state changed to " + e.visibilityState),
18721
18731
  this.a_.t_();
18722
- }, this.bu = e;
18732
+ }, this.Su = e;
18723
18733
  const t = getDocument();
18724
- t && "function" == typeof t.addEventListener && t.addEventListener("visibilitychange", this.Su);
18734
+ t && "function" == typeof t.addEventListener && t.addEventListener("visibilitychange", this.bu);
18725
18735
  }
18726
18736
  get isShuttingDown() {
18727
18737
  return this.mu;
@@ -18742,7 +18752,7 @@ class __PRIVATE_AsyncQueueImpl {
18742
18752
  if (!this.mu) {
18743
18753
  this.mu = !0, this.yu = e || !1;
18744
18754
  const t = getDocument();
18745
- t && "function" == typeof t.removeEventListener && t.removeEventListener("visibilitychange", this.Su);
18755
+ t && "function" == typeof t.removeEventListener && t.removeEventListener("visibilitychange", this.bu);
18746
18756
  }
18747
18757
  }
18748
18758
  enqueue(e) {
@@ -18786,7 +18796,7 @@ class __PRIVATE_AsyncQueueImpl {
18786
18796
  }
18787
18797
  }
18788
18798
  vu(e) {
18789
- const t = this.bu.then((() => (this.pu = !0, e().catch((e => {
18799
+ const t = this.Su.then((() => (this.pu = !0, e().catch((e => {
18790
18800
  this.gu = e, this.pu = !1;
18791
18801
  const t =
18792
18802
  /**
@@ -18820,7 +18830,7 @@ class __PRIVATE_AsyncQueueImpl {
18820
18830
  // and return the rejected Promise.
18821
18831
  throw __PRIVATE_logError("INTERNAL UNHANDLED ERROR: ", t), e;
18822
18832
  })).then((e => (this.pu = !1, e))))));
18823
- return this.bu = t, t;
18833
+ return this.Su = t, t;
18824
18834
  }
18825
18835
  enqueueAfterDelay(e, t, n) {
18826
18836
  this.Du(),
@@ -18843,8 +18853,8 @@ class __PRIVATE_AsyncQueueImpl {
18843
18853
  // operations were executed.
18844
18854
  let e;
18845
18855
  do {
18846
- e = this.bu, await e;
18847
- } while (e !== this.bu);
18856
+ e = this.Su, await e;
18857
+ } while (e !== this.Su);
18848
18858
  }
18849
18859
  /**
18850
18860
  * For Tests: Determine if a delayed operation with a particular TimerId
@@ -19622,7 +19632,7 @@ class AggregateField {
19622
19632
  */
19623
19633
  /**
19624
19634
  * Represents a vector type in Firestore documents.
19625
- * Create an instance with {@link FieldValue.vector}.
19635
+ * Create an instance with <code>{@link vector}</code>.
19626
19636
  *
19627
19637
  * @class VectorValue
19628
19638
  */ class VectorValue {
@@ -19640,7 +19650,7 @@ class AggregateField {
19640
19650
  return this._values.map((e => e));
19641
19651
  }
19642
19652
  /**
19643
- * Returns `true` if the two VectorValue has the same raw number arrays, returns `false` otherwise.
19653
+ * Returns `true` if the two `VectorValue` values have the same raw number arrays, returns `false` otherwise.
19644
19654
  */ isEqual(e) {
19645
19655
  return function __PRIVATE_isPrimitiveArrayEqual(e, t) {
19646
19656
  if (e.length !== t.length) return !1;
@@ -22343,9 +22353,9 @@ let an = null;
22343
22353
  return r = Object.assign({
22344
22354
  useFetchStreams: t
22345
22355
  }, r), s._setSettings(r), s;
22346
- }), "PUBLIC").setMultipleInstances(!0)), app.registerVersion(S, b, e),
22356
+ }), "PUBLIC").setMultipleInstances(!0)), app.registerVersion(b, S, e),
22347
22357
  // BUILD_TARGET will be replaced by values like esm2017, cjs2017, etc during the compilation
22348
- app.registerVersion(S, b, "cjs2017");
22358
+ app.registerVersion(b, S, "cjs2017");
22349
22359
  }();
22350
22360
 
22351
22361
  exports.AbstractUserDataWriter = AbstractUserDataWriter;