@vkontakte/videoplayer-shared 1.0.10 → 1.0.11

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/es2015.cjs.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
- * @vkontakte/videoplayer-shared v1.0.10
3
- * Tue, 22 Mar 2022 14:33:08 GMT
4
- * https://st.mycdn.me/static/playersdk/1-0-10/doc/
2
+ * @vkontakte/videoplayer-shared v1.0.11
3
+ * Wed, 06 Apr 2022 13:48:43 GMT
4
+ * https://st.mycdn.me/static/playersdk/1-0-11/doc/
5
5
  */
6
- 'use strict';Object.defineProperty(exports,'__esModule',{value:!0});class t{constructor(){this.subscriptions=[]}unsubscribe(){const t=this.subscriptions;this.subscriptions=[],t.forEach((t=>'function'==typeof t?t():t.unsubscribe()))}add(t){return this.subscriptions.push(t),this}}const e=t=>{throw new Error(`${t} is value of unexpected type`)},r=()=>{};class s{constructor(t){t&&(this._subscribe=t)}subscribe(s,n){let i;i=n?'function'==typeof n?{next:n,error:r}:{next:t=>n.next(t),error:t=>{var e;return null===(e=n.error)||void 0===e?void 0:e.call(n,t)}}:{next:r,error:r};const o='function'==typeof s?{next:t=>{try{s(t)}catch(t){i.next(t)}},error:t=>i.next(t)}:{next:t=>s.next(t),error:t=>s.error?s.error(t):i.next(t)},c=this._subscribe(o);return(new t).add((()=>{switch(o.next=r,o.error=r,typeof c){case'function':return void c();case'object':return void c.unsubscribe();case'undefined':return;default:return e(c)}}))}pipe(...t){return t.reduce(((t,e)=>e(t)),this)}_subscribe(t){}}class n extends s{constructor(){super(),this.keyCounter=0,this.subscribers=new Map}next(t){this.subscribers.forEach((e=>e.next(t)))}error(t){this.subscribers.forEach((e=>{var r;return null===(r=e.error)||void 0===r?void 0:r.call(e,t)}))}_subscribe(e){const r=this.keyCounter++;return this.subscribers.set(r,e),(new t).add((()=>this.subscribers.delete(r)))}}function i(t){return null!=t}function o(t){return null==t}var c;const u='function'==typeof(null===(c=window.performance)||void 0===c?void 0:c.now)?()=>window.performance.now():()=>Date.now();const a={leading:!1,trailing:!0};class l{constructor(t,e,r){this.destination=t,this.time=e,this.config=r}next(t){this.lastValue=t,i(this.timeout)?window.clearTimeout(this.timeout):this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout((()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0}),this.time)}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}const h={leading:!0,trailing:!1};class d{constructor(t,e,r){this.destination=t,this.time=e,this.config=r}next(t){this.lastValue=t,o(this.timeout)&&(this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout((()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0}),this.time))}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}class b{constructor(t,e){this.destination=t,this.predicate=e}next(t){let e;try{e=this.predicate(t)}catch(t){throw this.error(t),t}e&&this.destination.next(t)}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}const p={};class x{constructor(t,e){this.destination=t,this.predicate=e,this.lastValue=p}next(t){let e;try{e=this.lastValue===p||!this.predicate(this.lastValue,t),this.lastValue=t}catch(t){throw this.error(t),t}e&&this.destination.next(t)}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}function w(t){return e=>new s((r=>e.subscribe(new v(r,t))))}class v{constructor(t,e){this.destination=t,this.mapper=e}next(t){let e;try{e=this.mapper(t)}catch(t){throw this.error(t),t}this.destination.next(e)}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}class f{constructor(t){this.destination=t,this.hasLast=!1}next(t){const e=this.last;this.last=t,this.hasLast?this.destination.next([e,t]):this.hasLast=!0}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}class m{constructor(t,e){this.destination=t,this.effect=e}next(t){try{this.effect(t)}catch(t){throw this.error(t),t}this.destination.next(t)}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}exports.Logger=class{constructor(){this.log$=new n,this.logs=[],this.log=t=>{const e=Object.assign(Object.assign({},t),{timestamp:Date.now()});this.logs.push(e),this.log$.next(e)},this.getAllLogs=()=>this.logs}createCustomLog(t){return(...e)=>{let r;try{r=t(...e)}catch(t){r={message:'error in `createCustomLog`',component:'Logger'}}this.log(r)}}createComponentLog(t){return this.createCustomLog((e=>Object.assign({component:t},e)))}},exports.Observable=s,exports.Subject=n,exports.Subscription=t,exports.ValueSubject=class extends n{constructor(t){super(),this.value=t}next(t){super.next(this.value=t)}error(t){super.error(this.value=t)}getValue(){return this.value}_subscribe(t){const e=super._subscribe(t);return t.next(this.value),e}},exports.addScript=(t,e,r)=>new Promise(((s,n)=>{e.addEventListener('abort',(()=>{c(),a.remove()}));const i=()=>{c(),n()},o=()=>{c(),s()},c=()=>{u&&clearTimeout(u),a.removeEventListener('load',o),a.removeEventListener('error',i)};let u;r&&(u=window.setTimeout(i,r));const a=document.createElement('script');a.addEventListener('load',o),a.addEventListener('error',i),a.src=t,document.head.appendChild(a)})),exports.assertNever=e,exports.assertNonNullable=function(t,e='Assertion "value is not nullable" failed'){if(null==t)throw new Error(e)},exports.assertNullable=function(t,e='Assertion "value is nullable" failed'){if(null!=t)throw new Error(e)},exports.checkNever=t=>{},exports.combine=function(e){return new s((r=>{const s={};let n=Object.keys(e).length;return Object.entries(e).reduce(((t,[e,i])=>t.add(i.subscribe((t=>e=>{t in s||n--,s[t]=e,0===n&&r.next(s)})(e)))),new t)}))},exports.debounce=function(t,e=a){return r=>new s((s=>r.subscribe(new l(s,t,e))))},exports.filter=function(t){return e=>new s((r=>e.subscribe(new b(r,t))))},exports.filterChanged=function(t=((t,e)=>t===e)){return e=>new s((r=>e.subscribe(new x(r,t))))},exports.fromEvent=(t,e)=>new s((r=>{const s=t=>r.next(t);return t.addEventListener(e,s),()=>t.removeEventListener(e,s)})),exports.isNonNullable=i,exports.isNullable=o,exports.map=w,exports.mapTo=function(t){return w((()=>t))},exports.merge=function(...e){return new s((r=>e.reduce(((t,e)=>t.add(e.subscribe(r))),new t)))},exports.noop=r,exports.now=u,exports.observableFrom=t=>new s((e=>{t.forEach((t=>e.next(t)))})),exports.once=function(){return t=>new s((e=>{let r=!1,s=!1;const n=t.subscribe((t=>{r||(r=!0,e.next(t)),s&&n.unsubscribe()}),(t=>{var i;r=!0,null===(i=e.error)||void 0===i||i.call(e,t),s&&n.unsubscribe()}));return s=!0,r&&n.unsubscribe(),n}))},exports.pairwise=function(){return t=>new s((e=>t.subscribe(new f(e))))},exports.tap=function(t){return e=>new s((r=>e.subscribe(new m(r,t))))},exports.throttle=function(t,e=h){return r=>new s((s=>r.subscribe(new d(s,t,e))))},exports.timeout=t=>new s((e=>{const r=window.setTimeout((()=>e.next()),t);return()=>window.clearTimeout(r)}));
6
+ 'use strict';Object.defineProperty(exports,'__esModule',{value:!0});class t{constructor(){this.subscriptions=[]}unsubscribe(){const t=this.subscriptions;this.subscriptions=[],t.forEach((t=>'function'==typeof t?t():t.unsubscribe()))}add(t){return this.subscriptions.push(t),this}}const e=t=>{throw new Error(`${t} is value of unexpected type`)},r=()=>{};class s{constructor(t){t&&(this._subscribe=t)}subscribe(s,n){let i;i=n?'function'==typeof n?{next:n,error:r}:{next:t=>n.next(t),error:t=>{var e;return null===(e=n.error)||void 0===e?void 0:e.call(n,t)}}:{next:r,error:r};const o='function'==typeof s?{next:t=>{try{s(t)}catch(t){i.next(t)}},error:t=>i.next(t)}:{next:t=>s.next(t),error:t=>s.error?s.error(t):i.next(t)},c=this._subscribe(o);return(new t).add((()=>{switch(o.next=r,o.error=r,typeof c){case'function':return void c();case'object':return void c.unsubscribe();case'undefined':return;default:return e(c)}}))}pipe(...t){return t.reduce(((t,e)=>e(t)),this)}_subscribe(t){}}class n extends s{constructor(){super(),this.keyCounter=0,this.subscribers=new Map}next(t){this.subscribers.forEach((e=>e.next(t)))}error(t){this.subscribers.forEach((e=>{var r;return null===(r=e.error)||void 0===r?void 0:r.call(e,t)}))}_subscribe(e){const r=this.keyCounter++;return this.subscribers.set(r,e),(new t).add((()=>this.subscribers.delete(r)))}}function i(t){return null!=t}function o(t){return null==t}var c;const u='function'==typeof(null===(c=window.performance)||void 0===c?void 0:c.now)?()=>window.performance.now():()=>Date.now();const a={leading:!1,trailing:!0};class l{constructor(t,e,r){this.destination=t,this.time=e,this.config=r}next(t){this.lastValue=t,i(this.timeout)?window.clearTimeout(this.timeout):this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout((()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0}),this.time)}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}const h={leading:!0,trailing:!1};class d{constructor(t,e,r){this.destination=t,this.time=e,this.config=r}next(t){this.lastValue=t,o(this.timeout)&&(this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout((()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0}),this.time))}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}class b{constructor(t,e){this.destination=t,this.predicate=e}next(t){let e;try{e=this.predicate(t)}catch(t){throw this.error(t),t}e&&this.destination.next(t)}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}const p={};class x{constructor(t,e){this.destination=t,this.predicate=e,this.lastValue=p}next(t){let e;try{e=this.lastValue===p||!this.predicate(this.lastValue,t),this.lastValue=t}catch(t){throw this.error(t),t}e&&this.destination.next(t)}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}function w(t){return e=>new s((r=>e.subscribe(new v(r,t))))}class v{constructor(t,e){this.destination=t,this.mapper=e}next(t){let e;try{e=this.mapper(t)}catch(t){throw this.error(t),t}this.destination.next(e)}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}class f{constructor(t){this.destination=t,this.hasLast=!1}next(t){const e=this.last;this.last=t,this.hasLast?this.destination.next([e,t]):this.hasLast=!0}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}class m{constructor(t,e){this.destination=t,this.effect=e}next(t){try{this.effect(t)}catch(t){throw this.error(t),t}this.destination.next(t)}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}exports.Logger=class{constructor(){this.log$=new n,this.logs=[],this.log=t=>{const e=Object.assign(Object.assign({},t),{timestamp:Date.now()});this.logs.push(e),this.log$.next(e)},this.getAllLogs=()=>this.logs}createCustomLog(t){return(...e)=>{let r;try{r=t(...e)}catch(t){r={message:'error in `createCustomLog`',component:'Logger'}}this.log(r)}}createComponentLog(t){return this.createCustomLog((e=>Object.assign({component:t},e)))}},exports.Observable=s,exports.Subject=n,exports.Subscription=t,exports.ValueSubject=class extends n{constructor(t){super(),this.value=t}next(t){super.next(this.value=t)}error(t){super.error(this.value=t)}getValue(){return this.value}_subscribe(t){const e=super._subscribe(t);return t.next(this.value),e}},exports.addScript=(t,e,r)=>new Promise(((s,n)=>{e.addEventListener('abort',(()=>{c(),a.remove()}));const i=()=>{c(),n()},o=()=>{c(),s()},c=()=>{u&&clearTimeout(u),a.removeEventListener('load',o),a.removeEventListener('error',i)};let u;r&&(u=window.setTimeout(i,r));const a=document.createElement('script');a.addEventListener('load',o),a.addEventListener('error',i),a.src=t,document.head.appendChild(a)})),exports.assertNever=e,exports.assertNonNullable=function(t,e='Assertion "value is not nullable" failed'){if(null==t)throw new Error(e)},exports.assertNullable=function(t,e='Assertion "value is nullable" failed'){if(null!=t)throw new Error(e)},exports.checkNever=t=>{},exports.combine=function(e){return new s((r=>{const s={};let n=Object.keys(e).length;return Object.entries(e).reduce(((t,[e,i])=>t.add(i.subscribe((t=>e=>{t in s||n--,s[t]=e,0===n&&r.next(s)})(e)))),new t)}))},exports.debounce=function(t,e=a){return r=>new s((s=>r.subscribe(new l(s,t,e))))},exports.filter=function(t){return e=>new s((r=>e.subscribe(new b(r,t))))},exports.filterChanged=function(t=((t,e)=>t===e)){return e=>new s((r=>e.subscribe(new x(r,t))))},exports.fromEvent=(t,e)=>new s((r=>{const s=t=>r.next(t);return t.addEventListener(e,s),()=>t.removeEventListener(e,s)})),exports.interval=t=>new s((e=>{const r=window.setInterval((()=>e.next()),t);return()=>window.clearInterval(r)})),exports.isNonNullable=i,exports.isNullable=o,exports.map=w,exports.mapTo=function(t){return w((()=>t))},exports.merge=function(...e){return new s((r=>e.reduce(((t,e)=>t.add(e.subscribe(r))),new t)))},exports.noop=r,exports.now=u,exports.observableFrom=t=>new s((e=>{t.forEach((t=>e.next(t)))})),exports.once=function(){return t=>new s((e=>{let r=!1,s=!1;const n=t.subscribe((t=>{r||(r=!0,e.next(t)),s&&n.unsubscribe()}),(t=>{var i;r=!0,null===(i=e.error)||void 0===i||i.call(e,t),s&&n.unsubscribe()}));return s=!0,r&&n.unsubscribe(),n}))},exports.pairwise=function(){return t=>new s((e=>t.subscribe(new f(e))))},exports.tap=function(t){return e=>new s((r=>e.subscribe(new m(r,t))))},exports.throttle=function(t,e=h){return r=>new s((s=>r.subscribe(new d(s,t,e))))},exports.timeout=t=>new s((e=>{const r=window.setTimeout((()=>e.next()),t);return()=>window.clearTimeout(r)}));
package/es2015.esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
- * @vkontakte/videoplayer-shared v1.0.10
3
- * Tue, 22 Mar 2022 14:33:08 GMT
4
- * https://st.mycdn.me/static/playersdk/1-0-10/doc/
2
+ * @vkontakte/videoplayer-shared v1.0.11
3
+ * Wed, 06 Apr 2022 13:48:43 GMT
4
+ * https://st.mycdn.me/static/playersdk/1-0-11/doc/
5
5
  */
6
- class t{constructor(){this.subscriptions=[]}unsubscribe(){const t=this.subscriptions;this.subscriptions=[],t.forEach((t=>'function'==typeof t?t():t.unsubscribe()))}add(t){return this.subscriptions.push(t),this}}const e=t=>{throw new Error(`${t} is value of unexpected type`)},r=t=>{},s=()=>{};class n{constructor(t){t&&(this._subscribe=t)}subscribe(r,n){let i;i=n?'function'==typeof n?{next:n,error:s}:{next:t=>n.next(t),error:t=>{var e;return null===(e=n.error)||void 0===e?void 0:e.call(n,t)}}:{next:s,error:s};const o='function'==typeof r?{next:t=>{try{r(t)}catch(t){i.next(t)}},error:t=>i.next(t)}:{next:t=>r.next(t),error:t=>r.error?r.error(t):i.next(t)},c=this._subscribe(o);return(new t).add((()=>{switch(o.next=s,o.error=s,typeof c){case'function':return void c();case'object':return void c.unsubscribe();case'undefined':return;default:return e(c)}}))}pipe(...t){return t.reduce(((t,e)=>e(t)),this)}_subscribe(t){}}class i extends n{constructor(){super(),this.keyCounter=0,this.subscribers=new Map}next(t){this.subscribers.forEach((e=>e.next(t)))}error(t){this.subscribers.forEach((e=>{var r;return null===(r=e.error)||void 0===r?void 0:r.call(e,t)}))}_subscribe(e){const r=this.keyCounter++;return this.subscribers.set(r,e),(new t).add((()=>this.subscribers.delete(r)))}}class o{constructor(){this.log$=new i,this.logs=[],this.log=t=>{const e=Object.assign(Object.assign({},t),{timestamp:Date.now()});this.logs.push(e),this.log$.next(e)},this.getAllLogs=()=>this.logs}createCustomLog(t){return(...e)=>{let r;try{r=t(...e)}catch(t){r={message:'error in `createCustomLog`',component:'Logger'}}this.log(r)}}createComponentLog(t){return this.createCustomLog((e=>Object.assign({component:t},e)))}}function c(t,e='Assertion "value is not nullable" failed'){if(null==t)throw new Error(e)}function u(t,e='Assertion "value is nullable" failed'){if(null!=t)throw new Error(e)}function a(t){return null!=t}function l(t){return null==t}const h=(t,e,r)=>new Promise(((s,n)=>{e.addEventListener('abort',(()=>{c(),a.remove()}));const i=()=>{c(),n()},o=()=>{c(),s()},c=()=>{u&&clearTimeout(u),a.removeEventListener('load',o),a.removeEventListener('error',i)};let u;r&&(u=window.setTimeout(i,r));const a=document.createElement('script');a.addEventListener('load',o),a.addEventListener('error',i),a.src=t,document.head.appendChild(a)}));var d;const b='function'==typeof(null===(d=window.performance)||void 0===d?void 0:d.now)?()=>window.performance.now():()=>Date.now();class w extends i{constructor(t){super(),this.value=t}next(t){super.next(this.value=t)}error(t){super.error(this.value=t)}getValue(){return this.value}_subscribe(t){const e=super._subscribe(t);return t.next(this.value),e}}function v(e){return new n((r=>{const s={};let n=Object.keys(e).length;return Object.entries(e).reduce(((t,[e,i])=>t.add(i.subscribe((t=>e=>{t in s||n--,s[t]=e,0===n&&r.next(s)})(e)))),new t)}))}function f(...e){return new n((r=>e.reduce(((t,e)=>t.add(e.subscribe(r))),new t)))}var x=t=>new n((e=>{const r=window.setTimeout((()=>e.next()),t);return()=>window.clearTimeout(r)})),m=t=>new n((e=>{t.forEach((t=>e.next(t)))})),p=(t,e)=>new n((r=>{const s=t=>r.next(t);return t.addEventListener(e,s),()=>t.removeEventListener(e,s)}));const g={leading:!1,trailing:!0};function L(t,e=g){return r=>new n((s=>r.subscribe(new y(s,t,e))))}class y{constructor(t,e,r){this.destination=t,this.time=e,this.config=r}next(t){this.lastValue=t,a(this.timeout)?window.clearTimeout(this.timeout):this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout((()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0}),this.time)}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}const E={leading:!0,trailing:!1};function V(t,e=E){return r=>new n((s=>r.subscribe(new C(s,t,e))))}class C{constructor(t,e,r){this.destination=t,this.time=e,this.config=r}next(t){this.lastValue=t,l(this.timeout)&&(this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout((()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0}),this.time))}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}function T(t){return e=>new n((r=>e.subscribe(new j(r,t))))}class j{constructor(t,e){this.destination=t,this.predicate=e}next(t){let e;try{e=this.predicate(t)}catch(t){throw this.error(t),t}e&&this.destination.next(t)}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}function _(t=((t,e)=>t===e)){return e=>new n((r=>e.subscribe(new k(r,t))))}const O={};class k{constructor(t,e){this.destination=t,this.predicate=e,this.lastValue=O}next(t){let e;try{e=this.lastValue===O||!this.predicate(this.lastValue,t),this.lastValue=t}catch(t){throw this.error(t),t}e&&this.destination.next(t)}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}function A(t){return e=>new n((r=>e.subscribe(new $(r,t))))}class ${constructor(t,e){this.destination=t,this.mapper=e}next(t){let e;try{e=this.mapper(t)}catch(t){throw this.error(t),t}this.destination.next(e)}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}function D(t){return A((()=>t))}function M(){return t=>new n((e=>{let r=!1,s=!1;const n=t.subscribe((t=>{r||(r=!0,e.next(t)),s&&n.unsubscribe()}),(t=>{var i;r=!0,null===(i=e.error)||void 0===i||i.call(e,t),s&&n.unsubscribe()}));return s=!0,r&&n.unsubscribe(),n}))}function P(){return t=>new n((e=>t.subscribe(new q(e))))}class q{constructor(t){this.destination=t,this.hasLast=!1}next(t){const e=this.last;this.last=t,this.hasLast?this.destination.next([e,t]):this.hasLast=!0}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}function z(t){return e=>new n((r=>e.subscribe(new B(r,t))))}class B{constructor(t,e){this.destination=t,this.effect=e}next(t){try{this.effect(t)}catch(t){throw this.error(t),t}this.destination.next(t)}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}export{o as Logger,n as Observable,i as Subject,t as Subscription,w as ValueSubject,h as addScript,e as assertNever,c as assertNonNullable,u as assertNullable,r as checkNever,v as combine,L as debounce,T as filter,_ as filterChanged,p as fromEvent,a as isNonNullable,l as isNullable,A as map,D as mapTo,f as merge,s as noop,b as now,m as observableFrom,M as once,P as pairwise,z as tap,V as throttle,x as timeout};
6
+ class t{constructor(){this.subscriptions=[]}unsubscribe(){const t=this.subscriptions;this.subscriptions=[],t.forEach((t=>'function'==typeof t?t():t.unsubscribe()))}add(t){return this.subscriptions.push(t),this}}const e=t=>{throw new Error(`${t} is value of unexpected type`)},r=t=>{},n=()=>{};class s{constructor(t){t&&(this._subscribe=t)}subscribe(r,s){let i;i=s?'function'==typeof s?{next:s,error:n}:{next:t=>s.next(t),error:t=>{var e;return null===(e=s.error)||void 0===e?void 0:e.call(s,t)}}:{next:n,error:n};const o='function'==typeof r?{next:t=>{try{r(t)}catch(t){i.next(t)}},error:t=>i.next(t)}:{next:t=>r.next(t),error:t=>r.error?r.error(t):i.next(t)},c=this._subscribe(o);return(new t).add((()=>{switch(o.next=n,o.error=n,typeof c){case'function':return void c();case'object':return void c.unsubscribe();case'undefined':return;default:return e(c)}}))}pipe(...t){return t.reduce(((t,e)=>e(t)),this)}_subscribe(t){}}class i extends s{constructor(){super(),this.keyCounter=0,this.subscribers=new Map}next(t){this.subscribers.forEach((e=>e.next(t)))}error(t){this.subscribers.forEach((e=>{var r;return null===(r=e.error)||void 0===r?void 0:r.call(e,t)}))}_subscribe(e){const r=this.keyCounter++;return this.subscribers.set(r,e),(new t).add((()=>this.subscribers.delete(r)))}}class o{constructor(){this.log$=new i,this.logs=[],this.log=t=>{const e=Object.assign(Object.assign({},t),{timestamp:Date.now()});this.logs.push(e),this.log$.next(e)},this.getAllLogs=()=>this.logs}createCustomLog(t){return(...e)=>{let r;try{r=t(...e)}catch(t){r={message:'error in `createCustomLog`',component:'Logger'}}this.log(r)}}createComponentLog(t){return this.createCustomLog((e=>Object.assign({component:t},e)))}}function c(t,e='Assertion "value is not nullable" failed'){if(null==t)throw new Error(e)}function u(t,e='Assertion "value is nullable" failed'){if(null!=t)throw new Error(e)}function a(t){return null!=t}function l(t){return null==t}const h=(t,e,r)=>new Promise(((n,s)=>{e.addEventListener('abort',(()=>{c(),a.remove()}));const i=()=>{c(),s()},o=()=>{c(),n()},c=()=>{u&&clearTimeout(u),a.removeEventListener('load',o),a.removeEventListener('error',i)};let u;r&&(u=window.setTimeout(i,r));const a=document.createElement('script');a.addEventListener('load',o),a.addEventListener('error',i),a.src=t,document.head.appendChild(a)}));var d;const b='function'==typeof(null===(d=window.performance)||void 0===d?void 0:d.now)?()=>window.performance.now():()=>Date.now();class w extends i{constructor(t){super(),this.value=t}next(t){super.next(this.value=t)}error(t){super.error(this.value=t)}getValue(){return this.value}_subscribe(t){const e=super._subscribe(t);return t.next(this.value),e}}function v(e){return new s((r=>{const n={};let s=Object.keys(e).length;return Object.entries(e).reduce(((t,[e,i])=>t.add(i.subscribe((t=>e=>{t in n||s--,n[t]=e,0===s&&r.next(n)})(e)))),new t)}))}function f(...e){return new s((r=>e.reduce(((t,e)=>t.add(e.subscribe(r))),new t)))}var x=t=>new s((e=>{const r=window.setTimeout((()=>e.next()),t);return()=>window.clearTimeout(r)})),m=t=>new s((e=>{const r=window.setInterval((()=>e.next()),t);return()=>window.clearInterval(r)})),p=t=>new s((e=>{t.forEach((t=>e.next(t)))})),g=(t,e)=>new s((r=>{const n=t=>r.next(t);return t.addEventListener(e,n),()=>t.removeEventListener(e,n)}));const L={leading:!1,trailing:!0};function y(t,e=L){return r=>new s((n=>r.subscribe(new E(n,t,e))))}class E{constructor(t,e,r){this.destination=t,this.time=e,this.config=r}next(t){this.lastValue=t,a(this.timeout)?window.clearTimeout(this.timeout):this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout((()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0}),this.time)}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}const V={leading:!0,trailing:!1};function C(t,e=V){return r=>new s((n=>r.subscribe(new T(n,t,e))))}class T{constructor(t,e,r){this.destination=t,this.time=e,this.config=r}next(t){this.lastValue=t,l(this.timeout)&&(this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout((()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0}),this.time))}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}function j(t){return e=>new s((r=>e.subscribe(new _(r,t))))}class _{constructor(t,e){this.destination=t,this.predicate=e}next(t){let e;try{e=this.predicate(t)}catch(t){throw this.error(t),t}e&&this.destination.next(t)}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}function O(t=((t,e)=>t===e)){return e=>new s((r=>e.subscribe(new A(r,t))))}const k={};class A{constructor(t,e){this.destination=t,this.predicate=e,this.lastValue=k}next(t){let e;try{e=this.lastValue===k||!this.predicate(this.lastValue,t),this.lastValue=t}catch(t){throw this.error(t),t}e&&this.destination.next(t)}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}function $(t){return e=>new s((r=>e.subscribe(new D(r,t))))}class D{constructor(t,e){this.destination=t,this.mapper=e}next(t){let e;try{e=this.mapper(t)}catch(t){throw this.error(t),t}this.destination.next(e)}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}function I(t){return $((()=>t))}function M(){return t=>new s((e=>{let r=!1,n=!1;const s=t.subscribe((t=>{r||(r=!0,e.next(t)),n&&s.unsubscribe()}),(t=>{var i;r=!0,null===(i=e.error)||void 0===i||i.call(e,t),n&&s.unsubscribe()}));return n=!0,r&&s.unsubscribe(),s}))}function P(){return t=>new s((e=>t.subscribe(new q(e))))}class q{constructor(t){this.destination=t,this.hasLast=!1}next(t){const e=this.last;this.last=t,this.hasLast?this.destination.next([e,t]):this.hasLast=!0}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}function z(t){return e=>new s((r=>e.subscribe(new B(r,t))))}class B{constructor(t,e){this.destination=t,this.effect=e}next(t){try{this.effect(t)}catch(t){throw this.error(t),t}this.destination.next(t)}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}export{o as Logger,s as Observable,i as Subject,t as Subscription,w as ValueSubject,h as addScript,e as assertNever,c as assertNonNullable,u as assertNullable,r as checkNever,v as combine,y as debounce,j as filter,O as filterChanged,g as fromEvent,m as interval,a as isNonNullable,l as isNullable,$ as map,I as mapTo,f as merge,n as noop,b as now,p as observableFrom,M as once,P as pairwise,z as tap,C as throttle,x as timeout};
package/es2018.cjs.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
- * @vkontakte/videoplayer-shared v1.0.10
3
- * Tue, 22 Mar 2022 14:33:08 GMT
4
- * https://st.mycdn.me/static/playersdk/1-0-10/doc/
2
+ * @vkontakte/videoplayer-shared v1.0.11
3
+ * Wed, 06 Apr 2022 13:48:43 GMT
4
+ * https://st.mycdn.me/static/playersdk/1-0-11/doc/
5
5
  */
6
- 'use strict';Object.defineProperty(exports,'__esModule',{value:!0});class t{constructor(){this.subscriptions=[]}unsubscribe(){const t=this.subscriptions;this.subscriptions=[],t.forEach((t=>'function'==typeof t?t():t.unsubscribe()))}add(t){return this.subscriptions.push(t),this}}const e=t=>{throw new Error(`${t} is value of unexpected type`)},r=()=>{};class s{constructor(t){t&&(this._subscribe=t)}subscribe(s,n){let i;i=n?'function'==typeof n?{next:n,error:r}:{next:t=>n.next(t),error:t=>{var e;return null===(e=n.error)||void 0===e?void 0:e.call(n,t)}}:{next:r,error:r};const o='function'==typeof s?{next:t=>{try{s(t)}catch(t){i.next(t)}},error:t=>i.next(t)}:{next:t=>s.next(t),error:t=>s.error?s.error(t):i.next(t)},u=this._subscribe(o);return(new t).add((()=>{switch(o.next=r,o.error=r,typeof u){case'function':return void u();case'object':return void u.unsubscribe();case'undefined':return;default:return e(u)}}))}pipe(...t){return t.reduce(((t,e)=>e(t)),this)}_subscribe(t){}}class n extends s{constructor(){super(),this.keyCounter=0,this.subscribers=new Map}next(t){this.subscribers.forEach((e=>e.next(t)))}error(t){this.subscribers.forEach((e=>{var r;return null===(r=e.error)||void 0===r?void 0:r.call(e,t)}))}_subscribe(e){const r=this.keyCounter++;return this.subscribers.set(r,e),(new t).add((()=>this.subscribers.delete(r)))}}function i(t){return null!=t}function o(t){return null==t}var u;const c='function'==typeof(null===(u=window.performance)||void 0===u?void 0:u.now)?()=>window.performance.now():()=>Date.now();const a={leading:!1,trailing:!0};class l{constructor(t,e,r){this.destination=t,this.time=e,this.config=r}next(t){this.lastValue=t,i(this.timeout)?window.clearTimeout(this.timeout):this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout((()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0}),this.time)}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}const h={leading:!0,trailing:!1};class d{constructor(t,e,r){this.destination=t,this.time=e,this.config=r}next(t){this.lastValue=t,o(this.timeout)&&(this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout((()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0}),this.time))}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}class b{constructor(t,e){this.destination=t,this.predicate=e}next(t){let e;try{e=this.predicate(t)}catch(t){throw this.error(t),t}e&&this.destination.next(t)}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}const p={};class x{constructor(t,e){this.destination=t,this.predicate=e,this.lastValue=p}next(t){let e;try{e=this.lastValue===p||!this.predicate(this.lastValue,t),this.lastValue=t}catch(t){throw this.error(t),t}e&&this.destination.next(t)}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}function w(t){return e=>new s((r=>e.subscribe(new v(r,t))))}class v{constructor(t,e){this.destination=t,this.mapper=e}next(t){let e;try{e=this.mapper(t)}catch(t){throw this.error(t),t}this.destination.next(e)}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}class f{constructor(t){this.destination=t,this.hasLast=!1}next(t){const e=this.last;this.last=t,this.hasLast?this.destination.next([e,t]):this.hasLast=!0}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}class m{constructor(t,e){this.destination=t,this.effect=e}next(t){try{this.effect(t)}catch(t){throw this.error(t),t}this.destination.next(t)}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}exports.Logger=class{constructor(){this.log$=new n,this.logs=[],this.log=t=>{const e={...t,timestamp:Date.now()};this.logs.push(e),this.log$.next(e)},this.getAllLogs=()=>this.logs}createCustomLog(t){return(...e)=>{let r;try{r=t(...e)}catch(t){r={message:'error in `createCustomLog`',component:'Logger'}}this.log(r)}}createComponentLog(t){return this.createCustomLog((e=>({component:t,...e})))}},exports.Observable=s,exports.Subject=n,exports.Subscription=t,exports.ValueSubject=class extends n{constructor(t){super(),this.value=t}next(t){super.next(this.value=t)}error(t){super.error(this.value=t)}getValue(){return this.value}_subscribe(t){const e=super._subscribe(t);return t.next(this.value),e}},exports.addScript=(t,e,r)=>new Promise(((s,n)=>{e.addEventListener('abort',(()=>{u(),a.remove()}));const i=()=>{u(),n()},o=()=>{u(),s()},u=()=>{c&&clearTimeout(c),a.removeEventListener('load',o),a.removeEventListener('error',i)};let c;r&&(c=window.setTimeout(i,r));const a=document.createElement('script');a.addEventListener('load',o),a.addEventListener('error',i),a.src=t,document.head.appendChild(a)})),exports.assertNever=e,exports.assertNonNullable=function(t,e='Assertion "value is not nullable" failed'){if(null==t)throw new Error(e)},exports.assertNullable=function(t,e='Assertion "value is nullable" failed'){if(null!=t)throw new Error(e)},exports.checkNever=t=>{},exports.combine=function(e){return new s((r=>{const s={};let n=Object.keys(e).length;return Object.entries(e).reduce(((t,[e,i])=>t.add(i.subscribe((t=>e=>{t in s||n--,s[t]=e,0===n&&r.next(s)})(e)))),new t)}))},exports.debounce=function(t,e=a){return r=>new s((s=>r.subscribe(new l(s,t,e))))},exports.filter=function(t){return e=>new s((r=>e.subscribe(new b(r,t))))},exports.filterChanged=function(t=((t,e)=>t===e)){return e=>new s((r=>e.subscribe(new x(r,t))))},exports.fromEvent=(t,e)=>new s((r=>{const s=t=>r.next(t);return t.addEventListener(e,s),()=>t.removeEventListener(e,s)})),exports.isNonNullable=i,exports.isNullable=o,exports.map=w,exports.mapTo=function(t){return w((()=>t))},exports.merge=function(...e){return new s((r=>e.reduce(((t,e)=>t.add(e.subscribe(r))),new t)))},exports.noop=r,exports.now=c,exports.observableFrom=t=>new s((e=>{t.forEach((t=>e.next(t)))})),exports.once=function(){return t=>new s((e=>{let r=!1,s=!1;const n=t.subscribe((t=>{r||(r=!0,e.next(t)),s&&n.unsubscribe()}),(t=>{var i;r=!0,null===(i=e.error)||void 0===i||i.call(e,t),s&&n.unsubscribe()}));return s=!0,r&&n.unsubscribe(),n}))},exports.pairwise=function(){return t=>new s((e=>t.subscribe(new f(e))))},exports.tap=function(t){return e=>new s((r=>e.subscribe(new m(r,t))))},exports.throttle=function(t,e=h){return r=>new s((s=>r.subscribe(new d(s,t,e))))},exports.timeout=t=>new s((e=>{const r=window.setTimeout((()=>e.next()),t);return()=>window.clearTimeout(r)}));
6
+ 'use strict';Object.defineProperty(exports,'__esModule',{value:!0});class t{constructor(){this.subscriptions=[]}unsubscribe(){const t=this.subscriptions;this.subscriptions=[],t.forEach((t=>'function'==typeof t?t():t.unsubscribe()))}add(t){return this.subscriptions.push(t),this}}const e=t=>{throw new Error(`${t} is value of unexpected type`)},r=()=>{};class s{constructor(t){t&&(this._subscribe=t)}subscribe(s,n){let i;i=n?'function'==typeof n?{next:n,error:r}:{next:t=>n.next(t),error:t=>{var e;return null===(e=n.error)||void 0===e?void 0:e.call(n,t)}}:{next:r,error:r};const o='function'==typeof s?{next:t=>{try{s(t)}catch(t){i.next(t)}},error:t=>i.next(t)}:{next:t=>s.next(t),error:t=>s.error?s.error(t):i.next(t)},c=this._subscribe(o);return(new t).add((()=>{switch(o.next=r,o.error=r,typeof c){case'function':return void c();case'object':return void c.unsubscribe();case'undefined':return;default:return e(c)}}))}pipe(...t){return t.reduce(((t,e)=>e(t)),this)}_subscribe(t){}}class n extends s{constructor(){super(),this.keyCounter=0,this.subscribers=new Map}next(t){this.subscribers.forEach((e=>e.next(t)))}error(t){this.subscribers.forEach((e=>{var r;return null===(r=e.error)||void 0===r?void 0:r.call(e,t)}))}_subscribe(e){const r=this.keyCounter++;return this.subscribers.set(r,e),(new t).add((()=>this.subscribers.delete(r)))}}function i(t){return null!=t}function o(t){return null==t}var c;const u='function'==typeof(null===(c=window.performance)||void 0===c?void 0:c.now)?()=>window.performance.now():()=>Date.now();const a={leading:!1,trailing:!0};class l{constructor(t,e,r){this.destination=t,this.time=e,this.config=r}next(t){this.lastValue=t,i(this.timeout)?window.clearTimeout(this.timeout):this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout((()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0}),this.time)}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}const h={leading:!0,trailing:!1};class d{constructor(t,e,r){this.destination=t,this.time=e,this.config=r}next(t){this.lastValue=t,o(this.timeout)&&(this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout((()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0}),this.time))}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}class b{constructor(t,e){this.destination=t,this.predicate=e}next(t){let e;try{e=this.predicate(t)}catch(t){throw this.error(t),t}e&&this.destination.next(t)}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}const p={};class x{constructor(t,e){this.destination=t,this.predicate=e,this.lastValue=p}next(t){let e;try{e=this.lastValue===p||!this.predicate(this.lastValue,t),this.lastValue=t}catch(t){throw this.error(t),t}e&&this.destination.next(t)}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}function w(t){return e=>new s((r=>e.subscribe(new v(r,t))))}class v{constructor(t,e){this.destination=t,this.mapper=e}next(t){let e;try{e=this.mapper(t)}catch(t){throw this.error(t),t}this.destination.next(e)}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}class f{constructor(t){this.destination=t,this.hasLast=!1}next(t){const e=this.last;this.last=t,this.hasLast?this.destination.next([e,t]):this.hasLast=!0}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}class m{constructor(t,e){this.destination=t,this.effect=e}next(t){try{this.effect(t)}catch(t){throw this.error(t),t}this.destination.next(t)}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}exports.Logger=class{constructor(){this.log$=new n,this.logs=[],this.log=t=>{const e={...t,timestamp:Date.now()};this.logs.push(e),this.log$.next(e)},this.getAllLogs=()=>this.logs}createCustomLog(t){return(...e)=>{let r;try{r=t(...e)}catch(t){r={message:'error in `createCustomLog`',component:'Logger'}}this.log(r)}}createComponentLog(t){return this.createCustomLog((e=>({component:t,...e})))}},exports.Observable=s,exports.Subject=n,exports.Subscription=t,exports.ValueSubject=class extends n{constructor(t){super(),this.value=t}next(t){super.next(this.value=t)}error(t){super.error(this.value=t)}getValue(){return this.value}_subscribe(t){const e=super._subscribe(t);return t.next(this.value),e}},exports.addScript=(t,e,r)=>new Promise(((s,n)=>{e.addEventListener('abort',(()=>{c(),a.remove()}));const i=()=>{c(),n()},o=()=>{c(),s()},c=()=>{u&&clearTimeout(u),a.removeEventListener('load',o),a.removeEventListener('error',i)};let u;r&&(u=window.setTimeout(i,r));const a=document.createElement('script');a.addEventListener('load',o),a.addEventListener('error',i),a.src=t,document.head.appendChild(a)})),exports.assertNever=e,exports.assertNonNullable=function(t,e='Assertion "value is not nullable" failed'){if(null==t)throw new Error(e)},exports.assertNullable=function(t,e='Assertion "value is nullable" failed'){if(null!=t)throw new Error(e)},exports.checkNever=t=>{},exports.combine=function(e){return new s((r=>{const s={};let n=Object.keys(e).length;return Object.entries(e).reduce(((t,[e,i])=>t.add(i.subscribe((t=>e=>{t in s||n--,s[t]=e,0===n&&r.next(s)})(e)))),new t)}))},exports.debounce=function(t,e=a){return r=>new s((s=>r.subscribe(new l(s,t,e))))},exports.filter=function(t){return e=>new s((r=>e.subscribe(new b(r,t))))},exports.filterChanged=function(t=((t,e)=>t===e)){return e=>new s((r=>e.subscribe(new x(r,t))))},exports.fromEvent=(t,e)=>new s((r=>{const s=t=>r.next(t);return t.addEventListener(e,s),()=>t.removeEventListener(e,s)})),exports.interval=t=>new s((e=>{const r=window.setInterval((()=>e.next()),t);return()=>window.clearInterval(r)})),exports.isNonNullable=i,exports.isNullable=o,exports.map=w,exports.mapTo=function(t){return w((()=>t))},exports.merge=function(...e){return new s((r=>e.reduce(((t,e)=>t.add(e.subscribe(r))),new t)))},exports.noop=r,exports.now=u,exports.observableFrom=t=>new s((e=>{t.forEach((t=>e.next(t)))})),exports.once=function(){return t=>new s((e=>{let r=!1,s=!1;const n=t.subscribe((t=>{r||(r=!0,e.next(t)),s&&n.unsubscribe()}),(t=>{var i;r=!0,null===(i=e.error)||void 0===i||i.call(e,t),s&&n.unsubscribe()}));return s=!0,r&&n.unsubscribe(),n}))},exports.pairwise=function(){return t=>new s((e=>t.subscribe(new f(e))))},exports.tap=function(t){return e=>new s((r=>e.subscribe(new m(r,t))))},exports.throttle=function(t,e=h){return r=>new s((s=>r.subscribe(new d(s,t,e))))},exports.timeout=t=>new s((e=>{const r=window.setTimeout((()=>e.next()),t);return()=>window.clearTimeout(r)}));
package/es2018.esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
- * @vkontakte/videoplayer-shared v1.0.10
3
- * Tue, 22 Mar 2022 14:33:08 GMT
4
- * https://st.mycdn.me/static/playersdk/1-0-10/doc/
2
+ * @vkontakte/videoplayer-shared v1.0.11
3
+ * Wed, 06 Apr 2022 13:48:43 GMT
4
+ * https://st.mycdn.me/static/playersdk/1-0-11/doc/
5
5
  */
6
- class t{constructor(){this.subscriptions=[]}unsubscribe(){const t=this.subscriptions;this.subscriptions=[],t.forEach((t=>'function'==typeof t?t():t.unsubscribe()))}add(t){return this.subscriptions.push(t),this}}const e=t=>{throw new Error(`${t} is value of unexpected type`)},r=t=>{},n=()=>{};class s{constructor(t){t&&(this._subscribe=t)}subscribe(r,s){let i;i=s?'function'==typeof s?{next:s,error:n}:{next:t=>s.next(t),error:t=>{var e;return null===(e=s.error)||void 0===e?void 0:e.call(s,t)}}:{next:n,error:n};const o='function'==typeof r?{next:t=>{try{r(t)}catch(t){i.next(t)}},error:t=>i.next(t)}:{next:t=>r.next(t),error:t=>r.error?r.error(t):i.next(t)},c=this._subscribe(o);return(new t).add((()=>{switch(o.next=n,o.error=n,typeof c){case'function':return void c();case'object':return void c.unsubscribe();case'undefined':return;default:return e(c)}}))}pipe(...t){return t.reduce(((t,e)=>e(t)),this)}_subscribe(t){}}class i extends s{constructor(){super(),this.keyCounter=0,this.subscribers=new Map}next(t){this.subscribers.forEach((e=>e.next(t)))}error(t){this.subscribers.forEach((e=>{var r;return null===(r=e.error)||void 0===r?void 0:r.call(e,t)}))}_subscribe(e){const r=this.keyCounter++;return this.subscribers.set(r,e),(new t).add((()=>this.subscribers.delete(r)))}}class o{constructor(){this.log$=new i,this.logs=[],this.log=t=>{const e={...t,timestamp:Date.now()};this.logs.push(e),this.log$.next(e)},this.getAllLogs=()=>this.logs}createCustomLog(t){return(...e)=>{let r;try{r=t(...e)}catch(t){r={message:'error in `createCustomLog`',component:'Logger'}}this.log(r)}}createComponentLog(t){return this.createCustomLog((e=>({component:t,...e})))}}function c(t,e='Assertion "value is not nullable" failed'){if(null==t)throw new Error(e)}function u(t,e='Assertion "value is nullable" failed'){if(null!=t)throw new Error(e)}function a(t){return null!=t}function l(t){return null==t}const h=(t,e,r)=>new Promise(((n,s)=>{e.addEventListener('abort',(()=>{c(),a.remove()}));const i=()=>{c(),s()},o=()=>{c(),n()},c=()=>{u&&clearTimeout(u),a.removeEventListener('load',o),a.removeEventListener('error',i)};let u;r&&(u=window.setTimeout(i,r));const a=document.createElement('script');a.addEventListener('load',o),a.addEventListener('error',i),a.src=t,document.head.appendChild(a)}));var d;const b='function'==typeof(null===(d=window.performance)||void 0===d?void 0:d.now)?()=>window.performance.now():()=>Date.now();class w extends i{constructor(t){super(),this.value=t}next(t){super.next(this.value=t)}error(t){super.error(this.value=t)}getValue(){return this.value}_subscribe(t){const e=super._subscribe(t);return t.next(this.value),e}}function v(e){return new s((r=>{const n={};let s=Object.keys(e).length;return Object.entries(e).reduce(((t,[e,i])=>t.add(i.subscribe((t=>e=>{t in n||s--,n[t]=e,0===s&&r.next(n)})(e)))),new t)}))}function f(...e){return new s((r=>e.reduce(((t,e)=>t.add(e.subscribe(r))),new t)))}var x=t=>new s((e=>{const r=window.setTimeout((()=>e.next()),t);return()=>window.clearTimeout(r)})),m=t=>new s((e=>{t.forEach((t=>e.next(t)))})),p=(t,e)=>new s((r=>{const n=t=>r.next(t);return t.addEventListener(e,n),()=>t.removeEventListener(e,n)}));const g={leading:!1,trailing:!0};function L(t,e=g){return r=>new s((n=>r.subscribe(new y(n,t,e))))}class y{constructor(t,e,r){this.destination=t,this.time=e,this.config=r}next(t){this.lastValue=t,a(this.timeout)?window.clearTimeout(this.timeout):this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout((()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0}),this.time)}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}const E={leading:!0,trailing:!1};function V(t,e=E){return r=>new s((n=>r.subscribe(new C(n,t,e))))}class C{constructor(t,e,r){this.destination=t,this.time=e,this.config=r}next(t){this.lastValue=t,l(this.timeout)&&(this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout((()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0}),this.time))}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}function T(t){return e=>new s((r=>e.subscribe(new _(r,t))))}class _{constructor(t,e){this.destination=t,this.predicate=e}next(t){let e;try{e=this.predicate(t)}catch(t){throw this.error(t),t}e&&this.destination.next(t)}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}function j(t=((t,e)=>t===e)){return e=>new s((r=>e.subscribe(new A(r,t))))}const k={};class A{constructor(t,e){this.destination=t,this.predicate=e,this.lastValue=k}next(t){let e;try{e=this.lastValue===k||!this.predicate(this.lastValue,t),this.lastValue=t}catch(t){throw this.error(t),t}e&&this.destination.next(t)}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}function $(t){return e=>new s((r=>e.subscribe(new D(r,t))))}class D{constructor(t,e){this.destination=t,this.mapper=e}next(t){let e;try{e=this.mapper(t)}catch(t){throw this.error(t),t}this.destination.next(e)}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}function O(t){return $((()=>t))}function M(){return t=>new s((e=>{let r=!1,n=!1;const s=t.subscribe((t=>{r||(r=!0,e.next(t)),n&&s.unsubscribe()}),(t=>{var i;r=!0,null===(i=e.error)||void 0===i||i.call(e,t),n&&s.unsubscribe()}));return n=!0,r&&s.unsubscribe(),s}))}function P(){return t=>new s((e=>t.subscribe(new q(e))))}class q{constructor(t){this.destination=t,this.hasLast=!1}next(t){const e=this.last;this.last=t,this.hasLast?this.destination.next([e,t]):this.hasLast=!0}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}function z(t){return e=>new s((r=>e.subscribe(new B(r,t))))}class B{constructor(t,e){this.destination=t,this.effect=e}next(t){try{this.effect(t)}catch(t){throw this.error(t),t}this.destination.next(t)}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}export{o as Logger,s as Observable,i as Subject,t as Subscription,w as ValueSubject,h as addScript,e as assertNever,c as assertNonNullable,u as assertNullable,r as checkNever,v as combine,L as debounce,T as filter,j as filterChanged,p as fromEvent,a as isNonNullable,l as isNullable,$ as map,O as mapTo,f as merge,n as noop,b as now,m as observableFrom,M as once,P as pairwise,z as tap,V as throttle,x as timeout};
6
+ class t{constructor(){this.subscriptions=[]}unsubscribe(){const t=this.subscriptions;this.subscriptions=[],t.forEach((t=>'function'==typeof t?t():t.unsubscribe()))}add(t){return this.subscriptions.push(t),this}}const e=t=>{throw new Error(`${t} is value of unexpected type`)},r=t=>{},n=()=>{};class s{constructor(t){t&&(this._subscribe=t)}subscribe(r,s){let i;i=s?'function'==typeof s?{next:s,error:n}:{next:t=>s.next(t),error:t=>{var e;return null===(e=s.error)||void 0===e?void 0:e.call(s,t)}}:{next:n,error:n};const o='function'==typeof r?{next:t=>{try{r(t)}catch(t){i.next(t)}},error:t=>i.next(t)}:{next:t=>r.next(t),error:t=>r.error?r.error(t):i.next(t)},c=this._subscribe(o);return(new t).add((()=>{switch(o.next=n,o.error=n,typeof c){case'function':return void c();case'object':return void c.unsubscribe();case'undefined':return;default:return e(c)}}))}pipe(...t){return t.reduce(((t,e)=>e(t)),this)}_subscribe(t){}}class i extends s{constructor(){super(),this.keyCounter=0,this.subscribers=new Map}next(t){this.subscribers.forEach((e=>e.next(t)))}error(t){this.subscribers.forEach((e=>{var r;return null===(r=e.error)||void 0===r?void 0:r.call(e,t)}))}_subscribe(e){const r=this.keyCounter++;return this.subscribers.set(r,e),(new t).add((()=>this.subscribers.delete(r)))}}class o{constructor(){this.log$=new i,this.logs=[],this.log=t=>{const e={...t,timestamp:Date.now()};this.logs.push(e),this.log$.next(e)},this.getAllLogs=()=>this.logs}createCustomLog(t){return(...e)=>{let r;try{r=t(...e)}catch(t){r={message:'error in `createCustomLog`',component:'Logger'}}this.log(r)}}createComponentLog(t){return this.createCustomLog((e=>({component:t,...e})))}}function c(t,e='Assertion "value is not nullable" failed'){if(null==t)throw new Error(e)}function u(t,e='Assertion "value is nullable" failed'){if(null!=t)throw new Error(e)}function a(t){return null!=t}function l(t){return null==t}const h=(t,e,r)=>new Promise(((n,s)=>{e.addEventListener('abort',(()=>{c(),a.remove()}));const i=()=>{c(),s()},o=()=>{c(),n()},c=()=>{u&&clearTimeout(u),a.removeEventListener('load',o),a.removeEventListener('error',i)};let u;r&&(u=window.setTimeout(i,r));const a=document.createElement('script');a.addEventListener('load',o),a.addEventListener('error',i),a.src=t,document.head.appendChild(a)}));var d;const b='function'==typeof(null===(d=window.performance)||void 0===d?void 0:d.now)?()=>window.performance.now():()=>Date.now();class w extends i{constructor(t){super(),this.value=t}next(t){super.next(this.value=t)}error(t){super.error(this.value=t)}getValue(){return this.value}_subscribe(t){const e=super._subscribe(t);return t.next(this.value),e}}function v(e){return new s((r=>{const n={};let s=Object.keys(e).length;return Object.entries(e).reduce(((t,[e,i])=>t.add(i.subscribe((t=>e=>{t in n||s--,n[t]=e,0===s&&r.next(n)})(e)))),new t)}))}function f(...e){return new s((r=>e.reduce(((t,e)=>t.add(e.subscribe(r))),new t)))}var x=t=>new s((e=>{const r=window.setTimeout((()=>e.next()),t);return()=>window.clearTimeout(r)})),m=t=>new s((e=>{const r=window.setInterval((()=>e.next()),t);return()=>window.clearInterval(r)})),p=t=>new s((e=>{t.forEach((t=>e.next(t)))})),g=(t,e)=>new s((r=>{const n=t=>r.next(t);return t.addEventListener(e,n),()=>t.removeEventListener(e,n)}));const L={leading:!1,trailing:!0};function y(t,e=L){return r=>new s((n=>r.subscribe(new E(n,t,e))))}class E{constructor(t,e,r){this.destination=t,this.time=e,this.config=r}next(t){this.lastValue=t,a(this.timeout)?window.clearTimeout(this.timeout):this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout((()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0}),this.time)}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}const V={leading:!0,trailing:!1};function C(t,e=V){return r=>new s((n=>r.subscribe(new T(n,t,e))))}class T{constructor(t,e,r){this.destination=t,this.time=e,this.config=r}next(t){this.lastValue=t,l(this.timeout)&&(this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout((()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0}),this.time))}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}function _(t){return e=>new s((r=>e.subscribe(new j(r,t))))}class j{constructor(t,e){this.destination=t,this.predicate=e}next(t){let e;try{e=this.predicate(t)}catch(t){throw this.error(t),t}e&&this.destination.next(t)}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}function k(t=((t,e)=>t===e)){return e=>new s((r=>e.subscribe(new $(r,t))))}const A={};class ${constructor(t,e){this.destination=t,this.predicate=e,this.lastValue=A}next(t){let e;try{e=this.lastValue===A||!this.predicate(this.lastValue,t),this.lastValue=t}catch(t){throw this.error(t),t}e&&this.destination.next(t)}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}function D(t){return e=>new s((r=>e.subscribe(new I(r,t))))}class I{constructor(t,e){this.destination=t,this.mapper=e}next(t){let e;try{e=this.mapper(t)}catch(t){throw this.error(t),t}this.destination.next(e)}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}function O(t){return D((()=>t))}function M(){return t=>new s((e=>{let r=!1,n=!1;const s=t.subscribe((t=>{r||(r=!0,e.next(t)),n&&s.unsubscribe()}),(t=>{var i;r=!0,null===(i=e.error)||void 0===i||i.call(e,t),n&&s.unsubscribe()}));return n=!0,r&&s.unsubscribe(),s}))}function P(){return t=>new s((e=>t.subscribe(new q(e))))}class q{constructor(t){this.destination=t,this.hasLast=!1}next(t){const e=this.last;this.last=t,this.hasLast?this.destination.next([e,t]):this.hasLast=!0}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}function z(t){return e=>new s((r=>e.subscribe(new B(r,t))))}class B{constructor(t,e){this.destination=t,this.effect=e}next(t){try{this.effect(t)}catch(t){throw this.error(t),t}this.destination.next(t)}error(t){var e,r;null===(r=(e=this.destination).error)||void 0===r||r.call(e,t)}}export{o as Logger,s as Observable,i as Subject,t as Subscription,w as ValueSubject,h as addScript,e as assertNever,c as assertNonNullable,u as assertNullable,r as checkNever,v as combine,y as debounce,_ as filter,k as filterChanged,g as fromEvent,m as interval,a as isNonNullable,l as isNullable,D as map,O as mapTo,f as merge,n as noop,b as now,p as observableFrom,M as once,P as pairwise,z as tap,C as throttle,x as timeout};
package/esnext.cjs.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
- * @vkontakte/videoplayer-shared v1.0.10
3
- * Tue, 22 Mar 2022 14:33:08 GMT
4
- * https://st.mycdn.me/static/playersdk/1-0-10/doc/
2
+ * @vkontakte/videoplayer-shared v1.0.11
3
+ * Wed, 06 Apr 2022 13:48:43 GMT
4
+ * https://st.mycdn.me/static/playersdk/1-0-11/doc/
5
5
  */
6
- 'use strict';Object.defineProperty(exports,'__esModule',{value:!0});class t{subscriptions=[];unsubscribe(){const t=this.subscriptions;this.subscriptions=[],t.forEach((t=>'function'==typeof t?t():t.unsubscribe()))}add(t){return this.subscriptions.push(t),this}}const e=t=>{throw new Error(`${t} is value of unexpected type`)},r=()=>{};class s{constructor(t){t&&(this._subscribe=t)}subscribe(s,n){let i;i=n?'function'==typeof n?{next:n,error:r}:{next:t=>n.next(t),error:t=>n.error?.(t)}:{next:r,error:r};const o='function'==typeof s?{next:t=>{try{s(t)}catch(t){i.next(t)}},error:t=>i.next(t)}:{next:t=>s.next(t),error:t=>s.error?s.error(t):i.next(t)},c=this._subscribe(o);return(new t).add((()=>{switch(o.next=r,o.error=r,typeof c){case'function':return void c();case'object':return void c.unsubscribe();case'undefined':return;default:return e(c)}}))}pipe(...t){return t.reduce(((t,e)=>e(t)),this)}_subscribe(t){}}class n extends s{keyCounter=0;subscribers=new Map;constructor(){super()}next(t){this.subscribers.forEach((e=>e.next(t)))}error(t){this.subscribers.forEach((e=>e.error?.(t)))}_subscribe(e){const r=this.keyCounter++;return this.subscribers.set(r,e),(new t).add((()=>this.subscribers.delete(r)))}}function i(t){return null!=t}function o(t){return null==t}const c='function'==typeof window.performance?.now?()=>window.performance.now():()=>Date.now();const u={leading:!1,trailing:!0};class a{destination;time;config;lastValue;timeout;constructor(t,e,r){this.destination=t,this.time=e,this.config=r}next(t){this.lastValue=t,i(this.timeout)?window.clearTimeout(this.timeout):this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout((()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0}),this.time)}error(t){this.destination.error?.(t)}}const l={leading:!0,trailing:!1};class h{destination;time;config;lastValue;timeout;constructor(t,e,r){this.destination=t,this.time=e,this.config=r}next(t){this.lastValue=t,o(this.timeout)&&(this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout((()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0}),this.time))}error(t){this.destination.error?.(t)}}class d{destination;predicate;constructor(t,e){this.destination=t,this.predicate=e}next(t){let e;try{e=this.predicate(t)}catch(t){throw this.error(t),t}e&&this.destination.next(t)}error(t){this.destination.error?.(t)}}const b={};class p{destination;predicate;lastValue=b;constructor(t,e){this.destination=t,this.predicate=e}next(t){let e;try{e=this.lastValue===b||!this.predicate(this.lastValue,t),this.lastValue=t}catch(t){throw this.error(t),t}e&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function x(t){return e=>new s((r=>e.subscribe(new w(r,t))))}class w{destination;mapper;constructor(t,e){this.destination=t,this.mapper=e}next(t){let e;try{e=this.mapper(t)}catch(t){throw this.error(t),t}this.destination.next(e)}error(t){this.destination.error?.(t)}}class f{destination;last;hasLast=!1;constructor(t){this.destination=t}next(t){const e=this.last;this.last=t,this.hasLast?this.destination.next([e,t]):this.hasLast=!0}error(t){this.destination.error?.(t)}}class m{destination;effect;constructor(t,e){this.destination=t,this.effect=e}next(t){try{this.effect(t)}catch(t){throw this.error(t),t}this.destination.next(t)}error(t){this.destination.error?.(t)}}exports.Logger=class{log$=new n;logs=[];log=t=>{const e={...t,timestamp:Date.now()};this.logs.push(e),this.log$.next(e)};createCustomLog(t){return(...e)=>{let r;try{r=t(...e)}catch{r={message:'error in `createCustomLog`',component:'Logger'}}this.log(r)}}createComponentLog(t){return this.createCustomLog((e=>({component:t,...e})))}getAllLogs=()=>this.logs},exports.Observable=s,exports.Subject=n,exports.Subscription=t,exports.ValueSubject=class extends n{value;constructor(t){super(),this.value=t}next(t){super.next(this.value=t)}error(t){super.error(this.value=t)}getValue(){return this.value}_subscribe(t){const e=super._subscribe(t);return t.next(this.value),e}},exports.addScript=(t,e,r)=>new Promise(((s,n)=>{e.addEventListener('abort',(()=>{c(),a.remove()}));const i=()=>{c(),n()},o=()=>{c(),s()},c=()=>{u&&clearTimeout(u),a.removeEventListener('load',o),a.removeEventListener('error',i)};let u;r&&(u=window.setTimeout(i,r));const a=document.createElement('script');a.addEventListener('load',o),a.addEventListener('error',i),a.src=t,document.head.appendChild(a)})),exports.assertNever=e,exports.assertNonNullable=function(t,e='Assertion "value is not nullable" failed'){if(null==t)throw new Error(e)},exports.assertNullable=function(t,e='Assertion "value is nullable" failed'){if(null!=t)throw new Error(e)},exports.checkNever=t=>{},exports.combine=function(e){return new s((r=>{const s={};let n=Object.keys(e).length;return Object.entries(e).reduce(((t,[e,i])=>t.add(i.subscribe((t=>e=>{t in s||n--,s[t]=e,0===n&&r.next(s)})(e)))),new t)}))},exports.debounce=function(t,e=u){return r=>new s((s=>r.subscribe(new a(s,t,e))))},exports.filter=function(t){return e=>new s((r=>e.subscribe(new d(r,t))))},exports.filterChanged=function(t=((t,e)=>t===e)){return e=>new s((r=>e.subscribe(new p(r,t))))},exports.fromEvent=(t,e)=>new s((r=>{const s=t=>r.next(t);return t.addEventListener(e,s),()=>t.removeEventListener(e,s)})),exports.isNonNullable=i,exports.isNullable=o,exports.map=x,exports.mapTo=function(t){return x((()=>t))},exports.merge=function(...e){return new s((r=>e.reduce(((t,e)=>t.add(e.subscribe(r))),new t)))},exports.noop=r,exports.now=c,exports.observableFrom=t=>new s((e=>{t.forEach((t=>e.next(t)))})),exports.once=function(){return t=>new s((e=>{let r=!1,s=!1;const n=t.subscribe((t=>{r||(r=!0,e.next(t)),s&&n.unsubscribe()}),(t=>{r=!0,e.error?.(t),s&&n.unsubscribe()}));return s=!0,r&&n.unsubscribe(),n}))},exports.pairwise=function(){return t=>new s((e=>t.subscribe(new f(e))))},exports.tap=function(t){return e=>new s((r=>e.subscribe(new m(r,t))))},exports.throttle=function(t,e=l){return r=>new s((s=>r.subscribe(new h(s,t,e))))},exports.timeout=t=>new s((e=>{const r=window.setTimeout((()=>e.next()),t);return()=>window.clearTimeout(r)}));
6
+ 'use strict';Object.defineProperty(exports,'__esModule',{value:!0});class t{subscriptions=[];unsubscribe(){const t=this.subscriptions;this.subscriptions=[],t.forEach((t=>'function'==typeof t?t():t.unsubscribe()))}add(t){return this.subscriptions.push(t),this}}const e=t=>{throw new Error(`${t} is value of unexpected type`)},r=()=>{};class s{constructor(t){t&&(this._subscribe=t)}subscribe(s,n){let i;i=n?'function'==typeof n?{next:n,error:r}:{next:t=>n.next(t),error:t=>n.error?.(t)}:{next:r,error:r};const o='function'==typeof s?{next:t=>{try{s(t)}catch(t){i.next(t)}},error:t=>i.next(t)}:{next:t=>s.next(t),error:t=>s.error?s.error(t):i.next(t)},c=this._subscribe(o);return(new t).add((()=>{switch(o.next=r,o.error=r,typeof c){case'function':return void c();case'object':return void c.unsubscribe();case'undefined':return;default:return e(c)}}))}pipe(...t){return t.reduce(((t,e)=>e(t)),this)}_subscribe(t){}}class n extends s{keyCounter=0;subscribers=new Map;constructor(){super()}next(t){this.subscribers.forEach((e=>e.next(t)))}error(t){this.subscribers.forEach((e=>e.error?.(t)))}_subscribe(e){const r=this.keyCounter++;return this.subscribers.set(r,e),(new t).add((()=>this.subscribers.delete(r)))}}function i(t){return null!=t}function o(t){return null==t}const c='function'==typeof window.performance?.now?()=>window.performance.now():()=>Date.now();const u={leading:!1,trailing:!0};class a{destination;time;config;lastValue;timeout;constructor(t,e,r){this.destination=t,this.time=e,this.config=r}next(t){this.lastValue=t,i(this.timeout)?window.clearTimeout(this.timeout):this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout((()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0}),this.time)}error(t){this.destination.error?.(t)}}const l={leading:!0,trailing:!1};class h{destination;time;config;lastValue;timeout;constructor(t,e,r){this.destination=t,this.time=e,this.config=r}next(t){this.lastValue=t,o(this.timeout)&&(this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout((()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0}),this.time))}error(t){this.destination.error?.(t)}}class d{destination;predicate;constructor(t,e){this.destination=t,this.predicate=e}next(t){let e;try{e=this.predicate(t)}catch(t){throw this.error(t),t}e&&this.destination.next(t)}error(t){this.destination.error?.(t)}}const b={};class p{destination;predicate;lastValue=b;constructor(t,e){this.destination=t,this.predicate=e}next(t){let e;try{e=this.lastValue===b||!this.predicate(this.lastValue,t),this.lastValue=t}catch(t){throw this.error(t),t}e&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function x(t){return e=>new s((r=>e.subscribe(new w(r,t))))}class w{destination;mapper;constructor(t,e){this.destination=t,this.mapper=e}next(t){let e;try{e=this.mapper(t)}catch(t){throw this.error(t),t}this.destination.next(e)}error(t){this.destination.error?.(t)}}class f{destination;last;hasLast=!1;constructor(t){this.destination=t}next(t){const e=this.last;this.last=t,this.hasLast?this.destination.next([e,t]):this.hasLast=!0}error(t){this.destination.error?.(t)}}class m{destination;effect;constructor(t,e){this.destination=t,this.effect=e}next(t){try{this.effect(t)}catch(t){throw this.error(t),t}this.destination.next(t)}error(t){this.destination.error?.(t)}}exports.Logger=class{log$=new n;logs=[];log=t=>{const e={...t,timestamp:Date.now()};this.logs.push(e),this.log$.next(e)};createCustomLog(t){return(...e)=>{let r;try{r=t(...e)}catch{r={message:'error in `createCustomLog`',component:'Logger'}}this.log(r)}}createComponentLog(t){return this.createCustomLog((e=>({component:t,...e})))}getAllLogs=()=>this.logs},exports.Observable=s,exports.Subject=n,exports.Subscription=t,exports.ValueSubject=class extends n{value;constructor(t){super(),this.value=t}next(t){super.next(this.value=t)}error(t){super.error(this.value=t)}getValue(){return this.value}_subscribe(t){const e=super._subscribe(t);return t.next(this.value),e}},exports.addScript=(t,e,r)=>new Promise(((s,n)=>{e.addEventListener('abort',(()=>{c(),a.remove()}));const i=()=>{c(),n()},o=()=>{c(),s()},c=()=>{u&&clearTimeout(u),a.removeEventListener('load',o),a.removeEventListener('error',i)};let u;r&&(u=window.setTimeout(i,r));const a=document.createElement('script');a.addEventListener('load',o),a.addEventListener('error',i),a.src=t,document.head.appendChild(a)})),exports.assertNever=e,exports.assertNonNullable=function(t,e='Assertion "value is not nullable" failed'){if(null==t)throw new Error(e)},exports.assertNullable=function(t,e='Assertion "value is nullable" failed'){if(null!=t)throw new Error(e)},exports.checkNever=t=>{},exports.combine=function(e){return new s((r=>{const s={};let n=Object.keys(e).length;return Object.entries(e).reduce(((t,[e,i])=>t.add(i.subscribe((t=>e=>{t in s||n--,s[t]=e,0===n&&r.next(s)})(e)))),new t)}))},exports.debounce=function(t,e=u){return r=>new s((s=>r.subscribe(new a(s,t,e))))},exports.filter=function(t){return e=>new s((r=>e.subscribe(new d(r,t))))},exports.filterChanged=function(t=((t,e)=>t===e)){return e=>new s((r=>e.subscribe(new p(r,t))))},exports.fromEvent=(t,e)=>new s((r=>{const s=t=>r.next(t);return t.addEventListener(e,s),()=>t.removeEventListener(e,s)})),exports.interval=t=>new s((e=>{const r=window.setInterval((()=>e.next()),t);return()=>window.clearInterval(r)})),exports.isNonNullable=i,exports.isNullable=o,exports.map=x,exports.mapTo=function(t){return x((()=>t))},exports.merge=function(...e){return new s((r=>e.reduce(((t,e)=>t.add(e.subscribe(r))),new t)))},exports.noop=r,exports.now=c,exports.observableFrom=t=>new s((e=>{t.forEach((t=>e.next(t)))})),exports.once=function(){return t=>new s((e=>{let r=!1,s=!1;const n=t.subscribe((t=>{r||(r=!0,e.next(t)),s&&n.unsubscribe()}),(t=>{r=!0,e.error?.(t),s&&n.unsubscribe()}));return s=!0,r&&n.unsubscribe(),n}))},exports.pairwise=function(){return t=>new s((e=>t.subscribe(new f(e))))},exports.tap=function(t){return e=>new s((r=>e.subscribe(new m(r,t))))},exports.throttle=function(t,e=l){return r=>new s((s=>r.subscribe(new h(s,t,e))))},exports.timeout=t=>new s((e=>{const r=window.setTimeout((()=>e.next()),t);return()=>window.clearTimeout(r)}));
package/esnext.esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
- * @vkontakte/videoplayer-shared v1.0.10
3
- * Tue, 22 Mar 2022 14:33:08 GMT
4
- * https://st.mycdn.me/static/playersdk/1-0-10/doc/
2
+ * @vkontakte/videoplayer-shared v1.0.11
3
+ * Wed, 06 Apr 2022 13:48:43 GMT
4
+ * https://st.mycdn.me/static/playersdk/1-0-11/doc/
5
5
  */
6
- class t{subscriptions=[];unsubscribe(){const t=this.subscriptions;this.subscriptions=[],t.forEach((t=>'function'==typeof t?t():t.unsubscribe()))}add(t){return this.subscriptions.push(t),this}}const e=t=>{throw new Error(`${t} is value of unexpected type`)},n=t=>{},s=()=>{};class r{constructor(t){t&&(this._subscribe=t)}subscribe(n,r){let i;i=r?'function'==typeof r?{next:r,error:s}:{next:t=>r.next(t),error:t=>r.error?.(t)}:{next:s,error:s};const o='function'==typeof n?{next:t=>{try{n(t)}catch(t){i.next(t)}},error:t=>i.next(t)}:{next:t=>n.next(t),error:t=>n.error?n.error(t):i.next(t)},c=this._subscribe(o);return(new t).add((()=>{switch(o.next=s,o.error=s,typeof c){case'function':return void c();case'object':return void c.unsubscribe();case'undefined':return;default:return e(c)}}))}pipe(...t){return t.reduce(((t,e)=>e(t)),this)}_subscribe(t){}}class i extends r{keyCounter=0;subscribers=new Map;constructor(){super()}next(t){this.subscribers.forEach((e=>e.next(t)))}error(t){this.subscribers.forEach((e=>e.error?.(t)))}_subscribe(e){const n=this.keyCounter++;return this.subscribers.set(n,e),(new t).add((()=>this.subscribers.delete(n)))}}class o{log$=new i;logs=[];log=t=>{const e={...t,timestamp:Date.now()};this.logs.push(e),this.log$.next(e)};createCustomLog(t){return(...e)=>{let n;try{n=t(...e)}catch{n={message:'error in `createCustomLog`',component:'Logger'}}this.log(n)}}createComponentLog(t){return this.createCustomLog((e=>({component:t,...e})))}getAllLogs=()=>this.logs}function c(t,e='Assertion "value is not nullable" failed'){if(null==t)throw new Error(e)}function u(t,e='Assertion "value is nullable" failed'){if(null!=t)throw new Error(e)}function a(t){return null!=t}function h(t){return null==t}const l=(t,e,n)=>new Promise(((s,r)=>{e.addEventListener('abort',(()=>{c(),a.remove()}));const i=()=>{c(),r()},o=()=>{c(),s()},c=()=>{u&&clearTimeout(u),a.removeEventListener('load',o),a.removeEventListener('error',i)};let u;n&&(u=window.setTimeout(i,n));const a=document.createElement('script');a.addEventListener('load',o),a.addEventListener('error',i),a.src=t,document.head.appendChild(a)})),d='function'==typeof window.performance?.now?()=>window.performance.now():()=>Date.now();class b extends i{value;constructor(t){super(),this.value=t}next(t){super.next(this.value=t)}error(t){super.error(this.value=t)}getValue(){return this.value}_subscribe(t){const e=super._subscribe(t);return t.next(this.value),e}}function w(e){return new r((n=>{const s={};let r=Object.keys(e).length;return Object.entries(e).reduce(((t,[e,i])=>t.add(i.subscribe((t=>e=>{t in s||r--,s[t]=e,0===r&&n.next(s)})(e)))),new t)}))}function f(...e){return new r((n=>e.reduce(((t,e)=>t.add(e.subscribe(n))),new t)))}var m=t=>new r((e=>{const n=window.setTimeout((()=>e.next()),t);return()=>window.clearTimeout(n)})),p=t=>new r((e=>{t.forEach((t=>e.next(t)))})),x=(t,e)=>new r((n=>{const s=t=>n.next(t);return t.addEventListener(e,s),()=>t.removeEventListener(e,s)}));const g={leading:!1,trailing:!0};function v(t,e=g){return n=>new r((s=>n.subscribe(new L(s,t,e))))}class L{destination;time;config;lastValue;timeout;constructor(t,e,n){this.destination=t,this.time=e,this.config=n}next(t){this.lastValue=t,a(this.timeout)?window.clearTimeout(this.timeout):this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout((()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0}),this.time)}error(t){this.destination.error?.(t)}}const y={leading:!0,trailing:!1};function E(t,e=y){return n=>new r((s=>n.subscribe(new V(s,t,e))))}class V{destination;time;config;lastValue;timeout;constructor(t,e,n){this.destination=t,this.time=e,this.config=n}next(t){this.lastValue=t,h(this.timeout)&&(this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout((()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0}),this.time))}error(t){this.destination.error?.(t)}}function C(t){return e=>new r((n=>e.subscribe(new T(n,t))))}class T{destination;predicate;constructor(t,e){this.destination=t,this.predicate=e}next(t){let e;try{e=this.predicate(t)}catch(t){throw this.error(t),t}e&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function _(t=((t,e)=>t===e)){return e=>new r((n=>e.subscribe(new k(n,t))))}const j={};class k{destination;predicate;lastValue=j;constructor(t,e){this.destination=t,this.predicate=e}next(t){let e;try{e=this.lastValue===j||!this.predicate(this.lastValue,t),this.lastValue=t}catch(t){throw this.error(t),t}e&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function A(t){return e=>new r((n=>e.subscribe(new $(n,t))))}class ${destination;mapper;constructor(t,e){this.destination=t,this.mapper=e}next(t){let e;try{e=this.mapper(t)}catch(t){throw this.error(t),t}this.destination.next(e)}error(t){this.destination.error?.(t)}}function D(t){return A((()=>t))}function O(){return t=>new r((e=>{let n=!1,s=!1;const r=t.subscribe((t=>{n||(n=!0,e.next(t)),s&&r.unsubscribe()}),(t=>{n=!0,e.error?.(t),s&&r.unsubscribe()}));return s=!0,n&&r.unsubscribe(),r}))}function M(){return t=>new r((e=>t.subscribe(new P(e))))}class P{destination;last;hasLast=!1;constructor(t){this.destination=t}next(t){const e=this.last;this.last=t,this.hasLast?this.destination.next([e,t]):this.hasLast=!0}error(t){this.destination.error?.(t)}}function q(t){return e=>new r((n=>e.subscribe(new z(n,t))))}class z{destination;effect;constructor(t,e){this.destination=t,this.effect=e}next(t){try{this.effect(t)}catch(t){throw this.error(t),t}this.destination.next(t)}error(t){this.destination.error?.(t)}}export{o as Logger,r as Observable,i as Subject,t as Subscription,b as ValueSubject,l as addScript,e as assertNever,c as assertNonNullable,u as assertNullable,n as checkNever,w as combine,v as debounce,C as filter,_ as filterChanged,x as fromEvent,a as isNonNullable,h as isNullable,A as map,D as mapTo,f as merge,s as noop,d as now,p as observableFrom,O as once,M as pairwise,q as tap,E as throttle,m as timeout};
6
+ class t{subscriptions=[];unsubscribe(){const t=this.subscriptions;this.subscriptions=[],t.forEach((t=>'function'==typeof t?t():t.unsubscribe()))}add(t){return this.subscriptions.push(t),this}}const e=t=>{throw new Error(`${t} is value of unexpected type`)},n=t=>{},r=()=>{};class s{constructor(t){t&&(this._subscribe=t)}subscribe(n,s){let i;i=s?'function'==typeof s?{next:s,error:r}:{next:t=>s.next(t),error:t=>s.error?.(t)}:{next:r,error:r};const o='function'==typeof n?{next:t=>{try{n(t)}catch(t){i.next(t)}},error:t=>i.next(t)}:{next:t=>n.next(t),error:t=>n.error?n.error(t):i.next(t)},c=this._subscribe(o);return(new t).add((()=>{switch(o.next=r,o.error=r,typeof c){case'function':return void c();case'object':return void c.unsubscribe();case'undefined':return;default:return e(c)}}))}pipe(...t){return t.reduce(((t,e)=>e(t)),this)}_subscribe(t){}}class i extends s{keyCounter=0;subscribers=new Map;constructor(){super()}next(t){this.subscribers.forEach((e=>e.next(t)))}error(t){this.subscribers.forEach((e=>e.error?.(t)))}_subscribe(e){const n=this.keyCounter++;return this.subscribers.set(n,e),(new t).add((()=>this.subscribers.delete(n)))}}class o{log$=new i;logs=[];log=t=>{const e={...t,timestamp:Date.now()};this.logs.push(e),this.log$.next(e)};createCustomLog(t){return(...e)=>{let n;try{n=t(...e)}catch{n={message:'error in `createCustomLog`',component:'Logger'}}this.log(n)}}createComponentLog(t){return this.createCustomLog((e=>({component:t,...e})))}getAllLogs=()=>this.logs}function c(t,e='Assertion "value is not nullable" failed'){if(null==t)throw new Error(e)}function u(t,e='Assertion "value is nullable" failed'){if(null!=t)throw new Error(e)}function a(t){return null!=t}function h(t){return null==t}const l=(t,e,n)=>new Promise(((r,s)=>{e.addEventListener('abort',(()=>{c(),a.remove()}));const i=()=>{c(),s()},o=()=>{c(),r()},c=()=>{u&&clearTimeout(u),a.removeEventListener('load',o),a.removeEventListener('error',i)};let u;n&&(u=window.setTimeout(i,n));const a=document.createElement('script');a.addEventListener('load',o),a.addEventListener('error',i),a.src=t,document.head.appendChild(a)})),d='function'==typeof window.performance?.now?()=>window.performance.now():()=>Date.now();class b extends i{value;constructor(t){super(),this.value=t}next(t){super.next(this.value=t)}error(t){super.error(this.value=t)}getValue(){return this.value}_subscribe(t){const e=super._subscribe(t);return t.next(this.value),e}}function w(e){return new s((n=>{const r={};let s=Object.keys(e).length;return Object.entries(e).reduce(((t,[e,i])=>t.add(i.subscribe((t=>e=>{t in r||s--,r[t]=e,0===s&&n.next(r)})(e)))),new t)}))}function f(...e){return new s((n=>e.reduce(((t,e)=>t.add(e.subscribe(n))),new t)))}var m=t=>new s((e=>{const n=window.setTimeout((()=>e.next()),t);return()=>window.clearTimeout(n)})),p=t=>new s((e=>{const n=window.setInterval((()=>e.next()),t);return()=>window.clearInterval(n)})),x=t=>new s((e=>{t.forEach((t=>e.next(t)))})),g=(t,e)=>new s((n=>{const r=t=>n.next(t);return t.addEventListener(e,r),()=>t.removeEventListener(e,r)}));const v={leading:!1,trailing:!0};function L(t,e=v){return n=>new s((r=>n.subscribe(new y(r,t,e))))}class y{destination;time;config;lastValue;timeout;constructor(t,e,n){this.destination=t,this.time=e,this.config=n}next(t){this.lastValue=t,a(this.timeout)?window.clearTimeout(this.timeout):this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout((()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0}),this.time)}error(t){this.destination.error?.(t)}}const E={leading:!0,trailing:!1};function V(t,e=E){return n=>new s((r=>n.subscribe(new C(r,t,e))))}class C{destination;time;config;lastValue;timeout;constructor(t,e,n){this.destination=t,this.time=e,this.config=n}next(t){this.lastValue=t,h(this.timeout)&&(this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout((()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0}),this.time))}error(t){this.destination.error?.(t)}}function T(t){return e=>new s((n=>e.subscribe(new _(n,t))))}class _{destination;predicate;constructor(t,e){this.destination=t,this.predicate=e}next(t){let e;try{e=this.predicate(t)}catch(t){throw this.error(t),t}e&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function j(t=((t,e)=>t===e)){return e=>new s((n=>e.subscribe(new A(n,t))))}const k={};class A{destination;predicate;lastValue=k;constructor(t,e){this.destination=t,this.predicate=e}next(t){let e;try{e=this.lastValue===k||!this.predicate(this.lastValue,t),this.lastValue=t}catch(t){throw this.error(t),t}e&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function $(t){return e=>new s((n=>e.subscribe(new D(n,t))))}class D{destination;mapper;constructor(t,e){this.destination=t,this.mapper=e}next(t){let e;try{e=this.mapper(t)}catch(t){throw this.error(t),t}this.destination.next(e)}error(t){this.destination.error?.(t)}}function I(t){return $((()=>t))}function O(){return t=>new s((e=>{let n=!1,r=!1;const s=t.subscribe((t=>{n||(n=!0,e.next(t)),r&&s.unsubscribe()}),(t=>{n=!0,e.error?.(t),r&&s.unsubscribe()}));return r=!0,n&&s.unsubscribe(),s}))}function M(){return t=>new s((e=>t.subscribe(new P(e))))}class P{destination;last;hasLast=!1;constructor(t){this.destination=t}next(t){const e=this.last;this.last=t,this.hasLast?this.destination.next([e,t]):this.hasLast=!0}error(t){this.destination.error?.(t)}}function q(t){return e=>new s((n=>e.subscribe(new z(n,t))))}class z{destination;effect;constructor(t,e){this.destination=t,this.effect=e}next(t){try{this.effect(t)}catch(t){throw this.error(t),t}this.destination.next(t)}error(t){this.destination.error?.(t)}}export{o as Logger,s as Observable,i as Subject,t as Subscription,b as ValueSubject,l as addScript,e as assertNever,c as assertNonNullable,u as assertNullable,n as checkNever,w as combine,L as debounce,T as filter,j as filterChanged,g as fromEvent,p as interval,a as isNonNullable,h as isNullable,$ as map,I as mapTo,f as merge,r as noop,d as now,x as observableFrom,O as once,M as pairwise,q as tap,V as throttle,m as timeout};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vkontakte/videoplayer-shared",
3
- "version": "1.0.10",
3
+ "version": "1.0.11",
4
4
  "author": "vk.com",
5
5
  "description": "Shared code for vk.com videoplayer",
6
6
  "homepage": "https://vk.com",
@@ -5,6 +5,7 @@ export { default as ValueSubject } from './ValueSubject';
5
5
  export { default as combine } from './combine';
6
6
  export { default as merge } from './merge';
7
7
  export { default as timeout } from './timeout';
8
+ export { default as interval } from './interval';
8
9
  export { default as observableFrom } from './observableFrom';
9
10
  export { default as fromEvent } from './fromEvent';
10
11
  export { default as debounce } from './operators/debounce';
@@ -0,0 +1,4 @@
1
+ import { Milliseconds } from '../utils';
2
+ import type { IObservable } from './types';
3
+ declare const _default: (time: Milliseconds) => IObservable<void>;
4
+ export default _default;
@@ -1,3 +1,4 @@
1
+ import { Milliseconds } from '../utils';
1
2
  import type { IObservable } from './types';
2
- declare const _default: (interval: number) => IObservable<void>;
3
+ declare const _default: (time: Milliseconds) => IObservable<void>;
3
4
  export default _default;