@firebase/firestore 3.4.7-canary.7a4e65cef → 3.4.7-canary.e9e5f6b3c

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.
@@ -66,7 +66,7 @@ C.MOCK_USER = new C("mock-user");
66
66
  * See the License for the specific language governing permissions and
67
67
  * limitations under the License.
68
68
  */
69
- let x = "9.6.10-canary.7a4e65cef";
69
+ let x = "9.6.10-canary.e9e5f6b3c";
70
70
 
71
71
  /**
72
72
  * @license
@@ -1421,14 +1421,14 @@ const It = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
1421
1421
  * Preserving the previous values allows the user to display the last resoled
1422
1422
  * value until the backend responds with the timestamp.
1423
1423
  */
1424
- function Pt(t) {
1424
+ function bt(t) {
1425
1425
  const e = t.mapValue.fields.__previous_value__;
1426
- return Rt(e) ? Pt(e) : e;
1426
+ return Rt(e) ? bt(e) : e;
1427
1427
  }
1428
1428
 
1429
1429
  /**
1430
1430
  * Returns the local time at which this timestamp was first set.
1431
- */ function bt(t) {
1431
+ */ function Pt(t) {
1432
1432
  const e = Tt(t.mapValue.fields.__local_write_time__.timestampValue);
1433
1433
  return new at(e.seconds, e.nanos);
1434
1434
  }
@@ -1639,7 +1639,7 @@ function Mt(t) {
1639
1639
  return t.booleanValue === e.booleanValue;
1640
1640
 
1641
1641
  case 4 /* ServerTimestampValue */ :
1642
- return bt(t).isEqual(bt(e));
1642
+ return Pt(t).isEqual(Pt(e));
1643
1643
 
1644
1644
  case 3 /* TimestampValue */ :
1645
1645
  return function(t, e) {
@@ -1721,7 +1721,7 @@ function $t(t, e) {
1721
1721
  return Bt(t.timestampValue, e.timestampValue);
1722
1722
 
1723
1723
  case 4 /* ServerTimestampValue */ :
1724
- return Bt(bt(t), bt(e));
1724
+ return Bt(Pt(t), Pt(e));
1725
1725
 
1726
1726
  case 5 /* StringValue */ :
1727
1727
  return rt(t.stringValue, e.stringValue);
@@ -2499,7 +2499,7 @@ class Te extends class {} {
2499
2499
  /**
2500
2500
  * Creates a filter based on the provided arguments.
2501
2501
  */ static create(t, e, n) {
2502
- return t.isKeyField() ? "in" /* IN */ === e || "not-in" /* NOT_IN */ === e ? this.V(t, e, n) : new Ee(t, e, n) : "array-contains" /* ARRAY_CONTAINS */ === e ? new be(t, n) : "in" /* IN */ === e ? new Ve(t, n) : "not-in" /* NOT_IN */ === e ? new ve(t, n) : "array-contains-any" /* ARRAY_CONTAINS_ANY */ === e ? new Se(t, n) : new Te(t, e, n);
2502
+ return t.isKeyField() ? "in" /* IN */ === e || "not-in" /* NOT_IN */ === e ? this.V(t, e, n) : new Ee(t, e, n) : "array-contains" /* ARRAY_CONTAINS */ === e ? new Pe(t, n) : "in" /* IN */ === e ? new Ve(t, n) : "not-in" /* NOT_IN */ === e ? new ve(t, n) : "array-contains-any" /* ARRAY_CONTAINS_ANY */ === e ? new Se(t, n) : new Te(t, e, n);
2503
2503
  }
2504
2504
  static V(t, e, n) {
2505
2505
  return "in" /* IN */ === e ? new Ae(t, n) : new Re(t, n);
@@ -2551,7 +2551,7 @@ class Ee extends Te {
2551
2551
 
2552
2552
  /** Filter that matches on key fields within an array. */ class Ae extends Te {
2553
2553
  constructor(t, e) {
2554
- super(t, "in" /* IN */ , e), this.keys = Pe("in" /* IN */ , e);
2554
+ super(t, "in" /* IN */ , e), this.keys = be("in" /* IN */ , e);
2555
2555
  }
2556
2556
  matches(t) {
2557
2557
  return this.keys.some((e => e.isEqual(t.key)));
@@ -2560,19 +2560,19 @@ class Ee extends Te {
2560
2560
 
2561
2561
  /** Filter that matches on key fields not present within an array. */ class Re extends Te {
2562
2562
  constructor(t, e) {
2563
- super(t, "not-in" /* NOT_IN */ , e), this.keys = Pe("not-in" /* NOT_IN */ , e);
2563
+ super(t, "not-in" /* NOT_IN */ , e), this.keys = be("not-in" /* NOT_IN */ , e);
2564
2564
  }
2565
2565
  matches(t) {
2566
2566
  return !this.keys.some((e => e.isEqual(t.key)));
2567
2567
  }
2568
2568
  }
2569
2569
 
2570
- function Pe(t, e) {
2570
+ function be(t, e) {
2571
2571
  var n;
2572
2572
  return ((null === (n = e.arrayValue) || void 0 === n ? void 0 : n.values) || []).map((t => xt.fromName(t.referenceValue)));
2573
2573
  }
2574
2574
 
2575
- /** A Filter that implements the array-contains operator. */ class be extends Te {
2575
+ /** A Filter that implements the array-contains operator. */ class Pe extends Te {
2576
2576
  constructor(t, e) {
2577
2577
  super(t, "array-contains" /* ARRAY_CONTAINS */ , e);
2578
2578
  }
@@ -3244,7 +3244,7 @@ class gn {
3244
3244
  * of the document.
3245
3245
  * @param mutationResult - The result of applying the mutation from the backend.
3246
3246
  */ function Tn(t, e, n) {
3247
- t instanceof bn ? function(t, e, n) {
3247
+ t instanceof Pn ? function(t, e, n) {
3248
3248
  // Unlike setMutationApplyToLocalView, if we're applying a mutation to a
3249
3249
  // remote document the server has accepted the mutation so the precondition
3250
3250
  // must have held.
@@ -3279,13 +3279,13 @@ class gn {
3279
3279
  * @param localWriteTime - A timestamp indicating the local write time of the
3280
3280
  * batch this mutation is a part of.
3281
3281
  */ function En(t, e, n) {
3282
- t instanceof bn ? function(t, e, n) {
3282
+ t instanceof Pn ? function(t, e, n) {
3283
3283
  if (!pn(t.precondition, e))
3284
3284
  // The mutation failed to apply (e.g. a document ID created with add()
3285
3285
  // caused a name collision).
3286
3286
  return;
3287
3287
  const s = t.value.clone(), i = Dn(t.fieldTransforms, n, e);
3288
- s.setAll(i), e.convertToFoundDocument(Pn(e), s).setHasLocalMutations();
3288
+ s.setAll(i), e.convertToFoundDocument(bn(e), s).setHasLocalMutations();
3289
3289
  }
3290
3290
  /**
3291
3291
  * A mutation that modifies fields of the document at the given key with the
@@ -3302,7 +3302,7 @@ class gn {
3302
3302
  */ (t, e, n) : t instanceof Vn ? function(t, e, n) {
3303
3303
  if (!pn(t.precondition, e)) return;
3304
3304
  const s = Dn(t.fieldTransforms, n, e), i = e.data;
3305
- i.setAll(vn(t)), i.setAll(s), e.convertToFoundDocument(Pn(e), i).setHasLocalMutations();
3305
+ i.setAll(vn(t)), i.setAll(s), e.convertToFoundDocument(bn(e), i).setHasLocalMutations();
3306
3306
  }
3307
3307
  /**
3308
3308
  * Returns a FieldPath/Value map with the content of the PatchMutation.
@@ -3356,14 +3356,14 @@ function Rn(t, e) {
3356
3356
  * mutation. Mutations are defined to return the version of the base document
3357
3357
  * only if it is an existing document. Deleted and unknown documents have a
3358
3358
  * post-mutation version of SnapshotVersion.min().
3359
- */ function Pn(t) {
3359
+ */ function bn(t) {
3360
3360
  return t.isFoundDocument() ? t.version : ct.min();
3361
3361
  }
3362
3362
 
3363
3363
  /**
3364
3364
  * A mutation that creates or replaces the document at the given key with the
3365
3365
  * object value contents.
3366
- */ class bn extends In {
3366
+ */ class Pn extends In {
3367
3367
  constructor(t, e, n, s = []) {
3368
3368
  super(), this.key = t, this.value = e, this.precondition = n, this.fieldTransforms = s,
3369
3369
  this.type = 0 /* Set */;
@@ -4857,14 +4857,14 @@ function Rs(t) {
4857
4857
  return U(t.length > 4 && "documents" === t.get(4)), t.popFirst(5);
4858
4858
  }
4859
4859
 
4860
- /** Creates a Document proto from key and fields (but no create/update time) */ function Ps(t, e, n) {
4860
+ /** Creates a Document proto from key and fields (but no create/update time) */ function bs(t, e, n) {
4861
4861
  return {
4862
4862
  name: ps(t, e),
4863
4863
  fields: n.value.mapValue.fields
4864
4864
  };
4865
4865
  }
4866
4866
 
4867
- function bs(t, e, n) {
4867
+ function Ps(t, e, n) {
4868
4868
  const s = Is(t, e.name), i = ms(e.updateTime), r = new te({
4869
4869
  mapValue: {
4870
4870
  fields: e.fields
@@ -4950,12 +4950,12 @@ function vs(t, e) {
4950
4950
 
4951
4951
  function Ss(t, e) {
4952
4952
  let n;
4953
- if (e instanceof bn) n = {
4954
- update: Ps(t, e.key, e.value)
4953
+ if (e instanceof Pn) n = {
4954
+ update: bs(t, e.key, e.value)
4955
4955
  }; else if (e instanceof Cn) n = {
4956
4956
  delete: ps(t, e.key)
4957
4957
  }; else if (e instanceof Vn) n = {
4958
- update: Ps(t, e.key, e.data),
4958
+ update: bs(t, e.key, e.data),
4959
4959
  updateMask: Ks(e.fieldMask)
4960
4960
  }; else {
4961
4961
  if (!(e instanceof xn)) return L();
@@ -5024,7 +5024,7 @@ function Ds(t, e) {
5024
5024
  }(e.updateMask);
5025
5025
  return new Vn(i, r, t, n, s);
5026
5026
  }
5027
- return new bn(i, r, n, s);
5027
+ return new Pn(i, r, n, s);
5028
5028
  }
5029
5029
  if (e.delete) {
5030
5030
  const s = Is(t, e.delete);
@@ -5687,7 +5687,7 @@ class Ii {
5687
5687
  t && this.At.reject(t), this.aborted || (O("SimpleDb", "Aborting transaction:", t ? t.message : "Client-initiated abort"),
5688
5688
  this.aborted = !0, this.transaction.abort());
5689
5689
  }
5690
- Pt() {
5690
+ bt() {
5691
5691
  // If the browser supports V3 IndexedDB, we invoke commit() explicitly to
5692
5692
  // speed up index DB processing if the event loop remains blocks.
5693
5693
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -5704,7 +5704,7 @@ class Ii {
5704
5704
  * correct, but they allow type safety through the rest of the consuming code.
5705
5705
  */ store(t) {
5706
5706
  const e = this.transaction.objectStore(t);
5707
- return new Pi(e);
5707
+ return new bi(e);
5708
5708
  }
5709
5709
  }
5710
5710
 
@@ -5725,7 +5725,7 @@ class Ii {
5725
5725
  * objectstores.
5726
5726
  */
5727
5727
  constructor(t, e, n) {
5728
- this.name = t, this.version = e, this.bt = n;
5728
+ this.name = t, this.version = e, this.Pt = n;
5729
5729
  // NOTE: According to https://bugs.webkit.org/show_bug.cgi?id=197050, the
5730
5730
  // bug we're checking for should exist in iOS >= 12.2 and < 13, but for
5731
5731
  // whatever reason it's much harder to hit after 12.2 so we only proactively
@@ -5733,7 +5733,7 @@ class Ii {
5733
5733
  12.2 === Ti.Vt(getUA()) && F("Firestore persistence suffers from a bug in iOS 12.2 Safari that may cause your app to stop working. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.");
5734
5734
  }
5735
5735
  /** Deletes the specified database. */ static delete(t) {
5736
- return O("SimpleDb", "Removing database:", t), bi(window.indexedDB.deleteDatabase(t)).toPromise();
5736
+ return O("SimpleDb", "Removing database:", t), Pi(window.indexedDB.deleteDatabase(t)).toPromise();
5737
5737
  }
5738
5738
  /** Returns true if IndexedDB is available in the current environment. */ static vt() {
5739
5739
  if (!isIndexedDBAvailable()) return !1;
@@ -5799,7 +5799,7 @@ class Ii {
5799
5799
  }, s.onupgradeneeded = t => {
5800
5800
  O("SimpleDb", 'Database "' + this.name + '" requires upgrade from version:', t.oldVersion);
5801
5801
  const e = t.target.result;
5802
- this.bt.kt(e, s.transaction, t.oldVersion, this.version).next((() => {
5802
+ this.Pt.kt(e, s.transaction, t.oldVersion, this.version).next((() => {
5803
5803
  O("SimpleDb", "Database upgrade to version " + this.version + " complete");
5804
5804
  }));
5805
5805
  };
@@ -5815,7 +5815,7 @@ class Ii {
5815
5815
  ++r;
5816
5816
  try {
5817
5817
  this.db = await this.Nt(t);
5818
- const e = Ii.open(this.db, t, i ? "readonly" : "readwrite", n), r = s(e).next((t => (e.Pt(),
5818
+ const e = Ii.open(this.db, t, i ? "readonly" : "readwrite", n), r = s(e).next((t => (e.bt(),
5819
5819
  t))).catch((t => (
5820
5820
  // Abort the transaction if there was an error.
5821
5821
  e.abort(t), pi.reject(t)))).toPromise();
@@ -5876,7 +5876,7 @@ class Ii {
5876
5876
  *
5877
5877
  * NOTE: You CANNOT do this with a keysOnly query.
5878
5878
  */ delete() {
5879
- return bi(this.Ft.delete());
5879
+ return Pi(this.Ft.delete());
5880
5880
  }
5881
5881
  }
5882
5882
 
@@ -5901,14 +5901,14 @@ class Ii {
5901
5901
  * method return a PersistencePromise instead.
5902
5902
  * 3) Provides a higher-level API to avoid needing to do excessive wrapping of
5903
5903
  * intermediate IndexedDB types (IDBCursorWithValue, etc.)
5904
- */ class Pi {
5904
+ */ class bi {
5905
5905
  constructor(t) {
5906
5906
  this.store = t;
5907
5907
  }
5908
5908
  put(t, e) {
5909
5909
  let n;
5910
5910
  return void 0 !== e ? (O("SimpleDb", "PUT", this.store.name, t, e), n = this.store.put(e, t)) : (O("SimpleDb", "PUT", this.store.name, "<auto-key>", t),
5911
- n = this.store.put(t)), bi(n);
5911
+ n = this.store.put(t)), Pi(n);
5912
5912
  }
5913
5913
  /**
5914
5914
  * Adds a new value into an Object Store and returns the new key. Similar to
@@ -5918,7 +5918,7 @@ class Ii {
5918
5918
  * @returns The key of the value to add.
5919
5919
  */ add(t) {
5920
5920
  O("SimpleDb", "ADD", this.store.name, t, t);
5921
- return bi(this.store.add(t));
5921
+ return Pi(this.store.add(t));
5922
5922
  }
5923
5923
  /**
5924
5924
  * Gets the object with the specified key from the specified store, or null
@@ -5929,13 +5929,13 @@ class Ii {
5929
5929
  */ get(t) {
5930
5930
  // We're doing an unsafe cast to ValueType.
5931
5931
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
5932
- return bi(this.store.get(t)).next((e => (
5932
+ return Pi(this.store.get(t)).next((e => (
5933
5933
  // Normalize nonexistence to null.
5934
5934
  void 0 === e && (e = null), O("SimpleDb", "GET", this.store.name, t, e), e)));
5935
5935
  }
5936
5936
  delete(t) {
5937
5937
  O("SimpleDb", "DELETE", this.store.name, t);
5938
- return bi(this.store.delete(t));
5938
+ return Pi(this.store.delete(t));
5939
5939
  }
5940
5940
  /**
5941
5941
  * If we ever need more of the count variants, we can add overloads. For now,
@@ -5944,7 +5944,7 @@ class Ii {
5944
5944
  * Returns the number of rows in the store.
5945
5945
  */ count() {
5946
5946
  O("SimpleDb", "COUNT", this.store.name);
5947
- return bi(this.store.count());
5947
+ return Pi(this.store.count());
5948
5948
  }
5949
5949
  qt(t, e) {
5950
5950
  const n = this.options(t, e);
@@ -6051,7 +6051,7 @@ class Ii {
6051
6051
  /**
6052
6052
  * Wraps an IDBRequest in a PersistencePromise, using the onsuccess / onerror
6053
6053
  * handlers to resolve / reject the PersistencePromise as appropriate.
6054
- */ function bi(t) {
6054
+ */ function Pi(t) {
6055
6055
  return new pi(((e, n) => {
6056
6056
  t.onsuccess = t => {
6057
6057
  const n = t.target.result;
@@ -6341,7 +6341,7 @@ function Di(t, e) {
6341
6341
 
6342
6342
  /** Decodes a remote document from storage locally to a Document. */ function Oi(t, e) {
6343
6343
  let n;
6344
- if (e.document) n = bs(t.Jt, e.document, !!e.hasCommittedMutations); else if (e.noDocument) {
6344
+ if (e.document) n = Ps(t.Jt, e.document, !!e.hasCommittedMutations); else if (e.noDocument) {
6345
6345
  const t = xt.fromSegments(e.noDocument.path), s = Li(e.noDocument.readTime);
6346
6346
  n = ne.newNoDocument(t, s), e.hasCommittedMutations && n.setHasCommittedMutations();
6347
6347
  } else {
@@ -6842,8 +6842,8 @@ function tr(t) {
6842
6842
  /**
6843
6843
  * Writes the "infinity" byte sequence that sorts after all other byte
6844
6844
  * sequences written in ascending order.
6845
- */ Pe() {
6846
- this.be(255), this.be(255);
6845
+ */ be() {
6846
+ this.Pe(255), this.Pe(255);
6847
6847
  }
6848
6848
  /**
6849
6849
  * Writes the "infinity" byte sequence that sorts before all other byte
@@ -6885,19 +6885,19 @@ function tr(t) {
6885
6885
  }
6886
6886
  /** Writes a single byte ascending to the buffer. */ _e(t) {
6887
6887
  const e = 255 & t;
6888
- 0 === e ? (this.be(0), this.be(255)) : 255 === e ? (this.be(255), this.be(0)) : this.be(e);
6888
+ 0 === e ? (this.Pe(0), this.Pe(255)) : 255 === e ? (this.Pe(255), this.Pe(0)) : this.Pe(e);
6889
6889
  }
6890
6890
  /** Writes a single byte descending to the buffer. */ ge(t) {
6891
6891
  const e = 255 & t;
6892
6892
  0 === e ? (this.ve(0), this.ve(255)) : 255 === e ? (this.ve(255), this.ve(0)) : this.ve(t);
6893
6893
  }
6894
6894
  we() {
6895
- this.be(0), this.be(1);
6895
+ this.Pe(0), this.Pe(1);
6896
6896
  }
6897
6897
  ye() {
6898
6898
  this.ve(0), this.ve(1);
6899
6899
  }
6900
- be(t) {
6900
+ Pe(t) {
6901
6901
  this.Ae(1), this.buffer[this.position++] = t;
6902
6902
  }
6903
6903
  ve(t) {
@@ -6931,7 +6931,7 @@ class nr {
6931
6931
  this.De.Te(t);
6932
6932
  }
6933
6933
  ee() {
6934
- this.De.Pe();
6934
+ this.De.be();
6935
6935
  }
6936
6936
  }
6937
6937
 
@@ -8045,7 +8045,7 @@ class Tr {
8045
8045
  // PORTING NOTE: Multi-tab only (state is held in memory in other clients).
8046
8046
  /** Returns the mutation queue's metadata from IndexedDb. */
8047
8047
  wn(t) {
8048
- return Pr(t).get(this.userId).next((t => t || {
8048
+ return br(t).get(this.userId).next((t => t || {
8049
8049
  userId: this.userId,
8050
8050
  lastAcknowledgedBatchId: -1,
8051
8051
  lastStreamToken: ""
@@ -8084,7 +8084,7 @@ function Ar(t) {
8084
8084
 
8085
8085
  /**
8086
8086
  * Helper to get a typed SimpleDbStore for the mutationQueues object store.
8087
- */ function Pr(t) {
8087
+ */ function br(t) {
8088
8088
  return Di(t, "mutationQueues");
8089
8089
  }
8090
8090
 
@@ -8119,7 +8119,7 @@ function Ar(t) {
8119
8119
  * generate in-memory target IDs that are transient and can be reused after a
8120
8120
  * restart.
8121
8121
  */
8122
- class br {
8122
+ class Pr {
8123
8123
  constructor(t) {
8124
8124
  this.mn = t;
8125
8125
  }
@@ -8131,11 +8131,11 @@ class br {
8131
8131
  // as there is no differentiation in the protocol layer between an unset
8132
8132
  // number and the number '0'. If we were to sent a target with target ID
8133
8133
  // '0', the backend would consider it unset and replace it with its own ID.
8134
- return new br(0);
8134
+ return new Pr(0);
8135
8135
  }
8136
8136
  static yn() {
8137
8137
  // Sync engine assigns target IDs for limbo document detection.
8138
- return new br(-1);
8138
+ return new Pr(-1);
8139
8139
  }
8140
8140
  }
8141
8141
 
@@ -8166,7 +8166,7 @@ class br {
8166
8166
  // out to have a meaningful performance impact.
8167
8167
  allocateTargetId(t) {
8168
8168
  return this.pn(t).next((e => {
8169
- const n = new br(e.highestTargetId);
8169
+ const n = new Pr(e.highestTargetId);
8170
8170
  return e.highestTargetId = n.next(), this.In(t, e).next((() => e.highestTargetId));
8171
8171
  }));
8172
8172
  }
@@ -8394,11 +8394,11 @@ class br {
8394
8394
  constructor(t) {
8395
8395
  this.An = t, this.buffer = new qn(xr), this.Rn = 0;
8396
8396
  }
8397
- Pn() {
8397
+ bn() {
8398
8398
  return ++this.Rn;
8399
8399
  }
8400
- bn(t) {
8401
- const e = [ t, this.Pn() ];
8400
+ Pn(t) {
8401
+ const e = [ t, this.bn() ];
8402
8402
  if (this.buffer.size < this.An) this.buffer = this.buffer.add(e); else {
8403
8403
  const t = this.buffer.last();
8404
8404
  xr(e, t) < 0 && (this.buffer = this.buffer.delete(t).add(e));
@@ -8455,7 +8455,7 @@ class br {
8455
8455
  nthSequenceNumber(t, e) {
8456
8456
  if (0 === e) return pi.resolve(nt.A);
8457
8457
  const n = new Nr(e);
8458
- return this.Dn.forEachTarget(t, (t => n.bn(t.sequenceNumber))).next((() => this.Dn.xn(t, (t => n.bn(t))))).next((() => n.maxValue));
8458
+ return this.Dn.forEachTarget(t, (t => n.Pn(t.sequenceNumber))).next((() => this.Dn.xn(t, (t => n.Pn(t))))).next((() => n.maxValue));
8459
8459
  }
8460
8460
  removeTargets(t, e, n) {
8461
8461
  return this.Dn.removeTargets(t, e, n);
@@ -8552,7 +8552,7 @@ class Or {
8552
8552
  */ On(t, e) {
8553
8553
  return function(t, e) {
8554
8554
  let n = !1;
8555
- return Pr(t).zt((s => Er(t, s, e).next((t => (t && (n = !0), pi.resolve(!t)))))).next((() => n));
8555
+ return br(t).zt((s => Er(t, s, e).next((t => (t && (n = !0), pi.resolve(!t)))))).next((() => n));
8556
8556
  }(t, e);
8557
8557
  }
8558
8558
  removeOrphanedDocuments(t, e) {
@@ -9456,7 +9456,7 @@ class Hr {
9456
9456
  if (this.isPrimary) return this.Es(t).next((t => {
9457
9457
  t || (this.isPrimary = !1, this.Yn.enqueueRetryable((() => this.cs(!1))));
9458
9458
  }));
9459
- })).next((() => this.As(t))).next((e => this.isPrimary && !e ? this.Rs(t).next((() => !1)) : !!e && this.Ps(t).next((() => !0)))))).catch((t => {
9459
+ })).next((() => this.As(t))).next((e => this.isPrimary && !e ? this.Rs(t).next((() => !1)) : !!e && this.bs(t).next((() => !0)))))).catch((t => {
9460
9460
  if (Ri(t))
9461
9461
  // Proceed with the existing state. Any subsequent access to
9462
9462
  // IndexedDB will verify the lease.
@@ -9469,7 +9469,7 @@ class Hr {
9469
9469
  }));
9470
9470
  }
9471
9471
  Es(t) {
9472
- return Jr(t).get("owner").next((t => pi.resolve(this.bs(t))));
9472
+ return Jr(t).get("owner").next((t => pi.resolve(this.Ps(t))));
9473
9473
  }
9474
9474
  Vs(t) {
9475
9475
  return Yr(t).delete(this.clientId);
@@ -9503,7 +9503,7 @@ class Hr {
9503
9503
  */ Is() {
9504
9504
  this.os = this.Yn.enqueueAfterDelay("client_metadata_refresh" /* ClientMetadataRefresh */ , 4e3, (() => this.gs().then((() => this.vs())).then((() => this.Is()))));
9505
9505
  }
9506
- /** Checks whether `client` is the local client. */ bs(t) {
9506
+ /** Checks whether `client` is the local client. */ Ps(t) {
9507
9507
  return !!t && t.ownerId === this.clientId;
9508
9508
  }
9509
9509
  /**
@@ -9525,8 +9525,8 @@ class Hr {
9525
9525
  // the foreground.
9526
9526
  // - the `forceOwningTab` setting was passed in.
9527
9527
  if (null !== e && this.Ss(e.leaseTimestampMs, 5e3) && !this.xs(e.ownerId)) {
9528
- if (this.bs(e) && this.networkEnabled) return !0;
9529
- if (!this.bs(e)) {
9528
+ if (this.Ps(e) && this.networkEnabled) return !0;
9529
+ if (!this.Ps(e)) {
9530
9530
  if (!e.allowTabSynchronization)
9531
9531
  // Fail the `canActAsPrimary` check if the current leaseholder has
9532
9532
  // not opted into multi-tab synchronization. If this happens at
@@ -9617,7 +9617,7 @@ class Hr {
9617
9617
  if (!e) throw F(`Failed to obtain primary lease for action '${t}'.`), this.isPrimary = !1,
9618
9618
  this.Yn.enqueueRetryable((() => this.cs(!1))), new Q(G.FAILED_PRECONDITION, gi);
9619
9619
  return n(o);
9620
- })).next((t => this.Ps(o).next((() => t)))) : this.$s(o).next((() => n(o)))))).then((t => (o.raiseOnCommittedEvent(),
9620
+ })).next((t => this.bs(o).next((() => t)))) : this.$s(o).next((() => n(o)))))).then((t => (o.raiseOnCommittedEvent(),
9621
9621
  t)));
9622
9622
  }
9623
9623
  /**
@@ -9628,13 +9628,13 @@ class Hr {
9628
9628
  // be turned off.
9629
9629
  $s(t) {
9630
9630
  return Jr(t).get("owner").next((t => {
9631
- if (null !== t && this.Ss(t.leaseTimestampMs, 5e3) && !this.xs(t.ownerId) && !this.bs(t) && !(this.Zn || this.allowTabSynchronization && t.allowTabSynchronization)) throw new Q(G.FAILED_PRECONDITION, zr);
9631
+ if (null !== t && this.Ss(t.leaseTimestampMs, 5e3) && !this.xs(t.ownerId) && !this.Ps(t) && !(this.Zn || this.allowTabSynchronization && t.allowTabSynchronization)) throw new Q(G.FAILED_PRECONDITION, zr);
9632
9632
  }));
9633
9633
  }
9634
9634
  /**
9635
9635
  * Obtains or extends the new primary lease for the local client. This
9636
9636
  * method does not verify that the client is eligible for this lease.
9637
- */ Ps(t) {
9637
+ */ bs(t) {
9638
9638
  const e = {
9639
9639
  ownerId: this.clientId,
9640
9640
  allowTabSynchronization: this.allowTabSynchronization,
@@ -9647,7 +9647,7 @@ class Hr {
9647
9647
  }
9648
9648
  /** Checks the primary lease and removes it if we are the current primary. */ Rs(t) {
9649
9649
  const e = Jr(t);
9650
- return e.get("owner").next((t => this.bs(t) ? (O("IndexedDbPersistence", "Releasing primary lease."),
9650
+ return e.get("owner").next((t => this.Ps(t) ? (O("IndexedDbPersistence", "Releasing primary lease."),
9651
9651
  e.delete("owner")) : pi.resolve()));
9652
9652
  }
9653
9653
  /** Verifies that `updateTimeMs` is within `maxAgeMs`. */ Ss(t, e) {
@@ -10655,13 +10655,13 @@ async function yo(t, e, n = Xn()) {
10655
10655
  /**
10656
10656
  * Clears all references with a given ID. Calls removeRef() for each key
10657
10657
  * removed.
10658
- */ Pi(t) {
10658
+ */ bi(t) {
10659
10659
  const e = new xt(new _t([])), n = new Eo(e, t), s = new Eo(e, t + 1), i = [];
10660
10660
  return this.Ii.forEachInRange([ n, s ], (t => {
10661
10661
  this.Ai(t), i.push(t.key);
10662
10662
  })), i;
10663
10663
  }
10664
- bi() {
10664
+ Pi() {
10665
10665
  this.yi.forEach((t => this.Ai(t)));
10666
10666
  }
10667
10667
  Ai(t) {
@@ -10946,7 +10946,7 @@ class Ro {
10946
10946
  newChangeBuffer(t) {
10947
10947
  // `trackRemovals` is ignores since the MemoryRemoteDocumentCache keeps
10948
10948
  // a separate changelog and does not need special handling for removals.
10949
- return new Po(this);
10949
+ return new bo(this);
10950
10950
  }
10951
10951
  getSize(t) {
10952
10952
  return pi.resolve(this.size);
@@ -10963,7 +10963,7 @@ class Ro {
10963
10963
  /**
10964
10964
  * Handles the details of adding and updating documents in the MemoryRemoteDocumentCache.
10965
10965
  */
10966
- class Po extends $r {
10966
+ class bo extends $r {
10967
10967
  constructor(t) {
10968
10968
  super(), this.Kn = t;
10969
10969
  }
@@ -10996,7 +10996,7 @@ class Po extends $r {
10996
10996
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10997
10997
  * See the License for the specific language governing permissions and
10998
10998
  * limitations under the License.
10999
- */ class bo {
10999
+ */ class Po {
11000
11000
  constructor(t) {
11001
11001
  this.persistence = t,
11002
11002
  /**
@@ -11013,7 +11013,7 @@ class Po extends $r {
11013
11013
  * A ordered bidirectional mapping between documents and the remote target
11014
11014
  * IDs.
11015
11015
  */
11016
- this.Bi = new To, this.targetCount = 0, this.Li = br.gn();
11016
+ this.Bi = new To, this.targetCount = 0, this.Li = Pr.gn();
11017
11017
  }
11018
11018
  forEachTarget(t, e) {
11019
11019
  return this.Fi.forEach(((t, n) => e(n))), pi.resolve();
@@ -11034,7 +11034,7 @@ class Po extends $r {
11034
11034
  Tn(t) {
11035
11035
  this.Fi.set(t.target, t);
11036
11036
  const e = t.targetId;
11037
- e > this.highestTargetId && (this.Li = new br(e), this.highestTargetId = e), t.sequenceNumber > this.$i && (this.$i = t.sequenceNumber);
11037
+ e > this.highestTargetId && (this.Li = new Pr(e), this.highestTargetId = e), t.sequenceNumber > this.$i && (this.$i = t.sequenceNumber);
11038
11038
  }
11039
11039
  addTargetData(t, e) {
11040
11040
  return this.Tn(e), this.targetCount += 1, pi.resolve();
@@ -11043,7 +11043,7 @@ class Po extends $r {
11043
11043
  return this.Tn(e), pi.resolve();
11044
11044
  }
11045
11045
  removeTargetData(t, e) {
11046
- return this.Fi.delete(e.target), this.Bi.Pi(e.targetId), this.targetCount -= 1,
11046
+ return this.Fi.delete(e.target), this.Bi.bi(e.targetId), this.targetCount -= 1,
11047
11047
  pi.resolve();
11048
11048
  }
11049
11049
  removeTargets(t, e, n) {
@@ -11072,7 +11072,7 @@ class Po extends $r {
11072
11072
  })), pi.waitFor(i);
11073
11073
  }
11074
11074
  removeMatchingKeysForTargetId(t, e) {
11075
- return this.Bi.Pi(e), pi.resolve();
11075
+ return this.Bi.bi(e), pi.resolve();
11076
11076
  }
11077
11077
  getMatchingKeysForTargetId(t, e) {
11078
11078
  const n = this.Bi.Vi(e);
@@ -11112,7 +11112,7 @@ class Vo {
11112
11112
  */
11113
11113
  constructor(t, e) {
11114
11114
  this.Ui = {}, this.overlays = {}, this.es = new nt(0), this.ns = !1, this.ns = !0,
11115
- this.referenceDelegate = t(this), this.fs = new bo(this);
11115
+ this.referenceDelegate = t(this), this.fs = new Po(this);
11116
11116
  this.indexManager = new cr, this.ds = function(t) {
11117
11117
  return new Ro(t);
11118
11118
  }((t => this.referenceDelegate.qi(t))), this.M = new Mi(e), this._s = new po(this.M);
@@ -11200,7 +11200,7 @@ class So {
11200
11200
  return this.Hi.add(e.toString()), pi.resolve();
11201
11201
  }
11202
11202
  removeTarget(t, e) {
11203
- this.ji.Pi(e.targetId).forEach((t => this.Hi.add(t.toString())));
11203
+ this.ji.bi(e.targetId).forEach((t => this.Hi.add(t.toString())));
11204
11204
  const n = this.persistence.getTargetCache();
11205
11205
  return n.getMatchingKeysForTargetId(t, e.targetId).next((t => {
11206
11206
  t.forEach((t => this.Hi.add(t.toString())));
@@ -11589,12 +11589,12 @@ class Fo {
11589
11589
  if (this.started) {
11590
11590
  if (null !== e.key) if (this.cr.test(e.key)) {
11591
11591
  if (null == e.newValue) {
11592
- const t = this.Pr(e.key);
11593
- return this.br(t, null);
11592
+ const t = this.br(e.key);
11593
+ return this.Pr(t, null);
11594
11594
  }
11595
11595
  {
11596
11596
  const t = this.Vr(e.key, e.newValue);
11597
- if (t) return this.br(t.clientId, t);
11597
+ if (t) return this.Pr(t.clientId, t);
11598
11598
  }
11599
11599
  } else if (this.hr.test(e.key)) {
11600
11600
  if (null !== e.newValue) {
@@ -11668,7 +11668,7 @@ class Fo {
11668
11668
  /**
11669
11669
  * Parses a client state key in WebStorage. Returns null if the key does not
11670
11670
  * match the expected key format.
11671
- */ Pr(t) {
11671
+ */ br(t) {
11672
11672
  const e = this.cr.exec(t);
11673
11673
  return e ? e[1] : null;
11674
11674
  }
@@ -11676,7 +11676,7 @@ class Fo {
11676
11676
  * Parses a client state in WebStorage. Returns 'null' if the value could not
11677
11677
  * be parsed.
11678
11678
  */ Vr(t, e) {
11679
- const n = this.Pr(t);
11679
+ const n = this.br(t);
11680
11680
  return Mo.Yi(n, e);
11681
11681
  }
11682
11682
  /**
@@ -11709,7 +11709,7 @@ class Fo {
11709
11709
  Cr(t) {
11710
11710
  return this.syncEngine.Or(t.targetId, t.state, t.error);
11711
11711
  }
11712
- br(t, e) {
11712
+ Pr(t, e) {
11713
11713
  const n = e ? this.ir.insert(t, e) : this.ir.remove(t), s = this.yr(this.ir), i = this.yr(n), r = [], o = [];
11714
11714
  return i.forEach((t => {
11715
11715
  s.has(t) || r.push(t);
@@ -12368,7 +12368,7 @@ class zo {
12368
12368
  */
12369
12369
  class Ho {
12370
12370
  constructor(t, e, n, s, i, r, o, u) {
12371
- this.Yn = t, this.Ro = n, this.Po = s, this.bo = i, this.authCredentialsProvider = r,
12371
+ this.Yn = t, this.Ro = n, this.bo = s, this.Po = i, this.authCredentialsProvider = r,
12372
12372
  this.appCheckCredentialsProvider = o, this.listener = u, this.state = 0 /* Initial */ ,
12373
12373
  /**
12374
12374
  * A close count that's incremented every time the stream is closed; used by
@@ -12514,7 +12514,7 @@ class Ho {
12514
12514
  qo(t, e) {
12515
12515
  const n = this.Uo(this.Vo);
12516
12516
  this.stream = this.Go(t, e), this.stream.Hr((() => {
12517
- n((() => (this.state = 2 /* Open */ , this.So = this.Yn.enqueueAfterDelay(this.Po, 1e4, (() => (this.xo() && (this.state = 3 /* Healthy */),
12517
+ n((() => (this.state = 2 /* Open */ , this.So = this.Yn.enqueueAfterDelay(this.bo, 1e4, (() => (this.xo() && (this.state = 3 /* Healthy */),
12518
12518
  Promise.resolve()))), this.listener.Hr())));
12519
12519
  })), this.stream.Yr((t => {
12520
12520
  n((() => this.Ko(t)));
@@ -12560,7 +12560,7 @@ class Ho {
12560
12560
  this.M = i;
12561
12561
  }
12562
12562
  Go(t, e) {
12563
- return this.bo.lo("Listen", t, e);
12563
+ return this.Po.lo("Listen", t, e);
12564
12564
  }
12565
12565
  onMessage(t) {
12566
12566
  // A successful response means the stream is healthy
@@ -12642,7 +12642,7 @@ class Ho {
12642
12642
  this.zo && this.Jo([]);
12643
12643
  }
12644
12644
  Go(t, e) {
12645
- return this.bo.lo("Write", t, e);
12645
+ return this.Po.lo("Write", t, e);
12646
12646
  }
12647
12647
  onMessage(t) {
12648
12648
  if (
@@ -12704,20 +12704,20 @@ class Ho {
12704
12704
  */
12705
12705
  class Xo extends class {} {
12706
12706
  constructor(t, e, n, s) {
12707
- super(), this.authCredentials = t, this.appCheckCredentials = e, this.bo = n, this.M = s,
12707
+ super(), this.authCredentials = t, this.appCheckCredentials = e, this.Po = n, this.M = s,
12708
12708
  this.tu = !1;
12709
12709
  }
12710
12710
  eu() {
12711
12711
  if (this.tu) throw new Q(G.FAILED_PRECONDITION, "The client has already been terminated.");
12712
12712
  }
12713
12713
  /** Invokes the provided RPC with auth and AppCheck tokens. */ oo(t, e, n) {
12714
- return this.eu(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([s, i]) => this.bo.oo(t, e, n, s, i))).catch((t => {
12714
+ return this.eu(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([s, i]) => this.Po.oo(t, e, n, s, i))).catch((t => {
12715
12715
  throw "FirebaseError" === t.name ? (t.code === G.UNAUTHENTICATED && (this.authCredentials.invalidateToken(),
12716
12716
  this.appCheckCredentials.invalidateToken()), t) : new Q(G.UNKNOWN, t.toString());
12717
12717
  }));
12718
12718
  }
12719
12719
  /** Invokes the provided RPC with streamed results with auth and AppCheck tokens. */ ho(t, e, n) {
12720
- return this.eu(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([s, i]) => this.bo.ho(t, e, n, s, i))).catch((t => {
12720
+ return this.eu(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([s, i]) => this.Po.ho(t, e, n, s, i))).catch((t => {
12721
12721
  throw "FirebaseError" === t.name ? (t.code === G.UNAUTHENTICATED && (this.authCredentials.invalidateToken(),
12722
12722
  this.appCheckCredentials.invalidateToken()), t) : new Q(G.UNKNOWN, t.toString());
12723
12723
  }));
@@ -13169,7 +13169,7 @@ async function Ru(t, e) {
13169
13169
  pu(t) && Iu(t);
13170
13170
  }
13171
13171
 
13172
- async function Pu(t, e) {
13172
+ async function bu(t, e) {
13173
13173
  const n = K(t);
13174
13174
  n.asyncQueue.verifyOperationInProgress(), O("RemoteStore", "RemoteStore received new credentials");
13175
13175
  const s = cu(n);
@@ -13184,7 +13184,7 @@ async function Pu(t, e) {
13184
13184
 
13185
13185
  /**
13186
13186
  * Toggles the network state when the client gains or loses its primary lease.
13187
- */ async function bu(t, e) {
13187
+ */ async function Pu(t, e) {
13188
13188
  const n = K(t);
13189
13189
  e ? (n.fu.delete(2 /* IsSecondary */), await eu(n)) : e || (n.fu.add(2 /* IsSecondary */),
13190
13190
  await nu(n), n.wu.set("Unknown" /* Unknown */));
@@ -13202,7 +13202,7 @@ async function Pu(t, e) {
13202
13202
  // Create stream (but note that it is not started yet).
13203
13203
  t.gu = function(t, e, n) {
13204
13204
  const s = K(t);
13205
- return s.eu(), new Jo(e, s.bo, s.authCredentials, s.appCheckCredentials, s.M, n);
13205
+ return s.eu(), new Jo(e, s.Po, s.authCredentials, s.appCheckCredentials, s.M, n);
13206
13206
  }
13207
13207
  /**
13208
13208
  * @license
@@ -13241,7 +13241,7 @@ async function Pu(t, e) {
13241
13241
  // Create stream (but note that it is not started yet).
13242
13242
  t.yu = function(t, e, n) {
13243
13243
  const s = K(t);
13244
- return s.eu(), new Yo(e, s.bo, s.authCredentials, s.appCheckCredentials, s.M, n);
13244
+ return s.eu(), new Yo(e, s.Po, s.authCredentials, s.appCheckCredentials, s.M, n);
13245
13245
  }(t.datastore, t.asyncQueue, {
13246
13246
  Hr: Tu.bind(null, t),
13247
13247
  Yr: Ru.bind(null, t),
@@ -13623,12 +13623,12 @@ function Lu(t) {
13623
13623
  * It uses an Observer to dispatch events.
13624
13624
  */ class Uu {
13625
13625
  constructor(t, e, n) {
13626
- this.query = t, this.Pu = e,
13626
+ this.query = t, this.bu = e,
13627
13627
  /**
13628
13628
  * Initial snapshots (e.g. from cache) may not be propagated to the wrapped
13629
13629
  * observer. This flag is set to true once we've actually raised an event.
13630
13630
  */
13631
- this.bu = !1, this.Vu = null, this.onlineState = "Unknown" /* Unknown */ , this.options = n || {};
13631
+ this.Pu = !1, this.Vu = null, this.onlineState = "Unknown" /* Unknown */ , this.options = n || {};
13632
13632
  }
13633
13633
  /**
13634
13634
  * Applies the new ViewSnapshot to this listener, raising a user-facing event
@@ -13644,16 +13644,16 @@ function Lu(t) {
13644
13644
  /* excludesMetadataChanges= */ !0);
13645
13645
  }
13646
13646
  let e = !1;
13647
- return this.bu ? this.vu(t) && (this.Pu.next(t), e = !0) : this.Su(t, this.onlineState) && (this.Du(t),
13647
+ return this.Pu ? this.vu(t) && (this.bu.next(t), e = !0) : this.Su(t, this.onlineState) && (this.Du(t),
13648
13648
  e = !0), this.Vu = t, e;
13649
13649
  }
13650
13650
  onError(t) {
13651
- this.Pu.error(t);
13651
+ this.bu.error(t);
13652
13652
  }
13653
13653
  /** Returns whether a snapshot was raised. */ Au(t) {
13654
13654
  this.onlineState = t;
13655
13655
  let e = !1;
13656
- return this.Vu && !this.bu && this.Su(this.Vu, t) && (this.Du(this.Vu), e = !0),
13656
+ return this.Vu && !this.Pu && this.Su(this.Vu, t) && (this.Du(this.Vu), e = !0),
13657
13657
  e;
13658
13658
  }
13659
13659
  Su(t, e) {
@@ -13680,8 +13680,8 @@ function Lu(t) {
13680
13680
  // stripped out.
13681
13681
  }
13682
13682
  Du(t) {
13683
- t = Nu.fromInitialDocuments(t.query, t.docs, t.mutatedKeys, t.fromCache), this.bu = !0,
13684
- this.Pu.next(t);
13683
+ t = Nu.fromInitialDocuments(t.query, t.docs, t.mutatedKeys, t.fromCache), this.Pu = !0,
13684
+ this.bu.next(t);
13685
13685
  }
13686
13686
  }
13687
13687
 
@@ -13743,7 +13743,7 @@ function Lu(t) {
13743
13743
  /**
13744
13744
  * Converts a BundleDocument to a MutableDocument.
13745
13745
  */ di(t) {
13746
- return t.metadata.exists ? bs(this.M, t.document, !1) : ne.newNoDocument(this.fi(t.metadata.name), this._i(t.metadata.readTime));
13746
+ return t.metadata.exists ? Ps(this.M, t.document, !1) : ne.newNoDocument(this.fi(t.metadata.name), this._i(t.metadata.readTime));
13747
13747
  }
13748
13748
  _i(t) {
13749
13749
  return ms(t);
@@ -14190,7 +14190,7 @@ class Hu {
14190
14190
  /** Stores user completion handlers, indexed by User and BatchId. */
14191
14191
  this.ua = {},
14192
14192
  /** Stores user callbacks waiting for all pending writes to be acknowledged. */
14193
- this.aa = new Map, this.ca = br.yn(), this.onlineState = "Unknown" /* Unknown */ ,
14193
+ this.aa = new Map, this.ca = Pr.yn(), this.onlineState = "Unknown" /* Unknown */ ,
14194
14194
  // The primary state is set to `true` or `false` immediately after Firestore
14195
14195
  // startup. In the interim, a client should only be considered primary if
14196
14196
  // `isPrimary` is true.
@@ -14503,7 +14503,7 @@ function ha(t, e, n = null) {
14503
14503
  t.sharedClientState.removeLocalQueryTarget(e);
14504
14504
  for (const s of t.na.get(e)) t.ea.delete(s), n && t.ta.fa(s, n);
14505
14505
  if (t.na.delete(e), t.isPrimaryClient) {
14506
- t.oa.Pi(e).forEach((e => {
14506
+ t.oa.bi(e).forEach((e => {
14507
14507
  t.oa.containsKey(e) ||
14508
14508
  // We removed the last reference for this key
14509
14509
  la(t, e);
@@ -14680,7 +14680,7 @@ async function Ta(t, e) {
14680
14680
  // primary, we need to need to make sure that all views for all targets
14681
14681
  // match the state on disk.
14682
14682
  const t = n.sharedClientState.getAllActiveQueryTargets(), e = await Ea(n, t.toArray());
14683
- n.ha = !0, await bu(n.remoteStore, !0);
14683
+ n.ha = !0, await Pu(n.remoteStore, !0);
14684
14684
  for (const t of e) su(n.remoteStore, t);
14685
14685
  } else if (!1 === e && !1 !== n.ha) {
14686
14686
  const t = [];
@@ -14695,7 +14695,7 @@ async function Ta(t, e) {
14695
14695
  const e = K(t);
14696
14696
  e.ra.forEach(((t, n) => {
14697
14697
  iu(e.remoteStore, n);
14698
- })), e.oa.bi(), e.ra = new Map, e.ia = new Bn(xt.comparator);
14698
+ })), e.oa.Pi(), e.ra = new Map, e.ia = new Bn(xt.comparator);
14699
14699
  }
14700
14700
  /**
14701
14701
  * Reconcile the query views of the provided query targets with the state from
@@ -14708,7 +14708,7 @@ async function Ta(t, e) {
14708
14708
  * tab to a primary tab
14709
14709
  */
14710
14710
  // PORTING NOTE: Multi-Tab only.
14711
- (n), n.ha = !1, await bu(n.remoteStore, !1);
14711
+ (n), n.ha = !1, await Pu(n.remoteStore, !1);
14712
14712
  }
14713
14713
  }
14714
14714
 
@@ -14763,7 +14763,7 @@ function Ra(t) {
14763
14763
 
14764
14764
  /** Applies a query target change from a different tab. */
14765
14765
  // PORTING NOTE: Multi-Tab only.
14766
- async function Pa(t, e, n, s) {
14766
+ async function ba(t, e, n, s) {
14767
14767
  const i = K(t);
14768
14768
  if (i.ha)
14769
14769
  // If we receive a target state notification via WebStorage, we are
@@ -14789,7 +14789,7 @@ async function Pa(t, e, n, s) {
14789
14789
  }
14790
14790
  }
14791
14791
 
14792
- /** Adds or removes Watch targets for queries from different tabs. */ async function ba(t, e, n) {
14792
+ /** Adds or removes Watch targets for queries from different tabs. */ async function Pa(t, e, n) {
14793
14793
  const s = Va(t);
14794
14794
  if (s.ha) {
14795
14795
  for (const t of e) {
@@ -14977,8 +14977,8 @@ class Da {
14977
14977
  const e = this.ya.syncEngine;
14978
14978
  this.sharedClientState instanceof $o && (this.sharedClientState.syncEngine = {
14979
14979
  Mr: Ia.bind(null, e),
14980
- Or: Pa.bind(null, e),
14981
- Fr: ba.bind(null, e),
14980
+ Or: ba.bind(null, e),
14981
+ Fr: Pa.bind(null, e),
14982
14982
  Fs: Ra.bind(null, e),
14983
14983
  kr: pa.bind(null, e)
14984
14984
  }, await this.sharedClientState.start()),
@@ -15006,7 +15006,7 @@ class Da {
15006
15006
  this.eventManager = this.createEventManager(e), this.syncEngine = this.createSyncEngine(e,
15007
15007
  /* startAsPrimary=*/ !t.synchronizeTabs), this.sharedClientState.onlineStateHandler = t => sa(this.syncEngine, t, 1 /* SharedClientState */),
15008
15008
  this.remoteStore.remoteSyncer.handleCredentialChange = ma.bind(null, this.syncEngine),
15009
- await bu(this.remoteStore, this.syncEngine.isPrimaryClient));
15009
+ await Pu(this.remoteStore, this.syncEngine.isPrimaryClient));
15010
15010
  }
15011
15011
  createEventManager(t) {
15012
15012
  return new Mu;
@@ -15222,8 +15222,8 @@ class Ma {
15222
15222
  const t = await this.Ra();
15223
15223
  if (null === t) return null;
15224
15224
  const e = this.Ea.decode(t), n = Number(e);
15225
- isNaN(n) && this.Pa(`length string (${e}) is not valid number`);
15226
- const s = await this.ba(n);
15225
+ isNaN(n) && this.ba(`length string (${e}) is not valid number`);
15226
+ const s = await this.Pa(n);
15227
15227
  return new qu(JSON.parse(s), t.length + n);
15228
15228
  }
15229
15229
  /** First index of '{' from the underlying buffer. */ Va() {
@@ -15244,7 +15244,7 @@ class Ma {
15244
15244
  const t = this.Va();
15245
15245
  // Broke out of the loop because underlying stream is closed, but still
15246
15246
  // cannot find an open bracket.
15247
- t < 0 && this.Pa("Reached the end of bundle when a length string is expected.");
15247
+ t < 0 && this.ba("Reached the end of bundle when a length string is expected.");
15248
15248
  const e = this.buffer.slice(0, t);
15249
15249
  // Update the internal buffer to drop the read length.
15250
15250
  return this.buffer = this.buffer.slice(t), e;
@@ -15254,15 +15254,15 @@ class Ma {
15254
15254
  * number of bytes, pulling more data from the underlying stream if needed.
15255
15255
  *
15256
15256
  * Returns a string decoded from the read bytes.
15257
- */ async ba(t) {
15257
+ */ async Pa(t) {
15258
15258
  for (;this.buffer.length < t; ) {
15259
- await this.va() && this.Pa("Reached the end of bundle when more is expected.");
15259
+ await this.va() && this.ba("Reached the end of bundle when more is expected.");
15260
15260
  }
15261
15261
  const e = this.Ea.decode(this.buffer.slice(0, t));
15262
15262
  // Update the internal buffer to drop the read json string.
15263
15263
  return this.buffer = this.buffer.slice(t), e;
15264
15264
  }
15265
- Pa(t) {
15265
+ ba(t) {
15266
15266
  // eslint-disable-next-line @typescript-eslint/no-floating-promises
15267
15267
  throw this.Ta.cancel(), new Error(`Invalid bundle format: ${t}`);
15268
15268
  }
@@ -15589,7 +15589,7 @@ async function Ua(t, e) {
15589
15589
  await e.initialize(n, s),
15590
15590
  // The CredentialChangeListener of the online component provider takes
15591
15591
  // precedence over the offline component provider.
15592
- t.setCredentialChangeListener((t => Pu(e.remoteStore, t))), t.setAppCheckTokenChangeListener(((t, n) => Pu(e.remoteStore, n))),
15592
+ t.setCredentialChangeListener((t => bu(e.remoteStore, t))), t.setAppCheckTokenChangeListener(((t, n) => bu(e.remoteStore, n))),
15593
15593
  t.onlineComponents = e;
15594
15594
  }
15595
15595
 
@@ -16482,7 +16482,7 @@ function Tc(t, e, ...n) {
16482
16482
  }
16483
16483
  }
16484
16484
 
16485
- function Pc(t) {
16485
+ function bc(t) {
16486
16486
  /**
16487
16487
  * Returns true if obj is an object and contains at least one of the specified
16488
16488
  * methods.
@@ -16517,7 +16517,7 @@ function Pc(t) {
16517
16517
  */ (t, [ "next", "error", "complete" ]);
16518
16518
  }
16519
16519
 
16520
- class bc {
16520
+ class Pc {
16521
16521
  constructor() {
16522
16522
  this._progressObserver = {}, this._taskCompletionResolver = new j, this._lastProgress = {
16523
16523
  taskState: "Running",
@@ -16886,7 +16886,7 @@ function Oc(t) {
16886
16886
  * updates, and completion or error events. It can be used as a
16887
16887
  * `Promise<LoadBundleTaskProgress>`.
16888
16888
  */ function Uc(t, e) {
16889
- const n = Cc(t = lc(t, vc)), s = new bc;
16889
+ const n = Cc(t = lc(t, vc)), s = new Pc;
16890
16890
  return sc(n, t._databaseId, e, s), s;
16891
16891
  }
16892
16892
 
@@ -17167,7 +17167,7 @@ class Gc {
17167
17167
  this.data = t, this.fieldMask = e, this.fieldTransforms = n;
17168
17168
  }
17169
17169
  toMutation(t, e) {
17170
- return null !== this.fieldMask ? new Vn(t, this.data, this.fieldMask, e, this.fieldTransforms) : new bn(t, this.data, e, this.fieldTransforms);
17170
+ return null !== this.fieldMask ? new Vn(t, this.data, this.fieldMask, e, this.fieldTransforms) : new Pn(t, this.data, e, this.fieldTransforms);
17171
17171
  }
17172
17172
  }
17173
17173
 
@@ -17818,7 +17818,7 @@ function ph(t, e, n, s, i) {
17818
17818
  * For a `DocumentSnapshot` that points to a non-existing document, any data
17819
17819
  * access will return 'undefined'. You can use the `exists()` method to
17820
17820
  * explicitly verify a document's existence.
17821
- */ class Ph extends Th {
17821
+ */ class bh extends Th {
17822
17822
  /** @hideconstructor protected */
17823
17823
  constructor(t, e, n, s, i, r) {
17824
17824
  super(t, e, n, s, r), this._firestore = t, this._firestoreImpl = t, this.metadata = i;
@@ -17846,7 +17846,7 @@ function ph(t, e, n, s, i) {
17846
17846
  if (this._converter) {
17847
17847
  // We only want to use the converter and create a new DocumentSnapshot
17848
17848
  // if a converter has been provided.
17849
- const e = new bh(this._firestore, this._userDataWriter, this._key, this._document, this.metadata,
17849
+ const e = new Ph(this._firestore, this._userDataWriter, this._key, this._document, this.metadata,
17850
17850
  /* converter= */ null);
17851
17851
  return this._converter.fromFirestore(e, t);
17852
17852
  }
@@ -17889,7 +17889,7 @@ function ph(t, e, n, s, i) {
17889
17889
  * `DocumentSnapshot`. Since query results contain only existing documents, the
17890
17890
  * `exists` property will always be true and `data()` will never return
17891
17891
  * 'undefined'.
17892
- */ class bh extends Ph {
17892
+ */ class Ph extends bh {
17893
17893
  /**
17894
17894
  * Retrieves all fields in the document as an `Object`.
17895
17895
  *
@@ -17938,7 +17938,7 @@ function ph(t, e, n, s, i) {
17938
17938
  * @param thisArg - The `this` binding for the callback.
17939
17939
  */ forEach(t, e) {
17940
17940
  this._snapshot.docs.forEach((n => {
17941
- t.call(e, new bh(this._firestore, this._userDataWriter, n.key, n, new Rh(this._snapshot.mutatedKeys.has(n.key), this._snapshot.fromCache), this.query.converter));
17941
+ t.call(e, new Ph(this._firestore, this._userDataWriter, n.key, n, new Rh(this._snapshot.mutatedKeys.has(n.key), this._snapshot.fromCache), this.query.converter));
17942
17942
  }));
17943
17943
  }
17944
17944
  /**
@@ -17959,7 +17959,7 @@ function ph(t, e, n, s, i) {
17959
17959
  let e = 0;
17960
17960
  return t._snapshot.docChanges.map((n => ({
17961
17961
  type: "added",
17962
- doc: new bh(t._firestore, t._userDataWriter, n.doc.key, n.doc, new Rh(t._snapshot.mutatedKeys.has(n.doc.key), t._snapshot.fromCache), t.query.converter),
17962
+ doc: new Ph(t._firestore, t._userDataWriter, n.doc.key, n.doc, new Rh(t._snapshot.mutatedKeys.has(n.doc.key), t._snapshot.fromCache), t.query.converter),
17963
17963
  oldIndex: -1,
17964
17964
  newIndex: e++
17965
17965
  })));
@@ -17969,7 +17969,7 @@ function ph(t, e, n, s, i) {
17969
17969
  // to lookup the index of a document.
17970
17970
  let n = t._snapshot.oldDocs;
17971
17971
  return t._snapshot.docChanges.filter((t => e || 3 /* Metadata */ !== t.type)).map((e => {
17972
- const s = new bh(t._firestore, t._userDataWriter, e.doc.key, e.doc, new Rh(t._snapshot.mutatedKeys.has(e.doc.key), t._snapshot.fromCache), t.query.converter);
17972
+ const s = new Ph(t._firestore, t._userDataWriter, e.doc.key, e.doc, new Rh(t._snapshot.mutatedKeys.has(e.doc.key), t._snapshot.fromCache), t.query.converter);
17973
17973
  let i = -1, r = -1;
17974
17974
  return 0 /* Added */ !== e.type && (i = n.indexOf(e.doc.key), n = n.delete(e.doc.key)),
17975
17975
  1 /* Removed */ !== e.type && (n = n.add(e.doc), r = n.indexOf(e.doc.key)), {
@@ -18010,7 +18010,7 @@ function vh(t) {
18010
18010
  * @param right - A snapshot to compare.
18011
18011
  * @returns true if the snapshots are equal.
18012
18012
  */ function Sh(t, e) {
18013
- return t instanceof Ph && e instanceof Ph ? t._firestore === e._firestore && t._key.isEqual(e._key) && (null === t._document ? null === e._document : t._document.isEqual(e._document)) && t._converter === e._converter : t instanceof Vh && e instanceof Vh && (t._firestore === e._firestore && Ac(t.query, e.query) && t.metadata.isEqual(e.metadata) && t._snapshot.isEqual(e._snapshot));
18013
+ return t instanceof bh && e instanceof bh ? t._firestore === e._firestore && t._key.isEqual(e._key) && (null === t._document ? null === e._document : t._document.isEqual(e._document)) && t._converter === e._converter : t instanceof Vh && e instanceof Vh && (t._firestore === e._firestore && Ac(t.query, e.query) && t.metadata.isEqual(e.metadata) && t._snapshot.isEqual(e._snapshot));
18014
18014
  }
18015
18015
 
18016
18016
  /**
@@ -18426,11 +18426,11 @@ function Hh(t, e, n) {
18426
18426
  convertServerTimestamp(t, e) {
18427
18427
  switch (e) {
18428
18428
  case "previous":
18429
- const n = Pt(t);
18429
+ const n = bt(t);
18430
18430
  return null == n ? null : this.convertValue(n, e);
18431
18431
 
18432
18432
  case "estimate":
18433
- return this.convertTimestamp(bt(t));
18433
+ return this.convertTimestamp(Pt(t));
18434
18434
 
18435
18435
  default:
18436
18436
  return null;
@@ -18655,7 +18655,7 @@ class nl extends Jh {
18655
18655
  */ function sl(t) {
18656
18656
  t = lc(t, mc);
18657
18657
  const e = lc(t.firestore, vc), n = Cc(e), s = new nl(e);
18658
- return Ya(n, t._key).then((n => new Ph(e, s, t._key, n, new Rh(null !== n && n.hasLocalMutations,
18658
+ return Ya(n, t._key).then((n => new bh(e, s, t._key, n, new Rh(null !== n && n.hasLocalMutations,
18659
18659
  /* fromCache= */ !0), t.converter)));
18660
18660
  }
18661
18661
 
@@ -18759,11 +18759,11 @@ function fl(t, ...e) {
18759
18759
  let r = {
18760
18760
  includeMetadataChanges: !1
18761
18761
  }, o = 0;
18762
- "object" != typeof e[o] || Pc(e[o]) || (r = e[o], o++);
18762
+ "object" != typeof e[o] || bc(e[o]) || (r = e[o], o++);
18763
18763
  const u = {
18764
18764
  includeMetadataChanges: r.includeMetadataChanges
18765
18765
  };
18766
- if (Pc(e[o])) {
18766
+ if (bc(e[o])) {
18767
18767
  const t = e[o];
18768
18768
  e[o] = null === (n = t.next) || void 0 === n ? void 0 : n.bind(t), e[o + 1] = null === (s = t.error) || void 0 === s ? void 0 : s.bind(t),
18769
18769
  e[o + 2] = null === (i = t.complete) || void 0 === i ? void 0 : i.bind(t);
@@ -18796,7 +18796,7 @@ function fl(t, ...e) {
18796
18796
  }
18797
18797
 
18798
18798
  function dl(t, e) {
18799
- return ec(Cc(t = lc(t, vc)), Pc(e) ? e : {
18799
+ return ec(Cc(t = lc(t, vc)), bc(e) ? e : {
18800
18800
  next: e
18801
18801
  });
18802
18802
  }
@@ -18816,7 +18816,7 @@ function dl(t, e) {
18816
18816
  * to a {@link DocumentSnapshot}.
18817
18817
  */ function wl(t, e, n) {
18818
18818
  const s = n.docs.get(e._key), i = new nl(t);
18819
- return new Ph(t, i, e._key, s, new Rh(n.hasPendingWrites, n.fromCache), e.converter);
18819
+ return new bh(t, i, e._key, s, new Rh(n.hasPendingWrites, n.fromCache), e.converter);
18820
18820
  }
18821
18821
 
18822
18822
  /**
@@ -18896,7 +18896,7 @@ function dl(t, e) {
18896
18896
  * @returns A `DocumentSnapshot` with the read data.
18897
18897
  */ get(t) {
18898
18898
  const e = tl(t, this._firestore), n = new nl(this._firestore);
18899
- return super.get(t).then((t => new Ph(this._firestore, n, e._key, t._document, new Rh(
18899
+ return super.get(t).then((t => new bh(this._firestore, n, e._key, t._document, new Rh(
18900
18900
  /* hasPendingWrites= */ !1,
18901
18901
  /* fromCache= */ !1), e.converter)));
18902
18902
  }
@@ -19064,9 +19064,9 @@ function dl(t, e) {
19064
19064
  // PORTING NOTE: We don't return an error if the user has not enabled
19065
19065
  // persistence since `enableIndexeddbPersistence()` can fail on the Web.
19066
19066
  if (Array.isArray(n.indexes)) for (const t of n.indexes) {
19067
- const e = Pl(t, "collectionGroup"), n = [];
19067
+ const e = bl(t, "collectionGroup"), n = [];
19068
19068
  if (Array.isArray(t.fields)) for (const e of t.fields) {
19069
- const t = yh("setIndexConfiguration", Pl(e, "fieldPath"));
19069
+ const t = yh("setIndexConfiguration", bl(e, "fieldPath"));
19070
19070
  "CONTAINS" === e.arrayConfig ? n.push(new oe(t, 2 /* CONTAINS */)) : "ASCENDING" === e.order ? n.push(new oe(t, 0 /* ASCENDING */)) : "DESCENDING" === e.order && n.push(new oe(t, 1 /* DESCENDING */));
19071
19071
  }
19072
19072
  s.push(new se(se.UNKNOWN_ID, e, n, ue.empty()));
@@ -19075,7 +19075,7 @@ function dl(t, e) {
19075
19075
  return Promise.resolve();
19076
19076
  }
19077
19077
 
19078
- function Pl(t, e) {
19078
+ function bl(t, e) {
19079
19079
  if ("string" != typeof t[e]) throw new Q(G.INVALID_ARGUMENT, "Missing string value for: " + e);
19080
19080
  return t[e];
19081
19081
  }
@@ -19092,10 +19092,10 @@ function Pl(t, e) {
19092
19092
  return n = Object.assign({
19093
19093
  useFetchStreams: e
19094
19094
  }, n), i._setSettings(n), i;
19095
- }), "PUBLIC")), registerVersion(D, "3.4.7-canary.7a4e65cef", t),
19095
+ }), "PUBLIC")), registerVersion(D, "3.4.7-canary.e9e5f6b3c", t),
19096
19096
  // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation
19097
- registerVersion(D, "3.4.7-canary.7a4e65cef", "esm2017");
19097
+ registerVersion(D, "3.4.7-canary.e9e5f6b3c", "esm2017");
19098
19098
  }();
19099
19099
 
19100
- export { Jh as AbstractUserDataWriter, jc as Bytes, Vc as CACHE_SIZE_UNLIMITED, yc as CollectionReference, mc as DocumentReference, Ph as DocumentSnapshot, Gc as FieldPath, Wc as FieldValue, vc as Firestore, Q as FirestoreError, zc as GeoPoint, bc as LoadBundleTask, gc as Query, Ch as QueryConstraint, bh as QueryDocumentSnapshot, Vh as QuerySnapshot, Rh as SnapshotMetadata, at as Timestamp, ml as Transaction, Zh as WriteBatch, vt as _DatabaseId, xt as _DocumentKey, et as _EmptyAppCheckTokenProvider, z as _EmptyAuthCredentialsProvider, mt as _FieldPath, lc as _cast, q as _debugAssert, yt as _isBase64Available, $ as _logWarn, Rl as _setIndexConfiguration, uc as _validateIsNotUsedTogether, ll as addDoc, Tl as arrayRemove, Il as arrayUnion, Oc as clearIndexedDbPersistence, pc as collection, Ic as collectionGroup, wc as connectFirestoreEmulator, hl as deleteDoc, yl as deleteField, Bc as disableNetwork, Tc as doc, Qc as documentId, Nc as enableIndexedDbPersistence, kc as enableMultiTabIndexedDbPersistence, $c as enableNetwork, Qh as endAt, Gh as endBefore, Cc as ensureFirestoreConfigured, _l as executeWrite, el as getDoc, sl as getDocFromCache, il as getDocFromServer, rl as getDocs, ol as getDocsFromCache, ul as getDocsFromServer, Dc as getFirestore, El as increment, Sc as initializeFirestore, $h as limit, Bh as limitToLast, Uc as loadBundle, qc as namedQuery, fl as onSnapshot, dl as onSnapshotsInSync, Oh as orderBy, xh as query, Ac as queryEqual, Ec as refEqual, gl as runTransaction, pl as serverTimestamp, al as setDoc, M as setLogLevel, Sh as snapshotEqual, qh as startAfter, Uh as startAt, Lc as terminate, cl as updateDoc, Fc as waitForPendingWrites, kh as where, Al as writeBatch };
19100
+ export { Jh as AbstractUserDataWriter, jc as Bytes, Vc as CACHE_SIZE_UNLIMITED, yc as CollectionReference, mc as DocumentReference, bh as DocumentSnapshot, Gc as FieldPath, Wc as FieldValue, vc as Firestore, Q as FirestoreError, zc as GeoPoint, Pc as LoadBundleTask, gc as Query, Ch as QueryConstraint, Ph as QueryDocumentSnapshot, Vh as QuerySnapshot, Rh as SnapshotMetadata, at as Timestamp, ml as Transaction, Zh as WriteBatch, vt as _DatabaseId, xt as _DocumentKey, et as _EmptyAppCheckTokenProvider, z as _EmptyAuthCredentialsProvider, mt as _FieldPath, lc as _cast, q as _debugAssert, yt as _isBase64Available, $ as _logWarn, Rl as _setIndexConfiguration, uc as _validateIsNotUsedTogether, ll as addDoc, Tl as arrayRemove, Il as arrayUnion, Oc as clearIndexedDbPersistence, pc as collection, Ic as collectionGroup, wc as connectFirestoreEmulator, hl as deleteDoc, yl as deleteField, Bc as disableNetwork, Tc as doc, Qc as documentId, Nc as enableIndexedDbPersistence, kc as enableMultiTabIndexedDbPersistence, $c as enableNetwork, Qh as endAt, Gh as endBefore, Cc as ensureFirestoreConfigured, _l as executeWrite, el as getDoc, sl as getDocFromCache, il as getDocFromServer, rl as getDocs, ol as getDocsFromCache, ul as getDocsFromServer, Dc as getFirestore, El as increment, Sc as initializeFirestore, $h as limit, Bh as limitToLast, Uc as loadBundle, qc as namedQuery, fl as onSnapshot, dl as onSnapshotsInSync, Oh as orderBy, xh as query, Ac as queryEqual, Ec as refEqual, gl as runTransaction, pl as serverTimestamp, al as setDoc, M as setLogLevel, Sh as snapshotEqual, qh as startAfter, Uh as startAt, Lc as terminate, cl as updateDoc, Fc as waitForPendingWrites, kh as where, Al as writeBatch };
19101
19101
  //# sourceMappingURL=index.esm2017.js.map