@haiilo/catalyst 0.3.2 → 0.5.1
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/catalyst/app-globals-23d8c4a8.js +948 -0
- package/dist/catalyst/app-globals-23d8c4a8.js.map +1 -0
- package/dist/catalyst/app-globals-3dd6a26b.js +948 -0
- package/dist/catalyst/app-globals-3dd6a26b.js.map +1 -0
- package/dist/catalyst/app-globals-42ce39cc.js +948 -0
- package/dist/catalyst/app-globals-42ce39cc.js.map +1 -0
- package/dist/catalyst/app-globals-5cf43b57.js +949 -0
- package/dist/catalyst/app-globals-5cf43b57.js.map +1 -0
- package/dist/catalyst/app-globals-8598c768.js +948 -0
- package/dist/catalyst/app-globals-8598c768.js.map +1 -0
- package/dist/catalyst/app-globals-a41af143.js +948 -0
- package/dist/catalyst/app-globals-a41af143.js.map +1 -0
- package/dist/catalyst/app-globals-c6a8b994.js +949 -0
- package/dist/catalyst/app-globals-c6a8b994.js.map +1 -0
- package/dist/catalyst/cat-alert.entry.js +33 -0
- package/dist/catalyst/cat-alert.entry.js.map +1 -0
- package/dist/catalyst/cat-badge.entry.js +44 -0
- package/dist/catalyst/cat-badge.entry.js.map +1 -0
- package/dist/catalyst/cat-button.entry.js +298 -0
- package/dist/catalyst/cat-button.entry.js.map +1 -0
- package/dist/catalyst/cat-card.entry.js +17 -0
- package/dist/catalyst/cat-card.entry.js.map +1 -0
- package/dist/catalyst/cat-checkbox.entry.js +75 -0
- package/dist/catalyst/cat-checkbox.entry.js.map +1 -0
- package/dist/catalyst/cat-i18n-registry-2a6187c9.js +75 -0
- package/dist/catalyst/cat-i18n-registry-2a6187c9.js.map +1 -0
- package/dist/catalyst/cat-i18n-registry-330db605.js +74 -0
- package/dist/catalyst/cat-i18n-registry-330db605.js.map +1 -0
- package/dist/catalyst/cat-i18n-registry-83d20604.js +74 -0
- package/dist/catalyst/cat-i18n-registry-83d20604.js.map +1 -0
- package/dist/catalyst/cat-i18n-registry-dd55821d.js +73 -0
- package/dist/catalyst/cat-i18n-registry-dd55821d.js.map +1 -0
- package/dist/catalyst/cat-i18n-registry-f6560651.js +75 -0
- package/dist/catalyst/cat-i18n-registry-f6560651.js.map +1 -0
- package/dist/{esm/cat-icon-registry-59da2e37.js → catalyst/cat-icon-registry-2dcfc9fb.js} +16 -2
- package/dist/catalyst/cat-icon-registry-2dcfc9fb.js.map +1 -0
- package/dist/catalyst/cat-icon.entry.js +31 -0
- package/dist/catalyst/cat-icon.entry.js.map +1 -0
- package/dist/catalyst/cat-input.entry.js +111 -0
- package/dist/catalyst/cat-input.entry.js.map +1 -0
- package/dist/catalyst/cat-menu.entry.js +850 -0
- package/dist/catalyst/cat-menu.entry.js.map +1 -0
- package/dist/catalyst/cat-radio.entry.js +66 -0
- package/dist/catalyst/cat-radio.entry.js.map +1 -0
- package/dist/catalyst/cat-scrollable.entry.js +4522 -0
- package/dist/catalyst/cat-scrollable.entry.js.map +1 -0
- package/dist/catalyst/cat-skeleton.entry.js +55 -0
- package/dist/catalyst/cat-skeleton.entry.js.map +1 -0
- package/dist/catalyst/cat-spinner.entry.js +23 -0
- package/dist/catalyst/cat-spinner.entry.js.map +1 -0
- package/dist/catalyst/cat-textarea.entry.js +87 -0
- package/dist/catalyst/cat-textarea.entry.js.map +1 -0
- package/dist/catalyst/cat-toggle.entry.js +66 -0
- package/dist/catalyst/cat-toggle.entry.js.map +1 -0
- package/dist/catalyst/cat-tooltip.entry.js +129 -0
- package/dist/catalyst/cat-tooltip.entry.js.map +1 -0
- package/dist/catalyst/catalyst.css +2033 -1
- package/dist/catalyst/catalyst.esm.js +133 -1
- package/dist/catalyst/catalyst.esm.js.map +1 -1
- package/dist/catalyst/css-shim-e6dd2538.js +6 -0
- package/dist/catalyst/css-shim-e6dd2538.js.map +1 -0
- package/dist/catalyst/dom-7fc649b0.js +75 -0
- package/dist/catalyst/dom-7fc649b0.js.map +1 -0
- package/dist/catalyst/first-tabbable-2d9f9e9a.js +2123 -0
- package/dist/catalyst/first-tabbable-2d9f9e9a.js.map +1 -0
- package/dist/catalyst/index-471d4e05.js +3059 -0
- package/dist/catalyst/index-471d4e05.js.map +1 -0
- package/dist/catalyst/index-bbb694f5.js +3059 -0
- package/dist/catalyst/index-bbb694f5.js.map +1 -0
- package/dist/catalyst/index.esm.js +4 -1
- package/dist/catalyst/index.esm.js.map +1 -1
- package/dist/catalyst/loglevel-7f0f71af.js +346 -0
- package/dist/catalyst/loglevel-7f0f71af.js.map +1 -0
- package/dist/catalyst/shadow-css-4d56fa31.js +390 -0
- package/dist/catalyst/shadow-css-4d56fa31.js.map +1 -0
- package/dist/cjs/app-globals-aaefc070.js +950 -0
- package/dist/cjs/app-globals-aaefc070.js.map +1 -0
- package/dist/cjs/cat-alert.cjs.entry.js +37 -0
- package/dist/cjs/cat-alert.cjs.entry.js.map +1 -0
- package/dist/cjs/cat-badge.cjs.entry.js +48 -0
- package/dist/cjs/cat-badge.cjs.entry.js.map +1 -0
- package/dist/cjs/cat-button.cjs.entry.js +302 -0
- package/dist/cjs/cat-button.cjs.entry.js.map +1 -0
- package/dist/cjs/cat-card.cjs.entry.js +21 -0
- package/dist/cjs/cat-card.cjs.entry.js.map +1 -0
- package/dist/cjs/cat-checkbox.cjs.entry.js +79 -0
- package/dist/cjs/cat-checkbox.cjs.entry.js.map +1 -0
- package/dist/cjs/cat-i18n-registry-a1379d1e.js +76 -0
- package/dist/cjs/cat-i18n-registry-a1379d1e.js.map +1 -0
- package/dist/cjs/{cat-icon-registry-850c538c.js → cat-icon-registry-74247389.js} +16 -2
- package/dist/cjs/cat-icon-registry-74247389.js.map +1 -0
- package/dist/cjs/cat-icon.cjs.entry.js +35 -0
- package/dist/cjs/cat-icon.cjs.entry.js.map +1 -0
- package/dist/cjs/cat-input.cjs.entry.js +115 -0
- package/dist/cjs/cat-input.cjs.entry.js.map +1 -0
- package/dist/cjs/cat-menu.cjs.entry.js +854 -0
- package/dist/cjs/cat-menu.cjs.entry.js.map +1 -0
- package/dist/cjs/cat-radio.cjs.entry.js +70 -0
- package/dist/cjs/cat-radio.cjs.entry.js.map +1 -0
- package/dist/cjs/cat-scrollable.cjs.entry.js +4526 -0
- package/dist/cjs/cat-scrollable.cjs.entry.js.map +1 -0
- package/dist/cjs/cat-skeleton.cjs.entry.js +59 -0
- package/dist/cjs/cat-skeleton.cjs.entry.js.map +1 -0
- package/dist/cjs/cat-spinner.cjs.entry.js +27 -0
- package/dist/cjs/cat-spinner.cjs.entry.js.map +1 -0
- package/dist/cjs/cat-textarea.cjs.entry.js +91 -0
- package/dist/cjs/cat-textarea.cjs.entry.js.map +1 -0
- package/dist/cjs/cat-toggle.cjs.entry.js +70 -0
- package/dist/cjs/cat-toggle.cjs.entry.js.map +1 -0
- package/dist/cjs/cat-tooltip.cjs.entry.js +133 -0
- package/dist/cjs/cat-tooltip.cjs.entry.js.map +1 -0
- package/dist/cjs/catalyst.cjs.js +118 -6
- package/dist/cjs/catalyst.cjs.js.map +1 -1
- package/dist/cjs/css-shim-6ca600c2.js +8 -0
- package/dist/cjs/css-shim-6ca600c2.js.map +1 -0
- package/dist/cjs/dom-8d415461.js +77 -0
- package/dist/cjs/dom-8d415461.js.map +1 -0
- package/dist/cjs/first-tabbable-2068dcc6.js +2133 -0
- package/dist/cjs/first-tabbable-2068dcc6.js.map +1 -0
- package/dist/cjs/index-abcb3941.js +3094 -0
- package/dist/cjs/index-abcb3941.js.map +1 -0
- package/dist/cjs/index.cjs.js +4 -1
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +20 -4
- package/dist/cjs/loader.cjs.js.map +1 -1
- package/dist/cjs/loglevel-24040e9d.js +348 -0
- package/dist/cjs/loglevel-24040e9d.js.map +1 -0
- package/dist/cjs/shadow-css-78860e39.js +392 -0
- package/dist/cjs/shadow-css-78860e39.js.map +1 -0
- package/dist/collection/collection-manifest.json +8 -1
- package/dist/collection/components/cat-alert/cat-alert.css +11 -6
- package/dist/collection/components/cat-alert/cat-alert.js +19 -8
- package/dist/collection/components/cat-alert/cat-alert.js.map +1 -1
- package/dist/collection/components/cat-badge/cat-badge.css +17 -17
- package/dist/collection/components/cat-badge/cat-badge.js +9 -8
- package/dist/collection/components/cat-badge/cat-badge.js.map +1 -1
- package/dist/collection/components/cat-button/cat-button.css +18 -8
- package/dist/collection/components/cat-button/cat-button.js +32 -8
- package/dist/collection/components/cat-button/cat-button.js.map +1 -1
- package/dist/collection/components/cat-card/cat-card.css +25 -0
- package/dist/collection/components/cat-card/cat-card.js +20 -0
- package/dist/collection/components/cat-card/cat-card.js.map +1 -0
- package/dist/collection/components/cat-checkbox/cat-checkbox.css +105 -0
- package/dist/collection/components/cat-checkbox/cat-checkbox.js +314 -0
- package/dist/collection/components/cat-checkbox/cat-checkbox.js.map +1 -0
- package/dist/collection/components/cat-i18n/cat-i18n-registry.js +70 -0
- package/dist/collection/components/cat-i18n/cat-i18n-registry.js.map +1 -0
- package/dist/collection/components/cat-icon/cat-icon-registry.js +14 -1
- package/dist/collection/components/cat-icon/cat-icon-registry.js.map +1 -1
- package/dist/collection/components/cat-icon/cat-icon.css +5 -5
- package/dist/collection/components/cat-icon/cat-icon.js +3 -2
- package/dist/collection/components/cat-icon/cat-icon.js.map +1 -1
- package/dist/collection/components/cat-input/cat-input.css +131 -0
- package/dist/collection/components/cat-input/cat-input.js +606 -0
- package/dist/collection/components/cat-input/cat-input.js.map +1 -0
- package/dist/collection/components/cat-menu/cat-menu.css +2 -1
- package/dist/collection/components/cat-menu/cat-menu.js +3 -5
- package/dist/collection/components/cat-menu/cat-menu.js.map +1 -1
- package/dist/collection/components/cat-radio/cat-radio.css +84 -0
- package/dist/collection/components/cat-radio/cat-radio.js +283 -0
- package/dist/collection/components/cat-radio/cat-radio.js.map +1 -0
- package/dist/collection/components/cat-scrollable/cat-scrollable.js +4 -2
- package/dist/collection/components/cat-scrollable/cat-scrollable.js.map +1 -1
- package/dist/collection/components/cat-skeleton/cat-skeleton.css +30 -30
- package/dist/collection/components/cat-skeleton/cat-skeleton.js +4 -4
- package/dist/collection/components/cat-skeleton/cat-skeleton.js.map +1 -1
- package/dist/collection/components/cat-spinner/cat-spinner.css +7 -7
- package/dist/collection/components/cat-spinner/cat-spinner.js +1 -1
- package/dist/collection/components/cat-spinner/cat-spinner.js.map +1 -1
- package/dist/collection/components/cat-textarea/cat-textarea.css +74 -0
- package/dist/collection/components/cat-textarea/cat-textarea.js +393 -0
- package/dist/collection/components/cat-textarea/cat-textarea.js.map +1 -0
- package/dist/collection/components/cat-toggle/cat-toggle.css +93 -0
- package/dist/collection/components/cat-toggle/cat-toggle.js +283 -0
- package/dist/collection/components/cat-toggle/cat-toggle.js.map +1 -0
- package/dist/collection/components/cat-tooltip/cat-tooltip.css +41 -0
- package/dist/collection/components/cat-tooltip/cat-tooltip.js +254 -0
- package/dist/collection/components/cat-tooltip/cat-tooltip.js.map +1 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/index.js.map +1 -1
- package/dist/collection/init.js +9 -1
- package/dist/collection/init.js.map +1 -1
- package/dist/collection/utils/first-tabbable.js +6 -0
- package/dist/collection/utils/first-tabbable.js.map +1 -0
- package/dist/collection/utils/is-touch-screen.js +3 -0
- package/dist/collection/utils/is-touch-screen.js.map +1 -0
- package/dist/components/cat-alert.js +15 -6
- package/dist/components/cat-alert.js.map +1 -1
- package/dist/components/cat-badge.js +7 -7
- package/dist/components/cat-badge.js.map +1 -1
- package/dist/components/cat-button.js +1 -647
- package/dist/components/cat-button.js.map +1 -1
- package/dist/components/cat-button2.js +346 -0
- package/dist/components/cat-button2.js.map +1 -0
- package/dist/components/cat-card.d.ts +11 -0
- package/dist/components/cat-card.js +35 -0
- package/dist/components/cat-card.js.map +1 -0
- package/dist/components/cat-checkbox.d.ts +11 -0
- package/dist/components/cat-checkbox.js +103 -0
- package/dist/components/cat-checkbox.js.map +1 -0
- package/dist/components/cat-i18n-registry.js +74 -0
- package/dist/components/cat-i18n-registry.js.map +1 -0
- package/dist/components/cat-icon-registry.js +15 -1
- package/dist/components/cat-icon-registry.js.map +1 -1
- package/dist/components/cat-icon2.js +3 -2
- package/dist/components/cat-icon2.js.map +1 -1
- package/dist/components/cat-input.d.ts +11 -0
- package/dist/components/cat-input.js +172 -0
- package/dist/components/cat-input.js.map +1 -0
- package/dist/components/cat-menu.js +12 -1520
- package/dist/components/cat-menu.js.map +1 -1
- package/dist/components/cat-radio.d.ts +11 -0
- package/dist/components/cat-radio.js +93 -0
- package/dist/components/cat-radio.js.map +1 -0
- package/dist/components/cat-scrollable.js +3210 -25
- package/dist/components/cat-scrollable.js.map +1 -1
- package/dist/components/cat-skeleton.js +5 -5
- package/dist/components/cat-skeleton.js.map +1 -1
- package/dist/components/cat-spinner2.js +2 -2
- package/dist/components/cat-spinner2.js.map +1 -1
- package/dist/components/cat-textarea.d.ts +11 -0
- package/dist/components/cat-textarea.js +119 -0
- package/dist/components/cat-textarea.js.map +1 -0
- package/dist/components/cat-toggle.d.ts +11 -0
- package/dist/components/cat-toggle.js +93 -0
- package/dist/components/cat-toggle.js.map +1 -0
- package/dist/components/cat-tooltip.d.ts +11 -0
- package/dist/components/cat-tooltip.js +154 -0
- package/dist/components/cat-tooltip.js.map +1 -0
- package/dist/components/first-tabbable.js +2123 -0
- package/dist/components/first-tabbable.js.map +1 -0
- package/dist/components/index.js +778 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/loglevel.js +346 -0
- package/dist/components/loglevel.js.map +1 -0
- package/dist/esm/app-globals-3dd6a26b.js +948 -0
- package/dist/esm/app-globals-3dd6a26b.js.map +1 -0
- package/dist/esm/cat-alert.entry.js +33 -0
- package/dist/esm/cat-alert.entry.js.map +1 -0
- package/dist/esm/cat-badge.entry.js +44 -0
- package/dist/esm/cat-badge.entry.js.map +1 -0
- package/dist/esm/cat-button.entry.js +298 -0
- package/dist/esm/cat-button.entry.js.map +1 -0
- package/dist/esm/cat-card.entry.js +17 -0
- package/dist/esm/cat-card.entry.js.map +1 -0
- package/dist/esm/cat-checkbox.entry.js +75 -0
- package/dist/esm/cat-checkbox.entry.js.map +1 -0
- package/dist/esm/cat-i18n-registry-83d20604.js +74 -0
- package/dist/esm/cat-i18n-registry-83d20604.js.map +1 -0
- package/dist/esm/cat-icon-registry-2dcfc9fb.js +59 -0
- package/dist/esm/cat-icon-registry-2dcfc9fb.js.map +1 -0
- package/dist/esm/cat-icon.entry.js +31 -0
- package/dist/esm/cat-icon.entry.js.map +1 -0
- package/dist/esm/cat-input.entry.js +111 -0
- package/dist/esm/cat-input.entry.js.map +1 -0
- package/dist/esm/cat-menu.entry.js +850 -0
- package/dist/esm/cat-menu.entry.js.map +1 -0
- package/dist/esm/cat-radio.entry.js +66 -0
- package/dist/esm/cat-radio.entry.js.map +1 -0
- package/dist/esm/cat-scrollable.entry.js +4522 -0
- package/dist/esm/cat-scrollable.entry.js.map +1 -0
- package/dist/esm/cat-skeleton.entry.js +55 -0
- package/dist/esm/cat-skeleton.entry.js.map +1 -0
- package/dist/esm/cat-spinner.entry.js +23 -0
- package/dist/esm/cat-spinner.entry.js.map +1 -0
- package/dist/esm/cat-textarea.entry.js +87 -0
- package/dist/esm/cat-textarea.entry.js.map +1 -0
- package/dist/esm/cat-toggle.entry.js +66 -0
- package/dist/esm/cat-toggle.entry.js.map +1 -0
- package/dist/esm/cat-tooltip.entry.js +129 -0
- package/dist/esm/cat-tooltip.entry.js.map +1 -0
- package/dist/esm/catalyst.js +118 -6
- package/dist/esm/catalyst.js.map +1 -1
- package/dist/esm/css-shim-e6dd2538.js +6 -0
- package/dist/esm/css-shim-e6dd2538.js.map +1 -0
- package/dist/esm/dom-7fc649b0.js +75 -0
- package/dist/esm/dom-7fc649b0.js.map +1 -0
- package/dist/esm/first-tabbable-2d9f9e9a.js +2123 -0
- package/dist/esm/first-tabbable-2d9f9e9a.js.map +1 -0
- package/dist/esm/index-471d4e05.js +3059 -0
- package/dist/esm/index-471d4e05.js.map +1 -0
- package/dist/esm/index.js +3 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +20 -4
- package/dist/esm/loader.js.map +1 -1
- package/dist/esm/loglevel-7f0f71af.js +346 -0
- package/dist/esm/loglevel-7f0f71af.js.map +1 -0
- package/dist/esm/shadow-css-4d56fa31.js +390 -0
- package/dist/esm/shadow-css-4d56fa31.js.map +1 -0
- package/dist/types/components/cat-alert/cat-alert.d.ts +4 -2
- package/dist/types/components/cat-alert/cat-alert.e2e.d.ts +1 -0
- package/dist/types/components/cat-alert/cat-alert.spec.d.ts +1 -0
- package/dist/types/components/cat-badge/cat-badge.d.ts +3 -2
- package/dist/types/components/cat-badge/cat-badge.e2e.d.ts +1 -0
- package/dist/types/components/cat-badge/cat-badge.spec.d.ts +1 -0
- package/dist/types/components/cat-button/cat-button.d.ts +8 -3
- package/dist/types/components/cat-button/cat-button.e2e.d.ts +1 -0
- package/dist/types/components/cat-button/cat-button.spec.d.ts +1 -0
- package/dist/types/components/cat-card/cat-card.d.ts +7 -0
- package/dist/types/components/cat-card/cat-card.e2e.d.ts +1 -0
- package/dist/types/components/cat-card/cat-card.spec.d.ts +1 -0
- package/dist/types/components/cat-checkbox/cat-checkbox.d.ts +69 -0
- package/dist/types/components/cat-checkbox/cat-checkbox.e2e.d.ts +1 -0
- package/dist/types/components/cat-checkbox/cat-checkbox.spec.d.ts +1 -0
- package/dist/types/components/cat-i18n/cat-i18n-registry.d.ts +18 -0
- package/dist/types/components/cat-icon/cat-icon-registry.d.ts +4 -4
- package/dist/types/components/cat-icon/cat-icon.d.ts +1 -1
- package/dist/types/components/cat-icon/cat-icon.e2e.d.ts +1 -0
- package/dist/types/components/cat-icon/cat-icon.spec.d.ts +1 -0
- package/dist/types/components/cat-input/cat-input.d.ts +130 -0
- package/dist/types/components/cat-input/cat-input.e2e.d.ts +1 -0
- package/dist/types/components/cat-input/cat-input.spec.d.ts +1 -0
- package/dist/types/components/cat-menu/cat-menu.d.ts +0 -1
- package/dist/types/components/cat-menu/cat-menu.e2e.d.ts +1 -0
- package/dist/types/components/cat-menu/cat-menu.spec.d.ts +1 -0
- package/dist/types/components/cat-radio/cat-radio.d.ts +63 -0
- package/dist/types/components/cat-radio/cat-radio.e2e.d.ts +1 -0
- package/dist/types/components/cat-radio/cat-radio.spec.d.ts +1 -0
- package/dist/types/components/cat-scrollable/cat-scrollable.d.ts +3 -1
- package/dist/types/components/cat-scrollable/cat-scrollable.e2e.d.ts +1 -0
- package/dist/types/components/cat-scrollable/cat-scrollable.spec.d.ts +1 -0
- package/dist/types/components/cat-skeleton/cat-skeleton.e2e.d.ts +1 -0
- package/dist/types/components/cat-skeleton/cat-skeleton.spec.d.ts +1 -0
- package/dist/types/components/cat-spinner/cat-spinner.e2e.d.ts +1 -0
- package/dist/types/components/cat-spinner/cat-spinner.spec.d.ts +1 -0
- package/dist/types/components/cat-textarea/cat-textarea.d.ts +85 -0
- package/dist/types/components/cat-textarea/cat-textarea.e2e.d.ts +1 -0
- package/dist/types/components/cat-textarea/cat-textarea.spec.d.ts +1 -0
- package/dist/types/components/cat-toggle/cat-toggle.d.ts +64 -0
- package/dist/types/components/cat-toggle/cat-toggle.e2e.d.ts +1 -0
- package/dist/types/components/cat-toggle/cat-toggle.spec.d.ts +1 -0
- package/dist/types/components/cat-tooltip/cat-tooltip.d.ts +46 -0
- package/dist/types/components/cat-tooltip/cat-tooltip.e2e.d.ts +1 -0
- package/dist/types/components/cat-tooltip/cat-tooltip.spec.d.ts +1 -0
- package/dist/types/components.d.ts +680 -4
- package/dist/types/index.d.ts +1 -0
- package/dist/types/utils/first-tabbable.d.ts +4 -0
- package/dist/types/utils/is-touch-screen.d.ts +2 -0
- package/dist/types/utils/media-matcher.spec.d.ts +1 -0
- package/package.json +9 -7
- package/dist/catalyst/p-31b500c7.entry.js +0 -10
- package/dist/catalyst/p-31b500c7.entry.js.map +0 -1
- package/dist/catalyst/p-ed826597.js +0 -2
- package/dist/catalyst/p-ed826597.js.map +0 -1
- package/dist/catalyst/p-ef0a8ae9.js +0 -2
- package/dist/catalyst/p-ef0a8ae9.js.map +0 -1
- package/dist/catalyst/p-f151cb13.js +0 -2
- package/dist/catalyst/p-f151cb13.js.map +0 -1
- package/dist/cjs/app-globals-7f2b1f8e.js +0 -173
- package/dist/cjs/app-globals-7f2b1f8e.js.map +0 -1
- package/dist/cjs/cat-alert_8.cjs.entry.js +0 -4450
- package/dist/cjs/cat-alert_8.cjs.entry.js.map +0 -1
- package/dist/cjs/cat-icon-registry-850c538c.js.map +0 -1
- package/dist/cjs/index-c0881ae0.js +0 -1348
- package/dist/cjs/index-c0881ae0.js.map +0 -1
- package/dist/collection/utils/utils.js +0 -4
- package/dist/collection/utils/utils.js.map +0 -1
- package/dist/esm/app-globals-8af9b2cf.js +0 -171
- package/dist/esm/app-globals-8af9b2cf.js.map +0 -1
- package/dist/esm/cat-alert_8.entry.js +0 -4439
- package/dist/esm/cat-alert_8.entry.js.map +0 -1
- package/dist/esm/cat-icon-registry-59da2e37.js.map +0 -1
- package/dist/esm/index-0ff35bca.js +0 -1320
- package/dist/esm/index-0ff35bca.js.map +0 -1
- package/dist/types/utils/utils.d.ts +0 -1
|
@@ -200,11 +200,32 @@ function createNotification(kind, value, error) {
|
|
|
200
200
|
};
|
|
201
201
|
}
|
|
202
202
|
|
|
203
|
+
let context = null;
|
|
203
204
|
function errorContext(cb) {
|
|
204
|
-
{
|
|
205
|
+
if (config.useDeprecatedSynchronousErrorHandling) {
|
|
206
|
+
const isRoot = !context;
|
|
207
|
+
if (isRoot) {
|
|
208
|
+
context = { errorThrown: false, error: null };
|
|
209
|
+
}
|
|
210
|
+
cb();
|
|
211
|
+
if (isRoot) {
|
|
212
|
+
const { errorThrown, error } = context;
|
|
213
|
+
context = null;
|
|
214
|
+
if (errorThrown) {
|
|
215
|
+
throw error;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
else {
|
|
205
220
|
cb();
|
|
206
221
|
}
|
|
207
222
|
}
|
|
223
|
+
function captureError(err) {
|
|
224
|
+
if (config.useDeprecatedSynchronousErrorHandling && context) {
|
|
225
|
+
context.errorThrown = true;
|
|
226
|
+
context.error = err;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
208
229
|
|
|
209
230
|
class Subscriber extends Subscription {
|
|
210
231
|
constructor(destination) {
|
|
@@ -351,7 +372,10 @@ class SafeSubscriber extends Subscriber {
|
|
|
351
372
|
}
|
|
352
373
|
}
|
|
353
374
|
function handleUnhandledError(error) {
|
|
354
|
-
{
|
|
375
|
+
if (config.useDeprecatedSynchronousErrorHandling) {
|
|
376
|
+
captureError(error);
|
|
377
|
+
}
|
|
378
|
+
else {
|
|
355
379
|
reportUnhandledError(error);
|
|
356
380
|
}
|
|
357
381
|
}
|
|
@@ -375,6 +399,9 @@ function identity(x) {
|
|
|
375
399
|
return x;
|
|
376
400
|
}
|
|
377
401
|
|
|
402
|
+
function pipe(...fns) {
|
|
403
|
+
return pipeFromArray(fns);
|
|
404
|
+
}
|
|
378
405
|
function pipeFromArray(fns) {
|
|
379
406
|
if (fns.length === 0) {
|
|
380
407
|
return identity;
|
|
@@ -547,6 +574,140 @@ class OperatorSubscriber extends Subscriber {
|
|
|
547
574
|
}
|
|
548
575
|
}
|
|
549
576
|
|
|
577
|
+
function refCount() {
|
|
578
|
+
return operate((source, subscriber) => {
|
|
579
|
+
let connection = null;
|
|
580
|
+
source._refCount++;
|
|
581
|
+
const refCounter = createOperatorSubscriber(subscriber, undefined, undefined, undefined, () => {
|
|
582
|
+
if (!source || source._refCount <= 0 || 0 < --source._refCount) {
|
|
583
|
+
connection = null;
|
|
584
|
+
return;
|
|
585
|
+
}
|
|
586
|
+
const sharedConnection = source._connection;
|
|
587
|
+
const conn = connection;
|
|
588
|
+
connection = null;
|
|
589
|
+
if (sharedConnection && (!conn || sharedConnection === conn)) {
|
|
590
|
+
sharedConnection.unsubscribe();
|
|
591
|
+
}
|
|
592
|
+
subscriber.unsubscribe();
|
|
593
|
+
});
|
|
594
|
+
source.subscribe(refCounter);
|
|
595
|
+
if (!refCounter.closed) {
|
|
596
|
+
connection = source.connect();
|
|
597
|
+
}
|
|
598
|
+
});
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
class ConnectableObservable extends Observable {
|
|
602
|
+
constructor(source, subjectFactory) {
|
|
603
|
+
super();
|
|
604
|
+
this.source = source;
|
|
605
|
+
this.subjectFactory = subjectFactory;
|
|
606
|
+
this._subject = null;
|
|
607
|
+
this._refCount = 0;
|
|
608
|
+
this._connection = null;
|
|
609
|
+
if (hasLift(source)) {
|
|
610
|
+
this.lift = source.lift;
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
_subscribe(subscriber) {
|
|
614
|
+
return this.getSubject().subscribe(subscriber);
|
|
615
|
+
}
|
|
616
|
+
getSubject() {
|
|
617
|
+
const subject = this._subject;
|
|
618
|
+
if (!subject || subject.isStopped) {
|
|
619
|
+
this._subject = this.subjectFactory();
|
|
620
|
+
}
|
|
621
|
+
return this._subject;
|
|
622
|
+
}
|
|
623
|
+
_teardown() {
|
|
624
|
+
this._refCount = 0;
|
|
625
|
+
const { _connection } = this;
|
|
626
|
+
this._subject = this._connection = null;
|
|
627
|
+
_connection === null || _connection === void 0 ? void 0 : _connection.unsubscribe();
|
|
628
|
+
}
|
|
629
|
+
connect() {
|
|
630
|
+
let connection = this._connection;
|
|
631
|
+
if (!connection) {
|
|
632
|
+
connection = this._connection = new Subscription();
|
|
633
|
+
const subject = this.getSubject();
|
|
634
|
+
connection.add(this.source.subscribe(createOperatorSubscriber(subject, undefined, () => {
|
|
635
|
+
this._teardown();
|
|
636
|
+
subject.complete();
|
|
637
|
+
}, (err) => {
|
|
638
|
+
this._teardown();
|
|
639
|
+
subject.error(err);
|
|
640
|
+
}, () => this._teardown())));
|
|
641
|
+
if (connection.closed) {
|
|
642
|
+
this._connection = null;
|
|
643
|
+
connection = Subscription.EMPTY;
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
return connection;
|
|
647
|
+
}
|
|
648
|
+
refCount() {
|
|
649
|
+
return refCount()(this);
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
const performanceTimestampProvider = {
|
|
654
|
+
now() {
|
|
655
|
+
return (performanceTimestampProvider.delegate || performance).now();
|
|
656
|
+
},
|
|
657
|
+
delegate: undefined,
|
|
658
|
+
};
|
|
659
|
+
|
|
660
|
+
const animationFrameProvider = {
|
|
661
|
+
schedule(callback) {
|
|
662
|
+
let request = requestAnimationFrame;
|
|
663
|
+
let cancel = cancelAnimationFrame;
|
|
664
|
+
const { delegate } = animationFrameProvider;
|
|
665
|
+
if (delegate) {
|
|
666
|
+
request = delegate.requestAnimationFrame;
|
|
667
|
+
cancel = delegate.cancelAnimationFrame;
|
|
668
|
+
}
|
|
669
|
+
const handle = request((timestamp) => {
|
|
670
|
+
cancel = undefined;
|
|
671
|
+
callback(timestamp);
|
|
672
|
+
});
|
|
673
|
+
return new Subscription(() => cancel === null || cancel === void 0 ? void 0 : cancel(handle));
|
|
674
|
+
},
|
|
675
|
+
requestAnimationFrame(...args) {
|
|
676
|
+
const { delegate } = animationFrameProvider;
|
|
677
|
+
return ((delegate === null || delegate === void 0 ? void 0 : delegate.requestAnimationFrame) || requestAnimationFrame)(...args);
|
|
678
|
+
},
|
|
679
|
+
cancelAnimationFrame(...args) {
|
|
680
|
+
const { delegate } = animationFrameProvider;
|
|
681
|
+
return ((delegate === null || delegate === void 0 ? void 0 : delegate.cancelAnimationFrame) || cancelAnimationFrame)(...args);
|
|
682
|
+
},
|
|
683
|
+
delegate: undefined,
|
|
684
|
+
};
|
|
685
|
+
|
|
686
|
+
function animationFrames(timestampProvider) {
|
|
687
|
+
return timestampProvider ? animationFramesFactory(timestampProvider) : DEFAULT_ANIMATION_FRAMES;
|
|
688
|
+
}
|
|
689
|
+
function animationFramesFactory(timestampProvider) {
|
|
690
|
+
const { schedule } = animationFrameProvider;
|
|
691
|
+
return new Observable((subscriber) => {
|
|
692
|
+
const subscription = new Subscription();
|
|
693
|
+
const provider = timestampProvider || performanceTimestampProvider;
|
|
694
|
+
const start = provider.now();
|
|
695
|
+
const run = (timestamp) => {
|
|
696
|
+
const now = provider.now();
|
|
697
|
+
subscriber.next({
|
|
698
|
+
timestamp: timestampProvider ? now : timestamp,
|
|
699
|
+
elapsed: now - start,
|
|
700
|
+
});
|
|
701
|
+
if (!subscriber.closed) {
|
|
702
|
+
subscription.add(schedule(run));
|
|
703
|
+
}
|
|
704
|
+
};
|
|
705
|
+
subscription.add(schedule(run));
|
|
706
|
+
return subscription;
|
|
707
|
+
});
|
|
708
|
+
}
|
|
709
|
+
const DEFAULT_ANIMATION_FRAMES = animationFramesFactory();
|
|
710
|
+
|
|
550
711
|
const ObjectUnsubscribedError = createErrorClass((_super) => function ObjectUnsubscribedErrorImpl() {
|
|
551
712
|
_super(this);
|
|
552
713
|
this.name = 'ObjectUnsubscribedError';
|
|
@@ -682,23 +843,555 @@ class AnonymousSubject extends Subject {
|
|
|
682
843
|
}
|
|
683
844
|
}
|
|
684
845
|
|
|
846
|
+
class BehaviorSubject extends Subject {
|
|
847
|
+
constructor(_value) {
|
|
848
|
+
super();
|
|
849
|
+
this._value = _value;
|
|
850
|
+
}
|
|
851
|
+
get value() {
|
|
852
|
+
return this.getValue();
|
|
853
|
+
}
|
|
854
|
+
_subscribe(subscriber) {
|
|
855
|
+
const subscription = super._subscribe(subscriber);
|
|
856
|
+
!subscription.closed && subscriber.next(this._value);
|
|
857
|
+
return subscription;
|
|
858
|
+
}
|
|
859
|
+
getValue() {
|
|
860
|
+
const { hasError, thrownError, _value } = this;
|
|
861
|
+
if (hasError) {
|
|
862
|
+
throw thrownError;
|
|
863
|
+
}
|
|
864
|
+
this._throwIfClosed();
|
|
865
|
+
return _value;
|
|
866
|
+
}
|
|
867
|
+
next(value) {
|
|
868
|
+
super.next((this._value = value));
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
const dateTimestampProvider = {
|
|
873
|
+
now() {
|
|
874
|
+
return (dateTimestampProvider.delegate || Date).now();
|
|
875
|
+
},
|
|
876
|
+
delegate: undefined,
|
|
877
|
+
};
|
|
878
|
+
|
|
879
|
+
class ReplaySubject extends Subject {
|
|
880
|
+
constructor(_bufferSize = Infinity, _windowTime = Infinity, _timestampProvider = dateTimestampProvider) {
|
|
881
|
+
super();
|
|
882
|
+
this._bufferSize = _bufferSize;
|
|
883
|
+
this._windowTime = _windowTime;
|
|
884
|
+
this._timestampProvider = _timestampProvider;
|
|
885
|
+
this._buffer = [];
|
|
886
|
+
this._infiniteTimeWindow = true;
|
|
887
|
+
this._infiniteTimeWindow = _windowTime === Infinity;
|
|
888
|
+
this._bufferSize = Math.max(1, _bufferSize);
|
|
889
|
+
this._windowTime = Math.max(1, _windowTime);
|
|
890
|
+
}
|
|
891
|
+
next(value) {
|
|
892
|
+
const { isStopped, _buffer, _infiniteTimeWindow, _timestampProvider, _windowTime } = this;
|
|
893
|
+
if (!isStopped) {
|
|
894
|
+
_buffer.push(value);
|
|
895
|
+
!_infiniteTimeWindow && _buffer.push(_timestampProvider.now() + _windowTime);
|
|
896
|
+
}
|
|
897
|
+
this._trimBuffer();
|
|
898
|
+
super.next(value);
|
|
899
|
+
}
|
|
900
|
+
_subscribe(subscriber) {
|
|
901
|
+
this._throwIfClosed();
|
|
902
|
+
this._trimBuffer();
|
|
903
|
+
const subscription = this._innerSubscribe(subscriber);
|
|
904
|
+
const { _infiniteTimeWindow, _buffer } = this;
|
|
905
|
+
const copy = _buffer.slice();
|
|
906
|
+
for (let i = 0; i < copy.length && !subscriber.closed; i += _infiniteTimeWindow ? 1 : 2) {
|
|
907
|
+
subscriber.next(copy[i]);
|
|
908
|
+
}
|
|
909
|
+
this._checkFinalizedStatuses(subscriber);
|
|
910
|
+
return subscription;
|
|
911
|
+
}
|
|
912
|
+
_trimBuffer() {
|
|
913
|
+
const { _bufferSize, _timestampProvider, _buffer, _infiniteTimeWindow } = this;
|
|
914
|
+
const adjustedBufferSize = (_infiniteTimeWindow ? 1 : 2) * _bufferSize;
|
|
915
|
+
_bufferSize < Infinity && adjustedBufferSize < _buffer.length && _buffer.splice(0, _buffer.length - adjustedBufferSize);
|
|
916
|
+
if (!_infiniteTimeWindow) {
|
|
917
|
+
const now = _timestampProvider.now();
|
|
918
|
+
let last = 0;
|
|
919
|
+
for (let i = 1; i < _buffer.length && _buffer[i] <= now; i += 2) {
|
|
920
|
+
last = i;
|
|
921
|
+
}
|
|
922
|
+
last && _buffer.splice(0, last + 1);
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
class AsyncSubject extends Subject {
|
|
928
|
+
constructor() {
|
|
929
|
+
super(...arguments);
|
|
930
|
+
this._value = null;
|
|
931
|
+
this._hasValue = false;
|
|
932
|
+
this._isComplete = false;
|
|
933
|
+
}
|
|
934
|
+
_checkFinalizedStatuses(subscriber) {
|
|
935
|
+
const { hasError, _hasValue, _value, thrownError, isStopped, _isComplete } = this;
|
|
936
|
+
if (hasError) {
|
|
937
|
+
subscriber.error(thrownError);
|
|
938
|
+
}
|
|
939
|
+
else if (isStopped || _isComplete) {
|
|
940
|
+
_hasValue && subscriber.next(_value);
|
|
941
|
+
subscriber.complete();
|
|
942
|
+
}
|
|
943
|
+
}
|
|
944
|
+
next(value) {
|
|
945
|
+
if (!this.isStopped) {
|
|
946
|
+
this._value = value;
|
|
947
|
+
this._hasValue = true;
|
|
948
|
+
}
|
|
949
|
+
}
|
|
950
|
+
complete() {
|
|
951
|
+
const { _hasValue, _value, _isComplete } = this;
|
|
952
|
+
if (!_isComplete) {
|
|
953
|
+
this._isComplete = true;
|
|
954
|
+
_hasValue && super.next(_value);
|
|
955
|
+
super.complete();
|
|
956
|
+
}
|
|
957
|
+
}
|
|
958
|
+
}
|
|
959
|
+
|
|
960
|
+
class Action extends Subscription {
|
|
961
|
+
constructor(scheduler, work) {
|
|
962
|
+
super();
|
|
963
|
+
}
|
|
964
|
+
schedule(state, delay = 0) {
|
|
965
|
+
return this;
|
|
966
|
+
}
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
const intervalProvider = {
|
|
970
|
+
setInterval(handler, timeout, ...args) {
|
|
971
|
+
const { delegate } = intervalProvider;
|
|
972
|
+
if (delegate === null || delegate === void 0 ? void 0 : delegate.setInterval) {
|
|
973
|
+
return delegate.setInterval(handler, timeout, ...args);
|
|
974
|
+
}
|
|
975
|
+
return setInterval(handler, timeout, ...args);
|
|
976
|
+
},
|
|
977
|
+
clearInterval(handle) {
|
|
978
|
+
const { delegate } = intervalProvider;
|
|
979
|
+
return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearInterval) || clearInterval)(handle);
|
|
980
|
+
},
|
|
981
|
+
delegate: undefined,
|
|
982
|
+
};
|
|
983
|
+
|
|
984
|
+
class AsyncAction extends Action {
|
|
985
|
+
constructor(scheduler, work) {
|
|
986
|
+
super(scheduler, work);
|
|
987
|
+
this.scheduler = scheduler;
|
|
988
|
+
this.work = work;
|
|
989
|
+
this.pending = false;
|
|
990
|
+
}
|
|
991
|
+
schedule(state, delay = 0) {
|
|
992
|
+
if (this.closed) {
|
|
993
|
+
return this;
|
|
994
|
+
}
|
|
995
|
+
this.state = state;
|
|
996
|
+
const id = this.id;
|
|
997
|
+
const scheduler = this.scheduler;
|
|
998
|
+
if (id != null) {
|
|
999
|
+
this.id = this.recycleAsyncId(scheduler, id, delay);
|
|
1000
|
+
}
|
|
1001
|
+
this.pending = true;
|
|
1002
|
+
this.delay = delay;
|
|
1003
|
+
this.id = this.id || this.requestAsyncId(scheduler, this.id, delay);
|
|
1004
|
+
return this;
|
|
1005
|
+
}
|
|
1006
|
+
requestAsyncId(scheduler, _id, delay = 0) {
|
|
1007
|
+
return intervalProvider.setInterval(scheduler.flush.bind(scheduler, this), delay);
|
|
1008
|
+
}
|
|
1009
|
+
recycleAsyncId(_scheduler, id, delay = 0) {
|
|
1010
|
+
if (delay != null && this.delay === delay && this.pending === false) {
|
|
1011
|
+
return id;
|
|
1012
|
+
}
|
|
1013
|
+
intervalProvider.clearInterval(id);
|
|
1014
|
+
return undefined;
|
|
1015
|
+
}
|
|
1016
|
+
execute(state, delay) {
|
|
1017
|
+
if (this.closed) {
|
|
1018
|
+
return new Error('executing a cancelled action');
|
|
1019
|
+
}
|
|
1020
|
+
this.pending = false;
|
|
1021
|
+
const error = this._execute(state, delay);
|
|
1022
|
+
if (error) {
|
|
1023
|
+
return error;
|
|
1024
|
+
}
|
|
1025
|
+
else if (this.pending === false && this.id != null) {
|
|
1026
|
+
this.id = this.recycleAsyncId(this.scheduler, this.id, null);
|
|
1027
|
+
}
|
|
1028
|
+
}
|
|
1029
|
+
_execute(state, _delay) {
|
|
1030
|
+
let errored = false;
|
|
1031
|
+
let errorValue;
|
|
1032
|
+
try {
|
|
1033
|
+
this.work(state);
|
|
1034
|
+
}
|
|
1035
|
+
catch (e) {
|
|
1036
|
+
errored = true;
|
|
1037
|
+
errorValue = e ? e : new Error('Scheduled action threw falsy error');
|
|
1038
|
+
}
|
|
1039
|
+
if (errored) {
|
|
1040
|
+
this.unsubscribe();
|
|
1041
|
+
return errorValue;
|
|
1042
|
+
}
|
|
1043
|
+
}
|
|
1044
|
+
unsubscribe() {
|
|
1045
|
+
if (!this.closed) {
|
|
1046
|
+
const { id, scheduler } = this;
|
|
1047
|
+
const { actions } = scheduler;
|
|
1048
|
+
this.work = this.state = this.scheduler = null;
|
|
1049
|
+
this.pending = false;
|
|
1050
|
+
arrRemove(actions, this);
|
|
1051
|
+
if (id != null) {
|
|
1052
|
+
this.id = this.recycleAsyncId(scheduler, id, null);
|
|
1053
|
+
}
|
|
1054
|
+
this.delay = null;
|
|
1055
|
+
super.unsubscribe();
|
|
1056
|
+
}
|
|
1057
|
+
}
|
|
1058
|
+
}
|
|
1059
|
+
|
|
1060
|
+
let nextHandle = 1;
|
|
1061
|
+
let resolved;
|
|
1062
|
+
const activeHandles = {};
|
|
1063
|
+
function findAndClearHandle(handle) {
|
|
1064
|
+
if (handle in activeHandles) {
|
|
1065
|
+
delete activeHandles[handle];
|
|
1066
|
+
return true;
|
|
1067
|
+
}
|
|
1068
|
+
return false;
|
|
1069
|
+
}
|
|
1070
|
+
const Immediate = {
|
|
1071
|
+
setImmediate(cb) {
|
|
1072
|
+
const handle = nextHandle++;
|
|
1073
|
+
activeHandles[handle] = true;
|
|
1074
|
+
if (!resolved) {
|
|
1075
|
+
resolved = Promise.resolve();
|
|
1076
|
+
}
|
|
1077
|
+
resolved.then(() => findAndClearHandle(handle) && cb());
|
|
1078
|
+
return handle;
|
|
1079
|
+
},
|
|
1080
|
+
clearImmediate(handle) {
|
|
1081
|
+
findAndClearHandle(handle);
|
|
1082
|
+
},
|
|
1083
|
+
};
|
|
1084
|
+
const TestTools = {
|
|
1085
|
+
pending() {
|
|
1086
|
+
return Object.keys(activeHandles).length;
|
|
1087
|
+
}
|
|
1088
|
+
};
|
|
1089
|
+
|
|
1090
|
+
const { setImmediate, clearImmediate } = Immediate;
|
|
1091
|
+
const immediateProvider = {
|
|
1092
|
+
setImmediate(...args) {
|
|
1093
|
+
const { delegate } = immediateProvider;
|
|
1094
|
+
return ((delegate === null || delegate === void 0 ? void 0 : delegate.setImmediate) || setImmediate)(...args);
|
|
1095
|
+
},
|
|
1096
|
+
clearImmediate(handle) {
|
|
1097
|
+
const { delegate } = immediateProvider;
|
|
1098
|
+
return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearImmediate) || clearImmediate)(handle);
|
|
1099
|
+
},
|
|
1100
|
+
delegate: undefined,
|
|
1101
|
+
};
|
|
1102
|
+
|
|
1103
|
+
class AsapAction extends AsyncAction {
|
|
1104
|
+
constructor(scheduler, work) {
|
|
1105
|
+
super(scheduler, work);
|
|
1106
|
+
this.scheduler = scheduler;
|
|
1107
|
+
this.work = work;
|
|
1108
|
+
}
|
|
1109
|
+
requestAsyncId(scheduler, id, delay = 0) {
|
|
1110
|
+
if (delay !== null && delay > 0) {
|
|
1111
|
+
return super.requestAsyncId(scheduler, id, delay);
|
|
1112
|
+
}
|
|
1113
|
+
scheduler.actions.push(this);
|
|
1114
|
+
return scheduler._scheduled || (scheduler._scheduled = immediateProvider.setImmediate(scheduler.flush.bind(scheduler, undefined)));
|
|
1115
|
+
}
|
|
1116
|
+
recycleAsyncId(scheduler, id, delay = 0) {
|
|
1117
|
+
if ((delay != null && delay > 0) || (delay == null && this.delay > 0)) {
|
|
1118
|
+
return super.recycleAsyncId(scheduler, id, delay);
|
|
1119
|
+
}
|
|
1120
|
+
if (!scheduler.actions.some((action) => action.id === id)) {
|
|
1121
|
+
immediateProvider.clearImmediate(id);
|
|
1122
|
+
scheduler._scheduled = undefined;
|
|
1123
|
+
}
|
|
1124
|
+
return undefined;
|
|
1125
|
+
}
|
|
1126
|
+
}
|
|
1127
|
+
|
|
1128
|
+
class Scheduler {
|
|
1129
|
+
constructor(schedulerActionCtor, now = Scheduler.now) {
|
|
1130
|
+
this.schedulerActionCtor = schedulerActionCtor;
|
|
1131
|
+
this.now = now;
|
|
1132
|
+
}
|
|
1133
|
+
schedule(work, delay = 0, state) {
|
|
1134
|
+
return new this.schedulerActionCtor(this, work).schedule(state, delay);
|
|
1135
|
+
}
|
|
1136
|
+
}
|
|
1137
|
+
Scheduler.now = dateTimestampProvider.now;
|
|
1138
|
+
|
|
1139
|
+
class AsyncScheduler extends Scheduler {
|
|
1140
|
+
constructor(SchedulerAction, now = Scheduler.now) {
|
|
1141
|
+
super(SchedulerAction, now);
|
|
1142
|
+
this.actions = [];
|
|
1143
|
+
this._active = false;
|
|
1144
|
+
this._scheduled = undefined;
|
|
1145
|
+
}
|
|
1146
|
+
flush(action) {
|
|
1147
|
+
const { actions } = this;
|
|
1148
|
+
if (this._active) {
|
|
1149
|
+
actions.push(action);
|
|
1150
|
+
return;
|
|
1151
|
+
}
|
|
1152
|
+
let error;
|
|
1153
|
+
this._active = true;
|
|
1154
|
+
do {
|
|
1155
|
+
if ((error = action.execute(action.state, action.delay))) {
|
|
1156
|
+
break;
|
|
1157
|
+
}
|
|
1158
|
+
} while ((action = actions.shift()));
|
|
1159
|
+
this._active = false;
|
|
1160
|
+
if (error) {
|
|
1161
|
+
while ((action = actions.shift())) {
|
|
1162
|
+
action.unsubscribe();
|
|
1163
|
+
}
|
|
1164
|
+
throw error;
|
|
1165
|
+
}
|
|
1166
|
+
}
|
|
1167
|
+
}
|
|
1168
|
+
|
|
1169
|
+
class AsapScheduler extends AsyncScheduler {
|
|
1170
|
+
flush(action) {
|
|
1171
|
+
this._active = true;
|
|
1172
|
+
const flushId = this._scheduled;
|
|
1173
|
+
this._scheduled = undefined;
|
|
1174
|
+
const { actions } = this;
|
|
1175
|
+
let error;
|
|
1176
|
+
action = action || actions.shift();
|
|
1177
|
+
do {
|
|
1178
|
+
if ((error = action.execute(action.state, action.delay))) {
|
|
1179
|
+
break;
|
|
1180
|
+
}
|
|
1181
|
+
} while ((action = actions[0]) && action.id === flushId && actions.shift());
|
|
1182
|
+
this._active = false;
|
|
1183
|
+
if (error) {
|
|
1184
|
+
while ((action = actions[0]) && action.id === flushId && actions.shift()) {
|
|
1185
|
+
action.unsubscribe();
|
|
1186
|
+
}
|
|
1187
|
+
throw error;
|
|
1188
|
+
}
|
|
1189
|
+
}
|
|
1190
|
+
}
|
|
1191
|
+
|
|
1192
|
+
const asapScheduler = new AsapScheduler(AsapAction);
|
|
1193
|
+
const asap = asapScheduler;
|
|
1194
|
+
|
|
1195
|
+
const asyncScheduler = new AsyncScheduler(AsyncAction);
|
|
1196
|
+
const async = asyncScheduler;
|
|
1197
|
+
|
|
1198
|
+
class QueueAction extends AsyncAction {
|
|
1199
|
+
constructor(scheduler, work) {
|
|
1200
|
+
super(scheduler, work);
|
|
1201
|
+
this.scheduler = scheduler;
|
|
1202
|
+
this.work = work;
|
|
1203
|
+
}
|
|
1204
|
+
schedule(state, delay = 0) {
|
|
1205
|
+
if (delay > 0) {
|
|
1206
|
+
return super.schedule(state, delay);
|
|
1207
|
+
}
|
|
1208
|
+
this.delay = delay;
|
|
1209
|
+
this.state = state;
|
|
1210
|
+
this.scheduler.flush(this);
|
|
1211
|
+
return this;
|
|
1212
|
+
}
|
|
1213
|
+
execute(state, delay) {
|
|
1214
|
+
return (delay > 0 || this.closed) ?
|
|
1215
|
+
super.execute(state, delay) :
|
|
1216
|
+
this._execute(state, delay);
|
|
1217
|
+
}
|
|
1218
|
+
requestAsyncId(scheduler, id, delay = 0) {
|
|
1219
|
+
if ((delay != null && delay > 0) || (delay == null && this.delay > 0)) {
|
|
1220
|
+
return super.requestAsyncId(scheduler, id, delay);
|
|
1221
|
+
}
|
|
1222
|
+
return scheduler.flush(this);
|
|
1223
|
+
}
|
|
1224
|
+
}
|
|
1225
|
+
|
|
1226
|
+
class QueueScheduler extends AsyncScheduler {
|
|
1227
|
+
}
|
|
1228
|
+
|
|
1229
|
+
const queueScheduler = new QueueScheduler(QueueAction);
|
|
1230
|
+
const queue = queueScheduler;
|
|
1231
|
+
|
|
1232
|
+
class AnimationFrameAction extends AsyncAction {
|
|
1233
|
+
constructor(scheduler, work) {
|
|
1234
|
+
super(scheduler, work);
|
|
1235
|
+
this.scheduler = scheduler;
|
|
1236
|
+
this.work = work;
|
|
1237
|
+
}
|
|
1238
|
+
requestAsyncId(scheduler, id, delay = 0) {
|
|
1239
|
+
if (delay !== null && delay > 0) {
|
|
1240
|
+
return super.requestAsyncId(scheduler, id, delay);
|
|
1241
|
+
}
|
|
1242
|
+
scheduler.actions.push(this);
|
|
1243
|
+
return scheduler._scheduled || (scheduler._scheduled = animationFrameProvider.requestAnimationFrame(() => scheduler.flush(undefined)));
|
|
1244
|
+
}
|
|
1245
|
+
recycleAsyncId(scheduler, id, delay = 0) {
|
|
1246
|
+
if ((delay != null && delay > 0) || (delay == null && this.delay > 0)) {
|
|
1247
|
+
return super.recycleAsyncId(scheduler, id, delay);
|
|
1248
|
+
}
|
|
1249
|
+
if (!scheduler.actions.some((action) => action.id === id)) {
|
|
1250
|
+
animationFrameProvider.cancelAnimationFrame(id);
|
|
1251
|
+
scheduler._scheduled = undefined;
|
|
1252
|
+
}
|
|
1253
|
+
return undefined;
|
|
1254
|
+
}
|
|
1255
|
+
}
|
|
1256
|
+
|
|
1257
|
+
class AnimationFrameScheduler extends AsyncScheduler {
|
|
1258
|
+
flush(action) {
|
|
1259
|
+
this._active = true;
|
|
1260
|
+
const flushId = this._scheduled;
|
|
1261
|
+
this._scheduled = undefined;
|
|
1262
|
+
const { actions } = this;
|
|
1263
|
+
let error;
|
|
1264
|
+
action = action || actions.shift();
|
|
1265
|
+
do {
|
|
1266
|
+
if ((error = action.execute(action.state, action.delay))) {
|
|
1267
|
+
break;
|
|
1268
|
+
}
|
|
1269
|
+
} while ((action = actions[0]) && action.id === flushId && actions.shift());
|
|
1270
|
+
this._active = false;
|
|
1271
|
+
if (error) {
|
|
1272
|
+
while ((action = actions[0]) && action.id === flushId && actions.shift()) {
|
|
1273
|
+
action.unsubscribe();
|
|
1274
|
+
}
|
|
1275
|
+
throw error;
|
|
1276
|
+
}
|
|
1277
|
+
}
|
|
1278
|
+
}
|
|
1279
|
+
|
|
1280
|
+
const animationFrameScheduler = new AnimationFrameScheduler(AnimationFrameAction);
|
|
1281
|
+
const animationFrame = animationFrameScheduler;
|
|
1282
|
+
|
|
1283
|
+
class VirtualTimeScheduler extends AsyncScheduler {
|
|
1284
|
+
constructor(schedulerActionCtor = VirtualAction, maxFrames = Infinity) {
|
|
1285
|
+
super(schedulerActionCtor, () => this.frame);
|
|
1286
|
+
this.maxFrames = maxFrames;
|
|
1287
|
+
this.frame = 0;
|
|
1288
|
+
this.index = -1;
|
|
1289
|
+
}
|
|
1290
|
+
flush() {
|
|
1291
|
+
const { actions, maxFrames } = this;
|
|
1292
|
+
let error;
|
|
1293
|
+
let action;
|
|
1294
|
+
while ((action = actions[0]) && action.delay <= maxFrames) {
|
|
1295
|
+
actions.shift();
|
|
1296
|
+
this.frame = action.delay;
|
|
1297
|
+
if ((error = action.execute(action.state, action.delay))) {
|
|
1298
|
+
break;
|
|
1299
|
+
}
|
|
1300
|
+
}
|
|
1301
|
+
if (error) {
|
|
1302
|
+
while ((action = actions.shift())) {
|
|
1303
|
+
action.unsubscribe();
|
|
1304
|
+
}
|
|
1305
|
+
throw error;
|
|
1306
|
+
}
|
|
1307
|
+
}
|
|
1308
|
+
}
|
|
1309
|
+
VirtualTimeScheduler.frameTimeFactor = 10;
|
|
1310
|
+
class VirtualAction extends AsyncAction {
|
|
1311
|
+
constructor(scheduler, work, index = (scheduler.index += 1)) {
|
|
1312
|
+
super(scheduler, work);
|
|
1313
|
+
this.scheduler = scheduler;
|
|
1314
|
+
this.work = work;
|
|
1315
|
+
this.index = index;
|
|
1316
|
+
this.active = true;
|
|
1317
|
+
this.index = scheduler.index = index;
|
|
1318
|
+
}
|
|
1319
|
+
schedule(state, delay = 0) {
|
|
1320
|
+
if (Number.isFinite(delay)) {
|
|
1321
|
+
if (!this.id) {
|
|
1322
|
+
return super.schedule(state, delay);
|
|
1323
|
+
}
|
|
1324
|
+
this.active = false;
|
|
1325
|
+
const action = new VirtualAction(this.scheduler, this.work);
|
|
1326
|
+
this.add(action);
|
|
1327
|
+
return action.schedule(state, delay);
|
|
1328
|
+
}
|
|
1329
|
+
else {
|
|
1330
|
+
return Subscription.EMPTY;
|
|
1331
|
+
}
|
|
1332
|
+
}
|
|
1333
|
+
requestAsyncId(scheduler, id, delay = 0) {
|
|
1334
|
+
this.delay = scheduler.frame + delay;
|
|
1335
|
+
const { actions } = scheduler;
|
|
1336
|
+
actions.push(this);
|
|
1337
|
+
actions.sort(VirtualAction.sortActions);
|
|
1338
|
+
return true;
|
|
1339
|
+
}
|
|
1340
|
+
recycleAsyncId(scheduler, id, delay = 0) {
|
|
1341
|
+
return undefined;
|
|
1342
|
+
}
|
|
1343
|
+
_execute(state, delay) {
|
|
1344
|
+
if (this.active === true) {
|
|
1345
|
+
return super._execute(state, delay);
|
|
1346
|
+
}
|
|
1347
|
+
}
|
|
1348
|
+
static sortActions(a, b) {
|
|
1349
|
+
if (a.delay === b.delay) {
|
|
1350
|
+
if (a.index === b.index) {
|
|
1351
|
+
return 0;
|
|
1352
|
+
}
|
|
1353
|
+
else if (a.index > b.index) {
|
|
1354
|
+
return 1;
|
|
1355
|
+
}
|
|
1356
|
+
else {
|
|
1357
|
+
return -1;
|
|
1358
|
+
}
|
|
1359
|
+
}
|
|
1360
|
+
else if (a.delay > b.delay) {
|
|
1361
|
+
return 1;
|
|
1362
|
+
}
|
|
1363
|
+
else {
|
|
1364
|
+
return -1;
|
|
1365
|
+
}
|
|
1366
|
+
}
|
|
1367
|
+
}
|
|
1368
|
+
|
|
685
1369
|
const EMPTY = new Observable((subscriber) => subscriber.complete());
|
|
1370
|
+
function empty(scheduler) {
|
|
1371
|
+
return scheduler ? emptyScheduled(scheduler) : EMPTY;
|
|
1372
|
+
}
|
|
1373
|
+
function emptyScheduled(scheduler) {
|
|
1374
|
+
return new Observable((subscriber) => scheduler.schedule(() => subscriber.complete()));
|
|
1375
|
+
}
|
|
686
1376
|
|
|
687
1377
|
function isScheduler(value) {
|
|
688
1378
|
return value && isFunction(value.schedule);
|
|
689
1379
|
}
|
|
690
1380
|
|
|
691
|
-
function last(arr) {
|
|
1381
|
+
function last$1(arr) {
|
|
692
1382
|
return arr[arr.length - 1];
|
|
693
1383
|
}
|
|
1384
|
+
function popResultSelector(args) {
|
|
1385
|
+
return isFunction(last$1(args)) ? args.pop() : undefined;
|
|
1386
|
+
}
|
|
694
1387
|
function popScheduler(args) {
|
|
695
|
-
return isScheduler(last(args)) ? args.pop() : undefined;
|
|
1388
|
+
return isScheduler(last$1(args)) ? args.pop() : undefined;
|
|
696
1389
|
}
|
|
697
1390
|
function popNumber(args, defaultValue) {
|
|
698
|
-
return typeof last(args) === 'number' ? args.pop() : defaultValue;
|
|
1391
|
+
return typeof last$1(args) === 'number' ? args.pop() : defaultValue;
|
|
699
1392
|
}
|
|
700
1393
|
|
|
701
|
-
|
|
1394
|
+
/*! *****************************************************************************
|
|
702
1395
|
Copyright (c) Microsoft Corporation.
|
|
703
1396
|
|
|
704
1397
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -712,19 +1405,113 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
712
1405
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
713
1406
|
PERFORMANCE OF THIS SOFTWARE.
|
|
714
1407
|
***************************************************************************** */
|
|
1408
|
+
/* global Reflect, Promise */
|
|
715
1409
|
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
function
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
1410
|
+
var extendStatics = function(d, b) {
|
|
1411
|
+
extendStatics = Object.setPrototypeOf ||
|
|
1412
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
1413
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
1414
|
+
return extendStatics(d, b);
|
|
1415
|
+
};
|
|
1416
|
+
|
|
1417
|
+
function __extends(d, b) {
|
|
1418
|
+
if (typeof b !== "function" && b !== null)
|
|
1419
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
1420
|
+
extendStatics(d, b);
|
|
1421
|
+
function __() { this.constructor = d; }
|
|
1422
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
724
1423
|
}
|
|
725
1424
|
|
|
726
|
-
function
|
|
727
|
-
|
|
1425
|
+
var __assign = function() {
|
|
1426
|
+
__assign = Object.assign || function __assign(t) {
|
|
1427
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
1428
|
+
s = arguments[i];
|
|
1429
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
1430
|
+
}
|
|
1431
|
+
return t;
|
|
1432
|
+
};
|
|
1433
|
+
return __assign.apply(this, arguments);
|
|
1434
|
+
};
|
|
1435
|
+
|
|
1436
|
+
function __rest(s, e) {
|
|
1437
|
+
var t = {};
|
|
1438
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1439
|
+
t[p] = s[p];
|
|
1440
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
1441
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
1442
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
1443
|
+
t[p[i]] = s[p[i]];
|
|
1444
|
+
}
|
|
1445
|
+
return t;
|
|
1446
|
+
}
|
|
1447
|
+
|
|
1448
|
+
function __decorate(decorators, target, key, desc) {
|
|
1449
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1450
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1451
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1452
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1453
|
+
}
|
|
1454
|
+
|
|
1455
|
+
function __param(paramIndex, decorator) {
|
|
1456
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
1457
|
+
}
|
|
1458
|
+
|
|
1459
|
+
function __metadata(metadataKey, metadataValue) {
|
|
1460
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
|
|
1461
|
+
}
|
|
1462
|
+
|
|
1463
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
1464
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
1465
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
1466
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
1467
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
1468
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
1469
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
1470
|
+
});
|
|
1471
|
+
}
|
|
1472
|
+
|
|
1473
|
+
function __generator(thisArg, body) {
|
|
1474
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
1475
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
1476
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
1477
|
+
function step(op) {
|
|
1478
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
1479
|
+
while (_) try {
|
|
1480
|
+
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;
|
|
1481
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
1482
|
+
switch (op[0]) {
|
|
1483
|
+
case 0: case 1: t = op; break;
|
|
1484
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
1485
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
1486
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
1487
|
+
default:
|
|
1488
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
1489
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
1490
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
1491
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
1492
|
+
if (t[2]) _.ops.pop();
|
|
1493
|
+
_.trys.pop(); continue;
|
|
1494
|
+
}
|
|
1495
|
+
op = body.call(thisArg, _);
|
|
1496
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
1497
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
1498
|
+
}
|
|
1499
|
+
}
|
|
1500
|
+
|
|
1501
|
+
var __createBinding = Object.create ? (function(o, m, k, k2) {
|
|
1502
|
+
if (k2 === undefined) k2 = k;
|
|
1503
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
1504
|
+
}) : (function(o, m, k, k2) {
|
|
1505
|
+
if (k2 === undefined) k2 = k;
|
|
1506
|
+
o[k2] = m[k];
|
|
1507
|
+
});
|
|
1508
|
+
|
|
1509
|
+
function __exportStar(m, o) {
|
|
1510
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
|
|
1511
|
+
}
|
|
1512
|
+
|
|
1513
|
+
function __values(o) {
|
|
1514
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
728
1515
|
if (m) return m.call(o);
|
|
729
1516
|
if (o && typeof o.length === "number") return {
|
|
730
1517
|
next: function () {
|
|
@@ -735,6 +1522,49 @@ function __values(o) {
|
|
|
735
1522
|
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
736
1523
|
}
|
|
737
1524
|
|
|
1525
|
+
function __read(o, n) {
|
|
1526
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
1527
|
+
if (!m) return o;
|
|
1528
|
+
var i = m.call(o), r, ar = [], e;
|
|
1529
|
+
try {
|
|
1530
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
1531
|
+
}
|
|
1532
|
+
catch (error) { e = { error: error }; }
|
|
1533
|
+
finally {
|
|
1534
|
+
try {
|
|
1535
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
1536
|
+
}
|
|
1537
|
+
finally { if (e) throw e.error; }
|
|
1538
|
+
}
|
|
1539
|
+
return ar;
|
|
1540
|
+
}
|
|
1541
|
+
|
|
1542
|
+
/** @deprecated */
|
|
1543
|
+
function __spread() {
|
|
1544
|
+
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
1545
|
+
ar = ar.concat(__read(arguments[i]));
|
|
1546
|
+
return ar;
|
|
1547
|
+
}
|
|
1548
|
+
|
|
1549
|
+
/** @deprecated */
|
|
1550
|
+
function __spreadArrays() {
|
|
1551
|
+
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
|
1552
|
+
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
1553
|
+
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
1554
|
+
r[k] = a[j];
|
|
1555
|
+
return r;
|
|
1556
|
+
}
|
|
1557
|
+
|
|
1558
|
+
function __spreadArray(to, from, pack) {
|
|
1559
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
1560
|
+
if (ar || !(i in from)) {
|
|
1561
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
1562
|
+
ar[i] = from[i];
|
|
1563
|
+
}
|
|
1564
|
+
}
|
|
1565
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
1566
|
+
}
|
|
1567
|
+
|
|
738
1568
|
function __await(v) {
|
|
739
1569
|
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
740
1570
|
}
|
|
@@ -751,12 +1581,54 @@ function __asyncGenerator(thisArg, _arguments, generator) {
|
|
|
751
1581
|
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
|
752
1582
|
}
|
|
753
1583
|
|
|
1584
|
+
function __asyncDelegator(o) {
|
|
1585
|
+
var i, p;
|
|
1586
|
+
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
1587
|
+
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
|
|
1588
|
+
}
|
|
1589
|
+
|
|
754
1590
|
function __asyncValues(o) {
|
|
755
1591
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
756
1592
|
var m = o[Symbol.asyncIterator], i;
|
|
757
1593
|
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
758
1594
|
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
759
1595
|
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
|
1596
|
+
}
|
|
1597
|
+
|
|
1598
|
+
function __makeTemplateObject(cooked, raw) {
|
|
1599
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
1600
|
+
return cooked;
|
|
1601
|
+
};
|
|
1602
|
+
|
|
1603
|
+
var __setModuleDefault = Object.create ? (function(o, v) {
|
|
1604
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
1605
|
+
}) : function(o, v) {
|
|
1606
|
+
o["default"] = v;
|
|
1607
|
+
};
|
|
1608
|
+
|
|
1609
|
+
function __importStar(mod) {
|
|
1610
|
+
if (mod && mod.__esModule) return mod;
|
|
1611
|
+
var result = {};
|
|
1612
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
1613
|
+
__setModuleDefault(result, mod);
|
|
1614
|
+
return result;
|
|
1615
|
+
}
|
|
1616
|
+
|
|
1617
|
+
function __importDefault(mod) {
|
|
1618
|
+
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
1619
|
+
}
|
|
1620
|
+
|
|
1621
|
+
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
1622
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
1623
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
1624
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
1625
|
+
}
|
|
1626
|
+
|
|
1627
|
+
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
1628
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
1629
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
1630
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
1631
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
760
1632
|
}
|
|
761
1633
|
|
|
762
1634
|
const isArrayLike = ((x) => x && typeof x.length === 'number' && typeof x !== 'function');
|
|
@@ -1041,6 +1913,212 @@ function from(input, scheduler) {
|
|
|
1041
1913
|
return scheduler ? scheduled(input, scheduler) : innerFrom(input);
|
|
1042
1914
|
}
|
|
1043
1915
|
|
|
1916
|
+
function of(...args) {
|
|
1917
|
+
const scheduler = popScheduler(args);
|
|
1918
|
+
return from(args, scheduler);
|
|
1919
|
+
}
|
|
1920
|
+
|
|
1921
|
+
function throwError(errorOrErrorFactory, scheduler) {
|
|
1922
|
+
const errorFactory = isFunction(errorOrErrorFactory) ? errorOrErrorFactory : () => errorOrErrorFactory;
|
|
1923
|
+
const init = (subscriber) => subscriber.error(errorFactory());
|
|
1924
|
+
return new Observable(scheduler ? (subscriber) => scheduler.schedule(init, 0, subscriber) : init);
|
|
1925
|
+
}
|
|
1926
|
+
|
|
1927
|
+
var NotificationKind;
|
|
1928
|
+
(function (NotificationKind) {
|
|
1929
|
+
NotificationKind["NEXT"] = "N";
|
|
1930
|
+
NotificationKind["ERROR"] = "E";
|
|
1931
|
+
NotificationKind["COMPLETE"] = "C";
|
|
1932
|
+
})(NotificationKind || (NotificationKind = {}));
|
|
1933
|
+
class Notification {
|
|
1934
|
+
constructor(kind, value, error) {
|
|
1935
|
+
this.kind = kind;
|
|
1936
|
+
this.value = value;
|
|
1937
|
+
this.error = error;
|
|
1938
|
+
this.hasValue = kind === 'N';
|
|
1939
|
+
}
|
|
1940
|
+
observe(observer) {
|
|
1941
|
+
return observeNotification(this, observer);
|
|
1942
|
+
}
|
|
1943
|
+
do(nextHandler, errorHandler, completeHandler) {
|
|
1944
|
+
const { kind, value, error } = this;
|
|
1945
|
+
return kind === 'N' ? nextHandler === null || nextHandler === void 0 ? void 0 : nextHandler(value) : kind === 'E' ? errorHandler === null || errorHandler === void 0 ? void 0 : errorHandler(error) : completeHandler === null || completeHandler === void 0 ? void 0 : completeHandler();
|
|
1946
|
+
}
|
|
1947
|
+
accept(nextOrObserver, error, complete) {
|
|
1948
|
+
var _a;
|
|
1949
|
+
return isFunction((_a = nextOrObserver) === null || _a === void 0 ? void 0 : _a.next)
|
|
1950
|
+
? this.observe(nextOrObserver)
|
|
1951
|
+
: this.do(nextOrObserver, error, complete);
|
|
1952
|
+
}
|
|
1953
|
+
toObservable() {
|
|
1954
|
+
const { kind, value, error } = this;
|
|
1955
|
+
const result = kind === 'N'
|
|
1956
|
+
?
|
|
1957
|
+
of(value)
|
|
1958
|
+
:
|
|
1959
|
+
kind === 'E'
|
|
1960
|
+
?
|
|
1961
|
+
throwError(() => error)
|
|
1962
|
+
:
|
|
1963
|
+
kind === 'C'
|
|
1964
|
+
?
|
|
1965
|
+
EMPTY
|
|
1966
|
+
:
|
|
1967
|
+
0;
|
|
1968
|
+
if (!result) {
|
|
1969
|
+
throw new TypeError(`Unexpected notification kind ${kind}`);
|
|
1970
|
+
}
|
|
1971
|
+
return result;
|
|
1972
|
+
}
|
|
1973
|
+
static createNext(value) {
|
|
1974
|
+
return new Notification('N', value);
|
|
1975
|
+
}
|
|
1976
|
+
static createError(err) {
|
|
1977
|
+
return new Notification('E', undefined, err);
|
|
1978
|
+
}
|
|
1979
|
+
static createComplete() {
|
|
1980
|
+
return Notification.completeNotification;
|
|
1981
|
+
}
|
|
1982
|
+
}
|
|
1983
|
+
Notification.completeNotification = new Notification('C');
|
|
1984
|
+
function observeNotification(notification, observer) {
|
|
1985
|
+
var _a, _b, _c;
|
|
1986
|
+
const { kind, value, error } = notification;
|
|
1987
|
+
if (typeof kind !== 'string') {
|
|
1988
|
+
throw new TypeError('Invalid notification, missing "kind"');
|
|
1989
|
+
}
|
|
1990
|
+
kind === 'N' ? (_a = observer.next) === null || _a === void 0 ? void 0 : _a.call(observer, value) : kind === 'E' ? (_b = observer.error) === null || _b === void 0 ? void 0 : _b.call(observer, error) : (_c = observer.complete) === null || _c === void 0 ? void 0 : _c.call(observer);
|
|
1991
|
+
}
|
|
1992
|
+
|
|
1993
|
+
function isObservable(obj) {
|
|
1994
|
+
return !!obj && (obj instanceof Observable || (isFunction(obj.lift) && isFunction(obj.subscribe)));
|
|
1995
|
+
}
|
|
1996
|
+
|
|
1997
|
+
const EmptyError = createErrorClass((_super) => function EmptyErrorImpl() {
|
|
1998
|
+
_super(this);
|
|
1999
|
+
this.name = 'EmptyError';
|
|
2000
|
+
this.message = 'no elements in sequence';
|
|
2001
|
+
});
|
|
2002
|
+
|
|
2003
|
+
function lastValueFrom(source, config) {
|
|
2004
|
+
const hasConfig = typeof config === 'object';
|
|
2005
|
+
return new Promise((resolve, reject) => {
|
|
2006
|
+
let _hasValue = false;
|
|
2007
|
+
let _value;
|
|
2008
|
+
source.subscribe({
|
|
2009
|
+
next: (value) => {
|
|
2010
|
+
_value = value;
|
|
2011
|
+
_hasValue = true;
|
|
2012
|
+
},
|
|
2013
|
+
error: reject,
|
|
2014
|
+
complete: () => {
|
|
2015
|
+
if (_hasValue) {
|
|
2016
|
+
resolve(_value);
|
|
2017
|
+
}
|
|
2018
|
+
else if (hasConfig) {
|
|
2019
|
+
resolve(config.defaultValue);
|
|
2020
|
+
}
|
|
2021
|
+
else {
|
|
2022
|
+
reject(new EmptyError());
|
|
2023
|
+
}
|
|
2024
|
+
},
|
|
2025
|
+
});
|
|
2026
|
+
});
|
|
2027
|
+
}
|
|
2028
|
+
|
|
2029
|
+
function firstValueFrom(source, config) {
|
|
2030
|
+
const hasConfig = typeof config === 'object';
|
|
2031
|
+
return new Promise((resolve, reject) => {
|
|
2032
|
+
const subscriber = new SafeSubscriber({
|
|
2033
|
+
next: (value) => {
|
|
2034
|
+
resolve(value);
|
|
2035
|
+
subscriber.unsubscribe();
|
|
2036
|
+
},
|
|
2037
|
+
error: reject,
|
|
2038
|
+
complete: () => {
|
|
2039
|
+
if (hasConfig) {
|
|
2040
|
+
resolve(config.defaultValue);
|
|
2041
|
+
}
|
|
2042
|
+
else {
|
|
2043
|
+
reject(new EmptyError());
|
|
2044
|
+
}
|
|
2045
|
+
},
|
|
2046
|
+
});
|
|
2047
|
+
source.subscribe(subscriber);
|
|
2048
|
+
});
|
|
2049
|
+
}
|
|
2050
|
+
|
|
2051
|
+
const ArgumentOutOfRangeError = createErrorClass((_super) => function ArgumentOutOfRangeErrorImpl() {
|
|
2052
|
+
_super(this);
|
|
2053
|
+
this.name = 'ArgumentOutOfRangeError';
|
|
2054
|
+
this.message = 'argument out of range';
|
|
2055
|
+
});
|
|
2056
|
+
|
|
2057
|
+
const NotFoundError = createErrorClass((_super) => function NotFoundErrorImpl(message) {
|
|
2058
|
+
_super(this);
|
|
2059
|
+
this.name = 'NotFoundError';
|
|
2060
|
+
this.message = message;
|
|
2061
|
+
});
|
|
2062
|
+
|
|
2063
|
+
const SequenceError = createErrorClass((_super) => function SequenceErrorImpl(message) {
|
|
2064
|
+
_super(this);
|
|
2065
|
+
this.name = 'SequenceError';
|
|
2066
|
+
this.message = message;
|
|
2067
|
+
});
|
|
2068
|
+
|
|
2069
|
+
function isValidDate(value) {
|
|
2070
|
+
return value instanceof Date && !isNaN(value);
|
|
2071
|
+
}
|
|
2072
|
+
|
|
2073
|
+
const TimeoutError = createErrorClass((_super) => function TimeoutErrorImpl(info = null) {
|
|
2074
|
+
_super(this);
|
|
2075
|
+
this.message = 'Timeout has occurred';
|
|
2076
|
+
this.name = 'TimeoutError';
|
|
2077
|
+
this.info = info;
|
|
2078
|
+
});
|
|
2079
|
+
function timeout(config, schedulerArg) {
|
|
2080
|
+
const { first, each, with: _with = timeoutErrorFactory, scheduler = schedulerArg !== null && schedulerArg !== void 0 ? schedulerArg : asyncScheduler, meta = null, } = (isValidDate(config) ? { first: config } : typeof config === 'number' ? { each: config } : config);
|
|
2081
|
+
if (first == null && each == null) {
|
|
2082
|
+
throw new TypeError('No timeout provided.');
|
|
2083
|
+
}
|
|
2084
|
+
return operate((source, subscriber) => {
|
|
2085
|
+
let originalSourceSubscription;
|
|
2086
|
+
let timerSubscription;
|
|
2087
|
+
let lastValue = null;
|
|
2088
|
+
let seen = 0;
|
|
2089
|
+
const startTimer = (delay) => {
|
|
2090
|
+
timerSubscription = executeSchedule(subscriber, scheduler, () => {
|
|
2091
|
+
try {
|
|
2092
|
+
originalSourceSubscription.unsubscribe();
|
|
2093
|
+
innerFrom(_with({
|
|
2094
|
+
meta,
|
|
2095
|
+
lastValue,
|
|
2096
|
+
seen,
|
|
2097
|
+
})).subscribe(subscriber);
|
|
2098
|
+
}
|
|
2099
|
+
catch (err) {
|
|
2100
|
+
subscriber.error(err);
|
|
2101
|
+
}
|
|
2102
|
+
}, delay);
|
|
2103
|
+
};
|
|
2104
|
+
originalSourceSubscription = source.subscribe(createOperatorSubscriber(subscriber, (value) => {
|
|
2105
|
+
timerSubscription === null || timerSubscription === void 0 ? void 0 : timerSubscription.unsubscribe();
|
|
2106
|
+
seen++;
|
|
2107
|
+
subscriber.next((lastValue = value));
|
|
2108
|
+
each > 0 && startTimer(each);
|
|
2109
|
+
}, undefined, undefined, () => {
|
|
2110
|
+
if (!(timerSubscription === null || timerSubscription === void 0 ? void 0 : timerSubscription.closed)) {
|
|
2111
|
+
timerSubscription === null || timerSubscription === void 0 ? void 0 : timerSubscription.unsubscribe();
|
|
2112
|
+
}
|
|
2113
|
+
lastValue = null;
|
|
2114
|
+
}));
|
|
2115
|
+
!seen && startTimer(first != null ? (typeof first === 'number' ? first : +first - scheduler.now()) : each);
|
|
2116
|
+
});
|
|
2117
|
+
}
|
|
2118
|
+
function timeoutErrorFactory(info) {
|
|
2119
|
+
throw new TimeoutError(info);
|
|
2120
|
+
}
|
|
2121
|
+
|
|
1044
2122
|
function map(project, thisArg) {
|
|
1045
2123
|
return operate((source, subscriber) => {
|
|
1046
2124
|
let index = 0;
|
|
@@ -1050,14 +2128,157 @@ function map(project, thisArg) {
|
|
|
1050
2128
|
});
|
|
1051
2129
|
}
|
|
1052
2130
|
|
|
1053
|
-
const { isArray } = Array;
|
|
2131
|
+
const { isArray: isArray$2 } = Array;
|
|
1054
2132
|
function callOrApply(fn, args) {
|
|
1055
|
-
return isArray(args) ? fn(...args) : fn(args);
|
|
2133
|
+
return isArray$2(args) ? fn(...args) : fn(args);
|
|
1056
2134
|
}
|
|
1057
2135
|
function mapOneOrManyArgs(fn) {
|
|
1058
2136
|
return map(args => callOrApply(fn, args));
|
|
1059
2137
|
}
|
|
1060
2138
|
|
|
2139
|
+
function bindCallbackInternals(isNodeStyle, callbackFunc, resultSelector, scheduler) {
|
|
2140
|
+
if (resultSelector) {
|
|
2141
|
+
if (isScheduler(resultSelector)) {
|
|
2142
|
+
scheduler = resultSelector;
|
|
2143
|
+
}
|
|
2144
|
+
else {
|
|
2145
|
+
return function (...args) {
|
|
2146
|
+
return bindCallbackInternals(isNodeStyle, callbackFunc, scheduler)
|
|
2147
|
+
.apply(this, args)
|
|
2148
|
+
.pipe(mapOneOrManyArgs(resultSelector));
|
|
2149
|
+
};
|
|
2150
|
+
}
|
|
2151
|
+
}
|
|
2152
|
+
if (scheduler) {
|
|
2153
|
+
return function (...args) {
|
|
2154
|
+
return bindCallbackInternals(isNodeStyle, callbackFunc)
|
|
2155
|
+
.apply(this, args)
|
|
2156
|
+
.pipe(subscribeOn(scheduler), observeOn(scheduler));
|
|
2157
|
+
};
|
|
2158
|
+
}
|
|
2159
|
+
return function (...args) {
|
|
2160
|
+
const subject = new AsyncSubject();
|
|
2161
|
+
let uninitialized = true;
|
|
2162
|
+
return new Observable((subscriber) => {
|
|
2163
|
+
const subs = subject.subscribe(subscriber);
|
|
2164
|
+
if (uninitialized) {
|
|
2165
|
+
uninitialized = false;
|
|
2166
|
+
let isAsync = false;
|
|
2167
|
+
let isComplete = false;
|
|
2168
|
+
callbackFunc.apply(this, [
|
|
2169
|
+
...args,
|
|
2170
|
+
(...results) => {
|
|
2171
|
+
if (isNodeStyle) {
|
|
2172
|
+
const err = results.shift();
|
|
2173
|
+
if (err != null) {
|
|
2174
|
+
subject.error(err);
|
|
2175
|
+
return;
|
|
2176
|
+
}
|
|
2177
|
+
}
|
|
2178
|
+
subject.next(1 < results.length ? results : results[0]);
|
|
2179
|
+
isComplete = true;
|
|
2180
|
+
if (isAsync) {
|
|
2181
|
+
subject.complete();
|
|
2182
|
+
}
|
|
2183
|
+
},
|
|
2184
|
+
]);
|
|
2185
|
+
if (isComplete) {
|
|
2186
|
+
subject.complete();
|
|
2187
|
+
}
|
|
2188
|
+
isAsync = true;
|
|
2189
|
+
}
|
|
2190
|
+
return subs;
|
|
2191
|
+
});
|
|
2192
|
+
};
|
|
2193
|
+
}
|
|
2194
|
+
|
|
2195
|
+
function bindCallback(callbackFunc, resultSelector, scheduler) {
|
|
2196
|
+
return bindCallbackInternals(false, callbackFunc, resultSelector, scheduler);
|
|
2197
|
+
}
|
|
2198
|
+
|
|
2199
|
+
function bindNodeCallback(callbackFunc, resultSelector, scheduler) {
|
|
2200
|
+
return bindCallbackInternals(true, callbackFunc, resultSelector, scheduler);
|
|
2201
|
+
}
|
|
2202
|
+
|
|
2203
|
+
const { isArray: isArray$1 } = Array;
|
|
2204
|
+
const { getPrototypeOf, prototype: objectProto, keys: getKeys } = Object;
|
|
2205
|
+
function argsArgArrayOrObject(args) {
|
|
2206
|
+
if (args.length === 1) {
|
|
2207
|
+
const first = args[0];
|
|
2208
|
+
if (isArray$1(first)) {
|
|
2209
|
+
return { args: first, keys: null };
|
|
2210
|
+
}
|
|
2211
|
+
if (isPOJO(first)) {
|
|
2212
|
+
const keys = getKeys(first);
|
|
2213
|
+
return {
|
|
2214
|
+
args: keys.map((key) => first[key]),
|
|
2215
|
+
keys,
|
|
2216
|
+
};
|
|
2217
|
+
}
|
|
2218
|
+
}
|
|
2219
|
+
return { args: args, keys: null };
|
|
2220
|
+
}
|
|
2221
|
+
function isPOJO(obj) {
|
|
2222
|
+
return obj && typeof obj === 'object' && getPrototypeOf(obj) === objectProto;
|
|
2223
|
+
}
|
|
2224
|
+
|
|
2225
|
+
function createObject(keys, values) {
|
|
2226
|
+
return keys.reduce((result, key, i) => ((result[key] = values[i]), result), {});
|
|
2227
|
+
}
|
|
2228
|
+
|
|
2229
|
+
function combineLatest$1(...args) {
|
|
2230
|
+
const scheduler = popScheduler(args);
|
|
2231
|
+
const resultSelector = popResultSelector(args);
|
|
2232
|
+
const { args: observables, keys } = argsArgArrayOrObject(args);
|
|
2233
|
+
if (observables.length === 0) {
|
|
2234
|
+
return from([], scheduler);
|
|
2235
|
+
}
|
|
2236
|
+
const result = new Observable(combineLatestInit(observables, scheduler, keys
|
|
2237
|
+
?
|
|
2238
|
+
(values) => createObject(keys, values)
|
|
2239
|
+
:
|
|
2240
|
+
identity));
|
|
2241
|
+
return resultSelector ? result.pipe(mapOneOrManyArgs(resultSelector)) : result;
|
|
2242
|
+
}
|
|
2243
|
+
function combineLatestInit(observables, scheduler, valueTransform = identity) {
|
|
2244
|
+
return (subscriber) => {
|
|
2245
|
+
maybeSchedule(scheduler, () => {
|
|
2246
|
+
const { length } = observables;
|
|
2247
|
+
const values = new Array(length);
|
|
2248
|
+
let active = length;
|
|
2249
|
+
let remainingFirstValues = length;
|
|
2250
|
+
for (let i = 0; i < length; i++) {
|
|
2251
|
+
maybeSchedule(scheduler, () => {
|
|
2252
|
+
const source = from(observables[i], scheduler);
|
|
2253
|
+
let hasFirstValue = false;
|
|
2254
|
+
source.subscribe(createOperatorSubscriber(subscriber, (value) => {
|
|
2255
|
+
values[i] = value;
|
|
2256
|
+
if (!hasFirstValue) {
|
|
2257
|
+
hasFirstValue = true;
|
|
2258
|
+
remainingFirstValues--;
|
|
2259
|
+
}
|
|
2260
|
+
if (!remainingFirstValues) {
|
|
2261
|
+
subscriber.next(valueTransform(values.slice()));
|
|
2262
|
+
}
|
|
2263
|
+
}, () => {
|
|
2264
|
+
if (!--active) {
|
|
2265
|
+
subscriber.complete();
|
|
2266
|
+
}
|
|
2267
|
+
}));
|
|
2268
|
+
}, subscriber);
|
|
2269
|
+
}
|
|
2270
|
+
}, subscriber);
|
|
2271
|
+
};
|
|
2272
|
+
}
|
|
2273
|
+
function maybeSchedule(scheduler, execute, subscription) {
|
|
2274
|
+
if (scheduler) {
|
|
2275
|
+
executeSchedule(subscription, scheduler, execute);
|
|
2276
|
+
}
|
|
2277
|
+
else {
|
|
2278
|
+
execute();
|
|
2279
|
+
}
|
|
2280
|
+
}
|
|
2281
|
+
|
|
1061
2282
|
function mergeInternals(source, subscriber, project, concurrent, onBeforeNext, expand, innerSubScheduler, additionalFinalizer) {
|
|
1062
2283
|
const buffer = [];
|
|
1063
2284
|
let active = 0;
|
|
@@ -1127,6 +2348,76 @@ function mergeAll(concurrent = Infinity) {
|
|
|
1127
2348
|
return mergeMap(identity, concurrent);
|
|
1128
2349
|
}
|
|
1129
2350
|
|
|
2351
|
+
function concatAll() {
|
|
2352
|
+
return mergeAll(1);
|
|
2353
|
+
}
|
|
2354
|
+
|
|
2355
|
+
function concat$1(...args) {
|
|
2356
|
+
return concatAll()(from(args, popScheduler(args)));
|
|
2357
|
+
}
|
|
2358
|
+
|
|
2359
|
+
function defer(observableFactory) {
|
|
2360
|
+
return new Observable((subscriber) => {
|
|
2361
|
+
innerFrom(observableFactory()).subscribe(subscriber);
|
|
2362
|
+
});
|
|
2363
|
+
}
|
|
2364
|
+
|
|
2365
|
+
const DEFAULT_CONFIG$1 = {
|
|
2366
|
+
connector: () => new Subject(),
|
|
2367
|
+
resetOnDisconnect: true,
|
|
2368
|
+
};
|
|
2369
|
+
function connectable(source, config = DEFAULT_CONFIG$1) {
|
|
2370
|
+
let connection = null;
|
|
2371
|
+
const { connector, resetOnDisconnect = true } = config;
|
|
2372
|
+
let subject = connector();
|
|
2373
|
+
const result = new Observable((subscriber) => {
|
|
2374
|
+
return subject.subscribe(subscriber);
|
|
2375
|
+
});
|
|
2376
|
+
result.connect = () => {
|
|
2377
|
+
if (!connection || connection.closed) {
|
|
2378
|
+
connection = defer(() => source).subscribe(subject);
|
|
2379
|
+
if (resetOnDisconnect) {
|
|
2380
|
+
connection.add(() => (subject = connector()));
|
|
2381
|
+
}
|
|
2382
|
+
}
|
|
2383
|
+
return connection;
|
|
2384
|
+
};
|
|
2385
|
+
return result;
|
|
2386
|
+
}
|
|
2387
|
+
|
|
2388
|
+
function forkJoin(...args) {
|
|
2389
|
+
const resultSelector = popResultSelector(args);
|
|
2390
|
+
const { args: sources, keys } = argsArgArrayOrObject(args);
|
|
2391
|
+
const result = new Observable((subscriber) => {
|
|
2392
|
+
const { length } = sources;
|
|
2393
|
+
if (!length) {
|
|
2394
|
+
subscriber.complete();
|
|
2395
|
+
return;
|
|
2396
|
+
}
|
|
2397
|
+
const values = new Array(length);
|
|
2398
|
+
let remainingCompletions = length;
|
|
2399
|
+
let remainingEmissions = length;
|
|
2400
|
+
for (let sourceIndex = 0; sourceIndex < length; sourceIndex++) {
|
|
2401
|
+
let hasValue = false;
|
|
2402
|
+
innerFrom(sources[sourceIndex]).subscribe(createOperatorSubscriber(subscriber, (value) => {
|
|
2403
|
+
if (!hasValue) {
|
|
2404
|
+
hasValue = true;
|
|
2405
|
+
remainingEmissions--;
|
|
2406
|
+
}
|
|
2407
|
+
values[sourceIndex] = value;
|
|
2408
|
+
}, () => remainingCompletions--, undefined, () => {
|
|
2409
|
+
if (!remainingCompletions || !hasValue) {
|
|
2410
|
+
if (!remainingEmissions) {
|
|
2411
|
+
subscriber.next(keys ? createObject(keys, values) : values);
|
|
2412
|
+
}
|
|
2413
|
+
subscriber.complete();
|
|
2414
|
+
}
|
|
2415
|
+
}));
|
|
2416
|
+
}
|
|
2417
|
+
});
|
|
2418
|
+
return resultSelector ? result.pipe(mapOneOrManyArgs(resultSelector)) : result;
|
|
2419
|
+
}
|
|
2420
|
+
|
|
1130
2421
|
const nodeEventEmitterMethods = ['addListener', 'removeListener'];
|
|
1131
2422
|
const eventTargetMethods = ['addEventListener', 'removeEventListener'];
|
|
1132
2423
|
const jqueryMethods = ['on', 'off'];
|
|
@@ -1173,7 +2464,93 @@ function isEventTarget(target) {
|
|
|
1173
2464
|
return isFunction(target.addEventListener) && isFunction(target.removeEventListener);
|
|
1174
2465
|
}
|
|
1175
2466
|
|
|
1176
|
-
function
|
|
2467
|
+
function fromEventPattern(addHandler, removeHandler, resultSelector) {
|
|
2468
|
+
if (resultSelector) {
|
|
2469
|
+
return fromEventPattern(addHandler, removeHandler).pipe(mapOneOrManyArgs(resultSelector));
|
|
2470
|
+
}
|
|
2471
|
+
return new Observable((subscriber) => {
|
|
2472
|
+
const handler = (...e) => subscriber.next(e.length === 1 ? e[0] : e);
|
|
2473
|
+
const retValue = addHandler(handler);
|
|
2474
|
+
return isFunction(removeHandler) ? () => removeHandler(handler, retValue) : undefined;
|
|
2475
|
+
});
|
|
2476
|
+
}
|
|
2477
|
+
|
|
2478
|
+
function generate(initialStateOrOptions, condition, iterate, resultSelectorOrScheduler, scheduler) {
|
|
2479
|
+
let resultSelector;
|
|
2480
|
+
let initialState;
|
|
2481
|
+
if (arguments.length === 1) {
|
|
2482
|
+
({
|
|
2483
|
+
initialState,
|
|
2484
|
+
condition,
|
|
2485
|
+
iterate,
|
|
2486
|
+
resultSelector = identity,
|
|
2487
|
+
scheduler,
|
|
2488
|
+
} = initialStateOrOptions);
|
|
2489
|
+
}
|
|
2490
|
+
else {
|
|
2491
|
+
initialState = initialStateOrOptions;
|
|
2492
|
+
if (!resultSelectorOrScheduler || isScheduler(resultSelectorOrScheduler)) {
|
|
2493
|
+
resultSelector = identity;
|
|
2494
|
+
scheduler = resultSelectorOrScheduler;
|
|
2495
|
+
}
|
|
2496
|
+
else {
|
|
2497
|
+
resultSelector = resultSelectorOrScheduler;
|
|
2498
|
+
}
|
|
2499
|
+
}
|
|
2500
|
+
function* gen() {
|
|
2501
|
+
for (let state = initialState; !condition || condition(state); state = iterate(state)) {
|
|
2502
|
+
yield resultSelector(state);
|
|
2503
|
+
}
|
|
2504
|
+
}
|
|
2505
|
+
return defer((scheduler
|
|
2506
|
+
?
|
|
2507
|
+
() => scheduleIterable(gen(), scheduler)
|
|
2508
|
+
:
|
|
2509
|
+
gen));
|
|
2510
|
+
}
|
|
2511
|
+
|
|
2512
|
+
function iif(condition, trueResult, falseResult) {
|
|
2513
|
+
return defer(() => (condition() ? trueResult : falseResult));
|
|
2514
|
+
}
|
|
2515
|
+
|
|
2516
|
+
function timer(dueTime = 0, intervalOrScheduler, scheduler = async) {
|
|
2517
|
+
let intervalDuration = -1;
|
|
2518
|
+
if (intervalOrScheduler != null) {
|
|
2519
|
+
if (isScheduler(intervalOrScheduler)) {
|
|
2520
|
+
scheduler = intervalOrScheduler;
|
|
2521
|
+
}
|
|
2522
|
+
else {
|
|
2523
|
+
intervalDuration = intervalOrScheduler;
|
|
2524
|
+
}
|
|
2525
|
+
}
|
|
2526
|
+
return new Observable((subscriber) => {
|
|
2527
|
+
let due = isValidDate(dueTime) ? +dueTime - scheduler.now() : dueTime;
|
|
2528
|
+
if (due < 0) {
|
|
2529
|
+
due = 0;
|
|
2530
|
+
}
|
|
2531
|
+
let n = 0;
|
|
2532
|
+
return scheduler.schedule(function () {
|
|
2533
|
+
if (!subscriber.closed) {
|
|
2534
|
+
subscriber.next(n++);
|
|
2535
|
+
if (0 <= intervalDuration) {
|
|
2536
|
+
this.schedule(undefined, intervalDuration);
|
|
2537
|
+
}
|
|
2538
|
+
else {
|
|
2539
|
+
subscriber.complete();
|
|
2540
|
+
}
|
|
2541
|
+
}
|
|
2542
|
+
}, due);
|
|
2543
|
+
});
|
|
2544
|
+
}
|
|
2545
|
+
|
|
2546
|
+
function interval(period = 0, scheduler = asyncScheduler) {
|
|
2547
|
+
if (period < 0) {
|
|
2548
|
+
period = 0;
|
|
2549
|
+
}
|
|
2550
|
+
return timer(period, period, scheduler);
|
|
2551
|
+
}
|
|
2552
|
+
|
|
2553
|
+
function merge$1(...args) {
|
|
1177
2554
|
const scheduler = popScheduler(args);
|
|
1178
2555
|
const concurrent = popNumber(args, Infinity);
|
|
1179
2556
|
const sources = args;
|
|
@@ -1187,6 +2564,56 @@ function merge(...args) {
|
|
|
1187
2564
|
mergeAll(concurrent)(from(sources, scheduler));
|
|
1188
2565
|
}
|
|
1189
2566
|
|
|
2567
|
+
const NEVER = new Observable(noop);
|
|
2568
|
+
function never() {
|
|
2569
|
+
return NEVER;
|
|
2570
|
+
}
|
|
2571
|
+
|
|
2572
|
+
const { isArray } = Array;
|
|
2573
|
+
function argsOrArgArray(args) {
|
|
2574
|
+
return args.length === 1 && isArray(args[0]) ? args[0] : args;
|
|
2575
|
+
}
|
|
2576
|
+
|
|
2577
|
+
function onErrorResumeNext$1(...sources) {
|
|
2578
|
+
const nextSources = argsOrArgArray(sources);
|
|
2579
|
+
return operate((source, subscriber) => {
|
|
2580
|
+
const remaining = [source, ...nextSources];
|
|
2581
|
+
const subscribeNext = () => {
|
|
2582
|
+
if (!subscriber.closed) {
|
|
2583
|
+
if (remaining.length > 0) {
|
|
2584
|
+
let nextSource;
|
|
2585
|
+
try {
|
|
2586
|
+
nextSource = innerFrom(remaining.shift());
|
|
2587
|
+
}
|
|
2588
|
+
catch (err) {
|
|
2589
|
+
subscribeNext();
|
|
2590
|
+
return;
|
|
2591
|
+
}
|
|
2592
|
+
const innerSub = createOperatorSubscriber(subscriber, undefined, noop, noop);
|
|
2593
|
+
nextSource.subscribe(innerSub);
|
|
2594
|
+
innerSub.add(subscribeNext);
|
|
2595
|
+
}
|
|
2596
|
+
else {
|
|
2597
|
+
subscriber.complete();
|
|
2598
|
+
}
|
|
2599
|
+
}
|
|
2600
|
+
};
|
|
2601
|
+
subscribeNext();
|
|
2602
|
+
});
|
|
2603
|
+
}
|
|
2604
|
+
|
|
2605
|
+
function onErrorResumeNext(...sources) {
|
|
2606
|
+
return onErrorResumeNext$1(argsOrArgArray(sources))(EMPTY);
|
|
2607
|
+
}
|
|
2608
|
+
|
|
2609
|
+
function pairs(obj, scheduler) {
|
|
2610
|
+
return from(Object.entries(obj), scheduler);
|
|
2611
|
+
}
|
|
2612
|
+
|
|
2613
|
+
function not(pred, thisArg) {
|
|
2614
|
+
return (value, index) => !pred.call(thisArg, value, index);
|
|
2615
|
+
}
|
|
2616
|
+
|
|
1190
2617
|
function filter(predicate, thisArg) {
|
|
1191
2618
|
return operate((source, subscriber) => {
|
|
1192
2619
|
let index = 0;
|
|
@@ -1194,6 +2621,562 @@ function filter(predicate, thisArg) {
|
|
|
1194
2621
|
});
|
|
1195
2622
|
}
|
|
1196
2623
|
|
|
2624
|
+
function partition$1(source, predicate, thisArg) {
|
|
2625
|
+
return [filter(predicate, thisArg)(innerFrom(source)), filter(not(predicate, thisArg))(innerFrom(source))];
|
|
2626
|
+
}
|
|
2627
|
+
|
|
2628
|
+
function race$1(...sources) {
|
|
2629
|
+
sources = argsOrArgArray(sources);
|
|
2630
|
+
return sources.length === 1 ? innerFrom(sources[0]) : new Observable(raceInit(sources));
|
|
2631
|
+
}
|
|
2632
|
+
function raceInit(sources) {
|
|
2633
|
+
return (subscriber) => {
|
|
2634
|
+
let subscriptions = [];
|
|
2635
|
+
for (let i = 0; subscriptions && !subscriber.closed && i < sources.length; i++) {
|
|
2636
|
+
subscriptions.push(innerFrom(sources[i]).subscribe(createOperatorSubscriber(subscriber, (value) => {
|
|
2637
|
+
if (subscriptions) {
|
|
2638
|
+
for (let s = 0; s < subscriptions.length; s++) {
|
|
2639
|
+
s !== i && subscriptions[s].unsubscribe();
|
|
2640
|
+
}
|
|
2641
|
+
subscriptions = null;
|
|
2642
|
+
}
|
|
2643
|
+
subscriber.next(value);
|
|
2644
|
+
})));
|
|
2645
|
+
}
|
|
2646
|
+
};
|
|
2647
|
+
}
|
|
2648
|
+
|
|
2649
|
+
function range(start, count, scheduler) {
|
|
2650
|
+
if (count == null) {
|
|
2651
|
+
count = start;
|
|
2652
|
+
start = 0;
|
|
2653
|
+
}
|
|
2654
|
+
if (count <= 0) {
|
|
2655
|
+
return EMPTY;
|
|
2656
|
+
}
|
|
2657
|
+
const end = count + start;
|
|
2658
|
+
return new Observable(scheduler
|
|
2659
|
+
?
|
|
2660
|
+
(subscriber) => {
|
|
2661
|
+
let n = start;
|
|
2662
|
+
return scheduler.schedule(function () {
|
|
2663
|
+
if (n < end) {
|
|
2664
|
+
subscriber.next(n++);
|
|
2665
|
+
this.schedule();
|
|
2666
|
+
}
|
|
2667
|
+
else {
|
|
2668
|
+
subscriber.complete();
|
|
2669
|
+
}
|
|
2670
|
+
});
|
|
2671
|
+
}
|
|
2672
|
+
:
|
|
2673
|
+
(subscriber) => {
|
|
2674
|
+
let n = start;
|
|
2675
|
+
while (n < end && !subscriber.closed) {
|
|
2676
|
+
subscriber.next(n++);
|
|
2677
|
+
}
|
|
2678
|
+
subscriber.complete();
|
|
2679
|
+
});
|
|
2680
|
+
}
|
|
2681
|
+
|
|
2682
|
+
function using(resourceFactory, observableFactory) {
|
|
2683
|
+
return new Observable((subscriber) => {
|
|
2684
|
+
const resource = resourceFactory();
|
|
2685
|
+
const result = observableFactory(resource);
|
|
2686
|
+
const source = result ? innerFrom(result) : EMPTY;
|
|
2687
|
+
source.subscribe(subscriber);
|
|
2688
|
+
return () => {
|
|
2689
|
+
if (resource) {
|
|
2690
|
+
resource.unsubscribe();
|
|
2691
|
+
}
|
|
2692
|
+
};
|
|
2693
|
+
});
|
|
2694
|
+
}
|
|
2695
|
+
|
|
2696
|
+
function zip$1(...args) {
|
|
2697
|
+
const resultSelector = popResultSelector(args);
|
|
2698
|
+
const sources = argsOrArgArray(args);
|
|
2699
|
+
return sources.length
|
|
2700
|
+
? new Observable((subscriber) => {
|
|
2701
|
+
let buffers = sources.map(() => []);
|
|
2702
|
+
let completed = sources.map(() => false);
|
|
2703
|
+
subscriber.add(() => {
|
|
2704
|
+
buffers = completed = null;
|
|
2705
|
+
});
|
|
2706
|
+
for (let sourceIndex = 0; !subscriber.closed && sourceIndex < sources.length; sourceIndex++) {
|
|
2707
|
+
innerFrom(sources[sourceIndex]).subscribe(createOperatorSubscriber(subscriber, (value) => {
|
|
2708
|
+
buffers[sourceIndex].push(value);
|
|
2709
|
+
if (buffers.every((buffer) => buffer.length)) {
|
|
2710
|
+
const result = buffers.map((buffer) => buffer.shift());
|
|
2711
|
+
subscriber.next(resultSelector ? resultSelector(...result) : result);
|
|
2712
|
+
if (buffers.some((buffer, i) => !buffer.length && completed[i])) {
|
|
2713
|
+
subscriber.complete();
|
|
2714
|
+
}
|
|
2715
|
+
}
|
|
2716
|
+
}, () => {
|
|
2717
|
+
completed[sourceIndex] = true;
|
|
2718
|
+
!buffers[sourceIndex].length && subscriber.complete();
|
|
2719
|
+
}));
|
|
2720
|
+
}
|
|
2721
|
+
return () => {
|
|
2722
|
+
buffers = completed = null;
|
|
2723
|
+
};
|
|
2724
|
+
})
|
|
2725
|
+
: EMPTY;
|
|
2726
|
+
}
|
|
2727
|
+
|
|
2728
|
+
function audit(durationSelector) {
|
|
2729
|
+
return operate((source, subscriber) => {
|
|
2730
|
+
let hasValue = false;
|
|
2731
|
+
let lastValue = null;
|
|
2732
|
+
let durationSubscriber = null;
|
|
2733
|
+
let isComplete = false;
|
|
2734
|
+
const endDuration = () => {
|
|
2735
|
+
durationSubscriber === null || durationSubscriber === void 0 ? void 0 : durationSubscriber.unsubscribe();
|
|
2736
|
+
durationSubscriber = null;
|
|
2737
|
+
if (hasValue) {
|
|
2738
|
+
hasValue = false;
|
|
2739
|
+
const value = lastValue;
|
|
2740
|
+
lastValue = null;
|
|
2741
|
+
subscriber.next(value);
|
|
2742
|
+
}
|
|
2743
|
+
isComplete && subscriber.complete();
|
|
2744
|
+
};
|
|
2745
|
+
const cleanupDuration = () => {
|
|
2746
|
+
durationSubscriber = null;
|
|
2747
|
+
isComplete && subscriber.complete();
|
|
2748
|
+
};
|
|
2749
|
+
source.subscribe(createOperatorSubscriber(subscriber, (value) => {
|
|
2750
|
+
hasValue = true;
|
|
2751
|
+
lastValue = value;
|
|
2752
|
+
if (!durationSubscriber) {
|
|
2753
|
+
innerFrom(durationSelector(value)).subscribe((durationSubscriber = createOperatorSubscriber(subscriber, endDuration, cleanupDuration)));
|
|
2754
|
+
}
|
|
2755
|
+
}, () => {
|
|
2756
|
+
isComplete = true;
|
|
2757
|
+
(!hasValue || !durationSubscriber || durationSubscriber.closed) && subscriber.complete();
|
|
2758
|
+
}));
|
|
2759
|
+
});
|
|
2760
|
+
}
|
|
2761
|
+
|
|
2762
|
+
function auditTime(duration, scheduler = asyncScheduler) {
|
|
2763
|
+
return audit(() => timer(duration, scheduler));
|
|
2764
|
+
}
|
|
2765
|
+
|
|
2766
|
+
function buffer(closingNotifier) {
|
|
2767
|
+
return operate((source, subscriber) => {
|
|
2768
|
+
let currentBuffer = [];
|
|
2769
|
+
source.subscribe(createOperatorSubscriber(subscriber, (value) => currentBuffer.push(value), () => {
|
|
2770
|
+
subscriber.next(currentBuffer);
|
|
2771
|
+
subscriber.complete();
|
|
2772
|
+
}));
|
|
2773
|
+
closingNotifier.subscribe(createOperatorSubscriber(subscriber, () => {
|
|
2774
|
+
const b = currentBuffer;
|
|
2775
|
+
currentBuffer = [];
|
|
2776
|
+
subscriber.next(b);
|
|
2777
|
+
}, noop));
|
|
2778
|
+
return () => {
|
|
2779
|
+
currentBuffer = null;
|
|
2780
|
+
};
|
|
2781
|
+
});
|
|
2782
|
+
}
|
|
2783
|
+
|
|
2784
|
+
function bufferCount(bufferSize, startBufferEvery = null) {
|
|
2785
|
+
startBufferEvery = startBufferEvery !== null && startBufferEvery !== void 0 ? startBufferEvery : bufferSize;
|
|
2786
|
+
return operate((source, subscriber) => {
|
|
2787
|
+
let buffers = [];
|
|
2788
|
+
let count = 0;
|
|
2789
|
+
source.subscribe(createOperatorSubscriber(subscriber, (value) => {
|
|
2790
|
+
let toEmit = null;
|
|
2791
|
+
if (count++ % startBufferEvery === 0) {
|
|
2792
|
+
buffers.push([]);
|
|
2793
|
+
}
|
|
2794
|
+
for (const buffer of buffers) {
|
|
2795
|
+
buffer.push(value);
|
|
2796
|
+
if (bufferSize <= buffer.length) {
|
|
2797
|
+
toEmit = toEmit !== null && toEmit !== void 0 ? toEmit : [];
|
|
2798
|
+
toEmit.push(buffer);
|
|
2799
|
+
}
|
|
2800
|
+
}
|
|
2801
|
+
if (toEmit) {
|
|
2802
|
+
for (const buffer of toEmit) {
|
|
2803
|
+
arrRemove(buffers, buffer);
|
|
2804
|
+
subscriber.next(buffer);
|
|
2805
|
+
}
|
|
2806
|
+
}
|
|
2807
|
+
}, () => {
|
|
2808
|
+
for (const buffer of buffers) {
|
|
2809
|
+
subscriber.next(buffer);
|
|
2810
|
+
}
|
|
2811
|
+
subscriber.complete();
|
|
2812
|
+
}, undefined, () => {
|
|
2813
|
+
buffers = null;
|
|
2814
|
+
}));
|
|
2815
|
+
});
|
|
2816
|
+
}
|
|
2817
|
+
|
|
2818
|
+
function bufferTime(bufferTimeSpan, ...otherArgs) {
|
|
2819
|
+
var _a, _b;
|
|
2820
|
+
const scheduler = (_a = popScheduler(otherArgs)) !== null && _a !== void 0 ? _a : asyncScheduler;
|
|
2821
|
+
const bufferCreationInterval = (_b = otherArgs[0]) !== null && _b !== void 0 ? _b : null;
|
|
2822
|
+
const maxBufferSize = otherArgs[1] || Infinity;
|
|
2823
|
+
return operate((source, subscriber) => {
|
|
2824
|
+
let bufferRecords = [];
|
|
2825
|
+
let restartOnEmit = false;
|
|
2826
|
+
const emit = (record) => {
|
|
2827
|
+
const { buffer, subs } = record;
|
|
2828
|
+
subs.unsubscribe();
|
|
2829
|
+
arrRemove(bufferRecords, record);
|
|
2830
|
+
subscriber.next(buffer);
|
|
2831
|
+
restartOnEmit && startBuffer();
|
|
2832
|
+
};
|
|
2833
|
+
const startBuffer = () => {
|
|
2834
|
+
if (bufferRecords) {
|
|
2835
|
+
const subs = new Subscription();
|
|
2836
|
+
subscriber.add(subs);
|
|
2837
|
+
const buffer = [];
|
|
2838
|
+
const record = {
|
|
2839
|
+
buffer,
|
|
2840
|
+
subs,
|
|
2841
|
+
};
|
|
2842
|
+
bufferRecords.push(record);
|
|
2843
|
+
executeSchedule(subs, scheduler, () => emit(record), bufferTimeSpan);
|
|
2844
|
+
}
|
|
2845
|
+
};
|
|
2846
|
+
if (bufferCreationInterval !== null && bufferCreationInterval >= 0) {
|
|
2847
|
+
executeSchedule(subscriber, scheduler, startBuffer, bufferCreationInterval, true);
|
|
2848
|
+
}
|
|
2849
|
+
else {
|
|
2850
|
+
restartOnEmit = true;
|
|
2851
|
+
}
|
|
2852
|
+
startBuffer();
|
|
2853
|
+
const bufferTimeSubscriber = createOperatorSubscriber(subscriber, (value) => {
|
|
2854
|
+
const recordsCopy = bufferRecords.slice();
|
|
2855
|
+
for (const record of recordsCopy) {
|
|
2856
|
+
const { buffer } = record;
|
|
2857
|
+
buffer.push(value);
|
|
2858
|
+
maxBufferSize <= buffer.length && emit(record);
|
|
2859
|
+
}
|
|
2860
|
+
}, () => {
|
|
2861
|
+
while (bufferRecords === null || bufferRecords === void 0 ? void 0 : bufferRecords.length) {
|
|
2862
|
+
subscriber.next(bufferRecords.shift().buffer);
|
|
2863
|
+
}
|
|
2864
|
+
bufferTimeSubscriber === null || bufferTimeSubscriber === void 0 ? void 0 : bufferTimeSubscriber.unsubscribe();
|
|
2865
|
+
subscriber.complete();
|
|
2866
|
+
subscriber.unsubscribe();
|
|
2867
|
+
}, undefined, () => (bufferRecords = null));
|
|
2868
|
+
source.subscribe(bufferTimeSubscriber);
|
|
2869
|
+
});
|
|
2870
|
+
}
|
|
2871
|
+
|
|
2872
|
+
function bufferToggle(openings, closingSelector) {
|
|
2873
|
+
return operate((source, subscriber) => {
|
|
2874
|
+
const buffers = [];
|
|
2875
|
+
innerFrom(openings).subscribe(createOperatorSubscriber(subscriber, (openValue) => {
|
|
2876
|
+
const buffer = [];
|
|
2877
|
+
buffers.push(buffer);
|
|
2878
|
+
const closingSubscription = new Subscription();
|
|
2879
|
+
const emitBuffer = () => {
|
|
2880
|
+
arrRemove(buffers, buffer);
|
|
2881
|
+
subscriber.next(buffer);
|
|
2882
|
+
closingSubscription.unsubscribe();
|
|
2883
|
+
};
|
|
2884
|
+
closingSubscription.add(innerFrom(closingSelector(openValue)).subscribe(createOperatorSubscriber(subscriber, emitBuffer, noop)));
|
|
2885
|
+
}, noop));
|
|
2886
|
+
source.subscribe(createOperatorSubscriber(subscriber, (value) => {
|
|
2887
|
+
for (const buffer of buffers) {
|
|
2888
|
+
buffer.push(value);
|
|
2889
|
+
}
|
|
2890
|
+
}, () => {
|
|
2891
|
+
while (buffers.length > 0) {
|
|
2892
|
+
subscriber.next(buffers.shift());
|
|
2893
|
+
}
|
|
2894
|
+
subscriber.complete();
|
|
2895
|
+
}));
|
|
2896
|
+
});
|
|
2897
|
+
}
|
|
2898
|
+
|
|
2899
|
+
function bufferWhen(closingSelector) {
|
|
2900
|
+
return operate((source, subscriber) => {
|
|
2901
|
+
let buffer = null;
|
|
2902
|
+
let closingSubscriber = null;
|
|
2903
|
+
const openBuffer = () => {
|
|
2904
|
+
closingSubscriber === null || closingSubscriber === void 0 ? void 0 : closingSubscriber.unsubscribe();
|
|
2905
|
+
const b = buffer;
|
|
2906
|
+
buffer = [];
|
|
2907
|
+
b && subscriber.next(b);
|
|
2908
|
+
innerFrom(closingSelector()).subscribe((closingSubscriber = createOperatorSubscriber(subscriber, openBuffer, noop)));
|
|
2909
|
+
};
|
|
2910
|
+
openBuffer();
|
|
2911
|
+
source.subscribe(createOperatorSubscriber(subscriber, (value) => buffer === null || buffer === void 0 ? void 0 : buffer.push(value), () => {
|
|
2912
|
+
buffer && subscriber.next(buffer);
|
|
2913
|
+
subscriber.complete();
|
|
2914
|
+
}, undefined, () => (buffer = closingSubscriber = null)));
|
|
2915
|
+
});
|
|
2916
|
+
}
|
|
2917
|
+
|
|
2918
|
+
function catchError(selector) {
|
|
2919
|
+
return operate((source, subscriber) => {
|
|
2920
|
+
let innerSub = null;
|
|
2921
|
+
let syncUnsub = false;
|
|
2922
|
+
let handledResult;
|
|
2923
|
+
innerSub = source.subscribe(createOperatorSubscriber(subscriber, undefined, undefined, (err) => {
|
|
2924
|
+
handledResult = innerFrom(selector(err, catchError(selector)(source)));
|
|
2925
|
+
if (innerSub) {
|
|
2926
|
+
innerSub.unsubscribe();
|
|
2927
|
+
innerSub = null;
|
|
2928
|
+
handledResult.subscribe(subscriber);
|
|
2929
|
+
}
|
|
2930
|
+
else {
|
|
2931
|
+
syncUnsub = true;
|
|
2932
|
+
}
|
|
2933
|
+
}));
|
|
2934
|
+
if (syncUnsub) {
|
|
2935
|
+
innerSub.unsubscribe();
|
|
2936
|
+
innerSub = null;
|
|
2937
|
+
handledResult.subscribe(subscriber);
|
|
2938
|
+
}
|
|
2939
|
+
});
|
|
2940
|
+
}
|
|
2941
|
+
|
|
2942
|
+
function scanInternals(accumulator, seed, hasSeed, emitOnNext, emitBeforeComplete) {
|
|
2943
|
+
return (source, subscriber) => {
|
|
2944
|
+
let hasState = hasSeed;
|
|
2945
|
+
let state = seed;
|
|
2946
|
+
let index = 0;
|
|
2947
|
+
source.subscribe(createOperatorSubscriber(subscriber, (value) => {
|
|
2948
|
+
const i = index++;
|
|
2949
|
+
state = hasState
|
|
2950
|
+
?
|
|
2951
|
+
accumulator(state, value, i)
|
|
2952
|
+
:
|
|
2953
|
+
((hasState = true), value);
|
|
2954
|
+
emitOnNext && subscriber.next(state);
|
|
2955
|
+
}, emitBeforeComplete &&
|
|
2956
|
+
(() => {
|
|
2957
|
+
hasState && subscriber.next(state);
|
|
2958
|
+
subscriber.complete();
|
|
2959
|
+
})));
|
|
2960
|
+
};
|
|
2961
|
+
}
|
|
2962
|
+
|
|
2963
|
+
function reduce(accumulator, seed) {
|
|
2964
|
+
return operate(scanInternals(accumulator, seed, arguments.length >= 2, false, true));
|
|
2965
|
+
}
|
|
2966
|
+
|
|
2967
|
+
const arrReducer = (arr, value) => (arr.push(value), arr);
|
|
2968
|
+
function toArray() {
|
|
2969
|
+
return operate((source, subscriber) => {
|
|
2970
|
+
reduce(arrReducer, [])(source).subscribe(subscriber);
|
|
2971
|
+
});
|
|
2972
|
+
}
|
|
2973
|
+
|
|
2974
|
+
function joinAllInternals(joinFn, project) {
|
|
2975
|
+
return pipe(toArray(), mergeMap((sources) => joinFn(sources)), project ? mapOneOrManyArgs(project) : identity);
|
|
2976
|
+
}
|
|
2977
|
+
|
|
2978
|
+
function combineLatestAll(project) {
|
|
2979
|
+
return joinAllInternals(combineLatest$1, project);
|
|
2980
|
+
}
|
|
2981
|
+
|
|
2982
|
+
const combineAll = combineLatestAll;
|
|
2983
|
+
|
|
2984
|
+
function combineLatest(...args) {
|
|
2985
|
+
const resultSelector = popResultSelector(args);
|
|
2986
|
+
return resultSelector
|
|
2987
|
+
? pipe(combineLatest(...args), mapOneOrManyArgs(resultSelector))
|
|
2988
|
+
: operate((source, subscriber) => {
|
|
2989
|
+
combineLatestInit([source, ...argsOrArgArray(args)])(subscriber);
|
|
2990
|
+
});
|
|
2991
|
+
}
|
|
2992
|
+
|
|
2993
|
+
function combineLatestWith(...otherSources) {
|
|
2994
|
+
return combineLatest(...otherSources);
|
|
2995
|
+
}
|
|
2996
|
+
|
|
2997
|
+
function concatMap(project, resultSelector) {
|
|
2998
|
+
return isFunction(resultSelector) ? mergeMap(project, resultSelector, 1) : mergeMap(project, 1);
|
|
2999
|
+
}
|
|
3000
|
+
|
|
3001
|
+
function concatMapTo(innerObservable, resultSelector) {
|
|
3002
|
+
return isFunction(resultSelector) ? concatMap(() => innerObservable, resultSelector) : concatMap(() => innerObservable);
|
|
3003
|
+
}
|
|
3004
|
+
|
|
3005
|
+
function concat(...args) {
|
|
3006
|
+
const scheduler = popScheduler(args);
|
|
3007
|
+
return operate((source, subscriber) => {
|
|
3008
|
+
concatAll()(from([source, ...args], scheduler)).subscribe(subscriber);
|
|
3009
|
+
});
|
|
3010
|
+
}
|
|
3011
|
+
|
|
3012
|
+
function concatWith(...otherSources) {
|
|
3013
|
+
return concat(...otherSources);
|
|
3014
|
+
}
|
|
3015
|
+
|
|
3016
|
+
function fromSubscribable(subscribable) {
|
|
3017
|
+
return new Observable((subscriber) => subscribable.subscribe(subscriber));
|
|
3018
|
+
}
|
|
3019
|
+
|
|
3020
|
+
const DEFAULT_CONFIG = {
|
|
3021
|
+
connector: () => new Subject(),
|
|
3022
|
+
};
|
|
3023
|
+
function connect(selector, config = DEFAULT_CONFIG) {
|
|
3024
|
+
const { connector } = config;
|
|
3025
|
+
return operate((source, subscriber) => {
|
|
3026
|
+
const subject = connector();
|
|
3027
|
+
from(selector(fromSubscribable(subject))).subscribe(subscriber);
|
|
3028
|
+
subscriber.add(source.subscribe(subject));
|
|
3029
|
+
});
|
|
3030
|
+
}
|
|
3031
|
+
|
|
3032
|
+
function count(predicate) {
|
|
3033
|
+
return reduce((total, value, i) => (!predicate || predicate(value, i) ? total + 1 : total), 0);
|
|
3034
|
+
}
|
|
3035
|
+
|
|
3036
|
+
function debounce(durationSelector) {
|
|
3037
|
+
return operate((source, subscriber) => {
|
|
3038
|
+
let hasValue = false;
|
|
3039
|
+
let lastValue = null;
|
|
3040
|
+
let durationSubscriber = null;
|
|
3041
|
+
const emit = () => {
|
|
3042
|
+
durationSubscriber === null || durationSubscriber === void 0 ? void 0 : durationSubscriber.unsubscribe();
|
|
3043
|
+
durationSubscriber = null;
|
|
3044
|
+
if (hasValue) {
|
|
3045
|
+
hasValue = false;
|
|
3046
|
+
const value = lastValue;
|
|
3047
|
+
lastValue = null;
|
|
3048
|
+
subscriber.next(value);
|
|
3049
|
+
}
|
|
3050
|
+
};
|
|
3051
|
+
source.subscribe(createOperatorSubscriber(subscriber, (value) => {
|
|
3052
|
+
durationSubscriber === null || durationSubscriber === void 0 ? void 0 : durationSubscriber.unsubscribe();
|
|
3053
|
+
hasValue = true;
|
|
3054
|
+
lastValue = value;
|
|
3055
|
+
durationSubscriber = createOperatorSubscriber(subscriber, emit, noop);
|
|
3056
|
+
innerFrom(durationSelector(value)).subscribe(durationSubscriber);
|
|
3057
|
+
}, () => {
|
|
3058
|
+
emit();
|
|
3059
|
+
subscriber.complete();
|
|
3060
|
+
}, undefined, () => {
|
|
3061
|
+
lastValue = durationSubscriber = null;
|
|
3062
|
+
}));
|
|
3063
|
+
});
|
|
3064
|
+
}
|
|
3065
|
+
|
|
3066
|
+
function debounceTime(dueTime, scheduler = asyncScheduler) {
|
|
3067
|
+
return operate((source, subscriber) => {
|
|
3068
|
+
let activeTask = null;
|
|
3069
|
+
let lastValue = null;
|
|
3070
|
+
let lastTime = null;
|
|
3071
|
+
const emit = () => {
|
|
3072
|
+
if (activeTask) {
|
|
3073
|
+
activeTask.unsubscribe();
|
|
3074
|
+
activeTask = null;
|
|
3075
|
+
const value = lastValue;
|
|
3076
|
+
lastValue = null;
|
|
3077
|
+
subscriber.next(value);
|
|
3078
|
+
}
|
|
3079
|
+
};
|
|
3080
|
+
function emitWhenIdle() {
|
|
3081
|
+
const targetTime = lastTime + dueTime;
|
|
3082
|
+
const now = scheduler.now();
|
|
3083
|
+
if (now < targetTime) {
|
|
3084
|
+
activeTask = this.schedule(undefined, targetTime - now);
|
|
3085
|
+
subscriber.add(activeTask);
|
|
3086
|
+
return;
|
|
3087
|
+
}
|
|
3088
|
+
emit();
|
|
3089
|
+
}
|
|
3090
|
+
source.subscribe(createOperatorSubscriber(subscriber, (value) => {
|
|
3091
|
+
lastValue = value;
|
|
3092
|
+
lastTime = scheduler.now();
|
|
3093
|
+
if (!activeTask) {
|
|
3094
|
+
activeTask = scheduler.schedule(emitWhenIdle, dueTime);
|
|
3095
|
+
subscriber.add(activeTask);
|
|
3096
|
+
}
|
|
3097
|
+
}, () => {
|
|
3098
|
+
emit();
|
|
3099
|
+
subscriber.complete();
|
|
3100
|
+
}, undefined, () => {
|
|
3101
|
+
lastValue = activeTask = null;
|
|
3102
|
+
}));
|
|
3103
|
+
});
|
|
3104
|
+
}
|
|
3105
|
+
|
|
3106
|
+
function defaultIfEmpty(defaultValue) {
|
|
3107
|
+
return operate((source, subscriber) => {
|
|
3108
|
+
let hasValue = false;
|
|
3109
|
+
source.subscribe(createOperatorSubscriber(subscriber, (value) => {
|
|
3110
|
+
hasValue = true;
|
|
3111
|
+
subscriber.next(value);
|
|
3112
|
+
}, () => {
|
|
3113
|
+
if (!hasValue) {
|
|
3114
|
+
subscriber.next(defaultValue);
|
|
3115
|
+
}
|
|
3116
|
+
subscriber.complete();
|
|
3117
|
+
}));
|
|
3118
|
+
});
|
|
3119
|
+
}
|
|
3120
|
+
|
|
3121
|
+
function take(count) {
|
|
3122
|
+
return count <= 0
|
|
3123
|
+
?
|
|
3124
|
+
() => EMPTY
|
|
3125
|
+
: operate((source, subscriber) => {
|
|
3126
|
+
let seen = 0;
|
|
3127
|
+
source.subscribe(createOperatorSubscriber(subscriber, (value) => {
|
|
3128
|
+
if (++seen <= count) {
|
|
3129
|
+
subscriber.next(value);
|
|
3130
|
+
if (count <= seen) {
|
|
3131
|
+
subscriber.complete();
|
|
3132
|
+
}
|
|
3133
|
+
}
|
|
3134
|
+
}));
|
|
3135
|
+
});
|
|
3136
|
+
}
|
|
3137
|
+
|
|
3138
|
+
function ignoreElements() {
|
|
3139
|
+
return operate((source, subscriber) => {
|
|
3140
|
+
source.subscribe(createOperatorSubscriber(subscriber, noop));
|
|
3141
|
+
});
|
|
3142
|
+
}
|
|
3143
|
+
|
|
3144
|
+
function mapTo(value) {
|
|
3145
|
+
return map(() => value);
|
|
3146
|
+
}
|
|
3147
|
+
|
|
3148
|
+
function delayWhen(delayDurationSelector, subscriptionDelay) {
|
|
3149
|
+
if (subscriptionDelay) {
|
|
3150
|
+
return (source) => concat$1(subscriptionDelay.pipe(take(1), ignoreElements()), source.pipe(delayWhen(delayDurationSelector)));
|
|
3151
|
+
}
|
|
3152
|
+
return mergeMap((value, index) => delayDurationSelector(value, index).pipe(take(1), mapTo(value)));
|
|
3153
|
+
}
|
|
3154
|
+
|
|
3155
|
+
function delay(due, scheduler = asyncScheduler) {
|
|
3156
|
+
const duration = timer(due, scheduler);
|
|
3157
|
+
return delayWhen(() => duration);
|
|
3158
|
+
}
|
|
3159
|
+
|
|
3160
|
+
function dematerialize() {
|
|
3161
|
+
return operate((source, subscriber) => {
|
|
3162
|
+
source.subscribe(createOperatorSubscriber(subscriber, (notification) => observeNotification(notification, subscriber)));
|
|
3163
|
+
});
|
|
3164
|
+
}
|
|
3165
|
+
|
|
3166
|
+
function distinct(keySelector, flushes) {
|
|
3167
|
+
return operate((source, subscriber) => {
|
|
3168
|
+
const distinctKeys = new Set();
|
|
3169
|
+
source.subscribe(createOperatorSubscriber(subscriber, (value) => {
|
|
3170
|
+
const key = keySelector ? keySelector(value) : value;
|
|
3171
|
+
if (!distinctKeys.has(key)) {
|
|
3172
|
+
distinctKeys.add(key);
|
|
3173
|
+
subscriber.next(value);
|
|
3174
|
+
}
|
|
3175
|
+
}));
|
|
3176
|
+
flushes === null || flushes === void 0 ? void 0 : flushes.subscribe(createOperatorSubscriber(subscriber, () => distinctKeys.clear(), noop));
|
|
3177
|
+
});
|
|
3178
|
+
}
|
|
3179
|
+
|
|
1197
3180
|
function distinctUntilChanged(comparator, keySelector = identity) {
|
|
1198
3181
|
comparator = comparator !== null && comparator !== void 0 ? comparator : defaultCompare;
|
|
1199
3182
|
return operate((source, subscriber) => {
|
|
@@ -1213,13 +3196,1216 @@ function defaultCompare(a, b) {
|
|
|
1213
3196
|
return a === b;
|
|
1214
3197
|
}
|
|
1215
3198
|
|
|
1216
|
-
function
|
|
3199
|
+
function distinctUntilKeyChanged(key, compare) {
|
|
3200
|
+
return distinctUntilChanged((x, y) => compare ? compare(x[key], y[key]) : x[key] === y[key]);
|
|
3201
|
+
}
|
|
3202
|
+
|
|
3203
|
+
function throwIfEmpty(errorFactory = defaultErrorFactory) {
|
|
1217
3204
|
return operate((source, subscriber) => {
|
|
1218
|
-
|
|
1219
|
-
|
|
3205
|
+
let hasValue = false;
|
|
3206
|
+
source.subscribe(createOperatorSubscriber(subscriber, (value) => {
|
|
3207
|
+
hasValue = true;
|
|
3208
|
+
subscriber.next(value);
|
|
3209
|
+
}, () => (hasValue ? subscriber.complete() : subscriber.error(errorFactory()))));
|
|
3210
|
+
});
|
|
3211
|
+
}
|
|
3212
|
+
function defaultErrorFactory() {
|
|
3213
|
+
return new EmptyError();
|
|
3214
|
+
}
|
|
3215
|
+
|
|
3216
|
+
function elementAt(index, defaultValue) {
|
|
3217
|
+
if (index < 0) {
|
|
3218
|
+
throw new ArgumentOutOfRangeError();
|
|
3219
|
+
}
|
|
3220
|
+
const hasDefaultValue = arguments.length >= 2;
|
|
3221
|
+
return (source) => source.pipe(filter((v, i) => i === index), take(1), hasDefaultValue ? defaultIfEmpty(defaultValue) : throwIfEmpty(() => new ArgumentOutOfRangeError()));
|
|
3222
|
+
}
|
|
3223
|
+
|
|
3224
|
+
function endWith(...values) {
|
|
3225
|
+
return (source) => concat$1(source, of(...values));
|
|
3226
|
+
}
|
|
3227
|
+
|
|
3228
|
+
function every(predicate, thisArg) {
|
|
3229
|
+
return operate((source, subscriber) => {
|
|
3230
|
+
let index = 0;
|
|
3231
|
+
source.subscribe(createOperatorSubscriber(subscriber, (value) => {
|
|
3232
|
+
if (!predicate.call(thisArg, value, index++, source)) {
|
|
3233
|
+
subscriber.next(false);
|
|
3234
|
+
subscriber.complete();
|
|
3235
|
+
}
|
|
3236
|
+
}, () => {
|
|
3237
|
+
subscriber.next(true);
|
|
3238
|
+
subscriber.complete();
|
|
3239
|
+
}));
|
|
3240
|
+
});
|
|
3241
|
+
}
|
|
3242
|
+
|
|
3243
|
+
function exhaustAll() {
|
|
3244
|
+
return operate((source, subscriber) => {
|
|
3245
|
+
let isComplete = false;
|
|
3246
|
+
let innerSub = null;
|
|
3247
|
+
source.subscribe(createOperatorSubscriber(subscriber, (inner) => {
|
|
3248
|
+
if (!innerSub) {
|
|
3249
|
+
innerSub = innerFrom(inner).subscribe(createOperatorSubscriber(subscriber, undefined, () => {
|
|
3250
|
+
innerSub = null;
|
|
3251
|
+
isComplete && subscriber.complete();
|
|
3252
|
+
}));
|
|
3253
|
+
}
|
|
3254
|
+
}, () => {
|
|
3255
|
+
isComplete = true;
|
|
3256
|
+
!innerSub && subscriber.complete();
|
|
3257
|
+
}));
|
|
1220
3258
|
});
|
|
1221
3259
|
}
|
|
1222
3260
|
|
|
3261
|
+
const exhaust = exhaustAll;
|
|
3262
|
+
|
|
3263
|
+
function exhaustMap(project, resultSelector) {
|
|
3264
|
+
if (resultSelector) {
|
|
3265
|
+
return (source) => source.pipe(exhaustMap((a, i) => innerFrom(project(a, i)).pipe(map((b, ii) => resultSelector(a, b, i, ii)))));
|
|
3266
|
+
}
|
|
3267
|
+
return operate((source, subscriber) => {
|
|
3268
|
+
let index = 0;
|
|
3269
|
+
let innerSub = null;
|
|
3270
|
+
let isComplete = false;
|
|
3271
|
+
source.subscribe(createOperatorSubscriber(subscriber, (outerValue) => {
|
|
3272
|
+
if (!innerSub) {
|
|
3273
|
+
innerSub = createOperatorSubscriber(subscriber, undefined, () => {
|
|
3274
|
+
innerSub = null;
|
|
3275
|
+
isComplete && subscriber.complete();
|
|
3276
|
+
});
|
|
3277
|
+
innerFrom(project(outerValue, index++)).subscribe(innerSub);
|
|
3278
|
+
}
|
|
3279
|
+
}, () => {
|
|
3280
|
+
isComplete = true;
|
|
3281
|
+
!innerSub && subscriber.complete();
|
|
3282
|
+
}));
|
|
3283
|
+
});
|
|
3284
|
+
}
|
|
3285
|
+
|
|
3286
|
+
function expand(project, concurrent = Infinity, scheduler) {
|
|
3287
|
+
concurrent = (concurrent || 0) < 1 ? Infinity : concurrent;
|
|
3288
|
+
return operate((source, subscriber) => mergeInternals(source, subscriber, project, concurrent, undefined, true, scheduler));
|
|
3289
|
+
}
|
|
3290
|
+
|
|
3291
|
+
function finalize(callback) {
|
|
3292
|
+
return operate((source, subscriber) => {
|
|
3293
|
+
try {
|
|
3294
|
+
source.subscribe(subscriber);
|
|
3295
|
+
}
|
|
3296
|
+
finally {
|
|
3297
|
+
subscriber.add(callback);
|
|
3298
|
+
}
|
|
3299
|
+
});
|
|
3300
|
+
}
|
|
3301
|
+
|
|
3302
|
+
function find(predicate, thisArg) {
|
|
3303
|
+
return operate(createFind(predicate, thisArg, 'value'));
|
|
3304
|
+
}
|
|
3305
|
+
function createFind(predicate, thisArg, emit) {
|
|
3306
|
+
const findIndex = emit === 'index';
|
|
3307
|
+
return (source, subscriber) => {
|
|
3308
|
+
let index = 0;
|
|
3309
|
+
source.subscribe(createOperatorSubscriber(subscriber, (value) => {
|
|
3310
|
+
const i = index++;
|
|
3311
|
+
if (predicate.call(thisArg, value, i, source)) {
|
|
3312
|
+
subscriber.next(findIndex ? i : value);
|
|
3313
|
+
subscriber.complete();
|
|
3314
|
+
}
|
|
3315
|
+
}, () => {
|
|
3316
|
+
subscriber.next(findIndex ? -1 : undefined);
|
|
3317
|
+
subscriber.complete();
|
|
3318
|
+
}));
|
|
3319
|
+
};
|
|
3320
|
+
}
|
|
3321
|
+
|
|
3322
|
+
function findIndex(predicate, thisArg) {
|
|
3323
|
+
return operate(createFind(predicate, thisArg, 'index'));
|
|
3324
|
+
}
|
|
3325
|
+
|
|
3326
|
+
function first(predicate, defaultValue) {
|
|
3327
|
+
const hasDefaultValue = arguments.length >= 2;
|
|
3328
|
+
return (source) => source.pipe(predicate ? filter((v, i) => predicate(v, i, source)) : identity, take(1), hasDefaultValue ? defaultIfEmpty(defaultValue) : throwIfEmpty(() => new EmptyError()));
|
|
3329
|
+
}
|
|
3330
|
+
|
|
3331
|
+
function groupBy(keySelector, elementOrOptions, duration, connector) {
|
|
3332
|
+
return operate((source, subscriber) => {
|
|
3333
|
+
let element;
|
|
3334
|
+
if (!elementOrOptions || typeof elementOrOptions === 'function') {
|
|
3335
|
+
element = elementOrOptions;
|
|
3336
|
+
}
|
|
3337
|
+
else {
|
|
3338
|
+
({ duration, element, connector } = elementOrOptions);
|
|
3339
|
+
}
|
|
3340
|
+
const groups = new Map();
|
|
3341
|
+
const notify = (cb) => {
|
|
3342
|
+
groups.forEach(cb);
|
|
3343
|
+
cb(subscriber);
|
|
3344
|
+
};
|
|
3345
|
+
const handleError = (err) => notify((consumer) => consumer.error(err));
|
|
3346
|
+
let activeGroups = 0;
|
|
3347
|
+
let teardownAttempted = false;
|
|
3348
|
+
const groupBySourceSubscriber = new OperatorSubscriber(subscriber, (value) => {
|
|
3349
|
+
try {
|
|
3350
|
+
const key = keySelector(value);
|
|
3351
|
+
let group = groups.get(key);
|
|
3352
|
+
if (!group) {
|
|
3353
|
+
groups.set(key, (group = connector ? connector() : new Subject()));
|
|
3354
|
+
const grouped = createGroupedObservable(key, group);
|
|
3355
|
+
subscriber.next(grouped);
|
|
3356
|
+
if (duration) {
|
|
3357
|
+
const durationSubscriber = createOperatorSubscriber(group, () => {
|
|
3358
|
+
group.complete();
|
|
3359
|
+
durationSubscriber === null || durationSubscriber === void 0 ? void 0 : durationSubscriber.unsubscribe();
|
|
3360
|
+
}, undefined, undefined, () => groups.delete(key));
|
|
3361
|
+
groupBySourceSubscriber.add(innerFrom(duration(grouped)).subscribe(durationSubscriber));
|
|
3362
|
+
}
|
|
3363
|
+
}
|
|
3364
|
+
group.next(element ? element(value) : value);
|
|
3365
|
+
}
|
|
3366
|
+
catch (err) {
|
|
3367
|
+
handleError(err);
|
|
3368
|
+
}
|
|
3369
|
+
}, () => notify((consumer) => consumer.complete()), handleError, () => groups.clear(), () => {
|
|
3370
|
+
teardownAttempted = true;
|
|
3371
|
+
return activeGroups === 0;
|
|
3372
|
+
});
|
|
3373
|
+
source.subscribe(groupBySourceSubscriber);
|
|
3374
|
+
function createGroupedObservable(key, groupSubject) {
|
|
3375
|
+
const result = new Observable((groupSubscriber) => {
|
|
3376
|
+
activeGroups++;
|
|
3377
|
+
const innerSub = groupSubject.subscribe(groupSubscriber);
|
|
3378
|
+
return () => {
|
|
3379
|
+
innerSub.unsubscribe();
|
|
3380
|
+
--activeGroups === 0 && teardownAttempted && groupBySourceSubscriber.unsubscribe();
|
|
3381
|
+
};
|
|
3382
|
+
});
|
|
3383
|
+
result.key = key;
|
|
3384
|
+
return result;
|
|
3385
|
+
}
|
|
3386
|
+
});
|
|
3387
|
+
}
|
|
3388
|
+
|
|
3389
|
+
function isEmpty() {
|
|
3390
|
+
return operate((source, subscriber) => {
|
|
3391
|
+
source.subscribe(createOperatorSubscriber(subscriber, () => {
|
|
3392
|
+
subscriber.next(false);
|
|
3393
|
+
subscriber.complete();
|
|
3394
|
+
}, () => {
|
|
3395
|
+
subscriber.next(true);
|
|
3396
|
+
subscriber.complete();
|
|
3397
|
+
}));
|
|
3398
|
+
});
|
|
3399
|
+
}
|
|
3400
|
+
|
|
3401
|
+
function takeLast(count) {
|
|
3402
|
+
return count <= 0
|
|
3403
|
+
? () => EMPTY
|
|
3404
|
+
: operate((source, subscriber) => {
|
|
3405
|
+
let buffer = [];
|
|
3406
|
+
source.subscribe(createOperatorSubscriber(subscriber, (value) => {
|
|
3407
|
+
buffer.push(value);
|
|
3408
|
+
count < buffer.length && buffer.shift();
|
|
3409
|
+
}, () => {
|
|
3410
|
+
for (const value of buffer) {
|
|
3411
|
+
subscriber.next(value);
|
|
3412
|
+
}
|
|
3413
|
+
subscriber.complete();
|
|
3414
|
+
}, undefined, () => {
|
|
3415
|
+
buffer = null;
|
|
3416
|
+
}));
|
|
3417
|
+
});
|
|
3418
|
+
}
|
|
3419
|
+
|
|
3420
|
+
function last(predicate, defaultValue) {
|
|
3421
|
+
const hasDefaultValue = arguments.length >= 2;
|
|
3422
|
+
return (source) => source.pipe(predicate ? filter((v, i) => predicate(v, i, source)) : identity, takeLast(1), hasDefaultValue ? defaultIfEmpty(defaultValue) : throwIfEmpty(() => new EmptyError()));
|
|
3423
|
+
}
|
|
3424
|
+
|
|
3425
|
+
function materialize() {
|
|
3426
|
+
return operate((source, subscriber) => {
|
|
3427
|
+
source.subscribe(createOperatorSubscriber(subscriber, (value) => {
|
|
3428
|
+
subscriber.next(Notification.createNext(value));
|
|
3429
|
+
}, () => {
|
|
3430
|
+
subscriber.next(Notification.createComplete());
|
|
3431
|
+
subscriber.complete();
|
|
3432
|
+
}, (err) => {
|
|
3433
|
+
subscriber.next(Notification.createError(err));
|
|
3434
|
+
subscriber.complete();
|
|
3435
|
+
}));
|
|
3436
|
+
});
|
|
3437
|
+
}
|
|
3438
|
+
|
|
3439
|
+
function max(comparer) {
|
|
3440
|
+
return reduce(isFunction(comparer) ? (x, y) => (comparer(x, y) > 0 ? x : y) : (x, y) => (x > y ? x : y));
|
|
3441
|
+
}
|
|
3442
|
+
|
|
3443
|
+
const flatMap = mergeMap;
|
|
3444
|
+
|
|
3445
|
+
function mergeMapTo(innerObservable, resultSelector, concurrent = Infinity) {
|
|
3446
|
+
if (isFunction(resultSelector)) {
|
|
3447
|
+
return mergeMap(() => innerObservable, resultSelector, concurrent);
|
|
3448
|
+
}
|
|
3449
|
+
if (typeof resultSelector === 'number') {
|
|
3450
|
+
concurrent = resultSelector;
|
|
3451
|
+
}
|
|
3452
|
+
return mergeMap(() => innerObservable, concurrent);
|
|
3453
|
+
}
|
|
3454
|
+
|
|
3455
|
+
function mergeScan(accumulator, seed, concurrent = Infinity) {
|
|
3456
|
+
return operate((source, subscriber) => {
|
|
3457
|
+
let state = seed;
|
|
3458
|
+
return mergeInternals(source, subscriber, (value, index) => accumulator(state, value, index), concurrent, (value) => {
|
|
3459
|
+
state = value;
|
|
3460
|
+
}, false, undefined, () => (state = null));
|
|
3461
|
+
});
|
|
3462
|
+
}
|
|
3463
|
+
|
|
3464
|
+
function merge(...args) {
|
|
3465
|
+
const scheduler = popScheduler(args);
|
|
3466
|
+
const concurrent = popNumber(args, Infinity);
|
|
3467
|
+
args = argsOrArgArray(args);
|
|
3468
|
+
return operate((source, subscriber) => {
|
|
3469
|
+
mergeAll(concurrent)(from([source, ...args], scheduler)).subscribe(subscriber);
|
|
3470
|
+
});
|
|
3471
|
+
}
|
|
3472
|
+
|
|
3473
|
+
function mergeWith(...otherSources) {
|
|
3474
|
+
return merge(...otherSources);
|
|
3475
|
+
}
|
|
3476
|
+
|
|
3477
|
+
function min(comparer) {
|
|
3478
|
+
return reduce(isFunction(comparer) ? (x, y) => (comparer(x, y) < 0 ? x : y) : (x, y) => (x < y ? x : y));
|
|
3479
|
+
}
|
|
3480
|
+
|
|
3481
|
+
function multicast(subjectOrSubjectFactory, selector) {
|
|
3482
|
+
const subjectFactory = isFunction(subjectOrSubjectFactory) ? subjectOrSubjectFactory : () => subjectOrSubjectFactory;
|
|
3483
|
+
if (isFunction(selector)) {
|
|
3484
|
+
return connect(selector, {
|
|
3485
|
+
connector: subjectFactory,
|
|
3486
|
+
});
|
|
3487
|
+
}
|
|
3488
|
+
return (source) => new ConnectableObservable(source, subjectFactory);
|
|
3489
|
+
}
|
|
3490
|
+
|
|
3491
|
+
function pairwise() {
|
|
3492
|
+
return operate((source, subscriber) => {
|
|
3493
|
+
let prev;
|
|
3494
|
+
let hasPrev = false;
|
|
3495
|
+
source.subscribe(createOperatorSubscriber(subscriber, (value) => {
|
|
3496
|
+
const p = prev;
|
|
3497
|
+
prev = value;
|
|
3498
|
+
hasPrev && subscriber.next([p, value]);
|
|
3499
|
+
hasPrev = true;
|
|
3500
|
+
}));
|
|
3501
|
+
});
|
|
3502
|
+
}
|
|
3503
|
+
|
|
3504
|
+
function pluck(...properties) {
|
|
3505
|
+
const length = properties.length;
|
|
3506
|
+
if (length === 0) {
|
|
3507
|
+
throw new Error('list of properties cannot be empty.');
|
|
3508
|
+
}
|
|
3509
|
+
return map((x) => {
|
|
3510
|
+
let currentProp = x;
|
|
3511
|
+
for (let i = 0; i < length; i++) {
|
|
3512
|
+
const p = currentProp === null || currentProp === void 0 ? void 0 : currentProp[properties[i]];
|
|
3513
|
+
if (typeof p !== 'undefined') {
|
|
3514
|
+
currentProp = p;
|
|
3515
|
+
}
|
|
3516
|
+
else {
|
|
3517
|
+
return undefined;
|
|
3518
|
+
}
|
|
3519
|
+
}
|
|
3520
|
+
return currentProp;
|
|
3521
|
+
});
|
|
3522
|
+
}
|
|
3523
|
+
|
|
3524
|
+
function publish(selector) {
|
|
3525
|
+
return selector ? (source) => connect(selector)(source) : (source) => multicast(new Subject())(source);
|
|
3526
|
+
}
|
|
3527
|
+
|
|
3528
|
+
function publishBehavior(initialValue) {
|
|
3529
|
+
return (source) => {
|
|
3530
|
+
const subject = new BehaviorSubject(initialValue);
|
|
3531
|
+
return new ConnectableObservable(source, () => subject);
|
|
3532
|
+
};
|
|
3533
|
+
}
|
|
3534
|
+
|
|
3535
|
+
function publishLast() {
|
|
3536
|
+
return (source) => {
|
|
3537
|
+
const subject = new AsyncSubject();
|
|
3538
|
+
return new ConnectableObservable(source, () => subject);
|
|
3539
|
+
};
|
|
3540
|
+
}
|
|
3541
|
+
|
|
3542
|
+
function publishReplay(bufferSize, windowTime, selectorOrScheduler, timestampProvider) {
|
|
3543
|
+
if (selectorOrScheduler && !isFunction(selectorOrScheduler)) {
|
|
3544
|
+
timestampProvider = selectorOrScheduler;
|
|
3545
|
+
}
|
|
3546
|
+
const selector = isFunction(selectorOrScheduler) ? selectorOrScheduler : undefined;
|
|
3547
|
+
return (source) => multicast(new ReplaySubject(bufferSize, windowTime, timestampProvider), selector)(source);
|
|
3548
|
+
}
|
|
3549
|
+
|
|
3550
|
+
function raceWith(...otherSources) {
|
|
3551
|
+
return !otherSources.length
|
|
3552
|
+
? identity
|
|
3553
|
+
: operate((source, subscriber) => {
|
|
3554
|
+
raceInit([source, ...otherSources])(subscriber);
|
|
3555
|
+
});
|
|
3556
|
+
}
|
|
3557
|
+
|
|
3558
|
+
function repeat(countOrConfig) {
|
|
3559
|
+
let count = Infinity;
|
|
3560
|
+
let delay;
|
|
3561
|
+
if (countOrConfig != null) {
|
|
3562
|
+
if (typeof countOrConfig === 'object') {
|
|
3563
|
+
({ count = Infinity, delay } = countOrConfig);
|
|
3564
|
+
}
|
|
3565
|
+
else {
|
|
3566
|
+
count = countOrConfig;
|
|
3567
|
+
}
|
|
3568
|
+
}
|
|
3569
|
+
return count <= 0
|
|
3570
|
+
? () => EMPTY
|
|
3571
|
+
: operate((source, subscriber) => {
|
|
3572
|
+
let soFar = 0;
|
|
3573
|
+
let sourceSub;
|
|
3574
|
+
const resubscribe = () => {
|
|
3575
|
+
sourceSub === null || sourceSub === void 0 ? void 0 : sourceSub.unsubscribe();
|
|
3576
|
+
sourceSub = null;
|
|
3577
|
+
if (delay != null) {
|
|
3578
|
+
const notifier = typeof delay === 'number' ? timer(delay) : innerFrom(delay(soFar));
|
|
3579
|
+
const notifierSubscriber = createOperatorSubscriber(subscriber, () => {
|
|
3580
|
+
notifierSubscriber.unsubscribe();
|
|
3581
|
+
subscribeToSource();
|
|
3582
|
+
});
|
|
3583
|
+
notifier.subscribe(notifierSubscriber);
|
|
3584
|
+
}
|
|
3585
|
+
else {
|
|
3586
|
+
subscribeToSource();
|
|
3587
|
+
}
|
|
3588
|
+
};
|
|
3589
|
+
const subscribeToSource = () => {
|
|
3590
|
+
let syncUnsub = false;
|
|
3591
|
+
sourceSub = source.subscribe(createOperatorSubscriber(subscriber, undefined, () => {
|
|
3592
|
+
if (++soFar < count) {
|
|
3593
|
+
if (sourceSub) {
|
|
3594
|
+
resubscribe();
|
|
3595
|
+
}
|
|
3596
|
+
else {
|
|
3597
|
+
syncUnsub = true;
|
|
3598
|
+
}
|
|
3599
|
+
}
|
|
3600
|
+
else {
|
|
3601
|
+
subscriber.complete();
|
|
3602
|
+
}
|
|
3603
|
+
}));
|
|
3604
|
+
if (syncUnsub) {
|
|
3605
|
+
resubscribe();
|
|
3606
|
+
}
|
|
3607
|
+
};
|
|
3608
|
+
subscribeToSource();
|
|
3609
|
+
});
|
|
3610
|
+
}
|
|
3611
|
+
|
|
3612
|
+
function repeatWhen(notifier) {
|
|
3613
|
+
return operate((source, subscriber) => {
|
|
3614
|
+
let innerSub;
|
|
3615
|
+
let syncResub = false;
|
|
3616
|
+
let completions$;
|
|
3617
|
+
let isNotifierComplete = false;
|
|
3618
|
+
let isMainComplete = false;
|
|
3619
|
+
const checkComplete = () => isMainComplete && isNotifierComplete && (subscriber.complete(), true);
|
|
3620
|
+
const getCompletionSubject = () => {
|
|
3621
|
+
if (!completions$) {
|
|
3622
|
+
completions$ = new Subject();
|
|
3623
|
+
notifier(completions$).subscribe(createOperatorSubscriber(subscriber, () => {
|
|
3624
|
+
if (innerSub) {
|
|
3625
|
+
subscribeForRepeatWhen();
|
|
3626
|
+
}
|
|
3627
|
+
else {
|
|
3628
|
+
syncResub = true;
|
|
3629
|
+
}
|
|
3630
|
+
}, () => {
|
|
3631
|
+
isNotifierComplete = true;
|
|
3632
|
+
checkComplete();
|
|
3633
|
+
}));
|
|
3634
|
+
}
|
|
3635
|
+
return completions$;
|
|
3636
|
+
};
|
|
3637
|
+
const subscribeForRepeatWhen = () => {
|
|
3638
|
+
isMainComplete = false;
|
|
3639
|
+
innerSub = source.subscribe(createOperatorSubscriber(subscriber, undefined, () => {
|
|
3640
|
+
isMainComplete = true;
|
|
3641
|
+
!checkComplete() && getCompletionSubject().next();
|
|
3642
|
+
}));
|
|
3643
|
+
if (syncResub) {
|
|
3644
|
+
innerSub.unsubscribe();
|
|
3645
|
+
innerSub = null;
|
|
3646
|
+
syncResub = false;
|
|
3647
|
+
subscribeForRepeatWhen();
|
|
3648
|
+
}
|
|
3649
|
+
};
|
|
3650
|
+
subscribeForRepeatWhen();
|
|
3651
|
+
});
|
|
3652
|
+
}
|
|
3653
|
+
|
|
3654
|
+
function retry(configOrCount = Infinity) {
|
|
3655
|
+
let config;
|
|
3656
|
+
if (configOrCount && typeof configOrCount === 'object') {
|
|
3657
|
+
config = configOrCount;
|
|
3658
|
+
}
|
|
3659
|
+
else {
|
|
3660
|
+
config = {
|
|
3661
|
+
count: configOrCount,
|
|
3662
|
+
};
|
|
3663
|
+
}
|
|
3664
|
+
const { count = Infinity, delay, resetOnSuccess: resetOnSuccess = false } = config;
|
|
3665
|
+
return count <= 0
|
|
3666
|
+
? identity
|
|
3667
|
+
: operate((source, subscriber) => {
|
|
3668
|
+
let soFar = 0;
|
|
3669
|
+
let innerSub;
|
|
3670
|
+
const subscribeForRetry = () => {
|
|
3671
|
+
let syncUnsub = false;
|
|
3672
|
+
innerSub = source.subscribe(createOperatorSubscriber(subscriber, (value) => {
|
|
3673
|
+
if (resetOnSuccess) {
|
|
3674
|
+
soFar = 0;
|
|
3675
|
+
}
|
|
3676
|
+
subscriber.next(value);
|
|
3677
|
+
}, undefined, (err) => {
|
|
3678
|
+
if (soFar++ < count) {
|
|
3679
|
+
const resub = () => {
|
|
3680
|
+
if (innerSub) {
|
|
3681
|
+
innerSub.unsubscribe();
|
|
3682
|
+
innerSub = null;
|
|
3683
|
+
subscribeForRetry();
|
|
3684
|
+
}
|
|
3685
|
+
else {
|
|
3686
|
+
syncUnsub = true;
|
|
3687
|
+
}
|
|
3688
|
+
};
|
|
3689
|
+
if (delay != null) {
|
|
3690
|
+
const notifier = typeof delay === 'number' ? timer(delay) : innerFrom(delay(err, soFar));
|
|
3691
|
+
const notifierSubscriber = createOperatorSubscriber(subscriber, () => {
|
|
3692
|
+
notifierSubscriber.unsubscribe();
|
|
3693
|
+
resub();
|
|
3694
|
+
}, () => {
|
|
3695
|
+
subscriber.complete();
|
|
3696
|
+
});
|
|
3697
|
+
notifier.subscribe(notifierSubscriber);
|
|
3698
|
+
}
|
|
3699
|
+
else {
|
|
3700
|
+
resub();
|
|
3701
|
+
}
|
|
3702
|
+
}
|
|
3703
|
+
else {
|
|
3704
|
+
subscriber.error(err);
|
|
3705
|
+
}
|
|
3706
|
+
}));
|
|
3707
|
+
if (syncUnsub) {
|
|
3708
|
+
innerSub.unsubscribe();
|
|
3709
|
+
innerSub = null;
|
|
3710
|
+
subscribeForRetry();
|
|
3711
|
+
}
|
|
3712
|
+
};
|
|
3713
|
+
subscribeForRetry();
|
|
3714
|
+
});
|
|
3715
|
+
}
|
|
3716
|
+
|
|
3717
|
+
function retryWhen(notifier) {
|
|
3718
|
+
return operate((source, subscriber) => {
|
|
3719
|
+
let innerSub;
|
|
3720
|
+
let syncResub = false;
|
|
3721
|
+
let errors$;
|
|
3722
|
+
const subscribeForRetryWhen = () => {
|
|
3723
|
+
innerSub = source.subscribe(createOperatorSubscriber(subscriber, undefined, undefined, (err) => {
|
|
3724
|
+
if (!errors$) {
|
|
3725
|
+
errors$ = new Subject();
|
|
3726
|
+
notifier(errors$).subscribe(createOperatorSubscriber(subscriber, () => innerSub ? subscribeForRetryWhen() : (syncResub = true)));
|
|
3727
|
+
}
|
|
3728
|
+
if (errors$) {
|
|
3729
|
+
errors$.next(err);
|
|
3730
|
+
}
|
|
3731
|
+
}));
|
|
3732
|
+
if (syncResub) {
|
|
3733
|
+
innerSub.unsubscribe();
|
|
3734
|
+
innerSub = null;
|
|
3735
|
+
syncResub = false;
|
|
3736
|
+
subscribeForRetryWhen();
|
|
3737
|
+
}
|
|
3738
|
+
};
|
|
3739
|
+
subscribeForRetryWhen();
|
|
3740
|
+
});
|
|
3741
|
+
}
|
|
3742
|
+
|
|
3743
|
+
function sample(notifier) {
|
|
3744
|
+
return operate((source, subscriber) => {
|
|
3745
|
+
let hasValue = false;
|
|
3746
|
+
let lastValue = null;
|
|
3747
|
+
source.subscribe(createOperatorSubscriber(subscriber, (value) => {
|
|
3748
|
+
hasValue = true;
|
|
3749
|
+
lastValue = value;
|
|
3750
|
+
}));
|
|
3751
|
+
notifier.subscribe(createOperatorSubscriber(subscriber, () => {
|
|
3752
|
+
if (hasValue) {
|
|
3753
|
+
hasValue = false;
|
|
3754
|
+
const value = lastValue;
|
|
3755
|
+
lastValue = null;
|
|
3756
|
+
subscriber.next(value);
|
|
3757
|
+
}
|
|
3758
|
+
}, noop));
|
|
3759
|
+
});
|
|
3760
|
+
}
|
|
3761
|
+
|
|
3762
|
+
function sampleTime(period, scheduler = asyncScheduler) {
|
|
3763
|
+
return sample(interval(period, scheduler));
|
|
3764
|
+
}
|
|
3765
|
+
|
|
3766
|
+
function scan(accumulator, seed) {
|
|
3767
|
+
return operate(scanInternals(accumulator, seed, arguments.length >= 2, true));
|
|
3768
|
+
}
|
|
3769
|
+
|
|
3770
|
+
function sequenceEqual(compareTo, comparator = (a, b) => a === b) {
|
|
3771
|
+
return operate((source, subscriber) => {
|
|
3772
|
+
const aState = createState();
|
|
3773
|
+
const bState = createState();
|
|
3774
|
+
const emit = (isEqual) => {
|
|
3775
|
+
subscriber.next(isEqual);
|
|
3776
|
+
subscriber.complete();
|
|
3777
|
+
};
|
|
3778
|
+
const createSubscriber = (selfState, otherState) => {
|
|
3779
|
+
const sequenceEqualSubscriber = createOperatorSubscriber(subscriber, (a) => {
|
|
3780
|
+
const { buffer, complete } = otherState;
|
|
3781
|
+
if (buffer.length === 0) {
|
|
3782
|
+
complete ? emit(false) : selfState.buffer.push(a);
|
|
3783
|
+
}
|
|
3784
|
+
else {
|
|
3785
|
+
!comparator(a, buffer.shift()) && emit(false);
|
|
3786
|
+
}
|
|
3787
|
+
}, () => {
|
|
3788
|
+
selfState.complete = true;
|
|
3789
|
+
const { complete, buffer } = otherState;
|
|
3790
|
+
complete && emit(buffer.length === 0);
|
|
3791
|
+
sequenceEqualSubscriber === null || sequenceEqualSubscriber === void 0 ? void 0 : sequenceEqualSubscriber.unsubscribe();
|
|
3792
|
+
});
|
|
3793
|
+
return sequenceEqualSubscriber;
|
|
3794
|
+
};
|
|
3795
|
+
source.subscribe(createSubscriber(aState, bState));
|
|
3796
|
+
compareTo.subscribe(createSubscriber(bState, aState));
|
|
3797
|
+
});
|
|
3798
|
+
}
|
|
3799
|
+
function createState() {
|
|
3800
|
+
return {
|
|
3801
|
+
buffer: [],
|
|
3802
|
+
complete: false,
|
|
3803
|
+
};
|
|
3804
|
+
}
|
|
3805
|
+
|
|
3806
|
+
function share(options = {}) {
|
|
3807
|
+
const { connector = () => new Subject(), resetOnError = true, resetOnComplete = true, resetOnRefCountZero = true } = options;
|
|
3808
|
+
return (wrapperSource) => {
|
|
3809
|
+
let connection = null;
|
|
3810
|
+
let resetConnection = null;
|
|
3811
|
+
let subject = null;
|
|
3812
|
+
let refCount = 0;
|
|
3813
|
+
let hasCompleted = false;
|
|
3814
|
+
let hasErrored = false;
|
|
3815
|
+
const cancelReset = () => {
|
|
3816
|
+
resetConnection === null || resetConnection === void 0 ? void 0 : resetConnection.unsubscribe();
|
|
3817
|
+
resetConnection = null;
|
|
3818
|
+
};
|
|
3819
|
+
const reset = () => {
|
|
3820
|
+
cancelReset();
|
|
3821
|
+
connection = subject = null;
|
|
3822
|
+
hasCompleted = hasErrored = false;
|
|
3823
|
+
};
|
|
3824
|
+
const resetAndUnsubscribe = () => {
|
|
3825
|
+
const conn = connection;
|
|
3826
|
+
reset();
|
|
3827
|
+
conn === null || conn === void 0 ? void 0 : conn.unsubscribe();
|
|
3828
|
+
};
|
|
3829
|
+
return operate((source, subscriber) => {
|
|
3830
|
+
refCount++;
|
|
3831
|
+
if (!hasErrored && !hasCompleted) {
|
|
3832
|
+
cancelReset();
|
|
3833
|
+
}
|
|
3834
|
+
const dest = (subject = subject !== null && subject !== void 0 ? subject : connector());
|
|
3835
|
+
subscriber.add(() => {
|
|
3836
|
+
refCount--;
|
|
3837
|
+
if (refCount === 0 && !hasErrored && !hasCompleted) {
|
|
3838
|
+
resetConnection = handleReset(resetAndUnsubscribe, resetOnRefCountZero);
|
|
3839
|
+
}
|
|
3840
|
+
});
|
|
3841
|
+
dest.subscribe(subscriber);
|
|
3842
|
+
if (!connection) {
|
|
3843
|
+
connection = new SafeSubscriber({
|
|
3844
|
+
next: (value) => dest.next(value),
|
|
3845
|
+
error: (err) => {
|
|
3846
|
+
hasErrored = true;
|
|
3847
|
+
cancelReset();
|
|
3848
|
+
resetConnection = handleReset(reset, resetOnError, err);
|
|
3849
|
+
dest.error(err);
|
|
3850
|
+
},
|
|
3851
|
+
complete: () => {
|
|
3852
|
+
hasCompleted = true;
|
|
3853
|
+
cancelReset();
|
|
3854
|
+
resetConnection = handleReset(reset, resetOnComplete);
|
|
3855
|
+
dest.complete();
|
|
3856
|
+
},
|
|
3857
|
+
});
|
|
3858
|
+
from(source).subscribe(connection);
|
|
3859
|
+
}
|
|
3860
|
+
})(wrapperSource);
|
|
3861
|
+
};
|
|
3862
|
+
}
|
|
3863
|
+
function handleReset(reset, on, ...args) {
|
|
3864
|
+
if (on === true) {
|
|
3865
|
+
reset();
|
|
3866
|
+
return null;
|
|
3867
|
+
}
|
|
3868
|
+
if (on === false) {
|
|
3869
|
+
return null;
|
|
3870
|
+
}
|
|
3871
|
+
return on(...args)
|
|
3872
|
+
.pipe(take(1))
|
|
3873
|
+
.subscribe(() => reset());
|
|
3874
|
+
}
|
|
3875
|
+
|
|
3876
|
+
function shareReplay(configOrBufferSize, windowTime, scheduler) {
|
|
3877
|
+
let bufferSize;
|
|
3878
|
+
let refCount = false;
|
|
3879
|
+
if (configOrBufferSize && typeof configOrBufferSize === 'object') {
|
|
3880
|
+
({ bufferSize = Infinity, windowTime = Infinity, refCount = false, scheduler } = configOrBufferSize);
|
|
3881
|
+
}
|
|
3882
|
+
else {
|
|
3883
|
+
bufferSize = configOrBufferSize !== null && configOrBufferSize !== void 0 ? configOrBufferSize : Infinity;
|
|
3884
|
+
}
|
|
3885
|
+
return share({
|
|
3886
|
+
connector: () => new ReplaySubject(bufferSize, windowTime, scheduler),
|
|
3887
|
+
resetOnError: true,
|
|
3888
|
+
resetOnComplete: false,
|
|
3889
|
+
resetOnRefCountZero: refCount,
|
|
3890
|
+
});
|
|
3891
|
+
}
|
|
3892
|
+
|
|
3893
|
+
function single(predicate) {
|
|
3894
|
+
return operate((source, subscriber) => {
|
|
3895
|
+
let hasValue = false;
|
|
3896
|
+
let singleValue;
|
|
3897
|
+
let seenValue = false;
|
|
3898
|
+
let index = 0;
|
|
3899
|
+
source.subscribe(createOperatorSubscriber(subscriber, (value) => {
|
|
3900
|
+
seenValue = true;
|
|
3901
|
+
if (!predicate || predicate(value, index++, source)) {
|
|
3902
|
+
hasValue && subscriber.error(new SequenceError('Too many matching values'));
|
|
3903
|
+
hasValue = true;
|
|
3904
|
+
singleValue = value;
|
|
3905
|
+
}
|
|
3906
|
+
}, () => {
|
|
3907
|
+
if (hasValue) {
|
|
3908
|
+
subscriber.next(singleValue);
|
|
3909
|
+
subscriber.complete();
|
|
3910
|
+
}
|
|
3911
|
+
else {
|
|
3912
|
+
subscriber.error(seenValue ? new NotFoundError('No matching values') : new EmptyError());
|
|
3913
|
+
}
|
|
3914
|
+
}));
|
|
3915
|
+
});
|
|
3916
|
+
}
|
|
3917
|
+
|
|
3918
|
+
function skip(count) {
|
|
3919
|
+
return filter((_, index) => count <= index);
|
|
3920
|
+
}
|
|
3921
|
+
|
|
3922
|
+
function skipLast(skipCount) {
|
|
3923
|
+
return skipCount <= 0
|
|
3924
|
+
?
|
|
3925
|
+
identity
|
|
3926
|
+
: operate((source, subscriber) => {
|
|
3927
|
+
let ring = new Array(skipCount);
|
|
3928
|
+
let seen = 0;
|
|
3929
|
+
source.subscribe(createOperatorSubscriber(subscriber, (value) => {
|
|
3930
|
+
const valueIndex = seen++;
|
|
3931
|
+
if (valueIndex < skipCount) {
|
|
3932
|
+
ring[valueIndex] = value;
|
|
3933
|
+
}
|
|
3934
|
+
else {
|
|
3935
|
+
const index = valueIndex % skipCount;
|
|
3936
|
+
const oldValue = ring[index];
|
|
3937
|
+
ring[index] = value;
|
|
3938
|
+
subscriber.next(oldValue);
|
|
3939
|
+
}
|
|
3940
|
+
}));
|
|
3941
|
+
return () => {
|
|
3942
|
+
ring = null;
|
|
3943
|
+
};
|
|
3944
|
+
});
|
|
3945
|
+
}
|
|
3946
|
+
|
|
3947
|
+
function skipUntil(notifier) {
|
|
3948
|
+
return operate((source, subscriber) => {
|
|
3949
|
+
let taking = false;
|
|
3950
|
+
const skipSubscriber = createOperatorSubscriber(subscriber, () => {
|
|
3951
|
+
skipSubscriber === null || skipSubscriber === void 0 ? void 0 : skipSubscriber.unsubscribe();
|
|
3952
|
+
taking = true;
|
|
3953
|
+
}, noop);
|
|
3954
|
+
innerFrom(notifier).subscribe(skipSubscriber);
|
|
3955
|
+
source.subscribe(createOperatorSubscriber(subscriber, (value) => taking && subscriber.next(value)));
|
|
3956
|
+
});
|
|
3957
|
+
}
|
|
3958
|
+
|
|
3959
|
+
function skipWhile(predicate) {
|
|
3960
|
+
return operate((source, subscriber) => {
|
|
3961
|
+
let taking = false;
|
|
3962
|
+
let index = 0;
|
|
3963
|
+
source.subscribe(createOperatorSubscriber(subscriber, (value) => (taking || (taking = !predicate(value, index++))) && subscriber.next(value)));
|
|
3964
|
+
});
|
|
3965
|
+
}
|
|
3966
|
+
|
|
3967
|
+
function startWith(...values) {
|
|
3968
|
+
const scheduler = popScheduler(values);
|
|
3969
|
+
return operate((source, subscriber) => {
|
|
3970
|
+
(scheduler ? concat$1(values, source, scheduler) : concat$1(values, source)).subscribe(subscriber);
|
|
3971
|
+
});
|
|
3972
|
+
}
|
|
3973
|
+
|
|
3974
|
+
function switchMap(project, resultSelector) {
|
|
3975
|
+
return operate((source, subscriber) => {
|
|
3976
|
+
let innerSubscriber = null;
|
|
3977
|
+
let index = 0;
|
|
3978
|
+
let isComplete = false;
|
|
3979
|
+
const checkComplete = () => isComplete && !innerSubscriber && subscriber.complete();
|
|
3980
|
+
source.subscribe(createOperatorSubscriber(subscriber, (value) => {
|
|
3981
|
+
innerSubscriber === null || innerSubscriber === void 0 ? void 0 : innerSubscriber.unsubscribe();
|
|
3982
|
+
let innerIndex = 0;
|
|
3983
|
+
const outerIndex = index++;
|
|
3984
|
+
innerFrom(project(value, outerIndex)).subscribe((innerSubscriber = createOperatorSubscriber(subscriber, (innerValue) => subscriber.next(resultSelector ? resultSelector(value, innerValue, outerIndex, innerIndex++) : innerValue), () => {
|
|
3985
|
+
innerSubscriber = null;
|
|
3986
|
+
checkComplete();
|
|
3987
|
+
})));
|
|
3988
|
+
}, () => {
|
|
3989
|
+
isComplete = true;
|
|
3990
|
+
checkComplete();
|
|
3991
|
+
}));
|
|
3992
|
+
});
|
|
3993
|
+
}
|
|
3994
|
+
|
|
3995
|
+
function switchAll() {
|
|
3996
|
+
return switchMap(identity);
|
|
3997
|
+
}
|
|
3998
|
+
|
|
3999
|
+
function switchMapTo(innerObservable, resultSelector) {
|
|
4000
|
+
return isFunction(resultSelector) ? switchMap(() => innerObservable, resultSelector) : switchMap(() => innerObservable);
|
|
4001
|
+
}
|
|
4002
|
+
|
|
4003
|
+
function switchScan(accumulator, seed) {
|
|
4004
|
+
return operate((source, subscriber) => {
|
|
4005
|
+
let state = seed;
|
|
4006
|
+
switchMap((value, index) => accumulator(state, value, index), (_, innerValue) => ((state = innerValue), innerValue))(source).subscribe(subscriber);
|
|
4007
|
+
return () => {
|
|
4008
|
+
state = null;
|
|
4009
|
+
};
|
|
4010
|
+
});
|
|
4011
|
+
}
|
|
4012
|
+
|
|
4013
|
+
function takeUntil(notifier) {
|
|
4014
|
+
return operate((source, subscriber) => {
|
|
4015
|
+
innerFrom(notifier).subscribe(createOperatorSubscriber(subscriber, () => subscriber.complete(), noop));
|
|
4016
|
+
!subscriber.closed && source.subscribe(subscriber);
|
|
4017
|
+
});
|
|
4018
|
+
}
|
|
4019
|
+
|
|
4020
|
+
function takeWhile(predicate, inclusive = false) {
|
|
4021
|
+
return operate((source, subscriber) => {
|
|
4022
|
+
let index = 0;
|
|
4023
|
+
source.subscribe(createOperatorSubscriber(subscriber, (value) => {
|
|
4024
|
+
const result = predicate(value, index++);
|
|
4025
|
+
(result || inclusive) && subscriber.next(value);
|
|
4026
|
+
!result && subscriber.complete();
|
|
4027
|
+
}));
|
|
4028
|
+
});
|
|
4029
|
+
}
|
|
4030
|
+
|
|
4031
|
+
function tap(observerOrNext, error, complete) {
|
|
4032
|
+
const tapObserver = isFunction(observerOrNext) || error || complete
|
|
4033
|
+
?
|
|
4034
|
+
{ next: observerOrNext, error, complete }
|
|
4035
|
+
: observerOrNext;
|
|
4036
|
+
return tapObserver
|
|
4037
|
+
? operate((source, subscriber) => {
|
|
4038
|
+
var _a;
|
|
4039
|
+
(_a = tapObserver.subscribe) === null || _a === void 0 ? void 0 : _a.call(tapObserver);
|
|
4040
|
+
let isUnsub = true;
|
|
4041
|
+
source.subscribe(createOperatorSubscriber(subscriber, (value) => {
|
|
4042
|
+
var _a;
|
|
4043
|
+
(_a = tapObserver.next) === null || _a === void 0 ? void 0 : _a.call(tapObserver, value);
|
|
4044
|
+
subscriber.next(value);
|
|
4045
|
+
}, () => {
|
|
4046
|
+
var _a;
|
|
4047
|
+
isUnsub = false;
|
|
4048
|
+
(_a = tapObserver.complete) === null || _a === void 0 ? void 0 : _a.call(tapObserver);
|
|
4049
|
+
subscriber.complete();
|
|
4050
|
+
}, (err) => {
|
|
4051
|
+
var _a;
|
|
4052
|
+
isUnsub = false;
|
|
4053
|
+
(_a = tapObserver.error) === null || _a === void 0 ? void 0 : _a.call(tapObserver, err);
|
|
4054
|
+
subscriber.error(err);
|
|
4055
|
+
}, () => {
|
|
4056
|
+
var _a, _b;
|
|
4057
|
+
if (isUnsub) {
|
|
4058
|
+
(_a = tapObserver.unsubscribe) === null || _a === void 0 ? void 0 : _a.call(tapObserver);
|
|
4059
|
+
}
|
|
4060
|
+
(_b = tapObserver.finalize) === null || _b === void 0 ? void 0 : _b.call(tapObserver);
|
|
4061
|
+
}));
|
|
4062
|
+
})
|
|
4063
|
+
:
|
|
4064
|
+
identity;
|
|
4065
|
+
}
|
|
4066
|
+
|
|
4067
|
+
const defaultThrottleConfig = {
|
|
4068
|
+
leading: true,
|
|
4069
|
+
trailing: false,
|
|
4070
|
+
};
|
|
4071
|
+
function throttle(durationSelector, config = defaultThrottleConfig) {
|
|
4072
|
+
return operate((source, subscriber) => {
|
|
4073
|
+
const { leading, trailing } = config;
|
|
4074
|
+
let hasValue = false;
|
|
4075
|
+
let sendValue = null;
|
|
4076
|
+
let throttled = null;
|
|
4077
|
+
let isComplete = false;
|
|
4078
|
+
const endThrottling = () => {
|
|
4079
|
+
throttled === null || throttled === void 0 ? void 0 : throttled.unsubscribe();
|
|
4080
|
+
throttled = null;
|
|
4081
|
+
if (trailing) {
|
|
4082
|
+
send();
|
|
4083
|
+
isComplete && subscriber.complete();
|
|
4084
|
+
}
|
|
4085
|
+
};
|
|
4086
|
+
const cleanupThrottling = () => {
|
|
4087
|
+
throttled = null;
|
|
4088
|
+
isComplete && subscriber.complete();
|
|
4089
|
+
};
|
|
4090
|
+
const startThrottle = (value) => (throttled = innerFrom(durationSelector(value)).subscribe(createOperatorSubscriber(subscriber, endThrottling, cleanupThrottling)));
|
|
4091
|
+
const send = () => {
|
|
4092
|
+
if (hasValue) {
|
|
4093
|
+
hasValue = false;
|
|
4094
|
+
const value = sendValue;
|
|
4095
|
+
sendValue = null;
|
|
4096
|
+
subscriber.next(value);
|
|
4097
|
+
!isComplete && startThrottle(value);
|
|
4098
|
+
}
|
|
4099
|
+
};
|
|
4100
|
+
source.subscribe(createOperatorSubscriber(subscriber, (value) => {
|
|
4101
|
+
hasValue = true;
|
|
4102
|
+
sendValue = value;
|
|
4103
|
+
!(throttled && !throttled.closed) && (leading ? send() : startThrottle(value));
|
|
4104
|
+
}, () => {
|
|
4105
|
+
isComplete = true;
|
|
4106
|
+
!(trailing && hasValue && throttled && !throttled.closed) && subscriber.complete();
|
|
4107
|
+
}));
|
|
4108
|
+
});
|
|
4109
|
+
}
|
|
4110
|
+
|
|
4111
|
+
function throttleTime(duration, scheduler = asyncScheduler, config = defaultThrottleConfig) {
|
|
4112
|
+
const duration$ = timer(duration, scheduler);
|
|
4113
|
+
return throttle(() => duration$, config);
|
|
4114
|
+
}
|
|
4115
|
+
|
|
4116
|
+
function timeInterval(scheduler = asyncScheduler) {
|
|
4117
|
+
return operate((source, subscriber) => {
|
|
4118
|
+
let last = scheduler.now();
|
|
4119
|
+
source.subscribe(createOperatorSubscriber(subscriber, (value) => {
|
|
4120
|
+
const now = scheduler.now();
|
|
4121
|
+
const interval = now - last;
|
|
4122
|
+
last = now;
|
|
4123
|
+
subscriber.next(new TimeInterval(value, interval));
|
|
4124
|
+
}));
|
|
4125
|
+
});
|
|
4126
|
+
}
|
|
4127
|
+
class TimeInterval {
|
|
4128
|
+
constructor(value, interval) {
|
|
4129
|
+
this.value = value;
|
|
4130
|
+
this.interval = interval;
|
|
4131
|
+
}
|
|
4132
|
+
}
|
|
4133
|
+
|
|
4134
|
+
function timeoutWith(due, withObservable, scheduler) {
|
|
4135
|
+
let first;
|
|
4136
|
+
let each;
|
|
4137
|
+
let _with;
|
|
4138
|
+
scheduler = scheduler !== null && scheduler !== void 0 ? scheduler : async;
|
|
4139
|
+
if (isValidDate(due)) {
|
|
4140
|
+
first = due;
|
|
4141
|
+
}
|
|
4142
|
+
else if (typeof due === 'number') {
|
|
4143
|
+
each = due;
|
|
4144
|
+
}
|
|
4145
|
+
if (withObservable) {
|
|
4146
|
+
_with = () => withObservable;
|
|
4147
|
+
}
|
|
4148
|
+
else {
|
|
4149
|
+
throw new TypeError('No observable provided to switch to');
|
|
4150
|
+
}
|
|
4151
|
+
if (first == null && each == null) {
|
|
4152
|
+
throw new TypeError('No timeout provided.');
|
|
4153
|
+
}
|
|
4154
|
+
return timeout({
|
|
4155
|
+
first,
|
|
4156
|
+
each,
|
|
4157
|
+
scheduler,
|
|
4158
|
+
with: _with,
|
|
4159
|
+
});
|
|
4160
|
+
}
|
|
4161
|
+
|
|
4162
|
+
function timestamp(timestampProvider = dateTimestampProvider) {
|
|
4163
|
+
return map((value) => ({ value, timestamp: timestampProvider.now() }));
|
|
4164
|
+
}
|
|
4165
|
+
|
|
4166
|
+
function window(windowBoundaries) {
|
|
4167
|
+
return operate((source, subscriber) => {
|
|
4168
|
+
let windowSubject = new Subject();
|
|
4169
|
+
subscriber.next(windowSubject.asObservable());
|
|
4170
|
+
const errorHandler = (err) => {
|
|
4171
|
+
windowSubject.error(err);
|
|
4172
|
+
subscriber.error(err);
|
|
4173
|
+
};
|
|
4174
|
+
source.subscribe(createOperatorSubscriber(subscriber, (value) => windowSubject === null || windowSubject === void 0 ? void 0 : windowSubject.next(value), () => {
|
|
4175
|
+
windowSubject.complete();
|
|
4176
|
+
subscriber.complete();
|
|
4177
|
+
}, errorHandler));
|
|
4178
|
+
windowBoundaries.subscribe(createOperatorSubscriber(subscriber, () => {
|
|
4179
|
+
windowSubject.complete();
|
|
4180
|
+
subscriber.next((windowSubject = new Subject()));
|
|
4181
|
+
}, noop, errorHandler));
|
|
4182
|
+
return () => {
|
|
4183
|
+
windowSubject === null || windowSubject === void 0 ? void 0 : windowSubject.unsubscribe();
|
|
4184
|
+
windowSubject = null;
|
|
4185
|
+
};
|
|
4186
|
+
});
|
|
4187
|
+
}
|
|
4188
|
+
|
|
4189
|
+
function windowCount(windowSize, startWindowEvery = 0) {
|
|
4190
|
+
const startEvery = startWindowEvery > 0 ? startWindowEvery : windowSize;
|
|
4191
|
+
return operate((source, subscriber) => {
|
|
4192
|
+
let windows = [new Subject()];
|
|
4193
|
+
let starts = [];
|
|
4194
|
+
let count = 0;
|
|
4195
|
+
subscriber.next(windows[0].asObservable());
|
|
4196
|
+
source.subscribe(createOperatorSubscriber(subscriber, (value) => {
|
|
4197
|
+
for (const window of windows) {
|
|
4198
|
+
window.next(value);
|
|
4199
|
+
}
|
|
4200
|
+
const c = count - windowSize + 1;
|
|
4201
|
+
if (c >= 0 && c % startEvery === 0) {
|
|
4202
|
+
windows.shift().complete();
|
|
4203
|
+
}
|
|
4204
|
+
if (++count % startEvery === 0) {
|
|
4205
|
+
const window = new Subject();
|
|
4206
|
+
windows.push(window);
|
|
4207
|
+
subscriber.next(window.asObservable());
|
|
4208
|
+
}
|
|
4209
|
+
}, () => {
|
|
4210
|
+
while (windows.length > 0) {
|
|
4211
|
+
windows.shift().complete();
|
|
4212
|
+
}
|
|
4213
|
+
subscriber.complete();
|
|
4214
|
+
}, (err) => {
|
|
4215
|
+
while (windows.length > 0) {
|
|
4216
|
+
windows.shift().error(err);
|
|
4217
|
+
}
|
|
4218
|
+
subscriber.error(err);
|
|
4219
|
+
}, () => {
|
|
4220
|
+
starts = null;
|
|
4221
|
+
windows = null;
|
|
4222
|
+
}));
|
|
4223
|
+
});
|
|
4224
|
+
}
|
|
4225
|
+
|
|
4226
|
+
function windowTime(windowTimeSpan, ...otherArgs) {
|
|
4227
|
+
var _a, _b;
|
|
4228
|
+
const scheduler = (_a = popScheduler(otherArgs)) !== null && _a !== void 0 ? _a : asyncScheduler;
|
|
4229
|
+
const windowCreationInterval = (_b = otherArgs[0]) !== null && _b !== void 0 ? _b : null;
|
|
4230
|
+
const maxWindowSize = otherArgs[1] || Infinity;
|
|
4231
|
+
return operate((source, subscriber) => {
|
|
4232
|
+
let windowRecords = [];
|
|
4233
|
+
let restartOnClose = false;
|
|
4234
|
+
const closeWindow = (record) => {
|
|
4235
|
+
const { window, subs } = record;
|
|
4236
|
+
window.complete();
|
|
4237
|
+
subs.unsubscribe();
|
|
4238
|
+
arrRemove(windowRecords, record);
|
|
4239
|
+
restartOnClose && startWindow();
|
|
4240
|
+
};
|
|
4241
|
+
const startWindow = () => {
|
|
4242
|
+
if (windowRecords) {
|
|
4243
|
+
const subs = new Subscription();
|
|
4244
|
+
subscriber.add(subs);
|
|
4245
|
+
const window = new Subject();
|
|
4246
|
+
const record = {
|
|
4247
|
+
window,
|
|
4248
|
+
subs,
|
|
4249
|
+
seen: 0,
|
|
4250
|
+
};
|
|
4251
|
+
windowRecords.push(record);
|
|
4252
|
+
subscriber.next(window.asObservable());
|
|
4253
|
+
executeSchedule(subs, scheduler, () => closeWindow(record), windowTimeSpan);
|
|
4254
|
+
}
|
|
4255
|
+
};
|
|
4256
|
+
if (windowCreationInterval !== null && windowCreationInterval >= 0) {
|
|
4257
|
+
executeSchedule(subscriber, scheduler, startWindow, windowCreationInterval, true);
|
|
4258
|
+
}
|
|
4259
|
+
else {
|
|
4260
|
+
restartOnClose = true;
|
|
4261
|
+
}
|
|
4262
|
+
startWindow();
|
|
4263
|
+
const loop = (cb) => windowRecords.slice().forEach(cb);
|
|
4264
|
+
const terminate = (cb) => {
|
|
4265
|
+
loop(({ window }) => cb(window));
|
|
4266
|
+
cb(subscriber);
|
|
4267
|
+
subscriber.unsubscribe();
|
|
4268
|
+
};
|
|
4269
|
+
source.subscribe(createOperatorSubscriber(subscriber, (value) => {
|
|
4270
|
+
loop((record) => {
|
|
4271
|
+
record.window.next(value);
|
|
4272
|
+
maxWindowSize <= ++record.seen && closeWindow(record);
|
|
4273
|
+
});
|
|
4274
|
+
}, () => terminate((consumer) => consumer.complete()), (err) => terminate((consumer) => consumer.error(err))));
|
|
4275
|
+
return () => {
|
|
4276
|
+
windowRecords = null;
|
|
4277
|
+
};
|
|
4278
|
+
});
|
|
4279
|
+
}
|
|
4280
|
+
|
|
4281
|
+
function windowToggle(openings, closingSelector) {
|
|
4282
|
+
return operate((source, subscriber) => {
|
|
4283
|
+
const windows = [];
|
|
4284
|
+
const handleError = (err) => {
|
|
4285
|
+
while (0 < windows.length) {
|
|
4286
|
+
windows.shift().error(err);
|
|
4287
|
+
}
|
|
4288
|
+
subscriber.error(err);
|
|
4289
|
+
};
|
|
4290
|
+
innerFrom(openings).subscribe(createOperatorSubscriber(subscriber, (openValue) => {
|
|
4291
|
+
const window = new Subject();
|
|
4292
|
+
windows.push(window);
|
|
4293
|
+
const closingSubscription = new Subscription();
|
|
4294
|
+
const closeWindow = () => {
|
|
4295
|
+
arrRemove(windows, window);
|
|
4296
|
+
window.complete();
|
|
4297
|
+
closingSubscription.unsubscribe();
|
|
4298
|
+
};
|
|
4299
|
+
let closingNotifier;
|
|
4300
|
+
try {
|
|
4301
|
+
closingNotifier = innerFrom(closingSelector(openValue));
|
|
4302
|
+
}
|
|
4303
|
+
catch (err) {
|
|
4304
|
+
handleError(err);
|
|
4305
|
+
return;
|
|
4306
|
+
}
|
|
4307
|
+
subscriber.next(window.asObservable());
|
|
4308
|
+
closingSubscription.add(closingNotifier.subscribe(createOperatorSubscriber(subscriber, closeWindow, noop, handleError)));
|
|
4309
|
+
}, noop));
|
|
4310
|
+
source.subscribe(createOperatorSubscriber(subscriber, (value) => {
|
|
4311
|
+
const windowsCopy = windows.slice();
|
|
4312
|
+
for (const window of windowsCopy) {
|
|
4313
|
+
window.next(value);
|
|
4314
|
+
}
|
|
4315
|
+
}, () => {
|
|
4316
|
+
while (0 < windows.length) {
|
|
4317
|
+
windows.shift().complete();
|
|
4318
|
+
}
|
|
4319
|
+
subscriber.complete();
|
|
4320
|
+
}, handleError, () => {
|
|
4321
|
+
while (0 < windows.length) {
|
|
4322
|
+
windows.shift().unsubscribe();
|
|
4323
|
+
}
|
|
4324
|
+
}));
|
|
4325
|
+
});
|
|
4326
|
+
}
|
|
4327
|
+
|
|
4328
|
+
function windowWhen(closingSelector) {
|
|
4329
|
+
return operate((source, subscriber) => {
|
|
4330
|
+
let window;
|
|
4331
|
+
let closingSubscriber;
|
|
4332
|
+
const handleError = (err) => {
|
|
4333
|
+
window.error(err);
|
|
4334
|
+
subscriber.error(err);
|
|
4335
|
+
};
|
|
4336
|
+
const openWindow = () => {
|
|
4337
|
+
closingSubscriber === null || closingSubscriber === void 0 ? void 0 : closingSubscriber.unsubscribe();
|
|
4338
|
+
window === null || window === void 0 ? void 0 : window.complete();
|
|
4339
|
+
window = new Subject();
|
|
4340
|
+
subscriber.next(window.asObservable());
|
|
4341
|
+
let closingNotifier;
|
|
4342
|
+
try {
|
|
4343
|
+
closingNotifier = innerFrom(closingSelector());
|
|
4344
|
+
}
|
|
4345
|
+
catch (err) {
|
|
4346
|
+
handleError(err);
|
|
4347
|
+
return;
|
|
4348
|
+
}
|
|
4349
|
+
closingNotifier.subscribe((closingSubscriber = createOperatorSubscriber(subscriber, openWindow, openWindow, handleError)));
|
|
4350
|
+
};
|
|
4351
|
+
openWindow();
|
|
4352
|
+
source.subscribe(createOperatorSubscriber(subscriber, (value) => window.next(value), () => {
|
|
4353
|
+
window.complete();
|
|
4354
|
+
subscriber.complete();
|
|
4355
|
+
}, handleError, () => {
|
|
4356
|
+
closingSubscriber === null || closingSubscriber === void 0 ? void 0 : closingSubscriber.unsubscribe();
|
|
4357
|
+
window = null;
|
|
4358
|
+
}));
|
|
4359
|
+
});
|
|
4360
|
+
}
|
|
4361
|
+
|
|
4362
|
+
function withLatestFrom(...inputs) {
|
|
4363
|
+
const project = popResultSelector(inputs);
|
|
4364
|
+
return operate((source, subscriber) => {
|
|
4365
|
+
const len = inputs.length;
|
|
4366
|
+
const otherValues = new Array(len);
|
|
4367
|
+
let hasValue = inputs.map(() => false);
|
|
4368
|
+
let ready = false;
|
|
4369
|
+
for (let i = 0; i < len; i++) {
|
|
4370
|
+
innerFrom(inputs[i]).subscribe(createOperatorSubscriber(subscriber, (value) => {
|
|
4371
|
+
otherValues[i] = value;
|
|
4372
|
+
if (!ready && !hasValue[i]) {
|
|
4373
|
+
hasValue[i] = true;
|
|
4374
|
+
(ready = hasValue.every(identity)) && (hasValue = null);
|
|
4375
|
+
}
|
|
4376
|
+
}, noop));
|
|
4377
|
+
}
|
|
4378
|
+
source.subscribe(createOperatorSubscriber(subscriber, (value) => {
|
|
4379
|
+
if (ready) {
|
|
4380
|
+
const values = [value, ...otherValues];
|
|
4381
|
+
subscriber.next(project ? project(...values) : values);
|
|
4382
|
+
}
|
|
4383
|
+
}));
|
|
4384
|
+
});
|
|
4385
|
+
}
|
|
4386
|
+
|
|
4387
|
+
function zipAll(project) {
|
|
4388
|
+
return joinAllInternals(zip$1, project);
|
|
4389
|
+
}
|
|
4390
|
+
|
|
4391
|
+
function zip(...sources) {
|
|
4392
|
+
return operate((source, subscriber) => {
|
|
4393
|
+
zip$1(source, ...sources).subscribe(subscriber);
|
|
4394
|
+
});
|
|
4395
|
+
}
|
|
4396
|
+
|
|
4397
|
+
function zipWith(...otherInputs) {
|
|
4398
|
+
return zip(...otherInputs);
|
|
4399
|
+
}
|
|
4400
|
+
|
|
4401
|
+
function partition(predicate, thisArg) {
|
|
4402
|
+
return (source) => [filter(predicate, thisArg)(source), filter(not(predicate, thisArg))(source)];
|
|
4403
|
+
}
|
|
4404
|
+
|
|
4405
|
+
function race(...args) {
|
|
4406
|
+
return raceWith(...argsOrArgArray(args));
|
|
4407
|
+
}
|
|
4408
|
+
|
|
1223
4409
|
const catScrollableCss = ":host{overflow:hidden;position:relative;display:flex}:host([hidden]){display:none}.shadow-bottom,.shadow-right,.shadow-left,.shadow-top{position:absolute;transition:box-shadow 0.3s cubic-bezier(0.25, 0.8, 0.25, 1)}.shadow-top{z-index:2;width:100%;top:0}.shadow-left{z-index:4;height:100%;left:0}.shadow-right{z-index:4;height:100%;right:0}.shadow-bottom{z-index:2;width:100%;bottom:0}.scrollable-wrapper{position:absolute;top:0;left:0;right:0;bottom:0;pointer-events:none}.scrollable-wrapper.cat-scrollable-top .shadow-top,.scrollable-wrapper.cat-scrollable-bottom .shadow-bottom,.scrollable-wrapper.cat-scrollable-left .shadow-left,.scrollable-wrapper.cat-scrollable-right .shadow-right{box-shadow:0 0 4px 1px rgba(16, 29, 48, 0.2)}.scrollable-content{overflow:hidden;white-space:nowrap}.scrollable-content.scroll-x{overflow-x:auto}.scrollable-content.scroll-y{overflow-y:auto}.scrollable-content.no-overscroll{overscroll-behavior:contain}";
|
|
1224
4410
|
|
|
1225
4411
|
const CatScrollable$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
@@ -1260,7 +4446,7 @@ const CatScrollable$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
1260
4446
|
this.attachEmitter('right', this.scrolledRight, this.scrolledBuffer);
|
|
1261
4447
|
this.attachEmitter('bottom', this.scrolledBottom, this.scrolledBuffer);
|
|
1262
4448
|
this.attachEmitter('top', this.scrolledTop, this.scrolledBuffer);
|
|
1263
|
-
merge(this.init, this.scrolled)
|
|
4449
|
+
merge$1(this.init, this.scrolled)
|
|
1264
4450
|
.pipe(map(() => ({
|
|
1265
4451
|
top: this.getScrollOffset('top') > 0,
|
|
1266
4452
|
left: this.getScrollOffset('left') > 0,
|
|
@@ -1296,7 +4482,7 @@ const CatScrollable$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
1296
4482
|
];
|
|
1297
4483
|
}
|
|
1298
4484
|
attachEmitter(from, emitter, buffer) {
|
|
1299
|
-
merge(this.init, this.scrolled)
|
|
4485
|
+
merge$1(this.init, this.scrolled)
|
|
1300
4486
|
.pipe(map(() => this.getScrollOffset(from)))
|
|
1301
4487
|
.pipe(map(offset => offset <= buffer))
|
|
1302
4488
|
.pipe(distinctUntilChanged())
|
|
@@ -1330,7 +4516,6 @@ const CatScrollable$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
1330
4516
|
(_b = this.scrollWrapperElement) === null || _b === void 0 ? void 0 : _b.classList.remove(name);
|
|
1331
4517
|
}
|
|
1332
4518
|
}
|
|
1333
|
-
get el() { return this; }
|
|
1334
4519
|
static get style() { return catScrollableCss; }
|
|
1335
4520
|
}, [1, "cat-scrollable", {
|
|
1336
4521
|
"shadowX": [4, "shadow-x"],
|