@firebase/firestore 4.7.7-canary.4e6a5c670 → 4.7.7-canary.604133f8d
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.
- package/dist/firestore/src/global_index.d.ts +9 -2
- package/dist/firestore/src/lite-api/database.d.ts +4 -0
- package/dist/firestore/src/lite-api/settings.d.ts +4 -0
- package/dist/firestore/src/lite-api/vector_value.d.ts +2 -2
- package/dist/firestore/src/util/misc.d.ts +0 -2
- package/dist/firestore/test/integration/util/settings.d.ts +1 -0
- package/dist/index.cjs.js +245 -243
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.esm2017.js +246 -244
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.node.cjs.js +56 -55
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.mjs +57 -56
- package/dist/index.node.mjs.map +1 -1
- package/dist/index.rn.js +198 -196
- package/dist/index.rn.js.map +1 -1
- package/dist/internal.d.ts +9 -2
- package/dist/lite/firestore/src/lite-api/database.d.ts +4 -0
- package/dist/lite/firestore/src/lite-api/settings.d.ts +4 -0
- package/dist/lite/firestore/src/lite-api/vector_value.d.ts +2 -2
- package/dist/lite/firestore/src/util/misc.d.ts +0 -2
- package/dist/lite/firestore/test/integration/util/settings.d.ts +1 -0
- package/dist/lite/index.browser.esm2017.js +148 -168
- package/dist/lite/index.browser.esm2017.js.map +1 -1
- package/dist/lite/index.cjs.js +148 -168
- package/dist/lite/index.cjs.js.map +1 -1
- package/dist/lite/index.d.ts +2 -2
- package/dist/lite/index.node.cjs.js +112 -130
- package/dist/lite/index.node.cjs.js.map +1 -1
- package/dist/lite/index.node.mjs +113 -131
- package/dist/lite/index.node.mjs.map +1 -1
- package/dist/lite/index.rn.esm2017.js +161 -181
- package/dist/lite/index.rn.esm2017.js.map +1 -1
- package/dist/lite/internal.d.ts +9 -2
- package/dist/lite/private.d.ts +6 -2
- package/dist/private.d.ts +6 -2
- package/package.json +9 -9
package/dist/index.cjs.js
CHANGED
|
@@ -9,7 +9,7 @@ var util = require('@firebase/util');
|
|
|
9
9
|
var bloomBlob = require('@firebase/webchannel-wrapper/bloom-blob');
|
|
10
10
|
var webchannelBlob = require('@firebase/webchannel-wrapper/webchannel-blob');
|
|
11
11
|
|
|
12
|
-
const
|
|
12
|
+
const b = "@firebase/firestore", S = "4.7.7-canary.604133f8d";
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* @license
|
|
@@ -71,7 +71,7 @@ User.MOCK_USER = new User("mock-user");
|
|
|
71
71
|
* See the License for the specific language governing permissions and
|
|
72
72
|
* limitations under the License.
|
|
73
73
|
*/
|
|
74
|
-
let D = "11.3.0-canary.
|
|
74
|
+
let D = "11.3.0-canary.604133f8d";
|
|
75
75
|
|
|
76
76
|
/**
|
|
77
77
|
* @license
|
|
@@ -688,31 +688,6 @@ function __PRIVATE_randomBytes(e) {
|
|
|
688
688
|
return n;
|
|
689
689
|
}
|
|
690
690
|
|
|
691
|
-
/**
|
|
692
|
-
* @license
|
|
693
|
-
* Copyright 2023 Google LLC
|
|
694
|
-
*
|
|
695
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
696
|
-
* you may not use this file except in compliance with the License.
|
|
697
|
-
* You may obtain a copy of the License at
|
|
698
|
-
*
|
|
699
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
700
|
-
*
|
|
701
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
702
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
703
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
704
|
-
* See the License for the specific language governing permissions and
|
|
705
|
-
* limitations under the License.
|
|
706
|
-
*/
|
|
707
|
-
/**
|
|
708
|
-
* An instance of the Platform's 'TextEncoder' implementation.
|
|
709
|
-
*/ function __PRIVATE_newTextEncoder() {
|
|
710
|
-
return new TextEncoder;
|
|
711
|
-
}
|
|
712
|
-
|
|
713
|
-
/**
|
|
714
|
-
* An instance of the Platform's 'TextDecoder' implementation.
|
|
715
|
-
*/
|
|
716
691
|
/**
|
|
717
692
|
* @license
|
|
718
693
|
* Copyright 2017 Google LLC
|
|
@@ -734,8 +709,7 @@ function __PRIVATE_randomBytes(e) {
|
|
|
734
709
|
*
|
|
735
710
|
* @internal
|
|
736
711
|
* Exported internally for testing purposes.
|
|
737
|
-
*/
|
|
738
|
-
class __PRIVATE_AutoId {
|
|
712
|
+
*/ class __PRIVATE_AutoId {
|
|
739
713
|
static newId() {
|
|
740
714
|
// Alphanumeric characters
|
|
741
715
|
const e = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", t = 62 * Math.floor(256 / 62);
|
|
@@ -756,16 +730,6 @@ function __PRIVATE_primitiveComparator(e, t) {
|
|
|
756
730
|
return e < t ? -1 : e > t ? 1 : 0;
|
|
757
731
|
}
|
|
758
732
|
|
|
759
|
-
/** Compare strings in UTF-8 encoded byte order */ function __PRIVATE_compareUtf8Strings(e, t) {
|
|
760
|
-
// Convert the string to UTF-8 encoded bytes
|
|
761
|
-
const n = __PRIVATE_newTextEncoder().encode(e), r = __PRIVATE_newTextEncoder().encode(t);
|
|
762
|
-
for (let e = 0; e < Math.min(n.length, r.length); e++) {
|
|
763
|
-
const t = __PRIVATE_primitiveComparator(n[e], r[e]);
|
|
764
|
-
if (0 !== t) return t;
|
|
765
|
-
}
|
|
766
|
-
return __PRIVATE_primitiveComparator(n.length, r.length);
|
|
767
|
-
}
|
|
768
|
-
|
|
769
733
|
/** Helper to compare arrays using isEqual(). */ function __PRIVATE_arrayEquals(e, t, n) {
|
|
770
734
|
return e.length === t.length && e.every(((e, r) => n(e, t[r])));
|
|
771
735
|
}
|
|
@@ -1056,11 +1020,13 @@ class Timestamp {
|
|
|
1056
1020
|
const n = BasePath.compareSegments(e.get(r), t.get(r));
|
|
1057
1021
|
if (0 !== n) return n;
|
|
1058
1022
|
}
|
|
1059
|
-
return
|
|
1023
|
+
return Math.sign(e.length - t.length);
|
|
1060
1024
|
}
|
|
1061
1025
|
static compareSegments(e, t) {
|
|
1062
1026
|
const n = BasePath.isNumericId(e), r = BasePath.isNumericId(t);
|
|
1063
|
-
return n && !r ? -1 : !n && r ? 1 : n && r ? BasePath.extractNumericId(e).compare(BasePath.extractNumericId(t)) :
|
|
1027
|
+
return n && !r ? -1 : !n && r ? 1 : n && r ? BasePath.extractNumericId(e).compare(BasePath.extractNumericId(t)) :
|
|
1028
|
+
// both non-numeric
|
|
1029
|
+
e < t ? -1 : e > t ? 1 : 0;
|
|
1064
1030
|
}
|
|
1065
1031
|
// Checks if a segment is a numeric ID (starts with "__id" and ends with "__").
|
|
1066
1032
|
static isNumericId(e) {
|
|
@@ -1848,13 +1814,13 @@ class __PRIVATE_SimpleDbTransaction {
|
|
|
1848
1814
|
* within the key range or index.
|
|
1849
1815
|
*/ class __PRIVATE_IterationController {
|
|
1850
1816
|
constructor(e) {
|
|
1851
|
-
this.q = e, this.$ = !1, this.
|
|
1817
|
+
this.q = e, this.$ = !1, this.K = null;
|
|
1852
1818
|
}
|
|
1853
1819
|
get isDone() {
|
|
1854
1820
|
return this.$;
|
|
1855
1821
|
}
|
|
1856
|
-
get
|
|
1857
|
-
return this.
|
|
1822
|
+
get U() {
|
|
1823
|
+
return this.K;
|
|
1858
1824
|
}
|
|
1859
1825
|
set cursor(e) {
|
|
1860
1826
|
this.q = e;
|
|
@@ -1868,7 +1834,7 @@ class __PRIVATE_SimpleDbTransaction {
|
|
|
1868
1834
|
* This function can be called to skip to that next key, which could be
|
|
1869
1835
|
* an index or a primary key.
|
|
1870
1836
|
*/ W(e) {
|
|
1871
|
-
this.
|
|
1837
|
+
this.K = e;
|
|
1872
1838
|
}
|
|
1873
1839
|
/**
|
|
1874
1840
|
* Delete the current cursor value from the object store.
|
|
@@ -2027,7 +1993,7 @@ class __PRIVATE_SimpleDbTransaction {
|
|
|
2027
1993
|
const e = o.catch((e => (s.done(), PersistencePromise.reject(e))));
|
|
2028
1994
|
n.push(e);
|
|
2029
1995
|
}
|
|
2030
|
-
s.isDone ? r() : null === s.
|
|
1996
|
+
s.isDone ? r() : null === s.U ? i.continue() : i.continue(s.U);
|
|
2031
1997
|
};
|
|
2032
1998
|
})).next((() => PersistencePromise.waitFor(n)));
|
|
2033
1999
|
}
|
|
@@ -2348,7 +2314,7 @@ function __PRIVATE_encodeResourcePath(e) {
|
|
|
2348
2314
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2349
2315
|
* See the License for the specific language governing permissions and
|
|
2350
2316
|
* limitations under the License.
|
|
2351
|
-
*/ const
|
|
2317
|
+
*/ const K = "remoteDocuments", U = "owner", W = "owner", G = "mutationQueues", z = "userId", j = "mutations", H = "batchId", J = "userMutationsIndex", Y = [ "userId", "batchId" ];
|
|
2352
2318
|
|
|
2353
2319
|
/**
|
|
2354
2320
|
* @license
|
|
@@ -2393,7 +2359,7 @@ function __PRIVATE_newDbDocumentMutationPrefixForPath(e, t) {
|
|
|
2393
2359
|
* there is no useful information to store as the value. The raw (unencoded)
|
|
2394
2360
|
* path cannot be stored because IndexedDb doesn't store prototype
|
|
2395
2361
|
* information.
|
|
2396
|
-
*/ const Z = {}, X = "documentMutations", ee = "remoteDocumentsV14", te = [ "prefixPath", "collectionGroup", "readTime", "documentId" ], ne = "documentKeyIndex", re = [ "prefixPath", "collectionGroup", "documentId" ], ie = "collectionGroupIndex", se = [ "collectionGroup", "readTime", "prefixPath", "documentId" ], oe = "remoteDocumentGlobal", _e = "remoteDocumentGlobalKey", ae = "targets", ue = "queryTargetsIndex", ce = [ "canonicalId", "targetId" ], le = "targetDocuments", he = [ "targetId", "path" ], Pe = "documentTargetsIndex", Te = [ "path", "targetId" ], Ie = "targetGlobalKey", Ee = "targetGlobal", de = "collectionParents", Ae = [ "collectionId", "parent" ], Re = "clientMetadata", Ve = "clientId", me = "bundles", fe = "bundleId", ge = "namedQueries", pe = "name", ye = "indexConfiguration", we = "indexId",
|
|
2362
|
+
*/ const Z = {}, X = "documentMutations", ee = "remoteDocumentsV14", te = [ "prefixPath", "collectionGroup", "readTime", "documentId" ], ne = "documentKeyIndex", re = [ "prefixPath", "collectionGroup", "documentId" ], ie = "collectionGroupIndex", se = [ "collectionGroup", "readTime", "prefixPath", "documentId" ], oe = "remoteDocumentGlobal", _e = "remoteDocumentGlobalKey", ae = "targets", ue = "queryTargetsIndex", ce = [ "canonicalId", "targetId" ], le = "targetDocuments", he = [ "targetId", "path" ], Pe = "documentTargetsIndex", Te = [ "path", "targetId" ], Ie = "targetGlobalKey", Ee = "targetGlobal", de = "collectionParents", Ae = [ "collectionId", "parent" ], Re = "clientMetadata", Ve = "clientId", me = "bundles", fe = "bundleId", ge = "namedQueries", pe = "name", ye = "indexConfiguration", we = "indexId", be = "collectionGroupIndex", Se = "collectionGroup", De = "indexState", ve = [ "indexId", "uid" ], Ce = "sequenceNumberIndex", Fe = [ "uid", "sequenceNumber" ], Me = "indexEntries", xe = [ "indexId", "uid", "arrayValue", "directionalValue", "orderedDocumentKey", "documentKey" ], Oe = "documentKeyIndex", Ne = [ "indexId", "uid", "orderedDocumentKey" ], Be = "documentOverlays", Le = [ "userId", "collectionPath", "documentId" ], ke = "collectionPathOverlayIndex", qe = [ "userId", "collectionPath", "largestBatchId" ], Qe = "collectionGroupOverlayIndex", $e = [ "userId", "collectionGroup", "largestBatchId" ], Ke = "globals", Ue = "name", We = [ ...[ ...[ ...[ ...[ G, j, X, K, ae, U, Ee, le ], Re ], oe ], de ], me, ge ], Ge = [ ...We, Be ], ze = [ G, j, X, ee, ae, U, Ee, le, Re, oe, de, me, ge, Be ], je = ze, He = [ ...je, ye, De, Me ], Je = He, Ye = [ ...He, Ke ];
|
|
2397
2363
|
|
|
2398
2364
|
/**
|
|
2399
2365
|
* @license
|
|
@@ -3455,7 +3421,7 @@ function __PRIVATE_valueCompare(e, t) {
|
|
|
3455
3421
|
return __PRIVATE_compareTimestamps(__PRIVATE_getLocalWriteTime(e), __PRIVATE_getLocalWriteTime(t));
|
|
3456
3422
|
|
|
3457
3423
|
case 5 /* TypeOrder.StringValue */ :
|
|
3458
|
-
return
|
|
3424
|
+
return __PRIVATE_primitiveComparator(e.stringValue, t.stringValue);
|
|
3459
3425
|
|
|
3460
3426
|
case 6 /* TypeOrder.BlobValue */ :
|
|
3461
3427
|
return function __PRIVATE_compareBlobs(e, t) {
|
|
@@ -3503,7 +3469,7 @@ function __PRIVATE_valueCompare(e, t) {
|
|
|
3503
3469
|
// canonical IDs are independent of insertion order.
|
|
3504
3470
|
r.sort(), s.sort();
|
|
3505
3471
|
for (let e = 0; e < r.length && e < s.length; ++e) {
|
|
3506
|
-
const t =
|
|
3472
|
+
const t = __PRIVATE_primitiveComparator(r[e], s[e]);
|
|
3507
3473
|
if (0 !== t) return t;
|
|
3508
3474
|
const o = __PRIVATE_valueCompare(n[r[e]], i[s[e]]);
|
|
3509
3475
|
if (0 !== o) return o;
|
|
@@ -5915,6 +5881,32 @@ let At = null;
|
|
|
5915
5881
|
* Sets the value of the `testingHooksSpi` object.
|
|
5916
5882
|
* @param instance the instance to set.
|
|
5917
5883
|
*/
|
|
5884
|
+
/**
|
|
5885
|
+
* @license
|
|
5886
|
+
* Copyright 2023 Google LLC
|
|
5887
|
+
*
|
|
5888
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5889
|
+
* you may not use this file except in compliance with the License.
|
|
5890
|
+
* You may obtain a copy of the License at
|
|
5891
|
+
*
|
|
5892
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
5893
|
+
*
|
|
5894
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
5895
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
5896
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
5897
|
+
* See the License for the specific language governing permissions and
|
|
5898
|
+
* limitations under the License.
|
|
5899
|
+
*/
|
|
5900
|
+
/**
|
|
5901
|
+
* An instance of the Platform's 'TextEncoder' implementation.
|
|
5902
|
+
*/
|
|
5903
|
+
function __PRIVATE_newTextEncoder() {
|
|
5904
|
+
return new TextEncoder;
|
|
5905
|
+
}
|
|
5906
|
+
|
|
5907
|
+
/**
|
|
5908
|
+
* An instance of the Platform's 'TextDecoder' implementation.
|
|
5909
|
+
*/
|
|
5918
5910
|
/**
|
|
5919
5911
|
* @license
|
|
5920
5912
|
* Copyright 2022 Google LLC
|
|
@@ -6195,13 +6187,13 @@ class __PRIVATE_WatchTargetChange {
|
|
|
6195
6187
|
*/
|
|
6196
6188
|
this.ye = __PRIVATE_snapshotChangesMap(),
|
|
6197
6189
|
/** See public getters for explanations of these fields. */
|
|
6198
|
-
this.we = ByteString.EMPTY_BYTE_STRING, this.
|
|
6190
|
+
this.we = ByteString.EMPTY_BYTE_STRING, this.be = !1,
|
|
6199
6191
|
/**
|
|
6200
6192
|
* Whether this target state should be included in the next snapshot. We
|
|
6201
6193
|
* initialize to true so that newly-added targets are included in the next
|
|
6202
6194
|
* RemoteEvent.
|
|
6203
6195
|
*/
|
|
6204
|
-
this.
|
|
6196
|
+
this.Se = !0;
|
|
6205
6197
|
}
|
|
6206
6198
|
/**
|
|
6207
6199
|
* Whether this target has been marked 'current'.
|
|
@@ -6211,7 +6203,7 @@ class __PRIVATE_WatchTargetChange {
|
|
|
6211
6203
|
* was added and that the target is consistent with the rest of the watch
|
|
6212
6204
|
* stream.
|
|
6213
6205
|
*/ get current() {
|
|
6214
|
-
return this.
|
|
6206
|
+
return this.be;
|
|
6215
6207
|
}
|
|
6216
6208
|
/** The last resume token sent to us for this target. */ get resumeToken() {
|
|
6217
6209
|
return this.we;
|
|
@@ -6220,13 +6212,13 @@ class __PRIVATE_WatchTargetChange {
|
|
|
6220
6212
|
return 0 !== this.pe;
|
|
6221
6213
|
}
|
|
6222
6214
|
/** Whether we have modified any state that should trigger a snapshot. */ get ve() {
|
|
6223
|
-
return this.
|
|
6215
|
+
return this.Se;
|
|
6224
6216
|
}
|
|
6225
6217
|
/**
|
|
6226
6218
|
* Applies the resume token to the TargetChange, but only when it has a new
|
|
6227
6219
|
* value. Empty resumeTokens are discarded.
|
|
6228
6220
|
*/ Ce(e) {
|
|
6229
|
-
e.approximateByteSize() > 0 && (this.
|
|
6221
|
+
e.approximateByteSize() > 0 && (this.Se = !0, this.we = e);
|
|
6230
6222
|
}
|
|
6231
6223
|
/**
|
|
6232
6224
|
* Creates a target change from the current set of changes.
|
|
@@ -6252,18 +6244,18 @@ class __PRIVATE_WatchTargetChange {
|
|
|
6252
6244
|
default:
|
|
6253
6245
|
fail();
|
|
6254
6246
|
}
|
|
6255
|
-
})), new TargetChange(this.we, this.
|
|
6247
|
+
})), new TargetChange(this.we, this.be, e, t, n);
|
|
6256
6248
|
}
|
|
6257
6249
|
/**
|
|
6258
6250
|
* Resets the document changes and sets `hasPendingChanges` to false.
|
|
6259
6251
|
*/ Me() {
|
|
6260
|
-
this.
|
|
6252
|
+
this.Se = !1, this.ye = __PRIVATE_snapshotChangesMap();
|
|
6261
6253
|
}
|
|
6262
6254
|
xe(e, t) {
|
|
6263
|
-
this.
|
|
6255
|
+
this.Se = !0, this.ye = this.ye.insert(e, t);
|
|
6264
6256
|
}
|
|
6265
6257
|
Oe(e) {
|
|
6266
|
-
this.
|
|
6258
|
+
this.Se = !0, this.ye = this.ye.remove(e);
|
|
6267
6259
|
}
|
|
6268
6260
|
Ne() {
|
|
6269
6261
|
this.pe += 1;
|
|
@@ -6272,7 +6264,7 @@ class __PRIVATE_WatchTargetChange {
|
|
|
6272
6264
|
this.pe -= 1, __PRIVATE_hardAssert(this.pe >= 0);
|
|
6273
6265
|
}
|
|
6274
6266
|
Le() {
|
|
6275
|
-
this.
|
|
6267
|
+
this.Se = !0, this.be = !0;
|
|
6276
6268
|
}
|
|
6277
6269
|
}
|
|
6278
6270
|
|
|
@@ -6287,13 +6279,13 @@ class __PRIVATE_WatchChangeAggregator {
|
|
|
6287
6279
|
/** Keeps track of the documents to update since the last raised snapshot. */
|
|
6288
6280
|
this.Qe = __PRIVATE_mutableDocumentMap(), this.$e = __PRIVATE_documentTargetMap(),
|
|
6289
6281
|
/** A mapping of document keys to their set of target IDs. */
|
|
6290
|
-
this.
|
|
6282
|
+
this.Ke = __PRIVATE_documentTargetMap(),
|
|
6291
6283
|
/**
|
|
6292
6284
|
* A map of targets with existence filter mismatches. These targets are
|
|
6293
6285
|
* known to be inconsistent and their listens needs to be re-established by
|
|
6294
6286
|
* RemoteStore.
|
|
6295
6287
|
*/
|
|
6296
|
-
this.
|
|
6288
|
+
this.Ue = new SortedMap(__PRIVATE_primitiveComparator);
|
|
6297
6289
|
}
|
|
6298
6290
|
/**
|
|
6299
6291
|
* Processes and adds the DocumentWatchChange to the current set of changes.
|
|
@@ -6382,7 +6374,7 @@ class __PRIVATE_WatchChangeAggregator {
|
|
|
6382
6374
|
// trigger re-run of the query.
|
|
6383
6375
|
this.Ye(t);
|
|
6384
6376
|
const e = 2 /* BloomFilterApplicationStatus.FalsePositive */ === i ? "TargetPurposeExistenceFilterMismatchBloom" /* TargetPurpose.ExistenceFilterMismatchBloom */ : "TargetPurposeExistenceFilterMismatch" /* TargetPurpose.ExistenceFilterMismatch */;
|
|
6385
|
-
this.
|
|
6377
|
+
this.Ue = this.Ue.insert(t, e);
|
|
6386
6378
|
}
|
|
6387
6379
|
null == At || At.rt(function __PRIVATE_createExistenceFilterMismatchInfoForTestingHooks(e, t, n, r, i) {
|
|
6388
6380
|
var s, o, _, a, u, c;
|
|
@@ -6494,7 +6486,7 @@ class __PRIVATE_WatchChangeAggregator {
|
|
|
6494
6486
|
|
|
6495
6487
|
// TODO(gsoltis): Expand on this comment once GC is available in the JS
|
|
6496
6488
|
// client.
|
|
6497
|
-
this.
|
|
6489
|
+
this.Ke.forEach(((e, t) => {
|
|
6498
6490
|
let r = !0;
|
|
6499
6491
|
t.forEachWhile((e => {
|
|
6500
6492
|
const t = this.Xe(e);
|
|
@@ -6502,9 +6494,9 @@ class __PRIVATE_WatchChangeAggregator {
|
|
|
6502
6494
|
!1);
|
|
6503
6495
|
})), r && (n = n.add(e));
|
|
6504
6496
|
})), this.Qe.forEach(((t, n) => n.setReadTime(e)));
|
|
6505
|
-
const r = new RemoteEvent(e, t, this.
|
|
6497
|
+
const r = new RemoteEvent(e, t, this.Ue, this.Qe, n);
|
|
6506
6498
|
return this.Qe = __PRIVATE_mutableDocumentMap(), this.$e = __PRIVATE_documentTargetMap(),
|
|
6507
|
-
this.
|
|
6499
|
+
this.Ke = __PRIVATE_documentTargetMap(), this.Ue = new SortedMap(__PRIVATE_primitiveComparator),
|
|
6508
6500
|
r;
|
|
6509
6501
|
}
|
|
6510
6502
|
/**
|
|
@@ -6516,7 +6508,7 @@ class __PRIVATE_WatchChangeAggregator {
|
|
|
6516
6508
|
if (!this.Je(e)) return;
|
|
6517
6509
|
const n = this.ut(e, t.key) ? 2 /* ChangeType.Modified */ : 0 /* ChangeType.Added */;
|
|
6518
6510
|
this.He(e).xe(t.key, n), this.Qe = this.Qe.insert(t.key, t), this.$e = this.$e.insert(t.key, this._t(t.key).add(e)),
|
|
6519
|
-
this.
|
|
6511
|
+
this.Ke = this.Ke.insert(t.key, this.ct(t.key).add(e));
|
|
6520
6512
|
}
|
|
6521
6513
|
/**
|
|
6522
6514
|
* Removes the provided document from the target mapping. If the
|
|
@@ -6532,7 +6524,7 @@ class __PRIVATE_WatchChangeAggregator {
|
|
|
6532
6524
|
this.ut(e, t) ? r.xe(t, 1 /* ChangeType.Removed */) :
|
|
6533
6525
|
// The document may have entered and left the target before we raised a
|
|
6534
6526
|
// snapshot, so we can just ignore the change.
|
|
6535
|
-
r.Oe(t), this.
|
|
6527
|
+
r.Oe(t), this.Ke = this.Ke.insert(t, this.ct(t).delete(e)), this.Ke = this.Ke.insert(t, this.ct(t).add(e)),
|
|
6536
6528
|
n && (this.Qe = this.Qe.insert(t, n));
|
|
6537
6529
|
}
|
|
6538
6530
|
removeTarget(e) {
|
|
@@ -6557,8 +6549,8 @@ class __PRIVATE_WatchChangeAggregator {
|
|
|
6557
6549
|
return t || (t = new __PRIVATE_TargetState, this.qe.set(e, t)), t;
|
|
6558
6550
|
}
|
|
6559
6551
|
ct(e) {
|
|
6560
|
-
let t = this.
|
|
6561
|
-
return t || (t = new SortedSet(__PRIVATE_primitiveComparator), this.
|
|
6552
|
+
let t = this.Ke.get(e);
|
|
6553
|
+
return t || (t = new SortedSet(__PRIVATE_primitiveComparator), this.Ke = this.Ke.insert(e, t)),
|
|
6562
6554
|
t;
|
|
6563
6555
|
}
|
|
6564
6556
|
_t(e) {
|
|
@@ -7741,7 +7733,7 @@ function __PRIVATE_toDbIndexState(e, t, n, r) {
|
|
|
7741
7733
|
* limitations under the License.
|
|
7742
7734
|
*/ class __PRIVATE_IndexedDbGlobalsCache {
|
|
7743
7735
|
dt(e) {
|
|
7744
|
-
return __PRIVATE_getStore(e,
|
|
7736
|
+
return __PRIVATE_getStore(e, Ke);
|
|
7745
7737
|
}
|
|
7746
7738
|
getSessionToken(e) {
|
|
7747
7739
|
return this.dt(e).get("sessionToken").next((e => {
|
|
@@ -7802,12 +7794,12 @@ class __PRIVATE_FirestoreIndexValueWriter {
|
|
|
7802
7794
|
let n = e.timestampValue;
|
|
7803
7795
|
this.ft(t, 20), "string" == typeof n && (n = __PRIVATE_normalizeTimestamp(n)), t.yt(`${n.seconds || ""}`),
|
|
7804
7796
|
t.gt(n.nanos || 0);
|
|
7805
|
-
} else if ("stringValue" in e) this.wt(e.stringValue, t), this.
|
|
7806
|
-
t.
|
|
7797
|
+
} else if ("stringValue" in e) this.wt(e.stringValue, t), this.bt(t); else if ("bytesValue" in e) this.ft(t, 30),
|
|
7798
|
+
t.St(__PRIVATE_normalizeByteString(e.bytesValue)), this.bt(t); else if ("referenceValue" in e) this.Dt(e.referenceValue, t); else if ("geoPointValue" in e) {
|
|
7807
7799
|
const n = e.geoPointValue;
|
|
7808
7800
|
this.ft(t, 45), t.gt(n.latitude || 0), t.gt(n.longitude || 0);
|
|
7809
7801
|
} else "mapValue" in e ? __PRIVATE_isMaxValue(e) ? this.ft(t, Number.MAX_SAFE_INTEGER) : __PRIVATE_isVectorValue(e) ? this.vt(e.mapValue, t) : (this.Ct(e.mapValue, t),
|
|
7810
|
-
this.
|
|
7802
|
+
this.bt(t)) : "arrayValue" in e ? (this.Ft(e.arrayValue, t), this.bt(t)) : fail();
|
|
7811
7803
|
}
|
|
7812
7804
|
wt(e, t) {
|
|
7813
7805
|
this.ft(t, 25), this.Mt(e, t);
|
|
@@ -7844,7 +7836,7 @@ class __PRIVATE_FirestoreIndexValueWriter {
|
|
|
7844
7836
|
ft(e, t) {
|
|
7845
7837
|
e.gt(t);
|
|
7846
7838
|
}
|
|
7847
|
-
|
|
7839
|
+
bt(e) {
|
|
7848
7840
|
// While the SDK does not implement truncation, the truncation marker is
|
|
7849
7841
|
// used to terminate all variable length values (which are strings, bytes,
|
|
7850
7842
|
// references, arrays and maps).
|
|
@@ -7953,10 +7945,10 @@ function __PRIVATE_unsignedNumLength(e) {
|
|
|
7953
7945
|
}
|
|
7954
7946
|
this.qt();
|
|
7955
7947
|
}
|
|
7956
|
-
|
|
7948
|
+
Kt(e) {
|
|
7957
7949
|
// Values are encoded with a single byte length prefix, followed by the
|
|
7958
7950
|
// actual value in big-endian format with leading 0 bytes dropped.
|
|
7959
|
-
const t = this.
|
|
7951
|
+
const t = this.Ut(e), n = __PRIVATE_unsignedNumLength(t);
|
|
7960
7952
|
this.Wt(1 + n), this.buffer[this.position++] = 255 & n;
|
|
7961
7953
|
// Write the length
|
|
7962
7954
|
for (let e = t.length - n; e < t.length; ++e) this.buffer[this.position++] = 255 & t[e];
|
|
@@ -7964,7 +7956,7 @@ function __PRIVATE_unsignedNumLength(e) {
|
|
|
7964
7956
|
Gt(e) {
|
|
7965
7957
|
// Values are encoded with a single byte length prefix, followed by the
|
|
7966
7958
|
// inverted value in big-endian format with leading 0 bytes dropped.
|
|
7967
|
-
const t = this.
|
|
7959
|
+
const t = this.Ut(e), n = __PRIVATE_unsignedNumLength(t);
|
|
7968
7960
|
this.Wt(1 + n), this.buffer[this.position++] = ~(255 & n);
|
|
7969
7961
|
// Write the length
|
|
7970
7962
|
for (let e = t.length - n; e < t.length; ++e) this.buffer[this.position++] = ~(255 & t[e]);
|
|
@@ -7999,7 +7991,7 @@ function __PRIVATE_unsignedNumLength(e) {
|
|
|
7999
7991
|
* -0.0 < 0.0
|
|
8000
7992
|
* all non-NaN < NaN
|
|
8001
7993
|
* NaN = NaN
|
|
8002
|
-
*/
|
|
7994
|
+
*/ Ut(e) {
|
|
8003
7995
|
const t =
|
|
8004
7996
|
/** Converts a JavaScript number to a byte array (using big endian encoding). */
|
|
8005
7997
|
function __PRIVATE_doubleToLongBits(e) {
|
|
@@ -8051,14 +8043,14 @@ class __PRIVATE_AscendingIndexByteEncoder {
|
|
|
8051
8043
|
constructor(e) {
|
|
8052
8044
|
this.Zt = e;
|
|
8053
8045
|
}
|
|
8054
|
-
|
|
8046
|
+
St(e) {
|
|
8055
8047
|
this.Zt.Ot(e);
|
|
8056
8048
|
}
|
|
8057
8049
|
yt(e) {
|
|
8058
8050
|
this.Zt.Qt(e);
|
|
8059
8051
|
}
|
|
8060
8052
|
gt(e) {
|
|
8061
|
-
this.Zt.
|
|
8053
|
+
this.Zt.Kt(e);
|
|
8062
8054
|
}
|
|
8063
8055
|
Vt() {
|
|
8064
8056
|
this.Zt.zt();
|
|
@@ -8069,7 +8061,7 @@ class __PRIVATE_DescendingIndexByteEncoder {
|
|
|
8069
8061
|
constructor(e) {
|
|
8070
8062
|
this.Zt = e;
|
|
8071
8063
|
}
|
|
8072
|
-
|
|
8064
|
+
St(e) {
|
|
8073
8065
|
this.Zt.Lt(e);
|
|
8074
8066
|
}
|
|
8075
8067
|
yt(e) {
|
|
@@ -8899,7 +8891,7 @@ class __PRIVATE_IndexedDbIndexManager {
|
|
|
8899
8891
|
let i = 0;
|
|
8900
8892
|
for (const s of __PRIVATE_fieldIndexGetDirectionalSegments(e)) {
|
|
8901
8893
|
const e = n[i++];
|
|
8902
|
-
for (const n of r) if (this.
|
|
8894
|
+
for (const n of r) if (this.bn(t, s.fieldPath) && isArray(e)) r = this.Sn(r, s, e); else {
|
|
8903
8895
|
const t = n.tn(s.kind);
|
|
8904
8896
|
__PRIVATE_FirestoreIndexValueWriter.xt.At(e, t);
|
|
8905
8897
|
}
|
|
@@ -8923,7 +8915,7 @@ class __PRIVATE_IndexedDbIndexManager {
|
|
|
8923
8915
|
* The method appends each value to all existing encoders (e.g. filter("a",
|
|
8924
8916
|
* "==", "a1").filter("b", "in", ["b1", "b2"]) becomes ["a1,b1", "a1,b2"]). A
|
|
8925
8917
|
* list of new encoders is returned.
|
|
8926
|
-
*/
|
|
8918
|
+
*/ Sn(e, t, n) {
|
|
8927
8919
|
const r = [ ...e ], i = [];
|
|
8928
8920
|
for (const e of n.arrayValue.values || []) for (const n of r) {
|
|
8929
8921
|
const r = new __PRIVATE_IndexByteEncoder;
|
|
@@ -8931,12 +8923,12 @@ class __PRIVATE_IndexedDbIndexManager {
|
|
|
8931
8923
|
}
|
|
8932
8924
|
return i;
|
|
8933
8925
|
}
|
|
8934
|
-
|
|
8926
|
+
bn(e, t) {
|
|
8935
8927
|
return !!e.filters.find((e => e instanceof FieldFilter && e.field.isEqual(t) && ("in" /* Operator.IN */ === e.op || "not-in" /* Operator.NOT_IN */ === e.op)));
|
|
8936
8928
|
}
|
|
8937
8929
|
getFieldIndexes(e, t) {
|
|
8938
8930
|
const n = __PRIVATE_indexConfigurationStore(e), r = __PRIVATE_indexStateStore(e);
|
|
8939
|
-
return (t ? n.G(
|
|
8931
|
+
return (t ? n.G(be, IDBKeyRange.bound(t, t)) : n.G()).next((e => {
|
|
8940
8932
|
const t = [];
|
|
8941
8933
|
return PersistencePromise.forEach(e, (e => r.get([ e.indexId, this.uid ]).next((n => {
|
|
8942
8934
|
t.push(function __PRIVATE_fromDbIndexConfiguration(e, t) {
|
|
@@ -8954,7 +8946,7 @@ class __PRIVATE_IndexedDbIndexManager {
|
|
|
8954
8946
|
}
|
|
8955
8947
|
updateCollectionGroup(e, t, n) {
|
|
8956
8948
|
const r = __PRIVATE_indexConfigurationStore(e), i = __PRIVATE_indexStateStore(e);
|
|
8957
|
-
return this.vn(e).next((e => r.G(
|
|
8949
|
+
return this.vn(e).next((e => r.G(be, IDBKeyRange.bound(t, t)).next((t => PersistencePromise.forEach(t, (t => i.put(__PRIVATE_toDbIndexState(t.indexId, this.uid, e, n))))))));
|
|
8958
8950
|
}
|
|
8959
8951
|
updateIndexEntries(e, t) {
|
|
8960
8952
|
// Porting Note: `getFieldIndexes()` on Web does not cache index lookups as
|
|
@@ -9151,7 +9143,7 @@ function __PRIVATE_getMinOffsetFromFieldIndexes(e) {
|
|
|
9151
9143
|
sequenceNumbersCollected: 0,
|
|
9152
9144
|
targetsRemoved: 0,
|
|
9153
9145
|
documentsRemoved: 0
|
|
9154
|
-
},
|
|
9146
|
+
}, bt = 41943040;
|
|
9155
9147
|
|
|
9156
9148
|
class LruParams {
|
|
9157
9149
|
static withCacheSize(e) {
|
|
@@ -9236,7 +9228,7 @@ function removeMutationBatch(e, t, n) {
|
|
|
9236
9228
|
* limitations under the License.
|
|
9237
9229
|
*/
|
|
9238
9230
|
/** A mutation queue for a specific user, backed by IndexedDB. */ LruParams.DEFAULT_COLLECTION_PERCENTILE = 10,
|
|
9239
|
-
LruParams.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT = 1e3, LruParams.DEFAULT = new LruParams(
|
|
9231
|
+
LruParams.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT = 1e3, LruParams.DEFAULT = new LruParams(bt, LruParams.DEFAULT_COLLECTION_PERCENTILE, LruParams.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT),
|
|
9240
9232
|
LruParams.DISABLED = new LruParams(-1, 0, 0);
|
|
9241
9233
|
|
|
9242
9234
|
class __PRIVATE_IndexedDbMutationQueue {
|
|
@@ -9567,14 +9559,14 @@ class __PRIVATE_TargetIdGenerator {
|
|
|
9567
9559
|
next() {
|
|
9568
9560
|
return this.$n += 2, this.$n;
|
|
9569
9561
|
}
|
|
9570
|
-
static
|
|
9562
|
+
static Kn() {
|
|
9571
9563
|
// The target cache generator must return '2' in its first call to `next()`
|
|
9572
9564
|
// as there is no differentiation in the protocol layer between an unset
|
|
9573
9565
|
// number and the number '0'. If we were to sent a target with target ID
|
|
9574
9566
|
// '0', the backend would consider it unset and replace it with its own ID.
|
|
9575
9567
|
return new __PRIVATE_TargetIdGenerator(0);
|
|
9576
9568
|
}
|
|
9577
|
-
static
|
|
9569
|
+
static Un() {
|
|
9578
9570
|
// Sync engine assigns target IDs for limbo document detection.
|
|
9579
9571
|
return new __PRIVATE_TargetIdGenerator(-1);
|
|
9580
9572
|
}
|
|
@@ -9793,7 +9785,7 @@ class __PRIVATE_TargetIdGenerator {
|
|
|
9793
9785
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9794
9786
|
* See the License for the specific language governing permissions and
|
|
9795
9787
|
* limitations under the License.
|
|
9796
|
-
*/ const
|
|
9788
|
+
*/ const St = "LruGarbageCollector", Dt = 1048576;
|
|
9797
9789
|
|
|
9798
9790
|
function __PRIVATE_bufferEntryComparator([e, t], [n, r]) {
|
|
9799
9791
|
const i = __PRIVATE_primitiveComparator(e, n);
|
|
@@ -9846,12 +9838,12 @@ function __PRIVATE_bufferEntryComparator([e, t], [n, r]) {
|
|
|
9846
9838
|
return null !== this.Xn;
|
|
9847
9839
|
}
|
|
9848
9840
|
er(e) {
|
|
9849
|
-
__PRIVATE_logDebug(
|
|
9841
|
+
__PRIVATE_logDebug(St, `Garbage collection scheduled in ${e}ms`), this.Xn = this.asyncQueue.enqueueAfterDelay("lru_garbage_collection" /* TimerId.LruGarbageCollection */ , e, (async () => {
|
|
9850
9842
|
this.Xn = null;
|
|
9851
9843
|
try {
|
|
9852
9844
|
await this.localStore.collectGarbage(this.garbageCollector);
|
|
9853
9845
|
} catch (e) {
|
|
9854
|
-
__PRIVATE_isIndexedDbTransactionError(e) ? __PRIVATE_logDebug(
|
|
9846
|
+
__PRIVATE_isIndexedDbTransactionError(e) ? __PRIVATE_logDebug(St, "Ignoring IndexedDB error during garbage collection: ", e) : await __PRIVATE_ignoreIfPrimaryLeaseLoss(e);
|
|
9855
9847
|
}
|
|
9856
9848
|
await this.er(3e5);
|
|
9857
9849
|
}));
|
|
@@ -10969,13 +10961,13 @@ class OverlayedDocument {
|
|
|
10969
10961
|
*/ removeReference(e, t) {
|
|
10970
10962
|
this.wr(new __PRIVATE_DocReference(e, t));
|
|
10971
10963
|
}
|
|
10972
|
-
|
|
10964
|
+
br(e, t) {
|
|
10973
10965
|
e.forEach((e => this.removeReference(e, t)));
|
|
10974
10966
|
}
|
|
10975
10967
|
/**
|
|
10976
10968
|
* Clears all references with a given ID. Calls removeRef() for each key
|
|
10977
10969
|
* removed.
|
|
10978
|
-
*/
|
|
10970
|
+
*/ Sr(e) {
|
|
10979
10971
|
const t = new DocumentKey(new ResourcePath([])), n = new __PRIVATE_DocReference(t, e), r = new __PRIVATE_DocReference(t, e + 1), i = [];
|
|
10980
10972
|
return this.gr.forEachInRange([ n, r ], (e => {
|
|
10981
10973
|
this.wr(e), i.push(e.key);
|
|
@@ -11342,7 +11334,7 @@ class __PRIVATE_MemoryRemoteDocumentChangeBuffer extends RemoteDocumentChangeBuf
|
|
|
11342
11334
|
* A ordered bidirectional mapping between documents and the remote target
|
|
11343
11335
|
* IDs.
|
|
11344
11336
|
*/
|
|
11345
|
-
this.
|
|
11337
|
+
this.Kr = new __PRIVATE_ReferenceSet, this.targetCount = 0, this.Ur = __PRIVATE_TargetIdGenerator.Kn();
|
|
11346
11338
|
}
|
|
11347
11339
|
forEachTarget(e, t) {
|
|
11348
11340
|
return this.Qr.forEach(((e, n) => t(n))), PersistencePromise.resolve();
|
|
@@ -11354,7 +11346,7 @@ class __PRIVATE_MemoryRemoteDocumentChangeBuffer extends RemoteDocumentChangeBuf
|
|
|
11354
11346
|
return PersistencePromise.resolve(this.$r);
|
|
11355
11347
|
}
|
|
11356
11348
|
allocateTargetId(e) {
|
|
11357
|
-
return this.highestTargetId = this.
|
|
11349
|
+
return this.highestTargetId = this.Ur.next(), PersistencePromise.resolve(this.highestTargetId);
|
|
11358
11350
|
}
|
|
11359
11351
|
setTargetsMetadata(e, t, n) {
|
|
11360
11352
|
return n && (this.lastRemoteSnapshotVersion = n), t > this.$r && (this.$r = t),
|
|
@@ -11363,7 +11355,7 @@ class __PRIVATE_MemoryRemoteDocumentChangeBuffer extends RemoteDocumentChangeBuf
|
|
|
11363
11355
|
zn(e) {
|
|
11364
11356
|
this.Qr.set(e.target, e);
|
|
11365
11357
|
const t = e.targetId;
|
|
11366
|
-
t > this.highestTargetId && (this.
|
|
11358
|
+
t > this.highestTargetId && (this.Ur = new __PRIVATE_TargetIdGenerator(t), this.highestTargetId = t),
|
|
11367
11359
|
e.sequenceNumber > this.$r && (this.$r = e.sequenceNumber);
|
|
11368
11360
|
}
|
|
11369
11361
|
addTargetData(e, t) {
|
|
@@ -11373,7 +11365,7 @@ class __PRIVATE_MemoryRemoteDocumentChangeBuffer extends RemoteDocumentChangeBuf
|
|
|
11373
11365
|
return this.zn(t), PersistencePromise.resolve();
|
|
11374
11366
|
}
|
|
11375
11367
|
removeTargetData(e, t) {
|
|
11376
|
-
return this.Qr.delete(t.target), this.
|
|
11368
|
+
return this.Qr.delete(t.target), this.Kr.Sr(t.targetId), this.targetCount -= 1,
|
|
11377
11369
|
PersistencePromise.resolve();
|
|
11378
11370
|
}
|
|
11379
11371
|
removeTargets(e, t, n) {
|
|
@@ -11392,24 +11384,24 @@ class __PRIVATE_MemoryRemoteDocumentChangeBuffer extends RemoteDocumentChangeBuf
|
|
|
11392
11384
|
return PersistencePromise.resolve(n);
|
|
11393
11385
|
}
|
|
11394
11386
|
addMatchingKeys(e, t, n) {
|
|
11395
|
-
return this.
|
|
11387
|
+
return this.Kr.yr(t, n), PersistencePromise.resolve();
|
|
11396
11388
|
}
|
|
11397
11389
|
removeMatchingKeys(e, t, n) {
|
|
11398
|
-
this.
|
|
11390
|
+
this.Kr.br(t, n);
|
|
11399
11391
|
const r = this.persistence.referenceDelegate, i = [];
|
|
11400
11392
|
return r && t.forEach((t => {
|
|
11401
11393
|
i.push(r.markPotentiallyOrphaned(e, t));
|
|
11402
11394
|
})), PersistencePromise.waitFor(i);
|
|
11403
11395
|
}
|
|
11404
11396
|
removeMatchingKeysForTargetId(e, t) {
|
|
11405
|
-
return this.
|
|
11397
|
+
return this.Kr.Sr(t), PersistencePromise.resolve();
|
|
11406
11398
|
}
|
|
11407
11399
|
getMatchingKeysForTargetId(e, t) {
|
|
11408
|
-
const n = this.
|
|
11400
|
+
const n = this.Kr.vr(t);
|
|
11409
11401
|
return PersistencePromise.resolve(n);
|
|
11410
11402
|
}
|
|
11411
11403
|
containsKey(e, t) {
|
|
11412
|
-
return PersistencePromise.resolve(this.
|
|
11404
|
+
return PersistencePromise.resolve(this.Kr.containsKey(t));
|
|
11413
11405
|
}
|
|
11414
11406
|
}
|
|
11415
11407
|
|
|
@@ -11537,7 +11529,7 @@ class __PRIVATE_MemoryEagerDelegate {
|
|
|
11537
11529
|
return this.ii.add(t.toString()), PersistencePromise.resolve();
|
|
11538
11530
|
}
|
|
11539
11531
|
removeTarget(e, t) {
|
|
11540
|
-
this.ti.
|
|
11532
|
+
this.ti.Sr(t.targetId).forEach((e => this.ii.add(e.toString())));
|
|
11541
11533
|
const n = this.persistence.getTargetCache();
|
|
11542
11534
|
return n.getMatchingKeysForTargetId(e, t.targetId).next((e => {
|
|
11543
11535
|
e.forEach((e => this.ii.add(e.toString())));
|
|
@@ -11670,7 +11662,7 @@ class __PRIVATE_MemoryLruDelegate {
|
|
|
11670
11662
|
*/ B(e, t, n, r) {
|
|
11671
11663
|
const i = new __PRIVATE_SimpleDbTransaction("createOrUpgrade", t);
|
|
11672
11664
|
n < 1 && r >= 1 && (!function __PRIVATE_createPrimaryClientStore(e) {
|
|
11673
|
-
e.createObjectStore(
|
|
11665
|
+
e.createObjectStore(U);
|
|
11674
11666
|
}(e), function __PRIVATE_createMutationQueue(e) {
|
|
11675
11667
|
e.createObjectStore(G, {
|
|
11676
11668
|
keyPath: z
|
|
@@ -11687,7 +11679,7 @@ class __PRIVATE_MemoryLruDelegate {
|
|
|
11687
11679
|
* Upgrade function to migrate the 'mutations' store from V1 to V3. Loads
|
|
11688
11680
|
* and rewrites all data.
|
|
11689
11681
|
*/ (e), __PRIVATE_createQueryCache(e), function __PRIVATE_createLegacyRemoteDocumentCache(e) {
|
|
11690
|
-
e.createObjectStore(
|
|
11682
|
+
e.createObjectStore(K);
|
|
11691
11683
|
}(e));
|
|
11692
11684
|
// Migration 2 to populate the targetGlobal object no longer needed since
|
|
11693
11685
|
// migration 3 unconditionally clears it.
|
|
@@ -11775,13 +11767,13 @@ class __PRIVATE_MemoryLruDelegate {
|
|
|
11775
11767
|
keyPath: te
|
|
11776
11768
|
});
|
|
11777
11769
|
t.createIndex(ne, re), t.createIndex(ie, se);
|
|
11778
|
-
}(e))).next((() => this.hi(e, i))).next((() => e.deleteObjectStore(
|
|
11770
|
+
}(e))).next((() => this.hi(e, i))).next((() => e.deleteObjectStore(K)))), n < 14 && r >= 14 && (s = s.next((() => this.Pi(e, i)))),
|
|
11779
11771
|
n < 15 && r >= 15 && (s = s.next((() => function __PRIVATE_createFieldIndex(e) {
|
|
11780
11772
|
const t = e.createObjectStore(ye, {
|
|
11781
11773
|
keyPath: we,
|
|
11782
11774
|
autoIncrement: !0
|
|
11783
11775
|
});
|
|
11784
|
-
t.createIndex(
|
|
11776
|
+
t.createIndex(be, Se, {
|
|
11785
11777
|
unique: !1
|
|
11786
11778
|
});
|
|
11787
11779
|
const n = e.createObjectStore(De, {
|
|
@@ -11804,15 +11796,15 @@ class __PRIVATE_MemoryLruDelegate {
|
|
|
11804
11796
|
t.objectStore(Me).clear();
|
|
11805
11797
|
}))), n < 17 && r >= 17 && (s = s.next((() => {
|
|
11806
11798
|
!function __PRIVATE_createGlobalsStore(e) {
|
|
11807
|
-
e.createObjectStore(
|
|
11808
|
-
keyPath:
|
|
11799
|
+
e.createObjectStore(Ke, {
|
|
11800
|
+
keyPath: Ue
|
|
11809
11801
|
});
|
|
11810
11802
|
}(e);
|
|
11811
11803
|
}))), s;
|
|
11812
11804
|
}
|
|
11813
11805
|
ai(e) {
|
|
11814
11806
|
let t = 0;
|
|
11815
|
-
return e.store(
|
|
11807
|
+
return e.store(K).Z(((e, n) => {
|
|
11816
11808
|
t += __PRIVATE_dbDocumentSize(n);
|
|
11817
11809
|
})).next((() => {
|
|
11818
11810
|
const n = {
|
|
@@ -11836,7 +11828,7 @@ class __PRIVATE_MemoryLruDelegate {
|
|
|
11836
11828
|
* Ensures that every document in the remote document cache has a corresponding sentinel row
|
|
11837
11829
|
* with a sequence number. Missing rows are given the most recently used sequence number.
|
|
11838
11830
|
*/ ui(e) {
|
|
11839
|
-
const t = e.store(le), n = e.store(
|
|
11831
|
+
const t = e.store(le), n = e.store(K);
|
|
11840
11832
|
return e.store(Ee).get(Ie).next((e => {
|
|
11841
11833
|
const r = [];
|
|
11842
11834
|
return n.Z(((n, i) => {
|
|
@@ -11867,7 +11859,7 @@ class __PRIVATE_MemoryLruDelegate {
|
|
|
11867
11859
|
};
|
|
11868
11860
|
// Helper to add an index entry iff we haven't already written it.
|
|
11869
11861
|
// Index existing remote documents.
|
|
11870
|
-
return t.store(
|
|
11862
|
+
return t.store(K).Z({
|
|
11871
11863
|
Y: !0
|
|
11872
11864
|
}, ((e, t) => {
|
|
11873
11865
|
const n = new ResourcePath(e);
|
|
@@ -11887,7 +11879,7 @@ class __PRIVATE_MemoryLruDelegate {
|
|
|
11887
11879
|
}));
|
|
11888
11880
|
}
|
|
11889
11881
|
hi(e, t) {
|
|
11890
|
-
const n = t.store(
|
|
11882
|
+
const n = t.store(K), r = [];
|
|
11891
11883
|
return n.Z(((e, n) => {
|
|
11892
11884
|
const i = t.store(ee), s = function __PRIVATE_extractKey(e) {
|
|
11893
11885
|
return e.document ? new DocumentKey(ResourcePath.fromString(e.document.name).popFirst(5)) : e.noDocument ? DocumentKey.fromSegments(e.noDocument.path) : e.unknownDocument ? DocumentKey.fromSegments(e.unknownDocument.path) : fail();
|
|
@@ -12048,7 +12040,7 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
12048
12040
|
// Fail `start()` if `synchronizeTabs` is disabled and we cannot
|
|
12049
12041
|
// obtain the primary lease.
|
|
12050
12042
|
throw new FirestoreError(C.FAILED_PRECONDITION, Mt);
|
|
12051
|
-
return this.
|
|
12043
|
+
return this.bi(), this.Si(), this.Di(), this.runTransaction("getHighestListenSequenceNumber", "readonly", (e => this.Hr.getHighestSequenceNumber(e)));
|
|
12052
12044
|
})).then((e => {
|
|
12053
12045
|
this.Gr = new __PRIVATE_ListenSequence(e, this.Ii);
|
|
12054
12046
|
})).then((() => {
|
|
@@ -12205,11 +12197,11 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
12205
12197
|
async shutdown() {
|
|
12206
12198
|
// The shutdown() operations are idempotent and can be called even when
|
|
12207
12199
|
// start() aborted (e.g. because it couldn't acquire the persistence lease).
|
|
12208
|
-
this.zr = !1, this.
|
|
12200
|
+
this.zr = !1, this.Ki(), this.Vi && (this.Vi.cancel(), this.Vi = null), this.Ui(),
|
|
12209
12201
|
this.Wi(),
|
|
12210
12202
|
// Use `SimpleDb.runTransaction` directly to avoid failing if another tab
|
|
12211
12203
|
// has obtained the primary lease.
|
|
12212
|
-
await this.pi.runTransaction("shutdown", "readwrite", [
|
|
12204
|
+
await this.pi.runTransaction("shutdown", "readwrite", [ U, Re ], (e => {
|
|
12213
12205
|
const t = new __PRIVATE_IndexedDbTransaction(e, __PRIVATE_ListenSequence.ae);
|
|
12214
12206
|
return this.xi(t).next((() => this.Bi(t)));
|
|
12215
12207
|
})), this.pi.close(),
|
|
@@ -12309,13 +12301,13 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
12309
12301
|
return !(e < n - t) && (!(e > n) || (__PRIVATE_logError(`Detected an update time that is in the future: ${e} > ${n}`),
|
|
12310
12302
|
!1));
|
|
12311
12303
|
}
|
|
12312
|
-
|
|
12304
|
+
bi() {
|
|
12313
12305
|
null !== this.document && "function" == typeof this.document.addEventListener && (this.Ri = () => {
|
|
12314
12306
|
this.Ti.enqueueAndForget((() => (this.inForeground = "visible" === this.document.visibilityState,
|
|
12315
12307
|
this.wi())));
|
|
12316
12308
|
}, this.document.addEventListener("visibilitychange", this.Ri), this.inForeground = "visible" === this.document.visibilityState);
|
|
12317
12309
|
}
|
|
12318
|
-
|
|
12310
|
+
Ui() {
|
|
12319
12311
|
this.Ri && (this.document.removeEventListener("visibilitychange", this.Ri), this.Ri = null);
|
|
12320
12312
|
}
|
|
12321
12313
|
/**
|
|
@@ -12327,13 +12319,13 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
12327
12319
|
* primary lease). LocalStorage is used for this rather than IndexedDb because
|
|
12328
12320
|
* it is a synchronous API and so can be used reliably from an unload
|
|
12329
12321
|
* handler.
|
|
12330
|
-
*/
|
|
12322
|
+
*/ Si() {
|
|
12331
12323
|
var e;
|
|
12332
12324
|
"function" == typeof (null === (e = this.window) || void 0 === e ? void 0 : e.addEventListener) && (this.Ai = () => {
|
|
12333
12325
|
// Note: In theory, this should be scheduled on the AsyncQueue since it
|
|
12334
12326
|
// accesses internal state. We execute this code directly during shutdown
|
|
12335
12327
|
// to make sure it gets a chance to run.
|
|
12336
|
-
this.
|
|
12328
|
+
this.Ki();
|
|
12337
12329
|
const e = /(?:Version|Mobile)\/1[456]/;
|
|
12338
12330
|
util.isSafari() && (navigator.appVersion.match(e) || navigator.userAgent.match(e)) &&
|
|
12339
12331
|
// On Safari 14, 15, and 16, we do not run any cleanup actions as it might
|
|
@@ -12364,7 +12356,7 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
12364
12356
|
/**
|
|
12365
12357
|
* Record client as zombied (a client that had its tab closed). Zombied
|
|
12366
12358
|
* clients are ignored during primary tab selection.
|
|
12367
|
-
*/
|
|
12359
|
+
*/ Ki() {
|
|
12368
12360
|
if (this.yi) try {
|
|
12369
12361
|
this.yi.setItem(this.Qi(this.clientId), String(Date.now()));
|
|
12370
12362
|
} catch (e) {
|
|
@@ -12387,7 +12379,7 @@ class __PRIVATE_IndexedDbPersistence {
|
|
|
12387
12379
|
/**
|
|
12388
12380
|
* Helper to get a typed SimpleDbStore for the primary client object store.
|
|
12389
12381
|
*/ function __PRIVATE_primaryClientStore(e) {
|
|
12390
|
-
return __PRIVATE_getStore(e,
|
|
12382
|
+
return __PRIVATE_getStore(e, U);
|
|
12391
12383
|
}
|
|
12392
12384
|
|
|
12393
12385
|
/**
|
|
@@ -13242,14 +13234,14 @@ class __PRIVATE_MutationMetadata {
|
|
|
13242
13234
|
/**
|
|
13243
13235
|
* Parses a MutationMetadata from its JSON representation in WebStorage.
|
|
13244
13236
|
* Logs a warning and returns null if the format of the data is not valid.
|
|
13245
|
-
*/ static
|
|
13237
|
+
*/ static bs(e, t, n) {
|
|
13246
13238
|
const r = JSON.parse(n);
|
|
13247
13239
|
let i, s = "object" == typeof r && -1 !== [ "pending", "acknowledged", "rejected" ].indexOf(r.state) && (void 0 === r.error || "object" == typeof r.error);
|
|
13248
13240
|
return s && r.error && (s = "string" == typeof r.error.message && "string" == typeof r.error.code,
|
|
13249
13241
|
s && (i = new FirestoreError(r.error.code, r.error.message))), s ? new __PRIVATE_MutationMetadata(e, t, r.state, i) : (__PRIVATE_logError(qt, `Failed to parse mutation state for ID '${t}': ${n}`),
|
|
13250
13242
|
null);
|
|
13251
13243
|
}
|
|
13252
|
-
|
|
13244
|
+
Ss() {
|
|
13253
13245
|
const e = {
|
|
13254
13246
|
state: this.state,
|
|
13255
13247
|
updateTimeMs: Date.now()
|
|
@@ -13273,14 +13265,14 @@ class __PRIVATE_QueryTargetMetadata {
|
|
|
13273
13265
|
/**
|
|
13274
13266
|
* Parses a QueryTargetMetadata from its JSON representation in WebStorage.
|
|
13275
13267
|
* Logs a warning and returns null if the format of the data is not valid.
|
|
13276
|
-
*/ static
|
|
13268
|
+
*/ static bs(e, t) {
|
|
13277
13269
|
const n = JSON.parse(t);
|
|
13278
13270
|
let r, i = "object" == typeof n && -1 !== [ "not-current", "current", "rejected" ].indexOf(n.state) && (void 0 === n.error || "object" == typeof n.error);
|
|
13279
13271
|
return i && n.error && (i = "string" == typeof n.error.message && "string" == typeof n.error.code,
|
|
13280
13272
|
i && (r = new FirestoreError(n.error.code, n.error.message))), i ? new __PRIVATE_QueryTargetMetadata(e, n.state, r) : (__PRIVATE_logError(qt, `Failed to parse target state for ID '${e}': ${t}`),
|
|
13281
13273
|
null);
|
|
13282
13274
|
}
|
|
13283
|
-
|
|
13275
|
+
Ss() {
|
|
13284
13276
|
const e = {
|
|
13285
13277
|
state: this.state,
|
|
13286
13278
|
updateTimeMs: Date.now()
|
|
@@ -13302,7 +13294,7 @@ class __PRIVATE_QueryTargetMetadata {
|
|
|
13302
13294
|
/**
|
|
13303
13295
|
* Parses a RemoteClientState from the JSON representation in WebStorage.
|
|
13304
13296
|
* Logs a warning and returns null if the format of the data is not valid.
|
|
13305
|
-
*/ static
|
|
13297
|
+
*/ static bs(e, t) {
|
|
13306
13298
|
const n = JSON.parse(t);
|
|
13307
13299
|
let r = "object" == typeof n && n.activeTargetIds instanceof Array, i = __PRIVATE_targetIdSet();
|
|
13308
13300
|
for (let e = 0; r && e < n.activeTargetIds.length; ++e) r = isSafeInteger(n.activeTargetIds[e]),
|
|
@@ -13323,7 +13315,7 @@ class __PRIVATE_QueryTargetMetadata {
|
|
|
13323
13315
|
/**
|
|
13324
13316
|
* Parses a SharedOnlineState from its JSON representation in WebStorage.
|
|
13325
13317
|
* Logs a warning and returns null if the format of the data is not valid.
|
|
13326
|
-
*/ static
|
|
13318
|
+
*/ static bs(e) {
|
|
13327
13319
|
const t = JSON.parse(e);
|
|
13328
13320
|
return "object" == typeof t && -1 !== [ "Unknown", "Online", "Offline" ].indexOf(t.onlineState) && "string" == typeof t.clientId ? new __PRIVATE_SharedOnlineState(t.clientId, t.onlineState) : (__PRIVATE_logError(qt, `Failed to parse online state: ${e}`),
|
|
13329
13321
|
null);
|
|
@@ -13354,7 +13346,7 @@ class __PRIVATE_LocalClientState {
|
|
|
13354
13346
|
/**
|
|
13355
13347
|
* Converts this entry into a JSON-encoded format we can use for WebStorage.
|
|
13356
13348
|
* Does not encode `clientId` as it is part of the key in WebStorage.
|
|
13357
|
-
*/
|
|
13349
|
+
*/ Ss() {
|
|
13358
13350
|
const e = {
|
|
13359
13351
|
activeTargetIds: this.activeTargetIds.toArray(),
|
|
13360
13352
|
updateTimeMs: Date.now()
|
|
@@ -13422,16 +13414,16 @@ class __PRIVATE_LocalClientState {
|
|
|
13422
13414
|
if (t === this.Cs) continue;
|
|
13423
13415
|
const e = this.getItem(createWebStorageClientStateKey(this.persistenceKey, t));
|
|
13424
13416
|
if (e) {
|
|
13425
|
-
const n = __PRIVATE_RemoteClientState.
|
|
13417
|
+
const n = __PRIVATE_RemoteClientState.bs(t, e);
|
|
13426
13418
|
n && (this.xs = this.xs.insert(n.clientId, n));
|
|
13427
13419
|
}
|
|
13428
13420
|
}
|
|
13429
|
-
this.
|
|
13421
|
+
this.Ks();
|
|
13430
13422
|
// Check if there is an existing online state and call the callback handler
|
|
13431
13423
|
// if applicable.
|
|
13432
13424
|
const t = this.storage.getItem(this.Qs);
|
|
13433
13425
|
if (t) {
|
|
13434
|
-
const e = this.
|
|
13426
|
+
const e = this.Us(t);
|
|
13435
13427
|
e && this.Ws(e);
|
|
13436
13428
|
}
|
|
13437
13429
|
for (const e of this.Os) this.Ms(e);
|
|
@@ -13469,16 +13461,16 @@ class __PRIVATE_LocalClientState {
|
|
|
13469
13461
|
if (this.isActiveQueryTarget(e)) {
|
|
13470
13462
|
const t = this.storage.getItem(createWebStorageQueryTargetMetadataKey(this.persistenceKey, e));
|
|
13471
13463
|
if (t) {
|
|
13472
|
-
const r = __PRIVATE_QueryTargetMetadata.
|
|
13464
|
+
const r = __PRIVATE_QueryTargetMetadata.bs(e, t);
|
|
13473
13465
|
r && (n = r.state);
|
|
13474
13466
|
}
|
|
13475
13467
|
}
|
|
13476
13468
|
// If the query is listening to cache only, the target ID should not be registered with the
|
|
13477
13469
|
// local Firestore client as an active watch target.
|
|
13478
|
-
return t && this.Hs.Ds(e), this.
|
|
13470
|
+
return t && this.Hs.Ds(e), this.Ks(), n;
|
|
13479
13471
|
}
|
|
13480
13472
|
removeLocalQueryTarget(e) {
|
|
13481
|
-
this.Hs.vs(e), this.
|
|
13473
|
+
this.Hs.vs(e), this.Ks();
|
|
13482
13474
|
}
|
|
13483
13475
|
isLocalQueryTarget(e) {
|
|
13484
13476
|
return this.Hs.activeTargetIds.has(e);
|
|
@@ -13545,7 +13537,7 @@ class __PRIVATE_LocalClientState {
|
|
|
13545
13537
|
}
|
|
13546
13538
|
} else if (t.key === this.Qs) {
|
|
13547
13539
|
if (null !== t.newValue) {
|
|
13548
|
-
const e = this.
|
|
13540
|
+
const e = this.Us(t.newValue);
|
|
13549
13541
|
if (e) return this.Ws(e);
|
|
13550
13542
|
}
|
|
13551
13543
|
} else if (t.key === this.Bs) {
|
|
@@ -13576,12 +13568,12 @@ class __PRIVATE_LocalClientState {
|
|
|
13576
13568
|
get Hs() {
|
|
13577
13569
|
return this.xs.get(this.Cs);
|
|
13578
13570
|
}
|
|
13579
|
-
|
|
13580
|
-
this.setItem(this.Ns, this.Hs.
|
|
13571
|
+
Ks() {
|
|
13572
|
+
this.setItem(this.Ns, this.Hs.Ss());
|
|
13581
13573
|
}
|
|
13582
13574
|
zs(e, t, n) {
|
|
13583
13575
|
const r = new __PRIVATE_MutationMetadata(this.currentUser, e, t, n), i = createWebStorageMutationBatchKey(this.persistenceKey, this.currentUser, e);
|
|
13584
|
-
this.setItem(i, r.
|
|
13576
|
+
this.setItem(i, r.Ss());
|
|
13585
13577
|
}
|
|
13586
13578
|
js(e) {
|
|
13587
13579
|
const t = createWebStorageMutationBatchKey(this.persistenceKey, this.currentUser, e);
|
|
@@ -13596,7 +13588,7 @@ class __PRIVATE_LocalClientState {
|
|
|
13596
13588
|
}
|
|
13597
13589
|
Js(e, t, n) {
|
|
13598
13590
|
const r = createWebStorageQueryTargetMetadataKey(this.persistenceKey, e), i = new __PRIVATE_QueryTargetMetadata(e, t, n);
|
|
13599
|
-
this.setItem(r, i.
|
|
13591
|
+
this.setItem(r, i.Ss());
|
|
13600
13592
|
}
|
|
13601
13593
|
Zs(e) {
|
|
13602
13594
|
const t = JSON.stringify(Array.from(e));
|
|
@@ -13614,27 +13606,27 @@ class __PRIVATE_LocalClientState {
|
|
|
13614
13606
|
* be parsed.
|
|
13615
13607
|
*/ no(e, t) {
|
|
13616
13608
|
const n = this.Xs(e);
|
|
13617
|
-
return __PRIVATE_RemoteClientState.
|
|
13609
|
+
return __PRIVATE_RemoteClientState.bs(n, t);
|
|
13618
13610
|
}
|
|
13619
13611
|
/**
|
|
13620
13612
|
* Parses a mutation batch state in WebStorage. Returns 'null' if the value
|
|
13621
13613
|
* could not be parsed.
|
|
13622
13614
|
*/ ro(e, t) {
|
|
13623
13615
|
const n = this.ks.exec(e), r = Number(n[1]), i = void 0 !== n[2] ? n[2] : null;
|
|
13624
|
-
return __PRIVATE_MutationMetadata.
|
|
13616
|
+
return __PRIVATE_MutationMetadata.bs(new User(i), r, t);
|
|
13625
13617
|
}
|
|
13626
13618
|
/**
|
|
13627
13619
|
* Parses a query target state from WebStorage. Returns 'null' if the value
|
|
13628
13620
|
* could not be parsed.
|
|
13629
13621
|
*/ so(e, t) {
|
|
13630
13622
|
const n = this.qs.exec(e), r = Number(n[1]);
|
|
13631
|
-
return __PRIVATE_QueryTargetMetadata.
|
|
13623
|
+
return __PRIVATE_QueryTargetMetadata.bs(r, t);
|
|
13632
13624
|
}
|
|
13633
13625
|
/**
|
|
13634
13626
|
* Parses an online state from WebStorage. Returns 'null' if the value
|
|
13635
13627
|
* could not be parsed.
|
|
13636
|
-
*/
|
|
13637
|
-
return __PRIVATE_SharedOnlineState.
|
|
13628
|
+
*/ Us(e) {
|
|
13629
|
+
return __PRIVATE_SharedOnlineState.bs(e);
|
|
13638
13630
|
}
|
|
13639
13631
|
_o(e) {
|
|
13640
13632
|
return JSON.parse(e);
|
|
@@ -13858,7 +13850,7 @@ function __PRIVATE_generateUniqueDebugId() {
|
|
|
13858
13850
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13859
13851
|
* See the License for the specific language governing permissions and
|
|
13860
13852
|
* limitations under the License.
|
|
13861
|
-
*/ const
|
|
13853
|
+
*/ const Kt = "RestConnection", Ut = {
|
|
13862
13854
|
BatchGetDocuments: "batchGet",
|
|
13863
13855
|
Commit: "commit",
|
|
13864
13856
|
RunQuery: "runQuery",
|
|
@@ -13885,23 +13877,23 @@ class __PRIVATE_RestConnection {
|
|
|
13885
13877
|
const t = e.ssl ? "https" : "http", n = encodeURIComponent(this.databaseId.projectId), r = encodeURIComponent(this.databaseId.database);
|
|
13886
13878
|
this.po = t + "://" + e.host, this.yo = `projects/${n}/databases/${r}`, this.wo = this.databaseId.database === rt ? `project_id=${n}` : `project_id=${n}&database_id=${r}`;
|
|
13887
13879
|
}
|
|
13888
|
-
|
|
13889
|
-
const s = __PRIVATE_generateUniqueDebugId(), o = this.
|
|
13890
|
-
__PRIVATE_logDebug(
|
|
13880
|
+
bo(e, t, n, r, i) {
|
|
13881
|
+
const s = __PRIVATE_generateUniqueDebugId(), o = this.So(e, t.toUriEncodedString());
|
|
13882
|
+
__PRIVATE_logDebug(Kt, `Sending RPC '${e}' ${s}:`, o, n);
|
|
13891
13883
|
const _ = {
|
|
13892
13884
|
"google-cloud-resource-prefix": this.yo,
|
|
13893
13885
|
"x-goog-request-params": this.wo
|
|
13894
13886
|
};
|
|
13895
|
-
return this.Do(_, r, i), this.vo(e, o, _, n).then((t => (__PRIVATE_logDebug(
|
|
13887
|
+
return this.Do(_, r, i), this.vo(e, o, _, n).then((t => (__PRIVATE_logDebug(Kt, `Received RPC '${e}' ${s}: `, t),
|
|
13896
13888
|
t)), (t => {
|
|
13897
|
-
throw __PRIVATE_logWarn(
|
|
13889
|
+
throw __PRIVATE_logWarn(Kt, `RPC '${e}' ${s} failed with error: `, t, "url: ", o, "request:", n),
|
|
13898
13890
|
t;
|
|
13899
13891
|
}));
|
|
13900
13892
|
}
|
|
13901
13893
|
Co(e, t, n, r, i, s) {
|
|
13902
13894
|
// The REST API automatically aggregates all of the streamed results, so we
|
|
13903
13895
|
// can just use the normal invoke() method.
|
|
13904
|
-
return this.
|
|
13896
|
+
return this.bo(e, t, n, r, i);
|
|
13905
13897
|
}
|
|
13906
13898
|
/**
|
|
13907
13899
|
* Modifies the headers for a request, adding any authorization token if
|
|
@@ -13920,8 +13912,8 @@ class __PRIVATE_RestConnection {
|
|
|
13920
13912
|
e["Content-Type"] = "text/plain", this.databaseInfo.appId && (e["X-Firebase-GMPID"] = this.databaseInfo.appId),
|
|
13921
13913
|
t && t.headers.forEach(((t, n) => e[n] = t)), n && n.headers.forEach(((t, n) => e[n] = t));
|
|
13922
13914
|
}
|
|
13923
|
-
|
|
13924
|
-
const n =
|
|
13915
|
+
So(e, t) {
|
|
13916
|
+
const n = Ut[e];
|
|
13925
13917
|
return `${this.po}/v1/${t}:${n}`;
|
|
13926
13918
|
}
|
|
13927
13919
|
/**
|
|
@@ -13981,10 +13973,10 @@ class __PRIVATE_RestConnection {
|
|
|
13981
13973
|
$o() {
|
|
13982
13974
|
this.Bo();
|
|
13983
13975
|
}
|
|
13984
|
-
|
|
13976
|
+
Ko(e) {
|
|
13985
13977
|
this.ko(e);
|
|
13986
13978
|
}
|
|
13987
|
-
|
|
13979
|
+
Uo(e) {
|
|
13988
13980
|
this.qo(e);
|
|
13989
13981
|
}
|
|
13990
13982
|
}
|
|
@@ -14136,10 +14128,10 @@ class __PRIVATE_WebChannelConnection extends __PRIVATE_RestConnection {
|
|
|
14136
14128
|
h || (__PRIVATE_logDebug(Wt, `RPC '${e}' stream ${r} transport opened.`), P.Qo());
|
|
14137
14129
|
})), __PRIVATE_unguardedEventListen(c, webchannelBlob.WebChannel.EventType.CLOSE, (() => {
|
|
14138
14130
|
h || (h = !0, __PRIVATE_logDebug(Wt, `RPC '${e}' stream ${r} transport closed`),
|
|
14139
|
-
P.
|
|
14131
|
+
P.Ko());
|
|
14140
14132
|
})), __PRIVATE_unguardedEventListen(c, webchannelBlob.WebChannel.EventType.ERROR, (t => {
|
|
14141
14133
|
h || (h = !0, __PRIVATE_logWarn(Wt, `RPC '${e}' stream ${r} transport errored:`, t),
|
|
14142
|
-
P.
|
|
14134
|
+
P.Ko(new FirestoreError(C.UNAVAILABLE, "The operation could not be completed")));
|
|
14143
14135
|
})), __PRIVATE_unguardedEventListen(c, webchannelBlob.WebChannel.EventType.MESSAGE, (t => {
|
|
14144
14136
|
var n;
|
|
14145
14137
|
if (!h) {
|
|
@@ -14170,8 +14162,8 @@ class __PRIVATE_WebChannelConnection extends __PRIVATE_RestConnection {
|
|
|
14170
14162
|
}(t), i = o.message;
|
|
14171
14163
|
void 0 === n && (n = C.INTERNAL, i = "Unknown error status: " + t + " with message " + o.message),
|
|
14172
14164
|
// Mark closed so no further events are propagated
|
|
14173
|
-
h = !0, P.
|
|
14174
|
-
} else __PRIVATE_logDebug(Wt, `RPC '${e}' stream ${r} received:`, i), P.
|
|
14165
|
+
h = !0, P.Ko(new FirestoreError(n, i)), c.close();
|
|
14166
|
+
} else __PRIVATE_logDebug(Wt, `RPC '${e}' stream ${r} received:`, i), P.Uo(i);
|
|
14175
14167
|
}
|
|
14176
14168
|
})), __PRIVATE_unguardedEventListen(o, webchannelBlob.Event.STAT_EVENT, (t => {
|
|
14177
14169
|
t.stat === webchannelBlob.Stat.PROXY ? __PRIVATE_logDebug(Wt, `RPC '${e}' stream ${r} detected buffering proxy`) : t.stat === webchannelBlob.Stat.NOPROXY && __PRIVATE_logDebug(Wt, `RPC '${e}' stream ${r} detected no buffering proxy`);
|
|
@@ -14682,7 +14674,7 @@ class __PRIVATE_PersistentStream {
|
|
|
14682
14674
|
/**
|
|
14683
14675
|
* Tracks whether or not a handshake has been successfully exchanged and
|
|
14684
14676
|
* the stream is ready to accept mutations.
|
|
14685
|
-
*/ get
|
|
14677
|
+
*/ get b_() {
|
|
14686
14678
|
return this.__ > 0;
|
|
14687
14679
|
}
|
|
14688
14680
|
// Override of PersistentStream.start
|
|
@@ -14690,7 +14682,7 @@ class __PRIVATE_PersistentStream {
|
|
|
14690
14682
|
this.lastStreamToken = void 0, super.start();
|
|
14691
14683
|
}
|
|
14692
14684
|
A_() {
|
|
14693
|
-
this.
|
|
14685
|
+
this.b_ && this.S_([]);
|
|
14694
14686
|
}
|
|
14695
14687
|
f_(e, t) {
|
|
14696
14688
|
return this.connection.Wo("Write", e, t);
|
|
@@ -14721,7 +14713,7 @@ class __PRIVATE_PersistentStream {
|
|
|
14721
14713
|
const e = {};
|
|
14722
14714
|
e.database = __PRIVATE_getEncodedDatabaseId(this.serializer), this.I_(e);
|
|
14723
14715
|
}
|
|
14724
|
-
/** Sends a group of mutations to the Firestore backend to apply. */
|
|
14716
|
+
/** Sends a group of mutations to the Firestore backend to apply. */ S_(e) {
|
|
14725
14717
|
const t = {
|
|
14726
14718
|
streamToken: this.lastStreamToken,
|
|
14727
14719
|
writes: e.map((e => toMutation(this.serializer, e)))
|
|
@@ -14763,8 +14755,8 @@ class __PRIVATE_PersistentStream {
|
|
|
14763
14755
|
M_() {
|
|
14764
14756
|
if (this.F_) throw new FirestoreError(C.FAILED_PRECONDITION, "The client has already been terminated.");
|
|
14765
14757
|
}
|
|
14766
|
-
/** Invokes the provided RPC with auth and AppCheck tokens. */
|
|
14767
|
-
return this.M_(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([i, s]) => this.connection.
|
|
14758
|
+
/** Invokes the provided RPC with auth and AppCheck tokens. */ bo(e, t, n, r) {
|
|
14759
|
+
return this.M_(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([i, s]) => this.connection.bo(e, __PRIVATE_toResourcePath(t, n), r, i, s))).catch((e => {
|
|
14768
14760
|
throw "FirebaseError" === e.name ? (e.code === C.UNAUTHENTICATED && (this.authCredentials.invalidateToken(),
|
|
14769
14761
|
this.appCheckCredentials.invalidateToken()), e) : new FirestoreError(C.UNKNOWN, e.toString());
|
|
14770
14762
|
}));
|
|
@@ -14906,7 +14898,7 @@ class __PRIVATE_RemoteStoreImpl {
|
|
|
14906
14898
|
* purely based on order, and so we can just shift() writes from the front of
|
|
14907
14899
|
* the writePipeline as we receive responses.
|
|
14908
14900
|
*/
|
|
14909
|
-
this.
|
|
14901
|
+
this.K_ = [],
|
|
14910
14902
|
/**
|
|
14911
14903
|
* A mapping of watched targets that the client cares about tracking and the
|
|
14912
14904
|
* user has explicitly called a 'listen' for this target.
|
|
@@ -14916,7 +14908,7 @@ class __PRIVATE_RemoteStoreImpl {
|
|
|
14916
14908
|
* to the server. The targets removed with unlistens are removed eagerly
|
|
14917
14909
|
* without waiting for confirmation from the listen stream.
|
|
14918
14910
|
*/
|
|
14919
|
-
this.
|
|
14911
|
+
this.U_ = new Map,
|
|
14920
14912
|
/**
|
|
14921
14913
|
* A set of reasons for why the RemoteStore may be offline. If empty, the
|
|
14922
14914
|
* RemoteStore may start its network connections.
|
|
@@ -14963,9 +14955,9 @@ async function __PRIVATE_enableNetworkInternal(e) {
|
|
|
14963
14955
|
*/
|
|
14964
14956
|
function __PRIVATE_remoteStoreListen(e, t) {
|
|
14965
14957
|
const n = __PRIVATE_debugCast(e);
|
|
14966
|
-
n.
|
|
14958
|
+
n.U_.has(t.targetId) || (
|
|
14967
14959
|
// Mark this as something the client is currently listening for.
|
|
14968
|
-
n.
|
|
14960
|
+
n.U_.set(t.targetId, t), __PRIVATE_shouldStartWatchStream(n) ?
|
|
14969
14961
|
// The listen will be sent in onWatchStreamOpen
|
|
14970
14962
|
__PRIVATE_startWatchStream(n) : __PRIVATE_ensureWatchStream(n).c_() && __PRIVATE_sendWatchRequest(n, t));
|
|
14971
14963
|
}
|
|
@@ -14975,7 +14967,7 @@ function __PRIVATE_remoteStoreListen(e, t) {
|
|
|
14975
14967
|
* not being listened to.
|
|
14976
14968
|
*/ function __PRIVATE_remoteStoreUnlisten(e, t) {
|
|
14977
14969
|
const n = __PRIVATE_debugCast(e), r = __PRIVATE_ensureWatchStream(n);
|
|
14978
|
-
n.
|
|
14970
|
+
n.U_.delete(t), r.c_() && __PRIVATE_sendUnwatchRequest(n, t), 0 === n.U_.size && (r.c_() ? r.P_() : __PRIVATE_canUseNetwork(n) &&
|
|
14979
14971
|
// Revert to OnlineState.Unknown if the watch stream is not open and we
|
|
14980
14972
|
// have no listeners, since without any listens to send we cannot
|
|
14981
14973
|
// confirm if the stream is healthy and upgrade to OnlineState.Online.
|
|
@@ -15004,7 +14996,7 @@ function __PRIVATE_remoteStoreListen(e, t) {
|
|
|
15004
14996
|
function __PRIVATE_startWatchStream(e) {
|
|
15005
14997
|
e.H_ = new __PRIVATE_WatchChangeAggregator({
|
|
15006
14998
|
getRemoteKeysForTarget: t => e.remoteSyncer.getRemoteKeysForTarget(t),
|
|
15007
|
-
lt: t => e.
|
|
14999
|
+
lt: t => e.U_.get(t) || null,
|
|
15008
15000
|
it: () => e.datastore.serializer.databaseId
|
|
15009
15001
|
}), __PRIVATE_ensureWatchStream(e).start(), e.j_.B_();
|
|
15010
15002
|
}
|
|
@@ -15013,7 +15005,7 @@ function __PRIVATE_startWatchStream(e) {
|
|
|
15013
15005
|
* Returns whether the watch stream should be started because it's necessary
|
|
15014
15006
|
* and has not yet been started.
|
|
15015
15007
|
*/ function __PRIVATE_shouldStartWatchStream(e) {
|
|
15016
|
-
return __PRIVATE_canUseNetwork(e) && !__PRIVATE_ensureWatchStream(e).u_() && e.
|
|
15008
|
+
return __PRIVATE_canUseNetwork(e) && !__PRIVATE_ensureWatchStream(e).u_() && e.U_.size > 0;
|
|
15017
15009
|
}
|
|
15018
15010
|
|
|
15019
15011
|
function __PRIVATE_canUseNetwork(e) {
|
|
@@ -15030,7 +15022,7 @@ async function __PRIVATE_onWatchStreamConnected(e) {
|
|
|
15030
15022
|
}
|
|
15031
15023
|
|
|
15032
15024
|
async function __PRIVATE_onWatchStreamOpen(e) {
|
|
15033
|
-
e.
|
|
15025
|
+
e.U_.forEach(((t, n) => {
|
|
15034
15026
|
__PRIVATE_sendWatchRequest(e, t);
|
|
15035
15027
|
}));
|
|
15036
15028
|
}
|
|
@@ -15057,7 +15049,7 @@ async function __PRIVATE_onWatchStreamChange(e, t, n) {
|
|
|
15057
15049
|
const n = t.cause;
|
|
15058
15050
|
for (const r of t.targetIds)
|
|
15059
15051
|
// A watched target might have been removed already.
|
|
15060
|
-
e.
|
|
15052
|
+
e.U_.has(r) && (await e.remoteSyncer.rejectListen(r, n), e.U_.delete(r), e.H_.removeTarget(r));
|
|
15061
15053
|
}
|
|
15062
15054
|
/**
|
|
15063
15055
|
* Attempts to fill our write pipeline with writes from the LocalStore.
|
|
@@ -15087,21 +15079,21 @@ async function __PRIVATE_onWatchStreamChange(e, t, n) {
|
|
|
15087
15079
|
// persistent view of these when applying the completed RemoteEvent.
|
|
15088
15080
|
return n.targetChanges.forEach(((n, r) => {
|
|
15089
15081
|
if (n.resumeToken.approximateByteSize() > 0) {
|
|
15090
|
-
const i = e.
|
|
15082
|
+
const i = e.U_.get(r);
|
|
15091
15083
|
// A watched target might have been removed already.
|
|
15092
|
-
i && e.
|
|
15084
|
+
i && e.U_.set(r, i.withResumeToken(n.resumeToken, t));
|
|
15093
15085
|
}
|
|
15094
15086
|
})),
|
|
15095
15087
|
// Re-establish listens for the targets that have been invalidated by
|
|
15096
15088
|
// existence filter mismatches.
|
|
15097
15089
|
n.targetMismatches.forEach(((t, n) => {
|
|
15098
|
-
const r = e.
|
|
15090
|
+
const r = e.U_.get(t);
|
|
15099
15091
|
if (!r)
|
|
15100
15092
|
// A watched target might have been removed already.
|
|
15101
15093
|
return;
|
|
15102
15094
|
// Clear the resume token for the target, since we're in a known mismatch
|
|
15103
15095
|
// state.
|
|
15104
|
-
e.
|
|
15096
|
+
e.U_.set(t, r.withResumeToken(ByteString.EMPTY_BYTE_STRING, r.snapshotVersion)),
|
|
15105
15097
|
// Cause a hard reset by unwatching and rewatching immediately, but
|
|
15106
15098
|
// deliberately don't send a resume token so that we get a full update.
|
|
15107
15099
|
__PRIVATE_sendUnwatchRequest(e, t);
|
|
@@ -15152,11 +15144,11 @@ async function __PRIVATE_onWatchStreamChange(e, t, n) {
|
|
|
15152
15144
|
|
|
15153
15145
|
async function __PRIVATE_fillWritePipeline(e) {
|
|
15154
15146
|
const t = __PRIVATE_debugCast(e), n = __PRIVATE_ensureWriteStream(t);
|
|
15155
|
-
let r = t.
|
|
15147
|
+
let r = t.K_.length > 0 ? t.K_[t.K_.length - 1].batchId : Q;
|
|
15156
15148
|
for (;__PRIVATE_canAddToWritePipeline(t); ) try {
|
|
15157
15149
|
const e = await __PRIVATE_localStoreGetNextMutationBatch(t.localStore, r);
|
|
15158
15150
|
if (null === e) {
|
|
15159
|
-
0 === t.
|
|
15151
|
+
0 === t.K_.length && n.P_();
|
|
15160
15152
|
break;
|
|
15161
15153
|
}
|
|
15162
15154
|
r = e.batchId, __PRIVATE_addToWritePipeline(t, e);
|
|
@@ -15170,20 +15162,20 @@ async function __PRIVATE_fillWritePipeline(e) {
|
|
|
15170
15162
|
* Returns true if we can add to the write pipeline (i.e. the network is
|
|
15171
15163
|
* enabled and the write pipeline is not full).
|
|
15172
15164
|
*/ function __PRIVATE_canAddToWritePipeline(e) {
|
|
15173
|
-
return __PRIVATE_canUseNetwork(e) && e.
|
|
15165
|
+
return __PRIVATE_canUseNetwork(e) && e.K_.length < 10;
|
|
15174
15166
|
}
|
|
15175
15167
|
|
|
15176
15168
|
/**
|
|
15177
15169
|
* Queues additional writes to be sent to the write stream, sending them
|
|
15178
15170
|
* immediately if the write stream is established.
|
|
15179
15171
|
*/ function __PRIVATE_addToWritePipeline(e, t) {
|
|
15180
|
-
e.
|
|
15172
|
+
e.K_.push(t);
|
|
15181
15173
|
const n = __PRIVATE_ensureWriteStream(e);
|
|
15182
|
-
n.c_() && n.
|
|
15174
|
+
n.c_() && n.b_ && n.S_(t.mutations);
|
|
15183
15175
|
}
|
|
15184
15176
|
|
|
15185
15177
|
function __PRIVATE_shouldStartWriteStream(e) {
|
|
15186
|
-
return __PRIVATE_canUseNetwork(e) && !__PRIVATE_ensureWriteStream(e).u_() && e.
|
|
15178
|
+
return __PRIVATE_canUseNetwork(e) && !__PRIVATE_ensureWriteStream(e).u_() && e.K_.length > 0;
|
|
15187
15179
|
}
|
|
15188
15180
|
|
|
15189
15181
|
function __PRIVATE_startWriteStream(e) {
|
|
@@ -15197,11 +15189,11 @@ async function __PRIVATE_onWriteStreamOpen(e) {
|
|
|
15197
15189
|
async function __PRIVATE_onWriteHandshakeComplete(e) {
|
|
15198
15190
|
const t = __PRIVATE_ensureWriteStream(e);
|
|
15199
15191
|
// Send the write pipeline now that the stream is established.
|
|
15200
|
-
for (const n of e.
|
|
15192
|
+
for (const n of e.K_) t.S_(n.mutations);
|
|
15201
15193
|
}
|
|
15202
15194
|
|
|
15203
15195
|
async function __PRIVATE_onMutationResult(e, t, n) {
|
|
15204
|
-
const r = e.
|
|
15196
|
+
const r = e.K_.shift(), i = MutationBatchResult.from(r, t, n);
|
|
15205
15197
|
await __PRIVATE_executeWithRecovery(e, (() => e.remoteSyncer.applySuccessfulWrite(i))),
|
|
15206
15198
|
// It's possible that with the completion of this mutation another
|
|
15207
15199
|
// slot has freed up.
|
|
@@ -15211,7 +15203,7 @@ async function __PRIVATE_onMutationResult(e, t, n) {
|
|
|
15211
15203
|
async function __PRIVATE_onWriteStreamClose(e, t) {
|
|
15212
15204
|
// If the write stream closed after the write handshake completes, a write
|
|
15213
15205
|
// operation failed and we fail the pending operation.
|
|
15214
|
-
t && __PRIVATE_ensureWriteStream(e).
|
|
15206
|
+
t && __PRIVATE_ensureWriteStream(e).b_ &&
|
|
15215
15207
|
// This error affects the actual write.
|
|
15216
15208
|
await async function __PRIVATE_handleWriteError(e, t) {
|
|
15217
15209
|
// Only handle permanent errors here. If it's transient, just let the retry
|
|
@@ -15221,7 +15213,7 @@ async function __PRIVATE_onWriteStreamClose(e, t) {
|
|
|
15221
15213
|
}(t.code)) {
|
|
15222
15214
|
// This was a permanent error, the request itself was the problem
|
|
15223
15215
|
// so it's not going to succeed if we resend it.
|
|
15224
|
-
const n = e.
|
|
15216
|
+
const n = e.K_.shift();
|
|
15225
15217
|
// In this case it's also unlikely that the server itself is melting
|
|
15226
15218
|
// down -- this was just a bad request so inhibit backoff on the next
|
|
15227
15219
|
// restart.
|
|
@@ -15320,8 +15312,8 @@ async function __PRIVATE_remoteStoreHandleCredentialChange(e, t) {
|
|
|
15320
15312
|
}), e.G_.push((async t => {
|
|
15321
15313
|
t ? (e.Y_.h_(),
|
|
15322
15314
|
// This will start the write stream if necessary.
|
|
15323
|
-
await __PRIVATE_fillWritePipeline(e)) : (await e.Y_.stop(), e.
|
|
15324
|
-
e.
|
|
15315
|
+
await __PRIVATE_fillWritePipeline(e)) : (await e.Y_.stop(), e.K_.length > 0 && (__PRIVATE_logDebug(zt, `Stopping write stream with ${e.K_.length} pending writes`),
|
|
15316
|
+
e.K_ = []));
|
|
15325
15317
|
}))), e.Y_;
|
|
15326
15318
|
}
|
|
15327
15319
|
|
|
@@ -16018,7 +16010,7 @@ class __PRIVATE_RemovedLimboDocument {
|
|
|
16018
16010
|
/**
|
|
16019
16011
|
* The set of remote documents that the server has told us belongs to the target associated with
|
|
16020
16012
|
* this view.
|
|
16021
|
-
*/ get
|
|
16013
|
+
*/ get ba() {
|
|
16022
16014
|
return this.fa;
|
|
16023
16015
|
}
|
|
16024
16016
|
/**
|
|
@@ -16030,7 +16022,7 @@ class __PRIVATE_RemovedLimboDocument {
|
|
|
16030
16022
|
* @param previousChanges - If this is being called with a refill, then start
|
|
16031
16023
|
* with this set of docs and changes instead of the current view.
|
|
16032
16024
|
* @returns a new set of docs, changes, and refill flag.
|
|
16033
|
-
*/
|
|
16025
|
+
*/ Sa(e, t) {
|
|
16034
16026
|
const n = t ? t.Da : new __PRIVATE_DocumentChangeSet, r = t ? t.wa : this.wa;
|
|
16035
16027
|
let i = t ? t.mutatedKeys : this.mutatedKeys, s = r, o = !1;
|
|
16036
16028
|
// Track the last doc in a (full) limit. This is necessary, because some
|
|
@@ -16243,7 +16235,7 @@ class __PRIVATE_RemovedLimboDocument {
|
|
|
16243
16235
|
// PORTING NOTE: Multi-tab only.
|
|
16244
16236
|
Oa(e) {
|
|
16245
16237
|
this.fa = e.gs, this.pa = __PRIVATE_documentKeySet();
|
|
16246
|
-
const t = this.
|
|
16238
|
+
const t = this.Sa(e.documents);
|
|
16247
16239
|
return this.applyChanges(t, /* limboResolutionEnabled= */ !0);
|
|
16248
16240
|
}
|
|
16249
16241
|
/**
|
|
@@ -16335,11 +16327,11 @@ const Jt = "SyncEngine";
|
|
|
16335
16327
|
* Keeps track of the information about an active limbo resolution for each
|
|
16336
16328
|
* active target ID that was started for the purpose of limbo resolution.
|
|
16337
16329
|
*/
|
|
16338
|
-
this.
|
|
16330
|
+
this.Ka = new Map, this.Ua = new __PRIVATE_ReferenceSet,
|
|
16339
16331
|
/** Stores user completion handlers, indexed by User and BatchId. */
|
|
16340
16332
|
this.Wa = {},
|
|
16341
16333
|
/** Stores user callbacks waiting for all pending writes to be acknowledged. */
|
|
16342
|
-
this.Ga = new Map, this.za = __PRIVATE_TargetIdGenerator.
|
|
16334
|
+
this.Ga = new Map, this.za = __PRIVATE_TargetIdGenerator.Un(), this.onlineState = "Unknown" /* OnlineState.Unknown */ ,
|
|
16343
16335
|
// The primary state is set to `true` or `false` immediately after Firestore
|
|
16344
16336
|
// startup. In the interim, a client should only be considered primary if
|
|
16345
16337
|
// `isPrimary` is true.
|
|
@@ -16392,19 +16384,19 @@ async function __PRIVATE_allocateTargetAndMaybeListen(e, t, n, r) {
|
|
|
16392
16384
|
// targets based on view changes. This allows us to only depend on Limbo
|
|
16393
16385
|
// changes when user code includes queries.
|
|
16394
16386
|
e.Ha = (t, n, r) => async function __PRIVATE_applyDocChanges(e, t, n, r) {
|
|
16395
|
-
let i = t.view.
|
|
16387
|
+
let i = t.view.Sa(n);
|
|
16396
16388
|
i.ls && (
|
|
16397
16389
|
// The query has a limit and some docs were removed, so we need
|
|
16398
16390
|
// to re-run the query against the local store to make sure we
|
|
16399
16391
|
// didn't lose any good docs that had been past the limit.
|
|
16400
16392
|
i = await __PRIVATE_localStoreExecuteQuery(e.localStore, t.query,
|
|
16401
|
-
/* usePreviousResults= */ !1).then((({documents: e}) => t.view.
|
|
16393
|
+
/* usePreviousResults= */ !1).then((({documents: e}) => t.view.Sa(e, i))));
|
|
16402
16394
|
const s = r && r.targetChanges.get(t.targetId), o = r && null != r.targetMismatches.get(t.targetId), _ = t.view.applyChanges(i,
|
|
16403
16395
|
/* limboResolutionEnabled= */ e.isPrimaryClient, s, o);
|
|
16404
16396
|
return __PRIVATE_updateTrackedLimbos(e, t.targetId, _.Ma), _.snapshot;
|
|
16405
16397
|
}(e, t, n, r);
|
|
16406
16398
|
const s = await __PRIVATE_localStoreExecuteQuery(e.localStore, t,
|
|
16407
|
-
/* usePreviousResults= */ !0), o = new __PRIVATE_View(t, s.gs), _ = o.
|
|
16399
|
+
/* usePreviousResults= */ !0), o = new __PRIVATE_View(t, s.gs), _ = o.Sa(s.documents), a = TargetChange.createSynthesizedTargetChangeForCurrentChange(n, r && "Offline" /* OnlineState.Offline */ !== e.onlineState, i), u = o.applyChanges(_,
|
|
16408
16400
|
/* limboResolutionEnabled= */ e.isPrimaryClient, a);
|
|
16409
16401
|
__PRIVATE_updateTrackedLimbos(e, n, u.Ma);
|
|
16410
16402
|
const c = new __PRIVATE_QueryView(t, n, o);
|
|
@@ -16519,7 +16511,7 @@ async function __PRIVATE_allocateTargetAndMaybeListen(e, t, n, r) {
|
|
|
16519
16511
|
const e = await __PRIVATE_localStoreApplyRemoteEventToLocalCache(n.localStore, t);
|
|
16520
16512
|
// Update `receivedDocument` as appropriate for any limbo targets.
|
|
16521
16513
|
t.targetChanges.forEach(((e, t) => {
|
|
16522
|
-
const r = n.
|
|
16514
|
+
const r = n.Ka.get(t);
|
|
16523
16515
|
r && (
|
|
16524
16516
|
// Since this is a limbo resolution lookup, it's for a single document
|
|
16525
16517
|
// and it could be added, modified, or removed, but not a combination.
|
|
@@ -16573,7 +16565,7 @@ async function __PRIVATE_allocateTargetAndMaybeListen(e, t, n, r) {
|
|
|
16573
16565
|
const r = __PRIVATE_debugCast(e);
|
|
16574
16566
|
// PORTING NOTE: Multi-tab only.
|
|
16575
16567
|
r.sharedClientState.updateQueryState(t, "rejected", n);
|
|
16576
|
-
const i = r.
|
|
16568
|
+
const i = r.Ka.get(t), s = i && i.key;
|
|
16577
16569
|
if (s) {
|
|
16578
16570
|
// TODO(klimt): We really only should do the following on permission
|
|
16579
16571
|
// denied errors, but we don't have the cause code here.
|
|
@@ -16595,7 +16587,7 @@ async function __PRIVATE_allocateTargetAndMaybeListen(e, t, n, r) {
|
|
|
16595
16587
|
// RemoteEvent. If `applyRemoteEvent()` throws, we want to re-listen to
|
|
16596
16588
|
// this query when the RemoteStore restarts the Watch stream, which should
|
|
16597
16589
|
// re-trigger the target failure.
|
|
16598
|
-
r.$a = r.$a.remove(s), r.
|
|
16590
|
+
r.$a = r.$a.remove(s), r.Ka.delete(t), __PRIVATE_pumpEnqueuedLimboResolutions(r);
|
|
16599
16591
|
} else await __PRIVATE_localStoreReleaseTarget(r.localStore, t,
|
|
16600
16592
|
/* keepPersistedTargetData */ !1).then((() => __PRIVATE_removeAndCleanupTarget(r, t, n))).catch(__PRIVATE_ignoreIfPrimaryLeaseLoss);
|
|
16601
16593
|
}
|
|
@@ -16689,8 +16681,8 @@ function __PRIVATE_removeAndCleanupTarget(e, t, n = null) {
|
|
|
16689
16681
|
e.sharedClientState.removeLocalQueryTarget(t);
|
|
16690
16682
|
for (const r of e.qa.get(t)) e.ka.delete(r), n && e.La.Ja(r, n);
|
|
16691
16683
|
if (e.qa.delete(t), e.isPrimaryClient) {
|
|
16692
|
-
e.
|
|
16693
|
-
e.
|
|
16684
|
+
e.Ua.Sr(t).forEach((t => {
|
|
16685
|
+
e.Ua.containsKey(t) ||
|
|
16694
16686
|
// We removed the last reference for this key
|
|
16695
16687
|
__PRIVATE_removeLimboTarget(e, t);
|
|
16696
16688
|
}));
|
|
@@ -16703,14 +16695,14 @@ function __PRIVATE_removeLimboTarget(e, t) {
|
|
|
16703
16695
|
// the key won't exist in `limboTargetsByKey`. Only do the cleanup if we still have the target.
|
|
16704
16696
|
const n = e.$a.get(t);
|
|
16705
16697
|
null !== n && (__PRIVATE_remoteStoreUnlisten(e.remoteStore, n), e.$a = e.$a.remove(t),
|
|
16706
|
-
e.
|
|
16698
|
+
e.Ka.delete(n), __PRIVATE_pumpEnqueuedLimboResolutions(e));
|
|
16707
16699
|
}
|
|
16708
16700
|
|
|
16709
16701
|
function __PRIVATE_updateTrackedLimbos(e, t, n) {
|
|
16710
|
-
for (const r of n) if (r instanceof __PRIVATE_AddedLimboDocument) e.
|
|
16702
|
+
for (const r of n) if (r instanceof __PRIVATE_AddedLimboDocument) e.Ua.addReference(r.key, t),
|
|
16711
16703
|
__PRIVATE_trackLimboChange(e, r); else if (r instanceof __PRIVATE_RemovedLimboDocument) {
|
|
16712
|
-
__PRIVATE_logDebug(Jt, "Document no longer in limbo: " + r.key), e.
|
|
16713
|
-
e.
|
|
16704
|
+
__PRIVATE_logDebug(Jt, "Document no longer in limbo: " + r.key), e.Ua.removeReference(r.key, t);
|
|
16705
|
+
e.Ua.containsKey(r.key) ||
|
|
16714
16706
|
// We removed the last reference for this key
|
|
16715
16707
|
__PRIVATE_removeLimboTarget(e, r.key);
|
|
16716
16708
|
} else fail();
|
|
@@ -16734,7 +16726,7 @@ function __PRIVATE_trackLimboChange(e, t) {
|
|
|
16734
16726
|
const t = e.Qa.values().next().value;
|
|
16735
16727
|
e.Qa.delete(t);
|
|
16736
16728
|
const n = new DocumentKey(ResourcePath.fromString(t)), r = e.za.next();
|
|
16737
|
-
e.
|
|
16729
|
+
e.Ka.set(r, new LimboResolution(n)), e.$a = e.$a.insert(n, r), __PRIVATE_remoteStoreListen(e.remoteStore, new TargetData(__PRIVATE_queryToTarget(__PRIVATE_newQueryForPath(n.path)), r, "TargetPurposeLimboResolution" /* TargetPurpose.LimboResolution */ , __PRIVATE_ListenSequence.ae));
|
|
16738
16730
|
}
|
|
16739
16731
|
}
|
|
16740
16732
|
|
|
@@ -16802,7 +16794,7 @@ async function __PRIVATE_syncEngineHandleCredentialChange(e, t) {
|
|
|
16802
16794
|
}
|
|
16803
16795
|
|
|
16804
16796
|
function __PRIVATE_syncEngineGetRemoteKeysForTarget(e, t) {
|
|
16805
|
-
const n = __PRIVATE_debugCast(e), r = n.
|
|
16797
|
+
const n = __PRIVATE_debugCast(e), r = n.Ka.get(t);
|
|
16806
16798
|
if (r && r.Ba) return __PRIVATE_documentKeySet().add(r.key);
|
|
16807
16799
|
{
|
|
16808
16800
|
let e = __PRIVATE_documentKeySet();
|
|
@@ -16810,7 +16802,7 @@ function __PRIVATE_syncEngineGetRemoteKeysForTarget(e, t) {
|
|
|
16810
16802
|
if (!r) return e;
|
|
16811
16803
|
for (const t of r) {
|
|
16812
16804
|
const r = n.ka.get(t);
|
|
16813
|
-
e = e.unionWith(r.view.
|
|
16805
|
+
e = e.unionWith(r.view.ba);
|
|
16814
16806
|
}
|
|
16815
16807
|
return e;
|
|
16816
16808
|
}
|
|
@@ -16894,9 +16886,9 @@ async function __PRIVATE_syncEngineApplyPrimaryState(e, t) {
|
|
|
16894
16886
|
// PORTING NOTE: Multi-Tab only.
|
|
16895
16887
|
function __PRIVATE_resetLimboDocuments(e) {
|
|
16896
16888
|
const t = __PRIVATE_debugCast(e);
|
|
16897
|
-
t.
|
|
16889
|
+
t.Ka.forEach(((e, n) => {
|
|
16898
16890
|
__PRIVATE_remoteStoreUnlisten(t.remoteStore, n);
|
|
16899
|
-
})), t.
|
|
16891
|
+
})), t.Ua.Dr(), t.Ka = new Map, t.$a = new SortedMap(DocumentKey.comparator);
|
|
16900
16892
|
}
|
|
16901
16893
|
/**
|
|
16902
16894
|
* Reconcile the query views of the provided query targets with the state from
|
|
@@ -17596,7 +17588,7 @@ class Transaction$2 {
|
|
|
17596
17588
|
const n = __PRIVATE_debugCast(e), r = {
|
|
17597
17589
|
writes: t.map((e => toMutation(n.serializer, e)))
|
|
17598
17590
|
};
|
|
17599
|
-
await n.
|
|
17591
|
+
await n.bo("Commit", n.serializer.databaseId, ResourcePath.emptyPath(), r);
|
|
17600
17592
|
}(this.datastore, this.mutations), this.committed = !0;
|
|
17601
17593
|
}
|
|
17602
17594
|
recordVersion(e) {
|
|
@@ -17958,7 +17950,7 @@ function __PRIVATE_firestoreClientGetDocumentsFromLocalCache(e, t) {
|
|
|
17958
17950
|
return e.asyncQueue.enqueueAndForget((async () => async function __PRIVATE_executeQueryFromCache(e, t, n) {
|
|
17959
17951
|
try {
|
|
17960
17952
|
const r = await __PRIVATE_localStoreExecuteQuery(e, t,
|
|
17961
|
-
/* usePreviousResults= */ !0), i = new __PRIVATE_View(t, r.gs), s = i.
|
|
17953
|
+
/* usePreviousResults= */ !0), i = new __PRIVATE_View(t, r.gs), s = i.Sa(r.documents), o = i.applyChanges(s,
|
|
17962
17954
|
/* limboResolutionEnabled= */ !1);
|
|
17963
17955
|
n.resolve(o.snapshot);
|
|
17964
17956
|
} catch (e) {
|
|
@@ -18331,7 +18323,7 @@ class FirestoreSettingsImpl {
|
|
|
18331
18323
|
this.host = Xt, this.ssl = en;
|
|
18332
18324
|
} else this.host = e.host, this.ssl = null !== (t = e.ssl) && void 0 !== t ? t : en;
|
|
18333
18325
|
if (this.credentials = e.credentials, this.ignoreUndefinedProperties = !!e.ignoreUndefinedProperties,
|
|
18334
|
-
this.localCache = e.localCache, void 0 === e.cacheSizeBytes) this.cacheSizeBytes =
|
|
18326
|
+
this.localCache = e.localCache, void 0 === e.cacheSizeBytes) this.cacheSizeBytes = bt; else {
|
|
18335
18327
|
if (-1 !== e.cacheSizeBytes && e.cacheSizeBytes < Dt) throw new FirestoreError(C.INVALID_ARGUMENT, "cacheSizeBytes must be at least 1048576");
|
|
18336
18328
|
this.cacheSizeBytes = e.cacheSizeBytes;
|
|
18337
18329
|
}
|
|
@@ -18387,7 +18379,7 @@ class Firestore$1 {
|
|
|
18387
18379
|
* Whether it's a Firestore or Firestore Lite instance.
|
|
18388
18380
|
*/
|
|
18389
18381
|
this.type = "firestore-lite", this._persistenceKey = "(lite)", this._settings = new FirestoreSettingsImpl({}),
|
|
18390
|
-
this._settingsFrozen = !1,
|
|
18382
|
+
this._settingsFrozen = !1, this._emulatorOptions = {},
|
|
18391
18383
|
// A task that is assigned when the terminate() is invoked and resolved when
|
|
18392
18384
|
// all components have shut down. Otherwise, Firestore is not terminated,
|
|
18393
18385
|
// which can mean either the FirestoreClient is in the process of starting,
|
|
@@ -18409,7 +18401,8 @@ class Firestore$1 {
|
|
|
18409
18401
|
}
|
|
18410
18402
|
_setSettings(e) {
|
|
18411
18403
|
if (this._settingsFrozen) throw new FirestoreError(C.FAILED_PRECONDITION, "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.");
|
|
18412
|
-
this._settings = new FirestoreSettingsImpl(e),
|
|
18404
|
+
this._settings = new FirestoreSettingsImpl(e), this._emulatorOptions = e.emulatorOptions || {},
|
|
18405
|
+
void 0 !== e.credentials && (this._authCredentials = function __PRIVATE_makeAuthCredentialsProvider(e) {
|
|
18413
18406
|
if (!e) return new __PRIVATE_EmptyAuthCredentialsProvider;
|
|
18414
18407
|
switch (e.type) {
|
|
18415
18408
|
case "firstParty":
|
|
@@ -18426,6 +18419,9 @@ class Firestore$1 {
|
|
|
18426
18419
|
_getSettings() {
|
|
18427
18420
|
return this._settings;
|
|
18428
18421
|
}
|
|
18422
|
+
_getEmulatorOptions() {
|
|
18423
|
+
return this._emulatorOptions;
|
|
18424
|
+
}
|
|
18429
18425
|
_freezeSettings() {
|
|
18430
18426
|
return this._settingsFrozen = !0, this._settings;
|
|
18431
18427
|
}
|
|
@@ -18481,12 +18477,18 @@ class Firestore$1 {
|
|
|
18481
18477
|
* Security Rules.
|
|
18482
18478
|
*/ function connectFirestoreEmulator(e, t, n, r = {}) {
|
|
18483
18479
|
var i;
|
|
18484
|
-
const s = (e = __PRIVATE_cast(e, Firestore$1))._getSettings(), o =
|
|
18485
|
-
|
|
18486
|
-
|
|
18487
|
-
|
|
18488
|
-
|
|
18489
|
-
|
|
18480
|
+
const s = (e = __PRIVATE_cast(e, Firestore$1))._getSettings(), o = Object.assign(Object.assign({}, s), {
|
|
18481
|
+
emulatorOptions: e._getEmulatorOptions()
|
|
18482
|
+
}), _ = `${t}:${n}`;
|
|
18483
|
+
s.host !== Xt && s.host !== _ && __PRIVATE_logWarn("Host has been set in both settings() and connectFirestoreEmulator(), emulator host will be used.");
|
|
18484
|
+
const a = Object.assign(Object.assign({}, s), {
|
|
18485
|
+
host: _,
|
|
18486
|
+
ssl: !1,
|
|
18487
|
+
emulatorOptions: r
|
|
18488
|
+
});
|
|
18489
|
+
// No-op if the new configuration matches the current configuration. This supports SSR
|
|
18490
|
+
// enviornments which might call `connectFirestoreEmulator` multiple times as a standard practice.
|
|
18491
|
+
if (!util.deepEqual(a, o) && (e._setSettings(a), r.mockUserToken)) {
|
|
18490
18492
|
let t, n;
|
|
18491
18493
|
if ("string" == typeof r.mockUserToken) t = r.mockUserToken, n = User.MOCK_USER; else {
|
|
18492
18494
|
// Let createMockUserToken validate first (catches common mistakes like
|
|
@@ -18723,13 +18725,13 @@ class __PRIVATE_AsyncQueueImpl {
|
|
|
18723
18725
|
// Visibility handler that triggers an immediate retry of all retryable
|
|
18724
18726
|
// operations. Meant to speed up recovery when we regain file system access
|
|
18725
18727
|
// after page comes into foreground.
|
|
18726
|
-
this.
|
|
18728
|
+
this.bu = () => {
|
|
18727
18729
|
const e = getDocument();
|
|
18728
18730
|
e && __PRIVATE_logDebug(tn, "Visibility state changed to " + e.visibilityState),
|
|
18729
18731
|
this.a_.t_();
|
|
18730
|
-
}, this.
|
|
18732
|
+
}, this.Su = e;
|
|
18731
18733
|
const t = getDocument();
|
|
18732
|
-
t && "function" == typeof t.addEventListener && t.addEventListener("visibilitychange", this.
|
|
18734
|
+
t && "function" == typeof t.addEventListener && t.addEventListener("visibilitychange", this.bu);
|
|
18733
18735
|
}
|
|
18734
18736
|
get isShuttingDown() {
|
|
18735
18737
|
return this.mu;
|
|
@@ -18750,7 +18752,7 @@ class __PRIVATE_AsyncQueueImpl {
|
|
|
18750
18752
|
if (!this.mu) {
|
|
18751
18753
|
this.mu = !0, this.yu = e || !1;
|
|
18752
18754
|
const t = getDocument();
|
|
18753
|
-
t && "function" == typeof t.removeEventListener && t.removeEventListener("visibilitychange", this.
|
|
18755
|
+
t && "function" == typeof t.removeEventListener && t.removeEventListener("visibilitychange", this.bu);
|
|
18754
18756
|
}
|
|
18755
18757
|
}
|
|
18756
18758
|
enqueue(e) {
|
|
@@ -18794,7 +18796,7 @@ class __PRIVATE_AsyncQueueImpl {
|
|
|
18794
18796
|
}
|
|
18795
18797
|
}
|
|
18796
18798
|
vu(e) {
|
|
18797
|
-
const t = this.
|
|
18799
|
+
const t = this.Su.then((() => (this.pu = !0, e().catch((e => {
|
|
18798
18800
|
this.gu = e, this.pu = !1;
|
|
18799
18801
|
const t =
|
|
18800
18802
|
/**
|
|
@@ -18828,7 +18830,7 @@ class __PRIVATE_AsyncQueueImpl {
|
|
|
18828
18830
|
// and return the rejected Promise.
|
|
18829
18831
|
throw __PRIVATE_logError("INTERNAL UNHANDLED ERROR: ", t), e;
|
|
18830
18832
|
})).then((e => (this.pu = !1, e))))));
|
|
18831
|
-
return this.
|
|
18833
|
+
return this.Su = t, t;
|
|
18832
18834
|
}
|
|
18833
18835
|
enqueueAfterDelay(e, t, n) {
|
|
18834
18836
|
this.Du(),
|
|
@@ -18851,8 +18853,8 @@ class __PRIVATE_AsyncQueueImpl {
|
|
|
18851
18853
|
// operations were executed.
|
|
18852
18854
|
let e;
|
|
18853
18855
|
do {
|
|
18854
|
-
e = this.
|
|
18855
|
-
} while (e !== this.
|
|
18856
|
+
e = this.Su, await e;
|
|
18857
|
+
} while (e !== this.Su);
|
|
18856
18858
|
}
|
|
18857
18859
|
/**
|
|
18858
18860
|
* For Tests: Determine if a delayed operation with a particular TimerId
|
|
@@ -19630,7 +19632,7 @@ class AggregateField {
|
|
|
19630
19632
|
*/
|
|
19631
19633
|
/**
|
|
19632
19634
|
* Represents a vector type in Firestore documents.
|
|
19633
|
-
* Create an instance with {@link
|
|
19635
|
+
* Create an instance with <code>{@link vector}</code>.
|
|
19634
19636
|
*
|
|
19635
19637
|
* @class VectorValue
|
|
19636
19638
|
*/ class VectorValue {
|
|
@@ -19648,7 +19650,7 @@ class AggregateField {
|
|
|
19648
19650
|
return this._values.map((e => e));
|
|
19649
19651
|
}
|
|
19650
19652
|
/**
|
|
19651
|
-
* Returns `true` if the two VectorValue
|
|
19653
|
+
* Returns `true` if the two `VectorValue` values have the same raw number arrays, returns `false` otherwise.
|
|
19652
19654
|
*/ isEqual(e) {
|
|
19653
19655
|
return function __PRIVATE_isPrimitiveArrayEqual(e, t) {
|
|
19654
19656
|
if (e.length !== t.length) return !1;
|
|
@@ -19755,7 +19757,7 @@ function __PRIVATE_isWrite(e) {
|
|
|
19755
19757
|
});
|
|
19756
19758
|
return r.$u(e), r;
|
|
19757
19759
|
}
|
|
19758
|
-
|
|
19760
|
+
Ku(e) {
|
|
19759
19761
|
var t;
|
|
19760
19762
|
const n = null === (t = this.path) || void 0 === t ? void 0 : t.child(e), r = this.ku({
|
|
19761
19763
|
path: n,
|
|
@@ -19763,7 +19765,7 @@ function __PRIVATE_isWrite(e) {
|
|
|
19763
19765
|
});
|
|
19764
19766
|
return r.Bu(), r;
|
|
19765
19767
|
}
|
|
19766
|
-
|
|
19768
|
+
Uu(e) {
|
|
19767
19769
|
// TODO(b/34871131): We don't support array paths right now; so make path
|
|
19768
19770
|
// undefined.
|
|
19769
19771
|
return this.ku({
|
|
@@ -19924,7 +19926,7 @@ class __PRIVATE_NumericIncrementFieldValueImpl extends FieldValue {
|
|
|
19924
19926
|
// For Compat types, we have to "extract" the underlying types before
|
|
19925
19927
|
// performing validation.
|
|
19926
19928
|
r = util.getModularInstance(r);
|
|
19927
|
-
const a = i.
|
|
19929
|
+
const a = i.Ku(_);
|
|
19928
19930
|
if (r instanceof __PRIVATE_DeleteFieldValueImpl)
|
|
19929
19931
|
// Add it to the field mask, but don't add anything to updateData.
|
|
19930
19932
|
s.push(_); else {
|
|
@@ -19950,7 +19952,7 @@ class __PRIVATE_NumericIncrementFieldValueImpl extends FieldValue {
|
|
|
19950
19952
|
// For Compat types, we have to "extract" the underlying types before
|
|
19951
19953
|
// performing validation.
|
|
19952
19954
|
n = util.getModularInstance(n);
|
|
19953
|
-
const r = o.
|
|
19955
|
+
const r = o.Ku(t);
|
|
19954
19956
|
if (n instanceof __PRIVATE_DeleteFieldValueImpl)
|
|
19955
19957
|
// Add it to the field mask, but don't add anything to updateData.
|
|
19956
19958
|
u.push(t); else {
|
|
@@ -20028,7 +20030,7 @@ class __PRIVATE_NumericIncrementFieldValueImpl extends FieldValue {
|
|
|
20028
20030
|
const n = [];
|
|
20029
20031
|
let r = 0;
|
|
20030
20032
|
for (const i of e) {
|
|
20031
|
-
let e = __PRIVATE_parseData(i, t.
|
|
20033
|
+
let e = __PRIVATE_parseData(i, t.Uu(r));
|
|
20032
20034
|
null == e && (
|
|
20033
20035
|
// Just include nulls in the array for fields being replaced with a
|
|
20034
20036
|
// sentinel.
|
|
@@ -22351,9 +22353,9 @@ let an = null;
|
|
|
22351
22353
|
return r = Object.assign({
|
|
22352
22354
|
useFetchStreams: t
|
|
22353
22355
|
}, r), s._setSettings(r), s;
|
|
22354
|
-
}), "PUBLIC").setMultipleInstances(!0)), app.registerVersion(
|
|
22356
|
+
}), "PUBLIC").setMultipleInstances(!0)), app.registerVersion(b, S, e),
|
|
22355
22357
|
// BUILD_TARGET will be replaced by values like esm2017, cjs2017, etc during the compilation
|
|
22356
|
-
app.registerVersion(
|
|
22358
|
+
app.registerVersion(b, S, "cjs2017");
|
|
22357
22359
|
}();
|
|
22358
22360
|
|
|
22359
22361
|
exports.AbstractUserDataWriter = AbstractUserDataWriter;
|