@firebase/firestore 3.4.3 → 3.4.4-canary.0482aa5b7

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 (125) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/firestore/src/api/database.d.ts +14 -9
  3. package/dist/firestore/src/api/{query.d.ts → filter.d.ts} +0 -0
  4. package/dist/firestore/src/api/index_configuration.d.ts +117 -0
  5. package/dist/firestore/src/api/snapshot.d.ts +1 -2
  6. package/dist/firestore/src/api.d.ts +2 -1
  7. package/dist/firestore/src/core/database_info.d.ts +1 -0
  8. package/dist/firestore/src/core/firestore_client.d.ts +2 -0
  9. package/dist/firestore/src/core/target.d.ts +34 -5
  10. package/dist/firestore/src/lite-api/query.d.ts +2 -2
  11. package/dist/firestore/src/local/index_manager.d.ts +52 -0
  12. package/dist/firestore/src/local/indexeddb_index_manager.d.ts +11 -0
  13. package/dist/firestore/src/local/indexeddb_schema.d.ts +121 -7
  14. package/dist/firestore/src/local/local_serializer.d.ts +1 -1
  15. package/dist/firestore/src/local/memory_index_manager.d.ts +11 -0
  16. package/dist/firestore/src/local/remote_document_change_buffer.d.ts +3 -12
  17. package/dist/firestore/src/model/document.d.ts +7 -0
  18. package/dist/firestore/src/model/document_key.d.ts +1 -0
  19. package/dist/firestore/src/model/field_index.d.ts +156 -0
  20. package/dist/firestore/src/model/values.d.ts +7 -0
  21. package/dist/firestore/test/integration/api/index_configuration.test.d.ts +17 -0
  22. package/dist/firestore/test/unit/local/test_remote_document_cache.d.ts +1 -1
  23. package/dist/firestore/test/unit/model/field_index.test.d.ts +17 -0
  24. package/dist/firestore/test/unit/model/target.test.d.ts +17 -0
  25. package/dist/firestore/test/util/helpers.d.ts +8 -2
  26. package/dist/index.d.ts +16 -11
  27. package/dist/index.esm2017.js +2979 -2671
  28. package/dist/index.esm2017.js.map +1 -1
  29. package/dist/index.esm5.js +3036 -2815
  30. package/dist/index.esm5.js.map +1 -1
  31. package/dist/index.node.cjs.js +644 -235
  32. package/dist/index.node.cjs.js.map +1 -1
  33. package/dist/index.node.mjs +644 -236
  34. package/dist/index.node.mjs.map +1 -1
  35. package/dist/index.rn.js +2761 -2449
  36. package/dist/index.rn.js.map +1 -1
  37. package/dist/internal.d.ts +303 -25
  38. package/dist/lite/firestore/src/api/database.d.ts +14 -9
  39. package/dist/lite/firestore/src/api/{query.d.ts → filter.d.ts} +0 -0
  40. package/dist/lite/firestore/src/api/index_configuration.d.ts +117 -0
  41. package/dist/lite/firestore/src/api/snapshot.d.ts +1 -2
  42. package/dist/lite/firestore/src/api.d.ts +2 -1
  43. package/dist/lite/firestore/src/core/database_info.d.ts +1 -0
  44. package/dist/lite/firestore/src/core/firestore_client.d.ts +2 -0
  45. package/dist/lite/firestore/src/core/target.d.ts +34 -5
  46. package/dist/lite/firestore/src/lite-api/query.d.ts +2 -2
  47. package/dist/lite/firestore/src/local/index_manager.d.ts +52 -0
  48. package/dist/lite/firestore/src/local/indexeddb_index_manager.d.ts +11 -0
  49. package/dist/lite/firestore/src/local/indexeddb_schema.d.ts +121 -7
  50. package/dist/lite/firestore/src/local/local_serializer.d.ts +1 -1
  51. package/dist/lite/firestore/src/local/memory_index_manager.d.ts +11 -0
  52. package/dist/lite/firestore/src/local/remote_document_change_buffer.d.ts +3 -12
  53. package/dist/lite/firestore/src/model/document.d.ts +7 -0
  54. package/dist/lite/firestore/src/model/document_key.d.ts +1 -0
  55. package/dist/lite/firestore/src/model/field_index.d.ts +156 -0
  56. package/dist/lite/firestore/src/model/values.d.ts +7 -0
  57. package/dist/lite/firestore/test/integration/api/index_configuration.test.d.ts +17 -0
  58. package/dist/lite/firestore/test/unit/local/test_remote_document_cache.d.ts +1 -1
  59. package/dist/lite/firestore/test/unit/model/field_index.test.d.ts +17 -0
  60. package/dist/lite/firestore/test/unit/model/target.test.d.ts +17 -0
  61. package/dist/lite/firestore/test/util/helpers.d.ts +8 -2
  62. package/dist/lite/index.browser.esm2017.js +352 -338
  63. package/dist/lite/index.browser.esm2017.js.map +1 -1
  64. package/dist/lite/index.browser.esm5.js +334 -326
  65. package/dist/lite/index.browser.esm5.js.map +1 -1
  66. package/dist/lite/index.node.cjs.js +53 -34
  67. package/dist/lite/index.node.cjs.js.map +1 -1
  68. package/dist/lite/index.node.mjs +53 -34
  69. package/dist/lite/index.node.mjs.map +1 -1
  70. package/dist/lite/index.rn.esm2017.js +318 -304
  71. package/dist/lite/index.rn.esm2017.js.map +1 -1
  72. package/dist/lite/internal.d.ts +11 -2
  73. package/dist/lite/packages/firestore/dist/lite/index.browser.esm2017.d.ts +98 -97
  74. package/dist/lite/packages/firestore/src/api/database.d.ts +14 -9
  75. package/dist/lite/packages/firestore/src/api/{query.d.ts → filter.d.ts} +0 -0
  76. package/dist/lite/packages/firestore/src/api/index_configuration.d.ts +117 -0
  77. package/dist/lite/packages/firestore/src/api/snapshot.d.ts +1 -2
  78. package/dist/lite/packages/firestore/src/api.d.ts +2 -1
  79. package/dist/lite/packages/firestore/src/core/database_info.d.ts +1 -0
  80. package/dist/lite/packages/firestore/src/core/firestore_client.d.ts +2 -0
  81. package/dist/lite/packages/firestore/src/core/target.d.ts +34 -5
  82. package/dist/lite/packages/firestore/src/lite-api/query.d.ts +2 -2
  83. package/dist/lite/packages/firestore/src/local/index_manager.d.ts +52 -0
  84. package/dist/lite/packages/firestore/src/local/indexeddb_index_manager.d.ts +11 -0
  85. package/dist/lite/packages/firestore/src/local/indexeddb_schema.d.ts +121 -7
  86. package/dist/lite/packages/firestore/src/local/local_serializer.d.ts +1 -1
  87. package/dist/lite/packages/firestore/src/local/memory_index_manager.d.ts +11 -0
  88. package/dist/lite/packages/firestore/src/local/remote_document_change_buffer.d.ts +3 -12
  89. package/dist/lite/packages/firestore/src/model/document.d.ts +7 -0
  90. package/dist/lite/packages/firestore/src/model/document_key.d.ts +1 -0
  91. package/dist/lite/packages/firestore/src/model/field_index.d.ts +156 -0
  92. package/dist/lite/packages/firestore/src/model/values.d.ts +7 -0
  93. package/dist/lite/packages/firestore/test/integration/api/index_configuration.test.d.ts +17 -0
  94. package/dist/lite/packages/firestore/test/unit/local/test_remote_document_cache.d.ts +1 -1
  95. package/dist/lite/packages/firestore/test/unit/model/field_index.test.d.ts +17 -0
  96. package/dist/lite/packages/firestore/test/unit/model/target.test.d.ts +17 -0
  97. package/dist/lite/packages/firestore/test/util/helpers.d.ts +8 -2
  98. package/dist/lite/private.d.ts +9 -2
  99. package/dist/packages/firestore/dist/index.esm2017.d.ts +214 -191
  100. package/dist/packages/firestore/src/api/database.d.ts +14 -9
  101. package/dist/packages/firestore/src/api/{query.d.ts → filter.d.ts} +0 -0
  102. package/dist/packages/firestore/src/api/index_configuration.d.ts +117 -0
  103. package/dist/packages/firestore/src/api/snapshot.d.ts +1 -2
  104. package/dist/packages/firestore/src/api.d.ts +2 -1
  105. package/dist/packages/firestore/src/core/database_info.d.ts +1 -0
  106. package/dist/packages/firestore/src/core/firestore_client.d.ts +2 -0
  107. package/dist/packages/firestore/src/core/target.d.ts +34 -5
  108. package/dist/packages/firestore/src/lite-api/query.d.ts +2 -2
  109. package/dist/packages/firestore/src/local/index_manager.d.ts +52 -0
  110. package/dist/packages/firestore/src/local/indexeddb_index_manager.d.ts +11 -0
  111. package/dist/packages/firestore/src/local/indexeddb_schema.d.ts +121 -7
  112. package/dist/packages/firestore/src/local/local_serializer.d.ts +1 -1
  113. package/dist/packages/firestore/src/local/memory_index_manager.d.ts +11 -0
  114. package/dist/packages/firestore/src/local/remote_document_change_buffer.d.ts +3 -12
  115. package/dist/packages/firestore/src/model/document.d.ts +7 -0
  116. package/dist/packages/firestore/src/model/document_key.d.ts +1 -0
  117. package/dist/packages/firestore/src/model/field_index.d.ts +156 -0
  118. package/dist/packages/firestore/src/model/values.d.ts +7 -0
  119. package/dist/packages/firestore/test/integration/api/index_configuration.test.d.ts +17 -0
  120. package/dist/packages/firestore/test/unit/local/test_remote_document_cache.d.ts +1 -1
  121. package/dist/packages/firestore/test/unit/model/field_index.test.d.ts +17 -0
  122. package/dist/packages/firestore/test/unit/model/target.test.d.ts +17 -0
  123. package/dist/packages/firestore/test/util/helpers.d.ts +8 -2
  124. package/dist/private.d.ts +205 -25
  125. package/package.json +10 -10
@@ -66,7 +66,7 @@ f.MOCK_USER = new f("mock-user");
66
66
  * See the License for the specific language governing permissions and
67
67
  * limitations under the License.
68
68
  */
69
- let d = "9.6.3";
69
+ let d = "9.6.5-canary.0482aa5b7";
70
70
 
71
71
  /**
72
72
  * @license
@@ -450,6 +450,9 @@ class J {
450
450
  constructor(t, n) {
451
451
  this.projectId = t, this.database = n || "(default)";
452
452
  }
453
+ static empty() {
454
+ return new J("", "");
455
+ }
453
456
  get isDefaultDatabase() {
454
457
  return "(default)" === this.database;
455
458
  }
@@ -675,6 +678,9 @@ const tt = /^[_a-zA-Z][_a-zA-Z0-9]*$/;
675
678
  static fromName(t) {
676
679
  return new et(Z.fromString(t).popFirst(5));
677
680
  }
681
+ static empty() {
682
+ return new et(Z.emptyPath());
683
+ }
678
684
  /** Returns true if the document is in the specified collectionId. */ hasCollectionId(t) {
679
685
  return this.path.length >= 2 && this.path.get(this.path.length - 2) === t;
680
686
  }
@@ -2005,30 +2011,31 @@ function kt(t, n) {
2005
2011
  * applied, `isValidDocument()` returns false and the document should be removed
2006
2012
  * from all views.
2007
2013
  */ class Gt {
2008
- constructor(t, n, e, r, s) {
2009
- this.key = t, this.documentType = n, this.version = e, this.data = r, this.documentState = s;
2014
+ constructor(t, n, e, r, s, i) {
2015
+ this.key = t, this.documentType = n, this.version = e, this.readTime = r, this.data = s,
2016
+ this.documentState = i;
2010
2017
  }
2011
2018
  /**
2012
2019
  * Creates a document with no known version or data, but which can serve as
2013
2020
  * base document for mutations.
2014
2021
  */ static newInvalidDocument(t) {
2015
- return new Gt(t, 0 /* INVALID */ , bt.min(), Qt.empty(), 0 /* SYNCED */);
2022
+ return new Gt(t, 0 /* INVALID */ , bt.min(), bt.min(), Qt.empty(), 0 /* SYNCED */);
2016
2023
  }
2017
2024
  /**
2018
2025
  * Creates a new document that is known to exist with the given data at the
2019
2026
  * given version.
2020
2027
  */ static newFoundDocument(t, n, e) {
2021
- return new Gt(t, 1 /* FOUND_DOCUMENT */ , n, e, 0 /* SYNCED */);
2028
+ return new Gt(t, 1 /* FOUND_DOCUMENT */ , n, bt.min(), e, 0 /* SYNCED */);
2022
2029
  }
2023
2030
  /** Creates a new document that is known to not exist at the given version. */ static newNoDocument(t, n) {
2024
- return new Gt(t, 2 /* NO_DOCUMENT */ , n, Qt.empty(), 0 /* SYNCED */);
2031
+ return new Gt(t, 2 /* NO_DOCUMENT */ , n, bt.min(), Qt.empty(), 0 /* SYNCED */);
2025
2032
  }
2026
2033
  /**
2027
2034
  * Creates a new document that is known to exist at the given version but
2028
2035
  * whose data is not known (e.g. a document that was updated without a known
2029
2036
  * base document).
2030
2037
  */ static newUnknownDocument(t, n) {
2031
- return new Gt(t, 3 /* UNKNOWN_DOCUMENT */ , n, Qt.empty(), 2 /* HAS_COMMITTED_MUTATIONS */);
2038
+ return new Gt(t, 3 /* UNKNOWN_DOCUMENT */ , n, bt.min(), Qt.empty(), 2 /* HAS_COMMITTED_MUTATIONS */);
2032
2039
  }
2033
2040
  /**
2034
2041
  * Changes the document type to indicate that it exists and that its version
@@ -2058,6 +2065,9 @@ function kt(t, n) {
2058
2065
  setHasLocalMutations() {
2059
2066
  return this.documentState = 1 /* HAS_LOCAL_MUTATIONS */ , this;
2060
2067
  }
2068
+ setReadTime(t) {
2069
+ return this.readTime = t, this;
2070
+ }
2061
2071
  get hasLocalMutations() {
2062
2072
  return 1 /* HAS_LOCAL_MUTATIONS */ === this.documentState;
2063
2073
  }
@@ -2083,7 +2093,7 @@ function kt(t, n) {
2083
2093
  return t instanceof Gt && this.key.isEqual(t.key) && this.version.isEqual(t.version) && this.documentType === t.documentType && this.documentState === t.documentState && this.data.isEqual(t.data);
2084
2094
  }
2085
2095
  mutableCopy() {
2086
- return new Gt(this.key, this.documentType, this.version, this.data.clone(), this.documentState);
2096
+ return new Gt(this.key, this.documentType, this.version, this.readTime, this.data.clone(), this.documentState);
2087
2097
  }
2088
2098
  toString() {
2089
2099
  return `Document(${this.key}, ${this.version}, ${JSON.stringify(this.data.value)}, {documentType: ${this.documentType}}), {documentState: ${this.documentState}})`;
@@ -2264,7 +2274,7 @@ function Zt(t, n) {
2264
2274
  * just after the provided values.
2265
2275
  */ class sn {
2266
2276
  constructor(t, n) {
2267
- this.position = t, this.before = n;
2277
+ this.position = t, this.inclusive = n;
2268
2278
  }
2269
2279
  }
2270
2280
 
@@ -2283,7 +2293,7 @@ function un(t, n) {
2283
2293
  function cn(t, n) {
2284
2294
  if (null === t) return null === n;
2285
2295
  if (null === n) return !1;
2286
- if (t.before !== n.before || t.position.length !== n.position.length) return !1;
2296
+ if (t.inclusive !== n.inclusive || t.position.length !== n.position.length) return !1;
2287
2297
  for (let e = 0; e < t.position.length; e++) {
2288
2298
  if (!qt(t.position[e], n.position[e])) return !1;
2289
2299
  }
@@ -2389,7 +2399,7 @@ function dn(t) {
2389
2399
  t.push(new on(e.field, n));
2390
2400
  }
2391
2401
  // We need to swap the cursors to match the now-flipped query ordering.
2392
- const e = n.endAt ? new sn(n.endAt.position, !n.endAt.before) : null, r = n.startAt ? new sn(n.startAt.position, !n.startAt.before) : null;
2402
+ const e = n.endAt ? new sn(n.endAt.position, !n.endAt.inclusive) : null, r = n.startAt ? new sn(n.startAt.position, !n.startAt.inclusive) : null;
2393
2403
  // Now return as a LimitType.First query.
2394
2404
  n.S = Yt(n.path, n.collectionGroup, t, n.filters, n.limit, e, r);
2395
2405
  }
@@ -2762,7 +2772,7 @@ function Ln(t, n) {
2762
2772
  function kn(t, n) {
2763
2773
  const e = function(t) {
2764
2774
  const n = Z.fromString(t);
2765
- return b(Jn(n)), n;
2775
+ return b(Kn(n)), n;
2766
2776
  }(n);
2767
2777
  if (e.get(1) !== t.databaseId.projectId) throw new U(R, "Tried to deserialize key from different project: " + e.get(1) + " vs " + t.databaseId.projectId);
2768
2778
  if (e.get(3) !== t.databaseId.database) throw new U(R, "Tried to deserialize key from different database: " + e.get(3) + " vs " + t.databaseId.database);
@@ -2809,7 +2819,7 @@ function zn(t, n) {
2809
2819
  delete: Ln(t, n.key)
2810
2820
  }; else if (n instanceof Pn) e = {
2811
2821
  update: Mn(t, n.key, n.data),
2812
- updateMask: Kn(n.fieldMask)
2822
+ updateMask: Hn(n.fieldMask)
2813
2823
  }; else {
2814
2824
  if (!(n instanceof Nn)) return v();
2815
2825
  e = {
@@ -2867,34 +2877,34 @@ function Qn(t, n) {
2867
2877
  if ("==" /* EQUAL */ === t.op) {
2868
2878
  if (Mt(t.value)) return {
2869
2879
  unaryFilter: {
2870
- field: Hn(t.field),
2880
+ field: Yn(t.field),
2871
2881
  op: "IS_NAN"
2872
2882
  }
2873
2883
  };
2874
2884
  if (jt(t.value)) return {
2875
2885
  unaryFilter: {
2876
- field: Hn(t.field),
2886
+ field: Yn(t.field),
2877
2887
  op: "IS_NULL"
2878
2888
  }
2879
2889
  };
2880
2890
  } else if ("!=" /* NOT_EQUAL */ === t.op) {
2881
2891
  if (Mt(t.value)) return {
2882
2892
  unaryFilter: {
2883
- field: Hn(t.field),
2893
+ field: Yn(t.field),
2884
2894
  op: "IS_NOT_NAN"
2885
2895
  }
2886
2896
  };
2887
2897
  if (jt(t.value)) return {
2888
2898
  unaryFilter: {
2889
- field: Hn(t.field),
2899
+ field: Yn(t.field),
2890
2900
  op: "IS_NOT_NULL"
2891
2901
  }
2892
2902
  };
2893
2903
  }
2894
2904
  return {
2895
2905
  fieldFilter: {
2896
- field: Hn(t.field),
2897
- op: Yn(t.op),
2906
+ field: Yn(t.field),
2907
+ op: Wn(t.op),
2898
2908
  value: t.value
2899
2909
  }
2900
2910
  };
@@ -2914,8 +2924,8 @@ function Qn(t, n) {
2914
2924
  // visible for testing
2915
2925
  function(t) {
2916
2926
  return {
2917
- field: Hn(t.field),
2918
- direction: Wn(t.dir)
2927
+ field: Yn(t.field),
2928
+ direction: Gn(t.dir)
2919
2929
  };
2920
2930
  }(t)));
2921
2931
  }(n.orderBy);
@@ -2925,41 +2935,43 @@ function Qn(t, n) {
2925
2935
  value: n
2926
2936
  };
2927
2937
  }(t, n.limit);
2928
- return null !== o && (e.structuredQuery.limit = o), n.startAt && (e.structuredQuery.startAt = Gn(n.startAt)),
2929
- n.endAt && (e.structuredQuery.endAt = Gn(n.endAt)), e;
2938
+ var u;
2939
+ return null !== o && (e.structuredQuery.limit = o), n.startAt && (e.structuredQuery.startAt = {
2940
+ before: (u = n.startAt).inclusive,
2941
+ values: u.position
2942
+ }), n.endAt && (e.structuredQuery.endAt = function(t) {
2943
+ return {
2944
+ before: !t.inclusive,
2945
+ values: t.position
2946
+ };
2947
+ }
2948
+ // visible for testing
2949
+ (n.endAt)), e;
2930
2950
  }
2931
2951
 
2932
2952
  function Gn(t) {
2933
- return {
2934
- before: t.before,
2935
- values: t.position
2936
- };
2937
- }
2938
-
2939
- // visible for testing
2940
- function Wn(t) {
2941
2953
  return Dn[t];
2942
2954
  }
2943
2955
 
2944
2956
  // visible for testing
2945
- function Yn(t) {
2957
+ function Wn(t) {
2946
2958
  return $n[t];
2947
2959
  }
2948
2960
 
2949
- function Hn(t) {
2961
+ function Yn(t) {
2950
2962
  return {
2951
2963
  fieldPath: t.canonicalString()
2952
2964
  };
2953
2965
  }
2954
2966
 
2955
- function Kn(t) {
2967
+ function Hn(t) {
2956
2968
  const n = [];
2957
2969
  return t.fields.forEach((t => n.push(t.canonicalString()))), {
2958
2970
  fieldPaths: n
2959
2971
  };
2960
2972
  }
2961
2973
 
2962
- function Jn(t) {
2974
+ function Kn(t) {
2963
2975
  // Resource names have at least 4 components (project ID, database ID)
2964
2976
  return t.length >= 4 && "projects" === t.get(0) && "databases" === t.get(2);
2965
2977
  }
@@ -2979,7 +2991,7 @@ function Jn(t) {
2979
2991
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2980
2992
  * See the License for the specific language governing permissions and
2981
2993
  * limitations under the License.
2982
- */ function Xn(t) {
2994
+ */ function Jn(t) {
2983
2995
  return new Sn(t, /* useProto3Json= */ !0);
2984
2996
  }
2985
2997
 
@@ -3008,7 +3020,7 @@ function Jn(t) {
3008
3020
  * base delay. This prevents clients from accidentally synchronizing their
3009
3021
  * delays causing spikes of load to the backend.
3010
3022
  */
3011
- class Zn {
3023
+ class Xn {
3012
3024
  constructor(
3013
3025
  /**
3014
3026
  * The AsyncQueue to run backoff operations on.
@@ -3106,7 +3118,7 @@ class Zn {
3106
3118
  * An implementation of Datastore that exposes additional state for internal
3107
3119
  * consumption.
3108
3120
  */
3109
- class te extends class {} {
3121
+ class Zn extends class {} {
3110
3122
  constructor(t, n, e, r) {
3111
3123
  super(), this.authCredentials = t, this.appCheckCredentials = n, this.K = e, this.q = r,
3112
3124
  this.J = !1;
@@ -3133,14 +3145,14 @@ class te extends class {} {
3133
3145
 
3134
3146
  // TODO(firestorexp): Make sure there is only one Datastore instance per
3135
3147
  // firestore-exp client.
3136
- async function ne(t, n) {
3148
+ async function te(t, n) {
3137
3149
  const e = E(t), r = jn(e.q) + "/documents", s = {
3138
3150
  writes: n.map((t => zn(e.q, t)))
3139
3151
  };
3140
3152
  await e.m("Commit", r, s);
3141
3153
  }
3142
3154
 
3143
- async function ee(t, n) {
3155
+ async function ne(t, n) {
3144
3156
  const e = E(t), r = jn(e.q) + "/documents", s = {
3145
3157
  documents: n.map((t => Ln(e.q, t)))
3146
3158
  }, i = await e.T("BatchGetDocuments", r, s), o = new Map;
@@ -3155,7 +3167,7 @@ async function ee(t, n) {
3155
3167
  })), u;
3156
3168
  }
3157
3169
 
3158
- async function re(t, n) {
3170
+ async function ee(t, n) {
3159
3171
  const e = E(t), r = Qn(e.q, mn(n));
3160
3172
  return (await e.T("RunQuery", r.parent, {
3161
3173
  structuredQuery: r.structuredQuery
@@ -3184,7 +3196,7 @@ async function re(t, n) {
3184
3196
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3185
3197
  * See the License for the specific language governing permissions and
3186
3198
  * limitations under the License.
3187
- */ const se = new Map;
3199
+ */ const re = new Map;
3188
3200
 
3189
3201
  /**
3190
3202
  * An instance map that ensures only one Datastore exists per Firestore
@@ -3195,17 +3207,17 @@ async function re(t, n) {
3195
3207
  * instance. Callers must invoke removeComponents() when the Firestore
3196
3208
  * instance is terminated.
3197
3209
  */
3198
- function ie(t) {
3210
+ function se(t) {
3199
3211
  if (t._terminated) throw new U(F, "The client has already been terminated.");
3200
- if (!se.has(t)) {
3212
+ if (!re.has(t)) {
3201
3213
  p("ComponentProvider", "Initializing Datastore");
3202
3214
  const i = function(t) {
3203
3215
  return new mt(t, fetch.bind(null));
3204
3216
  }((n = t._databaseId, e = t.app.options.appId || "", r = t._persistenceKey, s = t._freezeSettings(),
3205
- new K(n, e, r, s.host, s.ssl, s.experimentalForceLongPolling, s.experimentalAutoDetectLongPolling, s.useFetchStreams))), o = Xn(t._databaseId), u = function(t, n, e, r) {
3206
- return new te(t, n, e, r);
3217
+ new K(n, e, r, s.host, s.ssl, s.experimentalForceLongPolling, s.experimentalAutoDetectLongPolling, s.useFetchStreams))), o = Jn(t._databaseId), u = function(t, n, e, r) {
3218
+ return new Zn(t, n, e, r);
3207
3219
  }(t._authCredentials, t._appCheckCredentials, i, o);
3208
- se.set(t, u);
3220
+ re.set(t, u);
3209
3221
  }
3210
3222
  var n, e, r, s;
3211
3223
  /**
@@ -3223,7 +3235,7 @@ function ie(t) {
3223
3235
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3224
3236
  * See the License for the specific language governing permissions and
3225
3237
  * limitations under the License.
3226
- */ return se.get(t);
3238
+ */ return re.get(t);
3227
3239
  }
3228
3240
 
3229
3241
  /**
@@ -3235,7 +3247,7 @@ function ie(t) {
3235
3247
  * user-supplied `FirestoreSettings` object. This is a separate type so that
3236
3248
  * defaults can be supplied and the value can be checked for equality.
3237
3249
  */
3238
- class oe {
3250
+ class ie {
3239
3251
  constructor(t) {
3240
3252
  var n;
3241
3253
  if (void 0 === t.host) {
@@ -3277,14 +3289,14 @@ class oe {
3277
3289
  * The Cloud Firestore service interface.
3278
3290
  *
3279
3291
  * Do not call this constructor directly. Instead, use {@link getFirestore}.
3280
- */ class ue {
3292
+ */ class oe {
3281
3293
  /** @hideconstructor */
3282
3294
  constructor(t, n, e) {
3283
3295
  this._authCredentials = n, this._appCheckCredentials = e,
3284
3296
  /**
3285
3297
  * Whether it's a Firestore or Firestore Lite instance.
3286
3298
  */
3287
- this.type = "firestore-lite", this._persistenceKey = "(lite)", this._settings = new oe({}),
3299
+ this.type = "firestore-lite", this._persistenceKey = "(lite)", this._settings = new ie({}),
3288
3300
  this._settingsFrozen = !1, t instanceof J ? this._databaseId = t : (this._app = t,
3289
3301
  this._databaseId = function(t) {
3290
3302
  if (!Object.prototype.hasOwnProperty.apply(t.options, [ "projectId" ])) throw new U(R, '"projectId" not provided in firebase.initializeApp.');
@@ -3317,7 +3329,7 @@ class oe {
3317
3329
  }
3318
3330
  _setSettings(t) {
3319
3331
  if (this._settingsFrozen) throw new U(F, "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.");
3320
- this._settings = new oe(t), void 0 !== t.credentials && (this._authCredentials = function(t) {
3332
+ this._settings = new ie(t), void 0 !== t.credentials && (this._authCredentials = function(t) {
3321
3333
  if (!t) return new B;
3322
3334
  switch (t.type) {
3323
3335
  case "gapi":
@@ -3358,13 +3370,13 @@ class oe {
3358
3370
  * Only ever called once.
3359
3371
  */ _terminate() {
3360
3372
  return function(t) {
3361
- const n = se.get(t);
3362
- n && (p("ComponentProvider", "Removing Datastore"), se.delete(t), n.terminate());
3373
+ const n = re.get(t);
3374
+ n && (p("ComponentProvider", "Removing Datastore"), re.delete(t), n.terminate());
3363
3375
  }(this), Promise.resolve();
3364
3376
  }
3365
3377
  }
3366
3378
 
3367
- function ce(t, n) {
3379
+ function ue(t, n) {
3368
3380
  const e = _getProvider(t, "firestore/lite");
3369
3381
  if (e.isInitialized()) throw new U(F, "Firestore can only be initialized once per app.");
3370
3382
  return e.initialize({
@@ -3380,7 +3392,7 @@ function ce(t, n) {
3380
3392
  * @param app - The {@link @firebase/app#FirebaseApp} instance that the returned `Firestore`
3381
3393
  * instance is associated with.
3382
3394
  * @returns The `Firestore` instance of the provided app.
3383
- */ function ae(n = t()) {
3395
+ */ function ce(n = t()) {
3384
3396
  return _getProvider(n, "firestore/lite").getImmediate();
3385
3397
  }
3386
3398
 
@@ -3396,9 +3408,9 @@ function ce(t, n) {
3396
3408
  * @param port - the emulator port (ex: 9000).
3397
3409
  * @param options.mockUserToken - the mock auth token to use for unit testing
3398
3410
  * Security Rules.
3399
- */ function he(t, n, e, r = {}) {
3411
+ */ function ae(t, n, e, r = {}) {
3400
3412
  var s;
3401
- const i = (t = ut(t, ue))._getSettings();
3413
+ const i = (t = ut(t, oe))._getSettings();
3402
3414
  if ("firestore.googleapis.com" !== i.host && i.host !== n && _("Host has been set in both settings() and useEmulator(), emulator host will be used"),
3403
3415
  t._setSettings(Object.assign(Object.assign({}, i), {
3404
3416
  host: `${n}:${e}`,
@@ -3436,8 +3448,8 @@ function ce(t, n) {
3436
3448
  * @param firestore - The `Firestore` instance to terminate.
3437
3449
  * @returns A `Promise` that is resolved when the instance has been successfully
3438
3450
  * terminated.
3439
- */ function le(t) {
3440
- return t = ut(t, ue), n(t.app, "firestore/lite"), t._delete();
3451
+ */ function he(t) {
3452
+ return t = ut(t, oe), n(t.app, "firestore/lite"), t._delete();
3441
3453
  }
3442
3454
 
3443
3455
  /**
@@ -3477,7 +3489,7 @@ function ce(t, n) {
3477
3489
  * and can be used to write, read, or listen to the location. The document at
3478
3490
  * the referenced location may or may not exist.
3479
3491
  */
3480
- class fe {
3492
+ class le {
3481
3493
  /** @hideconstructor */
3482
3494
  constructor(t,
3483
3495
  /**
@@ -3505,17 +3517,17 @@ class fe {
3505
3517
  /**
3506
3518
  * The collection this `DocumentReference` belongs to.
3507
3519
  */ get parent() {
3508
- return new we(this.firestore, this.converter, this._key.path.popLast());
3520
+ return new de(this.firestore, this.converter, this._key.path.popLast());
3509
3521
  }
3510
3522
  withConverter(t) {
3511
- return new fe(this.firestore, t, this._key);
3523
+ return new le(this.firestore, t, this._key);
3512
3524
  }
3513
3525
  }
3514
3526
 
3515
3527
  /**
3516
3528
  * A `Query` refers to a query which you can read or listen to. You can also
3517
3529
  * construct refined `Query` objects by adding filters and ordering.
3518
- */ class de {
3530
+ */ class fe {
3519
3531
  // This is the lite version of the Query class in the main SDK.
3520
3532
  /** @hideconstructor protected */
3521
3533
  constructor(t,
@@ -3528,14 +3540,14 @@ class fe {
3528
3540
  this.type = "query", this.firestore = t;
3529
3541
  }
3530
3542
  withConverter(t) {
3531
- return new de(this.firestore, t, this._query);
3543
+ return new fe(this.firestore, t, this._query);
3532
3544
  }
3533
3545
  }
3534
3546
 
3535
3547
  /**
3536
3548
  * A `CollectionReference` object can be used for adding documents, getting
3537
3549
  * document references, and querying for documents (using {@link query}).
3538
- */ class we extends de {
3550
+ */ class de extends fe {
3539
3551
  /** @hideconstructor */
3540
3552
  constructor(t, n, e) {
3541
3553
  super(t, n, new an(e)), this._path = e,
@@ -3556,23 +3568,23 @@ class fe {
3556
3568
  * subcollection. If this isn't a subcollection, the reference is null.
3557
3569
  */ get parent() {
3558
3570
  const t = this._path.popLast();
3559
- return t.isEmpty() ? null : new fe(this.firestore,
3571
+ return t.isEmpty() ? null : new le(this.firestore,
3560
3572
  /* converter= */ null, new et(t));
3561
3573
  }
3562
3574
  withConverter(t) {
3563
- return new we(this.firestore, t, this._path);
3575
+ return new de(this.firestore, t, this._path);
3564
3576
  }
3565
3577
  }
3566
3578
 
3567
- function me(t, n, ...e) {
3568
- if (t = l(t), rt("collection", "path", n), t instanceof ue) {
3579
+ function we(t, n, ...e) {
3580
+ if (t = l(t), rt("collection", "path", n), t instanceof oe) {
3569
3581
  const r = Z.fromString(n, ...e);
3570
- return it(r), new we(t, /* converter= */ null, r);
3582
+ return it(r), new de(t, /* converter= */ null, r);
3571
3583
  }
3572
3584
  {
3573
- if (!(t instanceof fe || t instanceof we)) throw new U(R, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
3585
+ if (!(t instanceof le || t instanceof de)) throw new U(R, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
3574
3586
  const r = t._path.child(Z.fromString(n, ...e));
3575
- return it(r), new we(t.firestore,
3587
+ return it(r), new de(t.firestore,
3576
3588
  /* converter= */ null, r);
3577
3589
  }
3578
3590
  }
@@ -3589,9 +3601,9 @@ function me(t, n, ...e) {
3589
3601
  * collection or subcollection with this ID as the last segment of its path
3590
3602
  * will be included. Cannot contain a slash.
3591
3603
  * @returns The created `Query`.
3592
- */ function pe(t, n) {
3593
- if (t = ut(t, ue), rt("collectionGroup", "collection id", n), n.indexOf("/") >= 0) throw new U(R, `Invalid collection ID '${n}' passed to function collectionGroup(). Collection IDs must not contain '/'.`);
3594
- return new de(t,
3604
+ */ function me(t, n) {
3605
+ if (t = ut(t, oe), rt("collectionGroup", "collection id", n), n.indexOf("/") >= 0) throw new U(R, `Invalid collection ID '${n}' passed to function collectionGroup(). Collection IDs must not contain '/'.`);
3606
+ return new fe(t,
3595
3607
  /* converter= */ null,
3596
3608
  /**
3597
3609
  * Creates a new Query for a collection group query that matches all documents
@@ -3602,19 +3614,19 @@ function me(t, n, ...e) {
3602
3614
  }(n));
3603
3615
  }
3604
3616
 
3605
- function ye(t, n, ...e) {
3617
+ function pe(t, n, ...e) {
3606
3618
  if (t = l(t),
3607
3619
  // We allow omission of 'pathString' but explicitly prohibit passing in both
3608
3620
  // 'undefined' and 'null'.
3609
- 1 === arguments.length && (n = yt.R()), rt("doc", "path", n), t instanceof ue) {
3621
+ 1 === arguments.length && (n = yt.R()), rt("doc", "path", n), t instanceof oe) {
3610
3622
  const r = Z.fromString(n, ...e);
3611
- return st(r), new fe(t,
3623
+ return st(r), new le(t,
3612
3624
  /* converter= */ null, new et(r));
3613
3625
  }
3614
3626
  {
3615
- if (!(t instanceof fe || t instanceof we)) throw new U(R, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
3627
+ if (!(t instanceof le || t instanceof de)) throw new U(R, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
3616
3628
  const r = t._path.child(Z.fromString(n, ...e));
3617
- return st(r), new fe(t.firestore, t instanceof we ? t.converter : null, new et(r));
3629
+ return st(r), new le(t.firestore, t instanceof de ? t.converter : null, new et(r));
3618
3630
  }
3619
3631
  }
3620
3632
 
@@ -3625,8 +3637,8 @@ function ye(t, n, ...e) {
3625
3637
  * @param right - A reference to compare.
3626
3638
  * @returns true if the references point to the same location in the same
3627
3639
  * Firestore database.
3628
- */ function _e(t, n) {
3629
- return t = l(t), n = l(n), (t instanceof fe || t instanceof we) && (n instanceof fe || n instanceof we) && (t.firestore === n.firestore && t.path === n.path && t.converter === n.converter);
3640
+ */ function ye(t, n) {
3641
+ return t = l(t), n = l(n), (t instanceof le || t instanceof de) && (n instanceof le || n instanceof de) && (t.firestore === n.firestore && t.path === n.path && t.converter === n.converter);
3630
3642
  }
3631
3643
 
3632
3644
  /**
@@ -3637,8 +3649,8 @@ function ye(t, n, ...e) {
3637
3649
  * @param right - A `Query` to compare.
3638
3650
  * @returns true if the references point to the same location in the same
3639
3651
  * Firestore database.
3640
- */ function ge(t, n) {
3641
- return t = l(t), n = l(n), t instanceof de && n instanceof de && (t.firestore === n.firestore && pn(t._query, n._query) && t.converter === n.converter);
3652
+ */ function _e(t, n) {
3653
+ return t = l(t), n = l(n), t instanceof fe && n instanceof fe && (t.firestore === n.firestore && pn(t._query, n._query) && t.converter === n.converter);
3642
3654
  }
3643
3655
 
3644
3656
  /**
@@ -3664,7 +3676,7 @@ function ye(t, n, ...e) {
3664
3676
  *
3665
3677
  * Create a `FieldPath` by providing field names. If more than one field
3666
3678
  * name is provided, the path will point to a nested field in a document.
3667
- */ class ve {
3679
+ */ class ge {
3668
3680
  /**
3669
3681
  * Creates a `FieldPath` from the provided field names. If more than one field
3670
3682
  * name is provided, the path will point to a nested field in a document.
@@ -3688,8 +3700,8 @@ function ye(t, n, ...e) {
3688
3700
  /**
3689
3701
  * Returns a special sentinel `FieldPath` to refer to the ID of a document.
3690
3702
  * It can be used in queries to sort or filter by the document ID.
3691
- */ function be() {
3692
- return new ve("__name__");
3703
+ */ function ve() {
3704
+ return new ge("__name__");
3693
3705
  }
3694
3706
 
3695
3707
  /**
@@ -3710,7 +3722,7 @@ function ye(t, n, ...e) {
3710
3722
  */
3711
3723
  /**
3712
3724
  * An immutable object representing an array of bytes.
3713
- */ class Ee {
3725
+ */ class be {
3714
3726
  /** @hideconstructor */
3715
3727
  constructor(t) {
3716
3728
  this._byteString = t;
@@ -3722,7 +3734,7 @@ function ye(t, n, ...e) {
3722
3734
  * @param base64 - The Base64 string used to create the `Bytes` object.
3723
3735
  */ static fromBase64String(t) {
3724
3736
  try {
3725
- return new Ee(Rt.fromBase64String(t));
3737
+ return new be(Rt.fromBase64String(t));
3726
3738
  } catch (t) {
3727
3739
  throw new U(R, "Failed to construct data from Base64 string: " + t);
3728
3740
  }
@@ -3732,7 +3744,7 @@ function ye(t, n, ...e) {
3732
3744
  *
3733
3745
  * @param array - The Uint8Array used to create the `Bytes` object.
3734
3746
  */ static fromUint8Array(t) {
3735
- return new Ee(Rt.fromUint8Array(t));
3747
+ return new be(Rt.fromUint8Array(t));
3736
3748
  }
3737
3749
  /**
3738
3750
  * Returns the underlying bytes as a Base64-encoded string.
@@ -3784,7 +3796,7 @@ function ye(t, n, ...e) {
3784
3796
  /**
3785
3797
  * Sentinel values that can be used when writing document fields with `set()`
3786
3798
  * or `update()`.
3787
- */ class Te {
3799
+ */ class Ee {
3788
3800
  /**
3789
3801
  * @param _methodName - The public API endpoint that returns this class.
3790
3802
  * @hideconstructor
@@ -3816,7 +3828,7 @@ function ye(t, n, ...e) {
3816
3828
  *
3817
3829
  * Latitude values are in the range of [-90, 90].
3818
3830
  * Longitude values are in the range of [-180, 180].
3819
- */ class Ie {
3831
+ */ class Te {
3820
3832
  /**
3821
3833
  * Creates a new immutable `GeoPoint` object with the provided latitude and
3822
3834
  * longitude values.
@@ -3875,9 +3887,9 @@ function ye(t, n, ...e) {
3875
3887
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3876
3888
  * See the License for the specific language governing permissions and
3877
3889
  * limitations under the License.
3878
- */ const Ae = /^__.*__$/;
3890
+ */ const Ie = /^__.*__$/;
3879
3891
 
3880
- /** The result of parsing document data (e.g. for a setData call). */ class Re {
3892
+ /** The result of parsing document data (e.g. for a setData call). */ class Ae {
3881
3893
  constructor(t, n, e) {
3882
3894
  this.data = t, this.fieldMask = n, this.fieldTransforms = e;
3883
3895
  }
@@ -3886,7 +3898,7 @@ function ye(t, n, ...e) {
3886
3898
  }
3887
3899
  }
3888
3900
 
3889
- /** The result of parsing "update" data (i.e. for an updateData call). */ class Pe {
3901
+ /** The result of parsing "update" data (i.e. for an updateData call). */ class Re {
3890
3902
  constructor(t,
3891
3903
  // The fieldMask does not include document transforms.
3892
3904
  n, e) {
@@ -3897,7 +3909,7 @@ function ye(t, n, ...e) {
3897
3909
  }
3898
3910
  }
3899
3911
 
3900
- function Ve(t) {
3912
+ function Pe(t) {
3901
3913
  switch (t) {
3902
3914
  case 0 /* Set */ :
3903
3915
  // fall through
@@ -3915,7 +3927,7 @@ function Ve(t) {
3915
3927
  }
3916
3928
  }
3917
3929
 
3918
- /** A "context" object passed around while parsing user data. */ class Ne {
3930
+ /** A "context" object passed around while parsing user data. */ class Ve {
3919
3931
  /**
3920
3932
  * Initializes a ParseContext with the given source and path.
3921
3933
  *
@@ -3947,7 +3959,7 @@ function Ve(t) {
3947
3959
  return this.settings.tt;
3948
3960
  }
3949
3961
  /** Returns a new context with the specified settings overwritten. */ nt(t) {
3950
- return new Ne(Object.assign(Object.assign({}, this.settings), t), this.databaseId, this.q, this.ignoreUndefinedProperties, this.fieldTransforms, this.fieldMask);
3962
+ return new Ve(Object.assign(Object.assign({}, this.settings), t), this.databaseId, this.q, this.ignoreUndefinedProperties, this.fieldTransforms, this.fieldMask);
3951
3963
  }
3952
3964
  et(t) {
3953
3965
  var n;
@@ -3974,7 +3986,7 @@ function Ve(t) {
3974
3986
  });
3975
3987
  }
3976
3988
  ut(t) {
3977
- return He(t, this.settings.methodName, this.settings.ct || !1, this.path, this.settings.at);
3989
+ return Ye(t, this.settings.methodName, this.settings.ct || !1, this.path, this.settings.at);
3978
3990
  }
3979
3991
  /** Returns 'true' if 'fieldPath' was traversed when creating this context. */ contains(t) {
3980
3992
  return void 0 !== this.fieldMask.find((n => t.isPrefixOf(n))) || void 0 !== this.fieldTransforms.find((n => t.isPrefixOf(n.field)));
@@ -3986,19 +3998,19 @@ function Ve(t) {
3986
3998
  }
3987
3999
  st(t) {
3988
4000
  if (0 === t.length) throw this.ut("Document fields must not be empty");
3989
- if (Ve(this.tt) && Ae.test(t)) throw this.ut('Document fields cannot begin and end with "__"');
4001
+ if (Pe(this.tt) && Ie.test(t)) throw this.ut('Document fields cannot begin and end with "__"');
3990
4002
  }
3991
4003
  }
3992
4004
 
3993
4005
  /**
3994
4006
  * Helper for parsing raw user input (provided via the API) into internal model
3995
4007
  * classes.
3996
- */ class De {
4008
+ */ class Ne {
3997
4009
  constructor(t, n, e) {
3998
- this.databaseId = t, this.ignoreUndefinedProperties = n, this.q = e || Xn(t);
4010
+ this.databaseId = t, this.ignoreUndefinedProperties = n, this.q = e || Jn(t);
3999
4011
  }
4000
4012
  /** Creates a new top-level parse context. */ ht(t, n, e, r = !1) {
4001
- return new Ne({
4013
+ return new Ve({
4002
4014
  tt: t,
4003
4015
  methodName: n,
4004
4016
  at: e,
@@ -4009,29 +4021,29 @@ function Ve(t) {
4009
4021
  }
4010
4022
  }
4011
4023
 
4012
- function $e(t) {
4013
- const n = t._freezeSettings(), e = Xn(t._databaseId);
4014
- return new De(t._databaseId, !!n.ignoreUndefinedProperties, e);
4024
+ function De(t) {
4025
+ const n = t._freezeSettings(), e = Jn(t._databaseId);
4026
+ return new Ne(t._databaseId, !!n.ignoreUndefinedProperties, e);
4015
4027
  }
4016
4028
 
4017
- /** Parse document data from a set() call. */ function Se(t, n, e, r, s, i = {}) {
4029
+ /** Parse document data from a set() call. */ function $e(t, n, e, r, s, i = {}) {
4018
4030
  const o = t.ht(i.merge || i.mergeFields ? 2 /* MergeSet */ : 0 /* Set */ , n, e, s);
4019
- Qe("Data must be an object, but it was:", o, r);
4020
- const u = Be(r, o);
4031
+ ze("Data must be an object, but it was:", o, r);
4032
+ const u = Me(r, o);
4021
4033
  let c, a;
4022
4034
  if (i.merge) c = new It(o.fieldMask), a = o.fieldTransforms; else if (i.mergeFields) {
4023
4035
  const t = [];
4024
4036
  for (const r of i.mergeFields) {
4025
- const s = Ge(n, r, e);
4037
+ const s = Qe(n, r, e);
4026
4038
  if (!o.contains(s)) throw new U(R, `Field '${s}' is specified in your field mask but missing from your input data.`);
4027
- Ke(t, s) || t.push(s);
4039
+ He(t, s) || t.push(s);
4028
4040
  }
4029
4041
  c = new It(t), a = o.fieldTransforms.filter((t => c.covers(t.field)));
4030
4042
  } else c = null, a = o.fieldTransforms;
4031
- return new Re(new Qt(u), c, a);
4043
+ return new Ae(new Qt(u), c, a);
4032
4044
  }
4033
4045
 
4034
- class Fe extends Te {
4046
+ class Se extends Ee {
4035
4047
  _toFieldTransform(t) {
4036
4048
  if (2 /* MergeSet */ !== t.tt) throw 1 /* Update */ === t.tt ? t.ut(`${this._methodName}() can only appear at the top level of your update data`) : t.ut(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);
4037
4049
  // No transform to add for a delete, but we need to add it to our
@@ -4039,7 +4051,7 @@ class Fe extends Te {
4039
4051
  return t.fieldMask.push(t.path), null;
4040
4052
  }
4041
4053
  isEqual(t) {
4042
- return t instanceof Fe;
4054
+ return t instanceof Se;
4043
4055
  }
4044
4056
  }
4045
4057
 
@@ -4058,8 +4070,8 @@ class Fe extends Te {
4058
4070
  * context.
4059
4071
  * @param context - The parent context.
4060
4072
  * @param arrayElement - Whether or not the FieldValue has an array.
4061
- */ function xe(t, n, e) {
4062
- return new Ne({
4073
+ */ function Fe(t, n, e) {
4074
+ return new Ve({
4063
4075
  tt: 3 /* Argument */ ,
4064
4076
  at: n.settings.at,
4065
4077
  methodName: t._methodName,
@@ -4067,22 +4079,22 @@ class Fe extends Te {
4067
4079
  }, n.databaseId, n.q, n.ignoreUndefinedProperties);
4068
4080
  }
4069
4081
 
4070
- class qe extends Te {
4082
+ class xe extends Ee {
4071
4083
  _toFieldTransform(t) {
4072
4084
  return new Tn(t.path, new gn);
4073
4085
  }
4074
4086
  isEqual(t) {
4075
- return t instanceof qe;
4087
+ return t instanceof xe;
4076
4088
  }
4077
4089
  }
4078
4090
 
4079
- class Oe extends Te {
4091
+ class qe extends Ee {
4080
4092
  constructor(t, n) {
4081
4093
  super(t), this.lt = n;
4082
4094
  }
4083
4095
  _toFieldTransform(t) {
4084
- const n = xe(this, t,
4085
- /*array=*/ !0), e = this.lt.map((t => Me(t, n))), r = new vn(e);
4096
+ const n = Fe(this, t,
4097
+ /*array=*/ !0), e = this.lt.map((t => je(t, n))), r = new vn(e);
4086
4098
  return new Tn(t.path, r);
4087
4099
  }
4088
4100
  isEqual(t) {
@@ -4091,13 +4103,13 @@ class Oe extends Te {
4091
4103
  }
4092
4104
  }
4093
4105
 
4094
- class Ce extends Te {
4106
+ class Oe extends Ee {
4095
4107
  constructor(t, n) {
4096
4108
  super(t), this.lt = n;
4097
4109
  }
4098
4110
  _toFieldTransform(t) {
4099
- const n = xe(this, t,
4100
- /*array=*/ !0), e = this.lt.map((t => Me(t, n))), r = new bn(e);
4111
+ const n = Fe(this, t,
4112
+ /*array=*/ !0), e = this.lt.map((t => je(t, n))), r = new bn(e);
4101
4113
  return new Tn(t.path, r);
4102
4114
  }
4103
4115
  isEqual(t) {
@@ -4106,7 +4118,7 @@ class Ce extends Te {
4106
4118
  }
4107
4119
  }
4108
4120
 
4109
- class Le extends Te {
4121
+ class Ce extends Ee {
4110
4122
  constructor(t, n) {
4111
4123
  super(t), this.ft = n;
4112
4124
  }
@@ -4120,50 +4132,50 @@ class Le extends Te {
4120
4132
  }
4121
4133
  }
4122
4134
 
4123
- /** Parse update data from an update() call. */ function ke(t, n, e, r) {
4135
+ /** Parse update data from an update() call. */ function Le(t, n, e, r) {
4124
4136
  const s = t.ht(1 /* Update */ , n, e);
4125
- Qe("Data must be an object, but it was:", s, r);
4137
+ ze("Data must be an object, but it was:", s, r);
4126
4138
  const i = [], o = Qt.empty();
4127
4139
  Tt(r, ((t, r) => {
4128
- const u = Ye(n, t, e);
4140
+ const u = We(n, t, e);
4129
4141
  // For Compat types, we have to "extract" the underlying types before
4130
4142
  // performing validation.
4131
4143
  r = l(r);
4132
4144
  const c = s.it(u);
4133
- if (r instanceof Fe)
4145
+ if (r instanceof Se)
4134
4146
  // Add it to the field mask, but don't add anything to updateData.
4135
4147
  i.push(u); else {
4136
- const t = Me(r, c);
4148
+ const t = je(r, c);
4137
4149
  null != t && (i.push(u), o.set(u, t));
4138
4150
  }
4139
4151
  }));
4140
4152
  const u = new It(i);
4141
- return new Pe(o, u, s.fieldTransforms);
4153
+ return new Re(o, u, s.fieldTransforms);
4142
4154
  }
4143
4155
 
4144
- /** Parse update data from a list of field/value arguments. */ function Ue(t, n, e, r, s, i) {
4145
- const o = t.ht(1 /* Update */ , n, e), u = [ Ge(n, r, e) ], c = [ s ];
4156
+ /** Parse update data from a list of field/value arguments. */ function ke(t, n, e, r, s, i) {
4157
+ const o = t.ht(1 /* Update */ , n, e), u = [ Qe(n, r, e) ], c = [ s ];
4146
4158
  if (i.length % 2 != 0) throw new U(R, `Function ${n}() needs to be called with an even number of arguments that alternate between field names and values.`);
4147
- for (let t = 0; t < i.length; t += 2) u.push(Ge(n, i[t])), c.push(i[t + 1]);
4159
+ for (let t = 0; t < i.length; t += 2) u.push(Qe(n, i[t])), c.push(i[t + 1]);
4148
4160
  const a = [], h = Qt.empty();
4149
4161
  // We iterate in reverse order to pick the last value for a field if the
4150
4162
  // user specified the field multiple times.
4151
- for (let t = u.length - 1; t >= 0; --t) if (!Ke(a, u[t])) {
4163
+ for (let t = u.length - 1; t >= 0; --t) if (!He(a, u[t])) {
4152
4164
  const n = u[t];
4153
4165
  let e = c[t];
4154
4166
  // For Compat types, we have to "extract" the underlying types before
4155
4167
  // performing validation.
4156
4168
  e = l(e);
4157
4169
  const r = o.it(n);
4158
- if (e instanceof Fe)
4170
+ if (e instanceof Se)
4159
4171
  // Add it to the field mask, but don't add anything to updateData.
4160
4172
  a.push(n); else {
4161
- const t = Me(e, r);
4173
+ const t = je(e, r);
4162
4174
  null != t && (a.push(n), h.set(n, t));
4163
4175
  }
4164
4176
  }
4165
4177
  const f = new It(a);
4166
- return new Pe(h, f, o.fieldTransforms);
4178
+ return new Re(h, f, o.fieldTransforms);
4167
4179
  }
4168
4180
 
4169
4181
  /**
@@ -4172,8 +4184,8 @@ class Le extends Te {
4172
4184
  *
4173
4185
  * @param allowArrays - Whether the query value is an array that may directly
4174
4186
  * contain additional arrays (e.g. the operand of an `in` query).
4175
- */ function je(t, n, e, r = !1) {
4176
- return Me(e, t.ht(r ? 4 /* ArrayArgument */ : 3 /* Argument */ , n));
4187
+ */ function Ue(t, n, e, r = !1) {
4188
+ return je(e, t.ht(r ? 4 /* ArrayArgument */ : 3 /* Argument */ , n));
4177
4189
  }
4178
4190
 
4179
4191
  /**
@@ -4184,12 +4196,12 @@ class Le extends Te {
4184
4196
  * the source of the data being parsed, etc.
4185
4197
  * @returns The parsed value, or null if the value was a FieldValue sentinel
4186
4198
  * that should not be included in the resulting parsed data.
4187
- */ function Me(t, n) {
4188
- if (ze(
4199
+ */ function je(t, n) {
4200
+ if (Be(
4189
4201
  // Unwrap the API type from the Compat SDK. This will return the API type
4190
4202
  // from firestore-exp.
4191
- t = l(t))) return Qe("Unsupported field value:", n, t), Be(t, n);
4192
- if (t instanceof Te)
4203
+ t = l(t))) return ze("Unsupported field value:", n, t), Me(t, n);
4204
+ if (t instanceof Ee)
4193
4205
  // FieldValues usually parse into transforms (except deleteField())
4194
4206
  // in which case we do not want to include this field in our parsed data
4195
4207
  // (as doing so will overwrite the field directly prior to the transform
@@ -4201,7 +4213,7 @@ class Le extends Te {
4201
4213
  */
4202
4214
  return function(t, n) {
4203
4215
  // Sentinels are only supported with writes, and not within arrays.
4204
- if (!Ve(n.tt)) throw n.ut(`${t._methodName}() can only be used with update() and set()`);
4216
+ if (!Pe(n.tt)) throw n.ut(`${t._methodName}() can only be used with update() and set()`);
4205
4217
  if (!n.path) throw n.ut(`${t._methodName}() is not currently supported inside arrays`);
4206
4218
  const e = t._toFieldTransform(n);
4207
4219
  e && n.fieldTransforms.push(e);
@@ -4231,7 +4243,7 @@ class Le extends Te {
4231
4243
  const e = [];
4232
4244
  let r = 0;
4233
4245
  for (const s of t) {
4234
- let t = Me(s, n.ot(r));
4246
+ let t = je(s, n.ot(r));
4235
4247
  null == t && (
4236
4248
  // Just include nulls in the array for fields being replaced with a
4237
4249
  // sentinel.
@@ -4272,16 +4284,16 @@ class Le extends Te {
4272
4284
  timestampValue: Fn(n.q, e)
4273
4285
  };
4274
4286
  }
4275
- if (t instanceof Ie) return {
4287
+ if (t instanceof Te) return {
4276
4288
  geoPointValue: {
4277
4289
  latitude: t.latitude,
4278
4290
  longitude: t.longitude
4279
4291
  }
4280
4292
  };
4281
- if (t instanceof Ee) return {
4293
+ if (t instanceof be) return {
4282
4294
  bytesValue: xn(n.q, t._byteString)
4283
4295
  };
4284
- if (t instanceof fe) {
4296
+ if (t instanceof le) {
4285
4297
  const e = n.databaseId, r = t.firestore._databaseId;
4286
4298
  if (!r.isEqual(e)) throw n.ut(`Document reference is for database ${r.projectId}/${r.database} but should be for database ${e.projectId}/${e.database}`);
4287
4299
  return {
@@ -4299,13 +4311,13 @@ class Le extends Te {
4299
4311
  */ (t, n);
4300
4312
  }
4301
4313
 
4302
- function Be(t, n) {
4314
+ function Me(t, n) {
4303
4315
  const e = {};
4304
4316
  return !function(t) {
4305
4317
  for (const n in t) if (Object.prototype.hasOwnProperty.call(t, n)) return !1;
4306
4318
  return !0;
4307
4319
  }(t) ? Tt(t, ((t, r) => {
4308
- const s = Me(r, n.et(t));
4320
+ const s = je(r, n.et(t));
4309
4321
  null != s && (e[t] = s);
4310
4322
  })) :
4311
4323
  // If we encounter an empty object, we explicitly add it to the update
@@ -4317,12 +4329,12 @@ function Be(t, n) {
4317
4329
  };
4318
4330
  }
4319
4331
 
4320
- function ze(t) {
4321
- return !("object" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof vt || t instanceof Ie || t instanceof Ee || t instanceof fe || t instanceof Te);
4332
+ function Be(t) {
4333
+ return !("object" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof vt || t instanceof Te || t instanceof be || t instanceof le || t instanceof Ee);
4322
4334
  }
4323
4335
 
4324
- function Qe(t, n, e) {
4325
- if (!ze(e) || !function(t) {
4336
+ function ze(t, n, e) {
4337
+ if (!Be(e) || !function(t) {
4326
4338
  return "object" == typeof t && null !== t && (Object.getPrototypeOf(t) === Object.prototype || null === Object.getPrototypeOf(t));
4327
4339
  }(e)) {
4328
4340
  const r = ot(e);
@@ -4332,20 +4344,20 @@ function Qe(t, n, e) {
4332
4344
 
4333
4345
  /**
4334
4346
  * Helper that calls fromDotSeparatedString() but wraps any error thrown.
4335
- */ function Ge(t, n, e) {
4347
+ */ function Qe(t, n, e) {
4336
4348
  if ((
4337
4349
  // If required, replace the FieldPath Compat class with with the firestore-exp
4338
4350
  // FieldPath.
4339
- n = l(n)) instanceof ve) return n._internalPath;
4340
- if ("string" == typeof n) return Ye(t, n);
4341
- throw He("Field path arguments must be of type string or ", t,
4351
+ n = l(n)) instanceof ge) return n._internalPath;
4352
+ if ("string" == typeof n) return We(t, n);
4353
+ throw Ye("Field path arguments must be of type string or ", t,
4342
4354
  /* hasConverter= */ !1,
4343
4355
  /* path= */ void 0, e);
4344
4356
  }
4345
4357
 
4346
4358
  /**
4347
4359
  * Matches any characters in a field path string that are reserved.
4348
- */ const We = new RegExp("[~\\*/\\[\\]]");
4360
+ */ const Ge = new RegExp("[~\\*/\\[\\]]");
4349
4361
 
4350
4362
  /**
4351
4363
  * Wraps fromDotSeparatedString with an error message about the method that
@@ -4355,20 +4367,20 @@ function Qe(t, n, e) {
4355
4367
  * split on dots.
4356
4368
  * @param targetDoc - The document against which the field path will be
4357
4369
  * evaluated.
4358
- */ function Ye(t, n, e) {
4359
- if (n.search(We) >= 0) throw He(`Invalid field path (${n}). Paths must not contain '~', '*', '/', '[', or ']'`, t,
4370
+ */ function We(t, n, e) {
4371
+ if (n.search(Ge) >= 0) throw Ye(`Invalid field path (${n}). Paths must not contain '~', '*', '/', '[', or ']'`, t,
4360
4372
  /* hasConverter= */ !1,
4361
4373
  /* path= */ void 0, e);
4362
4374
  try {
4363
- return new ve(...n.split("."))._internalPath;
4375
+ return new ge(...n.split("."))._internalPath;
4364
4376
  } catch (r) {
4365
- throw He(`Invalid field path (${n}). Paths must not be empty, begin with '.', end with '.', or contain '..'`, t,
4377
+ throw Ye(`Invalid field path (${n}). Paths must not be empty, begin with '.', end with '.', or contain '..'`, t,
4366
4378
  /* hasConverter= */ !1,
4367
4379
  /* path= */ void 0, e);
4368
4380
  }
4369
4381
  }
4370
4382
 
4371
- function He(t, n, e, r, s) {
4383
+ function Ye(t, n, e, r, s) {
4372
4384
  const i = r && !r.isEmpty(), o = void 0 !== s;
4373
4385
  let u = `Function ${n}() called with invalid data`;
4374
4386
  e && (u += " (via `toFirestore()`)"), u += ". ";
@@ -4377,7 +4389,7 @@ function He(t, n, e, r, s) {
4377
4389
  c += ")"), new U(R, u + t + c);
4378
4390
  }
4379
4391
 
4380
- /** Checks `haystack` if FieldPath `needle` is present. Runs in O(n). */ function Ke(t, n) {
4392
+ /** Checks `haystack` if FieldPath `needle` is present. Runs in O(n). */ function He(t, n) {
4381
4393
  return t.some((t => t.isEqual(n)));
4382
4394
  }
4383
4395
 
@@ -4405,7 +4417,7 @@ function He(t, n, e, r, s) {
4405
4417
  * For a `DocumentSnapshot` that points to a non-existing document, any data
4406
4418
  * access will return 'undefined'. You can use the `exists()` method to
4407
4419
  * explicitly verify a document's existence.
4408
- */ class Je {
4420
+ */ class Ke {
4409
4421
  // Note: This class is stripped down version of the DocumentSnapshot in
4410
4422
  // the legacy SDK. The changes are:
4411
4423
  // - No support for SnapshotMetadata.
@@ -4421,7 +4433,7 @@ function He(t, n, e, r, s) {
4421
4433
  /**
4422
4434
  * The `DocumentReference` for the document included in the `DocumentSnapshot`.
4423
4435
  */ get ref() {
4424
- return new fe(this._firestore, this._converter, this._key);
4436
+ return new le(this._firestore, this._converter, this._key);
4425
4437
  }
4426
4438
  /**
4427
4439
  * Signals whether or not the document at the snapshot's location exists.
@@ -4441,7 +4453,7 @@ function He(t, n, e, r, s) {
4441
4453
  if (this._converter) {
4442
4454
  // We only want to use the converter and create a new DocumentSnapshot
4443
4455
  // if a converter has been provided.
4444
- const t = new Xe(this._firestore, this._userDataWriter, this._key, this._document,
4456
+ const t = new Je(this._firestore, this._userDataWriter, this._key, this._document,
4445
4457
  /* converter= */ null);
4446
4458
  return this._converter.fromFirestore(t);
4447
4459
  }
@@ -4461,7 +4473,7 @@ function He(t, n, e, r, s) {
4461
4473
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4462
4474
  get(t) {
4463
4475
  if (this._document) {
4464
- const n = this._document.data.field(nr("DocumentSnapshot.get", t));
4476
+ const n = this._document.data.field(tr("DocumentSnapshot.get", t));
4465
4477
  if (null !== n) return this._userDataWriter.convertValue(n);
4466
4478
  }
4467
4479
  }
@@ -4477,7 +4489,7 @@ function He(t, n, e, r, s) {
4477
4489
  * `DocumentSnapshot`. Since query results contain only existing documents, the
4478
4490
  * `exists` property will always be true and `data()` will never return
4479
4491
  * 'undefined'.
4480
- */ class Xe extends Je {
4492
+ */ class Je extends Ke {
4481
4493
  /**
4482
4494
  * Retrieves all fields in the document as an `Object`.
4483
4495
  *
@@ -4495,7 +4507,7 @@ function He(t, n, e, r, s) {
4495
4507
  * array via the `docs` property or enumerated using the `forEach` method. The
4496
4508
  * number of documents can be determined via the `empty` and `size`
4497
4509
  * properties.
4498
- */ class Ze {
4510
+ */ class Xe {
4499
4511
  /** @hideconstructor */
4500
4512
  constructor(t, n) {
4501
4513
  this._docs = n, this.query = t;
@@ -4526,14 +4538,14 @@ function He(t, n, e, r, s) {
4526
4538
  * @param left - A snapshot to compare.
4527
4539
  * @param right - A snapshot to compare.
4528
4540
  * @returns true if the snapshots are equal.
4529
- */ function tr(t, n) {
4530
- return t = l(t), n = l(n), t instanceof Je && n instanceof Je ? t._firestore === n._firestore && t._key.isEqual(n._key) && (null === t._document ? null === n._document : t._document.isEqual(n._document)) && t._converter === n._converter : t instanceof Ze && n instanceof Ze && (ge(t.query, n.query) && gt(t.docs, n.docs, tr));
4541
+ */ function Ze(t, n) {
4542
+ return t = l(t), n = l(n), t instanceof Ke && n instanceof Ke ? t._firestore === n._firestore && t._key.isEqual(n._key) && (null === t._document ? null === n._document : t._document.isEqual(n._document)) && t._converter === n._converter : t instanceof Xe && n instanceof Xe && (_e(t.query, n.query) && gt(t.docs, n.docs, Ze));
4531
4543
  }
4532
4544
 
4533
4545
  /**
4534
4546
  * Helper that calls `fromDotSeparatedString()` but wraps any error thrown.
4535
- */ function nr(t, n) {
4536
- return "string" == typeof n ? Ye(t, n) : n instanceof ve ? n._internalPath : n._delegate._internalPath;
4547
+ */ function tr(t, n) {
4548
+ return "string" == typeof n ? We(t, n) : n instanceof ge ? n._internalPath : n._delegate._internalPath;
4537
4549
  }
4538
4550
 
4539
4551
  /**
@@ -4560,7 +4572,7 @@ function He(t, n, e, r, s) {
4560
4572
  * can then be passed to {@link query} to create a new query instance that
4561
4573
  * also contains this `QueryConstraint`.
4562
4574
  */
4563
- class er {}
4575
+ class nr {}
4564
4576
 
4565
4577
  /**
4566
4578
  * Creates a new immutable instance of {@link Query} that is extended to also include
@@ -4570,32 +4582,32 @@ class er {}
4570
4582
  * @param queryConstraints - The list of {@link QueryConstraint}s to apply.
4571
4583
  * @throws if any of the provided query constraints cannot be combined with the
4572
4584
  * existing or new constraints.
4573
- */ function rr(t, ...n) {
4585
+ */ function er(t, ...n) {
4574
4586
  for (const e of n) t = e._apply(t);
4575
4587
  return t;
4576
4588
  }
4577
4589
 
4578
- class sr extends er {
4590
+ class rr extends nr {
4579
4591
  constructor(t, n, e) {
4580
4592
  super(), this.dt = t, this.wt = n, this.yt = e, this.type = "where";
4581
4593
  }
4582
4594
  _apply(t) {
4583
- const n = $e(t.firestore), e = function(t, n, e, r, s, i, o) {
4595
+ const n = De(t.firestore), e = function(t, n, e, r, s, i, o) {
4584
4596
  let u;
4585
4597
  if (s.isKeyField()) {
4586
4598
  if ("array-contains" /* ARRAY_CONTAINS */ === i || "array-contains-any" /* ARRAY_CONTAINS_ANY */ === i) throw new U(R, `Invalid Query. You can't perform '${i}' queries on documentId().`);
4587
4599
  if ("in" /* IN */ === i || "not-in" /* NOT_IN */ === i) {
4588
- gr(o, i);
4600
+ _r(o, i);
4589
4601
  const n = [];
4590
- for (const e of o) n.push(_r(r, t, e));
4602
+ for (const e of o) n.push(yr(r, t, e));
4591
4603
  u = {
4592
4604
  arrayValue: {
4593
4605
  values: n
4594
4606
  }
4595
4607
  };
4596
- } else u = _r(r, t, o);
4597
- } else "in" /* IN */ !== i && "not-in" /* NOT_IN */ !== i && "array-contains-any" /* ARRAY_CONTAINS_ANY */ !== i || gr(o, i),
4598
- u = je(e, n, o,
4608
+ } else u = yr(r, t, o);
4609
+ } else "in" /* IN */ !== i && "not-in" /* NOT_IN */ !== i && "array-contains-any" /* ARRAY_CONTAINS_ANY */ !== i || _r(o, i),
4610
+ u = Ue(e, n, o,
4599
4611
  /* allowArrays= */ "in" /* IN */ === i || "not-in" /* NOT_IN */ === i);
4600
4612
  const c = Ht.create(s, i, u);
4601
4613
  return function(t, n) {
@@ -4603,7 +4615,7 @@ class sr extends er {
4603
4615
  const e = fn(t);
4604
4616
  if (null !== e && !e.isEqual(n.field)) throw new U(R, `Invalid query. All where filters with an inequality (<, <=, !=, not-in, >, or >=) must be on the same field. But you have inequality filters on '${e.toString()}' and '${n.field.toString()}'`);
4605
4617
  const r = ln(t);
4606
- null !== r && vr(t, n.field, r);
4618
+ null !== r && gr(t, n.field, r);
4607
4619
  }
4608
4620
  const e = function(t, n) {
4609
4621
  for (const e of t.filters) if (n.indexOf(e.op) >= 0) return e.op;
@@ -4647,7 +4659,7 @@ class sr extends er {
4647
4659
  throw e === n.op ? new U(R, `Invalid query. You cannot use more than one '${n.op.toString()}' filter.`) : new U(R, `Invalid query. You cannot use '${n.op.toString()}' filters with '${e.toString()}' filters.`);
4648
4660
  }(t, c), c;
4649
4661
  }(t._query, "where", n, t.firestore._databaseId, this.dt, this.wt, this.yt);
4650
- return new de(t.firestore, t.converter, function(t, n) {
4662
+ return new fe(t.firestore, t.converter, function(t, n) {
4651
4663
  const e = t.filters.concat([ n ]);
4652
4664
  return new an(t.path, t.collectionGroup, t.explicitOrderBy.slice(), e, t.limit, t.limitType, t.startAt, t.endAt);
4653
4665
  }(t._query, e));
@@ -4664,12 +4676,12 @@ class sr extends er {
4664
4676
  * "&lt;=", "!=").
4665
4677
  * @param value - The value for comparison
4666
4678
  * @returns The created {@link Query}.
4667
- */ function ir(t, n, e) {
4668
- const r = n, s = nr("where", t);
4669
- return new sr(s, r, e);
4679
+ */ function sr(t, n, e) {
4680
+ const r = n, s = tr("where", t);
4681
+ return new rr(s, r, e);
4670
4682
  }
4671
4683
 
4672
- class or extends er {
4684
+ class ir extends nr {
4673
4685
  constructor(t, n) {
4674
4686
  super(), this.dt = t, this._t = n, this.type = "orderBy";
4675
4687
  }
@@ -4682,7 +4694,7 @@ class or extends er {
4682
4694
  if (null === ln(t)) {
4683
4695
  // This is the first order by. It must match any inequality.
4684
4696
  const e = fn(t);
4685
- null !== e && vr(t, e, n.field);
4697
+ null !== e && gr(t, e, n.field);
4686
4698
  }
4687
4699
  }(t, r), r;
4688
4700
  }
@@ -4697,7 +4709,7 @@ class or extends er {
4697
4709
  * of the query or if any of the fields in the order by are an uncommitted
4698
4710
  * server timestamp.
4699
4711
  */ (t._query, this.dt, this._t);
4700
- return new de(t.firestore, t.converter, function(t, n) {
4712
+ return new fe(t.firestore, t.converter, function(t, n) {
4701
4713
  // TODO(dimond): validate that orderBy does not list the same key twice.
4702
4714
  const e = t.explicitOrderBy.concat([ n ]);
4703
4715
  return new an(t.path, t.collectionGroup, e, t.filters.slice(), t.limit, t.limitType, t.startAt, t.endAt);
@@ -4713,17 +4725,17 @@ class or extends er {
4713
4725
  * @param directionStr - Optional direction to sort by ('asc' or 'desc'). If
4714
4726
  * not specified, order will be ascending.
4715
4727
  * @returns The created {@link Query}.
4716
- */ function ur(t, n = "asc") {
4717
- const e = n, r = nr("orderBy", t);
4718
- return new or(r, e);
4728
+ */ function or(t, n = "asc") {
4729
+ const e = n, r = tr("orderBy", t);
4730
+ return new ir(r, e);
4719
4731
  }
4720
4732
 
4721
- class cr extends er {
4733
+ class ur extends nr {
4722
4734
  constructor(t, n, e) {
4723
4735
  super(), this.type = t, this.gt = n, this.vt = e;
4724
4736
  }
4725
4737
  _apply(t) {
4726
- return new de(t.firestore, t.converter, function(t, n, e) {
4738
+ return new fe(t.firestore, t.converter, function(t, n, e) {
4727
4739
  return new an(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), n, e, t.startAt, t.endAt);
4728
4740
  }(t._query, this.gt, this.vt));
4729
4741
  }
@@ -4734,8 +4746,8 @@ class cr extends er {
4734
4746
  *
4735
4747
  * @param limit - The maximum number of items to return.
4736
4748
  * @returns The created {@link Query}.
4737
- */ function ar(t) {
4738
- return ct("limit", t), new cr("limit", t, "F" /* First */);
4749
+ */ function cr(t) {
4750
+ return ct("limit", t), new ur("limit", t, "F" /* First */);
4739
4751
  }
4740
4752
 
4741
4753
  /**
@@ -4746,53 +4758,55 @@ class cr extends er {
4746
4758
  *
4747
4759
  * @param limit - The maximum number of items to return.
4748
4760
  * @returns The created {@link Query}.
4749
- */ function hr(t) {
4750
- return ct("limitToLast", t), new cr("limitToLast", t, "L" /* Last */);
4761
+ */ function ar(t) {
4762
+ return ct("limitToLast", t), new ur("limitToLast", t, "L" /* Last */);
4751
4763
  }
4752
4764
 
4753
- class lr extends er {
4765
+ class hr extends nr {
4754
4766
  constructor(t, n, e) {
4755
4767
  super(), this.type = t, this.bt = n, this.Et = e;
4756
4768
  }
4757
4769
  _apply(t) {
4758
- const n = yr(t, this.type, this.bt, this.Et);
4759
- return new de(t.firestore, t.converter, function(t, n) {
4770
+ const n = pr(t, this.type, this.bt, this.Et);
4771
+ return new fe(t.firestore, t.converter, function(t, n) {
4760
4772
  return new an(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, n, t.endAt);
4761
4773
  }(t._query, n));
4762
4774
  }
4763
4775
  }
4764
4776
 
4765
- function fr(...t) {
4766
- return new lr("startAt", t, /*before=*/ !0);
4777
+ function lr(...t) {
4778
+ return new hr("startAt", t,
4779
+ /*inclusive=*/ !0);
4767
4780
  }
4768
4781
 
4769
- function dr(...t) {
4770
- return new lr("startAfter", t,
4771
- /*before=*/ !1);
4782
+ function fr(...t) {
4783
+ return new hr("startAfter", t,
4784
+ /*inclusive=*/ !1);
4772
4785
  }
4773
4786
 
4774
- class wr extends er {
4787
+ class dr extends nr {
4775
4788
  constructor(t, n, e) {
4776
4789
  super(), this.type = t, this.bt = n, this.Et = e;
4777
4790
  }
4778
4791
  _apply(t) {
4779
- const n = yr(t, this.type, this.bt, this.Et);
4780
- return new de(t.firestore, t.converter, function(t, n) {
4792
+ const n = pr(t, this.type, this.bt, this.Et);
4793
+ return new fe(t.firestore, t.converter, function(t, n) {
4781
4794
  return new an(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, t.startAt, n);
4782
4795
  }(t._query, n));
4783
4796
  }
4784
4797
  }
4785
4798
 
4786
- function mr(...t) {
4787
- return new wr("endBefore", t, /*before=*/ !0);
4799
+ function wr(...t) {
4800
+ return new dr("endBefore", t,
4801
+ /*inclusive=*/ !1);
4788
4802
  }
4789
4803
 
4790
- function pr(...t) {
4791
- return new wr("endAt", t, /*before=*/ !1);
4804
+ function mr(...t) {
4805
+ return new dr("endAt", t, /*inclusive=*/ !0);
4792
4806
  }
4793
4807
 
4794
- /** Helper function to create a bound from a document or fields */ function yr(t, n, e, r) {
4795
- if (e[0] = l(e[0]), e[0] instanceof Je) return function(t, n, e, r, s) {
4808
+ /** Helper function to create a bound from a document or fields */ function pr(t, n, e, r) {
4809
+ if (e[0] = l(e[0]), e[0] instanceof Ke) return function(t, n, e, r, s) {
4796
4810
  if (!r) throw new U(V, `Can't use a DocumentSnapshot that doesn't exist for ${e}().`);
4797
4811
  const i = [];
4798
4812
  // Because people expect to continue/end a query at the exact document
@@ -4817,7 +4831,7 @@ function pr(...t) {
4817
4831
  * Converts a list of field values to a `Bound` for the given query.
4818
4832
  */ (t._query, t.firestore._databaseId, n, e[0]._document, r);
4819
4833
  {
4820
- const s = $e(t.firestore);
4834
+ const s = De(t.firestore);
4821
4835
  return function(t, n, e, r, s, i) {
4822
4836
  // Use explicit order by's because it has to match the query the user made
4823
4837
  const o = t.explicitOrderBy;
@@ -4833,7 +4847,7 @@ function pr(...t) {
4833
4847
  const s = new et(e);
4834
4848
  u.push(kt(n, s));
4835
4849
  } else {
4836
- const t = je(e, r, c);
4850
+ const t = Ue(e, r, c);
4837
4851
  u.push(t);
4838
4852
  }
4839
4853
  }
@@ -4847,7 +4861,7 @@ function pr(...t) {
4847
4861
  }
4848
4862
  }
4849
4863
 
4850
- function _r(t, n, e) {
4864
+ function yr(t, n, e) {
4851
4865
  if ("string" == typeof (e = l(e))) {
4852
4866
  if ("" === e) throw new U(R, "Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");
4853
4867
  if (!dn(n) && -1 !== e.indexOf("/")) throw new U(R, `Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '${e}' contains a '/' character.`);
@@ -4855,19 +4869,19 @@ function _r(t, n, e) {
4855
4869
  if (!et.isDocumentKey(r)) throw new U(R, `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}).`);
4856
4870
  return kt(t, new et(r));
4857
4871
  }
4858
- if (e instanceof fe) return kt(t, e._key);
4872
+ if (e instanceof le) return kt(t, e._key);
4859
4873
  throw new U(R, `Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${ot(e)}.`);
4860
4874
  }
4861
4875
 
4862
4876
  /**
4863
4877
  * Validates that the value passed into a disjunctive filter satisfies all
4864
4878
  * array requirements.
4865
- */ function gr(t, n) {
4879
+ */ function _r(t, n) {
4866
4880
  if (!Array.isArray(t) || 0 === t.length) throw new U(R, `Invalid Query. A non-empty array is required for '${n.toString()}' filters.`);
4867
4881
  if (t.length > 10) throw new U(R, `Invalid Query. '${n.toString()}' filters support a maximum of 10 elements in the value array.`);
4868
4882
  }
4869
4883
 
4870
- function vr(t, n, e) {
4884
+ function gr(t, n, e) {
4871
4885
  if (!e.isEqual(n)) throw new U(R, `Invalid query. You have a where filter with an inequality (<, <=, !=, not-in, >, or >=) on field '${n.toString()}' and so you must also use '${n.toString()}' as your first argument to orderBy(), but your first orderBy() is on field '${e.toString()}' instead.`);
4872
4886
  }
4873
4887
 
@@ -4918,7 +4932,7 @@ function vr(t, n, e) {
4918
4932
  * their `set()` or fails due to invalid data originating from a `toFirestore()`
4919
4933
  * call.
4920
4934
  */
4921
- function br(t, n, e) {
4935
+ function vr(t, n, e) {
4922
4936
  let r;
4923
4937
  // Cast to `any` in order to satisfy the union type constraint on
4924
4938
  // toFirestore().
@@ -4927,7 +4941,7 @@ function br(t, n, e) {
4927
4941
  r;
4928
4942
  }
4929
4943
 
4930
- class Er extends class {
4944
+ class br extends class {
4931
4945
  convertValue(t, n = "none") {
4932
4946
  switch (xt(t)) {
4933
4947
  case 0 /* NullValue */ :
@@ -4974,7 +4988,7 @@ class Er extends class {
4974
4988
  })), e;
4975
4989
  }
4976
4990
  convertGeoPoint(t) {
4977
- return new Ie(Nt(t.latitude), Nt(t.longitude));
4991
+ return new Te(Nt(t.latitude), Nt(t.longitude));
4978
4992
  }
4979
4993
  convertArray(t, n) {
4980
4994
  return (t.values || []).map((t => this.convertValue(t, n)));
@@ -4998,7 +5012,7 @@ class Er extends class {
4998
5012
  }
4999
5013
  convertDocumentKey(t, n) {
5000
5014
  const e = Z.fromString(t);
5001
- b(Jn(e));
5015
+ b(Kn(e));
5002
5016
  const r = new J(e.get(1), e.get(3)), s = new et(e.popFirst(5));
5003
5017
  return r.isEqual(n) ||
5004
5018
  // TODO(b/64130202): Somehow support foreign references.
@@ -5010,11 +5024,11 @@ class Er extends class {
5010
5024
  super(), this.firestore = t;
5011
5025
  }
5012
5026
  convertBytes(t) {
5013
- return new Ee(t);
5027
+ return new be(t);
5014
5028
  }
5015
5029
  convertReference(t) {
5016
5030
  const n = this.convertDocumentKey(t, this.firestore._databaseId);
5017
- return new fe(this.firestore, /* converter= */ null, n);
5031
+ return new le(this.firestore, /* converter= */ null, n);
5018
5032
  }
5019
5033
  }
5020
5034
 
@@ -5030,12 +5044,12 @@ class Er extends class {
5030
5044
  * @param reference - The reference of the document to fetch.
5031
5045
  * @returns A Promise resolved with a `DocumentSnapshot` containing the current
5032
5046
  * document contents.
5033
- */ function Tr(t) {
5034
- const n = ie((t = ut(t, fe)).firestore), e = new Er(t.firestore);
5035
- return ee(n, [ t._key ]).then((n => {
5047
+ */ function Er(t) {
5048
+ const n = se((t = ut(t, le)).firestore), e = new br(t.firestore);
5049
+ return ne(n, [ t._key ]).then((n => {
5036
5050
  b(1 === n.length);
5037
5051
  const r = n[0];
5038
- return new Je(t.firestore, e, t._key, r.isFoundDocument() ? r : null, t.converter);
5052
+ return new Ke(t.firestore, e, t._key, r.isFoundDocument() ? r : null, t.converter);
5039
5053
  }));
5040
5054
  }
5041
5055
 
@@ -5050,33 +5064,33 @@ class Er extends class {
5050
5064
  *
5051
5065
  * @param query - The `Query` to execute.
5052
5066
  * @returns A Promise that will be resolved with the results of the query.
5053
- */ function Ir(t) {
5067
+ */ function Tr(t) {
5054
5068
  !function(t) {
5055
5069
  if (hn(t) && 0 === t.explicitOrderBy.length) throw new U(O, "limitToLast() queries require specifying at least one orderBy() clause");
5056
- }((t = ut(t, de))._query);
5057
- const n = ie(t.firestore), e = new Er(t.firestore);
5058
- return re(n, t._query).then((n => {
5059
- const r = n.map((n => new Xe(t.firestore, e, n.key, n, t.converter)));
5070
+ }((t = ut(t, fe))._query);
5071
+ const n = se(t.firestore), e = new br(t.firestore);
5072
+ return ee(n, t._query).then((n => {
5073
+ const r = n.map((n => new Je(t.firestore, e, n.key, n, t.converter)));
5060
5074
  return hn(t._query) &&
5061
5075
  // Limit to last queries reverse the orderBy constraint that was
5062
5076
  // specified by the user. As such, we need to reverse the order of the
5063
5077
  // results to return the documents in the expected order.
5064
- r.reverse(), new Ze(t, r);
5078
+ r.reverse(), new Xe(t, r);
5065
5079
  }));
5066
5080
  }
5067
5081
 
5068
- function Ar(t, n, e) {
5069
- const r = br((t = ut(t, fe)).converter, n, e), s = Se($e(t.firestore), "setDoc", t._key, r, null !== t.converter, e);
5070
- return ne(ie(t.firestore), [ s.toMutation(t._key, In.none()) ]);
5082
+ function Ir(t, n, e) {
5083
+ const r = vr((t = ut(t, le)).converter, n, e), s = $e(De(t.firestore), "setDoc", t._key, r, null !== t.converter, e);
5084
+ return te(se(t.firestore), [ s.toMutation(t._key, In.none()) ]);
5071
5085
  }
5072
5086
 
5073
- function Rr(t, n, e, ...r) {
5074
- const s = $e((t = ut(t, fe)).firestore);
5087
+ function Ar(t, n, e, ...r) {
5088
+ const s = De((t = ut(t, le)).firestore);
5075
5089
  // For Compat types, we have to "extract" the underlying types before
5076
5090
  // performing validation.
5077
5091
  let i;
5078
- i = "string" == typeof (n = l(n)) || n instanceof ve ? Ue(s, "updateDoc", t._key, n, e, r) : ke(s, "updateDoc", t._key, n);
5079
- return ne(ie(t.firestore), [ i.toMutation(t._key, In.exists(!0)) ]);
5092
+ i = "string" == typeof (n = l(n)) || n instanceof ge ? ke(s, "updateDoc", t._key, n, e, r) : Le(s, "updateDoc", t._key, n);
5093
+ return te(se(t.firestore), [ i.toMutation(t._key, In.exists(!0)) ]);
5080
5094
  }
5081
5095
 
5082
5096
  /**
@@ -5090,8 +5104,8 @@ function Rr(t, n, e, ...r) {
5090
5104
  * @param reference - A reference to the document to delete.
5091
5105
  * @returns A `Promise` resolved once the document has been successfully
5092
5106
  * deleted from the backend.
5093
- */ function Pr(t) {
5094
- return ne(ie((t = ut(t, fe)).firestore), [ new Vn(t._key, In.none()) ]);
5107
+ */ function Rr(t) {
5108
+ return te(se((t = ut(t, le)).firestore), [ new Vn(t._key, In.none()) ]);
5095
5109
  }
5096
5110
 
5097
5111
  /**
@@ -5108,9 +5122,9 @@ function Rr(t, n, e, ...r) {
5108
5122
  * @throws Error - If the provided input is not a valid Firestore document.
5109
5123
  * @returns A `Promise` resolved with a `DocumentReference` pointing to the
5110
5124
  * newly created document after it has been written to the backend.
5111
- */ function Vr(t, n) {
5112
- const e = ye(t = ut(t, we)), r = br(t.converter, n), s = Se($e(t.firestore), "addDoc", e._key, r, null !== e.converter, {});
5113
- return ne(ie(t.firestore), [ s.toMutation(e._key, In.exists(!1)) ]).then((() => e));
5125
+ */ function Pr(t, n) {
5126
+ const e = pe(t = ut(t, de)), r = vr(t.converter, n), s = $e(De(t.firestore), "addDoc", e._key, r, null !== e.converter, {});
5127
+ return te(se(t.firestore), [ s.toMutation(e._key, In.exists(!1)) ]).then((() => e));
5114
5128
  }
5115
5129
 
5116
5130
  /**
@@ -5132,15 +5146,15 @@ function Rr(t, n, e, ...r) {
5132
5146
  /**
5133
5147
  * Returns a sentinel for use with {@link @firebase/firestore/lite#(updateDoc:1)} or
5134
5148
  * {@link @firebase/firestore/lite#(setDoc:1)} with `{merge: true}` to mark a field for deletion.
5135
- */ function Nr() {
5136
- return new Fe("deleteField");
5149
+ */ function Vr() {
5150
+ return new Se("deleteField");
5137
5151
  }
5138
5152
 
5139
5153
  /**
5140
5154
  * Returns a sentinel used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link @firebase/firestore/lite#(updateDoc:1)} to
5141
5155
  * include a server-generated timestamp in the written data.
5142
- */ function Dr() {
5143
- return new qe("serverTimestamp");
5156
+ */ function Nr() {
5157
+ return new xe("serverTimestamp");
5144
5158
  }
5145
5159
 
5146
5160
  /**
@@ -5154,10 +5168,10 @@ function Rr(t, n, e, ...r) {
5154
5168
  * @param elements - The elements to union into the array.
5155
5169
  * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or
5156
5170
  * `updateDoc()`.
5157
- */ function $r(...t) {
5171
+ */ function Dr(...t) {
5158
5172
  // NOTE: We don't actually parse the data until it's used in set() or
5159
5173
  // update() since we'd need the Firestore instance to do this.
5160
- return new Oe("arrayUnion", t);
5174
+ return new qe("arrayUnion", t);
5161
5175
  }
5162
5176
 
5163
5177
  /**
@@ -5170,10 +5184,10 @@ function Rr(t, n, e, ...r) {
5170
5184
  * @param elements - The elements to remove from the array.
5171
5185
  * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or
5172
5186
  * `updateDoc()`
5173
- */ function Sr(...t) {
5187
+ */ function $r(...t) {
5174
5188
  // NOTE: We don't actually parse the data until it's used in set() or
5175
5189
  // update() since we'd need the Firestore instance to do this.
5176
- return new Ce("arrayRemove", t);
5190
+ return new Oe("arrayRemove", t);
5177
5191
  }
5178
5192
 
5179
5193
  /**
@@ -5194,8 +5208,8 @@ function Rr(t, n, e, ...r) {
5194
5208
  * @param n - The value to increment by.
5195
5209
  * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or
5196
5210
  * `updateDoc()`
5197
- */ function Fr(t) {
5198
- return new Le("increment", t);
5211
+ */ function Sr(t) {
5212
+ return new Ce("increment", t);
5199
5213
  }
5200
5214
 
5201
5215
  /**
@@ -5221,24 +5235,24 @@ function Rr(t, n, e, ...r) {
5221
5235
  * provides methods for adding writes to the write batch. None of the writes
5222
5236
  * will be committed (or visible locally) until {@link WriteBatch.commit} is
5223
5237
  * called.
5224
- */ class xr {
5238
+ */ class Fr {
5225
5239
  /** @hideconstructor */
5226
5240
  constructor(t, n) {
5227
5241
  this._firestore = t, this._commitHandler = n, this._mutations = [], this._committed = !1,
5228
- this._dataReader = $e(t);
5242
+ this._dataReader = De(t);
5229
5243
  }
5230
5244
  set(t, n, e) {
5231
5245
  this._verifyNotCommitted();
5232
- const r = qr(t, this._firestore), s = br(r.converter, n, e), i = Se(this._dataReader, "WriteBatch.set", r._key, s, null !== r.converter, e);
5246
+ const r = xr(t, this._firestore), s = vr(r.converter, n, e), i = $e(this._dataReader, "WriteBatch.set", r._key, s, null !== r.converter, e);
5233
5247
  return this._mutations.push(i.toMutation(r._key, In.none())), this;
5234
5248
  }
5235
5249
  update(t, n, e, ...r) {
5236
5250
  this._verifyNotCommitted();
5237
- const s = qr(t, this._firestore);
5251
+ const s = xr(t, this._firestore);
5238
5252
  // For Compat types, we have to "extract" the underlying types before
5239
5253
  // performing validation.
5240
5254
  let i;
5241
- return i = "string" == typeof (n = l(n)) || n instanceof ve ? Ue(this._dataReader, "WriteBatch.update", s._key, n, e, r) : ke(this._dataReader, "WriteBatch.update", s._key, n),
5255
+ return i = "string" == typeof (n = l(n)) || n instanceof ge ? ke(this._dataReader, "WriteBatch.update", s._key, n, e, r) : Le(this._dataReader, "WriteBatch.update", s._key, n),
5242
5256
  this._mutations.push(i.toMutation(s._key, In.exists(!0))), this;
5243
5257
  }
5244
5258
  /**
@@ -5248,7 +5262,7 @@ function Rr(t, n, e, ...r) {
5248
5262
  * @returns This `WriteBatch` instance. Used for chaining method calls.
5249
5263
  */ delete(t) {
5250
5264
  this._verifyNotCommitted();
5251
- const n = qr(t, this._firestore);
5265
+ const n = xr(t, this._firestore);
5252
5266
  return this._mutations = this._mutations.concat(new Vn(n._key, In.none())), this;
5253
5267
  }
5254
5268
  /**
@@ -5270,7 +5284,7 @@ function Rr(t, n, e, ...r) {
5270
5284
  }
5271
5285
  }
5272
5286
 
5273
- function qr(t, n) {
5287
+ function xr(t, n) {
5274
5288
  if ((t = l(t)).firestore !== n) throw new U(R, "Provided document reference is from a different Firestore instance.");
5275
5289
  return t;
5276
5290
  }
@@ -5287,9 +5301,9 @@ function qr(t, n) {
5287
5301
  *
5288
5302
  * @returns A `WriteBatch` that can be used to atomically execute multiple
5289
5303
  * writes.
5290
- */ function Or(t) {
5291
- const n = ie(t = ut(t, ue));
5292
- return new xr(t, (t => ne(n, t)));
5304
+ */ function qr(t) {
5305
+ const n = se(t = ut(t, oe));
5306
+ return new Fr(t, (t => te(n, t)));
5293
5307
  }
5294
5308
 
5295
5309
  /**
@@ -5311,7 +5325,7 @@ function qr(t, n) {
5311
5325
  /**
5312
5326
  * Internal transaction object responsible for accumulating the mutations to
5313
5327
  * perform and the base versions for any documents read.
5314
- */ class Cr {
5328
+ */ class Or {
5315
5329
  constructor(t) {
5316
5330
  this.datastore = t,
5317
5331
  // The version of each document that was read during this transaction.
@@ -5331,7 +5345,7 @@ function qr(t, n) {
5331
5345
  }
5332
5346
  async lookup(t) {
5333
5347
  if (this.ensureCommitNotCalled(), this.mutations.length > 0) throw new U(R, "Firestore transactions require all reads to be executed before all writes.");
5334
- const n = await ee(this.datastore, t);
5348
+ const n = await ne(this.datastore, t);
5335
5349
  return n.forEach((t => this.recordVersion(t))), n;
5336
5350
  }
5337
5351
  set(t, n) {
@@ -5360,7 +5374,7 @@ function qr(t, n) {
5360
5374
  t.forEach(((t, n) => {
5361
5375
  const e = et.fromPath(n);
5362
5376
  this.mutations.push(new Nn(e, this.precondition(e)));
5363
- })), await ne(this.datastore, this.mutations), this.committed = !0;
5377
+ })), await te(this.datastore, this.mutations), this.committed = !0;
5364
5378
  }
5365
5379
  recordVersion(t) {
5366
5380
  let n;
@@ -5434,17 +5448,17 @@ function qr(t, n) {
5434
5448
  * TransactionRunner encapsulates the logic needed to run and retry transactions
5435
5449
  * with backoff.
5436
5450
  */
5437
- class Lr {
5451
+ class Cr {
5438
5452
  constructor(t, n, e, r) {
5439
5453
  this.asyncQueue = t, this.datastore = n, this.updateFunction = e, this.deferred = r,
5440
- this.Tt = 5, this.It = new Zn(this.asyncQueue, "transaction_retry" /* TransactionRetry */);
5454
+ this.Tt = 5, this.It = new Xn(this.asyncQueue, "transaction_retry" /* TransactionRetry */);
5441
5455
  }
5442
5456
  /** Runs the transaction and sets the result on deferred. */ run() {
5443
5457
  this.Tt -= 1, this.At();
5444
5458
  }
5445
5459
  At() {
5446
5460
  this.It.W((async () => {
5447
- const t = new Cr(this.datastore), n = this.Rt(t);
5461
+ const t = new Or(this.datastore), n = this.Rt(t);
5448
5462
  n && n.then((n => {
5449
5463
  this.asyncQueue.enqueueAndForget((() => t.commit().then((() => {
5450
5464
  this.deferred.resolve(n);
@@ -5534,7 +5548,7 @@ class Lr {
5534
5548
  * See the License for the specific language governing permissions and
5535
5549
  * limitations under the License.
5536
5550
  */
5537
- /** The Platform's 'document' implementation or null if not available. */ function kr() {
5551
+ /** The Platform's 'document' implementation or null if not available. */ function Lr() {
5538
5552
  // `document` is not always available, e.g. in ReactNative and WebWorkers.
5539
5553
  // eslint-disable-next-line no-restricted-globals
5540
5554
  return "undefined" != typeof document ? document : null;
@@ -5566,7 +5580,7 @@ class Lr {
5566
5580
  * Note: We implement `PromiseLike` instead of `Promise`, as the `Promise` type
5567
5581
  * in newer versions of TypeScript defines `finally`, which is not available in
5568
5582
  * IE.
5569
- */ class Ur {
5583
+ */ class kr {
5570
5584
  constructor(t, n, e, r, s) {
5571
5585
  this.asyncQueue = t, this.timerId = n, this.targetTimeMs = e, this.op = r, this.removalCallback = s,
5572
5586
  this.deferred = new j, this.then = this.deferred.promise.then.bind(this.deferred.promise),
@@ -5589,7 +5603,7 @@ class Lr {
5589
5603
  * PORTING NOTE: This exists to prevent making removeDelayedOperation() and
5590
5604
  * the DelayedOperation class public.
5591
5605
  */ static createAndSchedule(t, n, e, r, s) {
5592
- const i = Date.now() + e, o = new Ur(t, n, i, r, s);
5606
+ const i = Date.now() + e, o = new kr(t, n, i, r, s);
5593
5607
  return o.start(e), o;
5594
5608
  }
5595
5609
  /**
@@ -5638,7 +5652,7 @@ class Lr {
5638
5652
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5639
5653
  * See the License for the specific language governing permissions and
5640
5654
  * limitations under the License.
5641
- */ class jr {
5655
+ */ class Ur {
5642
5656
  constructor() {
5643
5657
  // The last promise in the queue.
5644
5658
  this.Nt = Promise.resolve(),
@@ -5661,15 +5675,15 @@ class Lr {
5661
5675
  // List of TimerIds to fast-forward delays for.
5662
5676
  this.Ot = [],
5663
5677
  // Backoff timer used to schedule retries for retryable operations
5664
- this.It = new Zn(this, "async_queue_retry" /* AsyncQueueRetry */),
5678
+ this.It = new Xn(this, "async_queue_retry" /* AsyncQueueRetry */),
5665
5679
  // Visibility handler that triggers an immediate retry of all retryable
5666
5680
  // operations. Meant to speed up recovery when we regain file system access
5667
5681
  // after page comes into foreground.
5668
5682
  this.Ct = () => {
5669
- const t = kr();
5683
+ const t = Lr();
5670
5684
  t && p("AsyncQueue", "Visibility state changed to " + t.visibilityState), this.It.H();
5671
5685
  };
5672
- const t = kr();
5686
+ const t = Lr();
5673
5687
  t && "function" == typeof t.addEventListener && t.addEventListener("visibilitychange", this.Ct);
5674
5688
  }
5675
5689
  get isShuttingDown() {
@@ -5690,7 +5704,7 @@ class Lr {
5690
5704
  enterRestrictedMode(t) {
5691
5705
  if (!this.$t) {
5692
5706
  this.$t = !0, this.qt = t || !1;
5693
- const n = kr();
5707
+ const n = Lr();
5694
5708
  n && "function" == typeof n.removeEventListener && n.removeEventListener("visibilitychange", this.Ct);
5695
5709
  }
5696
5710
  }
@@ -5822,7 +5836,7 @@ class Lr {
5822
5836
  this.Lt(),
5823
5837
  // Fast-forward delays for timerIds that have been overriden.
5824
5838
  this.Ot.indexOf(t) > -1 && (n = 0);
5825
- const r = Ur.createAndSchedule(this, t, n, e, (t => this.jt(t)));
5839
+ const r = kr.createAndSchedule(this, t, n, e, (t => this.jt(t)));
5826
5840
  return this.St.push(r), r;
5827
5841
  }
5828
5842
  Lt() {
@@ -5876,10 +5890,10 @@ class Lr {
5876
5890
  }
5877
5891
  }
5878
5892
 
5879
- class Mr {
5893
+ class jr {
5880
5894
  /** @hideconstructor */
5881
5895
  constructor(t, n) {
5882
- this._firestore = t, this._transaction = n, this._dataReader = $e(t);
5896
+ this._firestore = t, this._transaction = n, this._dataReader = De(t);
5883
5897
  }
5884
5898
  /**
5885
5899
  * Reads the document referenced by the provided {@link DocumentReference}.
@@ -5887,25 +5901,25 @@ class Mr {
5887
5901
  * @param documentRef - A reference to the document to be read.
5888
5902
  * @returns A `DocumentSnapshot` with the read data.
5889
5903
  */ get(t) {
5890
- const n = qr(t, this._firestore), e = new Er(this._firestore);
5904
+ const n = xr(t, this._firestore), e = new br(this._firestore);
5891
5905
  return this._transaction.lookup([ n._key ]).then((t => {
5892
5906
  if (!t || 1 !== t.length) return v();
5893
5907
  const r = t[0];
5894
- if (r.isFoundDocument()) return new Je(this._firestore, e, r.key, r, n.converter);
5895
- if (r.isNoDocument()) return new Je(this._firestore, e, n._key, null, n.converter);
5908
+ if (r.isFoundDocument()) return new Ke(this._firestore, e, r.key, r, n.converter);
5909
+ if (r.isNoDocument()) return new Ke(this._firestore, e, n._key, null, n.converter);
5896
5910
  throw v();
5897
5911
  }));
5898
5912
  }
5899
5913
  set(t, n, e) {
5900
- const r = qr(t, this._firestore), s = br(r.converter, n, e), i = Se(this._dataReader, "Transaction.set", r._key, s, null !== r.converter, e);
5914
+ const r = xr(t, this._firestore), s = vr(r.converter, n, e), i = $e(this._dataReader, "Transaction.set", r._key, s, null !== r.converter, e);
5901
5915
  return this._transaction.set(r._key, i), this;
5902
5916
  }
5903
5917
  update(t, n, e, ...r) {
5904
- const s = qr(t, this._firestore);
5918
+ const s = xr(t, this._firestore);
5905
5919
  // For Compat types, we have to "extract" the underlying types before
5906
5920
  // performing validation.
5907
5921
  let i;
5908
- return i = "string" == typeof (n = l(n)) || n instanceof ve ? Ue(this._dataReader, "Transaction.update", s._key, n, e, r) : ke(this._dataReader, "Transaction.update", s._key, n),
5922
+ return i = "string" == typeof (n = l(n)) || n instanceof ge ? ke(this._dataReader, "Transaction.update", s._key, n, e, r) : Le(this._dataReader, "Transaction.update", s._key, n),
5909
5923
  this._transaction.update(s._key, i), this;
5910
5924
  }
5911
5925
  /**
@@ -5914,7 +5928,7 @@ class Mr {
5914
5928
  * @param documentRef - A reference to the document to be deleted.
5915
5929
  * @returns This `Transaction` instance. Used for chaining method calls.
5916
5930
  */ delete(t) {
5917
- const n = qr(t, this._firestore);
5931
+ const n = xr(t, this._firestore);
5918
5932
  return this._transaction.delete(n._key), this;
5919
5933
  }
5920
5934
  }
@@ -5935,9 +5949,9 @@ class Mr {
5935
5949
  * (the `updateFunction` returned a failed promise), the promise returned by the
5936
5950
  * `updateFunction `is returned here. Otherwise, if the transaction failed, a
5937
5951
  * rejected promise with the corresponding failure error is returned.
5938
- */ function Br(t, n) {
5939
- const e = ie(t = ut(t, ue)), r = new j;
5940
- return new Lr(new jr, e, (e => n(new Mr(t, e))), r).run(), r.promise;
5952
+ */ function Mr(t, n) {
5953
+ const e = se(t = ut(t, oe)), r = new j;
5954
+ return new Cr(new Ur, e, (e => n(new jr(t, e))), r).run(), r.promise;
5941
5955
  }
5942
5956
 
5943
5957
  /**
@@ -5950,11 +5964,11 @@ class Mr {
5950
5964
  */ !function(t) {
5951
5965
  d = t;
5952
5966
  }(`${s}_lite`), e(new i("firestore/lite", ((t, {options: n}) => {
5953
- const e = t.getProvider("app").getImmediate(), r = new ue(e, new Q(t.getProvider("auth-internal")), new H(t.getProvider("app-check-internal")));
5967
+ const e = t.getProvider("app").getImmediate(), r = new oe(e, new Q(t.getProvider("auth-internal")), new H(t.getProvider("app-check-internal")));
5954
5968
  return n && r._setSettings(n), r;
5955
5969
  }), "PUBLIC")),
5956
5970
  // RUNTIME_ENV and BUILD_TARGET are replaced by real values during the compilation
5957
- r("firestore-lite", "3.4.3", "rn"), r("firestore-lite", "3.4.3", "esm2017");
5971
+ r("firestore-lite", "3.4.4-canary.0482aa5b7", "rn"), r("firestore-lite", "3.4.4-canary.0482aa5b7", "esm2017");
5958
5972
 
5959
- export { Ee as Bytes, we as CollectionReference, fe as DocumentReference, Je as DocumentSnapshot, ve as FieldPath, Te as FieldValue, ue as Firestore, U as FirestoreError, Ie as GeoPoint, de as Query, er as QueryConstraint, Xe as QueryDocumentSnapshot, Ze as QuerySnapshot, vt as Timestamp, Mr as Transaction, xr as WriteBatch, Vr as addDoc, Sr as arrayRemove, $r as arrayUnion, me as collection, pe as collectionGroup, he as connectFirestoreEmulator, Pr as deleteDoc, Nr as deleteField, ye as doc, be as documentId, pr as endAt, mr as endBefore, Tr as getDoc, Ir as getDocs, ae as getFirestore, Fr as increment, ce as initializeFirestore, ar as limit, hr as limitToLast, ur as orderBy, rr as query, ge as queryEqual, _e as refEqual, Br as runTransaction, Dr as serverTimestamp, Ar as setDoc, m as setLogLevel, tr as snapshotEqual, dr as startAfter, fr as startAt, le as terminate, Rr as updateDoc, ir as where, Or as writeBatch };
5973
+ export { be as Bytes, de as CollectionReference, le as DocumentReference, Ke as DocumentSnapshot, ge as FieldPath, Ee as FieldValue, oe as Firestore, U as FirestoreError, Te as GeoPoint, fe as Query, nr as QueryConstraint, Je as QueryDocumentSnapshot, Xe as QuerySnapshot, vt as Timestamp, jr as Transaction, Fr as WriteBatch, Pr as addDoc, $r as arrayRemove, Dr as arrayUnion, we as collection, me as collectionGroup, ae as connectFirestoreEmulator, Rr as deleteDoc, Vr as deleteField, pe as doc, ve as documentId, mr as endAt, wr as endBefore, Er as getDoc, Tr as getDocs, ce as getFirestore, Sr as increment, ue as initializeFirestore, cr as limit, ar as limitToLast, or as orderBy, er as query, _e as queryEqual, ye as refEqual, Mr as runTransaction, Nr as serverTimestamp, Ir as setDoc, m as setLogLevel, Ze as snapshotEqual, fr as startAfter, lr as startAt, he as terminate, Ar as updateDoc, sr as where, qr as writeBatch };
5960
5974
  //# sourceMappingURL=index.rn.esm2017.js.map