@firebase/firestore 3.4.4-canary.0482aa5b7 → 3.4.4-canary.3e9f3e253

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 (134) hide show
  1. package/dist/firestore/src/api/credentials.d.ts +1 -0
  2. package/dist/firestore/src/local/document_overlay_cache.d.ts +72 -0
  3. package/dist/firestore/src/local/indexeddb_document_overlay_cache.d.ts +45 -0
  4. package/dist/firestore/src/local/indexeddb_index_manager.d.ts +10 -2
  5. package/dist/firestore/src/local/indexeddb_persistence.d.ts +6 -4
  6. package/dist/firestore/src/local/indexeddb_remote_document_cache.d.ts +2 -8
  7. package/dist/firestore/src/local/indexeddb_schema.d.ts +81 -9
  8. package/dist/firestore/src/local/local_documents_view.d.ts +0 -1
  9. package/dist/firestore/src/local/local_serializer.d.ts +18 -2
  10. package/dist/firestore/src/local/memory_document_overlay_cache.d.ts +37 -0
  11. package/dist/firestore/src/local/memory_persistence.d.ts +6 -2
  12. package/dist/firestore/src/local/memory_remote_document_cache.d.ts +1 -3
  13. package/dist/firestore/src/local/persistence.d.ts +8 -2
  14. package/dist/firestore/src/local/remote_document_cache.d.ts +7 -9
  15. package/dist/firestore/src/local/simple_db.d.ts +1 -0
  16. package/dist/firestore/src/model/document_key.d.ts +4 -0
  17. package/dist/firestore/src/model/field_index.d.ts +2 -2
  18. package/dist/firestore/src/model/overlay.d.ts +32 -0
  19. package/dist/firestore/src/model/target_index_matcher.d.ts +70 -0
  20. package/dist/firestore/test/unit/local/counting_query_engine.d.ts +3 -3
  21. package/dist/firestore/test/unit/local/document_overlay_cache.test.d.ts +1 -0
  22. package/dist/firestore/test/unit/local/persistence_test_helpers.d.ts +1 -0
  23. package/dist/firestore/test/unit/local/test_document_overlay_cache.d.ts +38 -0
  24. package/dist/firestore/test/unit/local/test_index_manager.d.ts +11 -0
  25. package/dist/firestore/test/unit/local/test_remote_document_cache.d.ts +4 -2
  26. package/dist/firestore/test/unit/local/test_remote_document_change_buffer.d.ts +1 -1
  27. package/dist/firestore/test/unit/model/target_index_matcher.test.d.ts +17 -0
  28. package/dist/index.esm2017.js +3497 -3134
  29. package/dist/index.esm2017.js.map +1 -1
  30. package/dist/index.esm5.js +3448 -3123
  31. package/dist/index.esm5.js.map +1 -1
  32. package/dist/index.node.cjs.js +639 -154
  33. package/dist/index.node.cjs.js.map +1 -1
  34. package/dist/index.node.mjs +639 -154
  35. package/dist/index.node.mjs.map +1 -1
  36. package/dist/index.rn.js +3586 -3227
  37. package/dist/index.rn.js.map +1 -1
  38. package/dist/internal.d.ts +83 -12
  39. package/dist/lite/firestore/src/api/credentials.d.ts +1 -0
  40. package/dist/lite/firestore/src/local/document_overlay_cache.d.ts +72 -0
  41. package/dist/lite/firestore/src/local/indexeddb_document_overlay_cache.d.ts +45 -0
  42. package/dist/lite/firestore/src/local/indexeddb_index_manager.d.ts +10 -2
  43. package/dist/lite/firestore/src/local/indexeddb_persistence.d.ts +6 -4
  44. package/dist/lite/firestore/src/local/indexeddb_remote_document_cache.d.ts +2 -8
  45. package/dist/lite/firestore/src/local/indexeddb_schema.d.ts +81 -9
  46. package/dist/lite/firestore/src/local/local_documents_view.d.ts +0 -1
  47. package/dist/lite/firestore/src/local/local_serializer.d.ts +18 -2
  48. package/dist/lite/firestore/src/local/memory_document_overlay_cache.d.ts +37 -0
  49. package/dist/lite/firestore/src/local/memory_persistence.d.ts +6 -2
  50. package/dist/lite/firestore/src/local/memory_remote_document_cache.d.ts +1 -3
  51. package/dist/lite/firestore/src/local/persistence.d.ts +8 -2
  52. package/dist/lite/firestore/src/local/remote_document_cache.d.ts +7 -9
  53. package/dist/lite/firestore/src/local/simple_db.d.ts +1 -0
  54. package/dist/lite/firestore/src/model/document_key.d.ts +4 -0
  55. package/dist/lite/firestore/src/model/field_index.d.ts +2 -2
  56. package/dist/lite/firestore/src/model/overlay.d.ts +32 -0
  57. package/dist/lite/firestore/src/model/target_index_matcher.d.ts +70 -0
  58. package/dist/lite/firestore/test/unit/local/counting_query_engine.d.ts +3 -3
  59. package/dist/lite/firestore/test/unit/local/document_overlay_cache.test.d.ts +1 -0
  60. package/dist/lite/firestore/test/unit/local/persistence_test_helpers.d.ts +1 -0
  61. package/dist/lite/firestore/test/unit/local/test_document_overlay_cache.d.ts +38 -0
  62. package/dist/lite/firestore/test/unit/local/test_index_manager.d.ts +11 -0
  63. package/dist/lite/firestore/test/unit/local/test_remote_document_cache.d.ts +4 -2
  64. package/dist/lite/firestore/test/unit/local/test_remote_document_change_buffer.d.ts +1 -1
  65. package/dist/lite/firestore/test/unit/model/target_index_matcher.test.d.ts +17 -0
  66. package/dist/lite/index.browser.esm2017.js +1118 -1112
  67. package/dist/lite/index.browser.esm2017.js.map +1 -1
  68. package/dist/lite/index.browser.esm5.js +53 -47
  69. package/dist/lite/index.browser.esm5.js.map +1 -1
  70. package/dist/lite/index.node.cjs.js +10 -2
  71. package/dist/lite/index.node.cjs.js.map +1 -1
  72. package/dist/lite/index.node.mjs +10 -2
  73. package/dist/lite/index.node.mjs.map +1 -1
  74. package/dist/lite/index.rn.esm2017.js +1134 -1128
  75. package/dist/lite/index.rn.esm2017.js.map +1 -1
  76. package/dist/lite/internal.d.ts +4 -0
  77. package/dist/lite/packages/firestore/dist/lite/index.browser.esm2017.d.ts +112 -112
  78. package/dist/lite/packages/firestore/src/api/credentials.d.ts +1 -0
  79. package/dist/lite/packages/firestore/src/local/document_overlay_cache.d.ts +72 -0
  80. package/dist/lite/packages/firestore/src/local/indexeddb_document_overlay_cache.d.ts +45 -0
  81. package/dist/lite/packages/firestore/src/local/indexeddb_index_manager.d.ts +10 -2
  82. package/dist/lite/packages/firestore/src/local/indexeddb_persistence.d.ts +6 -4
  83. package/dist/lite/packages/firestore/src/local/indexeddb_remote_document_cache.d.ts +2 -8
  84. package/dist/lite/packages/firestore/src/local/indexeddb_schema.d.ts +81 -9
  85. package/dist/lite/packages/firestore/src/local/local_documents_view.d.ts +0 -1
  86. package/dist/lite/packages/firestore/src/local/local_serializer.d.ts +18 -2
  87. package/dist/lite/packages/firestore/src/local/memory_document_overlay_cache.d.ts +37 -0
  88. package/dist/lite/packages/firestore/src/local/memory_persistence.d.ts +6 -2
  89. package/dist/lite/packages/firestore/src/local/memory_remote_document_cache.d.ts +1 -3
  90. package/dist/lite/packages/firestore/src/local/persistence.d.ts +8 -2
  91. package/dist/lite/packages/firestore/src/local/remote_document_cache.d.ts +7 -9
  92. package/dist/lite/packages/firestore/src/local/simple_db.d.ts +1 -0
  93. package/dist/lite/packages/firestore/src/model/document_key.d.ts +4 -0
  94. package/dist/lite/packages/firestore/src/model/field_index.d.ts +2 -2
  95. package/dist/lite/packages/firestore/src/model/overlay.d.ts +32 -0
  96. package/dist/lite/packages/firestore/src/model/target_index_matcher.d.ts +70 -0
  97. package/dist/lite/packages/firestore/test/unit/local/counting_query_engine.d.ts +3 -3
  98. package/dist/lite/packages/firestore/test/unit/local/document_overlay_cache.test.d.ts +1 -0
  99. package/dist/lite/packages/firestore/test/unit/local/persistence_test_helpers.d.ts +1 -0
  100. package/dist/lite/packages/firestore/test/unit/local/test_document_overlay_cache.d.ts +38 -0
  101. package/dist/lite/packages/firestore/test/unit/local/test_index_manager.d.ts +11 -0
  102. package/dist/lite/packages/firestore/test/unit/local/test_remote_document_cache.d.ts +4 -2
  103. package/dist/lite/packages/firestore/test/unit/local/test_remote_document_change_buffer.d.ts +1 -1
  104. package/dist/lite/packages/firestore/test/unit/model/target_index_matcher.test.d.ts +17 -0
  105. package/dist/packages/firestore/dist/index.esm2017.d.ts +181 -179
  106. package/dist/packages/firestore/src/api/credentials.d.ts +1 -0
  107. package/dist/packages/firestore/src/local/document_overlay_cache.d.ts +72 -0
  108. package/dist/packages/firestore/src/local/indexeddb_document_overlay_cache.d.ts +45 -0
  109. package/dist/packages/firestore/src/local/indexeddb_index_manager.d.ts +10 -2
  110. package/dist/packages/firestore/src/local/indexeddb_persistence.d.ts +6 -4
  111. package/dist/packages/firestore/src/local/indexeddb_remote_document_cache.d.ts +2 -8
  112. package/dist/packages/firestore/src/local/indexeddb_schema.d.ts +81 -9
  113. package/dist/packages/firestore/src/local/local_documents_view.d.ts +0 -1
  114. package/dist/packages/firestore/src/local/local_serializer.d.ts +18 -2
  115. package/dist/packages/firestore/src/local/memory_document_overlay_cache.d.ts +37 -0
  116. package/dist/packages/firestore/src/local/memory_persistence.d.ts +6 -2
  117. package/dist/packages/firestore/src/local/memory_remote_document_cache.d.ts +1 -3
  118. package/dist/packages/firestore/src/local/persistence.d.ts +8 -2
  119. package/dist/packages/firestore/src/local/remote_document_cache.d.ts +7 -9
  120. package/dist/packages/firestore/src/local/simple_db.d.ts +1 -0
  121. package/dist/packages/firestore/src/model/document_key.d.ts +4 -0
  122. package/dist/packages/firestore/src/model/field_index.d.ts +2 -2
  123. package/dist/packages/firestore/src/model/overlay.d.ts +32 -0
  124. package/dist/packages/firestore/src/model/target_index_matcher.d.ts +70 -0
  125. package/dist/packages/firestore/test/unit/local/counting_query_engine.d.ts +3 -3
  126. package/dist/packages/firestore/test/unit/local/document_overlay_cache.test.d.ts +1 -0
  127. package/dist/packages/firestore/test/unit/local/persistence_test_helpers.d.ts +1 -0
  128. package/dist/packages/firestore/test/unit/local/test_document_overlay_cache.d.ts +38 -0
  129. package/dist/packages/firestore/test/unit/local/test_index_manager.d.ts +11 -0
  130. package/dist/packages/firestore/test/unit/local/test_remote_document_cache.d.ts +4 -2
  131. package/dist/packages/firestore/test/unit/local/test_remote_document_change_buffer.d.ts +1 -1
  132. package/dist/packages/firestore/test/unit/model/target_index_matcher.test.d.ts +17 -0
  133. package/dist/private.d.ts +79 -12
  134. package/package.json +9 -9
@@ -1,4 +1,4 @@
1
- import { _getProvider, getApp as t, _removeServiceInstance as n, _registerComponent as e, registerVersion as r, SDK_VERSION as s } from "@firebase/app";
1
+ import { _getProvider, getApp as t, _removeServiceInstance as e, _registerComponent as n, registerVersion as r, SDK_VERSION as s } from "@firebase/app";
2
2
 
3
3
  import { Component as i } from "@firebase/component";
4
4
 
@@ -66,7 +66,7 @@ f.MOCK_USER = new f("mock-user");
66
66
  * See the License for the specific language governing permissions and
67
67
  * limitations under the License.
68
68
  */
69
- let d = "9.6.5-canary.0482aa5b7";
69
+ let d = "9.6.6-canary.3e9f3e253";
70
70
 
71
71
  /**
72
72
  * @license
@@ -102,26 +102,26 @@ const w = new o("@firebase/firestore");
102
102
  w.setLogLevel(t);
103
103
  }
104
104
 
105
- function p(t, ...n) {
105
+ function p(t, ...e) {
106
106
  if (w.logLevel <= u.DEBUG) {
107
- const e = n.map(g);
108
- w.debug(`Firestore (${d}): ${t}`, ...e);
107
+ const n = e.map(g);
108
+ w.debug(`Firestore (${d}): ${t}`, ...n);
109
109
  }
110
110
  }
111
111
 
112
- function y(t, ...n) {
112
+ function y(t, ...e) {
113
113
  if (w.logLevel <= u.ERROR) {
114
- const e = n.map(g);
115
- w.error(`Firestore (${d}): ${t}`, ...e);
114
+ const n = e.map(g);
115
+ w.error(`Firestore (${d}): ${t}`, ...n);
116
116
  }
117
117
  }
118
118
 
119
119
  /**
120
120
  * @internal
121
- */ function _(t, ...n) {
121
+ */ function _(t, ...e) {
122
122
  if (w.logLevel <= u.WARN) {
123
- const e = n.map(g);
124
- w.warn(`Firestore (${d}): ${t}`, ...e);
123
+ const n = e.map(g);
124
+ w.warn(`Firestore (${d}): ${t}`, ...n);
125
125
  }
126
126
  }
127
127
 
@@ -130,8 +130,8 @@ function y(t, ...n) {
130
130
  */ function g(t) {
131
131
  if ("string" == typeof t) return t;
132
132
  try {
133
- return n = t, JSON.stringify(n);
134
- } catch (n) {
133
+ return e = t, JSON.stringify(e);
134
+ } catch (e) {
135
135
  // Converting to JSON failed, just log the object directly
136
136
  return t;
137
137
  }
@@ -152,7 +152,7 @@ function y(t, ...n) {
152
152
  * limitations under the License.
153
153
  */
154
154
  /** Formats an object as a JSON string, suitable for logging. */
155
- var n;
155
+ var e;
156
156
  }
157
157
 
158
158
  /**
@@ -181,11 +181,11 @@ function y(t, ...n) {
181
181
  */ function v(t = "Unexpected state") {
182
182
  // Log the failure in addition to throw an exception, just in case the
183
183
  // exception is swallowed.
184
- const n = `FIRESTORE (${d}) INTERNAL ASSERTION FAILED: ` + t;
184
+ const e = `FIRESTORE (${d}) INTERNAL ASSERTION FAILED: ` + t;
185
185
  // NOTE: We don't use FirestoreError here because these are internal failures
186
186
  // that cannot be handled by the user. (Also it would create a circular
187
187
  // dependency between the error and assert modules which doesn't work.)
188
- throw y(n), new Error(n);
188
+ throw y(e), new Error(e);
189
189
  }
190
190
 
191
191
  /**
@@ -193,7 +193,7 @@ function y(t, ...n) {
193
193
  * given message if it did.
194
194
  *
195
195
  * Messages are stripped in production builds.
196
- */ function b(t, n) {
196
+ */ function b(t, e) {
197
197
  t || v();
198
198
  }
199
199
 
@@ -202,7 +202,7 @@ function y(t, ...n) {
202
202
  * instance of `T` before casting.
203
203
  */ function E(t,
204
204
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
205
- n) {
205
+ e) {
206
206
  return t;
207
207
  }
208
208
 
@@ -233,8 +233,8 @@ n) {
233
233
  /**
234
234
  * A custom error description.
235
235
  */
236
- n) {
237
- super(t, n), this.code = t, this.message = n,
236
+ e) {
237
+ super(t, e), this.code = t, this.message = e,
238
238
  // HACK: We write a toString property directly because Error is not a real
239
239
  // class and so inheritance does not work correctly. We could alternatively
240
240
  // do the same "back-door inheritance" trick that FirebaseError does.
@@ -259,8 +259,8 @@ n) {
259
259
  * limitations under the License.
260
260
  */ class j {
261
261
  constructor() {
262
- this.promise = new Promise(((t, n) => {
263
- this.resolve = t, this.reject = n;
262
+ this.promise = new Promise(((t, e) => {
263
+ this.resolve = t, this.reject = e;
264
264
  }));
265
265
  }
266
266
  }
@@ -281,8 +281,8 @@ n) {
281
281
  * See the License for the specific language governing permissions and
282
282
  * limitations under the License.
283
283
  */ class M {
284
- constructor(t, n) {
285
- this.user = n, this.type = "OAuth", this.headers = new Map, this.headers.set("Authorization", `Bearer ${t}`);
284
+ constructor(t, e) {
285
+ this.user = e, this.type = "OAuth", this.headers = new Map, this.headers.set("Authorization", `Bearer ${t}`);
286
286
  }
287
287
  }
288
288
 
@@ -294,9 +294,9 @@ n) {
294
294
  return Promise.resolve(null);
295
295
  }
296
296
  invalidateToken() {}
297
- start(t, n) {
297
+ start(t, e) {
298
298
  // Fire with initial user.
299
- t.enqueueRetryable((() => n(f.UNAUTHENTICATED)));
299
+ t.enqueueRetryable((() => e(f.UNAUTHENTICATED)));
300
300
  }
301
301
  shutdown() {}
302
302
  }
@@ -318,17 +318,17 @@ n) {
318
318
  return Promise.resolve(this.token);
319
319
  }
320
320
  invalidateToken() {}
321
- start(t, n) {
322
- this.changeListener = n,
321
+ start(t, e) {
322
+ this.changeListener = e,
323
323
  // Fire with initial user.
324
- t.enqueueRetryable((() => n(this.token.user)));
324
+ t.enqueueRetryable((() => e(this.token.user)));
325
325
  }
326
326
  shutdown() {
327
327
  this.changeListener = null;
328
328
  }
329
329
  }
330
330
 
331
- /** Credential provider for the Lite SDK. */ class Q {
331
+ /** Credential provider for the Lite SDK. */ class G {
332
332
  constructor(t) {
333
333
  this.auth = null, t.onInit((t => {
334
334
  this.auth = t;
@@ -339,7 +339,7 @@ n) {
339
339
  new M(t.accessToken, new f(this.auth.getUid()))) : null)) : Promise.resolve(null);
340
340
  }
341
341
  invalidateToken() {}
342
- start(t, n) {}
342
+ start(t, e) {}
343
343
  shutdown() {}
344
344
  }
345
345
 
@@ -349,11 +349,11 @@ n) {
349
349
  * Technically this may no longer be necessary since the SDK should gracefully
350
350
  * recover from unauthenticated errors (see b/33147818 for context), but it's
351
351
  * safer to keep the implementation as-is.
352
- */ class G {
353
- constructor(t, n, e) {
354
- this.type = "FirstParty", this.user = f.FIRST_PARTY, this.headers = new Map, this.headers.set("X-Goog-AuthUser", n);
352
+ */ class Q {
353
+ constructor(t, e, n) {
354
+ this.type = "FirstParty", this.user = f.FIRST_PARTY, this.headers = new Map, this.headers.set("X-Goog-AuthUser", e);
355
355
  const r = t.auth.getAuthHeaderValueForFirstParty([]);
356
- r && this.headers.set("Authorization", r), e && this.headers.set("X-Goog-Iam-Authorization-Token", e);
356
+ r && this.headers.set("Authorization", r), n && this.headers.set("X-Goog-Iam-Authorization-Token", n);
357
357
  }
358
358
  }
359
359
 
@@ -362,15 +362,15 @@ n) {
362
362
  * to authenticate the user, using technique that is only available
363
363
  * to applications hosted by Google.
364
364
  */ class W {
365
- constructor(t, n, e) {
366
- this.t = t, this.i = n, this.o = e;
365
+ constructor(t, e, n) {
366
+ this.t = t, this.i = e, this.o = n;
367
367
  }
368
368
  getToken() {
369
- return Promise.resolve(new G(this.t, this.i, this.o));
369
+ return Promise.resolve(new Q(this.t, this.i, this.o));
370
370
  }
371
- start(t, n) {
371
+ start(t, e) {
372
372
  // Fire with initial uid.
373
- t.enqueueRetryable((() => n(f.FIRST_PARTY)));
373
+ t.enqueueRetryable((() => e(f.FIRST_PARTY)));
374
374
  }
375
375
  shutdown() {}
376
376
  invalidateToken() {}
@@ -393,7 +393,7 @@ class Y {
393
393
  new Y(t.token)) : null)) : Promise.resolve(null);
394
394
  }
395
395
  invalidateToken() {}
396
- start(t, n) {}
396
+ start(t, e) {}
397
397
  shutdown() {}
398
398
  }
399
399
 
@@ -435,8 +435,8 @@ class K {
435
435
  * @param useFetchStreams Whether to use the Fetch API instead of
436
436
  * XMLHTTPRequest
437
437
  */
438
- constructor(t, n, e, r, s, i, o, u) {
439
- this.databaseId = t, this.appId = n, this.persistenceKey = e, this.host = r, this.ssl = s,
438
+ constructor(t, e, n, r, s, i, o, u) {
439
+ this.databaseId = t, this.appId = e, this.persistenceKey = n, this.host = r, this.ssl = s,
440
440
  this.forceLongPolling = i, this.autoDetectLongPolling = o, this.useFetchStreams = u;
441
441
  }
442
442
  }
@@ -447,8 +447,8 @@ class K {
447
447
  * @internal
448
448
  */
449
449
  class J {
450
- constructor(t, n) {
451
- this.projectId = t, this.database = n || "(default)";
450
+ constructor(t, e) {
451
+ this.projectId = t, this.database = e || "(default)";
452
452
  }
453
453
  static empty() {
454
454
  return new J("", "");
@@ -481,9 +481,9 @@ class J {
481
481
  * Path represents an ordered sequence of string segments.
482
482
  */
483
483
  class X {
484
- constructor(t, n, e) {
485
- void 0 === n ? n = 0 : n > t.length && v(), void 0 === e ? e = t.length - n : e > t.length - n && v(),
486
- this.segments = t, this.offset = n, this.len = e;
484
+ constructor(t, e, n) {
485
+ void 0 === e ? e = 0 : e > t.length && v(), void 0 === n ? n = t.length - e : n > t.length - e && v(),
486
+ this.segments = t, this.offset = e, this.len = n;
487
487
  }
488
488
  get length() {
489
489
  return this.len;
@@ -492,10 +492,10 @@ class X {
492
492
  return 0 === X.comparator(this, t);
493
493
  }
494
494
  child(t) {
495
- const n = this.segments.slice(this.offset, this.limit());
495
+ const e = this.segments.slice(this.offset, this.limit());
496
496
  return t instanceof X ? t.forEach((t => {
497
- n.push(t);
498
- })) : n.push(t), this.construct(n);
497
+ e.push(t);
498
+ })) : e.push(t), this.construct(e);
499
499
  }
500
500
  /** The index of one past the last segment of the path. */ limit() {
501
501
  return this.offset + this.length;
@@ -520,28 +520,28 @@ class X {
520
520
  }
521
521
  isPrefixOf(t) {
522
522
  if (t.length < this.length) return !1;
523
- for (let n = 0; n < this.length; n++) if (this.get(n) !== t.get(n)) return !1;
523
+ for (let e = 0; e < this.length; e++) if (this.get(e) !== t.get(e)) return !1;
524
524
  return !0;
525
525
  }
526
526
  isImmediateParentOf(t) {
527
527
  if (this.length + 1 !== t.length) return !1;
528
- for (let n = 0; n < this.length; n++) if (this.get(n) !== t.get(n)) return !1;
528
+ for (let e = 0; e < this.length; e++) if (this.get(e) !== t.get(e)) return !1;
529
529
  return !0;
530
530
  }
531
531
  forEach(t) {
532
- for (let n = this.offset, e = this.limit(); n < e; n++) t(this.segments[n]);
532
+ for (let e = this.offset, n = this.limit(); e < n; e++) t(this.segments[e]);
533
533
  }
534
534
  toArray() {
535
535
  return this.segments.slice(this.offset, this.limit());
536
536
  }
537
- static comparator(t, n) {
538
- const e = Math.min(t.length, n.length);
539
- for (let r = 0; r < e; r++) {
540
- const e = t.get(r), s = n.get(r);
541
- if (e < s) return -1;
542
- if (e > s) return 1;
537
+ static comparator(t, e) {
538
+ const n = Math.min(t.length, e.length);
539
+ for (let r = 0; r < n; r++) {
540
+ const n = t.get(r), s = e.get(r);
541
+ if (n < s) return -1;
542
+ if (n > s) return 1;
543
543
  }
544
- return t.length < n.length ? -1 : t.length > n.length ? 1 : 0;
544
+ return t.length < e.length ? -1 : t.length > e.length ? 1 : 0;
545
545
  }
546
546
  }
547
547
 
@@ -551,8 +551,8 @@ class X {
551
551
  *
552
552
  * @internal
553
553
  */ class Z extends X {
554
- construct(t, n, e) {
555
- return new Z(t, n, e);
554
+ construct(t, e, n) {
555
+ return new Z(t, e, n);
556
556
  }
557
557
  canonicalString() {
558
558
  // NOTE: The client is ignorant of any path segments containing escape
@@ -571,13 +571,13 @@ class X {
571
571
  // NOTE: The client is ignorant of any path segments containing escape
572
572
  // sequences (e.g. __id123__) and just passes them through raw (they exist
573
573
  // for legacy reasons and should not be used frequently).
574
- const n = [];
575
- for (const e of t) {
576
- if (e.indexOf("//") >= 0) throw new U(R, `Invalid segment (${e}). Paths must not contain // in them.`);
574
+ const e = [];
575
+ for (const n of t) {
576
+ if (n.indexOf("//") >= 0) throw new U(R, `Invalid segment (${n}). Paths must not contain // in them.`);
577
577
  // Strip leading and traling slashed.
578
- n.push(...e.split("/").filter((t => t.length > 0)));
578
+ e.push(...n.split("/").filter((t => t.length > 0)));
579
579
  }
580
- return new Z(n);
580
+ return new Z(e);
581
581
  }
582
582
  static emptyPath() {
583
583
  return new Z([]);
@@ -589,9 +589,9 @@ const tt = /^[_a-zA-Z][_a-zA-Z0-9]*$/;
589
589
  /**
590
590
  * A dot-separated path for navigating sub-objects within a document.
591
591
  * @internal
592
- */ class nt extends X {
593
- construct(t, n, e) {
594
- return new nt(t, n, e);
592
+ */ class et extends X {
593
+ construct(t, e, n) {
594
+ return new et(t, e, n);
595
595
  }
596
596
  /**
597
597
  * Returns true if the string could be used as a segment in a field path
@@ -601,7 +601,7 @@ const tt = /^[_a-zA-Z][_a-zA-Z0-9]*$/;
601
601
  }
602
602
  canonicalString() {
603
603
  return this.toArray().map((t => (t = t.replace(/\\/g, "\\\\").replace(/`/g, "\\`"),
604
- nt.isValidIdentifier(t) || (t = "`" + t + "`"), t))).join(".");
604
+ et.isValidIdentifier(t) || (t = "`" + t + "`"), t))).join(".");
605
605
  }
606
606
  toString() {
607
607
  return this.canonicalString();
@@ -614,7 +614,7 @@ const tt = /^[_a-zA-Z][_a-zA-Z0-9]*$/;
614
614
  /**
615
615
  * The field designating the key of a document.
616
616
  */ static keyField() {
617
- return new nt([ "__name__" ]);
617
+ return new et([ "__name__" ]);
618
618
  }
619
619
  /**
620
620
  * Parses a field string from the given server-formatted string.
@@ -626,27 +626,27 @@ const tt = /^[_a-zA-Z][_a-zA-Z0-9]*$/;
626
626
  * TODO(b/37244157): we should make this more strict. Right now, it allows
627
627
  * non-identifier path components, even if they aren't escaped.
628
628
  */ static fromServerFormat(t) {
629
- const n = [];
630
- let e = "", r = 0;
629
+ const e = [];
630
+ let n = "", r = 0;
631
631
  const s = () => {
632
- if (0 === e.length) throw new U(R, `Invalid field path (${t}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);
633
- n.push(e), e = "";
632
+ if (0 === n.length) throw new U(R, `Invalid field path (${t}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);
633
+ e.push(n), n = "";
634
634
  };
635
635
  let i = !1;
636
636
  for (;r < t.length; ) {
637
- const n = t[r];
638
- if ("\\" === n) {
637
+ const e = t[r];
638
+ if ("\\" === e) {
639
639
  if (r + 1 === t.length) throw new U(R, "Path has trailing escape character: " + t);
640
- const n = t[r + 1];
641
- if ("\\" !== n && "." !== n && "`" !== n) throw new U(R, "Path has invalid escape sequence: " + t);
642
- e += n, r += 2;
643
- } else "`" === n ? (i = !i, r++) : "." !== n || i ? (e += n, r++) : (s(), r++);
640
+ const e = t[r + 1];
641
+ if ("\\" !== e && "." !== e && "`" !== e) throw new U(R, "Path has invalid escape sequence: " + t);
642
+ n += e, r += 2;
643
+ } else "`" === e ? (i = !i, r++) : "." !== e || i ? (n += e, r++) : (s(), r++);
644
644
  }
645
645
  if (s(), i) throw new U(R, "Unterminated ` in path: " + t);
646
- return new nt(n);
646
+ return new et(e);
647
647
  }
648
648
  static emptyPath() {
649
- return new nt([]);
649
+ return new et([]);
650
650
  }
651
651
  }
652
652
 
@@ -668,30 +668,36 @@ const tt = /^[_a-zA-Z][_a-zA-Z0-9]*$/;
668
668
  */
669
669
  /**
670
670
  * @internal
671
- */ class et {
671
+ */ class nt {
672
672
  constructor(t) {
673
673
  this.path = t;
674
674
  }
675
675
  static fromPath(t) {
676
- return new et(Z.fromString(t));
676
+ return new nt(Z.fromString(t));
677
677
  }
678
678
  static fromName(t) {
679
- return new et(Z.fromString(t).popFirst(5));
679
+ return new nt(Z.fromString(t).popFirst(5));
680
680
  }
681
681
  static empty() {
682
- return new et(Z.emptyPath());
682
+ return new nt(Z.emptyPath());
683
683
  }
684
684
  /** Returns true if the document is in the specified collectionId. */ hasCollectionId(t) {
685
685
  return this.path.length >= 2 && this.path.get(this.path.length - 2) === t;
686
686
  }
687
+ /** Returns the collection group (i.e. the name of the parent collection) for this key. */ getCollectionGroup() {
688
+ return this.path.get(this.path.length - 2);
689
+ }
690
+ /** Returns the fully qualified path to the parent collection. */ getCollectionPath() {
691
+ return this.path.popLast();
692
+ }
687
693
  isEqual(t) {
688
694
  return null !== t && 0 === Z.comparator(this.path, t.path);
689
695
  }
690
696
  toString() {
691
697
  return this.path.toString();
692
698
  }
693
- static comparator(t, n) {
694
- return Z.comparator(t.path, n.path);
699
+ static comparator(t, e) {
700
+ return Z.comparator(t.path, e.path);
695
701
  }
696
702
  static isDocumentKey(t) {
697
703
  return t.length % 2 == 0;
@@ -702,7 +708,7 @@ const tt = /^[_a-zA-Z][_a-zA-Z0-9]*$/;
702
708
  * @param segments - The segments of the path to the document
703
709
  * @returns A new instance of DocumentKey
704
710
  */ static fromSegments(t) {
705
- return new et(new Z(t.slice()));
711
+ return new nt(new Z(t.slice()));
706
712
  }
707
713
  }
708
714
 
@@ -721,8 +727,8 @@ const tt = /^[_a-zA-Z][_a-zA-Z0-9]*$/;
721
727
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
722
728
  * See the License for the specific language governing permissions and
723
729
  * limitations under the License.
724
- */ function rt(t, n, e) {
725
- if (!e) throw new U(R, `Function ${t}() cannot be called with an empty ${n}.`);
730
+ */ function rt(t, e, n) {
731
+ if (!n) throw new U(R, `Function ${t}() cannot be called with an empty ${e}.`);
726
732
  }
727
733
 
728
734
  /**
@@ -734,14 +740,14 @@ const tt = /^[_a-zA-Z][_a-zA-Z0-9]*$/;
734
740
  * an even numbers of segments).
735
741
  */
736
742
  function st(t) {
737
- if (!et.isDocumentKey(t)) throw new U(R, `Invalid document reference. Document references must have an even number of segments, but ${t} has ${t.length}.`);
743
+ if (!nt.isDocumentKey(t)) throw new U(R, `Invalid document reference. Document references must have an even number of segments, but ${t} has ${t.length}.`);
738
744
  }
739
745
 
740
746
  /**
741
747
  * Validates that `path` refers to a collection (indicated by the fact it
742
748
  * contains an odd numbers of segments).
743
749
  */ function it(t) {
744
- if (et.isDocumentKey(t)) throw new U(R, `Invalid collection reference. Collection references must have an odd number of segments, but ${t} has ${t.length}.`);
750
+ if (nt.isDocumentKey(t)) throw new U(R, `Invalid collection reference. Collection references must have an odd number of segments, but ${t} has ${t.length}.`);
745
751
  }
746
752
 
747
753
  /**
@@ -758,7 +764,7 @@ function ot(t) {
758
764
  if ("object" == typeof t) {
759
765
  if (t instanceof Array) return "an array";
760
766
  {
761
- const n =
767
+ const e =
762
768
  /** try to get the constructor name for an object. */
763
769
  function(t) {
764
770
  if (t.constructor) return t.constructor.name;
@@ -772,7 +778,7 @@ function ot(t) {
772
778
  * arguments passed to the public API.
773
779
  * @internal
774
780
  */ (t);
775
- return n ? `a custom ${n} object` : "an object";
781
+ return e ? `a custom ${e} object` : "an object";
776
782
  }
777
783
  }
778
784
  return "function" == typeof t ? "a function" : v();
@@ -780,22 +786,22 @@ function ot(t) {
780
786
 
781
787
  function ut(t,
782
788
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
783
- n) {
789
+ e) {
784
790
  if ("_delegate" in t && (
785
791
  // Unwrap Compat types
786
792
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
787
- t = t._delegate), !(t instanceof n)) {
788
- if (n.name === t.constructor.name) throw new U(R, "Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");
793
+ t = t._delegate), !(t instanceof e)) {
794
+ if (e.name === t.constructor.name) throw new U(R, "Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");
789
795
  {
790
- const e = ot(t);
791
- throw new U(R, `Expected type '${n.name}', but it was: ${e}`);
796
+ const n = ot(t);
797
+ throw new U(R, `Expected type '${e.name}', but it was: ${n}`);
792
798
  }
793
799
  }
794
800
  return t;
795
801
  }
796
802
 
797
- function ct(t, n) {
798
- if (n <= 0) throw new U(R, `Function ${t}() requires a positive number, but it was: ${n}.`);
803
+ function ct(t, e) {
804
+ if (e <= 0) throw new U(R, `Function ${t}() requires a positive number, but it was: ${e}.`);
799
805
  }
800
806
 
801
807
  /**
@@ -1002,58 +1008,58 @@ class mt extends
1002
1008
  class {
1003
1009
  constructor(t) {
1004
1010
  this.databaseInfo = t, this.databaseId = t.databaseId;
1005
- const n = t.ssl ? "https" : "http";
1006
- this.h = n + "://" + t.host, this.l = "projects/" + this.databaseId.projectId + "/databases/" + this.databaseId.database + "/documents";
1011
+ const e = t.ssl ? "https" : "http";
1012
+ this.h = e + "://" + t.host, this.l = "projects/" + this.databaseId.projectId + "/databases/" + this.databaseId.database + "/documents";
1007
1013
  }
1008
- m(t, n, e, r, s) {
1009
- const i = this.p(t, n);
1010
- p("RestConnection", "Sending: ", i, e);
1014
+ m(t, e, n, r, s) {
1015
+ const i = this.p(t, e);
1016
+ p("RestConnection", "Sending: ", i, n);
1011
1017
  const o = {};
1012
- return this.g(o, r, s), this.v(t, i, o, e).then((t => (p("RestConnection", "Received: ", t),
1013
- t)), (n => {
1014
- throw _("RestConnection", `${t} failed with error: `, n, "url: ", i, "request:", e),
1015
- n;
1018
+ return this.g(o, r, s), this.v(t, i, o, n).then((t => (p("RestConnection", "Received: ", t),
1019
+ t)), (e => {
1020
+ throw _("RestConnection", `${t} failed with error: `, e, "url: ", i, "request:", n),
1021
+ e;
1016
1022
  }));
1017
1023
  }
1018
- T(t, n, e, r, s) {
1024
+ T(t, e, n, r, s) {
1019
1025
  // The REST API automatically aggregates all of the streamed results, so we
1020
1026
  // can just use the normal invoke() method.
1021
- return this.m(t, n, e, r, s);
1027
+ return this.m(t, e, n, r, s);
1022
1028
  }
1023
1029
  /**
1024
1030
  * Modifies the headers for a request, adding any authorization token if
1025
1031
  * present and any additional headers for the request.
1026
- */ g(t, n, e) {
1032
+ */ g(t, e, n) {
1027
1033
  t["X-Goog-Api-Client"] = "gl-js/ fire/" + d,
1028
1034
  // Content-Type: text/plain will avoid preflight requests which might
1029
1035
  // mess with CORS and redirects by proxies. If we add custom headers
1030
1036
  // we will need to change this code to potentially use the $httpOverwrite
1031
1037
  // parameter supported by ESF to avoid triggering preflight requests.
1032
1038
  t["Content-Type"] = "text/plain", this.databaseInfo.appId && (t["X-Firebase-GMPID"] = this.databaseInfo.appId),
1033
- n && n.headers.forEach(((n, e) => t[e] = n)), e && e.headers.forEach(((n, e) => t[e] = n));
1039
+ e && e.headers.forEach(((e, n) => t[n] = e)), n && n.headers.forEach(((e, n) => t[n] = e));
1034
1040
  }
1035
- p(t, n) {
1036
- const e = lt[t];
1037
- return `${this.h}/v1/${n}:${e}`;
1041
+ p(t, e) {
1042
+ const n = lt[t];
1043
+ return `${this.h}/v1/${e}:${n}`;
1038
1044
  }
1039
1045
  } {
1040
1046
  /**
1041
1047
  * @param databaseInfo - The connection info.
1042
1048
  * @param fetchImpl - `fetch` or a Polyfill that implements the fetch API.
1043
1049
  */
1044
- constructor(t, n) {
1045
- super(t), this.I = n;
1050
+ constructor(t, e) {
1051
+ super(t), this.I = e;
1046
1052
  }
1047
- A(t, n) {
1053
+ A(t, e) {
1048
1054
  throw new Error("Not supported by FetchConnection");
1049
1055
  }
1050
- async v(t, n, e, r) {
1056
+ async v(t, e, n, r) {
1051
1057
  const s = JSON.stringify(r);
1052
1058
  let i;
1053
1059
  try {
1054
- i = await this.I(n, {
1060
+ i = await this.I(e, {
1055
1061
  method: "POST",
1056
- headers: e,
1062
+ headers: n,
1057
1063
  body: s
1058
1064
  });
1059
1065
  } catch (t) {
@@ -1104,13 +1110,13 @@ class {
1104
1110
  */
1105
1111
  function pt(t) {
1106
1112
  // Polyfills for IE and WebWorker by using `self` and `msCrypto` when `crypto` is not available.
1107
- const n =
1113
+ const e =
1108
1114
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1109
- "undefined" != typeof self && (self.crypto || self.msCrypto), e = new Uint8Array(t);
1110
- if (n && "function" == typeof n.getRandomValues) n.getRandomValues(e); else
1115
+ "undefined" != typeof self && (self.crypto || self.msCrypto), n = new Uint8Array(t);
1116
+ if (e && "function" == typeof e.getRandomValues) e.getRandomValues(n); else
1111
1117
  // Falls back to Math.random
1112
- for (let n = 0; n < t; n++) e[n] = Math.floor(256 * Math.random());
1113
- return e;
1118
+ for (let e = 0; e < t; e++) n[e] = Math.floor(256 * Math.random());
1119
+ return n;
1114
1120
  }
1115
1121
 
1116
1122
  /**
@@ -1131,26 +1137,26 @@ function pt(t) {
1131
1137
  */ class yt {
1132
1138
  static R() {
1133
1139
  // Alphanumeric characters
1134
- const t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", n = Math.floor(256 / t.length) * t.length;
1140
+ const t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", e = Math.floor(256 / t.length) * t.length;
1135
1141
  // The largest byte value that is a multiple of `char.length`.
1136
- let e = "";
1137
- for (;e.length < 20; ) {
1142
+ let n = "";
1143
+ for (;n.length < 20; ) {
1138
1144
  const r = pt(40);
1139
1145
  for (let s = 0; s < r.length; ++s)
1140
1146
  // Only accept values that are [0, maxMultiple), this ensures they can
1141
1147
  // be evenly mapped to indices of `chars` via a modulo operation.
1142
- e.length < 20 && r[s] < n && (e += t.charAt(r[s] % t.length));
1148
+ n.length < 20 && r[s] < e && (n += t.charAt(r[s] % t.length));
1143
1149
  }
1144
- return e;
1150
+ return n;
1145
1151
  }
1146
1152
  }
1147
1153
 
1148
- function _t(t, n) {
1149
- return t < n ? -1 : t > n ? 1 : 0;
1154
+ function _t(t, e) {
1155
+ return t < e ? -1 : t > e ? 1 : 0;
1150
1156
  }
1151
1157
 
1152
- /** Helper to compare arrays using isEqual(). */ function gt(t, n, e) {
1153
- return t.length === n.length && t.every(((t, r) => e(t, n[r])));
1158
+ /** Helper to compare arrays using isEqual(). */ function gt(t, e, n) {
1159
+ return t.length === e.length && t.every(((t, r) => n(t, e[r])));
1154
1160
  }
1155
1161
 
1156
1162
  /**
@@ -1204,9 +1210,9 @@ class vt {
1204
1210
  /**
1205
1211
  * The fractions of a second at nanosecond resolution.*
1206
1212
  */
1207
- n) {
1208
- if (this.seconds = t, this.nanoseconds = n, n < 0) throw new U(R, "Timestamp nanoseconds out of range: " + n);
1209
- if (n >= 1e9) throw new U(R, "Timestamp nanoseconds out of range: " + n);
1213
+ e) {
1214
+ if (this.seconds = t, this.nanoseconds = e, e < 0) throw new U(R, "Timestamp nanoseconds out of range: " + e);
1215
+ if (e >= 1e9) throw new U(R, "Timestamp nanoseconds out of range: " + e);
1210
1216
  if (t < -62135596800) throw new U(R, "Timestamp seconds out of range: " + t);
1211
1217
  // This will break in the year 10,000.
1212
1218
  if (t >= 253402300800) throw new U(R, "Timestamp seconds out of range: " + t);
@@ -1235,8 +1241,8 @@ class vt {
1235
1241
  * @returns A new `Timestamp` representing the same point in time as the given
1236
1242
  * number of milliseconds.
1237
1243
  */ static fromMillis(t) {
1238
- const n = Math.floor(t / 1e3), e = Math.floor(1e6 * (t - 1e3 * n));
1239
- return new vt(n, e);
1244
+ const e = Math.floor(t / 1e3), n = Math.floor(1e6 * (t - 1e3 * e));
1245
+ return new vt(e, n);
1240
1246
  }
1241
1247
  /**
1242
1248
  * Converts a `Timestamp` to a JavaScript `Date` object. This conversion
@@ -1358,13 +1364,13 @@ class vt {
1358
1364
  * See the License for the specific language governing permissions and
1359
1365
  * limitations under the License.
1360
1366
  */ function Et(t) {
1361
- let n = 0;
1362
- for (const e in t) Object.prototype.hasOwnProperty.call(t, e) && n++;
1363
- return n;
1367
+ let e = 0;
1368
+ for (const n in t) Object.prototype.hasOwnProperty.call(t, n) && e++;
1369
+ return e;
1364
1370
  }
1365
1371
 
1366
- function Tt(t, n) {
1367
- for (const e in t) Object.prototype.hasOwnProperty.call(t, e) && n(e, t[e]);
1372
+ function Tt(t, e) {
1373
+ for (const n in t) Object.prototype.hasOwnProperty.call(t, n) && e(n, t[n]);
1368
1374
  }
1369
1375
 
1370
1376
  /**
@@ -1398,7 +1404,7 @@ class It {
1398
1404
  this.fields = t,
1399
1405
  // TODO(dimond): validation of FieldMask
1400
1406
  // Sort the field mask to support `FieldMask.isEqual()` and assert below.
1401
- t.sort(nt.comparator);
1407
+ t.sort(et.comparator);
1402
1408
  }
1403
1409
  /**
1404
1410
  * Verifies that `fieldPath` is included by at least one field in this field
@@ -1406,11 +1412,11 @@ class It {
1406
1412
  *
1407
1413
  * This is an O(n) operation, where `n` is the size of the field mask.
1408
1414
  */ covers(t) {
1409
- for (const n of this.fields) if (n.isPrefixOf(t)) return !0;
1415
+ for (const e of this.fields) if (e.isPrefixOf(t)) return !0;
1410
1416
  return !1;
1411
1417
  }
1412
1418
  isEqual(t) {
1413
- return gt(this.fields, t.fields, ((t, n) => t.isEqual(n)));
1419
+ return gt(this.fields, t.fields, ((t, e) => t.isEqual(e)));
1414
1420
  }
1415
1421
  }
1416
1422
 
@@ -1472,23 +1478,23 @@ class Rt {
1472
1478
  this.binaryString = t;
1473
1479
  }
1474
1480
  static fromBase64String(t) {
1475
- const n = At(t);
1476
- return new Rt(n);
1481
+ const e = At(t);
1482
+ return new Rt(e);
1477
1483
  }
1478
1484
  static fromUint8Array(t) {
1479
- const n =
1485
+ const e =
1480
1486
  /**
1481
1487
  * Helper function to convert an Uint8array to a binary string.
1482
1488
  */
1483
1489
  function(t) {
1484
- let n = "";
1485
- for (let e = 0; e < t.length; ++e) n += String.fromCharCode(t[e]);
1486
- return n;
1490
+ let e = "";
1491
+ for (let n = 0; n < t.length; ++n) e += String.fromCharCode(t[n]);
1492
+ return e;
1487
1493
  }
1488
1494
  /**
1489
1495
  * Helper function to convert a binary string to an Uint8Array.
1490
1496
  */ (t);
1491
- return new Rt(n);
1497
+ return new Rt(e);
1492
1498
  }
1493
1499
  [Symbol.iterator]() {
1494
1500
  let t = 0;
@@ -1504,16 +1510,16 @@ class Rt {
1504
1510
  }
1505
1511
  toBase64() {
1506
1512
  return function(t) {
1507
- const n = [];
1508
- for (let e = 0; e < t.length; e++) n[e] = t.charCodeAt(e);
1509
- return a.encodeByteArray(n, !1);
1513
+ const e = [];
1514
+ for (let n = 0; n < t.length; n++) e[n] = t.charCodeAt(n);
1515
+ return a.encodeByteArray(e, !1);
1510
1516
  }(this.binaryString);
1511
1517
  }
1512
1518
  toUint8Array() {
1513
1519
  return function(t) {
1514
- const n = new Uint8Array(t.length);
1515
- for (let e = 0; e < t.length; e++) n[e] = t.charCodeAt(e);
1516
- return n;
1520
+ const e = new Uint8Array(t.length);
1521
+ for (let n = 0; n < t.length; n++) e[n] = t.charCodeAt(n);
1522
+ return e;
1517
1523
  }
1518
1524
  /**
1519
1525
  * @license
@@ -1560,18 +1566,18 @@ const Pt = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
1560
1566
  // The date string can have higher precision (nanos) than the Date class
1561
1567
  // (millis), so we do some custom parsing here.
1562
1568
  // Parse the nanos right out of the string.
1563
- let n = 0;
1564
- const e = Pt.exec(t);
1565
- if (b(!!e), e[1]) {
1569
+ let e = 0;
1570
+ const n = Pt.exec(t);
1571
+ if (b(!!n), n[1]) {
1566
1572
  // Pad the fraction out to 9 digits (nanos).
1567
- let t = e[1];
1568
- t = (t + "000000000").substr(0, 9), n = Number(t);
1573
+ let t = n[1];
1574
+ t = (t + "000000000").substr(0, 9), e = Number(t);
1569
1575
  }
1570
1576
  // Parse the date to get the seconds.
1571
1577
  const r = new Date(t);
1572
1578
  return {
1573
1579
  seconds: Math.floor(r.getTime() / 1e3),
1574
- nanos: n
1580
+ nanos: e
1575
1581
  };
1576
1582
  }
1577
1583
  return {
@@ -1626,8 +1632,8 @@ const Pt = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
1626
1632
  * - With respect to other ServerTimestampValues, they sort by their
1627
1633
  * localWriteTime.
1628
1634
  */ function $t(t) {
1629
- var n, e;
1630
- return "server_timestamp" === (null === (e = ((null === (n = null == t ? void 0 : t.mapValue) || void 0 === n ? void 0 : n.fields) || {}).__type__) || void 0 === e ? void 0 : e.stringValue);
1635
+ var e, n;
1636
+ 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);
1631
1637
  }
1632
1638
 
1633
1639
  /**
@@ -1636,15 +1642,15 @@ const Pt = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
1636
1642
  * Preserving the previous values allows the user to display the last resoled
1637
1643
  * value until the backend responds with the timestamp.
1638
1644
  */ function St(t) {
1639
- const n = t.mapValue.fields.__previous_value__;
1640
- return $t(n) ? St(n) : n;
1645
+ const e = t.mapValue.fields.__previous_value__;
1646
+ return $t(e) ? St(e) : e;
1641
1647
  }
1642
1648
 
1643
1649
  /**
1644
1650
  * Returns the local time at which this timestamp was first set.
1645
1651
  */ function Ft(t) {
1646
- const n = Vt(t.mapValue.fields.__local_write_time__.timestampValue);
1647
- return new vt(n.seconds, n.nanos);
1652
+ const e = Vt(t.mapValue.fields.__local_write_time__.timestampValue);
1653
+ return new vt(e.seconds, e.nanos);
1648
1654
  }
1649
1655
 
1650
1656
  /**
@@ -1667,169 +1673,169 @@ const Pt = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
1667
1673
  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 ? $t(t) ? 4 /* ServerTimestampValue */ : 10 /* ObjectValue */ : v();
1668
1674
  }
1669
1675
 
1670
- /** Tests `left` and `right` for equality based on the backend semantics. */ function qt(t, n) {
1671
- if (t === n) return !0;
1672
- const e = xt(t);
1673
- if (e !== xt(n)) return !1;
1674
- switch (e) {
1676
+ /** Tests `left` and `right` for equality based on the backend semantics. */ function qt(t, e) {
1677
+ if (t === e) return !0;
1678
+ const n = xt(t);
1679
+ if (n !== xt(e)) return !1;
1680
+ switch (n) {
1675
1681
  case 0 /* NullValue */ :
1676
1682
  return !0;
1677
1683
 
1678
1684
  case 1 /* BooleanValue */ :
1679
- return t.booleanValue === n.booleanValue;
1685
+ return t.booleanValue === e.booleanValue;
1680
1686
 
1681
1687
  case 4 /* ServerTimestampValue */ :
1682
- return Ft(t).isEqual(Ft(n));
1688
+ return Ft(t).isEqual(Ft(e));
1683
1689
 
1684
1690
  case 3 /* TimestampValue */ :
1685
- return function(t, n) {
1686
- if ("string" == typeof t.timestampValue && "string" == typeof n.timestampValue && t.timestampValue.length === n.timestampValue.length)
1691
+ return function(t, e) {
1692
+ if ("string" == typeof t.timestampValue && "string" == typeof e.timestampValue && t.timestampValue.length === e.timestampValue.length)
1687
1693
  // Use string equality for ISO 8601 timestamps
1688
- return t.timestampValue === n.timestampValue;
1689
- const e = Vt(t.timestampValue), r = Vt(n.timestampValue);
1690
- return e.seconds === r.seconds && e.nanos === r.nanos;
1691
- }(t, n);
1694
+ return t.timestampValue === e.timestampValue;
1695
+ const n = Vt(t.timestampValue), r = Vt(e.timestampValue);
1696
+ return n.seconds === r.seconds && n.nanos === r.nanos;
1697
+ }(t, e);
1692
1698
 
1693
1699
  case 5 /* StringValue */ :
1694
- return t.stringValue === n.stringValue;
1700
+ return t.stringValue === e.stringValue;
1695
1701
 
1696
1702
  case 6 /* BlobValue */ :
1697
- return function(t, n) {
1698
- return Dt(t.bytesValue).isEqual(Dt(n.bytesValue));
1699
- }(t, n);
1703
+ return function(t, e) {
1704
+ return Dt(t.bytesValue).isEqual(Dt(e.bytesValue));
1705
+ }(t, e);
1700
1706
 
1701
1707
  case 7 /* RefValue */ :
1702
- return t.referenceValue === n.referenceValue;
1708
+ return t.referenceValue === e.referenceValue;
1703
1709
 
1704
1710
  case 8 /* GeoPointValue */ :
1705
- return function(t, n) {
1706
- return Nt(t.geoPointValue.latitude) === Nt(n.geoPointValue.latitude) && Nt(t.geoPointValue.longitude) === Nt(n.geoPointValue.longitude);
1707
- }(t, n);
1711
+ return function(t, e) {
1712
+ return Nt(t.geoPointValue.latitude) === Nt(e.geoPointValue.latitude) && Nt(t.geoPointValue.longitude) === Nt(e.geoPointValue.longitude);
1713
+ }(t, e);
1708
1714
 
1709
1715
  case 2 /* NumberValue */ :
1710
- return function(t, n) {
1711
- if ("integerValue" in t && "integerValue" in n) return Nt(t.integerValue) === Nt(n.integerValue);
1712
- if ("doubleValue" in t && "doubleValue" in n) {
1713
- const e = Nt(t.doubleValue), r = Nt(n.doubleValue);
1714
- return e === r ? ht(e) === ht(r) : isNaN(e) && isNaN(r);
1716
+ return function(t, e) {
1717
+ if ("integerValue" in t && "integerValue" in e) return Nt(t.integerValue) === Nt(e.integerValue);
1718
+ if ("doubleValue" in t && "doubleValue" in e) {
1719
+ const n = Nt(t.doubleValue), r = Nt(e.doubleValue);
1720
+ return n === r ? ht(n) === ht(r) : isNaN(n) && isNaN(r);
1715
1721
  }
1716
1722
  return !1;
1717
- }(t, n);
1723
+ }(t, e);
1718
1724
 
1719
1725
  case 9 /* ArrayValue */ :
1720
- return gt(t.arrayValue.values || [], n.arrayValue.values || [], qt);
1726
+ return gt(t.arrayValue.values || [], e.arrayValue.values || [], qt);
1721
1727
 
1722
1728
  case 10 /* ObjectValue */ :
1723
- return function(t, n) {
1724
- const e = t.mapValue.fields || {}, r = n.mapValue.fields || {};
1725
- if (Et(e) !== Et(r)) return !1;
1726
- for (const t in e) if (e.hasOwnProperty(t) && (void 0 === r[t] || !qt(e[t], r[t]))) return !1;
1729
+ return function(t, e) {
1730
+ const n = t.mapValue.fields || {}, r = e.mapValue.fields || {};
1731
+ if (Et(n) !== Et(r)) return !1;
1732
+ for (const t in n) if (n.hasOwnProperty(t) && (void 0 === r[t] || !qt(n[t], r[t]))) return !1;
1727
1733
  return !0;
1728
1734
  }
1729
- /** Returns true if the ArrayValue contains the specified element. */ (t, n);
1735
+ /** Returns true if the ArrayValue contains the specified element. */ (t, e);
1730
1736
 
1731
1737
  default:
1732
1738
  return v();
1733
1739
  }
1734
1740
  }
1735
1741
 
1736
- function Ot(t, n) {
1737
- return void 0 !== (t.values || []).find((t => qt(t, n)));
1742
+ function Ot(t, e) {
1743
+ return void 0 !== (t.values || []).find((t => qt(t, e)));
1738
1744
  }
1739
1745
 
1740
- function Ct(t, n) {
1741
- if (t === n) return 0;
1742
- const e = xt(t), r = xt(n);
1743
- if (e !== r) return _t(e, r);
1744
- switch (e) {
1746
+ function Ct(t, e) {
1747
+ if (t === e) return 0;
1748
+ const n = xt(t), r = xt(e);
1749
+ if (n !== r) return _t(n, r);
1750
+ switch (n) {
1745
1751
  case 0 /* NullValue */ :
1746
1752
  return 0;
1747
1753
 
1748
1754
  case 1 /* BooleanValue */ :
1749
- return _t(t.booleanValue, n.booleanValue);
1755
+ return _t(t.booleanValue, e.booleanValue);
1750
1756
 
1751
1757
  case 2 /* NumberValue */ :
1752
- return function(t, n) {
1753
- const e = Nt(t.integerValue || t.doubleValue), r = Nt(n.integerValue || n.doubleValue);
1754
- return e < r ? -1 : e > r ? 1 : e === r ? 0 :
1758
+ return function(t, e) {
1759
+ const n = Nt(t.integerValue || t.doubleValue), r = Nt(e.integerValue || e.doubleValue);
1760
+ return n < r ? -1 : n > r ? 1 : n === r ? 0 :
1755
1761
  // one or both are NaN.
1756
- isNaN(e) ? isNaN(r) ? 0 : -1 : 1;
1757
- }(t, n);
1762
+ isNaN(n) ? isNaN(r) ? 0 : -1 : 1;
1763
+ }(t, e);
1758
1764
 
1759
1765
  case 3 /* TimestampValue */ :
1760
- return Lt(t.timestampValue, n.timestampValue);
1766
+ return Lt(t.timestampValue, e.timestampValue);
1761
1767
 
1762
1768
  case 4 /* ServerTimestampValue */ :
1763
- return Lt(Ft(t), Ft(n));
1769
+ return Lt(Ft(t), Ft(e));
1764
1770
 
1765
1771
  case 5 /* StringValue */ :
1766
- return _t(t.stringValue, n.stringValue);
1772
+ return _t(t.stringValue, e.stringValue);
1767
1773
 
1768
1774
  case 6 /* BlobValue */ :
1769
- return function(t, n) {
1770
- const e = Dt(t), r = Dt(n);
1771
- return e.compareTo(r);
1772
- }(t.bytesValue, n.bytesValue);
1775
+ return function(t, e) {
1776
+ const n = Dt(t), r = Dt(e);
1777
+ return n.compareTo(r);
1778
+ }(t.bytesValue, e.bytesValue);
1773
1779
 
1774
1780
  case 7 /* RefValue */ :
1775
- return function(t, n) {
1776
- const e = t.split("/"), r = n.split("/");
1777
- for (let t = 0; t < e.length && t < r.length; t++) {
1778
- const n = _t(e[t], r[t]);
1779
- if (0 !== n) return n;
1781
+ return function(t, e) {
1782
+ const n = t.split("/"), r = e.split("/");
1783
+ for (let t = 0; t < n.length && t < r.length; t++) {
1784
+ const e = _t(n[t], r[t]);
1785
+ if (0 !== e) return e;
1780
1786
  }
1781
- return _t(e.length, r.length);
1782
- }(t.referenceValue, n.referenceValue);
1787
+ return _t(n.length, r.length);
1788
+ }(t.referenceValue, e.referenceValue);
1783
1789
 
1784
1790
  case 8 /* GeoPointValue */ :
1785
- return function(t, n) {
1786
- const e = _t(Nt(t.latitude), Nt(n.latitude));
1787
- if (0 !== e) return e;
1788
- return _t(Nt(t.longitude), Nt(n.longitude));
1789
- }(t.geoPointValue, n.geoPointValue);
1791
+ return function(t, e) {
1792
+ const n = _t(Nt(t.latitude), Nt(e.latitude));
1793
+ if (0 !== n) return n;
1794
+ return _t(Nt(t.longitude), Nt(e.longitude));
1795
+ }(t.geoPointValue, e.geoPointValue);
1790
1796
 
1791
1797
  case 9 /* ArrayValue */ :
1792
- return function(t, n) {
1793
- const e = t.values || [], r = n.values || [];
1794
- for (let t = 0; t < e.length && t < r.length; ++t) {
1795
- const n = Ct(e[t], r[t]);
1796
- if (n) return n;
1798
+ return function(t, e) {
1799
+ const n = t.values || [], r = e.values || [];
1800
+ for (let t = 0; t < n.length && t < r.length; ++t) {
1801
+ const e = Ct(n[t], r[t]);
1802
+ if (e) return e;
1797
1803
  }
1798
- return _t(e.length, r.length);
1799
- }(t.arrayValue, n.arrayValue);
1804
+ return _t(n.length, r.length);
1805
+ }(t.arrayValue, e.arrayValue);
1800
1806
 
1801
1807
  case 10 /* ObjectValue */ :
1802
- return function(t, n) {
1803
- const e = t.fields || {}, r = Object.keys(e), s = n.fields || {}, i = Object.keys(s);
1808
+ return function(t, e) {
1809
+ const n = t.fields || {}, r = Object.keys(n), s = e.fields || {}, i = Object.keys(s);
1804
1810
  // Even though MapValues are likely sorted correctly based on their insertion
1805
1811
  // order (e.g. when received from the backend), local modifications can bring
1806
1812
  // elements out of order. We need to re-sort the elements to ensure that
1807
1813
  // canonical IDs are independent of insertion order.
1808
1814
  r.sort(), i.sort();
1809
1815
  for (let t = 0; t < r.length && t < i.length; ++t) {
1810
- const n = _t(r[t], i[t]);
1811
- if (0 !== n) return n;
1812
- const o = Ct(e[r[t]], s[i[t]]);
1816
+ const e = _t(r[t], i[t]);
1817
+ if (0 !== e) return e;
1818
+ const o = Ct(n[r[t]], s[i[t]]);
1813
1819
  if (0 !== o) return o;
1814
1820
  }
1815
1821
  return _t(r.length, i.length);
1816
1822
  }
1817
- /** Returns a reference value for the provided database and key. */ (t.mapValue, n.mapValue);
1823
+ /** Returns a reference value for the provided database and key. */ (t.mapValue, e.mapValue);
1818
1824
 
1819
1825
  default:
1820
1826
  throw v();
1821
1827
  }
1822
1828
  }
1823
1829
 
1824
- function Lt(t, n) {
1825
- if ("string" == typeof t && "string" == typeof n && t.length === n.length) return _t(t, n);
1826
- const e = Vt(t), r = Vt(n), s = _t(e.seconds, r.seconds);
1827
- return 0 !== s ? s : _t(e.nanos, r.nanos);
1830
+ function Lt(t, e) {
1831
+ if ("string" == typeof t && "string" == typeof e && t.length === e.length) return _t(t, e);
1832
+ const n = Vt(t), r = Vt(e), s = _t(n.seconds, r.seconds);
1833
+ return 0 !== s ? s : _t(n.nanos, r.nanos);
1828
1834
  }
1829
1835
 
1830
- function kt(t, n) {
1836
+ function kt(t, e) {
1831
1837
  return {
1832
- referenceValue: `projects/${t.projectId}/databases/${t.database}/documents/${n.path.canonicalString()}`
1838
+ referenceValue: `projects/${t.projectId}/databases/${t.database}/documents/${e.path.canonicalString()}`
1833
1839
  };
1834
1840
  }
1835
1841
 
@@ -1857,21 +1863,21 @@ function kt(t, n) {
1857
1863
  timestampValue: Object.assign({}, t.timestampValue)
1858
1864
  };
1859
1865
  if (t.mapValue) {
1860
- const n = {
1866
+ const e = {
1861
1867
  mapValue: {
1862
1868
  fields: {}
1863
1869
  }
1864
1870
  };
1865
- return Tt(t.mapValue.fields, ((t, e) => n.mapValue.fields[t] = zt(e))), n;
1871
+ return Tt(t.mapValue.fields, ((t, n) => e.mapValue.fields[t] = zt(n))), e;
1866
1872
  }
1867
1873
  if (t.arrayValue) {
1868
- const n = {
1874
+ const e = {
1869
1875
  arrayValue: {
1870
1876
  values: []
1871
1877
  }
1872
1878
  };
1873
- for (let e = 0; e < (t.arrayValue.values || []).length; ++e) n.arrayValue.values[e] = zt(t.arrayValue.values[e]);
1874
- return n;
1879
+ for (let n = 0; n < (t.arrayValue.values || []).length; ++n) e.arrayValue.values[n] = zt(t.arrayValue.values[n]);
1880
+ return e;
1875
1881
  }
1876
1882
  return Object.assign({}, t);
1877
1883
  }
@@ -1895,12 +1901,12 @@ function kt(t, n) {
1895
1901
  /**
1896
1902
  * An ObjectValue represents a MapValue in the Firestore Proto and offers the
1897
1903
  * ability to add and remove fields (via the ObjectValueBuilder).
1898
- */ class Qt {
1904
+ */ class Gt {
1899
1905
  constructor(t) {
1900
1906
  this.value = t;
1901
1907
  }
1902
1908
  static empty() {
1903
- return new Qt({
1909
+ return new Gt({
1904
1910
  mapValue: {}
1905
1911
  });
1906
1912
  }
@@ -1912,10 +1918,10 @@ function kt(t, n) {
1912
1918
  */ field(t) {
1913
1919
  if (t.isEmpty()) return this.value;
1914
1920
  {
1915
- let n = this.value;
1916
- for (let e = 0; e < t.length - 1; ++e) if (n = (n.mapValue.fields || {})[t.get(e)],
1917
- !Bt(n)) return null;
1918
- return n = (n.mapValue.fields || {})[t.lastSegment()], n || null;
1921
+ let e = this.value;
1922
+ for (let n = 0; n < t.length - 1; ++n) if (e = (e.mapValue.fields || {})[t.get(n)],
1923
+ !Bt(e)) return null;
1924
+ return e = (e.mapValue.fields || {})[t.lastSegment()], e || null;
1919
1925
  }
1920
1926
  }
1921
1927
  /**
@@ -1923,25 +1929,25 @@ function kt(t, n) {
1923
1929
  *
1924
1930
  * @param path - The field path to set.
1925
1931
  * @param value - The value to set.
1926
- */ set(t, n) {
1927
- this.getFieldsMap(t.popLast())[t.lastSegment()] = zt(n);
1932
+ */ set(t, e) {
1933
+ this.getFieldsMap(t.popLast())[t.lastSegment()] = zt(e);
1928
1934
  }
1929
1935
  /**
1930
1936
  * Sets the provided fields to the provided values.
1931
1937
  *
1932
1938
  * @param data - A map of fields to values (or null for deletes).
1933
1939
  */ setAll(t) {
1934
- let n = nt.emptyPath(), e = {}, r = [];
1940
+ let e = et.emptyPath(), n = {}, r = [];
1935
1941
  t.forEach(((t, s) => {
1936
- if (!n.isImmediateParentOf(s)) {
1942
+ if (!e.isImmediateParentOf(s)) {
1937
1943
  // Insert the accumulated changes at this parent location
1938
- const t = this.getFieldsMap(n);
1939
- this.applyChanges(t, e, r), e = {}, r = [], n = s.popLast();
1944
+ const t = this.getFieldsMap(e);
1945
+ this.applyChanges(t, n, r), n = {}, r = [], e = s.popLast();
1940
1946
  }
1941
- t ? e[s.lastSegment()] = zt(t) : r.push(s.lastSegment());
1947
+ t ? n[s.lastSegment()] = zt(t) : r.push(s.lastSegment());
1942
1948
  }));
1943
- const s = this.getFieldsMap(n);
1944
- this.applyChanges(s, e, r);
1949
+ const s = this.getFieldsMap(e);
1950
+ this.applyChanges(s, n, r);
1945
1951
  }
1946
1952
  /**
1947
1953
  * Removes the field at the specified path. If there is no field at the
@@ -1949,8 +1955,8 @@ function kt(t, n) {
1949
1955
  *
1950
1956
  * @param path - The field path to remove.
1951
1957
  */ delete(t) {
1952
- const n = this.field(t.popLast());
1953
- Bt(n) && n.mapValue.fields && delete n.mapValue.fields[t.lastSegment()];
1958
+ const e = this.field(t.popLast());
1959
+ Bt(e) && e.mapValue.fields && delete e.mapValue.fields[t.lastSegment()];
1954
1960
  }
1955
1961
  isEqual(t) {
1956
1962
  return qt(this.value, t.value);
@@ -1959,29 +1965,29 @@ function kt(t, n) {
1959
1965
  * Returns the map that contains the leaf element of `path`. If the parent
1960
1966
  * entry does not yet exist, or if it is not a map, a new map will be created.
1961
1967
  */ getFieldsMap(t) {
1962
- let n = this.value;
1963
- n.mapValue.fields || (n.mapValue = {
1968
+ let e = this.value;
1969
+ e.mapValue.fields || (e.mapValue = {
1964
1970
  fields: {}
1965
1971
  });
1966
- for (let e = 0; e < t.length; ++e) {
1967
- let r = n.mapValue.fields[t.get(e)];
1972
+ for (let n = 0; n < t.length; ++n) {
1973
+ let r = e.mapValue.fields[t.get(n)];
1968
1974
  Bt(r) && r.mapValue.fields || (r = {
1969
1975
  mapValue: {
1970
1976
  fields: {}
1971
1977
  }
1972
- }, n.mapValue.fields[t.get(e)] = r), n = r;
1978
+ }, e.mapValue.fields[t.get(n)] = r), e = r;
1973
1979
  }
1974
- return n.mapValue.fields;
1980
+ return e.mapValue.fields;
1975
1981
  }
1976
1982
  /**
1977
1983
  * Modifies `fieldsMap` by adding, replacing or deleting the specified
1978
1984
  * entries.
1979
- */ applyChanges(t, n, e) {
1980
- Tt(n, ((n, e) => t[n] = e));
1981
- for (const n of e) delete t[n];
1985
+ */ applyChanges(t, e, n) {
1986
+ Tt(e, ((e, n) => t[e] = n));
1987
+ for (const e of n) delete t[e];
1982
1988
  }
1983
1989
  clone() {
1984
- return new Qt(zt(this.value));
1990
+ return new Gt(zt(this.value));
1985
1991
  }
1986
1992
  }
1987
1993
 
@@ -2010,45 +2016,45 @@ function kt(t, n) {
2010
2016
  * not transition to one of these states even after all mutations have been
2011
2017
  * applied, `isValidDocument()` returns false and the document should be removed
2012
2018
  * from all views.
2013
- */ class Gt {
2014
- constructor(t, n, e, r, s, i) {
2015
- this.key = t, this.documentType = n, this.version = e, this.readTime = r, this.data = s,
2019
+ */ class Qt {
2020
+ constructor(t, e, n, r, s, i) {
2021
+ this.key = t, this.documentType = e, this.version = n, this.readTime = r, this.data = s,
2016
2022
  this.documentState = i;
2017
2023
  }
2018
2024
  /**
2019
2025
  * Creates a document with no known version or data, but which can serve as
2020
2026
  * base document for mutations.
2021
2027
  */ static newInvalidDocument(t) {
2022
- return new Gt(t, 0 /* INVALID */ , bt.min(), bt.min(), Qt.empty(), 0 /* SYNCED */);
2028
+ return new Qt(t, 0 /* INVALID */ , bt.min(), bt.min(), Gt.empty(), 0 /* SYNCED */);
2023
2029
  }
2024
2030
  /**
2025
2031
  * Creates a new document that is known to exist with the given data at the
2026
2032
  * given version.
2027
- */ static newFoundDocument(t, n, e) {
2028
- return new Gt(t, 1 /* FOUND_DOCUMENT */ , n, bt.min(), e, 0 /* SYNCED */);
2033
+ */ static newFoundDocument(t, e, n) {
2034
+ return new Qt(t, 1 /* FOUND_DOCUMENT */ , e, bt.min(), n, 0 /* SYNCED */);
2029
2035
  }
2030
- /** Creates a new document that is known to not exist at the given version. */ static newNoDocument(t, n) {
2031
- return new Gt(t, 2 /* NO_DOCUMENT */ , n, bt.min(), Qt.empty(), 0 /* SYNCED */);
2036
+ /** Creates a new document that is known to not exist at the given version. */ static newNoDocument(t, e) {
2037
+ return new Qt(t, 2 /* NO_DOCUMENT */ , e, bt.min(), Gt.empty(), 0 /* SYNCED */);
2032
2038
  }
2033
2039
  /**
2034
2040
  * Creates a new document that is known to exist at the given version but
2035
2041
  * whose data is not known (e.g. a document that was updated without a known
2036
2042
  * base document).
2037
- */ static newUnknownDocument(t, n) {
2038
- return new Gt(t, 3 /* UNKNOWN_DOCUMENT */ , n, bt.min(), Qt.empty(), 2 /* HAS_COMMITTED_MUTATIONS */);
2043
+ */ static newUnknownDocument(t, e) {
2044
+ return new Qt(t, 3 /* UNKNOWN_DOCUMENT */ , e, bt.min(), Gt.empty(), 2 /* HAS_COMMITTED_MUTATIONS */);
2039
2045
  }
2040
2046
  /**
2041
2047
  * Changes the document type to indicate that it exists and that its version
2042
2048
  * and data are known.
2043
- */ convertToFoundDocument(t, n) {
2044
- return this.version = t, this.documentType = 1 /* FOUND_DOCUMENT */ , this.data = n,
2049
+ */ convertToFoundDocument(t, e) {
2050
+ return this.version = t, this.documentType = 1 /* FOUND_DOCUMENT */ , this.data = e,
2045
2051
  this.documentState = 0 /* SYNCED */ , this;
2046
2052
  }
2047
2053
  /**
2048
2054
  * Changes the document type to indicate that it doesn't exist at the given
2049
2055
  * version.
2050
2056
  */ convertToNoDocument(t) {
2051
- return this.version = t, this.documentType = 2 /* NO_DOCUMENT */ , this.data = Qt.empty(),
2057
+ return this.version = t, this.documentType = 2 /* NO_DOCUMENT */ , this.data = Gt.empty(),
2052
2058
  this.documentState = 0 /* SYNCED */ , this;
2053
2059
  }
2054
2060
  /**
@@ -2056,7 +2062,7 @@ function kt(t, n) {
2056
2062
  * that its data is not known (e.g. a document that was updated without a known
2057
2063
  * base document).
2058
2064
  */ convertToUnknownDocument(t) {
2059
- return this.version = t, this.documentType = 3 /* UNKNOWN_DOCUMENT */ , this.data = Qt.empty(),
2065
+ return this.version = t, this.documentType = 3 /* UNKNOWN_DOCUMENT */ , this.data = Gt.empty(),
2060
2066
  this.documentState = 2 /* HAS_COMMITTED_MUTATIONS */ , this;
2061
2067
  }
2062
2068
  setHasCommittedMutations() {
@@ -2090,10 +2096,10 @@ function kt(t, n) {
2090
2096
  return 3 /* UNKNOWN_DOCUMENT */ === this.documentType;
2091
2097
  }
2092
2098
  isEqual(t) {
2093
- return t instanceof Gt && this.key.isEqual(t.key) && this.version.isEqual(t.version) && this.documentType === t.documentType && this.documentState === t.documentState && this.data.isEqual(t.data);
2099
+ return t instanceof Qt && this.key.isEqual(t.key) && this.version.isEqual(t.version) && this.documentType === t.documentType && this.documentState === t.documentState && this.data.isEqual(t.data);
2094
2100
  }
2095
2101
  mutableCopy() {
2096
- return new Gt(this.key, this.documentType, this.version, this.readTime, this.data.clone(), this.documentState);
2102
+ return new Qt(this.key, this.documentType, this.version, this.readTime, this.data.clone(), this.documentState);
2097
2103
  }
2098
2104
  toString() {
2099
2105
  return `Document(${this.key}, ${this.version}, ${JSON.stringify(this.data.value)}, {documentType: ${this.documentType}}), {documentState: ${this.documentState}})`;
@@ -2118,8 +2124,8 @@ function kt(t, n) {
2118
2124
  */
2119
2125
  // Visible for testing
2120
2126
  class Wt {
2121
- constructor(t, n = null, e = [], r = [], s = null, i = null, o = null) {
2122
- this.path = t, this.collectionGroup = n, this.orderBy = e, this.filters = r, this.limit = s,
2127
+ constructor(t, e = null, n = [], r = [], s = null, i = null, o = null) {
2128
+ this.path = t, this.collectionGroup = e, this.orderBy = n, this.filters = r, this.limit = s,
2123
2129
  this.startAt = i, this.endAt = o, this.P = null;
2124
2130
  }
2125
2131
  }
@@ -2131,26 +2137,26 @@ class Wt {
2131
2137
  * NOTE: you should always construct `Target` from `Query.toTarget` instead of
2132
2138
  * using this factory method, because `Query` provides an implicit `orderBy`
2133
2139
  * property.
2134
- */ function Yt(t, n = null, e = [], r = [], s = null, i = null, o = null) {
2135
- return new Wt(t, n, e, r, s, i, o);
2140
+ */ function Yt(t, e = null, n = [], r = [], s = null, i = null, o = null) {
2141
+ return new Wt(t, e, n, r, s, i, o);
2136
2142
  }
2137
2143
 
2138
2144
  class Ht extends class {} {
2139
- constructor(t, n, e) {
2140
- super(), this.field = t, this.op = n, this.value = e;
2145
+ constructor(t, e, n) {
2146
+ super(), this.field = t, this.op = e, this.value = n;
2141
2147
  }
2142
2148
  /**
2143
2149
  * Creates a filter based on the provided arguments.
2144
- */ static create(t, n, e) {
2145
- return t.isKeyField() ? "in" /* IN */ === n || "not-in" /* NOT_IN */ === n ? this.V(t, n, e) : new Kt(t, n, e) : "array-contains" /* ARRAY_CONTAINS */ === n ? new tn(t, e) : "in" /* IN */ === n ? new nn(t, e) : "not-in" /* NOT_IN */ === n ? new en(t, e) : "array-contains-any" /* ARRAY_CONTAINS_ANY */ === n ? new rn(t, e) : new Ht(t, n, e);
2150
+ */ static create(t, e, n) {
2151
+ return t.isKeyField() ? "in" /* IN */ === e || "not-in" /* NOT_IN */ === e ? this.V(t, e, n) : new Kt(t, e, n) : "array-contains" /* ARRAY_CONTAINS */ === e ? new te(t, n) : "in" /* IN */ === e ? new ee(t, n) : "not-in" /* NOT_IN */ === e ? new ne(t, n) : "array-contains-any" /* ARRAY_CONTAINS_ANY */ === e ? new re(t, n) : new Ht(t, e, n);
2146
2152
  }
2147
- static V(t, n, e) {
2148
- return "in" /* IN */ === n ? new Jt(t, e) : new Xt(t, e);
2153
+ static V(t, e, n) {
2154
+ return "in" /* IN */ === e ? new Jt(t, n) : new Xt(t, n);
2149
2155
  }
2150
2156
  matches(t) {
2151
- const n = t.data.field(this.field);
2157
+ const e = t.data.field(this.field);
2152
2158
  // Types do not have to match in NOT_EQUAL filters.
2153
- return "!=" /* NOT_EQUAL */ === this.op ? null !== n && this.N(Ct(n, this.value)) : null !== n && xt(this.value) === xt(n) && this.N(Ct(n, this.value));
2159
+ return "!=" /* NOT_EQUAL */ === this.op ? null !== e && this.N(Ct(e, this.value)) : null !== e && xt(this.value) === xt(e) && this.N(Ct(e, this.value));
2154
2160
  // Only compare types with matching backend order (such as double and int).
2155
2161
  }
2156
2162
  N(t) {
@@ -2184,78 +2190,78 @@ class Ht extends class {} {
2184
2190
 
2185
2191
  /** Filter that matches on key fields (i.e. '__name__'). */
2186
2192
  class Kt extends Ht {
2187
- constructor(t, n, e) {
2188
- super(t, n, e), this.key = et.fromName(e.referenceValue);
2193
+ constructor(t, e, n) {
2194
+ super(t, e, n), this.key = nt.fromName(n.referenceValue);
2189
2195
  }
2190
2196
  matches(t) {
2191
- const n = et.comparator(t.key, this.key);
2192
- return this.N(n);
2197
+ const e = nt.comparator(t.key, this.key);
2198
+ return this.N(e);
2193
2199
  }
2194
2200
  }
2195
2201
 
2196
2202
  /** Filter that matches on key fields within an array. */ class Jt extends Ht {
2197
- constructor(t, n) {
2198
- super(t, "in" /* IN */ , n), this.keys = Zt("in" /* IN */ , n);
2203
+ constructor(t, e) {
2204
+ super(t, "in" /* IN */ , e), this.keys = Zt("in" /* IN */ , e);
2199
2205
  }
2200
2206
  matches(t) {
2201
- return this.keys.some((n => n.isEqual(t.key)));
2207
+ return this.keys.some((e => e.isEqual(t.key)));
2202
2208
  }
2203
2209
  }
2204
2210
 
2205
2211
  /** Filter that matches on key fields not present within an array. */ class Xt extends Ht {
2206
- constructor(t, n) {
2207
- super(t, "not-in" /* NOT_IN */ , n), this.keys = Zt("not-in" /* NOT_IN */ , n);
2212
+ constructor(t, e) {
2213
+ super(t, "not-in" /* NOT_IN */ , e), this.keys = Zt("not-in" /* NOT_IN */ , e);
2208
2214
  }
2209
2215
  matches(t) {
2210
- return !this.keys.some((n => n.isEqual(t.key)));
2216
+ return !this.keys.some((e => e.isEqual(t.key)));
2211
2217
  }
2212
2218
  }
2213
2219
 
2214
- function Zt(t, n) {
2215
- var e;
2216
- return ((null === (e = n.arrayValue) || void 0 === e ? void 0 : e.values) || []).map((t => et.fromName(t.referenceValue)));
2220
+ function Zt(t, e) {
2221
+ var n;
2222
+ return ((null === (n = e.arrayValue) || void 0 === n ? void 0 : n.values) || []).map((t => nt.fromName(t.referenceValue)));
2217
2223
  }
2218
2224
 
2219
- /** A Filter that implements the array-contains operator. */ class tn extends Ht {
2220
- constructor(t, n) {
2221
- super(t, "array-contains" /* ARRAY_CONTAINS */ , n);
2225
+ /** A Filter that implements the array-contains operator. */ class te extends Ht {
2226
+ constructor(t, e) {
2227
+ super(t, "array-contains" /* ARRAY_CONTAINS */ , e);
2222
2228
  }
2223
2229
  matches(t) {
2224
- const n = t.data.field(this.field);
2225
- return Ut(n) && Ot(n.arrayValue, this.value);
2230
+ const e = t.data.field(this.field);
2231
+ return Ut(e) && Ot(e.arrayValue, this.value);
2226
2232
  }
2227
2233
  }
2228
2234
 
2229
- /** A Filter that implements the IN operator. */ class nn extends Ht {
2230
- constructor(t, n) {
2231
- super(t, "in" /* IN */ , n);
2235
+ /** A Filter that implements the IN operator. */ class ee extends Ht {
2236
+ constructor(t, e) {
2237
+ super(t, "in" /* IN */ , e);
2232
2238
  }
2233
2239
  matches(t) {
2234
- const n = t.data.field(this.field);
2235
- return null !== n && Ot(this.value.arrayValue, n);
2240
+ const e = t.data.field(this.field);
2241
+ return null !== e && Ot(this.value.arrayValue, e);
2236
2242
  }
2237
2243
  }
2238
2244
 
2239
- /** A Filter that implements the not-in operator. */ class en extends Ht {
2240
- constructor(t, n) {
2241
- super(t, "not-in" /* NOT_IN */ , n);
2245
+ /** A Filter that implements the not-in operator. */ class ne extends Ht {
2246
+ constructor(t, e) {
2247
+ super(t, "not-in" /* NOT_IN */ , e);
2242
2248
  }
2243
2249
  matches(t) {
2244
2250
  if (Ot(this.value.arrayValue, {
2245
2251
  nullValue: "NULL_VALUE"
2246
2252
  })) return !1;
2247
- const n = t.data.field(this.field);
2248
- return null !== n && !Ot(this.value.arrayValue, n);
2253
+ const e = t.data.field(this.field);
2254
+ return null !== e && !Ot(this.value.arrayValue, e);
2249
2255
  }
2250
2256
  }
2251
2257
 
2252
- /** A Filter that implements the array-contains-any operator. */ class rn extends Ht {
2253
- constructor(t, n) {
2254
- super(t, "array-contains-any" /* ARRAY_CONTAINS_ANY */ , n);
2258
+ /** A Filter that implements the array-contains-any operator. */ class re extends Ht {
2259
+ constructor(t, e) {
2260
+ super(t, "array-contains-any" /* ARRAY_CONTAINS_ANY */ , e);
2255
2261
  }
2256
2262
  matches(t) {
2257
- const n = t.data.field(this.field);
2258
- return !(!Ut(n) || !n.arrayValue.values) && n.arrayValue.values.some((t => Ot(this.value.arrayValue, t)));
2263
+ const e = t.data.field(this.field);
2264
+ return !(!Ut(e) || !e.arrayValue.values) && e.arrayValue.values.some((t => Ot(this.value.arrayValue, t)));
2259
2265
  }
2260
2266
  }
2261
2267
 
@@ -2272,30 +2278,30 @@ function Zt(t, n) {
2272
2278
  * Bound provides a function to determine whether a document comes before or
2273
2279
  * after a bound. This is influenced by whether the position is just before or
2274
2280
  * just after the provided values.
2275
- */ class sn {
2276
- constructor(t, n) {
2277
- this.position = t, this.inclusive = n;
2281
+ */ class se {
2282
+ constructor(t, e) {
2283
+ this.position = t, this.inclusive = e;
2278
2284
  }
2279
2285
  }
2280
2286
 
2281
2287
  /**
2282
2288
  * An ordering on a field, in some Direction. Direction defaults to ASCENDING.
2283
- */ class on {
2284
- constructor(t, n = "asc" /* ASCENDING */) {
2285
- this.field = t, this.dir = n;
2289
+ */ class ie {
2290
+ constructor(t, e = "asc" /* ASCENDING */) {
2291
+ this.field = t, this.dir = e;
2286
2292
  }
2287
2293
  }
2288
2294
 
2289
- function un(t, n) {
2290
- return t.dir === n.dir && t.field.isEqual(n.field);
2295
+ function oe(t, e) {
2296
+ return t.dir === e.dir && t.field.isEqual(e.field);
2291
2297
  }
2292
2298
 
2293
- function cn(t, n) {
2294
- if (null === t) return null === n;
2295
- if (null === n) return !1;
2296
- if (t.inclusive !== n.inclusive || t.position.length !== n.position.length) return !1;
2297
- for (let e = 0; e < t.position.length; e++) {
2298
- if (!qt(t.position[e], n.position[e])) return !1;
2299
+ function ue(t, e) {
2300
+ if (null === t) return null === e;
2301
+ if (null === e) return !1;
2302
+ if (t.inclusive !== e.inclusive || t.position.length !== e.position.length) return !1;
2303
+ for (let n = 0; n < t.position.length; n++) {
2304
+ if (!qt(t.position[n], e.position[n])) return !1;
2299
2305
  }
2300
2306
  return !0;
2301
2307
  }
@@ -2322,29 +2328,29 @@ function cn(t, n) {
2322
2328
  * query the RemoteStore results.
2323
2329
  *
2324
2330
  * Visible for testing.
2325
- */ class an {
2331
+ */ class ce {
2326
2332
  /**
2327
2333
  * Initializes a Query with a path and optional additional query constraints.
2328
2334
  * Path must currently be empty if this is a collection group query.
2329
2335
  */
2330
- constructor(t, n = null, e = [], r = [], s = null, i = "F" /* First */ , o = null, u = null) {
2331
- this.path = t, this.collectionGroup = n, this.explicitOrderBy = e, this.filters = r,
2336
+ constructor(t, e = null, n = [], r = [], s = null, i = "F" /* First */ , o = null, u = null) {
2337
+ this.path = t, this.collectionGroup = e, this.explicitOrderBy = n, this.filters = r,
2332
2338
  this.limit = s, this.limitType = i, this.startAt = o, this.endAt = u, this.$ = null,
2333
2339
  // The corresponding `Target` of this `Query` instance.
2334
2340
  this.S = null, this.startAt, this.endAt;
2335
2341
  }
2336
2342
  }
2337
2343
 
2338
- /** Creates a new Query for a query that matches all documents at `path` */ function hn(t) {
2344
+ /** Creates a new Query for a query that matches all documents at `path` */ function ae(t) {
2339
2345
  return !at(t.limit) && "L" /* Last */ === t.limitType;
2340
2346
  }
2341
2347
 
2342
- function ln(t) {
2348
+ function he(t) {
2343
2349
  return t.explicitOrderBy.length > 0 ? t.explicitOrderBy[0].field : null;
2344
2350
  }
2345
2351
 
2346
- function fn(t) {
2347
- for (const n of t.filters) if (n.D()) return n.field;
2352
+ function le(t) {
2353
+ for (const e of t.filters) if (e.D()) return e.field;
2348
2354
  return null;
2349
2355
  }
2350
2356
 
@@ -2356,7 +2362,7 @@ function fn(t) {
2356
2362
  * Returns whether the query matches a collection group rather than a specific
2357
2363
  * collection.
2358
2364
  */
2359
- function dn(t) {
2365
+ function fe(t) {
2360
2366
  return null !== t.collectionGroup;
2361
2367
  }
2362
2368
 
@@ -2364,59 +2370,59 @@ function dn(t) {
2364
2370
  * Returns the implicit order by constraint that is used to execute the Query,
2365
2371
  * which can be different from the order by constraints the user provided (e.g.
2366
2372
  * the SDK and backend always orders by `__name__`).
2367
- */ function wn(t) {
2368
- const n = E(t);
2369
- if (null === n.$) {
2370
- n.$ = [];
2371
- const t = fn(n), e = ln(n);
2372
- if (null !== t && null === e)
2373
+ */ function de(t) {
2374
+ const e = E(t);
2375
+ if (null === e.$) {
2376
+ e.$ = [];
2377
+ const t = le(e), n = he(e);
2378
+ if (null !== t && null === n)
2373
2379
  // In order to implicitly add key ordering, we must also add the
2374
2380
  // inequality filter field for it to be a valid query.
2375
2381
  // Note that the default inequality field and key ordering is ascending.
2376
- t.isKeyField() || n.$.push(new on(t)), n.$.push(new on(nt.keyField(), "asc" /* ASCENDING */)); else {
2382
+ t.isKeyField() || e.$.push(new ie(t)), e.$.push(new ie(et.keyField(), "asc" /* ASCENDING */)); else {
2377
2383
  let t = !1;
2378
- for (const e of n.explicitOrderBy) n.$.push(e), e.field.isKeyField() && (t = !0);
2384
+ for (const n of e.explicitOrderBy) e.$.push(n), n.field.isKeyField() && (t = !0);
2379
2385
  if (!t) {
2380
2386
  // The order of the implicit key ordering always matches the last
2381
2387
  // explicit order by
2382
- const t = n.explicitOrderBy.length > 0 ? n.explicitOrderBy[n.explicitOrderBy.length - 1].dir : "asc" /* ASCENDING */;
2383
- n.$.push(new on(nt.keyField(), t));
2388
+ const t = e.explicitOrderBy.length > 0 ? e.explicitOrderBy[e.explicitOrderBy.length - 1].dir : "asc" /* ASCENDING */;
2389
+ e.$.push(new ie(et.keyField(), t));
2384
2390
  }
2385
2391
  }
2386
2392
  }
2387
- return n.$;
2393
+ return e.$;
2388
2394
  }
2389
2395
 
2390
2396
  /**
2391
2397
  * Converts this `Query` instance to it's corresponding `Target` representation.
2392
- */ function mn(t) {
2393
- const n = E(t);
2394
- if (!n.S) if ("F" /* First */ === n.limitType) n.S = Yt(n.path, n.collectionGroup, wn(n), n.filters, n.limit, n.startAt, n.endAt); else {
2398
+ */ function we(t) {
2399
+ const e = E(t);
2400
+ if (!e.S) if ("F" /* First */ === e.limitType) e.S = Yt(e.path, e.collectionGroup, de(e), e.filters, e.limit, e.startAt, e.endAt); else {
2395
2401
  // Flip the orderBy directions since we want the last results
2396
2402
  const t = [];
2397
- for (const e of wn(n)) {
2398
- const n = "desc" /* DESCENDING */ === e.dir ? "asc" /* ASCENDING */ : "desc" /* DESCENDING */;
2399
- t.push(new on(e.field, n));
2403
+ for (const n of de(e)) {
2404
+ const e = "desc" /* DESCENDING */ === n.dir ? "asc" /* ASCENDING */ : "desc" /* DESCENDING */;
2405
+ t.push(new ie(n.field, e));
2400
2406
  }
2401
2407
  // We need to swap the cursors to match the now-flipped query ordering.
2402
- const e = n.endAt ? new sn(n.endAt.position, !n.endAt.inclusive) : null, r = n.startAt ? new sn(n.startAt.position, !n.startAt.inclusive) : null;
2408
+ const n = e.endAt ? new se(e.endAt.position, !e.endAt.inclusive) : null, r = e.startAt ? new se(e.startAt.position, !e.startAt.inclusive) : null;
2403
2409
  // Now return as a LimitType.First query.
2404
- n.S = Yt(n.path, n.collectionGroup, t, n.filters, n.limit, e, r);
2410
+ e.S = Yt(e.path, e.collectionGroup, t, e.filters, e.limit, n, r);
2405
2411
  }
2406
- return n.S;
2412
+ return e.S;
2407
2413
  }
2408
2414
 
2409
- function pn(t, n) {
2410
- return function(t, n) {
2411
- if (t.limit !== n.limit) return !1;
2412
- if (t.orderBy.length !== n.orderBy.length) return !1;
2413
- for (let e = 0; e < t.orderBy.length; e++) if (!un(t.orderBy[e], n.orderBy[e])) return !1;
2414
- if (t.filters.length !== n.filters.length) return !1;
2415
- for (let s = 0; s < t.filters.length; s++) if (e = t.filters[s], r = n.filters[s],
2416
- e.op !== r.op || !e.field.isEqual(r.field) || !qt(e.value, r.value)) return !1;
2417
- var e, r;
2418
- return t.collectionGroup === n.collectionGroup && !!t.path.isEqual(n.path) && !!cn(t.startAt, n.startAt) && cn(t.endAt, n.endAt);
2419
- }(mn(t), mn(n)) && t.limitType === n.limitType;
2415
+ function me(t, e) {
2416
+ return function(t, e) {
2417
+ if (t.limit !== e.limit) return !1;
2418
+ if (t.orderBy.length !== e.orderBy.length) return !1;
2419
+ for (let n = 0; n < t.orderBy.length; n++) if (!oe(t.orderBy[n], e.orderBy[n])) return !1;
2420
+ if (t.filters.length !== e.filters.length) return !1;
2421
+ for (let s = 0; s < t.filters.length; s++) if (n = t.filters[s], r = e.filters[s],
2422
+ n.op !== r.op || !n.field.isEqual(r.field) || !qt(n.value, r.value)) return !1;
2423
+ var n, r;
2424
+ return t.collectionGroup === e.collectionGroup && !!t.path.isEqual(e.path) && !!ue(t.startAt, e.startAt) && ue(t.endAt, e.endAt);
2425
+ }(we(t), we(e)) && t.limitType === e.limitType;
2420
2426
  }
2421
2427
 
2422
2428
  /**
@@ -2444,10 +2450,10 @@ function pn(t, n) {
2444
2450
  * The return value is an IntegerValue if it can safely represent the value,
2445
2451
  * otherwise a DoubleValue is returned.
2446
2452
  */
2447
- function yn(t, n) {
2453
+ function pe(t, e) {
2448
2454
  return function(t) {
2449
2455
  return "number" == typeof t && Number.isInteger(t) && !ht(t) && t <= Number.MAX_SAFE_INTEGER && t >= Number.MIN_SAFE_INTEGER;
2450
- }(n) ?
2456
+ }(e) ?
2451
2457
  /**
2452
2458
  * Returns an IntegerValue for `value`.
2453
2459
  */
@@ -2455,22 +2461,22 @@ function yn(t, n) {
2455
2461
  return {
2456
2462
  integerValue: "" + t
2457
2463
  };
2458
- }(n) : function(t, n) {
2464
+ }(e) : function(t, e) {
2459
2465
  if (t.F) {
2460
- if (isNaN(n)) return {
2466
+ if (isNaN(e)) return {
2461
2467
  doubleValue: "NaN"
2462
2468
  };
2463
- if (n === 1 / 0) return {
2469
+ if (e === 1 / 0) return {
2464
2470
  doubleValue: "Infinity"
2465
2471
  };
2466
- if (n === -1 / 0) return {
2472
+ if (e === -1 / 0) return {
2467
2473
  doubleValue: "-Infinity"
2468
2474
  };
2469
2475
  }
2470
2476
  return {
2471
- doubleValue: ht(n) ? "-0" : n
2477
+ doubleValue: ht(e) ? "-0" : e
2472
2478
  };
2473
- }(t, n);
2479
+ }(t, e);
2474
2480
  }
2475
2481
 
2476
2482
  /**
@@ -2489,7 +2495,7 @@ function yn(t, n) {
2489
2495
  * See the License for the specific language governing permissions and
2490
2496
  * limitations under the License.
2491
2497
  */
2492
- /** Used to represent a field transform on a mutation. */ class _n {
2498
+ /** Used to represent a field transform on a mutation. */ class ye {
2493
2499
  constructor() {
2494
2500
  // Make sure that the structural type of `TransformOperation` is unique.
2495
2501
  // See https://github.com/microsoft/TypeScript/issues/5451
@@ -2497,15 +2503,15 @@ function yn(t, n) {
2497
2503
  }
2498
2504
  }
2499
2505
 
2500
- /** Transforms a value into a server-generated timestamp. */ class gn extends _n {}
2506
+ /** Transforms a value into a server-generated timestamp. */ class _e extends ye {}
2501
2507
 
2502
- /** Transforms an array value via a union operation. */ class vn extends _n {
2508
+ /** Transforms an array value via a union operation. */ class ge extends ye {
2503
2509
  constructor(t) {
2504
2510
  super(), this.elements = t;
2505
2511
  }
2506
2512
  }
2507
2513
 
2508
- /** Transforms an array value via a remove operation. */ class bn extends _n {
2514
+ /** Transforms an array value via a remove operation. */ class ve extends ye {
2509
2515
  constructor(t) {
2510
2516
  super(), this.elements = t;
2511
2517
  }
@@ -2516,9 +2522,9 @@ function yn(t, n) {
2516
2522
  * transforms. Converts all field values to integers or doubles, but unlike the
2517
2523
  * backend does not cap integer values at 2^63. Instead, JavaScript number
2518
2524
  * arithmetic is used and precision loss can occur for values greater than 2^53.
2519
- */ class En extends _n {
2520
- constructor(t, n) {
2521
- super(), this.q = t, this.O = n;
2525
+ */ class be extends ye {
2526
+ constructor(t, e) {
2527
+ super(), this.q = t, this.O = e;
2522
2528
  }
2523
2529
  }
2524
2530
 
@@ -2538,9 +2544,9 @@ function yn(t, n) {
2538
2544
  * See the License for the specific language governing permissions and
2539
2545
  * limitations under the License.
2540
2546
  */
2541
- /** A field path and the TransformOperation to perform upon it. */ class Tn {
2542
- constructor(t, n) {
2543
- this.field = t, this.transform = n;
2547
+ /** A field path and the TransformOperation to perform upon it. */ class Ee {
2548
+ constructor(t, e) {
2549
+ this.field = t, this.transform = e;
2544
2550
  }
2545
2551
  }
2546
2552
 
@@ -2548,18 +2554,18 @@ function yn(t, n) {
2548
2554
  * Encodes a precondition for a mutation. This follows the model that the
2549
2555
  * backend accepts with the special case of an explicit "empty" precondition
2550
2556
  * (meaning no precondition).
2551
- */ class In {
2552
- constructor(t, n) {
2553
- this.updateTime = t, this.exists = n;
2557
+ */ class Te {
2558
+ constructor(t, e) {
2559
+ this.updateTime = t, this.exists = e;
2554
2560
  }
2555
2561
  /** Creates a new empty Precondition. */ static none() {
2556
- return new In;
2562
+ return new Te;
2557
2563
  }
2558
2564
  /** Creates a new Precondition with an exists flag. */ static exists(t) {
2559
- return new In(void 0, t);
2565
+ return new Te(void 0, t);
2560
2566
  }
2561
2567
  /** Creates a new Precondition based on a version a document exists at. */ static updateTime(t) {
2562
- return new In(t);
2568
+ return new Te(t);
2563
2569
  }
2564
2570
  /** Returns whether this Precondition is empty. */ get isNone() {
2565
2571
  return void 0 === this.updateTime && void 0 === this.exists;
@@ -2612,14 +2618,14 @@ function yn(t, n) {
2612
2618
  * applyToLocalView() to implement the actual behavior of applying the mutation
2613
2619
  * to some source document (see `setMutationApplyToRemoteDocument()` for an
2614
2620
  * example).
2615
- */ class An {}
2621
+ */ class Ie {}
2616
2622
 
2617
2623
  /**
2618
2624
  * A mutation that creates or replaces the document at the given key with the
2619
2625
  * object value contents.
2620
- */ class Rn extends An {
2621
- constructor(t, n, e, r = []) {
2622
- super(), this.key = t, this.value = n, this.precondition = e, this.fieldTransforms = r,
2626
+ */ class Ae extends Ie {
2627
+ constructor(t, e, n, r = []) {
2628
+ super(), this.key = t, this.value = e, this.precondition = n, this.fieldTransforms = r,
2623
2629
  this.type = 0 /* Set */;
2624
2630
  }
2625
2631
  }
@@ -2636,16 +2642,16 @@ function yn(t, n) {
2636
2642
  * is deleted.
2637
2643
  * * When a field is not in the mask but is in the values, the values map is
2638
2644
  * ignored.
2639
- */ class Pn extends An {
2640
- constructor(t, n, e, r, s = []) {
2641
- super(), this.key = t, this.data = n, this.fieldMask = e, this.precondition = r,
2645
+ */ class Re extends Ie {
2646
+ constructor(t, e, n, r, s = []) {
2647
+ super(), this.key = t, this.data = e, this.fieldMask = n, this.precondition = r,
2642
2648
  this.fieldTransforms = s, this.type = 1 /* Patch */;
2643
2649
  }
2644
2650
  }
2645
2651
 
2646
- /** A mutation that deletes the document at the given key. */ class Vn extends An {
2647
- constructor(t, n) {
2648
- super(), this.key = t, this.precondition = n, this.type = 2 /* Delete */ , this.fieldTransforms = [];
2652
+ /** A mutation that deletes the document at the given key. */ class Pe extends Ie {
2653
+ constructor(t, e) {
2654
+ super(), this.key = t, this.precondition = e, this.type = 2 /* Delete */ , this.fieldTransforms = [];
2649
2655
  }
2650
2656
  }
2651
2657
 
@@ -2655,9 +2661,9 @@ function yn(t, n) {
2655
2661
  *
2656
2662
  * The `verify` operation is only used in Transactions, and this class serves
2657
2663
  * primarily to facilitate serialization into protos.
2658
- */ class Nn extends An {
2659
- constructor(t, n) {
2660
- super(), this.key = t, this.precondition = n, this.type = 3 /* Verify */ , this.fieldTransforms = [];
2664
+ */ class Ve extends Ie {
2665
+ constructor(t, e) {
2666
+ super(), this.key = t, this.precondition = e, this.type = 3 /* Verify */ , this.fieldTransforms = [];
2661
2667
  }
2662
2668
  }
2663
2669
 
@@ -2676,13 +2682,13 @@ function yn(t, n) {
2676
2682
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2677
2683
  * See the License for the specific language governing permissions and
2678
2684
  * limitations under the License.
2679
- */ const Dn = (() => {
2685
+ */ const Ne = (() => {
2680
2686
  const t = {
2681
2687
  asc: "ASCENDING",
2682
2688
  desc: "DESCENDING"
2683
2689
  };
2684
2690
  return t;
2685
- })(), $n = (() => {
2691
+ })(), De = (() => {
2686
2692
  const t = {
2687
2693
  "<": "LESS_THAN",
2688
2694
  "<=": "LESS_THAN_OR_EQUAL",
@@ -2712,9 +2718,9 @@ function yn(t, n) {
2712
2718
  * TODO(klimt): We can remove the databaseId argument if we keep the full
2713
2719
  * resource name in documents.
2714
2720
  */
2715
- class Sn {
2716
- constructor(t, n) {
2717
- this.databaseId = t, this.F = n;
2721
+ class $e {
2722
+ constructor(t, e) {
2723
+ this.databaseId = t, this.F = e;
2718
2724
  }
2719
2725
  }
2720
2726
 
@@ -2729,13 +2735,13 @@ class Sn {
2729
2735
  /**
2730
2736
  * Returns a value for a Date that's appropriate to put into a proto.
2731
2737
  */
2732
- function Fn(t, n) {
2738
+ function Se(t, e) {
2733
2739
  if (t.F) {
2734
- return `${new Date(1e3 * n.seconds).toISOString().replace(/\.\d*/, "").replace("Z", "")}.${("000000000" + n.nanoseconds).slice(-9)}Z`;
2740
+ return `${new Date(1e3 * e.seconds).toISOString().replace(/\.\d*/, "").replace("Z", "")}.${("000000000" + e.nanoseconds).slice(-9)}Z`;
2735
2741
  }
2736
2742
  return {
2737
- seconds: "" + n.seconds,
2738
- nanos: n.nanoseconds
2743
+ seconds: "" + e.seconds,
2744
+ nanos: e.nanoseconds
2739
2745
  };
2740
2746
  }
2741
2747
 
@@ -2744,234 +2750,234 @@ function Fn(t, n) {
2744
2750
  *
2745
2751
  * Visible for testing.
2746
2752
  */
2747
- function xn(t, n) {
2748
- return t.F ? n.toBase64() : n.toUint8Array();
2753
+ function Fe(t, e) {
2754
+ return t.F ? e.toBase64() : e.toUint8Array();
2749
2755
  }
2750
2756
 
2751
- function qn(t, n) {
2752
- return Fn(t, n.toTimestamp());
2757
+ function xe(t, e) {
2758
+ return Se(t, e.toTimestamp());
2753
2759
  }
2754
2760
 
2755
- function On(t) {
2761
+ function qe(t) {
2756
2762
  return b(!!t), bt.fromTimestamp(function(t) {
2757
- const n = Vt(t);
2758
- return new vt(n.seconds, n.nanos);
2763
+ const e = Vt(t);
2764
+ return new vt(e.seconds, e.nanos);
2759
2765
  }(t));
2760
2766
  }
2761
2767
 
2762
- function Cn(t, n) {
2768
+ function Oe(t, e) {
2763
2769
  return function(t) {
2764
2770
  return new Z([ "projects", t.projectId, "databases", t.database ]);
2765
- }(t).child("documents").child(n).canonicalString();
2771
+ }(t).child("documents").child(e).canonicalString();
2766
2772
  }
2767
2773
 
2768
- function Ln(t, n) {
2769
- return Cn(t.databaseId, n.path);
2774
+ function Ce(t, e) {
2775
+ return Oe(t.databaseId, e.path);
2770
2776
  }
2771
2777
 
2772
- function kn(t, n) {
2773
- const e = function(t) {
2774
- const n = Z.fromString(t);
2775
- return b(Kn(n)), n;
2776
- }(n);
2777
- if (e.get(1) !== t.databaseId.projectId) throw new U(R, "Tried to deserialize key from different project: " + e.get(1) + " vs " + t.databaseId.projectId);
2778
- if (e.get(3) !== t.databaseId.database) throw new U(R, "Tried to deserialize key from different database: " + e.get(3) + " vs " + t.databaseId.database);
2779
- return new et((b((r = e).length > 4 && "documents" === r.get(4)), r.popFirst(5)));
2778
+ function Le(t, e) {
2779
+ const n = function(t) {
2780
+ const e = Z.fromString(t);
2781
+ return b(He(e)), e;
2782
+ }(e);
2783
+ if (n.get(1) !== t.databaseId.projectId) throw new U(R, "Tried to deserialize key from different project: " + n.get(1) + " vs " + t.databaseId.projectId);
2784
+ if (n.get(3) !== t.databaseId.database) throw new U(R, "Tried to deserialize key from different database: " + n.get(3) + " vs " + t.databaseId.database);
2785
+ return new nt((b((r = n).length > 4 && "documents" === r.get(4)), r.popFirst(5)));
2780
2786
  var r;
2781
2787
  /** Creates a Document proto from key and fields (but no create/update time) */}
2782
2788
 
2783
- function Un(t, n) {
2784
- return Cn(t.databaseId, n);
2789
+ function ke(t, e) {
2790
+ return Oe(t.databaseId, e);
2785
2791
  }
2786
2792
 
2787
- function jn(t) {
2793
+ function Ue(t) {
2788
2794
  return new Z([ "projects", t.databaseId.projectId, "databases", t.databaseId.database ]).canonicalString();
2789
2795
  }
2790
2796
 
2791
- function Mn(t, n, e) {
2797
+ function je(t, e, n) {
2792
2798
  return {
2793
- name: Ln(t, n),
2794
- fields: e.value.mapValue.fields
2799
+ name: Ce(t, e),
2800
+ fields: n.value.mapValue.fields
2795
2801
  };
2796
2802
  }
2797
2803
 
2798
- function Bn(t, n) {
2799
- return "found" in n ? function(t, n) {
2800
- b(!!n.found), n.found.name, n.found.updateTime;
2801
- const e = kn(t, n.found.name), r = On(n.found.updateTime), s = new Qt({
2804
+ function Me(t, e) {
2805
+ return "found" in e ? function(t, e) {
2806
+ b(!!e.found), e.found.name, e.found.updateTime;
2807
+ const n = Le(t, e.found.name), r = qe(e.found.updateTime), s = new Gt({
2802
2808
  mapValue: {
2803
- fields: n.found.fields
2809
+ fields: e.found.fields
2804
2810
  }
2805
2811
  });
2806
- return Gt.newFoundDocument(e, r, s);
2807
- }(t, n) : "missing" in n ? function(t, n) {
2808
- b(!!n.missing), b(!!n.readTime);
2809
- const e = kn(t, n.missing), r = On(n.readTime);
2810
- return Gt.newNoDocument(e, r);
2811
- }(t, n) : v();
2812
- }
2813
-
2814
- function zn(t, n) {
2815
- let e;
2816
- if (n instanceof Rn) e = {
2817
- update: Mn(t, n.key, n.value)
2818
- }; else if (n instanceof Vn) e = {
2819
- delete: Ln(t, n.key)
2820
- }; else if (n instanceof Pn) e = {
2821
- update: Mn(t, n.key, n.data),
2822
- updateMask: Hn(n.fieldMask)
2812
+ return Qt.newFoundDocument(n, r, s);
2813
+ }(t, e) : "missing" in e ? function(t, e) {
2814
+ b(!!e.missing), b(!!e.readTime);
2815
+ const n = Le(t, e.missing), r = qe(e.readTime);
2816
+ return Qt.newNoDocument(n, r);
2817
+ }(t, e) : v();
2818
+ }
2819
+
2820
+ function Be(t, e) {
2821
+ let n;
2822
+ if (e instanceof Ae) n = {
2823
+ update: je(t, e.key, e.value)
2824
+ }; else if (e instanceof Pe) n = {
2825
+ delete: Ce(t, e.key)
2826
+ }; else if (e instanceof Re) n = {
2827
+ update: je(t, e.key, e.data),
2828
+ updateMask: Ye(e.fieldMask)
2823
2829
  }; else {
2824
- if (!(n instanceof Nn)) return v();
2825
- e = {
2826
- verify: Ln(t, n.key)
2830
+ if (!(e instanceof Ve)) return v();
2831
+ n = {
2832
+ verify: Ce(t, e.key)
2827
2833
  };
2828
2834
  }
2829
- return n.fieldTransforms.length > 0 && (e.updateTransforms = n.fieldTransforms.map((t => function(t, n) {
2830
- const e = n.transform;
2831
- if (e instanceof gn) return {
2832
- fieldPath: n.field.canonicalString(),
2835
+ return e.fieldTransforms.length > 0 && (n.updateTransforms = e.fieldTransforms.map((t => function(t, e) {
2836
+ const n = e.transform;
2837
+ if (n instanceof _e) return {
2838
+ fieldPath: e.field.canonicalString(),
2833
2839
  setToServerValue: "REQUEST_TIME"
2834
2840
  };
2835
- if (e instanceof vn) return {
2836
- fieldPath: n.field.canonicalString(),
2841
+ if (n instanceof ge) return {
2842
+ fieldPath: e.field.canonicalString(),
2837
2843
  appendMissingElements: {
2838
- values: e.elements
2844
+ values: n.elements
2839
2845
  }
2840
2846
  };
2841
- if (e instanceof bn) return {
2842
- fieldPath: n.field.canonicalString(),
2847
+ if (n instanceof ve) return {
2848
+ fieldPath: e.field.canonicalString(),
2843
2849
  removeAllFromArray: {
2844
- values: e.elements
2850
+ values: n.elements
2845
2851
  }
2846
2852
  };
2847
- if (e instanceof En) return {
2848
- fieldPath: n.field.canonicalString(),
2849
- increment: e.O
2853
+ if (n instanceof be) return {
2854
+ fieldPath: e.field.canonicalString(),
2855
+ increment: n.O
2850
2856
  };
2851
2857
  throw v();
2852
- }(0, t)))), n.precondition.isNone || (e.currentDocument = function(t, n) {
2853
- return void 0 !== n.updateTime ? {
2854
- updateTime: qn(t, n.updateTime)
2855
- } : void 0 !== n.exists ? {
2856
- exists: n.exists
2858
+ }(0, t)))), e.precondition.isNone || (n.currentDocument = function(t, e) {
2859
+ return void 0 !== e.updateTime ? {
2860
+ updateTime: xe(t, e.updateTime)
2861
+ } : void 0 !== e.exists ? {
2862
+ exists: e.exists
2857
2863
  } : v();
2858
- }(t, n.precondition)), e;
2864
+ }(t, e.precondition)), n;
2859
2865
  }
2860
2866
 
2861
- function Qn(t, n) {
2867
+ function ze(t, e) {
2862
2868
  // Dissect the path into parent, collectionId, and optional key filter.
2863
- const e = {
2869
+ const n = {
2864
2870
  structuredQuery: {}
2865
- }, r = n.path;
2866
- null !== n.collectionGroup ? (e.parent = Un(t, r), e.structuredQuery.from = [ {
2867
- collectionId: n.collectionGroup,
2871
+ }, r = e.path;
2872
+ null !== e.collectionGroup ? (n.parent = ke(t, r), n.structuredQuery.from = [ {
2873
+ collectionId: e.collectionGroup,
2868
2874
  allDescendants: !0
2869
- } ]) : (e.parent = Un(t, r.popLast()), e.structuredQuery.from = [ {
2875
+ } ]) : (n.parent = ke(t, r.popLast()), n.structuredQuery.from = [ {
2870
2876
  collectionId: r.lastSegment()
2871
2877
  } ]);
2872
2878
  const s = function(t) {
2873
2879
  if (0 === t.length) return;
2874
- const n = t.map((t =>
2880
+ const e = t.map((t =>
2875
2881
  // visible for testing
2876
2882
  function(t) {
2877
2883
  if ("==" /* EQUAL */ === t.op) {
2878
2884
  if (Mt(t.value)) return {
2879
2885
  unaryFilter: {
2880
- field: Yn(t.field),
2886
+ field: We(t.field),
2881
2887
  op: "IS_NAN"
2882
2888
  }
2883
2889
  };
2884
2890
  if (jt(t.value)) return {
2885
2891
  unaryFilter: {
2886
- field: Yn(t.field),
2892
+ field: We(t.field),
2887
2893
  op: "IS_NULL"
2888
2894
  }
2889
2895
  };
2890
2896
  } else if ("!=" /* NOT_EQUAL */ === t.op) {
2891
2897
  if (Mt(t.value)) return {
2892
2898
  unaryFilter: {
2893
- field: Yn(t.field),
2899
+ field: We(t.field),
2894
2900
  op: "IS_NOT_NAN"
2895
2901
  }
2896
2902
  };
2897
2903
  if (jt(t.value)) return {
2898
2904
  unaryFilter: {
2899
- field: Yn(t.field),
2905
+ field: We(t.field),
2900
2906
  op: "IS_NOT_NULL"
2901
2907
  }
2902
2908
  };
2903
2909
  }
2904
2910
  return {
2905
2911
  fieldFilter: {
2906
- field: Yn(t.field),
2907
- op: Wn(t.op),
2912
+ field: We(t.field),
2913
+ op: Qe(t.op),
2908
2914
  value: t.value
2909
2915
  }
2910
2916
  };
2911
2917
  }(t)));
2912
- if (1 === n.length) return n[0];
2918
+ if (1 === e.length) return e[0];
2913
2919
  return {
2914
2920
  compositeFilter: {
2915
2921
  op: "AND",
2916
- filters: n
2922
+ filters: e
2917
2923
  }
2918
2924
  };
2919
- }(n.filters);
2920
- s && (e.structuredQuery.where = s);
2925
+ }(e.filters);
2926
+ s && (n.structuredQuery.where = s);
2921
2927
  const i = function(t) {
2922
2928
  if (0 === t.length) return;
2923
2929
  return t.map((t =>
2924
2930
  // visible for testing
2925
2931
  function(t) {
2926
2932
  return {
2927
- field: Yn(t.field),
2928
- direction: Gn(t.dir)
2933
+ field: We(t.field),
2934
+ direction: Ge(t.dir)
2929
2935
  };
2930
2936
  }(t)));
2931
- }(n.orderBy);
2932
- i && (e.structuredQuery.orderBy = i);
2933
- const o = function(t, n) {
2934
- return t.F || at(n) ? n : {
2935
- value: n
2937
+ }(e.orderBy);
2938
+ i && (n.structuredQuery.orderBy = i);
2939
+ const o = function(t, e) {
2940
+ return t.F || at(e) ? e : {
2941
+ value: e
2936
2942
  };
2937
- }(t, n.limit);
2943
+ }(t, e.limit);
2938
2944
  var u;
2939
- return null !== o && (e.structuredQuery.limit = o), n.startAt && (e.structuredQuery.startAt = {
2940
- before: (u = n.startAt).inclusive,
2945
+ return null !== o && (n.structuredQuery.limit = o), e.startAt && (n.structuredQuery.startAt = {
2946
+ before: (u = e.startAt).inclusive,
2941
2947
  values: u.position
2942
- }), n.endAt && (e.structuredQuery.endAt = function(t) {
2948
+ }), e.endAt && (n.structuredQuery.endAt = function(t) {
2943
2949
  return {
2944
2950
  before: !t.inclusive,
2945
2951
  values: t.position
2946
2952
  };
2947
2953
  }
2948
2954
  // visible for testing
2949
- (n.endAt)), e;
2955
+ (e.endAt)), n;
2950
2956
  }
2951
2957
 
2952
- function Gn(t) {
2953
- return Dn[t];
2958
+ function Ge(t) {
2959
+ return Ne[t];
2954
2960
  }
2955
2961
 
2956
2962
  // visible for testing
2957
- function Wn(t) {
2958
- return $n[t];
2963
+ function Qe(t) {
2964
+ return De[t];
2959
2965
  }
2960
2966
 
2961
- function Yn(t) {
2967
+ function We(t) {
2962
2968
  return {
2963
2969
  fieldPath: t.canonicalString()
2964
2970
  };
2965
2971
  }
2966
2972
 
2967
- function Hn(t) {
2968
- const n = [];
2969
- return t.fields.forEach((t => n.push(t.canonicalString()))), {
2970
- fieldPaths: n
2973
+ function Ye(t) {
2974
+ const e = [];
2975
+ return t.fields.forEach((t => e.push(t.canonicalString()))), {
2976
+ fieldPaths: e
2971
2977
  };
2972
2978
  }
2973
2979
 
2974
- function Kn(t) {
2980
+ function He(t) {
2975
2981
  // Resource names have at least 4 components (project ID, database ID)
2976
2982
  return t.length >= 4 && "projects" === t.get(0) && "databases" === t.get(2);
2977
2983
  }
@@ -2991,8 +2997,8 @@ function Kn(t) {
2991
2997
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2992
2998
  * See the License for the specific language governing permissions and
2993
2999
  * limitations under the License.
2994
- */ function Jn(t) {
2995
- return new Sn(t, /* useProto3Json= */ !0);
3000
+ */ function Ke(t) {
3001
+ return new $e(t, /* useProto3Json= */ !0);
2996
3002
  }
2997
3003
 
2998
3004
  /**
@@ -3020,7 +3026,7 @@ function Kn(t) {
3020
3026
  * base delay. This prevents clients from accidentally synchronizing their
3021
3027
  * delays causing spikes of load to the backend.
3022
3028
  */
3023
- class Xn {
3029
+ class Je {
3024
3030
  constructor(
3025
3031
  /**
3026
3032
  * The AsyncQueue to run backoff operations on.
@@ -3029,13 +3035,13 @@ class Xn {
3029
3035
  /**
3030
3036
  * The ID to use when scheduling backoff operations on the AsyncQueue.
3031
3037
  */
3032
- n,
3038
+ e,
3033
3039
  /**
3034
3040
  * The initial delay (used as the base delay on the first retry attempt).
3035
3041
  * Note that jitter will still be applied, so the actual delay could be as
3036
3042
  * little as 0.5*initialDelayMs.
3037
3043
  */
3038
- e = 1e3
3044
+ n = 1e3
3039
3045
  /**
3040
3046
  * The multiplier to use to determine the extended base delay after each
3041
3047
  * attempt.
@@ -3045,7 +3051,7 @@ class Xn {
3045
3051
  * Note that jitter will still be applied, so the actual delay could be as
3046
3052
  * much as 1.5*maxDelayMs.
3047
3053
  */ , s = 6e4) {
3048
- this.C = t, this.timerId = n, this.L = e, this.k = r, this.U = s, this.j = 0, this.M = null,
3054
+ this.C = t, this.timerId = e, this.L = n, this.k = r, this.U = s, this.j = 0, this.M = null,
3049
3055
  /** The last backoff attempt, as epoch milliseconds. */
3050
3056
  this.B = Date.now(), this.reset();
3051
3057
  }
@@ -3073,9 +3079,9 @@ class Xn {
3073
3079
  this.cancel();
3074
3080
  // First schedule using the current base (which may be 0 and should be
3075
3081
  // honored as such).
3076
- const n = Math.floor(this.j + this.Y()), e = Math.max(0, Date.now() - this.B), r = Math.max(0, n - e);
3082
+ const e = Math.floor(this.j + this.Y()), n = Math.max(0, Date.now() - this.B), r = Math.max(0, e - n);
3077
3083
  // Guard against lastAttemptTime being in the future due to a clock change.
3078
- r > 0 && p("ExponentialBackoff", `Backing off for ${r} ms (base delay: ${this.j} ms, delay with jitter: ${n} ms, last attempt: ${e} ms ago)`),
3084
+ r > 0 && p("ExponentialBackoff", `Backing off for ${r} ms (base delay: ${this.j} ms, delay with jitter: ${e} ms, last attempt: ${n} ms ago)`),
3079
3085
  this.M = this.C.enqueueAfterDelay(this.timerId, r, (() => (this.B = Date.now(),
3080
3086
  t()))),
3081
3087
  // Apply backoff factor to determine next delay and ensure it is within
@@ -3118,22 +3124,22 @@ class Xn {
3118
3124
  * An implementation of Datastore that exposes additional state for internal
3119
3125
  * consumption.
3120
3126
  */
3121
- class Zn extends class {} {
3122
- constructor(t, n, e, r) {
3123
- super(), this.authCredentials = t, this.appCheckCredentials = n, this.K = e, this.q = r,
3127
+ class Xe extends class {} {
3128
+ constructor(t, e, n, r) {
3129
+ super(), this.authCredentials = t, this.appCheckCredentials = e, this.K = n, this.q = r,
3124
3130
  this.J = !1;
3125
3131
  }
3126
3132
  X() {
3127
3133
  if (this.J) throw new U(F, "The client has already been terminated.");
3128
3134
  }
3129
- /** Invokes the provided RPC with auth and AppCheck tokens. */ m(t, n, e) {
3130
- return this.X(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([r, s]) => this.K.m(t, n, e, r, s))).catch((t => {
3135
+ /** Invokes the provided RPC with auth and AppCheck tokens. */ m(t, e, n) {
3136
+ return this.X(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([r, s]) => this.K.m(t, e, n, r, s))).catch((t => {
3131
3137
  throw "FirebaseError" === t.name ? (t.code === $ && (this.authCredentials.invalidateToken(),
3132
3138
  this.appCheckCredentials.invalidateToken()), t) : new U(A, t.toString());
3133
3139
  }));
3134
3140
  }
3135
- /** Invokes the provided RPC with streamed results with auth and AppCheck tokens. */ T(t, n, e) {
3136
- return this.X(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([r, s]) => this.K.T(t, n, e, r, s))).catch((t => {
3141
+ /** Invokes the provided RPC with streamed results with auth and AppCheck tokens. */ T(t, e, n) {
3142
+ return this.X(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([r, s]) => this.K.T(t, e, n, r, s))).catch((t => {
3137
3143
  throw "FirebaseError" === t.name ? (t.code === $ && (this.authCredentials.invalidateToken(),
3138
3144
  this.appCheckCredentials.invalidateToken()), t) : new U(A, t.toString());
3139
3145
  }));
@@ -3145,40 +3151,40 @@ class Zn extends class {} {
3145
3151
 
3146
3152
  // TODO(firestorexp): Make sure there is only one Datastore instance per
3147
3153
  // firestore-exp client.
3148
- async function te(t, n) {
3149
- const e = E(t), r = jn(e.q) + "/documents", s = {
3150
- writes: n.map((t => zn(e.q, t)))
3154
+ async function Ze(t, e) {
3155
+ const n = E(t), r = Ue(n.q) + "/documents", s = {
3156
+ writes: e.map((t => Be(n.q, t)))
3151
3157
  };
3152
- await e.m("Commit", r, s);
3158
+ await n.m("Commit", r, s);
3153
3159
  }
3154
3160
 
3155
- async function ne(t, n) {
3156
- const e = E(t), r = jn(e.q) + "/documents", s = {
3157
- documents: n.map((t => Ln(e.q, t)))
3158
- }, i = await e.T("BatchGetDocuments", r, s), o = new Map;
3161
+ async function tn(t, e) {
3162
+ const n = E(t), r = Ue(n.q) + "/documents", s = {
3163
+ documents: e.map((t => Ce(n.q, t)))
3164
+ }, i = await n.T("BatchGetDocuments", r, s), o = new Map;
3159
3165
  i.forEach((t => {
3160
- const n = Bn(e.q, t);
3161
- o.set(n.key.toString(), n);
3166
+ const e = Me(n.q, t);
3167
+ o.set(e.key.toString(), e);
3162
3168
  }));
3163
3169
  const u = [];
3164
- return n.forEach((t => {
3165
- const n = o.get(t.toString());
3166
- b(!!n), u.push(n);
3170
+ return e.forEach((t => {
3171
+ const e = o.get(t.toString());
3172
+ b(!!e), u.push(e);
3167
3173
  })), u;
3168
3174
  }
3169
3175
 
3170
- async function ee(t, n) {
3171
- const e = E(t), r = Qn(e.q, mn(n));
3172
- return (await e.T("RunQuery", r.parent, {
3176
+ async function en(t, e) {
3177
+ const n = E(t), r = ze(n.q, we(e));
3178
+ return (await n.T("RunQuery", r.parent, {
3173
3179
  structuredQuery: r.structuredQuery
3174
- })).filter((t => !!t.document)).map((t => function(t, n, e) {
3175
- const r = kn(t, n.name), s = On(n.updateTime), i = new Qt({
3180
+ })).filter((t => !!t.document)).map((t => function(t, e, n) {
3181
+ const r = Le(t, e.name), s = qe(e.updateTime), i = new Gt({
3176
3182
  mapValue: {
3177
- fields: n.fields
3183
+ fields: e.fields
3178
3184
  }
3179
- }), o = Gt.newFoundDocument(r, s, i);
3180
- return e && o.setHasCommittedMutations(), e ? o.setHasCommittedMutations() : o;
3181
- }(e.q, t.document, void 0)));
3185
+ }), o = Qt.newFoundDocument(r, s, i);
3186
+ return n && o.setHasCommittedMutations(), n ? o.setHasCommittedMutations() : o;
3187
+ }(n.q, t.document, void 0)));
3182
3188
  }
3183
3189
 
3184
3190
  /**
@@ -3196,7 +3202,7 @@ async function ee(t, n) {
3196
3202
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3197
3203
  * See the License for the specific language governing permissions and
3198
3204
  * limitations under the License.
3199
- */ const re = new Map;
3205
+ */ const nn = new Map;
3200
3206
 
3201
3207
  /**
3202
3208
  * An instance map that ensures only one Datastore exists per Firestore
@@ -3207,19 +3213,19 @@ async function ee(t, n) {
3207
3213
  * instance. Callers must invoke removeComponents() when the Firestore
3208
3214
  * instance is terminated.
3209
3215
  */
3210
- function se(t) {
3216
+ function rn(t) {
3211
3217
  if (t._terminated) throw new U(F, "The client has already been terminated.");
3212
- if (!re.has(t)) {
3218
+ if (!nn.has(t)) {
3213
3219
  p("ComponentProvider", "Initializing Datastore");
3214
3220
  const i = function(t) {
3215
3221
  return new mt(t, fetch.bind(null));
3216
- }((n = t._databaseId, e = t.app.options.appId || "", r = t._persistenceKey, s = t._freezeSettings(),
3217
- new K(n, e, r, s.host, s.ssl, s.experimentalForceLongPolling, s.experimentalAutoDetectLongPolling, s.useFetchStreams))), o = Jn(t._databaseId), u = function(t, n, e, r) {
3218
- return new Zn(t, n, e, r);
3222
+ }((e = t._databaseId, n = t.app.options.appId || "", r = t._persistenceKey, s = t._freezeSettings(),
3223
+ new K(e, n, r, s.host, s.ssl, s.experimentalForceLongPolling, s.experimentalAutoDetectLongPolling, s.useFetchStreams))), o = Ke(t._databaseId), u = function(t, e, n, r) {
3224
+ return new Xe(t, e, n, r);
3219
3225
  }(t._authCredentials, t._appCheckCredentials, i, o);
3220
- re.set(t, u);
3226
+ nn.set(t, u);
3221
3227
  }
3222
- var n, e, r, s;
3228
+ var e, n, r, s;
3223
3229
  /**
3224
3230
  * @license
3225
3231
  * Copyright 2018 Google LLC
@@ -3235,7 +3241,7 @@ function se(t) {
3235
3241
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3236
3242
  * See the License for the specific language governing permissions and
3237
3243
  * limitations under the License.
3238
- */ return re.get(t);
3244
+ */ return nn.get(t);
3239
3245
  }
3240
3246
 
3241
3247
  /**
@@ -3247,21 +3253,21 @@ function se(t) {
3247
3253
  * user-supplied `FirestoreSettings` object. This is a separate type so that
3248
3254
  * defaults can be supplied and the value can be checked for equality.
3249
3255
  */
3250
- class ie {
3256
+ class sn {
3251
3257
  constructor(t) {
3252
- var n;
3258
+ var e;
3253
3259
  if (void 0 === t.host) {
3254
3260
  if (void 0 !== t.ssl) throw new U(R, "Can't provide ssl option if host option is not set");
3255
3261
  this.host = "firestore.googleapis.com", this.ssl = true;
3256
- } else this.host = t.host, this.ssl = null === (n = t.ssl) || void 0 === n || n;
3262
+ } else this.host = t.host, this.ssl = null === (e = t.ssl) || void 0 === e || e;
3257
3263
  if (this.credentials = t.credentials, this.ignoreUndefinedProperties = !!t.ignoreUndefinedProperties,
3258
3264
  void 0 === t.cacheSizeBytes) this.cacheSizeBytes = 41943040; else {
3259
3265
  if (-1 !== t.cacheSizeBytes && t.cacheSizeBytes < 1048576) throw new U(R, "cacheSizeBytes must be at least 1048576");
3260
3266
  this.cacheSizeBytes = t.cacheSizeBytes;
3261
3267
  }
3262
3268
  this.experimentalForceLongPolling = !!t.experimentalForceLongPolling, this.experimentalAutoDetectLongPolling = !!t.experimentalAutoDetectLongPolling,
3263
- this.useFetchStreams = !!t.useFetchStreams, function(t, n, e, r) {
3264
- if (!0 === n && !0 === r) throw new U(R, `${t} and ${e} cannot be used together.`);
3269
+ this.useFetchStreams = !!t.useFetchStreams, function(t, e, n, r) {
3270
+ if (!0 === e && !0 === r) throw new U(R, `${t} and ${n} cannot be used together.`);
3265
3271
  }("experimentalForceLongPolling", t.experimentalForceLongPolling, "experimentalAutoDetectLongPolling", t.experimentalAutoDetectLongPolling);
3266
3272
  }
3267
3273
  isEqual(t) {
@@ -3289,14 +3295,14 @@ class ie {
3289
3295
  * The Cloud Firestore service interface.
3290
3296
  *
3291
3297
  * Do not call this constructor directly. Instead, use {@link getFirestore}.
3292
- */ class oe {
3298
+ */ class on {
3293
3299
  /** @hideconstructor */
3294
- constructor(t, n, e) {
3295
- this._authCredentials = n, this._appCheckCredentials = e,
3300
+ constructor(t, e, n) {
3301
+ this._authCredentials = e, this._appCheckCredentials = n,
3296
3302
  /**
3297
3303
  * Whether it's a Firestore or Firestore Lite instance.
3298
3304
  */
3299
- this.type = "firestore-lite", this._persistenceKey = "(lite)", this._settings = new ie({}),
3305
+ this.type = "firestore-lite", this._persistenceKey = "(lite)", this._settings = new sn({}),
3300
3306
  this._settingsFrozen = !1, t instanceof J ? this._databaseId = t : (this._app = t,
3301
3307
  this._databaseId = function(t) {
3302
3308
  if (!Object.prototype.hasOwnProperty.apply(t.options, [ "projectId" ])) throw new U(R, '"projectId" not provided in firebase.initializeApp.');
@@ -3329,14 +3335,14 @@ class ie {
3329
3335
  }
3330
3336
  _setSettings(t) {
3331
3337
  if (this._settingsFrozen) throw new U(F, "Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");
3332
- this._settings = new ie(t), void 0 !== t.credentials && (this._authCredentials = function(t) {
3338
+ this._settings = new sn(t), void 0 !== t.credentials && (this._authCredentials = function(t) {
3333
3339
  if (!t) return new B;
3334
3340
  switch (t.type) {
3335
3341
  case "gapi":
3336
- const n = t.client;
3342
+ const e = t.client;
3337
3343
  // Make sure this really is a Gapi client.
3338
- return b(!("object" != typeof n || null === n || !n.auth || !n.auth.getAuthHeaderValueForFirstParty)),
3339
- new W(n, t.sessionIndex || "0", t.iamToken || null);
3344
+ return b(!("object" != typeof e || null === e || !e.auth || !e.auth.getAuthHeaderValueForFirstParty)),
3345
+ new W(e, t.sessionIndex || "0", t.iamToken || null);
3340
3346
 
3341
3347
  case "provider":
3342
3348
  return t.client;
@@ -3370,17 +3376,17 @@ class ie {
3370
3376
  * Only ever called once.
3371
3377
  */ _terminate() {
3372
3378
  return function(t) {
3373
- const n = re.get(t);
3374
- n && (p("ComponentProvider", "Removing Datastore"), re.delete(t), n.terminate());
3379
+ const e = nn.get(t);
3380
+ e && (p("ComponentProvider", "Removing Datastore"), nn.delete(t), e.terminate());
3375
3381
  }(this), Promise.resolve();
3376
3382
  }
3377
3383
  }
3378
3384
 
3379
- function ue(t, n) {
3380
- const e = _getProvider(t, "firestore/lite");
3381
- if (e.isInitialized()) throw new U(F, "Firestore can only be initialized once per app.");
3382
- return e.initialize({
3383
- options: n
3385
+ function un(t, e) {
3386
+ const n = _getProvider(t, "firestore/lite");
3387
+ if (n.isInitialized()) throw new U(F, "Firestore can only be initialized once per app.");
3388
+ return n.initialize({
3389
+ options: e
3384
3390
  });
3385
3391
  }
3386
3392
 
@@ -3392,8 +3398,8 @@ function ue(t, n) {
3392
3398
  * @param app - The {@link @firebase/app#FirebaseApp} instance that the returned `Firestore`
3393
3399
  * instance is associated with.
3394
3400
  * @returns The `Firestore` instance of the provided app.
3395
- */ function ce(n = t()) {
3396
- return _getProvider(n, "firestore/lite").getImmediate();
3401
+ */ function cn(e = t()) {
3402
+ return _getProvider(e, "firestore/lite").getImmediate();
3397
3403
  }
3398
3404
 
3399
3405
  /**
@@ -3408,24 +3414,24 @@ function ue(t, n) {
3408
3414
  * @param port - the emulator port (ex: 9000).
3409
3415
  * @param options.mockUserToken - the mock auth token to use for unit testing
3410
3416
  * Security Rules.
3411
- */ function ae(t, n, e, r = {}) {
3417
+ */ function an(t, e, n, r = {}) {
3412
3418
  var s;
3413
- const i = (t = ut(t, oe))._getSettings();
3414
- if ("firestore.googleapis.com" !== i.host && i.host !== n && _("Host has been set in both settings() and useEmulator(), emulator host will be used"),
3419
+ const i = (t = ut(t, on))._getSettings();
3420
+ if ("firestore.googleapis.com" !== i.host && i.host !== e && _("Host has been set in both settings() and useEmulator(), emulator host will be used"),
3415
3421
  t._setSettings(Object.assign(Object.assign({}, i), {
3416
- host: `${n}:${e}`,
3422
+ host: `${e}:${n}`,
3417
3423
  ssl: !1
3418
3424
  })), r.mockUserToken) {
3419
- let n, e;
3420
- if ("string" == typeof r.mockUserToken) n = r.mockUserToken, e = f.MOCK_USER; else {
3425
+ let e, n;
3426
+ if ("string" == typeof r.mockUserToken) e = r.mockUserToken, n = f.MOCK_USER; else {
3421
3427
  // Let createMockUserToken validate first (catches common mistakes like
3422
3428
  // invalid field "uid" and missing field "sub" / "user_id".)
3423
- n = h(r.mockUserToken, null === (s = t._app) || void 0 === s ? void 0 : s.options.projectId);
3429
+ e = h(r.mockUserToken, null === (s = t._app) || void 0 === s ? void 0 : s.options.projectId);
3424
3430
  const i = r.mockUserToken.sub || r.mockUserToken.user_id;
3425
3431
  if (!i) throw new U(R, "mockUserToken must contain 'sub' or 'user_id' field!");
3426
- e = new f(i);
3432
+ n = new f(i);
3427
3433
  }
3428
- t._authCredentials = new z(new M(n, e));
3434
+ t._authCredentials = new z(new M(e, n));
3429
3435
  }
3430
3436
  }
3431
3437
 
@@ -3448,8 +3454,8 @@ function ue(t, n) {
3448
3454
  * @param firestore - The `Firestore` instance to terminate.
3449
3455
  * @returns A `Promise` that is resolved when the instance has been successfully
3450
3456
  * terminated.
3451
- */ function he(t) {
3452
- return t = ut(t, oe), n(t.app, "firestore/lite"), t._delete();
3457
+ */ function hn(t) {
3458
+ return t = ut(t, on), e(t.app, "firestore/lite"), t._delete();
3453
3459
  }
3454
3460
 
3455
3461
  /**
@@ -3489,14 +3495,14 @@ function ue(t, n) {
3489
3495
  * and can be used to write, read, or listen to the location. The document at
3490
3496
  * the referenced location may or may not exist.
3491
3497
  */
3492
- class le {
3498
+ class ln {
3493
3499
  /** @hideconstructor */
3494
3500
  constructor(t,
3495
3501
  /**
3496
3502
  * If provided, the `FirestoreDataConverter` associated with this instance.
3497
3503
  */
3498
- n, e) {
3499
- this.converter = n, this._key = e,
3504
+ e, n) {
3505
+ this.converter = e, this._key = n,
3500
3506
  /** The type of this Firestore reference. */
3501
3507
  this.type = "document", this.firestore = t;
3502
3508
  }
@@ -3517,40 +3523,40 @@ class le {
3517
3523
  /**
3518
3524
  * The collection this `DocumentReference` belongs to.
3519
3525
  */ get parent() {
3520
- return new de(this.firestore, this.converter, this._key.path.popLast());
3526
+ return new dn(this.firestore, this.converter, this._key.path.popLast());
3521
3527
  }
3522
3528
  withConverter(t) {
3523
- return new le(this.firestore, t, this._key);
3529
+ return new ln(this.firestore, t, this._key);
3524
3530
  }
3525
3531
  }
3526
3532
 
3527
3533
  /**
3528
3534
  * A `Query` refers to a query which you can read or listen to. You can also
3529
3535
  * construct refined `Query` objects by adding filters and ordering.
3530
- */ class fe {
3536
+ */ class fn {
3531
3537
  // This is the lite version of the Query class in the main SDK.
3532
3538
  /** @hideconstructor protected */
3533
3539
  constructor(t,
3534
3540
  /**
3535
3541
  * If provided, the `FirestoreDataConverter` associated with this instance.
3536
3542
  */
3537
- n, e) {
3538
- this.converter = n, this._query = e,
3543
+ e, n) {
3544
+ this.converter = e, this._query = n,
3539
3545
  /** The type of this Firestore reference. */
3540
3546
  this.type = "query", this.firestore = t;
3541
3547
  }
3542
3548
  withConverter(t) {
3543
- return new fe(this.firestore, t, this._query);
3549
+ return new fn(this.firestore, t, this._query);
3544
3550
  }
3545
3551
  }
3546
3552
 
3547
3553
  /**
3548
3554
  * A `CollectionReference` object can be used for adding documents, getting
3549
3555
  * document references, and querying for documents (using {@link query}).
3550
- */ class de extends fe {
3556
+ */ class dn extends fn {
3551
3557
  /** @hideconstructor */
3552
- constructor(t, n, e) {
3553
- super(t, n, new an(e)), this._path = e,
3558
+ constructor(t, e, n) {
3559
+ super(t, e, new ce(n)), this._path = n,
3554
3560
  /** The type of this Firestore reference. */
3555
3561
  this.type = "collection";
3556
3562
  }
@@ -3568,23 +3574,23 @@ class le {
3568
3574
  * subcollection. If this isn't a subcollection, the reference is null.
3569
3575
  */ get parent() {
3570
3576
  const t = this._path.popLast();
3571
- return t.isEmpty() ? null : new le(this.firestore,
3572
- /* converter= */ null, new et(t));
3577
+ return t.isEmpty() ? null : new ln(this.firestore,
3578
+ /* converter= */ null, new nt(t));
3573
3579
  }
3574
3580
  withConverter(t) {
3575
- return new de(this.firestore, t, this._path);
3581
+ return new dn(this.firestore, t, this._path);
3576
3582
  }
3577
3583
  }
3578
3584
 
3579
- function we(t, n, ...e) {
3580
- if (t = l(t), rt("collection", "path", n), t instanceof oe) {
3581
- const r = Z.fromString(n, ...e);
3582
- return it(r), new de(t, /* converter= */ null, r);
3585
+ function wn(t, e, ...n) {
3586
+ if (t = l(t), rt("collection", "path", e), t instanceof on) {
3587
+ const r = Z.fromString(e, ...n);
3588
+ return it(r), new dn(t, /* converter= */ null, r);
3583
3589
  }
3584
3590
  {
3585
- if (!(t instanceof le || t instanceof de)) throw new U(R, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
3586
- const r = t._path.child(Z.fromString(n, ...e));
3587
- return it(r), new de(t.firestore,
3591
+ if (!(t instanceof ln || t instanceof dn)) throw new U(R, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
3592
+ const r = t._path.child(Z.fromString(e, ...n));
3593
+ return it(r), new dn(t.firestore,
3588
3594
  /* converter= */ null, r);
3589
3595
  }
3590
3596
  }
@@ -3601,32 +3607,32 @@ function we(t, n, ...e) {
3601
3607
  * collection or subcollection with this ID as the last segment of its path
3602
3608
  * will be included. Cannot contain a slash.
3603
3609
  * @returns The created `Query`.
3604
- */ function me(t, n) {
3605
- if (t = ut(t, oe), rt("collectionGroup", "collection id", n), n.indexOf("/") >= 0) throw new U(R, `Invalid collection ID '${n}' passed to function collectionGroup(). Collection IDs must not contain '/'.`);
3606
- return new fe(t,
3610
+ */ function mn(t, e) {
3611
+ if (t = ut(t, on), rt("collectionGroup", "collection id", e), e.indexOf("/") >= 0) throw new U(R, `Invalid collection ID '${e}' passed to function collectionGroup(). Collection IDs must not contain '/'.`);
3612
+ return new fn(t,
3607
3613
  /* converter= */ null,
3608
3614
  /**
3609
3615
  * Creates a new Query for a collection group query that matches all documents
3610
3616
  * within the provided collection group.
3611
3617
  */
3612
3618
  function(t) {
3613
- return new an(Z.emptyPath(), t);
3614
- }(n));
3619
+ return new ce(Z.emptyPath(), t);
3620
+ }(e));
3615
3621
  }
3616
3622
 
3617
- function pe(t, n, ...e) {
3623
+ function pn(t, e, ...n) {
3618
3624
  if (t = l(t),
3619
3625
  // We allow omission of 'pathString' but explicitly prohibit passing in both
3620
3626
  // 'undefined' and 'null'.
3621
- 1 === arguments.length && (n = yt.R()), rt("doc", "path", n), t instanceof oe) {
3622
- const r = Z.fromString(n, ...e);
3623
- return st(r), new le(t,
3624
- /* converter= */ null, new et(r));
3627
+ 1 === arguments.length && (e = yt.R()), rt("doc", "path", e), t instanceof on) {
3628
+ const r = Z.fromString(e, ...n);
3629
+ return st(r), new ln(t,
3630
+ /* converter= */ null, new nt(r));
3625
3631
  }
3626
3632
  {
3627
- if (!(t instanceof le || t instanceof de)) throw new U(R, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
3628
- const r = t._path.child(Z.fromString(n, ...e));
3629
- return st(r), new le(t.firestore, t instanceof de ? t.converter : null, new et(r));
3633
+ if (!(t instanceof ln || t instanceof dn)) throw new U(R, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
3634
+ const r = t._path.child(Z.fromString(e, ...n));
3635
+ return st(r), new ln(t.firestore, t instanceof dn ? t.converter : null, new nt(r));
3630
3636
  }
3631
3637
  }
3632
3638
 
@@ -3637,8 +3643,8 @@ function pe(t, n, ...e) {
3637
3643
  * @param right - A reference to compare.
3638
3644
  * @returns true if the references point to the same location in the same
3639
3645
  * Firestore database.
3640
- */ function ye(t, n) {
3641
- return t = l(t), n = l(n), (t instanceof le || t instanceof de) && (n instanceof le || n instanceof de) && (t.firestore === n.firestore && t.path === n.path && t.converter === n.converter);
3646
+ */ function yn(t, e) {
3647
+ return t = l(t), e = l(e), (t instanceof ln || t instanceof dn) && (e instanceof ln || e instanceof dn) && (t.firestore === e.firestore && t.path === e.path && t.converter === e.converter);
3642
3648
  }
3643
3649
 
3644
3650
  /**
@@ -3649,8 +3655,8 @@ function pe(t, n, ...e) {
3649
3655
  * @param right - A `Query` to compare.
3650
3656
  * @returns true if the references point to the same location in the same
3651
3657
  * Firestore database.
3652
- */ function _e(t, n) {
3653
- return t = l(t), n = l(n), t instanceof fe && n instanceof fe && (t.firestore === n.firestore && pn(t._query, n._query) && t.converter === n.converter);
3658
+ */ function _n(t, e) {
3659
+ return t = l(t), e = l(e), t instanceof fn && e instanceof fn && (t.firestore === e.firestore && me(t._query, e._query) && t.converter === e.converter);
3654
3660
  }
3655
3661
 
3656
3662
  /**
@@ -3676,7 +3682,7 @@ function pe(t, n, ...e) {
3676
3682
  *
3677
3683
  * Create a `FieldPath` by providing field names. If more than one field
3678
3684
  * name is provided, the path will point to a nested field in a document.
3679
- */ class ge {
3685
+ */ class gn {
3680
3686
  /**
3681
3687
  * Creates a `FieldPath` from the provided field names. If more than one field
3682
3688
  * name is provided, the path will point to a nested field in a document.
@@ -3684,8 +3690,8 @@ function pe(t, n, ...e) {
3684
3690
  * @param fieldNames - A list of field names.
3685
3691
  */
3686
3692
  constructor(...t) {
3687
- for (let n = 0; n < t.length; ++n) if (0 === t[n].length) throw new U(R, "Invalid field name at argument $(i + 1). Field names must not be empty.");
3688
- this._internalPath = new nt(t);
3693
+ for (let e = 0; e < t.length; ++e) if (0 === t[e].length) throw new U(R, "Invalid field name at argument $(i + 1). Field names must not be empty.");
3694
+ this._internalPath = new et(t);
3689
3695
  }
3690
3696
  /**
3691
3697
  * Returns true if this `FieldPath` is equal to the provided one.
@@ -3700,8 +3706,8 @@ function pe(t, n, ...e) {
3700
3706
  /**
3701
3707
  * Returns a special sentinel `FieldPath` to refer to the ID of a document.
3702
3708
  * It can be used in queries to sort or filter by the document ID.
3703
- */ function ve() {
3704
- return new ge("__name__");
3709
+ */ function vn() {
3710
+ return new gn("__name__");
3705
3711
  }
3706
3712
 
3707
3713
  /**
@@ -3722,7 +3728,7 @@ function pe(t, n, ...e) {
3722
3728
  */
3723
3729
  /**
3724
3730
  * An immutable object representing an array of bytes.
3725
- */ class be {
3731
+ */ class bn {
3726
3732
  /** @hideconstructor */
3727
3733
  constructor(t) {
3728
3734
  this._byteString = t;
@@ -3734,7 +3740,7 @@ function pe(t, n, ...e) {
3734
3740
  * @param base64 - The Base64 string used to create the `Bytes` object.
3735
3741
  */ static fromBase64String(t) {
3736
3742
  try {
3737
- return new be(Rt.fromBase64String(t));
3743
+ return new bn(Rt.fromBase64String(t));
3738
3744
  } catch (t) {
3739
3745
  throw new U(R, "Failed to construct data from Base64 string: " + t);
3740
3746
  }
@@ -3744,7 +3750,7 @@ function pe(t, n, ...e) {
3744
3750
  *
3745
3751
  * @param array - The Uint8Array used to create the `Bytes` object.
3746
3752
  */ static fromUint8Array(t) {
3747
- return new be(Rt.fromUint8Array(t));
3753
+ return new bn(Rt.fromUint8Array(t));
3748
3754
  }
3749
3755
  /**
3750
3756
  * Returns the underlying bytes as a Base64-encoded string.
@@ -3796,7 +3802,7 @@ function pe(t, n, ...e) {
3796
3802
  /**
3797
3803
  * Sentinel values that can be used when writing document fields with `set()`
3798
3804
  * or `update()`.
3799
- */ class Ee {
3805
+ */ class En {
3800
3806
  /**
3801
3807
  * @param _methodName - The public API endpoint that returns this class.
3802
3808
  * @hideconstructor
@@ -3828,17 +3834,17 @@ function pe(t, n, ...e) {
3828
3834
  *
3829
3835
  * Latitude values are in the range of [-90, 90].
3830
3836
  * Longitude values are in the range of [-180, 180].
3831
- */ class Te {
3837
+ */ class Tn {
3832
3838
  /**
3833
3839
  * Creates a new immutable `GeoPoint` object with the provided latitude and
3834
3840
  * longitude values.
3835
3841
  * @param latitude - The latitude as number between -90 and 90.
3836
3842
  * @param longitude - The longitude as number between -180 and 180.
3837
3843
  */
3838
- constructor(t, n) {
3844
+ constructor(t, e) {
3839
3845
  if (!isFinite(t) || t < -90 || t > 90) throw new U(R, "Latitude must be a number between -90 and 90, but was: " + t);
3840
- if (!isFinite(n) || n < -180 || n > 180) throw new U(R, "Longitude must be a number between -180 and 180, but was: " + n);
3841
- this._lat = t, this._long = n;
3846
+ if (!isFinite(e) || e < -180 || e > 180) throw new U(R, "Longitude must be a number between -180 and 180, but was: " + e);
3847
+ this._lat = t, this._long = e;
3842
3848
  }
3843
3849
  /**
3844
3850
  * The latitude of this `GeoPoint` instance.
@@ -3887,29 +3893,29 @@ function pe(t, n, ...e) {
3887
3893
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3888
3894
  * See the License for the specific language governing permissions and
3889
3895
  * limitations under the License.
3890
- */ const Ie = /^__.*__$/;
3896
+ */ const In = /^__.*__$/;
3891
3897
 
3892
- /** The result of parsing document data (e.g. for a setData call). */ class Ae {
3893
- constructor(t, n, e) {
3894
- this.data = t, this.fieldMask = n, this.fieldTransforms = e;
3898
+ /** The result of parsing document data (e.g. for a setData call). */ class An {
3899
+ constructor(t, e, n) {
3900
+ this.data = t, this.fieldMask = e, this.fieldTransforms = n;
3895
3901
  }
3896
- toMutation(t, n) {
3897
- return null !== this.fieldMask ? new Pn(t, this.data, this.fieldMask, n, this.fieldTransforms) : new Rn(t, this.data, n, this.fieldTransforms);
3902
+ toMutation(t, e) {
3903
+ return null !== this.fieldMask ? new Re(t, this.data, this.fieldMask, e, this.fieldTransforms) : new Ae(t, this.data, e, this.fieldTransforms);
3898
3904
  }
3899
3905
  }
3900
3906
 
3901
- /** The result of parsing "update" data (i.e. for an updateData call). */ class Re {
3907
+ /** The result of parsing "update" data (i.e. for an updateData call). */ class Rn {
3902
3908
  constructor(t,
3903
3909
  // The fieldMask does not include document transforms.
3904
- n, e) {
3905
- this.data = t, this.fieldMask = n, this.fieldTransforms = e;
3910
+ e, n) {
3911
+ this.data = t, this.fieldMask = e, this.fieldTransforms = n;
3906
3912
  }
3907
- toMutation(t, n) {
3908
- return new Pn(t, this.data, this.fieldMask, n, this.fieldTransforms);
3913
+ toMutation(t, e) {
3914
+ return new Re(t, this.data, this.fieldMask, e, this.fieldTransforms);
3909
3915
  }
3910
3916
  }
3911
3917
 
3912
- function Pe(t) {
3918
+ function Pn(t) {
3913
3919
  switch (t) {
3914
3920
  case 0 /* Set */ :
3915
3921
  // fall through
@@ -3927,7 +3933,7 @@ function Pe(t) {
3927
3933
  }
3928
3934
  }
3929
3935
 
3930
- /** A "context" object passed around while parsing user data. */ class Ve {
3936
+ /** A "context" object passed around while parsing user data. */ class Vn {
3931
3937
  /**
3932
3938
  * Initializes a ParseContext with the given source and path.
3933
3939
  *
@@ -3946,8 +3952,8 @@ function Pe(t) {
3946
3952
  * which case certain features will not work and errors will be somewhat
3947
3953
  * compromised).
3948
3954
  */
3949
- constructor(t, n, e, r, s, i) {
3950
- this.settings = t, this.databaseId = n, this.q = e, this.ignoreUndefinedProperties = r,
3955
+ constructor(t, e, n, r, s, i) {
3956
+ this.settings = t, this.databaseId = e, this.q = n, this.ignoreUndefinedProperties = r,
3951
3957
  // Minor hack: If fieldTransforms is undefined, we assume this is an
3952
3958
  // external call and we need to validate the entire path.
3953
3959
  void 0 === s && this.Z(), this.fieldTransforms = s || [], this.fieldMask = i || [];
@@ -3958,21 +3964,21 @@ function Pe(t) {
3958
3964
  get tt() {
3959
3965
  return this.settings.tt;
3960
3966
  }
3961
- /** Returns a new context with the specified settings overwritten. */ nt(t) {
3962
- return new Ve(Object.assign(Object.assign({}, this.settings), t), this.databaseId, this.q, this.ignoreUndefinedProperties, this.fieldTransforms, this.fieldMask);
3967
+ /** Returns a new context with the specified settings overwritten. */ et(t) {
3968
+ return new Vn(Object.assign(Object.assign({}, this.settings), t), this.databaseId, this.q, this.ignoreUndefinedProperties, this.fieldTransforms, this.fieldMask);
3963
3969
  }
3964
- et(t) {
3965
- var n;
3966
- const e = null === (n = this.path) || void 0 === n ? void 0 : n.child(t), r = this.nt({
3967
- path: e,
3970
+ nt(t) {
3971
+ var e;
3972
+ const n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), r = this.et({
3973
+ path: n,
3968
3974
  rt: !1
3969
3975
  });
3970
3976
  return r.st(t), r;
3971
3977
  }
3972
3978
  it(t) {
3973
- var n;
3974
- const e = null === (n = this.path) || void 0 === n ? void 0 : n.child(t), r = this.nt({
3975
- path: e,
3979
+ var e;
3980
+ const n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), r = this.et({
3981
+ path: n,
3976
3982
  rt: !1
3977
3983
  });
3978
3984
  return r.Z(), r;
@@ -3980,16 +3986,16 @@ function Pe(t) {
3980
3986
  ot(t) {
3981
3987
  // TODO(b/34871131): We don't support array paths right now; so make path
3982
3988
  // undefined.
3983
- return this.nt({
3989
+ return this.et({
3984
3990
  path: void 0,
3985
3991
  rt: !0
3986
3992
  });
3987
3993
  }
3988
3994
  ut(t) {
3989
- return Ye(t, this.settings.methodName, this.settings.ct || !1, this.path, this.settings.at);
3995
+ return Yn(t, this.settings.methodName, this.settings.ct || !1, this.path, this.settings.at);
3990
3996
  }
3991
3997
  /** Returns 'true' if 'fieldPath' was traversed when creating this context. */ contains(t) {
3992
- return void 0 !== this.fieldMask.find((n => t.isPrefixOf(n))) || void 0 !== this.fieldTransforms.find((n => t.isPrefixOf(n.field)));
3998
+ return void 0 !== this.fieldMask.find((e => t.isPrefixOf(e))) || void 0 !== this.fieldTransforms.find((e => t.isPrefixOf(e.field)));
3993
3999
  }
3994
4000
  Z() {
3995
4001
  // TODO(b/34871131): Remove null check once we have proper paths for fields
@@ -3998,52 +4004,52 @@ function Pe(t) {
3998
4004
  }
3999
4005
  st(t) {
4000
4006
  if (0 === t.length) throw this.ut("Document fields must not be empty");
4001
- if (Pe(this.tt) && Ie.test(t)) throw this.ut('Document fields cannot begin and end with "__"');
4007
+ if (Pn(this.tt) && In.test(t)) throw this.ut('Document fields cannot begin and end with "__"');
4002
4008
  }
4003
4009
  }
4004
4010
 
4005
4011
  /**
4006
4012
  * Helper for parsing raw user input (provided via the API) into internal model
4007
4013
  * classes.
4008
- */ class Ne {
4009
- constructor(t, n, e) {
4010
- this.databaseId = t, this.ignoreUndefinedProperties = n, this.q = e || Jn(t);
4014
+ */ class Nn {
4015
+ constructor(t, e, n) {
4016
+ this.databaseId = t, this.ignoreUndefinedProperties = e, this.q = n || Ke(t);
4011
4017
  }
4012
- /** Creates a new top-level parse context. */ ht(t, n, e, r = !1) {
4013
- return new Ve({
4018
+ /** Creates a new top-level parse context. */ ht(t, e, n, r = !1) {
4019
+ return new Vn({
4014
4020
  tt: t,
4015
- methodName: n,
4016
- at: e,
4017
- path: nt.emptyPath(),
4021
+ methodName: e,
4022
+ at: n,
4023
+ path: et.emptyPath(),
4018
4024
  rt: !1,
4019
4025
  ct: r
4020
4026
  }, this.databaseId, this.q, this.ignoreUndefinedProperties);
4021
4027
  }
4022
4028
  }
4023
4029
 
4024
- function De(t) {
4025
- const n = t._freezeSettings(), e = Jn(t._databaseId);
4026
- return new Ne(t._databaseId, !!n.ignoreUndefinedProperties, e);
4030
+ function Dn(t) {
4031
+ const e = t._freezeSettings(), n = Ke(t._databaseId);
4032
+ return new Nn(t._databaseId, !!e.ignoreUndefinedProperties, n);
4027
4033
  }
4028
4034
 
4029
- /** Parse document data from a set() call. */ function $e(t, n, e, r, s, i = {}) {
4030
- const o = t.ht(i.merge || i.mergeFields ? 2 /* MergeSet */ : 0 /* Set */ , n, e, s);
4031
- ze("Data must be an object, but it was:", o, r);
4032
- const u = Me(r, o);
4035
+ /** Parse document data from a set() call. */ function $n(t, e, n, r, s, i = {}) {
4036
+ const o = t.ht(i.merge || i.mergeFields ? 2 /* MergeSet */ : 0 /* Set */ , e, n, s);
4037
+ zn("Data must be an object, but it was:", o, r);
4038
+ const u = Mn(r, o);
4033
4039
  let c, a;
4034
4040
  if (i.merge) c = new It(o.fieldMask), a = o.fieldTransforms; else if (i.mergeFields) {
4035
4041
  const t = [];
4036
4042
  for (const r of i.mergeFields) {
4037
- const s = Qe(n, r, e);
4043
+ const s = Gn(e, r, n);
4038
4044
  if (!o.contains(s)) throw new U(R, `Field '${s}' is specified in your field mask but missing from your input data.`);
4039
- He(t, s) || t.push(s);
4045
+ Hn(t, s) || t.push(s);
4040
4046
  }
4041
4047
  c = new It(t), a = o.fieldTransforms.filter((t => c.covers(t.field)));
4042
4048
  } else c = null, a = o.fieldTransforms;
4043
- return new Ae(new Qt(u), c, a);
4049
+ return new An(new Gt(u), c, a);
4044
4050
  }
4045
4051
 
4046
- class Se extends Ee {
4052
+ class Sn extends En {
4047
4053
  _toFieldTransform(t) {
4048
4054
  if (2 /* MergeSet */ !== t.tt) throw 1 /* Update */ === t.tt ? t.ut(`${this._methodName}() can only appear at the top level of your update data`) : t.ut(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);
4049
4055
  // No transform to add for a delete, but we need to add it to our
@@ -4051,7 +4057,7 @@ class Se extends Ee {
4051
4057
  return t.fieldMask.push(t.path), null;
4052
4058
  }
4053
4059
  isEqual(t) {
4054
- return t instanceof Se;
4060
+ return t instanceof Sn;
4055
4061
  }
4056
4062
  }
4057
4063
 
@@ -4070,32 +4076,32 @@ class Se extends Ee {
4070
4076
  * context.
4071
4077
  * @param context - The parent context.
4072
4078
  * @param arrayElement - Whether or not the FieldValue has an array.
4073
- */ function Fe(t, n, e) {
4074
- return new Ve({
4079
+ */ function Fn(t, e, n) {
4080
+ return new Vn({
4075
4081
  tt: 3 /* Argument */ ,
4076
- at: n.settings.at,
4082
+ at: e.settings.at,
4077
4083
  methodName: t._methodName,
4078
- rt: e
4079
- }, n.databaseId, n.q, n.ignoreUndefinedProperties);
4084
+ rt: n
4085
+ }, e.databaseId, e.q, e.ignoreUndefinedProperties);
4080
4086
  }
4081
4087
 
4082
- class xe extends Ee {
4088
+ class xn extends En {
4083
4089
  _toFieldTransform(t) {
4084
- return new Tn(t.path, new gn);
4090
+ return new Ee(t.path, new _e);
4085
4091
  }
4086
4092
  isEqual(t) {
4087
- return t instanceof xe;
4093
+ return t instanceof xn;
4088
4094
  }
4089
4095
  }
4090
4096
 
4091
- class qe extends Ee {
4092
- constructor(t, n) {
4093
- super(t), this.lt = n;
4097
+ class qn extends En {
4098
+ constructor(t, e) {
4099
+ super(t), this.lt = e;
4094
4100
  }
4095
4101
  _toFieldTransform(t) {
4096
- const n = Fe(this, t,
4097
- /*array=*/ !0), e = this.lt.map((t => je(t, n))), r = new vn(e);
4098
- return new Tn(t.path, r);
4102
+ const e = Fn(this, t,
4103
+ /*array=*/ !0), n = this.lt.map((t => jn(t, e))), r = new ge(n);
4104
+ return new Ee(t.path, r);
4099
4105
  }
4100
4106
  isEqual(t) {
4101
4107
  // TODO(mrschmidt): Implement isEquals
@@ -4103,14 +4109,14 @@ class qe extends Ee {
4103
4109
  }
4104
4110
  }
4105
4111
 
4106
- class Oe extends Ee {
4107
- constructor(t, n) {
4108
- super(t), this.lt = n;
4112
+ class On extends En {
4113
+ constructor(t, e) {
4114
+ super(t), this.lt = e;
4109
4115
  }
4110
4116
  _toFieldTransform(t) {
4111
- const n = Fe(this, t,
4112
- /*array=*/ !0), e = this.lt.map((t => je(t, n))), r = new bn(e);
4113
- return new Tn(t.path, r);
4117
+ const e = Fn(this, t,
4118
+ /*array=*/ !0), n = this.lt.map((t => jn(t, e))), r = new ve(n);
4119
+ return new Ee(t.path, r);
4114
4120
  }
4115
4121
  isEqual(t) {
4116
4122
  // TODO(mrschmidt): Implement isEquals
@@ -4118,13 +4124,13 @@ class Oe extends Ee {
4118
4124
  }
4119
4125
  }
4120
4126
 
4121
- class Ce extends Ee {
4122
- constructor(t, n) {
4123
- super(t), this.ft = n;
4127
+ class Cn extends En {
4128
+ constructor(t, e) {
4129
+ super(t), this.ft = e;
4124
4130
  }
4125
4131
  _toFieldTransform(t) {
4126
- const n = new En(t.q, yn(t.q, this.ft));
4127
- return new Tn(t.path, n);
4132
+ const e = new be(t.q, pe(t.q, this.ft));
4133
+ return new Ee(t.path, e);
4128
4134
  }
4129
4135
  isEqual(t) {
4130
4136
  // TODO(mrschmidt): Implement isEquals
@@ -4132,50 +4138,50 @@ class Ce extends Ee {
4132
4138
  }
4133
4139
  }
4134
4140
 
4135
- /** Parse update data from an update() call. */ function Le(t, n, e, r) {
4136
- const s = t.ht(1 /* Update */ , n, e);
4137
- ze("Data must be an object, but it was:", s, r);
4138
- const i = [], o = Qt.empty();
4141
+ /** Parse update data from an update() call. */ function Ln(t, e, n, r) {
4142
+ const s = t.ht(1 /* Update */ , e, n);
4143
+ zn("Data must be an object, but it was:", s, r);
4144
+ const i = [], o = Gt.empty();
4139
4145
  Tt(r, ((t, r) => {
4140
- const u = We(n, t, e);
4146
+ const u = Wn(e, t, n);
4141
4147
  // For Compat types, we have to "extract" the underlying types before
4142
4148
  // performing validation.
4143
4149
  r = l(r);
4144
4150
  const c = s.it(u);
4145
- if (r instanceof Se)
4151
+ if (r instanceof Sn)
4146
4152
  // Add it to the field mask, but don't add anything to updateData.
4147
4153
  i.push(u); else {
4148
- const t = je(r, c);
4154
+ const t = jn(r, c);
4149
4155
  null != t && (i.push(u), o.set(u, t));
4150
4156
  }
4151
4157
  }));
4152
4158
  const u = new It(i);
4153
- return new Re(o, u, s.fieldTransforms);
4159
+ return new Rn(o, u, s.fieldTransforms);
4154
4160
  }
4155
4161
 
4156
- /** Parse update data from a list of field/value arguments. */ function ke(t, n, e, r, s, i) {
4157
- const o = t.ht(1 /* Update */ , n, e), u = [ Qe(n, r, e) ], c = [ s ];
4158
- if (i.length % 2 != 0) throw new U(R, `Function ${n}() needs to be called with an even number of arguments that alternate between field names and values.`);
4159
- for (let t = 0; t < i.length; t += 2) u.push(Qe(n, i[t])), c.push(i[t + 1]);
4160
- const a = [], h = Qt.empty();
4162
+ /** Parse update data from a list of field/value arguments. */ function kn(t, e, n, r, s, i) {
4163
+ const o = t.ht(1 /* Update */ , e, n), u = [ Gn(e, r, n) ], c = [ s ];
4164
+ if (i.length % 2 != 0) throw new U(R, `Function ${e}() needs to be called with an even number of arguments that alternate between field names and values.`);
4165
+ for (let t = 0; t < i.length; t += 2) u.push(Gn(e, i[t])), c.push(i[t + 1]);
4166
+ const a = [], h = Gt.empty();
4161
4167
  // We iterate in reverse order to pick the last value for a field if the
4162
4168
  // user specified the field multiple times.
4163
- for (let t = u.length - 1; t >= 0; --t) if (!He(a, u[t])) {
4164
- const n = u[t];
4165
- let e = c[t];
4169
+ for (let t = u.length - 1; t >= 0; --t) if (!Hn(a, u[t])) {
4170
+ const e = u[t];
4171
+ let n = c[t];
4166
4172
  // For Compat types, we have to "extract" the underlying types before
4167
4173
  // performing validation.
4168
- e = l(e);
4169
- const r = o.it(n);
4170
- if (e instanceof Se)
4174
+ n = l(n);
4175
+ const r = o.it(e);
4176
+ if (n instanceof Sn)
4171
4177
  // Add it to the field mask, but don't add anything to updateData.
4172
- a.push(n); else {
4173
- const t = je(e, r);
4174
- null != t && (a.push(n), h.set(n, t));
4178
+ a.push(e); else {
4179
+ const t = jn(n, r);
4180
+ null != t && (a.push(e), h.set(e, t));
4175
4181
  }
4176
4182
  }
4177
4183
  const f = new It(a);
4178
- return new Re(h, f, o.fieldTransforms);
4184
+ return new Rn(h, f, o.fieldTransforms);
4179
4185
  }
4180
4186
 
4181
4187
  /**
@@ -4184,8 +4190,8 @@ class Ce extends Ee {
4184
4190
  *
4185
4191
  * @param allowArrays - Whether the query value is an array that may directly
4186
4192
  * contain additional arrays (e.g. the operand of an `in` query).
4187
- */ function Ue(t, n, e, r = !1) {
4188
- return je(e, t.ht(r ? 4 /* ArrayArgument */ : 3 /* Argument */ , n));
4193
+ */ function Un(t, e, n, r = !1) {
4194
+ return jn(n, t.ht(r ? 4 /* ArrayArgument */ : 3 /* Argument */ , e));
4189
4195
  }
4190
4196
 
4191
4197
  /**
@@ -4196,12 +4202,12 @@ class Ce extends Ee {
4196
4202
  * the source of the data being parsed, etc.
4197
4203
  * @returns The parsed value, or null if the value was a FieldValue sentinel
4198
4204
  * that should not be included in the resulting parsed data.
4199
- */ function je(t, n) {
4200
- if (Be(
4205
+ */ function jn(t, e) {
4206
+ if (Bn(
4201
4207
  // Unwrap the API type from the Compat SDK. This will return the API type
4202
4208
  // from firestore-exp.
4203
- t = l(t))) return ze("Unsupported field value:", n, t), Me(t, n);
4204
- if (t instanceof Ee)
4209
+ t = l(t))) return zn("Unsupported field value:", e, t), Mn(t, e);
4210
+ if (t instanceof En)
4205
4211
  // FieldValues usually parse into transforms (except deleteField())
4206
4212
  // in which case we do not want to include this field in our parsed data
4207
4213
  // (as doing so will overwrite the field directly prior to the transform
@@ -4211,19 +4217,19 @@ class Ce extends Ee {
4211
4217
  * "Parses" the provided FieldValueImpl, adding any necessary transforms to
4212
4218
  * context.fieldTransforms.
4213
4219
  */
4214
- return function(t, n) {
4220
+ return function(t, e) {
4215
4221
  // Sentinels are only supported with writes, and not within arrays.
4216
- if (!Pe(n.tt)) throw n.ut(`${t._methodName}() can only be used with update() and set()`);
4217
- if (!n.path) throw n.ut(`${t._methodName}() is not currently supported inside arrays`);
4218
- const e = t._toFieldTransform(n);
4219
- e && n.fieldTransforms.push(e);
4222
+ if (!Pn(e.tt)) throw e.ut(`${t._methodName}() can only be used with update() and set()`);
4223
+ if (!e.path) throw e.ut(`${t._methodName}() is not currently supported inside arrays`);
4224
+ const n = t._toFieldTransform(e);
4225
+ n && e.fieldTransforms.push(n);
4220
4226
  }
4221
4227
  /**
4222
4228
  * Helper to parse a scalar value (i.e. not an Object, Array, or FieldValue)
4223
4229
  *
4224
4230
  * @returns The parsed value
4225
- */ (t, n), null;
4226
- if (void 0 === t && n.ignoreUndefinedProperties)
4231
+ */ (t, e), null;
4232
+ if (void 0 === t && e.ignoreUndefinedProperties)
4227
4233
  // If the input is undefined it can never participate in the fieldMask, so
4228
4234
  // don't handle this below. If `ignoreUndefinedProperties` is false,
4229
4235
  // `parseScalarValue` will reject an undefined value.
@@ -4231,38 +4237,38 @@ class Ce extends Ee {
4231
4237
  if (
4232
4238
  // If context.path is null we are inside an array and we don't support
4233
4239
  // field mask paths more granular than the top-level array.
4234
- n.path && n.fieldMask.push(n.path), t instanceof Array) {
4240
+ e.path && e.fieldMask.push(e.path), t instanceof Array) {
4235
4241
  // TODO(b/34871131): Include the path containing the array in the error
4236
4242
  // message.
4237
4243
  // In the case of IN queries, the parsed data is an array (representing
4238
4244
  // the set of values to be included for the IN query) that may directly
4239
4245
  // contain additional arrays (each representing an individual field
4240
4246
  // value), so we disable this validation.
4241
- if (n.settings.rt && 4 /* ArrayArgument */ !== n.tt) throw n.ut("Nested arrays are not supported");
4242
- return function(t, n) {
4243
- const e = [];
4247
+ if (e.settings.rt && 4 /* ArrayArgument */ !== e.tt) throw e.ut("Nested arrays are not supported");
4248
+ return function(t, e) {
4249
+ const n = [];
4244
4250
  let r = 0;
4245
4251
  for (const s of t) {
4246
- let t = je(s, n.ot(r));
4252
+ let t = jn(s, e.ot(r));
4247
4253
  null == t && (
4248
4254
  // Just include nulls in the array for fields being replaced with a
4249
4255
  // sentinel.
4250
4256
  t = {
4251
4257
  nullValue: "NULL_VALUE"
4252
- }), e.push(t), r++;
4258
+ }), n.push(t), r++;
4253
4259
  }
4254
4260
  return {
4255
4261
  arrayValue: {
4256
- values: e
4262
+ values: n
4257
4263
  }
4258
4264
  };
4259
- }(t, n);
4265
+ }(t, e);
4260
4266
  }
4261
- return function(t, n) {
4267
+ return function(t, e) {
4262
4268
  if (null === (t = l(t))) return {
4263
4269
  nullValue: "NULL_VALUE"
4264
4270
  };
4265
- if ("number" == typeof t) return yn(n.q, t);
4271
+ if ("number" == typeof t) return pe(e.q, t);
4266
4272
  if ("boolean" == typeof t) return {
4267
4273
  booleanValue: t
4268
4274
  };
@@ -4270,37 +4276,37 @@ class Ce extends Ee {
4270
4276
  stringValue: t
4271
4277
  };
4272
4278
  if (t instanceof Date) {
4273
- const e = vt.fromDate(t);
4279
+ const n = vt.fromDate(t);
4274
4280
  return {
4275
- timestampValue: Fn(n.q, e)
4281
+ timestampValue: Se(e.q, n)
4276
4282
  };
4277
4283
  }
4278
4284
  if (t instanceof vt) {
4279
4285
  // Firestore backend truncates precision down to microseconds. To ensure
4280
4286
  // offline mode works the same with regards to truncation, perform the
4281
4287
  // truncation immediately without waiting for the backend to do that.
4282
- const e = new vt(t.seconds, 1e3 * Math.floor(t.nanoseconds / 1e3));
4288
+ const n = new vt(t.seconds, 1e3 * Math.floor(t.nanoseconds / 1e3));
4283
4289
  return {
4284
- timestampValue: Fn(n.q, e)
4290
+ timestampValue: Se(e.q, n)
4285
4291
  };
4286
4292
  }
4287
- if (t instanceof Te) return {
4293
+ if (t instanceof Tn) return {
4288
4294
  geoPointValue: {
4289
4295
  latitude: t.latitude,
4290
4296
  longitude: t.longitude
4291
4297
  }
4292
4298
  };
4293
- if (t instanceof be) return {
4294
- bytesValue: xn(n.q, t._byteString)
4299
+ if (t instanceof bn) return {
4300
+ bytesValue: Fe(e.q, t._byteString)
4295
4301
  };
4296
- if (t instanceof le) {
4297
- const e = n.databaseId, r = t.firestore._databaseId;
4298
- if (!r.isEqual(e)) throw n.ut(`Document reference is for database ${r.projectId}/${r.database} but should be for database ${e.projectId}/${e.database}`);
4302
+ if (t instanceof ln) {
4303
+ const n = e.databaseId, r = t.firestore._databaseId;
4304
+ if (!r.isEqual(n)) throw e.ut(`Document reference is for database ${r.projectId}/${r.database} but should be for database ${n.projectId}/${n.database}`);
4299
4305
  return {
4300
- referenceValue: Cn(t.firestore._databaseId || n.databaseId, t._key.path)
4306
+ referenceValue: Oe(t.firestore._databaseId || e.databaseId, t._key.path)
4301
4307
  };
4302
4308
  }
4303
- throw n.ut(`Unsupported field value: ${ot(t)}`);
4309
+ throw e.ut(`Unsupported field value: ${ot(t)}`);
4304
4310
  }
4305
4311
  /**
4306
4312
  * Checks whether an object looks like a JSON object that should be converted
@@ -4308,56 +4314,56 @@ class Ce extends Ee {
4308
4314
  * JSON objects since they should be converted to a struct value. Arrays, Dates,
4309
4315
  * GeoPoints, etc. are not considered to look like JSON objects since they map
4310
4316
  * to specific FieldValue types other than ObjectValue.
4311
- */ (t, n);
4317
+ */ (t, e);
4312
4318
  }
4313
4319
 
4314
- function Me(t, n) {
4315
- const e = {};
4320
+ function Mn(t, e) {
4321
+ const n = {};
4316
4322
  return !function(t) {
4317
- for (const n in t) if (Object.prototype.hasOwnProperty.call(t, n)) return !1;
4323
+ for (const e in t) if (Object.prototype.hasOwnProperty.call(t, e)) return !1;
4318
4324
  return !0;
4319
4325
  }(t) ? Tt(t, ((t, r) => {
4320
- const s = je(r, n.et(t));
4321
- null != s && (e[t] = s);
4326
+ const s = jn(r, e.nt(t));
4327
+ null != s && (n[t] = s);
4322
4328
  })) :
4323
4329
  // If we encounter an empty object, we explicitly add it to the update
4324
4330
  // mask to ensure that the server creates a map entry.
4325
- n.path && n.path.length > 0 && n.fieldMask.push(n.path), {
4331
+ e.path && e.path.length > 0 && e.fieldMask.push(e.path), {
4326
4332
  mapValue: {
4327
- fields: e
4333
+ fields: n
4328
4334
  }
4329
4335
  };
4330
4336
  }
4331
4337
 
4332
- function Be(t) {
4333
- return !("object" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof vt || t instanceof Te || t instanceof be || t instanceof le || t instanceof Ee);
4338
+ function Bn(t) {
4339
+ return !("object" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof vt || t instanceof Tn || t instanceof bn || t instanceof ln || t instanceof En);
4334
4340
  }
4335
4341
 
4336
- function ze(t, n, e) {
4337
- if (!Be(e) || !function(t) {
4342
+ function zn(t, e, n) {
4343
+ if (!Bn(n) || !function(t) {
4338
4344
  return "object" == typeof t && null !== t && (Object.getPrototypeOf(t) === Object.prototype || null === Object.getPrototypeOf(t));
4339
- }(e)) {
4340
- const r = ot(e);
4341
- throw "an object" === r ? n.ut(t + " a custom object") : n.ut(t + " " + r);
4345
+ }(n)) {
4346
+ const r = ot(n);
4347
+ throw "an object" === r ? e.ut(t + " a custom object") : e.ut(t + " " + r);
4342
4348
  }
4343
4349
  }
4344
4350
 
4345
4351
  /**
4346
4352
  * Helper that calls fromDotSeparatedString() but wraps any error thrown.
4347
- */ function Qe(t, n, e) {
4353
+ */ function Gn(t, e, n) {
4348
4354
  if ((
4349
4355
  // If required, replace the FieldPath Compat class with with the firestore-exp
4350
4356
  // FieldPath.
4351
- n = l(n)) instanceof ge) return n._internalPath;
4352
- if ("string" == typeof n) return We(t, n);
4353
- throw Ye("Field path arguments must be of type string or ", t,
4357
+ e = l(e)) instanceof gn) return e._internalPath;
4358
+ if ("string" == typeof e) return Wn(t, e);
4359
+ throw Yn("Field path arguments must be of type string or ", t,
4354
4360
  /* hasConverter= */ !1,
4355
- /* path= */ void 0, e);
4361
+ /* path= */ void 0, n);
4356
4362
  }
4357
4363
 
4358
4364
  /**
4359
4365
  * Matches any characters in a field path string that are reserved.
4360
- */ const Ge = new RegExp("[~\\*/\\[\\]]");
4366
+ */ const Qn = new RegExp("[~\\*/\\[\\]]");
4361
4367
 
4362
4368
  /**
4363
4369
  * Wraps fromDotSeparatedString with an error message about the method that
@@ -4367,30 +4373,30 @@ function ze(t, n, e) {
4367
4373
  * split on dots.
4368
4374
  * @param targetDoc - The document against which the field path will be
4369
4375
  * evaluated.
4370
- */ function We(t, n, e) {
4371
- if (n.search(Ge) >= 0) throw Ye(`Invalid field path (${n}). Paths must not contain '~', '*', '/', '[', or ']'`, t,
4376
+ */ function Wn(t, e, n) {
4377
+ if (e.search(Qn) >= 0) throw Yn(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`, t,
4372
4378
  /* hasConverter= */ !1,
4373
- /* path= */ void 0, e);
4379
+ /* path= */ void 0, n);
4374
4380
  try {
4375
- return new ge(...n.split("."))._internalPath;
4381
+ return new gn(...e.split("."))._internalPath;
4376
4382
  } catch (r) {
4377
- throw Ye(`Invalid field path (${n}). Paths must not be empty, begin with '.', end with '.', or contain '..'`, t,
4383
+ throw Yn(`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`, t,
4378
4384
  /* hasConverter= */ !1,
4379
- /* path= */ void 0, e);
4385
+ /* path= */ void 0, n);
4380
4386
  }
4381
4387
  }
4382
4388
 
4383
- function Ye(t, n, e, r, s) {
4389
+ function Yn(t, e, n, r, s) {
4384
4390
  const i = r && !r.isEmpty(), o = void 0 !== s;
4385
- let u = `Function ${n}() called with invalid data`;
4386
- e && (u += " (via `toFirestore()`)"), u += ". ";
4391
+ let u = `Function ${e}() called with invalid data`;
4392
+ n && (u += " (via `toFirestore()`)"), u += ". ";
4387
4393
  let c = "";
4388
4394
  return (i || o) && (c += " (found", i && (c += ` in field ${r}`), o && (c += ` in document ${s}`),
4389
4395
  c += ")"), new U(R, u + t + c);
4390
4396
  }
4391
4397
 
4392
- /** Checks `haystack` if FieldPath `needle` is present. Runs in O(n). */ function He(t, n) {
4393
- return t.some((t => t.isEqual(n)));
4398
+ /** Checks `haystack` if FieldPath `needle` is present. Runs in O(n). */ function Hn(t, e) {
4399
+ return t.some((t => t.isEqual(e)));
4394
4400
  }
4395
4401
 
4396
4402
  /**
@@ -4417,14 +4423,14 @@ function Ye(t, n, e, r, s) {
4417
4423
  * For a `DocumentSnapshot` that points to a non-existing document, any data
4418
4424
  * access will return 'undefined'. You can use the `exists()` method to
4419
4425
  * explicitly verify a document's existence.
4420
- */ class Ke {
4426
+ */ class Kn {
4421
4427
  // Note: This class is stripped down version of the DocumentSnapshot in
4422
4428
  // the legacy SDK. The changes are:
4423
4429
  // - No support for SnapshotMetadata.
4424
4430
  // - No support for SnapshotOptions.
4425
4431
  /** @hideconstructor protected */
4426
- constructor(t, n, e, r, s) {
4427
- this._firestore = t, this._userDataWriter = n, this._key = e, this._document = r,
4432
+ constructor(t, e, n, r, s) {
4433
+ this._firestore = t, this._userDataWriter = e, this._key = n, this._document = r,
4428
4434
  this._converter = s;
4429
4435
  }
4430
4436
  /** Property of the `DocumentSnapshot` that provides the document's ID. */ get id() {
@@ -4433,7 +4439,7 @@ function Ye(t, n, e, r, s) {
4433
4439
  /**
4434
4440
  * The `DocumentReference` for the document included in the `DocumentSnapshot`.
4435
4441
  */ get ref() {
4436
- return new le(this._firestore, this._converter, this._key);
4442
+ return new ln(this._firestore, this._converter, this._key);
4437
4443
  }
4438
4444
  /**
4439
4445
  * Signals whether or not the document at the snapshot's location exists.
@@ -4453,7 +4459,7 @@ function Ye(t, n, e, r, s) {
4453
4459
  if (this._converter) {
4454
4460
  // We only want to use the converter and create a new DocumentSnapshot
4455
4461
  // if a converter has been provided.
4456
- const t = new Je(this._firestore, this._userDataWriter, this._key, this._document,
4462
+ const t = new Jn(this._firestore, this._userDataWriter, this._key, this._document,
4457
4463
  /* converter= */ null);
4458
4464
  return this._converter.fromFirestore(t);
4459
4465
  }
@@ -4473,8 +4479,8 @@ function Ye(t, n, e, r, s) {
4473
4479
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4474
4480
  get(t) {
4475
4481
  if (this._document) {
4476
- const n = this._document.data.field(tr("DocumentSnapshot.get", t));
4477
- if (null !== n) return this._userDataWriter.convertValue(n);
4482
+ const e = this._document.data.field(tr("DocumentSnapshot.get", t));
4483
+ if (null !== e) return this._userDataWriter.convertValue(e);
4478
4484
  }
4479
4485
  }
4480
4486
  }
@@ -4489,7 +4495,7 @@ function Ye(t, n, e, r, s) {
4489
4495
  * `DocumentSnapshot`. Since query results contain only existing documents, the
4490
4496
  * `exists` property will always be true and `data()` will never return
4491
4497
  * 'undefined'.
4492
- */ class Je extends Ke {
4498
+ */ class Jn extends Kn {
4493
4499
  /**
4494
4500
  * Retrieves all fields in the document as an `Object`.
4495
4501
  *
@@ -4507,10 +4513,10 @@ function Ye(t, n, e, r, s) {
4507
4513
  * array via the `docs` property or enumerated using the `forEach` method. The
4508
4514
  * number of documents can be determined via the `empty` and `size`
4509
4515
  * properties.
4510
- */ class Xe {
4516
+ */ class Xn {
4511
4517
  /** @hideconstructor */
4512
- constructor(t, n) {
4513
- this._docs = n, this.query = t;
4518
+ constructor(t, e) {
4519
+ this._docs = e, this.query = t;
4514
4520
  }
4515
4521
  /** An array of all the documents in the `QuerySnapshot`. */ get docs() {
4516
4522
  return [ ...this._docs ];
@@ -4527,8 +4533,8 @@ function Ye(t, n, e, r, s) {
4527
4533
  * @param callback - A callback to be called with a `QueryDocumentSnapshot` for
4528
4534
  * each document in the snapshot.
4529
4535
  * @param thisArg - The `this` binding for the callback.
4530
- */ forEach(t, n) {
4531
- this._docs.forEach(t, n);
4536
+ */ forEach(t, e) {
4537
+ this._docs.forEach(t, e);
4532
4538
  }
4533
4539
  }
4534
4540
 
@@ -4538,14 +4544,14 @@ function Ye(t, n, e, r, s) {
4538
4544
  * @param left - A snapshot to compare.
4539
4545
  * @param right - A snapshot to compare.
4540
4546
  * @returns true if the snapshots are equal.
4541
- */ function Ze(t, n) {
4542
- return t = l(t), n = l(n), t instanceof Ke && n instanceof Ke ? t._firestore === n._firestore && t._key.isEqual(n._key) && (null === t._document ? null === n._document : t._document.isEqual(n._document)) && t._converter === n._converter : t instanceof Xe && n instanceof Xe && (_e(t.query, n.query) && gt(t.docs, n.docs, Ze));
4547
+ */ function Zn(t, e) {
4548
+ return t = l(t), e = l(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 Xn && e instanceof Xn && (_n(t.query, e.query) && gt(t.docs, e.docs, Zn));
4543
4549
  }
4544
4550
 
4545
4551
  /**
4546
4552
  * Helper that calls `fromDotSeparatedString()` but wraps any error thrown.
4547
- */ function tr(t, n) {
4548
- return "string" == typeof n ? We(t, n) : n instanceof ge ? n._internalPath : n._delegate._internalPath;
4553
+ */ function tr(t, e) {
4554
+ return "string" == typeof e ? Wn(t, e) : e instanceof gn ? e._internalPath : e._delegate._internalPath;
4549
4555
  }
4550
4556
 
4551
4557
  /**
@@ -4572,7 +4578,7 @@ function Ye(t, n, e, r, s) {
4572
4578
  * can then be passed to {@link query} to create a new query instance that
4573
4579
  * also contains this `QueryConstraint`.
4574
4580
  */
4575
- class nr {}
4581
+ class er {}
4576
4582
 
4577
4583
  /**
4578
4584
  * Creates a new immutable instance of {@link Query} that is extended to also include
@@ -4582,43 +4588,43 @@ class nr {}
4582
4588
  * @param queryConstraints - The list of {@link QueryConstraint}s to apply.
4583
4589
  * @throws if any of the provided query constraints cannot be combined with the
4584
4590
  * existing or new constraints.
4585
- */ function er(t, ...n) {
4586
- for (const e of n) t = e._apply(t);
4591
+ */ function nr(t, ...e) {
4592
+ for (const n of e) t = n._apply(t);
4587
4593
  return t;
4588
4594
  }
4589
4595
 
4590
- class rr extends nr {
4591
- constructor(t, n, e) {
4592
- super(), this.dt = t, this.wt = n, this.yt = e, this.type = "where";
4596
+ class rr extends er {
4597
+ constructor(t, e, n) {
4598
+ super(), this.dt = t, this.wt = e, this.yt = n, this.type = "where";
4593
4599
  }
4594
4600
  _apply(t) {
4595
- const n = De(t.firestore), e = function(t, n, e, r, s, i, o) {
4601
+ const e = Dn(t.firestore), n = function(t, e, n, r, s, i, o) {
4596
4602
  let u;
4597
4603
  if (s.isKeyField()) {
4598
4604
  if ("array-contains" /* ARRAY_CONTAINS */ === i || "array-contains-any" /* ARRAY_CONTAINS_ANY */ === i) throw new U(R, `Invalid Query. You can't perform '${i}' queries on documentId().`);
4599
4605
  if ("in" /* IN */ === i || "not-in" /* NOT_IN */ === i) {
4600
4606
  _r(o, i);
4601
- const n = [];
4602
- for (const e of o) n.push(yr(r, t, e));
4607
+ const e = [];
4608
+ for (const n of o) e.push(yr(r, t, n));
4603
4609
  u = {
4604
4610
  arrayValue: {
4605
- values: n
4611
+ values: e
4606
4612
  }
4607
4613
  };
4608
4614
  } else u = yr(r, t, o);
4609
4615
  } else "in" /* IN */ !== i && "not-in" /* NOT_IN */ !== i && "array-contains-any" /* ARRAY_CONTAINS_ANY */ !== i || _r(o, i),
4610
- u = Ue(e, n, o,
4616
+ u = Un(n, e, o,
4611
4617
  /* allowArrays= */ "in" /* IN */ === i || "not-in" /* NOT_IN */ === i);
4612
4618
  const c = Ht.create(s, i, u);
4613
- return function(t, n) {
4614
- if (n.D()) {
4615
- const e = fn(t);
4616
- if (null !== e && !e.isEqual(n.field)) throw new U(R, `Invalid query. All where filters with an inequality (<, <=, !=, not-in, >, or >=) must be on the same field. But you have inequality filters on '${e.toString()}' and '${n.field.toString()}'`);
4617
- const r = ln(t);
4618
- null !== r && gr(t, n.field, r);
4619
+ return function(t, e) {
4620
+ if (e.D()) {
4621
+ const n = le(t);
4622
+ if (null !== n && !n.isEqual(e.field)) throw new U(R, `Invalid query. All where filters with an inequality (<, <=, !=, not-in, >, or >=) must be on the same field. But you have inequality filters on '${n.toString()}' and '${e.field.toString()}'`);
4623
+ const r = he(t);
4624
+ null !== r && gr(t, e.field, r);
4619
4625
  }
4620
- const e = function(t, n) {
4621
- for (const e of t.filters) if (n.indexOf(e.op) >= 0) return e.op;
4626
+ const n = function(t, e) {
4627
+ for (const n of t.filters) if (e.indexOf(n.op) >= 0) return n.op;
4622
4628
  return null;
4623
4629
  }(t,
4624
4630
  /**
@@ -4653,16 +4659,16 @@ class rr extends nr {
4653
4659
  default:
4654
4660
  return [];
4655
4661
  }
4656
- }(n.op));
4657
- if (null !== e)
4662
+ }(e.op));
4663
+ if (null !== n)
4658
4664
  // Special case when it's a duplicate op to give a slightly clearer error message.
4659
- throw e === n.op ? new U(R, `Invalid query. You cannot use more than one '${n.op.toString()}' filter.`) : new U(R, `Invalid query. You cannot use '${n.op.toString()}' filters with '${e.toString()}' filters.`);
4665
+ throw n === e.op ? new U(R, `Invalid query. You cannot use more than one '${e.op.toString()}' filter.`) : new U(R, `Invalid query. You cannot use '${e.op.toString()}' filters with '${n.toString()}' filters.`);
4660
4666
  }(t, c), c;
4661
- }(t._query, "where", n, t.firestore._databaseId, this.dt, this.wt, this.yt);
4662
- return new fe(t.firestore, t.converter, function(t, n) {
4663
- const e = t.filters.concat([ n ]);
4664
- return new an(t.path, t.collectionGroup, t.explicitOrderBy.slice(), e, t.limit, t.limitType, t.startAt, t.endAt);
4665
- }(t._query, e));
4667
+ }(t._query, "where", e, t.firestore._databaseId, this.dt, this.wt, this.yt);
4668
+ return new fn(t.firestore, t.converter, function(t, e) {
4669
+ const n = t.filters.concat([ e ]);
4670
+ return new ce(t.path, t.collectionGroup, t.explicitOrderBy.slice(), n, t.limit, t.limitType, t.startAt, t.endAt);
4671
+ }(t._query, n));
4666
4672
  }
4667
4673
  }
4668
4674
 
@@ -4676,25 +4682,25 @@ class rr extends nr {
4676
4682
  * "&lt;=", "!=").
4677
4683
  * @param value - The value for comparison
4678
4684
  * @returns The created {@link Query}.
4679
- */ function sr(t, n, e) {
4680
- const r = n, s = tr("where", t);
4681
- return new rr(s, r, e);
4685
+ */ function sr(t, e, n) {
4686
+ const r = e, s = tr("where", t);
4687
+ return new rr(s, r, n);
4682
4688
  }
4683
4689
 
4684
- class ir extends nr {
4685
- constructor(t, n) {
4686
- super(), this.dt = t, this._t = n, this.type = "orderBy";
4690
+ class ir extends er {
4691
+ constructor(t, e) {
4692
+ super(), this.dt = t, this._t = e, this.type = "orderBy";
4687
4693
  }
4688
4694
  _apply(t) {
4689
- const n = function(t, n, e) {
4695
+ const e = function(t, e, n) {
4690
4696
  if (null !== t.startAt) throw new U(R, "Invalid query. You must not call startAt() or startAfter() before calling orderBy().");
4691
4697
  if (null !== t.endAt) throw new U(R, "Invalid query. You must not call endAt() or endBefore() before calling orderBy().");
4692
- const r = new on(n, e);
4693
- return function(t, n) {
4694
- if (null === ln(t)) {
4698
+ const r = new ie(e, n);
4699
+ return function(t, e) {
4700
+ if (null === he(t)) {
4695
4701
  // This is the first order by. It must match any inequality.
4696
- const e = fn(t);
4697
- null !== e && gr(t, e, n.field);
4702
+ const n = le(t);
4703
+ null !== n && gr(t, n, e.field);
4698
4704
  }
4699
4705
  }(t, r), r;
4700
4706
  }
@@ -4709,11 +4715,11 @@ class ir extends nr {
4709
4715
  * of the query or if any of the fields in the order by are an uncommitted
4710
4716
  * server timestamp.
4711
4717
  */ (t._query, this.dt, this._t);
4712
- return new fe(t.firestore, t.converter, function(t, n) {
4718
+ return new fn(t.firestore, t.converter, function(t, e) {
4713
4719
  // TODO(dimond): validate that orderBy does not list the same key twice.
4714
- const e = t.explicitOrderBy.concat([ n ]);
4715
- return new an(t.path, t.collectionGroup, e, t.filters.slice(), t.limit, t.limitType, t.startAt, t.endAt);
4716
- }(t._query, n));
4720
+ const n = t.explicitOrderBy.concat([ e ]);
4721
+ return new ce(t.path, t.collectionGroup, n, t.filters.slice(), t.limit, t.limitType, t.startAt, t.endAt);
4722
+ }(t._query, e));
4717
4723
  }
4718
4724
  }
4719
4725
 
@@ -4725,18 +4731,18 @@ class ir extends nr {
4725
4731
  * @param directionStr - Optional direction to sort by ('asc' or 'desc'). If
4726
4732
  * not specified, order will be ascending.
4727
4733
  * @returns The created {@link Query}.
4728
- */ function or(t, n = "asc") {
4729
- const e = n, r = tr("orderBy", t);
4730
- return new ir(r, e);
4734
+ */ function or(t, e = "asc") {
4735
+ const n = e, r = tr("orderBy", t);
4736
+ return new ir(r, n);
4731
4737
  }
4732
4738
 
4733
- class ur extends nr {
4734
- constructor(t, n, e) {
4735
- super(), this.type = t, this.gt = n, this.vt = e;
4739
+ class ur extends er {
4740
+ constructor(t, e, n) {
4741
+ super(), this.type = t, this.gt = e, this.vt = n;
4736
4742
  }
4737
4743
  _apply(t) {
4738
- return new fe(t.firestore, t.converter, function(t, n, e) {
4739
- return new an(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), n, e, t.startAt, t.endAt);
4744
+ return new fn(t.firestore, t.converter, function(t, e, n) {
4745
+ return new ce(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), e, n, t.startAt, t.endAt);
4740
4746
  }(t._query, this.gt, this.vt));
4741
4747
  }
4742
4748
  }
@@ -4762,15 +4768,15 @@ class ur extends nr {
4762
4768
  return ct("limitToLast", t), new ur("limitToLast", t, "L" /* Last */);
4763
4769
  }
4764
4770
 
4765
- class hr extends nr {
4766
- constructor(t, n, e) {
4767
- super(), this.type = t, this.bt = n, this.Et = e;
4771
+ class hr extends er {
4772
+ constructor(t, e, n) {
4773
+ super(), this.type = t, this.bt = e, this.Et = n;
4768
4774
  }
4769
4775
  _apply(t) {
4770
- const n = pr(t, this.type, this.bt, this.Et);
4771
- return new fe(t.firestore, t.converter, function(t, n) {
4772
- return new an(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, n, t.endAt);
4773
- }(t._query, n));
4776
+ const e = pr(t, this.type, this.bt, this.Et);
4777
+ return new fn(t.firestore, t.converter, function(t, e) {
4778
+ return new ce(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, e, t.endAt);
4779
+ }(t._query, e));
4774
4780
  }
4775
4781
  }
4776
4782
 
@@ -4784,15 +4790,15 @@ function fr(...t) {
4784
4790
  /*inclusive=*/ !1);
4785
4791
  }
4786
4792
 
4787
- class dr extends nr {
4788
- constructor(t, n, e) {
4789
- super(), this.type = t, this.bt = n, this.Et = e;
4793
+ class dr extends er {
4794
+ constructor(t, e, n) {
4795
+ super(), this.type = t, this.bt = e, this.Et = n;
4790
4796
  }
4791
4797
  _apply(t) {
4792
- const n = pr(t, this.type, this.bt, this.Et);
4793
- return new fe(t.firestore, t.converter, function(t, n) {
4794
- return new an(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, t.startAt, n);
4795
- }(t._query, n));
4798
+ const e = pr(t, this.type, this.bt, this.Et);
4799
+ return new fn(t.firestore, t.converter, function(t, e) {
4800
+ return new ce(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, t.startAt, e);
4801
+ }(t._query, e));
4796
4802
  }
4797
4803
  }
4798
4804
 
@@ -4805,9 +4811,9 @@ function mr(...t) {
4805
4811
  return new dr("endAt", t, /*inclusive=*/ !0);
4806
4812
  }
4807
4813
 
4808
- /** Helper function to create a bound from a document or fields */ function pr(t, n, e, r) {
4809
- if (e[0] = l(e[0]), e[0] instanceof Ke) return function(t, n, e, r, s) {
4810
- if (!r) throw new U(V, `Can't use a DocumentSnapshot that doesn't exist for ${e}().`);
4814
+ /** Helper function to create a bound from a document or fields */ function pr(t, e, n, r) {
4815
+ if (n[0] = l(n[0]), n[0] instanceof Kn) return function(t, e, n, r, s) {
4816
+ if (!r) throw new U(V, `Can't use a DocumentSnapshot that doesn't exist for ${n}().`);
4811
4817
  const i = [];
4812
4818
  // Because people expect to continue/end a query at the exact document
4813
4819
  // provided, we need to use the implicit sort order rather than the explicit
@@ -4816,23 +4822,23 @@ function mr(...t) {
4816
4822
  // the provided document. Without the key (by using the explicit sort
4817
4823
  // orders), multiple documents could match the position, yielding duplicate
4818
4824
  // results.
4819
- for (const e of wn(t)) if (e.field.isKeyField()) i.push(kt(n, r.key)); else {
4820
- const t = r.data.field(e.field);
4821
- if ($t(t)) throw new U(R, 'Invalid query. You are trying to start or end a query using a document for which the field "' + e.field + '" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');
4825
+ for (const n of de(t)) if (n.field.isKeyField()) i.push(kt(e, r.key)); else {
4826
+ const t = r.data.field(n.field);
4827
+ if ($t(t)) throw new U(R, 'Invalid query. You are trying to start or end a query using a document for which the field "' + n.field + '" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');
4822
4828
  if (null === t) {
4823
- const t = e.field.canonicalString();
4829
+ const t = n.field.canonicalString();
4824
4830
  throw new U(R, `Invalid query. You are trying to start or end a query using a document for which the field '${t}' (used as the orderBy) does not exist.`);
4825
4831
  }
4826
4832
  i.push(t);
4827
4833
  }
4828
- return new sn(i, s);
4834
+ return new se(i, s);
4829
4835
  }
4830
4836
  /**
4831
4837
  * Converts a list of field values to a `Bound` for the given query.
4832
- */ (t._query, t.firestore._databaseId, n, e[0]._document, r);
4838
+ */ (t._query, t.firestore._databaseId, e, n[0]._document, r);
4833
4839
  {
4834
- const s = De(t.firestore);
4835
- return function(t, n, e, r, s, i) {
4840
+ const s = Dn(t.firestore);
4841
+ return function(t, e, n, r, s, i) {
4836
4842
  // Use explicit order by's because it has to match the query the user made
4837
4843
  const o = t.explicitOrderBy;
4838
4844
  if (s.length > o.length) throw new U(R, `Too many arguments provided to ${r}(). The number of arguments must be less than or equal to the number of orderBy() clauses`);
@@ -4841,48 +4847,48 @@ function mr(...t) {
4841
4847
  const c = s[i];
4842
4848
  if (o[i].field.isKeyField()) {
4843
4849
  if ("string" != typeof c) throw new U(R, `Invalid query. Expected a string for document ID in ${r}(), but got a ${typeof c}`);
4844
- if (!dn(t) && -1 !== c.indexOf("/")) throw new U(R, `Invalid query. When querying a collection and ordering by documentId(), the value passed to ${r}() must be a plain document ID, but '${c}' contains a slash.`);
4845
- const e = t.path.child(Z.fromString(c));
4846
- if (!et.isDocumentKey(e)) throw new U(R, `Invalid query. When querying a collection group and ordering by documentId(), the value passed to ${r}() must result in a valid document path, but '${e}' is not because it contains an odd number of segments.`);
4847
- const s = new et(e);
4848
- u.push(kt(n, s));
4850
+ if (!fe(t) && -1 !== c.indexOf("/")) throw new U(R, `Invalid query. When querying a collection and ordering by documentId(), the value passed to ${r}() must be a plain document ID, but '${c}' contains a slash.`);
4851
+ const n = t.path.child(Z.fromString(c));
4852
+ if (!nt.isDocumentKey(n)) throw new U(R, `Invalid query. When querying a collection group and ordering by documentId(), the value passed to ${r}() must result in a valid document path, but '${n}' is not because it contains an odd number of segments.`);
4853
+ const s = new nt(n);
4854
+ u.push(kt(e, s));
4849
4855
  } else {
4850
- const t = Ue(e, r, c);
4856
+ const t = Un(n, r, c);
4851
4857
  u.push(t);
4852
4858
  }
4853
4859
  }
4854
- return new sn(u, i);
4860
+ return new se(u, i);
4855
4861
  }
4856
4862
  /**
4857
4863
  * Parses the given `documentIdValue` into a `ReferenceValue`, throwing
4858
4864
  * appropriate errors if the value is anything other than a `DocumentReference`
4859
4865
  * or `string`, or if the string is malformed.
4860
- */ (t._query, t.firestore._databaseId, s, n, e, r);
4866
+ */ (t._query, t.firestore._databaseId, s, e, n, r);
4861
4867
  }
4862
4868
  }
4863
4869
 
4864
- function yr(t, n, e) {
4865
- if ("string" == typeof (e = l(e))) {
4866
- if ("" === e) throw new U(R, "Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");
4867
- if (!dn(n) && -1 !== e.indexOf("/")) throw new U(R, `Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '${e}' contains a '/' character.`);
4868
- const r = n.path.child(Z.fromString(e));
4869
- if (!et.isDocumentKey(r)) throw new U(R, `Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '${r}' is not because it has an odd number of segments (${r.length}).`);
4870
- return kt(t, new et(r));
4870
+ function yr(t, e, n) {
4871
+ if ("string" == typeof (n = l(n))) {
4872
+ if ("" === n) throw new U(R, "Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");
4873
+ if (!fe(e) && -1 !== n.indexOf("/")) throw new U(R, `Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '${n}' contains a '/' character.`);
4874
+ const r = e.path.child(Z.fromString(n));
4875
+ if (!nt.isDocumentKey(r)) throw new U(R, `Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '${r}' is not because it has an odd number of segments (${r.length}).`);
4876
+ return kt(t, new nt(r));
4871
4877
  }
4872
- if (e instanceof le) return kt(t, e._key);
4873
- throw new U(R, `Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${ot(e)}.`);
4878
+ if (n instanceof ln) return kt(t, n._key);
4879
+ throw new U(R, `Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${ot(n)}.`);
4874
4880
  }
4875
4881
 
4876
4882
  /**
4877
4883
  * Validates that the value passed into a disjunctive filter satisfies all
4878
4884
  * array requirements.
4879
- */ function _r(t, n) {
4880
- if (!Array.isArray(t) || 0 === t.length) throw new U(R, `Invalid Query. A non-empty array is required for '${n.toString()}' filters.`);
4881
- if (t.length > 10) throw new U(R, `Invalid Query. '${n.toString()}' filters support a maximum of 10 elements in the value array.`);
4885
+ */ function _r(t, e) {
4886
+ if (!Array.isArray(t) || 0 === t.length) throw new U(R, `Invalid Query. A non-empty array is required for '${e.toString()}' filters.`);
4887
+ if (t.length > 10) throw new U(R, `Invalid Query. '${e.toString()}' filters support a maximum of 10 elements in the value array.`);
4882
4888
  }
4883
4889
 
4884
- function gr(t, n, e) {
4885
- if (!e.isEqual(n)) throw new U(R, `Invalid query. You have a where filter with an inequality (<, <=, !=, not-in, >, or >=) on field '${n.toString()}' and so you must also use '${n.toString()}' as your first argument to orderBy(), but your first orderBy() is on field '${e.toString()}' instead.`);
4890
+ function gr(t, e, n) {
4891
+ if (!n.isEqual(e)) throw new U(R, `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.`);
4886
4892
  }
4887
4893
 
4888
4894
  /**
@@ -4932,17 +4938,17 @@ function gr(t, n, e) {
4932
4938
  * their `set()` or fails due to invalid data originating from a `toFirestore()`
4933
4939
  * call.
4934
4940
  */
4935
- function vr(t, n, e) {
4941
+ function vr(t, e, n) {
4936
4942
  let r;
4937
4943
  // Cast to `any` in order to satisfy the union type constraint on
4938
4944
  // toFirestore().
4939
4945
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4940
- return r = t ? e && (e.merge || e.mergeFields) ? t.toFirestore(n, e) : t.toFirestore(n) : n,
4946
+ return r = t ? n && (n.merge || n.mergeFields) ? t.toFirestore(e, n) : t.toFirestore(e) : e,
4941
4947
  r;
4942
4948
  }
4943
4949
 
4944
4950
  class br extends class {
4945
- convertValue(t, n = "none") {
4951
+ convertValue(t, e = "none") {
4946
4952
  switch (xt(t)) {
4947
4953
  case 0 /* NullValue */ :
4948
4954
  return null;
@@ -4957,7 +4963,7 @@ class br extends class {
4957
4963
  return this.convertTimestamp(t.timestampValue);
4958
4964
 
4959
4965
  case 4 /* ServerTimestampValue */ :
4960
- return this.convertServerTimestamp(t, n);
4966
+ return this.convertServerTimestamp(t, e);
4961
4967
 
4962
4968
  case 5 /* StringValue */ :
4963
4969
  return t.stringValue;
@@ -4972,32 +4978,32 @@ class br extends class {
4972
4978
  return this.convertGeoPoint(t.geoPointValue);
4973
4979
 
4974
4980
  case 9 /* ArrayValue */ :
4975
- return this.convertArray(t.arrayValue, n);
4981
+ return this.convertArray(t.arrayValue, e);
4976
4982
 
4977
4983
  case 10 /* ObjectValue */ :
4978
- return this.convertObject(t.mapValue, n);
4984
+ return this.convertObject(t.mapValue, e);
4979
4985
 
4980
4986
  default:
4981
4987
  throw v();
4982
4988
  }
4983
4989
  }
4984
- convertObject(t, n) {
4985
- const e = {};
4990
+ convertObject(t, e) {
4991
+ const n = {};
4986
4992
  return Tt(t.fields, ((t, r) => {
4987
- e[t] = this.convertValue(r, n);
4988
- })), e;
4993
+ n[t] = this.convertValue(r, e);
4994
+ })), n;
4989
4995
  }
4990
4996
  convertGeoPoint(t) {
4991
- return new Te(Nt(t.latitude), Nt(t.longitude));
4997
+ return new Tn(Nt(t.latitude), Nt(t.longitude));
4992
4998
  }
4993
- convertArray(t, n) {
4994
- return (t.values || []).map((t => this.convertValue(t, n)));
4999
+ convertArray(t, e) {
5000
+ return (t.values || []).map((t => this.convertValue(t, e)));
4995
5001
  }
4996
- convertServerTimestamp(t, n) {
4997
- switch (n) {
5002
+ convertServerTimestamp(t, e) {
5003
+ switch (e) {
4998
5004
  case "previous":
4999
- const e = St(t);
5000
- return null == e ? null : this.convertValue(e, n);
5005
+ const n = St(t);
5006
+ return null == n ? null : this.convertValue(n, e);
5001
5007
 
5002
5008
  case "estimate":
5003
5009
  return this.convertTimestamp(Ft(t));
@@ -5007,16 +5013,16 @@ class br extends class {
5007
5013
  }
5008
5014
  }
5009
5015
  convertTimestamp(t) {
5010
- const n = Vt(t);
5011
- return new vt(n.seconds, n.nanos);
5016
+ const e = Vt(t);
5017
+ return new vt(e.seconds, e.nanos);
5012
5018
  }
5013
- convertDocumentKey(t, n) {
5014
- const e = Z.fromString(t);
5015
- b(Kn(e));
5016
- const r = new J(e.get(1), e.get(3)), s = new et(e.popFirst(5));
5017
- return r.isEqual(n) ||
5019
+ convertDocumentKey(t, e) {
5020
+ const n = Z.fromString(t);
5021
+ b(He(n));
5022
+ const r = new J(n.get(1), n.get(3)), s = new nt(n.popFirst(5));
5023
+ return r.isEqual(e) ||
5018
5024
  // TODO(b/64130202): Somehow support foreign references.
5019
- y(`Document ${s} contains a document reference within a different database (${r.projectId}/${r.database}) which is not supported. It will be treated as a reference in the current database (${n.projectId}/${n.database}) instead.`),
5025
+ y(`Document ${s} contains a document reference within a different database (${r.projectId}/${r.database}) which is not supported. It will be treated as a reference in the current database (${e.projectId}/${e.database}) instead.`),
5020
5026
  s;
5021
5027
  }
5022
5028
  } {
@@ -5024,11 +5030,11 @@ class br extends class {
5024
5030
  super(), this.firestore = t;
5025
5031
  }
5026
5032
  convertBytes(t) {
5027
- return new be(t);
5033
+ return new bn(t);
5028
5034
  }
5029
5035
  convertReference(t) {
5030
- const n = this.convertDocumentKey(t, this.firestore._databaseId);
5031
- return new le(this.firestore, /* converter= */ null, n);
5036
+ const e = this.convertDocumentKey(t, this.firestore._databaseId);
5037
+ return new ln(this.firestore, /* converter= */ null, e);
5032
5038
  }
5033
5039
  }
5034
5040
 
@@ -5045,11 +5051,11 @@ class br extends class {
5045
5051
  * @returns A Promise resolved with a `DocumentSnapshot` containing the current
5046
5052
  * document contents.
5047
5053
  */ function Er(t) {
5048
- const n = se((t = ut(t, le)).firestore), e = new br(t.firestore);
5049
- return ne(n, [ t._key ]).then((n => {
5050
- b(1 === n.length);
5051
- const r = n[0];
5052
- return new Ke(t.firestore, e, t._key, r.isFoundDocument() ? r : null, t.converter);
5054
+ const e = rn((t = ut(t, ln)).firestore), n = new br(t.firestore);
5055
+ return tn(e, [ t._key ]).then((e => {
5056
+ b(1 === e.length);
5057
+ const r = e[0];
5058
+ return new Kn(t.firestore, n, t._key, r.isFoundDocument() ? r : null, t.converter);
5053
5059
  }));
5054
5060
  }
5055
5061
 
@@ -5066,31 +5072,31 @@ class br extends class {
5066
5072
  * @returns A Promise that will be resolved with the results of the query.
5067
5073
  */ function Tr(t) {
5068
5074
  !function(t) {
5069
- if (hn(t) && 0 === t.explicitOrderBy.length) throw new U(O, "limitToLast() queries require specifying at least one orderBy() clause");
5070
- }((t = ut(t, fe))._query);
5071
- const n = se(t.firestore), e = new br(t.firestore);
5072
- return ee(n, t._query).then((n => {
5073
- const r = n.map((n => new Je(t.firestore, e, n.key, n, t.converter)));
5074
- return hn(t._query) &&
5075
+ if (ae(t) && 0 === t.explicitOrderBy.length) throw new U(O, "limitToLast() queries require specifying at least one orderBy() clause");
5076
+ }((t = ut(t, fn))._query);
5077
+ const e = rn(t.firestore), n = new br(t.firestore);
5078
+ return en(e, t._query).then((e => {
5079
+ const r = e.map((e => new Jn(t.firestore, n, e.key, e, t.converter)));
5080
+ return ae(t._query) &&
5075
5081
  // Limit to last queries reverse the orderBy constraint that was
5076
5082
  // specified by the user. As such, we need to reverse the order of the
5077
5083
  // results to return the documents in the expected order.
5078
- r.reverse(), new Xe(t, r);
5084
+ r.reverse(), new Xn(t, r);
5079
5085
  }));
5080
5086
  }
5081
5087
 
5082
- function Ir(t, n, e) {
5083
- const r = vr((t = ut(t, le)).converter, n, e), s = $e(De(t.firestore), "setDoc", t._key, r, null !== t.converter, e);
5084
- return te(se(t.firestore), [ s.toMutation(t._key, In.none()) ]);
5088
+ function Ir(t, e, n) {
5089
+ const r = vr((t = ut(t, ln)).converter, e, n), s = $n(Dn(t.firestore), "setDoc", t._key, r, null !== t.converter, n);
5090
+ return Ze(rn(t.firestore), [ s.toMutation(t._key, Te.none()) ]);
5085
5091
  }
5086
5092
 
5087
- function Ar(t, n, e, ...r) {
5088
- const s = De((t = ut(t, le)).firestore);
5093
+ function Ar(t, e, n, ...r) {
5094
+ const s = Dn((t = ut(t, ln)).firestore);
5089
5095
  // For Compat types, we have to "extract" the underlying types before
5090
5096
  // performing validation.
5091
5097
  let i;
5092
- i = "string" == typeof (n = l(n)) || n instanceof ge ? ke(s, "updateDoc", t._key, n, e, r) : Le(s, "updateDoc", t._key, n);
5093
- return te(se(t.firestore), [ i.toMutation(t._key, In.exists(!0)) ]);
5098
+ i = "string" == typeof (e = l(e)) || e instanceof gn ? kn(s, "updateDoc", t._key, e, n, r) : Ln(s, "updateDoc", t._key, e);
5099
+ return Ze(rn(t.firestore), [ i.toMutation(t._key, Te.exists(!0)) ]);
5094
5100
  }
5095
5101
 
5096
5102
  /**
@@ -5105,7 +5111,7 @@ function Ar(t, n, e, ...r) {
5105
5111
  * @returns A `Promise` resolved once the document has been successfully
5106
5112
  * deleted from the backend.
5107
5113
  */ function Rr(t) {
5108
- return te(se((t = ut(t, le)).firestore), [ new Vn(t._key, In.none()) ]);
5114
+ return Ze(rn((t = ut(t, ln)).firestore), [ new Pe(t._key, Te.none()) ]);
5109
5115
  }
5110
5116
 
5111
5117
  /**
@@ -5122,9 +5128,9 @@ function Ar(t, n, e, ...r) {
5122
5128
  * @throws Error - If the provided input is not a valid Firestore document.
5123
5129
  * @returns A `Promise` resolved with a `DocumentReference` pointing to the
5124
5130
  * newly created document after it has been written to the backend.
5125
- */ function Pr(t, n) {
5126
- const e = pe(t = ut(t, de)), r = vr(t.converter, n), s = $e(De(t.firestore), "addDoc", e._key, r, null !== e.converter, {});
5127
- return te(se(t.firestore), [ s.toMutation(e._key, In.exists(!1)) ]).then((() => e));
5131
+ */ function Pr(t, e) {
5132
+ const n = pn(t = ut(t, dn)), r = vr(t.converter, e), s = $n(Dn(t.firestore), "addDoc", n._key, r, null !== n.converter, {});
5133
+ return Ze(rn(t.firestore), [ s.toMutation(n._key, Te.exists(!1)) ]).then((() => n));
5128
5134
  }
5129
5135
 
5130
5136
  /**
@@ -5147,14 +5153,14 @@ function Ar(t, n, e, ...r) {
5147
5153
  * Returns a sentinel for use with {@link @firebase/firestore/lite#(updateDoc:1)} or
5148
5154
  * {@link @firebase/firestore/lite#(setDoc:1)} with `{merge: true}` to mark a field for deletion.
5149
5155
  */ function Vr() {
5150
- return new Se("deleteField");
5156
+ return new Sn("deleteField");
5151
5157
  }
5152
5158
 
5153
5159
  /**
5154
5160
  * Returns a sentinel used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link @firebase/firestore/lite#(updateDoc:1)} to
5155
5161
  * include a server-generated timestamp in the written data.
5156
5162
  */ function Nr() {
5157
- return new xe("serverTimestamp");
5163
+ return new xn("serverTimestamp");
5158
5164
  }
5159
5165
 
5160
5166
  /**
@@ -5171,7 +5177,7 @@ function Ar(t, n, e, ...r) {
5171
5177
  */ function Dr(...t) {
5172
5178
  // NOTE: We don't actually parse the data until it's used in set() or
5173
5179
  // update() since we'd need the Firestore instance to do this.
5174
- return new qe("arrayUnion", t);
5180
+ return new qn("arrayUnion", t);
5175
5181
  }
5176
5182
 
5177
5183
  /**
@@ -5187,7 +5193,7 @@ function Ar(t, n, e, ...r) {
5187
5193
  */ function $r(...t) {
5188
5194
  // NOTE: We don't actually parse the data until it's used in set() or
5189
5195
  // update() since we'd need the Firestore instance to do this.
5190
- return new Oe("arrayRemove", t);
5196
+ return new On("arrayRemove", t);
5191
5197
  }
5192
5198
 
5193
5199
  /**
@@ -5209,7 +5215,7 @@ function Ar(t, n, e, ...r) {
5209
5215
  * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or
5210
5216
  * `updateDoc()`
5211
5217
  */ function Sr(t) {
5212
- return new Ce("increment", t);
5218
+ return new Cn("increment", t);
5213
5219
  }
5214
5220
 
5215
5221
  /**
@@ -5237,23 +5243,23 @@ function Ar(t, n, e, ...r) {
5237
5243
  * called.
5238
5244
  */ class Fr {
5239
5245
  /** @hideconstructor */
5240
- constructor(t, n) {
5241
- this._firestore = t, this._commitHandler = n, this._mutations = [], this._committed = !1,
5242
- this._dataReader = De(t);
5246
+ constructor(t, e) {
5247
+ this._firestore = t, this._commitHandler = e, this._mutations = [], this._committed = !1,
5248
+ this._dataReader = Dn(t);
5243
5249
  }
5244
- set(t, n, e) {
5250
+ set(t, e, n) {
5245
5251
  this._verifyNotCommitted();
5246
- const r = xr(t, this._firestore), s = vr(r.converter, n, e), i = $e(this._dataReader, "WriteBatch.set", r._key, s, null !== r.converter, e);
5247
- return this._mutations.push(i.toMutation(r._key, In.none())), this;
5252
+ const r = xr(t, this._firestore), s = vr(r.converter, e, n), i = $n(this._dataReader, "WriteBatch.set", r._key, s, null !== r.converter, n);
5253
+ return this._mutations.push(i.toMutation(r._key, Te.none())), this;
5248
5254
  }
5249
- update(t, n, e, ...r) {
5255
+ update(t, e, n, ...r) {
5250
5256
  this._verifyNotCommitted();
5251
5257
  const s = xr(t, this._firestore);
5252
5258
  // For Compat types, we have to "extract" the underlying types before
5253
5259
  // performing validation.
5254
5260
  let i;
5255
- return i = "string" == typeof (n = l(n)) || n instanceof ge ? ke(this._dataReader, "WriteBatch.update", s._key, n, e, r) : Le(this._dataReader, "WriteBatch.update", s._key, n),
5256
- this._mutations.push(i.toMutation(s._key, In.exists(!0))), this;
5261
+ return i = "string" == typeof (e = l(e)) || e instanceof gn ? kn(this._dataReader, "WriteBatch.update", s._key, e, n, r) : Ln(this._dataReader, "WriteBatch.update", s._key, e),
5262
+ this._mutations.push(i.toMutation(s._key, Te.exists(!0))), this;
5257
5263
  }
5258
5264
  /**
5259
5265
  * Deletes the document referred to by the provided {@link DocumentReference}.
@@ -5262,8 +5268,8 @@ function Ar(t, n, e, ...r) {
5262
5268
  * @returns This `WriteBatch` instance. Used for chaining method calls.
5263
5269
  */ delete(t) {
5264
5270
  this._verifyNotCommitted();
5265
- const n = xr(t, this._firestore);
5266
- return this._mutations = this._mutations.concat(new Vn(n._key, In.none())), this;
5271
+ const e = xr(t, this._firestore);
5272
+ return this._mutations = this._mutations.concat(new Pe(e._key, Te.none())), this;
5267
5273
  }
5268
5274
  /**
5269
5275
  * Commits all of the writes in this write batch as a single atomic unit.
@@ -5284,8 +5290,8 @@ function Ar(t, n, e, ...r) {
5284
5290
  }
5285
5291
  }
5286
5292
 
5287
- function xr(t, n) {
5288
- if ((t = l(t)).firestore !== n) throw new U(R, "Provided document reference is from a different Firestore instance.");
5293
+ function xr(t, e) {
5294
+ if ((t = l(t)).firestore !== e) throw new U(R, "Provided document reference is from a different Firestore instance.");
5289
5295
  return t;
5290
5296
  }
5291
5297
 
@@ -5302,8 +5308,8 @@ function xr(t, n) {
5302
5308
  * @returns A `WriteBatch` that can be used to atomically execute multiple
5303
5309
  * writes.
5304
5310
  */ function qr(t) {
5305
- const n = se(t = ut(t, oe));
5306
- return new Fr(t, (t => te(n, t)));
5311
+ const e = rn(t = ut(t, on));
5312
+ return new Fr(t, (t => Ze(e, t)));
5307
5313
  }
5308
5314
 
5309
5315
  /**
@@ -5345,66 +5351,66 @@ function xr(t, n) {
5345
5351
  }
5346
5352
  async lookup(t) {
5347
5353
  if (this.ensureCommitNotCalled(), this.mutations.length > 0) throw new U(R, "Firestore transactions require all reads to be executed before all writes.");
5348
- const n = await ne(this.datastore, t);
5349
- return n.forEach((t => this.recordVersion(t))), n;
5354
+ const e = await tn(this.datastore, t);
5355
+ return e.forEach((t => this.recordVersion(t))), e;
5350
5356
  }
5351
- set(t, n) {
5352
- this.write(n.toMutation(t, this.precondition(t))), this.writtenDocs.add(t.toString());
5357
+ set(t, e) {
5358
+ this.write(e.toMutation(t, this.precondition(t))), this.writtenDocs.add(t.toString());
5353
5359
  }
5354
- update(t, n) {
5360
+ update(t, e) {
5355
5361
  try {
5356
- this.write(n.toMutation(t, this.preconditionForUpdate(t)));
5362
+ this.write(e.toMutation(t, this.preconditionForUpdate(t)));
5357
5363
  } catch (t) {
5358
5364
  this.lastWriteError = t;
5359
5365
  }
5360
5366
  this.writtenDocs.add(t.toString());
5361
5367
  }
5362
5368
  delete(t) {
5363
- this.write(new Vn(t, this.precondition(t))), this.writtenDocs.add(t.toString());
5369
+ this.write(new Pe(t, this.precondition(t))), this.writtenDocs.add(t.toString());
5364
5370
  }
5365
5371
  async commit() {
5366
5372
  if (this.ensureCommitNotCalled(), this.lastWriteError) throw this.lastWriteError;
5367
5373
  const t = this.readVersions;
5368
5374
  // For each mutation, note that the doc was written.
5369
- this.mutations.forEach((n => {
5370
- t.delete(n.key.toString());
5375
+ this.mutations.forEach((e => {
5376
+ t.delete(e.key.toString());
5371
5377
  })),
5372
5378
  // For each document that was read but not written to, we want to perform
5373
5379
  // a `verify` operation.
5374
- t.forEach(((t, n) => {
5375
- const e = et.fromPath(n);
5376
- this.mutations.push(new Nn(e, this.precondition(e)));
5377
- })), await te(this.datastore, this.mutations), this.committed = !0;
5380
+ t.forEach(((t, e) => {
5381
+ const n = nt.fromPath(e);
5382
+ this.mutations.push(new Ve(n, this.precondition(n)));
5383
+ })), await Ze(this.datastore, this.mutations), this.committed = !0;
5378
5384
  }
5379
5385
  recordVersion(t) {
5380
- let n;
5381
- if (t.isFoundDocument()) n = t.version; else {
5386
+ let e;
5387
+ if (t.isFoundDocument()) e = t.version; else {
5382
5388
  if (!t.isNoDocument()) throw v();
5383
5389
  // For deleted docs, we must use baseVersion 0 when we overwrite them.
5384
- n = bt.min();
5390
+ e = bt.min();
5385
5391
  }
5386
- const e = this.readVersions.get(t.key.toString());
5387
- if (e) {
5388
- if (!n.isEqual(e))
5392
+ const n = this.readVersions.get(t.key.toString());
5393
+ if (n) {
5394
+ if (!e.isEqual(n))
5389
5395
  // This transaction will fail no matter what.
5390
5396
  throw new U(x, "Document version changed between two reads.");
5391
- } else this.readVersions.set(t.key.toString(), n);
5397
+ } else this.readVersions.set(t.key.toString(), e);
5392
5398
  }
5393
5399
  /**
5394
5400
  * Returns the version of this document when it was read in this transaction,
5395
5401
  * as a precondition, or no precondition if it was not read.
5396
5402
  */ precondition(t) {
5397
- const n = this.readVersions.get(t.toString());
5398
- return !this.writtenDocs.has(t.toString()) && n ? In.updateTime(n) : In.none();
5403
+ const e = this.readVersions.get(t.toString());
5404
+ return !this.writtenDocs.has(t.toString()) && e ? Te.updateTime(e) : Te.none();
5399
5405
  }
5400
5406
  /**
5401
5407
  * Returns the precondition for a document if the operation is an update.
5402
5408
  */ preconditionForUpdate(t) {
5403
- const n = this.readVersions.get(t.toString());
5409
+ const e = this.readVersions.get(t.toString());
5404
5410
  // The first time a document is written, we want to take into account the
5405
5411
  // read time and existence
5406
- if (!this.writtenDocs.has(t.toString()) && n) {
5407
- if (n.isEqual(bt.min()))
5412
+ if (!this.writtenDocs.has(t.toString()) && e) {
5413
+ if (e.isEqual(bt.min()))
5408
5414
  // The document doesn't exist, so fail the transaction.
5409
5415
  // This has to be validated locally because you can't send a
5410
5416
  // precondition that a document does not exist without changing the
@@ -5416,11 +5422,11 @@ function xr(t, n) {
5416
5422
  // transaction.
5417
5423
  throw new U(R, "Can't update a document that doesn't exist.");
5418
5424
  // Document exists, base precondition on document update time.
5419
- return In.updateTime(n);
5425
+ return Te.updateTime(e);
5420
5426
  }
5421
5427
  // Document was not read, so we just use the preconditions for a blind
5422
5428
  // update.
5423
- return In.exists(!0);
5429
+ return Te.exists(!0);
5424
5430
  }
5425
5431
  write(t) {
5426
5432
  this.ensureCommitNotCalled(), this.mutations.push(t);
@@ -5449,19 +5455,19 @@ function xr(t, n) {
5449
5455
  * with backoff.
5450
5456
  */
5451
5457
  class Cr {
5452
- constructor(t, n, e, r) {
5453
- this.asyncQueue = t, this.datastore = n, this.updateFunction = e, this.deferred = r,
5454
- this.Tt = 5, this.It = new Xn(this.asyncQueue, "transaction_retry" /* TransactionRetry */);
5458
+ constructor(t, e, n, r) {
5459
+ this.asyncQueue = t, this.datastore = e, this.updateFunction = n, this.deferred = r,
5460
+ this.Tt = 5, this.It = new Je(this.asyncQueue, "transaction_retry" /* TransactionRetry */);
5455
5461
  }
5456
5462
  /** Runs the transaction and sets the result on deferred. */ run() {
5457
5463
  this.Tt -= 1, this.At();
5458
5464
  }
5459
5465
  At() {
5460
5466
  this.It.W((async () => {
5461
- const t = new Or(this.datastore), n = this.Rt(t);
5462
- n && n.then((n => {
5467
+ const t = new Or(this.datastore), e = this.Rt(t);
5468
+ e && e.then((e => {
5463
5469
  this.asyncQueue.enqueueAndForget((() => t.commit().then((() => {
5464
- this.deferred.resolve(n);
5470
+ this.deferred.resolve(e);
5465
5471
  })).catch((t => {
5466
5472
  this.Pt(t);
5467
5473
  }))));
@@ -5472,8 +5478,8 @@ class Cr {
5472
5478
  }
5473
5479
  Rt(t) {
5474
5480
  try {
5475
- const n = this.updateFunction(t);
5476
- return !at(n) && n.catch && n.then ? n : (this.deferred.reject(Error("Transaction callback must return a Promise")),
5481
+ const e = this.updateFunction(t);
5482
+ return !at(e) && e.catch && e.then ? e : (this.deferred.reject(Error("Transaction callback must return a Promise")),
5477
5483
  null);
5478
5484
  } catch (t) {
5479
5485
  // Do not retry errors thrown by user provided updateFunction.
@@ -5488,8 +5494,8 @@ class Cr {
5488
5494
  if ("FirebaseError" === t.name) {
5489
5495
  // In transactions, the backend will fail outdated reads with FAILED_PRECONDITION and
5490
5496
  // non-matching document versions with ABORTED. These errors should be retried.
5491
- const n = t.code;
5492
- return "aborted" === n || "failed-precondition" === n || !
5497
+ const e = t.code;
5498
+ return "aborted" === e || "failed-precondition" === e || !
5493
5499
  /**
5494
5500
  * Determines whether an error code represents a permanent error when received
5495
5501
  * in response to a non-write operation.
@@ -5526,7 +5532,7 @@ class Cr {
5526
5532
  case k:
5527
5533
  return !0;
5528
5534
  }
5529
- }(n);
5535
+ }(e);
5530
5536
  }
5531
5537
  return !1;
5532
5538
  }
@@ -5581,8 +5587,8 @@ class Cr {
5581
5587
  * in newer versions of TypeScript defines `finally`, which is not available in
5582
5588
  * IE.
5583
5589
  */ class kr {
5584
- constructor(t, n, e, r, s) {
5585
- this.asyncQueue = t, this.timerId = n, this.targetTimeMs = e, this.op = r, this.removalCallback = s,
5590
+ constructor(t, e, n, r, s) {
5591
+ this.asyncQueue = t, this.timerId = e, this.targetTimeMs = n, this.op = r, this.removalCallback = s,
5586
5592
  this.deferred = new j, this.then = this.deferred.promise.then.bind(this.deferred.promise),
5587
5593
  // It's normal for the deferred promise to be canceled (due to cancellation)
5588
5594
  // and so we attach a dummy catch callback to avoid
@@ -5602,9 +5608,9 @@ class Cr {
5602
5608
  * from its delayedOperations list.
5603
5609
  * PORTING NOTE: This exists to prevent making removeDelayedOperation() and
5604
5610
  * the DelayedOperation class public.
5605
- */ static createAndSchedule(t, n, e, r, s) {
5606
- const i = Date.now() + e, o = new kr(t, n, i, r, s);
5607
- return o.start(e), o;
5611
+ */ static createAndSchedule(t, e, n, r, s) {
5612
+ const i = Date.now() + n, o = new kr(t, e, i, r, s);
5613
+ return o.start(n), o;
5608
5614
  }
5609
5615
  /**
5610
5616
  * Starts the timer. This is called immediately after construction by
@@ -5675,7 +5681,7 @@ class Cr {
5675
5681
  // List of TimerIds to fast-forward delays for.
5676
5682
  this.Ot = [],
5677
5683
  // Backoff timer used to schedule retries for retryable operations
5678
- this.It = new Xn(this, "async_queue_retry" /* AsyncQueueRetry */),
5684
+ this.It = new Je(this, "async_queue_retry" /* AsyncQueueRetry */),
5679
5685
  // Visibility handler that triggers an immediate retry of all retryable
5680
5686
  // operations. Meant to speed up recovery when we regain file system access
5681
5687
  // after page comes into foreground.
@@ -5704,8 +5710,8 @@ class Cr {
5704
5710
  enterRestrictedMode(t) {
5705
5711
  if (!this.$t) {
5706
5712
  this.$t = !0, this.qt = t || !1;
5707
- const n = Lr();
5708
- n && "function" == typeof n.removeEventListener && n.removeEventListener("visibilitychange", this.Ct);
5713
+ const e = Lr();
5714
+ e && "function" == typeof e.removeEventListener && e.removeEventListener("visibilitychange", this.Ct);
5709
5715
  }
5710
5716
  }
5711
5717
  enqueue(t) {
@@ -5715,9 +5721,9 @@ class Cr {
5715
5721
  // Create a deferred Promise that we can return to the callee. This
5716
5722
  // allows us to return a "hanging Promise" only to the callee and still
5717
5723
  // advance the queue even when the operation is not run.
5718
- const n = new j;
5719
- return this.kt((() => this.$t && this.qt ? Promise.resolve() : (t().then(n.resolve, n.reject),
5720
- n.promise))).then((() => n.promise));
5724
+ const e = new j;
5725
+ return this.kt((() => this.$t && this.qt ? Promise.resolve() : (t().then(e.resolve, e.reject),
5726
+ e.promise))).then((() => e.promise));
5721
5727
  }
5722
5728
  enqueueRetryable(t) {
5723
5729
  this.enqueueAndForget((() => (this.Dt.push(t), this.Ut())));
@@ -5787,18 +5793,18 @@ class Cr {
5787
5793
  }
5788
5794
  }
5789
5795
  kt(t) {
5790
- const n = this.Nt.then((() => (this.xt = !0, t().catch((t => {
5796
+ const e = this.Nt.then((() => (this.xt = !0, t().catch((t => {
5791
5797
  this.Ft = t, this.xt = !1;
5792
- const n =
5798
+ const e =
5793
5799
  /**
5794
5800
  * Chrome includes Error.message in Error.stack. Other browsers do not.
5795
5801
  * This returns expected output of message + stack when available.
5796
5802
  * @param error - Error or FirestoreError
5797
5803
  */
5798
5804
  function(t) {
5799
- let n = t.message || "";
5800
- t.stack && (n = t.stack.includes(t.message) ? t.stack : t.message + "\n" + t.stack);
5801
- return n;
5805
+ let e = t.message || "";
5806
+ t.stack && (e = t.stack.includes(t.message) ? t.stack : t.message + "\n" + t.stack);
5807
+ return e;
5802
5808
  }
5803
5809
  /**
5804
5810
  * @license
@@ -5828,15 +5834,15 @@ class Cr {
5828
5834
  // Re-throw the error so that this.tail becomes a rejected Promise and
5829
5835
  // all further attempts to chain (via .then) will just short-circuit
5830
5836
  // and return the rejected Promise.
5831
- throw y("INTERNAL UNHANDLED ERROR: ", n), t;
5837
+ throw y("INTERNAL UNHANDLED ERROR: ", e), t;
5832
5838
  })).then((t => (this.xt = !1, t))))));
5833
- return this.Nt = n, n;
5839
+ return this.Nt = e, e;
5834
5840
  }
5835
- enqueueAfterDelay(t, n, e) {
5841
+ enqueueAfterDelay(t, e, n) {
5836
5842
  this.Lt(),
5837
5843
  // Fast-forward delays for timerIds that have been overriden.
5838
- this.Ot.indexOf(t) > -1 && (n = 0);
5839
- const r = kr.createAndSchedule(this, t, n, e, (t => this.jt(t)));
5844
+ this.Ot.indexOf(t) > -1 && (e = 0);
5845
+ const r = kr.createAndSchedule(this, t, e, n, (t => this.jt(t)));
5840
5846
  return this.St.push(r), r;
5841
5847
  }
5842
5848
  Lt() {
@@ -5860,7 +5866,7 @@ class Cr {
5860
5866
  * For Tests: Determine if a delayed operation with a particular TimerId
5861
5867
  * exists.
5862
5868
  */ Bt(t) {
5863
- for (const n of this.St) if (n.timerId === t) return !0;
5869
+ for (const e of this.St) if (e.timerId === t) return !0;
5864
5870
  return !1;
5865
5871
  }
5866
5872
  /**
@@ -5873,27 +5879,27 @@ class Cr {
5873
5879
  // Note that draining may generate more delayed ops, so we do that first.
5874
5880
  return this.Mt().then((() => {
5875
5881
  // Run ops in the same order they'd run if they ran naturally.
5876
- this.St.sort(((t, n) => t.targetTimeMs - n.targetTimeMs));
5877
- for (const n of this.St) if (n.skipDelay(), "all" /* All */ !== t && n.timerId === t) break;
5882
+ this.St.sort(((t, e) => t.targetTimeMs - e.targetTimeMs));
5883
+ for (const e of this.St) if (e.skipDelay(), "all" /* All */ !== t && e.timerId === t) break;
5878
5884
  return this.Mt();
5879
5885
  }));
5880
5886
  }
5881
5887
  /**
5882
5888
  * For Tests: Skip all subsequent delays for a timer id.
5883
- */ Qt(t) {
5889
+ */ Gt(t) {
5884
5890
  this.Ot.push(t);
5885
5891
  }
5886
5892
  /** Called once a DelayedOperation is run or canceled. */ jt(t) {
5887
5893
  // NOTE: indexOf / slice are O(n), but delayedOperations is expected to be small.
5888
- const n = this.St.indexOf(t);
5889
- this.St.splice(n, 1);
5894
+ const e = this.St.indexOf(t);
5895
+ this.St.splice(e, 1);
5890
5896
  }
5891
5897
  }
5892
5898
 
5893
5899
  class jr {
5894
5900
  /** @hideconstructor */
5895
- constructor(t, n) {
5896
- this._firestore = t, this._transaction = n, this._dataReader = De(t);
5901
+ constructor(t, e) {
5902
+ this._firestore = t, this._transaction = e, this._dataReader = Dn(t);
5897
5903
  }
5898
5904
  /**
5899
5905
  * Reads the document referenced by the provided {@link DocumentReference}.
@@ -5901,25 +5907,25 @@ class jr {
5901
5907
  * @param documentRef - A reference to the document to be read.
5902
5908
  * @returns A `DocumentSnapshot` with the read data.
5903
5909
  */ get(t) {
5904
- const n = xr(t, this._firestore), e = new br(this._firestore);
5905
- return this._transaction.lookup([ n._key ]).then((t => {
5910
+ const e = xr(t, this._firestore), n = new br(this._firestore);
5911
+ return this._transaction.lookup([ e._key ]).then((t => {
5906
5912
  if (!t || 1 !== t.length) return v();
5907
5913
  const r = t[0];
5908
- if (r.isFoundDocument()) return new Ke(this._firestore, e, r.key, r, n.converter);
5909
- if (r.isNoDocument()) return new Ke(this._firestore, e, n._key, null, n.converter);
5914
+ if (r.isFoundDocument()) return new Kn(this._firestore, n, r.key, r, e.converter);
5915
+ if (r.isNoDocument()) return new Kn(this._firestore, n, e._key, null, e.converter);
5910
5916
  throw v();
5911
5917
  }));
5912
5918
  }
5913
- set(t, n, e) {
5914
- const r = xr(t, this._firestore), s = vr(r.converter, n, e), i = $e(this._dataReader, "Transaction.set", r._key, s, null !== r.converter, e);
5919
+ set(t, e, n) {
5920
+ const r = xr(t, this._firestore), s = vr(r.converter, e, n), i = $n(this._dataReader, "Transaction.set", r._key, s, null !== r.converter, n);
5915
5921
  return this._transaction.set(r._key, i), this;
5916
5922
  }
5917
- update(t, n, e, ...r) {
5923
+ update(t, e, n, ...r) {
5918
5924
  const s = xr(t, this._firestore);
5919
5925
  // For Compat types, we have to "extract" the underlying types before
5920
5926
  // performing validation.
5921
5927
  let i;
5922
- return i = "string" == typeof (n = l(n)) || n instanceof ge ? ke(this._dataReader, "Transaction.update", s._key, n, e, r) : Le(this._dataReader, "Transaction.update", s._key, n),
5928
+ return i = "string" == typeof (e = l(e)) || e instanceof gn ? kn(this._dataReader, "Transaction.update", s._key, e, n, r) : Ln(this._dataReader, "Transaction.update", s._key, e),
5923
5929
  this._transaction.update(s._key, i), this;
5924
5930
  }
5925
5931
  /**
@@ -5928,8 +5934,8 @@ class jr {
5928
5934
  * @param documentRef - A reference to the document to be deleted.
5929
5935
  * @returns This `Transaction` instance. Used for chaining method calls.
5930
5936
  */ delete(t) {
5931
- const n = xr(t, this._firestore);
5932
- return this._transaction.delete(n._key), this;
5937
+ const e = xr(t, this._firestore);
5938
+ return this._transaction.delete(e._key), this;
5933
5939
  }
5934
5940
  }
5935
5941
 
@@ -5949,9 +5955,9 @@ class jr {
5949
5955
  * (the `updateFunction` returned a failed promise), the promise returned by the
5950
5956
  * `updateFunction `is returned here. Otherwise, if the transaction failed, a
5951
5957
  * rejected promise with the corresponding failure error is returned.
5952
- */ function Mr(t, n) {
5953
- const e = se(t = ut(t, oe)), r = new j;
5954
- return new Cr(new Ur, e, (e => n(new jr(t, e))), r).run(), r.promise;
5958
+ */ function Mr(t, e) {
5959
+ const n = rn(t = ut(t, on)), r = new j;
5960
+ return new Cr(new Ur, n, (n => e(new jr(t, n))), r).run(), r.promise;
5955
5961
  }
5956
5962
 
5957
5963
  /**
@@ -5963,12 +5969,12 @@ class jr {
5963
5969
  * @packageDocumentation
5964
5970
  */ !function(t) {
5965
5971
  d = t;
5966
- }(`${s}_lite`), e(new i("firestore/lite", ((t, {options: n}) => {
5967
- const e = t.getProvider("app").getImmediate(), r = new oe(e, new Q(t.getProvider("auth-internal")), new H(t.getProvider("app-check-internal")));
5968
- return n && r._setSettings(n), r;
5972
+ }(`${s}_lite`), n(new i("firestore/lite", ((t, {options: e}) => {
5973
+ const n = t.getProvider("app").getImmediate(), r = new on(n, new G(t.getProvider("auth-internal")), new H(t.getProvider("app-check-internal")));
5974
+ return e && r._setSettings(e), r;
5969
5975
  }), "PUBLIC")),
5970
5976
  // RUNTIME_ENV and BUILD_TARGET are replaced by real values during the compilation
5971
- r("firestore-lite", "3.4.4-canary.0482aa5b7", "rn"), r("firestore-lite", "3.4.4-canary.0482aa5b7", "esm2017");
5977
+ r("firestore-lite", "3.4.4-canary.3e9f3e253", "rn"), r("firestore-lite", "3.4.4-canary.3e9f3e253", "esm2017");
5972
5978
 
5973
- export { be as Bytes, de as CollectionReference, le as DocumentReference, Ke as DocumentSnapshot, ge as FieldPath, Ee as FieldValue, oe as Firestore, U as FirestoreError, Te as GeoPoint, fe as Query, nr as QueryConstraint, Je as QueryDocumentSnapshot, Xe as QuerySnapshot, vt as Timestamp, jr as Transaction, Fr as WriteBatch, Pr as addDoc, $r as arrayRemove, Dr as arrayUnion, we as collection, me as collectionGroup, ae as connectFirestoreEmulator, Rr as deleteDoc, Vr as deleteField, pe as doc, ve as documentId, mr as endAt, wr as endBefore, Er as getDoc, Tr as getDocs, ce as getFirestore, Sr as increment, ue as initializeFirestore, cr as limit, ar as limitToLast, or as orderBy, er as query, _e as queryEqual, ye as refEqual, Mr as runTransaction, Nr as serverTimestamp, Ir as setDoc, m as setLogLevel, Ze as snapshotEqual, fr as startAfter, lr as startAt, he as terminate, Ar as updateDoc, sr as where, qr as writeBatch };
5979
+ export { bn as Bytes, dn as CollectionReference, ln as DocumentReference, Kn as DocumentSnapshot, gn as FieldPath, En as FieldValue, on as Firestore, U as FirestoreError, Tn as GeoPoint, fn as Query, er as QueryConstraint, Jn as QueryDocumentSnapshot, Xn as QuerySnapshot, vt as Timestamp, jr as Transaction, Fr as WriteBatch, Pr as addDoc, $r as arrayRemove, Dr as arrayUnion, wn as collection, mn as collectionGroup, an as connectFirestoreEmulator, Rr as deleteDoc, Vr as deleteField, pn as doc, vn as documentId, mr as endAt, wr as endBefore, Er as getDoc, Tr as getDocs, cn as getFirestore, Sr as increment, un as initializeFirestore, cr as limit, ar as limitToLast, or as orderBy, nr as query, _n as queryEqual, yn as refEqual, Mr as runTransaction, Nr as serverTimestamp, Ir as setDoc, m as setLogLevel, Zn as snapshotEqual, fr as startAfter, lr as startAt, hn as terminate, Ar as updateDoc, sr as where, qr as writeBatch };
5974
5980
  //# sourceMappingURL=index.rn.esm2017.js.map