@flarehr/apollo-super-selection 3.52.60060 → 3.55.61713
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/lib/apollo-super-selection/apollo-super-selection.css +1 -0
- package/dist/lib/apollo-super-selection/apollo-super-selection.esm.js +1 -1
- package/dist/lib/apollo-super-selection/apollo-super-selection.js +1 -1
- package/dist/lib/apollo-super-selection/assets/icon-check.svg +3 -0
- package/dist/lib/apollo-super-selection/assets/icon-exclamation.svg +3 -0
- package/dist/lib/apollo-super-selection/assets/icon-information-circle.svg +3 -0
- package/dist/lib/apollo-super-selection/p-0d3b8084.system.entry.js +1 -0
- package/dist/lib/apollo-super-selection/p-0ef73515.entry.js +1 -0
- package/dist/lib/apollo-super-selection/p-0f723eb4.system.js +1 -0
- package/dist/lib/apollo-super-selection/{p-01a9f4a4.entry.js → p-12d77532.entry.js} +1 -1
- package/dist/lib/apollo-super-selection/p-14885f78.system.js +15 -0
- package/dist/lib/apollo-super-selection/{p-381262c1.system.js → p-15f0e5eb.system.js} +1 -1
- package/dist/lib/apollo-super-selection/p-29c11183.js +15 -0
- package/dist/lib/apollo-super-selection/{p-20136efe.entry.js → p-375401a0.entry.js} +1 -1
- package/dist/lib/apollo-super-selection/{p-285da037.system.entry.js → p-3ce021a5.system.entry.js} +1 -1
- package/dist/lib/apollo-super-selection/{p-61734b66.js → p-40e504c4.js} +1 -1
- package/dist/lib/apollo-super-selection/p-67b71067.entry.js +1 -0
- package/dist/lib/apollo-super-selection/{p-082669d9.js → p-683b6e23.js} +1 -1
- package/dist/lib/apollo-super-selection/{p-38ee2795.system.js → p-6cdec249.system.js} +1 -1
- package/dist/lib/apollo-super-selection/{p-cd49a6b7.system.entry.js → p-76eee25a.system.entry.js} +1 -1
- package/dist/lib/apollo-super-selection/p-86e3e03f.js +1 -0
- package/dist/lib/apollo-super-selection/{p-8cbfc343.system.entry.js → p-918a740c.system.entry.js} +1 -1
- package/dist/lib/apollo-super-selection/p-93f7a547.entry.js +14 -0
- package/dist/lib/apollo-super-selection/p-c249f6ed.system.js +1 -0
- package/dist/lib/apollo-super-selection/p-c2b9cfa5.system.entry.js +69 -0
- package/dist/lib/apollo-super-selection/{p-a98c2760.entry.js → p-cb6b386e.entry.js} +1 -1
- package/dist/lib/apollo-super-selection/{p-f15bf700.system.entry.js → p-e9a34be2.system.entry.js} +1 -1
- package/dist/lib/cjs/{active-router-e92fd784.js → active-router-71d965f4.js} +1 -1
- package/dist/lib/cjs/apollo-super-selection.cjs.js +4 -5
- package/dist/lib/cjs/{app-globals-45007120.js → app-globals-b1125d8c.js} +1 -1
- package/dist/lib/cjs/context-consumer.cjs.entry.js +1 -1
- package/dist/lib/cjs/{datorama-akita-7f4b082a.js → datorama-akita-6c9cb8fb.js} +1005 -68
- package/dist/lib/cjs/{index-942e6faa.js → index-f746d8f0.js} +2 -0
- package/dist/lib/cjs/loader.cjs.js +4 -5
- package/dist/lib/cjs/{fl-button_31.cjs.entry.js → sss-button_28.cjs.entry.js} +2138 -2177
- package/dist/lib/cjs/stencil-async-content.cjs.entry.js +1 -1
- package/dist/lib/cjs/stencil-route-title.cjs.entry.js +2 -2
- package/dist/lib/cjs/stencil-router-prompt.cjs.entry.js +2 -2
- package/dist/lib/cjs/stencil-router-redirect.cjs.entry.js +2 -2
- package/dist/lib/collection/apollo-super-selection.css +1 -0
- package/dist/lib/collection/collection-manifest.json +16 -28
- package/dist/lib/collection/components/app-host/loading-page.js +3 -3
- package/dist/lib/collection/components/app-host/super-selection-app-host.css +0 -4
- package/dist/lib/collection/components/app-host/super-selection-app-host.js +7 -19
- package/dist/lib/collection/components/super-selection-app/api/super-selection.api.dto.js +69 -1
- package/dist/lib/collection/components/super-selection-app/api/super-selection.api.js +9 -3
- package/dist/lib/collection/components/super-selection-app/app-state-pages/success.js +16 -21
- package/dist/lib/collection/components/super-selection-app/assets/icon-check.svg +3 -0
- package/dist/lib/collection/components/super-selection-app/assets/icon-exclamation.svg +3 -0
- package/dist/lib/collection/components/super-selection-app/assets/icon-information-circle.svg +3 -0
- package/dist/lib/collection/components/super-selection-app/consent/consent.js +57 -0
- package/dist/lib/collection/components/super-selection-app/existing-choice/existing-choice.js +136 -0
- package/dist/lib/collection/components/super-selection-app/footer-section/footer-section.js +6 -18
- package/dist/lib/collection/components/super-selection-app/funds/constants.js +50 -0
- package/dist/lib/collection/components/super-selection-app/funds/custom-fund/custom-fund.js +32 -16
- package/dist/lib/collection/components/super-selection-app/funds/custom-fund/custom-fund.store.js +10 -14
- package/dist/lib/collection/components/super-selection-app/funds/custom-fund/default-fund/default-fund.js +36 -45
- package/dist/lib/collection/components/super-selection-app/funds/custom-fund/my-own-fund/my-own-fund-inputs.js +40 -19
- package/dist/lib/collection/components/super-selection-app/funds/custom-fund/my-own-fund/my-own-fund.js +45 -40
- package/dist/lib/collection/components/super-selection-app/funds/custom-fund/self-managed-fund/self-managed-fund-inputs.js +104 -58
- package/dist/lib/collection/components/super-selection-app/funds/custom-fund/self-managed-fund/self-managed-fund.js +53 -49
- package/dist/lib/collection/components/super-selection-app/funds/custom-fund/self-managed-fund/self-managed-not-supported.js +6 -16
- package/dist/lib/collection/components/super-selection-app/funds/promoted-fund/promoted-fund-join-page.js +1 -1
- package/dist/lib/collection/components/super-selection-app/funds/promoted-fund/promoted-fund.store.js +1 -4
- package/dist/lib/collection/components/super-selection-app/funds/promoted-fund/services/promoted-fund-join-iframe-builder.js +10 -4
- package/dist/lib/collection/components/super-selection-app/funds/slate-super/services/slate-iframe-builder.js +13 -4
- package/dist/lib/collection/components/super-selection-app/funds/slate-super/slate-join-page.js +2 -3
- package/dist/lib/collection/components/super-selection-app/header-section/header-section.js +45 -0
- package/dist/lib/collection/components/super-selection-app/misc/button.js +146 -0
- package/dist/lib/collection/components/super-selection-app/misc/dropdown-async.css +7 -0
- package/dist/lib/collection/components/super-selection-app/misc/dropdown-async.js +359 -0
- package/dist/lib/collection/components/super-selection-app/misc/loading-indicator.js +52 -0
- package/dist/lib/collection/components/super-selection-app/services/australian-fund-lookup.service.js +8 -4
- package/dist/lib/collection/components/super-selection-app/services/event-tracking.service.js +20 -0
- package/dist/lib/collection/components/super-selection-app/services/existing-super-choice-info.service.js +95 -0
- package/dist/lib/collection/components/super-selection-app/services/feature-flag.service.js +11 -0
- package/dist/lib/collection/components/super-selection-app/services/navigation.service.js +8 -0
- package/dist/lib/collection/components/super-selection-app/services/super-selection-app.routes.js +6 -4
- package/dist/lib/collection/components/super-selection-app/standard-choice/standard-choice-form.js +69 -34
- package/dist/lib/collection/components/super-selection-app/standard-choice/standard-choice-form.store.js +10 -0
- package/dist/lib/collection/components/super-selection-app/super-choice-page/super-choice-item/super-choice-item-bottom.js +94 -0
- package/dist/lib/collection/components/super-selection-app/super-choice-page/super-choice-item/super-choice-item-top.js +90 -0
- package/dist/lib/collection/components/super-selection-app/super-choice-page/super-choice-page.js +85 -92
- package/dist/lib/collection/components/super-selection-app/super-selection-app.css +16 -4
- package/dist/lib/collection/components/super-selection-app/super-selection-app.js +59 -11
- package/dist/lib/esm/{active-router-4c80d3d2.js → active-router-2056f552.js} +1 -1
- package/dist/lib/esm/apollo-super-selection.js +4 -5
- package/dist/lib/esm/{app-globals-7ac1ffba.js → app-globals-c1f89805.js} +1 -1
- package/dist/lib/esm/context-consumer.entry.js +1 -1
- package/dist/lib/esm/{datorama-akita-79ce4385.js → datorama-akita-127aea91.js} +960 -28
- package/dist/lib/esm/{index-0496d1af.js → index-e1e930c8.js} +2 -1
- package/dist/lib/esm/loader.js +4 -5
- package/dist/lib/esm/{fl-button_31.entry.js → sss-button_28.entry.js} +2124 -2160
- package/dist/lib/esm/stencil-async-content.entry.js +1 -1
- package/dist/lib/esm/stencil-route-title.entry.js +2 -2
- package/dist/lib/esm/stencil-router-prompt.entry.js +2 -2
- package/dist/lib/esm/stencil-router-redirect.entry.js +2 -2
- package/dist/lib/esm-es5/{active-router-4c80d3d2.js → active-router-2056f552.js} +1 -1
- package/dist/lib/esm-es5/apollo-super-selection.js +1 -1
- package/dist/lib/esm-es5/{app-globals-7ac1ffba.js → app-globals-c1f89805.js} +1 -1
- package/dist/lib/esm-es5/context-consumer.entry.js +1 -1
- package/dist/lib/esm-es5/datorama-akita-127aea91.js +15 -0
- package/dist/lib/esm-es5/{index-0496d1af.js → index-e1e930c8.js} +1 -1
- package/dist/lib/esm-es5/loader.js +1 -1
- package/dist/lib/esm-es5/sss-button_28.entry.js +69 -0
- package/dist/lib/esm-es5/stencil-async-content.entry.js +1 -1
- package/dist/lib/esm-es5/stencil-route-title.entry.js +1 -1
- package/dist/lib/esm-es5/stencil-router-prompt.entry.js +1 -1
- package/dist/lib/esm-es5/stencil-router-redirect.entry.js +1 -1
- package/dist/lib/types/components/app-host/super-selection-app-host.d.ts +0 -3
- package/dist/lib/types/components/super-selection-app/api/super-selection-events.model.d.ts +30 -0
- package/dist/lib/types/components/super-selection-app/api/super-selection.api.d.ts +2 -1
- package/dist/lib/types/components/super-selection-app/api/super-selection.api.dto.d.ts +19 -4
- package/dist/lib/types/components/super-selection-app/consent/consent.d.ts +9 -0
- package/dist/lib/types/components/super-selection-app/existing-choice/existing-choice.d.ts +12 -0
- package/dist/lib/types/components/super-selection-app/footer-section/footer-section.d.ts +0 -1
- package/dist/lib/types/components/super-selection-app/funds/constants.d.ts +3 -0
- package/dist/lib/types/components/super-selection-app/funds/custom-fund/custom-fund.d.ts +1 -1
- package/dist/lib/types/components/super-selection-app/funds/custom-fund/custom-fund.store.d.ts +4 -6
- package/dist/lib/types/components/super-selection-app/funds/custom-fund/default-fund/default-fund.d.ts +0 -2
- package/dist/lib/types/components/super-selection-app/funds/custom-fund/my-own-fund/my-own-fund-inputs.d.ts +2 -1
- package/dist/lib/types/components/super-selection-app/funds/custom-fund/my-own-fund/my-own-fund.d.ts +1 -0
- package/dist/lib/types/components/super-selection-app/funds/custom-fund/self-managed-fund/self-managed-fund-inputs.d.ts +7 -0
- package/dist/lib/types/components/super-selection-app/funds/custom-fund/self-managed-fund/self-managed-fund.d.ts +1 -0
- package/dist/lib/types/components/super-selection-app/funds/custom-fund/self-managed-fund/self-managed-fund.form.d.ts +0 -1
- package/dist/lib/types/components/super-selection-app/funds/promoted-fund/promoted-fund.store.d.ts +0 -3
- package/dist/lib/types/components/super-selection-app/header-section/header-section.d.ts +4 -0
- package/dist/lib/types/components/super-selection-app/misc/button.d.ts +11 -0
- package/dist/lib/types/components/super-selection-app/misc/dropdown-async.d.ts +44 -0
- package/dist/lib/types/components/super-selection-app/misc/loading-indicator.d.ts +5 -0
- package/dist/lib/types/components/super-selection-app/services/australian-fund-lookup.service.d.ts +1 -0
- package/dist/lib/types/components/super-selection-app/services/event-tracking.service.d.ts +4 -0
- package/dist/lib/types/components/super-selection-app/services/existing-super-choice-info.service.d.ts +51 -0
- package/dist/lib/types/components/super-selection-app/services/feature-flag.service.d.ts +3 -0
- package/dist/lib/types/components/super-selection-app/services/navigation.service.d.ts +6 -0
- package/dist/lib/types/components/super-selection-app/services/super-selection-app.routes.d.ts +3 -2
- package/dist/lib/types/components/super-selection-app/standard-choice/standard-choice-form.d.ts +6 -3
- package/dist/lib/types/components/super-selection-app/standard-choice/standard-choice-form.store.d.ts +8 -0
- package/dist/lib/types/components/super-selection-app/super-choice-page/super-choice-item/super-choice-item-bottom.d.ts +9 -0
- package/dist/lib/types/components/super-selection-app/super-choice-page/super-choice-item/super-choice-item-top.d.ts +7 -0
- package/dist/lib/types/components/super-selection-app/super-choice-page/super-choice-page.d.ts +1 -4
- package/dist/lib/types/components/super-selection-app/super-selection-app.d.ts +2 -1
- package/dist/lib/types/components.d.ts +148 -97
- package/package.json +12 -7
- package/dist/lib/apollo-super-selection/assets/logo-qsuper-square.png +0 -0
- package/dist/lib/apollo-super-selection/assets/logo-qsuper.png +0 -0
- package/dist/lib/apollo-super-selection/p-0623b20a.system.entry.js +0 -69
- package/dist/lib/apollo-super-selection/p-13573238.system.js +0 -15
- package/dist/lib/apollo-super-selection/p-342cee5a.js +0 -1
- package/dist/lib/apollo-super-selection/p-38f24f69.js +0 -1
- package/dist/lib/apollo-super-selection/p-642db1f7.system.entry.js +0 -1
- package/dist/lib/apollo-super-selection/p-64ebe17d.system.entry.js +0 -1
- package/dist/lib/apollo-super-selection/p-7dbe5a2f.system.js +0 -1
- package/dist/lib/apollo-super-selection/p-abedb220.entry.js +0 -1
- package/dist/lib/apollo-super-selection/p-ae4f5e0b.system.js +0 -1
- package/dist/lib/apollo-super-selection/p-c5e41889.entry.js +0 -1
- package/dist/lib/apollo-super-selection/p-d82b00ed.system.js +0 -1
- package/dist/lib/apollo-super-selection/p-df9ce4b7.js +0 -15
- package/dist/lib/apollo-super-selection/p-f7a45412.entry.js +0 -1
- package/dist/lib/apollo-super-selection/p-fbe8c6d1.entry.js +0 -14
- package/dist/lib/cjs/delay-81aff2f1.js +0 -955
- package/dist/lib/cjs/fl-style-guide.cjs.entry.js +0 -90
- package/dist/lib/collection/components/super-selection-app/footer-section/footer-section.css +0 -11
- package/dist/lib/collection/components/super-selection-app/funds/custom-fund/self-managed-fund/self-managed-not-supported.css +0 -23
- package/dist/lib/collection/components/super-selection-app/funds/promoted-fund/promoted-fund-standard-choice-page.js +0 -62
- package/dist/lib/collection/components/super-selection-app/funds/slate-super/slate-fund.store.js +0 -10
- package/dist/lib/collection/components/super-selection-app/funds/slate-super/slate-standard-choice-page.js +0 -67
- package/dist/lib/collection/components/super-selection-app/funds/slate-super/slatesuper-header.css +0 -0
- package/dist/lib/collection/components/super-selection-app/funds/slate-super/slatesuper-header.js +0 -19
- package/dist/lib/collection/components/super-selection-app/notifications-section/notifications-section.js +0 -25
- package/dist/lib/collection/components/super-selection-app/services/notifications.service.js +0 -37
- package/dist/lib/collection/components/super-selection-app/services/notifications.store.js +0 -3
- package/dist/lib/collection/components/super-selection-app/services/selected-super-choice-info.service.js +0 -50
- package/dist/lib/collection/components/super-selection-app/standard-choice/api/standard-choice.model.js +0 -1
- package/dist/lib/collection/components/super-selection-app/super-choice-page/assets/logo-qsuper-square.png +0 -0
- package/dist/lib/collection/components/super-selection-app/super-choice-page/assets/logo-qsuper.png +0 -0
- package/dist/lib/collection/components/super-selection-app/super-choice-page/selected-super-choice-section/selected-super-choice-section.css +0 -18
- package/dist/lib/collection/components/super-selection-app/super-choice-page/selected-super-choice-section/selected-super-choice-section.js +0 -53
- package/dist/lib/collection/components/super-selection-app/super-choice-page/super-choice-item.js +0 -296
- package/dist/lib/collection/components/super-selection-app/super-choice-page/super-choice-page.css +0 -70
- package/dist/lib/esm/delay-c0555599.js +0 -935
- package/dist/lib/esm/fl-style-guide.entry.js +0 -86
- package/dist/lib/esm-es5/datorama-akita-79ce4385.js +0 -15
- package/dist/lib/esm-es5/delay-c0555599.js +0 -1
- package/dist/lib/esm-es5/fl-button_31.entry.js +0 -69
- package/dist/lib/esm-es5/fl-style-guide.entry.js +0 -1
- package/dist/lib/node_modules/@flarehr/beacon/dist/collection/components/button/button.css +0 -45
- package/dist/lib/node_modules/@flarehr/beacon/dist/collection/components/dropdown/dropdown.css +0 -9
- package/dist/lib/node_modules/@flarehr/beacon/dist/collection/components/dropdown-async/dropdown-async.css +0 -9
- package/dist/lib/node_modules/@flarehr/beacon/dist/collection/components/loading-indicator/loading-indicator.css +0 -141
- package/dist/lib/node_modules/@flarehr/beacon/dist/collection/components/promise-button/promise-button.css +0 -5
- package/dist/lib/node_modules/@flarehr/beacon/dist/collection/components/style-guide/style-guide.css +0 -0
- package/dist/lib/types/components/super-selection-app/funds/promoted-fund/promoted-fund-standard-choice-page.d.ts +0 -8
- package/dist/lib/types/components/super-selection-app/funds/slate-super/slate-fund.store.d.ts +0 -7
- package/dist/lib/types/components/super-selection-app/funds/slate-super/slate-standard-choice-page.d.ts +0 -8
- package/dist/lib/types/components/super-selection-app/funds/slate-super/slatesuper-header.d.ts +0 -3
- package/dist/lib/types/components/super-selection-app/notifications-section/notifications-section.d.ts +0 -5
- package/dist/lib/types/components/super-selection-app/services/notifications.service.d.ts +0 -15
- package/dist/lib/types/components/super-selection-app/services/notifications.store.d.ts +0 -14
- package/dist/lib/types/components/super-selection-app/services/selected-super-choice-info.service.d.ts +0 -18
- package/dist/lib/types/components/super-selection-app/standard-choice/api/standard-choice.model.d.ts +0 -3
- package/dist/lib/types/components/super-selection-app/super-choice-page/selected-super-choice-section/selected-super-choice-section.d.ts +0 -5
- package/dist/lib/types/components/super-selection-app/super-choice-page/super-choice-item.d.ts +0 -22
|
@@ -1,935 +0,0 @@
|
|
|
1
|
-
function isFunction(x) {
|
|
2
|
-
return typeof x === 'function';
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
let _enable_super_gross_mode_that_will_cause_bad_things = false;
|
|
6
|
-
const config = {
|
|
7
|
-
Promise: undefined,
|
|
8
|
-
set useDeprecatedSynchronousErrorHandling(value) {
|
|
9
|
-
if (value) {
|
|
10
|
-
const error = new Error();
|
|
11
|
-
console.warn('DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n' + error.stack);
|
|
12
|
-
}
|
|
13
|
-
else if (_enable_super_gross_mode_that_will_cause_bad_things) {
|
|
14
|
-
console.log('RxJS: Back to a better error behavior. Thank you. <3');
|
|
15
|
-
}
|
|
16
|
-
_enable_super_gross_mode_that_will_cause_bad_things = value;
|
|
17
|
-
},
|
|
18
|
-
get useDeprecatedSynchronousErrorHandling() {
|
|
19
|
-
return _enable_super_gross_mode_that_will_cause_bad_things;
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
function hostReportError(err) {
|
|
24
|
-
setTimeout(() => { throw err; }, 0);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const empty = {
|
|
28
|
-
closed: true,
|
|
29
|
-
next(value) { },
|
|
30
|
-
error(err) {
|
|
31
|
-
if (config.useDeprecatedSynchronousErrorHandling) {
|
|
32
|
-
throw err;
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
hostReportError(err);
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
complete() { }
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
const isArray = (() => Array.isArray || ((x) => x && typeof x.length === 'number'))();
|
|
42
|
-
|
|
43
|
-
function isObject(x) {
|
|
44
|
-
return x !== null && typeof x === 'object';
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
const UnsubscriptionErrorImpl = (() => {
|
|
48
|
-
function UnsubscriptionErrorImpl(errors) {
|
|
49
|
-
Error.call(this);
|
|
50
|
-
this.message = errors ?
|
|
51
|
-
`${errors.length} errors occurred during unsubscription:
|
|
52
|
-
${errors.map((err, i) => `${i + 1}) ${err.toString()}`).join('\n ')}` : '';
|
|
53
|
-
this.name = 'UnsubscriptionError';
|
|
54
|
-
this.errors = errors;
|
|
55
|
-
return this;
|
|
56
|
-
}
|
|
57
|
-
UnsubscriptionErrorImpl.prototype = Object.create(Error.prototype);
|
|
58
|
-
return UnsubscriptionErrorImpl;
|
|
59
|
-
})();
|
|
60
|
-
const UnsubscriptionError = UnsubscriptionErrorImpl;
|
|
61
|
-
|
|
62
|
-
class Subscription {
|
|
63
|
-
constructor(unsubscribe) {
|
|
64
|
-
this.closed = false;
|
|
65
|
-
this._parentOrParents = null;
|
|
66
|
-
this._subscriptions = null;
|
|
67
|
-
if (unsubscribe) {
|
|
68
|
-
this._ctorUnsubscribe = true;
|
|
69
|
-
this._unsubscribe = unsubscribe;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
unsubscribe() {
|
|
73
|
-
let errors;
|
|
74
|
-
if (this.closed) {
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
let { _parentOrParents, _ctorUnsubscribe, _unsubscribe, _subscriptions } = this;
|
|
78
|
-
this.closed = true;
|
|
79
|
-
this._parentOrParents = null;
|
|
80
|
-
this._subscriptions = null;
|
|
81
|
-
if (_parentOrParents instanceof Subscription) {
|
|
82
|
-
_parentOrParents.remove(this);
|
|
83
|
-
}
|
|
84
|
-
else if (_parentOrParents !== null) {
|
|
85
|
-
for (let index = 0; index < _parentOrParents.length; ++index) {
|
|
86
|
-
const parent = _parentOrParents[index];
|
|
87
|
-
parent.remove(this);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
if (isFunction(_unsubscribe)) {
|
|
91
|
-
if (_ctorUnsubscribe) {
|
|
92
|
-
this._unsubscribe = undefined;
|
|
93
|
-
}
|
|
94
|
-
try {
|
|
95
|
-
_unsubscribe.call(this);
|
|
96
|
-
}
|
|
97
|
-
catch (e) {
|
|
98
|
-
errors = e instanceof UnsubscriptionError ? flattenUnsubscriptionErrors(e.errors) : [e];
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
if (isArray(_subscriptions)) {
|
|
102
|
-
let index = -1;
|
|
103
|
-
let len = _subscriptions.length;
|
|
104
|
-
while (++index < len) {
|
|
105
|
-
const sub = _subscriptions[index];
|
|
106
|
-
if (isObject(sub)) {
|
|
107
|
-
try {
|
|
108
|
-
sub.unsubscribe();
|
|
109
|
-
}
|
|
110
|
-
catch (e) {
|
|
111
|
-
errors = errors || [];
|
|
112
|
-
if (e instanceof UnsubscriptionError) {
|
|
113
|
-
errors = errors.concat(flattenUnsubscriptionErrors(e.errors));
|
|
114
|
-
}
|
|
115
|
-
else {
|
|
116
|
-
errors.push(e);
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
if (errors) {
|
|
123
|
-
throw new UnsubscriptionError(errors);
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
add(teardown) {
|
|
127
|
-
let subscription = teardown;
|
|
128
|
-
if (!teardown) {
|
|
129
|
-
return Subscription.EMPTY;
|
|
130
|
-
}
|
|
131
|
-
switch (typeof teardown) {
|
|
132
|
-
case 'function':
|
|
133
|
-
subscription = new Subscription(teardown);
|
|
134
|
-
case 'object':
|
|
135
|
-
if (subscription === this || subscription.closed || typeof subscription.unsubscribe !== 'function') {
|
|
136
|
-
return subscription;
|
|
137
|
-
}
|
|
138
|
-
else if (this.closed) {
|
|
139
|
-
subscription.unsubscribe();
|
|
140
|
-
return subscription;
|
|
141
|
-
}
|
|
142
|
-
else if (!(subscription instanceof Subscription)) {
|
|
143
|
-
const tmp = subscription;
|
|
144
|
-
subscription = new Subscription();
|
|
145
|
-
subscription._subscriptions = [tmp];
|
|
146
|
-
}
|
|
147
|
-
break;
|
|
148
|
-
default: {
|
|
149
|
-
throw new Error('unrecognized teardown ' + teardown + ' added to Subscription.');
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
let { _parentOrParents } = subscription;
|
|
153
|
-
if (_parentOrParents === null) {
|
|
154
|
-
subscription._parentOrParents = this;
|
|
155
|
-
}
|
|
156
|
-
else if (_parentOrParents instanceof Subscription) {
|
|
157
|
-
if (_parentOrParents === this) {
|
|
158
|
-
return subscription;
|
|
159
|
-
}
|
|
160
|
-
subscription._parentOrParents = [_parentOrParents, this];
|
|
161
|
-
}
|
|
162
|
-
else if (_parentOrParents.indexOf(this) === -1) {
|
|
163
|
-
_parentOrParents.push(this);
|
|
164
|
-
}
|
|
165
|
-
else {
|
|
166
|
-
return subscription;
|
|
167
|
-
}
|
|
168
|
-
const subscriptions = this._subscriptions;
|
|
169
|
-
if (subscriptions === null) {
|
|
170
|
-
this._subscriptions = [subscription];
|
|
171
|
-
}
|
|
172
|
-
else {
|
|
173
|
-
subscriptions.push(subscription);
|
|
174
|
-
}
|
|
175
|
-
return subscription;
|
|
176
|
-
}
|
|
177
|
-
remove(subscription) {
|
|
178
|
-
const subscriptions = this._subscriptions;
|
|
179
|
-
if (subscriptions) {
|
|
180
|
-
const subscriptionIndex = subscriptions.indexOf(subscription);
|
|
181
|
-
if (subscriptionIndex !== -1) {
|
|
182
|
-
subscriptions.splice(subscriptionIndex, 1);
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
Subscription.EMPTY = (function (empty) {
|
|
188
|
-
empty.closed = true;
|
|
189
|
-
return empty;
|
|
190
|
-
}(new Subscription()));
|
|
191
|
-
function flattenUnsubscriptionErrors(errors) {
|
|
192
|
-
return errors.reduce((errs, err) => errs.concat((err instanceof UnsubscriptionError) ? err.errors : err), []);
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
const rxSubscriber = (() => typeof Symbol === 'function'
|
|
196
|
-
? Symbol('rxSubscriber')
|
|
197
|
-
: '@@rxSubscriber_' + Math.random())();
|
|
198
|
-
|
|
199
|
-
class Subscriber extends Subscription {
|
|
200
|
-
constructor(destinationOrNext, error, complete) {
|
|
201
|
-
super();
|
|
202
|
-
this.syncErrorValue = null;
|
|
203
|
-
this.syncErrorThrown = false;
|
|
204
|
-
this.syncErrorThrowable = false;
|
|
205
|
-
this.isStopped = false;
|
|
206
|
-
switch (arguments.length) {
|
|
207
|
-
case 0:
|
|
208
|
-
this.destination = empty;
|
|
209
|
-
break;
|
|
210
|
-
case 1:
|
|
211
|
-
if (!destinationOrNext) {
|
|
212
|
-
this.destination = empty;
|
|
213
|
-
break;
|
|
214
|
-
}
|
|
215
|
-
if (typeof destinationOrNext === 'object') {
|
|
216
|
-
if (destinationOrNext instanceof Subscriber) {
|
|
217
|
-
this.syncErrorThrowable = destinationOrNext.syncErrorThrowable;
|
|
218
|
-
this.destination = destinationOrNext;
|
|
219
|
-
destinationOrNext.add(this);
|
|
220
|
-
}
|
|
221
|
-
else {
|
|
222
|
-
this.syncErrorThrowable = true;
|
|
223
|
-
this.destination = new SafeSubscriber(this, destinationOrNext);
|
|
224
|
-
}
|
|
225
|
-
break;
|
|
226
|
-
}
|
|
227
|
-
default:
|
|
228
|
-
this.syncErrorThrowable = true;
|
|
229
|
-
this.destination = new SafeSubscriber(this, destinationOrNext, error, complete);
|
|
230
|
-
break;
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
[rxSubscriber]() { return this; }
|
|
234
|
-
static create(next, error, complete) {
|
|
235
|
-
const subscriber = new Subscriber(next, error, complete);
|
|
236
|
-
subscriber.syncErrorThrowable = false;
|
|
237
|
-
return subscriber;
|
|
238
|
-
}
|
|
239
|
-
next(value) {
|
|
240
|
-
if (!this.isStopped) {
|
|
241
|
-
this._next(value);
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
error(err) {
|
|
245
|
-
if (!this.isStopped) {
|
|
246
|
-
this.isStopped = true;
|
|
247
|
-
this._error(err);
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
complete() {
|
|
251
|
-
if (!this.isStopped) {
|
|
252
|
-
this.isStopped = true;
|
|
253
|
-
this._complete();
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
unsubscribe() {
|
|
257
|
-
if (this.closed) {
|
|
258
|
-
return;
|
|
259
|
-
}
|
|
260
|
-
this.isStopped = true;
|
|
261
|
-
super.unsubscribe();
|
|
262
|
-
}
|
|
263
|
-
_next(value) {
|
|
264
|
-
this.destination.next(value);
|
|
265
|
-
}
|
|
266
|
-
_error(err) {
|
|
267
|
-
this.destination.error(err);
|
|
268
|
-
this.unsubscribe();
|
|
269
|
-
}
|
|
270
|
-
_complete() {
|
|
271
|
-
this.destination.complete();
|
|
272
|
-
this.unsubscribe();
|
|
273
|
-
}
|
|
274
|
-
_unsubscribeAndRecycle() {
|
|
275
|
-
const { _parentOrParents } = this;
|
|
276
|
-
this._parentOrParents = null;
|
|
277
|
-
this.unsubscribe();
|
|
278
|
-
this.closed = false;
|
|
279
|
-
this.isStopped = false;
|
|
280
|
-
this._parentOrParents = _parentOrParents;
|
|
281
|
-
return this;
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
class SafeSubscriber extends Subscriber {
|
|
285
|
-
constructor(_parentSubscriber, observerOrNext, error, complete) {
|
|
286
|
-
super();
|
|
287
|
-
this._parentSubscriber = _parentSubscriber;
|
|
288
|
-
let next;
|
|
289
|
-
let context = this;
|
|
290
|
-
if (isFunction(observerOrNext)) {
|
|
291
|
-
next = observerOrNext;
|
|
292
|
-
}
|
|
293
|
-
else if (observerOrNext) {
|
|
294
|
-
next = observerOrNext.next;
|
|
295
|
-
error = observerOrNext.error;
|
|
296
|
-
complete = observerOrNext.complete;
|
|
297
|
-
if (observerOrNext !== empty) {
|
|
298
|
-
context = Object.create(observerOrNext);
|
|
299
|
-
if (isFunction(context.unsubscribe)) {
|
|
300
|
-
this.add(context.unsubscribe.bind(context));
|
|
301
|
-
}
|
|
302
|
-
context.unsubscribe = this.unsubscribe.bind(this);
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
this._context = context;
|
|
306
|
-
this._next = next;
|
|
307
|
-
this._error = error;
|
|
308
|
-
this._complete = complete;
|
|
309
|
-
}
|
|
310
|
-
next(value) {
|
|
311
|
-
if (!this.isStopped && this._next) {
|
|
312
|
-
const { _parentSubscriber } = this;
|
|
313
|
-
if (!config.useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {
|
|
314
|
-
this.__tryOrUnsub(this._next, value);
|
|
315
|
-
}
|
|
316
|
-
else if (this.__tryOrSetError(_parentSubscriber, this._next, value)) {
|
|
317
|
-
this.unsubscribe();
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
error(err) {
|
|
322
|
-
if (!this.isStopped) {
|
|
323
|
-
const { _parentSubscriber } = this;
|
|
324
|
-
const { useDeprecatedSynchronousErrorHandling } = config;
|
|
325
|
-
if (this._error) {
|
|
326
|
-
if (!useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {
|
|
327
|
-
this.__tryOrUnsub(this._error, err);
|
|
328
|
-
this.unsubscribe();
|
|
329
|
-
}
|
|
330
|
-
else {
|
|
331
|
-
this.__tryOrSetError(_parentSubscriber, this._error, err);
|
|
332
|
-
this.unsubscribe();
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
else if (!_parentSubscriber.syncErrorThrowable) {
|
|
336
|
-
this.unsubscribe();
|
|
337
|
-
if (useDeprecatedSynchronousErrorHandling) {
|
|
338
|
-
throw err;
|
|
339
|
-
}
|
|
340
|
-
hostReportError(err);
|
|
341
|
-
}
|
|
342
|
-
else {
|
|
343
|
-
if (useDeprecatedSynchronousErrorHandling) {
|
|
344
|
-
_parentSubscriber.syncErrorValue = err;
|
|
345
|
-
_parentSubscriber.syncErrorThrown = true;
|
|
346
|
-
}
|
|
347
|
-
else {
|
|
348
|
-
hostReportError(err);
|
|
349
|
-
}
|
|
350
|
-
this.unsubscribe();
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
complete() {
|
|
355
|
-
if (!this.isStopped) {
|
|
356
|
-
const { _parentSubscriber } = this;
|
|
357
|
-
if (this._complete) {
|
|
358
|
-
const wrappedComplete = () => this._complete.call(this._context);
|
|
359
|
-
if (!config.useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {
|
|
360
|
-
this.__tryOrUnsub(wrappedComplete);
|
|
361
|
-
this.unsubscribe();
|
|
362
|
-
}
|
|
363
|
-
else {
|
|
364
|
-
this.__tryOrSetError(_parentSubscriber, wrappedComplete);
|
|
365
|
-
this.unsubscribe();
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
else {
|
|
369
|
-
this.unsubscribe();
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
__tryOrUnsub(fn, value) {
|
|
374
|
-
try {
|
|
375
|
-
fn.call(this._context, value);
|
|
376
|
-
}
|
|
377
|
-
catch (err) {
|
|
378
|
-
this.unsubscribe();
|
|
379
|
-
if (config.useDeprecatedSynchronousErrorHandling) {
|
|
380
|
-
throw err;
|
|
381
|
-
}
|
|
382
|
-
else {
|
|
383
|
-
hostReportError(err);
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
__tryOrSetError(parent, fn, value) {
|
|
388
|
-
if (!config.useDeprecatedSynchronousErrorHandling) {
|
|
389
|
-
throw new Error('bad call');
|
|
390
|
-
}
|
|
391
|
-
try {
|
|
392
|
-
fn.call(this._context, value);
|
|
393
|
-
}
|
|
394
|
-
catch (err) {
|
|
395
|
-
if (config.useDeprecatedSynchronousErrorHandling) {
|
|
396
|
-
parent.syncErrorValue = err;
|
|
397
|
-
parent.syncErrorThrown = true;
|
|
398
|
-
return true;
|
|
399
|
-
}
|
|
400
|
-
else {
|
|
401
|
-
hostReportError(err);
|
|
402
|
-
return true;
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
return false;
|
|
406
|
-
}
|
|
407
|
-
_unsubscribe() {
|
|
408
|
-
const { _parentSubscriber } = this;
|
|
409
|
-
this._context = null;
|
|
410
|
-
this._parentSubscriber = null;
|
|
411
|
-
_parentSubscriber.unsubscribe();
|
|
412
|
-
}
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
function canReportError(observer) {
|
|
416
|
-
while (observer) {
|
|
417
|
-
const { closed, destination, isStopped } = observer;
|
|
418
|
-
if (closed || isStopped) {
|
|
419
|
-
return false;
|
|
420
|
-
}
|
|
421
|
-
else if (destination && destination instanceof Subscriber) {
|
|
422
|
-
observer = destination;
|
|
423
|
-
}
|
|
424
|
-
else {
|
|
425
|
-
observer = null;
|
|
426
|
-
}
|
|
427
|
-
}
|
|
428
|
-
return true;
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
function toSubscriber(nextOrObserver, error, complete) {
|
|
432
|
-
if (nextOrObserver) {
|
|
433
|
-
if (nextOrObserver instanceof Subscriber) {
|
|
434
|
-
return nextOrObserver;
|
|
435
|
-
}
|
|
436
|
-
if (nextOrObserver[rxSubscriber]) {
|
|
437
|
-
return nextOrObserver[rxSubscriber]();
|
|
438
|
-
}
|
|
439
|
-
}
|
|
440
|
-
if (!nextOrObserver && !error && !complete) {
|
|
441
|
-
return new Subscriber(empty);
|
|
442
|
-
}
|
|
443
|
-
return new Subscriber(nextOrObserver, error, complete);
|
|
444
|
-
}
|
|
445
|
-
|
|
446
|
-
const observable = (() => typeof Symbol === 'function' && Symbol.observable || '@@observable')();
|
|
447
|
-
|
|
448
|
-
function identity(x) {
|
|
449
|
-
return x;
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
function pipeFromArray(fns) {
|
|
453
|
-
if (fns.length === 0) {
|
|
454
|
-
return identity;
|
|
455
|
-
}
|
|
456
|
-
if (fns.length === 1) {
|
|
457
|
-
return fns[0];
|
|
458
|
-
}
|
|
459
|
-
return function piped(input) {
|
|
460
|
-
return fns.reduce((prev, fn) => fn(prev), input);
|
|
461
|
-
};
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
class Observable {
|
|
465
|
-
constructor(subscribe) {
|
|
466
|
-
this._isScalar = false;
|
|
467
|
-
if (subscribe) {
|
|
468
|
-
this._subscribe = subscribe;
|
|
469
|
-
}
|
|
470
|
-
}
|
|
471
|
-
lift(operator) {
|
|
472
|
-
const observable = new Observable();
|
|
473
|
-
observable.source = this;
|
|
474
|
-
observable.operator = operator;
|
|
475
|
-
return observable;
|
|
476
|
-
}
|
|
477
|
-
subscribe(observerOrNext, error, complete) {
|
|
478
|
-
const { operator } = this;
|
|
479
|
-
const sink = toSubscriber(observerOrNext, error, complete);
|
|
480
|
-
if (operator) {
|
|
481
|
-
sink.add(operator.call(sink, this.source));
|
|
482
|
-
}
|
|
483
|
-
else {
|
|
484
|
-
sink.add(this.source || (config.useDeprecatedSynchronousErrorHandling && !sink.syncErrorThrowable) ?
|
|
485
|
-
this._subscribe(sink) :
|
|
486
|
-
this._trySubscribe(sink));
|
|
487
|
-
}
|
|
488
|
-
if (config.useDeprecatedSynchronousErrorHandling) {
|
|
489
|
-
if (sink.syncErrorThrowable) {
|
|
490
|
-
sink.syncErrorThrowable = false;
|
|
491
|
-
if (sink.syncErrorThrown) {
|
|
492
|
-
throw sink.syncErrorValue;
|
|
493
|
-
}
|
|
494
|
-
}
|
|
495
|
-
}
|
|
496
|
-
return sink;
|
|
497
|
-
}
|
|
498
|
-
_trySubscribe(sink) {
|
|
499
|
-
try {
|
|
500
|
-
return this._subscribe(sink);
|
|
501
|
-
}
|
|
502
|
-
catch (err) {
|
|
503
|
-
if (config.useDeprecatedSynchronousErrorHandling) {
|
|
504
|
-
sink.syncErrorThrown = true;
|
|
505
|
-
sink.syncErrorValue = err;
|
|
506
|
-
}
|
|
507
|
-
if (canReportError(sink)) {
|
|
508
|
-
sink.error(err);
|
|
509
|
-
}
|
|
510
|
-
else {
|
|
511
|
-
console.warn(err);
|
|
512
|
-
}
|
|
513
|
-
}
|
|
514
|
-
}
|
|
515
|
-
forEach(next, promiseCtor) {
|
|
516
|
-
promiseCtor = getPromiseCtor(promiseCtor);
|
|
517
|
-
return new promiseCtor((resolve, reject) => {
|
|
518
|
-
let subscription;
|
|
519
|
-
subscription = this.subscribe((value) => {
|
|
520
|
-
try {
|
|
521
|
-
next(value);
|
|
522
|
-
}
|
|
523
|
-
catch (err) {
|
|
524
|
-
reject(err);
|
|
525
|
-
if (subscription) {
|
|
526
|
-
subscription.unsubscribe();
|
|
527
|
-
}
|
|
528
|
-
}
|
|
529
|
-
}, reject, resolve);
|
|
530
|
-
});
|
|
531
|
-
}
|
|
532
|
-
_subscribe(subscriber) {
|
|
533
|
-
const { source } = this;
|
|
534
|
-
return source && source.subscribe(subscriber);
|
|
535
|
-
}
|
|
536
|
-
[observable]() {
|
|
537
|
-
return this;
|
|
538
|
-
}
|
|
539
|
-
pipe(...operations) {
|
|
540
|
-
if (operations.length === 0) {
|
|
541
|
-
return this;
|
|
542
|
-
}
|
|
543
|
-
return pipeFromArray(operations)(this);
|
|
544
|
-
}
|
|
545
|
-
toPromise(promiseCtor) {
|
|
546
|
-
promiseCtor = getPromiseCtor(promiseCtor);
|
|
547
|
-
return new promiseCtor((resolve, reject) => {
|
|
548
|
-
let value;
|
|
549
|
-
this.subscribe((x) => value = x, (err) => reject(err), () => resolve(value));
|
|
550
|
-
});
|
|
551
|
-
}
|
|
552
|
-
}
|
|
553
|
-
Observable.create = (subscribe) => {
|
|
554
|
-
return new Observable(subscribe);
|
|
555
|
-
};
|
|
556
|
-
function getPromiseCtor(promiseCtor) {
|
|
557
|
-
if (!promiseCtor) {
|
|
558
|
-
promiseCtor = Promise;
|
|
559
|
-
}
|
|
560
|
-
if (!promiseCtor) {
|
|
561
|
-
throw new Error('no Promise impl found');
|
|
562
|
-
}
|
|
563
|
-
return promiseCtor;
|
|
564
|
-
}
|
|
565
|
-
|
|
566
|
-
class Action extends Subscription {
|
|
567
|
-
constructor(scheduler, work) {
|
|
568
|
-
super();
|
|
569
|
-
}
|
|
570
|
-
schedule(state, delay = 0) {
|
|
571
|
-
return this;
|
|
572
|
-
}
|
|
573
|
-
}
|
|
574
|
-
|
|
575
|
-
class AsyncAction extends Action {
|
|
576
|
-
constructor(scheduler, work) {
|
|
577
|
-
super(scheduler, work);
|
|
578
|
-
this.scheduler = scheduler;
|
|
579
|
-
this.work = work;
|
|
580
|
-
this.pending = false;
|
|
581
|
-
}
|
|
582
|
-
schedule(state, delay = 0) {
|
|
583
|
-
if (this.closed) {
|
|
584
|
-
return this;
|
|
585
|
-
}
|
|
586
|
-
this.state = state;
|
|
587
|
-
const id = this.id;
|
|
588
|
-
const scheduler = this.scheduler;
|
|
589
|
-
if (id != null) {
|
|
590
|
-
this.id = this.recycleAsyncId(scheduler, id, delay);
|
|
591
|
-
}
|
|
592
|
-
this.pending = true;
|
|
593
|
-
this.delay = delay;
|
|
594
|
-
this.id = this.id || this.requestAsyncId(scheduler, this.id, delay);
|
|
595
|
-
return this;
|
|
596
|
-
}
|
|
597
|
-
requestAsyncId(scheduler, id, delay = 0) {
|
|
598
|
-
return setInterval(scheduler.flush.bind(scheduler, this), delay);
|
|
599
|
-
}
|
|
600
|
-
recycleAsyncId(scheduler, id, delay = 0) {
|
|
601
|
-
if (delay !== null && this.delay === delay && this.pending === false) {
|
|
602
|
-
return id;
|
|
603
|
-
}
|
|
604
|
-
clearInterval(id);
|
|
605
|
-
return undefined;
|
|
606
|
-
}
|
|
607
|
-
execute(state, delay) {
|
|
608
|
-
if (this.closed) {
|
|
609
|
-
return new Error('executing a cancelled action');
|
|
610
|
-
}
|
|
611
|
-
this.pending = false;
|
|
612
|
-
const error = this._execute(state, delay);
|
|
613
|
-
if (error) {
|
|
614
|
-
return error;
|
|
615
|
-
}
|
|
616
|
-
else if (this.pending === false && this.id != null) {
|
|
617
|
-
this.id = this.recycleAsyncId(this.scheduler, this.id, null);
|
|
618
|
-
}
|
|
619
|
-
}
|
|
620
|
-
_execute(state, delay) {
|
|
621
|
-
let errored = false;
|
|
622
|
-
let errorValue = undefined;
|
|
623
|
-
try {
|
|
624
|
-
this.work(state);
|
|
625
|
-
}
|
|
626
|
-
catch (e) {
|
|
627
|
-
errored = true;
|
|
628
|
-
errorValue = !!e && e || new Error(e);
|
|
629
|
-
}
|
|
630
|
-
if (errored) {
|
|
631
|
-
this.unsubscribe();
|
|
632
|
-
return errorValue;
|
|
633
|
-
}
|
|
634
|
-
}
|
|
635
|
-
_unsubscribe() {
|
|
636
|
-
const id = this.id;
|
|
637
|
-
const scheduler = this.scheduler;
|
|
638
|
-
const actions = scheduler.actions;
|
|
639
|
-
const index = actions.indexOf(this);
|
|
640
|
-
this.work = null;
|
|
641
|
-
this.state = null;
|
|
642
|
-
this.pending = false;
|
|
643
|
-
this.scheduler = null;
|
|
644
|
-
if (index !== -1) {
|
|
645
|
-
actions.splice(index, 1);
|
|
646
|
-
}
|
|
647
|
-
if (id != null) {
|
|
648
|
-
this.id = this.recycleAsyncId(scheduler, id, null);
|
|
649
|
-
}
|
|
650
|
-
this.delay = null;
|
|
651
|
-
}
|
|
652
|
-
}
|
|
653
|
-
|
|
654
|
-
class Scheduler {
|
|
655
|
-
constructor(SchedulerAction, now = Scheduler.now) {
|
|
656
|
-
this.SchedulerAction = SchedulerAction;
|
|
657
|
-
this.now = now;
|
|
658
|
-
}
|
|
659
|
-
schedule(work, delay = 0, state) {
|
|
660
|
-
return new this.SchedulerAction(this, work).schedule(state, delay);
|
|
661
|
-
}
|
|
662
|
-
}
|
|
663
|
-
Scheduler.now = () => Date.now();
|
|
664
|
-
|
|
665
|
-
class AsyncScheduler extends Scheduler {
|
|
666
|
-
constructor(SchedulerAction, now = Scheduler.now) {
|
|
667
|
-
super(SchedulerAction, () => {
|
|
668
|
-
if (AsyncScheduler.delegate && AsyncScheduler.delegate !== this) {
|
|
669
|
-
return AsyncScheduler.delegate.now();
|
|
670
|
-
}
|
|
671
|
-
else {
|
|
672
|
-
return now();
|
|
673
|
-
}
|
|
674
|
-
});
|
|
675
|
-
this.actions = [];
|
|
676
|
-
this.active = false;
|
|
677
|
-
this.scheduled = undefined;
|
|
678
|
-
}
|
|
679
|
-
schedule(work, delay = 0, state) {
|
|
680
|
-
if (AsyncScheduler.delegate && AsyncScheduler.delegate !== this) {
|
|
681
|
-
return AsyncScheduler.delegate.schedule(work, delay, state);
|
|
682
|
-
}
|
|
683
|
-
else {
|
|
684
|
-
return super.schedule(work, delay, state);
|
|
685
|
-
}
|
|
686
|
-
}
|
|
687
|
-
flush(action) {
|
|
688
|
-
const { actions } = this;
|
|
689
|
-
if (this.active) {
|
|
690
|
-
actions.push(action);
|
|
691
|
-
return;
|
|
692
|
-
}
|
|
693
|
-
let error;
|
|
694
|
-
this.active = true;
|
|
695
|
-
do {
|
|
696
|
-
if (error = action.execute(action.state, action.delay)) {
|
|
697
|
-
break;
|
|
698
|
-
}
|
|
699
|
-
} while (action = actions.shift());
|
|
700
|
-
this.active = false;
|
|
701
|
-
if (error) {
|
|
702
|
-
while (action = actions.shift()) {
|
|
703
|
-
action.unsubscribe();
|
|
704
|
-
}
|
|
705
|
-
throw error;
|
|
706
|
-
}
|
|
707
|
-
}
|
|
708
|
-
}
|
|
709
|
-
|
|
710
|
-
const EMPTY = new Observable(subscriber => subscriber.complete());
|
|
711
|
-
function empty$1(scheduler) {
|
|
712
|
-
return scheduler ? emptyScheduled(scheduler) : EMPTY;
|
|
713
|
-
}
|
|
714
|
-
function emptyScheduled(scheduler) {
|
|
715
|
-
return new Observable(subscriber => scheduler.schedule(() => subscriber.complete()));
|
|
716
|
-
}
|
|
717
|
-
|
|
718
|
-
function isScheduler(value) {
|
|
719
|
-
return value && typeof value.schedule === 'function';
|
|
720
|
-
}
|
|
721
|
-
|
|
722
|
-
const subscribeToArray = (array) => (subscriber) => {
|
|
723
|
-
for (let i = 0, len = array.length; i < len && !subscriber.closed; i++) {
|
|
724
|
-
subscriber.next(array[i]);
|
|
725
|
-
}
|
|
726
|
-
subscriber.complete();
|
|
727
|
-
};
|
|
728
|
-
|
|
729
|
-
function scheduleArray(input, scheduler) {
|
|
730
|
-
return new Observable(subscriber => {
|
|
731
|
-
const sub = new Subscription();
|
|
732
|
-
let i = 0;
|
|
733
|
-
sub.add(scheduler.schedule(function () {
|
|
734
|
-
if (i === input.length) {
|
|
735
|
-
subscriber.complete();
|
|
736
|
-
return;
|
|
737
|
-
}
|
|
738
|
-
subscriber.next(input[i++]);
|
|
739
|
-
if (!subscriber.closed) {
|
|
740
|
-
sub.add(this.schedule());
|
|
741
|
-
}
|
|
742
|
-
}));
|
|
743
|
-
return sub;
|
|
744
|
-
});
|
|
745
|
-
}
|
|
746
|
-
|
|
747
|
-
function fromArray(input, scheduler) {
|
|
748
|
-
if (!scheduler) {
|
|
749
|
-
return new Observable(subscribeToArray(input));
|
|
750
|
-
}
|
|
751
|
-
else {
|
|
752
|
-
return scheduleArray(input, scheduler);
|
|
753
|
-
}
|
|
754
|
-
}
|
|
755
|
-
|
|
756
|
-
function of(...args) {
|
|
757
|
-
let scheduler = args[args.length - 1];
|
|
758
|
-
if (isScheduler(scheduler)) {
|
|
759
|
-
args.pop();
|
|
760
|
-
return scheduleArray(args, scheduler);
|
|
761
|
-
}
|
|
762
|
-
else {
|
|
763
|
-
return fromArray(args);
|
|
764
|
-
}
|
|
765
|
-
}
|
|
766
|
-
|
|
767
|
-
function throwError(error, scheduler) {
|
|
768
|
-
if (!scheduler) {
|
|
769
|
-
return new Observable(subscriber => subscriber.error(error));
|
|
770
|
-
}
|
|
771
|
-
else {
|
|
772
|
-
return new Observable(subscriber => scheduler.schedule(dispatch, 0, { error, subscriber }));
|
|
773
|
-
}
|
|
774
|
-
}
|
|
775
|
-
function dispatch({ error, subscriber }) {
|
|
776
|
-
subscriber.error(error);
|
|
777
|
-
}
|
|
778
|
-
|
|
779
|
-
var NotificationKind;
|
|
780
|
-
(function (NotificationKind) {
|
|
781
|
-
NotificationKind["NEXT"] = "N";
|
|
782
|
-
NotificationKind["ERROR"] = "E";
|
|
783
|
-
NotificationKind["COMPLETE"] = "C";
|
|
784
|
-
})(NotificationKind || (NotificationKind = {}));
|
|
785
|
-
class Notification {
|
|
786
|
-
constructor(kind, value, error) {
|
|
787
|
-
this.kind = kind;
|
|
788
|
-
this.value = value;
|
|
789
|
-
this.error = error;
|
|
790
|
-
this.hasValue = kind === 'N';
|
|
791
|
-
}
|
|
792
|
-
observe(observer) {
|
|
793
|
-
switch (this.kind) {
|
|
794
|
-
case 'N':
|
|
795
|
-
return observer.next && observer.next(this.value);
|
|
796
|
-
case 'E':
|
|
797
|
-
return observer.error && observer.error(this.error);
|
|
798
|
-
case 'C':
|
|
799
|
-
return observer.complete && observer.complete();
|
|
800
|
-
}
|
|
801
|
-
}
|
|
802
|
-
do(next, error, complete) {
|
|
803
|
-
const kind = this.kind;
|
|
804
|
-
switch (kind) {
|
|
805
|
-
case 'N':
|
|
806
|
-
return next && next(this.value);
|
|
807
|
-
case 'E':
|
|
808
|
-
return error && error(this.error);
|
|
809
|
-
case 'C':
|
|
810
|
-
return complete && complete();
|
|
811
|
-
}
|
|
812
|
-
}
|
|
813
|
-
accept(nextOrObserver, error, complete) {
|
|
814
|
-
if (nextOrObserver && typeof nextOrObserver.next === 'function') {
|
|
815
|
-
return this.observe(nextOrObserver);
|
|
816
|
-
}
|
|
817
|
-
else {
|
|
818
|
-
return this.do(nextOrObserver, error, complete);
|
|
819
|
-
}
|
|
820
|
-
}
|
|
821
|
-
toObservable() {
|
|
822
|
-
const kind = this.kind;
|
|
823
|
-
switch (kind) {
|
|
824
|
-
case 'N':
|
|
825
|
-
return of(this.value);
|
|
826
|
-
case 'E':
|
|
827
|
-
return throwError(this.error);
|
|
828
|
-
case 'C':
|
|
829
|
-
return empty$1();
|
|
830
|
-
}
|
|
831
|
-
throw new Error('unexpected notification kind value');
|
|
832
|
-
}
|
|
833
|
-
static createNext(value) {
|
|
834
|
-
if (typeof value !== 'undefined') {
|
|
835
|
-
return new Notification('N', value);
|
|
836
|
-
}
|
|
837
|
-
return Notification.undefinedValueNotification;
|
|
838
|
-
}
|
|
839
|
-
static createError(err) {
|
|
840
|
-
return new Notification('E', undefined, err);
|
|
841
|
-
}
|
|
842
|
-
static createComplete() {
|
|
843
|
-
return Notification.completeNotification;
|
|
844
|
-
}
|
|
845
|
-
}
|
|
846
|
-
Notification.completeNotification = new Notification('C');
|
|
847
|
-
Notification.undefinedValueNotification = new Notification('N', undefined);
|
|
848
|
-
|
|
849
|
-
const asyncScheduler = new AsyncScheduler(AsyncAction);
|
|
850
|
-
const async = asyncScheduler;
|
|
851
|
-
|
|
852
|
-
function isDate(value) {
|
|
853
|
-
return value instanceof Date && !isNaN(+value);
|
|
854
|
-
}
|
|
855
|
-
|
|
856
|
-
function delay(delay, scheduler = async) {
|
|
857
|
-
const absoluteDelay = isDate(delay);
|
|
858
|
-
const delayFor = absoluteDelay ? (+delay - scheduler.now()) : Math.abs(delay);
|
|
859
|
-
return (source) => source.lift(new DelayOperator(delayFor, scheduler));
|
|
860
|
-
}
|
|
861
|
-
class DelayOperator {
|
|
862
|
-
constructor(delay, scheduler) {
|
|
863
|
-
this.delay = delay;
|
|
864
|
-
this.scheduler = scheduler;
|
|
865
|
-
}
|
|
866
|
-
call(subscriber, source) {
|
|
867
|
-
return source.subscribe(new DelaySubscriber(subscriber, this.delay, this.scheduler));
|
|
868
|
-
}
|
|
869
|
-
}
|
|
870
|
-
class DelaySubscriber extends Subscriber {
|
|
871
|
-
constructor(destination, delay, scheduler) {
|
|
872
|
-
super(destination);
|
|
873
|
-
this.delay = delay;
|
|
874
|
-
this.scheduler = scheduler;
|
|
875
|
-
this.queue = [];
|
|
876
|
-
this.active = false;
|
|
877
|
-
this.errored = false;
|
|
878
|
-
}
|
|
879
|
-
static dispatch(state) {
|
|
880
|
-
const source = state.source;
|
|
881
|
-
const queue = source.queue;
|
|
882
|
-
const scheduler = state.scheduler;
|
|
883
|
-
const destination = state.destination;
|
|
884
|
-
while (queue.length > 0 && (queue[0].time - scheduler.now()) <= 0) {
|
|
885
|
-
queue.shift().notification.observe(destination);
|
|
886
|
-
}
|
|
887
|
-
if (queue.length > 0) {
|
|
888
|
-
const delay = Math.max(0, queue[0].time - scheduler.now());
|
|
889
|
-
this.schedule(state, delay);
|
|
890
|
-
}
|
|
891
|
-
else {
|
|
892
|
-
this.unsubscribe();
|
|
893
|
-
source.active = false;
|
|
894
|
-
}
|
|
895
|
-
}
|
|
896
|
-
_schedule(scheduler) {
|
|
897
|
-
this.active = true;
|
|
898
|
-
const destination = this.destination;
|
|
899
|
-
destination.add(scheduler.schedule(DelaySubscriber.dispatch, this.delay, {
|
|
900
|
-
source: this, destination: this.destination, scheduler: scheduler
|
|
901
|
-
}));
|
|
902
|
-
}
|
|
903
|
-
scheduleNotification(notification) {
|
|
904
|
-
if (this.errored === true) {
|
|
905
|
-
return;
|
|
906
|
-
}
|
|
907
|
-
const scheduler = this.scheduler;
|
|
908
|
-
const message = new DelayMessage(scheduler.now() + this.delay, notification);
|
|
909
|
-
this.queue.push(message);
|
|
910
|
-
if (this.active === false) {
|
|
911
|
-
this._schedule(scheduler);
|
|
912
|
-
}
|
|
913
|
-
}
|
|
914
|
-
_next(value) {
|
|
915
|
-
this.scheduleNotification(Notification.createNext(value));
|
|
916
|
-
}
|
|
917
|
-
_error(err) {
|
|
918
|
-
this.errored = true;
|
|
919
|
-
this.queue = [];
|
|
920
|
-
this.destination.error(err);
|
|
921
|
-
this.unsubscribe();
|
|
922
|
-
}
|
|
923
|
-
_complete() {
|
|
924
|
-
this.scheduleNotification(Notification.createComplete());
|
|
925
|
-
this.unsubscribe();
|
|
926
|
-
}
|
|
927
|
-
}
|
|
928
|
-
class DelayMessage {
|
|
929
|
-
constructor(time, notification) {
|
|
930
|
-
this.time = time;
|
|
931
|
-
this.notification = notification;
|
|
932
|
-
}
|
|
933
|
-
}
|
|
934
|
-
|
|
935
|
-
export { AsyncAction as A, Notification as N, Observable as O, Subscription as S, Subscriber as a, AsyncScheduler as b, scheduleArray as c, of as d, empty$1 as e, delay as f, isArray as g, hostReportError as h, isObject as i, isFunction as j, async as k, isScheduler as l, observable as o, rxSubscriber as r, subscribeToArray as s };
|