@firebase/firestore 3.11.0-canary.98d0b8498 → 3.11.0-canary.a0bb76884
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/index.cjs.js +184 -184
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm2017.js +180 -180
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm5.js +212 -212
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +2 -2
- package/dist/index.node.mjs +2 -2
- package/dist/index.node.mjs.map +1 -1
- package/dist/index.rn.js +3 -3
- package/dist/lite/index.browser.esm2017.js +2 -2
- package/dist/lite/index.browser.esm2017.js.map +1 -1
- package/dist/lite/index.browser.esm5.js +29 -29
- package/dist/lite/index.cjs.js +2 -2
- package/dist/lite/index.cjs.js.map +1 -1
- package/dist/lite/index.node.cjs.js +2 -2
- package/dist/lite/index.node.mjs +2 -2
- package/dist/lite/index.node.mjs.map +1 -1
- package/dist/lite/index.rn.esm2017.js +2 -2
- package/dist/packages/firestore/dist/index.esm2017.d.ts +40 -40
- package/package.json +9 -9
package/dist/index.cjs.js
CHANGED
|
@@ -8,7 +8,7 @@ var logger = require('@firebase/logger');
|
|
|
8
8
|
var util = require('@firebase/util');
|
|
9
9
|
var webchannelWrapper = require('@firebase/webchannel-wrapper');
|
|
10
10
|
|
|
11
|
-
const
|
|
11
|
+
const P = "@firebase/firestore";
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* @license
|
|
@@ -70,7 +70,7 @@ V.MOCK_USER = new V("mock-user");
|
|
|
70
70
|
* See the License for the specific language governing permissions and
|
|
71
71
|
* limitations under the License.
|
|
72
72
|
*/
|
|
73
|
-
let S = "9.21.0-canary.
|
|
73
|
+
let S = "9.21.0-canary.a0bb76884";
|
|
74
74
|
|
|
75
75
|
/**
|
|
76
76
|
* @license
|
|
@@ -1569,7 +1569,7 @@ function Tt(t, e) {
|
|
|
1569
1569
|
* Wraps an IDBTransaction and exposes a store() method to get a handle to a
|
|
1570
1570
|
* specific object store.
|
|
1571
1571
|
*/
|
|
1572
|
-
class
|
|
1572
|
+
class bt {
|
|
1573
1573
|
constructor(t, e) {
|
|
1574
1574
|
this.action = t, this.transaction = e, this.aborted = !1,
|
|
1575
1575
|
/**
|
|
@@ -1586,7 +1586,7 @@ class Pt {
|
|
|
1586
1586
|
}
|
|
1587
1587
|
static open(t, e, n, s) {
|
|
1588
1588
|
try {
|
|
1589
|
-
return new
|
|
1589
|
+
return new bt(e, t.transaction(s, n));
|
|
1590
1590
|
} catch (t) {
|
|
1591
1591
|
throw new St(e, t);
|
|
1592
1592
|
}
|
|
@@ -1625,7 +1625,7 @@ class Pt {
|
|
|
1625
1625
|
* since .then() continuations are executed asynchronously (e.g. via
|
|
1626
1626
|
* .setImmediate), which would cause IndexedDB to end the transaction.
|
|
1627
1627
|
* See PersistencePromise for more details.
|
|
1628
|
-
*/ class
|
|
1628
|
+
*/ class Pt {
|
|
1629
1629
|
/*
|
|
1630
1630
|
* Creates a new SimpleDb wrapper for IndexedDb database `name`.
|
|
1631
1631
|
*
|
|
@@ -1641,14 +1641,14 @@ class Pt {
|
|
|
1641
1641
|
// bug we're checking for should exist in iOS >= 12.2 and < 13, but for
|
|
1642
1642
|
// whatever reason it's much harder to hit after 12.2 so we only proactively
|
|
1643
1643
|
// log on 12.2.
|
|
1644
|
-
12.2 ===
|
|
1644
|
+
12.2 === Pt.S(util.getUA()) && k("Firestore persistence suffers from a bug in iOS 12.2 Safari that may cause your app to stop working. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.");
|
|
1645
1645
|
}
|
|
1646
1646
|
/** Deletes the specified database. */ static delete(t) {
|
|
1647
1647
|
return N("SimpleDb", "Removing database:", t), xt(window.indexedDB.deleteDatabase(t)).toPromise();
|
|
1648
1648
|
}
|
|
1649
1649
|
/** Returns true if IndexedDB is available in the current environment. */ static D() {
|
|
1650
1650
|
if (!util.isIndexedDBAvailable()) return !1;
|
|
1651
|
-
if (
|
|
1651
|
+
if (Pt.C()) return !0;
|
|
1652
1652
|
// We extensively use indexed array values and compound keys,
|
|
1653
1653
|
// which IE and Edge do not support. However, they still have indexedDB
|
|
1654
1654
|
// defined on the window, so we need to check for them here and make sure
|
|
@@ -1656,7 +1656,7 @@ class Pt {
|
|
|
1656
1656
|
// For tracking support of this feature, see here:
|
|
1657
1657
|
// https://developer.microsoft.com/en-us/microsoft-edge/platform/status/indexeddbarraysandmultientrysupport/
|
|
1658
1658
|
// Check the UA string to find out the browser.
|
|
1659
|
-
const t = util.getUA(), e =
|
|
1659
|
+
const t = util.getUA(), e = Pt.S(t), n = 0 < e && e < 10, s = Pt.N(t), i = 0 < s && s < 4.5;
|
|
1660
1660
|
// IE 10
|
|
1661
1661
|
// ua = 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)';
|
|
1662
1662
|
// IE 11
|
|
@@ -1726,7 +1726,7 @@ class Pt {
|
|
|
1726
1726
|
++r;
|
|
1727
1727
|
try {
|
|
1728
1728
|
this.db = await this.$(t);
|
|
1729
|
-
const e =
|
|
1729
|
+
const e = bt.open(this.db, t, i ? "readonly" : "readwrite", n), r = s(e).next((t => (e.P(),
|
|
1730
1730
|
t))).catch((t => (
|
|
1731
1731
|
// Abort the transaction if there was an error.
|
|
1732
1732
|
e.abort(t), Rt.reject(t)))).toPromise();
|
|
@@ -1978,7 +1978,7 @@ class Pt {
|
|
|
1978
1978
|
let Nt = !1;
|
|
1979
1979
|
|
|
1980
1980
|
function kt(t) {
|
|
1981
|
-
const e =
|
|
1981
|
+
const e = Pt.S(util.getUA());
|
|
1982
1982
|
if (e >= 12.2 && e < 13) {
|
|
1983
1983
|
const e = "An internal error was encountered in the Indexed Database server";
|
|
1984
1984
|
if (t.message.indexOf(e) >= 0) {
|
|
@@ -2305,7 +2305,7 @@ class we extends At {
|
|
|
2305
2305
|
|
|
2306
2306
|
function _e(t, e) {
|
|
2307
2307
|
const n = L(t);
|
|
2308
|
-
return
|
|
2308
|
+
return Pt.M(n.at, e);
|
|
2309
2309
|
}
|
|
2310
2310
|
|
|
2311
2311
|
/**
|
|
@@ -2894,7 +2894,7 @@ function ve(t) {
|
|
|
2894
2894
|
*/
|
|
2895
2895
|
/**
|
|
2896
2896
|
* An error encountered while decoding base64 string.
|
|
2897
|
-
*/ class
|
|
2897
|
+
*/ class be extends Error {
|
|
2898
2898
|
constructor() {
|
|
2899
2899
|
super(...arguments), this.name = "Base64DecodeError";
|
|
2900
2900
|
}
|
|
@@ -2918,7 +2918,7 @@ function ve(t) {
|
|
|
2918
2918
|
*/
|
|
2919
2919
|
/** Converts a Base64 encoded string to a binary string. */
|
|
2920
2920
|
/** True if and only if the Base64 conversion functions are available. */
|
|
2921
|
-
function
|
|
2921
|
+
function Pe() {
|
|
2922
2922
|
return "undefined" != typeof atob;
|
|
2923
2923
|
}
|
|
2924
2924
|
|
|
@@ -2958,7 +2958,7 @@ function be() {
|
|
|
2958
2958
|
// Check that `DOMException` is defined before using it to avoid
|
|
2959
2959
|
// "ReferenceError: Property 'DOMException' doesn't exist" in react-native.
|
|
2960
2960
|
// (https://github.com/firebase/firebase-js-sdk/issues/7115)
|
|
2961
|
-
throw "undefined" != typeof DOMException && t instanceof DOMException ? new
|
|
2961
|
+
throw "undefined" != typeof DOMException && t instanceof DOMException ? new be("Invalid base64 string: " + t) : t;
|
|
2962
2962
|
}
|
|
2963
2963
|
}
|
|
2964
2964
|
/** Converts a binary string to a Base64 encoded string. */ (t);
|
|
@@ -3980,10 +3980,10 @@ class mn extends _n {
|
|
|
3980
3980
|
/**
|
|
3981
3981
|
* Creates a filter based on the provided arguments.
|
|
3982
3982
|
*/ static create(t, e, n) {
|
|
3983
|
-
return t.isKeyField() ? "in" /* Operator.IN */ === e || "not-in" /* Operator.NOT_IN */ === e ? this.createKeyFieldInFilter(t, e, n) : new
|
|
3983
|
+
return t.isKeyField() ? "in" /* Operator.IN */ === e || "not-in" /* Operator.NOT_IN */ === e ? this.createKeyFieldInFilter(t, e, n) : new bn(t, e, n) : "array-contains" /* Operator.ARRAY_CONTAINS */ === e ? new Dn(t, n) : "in" /* Operator.IN */ === e ? new Cn(t, n) : "not-in" /* Operator.NOT_IN */ === e ? new xn(t, n) : "array-contains-any" /* Operator.ARRAY_CONTAINS_ANY */ === e ? new Nn(t, n) : new mn(t, e, n);
|
|
3984
3984
|
}
|
|
3985
3985
|
static createKeyFieldInFilter(t, e, n) {
|
|
3986
|
-
return "in" /* Operator.IN */ === e ? new
|
|
3986
|
+
return "in" /* Operator.IN */ === e ? new Pn(t, n) : new Vn(t, n);
|
|
3987
3987
|
}
|
|
3988
3988
|
matches(t) {
|
|
3989
3989
|
const e = t.data.field(this.field);
|
|
@@ -4133,7 +4133,7 @@ function vn(t, e) {
|
|
|
4133
4133
|
}(t) : "Filter";
|
|
4134
4134
|
}
|
|
4135
4135
|
|
|
4136
|
-
class
|
|
4136
|
+
class bn extends mn {
|
|
4137
4137
|
constructor(t, e, n) {
|
|
4138
4138
|
super(t, e, n), this.key = ht.fromName(n.referenceValue);
|
|
4139
4139
|
}
|
|
@@ -4143,7 +4143,7 @@ class Pn extends mn {
|
|
|
4143
4143
|
}
|
|
4144
4144
|
}
|
|
4145
4145
|
|
|
4146
|
-
/** Filter that matches on key fields within an array. */ class
|
|
4146
|
+
/** Filter that matches on key fields within an array. */ class Pn extends mn {
|
|
4147
4147
|
constructor(t, e) {
|
|
4148
4148
|
super(t, "in" /* Operator.IN */ , e), this.keys = Sn("in" /* Operator.IN */ , e);
|
|
4149
4149
|
}
|
|
@@ -4858,7 +4858,7 @@ function ps() {
|
|
|
4858
4858
|
* Computes the local transform result against the provided `previousValue`,
|
|
4859
4859
|
* optionally using the provided localWriteTime.
|
|
4860
4860
|
*/ function vs(t, e, n) {
|
|
4861
|
-
return t instanceof
|
|
4861
|
+
return t instanceof Ps ? function(t, e) {
|
|
4862
4862
|
const n = {
|
|
4863
4863
|
fields: {
|
|
4864
4864
|
__type__: {
|
|
@@ -4888,7 +4888,7 @@ function ps() {
|
|
|
4888
4888
|
// PORTING NOTE: Since JavaScript's integer arithmetic is limited to 53 bit
|
|
4889
4889
|
// precision and resolves overflows by reducing precision, we do not
|
|
4890
4890
|
// manually cap overflows at 2^63.
|
|
4891
|
-
const n =
|
|
4891
|
+
const n = bs(t, e), s = Ns(n) + Ns(t._t);
|
|
4892
4892
|
return He(n) && He(t._t) ? Ts(s) : Is(t.serializer, s);
|
|
4893
4893
|
}(t, e);
|
|
4894
4894
|
}
|
|
@@ -4917,7 +4917,7 @@ function ps() {
|
|
|
4917
4917
|
*
|
|
4918
4918
|
* @returns a base value to store along with the mutation, or null for
|
|
4919
4919
|
* idempotent transforms.
|
|
4920
|
-
*/ function
|
|
4920
|
+
*/ function bs(t, e) {
|
|
4921
4921
|
return t instanceof xs ? He(n = e) || function(t) {
|
|
4922
4922
|
return !!t && "doubleValue" in t;
|
|
4923
4923
|
}
|
|
@@ -4928,7 +4928,7 @@ function ps() {
|
|
|
4928
4928
|
}
|
|
4929
4929
|
|
|
4930
4930
|
/** Transforms a value into a server-generated timestamp. */
|
|
4931
|
-
class
|
|
4931
|
+
class Ps extends As {}
|
|
4932
4932
|
|
|
4933
4933
|
/** Transforms an array value via a union operation. */ class Vs extends As {
|
|
4934
4934
|
constructor(t) {
|
|
@@ -5005,7 +5005,7 @@ function ks(t) {
|
|
|
5005
5005
|
|
|
5006
5006
|
function $s(t, e) {
|
|
5007
5007
|
return t.field.isEqual(e.field) && function(t, e) {
|
|
5008
|
-
return t instanceof Vs && e instanceof Vs || t instanceof Ds && e instanceof Ds ? nt(t.elements, e.elements, qe) : t instanceof xs && e instanceof xs ? qe(t._t, e._t) : t instanceof
|
|
5008
|
+
return t instanceof Vs && e instanceof Vs || t instanceof Ds && e instanceof Ds ? nt(t.elements, e.elements, qe) : t instanceof xs && e instanceof xs ? qe(t._t, e._t) : t instanceof Ps && e instanceof Ps;
|
|
5009
5009
|
}(t.transform, e.transform);
|
|
5010
5010
|
}
|
|
5011
5011
|
|
|
@@ -5250,7 +5250,7 @@ class Os {
|
|
|
5250
5250
|
*/ function Gs(t, e) {
|
|
5251
5251
|
let n = null;
|
|
5252
5252
|
for (const s of t.fieldTransforms) {
|
|
5253
|
-
const t = e.data.field(s.field), i =
|
|
5253
|
+
const t = e.data.field(s.field), i = bs(s.transform, t || null);
|
|
5254
5254
|
null != i && (null === n && (n = un.empty()), n.set(s.field, i));
|
|
5255
5255
|
}
|
|
5256
5256
|
return n || null;
|
|
@@ -6049,13 +6049,13 @@ class _i extends Error {
|
|
|
6049
6049
|
* document went out of view without the server sending a new document.
|
|
6050
6050
|
*/
|
|
6051
6051
|
s) {
|
|
6052
|
-
this.Rt = t, this.removedTargetIds = e, this.key = n, this.
|
|
6052
|
+
this.Rt = t, this.removedTargetIds = e, this.key = n, this.bt = s;
|
|
6053
6053
|
}
|
|
6054
6054
|
}
|
|
6055
6055
|
|
|
6056
6056
|
class pi {
|
|
6057
6057
|
constructor(t, e) {
|
|
6058
|
-
this.targetId = t, this.
|
|
6058
|
+
this.targetId = t, this.Pt = e;
|
|
6059
6059
|
}
|
|
6060
6060
|
}
|
|
6061
6061
|
|
|
@@ -6195,8 +6195,8 @@ class Ei {
|
|
|
6195
6195
|
/**
|
|
6196
6196
|
* Processes and adds the DocumentWatchChange to the current set of changes.
|
|
6197
6197
|
*/ Wt(t) {
|
|
6198
|
-
for (const e of t.Rt) t.
|
|
6199
|
-
for (const e of t.removedTargetIds) this.Jt(e, t.key, t.
|
|
6198
|
+
for (const e of t.Rt) t.bt && t.bt.isFoundDocument() ? this.Ht(e, t.bt) : this.Jt(e, t.key, t.bt);
|
|
6199
|
+
for (const e of t.removedTargetIds) this.Jt(e, t.key, t.bt);
|
|
6200
6200
|
}
|
|
6201
6201
|
/** Processes and adds the WatchTargetChange to the current set of changes. */ Yt(t) {
|
|
6202
6202
|
this.forEachTarget(t, (e => {
|
|
@@ -6256,7 +6256,7 @@ class Ei {
|
|
|
6256
6256
|
* `pendingTargetResets`.
|
|
6257
6257
|
*/ ee(t) {
|
|
6258
6258
|
var e;
|
|
6259
|
-
const n = t.targetId, s = t.
|
|
6259
|
+
const n = t.targetId, s = t.Pt.count, i = this.ne(n);
|
|
6260
6260
|
if (i) {
|
|
6261
6261
|
const r = i.target;
|
|
6262
6262
|
if (Fn(r)) if (0 === s) {
|
|
@@ -6311,7 +6311,7 @@ class Ei {
|
|
|
6311
6311
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
6312
6312
|
* See the License for the specific language governing permissions and
|
|
6313
6313
|
* limitations under the License.
|
|
6314
|
-
*/ (s, i, t.
|
|
6314
|
+
*/ (s, i, t.Pt));
|
|
6315
6315
|
}
|
|
6316
6316
|
}
|
|
6317
6317
|
}
|
|
@@ -6320,14 +6320,14 @@ class Ei {
|
|
|
6320
6320
|
* Apply bloom filter to remove the deleted documents, and return the
|
|
6321
6321
|
* application status.
|
|
6322
6322
|
*/ ie(t, e) {
|
|
6323
|
-
const {unchangedNames: n, count: s} = t.
|
|
6323
|
+
const {unchangedNames: n, count: s} = t.Pt;
|
|
6324
6324
|
if (!n || !n.bits) return 1 /* BloomFilterApplicationStatus.Skipped */;
|
|
6325
6325
|
const {bits: {bitmap: i = "", padding: r = 0}, hashCount: o = 0} = n;
|
|
6326
6326
|
let u, c;
|
|
6327
6327
|
try {
|
|
6328
6328
|
u = xe(i).toUint8Array();
|
|
6329
6329
|
} catch (t) {
|
|
6330
|
-
if (t instanceof
|
|
6330
|
+
if (t instanceof be) return M("Decoding the base64 bloom filter in existence filter failed (" + t.message + "); ignoring the bloom filter and falling back to full re-query."),
|
|
6331
6331
|
1 /* BloomFilterApplicationStatus.Skipped */;
|
|
6332
6332
|
throw t;
|
|
6333
6333
|
}
|
|
@@ -6490,7 +6490,7 @@ const Ri = (() => {
|
|
|
6490
6490
|
desc: "DESCENDING"
|
|
6491
6491
|
};
|
|
6492
6492
|
return t;
|
|
6493
|
-
})(),
|
|
6493
|
+
})(), bi = (() => {
|
|
6494
6494
|
const t = {
|
|
6495
6495
|
"<": "LESS_THAN",
|
|
6496
6496
|
"<=": "LESS_THAN_OR_EQUAL",
|
|
@@ -6504,7 +6504,7 @@ const Ri = (() => {
|
|
|
6504
6504
|
"array-contains-any": "ARRAY_CONTAINS_ANY"
|
|
6505
6505
|
};
|
|
6506
6506
|
return t;
|
|
6507
|
-
})(),
|
|
6507
|
+
})(), Pi = (() => {
|
|
6508
6508
|
const t = {
|
|
6509
6509
|
and: "AND",
|
|
6510
6510
|
or: "OR"
|
|
@@ -6727,7 +6727,7 @@ function ji(t, e) {
|
|
|
6727
6727
|
}
|
|
6728
6728
|
return e.fieldTransforms.length > 0 && (n.updateTransforms = e.fieldTransforms.map((t => function(t, e) {
|
|
6729
6729
|
const n = e.transform;
|
|
6730
|
-
if (n instanceof
|
|
6730
|
+
if (n instanceof Ps) return {
|
|
6731
6731
|
fieldPath: e.field.canonicalString(),
|
|
6732
6732
|
setToServerValue: "REQUEST_TIME"
|
|
6733
6733
|
};
|
|
@@ -6762,7 +6762,7 @@ function zi(t, e) {
|
|
|
6762
6762
|
return void 0 !== t.updateTime ? Fs.updateTime(Ni(t.updateTime)) : void 0 !== t.exists ? Fs.exists(t.exists) : Fs.none();
|
|
6763
6763
|
}(e.currentDocument) : Fs.none(), s = e.updateTransforms ? e.updateTransforms.map((e => function(t, e) {
|
|
6764
6764
|
let n = null;
|
|
6765
|
-
if ("setToServerValue" in e) F("REQUEST_TIME" === e.setToServerValue), n = new
|
|
6765
|
+
if ("setToServerValue" in e) F("REQUEST_TIME" === e.setToServerValue), n = new Ps; else if ("appendMissingElements" in e) {
|
|
6766
6766
|
const t = e.appendMissingElements.values || [];
|
|
6767
6767
|
n = new Vs(t);
|
|
6768
6768
|
} else if ("removeAllFromArray" in e) {
|
|
@@ -7027,11 +7027,11 @@ function tr(t) {
|
|
|
7027
7027
|
}
|
|
7028
7028
|
|
|
7029
7029
|
function er(t) {
|
|
7030
|
-
return
|
|
7030
|
+
return bi[t];
|
|
7031
7031
|
}
|
|
7032
7032
|
|
|
7033
7033
|
function nr(t) {
|
|
7034
|
-
return
|
|
7034
|
+
return Pi[t];
|
|
7035
7035
|
}
|
|
7036
7036
|
|
|
7037
7037
|
function sr(t) {
|
|
@@ -7460,7 +7460,7 @@ function Tr(t, e, n, s) {
|
|
|
7460
7460
|
return new Rr(t, n);
|
|
7461
7461
|
}
|
|
7462
7462
|
getOverlay(t, e) {
|
|
7463
|
-
return
|
|
7463
|
+
return br(t).get(Ir(this.userId, e)).next((t => t ? pr(this.serializer, t) : null));
|
|
7464
7464
|
}
|
|
7465
7465
|
getOverlays(t, e) {
|
|
7466
7466
|
const n = fs();
|
|
@@ -7484,13 +7484,13 @@ function Tr(t, e, n, s) {
|
|
|
7484
7484
|
const s = IDBKeyRange.bound([ this.userId, e, n ], [ this.userId, e, n + 1 ],
|
|
7485
7485
|
/*lowerOpen=*/ !1,
|
|
7486
7486
|
/*upperOpen=*/ !0);
|
|
7487
|
-
i.push(
|
|
7487
|
+
i.push(br(t).J("collectionPathOverlayIndex", s));
|
|
7488
7488
|
})), Rt.waitFor(i);
|
|
7489
7489
|
}
|
|
7490
7490
|
getOverlaysForCollection(t, e, n) {
|
|
7491
7491
|
const s = fs(), i = qt(e), r = IDBKeyRange.bound([ this.userId, i, n ], [ this.userId, i, Number.POSITIVE_INFINITY ],
|
|
7492
7492
|
/*lowerOpen=*/ !0);
|
|
7493
|
-
return
|
|
7493
|
+
return br(t).j("collectionPathOverlayIndex", r).next((t => {
|
|
7494
7494
|
for (const e of t) {
|
|
7495
7495
|
const t = pr(this.serializer, e);
|
|
7496
7496
|
s.set(t.getKey(), t);
|
|
@@ -7505,7 +7505,7 @@ function Tr(t, e, n, s) {
|
|
|
7505
7505
|
// is not inclusive.
|
|
7506
7506
|
const o = IDBKeyRange.bound([ this.userId, e, n ], [ this.userId, e, Number.POSITIVE_INFINITY ],
|
|
7507
7507
|
/*lowerOpen=*/ !0);
|
|
7508
|
-
return
|
|
7508
|
+
return br(t).X({
|
|
7509
7509
|
index: "collectionGroupOverlayIndex",
|
|
7510
7510
|
range: o
|
|
7511
7511
|
}, ((t, e, n) => {
|
|
@@ -7518,7 +7518,7 @@ function Tr(t, e, n, s) {
|
|
|
7518
7518
|
})).next((() => i));
|
|
7519
7519
|
}
|
|
7520
7520
|
de(t, e) {
|
|
7521
|
-
return
|
|
7521
|
+
return br(t).put(function(t, e, n) {
|
|
7522
7522
|
const [s, i, r] = Ir(e, n.mutation.key);
|
|
7523
7523
|
return {
|
|
7524
7524
|
userId: e,
|
|
@@ -7534,7 +7534,7 @@ function Tr(t, e, n, s) {
|
|
|
7534
7534
|
|
|
7535
7535
|
/**
|
|
7536
7536
|
* Helper to get a typed SimpleDbStore for the document overlay object store.
|
|
7537
|
-
*/ function
|
|
7537
|
+
*/ function br(t) {
|
|
7538
7538
|
return _e(t, "documentOverlays");
|
|
7539
7539
|
}
|
|
7540
7540
|
|
|
@@ -7557,7 +7557,7 @@ function Tr(t, e, n, s) {
|
|
|
7557
7557
|
// Note: This code is copied from the backend. Code that is not used by
|
|
7558
7558
|
// Firestore was removed.
|
|
7559
7559
|
/** Firestore index value writer. */
|
|
7560
|
-
class
|
|
7560
|
+
class Pr {
|
|
7561
7561
|
constructor() {}
|
|
7562
7562
|
// The write methods below short-circuit writing terminators for values
|
|
7563
7563
|
// containing a (terminating) truncated value.
|
|
@@ -7590,9 +7590,9 @@ class br {
|
|
|
7590
7590
|
this.Te(e)) : "arrayValue" in t ? (this.Re(t.arrayValue, e), this.Te(e)) : O();
|
|
7591
7591
|
}
|
|
7592
7592
|
Ie(t, e) {
|
|
7593
|
-
this.ge(e, 25), this.
|
|
7593
|
+
this.ge(e, 25), this.be(t, e);
|
|
7594
7594
|
}
|
|
7595
|
-
|
|
7595
|
+
be(t, e) {
|
|
7596
7596
|
e.pe(t);
|
|
7597
7597
|
}
|
|
7598
7598
|
ve(t, e) {
|
|
@@ -7608,7 +7608,7 @@ class br {
|
|
|
7608
7608
|
Ae(t, e) {
|
|
7609
7609
|
this.ge(e, 37);
|
|
7610
7610
|
ht.fromName(t).path.forEach((t => {
|
|
7611
|
-
this.ge(e, 60), this.
|
|
7611
|
+
this.ge(e, 60), this.be(t, e);
|
|
7612
7612
|
}));
|
|
7613
7613
|
}
|
|
7614
7614
|
ge(t, e) {
|
|
@@ -7622,7 +7622,7 @@ class br {
|
|
|
7622
7622
|
}
|
|
7623
7623
|
}
|
|
7624
7624
|
|
|
7625
|
-
|
|
7625
|
+
Pr.Pe = new Pr;
|
|
7626
7626
|
|
|
7627
7627
|
/**
|
|
7628
7628
|
* Counts the number of zeros in a byte.
|
|
@@ -8548,20 +8548,20 @@ class Jr {
|
|
|
8548
8548
|
const t = e.data.field(s.fieldPath);
|
|
8549
8549
|
if (null == t) return null;
|
|
8550
8550
|
const i = n.We(s.kind);
|
|
8551
|
-
|
|
8551
|
+
Pr.Pe.we(t, i);
|
|
8552
8552
|
}
|
|
8553
8553
|
return n.Ge();
|
|
8554
8554
|
}
|
|
8555
8555
|
/** Encodes a single value to the ascending index format. */ fn(t) {
|
|
8556
8556
|
const e = new Nr;
|
|
8557
|
-
return
|
|
8557
|
+
return Pr.Pe.we(t, e.We(0 /* IndexKind.ASCENDING */)), e.Ge();
|
|
8558
8558
|
}
|
|
8559
8559
|
/**
|
|
8560
8560
|
* Returns an encoded form of the document key that sorts based on the key
|
|
8561
8561
|
* ordering of the field index.
|
|
8562
8562
|
*/ mn(t, e) {
|
|
8563
8563
|
const n = new Nr;
|
|
8564
|
-
return
|
|
8564
|
+
return Pr.Pe.we(We(this.databaseId, e), n.We(function(t) {
|
|
8565
8565
|
const e = dt(t);
|
|
8566
8566
|
return 0 === e.length ? 0 /* IndexKind.ASCENDING */ : e[e.length - 1].kind;
|
|
8567
8567
|
}(t))), n.Ge();
|
|
@@ -8578,7 +8578,7 @@ class Jr {
|
|
|
8578
8578
|
const t = n[i++];
|
|
8579
8579
|
for (const n of s) if (this.gn(e, r.fieldPath) && Je(t)) s = this.yn(s, r, t); else {
|
|
8580
8580
|
const e = n.We(r.kind);
|
|
8581
|
-
|
|
8581
|
+
Pr.Pe.we(t, e);
|
|
8582
8582
|
}
|
|
8583
8583
|
}
|
|
8584
8584
|
return this.pn(s);
|
|
@@ -8604,7 +8604,7 @@ class Jr {
|
|
|
8604
8604
|
const s = [ ...t ], i = [];
|
|
8605
8605
|
for (const t of n.arrayValue.values || []) for (const n of s) {
|
|
8606
8606
|
const s = new Nr;
|
|
8607
|
-
s.seed(n.Ge()),
|
|
8607
|
+
s.seed(n.Ge()), Pr.Pe.we(t, s.We(e.kind)), i.push(s);
|
|
8608
8608
|
}
|
|
8609
8609
|
return i;
|
|
8610
8610
|
}
|
|
@@ -8753,13 +8753,13 @@ class Jr {
|
|
|
8753
8753
|
for (let t = 0; t < s.length; t += 2) {
|
|
8754
8754
|
// If we encounter two bounds that will create an unmatchable key range,
|
|
8755
8755
|
// then we return an empty set of key ranges.
|
|
8756
|
-
if (this.
|
|
8756
|
+
if (this.bn(s[t], s[t + 1])) return [];
|
|
8757
8757
|
const e = [ s[t].indexId, this.uid, s[t].arrayValue, s[t].directionalValue, Hr, [] ], n = [ s[t + 1].indexId, this.uid, s[t + 1].arrayValue, s[t + 1].directionalValue, Hr, [] ];
|
|
8758
8758
|
i.push(IDBKeyRange.bound(e, n));
|
|
8759
8759
|
}
|
|
8760
8760
|
return i;
|
|
8761
8761
|
}
|
|
8762
|
-
|
|
8762
|
+
bn(t, e) {
|
|
8763
8763
|
// If lower bound is greater than the upper bound, then the key
|
|
8764
8764
|
// range can never be matched.
|
|
8765
8765
|
return Mr(t, e) > 0;
|
|
@@ -8935,7 +8935,7 @@ class oo {
|
|
|
8935
8935
|
* view of the documents that were previously affected by the mutation.
|
|
8936
8936
|
*/
|
|
8937
8937
|
// PORTING NOTE: Multi-tab only.
|
|
8938
|
-
this.
|
|
8938
|
+
this.Pn = {};
|
|
8939
8939
|
}
|
|
8940
8940
|
/**
|
|
8941
8941
|
* Creates a new mutation queue for the given user.
|
|
@@ -8991,7 +8991,7 @@ class oo {
|
|
|
8991
8991
|
return h.forEach((e => {
|
|
8992
8992
|
a.push(this.indexManager.addToCollectionParentIndex(t, e));
|
|
8993
8993
|
})), t.addOnCommittedListener((() => {
|
|
8994
|
-
this.
|
|
8994
|
+
this.Pn[o] = u.keys();
|
|
8995
8995
|
})), Rt.waitFor(a).next((() => u));
|
|
8996
8996
|
}));
|
|
8997
8997
|
}
|
|
@@ -9006,10 +9006,10 @@ class oo {
|
|
|
9006
9006
|
*/
|
|
9007
9007
|
// PORTING NOTE: Multi-tab only.
|
|
9008
9008
|
Vn(t, e) {
|
|
9009
|
-
return this.
|
|
9009
|
+
return this.Pn[e] ? Rt.resolve(this.Pn[e]) : this.lookupMutationBatch(t, e).next((t => {
|
|
9010
9010
|
if (t) {
|
|
9011
9011
|
const n = t.keys();
|
|
9012
|
-
return this.
|
|
9012
|
+
return this.Pn[e] = n, n;
|
|
9013
9013
|
}
|
|
9014
9014
|
return null;
|
|
9015
9015
|
}));
|
|
@@ -9127,7 +9127,7 @@ class oo {
|
|
|
9127
9127
|
*/
|
|
9128
9128
|
// PORTING NOTE: Multi-tab only
|
|
9129
9129
|
Dn(t) {
|
|
9130
|
-
delete this.
|
|
9130
|
+
delete this.Pn[t];
|
|
9131
9131
|
}
|
|
9132
9132
|
performConsistencyCheck(t) {
|
|
9133
9133
|
return this.checkEmpty(t).next((e => {
|
|
@@ -9960,7 +9960,7 @@ function Ao(t, e) {
|
|
|
9960
9960
|
})).next((() => i));
|
|
9961
9961
|
}
|
|
9962
9962
|
newChangeBuffer(t) {
|
|
9963
|
-
return new
|
|
9963
|
+
return new Po(this, !!t && t.trackRemovals);
|
|
9964
9964
|
}
|
|
9965
9965
|
getSize(t) {
|
|
9966
9966
|
return this.getMetadata(t).next((t => t.byteSize));
|
|
@@ -9985,7 +9985,7 @@ function Ao(t, e) {
|
|
|
9985
9985
|
}
|
|
9986
9986
|
}
|
|
9987
9987
|
|
|
9988
|
-
/** Creates a new IndexedDbRemoteDocumentCache. */ function
|
|
9988
|
+
/** Creates a new IndexedDbRemoteDocumentCache. */ function bo(t) {
|
|
9989
9989
|
return new Ro(t);
|
|
9990
9990
|
}
|
|
9991
9991
|
|
|
@@ -9995,7 +9995,7 @@ function Ao(t, e) {
|
|
|
9995
9995
|
* Unlike the MemoryRemoteDocumentChangeBuffer, the IndexedDb implementation computes the size
|
|
9996
9996
|
* delta for all submitted changes. This avoids having to re-read all documents from IndexedDb
|
|
9997
9997
|
* when we apply the changes.
|
|
9998
|
-
*/ class
|
|
9998
|
+
*/ class Po extends vo {
|
|
9999
9999
|
/**
|
|
10000
10000
|
* @param documentCache - The IndexedDbRemoteDocumentCache to apply the changes to.
|
|
10001
10001
|
* @param trackRemovals - Whether to create sentinel deletes that can be tracked by
|
|
@@ -10681,7 +10681,7 @@ class Fo {
|
|
|
10681
10681
|
return Rt.resolve(this.Rs(e));
|
|
10682
10682
|
}
|
|
10683
10683
|
getNextMutationBatchAfterBatchId(t, e) {
|
|
10684
|
-
const n = e + 1, s = this.
|
|
10684
|
+
const n = e + 1, s = this.bs(n), i = s < 0 ? 0 : s;
|
|
10685
10685
|
// The requested batchId may still be out of range so normalize it to the
|
|
10686
10686
|
// start of the queue.
|
|
10687
10687
|
return Rt.resolve(this.mutationQueue.length > i ? this.mutationQueue[i] : null);
|
|
@@ -10706,7 +10706,7 @@ class Fo {
|
|
|
10706
10706
|
this.vs.forEachInRange([ e, s ], (t => {
|
|
10707
10707
|
n = n.add(t.Es);
|
|
10708
10708
|
}));
|
|
10709
|
-
})), Rt.resolve(this.
|
|
10709
|
+
})), Rt.resolve(this.Ps(n));
|
|
10710
10710
|
}
|
|
10711
10711
|
getAllMutationBatchesAffectingQuery(t, e) {
|
|
10712
10712
|
// Use the query path as a prefix for testing if a document matches the
|
|
@@ -10731,9 +10731,9 @@ class Fo {
|
|
|
10731
10731
|
// TODO(mcg): we'll need a different scanner when we implement
|
|
10732
10732
|
// ancestor queries.
|
|
10733
10733
|
e.length === s && (o = o.add(t.Es)), !0);
|
|
10734
|
-
}), r), Rt.resolve(this.
|
|
10734
|
+
}), r), Rt.resolve(this.Ps(o));
|
|
10735
10735
|
}
|
|
10736
|
-
|
|
10736
|
+
Ps(t) {
|
|
10737
10737
|
// Construct an array of matching batches, sorted by batchID to ensure that
|
|
10738
10738
|
// multiple mutations affecting the same document key are applied in order.
|
|
10739
10739
|
const e = [];
|
|
@@ -10770,7 +10770,7 @@ class Fo {
|
|
|
10770
10770
|
* @param action - A description of what the caller is doing, phrased in passive
|
|
10771
10771
|
* form (e.g. "acknowledged" in a routine that acknowledges batches).
|
|
10772
10772
|
*/ Vs(t, e) {
|
|
10773
|
-
return this.
|
|
10773
|
+
return this.bs(t);
|
|
10774
10774
|
}
|
|
10775
10775
|
/**
|
|
10776
10776
|
* Finds the index of the given batchId in the mutation queue. This operation
|
|
@@ -10780,7 +10780,7 @@ class Fo {
|
|
|
10780
10780
|
* the state of the queue. Note this index can be negative if the requested
|
|
10781
10781
|
* batchId has already been remvoed from the queue or past the end of the
|
|
10782
10782
|
* queue if the batchId is larger than the last added batch.
|
|
10783
|
-
*/
|
|
10783
|
+
*/ bs(t) {
|
|
10784
10784
|
if (0 === this.mutationQueue.length)
|
|
10785
10785
|
// As an index this is past the end of the queue
|
|
10786
10786
|
return 0;
|
|
@@ -10794,7 +10794,7 @@ class Fo {
|
|
|
10794
10794
|
* A version of lookupMutationBatch that doesn't return a promise, this makes
|
|
10795
10795
|
* other functions that uses this code easier to read and more efficent.
|
|
10796
10796
|
*/ Rs(t) {
|
|
10797
|
-
const e = this.
|
|
10797
|
+
const e = this.bs(t);
|
|
10798
10798
|
if (e < 0 || e >= this.mutationQueue.length) return null;
|
|
10799
10799
|
return this.mutationQueue[e];
|
|
10800
10800
|
}
|
|
@@ -11276,7 +11276,7 @@ class jo {
|
|
|
11276
11276
|
* to SCHEMA_VERSION. Different values of toVersion are only used for testing
|
|
11277
11277
|
* and local feature development.
|
|
11278
11278
|
*/ O(t, e, n, s) {
|
|
11279
|
-
const i = new
|
|
11279
|
+
const i = new bt("createOrUpgrade", e);
|
|
11280
11280
|
n < 1 && s >= 1 && (function(t) {
|
|
11281
11281
|
t.createObjectStore("owner");
|
|
11282
11282
|
}(t), function(t) {
|
|
@@ -11511,7 +11511,7 @@ class jo {
|
|
|
11511
11511
|
})).next((() => Rt.waitFor(s)));
|
|
11512
11512
|
}
|
|
11513
11513
|
ni(t, e) {
|
|
11514
|
-
const n = e.store("mutations"), s =
|
|
11514
|
+
const n = e.store("mutations"), s = bo(this.serializer), i = new Ko(Qo.js, this.serializer.le);
|
|
11515
11515
|
return n.j().next((t => {
|
|
11516
11516
|
const n = new Map;
|
|
11517
11517
|
return t.forEach((t => {
|
|
@@ -11618,8 +11618,8 @@ class Jo {
|
|
|
11618
11618
|
/** A listener to notify on primary state changes. */
|
|
11619
11619
|
this.li = t => Promise.resolve(), !Jo.D()) throw new U(q.UNIMPLEMENTED, "This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.");
|
|
11620
11620
|
this.referenceDelegate = new Eo(this, s), this.fi = e + "main", this.serializer = new ar(u),
|
|
11621
|
-
this.di = new
|
|
11622
|
-
this.remoteDocumentCache =
|
|
11621
|
+
this.di = new Pt(this.fi, this.oi, new zo(this.serializer)), this.Fs = new fo(this.referenceDelegate, this.serializer),
|
|
11622
|
+
this.remoteDocumentCache = bo(this.serializer), this.Ls = new Er, this.window && this.window.localStorage ? this.wi = this.window.localStorage : (this.wi = null,
|
|
11623
11623
|
!1 === a && k("IndexedDbPersistence", "LocalStorage is unavailable. As a result, persistence may not work reliably. In particular enablePersistence() could fail immediately after refreshing the page."));
|
|
11624
11624
|
}
|
|
11625
11625
|
/**
|
|
@@ -11714,8 +11714,8 @@ class Jo {
|
|
|
11714
11714
|
* If the garbage collection threshold has passed, prunes the
|
|
11715
11715
|
* RemoteDocumentChanges and the ClientMetadata store based on the last update
|
|
11716
11716
|
* time of all clients.
|
|
11717
|
-
*/ async
|
|
11718
|
-
if (this.isPrimary && !this.
|
|
11717
|
+
*/ async bi() {
|
|
11718
|
+
if (this.isPrimary && !this.Pi(this.hi, 18e5)) {
|
|
11719
11719
|
this.hi = Date.now();
|
|
11720
11720
|
const t = await this.runTransaction("maybeGarbageCollectMultiClientState", "readwrite-primary", (t => {
|
|
11721
11721
|
const e = _e(t, "clientMetadata");
|
|
@@ -11737,7 +11737,7 @@ class Jo {
|
|
|
11737
11737
|
* Schedules a recurring timer to update the client metadata and to either
|
|
11738
11738
|
* extend or acquire the primary lease if the client is eligible.
|
|
11739
11739
|
*/ yi() {
|
|
11740
|
-
this.ai = this.si.enqueueAfterDelay("client_metadata_refresh" /* TimerId.ClientMetadataRefresh */ , 4e3, (() => this._i().then((() => this.
|
|
11740
|
+
this.ai = this.si.enqueueAfterDelay("client_metadata_refresh" /* TimerId.ClientMetadataRefresh */ , 4e3, (() => this._i().then((() => this.bi())).then((() => this.yi()))));
|
|
11741
11741
|
}
|
|
11742
11742
|
/** Checks whether `client` is the local client. */ vi(t) {
|
|
11743
11743
|
return !!t && t.ownerId === this.clientId;
|
|
@@ -11760,7 +11760,7 @@ class Jo {
|
|
|
11760
11760
|
// - every clients network is disabled and no other client's tab is in
|
|
11761
11761
|
// the foreground.
|
|
11762
11762
|
// - the `forceOwningTab` setting was passed in.
|
|
11763
|
-
if (null !== e && this.
|
|
11763
|
+
if (null !== e && this.Pi(e.leaseTimestampMs, 5e3) && !this.Di(e.ownerId)) {
|
|
11764
11764
|
if (this.vi(e) && this.networkEnabled) return !0;
|
|
11765
11765
|
if (!this.vi(e)) {
|
|
11766
11766
|
if (!e.allowTabSynchronization)
|
|
@@ -11808,7 +11808,7 @@ class Jo {
|
|
|
11808
11808
|
* Returns clients that are not zombied and have an updateTime within the
|
|
11809
11809
|
* provided threshold.
|
|
11810
11810
|
*/ Vi(t, e) {
|
|
11811
|
-
return t.filter((t => this.
|
|
11811
|
+
return t.filter((t => this.Pi(t.updateTimeMs, e) && !this.Di(t.clientId)));
|
|
11812
11812
|
}
|
|
11813
11813
|
/**
|
|
11814
11814
|
* Returns the IDs of the clients that are currently active. If multi-tab
|
|
@@ -11864,7 +11864,7 @@ class Jo {
|
|
|
11864
11864
|
// be turned off.
|
|
11865
11865
|
$i(t) {
|
|
11866
11866
|
return Yo(t).get("owner").next((t => {
|
|
11867
|
-
if (null !== t && this.
|
|
11867
|
+
if (null !== t && this.Pi(t.leaseTimestampMs, 5e3) && !this.Di(t.ownerId) && !this.vi(t) && !(this.ri || this.allowTabSynchronization && t.allowTabSynchronization)) throw new U(q.FAILED_PRECONDITION, Ho);
|
|
11868
11868
|
}));
|
|
11869
11869
|
}
|
|
11870
11870
|
/**
|
|
@@ -11879,14 +11879,14 @@ class Jo {
|
|
|
11879
11879
|
return Yo(t).put("owner", e);
|
|
11880
11880
|
}
|
|
11881
11881
|
static D() {
|
|
11882
|
-
return
|
|
11882
|
+
return Pt.D();
|
|
11883
11883
|
}
|
|
11884
11884
|
/** Checks the primary lease and removes it if we are the current primary. */ Ei(t) {
|
|
11885
11885
|
const e = Yo(t);
|
|
11886
11886
|
return e.get("owner").next((t => this.vi(t) ? (N("IndexedDbPersistence", "Releasing primary lease."),
|
|
11887
11887
|
e.delete("owner")) : Rt.resolve()));
|
|
11888
11888
|
}
|
|
11889
|
-
/** Verifies that `updateTimeMs` is within `maxAgeMs`. */
|
|
11889
|
+
/** Verifies that `updateTimeMs` is within `maxAgeMs`. */ Pi(t, e) {
|
|
11890
11890
|
const n = Date.now();
|
|
11891
11891
|
return !(t < n - e) && (!(t > n) || (k(`Detected an update time that is in the future: ${t} > ${n}`),
|
|
11892
11892
|
!1));
|
|
@@ -12819,7 +12819,7 @@ class Ru {
|
|
|
12819
12819
|
* `WebStorageSharedClientState` uses WebStorage (window.localStorage) as the
|
|
12820
12820
|
* backing store for the SharedClientState. It keeps track of all active
|
|
12821
12821
|
* clients and supports modifications of the local client's data.
|
|
12822
|
-
*/ class
|
|
12822
|
+
*/ class bu {
|
|
12823
12823
|
constructor(t, e, n, s, i) {
|
|
12824
12824
|
this.window = t, this.si = e, this.persistenceKey = n, this.dr = s, this.syncEngine = null,
|
|
12825
12825
|
this.onlineStateHandler = null, this.sequenceNumberHandler = null, this.wr = this._r.bind(this),
|
|
@@ -12899,8 +12899,8 @@ class Ru {
|
|
|
12899
12899
|
// if applicable.
|
|
12900
12900
|
const e = this.storage.getItem(this.Ar);
|
|
12901
12901
|
if (e) {
|
|
12902
|
-
const t = this.
|
|
12903
|
-
t && this.
|
|
12902
|
+
const t = this.br(e);
|
|
12903
|
+
t && this.Pr(t);
|
|
12904
12904
|
}
|
|
12905
12905
|
for (const t of this.gr) this._r(t);
|
|
12906
12906
|
this.gr = [],
|
|
@@ -13011,8 +13011,8 @@ class Ru {
|
|
|
13011
13011
|
}
|
|
13012
13012
|
} else if (e.key === this.Ar) {
|
|
13013
13013
|
if (null !== e.newValue) {
|
|
13014
|
-
const t = this.
|
|
13015
|
-
if (t) return this.
|
|
13014
|
+
const t = this.br(e.newValue);
|
|
13015
|
+
if (t) return this.Pr(t);
|
|
13016
13016
|
}
|
|
13017
13017
|
} else if (e.key === this.pr) {
|
|
13018
13018
|
const t = function(t) {
|
|
@@ -13099,7 +13099,7 @@ class Ru {
|
|
|
13099
13099
|
/**
|
|
13100
13100
|
* Parses an online state from WebStorage. Returns 'null' if the value
|
|
13101
13101
|
* could not be parsed.
|
|
13102
|
-
*/
|
|
13102
|
+
*/ br(t) {
|
|
13103
13103
|
return vu.cr(t);
|
|
13104
13104
|
}
|
|
13105
13105
|
Kr(t) {
|
|
@@ -13122,7 +13122,7 @@ class Ru {
|
|
|
13122
13122
|
this.mr = n;
|
|
13123
13123
|
}));
|
|
13124
13124
|
}
|
|
13125
|
-
|
|
13125
|
+
Pr(t) {
|
|
13126
13126
|
// We check whether the client that wrote this online state is still active
|
|
13127
13127
|
// by comparing its client ID to the list of clients kept active in
|
|
13128
13128
|
// IndexedDb. If a client does not update their IndexedDb client state
|
|
@@ -13138,7 +13138,7 @@ class Ru {
|
|
|
13138
13138
|
}
|
|
13139
13139
|
}
|
|
13140
13140
|
|
|
13141
|
-
class
|
|
13141
|
+
class Pu {
|
|
13142
13142
|
constructor() {
|
|
13143
13143
|
this.Wr = new Ru, this.Hr = {}, this.onlineStateHandler = null, this.sequenceNumberHandler = null;
|
|
13144
13144
|
}
|
|
@@ -13739,7 +13739,7 @@ class Bu {
|
|
|
13739
13739
|
* Note that jitter will still be applied, so the actual delay could be as
|
|
13740
13740
|
* much as 1.5*maxDelayMs.
|
|
13741
13741
|
*/ , i = 6e4) {
|
|
13742
|
-
this.si = t, this.timerId = e, this.Ro = n, this.
|
|
13742
|
+
this.si = t, this.timerId = e, this.Ro = n, this.bo = s, this.Po = i, this.Vo = 0,
|
|
13743
13743
|
this.So = null,
|
|
13744
13744
|
/** The last backoff attempt, as epoch milliseconds. */
|
|
13745
13745
|
this.Do = Date.now(), this.reset();
|
|
@@ -13757,7 +13757,7 @@ class Bu {
|
|
|
13757
13757
|
* Resets the backoff delay to the maximum delay (e.g. for use after a
|
|
13758
13758
|
* RESOURCE_EXHAUSTED error).
|
|
13759
13759
|
*/ Co() {
|
|
13760
|
-
this.Vo = this.
|
|
13760
|
+
this.Vo = this.Po;
|
|
13761
13761
|
}
|
|
13762
13762
|
/**
|
|
13763
13763
|
* Returns a promise that resolves after currentDelayMs, and increases the
|
|
@@ -13775,7 +13775,7 @@ class Bu {
|
|
|
13775
13775
|
t()))),
|
|
13776
13776
|
// Apply backoff factor to determine next delay and ensure it is within
|
|
13777
13777
|
// bounds.
|
|
13778
|
-
this.Vo *= this.
|
|
13778
|
+
this.Vo *= this.bo, this.Vo < this.Ro && (this.Vo = this.Ro), this.Vo > this.Po && (this.Vo = this.Po);
|
|
13779
13779
|
}
|
|
13780
13780
|
ko() {
|
|
13781
13781
|
null !== this.So && (this.So.skipDelay(), this.So = null);
|
|
@@ -14405,11 +14405,11 @@ class Qu {
|
|
|
14405
14405
|
ec(this) && (N("RemoteStore", "Restarting streams for network reachability change."),
|
|
14406
14406
|
await async function(t) {
|
|
14407
14407
|
const e = L(t);
|
|
14408
|
-
e.Au.add(4 /* OfflineCause.ConnectivityChange */), await Wu(e), e.
|
|
14408
|
+
e.Au.add(4 /* OfflineCause.ConnectivityChange */), await Wu(e), e.bu.set("Unknown" /* OnlineState.Unknown */),
|
|
14409
14409
|
e.Au.delete(4 /* OfflineCause.ConnectivityChange */), await zu(e);
|
|
14410
14410
|
}(this));
|
|
14411
14411
|
}));
|
|
14412
|
-
})), this.
|
|
14412
|
+
})), this.bu = new Qu(n, s);
|
|
14413
14413
|
}
|
|
14414
14414
|
}
|
|
14415
14415
|
|
|
@@ -14446,14 +14446,14 @@ function Hu(t, e) {
|
|
|
14446
14446
|
// Revert to OnlineState.Unknown if the watch stream is not open and we
|
|
14447
14447
|
// have no listeners, since without any listens to send we cannot
|
|
14448
14448
|
// confirm if the stream is healthy and upgrade to OnlineState.Online.
|
|
14449
|
-
n.
|
|
14449
|
+
n.bu.set("Unknown" /* OnlineState.Unknown */));
|
|
14450
14450
|
}
|
|
14451
14451
|
|
|
14452
14452
|
/**
|
|
14453
14453
|
* We need to increment the the expected number of pending responses we're due
|
|
14454
14454
|
* from watch so we wait for the ack to process any messages from this target.
|
|
14455
14455
|
*/ function Yu(t, e) {
|
|
14456
|
-
if (t.
|
|
14456
|
+
if (t.Pu.Lt(e.targetId), e.resumeToken.approximateByteSize() > 0 || e.snapshotVersion.compareTo(rt.min()) > 0) {
|
|
14457
14457
|
const n = t.remoteSyncer.getRemoteKeysForTarget(e.targetId).size;
|
|
14458
14458
|
e = e.withExpectedCount(n);
|
|
14459
14459
|
}
|
|
@@ -14465,15 +14465,15 @@ function Hu(t, e) {
|
|
|
14465
14465
|
* from watch so we wait for the removal on the server before we process any
|
|
14466
14466
|
* messages from this target.
|
|
14467
14467
|
*/ function Xu(t, e) {
|
|
14468
|
-
t.
|
|
14468
|
+
t.Pu.Lt(e), pc(t).su(e);
|
|
14469
14469
|
}
|
|
14470
14470
|
|
|
14471
14471
|
function Zu(t) {
|
|
14472
|
-
t.
|
|
14472
|
+
t.Pu = new Ei({
|
|
14473
14473
|
getRemoteKeysForTarget: e => t.remoteSyncer.getRemoteKeysForTarget(e),
|
|
14474
14474
|
he: e => t.Eu.get(e) || null,
|
|
14475
14475
|
oe: () => t.datastore.serializer.databaseId
|
|
14476
|
-
}), pc(t).start(), t.
|
|
14476
|
+
}), pc(t).start(), t.bu.mu();
|
|
14477
14477
|
}
|
|
14478
14478
|
|
|
14479
14479
|
/**
|
|
@@ -14488,7 +14488,7 @@ function ec(t) {
|
|
|
14488
14488
|
}
|
|
14489
14489
|
|
|
14490
14490
|
function nc(t) {
|
|
14491
|
-
t.
|
|
14491
|
+
t.Pu = void 0;
|
|
14492
14492
|
}
|
|
14493
14493
|
|
|
14494
14494
|
async function sc(t) {
|
|
@@ -14500,17 +14500,17 @@ async function sc(t) {
|
|
|
14500
14500
|
async function ic(t, e) {
|
|
14501
14501
|
nc(t),
|
|
14502
14502
|
// If we still need the watch stream, retry the connection.
|
|
14503
|
-
tc(t) ? (t.
|
|
14503
|
+
tc(t) ? (t.bu.pu(e), Zu(t)) :
|
|
14504
14504
|
// No need to restart watch stream because there are no active targets.
|
|
14505
14505
|
// The online state is set to unknown because there is no active attempt
|
|
14506
14506
|
// at establishing a connection
|
|
14507
|
-
t.
|
|
14507
|
+
t.bu.set("Unknown" /* OnlineState.Unknown */);
|
|
14508
14508
|
}
|
|
14509
14509
|
|
|
14510
14510
|
async function rc(t, e, n) {
|
|
14511
14511
|
if (
|
|
14512
14512
|
// Mark the client as online since we got a message from the server
|
|
14513
|
-
t.
|
|
14513
|
+
t.bu.set("Online" /* OnlineState.Online */), e instanceof Ii && 2 /* WatchTargetChangeState.Removed */ === e.state && e.cause)
|
|
14514
14514
|
// There was an error on a target, don't wait for a consistent snapshot
|
|
14515
14515
|
// to raise events
|
|
14516
14516
|
try {
|
|
@@ -14520,7 +14520,7 @@ async function rc(t, e, n) {
|
|
|
14520
14520
|
const n = e.cause;
|
|
14521
14521
|
for (const s of e.targetIds)
|
|
14522
14522
|
// A watched target might have been removed already.
|
|
14523
|
-
t.Eu.has(s) && (await t.remoteSyncer.rejectListen(s, n), t.Eu.delete(s), t.
|
|
14523
|
+
t.Eu.has(s) && (await t.remoteSyncer.rejectListen(s, n), t.Eu.delete(s), t.Pu.removeTarget(s));
|
|
14524
14524
|
}
|
|
14525
14525
|
/**
|
|
14526
14526
|
* Attempts to fill our write pipeline with writes from the LocalStore.
|
|
@@ -14533,7 +14533,7 @@ async function rc(t, e, n) {
|
|
|
14533
14533
|
} catch (n) {
|
|
14534
14534
|
N("RemoteStore", "Failed to remove targets %s: %s ", e.targetIds.join(","), n),
|
|
14535
14535
|
await oc(t, n);
|
|
14536
|
-
} else if (e instanceof yi ? t.
|
|
14536
|
+
} else if (e instanceof yi ? t.Pu.Wt(e) : e instanceof pi ? t.Pu.ee(e) : t.Pu.Yt(e),
|
|
14537
14537
|
!n.isEqual(rt.min())) try {
|
|
14538
14538
|
const e = await ou(t.localStore);
|
|
14539
14539
|
n.compareTo(e) >= 0 &&
|
|
@@ -14546,7 +14546,7 @@ async function rc(t, e, n) {
|
|
|
14546
14546
|
* SyncEngine.
|
|
14547
14547
|
*/
|
|
14548
14548
|
function(t, e) {
|
|
14549
|
-
const n = t.
|
|
14549
|
+
const n = t.Pu.ue(e);
|
|
14550
14550
|
// Update in-memory resume tokens. LocalStore will update the
|
|
14551
14551
|
// persistent view of these when applying the completed RemoteEvent.
|
|
14552
14552
|
return n.targetChanges.forEach(((n, s) => {
|
|
@@ -14594,7 +14594,7 @@ async function rc(t, e, n) {
|
|
|
14594
14594
|
if (!Dt(e)) throw e;
|
|
14595
14595
|
t.Au.add(1 /* OfflineCause.IndexedDbFailed */),
|
|
14596
14596
|
// Disable network and raise offline snapshots
|
|
14597
|
-
await Wu(t), t.
|
|
14597
|
+
await Wu(t), t.bu.set("Offline" /* OnlineState.Offline */), n || (
|
|
14598
14598
|
// Use a simple read operation to determine if IndexedDB recovered.
|
|
14599
14599
|
// Ideally, we would expose a health check directly on SimpleDb, but
|
|
14600
14600
|
// RemoteStore only has access to persistence through LocalStore.
|
|
@@ -14707,7 +14707,7 @@ async function gc(t, e) {
|
|
|
14707
14707
|
// new mutations from the LocalStore (since mutations are per-user).
|
|
14708
14708
|
n.Au.add(3 /* OfflineCause.CredentialChange */), await Wu(n), s &&
|
|
14709
14709
|
// Don't set the network status to Unknown if we are offline.
|
|
14710
|
-
n.
|
|
14710
|
+
n.bu.set("Unknown" /* OnlineState.Unknown */), await n.remoteSyncer.handleCredentialChange(e),
|
|
14711
14711
|
n.Au.delete(3 /* OfflineCause.CredentialChange */), await zu(n);
|
|
14712
14712
|
}
|
|
14713
14713
|
|
|
@@ -14716,7 +14716,7 @@ async function gc(t, e) {
|
|
|
14716
14716
|
*/ async function yc(t, e) {
|
|
14717
14717
|
const n = L(t);
|
|
14718
14718
|
e ? (n.Au.delete(2 /* OfflineCause.IsSecondary */), await zu(n)) : e || (n.Au.add(2 /* OfflineCause.IsSecondary */),
|
|
14719
|
-
await Wu(n), n.
|
|
14719
|
+
await Wu(n), n.bu.set("Unknown" /* OnlineState.Unknown */));
|
|
14720
14720
|
}
|
|
14721
14721
|
|
|
14722
14722
|
/**
|
|
@@ -14753,7 +14753,7 @@ async function gc(t, e) {
|
|
|
14753
14753
|
co: ic.bind(null, t),
|
|
14754
14754
|
eu: rc.bind(null, t)
|
|
14755
14755
|
}), t.vu.push((async e => {
|
|
14756
|
-
e ? (t.Vu.Go(), tc(t) ? Zu(t) : t.
|
|
14756
|
+
e ? (t.Vu.Go(), tc(t) ? Zu(t) : t.bu.set("Unknown" /* OnlineState.Unknown */)) : (await t.Vu.stop(),
|
|
14757
14757
|
nc(t));
|
|
14758
14758
|
}))), t.Vu;
|
|
14759
14759
|
}
|
|
@@ -15078,13 +15078,13 @@ class Rc {
|
|
|
15078
15078
|
/**
|
|
15079
15079
|
* Holds the listeners and the last received ViewSnapshot for a query being
|
|
15080
15080
|
* tracked by EventManager.
|
|
15081
|
-
*/ class
|
|
15081
|
+
*/ class bc {
|
|
15082
15082
|
constructor() {
|
|
15083
15083
|
this.xu = void 0, this.listeners = [];
|
|
15084
15084
|
}
|
|
15085
15085
|
}
|
|
15086
15086
|
|
|
15087
|
-
class
|
|
15087
|
+
class Pc {
|
|
15088
15088
|
constructor() {
|
|
15089
15089
|
this.queries = new os((t => ts(t)), Zn), this.onlineState = "Unknown" /* OnlineState.Unknown */ ,
|
|
15090
15090
|
this.Nu = new Set;
|
|
@@ -15094,7 +15094,7 @@ class bc {
|
|
|
15094
15094
|
async function Vc(t, e) {
|
|
15095
15095
|
const n = L(t), s = e.query;
|
|
15096
15096
|
let i = !1, r = n.queries.get(s);
|
|
15097
|
-
if (r || (i = !0, r = new
|
|
15097
|
+
if (r || (i = !0, r = new bc), i) try {
|
|
15098
15098
|
r.xu = await n.onListen(s);
|
|
15099
15099
|
} catch (t) {
|
|
15100
15100
|
const n = Ec(t, `Initialization of query '${es(e.query)}' failed`);
|
|
@@ -16411,10 +16411,10 @@ function Ia(t) {
|
|
|
16411
16411
|
}(s)), Promise.resolve(new Set);
|
|
16412
16412
|
n._updateProgress(Oc(s));
|
|
16413
16413
|
const i = new $c(s, t.localStore, e.serializer);
|
|
16414
|
-
let r = await e.
|
|
16414
|
+
let r = await e.bc();
|
|
16415
16415
|
for (;r; ) {
|
|
16416
16416
|
const t = await i.ju(r);
|
|
16417
|
-
t && n._updateProgress(t), r = await e.
|
|
16417
|
+
t && n._updateProgress(t), r = await e.bc();
|
|
16418
16418
|
}
|
|
16419
16419
|
const o = await i.complete();
|
|
16420
16420
|
return await ua(t, o.Hu,
|
|
@@ -16478,7 +16478,7 @@ class Ea {
|
|
|
16478
16478
|
return new Ko(Qo.js, this.serializer);
|
|
16479
16479
|
}
|
|
16480
16480
|
createSharedClientState(t) {
|
|
16481
|
-
return new
|
|
16481
|
+
return new Pu;
|
|
16482
16482
|
}
|
|
16483
16483
|
async terminate() {
|
|
16484
16484
|
this.gcScheduler && this.gcScheduler.stop(), await this.sharedClientState.shutdown(),
|
|
@@ -16505,12 +16505,12 @@ class Aa extends Ea {
|
|
|
16505
16505
|
* Provides all components needed for Firestore with IndexedDB persistence.
|
|
16506
16506
|
*/ class va extends Ea {
|
|
16507
16507
|
constructor(t, e, n) {
|
|
16508
|
-
super(), this.
|
|
16508
|
+
super(), this.Pc = t, this.cacheSizeBytes = e, this.forceOwnership = n, this.synchronizeTabs = !1;
|
|
16509
16509
|
}
|
|
16510
16510
|
async initialize(t) {
|
|
16511
|
-
await super.initialize(t), await this.
|
|
16511
|
+
await super.initialize(t), await this.Pc.initialize(this, t),
|
|
16512
16512
|
// Enqueue writes from a previous session
|
|
16513
|
-
await Ia(this.
|
|
16513
|
+
await Ia(this.Pc.syncEngine), await cc(this.Pc.remoteStore),
|
|
16514
16514
|
// NOTE: This will immediately call the listener, so we make sure to
|
|
16515
16515
|
// set it after localStore / remoteStore are started.
|
|
16516
16516
|
await this.persistence.pi((() => (this.gcScheduler && !this.gcScheduler.started && this.gcScheduler.start(),
|
|
@@ -16533,7 +16533,7 @@ class Aa extends Ea {
|
|
|
16533
16533
|
return new Jo(this.synchronizeTabs, e, t.clientId, n, t.asyncQueue, $u(), Ou(), this.serializer, this.sharedClientState, !!this.forceOwnership);
|
|
16534
16534
|
}
|
|
16535
16535
|
createSharedClientState(t) {
|
|
16536
|
-
return new
|
|
16536
|
+
return new Pu;
|
|
16537
16537
|
}
|
|
16538
16538
|
}
|
|
16539
16539
|
|
|
@@ -16546,12 +16546,12 @@ class Aa extends Ea {
|
|
|
16546
16546
|
* `synchronizeTabs` will be enabled.
|
|
16547
16547
|
*/ class Ra extends va {
|
|
16548
16548
|
constructor(t, e) {
|
|
16549
|
-
super(t, e, /* forceOwnership= */ !1), this.
|
|
16549
|
+
super(t, e, /* forceOwnership= */ !1), this.Pc = t, this.cacheSizeBytes = e, this.synchronizeTabs = !0;
|
|
16550
16550
|
}
|
|
16551
16551
|
async initialize(t) {
|
|
16552
16552
|
await super.initialize(t);
|
|
16553
|
-
const e = this.
|
|
16554
|
-
this.sharedClientState instanceof
|
|
16553
|
+
const e = this.Pc.syncEngine;
|
|
16554
|
+
this.sharedClientState instanceof bu && (this.sharedClientState.syncEngine = {
|
|
16555
16555
|
Qr: fa.bind(null, e),
|
|
16556
16556
|
jr: ga.bind(null, e),
|
|
16557
16557
|
zr: ya.bind(null, e),
|
|
@@ -16561,22 +16561,22 @@ class Aa extends Ea {
|
|
|
16561
16561
|
// NOTE: This will immediately call the listener, so we make sure to
|
|
16562
16562
|
// set it after localStore / remoteStore are started.
|
|
16563
16563
|
await this.persistence.pi((async t => {
|
|
16564
|
-
await da(this.
|
|
16564
|
+
await da(this.Pc.syncEngine, t), this.gcScheduler && (t && !this.gcScheduler.started ? this.gcScheduler.start() : t || this.gcScheduler.stop()),
|
|
16565
16565
|
this.indexBackfillerScheduler && (t && !this.indexBackfillerScheduler.started ? this.indexBackfillerScheduler.start() : t || this.indexBackfillerScheduler.stop());
|
|
16566
16566
|
}));
|
|
16567
16567
|
}
|
|
16568
16568
|
createSharedClientState(t) {
|
|
16569
16569
|
const e = $u();
|
|
16570
|
-
if (!
|
|
16570
|
+
if (!bu.D(e)) throw new U(q.UNIMPLEMENTED, "IndexedDB persistence is only available on platforms that support LocalStorage.");
|
|
16571
16571
|
const n = Zo(t.databaseInfo.databaseId, t.databaseInfo.persistenceKey);
|
|
16572
|
-
return new
|
|
16572
|
+
return new bu(e, t.asyncQueue, n, t.clientId, t.initialUser);
|
|
16573
16573
|
}
|
|
16574
16574
|
}
|
|
16575
16575
|
|
|
16576
16576
|
/**
|
|
16577
16577
|
* Initializes and wires the components that are needed to interface with the
|
|
16578
16578
|
* network.
|
|
16579
|
-
*/ class
|
|
16579
|
+
*/ class ba {
|
|
16580
16580
|
async initialize(t, e) {
|
|
16581
16581
|
this.localStore || (this.localStore = t.localStore, this.sharedClientState = t.sharedClientState,
|
|
16582
16582
|
this.datastore = this.createDatastore(e), this.remoteStore = this.createRemoteStore(e),
|
|
@@ -16586,7 +16586,7 @@ class Aa extends Ea {
|
|
|
16586
16586
|
await yc(this.remoteStore, this.syncEngine.isPrimaryClient));
|
|
16587
16587
|
}
|
|
16588
16588
|
createEventManager(t) {
|
|
16589
|
-
return new
|
|
16589
|
+
return new Pc;
|
|
16590
16590
|
}
|
|
16591
16591
|
createDatastore(t) {
|
|
16592
16592
|
const e = Fu(t.databaseInfo.databaseId), n = (s = t.databaseInfo, new Mu(s));
|
|
@@ -16615,7 +16615,7 @@ class Aa extends Ea {
|
|
|
16615
16615
|
await Wu(e), e.Ru.shutdown(),
|
|
16616
16616
|
// Set the OnlineState to Unknown (rather than Offline) to avoid potentially
|
|
16617
16617
|
// triggering spurious listener events with cached data, etc.
|
|
16618
|
-
e.
|
|
16618
|
+
e.bu.set("Unknown" /* OnlineState.Unknown */);
|
|
16619
16619
|
}(this.remoteStore);
|
|
16620
16620
|
}
|
|
16621
16621
|
}
|
|
@@ -16647,7 +16647,7 @@ class Aa extends Ea {
|
|
|
16647
16647
|
* @param bytesPerRead - How many bytes each `read()` from the returned reader
|
|
16648
16648
|
* will read.
|
|
16649
16649
|
*/
|
|
16650
|
-
function
|
|
16650
|
+
function Pa(t, e = 10240) {
|
|
16651
16651
|
let n = 0;
|
|
16652
16652
|
// The TypeScript definition for ReadableStreamReader changed. We use
|
|
16653
16653
|
// `any` here to allow this code to compile with different versions.
|
|
@@ -16782,7 +16782,7 @@ class Va {
|
|
|
16782
16782
|
async getMetadata() {
|
|
16783
16783
|
return this.metadata.promise;
|
|
16784
16784
|
}
|
|
16785
|
-
async
|
|
16785
|
+
async bc() {
|
|
16786
16786
|
// Makes sure metadata is read before proceeding.
|
|
16787
16787
|
return await this.getMetadata(), this.xc();
|
|
16788
16788
|
}
|
|
@@ -17200,7 +17200,7 @@ async function $a(t) {
|
|
|
17200
17200
|
async function Oa(t) {
|
|
17201
17201
|
return t._onlineComponents || (t._uninitializedComponentsProvider ? (N("FirestoreClient", "Using user provided OnlineComponentProvider"),
|
|
17202
17202
|
await ka(t, t._uninitializedComponentsProvider._online)) : (N("FirestoreClient", "Using default OnlineComponentProvider"),
|
|
17203
|
-
await ka(t, new
|
|
17203
|
+
await ka(t, new ba))), t._onlineComponents;
|
|
17204
17204
|
}
|
|
17205
17205
|
|
|
17206
17206
|
function Fa(t) {
|
|
@@ -17246,7 +17246,7 @@ async function Ka(t) {
|
|
|
17246
17246
|
const e = L(t);
|
|
17247
17247
|
e.Au.add(0 /* OfflineCause.UserDisabled */), await Wu(e),
|
|
17248
17248
|
// Set the OnlineState to Offline so get()s return from cache, etc.
|
|
17249
|
-
e.
|
|
17249
|
+
e.bu.set("Offline" /* OnlineState.Offline */);
|
|
17250
17250
|
}(n);
|
|
17251
17251
|
}));
|
|
17252
17252
|
}
|
|
@@ -17375,8 +17375,8 @@ function Ja(t, e) {
|
|
|
17375
17375
|
return function(t, e) {
|
|
17376
17376
|
return new Sa(t, e);
|
|
17377
17377
|
}(function(t, e) {
|
|
17378
|
-
if (t instanceof Uint8Array) return
|
|
17379
|
-
if (t instanceof ArrayBuffer) return
|
|
17378
|
+
if (t instanceof Uint8Array) return Pa(t, e);
|
|
17379
|
+
if (t instanceof ArrayBuffer) return Pa(new Uint8Array(t), e);
|
|
17380
17380
|
if (t instanceof ReadableStream) return t.getReader();
|
|
17381
17381
|
throw new Error("Source of `toByteStreamReader` has to be a ArrayBuffer or ReadableStream");
|
|
17382
17382
|
}(n), e);
|
|
@@ -18361,7 +18361,7 @@ class Eh {
|
|
|
18361
18361
|
});
|
|
18362
18362
|
}
|
|
18363
18363
|
|
|
18364
|
-
function
|
|
18364
|
+
function bh(e, n) {
|
|
18365
18365
|
const s = "object" == typeof e ? e : app.getApp(), i = "string" == typeof e ? e : n || "(default)", r = app._getProvider(s, "firestore").getImmediate({
|
|
18366
18366
|
identifier: i
|
|
18367
18367
|
});
|
|
@@ -18374,7 +18374,7 @@ function Ph(e, n) {
|
|
|
18374
18374
|
|
|
18375
18375
|
/**
|
|
18376
18376
|
* @internal
|
|
18377
|
-
*/ function
|
|
18377
|
+
*/ function Ph(t) {
|
|
18378
18378
|
return t._firestoreClient || Vh(t), t._firestoreClient.verifyNotTerminated(), t._firestoreClient;
|
|
18379
18379
|
}
|
|
18380
18380
|
|
|
@@ -18419,10 +18419,10 @@ function Vh(t) {
|
|
|
18419
18419
|
* is already specified will throw an exception.
|
|
18420
18420
|
*/ function Sh(t, e) {
|
|
18421
18421
|
Bh(t = uh(t, vh));
|
|
18422
|
-
const n =
|
|
18422
|
+
const n = Ph(t);
|
|
18423
18423
|
if (n._uninitializedComponentsProvider) throw new U(q.FAILED_PRECONDITION, "SDK cache is already specified.");
|
|
18424
18424
|
M("enableIndexedDbPersistence() will be deprecated in the future, you can use `FirestoreSettings.cache` instead.");
|
|
18425
|
-
const s = t._freezeSettings(), i = new
|
|
18425
|
+
const s = t._freezeSettings(), i = new ba;
|
|
18426
18426
|
return Ch(n, i, new va(i, s.cacheSizeBytes, null == e ? void 0 : e.forceOwnership));
|
|
18427
18427
|
}
|
|
18428
18428
|
|
|
@@ -18453,10 +18453,10 @@ function Vh(t) {
|
|
|
18453
18453
|
* is already specified will throw an exception.
|
|
18454
18454
|
*/ function Dh(t) {
|
|
18455
18455
|
Bh(t = uh(t, vh));
|
|
18456
|
-
const e =
|
|
18456
|
+
const e = Ph(t);
|
|
18457
18457
|
if (e._uninitializedComponentsProvider) throw new U(q.FAILED_PRECONDITION, "SDK cache is already specified.");
|
|
18458
18458
|
M("enableMultiTabIndexedDbPersistence() will be deprecated in the future, you can use `FirestoreSettings.cache` instead.");
|
|
18459
|
-
const n = t._freezeSettings(), s = new
|
|
18459
|
+
const n = t._freezeSettings(), s = new ba;
|
|
18460
18460
|
return Ch(e, s, new Ra(s, n.cacheSizeBytes));
|
|
18461
18461
|
}
|
|
18462
18462
|
|
|
@@ -18505,9 +18505,9 @@ function Vh(t) {
|
|
|
18505
18505
|
return t._queue.enqueueAndForgetEvenWhileRestricted((async () => {
|
|
18506
18506
|
try {
|
|
18507
18507
|
await async function(t) {
|
|
18508
|
-
if (!
|
|
18508
|
+
if (!Pt.D()) return Promise.resolve();
|
|
18509
18509
|
const e = t + "main";
|
|
18510
|
-
await
|
|
18510
|
+
await Pt.delete(e);
|
|
18511
18511
|
}(Zo(t._databaseId, t._persistenceKey)), e.resolve();
|
|
18512
18512
|
} catch (t) {
|
|
18513
18513
|
e.reject(t);
|
|
@@ -18534,7 +18534,7 @@ function Vh(t) {
|
|
|
18534
18534
|
return function(t) {
|
|
18535
18535
|
const e = new K;
|
|
18536
18536
|
return t.asyncQueue.enqueueAndForget((async () => Zc(await qa(t), e))), e.promise;
|
|
18537
|
-
}(
|
|
18537
|
+
}(Ph(t = uh(t, vh)));
|
|
18538
18538
|
}
|
|
18539
18539
|
|
|
18540
18540
|
/**
|
|
@@ -18543,7 +18543,7 @@ function Vh(t) {
|
|
|
18543
18543
|
*
|
|
18544
18544
|
* @returns A `Promise` that is resolved once the network has been enabled.
|
|
18545
18545
|
*/ function kh(t) {
|
|
18546
|
-
return Ga(
|
|
18546
|
+
return Ga(Ph(t = uh(t, vh)));
|
|
18547
18547
|
}
|
|
18548
18548
|
|
|
18549
18549
|
/**
|
|
@@ -18554,7 +18554,7 @@ function Vh(t) {
|
|
|
18554
18554
|
*
|
|
18555
18555
|
* @returns A `Promise` that is resolved once the network has been disabled.
|
|
18556
18556
|
*/ function Mh(t) {
|
|
18557
|
-
return Qa(
|
|
18557
|
+
return Qa(Ph(t = uh(t, vh)));
|
|
18558
18558
|
}
|
|
18559
18559
|
|
|
18560
18560
|
/**
|
|
@@ -18593,7 +18593,7 @@ function Vh(t) {
|
|
|
18593
18593
|
* updates, and completion or error events. It can be used as a
|
|
18594
18594
|
* `Promise<LoadBundleTaskProgress>`.
|
|
18595
18595
|
*/ function Oh(t, e) {
|
|
18596
|
-
const n =
|
|
18596
|
+
const n = Ph(t = uh(t, vh)), s = new Eh;
|
|
18597
18597
|
return Ya(n, t._databaseId, e, s), s;
|
|
18598
18598
|
}
|
|
18599
18599
|
|
|
@@ -18609,7 +18609,7 @@ function Vh(t) {
|
|
|
18609
18609
|
* @param name - The name of the query.
|
|
18610
18610
|
* @returns A `Promise` that is resolved with the Query or `null`.
|
|
18611
18611
|
*/ function Fh(t, e) {
|
|
18612
|
-
return Xa(
|
|
18612
|
+
return Xa(Ph(t = uh(t, vh)), e).then((e => e ? new dh(t, null, e.query) : null));
|
|
18613
18613
|
}
|
|
18614
18614
|
|
|
18615
18615
|
function Bh(t) {
|
|
@@ -19120,7 +19120,7 @@ class el extends Qh {
|
|
|
19120
19120
|
|
|
19121
19121
|
class sl extends Qh {
|
|
19122
19122
|
_toFieldTransform(t) {
|
|
19123
|
-
return new Ms(t.path, new
|
|
19123
|
+
return new Ms(t.path, new Ps);
|
|
19124
19124
|
}
|
|
19125
19125
|
isEqual(t) {
|
|
19126
19126
|
return t instanceof sl;
|
|
@@ -19579,7 +19579,7 @@ function gl(t, e, n, s, i) {
|
|
|
19579
19579
|
function Rl(t, e, ...n) {
|
|
19580
19580
|
let s = [];
|
|
19581
19581
|
e instanceof Al && s.push(e), s = s.concat(n), function(t) {
|
|
19582
|
-
const e = t.filter((t => t instanceof Vl)).length, n = t.filter((t => t instanceof
|
|
19582
|
+
const e = t.filter((t => t instanceof Vl)).length, n = t.filter((t => t instanceof bl)).length;
|
|
19583
19583
|
if (e > 1 || e > 0 && n > 0) throw new U(q.INVALID_ARGUMENT, "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(...)))`.");
|
|
19584
19584
|
}
|
|
19585
19585
|
/**
|
|
@@ -19614,7 +19614,7 @@ function Rl(t, e, ...n) {
|
|
|
19614
19614
|
* `QueryFieldFilterConstraint`s are created by invoking {@link where} and can then
|
|
19615
19615
|
* be passed to {@link (query:1)} to create a new query instance that also contains
|
|
19616
19616
|
* this `QueryFieldFilterConstraint`.
|
|
19617
|
-
*/ class
|
|
19617
|
+
*/ class bl extends vl {
|
|
19618
19618
|
/**
|
|
19619
19619
|
* @internal
|
|
19620
19620
|
*/
|
|
@@ -19624,7 +19624,7 @@ function Rl(t, e, ...n) {
|
|
|
19624
19624
|
this.type = "where";
|
|
19625
19625
|
}
|
|
19626
19626
|
static _create(t, e, n) {
|
|
19627
|
-
return new
|
|
19627
|
+
return new bl(t, e, n);
|
|
19628
19628
|
}
|
|
19629
19629
|
_apply(t) {
|
|
19630
19630
|
const e = this._parse(t);
|
|
@@ -19664,9 +19664,9 @@ function Rl(t, e, ...n) {
|
|
|
19664
19664
|
* "<=", "!=").
|
|
19665
19665
|
* @param value - The value for comparison
|
|
19666
19666
|
* @returns The created {@link QueryFieldFilterConstraint}.
|
|
19667
|
-
*/ function
|
|
19667
|
+
*/ function Pl(t, e, n) {
|
|
19668
19668
|
const s = e, i = Tl("where", t);
|
|
19669
|
-
return
|
|
19669
|
+
return bl._create(i, s, n);
|
|
19670
19670
|
}
|
|
19671
19671
|
|
|
19672
19672
|
/**
|
|
@@ -20045,7 +20045,7 @@ function jl(t, e, n) {
|
|
|
20045
20045
|
}
|
|
20046
20046
|
|
|
20047
20047
|
function zl(t, e) {
|
|
20048
|
-
if (!(e instanceof
|
|
20048
|
+
if (!(e instanceof bl || e instanceof Vl)) throw new U(q.INVALID_ARGUMENT, `Function ${t}() requires AppliableConstraints created with a call to 'where(...)', 'or(...)', or 'and(...)'.`);
|
|
20049
20049
|
}
|
|
20050
20050
|
|
|
20051
20051
|
class Wl {
|
|
@@ -20517,7 +20517,7 @@ function uf(t) {
|
|
|
20517
20517
|
*/ function af(t) {
|
|
20518
20518
|
t = uh(t, fh);
|
|
20519
20519
|
const e = uh(t.firestore, vh);
|
|
20520
|
-
return za(
|
|
20520
|
+
return za(Ph(e), t._key).then((n => Af(e, t, n)));
|
|
20521
20521
|
}
|
|
20522
20522
|
|
|
20523
20523
|
class hf extends Wl {
|
|
@@ -20541,7 +20541,7 @@ class hf extends Wl {
|
|
|
20541
20541
|
* current document contents.
|
|
20542
20542
|
*/ function lf(t) {
|
|
20543
20543
|
t = uh(t, fh);
|
|
20544
|
-
const e = uh(t.firestore, vh), n =
|
|
20544
|
+
const e = uh(t.firestore, vh), n = Ph(e), s = new hf(e);
|
|
20545
20545
|
return ja(n, t._key).then((n => new sf(e, s, t._key, n, new nf(null !== n && n.hasLocalMutations,
|
|
20546
20546
|
/* fromCache= */ !0), t.converter)));
|
|
20547
20547
|
}
|
|
@@ -20555,7 +20555,7 @@ class hf extends Wl {
|
|
|
20555
20555
|
*/ function ff(t) {
|
|
20556
20556
|
t = uh(t, fh);
|
|
20557
20557
|
const e = uh(t.firestore, vh);
|
|
20558
|
-
return za(
|
|
20558
|
+
return za(Ph(e), t._key, {
|
|
20559
20559
|
source: "server"
|
|
20560
20560
|
}).then((n => Af(e, t, n)));
|
|
20561
20561
|
}
|
|
@@ -20571,7 +20571,7 @@ class hf extends Wl {
|
|
|
20571
20571
|
* @returns A `Promise` that will be resolved with the results of the query.
|
|
20572
20572
|
*/ function df(t) {
|
|
20573
20573
|
t = uh(t, dh);
|
|
20574
|
-
const e = uh(t.firestore, vh), n =
|
|
20574
|
+
const e = uh(t.firestore, vh), n = Ph(e), s = new hf(e);
|
|
20575
20575
|
return El(t._query), Ha(n, t._query).then((n => new of(e, s, t, n)));
|
|
20576
20576
|
}
|
|
20577
20577
|
|
|
@@ -20583,7 +20583,7 @@ class hf extends Wl {
|
|
|
20583
20583
|
* @returns A `Promise` that will be resolved with the results of the query.
|
|
20584
20584
|
*/ function wf(t) {
|
|
20585
20585
|
t = uh(t, dh);
|
|
20586
|
-
const e = uh(t.firestore, vh), n =
|
|
20586
|
+
const e = uh(t.firestore, vh), n = Ph(e), s = new hf(e);
|
|
20587
20587
|
return Wa(n, t._query).then((n => new of(e, s, t, n)));
|
|
20588
20588
|
}
|
|
20589
20589
|
|
|
@@ -20594,7 +20594,7 @@ class hf extends Wl {
|
|
|
20594
20594
|
* @returns A `Promise` that will be resolved with the results of the query.
|
|
20595
20595
|
*/ function _f(t) {
|
|
20596
20596
|
t = uh(t, dh);
|
|
20597
|
-
const e = uh(t.firestore, vh), n =
|
|
20597
|
+
const e = uh(t.firestore, vh), n = Ph(e), s = new hf(e);
|
|
20598
20598
|
return Ha(n, t._query, {
|
|
20599
20599
|
source: "server"
|
|
20600
20600
|
}).then((n => new of(e, s, t, n)));
|
|
@@ -20680,11 +20680,11 @@ function If(t, ...e) {
|
|
|
20680
20680
|
return t.asyncQueue.enqueueAndForget((async () => Vc(await Ka(t), r))), () => {
|
|
20681
20681
|
i.Sc(), t.asyncQueue.enqueueAndForget((async () => Sc(await Ka(t), r)));
|
|
20682
20682
|
};
|
|
20683
|
-
}(
|
|
20683
|
+
}(Ph(a), h, u, c);
|
|
20684
20684
|
}
|
|
20685
20685
|
|
|
20686
20686
|
function Tf(t, e) {
|
|
20687
|
-
return Ja(
|
|
20687
|
+
return Ja(Ph(t = uh(t, vh)), Th(e) ? e : {
|
|
20688
20688
|
next: e
|
|
20689
20689
|
});
|
|
20690
20690
|
}
|
|
@@ -20696,7 +20696,7 @@ function Tf(t, e) {
|
|
|
20696
20696
|
return function(t, e) {
|
|
20697
20697
|
const n = new K;
|
|
20698
20698
|
return t.asyncQueue.enqueueAndForget((async () => zc(await qa(t), e, n))), n.promise;
|
|
20699
|
-
}(
|
|
20699
|
+
}(Ph(t), e);
|
|
20700
20700
|
}
|
|
20701
20701
|
|
|
20702
20702
|
/**
|
|
@@ -20783,7 +20783,7 @@ function Tf(t, e) {
|
|
|
20783
20783
|
* ```
|
|
20784
20784
|
* @internal TODO (sum/avg) remove when public
|
|
20785
20785
|
*/ function Rf(t, e) {
|
|
20786
|
-
const n = uh(t.firestore, vh), s =
|
|
20786
|
+
const n = uh(t.firestore, vh), s = Ph(n), i = function(t, e) {
|
|
20787
20787
|
const n = [];
|
|
20788
20788
|
for (const s in t) Object.prototype.hasOwnProperty.call(t, s) && n.push(e(t[s], s, t));
|
|
20789
20789
|
return n;
|
|
@@ -20834,9 +20834,9 @@ function Tf(t, e) {
|
|
|
20834
20834
|
*/ (n, t, e)));
|
|
20835
20835
|
}
|
|
20836
20836
|
|
|
20837
|
-
class
|
|
20837
|
+
class bf {
|
|
20838
20838
|
constructor(t) {
|
|
20839
|
-
this.kind = "memory", this._onlineComponentProvider = new
|
|
20839
|
+
this.kind = "memory", this._onlineComponentProvider = new ba, (null == t ? void 0 : t.garbageCollector) ? this._offlineComponentProvider = t.garbageCollector._offlineComponentProvider : this._offlineComponentProvider = new Ea;
|
|
20840
20840
|
}
|
|
20841
20841
|
toJSON() {
|
|
20842
20842
|
return {
|
|
@@ -20845,7 +20845,7 @@ class Pf {
|
|
|
20845
20845
|
}
|
|
20846
20846
|
}
|
|
20847
20847
|
|
|
20848
|
-
class
|
|
20848
|
+
class Pf {
|
|
20849
20849
|
constructor(t) {
|
|
20850
20850
|
let e;
|
|
20851
20851
|
this.kind = "persistent", (null == t ? void 0 : t.tabManager) ? (t.tabManager._initialize(t),
|
|
@@ -20902,14 +20902,14 @@ class Sf {
|
|
|
20902
20902
|
* Creates an instance of `MemoryLocalCache`. The instance can be set to
|
|
20903
20903
|
* `FirestoreSettings.cache` to tell the SDK which cache layer to use.
|
|
20904
20904
|
*/ function xf(t) {
|
|
20905
|
-
return new
|
|
20905
|
+
return new bf(t);
|
|
20906
20906
|
}
|
|
20907
20907
|
|
|
20908
20908
|
/**
|
|
20909
20909
|
* Creates an instance of `PersistentLocalCache`. The instance can be set to
|
|
20910
20910
|
* `FirestoreSettings.cache` to tell the SDK which cache layer to use.
|
|
20911
20911
|
*/ function Nf(t) {
|
|
20912
|
-
return new
|
|
20912
|
+
return new Pf(t);
|
|
20913
20913
|
}
|
|
20914
20914
|
|
|
20915
20915
|
class kf {
|
|
@@ -20924,7 +20924,7 @@ class kf {
|
|
|
20924
20924
|
/**
|
|
20925
20925
|
* @internal
|
|
20926
20926
|
*/ _initialize(t) {
|
|
20927
|
-
this._onlineComponentProvider = new
|
|
20927
|
+
this._onlineComponentProvider = new ba, this._offlineComponentProvider = new va(this._onlineComponentProvider, null == t ? void 0 : t.cacheSizeBytes, this.forceOwnership);
|
|
20928
20928
|
}
|
|
20929
20929
|
}
|
|
20930
20930
|
|
|
@@ -20940,7 +20940,7 @@ class Mf {
|
|
|
20940
20940
|
/**
|
|
20941
20941
|
* @internal
|
|
20942
20942
|
*/ _initialize(t) {
|
|
20943
|
-
this._onlineComponentProvider = new
|
|
20943
|
+
this._onlineComponentProvider = new ba, this._offlineComponentProvider = new Ra(this._onlineComponentProvider, null == t ? void 0 : t.cacheSizeBytes);
|
|
20944
20944
|
}
|
|
20945
20945
|
}
|
|
20946
20946
|
|
|
@@ -21194,7 +21194,7 @@ class qf extends class {
|
|
|
21194
21194
|
const i = await Ua(t);
|
|
21195
21195
|
new Ca(t.asyncQueue, i, n, e, s).run();
|
|
21196
21196
|
})), s.promise;
|
|
21197
|
-
}(
|
|
21197
|
+
}(Ph(t), (n => e(new qf(t, n))), s);
|
|
21198
21198
|
}
|
|
21199
21199
|
|
|
21200
21200
|
/**
|
|
@@ -21309,7 +21309,7 @@ class qf extends class {
|
|
|
21309
21309
|
* @returns A {@link WriteBatch} that can be used to atomically execute multiple
|
|
21310
21310
|
* writes.
|
|
21311
21311
|
*/ function Wf(t) {
|
|
21312
|
-
return
|
|
21312
|
+
return Ph(t = uh(t, vh)), new Bf(t, (e => Ef(t, e)));
|
|
21313
21313
|
}
|
|
21314
21314
|
|
|
21315
21315
|
/**
|
|
@@ -21329,7 +21329,7 @@ class qf extends class {
|
|
|
21329
21329
|
* limitations under the License.
|
|
21330
21330
|
*/ function Hf(t, e) {
|
|
21331
21331
|
var n;
|
|
21332
|
-
const s =
|
|
21332
|
+
const s = Ph(t = uh(t, vh));
|
|
21333
21333
|
if (!s._uninitializedComponentsProvider || "memory" === (null === (n = s._uninitializedComponentsProvider) || void 0 === n ? void 0 : n._offlineKind))
|
|
21334
21334
|
// PORTING NOTE: We don't return an error if the user has not enabled
|
|
21335
21335
|
// persistence since `enableIndexeddbPersistence()` can fail on the Web.
|
|
@@ -21375,9 +21375,9 @@ function Jf(t, e) {
|
|
|
21375
21375
|
return s = Object.assign({
|
|
21376
21376
|
useFetchStreams: e
|
|
21377
21377
|
}, s), r._setSettings(s), r;
|
|
21378
|
-
}), "PUBLIC").setMultipleInstances(!0)), app.registerVersion(
|
|
21378
|
+
}), "PUBLIC").setMultipleInstances(!0)), app.registerVersion(P, "3.11.0-canary.a0bb76884", t),
|
|
21379
21379
|
// BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation
|
|
21380
|
-
app.registerVersion(
|
|
21380
|
+
app.registerVersion(P, "3.11.0-canary.a0bb76884", "cjs2017");
|
|
21381
21381
|
}();
|
|
21382
21382
|
|
|
21383
21383
|
exports.AbstractUserDataWriter = Wl;
|
|
@@ -21399,7 +21399,7 @@ exports.QueryCompositeFilterConstraint = Vl;
|
|
|
21399
21399
|
exports.QueryConstraint = vl;
|
|
21400
21400
|
exports.QueryDocumentSnapshot = rf;
|
|
21401
21401
|
exports.QueryEndAtConstraint = Bl;
|
|
21402
|
-
exports.QueryFieldFilterConstraint =
|
|
21402
|
+
exports.QueryFieldFilterConstraint = bl;
|
|
21403
21403
|
exports.QueryLimitConstraint = Nl;
|
|
21404
21404
|
exports.QueryOrderByConstraint = Cl;
|
|
21405
21405
|
exports.QuerySnapshot = of;
|
|
@@ -21416,7 +21416,7 @@ exports._FieldPath = at;
|
|
|
21416
21416
|
exports._TestingHooks = ci;
|
|
21417
21417
|
exports._cast = uh;
|
|
21418
21418
|
exports._debugAssert = B;
|
|
21419
|
-
exports._isBase64Available =
|
|
21419
|
+
exports._isBase64Available = Pe;
|
|
21420
21420
|
exports._logWarn = M;
|
|
21421
21421
|
exports._validateIsNotUsedTogether = sh;
|
|
21422
21422
|
exports.addDoc = pf;
|
|
@@ -21441,7 +21441,7 @@ exports.enableMultiTabIndexedDbPersistence = Dh;
|
|
|
21441
21441
|
exports.enableNetwork = kh;
|
|
21442
21442
|
exports.endAt = ql;
|
|
21443
21443
|
exports.endBefore = Ll;
|
|
21444
|
-
exports.ensureFirestoreConfigured =
|
|
21444
|
+
exports.ensureFirestoreConfigured = Ph;
|
|
21445
21445
|
exports.executeWrite = Ef;
|
|
21446
21446
|
exports.getAggregateFromServer = Rf;
|
|
21447
21447
|
exports.getCountFromServer = vf;
|
|
@@ -21451,7 +21451,7 @@ exports.getDocFromServer = ff;
|
|
|
21451
21451
|
exports.getDocs = df;
|
|
21452
21452
|
exports.getDocsFromCache = wf;
|
|
21453
21453
|
exports.getDocsFromServer = _f;
|
|
21454
|
-
exports.getFirestore =
|
|
21454
|
+
exports.getFirestore = bh;
|
|
21455
21455
|
exports.increment = zf;
|
|
21456
21456
|
exports.initializeFirestore = Rh;
|
|
21457
21457
|
exports.limit = kl;
|
|
@@ -21483,6 +21483,6 @@ exports.sum = Yl;
|
|
|
21483
21483
|
exports.terminate = $h;
|
|
21484
21484
|
exports.updateDoc = gf;
|
|
21485
21485
|
exports.waitForPendingWrites = Nh;
|
|
21486
|
-
exports.where =
|
|
21486
|
+
exports.where = Pl;
|
|
21487
21487
|
exports.writeBatch = Wf;
|
|
21488
21488
|
//# sourceMappingURL=index.cjs.js.map
|