@firebase/firestore 4.6.2-dataconnect-preview.877f8b7d0 → 4.6.2

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.
@@ -3,8 +3,6 @@ import { Component } from '@firebase/component';
3
3
  import { Logger, LogLevel } from '@firebase/logger';
4
4
  import { FirebaseError, getDefaultEmulatorHostnameAndPort, createMockUserToken, getModularInstance, deepEqual } from '@firebase/util';
5
5
 
6
- const d = "4.6.2-dataconnect-preview.877f8b7d0";
7
-
8
6
  /**
9
7
  * @license
10
8
  * Copyright 2017 Google LLC
@@ -24,7 +22,8 @@ const d = "4.6.2-dataconnect-preview.877f8b7d0";
24
22
  /**
25
23
  * Simple wrapper around a nullable UID. Mostly exists to make code more
26
24
  * readable.
27
- */ class User {
25
+ */
26
+ class User {
28
27
  constructor(t) {
29
28
  this.uid = t;
30
29
  }
@@ -64,7 +63,7 @@ User.MOCK_USER = new User("mock-user");
64
63
  * See the License for the specific language governing permissions and
65
64
  * limitations under the License.
66
65
  */
67
- let f = "10.12.0-dataconnect-preview.877f8b7d0";
66
+ let d = "10.12.0";
68
67
 
69
68
  /**
70
69
  * @license
@@ -82,7 +81,7 @@ let f = "10.12.0-dataconnect-preview.877f8b7d0";
82
81
  * See the License for the specific language governing permissions and
83
82
  * limitations under the License.
84
83
  */
85
- const E = new Logger("@firebase/firestore");
84
+ const f = new Logger("@firebase/firestore");
86
85
 
87
86
  /**
88
87
  * Sets the verbosity of Cloud Firestore logs (debug, error, or silent).
@@ -97,29 +96,29 @@ const E = new Logger("@firebase/firestore");
97
96
  * <li><code>`silent` to turn off logging.</li>
98
97
  * </ul>
99
98
  */ function setLogLevel(t) {
100
- E.setLogLevel(t);
99
+ f.setLogLevel(t);
101
100
  }
102
101
 
103
102
  function __PRIVATE_logDebug(t, ...e) {
104
- if (E.logLevel <= LogLevel.DEBUG) {
103
+ if (f.logLevel <= LogLevel.DEBUG) {
105
104
  const r = e.map(__PRIVATE_argToString);
106
- E.debug(`Firestore (${f}): ${t}`, ...r);
105
+ f.debug(`Firestore (${d}): ${t}`, ...r);
107
106
  }
108
107
  }
109
108
 
110
109
  function __PRIVATE_logError(t, ...e) {
111
- if (E.logLevel <= LogLevel.ERROR) {
110
+ if (f.logLevel <= LogLevel.ERROR) {
112
111
  const r = e.map(__PRIVATE_argToString);
113
- E.error(`Firestore (${f}): ${t}`, ...r);
112
+ f.error(`Firestore (${d}): ${t}`, ...r);
114
113
  }
115
114
  }
116
115
 
117
116
  /**
118
117
  * @internal
119
118
  */ function __PRIVATE_logWarn(t, ...e) {
120
- if (E.logLevel <= LogLevel.WARN) {
119
+ if (f.logLevel <= LogLevel.WARN) {
121
120
  const r = e.map(__PRIVATE_argToString);
122
- E.warn(`Firestore (${f}): ${t}`, ...r);
121
+ f.warn(`Firestore (${d}): ${t}`, ...r);
123
122
  }
124
123
  }
125
124
 
@@ -180,7 +179,7 @@ function __PRIVATE_logError(t, ...e) {
180
179
  */ function fail(t = "Unexpected state") {
181
180
  // Log the failure in addition to throw an exception, just in case the
182
181
  // exception is swallowed.
183
- const e = `FIRESTORE (${f}) INTERNAL ASSERTION FAILED: ` + t;
182
+ const e = `FIRESTORE (${d}) INTERNAL ASSERTION FAILED: ` + t;
184
183
  // NOTE: We don't use FirestoreError here because these are internal failures
185
184
  // that cannot be handled by the user. (Also it would create a circular
186
185
  // dependency between the error and assert modules which doesn't work.)
@@ -220,7 +219,7 @@ e) {
220
219
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
221
220
  * See the License for the specific language governing permissions and
222
221
  * limitations under the License.
223
- */ const m = "ok", A = "cancelled", T = "unknown", R = "invalid-argument", P = "deadline-exceeded", I = "not-found", V = "already-exists", p = "permission-denied", y = "unauthenticated", w = "resource-exhausted", g = "failed-precondition", F = "aborted", v = "out-of-range", D = "unimplemented", b = "internal", C = "unavailable", S = "data-loss";
222
+ */ const E = "ok", m = "cancelled", A = "unknown", T = "invalid-argument", R = "deadline-exceeded", P = "not-found", I = "already-exists", V = "permission-denied", p = "unauthenticated", y = "resource-exhausted", w = "failed-precondition", g = "aborted", F = "out-of-range", v = "unimplemented", D = "internal", b = "unavailable", C = "data-loss";
224
223
 
225
224
  /** An error returned by a Firestore operation. */ class FirestoreError extends FirebaseError {
226
225
  /** @hideconstructor */
@@ -577,7 +576,7 @@ class BasePath {
577
576
  // for legacy reasons and should not be used frequently).
578
577
  const e = [];
579
578
  for (const r of t) {
580
- if (r.indexOf("//") >= 0) throw new FirestoreError(R, `Invalid segment (${r}). Paths must not contain // in them.`);
579
+ if (r.indexOf("//") >= 0) throw new FirestoreError(T, `Invalid segment (${r}). Paths must not contain // in them.`);
581
580
  // Strip leading and traling slashed.
582
581
  e.push(...r.split("/").filter((t => t.length > 0)));
583
582
  }
@@ -588,7 +587,7 @@ class BasePath {
588
587
  }
589
588
  }
590
589
 
591
- const N = /^[_a-zA-Z][_a-zA-Z0-9]*$/;
590
+ const S = /^[_a-zA-Z][_a-zA-Z0-9]*$/;
592
591
 
593
592
  /**
594
593
  * A dot-separated path for navigating sub-objects within a document.
@@ -601,7 +600,7 @@ const N = /^[_a-zA-Z][_a-zA-Z0-9]*$/;
601
600
  * Returns true if the string could be used as a segment in a field path
602
601
  * without escaping.
603
602
  */ static isValidIdentifier(t) {
604
- return N.test(t);
603
+ return S.test(t);
605
604
  }
606
605
  canonicalString() {
607
606
  return this.toArray().map((t => (t = t.replace(/\\/g, "\\\\").replace(/`/g, "\\`"),
@@ -633,21 +632,21 @@ const N = /^[_a-zA-Z][_a-zA-Z0-9]*$/;
633
632
  const e = [];
634
633
  let r = "", n = 0;
635
634
  const __PRIVATE_addCurrentSegment = () => {
636
- if (0 === r.length) throw new FirestoreError(R, `Invalid field path (${t}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);
635
+ if (0 === r.length) throw new FirestoreError(T, `Invalid field path (${t}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);
637
636
  e.push(r), r = "";
638
637
  };
639
638
  let i = !1;
640
639
  for (;n < t.length; ) {
641
640
  const e = t[n];
642
641
  if ("\\" === e) {
643
- if (n + 1 === t.length) throw new FirestoreError(R, "Path has trailing escape character: " + t);
642
+ if (n + 1 === t.length) throw new FirestoreError(T, "Path has trailing escape character: " + t);
644
643
  const e = t[n + 1];
645
- if ("\\" !== e && "." !== e && "`" !== e) throw new FirestoreError(R, "Path has invalid escape sequence: " + t);
644
+ if ("\\" !== e && "." !== e && "`" !== e) throw new FirestoreError(T, "Path has invalid escape sequence: " + t);
646
645
  r += e, n += 2;
647
646
  } else "`" === e ? (i = !i, n++) : "." !== e || i ? (r += e, n++) : (__PRIVATE_addCurrentSegment(),
648
647
  n++);
649
648
  }
650
- if (__PRIVATE_addCurrentSegment(), i) throw new FirestoreError(R, "Unterminated ` in path: " + t);
649
+ if (__PRIVATE_addCurrentSegment(), i) throw new FirestoreError(T, "Unterminated ` in path: " + t);
651
650
  return new FieldPath$1(e);
652
651
  }
653
652
  static emptyPath() {
@@ -736,7 +735,7 @@ const N = /^[_a-zA-Z][_a-zA-Z0-9]*$/;
736
735
  * See the License for the specific language governing permissions and
737
736
  * limitations under the License.
738
737
  */ function __PRIVATE_validateNonEmptyArgument(t, e, r) {
739
- if (!r) throw new FirestoreError(R, `Function ${t}() cannot be called with an empty ${e}.`);
738
+ if (!r) throw new FirestoreError(T, `Function ${t}() cannot be called with an empty ${e}.`);
740
739
  }
741
740
 
742
741
  /**
@@ -748,14 +747,14 @@ const N = /^[_a-zA-Z][_a-zA-Z0-9]*$/;
748
747
  * an even numbers of segments).
749
748
  */
750
749
  function __PRIVATE_validateDocumentPath(t) {
751
- if (!DocumentKey.isDocumentKey(t)) throw new FirestoreError(R, `Invalid document reference. Document references must have an even number of segments, but ${t} has ${t.length}.`);
750
+ if (!DocumentKey.isDocumentKey(t)) throw new FirestoreError(T, `Invalid document reference. Document references must have an even number of segments, but ${t} has ${t.length}.`);
752
751
  }
753
752
 
754
753
  /**
755
754
  * Validates that `path` refers to a collection (indicated by the fact it
756
755
  * contains an odd numbers of segments).
757
756
  */ function __PRIVATE_validateCollectionPath(t) {
758
- if (DocumentKey.isDocumentKey(t)) throw new FirestoreError(R, `Invalid collection reference. Collection references must have an odd number of segments, but ${t} has ${t.length}.`);
757
+ if (DocumentKey.isDocumentKey(t)) throw new FirestoreError(T, `Invalid collection reference. Collection references must have an odd number of segments, but ${t} has ${t.length}.`);
759
758
  }
760
759
 
761
760
  /**
@@ -799,17 +798,17 @@ e) {
799
798
  // Unwrap Compat types
800
799
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
801
800
  t = t._delegate), !(t instanceof e)) {
802
- if (e.name === t.constructor.name) throw new FirestoreError(R, "Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");
801
+ if (e.name === t.constructor.name) throw new FirestoreError(T, "Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");
803
802
  {
804
803
  const r = __PRIVATE_valueDescription(t);
805
- throw new FirestoreError(R, `Expected type '${e.name}', but it was: ${r}`);
804
+ throw new FirestoreError(T, `Expected type '${e.name}', but it was: ${r}`);
806
805
  }
807
806
  }
808
807
  return t;
809
808
  }
810
809
 
811
810
  function __PRIVATE_validatePositiveNumber(t, e) {
812
- if (e <= 0) throw new FirestoreError(R, `Function ${t}() requires a positive number, but it was: ${e}.`);
811
+ if (e <= 0) throw new FirestoreError(T, `Function ${t}() requires a positive number, but it was: ${e}.`);
813
812
  }
814
813
 
815
814
  /**
@@ -859,7 +858,7 @@ function __PRIVATE_cloneLongPollingOptions(t) {
859
858
  /**
860
859
  * The value returned from the most recent invocation of
861
860
  * `generateUniqueDebugId()`, or null if it has never been invoked.
862
- */ let O = null;
861
+ */ let N = null;
863
862
 
864
863
  /**
865
864
  * Generates and returns an initial value for `lastUniqueDebugId`.
@@ -884,9 +883,9 @@ function __PRIVATE_cloneLongPollingOptions(t) {
884
883
  * @return the 10-character generated ID (e.g. "0xa1b2c3d4").
885
884
  */
886
885
  function __PRIVATE_generateUniqueDebugId() {
887
- return null === O ? O = function __PRIVATE_generateInitialUniqueDebugId() {
886
+ return null === N ? N = function __PRIVATE_generateInitialUniqueDebugId() {
888
887
  return 268435456 + Math.round(2147483648 * Math.random());
889
- }() : O++, "0x" + O.toString(16);
888
+ }() : N++, "0x" + N.toString(16);
890
889
  }
891
890
 
892
891
  /**
@@ -937,7 +936,7 @@ function __PRIVATE_generateUniqueDebugId() {
937
936
  * See the License for the specific language governing permissions and
938
937
  * limitations under the License.
939
938
  */
940
- const q = {
939
+ const O = {
941
940
  BatchGetDocuments: "batchGet",
942
941
  Commit: "commit",
943
942
  RunQuery: "runQuery",
@@ -975,7 +974,7 @@ const q = {
975
974
  * are used for reverse lookups from the webchannel stream. Do NOT change the
976
975
  * names of these identifiers or change this into a const enum.
977
976
  */
978
- var B, $;
977
+ var q, B;
979
978
 
980
979
  /**
981
980
  * Converts an HTTP Status Code to the equivalent error code.
@@ -986,7 +985,7 @@ var B, $;
986
985
  */
987
986
  function __PRIVATE_mapCodeFromHttpStatus(t) {
988
987
  if (void 0 === t) return __PRIVATE_logError("RPC_ERROR", "HTTP error has no status"),
989
- T;
988
+ A;
990
989
  // The canonical error codes for Google APIs [1] specify mapping onto HTTP
991
990
  // status codes but the mapping is not bijective. In each case of ambiguity
992
991
  // this function chooses a primary error.
@@ -996,66 +995,66 @@ function __PRIVATE_mapCodeFromHttpStatus(t) {
996
995
  switch (t) {
997
996
  case 200:
998
997
  // OK
999
- return m;
998
+ return E;
1000
999
 
1001
1000
  case 400:
1002
1001
  // Bad Request
1003
- return g;
1002
+ return w;
1004
1003
 
1005
1004
  // Other possibilities based on the forward mapping
1006
1005
  // return Code.INVALID_ARGUMENT;
1007
1006
  // return Code.OUT_OF_RANGE;
1008
1007
  case 401:
1009
1008
  // Unauthorized
1010
- return y;
1009
+ return p;
1011
1010
 
1012
1011
  case 403:
1013
1012
  // Forbidden
1014
- return p;
1013
+ return V;
1015
1014
 
1016
1015
  case 404:
1017
1016
  // Not Found
1018
- return I;
1017
+ return P;
1019
1018
 
1020
1019
  case 409:
1021
1020
  // Conflict
1022
- return F;
1021
+ return g;
1023
1022
 
1024
1023
  // Other possibilities:
1025
1024
  // return Code.ALREADY_EXISTS;
1026
1025
  case 416:
1027
1026
  // Range Not Satisfiable
1028
- return v;
1027
+ return F;
1029
1028
 
1030
1029
  case 429:
1031
1030
  // Too Many Requests
1032
- return w;
1031
+ return y;
1033
1032
 
1034
1033
  case 499:
1035
1034
  // Client Closed Request
1036
- return A;
1035
+ return m;
1037
1036
 
1038
1037
  case 500:
1039
1038
  // Internal Server Error
1040
- return T;
1039
+ return A;
1041
1040
 
1042
1041
  // Other possibilities:
1043
1042
  // return Code.INTERNAL;
1044
1043
  // return Code.DATA_LOSS;
1045
1044
  case 501:
1046
1045
  // Unimplemented
1047
- return D;
1046
+ return v;
1048
1047
 
1049
1048
  case 503:
1050
1049
  // Service Unavailable
1051
- return C;
1050
+ return b;
1052
1051
 
1053
1052
  case 504:
1054
1053
  // Gateway Timeout
1055
- return P;
1054
+ return R;
1056
1055
 
1057
1056
  default:
1058
- return t >= 200 && t < 300 ? m : t >= 400 && t < 500 ? g : t >= 500 && t < 600 ? b : T;
1057
+ return t >= 200 && t < 300 ? E : t >= 400 && t < 500 ? w : t >= 500 && t < 600 ? D : A;
1059
1058
  }
1060
1059
  }
1061
1060
 
@@ -1078,13 +1077,13 @@ function __PRIVATE_mapCodeFromHttpStatus(t) {
1078
1077
  /**
1079
1078
  * A Rest-based connection that relies on the native HTTP stack
1080
1079
  * (e.g. `fetch` or a polyfill).
1081
- */ ($ = B || (B = {}))[$.OK = 0] = "OK", $[$.CANCELLED = 1] = "CANCELLED", $[$.UNKNOWN = 2] = "UNKNOWN",
1082
- $[$.INVALID_ARGUMENT = 3] = "INVALID_ARGUMENT", $[$.DEADLINE_EXCEEDED = 4] = "DEADLINE_EXCEEDED",
1083
- $[$.NOT_FOUND = 5] = "NOT_FOUND", $[$.ALREADY_EXISTS = 6] = "ALREADY_EXISTS", $[$.PERMISSION_DENIED = 7] = "PERMISSION_DENIED",
1084
- $[$.UNAUTHENTICATED = 16] = "UNAUTHENTICATED", $[$.RESOURCE_EXHAUSTED = 8] = "RESOURCE_EXHAUSTED",
1085
- $[$.FAILED_PRECONDITION = 9] = "FAILED_PRECONDITION", $[$.ABORTED = 10] = "ABORTED",
1086
- $[$.OUT_OF_RANGE = 11] = "OUT_OF_RANGE", $[$.UNIMPLEMENTED = 12] = "UNIMPLEMENTED",
1087
- $[$.INTERNAL = 13] = "INTERNAL", $[$.UNAVAILABLE = 14] = "UNAVAILABLE", $[$.DATA_LOSS = 15] = "DATA_LOSS";
1080
+ */ (B = q || (q = {}))[B.OK = 0] = "OK", B[B.CANCELLED = 1] = "CANCELLED", B[B.UNKNOWN = 2] = "UNKNOWN",
1081
+ B[B.INVALID_ARGUMENT = 3] = "INVALID_ARGUMENT", B[B.DEADLINE_EXCEEDED = 4] = "DEADLINE_EXCEEDED",
1082
+ B[B.NOT_FOUND = 5] = "NOT_FOUND", B[B.ALREADY_EXISTS = 6] = "ALREADY_EXISTS", B[B.PERMISSION_DENIED = 7] = "PERMISSION_DENIED",
1083
+ B[B.UNAUTHENTICATED = 16] = "UNAUTHENTICATED", B[B.RESOURCE_EXHAUSTED = 8] = "RESOURCE_EXHAUSTED",
1084
+ B[B.FAILED_PRECONDITION = 9] = "FAILED_PRECONDITION", B[B.ABORTED = 10] = "ABORTED",
1085
+ B[B.OUT_OF_RANGE = 11] = "OUT_OF_RANGE", B[B.UNIMPLEMENTED = 12] = "UNIMPLEMENTED",
1086
+ B[B.INTERNAL = 13] = "INTERNAL", B[B.UNAVAILABLE = 14] = "UNAVAILABLE", B[B.DATA_LOSS = 15] = "DATA_LOSS";
1088
1087
 
1089
1088
  class __PRIVATE_FetchConnection extends
1090
1089
  /**
@@ -1128,7 +1127,7 @@ class __PRIVATE_RestConnection {
1128
1127
  // SDK_VERSION is updated to different value at runtime depending on the entry point,
1129
1128
  // so we need to get its value when we need it in a function.
1130
1129
  function __PRIVATE_getGoogApiClientValue() {
1131
- return "gl-js/ fire/" + f;
1130
+ return "gl-js/ fire/" + d;
1132
1131
  }(),
1133
1132
  // Content-Type: text/plain will avoid preflight requests which might
1134
1133
  // mess with CORS and redirects by proxies. If we add custom headers
@@ -1138,7 +1137,7 @@ class __PRIVATE_RestConnection {
1138
1137
  e && e.headers.forEach(((e, r) => t[r] = e)), r && r.headers.forEach(((e, r) => t[r] = e));
1139
1138
  }
1140
1139
  I(t, e) {
1141
- const r = q[t];
1140
+ const r = O[t];
1142
1141
  return `${this.m}/v1/${e}:${r}`;
1143
1142
  }
1144
1143
  /**
@@ -1484,7 +1483,7 @@ class ByteString {
1484
1483
 
1485
1484
  ByteString.EMPTY_BYTE_STRING = new ByteString("");
1486
1485
 
1487
- const Q = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
1486
+ const $ = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
1488
1487
 
1489
1488
  /**
1490
1489
  * Converts the possible Proto values for a timestamp value into a "seconds and
@@ -1498,7 +1497,7 @@ const Q = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
1498
1497
  // (millis), so we do some custom parsing here.
1499
1498
  // Parse the nanos right out of the string.
1500
1499
  let e = 0;
1501
- const r = Q.exec(t);
1500
+ const r = $.exec(t);
1502
1501
  if (__PRIVATE_hardAssert(!!r), r[1]) {
1503
1502
  // Pad the fraction out to 9 digits (nanos).
1504
1503
  let t = r[1];
@@ -1581,11 +1580,11 @@ class Timestamp {
1581
1580
  * The fractions of a second at nanosecond resolution.*
1582
1581
  */
1583
1582
  e) {
1584
- if (this.seconds = t, this.nanoseconds = e, e < 0) throw new FirestoreError(R, "Timestamp nanoseconds out of range: " + e);
1585
- if (e >= 1e9) throw new FirestoreError(R, "Timestamp nanoseconds out of range: " + e);
1586
- if (t < -62135596800) throw new FirestoreError(R, "Timestamp seconds out of range: " + t);
1583
+ if (this.seconds = t, this.nanoseconds = e, e < 0) throw new FirestoreError(T, "Timestamp nanoseconds out of range: " + e);
1584
+ if (e >= 1e9) throw new FirestoreError(T, "Timestamp nanoseconds out of range: " + e);
1585
+ if (t < -62135596800) throw new FirestoreError(T, "Timestamp seconds out of range: " + t);
1587
1586
  // This will break in the year 10,000.
1588
- if (t >= 253402300800) throw new FirestoreError(R, "Timestamp seconds out of range: " + t);
1587
+ if (t >= 253402300800) throw new FirestoreError(T, "Timestamp seconds out of range: " + t);
1589
1588
  }
1590
1589
  /**
1591
1590
  * Creates a new timestamp with the current date, with millisecond precision.
@@ -1741,7 +1740,7 @@ class Timestamp {
1741
1740
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1742
1741
  * See the License for the specific language governing permissions and
1743
1742
  * limitations under the License.
1744
- */ const L = {
1743
+ */ const Q = {
1745
1744
  fields: {
1746
1745
  __type__: {
1747
1746
  stringValue: "__max__"
@@ -1923,9 +1922,9 @@ function __PRIVATE_valueCompare(t, e) {
1923
1922
 
1924
1923
  case 10 /* TypeOrder.ObjectValue */ :
1925
1924
  return function __PRIVATE_compareMaps(t, e) {
1926
- if (t === L && e === L) return 0;
1927
- if (t === L) return 1;
1928
- if (e === L) return -1;
1925
+ if (t === Q && e === Q) return 0;
1926
+ if (t === Q) return 1;
1927
+ if (e === Q) return -1;
1929
1928
  const r = t.fields || {}, n = Object.keys(r), i = e.fields || {}, s = Object.keys(i);
1930
1929
  // Even though MapValues are likely sorted correctly based on their insertion
1931
1930
  // order (e.g. when received from the backend), local modifications can bring
@@ -3481,13 +3480,13 @@ function toNumber(t, e) {
3481
3480
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3482
3481
  * See the License for the specific language governing permissions and
3483
3482
  * limitations under the License.
3484
- */ const M = (() => {
3483
+ */ const L = (() => {
3485
3484
  const t = {
3486
3485
  asc: "ASCENDING",
3487
3486
  desc: "DESCENDING"
3488
3487
  };
3489
3488
  return t;
3490
- })(), x = (() => {
3489
+ })(), M = (() => {
3491
3490
  const t = {
3492
3491
  "<": "LESS_THAN",
3493
3492
  "<=": "LESS_THAN_OR_EQUAL",
@@ -3501,7 +3500,7 @@ function toNumber(t, e) {
3501
3500
  "array-contains-any": "ARRAY_CONTAINS_ANY"
3502
3501
  };
3503
3502
  return t;
3504
- })(), k = (() => {
3503
+ })(), x = (() => {
3505
3504
  const t = {
3506
3505
  and: "AND",
3507
3506
  or: "OR"
@@ -3590,8 +3589,8 @@ function fromName(t, e) {
3590
3589
  const e = ResourcePath.fromString(t);
3591
3590
  return __PRIVATE_hardAssert(__PRIVATE_isValidResourceName(e)), e;
3592
3591
  }(e);
3593
- if (r.get(1) !== t.databaseId.projectId) throw new FirestoreError(R, "Tried to deserialize key from different project: " + r.get(1) + " vs " + t.databaseId.projectId);
3594
- if (r.get(3) !== t.databaseId.database) throw new FirestoreError(R, "Tried to deserialize key from different database: " + r.get(3) + " vs " + t.databaseId.database);
3592
+ if (r.get(1) !== t.databaseId.projectId) throw new FirestoreError(T, "Tried to deserialize key from different project: " + r.get(1) + " vs " + t.databaseId.projectId);
3593
+ if (r.get(3) !== t.databaseId.database) throw new FirestoreError(T, "Tried to deserialize key from different database: " + r.get(3) + " vs " + t.databaseId.database);
3595
3594
  return new DocumentKey(function __PRIVATE_extractLocalPathFromResourceName(t) {
3596
3595
  return __PRIVATE_hardAssert(t.length > 4 && "documents" === t.get(4)), t.popFirst(5);
3597
3596
  }
@@ -3725,16 +3724,16 @@ function __PRIVATE_toQueryTarget(t, e) {
3725
3724
  }
3726
3725
 
3727
3726
  function __PRIVATE_toDirection(t) {
3728
- return M[t];
3727
+ return L[t];
3729
3728
  }
3730
3729
 
3731
3730
  // visible for testing
3732
3731
  function __PRIVATE_toOperatorName(t) {
3733
- return x[t];
3732
+ return M[t];
3734
3733
  }
3735
3734
 
3736
3735
  function __PRIVATE_toCompositeOperatorName(t) {
3737
- return k[t];
3736
+ return x[t];
3738
3737
  }
3739
3738
 
3740
3739
  function __PRIVATE_toFieldPathReference(t) {
@@ -3951,18 +3950,18 @@ class __PRIVATE_DatastoreImpl extends class Datastore {} {
3951
3950
  this.serializer = n, this.Y = !1;
3952
3951
  }
3953
3952
  Z() {
3954
- if (this.Y) throw new FirestoreError(g, "The client has already been terminated.");
3953
+ if (this.Y) throw new FirestoreError(w, "The client has already been terminated.");
3955
3954
  }
3956
3955
  /** Invokes the provided RPC with auth and AppCheck tokens. */ P(t, e, r, n) {
3957
3956
  return this.Z(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([i, s]) => this.connection.P(t, __PRIVATE_toResourcePath(e, r), n, i, s))).catch((t => {
3958
- throw "FirebaseError" === t.name ? (t.code === y && (this.authCredentials.invalidateToken(),
3959
- this.appCheckCredentials.invalidateToken()), t) : new FirestoreError(T, t.toString());
3957
+ throw "FirebaseError" === t.name ? (t.code === p && (this.authCredentials.invalidateToken(),
3958
+ this.appCheckCredentials.invalidateToken()), t) : new FirestoreError(A, t.toString());
3960
3959
  }));
3961
3960
  }
3962
3961
  /** Invokes the provided RPC with streamed results with auth and AppCheck tokens. */ g(t, e, r, n, i) {
3963
3962
  return this.Z(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([s, o]) => this.connection.g(t, __PRIVATE_toResourcePath(e, r), n, s, o, i))).catch((t => {
3964
- throw "FirebaseError" === t.name ? (t.code === y && (this.authCredentials.invalidateToken(),
3965
- this.appCheckCredentials.invalidateToken()), t) : new FirestoreError(T, t.toString());
3963
+ throw "FirebaseError" === t.name ? (t.code === p && (this.authCredentials.invalidateToken(),
3964
+ this.appCheckCredentials.invalidateToken()), t) : new FirestoreError(A, t.toString());
3966
3965
  }));
3967
3966
  }
3968
3967
  terminate() {
@@ -4076,7 +4075,7 @@ async function __PRIVATE_invokeRunAggregationQueryRpc(t, e, r) {
4076
4075
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4077
4076
  * See the License for the specific language governing permissions and
4078
4077
  * limitations under the License.
4079
- */ const U = new Map;
4078
+ */ const k = new Map;
4080
4079
 
4081
4080
  /**
4082
4081
  * An instance map that ensures only one Datastore exists per Firestore
@@ -4088,8 +4087,8 @@ async function __PRIVATE_invokeRunAggregationQueryRpc(t, e, r) {
4088
4087
  * instance is terminated.
4089
4088
  */
4090
4089
  function __PRIVATE_getDatastore(t) {
4091
- if (t._terminated) throw new FirestoreError(g, "The client has already been terminated.");
4092
- if (!U.has(t)) {
4090
+ if (t._terminated) throw new FirestoreError(w, "The client has already been terminated.");
4091
+ if (!k.has(t)) {
4093
4092
  __PRIVATE_logDebug("ComponentProvider", "Initializing Datastore");
4094
4093
  const e = function __PRIVATE_newConnection(t) {
4095
4094
  return new __PRIVATE_FetchConnection(t, fetch.bind(null));
@@ -4114,9 +4113,9 @@ function __PRIVATE_getDatastore(t) {
4114
4113
  */ (t._databaseId, t.app.options.appId || "", t._persistenceKey, t._freezeSettings())), r = __PRIVATE_newSerializer(t._databaseId), n = function __PRIVATE_newDatastore(t, e, r, n) {
4115
4114
  return new __PRIVATE_DatastoreImpl(t, e, r, n);
4116
4115
  }(t._authCredentials, t._appCheckCredentials, e, r);
4117
- U.set(t, n);
4116
+ k.set(t, n);
4118
4117
  }
4119
- return U.get(t);
4118
+ return k.get(t);
4120
4119
  }
4121
4120
 
4122
4121
  /**
@@ -4132,16 +4131,16 @@ class FirestoreSettingsImpl {
4132
4131
  constructor(t) {
4133
4132
  var e, r;
4134
4133
  if (void 0 === t.host) {
4135
- if (void 0 !== t.ssl) throw new FirestoreError(R, "Can't provide ssl option if host option is not set");
4134
+ if (void 0 !== t.ssl) throw new FirestoreError(T, "Can't provide ssl option if host option is not set");
4136
4135
  this.host = "firestore.googleapis.com", this.ssl = true;
4137
4136
  } else this.host = t.host, this.ssl = null === (e = t.ssl) || void 0 === e || e;
4138
4137
  if (this.credentials = t.credentials, this.ignoreUndefinedProperties = !!t.ignoreUndefinedProperties,
4139
4138
  this.localCache = t.localCache, void 0 === t.cacheSizeBytes) this.cacheSizeBytes = 41943040; else {
4140
- if (-1 !== t.cacheSizeBytes && t.cacheSizeBytes < 1048576) throw new FirestoreError(R, "cacheSizeBytes must be at least 1048576");
4139
+ if (-1 !== t.cacheSizeBytes && t.cacheSizeBytes < 1048576) throw new FirestoreError(T, "cacheSizeBytes must be at least 1048576");
4141
4140
  this.cacheSizeBytes = t.cacheSizeBytes;
4142
4141
  }
4143
4142
  !function __PRIVATE_validateIsNotUsedTogether(t, e, r, n) {
4144
- if (!0 === e && !0 === n) throw new FirestoreError(R, `${t} and ${r} cannot be used together.`);
4143
+ if (!0 === e && !0 === n) throw new FirestoreError(T, `${t} and ${r} cannot be used together.`);
4145
4144
  }("experimentalForceLongPolling", t.experimentalForceLongPolling, "experimentalAutoDetectLongPolling", t.experimentalAutoDetectLongPolling),
4146
4145
  this.experimentalForceLongPolling = !!t.experimentalForceLongPolling, this.experimentalForceLongPolling ? this.experimentalAutoDetectLongPolling = !1 : void 0 === t.experimentalAutoDetectLongPolling ? this.experimentalAutoDetectLongPolling = true :
4147
4146
  // For backwards compatibility, coerce the value to boolean even though
@@ -4151,9 +4150,9 @@ class FirestoreSettingsImpl {
4151
4150
  this.experimentalLongPollingOptions = __PRIVATE_cloneLongPollingOptions(null !== (r = t.experimentalLongPollingOptions) && void 0 !== r ? r : {}),
4152
4151
  function __PRIVATE_validateLongPollingOptions(t) {
4153
4152
  if (void 0 !== t.timeoutSeconds) {
4154
- if (isNaN(t.timeoutSeconds)) throw new FirestoreError(R, `invalid long polling timeout: ${t.timeoutSeconds} (must not be NaN)`);
4155
- if (t.timeoutSeconds < 5) throw new FirestoreError(R, `invalid long polling timeout: ${t.timeoutSeconds} (minimum allowed value is 5)`);
4156
- if (t.timeoutSeconds > 30) throw new FirestoreError(R, `invalid long polling timeout: ${t.timeoutSeconds} (maximum allowed value is 30)`);
4153
+ if (isNaN(t.timeoutSeconds)) throw new FirestoreError(T, `invalid long polling timeout: ${t.timeoutSeconds} (must not be NaN)`);
4154
+ if (t.timeoutSeconds < 5) throw new FirestoreError(T, `invalid long polling timeout: ${t.timeoutSeconds} (minimum allowed value is 5)`);
4155
+ if (t.timeoutSeconds > 30) throw new FirestoreError(T, `invalid long polling timeout: ${t.timeoutSeconds} (maximum allowed value is 30)`);
4157
4156
  }
4158
4157
  }
4159
4158
  /**
@@ -4200,7 +4199,7 @@ class Firestore {
4200
4199
  * The {@link @firebase/app#FirebaseApp} associated with this `Firestore` service
4201
4200
  * instance.
4202
4201
  */ get app() {
4203
- if (!this._app) throw new FirestoreError(g, "Firestore was not initialized using the Firebase SDK. 'app' is not available");
4202
+ if (!this._app) throw new FirestoreError(w, "Firestore was not initialized using the Firebase SDK. 'app' is not available");
4204
4203
  return this._app;
4205
4204
  }
4206
4205
  get _initialized() {
@@ -4210,7 +4209,7 @@ class Firestore {
4210
4209
  return void 0 !== this._terminateTask;
4211
4210
  }
4212
4211
  _setSettings(t) {
4213
- if (this._settingsFrozen) throw new FirestoreError(g, "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.");
4212
+ if (this._settingsFrozen) throw new FirestoreError(w, "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.");
4214
4213
  this._settings = new FirestoreSettingsImpl(t), void 0 !== t.credentials && (this._authCredentials = function __PRIVATE_makeAuthCredentialsProvider(t) {
4215
4214
  if (!t) return new __PRIVATE_EmptyAuthCredentialsProvider;
4216
4215
  switch (t.type) {
@@ -4221,7 +4220,7 @@ class Firestore {
4221
4220
  return t.client;
4222
4221
 
4223
4222
  default:
4224
- throw new FirestoreError(R, "makeAuthCredentialsProvider failed due to invalid credential type");
4223
+ throw new FirestoreError(T, "makeAuthCredentialsProvider failed due to invalid credential type");
4225
4224
  }
4226
4225
  }(t.credentials));
4227
4226
  }
@@ -4249,8 +4248,8 @@ class Firestore {
4249
4248
  * Only ever called once.
4250
4249
  */ _terminate() {
4251
4250
  return function __PRIVATE_removeComponents(t) {
4252
- const e = U.get(t);
4253
- e && (__PRIVATE_logDebug("ComponentProvider", "Removing Datastore"), U.delete(t),
4251
+ const e = k.get(t);
4252
+ e && (__PRIVATE_logDebug("ComponentProvider", "Removing Datastore"), k.delete(t),
4254
4253
  e.terminate());
4255
4254
  }(this), Promise.resolve();
4256
4255
  }
@@ -4259,7 +4258,7 @@ class Firestore {
4259
4258
  function initializeFirestore(t, e, r) {
4260
4259
  r || (r = "(default)");
4261
4260
  const n = _getProvider(t, "firestore/lite");
4262
- if (n.isInitialized(r)) throw new FirestoreError(g, "Firestore can only be initialized once per app.");
4261
+ if (n.isInitialized(r)) throw new FirestoreError(w, "Firestore can only be initialized once per app.");
4263
4262
  return n.initialize({
4264
4263
  options: e,
4265
4264
  instanceIdentifier: r
@@ -4303,7 +4302,7 @@ function getFirestore(e, r) {
4303
4302
  // invalid field "uid" and missing field "sub" / "user_id".)
4304
4303
  e = createMockUserToken(n.mockUserToken, null === (i = t._app) || void 0 === i ? void 0 : i.options.projectId);
4305
4304
  const s = n.mockUserToken.sub || n.mockUserToken.user_id;
4306
- if (!s) throw new FirestoreError(R, "mockUserToken must contain 'sub' or 'user_id' field!");
4305
+ if (!s) throw new FirestoreError(T, "mockUserToken must contain 'sub' or 'user_id' field!");
4307
4306
  r = new User(s);
4308
4307
  }
4309
4308
  t._authCredentials = new __PRIVATE_EmulatorAuthCredentialsProvider(new __PRIVATE_OAuthToken(e, r));
@@ -4522,7 +4521,7 @@ function collection(t, e, ...r) {
4522
4521
  return __PRIVATE_validateCollectionPath(n), new CollectionReference(t, /* converter= */ null, n);
4523
4522
  }
4524
4523
  {
4525
- if (!(t instanceof DocumentReference || t instanceof CollectionReference)) throw new FirestoreError(R, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
4524
+ if (!(t instanceof DocumentReference || t instanceof CollectionReference)) throw new FirestoreError(T, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
4526
4525
  const n = t._path.child(ResourcePath.fromString(e, ...r));
4527
4526
  return __PRIVATE_validateCollectionPath(n), new CollectionReference(t.firestore,
4528
4527
  /* converter= */ null, n);
@@ -4543,7 +4542,7 @@ function collection(t, e, ...r) {
4543
4542
  * @returns The created `Query`.
4544
4543
  */ function collectionGroup(t, e) {
4545
4544
  if (t = __PRIVATE_cast(t, Firestore), __PRIVATE_validateNonEmptyArgument("collectionGroup", "collection id", e),
4546
- e.indexOf("/") >= 0) throw new FirestoreError(R, `Invalid collection ID '${e}' passed to function collectionGroup(). Collection IDs must not contain '/'.`);
4545
+ e.indexOf("/") >= 0) throw new FirestoreError(T, `Invalid collection ID '${e}' passed to function collectionGroup(). Collection IDs must not contain '/'.`);
4547
4546
  return new Query(t,
4548
4547
  /* converter= */ null, function __PRIVATE_newQueryForCollectionGroup(t) {
4549
4548
  return new __PRIVATE_QueryImpl(ResourcePath.emptyPath(), t);
@@ -4561,7 +4560,7 @@ function doc(t, e, ...r) {
4561
4560
  /* converter= */ null, new DocumentKey(n));
4562
4561
  }
4563
4562
  {
4564
- if (!(t instanceof DocumentReference || t instanceof CollectionReference)) throw new FirestoreError(R, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
4563
+ if (!(t instanceof DocumentReference || t instanceof CollectionReference)) throw new FirestoreError(T, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
4565
4564
  const n = t._path.child(ResourcePath.fromString(e, ...r));
4566
4565
  return __PRIVATE_validateDocumentPath(n), new DocumentReference(t.firestore, t instanceof CollectionReference ? t.converter : null, new DocumentKey(n));
4567
4566
  }
@@ -4622,7 +4621,7 @@ function doc(t, e, ...r) {
4622
4621
  try {
4623
4622
  return new Bytes(ByteString.fromBase64String(t));
4624
4623
  } catch (t) {
4625
- throw new FirestoreError(R, "Failed to construct data from Base64 string: " + t);
4624
+ throw new FirestoreError(T, "Failed to construct data from Base64 string: " + t);
4626
4625
  }
4627
4626
  }
4628
4627
  /**
@@ -4694,7 +4693,7 @@ function doc(t, e, ...r) {
4694
4693
  * @param fieldNames - A list of field names.
4695
4694
  */
4696
4695
  constructor(...t) {
4697
- for (let e = 0; e < t.length; ++e) if (0 === t[e].length) throw new FirestoreError(R, "Invalid field name at argument $(i + 1). Field names must not be empty.");
4696
+ for (let e = 0; e < t.length; ++e) if (0 === t[e].length) throw new FirestoreError(T, "Invalid field name at argument $(i + 1). Field names must not be empty.");
4698
4697
  this._internalPath = new FieldPath$1(t);
4699
4698
  }
4700
4699
  /**
@@ -4773,8 +4772,8 @@ function doc(t, e, ...r) {
4773
4772
  * @param longitude - The longitude as number between -180 and 180.
4774
4773
  */
4775
4774
  constructor(t, e) {
4776
- if (!isFinite(t) || t < -90 || t > 90) throw new FirestoreError(R, "Latitude must be a number between -90 and 90, but was: " + t);
4777
- if (!isFinite(e) || e < -180 || e > 180) throw new FirestoreError(R, "Longitude must be a number between -180 and 180, but was: " + e);
4775
+ if (!isFinite(t) || t < -90 || t > 90) throw new FirestoreError(T, "Latitude must be a number between -90 and 90, but was: " + t);
4776
+ if (!isFinite(e) || e < -180 || e > 180) throw new FirestoreError(T, "Longitude must be a number between -180 and 180, but was: " + e);
4778
4777
  this._lat = t, this._long = e;
4779
4778
  }
4780
4779
  /**
@@ -4824,7 +4823,7 @@ function doc(t, e, ...r) {
4824
4823
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4825
4824
  * See the License for the specific language governing permissions and
4826
4825
  * limitations under the License.
4827
- */ const j = /^__.*__$/;
4826
+ */ const U = /^__.*__$/;
4828
4827
 
4829
4828
  /** The result of parsing document data (e.g. for a setData call). */ class ParsedSetData {
4830
4829
  constructor(t, e, r) {
@@ -4935,7 +4934,7 @@ function __PRIVATE_isWrite(t) {
4935
4934
  }
4936
4935
  st(t) {
4937
4936
  if (0 === t.length) throw this._t("Document fields must not be empty");
4938
- if (__PRIVATE_isWrite(this.et) && j.test(t)) throw this._t('Document fields cannot begin and end with "__"');
4937
+ if (__PRIVATE_isWrite(this.et) && U.test(t)) throw this._t('Document fields cannot begin and end with "__"');
4939
4938
  }
4940
4939
  }
4941
4940
 
@@ -4972,7 +4971,7 @@ function __PRIVATE_newUserDataReader(t) {
4972
4971
  const t = [];
4973
4972
  for (const n of s.mergeFields) {
4974
4973
  const i = __PRIVATE_fieldPathFromArgument$1(e, n, r);
4975
- if (!o.contains(i)) throw new FirestoreError(R, `Field '${i}' is specified in your field mask but missing from your input data.`);
4974
+ if (!o.contains(i)) throw new FirestoreError(T, `Field '${i}' is specified in your field mask but missing from your input data.`);
4976
4975
  __PRIVATE_fieldMaskContains(t, i) || t.push(i);
4977
4976
  }
4978
4977
  u = new FieldMask(t), _ = o.fieldTransforms.filter((t => u.covers(t.field)));
@@ -5089,7 +5088,7 @@ class __PRIVATE_NumericIncrementFieldValueImpl extends FieldValue {
5089
5088
 
5090
5089
  /** Parse update data from a list of field/value arguments. */ function __PRIVATE_parseUpdateVarargs(t, e, r, n, i, s) {
5091
5090
  const o = t.ht(1 /* UserDataSource.Update */ , e, r), a = [ __PRIVATE_fieldPathFromArgument$1(e, n, r) ], u = [ i ];
5092
- if (s.length % 2 != 0) throw new FirestoreError(R, `Function ${e}() needs to be called with an even number of arguments that alternate between field names and values.`);
5091
+ if (s.length % 2 != 0) throw new FirestoreError(T, `Function ${e}() needs to be called with an even number of arguments that alternate between field names and values.`);
5093
5092
  for (let t = 0; t < s.length; t += 2) a.push(__PRIVATE_fieldPathFromArgument$1(e, s[t])),
5094
5093
  u.push(s[t + 1]);
5095
5094
  const _ = [], c = ObjectValue.empty();
@@ -5293,7 +5292,7 @@ function __PRIVATE_validatePlainObject(t, e, r) {
5293
5292
 
5294
5293
  /**
5295
5294
  * Matches any characters in a field path string that are reserved.
5296
- */ const z = new RegExp("[~\\*/\\[\\]]");
5295
+ */ const j = new RegExp("[~\\*/\\[\\]]");
5297
5296
 
5298
5297
  /**
5299
5298
  * Wraps fromDotSeparatedString with an error message about the method that
@@ -5304,7 +5303,7 @@ function __PRIVATE_validatePlainObject(t, e, r) {
5304
5303
  * @param targetDoc - The document against which the field path will be
5305
5304
  * evaluated.
5306
5305
  */ function __PRIVATE_fieldPathFromDotSeparatedString(t, e, r) {
5307
- if (e.search(z) >= 0) throw __PRIVATE_createError(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`, t,
5306
+ if (e.search(j) >= 0) throw __PRIVATE_createError(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`, t,
5308
5307
  /* hasConverter= */ !1,
5309
5308
  /* path= */ void 0, r);
5310
5309
  try {
@@ -5322,7 +5321,7 @@ function __PRIVATE_createError(t, e, r, n, i) {
5322
5321
  r && (a += " (via `toFirestore()`)"), a += ". ";
5323
5322
  let u = "";
5324
5323
  return (s || o) && (u += " (found", s && (u += ` in field ${n}`), o && (u += ` in document ${i}`),
5325
- u += ")"), new FirestoreError(R, a + t + u);
5324
+ u += ")"), new FirestoreError(T, a + t + u);
5326
5325
  }
5327
5326
 
5328
5327
  /** Checks `haystack` if FieldPath `needle` is present. Runs in O(n). */ function __PRIVATE_fieldMaskContains(t, e) {
@@ -5519,7 +5518,7 @@ function query(t, e, ...r) {
5519
5518
  let n = [];
5520
5519
  e instanceof AppliableConstraint && n.push(e), n = n.concat(r), function __PRIVATE_validateQueryConstraintArray(t) {
5521
5520
  const e = t.filter((t => t instanceof QueryCompositeFilterConstraint)).length, r = t.filter((t => t instanceof QueryFieldFilterConstraint)).length;
5522
- if (e > 1 || e > 0 && r > 0) throw new FirestoreError(R, "InvalidQuery. When using composite filters, you cannot use more than one filter at the top level. Consider nesting the multiple filters within an `and(...)` statement. For example: change `query(query, where(...), or(...))` to `query(query, and(where(...), or(...)))`.");
5521
+ if (e > 1 || e > 0 && r > 0) throw new FirestoreError(T, "InvalidQuery. When using composite filters, you cannot use more than one filter at the top level. Consider nesting the multiple filters within an `and(...)` statement. For example: change `query(query, where(...), or(...))` to `query(query, and(where(...), or(...)))`.");
5523
5522
  }
5524
5523
  /**
5525
5524
  * @license
@@ -5573,7 +5572,7 @@ function query(t, e, ...r) {
5573
5572
  const e = __PRIVATE_newUserDataReader(t.firestore), r = function __PRIVATE_newQueryFilter(t, e, r, n, i, s, o) {
5574
5573
  let a;
5575
5574
  if (i.isKeyField()) {
5576
- if ("array-contains" /* Operator.ARRAY_CONTAINS */ === s || "array-contains-any" /* Operator.ARRAY_CONTAINS_ANY */ === s) throw new FirestoreError(R, `Invalid Query. You can't perform '${s}' queries on documentId().`);
5575
+ if ("array-contains" /* Operator.ARRAY_CONTAINS */ === s || "array-contains-any" /* Operator.ARRAY_CONTAINS_ANY */ === s) throw new FirestoreError(T, `Invalid Query. You can't perform '${s}' queries on documentId().`);
5577
5576
  if ("in" /* Operator.IN */ === s || "not-in" /* Operator.NOT_IN */ === s) {
5578
5577
  __PRIVATE_validateDisjunctiveFilterElements(o, s);
5579
5578
  const e = [];
@@ -5700,8 +5699,8 @@ function query(t, e, ...r) {
5700
5699
  }
5701
5700
  _apply(t) {
5702
5701
  const e = function __PRIVATE_newQueryOrderBy(t, e, r) {
5703
- if (null !== t.startAt) throw new FirestoreError(R, "Invalid query. You must not call startAt() or startAfter() before calling orderBy().");
5704
- if (null !== t.endAt) throw new FirestoreError(R, "Invalid query. You must not call endAt() or endBefore() before calling orderBy().");
5702
+ if (null !== t.startAt) throw new FirestoreError(T, "Invalid query. You must not call startAt() or startAfter() before calling orderBy().");
5703
+ if (null !== t.endAt) throw new FirestoreError(T, "Invalid query. You must not call endAt() or endBefore() before calling orderBy().");
5705
5704
  return new OrderBy(e, r);
5706
5705
  }
5707
5706
  /**
@@ -5861,7 +5860,7 @@ function endAt(...t) {
5861
5860
 
5862
5861
  /** Helper function to create a bound from a document or fields */ function __PRIVATE_newQueryBoundFromDocOrFields(t, e, r, n) {
5863
5862
  if (r[0] = getModularInstance(r[0]), r[0] instanceof DocumentSnapshot) return function __PRIVATE_newQueryBoundFromDocument(t, e, r, n, i) {
5864
- if (!n) throw new FirestoreError(I, `Can't use a DocumentSnapshot that doesn't exist for ${r}().`);
5863
+ if (!n) throw new FirestoreError(P, `Can't use a DocumentSnapshot that doesn't exist for ${r}().`);
5865
5864
  const s = [];
5866
5865
  // Because people expect to continue/end a query at the exact document
5867
5866
  // provided, we need to use the implicit sort order rather than the explicit
@@ -5872,10 +5871,10 @@ function endAt(...t) {
5872
5871
  // results.
5873
5872
  for (const r of __PRIVATE_queryNormalizedOrderBy(t)) if (r.field.isKeyField()) s.push(__PRIVATE_refValue(e, n.key)); else {
5874
5873
  const t = n.data.field(r.field);
5875
- if (__PRIVATE_isServerTimestamp(t)) throw new FirestoreError(R, 'Invalid query. You are trying to start or end a query using a document for which the field "' + r.field + '" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');
5874
+ if (__PRIVATE_isServerTimestamp(t)) throw new FirestoreError(T, 'Invalid query. You are trying to start or end a query using a document for which the field "' + r.field + '" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');
5876
5875
  if (null === t) {
5877
5876
  const t = r.field.canonicalString();
5878
- throw new FirestoreError(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.`);
5877
+ throw new FirestoreError(T, `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.`);
5879
5878
  }
5880
5879
  s.push(t);
5881
5880
  }
@@ -5889,15 +5888,15 @@ function endAt(...t) {
5889
5888
  return function __PRIVATE_newQueryBoundFromFields(t, e, r, n, i, s) {
5890
5889
  // Use explicit order by's because it has to match the query the user made
5891
5890
  const o = t.explicitOrderBy;
5892
- if (i.length > o.length) throw new FirestoreError(R, `Too many arguments provided to ${n}(). The number of arguments must be less than or equal to the number of orderBy() clauses`);
5891
+ if (i.length > o.length) throw new FirestoreError(T, `Too many arguments provided to ${n}(). The number of arguments must be less than or equal to the number of orderBy() clauses`);
5893
5892
  const a = [];
5894
5893
  for (let s = 0; s < i.length; s++) {
5895
5894
  const u = i[s];
5896
5895
  if (o[s].field.isKeyField()) {
5897
- if ("string" != typeof u) throw new FirestoreError(R, `Invalid query. Expected a string for document ID in ${n}(), but got a ${typeof u}`);
5898
- if (!__PRIVATE_isCollectionGroupQuery(t) && -1 !== u.indexOf("/")) throw new FirestoreError(R, `Invalid query. When querying a collection and ordering by documentId(), the value passed to ${n}() must be a plain document ID, but '${u}' contains a slash.`);
5896
+ if ("string" != typeof u) throw new FirestoreError(T, `Invalid query. Expected a string for document ID in ${n}(), but got a ${typeof u}`);
5897
+ if (!__PRIVATE_isCollectionGroupQuery(t) && -1 !== u.indexOf("/")) throw new FirestoreError(T, `Invalid query. When querying a collection and ordering by documentId(), the value passed to ${n}() must be a plain document ID, but '${u}' contains a slash.`);
5899
5898
  const r = t.path.child(ResourcePath.fromString(u));
5900
- if (!DocumentKey.isDocumentKey(r)) throw new FirestoreError(R, `Invalid query. When querying a collection group and ordering by documentId(), the value passed to ${n}() must result in a valid document path, but '${r}' is not because it contains an odd number of segments.`);
5899
+ if (!DocumentKey.isDocumentKey(r)) throw new FirestoreError(T, `Invalid query. When querying a collection group and ordering by documentId(), the value passed to ${n}() must result in a valid document path, but '${r}' is not because it contains an odd number of segments.`);
5901
5900
  const i = new DocumentKey(r);
5902
5901
  a.push(__PRIVATE_refValue(e, i));
5903
5902
  } else {
@@ -5917,21 +5916,21 @@ function endAt(...t) {
5917
5916
 
5918
5917
  function __PRIVATE_parseDocumentIdValue(t, e, r) {
5919
5918
  if ("string" == typeof (r = getModularInstance(r))) {
5920
- if ("" === r) throw new FirestoreError(R, "Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");
5921
- if (!__PRIVATE_isCollectionGroupQuery(e) && -1 !== r.indexOf("/")) throw new FirestoreError(R, `Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '${r}' contains a '/' character.`);
5919
+ if ("" === r) throw new FirestoreError(T, "Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");
5920
+ if (!__PRIVATE_isCollectionGroupQuery(e) && -1 !== r.indexOf("/")) throw new FirestoreError(T, `Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '${r}' contains a '/' character.`);
5922
5921
  const n = e.path.child(ResourcePath.fromString(r));
5923
- if (!DocumentKey.isDocumentKey(n)) throw new FirestoreError(R, `Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '${n}' is not because it has an odd number of segments (${n.length}).`);
5922
+ if (!DocumentKey.isDocumentKey(n)) throw new FirestoreError(T, `Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '${n}' is not because it has an odd number of segments (${n.length}).`);
5924
5923
  return __PRIVATE_refValue(t, new DocumentKey(n));
5925
5924
  }
5926
5925
  if (r instanceof DocumentReference) return __PRIVATE_refValue(t, r._key);
5927
- throw new FirestoreError(R, `Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${__PRIVATE_valueDescription(r)}.`);
5926
+ throw new FirestoreError(T, `Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${__PRIVATE_valueDescription(r)}.`);
5928
5927
  }
5929
5928
 
5930
5929
  /**
5931
5930
  * Validates that the value passed into a disjunctive filter satisfies all
5932
5931
  * array requirements.
5933
5932
  */ function __PRIVATE_validateDisjunctiveFilterElements(t, e) {
5934
- if (!Array.isArray(t) || 0 === t.length) throw new FirestoreError(R, `Invalid Query. A non-empty array is required for '${e.toString()}' filters.`);
5933
+ if (!Array.isArray(t) || 0 === t.length) throw new FirestoreError(T, `Invalid Query. A non-empty array is required for '${e.toString()}' filters.`);
5935
5934
  }
5936
5935
 
5937
5936
  /**
@@ -5965,11 +5964,11 @@ function __PRIVATE_parseDocumentIdValue(t, e, r) {
5965
5964
  }(e.op));
5966
5965
  if (null !== r)
5967
5966
  // Special case when it's a duplicate op to give a slightly clearer error message.
5968
- throw r === e.op ? new FirestoreError(R, `Invalid query. You cannot use more than one '${e.op.toString()}' filter.`) : new FirestoreError(R, `Invalid query. You cannot use '${e.op.toString()}' filters with '${r.toString()}' filters.`);
5967
+ throw r === e.op ? new FirestoreError(T, `Invalid query. You cannot use more than one '${e.op.toString()}' filter.`) : new FirestoreError(T, `Invalid query. You cannot use '${e.op.toString()}' filters with '${r.toString()}' filters.`);
5969
5968
  }
5970
5969
 
5971
5970
  function __PRIVATE_validateQueryFilterConstraint(t, e) {
5972
- if (!(e instanceof QueryFieldFilterConstraint || e instanceof QueryCompositeFilterConstraint)) throw new FirestoreError(R, `Function ${t}() requires AppliableConstraints created with a call to 'where(...)', 'or(...)', or 'and(...)'.`);
5971
+ if (!(e instanceof QueryFieldFilterConstraint || e instanceof QueryCompositeFilterConstraint)) throw new FirestoreError(T, `Function ${t}() requires AppliableConstraints created with a call to 'where(...)', 'or(...)', or 'and(...)'.`);
5973
5972
  }
5974
5973
 
5975
5974
  /**
@@ -6136,7 +6135,7 @@ class __PRIVATE_LiteUserDataWriter extends class AbstractUserDataWriter {
6136
6135
  * @returns A Promise that will be resolved with the results of the query.
6137
6136
  */ function getDocs(t) {
6138
6137
  (function __PRIVATE_validateHasExplicitOrderByForLimitToLast(t) {
6139
- if ("L" /* LimitType.Last */ === t.limitType && 0 === t.explicitOrderBy.length) throw new FirestoreError(D, "limitToLast() queries require specifying at least one orderBy() clause");
6138
+ if ("L" /* LimitType.Last */ === t.limitType && 0 === t.explicitOrderBy.length) throw new FirestoreError(v, "limitToLast() queries require specifying at least one orderBy() clause");
6140
6139
  })((t = __PRIVATE_cast(t, Query))._query);
6141
6140
  const e = __PRIVATE_getDatastore(t.firestore), r = new __PRIVATE_LiteUserDataWriter(t.firestore);
6142
6141
  return __PRIVATE_invokeRunQueryRpc(e, t._query).then((e => {
@@ -6473,12 +6472,12 @@ function sum(t) {
6473
6472
  return this._verifyNotCommitted(), this._committed = !0, this._mutations.length > 0 ? this._commitHandler(this._mutations) : Promise.resolve();
6474
6473
  }
6475
6474
  _verifyNotCommitted() {
6476
- if (this._committed) throw new FirestoreError(g, "A write batch can no longer be used after commit() has been called.");
6475
+ if (this._committed) throw new FirestoreError(w, "A write batch can no longer be used after commit() has been called.");
6477
6476
  }
6478
6477
  }
6479
6478
 
6480
6479
  function __PRIVATE_validateReference(t, e) {
6481
- if ((t = getModularInstance(t)).firestore !== e) throw new FirestoreError(R, "Provided document reference is from a different Firestore instance.");
6480
+ if ((t = getModularInstance(t)).firestore !== e) throw new FirestoreError(T, "Provided document reference is from a different Firestore instance.");
6482
6481
  return t;
6483
6482
  }
6484
6483
 
@@ -6537,7 +6536,7 @@ function __PRIVATE_validateReference(t, e) {
6537
6536
  this.writtenDocs = new Set;
6538
6537
  }
6539
6538
  async lookup(t) {
6540
- if (this.ensureCommitNotCalled(), this.mutations.length > 0) throw this.lastTransactionError = new FirestoreError(R, "Firestore transactions require all reads to be executed before all writes."),
6539
+ if (this.ensureCommitNotCalled(), this.mutations.length > 0) throw this.lastTransactionError = new FirestoreError(T, "Firestore transactions require all reads to be executed before all writes."),
6541
6540
  this.lastTransactionError;
6542
6541
  const e = await __PRIVATE_invokeBatchGetDocumentsRpc(this.datastore, t);
6543
6542
  return e.forEach((t => this.recordVersion(t))), e;
@@ -6581,7 +6580,7 @@ function __PRIVATE_validateReference(t, e) {
6581
6580
  if (r) {
6582
6581
  if (!e.isEqual(r))
6583
6582
  // This transaction will fail no matter what.
6584
- throw new FirestoreError(F, "Document version changed between two reads.");
6583
+ throw new FirestoreError(g, "Document version changed between two reads.");
6585
6584
  } else this.readVersions.set(t.key.toString(), e);
6586
6585
  }
6587
6586
  /**
@@ -6608,7 +6607,7 @@ function __PRIVATE_validateReference(t, e) {
6608
6607
  // express that to the backend, we have to validate locally.
6609
6608
  // Note: this can change once we can send separate verify writes in the
6610
6609
  // transaction.
6611
- throw new FirestoreError(R, "Can't update a document that doesn't exist.");
6610
+ throw new FirestoreError(T, "Can't update a document that doesn't exist.");
6612
6611
  // Document exists, base precondition on document update time.
6613
6612
  return Precondition.updateTime(e);
6614
6613
  }
@@ -6637,7 +6636,7 @@ function __PRIVATE_validateReference(t, e) {
6637
6636
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
6638
6637
  * See the License for the specific language governing permissions and
6639
6638
  * limitations under the License.
6640
- */ const W = {
6639
+ */ const z = {
6641
6640
  maxAttempts: 5
6642
6641
  };
6643
6642
 
@@ -6714,29 +6713,29 @@ class __PRIVATE_TransactionRunner {
6714
6713
  default:
6715
6714
  return fail();
6716
6715
 
6716
+ case m:
6717
6717
  case A:
6718
- case T:
6719
- case P:
6720
- case w:
6718
+ case R:
6719
+ case y:
6720
+ case D:
6721
6721
  case b:
6722
- case C:
6723
6722
  // Unauthenticated means something went wrong with our token and we need
6724
6723
  // to retry with new credentials which will happen automatically.
6725
- case y:
6724
+ case p:
6726
6725
  return !1;
6727
6726
 
6728
- case R:
6727
+ case T:
6728
+ case P:
6729
6729
  case I:
6730
6730
  case V:
6731
- case p:
6732
- case g:
6731
+ case w:
6733
6732
  // Aborted might be retried in some scenarios, but that is dependant on
6734
6733
  // the context and should handled individually by the calling code.
6735
6734
  // See https://cloud.google.com/apis/design/errors.
6736
- case F:
6735
+ case g:
6736
+ case F:
6737
6737
  case v:
6738
- case D:
6739
- case S:
6738
+ case C:
6740
6739
  return !0;
6741
6740
  }
6742
6741
  }(e);
@@ -6841,7 +6840,7 @@ class __PRIVATE_TransactionRunner {
6841
6840
  * As long as the operation has not yet been run, calling cancel() provides a
6842
6841
  * guarantee that the operation will not be run.
6843
6842
  */ cancel(t) {
6844
- null !== this.timerHandle && (this.clearTimeout(), this.deferred.reject(new FirestoreError(A, "Operation cancelled" + (t ? ": " + t : ""))));
6843
+ null !== this.timerHandle && (this.clearTimeout(), this.deferred.reject(new FirestoreError(m, "Operation cancelled" + (t ? ": " + t : ""))));
6845
6844
  }
6846
6845
  handleDelayElapsed() {
6847
6846
  this.asyncQueue.enqueueAndForget((() => null !== this.timerHandle ? (this.clearTimeout(),
@@ -7169,9 +7168,9 @@ class Transaction {
7169
7168
  * `updateFunction `is returned here. Otherwise, if the transaction failed, a
7170
7169
  * rejected promise with the corresponding failure error is returned.
7171
7170
  */ function runTransaction(t, e, r) {
7172
- const n = __PRIVATE_getDatastore(t = __PRIVATE_cast(t, Firestore)), i = Object.assign(Object.assign({}, W), r);
7171
+ const n = __PRIVATE_getDatastore(t = __PRIVATE_cast(t, Firestore)), i = Object.assign(Object.assign({}, z), r);
7173
7172
  !function __PRIVATE_validateTransactionOptions(t) {
7174
- if (t.maxAttempts < 1) throw new FirestoreError(R, "Max attempts must be at least 1");
7173
+ if (t.maxAttempts < 1) throw new FirestoreError(T, "Max attempts must be at least 1");
7175
7174
  }(i);
7176
7175
  const s = new __PRIVATE_Deferred;
7177
7176
  return new __PRIVATE_TransactionRunner(function __PRIVATE_newAsyncQueue() {
@@ -7188,10 +7187,10 @@ class Transaction {
7188
7187
  * @packageDocumentation
7189
7188
  */ !function __PRIVATE_registerFirestore() {
7190
7189
  !function __PRIVATE_setSDKVersion(t) {
7191
- f = t;
7190
+ d = t;
7192
7191
  }(`${SDK_VERSION}_lite`), _registerComponent(new Component("firestore/lite", ((t, {instanceIdentifier: e, options: r}) => {
7193
7192
  const n = t.getProvider("app").getImmediate(), i = new Firestore(new __PRIVATE_LiteAuthCredentialsProvider(t.getProvider("auth-internal")), new __PRIVATE_LiteAppCheckTokenProvider(t.getProvider("app-check-internal")), function __PRIVATE_databaseIdFromApp(t, e) {
7194
- if (!Object.prototype.hasOwnProperty.apply(t.options, [ "projectId" ])) throw new FirestoreError(R, '"projectId" not provided in firebase.initializeApp.');
7193
+ if (!Object.prototype.hasOwnProperty.apply(t.options, [ "projectId" ])) throw new FirestoreError(T, '"projectId" not provided in firebase.initializeApp.');
7195
7194
  return new DatabaseId(t.options.projectId, e);
7196
7195
  }
7197
7196
  /**
@@ -7213,7 +7212,7 @@ class Transaction {
7213
7212
  return r && i._setSettings(r), i;
7214
7213
  }), "PUBLIC").setMultipleInstances(!0)),
7215
7214
  // RUNTIME_ENV and BUILD_TARGET are replaced by real values during the compilation
7216
- registerVersion("firestore-lite", d, ""), registerVersion("firestore-lite", d, "esm2017");
7215
+ registerVersion("firestore-lite", "4.6.2", ""), registerVersion("firestore-lite", "4.6.2", "esm2017");
7217
7216
  }();
7218
7217
 
7219
7218
  export { AggregateField, AggregateQuerySnapshot, Bytes, CollectionReference, DocumentReference, DocumentSnapshot, FieldPath, FieldValue, Firestore, FirestoreError, GeoPoint, Query, QueryCompositeFilterConstraint, QueryConstraint, QueryDocumentSnapshot, QueryEndAtConstraint, QueryFieldFilterConstraint, QueryLimitConstraint, QueryOrderByConstraint, QuerySnapshot, QueryStartAtConstraint, Timestamp, Transaction, WriteBatch, addDoc, aggregateFieldEqual, aggregateQuerySnapshotEqual, and, arrayRemove, arrayUnion, average, collection, collectionGroup, connectFirestoreEmulator, count, deleteDoc, deleteField, doc, documentId, endAt, endBefore, getAggregate, getCount, getDoc, getDocs, getFirestore, increment, initializeFirestore, limit, limitToLast, or, orderBy, query, queryEqual, refEqual, runTransaction, serverTimestamp, setDoc, setLogLevel, snapshotEqual, startAfter, startAt, sum, terminate, updateDoc, where, writeBatch };