@firebase/firestore 3.8.1 → 3.8.2-20230201003102

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/firestore/src/local/remote_document_cache.d.ts +5 -5
  3. package/dist/firestore/test/unit/local/test_remote_document_cache.d.ts +3 -3
  4. package/dist/index.cjs.js +20635 -0
  5. package/dist/index.cjs.js.map +1 -0
  6. package/dist/index.esm2017.js +29 -27
  7. package/dist/index.esm2017.js.map +1 -1
  8. package/dist/index.esm5.js +140 -138
  9. package/dist/index.esm5.js.map +1 -1
  10. package/dist/index.node.cjs.js +22 -12
  11. package/dist/index.node.cjs.js.map +1 -1
  12. package/dist/index.node.mjs +22 -12
  13. package/dist/index.node.mjs.map +1 -1
  14. package/dist/index.rn.js +29 -27
  15. package/dist/index.rn.js.map +1 -1
  16. package/dist/internal.d.ts +3 -3
  17. package/dist/lite/firestore/src/local/remote_document_cache.d.ts +5 -5
  18. package/dist/lite/firestore/test/unit/local/test_remote_document_cache.d.ts +3 -3
  19. package/dist/lite/index.browser.esm2017.js +2 -2
  20. package/dist/lite/index.browser.esm2017.js.map +1 -1
  21. package/dist/lite/index.browser.esm5.js +2 -2
  22. package/dist/lite/index.browser.esm5.js.map +1 -1
  23. package/dist/lite/index.cjs.js +6954 -0
  24. package/dist/lite/index.cjs.js.map +1 -0
  25. package/dist/lite/index.node.cjs.js +2 -2
  26. package/dist/lite/index.node.mjs +2 -2
  27. package/dist/lite/index.node.mjs.map +1 -1
  28. package/dist/lite/index.rn.esm2017.js +2 -2
  29. package/dist/lite/index.rn.esm2017.js.map +1 -1
  30. package/dist/lite/packages/firestore/src/local/remote_document_cache.d.ts +5 -5
  31. package/dist/lite/packages/firestore/test/unit/local/test_remote_document_cache.d.ts +3 -3
  32. package/dist/packages/firestore/src/local/remote_document_cache.d.ts +5 -5
  33. package/dist/packages/firestore/test/unit/local/test_remote_document_cache.d.ts +3 -3
  34. package/dist/private.d.ts +3 -3
  35. package/package.json +17 -9
@@ -10,7 +10,7 @@ import { FirebaseError as f, getUA as d, isSafari as p, getModularInstance as y,
10
10
 
11
11
  import { XhrIo as b, EventType as I, ErrorCode as T, createWebChannelTransport as E, getStatEventTarget as S, FetchXmlHttpFactory as _, WebChannel as D, Event as x, Stat as A } from "@firebase/webchannel-wrapper";
12
12
 
13
- var C = "@firebase/firestore", N = /** @class */ function() {
13
+ var N = "@firebase/firestore", C = /** @class */ function() {
14
14
  function t(t) {
15
15
  this.uid = t;
16
16
  }
@@ -48,11 +48,11 @@ var C = "@firebase/firestore", N = /** @class */ function() {
48
48
  * Simple wrapper around a nullable UID. Mostly exists to make code more
49
49
  * readable.
50
50
  */
51
- /** A user with a null UID. */ N.UNAUTHENTICATED = new N(null),
51
+ /** A user with a null UID. */ C.UNAUTHENTICATED = new C(null),
52
52
  // TODO(mikelehen): Look into getting a proper uid-equivalent for
53
53
  // non-FirebaseAuth providers.
54
- N.GOOGLE_CREDENTIALS = new N("google-credentials-uid"), N.FIRST_PARTY = new N("first-party-uid"),
55
- N.MOCK_USER = new N("mock-user");
54
+ C.GOOGLE_CREDENTIALS = new C("google-credentials-uid"), C.FIRST_PARTY = new C("first-party-uid"),
55
+ C.MOCK_USER = new C("mock-user");
56
56
 
57
57
  /**
58
58
  * @license
@@ -70,7 +70,7 @@ N.MOCK_USER = new N("mock-user");
70
70
  * See the License for the specific language governing permissions and
71
71
  * limitations under the License.
72
72
  */
73
- var k = "9.16.0", F = new l("@firebase/firestore");
73
+ var k = "9.17.0-20230201003102", F = new l("@firebase/firestore");
74
74
 
75
75
  /**
76
76
  * @license
@@ -391,7 +391,7 @@ e) {
391
391
  }, t.prototype.invalidateToken = function() {}, t.prototype.start = function(t, e) {
392
392
  // Fire with initial user.
393
393
  t.enqueueRetryable((function() {
394
- return e(N.UNAUTHENTICATED);
394
+ return e(C.UNAUTHENTICATED);
395
395
  }));
396
396
  }, t.prototype.shutdown = function() {}, t;
397
397
  }(), H = /** @class */ function() {
@@ -420,7 +420,7 @@ e) {
420
420
  function t(t) {
421
421
  this.t = t,
422
422
  /** Tracks the current User. */
423
- this.currentUser = N.UNAUTHENTICATED,
423
+ this.currentUser = C.UNAUTHENTICATED,
424
424
  /**
425
425
  * Counter used to detect if the token changed while a getToken request was
426
426
  * outstanding.
@@ -497,11 +497,11 @@ e) {
497
497
  // to guarantee to get the actual user.
498
498
  t.prototype.u = function() {
499
499
  var t = this.auth && this.auth.getUid();
500
- return U(null === t || "string" == typeof t), new N(t);
500
+ return U(null === t || "string" == typeof t), new C(t);
501
501
  }, t;
502
502
  }(), X = /** @class */ function() {
503
503
  function t(t, e, n, r) {
504
- this.h = t, this.l = e, this.m = n, this.g = r, this.type = "FirstParty", this.user = N.FIRST_PARTY,
504
+ this.h = t, this.l = e, this.m = n, this.g = r, this.type = "FirstParty", this.user = C.FIRST_PARTY,
505
505
  this.p = new Map
506
506
  /** Gets an authorization token, using a provided factory function, or falling back to First Party GAPI. */;
507
507
  }
@@ -530,7 +530,7 @@ e) {
530
530
  }, t.prototype.start = function(t, e) {
531
531
  // Fire with initial uid.
532
532
  t.enqueueRetryable((function() {
533
- return e(N.FIRST_PARTY);
533
+ return e(C.FIRST_PARTY);
534
534
  }));
535
535
  }, t.prototype.shutdown = function() {}, t.prototype.invalidateToken = function() {},
536
536
  t;
@@ -1460,7 +1460,7 @@ function Dt(t) {
1460
1460
  var e = this.transaction.objectStore(t);
1461
1461
  return new Ot(e);
1462
1462
  }, t;
1463
- }(), Ct = /** @class */ function() {
1463
+ }(), Nt = /** @class */ function() {
1464
1464
  /*
1465
1465
  * Creates a new SimpleDb wrapper for IndexedDb database `name`.
1466
1466
  *
@@ -1642,7 +1642,7 @@ function Dt(t) {
1642
1642
  }, t.prototype.close = function() {
1643
1643
  this.db && this.db.close(), this.db = void 0;
1644
1644
  }, t;
1645
- }(), Nt = /** @class */ function() {
1645
+ }(), Ct = /** @class */ function() {
1646
1646
  function t(t) {
1647
1647
  this.q = t, this.U = !1, this.K = null;
1648
1648
  }
@@ -1854,7 +1854,7 @@ function Dt(t) {
1854
1854
  }, t.onsuccess = function(t) {
1855
1855
  var i = t.target.result;
1856
1856
  if (i) {
1857
- var o = new Nt(i), u = e(i.primaryKey, i.value, o);
1857
+ var o = new Ct(i), u = e(i.primaryKey, i.value, o);
1858
1858
  if (u instanceof xt) {
1859
1859
  var a = u.catch((function(t) {
1860
1860
  return o.done(), xt.reject(t);
@@ -1902,7 +1902,7 @@ function Dt(t) {
1902
1902
  var Vt = !1;
1903
1903
 
1904
1904
  function Mt(t) {
1905
- var e = Ct.D(d());
1905
+ var e = Nt.D(d());
1906
1906
  if (e >= 12.2 && e < 13) {
1907
1907
  var n = "An internal error was encountered in the Indexed Database server";
1908
1908
  if (t.message.indexOf(n) >= 0) {
@@ -2835,7 +2835,7 @@ function _e(t, e, n) {
2835
2835
  }, n.prototype.getFirstInequalityField = function() {
2836
2836
  return this.isInequality() ? this.field : null;
2837
2837
  }, n;
2838
- }(xe), Ce = /** @class */ function(e) {
2838
+ }(xe), Ne = /** @class */ function(e) {
2839
2839
  function n(t, n) {
2840
2840
  var r = this;
2841
2841
  return (r = e.call(this) || this).filters = t, r.op = n, r.ht = null, r;
@@ -2845,7 +2845,7 @@ function _e(t, e, n) {
2845
2845
  */ return t(n, e), n.create = function(t, e) {
2846
2846
  return new n(t, e);
2847
2847
  }, n.prototype.matches = function(t) {
2848
- return Ne(this) ? void 0 === this.filters.find((function(e) {
2848
+ return Ce(this) ? void 0 === this.filters.find((function(e) {
2849
2849
  return !e.matches(t);
2850
2850
  })) : void 0 !== this.filters.find((function(e) {
2851
2851
  return e.matches(t);
@@ -2876,7 +2876,7 @@ function _e(t, e, n) {
2876
2876
  }, n;
2877
2877
  }(xe);
2878
2878
 
2879
- function Ne(t) {
2879
+ function Ce(t) {
2880
2880
  return "and" /* CompositeOperator.AND */ === t.op;
2881
2881
  }
2882
2882
 
@@ -2887,14 +2887,14 @@ function ke(t) {
2887
2887
  /**
2888
2888
  * Returns true if this filter is a conjunction of field filters only. Returns false otherwise.
2889
2889
  */ function Fe(t) {
2890
- return Oe(t) && Ne(t);
2890
+ return Oe(t) && Ce(t);
2891
2891
  }
2892
2892
 
2893
2893
  /**
2894
2894
  * Returns true if this filter does not contain any composite filters. Returns false otherwise.
2895
2895
  */ function Oe(t) {
2896
2896
  for (var e = 0, n = t.filters; e < n.length; e++) {
2897
- if (n[e] instanceof Ce) return !1;
2897
+ if (n[e] instanceof Ne) return !1;
2898
2898
  }
2899
2899
  return !0;
2900
2900
  }
@@ -2925,8 +2925,8 @@ function Re(t) {
2925
2925
  function Ve(t, e) {
2926
2926
  return t instanceof Ae ? function(t, e) {
2927
2927
  return e instanceof Ae && t.op === e.op && t.field.isEqual(e.field) && ue(t.value, e.value);
2928
- }(t, e) : t instanceof Ce ? function(t, e) {
2929
- return e instanceof Ce && t.op === e.op && t.filters.length === e.filters.length && t.filters.reduce((function(t, n, r) {
2928
+ }(t, e) : t instanceof Ne ? function(t, e) {
2929
+ return e instanceof Ne && t.op === e.op && t.filters.length === e.filters.length && t.filters.reduce((function(t, n, r) {
2930
2930
  return t && Ve(n, e.filters[r]);
2931
2931
  }), !0);
2932
2932
  }(t, e) : void q();
@@ -2934,13 +2934,13 @@ function Ve(t, e) {
2934
2934
 
2935
2935
  function Me(t, e) {
2936
2936
  var n = t.filters.concat(e);
2937
- return Ce.create(n, t.op);
2937
+ return Ne.create(n, t.op);
2938
2938
  }
2939
2939
 
2940
2940
  /** Returns a debug description for `filter`. */ function Le(t) {
2941
2941
  return t instanceof Ae ? function(t) {
2942
2942
  return "".concat(t.field.canonicalString(), " ").concat(t.op, " ").concat(le(t.value));
2943
- }(t) : t instanceof Ce ? function(t) {
2943
+ }(t) : t instanceof Ne ? function(t) {
2944
2944
  return t.op.toString() + " {" + t.getFilters().map(Le).join(" ,") + "}";
2945
2945
  }(t) : "Filter";
2946
2946
  }
@@ -4243,10 +4243,10 @@ function An(t) {
4243
4243
  /**
4244
4244
  * Returns a new comparator function that can be used to compare two documents
4245
4245
  * based on the Query's ordering constraint.
4246
- */ function Cn(t) {
4246
+ */ function Nn(t) {
4247
4247
  return function(e, n) {
4248
4248
  for (var r = !1, i = 0, o = bn(t); i < o.length; i++) {
4249
- var u = o[i], a = Nn(u, e, n);
4249
+ var u = o[i], a = Cn(u, e, n);
4250
4250
  if (0 !== a) return a;
4251
4251
  r = r || u.field.isKeyField();
4252
4252
  }
@@ -4254,7 +4254,7 @@ function An(t) {
4254
4254
  };
4255
4255
  }
4256
4256
 
4257
- function Nn(t, e, n) {
4257
+ function Cn(t, e, n) {
4258
4258
  var r = t.field.isKeyField() ? ft.comparator(e.key, n.key) : function(t, e, n) {
4259
4259
  var r = e.data.field(t), i = n.data.field(t);
4260
4260
  return null !== r && null !== i ? se(r, i) : q();
@@ -5164,9 +5164,9 @@ function xr() {
5164
5164
  // PORTING NOTE: Multi-tab only
5165
5165
  return t.createSynthesizedRemoteEventForCurrentChange = function(e, n, r) {
5166
5166
  var i = new Map;
5167
- return i.set(e, Cr.createSynthesizedTargetChangeForCurrentChange(e, n, r)), new t(at.min(), i, xr(), vr(), _r());
5167
+ return i.set(e, Nr.createSynthesizedTargetChangeForCurrentChange(e, n, r)), new t(at.min(), i, xr(), vr(), _r());
5168
5168
  }, t;
5169
- }(), Cr = /** @class */ function() {
5169
+ }(), Nr = /** @class */ function() {
5170
5170
  function t(
5171
5171
  /**
5172
5172
  * An opaque, server-assigned token that allows watching a query to be resumed
@@ -5207,7 +5207,7 @@ function xr() {
5207
5207
  return t.createSynthesizedTargetChangeForCurrentChange = function(e, n, r) {
5208
5208
  return new t(r, n, _r(), _r(), _r());
5209
5209
  }, t;
5210
- }(), Nr = function(
5210
+ }(), Cr = function(
5211
5211
  /** The new document applies to all of these targets. */
5212
5212
  t,
5213
5213
  /** The new document is removed from all of these targets. */
@@ -5325,7 +5325,7 @@ n
5325
5325
  default:
5326
5326
  q();
5327
5327
  }
5328
- })), new Cr(this.bt, this.Pt, t, e, n);
5328
+ })), new Nr(this.bt, this.Pt, t, e, n);
5329
5329
  },
5330
5330
  /**
5331
5331
  * Resets the document changes and sets `hasPendingChanges` to false.
@@ -5850,7 +5850,7 @@ function ii(t, e) {
5850
5850
  collectionId: r.lastSegment()
5851
5851
  } ]);
5852
5852
  var i = function(t) {
5853
- if (0 !== t.length) return fi(Ce.create(t, "and" /* CompositeOperator.AND */));
5853
+ if (0 !== t.length) return fi(Ne.create(t, "and" /* CompositeOperator.AND */));
5854
5854
  }(e.filters);
5855
5855
  i && (n.structuredQuery.where = i);
5856
5856
  var o = function(t) {
@@ -5891,7 +5891,7 @@ function oi(t) {
5891
5891
  var u = [];
5892
5892
  n.where && (u = function(t) {
5893
5893
  var e = ui(t);
5894
- return e instanceof Ce && Fe(e) ? e.getFilters() : [ e ];
5894
+ return e instanceof Ne && Fe(e) ? e.getFilters() : [ e ];
5895
5895
  }(n.where));
5896
5896
  var a = [];
5897
5897
  n.orderBy && (a = n.orderBy.map((function(t) {
@@ -5997,7 +5997,7 @@ function ui(t) {
5997
5997
  }
5998
5998
  }(t.fieldFilter.op), t.fieldFilter.value);
5999
5999
  }(t) : void 0 !== t.compositeFilter ? function(t) {
6000
- return Ce.create(t.compositeFilter.filters.map((function(t) {
6000
+ return Ne.create(t.compositeFilter.filters.map((function(t) {
6001
6001
  return ui(t);
6002
6002
  })), function(t) {
6003
6003
  switch (t) {
@@ -6072,7 +6072,7 @@ function fi(t) {
6072
6072
  value: t.value
6073
6073
  }
6074
6074
  };
6075
- }(t) : t instanceof Ce ? function(t) {
6075
+ }(t) : t instanceof Ne ? function(t) {
6076
6076
  var e = t.getFilters().map((function(t) {
6077
6077
  return fi(t);
6078
6078
  }));
@@ -6246,7 +6246,7 @@ function pi(t) {
6246
6246
  * there is no useful information to store as the value. The raw (unencoded)
6247
6247
  * path cannot be stored because IndexedDb doesn't store prototype
6248
6248
  * information.
6249
- */ var Ti = {}, Ei = [ "prefixPath", "collectionGroup", "readTime", "documentId" ], Si = [ "prefixPath", "collectionGroup", "documentId" ], _i = [ "collectionGroup", "readTime", "prefixPath", "documentId" ], Di = [ "canonicalId", "targetId" ], xi = [ "targetId", "path" ], Ai = [ "path", "targetId" ], Ci = [ "collectionId", "parent" ], Ni = [ "indexId", "uid" ], ki = [ "uid", "sequenceNumber" ], Fi = [ "indexId", "uid", "arrayValue", "directionalValue", "orderedDocumentKey", "documentKey" ], Oi = [ "indexId", "uid", "orderedDocumentKey" ], Ri = [ "userId", "collectionPath", "documentId" ], Vi = [ "userId", "collectionPath", "largestBatchId" ], Mi = [ "userId", "collectionGroup", "largestBatchId" ], Li = r(r([], r(r([], r(r([], r(r([], [ "mutationQueues", "mutations", "documentMutations", "remoteDocuments", "targets", "owner", "targetGlobal", "targetDocuments" ], !1), [ "clientMetadata" ], !1), !0), [ "remoteDocumentGlobal" ], !1), !0), [ "collectionParents" ], !1), !0), [ "bundles", "namedQueries" ], !1), Pi = r(r([], Li, !0), [ "documentOverlays" ], !1), qi = [ "mutationQueues", "mutations", "documentMutations", "remoteDocumentsV14", "targets", "owner", "targetGlobal", "targetDocuments", "clientMetadata", "remoteDocumentGlobal", "collectionParents", "bundles", "namedQueries", "documentOverlays" ], Ui = qi, Bi = r(r([], Ui, !0), [ "indexConfiguration", "indexState", "indexEntries" ], !1), Gi = /** @class */ function(e) {
6249
+ */ var Ti = {}, Ei = [ "prefixPath", "collectionGroup", "readTime", "documentId" ], Si = [ "prefixPath", "collectionGroup", "documentId" ], _i = [ "collectionGroup", "readTime", "prefixPath", "documentId" ], Di = [ "canonicalId", "targetId" ], xi = [ "targetId", "path" ], Ai = [ "path", "targetId" ], Ni = [ "collectionId", "parent" ], Ci = [ "indexId", "uid" ], ki = [ "uid", "sequenceNumber" ], Fi = [ "indexId", "uid", "arrayValue", "directionalValue", "orderedDocumentKey", "documentKey" ], Oi = [ "indexId", "uid", "orderedDocumentKey" ], Ri = [ "userId", "collectionPath", "documentId" ], Vi = [ "userId", "collectionPath", "largestBatchId" ], Mi = [ "userId", "collectionGroup", "largestBatchId" ], Li = r(r([], r(r([], r(r([], r(r([], [ "mutationQueues", "mutations", "documentMutations", "remoteDocuments", "targets", "owner", "targetGlobal", "targetDocuments" ], !1), [ "clientMetadata" ], !1), !0), [ "remoteDocumentGlobal" ], !1), !0), [ "collectionParents" ], !1), !0), [ "bundles", "namedQueries" ], !1), Pi = r(r([], Li, !0), [ "documentOverlays" ], !1), qi = [ "mutationQueues", "mutations", "documentMutations", "remoteDocumentsV14", "targets", "owner", "targetGlobal", "targetDocuments", "clientMetadata", "remoteDocumentGlobal", "collectionParents", "bundles", "namedQueries", "documentOverlays" ], Ui = qi, Bi = r(r([], Ui, !0), [ "indexConfiguration", "indexState", "indexEntries" ], !1), Gi = /** @class */ function(e) {
6250
6250
  function n(t, n) {
6251
6251
  var r = this;
6252
6252
  return (r = e.call(this) || this).se = t, r.currentSequenceNumber = n, r;
@@ -6271,7 +6271,7 @@ function pi(t) {
6271
6271
  * limitations under the License.
6272
6272
  */ function Ki(t, e) {
6273
6273
  var n = G(t);
6274
- return Ct.M(n.se, e);
6274
+ return Nt.M(n.se, e);
6275
6275
  }
6276
6276
 
6277
6277
  /**
@@ -7211,12 +7211,12 @@ function Io(t, e) {
7211
7211
  * input into a disjunction of equality filters and returns the expanded filter.
7212
7212
  */ function Eo(t) {
7213
7213
  var e, n;
7214
- if (U(t instanceof Ae || t instanceof Ce), t instanceof Ae) {
7214
+ if (U(t instanceof Ae || t instanceof Ne), t instanceof Ae) {
7215
7215
  if (t instanceof Ke) {
7216
7216
  var r = (null === (n = null === (e = t.value.arrayValue) || void 0 === e ? void 0 : e.values) || void 0 === n ? void 0 : n.map((function(e) {
7217
7217
  return Ae.create(t.field, "==" /* Operator.EQUAL */ , e);
7218
7218
  }))) || [];
7219
- return Ce.create(r, "or" /* CompositeOperator.OR */);
7219
+ return Ne.create(r, "or" /* CompositeOperator.OR */);
7220
7220
  }
7221
7221
  // We have reached other kinds of field filters.
7222
7222
  return t;
@@ -7225,7 +7225,7 @@ function Io(t, e) {
7225
7225
  var i = t.filters.map((function(t) {
7226
7226
  return Eo(t);
7227
7227
  }));
7228
- return Ce.create(i, t.op);
7228
+ return Ne.create(i, t.op);
7229
7229
  }
7230
7230
 
7231
7231
  /**
@@ -7253,7 +7253,7 @@ function _o(t) {
7253
7253
  * Returns true if the given filter is the conjunction of one or more field filters. e.g. (a == 10
7254
7254
  * && b == 20)
7255
7255
  */ function Do(t) {
7256
- return t instanceof Ce && Fe(t);
7256
+ return t instanceof Ne && Fe(t);
7257
7257
  }
7258
7258
 
7259
7259
  /**
@@ -7270,7 +7270,7 @@ function _o(t) {
7270
7270
  * field filters. e.g. (a == 10) || (b==20 && c==30)
7271
7271
  */
7272
7272
  function(t) {
7273
- if (t instanceof Ce && ke(t)) {
7273
+ if (t instanceof Ne && ke(t)) {
7274
7274
  for (var e = 0, n = t.getFilters(); e < n.length; e++) {
7275
7275
  var r = n[e];
7276
7276
  if (!_o(r) && !Do(r)) return !1;
@@ -7282,55 +7282,55 @@ function _o(t) {
7282
7282
  }
7283
7283
 
7284
7284
  function Ao(t) {
7285
- if (U(t instanceof Ae || t instanceof Ce), t instanceof Ae) return t;
7285
+ if (U(t instanceof Ae || t instanceof Ne), t instanceof Ae) return t;
7286
7286
  if (1 === t.filters.length) return Ao(t.filters[0]);
7287
7287
  // Compute DNF for each of the subfilters first
7288
7288
  var e = t.filters.map((function(t) {
7289
7289
  return Ao(t);
7290
- })), n = Ce.create(e, t.op);
7291
- return xo(n = ko(n)) ? n : (U(n instanceof Ce), U(Ne(n)), U(n.filters.length > 1),
7290
+ })), n = Ne.create(e, t.op);
7291
+ return xo(n = ko(n)) ? n : (U(n instanceof Ne), U(Ce(n)), U(n.filters.length > 1),
7292
7292
  n.filters.reduce((function(t, e) {
7293
- return Co(t, e);
7293
+ return No(t, e);
7294
7294
  })));
7295
7295
  }
7296
7296
 
7297
- function Co(t, e) {
7297
+ function No(t, e) {
7298
7298
  var n;
7299
- return U(t instanceof Ae || t instanceof Ce), U(e instanceof Ae || e instanceof Ce),
7299
+ return U(t instanceof Ae || t instanceof Ne), U(e instanceof Ae || e instanceof Ne),
7300
7300
  // FieldFilter FieldFilter
7301
7301
  n = t instanceof Ae ? e instanceof Ae ? function(t, e) {
7302
7302
  // Conjunction distribution for two field filters is the conjunction of them.
7303
- return Ce.create([ t, e ], "and" /* CompositeOperator.AND */);
7304
- }(t, e) : No(t, e) : e instanceof Ae ? No(e, t) : function(t, e) {
7303
+ return Ne.create([ t, e ], "and" /* CompositeOperator.AND */);
7304
+ }(t, e) : Co(t, e) : e instanceof Ae ? Co(e, t) : function(t, e) {
7305
7305
  // There are four cases:
7306
7306
  // (A & B) & (C & D) --> (A & B & C & D)
7307
7307
  // (A & B) & (C | D) --> (A & B & C) | (A & B & D)
7308
7308
  // (A | B) & (C & D) --> (C & D & A) | (C & D & B)
7309
7309
  // (A | B) & (C | D) --> (A & C) | (A & D) | (B & C) | (B & D)
7310
7310
  // Case 1 is a merge.
7311
- if (U(t.filters.length > 0 && e.filters.length > 0), Ne(t) && Ne(e)) return Me(t, e.getFilters());
7311
+ if (U(t.filters.length > 0 && e.filters.length > 0), Ce(t) && Ce(e)) return Me(t, e.getFilters());
7312
7312
  // Case 2,3,4 all have at least one side (lhs or rhs) that is a disjunction. In all three cases
7313
7313
  // we should take each element of the disjunction and distribute it over the other side, and
7314
7314
  // return the disjunction of the distribution results.
7315
7315
  var n = ke(t) ? t : e, r = ke(t) ? e : t, i = n.filters.map((function(t) {
7316
- return Co(t, r);
7316
+ return No(t, r);
7317
7317
  }));
7318
- return Ce.create(i, "or" /* CompositeOperator.OR */);
7318
+ return Ne.create(i, "or" /* CompositeOperator.OR */);
7319
7319
  }(t, e), ko(n);
7320
7320
  }
7321
7321
 
7322
- function No(t, e) {
7322
+ function Co(t, e) {
7323
7323
  // There are two cases:
7324
7324
  // A & (B & C) --> (A & B & C)
7325
7325
  // A & (B | C) --> (A & B) | (A & C)
7326
- if (Ne(e))
7326
+ if (Ce(e))
7327
7327
  // Case 1
7328
7328
  return Me(e, t.getFilters());
7329
7329
  // Case 2
7330
7330
  var n = e.filters.map((function(e) {
7331
- return Co(t, e);
7331
+ return No(t, e);
7332
7332
  }));
7333
- return Ce.create(n, "or" /* CompositeOperator.OR */);
7333
+ return Ne.create(n, "or" /* CompositeOperator.OR */);
7334
7334
  }
7335
7335
 
7336
7336
  /**
@@ -7343,7 +7343,7 @@ function No(t, e) {
7343
7343
  *
7344
7344
  * <p>For more info, visit: https://en.wikipedia.org/wiki/Associative_property#Propositional_logic
7345
7345
  */ function ko(t) {
7346
- if (U(t instanceof Ae || t instanceof Ce), t instanceof Ae) return t;
7346
+ if (U(t instanceof Ae || t instanceof Ne), t instanceof Ae) return t;
7347
7347
  var e = t.getFilters();
7348
7348
  // If the composite filter only contains 1 filter, apply associativity to it.
7349
7349
  if (1 === e.length) return ko(e[0]);
@@ -7362,7 +7362,7 @@ function No(t, e) {
7362
7362
  // Note that the `compositeSubfilter` has been eliminated, and its filters (B, C, D) have been
7363
7363
  // added to the top-level "compositeFilter".
7364
7364
  return n.forEach((function(e) {
7365
- e instanceof Ae ? r.push(e) : e instanceof Ce && (e.op === t.op ?
7365
+ e instanceof Ae ? r.push(e) : e instanceof Ne && (e.op === t.op ?
7366
7366
  // compositeFilter: (A | (B | C))
7367
7367
  // compositeSubfilter: (B | C)
7368
7368
  // Result: (A | B | C)
@@ -7375,7 +7375,7 @@ function No(t, e) {
7375
7375
  // compositeSubfilter: (B & C)
7376
7376
  // Result: (A | (B & C))
7377
7377
  r.push(e));
7378
- })), 1 === r.length ? r[0] : Ce.create(r, t.op)
7378
+ })), 1 === r.length ? r[0] : Ne.create(r, t.op)
7379
7379
  /**
7380
7380
  * @license
7381
7381
  * Copyright 2019 Google LLC
@@ -7624,7 +7624,7 @@ var Fo = /** @class */ function() {
7624
7624
  }));
7625
7625
  }, t.prototype.Ze = function(t) {
7626
7626
  var e = this.Xe.get(t);
7627
- return e || (e = 0 === t.filters.length ? [ t ] : So(Ce.create(t.filters, "and" /* CompositeOperator.AND */)).map((function(e) {
7627
+ return e || (e = 0 === t.filters.length ? [ t ] : So(Ne.create(t.filters, "and" /* CompositeOperator.AND */)).map((function(e) {
7628
7628
  return un(t.path, t.collectionGroup, t.orderBy, e.getFilters(), t.limit, t.startAt, t.endAt);
7629
7629
  })), this.Xe.set(t, e), e);
7630
7630
  },
@@ -9181,14 +9181,16 @@ function Jo(t) {
9181
9181
  // above won't go through them is when the cache is empty.
9182
9182
  for (;a; ) n(a, null), a = u.hasNext() ? u.getNext() : null;
9183
9183
  }));
9184
- }, t.prototype.getAllFromCollection = function(t, e, n) {
9185
- var r = this, i = [ e.popLast().toArray(), e.lastSegment(), Xi(n.readTime), n.documentKey.path.isEmpty() ? "" : n.documentKey.path.lastSegment() ], o = [ e.popLast().toArray(), e.lastSegment(), [ Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER ], "" ];
9186
- return fu(t).W(IDBKeyRange.bound(i, o, !0)).next((function(t) {
9187
- for (var e = vr(), n = 0, i = t; n < i.length; n++) {
9188
- var o = i[n], u = r.jn(ft.fromSegments(o.prefixPath.concat(o.collectionGroup, o.documentId)), o);
9189
- e = e.insert(u.key, u);
9184
+ }, t.prototype.getDocumentsMatchingQuery = function(t, e, n, r) {
9185
+ var i = this, o = e.path, u = [ o.popLast().toArray(), o.lastSegment(), Xi(n.readTime), n.documentKey.path.isEmpty() ? "" : n.documentKey.path.lastSegment() ], a = [ o.popLast().toArray(), o.lastSegment(), [ Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER ], "" ];
9186
+ return fu(t).W(IDBKeyRange.bound(u, a, !0)).next((function(t) {
9187
+ for (var n = vr(), o = 0, u = t; o < u.length; o++) {
9188
+ var a = u[o], s = i.jn(ft.fromSegments(a.prefixPath.concat(a.collectionGroup, a.documentId)), a);
9189
+ s.isFoundDocument() && (xn(e, s) || r.has(s.key)) && (
9190
+ // Either the document matches the given query, or it is mutated.
9191
+ n = n.insert(s.key, s));
9190
9192
  }
9191
- return e;
9193
+ return n;
9192
9194
  }));
9193
9195
  }, t.prototype.getAllFromCollectionGroup = function(t, e, n, r) {
9194
9196
  var i = this, o = vr(), u = pu(e, n), a = pu(e, Tt.max());
@@ -9695,22 +9697,22 @@ e) {
9695
9697
  }, t.prototype.getDocumentsMatchingCollectionQuery = function(t, e, n) {
9696
9698
  var r, i = this;
9697
9699
  // Query the remote documents and overlay mutations.
9698
- return this.remoteDocumentCache.getAllFromCollection(t, e.path, n).next((function(o) {
9699
- return r = o, i.documentOverlayCache.getOverlaysForCollection(t, e.path, n.largestBatchId);
9700
+ return this.documentOverlayCache.getOverlaysForCollection(t, e.path, n.largestBatchId).next((function(o) {
9701
+ return r = o, i.remoteDocumentCache.getDocumentsMatchingQuery(t, e, n, r);
9700
9702
  })).next((function(t) {
9701
9703
  // As documents might match the query because of their overlay we need to
9702
9704
  // include documents for all overlays in the initial document set.
9703
- t.forEach((function(t, e) {
9704
- var n = e.getKey();
9705
- null === r.get(n) && (r = r.insert(n, rn.newInvalidDocument(n)));
9705
+ r.forEach((function(e, n) {
9706
+ var r = n.getKey();
9707
+ null === t.get(r) && (t = t.insert(r, rn.newInvalidDocument(r)));
9706
9708
  }));
9707
9709
  // Apply the overlays and match against the query.
9708
9710
  var n = gr();
9709
- return r.forEach((function(r, i) {
9710
- var o = t.get(r);
9711
+ return t.forEach((function(t, i) {
9712
+ var o = r.get(t);
9711
9713
  void 0 !== o && $n(o.mutation, i, tn.empty(), ut.now()),
9712
9714
  // Finally, insert the documents that still match the query
9713
- xn(e, i) && (n = n.insert(r, i));
9715
+ xn(e, i) && (n = n.insert(t, i));
9714
9716
  })), n;
9715
9717
  }));
9716
9718
  }, t;
@@ -10050,16 +10052,16 @@ e) {
10050
10052
  var e = n.docs.get(t);
10051
10053
  r = r.insert(t, e ? e.document.mutableCopy() : rn.newInvalidDocument(t));
10052
10054
  })), xt.resolve(r);
10053
- }, t.prototype.getAllFromCollection = function(t, e, n) {
10054
- for (var r = vr(), i = new ft(e.child("")), o = this.docs.getIteratorFrom(i)
10055
+ }, t.prototype.getDocumentsMatchingQuery = function(t, e, n, r) {
10056
+ for (var i = vr(), o = e.path, u = new ft(o.child("")), a = this.docs.getIteratorFrom(u)
10055
10057
  // Documents are ordered by key, so we can use a prefix scan to narrow down
10056
10058
  // the documents we need to match the query against.
10057
- ; o.hasNext(); ) {
10058
- var u = o.getNext(), a = u.key, s = u.value.document;
10059
- if (!e.isPrefixOf(a.path)) break;
10060
- a.path.length > e.length + 1 || Et(It(s), n) <= 0 || (r = r.insert(s.key, s.mutableCopy()));
10059
+ ; a.hasNext(); ) {
10060
+ var s = a.getNext(), c = s.key, l = s.value.document;
10061
+ if (!o.isPrefixOf(c.path)) break;
10062
+ c.path.length > o.length + 1 || Et(It(l), n) <= 0 || (r.has(l.key) || xn(e, l)) && (i = i.insert(l.key, l.mutableCopy()));
10061
10063
  }
10062
- return xt.resolve(r);
10064
+ return xt.resolve(i);
10063
10065
  }, t.prototype.getAllFromCollectionGroup = function(t, e, n, r) {
10064
10066
  // This method should only be called from the IndexBackfiller if persistence
10065
10067
  // is enabled.
@@ -10301,7 +10303,7 @@ e) {
10301
10303
  return n.persistence.Ms(t, e);
10302
10304
  } ]);
10303
10305
  }, t;
10304
- }(), Cu = /** @class */ function() {
10306
+ }(), Nu = /** @class */ function() {
10305
10307
  function t(t) {
10306
10308
  this.yt = t;
10307
10309
  }
@@ -10324,7 +10326,7 @@ e) {
10324
10326
  }).createIndex("userMutationsIndex", wi, {
10325
10327
  unique: !0
10326
10328
  }), t.createObjectStore("documentMutations");
10327
- }(t), Nu(t), function(t) {
10329
+ }(t), Cu(t), function(t) {
10328
10330
  t.createObjectStore("remoteDocuments");
10329
10331
  }(t));
10330
10332
  // Migration 2 to populate the targetGlobal object no longer needed since
@@ -10335,7 +10337,7 @@ e) {
10335
10337
  // potentially have corrupt data.
10336
10338
  0 !== n && (function(t) {
10337
10339
  t.deleteObjectStore("targetDocuments"), t.deleteObjectStore("targets"), t.deleteObjectStore("targetGlobal");
10338
- }(t), Nu(t)), u = u.next((function() {
10340
+ }(t), Cu(t)), u = u.next((function() {
10339
10341
  /**
10340
10342
  * Creates the target global singleton row.
10341
10343
  *
@@ -10441,7 +10443,7 @@ e) {
10441
10443
  }).createIndex("collectionGroupIndex", "collectionGroup", {
10442
10444
  unique: !1
10443
10445
  }), t.createObjectStore("indexState", {
10444
- keyPath: Ni
10446
+ keyPath: Ci
10445
10447
  }).createIndex("sequenceNumberIndex", ki, {
10446
10448
  unique: !1
10447
10449
  }), t.createObjectStore("indexEntries", {
@@ -10504,7 +10506,7 @@ e) {
10504
10506
  }, t.prototype.Qs = function(t, e) {
10505
10507
  // Create the index.
10506
10508
  t.createObjectStore("collectionParents", {
10507
- keyPath: Ci
10509
+ keyPath: Ni
10508
10510
  });
10509
10511
  var n = e.store("collectionParents"), r = new Oo, i = function(t) {
10510
10512
  if (r.add(t)) {
@@ -10566,7 +10568,7 @@ e) {
10566
10568
  return i = i.add(t);
10567
10569
  })), r.set(t.userId, i);
10568
10570
  })), xt.forEach(r, (function(t, r) {
10569
- var u = new N(r), a = co.re(n.yt, u), s = o.getIndexManager(u), c = Qo.re(u, n.yt, s, o.referenceDelegate);
10571
+ var u = new C(r), a = co.re(n.yt, u), s = o.getIndexManager(u), c = Qo.re(u, n.yt, s, o.referenceDelegate);
10570
10572
  return new mu(i, c, a, s).recalculateAndSaveOverlaysForDocumentKeys(new Gi(e, qt.at), t).next();
10571
10573
  }));
10572
10574
  }));
@@ -10594,7 +10596,7 @@ e) {
10594
10596
  * have a cached version in remoteDocumentCache or local mutations for the
10595
10597
  * document). The view is computed by applying the mutations in the
10596
10598
  * MutationQueue to the RemoteDocumentCache.
10597
- */ function Nu(t) {
10599
+ */ function Cu(t) {
10598
10600
  t.createObjectStore("targetDocuments", {
10599
10601
  keyPath: xi
10600
10602
  }).createIndex("documentTargetsIndex", Ai, {
@@ -10636,7 +10638,7 @@ var ku = "Failed to obtain exclusive access to the persistence layer. To allow s
10636
10638
  return Promise.resolve();
10637
10639
  }, !t.C()) throw new j(K.UNIMPLEMENTED, "This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.");
10638
10640
  this.referenceDelegate = new ou(this, i), this.ii = n + "main", this.yt = new Hi(s),
10639
- this.ri = new Ct(this.ii, this.Xs, new Cu(this.yt)), this.Cs = new Zo(this.referenceDelegate, this.yt),
10641
+ this.ri = new Nt(this.ii, this.Xs, new Nu(this.yt)), this.Cs = new Zo(this.referenceDelegate, this.yt),
10640
10642
  this.remoteDocumentCache = cu(this.yt), this.Ns = new uo, this.window && this.window.localStorage ? this.oi = this.window.localStorage : (this.oi = null,
10641
10643
  !1 === l && M("IndexedDbPersistence", "LocalStorage is unavailable. As a result, persistence may not work reliably. In particular enablePersistence() could fail immediately after refreshing the page."));
10642
10644
  }
@@ -11023,7 +11025,7 @@ var ku = "Failed to obtain exclusive access to the persistence layer. To allow s
11023
11025
  };
11024
11026
  return Ou(t).put("owner", e);
11025
11027
  }, t.C = function() {
11026
- return Ct.C();
11028
+ return Nt.C();
11027
11029
  },
11028
11030
  /** Checks the primary lease and removes it if we are the current primary. */ t.prototype._i = function(t) {
11029
11031
  var e = this, n = Ou(t);
@@ -11292,7 +11294,7 @@ var Mu = /** @class */ function() {
11292
11294
  /** Applies the query filter and sorting to the provided documents. */ t.prototype.Fi = function(t, e) {
11293
11295
  // Sort the documents and re-apply the query filter since previously
11294
11296
  // matching documents do not necessarily still match the query.
11295
- var n = new Ze(Cn(t));
11297
+ var n = new Ze(Nn(t));
11296
11298
  return e.forEach((function(e, r) {
11297
11299
  xn(t, r) && (n = n.add(r));
11298
11300
  })), n;
@@ -12278,7 +12280,7 @@ var ra = /** @class */ function() {
12278
12280
  */
12279
12281
  t.prototype.Dr = function(t, e) {
12280
12282
  var n = this.dr.exec(t), r = Number(n[1]), i = void 0 !== n[2] ? n[2] : null;
12281
- return ra.Zi(new N(i), r, e);
12283
+ return ra.Zi(new C(i), r, e);
12282
12284
  },
12283
12285
  /**
12284
12286
  * Parses a query target state from WebStorage. Returns 'null' if the value
@@ -13070,19 +13072,19 @@ function ya() {
13070
13072
  fields: s.document.fields
13071
13073
  }
13072
13074
  }), d = rn.newFoundDocument(c, l, h, f), p = s.targetIds || [], y = s.removedTargetIds || [];
13073
- n = new Nr(p, y, d.key, d);
13075
+ n = new Cr(p, y, d.key, d);
13074
13076
  } else if ("documentDelete" in e) {
13075
13077
  e.documentDelete;
13076
13078
  var v = e.documentDelete;
13077
13079
  v.document;
13078
13080
  var m = Hr(t, v.document), g = v.readTime ? jr(v.readTime) : at.min(), w = rn.newNoDocument(m, g), b = v.removedTargetIds || [];
13079
- n = new Nr([], b, w.key, w);
13081
+ n = new Cr([], b, w.key, w);
13080
13082
  } else if ("documentRemove" in e) {
13081
13083
  e.documentRemove;
13082
13084
  var I = e.documentRemove;
13083
13085
  I.document;
13084
13086
  var T = Hr(t, I.document), E = I.removedTargetIds || [];
13085
- n = new Nr([], E, T, null);
13087
+ n = new Cr([], E, T, null);
13086
13088
  } else {
13087
13089
  if (!("filter" in e)) return q();
13088
13090
  e.filter;
@@ -13549,7 +13551,7 @@ r, i, o, u) {
13549
13551
  // Mark this as something the client is currently listening for.
13550
13552
  n.du.set(e.targetId, e), Fa(n) ?
13551
13553
  // The listen will be sent in onWatchStreamOpen
13552
- ka(n) : Ya(n).ko() && Ca(n, e));
13554
+ ka(n) : Ya(n).ko() && Na(n, e));
13553
13555
  }
13554
13556
 
13555
13557
  /**
@@ -13557,7 +13559,7 @@ r, i, o, u) {
13557
13559
  * not being listened to.
13558
13560
  */ function Aa(t, e) {
13559
13561
  var n = G(t), r = Ya(n);
13560
- n.du.delete(e), r.ko() && Na(n, e), 0 === n.du.size && (r.ko() ? r.Fo() : Oa(n) &&
13562
+ n.du.delete(e), r.ko() && Ca(n, e), 0 === n.du.size && (r.ko() ? r.Fo() : Oa(n) &&
13561
13563
  // Revert to OnlineState.Unknown if the watch stream is not open and we
13562
13564
  // have no listeners, since without any listens to send we cannot
13563
13565
  // confirm if the stream is healthy and upgrade to OnlineState.Online.
@@ -13567,7 +13569,7 @@ r, i, o, u) {
13567
13569
  /**
13568
13570
  * We need to increment the the expected number of pending responses we're due
13569
13571
  * from watch so we wait for the ack to process any messages from this target.
13570
- */ function Ca(t, e) {
13572
+ */ function Na(t, e) {
13571
13573
  t.yu.Ot(e.targetId), Ya(t).zo(e)
13572
13574
  /**
13573
13575
  * We need to increment the expected number of pending responses we're due
@@ -13576,7 +13578,7 @@ r, i, o, u) {
13576
13578
  */;
13577
13579
  }
13578
13580
 
13579
- function Na(t, e) {
13581
+ function Ca(t, e) {
13580
13582
  t.yu.Ot(e), Ya(t).Ho(e);
13581
13583
  }
13582
13584
 
@@ -13611,7 +13613,7 @@ function Va(t) {
13611
13613
  return e(this, void 0, void 0, (function() {
13612
13614
  return n(this, (function(e) {
13613
13615
  return t.du.forEach((function(e, n) {
13614
- Ca(t, e);
13616
+ Na(t, e);
13615
13617
  })), [ 2 /*return*/ ];
13616
13618
  }));
13617
13619
  }));
@@ -13686,7 +13688,7 @@ function La(t, r, i) {
13686
13688
  return [ 3 /*break*/ , 13 ];
13687
13689
 
13688
13690
  case 6:
13689
- if (r instanceof Nr ? t.yu.Kt(r) : r instanceof kr ? t.yu.Jt(r) : t.yu.jt(r), i.isEqual(at.min())) return [ 3 /*break*/ , 13 ];
13691
+ if (r instanceof Cr ? t.yu.Kt(r) : r instanceof kr ? t.yu.Jt(r) : t.yu.jt(r), i.isEqual(at.min())) return [ 3 /*break*/ , 13 ];
13690
13692
  s.label = 7;
13691
13693
 
13692
13694
  case 7:
@@ -13720,13 +13722,13 @@ function La(t, r, i) {
13720
13722
  t.du.set(e, n.withResumeToken(Yt.EMPTY_BYTE_STRING, n.snapshotVersion)),
13721
13723
  // Cause a hard reset by unwatching and rewatching immediately, but
13722
13724
  // deliberately don't send a resume token so that we get a full update.
13723
- Na(t, e);
13725
+ Ca(t, e);
13724
13726
  // Mark the target we send as being on behalf of an existence filter
13725
13727
  // mismatch, but don't actually retain that in listenTargets. This ensures
13726
13728
  // that we flag the first re-listen this way without impacting future
13727
13729
  // listens of this target (that might happen e.g. on reconnect).
13728
13730
  var r = new Wi(n.target, e, 1 /* TargetPurpose.ExistenceFilterMismatch */ , n.sequenceNumber);
13729
- Ca(t, r);
13731
+ Na(t, r);
13730
13732
  }
13731
13733
  })), t.remoteSyncer.applyRemoteEvent(n);
13732
13734
  }(t, i) ] : [ 3 /*break*/ , 10 ];
@@ -14711,7 +14713,7 @@ function ds(t) {
14711
14713
  /** Documents in the view but not in the remote target */
14712
14714
  this.Ku = _r(),
14713
14715
  /** Document Keys that have local changes */
14714
- this.mutatedKeys = _r(), this.Gu = Cn(t), this.Qu = new $a(this.Gu);
14716
+ this.mutatedKeys = _r(), this.Gu = Nn(t), this.Qu = new $a(this.Gu);
14715
14717
  }
14716
14718
  return Object.defineProperty(t.prototype, "ju", {
14717
14719
  /**
@@ -15083,7 +15085,7 @@ function bs(t, r) {
15083
15085
  /* usePreviousResults= */ !0) ];
15084
15086
 
15085
15087
  case 1:
15086
- return a = d.sent(), s = new vs(r, a.Hi), c = s.Wu(a.documents), l = Cr.createSynthesizedTargetChangeForCurrentChange(i, o && "Offline" /* OnlineState.Offline */ !== t.onlineState, u),
15088
+ return a = d.sent(), s = new vs(r, a.Hi), c = s.Wu(a.documents), l = Nr.createSynthesizedTargetChangeForCurrentChange(i, o && "Offline" /* OnlineState.Offline */ !== t.onlineState, u),
15087
15089
  h = s.applyChanges(c,
15088
15090
  /* updateLimboDocuments= */ t.isPrimaryClient, l), Rs(t, i, h.Xu), f = new ms(r, i, s),
15089
15091
  [ 2 /*return*/ , (t.ic.set(r, f), t.rc.has(i) ? t.rc.get(i).push(r) : t.rc.set(i, [ r ]),
@@ -15360,7 +15362,7 @@ function xs(t, r) {
15360
15362
  // raise events immediately (depending on whether the watcher is caught
15361
15363
  // up), so we raise user callbacks first so that they consistently happen
15362
15364
  // before listen events.
15363
- ks(e, i, /*error=*/ null), Ns(e, i), e.sharedClientState.updateMutationState(i, "acknowledged"),
15365
+ ks(e, i, /*error=*/ null), Cs(e, i), e.sharedClientState.updateMutationState(i, "acknowledged"),
15364
15366
  [ 4 /*yield*/ , Ls(e, o) ];
15365
15367
 
15366
15368
  case 3:
@@ -15416,7 +15418,7 @@ function As(t, r, i) {
15416
15418
  // raise events immediately (depending on whether the watcher is caught up),
15417
15419
  // so we raise user callbacks first so that they consistently happen before
15418
15420
  // listen events.
15419
- ks(e, r, i), Ns(e, r), e.sharedClientState.updateMutationState(r, "rejected", i),
15421
+ ks(e, r, i), Cs(e, r), e.sharedClientState.updateMutationState(r, "rejected", i),
15420
15422
  [ 4 /*yield*/ , Ls(e, o) ];
15421
15423
 
15422
15424
  case 3:
@@ -15442,7 +15444,7 @@ function As(t, r, i) {
15442
15444
  /**
15443
15445
  * Registers a user callback that resolves when all pending mutations at the moment of calling
15444
15446
  * are acknowledged .
15445
- */ function Cs(t, r) {
15447
+ */ function Ns(t, r) {
15446
15448
  return e(this, void 0, void 0, (function() {
15447
15449
  var e, i, o, u, a;
15448
15450
  return n(this, (function(n) {
@@ -15477,7 +15479,7 @@ function As(t, r, i) {
15477
15479
  /**
15478
15480
  * Triggers the callbacks that are waiting for this batch id to get acknowledged by server,
15479
15481
  * if there are any.
15480
- */ function Ns(t, e) {
15482
+ */ function Cs(t, e) {
15481
15483
  (t.lc.get(e) || []).forEach((function(t) {
15482
15484
  t.resolve();
15483
15485
  })), t.lc.delete(e)
@@ -15733,7 +15735,7 @@ function Gs(t, r, i, o) {
15733
15735
  "acknowledged" === i || "rejected" === i ? (
15734
15736
  // NOTE: Both these methods are no-ops for batches that originated from
15735
15737
  // other clients.
15736
- ks(e, r, o || null), Ns(e, r), function(t, e) {
15738
+ ks(e, r, o || null), Cs(e, r), function(t, e) {
15737
15739
  G(G(t).mutationQueue).An(e);
15738
15740
  }(e.localStore, r)) : q(), n.label = 4;
15739
15741
 
@@ -16585,13 +16587,13 @@ function fc(t, e, n, r) {
16585
16587
  ssl: !1
16586
16588
  })), r.mockUserToken) {
16587
16589
  var u, a;
16588
- if ("string" == typeof r.mockUserToken) u = r.mockUserToken, a = N.MOCK_USER; else {
16590
+ if ("string" == typeof r.mockUserToken) u = r.mockUserToken, a = C.MOCK_USER; else {
16589
16591
  // Let createMockUserToken validate first (catches common mistakes like
16590
16592
  // invalid field "uid" and missing field "sub" / "user_id".)
16591
16593
  u = m(r.mockUserToken, null === (i = t._app) || void 0 === i ? void 0 : i.options.projectId);
16592
16594
  var s = r.mockUserToken.sub || r.mockUserToken.user_id;
16593
16595
  if (!s) throw new j(K.INVALID_ARGUMENT, "mockUserToken must contain 'sub' or 'user_id' field!");
16594
- a = new N(s);
16596
+ a = new C(s);
16595
16597
  }
16596
16598
  t._authCredentials = new H(new z(u, a));
16597
16599
  }
@@ -17377,7 +17379,7 @@ function Ic(t, r) {
17377
17379
  }
17378
17380
  return !1;
17379
17381
  }, t;
17380
- }(), Cc = /** @class */ function() {
17382
+ }(), Nc = /** @class */ function() {
17381
17383
  function t(t, r,
17382
17384
  /**
17383
17385
  * Asynchronous queue responsible for all of our internal processing. When
@@ -17390,7 +17392,7 @@ function Ic(t, r) {
17390
17392
  i, o) {
17391
17393
  var u = this;
17392
17394
  this.authCredentials = t, this.appCheckCredentials = r, this.asyncQueue = i, this.databaseInfo = o,
17393
- this.user = N.UNAUTHENTICATED, this.clientId = nt.R(), this.authCredentialListener = function() {
17395
+ this.user = C.UNAUTHENTICATED, this.clientId = nt.R(), this.authCredentialListener = function() {
17394
17396
  return Promise.resolve();
17395
17397
  }, this.appCheckCredentialListener = function() {
17396
17398
  return Promise.resolve();
@@ -17496,7 +17498,7 @@ function Ic(t, r) {
17496
17498
  *
17497
17499
  * Takes a bundle stream or buffer, and presents abstractions to read bundled
17498
17500
  * elements out of the underlying content.
17499
- */ function Nc(t, r) {
17501
+ */ function Cc(t, r) {
17500
17502
  return e(this, void 0, void 0, (function() {
17501
17503
  var i, o, u = this;
17502
17504
  return n(this, (function(a) {
@@ -17570,7 +17572,7 @@ function Fc(t) {
17570
17572
  switch (e.label) {
17571
17573
  case 0:
17572
17574
  return t.offlineComponents ? [ 3 /*break*/ , 2 ] : (V("FirestoreClient", "Using default OfflineComponentProvider"),
17573
- [ 4 /*yield*/ , Nc(t, new Js) ]);
17575
+ [ 4 /*yield*/ , Cc(t, new Js) ]);
17574
17576
 
17575
17577
  case 1:
17576
17578
  e.sent(), e.label = 2;
@@ -18133,7 +18135,7 @@ function Xc(t) {
18133
18135
  var e, n = t._freezeSettings(), r = function(t, e, n, r) {
18134
18136
  return new Ut(t, e, n, r.host, r.ssl, r.experimentalForceLongPolling, r.experimentalAutoDetectLongPolling, r.useFetchStreams);
18135
18137
  }(t._databaseId, (null === (e = t._app) || void 0 === e ? void 0 : e.options.appId) || "", t._persistenceKey, n);
18136
- t._firestoreClient = new Cc(t._authCredentials, t._appCheckCredentials, t._queue, r);
18138
+ t._firestoreClient = new Nc(t._authCredentials, t._appCheckCredentials, t._queue, r);
18137
18139
  }
18138
18140
 
18139
18141
  /**
@@ -18204,7 +18206,7 @@ function Xc(t) {
18204
18206
  return n(this, (function(n) {
18205
18207
  switch (n.label) {
18206
18208
  case 0:
18207
- return n.trys.push([ 0, 3, , 4 ]), [ 4 /*yield*/ , Nc(t, i) ];
18209
+ return n.trys.push([ 0, 3, , 4 ]), [ 4 /*yield*/ , Cc(t, i) ];
18208
18210
 
18209
18211
  case 1:
18210
18212
  return n.sent(), [ 4 /*yield*/ , kc(t, r) ];
@@ -18253,7 +18255,7 @@ function tl(t) {
18253
18255
  return n(this, (function(n) {
18254
18256
  switch (n.label) {
18255
18257
  case 0:
18256
- return Ct.C() ? (e = t + "main", [ 4 /*yield*/ , Ct.delete(e) ]) : [ 2 /*return*/ , Promise.resolve() ];
18258
+ return Nt.C() ? (e = t + "main", [ 4 /*yield*/ , Nt.delete(e) ]) : [ 2 /*return*/ , Promise.resolve() ];
18257
18259
 
18258
18260
  case 1:
18259
18261
  return n.sent(), [ 2 /*return*/ ];
@@ -18301,7 +18303,7 @@ function el(t) {
18301
18303
  return n(this, (function(n) {
18302
18304
  switch (n.label) {
18303
18305
  case 0:
18304
- return e = Cs, [ 4 /*yield*/ , Lc(t) ];
18306
+ return e = Ns, [ 4 /*yield*/ , Lc(t) ];
18305
18307
 
18306
18308
  case 1:
18307
18309
  return [ 2 /*return*/ , e.apply(void 0, [ n.sent(), i ]) ];
@@ -18975,7 +18977,7 @@ var El = /** @class */ function(e) {
18975
18977
  return t(n, e), n.prototype._toFieldTransform = function(t) {
18976
18978
  var e = Tl(this, t,
18977
18979
  /*array=*/ !0), n = this._a.map((function(t) {
18978
- return Nl(t, e);
18980
+ return Cl(t, e);
18979
18981
  })), r = new qn(n);
18980
18982
  return new zn(t.path, r);
18981
18983
  }, n.prototype.isEqual = function(t) {
@@ -18990,7 +18992,7 @@ var El = /** @class */ function(e) {
18990
18992
  return t(n, e), n.prototype._toFieldTransform = function(t) {
18991
18993
  var e = Tl(this, t,
18992
18994
  /*array=*/ !0), n = this._a.map((function(t) {
18993
- return Nl(t, e);
18995
+ return Cl(t, e);
18994
18996
  })), r = new Bn(n);
18995
18997
  return new zn(t.path, r);
18996
18998
  }, n.prototype.isEqual = function(t) {
@@ -19024,7 +19026,7 @@ var El = /** @class */ function(e) {
19024
19026
  if (r instanceof Il)
19025
19027
  // Add it to the field mask, but don't add anything to updateData.
19026
19028
  o.push(a); else {
19027
- var c = Nl(r, s);
19029
+ var c = Cl(r, s);
19028
19030
  null != c && (o.push(a), u.set(a, c));
19029
19031
  }
19030
19032
  }));
@@ -19047,7 +19049,7 @@ var El = /** @class */ function(e) {
19047
19049
  if (p instanceof Il)
19048
19050
  // Add it to the field mask, but don't add anything to updateData.
19049
19051
  l.push(d); else {
19050
- var m = Nl(p, v);
19052
+ var m = Cl(p, v);
19051
19053
  null != m && (l.push(d), h.set(d, m));
19052
19054
  }
19053
19055
  }
@@ -19061,8 +19063,8 @@ var El = /** @class */ function(e) {
19061
19063
  *
19062
19064
  * @param allowArrays - Whether the query value is an array that may directly
19063
19065
  * contain additional arrays (e.g. the operand of an `in` query).
19064
- */ function Cl(t, e, n, r) {
19065
- return void 0 === r && (r = !1), Nl(n, t.da(r ? 4 /* UserDataSource.ArrayArgument */ : 3 /* UserDataSource.Argument */ , e));
19066
+ */ function Nl(t, e, n, r) {
19067
+ return void 0 === r && (r = !1), Cl(n, t.da(r ? 4 /* UserDataSource.ArrayArgument */ : 3 /* UserDataSource.Argument */ , e));
19066
19068
  }
19067
19069
 
19068
19070
  /**
@@ -19073,7 +19075,7 @@ var El = /** @class */ function(e) {
19073
19075
  * the source of the data being parsed, etc.
19074
19076
  * @returns The parsed value, or null if the value was a FieldValue sentinel
19075
19077
  * that should not be included in the resulting parsed data.
19076
- */ function Nl(t, e) {
19078
+ */ function Cl(t, e) {
19077
19079
  if (Fl(
19078
19080
  // Unwrap the API type from the Compat SDK. This will return the API type
19079
19081
  // from firestore-exp.
@@ -19113,7 +19115,7 @@ var El = /** @class */ function(e) {
19113
19115
  if (e.settings.oa && 4 /* UserDataSource.ArrayArgument */ !== e.sa) throw e.ha("Nested arrays are not supported");
19114
19116
  return function(t, e) {
19115
19117
  for (var n = [], r = 0, i = 0, o = t; i < o.length; i++) {
19116
- var u = Nl(o[i], e.aa(r));
19118
+ var u = Cl(o[i], e.aa(r));
19117
19119
  null == u && (
19118
19120
  // Just include nulls in the array for fields being replaced with a
19119
19121
  // sentinel.
@@ -19180,7 +19182,7 @@ function kl(t, e) {
19180
19182
  // If we encounter an empty object, we explicitly add it to the update
19181
19183
  // mask to ensure that the server creates a map entry.
19182
19184
  e.path && e.path.length > 0 && e.fieldMask.push(e.path) : Kt(t, (function(t, r) {
19183
- var i = Nl(r, e.ra(t));
19185
+ var i = Cl(r, e.ra(t));
19184
19186
  null != i && (n[t] = i);
19185
19187
  })), {
19186
19188
  mapValue: {
@@ -19474,7 +19476,7 @@ function Bl(t, e) {
19474
19476
  };
19475
19477
  } else a = ch(r, t, u);
19476
19478
  } else "in" /* Operator.IN */ !== o && "not-in" /* Operator.NOT_IN */ !== o && "array-contains-any" /* Operator.ARRAY_CONTAINS_ANY */ !== o || lh(u, o),
19477
- a = Cl(n, "where", u,
19479
+ a = Nl(n, "where", u,
19478
19480
  /* allowArrays= */ "in" /* Operator.IN */ === o || "not-in" /* Operator.NOT_IN */ === o);
19479
19481
  return Ae.create(i, o, a);
19480
19482
  }(t._query, 0, e, t.firestore._databaseId, this._field, this._op, this._value);
@@ -19523,7 +19525,7 @@ function Bl(t, e) {
19523
19525
  })).filter((function(t) {
19524
19526
  return t.getFilters().length > 0;
19525
19527
  }));
19526
- return 1 === e.length ? e[0] : Ce.create(e, this._getOperator());
19528
+ return 1 === e.length ? e[0] : Ne.create(e, this._getOperator());
19527
19529
  }, n.prototype._apply = function(t) {
19528
19530
  var e = this._parse(t);
19529
19531
  return 0 === e.getFilters().length ? t : (function(t, e) {
@@ -19800,7 +19802,7 @@ function ah() {
19800
19802
  var h = new ft(l);
19801
19803
  a.push(fe(e, h));
19802
19804
  } else {
19803
- var f = Cl(n, r, c);
19805
+ var f = Nl(n, r, c);
19804
19806
  a.push(f);
19805
19807
  }
19806
19808
  }
@@ -20433,7 +20435,7 @@ function Ah(t) {
20433
20435
  * server. Returns an error if the network is not available.
20434
20436
  *
20435
20437
  * @returns A `Promise` that will be resolved with the results of the query.
20436
- */ function Ch(t) {
20438
+ */ function Nh(t) {
20437
20439
  t = ac(t, pc);
20438
20440
  var e = ac(t.firestore, zc), n = Yc(e), r = new Sh(e);
20439
20441
  return Bc(n, t._query, {
@@ -20443,7 +20445,7 @@ function Ah(t) {
20443
20445
  }));
20444
20446
  }
20445
20447
 
20446
- function Nh(t, e, n) {
20448
+ function Ch(t, e, n) {
20447
20449
  t = ac(t, dc);
20448
20450
  var r = ac(t.firestore, zc), i = yh(t.converter, e, n);
20449
20451
  return Mh(r, [ bl(wl(r), "setDoc", t._key, i, null !== t.converter, n).toMutation(t._key, Hn.none()) ]);
@@ -21192,9 +21194,9 @@ function $h(t, e) {
21192
21194
  return r = Object.assign({
21193
21195
  useFetchStreams: Kh
21194
21196
  }, r), o._setSettings(r), o;
21195
- }), "PUBLIC").setMultipleInstances(!0)), u(C, "3.8.1", void 0),
21197
+ }), "PUBLIC").setMultipleInstances(!0)), u(N, "3.8.2-20230201003102", void 0),
21196
21198
  // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation
21197
- u(C, "3.8.1", "esm5");
21199
+ u(N, "3.8.2-20230201003102", "esm5");
21198
21200
 
21199
- export { ph as AbstractUserDataWriter, Sc as AggregateField, _c as AggregateQuerySnapshot, sl as Bytes, Qc as CACHE_SIZE_UNLIMITED, yc as CollectionReference, dc as DocumentReference, gh as DocumentSnapshot, cl as FieldPath, hl as FieldValue, zc as Firestore, j as FirestoreError, fl as GeoPoint, jc as LoadBundleTask, pc as Query, Hl as QueryCompositeFilterConstraint, jl as QueryConstraint, wh as QueryDocumentSnapshot, oh as QueryEndAtConstraint, zl as QueryFieldFilterConstraint, $l as QueryLimitConstraint, Zl as QueryOrderByConstraint, bh as QuerySnapshot, nh as QueryStartAtConstraint, mh as SnapshotMetadata, ut as Timestamp, jh as Transaction, Bh as WriteBatch, Bt as _DatabaseId, ft as _DocumentKey, tt as _EmptyAppCheckTokenProvider, W as _EmptyAuthCredentialsProvider, ht as _FieldPath, ac as _cast, B as _debugAssert, Ht as _isBase64Available, L as _logWarn, rc as _validateIsNotUsedTogether, Oh as addDoc, Ph as aggregateQuerySnapshotEqual, Xl as and, Yh as arrayRemove, Hh as arrayUnion, tl as clearIndexedDbPersistence, vc as collection, mc as collectionGroup, fc as connectFirestoreEmulator, Fh as deleteDoc, zh as deleteField, rl as disableNetwork, gc as doc, ll as documentId, Zc as enableIndexedDbPersistence, Jc as enableMultiTabIndexedDbPersistence, nl as enableNetwork, ah as endAt, uh as endBefore, Yc as ensureFirestoreConfigured, Mh as executeWrite, qh as getCountFromServer, Eh as getDoc, _h as getDocFromCache, Dh as getDocFromServer, xh as getDocs, Ah as getDocsFromCache, Ch as getDocsFromServer, Hc as getFirestore, Xh as increment, Wc as initializeFirestore, th as limit, eh as limitToLast, ol as loadBundle, ul as namedQuery, Rh as onSnapshot, Vh as onSnapshotsInSync, Yl as or, Jl as orderBy, Ql as query, bc as queryEqual, wc as refEqual, Qh as runTransaction, Wh as serverTimestamp, Nh as setDoc, Jh as setIndexConfiguration, R as setLogLevel, Th as snapshotEqual, ih as startAfter, rh as startAt, il as terminate, kh as updateDoc, el as waitForPendingWrites, Wl as where, Zh as writeBatch };
21201
+ export { ph as AbstractUserDataWriter, Sc as AggregateField, _c as AggregateQuerySnapshot, sl as Bytes, Qc as CACHE_SIZE_UNLIMITED, yc as CollectionReference, dc as DocumentReference, gh as DocumentSnapshot, cl as FieldPath, hl as FieldValue, zc as Firestore, j as FirestoreError, fl as GeoPoint, jc as LoadBundleTask, pc as Query, Hl as QueryCompositeFilterConstraint, jl as QueryConstraint, wh as QueryDocumentSnapshot, oh as QueryEndAtConstraint, zl as QueryFieldFilterConstraint, $l as QueryLimitConstraint, Zl as QueryOrderByConstraint, bh as QuerySnapshot, nh as QueryStartAtConstraint, mh as SnapshotMetadata, ut as Timestamp, jh as Transaction, Bh as WriteBatch, Bt as _DatabaseId, ft as _DocumentKey, tt as _EmptyAppCheckTokenProvider, W as _EmptyAuthCredentialsProvider, ht as _FieldPath, ac as _cast, B as _debugAssert, Ht as _isBase64Available, L as _logWarn, rc as _validateIsNotUsedTogether, Oh as addDoc, Ph as aggregateQuerySnapshotEqual, Xl as and, Yh as arrayRemove, Hh as arrayUnion, tl as clearIndexedDbPersistence, vc as collection, mc as collectionGroup, fc as connectFirestoreEmulator, Fh as deleteDoc, zh as deleteField, rl as disableNetwork, gc as doc, ll as documentId, Zc as enableIndexedDbPersistence, Jc as enableMultiTabIndexedDbPersistence, nl as enableNetwork, ah as endAt, uh as endBefore, Yc as ensureFirestoreConfigured, Mh as executeWrite, qh as getCountFromServer, Eh as getDoc, _h as getDocFromCache, Dh as getDocFromServer, xh as getDocs, Ah as getDocsFromCache, Nh as getDocsFromServer, Hc as getFirestore, Xh as increment, Wc as initializeFirestore, th as limit, eh as limitToLast, ol as loadBundle, ul as namedQuery, Rh as onSnapshot, Vh as onSnapshotsInSync, Yl as or, Jl as orderBy, Ql as query, bc as queryEqual, wc as refEqual, Qh as runTransaction, Wh as serverTimestamp, Ch as setDoc, Jh as setIndexConfiguration, R as setLogLevel, Th as snapshotEqual, ih as startAfter, rh as startAt, il as terminate, kh as updateDoc, el as waitForPendingWrites, Wl as where, Zh as writeBatch };
21200
21202
  //# sourceMappingURL=index.esm5.js.map