@firebase/firestore 3.4.4 → 3.4.5-canary.8ac8fb099

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 (221) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/firestore/src/api/credentials.d.ts +1 -0
  3. package/dist/firestore/src/api/{query.d.ts → filter.d.ts} +0 -0
  4. package/dist/firestore/src/api/snapshot.d.ts +1 -2
  5. package/dist/firestore/src/api.d.ts +1 -1
  6. package/dist/firestore/src/core/database_info.d.ts +1 -0
  7. package/dist/firestore/src/core/target.d.ts +34 -5
  8. package/dist/firestore/src/index/index_byte_encoder.d.ts +18 -1
  9. package/dist/firestore/src/index/index_entry.d.ts +32 -0
  10. package/dist/firestore/src/lite-api/query.d.ts +2 -2
  11. package/dist/firestore/src/local/document_overlay_cache.d.ts +72 -0
  12. package/dist/firestore/src/local/index_manager.d.ts +52 -0
  13. package/dist/firestore/src/local/indexeddb_document_overlay_cache.d.ts +45 -0
  14. package/dist/firestore/src/local/indexeddb_index_manager.d.ts +87 -2
  15. package/dist/firestore/src/local/indexeddb_persistence.d.ts +6 -4
  16. package/dist/firestore/src/local/indexeddb_remote_document_cache.d.ts +2 -8
  17. package/dist/firestore/src/local/indexeddb_schema.d.ts +195 -7
  18. package/dist/firestore/src/local/local_documents_view.d.ts +0 -1
  19. package/dist/firestore/src/local/local_serializer.d.ts +19 -3
  20. package/dist/firestore/src/local/memory_document_overlay_cache.d.ts +37 -0
  21. package/dist/firestore/src/local/memory_index_manager.d.ts +11 -0
  22. package/dist/firestore/src/local/memory_persistence.d.ts +6 -2
  23. package/dist/firestore/src/local/memory_remote_document_cache.d.ts +1 -3
  24. package/dist/firestore/src/local/persistence.d.ts +8 -2
  25. package/dist/firestore/src/local/remote_document_cache.d.ts +7 -9
  26. package/dist/firestore/src/local/remote_document_change_buffer.d.ts +3 -12
  27. package/dist/firestore/src/local/simple_db.d.ts +12 -0
  28. package/dist/firestore/src/model/document.d.ts +7 -0
  29. package/dist/firestore/src/model/document_key.d.ts +6 -0
  30. package/dist/firestore/src/model/field_index.d.ts +89 -7
  31. package/dist/firestore/src/model/overlay.d.ts +32 -0
  32. package/dist/firestore/src/model/target_index_matcher.d.ts +70 -0
  33. package/dist/firestore/src/model/type_order.d.ts +2 -1
  34. package/dist/firestore/src/model/values.d.ts +7 -0
  35. package/dist/firestore/src/platform/node/base64.d.ts +1 -0
  36. package/dist/firestore/src/platform/node/grpc_connection.d.ts +2 -2
  37. package/dist/firestore/src/platform/node/load_protos.d.ts +2 -2
  38. package/dist/firestore/src/util/sorted_set.d.ts +18 -0
  39. package/dist/firestore/test/unit/local/counting_query_engine.d.ts +3 -3
  40. package/dist/firestore/test/unit/local/document_overlay_cache.test.d.ts +1 -0
  41. package/dist/firestore/test/unit/local/persistence_test_helpers.d.ts +1 -0
  42. package/dist/firestore/test/unit/local/test_document_overlay_cache.d.ts +38 -0
  43. package/dist/firestore/test/unit/local/test_index_manager.d.ts +11 -0
  44. package/dist/firestore/test/unit/local/test_remote_document_cache.d.ts +5 -3
  45. package/dist/firestore/test/unit/local/test_remote_document_change_buffer.d.ts +1 -1
  46. package/dist/firestore/test/unit/model/field_index.test.d.ts +17 -0
  47. package/dist/firestore/test/unit/model/target.test.d.ts +17 -0
  48. package/dist/firestore/test/unit/model/target_index_matcher.test.d.ts +17 -0
  49. package/dist/firestore/test/util/helpers.d.ts +8 -2
  50. package/dist/index.d.ts +1 -2
  51. package/dist/index.esm2017.js +5415 -3839
  52. package/dist/index.esm2017.js.map +1 -1
  53. package/dist/index.esm5.js +5039 -3613
  54. package/dist/index.esm5.js.map +1 -1
  55. package/dist/index.node.cjs.js +2908 -592
  56. package/dist/index.node.cjs.js.map +1 -1
  57. package/dist/index.node.mjs +2888 -593
  58. package/dist/index.node.mjs.map +1 -1
  59. package/dist/index.rn.js +5396 -3862
  60. package/dist/index.rn.js.map +1 -1
  61. package/dist/internal.d.ts +265 -26
  62. package/dist/lite/firestore/src/api/credentials.d.ts +1 -0
  63. package/dist/lite/firestore/src/api/{query.d.ts → filter.d.ts} +0 -0
  64. package/dist/lite/firestore/src/api/snapshot.d.ts +1 -2
  65. package/dist/lite/firestore/src/api.d.ts +1 -1
  66. package/dist/lite/firestore/src/core/database_info.d.ts +1 -0
  67. package/dist/lite/firestore/src/core/target.d.ts +34 -5
  68. package/dist/lite/firestore/src/index/index_byte_encoder.d.ts +18 -1
  69. package/dist/lite/firestore/src/index/index_entry.d.ts +32 -0
  70. package/dist/lite/firestore/src/lite-api/query.d.ts +2 -2
  71. package/dist/lite/firestore/src/local/document_overlay_cache.d.ts +72 -0
  72. package/dist/lite/firestore/src/local/index_manager.d.ts +52 -0
  73. package/dist/lite/firestore/src/local/indexeddb_document_overlay_cache.d.ts +45 -0
  74. package/dist/lite/firestore/src/local/indexeddb_index_manager.d.ts +87 -2
  75. package/dist/lite/firestore/src/local/indexeddb_persistence.d.ts +6 -4
  76. package/dist/lite/firestore/src/local/indexeddb_remote_document_cache.d.ts +2 -8
  77. package/dist/lite/firestore/src/local/indexeddb_schema.d.ts +195 -7
  78. package/dist/lite/firestore/src/local/local_documents_view.d.ts +0 -1
  79. package/dist/lite/firestore/src/local/local_serializer.d.ts +19 -3
  80. package/dist/lite/firestore/src/local/memory_document_overlay_cache.d.ts +37 -0
  81. package/dist/lite/firestore/src/local/memory_index_manager.d.ts +11 -0
  82. package/dist/lite/firestore/src/local/memory_persistence.d.ts +6 -2
  83. package/dist/lite/firestore/src/local/memory_remote_document_cache.d.ts +1 -3
  84. package/dist/lite/firestore/src/local/persistence.d.ts +8 -2
  85. package/dist/lite/firestore/src/local/remote_document_cache.d.ts +7 -9
  86. package/dist/lite/firestore/src/local/remote_document_change_buffer.d.ts +3 -12
  87. package/dist/lite/firestore/src/local/simple_db.d.ts +12 -0
  88. package/dist/lite/firestore/src/model/document.d.ts +7 -0
  89. package/dist/lite/firestore/src/model/document_key.d.ts +6 -0
  90. package/dist/lite/firestore/src/model/field_index.d.ts +89 -7
  91. package/dist/lite/firestore/src/model/overlay.d.ts +32 -0
  92. package/dist/lite/firestore/src/model/target_index_matcher.d.ts +70 -0
  93. package/dist/lite/firestore/src/model/type_order.d.ts +2 -1
  94. package/dist/lite/firestore/src/model/values.d.ts +7 -0
  95. package/dist/lite/firestore/src/platform/node/base64.d.ts +1 -0
  96. package/dist/lite/firestore/src/platform/node/grpc_connection.d.ts +2 -2
  97. package/dist/lite/firestore/src/platform/node/load_protos.d.ts +2 -2
  98. package/dist/lite/firestore/src/util/sorted_set.d.ts +18 -0
  99. package/dist/lite/firestore/test/unit/local/counting_query_engine.d.ts +3 -3
  100. package/dist/lite/firestore/test/unit/local/document_overlay_cache.test.d.ts +1 -0
  101. package/dist/lite/firestore/test/unit/local/persistence_test_helpers.d.ts +1 -0
  102. package/dist/lite/firestore/test/unit/local/test_document_overlay_cache.d.ts +38 -0
  103. package/dist/lite/firestore/test/unit/local/test_index_manager.d.ts +11 -0
  104. package/dist/lite/firestore/test/unit/local/test_remote_document_cache.d.ts +5 -3
  105. package/dist/lite/firestore/test/unit/local/test_remote_document_change_buffer.d.ts +1 -1
  106. package/dist/lite/firestore/test/unit/model/field_index.test.d.ts +17 -0
  107. package/dist/lite/firestore/test/unit/model/target.test.d.ts +17 -0
  108. package/dist/lite/firestore/test/unit/model/target_index_matcher.test.d.ts +17 -0
  109. package/dist/lite/firestore/test/util/helpers.d.ts +8 -2
  110. package/dist/lite/index.browser.esm2017.js +1207 -1174
  111. package/dist/lite/index.browser.esm2017.js.map +1 -1
  112. package/dist/lite/index.browser.esm5.js +370 -361
  113. package/dist/lite/index.browser.esm5.js.map +1 -1
  114. package/dist/lite/index.node.cjs.js +83 -41
  115. package/dist/lite/index.node.cjs.js.map +1 -1
  116. package/dist/lite/index.node.mjs +83 -41
  117. package/dist/lite/index.node.mjs.map +1 -1
  118. package/dist/lite/index.rn.esm2017.js +375 -342
  119. package/dist/lite/index.rn.esm2017.js.map +1 -1
  120. package/dist/lite/internal.d.ts +16 -2
  121. package/dist/lite/packages/firestore/dist/lite/index.browser.esm2017.d.ts +125 -124
  122. package/dist/lite/packages/firestore/src/api/credentials.d.ts +1 -0
  123. package/dist/lite/packages/firestore/src/api/{query.d.ts → filter.d.ts} +0 -0
  124. package/dist/lite/packages/firestore/src/api/snapshot.d.ts +1 -2
  125. package/dist/lite/packages/firestore/src/api.d.ts +1 -1
  126. package/dist/lite/packages/firestore/src/core/database_info.d.ts +1 -0
  127. package/dist/lite/packages/firestore/src/core/target.d.ts +34 -5
  128. package/dist/lite/packages/firestore/src/index/index_byte_encoder.d.ts +18 -1
  129. package/dist/lite/packages/firestore/src/index/index_entry.d.ts +32 -0
  130. package/dist/lite/packages/firestore/src/lite-api/query.d.ts +2 -2
  131. package/dist/lite/packages/firestore/src/local/document_overlay_cache.d.ts +72 -0
  132. package/dist/lite/packages/firestore/src/local/index_manager.d.ts +52 -0
  133. package/dist/lite/packages/firestore/src/local/indexeddb_document_overlay_cache.d.ts +45 -0
  134. package/dist/lite/packages/firestore/src/local/indexeddb_index_manager.d.ts +87 -2
  135. package/dist/lite/packages/firestore/src/local/indexeddb_persistence.d.ts +6 -4
  136. package/dist/lite/packages/firestore/src/local/indexeddb_remote_document_cache.d.ts +2 -8
  137. package/dist/lite/packages/firestore/src/local/indexeddb_schema.d.ts +195 -7
  138. package/dist/lite/packages/firestore/src/local/local_documents_view.d.ts +0 -1
  139. package/dist/lite/packages/firestore/src/local/local_serializer.d.ts +19 -3
  140. package/dist/lite/packages/firestore/src/local/memory_document_overlay_cache.d.ts +37 -0
  141. package/dist/lite/packages/firestore/src/local/memory_index_manager.d.ts +11 -0
  142. package/dist/lite/packages/firestore/src/local/memory_persistence.d.ts +6 -2
  143. package/dist/lite/packages/firestore/src/local/memory_remote_document_cache.d.ts +1 -3
  144. package/dist/lite/packages/firestore/src/local/persistence.d.ts +8 -2
  145. package/dist/lite/packages/firestore/src/local/remote_document_cache.d.ts +7 -9
  146. package/dist/lite/packages/firestore/src/local/remote_document_change_buffer.d.ts +3 -12
  147. package/dist/lite/packages/firestore/src/local/simple_db.d.ts +12 -0
  148. package/dist/lite/packages/firestore/src/model/document.d.ts +7 -0
  149. package/dist/lite/packages/firestore/src/model/document_key.d.ts +6 -0
  150. package/dist/lite/packages/firestore/src/model/field_index.d.ts +89 -7
  151. package/dist/lite/packages/firestore/src/model/overlay.d.ts +32 -0
  152. package/dist/lite/packages/firestore/src/model/target_index_matcher.d.ts +70 -0
  153. package/dist/lite/packages/firestore/src/model/type_order.d.ts +2 -1
  154. package/dist/lite/packages/firestore/src/model/values.d.ts +7 -0
  155. package/dist/lite/packages/firestore/src/platform/node/base64.d.ts +1 -0
  156. package/dist/lite/packages/firestore/src/platform/node/grpc_connection.d.ts +2 -2
  157. package/dist/lite/packages/firestore/src/platform/node/load_protos.d.ts +2 -2
  158. package/dist/lite/packages/firestore/src/util/sorted_set.d.ts +18 -0
  159. package/dist/lite/packages/firestore/test/unit/local/counting_query_engine.d.ts +3 -3
  160. package/dist/lite/packages/firestore/test/unit/local/document_overlay_cache.test.d.ts +1 -0
  161. package/dist/lite/packages/firestore/test/unit/local/persistence_test_helpers.d.ts +1 -0
  162. package/dist/lite/packages/firestore/test/unit/local/test_document_overlay_cache.d.ts +38 -0
  163. package/dist/lite/packages/firestore/test/unit/local/test_index_manager.d.ts +11 -0
  164. package/dist/lite/packages/firestore/test/unit/local/test_remote_document_cache.d.ts +5 -3
  165. package/dist/lite/packages/firestore/test/unit/local/test_remote_document_change_buffer.d.ts +1 -1
  166. package/dist/lite/packages/firestore/test/unit/model/field_index.test.d.ts +17 -0
  167. package/dist/lite/packages/firestore/test/unit/model/target.test.d.ts +17 -0
  168. package/dist/lite/packages/firestore/test/unit/model/target_index_matcher.test.d.ts +17 -0
  169. package/dist/lite/packages/firestore/test/util/helpers.d.ts +8 -2
  170. package/dist/lite/private.d.ts +9 -2
  171. package/dist/packages/firestore/dist/index.esm2017.d.ts +199 -194
  172. package/dist/packages/firestore/src/api/credentials.d.ts +1 -0
  173. package/dist/packages/firestore/src/api/{query.d.ts → filter.d.ts} +0 -0
  174. package/dist/packages/firestore/src/api/snapshot.d.ts +1 -2
  175. package/dist/packages/firestore/src/api.d.ts +1 -1
  176. package/dist/packages/firestore/src/core/database_info.d.ts +1 -0
  177. package/dist/packages/firestore/src/core/target.d.ts +34 -5
  178. package/dist/packages/firestore/src/index/index_byte_encoder.d.ts +18 -1
  179. package/dist/packages/firestore/src/index/index_entry.d.ts +32 -0
  180. package/dist/packages/firestore/src/lite-api/query.d.ts +2 -2
  181. package/dist/packages/firestore/src/local/document_overlay_cache.d.ts +72 -0
  182. package/dist/packages/firestore/src/local/index_manager.d.ts +52 -0
  183. package/dist/packages/firestore/src/local/indexeddb_document_overlay_cache.d.ts +45 -0
  184. package/dist/packages/firestore/src/local/indexeddb_index_manager.d.ts +87 -2
  185. package/dist/packages/firestore/src/local/indexeddb_persistence.d.ts +6 -4
  186. package/dist/packages/firestore/src/local/indexeddb_remote_document_cache.d.ts +2 -8
  187. package/dist/packages/firestore/src/local/indexeddb_schema.d.ts +195 -7
  188. package/dist/packages/firestore/src/local/local_documents_view.d.ts +0 -1
  189. package/dist/packages/firestore/src/local/local_serializer.d.ts +19 -3
  190. package/dist/packages/firestore/src/local/memory_document_overlay_cache.d.ts +37 -0
  191. package/dist/packages/firestore/src/local/memory_index_manager.d.ts +11 -0
  192. package/dist/packages/firestore/src/local/memory_persistence.d.ts +6 -2
  193. package/dist/packages/firestore/src/local/memory_remote_document_cache.d.ts +1 -3
  194. package/dist/packages/firestore/src/local/persistence.d.ts +8 -2
  195. package/dist/packages/firestore/src/local/remote_document_cache.d.ts +7 -9
  196. package/dist/packages/firestore/src/local/remote_document_change_buffer.d.ts +3 -12
  197. package/dist/packages/firestore/src/local/simple_db.d.ts +12 -0
  198. package/dist/packages/firestore/src/model/document.d.ts +7 -0
  199. package/dist/packages/firestore/src/model/document_key.d.ts +6 -0
  200. package/dist/packages/firestore/src/model/field_index.d.ts +89 -7
  201. package/dist/packages/firestore/src/model/overlay.d.ts +32 -0
  202. package/dist/packages/firestore/src/model/target_index_matcher.d.ts +70 -0
  203. package/dist/packages/firestore/src/model/type_order.d.ts +2 -1
  204. package/dist/packages/firestore/src/model/values.d.ts +7 -0
  205. package/dist/packages/firestore/src/platform/node/base64.d.ts +1 -0
  206. package/dist/packages/firestore/src/platform/node/grpc_connection.d.ts +2 -2
  207. package/dist/packages/firestore/src/platform/node/load_protos.d.ts +2 -2
  208. package/dist/packages/firestore/src/util/sorted_set.d.ts +18 -0
  209. package/dist/packages/firestore/test/unit/local/counting_query_engine.d.ts +3 -3
  210. package/dist/packages/firestore/test/unit/local/document_overlay_cache.test.d.ts +1 -0
  211. package/dist/packages/firestore/test/unit/local/persistence_test_helpers.d.ts +1 -0
  212. package/dist/packages/firestore/test/unit/local/test_document_overlay_cache.d.ts +38 -0
  213. package/dist/packages/firestore/test/unit/local/test_index_manager.d.ts +11 -0
  214. package/dist/packages/firestore/test/unit/local/test_remote_document_cache.d.ts +5 -3
  215. package/dist/packages/firestore/test/unit/local/test_remote_document_change_buffer.d.ts +1 -1
  216. package/dist/packages/firestore/test/unit/model/field_index.test.d.ts +17 -0
  217. package/dist/packages/firestore/test/unit/model/target.test.d.ts +17 -0
  218. package/dist/packages/firestore/test/unit/model/target_index_matcher.test.d.ts +17 -0
  219. package/dist/packages/firestore/test/util/helpers.d.ts +8 -2
  220. package/dist/private.d.ts +258 -26
  221. package/package.json +9 -9
@@ -67,7 +67,7 @@ m.MOCK_USER = new m("mock-user");
67
67
  * See the License for the specific language governing permissions and
68
68
  * limitations under the License.
69
69
  */
70
- var y = "9.6.5", v = new l("@firebase/firestore");
70
+ var y = "9.6.7-canary.8ac8fb099", v = new l("@firebase/firestore");
71
71
 
72
72
  /**
73
73
  * @license
@@ -225,7 +225,7 @@ e) {
225
225
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
226
226
  * See the License for the specific language governing permissions and
227
227
  * limitations under the License.
228
- */ var A = "cancelled", k = "unknown", V = "invalid-argument", D = "deadline-exceeded", N = "not-found", P = "permission-denied", q = "unauthenticated", F = "resource-exhausted", O = "failed-precondition", C = "aborted", j = "out-of-range", L = "unimplemented", R = "internal", M = "unavailable", U = /** @class */ function(e) {
228
+ */ var A = "cancelled", k = "unknown", V = "invalid-argument", D = "deadline-exceeded", P = "not-found", N = "permission-denied", q = "unauthenticated", F = "resource-exhausted", O = "failed-precondition", C = "aborted", L = "out-of-range", j = "unimplemented", R = "internal", M = "unavailable", U = /** @class */ function(e) {
229
229
  /** @hideconstructor */
230
230
  function n(
231
231
  /**
@@ -356,7 +356,9 @@ function(t, e, n, r, i, o, a, s) {
356
356
  function t(t, e) {
357
357
  this.projectId = t, this.database = e || "(default)";
358
358
  }
359
- return Object.defineProperty(t.prototype, "isDefaultDatabase", {
359
+ return t.empty = function() {
360
+ return new t("", "");
361
+ }, Object.defineProperty(t.prototype, "isDefaultDatabase", {
360
362
  get: function() {
361
363
  return "(default)" === this.database;
362
364
  },
@@ -523,9 +525,23 @@ function(t, e, n, r, i, o, a, s) {
523
525
  return new t(Z.fromString(e));
524
526
  }, t.fromName = function(e) {
525
527
  return new t(Z.fromString(e).popFirst(5));
526
- },
528
+ }, t.empty = function() {
529
+ return new t(Z.emptyPath());
530
+ }, Object.defineProperty(t.prototype, "collectionGroup", {
531
+ get: function() {
532
+ return this.path.popLast().lastSegment();
533
+ },
534
+ enumerable: !1,
535
+ configurable: !0
536
+ }),
527
537
  /** Returns true if the document is in the specified collectionId. */ t.prototype.hasCollectionId = function(t) {
528
538
  return this.path.length >= 2 && this.path.get(this.path.length - 2) === t;
539
+ },
540
+ /** Returns the collection group (i.e. the name of the parent collection) for this key. */ t.prototype.getCollectionGroup = function() {
541
+ return this.path.get(this.path.length - 2);
542
+ },
543
+ /** Returns the fully qualified path to the parent collection. */ t.prototype.getCollectionPath = function() {
544
+ return this.path.popLast();
529
545
  }, t.prototype.isEqual = function(t) {
530
546
  return null !== t && 0 === Z.comparator(this.path, t.path);
531
547
  }, t.prototype.toString = function() {
@@ -741,11 +757,11 @@ function dt(t) {
741
757
 
742
758
  case 403:
743
759
  // Forbidden
744
- return P;
760
+ return N;
745
761
 
746
762
  case 404:
747
763
  // Not Found
748
- return N;
764
+ return P;
749
765
 
750
766
  case 409:
751
767
  // Conflict
@@ -755,7 +771,7 @@ function dt(t) {
755
771
  // return Code.ALREADY_EXISTS;
756
772
  case 416:
757
773
  // Range Not Satisfiable
758
- return j;
774
+ return L;
759
775
 
760
776
  case 429:
761
777
  // Too Many Requests
@@ -774,7 +790,7 @@ function dt(t) {
774
790
  // return Code.DATA_LOSS;
775
791
  case 501:
776
792
  // Unimplemented
777
- return L;
793
+ return j;
778
794
 
779
795
  case 503:
780
796
  // Service Unavailable
@@ -1259,6 +1275,8 @@ function St(t, e) {
1259
1275
  return t.fromBase64String = function(e) {
1260
1276
  return new t(atob(e));
1261
1277
  }, t.fromUint8Array = function(e) {
1278
+ // TODO(indexing); Remove the copy of the byte string here as this method
1279
+ // is frequently called during indexing.
1262
1280
  var n =
1263
1281
  /**
1264
1282
  * Helper function to convert an Uint8array to a binary string.
@@ -1418,7 +1436,7 @@ var At = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
1418
1436
  * FieldValueOptions to value().
1419
1437
  * - With respect to other ServerTimestampValues, they sort by their
1420
1438
  * localWriteTime.
1421
- */ function Nt(t) {
1439
+ */ function Pt(t) {
1422
1440
  var e, n;
1423
1441
  return "server_timestamp" === (null === (n = ((null === (e = null == t ? void 0 : t.mapValue) || void 0 === e ? void 0 : e.fields) || {}).__type__) || void 0 === n ? void 0 : n.stringValue);
1424
1442
  }
@@ -1428,9 +1446,9 @@ var At = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
1428
1446
  *
1429
1447
  * Preserving the previous values allows the user to display the last resoled
1430
1448
  * value until the backend responds with the timestamp.
1431
- */ function Pt(t) {
1449
+ */ function Nt(t) {
1432
1450
  var e = t.mapValue.fields.__previous_value__;
1433
- return Nt(e) ? Pt(e) : e;
1451
+ return Pt(e) ? Nt(e) : e;
1434
1452
  }
1435
1453
 
1436
1454
  /**
@@ -1457,7 +1475,11 @@ var At = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
1457
1475
  * limitations under the License.
1458
1476
  */
1459
1477
  /** Extracts the backend's type order for the provided value. */ function Ft(t) {
1460
- return "nullValue" in t ? 0 /* NullValue */ : "booleanValue" in t ? 1 /* BooleanValue */ : "integerValue" in t || "doubleValue" in t ? 2 /* NumberValue */ : "timestampValue" in t ? 3 /* TimestampValue */ : "stringValue" in t ? 5 /* StringValue */ : "bytesValue" in t ? 6 /* BlobValue */ : "referenceValue" in t ? 7 /* RefValue */ : "geoPointValue" in t ? 8 /* GeoPointValue */ : "arrayValue" in t ? 9 /* ArrayValue */ : "mapValue" in t ? Nt(t) ? 4 /* ServerTimestampValue */ : 10 /* ObjectValue */ : S();
1478
+ return "nullValue" in t ? 0 /* NullValue */ : "booleanValue" in t ? 1 /* BooleanValue */ : "integerValue" in t || "doubleValue" in t ? 2 /* NumberValue */ : "timestampValue" in t ? 3 /* TimestampValue */ : "stringValue" in t ? 5 /* StringValue */ : "bytesValue" in t ? 6 /* BlobValue */ : "referenceValue" in t ? 7 /* RefValue */ : "geoPointValue" in t ? 8 /* GeoPointValue */ : "arrayValue" in t ? 9 /* ArrayValue */ : "mapValue" in t ? Pt(t) ? 4 /* ServerTimestampValue */ :
1479
+ /** Returns true if the Value represents the canonical {@link #MAX_VALUE} . */
1480
+ function(t) {
1481
+ return "__max__" === (((t.mapValue || {}).fields || {}).__type__ || {}).stringValue;
1482
+ }(t) ? 9 /* ArrayValue */ : 10 /* ObjectValue */ : S();
1461
1483
  }
1462
1484
 
1463
1485
  /** Tests `left` and `right` for equality based on the backend semantics. */ function Ot(t, e) {
@@ -1466,6 +1488,7 @@ var At = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
1466
1488
  if (n !== Ft(e)) return !1;
1467
1489
  switch (n) {
1468
1490
  case 0 /* NullValue */ :
1491
+ case 9007199254740991 /* MaxValue */ :
1469
1492
  return !0;
1470
1493
 
1471
1494
  case 1 /* BooleanValue */ :
@@ -1531,12 +1554,13 @@ function Ct(t, e) {
1531
1554
  }));
1532
1555
  }
1533
1556
 
1534
- function jt(t, e) {
1557
+ function Lt(t, e) {
1535
1558
  if (t === e) return 0;
1536
1559
  var n = Ft(t), r = Ft(e);
1537
1560
  if (n !== r) return gt(n, r);
1538
1561
  switch (n) {
1539
1562
  case 0 /* NullValue */ :
1563
+ case 9007199254740991 /* MaxValue */ :
1540
1564
  return 0;
1541
1565
 
1542
1566
  case 1 /* BooleanValue */ :
@@ -1551,10 +1575,10 @@ function jt(t, e) {
1551
1575
  }(t, e);
1552
1576
 
1553
1577
  case 3 /* TimestampValue */ :
1554
- return Lt(t.timestampValue, e.timestampValue);
1578
+ return jt(t.timestampValue, e.timestampValue);
1555
1579
 
1556
1580
  case 4 /* ServerTimestampValue */ :
1557
- return Lt(qt(t), qt(e));
1581
+ return jt(qt(t), qt(e));
1558
1582
 
1559
1583
  case 5 /* StringValue */ :
1560
1584
  return gt(t.stringValue, e.stringValue);
@@ -1583,7 +1607,7 @@ function jt(t, e) {
1583
1607
  case 9 /* ArrayValue */ :
1584
1608
  return function(t, e) {
1585
1609
  for (var n = t.values || [], r = e.values || [], i = 0; i < n.length && i < r.length; ++i) {
1586
- var o = jt(n[i], r[i]);
1610
+ var o = Lt(n[i], r[i]);
1587
1611
  if (o) return o;
1588
1612
  }
1589
1613
  return gt(n.length, r.length);
@@ -1600,7 +1624,7 @@ function jt(t, e) {
1600
1624
  for (var a = 0; a < r.length && a < o.length; ++a) {
1601
1625
  var s = gt(r[a], o[a]);
1602
1626
  if (0 !== s) return s;
1603
- var u = jt(n[r[a]], i[o[a]]);
1627
+ var u = Lt(n[r[a]], i[o[a]]);
1604
1628
  if (0 !== u) return u;
1605
1629
  }
1606
1630
  return gt(r.length, o.length);
@@ -1611,7 +1635,7 @@ function jt(t, e) {
1611
1635
  }
1612
1636
  }
1613
1637
 
1614
- function Lt(t, e) {
1638
+ function jt(t, e) {
1615
1639
  if ("string" == typeof t && "string" == typeof e && t.length === e.length) return gt(t, e);
1616
1640
  var n = kt(t), r = kt(e), i = gt(n.seconds, r.seconds);
1617
1641
  return 0 !== i ? i : gt(n.nanos, r.nanos);
@@ -1667,26 +1691,7 @@ function Rt(t, e) {
1667
1691
  return Object.assign({}, t);
1668
1692
  }
1669
1693
 
1670
- /**
1671
- * @license
1672
- * Copyright 2017 Google LLC
1673
- *
1674
- * Licensed under the Apache License, Version 2.0 (the "License");
1675
- * you may not use this file except in compliance with the License.
1676
- * You may obtain a copy of the License at
1677
- *
1678
- * http://www.apache.org/licenses/LICENSE-2.0
1679
- *
1680
- * Unless required by applicable law or agreed to in writing, software
1681
- * distributed under the License is distributed on an "AS IS" BASIS,
1682
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1683
- * See the License for the specific language governing permissions and
1684
- * limitations under the License.
1685
- */
1686
- /**
1687
- * An ObjectValue represents a MapValue in the Firestore Proto and offers the
1688
- * ability to add and remove fields (via the ObjectValueBuilder).
1689
- */ var zt = /** @class */ function() {
1694
+ var zt = /** @class */ function() {
1690
1695
  function t(t) {
1691
1696
  this.value = t;
1692
1697
  }
@@ -1780,25 +1785,26 @@ function Rt(t, e) {
1780
1785
  return new t(Gt(this.value));
1781
1786
  }, t;
1782
1787
  }(), Qt = /** @class */ function() {
1783
- function t(t, e, n, r, i) {
1784
- this.key = t, this.documentType = e, this.version = n, this.data = r, this.documentState = i
1788
+ function t(t, e, n, r, i, o) {
1789
+ this.key = t, this.documentType = e, this.version = n, this.readTime = r, this.data = i,
1790
+ this.documentState = o
1785
1791
  /**
1786
1792
  * Creates a document with no known version or data, but which can serve as
1787
1793
  * base document for mutations.
1788
1794
  */;
1789
1795
  }
1790
1796
  return t.newInvalidDocument = function(e) {
1791
- return new t(e, 0 /* INVALID */ , _t.min(), zt.empty(), 0 /* SYNCED */);
1797
+ return new t(e, 0 /* INVALID */ , _t.min(), _t.min(), zt.empty(), 0 /* SYNCED */);
1792
1798
  },
1793
1799
  /**
1794
1800
  * Creates a new document that is known to exist with the given data at the
1795
1801
  * given version.
1796
1802
  */
1797
1803
  t.newFoundDocument = function(e, n, r) {
1798
- return new t(e, 1 /* FOUND_DOCUMENT */ , n, r, 0 /* SYNCED */);
1804
+ return new t(e, 1 /* FOUND_DOCUMENT */ , n, _t.min(), r, 0 /* SYNCED */);
1799
1805
  },
1800
1806
  /** Creates a new document that is known to not exist at the given version. */ t.newNoDocument = function(e, n) {
1801
- return new t(e, 2 /* NO_DOCUMENT */ , n, zt.empty(), 0 /* SYNCED */);
1807
+ return new t(e, 2 /* NO_DOCUMENT */ , n, _t.min(), zt.empty(), 0 /* SYNCED */);
1802
1808
  },
1803
1809
  /**
1804
1810
  * Creates a new document that is known to exist at the given version but
@@ -1806,7 +1812,7 @@ function Rt(t, e) {
1806
1812
  * base document).
1807
1813
  */
1808
1814
  t.newUnknownDocument = function(e, n) {
1809
- return new t(e, 3 /* UNKNOWN_DOCUMENT */ , n, zt.empty(), 2 /* HAS_COMMITTED_MUTATIONS */);
1815
+ return new t(e, 3 /* UNKNOWN_DOCUMENT */ , n, _t.min(), zt.empty(), 2 /* HAS_COMMITTED_MUTATIONS */);
1810
1816
  },
1811
1817
  /**
1812
1818
  * Changes the document type to indicate that it exists and that its version
@@ -1836,6 +1842,8 @@ function Rt(t, e) {
1836
1842
  return this.documentState = 2 /* HAS_COMMITTED_MUTATIONS */ , this;
1837
1843
  }, t.prototype.setHasLocalMutations = function() {
1838
1844
  return this.documentState = 1 /* HAS_LOCAL_MUTATIONS */ , this;
1845
+ }, t.prototype.setReadTime = function(t) {
1846
+ return this.readTime = t, this;
1839
1847
  }, Object.defineProperty(t.prototype, "hasLocalMutations", {
1840
1848
  get: function() {
1841
1849
  return 1 /* HAS_LOCAL_MUTATIONS */ === this.documentState;
@@ -1865,7 +1873,7 @@ function Rt(t, e) {
1865
1873
  }, t.prototype.isEqual = function(e) {
1866
1874
  return e instanceof t && this.key.isEqual(e.key) && this.version.isEqual(e.version) && this.documentType === e.documentType && this.documentState === e.documentState && this.data.isEqual(e.data);
1867
1875
  }, t.prototype.mutableCopy = function() {
1868
- return new t(this.key, this.documentType, this.version, this.data.clone(), this.documentState);
1876
+ return new t(this.key, this.documentType, this.version, this.readTime, this.data.clone(), this.documentState);
1869
1877
  }, t.prototype.toString = function() {
1870
1878
  return "Document(" + this.key + ", " + this.version + ", " + JSON.stringify(this.data.value) + ", {documentType: " + this.documentType + "}), {documentState: " + this.documentState + "})";
1871
1879
  }, t;
@@ -1930,7 +1938,7 @@ var Wt = /** @class */ function(e) {
1930
1938
  }, n.prototype.matches = function(t) {
1931
1939
  var e = t.data.field(this.field);
1932
1940
  // Types do not have to match in NOT_EQUAL filters.
1933
- return "!=" /* NOT_EQUAL */ === this.op ? null !== e && this.D(jt(e, this.value)) : null !== e && Ft(this.value) === Ft(e) && this.D(jt(e, this.value));
1941
+ return "!=" /* NOT_EQUAL */ === this.op ? null !== e && this.D(Lt(e, this.value)) : null !== e && Ft(this.value) === Ft(e) && this.D(Lt(e, this.value));
1934
1942
  // Only compare types with matching backend order (such as double and int).
1935
1943
  }, n.prototype.D = function(t) {
1936
1944
  switch (this.op) {
@@ -2037,7 +2045,7 @@ var Wt = /** @class */ function(e) {
2037
2045
  }));
2038
2046
  }, n;
2039
2047
  }(Wt), re = function(t, e) {
2040
- this.position = t, this.before = e;
2048
+ this.position = t, this.inclusive = e;
2041
2049
  }, ie = function(t, e /* ASCENDING */) {
2042
2050
  void 0 === e && (e = "asc"), this.field = t, this.dir = e;
2043
2051
  };
@@ -2049,7 +2057,7 @@ var Wt = /** @class */ function(e) {
2049
2057
  function ae(t, e) {
2050
2058
  if (null === t) return null === e;
2051
2059
  if (null === e) return !1;
2052
- if (t.before !== e.before || t.position.length !== e.position.length) return !1;
2060
+ if (t.inclusive !== e.inclusive || t.position.length !== e.position.length) return !1;
2053
2061
  for (var n = 0; n < t.position.length; n++) if (!Ot(t.position[n], e.position[n])) return !1;
2054
2062
  return !0;
2055
2063
  }
@@ -2159,7 +2167,7 @@ function le(t) {
2159
2167
  n.push(new ie(o.field, a));
2160
2168
  }
2161
2169
  // We need to swap the cursors to match the now-flipped query ordering.
2162
- var s = e.endAt ? new re(e.endAt.position, !e.endAt.before) : null, u = e.startAt ? new re(e.startAt.position, !e.startAt.before) : null;
2170
+ var s = e.endAt ? new re(e.endAt.position, !e.endAt.inclusive) : null, u = e.startAt ? new re(e.startAt.position, !e.startAt.inclusive) : null;
2163
2171
  // Now return as a LimitType.First query.
2164
2172
  e.S = Ht(e.path, e.collectionGroup, n, e.filters, e.limit, s, u);
2165
2173
  }
@@ -2347,7 +2355,7 @@ function de(t, e) {
2347
2355
  /**
2348
2356
  * Returns a value for a Date that's appropriate to put into a proto.
2349
2357
  */
2350
- function Ne(t, e) {
2358
+ function Pe(t, e) {
2351
2359
  return t.F ? new Date(1e3 * e.seconds).toISOString().replace(/\.\d*/, "").replace("Z", "") + "." + ("000000000" + e.nanoseconds).slice(-9) + "Z" : {
2352
2360
  seconds: "" + e.seconds,
2353
2361
  nanos: e.nanoseconds
@@ -2358,12 +2366,12 @@ function Ne(t, e) {
2358
2366
  * Returns a value for bytes that's appropriate to put in a proto.
2359
2367
  *
2360
2368
  * Visible for testing.
2361
- */ function Pe(t, e) {
2369
+ */ function Ne(t, e) {
2362
2370
  return t.F ? e.toBase64() : e.toUint8Array();
2363
2371
  }
2364
2372
 
2365
2373
  function qe(t, e) {
2366
- return Ne(t, e.toTimestamp());
2374
+ return Pe(t, e.toTimestamp());
2367
2375
  }
2368
2376
 
2369
2377
  function Fe(t) {
@@ -2383,17 +2391,17 @@ function Ce(t, e) {
2383
2391
  return Oe(t.databaseId, e.path);
2384
2392
  }
2385
2393
 
2386
- function je(t, e) {
2394
+ function Le(t, e) {
2387
2395
  var n, r = function(t) {
2388
2396
  var e = Z.fromString(t);
2389
- return E(Qe(e)), e;
2397
+ return E(ze(e)), e;
2390
2398
  }(e);
2391
2399
  if (r.get(1) !== t.databaseId.projectId) throw new U(V, "Tried to deserialize key from different project: " + r.get(1) + " vs " + t.databaseId.projectId);
2392
2400
  if (r.get(3) !== t.databaseId.database) throw new U(V, "Tried to deserialize key from different database: " + r.get(3) + " vs " + t.databaseId.database);
2393
2401
  return new nt((E((n = r).length > 4 && "documents" === n.get(4)), n.popFirst(5)));
2394
2402
  }
2395
2403
 
2396
- function Le(t, e) {
2404
+ function je(t, e) {
2397
2405
  return Oe(t.databaseId, e);
2398
2406
  }
2399
2407
 
@@ -2409,29 +2417,21 @@ function Me(t, e, n) {
2409
2417
  }
2410
2418
 
2411
2419
  function Ue(t) {
2412
- return {
2413
- before: t.before,
2414
- values: t.position
2415
- };
2416
- }
2417
-
2418
- // visible for testing
2419
- function xe(t) {
2420
2420
  return ke[t];
2421
2421
  }
2422
2422
 
2423
2423
  // visible for testing
2424
- function Be(t) {
2424
+ function xe(t) {
2425
2425
  return Ve[t];
2426
2426
  }
2427
2427
 
2428
- function Ge(t) {
2428
+ function Be(t) {
2429
2429
  return {
2430
2430
  fieldPath: t.canonicalString()
2431
2431
  };
2432
2432
  }
2433
2433
 
2434
- function ze(t) {
2434
+ function Ge(t) {
2435
2435
  var e = [];
2436
2436
  return t.fields.forEach((function(t) {
2437
2437
  return e.push(t.canonicalString());
@@ -2440,7 +2440,7 @@ function ze(t) {
2440
2440
  };
2441
2441
  }
2442
2442
 
2443
- function Qe(t) {
2443
+ function ze(t) {
2444
2444
  // Resource names have at least 4 components (project ID, database ID)
2445
2445
  return t.length >= 4 && "projects" === t.get(0) && "databases" === t.get(2);
2446
2446
  }
@@ -2460,7 +2460,7 @@ function Qe(t) {
2460
2460
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2461
2461
  * See the License for the specific language governing permissions and
2462
2462
  * limitations under the License.
2463
- */ function Ke(t) {
2463
+ */ function Qe(t) {
2464
2464
  return new De(t, /* useProto3Json= */ !0);
2465
2465
  }
2466
2466
 
@@ -2488,7 +2488,7 @@ function Qe(t) {
2488
2488
  * backoff curve, and a +/- 50% "jitter" that is calculated and added to the
2489
2489
  * base delay. This prevents clients from accidentally synchronizing their
2490
2490
  * delays causing spikes of load to the backend.
2491
- */ var He = /** @class */ function() {
2491
+ */ var Ke = /** @class */ function() {
2492
2492
  function t(
2493
2493
  /**
2494
2494
  * The AsyncQueue to run backoff operations on.
@@ -2562,7 +2562,7 @@ function Qe(t) {
2562
2562
  /** Returns a random value in the range [-currentBaseMs/2, currentBaseMs/2] */ t.prototype.Y = function() {
2563
2563
  return (Math.random() - .5) * this.j;
2564
2564
  }, t;
2565
- }(), We = /** @class */ function(e) {
2565
+ }(), He = /** @class */ function(e) {
2566
2566
  function n(t, n, r, i) {
2567
2567
  var o = this;
2568
2568
  return (o = e.call(this) || this).authCredentials = t, o.appCheckCredentials = n,
@@ -2622,7 +2622,7 @@ function Qe(t) {
2622
2622
  */
2623
2623
  // TODO(firestorexp): Make sure there is only one Datastore instance per
2624
2624
  // firestore-exp client.
2625
- function Ye(t, r) {
2625
+ function We(t, r) {
2626
2626
  return e(this, void 0, void 0, (function() {
2627
2627
  var e, i, o;
2628
2628
  return n(this, (function(n) {
@@ -2638,7 +2638,7 @@ function Ye(t, r) {
2638
2638
  delete: Ce(t, e.key)
2639
2639
  }; else if (e instanceof Ee) n = {
2640
2640
  update: Me(t, e.key, e.data),
2641
- updateMask: ze(e.fieldMask)
2641
+ updateMask: Ge(e.fieldMask)
2642
2642
  }; else {
2643
2643
  if (!(e instanceof Ae)) return S();
2644
2644
  n = {
@@ -2688,7 +2688,7 @@ function Ye(t, r) {
2688
2688
  }));
2689
2689
  }
2690
2690
 
2691
- function $e(t, r) {
2691
+ function Ye(t, r) {
2692
2692
  return e(this, void 0, void 0, (function() {
2693
2693
  var e, i, o, a, s, u;
2694
2694
  return n(this, (function(n) {
@@ -2705,7 +2705,7 @@ function $e(t, r) {
2705
2705
  var n = function(t, e) {
2706
2706
  return "found" in e ? function(t, e) {
2707
2707
  E(!!e.found), e.found.name, e.found.updateTime;
2708
- var n = je(t, e.found.name), r = Fe(e.found.updateTime), i = new zt({
2708
+ var n = Le(t, e.found.name), r = Fe(e.found.updateTime), i = new zt({
2709
2709
  mapValue: {
2710
2710
  fields: e.found.fields
2711
2711
  }
@@ -2713,7 +2713,7 @@ function $e(t, r) {
2713
2713
  return Qt.newFoundDocument(n, r, i);
2714
2714
  }(t, e) : "missing" in e ? function(t, e) {
2715
2715
  E(!!e.missing), E(!!e.readTime);
2716
- var n = je(t, e.missing), r = Fe(e.readTime);
2716
+ var n = Le(t, e.missing), r = Fe(e.readTime);
2717
2717
  return Qt.newNoDocument(n, r);
2718
2718
  }(t, e) : S();
2719
2719
  }(e.q, t);
@@ -2727,7 +2727,7 @@ function $e(t, r) {
2727
2727
  }));
2728
2728
  }
2729
2729
 
2730
- function Xe(t, r) {
2730
+ function $e(t, r) {
2731
2731
  return e(this, void 0, void 0, (function() {
2732
2732
  var e, i;
2733
2733
  return n(this, (function(n) {
@@ -2738,10 +2738,10 @@ function Xe(t, r) {
2738
2738
  var n = {
2739
2739
  structuredQuery: {}
2740
2740
  }, r = e.path;
2741
- null !== e.collectionGroup ? (n.parent = Le(t, r), n.structuredQuery.from = [ {
2741
+ null !== e.collectionGroup ? (n.parent = je(t, r), n.structuredQuery.from = [ {
2742
2742
  collectionId: e.collectionGroup,
2743
2743
  allDescendants: !0
2744
- } ]) : (n.parent = Le(t, r.popLast()), n.structuredQuery.from = [ {
2744
+ } ]) : (n.parent = je(t, r.popLast()), n.structuredQuery.from = [ {
2745
2745
  collectionId: r.lastSegment()
2746
2746
  } ]);
2747
2747
  var i = function(t) {
@@ -2752,34 +2752,34 @@ function Xe(t, r) {
2752
2752
  if ("==" /* EQUAL */ === t.op) {
2753
2753
  if (xt(t.value)) return {
2754
2754
  unaryFilter: {
2755
- field: Ge(t.field),
2755
+ field: Be(t.field),
2756
2756
  op: "IS_NAN"
2757
2757
  }
2758
2758
  };
2759
2759
  if (Ut(t.value)) return {
2760
2760
  unaryFilter: {
2761
- field: Ge(t.field),
2761
+ field: Be(t.field),
2762
2762
  op: "IS_NULL"
2763
2763
  }
2764
2764
  };
2765
2765
  } else if ("!=" /* NOT_EQUAL */ === t.op) {
2766
2766
  if (xt(t.value)) return {
2767
2767
  unaryFilter: {
2768
- field: Ge(t.field),
2768
+ field: Be(t.field),
2769
2769
  op: "IS_NOT_NAN"
2770
2770
  }
2771
2771
  };
2772
2772
  if (Ut(t.value)) return {
2773
2773
  unaryFilter: {
2774
- field: Ge(t.field),
2774
+ field: Be(t.field),
2775
2775
  op: "IS_NOT_NULL"
2776
2776
  }
2777
2777
  };
2778
2778
  }
2779
2779
  return {
2780
2780
  fieldFilter: {
2781
- field: Ge(t.field),
2782
- op: Be(t.op),
2781
+ field: Be(t.field),
2782
+ op: xe(t.op),
2783
2783
  value: t.value
2784
2784
  }
2785
2785
  };
@@ -2799,20 +2799,27 @@ function Xe(t, r) {
2799
2799
  // visible for testing
2800
2800
  return function(t) {
2801
2801
  return {
2802
- field: Ge(t.field),
2803
- direction: xe(t.dir)
2802
+ field: Be(t.field),
2803
+ direction: Ue(t.dir)
2804
2804
  };
2805
2805
  }(t);
2806
2806
  }));
2807
2807
  }(e.orderBy);
2808
2808
  o && (n.structuredQuery.orderBy = o);
2809
- var a = function(t, e) {
2809
+ var a, s = function(t, e) {
2810
2810
  return t.F || ct(e) ? e : {
2811
2811
  value: e
2812
2812
  };
2813
2813
  }(t, e.limit);
2814
- return null !== a && (n.structuredQuery.limit = a), e.startAt && (n.structuredQuery.startAt = Ue(e.startAt)),
2815
- e.endAt && (n.structuredQuery.endAt = Ue(e.endAt)), n;
2814
+ return null !== s && (n.structuredQuery.limit = s), e.startAt && (n.structuredQuery.startAt = {
2815
+ before: (a = e.startAt).inclusive,
2816
+ values: a.position
2817
+ }), e.endAt && (n.structuredQuery.endAt = function(t) {
2818
+ return {
2819
+ before: !t.inclusive,
2820
+ values: t.position
2821
+ };
2822
+ }(e.endAt)), n;
2816
2823
  }(e.q, pe(r)), [ 4 /*yield*/ , e.T("RunQuery", i.parent, {
2817
2824
  structuredQuery: i.structuredQuery
2818
2825
  }) ];
@@ -2822,7 +2829,7 @@ function Xe(t, r) {
2822
2829
  return !!t.document;
2823
2830
  })).map((function(t) {
2824
2831
  return function(t, e, n) {
2825
- var r = je(t, e.name), i = Fe(e.updateTime), o = new zt({
2832
+ var r = Le(t, e.name), i = Fe(e.updateTime), o = new zt({
2826
2833
  mapValue: {
2827
2834
  fields: e.fields
2828
2835
  }
@@ -2850,7 +2857,7 @@ function Xe(t, r) {
2850
2857
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2851
2858
  * See the License for the specific language governing permissions and
2852
2859
  * limitations under the License.
2853
- */ var Je = new Map;
2860
+ */ var Xe = new Map;
2854
2861
 
2855
2862
  /**
2856
2863
  * An instance map that ensures only one Datastore exists per Firestore
@@ -2860,17 +2867,17 @@ function Xe(t, r) {
2860
2867
  * Returns an initialized and started Datastore for the given Firestore
2861
2868
  * instance. Callers must invoke removeComponents() when the Firestore
2862
2869
  * instance is terminated.
2863
- */ function Ze(t) {
2870
+ */ function Je(t) {
2864
2871
  if (t._terminated) throw new U(O, "The client has already been terminated.");
2865
- if (!Je.has(t)) {
2872
+ if (!Xe.has(t)) {
2866
2873
  w("ComponentProvider", "Initializing Datastore");
2867
2874
  var e = function(t) {
2868
2875
  return new mt(t, fetch.bind(null));
2869
2876
  }((i = t._databaseId, o = t.app.options.appId || "", a = t._persistenceKey, s = t._freezeSettings(),
2870
- new $(i, o, a, s.host, s.ssl, s.experimentalForceLongPolling, s.experimentalAutoDetectLongPolling, s.useFetchStreams))), n = Ke(t._databaseId), r = function(t, e, n, r) {
2871
- return new We(t, e, n, r);
2877
+ new $(i, o, a, s.host, s.ssl, s.experimentalForceLongPolling, s.experimentalAutoDetectLongPolling, s.useFetchStreams))), n = Qe(t._databaseId), r = function(t, e, n, r) {
2878
+ return new He(t, e, n, r);
2872
2879
  }(t._authCredentials, t._appCheckCredentials, e, n);
2873
- Je.set(t, r);
2880
+ Xe.set(t, r);
2874
2881
  }
2875
2882
  var i, o, a, s;
2876
2883
  /**
@@ -2888,7 +2895,7 @@ function Xe(t, r) {
2888
2895
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2889
2896
  * See the License for the specific language governing permissions and
2890
2897
  * limitations under the License.
2891
- */ return Je.get(t);
2898
+ */ return Xe.get(t);
2892
2899
  }
2893
2900
 
2894
2901
  /**
@@ -2899,7 +2906,7 @@ function Xe(t, r) {
2899
2906
  * A concrete type describing all the values that can be applied via a
2900
2907
  * user-supplied `FirestoreSettings` object. This is a separate type so that
2901
2908
  * defaults can be supplied and the value can be checked for equality.
2902
- */ var tn = /** @class */ function() {
2909
+ */ var Ze = /** @class */ function() {
2903
2910
  function t(t) {
2904
2911
  var e;
2905
2912
  if (void 0 === t.host) {
@@ -2919,14 +2926,14 @@ function Xe(t, r) {
2919
2926
  return t.prototype.isEqual = function(t) {
2920
2927
  return this.host === t.host && this.ssl === t.ssl && this.credentials === t.credentials && this.cacheSizeBytes === t.cacheSizeBytes && this.experimentalForceLongPolling === t.experimentalForceLongPolling && this.experimentalAutoDetectLongPolling === t.experimentalAutoDetectLongPolling && this.ignoreUndefinedProperties === t.ignoreUndefinedProperties && this.useFetchStreams === t.useFetchStreams;
2921
2928
  }, t;
2922
- }(), en = /** @class */ function() {
2929
+ }(), tn = /** @class */ function() {
2923
2930
  /** @hideconstructor */
2924
2931
  function t(t, e, n) {
2925
2932
  this._authCredentials = e, this._appCheckCredentials = n,
2926
2933
  /**
2927
2934
  * Whether it's a Firestore or Firestore Lite instance.
2928
2935
  */
2929
- this.type = "firestore-lite", this._persistenceKey = "(lite)", this._settings = new tn({}),
2936
+ this.type = "firestore-lite", this._persistenceKey = "(lite)", this._settings = new Ze({}),
2930
2937
  this._settingsFrozen = !1, t instanceof X ? this._databaseId = t : (this._app = t,
2931
2938
  this._databaseId = function(t) {
2932
2939
  if (!Object.prototype.hasOwnProperty.apply(t.options, [ "projectId" ])) throw new U(V, '"projectId" not provided in firebase.initializeApp.');
@@ -2958,7 +2965,7 @@ function Xe(t, r) {
2958
2965
  configurable: !0
2959
2966
  }), t.prototype._setSettings = function(t) {
2960
2967
  if (this._settingsFrozen) throw new U(O, "Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");
2961
- this._settings = new tn(t), void 0 !== t.credentials && (this._authCredentials = function(t) {
2968
+ this._settings = new Ze(t), void 0 !== t.credentials && (this._authCredentials = function(t) {
2962
2969
  if (!t) return new G;
2963
2970
  switch (t.type) {
2964
2971
  case "gapi":
@@ -2996,8 +3003,8 @@ function Xe(t, r) {
2996
3003
  * Only ever called once.
2997
3004
  */
2998
3005
  t.prototype._terminate = function() {
2999
- return t = this, (e = Je.get(t)) && (w("ComponentProvider", "Removing Datastore"),
3000
- Je.delete(t), e.terminate()), Promise.resolve();
3006
+ return t = this, (e = Xe.get(t)) && (w("ComponentProvider", "Removing Datastore"),
3007
+ Xe.delete(t), e.terminate()), Promise.resolve();
3001
3008
  var t, e;
3002
3009
  }, t;
3003
3010
  }();
@@ -3022,7 +3029,7 @@ function Xe(t, r) {
3022
3029
  * The Cloud Firestore service interface.
3023
3030
  *
3024
3031
  * Do not call this constructor directly. Instead, use {@link getFirestore}.
3025
- */ function nn(t, e) {
3032
+ */ function en(t, e) {
3026
3033
  var n = _getProvider(t, "firestore/lite");
3027
3034
  if (n.isInitialized()) throw new U(O, "Firestore can only be initialized once per app.");
3028
3035
  return n.initialize({
@@ -3038,7 +3045,7 @@ function Xe(t, r) {
3038
3045
  * @param app - The {@link @firebase/app#FirebaseApp} instance that the returned `Firestore`
3039
3046
  * instance is associated with.
3040
3047
  * @returns The `Firestore` instance of the provided app.
3041
- */ function rn(t) {
3048
+ */ function nn(t) {
3042
3049
  return void 0 === t && (t = s()), _getProvider(t, "firestore/lite").getImmediate();
3043
3050
  }
3044
3051
 
@@ -3054,10 +3061,10 @@ function Xe(t, r) {
3054
3061
  * @param port - the emulator port (ex: 9000).
3055
3062
  * @param options.mockUserToken - the mock auth token to use for unit testing
3056
3063
  * Security Rules.
3057
- */ function on(t, e, n, r) {
3064
+ */ function rn(t, e, n, r) {
3058
3065
  var i;
3059
3066
  void 0 === r && (r = {});
3060
- var o = (t = st(t, en))._getSettings();
3067
+ var o = (t = st(t, tn))._getSettings();
3061
3068
  if ("firestore.googleapis.com" !== o.host && o.host !== e && _("Host has been set in both settings() and useEmulator(), emulator host will be used"),
3062
3069
  t._setSettings(Object.assign(Object.assign({}, o), {
3063
3070
  host: e + ":" + n,
@@ -3095,8 +3102,8 @@ function Xe(t, r) {
3095
3102
  * @param firestore - The `Firestore` instance to terminate.
3096
3103
  * @returns A `Promise` that is resolved when the instance has been successfully
3097
3104
  * terminated.
3098
- */ function an(t) {
3099
- return t = st(t, en), u(t.app, "firestore/lite"), t._delete()
3105
+ */ function on(t) {
3106
+ return t = st(t, tn), u(t.app, "firestore/lite"), t._delete()
3100
3107
  /**
3101
3108
  * @license
3102
3109
  * Copyright 2020 Google LLC
@@ -3136,7 +3143,7 @@ function Xe(t, r) {
3136
3143
  */;
3137
3144
  }
3138
3145
 
3139
- var sn = /** @class */ function() {
3146
+ var an = /** @class */ function() {
3140
3147
  /** @hideconstructor */
3141
3148
  function t(t,
3142
3149
  /**
@@ -3177,14 +3184,14 @@ var sn = /** @class */ function() {
3177
3184
  * The collection this `DocumentReference` belongs to.
3178
3185
  */
3179
3186
  get: function() {
3180
- return new cn(this.firestore, this.converter, this._key.path.popLast());
3187
+ return new un(this.firestore, this.converter, this._key.path.popLast());
3181
3188
  },
3182
3189
  enumerable: !1,
3183
3190
  configurable: !0
3184
3191
  }), t.prototype.withConverter = function(e) {
3185
3192
  return new t(this.firestore, e, this._key);
3186
3193
  }, t;
3187
- }(), un = /** @class */ function() {
3194
+ }(), sn = /** @class */ function() {
3188
3195
  // This is the lite version of the Query class in the main SDK.
3189
3196
  /** @hideconstructor protected */
3190
3197
  function t(t,
@@ -3199,7 +3206,7 @@ var sn = /** @class */ function() {
3199
3206
  return t.prototype.withConverter = function(e) {
3200
3207
  return new t(this.firestore, e, this._query);
3201
3208
  }, t;
3202
- }(), cn = /** @class */ function(e) {
3209
+ }(), un = /** @class */ function(e) {
3203
3210
  /** @hideconstructor */
3204
3211
  function n(t, n, r) {
3205
3212
  var i = this;
@@ -3230,7 +3237,7 @@ var sn = /** @class */ function() {
3230
3237
  */
3231
3238
  get: function() {
3232
3239
  var t = this._path.popLast();
3233
- return t.isEmpty() ? null : new sn(this.firestore,
3240
+ return t.isEmpty() ? null : new an(this.firestore,
3234
3241
  /* converter= */ null, new nt(t));
3235
3242
  },
3236
3243
  enumerable: !1,
@@ -3238,20 +3245,20 @@ var sn = /** @class */ function() {
3238
3245
  }), n.prototype.withConverter = function(t) {
3239
3246
  return new n(this.firestore, t, this._path);
3240
3247
  }, n;
3241
- }(un);
3248
+ }(sn);
3242
3249
 
3243
3250
  /**
3244
3251
  * A `Query` refers to a query which you can read or listen to. You can also
3245
3252
  * construct refined `Query` objects by adding filters and ordering.
3246
- */ function ln(t, e) {
3253
+ */ function cn(t, e) {
3247
3254
  for (var n = [], i = 2; i < arguments.length; i++) n[i - 2] = arguments[i];
3248
- if (t = p(t), rt("collection", "path", e), t instanceof en) {
3255
+ if (t = p(t), rt("collection", "path", e), t instanceof tn) {
3249
3256
  var o = Z.fromString.apply(Z, r([ e ], n));
3250
- return ot(o), new cn(t, /* converter= */ null, o);
3257
+ return ot(o), new un(t, /* converter= */ null, o);
3251
3258
  }
3252
- if (!(t instanceof sn || t instanceof cn)) throw new U(V, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
3259
+ if (!(t instanceof an || t instanceof un)) throw new U(V, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
3253
3260
  var a = t._path.child(Z.fromString.apply(Z, r([ e ], n)));
3254
- return ot(a), new cn(t.firestore,
3261
+ return ot(a), new un(t.firestore,
3255
3262
  /* converter= */ null, a);
3256
3263
  }
3257
3264
 
@@ -3267,9 +3274,9 @@ var sn = /** @class */ function() {
3267
3274
  * collection or subcollection with this ID as the last segment of its path
3268
3275
  * will be included. Cannot contain a slash.
3269
3276
  * @returns The created `Query`.
3270
- */ function fn(t, e) {
3271
- if (t = st(t, en), rt("collectionGroup", "collection id", e), e.indexOf("/") >= 0) throw new U(V, "Invalid collection ID '" + e + "' passed to function collectionGroup(). Collection IDs must not contain '/'.");
3272
- return new un(t,
3277
+ */ function ln(t, e) {
3278
+ if (t = st(t, tn), rt("collectionGroup", "collection id", e), e.indexOf("/") >= 0) throw new U(V, "Invalid collection ID '" + e + "' passed to function collectionGroup(). Collection IDs must not contain '/'.");
3279
+ return new sn(t,
3273
3280
  /* converter= */ null,
3274
3281
  /**
3275
3282
  * Creates a new Query for a collection group query that matches all documents
@@ -3280,19 +3287,19 @@ var sn = /** @class */ function() {
3280
3287
  }(e));
3281
3288
  }
3282
3289
 
3283
- function hn(t, e) {
3290
+ function fn(t, e) {
3284
3291
  for (var n = [], i = 2; i < arguments.length; i++) n[i - 2] = arguments[i];
3285
3292
  if (t = p(t),
3286
3293
  // We allow omission of 'pathString' but explicitly prohibit passing in both
3287
3294
  // 'undefined' and 'null'.
3288
- 1 === arguments.length && (e = vt.R()), rt("doc", "path", e), t instanceof en) {
3295
+ 1 === arguments.length && (e = vt.R()), rt("doc", "path", e), t instanceof tn) {
3289
3296
  var o = Z.fromString.apply(Z, r([ e ], n));
3290
- return it(o), new sn(t,
3297
+ return it(o), new an(t,
3291
3298
  /* converter= */ null, new nt(o));
3292
3299
  }
3293
- if (!(t instanceof sn || t instanceof cn)) throw new U(V, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
3300
+ if (!(t instanceof an || t instanceof un)) throw new U(V, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
3294
3301
  var a = t._path.child(Z.fromString.apply(Z, r([ e ], n)));
3295
- return it(a), new sn(t.firestore, t instanceof cn ? t.converter : null, new nt(a));
3302
+ return it(a), new an(t.firestore, t instanceof un ? t.converter : null, new nt(a));
3296
3303
  }
3297
3304
 
3298
3305
  /**
@@ -3302,8 +3309,8 @@ function hn(t, e) {
3302
3309
  * @param right - A reference to compare.
3303
3310
  * @returns true if the references point to the same location in the same
3304
3311
  * Firestore database.
3305
- */ function pn(t, e) {
3306
- return t = p(t), e = p(e), (t instanceof sn || t instanceof cn) && (e instanceof sn || e instanceof cn) && t.firestore === e.firestore && t.path === e.path && t.converter === e.converter
3312
+ */ function hn(t, e) {
3313
+ return t = p(t), e = p(e), (t instanceof an || t instanceof un) && (e instanceof an || e instanceof un) && t.firestore === e.firestore && t.path === e.path && t.converter === e.converter
3307
3314
  /**
3308
3315
  * Returns true if the provided queries point to the same collection and apply
3309
3316
  * the same constraints.
@@ -3315,8 +3322,8 @@ function hn(t, e) {
3315
3322
  */;
3316
3323
  }
3317
3324
 
3318
- function dn(t, e) {
3319
- return t = p(t), e = p(e), t instanceof un && e instanceof un && t.firestore === e.firestore && function(t, e) {
3325
+ function pn(t, e) {
3326
+ return t = p(t), e = p(e), t instanceof sn && e instanceof sn && t.firestore === e.firestore && function(t, e) {
3320
3327
  return function(t, e) {
3321
3328
  if (t.limit !== e.limit) return !1;
3322
3329
  if (t.orderBy.length !== e.orderBy.length) return !1;
@@ -3354,7 +3361,7 @@ function dn(t, e) {
3354
3361
  */;
3355
3362
  }
3356
3363
 
3357
- var mn = /** @class */ function() {
3364
+ var dn = /** @class */ function() {
3358
3365
  /**
3359
3366
  * Creates a `FieldPath` from the provided field names. If more than one field
3360
3367
  * name is provided, the path will point to a nested field in a document.
@@ -3379,8 +3386,8 @@ var mn = /** @class */ function() {
3379
3386
  /**
3380
3387
  * Returns a special sentinel `FieldPath` to refer to the ID of a document.
3381
3388
  * It can be used in queries to sort or filter by the document ID.
3382
- */ function yn() {
3383
- return new mn("__name__");
3389
+ */ function mn() {
3390
+ return new dn("__name__");
3384
3391
  }
3385
3392
 
3386
3393
  /**
@@ -3401,7 +3408,7 @@ var mn = /** @class */ function() {
3401
3408
  */
3402
3409
  /**
3403
3410
  * An immutable object representing an array of bytes.
3404
- */ var vn = /** @class */ function() {
3411
+ */ var yn = /** @class */ function() {
3405
3412
  /** @hideconstructor */
3406
3413
  function t(t) {
3407
3414
  this._byteString = t;
@@ -3459,14 +3466,14 @@ var mn = /** @class */ function() {
3459
3466
  t.prototype.isEqual = function(t) {
3460
3467
  return this._byteString.isEqual(t._byteString);
3461
3468
  }, t;
3462
- }(), gn =
3469
+ }(), vn =
3463
3470
  /**
3464
3471
  * @param _methodName - The public API endpoint that returns this class.
3465
3472
  * @hideconstructor
3466
3473
  */
3467
3474
  function(t) {
3468
3475
  this._methodName = t;
3469
- }, wn = /** @class */ function() {
3476
+ }, gn = /** @class */ function() {
3470
3477
  /**
3471
3478
  * Creates a new immutable `GeoPoint` object with the provided latitude and
3472
3479
  * longitude values.
@@ -3519,14 +3526,14 @@ function(t) {
3519
3526
  t.prototype._compareTo = function(t) {
3520
3527
  return gt(this._lat, t._lat) || gt(this._long, t._long);
3521
3528
  }, t;
3522
- }(), bn = /^__.*__$/, _n = /** @class */ function() {
3529
+ }(), wn = /^__.*__$/, bn = /** @class */ function() {
3523
3530
  function t(t, e, n) {
3524
3531
  this.data = t, this.fieldMask = e, this.fieldTransforms = n;
3525
3532
  }
3526
3533
  return t.prototype.toMutation = function(t, e) {
3527
3534
  return null !== this.fieldMask ? new Ee(t, this.data, this.fieldMask, e, this.fieldTransforms) : new Se(t, this.data, e, this.fieldTransforms);
3528
3535
  }, t;
3529
- }(), Tn = /** @class */ function() {
3536
+ }(), _n = /** @class */ function() {
3530
3537
  function t(t,
3531
3538
  // The fieldMask does not include document transforms.
3532
3539
  e, n) {
@@ -3556,7 +3563,7 @@ function(t) {
3556
3563
  /**
3557
3564
  * Sentinel values that can be used when writing document fields with `set()`
3558
3565
  * or `update()`.
3559
- */ function Sn(t) {
3566
+ */ function Tn(t) {
3560
3567
  switch (t) {
3561
3568
  case 0 /* Set */ :
3562
3569
  // fall through
@@ -3574,7 +3581,7 @@ function(t) {
3574
3581
  }
3575
3582
  }
3576
3583
 
3577
- /** A "context" object passed around while parsing user data. */ var En = /** @class */ function() {
3584
+ /** A "context" object passed around while parsing user data. */ var Sn = /** @class */ function() {
3578
3585
  /**
3579
3586
  * Initializes a ParseContext with the given source and path.
3580
3587
  *
@@ -3612,16 +3619,16 @@ function(t) {
3612
3619
  enumerable: !1,
3613
3620
  configurable: !0
3614
3621
  }),
3615
- /** Returns a new context with the specified settings overwritten. */ t.prototype.nt = function(e) {
3622
+ /** Returns a new context with the specified settings overwritten. */ t.prototype.et = function(e) {
3616
3623
  return new t(Object.assign(Object.assign({}, this.settings), e), this.databaseId, this.q, this.ignoreUndefinedProperties, this.fieldTransforms, this.fieldMask);
3617
- }, t.prototype.et = function(t) {
3618
- var e, n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), r = this.nt({
3624
+ }, t.prototype.nt = function(t) {
3625
+ var e, n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), r = this.et({
3619
3626
  path: n,
3620
3627
  rt: !1
3621
3628
  });
3622
3629
  return r.st(t), r;
3623
3630
  }, t.prototype.it = function(t) {
3624
- var e, n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), r = this.nt({
3631
+ var e, n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), r = this.et({
3625
3632
  path: n,
3626
3633
  rt: !1
3627
3634
  });
@@ -3629,12 +3636,12 @@ function(t) {
3629
3636
  }, t.prototype.ot = function(t) {
3630
3637
  // TODO(b/34871131): We don't support array paths right now; so make path
3631
3638
  // undefined.
3632
- return this.nt({
3639
+ return this.et({
3633
3640
  path: void 0,
3634
3641
  rt: !0
3635
3642
  });
3636
3643
  }, t.prototype.ut = function(t) {
3637
- return zn(t, this.settings.methodName, this.settings.ct || !1, this.path, this.settings.at);
3644
+ return Gn(t, this.settings.methodName, this.settings.ct || !1, this.path, this.settings.at);
3638
3645
  },
3639
3646
  /** Returns 'true' if 'fieldPath' was traversed when creating this context. */ t.prototype.contains = function(t) {
3640
3647
  return void 0 !== this.fieldMask.find((function(e) {
@@ -3648,15 +3655,15 @@ function(t) {
3648
3655
  if (this.path) for (var t = 0; t < this.path.length; t++) this.st(this.path.get(t));
3649
3656
  }, t.prototype.st = function(t) {
3650
3657
  if (0 === t.length) throw this.ut("Document fields must not be empty");
3651
- if (Sn(this.tt) && bn.test(t)) throw this.ut('Document fields cannot begin and end with "__"');
3658
+ if (Tn(this.tt) && wn.test(t)) throw this.ut('Document fields cannot begin and end with "__"');
3652
3659
  }, t;
3653
- }(), In = /** @class */ function() {
3660
+ }(), En = /** @class */ function() {
3654
3661
  function t(t, e, n) {
3655
- this.databaseId = t, this.ignoreUndefinedProperties = e, this.q = n || Ke(t)
3662
+ this.databaseId = t, this.ignoreUndefinedProperties = e, this.q = n || Qe(t)
3656
3663
  /** Creates a new top-level parse context. */;
3657
3664
  }
3658
3665
  return t.prototype.ht = function(t, e, n, r) {
3659
- return void 0 === r && (r = !1), new En({
3666
+ return void 0 === r && (r = !1), new Sn({
3660
3667
  tt: t,
3661
3668
  methodName: e,
3662
3669
  at: n,
@@ -3670,30 +3677,30 @@ function(t) {
3670
3677
  /**
3671
3678
  * Helper for parsing raw user input (provided via the API) into internal model
3672
3679
  * classes.
3673
- */ function An(t) {
3674
- var e = t._freezeSettings(), n = Ke(t._databaseId);
3675
- return new In(t._databaseId, !!e.ignoreUndefinedProperties, n);
3680
+ */ function In(t) {
3681
+ var e = t._freezeSettings(), n = Qe(t._databaseId);
3682
+ return new En(t._databaseId, !!e.ignoreUndefinedProperties, n);
3676
3683
  }
3677
3684
 
3678
- /** Parse document data from a set() call. */ function kn(t, e, n, r, i, o) {
3685
+ /** Parse document data from a set() call. */ function An(t, e, n, r, i, o) {
3679
3686
  void 0 === o && (o = {});
3680
3687
  var a = t.ht(o.merge || o.mergeFields ? 2 /* MergeSet */ : 0 /* Set */ , e, n, i);
3681
- Un("Data must be an object, but it was:", a, r);
3682
- var s, u, c = Rn(r, a);
3688
+ Mn("Data must be an object, but it was:", a, r);
3689
+ var s, u, c = jn(r, a);
3683
3690
  if (o.merge) s = new Et(a.fieldMask), u = a.fieldTransforms; else if (o.mergeFields) {
3684
3691
  for (var l = [], f = 0, h = o.mergeFields; f < h.length; f++) {
3685
- var p = xn(e, h[f], n);
3692
+ var p = Un(e, h[f], n);
3686
3693
  if (!a.contains(p)) throw new U(V, "Field '" + p + "' is specified in your field mask but missing from your input data.");
3687
- Qn(l, p) || l.push(p);
3694
+ zn(l, p) || l.push(p);
3688
3695
  }
3689
3696
  s = new Et(l), u = a.fieldTransforms.filter((function(t) {
3690
3697
  return s.covers(t.field);
3691
3698
  }));
3692
3699
  } else s = null, u = a.fieldTransforms;
3693
- return new _n(new zt(c), s, u);
3700
+ return new bn(new zt(c), s, u);
3694
3701
  }
3695
3702
 
3696
- var Vn = /** @class */ function(e) {
3703
+ var kn = /** @class */ function(e) {
3697
3704
  function n() {
3698
3705
  return null !== e && e.apply(this, arguments) || this;
3699
3706
  }
@@ -3705,7 +3712,7 @@ var Vn = /** @class */ function(e) {
3705
3712
  }, n.prototype.isEqual = function(t) {
3706
3713
  return t instanceof n;
3707
3714
  }, n;
3708
- }(gn);
3715
+ }(vn);
3709
3716
 
3710
3717
  /**
3711
3718
  * Creates a child context for parsing SerializableFieldValues.
@@ -3722,8 +3729,8 @@ var Vn = /** @class */ function(e) {
3722
3729
  * context.
3723
3730
  * @param context - The parent context.
3724
3731
  * @param arrayElement - Whether or not the FieldValue has an array.
3725
- */ function Dn(t, e, n) {
3726
- return new En({
3732
+ */ function Vn(t, e, n) {
3733
+ return new Sn({
3727
3734
  tt: 3 /* Argument */ ,
3728
3735
  at: e.settings.at,
3729
3736
  methodName: t._methodName,
@@ -3731,7 +3738,7 @@ var Vn = /** @class */ function(e) {
3731
3738
  }, e.databaseId, e.q, e.ignoreUndefinedProperties);
3732
3739
  }
3733
3740
 
3734
- var Nn = /** @class */ function(e) {
3741
+ var Dn = /** @class */ function(e) {
3735
3742
  function n() {
3736
3743
  return null !== e && e.apply(this, arguments) || this;
3737
3744
  }
@@ -3740,13 +3747,13 @@ var Nn = /** @class */ function(e) {
3740
3747
  }, n.prototype.isEqual = function(t) {
3741
3748
  return t instanceof n;
3742
3749
  }, n;
3743
- }(gn), Pn = /** @class */ function(e) {
3750
+ }(vn), Pn = /** @class */ function(e) {
3744
3751
  function n(t, n) {
3745
3752
  var r = this;
3746
3753
  return (r = e.call(this, t) || this).lt = n, r;
3747
3754
  }
3748
3755
  return t(n, e), n.prototype._toFieldTransform = function(t) {
3749
- var e = Dn(this, t,
3756
+ var e = Vn(this, t,
3750
3757
  /*array=*/ !0), n = this.lt.map((function(t) {
3751
3758
  return Ln(t, e);
3752
3759
  })), r = new ve(n);
@@ -3755,13 +3762,13 @@ var Nn = /** @class */ function(e) {
3755
3762
  // TODO(mrschmidt): Implement isEquals
3756
3763
  return this === t;
3757
3764
  }, n;
3758
- }(gn), qn = /** @class */ function(e) {
3765
+ }(vn), Nn = /** @class */ function(e) {
3759
3766
  function n(t, n) {
3760
3767
  var r = this;
3761
3768
  return (r = e.call(this, t) || this).lt = n, r;
3762
3769
  }
3763
3770
  return t(n, e), n.prototype._toFieldTransform = function(t) {
3764
- var e = Dn(this, t,
3771
+ var e = Vn(this, t,
3765
3772
  /*array=*/ !0), n = this.lt.map((function(t) {
3766
3773
  return Ln(t, e);
3767
3774
  })), r = new ge(n);
@@ -3770,7 +3777,7 @@ var Nn = /** @class */ function(e) {
3770
3777
  // TODO(mrschmidt): Implement isEquals
3771
3778
  return this === t;
3772
3779
  }, n;
3773
- }(gn), Fn = /** @class */ function(e) {
3780
+ }(vn), qn = /** @class */ function(e) {
3774
3781
  function n(t, n) {
3775
3782
  var r = this;
3776
3783
  return (r = e.call(this, t) || this).ft = n, r;
@@ -3782,19 +3789,19 @@ var Nn = /** @class */ function(e) {
3782
3789
  // TODO(mrschmidt): Implement isEquals
3783
3790
  return this === t;
3784
3791
  }, n;
3785
- }(gn);
3792
+ }(vn);
3786
3793
 
3787
- /** Parse update data from an update() call. */ function On(t, e, n, r) {
3794
+ /** Parse update data from an update() call. */ function Fn(t, e, n, r) {
3788
3795
  var i = t.ht(1 /* Update */ , e, n);
3789
- Un("Data must be an object, but it was:", i, r);
3796
+ Mn("Data must be an object, but it was:", i, r);
3790
3797
  var o = [], a = zt.empty();
3791
3798
  St(r, (function(t, r) {
3792
- var s = Gn(e, t, n);
3799
+ var s = Bn(e, t, n);
3793
3800
  // For Compat types, we have to "extract" the underlying types before
3794
3801
  // performing validation.
3795
3802
  r = p(r);
3796
3803
  var u = i.it(s);
3797
- if (r instanceof Vn)
3804
+ if (r instanceof kn)
3798
3805
  // Add it to the field mask, but don't add anything to updateData.
3799
3806
  o.push(s); else {
3800
3807
  var c = Ln(r, u);
@@ -3802,22 +3809,22 @@ var Nn = /** @class */ function(e) {
3802
3809
  }
3803
3810
  }));
3804
3811
  var s = new Et(o);
3805
- return new Tn(a, s, i.fieldTransforms);
3812
+ return new _n(a, s, i.fieldTransforms);
3806
3813
  }
3807
3814
 
3808
- /** Parse update data from a list of field/value arguments. */ function Cn(t, e, n, r, i, o) {
3809
- var a = t.ht(1 /* Update */ , e, n), s = [ xn(e, r, n) ], u = [ i ];
3815
+ /** Parse update data from a list of field/value arguments. */ function On(t, e, n, r, i, o) {
3816
+ var a = t.ht(1 /* Update */ , e, n), s = [ Un(e, r, n) ], u = [ i ];
3810
3817
  if (o.length % 2 != 0) throw new U(V, "Function " + e + "() needs to be called with an even number of arguments that alternate between field names and values.");
3811
- for (var c = 0; c < o.length; c += 2) s.push(xn(e, o[c])), u.push(o[c + 1]);
3818
+ for (var c = 0; c < o.length; c += 2) s.push(Un(e, o[c])), u.push(o[c + 1]);
3812
3819
  // We iterate in reverse order to pick the last value for a field if the
3813
3820
  // user specified the field multiple times.
3814
- for (var l = [], f = zt.empty(), h = s.length - 1; h >= 0; --h) if (!Qn(l, s[h])) {
3821
+ for (var l = [], f = zt.empty(), h = s.length - 1; h >= 0; --h) if (!zn(l, s[h])) {
3815
3822
  var d = s[h], m = u[h];
3816
3823
  // For Compat types, we have to "extract" the underlying types before
3817
3824
  // performing validation.
3818
3825
  m = p(m);
3819
3826
  var y = a.it(d);
3820
- if (m instanceof Vn)
3827
+ if (m instanceof kn)
3821
3828
  // Add it to the field mask, but don't add anything to updateData.
3822
3829
  l.push(d); else {
3823
3830
  var v = Ln(m, y);
@@ -3825,7 +3832,7 @@ var Nn = /** @class */ function(e) {
3825
3832
  }
3826
3833
  }
3827
3834
  var g = new Et(l);
3828
- return new Tn(f, g, a.fieldTransforms);
3835
+ return new _n(f, g, a.fieldTransforms);
3829
3836
  }
3830
3837
 
3831
3838
  /**
@@ -3834,7 +3841,7 @@ var Nn = /** @class */ function(e) {
3834
3841
  *
3835
3842
  * @param allowArrays - Whether the query value is an array that may directly
3836
3843
  * contain additional arrays (e.g. the operand of an `in` query).
3837
- */ function jn(t, e, n, r) {
3844
+ */ function Cn(t, e, n, r) {
3838
3845
  return void 0 === r && (r = !1), Ln(n, t.ht(r ? 4 /* ArrayArgument */ : 3 /* Argument */ , e));
3839
3846
  }
3840
3847
 
@@ -3847,11 +3854,11 @@ var Nn = /** @class */ function(e) {
3847
3854
  * @returns The parsed value, or null if the value was a FieldValue sentinel
3848
3855
  * that should not be included in the resulting parsed data.
3849
3856
  */ function Ln(t, e) {
3850
- if (Mn(
3857
+ if (Rn(
3851
3858
  // Unwrap the API type from the Compat SDK. This will return the API type
3852
3859
  // from firestore-exp.
3853
- t = p(t))) return Un("Unsupported field value:", e, t), Rn(t, e);
3854
- if (t instanceof gn)
3860
+ t = p(t))) return Mn("Unsupported field value:", e, t), jn(t, e);
3861
+ if (t instanceof vn)
3855
3862
  // FieldValues usually parse into transforms (except deleteField())
3856
3863
  // in which case we do not want to include this field in our parsed data
3857
3864
  // (as doing so will overwrite the field directly prior to the transform
@@ -3863,7 +3870,7 @@ var Nn = /** @class */ function(e) {
3863
3870
  */
3864
3871
  return function(t, e) {
3865
3872
  // Sentinels are only supported with writes, and not within arrays.
3866
- if (!Sn(e.tt)) throw e.ut(t._methodName + "() can only be used with update() and set()");
3873
+ if (!Tn(e.tt)) throw e.ut(t._methodName + "() can only be used with update() and set()");
3867
3874
  if (!e.path) throw e.ut(t._methodName + "() is not currently supported inside arrays");
3868
3875
  var n = t._toFieldTransform(e);
3869
3876
  n && e.fieldTransforms.push(n);
@@ -3915,7 +3922,7 @@ var Nn = /** @class */ function(e) {
3915
3922
  if (t instanceof Date) {
3916
3923
  var n = bt.fromDate(t);
3917
3924
  return {
3918
- timestampValue: Ne(e.q, n)
3925
+ timestampValue: Pe(e.q, n)
3919
3926
  };
3920
3927
  }
3921
3928
  if (t instanceof bt) {
@@ -3924,19 +3931,19 @@ var Nn = /** @class */ function(e) {
3924
3931
  // truncation immediately without waiting for the backend to do that.
3925
3932
  var r = new bt(t.seconds, 1e3 * Math.floor(t.nanoseconds / 1e3));
3926
3933
  return {
3927
- timestampValue: Ne(e.q, r)
3934
+ timestampValue: Pe(e.q, r)
3928
3935
  };
3929
3936
  }
3930
- if (t instanceof wn) return {
3937
+ if (t instanceof gn) return {
3931
3938
  geoPointValue: {
3932
3939
  latitude: t.latitude,
3933
3940
  longitude: t.longitude
3934
3941
  }
3935
3942
  };
3936
- if (t instanceof vn) return {
3937
- bytesValue: Pe(e.q, t._byteString)
3943
+ if (t instanceof yn) return {
3944
+ bytesValue: Ne(e.q, t._byteString)
3938
3945
  };
3939
- if (t instanceof sn) {
3946
+ if (t instanceof an) {
3940
3947
  var i = e.databaseId, o = t.firestore._databaseId;
3941
3948
  if (!o.isEqual(i)) throw e.ut("Document reference is for database " + o.projectId + "/" + o.database + " but should be for database " + i.projectId + "/" + i.database);
3942
3949
  return {
@@ -3947,7 +3954,7 @@ var Nn = /** @class */ function(e) {
3947
3954
  }(t, e);
3948
3955
  }
3949
3956
 
3950
- function Rn(t, e) {
3957
+ function jn(t, e) {
3951
3958
  var n = {};
3952
3959
  return function(t) {
3953
3960
  for (var e in t) if (Object.prototype.hasOwnProperty.call(t, e)) return !1;
@@ -3956,7 +3963,7 @@ function Rn(t, e) {
3956
3963
  // If we encounter an empty object, we explicitly add it to the update
3957
3964
  // mask to ensure that the server creates a map entry.
3958
3965
  e.path && e.path.length > 0 && e.fieldMask.push(e.path) : St(t, (function(t, r) {
3959
- var i = Ln(r, e.et(t));
3966
+ var i = Ln(r, e.nt(t));
3960
3967
  null != i && (n[t] = i);
3961
3968
  })), {
3962
3969
  mapValue: {
@@ -3965,12 +3972,12 @@ function Rn(t, e) {
3965
3972
  };
3966
3973
  }
3967
3974
 
3968
- function Mn(t) {
3969
- return !("object" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof bt || t instanceof wn || t instanceof vn || t instanceof sn || t instanceof gn);
3975
+ function Rn(t) {
3976
+ return !("object" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof bt || t instanceof gn || t instanceof yn || t instanceof an || t instanceof vn);
3970
3977
  }
3971
3978
 
3972
- function Un(t, e, n) {
3973
- if (!Mn(n) || !function(t) {
3979
+ function Mn(t, e, n) {
3980
+ if (!Rn(n) || !function(t) {
3974
3981
  return "object" == typeof t && null !== t && (Object.getPrototypeOf(t) === Object.prototype || null === Object.getPrototypeOf(t));
3975
3982
  }(n)) {
3976
3983
  var r = at(n);
@@ -3980,20 +3987,20 @@ function Un(t, e, n) {
3980
3987
 
3981
3988
  /**
3982
3989
  * Helper that calls fromDotSeparatedString() but wraps any error thrown.
3983
- */ function xn(t, e, n) {
3990
+ */ function Un(t, e, n) {
3984
3991
  if (
3985
3992
  // If required, replace the FieldPath Compat class with with the firestore-exp
3986
3993
  // FieldPath.
3987
- (e = p(e)) instanceof mn) return e._internalPath;
3988
- if ("string" == typeof e) return Gn(t, e);
3989
- throw zn("Field path arguments must be of type string or ", t,
3994
+ (e = p(e)) instanceof dn) return e._internalPath;
3995
+ if ("string" == typeof e) return Bn(t, e);
3996
+ throw Gn("Field path arguments must be of type string or ", t,
3990
3997
  /* hasConverter= */ !1,
3991
3998
  /* path= */ void 0, n);
3992
3999
  }
3993
4000
 
3994
4001
  /**
3995
4002
  * Matches any characters in a field path string that are reserved.
3996
- */ var Bn = new RegExp("[~\\*/\\[\\]]");
4003
+ */ var xn = new RegExp("[~\\*/\\[\\]]");
3997
4004
 
3998
4005
  /**
3999
4006
  * Wraps fromDotSeparatedString with an error message about the method that
@@ -4003,20 +4010,20 @@ function Un(t, e, n) {
4003
4010
  * split on dots.
4004
4011
  * @param targetDoc - The document against which the field path will be
4005
4012
  * evaluated.
4006
- */ function Gn(t, e, n) {
4007
- if (e.search(Bn) >= 0) throw zn("Invalid field path (" + e + "). Paths must not contain '~', '*', '/', '[', or ']'", t,
4013
+ */ function Bn(t, e, n) {
4014
+ if (e.search(xn) >= 0) throw Gn("Invalid field path (" + e + "). Paths must not contain '~', '*', '/', '[', or ']'", t,
4008
4015
  /* hasConverter= */ !1,
4009
4016
  /* path= */ void 0, n);
4010
4017
  try {
4011
- return (new (mn.bind.apply(mn, r([ void 0 ], e.split(".")))))._internalPath;
4018
+ return (new (dn.bind.apply(dn, r([ void 0 ], e.split(".")))))._internalPath;
4012
4019
  } catch (r) {
4013
- throw zn("Invalid field path (" + e + "). Paths must not be empty, begin with '.', end with '.', or contain '..'", t,
4020
+ throw Gn("Invalid field path (" + e + "). Paths must not be empty, begin with '.', end with '.', or contain '..'", t,
4014
4021
  /* hasConverter= */ !1,
4015
4022
  /* path= */ void 0, n);
4016
4023
  }
4017
4024
  }
4018
4025
 
4019
- function zn(t, e, n, r, i) {
4026
+ function Gn(t, e, n, r, i) {
4020
4027
  var o = r && !r.isEmpty(), a = void 0 !== i, s = "Function " + e + "() called with invalid data";
4021
4028
  n && (s += " (via `toFirestore()`)");
4022
4029
  var u = "";
@@ -4025,7 +4032,7 @@ function zn(t, e, n, r, i) {
4025
4032
  /** Checks `haystack` if FieldPath `needle` is present. Runs in O(n). */;
4026
4033
  }
4027
4034
 
4028
- function Qn(t, e) {
4035
+ function zn(t, e) {
4029
4036
  return t.some((function(t) {
4030
4037
  return t.isEqual(e);
4031
4038
  }));
@@ -4055,7 +4062,7 @@ function Qn(t, e) {
4055
4062
  * For a `DocumentSnapshot` that points to a non-existing document, any data
4056
4063
  * access will return 'undefined'. You can use the `exists()` method to
4057
4064
  * explicitly verify a document's existence.
4058
- */ var Kn = /** @class */ function() {
4065
+ */ var Qn = /** @class */ function() {
4059
4066
  // Note: This class is stripped down version of the DocumentSnapshot in
4060
4067
  // the legacy SDK. The changes are:
4061
4068
  // - No support for SnapshotMetadata.
@@ -4076,7 +4083,7 @@ function Qn(t, e) {
4076
4083
  * The `DocumentReference` for the document included in the `DocumentSnapshot`.
4077
4084
  */
4078
4085
  get: function() {
4079
- return new sn(this._firestore, this._converter, this._key);
4086
+ return new an(this._firestore, this._converter, this._key);
4080
4087
  },
4081
4088
  enumerable: !1,
4082
4089
  configurable: !0
@@ -4101,7 +4108,7 @@ function Qn(t, e) {
4101
4108
  if (this._converter) {
4102
4109
  // We only want to use the converter and create a new DocumentSnapshot
4103
4110
  // if a converter has been provided.
4104
- var t = new Hn(this._firestore, this._userDataWriter, this._key, this._document,
4111
+ var t = new Kn(this._firestore, this._userDataWriter, this._key, this._document,
4105
4112
  /* converter= */ null);
4106
4113
  return this._converter.fromFirestore(t);
4107
4114
  }
@@ -4121,11 +4128,11 @@ function Qn(t, e) {
4121
4128
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4122
4129
  t.prototype.get = function(t) {
4123
4130
  if (this._document) {
4124
- var e = this._document.data.field($n("DocumentSnapshot.get", t));
4131
+ var e = this._document.data.field(Yn("DocumentSnapshot.get", t));
4125
4132
  if (null !== e) return this._userDataWriter.convertValue(e);
4126
4133
  }
4127
4134
  }, t;
4128
- }(), Hn = /** @class */ function(e) {
4135
+ }(), Kn = /** @class */ function(e) {
4129
4136
  function n() {
4130
4137
  return null !== e && e.apply(this, arguments) || this;
4131
4138
  }
@@ -4137,7 +4144,7 @@ function Qn(t, e) {
4137
4144
  */ return t(n, e), n.prototype.data = function() {
4138
4145
  return e.prototype.data.call(this);
4139
4146
  }, n;
4140
- }(Kn), Wn = /** @class */ function() {
4147
+ }(Qn), Hn = /** @class */ function() {
4141
4148
  /** @hideconstructor */
4142
4149
  function t(t, e) {
4143
4150
  this._docs = e, this.query = t;
@@ -4191,15 +4198,15 @@ function Qn(t, e) {
4191
4198
  * @param right - A snapshot to compare.
4192
4199
  * @returns true if the snapshots are equal.
4193
4200
  */
4194
- function Yn(t, e) {
4195
- return t = p(t), e = p(e), t instanceof Kn && e instanceof Kn ? t._firestore === e._firestore && t._key.isEqual(e._key) && (null === t._document ? null === e._document : t._document.isEqual(e._document)) && t._converter === e._converter : t instanceof Wn && e instanceof Wn && dn(t.query, e.query) && wt(t.docs, e.docs, Yn)
4201
+ function Wn(t, e) {
4202
+ return t = p(t), e = p(e), t instanceof Qn && e instanceof Qn ? t._firestore === e._firestore && t._key.isEqual(e._key) && (null === t._document ? null === e._document : t._document.isEqual(e._document)) && t._converter === e._converter : t instanceof Hn && e instanceof Hn && pn(t.query, e.query) && wt(t.docs, e.docs, Wn)
4196
4203
  /**
4197
4204
  * Helper that calls `fromDotSeparatedString()` but wraps any error thrown.
4198
4205
  */;
4199
4206
  }
4200
4207
 
4201
- function $n(t, e) {
4202
- return "string" == typeof e ? Gn(t, e) : e instanceof mn ? e._internalPath : e._delegate._internalPath;
4208
+ function Yn(t, e) {
4209
+ return "string" == typeof e ? Bn(t, e) : e instanceof dn ? e._internalPath : e._delegate._internalPath;
4203
4210
  }
4204
4211
 
4205
4212
  /**
@@ -4225,7 +4232,7 @@ function $n(t, e) {
4225
4232
  * endBefore:1}, {@link (endAt:1)}, {@link limit} or {@link limitToLast} and
4226
4233
  * can then be passed to {@link query} to create a new query instance that
4227
4234
  * also contains this `QueryConstraint`.
4228
- */ var Xn = function() {};
4235
+ */ var $n = function() {};
4229
4236
 
4230
4237
  /**
4231
4238
  * Creates a new immutable instance of {@link Query} that is extended to also include
@@ -4235,7 +4242,7 @@ function $n(t, e) {
4235
4242
  * @param queryConstraints - The list of {@link QueryConstraint}s to apply.
4236
4243
  * @throws if any of the provided query constraints cannot be combined with the
4237
4244
  * existing or new constraints.
4238
- */ function Jn(t) {
4245
+ */ function Xn(t) {
4239
4246
  for (var e = [], n = 1; n < arguments.length; n++) e[n - 1] = arguments[n];
4240
4247
  for (var r = 0, i = e; r < i.length; r++) {
4241
4248
  var o = i[r];
@@ -4244,31 +4251,31 @@ function $n(t, e) {
4244
4251
  return t;
4245
4252
  }
4246
4253
 
4247
- var Zn = /** @class */ function(e) {
4254
+ var Jn = /** @class */ function(e) {
4248
4255
  function n(t, n, r) {
4249
4256
  var i = this;
4250
4257
  return (i = e.call(this) || this).dt = t, i.wt = n, i.yt = r, i.type = "where",
4251
4258
  i;
4252
4259
  }
4253
4260
  return t(n, e), n.prototype._apply = function(t) {
4254
- var e = An(t.firestore), n = function(t, e, n, r, i, o, a) {
4261
+ var e = In(t.firestore), n = function(t, e, n, r, i, o, a) {
4255
4262
  var s;
4256
4263
  if (i.isKeyField()) {
4257
4264
  if ("array-contains" /* ARRAY_CONTAINS */ === o || "array-contains-any" /* ARRAY_CONTAINS_ANY */ === o) throw new U(V, "Invalid Query. You can't perform '" + o + "' queries on documentId().");
4258
4265
  if ("in" /* IN */ === o || "not-in" /* NOT_IN */ === o) {
4259
- dr(a, o);
4266
+ pr(a, o);
4260
4267
  for (var u = [], c = 0, l = a; c < l.length; c++) {
4261
4268
  var f = l[c];
4262
- u.push(pr(r, t, f));
4269
+ u.push(hr(r, t, f));
4263
4270
  }
4264
4271
  s = {
4265
4272
  arrayValue: {
4266
4273
  values: u
4267
4274
  }
4268
4275
  };
4269
- } else s = pr(r, t, a);
4270
- } else "in" /* IN */ !== o && "not-in" /* NOT_IN */ !== o && "array-contains-any" /* ARRAY_CONTAINS_ANY */ !== o || dr(a, o),
4271
- s = jn(n, "where", a,
4276
+ } else s = hr(r, t, a);
4277
+ } else "in" /* IN */ !== o && "not-in" /* NOT_IN */ !== o && "array-contains-any" /* ARRAY_CONTAINS_ANY */ !== o || pr(a, o),
4278
+ s = Cn(n, "where", a,
4272
4279
  /* allowArrays= */ "in" /* IN */ === o || "not-in" /* NOT_IN */ === o);
4273
4280
  var h = Wt.create(i, o, s);
4274
4281
  return function(t, e) {
@@ -4276,7 +4283,7 @@ var Zn = /** @class */ function(e) {
4276
4283
  var n = le(t);
4277
4284
  if (null !== n && !n.isEqual(e.field)) throw new U(V, "Invalid query. All where filters with an inequality (<, <=, !=, not-in, >, or >=) must be on the same field. But you have inequality filters on '" + n.toString() + "' and '" + e.field.toString() + "'");
4278
4285
  var r = ce(t);
4279
- null !== r && mr(t, e.field, r);
4286
+ null !== r && dr(t, e.field, r);
4280
4287
  }
4281
4288
  var i = function(t, e) {
4282
4289
  for (var n = 0, r = t.filters; n < r.length; n++) {
@@ -4323,12 +4330,12 @@ var Zn = /** @class */ function(e) {
4323
4330
  throw i === e.op ? new U(V, "Invalid query. You cannot use more than one '" + e.op.toString() + "' filter.") : new U(V, "Invalid query. You cannot use '" + e.op.toString() + "' filters with '" + i.toString() + "' filters.");
4324
4331
  }(t, h), h;
4325
4332
  }(t._query, 0, e, t.firestore._databaseId, this.dt, this.wt, this.yt);
4326
- return new un(t.firestore, t.converter, function(t, e) {
4333
+ return new sn(t.firestore, t.converter, function(t, e) {
4327
4334
  var n = t.filters.concat([ e ]);
4328
4335
  return new se(t.path, t.collectionGroup, t.explicitOrderBy.slice(), n, t.limit, t.limitType, t.startAt, t.endAt);
4329
4336
  }(t._query, n));
4330
4337
  }, n;
4331
- }(Xn);
4338
+ }($n);
4332
4339
 
4333
4340
  /**
4334
4341
  * Creates a {@link QueryConstraint} that enforces that documents must contain the
@@ -4340,12 +4347,12 @@ var Zn = /** @class */ function(e) {
4340
4347
  * "&lt;=", "!=").
4341
4348
  * @param value - The value for comparison
4342
4349
  * @returns The created {@link Query}.
4343
- */ function tr(t, e, n) {
4344
- var r = e, i = $n("where", t);
4345
- return new Zn(i, r, n);
4350
+ */ function Zn(t, e, n) {
4351
+ var r = e, i = Yn("where", t);
4352
+ return new Jn(i, r, n);
4346
4353
  }
4347
4354
 
4348
- var er = /** @class */ function(e) {
4355
+ var tr = /** @class */ function(e) {
4349
4356
  function n(t, n) {
4350
4357
  var r = this;
4351
4358
  return (r = e.call(this) || this).dt = t, r._t = n, r.type = "orderBy", r;
@@ -4359,17 +4366,17 @@ var er = /** @class */ function(e) {
4359
4366
  if (null === ce(t)) {
4360
4367
  // This is the first order by. It must match any inequality.
4361
4368
  var n = le(t);
4362
- null !== n && mr(t, n, e.field);
4369
+ null !== n && dr(t, n, e.field);
4363
4370
  }
4364
4371
  }(t, r), r;
4365
4372
  }(t._query, this.dt, this._t);
4366
- return new un(t.firestore, t.converter, function(t, e) {
4373
+ return new sn(t.firestore, t.converter, function(t, e) {
4367
4374
  // TODO(dimond): validate that orderBy does not list the same key twice.
4368
4375
  var n = t.explicitOrderBy.concat([ e ]);
4369
4376
  return new se(t.path, t.collectionGroup, n, t.filters.slice(), t.limit, t.limitType, t.startAt, t.endAt);
4370
4377
  }(t._query, e));
4371
4378
  }, n;
4372
- }(Xn);
4379
+ }($n);
4373
4380
 
4374
4381
  /**
4375
4382
  * Creates a {@link QueryConstraint} that sorts the query result by the
@@ -4379,31 +4386,31 @@ var er = /** @class */ function(e) {
4379
4386
  * @param directionStr - Optional direction to sort by ('asc' or 'desc'). If
4380
4387
  * not specified, order will be ascending.
4381
4388
  * @returns The created {@link Query}.
4382
- */ function nr(t, e) {
4389
+ */ function er(t, e) {
4383
4390
  void 0 === e && (e = "asc");
4384
- var n = e, r = $n("orderBy", t);
4385
- return new er(r, n);
4391
+ var n = e, r = Yn("orderBy", t);
4392
+ return new tr(r, n);
4386
4393
  }
4387
4394
 
4388
- var rr = /** @class */ function(e) {
4395
+ var nr = /** @class */ function(e) {
4389
4396
  function n(t, n, r) {
4390
4397
  var i = this;
4391
- return (i = e.call(this) || this).type = t, i.gt = n, i.vt = r, i;
4398
+ return (i = e.call(this) || this).type = t, i.gt = n, i.bt = r, i;
4392
4399
  }
4393
4400
  return t(n, e), n.prototype._apply = function(t) {
4394
- return new un(t.firestore, t.converter, function(t, e, n) {
4401
+ return new sn(t.firestore, t.converter, function(t, e, n) {
4395
4402
  return new se(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), e, n, t.startAt, t.endAt);
4396
- }(t._query, this.gt, this.vt));
4403
+ }(t._query, this.gt, this.bt));
4397
4404
  }, n;
4398
- }(Xn);
4405
+ }($n);
4399
4406
 
4400
4407
  /**
4401
4408
  * Creates a {@link QueryConstraint} that only returns the first matching documents.
4402
4409
  *
4403
4410
  * @param limit - The maximum number of items to return.
4404
4411
  * @returns The created {@link Query}.
4405
- */ function ir(t) {
4406
- return ut("limit", t), new rr("limit", t, "F" /* First */)
4412
+ */ function rr(t) {
4413
+ return ut("limit", t), new nr("limit", t, "F" /* First */)
4407
4414
  /**
4408
4415
  * Creates a {@link QueryConstraint} that only returns the last matching documents.
4409
4416
  *
@@ -4415,60 +4422,62 @@ var rr = /** @class */ function(e) {
4415
4422
  */;
4416
4423
  }
4417
4424
 
4418
- function or(t) {
4419
- return ut("limitToLast", t), new rr("limitToLast", t, "L" /* Last */);
4425
+ function ir(t) {
4426
+ return ut("limitToLast", t), new nr("limitToLast", t, "L" /* Last */);
4420
4427
  }
4421
4428
 
4422
- var ar = /** @class */ function(e) {
4429
+ var or = /** @class */ function(e) {
4423
4430
  function n(t, n, r) {
4424
4431
  var i = this;
4425
- return (i = e.call(this) || this).type = t, i.bt = n, i.Et = r, i;
4432
+ return (i = e.call(this) || this).type = t, i.vt = n, i.Et = r, i;
4426
4433
  }
4427
4434
  return t(n, e), n.prototype._apply = function(t) {
4428
- var e = hr(t, this.type, this.bt, this.Et);
4429
- return new un(t.firestore, t.converter, function(t, e) {
4435
+ var e = fr(t, this.type, this.vt, this.Et);
4436
+ return new sn(t.firestore, t.converter, function(t, e) {
4430
4437
  return new se(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, e, t.endAt);
4431
4438
  }(t._query, e));
4432
4439
  }, n;
4433
- }(Xn);
4440
+ }($n);
4434
4441
 
4435
- function sr() {
4442
+ function ar() {
4436
4443
  for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
4437
- return new ar("startAt", t, /*before=*/ !0);
4444
+ return new or("startAt", t,
4445
+ /*inclusive=*/ !0);
4438
4446
  }
4439
4447
 
4440
- function ur() {
4448
+ function sr() {
4441
4449
  for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
4442
- return new ar("startAfter", t,
4443
- /*before=*/ !1);
4450
+ return new or("startAfter", t,
4451
+ /*inclusive=*/ !1);
4444
4452
  }
4445
4453
 
4446
- var cr = /** @class */ function(e) {
4454
+ var ur = /** @class */ function(e) {
4447
4455
  function n(t, n, r) {
4448
4456
  var i = this;
4449
- return (i = e.call(this) || this).type = t, i.bt = n, i.Et = r, i;
4457
+ return (i = e.call(this) || this).type = t, i.vt = n, i.Et = r, i;
4450
4458
  }
4451
4459
  return t(n, e), n.prototype._apply = function(t) {
4452
- var e = hr(t, this.type, this.bt, this.Et);
4453
- return new un(t.firestore, t.converter, function(t, e) {
4460
+ var e = fr(t, this.type, this.vt, this.Et);
4461
+ return new sn(t.firestore, t.converter, function(t, e) {
4454
4462
  return new se(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, t.startAt, e);
4455
4463
  }(t._query, e));
4456
4464
  }, n;
4457
- }(Xn);
4465
+ }($n);
4458
4466
 
4459
- function lr() {
4467
+ function cr() {
4460
4468
  for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
4461
- return new cr("endBefore", t, /*before=*/ !0);
4469
+ return new ur("endBefore", t,
4470
+ /*inclusive=*/ !1);
4462
4471
  }
4463
4472
 
4464
- function fr() {
4473
+ function lr() {
4465
4474
  for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
4466
- return new cr("endAt", t, /*before=*/ !1);
4475
+ return new ur("endAt", t, /*inclusive=*/ !0);
4467
4476
  }
4468
4477
 
4469
- /** Helper function to create a bound from a document or fields */ function hr(t, e, n, r) {
4470
- if (n[0] = p(n[0]), n[0] instanceof Kn) return function(t, e, n, r, i) {
4471
- if (!r) throw new U(N, "Can't use a DocumentSnapshot that doesn't exist for " + n + "().");
4478
+ /** Helper function to create a bound from a document or fields */ function fr(t, e, n, r) {
4479
+ if (n[0] = p(n[0]), n[0] instanceof Qn) return function(t, e, n, r, i) {
4480
+ if (!r) throw new U(P, "Can't use a DocumentSnapshot that doesn't exist for " + n + "().");
4472
4481
  // Because people expect to continue/end a query at the exact document
4473
4482
  // provided, we need to use the implicit sort order rather than the explicit
4474
4483
  // sort order, because it's guaranteed to contain the document key. That way
@@ -4480,7 +4489,7 @@ function fr() {
4480
4489
  var u = s[a];
4481
4490
  if (u.field.isKeyField()) o.push(Rt(e, r.key)); else {
4482
4491
  var c = r.data.field(u.field);
4483
- if (Nt(c)) throw new U(V, 'Invalid query. You are trying to start or end a query using a document for which the field "' + u.field + '" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');
4492
+ if (Pt(c)) throw new U(V, 'Invalid query. You are trying to start or end a query using a document for which the field "' + u.field + '" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');
4484
4493
  if (null === c) {
4485
4494
  var l = u.field.canonicalString();
4486
4495
  throw new U(V, "Invalid query. You are trying to start or end a query using a document for which the field '" + l + "' (used as the orderBy) does not exist.");
@@ -4490,7 +4499,7 @@ function fr() {
4490
4499
  }
4491
4500
  return new re(o, i);
4492
4501
  }(t._query, t.firestore._databaseId, e, n[0]._document, r);
4493
- var i = An(t.firestore);
4502
+ var i = In(t.firestore);
4494
4503
  return function(t, e, n, r, i, o) {
4495
4504
  // Use explicit order by's because it has to match the query the user made
4496
4505
  var a = t.explicitOrderBy;
@@ -4505,7 +4514,7 @@ function fr() {
4505
4514
  var f = new nt(l);
4506
4515
  s.push(Rt(e, f));
4507
4516
  } else {
4508
- var h = jn(n, r, c);
4517
+ var h = Cn(n, r, c);
4509
4518
  s.push(h);
4510
4519
  }
4511
4520
  }
@@ -4513,7 +4522,7 @@ function fr() {
4513
4522
  }(t._query, t.firestore._databaseId, i, e, n, r);
4514
4523
  }
4515
4524
 
4516
- function pr(t, e, n) {
4525
+ function hr(t, e, n) {
4517
4526
  if ("string" == typeof (n = p(n))) {
4518
4527
  if ("" === n) throw new U(V, "Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");
4519
4528
  if (!fe(e) && -1 !== n.indexOf("/")) throw new U(V, "Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '" + n + "' contains a '/' character.");
@@ -4521,19 +4530,19 @@ function pr(t, e, n) {
4521
4530
  if (!nt.isDocumentKey(r)) throw new U(V, "Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '" + r + "' is not because it has an odd number of segments (" + r.length + ").");
4522
4531
  return Rt(t, new nt(r));
4523
4532
  }
4524
- if (n instanceof sn) return Rt(t, n._key);
4533
+ if (n instanceof an) return Rt(t, n._key);
4525
4534
  throw new U(V, "Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: " + at(n) + ".");
4526
4535
  }
4527
4536
 
4528
4537
  /**
4529
4538
  * Validates that the value passed into a disjunctive filter satisfies all
4530
4539
  * array requirements.
4531
- */ function dr(t, e) {
4540
+ */ function pr(t, e) {
4532
4541
  if (!Array.isArray(t) || 0 === t.length) throw new U(V, "Invalid Query. A non-empty array is required for '" + e.toString() + "' filters.");
4533
4542
  if (t.length > 10) throw new U(V, "Invalid Query. '" + e.toString() + "' filters support a maximum of 10 elements in the value array.");
4534
4543
  }
4535
4544
 
4536
- function mr(t, e, n) {
4545
+ function dr(t, e, n) {
4537
4546
  if (!n.isEqual(e)) throw new U(V, "Invalid query. You have a where filter with an inequality (<, <=, !=, not-in, >, or >=) on field '" + e.toString() + "' and so you must also use '" + e.toString() + "' as your first argument to orderBy(), but your first orderBy() is on field '" + n.toString() + "' instead.");
4538
4547
  }
4539
4548
 
@@ -4583,23 +4592,23 @@ function mr(t, e, n) {
4583
4592
  * because we want to provide the user with a more specific error message if
4584
4593
  * their `set()` or fails due to invalid data originating from a `toFirestore()`
4585
4594
  * call.
4586
- */ function yr(t, e, n) {
4595
+ */ function mr(t, e, n) {
4587
4596
  // Cast to `any` in order to satisfy the union type constraint on
4588
4597
  // toFirestore().
4589
4598
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4590
4599
  return t ? n && (n.merge || n.mergeFields) ? t.toFirestore(e, n) : t.toFirestore(e) : e;
4591
4600
  }
4592
4601
 
4593
- var vr = /** @class */ function(e) {
4602
+ var yr = /** @class */ function(e) {
4594
4603
  function n(t) {
4595
4604
  var n = this;
4596
4605
  return (n = e.call(this) || this).firestore = t, n;
4597
4606
  }
4598
4607
  return t(n, e), n.prototype.convertBytes = function(t) {
4599
- return new vn(t);
4608
+ return new yn(t);
4600
4609
  }, n.prototype.convertReference = function(t) {
4601
4610
  var e = this.convertDocumentKey(t, this.firestore._databaseId);
4602
- return new sn(this.firestore, /* converter= */ null, e);
4611
+ return new an(this.firestore, /* converter= */ null, e);
4603
4612
  }, n;
4604
4613
  }(/** @class */ function() {
4605
4614
  function t() {}
@@ -4647,7 +4656,7 @@ var vr = /** @class */ function(e) {
4647
4656
  r[t] = n.convertValue(i, e);
4648
4657
  })), r;
4649
4658
  }, t.prototype.convertGeoPoint = function(t) {
4650
- return new wn(Vt(t.latitude), Vt(t.longitude));
4659
+ return new gn(Vt(t.latitude), Vt(t.longitude));
4651
4660
  }, t.prototype.convertArray = function(t, e) {
4652
4661
  var n = this;
4653
4662
  return (t.values || []).map((function(t) {
@@ -4656,7 +4665,7 @@ var vr = /** @class */ function(e) {
4656
4665
  }, t.prototype.convertServerTimestamp = function(t, e) {
4657
4666
  switch (e) {
4658
4667
  case "previous":
4659
- var n = Pt(t);
4668
+ var n = Nt(t);
4660
4669
  return null == n ? null : this.convertValue(n, e);
4661
4670
 
4662
4671
  case "estimate":
@@ -4670,7 +4679,7 @@ var vr = /** @class */ function(e) {
4670
4679
  return new bt(e.seconds, e.nanos);
4671
4680
  }, t.prototype.convertDocumentKey = function(t, e) {
4672
4681
  var n = Z.fromString(t);
4673
- E(Qe(n));
4682
+ E(ze(n));
4674
4683
  var r = new X(n.get(1), n.get(3)), i = new nt(n.popFirst(5));
4675
4684
  return r.isEqual(e) ||
4676
4685
  // TODO(b/64130202): Somehow support foreign references.
@@ -4691,12 +4700,12 @@ var vr = /** @class */ function(e) {
4691
4700
  * @param reference - The reference of the document to fetch.
4692
4701
  * @returns A Promise resolved with a `DocumentSnapshot` containing the current
4693
4702
  * document contents.
4694
- */ function gr(t) {
4695
- var e = Ze((t = st(t, sn)).firestore), n = new vr(t.firestore);
4696
- return $e(e, [ t._key ]).then((function(e) {
4703
+ */ function vr(t) {
4704
+ var e = Je((t = st(t, an)).firestore), n = new yr(t.firestore);
4705
+ return Ye(e, [ t._key ]).then((function(e) {
4697
4706
  E(1 === e.length);
4698
4707
  var r = e[0];
4699
- return new Kn(t.firestore, n, t._key, r.isFoundDocument() ? r : null, t.converter);
4708
+ return new Qn(t.firestore, n, t._key, r.isFoundDocument() ? r : null, t.converter);
4700
4709
  }));
4701
4710
  }
4702
4711
 
@@ -4711,35 +4720,35 @@ var vr = /** @class */ function(e) {
4711
4720
  *
4712
4721
  * @param query - The `Query` to execute.
4713
4722
  * @returns A Promise that will be resolved with the results of the query.
4714
- */ function wr(t) {
4723
+ */ function gr(t) {
4715
4724
  !function(t) {
4716
- if (ue(t) && 0 === t.explicitOrderBy.length) throw new U(L, "limitToLast() queries require specifying at least one orderBy() clause");
4717
- }((t = st(t, un))._query);
4718
- var e = Ze(t.firestore), n = new vr(t.firestore);
4719
- return Xe(e, t._query).then((function(e) {
4725
+ if (ue(t) && 0 === t.explicitOrderBy.length) throw new U(j, "limitToLast() queries require specifying at least one orderBy() clause");
4726
+ }((t = st(t, sn))._query);
4727
+ var e = Je(t.firestore), n = new yr(t.firestore);
4728
+ return $e(e, t._query).then((function(e) {
4720
4729
  var r = e.map((function(e) {
4721
- return new Hn(t.firestore, n, e.key, e, t.converter);
4730
+ return new Kn(t.firestore, n, e.key, e, t.converter);
4722
4731
  }));
4723
4732
  return ue(t._query) &&
4724
4733
  // Limit to last queries reverse the orderBy constraint that was
4725
4734
  // specified by the user. As such, we need to reverse the order of the
4726
4735
  // results to return the documents in the expected order.
4727
- r.reverse(), new Wn(t, r);
4736
+ r.reverse(), new Hn(t, r);
4728
4737
  }));
4729
4738
  }
4730
4739
 
4731
- function br(t, e, n) {
4732
- var r = yr((t = st(t, sn)).converter, e, n), i = kn(An(t.firestore), "setDoc", t._key, r, null !== t.converter, n);
4733
- return Ye(Ze(t.firestore), [ i.toMutation(t._key, _e.none()) ]);
4740
+ function wr(t, e, n) {
4741
+ var r = mr((t = st(t, an)).converter, e, n), i = An(In(t.firestore), "setDoc", t._key, r, null !== t.converter, n);
4742
+ return We(Je(t.firestore), [ i.toMutation(t._key, _e.none()) ]);
4734
4743
  }
4735
4744
 
4736
- function _r(t, e, n) {
4745
+ function br(t, e, n) {
4737
4746
  for (var r = [], i = 3; i < arguments.length; i++) r[i - 3] = arguments[i];
4738
- var o, a = An((t = st(t, sn)).firestore);
4747
+ var o, a = In((t = st(t, an)).firestore);
4739
4748
  // For Compat types, we have to "extract" the underlying types before
4740
4749
  // performing validation.
4741
- return o = "string" == typeof (e = p(e)) || e instanceof mn ? Cn(a, "updateDoc", t._key, e, n, r) : On(a, "updateDoc", t._key, e),
4742
- Ye(Ze(t.firestore), [ o.toMutation(t._key, _e.exists(!0)) ]);
4750
+ return o = "string" == typeof (e = p(e)) || e instanceof dn ? On(a, "updateDoc", t._key, e, n, r) : Fn(a, "updateDoc", t._key, e),
4751
+ We(Je(t.firestore), [ o.toMutation(t._key, _e.exists(!0)) ]);
4743
4752
  }
4744
4753
 
4745
4754
  /**
@@ -4753,8 +4762,8 @@ function _r(t, e, n) {
4753
4762
  * @param reference - A reference to the document to delete.
4754
4763
  * @returns A `Promise` resolved once the document has been successfully
4755
4764
  * deleted from the backend.
4756
- */ function Tr(t) {
4757
- return Ye(Ze((t = st(t, sn)).firestore), [ new Ie(t._key, _e.none()) ]);
4765
+ */ function _r(t) {
4766
+ return We(Je((t = st(t, an)).firestore), [ new Ie(t._key, _e.none()) ]);
4758
4767
  }
4759
4768
 
4760
4769
  /**
@@ -4771,9 +4780,9 @@ function _r(t, e, n) {
4771
4780
  * @throws Error - If the provided input is not a valid Firestore document.
4772
4781
  * @returns A `Promise` resolved with a `DocumentReference` pointing to the
4773
4782
  * newly created document after it has been written to the backend.
4774
- */ function Sr(t, e) {
4775
- var n = hn(t = st(t, cn)), r = yr(t.converter, e), i = kn(An(t.firestore), "addDoc", n._key, r, null !== n.converter, {});
4776
- return Ye(Ze(t.firestore), [ i.toMutation(n._key, _e.exists(!1)) ]).then((function() {
4783
+ */ function Tr(t, e) {
4784
+ var n = fn(t = st(t, un)), r = mr(t.converter, e), i = An(In(t.firestore), "addDoc", n._key, r, null !== n.converter, {});
4785
+ return We(Je(t.firestore), [ i.toMutation(n._key, _e.exists(!1)) ]).then((function() {
4777
4786
  return n;
4778
4787
  }));
4779
4788
  }
@@ -4797,15 +4806,15 @@ function _r(t, e, n) {
4797
4806
  /**
4798
4807
  * Returns a sentinel for use with {@link @firebase/firestore/lite#(updateDoc:1)} or
4799
4808
  * {@link @firebase/firestore/lite#(setDoc:1)} with `{merge: true}` to mark a field for deletion.
4800
- */ function Er() {
4801
- return new Vn("deleteField");
4809
+ */ function Sr() {
4810
+ return new kn("deleteField");
4802
4811
  }
4803
4812
 
4804
4813
  /**
4805
4814
  * Returns a sentinel used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link @firebase/firestore/lite#(updateDoc:1)} to
4806
4815
  * include a server-generated timestamp in the written data.
4807
- */ function Ir() {
4808
- return new Nn("serverTimestamp");
4816
+ */ function Er() {
4817
+ return new Dn("serverTimestamp");
4809
4818
  }
4810
4819
 
4811
4820
  /**
@@ -4819,7 +4828,7 @@ function _r(t, e, n) {
4819
4828
  * @param elements - The elements to union into the array.
4820
4829
  * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or
4821
4830
  * `updateDoc()`.
4822
- */ function Ar() {
4831
+ */ function Ir() {
4823
4832
  for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
4824
4833
  // NOTE: We don't actually parse the data until it's used in set() or
4825
4834
  // update() since we'd need the Firestore instance to do this.
@@ -4836,11 +4845,11 @@ function _r(t, e, n) {
4836
4845
  * @param elements - The elements to remove from the array.
4837
4846
  * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or
4838
4847
  * `updateDoc()`
4839
- */ function kr() {
4848
+ */ function Ar() {
4840
4849
  for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
4841
4850
  // NOTE: We don't actually parse the data until it's used in set() or
4842
4851
  // update() since we'd need the Firestore instance to do this.
4843
- return new qn("arrayRemove", t);
4852
+ return new Nn("arrayRemove", t);
4844
4853
  }
4845
4854
 
4846
4855
  /**
@@ -4861,8 +4870,8 @@ function _r(t, e, n) {
4861
4870
  * @param n - The value to increment by.
4862
4871
  * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or
4863
4872
  * `updateDoc()`
4864
- */ function Vr(t) {
4865
- return new Fn("increment", t);
4873
+ */ function kr(t) {
4874
+ return new qn("increment", t);
4866
4875
  }
4867
4876
 
4868
4877
  /**
@@ -4888,23 +4897,23 @@ function _r(t, e, n) {
4888
4897
  * provides methods for adding writes to the write batch. None of the writes
4889
4898
  * will be committed (or visible locally) until {@link WriteBatch.commit} is
4890
4899
  * called.
4891
- */ var Dr = /** @class */ function() {
4900
+ */ var Vr = /** @class */ function() {
4892
4901
  /** @hideconstructor */
4893
4902
  function t(t, e) {
4894
4903
  this._firestore = t, this._commitHandler = e, this._mutations = [], this._committed = !1,
4895
- this._dataReader = An(t);
4904
+ this._dataReader = In(t);
4896
4905
  }
4897
4906
  return t.prototype.set = function(t, e, n) {
4898
4907
  this._verifyNotCommitted();
4899
- var r = Nr(t, this._firestore), i = yr(r.converter, e, n), o = kn(this._dataReader, "WriteBatch.set", r._key, i, null !== r.converter, n);
4908
+ var r = Dr(t, this._firestore), i = mr(r.converter, e, n), o = An(this._dataReader, "WriteBatch.set", r._key, i, null !== r.converter, n);
4900
4909
  return this._mutations.push(o.toMutation(r._key, _e.none())), this;
4901
4910
  }, t.prototype.update = function(t, e, n) {
4902
4911
  for (var r = [], i = 3; i < arguments.length; i++) r[i - 3] = arguments[i];
4903
4912
  this._verifyNotCommitted();
4904
- var o, a = Nr(t, this._firestore);
4913
+ var o, a = Dr(t, this._firestore);
4905
4914
  // For Compat types, we have to "extract" the underlying types before
4906
4915
  // performing validation.
4907
- return o = "string" == typeof (e = p(e)) || e instanceof mn ? Cn(this._dataReader, "WriteBatch.update", a._key, e, n, r) : On(this._dataReader, "WriteBatch.update", a._key, e),
4916
+ return o = "string" == typeof (e = p(e)) || e instanceof dn ? On(this._dataReader, "WriteBatch.update", a._key, e, n, r) : Fn(this._dataReader, "WriteBatch.update", a._key, e),
4908
4917
  this._mutations.push(o.toMutation(a._key, _e.exists(!0))), this;
4909
4918
  },
4910
4919
  /**
@@ -4915,7 +4924,7 @@ function _r(t, e, n) {
4915
4924
  */
4916
4925
  t.prototype.delete = function(t) {
4917
4926
  this._verifyNotCommitted();
4918
- var e = Nr(t, this._firestore);
4927
+ var e = Dr(t, this._firestore);
4919
4928
  return this._mutations = this._mutations.concat(new Ie(e._key, _e.none())), this;
4920
4929
  },
4921
4930
  /**
@@ -4937,7 +4946,7 @@ function _r(t, e, n) {
4937
4946
  }, t;
4938
4947
  }();
4939
4948
 
4940
- function Nr(t, e) {
4949
+ function Dr(t, e) {
4941
4950
  if ((t = p(t)).firestore !== e) throw new U(V, "Provided document reference is from a different Firestore instance.");
4942
4951
  return t;
4943
4952
  }
@@ -4955,9 +4964,9 @@ function Nr(t, e) {
4955
4964
  * @returns A `WriteBatch` that can be used to atomically execute multiple
4956
4965
  * writes.
4957
4966
  */ function Pr(t) {
4958
- var e = Ze(t = st(t, en));
4959
- return new Dr(t, (function(t) {
4960
- return Ye(e, t);
4967
+ var e = Je(t = st(t, tn));
4968
+ return new Vr(t, (function(t) {
4969
+ return We(e, t);
4961
4970
  }));
4962
4971
  }
4963
4972
 
@@ -4980,7 +4989,7 @@ function Nr(t, e) {
4980
4989
  /**
4981
4990
  * Internal transaction object responsible for accumulating the mutations to
4982
4991
  * perform and the base versions for any documents read.
4983
- */ var qr = /** @class */ function() {
4992
+ */ var Nr = /** @class */ function() {
4984
4993
  function t(t) {
4985
4994
  this.datastore = t,
4986
4995
  // The version of each document that was read during this transaction.
@@ -5005,7 +5014,7 @@ function Nr(t, e) {
5005
5014
  switch (n.label) {
5006
5015
  case 0:
5007
5016
  if (this.ensureCommitNotCalled(), this.mutations.length > 0) throw new U(V, "Firestore transactions require all reads to be executed before all writes.");
5008
- return [ 4 /*yield*/ , $e(this.datastore, t) ];
5017
+ return [ 4 /*yield*/ , Ye(this.datastore, t) ];
5009
5018
 
5010
5019
  case 1:
5011
5020
  return [ 2 /*return*/ , ((e = n.sent()).forEach((function(t) {
@@ -5042,7 +5051,7 @@ function Nr(t, e) {
5042
5051
  t.forEach((function(t, n) {
5043
5052
  var r = nt.fromPath(n);
5044
5053
  e.mutations.push(new Ae(r, e.precondition(r)));
5045
- })), [ 4 /*yield*/ , Ye(this.datastore, this.mutations) ];
5054
+ })), [ 4 /*yield*/ , We(this.datastore, this.mutations) ];
5046
5055
 
5047
5056
  case 1:
5048
5057
  // For each mutation, note that the doc was written.
@@ -5100,10 +5109,10 @@ function Nr(t, e) {
5100
5109
  }, t.prototype.write = function(t) {
5101
5110
  this.ensureCommitNotCalled(), this.mutations.push(t);
5102
5111
  }, t.prototype.ensureCommitNotCalled = function() {}, t;
5103
- }(), Fr = /** @class */ function() {
5112
+ }(), qr = /** @class */ function() {
5104
5113
  function t(t, e, n, r) {
5105
5114
  this.asyncQueue = t, this.datastore = e, this.updateFunction = n, this.deferred = r,
5106
- this.Tt = 5, this.It = new He(this.asyncQueue, "transaction_retry" /* TransactionRetry */)
5115
+ this.Tt = 5, this.It = new Ke(this.asyncQueue, "transaction_retry" /* TransactionRetry */)
5107
5116
  /** Runs the transaction and sets the result on deferred. */;
5108
5117
  }
5109
5118
  return t.prototype.run = function() {
@@ -5114,7 +5123,7 @@ function Nr(t, e) {
5114
5123
  return e(t, void 0, void 0, (function() {
5115
5124
  var t, e, r = this;
5116
5125
  return n(this, (function(n) {
5117
- return t = new qr(this.datastore), (e = this.Rt(t)) && e.then((function(e) {
5126
+ return t = new Nr(this.datastore), (e = this.Rt(t)) && e.then((function(e) {
5118
5127
  r.asyncQueue.enqueueAndForget((function() {
5119
5128
  return t.commit().then((function() {
5120
5129
  r.deferred.resolve(e);
@@ -5171,16 +5180,16 @@ function Nr(t, e) {
5171
5180
  return !1;
5172
5181
 
5173
5182
  case V:
5174
- case N:
5175
- case "already-exists":
5176
5183
  case P:
5184
+ case "already-exists":
5185
+ case N:
5177
5186
  case O:
5178
5187
  // Aborted might be retried in some scenarios, but that is dependant on
5179
5188
  // the context and should handled individually by the calling code.
5180
5189
  // See https://cloud.google.com/apis/design/errors.
5181
5190
  case C:
5182
- case j:
5183
5191
  case L:
5192
+ case j:
5184
5193
  case "data-loss":
5185
5194
  return !0;
5186
5195
  }
@@ -5226,7 +5235,7 @@ function Nr(t, e) {
5226
5235
  * See the License for the specific language governing permissions and
5227
5236
  * limitations under the License.
5228
5237
  */
5229
- /** The Platform's 'document' implementation or null if not available. */ function Or() {
5238
+ /** The Platform's 'document' implementation or null if not available. */ function Fr() {
5230
5239
  // `document` is not always available, e.g. in ReactNative and WebWorkers.
5231
5240
  // eslint-disable-next-line no-restricted-globals
5232
5241
  return "undefined" != typeof document ? document : null;
@@ -5258,7 +5267,7 @@ function Nr(t, e) {
5258
5267
  * Note: We implement `PromiseLike` instead of `Promise`, as the `Promise` type
5259
5268
  * in newer versions of TypeScript defines `finally`, which is not available in
5260
5269
  * IE.
5261
- */ var Cr = /** @class */ function() {
5270
+ */ var Or = /** @class */ function() {
5262
5271
  function t(t, e, n, r, i) {
5263
5272
  this.asyncQueue = t, this.timerId = e, this.targetTimeMs = n, this.op = r, this.removalCallback = i,
5264
5273
  this.deferred = new x, this.then = this.deferred.promise.then.bind(this.deferred.promise),
@@ -5322,7 +5331,7 @@ function Nr(t, e) {
5322
5331
  null !== this.timerHandle && (this.removalCallback(this), clearTimeout(this.timerHandle),
5323
5332
  this.timerHandle = null);
5324
5333
  }, t;
5325
- }(), jr = /** @class */ function() {
5334
+ }(), Cr = /** @class */ function() {
5326
5335
  function t() {
5327
5336
  var t = this;
5328
5337
  // The last promise in the queue.
@@ -5346,15 +5355,15 @@ function Nr(t, e) {
5346
5355
  // List of TimerIds to fast-forward delays for.
5347
5356
  this.Ot = [],
5348
5357
  // Backoff timer used to schedule retries for retryable operations
5349
- this.It = new He(this, "async_queue_retry" /* AsyncQueueRetry */),
5358
+ this.It = new Ke(this, "async_queue_retry" /* AsyncQueueRetry */),
5350
5359
  // Visibility handler that triggers an immediate retry of all retryable
5351
5360
  // operations. Meant to speed up recovery when we regain file system access
5352
5361
  // after page comes into foreground.
5353
5362
  this.Ct = function() {
5354
- var e = Or();
5363
+ var e = Fr();
5355
5364
  e && w("AsyncQueue", "Visibility state changed to " + e.visibilityState), t.It.H();
5356
5365
  };
5357
- var e = Or();
5366
+ var e = Fr();
5358
5367
  e && "function" == typeof e.addEventListener && e.addEventListener("visibilitychange", this.Ct);
5359
5368
  }
5360
5369
  return Object.defineProperty(t.prototype, "isShuttingDown", {
@@ -5378,7 +5387,7 @@ function Nr(t, e) {
5378
5387
  }, t.prototype.enterRestrictedMode = function(t) {
5379
5388
  if (!this.$t) {
5380
5389
  this.$t = !0, this.qt = t || !1;
5381
- var e = Or();
5390
+ var e = Fr();
5382
5391
  e && "function" == typeof e.removeEventListener && e.removeEventListener("visibilitychange", this.Ct);
5383
5392
  }
5384
5393
  }, t.prototype.enqueue = function(t) {
@@ -5476,7 +5485,7 @@ function Nr(t, e) {
5476
5485
  this.Lt(),
5477
5486
  // Fast-forward delays for timerIds that have been overriden.
5478
5487
  this.Ot.indexOf(t) > -1 && (e = 0);
5479
- var i = Cr.createAndSchedule(this, t, e, n, (function(t) {
5488
+ var i = Or.createAndSchedule(this, t, e, n, (function(t) {
5480
5489
  return r.jt(t);
5481
5490
  }));
5482
5491
  return this.St.push(i), i;
@@ -5554,7 +5563,7 @@ function Nr(t, e) {
5554
5563
  }(), Lr = /** @class */ function() {
5555
5564
  /** @hideconstructor */
5556
5565
  function t(t, e) {
5557
- this._firestore = t, this._transaction = e, this._dataReader = An(t)
5566
+ this._firestore = t, this._transaction = e, this._dataReader = In(t)
5558
5567
  /**
5559
5568
  * Reads the document referenced by the provided {@link DocumentReference}.
5560
5569
  *
@@ -5563,23 +5572,23 @@ function Nr(t, e) {
5563
5572
  */;
5564
5573
  }
5565
5574
  return t.prototype.get = function(t) {
5566
- var e = this, n = Nr(t, this._firestore), r = new vr(this._firestore);
5575
+ var e = this, n = Dr(t, this._firestore), r = new yr(this._firestore);
5567
5576
  return this._transaction.lookup([ n._key ]).then((function(t) {
5568
5577
  if (!t || 1 !== t.length) return S();
5569
5578
  var i = t[0];
5570
- if (i.isFoundDocument()) return new Kn(e._firestore, r, i.key, i, n.converter);
5571
- if (i.isNoDocument()) return new Kn(e._firestore, r, n._key, null, n.converter);
5579
+ if (i.isFoundDocument()) return new Qn(e._firestore, r, i.key, i, n.converter);
5580
+ if (i.isNoDocument()) return new Qn(e._firestore, r, n._key, null, n.converter);
5572
5581
  throw S();
5573
5582
  }));
5574
5583
  }, t.prototype.set = function(t, e, n) {
5575
- var r = Nr(t, this._firestore), i = yr(r.converter, e, n), o = kn(this._dataReader, "Transaction.set", r._key, i, null !== r.converter, n);
5584
+ var r = Dr(t, this._firestore), i = mr(r.converter, e, n), o = An(this._dataReader, "Transaction.set", r._key, i, null !== r.converter, n);
5576
5585
  return this._transaction.set(r._key, o), this;
5577
5586
  }, t.prototype.update = function(t, e, n) {
5578
5587
  for (var r = [], i = 3; i < arguments.length; i++) r[i - 3] = arguments[i];
5579
- var o, a = Nr(t, this._firestore);
5588
+ var o, a = Dr(t, this._firestore);
5580
5589
  // For Compat types, we have to "extract" the underlying types before
5581
5590
  // performing validation.
5582
- return o = "string" == typeof (e = p(e)) || e instanceof mn ? Cn(this._dataReader, "Transaction.update", a._key, e, n, r) : On(this._dataReader, "Transaction.update", a._key, e),
5591
+ return o = "string" == typeof (e = p(e)) || e instanceof dn ? On(this._dataReader, "Transaction.update", a._key, e, n, r) : Fn(this._dataReader, "Transaction.update", a._key, e),
5583
5592
  this._transaction.update(a._key, o), this;
5584
5593
  },
5585
5594
  /**
@@ -5589,7 +5598,7 @@ function Nr(t, e) {
5589
5598
  * @returns This `Transaction` instance. Used for chaining method calls.
5590
5599
  */
5591
5600
  t.prototype.delete = function(t) {
5592
- var e = Nr(t, this._firestore);
5601
+ var e = Dr(t, this._firestore);
5593
5602
  return this._transaction.delete(e._key), this;
5594
5603
  }, t;
5595
5604
  }();
@@ -5627,9 +5636,9 @@ function Nr(t, e) {
5627
5636
  * `updateFunction `is returned here. Otherwise, if the transaction failed, a
5628
5637
  * rejected promise with the corresponding failure error is returned.
5629
5638
  */
5630
- function Rr(t, e) {
5631
- var n = Ze(t = st(t, en)), r = new x;
5632
- return new Fr(new jr, n, (function(n) {
5639
+ function jr(t, e) {
5640
+ var n = Je(t = st(t, tn)), r = new x;
5641
+ return new qr(new Cr, n, (function(n) {
5633
5642
  return e(new Lr(t, n));
5634
5643
  }), r).run(), r.promise
5635
5644
  /**
@@ -5643,11 +5652,11 @@ function Rr(t, e) {
5643
5652
  }
5644
5653
 
5645
5654
  y = i + "_lite", o(new c("firestore/lite", (function(t, e) {
5646
- var n = e.options, r = t.getProvider("app").getImmediate(), i = new en(r, new Q(t.getProvider("auth-internal")), new Y(t.getProvider("app-check-internal")));
5655
+ var n = e.options, r = t.getProvider("app").getImmediate(), i = new tn(r, new Q(t.getProvider("auth-internal")), new Y(t.getProvider("app-check-internal")));
5647
5656
  return n && i._setSettings(n), i;
5648
5657
  }), "PUBLIC")),
5649
5658
  // RUNTIME_ENV and BUILD_TARGET are replaced by real values during the compilation
5650
- a("firestore-lite", "3.4.4", ""), a("firestore-lite", "3.4.4", "esm5");
5659
+ a("firestore-lite", "3.4.5-canary.8ac8fb099", ""), a("firestore-lite", "3.4.5-canary.8ac8fb099", "esm5");
5651
5660
 
5652
- export { vn as Bytes, cn as CollectionReference, sn as DocumentReference, Kn as DocumentSnapshot, mn as FieldPath, gn as FieldValue, en as Firestore, U as FirestoreError, wn as GeoPoint, un as Query, Xn as QueryConstraint, Hn as QueryDocumentSnapshot, Wn as QuerySnapshot, bt as Timestamp, Lr as Transaction, Dr as WriteBatch, Sr as addDoc, kr as arrayRemove, Ar as arrayUnion, ln as collection, fn as collectionGroup, on as connectFirestoreEmulator, Tr as deleteDoc, Er as deleteField, hn as doc, yn as documentId, fr as endAt, lr as endBefore, gr as getDoc, wr as getDocs, rn as getFirestore, Vr as increment, nn as initializeFirestore, ir as limit, or as limitToLast, nr as orderBy, Jn as query, dn as queryEqual, pn as refEqual, Rr as runTransaction, Ir as serverTimestamp, br as setDoc, g as setLogLevel, Yn as snapshotEqual, ur as startAfter, sr as startAt, an as terminate, _r as updateDoc, tr as where, Pr as writeBatch };
5661
+ export { yn as Bytes, un as CollectionReference, an as DocumentReference, Qn as DocumentSnapshot, dn as FieldPath, vn as FieldValue, tn as Firestore, U as FirestoreError, gn as GeoPoint, sn as Query, $n as QueryConstraint, Kn as QueryDocumentSnapshot, Hn as QuerySnapshot, bt as Timestamp, Lr as Transaction, Vr as WriteBatch, Tr as addDoc, Ar as arrayRemove, Ir as arrayUnion, cn as collection, ln as collectionGroup, rn as connectFirestoreEmulator, _r as deleteDoc, Sr as deleteField, fn as doc, mn as documentId, lr as endAt, cr as endBefore, vr as getDoc, gr as getDocs, nn as getFirestore, kr as increment, en as initializeFirestore, rr as limit, ir as limitToLast, er as orderBy, Xn as query, pn as queryEqual, hn as refEqual, jr as runTransaction, Er as serverTimestamp, wr as setDoc, g as setLogLevel, Wn as snapshotEqual, sr as startAfter, ar as startAt, on as terminate, br as updateDoc, Zn as where, Pr as writeBatch };
5653
5662
  //# sourceMappingURL=index.browser.esm5.js.map