@firebase/firestore 3.4.7 → 3.4.8-canary.19e31a231

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 (97) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/firestore/src/core/query.d.ts +2 -4
  3. package/dist/firestore/src/core/target.d.ts +6 -4
  4. package/dist/firestore/src/local/index_manager.d.ts +27 -5
  5. package/dist/firestore/src/local/indexeddb_index_manager.d.ts +15 -10
  6. package/dist/firestore/src/local/indexeddb_remote_document_cache.d.ts +9 -0
  7. package/dist/firestore/src/local/indexeddb_schema.d.ts +8 -2
  8. package/dist/firestore/src/local/indexeddb_sentinels.d.ts +9 -2
  9. package/dist/firestore/src/local/local_documents_view.d.ts +1 -1
  10. package/dist/firestore/src/local/memory_index_manager.d.ts +6 -4
  11. package/dist/firestore/src/local/query_engine.d.ts +44 -5
  12. package/dist/firestore/src/local/simple_db.d.ts +2 -0
  13. package/dist/firestore/src/model/collections.d.ts +1 -1
  14. package/dist/firestore/src/model/field_index.d.ts +6 -0
  15. package/dist/firestore/src/model/values.d.ts +14 -2
  16. package/dist/firestore/src/util/misc.d.ts +3 -0
  17. package/dist/firestore/test/unit/local/counting_query_engine.d.ts +2 -1
  18. package/dist/firestore/test/unit/local/test_index_manager.d.ts +5 -4
  19. package/dist/firestore/test/unit/local/test_remote_document_cache.d.ts +0 -4
  20. package/dist/index.esm2017.js +4649 -4498
  21. package/dist/index.esm2017.js.map +1 -1
  22. package/dist/index.esm5.js +4941 -4800
  23. package/dist/index.esm5.js.map +1 -1
  24. package/dist/index.node.cjs.js +1764 -1577
  25. package/dist/index.node.cjs.js.map +1 -1
  26. package/dist/index.node.mjs +1764 -1577
  27. package/dist/index.node.mjs.map +1 -1
  28. package/dist/index.rn.js +4495 -4344
  29. package/dist/index.rn.js.map +1 -1
  30. package/dist/internal.d.ts +26 -4
  31. package/dist/lite/firestore/src/core/query.d.ts +2 -4
  32. package/dist/lite/firestore/src/core/target.d.ts +6 -4
  33. package/dist/lite/firestore/src/local/index_manager.d.ts +27 -5
  34. package/dist/lite/firestore/src/local/indexeddb_index_manager.d.ts +15 -10
  35. package/dist/lite/firestore/src/local/indexeddb_remote_document_cache.d.ts +9 -0
  36. package/dist/lite/firestore/src/local/indexeddb_schema.d.ts +8 -2
  37. package/dist/lite/firestore/src/local/indexeddb_sentinels.d.ts +9 -2
  38. package/dist/lite/firestore/src/local/local_documents_view.d.ts +1 -1
  39. package/dist/lite/firestore/src/local/memory_index_manager.d.ts +6 -4
  40. package/dist/lite/firestore/src/local/query_engine.d.ts +44 -5
  41. package/dist/lite/firestore/src/local/simple_db.d.ts +2 -0
  42. package/dist/lite/firestore/src/model/collections.d.ts +1 -1
  43. package/dist/lite/firestore/src/model/field_index.d.ts +6 -0
  44. package/dist/lite/firestore/src/model/values.d.ts +14 -2
  45. package/dist/lite/firestore/src/util/misc.d.ts +3 -0
  46. package/dist/lite/firestore/test/unit/local/counting_query_engine.d.ts +2 -1
  47. package/dist/lite/firestore/test/unit/local/test_index_manager.d.ts +5 -4
  48. package/dist/lite/firestore/test/unit/local/test_remote_document_cache.d.ts +0 -4
  49. package/dist/lite/index.browser.esm2017.js +123 -117
  50. package/dist/lite/index.browser.esm2017.js.map +1 -1
  51. package/dist/lite/index.browser.esm5.js +203 -197
  52. package/dist/lite/index.browser.esm5.js.map +1 -1
  53. package/dist/lite/index.node.cjs.js +24 -10
  54. package/dist/lite/index.node.cjs.js.map +1 -1
  55. package/dist/lite/index.node.mjs +24 -10
  56. package/dist/lite/index.node.mjs.map +1 -1
  57. package/dist/lite/index.rn.esm2017.js +1155 -1149
  58. package/dist/lite/index.rn.esm2017.js.map +1 -1
  59. package/dist/lite/packages/firestore/src/core/query.d.ts +2 -4
  60. package/dist/lite/packages/firestore/src/core/target.d.ts +6 -4
  61. package/dist/lite/packages/firestore/src/local/index_manager.d.ts +27 -5
  62. package/dist/lite/packages/firestore/src/local/indexeddb_index_manager.d.ts +15 -10
  63. package/dist/lite/packages/firestore/src/local/indexeddb_remote_document_cache.d.ts +9 -0
  64. package/dist/lite/packages/firestore/src/local/indexeddb_schema.d.ts +8 -2
  65. package/dist/lite/packages/firestore/src/local/indexeddb_sentinels.d.ts +9 -2
  66. package/dist/lite/packages/firestore/src/local/local_documents_view.d.ts +1 -1
  67. package/dist/lite/packages/firestore/src/local/memory_index_manager.d.ts +6 -4
  68. package/dist/lite/packages/firestore/src/local/query_engine.d.ts +44 -5
  69. package/dist/lite/packages/firestore/src/local/simple_db.d.ts +2 -0
  70. package/dist/lite/packages/firestore/src/model/collections.d.ts +1 -1
  71. package/dist/lite/packages/firestore/src/model/field_index.d.ts +6 -0
  72. package/dist/lite/packages/firestore/src/model/values.d.ts +14 -2
  73. package/dist/lite/packages/firestore/src/util/misc.d.ts +3 -0
  74. package/dist/lite/packages/firestore/test/unit/local/counting_query_engine.d.ts +2 -1
  75. package/dist/lite/packages/firestore/test/unit/local/test_index_manager.d.ts +5 -4
  76. package/dist/lite/packages/firestore/test/unit/local/test_remote_document_cache.d.ts +0 -4
  77. package/dist/packages/firestore/dist/index.esm2017.d.ts +171 -171
  78. package/dist/packages/firestore/src/core/query.d.ts +2 -4
  79. package/dist/packages/firestore/src/core/target.d.ts +6 -4
  80. package/dist/packages/firestore/src/local/index_manager.d.ts +27 -5
  81. package/dist/packages/firestore/src/local/indexeddb_index_manager.d.ts +15 -10
  82. package/dist/packages/firestore/src/local/indexeddb_remote_document_cache.d.ts +9 -0
  83. package/dist/packages/firestore/src/local/indexeddb_schema.d.ts +8 -2
  84. package/dist/packages/firestore/src/local/indexeddb_sentinels.d.ts +9 -2
  85. package/dist/packages/firestore/src/local/local_documents_view.d.ts +1 -1
  86. package/dist/packages/firestore/src/local/memory_index_manager.d.ts +6 -4
  87. package/dist/packages/firestore/src/local/query_engine.d.ts +44 -5
  88. package/dist/packages/firestore/src/local/simple_db.d.ts +2 -0
  89. package/dist/packages/firestore/src/model/collections.d.ts +1 -1
  90. package/dist/packages/firestore/src/model/field_index.d.ts +6 -0
  91. package/dist/packages/firestore/src/model/values.d.ts +14 -2
  92. package/dist/packages/firestore/src/util/misc.d.ts +3 -0
  93. package/dist/packages/firestore/test/unit/local/counting_query_engine.d.ts +2 -1
  94. package/dist/packages/firestore/test/unit/local/test_index_manager.d.ts +5 -4
  95. package/dist/packages/firestore/test/unit/local/test_remote_document_cache.d.ts +0 -4
  96. package/dist/private.d.ts +26 -4
  97. package/package.json +9 -9
@@ -67,7 +67,7 @@ m.MOCK_USER = new m("mock-user");
67
67
  * See the License for the specific language governing permissions and
68
68
  * limitations under the License.
69
69
  */
70
- var y = "9.6.10", v = new l("@firebase/firestore");
70
+ var y = "9.6.11-canary.19e31a231", v = new l("@firebase/firestore");
71
71
 
72
72
  /**
73
73
  * @license
@@ -225,7 +225,7 @@ e) {
225
225
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
226
226
  * See the License for the specific language governing permissions and
227
227
  * limitations under the License.
228
- */ var A = "cancelled", k = "unknown", V = "invalid-argument", D = "deadline-exceeded", P = "not-found", N = "permission-denied", q = "unauthenticated", F = "resource-exhausted", O = "failed-precondition", C = "aborted", L = "out-of-range", j = "unimplemented", R = "internal", M = "unavailable", x = /** @class */ function(e) {
228
+ */ var A = "cancelled", k = "unknown", V = "invalid-argument", D = "deadline-exceeded", P = "not-found", N = "permission-denied", q = "unauthenticated", F = "resource-exhausted", O = "failed-precondition", C = "aborted", L = "out-of-range", j = "unimplemented", R = "internal", x = "unavailable", M = /** @class */ function(e) {
229
229
  /** @hideconstructor */
230
230
  function n(
231
231
  /**
@@ -446,7 +446,7 @@ function(t, e, n, r, i, o, a, s) {
446
446
  // for legacy reasons and should not be used frequently).
447
447
  for (var r = [], i = 0, o = t; i < o.length; i++) {
448
448
  var a = o[i];
449
- if (a.indexOf("//") >= 0) throw new x(V, "Invalid segment (" + a + "). Paths must not contain // in them.");
449
+ if (a.indexOf("//") >= 0) throw new M(V, "Invalid segment (" + a + "). Paths must not contain // in them.");
450
450
  // Strip leading and traling slashed.
451
451
  r.push.apply(r, a.split("/").filter((function(t) {
452
452
  return t.length > 0;
@@ -501,18 +501,18 @@ function(t, e, n, r, i, o, a, s) {
501
501
  */
502
502
  n.fromServerFormat = function(t) {
503
503
  for (var e = [], r = "", i = 0, o = function() {
504
- if (0 === r.length) throw new x(V, "Invalid field path (" + t + "). Paths must not be empty, begin with '.', end with '.', or contain '..'");
504
+ if (0 === r.length) throw new M(V, "Invalid field path (" + t + "). Paths must not be empty, begin with '.', end with '.', or contain '..'");
505
505
  e.push(r), r = "";
506
506
  }, a = !1; i < t.length; ) {
507
507
  var s = t[i];
508
508
  if ("\\" === s) {
509
- if (i + 1 === t.length) throw new x(V, "Path has trailing escape character: " + t);
509
+ if (i + 1 === t.length) throw new M(V, "Path has trailing escape character: " + t);
510
510
  var u = t[i + 1];
511
- if ("\\" !== u && "." !== u && "`" !== u) throw new x(V, "Path has invalid escape sequence: " + t);
511
+ if ("\\" !== u && "." !== u && "`" !== u) throw new M(V, "Path has invalid escape sequence: " + t);
512
512
  r += u, i += 2;
513
513
  } else "`" === s ? (a = !a, i++) : "." !== s || a ? (r += s, i++) : (o(), i++);
514
514
  }
515
- if (o(), a) throw new x(V, "Unterminated ` in path: " + t);
515
+ if (o(), a) throw new M(V, "Unterminated ` in path: " + t);
516
516
  return new n(e);
517
517
  }, n.emptyPath = function() {
518
518
  return new n([]);
@@ -580,7 +580,7 @@ function(t, e, n, r, i, o, a, s) {
580
580
  * limitations under the License.
581
581
  */
582
582
  function rt(t, e, n) {
583
- if (!n) throw new x(V, "Function " + t + "() cannot be called with an empty " + e + ".");
583
+ if (!n) throw new M(V, "Function " + t + "() cannot be called with an empty " + e + ".");
584
584
  }
585
585
 
586
586
  /**
@@ -591,14 +591,14 @@ function rt(t, e, n) {
591
591
  * Validates that `path` refers to a document (indicated by the fact it contains
592
592
  * an even numbers of segments).
593
593
  */ function it(t) {
594
- if (!nt.isDocumentKey(t)) throw new x(V, "Invalid document reference. Document references must have an even number of segments, but " + t + " has " + t.length + ".");
594
+ if (!nt.isDocumentKey(t)) throw new M(V, "Invalid document reference. Document references must have an even number of segments, but " + t + " has " + t.length + ".");
595
595
  }
596
596
 
597
597
  /**
598
598
  * Validates that `path` refers to a collection (indicated by the fact it
599
599
  * contains an odd numbers of segments).
600
600
  */ function ot(t) {
601
- if (nt.isDocumentKey(t)) throw new x(V, "Invalid collection reference. Collection references must have an odd number of segments, but " + t + " has " + t.length + ".");
601
+ if (nt.isDocumentKey(t)) throw new M(V, "Invalid collection reference. Collection references must have an odd number of segments, but " + t + " has " + t.length + ".");
602
602
  }
603
603
 
604
604
  /**
@@ -630,15 +630,15 @@ e) {
630
630
  // Unwrap Compat types
631
631
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
632
632
  t = t._delegate), !(t instanceof e)) {
633
- if (e.name === t.constructor.name) throw new x(V, "Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");
633
+ if (e.name === t.constructor.name) throw new M(V, "Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");
634
634
  var n = at(t);
635
- throw new x(V, "Expected type '" + e.name + "', but it was: " + n);
635
+ throw new M(V, "Expected type '" + e.name + "', but it was: " + n);
636
636
  }
637
637
  return t;
638
638
  }
639
639
 
640
640
  function ut(t, e) {
641
- if (e <= 0) throw new x(V, "Function " + t + "() requires a positive number, but it was: " + e + ".");
641
+ if (e <= 0) throw new M(V, "Function " + t + "() requires a positive number, but it was: " + e + ".");
642
642
  }
643
643
 
644
644
  /**
@@ -794,7 +794,7 @@ function dt(t) {
794
794
 
795
795
  case 503:
796
796
  // Service Unavailable
797
- return M;
797
+ return x;
798
798
 
799
799
  case 504:
800
800
  // Gateway Timeout
@@ -867,10 +867,10 @@ var mt = /** @class */ function(r) {
867
867
  return e = n.sent(), [ 3 /*break*/ , 4 ];
868
868
 
869
869
  case 3:
870
- throw a = n.sent(), new x(dt(a.status), "Request failed with error: " + a.statusText);
870
+ throw a = n.sent(), new M(dt(a.status), "Request failed with error: " + a.statusText);
871
871
 
872
872
  case 4:
873
- if (!e.ok) throw new x(dt(e.status), "Request failed with error: " + e.statusText);
873
+ if (!e.ok) throw new M(dt(e.status), "Request failed with error: " + e.statusText);
874
874
  return [ 2 /*return*/ , e.json() ];
875
875
  }
876
876
  }));
@@ -1058,11 +1058,11 @@ function gt(t, e) {
1058
1058
  * The fractions of a second at nanosecond resolution.*
1059
1059
  */
1060
1060
  e) {
1061
- if (this.seconds = t, this.nanoseconds = e, e < 0) throw new x(V, "Timestamp nanoseconds out of range: " + e);
1062
- if (e >= 1e9) throw new x(V, "Timestamp nanoseconds out of range: " + e);
1063
- if (t < -62135596800) throw new x(V, "Timestamp seconds out of range: " + t);
1061
+ if (this.seconds = t, this.nanoseconds = e, e < 0) throw new M(V, "Timestamp nanoseconds out of range: " + e);
1062
+ if (e >= 1e9) throw new M(V, "Timestamp nanoseconds out of range: " + e);
1063
+ if (t < -62135596800) throw new M(V, "Timestamp seconds out of range: " + t);
1064
1064
  // This will break in the year 10,000.
1065
- if (t >= 253402300800) throw new x(V, "Timestamp seconds out of range: " + t);
1065
+ if (t >= 253402300800) throw new M(V, "Timestamp seconds out of range: " + t);
1066
1066
  }
1067
1067
  /**
1068
1068
  * Creates a new timestamp with the current date, with millisecond precision.
@@ -1475,19 +1475,26 @@ var At = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
1475
1475
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1476
1476
  * See the License for the specific language governing permissions and
1477
1477
  * limitations under the License.
1478
- */
1479
- /** Extracts the backend's type order for the provided value. */ function Ft(t) {
1478
+ */ var Ft = {
1479
+ fields: {
1480
+ __type__: {
1481
+ stringValue: "__max__"
1482
+ }
1483
+ }
1484
+ };
1485
+
1486
+ /** Extracts the backend's type order for the provided value. */ function Ot(t) {
1480
1487
  return "nullValue" in t ? 0 /* NullValue */ : "booleanValue" in t ? 1 /* BooleanValue */ : "integerValue" in t || "doubleValue" in t ? 2 /* NumberValue */ : "timestampValue" in t ? 3 /* TimestampValue */ : "stringValue" in t ? 5 /* StringValue */ : "bytesValue" in t ? 6 /* BlobValue */ : "referenceValue" in t ? 7 /* RefValue */ : "geoPointValue" in t ? 8 /* GeoPointValue */ : "arrayValue" in t ? 9 /* ArrayValue */ : "mapValue" in t ? Pt(t) ? 4 /* ServerTimestampValue */ :
1481
1488
  /** Returns true if the Value represents the canonical {@link #MAX_VALUE} . */
1482
1489
  function(t) {
1483
1490
  return "__max__" === (((t.mapValue || {}).fields || {}).__type__ || {}).stringValue;
1484
- }(t) ? 9 /* ArrayValue */ : 10 /* ObjectValue */ : S();
1491
+ }(t) ? 9007199254740991 /* MaxValue */ : 10 /* ObjectValue */ : S();
1485
1492
  }
1486
1493
 
1487
- /** Tests `left` and `right` for equality based on the backend semantics. */ function Ot(t, e) {
1494
+ /** Tests `left` and `right` for equality based on the backend semantics. */ function Ct(t, e) {
1488
1495
  if (t === e) return !0;
1489
- var n = Ft(t);
1490
- if (n !== Ft(e)) return !1;
1496
+ var n = Ot(t);
1497
+ if (n !== Ot(e)) return !1;
1491
1498
  switch (n) {
1492
1499
  case 0 /* NullValue */ :
1493
1500
  case 9007199254740991 /* MaxValue */ :
@@ -1535,13 +1542,13 @@ var At = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
1535
1542
  }(t, e);
1536
1543
 
1537
1544
  case 9 /* ArrayValue */ :
1538
- return wt(t.arrayValue.values || [], e.arrayValue.values || [], Ot);
1545
+ return wt(t.arrayValue.values || [], e.arrayValue.values || [], Ct);
1539
1546
 
1540
1547
  case 10 /* ObjectValue */ :
1541
1548
  return function(t, e) {
1542
1549
  var n = t.mapValue.fields || {}, r = e.mapValue.fields || {};
1543
1550
  if (Tt(n) !== Tt(r)) return !1;
1544
- for (var i in n) if (n.hasOwnProperty(i) && (void 0 === r[i] || !Ot(n[i], r[i]))) return !1;
1551
+ for (var i in n) if (n.hasOwnProperty(i) && (void 0 === r[i] || !Ct(n[i], r[i]))) return !1;
1545
1552
  return !0;
1546
1553
  }(t, e);
1547
1554
 
@@ -1550,15 +1557,15 @@ var At = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
1550
1557
  }
1551
1558
  }
1552
1559
 
1553
- function Ct(t, e) {
1560
+ function Lt(t, e) {
1554
1561
  return void 0 !== (t.values || []).find((function(t) {
1555
- return Ot(t, e);
1562
+ return Ct(t, e);
1556
1563
  }));
1557
1564
  }
1558
1565
 
1559
- function Lt(t, e) {
1566
+ function jt(t, e) {
1560
1567
  if (t === e) return 0;
1561
- var n = Ft(t), r = Ft(e);
1568
+ var n = Ot(t), r = Ot(e);
1562
1569
  if (n !== r) return gt(n, r);
1563
1570
  switch (n) {
1564
1571
  case 0 /* NullValue */ :
@@ -1577,10 +1584,10 @@ function Lt(t, e) {
1577
1584
  }(t, e);
1578
1585
 
1579
1586
  case 3 /* TimestampValue */ :
1580
- return jt(t.timestampValue, e.timestampValue);
1587
+ return Rt(t.timestampValue, e.timestampValue);
1581
1588
 
1582
1589
  case 4 /* ServerTimestampValue */ :
1583
- return jt(qt(t), qt(e));
1590
+ return Rt(qt(t), qt(e));
1584
1591
 
1585
1592
  case 5 /* StringValue */ :
1586
1593
  return gt(t.stringValue, e.stringValue);
@@ -1609,7 +1616,7 @@ function Lt(t, e) {
1609
1616
  case 9 /* ArrayValue */ :
1610
1617
  return function(t, e) {
1611
1618
  for (var n = t.values || [], r = e.values || [], i = 0; i < n.length && i < r.length; ++i) {
1612
- var o = Lt(n[i], r[i]);
1619
+ var o = jt(n[i], r[i]);
1613
1620
  if (o) return o;
1614
1621
  }
1615
1622
  return gt(n.length, r.length);
@@ -1617,6 +1624,9 @@ function Lt(t, e) {
1617
1624
 
1618
1625
  case 10 /* ObjectValue */ :
1619
1626
  return function(t, e) {
1627
+ if (t === Ft && e === Ft) return 0;
1628
+ if (t === Ft) return 1;
1629
+ if (e === Ft) return -1;
1620
1630
  var n = t.fields || {}, r = Object.keys(n), i = e.fields || {}, o = Object.keys(i);
1621
1631
  // Even though MapValues are likely sorted correctly based on their insertion
1622
1632
  // order (e.g. when received from the backend), local modifications can bring
@@ -1626,7 +1636,7 @@ function Lt(t, e) {
1626
1636
  for (var a = 0; a < r.length && a < o.length; ++a) {
1627
1637
  var s = gt(r[a], o[a]);
1628
1638
  if (0 !== s) return s;
1629
- var u = Lt(n[r[a]], i[o[a]]);
1639
+ var u = jt(n[r[a]], i[o[a]]);
1630
1640
  if (0 !== u) return u;
1631
1641
  }
1632
1642
  return gt(r.length, o.length);
@@ -1637,13 +1647,13 @@ function Lt(t, e) {
1637
1647
  }
1638
1648
  }
1639
1649
 
1640
- function jt(t, e) {
1650
+ function Rt(t, e) {
1641
1651
  if ("string" == typeof t && "string" == typeof e && t.length === e.length) return gt(t, e);
1642
1652
  var n = kt(t), r = kt(e), i = gt(n.seconds, r.seconds);
1643
1653
  return 0 !== i ? i : gt(n.nanos, r.nanos);
1644
1654
  }
1645
1655
 
1646
- function Rt(t, e) {
1656
+ function xt(t, e) {
1647
1657
  return {
1648
1658
  referenceValue: "projects/" + t.projectId + "/databases/" + t.database + "/documents/" + e.path.canonicalString()
1649
1659
  };
@@ -1653,19 +1663,19 @@ function Rt(t, e) {
1653
1663
  return !!t && "arrayValue" in t;
1654
1664
  }
1655
1665
 
1656
- /** Returns true if `value` is a NullValue. */ function xt(t) {
1666
+ /** Returns true if `value` is a NullValue. */ function Ut(t) {
1657
1667
  return !!t && "nullValue" in t;
1658
1668
  }
1659
1669
 
1660
- /** Returns true if `value` is NaN. */ function Ut(t) {
1670
+ /** Returns true if `value` is NaN. */ function Bt(t) {
1661
1671
  return !!t && "doubleValue" in t && isNaN(Number(t.doubleValue));
1662
1672
  }
1663
1673
 
1664
- /** Returns true if `value` is a MapValue. */ function Bt(t) {
1674
+ /** Returns true if `value` is a MapValue. */ function Gt(t) {
1665
1675
  return !!t && "mapValue" in t;
1666
1676
  }
1667
1677
 
1668
- /** Creates a deep copy of `source`. */ function Gt(t) {
1678
+ /** Creates a deep copy of `source`. */ function zt(t) {
1669
1679
  if (t.geoPointValue) return {
1670
1680
  geoPointValue: Object.assign({}, t.geoPointValue)
1671
1681
  };
@@ -1679,7 +1689,7 @@ function Rt(t, e) {
1679
1689
  }
1680
1690
  };
1681
1691
  return St(t.mapValue.fields, (function(t, n) {
1682
- return e.mapValue.fields[t] = Gt(n);
1692
+ return e.mapValue.fields[t] = zt(n);
1683
1693
  })), e;
1684
1694
  }
1685
1695
  if (t.arrayValue) {
@@ -1687,13 +1697,13 @@ function Rt(t, e) {
1687
1697
  arrayValue: {
1688
1698
  values: []
1689
1699
  }
1690
- }, r = 0; r < (t.arrayValue.values || []).length; ++r) n.arrayValue.values[r] = Gt(t.arrayValue.values[r]);
1700
+ }, r = 0; r < (t.arrayValue.values || []).length; ++r) n.arrayValue.values[r] = zt(t.arrayValue.values[r]);
1691
1701
  return n;
1692
1702
  }
1693
1703
  return Object.assign({}, t);
1694
1704
  }
1695
1705
 
1696
- var zt = /** @class */ function() {
1706
+ var Qt = /** @class */ function() {
1697
1707
  function t(t) {
1698
1708
  this.value = t;
1699
1709
  }
@@ -1710,7 +1720,7 @@ var zt = /** @class */ function() {
1710
1720
  */
1711
1721
  t.prototype.field = function(t) {
1712
1722
  if (t.isEmpty()) return this.value;
1713
- for (var e = this.value, n = 0; n < t.length - 1; ++n) if (!Bt(e = (e.mapValue.fields || {})[t.get(n)])) return null;
1723
+ for (var e = this.value, n = 0; n < t.length - 1; ++n) if (!Gt(e = (e.mapValue.fields || {})[t.get(n)])) return null;
1714
1724
  return (e = (e.mapValue.fields || {})[t.lastSegment()]) || null;
1715
1725
  },
1716
1726
  /**
@@ -1720,7 +1730,7 @@ var zt = /** @class */ function() {
1720
1730
  * @param value - The value to set.
1721
1731
  */
1722
1732
  t.prototype.set = function(t, e) {
1723
- this.getFieldsMap(t.popLast())[t.lastSegment()] = Gt(e);
1733
+ this.getFieldsMap(t.popLast())[t.lastSegment()] = zt(e);
1724
1734
  },
1725
1735
  /**
1726
1736
  * Sets the provided fields to the provided values.
@@ -1735,7 +1745,7 @@ var zt = /** @class */ function() {
1735
1745
  var a = e.getFieldsMap(n);
1736
1746
  e.applyChanges(a, r, i), r = {}, i = [], n = o.popLast();
1737
1747
  }
1738
- t ? r[o.lastSegment()] = Gt(t) : i.push(o.lastSegment());
1748
+ t ? r[o.lastSegment()] = zt(t) : i.push(o.lastSegment());
1739
1749
  }));
1740
1750
  var o = this.getFieldsMap(n);
1741
1751
  this.applyChanges(o, r, i);
@@ -1748,9 +1758,9 @@ var zt = /** @class */ function() {
1748
1758
  */
1749
1759
  t.prototype.delete = function(t) {
1750
1760
  var e = this.field(t.popLast());
1751
- Bt(e) && e.mapValue.fields && delete e.mapValue.fields[t.lastSegment()];
1761
+ Gt(e) && e.mapValue.fields && delete e.mapValue.fields[t.lastSegment()];
1752
1762
  }, t.prototype.isEqual = function(t) {
1753
- return Ot(this.value, t.value);
1763
+ return Ct(this.value, t.value);
1754
1764
  },
1755
1765
  /**
1756
1766
  * Returns the map that contains the leaf element of `path`. If the parent
@@ -1763,7 +1773,7 @@ var zt = /** @class */ function() {
1763
1773
  });
1764
1774
  for (var n = 0; n < t.length; ++n) {
1765
1775
  var r = e.mapValue.fields[t.get(n)];
1766
- Bt(r) && r.mapValue.fields || (r = {
1776
+ Gt(r) && r.mapValue.fields || (r = {
1767
1777
  mapValue: {
1768
1778
  fields: {}
1769
1779
  }
@@ -1784,9 +1794,9 @@ var zt = /** @class */ function() {
1784
1794
  delete t[o];
1785
1795
  }
1786
1796
  }, t.prototype.clone = function() {
1787
- return new t(Gt(this.value));
1797
+ return new t(zt(this.value));
1788
1798
  }, t;
1789
- }(), Qt = /** @class */ function() {
1799
+ }(), Kt = /** @class */ function() {
1790
1800
  function t(t, e, n, r, i, o) {
1791
1801
  this.key = t, this.documentType = e, this.version = n, this.readTime = r, this.data = i,
1792
1802
  this.documentState = o
@@ -1796,7 +1806,7 @@ var zt = /** @class */ function() {
1796
1806
  */;
1797
1807
  }
1798
1808
  return t.newInvalidDocument = function(e) {
1799
- return new t(e, 0 /* INVALID */ , _t.min(), _t.min(), zt.empty(), 0 /* SYNCED */);
1809
+ return new t(e, 0 /* INVALID */ , _t.min(), _t.min(), Qt.empty(), 0 /* SYNCED */);
1800
1810
  },
1801
1811
  /**
1802
1812
  * Creates a new document that is known to exist with the given data at the
@@ -1806,7 +1816,7 @@ var zt = /** @class */ function() {
1806
1816
  return new t(e, 1 /* FOUND_DOCUMENT */ , n, _t.min(), r, 0 /* SYNCED */);
1807
1817
  },
1808
1818
  /** Creates a new document that is known to not exist at the given version. */ t.newNoDocument = function(e, n) {
1809
- return new t(e, 2 /* NO_DOCUMENT */ , n, _t.min(), zt.empty(), 0 /* SYNCED */);
1819
+ return new t(e, 2 /* NO_DOCUMENT */ , n, _t.min(), Qt.empty(), 0 /* SYNCED */);
1810
1820
  },
1811
1821
  /**
1812
1822
  * Creates a new document that is known to exist at the given version but
@@ -1814,7 +1824,7 @@ var zt = /** @class */ function() {
1814
1824
  * base document).
1815
1825
  */
1816
1826
  t.newUnknownDocument = function(e, n) {
1817
- return new t(e, 3 /* UNKNOWN_DOCUMENT */ , n, _t.min(), zt.empty(), 2 /* HAS_COMMITTED_MUTATIONS */);
1827
+ return new t(e, 3 /* UNKNOWN_DOCUMENT */ , n, _t.min(), Qt.empty(), 2 /* HAS_COMMITTED_MUTATIONS */);
1818
1828
  },
1819
1829
  /**
1820
1830
  * Changes the document type to indicate that it exists and that its version
@@ -1829,7 +1839,7 @@ var zt = /** @class */ function() {
1829
1839
  * version.
1830
1840
  */
1831
1841
  t.prototype.convertToNoDocument = function(t) {
1832
- return this.version = t, this.documentType = 2 /* NO_DOCUMENT */ , this.data = zt.empty(),
1842
+ return this.version = t, this.documentType = 2 /* NO_DOCUMENT */ , this.data = Qt.empty(),
1833
1843
  this.documentState = 0 /* SYNCED */ , this;
1834
1844
  },
1835
1845
  /**
@@ -1838,7 +1848,7 @@ var zt = /** @class */ function() {
1838
1848
  * base document).
1839
1849
  */
1840
1850
  t.prototype.convertToUnknownDocument = function(t) {
1841
- return this.version = t, this.documentType = 3 /* UNKNOWN_DOCUMENT */ , this.data = zt.empty(),
1851
+ return this.version = t, this.documentType = 3 /* UNKNOWN_DOCUMENT */ , this.data = Qt.empty(),
1842
1852
  this.documentState = 2 /* HAS_COMMITTED_MUTATIONS */ , this;
1843
1853
  }, t.prototype.setHasCommittedMutations = function() {
1844
1854
  return this.documentState = 2 /* HAS_COMMITTED_MUTATIONS */ , this;
@@ -1879,7 +1889,7 @@ var zt = /** @class */ function() {
1879
1889
  }, t.prototype.toString = function() {
1880
1890
  return "Document(" + this.key + ", " + this.version + ", " + JSON.stringify(this.data.value) + ", {documentType: " + this.documentType + "}), {documentState: " + this.documentState + "})";
1881
1891
  }, t;
1882
- }(), Kt = function(t, e, n, r, i, o, a) {
1892
+ }(), Ht = function(t, e, n, r, i, o, a) {
1883
1893
  void 0 === e && (e = null), void 0 === n && (n = []), void 0 === r && (r = []),
1884
1894
  void 0 === i && (i = null), void 0 === o && (o = null), void 0 === a && (a = null),
1885
1895
  this.path = t, this.collectionGroup = e, this.orderBy = n, this.filters = r, this.limit = i,
@@ -1920,13 +1930,13 @@ var zt = /** @class */ function() {
1920
1930
  * using this factory method, because `Query` provides an implicit `orderBy`
1921
1931
  * property.
1922
1932
  */
1923
- function Ht(t, e, n, r, i, o, a) {
1933
+ function Wt(t, e, n, r, i, o, a) {
1924
1934
  return void 0 === e && (e = null), void 0 === n && (n = []), void 0 === r && (r = []),
1925
1935
  void 0 === i && (i = null), void 0 === o && (o = null), void 0 === a && (a = null),
1926
- new Kt(t, e, n, r, i, o, a);
1936
+ new Ht(t, e, n, r, i, o, a);
1927
1937
  }
1928
1938
 
1929
- var Wt = /** @class */ function(e) {
1939
+ var Yt = /** @class */ function(e) {
1930
1940
  function n(t, n, r) {
1931
1941
  var i = this;
1932
1942
  return (i = e.call(this) || this).field = t, i.op = n, i.value = r, i;
@@ -1934,13 +1944,13 @@ var Wt = /** @class */ function(e) {
1934
1944
  /**
1935
1945
  * Creates a filter based on the provided arguments.
1936
1946
  */ return t(n, e), n.create = function(t, e, r) {
1937
- return t.isKeyField() ? "in" /* IN */ === e || "not-in" /* NOT_IN */ === e ? this.V(t, e, r) : new Yt(t, e, r) : "array-contains" /* ARRAY_CONTAINS */ === e ? new Zt(t, r) : "in" /* IN */ === e ? new te(t, r) : "not-in" /* NOT_IN */ === e ? new ee(t, r) : "array-contains-any" /* ARRAY_CONTAINS_ANY */ === e ? new ne(t, r) : new n(t, e, r);
1947
+ return t.isKeyField() ? "in" /* IN */ === e || "not-in" /* NOT_IN */ === e ? this.V(t, e, r) : new $t(t, e, r) : "array-contains" /* ARRAY_CONTAINS */ === e ? new te(t, r) : "in" /* IN */ === e ? new ee(t, r) : "not-in" /* NOT_IN */ === e ? new ne(t, r) : "array-contains-any" /* ARRAY_CONTAINS_ANY */ === e ? new re(t, r) : new n(t, e, r);
1938
1948
  }, n.V = function(t, e, n) {
1939
- return "in" /* IN */ === e ? new $t(t, n) : new Xt(t, n);
1949
+ return "in" /* IN */ === e ? new Xt(t, n) : new Jt(t, n);
1940
1950
  }, n.prototype.matches = function(t) {
1941
1951
  var e = t.data.field(this.field);
1942
1952
  // Types do not have to match in NOT_EQUAL filters.
1943
- return "!=" /* NOT_EQUAL */ === this.op ? null !== e && this.D(Lt(e, this.value)) : null !== e && Ft(this.value) === Ft(e) && this.D(Lt(e, this.value));
1953
+ return "!=" /* NOT_EQUAL */ === this.op ? null !== e && this.D(jt(e, this.value)) : null !== e && Ot(this.value) === Ot(e) && this.D(jt(e, this.value));
1944
1954
  // Only compare types with matching backend order (such as double and int).
1945
1955
  }, n.prototype.D = function(t) {
1946
1956
  switch (this.op) {
@@ -1968,7 +1978,7 @@ var Wt = /** @class */ function(e) {
1968
1978
  }, n.prototype.N = function() {
1969
1979
  return [ "<" /* LESS_THAN */ , "<=" /* LESS_THAN_OR_EQUAL */ , ">" /* GREATER_THAN */ , ">=" /* GREATER_THAN_OR_EQUAL */ , "!=" /* NOT_EQUAL */ , "not-in" /* NOT_IN */ ].indexOf(this.op) >= 0;
1970
1980
  }, n;
1971
- }((function() {})), Yt = /** @class */ function(e) {
1981
+ }((function() {})), $t = /** @class */ function(e) {
1972
1982
  function n(t, n, r) {
1973
1983
  var i = this;
1974
1984
  return (i = e.call(this, t, n, r) || this).key = nt.fromName(r.referenceValue),
@@ -1978,10 +1988,10 @@ var Wt = /** @class */ function(e) {
1978
1988
  var e = nt.comparator(t.key, this.key);
1979
1989
  return this.D(e);
1980
1990
  }, n;
1981
- }(Wt), $t = /** @class */ function(e) {
1991
+ }(Yt), Xt = /** @class */ function(e) {
1982
1992
  function n(t, n) {
1983
1993
  var r = this;
1984
- return (r = e.call(this, t, "in" /* IN */ , n) || this).keys = Jt("in" /* IN */ , n),
1994
+ return (r = e.call(this, t, "in" /* IN */ , n) || this).keys = Zt("in" /* IN */ , n),
1985
1995
  r;
1986
1996
  }
1987
1997
  return t(n, e), n.prototype.matches = function(t) {
@@ -1989,10 +1999,10 @@ var Wt = /** @class */ function(e) {
1989
1999
  return e.isEqual(t.key);
1990
2000
  }));
1991
2001
  }, n;
1992
- }(Wt), Xt = /** @class */ function(e) {
2002
+ }(Yt), Jt = /** @class */ function(e) {
1993
2003
  function n(t, n) {
1994
2004
  var r = this;
1995
- return (r = e.call(this, t, "not-in" /* NOT_IN */ , n) || this).keys = Jt("not-in" /* NOT_IN */ , n),
2005
+ return (r = e.call(this, t, "not-in" /* NOT_IN */ , n) || this).keys = Zt("not-in" /* NOT_IN */ , n),
1996
2006
  r;
1997
2007
  }
1998
2008
  return t(n, e), n.prototype.matches = function(t) {
@@ -2000,67 +2010,67 @@ var Wt = /** @class */ function(e) {
2000
2010
  return e.isEqual(t.key);
2001
2011
  }));
2002
2012
  }, n;
2003
- }(Wt);
2013
+ }(Yt);
2004
2014
 
2005
- /** Filter that matches on key fields (i.e. '__name__'). */ function Jt(t, e) {
2015
+ /** Filter that matches on key fields (i.e. '__name__'). */ function Zt(t, e) {
2006
2016
  var n;
2007
2017
  return ((null === (n = e.arrayValue) || void 0 === n ? void 0 : n.values) || []).map((function(t) {
2008
2018
  return nt.fromName(t.referenceValue);
2009
2019
  }));
2010
2020
  }
2011
2021
 
2012
- /** A Filter that implements the array-contains operator. */ var Zt = /** @class */ function(e) {
2022
+ /** A Filter that implements the array-contains operator. */ var te = /** @class */ function(e) {
2013
2023
  function n(t, n) {
2014
2024
  return e.call(this, t, "array-contains" /* ARRAY_CONTAINS */ , n) || this;
2015
2025
  }
2016
2026
  return t(n, e), n.prototype.matches = function(t) {
2017
2027
  var e = t.data.field(this.field);
2018
- return Mt(e) && Ct(e.arrayValue, this.value);
2028
+ return Mt(e) && Lt(e.arrayValue, this.value);
2019
2029
  }, n;
2020
- }(Wt), te = /** @class */ function(e) {
2030
+ }(Yt), ee = /** @class */ function(e) {
2021
2031
  function n(t, n) {
2022
2032
  return e.call(this, t, "in" /* IN */ , n) || this;
2023
2033
  }
2024
2034
  return t(n, e), n.prototype.matches = function(t) {
2025
2035
  var e = t.data.field(this.field);
2026
- return null !== e && Ct(this.value.arrayValue, e);
2036
+ return null !== e && Lt(this.value.arrayValue, e);
2027
2037
  }, n;
2028
- }(Wt), ee = /** @class */ function(e) {
2038
+ }(Yt), ne = /** @class */ function(e) {
2029
2039
  function n(t, n) {
2030
2040
  return e.call(this, t, "not-in" /* NOT_IN */ , n) || this;
2031
2041
  }
2032
2042
  return t(n, e), n.prototype.matches = function(t) {
2033
- if (Ct(this.value.arrayValue, {
2043
+ if (Lt(this.value.arrayValue, {
2034
2044
  nullValue: "NULL_VALUE"
2035
2045
  })) return !1;
2036
2046
  var e = t.data.field(this.field);
2037
- return null !== e && !Ct(this.value.arrayValue, e);
2047
+ return null !== e && !Lt(this.value.arrayValue, e);
2038
2048
  }, n;
2039
- }(Wt), ne = /** @class */ function(e) {
2049
+ }(Yt), re = /** @class */ function(e) {
2040
2050
  function n(t, n) {
2041
2051
  return e.call(this, t, "array-contains-any" /* ARRAY_CONTAINS_ANY */ , n) || this;
2042
2052
  }
2043
2053
  return t(n, e), n.prototype.matches = function(t) {
2044
2054
  var e = this, n = t.data.field(this.field);
2045
2055
  return !(!Mt(n) || !n.arrayValue.values) && n.arrayValue.values.some((function(t) {
2046
- return Ct(e.value.arrayValue, t);
2056
+ return Lt(e.value.arrayValue, t);
2047
2057
  }));
2048
2058
  }, n;
2049
- }(Wt), re = function(t, e) {
2059
+ }(Yt), ie = function(t, e) {
2050
2060
  this.position = t, this.inclusive = e;
2051
- }, ie = function(t, e /* ASCENDING */) {
2061
+ }, oe = function(t, e /* ASCENDING */) {
2052
2062
  void 0 === e && (e = "asc"), this.field = t, this.dir = e;
2053
2063
  };
2054
2064
 
2055
- /** A Filter that implements the IN operator. */ function oe(t, e) {
2065
+ /** A Filter that implements the IN operator. */ function ae(t, e) {
2056
2066
  return t.dir === e.dir && t.field.isEqual(e.field);
2057
2067
  }
2058
2068
 
2059
- function ae(t, e) {
2069
+ function se(t, e) {
2060
2070
  if (null === t) return null === e;
2061
2071
  if (null === e) return !1;
2062
2072
  if (t.inclusive !== e.inclusive || t.position.length !== e.position.length) return !1;
2063
- for (var n = 0; n < t.position.length; n++) if (!Ot(t.position[n], e.position[n])) return !1;
2073
+ for (var n = 0; n < t.position.length; n++) if (!Ct(t.position[n], e.position[n])) return !1;
2064
2074
  return !0;
2065
2075
  }
2066
2076
 
@@ -2086,7 +2096,7 @@ function ae(t, e) {
2086
2096
  * query the RemoteStore results.
2087
2097
  *
2088
2098
  * Visible for testing.
2089
- */ var se =
2099
+ */ var ue =
2090
2100
  /**
2091
2101
  * Initializes a Query with a path and optional additional query constraints.
2092
2102
  * Path must currently be empty if this is a collection group query.
@@ -2101,11 +2111,7 @@ function(t, e, n, r, i, o /* First */ , a, s) {
2101
2111
  this.S = null, this.startAt, this.endAt;
2102
2112
  };
2103
2113
 
2104
- /** Creates a new Query for a query that matches all documents at `path` */ function ue(t) {
2105
- return !ct(t.limit) && "L" /* Last */ === t.limitType;
2106
- }
2107
-
2108
- function ce(t) {
2114
+ /** Creates a new Query for a query that matches all documents at `path` */ function ce(t) {
2109
2115
  return t.explicitOrderBy.length > 0 ? t.explicitOrderBy[0].field : null;
2110
2116
  }
2111
2117
 
@@ -2141,7 +2147,7 @@ function le(t) {
2141
2147
  // In order to implicitly add key ordering, we must also add the
2142
2148
  // inequality filter field for it to be a valid query.
2143
2149
  // Note that the default inequality field and key ordering is ascending.
2144
- n.isKeyField() || e.$.push(new ie(n)), e.$.push(new ie(et.keyField(), "asc" /* ASCENDING */)); else {
2150
+ n.isKeyField() || e.$.push(new oe(n)), e.$.push(new oe(et.keyField(), "asc" /* ASCENDING */)); else {
2145
2151
  for (var i = !1, o = 0, a = e.explicitOrderBy; o < a.length; o++) {
2146
2152
  var s = a[o];
2147
2153
  e.$.push(s), s.field.isKeyField() && (i = !0);
@@ -2150,7 +2156,7 @@ function le(t) {
2150
2156
  // The order of the implicit key ordering always matches the last
2151
2157
  // explicit order by
2152
2158
  var u = e.explicitOrderBy.length > 0 ? e.explicitOrderBy[e.explicitOrderBy.length - 1].dir : "asc" /* ASCENDING */;
2153
- e.$.push(new ie(et.keyField(), u));
2159
+ e.$.push(new oe(et.keyField(), u));
2154
2160
  }
2155
2161
  }
2156
2162
  }
@@ -2161,17 +2167,17 @@ function le(t) {
2161
2167
  * Converts this `Query` instance to it's corresponding `Target` representation.
2162
2168
  */ function pe(t) {
2163
2169
  var e = I(t);
2164
- if (!e.S) if ("F" /* First */ === e.limitType) e.S = Ht(e.path, e.collectionGroup, he(e), e.filters, e.limit, e.startAt, e.endAt); else {
2170
+ if (!e.S) if ("F" /* First */ === e.limitType) e.S = Wt(e.path, e.collectionGroup, he(e), e.filters, e.limit, e.startAt, e.endAt); else {
2165
2171
  for (
2166
2172
  // Flip the orderBy directions since we want the last results
2167
2173
  var n = [], r = 0, i = he(e); r < i.length; r++) {
2168
2174
  var o = i[r], a = "desc" /* DESCENDING */ === o.dir ? "asc" /* ASCENDING */ : "desc" /* DESCENDING */;
2169
- n.push(new ie(o.field, a));
2175
+ n.push(new oe(o.field, a));
2170
2176
  }
2171
2177
  // We need to swap the cursors to match the now-flipped query ordering.
2172
- var s = e.endAt ? new re(e.endAt.position, !e.endAt.inclusive) : null, u = e.startAt ? new re(e.startAt.position, !e.startAt.inclusive) : null;
2178
+ var s = e.endAt ? new ie(e.endAt.position, e.endAt.inclusive) : null, u = e.startAt ? new ie(e.startAt.position, e.startAt.inclusive) : null;
2173
2179
  // Now return as a LimitType.First query.
2174
- e.S = Ht(e.path, e.collectionGroup, n, e.filters, e.limit, s, u);
2180
+ e.S = Wt(e.path, e.collectionGroup, n, e.filters, e.limit, s, u);
2175
2181
  }
2176
2182
  return e.S;
2177
2183
  }
@@ -2398,8 +2404,8 @@ function Le(t, e) {
2398
2404
  var e = Z.fromString(t);
2399
2405
  return E(ze(e)), e;
2400
2406
  }(e);
2401
- if (r.get(1) !== t.databaseId.projectId) throw new x(V, "Tried to deserialize key from different project: " + r.get(1) + " vs " + t.databaseId.projectId);
2402
- if (r.get(3) !== t.databaseId.database) throw new x(V, "Tried to deserialize key from different database: " + r.get(3) + " vs " + t.databaseId.database);
2407
+ if (r.get(1) !== t.databaseId.projectId) throw new M(V, "Tried to deserialize key from different project: " + r.get(1) + " vs " + t.databaseId.projectId);
2408
+ if (r.get(3) !== t.databaseId.database) throw new M(V, "Tried to deserialize key from different database: " + r.get(3) + " vs " + t.databaseId.database);
2403
2409
  return new nt((E((n = r).length > 4 && "documents" === n.get(4)), n.popFirst(5)));
2404
2410
  }
2405
2411
 
@@ -2411,14 +2417,14 @@ function Re(t) {
2411
2417
  return new Z([ "projects", t.databaseId.projectId, "databases", t.databaseId.database ]).canonicalString();
2412
2418
  }
2413
2419
 
2414
- function Me(t, e, n) {
2420
+ function xe(t, e, n) {
2415
2421
  return {
2416
2422
  name: Ce(t, e),
2417
2423
  fields: n.value.mapValue.fields
2418
2424
  };
2419
2425
  }
2420
2426
 
2421
- function xe(t) {
2427
+ function Me(t) {
2422
2428
  return ke[t];
2423
2429
  }
2424
2430
 
@@ -2571,7 +2577,7 @@ function ze(t) {
2571
2577
  o.K = r, o.q = i, o.J = !1, o;
2572
2578
  }
2573
2579
  return t(n, e), n.prototype.X = function() {
2574
- if (this.J) throw new x(O, "The client has already been terminated.");
2580
+ if (this.J) throw new M(O, "The client has already been terminated.");
2575
2581
  },
2576
2582
  /** Invokes the provided RPC with auth and AppCheck tokens. */ n.prototype.m = function(t, e, n) {
2577
2583
  var r = this;
@@ -2580,7 +2586,7 @@ function ze(t) {
2580
2586
  return r.K.m(t, e, n, o, a);
2581
2587
  })).catch((function(t) {
2582
2588
  throw "FirebaseError" === t.name ? (t.code === q && (r.authCredentials.invalidateToken(),
2583
- r.appCheckCredentials.invalidateToken()), t) : new x(k, t.toString());
2589
+ r.appCheckCredentials.invalidateToken()), t) : new M(k, t.toString());
2584
2590
  }));
2585
2591
  },
2586
2592
  /** Invokes the provided RPC with streamed results with auth and AppCheck tokens. */ n.prototype.T = function(t, e, n) {
@@ -2590,7 +2596,7 @@ function ze(t) {
2590
2596
  return r.K.T(t, e, n, o, a);
2591
2597
  })).catch((function(t) {
2592
2598
  throw "FirebaseError" === t.name ? (t.code === q && (r.authCredentials.invalidateToken(),
2593
- r.appCheckCredentials.invalidateToken()), t) : new x(k, t.toString());
2599
+ r.appCheckCredentials.invalidateToken()), t) : new M(k, t.toString());
2594
2600
  }));
2595
2601
  }, n.prototype.terminate = function() {
2596
2602
  this.J = !0;
@@ -2635,11 +2641,11 @@ function We(t, r) {
2635
2641
  return function(t, e) {
2636
2642
  var n;
2637
2643
  if (e instanceof Se) n = {
2638
- update: Me(t, e.key, e.value)
2644
+ update: xe(t, e.key, e.value)
2639
2645
  }; else if (e instanceof Ie) n = {
2640
2646
  delete: Ce(t, e.key)
2641
2647
  }; else if (e instanceof Ee) n = {
2642
- update: Me(t, e.key, e.data),
2648
+ update: xe(t, e.key, e.data),
2643
2649
  updateMask: Ge(e.fieldMask)
2644
2650
  }; else {
2645
2651
  if (!(e instanceof Ae)) return S();
@@ -2707,16 +2713,16 @@ function Ye(t, r) {
2707
2713
  var n = function(t, e) {
2708
2714
  return "found" in e ? function(t, e) {
2709
2715
  E(!!e.found), e.found.name, e.found.updateTime;
2710
- var n = Le(t, e.found.name), r = Fe(e.found.updateTime), i = new zt({
2716
+ var n = Le(t, e.found.name), r = Fe(e.found.updateTime), i = new Qt({
2711
2717
  mapValue: {
2712
2718
  fields: e.found.fields
2713
2719
  }
2714
2720
  });
2715
- return Qt.newFoundDocument(n, r, i);
2721
+ return Kt.newFoundDocument(n, r, i);
2716
2722
  }(t, e) : "missing" in e ? function(t, e) {
2717
2723
  E(!!e.missing), E(!!e.readTime);
2718
2724
  var n = Le(t, e.missing), r = Fe(e.readTime);
2719
- return Qt.newNoDocument(n, r);
2725
+ return Kt.newNoDocument(n, r);
2720
2726
  }(t, e) : S();
2721
2727
  }(e.q, t);
2722
2728
  s.set(n.key.toString(), n);
@@ -2752,26 +2758,26 @@ function $e(t, r) {
2752
2758
  // visible for testing
2753
2759
  return function(t) {
2754
2760
  if ("==" /* EQUAL */ === t.op) {
2755
- if (Ut(t.value)) return {
2761
+ if (Bt(t.value)) return {
2756
2762
  unaryFilter: {
2757
2763
  field: Be(t.field),
2758
2764
  op: "IS_NAN"
2759
2765
  }
2760
2766
  };
2761
- if (xt(t.value)) return {
2767
+ if (Ut(t.value)) return {
2762
2768
  unaryFilter: {
2763
2769
  field: Be(t.field),
2764
2770
  op: "IS_NULL"
2765
2771
  }
2766
2772
  };
2767
2773
  } else if ("!=" /* NOT_EQUAL */ === t.op) {
2768
- if (Ut(t.value)) return {
2774
+ if (Bt(t.value)) return {
2769
2775
  unaryFilter: {
2770
2776
  field: Be(t.field),
2771
2777
  op: "IS_NOT_NAN"
2772
2778
  }
2773
2779
  };
2774
- if (xt(t.value)) return {
2780
+ if (Ut(t.value)) return {
2775
2781
  unaryFilter: {
2776
2782
  field: Be(t.field),
2777
2783
  op: "IS_NOT_NULL"
@@ -2802,7 +2808,7 @@ function $e(t, r) {
2802
2808
  return function(t) {
2803
2809
  return {
2804
2810
  field: Be(t.field),
2805
- direction: xe(t.dir)
2811
+ direction: Me(t.dir)
2806
2812
  };
2807
2813
  }(t);
2808
2814
  }));
@@ -2831,11 +2837,11 @@ function $e(t, r) {
2831
2837
  return !!t.document;
2832
2838
  })).map((function(t) {
2833
2839
  return function(t, e, n) {
2834
- var r = Le(t, e.name), i = Fe(e.updateTime), o = new zt({
2840
+ var r = Le(t, e.name), i = Fe(e.updateTime), o = new Qt({
2835
2841
  mapValue: {
2836
2842
  fields: e.fields
2837
2843
  }
2838
- }), a = Qt.newFoundDocument(r, i, o);
2844
+ }), a = Kt.newFoundDocument(r, i, o);
2839
2845
  return a;
2840
2846
  }(e.q, t.document);
2841
2847
  })) ];
@@ -2870,7 +2876,7 @@ function $e(t, r) {
2870
2876
  * instance. Callers must invoke removeComponents() when the Firestore
2871
2877
  * instance is terminated.
2872
2878
  */ function Je(t) {
2873
- if (t._terminated) throw new x(O, "The client has already been terminated.");
2879
+ if (t._terminated) throw new M(O, "The client has already been terminated.");
2874
2880
  if (!Xe.has(t)) {
2875
2881
  w("ComponentProvider", "Initializing Datastore");
2876
2882
  var e = function(t) {
@@ -2912,17 +2918,17 @@ function $e(t, r) {
2912
2918
  function t(t) {
2913
2919
  var e;
2914
2920
  if (void 0 === t.host) {
2915
- if (void 0 !== t.ssl) throw new x(V, "Can't provide ssl option if host option is not set");
2921
+ if (void 0 !== t.ssl) throw new M(V, "Can't provide ssl option if host option is not set");
2916
2922
  this.host = "firestore.googleapis.com", this.ssl = !0;
2917
2923
  } else this.host = t.host, this.ssl = null === (e = t.ssl) || void 0 === e || e;
2918
2924
  if (this.credentials = t.credentials, this.ignoreUndefinedProperties = !!t.ignoreUndefinedProperties,
2919
2925
  void 0 === t.cacheSizeBytes) this.cacheSizeBytes = 41943040; else {
2920
- if (-1 !== t.cacheSizeBytes && t.cacheSizeBytes < 1048576) throw new x(V, "cacheSizeBytes must be at least 1048576");
2926
+ if (-1 !== t.cacheSizeBytes && t.cacheSizeBytes < 1048576) throw new M(V, "cacheSizeBytes must be at least 1048576");
2921
2927
  this.cacheSizeBytes = t.cacheSizeBytes;
2922
2928
  }
2923
2929
  this.experimentalForceLongPolling = !!t.experimentalForceLongPolling, this.experimentalAutoDetectLongPolling = !!t.experimentalAutoDetectLongPolling,
2924
2930
  this.useFetchStreams = !!t.useFetchStreams, function(t, e, n, r) {
2925
- if (!0 === e && !0 === r) throw new x(V, "experimentalForceLongPolling and experimentalAutoDetectLongPolling cannot be used together.");
2931
+ if (!0 === e && !0 === r) throw new M(V, "experimentalForceLongPolling and experimentalAutoDetectLongPolling cannot be used together.");
2926
2932
  }(0, t.experimentalForceLongPolling, 0, t.experimentalAutoDetectLongPolling);
2927
2933
  }
2928
2934
  return t.prototype.isEqual = function(t) {
@@ -2938,7 +2944,7 @@ function $e(t, r) {
2938
2944
  this.type = "firestore-lite", this._persistenceKey = "(lite)", this._settings = new Ze({}),
2939
2945
  this._settingsFrozen = !1, t instanceof X ? this._databaseId = t : (this._app = t,
2940
2946
  this._databaseId = function(t) {
2941
- if (!Object.prototype.hasOwnProperty.apply(t.options, [ "projectId" ])) throw new x(V, '"projectId" not provided in firebase.initializeApp.');
2947
+ if (!Object.prototype.hasOwnProperty.apply(t.options, [ "projectId" ])) throw new M(V, '"projectId" not provided in firebase.initializeApp.');
2942
2948
  return new X(t.options.projectId);
2943
2949
  }(t));
2944
2950
  }
@@ -2948,7 +2954,7 @@ function $e(t, r) {
2948
2954
  * instance.
2949
2955
  */
2950
2956
  get: function() {
2951
- if (!this._app) throw new x(O, "Firestore was not initialized using the Firebase SDK. 'app' is not available");
2957
+ if (!this._app) throw new M(O, "Firestore was not initialized using the Firebase SDK. 'app' is not available");
2952
2958
  return this._app;
2953
2959
  },
2954
2960
  enumerable: !1,
@@ -2966,7 +2972,7 @@ function $e(t, r) {
2966
2972
  enumerable: !1,
2967
2973
  configurable: !0
2968
2974
  }), t.prototype._setSettings = function(t) {
2969
- if (this._settingsFrozen) throw new x(O, "Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");
2975
+ if (this._settingsFrozen) throw new M(O, "Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");
2970
2976
  this._settings = new Ze(t), void 0 !== t.credentials && (this._authCredentials = function(t) {
2971
2977
  if (!t) return new G;
2972
2978
  switch (t.type) {
@@ -2980,7 +2986,7 @@ function $e(t, r) {
2980
2986
  return t.client;
2981
2987
 
2982
2988
  default:
2983
- throw new x(V, "makeAuthCredentialsProvider failed due to invalid credential type");
2989
+ throw new M(V, "makeAuthCredentialsProvider failed due to invalid credential type");
2984
2990
  }
2985
2991
  }(t.credentials));
2986
2992
  }, t.prototype._getSettings = function() {
@@ -3033,7 +3039,7 @@ function $e(t, r) {
3033
3039
  * Do not call this constructor directly. Instead, use {@link getFirestore}.
3034
3040
  */ function en(t, e) {
3035
3041
  var n = _getProvider(t, "firestore/lite");
3036
- if (n.isInitialized()) throw new x(O, "Firestore can only be initialized once per app.");
3042
+ if (n.isInitialized()) throw new M(O, "Firestore can only be initialized once per app.");
3037
3043
  return n.initialize({
3038
3044
  options: e
3039
3045
  });
@@ -3078,7 +3084,7 @@ function $e(t, r) {
3078
3084
  // invalid field "uid" and missing field "sub" / "user_id".)
3079
3085
  a = d(r.mockUserToken, null === (i = t._app) || void 0 === i ? void 0 : i.options.projectId);
3080
3086
  var u = r.mockUserToken.sub || r.mockUserToken.user_id;
3081
- if (!u) throw new x(V, "mockUserToken must contain 'sub' or 'user_id' field!");
3087
+ if (!u) throw new M(V, "mockUserToken must contain 'sub' or 'user_id' field!");
3082
3088
  s = new m(u);
3083
3089
  }
3084
3090
  t._authCredentials = new z(new B(a, s));
@@ -3212,7 +3218,7 @@ var an = /** @class */ function() {
3212
3218
  /** @hideconstructor */
3213
3219
  function n(t, n, r) {
3214
3220
  var i = this;
3215
- return (i = e.call(this, t, n, new se(r)) || this)._path = r,
3221
+ return (i = e.call(this, t, n, new ue(r)) || this)._path = r,
3216
3222
  /** The type of this Firestore reference. */
3217
3223
  i.type = "collection", i;
3218
3224
  }
@@ -3258,7 +3264,7 @@ var an = /** @class */ function() {
3258
3264
  var o = Z.fromString.apply(Z, r([ e ], n));
3259
3265
  return ot(o), new un(t, /* converter= */ null, o);
3260
3266
  }
3261
- if (!(t instanceof an || t instanceof un)) throw new x(V, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
3267
+ if (!(t instanceof an || t instanceof un)) throw new M(V, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
3262
3268
  var a = t._path.child(Z.fromString.apply(Z, r([ e ], n)));
3263
3269
  return ot(a), new un(t.firestore,
3264
3270
  /* converter= */ null, a);
@@ -3277,7 +3283,7 @@ var an = /** @class */ function() {
3277
3283
  * will be included. Cannot contain a slash.
3278
3284
  * @returns The created `Query`.
3279
3285
  */ function ln(t, e) {
3280
- if (t = st(t, tn), rt("collectionGroup", "collection id", e), e.indexOf("/") >= 0) throw new x(V, "Invalid collection ID '" + e + "' passed to function collectionGroup(). Collection IDs must not contain '/'.");
3286
+ if (t = st(t, tn), rt("collectionGroup", "collection id", e), e.indexOf("/") >= 0) throw new M(V, "Invalid collection ID '" + e + "' passed to function collectionGroup(). Collection IDs must not contain '/'.");
3281
3287
  return new sn(t,
3282
3288
  /* converter= */ null,
3283
3289
  /**
@@ -3285,7 +3291,7 @@ var an = /** @class */ function() {
3285
3291
  * within the provided collection group.
3286
3292
  */
3287
3293
  function(t) {
3288
- return new se(Z.emptyPath(), t);
3294
+ return new ue(Z.emptyPath(), t);
3289
3295
  }(e));
3290
3296
  }
3291
3297
 
@@ -3299,7 +3305,7 @@ function fn(t, e) {
3299
3305
  return it(o), new an(t,
3300
3306
  /* converter= */ null, new nt(o));
3301
3307
  }
3302
- if (!(t instanceof an || t instanceof un)) throw new x(V, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
3308
+ if (!(t instanceof an || t instanceof un)) throw new M(V, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
3303
3309
  var a = t._path.child(Z.fromString.apply(Z, r([ e ], n)));
3304
3310
  return it(a), new an(t.firestore, t instanceof un ? t.converter : null, new nt(a));
3305
3311
  }
@@ -3329,12 +3335,12 @@ function pn(t, e) {
3329
3335
  return function(t, e) {
3330
3336
  if (t.limit !== e.limit) return !1;
3331
3337
  if (t.orderBy.length !== e.orderBy.length) return !1;
3332
- for (var n = 0; n < t.orderBy.length; n++) if (!oe(t.orderBy[n], e.orderBy[n])) return !1;
3338
+ for (var n = 0; n < t.orderBy.length; n++) if (!ae(t.orderBy[n], e.orderBy[n])) return !1;
3333
3339
  if (t.filters.length !== e.filters.length) return !1;
3334
3340
  for (var r = 0; r < t.filters.length; r++) if (i = t.filters[r], o = e.filters[r],
3335
- i.op !== o.op || !i.field.isEqual(o.field) || !Ot(i.value, o.value)) return !1;
3341
+ i.op !== o.op || !i.field.isEqual(o.field) || !Ct(i.value, o.value)) return !1;
3336
3342
  var i, o;
3337
- return t.collectionGroup === e.collectionGroup && !!t.path.isEqual(e.path) && !!ae(t.startAt, e.startAt) && ae(t.endAt, e.endAt);
3343
+ return t.collectionGroup === e.collectionGroup && !!t.path.isEqual(e.path) && !!se(t.startAt, e.startAt) && se(t.endAt, e.endAt);
3338
3344
  }(pe(t), pe(e)) && t.limitType === e.limitType;
3339
3345
  }(t._query, e._query) && t.converter === e.converter
3340
3346
  /**
@@ -3372,7 +3378,7 @@ var dn = /** @class */ function() {
3372
3378
  */
3373
3379
  function t() {
3374
3380
  for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
3375
- for (var n = 0; n < t.length; ++n) if (0 === t[n].length) throw new x(V, "Invalid field name at argument $(i + 1). Field names must not be empty.");
3381
+ for (var n = 0; n < t.length; ++n) if (0 === t[n].length) throw new M(V, "Invalid field name at argument $(i + 1). Field names must not be empty.");
3376
3382
  this._internalPath = new et(t);
3377
3383
  }
3378
3384
  /**
@@ -3424,7 +3430,7 @@ var dn = /** @class */ function() {
3424
3430
  try {
3425
3431
  return new t(It.fromBase64String(e));
3426
3432
  } catch (e) {
3427
- throw new x(V, "Failed to construct data from Base64 string: " + e);
3433
+ throw new M(V, "Failed to construct data from Base64 string: " + e);
3428
3434
  }
3429
3435
  },
3430
3436
  /**
@@ -3483,8 +3489,8 @@ function(t) {
3483
3489
  * @param longitude - The longitude as number between -180 and 180.
3484
3490
  */
3485
3491
  function t(t, e) {
3486
- if (!isFinite(t) || t < -90 || t > 90) throw new x(V, "Latitude must be a number between -90 and 90, but was: " + t);
3487
- if (!isFinite(e) || e < -180 || e > 180) throw new x(V, "Longitude must be a number between -180 and 180, but was: " + e);
3492
+ if (!isFinite(t) || t < -90 || t > 90) throw new M(V, "Latitude must be a number between -90 and 90, but was: " + t);
3493
+ if (!isFinite(e) || e < -180 || e > 180) throw new M(V, "Longitude must be a number between -180 and 180, but was: " + e);
3488
3494
  this._lat = t, this._long = e;
3489
3495
  }
3490
3496
  return Object.defineProperty(t.prototype, "latitude", {
@@ -3687,19 +3693,19 @@ function(t) {
3687
3693
  /** Parse document data from a set() call. */ function An(t, e, n, r, i, o) {
3688
3694
  void 0 === o && (o = {});
3689
3695
  var a = t.ht(o.merge || o.mergeFields ? 2 /* MergeSet */ : 0 /* Set */ , e, n, i);
3690
- Mn("Data must be an object, but it was:", a, r);
3696
+ xn("Data must be an object, but it was:", a, r);
3691
3697
  var s, u, c = jn(r, a);
3692
3698
  if (o.merge) s = new Et(a.fieldMask), u = a.fieldTransforms; else if (o.mergeFields) {
3693
3699
  for (var l = [], f = 0, h = o.mergeFields; f < h.length; f++) {
3694
- var p = xn(e, h[f], n);
3695
- if (!a.contains(p)) throw new x(V, "Field '" + p + "' is specified in your field mask but missing from your input data.");
3700
+ var p = Mn(e, h[f], n);
3701
+ if (!a.contains(p)) throw new M(V, "Field '" + p + "' is specified in your field mask but missing from your input data.");
3696
3702
  zn(l, p) || l.push(p);
3697
3703
  }
3698
3704
  s = new Et(l), u = a.fieldTransforms.filter((function(t) {
3699
3705
  return s.covers(t.field);
3700
3706
  }));
3701
3707
  } else s = null, u = a.fieldTransforms;
3702
- return new bn(new zt(c), s, u);
3708
+ return new bn(new Qt(c), s, u);
3703
3709
  }
3704
3710
 
3705
3711
  var kn = /** @class */ function(e) {
@@ -3795,8 +3801,8 @@ var Dn = /** @class */ function(e) {
3795
3801
 
3796
3802
  /** Parse update data from an update() call. */ function Fn(t, e, n, r) {
3797
3803
  var i = t.ht(1 /* Update */ , e, n);
3798
- Mn("Data must be an object, but it was:", i, r);
3799
- var o = [], a = zt.empty();
3804
+ xn("Data must be an object, but it was:", i, r);
3805
+ var o = [], a = Qt.empty();
3800
3806
  St(r, (function(t, r) {
3801
3807
  var s = Bn(e, t, n);
3802
3808
  // For Compat types, we have to "extract" the underlying types before
@@ -3815,12 +3821,12 @@ var Dn = /** @class */ function(e) {
3815
3821
  }
3816
3822
 
3817
3823
  /** Parse update data from a list of field/value arguments. */ function On(t, e, n, r, i, o) {
3818
- var a = t.ht(1 /* Update */ , e, n), s = [ xn(e, r, n) ], u = [ i ];
3819
- if (o.length % 2 != 0) throw new x(V, "Function " + e + "() needs to be called with an even number of arguments that alternate between field names and values.");
3820
- for (var c = 0; c < o.length; c += 2) s.push(xn(e, o[c])), u.push(o[c + 1]);
3824
+ var a = t.ht(1 /* Update */ , e, n), s = [ Mn(e, r, n) ], u = [ i ];
3825
+ if (o.length % 2 != 0) throw new M(V, "Function " + e + "() needs to be called with an even number of arguments that alternate between field names and values.");
3826
+ for (var c = 0; c < o.length; c += 2) s.push(Mn(e, o[c])), u.push(o[c + 1]);
3821
3827
  // We iterate in reverse order to pick the last value for a field if the
3822
3828
  // user specified the field multiple times.
3823
- for (var l = [], f = zt.empty(), h = s.length - 1; h >= 0; --h) if (!zn(l, s[h])) {
3829
+ for (var l = [], f = Qt.empty(), h = s.length - 1; h >= 0; --h) if (!zn(l, s[h])) {
3824
3830
  var d = s[h], m = u[h];
3825
3831
  // For Compat types, we have to "extract" the underlying types before
3826
3832
  // performing validation.
@@ -3859,7 +3865,7 @@ var Dn = /** @class */ function(e) {
3859
3865
  if (Rn(
3860
3866
  // Unwrap the API type from the Compat SDK. This will return the API type
3861
3867
  // from firestore-exp.
3862
- t = p(t))) return Mn("Unsupported field value:", e, t), jn(t, e);
3868
+ t = p(t))) return xn("Unsupported field value:", e, t), jn(t, e);
3863
3869
  if (t instanceof vn)
3864
3870
  // FieldValues usually parse into transforms (except deleteField())
3865
3871
  // in which case we do not want to include this field in our parsed data
@@ -3978,7 +3984,7 @@ function Rn(t) {
3978
3984
  return !("object" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof bt || t instanceof gn || t instanceof yn || t instanceof an || t instanceof vn);
3979
3985
  }
3980
3986
 
3981
- function Mn(t, e, n) {
3987
+ function xn(t, e, n) {
3982
3988
  if (!Rn(n) || !function(t) {
3983
3989
  return "object" == typeof t && null !== t && (Object.getPrototypeOf(t) === Object.prototype || null === Object.getPrototypeOf(t));
3984
3990
  }(n)) {
@@ -3989,7 +3995,7 @@ function Mn(t, e, n) {
3989
3995
 
3990
3996
  /**
3991
3997
  * Helper that calls fromDotSeparatedString() but wraps any error thrown.
3992
- */ function xn(t, e, n) {
3998
+ */ function Mn(t, e, n) {
3993
3999
  if (
3994
4000
  // If required, replace the FieldPath Compat class with with the firestore-exp
3995
4001
  // FieldPath.
@@ -4030,7 +4036,7 @@ function Gn(t, e, n, r, i) {
4030
4036
  n && (s += " (via `toFirestore()`)");
4031
4037
  var u = "";
4032
4038
  return (o || a) && (u += " (found", o && (u += " in field " + r), a && (u += " in document " + i),
4033
- u += ")"), new x(V, (s += ". ") + t + u)
4039
+ u += ")"), new M(V, (s += ". ") + t + u)
4034
4040
  /** Checks `haystack` if FieldPath `needle` is present. Runs in O(n). */;
4035
4041
  }
4036
4042
 
@@ -4263,7 +4269,7 @@ var Jn = /** @class */ function(e) {
4263
4269
  var e = In(t.firestore), n = function(t, e, n, r, i, o, a) {
4264
4270
  var s;
4265
4271
  if (i.isKeyField()) {
4266
- if ("array-contains" /* ARRAY_CONTAINS */ === o || "array-contains-any" /* ARRAY_CONTAINS_ANY */ === o) throw new x(V, "Invalid Query. You can't perform '" + o + "' queries on documentId().");
4272
+ if ("array-contains" /* ARRAY_CONTAINS */ === o || "array-contains-any" /* ARRAY_CONTAINS_ANY */ === o) throw new M(V, "Invalid Query. You can't perform '" + o + "' queries on documentId().");
4267
4273
  if ("in" /* IN */ === o || "not-in" /* NOT_IN */ === o) {
4268
4274
  pr(a, o);
4269
4275
  for (var u = [], c = 0, l = a; c < l.length; c++) {
@@ -4279,11 +4285,11 @@ var Jn = /** @class */ function(e) {
4279
4285
  } else "in" /* IN */ !== o && "not-in" /* NOT_IN */ !== o && "array-contains-any" /* ARRAY_CONTAINS_ANY */ !== o || pr(a, o),
4280
4286
  s = Cn(n, "where", a,
4281
4287
  /* allowArrays= */ "in" /* IN */ === o || "not-in" /* NOT_IN */ === o);
4282
- var h = Wt.create(i, o, s);
4288
+ var h = Yt.create(i, o, s);
4283
4289
  return function(t, e) {
4284
4290
  if (e.N()) {
4285
4291
  var n = le(t);
4286
- if (null !== n && !n.isEqual(e.field)) throw new x(V, "Invalid query. All where filters with an inequality (<, <=, !=, not-in, >, or >=) must be on the same field. But you have inequality filters on '" + n.toString() + "' and '" + e.field.toString() + "'");
4292
+ if (null !== n && !n.isEqual(e.field)) throw new M(V, "Invalid query. All where filters with an inequality (<, <=, !=, not-in, >, or >=) must be on the same field. But you have inequality filters on '" + n.toString() + "' and '" + e.field.toString() + "'");
4287
4293
  var r = ce(t);
4288
4294
  null !== r && dr(t, e.field, r);
4289
4295
  }
@@ -4329,12 +4335,12 @@ var Jn = /** @class */ function(e) {
4329
4335
  }(e.op));
4330
4336
  if (null !== i)
4331
4337
  // Special case when it's a duplicate op to give a slightly clearer error message.
4332
- throw i === e.op ? new x(V, "Invalid query. You cannot use more than one '" + e.op.toString() + "' filter.") : new x(V, "Invalid query. You cannot use '" + e.op.toString() + "' filters with '" + i.toString() + "' filters.");
4338
+ throw i === e.op ? new M(V, "Invalid query. You cannot use more than one '" + e.op.toString() + "' filter.") : new M(V, "Invalid query. You cannot use '" + e.op.toString() + "' filters with '" + i.toString() + "' filters.");
4333
4339
  }(t, h), h;
4334
4340
  }(t._query, 0, e, t.firestore._databaseId, this.dt, this.wt, this.yt);
4335
4341
  return new sn(t.firestore, t.converter, function(t, e) {
4336
4342
  var n = t.filters.concat([ e ]);
4337
- return new se(t.path, t.collectionGroup, t.explicitOrderBy.slice(), n, t.limit, t.limitType, t.startAt, t.endAt);
4343
+ return new ue(t.path, t.collectionGroup, t.explicitOrderBy.slice(), n, t.limit, t.limitType, t.startAt, t.endAt);
4338
4344
  }(t._query, n));
4339
4345
  }, n;
4340
4346
  }($n);
@@ -4361,9 +4367,9 @@ var tr = /** @class */ function(e) {
4361
4367
  }
4362
4368
  return t(n, e), n.prototype._apply = function(t) {
4363
4369
  var e = function(t, e, n) {
4364
- if (null !== t.startAt) throw new x(V, "Invalid query. You must not call startAt() or startAfter() before calling orderBy().");
4365
- if (null !== t.endAt) throw new x(V, "Invalid query. You must not call endAt() or endBefore() before calling orderBy().");
4366
- var r = new ie(e, n);
4370
+ if (null !== t.startAt) throw new M(V, "Invalid query. You must not call startAt() or startAfter() before calling orderBy().");
4371
+ if (null !== t.endAt) throw new M(V, "Invalid query. You must not call endAt() or endBefore() before calling orderBy().");
4372
+ var r = new oe(e, n);
4367
4373
  return function(t, e) {
4368
4374
  if (null === ce(t)) {
4369
4375
  // This is the first order by. It must match any inequality.
@@ -4375,7 +4381,7 @@ var tr = /** @class */ function(e) {
4375
4381
  return new sn(t.firestore, t.converter, function(t, e) {
4376
4382
  // TODO(dimond): validate that orderBy does not list the same key twice.
4377
4383
  var n = t.explicitOrderBy.concat([ e ]);
4378
- return new se(t.path, t.collectionGroup, n, t.filters.slice(), t.limit, t.limitType, t.startAt, t.endAt);
4384
+ return new ue(t.path, t.collectionGroup, n, t.filters.slice(), t.limit, t.limitType, t.startAt, t.endAt);
4379
4385
  }(t._query, e));
4380
4386
  }, n;
4381
4387
  }($n);
@@ -4401,7 +4407,7 @@ var nr = /** @class */ function(e) {
4401
4407
  }
4402
4408
  return t(n, e), n.prototype._apply = function(t) {
4403
4409
  return new sn(t.firestore, t.converter, function(t, e, n) {
4404
- return new se(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), e, n, t.startAt, t.endAt);
4410
+ return new ue(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), e, n, t.startAt, t.endAt);
4405
4411
  }(t._query, this.gt, this.vt));
4406
4412
  }, n;
4407
4413
  }($n);
@@ -4436,7 +4442,7 @@ var or = /** @class */ function(e) {
4436
4442
  return t(n, e), n.prototype._apply = function(t) {
4437
4443
  var e = fr(t, this.type, this.bt, this.Et);
4438
4444
  return new sn(t.firestore, t.converter, function(t, e) {
4439
- return new se(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, e, t.endAt);
4445
+ return new ue(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, e, t.endAt);
4440
4446
  }(t._query, e));
4441
4447
  }, n;
4442
4448
  }($n);
@@ -4461,7 +4467,7 @@ var ur = /** @class */ function(e) {
4461
4467
  return t(n, e), n.prototype._apply = function(t) {
4462
4468
  var e = fr(t, this.type, this.bt, this.Et);
4463
4469
  return new sn(t.firestore, t.converter, function(t, e) {
4464
- return new se(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, t.startAt, e);
4470
+ return new ue(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, t.startAt, e);
4465
4471
  }(t._query, e));
4466
4472
  }, n;
4467
4473
  }($n);
@@ -4479,7 +4485,7 @@ function lr() {
4479
4485
 
4480
4486
  /** Helper function to create a bound from a document or fields */ function fr(t, e, n, r) {
4481
4487
  if (n[0] = p(n[0]), n[0] instanceof Qn) return function(t, e, n, r, i) {
4482
- if (!r) throw new x(P, "Can't use a DocumentSnapshot that doesn't exist for " + n + "().");
4488
+ if (!r) throw new M(P, "Can't use a DocumentSnapshot that doesn't exist for " + n + "().");
4483
4489
  // Because people expect to continue/end a query at the exact document
4484
4490
  // provided, we need to use the implicit sort order rather than the explicit
4485
4491
  // sort order, because it's guaranteed to contain the document key. That way
@@ -4489,63 +4495,63 @@ function lr() {
4489
4495
  // results.
4490
4496
  for (var o = [], a = 0, s = he(t); a < s.length; a++) {
4491
4497
  var u = s[a];
4492
- if (u.field.isKeyField()) o.push(Rt(e, r.key)); else {
4498
+ if (u.field.isKeyField()) o.push(xt(e, r.key)); else {
4493
4499
  var c = r.data.field(u.field);
4494
- if (Pt(c)) throw new x(V, 'Invalid query. You are trying to start or end a query using a document for which the field "' + u.field + '" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');
4500
+ if (Pt(c)) throw new M(V, 'Invalid query. You are trying to start or end a query using a document for which the field "' + u.field + '" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');
4495
4501
  if (null === c) {
4496
4502
  var l = u.field.canonicalString();
4497
- throw new x(V, "Invalid query. You are trying to start or end a query using a document for which the field '" + l + "' (used as the orderBy) does not exist.");
4503
+ throw new M(V, "Invalid query. You are trying to start or end a query using a document for which the field '" + l + "' (used as the orderBy) does not exist.");
4498
4504
  }
4499
4505
  o.push(c);
4500
4506
  }
4501
4507
  }
4502
- return new re(o, i);
4508
+ return new ie(o, i);
4503
4509
  }(t._query, t.firestore._databaseId, e, n[0]._document, r);
4504
4510
  var i = In(t.firestore);
4505
4511
  return function(t, e, n, r, i, o) {
4506
4512
  // Use explicit order by's because it has to match the query the user made
4507
4513
  var a = t.explicitOrderBy;
4508
- if (i.length > a.length) throw new x(V, "Too many arguments provided to " + r + "(). The number of arguments must be less than or equal to the number of orderBy() clauses");
4514
+ if (i.length > a.length) throw new M(V, "Too many arguments provided to " + r + "(). The number of arguments must be less than or equal to the number of orderBy() clauses");
4509
4515
  for (var s = [], u = 0; u < i.length; u++) {
4510
4516
  var c = i[u];
4511
4517
  if (a[u].field.isKeyField()) {
4512
- if ("string" != typeof c) throw new x(V, "Invalid query. Expected a string for document ID in " + r + "(), but got a " + typeof c);
4513
- if (!fe(t) && -1 !== c.indexOf("/")) throw new x(V, "Invalid query. When querying a collection and ordering by documentId(), the value passed to " + r + "() must be a plain document ID, but '" + c + "' contains a slash.");
4518
+ if ("string" != typeof c) throw new M(V, "Invalid query. Expected a string for document ID in " + r + "(), but got a " + typeof c);
4519
+ if (!fe(t) && -1 !== c.indexOf("/")) throw new M(V, "Invalid query. When querying a collection and ordering by documentId(), the value passed to " + r + "() must be a plain document ID, but '" + c + "' contains a slash.");
4514
4520
  var l = t.path.child(Z.fromString(c));
4515
- if (!nt.isDocumentKey(l)) throw new x(V, "Invalid query. When querying a collection group and ordering by documentId(), the value passed to " + r + "() must result in a valid document path, but '" + l + "' is not because it contains an odd number of segments.");
4521
+ if (!nt.isDocumentKey(l)) throw new M(V, "Invalid query. When querying a collection group and ordering by documentId(), the value passed to " + r + "() must result in a valid document path, but '" + l + "' is not because it contains an odd number of segments.");
4516
4522
  var f = new nt(l);
4517
- s.push(Rt(e, f));
4523
+ s.push(xt(e, f));
4518
4524
  } else {
4519
4525
  var h = Cn(n, r, c);
4520
4526
  s.push(h);
4521
4527
  }
4522
4528
  }
4523
- return new re(s, o);
4529
+ return new ie(s, o);
4524
4530
  }(t._query, t.firestore._databaseId, i, e, n, r);
4525
4531
  }
4526
4532
 
4527
4533
  function hr(t, e, n) {
4528
4534
  if ("string" == typeof (n = p(n))) {
4529
- if ("" === n) throw new x(V, "Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");
4530
- if (!fe(e) && -1 !== n.indexOf("/")) throw new x(V, "Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '" + n + "' contains a '/' character.");
4535
+ if ("" === n) throw new M(V, "Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");
4536
+ if (!fe(e) && -1 !== n.indexOf("/")) throw new M(V, "Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '" + n + "' contains a '/' character.");
4531
4537
  var r = e.path.child(Z.fromString(n));
4532
- if (!nt.isDocumentKey(r)) throw new x(V, "Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '" + r + "' is not because it has an odd number of segments (" + r.length + ").");
4533
- return Rt(t, new nt(r));
4538
+ if (!nt.isDocumentKey(r)) throw new M(V, "Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '" + r + "' is not because it has an odd number of segments (" + r.length + ").");
4539
+ return xt(t, new nt(r));
4534
4540
  }
4535
- if (n instanceof an) return Rt(t, n._key);
4536
- throw new x(V, "Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: " + at(n) + ".");
4541
+ if (n instanceof an) return xt(t, n._key);
4542
+ throw new M(V, "Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: " + at(n) + ".");
4537
4543
  }
4538
4544
 
4539
4545
  /**
4540
4546
  * Validates that the value passed into a disjunctive filter satisfies all
4541
4547
  * array requirements.
4542
4548
  */ function pr(t, e) {
4543
- if (!Array.isArray(t) || 0 === t.length) throw new x(V, "Invalid Query. A non-empty array is required for '" + e.toString() + "' filters.");
4544
- if (t.length > 10) throw new x(V, "Invalid Query. '" + e.toString() + "' filters support a maximum of 10 elements in the value array.");
4549
+ if (!Array.isArray(t) || 0 === t.length) throw new M(V, "Invalid Query. A non-empty array is required for '" + e.toString() + "' filters.");
4550
+ if (t.length > 10) throw new M(V, "Invalid Query. '" + e.toString() + "' filters support a maximum of 10 elements in the value array.");
4545
4551
  }
4546
4552
 
4547
4553
  function dr(t, e, n) {
4548
- if (!n.isEqual(e)) throw new x(V, "Invalid query. You have a where filter with an inequality (<, <=, !=, not-in, >, or >=) on field '" + e.toString() + "' and so you must also use '" + e.toString() + "' as your first argument to orderBy(), but your first orderBy() is on field '" + n.toString() + "' instead.");
4554
+ if (!n.isEqual(e)) throw new M(V, "Invalid query. You have a where filter with an inequality (<, <=, !=, not-in, >, or >=) on field '" + e.toString() + "' and so you must also use '" + e.toString() + "' as your first argument to orderBy(), but your first orderBy() is on field '" + n.toString() + "' instead.");
4549
4555
  }
4550
4556
 
4551
4557
  /**
@@ -4615,7 +4621,7 @@ var yr = /** @class */ function(e) {
4615
4621
  }(/** @class */ function() {
4616
4622
  function t() {}
4617
4623
  return t.prototype.convertValue = function(t, e) {
4618
- switch (void 0 === e && (e = "none"), Ft(t)) {
4624
+ switch (void 0 === e && (e = "none"), Ot(t)) {
4619
4625
  case 0 /* NullValue */ :
4620
4626
  return null;
4621
4627
 
@@ -4724,14 +4730,14 @@ var yr = /** @class */ function(e) {
4724
4730
  * @returns A Promise that will be resolved with the results of the query.
4725
4731
  */ function gr(t) {
4726
4732
  !function(t) {
4727
- if (ue(t) && 0 === t.explicitOrderBy.length) throw new x(j, "limitToLast() queries require specifying at least one orderBy() clause");
4733
+ if ("L" /* Last */ === t.limitType && 0 === t.explicitOrderBy.length) throw new M(j, "limitToLast() queries require specifying at least one orderBy() clause");
4728
4734
  }((t = st(t, sn))._query);
4729
4735
  var e = Je(t.firestore), n = new yr(t.firestore);
4730
4736
  return $e(e, t._query).then((function(e) {
4731
4737
  var r = e.map((function(e) {
4732
4738
  return new Kn(t.firestore, n, e.key, e, t.converter);
4733
4739
  }));
4734
- return ue(t._query) &&
4740
+ return "L" /* Last */ === t._query.limitType &&
4735
4741
  // Limit to last queries reverse the orderBy constraint that was
4736
4742
  // specified by the user. As such, we need to reverse the order of the
4737
4743
  // results to return the documents in the expected order.
@@ -4944,12 +4950,12 @@ function br(t, e, n) {
4944
4950
  t.prototype.commit = function() {
4945
4951
  return this._verifyNotCommitted(), this._committed = !0, this._mutations.length > 0 ? this._commitHandler(this._mutations) : Promise.resolve();
4946
4952
  }, t.prototype._verifyNotCommitted = function() {
4947
- if (this._committed) throw new x(O, "A write batch can no longer be used after commit() has been called.");
4953
+ if (this._committed) throw new M(O, "A write batch can no longer be used after commit() has been called.");
4948
4954
  }, t;
4949
4955
  }();
4950
4956
 
4951
4957
  function Dr(t, e) {
4952
- if ((t = p(t)).firestore !== e) throw new x(V, "Provided document reference is from a different Firestore instance.");
4958
+ if ((t = p(t)).firestore !== e) throw new M(V, "Provided document reference is from a different Firestore instance.");
4953
4959
  return t;
4954
4960
  }
4955
4961
 
@@ -5015,7 +5021,7 @@ function Dr(t, e) {
5015
5021
  return n(this, (function(n) {
5016
5022
  switch (n.label) {
5017
5023
  case 0:
5018
- if (this.ensureCommitNotCalled(), this.mutations.length > 0) throw new x(V, "Firestore transactions require all reads to be executed before all writes.");
5024
+ if (this.ensureCommitNotCalled(), this.mutations.length > 0) throw new M(V, "Firestore transactions require all reads to be executed before all writes.");
5019
5025
  return [ 4 /*yield*/ , Ye(this.datastore, t) ];
5020
5026
 
5021
5027
  case 1:
@@ -5072,7 +5078,7 @@ function Dr(t, e) {
5072
5078
  if (n) {
5073
5079
  if (!e.isEqual(n))
5074
5080
  // This transaction will fail no matter what.
5075
- throw new x(C, "Document version changed between two reads.");
5081
+ throw new M(C, "Document version changed between two reads.");
5076
5082
  } else this.readVersions.set(t.key.toString(), e);
5077
5083
  },
5078
5084
  /**
@@ -5101,7 +5107,7 @@ function Dr(t, e) {
5101
5107
  // express that to the backend, we have to validate locally.
5102
5108
  // Note: this can change once we can send separate verify writes in the
5103
5109
  // transaction.
5104
- throw new x(V, "Can't update a document that doesn't exist.");
5110
+ throw new M(V, "Can't update a document that doesn't exist.");
5105
5111
  // Document exists, base precondition on document update time.
5106
5112
  return _e.updateTime(e);
5107
5113
  }
@@ -5175,7 +5181,7 @@ function Dr(t, e) {
5175
5181
  case D:
5176
5182
  case F:
5177
5183
  case R:
5178
- case M:
5184
+ case x:
5179
5185
  // Unauthenticated means something went wrong with our token and we need
5180
5186
  // to retry with new credentials which will happen automatically.
5181
5187
  case q:
@@ -5321,7 +5327,7 @@ function Dr(t, e) {
5321
5327
  * guarantee that the operation will not be run.
5322
5328
  */
5323
5329
  t.prototype.cancel = function(t) {
5324
- null !== this.timerHandle && (this.clearTimeout(), this.deferred.reject(new x(A, "Operation cancelled" + (t ? ": " + t : ""))));
5330
+ null !== this.timerHandle && (this.clearTimeout(), this.deferred.reject(new M(A, "Operation cancelled" + (t ? ": " + t : ""))));
5325
5331
  }, t.prototype.handleDelayElapsed = function() {
5326
5332
  var t = this;
5327
5333
  this.asyncQueue.enqueueAndForget((function() {
@@ -5658,7 +5664,7 @@ y = i + "_lite", o(new c("firestore/lite", (function(t, e) {
5658
5664
  return n && i._setSettings(n), i;
5659
5665
  }), "PUBLIC")),
5660
5666
  // RUNTIME_ENV and BUILD_TARGET are replaced by real values during the compilation
5661
- a("firestore-lite", "3.4.7", ""), a("firestore-lite", "3.4.7", "esm5");
5667
+ a("firestore-lite", "3.4.8-canary.19e31a231", ""), a("firestore-lite", "3.4.8-canary.19e31a231", "esm5");
5662
5668
 
5663
- export { yn as Bytes, un as CollectionReference, an as DocumentReference, Qn as DocumentSnapshot, dn as FieldPath, vn as FieldValue, tn as Firestore, x as FirestoreError, gn as GeoPoint, sn as Query, $n as QueryConstraint, Kn as QueryDocumentSnapshot, Hn as QuerySnapshot, bt as Timestamp, Lr as Transaction, Vr as WriteBatch, Tr as addDoc, Ar as arrayRemove, Ir as arrayUnion, cn as collection, ln as collectionGroup, rn as connectFirestoreEmulator, _r as deleteDoc, Sr as deleteField, fn as doc, mn as documentId, lr as endAt, cr as endBefore, vr as getDoc, gr as getDocs, nn as getFirestore, kr as increment, en as initializeFirestore, rr as limit, ir as limitToLast, er as orderBy, Xn as query, pn as queryEqual, hn as refEqual, jr as runTransaction, Er as serverTimestamp, wr as setDoc, g as setLogLevel, Wn as snapshotEqual, sr as startAfter, ar as startAt, on as terminate, br as updateDoc, Zn as where, Pr as writeBatch };
5669
+ export { yn as Bytes, un as CollectionReference, an as DocumentReference, Qn as DocumentSnapshot, dn as FieldPath, vn as FieldValue, tn as Firestore, M as FirestoreError, gn as GeoPoint, sn as Query, $n as QueryConstraint, Kn as QueryDocumentSnapshot, Hn as QuerySnapshot, bt as Timestamp, Lr as Transaction, Vr as WriteBatch, Tr as addDoc, Ar as arrayRemove, Ir as arrayUnion, cn as collection, ln as collectionGroup, rn as connectFirestoreEmulator, _r as deleteDoc, Sr as deleteField, fn as doc, mn as documentId, lr as endAt, cr as endBefore, vr as getDoc, gr as getDocs, nn as getFirestore, kr as increment, en as initializeFirestore, rr as limit, ir as limitToLast, er as orderBy, Xn as query, pn as queryEqual, hn as refEqual, jr as runTransaction, Er as serverTimestamp, wr as setDoc, g as setLogLevel, Wn as snapshotEqual, sr as startAfter, ar as startAt, on as terminate, br as updateDoc, Zn as where, Pr as writeBatch };
5664
5670
  //# sourceMappingURL=index.browser.esm5.js.map