dexie-cloud-addon 4.2.0-alpha.1 → 4.2.0-alpha.4
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/modern/dexie-cloud-addon.js +1893 -14966
- package/dist/modern/dexie-cloud-addon.js.map +1 -1
- package/dist/modern/dexie-cloud-addon.min.js +1 -1
- package/dist/modern/dexie-cloud-addon.min.js.gz +0 -0
- package/dist/modern/dexie-cloud-addon.min.js.map +1 -1
- package/dist/modern/service-worker.js +1969 -15042
- package/dist/modern/service-worker.js.map +1 -1
- package/dist/modern/service-worker.min.js +1 -1
- package/dist/modern/service-worker.min.js.map +1 -1
- package/dist/modern/yjs/reopenDocSignal.d.ts +2 -2
- package/dist/umd/dexie-cloud-addon.js +200 -1677
- package/dist/umd/dexie-cloud-addon.js.gz +0 -0
- package/dist/umd/dexie-cloud-addon.js.map +1 -1
- package/dist/umd/dexie-cloud-addon.min.js +1 -1
- package/dist/umd/dexie-cloud-addon.min.js.gz +0 -0
- package/dist/umd/dexie-cloud-addon.min.js.map +1 -1
- package/dist/umd/service-worker.js +61 -1538
- package/dist/umd/service-worker.js.map +1 -1
- package/dist/umd/service-worker.min.js +1 -1
- package/dist/umd/service-worker.min.js.map +1 -1
- package/dist/umd/yjs/reopenDocSignal.d.ts +2 -2
- package/package.json +11 -15
- package/dist/modern/helpers/dbOnClosed.d.ts +0 -2
- package/dist/modern/yjs/Y.d.ts +0 -3
- package/dist/modern/yjs/importDexieYProvider.d.ts +0 -1
- package/dist/umd/helpers/dbOnClosed.d.ts +0 -2
- package/dist/umd/yjs/Y.d.ts +0 -3
- package/dist/umd/yjs/importDexieYProvider.d.ts +0 -1
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* ==========================================================================
|
|
10
10
|
*
|
|
11
|
-
* Version 4.2.0-alpha.
|
|
11
|
+
* Version 4.2.0-alpha.4, Fri Aug 01 2025
|
|
12
12
|
*
|
|
13
13
|
* https://dexie.org
|
|
14
14
|
*
|
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
(function (global, factory) {
|
|
20
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('dexie'), require('rxjs')) :
|
|
21
|
-
typeof define === 'function' && define.amd ? define(['exports', 'dexie', 'rxjs'], factory) :
|
|
22
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.DexieCloud = {}, global.Dexie, global.rxjs));
|
|
23
|
-
})(this, (function (exports, Dexie, rxjs) { 'use strict';
|
|
20
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('dexie'), require('rxjs'), require('rxjs/operators')) :
|
|
21
|
+
typeof define === 'function' && define.amd ? define(['exports', 'dexie', 'rxjs', 'rxjs/operators'], factory) :
|
|
22
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.DexieCloud = {}, global.Dexie, global.rxjs, global.rxjs.operators));
|
|
23
|
+
})(this, (function (exports, Dexie, rxjs, operators) { 'use strict';
|
|
24
24
|
|
|
25
25
|
/******************************************************************************
|
|
26
26
|
Copyright (c) Microsoft Corporation.
|
|
@@ -38,20 +38,6 @@
|
|
|
38
38
|
***************************************************************************** */
|
|
39
39
|
/* global Reflect, Promise */
|
|
40
40
|
|
|
41
|
-
var extendStatics = function(d, b) {
|
|
42
|
-
extendStatics = Object.setPrototypeOf ||
|
|
43
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
44
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
45
|
-
return extendStatics(d, b);
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
function __extends(d, b) {
|
|
49
|
-
if (typeof b !== "function" && b !== null)
|
|
50
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
51
|
-
extendStatics(d, b);
|
|
52
|
-
function __() { this.constructor = d; }
|
|
53
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
54
|
-
}
|
|
55
41
|
|
|
56
42
|
function __rest(s, e) {
|
|
57
43
|
var t = {};
|
|
@@ -75,34 +61,6 @@
|
|
|
75
61
|
});
|
|
76
62
|
}
|
|
77
63
|
|
|
78
|
-
function __generator(thisArg, body) {
|
|
79
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
80
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
81
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
82
|
-
function step(op) {
|
|
83
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
84
|
-
while (_) try {
|
|
85
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
86
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
87
|
-
switch (op[0]) {
|
|
88
|
-
case 0: case 1: t = op; break;
|
|
89
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
90
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
91
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
92
|
-
default:
|
|
93
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
94
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
95
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
96
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
97
|
-
if (t[2]) _.ops.pop();
|
|
98
|
-
_.trys.pop(); continue;
|
|
99
|
-
}
|
|
100
|
-
op = body.call(thisArg, _);
|
|
101
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
102
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
|
|
106
64
|
function __values(o) {
|
|
107
65
|
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
108
66
|
if (m) return m.call(o);
|
|
@@ -115,33 +73,6 @@
|
|
|
115
73
|
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
116
74
|
}
|
|
117
75
|
|
|
118
|
-
function __read(o, n) {
|
|
119
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
120
|
-
if (!m) return o;
|
|
121
|
-
var i = m.call(o), r, ar = [], e;
|
|
122
|
-
try {
|
|
123
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
124
|
-
}
|
|
125
|
-
catch (error) { e = { error: error }; }
|
|
126
|
-
finally {
|
|
127
|
-
try {
|
|
128
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
129
|
-
}
|
|
130
|
-
finally { if (e) throw e.error; }
|
|
131
|
-
}
|
|
132
|
-
return ar;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
function __spreadArray(to, from, pack) {
|
|
136
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
137
|
-
if (ar || !(i in from)) {
|
|
138
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
139
|
-
ar[i] = from[i];
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
143
|
-
}
|
|
144
|
-
|
|
145
76
|
function __await(v) {
|
|
146
77
|
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
147
78
|
}
|
|
@@ -1395,1581 +1326,163 @@
|
|
|
1395
1326
|
table,
|
|
1396
1327
|
prop,
|
|
1397
1328
|
k,
|
|
1398
|
-
u: readVarUint8Array$1(decoder),
|
|
1399
|
-
i: Number(readBigUint64(decoder)),
|
|
1400
|
-
};
|
|
1401
|
-
case 'u-s':
|
|
1402
|
-
return {
|
|
1403
|
-
type,
|
|
1404
|
-
table,
|
|
1405
|
-
prop,
|
|
1406
|
-
k,
|
|
1407
|
-
u: readVarUint8Array$1(decoder),
|
|
1408
|
-
r: (decoder.pos < decoder.arr.length && readVarString$1(decoder)) || undefined,
|
|
1409
|
-
};
|
|
1410
|
-
default:
|
|
1411
|
-
throw new TypeError(`Unknown message type: ${type}`);
|
|
1412
|
-
}
|
|
1413
|
-
}
|
|
1414
|
-
}
|
|
1415
|
-
}
|
|
1416
|
-
|
|
1417
|
-
async function asyncIterablePipeline(source, ...stages) {
|
|
1418
|
-
var _a, e_1, _b, _c;
|
|
1419
|
-
// Chain generators by sending outdata from one to another
|
|
1420
|
-
let result = source(); // Start with the source generator
|
|
1421
|
-
for (let i = 0; i < stages.length; i++) {
|
|
1422
|
-
result = stages[i](result); // Pass on the result to next generator
|
|
1423
|
-
}
|
|
1424
|
-
try {
|
|
1425
|
-
// Start running the machine. If the last stage is a sink, it will consume the data and never emit anything
|
|
1426
|
-
// to us here...
|
|
1427
|
-
for (var _d = true, result_1 = __asyncValues(result), result_1_1; result_1_1 = await result_1.next(), _a = result_1_1.done, !_a; _d = true) {
|
|
1428
|
-
_c = result_1_1.value;
|
|
1429
|
-
_d = false;
|
|
1430
|
-
const chunk = _c;
|
|
1431
|
-
}
|
|
1432
|
-
}
|
|
1433
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
1434
|
-
finally {
|
|
1435
|
-
try {
|
|
1436
|
-
if (!_d && !_a && (_b = result_1.return)) await _b.call(result_1);
|
|
1437
|
-
}
|
|
1438
|
-
finally { if (e_1) throw e_1.error; }
|
|
1439
|
-
}
|
|
1440
|
-
}
|
|
1441
|
-
|
|
1442
|
-
function consumeChunkedBinaryStream(source) {
|
|
1443
|
-
return __asyncGenerator(this, arguments, function* consumeChunkedBinaryStream_1() {
|
|
1444
|
-
var _a, e_1, _b, _c;
|
|
1445
|
-
let state = 0;
|
|
1446
|
-
let sizeBuf = new Uint8Array(4);
|
|
1447
|
-
let sizeBufPos = 0;
|
|
1448
|
-
let bufs = [];
|
|
1449
|
-
let len = 0;
|
|
1450
|
-
try {
|
|
1451
|
-
for (var _d = true, source_1 = __asyncValues(source), source_1_1; source_1_1 = yield __await(source_1.next()), _a = source_1_1.done, !_a; _d = true) {
|
|
1452
|
-
_c = source_1_1.value;
|
|
1453
|
-
_d = false;
|
|
1454
|
-
const chunk = _c;
|
|
1455
|
-
const dw = new DataView(chunk.buffer, chunk.byteOffset, chunk.byteLength);
|
|
1456
|
-
let pos = 0;
|
|
1457
|
-
while (pos < chunk.byteLength) {
|
|
1458
|
-
switch (state) {
|
|
1459
|
-
case 0:
|
|
1460
|
-
// Beginning of a size header
|
|
1461
|
-
if (pos + 4 > chunk.byteLength) {
|
|
1462
|
-
for (const b of chunk.slice(pos)) {
|
|
1463
|
-
if (sizeBufPos === 4)
|
|
1464
|
-
break;
|
|
1465
|
-
sizeBuf[sizeBufPos++] = b;
|
|
1466
|
-
++pos;
|
|
1467
|
-
}
|
|
1468
|
-
if (sizeBufPos < 4) {
|
|
1469
|
-
// Need more bytes in order to read length.
|
|
1470
|
-
// Will go out from while loop as well because pos is defenitely = chunk.byteLength here.
|
|
1471
|
-
break;
|
|
1472
|
-
}
|
|
1473
|
-
}
|
|
1474
|
-
else if (sizeBufPos > 0 && sizeBufPos < 4) {
|
|
1475
|
-
for (const b of chunk.slice(pos, pos + 4 - sizeBufPos)) {
|
|
1476
|
-
sizeBuf[sizeBufPos++] = b;
|
|
1477
|
-
++pos;
|
|
1478
|
-
}
|
|
1479
|
-
}
|
|
1480
|
-
// Intentional fall-through...
|
|
1481
|
-
case 1:
|
|
1482
|
-
len =
|
|
1483
|
-
sizeBufPos === 4
|
|
1484
|
-
? new DataView(sizeBuf.buffer, 0, 4).getUint32(0, false)
|
|
1485
|
-
: dw.getUint32(pos, false);
|
|
1486
|
-
if (sizeBufPos)
|
|
1487
|
-
sizeBufPos = 0; // in this case pos is already forwarded
|
|
1488
|
-
else
|
|
1489
|
-
pos += 4; // else pos is not yet forwarded - that's why we do it now
|
|
1490
|
-
// Intentional fall-through...
|
|
1491
|
-
case 2:
|
|
1492
|
-
// Eat the chunk
|
|
1493
|
-
if (pos >= chunk.byteLength) {
|
|
1494
|
-
state = 2;
|
|
1495
|
-
break;
|
|
1496
|
-
}
|
|
1497
|
-
if (pos + len > chunk.byteLength) {
|
|
1498
|
-
bufs.push(chunk.slice(pos));
|
|
1499
|
-
len -= (chunk.byteLength - pos);
|
|
1500
|
-
state = 2;
|
|
1501
|
-
pos = chunk.byteLength; // will break while loop.
|
|
1502
|
-
}
|
|
1503
|
-
else {
|
|
1504
|
-
if (bufs.length > 0) {
|
|
1505
|
-
const concats = new Uint8Array(bufs.reduce((p, c) => p + c.byteLength, len));
|
|
1506
|
-
let p = 0;
|
|
1507
|
-
for (const buf of bufs) {
|
|
1508
|
-
concats.set(buf, p);
|
|
1509
|
-
p += buf.byteLength;
|
|
1510
|
-
}
|
|
1511
|
-
concats.set(chunk.slice(pos, pos + len), p);
|
|
1512
|
-
bufs = [];
|
|
1513
|
-
yield yield __await(concats);
|
|
1514
|
-
}
|
|
1515
|
-
else {
|
|
1516
|
-
yield yield __await(chunk.slice(pos, pos + len));
|
|
1517
|
-
}
|
|
1518
|
-
pos += len;
|
|
1519
|
-
state = 0;
|
|
1520
|
-
}
|
|
1521
|
-
break;
|
|
1522
|
-
}
|
|
1523
|
-
}
|
|
1524
|
-
}
|
|
1525
|
-
}
|
|
1526
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
1527
|
-
finally {
|
|
1528
|
-
try {
|
|
1529
|
-
if (!_d && !_a && (_b = source_1.return)) yield __await(_b.call(source_1));
|
|
1530
|
-
}
|
|
1531
|
-
finally { if (e_1) throw e_1.error; }
|
|
1532
|
-
}
|
|
1533
|
-
});
|
|
1534
|
-
}
|
|
1535
|
-
|
|
1536
|
-
function getFetchResponseBodyGenerator(res) {
|
|
1537
|
-
return function () {
|
|
1538
|
-
return __asyncGenerator(this, arguments, function* () {
|
|
1539
|
-
if (!res.body)
|
|
1540
|
-
throw new Error("Response body is not readable");
|
|
1541
|
-
const reader = res.body.getReader();
|
|
1542
|
-
try {
|
|
1543
|
-
while (true) {
|
|
1544
|
-
const { done, value } = yield __await(reader.read());
|
|
1545
|
-
if (done)
|
|
1546
|
-
return yield __await(void 0);
|
|
1547
|
-
yield yield __await(value);
|
|
1548
|
-
}
|
|
1549
|
-
}
|
|
1550
|
-
finally {
|
|
1551
|
-
reader.releaseLock();
|
|
1552
|
-
}
|
|
1553
|
-
});
|
|
1554
|
-
};
|
|
1555
|
-
}
|
|
1556
|
-
|
|
1557
|
-
function isFunction(value) {
|
|
1558
|
-
return typeof value === 'function';
|
|
1559
|
-
}
|
|
1560
|
-
|
|
1561
|
-
function hasLift(source) {
|
|
1562
|
-
return isFunction(source === null || source === void 0 ? void 0 : source.lift);
|
|
1563
|
-
}
|
|
1564
|
-
function operate(init) {
|
|
1565
|
-
return function (source) {
|
|
1566
|
-
if (hasLift(source)) {
|
|
1567
|
-
return source.lift(function (liftedSource) {
|
|
1568
|
-
try {
|
|
1569
|
-
return init(liftedSource, this);
|
|
1570
|
-
}
|
|
1571
|
-
catch (err) {
|
|
1572
|
-
this.error(err);
|
|
1573
|
-
}
|
|
1574
|
-
});
|
|
1575
|
-
}
|
|
1576
|
-
throw new TypeError('Unable to lift unknown Observable type');
|
|
1577
|
-
};
|
|
1578
|
-
}
|
|
1579
|
-
|
|
1580
|
-
var isArrayLike = (function (x) { return x && typeof x.length === 'number' && typeof x !== 'function'; });
|
|
1581
|
-
|
|
1582
|
-
function isPromise(value) {
|
|
1583
|
-
return isFunction(value === null || value === void 0 ? void 0 : value.then);
|
|
1584
|
-
}
|
|
1585
|
-
|
|
1586
|
-
function createErrorClass(createImpl) {
|
|
1587
|
-
var _super = function (instance) {
|
|
1588
|
-
Error.call(instance);
|
|
1589
|
-
instance.stack = new Error().stack;
|
|
1590
|
-
};
|
|
1591
|
-
var ctorFunc = createImpl(_super);
|
|
1592
|
-
ctorFunc.prototype = Object.create(Error.prototype);
|
|
1593
|
-
ctorFunc.prototype.constructor = ctorFunc;
|
|
1594
|
-
return ctorFunc;
|
|
1595
|
-
}
|
|
1596
|
-
|
|
1597
|
-
var UnsubscriptionError = createErrorClass(function (_super) {
|
|
1598
|
-
return function UnsubscriptionErrorImpl(errors) {
|
|
1599
|
-
_super(this);
|
|
1600
|
-
this.message = errors
|
|
1601
|
-
? errors.length + " errors occurred during unsubscription:\n" + errors.map(function (err, i) { return i + 1 + ") " + err.toString(); }).join('\n ')
|
|
1602
|
-
: '';
|
|
1603
|
-
this.name = 'UnsubscriptionError';
|
|
1604
|
-
this.errors = errors;
|
|
1605
|
-
};
|
|
1606
|
-
});
|
|
1607
|
-
|
|
1608
|
-
function arrRemove(arr, item) {
|
|
1609
|
-
if (arr) {
|
|
1610
|
-
var index = arr.indexOf(item);
|
|
1611
|
-
0 <= index && arr.splice(index, 1);
|
|
1612
|
-
}
|
|
1613
|
-
}
|
|
1614
|
-
|
|
1615
|
-
var Subscription = (function () {
|
|
1616
|
-
function Subscription(initialTeardown) {
|
|
1617
|
-
this.initialTeardown = initialTeardown;
|
|
1618
|
-
this.closed = false;
|
|
1619
|
-
this._parentage = null;
|
|
1620
|
-
this._finalizers = null;
|
|
1621
|
-
}
|
|
1622
|
-
Subscription.prototype.unsubscribe = function () {
|
|
1623
|
-
var e_1, _a, e_2, _b;
|
|
1624
|
-
var errors;
|
|
1625
|
-
if (!this.closed) {
|
|
1626
|
-
this.closed = true;
|
|
1627
|
-
var _parentage = this._parentage;
|
|
1628
|
-
if (_parentage) {
|
|
1629
|
-
this._parentage = null;
|
|
1630
|
-
if (Array.isArray(_parentage)) {
|
|
1631
|
-
try {
|
|
1632
|
-
for (var _parentage_1 = __values(_parentage), _parentage_1_1 = _parentage_1.next(); !_parentage_1_1.done; _parentage_1_1 = _parentage_1.next()) {
|
|
1633
|
-
var parent_1 = _parentage_1_1.value;
|
|
1634
|
-
parent_1.remove(this);
|
|
1635
|
-
}
|
|
1636
|
-
}
|
|
1637
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
1638
|
-
finally {
|
|
1639
|
-
try {
|
|
1640
|
-
if (_parentage_1_1 && !_parentage_1_1.done && (_a = _parentage_1.return)) _a.call(_parentage_1);
|
|
1641
|
-
}
|
|
1642
|
-
finally { if (e_1) throw e_1.error; }
|
|
1643
|
-
}
|
|
1644
|
-
}
|
|
1645
|
-
else {
|
|
1646
|
-
_parentage.remove(this);
|
|
1647
|
-
}
|
|
1648
|
-
}
|
|
1649
|
-
var initialFinalizer = this.initialTeardown;
|
|
1650
|
-
if (isFunction(initialFinalizer)) {
|
|
1651
|
-
try {
|
|
1652
|
-
initialFinalizer();
|
|
1653
|
-
}
|
|
1654
|
-
catch (e) {
|
|
1655
|
-
errors = e instanceof UnsubscriptionError ? e.errors : [e];
|
|
1656
|
-
}
|
|
1657
|
-
}
|
|
1658
|
-
var _finalizers = this._finalizers;
|
|
1659
|
-
if (_finalizers) {
|
|
1660
|
-
this._finalizers = null;
|
|
1661
|
-
try {
|
|
1662
|
-
for (var _finalizers_1 = __values(_finalizers), _finalizers_1_1 = _finalizers_1.next(); !_finalizers_1_1.done; _finalizers_1_1 = _finalizers_1.next()) {
|
|
1663
|
-
var finalizer = _finalizers_1_1.value;
|
|
1664
|
-
try {
|
|
1665
|
-
execFinalizer(finalizer);
|
|
1666
|
-
}
|
|
1667
|
-
catch (err) {
|
|
1668
|
-
errors = errors !== null && errors !== void 0 ? errors : [];
|
|
1669
|
-
if (err instanceof UnsubscriptionError) {
|
|
1670
|
-
errors = __spreadArray(__spreadArray([], __read(errors)), __read(err.errors));
|
|
1671
|
-
}
|
|
1672
|
-
else {
|
|
1673
|
-
errors.push(err);
|
|
1674
|
-
}
|
|
1675
|
-
}
|
|
1676
|
-
}
|
|
1677
|
-
}
|
|
1678
|
-
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
1679
|
-
finally {
|
|
1680
|
-
try {
|
|
1681
|
-
if (_finalizers_1_1 && !_finalizers_1_1.done && (_b = _finalizers_1.return)) _b.call(_finalizers_1);
|
|
1682
|
-
}
|
|
1683
|
-
finally { if (e_2) throw e_2.error; }
|
|
1684
|
-
}
|
|
1685
|
-
}
|
|
1686
|
-
if (errors) {
|
|
1687
|
-
throw new UnsubscriptionError(errors);
|
|
1688
|
-
}
|
|
1689
|
-
}
|
|
1690
|
-
};
|
|
1691
|
-
Subscription.prototype.add = function (teardown) {
|
|
1692
|
-
var _a;
|
|
1693
|
-
if (teardown && teardown !== this) {
|
|
1694
|
-
if (this.closed) {
|
|
1695
|
-
execFinalizer(teardown);
|
|
1696
|
-
}
|
|
1697
|
-
else {
|
|
1698
|
-
if (teardown instanceof Subscription) {
|
|
1699
|
-
if (teardown.closed || teardown._hasParent(this)) {
|
|
1700
|
-
return;
|
|
1701
|
-
}
|
|
1702
|
-
teardown._addParent(this);
|
|
1703
|
-
}
|
|
1704
|
-
(this._finalizers = (_a = this._finalizers) !== null && _a !== void 0 ? _a : []).push(teardown);
|
|
1705
|
-
}
|
|
1706
|
-
}
|
|
1707
|
-
};
|
|
1708
|
-
Subscription.prototype._hasParent = function (parent) {
|
|
1709
|
-
var _parentage = this._parentage;
|
|
1710
|
-
return _parentage === parent || (Array.isArray(_parentage) && _parentage.includes(parent));
|
|
1711
|
-
};
|
|
1712
|
-
Subscription.prototype._addParent = function (parent) {
|
|
1713
|
-
var _parentage = this._parentage;
|
|
1714
|
-
this._parentage = Array.isArray(_parentage) ? (_parentage.push(parent), _parentage) : _parentage ? [_parentage, parent] : parent;
|
|
1715
|
-
};
|
|
1716
|
-
Subscription.prototype._removeParent = function (parent) {
|
|
1717
|
-
var _parentage = this._parentage;
|
|
1718
|
-
if (_parentage === parent) {
|
|
1719
|
-
this._parentage = null;
|
|
1720
|
-
}
|
|
1721
|
-
else if (Array.isArray(_parentage)) {
|
|
1722
|
-
arrRemove(_parentage, parent);
|
|
1723
|
-
}
|
|
1724
|
-
};
|
|
1725
|
-
Subscription.prototype.remove = function (teardown) {
|
|
1726
|
-
var _finalizers = this._finalizers;
|
|
1727
|
-
_finalizers && arrRemove(_finalizers, teardown);
|
|
1728
|
-
if (teardown instanceof Subscription) {
|
|
1729
|
-
teardown._removeParent(this);
|
|
1730
|
-
}
|
|
1731
|
-
};
|
|
1732
|
-
Subscription.EMPTY = (function () {
|
|
1733
|
-
var empty = new Subscription();
|
|
1734
|
-
empty.closed = true;
|
|
1735
|
-
return empty;
|
|
1736
|
-
})();
|
|
1737
|
-
return Subscription;
|
|
1738
|
-
}());
|
|
1739
|
-
Subscription.EMPTY;
|
|
1740
|
-
function isSubscription(value) {
|
|
1741
|
-
return (value instanceof Subscription ||
|
|
1742
|
-
(value && 'closed' in value && isFunction(value.remove) && isFunction(value.add) && isFunction(value.unsubscribe)));
|
|
1743
|
-
}
|
|
1744
|
-
function execFinalizer(finalizer) {
|
|
1745
|
-
if (isFunction(finalizer)) {
|
|
1746
|
-
finalizer();
|
|
1747
|
-
}
|
|
1748
|
-
else {
|
|
1749
|
-
finalizer.unsubscribe();
|
|
1750
|
-
}
|
|
1751
|
-
}
|
|
1752
|
-
|
|
1753
|
-
var config = {
|
|
1754
|
-
onUnhandledError: null,
|
|
1755
|
-
onStoppedNotification: null,
|
|
1756
|
-
Promise: undefined,
|
|
1757
|
-
useDeprecatedSynchronousErrorHandling: false,
|
|
1758
|
-
useDeprecatedNextContext: false,
|
|
1759
|
-
};
|
|
1760
|
-
|
|
1761
|
-
var timeoutProvider = {
|
|
1762
|
-
setTimeout: function (handler, timeout) {
|
|
1763
|
-
var args = [];
|
|
1764
|
-
for (var _i = 2; _i < arguments.length; _i++) {
|
|
1765
|
-
args[_i - 2] = arguments[_i];
|
|
1766
|
-
}
|
|
1767
|
-
var delegate = timeoutProvider.delegate;
|
|
1768
|
-
if (delegate === null || delegate === void 0 ? void 0 : delegate.setTimeout) {
|
|
1769
|
-
return delegate.setTimeout.apply(delegate, __spreadArray([handler, timeout], __read(args)));
|
|
1770
|
-
}
|
|
1771
|
-
return setTimeout.apply(void 0, __spreadArray([handler, timeout], __read(args)));
|
|
1772
|
-
},
|
|
1773
|
-
clearTimeout: function (handle) {
|
|
1774
|
-
var delegate = timeoutProvider.delegate;
|
|
1775
|
-
return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearTimeout) || clearTimeout)(handle);
|
|
1776
|
-
},
|
|
1777
|
-
delegate: undefined,
|
|
1778
|
-
};
|
|
1779
|
-
|
|
1780
|
-
function reportUnhandledError(err) {
|
|
1781
|
-
timeoutProvider.setTimeout(function () {
|
|
1782
|
-
{
|
|
1783
|
-
throw err;
|
|
1784
|
-
}
|
|
1785
|
-
});
|
|
1786
|
-
}
|
|
1787
|
-
|
|
1788
|
-
function noop() { }
|
|
1789
|
-
|
|
1790
|
-
function errorContext(cb) {
|
|
1791
|
-
{
|
|
1792
|
-
cb();
|
|
1793
|
-
}
|
|
1794
|
-
}
|
|
1795
|
-
|
|
1796
|
-
var Subscriber = (function (_super) {
|
|
1797
|
-
__extends(Subscriber, _super);
|
|
1798
|
-
function Subscriber(destination) {
|
|
1799
|
-
var _this = _super.call(this) || this;
|
|
1800
|
-
_this.isStopped = false;
|
|
1801
|
-
if (destination) {
|
|
1802
|
-
_this.destination = destination;
|
|
1803
|
-
if (isSubscription(destination)) {
|
|
1804
|
-
destination.add(_this);
|
|
1805
|
-
}
|
|
1806
|
-
}
|
|
1807
|
-
else {
|
|
1808
|
-
_this.destination = EMPTY_OBSERVER;
|
|
1809
|
-
}
|
|
1810
|
-
return _this;
|
|
1811
|
-
}
|
|
1812
|
-
Subscriber.create = function (next, error, complete) {
|
|
1813
|
-
return new SafeSubscriber(next, error, complete);
|
|
1814
|
-
};
|
|
1815
|
-
Subscriber.prototype.next = function (value) {
|
|
1816
|
-
if (this.isStopped) ;
|
|
1817
|
-
else {
|
|
1818
|
-
this._next(value);
|
|
1819
|
-
}
|
|
1820
|
-
};
|
|
1821
|
-
Subscriber.prototype.error = function (err) {
|
|
1822
|
-
if (this.isStopped) ;
|
|
1823
|
-
else {
|
|
1824
|
-
this.isStopped = true;
|
|
1825
|
-
this._error(err);
|
|
1826
|
-
}
|
|
1827
|
-
};
|
|
1828
|
-
Subscriber.prototype.complete = function () {
|
|
1829
|
-
if (this.isStopped) ;
|
|
1830
|
-
else {
|
|
1831
|
-
this.isStopped = true;
|
|
1832
|
-
this._complete();
|
|
1833
|
-
}
|
|
1834
|
-
};
|
|
1835
|
-
Subscriber.prototype.unsubscribe = function () {
|
|
1836
|
-
if (!this.closed) {
|
|
1837
|
-
this.isStopped = true;
|
|
1838
|
-
_super.prototype.unsubscribe.call(this);
|
|
1839
|
-
this.destination = null;
|
|
1840
|
-
}
|
|
1841
|
-
};
|
|
1842
|
-
Subscriber.prototype._next = function (value) {
|
|
1843
|
-
this.destination.next(value);
|
|
1844
|
-
};
|
|
1845
|
-
Subscriber.prototype._error = function (err) {
|
|
1846
|
-
try {
|
|
1847
|
-
this.destination.error(err);
|
|
1848
|
-
}
|
|
1849
|
-
finally {
|
|
1850
|
-
this.unsubscribe();
|
|
1851
|
-
}
|
|
1852
|
-
};
|
|
1853
|
-
Subscriber.prototype._complete = function () {
|
|
1854
|
-
try {
|
|
1855
|
-
this.destination.complete();
|
|
1856
|
-
}
|
|
1857
|
-
finally {
|
|
1858
|
-
this.unsubscribe();
|
|
1859
|
-
}
|
|
1860
|
-
};
|
|
1861
|
-
return Subscriber;
|
|
1862
|
-
}(Subscription));
|
|
1863
|
-
var _bind = Function.prototype.bind;
|
|
1864
|
-
function bind(fn, thisArg) {
|
|
1865
|
-
return _bind.call(fn, thisArg);
|
|
1866
|
-
}
|
|
1867
|
-
var ConsumerObserver = (function () {
|
|
1868
|
-
function ConsumerObserver(partialObserver) {
|
|
1869
|
-
this.partialObserver = partialObserver;
|
|
1870
|
-
}
|
|
1871
|
-
ConsumerObserver.prototype.next = function (value) {
|
|
1872
|
-
var partialObserver = this.partialObserver;
|
|
1873
|
-
if (partialObserver.next) {
|
|
1874
|
-
try {
|
|
1875
|
-
partialObserver.next(value);
|
|
1876
|
-
}
|
|
1877
|
-
catch (error) {
|
|
1878
|
-
handleUnhandledError(error);
|
|
1879
|
-
}
|
|
1880
|
-
}
|
|
1881
|
-
};
|
|
1882
|
-
ConsumerObserver.prototype.error = function (err) {
|
|
1883
|
-
var partialObserver = this.partialObserver;
|
|
1884
|
-
if (partialObserver.error) {
|
|
1885
|
-
try {
|
|
1886
|
-
partialObserver.error(err);
|
|
1887
|
-
}
|
|
1888
|
-
catch (error) {
|
|
1889
|
-
handleUnhandledError(error);
|
|
1890
|
-
}
|
|
1891
|
-
}
|
|
1892
|
-
else {
|
|
1893
|
-
handleUnhandledError(err);
|
|
1894
|
-
}
|
|
1895
|
-
};
|
|
1896
|
-
ConsumerObserver.prototype.complete = function () {
|
|
1897
|
-
var partialObserver = this.partialObserver;
|
|
1898
|
-
if (partialObserver.complete) {
|
|
1899
|
-
try {
|
|
1900
|
-
partialObserver.complete();
|
|
1901
|
-
}
|
|
1902
|
-
catch (error) {
|
|
1903
|
-
handleUnhandledError(error);
|
|
1904
|
-
}
|
|
1905
|
-
}
|
|
1906
|
-
};
|
|
1907
|
-
return ConsumerObserver;
|
|
1908
|
-
}());
|
|
1909
|
-
var SafeSubscriber = (function (_super) {
|
|
1910
|
-
__extends(SafeSubscriber, _super);
|
|
1911
|
-
function SafeSubscriber(observerOrNext, error, complete) {
|
|
1912
|
-
var _this = _super.call(this) || this;
|
|
1913
|
-
var partialObserver;
|
|
1914
|
-
if (isFunction(observerOrNext) || !observerOrNext) {
|
|
1915
|
-
partialObserver = {
|
|
1916
|
-
next: (observerOrNext !== null && observerOrNext !== void 0 ? observerOrNext : undefined),
|
|
1917
|
-
error: error !== null && error !== void 0 ? error : undefined,
|
|
1918
|
-
complete: complete !== null && complete !== void 0 ? complete : undefined,
|
|
1919
|
-
};
|
|
1920
|
-
}
|
|
1921
|
-
else {
|
|
1922
|
-
var context_1;
|
|
1923
|
-
if (_this && config.useDeprecatedNextContext) {
|
|
1924
|
-
context_1 = Object.create(observerOrNext);
|
|
1925
|
-
context_1.unsubscribe = function () { return _this.unsubscribe(); };
|
|
1926
|
-
partialObserver = {
|
|
1927
|
-
next: observerOrNext.next && bind(observerOrNext.next, context_1),
|
|
1928
|
-
error: observerOrNext.error && bind(observerOrNext.error, context_1),
|
|
1929
|
-
complete: observerOrNext.complete && bind(observerOrNext.complete, context_1),
|
|
1930
|
-
};
|
|
1931
|
-
}
|
|
1932
|
-
else {
|
|
1933
|
-
partialObserver = observerOrNext;
|
|
1934
|
-
}
|
|
1935
|
-
}
|
|
1936
|
-
_this.destination = new ConsumerObserver(partialObserver);
|
|
1937
|
-
return _this;
|
|
1938
|
-
}
|
|
1939
|
-
return SafeSubscriber;
|
|
1940
|
-
}(Subscriber));
|
|
1941
|
-
function handleUnhandledError(error) {
|
|
1942
|
-
{
|
|
1943
|
-
reportUnhandledError(error);
|
|
1944
|
-
}
|
|
1945
|
-
}
|
|
1946
|
-
function defaultErrorHandler(err) {
|
|
1947
|
-
throw err;
|
|
1948
|
-
}
|
|
1949
|
-
var EMPTY_OBSERVER = {
|
|
1950
|
-
closed: true,
|
|
1951
|
-
next: noop,
|
|
1952
|
-
error: defaultErrorHandler,
|
|
1953
|
-
complete: noop,
|
|
1954
|
-
};
|
|
1955
|
-
|
|
1956
|
-
var observable = (function () { return (typeof Symbol === 'function' && Symbol.observable) || '@@observable'; })();
|
|
1957
|
-
|
|
1958
|
-
function identity(x) {
|
|
1959
|
-
return x;
|
|
1960
|
-
}
|
|
1961
|
-
|
|
1962
|
-
function pipeFromArray(fns) {
|
|
1963
|
-
if (fns.length === 0) {
|
|
1964
|
-
return identity;
|
|
1965
|
-
}
|
|
1966
|
-
if (fns.length === 1) {
|
|
1967
|
-
return fns[0];
|
|
1968
|
-
}
|
|
1969
|
-
return function piped(input) {
|
|
1970
|
-
return fns.reduce(function (prev, fn) { return fn(prev); }, input);
|
|
1971
|
-
};
|
|
1972
|
-
}
|
|
1973
|
-
|
|
1974
|
-
var Observable = (function () {
|
|
1975
|
-
function Observable(subscribe) {
|
|
1976
|
-
if (subscribe) {
|
|
1977
|
-
this._subscribe = subscribe;
|
|
1978
|
-
}
|
|
1979
|
-
}
|
|
1980
|
-
Observable.prototype.lift = function (operator) {
|
|
1981
|
-
var observable = new Observable();
|
|
1982
|
-
observable.source = this;
|
|
1983
|
-
observable.operator = operator;
|
|
1984
|
-
return observable;
|
|
1985
|
-
};
|
|
1986
|
-
Observable.prototype.subscribe = function (observerOrNext, error, complete) {
|
|
1987
|
-
var _this = this;
|
|
1988
|
-
var subscriber = isSubscriber(observerOrNext) ? observerOrNext : new SafeSubscriber(observerOrNext, error, complete);
|
|
1989
|
-
errorContext(function () {
|
|
1990
|
-
var _a = _this, operator = _a.operator, source = _a.source;
|
|
1991
|
-
subscriber.add(operator
|
|
1992
|
-
?
|
|
1993
|
-
operator.call(subscriber, source)
|
|
1994
|
-
: source
|
|
1995
|
-
?
|
|
1996
|
-
_this._subscribe(subscriber)
|
|
1997
|
-
:
|
|
1998
|
-
_this._trySubscribe(subscriber));
|
|
1999
|
-
});
|
|
2000
|
-
return subscriber;
|
|
2001
|
-
};
|
|
2002
|
-
Observable.prototype._trySubscribe = function (sink) {
|
|
2003
|
-
try {
|
|
2004
|
-
return this._subscribe(sink);
|
|
2005
|
-
}
|
|
2006
|
-
catch (err) {
|
|
2007
|
-
sink.error(err);
|
|
2008
|
-
}
|
|
2009
|
-
};
|
|
2010
|
-
Observable.prototype.forEach = function (next, promiseCtor) {
|
|
2011
|
-
var _this = this;
|
|
2012
|
-
promiseCtor = getPromiseCtor(promiseCtor);
|
|
2013
|
-
return new promiseCtor(function (resolve, reject) {
|
|
2014
|
-
var subscriber = new SafeSubscriber({
|
|
2015
|
-
next: function (value) {
|
|
2016
|
-
try {
|
|
2017
|
-
next(value);
|
|
2018
|
-
}
|
|
2019
|
-
catch (err) {
|
|
2020
|
-
reject(err);
|
|
2021
|
-
subscriber.unsubscribe();
|
|
2022
|
-
}
|
|
2023
|
-
},
|
|
2024
|
-
error: reject,
|
|
2025
|
-
complete: resolve,
|
|
2026
|
-
});
|
|
2027
|
-
_this.subscribe(subscriber);
|
|
2028
|
-
});
|
|
2029
|
-
};
|
|
2030
|
-
Observable.prototype._subscribe = function (subscriber) {
|
|
2031
|
-
var _a;
|
|
2032
|
-
return (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber);
|
|
2033
|
-
};
|
|
2034
|
-
Observable.prototype[observable] = function () {
|
|
2035
|
-
return this;
|
|
2036
|
-
};
|
|
2037
|
-
Observable.prototype.pipe = function () {
|
|
2038
|
-
var operations = [];
|
|
2039
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
2040
|
-
operations[_i] = arguments[_i];
|
|
2041
|
-
}
|
|
2042
|
-
return pipeFromArray(operations)(this);
|
|
2043
|
-
};
|
|
2044
|
-
Observable.prototype.toPromise = function (promiseCtor) {
|
|
2045
|
-
var _this = this;
|
|
2046
|
-
promiseCtor = getPromiseCtor(promiseCtor);
|
|
2047
|
-
return new promiseCtor(function (resolve, reject) {
|
|
2048
|
-
var value;
|
|
2049
|
-
_this.subscribe(function (x) { return (value = x); }, function (err) { return reject(err); }, function () { return resolve(value); });
|
|
2050
|
-
});
|
|
2051
|
-
};
|
|
2052
|
-
Observable.create = function (subscribe) {
|
|
2053
|
-
return new Observable(subscribe);
|
|
2054
|
-
};
|
|
2055
|
-
return Observable;
|
|
2056
|
-
}());
|
|
2057
|
-
function getPromiseCtor(promiseCtor) {
|
|
2058
|
-
var _a;
|
|
2059
|
-
return (_a = promiseCtor !== null && promiseCtor !== void 0 ? promiseCtor : config.Promise) !== null && _a !== void 0 ? _a : Promise;
|
|
2060
|
-
}
|
|
2061
|
-
function isObserver(value) {
|
|
2062
|
-
return value && isFunction(value.next) && isFunction(value.error) && isFunction(value.complete);
|
|
2063
|
-
}
|
|
2064
|
-
function isSubscriber(value) {
|
|
2065
|
-
return (value && value instanceof Subscriber) || (isObserver(value) && isSubscription(value));
|
|
2066
|
-
}
|
|
2067
|
-
|
|
2068
|
-
function isInteropObservable(input) {
|
|
2069
|
-
return isFunction(input[observable]);
|
|
2070
|
-
}
|
|
2071
|
-
|
|
2072
|
-
function isAsyncIterable(obj) {
|
|
2073
|
-
return Symbol.asyncIterator && isFunction(obj === null || obj === void 0 ? void 0 : obj[Symbol.asyncIterator]);
|
|
2074
|
-
}
|
|
2075
|
-
|
|
2076
|
-
function createInvalidObservableTypeError(input) {
|
|
2077
|
-
return new TypeError("You provided " + (input !== null && typeof input === 'object' ? 'an invalid object' : "'" + input + "'") + " where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.");
|
|
2078
|
-
}
|
|
2079
|
-
|
|
2080
|
-
function getSymbolIterator() {
|
|
2081
|
-
if (typeof Symbol !== 'function' || !Symbol.iterator) {
|
|
2082
|
-
return '@@iterator';
|
|
2083
|
-
}
|
|
2084
|
-
return Symbol.iterator;
|
|
2085
|
-
}
|
|
2086
|
-
var iterator = getSymbolIterator();
|
|
2087
|
-
|
|
2088
|
-
function isIterable(input) {
|
|
2089
|
-
return isFunction(input === null || input === void 0 ? void 0 : input[iterator]);
|
|
2090
|
-
}
|
|
2091
|
-
|
|
2092
|
-
function readableStreamLikeToAsyncGenerator(readableStream) {
|
|
2093
|
-
return __asyncGenerator(this, arguments, function readableStreamLikeToAsyncGenerator_1() {
|
|
2094
|
-
var reader, _a, value, done;
|
|
2095
|
-
return __generator(this, function (_b) {
|
|
2096
|
-
switch (_b.label) {
|
|
2097
|
-
case 0:
|
|
2098
|
-
reader = readableStream.getReader();
|
|
2099
|
-
_b.label = 1;
|
|
2100
|
-
case 1:
|
|
2101
|
-
_b.trys.push([1, , 9, 10]);
|
|
2102
|
-
_b.label = 2;
|
|
2103
|
-
case 2:
|
|
2104
|
-
return [4, __await(reader.read())];
|
|
2105
|
-
case 3:
|
|
2106
|
-
_a = _b.sent(), value = _a.value, done = _a.done;
|
|
2107
|
-
if (!done) return [3, 5];
|
|
2108
|
-
return [4, __await(void 0)];
|
|
2109
|
-
case 4: return [2, _b.sent()];
|
|
2110
|
-
case 5: return [4, __await(value)];
|
|
2111
|
-
case 6: return [4, _b.sent()];
|
|
2112
|
-
case 7:
|
|
2113
|
-
_b.sent();
|
|
2114
|
-
return [3, 2];
|
|
2115
|
-
case 8: return [3, 10];
|
|
2116
|
-
case 9:
|
|
2117
|
-
reader.releaseLock();
|
|
2118
|
-
return [7];
|
|
2119
|
-
case 10: return [2];
|
|
2120
|
-
}
|
|
2121
|
-
});
|
|
2122
|
-
});
|
|
2123
|
-
}
|
|
2124
|
-
function isReadableStreamLike(obj) {
|
|
2125
|
-
return isFunction(obj === null || obj === void 0 ? void 0 : obj.getReader);
|
|
2126
|
-
}
|
|
2127
|
-
|
|
2128
|
-
function innerFrom(input) {
|
|
2129
|
-
if (input instanceof Observable) {
|
|
2130
|
-
return input;
|
|
2131
|
-
}
|
|
2132
|
-
if (input != null) {
|
|
2133
|
-
if (isInteropObservable(input)) {
|
|
2134
|
-
return fromInteropObservable(input);
|
|
2135
|
-
}
|
|
2136
|
-
if (isArrayLike(input)) {
|
|
2137
|
-
return fromArrayLike(input);
|
|
2138
|
-
}
|
|
2139
|
-
if (isPromise(input)) {
|
|
2140
|
-
return fromPromise(input);
|
|
2141
|
-
}
|
|
2142
|
-
if (isAsyncIterable(input)) {
|
|
2143
|
-
return fromAsyncIterable(input);
|
|
2144
|
-
}
|
|
2145
|
-
if (isIterable(input)) {
|
|
2146
|
-
return fromIterable(input);
|
|
2147
|
-
}
|
|
2148
|
-
if (isReadableStreamLike(input)) {
|
|
2149
|
-
return fromReadableStreamLike(input);
|
|
2150
|
-
}
|
|
2151
|
-
}
|
|
2152
|
-
throw createInvalidObservableTypeError(input);
|
|
2153
|
-
}
|
|
2154
|
-
function fromInteropObservable(obj) {
|
|
2155
|
-
return new Observable(function (subscriber) {
|
|
2156
|
-
var obs = obj[observable]();
|
|
2157
|
-
if (isFunction(obs.subscribe)) {
|
|
2158
|
-
return obs.subscribe(subscriber);
|
|
2159
|
-
}
|
|
2160
|
-
throw new TypeError('Provided object does not correctly implement Symbol.observable');
|
|
2161
|
-
});
|
|
2162
|
-
}
|
|
2163
|
-
function fromArrayLike(array) {
|
|
2164
|
-
return new Observable(function (subscriber) {
|
|
2165
|
-
for (var i = 0; i < array.length && !subscriber.closed; i++) {
|
|
2166
|
-
subscriber.next(array[i]);
|
|
2167
|
-
}
|
|
2168
|
-
subscriber.complete();
|
|
2169
|
-
});
|
|
2170
|
-
}
|
|
2171
|
-
function fromPromise(promise) {
|
|
2172
|
-
return new Observable(function (subscriber) {
|
|
2173
|
-
promise
|
|
2174
|
-
.then(function (value) {
|
|
2175
|
-
if (!subscriber.closed) {
|
|
2176
|
-
subscriber.next(value);
|
|
2177
|
-
subscriber.complete();
|
|
2178
|
-
}
|
|
2179
|
-
}, function (err) { return subscriber.error(err); })
|
|
2180
|
-
.then(null, reportUnhandledError);
|
|
2181
|
-
});
|
|
2182
|
-
}
|
|
2183
|
-
function fromIterable(iterable) {
|
|
2184
|
-
return new Observable(function (subscriber) {
|
|
2185
|
-
var e_1, _a;
|
|
2186
|
-
try {
|
|
2187
|
-
for (var iterable_1 = __values(iterable), iterable_1_1 = iterable_1.next(); !iterable_1_1.done; iterable_1_1 = iterable_1.next()) {
|
|
2188
|
-
var value = iterable_1_1.value;
|
|
2189
|
-
subscriber.next(value);
|
|
2190
|
-
if (subscriber.closed) {
|
|
2191
|
-
return;
|
|
2192
|
-
}
|
|
2193
|
-
}
|
|
2194
|
-
}
|
|
2195
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
2196
|
-
finally {
|
|
2197
|
-
try {
|
|
2198
|
-
if (iterable_1_1 && !iterable_1_1.done && (_a = iterable_1.return)) _a.call(iterable_1);
|
|
2199
|
-
}
|
|
2200
|
-
finally { if (e_1) throw e_1.error; }
|
|
2201
|
-
}
|
|
2202
|
-
subscriber.complete();
|
|
2203
|
-
});
|
|
2204
|
-
}
|
|
2205
|
-
function fromAsyncIterable(asyncIterable) {
|
|
2206
|
-
return new Observable(function (subscriber) {
|
|
2207
|
-
process$1(asyncIterable, subscriber).catch(function (err) { return subscriber.error(err); });
|
|
2208
|
-
});
|
|
2209
|
-
}
|
|
2210
|
-
function fromReadableStreamLike(readableStream) {
|
|
2211
|
-
return fromAsyncIterable(readableStreamLikeToAsyncGenerator(readableStream));
|
|
2212
|
-
}
|
|
2213
|
-
function process$1(asyncIterable, subscriber) {
|
|
2214
|
-
var asyncIterable_1, asyncIterable_1_1;
|
|
2215
|
-
var e_2, _a;
|
|
2216
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
2217
|
-
var value, e_2_1;
|
|
2218
|
-
return __generator(this, function (_b) {
|
|
2219
|
-
switch (_b.label) {
|
|
2220
|
-
case 0:
|
|
2221
|
-
_b.trys.push([0, 5, 6, 11]);
|
|
2222
|
-
asyncIterable_1 = __asyncValues(asyncIterable);
|
|
2223
|
-
_b.label = 1;
|
|
2224
|
-
case 1: return [4, asyncIterable_1.next()];
|
|
2225
|
-
case 2:
|
|
2226
|
-
if (!(asyncIterable_1_1 = _b.sent(), !asyncIterable_1_1.done)) return [3, 4];
|
|
2227
|
-
value = asyncIterable_1_1.value;
|
|
2228
|
-
subscriber.next(value);
|
|
2229
|
-
if (subscriber.closed) {
|
|
2230
|
-
return [2];
|
|
2231
|
-
}
|
|
2232
|
-
_b.label = 3;
|
|
2233
|
-
case 3: return [3, 1];
|
|
2234
|
-
case 4: return [3, 11];
|
|
2235
|
-
case 5:
|
|
2236
|
-
e_2_1 = _b.sent();
|
|
2237
|
-
e_2 = { error: e_2_1 };
|
|
2238
|
-
return [3, 11];
|
|
2239
|
-
case 6:
|
|
2240
|
-
_b.trys.push([6, , 9, 10]);
|
|
2241
|
-
if (!(asyncIterable_1_1 && !asyncIterable_1_1.done && (_a = asyncIterable_1.return))) return [3, 8];
|
|
2242
|
-
return [4, _a.call(asyncIterable_1)];
|
|
2243
|
-
case 7:
|
|
2244
|
-
_b.sent();
|
|
2245
|
-
_b.label = 8;
|
|
2246
|
-
case 8: return [3, 10];
|
|
2247
|
-
case 9:
|
|
2248
|
-
if (e_2) throw e_2.error;
|
|
2249
|
-
return [7];
|
|
2250
|
-
case 10: return [7];
|
|
2251
|
-
case 11:
|
|
2252
|
-
subscriber.complete();
|
|
2253
|
-
return [2];
|
|
2254
|
-
}
|
|
2255
|
-
});
|
|
2256
|
-
});
|
|
2257
|
-
}
|
|
2258
|
-
|
|
2259
|
-
function createOperatorSubscriber(destination, onNext, onComplete, onError, onFinalize) {
|
|
2260
|
-
return new OperatorSubscriber(destination, onNext, onComplete, onError, onFinalize);
|
|
2261
|
-
}
|
|
2262
|
-
var OperatorSubscriber = (function (_super) {
|
|
2263
|
-
__extends(OperatorSubscriber, _super);
|
|
2264
|
-
function OperatorSubscriber(destination, onNext, onComplete, onError, onFinalize, shouldUnsubscribe) {
|
|
2265
|
-
var _this = _super.call(this, destination) || this;
|
|
2266
|
-
_this.onFinalize = onFinalize;
|
|
2267
|
-
_this.shouldUnsubscribe = shouldUnsubscribe;
|
|
2268
|
-
_this._next = onNext
|
|
2269
|
-
? function (value) {
|
|
2270
|
-
try {
|
|
2271
|
-
onNext(value);
|
|
2272
|
-
}
|
|
2273
|
-
catch (err) {
|
|
2274
|
-
destination.error(err);
|
|
2275
|
-
}
|
|
2276
|
-
}
|
|
2277
|
-
: _super.prototype._next;
|
|
2278
|
-
_this._error = onError
|
|
2279
|
-
? function (err) {
|
|
2280
|
-
try {
|
|
2281
|
-
onError(err);
|
|
2282
|
-
}
|
|
2283
|
-
catch (err) {
|
|
2284
|
-
destination.error(err);
|
|
2285
|
-
}
|
|
2286
|
-
finally {
|
|
2287
|
-
this.unsubscribe();
|
|
2288
|
-
}
|
|
2289
|
-
}
|
|
2290
|
-
: _super.prototype._error;
|
|
2291
|
-
_this._complete = onComplete
|
|
2292
|
-
? function () {
|
|
2293
|
-
try {
|
|
2294
|
-
onComplete();
|
|
2295
|
-
}
|
|
2296
|
-
catch (err) {
|
|
2297
|
-
destination.error(err);
|
|
2298
|
-
}
|
|
2299
|
-
finally {
|
|
2300
|
-
this.unsubscribe();
|
|
2301
|
-
}
|
|
2302
|
-
}
|
|
2303
|
-
: _super.prototype._complete;
|
|
2304
|
-
return _this;
|
|
2305
|
-
}
|
|
2306
|
-
OperatorSubscriber.prototype.unsubscribe = function () {
|
|
2307
|
-
var _a;
|
|
2308
|
-
if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {
|
|
2309
|
-
var closed_1 = this.closed;
|
|
2310
|
-
_super.prototype.unsubscribe.call(this);
|
|
2311
|
-
!closed_1 && ((_a = this.onFinalize) === null || _a === void 0 ? void 0 : _a.call(this));
|
|
2312
|
-
}
|
|
2313
|
-
};
|
|
2314
|
-
return OperatorSubscriber;
|
|
2315
|
-
}(Subscriber));
|
|
2316
|
-
|
|
2317
|
-
var Action = (function (_super) {
|
|
2318
|
-
__extends(Action, _super);
|
|
2319
|
-
function Action(scheduler, work) {
|
|
2320
|
-
return _super.call(this) || this;
|
|
2321
|
-
}
|
|
2322
|
-
Action.prototype.schedule = function (state, delay) {
|
|
2323
|
-
return this;
|
|
2324
|
-
};
|
|
2325
|
-
return Action;
|
|
2326
|
-
}(Subscription));
|
|
2327
|
-
|
|
2328
|
-
var intervalProvider = {
|
|
2329
|
-
setInterval: function (handler, timeout) {
|
|
2330
|
-
var args = [];
|
|
2331
|
-
for (var _i = 2; _i < arguments.length; _i++) {
|
|
2332
|
-
args[_i - 2] = arguments[_i];
|
|
2333
|
-
}
|
|
2334
|
-
var delegate = intervalProvider.delegate;
|
|
2335
|
-
if (delegate === null || delegate === void 0 ? void 0 : delegate.setInterval) {
|
|
2336
|
-
return delegate.setInterval.apply(delegate, __spreadArray([handler, timeout], __read(args)));
|
|
2337
|
-
}
|
|
2338
|
-
return setInterval.apply(void 0, __spreadArray([handler, timeout], __read(args)));
|
|
2339
|
-
},
|
|
2340
|
-
clearInterval: function (handle) {
|
|
2341
|
-
var delegate = intervalProvider.delegate;
|
|
2342
|
-
return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearInterval) || clearInterval)(handle);
|
|
2343
|
-
},
|
|
2344
|
-
delegate: undefined,
|
|
2345
|
-
};
|
|
2346
|
-
|
|
2347
|
-
var AsyncAction = (function (_super) {
|
|
2348
|
-
__extends(AsyncAction, _super);
|
|
2349
|
-
function AsyncAction(scheduler, work) {
|
|
2350
|
-
var _this = _super.call(this, scheduler, work) || this;
|
|
2351
|
-
_this.scheduler = scheduler;
|
|
2352
|
-
_this.work = work;
|
|
2353
|
-
_this.pending = false;
|
|
2354
|
-
return _this;
|
|
2355
|
-
}
|
|
2356
|
-
AsyncAction.prototype.schedule = function (state, delay) {
|
|
2357
|
-
if (delay === void 0) { delay = 0; }
|
|
2358
|
-
if (this.closed) {
|
|
2359
|
-
return this;
|
|
2360
|
-
}
|
|
2361
|
-
this.state = state;
|
|
2362
|
-
var id = this.id;
|
|
2363
|
-
var scheduler = this.scheduler;
|
|
2364
|
-
if (id != null) {
|
|
2365
|
-
this.id = this.recycleAsyncId(scheduler, id, delay);
|
|
2366
|
-
}
|
|
2367
|
-
this.pending = true;
|
|
2368
|
-
this.delay = delay;
|
|
2369
|
-
this.id = this.id || this.requestAsyncId(scheduler, this.id, delay);
|
|
2370
|
-
return this;
|
|
2371
|
-
};
|
|
2372
|
-
AsyncAction.prototype.requestAsyncId = function (scheduler, _id, delay) {
|
|
2373
|
-
if (delay === void 0) { delay = 0; }
|
|
2374
|
-
return intervalProvider.setInterval(scheduler.flush.bind(scheduler, this), delay);
|
|
2375
|
-
};
|
|
2376
|
-
AsyncAction.prototype.recycleAsyncId = function (_scheduler, id, delay) {
|
|
2377
|
-
if (delay === void 0) { delay = 0; }
|
|
2378
|
-
if (delay != null && this.delay === delay && this.pending === false) {
|
|
2379
|
-
return id;
|
|
2380
|
-
}
|
|
2381
|
-
intervalProvider.clearInterval(id);
|
|
2382
|
-
return undefined;
|
|
2383
|
-
};
|
|
2384
|
-
AsyncAction.prototype.execute = function (state, delay) {
|
|
2385
|
-
if (this.closed) {
|
|
2386
|
-
return new Error('executing a cancelled action');
|
|
2387
|
-
}
|
|
2388
|
-
this.pending = false;
|
|
2389
|
-
var error = this._execute(state, delay);
|
|
2390
|
-
if (error) {
|
|
2391
|
-
return error;
|
|
2392
|
-
}
|
|
2393
|
-
else if (this.pending === false && this.id != null) {
|
|
2394
|
-
this.id = this.recycleAsyncId(this.scheduler, this.id, null);
|
|
2395
|
-
}
|
|
2396
|
-
};
|
|
2397
|
-
AsyncAction.prototype._execute = function (state, _delay) {
|
|
2398
|
-
var errored = false;
|
|
2399
|
-
var errorValue;
|
|
2400
|
-
try {
|
|
2401
|
-
this.work(state);
|
|
2402
|
-
}
|
|
2403
|
-
catch (e) {
|
|
2404
|
-
errored = true;
|
|
2405
|
-
errorValue = e ? e : new Error('Scheduled action threw falsy error');
|
|
2406
|
-
}
|
|
2407
|
-
if (errored) {
|
|
2408
|
-
this.unsubscribe();
|
|
2409
|
-
return errorValue;
|
|
2410
|
-
}
|
|
2411
|
-
};
|
|
2412
|
-
AsyncAction.prototype.unsubscribe = function () {
|
|
2413
|
-
if (!this.closed) {
|
|
2414
|
-
var _a = this, id = _a.id, scheduler = _a.scheduler;
|
|
2415
|
-
var actions = scheduler.actions;
|
|
2416
|
-
this.work = this.state = this.scheduler = null;
|
|
2417
|
-
this.pending = false;
|
|
2418
|
-
arrRemove(actions, this);
|
|
2419
|
-
if (id != null) {
|
|
2420
|
-
this.id = this.recycleAsyncId(scheduler, id, null);
|
|
2421
|
-
}
|
|
2422
|
-
this.delay = null;
|
|
2423
|
-
_super.prototype.unsubscribe.call(this);
|
|
2424
|
-
}
|
|
2425
|
-
};
|
|
2426
|
-
return AsyncAction;
|
|
2427
|
-
}(Action));
|
|
2428
|
-
|
|
2429
|
-
var dateTimestampProvider = {
|
|
2430
|
-
now: function () {
|
|
2431
|
-
return (dateTimestampProvider.delegate || Date).now();
|
|
2432
|
-
},
|
|
2433
|
-
delegate: undefined,
|
|
2434
|
-
};
|
|
2435
|
-
|
|
2436
|
-
var Scheduler = (function () {
|
|
2437
|
-
function Scheduler(schedulerActionCtor, now) {
|
|
2438
|
-
if (now === void 0) { now = Scheduler.now; }
|
|
2439
|
-
this.schedulerActionCtor = schedulerActionCtor;
|
|
2440
|
-
this.now = now;
|
|
2441
|
-
}
|
|
2442
|
-
Scheduler.prototype.schedule = function (work, delay, state) {
|
|
2443
|
-
if (delay === void 0) { delay = 0; }
|
|
2444
|
-
return new this.schedulerActionCtor(this, work).schedule(state, delay);
|
|
2445
|
-
};
|
|
2446
|
-
Scheduler.now = dateTimestampProvider.now;
|
|
2447
|
-
return Scheduler;
|
|
2448
|
-
}());
|
|
2449
|
-
|
|
2450
|
-
var AsyncScheduler = (function (_super) {
|
|
2451
|
-
__extends(AsyncScheduler, _super);
|
|
2452
|
-
function AsyncScheduler(SchedulerAction, now) {
|
|
2453
|
-
if (now === void 0) { now = Scheduler.now; }
|
|
2454
|
-
var _this = _super.call(this, SchedulerAction, now) || this;
|
|
2455
|
-
_this.actions = [];
|
|
2456
|
-
_this._active = false;
|
|
2457
|
-
_this._scheduled = undefined;
|
|
2458
|
-
return _this;
|
|
2459
|
-
}
|
|
2460
|
-
AsyncScheduler.prototype.flush = function (action) {
|
|
2461
|
-
var actions = this.actions;
|
|
2462
|
-
if (this._active) {
|
|
2463
|
-
actions.push(action);
|
|
2464
|
-
return;
|
|
2465
|
-
}
|
|
2466
|
-
var error;
|
|
2467
|
-
this._active = true;
|
|
2468
|
-
do {
|
|
2469
|
-
if ((error = action.execute(action.state, action.delay))) {
|
|
2470
|
-
break;
|
|
2471
|
-
}
|
|
2472
|
-
} while ((action = actions.shift()));
|
|
2473
|
-
this._active = false;
|
|
2474
|
-
if (error) {
|
|
2475
|
-
while ((action = actions.shift())) {
|
|
2476
|
-
action.unsubscribe();
|
|
2477
|
-
}
|
|
2478
|
-
throw error;
|
|
2479
|
-
}
|
|
2480
|
-
};
|
|
2481
|
-
return AsyncScheduler;
|
|
2482
|
-
}(Scheduler));
|
|
2483
|
-
|
|
2484
|
-
var asyncScheduler = new AsyncScheduler(AsyncAction);
|
|
2485
|
-
var async = asyncScheduler;
|
|
2486
|
-
|
|
2487
|
-
function isScheduler(value) {
|
|
2488
|
-
return value && isFunction(value.schedule);
|
|
2489
|
-
}
|
|
2490
|
-
|
|
2491
|
-
function isValidDate(value) {
|
|
2492
|
-
return value instanceof Date && !isNaN(value);
|
|
2493
|
-
}
|
|
2494
|
-
|
|
2495
|
-
function timer(dueTime, intervalOrScheduler, scheduler) {
|
|
2496
|
-
if (dueTime === void 0) { dueTime = 0; }
|
|
2497
|
-
if (scheduler === void 0) { scheduler = async; }
|
|
2498
|
-
var intervalDuration = -1;
|
|
2499
|
-
if (intervalOrScheduler != null) {
|
|
2500
|
-
if (isScheduler(intervalOrScheduler)) {
|
|
2501
|
-
scheduler = intervalOrScheduler;
|
|
2502
|
-
}
|
|
2503
|
-
else {
|
|
2504
|
-
intervalDuration = intervalOrScheduler;
|
|
2505
|
-
}
|
|
2506
|
-
}
|
|
2507
|
-
return new Observable(function (subscriber) {
|
|
2508
|
-
var due = isValidDate(dueTime) ? +dueTime - scheduler.now() : dueTime;
|
|
2509
|
-
if (due < 0) {
|
|
2510
|
-
due = 0;
|
|
2511
|
-
}
|
|
2512
|
-
var n = 0;
|
|
2513
|
-
return scheduler.schedule(function () {
|
|
2514
|
-
if (!subscriber.closed) {
|
|
2515
|
-
subscriber.next(n++);
|
|
2516
|
-
if (0 <= intervalDuration) {
|
|
2517
|
-
this.schedule(undefined, intervalDuration);
|
|
2518
|
-
}
|
|
2519
|
-
else {
|
|
2520
|
-
subscriber.complete();
|
|
2521
|
-
}
|
|
2522
|
-
}
|
|
2523
|
-
}, due);
|
|
2524
|
-
});
|
|
2525
|
-
}
|
|
2526
|
-
|
|
2527
|
-
function last$1(arr) {
|
|
2528
|
-
return arr[arr.length - 1];
|
|
2529
|
-
}
|
|
2530
|
-
function popScheduler(args) {
|
|
2531
|
-
return isScheduler(last$1(args)) ? args.pop() : undefined;
|
|
2532
|
-
}
|
|
2533
|
-
|
|
2534
|
-
function executeSchedule(parentSubscription, scheduler, work, delay, repeat) {
|
|
2535
|
-
if (delay === void 0) { delay = 0; }
|
|
2536
|
-
if (repeat === void 0) { repeat = false; }
|
|
2537
|
-
var scheduleSubscription = scheduler.schedule(function () {
|
|
2538
|
-
work();
|
|
2539
|
-
if (repeat) {
|
|
2540
|
-
parentSubscription.add(this.schedule(null, delay));
|
|
2541
|
-
}
|
|
2542
|
-
else {
|
|
2543
|
-
this.unsubscribe();
|
|
2544
|
-
}
|
|
2545
|
-
}, delay);
|
|
2546
|
-
parentSubscription.add(scheduleSubscription);
|
|
2547
|
-
if (!repeat) {
|
|
2548
|
-
return scheduleSubscription;
|
|
2549
|
-
}
|
|
2550
|
-
}
|
|
2551
|
-
|
|
2552
|
-
function catchError(selector) {
|
|
2553
|
-
return operate(function (source, subscriber) {
|
|
2554
|
-
var innerSub = null;
|
|
2555
|
-
var syncUnsub = false;
|
|
2556
|
-
var handledResult;
|
|
2557
|
-
innerSub = source.subscribe(createOperatorSubscriber(subscriber, undefined, undefined, function (err) {
|
|
2558
|
-
handledResult = innerFrom(selector(err, catchError(selector)(source)));
|
|
2559
|
-
if (innerSub) {
|
|
2560
|
-
innerSub.unsubscribe();
|
|
2561
|
-
innerSub = null;
|
|
2562
|
-
handledResult.subscribe(subscriber);
|
|
2563
|
-
}
|
|
2564
|
-
else {
|
|
2565
|
-
syncUnsub = true;
|
|
2566
|
-
}
|
|
2567
|
-
}));
|
|
2568
|
-
if (syncUnsub) {
|
|
2569
|
-
innerSub.unsubscribe();
|
|
2570
|
-
innerSub = null;
|
|
2571
|
-
handledResult.subscribe(subscriber);
|
|
2572
|
-
}
|
|
2573
|
-
});
|
|
2574
|
-
}
|
|
2575
|
-
|
|
2576
|
-
function observeOn(scheduler, delay) {
|
|
2577
|
-
if (delay === void 0) { delay = 0; }
|
|
2578
|
-
return operate(function (source, subscriber) {
|
|
2579
|
-
source.subscribe(createOperatorSubscriber(subscriber, function (value) { return executeSchedule(subscriber, scheduler, function () { return subscriber.next(value); }, delay); }, function () { return executeSchedule(subscriber, scheduler, function () { return subscriber.complete(); }, delay); }, function (err) { return executeSchedule(subscriber, scheduler, function () { return subscriber.error(err); }, delay); }));
|
|
2580
|
-
});
|
|
2581
|
-
}
|
|
2582
|
-
|
|
2583
|
-
function subscribeOn(scheduler, delay) {
|
|
2584
|
-
if (delay === void 0) { delay = 0; }
|
|
2585
|
-
return operate(function (source, subscriber) {
|
|
2586
|
-
subscriber.add(scheduler.schedule(function () { return source.subscribe(subscriber); }, delay));
|
|
2587
|
-
});
|
|
2588
|
-
}
|
|
2589
|
-
|
|
2590
|
-
function scheduleObservable(input, scheduler) {
|
|
2591
|
-
return innerFrom(input).pipe(subscribeOn(scheduler), observeOn(scheduler));
|
|
2592
|
-
}
|
|
2593
|
-
|
|
2594
|
-
function schedulePromise(input, scheduler) {
|
|
2595
|
-
return innerFrom(input).pipe(subscribeOn(scheduler), observeOn(scheduler));
|
|
2596
|
-
}
|
|
2597
|
-
|
|
2598
|
-
function scheduleArray(input, scheduler) {
|
|
2599
|
-
return new Observable(function (subscriber) {
|
|
2600
|
-
var i = 0;
|
|
2601
|
-
return scheduler.schedule(function () {
|
|
2602
|
-
if (i === input.length) {
|
|
2603
|
-
subscriber.complete();
|
|
2604
|
-
}
|
|
2605
|
-
else {
|
|
2606
|
-
subscriber.next(input[i++]);
|
|
2607
|
-
if (!subscriber.closed) {
|
|
2608
|
-
this.schedule();
|
|
2609
|
-
}
|
|
1329
|
+
u: readVarUint8Array$1(decoder),
|
|
1330
|
+
i: Number(readBigUint64(decoder)),
|
|
1331
|
+
};
|
|
1332
|
+
case 'u-s':
|
|
1333
|
+
return {
|
|
1334
|
+
type,
|
|
1335
|
+
table,
|
|
1336
|
+
prop,
|
|
1337
|
+
k,
|
|
1338
|
+
u: readVarUint8Array$1(decoder),
|
|
1339
|
+
r: (decoder.pos < decoder.arr.length && readVarString$1(decoder)) || undefined,
|
|
1340
|
+
};
|
|
1341
|
+
default:
|
|
1342
|
+
throw new TypeError(`Unknown message type: ${type}`);
|
|
2610
1343
|
}
|
|
2611
|
-
});
|
|
2612
|
-
});
|
|
2613
|
-
}
|
|
2614
|
-
|
|
2615
|
-
function scheduleIterable(input, scheduler) {
|
|
2616
|
-
return new Observable(function (subscriber) {
|
|
2617
|
-
var iterator$1;
|
|
2618
|
-
executeSchedule(subscriber, scheduler, function () {
|
|
2619
|
-
iterator$1 = input[iterator]();
|
|
2620
|
-
executeSchedule(subscriber, scheduler, function () {
|
|
2621
|
-
var _a;
|
|
2622
|
-
var value;
|
|
2623
|
-
var done;
|
|
2624
|
-
try {
|
|
2625
|
-
(_a = iterator$1.next(), value = _a.value, done = _a.done);
|
|
2626
|
-
}
|
|
2627
|
-
catch (err) {
|
|
2628
|
-
subscriber.error(err);
|
|
2629
|
-
return;
|
|
2630
|
-
}
|
|
2631
|
-
if (done) {
|
|
2632
|
-
subscriber.complete();
|
|
2633
|
-
}
|
|
2634
|
-
else {
|
|
2635
|
-
subscriber.next(value);
|
|
2636
|
-
}
|
|
2637
|
-
}, 0, true);
|
|
2638
|
-
});
|
|
2639
|
-
return function () { return isFunction(iterator$1 === null || iterator$1 === void 0 ? void 0 : iterator$1.return) && iterator$1.return(); };
|
|
2640
|
-
});
|
|
2641
|
-
}
|
|
2642
|
-
|
|
2643
|
-
function scheduleAsyncIterable(input, scheduler) {
|
|
2644
|
-
if (!input) {
|
|
2645
|
-
throw new Error('Iterable cannot be null');
|
|
2646
|
-
}
|
|
2647
|
-
return new Observable(function (subscriber) {
|
|
2648
|
-
executeSchedule(subscriber, scheduler, function () {
|
|
2649
|
-
var iterator = input[Symbol.asyncIterator]();
|
|
2650
|
-
executeSchedule(subscriber, scheduler, function () {
|
|
2651
|
-
iterator.next().then(function (result) {
|
|
2652
|
-
if (result.done) {
|
|
2653
|
-
subscriber.complete();
|
|
2654
|
-
}
|
|
2655
|
-
else {
|
|
2656
|
-
subscriber.next(result.value);
|
|
2657
|
-
}
|
|
2658
|
-
});
|
|
2659
|
-
}, 0, true);
|
|
2660
|
-
});
|
|
2661
|
-
});
|
|
2662
|
-
}
|
|
2663
|
-
|
|
2664
|
-
function scheduleReadableStreamLike(input, scheduler) {
|
|
2665
|
-
return scheduleAsyncIterable(readableStreamLikeToAsyncGenerator(input), scheduler);
|
|
2666
|
-
}
|
|
2667
|
-
|
|
2668
|
-
function scheduled(input, scheduler) {
|
|
2669
|
-
if (input != null) {
|
|
2670
|
-
if (isInteropObservable(input)) {
|
|
2671
|
-
return scheduleObservable(input, scheduler);
|
|
2672
|
-
}
|
|
2673
|
-
if (isArrayLike(input)) {
|
|
2674
|
-
return scheduleArray(input, scheduler);
|
|
2675
|
-
}
|
|
2676
|
-
if (isPromise(input)) {
|
|
2677
|
-
return schedulePromise(input, scheduler);
|
|
2678
|
-
}
|
|
2679
|
-
if (isAsyncIterable(input)) {
|
|
2680
|
-
return scheduleAsyncIterable(input, scheduler);
|
|
2681
|
-
}
|
|
2682
|
-
if (isIterable(input)) {
|
|
2683
|
-
return scheduleIterable(input, scheduler);
|
|
2684
|
-
}
|
|
2685
|
-
if (isReadableStreamLike(input)) {
|
|
2686
|
-
return scheduleReadableStreamLike(input, scheduler);
|
|
2687
1344
|
}
|
|
2688
1345
|
}
|
|
2689
|
-
throw createInvalidObservableTypeError(input);
|
|
2690
|
-
}
|
|
2691
|
-
|
|
2692
|
-
function from$1(input, scheduler) {
|
|
2693
|
-
return scheduler ? scheduled(input, scheduler) : innerFrom(input);
|
|
2694
|
-
}
|
|
2695
|
-
|
|
2696
|
-
function map$1(project, thisArg) {
|
|
2697
|
-
return operate(function (source, subscriber) {
|
|
2698
|
-
var index = 0;
|
|
2699
|
-
source.subscribe(createOperatorSubscriber(subscriber, function (value) {
|
|
2700
|
-
subscriber.next(project.call(thisArg, value, index++));
|
|
2701
|
-
}));
|
|
2702
|
-
});
|
|
2703
|
-
}
|
|
2704
|
-
|
|
2705
|
-
function mergeInternals(source, subscriber, project, concurrent, onBeforeNext, expand, innerSubScheduler, additionalFinalizer) {
|
|
2706
|
-
var buffer = [];
|
|
2707
|
-
var active = 0;
|
|
2708
|
-
var index = 0;
|
|
2709
|
-
var isComplete = false;
|
|
2710
|
-
var checkComplete = function () {
|
|
2711
|
-
if (isComplete && !buffer.length && !active) {
|
|
2712
|
-
subscriber.complete();
|
|
2713
|
-
}
|
|
2714
|
-
};
|
|
2715
|
-
var outerNext = function (value) { return (active < concurrent ? doInnerSub(value) : buffer.push(value)); };
|
|
2716
|
-
var doInnerSub = function (value) {
|
|
2717
|
-
expand && subscriber.next(value);
|
|
2718
|
-
active++;
|
|
2719
|
-
var innerComplete = false;
|
|
2720
|
-
innerFrom(project(value, index++)).subscribe(createOperatorSubscriber(subscriber, function (innerValue) {
|
|
2721
|
-
onBeforeNext === null || onBeforeNext === void 0 ? void 0 : onBeforeNext(innerValue);
|
|
2722
|
-
if (expand) {
|
|
2723
|
-
outerNext(innerValue);
|
|
2724
|
-
}
|
|
2725
|
-
else {
|
|
2726
|
-
subscriber.next(innerValue);
|
|
2727
|
-
}
|
|
2728
|
-
}, function () {
|
|
2729
|
-
innerComplete = true;
|
|
2730
|
-
}, undefined, function () {
|
|
2731
|
-
if (innerComplete) {
|
|
2732
|
-
try {
|
|
2733
|
-
active--;
|
|
2734
|
-
var _loop_1 = function () {
|
|
2735
|
-
var bufferedValue = buffer.shift();
|
|
2736
|
-
if (innerSubScheduler) {
|
|
2737
|
-
executeSchedule(subscriber, innerSubScheduler, function () { return doInnerSub(bufferedValue); });
|
|
2738
|
-
}
|
|
2739
|
-
else {
|
|
2740
|
-
doInnerSub(bufferedValue);
|
|
2741
|
-
}
|
|
2742
|
-
};
|
|
2743
|
-
while (buffer.length && active < concurrent) {
|
|
2744
|
-
_loop_1();
|
|
2745
|
-
}
|
|
2746
|
-
checkComplete();
|
|
2747
|
-
}
|
|
2748
|
-
catch (err) {
|
|
2749
|
-
subscriber.error(err);
|
|
2750
|
-
}
|
|
2751
|
-
}
|
|
2752
|
-
}));
|
|
2753
|
-
};
|
|
2754
|
-
source.subscribe(createOperatorSubscriber(subscriber, outerNext, function () {
|
|
2755
|
-
isComplete = true;
|
|
2756
|
-
checkComplete();
|
|
2757
|
-
}));
|
|
2758
|
-
return function () {
|
|
2759
|
-
additionalFinalizer === null || additionalFinalizer === void 0 ? void 0 : additionalFinalizer();
|
|
2760
|
-
};
|
|
2761
1346
|
}
|
|
2762
1347
|
|
|
2763
|
-
function
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
1348
|
+
async function asyncIterablePipeline(source, ...stages) {
|
|
1349
|
+
var _a, e_1, _b, _c;
|
|
1350
|
+
// Chain generators by sending outdata from one to another
|
|
1351
|
+
let result = source(); // Start with the source generator
|
|
1352
|
+
for (let i = 0; i < stages.length; i++) {
|
|
1353
|
+
result = stages[i](result); // Pass on the result to next generator
|
|
2767
1354
|
}
|
|
2768
|
-
|
|
2769
|
-
|
|
1355
|
+
try {
|
|
1356
|
+
// Start running the machine. If the last stage is a sink, it will consume the data and never emit anything
|
|
1357
|
+
// to us here...
|
|
1358
|
+
for (var _d = true, result_1 = __asyncValues(result), result_1_1; result_1_1 = await result_1.next(), _a = result_1_1.done, !_a; _d = true) {
|
|
1359
|
+
_c = result_1_1.value;
|
|
1360
|
+
_d = false;
|
|
1361
|
+
const chunk = _c;
|
|
1362
|
+
}
|
|
2770
1363
|
}
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
if (concurrent === void 0) { concurrent = Infinity; }
|
|
2776
|
-
return mergeMap(identity, concurrent);
|
|
2777
|
-
}
|
|
2778
|
-
|
|
2779
|
-
function concatAll() {
|
|
2780
|
-
return mergeAll(1);
|
|
2781
|
-
}
|
|
2782
|
-
|
|
2783
|
-
function debounceTime(dueTime, scheduler) {
|
|
2784
|
-
if (scheduler === void 0) { scheduler = asyncScheduler; }
|
|
2785
|
-
return operate(function (source, subscriber) {
|
|
2786
|
-
var activeTask = null;
|
|
2787
|
-
var lastValue = null;
|
|
2788
|
-
var lastTime = null;
|
|
2789
|
-
var emit = function () {
|
|
2790
|
-
if (activeTask) {
|
|
2791
|
-
activeTask.unsubscribe();
|
|
2792
|
-
activeTask = null;
|
|
2793
|
-
var value = lastValue;
|
|
2794
|
-
lastValue = null;
|
|
2795
|
-
subscriber.next(value);
|
|
2796
|
-
}
|
|
2797
|
-
};
|
|
2798
|
-
function emitWhenIdle() {
|
|
2799
|
-
var targetTime = lastTime + dueTime;
|
|
2800
|
-
var now = scheduler.now();
|
|
2801
|
-
if (now < targetTime) {
|
|
2802
|
-
activeTask = this.schedule(undefined, targetTime - now);
|
|
2803
|
-
subscriber.add(activeTask);
|
|
2804
|
-
return;
|
|
2805
|
-
}
|
|
2806
|
-
emit();
|
|
1364
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
1365
|
+
finally {
|
|
1366
|
+
try {
|
|
1367
|
+
if (!_d && !_a && (_b = result_1.return)) await _b.call(result_1);
|
|
2807
1368
|
}
|
|
2808
|
-
|
|
2809
|
-
lastValue = value;
|
|
2810
|
-
lastTime = scheduler.now();
|
|
2811
|
-
if (!activeTask) {
|
|
2812
|
-
activeTask = scheduler.schedule(emitWhenIdle, dueTime);
|
|
2813
|
-
subscriber.add(activeTask);
|
|
2814
|
-
}
|
|
2815
|
-
}, function () {
|
|
2816
|
-
emit();
|
|
2817
|
-
subscriber.complete();
|
|
2818
|
-
}, undefined, function () {
|
|
2819
|
-
lastValue = activeTask = null;
|
|
2820
|
-
}));
|
|
2821
|
-
});
|
|
2822
|
-
}
|
|
2823
|
-
|
|
2824
|
-
function concat$1() {
|
|
2825
|
-
var args = [];
|
|
2826
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
2827
|
-
args[_i] = arguments[_i];
|
|
1369
|
+
finally { if (e_1) throw e_1.error; }
|
|
2828
1370
|
}
|
|
2829
|
-
return concatAll()(from$1(args, popScheduler(args)));
|
|
2830
1371
|
}
|
|
2831
1372
|
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
1373
|
+
function consumeChunkedBinaryStream(source) {
|
|
1374
|
+
return __asyncGenerator(this, arguments, function* consumeChunkedBinaryStream_1() {
|
|
1375
|
+
var _a, e_1, _b, _c;
|
|
1376
|
+
let state = 0;
|
|
1377
|
+
let sizeBuf = new Uint8Array(4);
|
|
1378
|
+
let sizeBufPos = 0;
|
|
1379
|
+
let bufs = [];
|
|
1380
|
+
let len = 0;
|
|
1381
|
+
try {
|
|
1382
|
+
for (var _d = true, source_1 = __asyncValues(source), source_1_1; source_1_1 = yield __await(source_1.next()), _a = source_1_1.done, !_a; _d = true) {
|
|
1383
|
+
_c = source_1_1.value;
|
|
1384
|
+
_d = false;
|
|
1385
|
+
const chunk = _c;
|
|
1386
|
+
const dw = new DataView(chunk.buffer, chunk.byteOffset, chunk.byteLength);
|
|
1387
|
+
let pos = 0;
|
|
1388
|
+
while (pos < chunk.byteLength) {
|
|
1389
|
+
switch (state) {
|
|
1390
|
+
case 0:
|
|
1391
|
+
// Beginning of a size header
|
|
1392
|
+
if (pos + 4 > chunk.byteLength) {
|
|
1393
|
+
for (const b of chunk.slice(pos)) {
|
|
1394
|
+
if (sizeBufPos === 4)
|
|
1395
|
+
break;
|
|
1396
|
+
sizeBuf[sizeBufPos++] = b;
|
|
1397
|
+
++pos;
|
|
1398
|
+
}
|
|
1399
|
+
if (sizeBufPos < 4) {
|
|
1400
|
+
// Need more bytes in order to read length.
|
|
1401
|
+
// Will go out from while loop as well because pos is defenitely = chunk.byteLength here.
|
|
1402
|
+
break;
|
|
1403
|
+
}
|
|
1404
|
+
}
|
|
1405
|
+
else if (sizeBufPos > 0 && sizeBufPos < 4) {
|
|
1406
|
+
for (const b of chunk.slice(pos, pos + 4 - sizeBufPos)) {
|
|
1407
|
+
sizeBuf[sizeBufPos++] = b;
|
|
1408
|
+
++pos;
|
|
1409
|
+
}
|
|
1410
|
+
}
|
|
1411
|
+
// Intentional fall-through...
|
|
1412
|
+
case 1:
|
|
1413
|
+
len =
|
|
1414
|
+
sizeBufPos === 4
|
|
1415
|
+
? new DataView(sizeBuf.buffer, 0, 4).getUint32(0, false)
|
|
1416
|
+
: dw.getUint32(pos, false);
|
|
1417
|
+
if (sizeBufPos)
|
|
1418
|
+
sizeBufPos = 0; // in this case pos is already forwarded
|
|
1419
|
+
else
|
|
1420
|
+
pos += 4; // else pos is not yet forwarded - that's why we do it now
|
|
1421
|
+
// Intentional fall-through...
|
|
1422
|
+
case 2:
|
|
1423
|
+
// Eat the chunk
|
|
1424
|
+
if (pos >= chunk.byteLength) {
|
|
1425
|
+
state = 2;
|
|
1426
|
+
break;
|
|
1427
|
+
}
|
|
1428
|
+
if (pos + len > chunk.byteLength) {
|
|
1429
|
+
bufs.push(chunk.slice(pos));
|
|
1430
|
+
len -= (chunk.byteLength - pos);
|
|
1431
|
+
state = 2;
|
|
1432
|
+
pos = chunk.byteLength; // will break while loop.
|
|
1433
|
+
}
|
|
1434
|
+
else {
|
|
1435
|
+
if (bufs.length > 0) {
|
|
1436
|
+
const concats = new Uint8Array(bufs.reduce((p, c) => p + c.byteLength, len));
|
|
1437
|
+
let p = 0;
|
|
1438
|
+
for (const buf of bufs) {
|
|
1439
|
+
concats.set(buf, p);
|
|
1440
|
+
p += buf.byteLength;
|
|
1441
|
+
}
|
|
1442
|
+
concats.set(chunk.slice(pos, pos + len), p);
|
|
1443
|
+
bufs = [];
|
|
1444
|
+
yield yield __await(concats);
|
|
1445
|
+
}
|
|
1446
|
+
else {
|
|
1447
|
+
yield yield __await(chunk.slice(pos, pos + len));
|
|
1448
|
+
}
|
|
1449
|
+
pos += len;
|
|
1450
|
+
state = 0;
|
|
1451
|
+
}
|
|
1452
|
+
break;
|
|
2845
1453
|
}
|
|
2846
1454
|
}
|
|
2847
|
-
}));
|
|
2848
|
-
});
|
|
2849
|
-
}
|
|
2850
|
-
|
|
2851
|
-
function ignoreElements() {
|
|
2852
|
-
return operate(function (source, subscriber) {
|
|
2853
|
-
source.subscribe(createOperatorSubscriber(subscriber, noop));
|
|
2854
|
-
});
|
|
2855
|
-
}
|
|
2856
|
-
|
|
2857
|
-
function mapTo(value) {
|
|
2858
|
-
return map$1(function () { return value; });
|
|
2859
|
-
}
|
|
2860
|
-
|
|
2861
|
-
function delayWhen(delayDurationSelector, subscriptionDelay) {
|
|
2862
|
-
if (subscriptionDelay) {
|
|
2863
|
-
return function (source) {
|
|
2864
|
-
return concat$1(subscriptionDelay.pipe(take(1), ignoreElements()), source.pipe(delayWhen(delayDurationSelector)));
|
|
2865
|
-
};
|
|
2866
|
-
}
|
|
2867
|
-
return mergeMap(function (value, index) { return delayDurationSelector(value, index).pipe(take(1), mapTo(value)); });
|
|
2868
|
-
}
|
|
2869
|
-
|
|
2870
|
-
function delay(due, scheduler) {
|
|
2871
|
-
if (scheduler === void 0) { scheduler = asyncScheduler; }
|
|
2872
|
-
var duration = timer(due, scheduler);
|
|
2873
|
-
return delayWhen(function () { return duration; });
|
|
2874
|
-
}
|
|
2875
|
-
|
|
2876
|
-
function distinctUntilChanged(comparator, keySelector) {
|
|
2877
|
-
if (keySelector === void 0) { keySelector = identity; }
|
|
2878
|
-
comparator = comparator !== null && comparator !== void 0 ? comparator : defaultCompare;
|
|
2879
|
-
return operate(function (source, subscriber) {
|
|
2880
|
-
var previousKey;
|
|
2881
|
-
var first = true;
|
|
2882
|
-
source.subscribe(createOperatorSubscriber(subscriber, function (value) {
|
|
2883
|
-
var currentKey = keySelector(value);
|
|
2884
|
-
if (first || !comparator(previousKey, currentKey)) {
|
|
2885
|
-
first = false;
|
|
2886
|
-
previousKey = currentKey;
|
|
2887
|
-
subscriber.next(value);
|
|
2888
1455
|
}
|
|
2889
|
-
}
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
return operate(function (source, subscriber) {
|
|
2898
|
-
var index = 0;
|
|
2899
|
-
source.subscribe(createOperatorSubscriber(subscriber, function (value) { return predicate.call(thisArg, value, index++) && subscriber.next(value); }));
|
|
2900
|
-
});
|
|
2901
|
-
}
|
|
2902
|
-
|
|
2903
|
-
function skip(count) {
|
|
2904
|
-
return filter(function (_, index) { return count <= index; });
|
|
2905
|
-
}
|
|
2906
|
-
|
|
2907
|
-
function startWith() {
|
|
2908
|
-
var values = [];
|
|
2909
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
2910
|
-
values[_i] = arguments[_i];
|
|
2911
|
-
}
|
|
2912
|
-
var scheduler = popScheduler(values);
|
|
2913
|
-
return operate(function (source, subscriber) {
|
|
2914
|
-
(scheduler ? concat$1(values, source, scheduler) : concat$1(values, source)).subscribe(subscriber);
|
|
2915
|
-
});
|
|
2916
|
-
}
|
|
2917
|
-
|
|
2918
|
-
function switchMap(project, resultSelector) {
|
|
2919
|
-
return operate(function (source, subscriber) {
|
|
2920
|
-
var innerSubscriber = null;
|
|
2921
|
-
var index = 0;
|
|
2922
|
-
var isComplete = false;
|
|
2923
|
-
var checkComplete = function () { return isComplete && !innerSubscriber && subscriber.complete(); };
|
|
2924
|
-
source.subscribe(createOperatorSubscriber(subscriber, function (value) {
|
|
2925
|
-
innerSubscriber === null || innerSubscriber === void 0 ? void 0 : innerSubscriber.unsubscribe();
|
|
2926
|
-
var innerIndex = 0;
|
|
2927
|
-
var outerIndex = index++;
|
|
2928
|
-
innerFrom(project(value, outerIndex)).subscribe((innerSubscriber = createOperatorSubscriber(subscriber, function (innerValue) { return subscriber.next(resultSelector ? resultSelector(value, innerValue, outerIndex, innerIndex++) : innerValue); }, function () {
|
|
2929
|
-
innerSubscriber = null;
|
|
2930
|
-
checkComplete();
|
|
2931
|
-
})));
|
|
2932
|
-
}, function () {
|
|
2933
|
-
isComplete = true;
|
|
2934
|
-
checkComplete();
|
|
2935
|
-
}));
|
|
1456
|
+
}
|
|
1457
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
1458
|
+
finally {
|
|
1459
|
+
try {
|
|
1460
|
+
if (!_d && !_a && (_b = source_1.return)) yield __await(_b.call(source_1));
|
|
1461
|
+
}
|
|
1462
|
+
finally { if (e_1) throw e_1.error; }
|
|
1463
|
+
}
|
|
2936
1464
|
});
|
|
2937
1465
|
}
|
|
2938
1466
|
|
|
2939
|
-
function
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
(_a = tapObserver.next) === null || _a === void 0 ? void 0 : _a.call(tapObserver, value);
|
|
2952
|
-
subscriber.next(value);
|
|
2953
|
-
}, function () {
|
|
2954
|
-
var _a;
|
|
2955
|
-
isUnsub = false;
|
|
2956
|
-
(_a = tapObserver.complete) === null || _a === void 0 ? void 0 : _a.call(tapObserver);
|
|
2957
|
-
subscriber.complete();
|
|
2958
|
-
}, function (err) {
|
|
2959
|
-
var _a;
|
|
2960
|
-
isUnsub = false;
|
|
2961
|
-
(_a = tapObserver.error) === null || _a === void 0 ? void 0 : _a.call(tapObserver, err);
|
|
2962
|
-
subscriber.error(err);
|
|
2963
|
-
}, function () {
|
|
2964
|
-
var _a, _b;
|
|
2965
|
-
if (isUnsub) {
|
|
2966
|
-
(_a = tapObserver.unsubscribe) === null || _a === void 0 ? void 0 : _a.call(tapObserver);
|
|
1467
|
+
function getFetchResponseBodyGenerator(res) {
|
|
1468
|
+
return function () {
|
|
1469
|
+
return __asyncGenerator(this, arguments, function* () {
|
|
1470
|
+
if (!res.body)
|
|
1471
|
+
throw new Error("Response body is not readable");
|
|
1472
|
+
const reader = res.body.getReader();
|
|
1473
|
+
try {
|
|
1474
|
+
while (true) {
|
|
1475
|
+
const { done, value } = yield __await(reader.read());
|
|
1476
|
+
if (done)
|
|
1477
|
+
return yield __await(void 0);
|
|
1478
|
+
yield yield __await(value);
|
|
2967
1479
|
}
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
1480
|
+
}
|
|
1481
|
+
finally {
|
|
1482
|
+
reader.releaseLock();
|
|
1483
|
+
}
|
|
1484
|
+
});
|
|
1485
|
+
};
|
|
2973
1486
|
}
|
|
2974
1487
|
|
|
2975
1488
|
//const hasSW = 'serviceWorker' in navigator;
|
|
@@ -15497,7 +14010,7 @@
|
|
|
15497
14010
|
*
|
|
15498
14011
|
* ==========================================================================
|
|
15499
14012
|
*
|
|
15500
|
-
* Version 4.2.0-alpha.
|
|
14013
|
+
* Version 4.2.0-alpha.3, Fri Aug 01 2025
|
|
15501
14014
|
*
|
|
15502
14015
|
* https://dexie.org
|
|
15503
14016
|
*
|
|
@@ -15883,8 +14396,18 @@
|
|
|
15883
14396
|
beforeunload: [promisableChain],
|
|
15884
14397
|
});
|
|
15885
14398
|
DexieYProvider.getDocCache = getDocCache;
|
|
15886
|
-
//
|
|
15887
|
-
|
|
14399
|
+
//
|
|
14400
|
+
// Eliminate dual package hazard
|
|
14401
|
+
//
|
|
14402
|
+
// Since we're holding static state, make sure to singletonize DexieYProvider
|
|
14403
|
+
//
|
|
14404
|
+
if (Dexie.Dexie["DexieYProvider"]) {
|
|
14405
|
+
// @ts-ignore
|
|
14406
|
+
DexieYProvider = Dexie.Dexie["DexieYProvider"] || DexieYProvider;
|
|
14407
|
+
}
|
|
14408
|
+
else {
|
|
14409
|
+
Dexie.Dexie["DexieYProvider"] = DexieYProvider;
|
|
14410
|
+
}
|
|
15888
14411
|
|
|
15889
14412
|
function applyYServerMessages(yMessages, db) {
|
|
15890
14413
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -16537,7 +15060,7 @@
|
|
|
16537
15060
|
// If the sync worker or service worker is syncing, wait 'til thei're done.
|
|
16538
15061
|
// It's no need to have two channels at the same time - even though it wouldnt
|
|
16539
15062
|
// be a problem - this is an optimization.
|
|
16540
|
-
yield rxjs.firstValueFrom(db.cloud.syncState.pipe(filter(({ phase }) => phase === 'in-sync' || phase === 'error')));
|
|
15063
|
+
yield rxjs.firstValueFrom(db.cloud.syncState.pipe(operators.filter(({ phase }) => phase === 'in-sync' || phase === 'error')));
|
|
16541
15064
|
console.debug('processing msg', msg);
|
|
16542
15065
|
const persistedSyncState = db.cloud.persistedSyncState.value;
|
|
16543
15066
|
//syncState.
|
|
@@ -17560,13 +16083,13 @@
|
|
|
17560
16083
|
// for just a short time.
|
|
17561
16084
|
const userIsReallyActive = new rxjs.BehaviorSubject(true);
|
|
17562
16085
|
userIsActive
|
|
17563
|
-
.pipe(switchMap((isActive) => {
|
|
16086
|
+
.pipe(operators.switchMap((isActive) => {
|
|
17564
16087
|
//console.debug('SyncStatus: DUBB: isActive changed to', isActive);
|
|
17565
16088
|
return isActive
|
|
17566
16089
|
? rxjs.of(true)
|
|
17567
|
-
: rxjs.of(false).pipe(delay(INACTIVE_WAIT_TIME))
|
|
16090
|
+
: rxjs.of(false).pipe(operators.delay(INACTIVE_WAIT_TIME))
|
|
17568
16091
|
;
|
|
17569
|
-
}), distinctUntilChanged())
|
|
16092
|
+
}), operators.distinctUntilChanged())
|
|
17570
16093
|
.subscribe(userIsReallyActive);
|
|
17571
16094
|
//
|
|
17572
16095
|
// First create some corner-stone observables to build the flow on
|
|
@@ -17576,9 +16099,9 @@
|
|
|
17576
16099
|
? rxjs.fromEvent(document, 'visibilitychange')
|
|
17577
16100
|
: rxjs.of({});
|
|
17578
16101
|
// document.onvisibilitychange makes document hidden:
|
|
17579
|
-
const documentBecomesHidden = visibilityStateIsChanged.pipe(filter(() => document.visibilityState === 'hidden'));
|
|
16102
|
+
const documentBecomesHidden = visibilityStateIsChanged.pipe(operators.filter(() => document.visibilityState === 'hidden'));
|
|
17580
16103
|
// document.onvisibilitychange makes document visible
|
|
17581
|
-
const documentBecomesVisible = visibilityStateIsChanged.pipe(filter(() => document.visibilityState === 'visible'));
|
|
16104
|
+
const documentBecomesVisible = visibilityStateIsChanged.pipe(operators.filter(() => document.visibilityState === 'visible'));
|
|
17582
16105
|
// Any of various user-activity-related events happen:
|
|
17583
16106
|
const userDoesSomething = typeof window !== 'undefined'
|
|
17584
16107
|
? rxjs.merge(documentBecomesVisible, rxjs.fromEvent(window, 'mousedown'), rxjs.fromEvent(window, 'mousemove'), rxjs.fromEvent(window, 'keydown'), rxjs.fromEvent(window, 'wheel'), rxjs.fromEvent(window, 'touchmove'))
|
|
@@ -17596,9 +16119,9 @@
|
|
|
17596
16119
|
userDoesSomething)
|
|
17597
16120
|
.pipe(
|
|
17598
16121
|
// No matter event source, compute whether user is visible using visibilityState:
|
|
17599
|
-
map
|
|
16122
|
+
operators.map(() => document.visibilityState === 'visible'),
|
|
17600
16123
|
// Make sure to emit it
|
|
17601
|
-
tap((isActive) => {
|
|
16124
|
+
operators.tap((isActive) => {
|
|
17602
16125
|
if (userIsActive.value !== isActive) {
|
|
17603
16126
|
// Emit new value unless it already has that value
|
|
17604
16127
|
userIsActive.next(isActive);
|
|
@@ -17606,8 +16129,8 @@
|
|
|
17606
16129
|
}),
|
|
17607
16130
|
// Now, if true was emitted, make sure to set a timeout to emit false
|
|
17608
16131
|
// unless new user activity things happen (in that case, the timeout will be cancelled!)
|
|
17609
|
-
switchMap((isActive) => isActive
|
|
17610
|
-
? rxjs.of(0).pipe(delay(USER_INACTIVITY_TIMEOUT - INACTIVE_WAIT_TIME), tap(() => userIsActive.next(false)))
|
|
16132
|
+
operators.switchMap((isActive) => isActive
|
|
16133
|
+
? rxjs.of(0).pipe(operators.delay(USER_INACTIVITY_TIMEOUT - INACTIVE_WAIT_TIME), operators.tap(() => userIsActive.next(false)))
|
|
17611
16134
|
: rxjs.of(0)))
|
|
17612
16135
|
.subscribe(() => { }); // Unless we subscribe nothing will be propagated to userIsActive observable
|
|
17613
16136
|
}
|
|
@@ -18000,10 +16523,10 @@
|
|
|
18000
16523
|
if (!((_a = db.cloud.options) === null || _a === void 0 ? void 0 : _a.databaseUrl)) {
|
|
18001
16524
|
throw new Error(`No database URL to connect WebSocket to`);
|
|
18002
16525
|
}
|
|
18003
|
-
const readyForChangesMessage = db.messageConsumer.readyToServe.pipe(filter((isReady) => isReady), // When consumer is ready for new messages, produce such a message to inform server about it
|
|
18004
|
-
switchMap(() => db.getPersistedSyncState()), // We need the info on which server revision we are at:
|
|
18005
|
-
filter((syncState) => syncState && syncState.serverRevision), // We wont send anything to server before inital sync has taken place
|
|
18006
|
-
switchMap((syncState) => __awaiter(this, void 0, void 0, function* () {
|
|
16526
|
+
const readyForChangesMessage = db.messageConsumer.readyToServe.pipe(operators.filter((isReady) => isReady), // When consumer is ready for new messages, produce such a message to inform server about it
|
|
16527
|
+
operators.switchMap(() => db.getPersistedSyncState()), // We need the info on which server revision we are at:
|
|
16528
|
+
operators.filter((syncState) => syncState && syncState.serverRevision), // We wont send anything to server before inital sync has taken place
|
|
16529
|
+
operators.switchMap((syncState) => __awaiter(this, void 0, void 0, function* () {
|
|
18007
16530
|
return ({
|
|
18008
16531
|
// Produce the message to trigger server to send us new messages to consume:
|
|
18009
16532
|
type: 'ready',
|
|
@@ -18013,22 +16536,22 @@
|
|
|
18013
16536
|
})));
|
|
18014
16537
|
const messageProducer = rxjs.merge(readyForChangesMessage, db.messageProducer);
|
|
18015
16538
|
function createObservable() {
|
|
18016
|
-
return db.cloud.persistedSyncState.pipe(filter((syncState) => syncState === null || syncState === void 0 ? void 0 : syncState.serverRevision), // Don't connect before there's no initial sync performed.
|
|
18017
|
-
take(1), // Don't continue waking up whenever syncState change
|
|
18018
|
-
switchMap((syncState) => db.cloud.currentUser.pipe(map
|
|
16539
|
+
return db.cloud.persistedSyncState.pipe(operators.filter((syncState) => syncState === null || syncState === void 0 ? void 0 : syncState.serverRevision), // Don't connect before there's no initial sync performed.
|
|
16540
|
+
operators.take(1), // Don't continue waking up whenever syncState change
|
|
16541
|
+
operators.switchMap((syncState) => db.cloud.currentUser.pipe(operators.map((userLogin) => [userLogin, syncState]))), operators.switchMap(([userLogin, syncState]) => {
|
|
18019
16542
|
/*if (userLogin.license?.status && userLogin.license.status !== 'ok') {
|
|
18020
16543
|
throw new InvalidLicenseError();
|
|
18021
16544
|
}*/
|
|
18022
|
-
return userIsReallyActive.pipe(map
|
|
18023
|
-
}), switchMap(([userLogin, syncState]) => {
|
|
16545
|
+
return userIsReallyActive.pipe(operators.map((isActive) => [isActive ? userLogin : null, syncState]));
|
|
16546
|
+
}), operators.switchMap(([userLogin, syncState]) => {
|
|
18024
16547
|
if ((userLogin === null || userLogin === void 0 ? void 0 : userLogin.isLoggedIn) && !(syncState === null || syncState === void 0 ? void 0 : syncState.realms.includes(userLogin.userId))) {
|
|
18025
16548
|
// We're in an in-between state when user is logged in but the user's realms are not yet synced.
|
|
18026
16549
|
// Don't make this change reconnect the websocket just yet. Wait till syncState is updated
|
|
18027
16550
|
// to iclude the user's realm.
|
|
18028
|
-
return db.cloud.persistedSyncState.pipe(filter((syncState) => (syncState === null || syncState === void 0 ? void 0 : syncState.realms.includes(userLogin.userId)) || false), take(1), map
|
|
16551
|
+
return db.cloud.persistedSyncState.pipe(operators.filter((syncState) => (syncState === null || syncState === void 0 ? void 0 : syncState.realms.includes(userLogin.userId)) || false), operators.take(1), operators.map((syncState) => [userLogin, syncState]));
|
|
18029
16552
|
}
|
|
18030
16553
|
return new rxjs.BehaviorSubject([userLogin, syncState]);
|
|
18031
|
-
}), switchMap((_a) => __awaiter(this, [_a], void 0, function* ([userLogin, syncState]) { return [userLogin, yield computeRealmSetHash(syncState)]; })), distinctUntilChanged(([prevUser, prevHash], [currUser, currHash]) => prevUser === currUser && prevHash === currHash), switchMap(([userLogin, realmSetHash]) => {
|
|
16554
|
+
}), operators.switchMap((_a) => __awaiter(this, [_a], void 0, function* ([userLogin, syncState]) { return [userLogin, yield computeRealmSetHash(syncState)]; })), operators.distinctUntilChanged(([prevUser, prevHash], [currUser, currHash]) => prevUser === currUser && prevHash === currHash), operators.switchMap(([userLogin, realmSetHash]) => {
|
|
18032
16555
|
var _a;
|
|
18033
16556
|
if (!((_a = db.cloud.persistedSyncState) === null || _a === void 0 ? void 0 : _a.value)) {
|
|
18034
16557
|
// Restart the flow if persistedSyncState is not yet available.
|
|
@@ -18043,10 +16566,10 @@
|
|
|
18043
16566
|
else {
|
|
18044
16567
|
return rxjs.from([]);
|
|
18045
16568
|
}
|
|
18046
|
-
}), catchError((error) => {
|
|
16569
|
+
}), operators.catchError((error) => {
|
|
18047
16570
|
if ((error === null || error === void 0 ? void 0 : error.name) === 'TokenExpiredError') {
|
|
18048
16571
|
console.debug('WebSocket observable: Token expired. Refreshing token...');
|
|
18049
|
-
return rxjs.of(true).pipe(switchMap(() => __awaiter(this, void 0, void 0, function* () {
|
|
16572
|
+
return rxjs.of(true).pipe(operators.switchMap(() => __awaiter(this, void 0, void 0, function* () {
|
|
18050
16573
|
// Refresh access token
|
|
18051
16574
|
const user = yield db.getCurrentUser();
|
|
18052
16575
|
const refreshedLogin = yield refreshAccessToken(db.cloud.options.databaseUrl, user);
|
|
@@ -18058,18 +16581,18 @@
|
|
|
18058
16581
|
license: refreshedLogin.license,
|
|
18059
16582
|
data: refreshedLogin.data
|
|
18060
16583
|
});
|
|
18061
|
-
})), switchMap(() => createObservable()));
|
|
16584
|
+
})), operators.switchMap(() => createObservable()));
|
|
18062
16585
|
}
|
|
18063
16586
|
else {
|
|
18064
16587
|
return rxjs.throwError(() => error);
|
|
18065
16588
|
}
|
|
18066
|
-
}), catchError((error) => {
|
|
16589
|
+
}), operators.catchError((error) => {
|
|
18067
16590
|
db.cloud.webSocketStatus.next("error");
|
|
18068
16591
|
if (error instanceof InvalidLicenseError) {
|
|
18069
16592
|
// Don't retry. Just throw and don't try connect again.
|
|
18070
16593
|
return rxjs.throwError(() => error);
|
|
18071
16594
|
}
|
|
18072
|
-
return rxjs.from(waitAndReconnectWhenUserDoesSomething(error)).pipe(switchMap(() => createObservable()));
|
|
16595
|
+
return rxjs.from(waitAndReconnectWhenUserDoesSomething(error)).pipe(operators.switchMap(() => createObservable()));
|
|
18073
16596
|
}));
|
|
18074
16597
|
}
|
|
18075
16598
|
return createObservable().subscribe({
|
|
@@ -18499,7 +17022,7 @@
|
|
|
18499
17022
|
|
|
18500
17023
|
function computeSyncState(db) {
|
|
18501
17024
|
let _prevStatus = db.cloud.webSocketStatus.value;
|
|
18502
|
-
const lazyWebSocketStatus = db.cloud.webSocketStatus.pipe(switchMap((status) => {
|
|
17025
|
+
const lazyWebSocketStatus = db.cloud.webSocketStatus.pipe(operators.switchMap((status) => {
|
|
18503
17026
|
const prevStatus = _prevStatus;
|
|
18504
17027
|
_prevStatus = status;
|
|
18505
17028
|
const rv = rxjs.of(status);
|
|
@@ -18509,23 +17032,23 @@
|
|
|
18509
17032
|
// Only show disconnected if disconnected more than 500ms, or if we can
|
|
18510
17033
|
// see that the user is indeed not active.
|
|
18511
17034
|
case 'disconnected':
|
|
18512
|
-
return userIsActive.value ? rv.pipe(debounceTime(500)) : rv;
|
|
17035
|
+
return userIsActive.value ? rv.pipe(operators.debounceTime(500)) : rv;
|
|
18513
17036
|
// Only show connecting if previous state was 'not-started' or 'error', or if
|
|
18514
17037
|
// the time it takes to connect goes beyond 4 seconds.
|
|
18515
17038
|
case 'connecting':
|
|
18516
17039
|
return prevStatus === 'not-started' || prevStatus === 'error'
|
|
18517
17040
|
? rv
|
|
18518
|
-
: rv.pipe(debounceTime(4000));
|
|
17041
|
+
: rv.pipe(operators.debounceTime(4000));
|
|
18519
17042
|
default:
|
|
18520
17043
|
return rv;
|
|
18521
17044
|
}
|
|
18522
17045
|
}));
|
|
18523
17046
|
return rxjs.combineLatest([
|
|
18524
17047
|
lazyWebSocketStatus,
|
|
18525
|
-
db.syncStateChangedEvent.pipe(startWith({ phase: 'initial' })),
|
|
17048
|
+
db.syncStateChangedEvent.pipe(operators.startWith({ phase: 'initial' })),
|
|
18526
17049
|
getCurrentUserEmitter(db.dx._novip),
|
|
18527
17050
|
userIsReallyActive
|
|
18528
|
-
]).pipe(map
|
|
17051
|
+
]).pipe(operators.map(([status, syncState, user, userIsActive]) => {
|
|
18529
17052
|
var _a;
|
|
18530
17053
|
if (((_a = user.license) === null || _a === void 0 ? void 0 : _a.status) && user.license.status !== 'ok') {
|
|
18531
17054
|
return {
|
|
@@ -18614,7 +17137,7 @@
|
|
|
18614
17137
|
});
|
|
18615
17138
|
|
|
18616
17139
|
const getInternalAccessControlObservable = associate((db) => {
|
|
18617
|
-
return createSharedValueObservable(getCurrentUserEmitter(db._novip).pipe(switchMap((currentUser) => Dexie.liveQuery(() => db.transaction('r', 'realms', 'members', () => Promise.all([
|
|
17140
|
+
return createSharedValueObservable(getCurrentUserEmitter(db._novip).pipe(operators.switchMap((currentUser) => Dexie.liveQuery(() => db.transaction('r', 'realms', 'members', () => Promise.all([
|
|
18618
17141
|
db.members.where({ userId: currentUser.userId }).toArray(),
|
|
18619
17142
|
db.realms.toArray(),
|
|
18620
17143
|
currentUser.userId,
|
|
@@ -18715,7 +17238,7 @@
|
|
|
18715
17238
|
const o = createSharedValueObservable(rxjs.combineLatest([
|
|
18716
17239
|
getInternalAccessControlObservable(db._novip),
|
|
18717
17240
|
getGlobalRolesObservable(db._novip),
|
|
18718
|
-
]).pipe(map
|
|
17241
|
+
]).pipe(operators.map(([{ selfMembers, realms, userId }, globalRoles]) => ({
|
|
18719
17242
|
selfMembers,
|
|
18720
17243
|
realms,
|
|
18721
17244
|
userId,
|
|
@@ -18830,16 +17353,16 @@
|
|
|
18830
17353
|
return new PermissionChecker({}, tableName, !owner || owner === dexie.cloud.currentUserId);
|
|
18831
17354
|
return new PermissionChecker(realm.permissions, tableName, realmId === undefined || realmId === dexie.cloud.currentUserId || owner === dexie.cloud.currentUserId);
|
|
18832
17355
|
};
|
|
18833
|
-
const o = source.pipe(map
|
|
17356
|
+
const o = source.pipe(operators.map(mapper));
|
|
18834
17357
|
o.getValue = () => mapper(source.getValue());
|
|
18835
17358
|
return o;
|
|
18836
17359
|
}
|
|
18837
17360
|
|
|
18838
17361
|
const getInvitesObservable = associate((db) => {
|
|
18839
|
-
const membersByEmail = getCurrentUserEmitter(db._novip).pipe(switchMap((currentUser) => Dexie.liveQuery(() => db.members.where({ email: currentUser.email || '' }).toArray())));
|
|
17362
|
+
const membersByEmail = getCurrentUserEmitter(db._novip).pipe(operators.switchMap((currentUser) => Dexie.liveQuery(() => db.members.where({ email: currentUser.email || '' }).toArray())));
|
|
18840
17363
|
const permissions = getPermissionsLookupObservable(db._novip);
|
|
18841
17364
|
const accessControl = getInternalAccessControlObservable(db._novip);
|
|
18842
|
-
return createSharedValueObservable(rxjs.combineLatest([membersByEmail, accessControl, permissions]).pipe(map
|
|
17365
|
+
return createSharedValueObservable(rxjs.combineLatest([membersByEmail, accessControl, permissions]).pipe(operators.map(([membersByEmail, accessControl, realmLookup]) => {
|
|
18843
17366
|
const reducer = (result, m) => (Object.assign(Object.assign({}, result), { [m.id]: Object.assign(Object.assign({}, m), { realm: realmLookup[m.realmId] }) }));
|
|
18844
17367
|
const emailMembersById = membersByEmail.reduce(reducer, {});
|
|
18845
17368
|
const membersById = accessControl.selfMembers.reduce(reducer, emailMembersById);
|
|
@@ -19221,7 +17744,7 @@
|
|
|
19221
17744
|
const syncComplete = new rxjs.Subject();
|
|
19222
17745
|
dexie.cloud = {
|
|
19223
17746
|
// @ts-ignore
|
|
19224
|
-
version: "4.2.0-alpha.
|
|
17747
|
+
version: "4.2.0-alpha.4",
|
|
19225
17748
|
options: Object.assign({}, DEFAULT_OPTIONS),
|
|
19226
17749
|
schema: null,
|
|
19227
17750
|
get currentUserId() {
|
|
@@ -19279,7 +17802,7 @@
|
|
|
19279
17802
|
const syncState = db.cloud.persistedSyncState.value;
|
|
19280
17803
|
triggerSync(db, purpose);
|
|
19281
17804
|
if (wait) {
|
|
19282
|
-
const newSyncState = yield rxjs.firstValueFrom(db.cloud.persistedSyncState.pipe(filter((newSyncState) => (newSyncState === null || newSyncState === void 0 ? void 0 : newSyncState.timestamp) != null &&
|
|
17805
|
+
const newSyncState = yield rxjs.firstValueFrom(db.cloud.persistedSyncState.pipe(operators.filter((newSyncState) => (newSyncState === null || newSyncState === void 0 ? void 0 : newSyncState.timestamp) != null &&
|
|
19283
17806
|
(!syncState || newSyncState.timestamp > syncState.timestamp))));
|
|
19284
17807
|
if (newSyncState === null || newSyncState === void 0 ? void 0 : newSyncState.error) {
|
|
19285
17808
|
throw new Error(`Sync error: ` + newSyncState.error);
|
|
@@ -19298,7 +17821,7 @@
|
|
|
19298
17821
|
(newSyncState === null || newSyncState === void 0 ? void 0 : newSyncState.error))
|
|
19299
17822
|
throw new Error(`Sync error: ` + newSyncState.error);
|
|
19300
17823
|
return syncNeeded;
|
|
19301
|
-
}))).pipe(filter((isNeeded) => !isNeeded)));
|
|
17824
|
+
}))).pipe(operators.filter((isNeeded) => !isNeeded)));
|
|
19302
17825
|
console.debug('Done waiting for sync completion because we have nothing to push anymore');
|
|
19303
17826
|
}
|
|
19304
17827
|
}
|
|
@@ -19438,8 +17961,8 @@
|
|
|
19438
17961
|
// This is so that when db.open() completes, user should be safe
|
|
19439
17962
|
// to subscribe to these observables and get actual data.
|
|
19440
17963
|
yield rxjs.firstValueFrom(rxjs.combineLatest([
|
|
19441
|
-
currentUserEmitter.pipe(skip(1), take(1)),
|
|
19442
|
-
db.cloud.persistedSyncState.pipe(skip(1), take(1)),
|
|
17964
|
+
currentUserEmitter.pipe(operators.skip(1), operators.take(1)),
|
|
17965
|
+
db.cloud.persistedSyncState.pipe(operators.skip(1), operators.take(1)),
|
|
19443
17966
|
]));
|
|
19444
17967
|
const yHandler = createYHandler(db);
|
|
19445
17968
|
DexieYProvider.on.new.subscribe(yHandler);
|
|
@@ -19456,7 +17979,7 @@
|
|
|
19456
17979
|
// If this is a service worker DB, we can't do authentication here,
|
|
19457
17980
|
// we just wait until the application has done it.
|
|
19458
17981
|
console.debug('Dexie Cloud Service worker. Waiting for application to authenticate.');
|
|
19459
|
-
yield rxjs.firstValueFrom(currentUserEmitter.pipe(filter((user) => !!user.isLoggedIn), take(1)));
|
|
17982
|
+
yield rxjs.firstValueFrom(currentUserEmitter.pipe(operators.filter((user) => !!user.isLoggedIn), operators.take(1)));
|
|
19460
17983
|
console.debug('Dexie Cloud Service worker. Application has authenticated.');
|
|
19461
17984
|
}
|
|
19462
17985
|
else {
|
|
@@ -19538,7 +18061,7 @@
|
|
|
19538
18061
|
}
|
|
19539
18062
|
}
|
|
19540
18063
|
// @ts-ignore
|
|
19541
|
-
dexieCloud.version = "4.2.0-alpha.
|
|
18064
|
+
dexieCloud.version = "4.2.0-alpha.4";
|
|
19542
18065
|
Dexie.Cloud = dexieCloud;
|
|
19543
18066
|
|
|
19544
18067
|
exports.default = dexieCloud;
|