@firebase/firestore 3.7.2 → 3.7.3-20221109210852

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.
@@ -67,7 +67,7 @@ v.MOCK_USER = new v("mock-user");
67
67
  * See the License for the specific language governing permissions and
68
68
  * limitations under the License.
69
69
  */
70
- var g = "9.13.0", w = new l("@firebase/firestore");
70
+ var g = "9.14.0-20221109210852", w = new l("@firebase/firestore");
71
71
 
72
72
  /**
73
73
  * @license
@@ -197,14 +197,14 @@ function T(t) {
197
197
  */;
198
198
  }
199
199
 
200
- function I(t, e) {
200
+ function A(t, e) {
201
201
  t || S();
202
202
  }
203
203
 
204
204
  /**
205
205
  * Casts `obj` to `T`. In non-production builds, verifies that `obj` is an
206
206
  * instance of `T` before casting.
207
- */ function A(t,
207
+ */ function I(t,
208
208
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
209
209
  e) {
210
210
  return t;
@@ -295,7 +295,7 @@ e) {
295
295
  return t.prototype.getToken = function() {
296
296
  var t = this;
297
297
  return this.auth ? this.auth.getToken().then((function(e) {
298
- return e ? (I("string" == typeof e.accessToken), new K(e.accessToken, new v(t.auth.getUid()))) : null;
298
+ return e ? (A("string" == typeof e.accessToken), new K(e.accessToken, new v(t.auth.getUid()))) : null;
299
299
  })) : Promise.resolve(null);
300
300
  }, t.prototype.invalidateToken = function() {}, t.prototype.start = function(t, e) {},
301
301
  t.prototype.shutdown = function() {}, t;
@@ -308,7 +308,7 @@ e) {
308
308
  return t.prototype.l = function() {
309
309
  return this.u ? this.u() : (
310
310
  // Make sure this really is a Gapi client.
311
- I(!("object" != typeof this.t || null === this.t || !this.t.auth || !this.t.auth.getAuthHeaderValueForFirstParty)),
311
+ A(!("object" != typeof this.t || null === this.t || !this.t.auth || !this.t.auth.getAuthHeaderValueForFirstParty)),
312
312
  this.t.auth.getAuthHeaderValueForFirstParty([]));
313
313
  }, Object.defineProperty(t.prototype, "headers", {
314
314
  get: function() {
@@ -345,11 +345,11 @@ e) {
345
345
  }
346
346
  return t.prototype.getToken = function() {
347
347
  return this.appCheck ? this.appCheck.getToken().then((function(t) {
348
- return t ? (I("string" == typeof t.token), new X(t.token)) : null;
348
+ return t ? (A("string" == typeof t.token), new X(t.token)) : null;
349
349
  })) : Promise.resolve(null);
350
350
  }, t.prototype.invalidateToken = function() {}, t.prototype.start = function(t, e) {},
351
351
  t.prototype.shutdown = function() {}, t;
352
- }(), Z =
352
+ }(), $ =
353
353
  /**
354
354
  * Constructs a DatabaseInfo using the provided host, databaseId and
355
355
  * persistenceKey.
@@ -370,7 +370,7 @@ e) {
370
370
  function(t, e, n, r, i, o, a, u) {
371
371
  this.databaseId = t, this.appId = e, this.persistenceKey = n, this.host = r, this.ssl = i,
372
372
  this.forceLongPolling = o, this.autoDetectLongPolling = a, this.useFetchStreams = u;
373
- }, $ = /** @class */ function() {
373
+ }, Z = /** @class */ function() {
374
374
  function t(t, e) {
375
375
  this.projectId = t, this.database = e || "(default)";
376
376
  }
@@ -869,28 +869,34 @@ var vt = /** @class */ function(r) {
869
869
  throw new Error("Not supported by FetchConnection");
870
870
  }, i.prototype.R = function(t, r, i, o) {
871
871
  return e(this, void 0, void 0, (function() {
872
- var t, e, a;
872
+ var t, e, a, u, s, c;
873
873
  return n(this, (function(n) {
874
874
  switch (n.label) {
875
875
  case 0:
876
- t = JSON.stringify(o), n.label = 1;
876
+ e = JSON.stringify(o), n.label = 1;
877
877
 
878
878
  case 1:
879
879
  return n.trys.push([ 1, 3, , 4 ]), [ 4 /*yield*/ , this.V(r, {
880
880
  method: "POST",
881
881
  headers: i,
882
- body: t
882
+ body: e
883
883
  }) ];
884
884
 
885
885
  case 2:
886
- return e = n.sent(), [ 3 /*break*/ , 4 ];
886
+ return a = n.sent(), [ 3 /*break*/ , 4 ];
887
887
 
888
888
  case 3:
889
- throw a = n.sent(), new B(mt(a.status), "Request failed with error: " + a.statusText);
889
+ throw u = n.sent(), new B(mt(u.status), "Request failed with error: " + u.statusText);
890
890
 
891
891
  case 4:
892
- if (!e.ok) throw new B(mt(e.status), "Request failed with error: " + e.statusText);
893
- return [ 2 /*return*/ , e.json() ];
892
+ return a.ok ? [ 3 /*break*/ , 6 ] : [ 4 /*yield*/ , a.json() ];
893
+
894
+ case 5:
895
+ throw s = n.sent(), Array.isArray(s) && (s = s[0]), c = null === (t = null == s ? void 0 : s.error) || void 0 === t ? void 0 : t.message,
896
+ new B(mt(a.status), "Request failed with error: " + (null != c ? c : a.statusText));
897
+
898
+ case 6:
899
+ return [ 2 /*return*/ , a.json() ];
894
900
  }
895
901
  }));
896
902
  }));
@@ -1011,7 +1017,7 @@ var vt = /** @class */ function(r) {
1011
1017
  * limitations under the License.
1012
1018
  */ var wt = /** @class */ function() {
1013
1019
  function t() {}
1014
- return t.D = function() {
1020
+ return t.$ = function() {
1015
1021
  for (
1016
1022
  // Alphanumeric characters
1017
1023
  var t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", e = Math.floor(256 / t.length) * t.length, n = ""
@@ -1267,7 +1273,7 @@ function St(t, e) {
1267
1273
  */
1268
1274
  // An immutable sorted map implementation, based on a Left-leaning Red-Black
1269
1275
  // tree.
1270
- var It = /** @class */ function() {
1276
+ var At = /** @class */ function() {
1271
1277
  function t(t, e) {
1272
1278
  this.comparator = t, this.root = e || Vt.EMPTY;
1273
1279
  }
@@ -1346,15 +1352,15 @@ var It = /** @class */ function() {
1346
1352
  },
1347
1353
  // Returns an iterator over the SortedMap.
1348
1354
  t.prototype.getIterator = function() {
1349
- return new At(this.root, null, this.comparator, !1);
1355
+ return new It(this.root, null, this.comparator, !1);
1350
1356
  }, t.prototype.getIteratorFrom = function(t) {
1351
- return new At(this.root, t, this.comparator, !1);
1357
+ return new It(this.root, t, this.comparator, !1);
1352
1358
  }, t.prototype.getReverseIterator = function() {
1353
- return new At(this.root, null, this.comparator, !0);
1359
+ return new It(this.root, null, this.comparator, !0);
1354
1360
  }, t.prototype.getReverseIteratorFrom = function(t) {
1355
- return new At(this.root, t, this.comparator, !0);
1361
+ return new It(this.root, t, this.comparator, !0);
1356
1362
  }, t;
1357
- }(), At = /** @class */ function() {
1363
+ }(), It = /** @class */ function() {
1358
1364
  function t(t, e, n, r) {
1359
1365
  this.isReverse = r, this.nodeStack = [];
1360
1366
  for (var i = 1; !t.isEmpty(); ) if (i = e ? n(t.key, e) : 1,
@@ -1590,7 +1596,7 @@ Vt.EMPTY = new (/** @class */ function() {
1590
1596
  */
1591
1597
  var Pt = /** @class */ function() {
1592
1598
  function t(t) {
1593
- this.comparator = t, this.data = new It(this.comparator);
1599
+ this.comparator = t, this.data = new At(this.comparator);
1594
1600
  }
1595
1601
  return t.prototype.has = function(t) {
1596
1602
  return null !== this.data.get(t);
@@ -1778,12 +1784,12 @@ var Ot = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
1778
1784
  // The json interface (for the browser) will return an iso timestamp string,
1779
1785
  // while the proto js library (for node) will return a
1780
1786
  // google.protobuf.Timestamp instance.
1781
- if (I(!!t), "string" == typeof t) {
1787
+ if (A(!!t), "string" == typeof t) {
1782
1788
  // The date string can have higher precision (nanos) than the Date class
1783
1789
  // (millis), so we do some custom parsing here.
1784
1790
  // Parse the nanos right out of the string.
1785
1791
  var e = 0, n = Ot.exec(t);
1786
- if (I(!!n), n[1]) {
1792
+ if (A(!!n), n[1]) {
1787
1793
  // Pad the fraction out to 9 digits (nanos).
1788
1794
  var r = n[1];
1789
1795
  r = (r + "000000000").substr(0, 9), e = Number(r);
@@ -2111,7 +2117,7 @@ function Qt(t, e) {
2111
2117
  return Object.assign({}, t);
2112
2118
  }
2113
2119
 
2114
- var Zt = /** @class */ function() {
2120
+ var $t = /** @class */ function() {
2115
2121
  function t(t) {
2116
2122
  this.value = t;
2117
2123
  }
@@ -2204,7 +2210,7 @@ var Zt = /** @class */ function() {
2204
2210
  }, t.prototype.clone = function() {
2205
2211
  return new t(Jt(this.value));
2206
2212
  }, t;
2207
- }(), $t = /** @class */ function() {
2213
+ }(), Zt = /** @class */ function() {
2208
2214
  function t(t, e, n, r, i, o) {
2209
2215
  this.key = t, this.documentType = e, this.version = n, this.readTime = r, this.data = i,
2210
2216
  this.documentState = o
@@ -2214,7 +2220,7 @@ var Zt = /** @class */ function() {
2214
2220
  */;
2215
2221
  }
2216
2222
  return t.newInvalidDocument = function(e) {
2217
- return new t(e, 0 /* INVALID */ , Et.min(), Et.min(), Zt.empty(), 0 /* SYNCED */);
2223
+ return new t(e, 0 /* INVALID */ , Et.min(), Et.min(), $t.empty(), 0 /* SYNCED */);
2218
2224
  },
2219
2225
  /**
2220
2226
  * Creates a new document that is known to exist with the given data at the
@@ -2224,7 +2230,7 @@ var Zt = /** @class */ function() {
2224
2230
  return new t(e, 1 /* FOUND_DOCUMENT */ , n, Et.min(), r, 0 /* SYNCED */);
2225
2231
  },
2226
2232
  /** Creates a new document that is known to not exist at the given version. */ t.newNoDocument = function(e, n) {
2227
- return new t(e, 2 /* NO_DOCUMENT */ , n, Et.min(), Zt.empty(), 0 /* SYNCED */);
2233
+ return new t(e, 2 /* NO_DOCUMENT */ , n, Et.min(), $t.empty(), 0 /* SYNCED */);
2228
2234
  },
2229
2235
  /**
2230
2236
  * Creates a new document that is known to exist at the given version but
@@ -2232,7 +2238,7 @@ var Zt = /** @class */ function() {
2232
2238
  * base document).
2233
2239
  */
2234
2240
  t.newUnknownDocument = function(e, n) {
2235
- return new t(e, 3 /* UNKNOWN_DOCUMENT */ , n, Et.min(), Zt.empty(), 2 /* HAS_COMMITTED_MUTATIONS */);
2241
+ return new t(e, 3 /* UNKNOWN_DOCUMENT */ , n, Et.min(), $t.empty(), 2 /* HAS_COMMITTED_MUTATIONS */);
2236
2242
  },
2237
2243
  /**
2238
2244
  * Changes the document type to indicate that it exists and that its version
@@ -2247,7 +2253,7 @@ var Zt = /** @class */ function() {
2247
2253
  * version.
2248
2254
  */
2249
2255
  t.prototype.convertToNoDocument = function(t) {
2250
- return this.version = t, this.documentType = 2 /* NO_DOCUMENT */ , this.data = Zt.empty(),
2256
+ return this.version = t, this.documentType = 2 /* NO_DOCUMENT */ , this.data = $t.empty(),
2251
2257
  this.documentState = 0 /* SYNCED */ , this;
2252
2258
  },
2253
2259
  /**
@@ -2256,7 +2262,7 @@ var Zt = /** @class */ function() {
2256
2262
  * base document).
2257
2263
  */
2258
2264
  t.prototype.convertToUnknownDocument = function(t) {
2259
- return this.version = t, this.documentType = 3 /* UNKNOWN_DOCUMENT */ , this.data = Zt.empty(),
2265
+ return this.version = t, this.documentType = 3 /* UNKNOWN_DOCUMENT */ , this.data = $t.empty(),
2260
2266
  this.documentState = 2 /* HAS_COMMITTED_MUTATIONS */ , this;
2261
2267
  }, t.prototype.setHasCommittedMutations = function() {
2262
2268
  return this.documentState = 2 /* HAS_COMMITTED_MUTATIONS */ , this;
@@ -2302,7 +2308,7 @@ var Zt = /** @class */ function() {
2302
2308
  void 0 === e && (e = null), void 0 === n && (n = []), void 0 === r && (r = []),
2303
2309
  void 0 === i && (i = null), void 0 === o && (o = null), void 0 === a && (a = null),
2304
2310
  this.path = t, this.collectionGroup = e, this.orderBy = n, this.filters = r, this.limit = i,
2305
- this.startAt = o, this.endAt = a, this.$ = null;
2311
+ this.startAt = o, this.endAt = a, this.D = null;
2306
2312
  };
2307
2313
 
2308
2314
  /**
@@ -2548,7 +2554,7 @@ function ve(t) {
2548
2554
  * which can be different from the order by constraints the user provided (e.g.
2549
2555
  * the SDK and backend always orders by `__name__`).
2550
2556
  */ function we(t) {
2551
- var e = A(t);
2557
+ var e = I(t);
2552
2558
  if (null === e.O) {
2553
2559
  e.O = [];
2554
2560
  var n = ve(e), r = me(e);
@@ -2575,7 +2581,7 @@ function ve(t) {
2575
2581
  /**
2576
2582
  * Converts this `Query` instance to it's corresponding `Target` representation.
2577
2583
  */ function be(t) {
2578
- var e = A(t);
2584
+ var e = I(t);
2579
2585
  if (!e.k) if ("F" /* First */ === e.limitType) e.k = ee(e.path, e.collectionGroup, we(e), e.filters, e.limit, e.startAt, e.endAt); else {
2580
2586
  for (
2581
2587
  // Flip the orderBy directions since we want the last results
@@ -2682,13 +2688,13 @@ function _e(t, e) {
2682
2688
  return (n = e.call(this) || this).elements = t, n;
2683
2689
  }
2684
2690
  return t(n, e), n;
2685
- }(Te), Ie = /** @class */ function(e) {
2691
+ }(Te), Ae = /** @class */ function(e) {
2686
2692
  function n(t, n) {
2687
2693
  var r = this;
2688
2694
  return (r = e.call(this) || this).L = t, r.M = n, r;
2689
2695
  }
2690
2696
  return t(n, e), n;
2691
- }(Te), Ae = function(t, e) {
2697
+ }(Te), Ie = function(t, e) {
2692
2698
  this.field = t, this.transform = e;
2693
2699
  }, Ve = /** @class */ function() {
2694
2700
  function t(t, e) {
@@ -2800,7 +2806,7 @@ function je(t, e) {
2800
2806
  }
2801
2807
 
2802
2808
  function Me(t) {
2803
- return I(!!t), Et.fromTimestamp(function(t) {
2809
+ return A(!!t), Et.fromTimestamp(function(t) {
2804
2810
  var e = Rt(t);
2805
2811
  return new Tt(e.seconds, e.nanos);
2806
2812
  }(t));
@@ -2819,11 +2825,11 @@ function Be(t, e) {
2819
2825
  function ze(t, e) {
2820
2826
  var n, r = function(t) {
2821
2827
  var e = et.fromString(t);
2822
- return I(Ze(e)), e;
2828
+ return A($e(e)), e;
2823
2829
  }(e);
2824
2830
  if (r.get(1) !== t.databaseId.projectId) throw new B(D, "Tried to deserialize key from different project: " + r.get(1) + " vs " + t.databaseId.projectId);
2825
2831
  if (r.get(3) !== t.databaseId.database) throw new B(D, "Tried to deserialize key from different database: " + r.get(3) + " vs " + t.databaseId.database);
2826
- return new it((I((n = r).length > 4 && "documents" === n.get(4)), n.popFirst(5)));
2832
+ return new it((A((n = r).length > 4 && "documents" === n.get(4)), n.popFirst(5)));
2827
2833
  }
2828
2834
 
2829
2835
  function Ke(t, e) {
@@ -2954,7 +2960,7 @@ function Je(t) {
2954
2960
  };
2955
2961
  }
2956
2962
 
2957
- function Ze(t) {
2963
+ function $e(t) {
2958
2964
  // Resource names have at least 4 components (project ID, database ID)
2959
2965
  return t.length >= 4 && "projects" === t.get(0) && "databases" === t.get(2);
2960
2966
  }
@@ -2974,7 +2980,7 @@ function Ze(t) {
2974
2980
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2975
2981
  * See the License for the specific language governing permissions and
2976
2982
  * limitations under the License.
2977
- */ function $e(t) {
2983
+ */ function Ze(t) {
2978
2984
  return new Le(t, /* useProto3Json= */ !0);
2979
2985
  }
2980
2986
 
@@ -3142,7 +3148,7 @@ function nn(t, r) {
3142
3148
  return n(this, (function(n) {
3143
3149
  switch (n.label) {
3144
3150
  case 0:
3145
- return e = A(t), i = Ge(e.L) + "/documents", o = {
3151
+ return e = I(t), i = Ge(e.L) + "/documents", o = {
3146
3152
  writes: r.map((function(t) {
3147
3153
  return function(t, e) {
3148
3154
  var n;
@@ -3178,7 +3184,7 @@ function nn(t, r) {
3178
3184
  values: n.elements
3179
3185
  }
3180
3186
  };
3181
- if (n instanceof Ie) return {
3187
+ if (n instanceof Ae) return {
3182
3188
  fieldPath: e.field.canonicalString(),
3183
3189
  increment: n.M
3184
3190
  };
@@ -3208,7 +3214,7 @@ function rn(t, r) {
3208
3214
  return n(this, (function(n) {
3209
3215
  switch (n.label) {
3210
3216
  case 0:
3211
- return e = A(t), i = Ge(e.L) + "/documents", o = {
3217
+ return e = I(t), i = Ge(e.L) + "/documents", o = {
3212
3218
  documents: r.map((function(t) {
3213
3219
  return Be(e.L, t);
3214
3220
  }))
@@ -3218,23 +3224,23 @@ function rn(t, r) {
3218
3224
  return a = n.sent(), u = new Map, a.forEach((function(t) {
3219
3225
  var n = function(t, e) {
3220
3226
  return "found" in e ? function(t, e) {
3221
- I(!!e.found), e.found.name, e.found.updateTime;
3222
- var n = ze(t, e.found.name), r = Me(e.found.updateTime), i = new Zt({
3227
+ A(!!e.found), e.found.name, e.found.updateTime;
3228
+ var n = ze(t, e.found.name), r = Me(e.found.updateTime), i = new $t({
3223
3229
  mapValue: {
3224
3230
  fields: e.found.fields
3225
3231
  }
3226
3232
  });
3227
- return $t.newFoundDocument(n, r, i);
3233
+ return Zt.newFoundDocument(n, r, i);
3228
3234
  }(t, e) : "missing" in e ? function(t, e) {
3229
- I(!!e.missing), I(!!e.readTime);
3235
+ A(!!e.missing), A(!!e.readTime);
3230
3236
  var n = ze(t, e.missing), r = Me(e.readTime);
3231
- return $t.newNoDocument(n, r);
3237
+ return Zt.newNoDocument(n, r);
3232
3238
  }(t, e) : S();
3233
3239
  }(e.L, t);
3234
3240
  u.set(n.key.toString(), n);
3235
3241
  })), s = [], [ 2 /*return*/ , (r.forEach((function(t) {
3236
3242
  var e = u.get(t.toString());
3237
- I(!!e), s.push(e);
3243
+ A(!!e), s.push(e);
3238
3244
  })), s) ];
3239
3245
  }
3240
3246
  }));
@@ -3274,7 +3280,7 @@ var on = new Map;
3274
3280
  var e = function(t) {
3275
3281
  return new vt(t, fetch.bind(null));
3276
3282
  }((i = t._databaseId, o = t.app.options.appId || "", a = t._persistenceKey, u = t._freezeSettings(),
3277
- new Z(i, o, a, u.host, u.ssl, u.experimentalForceLongPolling, u.experimentalAutoDetectLongPolling, u.useFetchStreams))), n = $e(t._databaseId), r = function(t, e, n, r) {
3283
+ new $(i, o, a, u.host, u.ssl, u.experimentalForceLongPolling, u.experimentalAutoDetectLongPolling, u.useFetchStreams))), n = Ze(t._databaseId), r = function(t, e, n, r) {
3278
3284
  return new en(t, e, n, r);
3279
3285
  }(t._authCredentials, t._appCheckCredentials, e, n);
3280
3286
  on.set(t, r);
@@ -3574,7 +3580,7 @@ var pn = function() {
3574
3580
  return n(this, (function(n) {
3575
3581
  switch (n.label) {
3576
3582
  case 0:
3577
- return e = A(t), i = function(t, e) {
3583
+ return e = I(t), i = function(t, e) {
3578
3584
  var n = We(t, e);
3579
3585
  return {
3580
3586
  structuredAggregationQuery: {
@@ -3598,7 +3604,7 @@ var pn = function() {
3598
3604
  }));
3599
3605
  }));
3600
3606
  }(this.datastore, this.query._query).then((function(e) {
3601
- I(void 0 !== e[0]);
3607
+ A(void 0 !== e[0]);
3602
3608
  var n = Object.entries(e[0]).filter((function(t) {
3603
3609
  var e = t[0];
3604
3610
  return t[1], "count_alias" === e;
@@ -3607,7 +3613,7 @@ var pn = function() {
3607
3613
  var n = e[1];
3608
3614
  return t.userDataWriter.convertValue(n);
3609
3615
  }))[0];
3610
- return I("number" == typeof n), Promise.resolve(new dn(t.query, {
3616
+ return A("number" == typeof n), Promise.resolve(new dn(t.query, {
3611
3617
  count: n
3612
3618
  }));
3613
3619
  }));
@@ -3760,7 +3766,7 @@ function _n(t, e) {
3760
3766
  if (t = p(t),
3761
3767
  // We allow omission of 'pathString' but explicitly prohibit passing in both
3762
3768
  // 'undefined' and 'null'.
3763
- 1 === arguments.length && (e = wt.D()), ot("doc", "path", e), t instanceof sn) {
3769
+ 1 === arguments.length && (e = wt.$()), ot("doc", "path", e), t instanceof sn) {
3764
3770
  var o = et.fromString.apply(et, r([ e ], n));
3765
3771
  return at(o), new mn(t,
3766
3772
  /* converter= */ null, new it(o));
@@ -3932,7 +3938,7 @@ var kn = /** @class */ function() {
3932
3938
  * Returns a special sentinel `FieldPath` to refer to the ID of a document.
3933
3939
  * It can be used in queries to sort or filter by the document ID.
3934
3940
  */
3935
- function In() {
3941
+ function An() {
3936
3942
  return new Sn("__name__");
3937
3943
  }
3938
3944
 
@@ -3955,7 +3961,7 @@ function In() {
3955
3961
  /**
3956
3962
  * Sentinel values that can be used when writing document fields with `set()`
3957
3963
  * or `update()`.
3958
- */ var An =
3964
+ */ var In =
3959
3965
  /**
3960
3966
  * @param _methodName - The public API endpoint that returns this class.
3961
3967
  * @hideconstructor
@@ -4133,7 +4139,7 @@ function(t) {
4133
4139
  ot: !0
4134
4140
  });
4135
4141
  }, t.prototype.ht = function(t) {
4136
- return $n(t, this.settings.methodName, this.settings.lt || !1, this.path, this.settings.ft);
4142
+ return Zn(t, this.settings.methodName, this.settings.lt || !1, this.path, this.settings.ft);
4137
4143
  },
4138
4144
  /** Returns 'true' if 'fieldPath' was traversed when creating this context. */ t.prototype.contains = function(t) {
4139
4145
  return void 0 !== this.fieldMask.find((function(e) {
@@ -4151,7 +4157,7 @@ function(t) {
4151
4157
  }, t;
4152
4158
  }(), Rn = /** @class */ function() {
4153
4159
  function t(t, e, n) {
4154
- this.databaseId = t, this.ignoreUndefinedProperties = e, this.L = n || $e(t)
4160
+ this.databaseId = t, this.ignoreUndefinedProperties = e, this.L = n || Ze(t)
4155
4161
  /** Creates a new top-level parse context. */;
4156
4162
  }
4157
4163
  return t.prototype.dt = function(t, e, n, r) {
@@ -4170,7 +4176,7 @@ function(t) {
4170
4176
  * Helper for parsing raw user input (provided via the API) into internal model
4171
4177
  * classes.
4172
4178
  */ function qn(t) {
4173
- var e = t._freezeSettings(), n = $e(t._databaseId);
4179
+ var e = t._freezeSettings(), n = Ze(t._databaseId);
4174
4180
  return new Rn(t._databaseId, !!e.ignoreUndefinedProperties, n);
4175
4181
  }
4176
4182
 
@@ -4189,7 +4195,7 @@ function(t) {
4189
4195
  return u.covers(t.field);
4190
4196
  }));
4191
4197
  } else u = null, s = a.fieldTransforms;
4192
- return new Dn(new Zt(c), u, s);
4198
+ return new Dn(new $t(c), u, s);
4193
4199
  }
4194
4200
 
4195
4201
  var xn = /** @class */ function(e) {
@@ -4204,7 +4210,7 @@ var xn = /** @class */ function(e) {
4204
4210
  }, n.prototype.isEqual = function(t) {
4205
4211
  return t instanceof n;
4206
4212
  }, n;
4207
- }(An);
4213
+ }(In);
4208
4214
 
4209
4215
  /**
4210
4216
  * Creates a child context for parsing SerializableFieldValues.
@@ -4235,11 +4241,11 @@ var jn = /** @class */ function(e) {
4235
4241
  return null !== e && e.apply(this, arguments) || this;
4236
4242
  }
4237
4243
  return t(n, e), n.prototype._toFieldTransform = function(t) {
4238
- return new Ae(t.path, new Ee);
4244
+ return new Ie(t.path, new Ee);
4239
4245
  }, n.prototype.isEqual = function(t) {
4240
4246
  return t instanceof n;
4241
4247
  }, n;
4242
- }(An), Mn = /** @class */ function(e) {
4248
+ }(In), Mn = /** @class */ function(e) {
4243
4249
  function n(t, n) {
4244
4250
  var r = this;
4245
4251
  return (r = e.call(this, t) || this).wt = n, r;
@@ -4249,12 +4255,12 @@ var jn = /** @class */ function(e) {
4249
4255
  /*array=*/ !0), n = this.wt.map((function(t) {
4250
4256
  return Qn(t, e);
4251
4257
  })), r = new ke(n);
4252
- return new Ae(t.path, r);
4258
+ return new Ie(t.path, r);
4253
4259
  }, n.prototype.isEqual = function(t) {
4254
4260
  // TODO(mrschmidt): Implement isEquals
4255
4261
  return this === t;
4256
4262
  }, n;
4257
- }(An), Un = /** @class */ function(e) {
4263
+ }(In), Un = /** @class */ function(e) {
4258
4264
  function n(t, n) {
4259
4265
  var r = this;
4260
4266
  return (r = e.call(this, t) || this).wt = n, r;
@@ -4264,31 +4270,31 @@ var jn = /** @class */ function(e) {
4264
4270
  /*array=*/ !0), n = this.wt.map((function(t) {
4265
4271
  return Qn(t, e);
4266
4272
  })), r = new Se(n);
4267
- return new Ae(t.path, r);
4273
+ return new Ie(t.path, r);
4268
4274
  }, n.prototype.isEqual = function(t) {
4269
4275
  // TODO(mrschmidt): Implement isEquals
4270
4276
  return this === t;
4271
4277
  }, n;
4272
- }(An), Bn = /** @class */ function(e) {
4278
+ }(In), Bn = /** @class */ function(e) {
4273
4279
  function n(t, n) {
4274
4280
  var r = this;
4275
4281
  return (r = e.call(this, t) || this).yt = n, r;
4276
4282
  }
4277
4283
  return t(n, e), n.prototype._toFieldTransform = function(t) {
4278
- var e = new Ie(t.L, _e(t.L, this.yt));
4279
- return new Ae(t.path, e);
4284
+ var e = new Ae(t.L, _e(t.L, this.yt));
4285
+ return new Ie(t.path, e);
4280
4286
  }, n.prototype.isEqual = function(t) {
4281
4287
  // TODO(mrschmidt): Implement isEquals
4282
4288
  return this === t;
4283
4289
  }, n;
4284
- }(An);
4290
+ }(In);
4285
4291
 
4286
4292
  /** Parse update data from an update() call. */ function zn(t, e, n, r) {
4287
4293
  var i = t.dt(1 /* Update */ , e, n);
4288
4294
  Hn("Data must be an object, but it was:", i, r);
4289
- var o = [], a = Zt.empty();
4295
+ var o = [], a = $t.empty();
4290
4296
  St(r, (function(t, r) {
4291
- var u = Zn(e, t, n);
4297
+ var u = $n(e, t, n);
4292
4298
  // For Compat types, we have to "extract" the underlying types before
4293
4299
  // performing validation.
4294
4300
  r = p(r);
@@ -4310,7 +4316,7 @@ var jn = /** @class */ function(e) {
4310
4316
  for (var c = 0; c < o.length; c += 2) u.push(Xn(e, o[c])), s.push(o[c + 1]);
4311
4317
  // We iterate in reverse order to pick the last value for a field if the
4312
4318
  // user specified the field multiple times.
4313
- for (var l = [], f = Zt.empty(), h = u.length - 1; h >= 0; --h) if (!tr(l, u[h])) {
4319
+ for (var l = [], f = $t.empty(), h = u.length - 1; h >= 0; --h) if (!tr(l, u[h])) {
4314
4320
  var d = u[h], y = s[h];
4315
4321
  // For Compat types, we have to "extract" the underlying types before
4316
4322
  // performing validation.
@@ -4350,7 +4356,7 @@ var jn = /** @class */ function(e) {
4350
4356
  // Unwrap the API type from the Compat SDK. This will return the API type
4351
4357
  // from firestore-exp.
4352
4358
  t = p(t))) return Hn("Unsupported field value:", e, t), Wn(t, e);
4353
- if (t instanceof An)
4359
+ if (t instanceof In)
4354
4360
  // FieldValues usually parse into transforms (except deleteField())
4355
4361
  // in which case we do not want to include this field in our parsed data
4356
4362
  // (as doing so will overwrite the field directly prior to the transform
@@ -4465,7 +4471,7 @@ function Wn(t, e) {
4465
4471
  }
4466
4472
 
4467
4473
  function Yn(t) {
4468
- return !("object" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof Tt || t instanceof Vn || t instanceof kn || t instanceof mn || t instanceof An);
4474
+ return !("object" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof Tt || t instanceof Vn || t instanceof kn || t instanceof mn || t instanceof In);
4469
4475
  }
4470
4476
 
4471
4477
  function Hn(t, e, n) {
@@ -4484,8 +4490,8 @@ function Hn(t, e, n) {
4484
4490
  // If required, replace the FieldPath Compat class with with the firestore-exp
4485
4491
  // FieldPath.
4486
4492
  (e = p(e)) instanceof Sn) return e._internalPath;
4487
- if ("string" == typeof e) return Zn(t, e);
4488
- throw $n("Field path arguments must be of type string or ", t,
4493
+ if ("string" == typeof e) return $n(t, e);
4494
+ throw Zn("Field path arguments must be of type string or ", t,
4489
4495
  /* hasConverter= */ !1,
4490
4496
  /* path= */ void 0, n);
4491
4497
  }
@@ -4502,20 +4508,20 @@ function Hn(t, e, n) {
4502
4508
  * split on dots.
4503
4509
  * @param targetDoc - The document against which the field path will be
4504
4510
  * evaluated.
4505
- */ function Zn(t, e, n) {
4506
- if (e.search(Jn) >= 0) throw $n("Invalid field path (" + e + "). Paths must not contain '~', '*', '/', '[', or ']'", t,
4511
+ */ function $n(t, e, n) {
4512
+ if (e.search(Jn) >= 0) throw Zn("Invalid field path (" + e + "). Paths must not contain '~', '*', '/', '[', or ']'", t,
4507
4513
  /* hasConverter= */ !1,
4508
4514
  /* path= */ void 0, n);
4509
4515
  try {
4510
4516
  return (new (Sn.bind.apply(Sn, r([ void 0 ], e.split(".")))))._internalPath;
4511
4517
  } catch (r) {
4512
- throw $n("Invalid field path (" + e + "). Paths must not be empty, begin with '.', end with '.', or contain '..'", t,
4518
+ throw Zn("Invalid field path (" + e + "). Paths must not be empty, begin with '.', end with '.', or contain '..'", t,
4513
4519
  /* hasConverter= */ !1,
4514
4520
  /* path= */ void 0, n);
4515
4521
  }
4516
4522
  }
4517
4523
 
4518
- function $n(t, e, n, r, i) {
4524
+ function Zn(t, e, n, r, i) {
4519
4525
  var o = r && !r.isEmpty(), a = void 0 !== i, u = "Function " + e + "() called with invalid data";
4520
4526
  n && (u += " (via `toFirestore()`)");
4521
4527
  var s = "";
@@ -4698,7 +4704,7 @@ function ir(t, e) {
4698
4704
  }
4699
4705
 
4700
4706
  function or(t, e) {
4701
- return "string" == typeof e ? Zn(t, e) : e instanceof Sn ? e._internalPath : e._delegate._internalPath;
4707
+ return "string" == typeof e ? $n(t, e) : e instanceof Sn ? e._internalPath : e._delegate._internalPath;
4702
4708
  }
4703
4709
 
4704
4710
  /**
@@ -5091,7 +5097,7 @@ function kr(t, e, n) {
5091
5097
  return t ? n && (n.merge || n.mergeFields) ? t.toFirestore(e, n) : t.toFirestore(e) : e;
5092
5098
  }
5093
5099
 
5094
- var Ir = /** @class */ function(e) {
5100
+ var Ar = /** @class */ function(e) {
5095
5101
  function n(t) {
5096
5102
  var n = this;
5097
5103
  return (n = e.call(this) || this).firestore = t, n;
@@ -5171,8 +5177,8 @@ var Ir = /** @class */ function(e) {
5171
5177
  return new Tt(e.seconds, e.nanos);
5172
5178
  }, t.prototype.convertDocumentKey = function(t, e) {
5173
5179
  var n = et.fromString(t);
5174
- I(Ze(n));
5175
- var r = new $(n.get(1), n.get(3)), i = new it(n.popFirst(5));
5180
+ A($e(n));
5181
+ var r = new Z(n.get(1), n.get(3)), i = new it(n.popFirst(5));
5176
5182
  return r.isEqual(e) ||
5177
5183
  // TODO(b/64130202): Somehow support foreign references.
5178
5184
  T("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."),
@@ -5192,10 +5198,10 @@ var Ir = /** @class */ function(e) {
5192
5198
  * @param reference - The reference of the document to fetch.
5193
5199
  * @returns A Promise resolved with a `DocumentSnapshot` containing the current
5194
5200
  * document contents.
5195
- */ function Ar(t) {
5196
- var e = an((t = ct(t, mn)).firestore), n = new Ir(t.firestore);
5201
+ */ function Ir(t) {
5202
+ var e = an((t = ct(t, mn)).firestore), n = new Ar(t.firestore);
5197
5203
  return rn(e, [ t._key ]).then((function(e) {
5198
- I(1 === e.length);
5204
+ A(1 === e.length);
5199
5205
  var r = e[0];
5200
5206
  return new er(t.firestore, n, t._key, r.isFoundDocument() ? r : null, t.converter);
5201
5207
  }));
@@ -5216,14 +5222,14 @@ var Ir = /** @class */ function(e) {
5216
5222
  !function(t) {
5217
5223
  if ("L" /* Last */ === t.limitType && 0 === t.explicitOrderBy.length) throw new B(j, "limitToLast() queries require specifying at least one orderBy() clause");
5218
5224
  }((t = ct(t, vn))._query);
5219
- var r = an(t.firestore), i = new Ir(t.firestore);
5225
+ var r = an(t.firestore), i = new Ar(t.firestore);
5220
5226
  return function(t, r) {
5221
5227
  return e(this, void 0, void 0, (function() {
5222
5228
  var e, i;
5223
5229
  return n(this, (function(n) {
5224
5230
  switch (n.label) {
5225
5231
  case 0:
5226
- return e = A(t), i = We(e.L, be(r)), [ 4 /*yield*/ , e.P("RunQuery", i.parent, {
5232
+ return e = I(t), i = We(e.L, be(r)), [ 4 /*yield*/ , e.P("RunQuery", i.parent, {
5227
5233
  structuredQuery: i.structuredQuery
5228
5234
  }) ];
5229
5235
 
@@ -5232,12 +5238,12 @@ var Ir = /** @class */ function(e) {
5232
5238
  return !!t.document;
5233
5239
  })).map((function(t) {
5234
5240
  return function(t, e, n) {
5235
- var r = ze(t, e.name), i = Me(e.updateTime), o = new Zt({
5241
+ var r = ze(t, e.name), i = Me(e.updateTime), o = new $t({
5236
5242
  mapValue: {
5237
5243
  fields: e.fields
5238
5244
  }
5239
5245
  });
5240
- return $t.newFoundDocument(r, i, o);
5246
+ return Zt.newFoundDocument(r, i, o);
5241
5247
  }(e.L, t.document);
5242
5248
  })) ];
5243
5249
  }
@@ -5335,7 +5341,7 @@ function Dr(t, e, n) {
5335
5341
  * retrieved from `snapshot.data().count`, where `snapshot` is the
5336
5342
  * `AggregateQuerySnapshot` to which the returned Promise resolves.
5337
5343
  */ function Or(t) {
5338
- var e = ct(t.firestore, sn), n = an(e), r = new Ir(e);
5344
+ var e = ct(t.firestore, sn), n = an(e), r = new Ar(e);
5339
5345
  return new yn(t, n, r).run();
5340
5346
  }
5341
5347
 
@@ -5697,11 +5703,11 @@ function Ur(t, e) {
5697
5703
  return t.commit().then((function() {
5698
5704
  r.deferred.resolve(e);
5699
5705
  })).catch((function(t) {
5700
- r.Dt(t);
5706
+ r.$t(t);
5701
5707
  }));
5702
5708
  }));
5703
5709
  })).catch((function(t) {
5704
- r.Dt(t);
5710
+ r.$t(t);
5705
5711
  })), [ 2 /*return*/ ];
5706
5712
  }));
5707
5713
  }));
@@ -5715,17 +5721,17 @@ function Ur(t, e) {
5715
5721
  // Do not retry errors thrown by user provided updateFunction.
5716
5722
  return this.deferred.reject(t), null;
5717
5723
  }
5718
- }, t.prototype.Dt = function(t) {
5724
+ }, t.prototype.$t = function(t) {
5719
5725
  var e = this;
5720
- this.Rt > 0 && this.$t(t) ? (this.Rt -= 1, this.asyncQueue.enqueueAndForget((function() {
5726
+ this.Rt > 0 && this.Dt(t) ? (this.Rt -= 1, this.asyncQueue.enqueueAndForget((function() {
5721
5727
  return e.Vt(), Promise.resolve();
5722
5728
  }))) : this.deferred.reject(t);
5723
- }, t.prototype.$t = function(t) {
5729
+ }, t.prototype.Dt = function(t) {
5724
5730
  if ("FirebaseError" === t.name) {
5725
5731
  // In transactions, the backend will fail outdated reads with FAILED_PRECONDITION and
5726
5732
  // non-matching document versions with ABORTED. These errors should be retried.
5727
5733
  var e = t.code;
5728
- return "aborted" === e || "failed-precondition" === e || !
5734
+ return "aborted" === e || "failed-precondition" === e || "already-exists" === e || !
5729
5735
  /**
5730
5736
  * Determines whether an error code represents a permanent error when received
5731
5737
  * in response to a non-write operation.
@@ -6137,7 +6143,7 @@ function Ur(t, e) {
6137
6143
  */;
6138
6144
  }
6139
6145
  return t.prototype.get = function(t) {
6140
- var e = this, n = Ur(t, this._firestore), r = new Ir(this._firestore);
6146
+ var e = this, n = Ur(t, this._firestore), r = new Ar(this._firestore);
6141
6147
  return this._transaction.lookup([ n._key ]).then((function(t) {
6142
6148
  if (!t || 1 !== t.length) return S();
6143
6149
  var i = t[0];
@@ -6225,12 +6231,12 @@ function Xr(t, e, n) {
6225
6231
  g = i + "_lite", o(new c("firestore/lite", (function(t, e) {
6226
6232
  var n = e.instanceIdentifier, r = e.options, i = t.getProvider("app").getImmediate(), o = new sn(new W(t.getProvider("auth-internal")), new J(t.getProvider("app-check-internal")), function(t, e) {
6227
6233
  if (!Object.prototype.hasOwnProperty.apply(t.options, [ "projectId" ])) throw new B(D, '"projectId" not provided in firebase.initializeApp.');
6228
- return new $(t.options.projectId, e);
6234
+ return new Z(t.options.projectId, e);
6229
6235
  }(i, n), i);
6230
6236
  return r && o._setSettings(r), o;
6231
6237
  }), "PUBLIC").setMultipleInstances(!0)),
6232
6238
  // RUNTIME_ENV and BUILD_TARGET are replaced by real values during the compilation
6233
- a("firestore-lite", "3.7.2", ""), a("firestore-lite", "3.7.2", "esm5");
6239
+ a("firestore-lite", "3.7.3-20221109210852", ""), a("firestore-lite", "3.7.3-20221109210852", "esm5");
6234
6240
 
6235
- export { pn as AggregateField, dn as AggregateQuerySnapshot, kn as Bytes, gn as CollectionReference, mn as DocumentReference, er as DocumentSnapshot, Sn as FieldPath, An as FieldValue, sn as Firestore, B as FirestoreError, Vn as GeoPoint, vn as Query, ar as QueryConstraint, nr as QueryDocumentSnapshot, rr as QuerySnapshot, Tt as Timestamp, Hr as Transaction, Mr as WriteBatch, Nr as addDoc, Rr as aggregateQuerySnapshotEqual, Cr as arrayRemove, xr as arrayUnion, wn as collection, bn as collectionGroup, fn as connectFirestoreEmulator, Fr as deleteDoc, qr as deleteField, _n as doc, In as documentId, br as endAt, wr as endBefore, Or as getCount, Ar as getDoc, Vr as getDocs, ln as getFirestore, jr as increment, cn as initializeFirestore, pr as limit, dr as limitToLast, fr as orderBy, ur as query, En as queryEqual, Tn as refEqual, Xr as runTransaction, Lr as serverTimestamp, Pr as setDoc, b as setLogLevel, ir as snapshotEqual, vr as startAfter, mr as startAt, hn as terminate, Dr as updateDoc, cr as where, Br as writeBatch };
6241
+ export { pn as AggregateField, dn as AggregateQuerySnapshot, kn as Bytes, gn as CollectionReference, mn as DocumentReference, er as DocumentSnapshot, Sn as FieldPath, In as FieldValue, sn as Firestore, B as FirestoreError, Vn as GeoPoint, vn as Query, ar as QueryConstraint, nr as QueryDocumentSnapshot, rr as QuerySnapshot, Tt as Timestamp, Hr as Transaction, Mr as WriteBatch, Nr as addDoc, Rr as aggregateQuerySnapshotEqual, Cr as arrayRemove, xr as arrayUnion, wn as collection, bn as collectionGroup, fn as connectFirestoreEmulator, Fr as deleteDoc, qr as deleteField, _n as doc, An as documentId, br as endAt, wr as endBefore, Or as getCount, Ir as getDoc, Vr as getDocs, ln as getFirestore, jr as increment, cn as initializeFirestore, pr as limit, dr as limitToLast, fr as orderBy, ur as query, En as queryEqual, Tn as refEqual, Xr as runTransaction, Lr as serverTimestamp, Pr as setDoc, b as setLogLevel, ir as snapshotEqual, vr as startAfter, mr as startAt, hn as terminate, Dr as updateDoc, cr as where, Br as writeBatch };
6236
6242
  //# sourceMappingURL=index.browser.esm5.js.map