rxjs-native-bridge 1.0.0
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/README.md +87 -0
- package/dist/es/index.js +184 -0
- package/dist/index-BpknkqY0.cjs +3 -0
- package/dist/index-HOABx4tn.js +2989 -0
- package/dist/index.d.ts +77 -0
- package/dist/lib/index.js +1 -0
- package/package.json +49 -0
package/README.md
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# 简介
|
|
2
|
+
js-bridge https://github.com/uknownothingsnow/JsBridge?tab=readme-ov-file
|
|
3
|
+
|
|
4
|
+
基于rxjs封装js-bridge的js端
|
|
5
|
+
|
|
6
|
+
# 使用
|
|
7
|
+
安装rxjs依赖<br/>
|
|
8
|
+
npm install rxjs-native-bridge<br/>
|
|
9
|
+
### 初始化js-bridge main.js
|
|
10
|
+
import 'rxjs-native-bridge'<br/>
|
|
11
|
+
### 扩展
|
|
12
|
+
// import { jsBridge, rxJsBridge, JSBridge, RxJSBridge } from 'rxjs-native-bridge'<br/>
|
|
13
|
+
自定义jsBridge扩展继承 JSBridge<br/>
|
|
14
|
+
自定义RxJSBridge扩展继承 RxJSBridge<br/>
|
|
15
|
+
|
|
16
|
+
### 不使用rxjs
|
|
17
|
+
import { jsBridge } from 'rxjs-native-bridge'<br/>
|
|
18
|
+
#### js调用native
|
|
19
|
+
|
|
20
|
+
jsBridge.callHandler('handlerName', { num: 1 }, res => {
|
|
21
|
+
console.log(res)
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
#### js注册方法共native调用
|
|
25
|
+
|
|
26
|
+
jsBridge.registerHandler('handlerName', (params, callback) => {
|
|
27
|
+
console.log('native 参数', params)
|
|
28
|
+
callback({ name: 'hello' })
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
### 使用rxjs
|
|
32
|
+
安装rxjs依赖<br/>
|
|
33
|
+
npm install rxjs@7.8.2<br/>
|
|
34
|
+
import { rxJsBridge } from 'rxjs-native-bridge'<br/>
|
|
35
|
+
#### js调用native全局回调值拦截器
|
|
36
|
+
rxJsBridge.useCallInterceptor<{ data: unknown }>(res => {
|
|
37
|
+
if (!res) throw new Error('native error')
|
|
38
|
+
if (res?.data) return res.data
|
|
39
|
+
})
|
|
40
|
+
#### js调用native
|
|
41
|
+
rxJsBridge.call<{ num: number }, { name: string }>('test', { num: 1 }).subscribe(res => {
|
|
42
|
+
console.log(res.name)
|
|
43
|
+
})
|
|
44
|
+
#### js注册方法共native调用
|
|
45
|
+
|
|
46
|
+
// 模块a注册事件<br/>
|
|
47
|
+
rxJsBridge.register('handlerName')<br/>
|
|
48
|
+
rxJsBridge.setState('handlerName', { name: 'hello' }) // 设置事件得回调参数<br/>
|
|
49
|
+
rxJsBridge.delState('handlerName') // 删除对应函数的回调值,删除后回调为null<br/>
|
|
50
|
+
rxJsBridge.clearState() // 清空所有回调值,回调为null<br/>
|
|
51
|
+
|
|
52
|
+
// 其他模块监听native调用提供的方法<br/>
|
|
53
|
+
const sub = rxJsBridge.on('handlerName').subscribe(({ params }) => {
|
|
54
|
+
console.log('native 传的参数', params)
|
|
55
|
+
})
|
|
56
|
+
|
|
57
|
+
sub.unsubscribe() // 取消监听
|
|
58
|
+
##### 监听执行并自动取消
|
|
59
|
+
rxJsBridge.once('handlerName').subscribe(({ params }) => {
|
|
60
|
+
console.log('native 参数', params)
|
|
61
|
+
})
|
|
62
|
+
###### or
|
|
63
|
+
rxJsBridge
|
|
64
|
+
.event('handlerName')
|
|
65
|
+
.pipe(take(1))
|
|
66
|
+
.subscribe(({ params }) => {
|
|
67
|
+
console.log('native 参数', params)
|
|
68
|
+
})
|
|
69
|
+
##### 链式调用
|
|
70
|
+
rxJsBridge
|
|
71
|
+
.register('handlerName')
|
|
72
|
+
.on('handlerName')
|
|
73
|
+
.subscribe(({ params }) => {
|
|
74
|
+
console.log('native 参数', params)
|
|
75
|
+
})
|
|
76
|
+
|
|
77
|
+
##### 同时注册并监听事件
|
|
78
|
+
const sub = rxJsBridge
|
|
79
|
+
.event('handlerName')
|
|
80
|
+
.subscribe(({ params }) => {
|
|
81
|
+
console.log('native 参数', params)
|
|
82
|
+
})
|
|
83
|
+
|
|
84
|
+
sub.unsubscribe() // 取消监听
|
|
85
|
+
|
|
86
|
+
### 构建项目
|
|
87
|
+
npm run build
|
package/dist/es/index.js
ADDED
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
class r {
|
|
2
|
+
static instance;
|
|
3
|
+
bridge;
|
|
4
|
+
isReady = !1;
|
|
5
|
+
readyCallbacks = [];
|
|
6
|
+
isAndroid = navigator.userAgent.includes("Android") || navigator.userAgent.includes("Adr");
|
|
7
|
+
isiOS = /\(i[^;]+;( U;)? CPU.+Mac OS X/.test(navigator.userAgent);
|
|
8
|
+
constructor() {
|
|
9
|
+
this.setup();
|
|
10
|
+
}
|
|
11
|
+
/** 获取单例 */
|
|
12
|
+
static getInstance() {
|
|
13
|
+
return r.instance || (r.instance = new r()), r.instance;
|
|
14
|
+
}
|
|
15
|
+
/** 是否在 Native WebView 中 */
|
|
16
|
+
isNative() {
|
|
17
|
+
return !!window.WebViewJavascriptBridge;
|
|
18
|
+
}
|
|
19
|
+
/** 初始化 bridge */
|
|
20
|
+
setup() {
|
|
21
|
+
this.isAndroid ? this.setupAndroid() : this.isiOS && this.setupIOS();
|
|
22
|
+
}
|
|
23
|
+
setupAndroid() {
|
|
24
|
+
window.WebViewJavascriptBridge ? this.onReady(window.WebViewJavascriptBridge) : document.addEventListener(
|
|
25
|
+
"WebViewJavascriptBridgeReady",
|
|
26
|
+
() => {
|
|
27
|
+
this.onReady(window.WebViewJavascriptBridge);
|
|
28
|
+
},
|
|
29
|
+
!1
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
setupIOS() {
|
|
33
|
+
if (window.WebViewJavascriptBridge) {
|
|
34
|
+
this.onReady(window.WebViewJavascriptBridge);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
if (window.WVJBCallbacks) {
|
|
38
|
+
window.WVJBCallbacks.push((e) => this.onReady(e));
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
window.WVJBCallbacks = [(e) => this.onReady(e)];
|
|
42
|
+
const t = document.createElement("iframe");
|
|
43
|
+
t.style.display = "none", t.src = "https://__bridge_loaded__", document.documentElement.appendChild(t), setTimeout(() => {
|
|
44
|
+
document.documentElement.removeChild(t);
|
|
45
|
+
}, 0);
|
|
46
|
+
}
|
|
47
|
+
/** bridge ready 统一入口 */
|
|
48
|
+
onReady(t) {
|
|
49
|
+
this.isReady || (this.bridge = t, this.isReady = !0, this.isAndroid && t.init((e, i) => {
|
|
50
|
+
i("JS init response");
|
|
51
|
+
}), this.readyCallbacks.forEach((e) => e(t)), this.readyCallbacks.length = 0);
|
|
52
|
+
}
|
|
53
|
+
/** 等待 bridge 可用 */
|
|
54
|
+
withBridge(t) {
|
|
55
|
+
this.isReady && this.bridge ? t(this.bridge) : this.readyCallbacks.push(t);
|
|
56
|
+
}
|
|
57
|
+
/** JS 调用 Native */
|
|
58
|
+
callHandler(t, e, i) {
|
|
59
|
+
this.withBridge((s) => {
|
|
60
|
+
s.callHandler(t, e, i);
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
/** Native 调用 JS */
|
|
64
|
+
registerHandler(t, e) {
|
|
65
|
+
this.withBridge((i) => {
|
|
66
|
+
i.registerHandler(t, e);
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
const w = r.getInstance();
|
|
71
|
+
let h, d, p, o;
|
|
72
|
+
(async () => {
|
|
73
|
+
try {
|
|
74
|
+
const c = await import("rxjs");
|
|
75
|
+
h = c.Observable, d = c.Subject, o = await import("../index-HOABx4tn.js"), p = c.BehaviorSubject;
|
|
76
|
+
} catch (c) {
|
|
77
|
+
throw new Error("RxJS 未安装,RxJsBridge 功能不可用" + c);
|
|
78
|
+
}
|
|
79
|
+
})();
|
|
80
|
+
class n extends r {
|
|
81
|
+
static instance;
|
|
82
|
+
_callInterceptor;
|
|
83
|
+
_stateMap = /* @__PURE__ */ new Map();
|
|
84
|
+
// 全局事件总线(Native -> Web)
|
|
85
|
+
_event = d ? new d() : void 0;
|
|
86
|
+
_registered = /* @__PURE__ */ new Set();
|
|
87
|
+
constructor() {
|
|
88
|
+
super();
|
|
89
|
+
}
|
|
90
|
+
// 单列模式获取
|
|
91
|
+
static getInstance() {
|
|
92
|
+
return n.instance || (n.instance = new n()), n.instance;
|
|
93
|
+
}
|
|
94
|
+
// call的回调拦截器
|
|
95
|
+
useCallInterceptor(t) {
|
|
96
|
+
return this._callInterceptor = t, this;
|
|
97
|
+
}
|
|
98
|
+
/* --------------------------------
|
|
99
|
+
* Web 调用 Native
|
|
100
|
+
* -------------------------------- */
|
|
101
|
+
call(t, e) {
|
|
102
|
+
return new h((i) => {
|
|
103
|
+
try {
|
|
104
|
+
this.callHandler(t, e, (s) => {
|
|
105
|
+
try {
|
|
106
|
+
let a = s;
|
|
107
|
+
this._callInterceptor && (a = this._callInterceptor(s, {
|
|
108
|
+
handlerName: t,
|
|
109
|
+
params: e
|
|
110
|
+
})), i.next(a), i.complete();
|
|
111
|
+
} catch (a) {
|
|
112
|
+
i.error(a);
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
} catch (s) {
|
|
116
|
+
i.error(s);
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
// 设置对应回调值
|
|
121
|
+
setState(t, e) {
|
|
122
|
+
if (!this._registered.has(t))
|
|
123
|
+
return;
|
|
124
|
+
let i = this._stateMap.get(t);
|
|
125
|
+
i ? i.next(e) : (i = new p(e), this._stateMap.set(t, i));
|
|
126
|
+
}
|
|
127
|
+
// 删除回调值
|
|
128
|
+
delState(t) {
|
|
129
|
+
const e = this._stateMap.get(t);
|
|
130
|
+
e && (e.complete(), this._stateMap.delete(t));
|
|
131
|
+
}
|
|
132
|
+
// 清空所有回调值
|
|
133
|
+
clearState() {
|
|
134
|
+
this._stateMap.forEach((t) => t.complete()), this._stateMap.clear();
|
|
135
|
+
}
|
|
136
|
+
/* --------------------------------
|
|
137
|
+
* Native 事件注册(推送进 RxJS)
|
|
138
|
+
* -------------------------------- */
|
|
139
|
+
register(t, e) {
|
|
140
|
+
return this._registered.has(t) ? this : (this._registered.add(t), e !== void 0 && this.setState(t, e), this.registerHandler(t, (i, s) => {
|
|
141
|
+
const a = (u) => {
|
|
142
|
+
console.log("扩展方法,暂时无用", u);
|
|
143
|
+
};
|
|
144
|
+
this._event.next({
|
|
145
|
+
key: t,
|
|
146
|
+
params: i,
|
|
147
|
+
reply: a
|
|
148
|
+
});
|
|
149
|
+
const l = this._stateMap.get(t);
|
|
150
|
+
s(l ? l.getValue() : null);
|
|
151
|
+
}), this);
|
|
152
|
+
}
|
|
153
|
+
/* --------------------------------
|
|
154
|
+
* Web 监听 Native 事件
|
|
155
|
+
* -------------------------------- */
|
|
156
|
+
on(t) {
|
|
157
|
+
return this._event.pipe(
|
|
158
|
+
o.filter((e) => e.key === t),
|
|
159
|
+
o.map((e) => ({
|
|
160
|
+
params: e.params,
|
|
161
|
+
reply: e.reply
|
|
162
|
+
}))
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
/* --------------------------------
|
|
166
|
+
* Native 事件注册(推送进 RxJS) + Web 监听 Native 事件
|
|
167
|
+
* -------------------------------- */
|
|
168
|
+
event(t, e) {
|
|
169
|
+
return this.register(t, e), this.on(t);
|
|
170
|
+
}
|
|
171
|
+
/* --------------------------------
|
|
172
|
+
* Native 事件注册(推送进 RxJS) + Web 监听 Native 事件 只监听一次
|
|
173
|
+
* -------------------------------- */
|
|
174
|
+
once(t, e) {
|
|
175
|
+
return this.register(t, e), this.on(t).pipe(o.take(1));
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
const g = n.getInstance();
|
|
179
|
+
export {
|
|
180
|
+
r as JSBridge,
|
|
181
|
+
n as RxJsBridge,
|
|
182
|
+
w as jsBridge,
|
|
183
|
+
g as rxJsBridge
|
|
184
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function x(n){return typeof n=="function"}function Fn(n){return x(n?.lift)}function p(n){return function(t){if(Fn(t))return t.lift(function(e){try{return n(e,this)}catch(r){this.error(r)}});throw new TypeError("Unable to lift unknown Observable type")}}var sn=function(n,t){return sn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])},sn(n,t)};function R(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");sn(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}function Rt(n,t,e,r){function i(o){return o instanceof e?o:new e(function(u){u(o)})}return new(e||(e=Promise))(function(o,u){function a(l){try{f(r.next(l))}catch(s){u(s)}}function c(l){try{f(r.throw(l))}catch(s){u(s)}}function f(l){l.done?o(l.value):i(l.value).then(a,c)}f((r=r.apply(n,t||[])).next())})}function Nn(n,t){var e={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,u=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return u.next=a(0),u.throw=a(1),u.return=a(2),typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function a(f){return function(l){return c([f,l])}}function c(f){if(r)throw new TypeError("Generator is already executing.");for(;u&&(u=0,f[0]&&(e=0)),e;)try{if(r=1,i&&(o=f[0]&2?i.return:f[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,f[1])).done)return o;switch(i=0,o&&(f=[f[0]&2,o.value]),f[0]){case 0:case 1:o=f;break;case 4:return e.label++,{value:f[1],done:!1};case 5:e.label++,i=f[1],f=[0];continue;case 7:f=e.ops.pop(),e.trys.pop();continue;default:if(o=e.trys,!(o=o.length>0&&o[o.length-1])&&(f[0]===6||f[0]===2)){e=0;continue}if(f[0]===3&&(!o||f[1]>o[0]&&f[1]<o[3])){e.label=f[1];break}if(f[0]===6&&e.label<o[1]){e.label=o[1],o=f;break}if(o&&e.label<o[2]){e.label=o[2],e.ops.push(f);break}o[2]&&e.ops.pop(),e.trys.pop();continue}f=t.call(n,e)}catch(l){f=[6,l],i=0}finally{r=o=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}function O(n){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&n[t],r=0;if(e)return e.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&r>=n.length&&(n=void 0),{value:n&&n[r++],done:!n}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function E(n,t){var e=typeof Symbol=="function"&&n[Symbol.iterator];if(!e)return n;var r=e.call(n),i,o=[],u;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(a){u={error:a}}finally{try{i&&!i.done&&(e=r.return)&&e.call(r)}finally{if(u)throw u.error}}return o}function I(n,t,e){if(e||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return n.concat(o||Array.prototype.slice.call(t))}function D(n){return this instanceof D?(this.v=n,this):new D(n)}function Pt(n,t,e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=e.apply(n,t||[]),i,o=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",u),i[Symbol.asyncIterator]=function(){return this},i;function u(d){return function(m){return Promise.resolve(m).then(d,s)}}function a(d,m){r[d]&&(i[d]=function(y){return new Promise(function(b,w){o.push([d,y,b,w])>1||c(d,y)})},m&&(i[d]=m(i[d])))}function c(d,m){try{f(r[d](m))}catch(y){h(o[0][3],y)}}function f(d){d.value instanceof D?Promise.resolve(d.value.v).then(l,s):h(o[0][2],d)}function l(d){c("next",d)}function s(d){c("throw",d)}function h(d,m){d(m),o.shift(),o.length&&c(o[0][0],o[0][1])}}function Vt(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=n[Symbol.asyncIterator],e;return t?t.call(n):(n=typeof O=="function"?O(n):n[Symbol.iterator](),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(o){e[o]=n[o]&&function(u){return new Promise(function(a,c){u=n[o](u),i(a,c,u.done,u.value)})}}function i(o,u,a,c){Promise.resolve(c).then(function(f){o({value:f,done:a})},u)}}var qn=(function(n){return n&&typeof n.length=="number"&&typeof n!="function"});function zn(n){return x(n?.then)}function z(n){var t=function(r){Error.call(r),r.stack=new Error().stack},e=n(t);return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var fn=z(function(n){return function(e){n(this),this.message=e?e.length+` errors occurred during unsubscription:
|
|
2
|
+
`+e.map(function(r,i){return i+1+") "+r.toString()}).join(`
|
|
3
|
+
`):"",this.name="UnsubscriptionError",this.errors=e}});function _(n,t){if(n){var e=n.indexOf(t);0<=e&&n.splice(e,1)}}var P=(function(){function n(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return n.prototype.unsubscribe=function(){var t,e,r,i,o;if(!this.closed){this.closed=!0;var u=this._parentage;if(u)if(this._parentage=null,Array.isArray(u))try{for(var a=O(u),c=a.next();!c.done;c=a.next()){var f=c.value;f.remove(this)}}catch(y){t={error:y}}finally{try{c&&!c.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}else u.remove(this);var l=this.initialTeardown;if(x(l))try{l()}catch(y){o=y instanceof fn?y.errors:[y]}var s=this._finalizers;if(s){this._finalizers=null;try{for(var h=O(s),d=h.next();!d.done;d=h.next()){var m=d.value;try{On(m)}catch(y){o=o??[],y instanceof fn?o=I(I([],E(o)),E(y.errors)):o.push(y)}}}catch(y){r={error:y}}finally{try{d&&!d.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}}if(o)throw new fn(o)}},n.prototype.add=function(t){var e;if(t&&t!==this)if(this.closed)On(t);else{if(t instanceof n){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(e=this._finalizers)!==null&&e!==void 0?e:[]).push(t)}},n.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},n.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},n.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&_(e,t)},n.prototype.remove=function(t){var e=this._finalizers;e&&_(e,t),t instanceof n&&t._removeParent(this)},n.EMPTY=(function(){var t=new n;return t.closed=!0,t})(),n})(),$n=P.EMPTY;function Dn(n){return n instanceof P||n&&"closed"in n&&x(n.remove)&&x(n.add)&&x(n.unsubscribe)}function On(n){x(n)?n():n.unsubscribe()}var Mt={Promise:void 0},_t={setTimeout:function(n,t){for(var e=[],r=2;r<arguments.length;r++)e[r-2]=arguments[r];return setTimeout.apply(void 0,I([n,t],E(e)))},clearTimeout:function(n){return clearTimeout(n)},delegate:void 0};function Yn(n){_t.setTimeout(function(){throw n})}function T(){}function nn(n){n()}var hn=(function(n){R(t,n);function t(e){var r=n.call(this)||this;return r.isStopped=!1,e?(r.destination=e,Dn(e)&&e.add(r)):r.destination=Ft,r}return t.create=function(e,r,i){return new K(e,r,i)},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,n.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t})(P),Ut=(function(){function n(t){this.partialObserver=t}return n.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(r){H(r)}},n.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(r){H(r)}else H(t)},n.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(e){H(e)}},n})(),K=(function(n){R(t,n);function t(e,r,i){var o=n.call(this)||this,u;return x(e)||!e?u={next:e??void 0,error:r??void 0,complete:i??void 0}:u=e,o.destination=new Ut(u),o}return t})(hn);function H(n){Yn(n)}function Lt(n){throw n}var Ft={closed:!0,next:T,error:Lt,complete:T},dn=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();function j(n){return n}function Gn(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return Kn(n)}function Kn(n){return n.length===0?j:n.length===1?n[0]:function(e){return n.reduce(function(r,i){return i(r)},e)}}var A=(function(){function n(t){t&&(this._subscribe=t)}return n.prototype.lift=function(t){var e=new n;return e.source=this,e.operator=t,e},n.prototype.subscribe=function(t,e,r){var i=this,o=qt(t)?t:new K(t,e,r);return nn(function(){var u=i,a=u.operator,c=u.source;o.add(a?a.call(o,c):c?i._subscribe(o):i._trySubscribe(o))}),o},n.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},n.prototype.forEach=function(t,e){var r=this;return e=Wn(e),new e(function(i,o){var u=new K({next:function(a){try{t(a)}catch(c){o(c),u.unsubscribe()}},error:o,complete:i});r.subscribe(u)})},n.prototype._subscribe=function(t){var e;return(e=this.source)===null||e===void 0?void 0:e.subscribe(t)},n.prototype[dn]=function(){return this},n.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Kn(t)(this)},n.prototype.toPromise=function(t){var e=this;return t=Wn(t),new t(function(r,i){var o;e.subscribe(function(u){return o=u},function(u){return i(u)},function(){return r(o)})})},n.create=function(t){return new n(t)},n})();function Wn(n){var t;return(t=n??Mt.Promise)!==null&&t!==void 0?t:Promise}function Nt(n){return n&&x(n.next)&&x(n.error)&&x(n.complete)}function qt(n){return n&&n instanceof hn||Nt(n)&&Dn(n)}function Zn(n){return x(n[dn])}function Bn(n){return Symbol.asyncIterator&&x(n?.[Symbol.asyncIterator])}function Jn(n){return new TypeError("You provided "+(n!==null&&typeof n=="object"?"an invalid object":"'"+n+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function zt(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Xn=zt();function Qn(n){return x(n?.[Xn])}function Hn(n){return Pt(this,arguments,function(){var e,r,i,o;return Nn(this,function(u){switch(u.label){case 0:e=n.getReader(),u.label=1;case 1:u.trys.push([1,,9,10]),u.label=2;case 2:return[4,D(e.read())];case 3:return r=u.sent(),i=r.value,o=r.done,o?[4,D(void 0)]:[3,5];case 4:return[2,u.sent()];case 5:return[4,D(i)];case 6:return[4,u.sent()];case 7:return u.sent(),[3,2];case 8:return[3,10];case 9:return e.releaseLock(),[7];case 10:return[2]}})})}function nt(n){return x(n?.getReader)}function g(n){if(n instanceof A)return n;if(n!=null){if(Zn(n))return $t(n);if(qn(n))return Dt(n);if(zn(n))return Yt(n);if(Bn(n))return tt(n);if(Qn(n))return Gt(n);if(nt(n))return Kt(n)}throw Jn(n)}function $t(n){return new A(function(t){var e=n[dn]();if(x(e.subscribe))return e.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Dt(n){return new A(function(t){for(var e=0;e<n.length&&!t.closed;e++)t.next(n[e]);t.complete()})}function Yt(n){return new A(function(t){n.then(function(e){t.closed||(t.next(e),t.complete())},function(e){return t.error(e)}).then(null,Yn)})}function Gt(n){return new A(function(t){var e,r;try{for(var i=O(n),o=i.next();!o.done;o=i.next()){var u=o.value;if(t.next(u),t.closed)return}}catch(a){e={error:a}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}t.complete()})}function tt(n){return new A(function(t){Zt(n,t).catch(function(e){return t.error(e)})})}function Kt(n){return tt(Hn(n))}function Zt(n,t){var e,r,i,o;return Rt(this,void 0,void 0,function(){var u,a;return Nn(this,function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),e=Vt(n),c.label=1;case 1:return[4,e.next()];case 2:if(r=c.sent(),!!r.done)return[3,4];if(u=r.value,t.next(u),t.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return a=c.sent(),i={error:a},[3,11];case 6:return c.trys.push([6,,9,10]),r&&!r.done&&(o=e.return)?[4,o.call(e)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}function v(n,t,e,r,i){return new pn(n,t,e,r,i)}var pn=(function(n){R(t,n);function t(e,r,i,o,u,a){var c=n.call(this,e)||this;return c.onFinalize=u,c.shouldUnsubscribe=a,c._next=r?function(f){try{r(f)}catch(l){e.error(l)}}:n.prototype._next,c._error=o?function(f){try{o(f)}catch(l){e.error(l)}finally{this.unsubscribe()}}:n.prototype._error,c._complete=i?function(){try{i()}catch(f){e.error(f)}finally{this.unsubscribe()}}:n.prototype._complete,c}return t.prototype.unsubscribe=function(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;n.prototype.unsubscribe.call(this),!r&&((e=this.onFinalize)===null||e===void 0||e.call(this))}},t})(hn);function et(n){return p(function(t,e){var r=!1,i=null,o=null,u=!1,a=function(){if(o?.unsubscribe(),o=null,r){r=!1;var f=i;i=null,e.next(f)}u&&e.complete()},c=function(){o=null,u&&e.complete()};t.subscribe(v(e,function(f){r=!0,i=f,o||g(n(f)).subscribe(o=v(e,a,c))},function(){u=!0,(!r||!o||o.closed)&&e.complete()}))})}var Bt=(function(n){R(t,n);function t(e,r){return n.call(this)||this}return t.prototype.schedule=function(e,r){return this},t})(P),Rn={setInterval:function(n,t){for(var e=[],r=2;r<arguments.length;r++)e[r-2]=arguments[r];return setInterval.apply(void 0,I([n,t],E(e)))},clearInterval:function(n){return clearInterval(n)},delegate:void 0},Jt=(function(n){R(t,n);function t(e,r){var i=n.call(this,e,r)||this;return i.scheduler=e,i.work=r,i.pending=!1,i}return t.prototype.schedule=function(e,r){var i;if(r===void 0&&(r=0),this.closed)return this;this.state=e;var o=this.id,u=this.scheduler;return o!=null&&(this.id=this.recycleAsyncId(u,o,r)),this.pending=!0,this.delay=r,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(u,this.id,r),this},t.prototype.requestAsyncId=function(e,r,i){return i===void 0&&(i=0),Rn.setInterval(e.flush.bind(e,this),i)},t.prototype.recycleAsyncId=function(e,r,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return r;r!=null&&Rn.clearInterval(r)},t.prototype.execute=function(e,r){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(e,r);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,r){var i=!1,o;try{this.work(e)}catch(u){i=!0,o=u||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),o},t.prototype.unsubscribe=function(){if(!this.closed){var e=this,r=e.id,i=e.scheduler,o=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,_(o,this),r!=null&&(this.id=this.recycleAsyncId(i,r,null)),this.delay=null,n.prototype.unsubscribe.call(this)}},t})(Bt),en={now:function(){return(en.delegate||Date).now()},delegate:void 0},Pn=(function(){function n(t,e){e===void 0&&(e=n.now),this.schedulerActionCtor=t,this.now=e}return n.prototype.schedule=function(t,e,r){return e===void 0&&(e=0),new this.schedulerActionCtor(this,t).schedule(r,e)},n.now=en.now,n})(),Xt=(function(n){R(t,n);function t(e,r){r===void 0&&(r=Pn.now);var i=n.call(this,e,r)||this;return i.actions=[],i._active=!1,i}return t.prototype.flush=function(e){var r=this.actions;if(this._active){r.push(e);return}var i;this._active=!0;do if(i=e.execute(e.state,e.delay))break;while(e=r.shift());if(this._active=!1,i){for(;e=r.shift();)e.unsubscribe();throw i}},t})(Pn),V=new Xt(Jt),rt=V;function it(n){return n&&x(n.schedule)}function mn(n){return n instanceof Date&&!isNaN(n)}function Y(n,t,e){n===void 0&&(n=0),e===void 0&&(e=rt);var r=-1;return t!=null&&(it(t)?e=t:r=t),new A(function(i){var o=mn(n)?+n-e.now():n;o<0&&(o=0);var u=0;return e.schedule(function(){i.closed||(i.next(u++),0<=r?this.schedule(void 0,r):i.complete())},o)})}function Qt(n,t){return t===void 0&&(t=V),et(function(){return Y(n,t)})}function Ht(n){return p(function(t,e){var r=[];return t.subscribe(v(e,function(i){return r.push(i)},function(){e.next(r),e.complete()})),g(n).subscribe(v(e,function(){var i=r;r=[],e.next(i)},T)),function(){r=null}})}function ne(n,t){return t===void 0&&(t=null),t=t??n,p(function(e,r){var i=[],o=0;e.subscribe(v(r,function(u){var a,c,f,l,s=null;o++%t===0&&i.push([]);try{for(var h=O(i),d=h.next();!d.done;d=h.next()){var m=d.value;m.push(u),n<=m.length&&(s=s??[],s.push(m))}}catch(w){a={error:w}}finally{try{d&&!d.done&&(c=h.return)&&c.call(h)}finally{if(a)throw a.error}}if(s)try{for(var y=O(s),b=y.next();!b.done;b=y.next()){var m=b.value;_(i,m),r.next(m)}}catch(w){f={error:w}}finally{try{b&&!b.done&&(l=y.return)&&l.call(y)}finally{if(f)throw f.error}}},function(){var u,a;try{for(var c=O(i),f=c.next();!f.done;f=c.next()){var l=f.value;r.next(l)}}catch(s){u={error:s}}finally{try{f&&!f.done&&(a=c.return)&&a.call(c)}finally{if(u)throw u.error}}r.complete()},void 0,function(){i=null}))})}function yn(n){return n[n.length-1]}function rn(n){return x(yn(n))?n.pop():void 0}function L(n){return it(yn(n))?n.pop():void 0}function te(n,t){return typeof yn(n)=="number"?n.pop():t}function W(n,t,e,r,i){r===void 0&&(r=0),i===void 0&&(i=!1);var o=t.schedule(function(){e(),i?n.add(this.schedule(null,r)):this.unsubscribe()},r);if(n.add(o),!i)return o}function ee(n){for(var t,e,r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];var o=(t=L(r))!==null&&t!==void 0?t:V,u=(e=r[0])!==null&&e!==void 0?e:null,a=r[1]||1/0;return p(function(c,f){var l=[],s=!1,h=function(y){var b=y.buffer,w=y.subs;w.unsubscribe(),_(l,y),f.next(b),s&&d()},d=function(){if(l){var y=new P;f.add(y);var b=[],w={buffer:b,subs:y};l.push(w),W(y,o,function(){return h(w)},n)}};u!==null&&u>=0?W(f,o,d,u,!0):s=!0,d();var m=v(f,function(y){var b,w,S=l.slice();try{for(var C=O(S),U=C.next();!U.done;U=C.next()){var F=U.value,N=F.buffer;N.push(y),a<=N.length&&h(F)}}catch(Wt){b={error:Wt}}finally{try{U&&!U.done&&(w=C.return)&&w.call(C)}finally{if(b)throw b.error}}},function(){for(;l?.length;)f.next(l.shift().buffer);m?.unsubscribe(),f.complete(),f.unsubscribe()},void 0,function(){return l=null});c.subscribe(m)})}function re(n,t){return p(function(e,r){var i=[];g(n).subscribe(v(r,function(o){var u=[];i.push(u);var a=new P,c=function(){_(i,u),r.next(u),a.unsubscribe()};a.add(g(t(o)).subscribe(v(r,c,T)))},T)),e.subscribe(v(r,function(o){var u,a;try{for(var c=O(i),f=c.next();!f.done;f=c.next()){var l=f.value;l.push(o)}}catch(s){u={error:s}}finally{try{f&&!f.done&&(a=c.return)&&a.call(c)}finally{if(u)throw u.error}}},function(){for(;i.length>0;)r.next(i.shift());r.complete()}))})}function ie(n){return p(function(t,e){var r=null,i=null,o=function(){i?.unsubscribe();var u=r;r=[],u&&e.next(u),g(n()).subscribe(i=v(e,o,T))};o(),t.subscribe(v(e,function(u){return r?.push(u)},function(){r&&e.next(r),e.complete()},void 0,function(){return r=i=null}))})}function ot(n){return p(function(t,e){var r=null,i=!1,o;r=t.subscribe(v(e,void 0,void 0,function(u){o=g(n(u,ot(n)(t))),r?(r.unsubscribe(),r=null,o.subscribe(e)):i=!0})),i&&(r.unsubscribe(),r=null,o.subscribe(e))})}var oe=Array.isArray,ue=Object.getPrototypeOf,ae=Object.prototype,fe=Object.keys;function ce(n){if(n.length===1){var t=n[0];if(oe(t))return{args:t,keys:null};if(le(t)){var e=fe(t);return{args:e.map(function(r){return t[r]}),keys:e}}}return{args:n,keys:null}}function le(n){return n&&typeof n=="object"&&ue(n)===ae}function bn(n,t){return t===void 0&&(t=0),p(function(e,r){e.subscribe(v(r,function(i){return W(r,n,function(){return r.next(i)},t)},function(){return W(r,n,function(){return r.complete()},t)},function(i){return W(r,n,function(){return r.error(i)},t)}))})}function wn(n,t){return t===void 0&&(t=0),p(function(e,r){r.add(n.schedule(function(){return e.subscribe(r)},t))})}function se(n,t){return g(n).pipe(wn(t),bn(t))}function ve(n,t){return g(n).pipe(wn(t),bn(t))}function he(n,t){return new A(function(e){var r=0;return t.schedule(function(){r===n.length?e.complete():(e.next(n[r++]),e.closed||this.schedule())})})}function de(n,t){return new A(function(e){var r;return W(e,t,function(){r=n[Xn](),W(e,t,function(){var i,o,u;try{i=r.next(),o=i.value,u=i.done}catch(a){e.error(a);return}u?e.complete():e.next(o)},0,!0)}),function(){return x(r?.return)&&r.return()}})}function ut(n,t){if(!n)throw new Error("Iterable cannot be null");return new A(function(e){W(e,t,function(){var r=n[Symbol.asyncIterator]();W(e,t,function(){r.next().then(function(i){i.done?e.complete():e.next(i.value)})},0,!0)})})}function pe(n,t){return ut(Hn(n),t)}function me(n,t){if(n!=null){if(Zn(n))return se(n,t);if(qn(n))return he(n,t);if(zn(n))return ve(n,t);if(Bn(n))return ut(n,t);if(Qn(n))return de(n,t);if(nt(n))return pe(n,t)}throw Jn(n)}function G(n,t){return t?me(n,t):g(n)}function $(n,t){return p(function(e,r){var i=0;e.subscribe(v(r,function(o){r.next(n.call(t,o,i++))}))})}var ye=Array.isArray;function be(n,t){return ye(t)?n.apply(void 0,I([],E(t))):n(t)}function gn(n){return $(function(t){return be(n,t)})}function we(n,t){return n.reduce(function(e,r,i){return e[r]=t[i],e},{})}function ge(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var e=L(n),r=rn(n),i=ce(n),o=i.args,u=i.keys;if(o.length===0)return G([],e);var a=new A(at(o,e,u?function(c){return we(u,c)}:j));return r?a.pipe(gn(r)):a}function at(n,t,e){return e===void 0&&(e=j),function(r){Vn(t,function(){for(var i=n.length,o=new Array(i),u=i,a=i,c=function(l){Vn(t,function(){var s=G(n[l],t),h=!1;s.subscribe(v(r,function(d){o[l]=d,h||(h=!0,a--),a||r.next(e(o.slice()))},function(){--u||r.complete()}))},r)},f=0;f<i;f++)c(f)},r)}}function Vn(n,t,e){n?W(e,n,t):t()}function xn(n,t,e,r,i,o,u,a){var c=[],f=0,l=0,s=!1,h=function(){s&&!c.length&&!f&&t.complete()},d=function(y){return f<r?m(y):c.push(y)},m=function(y){o&&t.next(y),f++;var b=!1;g(e(y,l++)).subscribe(v(t,function(w){i?.(w),o?d(w):t.next(w)},function(){b=!0},void 0,function(){if(b)try{f--;for(var w=function(){var S=c.shift();u?W(t,u,function(){return m(S)}):m(S)};c.length&&f<r;)w();h()}catch(S){t.error(S)}}))};return n.subscribe(v(t,d,function(){s=!0,h()})),function(){a?.()}}function M(n,t,e){return e===void 0&&(e=1/0),x(t)?M(function(r,i){return $(function(o,u){return t(r,o,i,u)})(g(n(r,i)))},e):(typeof t=="number"&&(e=t),p(function(r,i){return xn(r,i,n,e)}))}function ft(n,t,e,r,i){return function(o,u){var a=e,c=t,f=0;o.subscribe(v(u,function(l){var s=f++;c=a?n(c,l,s):(a=!0,l),r&&u.next(c)},i&&(function(){a&&u.next(c),u.complete()})))}}function J(n,t){return p(ft(n,t,arguments.length>=2,!1,!0))}var xe=function(n,t){return n.push(t),n};function ct(){return p(function(n,t){J(xe,[])(n).subscribe(t)})}function lt(n,t){return Gn(ct(),M(function(e){return n(e)}),t?gn(t):j)}function st(n){return lt(ge,n)}var Se=st,Ee=Array.isArray;function X(n){return n.length===1&&Ee(n[0])?n[0]:n}function Sn(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var e=rn(n);return e?Gn(Sn.apply(void 0,I([],E(n))),gn(e)):p(function(r,i){at(I([r],E(X(n))))(i)})}function Ie(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return Sn.apply(void 0,I([],E(n)))}function En(n){return n===void 0&&(n=1/0),M(j,n)}function In(){return En(1)}function vt(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var e=L(n);return p(function(r,i){In()(G(I([r],E(n)),e)).subscribe(i)})}function vn(n,t){return x(t)?M(n,t,1):M(n,1)}function Ae(n,t){return x(t)?vn(function(){return n},t):vn(function(){return n})}function Te(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return vt.apply(void 0,I([],E(n)))}var ke=z(function(n){return function(){n(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),k=(function(n){R(t,n);function t(){var e=n.call(this)||this;return e.closed=!1,e.currentObservers=null,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return t.prototype.lift=function(e){var r=new Mn(this,this);return r.operator=e,r},t.prototype._throwIfClosed=function(){if(this.closed)throw new ke},t.prototype.next=function(e){var r=this;nn(function(){var i,o;if(r._throwIfClosed(),!r.isStopped){r.currentObservers||(r.currentObservers=Array.from(r.observers));try{for(var u=O(r.currentObservers),a=u.next();!a.done;a=u.next()){var c=a.value;c.next(e)}}catch(f){i={error:f}}finally{try{a&&!a.done&&(o=u.return)&&o.call(u)}finally{if(i)throw i.error}}}})},t.prototype.error=function(e){var r=this;nn(function(){if(r._throwIfClosed(),!r.isStopped){r.hasError=r.isStopped=!0,r.thrownError=e;for(var i=r.observers;i.length;)i.shift().error(e)}})},t.prototype.complete=function(){var e=this;nn(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var r=e.observers;r.length;)r.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return((e=this.observers)===null||e===void 0?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(e){return this._throwIfClosed(),n.prototype._trySubscribe.call(this,e)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var r=this,i=this,o=i.hasError,u=i.isStopped,a=i.observers;return o||u?$n:(this.currentObservers=null,a.push(e),new P(function(){r.currentObservers=null,_(a,e)}))},t.prototype._checkFinalizedStatuses=function(e){var r=this,i=r.hasError,o=r.thrownError,u=r.isStopped;i?e.error(o):u&&e.complete()},t.prototype.asObservable=function(){var e=new A;return e.source=this,e},t.create=function(e,r){return new Mn(e,r)},t})(A),Mn=(function(n){R(t,n);function t(e,r){var i=n.call(this)||this;return i.destination=e,i.source=r,i}return t.prototype.next=function(e){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.next)===null||i===void 0||i.call(r,e)},t.prototype.error=function(e){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.error)===null||i===void 0||i.call(r,e)},t.prototype.complete=function(){var e,r;(r=(e=this.destination)===null||e===void 0?void 0:e.complete)===null||r===void 0||r.call(e)},t.prototype._subscribe=function(e){var r,i;return(i=(r=this.source)===null||r===void 0?void 0:r.subscribe(e))!==null&&i!==void 0?i:$n},t})(k);function je(n){return new A(function(t){return n.subscribe(t)})}var Ce={connector:function(){return new k}};function An(n,t){t===void 0&&(t=Ce);var e=t.connector;return p(function(r,i){var o=e();g(n(je(o))).subscribe(i),i.add(r.subscribe(o))})}function Oe(n){return J(function(t,e,r){return!n||n(e,r)?t+1:t},0)}function We(n){return p(function(t,e){var r=!1,i=null,o=null,u=function(){if(o?.unsubscribe(),o=null,r){r=!1;var a=i;i=null,e.next(a)}};t.subscribe(v(e,function(a){o?.unsubscribe(),r=!0,i=a,o=v(e,u,T),g(n(a)).subscribe(o)},function(){u(),e.complete()},void 0,function(){i=o=null}))})}function Re(n,t){return t===void 0&&(t=V),p(function(e,r){var i=null,o=null,u=null,a=function(){if(i){i.unsubscribe(),i=null;var f=o;o=null,r.next(f)}};function c(){var f=u+n,l=t.now();if(l<f){i=this.schedule(void 0,f-l),r.add(i);return}a()}e.subscribe(v(r,function(f){o=f,u=t.now(),i||(i=t.schedule(c,n),r.add(i))},function(){a(),r.complete()},void 0,function(){o=i=null}))})}function on(n){return p(function(t,e){var r=!1;t.subscribe(v(e,function(i){r=!0,e.next(i)},function(){r||e.next(n),e.complete()}))})}function tn(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return In()(G(n,L(n)))}var Q=new A(function(n){return n.complete()});function Z(n){return n<=0?function(){return Q}:p(function(t,e){var r=0;t.subscribe(v(e,function(i){++r<=n&&(e.next(i),n<=r&&e.complete())}))})}function ht(){return p(function(n,t){n.subscribe(v(t,T))})}function dt(n){return $(function(){return n})}function Tn(n,t){return t?function(e){return tn(t.pipe(Z(1),ht()),e.pipe(Tn(n)))}:M(function(e,r){return g(n(e,r)).pipe(Z(1),dt(e))})}function Pe(n,t){t===void 0&&(t=V);var e=Y(n,t);return Tn(function(){return e})}function pt(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var e=L(n);return G(n,e)}function Ve(n,t){var e=x(n)?n:function(){return n},r=function(i){return i.error(e())};return new A(r)}var _n;(function(n){n.NEXT="N",n.ERROR="E",n.COMPLETE="C"})(_n||(_n={}));var cn=(function(){function n(t,e,r){this.kind=t,this.value=e,this.error=r,this.hasValue=t==="N"}return n.prototype.observe=function(t){return mt(this,t)},n.prototype.do=function(t,e,r){var i=this,o=i.kind,u=i.value,a=i.error;return o==="N"?t?.(u):o==="E"?e?.(a):r?.()},n.prototype.accept=function(t,e,r){var i;return x((i=t)===null||i===void 0?void 0:i.next)?this.observe(t):this.do(t,e,r)},n.prototype.toObservable=function(){var t=this,e=t.kind,r=t.value,i=t.error,o=e==="N"?pt(r):e==="E"?Ve(function(){return i}):e==="C"?Q:0;if(!o)throw new TypeError("Unexpected notification kind "+e);return o},n.createNext=function(t){return new n("N",t)},n.createError=function(t){return new n("E",void 0,t)},n.createComplete=function(){return n.completeNotification},n.completeNotification=new n("C"),n})();function mt(n,t){var e,r,i,o=n,u=o.kind,a=o.value,c=o.error;if(typeof u!="string")throw new TypeError('Invalid notification, missing "kind"');u==="N"?(e=t.next)===null||e===void 0||e.call(t,a):u==="E"?(r=t.error)===null||r===void 0||r.call(t,c):(i=t.complete)===null||i===void 0||i.call(t)}function Me(){return p(function(n,t){n.subscribe(v(t,function(e){return mt(e,t)}))})}function _e(n,t){return p(function(e,r){var i=new Set;e.subscribe(v(r,function(o){var u=n?n(o):o;i.has(u)||(i.add(u),r.next(o))})),t&&g(t).subscribe(v(r,function(){return i.clear()},T))})}function yt(n,t){return t===void 0&&(t=j),n=n??Ue,p(function(e,r){var i,o=!0;e.subscribe(v(r,function(u){var a=t(u);(o||!n(i,a))&&(o=!1,i=a,r.next(u))}))})}function Ue(n,t){return n===t}function Le(n,t){return yt(function(e,r){return t?t(e[n],r[n]):e[n]===r[n]})}var Un=z(function(n){return function(){n(this),this.name="ArgumentOutOfRangeError",this.message="argument out of range"}});function q(n,t){return p(function(e,r){var i=0;e.subscribe(v(r,function(o){return n.call(t,o,i++)&&r.next(o)}))})}var un=z(function(n){return function(){n(this),this.name="EmptyError",this.message="no elements in sequence"}});function an(n){return n===void 0&&(n=Fe),p(function(t,e){var r=!1;t.subscribe(v(e,function(i){r=!0,e.next(i)},function(){return r?e.complete():e.error(n())}))})}function Fe(){return new un}function Ne(n,t){if(n<0)throw new Un;var e=arguments.length>=2;return function(r){return r.pipe(q(function(i,o){return o===n}),Z(1),e?on(t):an(function(){return new Un}))}}function qe(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return function(e){return tn(e,pt.apply(void 0,I([],E(n))))}}function ze(n,t){return p(function(e,r){var i=0;e.subscribe(v(r,function(o){n.call(t,o,i++,e)||(r.next(!1),r.complete())},function(){r.next(!0),r.complete()}))})}function kn(n,t){return t?function(e){return e.pipe(kn(function(r,i){return g(n(r,i)).pipe($(function(o,u){return t(r,o,i,u)}))}))}:p(function(e,r){var i=0,o=null,u=!1;e.subscribe(v(r,function(a){o||(o=v(r,void 0,function(){o=null,u&&r.complete()}),g(n(a,i++)).subscribe(o))},function(){u=!0,!o&&r.complete()}))})}function bt(){return kn(j)}var $e=bt;function De(n,t,e){return t===void 0&&(t=1/0),t=(t||0)<1?1/0:t,p(function(r,i){return xn(r,i,n,t,void 0,!0,e)})}function Ye(n){return p(function(t,e){try{t.subscribe(e)}finally{e.add(n)}})}function Ge(n,t){return p(wt(n,t,"value"))}function wt(n,t,e){var r=e==="index";return function(i,o){var u=0;i.subscribe(v(o,function(a){var c=u++;n.call(t,a,c,i)&&(o.next(r?c:a),o.complete())},function(){o.next(r?-1:void 0),o.complete()}))}}function Ke(n,t){return p(wt(n,t,"index"))}function Ze(n,t){var e=arguments.length>=2;return function(r){return r.pipe(n?q(function(i,o){return n(i,o,r)}):j,Z(1),e?on(t):an(function(){return new un}))}}function Be(n,t,e,r){return p(function(i,o){var u;!t||typeof t=="function"?u=t:(e=t.duration,u=t.element,r=t.connector);var a=new Map,c=function(m){a.forEach(m),m(o)},f=function(m){return c(function(y){return y.error(m)})},l=0,s=!1,h=new pn(o,function(m){try{var y=n(m),b=a.get(y);if(!b){a.set(y,b=r?r():new k);var w=d(y,b);if(o.next(w),e){var S=v(b,function(){b.complete(),S?.unsubscribe()},void 0,void 0,function(){return a.delete(y)});h.add(g(e(w)).subscribe(S))}}b.next(u?u(m):m)}catch(C){f(C)}},function(){return c(function(m){return m.complete()})},f,function(){return a.clear()},function(){return s=!0,l===0});i.subscribe(h);function d(m,y){var b=new A(function(w){l++;var S=y.subscribe(w);return function(){S.unsubscribe(),--l===0&&s&&h.unsubscribe()}});return b.key=m,b}})}function Je(){return p(function(n,t){n.subscribe(v(t,function(){t.next(!1),t.complete()},function(){t.next(!0),t.complete()}))})}function gt(n){return n<=0?function(){return Q}:p(function(t,e){var r=[];t.subscribe(v(e,function(i){r.push(i),n<r.length&&r.shift()},function(){var i,o;try{for(var u=O(r),a=u.next();!a.done;a=u.next()){var c=a.value;e.next(c)}}catch(f){i={error:f}}finally{try{a&&!a.done&&(o=u.return)&&o.call(u)}finally{if(i)throw i.error}}e.complete()},void 0,function(){r=null}))})}function Xe(n,t){var e=arguments.length>=2;return function(r){return r.pipe(n?q(function(i,o){return n(i,o,r)}):j,gt(1),e?on(t):an(function(){return new un}))}}function Qe(){return p(function(n,t){n.subscribe(v(t,function(e){t.next(cn.createNext(e))},function(){t.next(cn.createComplete()),t.complete()},function(e){t.next(cn.createError(e)),t.complete()}))})}function He(n){return J(x(n)?function(t,e){return n(t,e)>0?t:e}:function(t,e){return t>e?t:e})}function xt(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var e=L(n),r=te(n,1/0);return p(function(i,o){En(r)(G(I([i],E(n)),e)).subscribe(o)})}var nr=M;function tr(n,t,e){return e===void 0&&(e=1/0),x(t)?M(function(){return n},t,e):(typeof t=="number"&&(e=t),M(function(){return n},e))}function er(n,t,e){return e===void 0&&(e=1/0),p(function(r,i){var o=t;return xn(r,i,function(u,a){return n(o,u,a)},e,function(u){o=u},!1,void 0,function(){return o=null})})}function rr(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return xt.apply(void 0,I([],E(n)))}function ir(n){return J(x(n)?function(t,e){return n(t,e)<0?t:e}:function(t,e){return t<e?t:e})}function St(){return p(function(n,t){var e=null;n._refCount++;var r=v(t,void 0,void 0,void 0,function(){if(!n||n._refCount<=0||0<--n._refCount){e=null;return}var i=n._connection,o=e;e=null,i&&(!o||i===o)&&i.unsubscribe(),t.unsubscribe()});n.subscribe(r),r.closed||(e=n.connect())})}var jn=(function(n){R(t,n);function t(e,r){var i=n.call(this)||this;return i.source=e,i.subjectFactory=r,i._subject=null,i._refCount=0,i._connection=null,Fn(e)&&(i.lift=e.lift),i}return t.prototype._subscribe=function(e){return this.getSubject().subscribe(e)},t.prototype.getSubject=function(){var e=this._subject;return(!e||e.isStopped)&&(this._subject=this.subjectFactory()),this._subject},t.prototype._teardown=function(){this._refCount=0;var e=this._connection;this._subject=this._connection=null,e?.unsubscribe()},t.prototype.connect=function(){var e=this,r=this._connection;if(!r){r=this._connection=new P;var i=this.getSubject();r.add(this.source.subscribe(v(i,void 0,function(){e._teardown(),i.complete()},function(o){e._teardown(),i.error(o)},function(){return e._teardown()}))),r.closed&&(this._connection=null,r=P.EMPTY)}return r},t.prototype.refCount=function(){return St()(this)},t})(A);function Cn(n,t){var e=x(n)?n:function(){return n};return x(t)?An(t,{connector:e}):function(r){return new jn(r,e)}}function or(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var e=X(n);return new A(function(r){var i=0,o=function(){if(i<e.length){var u=void 0;try{u=g(e[i++])}catch{o();return}var a=new pn(r,void 0,T,T);u.subscribe(a),a.add(o)}else r.complete()};o()})}function ur(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var e=X(n);return function(r){return or.apply(void 0,I([r],E(e)))}}var ar=ur;function fr(){return p(function(n,t){var e,r=!1;n.subscribe(v(t,function(i){var o=e;e=i,r&&t.next([o,i]),r=!0}))})}function cr(n,t){return function(e,r){return!n.call(t,e,r)}}function lr(n,t){return function(e){return[q(n,t)(e),q(cr(n,t))(e)]}}function sr(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var e=n.length;if(e===0)throw new Error("list of properties cannot be empty.");return $(function(r){for(var i=r,o=0;o<e;o++){var u=i?.[n[o]];if(typeof u<"u")i=u;else return}return i})}function vr(n){return n?function(t){return An(n)(t)}:function(t){return Cn(new k)(t)}}var hr=(function(n){R(t,n);function t(e){var r=n.call(this)||this;return r._value=e,r}return Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(e){var r=n.prototype._subscribe.call(this,e);return!r.closed&&e.next(this._value),r},t.prototype.getValue=function(){var e=this,r=e.hasError,i=e.thrownError,o=e._value;if(r)throw i;return this._throwIfClosed(),o},t.prototype.next=function(e){n.prototype.next.call(this,this._value=e)},t})(k);function dr(n){return function(t){var e=new hr(n);return new jn(t,function(){return e})}}var pr=(function(n){R(t,n);function t(){var e=n!==null&&n.apply(this,arguments)||this;return e._value=null,e._hasValue=!1,e._isComplete=!1,e}return t.prototype._checkFinalizedStatuses=function(e){var r=this,i=r.hasError,o=r._hasValue,u=r._value,a=r.thrownError,c=r.isStopped,f=r._isComplete;i?e.error(a):(c||f)&&(o&&e.next(u),e.complete())},t.prototype.next=function(e){this.isStopped||(this._value=e,this._hasValue=!0)},t.prototype.complete=function(){var e=this,r=e._hasValue,i=e._value,o=e._isComplete;o||(this._isComplete=!0,r&&n.prototype.next.call(this,i),n.prototype.complete.call(this))},t})(k);function mr(){return function(n){var t=new pr;return new jn(n,function(){return t})}}var Et=(function(n){R(t,n);function t(e,r,i){e===void 0&&(e=1/0),r===void 0&&(r=1/0),i===void 0&&(i=en);var o=n.call(this)||this;return o._bufferSize=e,o._windowTime=r,o._timestampProvider=i,o._buffer=[],o._infiniteTimeWindow=!0,o._infiniteTimeWindow=r===1/0,o._bufferSize=Math.max(1,e),o._windowTime=Math.max(1,r),o}return t.prototype.next=function(e){var r=this,i=r.isStopped,o=r._buffer,u=r._infiniteTimeWindow,a=r._timestampProvider,c=r._windowTime;i||(o.push(e),!u&&o.push(a.now()+c)),this._trimBuffer(),n.prototype.next.call(this,e)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var r=this._innerSubscribe(e),i=this,o=i._infiniteTimeWindow,u=i._buffer,a=u.slice(),c=0;c<a.length&&!e.closed;c+=o?1:2)e.next(a[c]);return this._checkFinalizedStatuses(e),r},t.prototype._trimBuffer=function(){var e=this,r=e._bufferSize,i=e._timestampProvider,o=e._buffer,u=e._infiniteTimeWindow,a=(u?1:2)*r;if(r<1/0&&a<o.length&&o.splice(0,o.length-a),!u){for(var c=i.now(),f=0,l=1;l<o.length&&o[l]<=c;l+=2)f=l;f&&o.splice(0,f+1)}},t})(k);function yr(n,t,e,r){e&&!x(e)&&(r=e);var i=x(e)?e:void 0;return function(o){return Cn(new Et(n,t,r),i)(o)}}function br(n){return function(t){for(var e=[],r=function(o){e.push(g(n[o]).subscribe(v(t,function(u){if(e){for(var a=0;a<e.length;a++)a!==o&&e[a].unsubscribe();e=null}t.next(u)})))},i=0;e&&!t.closed&&i<n.length;i++)r(i)}}function It(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return n.length?p(function(e,r){br(I([e],E(n)))(r)}):j}function wr(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return It.apply(void 0,I([],E(X(n))))}function gr(n){var t,e=1/0,r;return n!=null&&(typeof n=="object"?(t=n.count,e=t===void 0?1/0:t,r=n.delay):e=n),e<=0?function(){return Q}:p(function(i,o){var u=0,a,c=function(){if(a?.unsubscribe(),a=null,r!=null){var l=typeof r=="number"?Y(r):g(r(u)),s=v(o,function(){s.unsubscribe(),f()});l.subscribe(s)}else f()},f=function(){var l=!1;a=i.subscribe(v(o,void 0,function(){++u<e?a?c():l=!0:o.complete()})),l&&c()};f()})}function xr(n){return p(function(t,e){var r,i=!1,o,u=!1,a=!1,c=function(){return a&&u&&(e.complete(),!0)},f=function(){return o||(o=new k,g(n(o)).subscribe(v(e,function(){r?l():i=!0},function(){u=!0,c()}))),o},l=function(){a=!1,r=t.subscribe(v(e,void 0,function(){a=!0,!c()&&f().next()})),i&&(r.unsubscribe(),r=null,i=!1,l())};l()})}function Sr(n){n===void 0&&(n=1/0);var t;n&&typeof n=="object"?t=n:t={count:n};var e=t.count,r=e===void 0?1/0:e,i=t.delay,o=t.resetOnSuccess,u=o===void 0?!1:o;return r<=0?j:p(function(a,c){var f=0,l,s=function(){var h=!1;l=a.subscribe(v(c,function(d){u&&(f=0),c.next(d)},void 0,function(d){if(f++<r){var m=function(){l?(l.unsubscribe(),l=null,s()):h=!0};if(i!=null){var y=typeof i=="number"?Y(i):g(i(d,f)),b=v(c,function(){b.unsubscribe(),m()},function(){c.complete()});y.subscribe(b)}else m()}else c.error(d)})),h&&(l.unsubscribe(),l=null,s())};s()})}function Er(n){return p(function(t,e){var r,i=!1,o,u=function(){r=t.subscribe(v(e,void 0,void 0,function(a){o||(o=new k,g(n(o)).subscribe(v(e,function(){return r?u():i=!0}))),o&&o.next(a)})),i&&(r.unsubscribe(),r=null,i=!1,u())};u()})}function At(n){return p(function(t,e){var r=!1,i=null;t.subscribe(v(e,function(o){r=!0,i=o})),g(n).subscribe(v(e,function(){if(r){r=!1;var o=i;i=null,e.next(o)}},T))})}function Ir(n,t){return n===void 0&&(n=0),t===void 0&&(t=V),n<0&&(n=0),Y(n,n,t)}function Ar(n,t){return t===void 0&&(t=V),At(Ir(n,t))}function Tr(n,t){return p(ft(n,t,arguments.length>=2,!0))}function kr(n,t){return t===void 0&&(t=function(e,r){return e===r}),p(function(e,r){var i=Ln(),o=Ln(),u=function(c){r.next(c),r.complete()},a=function(c,f){var l=v(r,function(s){var h=f.buffer,d=f.complete;h.length===0?d?u(!1):c.buffer.push(s):!t(s,h.shift())&&u(!1)},function(){c.complete=!0;var s=f.complete,h=f.buffer;s&&u(h.length===0),l?.unsubscribe()});return l};e.subscribe(a(i,o)),g(n).subscribe(a(o,i))})}function Ln(){return{buffer:[],complete:!1}}function Tt(n){n===void 0&&(n={});var t=n.connector,e=t===void 0?function(){return new k}:t,r=n.resetOnError,i=r===void 0?!0:r,o=n.resetOnComplete,u=o===void 0?!0:o,a=n.resetOnRefCountZero,c=a===void 0?!0:a;return function(f){var l,s,h,d=0,m=!1,y=!1,b=function(){s?.unsubscribe(),s=void 0},w=function(){b(),l=h=void 0,m=y=!1},S=function(){var C=l;w(),C?.unsubscribe()};return p(function(C,U){d++,!y&&!m&&b();var F=h=h??e();U.add(function(){d--,d===0&&!y&&!m&&(s=ln(S,c))}),F.subscribe(U),!l&&d>0&&(l=new K({next:function(N){return F.next(N)},error:function(N){y=!0,b(),s=ln(w,i,N),F.error(N)},complete:function(){m=!0,b(),s=ln(w,u),F.complete()}}),g(C).subscribe(l))})(f)}}function ln(n,t){for(var e=[],r=2;r<arguments.length;r++)e[r-2]=arguments[r];if(t===!0){n();return}if(t!==!1){var i=new K({next:function(){i.unsubscribe(),n()}});return g(t.apply(void 0,I([],E(e)))).subscribe(i)}}function jr(n,t,e){var r,i,o,u,a=!1;return n&&typeof n=="object"?(r=n.bufferSize,u=r===void 0?1/0:r,i=n.windowTime,t=i===void 0?1/0:i,o=n.refCount,a=o===void 0?!1:o,e=n.scheduler):u=n??1/0,Tt({connector:function(){return new Et(u,t,e)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:a})}var Cr=z(function(n){return function(e){n(this),this.name="SequenceError",this.message=e}}),Or=z(function(n){return function(e){n(this),this.name="NotFoundError",this.message=e}});function Wr(n){return p(function(t,e){var r=!1,i,o=!1,u=0;t.subscribe(v(e,function(a){o=!0,(!n||n(a,u++,t))&&(r&&e.error(new Cr("Too many matching values")),r=!0,i=a)},function(){r?(e.next(i),e.complete()):e.error(o?new Or("No matching values"):new un)}))})}function Rr(n){return q(function(t,e){return n<=e})}function Pr(n){return n<=0?j:p(function(t,e){var r=new Array(n),i=0;return t.subscribe(v(e,function(o){var u=i++;if(u<n)r[u]=o;else{var a=u%n,c=r[a];r[a]=o,e.next(c)}})),function(){r=null}})}function Vr(n){return p(function(t,e){var r=!1,i=v(e,function(){i?.unsubscribe(),r=!0},T);g(n).subscribe(i),t.subscribe(v(e,function(o){return r&&e.next(o)}))})}function Mr(n){return p(function(t,e){var r=!1,i=0;t.subscribe(v(e,function(o){return(r||(r=!n(o,i++)))&&e.next(o)}))})}function _r(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var e=L(n);return p(function(r,i){(e?tn(n,r,e):tn(n,r)).subscribe(i)})}function B(n,t){return p(function(e,r){var i=null,o=0,u=!1,a=function(){return u&&!i&&r.complete()};e.subscribe(v(r,function(c){i?.unsubscribe();var f=0,l=o++;g(n(c,l)).subscribe(i=v(r,function(s){return r.next(t?t(c,s,l,f++):s)},function(){i=null,a()}))},function(){u=!0,a()}))})}function Ur(){return B(j)}function Lr(n,t){return x(t)?B(function(){return n},t):B(function(){return n})}function Fr(n,t){return p(function(e,r){var i=t;return B(function(o,u){return n(i,o,u)},function(o,u){return i=u,u})(e).subscribe(r),function(){i=null}})}function Nr(n){return p(function(t,e){g(n).subscribe(v(e,function(){return e.complete()},T)),!e.closed&&t.subscribe(e)})}function qr(n,t){return t===void 0&&(t=!1),p(function(e,r){var i=0;e.subscribe(v(r,function(o){var u=n(o,i++);(u||t)&&r.next(o),!u&&r.complete()}))})}function zr(n,t,e){var r=x(n)||t||e?{next:n,error:t,complete:e}:n;return r?p(function(i,o){var u;(u=r.subscribe)===null||u===void 0||u.call(r);var a=!0;i.subscribe(v(o,function(c){var f;(f=r.next)===null||f===void 0||f.call(r,c),o.next(c)},function(){var c;a=!1,(c=r.complete)===null||c===void 0||c.call(r),o.complete()},function(c){var f;a=!1,(f=r.error)===null||f===void 0||f.call(r,c),o.error(c)},function(){var c,f;a&&((c=r.unsubscribe)===null||c===void 0||c.call(r)),(f=r.finalize)===null||f===void 0||f.call(r)}))}):j}function kt(n,t){return p(function(e,r){var i=t??{},o=i.leading,u=o===void 0?!0:o,a=i.trailing,c=a===void 0?!1:a,f=!1,l=null,s=null,h=!1,d=function(){s?.unsubscribe(),s=null,c&&(b(),h&&r.complete())},m=function(){s=null,h&&r.complete()},y=function(w){return s=g(n(w)).subscribe(v(r,d,m))},b=function(){if(f){f=!1;var w=l;l=null,r.next(w),!h&&y(w)}};e.subscribe(v(r,function(w){f=!0,l=w,!(s&&!s.closed)&&(u?b():y(w))},function(){h=!0,!(c&&f&&s&&!s.closed)&&r.complete()}))})}function $r(n,t,e){t===void 0&&(t=V);var r=Y(n,t);return kt(function(){return r},e)}function Dr(n){return n===void 0&&(n=V),p(function(t,e){var r=n.now();t.subscribe(v(e,function(i){var o=n.now(),u=o-r;r=o,e.next(new Yr(i,u))}))})}var Yr=(function(){function n(t,e){this.value=t,this.interval=e}return n})(),Gr=z(function(n){return function(e){e===void 0&&(e=null),n(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=e}});function jt(n,t){var e=mn(n)?{first:n}:typeof n=="number"?{each:n}:n,r=e.first,i=e.each,o=e.with,u=o===void 0?Kr:o,a=e.scheduler,c=a===void 0?t??V:a,f=e.meta,l=f===void 0?null:f;if(r==null&&i==null)throw new TypeError("No timeout provided.");return p(function(s,h){var d,m,y=null,b=0,w=function(S){m=W(h,c,function(){try{d.unsubscribe(),g(u({meta:l,lastValue:y,seen:b})).subscribe(h)}catch(C){h.error(C)}},S)};d=s.subscribe(v(h,function(S){m?.unsubscribe(),b++,h.next(y=S),i>0&&w(i)},void 0,void 0,function(){m?.closed||m?.unsubscribe(),y=null})),!b&&w(r!=null?typeof r=="number"?r:+r-c.now():i)})}function Kr(n){throw new Gr(n)}function Zr(n,t,e){var r,i,o;if(e=e??rt,mn(n)?r=n:typeof n=="number"&&(i=n),t)o=function(){return t};else throw new TypeError("No observable provided to switch to");if(r==null&&i==null)throw new TypeError("No timeout provided.");return jt({first:r,each:i,scheduler:e,with:o})}function Br(n){return n===void 0&&(n=en),$(function(t){return{value:t,timestamp:n.now()}})}function Jr(n){return p(function(t,e){var r=new k;e.next(r.asObservable());var i=function(o){r.error(o),e.error(o)};return t.subscribe(v(e,function(o){return r?.next(o)},function(){r.complete(),e.complete()},i)),g(n).subscribe(v(e,function(){r.complete(),e.next(r=new k)},T,i)),function(){r?.unsubscribe(),r=null}})}function Xr(n,t){t===void 0&&(t=0);var e=t>0?t:n;return p(function(r,i){var o=[new k],u=[],a=0;i.next(o[0].asObservable()),r.subscribe(v(i,function(c){var f,l;try{for(var s=O(o),h=s.next();!h.done;h=s.next()){var d=h.value;d.next(c)}}catch(b){f={error:b}}finally{try{h&&!h.done&&(l=s.return)&&l.call(s)}finally{if(f)throw f.error}}var m=a-n+1;if(m>=0&&m%e===0&&o.shift().complete(),++a%e===0){var y=new k;o.push(y),i.next(y.asObservable())}},function(){for(;o.length>0;)o.shift().complete();i.complete()},function(c){for(;o.length>0;)o.shift().error(c);i.error(c)},function(){u=null,o=null}))})}function Qr(n){for(var t,e,r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];var o=(t=L(r))!==null&&t!==void 0?t:V,u=(e=r[0])!==null&&e!==void 0?e:null,a=r[1]||1/0;return p(function(c,f){var l=[],s=!1,h=function(b){var w=b.window,S=b.subs;w.complete(),S.unsubscribe(),_(l,b),s&&d()},d=function(){if(l){var b=new P;f.add(b);var w=new k,S={window:w,subs:b,seen:0};l.push(S),f.next(w.asObservable()),W(b,o,function(){return h(S)},n)}};u!==null&&u>=0?W(f,o,d,u,!0):s=!0,d();var m=function(b){return l.slice().forEach(b)},y=function(b){m(function(w){var S=w.window;return b(S)}),b(f),f.unsubscribe()};return c.subscribe(v(f,function(b){m(function(w){w.window.next(b),a<=++w.seen&&h(w)})},function(){return y(function(b){return b.complete()})},function(b){return y(function(w){return w.error(b)})})),function(){l=null}})}function Hr(n,t){return p(function(e,r){var i=[],o=function(u){for(;0<i.length;)i.shift().error(u);r.error(u)};g(n).subscribe(v(r,function(u){var a=new k;i.push(a);var c=new P,f=function(){_(i,a),a.complete(),c.unsubscribe()},l;try{l=g(t(u))}catch(s){o(s);return}r.next(a.asObservable()),c.add(l.subscribe(v(r,f,T,o)))},T)),e.subscribe(v(r,function(u){var a,c,f=i.slice();try{for(var l=O(f),s=l.next();!s.done;s=l.next()){var h=s.value;h.next(u)}}catch(d){a={error:d}}finally{try{s&&!s.done&&(c=l.return)&&c.call(l)}finally{if(a)throw a.error}}},function(){for(;0<i.length;)i.shift().complete();r.complete()},o,function(){for(;0<i.length;)i.shift().unsubscribe()}))})}function ni(n){return p(function(t,e){var r,i,o=function(a){r.error(a),e.error(a)},u=function(){i?.unsubscribe(),r?.complete(),r=new k,e.next(r.asObservable());var a;try{a=g(n())}catch(c){o(c);return}a.subscribe(i=v(e,u,u,o))};u(),t.subscribe(v(e,function(a){return r.next(a)},function(){r.complete(),e.complete()},o,function(){i?.unsubscribe(),r=null}))})}function ti(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var e=rn(n);return p(function(r,i){for(var o=n.length,u=new Array(o),a=n.map(function(){return!1}),c=!1,f=function(s){g(n[s]).subscribe(v(i,function(h){u[s]=h,!c&&!a[s]&&(a[s]=!0,(c=a.every(j))&&(a=null))},T))},l=0;l<o;l++)f(l);r.subscribe(v(i,function(s){if(c){var h=I([s],E(u));i.next(e?e.apply(void 0,I([],E(h))):h)}}))})}function Ct(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var e=rn(n),r=X(n);return r.length?new A(function(i){var o=r.map(function(){return[]}),u=r.map(function(){return!1});i.add(function(){o=u=null});for(var a=function(f){g(r[f]).subscribe(v(i,function(l){if(o[f].push(l),o.every(function(h){return h.length})){var s=o.map(function(h){return h.shift()});i.next(e?e.apply(void 0,I([],E(s))):s),o.some(function(h,d){return!h.length&&u[d]})&&i.complete()}},function(){u[f]=!0,!o[f].length&&i.complete()}))},c=0;!i.closed&&c<r.length;c++)a(c);return function(){o=u=null}}):Q}function Ot(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return p(function(e,r){Ct.apply(void 0,I([e],E(n))).subscribe(r)})}function ei(n){return lt(Ct,n)}function ri(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return Ot.apply(void 0,I([],E(n)))}exports.audit=et;exports.auditTime=Qt;exports.buffer=Ht;exports.bufferCount=ne;exports.bufferTime=ee;exports.bufferToggle=re;exports.bufferWhen=ie;exports.catchError=ot;exports.combineAll=Se;exports.combineLatest=Sn;exports.combineLatestAll=st;exports.combineLatestWith=Ie;exports.concat=vt;exports.concatAll=In;exports.concatMap=vn;exports.concatMapTo=Ae;exports.concatWith=Te;exports.connect=An;exports.count=Oe;exports.debounce=We;exports.debounceTime=Re;exports.defaultIfEmpty=on;exports.delay=Pe;exports.delayWhen=Tn;exports.dematerialize=Me;exports.distinct=_e;exports.distinctUntilChanged=yt;exports.distinctUntilKeyChanged=Le;exports.elementAt=Ne;exports.endWith=qe;exports.every=ze;exports.exhaust=$e;exports.exhaustAll=bt;exports.exhaustMap=kn;exports.expand=De;exports.filter=q;exports.finalize=Ye;exports.find=Ge;exports.findIndex=Ke;exports.first=Ze;exports.flatMap=nr;exports.groupBy=Be;exports.ignoreElements=ht;exports.isEmpty=Je;exports.last=Xe;exports.map=$;exports.mapTo=dt;exports.materialize=Qe;exports.max=He;exports.merge=xt;exports.mergeAll=En;exports.mergeMap=M;exports.mergeMapTo=tr;exports.mergeScan=er;exports.mergeWith=rr;exports.min=ir;exports.multicast=Cn;exports.observeOn=bn;exports.onErrorResumeNext=ar;exports.pairwise=fr;exports.partition=lr;exports.pluck=sr;exports.publish=vr;exports.publishBehavior=dr;exports.publishLast=mr;exports.publishReplay=yr;exports.race=wr;exports.raceWith=It;exports.reduce=J;exports.refCount=St;exports.repeat=gr;exports.repeatWhen=xr;exports.retry=Sr;exports.retryWhen=Er;exports.sample=At;exports.sampleTime=Ar;exports.scan=Tr;exports.sequenceEqual=kr;exports.share=Tt;exports.shareReplay=jr;exports.single=Wr;exports.skip=Rr;exports.skipLast=Pr;exports.skipUntil=Vr;exports.skipWhile=Mr;exports.startWith=_r;exports.subscribeOn=wn;exports.switchAll=Ur;exports.switchMap=B;exports.switchMapTo=Lr;exports.switchScan=Fr;exports.take=Z;exports.takeLast=gt;exports.takeUntil=Nr;exports.takeWhile=qr;exports.tap=zr;exports.throttle=kt;exports.throttleTime=$r;exports.throwIfEmpty=an;exports.timeInterval=Dr;exports.timeout=jt;exports.timeoutWith=Zr;exports.timestamp=Br;exports.toArray=ct;exports.window=Jr;exports.windowCount=Xr;exports.windowTime=Qr;exports.windowToggle=Hr;exports.windowWhen=ni;exports.withLatestFrom=ti;exports.zip=Ot;exports.zipAll=ei;exports.zipWith=ri;
|