@firebase/firestore 3.4.4-canary.aaeab08ac → 3.4.4-canary.dd86989b3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  import { __extends as t, __spreadArray as e, __awaiter as n, __generator as r } from "tslib";
2
2
 
3
- import { SDK_VERSION as i, _registerComponent as o, registerVersion as s, _getProvider, getApp as a, _removeServiceInstance as u } from "@firebase/app";
3
+ import { SDK_VERSION as i, _registerComponent as o, registerVersion as s, _getProvider, getApp as u, _removeServiceInstance as a } from "@firebase/app";
4
4
 
5
5
  import { Component as c } from "@firebase/component";
6
6
 
@@ -70,7 +70,7 @@ O.MOCK_USER = new O("mock-user");
70
70
  * See the License for the specific language governing permissions and
71
71
  * limitations under the License.
72
72
  */
73
- var M = "9.6.5-canary.aaeab08ac", F = new h("@firebase/firestore");
73
+ var M = "9.6.5-canary.dd86989b3", F = new h("@firebase/firestore");
74
74
 
75
75
  /**
76
76
  * @license
@@ -430,14 +430,14 @@ e) {
430
430
  return t.prototype.start = function(t, e) {
431
431
  var i = this, o = this.i, s = function(t) {
432
432
  return i.i !== o ? (o = i.i, e(t)) : Promise.resolve();
433
- }, a = new J;
433
+ }, u = new J;
434
434
  this.o = function() {
435
- i.i++, i.currentUser = i.u(), a.resolve(), a = new J, t.enqueueRetryable((function() {
435
+ i.i++, i.currentUser = i.u(), u.resolve(), u = new J, t.enqueueRetryable((function() {
436
436
  return s(i.currentUser);
437
437
  }));
438
438
  };
439
- var u = function() {
440
- var e = a;
439
+ var a = function() {
440
+ var e = u;
441
441
  t.enqueueRetryable((function() {
442
442
  return n(i, void 0, void 0, (function() {
443
443
  return r(this, (function(t) {
@@ -456,7 +456,7 @@ e) {
456
456
  }));
457
457
  }, c = function(t) {
458
458
  U("FirebaseAuthCredentialsProvider", "Auth detected"), i.auth = t, i.auth.addAuthTokenListener(i.o),
459
- u();
459
+ a();
460
460
  };
461
461
  this.t.onInit((function(t) {
462
462
  return c(t);
@@ -471,9 +471,9 @@ e) {
471
471
  });
472
472
  t ? c(t) : (
473
473
  // If auth is still not available, proceed with `null` user
474
- U("FirebaseAuthCredentialsProvider", "Auth not yet detected"), a.resolve(), a = new J);
474
+ U("FirebaseAuthCredentialsProvider", "Auth not yet detected"), u.resolve(), u = new J);
475
475
  }
476
- }), 0), u();
476
+ }), 0), a();
477
477
  }, t.prototype.getToken = function() {
478
478
  var t = this, e = this.i, n = this.forceRefresh;
479
479
  // Take note of the current value of the tokenCounter so that this method
@@ -605,7 +605,7 @@ e) {
605
605
  *
606
606
  * If `nBytes < 0` , an error will be thrown.
607
607
  */
608
- function at(t) {
608
+ function ut(t) {
609
609
  // Polyfills for IE and WebWorker by using `self` and `msCrypto` when `crypto` is not available.
610
610
  var e =
611
611
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -633,14 +633,14 @@ function at(t) {
633
633
  * limitations under the License.
634
634
  */ st.I = -1;
635
635
 
636
- var ut = /** @class */ function() {
636
+ var at = /** @class */ function() {
637
637
  function t() {}
638
638
  return t.A = function() {
639
639
  for (
640
640
  // Alphanumeric characters
641
641
  var t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", e = Math.floor(256 / t.length) * t.length, n = ""
642
642
  // The largest byte value that is a multiple of `char.length`.
643
- ; n.length < 20; ) for (var r = at(40), i = 0; i < r.length; ++i)
643
+ ; n.length < 20; ) for (var r = ut(40), i = 0; i < r.length; ++i)
644
644
  // Only accept values that are [0, maxMultiple), this ensures they can
645
645
  // be evenly mapped to indices of `chars` via a modulo operation.
646
646
  n.length < 20 && r[i] < e && (n += t.charAt(r[i] % t.length));
@@ -1039,13 +1039,13 @@ function vt(t) {
1039
1039
  if (0 === r.length) throw new Y(H.INVALID_ARGUMENT, "Invalid field path (" + t + "). Paths must not be empty, begin with '.', end with '.', or contain '..'");
1040
1040
  e.push(r), r = "";
1041
1041
  }, s = !1; i < t.length; ) {
1042
- var a = t[i];
1043
- if ("\\" === a) {
1042
+ var u = t[i];
1043
+ if ("\\" === u) {
1044
1044
  if (i + 1 === t.length) throw new Y(H.INVALID_ARGUMENT, "Path has trailing escape character: " + t);
1045
- var u = t[i + 1];
1046
- if ("\\" !== u && "." !== u && "`" !== u) throw new Y(H.INVALID_ARGUMENT, "Path has invalid escape sequence: " + t);
1047
- r += u, i += 2;
1048
- } else "`" === a ? (s = !s, i++) : "." !== a || s ? (r += a, i++) : (o(), i++);
1045
+ var a = t[i + 1];
1046
+ if ("\\" !== a && "." !== a && "`" !== a) throw new Y(H.INVALID_ARGUMENT, "Path has invalid escape sequence: " + t);
1047
+ r += a, i += 2;
1048
+ } else "`" === u ? (s = !s, i++) : "." !== u || s ? (r += u, i++) : (o(), i++);
1049
1049
  }
1050
1050
  if (o(), s) throw new Y(H.INVALID_ARGUMENT, "Unterminated ` in path: " + t);
1051
1051
  return new n(e);
@@ -1524,10 +1524,10 @@ function Vt(t, e) {
1524
1524
  // canonical IDs are independent of insertion order.
1525
1525
  r.sort(), o.sort();
1526
1526
  for (var s = 0; s < r.length && s < o.length; ++s) {
1527
- var a = ct(r[s], o[s]);
1528
- if (0 !== a) return a;
1529
- var u = Vt(n[r[s]], i[o[s]]);
1527
+ var u = ct(r[s], o[s]);
1530
1528
  if (0 !== u) return u;
1529
+ var a = Vt(n[r[s]], i[o[s]]);
1530
+ if (0 !== a) return a;
1531
1531
  }
1532
1532
  return ct(r.length, o.length);
1533
1533
  }(t.mapValue, e.mapValue);
@@ -1753,8 +1753,8 @@ function jt(t, e) {
1753
1753
  // For nested and non-empty ObjectValues, add the FieldPath of the
1754
1754
  // leaf nodes.
1755
1755
  for (var o = 0, s = i; o < s.length; o++) {
1756
- var a = s[o];
1757
- e.push(r.child(a));
1756
+ var u = s[o];
1757
+ e.push(r.child(u));
1758
1758
  }
1759
1759
  } else
1760
1760
  // For nested and non-empty ObjectValues, add the FieldPath of the leaf
@@ -1969,7 +1969,7 @@ var re = /** @class */ function(e) {
1969
1969
  /**
1970
1970
  * Creates a filter based on the provided arguments.
1971
1971
  */ return t(n, e), n.create = function(t, e, r) {
1972
- return t.isKeyField() ? "in" /* IN */ === e || "not-in" /* NOT_IN */ === e ? this.P(t, e, r) : new ie(t, e, r) : "array-contains" /* ARRAY_CONTAINS */ === e ? new ue(t, r) : "in" /* IN */ === e ? new ce(t, r) : "not-in" /* NOT_IN */ === e ? new he(t, r) : "array-contains-any" /* ARRAY_CONTAINS_ANY */ === e ? new fe(t, r) : new n(t, e, r);
1972
+ return t.isKeyField() ? "in" /* IN */ === e || "not-in" /* NOT_IN */ === e ? this.P(t, e, r) : new ie(t, e, r) : "array-contains" /* ARRAY_CONTAINS */ === e ? new ae(t, r) : "in" /* IN */ === e ? new ce(t, r) : "not-in" /* NOT_IN */ === e ? new he(t, r) : "array-contains-any" /* ARRAY_CONTAINS_ANY */ === e ? new fe(t, r) : new n(t, e, r);
1973
1973
  }, n.P = function(t, e, n) {
1974
1974
  return "in" /* IN */ === e ? new oe(t, n) : new se(t, n);
1975
1975
  }, n.prototype.matches = function(t) {
@@ -2018,7 +2018,7 @@ var ie = /** @class */ function(e) {
2018
2018
  }(re), oe = /** @class */ function(e) {
2019
2019
  function n(t, n) {
2020
2020
  var r = this;
2021
- return (r = e.call(this, t, "in" /* IN */ , n) || this).keys = ae("in" /* IN */ , n),
2021
+ return (r = e.call(this, t, "in" /* IN */ , n) || this).keys = ue("in" /* IN */ , n),
2022
2022
  r;
2023
2023
  }
2024
2024
  return t(n, e), n.prototype.matches = function(t) {
@@ -2029,7 +2029,7 @@ var ie = /** @class */ function(e) {
2029
2029
  }(re), se = /** @class */ function(e) {
2030
2030
  function n(t, n) {
2031
2031
  var r = this;
2032
- return (r = e.call(this, t, "not-in" /* NOT_IN */ , n) || this).keys = ae("not-in" /* NOT_IN */ , n),
2032
+ return (r = e.call(this, t, "not-in" /* NOT_IN */ , n) || this).keys = ue("not-in" /* NOT_IN */ , n),
2033
2033
  r;
2034
2034
  }
2035
2035
  return t(n, e), n.prototype.matches = function(t) {
@@ -2039,14 +2039,14 @@ var ie = /** @class */ function(e) {
2039
2039
  }, n;
2040
2040
  }(re);
2041
2041
 
2042
- /** Filter that matches on key fields within an array. */ function ae(t, e) {
2042
+ /** Filter that matches on key fields within an array. */ function ue(t, e) {
2043
2043
  var n;
2044
2044
  return ((null === (n = e.arrayValue) || void 0 === n ? void 0 : n.values) || []).map((function(t) {
2045
2045
  return Pt.fromName(t.referenceValue);
2046
2046
  }));
2047
2047
  }
2048
2048
 
2049
- /** A Filter that implements the array-contains operator. */ var ue = /** @class */ function(e) {
2049
+ /** A Filter that implements the array-contains operator. */ var ae = /** @class */ function(e) {
2050
2050
  function n(t, n) {
2051
2051
  return e.call(this, t, "array-contains" /* ARRAY_CONTAINS */ , n) || this;
2052
2052
  }
@@ -2151,18 +2151,18 @@ function me(t, e) {
2151
2151
  * Initializes a Query with a path and optional additional query constraints.
2152
2152
  * Path must currently be empty if this is a collection group query.
2153
2153
  */
2154
- function(t, e, n, r, i, o /* First */ , s, a) {
2154
+ function(t, e, n, r, i, o /* First */ , s, u) {
2155
2155
  void 0 === e && (e = null), void 0 === n && (n = []), void 0 === r && (r = []),
2156
2156
  void 0 === i && (i = null), void 0 === o && (o = "F"), void 0 === s && (s = null),
2157
- void 0 === a && (a = null), this.path = t, this.collectionGroup = e, this.explicitOrderBy = n,
2158
- this.filters = r, this.limit = i, this.limitType = o, this.startAt = s, this.endAt = a,
2157
+ void 0 === u && (u = null), this.path = t, this.collectionGroup = e, this.explicitOrderBy = n,
2158
+ this.filters = r, this.limit = i, this.limitType = o, this.startAt = s, this.endAt = u,
2159
2159
  this.S = null,
2160
2160
  // The corresponding `Target` of this `Query` instance.
2161
2161
  this.D = null, this.startAt, this.endAt;
2162
2162
  };
2163
2163
 
2164
- /** Creates a new Query instance with the options provided. */ function we(t, e, n, r, i, o, s, a) {
2165
- return new ge(t, e, n, r, i, o, s, a);
2164
+ /** Creates a new Query instance with the options provided. */ function we(t, e, n, r, i, o, s, u) {
2165
+ return new ge(t, e, n, r, i, o, s, u);
2166
2166
  }
2167
2167
 
2168
2168
  /** Creates a new Query for a query that matches all documents at `path` */ function be(t) {
@@ -2220,14 +2220,14 @@ function Se(t) {
2220
2220
  // Note that the default inequality field and key ordering is ascending.
2221
2221
  n.isKeyField() || e.S.push(new pe(n)), e.S.push(new pe(bt.keyField(), "asc" /* ASCENDING */)); else {
2222
2222
  for (var i = !1, o = 0, s = e.explicitOrderBy; o < s.length; o++) {
2223
- var a = s[o];
2224
- e.S.push(a), a.field.isKeyField() && (i = !0);
2223
+ var u = s[o];
2224
+ e.S.push(u), u.field.isKeyField() && (i = !0);
2225
2225
  }
2226
2226
  if (!i) {
2227
2227
  // The order of the implicit key ordering always matches the last
2228
2228
  // explicit order by
2229
- var u = e.explicitOrderBy.length > 0 ? e.explicitOrderBy[e.explicitOrderBy.length - 1].dir : "asc" /* ASCENDING */;
2230
- e.S.push(new pe(bt.keyField(), u));
2229
+ var a = e.explicitOrderBy.length > 0 ? e.explicitOrderBy[e.explicitOrderBy.length - 1].dir : "asc" /* ASCENDING */;
2230
+ e.S.push(new pe(bt.keyField(), a));
2231
2231
  }
2232
2232
  }
2233
2233
  }
@@ -2246,9 +2246,9 @@ function Se(t) {
2246
2246
  n.push(new pe(o.field, s));
2247
2247
  }
2248
2248
  // We need to swap the cursors to match the now-flipped query ordering.
2249
- var a = e.endAt ? new le(e.endAt.position, !e.endAt.before) : null, u = e.startAt ? new le(e.startAt.position, !e.startAt.before) : null;
2249
+ var u = e.endAt ? new le(e.endAt.position, !e.endAt.before) : null, a = e.startAt ? new le(e.startAt.position, !e.startAt.before) : null;
2250
2250
  // Now return as a LimitType.First query.
2251
- e.D = Zt(e.path, e.collectionGroup, n, e.filters, e.limit, a, u);
2251
+ e.D = Zt(e.path, e.collectionGroup, n, e.filters, e.limit, u, a);
2252
2252
  }
2253
2253
  return e.D;
2254
2254
  }
@@ -2309,8 +2309,8 @@ function xe(t) {
2309
2309
  function Le(t) {
2310
2310
  return function(e, n) {
2311
2311
  for (var r = !1, i = 0, o = Ae(t); i < o.length; i++) {
2312
- var s = o[i], a = Pe(s, e, n);
2313
- if (0 !== a) return a;
2312
+ var s = o[i], u = Pe(s, e, n);
2313
+ if (0 !== u) return u;
2314
2314
  r = r || s.field.isKeyField();
2315
2315
  }
2316
2316
  return 0;
@@ -2675,13 +2675,13 @@ e) {
2675
2675
  * of the document.
2676
2676
  * @param mutationResult - The result of applying the mutation from the backend.
2677
2677
  */ function en(t, e, n) {
2678
- t instanceof an ? function(t, e, n) {
2678
+ t instanceof un ? function(t, e, n) {
2679
2679
  // Unlike setMutationApplyToLocalView, if we're applying a mutation to a
2680
2680
  // remote document the server has accepted the mutation so the precondition
2681
2681
  // must have held.
2682
2682
  var r = t.value.clone(), i = hn(t.fieldTransforms, e, n.transformResults);
2683
2683
  r.setAll(i), e.convertToFoundDocument(n.version, r).setHasCommittedMutations();
2684
- }(t, e, n) : t instanceof un ? function(t, e, n) {
2684
+ }(t, e, n) : t instanceof an ? function(t, e, n) {
2685
2685
  if (Ze(t.precondition, e)) {
2686
2686
  var r = hn(t.fieldTransforms, e, n.transformResults), i = e.data;
2687
2687
  i.setAll(cn(t)), i.setAll(r), e.convertToFoundDocument(n.version, i).setHasCommittedMutations();
@@ -2706,12 +2706,12 @@ e) {
2706
2706
  * @param localWriteTime - A timestamp indicating the local write time of the
2707
2707
  * batch this mutation is a part of.
2708
2708
  */ function nn(t, e, n) {
2709
- t instanceof an ? function(t, e, n) {
2709
+ t instanceof un ? function(t, e, n) {
2710
2710
  if (Ze(t.precondition, e)) {
2711
2711
  var r = t.value.clone(), i = fn(t.fieldTransforms, n, e);
2712
2712
  r.setAll(i), e.convertToFoundDocument(sn(e), r).setHasLocalMutations();
2713
2713
  }
2714
- }(t, e, n) : t instanceof un ? function(t, e, n) {
2714
+ }(t, e, n) : t instanceof an ? function(t, e, n) {
2715
2715
  if (Ze(t.precondition, e)) {
2716
2716
  var r = fn(t.fieldTransforms, n, e), i = e.data;
2717
2717
  i.setAll(cn(t)), i.setAll(r), e.convertToFoundDocument(sn(e), i).setHasLocalMutations();
@@ -2741,8 +2741,8 @@ e) {
2741
2741
  * idempotent mutations.
2742
2742
  */ function rn(t, e) {
2743
2743
  for (var n = null, r = 0, i = t.fieldTransforms; r < i.length; r++) {
2744
- var o = i[r], s = e.data.field(o.field), a = Be(o.transform, s || null);
2745
- null != a && (null == n && (n = Yt.empty()), n.set(o.field, a));
2744
+ var o = i[r], s = e.data.field(o.field), u = Be(o.transform, s || null);
2745
+ null != u && (null == n && (n = Yt.empty()), n.set(o.field, u));
2746
2746
  }
2747
2747
  return n || null;
2748
2748
  }
@@ -2771,7 +2771,7 @@ function on(t, e) {
2771
2771
  /**
2772
2772
  * A mutation that creates or replaces the document at the given key with the
2773
2773
  * object value contents.
2774
- */ var an = /** @class */ function(e) {
2774
+ */ var un = /** @class */ function(e) {
2775
2775
  function n(t, n, r, i) {
2776
2776
  void 0 === i && (i = []);
2777
2777
  var o = this;
@@ -2779,7 +2779,7 @@ function on(t, e) {
2779
2779
  o.type = 0 /* Set */ , o;
2780
2780
  }
2781
2781
  return t(n, e), n;
2782
- }(tn), un = /** @class */ function(e) {
2782
+ }(tn), an = /** @class */ function(e) {
2783
2783
  function n(t, n, r, i, o) {
2784
2784
  void 0 === o && (o = []);
2785
2785
  var s = this;
@@ -2814,8 +2814,8 @@ function hn(t, e, n) {
2814
2814
  var r = new Map;
2815
2815
  z(t.length === n.length);
2816
2816
  for (var i = 0; i < n.length; i++) {
2817
- var o = t[i], s = o.transform, a = e.data.field(o.field);
2818
- r.set(o.field, Ue(s, a, n[i]));
2817
+ var o = t[i], s = o.transform, u = e.data.field(o.field);
2818
+ r.set(o.field, Ue(s, u, n[i]));
2819
2819
  }
2820
2820
  return r;
2821
2821
  }
@@ -2833,8 +2833,8 @@ function hn(t, e, n) {
2833
2833
  * @returns The transform results list.
2834
2834
  */ function fn(t, e, n) {
2835
2835
  for (var r = new Map, i = 0, o = t; i < o.length; i++) {
2836
- var s = o[i], a = s.transform, u = n.data.field(s.field);
2837
- r.set(s.field, qe(a, u, e));
2836
+ var s = o[i], u = s.transform, a = n.data.field(s.field);
2837
+ r.set(s.field, qe(u, a, e));
2838
2838
  }
2839
2839
  return r;
2840
2840
  }
@@ -4079,11 +4079,11 @@ function ir(t, e, n) {
4079
4079
 
4080
4080
  function or(t, e) {
4081
4081
  var n;
4082
- if (e instanceof an) n = {
4082
+ if (e instanceof un) n = {
4083
4083
  update: rr(t, e.key, e.value)
4084
4084
  }; else if (e instanceof pn) n = {
4085
4085
  delete: Xn(t, e.key)
4086
- }; else if (e instanceof un) n = {
4086
+ }; else if (e instanceof an) n = {
4087
4087
  update: rr(t, e.key, e.data),
4088
4088
  updateMask: wr(e.fieldMask)
4089
4089
  }; else {
@@ -4157,28 +4157,28 @@ function sr(t, e) {
4157
4157
  return bt.fromServerFormat(t);
4158
4158
  })));
4159
4159
  }(e.updateMask);
4160
- return new un(i, o, s, n, r);
4160
+ return new an(i, o, s, n, r);
4161
4161
  }
4162
- return new an(i, o, n, r);
4162
+ return new un(i, o, n, r);
4163
4163
  }
4164
4164
  if (e.delete) {
4165
- var a = $n(t, e.delete);
4166
- return new pn(a, n);
4165
+ var u = $n(t, e.delete);
4166
+ return new pn(u, n);
4167
4167
  }
4168
4168
  if (e.verify) {
4169
- var u = $n(t, e.verify);
4170
- return new yn(u, n);
4169
+ var a = $n(t, e.verify);
4170
+ return new yn(a, n);
4171
4171
  }
4172
4172
  return G();
4173
4173
  }
4174
4174
 
4175
- function ar(t, e) {
4175
+ function ur(t, e) {
4176
4176
  return {
4177
4177
  documents: [ Zn(t, e.path) ]
4178
4178
  };
4179
4179
  }
4180
4180
 
4181
- function ur(t, e) {
4181
+ function ar(t, e) {
4182
4182
  // Dissect the path into parent, collectionId, and optional key filter.
4183
4183
  var n = {
4184
4184
  structuredQuery: {}
@@ -4269,8 +4269,8 @@ function cr(t) {
4269
4269
  }
4270
4270
  var s = [];
4271
4271
  n.where && (s = hr(n.where));
4272
- var a = [];
4273
- n.orderBy && (a = n.orderBy.map((function(t) {
4272
+ var u = [];
4273
+ n.orderBy && (u = n.orderBy.map((function(t) {
4274
4274
  return function(t) {
4275
4275
  return new pe(vr(t.field),
4276
4276
  // visible for testing
@@ -4288,15 +4288,15 @@ function cr(t) {
4288
4288
  }(t.direction));
4289
4289
  }(t);
4290
4290
  })));
4291
- var u = null;
4292
- n.limit && (u = function(t) {
4291
+ var a = null;
4292
+ n.limit && (a = function(t) {
4293
4293
  var e;
4294
4294
  return xt(e = "object" == typeof t ? t.value : t) ? null : e;
4295
4295
  }(n.limit));
4296
4296
  var c = null;
4297
4297
  n.startAt && (c = lr(n.startAt));
4298
4298
  var h = null;
4299
- return n.endAt && (h = lr(n.endAt)), we(e, i, a, s, u, "F" /* First */ , c, h);
4299
+ return n.endAt && (h = lr(n.endAt)), we(e, i, u, s, a, "F" /* First */ , c, h);
4300
4300
  }
4301
4301
 
4302
4302
  function hr(t) {
@@ -4486,11 +4486,11 @@ function br(t) {
4486
4486
  var s = t.indexOf("", o);
4487
4487
  switch ((s < 0 || s > n) && G(), t.charAt(s + 1)) {
4488
4488
  case "":
4489
- var a = t.substring(o, s), u = void 0;
4489
+ var u = t.substring(o, s), a = void 0;
4490
4490
  0 === i.length ?
4491
4491
  // Avoid copying for the common case of a segment that excludes \0
4492
4492
  // and \001
4493
- u = a : (u = i += a, i = ""), r.push(u);
4493
+ a = u : (a = i += u, i = ""), r.push(a);
4494
4494
  break;
4495
4495
 
4496
4496
  case "":
@@ -5307,39 +5307,39 @@ var Br = e(e([], e(e([], e(e([], e(e([], [ kr.store, Dr.store, Nr.store, Rr.stor
5307
5307
  });
5308
5308
  }, t.prototype.runTransaction = function(t, e, i, o) {
5309
5309
  return n(this, void 0, void 0, (function() {
5310
- var n, s, a, u, c;
5310
+ var n, s, u, a, c;
5311
5311
  return r(this, (function(h) {
5312
5312
  switch (h.label) {
5313
5313
  case 0:
5314
- n = "readonly" === e, s = 0, a = function() {
5315
- var e, a, c, h, f;
5314
+ n = "readonly" === e, s = 0, u = function() {
5315
+ var e, u, c, h, f;
5316
5316
  return r(this, (function(r) {
5317
5317
  switch (r.label) {
5318
5318
  case 0:
5319
5319
  ++s, r.label = 1;
5320
5320
 
5321
5321
  case 1:
5322
- return r.trys.push([ 1, 4, , 5 ]), [ 4 /*yield*/ , u.Ct(t) ];
5322
+ return r.trys.push([ 1, 4, , 5 ]), [ 4 /*yield*/ , a.Ct(t) ];
5323
5323
 
5324
5324
  case 2:
5325
5325
  // Wait for the transaction to complete (i.e. IndexedDb's onsuccess event to
5326
5326
  // fire), but still return the original transactionFnResult back to the
5327
5327
  // caller.
5328
- return u.db = r.sent(), e = zr.open(u.db, t, n ? "readonly" : "readwrite", i), a = o(e).catch((function(t) {
5328
+ return a.db = r.sent(), e = zr.open(a.db, t, n ? "readonly" : "readwrite", i), u = o(e).catch((function(t) {
5329
5329
  // Abort the transaction if there was an error.
5330
5330
  return e.abort(t), Gr.reject(t);
5331
- })).toPromise(), c = {}, a.catch((function() {})), [ 4 /*yield*/ , e.At ];
5331
+ })).toPromise(), c = {}, u.catch((function() {})), [ 4 /*yield*/ , e.At ];
5332
5332
 
5333
5333
  case 3:
5334
5334
  return [ 2 /*return*/ , (c.value = (
5335
5335
  // Wait for the transaction to complete (i.e. IndexedDb's onsuccess event to
5336
5336
  // fire), but still return the original transactionFnResult back to the
5337
5337
  // caller.
5338
- r.sent(), a), c) ];
5338
+ r.sent(), u), c) ];
5339
5339
 
5340
5340
  case 4:
5341
5341
  return h = r.sent(), f = "FirebaseError" !== h.name && s < 3, U("SimpleDb", "Transaction failed with error:", h.message, "Retrying:", f),
5342
- u.close(), f ? [ 3 /*break*/ , 5 ] : [ 2 /*return*/ , {
5342
+ a.close(), f ? [ 3 /*break*/ , 5 ] : [ 2 /*return*/ , {
5343
5343
  value: Promise.reject(h)
5344
5344
  } ];
5345
5345
 
@@ -5347,10 +5347,10 @@ var Br = e(e([], e(e([], e(e([], e(e([], [ kr.store, Dr.store, Nr.store, Rr.stor
5347
5347
  return [ 2 /*return*/ ];
5348
5348
  }
5349
5349
  }));
5350
- }, u = this, h.label = 1;
5350
+ }, a = this, h.label = 1;
5351
5351
 
5352
5352
  case 1:
5353
- return [ 5 /*yield**/ , a() ];
5353
+ return [ 5 /*yield**/ , u() ];
5354
5354
 
5355
5355
  case 2:
5356
5356
  if ("object" == typeof (c = h.sent())) return [ 2 /*return*/ , c.value ];
@@ -5542,10 +5542,10 @@ var Br = e(e([], e(e([], e(e([], e(e([], [ kr.store, Dr.store, Nr.store, Rr.stor
5542
5542
  if (i) {
5543
5543
  var o = new Wr(i), s = e(i.primaryKey, i.value, o);
5544
5544
  if (s instanceof Gr) {
5545
- var a = s.catch((function(t) {
5545
+ var u = s.catch((function(t) {
5546
5546
  return o.done(), Gr.reject(t);
5547
5547
  }));
5548
- n.push(a);
5548
+ n.push(u);
5549
5549
  }
5550
5550
  o.isDone ? r() : null === o.Ft ? i.continue() : i.continue(o.Ft);
5551
5551
  } else r();
@@ -5812,8 +5812,8 @@ function ei(t, e) {
5812
5812
  /** Encodes a document for storage locally. */;
5813
5813
  }
5814
5814
 
5815
- function ai(t, e) {
5816
- var n = ui(e.readTime), r = e.key.path.popLast().toArray();
5815
+ function ui(t, e) {
5816
+ var n = ai(e.readTime), r = e.key.path.popLast().toArray();
5817
5817
  if (e.isFoundDocument()) {
5818
5818
  var i = function(t, e) {
5819
5819
  return {
@@ -5827,10 +5827,10 @@ function ai(t, e) {
5827
5827
  /* noDocument= */ null, i, o, n, r);
5828
5828
  }
5829
5829
  if (e.isNoDocument()) {
5830
- var s = e.key.path.toArray(), a = hi(e.version), u = e.hasCommittedMutations;
5830
+ var s = e.key.path.toArray(), u = hi(e.version), a = e.hasCommittedMutations;
5831
5831
  return new Rr(
5832
- /* unknownDocument= */ null, new Cr(s, a),
5833
- /* document= */ null, u, n, r);
5832
+ /* unknownDocument= */ null, new Cr(s, u),
5833
+ /* document= */ null, a, n, r);
5834
5834
  }
5835
5835
  if (e.isUnknownDocument()) {
5836
5836
  var c = e.key.path.toArray(), h = hi(e.version);
@@ -5842,7 +5842,7 @@ function ai(t, e) {
5842
5842
  return G();
5843
5843
  }
5844
5844
 
5845
- function ui(t) {
5845
+ function ai(t) {
5846
5846
  var e = t.toTimestamp();
5847
5847
  return [ e.seconds, e.nanoseconds ];
5848
5848
  }
@@ -5881,8 +5881,8 @@ function fi(t) {
5881
5881
  }
5882
5882
  var s = e.mutations.map((function(e) {
5883
5883
  return sr(t.Gt, e);
5884
- })), a = lt.fromMillis(e.localWriteTimeMs);
5885
- return new ni(e.batchId, a, n, s);
5884
+ })), u = lt.fromMillis(e.localWriteTimeMs);
5885
+ return new ni(e.batchId, u, n, s);
5886
5886
  }
5887
5887
 
5888
5888
  /** Decodes a DbTarget into TargetData */ function di(t) {
@@ -5896,7 +5896,7 @@ function fi(t) {
5896
5896
 
5897
5897
  function pi(t, e) {
5898
5898
  var n, r = hi(e.snapshotVersion), i = hi(e.lastLimboFreeSnapshotVersion);
5899
- n = ne(e.target) ? ar(t.Gt, e.target) : ur(t.Gt, e.target);
5899
+ n = ne(e.target) ? ur(t.Gt, e.target) : ar(t.Gt, e.target);
5900
5900
  // We can't store the resumeToken as a ByteString in IndexedDb, so we
5901
5901
  // convert it to a base64 string for storage.
5902
5902
  var o = e.resumeToken.toBase64();
@@ -6150,13 +6150,13 @@ function Ti(t) {
6150
6150
  * @returns A PersistencePromise of the document mutations that were removed.
6151
6151
  */
6152
6152
  function _i(t, e, n) {
6153
- var r = t.store(Dr.store), i = t.store(Nr.store), o = [], s = IDBKeyRange.only(n.batchId), a = 0, u = r.jt({
6153
+ var r = t.store(Dr.store), i = t.store(Nr.store), o = [], s = IDBKeyRange.only(n.batchId), u = 0, a = r.jt({
6154
6154
  range: s
6155
6155
  }, (function(t, e, n) {
6156
- return a++, n.delete();
6156
+ return u++, n.delete();
6157
6157
  }));
6158
- o.push(u.next((function() {
6159
- z(1 === a);
6158
+ o.push(a.next((function() {
6159
+ z(1 === u);
6160
6160
  })));
6161
6161
  for (var c = [], h = 0, f = n.mutations; h < f.length; h++) {
6162
6162
  var l = f[h], d = Nr.key(e, l.key.path, n.batchId);
@@ -6253,27 +6253,27 @@ var ki = /** @class */ function() {
6253
6253
  // See: https://bugs.chromium.org/p/chromium/issues/detail?id=701972
6254
6254
  // We write an empty object to obtain key
6255
6255
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
6256
- return s.add({}).next((function(a) {
6257
- z("number" == typeof a);
6258
- for (var u = new ni(a, e, n, r), c = function(t, e, n) {
6256
+ return s.add({}).next((function(u) {
6257
+ z("number" == typeof u);
6258
+ for (var a = new ni(u, e, n, r), c = function(t, e, n) {
6259
6259
  var r = n.baseMutations.map((function(e) {
6260
6260
  return or(t.Gt, e);
6261
6261
  })), i = n.mutations.map((function(e) {
6262
6262
  return or(t.Gt, e);
6263
6263
  }));
6264
6264
  return new Dr(e, n.batchId, n.localWriteTime.toMillis(), r, i);
6265
- }(i.k, i.userId, u), h = [], f = new Tn((function(t, e) {
6265
+ }(i.k, i.userId, a), h = [], f = new Tn((function(t, e) {
6266
6266
  return ct(t.canonicalString(), e.canonicalString());
6267
6267
  })), l = 0, d = r; l < d.length; l++) {
6268
- var p = d[l], y = Nr.key(i.userId, p.key.path, a);
6268
+ var p = d[l], y = Nr.key(i.userId, p.key.path, u);
6269
6269
  f = f.add(p.key.path.popLast()), h.push(s.put(c)), h.push(o.put(y, Nr.PLACEHOLDER));
6270
6270
  }
6271
6271
  return f.forEach((function(e) {
6272
6272
  h.push(i.Jt.addToCollectionParentIndex(t, e));
6273
6273
  })), t.addOnCommittedListener((function() {
6274
- i.Yt[a] = u.keys();
6274
+ i.Yt[u] = a.keys();
6275
6275
  })), Gr.waitFor(h).next((function() {
6276
- return u;
6276
+ return a;
6277
6277
  }));
6278
6278
  }));
6279
6279
  }, t.prototype.lookupMutationBatch = function(t, e) {
@@ -6333,7 +6333,7 @@ var ki = /** @class */ function() {
6333
6333
  return Ci(t).jt({
6334
6334
  range: i
6335
6335
  }, (function(r, i, s) {
6336
- var a = r[0], u = r[1], c = r[2], h = Sr(u);
6336
+ var u = r[0], a = r[1], c = r[2], h = Sr(a);
6337
6337
  // Only consider rows matching exactly the specific key of
6338
6338
  // interest. Note that because we order by path first, and we
6339
6339
  // order terminators before path separators, we'll encounter all
@@ -6341,7 +6341,7 @@ var ki = /** @class */ function() {
6341
6341
  // the rows for documentKey will occur before any rows for
6342
6342
  // documents nested in a subcollection beneath documentKey so we
6343
6343
  // can stop as soon as we hit any such row.
6344
- if (a === n.userId && e.path.isEqual(h))
6344
+ if (u === n.userId && e.path.isEqual(h))
6345
6345
  // Look up the mutation batch in the store.
6346
6346
  return Ni(t).get(c).next((function(t) {
6347
6347
  if (!t) throw G();
@@ -6354,10 +6354,10 @@ var ki = /** @class */ function() {
6354
6354
  }, t.prototype.getAllMutationBatchesAffectingDocumentKeys = function(t, e) {
6355
6355
  var n = this, r = new Tn(ct), i = [];
6356
6356
  return e.forEach((function(e) {
6357
- var o = Nr.prefixForPath(n.userId, e.path), s = IDBKeyRange.lowerBound(o), a = Ci(t).jt({
6357
+ var o = Nr.prefixForPath(n.userId, e.path), s = IDBKeyRange.lowerBound(o), u = Ci(t).jt({
6358
6358
  range: s
6359
6359
  }, (function(t, i, o) {
6360
- var s = t[0], a = t[1], u = t[2], c = Sr(a);
6360
+ var s = t[0], u = t[1], a = t[2], c = Sr(u);
6361
6361
  // Only consider rows matching exactly the specific key of
6362
6362
  // interest. Note that because we order by path first, and we
6363
6363
  // order terminators before path separators, we'll encounter all
@@ -6365,27 +6365,27 @@ var ki = /** @class */ function() {
6365
6365
  // the rows for documentKey will occur before any rows for
6366
6366
  // documents nested in a subcollection beneath documentKey so we
6367
6367
  // can stop as soon as we hit any such row.
6368
- s === n.userId && e.path.isEqual(c) ? r = r.add(u) : o.done();
6368
+ s === n.userId && e.path.isEqual(c) ? r = r.add(a) : o.done();
6369
6369
  }));
6370
- i.push(a);
6370
+ i.push(u);
6371
6371
  })), Gr.waitFor(i).next((function() {
6372
6372
  return n.te(t, r);
6373
6373
  }));
6374
6374
  }, t.prototype.getAllMutationBatchesAffectingQuery = function(t, e) {
6375
- var n = this, r = e.path, i = r.length + 1, o = Nr.prefixForPath(this.userId, r), s = IDBKeyRange.lowerBound(o), a = new Tn(ct);
6375
+ var n = this, r = e.path, i = r.length + 1, o = Nr.prefixForPath(this.userId, r), s = IDBKeyRange.lowerBound(o), u = new Tn(ct);
6376
6376
  return Ci(t).jt({
6377
6377
  range: s
6378
6378
  }, (function(t, e, o) {
6379
- var s = t[0], u = t[1], c = t[2], h = Sr(u);
6379
+ var s = t[0], a = t[1], c = t[2], h = Sr(a);
6380
6380
  s === n.userId && r.isPrefixOf(h) ?
6381
6381
  // Rows with document keys more than one segment longer than the
6382
6382
  // query path can't be matches. For example, a query on 'rooms'
6383
6383
  // can't match the document /rooms/abc/messages/xyx.
6384
6384
  // TODO(mcg): we'll need a different scanner when we implement
6385
6385
  // ancestor queries.
6386
- h.length === i && (a = a.add(c)) : o.done();
6386
+ h.length === i && (u = u.add(c)) : o.done();
6387
6387
  })).next((function() {
6388
- return n.te(t, a);
6388
+ return n.te(t, u);
6389
6389
  }));
6390
6390
  }, t.prototype.te = function(t, e) {
6391
6391
  var n = this, r = [], i = [];
@@ -6460,8 +6460,8 @@ var ki = /** @class */ function() {
6460
6460
  range: o,
6461
6461
  Kt: !0
6462
6462
  }, (function(t, n, r) {
6463
- var o = t[0], a = t[1];
6464
- /*batchID*/ t[2], o === e && a === i && (s = !0),
6463
+ var o = t[0], u = t[1];
6464
+ /*batchID*/ t[2], o === e && u === i && (s = !0),
6465
6465
  r.done();
6466
6466
  })).next((function() {
6467
6467
  return s;
@@ -6591,9 +6591,9 @@ var ki = /** @class */ function() {
6591
6591
  */
6592
6592
  t.prototype.removeTargets = function(t, e, n) {
6593
6593
  var r = this, i = 0, o = [];
6594
- return Pi(t).jt((function(s, a) {
6595
- var u = di(a);
6596
- u.sequenceNumber <= e && null === n.get(u.targetId) && (i++, o.push(r.removeTargetData(t, u)));
6594
+ return Pi(t).jt((function(s, u) {
6595
+ var a = di(u);
6596
+ a.sequenceNumber <= e && null === n.get(a.targetId) && (i++, o.push(r.removeTargetData(t, a)));
6597
6597
  })).next((function() {
6598
6598
  return Gr.waitFor(o);
6599
6599
  })).next((function() {
@@ -6921,7 +6921,7 @@ function Pi(t) {
6921
6921
  }, t.prototype.getCacheSize = function(t) {
6922
6922
  return this.ge.getCacheSize(t);
6923
6923
  }, t.prototype.Te = function(t, e) {
6924
- var n, r, i, o, s, a, u, c = this, h = Date.now();
6924
+ var n, r, i, o, s, u, a, c = this, h = Date.now();
6925
6925
  return this.calculateTargetCount(t, this.params.percentileToCollect).next((function(e) {
6926
6926
  // Cap at the configured max
6927
6927
  return e > c.params.maximumSequenceNumbersToCollect ? (U("LruGarbageCollector", "Capping sequence numbers to collect down to the maximum of " + c.params.maximumSequenceNumbersToCollect + " from " + e),
@@ -6929,9 +6929,9 @@ function Pi(t) {
6929
6929
  })).next((function(r) {
6930
6930
  return n = r, s = Date.now(), c.removeTargets(t, n, e);
6931
6931
  })).next((function(e) {
6932
- return i = e, a = Date.now(), c.removeOrphanedDocuments(t, n);
6932
+ return i = e, u = Date.now(), c.removeOrphanedDocuments(t, n);
6933
6933
  })).next((function(t) {
6934
- return u = Date.now(), V() <= f.DEBUG && U("LruGarbageCollector", "LRU Garbage Collection\n\tCounted targets in " + (o - h) + "ms\n\tDetermined least recently used " + r + " in " + (s - o) + "ms\n\tRemoved " + i + " targets in " + (a - s) + "ms\n\tRemoved " + t + " documents in " + (u - a) + "ms\nTotal Duration: " + (u - h) + "ms"),
6934
+ return a = Date.now(), V() <= f.DEBUG && U("LruGarbageCollector", "LRU Garbage Collection\n\tCounted targets in " + (o - h) + "ms\n\tDetermined least recently used " + r + " in " + (s - o) + "ms\n\tRemoved " + i + " targets in " + (u - s) + "ms\n\tRemoved " + t + " documents in " + (a - u) + "ms\nTotal Duration: " + (a - h) + "ms"),
6935
6935
  Gr.resolve({
6936
6936
  didRun: !0,
6937
6937
  sequenceNumbersCollected: r,
@@ -6994,9 +6994,9 @@ function Pi(t) {
6994
6994
  }(t, e);
6995
6995
  }, t.prototype.removeOrphanedDocuments = function(t, e) {
6996
6996
  var n = this, r = this.db.getRemoteDocumentCache().newChangeBuffer(), i = [], o = 0;
6997
- return this.Ie(t, (function(s, a) {
6998
- if (a <= e) {
6999
- var u = n.Ae(t, s).next((function(e) {
6997
+ return this.Ie(t, (function(s, u) {
6998
+ if (u <= e) {
6999
+ var a = n.Ae(t, s).next((function(e) {
7000
7000
  if (!e)
7001
7001
  // Our size accounting requires us to read all documents before
7002
7002
  // removing them.
@@ -7004,7 +7004,7 @@ function Pi(t) {
7004
7004
  return r.removeEntry(s, dt.min()), Mi(t).delete([ 0, Ir(s.path) ]);
7005
7005
  }));
7006
7006
  }));
7007
- i.push(u);
7007
+ i.push(a);
7008
7008
  }
7009
7009
  })).next((function() {
7010
7010
  return Gr.waitFor(i);
@@ -7032,7 +7032,7 @@ function Pi(t) {
7032
7032
  }, (function(t, r) {
7033
7033
  var o = t[0];
7034
7034
  t[1];
7035
- var s = r.path, a = r.sequenceNumber;
7035
+ var s = r.path, u = r.sequenceNumber;
7036
7036
  0 === o ? (
7037
7037
  // if nextToReport is valid, report it, this is a new key so the
7038
7038
  // last one must not be a member of any targets.
@@ -7041,7 +7041,7 @@ function Pi(t) {
7041
7041
  // might report, if we don't find any targets for this document.
7042
7042
  // Note that the sequence number must be defined when the targetId
7043
7043
  // is 0.
7044
- i = a, n = s) :
7044
+ i = u, n = s) :
7045
7045
  // set nextToReport to be invalid, we know we don't need to report
7046
7046
  // this one since we found a target for it.
7047
7047
  i = st.I;
@@ -7106,8 +7106,8 @@ function Pi(t) {
7106
7106
  return t.prototype.get = function(t) {
7107
7107
  var e = this.mapKeyFn(t), n = this.inner[e];
7108
7108
  if (void 0 !== n) for (var r = 0, i = n; r < i.length; r++) {
7109
- var o = i[r], s = o[0], a = o[1];
7110
- if (this.equalsFn(s, t)) return a;
7109
+ var o = i[r], s = o[0], u = o[1];
7110
+ if (this.equalsFn(s, t)) return u;
7111
7111
  }
7112
7112
  }, t.prototype.has = function(t) {
7113
7113
  return void 0 !== this.get(t);
@@ -7131,8 +7131,8 @@ function Pi(t) {
7131
7131
  }, t.prototype.forEach = function(t) {
7132
7132
  yt(this.inner, (function(e, n) {
7133
7133
  for (var r = 0, i = n; r < i.length; r++) {
7134
- var o = i[r], s = o[0], a = o[1];
7135
- t(s, a);
7134
+ var o = i[r], s = o[0], u = o[1];
7135
+ t(s, u);
7136
7136
  }
7137
7137
  }));
7138
7138
  }, t.prototype.isEmpty = function() {
@@ -7311,14 +7311,14 @@ function Pi(t) {
7311
7311
  if (n.isEqual(dt.min())) {
7312
7312
  // Documents are ordered by key, so we can use a prefix scan to narrow
7313
7313
  // down the documents we need to match the query against.
7314
- var a = e.path.toArray();
7315
- s.range = IDBKeyRange.lowerBound(a);
7314
+ var u = e.path.toArray();
7315
+ s.range = IDBKeyRange.lowerBound(u);
7316
7316
  } else {
7317
7317
  // Execute an index-free query and filter by read time. This is safe
7318
7318
  // since all document changes to queries that have a
7319
7319
  // lastLimboFreeSnapshotVersion (`sinceReadTime`) have a read time set.
7320
- var u = e.path.toArray(), c = ui(n);
7321
- s.range = IDBKeyRange.lowerBound([ u, c ],
7320
+ var a = e.path.toArray(), c = ai(n);
7321
+ s.range = IDBKeyRange.lowerBound([ a, c ],
7322
7322
  /* open= */ !0), s.index = Rr.collectionReadTimeIndex;
7323
7323
  }
7324
7324
  return Yi(t).jt(s, (function(t, n, s) {
@@ -7328,8 +7328,8 @@ function Pi(t) {
7328
7328
  // shouldn't match it. Fix this by discarding rows with document keys
7329
7329
  // more than one segment longer than the query path.
7330
7330
  if (t.length === o) {
7331
- var a = r.be(Pt.fromSegments(t), n);
7332
- e.path.isPrefixOf(a.key.path) ? Re(e, a) && (i = i.insert(a.key, a)) : s.done();
7331
+ var u = r.be(Pt.fromSegments(t), n);
7332
+ e.path.isPrefixOf(u.key.path) ? Re(e, u) && (i = i.insert(u.key, u)) : s.done();
7333
7333
  }
7334
7334
  })).next((function() {
7335
7335
  return i;
@@ -7381,18 +7381,18 @@ function Pi(t) {
7381
7381
  return ct(t.canonicalString(), e.canonicalString());
7382
7382
  }));
7383
7383
  return this.changes.forEach((function(o, s) {
7384
- var a = e.Ce.get(o);
7384
+ var u = e.Ce.get(o);
7385
7385
  if (s.isValidDocument()) {
7386
- var u = ai(e.De.k, s);
7386
+ var a = ui(e.De.k, s);
7387
7387
  i = i.add(o.path.popLast());
7388
- var c = Ai(u);
7389
- r += c - a, n.push(e.De.addEntry(t, o, u));
7390
- } else if (r -= a, e.trackRemovals) {
7388
+ var c = Ai(a);
7389
+ r += c - u, n.push(e.De.addEntry(t, o, a));
7390
+ } else if (r -= u, e.trackRemovals) {
7391
7391
  // In order to track removals, we store a "sentinel delete" in the
7392
7392
  // RemoteDocumentCache. This entry is represented by a NoDocument
7393
7393
  // with a version of 0 and ignored by `maybeDecodeDocument()` but
7394
7394
  // preserved in `getNewDocumentChanges()`.
7395
- var h = ai(e.De.k, s.convertToNoDocument(dt.min()));
7395
+ var h = ui(e.De.k, s.convertToNoDocument(dt.min()));
7396
7396
  n.push(e.De.addEntry(t, o, h));
7397
7397
  } else n.push(e.De.removeEntry(t, o));
7398
7398
  })), i.forEach((function(r) {
@@ -7698,14 +7698,14 @@ var Zi = "Failed to obtain exclusive access to the persistence layer. To allow s
7698
7698
  * Whether to synchronize the in-memory state of multiple tabs and share
7699
7699
  * access to local persistence.
7700
7700
  */
7701
- e, n, r, i, o, s, a, u, c,
7701
+ e, n, r, i, o, s, u, a, c,
7702
7702
  /**
7703
7703
  * If set to true, forcefully obtains database access. Existing tabs will
7704
7704
  * no longer be able to access IndexedDB.
7705
7705
  */
7706
7706
  h) {
7707
7707
  if (this.allowTabSynchronization = e, this.persistenceKey = n, this.clientId = r,
7708
- this.Me = o, this.window = s, this.document = a, this.Fe = c, this.Le = h, this.Be = null,
7708
+ this.Me = o, this.window = s, this.document = u, this.Fe = c, this.Le = h, this.Be = null,
7709
7709
  this.Ue = !1, this.isPrimary = !1, this.networkEnabled = !0,
7710
7710
  /** Our window.unload handler, if registered. */
7711
7711
  this.qe = null, this.inForeground = !1,
@@ -7719,7 +7719,7 @@ var Zi = "Failed to obtain exclusive access to the persistence layer. To allow s
7719
7719
  this.We = function(t) {
7720
7720
  return Promise.resolve();
7721
7721
  }, !t.Pt()) throw new Y(H.UNIMPLEMENTED, "This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.");
7722
- this.referenceDelegate = new ji(this, i), this.Ge = n + "main", this.k = new oi(u),
7722
+ this.referenceDelegate = new ji(this, i), this.Ge = n + "main", this.k = new oi(a),
7723
7723
  this.ze = new Qr(this.Ge, 11, new Xi(this.k)), this.He = new Li(this.referenceDelegate, this.k),
7724
7724
  this.Jt = new Ii, this.Je = function(t, e) {
7725
7725
  return new Qi(t, e);
@@ -8363,11 +8363,11 @@ var io = function(t, e) {
8363
8363
  var r = this, i = e.collectionGroup, o = kn();
8364
8364
  return this.Jt.getCollectionParents(t, i).next((function(s) {
8365
8365
  return Gr.forEach(s, (function(s) {
8366
- var a = function(t, e) {
8366
+ var u = function(t, e) {
8367
8367
  return new ge(e,
8368
8368
  /*collectionGroup=*/ null, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, t.startAt, t.endAt);
8369
8369
  }(e, s.child(i));
8370
- return r.Cn(t, a, n).next((function(t) {
8370
+ return r.Cn(t, u, n).next((function(t) {
8371
8371
  t.forEach((function(t, e) {
8372
8372
  o = o.insert(t, e);
8373
8373
  }));
@@ -8384,11 +8384,11 @@ var io = function(t, e) {
8384
8384
  })).next((function(e) {
8385
8385
  return i = e, o.Nn(t, i, r).next((function(t) {
8386
8386
  r = t;
8387
- for (var e = 0, n = i; e < n.length; e++) for (var o = n[e], s = 0, a = o.mutations; s < a.length; s++) {
8388
- var u = a[s], c = u.key, h = r.get(c);
8387
+ for (var e = 0, n = i; e < n.length; e++) for (var o = n[e], s = 0, u = o.mutations; s < u.length; s++) {
8388
+ var a = u[s], c = a.key, h = r.get(c);
8389
8389
  null == h && (
8390
8390
  // Create invalid document to apply mutations on top of
8391
- h = Xt.newInvalidDocument(c), r = r.insert(c, h)), nn(u, h, o.localWriteTime), h.isFoundDocument() || (r = r.remove(c));
8391
+ h = Xt.newInvalidDocument(c), r = r.insert(c, h)), nn(a, h, o.localWriteTime), h.isFoundDocument() || (r = r.remove(c));
8392
8392
  }
8393
8393
  }));
8394
8394
  })).next((function() {
@@ -8399,9 +8399,9 @@ var io = function(t, e) {
8399
8399
  })), r;
8400
8400
  }));
8401
8401
  }, t.prototype.Nn = function(t, e, n) {
8402
- for (var r = Cn(), i = 0, o = e; i < o.length; i++) for (var s = 0, a = o[i].mutations; s < a.length; s++) {
8403
- var u = a[s];
8404
- u instanceof un && null === n.get(u.key) && (r = r.add(u.key));
8402
+ for (var r = Cn(), i = 0, o = e; i < o.length; i++) for (var s = 0, u = o[i].mutations; s < u.length; s++) {
8403
+ var a = u[s];
8404
+ a instanceof an && null === n.get(a.key) && (r = r.add(a.key));
8405
8405
  }
8406
8406
  var c = n;
8407
8407
  return this.Je.getEntries(t, r).next((function(t) {
@@ -8416,20 +8416,20 @@ var io = function(t, e) {
8416
8416
  }
8417
8417
  return t.$n = function(e, n) {
8418
8418
  for (var r = Cn(), i = Cn(), o = 0, s = n.docChanges; o < s.length; o++) {
8419
- var a = s[o];
8420
- switch (a.type) {
8419
+ var u = s[o];
8420
+ switch (u.type) {
8421
8421
  case 0 /* Added */ :
8422
- r = r.add(a.doc.key);
8422
+ r = r.add(u.doc.key);
8423
8423
  break;
8424
8424
 
8425
8425
  case 1 /* Removed */ :
8426
- i = i.add(a.doc.key);
8426
+ i = i.add(u.doc.key);
8427
8427
  // do nothing
8428
8428
  }
8429
8429
  }
8430
8430
  return new t(e, n.fromCache, r, i);
8431
8431
  }, t;
8432
- }(), ao = /** @class */ function() {
8432
+ }(), uo = /** @class */ function() {
8433
8433
  function t() {}
8434
8434
  /** Sets the document view to query against. */ return t.prototype.On = function(t) {
8435
8435
  this.Mn = t;
@@ -8493,7 +8493,7 @@ var io = function(t, e) {
8493
8493
  return V() <= f.DEBUG && U("QueryEngine", "Using full collection scan to execute query:", xe(e)),
8494
8494
  this.Mn.getDocumentsMatchingQuery(t, e, dt.min());
8495
8495
  }, t;
8496
- }(), uo = /** @class */ function() {
8496
+ }(), ao = /** @class */ function() {
8497
8497
  function t(
8498
8498
  /** Manages our in-memory or durable persistence. */
8499
8499
  t, e, n, r) {
@@ -8551,7 +8551,7 @@ var io = function(t, e) {
8551
8551
  */ function co(
8552
8552
  /** Manages our in-memory or durable persistence. */
8553
8553
  t, e, n, r) {
8554
- return new uo(t, e, n, r);
8554
+ return new ao(t, e, n, r);
8555
8555
  }
8556
8556
 
8557
8557
  /**
@@ -8578,10 +8578,10 @@ function ho(t, e) {
8578
8578
  // MutationQueue.
8579
8579
  o = new oo(n.Qn, i, n.persistence.getIndexManager()), i.getAllMutationBatches(t);
8580
8580
  })).next((function(e) {
8581
- for (var n = [], i = [], s = Cn(), a = 0, u = r
8581
+ for (var n = [], i = [], s = Cn(), u = 0, a = r
8582
8582
  // Union the old/new changed keys.
8583
- ; a < u.length; a++) {
8584
- var c = u[a];
8583
+ ; u < a.length; u++) {
8584
+ var c = a[u];
8585
8585
  n.push(c.batchId);
8586
8586
  for (var h = 0, f = c.mutations; h < f.length; h++) {
8587
8587
  var l = f[h];
@@ -8693,18 +8693,18 @@ function ho(t, e) {
8693
8693
  // Reset newTargetDataByTargetMap in case this transaction gets re-run.
8694
8694
  i = n.qn;
8695
8695
  var s = [];
8696
- e.targetChanges.forEach((function(o, a) {
8697
- var u = i.get(a);
8698
- if (u) {
8696
+ e.targetChanges.forEach((function(o, u) {
8697
+ var a = i.get(u);
8698
+ if (a) {
8699
8699
  // Only update the remote keys if the target is still active. This
8700
8700
  // ensures that we can persist the updated target data along with
8701
8701
  // the updated assignment.
8702
- s.push(n.He.removeMatchingKeys(t, o.removedDocuments, a).next((function() {
8703
- return n.He.addMatchingKeys(t, o.addedDocuments, a);
8702
+ s.push(n.He.removeMatchingKeys(t, o.removedDocuments, u).next((function() {
8703
+ return n.He.addMatchingKeys(t, o.addedDocuments, u);
8704
8704
  })));
8705
- var c = u.withSequenceNumber(t.currentSequenceNumber);
8706
- e.targetMismatches.has(a) ? c = c.withResumeToken(Et.EMPTY_BYTE_STRING, dt.min()).withLastLimboFreeSnapshotVersion(dt.min()) : o.resumeToken.approximateByteSize() > 0 && (c = c.withResumeToken(o.resumeToken, r)),
8707
- i = i.insert(a, c),
8705
+ var c = a.withSequenceNumber(t.currentSequenceNumber);
8706
+ e.targetMismatches.has(u) ? c = c.withResumeToken(Et.EMPTY_BYTE_STRING, dt.min()).withLastLimboFreeSnapshotVersion(dt.min()) : o.resumeToken.approximateByteSize() > 0 && (c = c.withResumeToken(o.resumeToken, r)),
8707
+ i = i.insert(u, c),
8708
8708
  // Update the target data if there are target changes (or if
8709
8709
  // sufficient time has passed since the last update).
8710
8710
  /**
@@ -8727,10 +8727,10 @@ function ho(t, e) {
8727
8727
  // we may not get time to do anything interesting while the current tab is
8728
8728
  // closing.
8729
8729
  e.snapshotVersion.toMicroseconds() - t.snapshotVersion.toMicroseconds() >= 3e8 || n.addedDocuments.size + n.modifiedDocuments.size + n.removedDocuments.size > 0);
8730
- }(u, c, o) && s.push(n.He.updateTargetData(t, c));
8730
+ }(a, c, o) && s.push(n.He.updateTargetData(t, c));
8731
8731
  }
8732
8732
  }));
8733
- var a = _n();
8733
+ var u = _n();
8734
8734
  // HACK: The only reason we allow a null snapshot version is so that we
8735
8735
  // can synthesize remote events when we get permission denied errors while
8736
8736
  // trying to resolve the state of a locally cached document that is in
@@ -8741,19 +8741,19 @@ function ho(t, e) {
8741
8741
  // Each loop iteration only affects its "own" doc, so it's safe to get all the remote
8742
8742
  // documents in advance in a single call.
8743
8743
  s.push(yo(t, o, e.documentUpdates).next((function(t) {
8744
- a = t;
8744
+ u = t;
8745
8745
  }))), !r.isEqual(dt.min())) {
8746
- var u = n.He.getLastRemoteSnapshotVersion(t).next((function(e) {
8746
+ var a = n.He.getLastRemoteSnapshotVersion(t).next((function(e) {
8747
8747
  return n.He.setTargetsMetadata(t, t.currentSequenceNumber, r);
8748
8748
  }));
8749
- s.push(u);
8749
+ s.push(a);
8750
8750
  }
8751
8751
  return Gr.waitFor(s).next((function() {
8752
8752
  return o.apply(t);
8753
8753
  })).next((function() {
8754
- return n.Wn.Vn(t, a);
8754
+ return n.Wn.Vn(t, u);
8755
8755
  })).next((function() {
8756
- return a;
8756
+ return u;
8757
8757
  }));
8758
8758
  })).then((function(t) {
8759
8759
  return n.qn = i, t;
@@ -8860,7 +8860,7 @@ function vo(t, e) {
8860
8860
  // PORTING NOTE: `keepPersistedTargetData` is multi-tab only.
8861
8861
  function go(t, e, i) {
8862
8862
  return n(this, void 0, void 0, (function() {
8863
- var n, o, s, a;
8863
+ var n, o, s, u;
8864
8864
  return r(this, (function(r) {
8865
8865
  switch (r.label) {
8866
8866
  case 0:
@@ -8878,13 +8878,13 @@ function go(t, e, i) {
8878
8878
  return [ 3 /*break*/ , 5 ];
8879
8879
 
8880
8880
  case 4:
8881
- if (!Yr(a = r.sent())) throw a;
8881
+ if (!Yr(u = r.sent())) throw u;
8882
8882
  // All `releaseTarget` does is record the final metadata state for the
8883
8883
  // target, but we've been recording this periodically during target
8884
8884
  // activity. If we lose this write this could cause a very slight
8885
8885
  // difference in the order of target deletion during GC, but we
8886
8886
  // don't define exact LRU semantics so this is acceptable.
8887
- return U("LocalStore", "Failed to update sequence numbers for target " + e + ": " + a),
8887
+ return U("LocalStore", "Failed to update sequence numbers for target " + e + ": " + u),
8888
8888
  [ 3 /*break*/ , 5 ];
8889
8889
 
8890
8890
  case 5:
@@ -8943,10 +8943,10 @@ function Io(t) {
8943
8943
  var e = W(t);
8944
8944
  return e.persistence.runTransaction("Get new document changes", "readonly", (function(t) {
8945
8945
  return function(t, e, n) {
8946
- var r = W(t), i = _n(), o = ui(n), s = Yi(e), a = IDBKeyRange.lowerBound(o, !0);
8946
+ var r = W(t), i = _n(), o = ai(n), s = Yi(e), u = IDBKeyRange.lowerBound(o, !0);
8947
8947
  return s.jt({
8948
8948
  index: Rr.readTimeIndex,
8949
- range: a
8949
+ range: u
8950
8950
  }, (function(t, e) {
8951
8951
  // Unlike `getEntry()` and others, `getNewDocumentChanges()` parses
8952
8952
  // the documents directly since we want to keep sentinel deletes.
@@ -9009,13 +9009,13 @@ function To(t) {
9009
9009
  * queue.
9010
9010
  */ function Eo(t, e, i, o) {
9011
9011
  return n(this, void 0, void 0, (function() {
9012
- var n, s, a, u, c, h, f, l, d, p;
9012
+ var n, s, u, a, c, h, f, l, d, p;
9013
9013
  return r(this, (function(r) {
9014
9014
  switch (r.label) {
9015
9015
  case 0:
9016
- for (n = W(t), s = Cn(), a = _n(), u = 0, c = i; u < c.length; u++) h = c[u], f = e.Hn(h.metadata.name),
9016
+ for (n = W(t), s = Cn(), u = _n(), a = 0, c = i; a < c.length; a++) h = c[a], f = e.Hn(h.metadata.name),
9017
9017
  h.document && (s = s.add(f)), (l = e.Jn(h)).setReadTime(e.Yn(h.metadata.readTime)),
9018
- a = a.insert(f, l);
9018
+ u = u.insert(f, l);
9019
9019
  return d = n.Qn.newChangeBuffer({
9020
9020
  trackRemovals: !0
9021
9021
  }), [ 4 /*yield*/ , mo(n, function(t) {
@@ -9028,7 +9028,7 @@ function To(t) {
9028
9028
  // Allocates a target to hold all document keys from the bundle, such that
9029
9029
  // they will not get garbage collected right away.
9030
9030
  return p = r.sent(), [ 2 /*return*/ , n.persistence.runTransaction("Apply bundle documents", "readwrite", (function(t) {
9031
- return yo(t, d, a).next((function(e) {
9031
+ return yo(t, d, u).next((function(e) {
9032
9032
  return d.apply(t), e;
9033
9033
  })).next((function(e) {
9034
9034
  return n.He.removeMatchingKeysForTargetId(t, p.targetId).next((function() {
@@ -9210,9 +9210,9 @@ function To(t) {
9210
9210
  var o = new ni(i, e, n, r);
9211
9211
  this.An.push(o);
9212
9212
  // Track references by document key and index collection parents.
9213
- for (var s = 0, a = r; s < a.length; s++) {
9214
- var u = a[s];
9215
- this.ws = this.ws.add(new ko(u.key, i)), this.Jt.addToCollectionParentIndex(t, u.key.path.popLast());
9213
+ for (var s = 0, u = r; s < u.length; s++) {
9214
+ var a = u[s];
9215
+ this.ws = this.ws.add(new ko(a.key, i)), this.Jt.addToCollectionParentIndex(t, a.key.path.popLast());
9216
9216
  }
9217
9217
  return Gr.resolve(o);
9218
9218
  }, t.prototype.lookupMutationBatch = function(t, e) {
@@ -9372,9 +9372,9 @@ function To(t) {
9372
9372
  // Documents are ordered by key, so we can use a prefix scan to narrow down
9373
9373
  // the documents we need to match the query against.
9374
9374
  ; o.hasNext(); ) {
9375
- var s = o.getNext(), a = s.key, u = s.value.document;
9376
- if (!e.path.isPrefixOf(a.path)) break;
9377
- u.readTime.compareTo(n) <= 0 || Re(e, u) && (r = r.insert(u.key, u.mutableCopy()));
9375
+ var s = o.getNext(), u = s.key, a = s.value.document;
9376
+ if (!e.path.isPrefixOf(u.path)) break;
9377
+ a.readTime.compareTo(n) <= 0 || Re(e, a) && (r = r.insert(a.key, a.mutableCopy()));
9378
9378
  }
9379
9379
  return Gr.resolve(r);
9380
9380
  }, t.prototype.Es = function(t, e) {
@@ -9450,8 +9450,8 @@ function To(t) {
9450
9450
  Gr.resolve();
9451
9451
  }, t.prototype.removeTargets = function(t, e, n) {
9452
9452
  var r = this, i = 0, o = [];
9453
- return this.Is.forEach((function(s, a) {
9454
- a.sequenceNumber <= e && null === n.get(a.targetId) && (r.Is.delete(s), o.push(r.removeMatchingKeysForTargetId(t, a.targetId)),
9453
+ return this.Is.forEach((function(s, u) {
9454
+ u.sequenceNumber <= e && null === n.get(u.targetId) && (r.Is.delete(s), o.push(r.removeMatchingKeysForTargetId(t, u.targetId)),
9455
9455
  i++);
9456
9456
  })), Gr.waitFor(o).next((function() {
9457
9457
  return i;
@@ -9824,7 +9824,7 @@ var Vo = /** @class */ function() {
9824
9824
  return !(!t || !t.localStorage);
9825
9825
  }, t.prototype.start = function() {
9826
9826
  return n(this, void 0, void 0, (function() {
9827
- var t, e, n, i, o, s, a, u, c, h, f, l = this;
9827
+ var t, e, n, i, o, s, u, a, c, h, f, l = this;
9828
9828
  return r(this, (function(r) {
9829
9829
  switch (r.label) {
9830
9830
  case 0:
@@ -9832,7 +9832,7 @@ var Vo = /** @class */ function() {
9832
9832
 
9833
9833
  case 1:
9834
9834
  for (t = r.sent(), e = 0, n = t; e < n.length; e++) (i = n[e]) !== this.Bs && (o = this.getItem(Oo(this.persistenceKey, i))) && (s = Uo.Os(i, o)) && (this.Ks = this.Ks.insert(s.clientId, s));
9835
- for (this.Xs(), (a = this.storage.getItem(this.Js)) && (u = this.Zs(a)) && this.ti(u),
9835
+ for (this.Xs(), (u = this.storage.getItem(this.Js)) && (a = this.Zs(u)) && this.ti(a),
9836
9836
  c = 0, h = this.js; c < h.length; c++) f = h[c], this.qs(f);
9837
9837
  return this.js = [],
9838
9838
  // Register a window unload hook to remove the client metadata entry from
@@ -9909,7 +9909,7 @@ var Vo = /** @class */ function() {
9909
9909
  if (U("SharedClientState", "EVENT", i.key, i.newValue), i.key === this.Qs) return void B("Received WebStorage notification for local change. Another client might have garbage-collected our state");
9910
9910
  this.Me.enqueueRetryable((function() {
9911
9911
  return n(e, void 0, void 0, (function() {
9912
- var t, e, n, o, s, a;
9912
+ var t, e, n, o, s, u;
9913
9913
  return r(this, (function(r) {
9914
9914
  if (this.started) {
9915
9915
  if (null !== i.key) if (this.Gs.test(i.key)) {
@@ -9921,7 +9921,7 @@ var Vo = /** @class */ function() {
9921
9921
  if (null !== i.newValue && (o = this.di(i.key, i.newValue))) return [ 2 /*return*/ , this.wi(o) ];
9922
9922
  } else if (i.key === this.Js) {
9923
9923
  if (null !== i.newValue && (s = this.Zs(i.newValue))) return [ 2 /*return*/ , this.ti(s) ];
9924
- } else if (i.key === this.Ws) a = function(t) {
9924
+ } else if (i.key === this.Ws) u = function(t) {
9925
9925
  var e = st.I;
9926
9926
  if (null != t) try {
9927
9927
  var n = JSON.parse(t);
@@ -9930,7 +9930,7 @@ var Vo = /** @class */ function() {
9930
9930
  B("SharedClientState", "Failed to read sequence number from WebStorage", t);
9931
9931
  }
9932
9932
  return e;
9933
- }(i.newValue), a !== st.I && this.sequenceNumberHandler(a); else if (i.key === this.Ys) return [ 2 /*return*/ , this.syncEngine._i() ];
9933
+ }(i.newValue), u !== st.I && this.sequenceNumberHandler(u); else if (i.key === this.Ys) return [ 2 /*return*/ , this.syncEngine._i() ];
9934
9934
  } else this.js.push(i);
9935
9935
  return [ 2 /*return*/ ];
9936
9936
  }));
@@ -10011,12 +10011,12 @@ var Vo = /** @class */ function() {
10011
10011
  }, t.prototype.wi = function(t) {
10012
10012
  return this.syncEngine.gi(t.targetId, t.state, t.error);
10013
10013
  }, t.prototype.ui = function(t, e) {
10014
- var n = this, r = e ? this.Ks.insert(t, e) : this.Ks.remove(t), i = this.ei(this.Ks), o = this.ei(r), s = [], a = [];
10014
+ var n = this, r = e ? this.Ks.insert(t, e) : this.Ks.remove(t), i = this.ei(this.Ks), o = this.ei(r), s = [], u = [];
10015
10015
  return o.forEach((function(t) {
10016
10016
  i.has(t) || s.push(t);
10017
10017
  })), i.forEach((function(t) {
10018
- o.has(t) || a.push(t);
10019
- })), this.syncEngine.yi(s, a).then((function() {
10018
+ o.has(t) || u.push(t);
10019
+ })), this.syncEngine.yi(s, u).then((function() {
10020
10020
  n.Ks = r;
10021
10021
  }));
10022
10022
  }, t.prototype.ti = function(t) {
@@ -10159,11 +10159,11 @@ var Vo = /** @class */ function() {
10159
10159
  n > 0) {
10160
10160
  var r = s.getResponseJson().error;
10161
10161
  if (r && r.status && r.message) {
10162
- var a = function(t) {
10162
+ var u = function(t) {
10163
10163
  var e = t.toLowerCase().replace(/_/g, "-");
10164
10164
  return Object.values(H).indexOf(e) >= 0 ? e : H.UNKNOWN;
10165
10165
  }(r.status);
10166
- o(new Y(a, r.message));
10166
+ o(new Y(u, r.message));
10167
10167
  } else o(new Y(H.UNKNOWN, "Server responded with status " + s.getStatus()));
10168
10168
  } else
10169
10169
  // If we received an HTTP_ERROR but there's no status code,
@@ -10178,8 +10178,8 @@ var Vo = /** @class */ function() {
10178
10178
  U("Connection", 'RPC "' + t + '" completed.');
10179
10179
  }
10180
10180
  }));
10181
- var a = JSON.stringify(r);
10182
- s.send(e, "POST", a, n, 15);
10181
+ var u = JSON.stringify(r);
10182
+ s.send(e, "POST", u, n, 15);
10183
10183
  }));
10184
10184
  }, n.prototype.Qi = function(t, e, n) {
10185
10185
  var r = [ this.Fi, "/", "google.firestore.v1.Firestore", "/", t, "/channel" ], i = D(), o = N(), s = {
@@ -10223,15 +10223,15 @@ var Vo = /** @class */ function() {
10223
10223
  // known to (sometimes) not include an Origin. See
10224
10224
  // https://github.com/firebase/firebase-js-sdk/issues/1491.
10225
10225
  y() || v() || m() || g() || w() || b() || (s.httpHeadersOverwriteParam = "$httpHeaders");
10226
- var a = r.join("");
10227
- U("Connection", "Creating WebChannel: " + a, s);
10228
- var u = i.createWebChannel(a, s), c = !1, h = !1, f = new Ho({
10226
+ var u = r.join("");
10227
+ U("Connection", "Creating WebChannel: " + u, s);
10228
+ var a = i.createWebChannel(u, s), c = !1, h = !1, f = new Ho({
10229
10229
  Vi: function(t) {
10230
10230
  h ? U("Connection", "Not sending because WebChannel is closed:", t) : (c || (U("Connection", "Opening WebChannel transport."),
10231
- u.open(), c = !0), U("Connection", "WebChannel sending:", t), u.send(t));
10231
+ a.open(), c = !0), U("Connection", "WebChannel sending:", t), a.send(t));
10232
10232
  },
10233
10233
  Si: function() {
10234
- return u.close();
10234
+ return a.close();
10235
10235
  }
10236
10236
  }), l = function(t, e, n) {
10237
10237
  // TODO(dimond): closure typing seems broken because WebChannel does
@@ -10255,13 +10255,13 @@ var Vo = /** @class */ function() {
10255
10255
  // exception and rethrow using a setTimeout so they become visible again.
10256
10256
  // Note that eventually this function could go away if we are confident
10257
10257
  // enough the code is exception free.
10258
- return l(u, x.EventType.OPEN, (function() {
10258
+ return l(a, x.EventType.OPEN, (function() {
10259
10259
  h || U("Connection", "WebChannel transport opened.");
10260
- })), l(u, x.EventType.CLOSE, (function() {
10260
+ })), l(a, x.EventType.CLOSE, (function() {
10261
10261
  h || (h = !0, U("Connection", "WebChannel transport closed"), f.Oi());
10262
- })), l(u, x.EventType.ERROR, (function(t) {
10262
+ })), l(a, x.EventType.ERROR, (function(t) {
10263
10263
  h || (h = !0, j("Connection", "WebChannel transport errored:", t), f.Oi(new Y(H.UNAVAILABLE, "The operation could not be completed")));
10264
- })), l(u, x.EventType.MESSAGE, (function(t) {
10264
+ })), l(a, x.EventType.MESSAGE, (function(t) {
10265
10265
  var e;
10266
10266
  if (!h) {
10267
10267
  var n = t.data[0];
@@ -10287,10 +10287,10 @@ var Vo = /** @class */ function() {
10287
10287
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
10288
10288
  var e = ln[t];
10289
10289
  if (void 0 !== e) return gn(e);
10290
- }(o), a = i.message;
10291
- void 0 === s && (s = H.INTERNAL, a = "Unknown error status: " + o + " with message " + i.message),
10290
+ }(o), u = i.message;
10291
+ void 0 === s && (s = H.INTERNAL, u = "Unknown error status: " + o + " with message " + i.message),
10292
10292
  // Mark closed so no further events are propagated
10293
- h = !0, f.Oi(new Y(s, a)), u.close();
10293
+ h = !0, f.Oi(new Y(s, u)), a.close();
10294
10294
  } else U("Connection", "WebChannel received:", n), f.Mi(n);
10295
10295
  }
10296
10296
  })), l(o, R.STAT_EVENT, (function(t) {
@@ -10503,9 +10503,9 @@ function Jo() {
10503
10503
  return (Math.random() - .5) * this.Hi;
10504
10504
  }, t;
10505
10505
  }(), ts = /** @class */ function() {
10506
- function t(t, e, n, r, i, o, s, a) {
10506
+ function t(t, e, n, r, i, o, s, u) {
10507
10507
  this.Me = t, this.nr = n, this.sr = r, this.ir = i, this.authCredentialsProvider = o,
10508
- this.appCheckCredentialsProvider = s, this.listener = a, this.state = 0 /* Initial */ ,
10508
+ this.appCheckCredentialsProvider = s, this.listener = u, this.state = 0 /* Initial */ ,
10509
10509
  /**
10510
10510
  * A close count that's incremented every time the stream is closed; used by
10511
10511
  * getCloseGuardedDispatcher() to invalidate callbacks that happen after
@@ -10735,9 +10735,9 @@ function Jo() {
10735
10735
  }, t;
10736
10736
  }(), es = /** @class */ function(e) {
10737
10737
  function n(t, n, r, i, o, s) {
10738
- var a = this;
10739
- return (a = e.call(this, t, "listen_stream_connection_backoff" /* ListenStreamConnectionBackoff */ , "listen_stream_idle" /* ListenStreamIdle */ , "health_check_timeout" /* HealthCheckTimeout */ , n, r, i, s) || this).k = o,
10740
- a;
10738
+ var u = this;
10739
+ return (u = e.call(this, t, "listen_stream_connection_backoff" /* ListenStreamConnectionBackoff */ , "listen_stream_idle" /* ListenStreamIdle */ , "health_check_timeout" /* HealthCheckTimeout */ , n, r, i, s) || this).k = o,
10740
+ u;
10741
10741
  }
10742
10742
  return t(n, e), n.prototype.Rr = function(t, e) {
10743
10743
  return this.ir.Qi("Listen", t, e);
@@ -10755,20 +10755,20 @@ function Jo() {
10755
10755
  }(e.targetChange.targetChangeType || "NO_CHANGE"), i = e.targetChange.targetIds || [], o = function(t, e) {
10756
10756
  return t.C ? (z(void 0 === e || "string" == typeof e), Et.fromBase64String(e || "")) : (z(void 0 === e || e instanceof Uint8Array),
10757
10757
  Et.fromUint8Array(e || new Uint8Array));
10758
- }(t, e.targetChange.resumeToken), s = e.targetChange.cause, a = s && function(t) {
10758
+ }(t, e.targetChange.resumeToken), s = e.targetChange.cause, u = s && function(t) {
10759
10759
  var e = void 0 === t.code ? H.UNKNOWN : gn(t.code);
10760
10760
  return new Y(e, t.message || "");
10761
10761
  }(s);
10762
- n = new Fn(r, i, o, a || null);
10762
+ n = new Fn(r, i, o, u || null);
10763
10763
  } else if ("documentChange" in e) {
10764
10764
  e.documentChange;
10765
- var u = e.documentChange;
10766
- u.document, u.document.name, u.document.updateTime;
10767
- var c = $n(t, u.document.name), h = Hn(u.document.updateTime), f = new Yt({
10765
+ var a = e.documentChange;
10766
+ a.document, a.document.name, a.document.updateTime;
10767
+ var c = $n(t, a.document.name), h = Hn(a.document.updateTime), f = new Yt({
10768
10768
  mapValue: {
10769
- fields: u.document.fields
10769
+ fields: a.document.fields
10770
10770
  }
10771
- }), l = Xt.newFoundDocument(c, h, f), d = u.targetIds || [], p = u.removedTargetIds || [];
10771
+ }), l = Xt.newFoundDocument(c, h, f), d = a.targetIds || [], p = a.removedTargetIds || [];
10772
10772
  n = new On(d, p, l.key, l);
10773
10773
  } else if ("documentDelete" in e) {
10774
10774
  e.documentDelete;
@@ -10812,9 +10812,9 @@ function Jo() {
10812
10812
  e.database = er(this.k), e.addTarget = function(t, e) {
10813
10813
  var n, r = e.target;
10814
10814
  return (n = ne(r) ? {
10815
- documents: ar(t, r)
10815
+ documents: ur(t, r)
10816
10816
  } : {
10817
- query: ur(t, r)
10817
+ query: ar(t, r)
10818
10818
  }).targetId = e.targetId, e.resumeToken.approximateByteSize() > 0 ? n.resumeToken = Qn(t, e.resumeToken) : e.snapshotVersion.compareTo(dt.min()) > 0 && (
10819
10819
  // TODO(wuandy): Consider removing above check because it is most likely true.
10820
10820
  // Right now, many tests depend on this behaviour though (leaving min() out
@@ -10853,9 +10853,9 @@ function Jo() {
10853
10853
  }, n;
10854
10854
  }(ts), ns = /** @class */ function(e) {
10855
10855
  function n(t, n, r, i, o, s) {
10856
- var a = this;
10857
- return (a = e.call(this, t, "write_stream_connection_backoff" /* WriteStreamConnectionBackoff */ , "write_stream_idle" /* WriteStreamIdle */ , "health_check_timeout" /* HealthCheckTimeout */ , n, r, i, s) || this).k = o,
10858
- a.Vr = !1, a;
10856
+ var u = this;
10857
+ return (u = e.call(this, t, "write_stream_connection_backoff" /* WriteStreamConnectionBackoff */ , "write_stream_idle" /* WriteStreamIdle */ , "health_check_timeout" /* HealthCheckTimeout */ , n, r, i, s) || this).k = o,
10858
+ u.Vr = !1, u;
10859
10859
  }
10860
10860
  return t(n, e), Object.defineProperty(n.prototype, "Sr", {
10861
10861
  /**
@@ -11031,7 +11031,7 @@ function Jo() {
11031
11031
  t,
11032
11032
  /** The client-side proxy for interacting with the backend. */
11033
11033
  e, i, o, s) {
11034
- var a = this;
11034
+ var u = this;
11035
11035
  this.localStore = t, this.datastore = e, this.asyncQueue = i, this.remoteSyncer = {},
11036
11036
  /**
11037
11037
  * A list of up to MAX_PENDING_WRITES writes that we have fetched from the
@@ -11075,7 +11075,7 @@ e, i, o, s) {
11075
11075
  */
11076
11076
  this.zr = [], this.Hr = s, this.Hr.Ei((function(t) {
11077
11077
  i.enqueueAndForget((function() {
11078
- return n(a, void 0, void 0, (function() {
11078
+ return n(u, void 0, void 0, (function() {
11079
11079
  return r(this, (function(t) {
11080
11080
  switch (t.label) {
11081
11081
  case 0:
@@ -11086,7 +11086,7 @@ e, i, o, s) {
11086
11086
  return r(this, (function(n) {
11087
11087
  switch (n.label) {
11088
11088
  case 0:
11089
- return (e = W(t)).Gr.add(4 /* ConnectivityChange */), [ 4 /*yield*/ , as(e) ];
11089
+ return (e = W(t)).Gr.add(4 /* ConnectivityChange */), [ 4 /*yield*/ , us(e) ];
11090
11090
 
11091
11091
  case 1:
11092
11092
  return n.sent(), e.Jr.set("Unknown" /* Unknown */), e.Gr.delete(4 /* ConnectivityChange */),
@@ -11186,7 +11186,7 @@ e, i, o, s) {
11186
11186
  /**
11187
11187
  * Temporarily disables the network. The network can be re-enabled using
11188
11188
  * enableNetwork().
11189
- */ function as(t) {
11189
+ */ function us(t) {
11190
11190
  return n(this, void 0, void 0, (function() {
11191
11191
  var e, n;
11192
11192
  return r(this, (function(r) {
@@ -11213,7 +11213,7 @@ e, i, o, s) {
11213
11213
  /**
11214
11214
  * Starts new listen for the given target. Uses resume token if provided. It
11215
11215
  * is a no-op if the target of given `TargetData` is already being listened to.
11216
- */ function us(t, e) {
11216
+ */ function as(t, e) {
11217
11217
  var n = W(t);
11218
11218
  n.Wr.has(e.targetId) || (
11219
11219
  // Mark this as something the client is currently listening for.
@@ -11303,17 +11303,17 @@ function ms(t, e) {
11303
11303
 
11304
11304
  function gs(t, e, i) {
11305
11305
  return n(this, void 0, void 0, (function() {
11306
- var o, s, a;
11307
- return r(this, (function(u) {
11308
- switch (u.label) {
11306
+ var o, s, u;
11307
+ return r(this, (function(a) {
11308
+ switch (a.label) {
11309
11309
  case 0:
11310
11310
  if (t.Jr.set("Online" /* Online */), !(e instanceof Fn && 2 /* Removed */ === e.state && e.cause))
11311
11311
  // Mark the client as online since we got a message from the server
11312
11312
  return [ 3 /*break*/ , 6 ];
11313
- u.label = 1;
11313
+ a.label = 1;
11314
11314
 
11315
11315
  case 1:
11316
- return u.trys.push([ 1, 3, , 5 ]), [ 4 /*yield*/ ,
11316
+ return a.trys.push([ 1, 3, , 5 ]), [ 4 /*yield*/ ,
11317
11317
  /** Handles an error on a target */
11318
11318
  function(t, e) {
11319
11319
  return n(this, void 0, void 0, (function() {
@@ -11343,27 +11343,27 @@ function gs(t, e, i) {
11343
11343
  }(t, e) ];
11344
11344
 
11345
11345
  case 2:
11346
- return u.sent(), [ 3 /*break*/ , 5 ];
11346
+ return a.sent(), [ 3 /*break*/ , 5 ];
11347
11347
 
11348
11348
  case 3:
11349
- return o = u.sent(), U("RemoteStore", "Failed to remove targets %s: %s ", e.targetIds.join(","), o),
11349
+ return o = a.sent(), U("RemoteStore", "Failed to remove targets %s: %s ", e.targetIds.join(","), o),
11350
11350
  [ 4 /*yield*/ , ws(t, o) ];
11351
11351
 
11352
11352
  case 4:
11353
- return u.sent(), [ 3 /*break*/ , 5 ];
11353
+ return a.sent(), [ 3 /*break*/ , 5 ];
11354
11354
 
11355
11355
  case 5:
11356
11356
  return [ 3 /*break*/ , 13 ];
11357
11357
 
11358
11358
  case 6:
11359
11359
  if (e instanceof On ? t.Yr.ot(e) : e instanceof Mn ? t.Yr.dt(e) : t.Yr.ut(e), i.isEqual(dt.min())) return [ 3 /*break*/ , 13 ];
11360
- u.label = 7;
11360
+ a.label = 7;
11361
11361
 
11362
11362
  case 7:
11363
- return u.trys.push([ 7, 11, , 13 ]), [ 4 /*yield*/ , lo(t.localStore) ];
11363
+ return a.trys.push([ 7, 11, , 13 ]), [ 4 /*yield*/ , lo(t.localStore) ];
11364
11364
 
11365
11365
  case 8:
11366
- return s = u.sent(), i.compareTo(s) >= 0 ? [ 4 /*yield*/ ,
11366
+ return s = a.sent(), i.compareTo(s) >= 0 ? [ 4 /*yield*/ ,
11367
11367
  /**
11368
11368
  * Takes a batch of changes from the Datastore, repackages them as a
11369
11369
  * RemoteEvent, and passes that on to the listener, which is typically the
@@ -11406,16 +11406,16 @@ function gs(t, e, i) {
11406
11406
  case 9:
11407
11407
  // We have received a target change with a global snapshot if the snapshot
11408
11408
  // version is not equal to SnapshotVersion.min().
11409
- u.sent(), u.label = 10;
11409
+ a.sent(), a.label = 10;
11410
11410
 
11411
11411
  case 10:
11412
11412
  return [ 3 /*break*/ , 13 ];
11413
11413
 
11414
11414
  case 11:
11415
- return U("RemoteStore", "Failed to raise snapshot:", a = u.sent()), [ 4 /*yield*/ , ws(t, a) ];
11415
+ return U("RemoteStore", "Failed to raise snapshot:", u = a.sent()), [ 4 /*yield*/ , ws(t, u) ];
11416
11416
 
11417
11417
  case 12:
11418
- return u.sent(), [ 3 /*break*/ , 13 ];
11418
+ return a.sent(), [ 3 /*break*/ , 13 ];
11419
11419
 
11420
11420
  case 13:
11421
11421
  return [ 2 /*return*/ ];
@@ -11440,7 +11440,7 @@ function gs(t, e, i) {
11440
11440
  case 0:
11441
11441
  if (!Yr(e)) throw e;
11442
11442
  // Disable network and raise offline snapshots
11443
- return t.Gr.add(1 /* IndexedDbFailed */), [ 4 /*yield*/ , as(t) ];
11443
+ return t.Gr.add(1 /* IndexedDbFailed */), [ 4 /*yield*/ , us(t) ];
11444
11444
 
11445
11445
  case 1:
11446
11446
  // Disable network and raise offline snapshots
@@ -11649,7 +11649,7 @@ function Ds(t, e) {
11649
11649
  // Tear down and re-create our network streams. This will ensure we get a
11650
11650
  // fresh auth token for the new user and re-fill the write pipeline with
11651
11651
  // new mutations from the LocalStore (since mutations are per-user).
11652
- n.Gr.add(3 /* CredentialChange */), [ 4 /*yield*/ , as(n) ];
11652
+ n.Gr.add(3 /* CredentialChange */), [ 4 /*yield*/ , us(n) ];
11653
11653
 
11654
11654
  case 1:
11655
11655
  return r.sent(), i &&
@@ -11683,7 +11683,7 @@ function Ds(t, e) {
11683
11683
  return r.sent(), [ 3 /*break*/ , 5 ];
11684
11684
 
11685
11685
  case 2:
11686
- return e ? [ 3 /*break*/ , 4 ] : (n.Gr.add(2 /* IsSecondary */), [ 4 /*yield*/ , as(n) ]);
11686
+ return e ? [ 3 /*break*/ , 4 ] : (n.Gr.add(2 /* IsSecondary */), [ 4 /*yield*/ , us(n) ]);
11687
11687
 
11688
11688
  case 3:
11689
11689
  r.sent(), n.Jr.set("Unknown" /* Unknown */), r.label = 4;
@@ -12016,9 +12016,9 @@ var Rs = /** @class */ function() {
12016
12016
  })), t;
12017
12017
  }, t;
12018
12018
  }(), Ms = /** @class */ function() {
12019
- function t(t, e, n, r, i, o, s, a) {
12019
+ function t(t, e, n, r, i, o, s, u) {
12020
12020
  this.query = t, this.docs = e, this.oldDocs = n, this.docChanges = r, this.mutatedKeys = i,
12021
- this.fromCache = o, this.syncStateChanged = s, this.excludesMetadataChanges = a
12021
+ this.fromCache = o, this.syncStateChanged = s, this.excludesMetadataChanges = u
12022
12022
  /** Returns a view snapshot as if all documents in the snapshot were added. */;
12023
12023
  }
12024
12024
  return t.fromInitialDocuments = function(e, n, r, i) {
@@ -12073,7 +12073,7 @@ var Rs = /** @class */ function() {
12073
12073
  * duplicate events for the same doc.
12074
12074
  */ function qs(t, e) {
12075
12075
  return n(this, void 0, void 0, (function() {
12076
- var n, i, o, s, a, u, c;
12076
+ var n, i, o, s, u, a, c;
12077
12077
  return r(this, (function(r) {
12078
12078
  switch (r.label) {
12079
12079
  case 0:
@@ -12082,13 +12082,13 @@ var Rs = /** @class */ function() {
12082
12082
  r.label = 1;
12083
12083
 
12084
12084
  case 1:
12085
- return r.trys.push([ 1, 3, , 4 ]), a = s, [ 4 /*yield*/ , n.onListen(i) ];
12085
+ return r.trys.push([ 1, 3, , 4 ]), u = s, [ 4 /*yield*/ , n.onListen(i) ];
12086
12086
 
12087
12087
  case 2:
12088
- return a.so = r.sent(), [ 3 /*break*/ , 4 ];
12088
+ return u.so = r.sent(), [ 3 /*break*/ , 4 ];
12089
12089
 
12090
12090
  case 3:
12091
- return u = r.sent(), c = Ls(u, "Initialization of query '" + xe(e.query) + "' failed"),
12091
+ return a = r.sent(), c = Ls(a, "Initialization of query '" + xe(e.query) + "' failed"),
12092
12092
  [ 2 /*return*/ , void e.onError(c) ];
12093
12093
 
12094
12094
  case 4:
@@ -12102,9 +12102,9 @@ var Rs = /** @class */ function() {
12102
12102
 
12103
12103
  function Us(t, e) {
12104
12104
  return n(this, void 0, void 0, (function() {
12105
- var n, i, o, s, a;
12105
+ var n, i, o, s, u;
12106
12106
  return r(this, (function(r) {
12107
- return n = W(t), i = e.query, o = !1, (s = n.queries.get(i)) && (a = s.listeners.indexOf(e)) >= 0 && (s.listeners.splice(a, 1),
12107
+ return n = W(t), i = e.query, o = !1, (s = n.queries.get(i)) && (u = s.listeners.indexOf(e)) >= 0 && (s.listeners.splice(u, 1),
12108
12108
  o = 0 === s.listeners.length), o ? [ 2 /*return*/ , (n.queries.delete(i), n.onUnlisten(i)) ] : [ 2 /*return*/ ];
12109
12109
  }));
12110
12110
  }));
@@ -12112,12 +12112,12 @@ function Us(t, e) {
12112
12112
 
12113
12113
  function Bs(t, e) {
12114
12114
  for (var n = W(t), r = !1, i = 0, o = e; i < o.length; i++) {
12115
- var s = o[i], a = s.query, u = n.queries.get(a);
12116
- if (u) {
12117
- for (var c = 0, h = u.listeners; c < h.length; c++) {
12115
+ var s = o[i], u = s.query, a = n.queries.get(u);
12116
+ if (a) {
12117
+ for (var c = 0, h = a.listeners; c < h.length; c++) {
12118
12118
  h[c].oo(s) && (r = !0);
12119
12119
  }
12120
- u.so = s;
12120
+ a.so = s;
12121
12121
  }
12122
12122
  }
12123
12123
  r && Ks(n);
@@ -12256,8 +12256,8 @@ function Ks(t) {
12256
12256
  }, t.prototype.po = function(t) {
12257
12257
  for (var e = new Map, n = new Qs(this.k), r = 0, i = t; r < i.length; r++) {
12258
12258
  var o = i[r];
12259
- if (o.metadata.queries) for (var s = n.Hn(o.metadata.name), a = 0, u = o.metadata.queries; a < u.length; a++) {
12260
- var c = u[a], h = (e.get(c) || Cn()).add(s);
12259
+ if (o.metadata.queries) for (var s = n.Hn(o.metadata.name), u = 0, a = o.metadata.queries; u < a.length; u++) {
12260
+ var c = a[u], h = (e.get(c) || Cn()).add(s);
12261
12261
  e.set(c, h);
12262
12262
  }
12263
12263
  }
@@ -12390,7 +12390,7 @@ function Hs(t) {
12390
12390
  * @returns a new set of docs, changes, and refill flag.
12391
12391
  */
12392
12392
  t.prototype.Po = function(t, e) {
12393
- var n = this, r = e ? e.vo : new Os, i = e ? e.Ro : this.Ro, o = e ? e.mutatedKeys : this.mutatedKeys, s = i, a = !1, u = Ie(this.query) && i.size === this.query.limit ? i.last() : null, c = Te(this.query) && i.size === this.query.limit ? i.first() : null;
12393
+ var n = this, r = e ? e.vo : new Os, i = e ? e.Ro : this.Ro, o = e ? e.mutatedKeys : this.mutatedKeys, s = i, u = !1, a = Ie(this.query) && i.size === this.query.limit ? i.last() : null, c = Te(this.query) && i.size === this.query.limit ? i.first() : null;
12394
12394
  // Drop documents out to meet limit/limitToLast requirement.
12395
12395
  if (t.inorderTraversal((function(t, e) {
12396
12396
  var h = i.get(t), f = Re(n.query, e) ? e : null, l = !!h && n.mutatedKeys.has(h.key), d = !!f && (f.hasLocalMutations ||
@@ -12404,21 +12404,21 @@ function Hs(t) {
12404
12404
  }), p = !0) : n.Vo(h, f) || (r.track({
12405
12405
  type: 2 /* Modified */ ,
12406
12406
  doc: f
12407
- }), p = !0, (u && n.Ao(f, u) > 0 || c && n.Ao(f, c) < 0) && (
12407
+ }), p = !0, (a && n.Ao(f, a) > 0 || c && n.Ao(f, c) < 0) && (
12408
12408
  // This doc moved from inside the limit to outside the limit.
12409
12409
  // That means there may be some other doc in the local cache
12410
12410
  // that should be included instead.
12411
- a = !0)) : !h && f ? (r.track({
12411
+ u = !0)) : !h && f ? (r.track({
12412
12412
  type: 0 /* Added */ ,
12413
12413
  doc: f
12414
12414
  }), p = !0) : h && !f && (r.track({
12415
12415
  type: 1 /* Removed */ ,
12416
12416
  doc: h
12417
- }), p = !0, (u || c) && (
12417
+ }), p = !0, (a || c) && (
12418
12418
  // A doc was removed from a full limit query. We'll need to
12419
12419
  // requery from the local cache to see if we know about some other
12420
12420
  // doc that should be in the results.
12421
- a = !0)), p && (f ? (s = s.add(f), o = d ? o.add(t) : o.delete(t)) : (s = s.delete(t),
12421
+ u = !0)), p && (f ? (s = s.add(f), o = d ? o.add(t) : o.delete(t)) : (s = s.delete(t),
12422
12422
  o = o.delete(t)));
12423
12423
  })), Ie(this.query) || Te(this.query)) for (;s.size > this.query.limit; ) {
12424
12424
  var h = Ie(this.query) ? s.last() : s.first();
@@ -12430,7 +12430,7 @@ function Hs(t) {
12430
12430
  return {
12431
12431
  Ro: s,
12432
12432
  vo: r,
12433
- Bn: a,
12433
+ Bn: u,
12434
12434
  mutatedKeys: o
12435
12435
  };
12436
12436
  }, t.prototype.Vo = function(t, e) {
@@ -12483,9 +12483,9 @@ function Hs(t) {
12483
12483
  return n(t) - n(e);
12484
12484
  }(t.type, e.type) || r.Ao(t.doc, e.doc);
12485
12485
  })), this.So(n);
12486
- var s = e ? this.Do() : [], a = 0 === this.Io.size && this.current ? 1 /* Synced */ : 0 /* Local */ , u = a !== this.Eo;
12487
- return this.Eo = a, 0 !== o.length || u ? {
12488
- snapshot: new Ms(this.query, t.Ro, i, o, t.mutatedKeys, 0 /* Local */ === a, u,
12486
+ var s = e ? this.Do() : [], u = 0 === this.Io.size && this.current ? 1 /* Synced */ : 0 /* Local */ , a = u !== this.Eo;
12487
+ return this.Eo = u, 0 !== o.length || a ? {
12488
+ snapshot: new Ms(this.query, t.Ro, i, o, t.mutatedKeys, 0 /* Local */ === u, a,
12489
12489
  /* excludesMetadataChanges= */ !1),
12490
12490
  Co: s
12491
12491
  } : {
@@ -12612,7 +12612,7 @@ n) {
12612
12612
  * the target is CURRENT.
12613
12613
  */
12614
12614
  this.$o = !1;
12615
- }, ta = /** @class */ function() {
12615
+ }, tu = /** @class */ function() {
12616
12616
  function t(t, e, n,
12617
12617
  // PORTING NOTE: Manages state synchronization in multi-tab environments.
12618
12618
  r, i, o) {
@@ -12663,13 +12663,13 @@ n) {
12663
12663
  * server. All the subsequent view snapshots or errors are sent to the
12664
12664
  * subscribed handlers. Returns the initial snapshot.
12665
12665
  */
12666
- function ea(t, e) {
12666
+ function eu(t, e) {
12667
12667
  return n(this, void 0, void 0, (function() {
12668
- var n, i, o, s, a, u;
12668
+ var n, i, o, s, u, a;
12669
12669
  return r(this, (function(r) {
12670
12670
  switch (r.label) {
12671
12671
  case 0:
12672
- return n = Ca(t), (s = n.Mo.get(e)) ? (
12672
+ return n = Cu(t), (s = n.Mo.get(e)) ? (
12673
12673
  // PORTING NOTE: With Multi-Tab Web, it is possible that a query view
12674
12674
  // already exists when EventManager calls us for the first time. This
12675
12675
  // happens when the primary tab is already listening to this query on
@@ -12682,11 +12682,11 @@ function ea(t, e) {
12682
12682
  return [ 4 /*yield*/ , mo(n.localStore, ke(e)) ];
12683
12683
 
12684
12684
  case 2:
12685
- return a = r.sent(), u = n.sharedClientState.addLocalQueryTarget(a.targetId), i = a.targetId,
12686
- [ 4 /*yield*/ , na(n, e, i, "current" === u) ];
12685
+ return u = r.sent(), a = n.sharedClientState.addLocalQueryTarget(u.targetId), i = u.targetId,
12686
+ [ 4 /*yield*/ , nu(n, e, i, "current" === a) ];
12687
12687
 
12688
12688
  case 3:
12689
- o = r.sent(), n.isPrimaryClient && us(n.remoteStore, a), r.label = 4;
12689
+ o = r.sent(), n.isPrimaryClient && as(n.remoteStore, u), r.label = 4;
12690
12690
 
12691
12691
  case 4:
12692
12692
  return [ 2 /*return*/ , o ];
@@ -12698,9 +12698,9 @@ function ea(t, e) {
12698
12698
  /**
12699
12699
  * Registers a view for a previously unknown query and computes its initial
12700
12700
  * snapshot.
12701
- */ function na(t, e, i, o) {
12701
+ */ function nu(t, e, i, o) {
12702
12702
  return n(this, void 0, void 0, (function() {
12703
- var s, a, u, c, h, f;
12703
+ var s, u, a, c, h, f;
12704
12704
  return r(this, (function(l) {
12705
12705
  switch (l.label) {
12706
12706
  case 0:
@@ -12710,7 +12710,7 @@ function ea(t, e) {
12710
12710
  return t.Go = function(e, i, o) {
12711
12711
  return function(t, e, i, o) {
12712
12712
  return n(this, void 0, void 0, (function() {
12713
- var n, s, a;
12713
+ var n, s, u;
12714
12714
  return r(this, (function(r) {
12715
12715
  switch (r.label) {
12716
12716
  case 0:
@@ -12727,9 +12727,9 @@ function ea(t, e) {
12727
12727
  n = r.sent(), r.label = 2;
12728
12728
 
12729
12729
  case 2:
12730
- return s = o && o.targetChanges.get(e.targetId), a = e.view.applyChanges(n,
12731
- /* updateLimboDocuments= */ t.isPrimaryClient, s), [ 2 /*return*/ , (ya(t, e.targetId, a.Co),
12732
- a.snapshot) ];
12730
+ return s = o && o.targetChanges.get(e.targetId), u = e.view.applyChanges(n,
12731
+ /* updateLimboDocuments= */ t.isPrimaryClient, s), [ 2 /*return*/ , (yu(t, e.targetId, u.Co),
12732
+ u.snapshot) ];
12733
12733
  }
12734
12734
  }));
12735
12735
  }));
@@ -12738,9 +12738,9 @@ function ea(t, e) {
12738
12738
  /* usePreviousResults= */ !0) ];
12739
12739
 
12740
12740
  case 1:
12741
- return s = l.sent(), a = new Xs(e, s.zn), u = a.Po(s.documents), c = Pn.createSynthesizedTargetChangeForCurrentChange(i, o && "Offline" /* Offline */ !== t.onlineState),
12742
- h = a.applyChanges(u,
12743
- /* updateLimboDocuments= */ t.isPrimaryClient, c), ya(t, i, h.Co), f = new $s(e, i, a),
12741
+ return s = l.sent(), u = new Xs(e, s.zn), a = u.Po(s.documents), c = Pn.createSynthesizedTargetChangeForCurrentChange(i, o && "Offline" /* Offline */ !== t.onlineState),
12742
+ h = u.applyChanges(a,
12743
+ /* updateLimboDocuments= */ t.isPrimaryClient, c), yu(t, i, h.Co), f = new $s(e, i, u),
12744
12744
  [ 2 /*return*/ , (t.Mo.set(e, f), t.Fo.has(i) ? t.Fo.get(i).push(e) : t.Fo.set(i, [ e ]),
12745
12745
  h.snapshot) ];
12746
12746
  }
@@ -12748,7 +12748,7 @@ function ea(t, e) {
12748
12748
  }));
12749
12749
  }
12750
12750
 
12751
- /** Stops listening to the query. */ function ra(t, e) {
12751
+ /** Stops listening to the query. */ function ru(t, e) {
12752
12752
  return n(this, void 0, void 0, (function() {
12753
12753
  var n, i, o;
12754
12754
  return r(this, (function(r) {
@@ -12762,7 +12762,7 @@ function ea(t, e) {
12762
12762
  n.sharedClientState.removeLocalQueryTarget(i.targetId), n.sharedClientState.isActiveQueryTarget(i.targetId) ? [ 3 /*break*/ , 2 ] : [ 4 /*yield*/ , go(n.localStore, i.targetId,
12763
12763
  /*keepPersistedTargetData=*/ !1).then((function() {
12764
12764
  n.sharedClientState.clearQueryState(i.targetId), cs(n.remoteStore, i.targetId),
12765
- da(n, i.targetId);
12765
+ du(n, i.targetId);
12766
12766
  })).catch(Fi) ]) : [ 3 /*break*/ , 3 ];
12767
12767
 
12768
12768
  case 1:
@@ -12772,7 +12772,7 @@ function ea(t, e) {
12772
12772
  return [ 3 /*break*/ , 5 ];
12773
12773
 
12774
12774
  case 3:
12775
- return da(n, i.targetId), [ 4 /*yield*/ , go(n.localStore, i.targetId,
12775
+ return du(n, i.targetId), [ 4 /*yield*/ , go(n.localStore, i.targetId,
12776
12776
  /*keepPersistedTargetData=*/ !0) ];
12777
12777
 
12778
12778
  case 4:
@@ -12794,13 +12794,13 @@ function ea(t, e) {
12794
12794
  * have completed, *not* when the write was acked by the backend. The
12795
12795
  * userCallback is resolved once the write was acked/rejected by the
12796
12796
  * backend (or failed locally for any other reason).
12797
- */ function ia(t, e, i) {
12797
+ */ function iu(t, e, i) {
12798
12798
  return n(this, void 0, void 0, (function() {
12799
- var n, o, s, a;
12799
+ var n, o, s, u;
12800
12800
  return r(this, (function(r) {
12801
12801
  switch (r.label) {
12802
12802
  case 0:
12803
- n = xa(t), r.label = 1;
12803
+ n = xu(t), r.label = 1;
12804
12804
 
12805
12805
  case 1:
12806
12806
  return r.trys.push([ 1, 5, , 6 ]), [ 4 /*yield*/ , function(t, e) {
@@ -12816,13 +12816,13 @@ function ea(t, e) {
12816
12816
  // later used to guarantee consistent values and prevents flicker
12817
12817
  // even if the backend sends us an update that already includes our
12818
12818
  // transform.
12819
- var s = [], a = 0, u = e; a < u.length; a++) {
12820
- var c = u[a], h = rn(c, n.get(c.key));
12819
+ var s = [], u = 0, a = e; u < a.length; u++) {
12820
+ var c = a[u], h = rn(c, n.get(c.key));
12821
12821
  null != h &&
12822
12822
  // NOTE: The base state should only be applied if there's some
12823
12823
  // existing document to override, so use a Precondition of
12824
12824
  // exists=true
12825
- s.push(new un(c.key, h, Jt(h.value.mapValue), $e.exists(!0)));
12825
+ s.push(new an(c.key, h, Jt(h.value.mapValue), $e.exists(!0)));
12826
12826
  }
12827
12827
  return r.An.addMutationBatch(t, i, s, e);
12828
12828
  }));
@@ -12838,7 +12838,7 @@ function ea(t, e) {
12838
12838
  return o = r.sent(), n.sharedClientState.addPendingMutation(o.batchId), function(t, e, n) {
12839
12839
  var r = t.Ko[t.currentUser.toKey()];
12840
12840
  r || (r = new wn(ct)), r = r.insert(e, n), t.Ko[t.currentUser.toKey()] = r;
12841
- }(n, o.batchId, i), [ 4 /*yield*/ , ga(n, o.changes) ];
12841
+ }(n, o.batchId, i), [ 4 /*yield*/ , gu(n, o.changes) ];
12842
12842
 
12843
12843
  case 3:
12844
12844
  return r.sent(), [ 4 /*yield*/ , Is(n.remoteStore) ];
@@ -12847,7 +12847,7 @@ function ea(t, e) {
12847
12847
  return r.sent(), [ 3 /*break*/ , 6 ];
12848
12848
 
12849
12849
  case 5:
12850
- return s = r.sent(), a = Ls(s, "Failed to persist write"), i.reject(a), [ 3 /*break*/ , 6 ];
12850
+ return s = r.sent(), u = Ls(s, "Failed to persist write"), i.reject(u), [ 3 /*break*/ , 6 ];
12851
12851
 
12852
12852
  case 6:
12853
12853
  return [ 2 /*return*/ ];
@@ -12860,7 +12860,7 @@ function ea(t, e) {
12860
12860
  * Applies one remote event to the sync engine, notifying any views of the
12861
12861
  * changes, and releasing any pending mutation batches that would become
12862
12862
  * visible because of the snapshot version the remote event contains.
12863
- */ function oa(t, e) {
12863
+ */ function ou(t, e) {
12864
12864
  return n(this, void 0, void 0, (function() {
12865
12865
  var n, i;
12866
12866
  return r(this, (function(r) {
@@ -12882,7 +12882,7 @@ function ea(t, e) {
12882
12882
  z(t.addedDocuments.size + t.modifiedDocuments.size + t.removedDocuments.size <= 1),
12883
12883
  t.addedDocuments.size > 0 ? r.$o = !0 : t.modifiedDocuments.size > 0 ? z(r.$o) : t.removedDocuments.size > 0 && (z(r.$o),
12884
12884
  r.$o = !1));
12885
- })), [ 4 /*yield*/ , ga(n, i, e) ];
12885
+ })), [ 4 /*yield*/ , gu(n, i, e) ];
12886
12886
 
12887
12887
  case 3:
12888
12888
  // Update `receivedDocument` as appropriate for any limbo targets.
@@ -12904,7 +12904,7 @@ function ea(t, e) {
12904
12904
  /**
12905
12905
  * Applies an OnlineState change to the sync engine and notifies any views of
12906
12906
  * the change.
12907
- */ function sa(t, e, n) {
12907
+ */ function su(t, e, n) {
12908
12908
  var r = W(t);
12909
12909
  // If we are the secondary client, we explicitly ignore the remote store's
12910
12910
  // online state (the local client may go offline, even though the primary
@@ -12939,9 +12939,9 @@ function ea(t, e) {
12939
12939
  * @param err - A description of the condition that has forced the rejection.
12940
12940
  * Nearly always this will be an indication that the user is no longer
12941
12941
  * authorized to see the data matching the target.
12942
- */ function aa(t, e, i) {
12942
+ */ function uu(t, e, i) {
12943
12943
  return n(this, void 0, void 0, (function() {
12944
- var n, o, s, a, u, c;
12944
+ var n, o, s, u, a, c;
12945
12945
  return r(this, (function(r) {
12946
12946
  switch (r.label) {
12947
12947
  case 0:
@@ -12951,10 +12951,10 @@ function ea(t, e) {
12951
12951
  // TODO(b/217189216): This limbo document should ideally have a read time,
12952
12952
  // so that it is picked up by any read-time based scans. The backend,
12953
12953
  // however, does not send a read time for target removals.
12954
- a = (a = new wn(Pt.comparator)).insert(s, Xt.newNoDocument(s, dt.min())), u = Cn().add(s),
12954
+ u = (u = new wn(Pt.comparator)).insert(s, Xt.newNoDocument(s, dt.min())), a = Cn().add(s),
12955
12955
  c = new Ln(dt.min(),
12956
12956
  /* targetChanges= */ new Map,
12957
- /* targetMismatches= */ new Tn(ct), a, u), [ 4 /*yield*/ , oa(n, c) ]) : [ 3 /*break*/ , 2 ];
12957
+ /* targetMismatches= */ new Tn(ct), u, a), [ 4 /*yield*/ , ou(n, c) ]) : [ 3 /*break*/ , 2 ];
12958
12958
 
12959
12959
  case 1:
12960
12960
  return r.sent(),
@@ -12963,12 +12963,12 @@ function ea(t, e) {
12963
12963
  // RemoteEvent. If `applyRemoteEvent()` throws, we want to re-listen to
12964
12964
  // this query when the RemoteStore restarts the Watch stream, which should
12965
12965
  // re-trigger the target failure.
12966
- n.Bo = n.Bo.remove(s), n.Uo.delete(e), ma(n), [ 3 /*break*/ , 4 ];
12966
+ n.Bo = n.Bo.remove(s), n.Uo.delete(e), mu(n), [ 3 /*break*/ , 4 ];
12967
12967
 
12968
12968
  case 2:
12969
12969
  return [ 4 /*yield*/ , go(n.localStore, e,
12970
12970
  /* keepPersistedTargetData */ !1).then((function() {
12971
- return da(n, e, i);
12971
+ return du(n, e, i);
12972
12972
  })).catch(Fi) ];
12973
12973
 
12974
12974
  case 3:
@@ -12981,7 +12981,7 @@ function ea(t, e) {
12981
12981
  }));
12982
12982
  }
12983
12983
 
12984
- function ua(t, e) {
12984
+ function au(t, e) {
12985
12985
  return n(this, void 0, void 0, (function() {
12986
12986
  var n, i, o;
12987
12987
  return r(this, (function(r) {
@@ -12998,8 +12998,8 @@ function ua(t, e) {
12998
12998
  // raise events immediately (depending on whether the watcher is caught
12999
12999
  // up), so we raise user callbacks first so that they consistently happen
13000
13000
  // before listen events.
13001
- la(n, i, /*error=*/ null), fa(n, i), n.sharedClientState.updateMutationState(i, "acknowledged"),
13002
- [ 4 /*yield*/ , ga(n, o) ];
13001
+ lu(n, i, /*error=*/ null), fu(n, i), n.sharedClientState.updateMutationState(i, "acknowledged"),
13002
+ [ 4 /*yield*/ , gu(n, o) ];
13003
13003
 
13004
13004
  case 3:
13005
13005
  // The local store may or may not be able to apply the write result and
@@ -13021,7 +13021,7 @@ function ua(t, e) {
13021
13021
  }));
13022
13022
  }
13023
13023
 
13024
- function ca(t, e, i) {
13024
+ function cu(t, e, i) {
13025
13025
  return n(this, void 0, void 0, (function() {
13026
13026
  var n, o;
13027
13027
  return r(this, (function(r) {
@@ -13050,8 +13050,8 @@ function ca(t, e, i) {
13050
13050
  // raise events immediately (depending on whether the watcher is caught up),
13051
13051
  // so we raise user callbacks first so that they consistently happen before
13052
13052
  // listen events.
13053
- la(n, e, i), fa(n, e), n.sharedClientState.updateMutationState(e, "rejected", i),
13054
- [ 4 /*yield*/ , ga(n, o) ];
13053
+ lu(n, e, i), fu(n, e), n.sharedClientState.updateMutationState(e, "rejected", i),
13054
+ [ 4 /*yield*/ , gu(n, o) ];
13055
13055
 
13056
13056
  case 3:
13057
13057
  // The local store may or may not be able to apply the write result and
@@ -13076,9 +13076,9 @@ function ca(t, e, i) {
13076
13076
  /**
13077
13077
  * Registers a user callback that resolves when all pending mutations at the moment of calling
13078
13078
  * are acknowledged .
13079
- */ function ha(t, e) {
13079
+ */ function hu(t, e) {
13080
13080
  return n(this, void 0, void 0, (function() {
13081
- var n, i, o, s, a;
13081
+ var n, i, o, s, u;
13082
13082
  return r(this, (function(r) {
13083
13083
  switch (r.label) {
13084
13084
  case 0:
@@ -13098,8 +13098,8 @@ function ca(t, e, i) {
13098
13098
  n.jo.set(i, o), [ 3 /*break*/ , 4 ]);
13099
13099
 
13100
13100
  case 3:
13101
- return s = r.sent(), a = Ls(s, "Initialization of waitForPendingWrites() operation failed"),
13102
- e.reject(a), [ 3 /*break*/ , 4 ];
13101
+ return s = r.sent(), u = Ls(s, "Initialization of waitForPendingWrites() operation failed"),
13102
+ e.reject(u), [ 3 /*break*/ , 4 ];
13103
13103
 
13104
13104
  case 4:
13105
13105
  return [ 2 /*return*/ ];
@@ -13111,14 +13111,14 @@ function ca(t, e, i) {
13111
13111
  /**
13112
13112
  * Triggers the callbacks that are waiting for this batch id to get acknowledged by server,
13113
13113
  * if there are any.
13114
- */ function fa(t, e) {
13114
+ */ function fu(t, e) {
13115
13115
  (t.jo.get(e) || []).forEach((function(t) {
13116
13116
  t.resolve();
13117
13117
  })), t.jo.delete(e)
13118
13118
  /** Reject all outstanding callbacks waiting for pending writes to complete. */;
13119
13119
  }
13120
13120
 
13121
- function la(t, e, n) {
13121
+ function lu(t, e, n) {
13122
13122
  var r = W(t), i = r.Ko[r.currentUser.toKey()];
13123
13123
  // NOTE: Mutations restored from persistence won't have callbacks, so it's
13124
13124
  // okay for there to be no callback for this ID.
@@ -13128,7 +13128,7 @@ function la(t, e, n) {
13128
13128
  }
13129
13129
  }
13130
13130
 
13131
- function da(t, e, n) {
13131
+ function du(t, e, n) {
13132
13132
  void 0 === n && (n = null), t.sharedClientState.removeLocalQueryTarget(e);
13133
13133
  for (var r = 0, i = t.Fo.get(e); r < i.length; r++) {
13134
13134
  var o = i[r];
@@ -13137,32 +13137,32 @@ function da(t, e, n) {
13137
13137
  t.Fo.delete(e), t.isPrimaryClient && t.qo.us(e).forEach((function(e) {
13138
13138
  t.qo.containsKey(e) ||
13139
13139
  // We removed the last reference for this key
13140
- pa(t, e);
13140
+ pu(t, e);
13141
13141
  }));
13142
13142
  }
13143
13143
 
13144
- function pa(t, e) {
13144
+ function pu(t, e) {
13145
13145
  t.Lo.delete(e.path.canonicalString());
13146
13146
  // It's possible that the target already got removed because the query failed. In that case,
13147
13147
  // the key won't exist in `limboTargetsByKey`. Only do the cleanup if we still have the target.
13148
13148
  var n = t.Bo.get(e);
13149
- null !== n && (cs(t.remoteStore, n), t.Bo = t.Bo.remove(e), t.Uo.delete(n), ma(t));
13149
+ null !== n && (cs(t.remoteStore, n), t.Bo = t.Bo.remove(e), t.Uo.delete(n), mu(t));
13150
13150
  }
13151
13151
 
13152
- function ya(t, e, n) {
13152
+ function yu(t, e, n) {
13153
13153
  for (var r = 0, i = n; r < i.length; r++) {
13154
13154
  var o = i[r];
13155
- o instanceof Ys ? (t.qo.addReference(o.key, e), va(t, o)) : o instanceof Js ? (U("SyncEngine", "Document no longer in limbo: " + o.key),
13155
+ o instanceof Ys ? (t.qo.addReference(o.key, e), vu(t, o)) : o instanceof Js ? (U("SyncEngine", "Document no longer in limbo: " + o.key),
13156
13156
  t.qo.removeReference(o.key, e), t.qo.containsKey(o.key) ||
13157
13157
  // We removed the last reference for this key
13158
- pa(t, o.key)) : G();
13158
+ pu(t, o.key)) : G();
13159
13159
  }
13160
13160
  }
13161
13161
 
13162
- function va(t, e) {
13162
+ function vu(t, e) {
13163
13163
  var n = e.key, r = n.path.canonicalString();
13164
13164
  t.Bo.get(n) || t.Lo.has(r) || (U("SyncEngine", "New document in limbo: " + n), t.Lo.add(r),
13165
- ma(t));
13165
+ mu(t));
13166
13166
  }
13167
13167
 
13168
13168
  /**
@@ -13172,36 +13172,36 @@ function va(t, e) {
13172
13172
  * Without bounding the number of concurrent resolutions, the server can fail
13173
13173
  * with "resource exhausted" errors which can lead to pathological client
13174
13174
  * behavior as seen in https://github.com/firebase/firebase-js-sdk/issues/2683.
13175
- */ function ma(t) {
13175
+ */ function mu(t) {
13176
13176
  for (;t.Lo.size > 0 && t.Bo.size < t.maxConcurrentLimboResolutions; ) {
13177
13177
  var e = t.Lo.values().next().value;
13178
13178
  t.Lo.delete(e);
13179
13179
  var n = new Pt(gt.fromString(e)), r = t.Qo.next();
13180
- t.Uo.set(r, new Zs(n)), t.Bo = t.Bo.insert(n, r), us(t.remoteStore, new ii(ke(be(n.path)), r, 2 /* LimboResolution */ , st.I));
13180
+ t.Uo.set(r, new Zs(n)), t.Bo = t.Bo.insert(n, r), as(t.remoteStore, new ii(ke(be(n.path)), r, 2 /* LimboResolution */ , st.I));
13181
13181
  }
13182
13182
  }
13183
13183
 
13184
- function ga(t, e, i) {
13184
+ function gu(t, e, i) {
13185
13185
  return n(this, void 0, void 0, (function() {
13186
- var o, s, a, u;
13186
+ var o, s, u, a;
13187
13187
  return r(this, (function(c) {
13188
13188
  switch (c.label) {
13189
13189
  case 0:
13190
- return o = W(t), s = [], a = [], u = [], o.Mo.isEmpty() ? [ 3 /*break*/ , 3 ] : (o.Mo.forEach((function(t, n) {
13191
- u.push(o.Go(n, e, i).then((function(t) {
13190
+ return o = W(t), s = [], u = [], a = [], o.Mo.isEmpty() ? [ 3 /*break*/ , 3 ] : (o.Mo.forEach((function(t, n) {
13191
+ a.push(o.Go(n, e, i).then((function(t) {
13192
13192
  if (t) {
13193
13193
  o.isPrimaryClient && o.sharedClientState.updateQueryState(n.targetId, t.fromCache ? "not-current" : "current"),
13194
13194
  s.push(t);
13195
13195
  var e = so.$n(n.targetId, t);
13196
- a.push(e);
13196
+ u.push(e);
13197
13197
  }
13198
13198
  })));
13199
- })), [ 4 /*yield*/ , Promise.all(u) ]);
13199
+ })), [ 4 /*yield*/ , Promise.all(a) ]);
13200
13200
 
13201
13201
  case 1:
13202
13202
  return c.sent(), o.Oo.br(s), [ 4 /*yield*/ , function(t, e) {
13203
13203
  return n(this, void 0, void 0, (function() {
13204
- var n, i, o, s, a, u, c, h, f;
13204
+ var n, i, o, s, u, a, c, h, f;
13205
13205
  return r(this, (function(r) {
13206
13206
  switch (r.label) {
13207
13207
  case 0:
@@ -13233,15 +13233,15 @@ function ga(t, e, i) {
13233
13233
  [ 3 /*break*/ , 4 ];
13234
13234
 
13235
13235
  case 4:
13236
- for (o = 0, s = e; o < s.length; o++) a = s[o], u = a.targetId, a.fromCache || (c = n.qn.get(u),
13236
+ for (o = 0, s = e; o < s.length; o++) u = s[o], a = u.targetId, u.fromCache || (c = n.qn.get(a),
13237
13237
  h = c.snapshotVersion, f = c.withLastLimboFreeSnapshotVersion(h),
13238
13238
  // Advance the last limbo free snapshot version
13239
- n.qn = n.qn.insert(u, f));
13239
+ n.qn = n.qn.insert(a, f));
13240
13240
  return [ 2 /*return*/ ];
13241
13241
  }
13242
13242
  }));
13243
13243
  }));
13244
- }(o.localStore, a) ];
13244
+ }(o.localStore, u) ];
13245
13245
 
13246
13246
  case 2:
13247
13247
  c.sent(), c.label = 3;
@@ -13253,7 +13253,7 @@ function ga(t, e, i) {
13253
13253
  }));
13254
13254
  }
13255
13255
 
13256
- function wa(t, e) {
13256
+ function wu(t, e) {
13257
13257
  return n(this, void 0, void 0, (function() {
13258
13258
  var n, i;
13259
13259
  return r(this, (function(r) {
@@ -13273,7 +13273,7 @@ function wa(t, e) {
13273
13273
  })), t.jo.clear();
13274
13274
  }(n),
13275
13275
  // TODO(b/114226417): Consider calling this only in the primary tab.
13276
- n.sharedClientState.handleUserChange(e, i.removedBatchIds, i.addedBatchIds), [ 4 /*yield*/ , ga(n, i.Gn) ];
13276
+ n.sharedClientState.handleUserChange(e, i.removedBatchIds, i.addedBatchIds), [ 4 /*yield*/ , gu(n, i.Gn) ];
13277
13277
 
13278
13278
  case 2:
13279
13279
  r.sent(), r.label = 3;
@@ -13285,13 +13285,13 @@ function wa(t, e) {
13285
13285
  }));
13286
13286
  }
13287
13287
 
13288
- function ba(t, e) {
13288
+ function bu(t, e) {
13289
13289
  var n = W(t), r = n.Uo.get(e);
13290
13290
  if (r && r.$o) return Cn().add(r.key);
13291
13291
  var i = Cn(), o = n.Fo.get(e);
13292
13292
  if (!o) return i;
13293
- for (var s = 0, a = o; s < a.length; s++) {
13294
- var u = a[s], c = n.Mo.get(u);
13293
+ for (var s = 0, u = o; s < u.length; s++) {
13294
+ var a = u[s], c = n.Mo.get(a);
13295
13295
  i = i.unionWith(c.view.bo);
13296
13296
  }
13297
13297
  return i;
@@ -13300,7 +13300,7 @@ function ba(t, e) {
13300
13300
  /**
13301
13301
  * Reconcile the list of synced documents in an existing view with those
13302
13302
  * from persistence.
13303
- */ function Ia(t, e) {
13303
+ */ function Iu(t, e) {
13304
13304
  return n(this, void 0, void 0, (function() {
13305
13305
  var n, i, o;
13306
13306
  return r(this, (function(r) {
@@ -13310,7 +13310,7 @@ function ba(t, e) {
13310
13310
  /* usePreviousResults= */ !0) ];
13311
13311
 
13312
13312
  case 1:
13313
- return i = r.sent(), o = e.view.ko(i), [ 2 /*return*/ , (n.isPrimaryClient && ya(n, e.targetId, o.Co),
13313
+ return i = r.sent(), o = e.view.ko(i), [ 2 /*return*/ , (n.isPrimaryClient && yu(n, e.targetId, o.Co),
13314
13314
  o) ];
13315
13315
  }
13316
13316
  }));
@@ -13322,12 +13322,12 @@ function ba(t, e) {
13322
13322
  * snapshots if needed.
13323
13323
  */
13324
13324
  // PORTING NOTE: Multi-Tab only.
13325
- function Ta(t) {
13325
+ function Tu(t) {
13326
13326
  return n(this, void 0, void 0, (function() {
13327
13327
  var e;
13328
13328
  return r(this, (function(n) {
13329
13329
  return [ 2 /*return*/ , Io((e = W(t)).localStore).then((function(t) {
13330
- return ga(e, t);
13330
+ return gu(e, t);
13331
13331
  })) ];
13332
13332
  }));
13333
13333
  }));
@@ -13335,7 +13335,7 @@ function Ta(t) {
13335
13335
 
13336
13336
  /** Applies a mutation state to an existing batch. */
13337
13337
  // PORTING NOTE: Multi-Tab only.
13338
- function Ea(t, e, i, o) {
13338
+ function Eu(t, e, i, o) {
13339
13339
  return n(this, void 0, void 0, (function() {
13340
13340
  var n, s;
13341
13341
  return r(this, (function(r) {
@@ -13363,12 +13363,12 @@ function Ea(t, e, i, o) {
13363
13363
  "acknowledged" === i || "rejected" === i ? (
13364
13364
  // NOTE: Both these methods are no-ops for batches that originated from
13365
13365
  // other clients.
13366
- la(n, e, o || null), fa(n, e), function(t, e) {
13366
+ lu(n, e, o || null), fu(n, e), function(t, e) {
13367
13367
  W(W(t).An).ee(e);
13368
13368
  }(n.localStore, e)) : G(), r.label = 4;
13369
13369
 
13370
13370
  case 4:
13371
- return [ 4 /*yield*/ , ga(n, s) ];
13371
+ return [ 4 /*yield*/ , gu(n, s) ];
13372
13372
 
13373
13373
  case 5:
13374
13374
  return r.sent(), [ 3 /*break*/ , 7 ];
@@ -13392,33 +13392,33 @@ function Ea(t, e, i, o) {
13392
13392
 
13393
13393
  /** Applies a query target change from a different tab. */
13394
13394
  // PORTING NOTE: Multi-Tab only.
13395
- function Sa(t, e) {
13395
+ function Su(t, e) {
13396
13396
  return n(this, void 0, void 0, (function() {
13397
- var n, i, o, s, a, u, c, h;
13397
+ var n, i, o, s, u, a, c, h;
13398
13398
  return r(this, (function(r) {
13399
13399
  switch (r.label) {
13400
13400
  case 0:
13401
- return Ca(n = W(t)), xa(n), !0 !== e || !0 === n.Wo ? [ 3 /*break*/ , 3 ] : (i = n.sharedClientState.getAllActiveQueryTargets(),
13402
- [ 4 /*yield*/ , _a(n, i.toArray()) ]);
13401
+ return Cu(n = W(t)), xu(n), !0 !== e || !0 === n.Wo ? [ 3 /*break*/ , 3 ] : (i = n.sharedClientState.getAllActiveQueryTargets(),
13402
+ [ 4 /*yield*/ , _u(n, i.toArray()) ]);
13403
13403
 
13404
13404
  case 1:
13405
13405
  return o = r.sent(), n.Wo = !0, [ 4 /*yield*/ , Ns(n.remoteStore, !0) ];
13406
13406
 
13407
13407
  case 2:
13408
- for (r.sent(), s = 0, a = o; s < a.length; s++) u = a[s], us(n.remoteStore, u);
13408
+ for (r.sent(), s = 0, u = o; s < u.length; s++) a = u[s], as(n.remoteStore, a);
13409
13409
  return [ 3 /*break*/ , 7 ];
13410
13410
 
13411
13411
  case 3:
13412
13412
  return !1 !== e || !1 === n.Wo ? [ 3 /*break*/ , 7 ] : (c = [], h = Promise.resolve(),
13413
13413
  n.Fo.forEach((function(t, e) {
13414
13414
  n.sharedClientState.isLocalQueryTarget(e) ? c.push(e) : h = h.then((function() {
13415
- return da(n, e), go(n.localStore, e,
13415
+ return du(n, e), go(n.localStore, e,
13416
13416
  /*keepPersistedTargetData=*/ !0);
13417
13417
  })), cs(n.remoteStore, e);
13418
13418
  })), [ 4 /*yield*/ , h ]);
13419
13419
 
13420
13420
  case 4:
13421
- return r.sent(), [ 4 /*yield*/ , _a(n, c) ];
13421
+ return r.sent(), [ 4 /*yield*/ , _u(n, c) ];
13422
13422
 
13423
13423
  case 5:
13424
13424
  return r.sent(),
@@ -13440,16 +13440,16 @@ function Sa(t, e) {
13440
13440
  }));
13441
13441
  }
13442
13442
 
13443
- function _a(t, e, i) {
13443
+ function _u(t, e, i) {
13444
13444
  return n(this, void 0, void 0, (function() {
13445
- var n, i, o, s, a, u, c, h, f, l, d, p, y, v;
13445
+ var n, i, o, s, u, a, c, h, f, l, d, p, y, v;
13446
13446
  return r(this, (function(r) {
13447
13447
  switch (r.label) {
13448
13448
  case 0:
13449
- n = W(t), i = [], o = [], s = 0, a = e, r.label = 1;
13449
+ n = W(t), i = [], o = [], s = 0, u = e, r.label = 1;
13450
13450
 
13451
13451
  case 1:
13452
- return s < a.length ? (u = a[s], c = void 0, (h = n.Fo.get(u)) && 0 !== h.length ? [ 4 /*yield*/ , mo(n.localStore, ke(h[0])) ] : [ 3 /*break*/ , 7 ]) : [ 3 /*break*/ , 13 ];
13452
+ return s < u.length ? (a = u[s], c = void 0, (h = n.Fo.get(a)) && 0 !== h.length ? [ 4 /*yield*/ , mo(n.localStore, ke(h[0])) ] : [ 3 /*break*/ , 7 ]) : [ 3 /*break*/ , 13 ];
13453
13453
 
13454
13454
  case 2:
13455
13455
  // For queries that have a local View, we fetch their current state
@@ -13459,7 +13459,7 @@ function _a(t, e, i) {
13459
13459
  c = r.sent(), f = 0, l = h, r.label = 3;
13460
13460
 
13461
13461
  case 3:
13462
- return f < l.length ? (d = l[f], p = n.Mo.get(d), [ 4 /*yield*/ , Ia(n, p) ]) : [ 3 /*break*/ , 6 ];
13462
+ return f < l.length ? (d = l[f], p = n.Mo.get(d), [ 4 /*yield*/ , Iu(n, p) ]) : [ 3 /*break*/ , 6 ];
13463
13463
 
13464
13464
  case 4:
13465
13465
  (y = r.sent()).snapshot && o.push(y.snapshot), r.label = 5;
@@ -13471,13 +13471,13 @@ function _a(t, e, i) {
13471
13471
  return [ 3 /*break*/ , 11 ];
13472
13472
 
13473
13473
  case 7:
13474
- return [ 4 /*yield*/ , bo(n.localStore, u) ];
13474
+ return [ 4 /*yield*/ , bo(n.localStore, a) ];
13475
13475
 
13476
13476
  case 8:
13477
13477
  return v = r.sent(), [ 4 /*yield*/ , mo(n.localStore, v) ];
13478
13478
 
13479
13479
  case 9:
13480
- return c = r.sent(), [ 4 /*yield*/ , na(n, Aa(v), u,
13480
+ return c = r.sent(), [ 4 /*yield*/ , nu(n, Au(v), a,
13481
13481
  /*current=*/ !1) ];
13482
13482
 
13483
13483
  case 10:
@@ -13507,22 +13507,22 @@ function _a(t, e, i) {
13507
13507
  * difference will not cause issues.
13508
13508
  */
13509
13509
  // PORTING NOTE: Multi-Tab only.
13510
- function Aa(t) {
13510
+ function Au(t) {
13511
13511
  return we(t.path, t.collectionGroup, t.orderBy, t.filters, t.limit, "F" /* First */ , t.startAt, t.endAt);
13512
13512
  }
13513
13513
 
13514
13514
  /** Returns the IDs of the clients that are currently active. */
13515
13515
  // PORTING NOTE: Multi-Tab only.
13516
- function ka(t) {
13516
+ function ku(t) {
13517
13517
  var e = W(t);
13518
13518
  return W(W(e.localStore).persistence).Tn();
13519
13519
  }
13520
13520
 
13521
13521
  /** Applies a query target change from a different tab. */
13522
13522
  // PORTING NOTE: Multi-Tab only.
13523
- function Da(t, e, i, o) {
13523
+ function Du(t, e, i, o) {
13524
13524
  return n(this, void 0, void 0, (function() {
13525
- var n, s, a;
13525
+ var n, s, u;
13526
13526
  return r(this, (function(r) {
13527
13527
  switch (r.label) {
13528
13528
  case 0:
@@ -13547,8 +13547,8 @@ function Da(t, e, i, o) {
13547
13547
  return [ 4 /*yield*/ , Io(n.localStore) ];
13548
13548
 
13549
13549
  case 3:
13550
- return s = r.sent(), a = Ln.createSynthesizedRemoteEventForCurrentChange(e, "current" === i),
13551
- [ 4 /*yield*/ , ga(n, s, a) ];
13550
+ return s = r.sent(), u = Ln.createSynthesizedRemoteEventForCurrentChange(e, "current" === i),
13551
+ [ 4 /*yield*/ , gu(n, s, u) ];
13552
13552
 
13553
13553
  case 4:
13554
13554
  return r.sent(), [ 3 /*break*/ , 8 ];
@@ -13558,7 +13558,7 @@ function Da(t, e, i, o) {
13558
13558
  /* keepPersistedTargetData */ !0) ];
13559
13559
 
13560
13560
  case 6:
13561
- return r.sent(), da(n, e, o), [ 3 /*break*/ , 8 ];
13561
+ return r.sent(), du(n, e, o), [ 3 /*break*/ , 8 ];
13562
13562
 
13563
13563
  case 7:
13564
13564
  G(), r.label = 8;
@@ -13570,29 +13570,29 @@ function Da(t, e, i, o) {
13570
13570
  }));
13571
13571
  }
13572
13572
 
13573
- /** Adds or removes Watch targets for queries from different tabs. */ function Na(t, e, i) {
13573
+ /** Adds or removes Watch targets for queries from different tabs. */ function Nu(t, e, i) {
13574
13574
  return n(this, void 0, void 0, (function() {
13575
- var n, o, s, a, u, c, h, f, l, d;
13575
+ var n, o, s, u, a, c, h, f, l, d;
13576
13576
  return r(this, (function(p) {
13577
13577
  switch (p.label) {
13578
13578
  case 0:
13579
- if (!(n = Ca(t)).Wo) return [ 3 /*break*/ , 10 ];
13579
+ if (!(n = Cu(t)).Wo) return [ 3 /*break*/ , 10 ];
13580
13580
  o = 0, s = e, p.label = 1;
13581
13581
 
13582
13582
  case 1:
13583
- return o < s.length ? (a = s[o], n.Fo.has(a) ? (
13583
+ return o < s.length ? (u = s[o], n.Fo.has(u) ? (
13584
13584
  // A target might have been added in a previous attempt
13585
- U("SyncEngine", "Adding an already active target " + a), [ 3 /*break*/ , 5 ]) : [ 4 /*yield*/ , bo(n.localStore, a) ]) : [ 3 /*break*/ , 6 ];
13585
+ U("SyncEngine", "Adding an already active target " + u), [ 3 /*break*/ , 5 ]) : [ 4 /*yield*/ , bo(n.localStore, u) ]) : [ 3 /*break*/ , 6 ];
13586
13586
 
13587
13587
  case 2:
13588
- return u = p.sent(), [ 4 /*yield*/ , mo(n.localStore, u) ];
13588
+ return a = p.sent(), [ 4 /*yield*/ , mo(n.localStore, a) ];
13589
13589
 
13590
13590
  case 3:
13591
- return c = p.sent(), [ 4 /*yield*/ , na(n, Aa(u), c.targetId,
13591
+ return c = p.sent(), [ 4 /*yield*/ , nu(n, Au(a), c.targetId,
13592
13592
  /*current=*/ !1) ];
13593
13593
 
13594
13594
  case 4:
13595
- p.sent(), us(n.remoteStore, c), p.label = 5;
13595
+ p.sent(), as(n.remoteStore, c), p.label = 5;
13596
13596
 
13597
13597
  case 5:
13598
13598
  return o++, [ 3 /*break*/ , 1 ];
@@ -13604,7 +13604,7 @@ function Da(t, e, i, o) {
13604
13604
  case 0:
13605
13605
  return n.Fo.has(t) ? [ 4 /*yield*/ , go(n.localStore, t,
13606
13606
  /* keepPersistedTargetData */ !1).then((function() {
13607
- cs(n.remoteStore, t), da(n, t);
13607
+ cs(n.remoteStore, t), du(n, t);
13608
13608
  })).catch(Fi) ] : [ 3 /*break*/ , 2 ];
13609
13609
 
13610
13610
  // Release queries that are still active.
@@ -13634,16 +13634,16 @@ function Da(t, e, i, o) {
13634
13634
  }));
13635
13635
  }
13636
13636
 
13637
- function Ca(t) {
13637
+ function Cu(t) {
13638
13638
  var e = W(t);
13639
- return e.remoteStore.remoteSyncer.applyRemoteEvent = oa.bind(null, e), e.remoteStore.remoteSyncer.getRemoteKeysForTarget = ba.bind(null, e),
13640
- e.remoteStore.remoteSyncer.rejectListen = aa.bind(null, e), e.Oo.br = Bs.bind(null, e.eventManager),
13639
+ return e.remoteStore.remoteSyncer.applyRemoteEvent = ou.bind(null, e), e.remoteStore.remoteSyncer.getRemoteKeysForTarget = bu.bind(null, e),
13640
+ e.remoteStore.remoteSyncer.rejectListen = uu.bind(null, e), e.Oo.br = Bs.bind(null, e.eventManager),
13641
13641
  e.Oo.zo = js.bind(null, e.eventManager), e;
13642
13642
  }
13643
13643
 
13644
- function xa(t) {
13644
+ function xu(t) {
13645
13645
  var e = W(t);
13646
- return e.remoteStore.remoteSyncer.applySuccessfulWrite = ua.bind(null, e), e.remoteStore.remoteSyncer.rejectFailedWrite = ca.bind(null, e),
13646
+ return e.remoteStore.remoteSyncer.applySuccessfulWrite = au.bind(null, e), e.remoteStore.remoteSyncer.rejectFailedWrite = cu.bind(null, e),
13647
13647
  e
13648
13648
  /**
13649
13649
  * Loads a Firestore bundle into the SDK. The returned promise resolves when
@@ -13655,12 +13655,12 @@ function xa(t) {
13655
13655
  */;
13656
13656
  }
13657
13657
 
13658
- function Ra(t, e, i) {
13658
+ function Ru(t, e, i) {
13659
13659
  var o = W(t);
13660
13660
  // eslint-disable-next-line @typescript-eslint/no-floating-promises
13661
13661
  (function(t, e, i) {
13662
13662
  return n(this, void 0, void 0, (function() {
13663
- var n, o, s, a, u, c;
13663
+ var n, o, s, u, a, c;
13664
13664
  return r(this, (function(r) {
13665
13665
  switch (r.label) {
13666
13666
  case 0:
@@ -13700,7 +13700,7 @@ function Ra(t, e, i) {
13700
13700
  return s ? [ 4 /*yield*/ , o.yo(s) ] : [ 3 /*break*/ , 10 ];
13701
13701
 
13702
13702
  case 7:
13703
- return (a = r.sent()) && i._updateProgress(a), [ 4 /*yield*/ , e.Ho() ];
13703
+ return (u = r.sent()) && i._updateProgress(u), [ 4 /*yield*/ , e.Ho() ];
13704
13704
 
13705
13705
  case 8:
13706
13706
  s = r.sent(), r.label = 9;
@@ -13715,7 +13715,7 @@ function Ra(t, e, i) {
13715
13715
  // TODO(b/160876443): This currently raises snapshots with
13716
13716
  // `fromCache=false` if users already listen to some queries and bundles
13717
13717
  // has newer version.
13718
- return u = r.sent(), [ 4 /*yield*/ , ga(t, u.In,
13718
+ return a = r.sent(), [ 4 /*yield*/ , gu(t, a.In,
13719
13719
  /* remoteEvent */ void 0) ];
13720
13720
 
13721
13721
  case 12:
@@ -13735,7 +13735,7 @@ function Ra(t, e, i) {
13735
13735
  // `fromCache=false` if users already listen to some queries and bundles
13736
13736
  // has newer version.
13737
13737
  // Save metadata, so loading the same bundle will skip.
13738
- return r.sent(), i._completeWith(u.progress), [ 3 /*break*/ , 15 ];
13738
+ return r.sent(), i._completeWith(a.progress), [ 3 /*break*/ , 15 ];
13739
13739
 
13740
13740
  case 14:
13741
13741
  return j("SyncEngine", "Loading bundle failed with " + (c = r.sent())), i._failWith(c),
@@ -13771,7 +13771,7 @@ function Ra(t, e, i) {
13771
13771
  }));
13772
13772
  }
13773
13773
 
13774
- var La = /** @class */ function() {
13774
+ var Lu = /** @class */ function() {
13775
13775
  function t() {
13776
13776
  this.synchronizeTabs = !1;
13777
13777
  }
@@ -13791,7 +13791,7 @@ var La = /** @class */ function() {
13791
13791
  }, t.prototype.Xo = function(t) {
13792
13792
  return null;
13793
13793
  }, t.prototype.Zo = function(t) {
13794
- return co(this.persistence, new ao, t.initialUser, this.k);
13794
+ return co(this.persistence, new uo, t.initialUser, this.k);
13795
13795
  }, t.prototype.Yo = function(t) {
13796
13796
  return new Ro(Po.ks, this.k);
13797
13797
  }, t.prototype.Jo = function(t) {
@@ -13812,7 +13812,7 @@ var La = /** @class */ function() {
13812
13812
  }));
13813
13813
  }));
13814
13814
  }, t;
13815
- }(), Pa = /** @class */ function(e) {
13815
+ }(), Pu = /** @class */ function(e) {
13816
13816
  function i(t, n, r) {
13817
13817
  var i = this;
13818
13818
  return (i = e.call(this) || this).tc = t, i.cacheSizeBytes = n, i.forceOwnership = r,
@@ -13834,7 +13834,7 @@ var La = /** @class */ function() {
13834
13834
 
13835
13835
  case 3:
13836
13836
  // Enqueue writes from a previous session
13837
- return r.sent(), [ 4 /*yield*/ , xa(this.tc.syncEngine) ];
13837
+ return r.sent(), [ 4 /*yield*/ , xu(this.tc.syncEngine) ];
13838
13838
 
13839
13839
  case 4:
13840
13840
  // Enqueue writes from a previous session
@@ -13856,7 +13856,7 @@ var La = /** @class */ function() {
13856
13856
  }));
13857
13857
  }));
13858
13858
  }, i.prototype.Zo = function(t) {
13859
- return co(this.persistence, new ao, t.initialUser, this.k);
13859
+ return co(this.persistence, new uo, t.initialUser, this.k);
13860
13860
  }, i.prototype.Xo = function(t) {
13861
13861
  var e = this.persistence.referenceDelegate.garbageCollector;
13862
13862
  return new Ui(e, t.asyncQueue);
@@ -13866,7 +13866,7 @@ var La = /** @class */ function() {
13866
13866
  }, i.prototype.Jo = function(t) {
13867
13867
  return new Go;
13868
13868
  }, i;
13869
- }(La), Oa = /** @class */ function(e) {
13869
+ }(Lu), Ou = /** @class */ function(e) {
13870
13870
  function i(t, n) {
13871
13871
  var r = this;
13872
13872
  return (r = e.call(this, t, n, /* forceOwnership= */ !1) || this).tc = t, r.cacheSizeBytes = n,
@@ -13882,11 +13882,11 @@ var La = /** @class */ function() {
13882
13882
 
13883
13883
  case 1:
13884
13884
  return s.sent(), i = this.tc.syncEngine, this.sharedClientState instanceof Ko ? (this.sharedClientState.syncEngine = {
13885
- mi: Ea.bind(null, i),
13886
- gi: Da.bind(null, i),
13887
- yi: Na.bind(null, i),
13888
- Tn: ka.bind(null, i),
13889
- _i: Ta.bind(null, i)
13885
+ mi: Eu.bind(null, i),
13886
+ gi: Du.bind(null, i),
13887
+ yi: Nu.bind(null, i),
13888
+ Tn: ku.bind(null, i),
13889
+ _i: Tu.bind(null, i)
13890
13890
  }, [ 4 /*yield*/ , this.sharedClientState.start() ]) : [ 3 /*break*/ , 3 ];
13891
13891
 
13892
13892
  case 2:
@@ -13900,7 +13900,7 @@ var La = /** @class */ function() {
13900
13900
  return r(this, (function(e) {
13901
13901
  switch (e.label) {
13902
13902
  case 0:
13903
- return [ 4 /*yield*/ , Sa(this.tc.syncEngine, t) ];
13903
+ return [ 4 /*yield*/ , Su(this.tc.syncEngine, t) ];
13904
13904
 
13905
13905
  case 1:
13906
13906
  return e.sent(), this.gcScheduler && (t && !this.gcScheduler.started ? this.gcScheduler.start(this.localStore) : t || this.gcScheduler.stop()),
@@ -13923,7 +13923,7 @@ var La = /** @class */ function() {
13923
13923
  var n = ro(t.databaseInfo.databaseId, t.databaseInfo.persistenceKey);
13924
13924
  return new Ko(e, t.asyncQueue, n, t.clientId, t.initialUser);
13925
13925
  }, i;
13926
- }(Pa), Ma = /** @class */ function() {
13926
+ }(Pu), Mu = /** @class */ function() {
13927
13927
  function t() {}
13928
13928
  return t.prototype.initialize = function(t, e) {
13929
13929
  return n(this, void 0, void 0, (function() {
@@ -13936,8 +13936,8 @@ var La = /** @class */ function() {
13936
13936
  this.remoteStore = this.createRemoteStore(e), this.eventManager = this.createEventManager(e),
13937
13937
  this.syncEngine = this.createSyncEngine(e,
13938
13938
  /* startAsPrimary=*/ !t.synchronizeTabs), this.sharedClientState.onlineStateHandler = function(t) {
13939
- return sa(n.syncEngine, t, 1 /* SharedClientState */);
13940
- }, this.remoteStore.remoteSyncer.handleCredentialChange = wa.bind(null, this.syncEngine),
13939
+ return su(n.syncEngine, t, 1 /* SharedClientState */);
13940
+ }, this.remoteStore.remoteSyncer.handleCredentialChange = wu.bind(null, this.syncEngine),
13941
13941
  [ 4 /*yield*/ , Ns(this.remoteStore, this.syncEngine.isPrimaryClient) ]);
13942
13942
 
13943
13943
  case 1:
@@ -13958,14 +13958,14 @@ var La = /** @class */ function() {
13958
13958
  }, t.prototype.createRemoteStore = function(t) {
13959
13959
  var e, n, r, i, o, s = this;
13960
13960
  return e = this.localStore, n = this.datastore, r = t.asyncQueue, i = function(t) {
13961
- return sa(s.syncEngine, t, 0 /* RemoteStore */);
13961
+ return su(s.syncEngine, t, 0 /* RemoteStore */);
13962
13962
  }, o = Qo.Pt() ? new Qo : new zo, new os(e, n, r, i, o);
13963
13963
  }, t.prototype.createSyncEngine = function(t, e) {
13964
13964
  return function(t, e, n,
13965
13965
  // PORTING NOTE: Manages state synchronization in multi-tab environments.
13966
13966
  r, i, o, s) {
13967
- var a = new ta(t, e, n, r, i, o);
13968
- return s && (a.Wo = !0), a;
13967
+ var u = new tu(t, e, n, r, i, o);
13968
+ return s && (u.Wo = !0), u;
13969
13969
  }(this.localStore, this.remoteStore, this.eventManager, this.sharedClientState, t.initialUser, t.maxConcurrentLimboResolutions, e);
13970
13970
  }, t.prototype.terminate = function() {
13971
13971
  return function(t) {
@@ -13975,7 +13975,7 @@ var La = /** @class */ function() {
13975
13975
  switch (n.label) {
13976
13976
  case 0:
13977
13977
  return e = W(t), U("RemoteStore", "RemoteStore shutting down."), e.Gr.add(5 /* Shutdown */),
13978
- [ 4 /*yield*/ , as(e) ];
13978
+ [ 4 /*yield*/ , us(e) ];
13979
13979
 
13980
13980
  case 1:
13981
13981
  return n.sent(), e.Hr.shutdown(),
@@ -14019,7 +14019,7 @@ var La = /** @class */ function() {
14019
14019
  * @param bytesPerRead - How many bytes each `read()` from the returned reader
14020
14020
  * will read.
14021
14021
  */
14022
- function Fa(t, e) {
14022
+ function Fu(t, e) {
14023
14023
  void 0 === e && (e = 10240);
14024
14024
  var i = 0;
14025
14025
  // The TypeScript definition for ReadableStreamReader changed. We use
@@ -14092,7 +14092,7 @@ function Fa(t, e) {
14092
14092
  * A wrapper implementation of Observer<T> that will dispatch events
14093
14093
  * asynchronously. To allow immediate silencing, a mute call is added which
14094
14094
  * causes events scheduled to no longer be raised.
14095
- */ var Va = /** @class */ function() {
14095
+ */ var Vu = /** @class */ function() {
14096
14096
  function t(t) {
14097
14097
  this.observer = t,
14098
14098
  /**
@@ -14113,7 +14113,7 @@ function Fa(t, e) {
14113
14113
  n.muted || t(e);
14114
14114
  }), 0);
14115
14115
  }, t;
14116
- }(), qa = /** @class */ function() {
14116
+ }(), qu = /** @class */ function() {
14117
14117
  function t(
14118
14118
  /** The reader to read from underlying binary bundle data source. */
14119
14119
  t, e) {
@@ -14273,7 +14273,7 @@ function Fa(t, e) {
14273
14273
  }));
14274
14274
  }));
14275
14275
  }, t;
14276
- }(), Ua = /** @class */ function() {
14276
+ }(), Uu = /** @class */ function() {
14277
14277
  function t(t) {
14278
14278
  this.datastore = t,
14279
14279
  // The version of each document that was read during this transaction.
@@ -14300,7 +14300,7 @@ function Fa(t, e) {
14300
14300
  if (this.ensureCommitNotCalled(), this.mutations.length > 0) throw new Y(H.INVALID_ARGUMENT, "Firestore transactions require all reads to be executed before all writes.");
14301
14301
  return [ 4 /*yield*/ , function(t, e) {
14302
14302
  return n(this, void 0, void 0, (function() {
14303
- var n, i, o, s, a, u;
14303
+ var n, i, o, s, u, a;
14304
14304
  return r(this, (function(r) {
14305
14305
  switch (r.label) {
14306
14306
  case 0:
@@ -14311,7 +14311,7 @@ function Fa(t, e) {
14311
14311
  }, [ 4 /*yield*/ , n.ji("BatchGetDocuments", i, o) ];
14312
14312
 
14313
14313
  case 1:
14314
- return s = r.sent(), a = new Map, s.forEach((function(t) {
14314
+ return s = r.sent(), u = new Map, s.forEach((function(t) {
14315
14315
  var e = function(t, e) {
14316
14316
  return "found" in e ? function(t, e) {
14317
14317
  z(!!e.found), e.found.name, e.found.updateTime;
@@ -14327,11 +14327,11 @@ function Fa(t, e) {
14327
14327
  return Xt.newNoDocument(n, r);
14328
14328
  }(t, e) : G();
14329
14329
  }(n.k, t);
14330
- a.set(e.key.toString(), e);
14331
- })), u = [], [ 2 /*return*/ , (e.forEach((function(t) {
14332
- var e = a.get(t.toString());
14333
- z(!!e), u.push(e);
14334
- })), u) ];
14330
+ u.set(e.key.toString(), e);
14331
+ })), a = [], [ 2 /*return*/ , (e.forEach((function(t) {
14332
+ var e = u.get(t.toString());
14333
+ z(!!e), a.push(e);
14334
+ })), a) ];
14335
14335
  }
14336
14336
  }));
14337
14337
  }));
@@ -14447,7 +14447,7 @@ function Fa(t, e) {
14447
14447
  }, t.prototype.write = function(t) {
14448
14448
  this.ensureCommitNotCalled(), this.mutations.push(t);
14449
14449
  }, t.prototype.ensureCommitNotCalled = function() {}, t;
14450
- }(), Ba = /** @class */ function() {
14450
+ }(), Bu = /** @class */ function() {
14451
14451
  function t(t, e, n, r) {
14452
14452
  this.asyncQueue = t, this.datastore = e, this.updateFunction = n, this.deferred = r,
14453
14453
  this.lc = 5, this.ur = new Zo(this.asyncQueue, "transaction_retry" /* TransactionRetry */)
@@ -14461,7 +14461,7 @@ function Fa(t, e) {
14461
14461
  return n(t, void 0, void 0, (function() {
14462
14462
  var t, e, n = this;
14463
14463
  return r(this, (function(r) {
14464
- return t = new Ua(this.datastore), (e = this.dc(t)) && e.then((function(e) {
14464
+ return t = new Uu(this.datastore), (e = this.dc(t)) && e.then((function(e) {
14465
14465
  n.asyncQueue.enqueueAndForget((function() {
14466
14466
  return t.commit().then((function() {
14467
14467
  n.deferred.resolve(e);
@@ -14498,7 +14498,7 @@ function Fa(t, e) {
14498
14498
  }
14499
14499
  return !1;
14500
14500
  }, t;
14501
- }(), ja = /** @class */ function() {
14501
+ }(), ju = /** @class */ function() {
14502
14502
  function t(t, e,
14503
14503
  /**
14504
14504
  * Asynchronous queue responsible for all of our internal processing. When
@@ -14511,7 +14511,7 @@ function Fa(t, e) {
14511
14511
  i, o) {
14512
14512
  var s = this;
14513
14513
  this.authCredentials = t, this.appCheckCredentials = e, this.asyncQueue = i, this.databaseInfo = o,
14514
- this.user = O.UNAUTHENTICATED, this.clientId = ut.A(), this.authCredentialListener = function() {
14514
+ this.user = O.UNAUTHENTICATED, this.clientId = at.A(), this.authCredentialListener = function() {
14515
14515
  return Promise.resolve();
14516
14516
  }, this.appCheckCredentialListener = function() {
14517
14517
  return Promise.resolve();
@@ -14617,20 +14617,20 @@ function Fa(t, e) {
14617
14617
  *
14618
14618
  * Takes a bundle stream or buffer, and presents abstractions to read bundled
14619
14619
  * elements out of the underlying content.
14620
- */ function Ka(t, e) {
14620
+ */ function Ku(t, e) {
14621
14621
  return n(this, void 0, void 0, (function() {
14622
14622
  var i, o, s = this;
14623
- return r(this, (function(a) {
14624
- switch (a.label) {
14623
+ return r(this, (function(u) {
14624
+ switch (u.label) {
14625
14625
  case 0:
14626
14626
  return t.asyncQueue.verifyOperationInProgress(), U("FirestoreClient", "Initializing OfflineComponentProvider"),
14627
14627
  [ 4 /*yield*/ , t.getConfiguration() ];
14628
14628
 
14629
14629
  case 1:
14630
- return i = a.sent(), [ 4 /*yield*/ , e.initialize(i) ];
14630
+ return i = u.sent(), [ 4 /*yield*/ , e.initialize(i) ];
14631
14631
 
14632
14632
  case 2:
14633
- return a.sent(), o = i.initialUser, t.setCredentialChangeListener((function(t) {
14633
+ return u.sent(), o = i.initialUser, t.setCredentialChangeListener((function(t) {
14634
14634
  return n(s, void 0, void 0, (function() {
14635
14635
  return r(this, (function(n) {
14636
14636
  switch (n.label) {
@@ -14656,13 +14656,13 @@ function Fa(t, e) {
14656
14656
  }));
14657
14657
  }
14658
14658
 
14659
- function Ga(t, e) {
14659
+ function Gu(t, e) {
14660
14660
  return n(this, void 0, void 0, (function() {
14661
14661
  var n, i;
14662
14662
  return r(this, (function(r) {
14663
14663
  switch (r.label) {
14664
14664
  case 0:
14665
- return t.asyncQueue.verifyOperationInProgress(), [ 4 /*yield*/ , za(t) ];
14665
+ return t.asyncQueue.verifyOperationInProgress(), [ 4 /*yield*/ , zu(t) ];
14666
14666
 
14667
14667
  case 1:
14668
14668
  return n = r.sent(), U("FirestoreClient", "Initializing OnlineComponentProvider"),
@@ -14685,13 +14685,13 @@ function Ga(t, e) {
14685
14685
  }));
14686
14686
  }
14687
14687
 
14688
- function za(t) {
14688
+ function zu(t) {
14689
14689
  return n(this, void 0, void 0, (function() {
14690
14690
  return r(this, (function(e) {
14691
14691
  switch (e.label) {
14692
14692
  case 0:
14693
14693
  return t.offlineComponents ? [ 3 /*break*/ , 2 ] : (U("FirestoreClient", "Using default OfflineComponentProvider"),
14694
- [ 4 /*yield*/ , Ka(t, new La) ]);
14694
+ [ 4 /*yield*/ , Ku(t, new Lu) ]);
14695
14695
 
14696
14696
  case 1:
14697
14697
  e.sent(), e.label = 2;
@@ -14703,13 +14703,13 @@ function za(t) {
14703
14703
  }));
14704
14704
  }
14705
14705
 
14706
- function Qa(t) {
14706
+ function Qu(t) {
14707
14707
  return n(this, void 0, void 0, (function() {
14708
14708
  return r(this, (function(e) {
14709
14709
  switch (e.label) {
14710
14710
  case 0:
14711
14711
  return t.onlineComponents ? [ 3 /*break*/ , 2 ] : (U("FirestoreClient", "Using default OnlineComponentProvider"),
14712
- [ 4 /*yield*/ , Ga(t, new Ma) ]);
14712
+ [ 4 /*yield*/ , Gu(t, new Mu) ]);
14713
14713
 
14714
14714
  case 1:
14715
14715
  e.sent(), e.label = 2;
@@ -14721,47 +14721,47 @@ function Qa(t) {
14721
14721
  }));
14722
14722
  }
14723
14723
 
14724
- function Wa(t) {
14725
- return za(t).then((function(t) {
14724
+ function Wu(t) {
14725
+ return zu(t).then((function(t) {
14726
14726
  return t.persistence;
14727
14727
  }));
14728
14728
  }
14729
14729
 
14730
- function Ha(t) {
14731
- return za(t).then((function(t) {
14730
+ function Hu(t) {
14731
+ return zu(t).then((function(t) {
14732
14732
  return t.localStore;
14733
14733
  }));
14734
14734
  }
14735
14735
 
14736
- function Ya(t) {
14737
- return Qa(t).then((function(t) {
14736
+ function Yu(t) {
14737
+ return Qu(t).then((function(t) {
14738
14738
  return t.remoteStore;
14739
14739
  }));
14740
14740
  }
14741
14741
 
14742
- function Ja(t) {
14743
- return Qa(t).then((function(t) {
14742
+ function Ju(t) {
14743
+ return Qu(t).then((function(t) {
14744
14744
  return t.syncEngine;
14745
14745
  }));
14746
14746
  }
14747
14747
 
14748
- function Xa(t) {
14748
+ function Xu(t) {
14749
14749
  return n(this, void 0, void 0, (function() {
14750
14750
  var e, n;
14751
14751
  return r(this, (function(r) {
14752
14752
  switch (r.label) {
14753
14753
  case 0:
14754
- return [ 4 /*yield*/ , Qa(t) ];
14754
+ return [ 4 /*yield*/ , Qu(t) ];
14755
14755
 
14756
14756
  case 1:
14757
- return e = r.sent(), [ 2 /*return*/ , ((n = e.eventManager).onListen = ea.bind(null, e.syncEngine),
14758
- n.onUnlisten = ra.bind(null, e.syncEngine), n) ];
14757
+ return e = r.sent(), [ 2 /*return*/ , ((n = e.eventManager).onListen = eu.bind(null, e.syncEngine),
14758
+ n.onUnlisten = ru.bind(null, e.syncEngine), n) ];
14759
14759
  }
14760
14760
  }));
14761
14761
  }));
14762
14762
  }
14763
14763
 
14764
- /** Enables the network connection and re-enqueues all pending operations. */ function $a(t, e, i) {
14764
+ /** Enables the network connection and re-enqueues all pending operations. */ function $u(t, e, i) {
14765
14765
  var o = this;
14766
14766
  void 0 === i && (i = {});
14767
14767
  var s = new J;
@@ -14772,15 +14772,15 @@ function Xa(t) {
14772
14772
  switch (r.label) {
14773
14773
  case 0:
14774
14774
  return n = function(t, e, n, r, i) {
14775
- var o = new Va({
14775
+ var o = new Vu({
14776
14776
  next: function(o) {
14777
14777
  // Remove query first before passing event to user to avoid
14778
14778
  // user actions affecting the now stale query.
14779
14779
  e.enqueueAndForget((function() {
14780
14780
  return Us(t, s);
14781
14781
  }));
14782
- var a = o.docs.has(n);
14783
- !a && o.fromCache ?
14782
+ var u = o.docs.has(n);
14783
+ !u && o.fromCache ?
14784
14784
  // TODO(dimond): If we're online and the document doesn't
14785
14785
  // exist then we resolve with a doc.exists set to false. If
14786
14786
  // we're offline however, we reject the Promise in this
@@ -14788,7 +14788,7 @@ function Xa(t) {
14788
14788
  // the server so we can deliver that even when you're
14789
14789
  // offline 2) Actually reject the Promise in the online case
14790
14790
  // if the document doesn't exist.
14791
- i.reject(new Y(H.UNAVAILABLE, "Failed to get document because the client is offline.")) : a && o.fromCache && r && "server" === r.source ? i.reject(new Y(H.UNAVAILABLE, 'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to "server" to retrieve the cached document.)')) : i.resolve(o);
14791
+ i.reject(new Y(H.UNAVAILABLE, "Failed to get document because the client is offline.")) : u && o.fromCache && r && "server" === r.source ? i.reject(new Y(H.UNAVAILABLE, 'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to "server" to retrieve the cached document.)')) : i.resolve(o);
14792
14792
  },
14793
14793
  error: function(t) {
14794
14794
  return i.reject(t);
@@ -14798,7 +14798,7 @@ function Xa(t) {
14798
14798
  wo: !0
14799
14799
  });
14800
14800
  return qs(t, s);
14801
- }, [ 4 /*yield*/ , Xa(t) ];
14801
+ }, [ 4 /*yield*/ , Xu(t) ];
14802
14802
 
14803
14803
  case 1:
14804
14804
  return [ 2 /*return*/ , n.apply(void 0, [ r.sent(), t.asyncQueue, e, i, s ]) ];
@@ -14808,7 +14808,7 @@ function Xa(t) {
14808
14808
  })), s.promise;
14809
14809
  }
14810
14810
 
14811
- function Za(t, e, i) {
14811
+ function Zu(t, e, i) {
14812
14812
  var o = this;
14813
14813
  void 0 === i && (i = {});
14814
14814
  var s = new J;
@@ -14819,7 +14819,7 @@ function Za(t, e, i) {
14819
14819
  switch (r.label) {
14820
14820
  case 0:
14821
14821
  return n = function(t, e, n, r, i) {
14822
- var o = new Va({
14822
+ var o = new Vu({
14823
14823
  next: function(n) {
14824
14824
  // Remove query first before passing event to user to avoid
14825
14825
  // user actions affecting the now stale query.
@@ -14835,7 +14835,7 @@ function Za(t, e, i) {
14835
14835
  wo: !0
14836
14836
  });
14837
14837
  return qs(t, s);
14838
- }, [ 4 /*yield*/ , Xa(t) ];
14838
+ }, [ 4 /*yield*/ , Xu(t) ];
14839
14839
 
14840
14840
  case 1:
14841
14841
  return [ 2 /*return*/ , n.apply(void 0, [ r.sent(), t.asyncQueue, e, i, s ]) ];
@@ -14845,7 +14845,7 @@ function Za(t, e, i) {
14845
14845
  })), s.promise;
14846
14846
  }
14847
14847
 
14848
- var tu =
14848
+ var ta =
14849
14849
  /**
14850
14850
  * Constructs a DatabaseInfo using the provided host, databaseId and
14851
14851
  * persistenceKey.
@@ -14863,10 +14863,10 @@ var tu =
14863
14863
  * @param useFetchStreams Whether to use the Fetch API instead of
14864
14864
  * XMLHTTPRequest
14865
14865
  */
14866
- function(t, e, n, r, i, o, s, a) {
14866
+ function(t, e, n, r, i, o, s, u) {
14867
14867
  this.databaseId = t, this.appId = e, this.persistenceKey = n, this.host = r, this.ssl = i,
14868
- this.forceLongPolling = o, this.autoDetectLongPolling = s, this.useFetchStreams = a;
14869
- }, eu = /** @class */ function() {
14868
+ this.forceLongPolling = o, this.autoDetectLongPolling = s, this.useFetchStreams = u;
14869
+ }, ea = /** @class */ function() {
14870
14870
  function t(t, e) {
14871
14871
  this.projectId = t, this.database = e || "(default)";
14872
14872
  }
@@ -14879,7 +14879,7 @@ function(t, e, n, r, i, o, s, a) {
14879
14879
  }), t.prototype.isEqual = function(e) {
14880
14880
  return e instanceof t && e.projectId === this.projectId && e.database === this.database;
14881
14881
  }, t;
14882
- }(), nu = new Map;
14882
+ }(), na = new Map;
14883
14883
 
14884
14884
  /** The default database name for a project. */
14885
14885
  /**
@@ -14906,28 +14906,28 @@ function(t, e, n, r, i, o, s, a) {
14906
14906
  * See the License for the specific language governing permissions and
14907
14907
  * limitations under the License.
14908
14908
  */
14909
- function ru(t, e, n) {
14909
+ function ra(t, e, n) {
14910
14910
  if (!n) throw new Y(H.INVALID_ARGUMENT, "Function " + t + "() cannot be called with an empty " + e + ".");
14911
14911
  }
14912
14912
 
14913
14913
  /**
14914
14914
  * Validates that two boolean options are not set at the same time.
14915
14915
  * @internal
14916
- */ function iu(t, e, n, r) {
14916
+ */ function ia(t, e, n, r) {
14917
14917
  if (!0 === e && !0 === r) throw new Y(H.INVALID_ARGUMENT, t + " and " + n + " cannot be used together.");
14918
14918
  }
14919
14919
 
14920
14920
  /**
14921
14921
  * Validates that `path` refers to a document (indicated by the fact it contains
14922
14922
  * an even numbers of segments).
14923
- */ function ou(t) {
14923
+ */ function oa(t) {
14924
14924
  if (!Pt.isDocumentKey(t)) throw new Y(H.INVALID_ARGUMENT, "Invalid document reference. Document references must have an even number of segments, but " + t + " has " + t.length + ".");
14925
14925
  }
14926
14926
 
14927
14927
  /**
14928
14928
  * Validates that `path` refers to a collection (indicated by the fact it
14929
14929
  * contains an odd numbers of segments).
14930
- */ function su(t) {
14930
+ */ function sa(t) {
14931
14931
  if (Pt.isDocumentKey(t)) throw new Y(H.INVALID_ARGUMENT, "Invalid collection reference. Collection references must have an odd number of segments, but " + t + " has " + t.length + ".");
14932
14932
  }
14933
14933
 
@@ -14935,7 +14935,7 @@ function ru(t, e, n) {
14935
14935
  * Returns true if it's a non-null object without a custom prototype
14936
14936
  * (i.e. excludes Array, Date, etc.).
14937
14937
  */
14938
- /** Returns a string describing the type / value of the provided input. */ function au(t) {
14938
+ /** Returns a string describing the type / value of the provided input. */ function ua(t) {
14939
14939
  if (void 0 === t) return "undefined";
14940
14940
  if (null === t) return "null";
14941
14941
  if ("string" == typeof t) return t.length > 20 && (t = t.substring(0, 20) + "..."),
@@ -14953,7 +14953,7 @@ function ru(t, e, n) {
14953
14953
  return "function" == typeof t ? "a function" : G();
14954
14954
  }
14955
14955
 
14956
- function uu(t,
14956
+ function aa(t,
14957
14957
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
14958
14958
  e) {
14959
14959
  if ("_delegate" in t && (
@@ -14961,13 +14961,13 @@ e) {
14961
14961
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
14962
14962
  t = t._delegate), !(t instanceof e)) {
14963
14963
  if (e.name === t.constructor.name) throw new Y(H.INVALID_ARGUMENT, "Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");
14964
- var n = au(t);
14964
+ var n = ua(t);
14965
14965
  throw new Y(H.INVALID_ARGUMENT, "Expected type '" + e.name + "', but it was: " + n);
14966
14966
  }
14967
14967
  return t;
14968
14968
  }
14969
14969
 
14970
- function cu(t, e) {
14970
+ function ca(t, e) {
14971
14971
  if (e <= 0) throw new Y(H.INVALID_ARGUMENT, "Function " + t + "() requires a positive number, but it was: " + e + ".");
14972
14972
  }
14973
14973
 
@@ -14992,7 +14992,7 @@ function cu(t, e) {
14992
14992
  * A concrete type describing all the values that can be applied via a
14993
14993
  * user-supplied `FirestoreSettings` object. This is a separate type so that
14994
14994
  * defaults can be supplied and the value can be checked for equality.
14995
- */ var hu = /** @class */ function() {
14995
+ */ var ha = /** @class */ function() {
14996
14996
  function t(t) {
14997
14997
  var e;
14998
14998
  if (void 0 === t.host) {
@@ -15005,23 +15005,23 @@ function cu(t, e) {
15005
15005
  this.cacheSizeBytes = t.cacheSizeBytes;
15006
15006
  }
15007
15007
  this.experimentalForceLongPolling = !!t.experimentalForceLongPolling, this.experimentalAutoDetectLongPolling = !!t.experimentalAutoDetectLongPolling,
15008
- this.useFetchStreams = !!t.useFetchStreams, iu("experimentalForceLongPolling", t.experimentalForceLongPolling, "experimentalAutoDetectLongPolling", t.experimentalAutoDetectLongPolling);
15008
+ this.useFetchStreams = !!t.useFetchStreams, ia("experimentalForceLongPolling", t.experimentalForceLongPolling, "experimentalAutoDetectLongPolling", t.experimentalAutoDetectLongPolling);
15009
15009
  }
15010
15010
  return t.prototype.isEqual = function(t) {
15011
15011
  return this.host === t.host && this.ssl === t.ssl && this.credentials === t.credentials && this.cacheSizeBytes === t.cacheSizeBytes && this.experimentalForceLongPolling === t.experimentalForceLongPolling && this.experimentalAutoDetectLongPolling === t.experimentalAutoDetectLongPolling && this.ignoreUndefinedProperties === t.ignoreUndefinedProperties && this.useFetchStreams === t.useFetchStreams;
15012
15012
  }, t;
15013
- }(), fu = /** @class */ function() {
15013
+ }(), fa = /** @class */ function() {
15014
15014
  /** @hideconstructor */
15015
15015
  function t(t, e, n) {
15016
15016
  this._authCredentials = e, this._appCheckCredentials = n,
15017
15017
  /**
15018
15018
  * Whether it's a Firestore or Firestore Lite instance.
15019
15019
  */
15020
- this.type = "firestore-lite", this._persistenceKey = "(lite)", this._settings = new hu({}),
15021
- this._settingsFrozen = !1, t instanceof eu ? this._databaseId = t : (this._app = t,
15020
+ this.type = "firestore-lite", this._persistenceKey = "(lite)", this._settings = new ha({}),
15021
+ this._settingsFrozen = !1, t instanceof ea ? this._databaseId = t : (this._app = t,
15022
15022
  this._databaseId = function(t) {
15023
15023
  if (!Object.prototype.hasOwnProperty.apply(t.options, [ "projectId" ])) throw new Y(H.INVALID_ARGUMENT, '"projectId" not provided in firebase.initializeApp.');
15024
- return new eu(t.options.projectId);
15024
+ return new ea(t.options.projectId);
15025
15025
  }(t));
15026
15026
  }
15027
15027
  return Object.defineProperty(t.prototype, "app", {
@@ -15049,7 +15049,7 @@ function cu(t, e) {
15049
15049
  configurable: !0
15050
15050
  }), t.prototype._setSettings = function(t) {
15051
15051
  if (this._settingsFrozen) throw new Y(H.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.");
15052
- this._settings = new hu(t), void 0 !== t.credentials && (this._authCredentials = function(t) {
15052
+ this._settings = new ha(t), void 0 !== t.credentials && (this._authCredentials = function(t) {
15053
15053
  if (!t) return new $;
15054
15054
  switch (t.type) {
15055
15055
  case "gapi":
@@ -15091,8 +15091,8 @@ function cu(t, e) {
15091
15091
  * Removes all components associated with the provided instance. Must be called
15092
15092
  * when the `Firestore` instance is terminated.
15093
15093
  */
15094
- return t = this, (e = nu.get(t)) && (U("ComponentProvider", "Removing Datastore"),
15095
- nu.delete(t), e.terminate()), Promise.resolve();
15094
+ return t = this, (e = na.get(t)) && (U("ComponentProvider", "Removing Datastore"),
15095
+ na.delete(t), e.terminate()), Promise.resolve();
15096
15096
  var t, e;
15097
15097
  }, t;
15098
15098
  }();
@@ -15117,25 +15117,25 @@ function cu(t, e) {
15117
15117
  * The Cloud Firestore service interface.
15118
15118
  *
15119
15119
  * Do not call this constructor directly. Instead, use {@link getFirestore}.
15120
- */ function lu(t, e, n, r) {
15120
+ */ function la(t, e, n, r) {
15121
15121
  var i;
15122
15122
  void 0 === r && (r = {});
15123
- var o = (t = uu(t, fu))._getSettings();
15123
+ var o = (t = aa(t, fa))._getSettings();
15124
15124
  if ("firestore.googleapis.com" !== o.host && o.host !== e && j("Host has been set in both settings() and useEmulator(), emulator host will be used"),
15125
15125
  t._setSettings(Object.assign(Object.assign({}, o), {
15126
15126
  host: e + ":" + n,
15127
15127
  ssl: !1
15128
15128
  })), r.mockUserToken) {
15129
- var s, a;
15130
- if ("string" == typeof r.mockUserToken) s = r.mockUserToken, a = O.MOCK_USER; else {
15129
+ var s, u;
15130
+ if ("string" == typeof r.mockUserToken) s = r.mockUserToken, u = O.MOCK_USER; else {
15131
15131
  // Let createMockUserToken validate first (catches common mistakes like
15132
15132
  // invalid field "uid" and missing field "sub" / "user_id".)
15133
15133
  s = T(r.mockUserToken, null === (i = t._app) || void 0 === i ? void 0 : i.options.projectId);
15134
- var u = r.mockUserToken.sub || r.mockUserToken.user_id;
15135
- if (!u) throw new Y(H.INVALID_ARGUMENT, "mockUserToken must contain 'sub' or 'user_id' field!");
15136
- a = new O(u);
15134
+ var a = r.mockUserToken.sub || r.mockUserToken.user_id;
15135
+ if (!a) throw new Y(H.INVALID_ARGUMENT, "mockUserToken must contain 'sub' or 'user_id' field!");
15136
+ u = new O(a);
15137
15137
  }
15138
- t._authCredentials = new Z(new X(s, a));
15138
+ t._authCredentials = new Z(new X(s, u));
15139
15139
  }
15140
15140
  }
15141
15141
 
@@ -15159,7 +15159,7 @@ function cu(t, e) {
15159
15159
  * A `DocumentReference` refers to a document location in a Firestore database
15160
15160
  * and can be used to write, read, or listen to the location. The document at
15161
15161
  * the referenced location may or may not exist.
15162
- */ var du = /** @class */ function() {
15162
+ */ var da = /** @class */ function() {
15163
15163
  /** @hideconstructor */
15164
15164
  function t(t,
15165
15165
  /**
@@ -15200,14 +15200,14 @@ function cu(t, e) {
15200
15200
  * The collection this `DocumentReference` belongs to.
15201
15201
  */
15202
15202
  get: function() {
15203
- return new yu(this.firestore, this.converter, this._key.path.popLast());
15203
+ return new ya(this.firestore, this.converter, this._key.path.popLast());
15204
15204
  },
15205
15205
  enumerable: !1,
15206
15206
  configurable: !0
15207
15207
  }), t.prototype.withConverter = function(e) {
15208
15208
  return new t(this.firestore, e, this._key);
15209
15209
  }, t;
15210
- }(), pu = /** @class */ function() {
15210
+ }(), pa = /** @class */ function() {
15211
15211
  // This is the lite version of the Query class in the main SDK.
15212
15212
  /** @hideconstructor protected */
15213
15213
  function t(t,
@@ -15222,7 +15222,7 @@ function cu(t, e) {
15222
15222
  return t.prototype.withConverter = function(e) {
15223
15223
  return new t(this.firestore, e, this._query);
15224
15224
  }, t;
15225
- }(), yu = /** @class */ function(e) {
15225
+ }(), ya = /** @class */ function(e) {
15226
15226
  /** @hideconstructor */
15227
15227
  function n(t, n, r) {
15228
15228
  var i = this;
@@ -15253,7 +15253,7 @@ function cu(t, e) {
15253
15253
  */
15254
15254
  get: function() {
15255
15255
  var t = this._path.popLast();
15256
- return t.isEmpty() ? null : new du(this.firestore,
15256
+ return t.isEmpty() ? null : new da(this.firestore,
15257
15257
  /* converter= */ null, new Pt(t));
15258
15258
  },
15259
15259
  enumerable: !1,
@@ -15261,20 +15261,20 @@ function cu(t, e) {
15261
15261
  }), n.prototype.withConverter = function(t) {
15262
15262
  return new n(this.firestore, t, this._path);
15263
15263
  }, n;
15264
- }(pu);
15264
+ }(pa);
15265
15265
 
15266
15266
  /**
15267
15267
  * A `Query` refers to a query which you can read or listen to. You can also
15268
15268
  * construct refined `Query` objects by adding filters and ordering.
15269
- */ function vu(t, n) {
15269
+ */ function va(t, n) {
15270
15270
  for (var r = [], i = 2; i < arguments.length; i++) r[i - 2] = arguments[i];
15271
- if (t = I(t), ru("collection", "path", n), t instanceof fu) {
15271
+ if (t = I(t), ra("collection", "path", n), t instanceof fa) {
15272
15272
  var o = gt.fromString.apply(gt, e([ n ], r));
15273
- return su(o), new yu(t, /* converter= */ null, o);
15273
+ return sa(o), new ya(t, /* converter= */ null, o);
15274
15274
  }
15275
- if (!(t instanceof du || t instanceof yu)) throw new Y(H.INVALID_ARGUMENT, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
15275
+ if (!(t instanceof da || t instanceof ya)) throw new Y(H.INVALID_ARGUMENT, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
15276
15276
  var s = t._path.child(gt.fromString.apply(gt, e([ n ], r)));
15277
- return su(s), new yu(t.firestore,
15277
+ return sa(s), new ya(t.firestore,
15278
15278
  /* converter= */ null, s);
15279
15279
  }
15280
15280
 
@@ -15290,9 +15290,9 @@ function cu(t, e) {
15290
15290
  * collection or subcollection with this ID as the last segment of its path
15291
15291
  * will be included. Cannot contain a slash.
15292
15292
  * @returns The created `Query`.
15293
- */ function mu(t, e) {
15294
- if (t = uu(t, fu), ru("collectionGroup", "collection id", e), e.indexOf("/") >= 0) throw new Y(H.INVALID_ARGUMENT, "Invalid collection ID '" + e + "' passed to function collectionGroup(). Collection IDs must not contain '/'.");
15295
- return new pu(t,
15293
+ */ function ma(t, e) {
15294
+ if (t = aa(t, fa), ra("collectionGroup", "collection id", e), e.indexOf("/") >= 0) throw new Y(H.INVALID_ARGUMENT, "Invalid collection ID '" + e + "' passed to function collectionGroup(). Collection IDs must not contain '/'.");
15295
+ return new pa(t,
15296
15296
  /* converter= */ null,
15297
15297
  /**
15298
15298
  * Creates a new Query for a collection group query that matches all documents
@@ -15303,19 +15303,19 @@ function cu(t, e) {
15303
15303
  }(e));
15304
15304
  }
15305
15305
 
15306
- function gu(t, n) {
15306
+ function ga(t, n) {
15307
15307
  for (var r = [], i = 2; i < arguments.length; i++) r[i - 2] = arguments[i];
15308
15308
  if (t = I(t),
15309
15309
  // We allow omission of 'pathString' but explicitly prohibit passing in both
15310
15310
  // 'undefined' and 'null'.
15311
- 1 === arguments.length && (n = ut.A()), ru("doc", "path", n), t instanceof fu) {
15311
+ 1 === arguments.length && (n = at.A()), ra("doc", "path", n), t instanceof fa) {
15312
15312
  var o = gt.fromString.apply(gt, e([ n ], r));
15313
- return ou(o), new du(t,
15313
+ return oa(o), new da(t,
15314
15314
  /* converter= */ null, new Pt(o));
15315
15315
  }
15316
- if (!(t instanceof du || t instanceof yu)) throw new Y(H.INVALID_ARGUMENT, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
15316
+ if (!(t instanceof da || t instanceof ya)) throw new Y(H.INVALID_ARGUMENT, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
15317
15317
  var s = t._path.child(gt.fromString.apply(gt, e([ n ], r)));
15318
- return ou(s), new du(t.firestore, t instanceof yu ? t.converter : null, new Pt(s));
15318
+ return oa(s), new da(t.firestore, t instanceof ya ? t.converter : null, new Pt(s));
15319
15319
  }
15320
15320
 
15321
15321
  /**
@@ -15325,8 +15325,8 @@ function gu(t, n) {
15325
15325
  * @param right - A reference to compare.
15326
15326
  * @returns true if the references point to the same location in the same
15327
15327
  * Firestore database.
15328
- */ function wu(t, e) {
15329
- return t = I(t), e = I(e), (t instanceof du || t instanceof yu) && (e instanceof du || e instanceof yu) && t.firestore === e.firestore && t.path === e.path && t.converter === e.converter
15328
+ */ function wa(t, e) {
15329
+ return t = I(t), e = I(e), (t instanceof da || t instanceof ya) && (e instanceof da || e instanceof ya) && t.firestore === e.firestore && t.path === e.path && t.converter === e.converter
15330
15330
  /**
15331
15331
  * Returns true if the provided queries point to the same collection and apply
15332
15332
  * the same constraints.
@@ -15338,8 +15338,8 @@ function gu(t, n) {
15338
15338
  */;
15339
15339
  }
15340
15340
 
15341
- function bu(t, e) {
15342
- return t = I(t), e = I(e), t instanceof pu && e instanceof pu && t.firestore === e.firestore && Ne(t._query, e._query) && t.converter === e.converter
15341
+ function ba(t, e) {
15342
+ return t = I(t), e = I(e), t instanceof pa && e instanceof pa && t.firestore === e.firestore && Ne(t._query, e._query) && t.converter === e.converter
15343
15343
  /**
15344
15344
  * @license
15345
15345
  * Copyright 2020 Google LLC
@@ -15358,7 +15358,7 @@ function bu(t, e) {
15358
15358
  */;
15359
15359
  }
15360
15360
 
15361
- var Iu = /** @class */ function() {
15361
+ var Ia = /** @class */ function() {
15362
15362
  function t() {
15363
15363
  var t = this;
15364
15364
  // The last promise in the queue.
@@ -15589,7 +15589,7 @@ var Iu = /** @class */ function() {
15589
15589
  }, t;
15590
15590
  }();
15591
15591
 
15592
- function Tu(t) {
15592
+ function Ta(t) {
15593
15593
  /**
15594
15594
  * Returns true if obj is an object and contains at least one of the specified
15595
15595
  * methods.
@@ -15604,7 +15604,7 @@ function Tu(t) {
15604
15604
  }(t);
15605
15605
  }
15606
15606
 
15607
- var Eu = /** @class */ function() {
15607
+ var Ea = /** @class */ function() {
15608
15608
  function t() {
15609
15609
  this._progressObserver = {}, this._taskCompletionResolver = new J, this._lastProgress = {
15610
15610
  taskState: "Running",
@@ -15676,23 +15676,23 @@ var Eu = /** @class */ function() {
15676
15676
  t.prototype._updateProgress = function(t) {
15677
15677
  this._lastProgress = t, this._progressObserver.next && this._progressObserver.next(t);
15678
15678
  }, t;
15679
- }(), Su = -1, _u = /** @class */ function(e) {
15679
+ }(), Sa = -1, _a = /** @class */ function(e) {
15680
15680
  /** @hideconstructor */
15681
15681
  function n(t, n, r) {
15682
15682
  var i = this;
15683
15683
  /**
15684
15684
  * Whether it's a {@link Firestore} or Firestore Lite instance.
15685
15685
  */
15686
- return (i = e.call(this, t, n, r) || this).type = "firestore", i._queue = new Iu,
15686
+ return (i = e.call(this, t, n, r) || this).type = "firestore", i._queue = new Ia,
15687
15687
  i._persistenceKey = "name" in t ? t.name : "[DEFAULT]", i;
15688
15688
  }
15689
15689
  return t(n, e), n.prototype._terminate = function() {
15690
15690
  return this._firestoreClient ||
15691
15691
  // The client must be initialized to ensure that all subsequent API
15692
15692
  // usage throws an exception.
15693
- Nu(this), this._firestoreClient.terminate();
15693
+ Na(this), this._firestoreClient.terminate();
15694
15694
  }, n;
15695
- }(fu);
15695
+ }(fa);
15696
15696
 
15697
15697
  /**
15698
15698
  * @license
@@ -15722,7 +15722,7 @@ var Eu = /** @class */ function() {
15722
15722
  * @param settings - A settings object to configure the {@link Firestore} instance.
15723
15723
  * @returns A newly initialized {@link Firestore} instance.
15724
15724
  */
15725
- function Au(t, e) {
15725
+ function Aa(t, e) {
15726
15726
  var n = _getProvider(t, "firestore");
15727
15727
  if (n.isInitialized()) {
15728
15728
  var r = n.getImmediate(), i = n.getOptions();
@@ -15743,21 +15743,21 @@ function Au(t, e) {
15743
15743
  * @param app - The {@link @firebase/app#FirebaseApp} instance that the returned {@link Firestore}
15744
15744
  * instance is associated with.
15745
15745
  * @returns The {@link Firestore} instance of the provided app.
15746
- */ function ku(t) {
15747
- return void 0 === t && (t = a()), _getProvider(t, "firestore").getImmediate();
15746
+ */ function ka(t) {
15747
+ return void 0 === t && (t = u()), _getProvider(t, "firestore").getImmediate();
15748
15748
  }
15749
15749
 
15750
15750
  /**
15751
15751
  * @internal
15752
- */ function Du(t) {
15753
- return t._firestoreClient || Nu(t), t._firestoreClient.verifyNotTerminated(), t._firestoreClient;
15752
+ */ function Da(t) {
15753
+ return t._firestoreClient || Na(t), t._firestoreClient.verifyNotTerminated(), t._firestoreClient;
15754
15754
  }
15755
15755
 
15756
- function Nu(t) {
15756
+ function Na(t) {
15757
15757
  var e, n = t._freezeSettings(), r = function(t, e, n, r) {
15758
- return new tu(t, e, n, r.host, r.ssl, r.experimentalForceLongPolling, r.experimentalAutoDetectLongPolling, r.useFetchStreams);
15758
+ return new ta(t, e, n, r.host, r.ssl, r.experimentalForceLongPolling, r.experimentalAutoDetectLongPolling, r.useFetchStreams);
15759
15759
  }(t._databaseId, (null === (e = t._app) || void 0 === e ? void 0 : e.options.appId) || "", t._persistenceKey, n);
15760
- t._firestoreClient = new ja(t._authCredentials, t._appCheckCredentials, t._queue, r);
15760
+ t._firestoreClient = new ju(t._authCredentials, t._appCheckCredentials, t._queue, r);
15761
15761
  }
15762
15762
 
15763
15763
  /**
@@ -15782,10 +15782,10 @@ function Nu(t) {
15782
15782
  * @param persistenceSettings - Optional settings object to configure
15783
15783
  * persistence.
15784
15784
  * @returns A `Promise` that represents successfully enabling persistent storage.
15785
- */ function Cu(t, e) {
15786
- Uu(t = uu(t, _u));
15787
- var n = Du(t), r = t._freezeSettings(), i = new Ma;
15788
- return Ru(n, i, new Pa(i, r.cacheSizeBytes, null == e ? void 0 : e.forceOwnership));
15785
+ */ function Ca(t, e) {
15786
+ Ua(t = aa(t, _a));
15787
+ var n = Da(t), r = t._freezeSettings(), i = new Mu;
15788
+ return Ra(n, i, new Pu(i, r.cacheSizeBytes, null == e ? void 0 : e.forceOwnership));
15789
15789
  }
15790
15790
 
15791
15791
  /**
@@ -15809,10 +15809,10 @@ function Nu(t) {
15809
15809
  * @param firestore - The {@link Firestore} instance to enable persistence for.
15810
15810
  * @returns A `Promise` that represents successfully enabling persistent
15811
15811
  * storage.
15812
- */ function xu(t) {
15813
- Uu(t = uu(t, _u));
15814
- var e = Du(t), n = t._freezeSettings(), r = new Ma;
15815
- return Ru(e, r, new Oa(r, n.cacheSizeBytes));
15812
+ */ function xa(t) {
15813
+ Ua(t = aa(t, _a));
15814
+ var e = Da(t), n = t._freezeSettings(), r = new Mu;
15815
+ return Ra(e, r, new Ou(r, n.cacheSizeBytes));
15816
15816
  }
15817
15817
 
15818
15818
  /**
@@ -15820,7 +15820,7 @@ function Nu(t) {
15820
15820
  * If the operation fails with a recoverable error (see
15821
15821
  * `canRecoverFromIndexedDbError()` below), the returned Promise is rejected
15822
15822
  * but the client remains usable.
15823
- */ function Ru(t, e, i) {
15823
+ */ function Ra(t, e, i) {
15824
15824
  var o = this, s = new J;
15825
15825
  return t.asyncQueue.enqueue((function() {
15826
15826
  return n(o, void 0, void 0, (function() {
@@ -15828,10 +15828,10 @@ function Nu(t) {
15828
15828
  return r(this, (function(r) {
15829
15829
  switch (r.label) {
15830
15830
  case 0:
15831
- return r.trys.push([ 0, 3, , 4 ]), [ 4 /*yield*/ , Ka(t, i) ];
15831
+ return r.trys.push([ 0, 3, , 4 ]), [ 4 /*yield*/ , Ku(t, i) ];
15832
15832
 
15833
15833
  case 1:
15834
- return r.sent(), [ 4 /*yield*/ , Ga(t, e) ];
15834
+ return r.sent(), [ 4 /*yield*/ , Gu(t, e) ];
15835
15835
 
15836
15836
  case 2:
15837
15837
  return r.sent(), s.resolve(), [ 3 /*break*/ , 4 ];
@@ -15861,7 +15861,7 @@ function Nu(t) {
15861
15861
  }));
15862
15862
  }
15863
15863
 
15864
- function Lu(t) {
15864
+ function La(t) {
15865
15865
  var e = this;
15866
15866
  if (t._initialized && !t._terminated) throw new Y(H.FAILED_PRECONDITION, "Persistence can only be cleared before a Firestore instance is initialized or after it is terminated.");
15867
15867
  var i = new J;
@@ -15916,7 +15916,7 @@ function Lu(t) {
15916
15916
  */;
15917
15917
  }
15918
15918
 
15919
- function Pu(t) {
15919
+ function Pa(t) {
15920
15920
  return function(t) {
15921
15921
  var e = this, i = new J;
15922
15922
  return t.asyncQueue.enqueueAndForget((function() {
@@ -15925,7 +15925,7 @@ function Pu(t) {
15925
15925
  return r(this, (function(n) {
15926
15926
  switch (n.label) {
15927
15927
  case 0:
15928
- return e = ha, [ 4 /*yield*/ , Ja(t) ];
15928
+ return e = hu, [ 4 /*yield*/ , Ju(t) ];
15929
15929
 
15930
15930
  case 1:
15931
15931
  return [ 2 /*return*/ , e.apply(void 0, [ n.sent(), i ]) ];
@@ -15933,7 +15933,7 @@ function Pu(t) {
15933
15933
  }));
15934
15934
  }));
15935
15935
  })), i.promise;
15936
- }(Du(t = uu(t, _u)));
15936
+ }(Da(t = aa(t, _a)));
15937
15937
  }
15938
15938
 
15939
15939
  /**
@@ -15941,7 +15941,7 @@ function Pu(t) {
15941
15941
  * call to {@link disableNetwork}.
15942
15942
  *
15943
15943
  * @returns A `Promise` that is resolved once the network has been enabled.
15944
- */ function Ou(t) {
15944
+ */ function Oa(t) {
15945
15945
  return function(t) {
15946
15946
  var e = this;
15947
15947
  return t.asyncQueue.enqueue((function() {
@@ -15950,10 +15950,10 @@ function Pu(t) {
15950
15950
  return r(this, (function(r) {
15951
15951
  switch (r.label) {
15952
15952
  case 0:
15953
- return [ 4 /*yield*/ , Wa(t) ];
15953
+ return [ 4 /*yield*/ , Wu(t) ];
15954
15954
 
15955
15955
  case 1:
15956
- return e = r.sent(), [ 4 /*yield*/ , Ya(t) ];
15956
+ return e = r.sent(), [ 4 /*yield*/ , Yu(t) ];
15957
15957
 
15958
15958
  case 2:
15959
15959
  return n = r.sent(), [ 2 /*return*/ , (e.setNetworkEnabled(!0), function(t) {
@@ -15965,7 +15965,7 @@ function Pu(t) {
15965
15965
  }));
15966
15966
  }));
15967
15967
  }
15968
- /** Disables the network connection. Pending operations will not complete. */ (Du(t = uu(t, _u)));
15968
+ /** Disables the network connection. Pending operations will not complete. */ (Da(t = aa(t, _a)));
15969
15969
  }
15970
15970
 
15971
15971
  /**
@@ -15975,7 +15975,7 @@ function Pu(t) {
15975
15975
  * operations will be queued until the network is restored.
15976
15976
  *
15977
15977
  * @returns A `Promise` that is resolved once the network has been disabled.
15978
- */ function Mu(t) {
15978
+ */ function Ma(t) {
15979
15979
  return function(t) {
15980
15980
  var e = this;
15981
15981
  return t.asyncQueue.enqueue((function() {
@@ -15984,10 +15984,10 @@ function Pu(t) {
15984
15984
  return r(this, (function(o) {
15985
15985
  switch (o.label) {
15986
15986
  case 0:
15987
- return [ 4 /*yield*/ , Wa(t) ];
15987
+ return [ 4 /*yield*/ , Wu(t) ];
15988
15988
 
15989
15989
  case 1:
15990
- return e = o.sent(), [ 4 /*yield*/ , Ya(t) ];
15990
+ return e = o.sent(), [ 4 /*yield*/ , Yu(t) ];
15991
15991
 
15992
15992
  case 2:
15993
15993
  return i = o.sent(), [ 2 /*return*/ , (e.setNetworkEnabled(!1), function(t) {
@@ -15996,7 +15996,7 @@ function Pu(t) {
15996
15996
  return r(this, (function(n) {
15997
15997
  switch (n.label) {
15998
15998
  case 0:
15999
- return (e = W(t)).Gr.add(0 /* UserDisabled */), [ 4 /*yield*/ , as(e) ];
15999
+ return (e = W(t)).Gr.add(0 /* UserDisabled */), [ 4 /*yield*/ , us(e) ];
16000
16000
 
16001
16001
  case 1:
16002
16002
  return n.sent(),
@@ -16015,7 +16015,7 @@ function Pu(t) {
16015
16015
  * Returns a Promise that resolves when all writes that were pending at the time
16016
16016
  * this method was called received server acknowledgement. An acknowledgement
16017
16017
  * can be either acceptance or rejection.
16018
- */ (Du(t = uu(t, _u)));
16018
+ */ (Da(t = aa(t, _a)));
16019
16019
  }
16020
16020
 
16021
16021
  /**
@@ -16039,8 +16039,8 @@ function Pu(t) {
16039
16039
  *
16040
16040
  * @returns A `Promise` that is resolved when the instance has been successfully
16041
16041
  * terminated.
16042
- */ function Fu(t) {
16043
- return u(t.app, "firestore"), t._delete()
16042
+ */ function Fa(t) {
16043
+ return a(t.app, "firestore"), t._delete()
16044
16044
  /**
16045
16045
  * Loads a Firestore bundle into the local cache.
16046
16046
  *
@@ -16054,15 +16054,15 @@ function Pu(t) {
16054
16054
  */;
16055
16055
  }
16056
16056
 
16057
- function Vu(t, e) {
16058
- var i = Du(t = uu(t, _u)), o = new Eu;
16057
+ function Va(t, e) {
16058
+ var i = Da(t = aa(t, _a)), o = new Ea;
16059
16059
  return function(t, e, i, o) {
16060
- var s = this, a = function(t, e) {
16060
+ var s = this, u = function(t, e) {
16061
16061
  return function(t, e) {
16062
- return new qa(t, e);
16062
+ return new qu(t, e);
16063
16063
  }(function(t, e) {
16064
- if (t instanceof Uint8Array) return Fa(t, e);
16065
- if (t instanceof ArrayBuffer) return Fa(new Uint8Array(t), e);
16064
+ if (t instanceof Uint8Array) return Fu(t, e);
16065
+ if (t instanceof ArrayBuffer) return Fu(new Uint8Array(t), e);
16066
16066
  if (t instanceof ReadableStream) return t.getReader();
16067
16067
  throw new Error("Source of `toByteStreamReader` has to be a ArrayBuffer or ReadableStream");
16068
16068
  }("string" == typeof t ? (new TextEncoder).encode(t) : t), e);
@@ -16073,10 +16073,10 @@ function Vu(t, e) {
16073
16073
  return r(this, (function(n) {
16074
16074
  switch (n.label) {
16075
16075
  case 0:
16076
- return e = Ra, [ 4 /*yield*/ , Ja(t) ];
16076
+ return e = Ru, [ 4 /*yield*/ , Ju(t) ];
16077
16077
 
16078
16078
  case 1:
16079
- return e.apply(void 0, [ n.sent(), a, o ]), [ 2 /*return*/ ];
16079
+ return e.apply(void 0, [ n.sent(), u, o ]), [ 2 /*return*/ ];
16080
16080
  }
16081
16081
  }));
16082
16082
  }));
@@ -16096,7 +16096,7 @@ function Vu(t, e) {
16096
16096
  */;
16097
16097
  }
16098
16098
 
16099
- function qu(t, e) {
16099
+ function qa(t, e) {
16100
16100
  return function(t, e) {
16101
16101
  var i = this;
16102
16102
  return t.asyncQueue.enqueue((function() {
@@ -16110,7 +16110,7 @@ function qu(t, e) {
16110
16110
  return n.persistence.runTransaction("Get named query", "readonly", (function(t) {
16111
16111
  return n.Ye.getNamedQuery(t, e);
16112
16112
  }));
16113
- }, [ 4 /*yield*/ , Ha(t) ];
16113
+ }, [ 4 /*yield*/ , Hu(t) ];
16114
16114
 
16115
16115
  case 1:
16116
16116
  return [ 2 /*return*/ , n.apply(void 0, [ r.sent(), e ]) ];
@@ -16118,12 +16118,12 @@ function qu(t, e) {
16118
16118
  }));
16119
16119
  }));
16120
16120
  }));
16121
- }(Du(t = uu(t, _u)), e).then((function(e) {
16122
- return e ? new pu(t, null, e.query) : null;
16121
+ }(Da(t = aa(t, _a)), e).then((function(e) {
16122
+ return e ? new pa(t, null, e.query) : null;
16123
16123
  }));
16124
16124
  }
16125
16125
 
16126
- function Uu(t) {
16126
+ function Ua(t) {
16127
16127
  if (t._initialized || t._terminated) throw new Y(H.FAILED_PRECONDITION, "Firestore has already been started and persistence can no longer be enabled. You can only enable persistence before calling any other methods on a Firestore object.");
16128
16128
  }
16129
16129
 
@@ -16166,7 +16166,7 @@ function Uu(t) {
16166
16166
  *
16167
16167
  * Create a `FieldPath` by providing field names. If more than one field
16168
16168
  * name is provided, the path will point to a nested field in a document.
16169
- */ var Bu = /** @class */ function() {
16169
+ */ var Ba = /** @class */ function() {
16170
16170
  /**
16171
16171
  * Creates a `FieldPath` from the provided field names. If more than one field
16172
16172
  * name is provided, the path will point to a nested field in a document.
@@ -16191,8 +16191,8 @@ function Uu(t) {
16191
16191
  /**
16192
16192
  * Returns a special sentinel `FieldPath` to refer to the ID of a document.
16193
16193
  * It can be used in queries to sort or filter by the document ID.
16194
- */ function ju() {
16195
- return new Bu("__name__");
16194
+ */ function ja() {
16195
+ return new Ba("__name__");
16196
16196
  }
16197
16197
 
16198
16198
  /**
@@ -16213,7 +16213,7 @@ function Uu(t) {
16213
16213
  */
16214
16214
  /**
16215
16215
  * An immutable object representing an array of bytes.
16216
- */ var Ku = /** @class */ function() {
16216
+ */ var Ka = /** @class */ function() {
16217
16217
  /** @hideconstructor */
16218
16218
  function t(t) {
16219
16219
  this._byteString = t;
@@ -16271,14 +16271,14 @@ function Uu(t) {
16271
16271
  t.prototype.isEqual = function(t) {
16272
16272
  return this._byteString.isEqual(t._byteString);
16273
16273
  }, t;
16274
- }(), Gu =
16274
+ }(), Ga =
16275
16275
  /**
16276
16276
  * @param _methodName - The public API endpoint that returns this class.
16277
16277
  * @hideconstructor
16278
16278
  */
16279
16279
  function(t) {
16280
16280
  this._methodName = t;
16281
- }, zu = /** @class */ function() {
16281
+ }, za = /** @class */ function() {
16282
16282
  /**
16283
16283
  * Creates a new immutable `GeoPoint` object with the provided latitude and
16284
16284
  * longitude values.
@@ -16331,21 +16331,21 @@ function(t) {
16331
16331
  t.prototype._compareTo = function(t) {
16332
16332
  return ct(this._lat, t._lat) || ct(this._long, t._long);
16333
16333
  }, t;
16334
- }(), Qu = /^__.*__$/, Wu = /** @class */ function() {
16334
+ }(), Qa = /^__.*__$/, Wa = /** @class */ function() {
16335
16335
  function t(t, e, n) {
16336
16336
  this.data = t, this.fieldMask = e, this.fieldTransforms = n;
16337
16337
  }
16338
16338
  return t.prototype.toMutation = function(t, e) {
16339
- return null !== this.fieldMask ? new un(t, this.data, this.fieldMask, e, this.fieldTransforms) : new an(t, this.data, e, this.fieldTransforms);
16339
+ return null !== this.fieldMask ? new an(t, this.data, this.fieldMask, e, this.fieldTransforms) : new un(t, this.data, e, this.fieldTransforms);
16340
16340
  }, t;
16341
- }(), Hu = /** @class */ function() {
16341
+ }(), Ha = /** @class */ function() {
16342
16342
  function t(t,
16343
16343
  // The fieldMask does not include document transforms.
16344
16344
  e, n) {
16345
16345
  this.data = t, this.fieldMask = e, this.fieldTransforms = n;
16346
16346
  }
16347
16347
  return t.prototype.toMutation = function(t, e) {
16348
- return new un(t, this.data, this.fieldMask, e, this.fieldTransforms);
16348
+ return new an(t, this.data, this.fieldMask, e, this.fieldTransforms);
16349
16349
  }, t;
16350
16350
  }();
16351
16351
 
@@ -16368,7 +16368,7 @@ function(t) {
16368
16368
  /**
16369
16369
  * Sentinel values that can be used when writing document fields with `set()`
16370
16370
  * or `update()`.
16371
- */ function Yu(t) {
16371
+ */ function Ya(t) {
16372
16372
  switch (t) {
16373
16373
  case 0 /* Set */ :
16374
16374
  // fall through
@@ -16386,7 +16386,7 @@ function(t) {
16386
16386
  }
16387
16387
  }
16388
16388
 
16389
- /** A "context" object passed around while parsing user data. */ var Ju = /** @class */ function() {
16389
+ /** A "context" object passed around while parsing user data. */ var Ja = /** @class */ function() {
16390
16390
  /**
16391
16391
  * Initializes a ParseContext with the given source and path.
16392
16392
  *
@@ -16460,15 +16460,15 @@ function(t) {
16460
16460
  if (this.path) for (var t = 0; t < this.path.length; t++) this.Lc(this.path.get(t));
16461
16461
  }, t.prototype.Lc = function(t) {
16462
16462
  if (0 === t.length) throw this.qc("Document fields must not be empty");
16463
- if (Yu(this.$c) && Qu.test(t)) throw this.qc('Document fields cannot begin and end with "__"');
16463
+ if (Ya(this.$c) && Qa.test(t)) throw this.qc('Document fields cannot begin and end with "__"');
16464
16464
  }, t;
16465
- }(), Xu = /** @class */ function() {
16465
+ }(), Xa = /** @class */ function() {
16466
16466
  function t(t, e, n) {
16467
16467
  this.databaseId = t, this.ignoreUndefinedProperties = e, this.k = n || $o(t)
16468
16468
  /** Creates a new top-level parse context. */;
16469
16469
  }
16470
16470
  return t.prototype.Qc = function(t, e, n, r) {
16471
- return void 0 === r && (r = !1), new Ju({
16471
+ return void 0 === r && (r = !1), new Ja({
16472
16472
  $c: t,
16473
16473
  methodName: e,
16474
16474
  jc: n,
@@ -16482,27 +16482,27 @@ function(t) {
16482
16482
  /**
16483
16483
  * Helper for parsing raw user input (provided via the API) into internal model
16484
16484
  * classes.
16485
- */ function $u(t) {
16485
+ */ function $a(t) {
16486
16486
  var e = t._freezeSettings(), n = $o(t._databaseId);
16487
- return new Xu(t._databaseId, !!e.ignoreUndefinedProperties, n);
16487
+ return new Xa(t._databaseId, !!e.ignoreUndefinedProperties, n);
16488
16488
  }
16489
16489
 
16490
- /** Parse document data from a set() call. */ function Zu(t, e, n, r, i, o) {
16490
+ /** Parse document data from a set() call. */ function Za(t, e, n, r, i, o) {
16491
16491
  void 0 === o && (o = {});
16492
16492
  var s = t.Qc(o.merge || o.mergeFields ? 2 /* MergeSet */ : 0 /* Set */ , e, n, i);
16493
16493
  lc("Data must be an object, but it was:", s, r);
16494
- var a, u, c = hc(r, s);
16495
- if (o.merge) a = new It(s.fieldMask), u = s.fieldTransforms; else if (o.mergeFields) {
16494
+ var u, a, c = hc(r, s);
16495
+ if (o.merge) u = new It(s.fieldMask), a = s.fieldTransforms; else if (o.mergeFields) {
16496
16496
  for (var h = [], f = 0, l = o.mergeFields; f < l.length; f++) {
16497
16497
  var d = dc(e, l[f], n);
16498
16498
  if (!s.contains(d)) throw new Y(H.INVALID_ARGUMENT, "Field '" + d + "' is specified in your field mask but missing from your input data.");
16499
16499
  mc(h, d) || h.push(d);
16500
16500
  }
16501
- a = new It(h), u = s.fieldTransforms.filter((function(t) {
16502
- return a.covers(t.field);
16501
+ u = new It(h), a = s.fieldTransforms.filter((function(t) {
16502
+ return u.covers(t.field);
16503
16503
  }));
16504
- } else a = null, u = s.fieldTransforms;
16505
- return new Wu(new Yt(c), a, u);
16504
+ } else u = null, a = s.fieldTransforms;
16505
+ return new Wa(new Yt(c), u, a);
16506
16506
  }
16507
16507
 
16508
16508
  var tc = /** @class */ function(e) {
@@ -16517,7 +16517,7 @@ var tc = /** @class */ function(e) {
16517
16517
  }, n.prototype.isEqual = function(t) {
16518
16518
  return t instanceof n;
16519
16519
  }, n;
16520
- }(Gu);
16520
+ }(Ga);
16521
16521
 
16522
16522
  /**
16523
16523
  * Creates a child context for parsing SerializableFieldValues.
@@ -16535,7 +16535,7 @@ var tc = /** @class */ function(e) {
16535
16535
  * @param context - The parent context.
16536
16536
  * @param arrayElement - Whether or not the FieldValue has an array.
16537
16537
  */ function ec(t, e, n) {
16538
- return new Ju({
16538
+ return new Ja({
16539
16539
  $c: 3 /* Argument */ ,
16540
16540
  jc: e.settings.jc,
16541
16541
  methodName: t._methodName,
@@ -16552,7 +16552,7 @@ var nc = /** @class */ function(e) {
16552
16552
  }, n.prototype.isEqual = function(t) {
16553
16553
  return t instanceof n;
16554
16554
  }, n;
16555
- }(Gu), rc = /** @class */ function(e) {
16555
+ }(Ga), rc = /** @class */ function(e) {
16556
16556
  function n(t, n) {
16557
16557
  var r = this;
16558
16558
  return (r = e.call(this, t) || this).Wc = n, r;
@@ -16567,7 +16567,7 @@ var nc = /** @class */ function(e) {
16567
16567
  // TODO(mrschmidt): Implement isEquals
16568
16568
  return this === t;
16569
16569
  }, n;
16570
- }(Gu), ic = /** @class */ function(e) {
16570
+ }(Ga), ic = /** @class */ function(e) {
16571
16571
  function n(t, n) {
16572
16572
  var r = this;
16573
16573
  return (r = e.call(this, t) || this).Wc = n, r;
@@ -16582,7 +16582,7 @@ var nc = /** @class */ function(e) {
16582
16582
  // TODO(mrschmidt): Implement isEquals
16583
16583
  return this === t;
16584
16584
  }, n;
16585
- }(Gu), oc = /** @class */ function(e) {
16585
+ }(Ga), oc = /** @class */ function(e) {
16586
16586
  function n(t, n) {
16587
16587
  var r = this;
16588
16588
  return (r = e.call(this, t) || this).Gc = n, r;
@@ -16594,37 +16594,37 @@ var nc = /** @class */ function(e) {
16594
16594
  // TODO(mrschmidt): Implement isEquals
16595
16595
  return this === t;
16596
16596
  }, n;
16597
- }(Gu);
16597
+ }(Ga);
16598
16598
 
16599
16599
  /** Parse update data from an update() call. */ function sc(t, e, n, r) {
16600
16600
  var i = t.Qc(1 /* Update */ , e, n);
16601
16601
  lc("Data must be an object, but it was:", i, r);
16602
16602
  var o = [], s = Yt.empty();
16603
16603
  yt(r, (function(t, r) {
16604
- var a = yc(e, t, n);
16604
+ var u = yc(e, t, n);
16605
16605
  // For Compat types, we have to "extract" the underlying types before
16606
16606
  // performing validation.
16607
16607
  r = I(r);
16608
- var u = i.Bc(a);
16608
+ var a = i.Bc(u);
16609
16609
  if (r instanceof tc)
16610
16610
  // Add it to the field mask, but don't add anything to updateData.
16611
- o.push(a); else {
16612
- var c = cc(r, u);
16613
- null != c && (o.push(a), s.set(a, c));
16611
+ o.push(u); else {
16612
+ var c = cc(r, a);
16613
+ null != c && (o.push(u), s.set(u, c));
16614
16614
  }
16615
16615
  }));
16616
- var a = new It(o);
16617
- return new Hu(s, a, i.fieldTransforms);
16616
+ var u = new It(o);
16617
+ return new Ha(s, u, i.fieldTransforms);
16618
16618
  }
16619
16619
 
16620
- /** Parse update data from a list of field/value arguments. */ function ac(t, e, n, r, i, o) {
16621
- var s = t.Qc(1 /* Update */ , e, n), a = [ dc(e, r, n) ], u = [ i ];
16620
+ /** Parse update data from a list of field/value arguments. */ function uc(t, e, n, r, i, o) {
16621
+ var s = t.Qc(1 /* Update */ , e, n), u = [ dc(e, r, n) ], a = [ i ];
16622
16622
  if (o.length % 2 != 0) throw new Y(H.INVALID_ARGUMENT, "Function " + e + "() needs to be called with an even number of arguments that alternate between field names and values.");
16623
- for (var c = 0; c < o.length; c += 2) a.push(dc(e, o[c])), u.push(o[c + 1]);
16623
+ for (var c = 0; c < o.length; c += 2) u.push(dc(e, o[c])), a.push(o[c + 1]);
16624
16624
  // We iterate in reverse order to pick the last value for a field if the
16625
16625
  // user specified the field multiple times.
16626
- for (var h = [], f = Yt.empty(), l = a.length - 1; l >= 0; --l) if (!mc(h, a[l])) {
16627
- var d = a[l], p = u[l];
16626
+ for (var h = [], f = Yt.empty(), l = u.length - 1; l >= 0; --l) if (!mc(h, u[l])) {
16627
+ var d = u[l], p = a[l];
16628
16628
  // For Compat types, we have to "extract" the underlying types before
16629
16629
  // performing validation.
16630
16630
  p = I(p);
@@ -16637,7 +16637,7 @@ var nc = /** @class */ function(e) {
16637
16637
  }
16638
16638
  }
16639
16639
  var m = new It(h);
16640
- return new Hu(f, m, s.fieldTransforms);
16640
+ return new Ha(f, m, s.fieldTransforms);
16641
16641
  }
16642
16642
 
16643
16643
  /**
@@ -16646,7 +16646,7 @@ var nc = /** @class */ function(e) {
16646
16646
  *
16647
16647
  * @param allowArrays - Whether the query value is an array that may directly
16648
16648
  * contain additional arrays (e.g. the operand of an `in` query).
16649
- */ function uc(t, e, n, r) {
16649
+ */ function ac(t, e, n, r) {
16650
16650
  return void 0 === r && (r = !1), cc(n, t.Qc(r ? 4 /* ArrayArgument */ : 3 /* Argument */ , e));
16651
16651
  }
16652
16652
 
@@ -16663,7 +16663,7 @@ var nc = /** @class */ function(e) {
16663
16663
  // Unwrap the API type from the Compat SDK. This will return the API type
16664
16664
  // from firestore-exp.
16665
16665
  t = I(t))) return lc("Unsupported field value:", e, t), hc(t, e);
16666
- if (t instanceof Gu)
16666
+ if (t instanceof Ga)
16667
16667
  // FieldValues usually parse into transforms (except deleteField())
16668
16668
  // in which case we do not want to include this field in our parsed data
16669
16669
  // (as doing so will overwrite the field directly prior to the transform
@@ -16675,7 +16675,7 @@ var nc = /** @class */ function(e) {
16675
16675
  */
16676
16676
  return function(t, e) {
16677
16677
  // Sentinels are only supported with writes, and not within arrays.
16678
- if (!Yu(e.$c)) throw e.qc(t._methodName + "() can only be used with update() and set()");
16678
+ if (!Ya(e.$c)) throw e.qc(t._methodName + "() can only be used with update() and set()");
16679
16679
  if (!e.path) throw e.qc(t._methodName + "() is not currently supported inside arrays");
16680
16680
  var n = t._toFieldTransform(e);
16681
16681
  n && e.fieldTransforms.push(n);
@@ -16739,23 +16739,23 @@ var nc = /** @class */ function(e) {
16739
16739
  timestampValue: zn(e.k, r)
16740
16740
  };
16741
16741
  }
16742
- if (t instanceof zu) return {
16742
+ if (t instanceof za) return {
16743
16743
  geoPointValue: {
16744
16744
  latitude: t.latitude,
16745
16745
  longitude: t.longitude
16746
16746
  }
16747
16747
  };
16748
- if (t instanceof Ku) return {
16748
+ if (t instanceof Ka) return {
16749
16749
  bytesValue: Qn(e.k, t._byteString)
16750
16750
  };
16751
- if (t instanceof du) {
16751
+ if (t instanceof da) {
16752
16752
  var i = e.databaseId, o = t.firestore._databaseId;
16753
16753
  if (!o.isEqual(i)) throw e.qc("Document reference is for database " + o.projectId + "/" + o.database + " but should be for database " + i.projectId + "/" + i.database);
16754
16754
  return {
16755
16755
  referenceValue: Yn(t.firestore._databaseId || e.databaseId, t._key.path)
16756
16756
  };
16757
16757
  }
16758
- throw e.qc("Unsupported field value: " + au(t));
16758
+ throw e.qc("Unsupported field value: " + ua(t));
16759
16759
  }(t, e);
16760
16760
  }
16761
16761
 
@@ -16775,14 +16775,14 @@ function hc(t, e) {
16775
16775
  }
16776
16776
 
16777
16777
  function fc(t) {
16778
- return !("object" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof lt || t instanceof zu || t instanceof Ku || t instanceof du || t instanceof Gu);
16778
+ return !("object" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof lt || t instanceof za || t instanceof Ka || t instanceof da || t instanceof Ga);
16779
16779
  }
16780
16780
 
16781
16781
  function lc(t, e, n) {
16782
16782
  if (!fc(n) || !function(t) {
16783
16783
  return "object" == typeof t && null !== t && (Object.getPrototypeOf(t) === Object.prototype || null === Object.getPrototypeOf(t));
16784
16784
  }(n)) {
16785
- var r = au(n);
16785
+ var r = ua(n);
16786
16786
  throw "an object" === r ? e.qc(t + " a custom object") : e.qc(t + " " + r);
16787
16787
  }
16788
16788
  }
@@ -16793,7 +16793,7 @@ function lc(t, e, n) {
16793
16793
  if (
16794
16794
  // If required, replace the FieldPath Compat class with with the firestore-exp
16795
16795
  // FieldPath.
16796
- (e = I(e)) instanceof Bu) return e._internalPath;
16796
+ (e = I(e)) instanceof Ba) return e._internalPath;
16797
16797
  if ("string" == typeof e) return yc(t, e);
16798
16798
  throw vc("Field path arguments must be of type string or ", t,
16799
16799
  /* hasConverter= */ !1,
@@ -16817,7 +16817,7 @@ function lc(t, e, n) {
16817
16817
  /* hasConverter= */ !1,
16818
16818
  /* path= */ void 0, r);
16819
16819
  try {
16820
- return (new (Bu.bind.apply(Bu, e([ void 0 ], n.split(".")))))._internalPath;
16820
+ return (new (Ba.bind.apply(Ba, e([ void 0 ], n.split(".")))))._internalPath;
16821
16821
  } catch (e) {
16822
16822
  throw vc("Invalid field path (" + n + "). Paths must not be empty, begin with '.', end with '.', or contain '..'", t,
16823
16823
  /* hasConverter= */ !1,
@@ -16826,11 +16826,11 @@ function lc(t, e, n) {
16826
16826
  }
16827
16827
 
16828
16828
  function vc(t, e, n, r, i) {
16829
- var o = r && !r.isEmpty(), s = void 0 !== i, a = "Function " + e + "() called with invalid data";
16830
- n && (a += " (via `toFirestore()`)");
16831
- var u = "";
16832
- return (o || s) && (u += " (found", o && (u += " in field " + r), s && (u += " in document " + i),
16833
- u += ")"), new Y(H.INVALID_ARGUMENT, (a += ". ") + t + u)
16829
+ var o = r && !r.isEmpty(), s = void 0 !== i, u = "Function " + e + "() called with invalid data";
16830
+ n && (u += " (via `toFirestore()`)");
16831
+ var a = "";
16832
+ return (o || s) && (a += " (found", o && (a += " in field " + r), s && (a += " in document " + i),
16833
+ a += ")"), new Y(H.INVALID_ARGUMENT, (u += ". ") + t + a)
16834
16834
  /** Checks `haystack` if FieldPath `needle` is present. Runs in O(n). */;
16835
16835
  }
16836
16836
 
@@ -16885,7 +16885,7 @@ function mc(t, e) {
16885
16885
  * The `DocumentReference` for the document included in the `DocumentSnapshot`.
16886
16886
  */
16887
16887
  get: function() {
16888
- return new du(this._firestore, this._converter, this._key);
16888
+ return new da(this._firestore, this._converter, this._key);
16889
16889
  },
16890
16890
  enumerable: !1,
16891
16891
  configurable: !0
@@ -16963,7 +16963,7 @@ function mc(t, e) {
16963
16963
  * Helper that calls `fromDotSeparatedString()` but wraps any error thrown.
16964
16964
  */
16965
16965
  function bc(t, e) {
16966
- return "string" == typeof e ? yc(t, e) : e instanceof Bu ? e._internalPath : e._delegate._internalPath;
16966
+ return "string" == typeof e ? yc(t, e) : e instanceof Ba ? e._internalPath : e._delegate._internalPath;
16967
16967
  }
16968
16968
 
16969
16969
  /**
@@ -17001,9 +17001,9 @@ function bc(t, e) {
17001
17001
  }(), Tc = /** @class */ function(e) {
17002
17002
  /** @hideconstructor protected */
17003
17003
  function n(t, n, r, i, o, s) {
17004
- var a = this;
17005
- return (a = e.call(this, t, n, r, i, s) || this)._firestore = t, a._firestoreImpl = t,
17006
- a.metadata = o, a;
17004
+ var u = this;
17005
+ return (u = e.call(this, t, n, r, i, s) || this)._firestore = t, u._firestoreImpl = t,
17006
+ u.metadata = o, u;
17007
17007
  }
17008
17008
  /**
17009
17009
  * Property of the `DocumentSnapshot` that signals whether or not the data
@@ -17201,7 +17201,7 @@ function bc(t, e) {
17201
17201
  * @param right - A snapshot to compare.
17202
17202
  * @returns true if the snapshots are equal.
17203
17203
  */ function Ac(t, e) {
17204
- return t instanceof Tc && e instanceof Tc ? 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 Sc && e instanceof Sc && t._firestore === e._firestore && bu(t.query, e.query) && t.metadata.isEqual(e.metadata) && t._snapshot.isEqual(e._snapshot);
17204
+ return t instanceof Tc && e instanceof Tc ? 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 Sc && e instanceof Sc && t._firestore === e._firestore && ba(t.query, e.query) && t.metadata.isEqual(e.metadata) && t._snapshot.isEqual(e._snapshot);
17205
17205
  }
17206
17206
 
17207
17207
  /**
@@ -17256,26 +17256,26 @@ var Cc = /** @class */ function(e) {
17256
17256
  i;
17257
17257
  }
17258
17258
  return t(n, e), n.prototype._apply = function(t) {
17259
- var e = $u(t.firestore), n = function(t, e, n, r, i, o, s) {
17260
- var a;
17259
+ var e = $a(t.firestore), n = function(t, e, n, r, i, o, s) {
17260
+ var u;
17261
17261
  if (i.isKeyField()) {
17262
17262
  if ("array-contains" /* ARRAY_CONTAINS */ === o || "array-contains-any" /* ARRAY_CONTAINS_ANY */ === o) throw new Y(H.INVALID_ARGUMENT, "Invalid Query. You can't perform '" + o + "' queries on documentId().");
17263
17263
  if ("in" /* IN */ === o || "not-in" /* NOT_IN */ === o) {
17264
17264
  zc(s, o);
17265
- for (var u = [], c = 0, h = s; c < h.length; c++) {
17265
+ for (var a = [], c = 0, h = s; c < h.length; c++) {
17266
17266
  var f = h[c];
17267
- u.push(Gc(r, t, f));
17267
+ a.push(Gc(r, t, f));
17268
17268
  }
17269
- a = {
17269
+ u = {
17270
17270
  arrayValue: {
17271
- values: u
17271
+ values: a
17272
17272
  }
17273
17273
  };
17274
- } else a = Gc(r, t, s);
17274
+ } else u = Gc(r, t, s);
17275
17275
  } else "in" /* IN */ !== o && "not-in" /* NOT_IN */ !== o && "array-contains-any" /* ARRAY_CONTAINS_ANY */ !== o || zc(s, o),
17276
- a = uc(n, "where", s,
17276
+ u = ac(n, "where", s,
17277
17277
  /* allowArrays= */ "in" /* IN */ === o || "not-in" /* NOT_IN */ === o);
17278
- var l = re.create(i, o, a);
17278
+ var l = re.create(i, o, u);
17279
17279
  return function(t, e) {
17280
17280
  if (e.V()) {
17281
17281
  var n = Se(t);
@@ -17328,7 +17328,7 @@ var Cc = /** @class */ function(e) {
17328
17328
  throw i === e.op ? new Y(H.INVALID_ARGUMENT, "Invalid query. You cannot use more than one '" + e.op.toString() + "' filter.") : new Y(H.INVALID_ARGUMENT, "Invalid query. You cannot use '" + e.op.toString() + "' filters with '" + i.toString() + "' filters.");
17329
17329
  }(t, l), l;
17330
17330
  }(t._query, 0, e, t.firestore._databaseId, this.zc, this.Hc, this.Jc);
17331
- return new pu(t.firestore, t.converter, function(t, e) {
17331
+ return new pa(t.firestore, t.converter, function(t, e) {
17332
17332
  var n = t.filters.concat([ e ]);
17333
17333
  return new ge(t.path, t.collectionGroup, t.explicitOrderBy.slice(), n, t.limit, t.limitType, t.startAt, t.endAt);
17334
17334
  }(t._query, n));
@@ -17368,7 +17368,7 @@ var Rc = /** @class */ function(e) {
17368
17368
  }
17369
17369
  }(t, r), r;
17370
17370
  }(t._query, this.zc, this.Yc);
17371
- return new pu(t.firestore, t.converter, function(t, e) {
17371
+ return new pa(t.firestore, t.converter, function(t, e) {
17372
17372
  // TODO(dimond): validate that orderBy does not list the same key twice.
17373
17373
  var n = t.explicitOrderBy.concat([ e ]);
17374
17374
  return new ge(t.path, t.collectionGroup, n, t.filters.slice(), t.limit, t.limitType, t.startAt, t.endAt);
@@ -17396,7 +17396,7 @@ var Pc = /** @class */ function(e) {
17396
17396
  return (i = e.call(this) || this).type = t, i.Xc = n, i.Zc = r, i;
17397
17397
  }
17398
17398
  return t(n, e), n.prototype._apply = function(t) {
17399
- return new pu(t.firestore, t.converter, De(t._query, this.Xc, this.Zc));
17399
+ return new pa(t.firestore, t.converter, De(t._query, this.Xc, this.Zc));
17400
17400
  }, n;
17401
17401
  }(Dc);
17402
17402
 
@@ -17406,7 +17406,7 @@ var Pc = /** @class */ function(e) {
17406
17406
  * @param limit - The maximum number of items to return.
17407
17407
  * @returns The created {@link Query}.
17408
17408
  */ function Oc(t) {
17409
- return cu("limit", t), new Pc("limit", t, "F" /* First */)
17409
+ return ca("limit", t), new Pc("limit", t, "F" /* First */)
17410
17410
  /**
17411
17411
  * Creates a {@link QueryConstraint} that only returns the last matching documents.
17412
17412
  *
@@ -17419,7 +17419,7 @@ var Pc = /** @class */ function(e) {
17419
17419
  }
17420
17420
 
17421
17421
  function Mc(t) {
17422
- return cu("limitToLast", t), new Pc("limitToLast", t, "L" /* Last */);
17422
+ return ca("limitToLast", t), new Pc("limitToLast", t, "L" /* Last */);
17423
17423
  }
17424
17424
 
17425
17425
  var Fc = /** @class */ function(e) {
@@ -17429,7 +17429,7 @@ var Fc = /** @class */ function(e) {
17429
17429
  }
17430
17430
  return t(n, e), n.prototype._apply = function(t) {
17431
17431
  var e = Kc(t, this.type, this.ta, this.ea);
17432
- return new pu(t.firestore, t.converter, function(t, e) {
17432
+ return new pa(t.firestore, t.converter, function(t, e) {
17433
17433
  return new ge(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, e, t.endAt);
17434
17434
  }(t._query, e));
17435
17435
  }, n;
@@ -17453,7 +17453,7 @@ var Uc = /** @class */ function(e) {
17453
17453
  }
17454
17454
  return t(n, e), n.prototype._apply = function(t) {
17455
17455
  var e = Kc(t, this.type, this.ta, this.ea);
17456
- return new pu(t.firestore, t.converter, function(t, e) {
17456
+ return new pa(t.firestore, t.converter, function(t, e) {
17457
17457
  return new ge(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, t.startAt, e);
17458
17458
  }(t._query, e));
17459
17459
  }, n;
@@ -17479,13 +17479,13 @@ function jc() {
17479
17479
  // the provided document. Without the key (by using the explicit sort
17480
17480
  // orders), multiple documents could match the position, yielding duplicate
17481
17481
  // results.
17482
- for (var o = [], s = 0, a = Ae(t); s < a.length; s++) {
17483
- var u = a[s];
17484
- if (u.field.isKeyField()) o.push(jt(e, r.key)); else {
17485
- var c = r.data.field(u.field);
17486
- if (Dt(c)) throw new Y(H.INVALID_ARGUMENT, 'Invalid query. You are trying to start or end a query using a document for which the field "' + u.field + '" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');
17482
+ for (var o = [], s = 0, u = Ae(t); s < u.length; s++) {
17483
+ var a = u[s];
17484
+ if (a.field.isKeyField()) o.push(jt(e, r.key)); else {
17485
+ var c = r.data.field(a.field);
17486
+ if (Dt(c)) throw new Y(H.INVALID_ARGUMENT, 'Invalid query. You are trying to start or end a query using a document for which the field "' + a.field + '" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');
17487
17487
  if (null === c) {
17488
- var h = u.field.canonicalString();
17488
+ var h = a.field.canonicalString();
17489
17489
  throw new Y(H.INVALID_ARGUMENT, "Invalid query. You are trying to start or end a query using a document for which the field '" + h + "' (used as the orderBy) does not exist.");
17490
17490
  }
17491
17491
  o.push(c);
@@ -17493,26 +17493,26 @@ function jc() {
17493
17493
  }
17494
17494
  return new le(o, i);
17495
17495
  }(t._query, t.firestore._databaseId, e, n[0]._document, r);
17496
- var i = $u(t.firestore);
17496
+ var i = $a(t.firestore);
17497
17497
  return function(t, e, n, r, i, o) {
17498
17498
  // Use explicit order by's because it has to match the query the user made
17499
17499
  var s = t.explicitOrderBy;
17500
17500
  if (i.length > s.length) throw new Y(H.INVALID_ARGUMENT, "Too many arguments provided to " + r + "(). The number of arguments must be less than or equal to the number of orderBy() clauses");
17501
- for (var a = [], u = 0; u < i.length; u++) {
17502
- var c = i[u];
17503
- if (s[u].field.isKeyField()) {
17501
+ for (var u = [], a = 0; a < i.length; a++) {
17502
+ var c = i[a];
17503
+ if (s[a].field.isKeyField()) {
17504
17504
  if ("string" != typeof c) throw new Y(H.INVALID_ARGUMENT, "Invalid query. Expected a string for document ID in " + r + "(), but got a " + typeof c);
17505
17505
  if (!_e(t) && -1 !== c.indexOf("/")) throw new Y(H.INVALID_ARGUMENT, "Invalid query. When querying a collection and ordering by documentId(), the value passed to " + r + "() must be a plain document ID, but '" + c + "' contains a slash.");
17506
17506
  var h = t.path.child(gt.fromString(c));
17507
17507
  if (!Pt.isDocumentKey(h)) throw new Y(H.INVALID_ARGUMENT, "Invalid query. When querying a collection group and ordering by documentId(), the value passed to " + r + "() must result in a valid document path, but '" + h + "' is not because it contains an odd number of segments.");
17508
17508
  var f = new Pt(h);
17509
- a.push(jt(e, f));
17509
+ u.push(jt(e, f));
17510
17510
  } else {
17511
- var l = uc(n, r, c);
17512
- a.push(l);
17511
+ var l = ac(n, r, c);
17512
+ u.push(l);
17513
17513
  }
17514
17514
  }
17515
- return new le(a, o);
17515
+ return new le(u, o);
17516
17516
  }(t._query, t.firestore._databaseId, i, e, n, r);
17517
17517
  }
17518
17518
 
@@ -17524,8 +17524,8 @@ function Gc(t, e, n) {
17524
17524
  if (!Pt.isDocumentKey(r)) throw new Y(H.INVALID_ARGUMENT, "Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '" + r + "' is not because it has an odd number of segments (" + r.length + ").");
17525
17525
  return jt(t, new Pt(r));
17526
17526
  }
17527
- if (n instanceof du) return jt(t, n._key);
17528
- throw new Y(H.INVALID_ARGUMENT, "Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: " + au(n) + ".");
17527
+ if (n instanceof da) return jt(t, n._key);
17528
+ throw new Y(H.INVALID_ARGUMENT, "Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: " + ua(n) + ".");
17529
17529
  }
17530
17530
 
17531
17531
  /**
@@ -17607,7 +17607,7 @@ function Qc(t, e, n) {
17607
17607
  r[t] = n.convertValue(i, e);
17608
17608
  })), r;
17609
17609
  }, t.prototype.convertGeoPoint = function(t) {
17610
- return new zu(At(t.latitude), At(t.longitude));
17610
+ return new za(At(t.latitude), At(t.longitude));
17611
17611
  }, t.prototype.convertArray = function(t, e) {
17612
17612
  var n = this;
17613
17613
  return (t.values || []).map((function(t) {
@@ -17631,7 +17631,7 @@ function Qc(t, e, n) {
17631
17631
  }, t.prototype.convertDocumentKey = function(t, e) {
17632
17632
  var n = gt.fromString(t);
17633
17633
  z(br(n));
17634
- var r = new eu(n.get(1), n.get(3)), i = new Pt(n.popFirst(5));
17634
+ var r = new ea(n.get(1), n.get(3)), i = new Pt(n.popFirst(5));
17635
17635
  return r.isEqual(e) ||
17636
17636
  // TODO(b/64130202): Somehow support foreign references.
17637
17637
  B("Document " + i + " contains a document reference within a different database (" + r.projectId + "/" + r.database + ") which is not supported. It will be treated as a reference in the current database (" + e.projectId + "/" + e.database + ") instead."),
@@ -17676,20 +17676,20 @@ var Yc = /** @class */ function(e) {
17676
17676
  return (n = e.call(this) || this).firestore = t, n;
17677
17677
  }
17678
17678
  return t(n, e), n.prototype.convertBytes = function(t) {
17679
- return new Ku(t);
17679
+ return new Ka(t);
17680
17680
  }, n.prototype.convertReference = function(t) {
17681
17681
  var e = this.convertDocumentKey(t, this.firestore._databaseId);
17682
- return new du(this.firestore, /* converter= */ null, e);
17682
+ return new da(this.firestore, /* converter= */ null, e);
17683
17683
  }, n;
17684
17684
  }(Wc), Jc = /** @class */ function() {
17685
17685
  /** @hideconstructor */
17686
17686
  function t(t, e) {
17687
17687
  this._firestore = t, this._commitHandler = e, this._mutations = [], this._committed = !1,
17688
- this._dataReader = $u(t);
17688
+ this._dataReader = $a(t);
17689
17689
  }
17690
17690
  return t.prototype.set = function(t, e, n) {
17691
17691
  this._verifyNotCommitted();
17692
- var r = Xc(t, this._firestore), i = Hc(r.converter, e, n), o = Zu(this._dataReader, "WriteBatch.set", r._key, i, null !== r.converter, n);
17692
+ var r = Xc(t, this._firestore), i = Hc(r.converter, e, n), o = Za(this._dataReader, "WriteBatch.set", r._key, i, null !== r.converter, n);
17693
17693
  return this._mutations.push(o.toMutation(r._key, $e.none())), this;
17694
17694
  }, t.prototype.update = function(t, e, n) {
17695
17695
  for (var r = [], i = 3; i < arguments.length; i++) r[i - 3] = arguments[i];
@@ -17697,7 +17697,7 @@ var Yc = /** @class */ function(e) {
17697
17697
  var o, s = Xc(t, this._firestore);
17698
17698
  // For Compat types, we have to "extract" the underlying types before
17699
17699
  // performing validation.
17700
- return o = "string" == typeof (e = I(e)) || e instanceof Bu ? ac(this._dataReader, "WriteBatch.update", s._key, e, n, r) : sc(this._dataReader, "WriteBatch.update", s._key, e),
17700
+ return o = "string" == typeof (e = I(e)) || e instanceof Ba ? uc(this._dataReader, "WriteBatch.update", s._key, e, n, r) : sc(this._dataReader, "WriteBatch.update", s._key, e),
17701
17701
  this._mutations.push(o.toMutation(s._key, $e.exists(!0))), this;
17702
17702
  },
17703
17703
  /**
@@ -17811,9 +17811,9 @@ var Yc = /** @class */ function(e) {
17811
17811
  * @returns A Promise resolved with a `DocumentSnapshot` containing the
17812
17812
  * current document contents.
17813
17813
  */ function $c(t) {
17814
- t = uu(t, du);
17815
- var e = uu(t.firestore, _u);
17816
- return $a(Du(e), t._key).then((function(n) {
17814
+ t = aa(t, da);
17815
+ var e = aa(t.firestore, _a);
17816
+ return $u(Da(e), t._key).then((function(n) {
17817
17817
  return lh(e, t, n);
17818
17818
  }));
17819
17819
  }
@@ -17824,10 +17824,10 @@ var Zc = /** @class */ function(e) {
17824
17824
  return (n = e.call(this) || this).firestore = t, n;
17825
17825
  }
17826
17826
  return t(n, e), n.prototype.convertBytes = function(t) {
17827
- return new Ku(t);
17827
+ return new Ka(t);
17828
17828
  }, n.prototype.convertReference = function(t) {
17829
17829
  var e = this.convertDocumentKey(t, this.firestore._databaseId);
17830
- return new du(this.firestore, /* converter= */ null, e);
17830
+ return new da(this.firestore, /* converter= */ null, e);
17831
17831
  }, n;
17832
17832
  }(Wc);
17833
17833
 
@@ -17838,8 +17838,8 @@ var Zc = /** @class */ function(e) {
17838
17838
  * @returns A `Promise` resolved with a `DocumentSnapshot` containing the
17839
17839
  * current document contents.
17840
17840
  */ function th(t) {
17841
- t = uu(t, du);
17842
- var e = uu(t.firestore, _u), i = Du(e), o = new Zc(e);
17841
+ t = aa(t, da);
17842
+ var e = aa(t.firestore, _a), i = Da(e), o = new Zc(e);
17843
17843
  return function(t, e) {
17844
17844
  var i = this, o = new J;
17845
17845
  return t.asyncQueue.enqueueAndForget((function() {
@@ -17874,7 +17874,7 @@ var Zc = /** @class */ function(e) {
17874
17874
  }
17875
17875
  }));
17876
17876
  }));
17877
- }, [ 4 /*yield*/ , Ha(t) ];
17877
+ }, [ 4 /*yield*/ , Hu(t) ];
17878
17878
 
17879
17879
  case 1:
17880
17880
  return [ 2 /*return*/ , i.apply(void 0, [ s.sent(), e, o ]) ];
@@ -17895,9 +17895,9 @@ var Zc = /** @class */ function(e) {
17895
17895
  * @returns A `Promise` resolved with a `DocumentSnapshot` containing the
17896
17896
  * current document contents.
17897
17897
  */ function eh(t) {
17898
- t = uu(t, du);
17899
- var e = uu(t.firestore, _u);
17900
- return $a(Du(e), t._key, {
17898
+ t = aa(t, da);
17899
+ var e = aa(t.firestore, _a);
17900
+ return $u(Da(e), t._key, {
17901
17901
  source: "server"
17902
17902
  }).then((function(n) {
17903
17903
  return lh(e, t, n);
@@ -17914,9 +17914,9 @@ var Zc = /** @class */ function(e) {
17914
17914
  *
17915
17915
  * @returns A `Promise` that will be resolved with the results of the query.
17916
17916
  */ function nh(t) {
17917
- t = uu(t, pu);
17918
- var e = uu(t.firestore, _u), n = Du(e), r = new Zc(e);
17919
- return kc(t._query), Za(n, t._query).then((function(n) {
17917
+ t = aa(t, pa);
17918
+ var e = aa(t.firestore, _a), n = Da(e), r = new Zc(e);
17919
+ return kc(t._query), Zu(n, t._query).then((function(n) {
17920
17920
  return new Sc(e, r, t, n);
17921
17921
  }))
17922
17922
  /**
@@ -17928,8 +17928,8 @@ var Zc = /** @class */ function(e) {
17928
17928
  }
17929
17929
 
17930
17930
  function rh(t) {
17931
- t = uu(t, pu);
17932
- var e = uu(t.firestore, _u), i = Du(e), o = new Zc(e);
17931
+ t = aa(t, pa);
17932
+ var e = aa(t.firestore, _a), i = Da(e), o = new Zc(e);
17933
17933
  return function(t, e) {
17934
17934
  var i = this, o = new J;
17935
17935
  return t.asyncQueue.enqueueAndForget((function() {
@@ -17940,7 +17940,7 @@ function rh(t) {
17940
17940
  case 0:
17941
17941
  return i = function(t, e, i) {
17942
17942
  return n(this, void 0, void 0, (function() {
17943
- var n, o, s, a, u, c;
17943
+ var n, o, s, u, a, c;
17944
17944
  return r(this, (function(r) {
17945
17945
  switch (r.label) {
17946
17946
  case 0:
@@ -17948,11 +17948,11 @@ function rh(t) {
17948
17948
  /* usePreviousResults= */ !0) ];
17949
17949
 
17950
17950
  case 1:
17951
- return n = r.sent(), o = new Xs(e, n.zn), s = o.Po(n.documents), a = o.applyChanges(s,
17952
- /* updateLimboDocuments= */ !1), i.resolve(a.snapshot), [ 3 /*break*/ , 3 ];
17951
+ return n = r.sent(), o = new Xs(e, n.zn), s = o.Po(n.documents), u = o.applyChanges(s,
17952
+ /* updateLimboDocuments= */ !1), i.resolve(u.snapshot), [ 3 /*break*/ , 3 ];
17953
17953
 
17954
17954
  case 2:
17955
- return u = r.sent(), c = Ls(u, "Failed to execute query '" + e + " against cache"),
17955
+ return a = r.sent(), c = Ls(a, "Failed to execute query '" + e + " against cache"),
17956
17956
  i.reject(c), [ 3 /*break*/ , 3 ];
17957
17957
 
17958
17958
  case 3:
@@ -17960,7 +17960,7 @@ function rh(t) {
17960
17960
  }
17961
17961
  }));
17962
17962
  }));
17963
- }, [ 4 /*yield*/ , Ha(t) ];
17963
+ }, [ 4 /*yield*/ , Hu(t) ];
17964
17964
 
17965
17965
  case 1:
17966
17966
  return [ 2 /*return*/ , i.apply(void 0, [ s.sent(), e, o ]) ];
@@ -17979,9 +17979,9 @@ function rh(t) {
17979
17979
  *
17980
17980
  * @returns A `Promise` that will be resolved with the results of the query.
17981
17981
  */ function ih(t) {
17982
- t = uu(t, pu);
17983
- var e = uu(t.firestore, _u), n = Du(e), r = new Zc(e);
17984
- return Za(n, t._query, {
17982
+ t = aa(t, pa);
17983
+ var e = aa(t.firestore, _a), n = Da(e), r = new Zc(e);
17984
+ return Zu(n, t._query, {
17985
17985
  source: "server"
17986
17986
  }).then((function(n) {
17987
17987
  return new Sc(e, r, t, n);
@@ -17989,19 +17989,19 @@ function rh(t) {
17989
17989
  }
17990
17990
 
17991
17991
  function oh(t, e, n) {
17992
- t = uu(t, du);
17993
- var r = uu(t.firestore, _u), i = Hc(t.converter, e, n);
17994
- return fh(r, [ Zu($u(r), "setDoc", t._key, i, null !== t.converter, n).toMutation(t._key, $e.none()) ]);
17992
+ t = aa(t, da);
17993
+ var r = aa(t.firestore, _a), i = Hc(t.converter, e, n);
17994
+ return fh(r, [ Za($a(r), "setDoc", t._key, i, null !== t.converter, n).toMutation(t._key, $e.none()) ]);
17995
17995
  }
17996
17996
 
17997
17997
  function sh(t, e, n) {
17998
17998
  for (var r = [], i = 3; i < arguments.length; i++) r[i - 3] = arguments[i];
17999
- t = uu(t, du);
18000
- var o = uu(t.firestore, _u), s = $u(o);
17999
+ t = aa(t, da);
18000
+ var o = aa(t.firestore, _a), s = $a(o);
18001
18001
  return fh(o, [ ("string" == typeof (
18002
18002
  // For Compat types, we have to "extract" the underlying types before
18003
18003
  // performing validation.
18004
- e = I(e)) || e instanceof Bu ? ac(s, "updateDoc", t._key, e, n, r) : sc(s, "updateDoc", t._key, e)).toMutation(t._key, $e.exists(!0)) ]);
18004
+ e = I(e)) || e instanceof Ba ? uc(s, "updateDoc", t._key, e, n, r) : sc(s, "updateDoc", t._key, e)).toMutation(t._key, $e.exists(!0)) ]);
18005
18005
  }
18006
18006
 
18007
18007
  /**
@@ -18010,8 +18010,8 @@ function sh(t, e, n) {
18010
18010
  * @param reference - A reference to the document to delete.
18011
18011
  * @returns A Promise resolved once the document has been successfully
18012
18012
  * deleted from the backend (note that it won't resolve while you're offline).
18013
- */ function ah(t) {
18014
- return fh(uu(t.firestore, _u), [ new pn(t._key, $e.none()) ]);
18013
+ */ function uh(t) {
18014
+ return fh(aa(t.firestore, _a), [ new pn(t._key, $e.none()) ]);
18015
18015
  }
18016
18016
 
18017
18017
  /**
@@ -18023,37 +18023,37 @@ function sh(t, e, n) {
18023
18023
  * @returns A `Promise` resolved with a `DocumentReference` pointing to the
18024
18024
  * newly created document after it has been written to the backend (Note that it
18025
18025
  * won't resolve while you're offline).
18026
- */ function uh(t, e) {
18027
- var n = uu(t.firestore, _u), r = gu(t), i = Hc(t.converter, e);
18028
- return fh(n, [ Zu($u(t.firestore), "addDoc", r._key, i, null !== t.converter, {}).toMutation(r._key, $e.exists(!1)) ]).then((function() {
18026
+ */ function ah(t, e) {
18027
+ var n = aa(t.firestore, _a), r = ga(t), i = Hc(t.converter, e);
18028
+ return fh(n, [ Za($a(t.firestore), "addDoc", r._key, i, null !== t.converter, {}).toMutation(r._key, $e.exists(!1)) ]).then((function() {
18029
18029
  return r;
18030
18030
  }));
18031
18031
  }
18032
18032
 
18033
18033
  function ch(t) {
18034
- for (var e, i, o, s = [], a = 1; a < arguments.length; a++) s[a - 1] = arguments[a];
18034
+ for (var e, i, o, s = [], u = 1; u < arguments.length; u++) s[u - 1] = arguments[u];
18035
18035
  t = I(t);
18036
- var u = {
18036
+ var a = {
18037
18037
  includeMetadataChanges: !1
18038
18038
  }, c = 0;
18039
- "object" != typeof s[c] || Tu(s[c]) || (u = s[c], c++);
18039
+ "object" != typeof s[c] || Ta(s[c]) || (a = s[c], c++);
18040
18040
  var h, f, l, d = {
18041
- includeMetadataChanges: u.includeMetadataChanges
18041
+ includeMetadataChanges: a.includeMetadataChanges
18042
18042
  };
18043
- if (Tu(s[c])) {
18043
+ if (Ta(s[c])) {
18044
18044
  var p = s[c];
18045
18045
  s[c] = null === (e = p.next) || void 0 === e ? void 0 : e.bind(p), s[c + 1] = null === (i = p.error) || void 0 === i ? void 0 : i.bind(p),
18046
18046
  s[c + 2] = null === (o = p.complete) || void 0 === o ? void 0 : o.bind(p);
18047
18047
  }
18048
- if (t instanceof du) f = uu(t.firestore, _u), l = be(t._key.path), h = {
18048
+ if (t instanceof da) f = aa(t.firestore, _a), l = be(t._key.path), h = {
18049
18049
  next: function(e) {
18050
18050
  s[c] && s[c](lh(f, t, e));
18051
18051
  },
18052
18052
  error: s[c + 1],
18053
18053
  complete: s[c + 2]
18054
18054
  }; else {
18055
- var y = uu(t, pu);
18056
- f = uu(y.firestore, _u), l = y._query;
18055
+ var y = aa(t, pa);
18056
+ f = aa(y.firestore, _a), l = y._query;
18057
18057
  var v = new Zc(f);
18058
18058
  h = {
18059
18059
  next: function(t) {
@@ -18064,42 +18064,42 @@ function ch(t) {
18064
18064
  }, kc(t._query);
18065
18065
  }
18066
18066
  return function(t, e, i, o) {
18067
- var s = this, a = new Va(o), u = new Gs(e, a, i);
18067
+ var s = this, u = new Vu(o), a = new Gs(e, u, i);
18068
18068
  return t.asyncQueue.enqueueAndForget((function() {
18069
18069
  return n(s, void 0, void 0, (function() {
18070
18070
  var e;
18071
18071
  return r(this, (function(n) {
18072
18072
  switch (n.label) {
18073
18073
  case 0:
18074
- return e = qs, [ 4 /*yield*/ , Xa(t) ];
18074
+ return e = qs, [ 4 /*yield*/ , Xu(t) ];
18075
18075
 
18076
18076
  case 1:
18077
- return [ 2 /*return*/ , e.apply(void 0, [ n.sent(), u ]) ];
18077
+ return [ 2 /*return*/ , e.apply(void 0, [ n.sent(), a ]) ];
18078
18078
  }
18079
18079
  }));
18080
18080
  }));
18081
18081
  })), function() {
18082
- a.nc(), t.asyncQueue.enqueueAndForget((function() {
18082
+ u.nc(), t.asyncQueue.enqueueAndForget((function() {
18083
18083
  return n(s, void 0, void 0, (function() {
18084
18084
  var e;
18085
18085
  return r(this, (function(n) {
18086
18086
  switch (n.label) {
18087
18087
  case 0:
18088
- return e = Us, [ 4 /*yield*/ , Xa(t) ];
18088
+ return e = Us, [ 4 /*yield*/ , Xu(t) ];
18089
18089
 
18090
18090
  case 1:
18091
- return [ 2 /*return*/ , e.apply(void 0, [ n.sent(), u ]) ];
18091
+ return [ 2 /*return*/ , e.apply(void 0, [ n.sent(), a ]) ];
18092
18092
  }
18093
18093
  }));
18094
18094
  }));
18095
18095
  }));
18096
18096
  };
18097
- }(Du(f), l, d, h);
18097
+ }(Da(f), l, d, h);
18098
18098
  }
18099
18099
 
18100
18100
  function hh(t, e) {
18101
18101
  return function(t, e) {
18102
- var i = this, o = new Va(e);
18102
+ var i = this, o = new Vu(e);
18103
18103
  return t.asyncQueue.enqueueAndForget((function() {
18104
18104
  return n(i, void 0, void 0, (function() {
18105
18105
  var e;
@@ -18111,7 +18111,7 @@ function hh(t, e) {
18111
18111
  // Immediately fire an initial event, indicating all existing listeners
18112
18112
  // are in-sync.
18113
18113
  e.next();
18114
- }, [ 4 /*yield*/ , Xa(t) ];
18114
+ }, [ 4 /*yield*/ , Xu(t) ];
18115
18115
 
18116
18116
  case 1:
18117
18117
  return [ 2 /*return*/ , e.apply(void 0, [ n.sent(), o ]) ];
@@ -18127,7 +18127,7 @@ function hh(t, e) {
18127
18127
  case 0:
18128
18128
  return e = function(t, e) {
18129
18129
  W(t).io.delete(e);
18130
- }, [ 4 /*yield*/ , Xa(t) ];
18130
+ }, [ 4 /*yield*/ , Xu(t) ];
18131
18131
 
18132
18132
  case 1:
18133
18133
  return [ 2 /*return*/ , e.apply(void 0, [ n.sent(), o ]) ];
@@ -18151,7 +18151,7 @@ function hh(t, e) {
18151
18151
  * been committed. For this reason, it is required that all reads are
18152
18152
  * performed before any writes. Transactions must be performed while online.
18153
18153
  */;
18154
- }(Du(t = uu(t, _u)), Tu(e) ? e : {
18154
+ }(Da(t = aa(t, _a)), Ta(e) ? e : {
18155
18155
  next: e
18156
18156
  });
18157
18157
  }
@@ -18168,7 +18168,7 @@ function hh(t, e) {
18168
18168
  return r(this, (function(r) {
18169
18169
  switch (r.label) {
18170
18170
  case 0:
18171
- return n = ia, [ 4 /*yield*/ , Ja(t) ];
18171
+ return n = iu, [ 4 /*yield*/ , Ju(t) ];
18172
18172
 
18173
18173
  case 1:
18174
18174
  return [ 2 /*return*/ , n.apply(void 0, [ r.sent(), e, o ]) ];
@@ -18176,7 +18176,7 @@ function hh(t, e) {
18176
18176
  }));
18177
18177
  }));
18178
18178
  })), o.promise;
18179
- }(Du(t), e);
18179
+ }(Da(t), e);
18180
18180
  }
18181
18181
 
18182
18182
  /**
@@ -18233,7 +18233,7 @@ function hh(t, e) {
18233
18233
  }(/** @class */ function() {
18234
18234
  /** @hideconstructor */
18235
18235
  function t(t, e) {
18236
- this._firestore = t, this._transaction = e, this._dataReader = $u(t)
18236
+ this._firestore = t, this._transaction = e, this._dataReader = $a(t)
18237
18237
  /**
18238
18238
  * Reads the document referenced by the provided {@link DocumentReference}.
18239
18239
  *
@@ -18251,14 +18251,14 @@ function hh(t, e) {
18251
18251
  throw G();
18252
18252
  }));
18253
18253
  }, t.prototype.set = function(t, e, n) {
18254
- var r = Xc(t, this._firestore), i = Hc(r.converter, e, n), o = Zu(this._dataReader, "Transaction.set", r._key, i, null !== r.converter, n);
18254
+ var r = Xc(t, this._firestore), i = Hc(r.converter, e, n), o = Za(this._dataReader, "Transaction.set", r._key, i, null !== r.converter, n);
18255
18255
  return this._transaction.set(r._key, o), this;
18256
18256
  }, t.prototype.update = function(t, e, n) {
18257
18257
  for (var r = [], i = 3; i < arguments.length; i++) r[i - 3] = arguments[i];
18258
18258
  var o, s = Xc(t, this._firestore);
18259
18259
  // For Compat types, we have to "extract" the underlying types before
18260
18260
  // performing validation.
18261
- return o = "string" == typeof (e = I(e)) || e instanceof Bu ? ac(this._dataReader, "Transaction.update", s._key, e, n, r) : sc(this._dataReader, "Transaction.update", s._key, e),
18261
+ return o = "string" == typeof (e = I(e)) || e instanceof Ba ? uc(this._dataReader, "Transaction.update", s._key, e, n, r) : sc(this._dataReader, "Transaction.update", s._key, e),
18262
18262
  this._transaction.update(s._key, o), this;
18263
18263
  },
18264
18264
  /**
@@ -18299,18 +18299,18 @@ function hh(t, e) {
18299
18299
  switch (r.label) {
18300
18300
  case 0:
18301
18301
  return [ 4 /*yield*/ , function(t) {
18302
- return Qa(t).then((function(t) {
18302
+ return Qu(t).then((function(t) {
18303
18303
  return t.datastore;
18304
18304
  }));
18305
18305
  }(t) ];
18306
18306
 
18307
18307
  case 1:
18308
- return n = r.sent(), new Ba(t.asyncQueue, n, e, o).run(), [ 2 /*return*/ ];
18308
+ return n = r.sent(), new Bu(t.asyncQueue, n, e, o).run(), [ 2 /*return*/ ];
18309
18309
  }
18310
18310
  }));
18311
18311
  }));
18312
18312
  })), o.promise;
18313
- }(Du(t = uu(t, _u)), (function(n) {
18313
+ }(Da(t = aa(t, _a)), (function(n) {
18314
18314
  return e(new dh(t, n));
18315
18315
  }));
18316
18316
  }
@@ -18429,7 +18429,7 @@ function hh(t, e) {
18429
18429
  * @returns A {@link WriteBatch} that can be used to atomically execute multiple
18430
18430
  * writes.
18431
18431
  */ function bh(t) {
18432
- return Du(t = uu(t, _u)), new Jc(t, (function(e) {
18432
+ return Da(t = aa(t, _a)), new Jc(t, (function(e) {
18433
18433
  return fh(t, e);
18434
18434
  }))
18435
18435
  /**
@@ -18548,7 +18548,7 @@ e) {
18548
18548
  * limitations under the License.
18549
18549
  */
18550
18550
  function Ah(t, e) {
18551
- Du(t = uu(t, _u));
18551
+ Da(t = aa(t, _a));
18552
18552
  var n = "string" == typeof e ? function(t) {
18553
18553
  try {
18554
18554
  return JSON.parse(t);
@@ -18559,12 +18559,12 @@ function Ah(t, e) {
18559
18559
  // PORTING NOTE: We don't return an error if the user has not enabled
18560
18560
  // persistence since `enableIndexeddbPersistence()` can fail on the Web.
18561
18561
  if (Array.isArray(n.indexes)) for (var i = 0, o = n.indexes; i < o.length; i++) {
18562
- var s = o[i], a = kh(s, "collectionGroup"), u = [];
18562
+ var s = o[i], u = kh(s, "collectionGroup"), a = [];
18563
18563
  if (Array.isArray(s.fields)) for (var c = 0, h = s.fields; c < h.length; c++) {
18564
18564
  var f = h[c], l = yc("setIndexConfiguration", kh(f, "fieldPath"));
18565
- "CONTAINS" === f.arrayConfig ? u.push(new Eh(l, 2 /* CONTAINS */)) : "ASCENDING" === f.order ? u.push(new Eh(l, 0 /* ASCENDING */)) : "DESCENDING" === f.order && u.push(new Eh(l, 1 /* DESCENDING */));
18565
+ "CONTAINS" === f.arrayConfig ? a.push(new Eh(l, 2 /* CONTAINS */)) : "ASCENDING" === f.order ? a.push(new Eh(l, 0 /* ASCENDING */)) : "DESCENDING" === f.order && a.push(new Eh(l, 1 /* DESCENDING */));
18566
18566
  }
18567
- r.push(new Ih(Ih.ia, a, u, Sh.empty()));
18567
+ r.push(new Ih(Ih.ia, u, a, Sh.empty()));
18568
18568
  }
18569
18569
  // TODO(indexing): Configure indexes
18570
18570
  return Promise.resolve();
@@ -18580,13 +18580,13 @@ function kh(t, e) {
18580
18580
  *
18581
18581
  * @packageDocumentation
18582
18582
  */ void 0 === Th && (Th = !0), M = i, o(new c("firestore", (function(t, e) {
18583
- var n = e.options, r = t.getProvider("app").getImmediate(), i = new _u(r, new tt(t.getProvider("auth-internal")), new it(t.getProvider("app-check-internal")));
18583
+ var n = e.options, r = t.getProvider("app").getImmediate(), i = new _a(r, new tt(t.getProvider("auth-internal")), new it(t.getProvider("app-check-internal")));
18584
18584
  return n = Object.assign({
18585
18585
  useFetchStreams: Th
18586
18586
  }, n), i._setSettings(n), i;
18587
- }), "PUBLIC")), s(P, "3.4.4-canary.aaeab08ac", void 0),
18587
+ }), "PUBLIC")), s(P, "3.4.4-canary.dd86989b3", void 0),
18588
18588
  // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation
18589
- s(P, "3.4.4-canary.aaeab08ac", "esm5");
18589
+ s(P, "3.4.4-canary.dd86989b3", "esm5");
18590
18590
 
18591
- export { Wc as AbstractUserDataWriter, Ku as Bytes, Su as CACHE_SIZE_UNLIMITED, yu as CollectionReference, du as DocumentReference, Tc as DocumentSnapshot, Bu as FieldPath, Gu as FieldValue, _u as Firestore, Y as FirestoreError, zu as GeoPoint, Eu as LoadBundleTask, pu as Query, Dc as QueryConstraint, Ec as QueryDocumentSnapshot, Sc as QuerySnapshot, Ic as SnapshotMetadata, lt as Timestamp, dh as Transaction, Jc as WriteBatch, eu as _DatabaseId, Pt as _DocumentKey, ot as _EmptyAppCheckTokenProvider, $ as _EmptyAuthCredentialsProvider, bt as _FieldPath, uu as _cast, Q as _debugAssert, Tt as _isBase64Available, j as _logWarn, Ah as _setIndexConfiguration, iu as _validateIsNotUsedTogether, uh as addDoc, gh as arrayRemove, mh as arrayUnion, Lu as clearIndexedDbPersistence, vu as collection, mu as collectionGroup, lu as connectFirestoreEmulator, ah as deleteDoc, yh as deleteField, Mu as disableNetwork, gu as doc, ju as documentId, Cu as enableIndexedDbPersistence, xu as enableMultiTabIndexedDbPersistence, Ou as enableNetwork, jc as endAt, Bc as endBefore, Du as ensureFirestoreConfigured, fh as executeWrite, $c as getDoc, th as getDocFromCache, eh as getDocFromServer, nh as getDocs, rh as getDocsFromCache, ih as getDocsFromServer, ku as getFirestore, wh as increment, Au as initializeFirestore, Oc as limit, Mc as limitToLast, Vu as loadBundle, qu as namedQuery, ch as onSnapshot, hh as onSnapshotsInSync, Lc as orderBy, Nc as query, bu as queryEqual, wu as refEqual, ph as runTransaction, vh as serverTimestamp, oh as setDoc, q as setLogLevel, Ac as snapshotEqual, qc as startAfter, Vc as startAt, Fu as terminate, sh as updateDoc, Pu as waitForPendingWrites, xc as where, bh as writeBatch };
18591
+ export { Wc as AbstractUserDataWriter, Ka as Bytes, Sa as CACHE_SIZE_UNLIMITED, ya as CollectionReference, da as DocumentReference, Tc as DocumentSnapshot, Ba as FieldPath, Ga as FieldValue, _a as Firestore, Y as FirestoreError, za as GeoPoint, Ea as LoadBundleTask, pa as Query, Dc as QueryConstraint, Ec as QueryDocumentSnapshot, Sc as QuerySnapshot, Ic as SnapshotMetadata, lt as Timestamp, dh as Transaction, Jc as WriteBatch, ea as _DatabaseId, Pt as _DocumentKey, ot as _EmptyAppCheckTokenProvider, $ as _EmptyAuthCredentialsProvider, bt as _FieldPath, aa as _cast, Q as _debugAssert, Tt as _isBase64Available, j as _logWarn, Ah as _setIndexConfiguration, ia as _validateIsNotUsedTogether, ah as addDoc, gh as arrayRemove, mh as arrayUnion, La as clearIndexedDbPersistence, va as collection, ma as collectionGroup, la as connectFirestoreEmulator, uh as deleteDoc, yh as deleteField, Ma as disableNetwork, ga as doc, ja as documentId, Ca as enableIndexedDbPersistence, xa as enableMultiTabIndexedDbPersistence, Oa as enableNetwork, jc as endAt, Bc as endBefore, Da as ensureFirestoreConfigured, fh as executeWrite, $c as getDoc, th as getDocFromCache, eh as getDocFromServer, nh as getDocs, rh as getDocsFromCache, ih as getDocsFromServer, ka as getFirestore, wh as increment, Aa as initializeFirestore, Oc as limit, Mc as limitToLast, Va as loadBundle, qa as namedQuery, ch as onSnapshot, hh as onSnapshotsInSync, Lc as orderBy, Nc as query, ba as queryEqual, wa as refEqual, ph as runTransaction, vh as serverTimestamp, oh as setDoc, q as setLogLevel, Ac as snapshotEqual, qc as startAfter, Vc as startAt, Fa as terminate, sh as updateDoc, Pa as waitForPendingWrites, xc as where, bh as writeBatch };
18592
18592
  //# sourceMappingURL=index.esm5.js.map