@firebase/firestore 3.4.4-canary.2dd99ae2d → 3.4.4-canary.434d87ee2

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 (112) hide show
  1. package/dist/firestore/src/api/snapshot.d.ts +1 -2
  2. package/dist/firestore/src/core/target.d.ts +8 -4
  3. package/dist/firestore/src/lite-api/query.d.ts +2 -2
  4. package/dist/firestore/src/local/index_manager.d.ts +52 -0
  5. package/dist/firestore/src/local/indexeddb_index_manager.d.ts +21 -2
  6. package/dist/firestore/src/local/indexeddb_persistence.d.ts +4 -4
  7. package/dist/firestore/src/local/indexeddb_remote_document_cache.d.ts +2 -8
  8. package/dist/firestore/src/local/indexeddb_schema.d.ts +149 -7
  9. package/dist/firestore/src/local/local_serializer.d.ts +7 -2
  10. package/dist/firestore/src/local/memory_index_manager.d.ts +11 -0
  11. package/dist/firestore/src/local/memory_persistence.d.ts +3 -2
  12. package/dist/firestore/src/local/memory_remote_document_cache.d.ts +1 -3
  13. package/dist/firestore/src/local/persistence.d.ts +2 -2
  14. package/dist/firestore/src/local/remote_document_cache.d.ts +3 -0
  15. package/dist/firestore/src/local/simple_db.d.ts +1 -0
  16. package/dist/firestore/src/model/field_index.d.ts +2 -2
  17. package/dist/firestore/test/unit/local/persistence_test_helpers.d.ts +1 -0
  18. package/dist/firestore/test/unit/local/test_index_manager.d.ts +11 -0
  19. package/dist/firestore/test/unit/local/test_remote_document_cache.d.ts +2 -0
  20. package/dist/firestore/test/unit/local/test_remote_document_change_buffer.d.ts +1 -1
  21. package/dist/firestore/test/util/helpers.d.ts +1 -1
  22. package/dist/index.d.ts +1 -2
  23. package/dist/index.esm2017.js +3329 -3095
  24. package/dist/index.esm2017.js.map +1 -1
  25. package/dist/index.esm5.js +3590 -3370
  26. package/dist/index.esm5.js.map +1 -1
  27. package/dist/index.node.cjs.js +446 -150
  28. package/dist/index.node.cjs.js.map +1 -1
  29. package/dist/index.node.mjs +446 -150
  30. package/dist/index.node.mjs.map +1 -1
  31. package/dist/index.rn.js +3536 -3302
  32. package/dist/index.rn.js.map +1 -1
  33. package/dist/internal.d.ts +175 -6
  34. package/dist/lite/firestore/src/api/snapshot.d.ts +1 -2
  35. package/dist/lite/firestore/src/core/target.d.ts +8 -4
  36. package/dist/lite/firestore/src/lite-api/query.d.ts +2 -2
  37. package/dist/lite/firestore/src/local/index_manager.d.ts +52 -0
  38. package/dist/lite/firestore/src/local/indexeddb_index_manager.d.ts +21 -2
  39. package/dist/lite/firestore/src/local/indexeddb_persistence.d.ts +4 -4
  40. package/dist/lite/firestore/src/local/indexeddb_remote_document_cache.d.ts +2 -8
  41. package/dist/lite/firestore/src/local/indexeddb_schema.d.ts +149 -7
  42. package/dist/lite/firestore/src/local/local_serializer.d.ts +7 -2
  43. package/dist/lite/firestore/src/local/memory_index_manager.d.ts +11 -0
  44. package/dist/lite/firestore/src/local/memory_persistence.d.ts +3 -2
  45. package/dist/lite/firestore/src/local/memory_remote_document_cache.d.ts +1 -3
  46. package/dist/lite/firestore/src/local/persistence.d.ts +2 -2
  47. package/dist/lite/firestore/src/local/remote_document_cache.d.ts +3 -0
  48. package/dist/lite/firestore/src/local/simple_db.d.ts +1 -0
  49. package/dist/lite/firestore/src/model/field_index.d.ts +2 -2
  50. package/dist/lite/firestore/test/unit/local/persistence_test_helpers.d.ts +1 -0
  51. package/dist/lite/firestore/test/unit/local/test_index_manager.d.ts +11 -0
  52. package/dist/lite/firestore/test/unit/local/test_remote_document_cache.d.ts +2 -0
  53. package/dist/lite/firestore/test/unit/local/test_remote_document_change_buffer.d.ts +1 -1
  54. package/dist/lite/firestore/test/util/helpers.d.ts +1 -1
  55. package/dist/lite/index.browser.esm2017.js +1146 -1143
  56. package/dist/lite/index.browser.esm2017.js.map +1 -1
  57. package/dist/lite/index.browser.esm5.js +332 -331
  58. package/dist/lite/index.browser.esm5.js.map +1 -1
  59. package/dist/lite/index.node.cjs.js +36 -29
  60. package/dist/lite/index.node.cjs.js.map +1 -1
  61. package/dist/lite/index.node.mjs +36 -29
  62. package/dist/lite/index.node.mjs.map +1 -1
  63. package/dist/lite/index.rn.esm2017.js +301 -298
  64. package/dist/lite/index.rn.esm2017.js.map +1 -1
  65. package/dist/lite/internal.d.ts +2 -2
  66. package/dist/lite/packages/firestore/dist/lite/index.browser.esm2017.d.ts +121 -121
  67. package/dist/lite/packages/firestore/src/api/snapshot.d.ts +1 -2
  68. package/dist/lite/packages/firestore/src/core/target.d.ts +8 -4
  69. package/dist/lite/packages/firestore/src/lite-api/query.d.ts +2 -2
  70. package/dist/lite/packages/firestore/src/local/index_manager.d.ts +52 -0
  71. package/dist/lite/packages/firestore/src/local/indexeddb_index_manager.d.ts +21 -2
  72. package/dist/lite/packages/firestore/src/local/indexeddb_persistence.d.ts +4 -4
  73. package/dist/lite/packages/firestore/src/local/indexeddb_remote_document_cache.d.ts +2 -8
  74. package/dist/lite/packages/firestore/src/local/indexeddb_schema.d.ts +149 -7
  75. package/dist/lite/packages/firestore/src/local/local_serializer.d.ts +7 -2
  76. package/dist/lite/packages/firestore/src/local/memory_index_manager.d.ts +11 -0
  77. package/dist/lite/packages/firestore/src/local/memory_persistence.d.ts +3 -2
  78. package/dist/lite/packages/firestore/src/local/memory_remote_document_cache.d.ts +1 -3
  79. package/dist/lite/packages/firestore/src/local/persistence.d.ts +2 -2
  80. package/dist/lite/packages/firestore/src/local/remote_document_cache.d.ts +3 -0
  81. package/dist/lite/packages/firestore/src/local/simple_db.d.ts +1 -0
  82. package/dist/lite/packages/firestore/src/model/field_index.d.ts +2 -2
  83. package/dist/lite/packages/firestore/test/unit/local/persistence_test_helpers.d.ts +1 -0
  84. package/dist/lite/packages/firestore/test/unit/local/test_index_manager.d.ts +11 -0
  85. package/dist/lite/packages/firestore/test/unit/local/test_remote_document_cache.d.ts +2 -0
  86. package/dist/lite/packages/firestore/test/unit/local/test_remote_document_change_buffer.d.ts +1 -1
  87. package/dist/lite/packages/firestore/test/util/helpers.d.ts +1 -1
  88. package/dist/lite/private.d.ts +2 -2
  89. package/dist/packages/firestore/dist/index.esm2017.d.ts +176 -176
  90. package/dist/packages/firestore/src/api/snapshot.d.ts +1 -2
  91. package/dist/packages/firestore/src/core/target.d.ts +8 -4
  92. package/dist/packages/firestore/src/lite-api/query.d.ts +2 -2
  93. package/dist/packages/firestore/src/local/index_manager.d.ts +52 -0
  94. package/dist/packages/firestore/src/local/indexeddb_index_manager.d.ts +21 -2
  95. package/dist/packages/firestore/src/local/indexeddb_persistence.d.ts +4 -4
  96. package/dist/packages/firestore/src/local/indexeddb_remote_document_cache.d.ts +2 -8
  97. package/dist/packages/firestore/src/local/indexeddb_schema.d.ts +149 -7
  98. package/dist/packages/firestore/src/local/local_serializer.d.ts +7 -2
  99. package/dist/packages/firestore/src/local/memory_index_manager.d.ts +11 -0
  100. package/dist/packages/firestore/src/local/memory_persistence.d.ts +3 -2
  101. package/dist/packages/firestore/src/local/memory_remote_document_cache.d.ts +1 -3
  102. package/dist/packages/firestore/src/local/persistence.d.ts +2 -2
  103. package/dist/packages/firestore/src/local/remote_document_cache.d.ts +3 -0
  104. package/dist/packages/firestore/src/local/simple_db.d.ts +1 -0
  105. package/dist/packages/firestore/src/model/field_index.d.ts +2 -2
  106. package/dist/packages/firestore/test/unit/local/persistence_test_helpers.d.ts +1 -0
  107. package/dist/packages/firestore/test/unit/local/test_index_manager.d.ts +11 -0
  108. package/dist/packages/firestore/test/unit/local/test_remote_document_cache.d.ts +2 -0
  109. package/dist/packages/firestore/test/unit/local/test_remote_document_change_buffer.d.ts +1 -1
  110. package/dist/packages/firestore/test/util/helpers.d.ts +1 -1
  111. package/dist/private.d.ts +175 -6
  112. package/package.json +9 -9
@@ -4,7 +4,7 @@ import { SDK_VERSION as i, _registerComponent as o, registerVersion as a, _getPr
4
4
 
5
5
  import { Component as c } from "@firebase/component";
6
6
 
7
- import { Logger as f, LogLevel as l } from "@firebase/logger";
7
+ import { Logger as l, LogLevel as f } from "@firebase/logger";
8
8
 
9
9
  import { FirebaseError as h, getModularInstance as p, createMockUserToken as d } from "@firebase/util";
10
10
 
@@ -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.5-canary.2dd99ae2d", v = new f("@firebase/firestore");
70
+ var y = "9.6.6-canary.434d87ee2", v = new l("@firebase/firestore");
71
71
 
72
72
  /**
73
73
  * @license
@@ -104,7 +104,7 @@ function g(t) {
104
104
 
105
105
  function w(t) {
106
106
  for (var e = [], n = 1; n < arguments.length; n++) e[n - 1] = arguments[n];
107
- if (v.logLevel <= l.DEBUG) {
107
+ if (v.logLevel <= f.DEBUG) {
108
108
  var i = e.map(T);
109
109
  v.debug.apply(v, r([ "Firestore (" + y + "): " + t ], i));
110
110
  }
@@ -112,7 +112,7 @@ function w(t) {
112
112
 
113
113
  function b(t) {
114
114
  for (var e = [], n = 1; n < arguments.length; n++) e[n - 1] = arguments[n];
115
- if (v.logLevel <= l.ERROR) {
115
+ if (v.logLevel <= f.ERROR) {
116
116
  var i = e.map(T);
117
117
  v.error.apply(v, r([ "Firestore (" + y + "): " + t ], i));
118
118
  }
@@ -122,7 +122,7 @@ function b(t) {
122
122
  * @internal
123
123
  */ function _(t) {
124
124
  for (var e = [], n = 1; n < arguments.length; n++) e[n - 1] = arguments[n];
125
- if (v.logLevel <= l.WARN) {
125
+ if (v.logLevel <= f.WARN) {
126
126
  var i = e.map(T);
127
127
  v.warn.apply(v, r([ "Firestore (" + y + "): " + t ], i));
128
128
  }
@@ -651,7 +651,7 @@ function ut(t, e) {
651
651
  return null == t;
652
652
  }
653
653
 
654
- /** Returns whether the value represents -0. */ function ft(t) {
654
+ /** Returns whether the value represents -0. */ function lt(t) {
655
655
  // Detect if the value is -0.0. Based on polyfill from
656
656
  // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
657
657
  return 0 === t && 1 / t == -1 / 0;
@@ -676,7 +676,7 @@ function ut(t, e) {
676
676
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
677
677
  * See the License for the specific language governing permissions and
678
678
  * limitations under the License.
679
- */ var lt, ht, pt = {
679
+ */ var ft, ht, pt = {
680
680
  BatchGetDocuments: "batchGet",
681
681
  Commit: "commit",
682
682
  RunQuery: "runQuery"
@@ -812,7 +812,7 @@ function dt(t) {
812
812
  /**
813
813
  * A Rest-based connection that relies on the native HTTP stack
814
814
  * (e.g. `fetch` or a polyfill).
815
- */ (ht = lt || (lt = {}))[ht.OK = 0] = "OK", ht[ht.CANCELLED = 1] = "CANCELLED",
815
+ */ (ht = ft || (ft = {}))[ht.OK = 0] = "OK", ht[ht.CANCELLED = 1] = "CANCELLED",
816
816
  ht[ht.UNKNOWN = 2] = "UNKNOWN", ht[ht.INVALID_ARGUMENT = 3] = "INVALID_ARGUMENT",
817
817
  ht[ht.DEADLINE_EXCEEDED = 4] = "DEADLINE_EXCEEDED", ht[ht.NOT_FOUND = 5] = "NOT_FOUND",
818
818
  ht[ht.ALREADY_EXISTS = 6] = "ALREADY_EXISTS", ht[ht.PERMISSION_DENIED = 7] = "PERMISSION_DENIED",
@@ -1508,7 +1508,7 @@ var At = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
1508
1508
  if ("integerValue" in t && "integerValue" in e) return Vt(t.integerValue) === Vt(e.integerValue);
1509
1509
  if ("doubleValue" in t && "doubleValue" in e) {
1510
1510
  var n = Vt(t.doubleValue), r = Vt(e.doubleValue);
1511
- return n === r ? ft(n) === ft(r) : isNaN(n) && isNaN(r);
1511
+ return n === r ? lt(n) === lt(r) : isNaN(n) && isNaN(r);
1512
1512
  }
1513
1513
  return !1;
1514
1514
  }(t, e);
@@ -2044,7 +2044,7 @@ var Wt = /** @class */ function(e) {
2044
2044
  }));
2045
2045
  }, n;
2046
2046
  }(Wt), re = function(t, e) {
2047
- this.position = t, this.before = e;
2047
+ this.position = t, this.inclusive = e;
2048
2048
  }, ie = function(t, e /* ASCENDING */) {
2049
2049
  void 0 === e && (e = "asc"), this.field = t, this.dir = e;
2050
2050
  };
@@ -2056,7 +2056,7 @@ var Wt = /** @class */ function(e) {
2056
2056
  function ae(t, e) {
2057
2057
  if (null === t) return null === e;
2058
2058
  if (null === e) return !1;
2059
- if (t.before !== e.before || t.position.length !== e.position.length) return !1;
2059
+ if (t.inclusive !== e.inclusive || t.position.length !== e.position.length) return !1;
2060
2060
  for (var n = 0; n < t.position.length; n++) if (!Ot(t.position[n], e.position[n])) return !1;
2061
2061
  return !0;
2062
2062
  }
@@ -2106,7 +2106,7 @@ function ce(t) {
2106
2106
  return t.explicitOrderBy.length > 0 ? t.explicitOrderBy[0].field : null;
2107
2107
  }
2108
2108
 
2109
- function fe(t) {
2109
+ function le(t) {
2110
2110
  for (var e = 0, n = t.filters; e < n.length; e++) {
2111
2111
  var r = n[e];
2112
2112
  if (r.N()) return r.field;
@@ -2121,7 +2121,7 @@ function fe(t) {
2121
2121
  /**
2122
2122
  * Returns whether the query matches a collection group rather than a specific
2123
2123
  * collection.
2124
- */ function le(t) {
2124
+ */ function fe(t) {
2125
2125
  return null !== t.collectionGroup;
2126
2126
  }
2127
2127
 
@@ -2133,7 +2133,7 @@ function fe(t) {
2133
2133
  var e = I(t);
2134
2134
  if (null === e.$) {
2135
2135
  e.$ = [];
2136
- var n = fe(e), r = ce(e);
2136
+ var n = le(e), r = ce(e);
2137
2137
  if (null !== n && null === r)
2138
2138
  // In order to implicitly add key ordering, we must also add the
2139
2139
  // inequality filter field for it to be a valid query.
@@ -2166,7 +2166,7 @@ function fe(t) {
2166
2166
  n.push(new ie(o.field, a));
2167
2167
  }
2168
2168
  // We need to swap the cursors to match the now-flipped query ordering.
2169
- var s = e.endAt ? new re(e.endAt.position, !e.endAt.before) : null, u = e.startAt ? new re(e.startAt.position, !e.startAt.before) : null;
2169
+ 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;
2170
2170
  // Now return as a LimitType.First query.
2171
2171
  e.S = Ht(e.path, e.collectionGroup, n, e.filters, e.limit, s, u);
2172
2172
  }
@@ -2200,7 +2200,7 @@ function fe(t) {
2200
2200
  */
2201
2201
  function de(t, e) {
2202
2202
  return function(t) {
2203
- return "number" == typeof t && Number.isInteger(t) && !ft(t) && t <= Number.MAX_SAFE_INTEGER && t >= Number.MIN_SAFE_INTEGER;
2203
+ return "number" == typeof t && Number.isInteger(t) && !lt(t) && t <= Number.MAX_SAFE_INTEGER && t >= Number.MIN_SAFE_INTEGER;
2204
2204
  }(e) ?
2205
2205
  /**
2206
2206
  * Returns an IntegerValue for `value`.
@@ -2222,7 +2222,7 @@ function de(t, e) {
2222
2222
  };
2223
2223
  }
2224
2224
  return {
2225
- doubleValue: ft(e) ? "-0" : e
2225
+ doubleValue: lt(e) ? "-0" : e
2226
2226
  };
2227
2227
  }(t, e);
2228
2228
  }
@@ -2393,7 +2393,7 @@ function Ce(t, e) {
2393
2393
  function je(t, e) {
2394
2394
  var n, r = function(t) {
2395
2395
  var e = Z.fromString(t);
2396
- return E(Qe(e)), e;
2396
+ return E(ze(e)), e;
2397
2397
  }(e);
2398
2398
  if (r.get(1) !== t.databaseId.projectId) throw new U(V, "Tried to deserialize key from different project: " + r.get(1) + " vs " + t.databaseId.projectId);
2399
2399
  if (r.get(3) !== t.databaseId.database) throw new U(V, "Tried to deserialize key from different database: " + r.get(3) + " vs " + t.databaseId.database);
@@ -2416,29 +2416,21 @@ function Me(t, e, n) {
2416
2416
  }
2417
2417
 
2418
2418
  function Ue(t) {
2419
- return {
2420
- before: t.before,
2421
- values: t.position
2422
- };
2423
- }
2424
-
2425
- // visible for testing
2426
- function xe(t) {
2427
2419
  return ke[t];
2428
2420
  }
2429
2421
 
2430
2422
  // visible for testing
2431
- function Be(t) {
2423
+ function xe(t) {
2432
2424
  return Ve[t];
2433
2425
  }
2434
2426
 
2435
- function Ge(t) {
2427
+ function Be(t) {
2436
2428
  return {
2437
2429
  fieldPath: t.canonicalString()
2438
2430
  };
2439
2431
  }
2440
2432
 
2441
- function ze(t) {
2433
+ function Ge(t) {
2442
2434
  var e = [];
2443
2435
  return t.fields.forEach((function(t) {
2444
2436
  return e.push(t.canonicalString());
@@ -2447,7 +2439,7 @@ function ze(t) {
2447
2439
  };
2448
2440
  }
2449
2441
 
2450
- function Qe(t) {
2442
+ function ze(t) {
2451
2443
  // Resource names have at least 4 components (project ID, database ID)
2452
2444
  return t.length >= 4 && "projects" === t.get(0) && "databases" === t.get(2);
2453
2445
  }
@@ -2467,7 +2459,7 @@ function Qe(t) {
2467
2459
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2468
2460
  * See the License for the specific language governing permissions and
2469
2461
  * limitations under the License.
2470
- */ function Ke(t) {
2462
+ */ function Qe(t) {
2471
2463
  return new De(t, /* useProto3Json= */ !0);
2472
2464
  }
2473
2465
 
@@ -2495,7 +2487,7 @@ function Qe(t) {
2495
2487
  * backoff curve, and a +/- 50% "jitter" that is calculated and added to the
2496
2488
  * base delay. This prevents clients from accidentally synchronizing their
2497
2489
  * delays causing spikes of load to the backend.
2498
- */ var He = /** @class */ function() {
2490
+ */ var Ke = /** @class */ function() {
2499
2491
  function t(
2500
2492
  /**
2501
2493
  * The AsyncQueue to run backoff operations on.
@@ -2569,7 +2561,7 @@ function Qe(t) {
2569
2561
  /** Returns a random value in the range [-currentBaseMs/2, currentBaseMs/2] */ t.prototype.Y = function() {
2570
2562
  return (Math.random() - .5) * this.j;
2571
2563
  }, t;
2572
- }(), We = /** @class */ function(e) {
2564
+ }(), He = /** @class */ function(e) {
2573
2565
  function n(t, n, r, i) {
2574
2566
  var o = this;
2575
2567
  return (o = e.call(this) || this).authCredentials = t, o.appCheckCredentials = n,
@@ -2629,7 +2621,7 @@ function Qe(t) {
2629
2621
  */
2630
2622
  // TODO(firestorexp): Make sure there is only one Datastore instance per
2631
2623
  // firestore-exp client.
2632
- function Ye(t, r) {
2624
+ function We(t, r) {
2633
2625
  return e(this, void 0, void 0, (function() {
2634
2626
  var e, i, o;
2635
2627
  return n(this, (function(n) {
@@ -2645,7 +2637,7 @@ function Ye(t, r) {
2645
2637
  delete: Ce(t, e.key)
2646
2638
  }; else if (e instanceof Ee) n = {
2647
2639
  update: Me(t, e.key, e.data),
2648
- updateMask: ze(e.fieldMask)
2640
+ updateMask: Ge(e.fieldMask)
2649
2641
  }; else {
2650
2642
  if (!(e instanceof Ae)) return S();
2651
2643
  n = {
@@ -2695,7 +2687,7 @@ function Ye(t, r) {
2695
2687
  }));
2696
2688
  }
2697
2689
 
2698
- function $e(t, r) {
2690
+ function Ye(t, r) {
2699
2691
  return e(this, void 0, void 0, (function() {
2700
2692
  var e, i, o, a, s, u;
2701
2693
  return n(this, (function(n) {
@@ -2734,7 +2726,7 @@ function $e(t, r) {
2734
2726
  }));
2735
2727
  }
2736
2728
 
2737
- function Xe(t, r) {
2729
+ function $e(t, r) {
2738
2730
  return e(this, void 0, void 0, (function() {
2739
2731
  var e, i;
2740
2732
  return n(this, (function(n) {
@@ -2759,34 +2751,34 @@ function Xe(t, r) {
2759
2751
  if ("==" /* EQUAL */ === t.op) {
2760
2752
  if (xt(t.value)) return {
2761
2753
  unaryFilter: {
2762
- field: Ge(t.field),
2754
+ field: Be(t.field),
2763
2755
  op: "IS_NAN"
2764
2756
  }
2765
2757
  };
2766
2758
  if (Ut(t.value)) return {
2767
2759
  unaryFilter: {
2768
- field: Ge(t.field),
2760
+ field: Be(t.field),
2769
2761
  op: "IS_NULL"
2770
2762
  }
2771
2763
  };
2772
2764
  } else if ("!=" /* NOT_EQUAL */ === t.op) {
2773
2765
  if (xt(t.value)) return {
2774
2766
  unaryFilter: {
2775
- field: Ge(t.field),
2767
+ field: Be(t.field),
2776
2768
  op: "IS_NOT_NAN"
2777
2769
  }
2778
2770
  };
2779
2771
  if (Ut(t.value)) return {
2780
2772
  unaryFilter: {
2781
- field: Ge(t.field),
2773
+ field: Be(t.field),
2782
2774
  op: "IS_NOT_NULL"
2783
2775
  }
2784
2776
  };
2785
2777
  }
2786
2778
  return {
2787
2779
  fieldFilter: {
2788
- field: Ge(t.field),
2789
- op: Be(t.op),
2780
+ field: Be(t.field),
2781
+ op: xe(t.op),
2790
2782
  value: t.value
2791
2783
  }
2792
2784
  };
@@ -2806,20 +2798,27 @@ function Xe(t, r) {
2806
2798
  // visible for testing
2807
2799
  return function(t) {
2808
2800
  return {
2809
- field: Ge(t.field),
2810
- direction: xe(t.dir)
2801
+ field: Be(t.field),
2802
+ direction: Ue(t.dir)
2811
2803
  };
2812
2804
  }(t);
2813
2805
  }));
2814
2806
  }(e.orderBy);
2815
2807
  o && (n.structuredQuery.orderBy = o);
2816
- var a = function(t, e) {
2808
+ var a, s = function(t, e) {
2817
2809
  return t.F || ct(e) ? e : {
2818
2810
  value: e
2819
2811
  };
2820
2812
  }(t, e.limit);
2821
- return null !== a && (n.structuredQuery.limit = a), e.startAt && (n.structuredQuery.startAt = Ue(e.startAt)),
2822
- e.endAt && (n.structuredQuery.endAt = Ue(e.endAt)), n;
2813
+ return null !== s && (n.structuredQuery.limit = s), e.startAt && (n.structuredQuery.startAt = {
2814
+ before: (a = e.startAt).inclusive,
2815
+ values: a.position
2816
+ }), e.endAt && (n.structuredQuery.endAt = function(t) {
2817
+ return {
2818
+ before: !t.inclusive,
2819
+ values: t.position
2820
+ };
2821
+ }(e.endAt)), n;
2823
2822
  }(e.q, pe(r)), [ 4 /*yield*/ , e.T("RunQuery", i.parent, {
2824
2823
  structuredQuery: i.structuredQuery
2825
2824
  }) ];
@@ -2857,7 +2856,7 @@ function Xe(t, r) {
2857
2856
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2858
2857
  * See the License for the specific language governing permissions and
2859
2858
  * limitations under the License.
2860
- */ var Je = new Map;
2859
+ */ var Xe = new Map;
2861
2860
 
2862
2861
  /**
2863
2862
  * An instance map that ensures only one Datastore exists per Firestore
@@ -2867,17 +2866,17 @@ function Xe(t, r) {
2867
2866
  * Returns an initialized and started Datastore for the given Firestore
2868
2867
  * instance. Callers must invoke removeComponents() when the Firestore
2869
2868
  * instance is terminated.
2870
- */ function Ze(t) {
2869
+ */ function Je(t) {
2871
2870
  if (t._terminated) throw new U(O, "The client has already been terminated.");
2872
- if (!Je.has(t)) {
2871
+ if (!Xe.has(t)) {
2873
2872
  w("ComponentProvider", "Initializing Datastore");
2874
2873
  var e = function(t) {
2875
2874
  return new mt(t, fetch.bind(null));
2876
2875
  }((i = t._databaseId, o = t.app.options.appId || "", a = t._persistenceKey, s = t._freezeSettings(),
2877
- new $(i, o, a, s.host, s.ssl, s.experimentalForceLongPolling, s.experimentalAutoDetectLongPolling, s.useFetchStreams))), n = Ke(t._databaseId), r = function(t, e, n, r) {
2878
- return new We(t, e, n, r);
2876
+ new $(i, o, a, s.host, s.ssl, s.experimentalForceLongPolling, s.experimentalAutoDetectLongPolling, s.useFetchStreams))), n = Qe(t._databaseId), r = function(t, e, n, r) {
2877
+ return new He(t, e, n, r);
2879
2878
  }(t._authCredentials, t._appCheckCredentials, e, n);
2880
- Je.set(t, r);
2879
+ Xe.set(t, r);
2881
2880
  }
2882
2881
  var i, o, a, s;
2883
2882
  /**
@@ -2895,7 +2894,7 @@ function Xe(t, r) {
2895
2894
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2896
2895
  * See the License for the specific language governing permissions and
2897
2896
  * limitations under the License.
2898
- */ return Je.get(t);
2897
+ */ return Xe.get(t);
2899
2898
  }
2900
2899
 
2901
2900
  /**
@@ -2906,7 +2905,7 @@ function Xe(t, r) {
2906
2905
  * A concrete type describing all the values that can be applied via a
2907
2906
  * user-supplied `FirestoreSettings` object. This is a separate type so that
2908
2907
  * defaults can be supplied and the value can be checked for equality.
2909
- */ var tn = /** @class */ function() {
2908
+ */ var Ze = /** @class */ function() {
2910
2909
  function t(t) {
2911
2910
  var e;
2912
2911
  if (void 0 === t.host) {
@@ -2926,14 +2925,14 @@ function Xe(t, r) {
2926
2925
  return t.prototype.isEqual = function(t) {
2927
2926
  return this.host === t.host && this.ssl === t.ssl && this.credentials === t.credentials && this.cacheSizeBytes === t.cacheSizeBytes && this.experimentalForceLongPolling === t.experimentalForceLongPolling && this.experimentalAutoDetectLongPolling === t.experimentalAutoDetectLongPolling && this.ignoreUndefinedProperties === t.ignoreUndefinedProperties && this.useFetchStreams === t.useFetchStreams;
2928
2927
  }, t;
2929
- }(), en = /** @class */ function() {
2928
+ }(), tn = /** @class */ function() {
2930
2929
  /** @hideconstructor */
2931
2930
  function t(t, e, n) {
2932
2931
  this._authCredentials = e, this._appCheckCredentials = n,
2933
2932
  /**
2934
2933
  * Whether it's a Firestore or Firestore Lite instance.
2935
2934
  */
2936
- this.type = "firestore-lite", this._persistenceKey = "(lite)", this._settings = new tn({}),
2935
+ this.type = "firestore-lite", this._persistenceKey = "(lite)", this._settings = new Ze({}),
2937
2936
  this._settingsFrozen = !1, t instanceof X ? this._databaseId = t : (this._app = t,
2938
2937
  this._databaseId = function(t) {
2939
2938
  if (!Object.prototype.hasOwnProperty.apply(t.options, [ "projectId" ])) throw new U(V, '"projectId" not provided in firebase.initializeApp.');
@@ -2965,7 +2964,7 @@ function Xe(t, r) {
2965
2964
  configurable: !0
2966
2965
  }), t.prototype._setSettings = function(t) {
2967
2966
  if (this._settingsFrozen) throw new U(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.");
2968
- this._settings = new tn(t), void 0 !== t.credentials && (this._authCredentials = function(t) {
2967
+ this._settings = new Ze(t), void 0 !== t.credentials && (this._authCredentials = function(t) {
2969
2968
  if (!t) return new G;
2970
2969
  switch (t.type) {
2971
2970
  case "gapi":
@@ -3003,8 +3002,8 @@ function Xe(t, r) {
3003
3002
  * Only ever called once.
3004
3003
  */
3005
3004
  t.prototype._terminate = function() {
3006
- return t = this, (e = Je.get(t)) && (w("ComponentProvider", "Removing Datastore"),
3007
- Je.delete(t), e.terminate()), Promise.resolve();
3005
+ return t = this, (e = Xe.get(t)) && (w("ComponentProvider", "Removing Datastore"),
3006
+ Xe.delete(t), e.terminate()), Promise.resolve();
3008
3007
  var t, e;
3009
3008
  }, t;
3010
3009
  }();
@@ -3029,7 +3028,7 @@ function Xe(t, r) {
3029
3028
  * The Cloud Firestore service interface.
3030
3029
  *
3031
3030
  * Do not call this constructor directly. Instead, use {@link getFirestore}.
3032
- */ function nn(t, e) {
3031
+ */ function en(t, e) {
3033
3032
  var n = _getProvider(t, "firestore/lite");
3034
3033
  if (n.isInitialized()) throw new U(O, "Firestore can only be initialized once per app.");
3035
3034
  return n.initialize({
@@ -3045,7 +3044,7 @@ function Xe(t, r) {
3045
3044
  * @param app - The {@link @firebase/app#FirebaseApp} instance that the returned `Firestore`
3046
3045
  * instance is associated with.
3047
3046
  * @returns The `Firestore` instance of the provided app.
3048
- */ function rn(t) {
3047
+ */ function nn(t) {
3049
3048
  return void 0 === t && (t = s()), _getProvider(t, "firestore/lite").getImmediate();
3050
3049
  }
3051
3050
 
@@ -3061,10 +3060,10 @@ function Xe(t, r) {
3061
3060
  * @param port - the emulator port (ex: 9000).
3062
3061
  * @param options.mockUserToken - the mock auth token to use for unit testing
3063
3062
  * Security Rules.
3064
- */ function on(t, e, n, r) {
3063
+ */ function rn(t, e, n, r) {
3065
3064
  var i;
3066
3065
  void 0 === r && (r = {});
3067
- var o = (t = st(t, en))._getSettings();
3066
+ var o = (t = st(t, tn))._getSettings();
3068
3067
  if ("firestore.googleapis.com" !== o.host && o.host !== e && _("Host has been set in both settings() and useEmulator(), emulator host will be used"),
3069
3068
  t._setSettings(Object.assign(Object.assign({}, o), {
3070
3069
  host: e + ":" + n,
@@ -3102,8 +3101,8 @@ function Xe(t, r) {
3102
3101
  * @param firestore - The `Firestore` instance to terminate.
3103
3102
  * @returns A `Promise` that is resolved when the instance has been successfully
3104
3103
  * terminated.
3105
- */ function an(t) {
3106
- return t = st(t, en), u(t.app, "firestore/lite"), t._delete()
3104
+ */ function on(t) {
3105
+ return t = st(t, tn), u(t.app, "firestore/lite"), t._delete()
3107
3106
  /**
3108
3107
  * @license
3109
3108
  * Copyright 2020 Google LLC
@@ -3143,7 +3142,7 @@ function Xe(t, r) {
3143
3142
  */;
3144
3143
  }
3145
3144
 
3146
- var sn = /** @class */ function() {
3145
+ var an = /** @class */ function() {
3147
3146
  /** @hideconstructor */
3148
3147
  function t(t,
3149
3148
  /**
@@ -3184,14 +3183,14 @@ var sn = /** @class */ function() {
3184
3183
  * The collection this `DocumentReference` belongs to.
3185
3184
  */
3186
3185
  get: function() {
3187
- return new cn(this.firestore, this.converter, this._key.path.popLast());
3186
+ return new un(this.firestore, this.converter, this._key.path.popLast());
3188
3187
  },
3189
3188
  enumerable: !1,
3190
3189
  configurable: !0
3191
3190
  }), t.prototype.withConverter = function(e) {
3192
3191
  return new t(this.firestore, e, this._key);
3193
3192
  }, t;
3194
- }(), un = /** @class */ function() {
3193
+ }(), sn = /** @class */ function() {
3195
3194
  // This is the lite version of the Query class in the main SDK.
3196
3195
  /** @hideconstructor protected */
3197
3196
  function t(t,
@@ -3206,7 +3205,7 @@ var sn = /** @class */ function() {
3206
3205
  return t.prototype.withConverter = function(e) {
3207
3206
  return new t(this.firestore, e, this._query);
3208
3207
  }, t;
3209
- }(), cn = /** @class */ function(e) {
3208
+ }(), un = /** @class */ function(e) {
3210
3209
  /** @hideconstructor */
3211
3210
  function n(t, n, r) {
3212
3211
  var i = this;
@@ -3237,7 +3236,7 @@ var sn = /** @class */ function() {
3237
3236
  */
3238
3237
  get: function() {
3239
3238
  var t = this._path.popLast();
3240
- return t.isEmpty() ? null : new sn(this.firestore,
3239
+ return t.isEmpty() ? null : new an(this.firestore,
3241
3240
  /* converter= */ null, new nt(t));
3242
3241
  },
3243
3242
  enumerable: !1,
@@ -3245,20 +3244,20 @@ var sn = /** @class */ function() {
3245
3244
  }), n.prototype.withConverter = function(t) {
3246
3245
  return new n(this.firestore, t, this._path);
3247
3246
  }, n;
3248
- }(un);
3247
+ }(sn);
3249
3248
 
3250
3249
  /**
3251
3250
  * A `Query` refers to a query which you can read or listen to. You can also
3252
3251
  * construct refined `Query` objects by adding filters and ordering.
3253
- */ function fn(t, e) {
3252
+ */ function cn(t, e) {
3254
3253
  for (var n = [], i = 2; i < arguments.length; i++) n[i - 2] = arguments[i];
3255
- if (t = p(t), rt("collection", "path", e), t instanceof en) {
3254
+ if (t = p(t), rt("collection", "path", e), t instanceof tn) {
3256
3255
  var o = Z.fromString.apply(Z, r([ e ], n));
3257
- return ot(o), new cn(t, /* converter= */ null, o);
3256
+ return ot(o), new un(t, /* converter= */ null, o);
3258
3257
  }
3259
- if (!(t instanceof sn || t instanceof cn)) throw new U(V, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
3258
+ if (!(t instanceof an || t instanceof un)) throw new U(V, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
3260
3259
  var a = t._path.child(Z.fromString.apply(Z, r([ e ], n)));
3261
- return ot(a), new cn(t.firestore,
3260
+ return ot(a), new un(t.firestore,
3262
3261
  /* converter= */ null, a);
3263
3262
  }
3264
3263
 
@@ -3275,8 +3274,8 @@ var sn = /** @class */ function() {
3275
3274
  * will be included. Cannot contain a slash.
3276
3275
  * @returns The created `Query`.
3277
3276
  */ function ln(t, e) {
3278
- if (t = st(t, en), rt("collectionGroup", "collection id", e), e.indexOf("/") >= 0) throw new U(V, "Invalid collection ID '" + e + "' passed to function collectionGroup(). Collection IDs must not contain '/'.");
3279
- return new un(t,
3277
+ if (t = st(t, tn), rt("collectionGroup", "collection id", e), e.indexOf("/") >= 0) throw new U(V, "Invalid collection ID '" + e + "' passed to function collectionGroup(). Collection IDs must not contain '/'.");
3278
+ return new sn(t,
3280
3279
  /* converter= */ null,
3281
3280
  /**
3282
3281
  * Creates a new Query for a collection group query that matches all documents
@@ -3287,19 +3286,19 @@ var sn = /** @class */ function() {
3287
3286
  }(e));
3288
3287
  }
3289
3288
 
3290
- function hn(t, e) {
3289
+ function fn(t, e) {
3291
3290
  for (var n = [], i = 2; i < arguments.length; i++) n[i - 2] = arguments[i];
3292
3291
  if (t = p(t),
3293
3292
  // We allow omission of 'pathString' but explicitly prohibit passing in both
3294
3293
  // 'undefined' and 'null'.
3295
- 1 === arguments.length && (e = vt.R()), rt("doc", "path", e), t instanceof en) {
3294
+ 1 === arguments.length && (e = vt.R()), rt("doc", "path", e), t instanceof tn) {
3296
3295
  var o = Z.fromString.apply(Z, r([ e ], n));
3297
- return it(o), new sn(t,
3296
+ return it(o), new an(t,
3298
3297
  /* converter= */ null, new nt(o));
3299
3298
  }
3300
- if (!(t instanceof sn || t instanceof cn)) throw new U(V, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
3299
+ if (!(t instanceof an || t instanceof un)) throw new U(V, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
3301
3300
  var a = t._path.child(Z.fromString.apply(Z, r([ e ], n)));
3302
- return it(a), new sn(t.firestore, t instanceof cn ? t.converter : null, new nt(a));
3301
+ return it(a), new an(t.firestore, t instanceof un ? t.converter : null, new nt(a));
3303
3302
  }
3304
3303
 
3305
3304
  /**
@@ -3309,8 +3308,8 @@ function hn(t, e) {
3309
3308
  * @param right - A reference to compare.
3310
3309
  * @returns true if the references point to the same location in the same
3311
3310
  * Firestore database.
3312
- */ function pn(t, e) {
3313
- return t = p(t), e = p(e), (t instanceof sn || t instanceof cn) && (e instanceof sn || e instanceof cn) && t.firestore === e.firestore && t.path === e.path && t.converter === e.converter
3311
+ */ function hn(t, e) {
3312
+ return t = p(t), e = p(e), (t instanceof an || t instanceof un) && (e instanceof an || e instanceof un) && t.firestore === e.firestore && t.path === e.path && t.converter === e.converter
3314
3313
  /**
3315
3314
  * Returns true if the provided queries point to the same collection and apply
3316
3315
  * the same constraints.
@@ -3322,8 +3321,8 @@ function hn(t, e) {
3322
3321
  */;
3323
3322
  }
3324
3323
 
3325
- function dn(t, e) {
3326
- return t = p(t), e = p(e), t instanceof un && e instanceof un && t.firestore === e.firestore && function(t, e) {
3324
+ function pn(t, e) {
3325
+ return t = p(t), e = p(e), t instanceof sn && e instanceof sn && t.firestore === e.firestore && function(t, e) {
3327
3326
  return function(t, e) {
3328
3327
  if (t.limit !== e.limit) return !1;
3329
3328
  if (t.orderBy.length !== e.orderBy.length) return !1;
@@ -3361,7 +3360,7 @@ function dn(t, e) {
3361
3360
  */;
3362
3361
  }
3363
3362
 
3364
- var mn = /** @class */ function() {
3363
+ var dn = /** @class */ function() {
3365
3364
  /**
3366
3365
  * Creates a `FieldPath` from the provided field names. If more than one field
3367
3366
  * name is provided, the path will point to a nested field in a document.
@@ -3386,8 +3385,8 @@ var mn = /** @class */ function() {
3386
3385
  /**
3387
3386
  * Returns a special sentinel `FieldPath` to refer to the ID of a document.
3388
3387
  * It can be used in queries to sort or filter by the document ID.
3389
- */ function yn() {
3390
- return new mn("__name__");
3388
+ */ function mn() {
3389
+ return new dn("__name__");
3391
3390
  }
3392
3391
 
3393
3392
  /**
@@ -3408,7 +3407,7 @@ var mn = /** @class */ function() {
3408
3407
  */
3409
3408
  /**
3410
3409
  * An immutable object representing an array of bytes.
3411
- */ var vn = /** @class */ function() {
3410
+ */ var yn = /** @class */ function() {
3412
3411
  /** @hideconstructor */
3413
3412
  function t(t) {
3414
3413
  this._byteString = t;
@@ -3466,14 +3465,14 @@ var mn = /** @class */ function() {
3466
3465
  t.prototype.isEqual = function(t) {
3467
3466
  return this._byteString.isEqual(t._byteString);
3468
3467
  }, t;
3469
- }(), gn =
3468
+ }(), vn =
3470
3469
  /**
3471
3470
  * @param _methodName - The public API endpoint that returns this class.
3472
3471
  * @hideconstructor
3473
3472
  */
3474
3473
  function(t) {
3475
3474
  this._methodName = t;
3476
- }, wn = /** @class */ function() {
3475
+ }, gn = /** @class */ function() {
3477
3476
  /**
3478
3477
  * Creates a new immutable `GeoPoint` object with the provided latitude and
3479
3478
  * longitude values.
@@ -3526,14 +3525,14 @@ function(t) {
3526
3525
  t.prototype._compareTo = function(t) {
3527
3526
  return gt(this._lat, t._lat) || gt(this._long, t._long);
3528
3527
  }, t;
3529
- }(), bn = /^__.*__$/, _n = /** @class */ function() {
3528
+ }(), wn = /^__.*__$/, bn = /** @class */ function() {
3530
3529
  function t(t, e, n) {
3531
3530
  this.data = t, this.fieldMask = e, this.fieldTransforms = n;
3532
3531
  }
3533
3532
  return t.prototype.toMutation = function(t, e) {
3534
3533
  return null !== this.fieldMask ? new Ee(t, this.data, this.fieldMask, e, this.fieldTransforms) : new Se(t, this.data, e, this.fieldTransforms);
3535
3534
  }, t;
3536
- }(), Tn = /** @class */ function() {
3535
+ }(), _n = /** @class */ function() {
3537
3536
  function t(t,
3538
3537
  // The fieldMask does not include document transforms.
3539
3538
  e, n) {
@@ -3563,7 +3562,7 @@ function(t) {
3563
3562
  /**
3564
3563
  * Sentinel values that can be used when writing document fields with `set()`
3565
3564
  * or `update()`.
3566
- */ function Sn(t) {
3565
+ */ function Tn(t) {
3567
3566
  switch (t) {
3568
3567
  case 0 /* Set */ :
3569
3568
  // fall through
@@ -3581,7 +3580,7 @@ function(t) {
3581
3580
  }
3582
3581
  }
3583
3582
 
3584
- /** A "context" object passed around while parsing user data. */ var En = /** @class */ function() {
3583
+ /** A "context" object passed around while parsing user data. */ var Sn = /** @class */ function() {
3585
3584
  /**
3586
3585
  * Initializes a ParseContext with the given source and path.
3587
3586
  *
@@ -3619,16 +3618,16 @@ function(t) {
3619
3618
  enumerable: !1,
3620
3619
  configurable: !0
3621
3620
  }),
3622
- /** Returns a new context with the specified settings overwritten. */ t.prototype.nt = function(e) {
3621
+ /** Returns a new context with the specified settings overwritten. */ t.prototype.et = function(e) {
3623
3622
  return new t(Object.assign(Object.assign({}, this.settings), e), this.databaseId, this.q, this.ignoreUndefinedProperties, this.fieldTransforms, this.fieldMask);
3624
- }, t.prototype.et = function(t) {
3625
- var e, n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), r = this.nt({
3623
+ }, t.prototype.nt = function(t) {
3624
+ var e, n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), r = this.et({
3626
3625
  path: n,
3627
3626
  rt: !1
3628
3627
  });
3629
3628
  return r.st(t), r;
3630
3629
  }, t.prototype.it = function(t) {
3631
- var e, n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), r = this.nt({
3630
+ var e, n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), r = this.et({
3632
3631
  path: n,
3633
3632
  rt: !1
3634
3633
  });
@@ -3636,12 +3635,12 @@ function(t) {
3636
3635
  }, t.prototype.ot = function(t) {
3637
3636
  // TODO(b/34871131): We don't support array paths right now; so make path
3638
3637
  // undefined.
3639
- return this.nt({
3638
+ return this.et({
3640
3639
  path: void 0,
3641
3640
  rt: !0
3642
3641
  });
3643
3642
  }, t.prototype.ut = function(t) {
3644
- return zn(t, this.settings.methodName, this.settings.ct || !1, this.path, this.settings.at);
3643
+ return Gn(t, this.settings.methodName, this.settings.ct || !1, this.path, this.settings.at);
3645
3644
  },
3646
3645
  /** Returns 'true' if 'fieldPath' was traversed when creating this context. */ t.prototype.contains = function(t) {
3647
3646
  return void 0 !== this.fieldMask.find((function(e) {
@@ -3655,15 +3654,15 @@ function(t) {
3655
3654
  if (this.path) for (var t = 0; t < this.path.length; t++) this.st(this.path.get(t));
3656
3655
  }, t.prototype.st = function(t) {
3657
3656
  if (0 === t.length) throw this.ut("Document fields must not be empty");
3658
- if (Sn(this.tt) && bn.test(t)) throw this.ut('Document fields cannot begin and end with "__"');
3657
+ if (Tn(this.tt) && wn.test(t)) throw this.ut('Document fields cannot begin and end with "__"');
3659
3658
  }, t;
3660
- }(), In = /** @class */ function() {
3659
+ }(), En = /** @class */ function() {
3661
3660
  function t(t, e, n) {
3662
- this.databaseId = t, this.ignoreUndefinedProperties = e, this.q = n || Ke(t)
3661
+ this.databaseId = t, this.ignoreUndefinedProperties = e, this.q = n || Qe(t)
3663
3662
  /** Creates a new top-level parse context. */;
3664
3663
  }
3665
3664
  return t.prototype.ht = function(t, e, n, r) {
3666
- return void 0 === r && (r = !1), new En({
3665
+ return void 0 === r && (r = !1), new Sn({
3667
3666
  tt: t,
3668
3667
  methodName: e,
3669
3668
  at: n,
@@ -3677,30 +3676,30 @@ function(t) {
3677
3676
  /**
3678
3677
  * Helper for parsing raw user input (provided via the API) into internal model
3679
3678
  * classes.
3680
- */ function An(t) {
3681
- var e = t._freezeSettings(), n = Ke(t._databaseId);
3682
- return new In(t._databaseId, !!e.ignoreUndefinedProperties, n);
3679
+ */ function In(t) {
3680
+ var e = t._freezeSettings(), n = Qe(t._databaseId);
3681
+ return new En(t._databaseId, !!e.ignoreUndefinedProperties, n);
3683
3682
  }
3684
3683
 
3685
- /** Parse document data from a set() call. */ function kn(t, e, n, r, i, o) {
3684
+ /** Parse document data from a set() call. */ function An(t, e, n, r, i, o) {
3686
3685
  void 0 === o && (o = {});
3687
3686
  var a = t.ht(o.merge || o.mergeFields ? 2 /* MergeSet */ : 0 /* Set */ , e, n, i);
3688
- Un("Data must be an object, but it was:", a, r);
3689
- var s, u, c = Rn(r, a);
3687
+ Mn("Data must be an object, but it was:", a, r);
3688
+ var s, u, c = Ln(r, a);
3690
3689
  if (o.merge) s = new Et(a.fieldMask), u = a.fieldTransforms; else if (o.mergeFields) {
3691
- for (var f = [], l = 0, h = o.mergeFields; l < h.length; l++) {
3692
- var p = xn(e, h[l], n);
3690
+ for (var l = [], f = 0, h = o.mergeFields; f < h.length; f++) {
3691
+ var p = Un(e, h[f], n);
3693
3692
  if (!a.contains(p)) throw new U(V, "Field '" + p + "' is specified in your field mask but missing from your input data.");
3694
- Qn(f, p) || f.push(p);
3693
+ zn(l, p) || l.push(p);
3695
3694
  }
3696
- s = new Et(f), u = a.fieldTransforms.filter((function(t) {
3695
+ s = new Et(l), u = a.fieldTransforms.filter((function(t) {
3697
3696
  return s.covers(t.field);
3698
3697
  }));
3699
3698
  } else s = null, u = a.fieldTransforms;
3700
- return new _n(new zt(c), s, u);
3699
+ return new bn(new zt(c), s, u);
3701
3700
  }
3702
3701
 
3703
- var Vn = /** @class */ function(e) {
3702
+ var kn = /** @class */ function(e) {
3704
3703
  function n() {
3705
3704
  return null !== e && e.apply(this, arguments) || this;
3706
3705
  }
@@ -3712,7 +3711,7 @@ var Vn = /** @class */ function(e) {
3712
3711
  }, n.prototype.isEqual = function(t) {
3713
3712
  return t instanceof n;
3714
3713
  }, n;
3715
- }(gn);
3714
+ }(vn);
3716
3715
 
3717
3716
  /**
3718
3717
  * Creates a child context for parsing SerializableFieldValues.
@@ -3729,8 +3728,8 @@ var Vn = /** @class */ function(e) {
3729
3728
  * context.
3730
3729
  * @param context - The parent context.
3731
3730
  * @param arrayElement - Whether or not the FieldValue has an array.
3732
- */ function Dn(t, e, n) {
3733
- return new En({
3731
+ */ function Vn(t, e, n) {
3732
+ return new Sn({
3734
3733
  tt: 3 /* Argument */ ,
3735
3734
  at: e.settings.at,
3736
3735
  methodName: t._methodName,
@@ -3738,7 +3737,7 @@ var Vn = /** @class */ function(e) {
3738
3737
  }, e.databaseId, e.q, e.ignoreUndefinedProperties);
3739
3738
  }
3740
3739
 
3741
- var Pn = /** @class */ function(e) {
3740
+ var Dn = /** @class */ function(e) {
3742
3741
  function n() {
3743
3742
  return null !== e && e.apply(this, arguments) || this;
3744
3743
  }
@@ -3747,37 +3746,37 @@ var Pn = /** @class */ function(e) {
3747
3746
  }, n.prototype.isEqual = function(t) {
3748
3747
  return t instanceof n;
3749
3748
  }, n;
3750
- }(gn), Nn = /** @class */ function(e) {
3749
+ }(vn), Pn = /** @class */ function(e) {
3751
3750
  function n(t, n) {
3752
3751
  var r = this;
3753
3752
  return (r = e.call(this, t) || this).lt = n, r;
3754
3753
  }
3755
3754
  return t(n, e), n.prototype._toFieldTransform = function(t) {
3756
- var e = Dn(this, t,
3755
+ var e = Vn(this, t,
3757
3756
  /*array=*/ !0), n = this.lt.map((function(t) {
3758
- return Ln(t, e);
3757
+ return jn(t, e);
3759
3758
  })), r = new ve(n);
3760
3759
  return new be(t.path, r);
3761
3760
  }, n.prototype.isEqual = function(t) {
3762
3761
  // TODO(mrschmidt): Implement isEquals
3763
3762
  return this === t;
3764
3763
  }, n;
3765
- }(gn), qn = /** @class */ function(e) {
3764
+ }(vn), Nn = /** @class */ function(e) {
3766
3765
  function n(t, n) {
3767
3766
  var r = this;
3768
3767
  return (r = e.call(this, t) || this).lt = n, r;
3769
3768
  }
3770
3769
  return t(n, e), n.prototype._toFieldTransform = function(t) {
3771
- var e = Dn(this, t,
3770
+ var e = Vn(this, t,
3772
3771
  /*array=*/ !0), n = this.lt.map((function(t) {
3773
- return Ln(t, e);
3772
+ return jn(t, e);
3774
3773
  })), r = new ge(n);
3775
3774
  return new be(t.path, r);
3776
3775
  }, n.prototype.isEqual = function(t) {
3777
3776
  // TODO(mrschmidt): Implement isEquals
3778
3777
  return this === t;
3779
3778
  }, n;
3780
- }(gn), Fn = /** @class */ function(e) {
3779
+ }(vn), qn = /** @class */ function(e) {
3781
3780
  function n(t, n) {
3782
3781
  var r = this;
3783
3782
  return (r = e.call(this, t) || this).ft = n, r;
@@ -3789,50 +3788,50 @@ var Pn = /** @class */ function(e) {
3789
3788
  // TODO(mrschmidt): Implement isEquals
3790
3789
  return this === t;
3791
3790
  }, n;
3792
- }(gn);
3791
+ }(vn);
3793
3792
 
3794
- /** Parse update data from an update() call. */ function On(t, e, n, r) {
3793
+ /** Parse update data from an update() call. */ function Fn(t, e, n, r) {
3795
3794
  var i = t.ht(1 /* Update */ , e, n);
3796
- Un("Data must be an object, but it was:", i, r);
3795
+ Mn("Data must be an object, but it was:", i, r);
3797
3796
  var o = [], a = zt.empty();
3798
3797
  St(r, (function(t, r) {
3799
- var s = Gn(e, t, n);
3798
+ var s = Bn(e, t, n);
3800
3799
  // For Compat types, we have to "extract" the underlying types before
3801
3800
  // performing validation.
3802
3801
  r = p(r);
3803
3802
  var u = i.it(s);
3804
- if (r instanceof Vn)
3803
+ if (r instanceof kn)
3805
3804
  // Add it to the field mask, but don't add anything to updateData.
3806
3805
  o.push(s); else {
3807
- var c = Ln(r, u);
3806
+ var c = jn(r, u);
3808
3807
  null != c && (o.push(s), a.set(s, c));
3809
3808
  }
3810
3809
  }));
3811
3810
  var s = new Et(o);
3812
- return new Tn(a, s, i.fieldTransforms);
3811
+ return new _n(a, s, i.fieldTransforms);
3813
3812
  }
3814
3813
 
3815
- /** Parse update data from a list of field/value arguments. */ function Cn(t, e, n, r, i, o) {
3816
- var a = t.ht(1 /* Update */ , e, n), s = [ xn(e, r, n) ], u = [ i ];
3814
+ /** Parse update data from a list of field/value arguments. */ function On(t, e, n, r, i, o) {
3815
+ var a = t.ht(1 /* Update */ , e, n), s = [ Un(e, r, n) ], u = [ i ];
3817
3816
  if (o.length % 2 != 0) throw new U(V, "Function " + e + "() needs to be called with an even number of arguments that alternate between field names and values.");
3818
- for (var c = 0; c < o.length; c += 2) s.push(xn(e, o[c])), u.push(o[c + 1]);
3817
+ for (var c = 0; c < o.length; c += 2) s.push(Un(e, o[c])), u.push(o[c + 1]);
3819
3818
  // We iterate in reverse order to pick the last value for a field if the
3820
3819
  // user specified the field multiple times.
3821
- for (var f = [], l = zt.empty(), h = s.length - 1; h >= 0; --h) if (!Qn(f, s[h])) {
3820
+ for (var l = [], f = zt.empty(), h = s.length - 1; h >= 0; --h) if (!zn(l, s[h])) {
3822
3821
  var d = s[h], m = u[h];
3823
3822
  // For Compat types, we have to "extract" the underlying types before
3824
3823
  // performing validation.
3825
3824
  m = p(m);
3826
3825
  var y = a.it(d);
3827
- if (m instanceof Vn)
3826
+ if (m instanceof kn)
3828
3827
  // Add it to the field mask, but don't add anything to updateData.
3829
- f.push(d); else {
3830
- var v = Ln(m, y);
3831
- null != v && (f.push(d), l.set(d, v));
3828
+ l.push(d); else {
3829
+ var v = jn(m, y);
3830
+ null != v && (l.push(d), f.set(d, v));
3832
3831
  }
3833
3832
  }
3834
- var g = new Et(f);
3835
- return new Tn(l, g, a.fieldTransforms);
3833
+ var g = new Et(l);
3834
+ return new _n(f, g, a.fieldTransforms);
3836
3835
  }
3837
3836
 
3838
3837
  /**
@@ -3841,8 +3840,8 @@ var Pn = /** @class */ function(e) {
3841
3840
  *
3842
3841
  * @param allowArrays - Whether the query value is an array that may directly
3843
3842
  * contain additional arrays (e.g. the operand of an `in` query).
3844
- */ function jn(t, e, n, r) {
3845
- return void 0 === r && (r = !1), Ln(n, t.ht(r ? 4 /* ArrayArgument */ : 3 /* Argument */ , e));
3843
+ */ function Cn(t, e, n, r) {
3844
+ return void 0 === r && (r = !1), jn(n, t.ht(r ? 4 /* ArrayArgument */ : 3 /* Argument */ , e));
3846
3845
  }
3847
3846
 
3848
3847
  /**
@@ -3853,12 +3852,12 @@ var Pn = /** @class */ function(e) {
3853
3852
  * the source of the data being parsed, etc.
3854
3853
  * @returns The parsed value, or null if the value was a FieldValue sentinel
3855
3854
  * that should not be included in the resulting parsed data.
3856
- */ function Ln(t, e) {
3857
- if (Mn(
3855
+ */ function jn(t, e) {
3856
+ if (Rn(
3858
3857
  // Unwrap the API type from the Compat SDK. This will return the API type
3859
3858
  // from firestore-exp.
3860
- t = p(t))) return Un("Unsupported field value:", e, t), Rn(t, e);
3861
- if (t instanceof gn)
3859
+ t = p(t))) return Mn("Unsupported field value:", e, t), Ln(t, e);
3860
+ if (t instanceof vn)
3862
3861
  // FieldValues usually parse into transforms (except deleteField())
3863
3862
  // in which case we do not want to include this field in our parsed data
3864
3863
  // (as doing so will overwrite the field directly prior to the transform
@@ -3870,7 +3869,7 @@ var Pn = /** @class */ function(e) {
3870
3869
  */
3871
3870
  return function(t, e) {
3872
3871
  // Sentinels are only supported with writes, and not within arrays.
3873
- if (!Sn(e.tt)) throw e.ut(t._methodName + "() can only be used with update() and set()");
3872
+ if (!Tn(e.tt)) throw e.ut(t._methodName + "() can only be used with update() and set()");
3874
3873
  if (!e.path) throw e.ut(t._methodName + "() is not currently supported inside arrays");
3875
3874
  var n = t._toFieldTransform(e);
3876
3875
  n && e.fieldTransforms.push(n);
@@ -3893,7 +3892,7 @@ var Pn = /** @class */ function(e) {
3893
3892
  if (e.settings.rt && 4 /* ArrayArgument */ !== e.tt) throw e.ut("Nested arrays are not supported");
3894
3893
  return function(t, e) {
3895
3894
  for (var n = [], r = 0, i = 0, o = t; i < o.length; i++) {
3896
- var a = Ln(o[i], e.ot(r));
3895
+ var a = jn(o[i], e.ot(r));
3897
3896
  null == a && (
3898
3897
  // Just include nulls in the array for fields being replaced with a
3899
3898
  // sentinel.
@@ -3934,16 +3933,16 @@ var Pn = /** @class */ function(e) {
3934
3933
  timestampValue: Pe(e.q, r)
3935
3934
  };
3936
3935
  }
3937
- if (t instanceof wn) return {
3936
+ if (t instanceof gn) return {
3938
3937
  geoPointValue: {
3939
3938
  latitude: t.latitude,
3940
3939
  longitude: t.longitude
3941
3940
  }
3942
3941
  };
3943
- if (t instanceof vn) return {
3942
+ if (t instanceof yn) return {
3944
3943
  bytesValue: Ne(e.q, t._byteString)
3945
3944
  };
3946
- if (t instanceof sn) {
3945
+ if (t instanceof an) {
3947
3946
  var i = e.databaseId, o = t.firestore._databaseId;
3948
3947
  if (!o.isEqual(i)) throw e.ut("Document reference is for database " + o.projectId + "/" + o.database + " but should be for database " + i.projectId + "/" + i.database);
3949
3948
  return {
@@ -3954,7 +3953,7 @@ var Pn = /** @class */ function(e) {
3954
3953
  }(t, e);
3955
3954
  }
3956
3955
 
3957
- function Rn(t, e) {
3956
+ function Ln(t, e) {
3958
3957
  var n = {};
3959
3958
  return function(t) {
3960
3959
  for (var e in t) if (Object.prototype.hasOwnProperty.call(t, e)) return !1;
@@ -3963,7 +3962,7 @@ function Rn(t, e) {
3963
3962
  // If we encounter an empty object, we explicitly add it to the update
3964
3963
  // mask to ensure that the server creates a map entry.
3965
3964
  e.path && e.path.length > 0 && e.fieldMask.push(e.path) : St(t, (function(t, r) {
3966
- var i = Ln(r, e.et(t));
3965
+ var i = jn(r, e.nt(t));
3967
3966
  null != i && (n[t] = i);
3968
3967
  })), {
3969
3968
  mapValue: {
@@ -3972,12 +3971,12 @@ function Rn(t, e) {
3972
3971
  };
3973
3972
  }
3974
3973
 
3975
- function Mn(t) {
3976
- return !("object" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof bt || t instanceof wn || t instanceof vn || t instanceof sn || t instanceof gn);
3974
+ function Rn(t) {
3975
+ 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);
3977
3976
  }
3978
3977
 
3979
- function Un(t, e, n) {
3980
- if (!Mn(n) || !function(t) {
3978
+ function Mn(t, e, n) {
3979
+ if (!Rn(n) || !function(t) {
3981
3980
  return "object" == typeof t && null !== t && (Object.getPrototypeOf(t) === Object.prototype || null === Object.getPrototypeOf(t));
3982
3981
  }(n)) {
3983
3982
  var r = at(n);
@@ -3987,20 +3986,20 @@ function Un(t, e, n) {
3987
3986
 
3988
3987
  /**
3989
3988
  * Helper that calls fromDotSeparatedString() but wraps any error thrown.
3990
- */ function xn(t, e, n) {
3989
+ */ function Un(t, e, n) {
3991
3990
  if (
3992
3991
  // If required, replace the FieldPath Compat class with with the firestore-exp
3993
3992
  // FieldPath.
3994
- (e = p(e)) instanceof mn) return e._internalPath;
3995
- if ("string" == typeof e) return Gn(t, e);
3996
- throw zn("Field path arguments must be of type string or ", t,
3993
+ (e = p(e)) instanceof dn) return e._internalPath;
3994
+ if ("string" == typeof e) return Bn(t, e);
3995
+ throw Gn("Field path arguments must be of type string or ", t,
3997
3996
  /* hasConverter= */ !1,
3998
3997
  /* path= */ void 0, n);
3999
3998
  }
4000
3999
 
4001
4000
  /**
4002
4001
  * Matches any characters in a field path string that are reserved.
4003
- */ var Bn = new RegExp("[~\\*/\\[\\]]");
4002
+ */ var xn = new RegExp("[~\\*/\\[\\]]");
4004
4003
 
4005
4004
  /**
4006
4005
  * Wraps fromDotSeparatedString with an error message about the method that
@@ -4010,20 +4009,20 @@ function Un(t, e, n) {
4010
4009
  * split on dots.
4011
4010
  * @param targetDoc - The document against which the field path will be
4012
4011
  * evaluated.
4013
- */ function Gn(t, e, n) {
4014
- if (e.search(Bn) >= 0) throw zn("Invalid field path (" + e + "). Paths must not contain '~', '*', '/', '[', or ']'", t,
4012
+ */ function Bn(t, e, n) {
4013
+ if (e.search(xn) >= 0) throw Gn("Invalid field path (" + e + "). Paths must not contain '~', '*', '/', '[', or ']'", t,
4015
4014
  /* hasConverter= */ !1,
4016
4015
  /* path= */ void 0, n);
4017
4016
  try {
4018
- return (new (mn.bind.apply(mn, r([ void 0 ], e.split(".")))))._internalPath;
4017
+ return (new (dn.bind.apply(dn, r([ void 0 ], e.split(".")))))._internalPath;
4019
4018
  } catch (r) {
4020
- throw zn("Invalid field path (" + e + "). Paths must not be empty, begin with '.', end with '.', or contain '..'", t,
4019
+ throw Gn("Invalid field path (" + e + "). Paths must not be empty, begin with '.', end with '.', or contain '..'", t,
4021
4020
  /* hasConverter= */ !1,
4022
4021
  /* path= */ void 0, n);
4023
4022
  }
4024
4023
  }
4025
4024
 
4026
- function zn(t, e, n, r, i) {
4025
+ function Gn(t, e, n, r, i) {
4027
4026
  var o = r && !r.isEmpty(), a = void 0 !== i, s = "Function " + e + "() called with invalid data";
4028
4027
  n && (s += " (via `toFirestore()`)");
4029
4028
  var u = "";
@@ -4032,7 +4031,7 @@ function zn(t, e, n, r, i) {
4032
4031
  /** Checks `haystack` if FieldPath `needle` is present. Runs in O(n). */;
4033
4032
  }
4034
4033
 
4035
- function Qn(t, e) {
4034
+ function zn(t, e) {
4036
4035
  return t.some((function(t) {
4037
4036
  return t.isEqual(e);
4038
4037
  }));
@@ -4062,7 +4061,7 @@ function Qn(t, e) {
4062
4061
  * For a `DocumentSnapshot` that points to a non-existing document, any data
4063
4062
  * access will return 'undefined'. You can use the `exists()` method to
4064
4063
  * explicitly verify a document's existence.
4065
- */ var Kn = /** @class */ function() {
4064
+ */ var Qn = /** @class */ function() {
4066
4065
  // Note: This class is stripped down version of the DocumentSnapshot in
4067
4066
  // the legacy SDK. The changes are:
4068
4067
  // - No support for SnapshotMetadata.
@@ -4083,7 +4082,7 @@ function Qn(t, e) {
4083
4082
  * The `DocumentReference` for the document included in the `DocumentSnapshot`.
4084
4083
  */
4085
4084
  get: function() {
4086
- return new sn(this._firestore, this._converter, this._key);
4085
+ return new an(this._firestore, this._converter, this._key);
4087
4086
  },
4088
4087
  enumerable: !1,
4089
4088
  configurable: !0
@@ -4108,7 +4107,7 @@ function Qn(t, e) {
4108
4107
  if (this._converter) {
4109
4108
  // We only want to use the converter and create a new DocumentSnapshot
4110
4109
  // if a converter has been provided.
4111
- var t = new Hn(this._firestore, this._userDataWriter, this._key, this._document,
4110
+ var t = new Kn(this._firestore, this._userDataWriter, this._key, this._document,
4112
4111
  /* converter= */ null);
4113
4112
  return this._converter.fromFirestore(t);
4114
4113
  }
@@ -4128,11 +4127,11 @@ function Qn(t, e) {
4128
4127
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4129
4128
  t.prototype.get = function(t) {
4130
4129
  if (this._document) {
4131
- var e = this._document.data.field($n("DocumentSnapshot.get", t));
4130
+ var e = this._document.data.field(Yn("DocumentSnapshot.get", t));
4132
4131
  if (null !== e) return this._userDataWriter.convertValue(e);
4133
4132
  }
4134
4133
  }, t;
4135
- }(), Hn = /** @class */ function(e) {
4134
+ }(), Kn = /** @class */ function(e) {
4136
4135
  function n() {
4137
4136
  return null !== e && e.apply(this, arguments) || this;
4138
4137
  }
@@ -4144,7 +4143,7 @@ function Qn(t, e) {
4144
4143
  */ return t(n, e), n.prototype.data = function() {
4145
4144
  return e.prototype.data.call(this);
4146
4145
  }, n;
4147
- }(Kn), Wn = /** @class */ function() {
4146
+ }(Qn), Hn = /** @class */ function() {
4148
4147
  /** @hideconstructor */
4149
4148
  function t(t, e) {
4150
4149
  this._docs = e, this.query = t;
@@ -4198,15 +4197,15 @@ function Qn(t, e) {
4198
4197
  * @param right - A snapshot to compare.
4199
4198
  * @returns true if the snapshots are equal.
4200
4199
  */
4201
- function Yn(t, e) {
4202
- return t = p(t), e = p(e), t instanceof Kn && e instanceof Kn ? t._firestore === e._firestore && t._key.isEqual(e._key) && (null === t._document ? null === e._document : t._document.isEqual(e._document)) && t._converter === e._converter : t instanceof Wn && e instanceof Wn && dn(t.query, e.query) && wt(t.docs, e.docs, Yn)
4200
+ function Wn(t, e) {
4201
+ return t = p(t), e = p(e), t instanceof Qn && e instanceof Qn ? t._firestore === e._firestore && t._key.isEqual(e._key) && (null === t._document ? null === e._document : t._document.isEqual(e._document)) && t._converter === e._converter : t instanceof Hn && e instanceof Hn && pn(t.query, e.query) && wt(t.docs, e.docs, Wn)
4203
4202
  /**
4204
4203
  * Helper that calls `fromDotSeparatedString()` but wraps any error thrown.
4205
4204
  */;
4206
4205
  }
4207
4206
 
4208
- function $n(t, e) {
4209
- return "string" == typeof e ? Gn(t, e) : e instanceof mn ? e._internalPath : e._delegate._internalPath;
4207
+ function Yn(t, e) {
4208
+ return "string" == typeof e ? Bn(t, e) : e instanceof dn ? e._internalPath : e._delegate._internalPath;
4210
4209
  }
4211
4210
 
4212
4211
  /**
@@ -4232,7 +4231,7 @@ function $n(t, e) {
4232
4231
  * endBefore:1}, {@link (endAt:1)}, {@link limit} or {@link limitToLast} and
4233
4232
  * can then be passed to {@link query} to create a new query instance that
4234
4233
  * also contains this `QueryConstraint`.
4235
- */ var Xn = function() {};
4234
+ */ var $n = function() {};
4236
4235
 
4237
4236
  /**
4238
4237
  * Creates a new immutable instance of {@link Query} that is extended to also include
@@ -4242,7 +4241,7 @@ function $n(t, e) {
4242
4241
  * @param queryConstraints - The list of {@link QueryConstraint}s to apply.
4243
4242
  * @throws if any of the provided query constraints cannot be combined with the
4244
4243
  * existing or new constraints.
4245
- */ function Jn(t) {
4244
+ */ function Xn(t) {
4246
4245
  for (var e = [], n = 1; n < arguments.length; n++) e[n - 1] = arguments[n];
4247
4246
  for (var r = 0, i = e; r < i.length; r++) {
4248
4247
  var o = i[r];
@@ -4251,39 +4250,39 @@ function $n(t, e) {
4251
4250
  return t;
4252
4251
  }
4253
4252
 
4254
- var Zn = /** @class */ function(e) {
4253
+ var Jn = /** @class */ function(e) {
4255
4254
  function n(t, n, r) {
4256
4255
  var i = this;
4257
4256
  return (i = e.call(this) || this).dt = t, i.wt = n, i.yt = r, i.type = "where",
4258
4257
  i;
4259
4258
  }
4260
4259
  return t(n, e), n.prototype._apply = function(t) {
4261
- var e = An(t.firestore), n = function(t, e, n, r, i, o, a) {
4260
+ var e = In(t.firestore), n = function(t, e, n, r, i, o, a) {
4262
4261
  var s;
4263
4262
  if (i.isKeyField()) {
4264
4263
  if ("array-contains" /* ARRAY_CONTAINS */ === o || "array-contains-any" /* ARRAY_CONTAINS_ANY */ === o) throw new U(V, "Invalid Query. You can't perform '" + o + "' queries on documentId().");
4265
4264
  if ("in" /* IN */ === o || "not-in" /* NOT_IN */ === o) {
4266
- dr(a, o);
4267
- for (var u = [], c = 0, f = a; c < f.length; c++) {
4268
- var l = f[c];
4269
- u.push(pr(r, t, l));
4265
+ pr(a, o);
4266
+ for (var u = [], c = 0, l = a; c < l.length; c++) {
4267
+ var f = l[c];
4268
+ u.push(hr(r, t, f));
4270
4269
  }
4271
4270
  s = {
4272
4271
  arrayValue: {
4273
4272
  values: u
4274
4273
  }
4275
4274
  };
4276
- } else s = pr(r, t, a);
4277
- } else "in" /* IN */ !== o && "not-in" /* NOT_IN */ !== o && "array-contains-any" /* ARRAY_CONTAINS_ANY */ !== o || dr(a, o),
4278
- s = jn(n, "where", a,
4275
+ } else s = hr(r, t, a);
4276
+ } else "in" /* IN */ !== o && "not-in" /* NOT_IN */ !== o && "array-contains-any" /* ARRAY_CONTAINS_ANY */ !== o || pr(a, o),
4277
+ s = Cn(n, "where", a,
4279
4278
  /* allowArrays= */ "in" /* IN */ === o || "not-in" /* NOT_IN */ === o);
4280
4279
  var h = Wt.create(i, o, s);
4281
4280
  return function(t, e) {
4282
4281
  if (e.N()) {
4283
- var n = fe(t);
4282
+ var n = le(t);
4284
4283
  if (null !== n && !n.isEqual(e.field)) throw new U(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() + "'");
4285
4284
  var r = ce(t);
4286
- null !== r && mr(t, e.field, r);
4285
+ null !== r && dr(t, e.field, r);
4287
4286
  }
4288
4287
  var i = function(t, e) {
4289
4288
  for (var n = 0, r = t.filters; n < r.length; n++) {
@@ -4330,12 +4329,12 @@ var Zn = /** @class */ function(e) {
4330
4329
  throw i === e.op ? new U(V, "Invalid query. You cannot use more than one '" + e.op.toString() + "' filter.") : new U(V, "Invalid query. You cannot use '" + e.op.toString() + "' filters with '" + i.toString() + "' filters.");
4331
4330
  }(t, h), h;
4332
4331
  }(t._query, 0, e, t.firestore._databaseId, this.dt, this.wt, this.yt);
4333
- return new un(t.firestore, t.converter, function(t, e) {
4332
+ return new sn(t.firestore, t.converter, function(t, e) {
4334
4333
  var n = t.filters.concat([ e ]);
4335
4334
  return new se(t.path, t.collectionGroup, t.explicitOrderBy.slice(), n, t.limit, t.limitType, t.startAt, t.endAt);
4336
4335
  }(t._query, n));
4337
4336
  }, n;
4338
- }(Xn);
4337
+ }($n);
4339
4338
 
4340
4339
  /**
4341
4340
  * Creates a {@link QueryConstraint} that enforces that documents must contain the
@@ -4347,12 +4346,12 @@ var Zn = /** @class */ function(e) {
4347
4346
  * "&lt;=", "!=").
4348
4347
  * @param value - The value for comparison
4349
4348
  * @returns The created {@link Query}.
4350
- */ function tr(t, e, n) {
4351
- var r = e, i = $n("where", t);
4352
- return new Zn(i, r, n);
4349
+ */ function Zn(t, e, n) {
4350
+ var r = e, i = Yn("where", t);
4351
+ return new Jn(i, r, n);
4353
4352
  }
4354
4353
 
4355
- var er = /** @class */ function(e) {
4354
+ var tr = /** @class */ function(e) {
4356
4355
  function n(t, n) {
4357
4356
  var r = this;
4358
4357
  return (r = e.call(this) || this).dt = t, r._t = n, r.type = "orderBy", r;
@@ -4365,18 +4364,18 @@ var er = /** @class */ function(e) {
4365
4364
  return function(t, e) {
4366
4365
  if (null === ce(t)) {
4367
4366
  // This is the first order by. It must match any inequality.
4368
- var n = fe(t);
4369
- null !== n && mr(t, n, e.field);
4367
+ var n = le(t);
4368
+ null !== n && dr(t, n, e.field);
4370
4369
  }
4371
4370
  }(t, r), r;
4372
4371
  }(t._query, this.dt, this._t);
4373
- return new un(t.firestore, t.converter, function(t, e) {
4372
+ return new sn(t.firestore, t.converter, function(t, e) {
4374
4373
  // TODO(dimond): validate that orderBy does not list the same key twice.
4375
4374
  var n = t.explicitOrderBy.concat([ e ]);
4376
4375
  return new se(t.path, t.collectionGroup, n, t.filters.slice(), t.limit, t.limitType, t.startAt, t.endAt);
4377
4376
  }(t._query, e));
4378
4377
  }, n;
4379
- }(Xn);
4378
+ }($n);
4380
4379
 
4381
4380
  /**
4382
4381
  * Creates a {@link QueryConstraint} that sorts the query result by the
@@ -4386,31 +4385,31 @@ var er = /** @class */ function(e) {
4386
4385
  * @param directionStr - Optional direction to sort by ('asc' or 'desc'). If
4387
4386
  * not specified, order will be ascending.
4388
4387
  * @returns The created {@link Query}.
4389
- */ function nr(t, e) {
4388
+ */ function er(t, e) {
4390
4389
  void 0 === e && (e = "asc");
4391
- var n = e, r = $n("orderBy", t);
4392
- return new er(r, n);
4390
+ var n = e, r = Yn("orderBy", t);
4391
+ return new tr(r, n);
4393
4392
  }
4394
4393
 
4395
- var rr = /** @class */ function(e) {
4394
+ var nr = /** @class */ function(e) {
4396
4395
  function n(t, n, r) {
4397
4396
  var i = this;
4398
4397
  return (i = e.call(this) || this).type = t, i.gt = n, i.vt = r, i;
4399
4398
  }
4400
4399
  return t(n, e), n.prototype._apply = function(t) {
4401
- return new un(t.firestore, t.converter, function(t, e, n) {
4400
+ return new sn(t.firestore, t.converter, function(t, e, n) {
4402
4401
  return new se(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), e, n, t.startAt, t.endAt);
4403
4402
  }(t._query, this.gt, this.vt));
4404
4403
  }, n;
4405
- }(Xn);
4404
+ }($n);
4406
4405
 
4407
4406
  /**
4408
4407
  * Creates a {@link QueryConstraint} that only returns the first matching documents.
4409
4408
  *
4410
4409
  * @param limit - The maximum number of items to return.
4411
4410
  * @returns The created {@link Query}.
4412
- */ function ir(t) {
4413
- return ut("limit", t), new rr("limit", t, "F" /* First */)
4411
+ */ function rr(t) {
4412
+ return ut("limit", t), new nr("limit", t, "F" /* First */)
4414
4413
  /**
4415
4414
  * Creates a {@link QueryConstraint} that only returns the last matching documents.
4416
4415
  *
@@ -4422,59 +4421,61 @@ var rr = /** @class */ function(e) {
4422
4421
  */;
4423
4422
  }
4424
4423
 
4425
- function or(t) {
4426
- return ut("limitToLast", t), new rr("limitToLast", t, "L" /* Last */);
4424
+ function ir(t) {
4425
+ return ut("limitToLast", t), new nr("limitToLast", t, "L" /* Last */);
4427
4426
  }
4428
4427
 
4429
- var ar = /** @class */ function(e) {
4428
+ var or = /** @class */ function(e) {
4430
4429
  function n(t, n, r) {
4431
4430
  var i = this;
4432
4431
  return (i = e.call(this) || this).type = t, i.bt = n, i.Et = r, i;
4433
4432
  }
4434
4433
  return t(n, e), n.prototype._apply = function(t) {
4435
- var e = hr(t, this.type, this.bt, this.Et);
4436
- return new un(t.firestore, t.converter, function(t, e) {
4434
+ var e = fr(t, this.type, this.bt, this.Et);
4435
+ return new sn(t.firestore, t.converter, function(t, e) {
4437
4436
  return new se(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, e, t.endAt);
4438
4437
  }(t._query, e));
4439
4438
  }, n;
4440
- }(Xn);
4439
+ }($n);
4441
4440
 
4442
- function sr() {
4441
+ function ar() {
4443
4442
  for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
4444
- return new ar("startAt", t, /*before=*/ !0);
4443
+ return new or("startAt", t,
4444
+ /*inclusive=*/ !0);
4445
4445
  }
4446
4446
 
4447
- function ur() {
4447
+ function sr() {
4448
4448
  for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
4449
- return new ar("startAfter", t,
4450
- /*before=*/ !1);
4449
+ return new or("startAfter", t,
4450
+ /*inclusive=*/ !1);
4451
4451
  }
4452
4452
 
4453
- var cr = /** @class */ function(e) {
4453
+ var ur = /** @class */ function(e) {
4454
4454
  function n(t, n, r) {
4455
4455
  var i = this;
4456
4456
  return (i = e.call(this) || this).type = t, i.bt = n, i.Et = r, i;
4457
4457
  }
4458
4458
  return t(n, e), n.prototype._apply = function(t) {
4459
- var e = hr(t, this.type, this.bt, this.Et);
4460
- return new un(t.firestore, t.converter, function(t, e) {
4459
+ var e = fr(t, this.type, this.bt, this.Et);
4460
+ return new sn(t.firestore, t.converter, function(t, e) {
4461
4461
  return new se(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, t.startAt, e);
4462
4462
  }(t._query, e));
4463
4463
  }, n;
4464
- }(Xn);
4464
+ }($n);
4465
4465
 
4466
- function fr() {
4466
+ function cr() {
4467
4467
  for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
4468
- return new cr("endBefore", t, /*before=*/ !0);
4468
+ return new ur("endBefore", t,
4469
+ /*inclusive=*/ !1);
4469
4470
  }
4470
4471
 
4471
4472
  function lr() {
4472
4473
  for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
4473
- return new cr("endAt", t, /*before=*/ !1);
4474
+ return new ur("endAt", t, /*inclusive=*/ !0);
4474
4475
  }
4475
4476
 
4476
- /** Helper function to create a bound from a document or fields */ function hr(t, e, n, r) {
4477
- if (n[0] = p(n[0]), n[0] instanceof Kn) return function(t, e, n, r, i) {
4477
+ /** Helper function to create a bound from a document or fields */ function fr(t, e, n, r) {
4478
+ if (n[0] = p(n[0]), n[0] instanceof Qn) return function(t, e, n, r, i) {
4478
4479
  if (!r) throw new U(P, "Can't use a DocumentSnapshot that doesn't exist for " + n + "().");
4479
4480
  // Because people expect to continue/end a query at the exact document
4480
4481
  // provided, we need to use the implicit sort order rather than the explicit
@@ -4489,15 +4490,15 @@ function lr() {
4489
4490
  var c = r.data.field(u.field);
4490
4491
  if (Pt(c)) throw new U(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.)');
4491
4492
  if (null === c) {
4492
- var f = u.field.canonicalString();
4493
- throw new U(V, "Invalid query. You are trying to start or end a query using a document for which the field '" + f + "' (used as the orderBy) does not exist.");
4493
+ var l = u.field.canonicalString();
4494
+ throw new U(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.");
4494
4495
  }
4495
4496
  o.push(c);
4496
4497
  }
4497
4498
  }
4498
4499
  return new re(o, i);
4499
4500
  }(t._query, t.firestore._databaseId, e, n[0]._document, r);
4500
- var i = An(t.firestore);
4501
+ var i = In(t.firestore);
4501
4502
  return function(t, e, n, r, i, o) {
4502
4503
  // Use explicit order by's because it has to match the query the user made
4503
4504
  var a = t.explicitOrderBy;
@@ -4506,13 +4507,13 @@ function lr() {
4506
4507
  var c = i[u];
4507
4508
  if (a[u].field.isKeyField()) {
4508
4509
  if ("string" != typeof c) throw new U(V, "Invalid query. Expected a string for document ID in " + r + "(), but got a " + typeof c);
4509
- if (!le(t) && -1 !== c.indexOf("/")) throw new U(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.");
4510
- var f = t.path.child(Z.fromString(c));
4511
- if (!nt.isDocumentKey(f)) throw new U(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 '" + f + "' is not because it contains an odd number of segments.");
4512
- var l = new nt(f);
4513
- s.push(Rt(e, l));
4510
+ if (!fe(t) && -1 !== c.indexOf("/")) throw new U(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.");
4511
+ var l = t.path.child(Z.fromString(c));
4512
+ if (!nt.isDocumentKey(l)) throw new U(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.");
4513
+ var f = new nt(l);
4514
+ s.push(Rt(e, f));
4514
4515
  } else {
4515
- var h = jn(n, r, c);
4516
+ var h = Cn(n, r, c);
4516
4517
  s.push(h);
4517
4518
  }
4518
4519
  }
@@ -4520,27 +4521,27 @@ function lr() {
4520
4521
  }(t._query, t.firestore._databaseId, i, e, n, r);
4521
4522
  }
4522
4523
 
4523
- function pr(t, e, n) {
4524
+ function hr(t, e, n) {
4524
4525
  if ("string" == typeof (n = p(n))) {
4525
4526
  if ("" === n) throw new U(V, "Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");
4526
- if (!le(e) && -1 !== n.indexOf("/")) throw new U(V, "Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '" + n + "' contains a '/' character.");
4527
+ if (!fe(e) && -1 !== n.indexOf("/")) throw new U(V, "Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '" + n + "' contains a '/' character.");
4527
4528
  var r = e.path.child(Z.fromString(n));
4528
4529
  if (!nt.isDocumentKey(r)) throw new U(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 + ").");
4529
4530
  return Rt(t, new nt(r));
4530
4531
  }
4531
- if (n instanceof sn) return Rt(t, n._key);
4532
+ if (n instanceof an) return Rt(t, n._key);
4532
4533
  throw new U(V, "Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: " + at(n) + ".");
4533
4534
  }
4534
4535
 
4535
4536
  /**
4536
4537
  * Validates that the value passed into a disjunctive filter satisfies all
4537
4538
  * array requirements.
4538
- */ function dr(t, e) {
4539
+ */ function pr(t, e) {
4539
4540
  if (!Array.isArray(t) || 0 === t.length) throw new U(V, "Invalid Query. A non-empty array is required for '" + e.toString() + "' filters.");
4540
4541
  if (t.length > 10) throw new U(V, "Invalid Query. '" + e.toString() + "' filters support a maximum of 10 elements in the value array.");
4541
4542
  }
4542
4543
 
4543
- function mr(t, e, n) {
4544
+ function dr(t, e, n) {
4544
4545
  if (!n.isEqual(e)) throw new U(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.");
4545
4546
  }
4546
4547
 
@@ -4590,23 +4591,23 @@ function mr(t, e, n) {
4590
4591
  * because we want to provide the user with a more specific error message if
4591
4592
  * their `set()` or fails due to invalid data originating from a `toFirestore()`
4592
4593
  * call.
4593
- */ function yr(t, e, n) {
4594
+ */ function mr(t, e, n) {
4594
4595
  // Cast to `any` in order to satisfy the union type constraint on
4595
4596
  // toFirestore().
4596
4597
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4597
4598
  return t ? n && (n.merge || n.mergeFields) ? t.toFirestore(e, n) : t.toFirestore(e) : e;
4598
4599
  }
4599
4600
 
4600
- var vr = /** @class */ function(e) {
4601
+ var yr = /** @class */ function(e) {
4601
4602
  function n(t) {
4602
4603
  var n = this;
4603
4604
  return (n = e.call(this) || this).firestore = t, n;
4604
4605
  }
4605
4606
  return t(n, e), n.prototype.convertBytes = function(t) {
4606
- return new vn(t);
4607
+ return new yn(t);
4607
4608
  }, n.prototype.convertReference = function(t) {
4608
4609
  var e = this.convertDocumentKey(t, this.firestore._databaseId);
4609
- return new sn(this.firestore, /* converter= */ null, e);
4610
+ return new an(this.firestore, /* converter= */ null, e);
4610
4611
  }, n;
4611
4612
  }(/** @class */ function() {
4612
4613
  function t() {}
@@ -4654,7 +4655,7 @@ var vr = /** @class */ function(e) {
4654
4655
  r[t] = n.convertValue(i, e);
4655
4656
  })), r;
4656
4657
  }, t.prototype.convertGeoPoint = function(t) {
4657
- return new wn(Vt(t.latitude), Vt(t.longitude));
4658
+ return new gn(Vt(t.latitude), Vt(t.longitude));
4658
4659
  }, t.prototype.convertArray = function(t, e) {
4659
4660
  var n = this;
4660
4661
  return (t.values || []).map((function(t) {
@@ -4677,7 +4678,7 @@ var vr = /** @class */ function(e) {
4677
4678
  return new bt(e.seconds, e.nanos);
4678
4679
  }, t.prototype.convertDocumentKey = function(t, e) {
4679
4680
  var n = Z.fromString(t);
4680
- E(Qe(n));
4681
+ E(ze(n));
4681
4682
  var r = new X(n.get(1), n.get(3)), i = new nt(n.popFirst(5));
4682
4683
  return r.isEqual(e) ||
4683
4684
  // TODO(b/64130202): Somehow support foreign references.
@@ -4698,12 +4699,12 @@ var vr = /** @class */ function(e) {
4698
4699
  * @param reference - The reference of the document to fetch.
4699
4700
  * @returns A Promise resolved with a `DocumentSnapshot` containing the current
4700
4701
  * document contents.
4701
- */ function gr(t) {
4702
- var e = Ze((t = st(t, sn)).firestore), n = new vr(t.firestore);
4703
- return $e(e, [ t._key ]).then((function(e) {
4702
+ */ function vr(t) {
4703
+ var e = Je((t = st(t, an)).firestore), n = new yr(t.firestore);
4704
+ return Ye(e, [ t._key ]).then((function(e) {
4704
4705
  E(1 === e.length);
4705
4706
  var r = e[0];
4706
- return new Kn(t.firestore, n, t._key, r.isFoundDocument() ? r : null, t.converter);
4707
+ return new Qn(t.firestore, n, t._key, r.isFoundDocument() ? r : null, t.converter);
4707
4708
  }));
4708
4709
  }
4709
4710
 
@@ -4718,35 +4719,35 @@ var vr = /** @class */ function(e) {
4718
4719
  *
4719
4720
  * @param query - The `Query` to execute.
4720
4721
  * @returns A Promise that will be resolved with the results of the query.
4721
- */ function wr(t) {
4722
+ */ function gr(t) {
4722
4723
  !function(t) {
4723
4724
  if (ue(t) && 0 === t.explicitOrderBy.length) throw new U(L, "limitToLast() queries require specifying at least one orderBy() clause");
4724
- }((t = st(t, un))._query);
4725
- var e = Ze(t.firestore), n = new vr(t.firestore);
4726
- return Xe(e, t._query).then((function(e) {
4725
+ }((t = st(t, sn))._query);
4726
+ var e = Je(t.firestore), n = new yr(t.firestore);
4727
+ return $e(e, t._query).then((function(e) {
4727
4728
  var r = e.map((function(e) {
4728
- return new Hn(t.firestore, n, e.key, e, t.converter);
4729
+ return new Kn(t.firestore, n, e.key, e, t.converter);
4729
4730
  }));
4730
4731
  return ue(t._query) &&
4731
4732
  // Limit to last queries reverse the orderBy constraint that was
4732
4733
  // specified by the user. As such, we need to reverse the order of the
4733
4734
  // results to return the documents in the expected order.
4734
- r.reverse(), new Wn(t, r);
4735
+ r.reverse(), new Hn(t, r);
4735
4736
  }));
4736
4737
  }
4737
4738
 
4738
- function br(t, e, n) {
4739
- var r = yr((t = st(t, sn)).converter, e, n), i = kn(An(t.firestore), "setDoc", t._key, r, null !== t.converter, n);
4740
- return Ye(Ze(t.firestore), [ i.toMutation(t._key, _e.none()) ]);
4739
+ function wr(t, e, n) {
4740
+ var r = mr((t = st(t, an)).converter, e, n), i = An(In(t.firestore), "setDoc", t._key, r, null !== t.converter, n);
4741
+ return We(Je(t.firestore), [ i.toMutation(t._key, _e.none()) ]);
4741
4742
  }
4742
4743
 
4743
- function _r(t, e, n) {
4744
+ function br(t, e, n) {
4744
4745
  for (var r = [], i = 3; i < arguments.length; i++) r[i - 3] = arguments[i];
4745
- var o, a = An((t = st(t, sn)).firestore);
4746
+ var o, a = In((t = st(t, an)).firestore);
4746
4747
  // For Compat types, we have to "extract" the underlying types before
4747
4748
  // performing validation.
4748
- return o = "string" == typeof (e = p(e)) || e instanceof mn ? Cn(a, "updateDoc", t._key, e, n, r) : On(a, "updateDoc", t._key, e),
4749
- Ye(Ze(t.firestore), [ o.toMutation(t._key, _e.exists(!0)) ]);
4749
+ return o = "string" == typeof (e = p(e)) || e instanceof dn ? On(a, "updateDoc", t._key, e, n, r) : Fn(a, "updateDoc", t._key, e),
4750
+ We(Je(t.firestore), [ o.toMutation(t._key, _e.exists(!0)) ]);
4750
4751
  }
4751
4752
 
4752
4753
  /**
@@ -4760,8 +4761,8 @@ function _r(t, e, n) {
4760
4761
  * @param reference - A reference to the document to delete.
4761
4762
  * @returns A `Promise` resolved once the document has been successfully
4762
4763
  * deleted from the backend.
4763
- */ function Tr(t) {
4764
- return Ye(Ze((t = st(t, sn)).firestore), [ new Ie(t._key, _e.none()) ]);
4764
+ */ function _r(t) {
4765
+ return We(Je((t = st(t, an)).firestore), [ new Ie(t._key, _e.none()) ]);
4765
4766
  }
4766
4767
 
4767
4768
  /**
@@ -4778,9 +4779,9 @@ function _r(t, e, n) {
4778
4779
  * @throws Error - If the provided input is not a valid Firestore document.
4779
4780
  * @returns A `Promise` resolved with a `DocumentReference` pointing to the
4780
4781
  * newly created document after it has been written to the backend.
4781
- */ function Sr(t, e) {
4782
- var n = hn(t = st(t, cn)), r = yr(t.converter, e), i = kn(An(t.firestore), "addDoc", n._key, r, null !== n.converter, {});
4783
- return Ye(Ze(t.firestore), [ i.toMutation(n._key, _e.exists(!1)) ]).then((function() {
4782
+ */ function Tr(t, e) {
4783
+ var n = fn(t = st(t, un)), r = mr(t.converter, e), i = An(In(t.firestore), "addDoc", n._key, r, null !== n.converter, {});
4784
+ return We(Je(t.firestore), [ i.toMutation(n._key, _e.exists(!1)) ]).then((function() {
4784
4785
  return n;
4785
4786
  }));
4786
4787
  }
@@ -4804,15 +4805,15 @@ function _r(t, e, n) {
4804
4805
  /**
4805
4806
  * Returns a sentinel for use with {@link @firebase/firestore/lite#(updateDoc:1)} or
4806
4807
  * {@link @firebase/firestore/lite#(setDoc:1)} with `{merge: true}` to mark a field for deletion.
4807
- */ function Er() {
4808
- return new Vn("deleteField");
4808
+ */ function Sr() {
4809
+ return new kn("deleteField");
4809
4810
  }
4810
4811
 
4811
4812
  /**
4812
4813
  * Returns a sentinel used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link @firebase/firestore/lite#(updateDoc:1)} to
4813
4814
  * include a server-generated timestamp in the written data.
4814
- */ function Ir() {
4815
- return new Pn("serverTimestamp");
4815
+ */ function Er() {
4816
+ return new Dn("serverTimestamp");
4816
4817
  }
4817
4818
 
4818
4819
  /**
@@ -4826,11 +4827,11 @@ function _r(t, e, n) {
4826
4827
  * @param elements - The elements to union into the array.
4827
4828
  * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or
4828
4829
  * `updateDoc()`.
4829
- */ function Ar() {
4830
+ */ function Ir() {
4830
4831
  for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
4831
4832
  // NOTE: We don't actually parse the data until it's used in set() or
4832
4833
  // update() since we'd need the Firestore instance to do this.
4833
- return new Nn("arrayUnion", t);
4834
+ return new Pn("arrayUnion", t);
4834
4835
  }
4835
4836
 
4836
4837
  /**
@@ -4843,11 +4844,11 @@ function _r(t, e, n) {
4843
4844
  * @param elements - The elements to remove from the array.
4844
4845
  * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or
4845
4846
  * `updateDoc()`
4846
- */ function kr() {
4847
+ */ function Ar() {
4847
4848
  for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
4848
4849
  // NOTE: We don't actually parse the data until it's used in set() or
4849
4850
  // update() since we'd need the Firestore instance to do this.
4850
- return new qn("arrayRemove", t);
4851
+ return new Nn("arrayRemove", t);
4851
4852
  }
4852
4853
 
4853
4854
  /**
@@ -4868,8 +4869,8 @@ function _r(t, e, n) {
4868
4869
  * @param n - The value to increment by.
4869
4870
  * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or
4870
4871
  * `updateDoc()`
4871
- */ function Vr(t) {
4872
- return new Fn("increment", t);
4872
+ */ function kr(t) {
4873
+ return new qn("increment", t);
4873
4874
  }
4874
4875
 
4875
4876
  /**
@@ -4895,23 +4896,23 @@ function _r(t, e, n) {
4895
4896
  * provides methods for adding writes to the write batch. None of the writes
4896
4897
  * will be committed (or visible locally) until {@link WriteBatch.commit} is
4897
4898
  * called.
4898
- */ var Dr = /** @class */ function() {
4899
+ */ var Vr = /** @class */ function() {
4899
4900
  /** @hideconstructor */
4900
4901
  function t(t, e) {
4901
4902
  this._firestore = t, this._commitHandler = e, this._mutations = [], this._committed = !1,
4902
- this._dataReader = An(t);
4903
+ this._dataReader = In(t);
4903
4904
  }
4904
4905
  return t.prototype.set = function(t, e, n) {
4905
4906
  this._verifyNotCommitted();
4906
- var r = Pr(t, this._firestore), i = yr(r.converter, e, n), o = kn(this._dataReader, "WriteBatch.set", r._key, i, null !== r.converter, n);
4907
+ var r = Dr(t, this._firestore), i = mr(r.converter, e, n), o = An(this._dataReader, "WriteBatch.set", r._key, i, null !== r.converter, n);
4907
4908
  return this._mutations.push(o.toMutation(r._key, _e.none())), this;
4908
4909
  }, t.prototype.update = function(t, e, n) {
4909
4910
  for (var r = [], i = 3; i < arguments.length; i++) r[i - 3] = arguments[i];
4910
4911
  this._verifyNotCommitted();
4911
- var o, a = Pr(t, this._firestore);
4912
+ var o, a = Dr(t, this._firestore);
4912
4913
  // For Compat types, we have to "extract" the underlying types before
4913
4914
  // performing validation.
4914
- return o = "string" == typeof (e = p(e)) || e instanceof mn ? Cn(this._dataReader, "WriteBatch.update", a._key, e, n, r) : On(this._dataReader, "WriteBatch.update", a._key, e),
4915
+ return o = "string" == typeof (e = p(e)) || e instanceof dn ? On(this._dataReader, "WriteBatch.update", a._key, e, n, r) : Fn(this._dataReader, "WriteBatch.update", a._key, e),
4915
4916
  this._mutations.push(o.toMutation(a._key, _e.exists(!0))), this;
4916
4917
  },
4917
4918
  /**
@@ -4922,7 +4923,7 @@ function _r(t, e, n) {
4922
4923
  */
4923
4924
  t.prototype.delete = function(t) {
4924
4925
  this._verifyNotCommitted();
4925
- var e = Pr(t, this._firestore);
4926
+ var e = Dr(t, this._firestore);
4926
4927
  return this._mutations = this._mutations.concat(new Ie(e._key, _e.none())), this;
4927
4928
  },
4928
4929
  /**
@@ -4944,7 +4945,7 @@ function _r(t, e, n) {
4944
4945
  }, t;
4945
4946
  }();
4946
4947
 
4947
- function Pr(t, e) {
4948
+ function Dr(t, e) {
4948
4949
  if ((t = p(t)).firestore !== e) throw new U(V, "Provided document reference is from a different Firestore instance.");
4949
4950
  return t;
4950
4951
  }
@@ -4961,10 +4962,10 @@ function Pr(t, e) {
4961
4962
  *
4962
4963
  * @returns A `WriteBatch` that can be used to atomically execute multiple
4963
4964
  * writes.
4964
- */ function Nr(t) {
4965
- var e = Ze(t = st(t, en));
4966
- return new Dr(t, (function(t) {
4967
- return Ye(e, t);
4965
+ */ function Pr(t) {
4966
+ var e = Je(t = st(t, tn));
4967
+ return new Vr(t, (function(t) {
4968
+ return We(e, t);
4968
4969
  }));
4969
4970
  }
4970
4971
 
@@ -4987,7 +4988,7 @@ function Pr(t, e) {
4987
4988
  /**
4988
4989
  * Internal transaction object responsible for accumulating the mutations to
4989
4990
  * perform and the base versions for any documents read.
4990
- */ var qr = /** @class */ function() {
4991
+ */ var Nr = /** @class */ function() {
4991
4992
  function t(t) {
4992
4993
  this.datastore = t,
4993
4994
  // The version of each document that was read during this transaction.
@@ -5012,7 +5013,7 @@ function Pr(t, e) {
5012
5013
  switch (n.label) {
5013
5014
  case 0:
5014
5015
  if (this.ensureCommitNotCalled(), this.mutations.length > 0) throw new U(V, "Firestore transactions require all reads to be executed before all writes.");
5015
- return [ 4 /*yield*/ , $e(this.datastore, t) ];
5016
+ return [ 4 /*yield*/ , Ye(this.datastore, t) ];
5016
5017
 
5017
5018
  case 1:
5018
5019
  return [ 2 /*return*/ , ((e = n.sent()).forEach((function(t) {
@@ -5049,7 +5050,7 @@ function Pr(t, e) {
5049
5050
  t.forEach((function(t, n) {
5050
5051
  var r = nt.fromPath(n);
5051
5052
  e.mutations.push(new Ae(r, e.precondition(r)));
5052
- })), [ 4 /*yield*/ , Ye(this.datastore, this.mutations) ];
5053
+ })), [ 4 /*yield*/ , We(this.datastore, this.mutations) ];
5053
5054
 
5054
5055
  case 1:
5055
5056
  // For each mutation, note that the doc was written.
@@ -5107,10 +5108,10 @@ function Pr(t, e) {
5107
5108
  }, t.prototype.write = function(t) {
5108
5109
  this.ensureCommitNotCalled(), this.mutations.push(t);
5109
5110
  }, t.prototype.ensureCommitNotCalled = function() {}, t;
5110
- }(), Fr = /** @class */ function() {
5111
+ }(), qr = /** @class */ function() {
5111
5112
  function t(t, e, n, r) {
5112
5113
  this.asyncQueue = t, this.datastore = e, this.updateFunction = n, this.deferred = r,
5113
- this.Tt = 5, this.It = new He(this.asyncQueue, "transaction_retry" /* TransactionRetry */)
5114
+ this.Tt = 5, this.It = new Ke(this.asyncQueue, "transaction_retry" /* TransactionRetry */)
5114
5115
  /** Runs the transaction and sets the result on deferred. */;
5115
5116
  }
5116
5117
  return t.prototype.run = function() {
@@ -5121,7 +5122,7 @@ function Pr(t, e) {
5121
5122
  return e(t, void 0, void 0, (function() {
5122
5123
  var t, e, r = this;
5123
5124
  return n(this, (function(n) {
5124
- return t = new qr(this.datastore), (e = this.Rt(t)) && e.then((function(e) {
5125
+ return t = new Nr(this.datastore), (e = this.Rt(t)) && e.then((function(e) {
5125
5126
  r.asyncQueue.enqueueAndForget((function() {
5126
5127
  return t.commit().then((function() {
5127
5128
  r.deferred.resolve(e);
@@ -5233,7 +5234,7 @@ function Pr(t, e) {
5233
5234
  * See the License for the specific language governing permissions and
5234
5235
  * limitations under the License.
5235
5236
  */
5236
- /** The Platform's 'document' implementation or null if not available. */ function Or() {
5237
+ /** The Platform's 'document' implementation or null if not available. */ function Fr() {
5237
5238
  // `document` is not always available, e.g. in ReactNative and WebWorkers.
5238
5239
  // eslint-disable-next-line no-restricted-globals
5239
5240
  return "undefined" != typeof document ? document : null;
@@ -5265,7 +5266,7 @@ function Pr(t, e) {
5265
5266
  * Note: We implement `PromiseLike` instead of `Promise`, as the `Promise` type
5266
5267
  * in newer versions of TypeScript defines `finally`, which is not available in
5267
5268
  * IE.
5268
- */ var Cr = /** @class */ function() {
5269
+ */ var Or = /** @class */ function() {
5269
5270
  function t(t, e, n, r, i) {
5270
5271
  this.asyncQueue = t, this.timerId = e, this.targetTimeMs = n, this.op = r, this.removalCallback = i,
5271
5272
  this.deferred = new x, this.then = this.deferred.promise.then.bind(this.deferred.promise),
@@ -5329,7 +5330,7 @@ function Pr(t, e) {
5329
5330
  null !== this.timerHandle && (this.removalCallback(this), clearTimeout(this.timerHandle),
5330
5331
  this.timerHandle = null);
5331
5332
  }, t;
5332
- }(), jr = /** @class */ function() {
5333
+ }(), Cr = /** @class */ function() {
5333
5334
  function t() {
5334
5335
  var t = this;
5335
5336
  // The last promise in the queue.
@@ -5353,15 +5354,15 @@ function Pr(t, e) {
5353
5354
  // List of TimerIds to fast-forward delays for.
5354
5355
  this.Ot = [],
5355
5356
  // Backoff timer used to schedule retries for retryable operations
5356
- this.It = new He(this, "async_queue_retry" /* AsyncQueueRetry */),
5357
+ this.It = new Ke(this, "async_queue_retry" /* AsyncQueueRetry */),
5357
5358
  // Visibility handler that triggers an immediate retry of all retryable
5358
5359
  // operations. Meant to speed up recovery when we regain file system access
5359
5360
  // after page comes into foreground.
5360
5361
  this.Ct = function() {
5361
- var e = Or();
5362
+ var e = Fr();
5362
5363
  e && w("AsyncQueue", "Visibility state changed to " + e.visibilityState), t.It.H();
5363
5364
  };
5364
- var e = Or();
5365
+ var e = Fr();
5365
5366
  e && "function" == typeof e.addEventListener && e.addEventListener("visibilitychange", this.Ct);
5366
5367
  }
5367
5368
  return Object.defineProperty(t.prototype, "isShuttingDown", {
@@ -5385,7 +5386,7 @@ function Pr(t, e) {
5385
5386
  }, t.prototype.enterRestrictedMode = function(t) {
5386
5387
  if (!this.$t) {
5387
5388
  this.$t = !0, this.qt = t || !1;
5388
- var e = Or();
5389
+ var e = Fr();
5389
5390
  e && "function" == typeof e.removeEventListener && e.removeEventListener("visibilitychange", this.Ct);
5390
5391
  }
5391
5392
  }, t.prototype.enqueue = function(t) {
@@ -5483,7 +5484,7 @@ function Pr(t, e) {
5483
5484
  this.Lt(),
5484
5485
  // Fast-forward delays for timerIds that have been overriden.
5485
5486
  this.Ot.indexOf(t) > -1 && (e = 0);
5486
- var i = Cr.createAndSchedule(this, t, e, n, (function(t) {
5487
+ var i = Or.createAndSchedule(this, t, e, n, (function(t) {
5487
5488
  return r.jt(t);
5488
5489
  }));
5489
5490
  return this.St.push(i), i;
@@ -5558,10 +5559,10 @@ function Pr(t, e) {
5558
5559
  var e = this.St.indexOf(t);
5559
5560
  this.St.splice(e, 1);
5560
5561
  }, t;
5561
- }(), Lr = /** @class */ function() {
5562
+ }(), jr = /** @class */ function() {
5562
5563
  /** @hideconstructor */
5563
5564
  function t(t, e) {
5564
- this._firestore = t, this._transaction = e, this._dataReader = An(t)
5565
+ this._firestore = t, this._transaction = e, this._dataReader = In(t)
5565
5566
  /**
5566
5567
  * Reads the document referenced by the provided {@link DocumentReference}.
5567
5568
  *
@@ -5570,23 +5571,23 @@ function Pr(t, e) {
5570
5571
  */;
5571
5572
  }
5572
5573
  return t.prototype.get = function(t) {
5573
- var e = this, n = Pr(t, this._firestore), r = new vr(this._firestore);
5574
+ var e = this, n = Dr(t, this._firestore), r = new yr(this._firestore);
5574
5575
  return this._transaction.lookup([ n._key ]).then((function(t) {
5575
5576
  if (!t || 1 !== t.length) return S();
5576
5577
  var i = t[0];
5577
- if (i.isFoundDocument()) return new Kn(e._firestore, r, i.key, i, n.converter);
5578
- if (i.isNoDocument()) return new Kn(e._firestore, r, n._key, null, n.converter);
5578
+ if (i.isFoundDocument()) return new Qn(e._firestore, r, i.key, i, n.converter);
5579
+ if (i.isNoDocument()) return new Qn(e._firestore, r, n._key, null, n.converter);
5579
5580
  throw S();
5580
5581
  }));
5581
5582
  }, t.prototype.set = function(t, e, n) {
5582
- var r = Pr(t, this._firestore), i = yr(r.converter, e, n), o = kn(this._dataReader, "Transaction.set", r._key, i, null !== r.converter, n);
5583
+ var r = Dr(t, this._firestore), i = mr(r.converter, e, n), o = An(this._dataReader, "Transaction.set", r._key, i, null !== r.converter, n);
5583
5584
  return this._transaction.set(r._key, o), this;
5584
5585
  }, t.prototype.update = function(t, e, n) {
5585
5586
  for (var r = [], i = 3; i < arguments.length; i++) r[i - 3] = arguments[i];
5586
- var o, a = Pr(t, this._firestore);
5587
+ var o, a = Dr(t, this._firestore);
5587
5588
  // For Compat types, we have to "extract" the underlying types before
5588
5589
  // performing validation.
5589
- return o = "string" == typeof (e = p(e)) || e instanceof mn ? Cn(this._dataReader, "Transaction.update", a._key, e, n, r) : On(this._dataReader, "Transaction.update", a._key, e),
5590
+ return o = "string" == typeof (e = p(e)) || e instanceof dn ? On(this._dataReader, "Transaction.update", a._key, e, n, r) : Fn(this._dataReader, "Transaction.update", a._key, e),
5590
5591
  this._transaction.update(a._key, o), this;
5591
5592
  },
5592
5593
  /**
@@ -5596,7 +5597,7 @@ function Pr(t, e) {
5596
5597
  * @returns This `Transaction` instance. Used for chaining method calls.
5597
5598
  */
5598
5599
  t.prototype.delete = function(t) {
5599
- var e = Pr(t, this._firestore);
5600
+ var e = Dr(t, this._firestore);
5600
5601
  return this._transaction.delete(e._key), this;
5601
5602
  }, t;
5602
5603
  }();
@@ -5634,10 +5635,10 @@ function Pr(t, e) {
5634
5635
  * `updateFunction `is returned here. Otherwise, if the transaction failed, a
5635
5636
  * rejected promise with the corresponding failure error is returned.
5636
5637
  */
5637
- function Rr(t, e) {
5638
- var n = Ze(t = st(t, en)), r = new x;
5639
- return new Fr(new jr, n, (function(n) {
5640
- return e(new Lr(t, n));
5638
+ function Lr(t, e) {
5639
+ var n = Je(t = st(t, tn)), r = new x;
5640
+ return new qr(new Cr, n, (function(n) {
5641
+ return e(new jr(t, n));
5641
5642
  }), r).run(), r.promise
5642
5643
  /**
5643
5644
  * Firestore Lite
@@ -5650,11 +5651,11 @@ function Rr(t, e) {
5650
5651
  }
5651
5652
 
5652
5653
  y = i + "_lite", o(new c("firestore/lite", (function(t, e) {
5653
- var n = e.options, r = t.getProvider("app").getImmediate(), i = new en(r, new Q(t.getProvider("auth-internal")), new Y(t.getProvider("app-check-internal")));
5654
+ var n = e.options, r = t.getProvider("app").getImmediate(), i = new tn(r, new Q(t.getProvider("auth-internal")), new Y(t.getProvider("app-check-internal")));
5654
5655
  return n && i._setSettings(n), i;
5655
5656
  }), "PUBLIC")),
5656
5657
  // RUNTIME_ENV and BUILD_TARGET are replaced by real values during the compilation
5657
- a("firestore-lite", "3.4.4-canary.2dd99ae2d", ""), a("firestore-lite", "3.4.4-canary.2dd99ae2d", "esm5");
5658
+ a("firestore-lite", "3.4.4-canary.434d87ee2", ""), a("firestore-lite", "3.4.4-canary.434d87ee2", "esm5");
5658
5659
 
5659
- export { vn as Bytes, cn as CollectionReference, sn as DocumentReference, Kn as DocumentSnapshot, mn as FieldPath, gn as FieldValue, en as Firestore, U as FirestoreError, wn as GeoPoint, un as Query, Xn as QueryConstraint, Hn as QueryDocumentSnapshot, Wn as QuerySnapshot, bt as Timestamp, Lr as Transaction, Dr as WriteBatch, Sr as addDoc, kr as arrayRemove, Ar as arrayUnion, fn as collection, ln as collectionGroup, on as connectFirestoreEmulator, Tr as deleteDoc, Er as deleteField, hn as doc, yn as documentId, lr as endAt, fr as endBefore, gr as getDoc, wr as getDocs, rn as getFirestore, Vr as increment, nn as initializeFirestore, ir as limit, or as limitToLast, nr as orderBy, Jn as query, dn as queryEqual, pn as refEqual, Rr as runTransaction, Ir as serverTimestamp, br as setDoc, g as setLogLevel, Yn as snapshotEqual, ur as startAfter, sr as startAt, an as terminate, _r as updateDoc, tr as where, Nr as writeBatch };
5660
+ export { yn as Bytes, un as CollectionReference, an as DocumentReference, Qn as DocumentSnapshot, dn as FieldPath, vn as FieldValue, tn as Firestore, U as FirestoreError, gn as GeoPoint, sn as Query, $n as QueryConstraint, Kn as QueryDocumentSnapshot, Hn as QuerySnapshot, bt as Timestamp, jr 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, Lr 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 };
5660
5661
  //# sourceMappingURL=index.browser.esm5.js.map