@vkontakte/videoplayer-shared 1.0.36-dev.e23ad8e3.0 → 1.0.37-beta.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.
Files changed (62) hide show
  1. package/es2015.cjs.js +4 -4
  2. package/es2015.esm.js +4 -4
  3. package/es2018.cjs.js +4 -4
  4. package/es2018.esm.js +4 -4
  5. package/esnext.cjs.js +4 -4
  6. package/esnext.esm.js +4 -4
  7. package/evergreen.esm.js +4 -4
  8. package/package.json +7 -7
  9. package/types/Logger/Logger.d.ts +10 -0
  10. package/types/Logger/index.d.ts +2 -0
  11. package/types/Logger/types.d.ts +30 -0
  12. package/types/env.d.ts +1 -0
  13. package/types/index.d.ts +6 -0
  14. package/types/reactive/Observable.d.ts +7 -0
  15. package/types/reactive/Subject.d.ts +10 -0
  16. package/types/reactive/Subscription.d.ts +6 -0
  17. package/types/reactive/ValueSubject.d.ts +10 -0
  18. package/types/reactive/combine.d.ts +10 -0
  19. package/types/reactive/fromEvent.d.ts +7 -0
  20. package/types/reactive/index.d.ts +21 -0
  21. package/types/reactive/interval.d.ts +4 -0
  22. package/types/reactive/merge.d.ts +12 -0
  23. package/types/reactive/observableFrom.d.ts +3 -0
  24. package/types/reactive/operators/buffer.d.ts +2 -0
  25. package/types/reactive/operators/debounce.d.ts +6 -0
  26. package/types/reactive/operators/filter.d.ts +3 -0
  27. package/types/reactive/operators/filterChanged.d.ts +5 -0
  28. package/types/reactive/operators/map.d.ts +2 -0
  29. package/types/reactive/operators/mapTo.d.ts +2 -0
  30. package/types/reactive/operators/once.d.ts +5 -0
  31. package/types/reactive/operators/pairwise.d.ts +4 -0
  32. package/types/reactive/operators/tap.d.ts +2 -0
  33. package/types/reactive/operators/throttle.d.ts +5 -0
  34. package/types/reactive/timeout.d.ts +4 -0
  35. package/types/reactive/types.d.ts +29 -0
  36. package/types/translation/index.d.ts +2 -0
  37. package/types/translation/loadVKLangPack.d.ts +16 -0
  38. package/types/translation/types.d.ts +5 -0
  39. package/types/types/index.d.ts +53 -0
  40. package/types/utils/abortable.d.ts +3 -0
  41. package/types/utils/addScript.d.ts +1 -0
  42. package/types/utils/cloneDeep.d.ts +1 -0
  43. package/types/utils/cloneDeepWith.d.ts +3 -0
  44. package/types/utils/config.d.ts +2 -0
  45. package/types/utils/debounceFn.d.ts +13 -0
  46. package/types/utils/detectBrowser.d.ts +31 -0
  47. package/types/utils/detectEmbed.d.ts +4 -0
  48. package/types/utils/empty.d.ts +2 -0
  49. package/types/utils/exponentialBackoff.d.ts +9 -0
  50. package/types/utils/iframeSafeStorage.d.ts +6 -0
  51. package/types/utils/index.d.ts +22 -0
  52. package/types/utils/never.d.ts +2 -0
  53. package/types/utils/noop.d.ts +1 -0
  54. package/types/utils/now.d.ts +2 -0
  55. package/types/utils/nullable.d.ts +7 -0
  56. package/types/utils/observeElementSize.d.ts +3 -0
  57. package/types/utils/quality/index.d.ts +20 -0
  58. package/types/utils/quality/types.d.ts +21 -0
  59. package/types/utils/semanticTypes.d.ts +7 -0
  60. package/types/utils/throttleFn.d.ts +5 -0
  61. package/types/utils/timecode.d.ts +1 -0
  62. package/index.d.ts +0 -415
package/es2015.cjs.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
- * @vkontakte/videoplayer-shared v1.0.36-dev.e23ad8e3.0
3
- * Mon, 03 Jun 2024 05:52:59 GMT
4
- * https://st.mycdn.me/static/vkontakte-videoplayer/1-0-36/doc/
2
+ * @vkontakte/videoplayer-shared v1.0.37-beta.0
3
+ * Tue, 16 Jul 2024 14:55:16 GMT
4
+ * https://st.mycdn.me/static/vkontakte-videoplayer/1-0-37/doc/
5
5
  */
6
- "use strict";const On="1.0.36-dev.e23ad8e3.0";class H{constructor(){this.subscriptions=[]}unsubscribe(){const r=this.subscriptions;this.subscriptions=[],r.forEach(t=>typeof t=="function"?t():t.unsubscribe())}add(r){return this.subscriptions.push(r),this}}const M=e=>{throw new Error(`${e} is value of unexpected type`)},En=e=>{},B=()=>{};class g{constructor(r){r&&(this._subscribe=r)}subscribe(r,t){var n;let i;t?typeof t=="function"?i={next:t,error:B}:i={next:s=>t.next(s),error:s=>{var u;return(u=t.error)===null||u===void 0?void 0:u.call(t,s)}}:i={next:B,error:B};const o=typeof r=="function"?{next:s=>{try{r(s)}catch(u){i.next(u)}},error:s=>i.next(s)}:{next:s=>r.next(s),error:s=>r.error?r.error(s):i.next(s)};let a;try{a=this._subscribe(o)}catch(s){(n=o.error)===null||n===void 0||n.call(o,s)}return new H().add(()=>{switch(o.next=B,o.error=B,typeof a){case"function":a();return;case"object":a.unsubscribe();return;case"undefined":return;default:return M(a)}})}pipe(...r){return r.reduce((t,n)=>n(t),this)}_subscribe(r){}}class Je extends g{constructor(){super(),this.keyCounter=0,this.subscribers=new Map}next(r){this.subscribers.forEach(t=>t.next(r))}error(r){this.subscribers.forEach(t=>{var n;return(n=t.error)===null||n===void 0?void 0:n.call(t,r)})}_subscribe(r){const t=this.keyCounter++;return this.subscribers.set(t,r),new H().add(()=>this.subscribers.delete(t))}}class Sn{constructor(){this.log$=new Je,this.logs=[],this.log=r=>{const t=Object.assign(Object.assign({},r),{timestamp:Date.now()});this.logs.push(t),this.log$.next(t)},this.getAllLogs=()=>this.logs}createCustomLog(r){return(...t)=>{let n;try{n=r(...t)}catch(i){n={message:"error in `createCustomLog`",component:"Logger"}}this.log(n)}}createComponentLog(r){return this.createCustomLog(t=>Object.assign({component:r},t))}}function $n(e,r='Assertion "value is not nullable" failed'){if(e==null)throw new Error(r)}function Tn(e,r='Assertion "value is nullable" failed'){if(e!=null)throw new Error(r)}function de(e){return typeof e!="undefined"&&e!==null}function vt(e){return e==null}function In(e,r){if(!(e!=null&&e.length))throw new Error(r)}function Rn(e,r){if(e!=null&&e.length)throw new Error(r)}const Pn=(e,r,t)=>new Promise((n,i)=>{r.addEventListener("abort",()=>{s(),c.remove()});const o=()=>{s(),i()},a=()=>{s(),n()},s=()=>{u&&clearTimeout(u),c.removeEventListener("load",a),c.removeEventListener("error",o)};let u;t&&(u=window.setTimeout(o,t));const c=document.createElement("script");c.addEventListener("load",a),c.addEventListener("error",o),c.src=e,document.head.appendChild(c)});var me;const _n=typeof((me=window.performance)===null||me===void 0?void 0:me.now)=="function"?()=>window.performance.now():()=>Date.now();function dt(e,r,t,n){function i(o){return o instanceof t?o:new t(function(a){a(o)})}return new(t||(t=Promise))(function(o,a){function s(l){try{c(n.next(l))}catch(f){a(f)}}function u(l){try{c(n.throw(l))}catch(f){a(f)}}function c(l){l.done?o(l.value):i(l.value).then(s,u)}c((n=n.apply(e,r||[])).next())})}const An=(e,r)=>(...t)=>dt(void 0,void 0,void 0,function*(){var n;const i=r(...t);let o=e.aborted,a;for(;!o&&!e.aborted;)try{const s=yield i.next(a);o=(n=s.done)!==null&&n!==void 0?n:!1,a=s.value}catch(s){yield i.throw(s)}return a});exports.CurrentClientBrowser=void 0;(function(e){e.Unknown="Unknown",e.Yandex="Yandex",e.Chrome="Chrome",e.Chromium="Chromium",e.Firefox="Firefox",e.Safari="Safari",e.Opera="Opera",e.Edge="Edge",e.Rest="Rest"})(exports.CurrentClientBrowser||(exports.CurrentClientBrowser={}));exports.CurrentClientDevice=void 0;(function(e){e.Unknown="Unknown",e.Android="Android",e.iPhone="iPhone",e.iPad="iPad",e.iPod="iPod",e.RestMobile="RestMobile",e.Mac="Mac",e.Desktop="Desktop"})(exports.CurrentClientDevice||(exports.CurrentClientDevice={}));const Ze=()=>{const{userAgent:e}=window.navigator,r=/yabrowser/i.test(e)?exports.CurrentClientBrowser.Yandex:void 0,t=/chrome|crios/i.test(e)?exports.CurrentClientBrowser.Chrome:void 0,n=/chromium/i.test(e)?exports.CurrentClientBrowser.Chromium:void 0,i=/firefox|fxios/i.test(e)?exports.CurrentClientBrowser.Firefox:void 0,o=/webkit|safari|khtml/i.test(e)?exports.CurrentClientBrowser.Safari:void 0,a=/opr\//i.test(e)?exports.CurrentClientBrowser.Opera:void 0,s=/edg/i.test(e)?exports.CurrentClientBrowser.Edge:void 0,u=/android/i.test(e)?exports.CurrentClientDevice.Android:void 0,c=/iphone/i.test(e)?exports.CurrentClientDevice.iPhone:void 0,l=/ipad/i.test(e)?exports.CurrentClientDevice.iPad:void 0,f=/ipod/i.test(e)?exports.CurrentClientDevice.iPod:void 0,v=/mac/i.test(e)?exports.CurrentClientDevice.Mac:void 0,d=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(e)?exports.CurrentClientDevice.RestMobile:void 0;return{browser:r||i||a||s||t||n||o||exports.CurrentClientBrowser.Rest,device:u||c||l||f||d||v||exports.CurrentClientDevice.Desktop}},Cn=(e=!1)=>{const t=[exports.CurrentClientDevice.iPhone,exports.CurrentClientDevice.iPad,exports.CurrentClientDevice.iPod].includes(Ze().device);if(!e)return t;const{userAgent:n,maxTouchPoints:i}=window.navigator;return!!(t||/macintosh/i.test(n)&&i>0)},jn=()=>{const{userAgent:e}=window.navigator,r=e.match(/Version\/(\d+(\.\d+)?)/i);if(!r)return null;const t=r[1],n=parseFloat(t);return isNaN(n)?null:n},Ln=()=>[exports.CurrentClientDevice.Mac,exports.CurrentClientDevice.iPhone,exports.CurrentClientDevice.iPad,exports.CurrentClientDevice.iPod].includes(Ze().device),xn=()=>{var e,r;return/Mobile|mini|Fennec|Android|iP(ad|od|hone)/.test((e=navigator.appVersion)!==null&&e!==void 0?e:navigator.userAgent)||((r=navigator==null?void 0:navigator.userAgentData)===null||r===void 0?void 0:r.mobile)},Mn=(e,{start:r=0,factor:t=2,max:n=1/0,min:i=r,random:o=0}={})=>{let a=r;return a*=Math.pow(t,e),a*=1+(Math.random()*o*2-o),a=Math.round(a),a=Math.min(a,n),a=Math.max(a,i),a};var b;(function(e){e[e.LOCAL_STORAGE=0]="LOCAL_STORAGE",e[e.SESSION_STORAGE=1]="SESSION_STORAGE",e[e.RUNTIME=2]="RUNTIME"})(b||(b={}));let E,x;const we=`vk-videoplayer-dummy-key-${Math.random()}`,Q=()=>{if(x!==void 0)return x;try{localStorage.setItem(we,"test"),localStorage.removeItem(we),x=b.LOCAL_STORAGE}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem(we),x=b.SESSION_STORAGE}catch(r){if(r instanceof DOMException||r instanceof TypeError)x=b.RUNTIME;else throw r}else throw e}return x===b.RUNTIME&&(E=new Map),x},Nn=()=>Q()===b.LOCAL_STORAGE,Dn=e=>{var r,t;const n=Q();switch(n){case b.LOCAL_STORAGE:return(r=localStorage.getItem(e))!==null&&r!==void 0?r:void 0;case b.SESSION_STORAGE:return(t=sessionStorage.getItem(e))!==null&&t!==void 0?t:void 0;case b.RUNTIME:return E==null?void 0:E.get(e);default:M(n)}},Fn=(e,r)=>{const t=Q();switch(t){case b.LOCAL_STORAGE:try{localStorage.setItem(e,r)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case b.SESSION_STORAGE:try{sessionStorage.setItem(e,r)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case b.RUNTIME:return void(E==null?void 0:E.set(e,r));default:M(t)}},Gn=e=>{var r;const t=Q();switch(t){case b.LOCAL_STORAGE:return e in localStorage;case b.SESSION_STORAGE:return e in sessionStorage;case b.RUNTIME:return(r=E==null?void 0:E.has(e))!==null&&r!==void 0?r:!1;default:return M(t),!1}},kn=e=>{const r=Q();switch(r){case b.LOCAL_STORAGE:return localStorage.removeItem(e);case b.SESSION_STORAGE:return sessionStorage.removeItem(e);case b.RUNTIME:return void(E==null?void 0:E.delete(e));default:M(r)}},Vn=()=>{const e=Q();switch(e){case b.LOCAL_STORAGE:return localStorage.clear();case b.SESSION_STORAGE:return sessionStorage.clear();case b.RUNTIME:return E==null?void 0:E.clear();default:M(e)}};var Bn=Object.freeze({__proto__:null,clear:Vn,get:Dn,has:Gn,isPersistent:Nn,remove:kn,set:Fn});const Un=()=>{let e,r;try{e=window.self!==window.top}catch(n){n instanceof DOMException&&n.name==="SecurityError"?e=!0:(e=!1,console.error(n))}try{window.location.ancestorOrigins&&(r=window.location.ancestorOrigins[window.location.ancestorOrigins.length-1])}catch(n){console.error(n)}try{!r&&document.referrer&&(r=document.referrer)}catch(n){console.error(n)}const t=r?new URL(r).hostname:void 0;return{isEmbed:e,host:t}};exports.VideoQuality=void 0;(function(e){e.INVARIANT="Invariant quality",e.Q_144P="144p",e.Q_240P="240p",e.Q_360P="360p",e.Q_480P="480p",e.Q_720P="720p",e.Q_1080P="1080p",e.Q_1440P="1440p",e.Q_2160P="2160p",e.Q_4320P="4320p"})(exports.VideoQuality||(exports.VideoQuality={}));const S={[exports.VideoQuality.Q_144P]:{width:256,height:144},[exports.VideoQuality.Q_240P]:{width:428,height:240},[exports.VideoQuality.Q_360P]:{width:640,height:360},[exports.VideoQuality.Q_480P]:{width:856,height:480},[exports.VideoQuality.Q_720P]:{width:1280,height:720},[exports.VideoQuality.Q_1080P]:{width:1920,height:1080},[exports.VideoQuality.Q_1440P]:{width:2560,height:1440},[exports.VideoQuality.Q_2160P]:{width:3840,height:2160},[exports.VideoQuality.Q_4320P]:{width:7680,height:4320}},Qn=(e,r)=>S[e].height>S[r].height,qn=(e,r)=>S[e].height>=S[r].height,er=(e,r)=>S[e].height<S[r].height,Kn=(e,r)=>S[e].height<=S[r].height,zn=e=>e.sort((r,t)=>r===t?0:r===exports.VideoQuality.INVARIANT?1:t===exports.VideoQuality.INVARIANT?-1:er(r,t)?1:-1)[0],ht=Object.keys(S).sort((e,r)=>er(e,r)?-1:1),Wn=(e,r=.02)=>[...ht].find(n=>S[n].height*(1+r)>=e),Yn=({width:e,height:r})=>{const t=Math.min(e,r),n=Math.max(e,r);return ht.find(i=>{const o=S[i];return o.width>=n&&o.height>=t})},Hn=e=>S[e].height,rr=e=>e===exports.VideoQuality.INVARIANT,Xn=e=>e.every(r=>!rr(r));function Jn(e){if(rr(e))throw new Error("Expected exact quality")}const bt=(e,r)=>{const t={};for(const n of Object.keys(r)){const i=r[n],o=e[n];Array.isArray(i)&&Array.isArray(o)?t[n]=o:typeof i=="object"&&typeof o=="object"?t[n]=bt(o,i):t[n]=n in e?o:i}return t},Zn=e=>{let r="";return e>=3600&&(r+=Math.floor(e/3600)+"h",e=e%3600),e>=60&&(r+=Math.floor(e/60)+"m",e=e%60),e>0&&(r+=Math.floor(e)+"s"),r};function pt(e,r=0,t){let n,i,o,a,s,u,c=0,l=!1,f=!1,v=!0;const d=!r&&r!==0&&typeof window.requestAnimationFrame=="function";t&&(l=!!t.leading,f="maxWait"in t,o=t!=null&&t.maxWait?Math.max(+(t==null?void 0:t.maxWait)||0,r):o,v="trailing"in t?!!t.trailing:v);function p(h){const $=n,L=i;return n=i=void 0,c=h,a=e.apply(L,$),a}function y(h,$){return d?(s&&window.cancelAnimationFrame(s),window.requestAnimationFrame(h)):setTimeout(h,$)}function O(h){if(d){window.cancelAnimationFrame(h);return}clearTimeout(h)}function m(h){return c=h,s=y(ee,r),l?p(h):a}function w(h){const $=h-u,L=h-c,gr=r-$;return f?Math.min(gr,o-L):gr}function pr(h){const $=h-u,L=h-c;return u===void 0||$>=r||$<0||f&&L>=o}function ee(){const h=Date.now();if(pr(h))return yr(h);s=y(ee,w(h))}function yr(h){return s=void 0,v&&n?p(h):(n=i=void 0,a)}function gn(){s!==void 0&&O(s),c=0,n=u=i=s=void 0}function mn(){return s===void 0?a:yr(Date.now())}function wn(){return s!==void 0}function re(...h){const $=Date.now(),L=pr($);if(n=h,i=this,u=$,L){if(s===void 0)return m(u);if(f)return s=y(ee,r),p(u)}return s===void 0&&(s=y(ee,r)),a}return re.cancel=gn,re.flush=mn,re.pending=wn,re}const yt=(e,r=0,t)=>pt(e,r,Object.assign(Object.assign(Object.assign({},{leading:!0,trailing:!0}),t),{maxWait:r})),tr=(e,r)=>{if(e===null||typeof e!="object")return e;const t=Array.isArray(e)?[]:{};for(const n in e){if(typeof r=="function"){const i=r(e[n],n,e,t);if(i!==void 0){t[n]=i;continue}}typeof e[n]=="object"?t[n]=tr(e[n],r):t[n]=e[n]}return t},ei=e=>tr(e),ri=300,ti=(e,r=ri)=>new g(t=>{const{width:n,height:i}=e.getBoundingClientRect();if(t.next({width:n,height:i}),!window.ResizeObserver)return;const o=new ResizeObserver(yt(a=>{const s=a[0];if(!s)return;let u,c;s.contentBoxSize&&s.contentBoxSize[0]?(c=s.contentBoxSize[0].blockSize,u=s.contentBoxSize[0].inlineSize):s.contentRect&&(u=s.contentRect.width,c=s.contentRect.height),de(u)&&de(c)&&t.next({width:u,height:c})},r));return o.observe(e),()=>o.disconnect()});class ni extends Je{constructor(r){super(),this.value=r}next(r){super.next(this.value=r)}error(r){super.error(this.value=r)}getValue(){return this.value}_subscribe(r){const t=super._subscribe(r);return r.next(this.value),t}}function ii(e){return new g(r=>{const t={};let n=Object.keys(e).length;const i=o=>a=>{o in t||n--,t[o]=a,n===0&&r.next(t)};return Object.entries(e).reduce((o,[a,s])=>o.add(s.subscribe(i(a))),new H)})}function oi(...e){return new g(r=>e.reduce((t,n)=>t.add(n.subscribe(r)),new H))}var ai=e=>new g(r=>{const t=window.setTimeout(()=>{try{r.next()}catch(n){if(r.error)r.error(n);else throw n}},e);return()=>window.clearTimeout(t)}),si=e=>new g(r=>{let t=window.setInterval(()=>r.next(),e);return()=>{t&&(window.clearInterval(t),t=void 0)}}),ci=e=>new g(r=>{e.forEach(t=>r.next(t))}),li=(e,r)=>new g(t=>{const n=i=>t.next(i);return e.addEventListener(r,n),()=>e.removeEventListener(r,n)});function ui(e){return r=>new g(t=>r.subscribe(new fi(t,e)))}class fi{constructor(r,t){this.destination=r,this.size=t,this.lastValues=[]}next(r){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(r),this.destination.next(this.lastValues)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}const vi={leading:!1,trailing:!0};function di(e,r=vi){return t=>new g(n=>t.subscribe(new hi(n,e,r)))}class hi{constructor(r,t,n){this.destination=r,this.time=t,this.config=n}next(r){this.lastValue=r,de(this.timeout)?window.clearTimeout(this.timeout):this.config.leading&&this.destination.next(r),this.timeout=window.setTimeout(()=>{if(this.config.trailing)try{this.destination.next(this.lastValue)}catch(t){if(this.destination.error)this.destination.error(t);else throw t}this.timeout=void 0},this.time)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}const bi={leading:!0,trailing:!1};function pi(e,r=bi){return t=>new g(n=>t.subscribe(new yi(n,e,r)))}class yi{constructor(r,t,n){this.destination=r,this.time=t,this.config=n}next(r){this.lastValue=r,vt(this.timeout)&&(this.config.leading&&this.destination.next(r),this.timeout=window.setTimeout(()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0},this.time))}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function gi(e){return r=>new g(t=>r.subscribe(new mi(t,e)))}class mi{constructor(r,t){this.destination=r,this.predicate=t}next(r){let t;try{t=this.predicate(r)}catch(n){throw this.error(n),n}t&&this.destination.next(r)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function wi(e=(r,t)=>r===t){return r=>new g(t=>r.subscribe(new Oi(t,e)))}const mr={};class Oi{constructor(r,t){this.destination=r,this.predicate=t,this.lastValue=mr}next(r){let t;try{t=this.lastValue===mr||!this.predicate(this.lastValue,r),this.lastValue=r}catch(n){throw this.error(n),n}t&&this.destination.next(r)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function gt(e){return r=>new g(t=>r.subscribe(new Ei(t,e)))}let Ei=class{constructor(r,t){this.destination=r,this.mapper=t}next(r){let t;try{t=this.mapper(r)}catch(n){throw this.error(n),n}this.destination.next(t)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}};function Si(e){return gt(()=>e)}function $i(){return e=>new g(r=>{let t=!1,n=!1;const i=e.subscribe(o=>{t||(t=!0,r.next(o)),n&&i.unsubscribe()},o=>{var a;t=!0,(a=r.error)===null||a===void 0||a.call(r,o),n&&i.unsubscribe()});return n=!0,t&&i.unsubscribe(),i})}function Ti(){return e=>new g(r=>e.subscribe(new Ii(r)))}class Ii{constructor(r){this.destination=r,this.hasLast=!1}next(r){const t=this.last;if(this.last=r,!this.hasLast){this.hasLast=!0;return}this.destination.next([t,r])}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function Ri(e){return r=>new g(t=>r.subscribe(new Pi(t,e)))}class Pi{constructor(r,t){this.destination=r,this.effect=t}next(r){try{this.effect(r)}catch(t){throw this.error(t),t}this.destination.next(r)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}exports.ErrorCategory=void 0;(function(e){e.NETWORK="network",e.VIDEO_PIPELINE="video_pipeline",e.EXTERNAL_API="external_api",e.PARSER="parser",e.DOM="dom",e.WTF="wtf",e.FATAL="fatal"})(exports.ErrorCategory||(exports.ErrorCategory={}));class wr{constructor(){Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}addEventListener(r,t,n){r in this.listeners||(this.listeners[r]=[]),this.listeners[r].push({callback:t,options:n})}removeEventListener(r,t){if(!(r in this.listeners))return;const n=this.listeners[r];for(let i=0,o=n.length;i<o;i++)if(n[i].callback===t){n.splice(i,1);return}}dispatchEvent(r){if(!(r.type in this.listeners))return;const n=this.listeners[r.type].slice();for(let i=0,o=n.length;i<o;i++){const a=n[i];try{a.callback.call(this,r)}catch(s){Promise.resolve().then(()=>{throw s})}a.options&&a.options.once&&this.removeEventListener(r.type,a.callback)}return!r.defaultPrevented}}class mt extends wr{constructor(){super(),this.listeners||wr.call(this),Object.defineProperty(this,"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"onabort",{value:null,writable:!0,configurable:!0}),Object.defineProperty(this,"reason",{value:void 0,writable:!0,configurable:!0})}toString(){return"[object AbortSignal]"}dispatchEvent(r){r.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,r)),super.dispatchEvent(r)}}class _i{constructor(){Object.defineProperty(this,"signal",{value:new mt,writable:!0,configurable:!0})}abort(r){let t;try{t=new Event("abort")}catch(i){typeof document!="undefined"?document.createEvent?(t=document.createEvent("Event"),t.initEvent("abort",!1,!1)):(t=document.createEventObject(),t.type="abort"):t={type:"abort",bubbles:!1,cancelable:!1}}let n=r;if(n===void 0)if(typeof document=="undefined")n=new Error("This operation was aborted"),n.name="AbortError";else try{n=new DOMException("signal is aborted without reason")}catch(i){n=new Error("This operation was aborted"),n.name="AbortError"}this.signal.reason=n,this.signal.dispatchEvent(t)}toString(){return"[object AbortController]"}}typeof Symbol!="undefined"&&Symbol.toStringTag&&(_i.prototype[Symbol.toStringTag]="AbortController",mt.prototype[Symbol.toStringTag]="AbortSignal");function wt(e){return e.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):typeof e.Request=="function"&&!e.Request.prototype.hasOwnProperty("signal")||!e.AbortController}function Ai(e){typeof e=="function"&&(e={fetch:e});const{fetch:r,Request:t=r.Request,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:i=!1}=e;if(!wt({fetch:r,Request:t,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:i}))return{fetch:r,Request:o};let o=t;(o&&!o.prototype.hasOwnProperty("signal")||i)&&(o=function(c,l){let f;l&&l.signal&&(f=l.signal,delete l.signal);const v=new t(c,l);return f&&Object.defineProperty(v,"signal",{writable:!1,enumerable:!1,configurable:!0,value:f}),v},o.prototype=t.prototype);const a=r;return{fetch:(u,c)=>{const l=o&&o.prototype.isPrototypeOf(u)?u.signal:c?c.signal:void 0;if(l){let f;try{f=new DOMException("Aborted","AbortError")}catch(d){f=new Error("Aborted"),f.name="AbortError"}if(l.aborted)return Promise.reject(f);const v=new Promise((d,p)=>{l.addEventListener("abort",()=>p(f),{once:!0})});return c&&c.signal&&delete c.signal,Promise.race([v,a(u,c)])}return a(u,c)},Request:o}}const nr=wt({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),Ot=nr?Ai({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,Ci=nr?Ot.fetch:window.fetch;nr?Ot.Request:window.Request;var Oe=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function ji(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var A=function(e){try{return!!e()}catch(r){return!0}},Li=A,ye=!Li(function(){var e=function(){}.bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),Et=ye,St=Function.prototype,Ue=St.call,xi=Et&&St.bind.bind(Ue,Ue),N=Et?xi:function(e){return function(){return Ue.apply(e,arguments)}},$t=N,Mi=$t({}.toString),Ni=$t("".slice),ir=function(e){return Ni(Mi(e),8,-1)},Di=N,Fi=A,Gi=ir,Ee=Object,ki=Di("".split),Vi=Fi(function(){return!Ee("z").propertyIsEnumerable(0)})?function(e){return Gi(e)=="String"?ki(e,""):Ee(e)}:Ee,or=function(e){return e==null},Bi=or,Ui=TypeError,Tt=function(e){if(Bi(e))throw Ui("Can't call method on "+e);return e},Qi=Vi,qi=Tt,X=function(e){return Qi(qi(e))},q={},te=function(e){return e&&e.Math==Math&&e},I=te(typeof globalThis=="object"&&globalThis)||te(typeof window=="object"&&window)||te(typeof self=="object"&&self)||te(typeof Oe=="object"&&Oe)||function(){return this}()||Oe||Function("return this")(),Qe=typeof document=="object"&&document.all,Ki=typeof Qe=="undefined"&&Qe!==void 0,It={all:Qe,IS_HTMLDDA:Ki},Rt=It,zi=Rt.all,R=Rt.IS_HTMLDDA?function(e){return typeof e=="function"||e===zi}:function(e){return typeof e=="function"},Wi=I,Yi=R,Or=Wi.WeakMap,Hi=Yi(Or)&&/native code/.test(String(Or)),Er=R,Pt=It,Xi=Pt.all,K=Pt.IS_HTMLDDA?function(e){return typeof e=="object"?e!==null:Er(e)||e===Xi}:function(e){return typeof e=="object"?e!==null:Er(e)},Ji=A,D=!Ji(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),z={},Zi=I,Sr=K,qe=Zi.document,eo=Sr(qe)&&Sr(qe.createElement),_t=function(e){return eo?qe.createElement(e):{}},ro=D,to=A,no=_t,At=!ro&&!to(function(){return Object.defineProperty(no("div"),"a",{get:function(){return 7}}).a!=7}),io=D,oo=A,Ct=io&&oo(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42}),ao=K,so=String,co=TypeError,W=function(e){if(ao(e))return e;throw co(so(e)+" is not an object")},lo=ye,ne=Function.prototype.call,F=lo?ne.bind(ne):function(){return ne.apply(ne,arguments)},ar={},Se=ar,$e=I,uo=R,$r=function(e){return uo(e)?e:void 0},jt=function(e,r){return arguments.length<2?$r(Se[e])||$r($e[e]):Se[e]&&Se[e][r]||$e[e]&&$e[e][r]},fo=N,Lt=fo({}.isPrototypeOf),vo=typeof navigator!="undefined"&&String(navigator.userAgent)||"",xt=I,Te=vo,Tr=xt.process,Ir=xt.Deno,Rr=Tr&&Tr.versions||Ir&&Ir.version,Pr=Rr&&Rr.v8,T,he;Pr&&(T=Pr.split("."),he=T[0]>0&&T[0]<4?1:+(T[0]+T[1]));!he&&Te&&(T=Te.match(/Edge\/(\d+)/),(!T||T[1]>=74)&&(T=Te.match(/Chrome\/(\d+)/),T&&(he=+T[1])));var ho=he,_r=ho,bo=A,po=I,yo=po.String,Mt=!!Object.getOwnPropertySymbols&&!bo(function(){var e=Symbol();return!yo(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&_r&&_r<41}),go=Mt,Nt=go&&!Symbol.sham&&typeof Symbol.iterator=="symbol",mo=jt,wo=R,Oo=Lt,Eo=Nt,So=Object,Dt=Eo?function(e){return typeof e=="symbol"}:function(e){var r=mo("Symbol");return wo(r)&&Oo(r.prototype,So(e))},$o=String,sr=function(e){try{return $o(e)}catch(r){return"Object"}},To=R,Io=sr,Ro=TypeError,cr=function(e){if(To(e))return e;throw Ro(Io(e)+" is not a function")},Po=cr,_o=or,lr=function(e,r){var t=e[r];return _o(t)?void 0:Po(t)},Ie=F,Re=R,Pe=K,Ao=TypeError,Co=function(e,r){var t,n;if(r==="string"&&Re(t=e.toString)&&!Pe(n=Ie(t,e))||Re(t=e.valueOf)&&!Pe(n=Ie(t,e))||r!=="string"&&Re(t=e.toString)&&!Pe(n=Ie(t,e)))return n;throw Ao("Can't convert object to primitive value")},Ft={exports:{}},Ar=I,jo=Object.defineProperty,Lo=function(e,r){try{jo(Ar,e,{value:r,configurable:!0,writable:!0})}catch(t){Ar[e]=r}return r},xo=I,Mo=Lo,Cr="__core-js_shared__",No=xo[Cr]||Mo(Cr,{}),Gt=No,jr=Gt;(Ft.exports=function(e,r){return jr[e]||(jr[e]=r!==void 0?r:{})})("versions",[]).push({version:"3.31.0",mode:"pure",copyright:"\xA9 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.31.0/LICENSE",source:"https://github.com/zloirock/core-js"});var kt=Ft.exports,Do=Tt,Fo=Object,Vt=function(e){return Fo(Do(e))},Go=N,ko=Vt,Vo=Go({}.hasOwnProperty),j=Object.hasOwn||function(r,t){return Vo(ko(r),t)},Bo=N,Uo=0,Qo=Math.random(),qo=Bo(1 .toString),Bt=function(e){return"Symbol("+(e===void 0?"":e)+")_"+qo(++Uo+Qo,36)},Ko=I,zo=kt,Lr=j,Wo=Bt,Yo=Mt,Ho=Nt,U=Ko.Symbol,_e=zo("wks"),Xo=Ho?U.for||U:U&&U.withoutSetter||Wo,C=function(e){return Lr(_e,e)||(_e[e]=Yo&&Lr(U,e)?U[e]:Xo("Symbol."+e)),_e[e]},Jo=F,xr=K,Mr=Dt,Zo=lr,ea=Co,ra=C,ta=TypeError,na=ra("toPrimitive"),ia=function(e,r){if(!xr(e)||Mr(e))return e;var t=Zo(e,na),n;if(t){if(r===void 0&&(r="default"),n=Jo(t,e,r),!xr(n)||Mr(n))return n;throw ta("Can't convert object to primitive value")}return r===void 0&&(r="number"),ea(e,r)},oa=ia,aa=Dt,ur=function(e){var r=oa(e,"string");return aa(r)?r:r+""},sa=D,ca=At,la=Ct,ie=W,Nr=ur,ua=TypeError,Ae=Object.defineProperty,fa=Object.getOwnPropertyDescriptor,Ce="enumerable",je="configurable",Le="writable";z.f=sa?la?function(r,t,n){if(ie(r),t=Nr(t),ie(n),typeof r=="function"&&t==="prototype"&&"value"in n&&Le in n&&!n[Le]){var i=fa(r,t);i&&i[Le]&&(r[t]=n.value,n={configurable:je in n?n[je]:i[je],enumerable:Ce in n?n[Ce]:i[Ce],writable:!1})}return Ae(r,t,n)}:Ae:function(r,t,n){if(ie(r),t=Nr(t),ie(n),ca)try{return Ae(r,t,n)}catch(i){}if("get"in n||"set"in n)throw ua("Accessors not supported");return"value"in n&&(r[t]=n.value),r};var ge=function(e,r){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:r}},va=D,da=z,ha=ge,J=va?function(e,r,t){return da.f(e,r,ha(1,t))}:function(e,r,t){return e[r]=t,e},ba=kt,pa=Bt,Dr=ba("keys"),fr=function(e){return Dr[e]||(Dr[e]=pa(e))},vr={},ya=Hi,Ut=I,ga=K,ma=J,xe=j,Me=Gt,wa=fr,Oa=vr,Fr="Object already initialized",Ke=Ut.TypeError,Ea=Ut.WeakMap,be,Y,pe,Sa=function(e){return pe(e)?Y(e):be(e,{})},$a=function(e){return function(r){var t;if(!ga(r)||(t=Y(r)).type!==e)throw Ke("Incompatible receiver, "+e+" required");return t}};if(ya||Me.state){var P=Me.state||(Me.state=new Ea);P.get=P.get,P.has=P.has,P.set=P.set,be=function(e,r){if(P.has(e))throw Ke(Fr);return r.facade=e,P.set(e,r),r},Y=function(e){return P.get(e)||{}},pe=function(e){return P.has(e)}}else{var G=wa("state");Oa[G]=!0,be=function(e,r){if(xe(e,G))throw Ke(Fr);return r.facade=e,ma(e,G,r),r},Y=function(e){return xe(e,G)?e[G]:{}},pe=function(e){return xe(e,G)}}var Ta={set:be,get:Y,has:pe,enforce:Sa,getterFor:$a},Ia=ye,Qt=Function.prototype,Gr=Qt.apply,kr=Qt.call,Ra=typeof Reflect=="object"&&Reflect.apply||(Ia?kr.bind(Gr):function(){return kr.apply(Gr,arguments)}),Pa=ir,_a=N,qt=function(e){if(Pa(e)==="Function")return _a(e)},Kt={},zt={},Wt={}.propertyIsEnumerable,Yt=Object.getOwnPropertyDescriptor,Aa=Yt&&!Wt.call({1:2},1);zt.f=Aa?function(r){var t=Yt(this,r);return!!t&&t.enumerable}:Wt;var Ca=D,ja=F,La=zt,xa=ge,Ma=X,Na=ur,Da=j,Fa=At,Vr=Object.getOwnPropertyDescriptor;Kt.f=Ca?Vr:function(r,t){if(r=Ma(r),t=Na(t),Fa)try{return Vr(r,t)}catch(n){}if(Da(r,t))return xa(!ja(La.f,r,t),r[t])};var Ga=A,ka=R,Va=/#|\.prototype\./,Z=function(e,r){var t=Ua[Ba(e)];return t==qa?!0:t==Qa?!1:ka(r)?Ga(r):!!r},Ba=Z.normalize=function(e){return String(e).replace(Va,".").toLowerCase()},Ua=Z.data={},Qa=Z.NATIVE="N",qa=Z.POLYFILL="P",Ka=Z,Br=qt,za=cr,Wa=ye,Ya=Br(Br.bind),Ht=function(e,r){return za(e),r===void 0?e:Wa?Ya(e,r):function(){return e.apply(r,arguments)}},oe=I,Ha=Ra,Xa=qt,Ja=R,Za=Kt.f,es=Ka,k=ar,rs=Ht,V=J,Ur=j,ts=function(e){var r=function(t,n,i){if(this instanceof r){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,i)}return Ha(e,this,arguments)};return r.prototype=e.prototype,r},Xt=function(e,r){var t=e.target,n=e.global,i=e.stat,o=e.proto,a=n?oe:i?oe[t]:(oe[t]||{}).prototype,s=n?k:k[t]||V(k,t,{})[t],u=s.prototype,c,l,f,v,d,p,y,O,m;for(v in r)c=es(n?v:t+(i?".":"#")+v,e.forced),l=!c&&a&&Ur(a,v),p=s[v],l&&(e.dontCallGetSet?(m=Za(a,v),y=m&&m.value):y=a[v]),d=l&&y?y:r[v],!(l&&typeof p==typeof d)&&(e.bind&&l?O=rs(d,oe):e.wrap&&l?O=ts(d):o&&Ja(d)?O=Xa(d):O=d,(e.sham||d&&d.sham||p&&p.sham)&&V(O,"sham",!0),V(s,v,O),o&&(f=t+"Prototype",Ur(k,f)||V(k,f,{}),V(k[f],v,d),e.real&&u&&(c||!u[v])&&V(u,v,d)))},ze=D,ns=j,Jt=Function.prototype,is=ze&&Object.getOwnPropertyDescriptor,dr=ns(Jt,"name"),os=dr&&function(){}.name==="something",as=dr&&(!ze||ze&&is(Jt,"name").configurable),ss={EXISTS:dr,PROPER:os,CONFIGURABLE:as},Zt={},cs=Math.ceil,ls=Math.floor,us=Math.trunc||function(r){var t=+r;return(t>0?ls:cs)(t)},fs=us,en=function(e){var r=+e;return r!==r||r===0?0:fs(r)},vs=en,ds=Math.max,hs=Math.min,bs=function(e,r){var t=vs(e);return t<0?ds(t+r,0):hs(t,r)},ps=en,ys=Math.min,gs=function(e){return e>0?ys(ps(e),9007199254740991):0},ms=gs,rn=function(e){return ms(e.length)},ws=X,Os=bs,Es=rn,Qr=function(e){return function(r,t,n){var i=ws(r),o=Es(i),a=Os(n,o),s;if(e&&t!=t){for(;o>a;)if(s=i[a++],s!=s)return!0}else for(;o>a;a++)if((e||a in i)&&i[a]===t)return e||a||0;return!e&&-1}},Ss={includes:Qr(!0),indexOf:Qr(!1)},$s=N,Ne=j,Ts=X,Is=Ss.indexOf,Rs=vr,qr=$s([].push),Ps=function(e,r){var t=Ts(e),n=0,i=[],o;for(o in t)!Ne(Rs,o)&&Ne(t,o)&&qr(i,o);for(;r.length>n;)Ne(t,o=r[n++])&&(~Is(i,o)||qr(i,o));return i},tn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],_s=Ps,As=tn,Cs=Object.keys||function(r){return _s(r,As)},js=D,Ls=Ct,xs=z,Ms=W,Ns=X,Ds=Cs;Zt.f=js&&!Ls?Object.defineProperties:function(r,t){Ms(r);for(var n=Ns(t),i=Ds(t),o=i.length,a=0,s;o>a;)xs.f(r,s=i[a++],n[s]);return r};var Fs=jt,Gs=Fs("document","documentElement"),ks=W,Vs=Zt,Kr=tn,Bs=vr,Us=Gs,Qs=_t,qs=fr,zr=">",Wr="<",We="prototype",Ye="script",nn=qs("IE_PROTO"),De=function(){},on=function(e){return Wr+Ye+zr+e+Wr+"/"+Ye+zr},Yr=function(e){e.write(on("")),e.close();var r=e.parentWindow.Object;return e=null,r},Ks=function(){var e=Qs("iframe"),r="java"+Ye+":",t;return e.style.display="none",Us.appendChild(e),e.src=String(r),t=e.contentWindow.document,t.open(),t.write(on("document.F=Object")),t.close(),t.F},ae,ue=function(){try{ae=new ActiveXObject("htmlfile")}catch(r){}ue=typeof document!="undefined"?document.domain&&ae?Yr(ae):Ks():Yr(ae);for(var e=Kr.length;e--;)delete ue[We][Kr[e]];return ue()};Bs[nn]=!0;var an=Object.create||function(r,t){var n;return r!==null?(De[We]=ks(r),n=new De,De[We]=null,n[nn]=r):n=ue(),t===void 0?n:Vs.f(n,t)},zs=A,Ws=!zs(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),Ys=j,Hs=R,Xs=Vt,Js=fr,Zs=Ws,Hr=Js("IE_PROTO"),He=Object,ec=He.prototype,sn=Zs?He.getPrototypeOf:function(e){var r=Xs(e);if(Ys(r,Hr))return r[Hr];var t=r.constructor;return Hs(t)&&r instanceof t?t.prototype:r instanceof He?ec:null},rc=J,cn=function(e,r,t,n){return n&&n.enumerable?e[r]=t:rc(e,r,t),e},tc=A,nc=R,ic=K,oc=an,Xr=sn,ac=cn,sc=C,Xe=sc("iterator"),ln=!1,_,Fe,Ge;[].keys&&(Ge=[].keys(),"next"in Ge?(Fe=Xr(Xr(Ge)),Fe!==Object.prototype&&(_=Fe)):ln=!0);var cc=!ic(_)||tc(function(){var e={};return _[Xe].call(e)!==e});cc?_={}:_=oc(_);nc(_[Xe])||ac(_,Xe,function(){return this});var un={IteratorPrototype:_,BUGGY_SAFARI_ITERATORS:ln},lc=C,uc=lc("toStringTag"),fn={};fn[uc]="z";var hr=String(fn)==="[object z]",fc=hr,vc=R,fe=ir,dc=C,hc=dc("toStringTag"),bc=Object,pc=fe(function(){return arguments}())=="Arguments",yc=function(e,r){try{return e[r]}catch(t){}},br=fc?fe:function(e){var r,t,n;return e===void 0?"Undefined":e===null?"Null":typeof(t=yc(r=bc(e),hc))=="string"?t:pc?fe(r):(n=fe(r))=="Object"&&vc(r.callee)?"Arguments":n},gc=hr,mc=br,wc=gc?{}.toString:function(){return"[object "+mc(this)+"]"},Oc=hr,Ec=z.f,Sc=J,$c=j,Tc=wc,Ic=C,Jr=Ic("toStringTag"),vn=function(e,r,t,n){if(e){var i=t?e:e.prototype;$c(i,Jr)||Ec(i,Jr,{configurable:!0,value:r}),n&&!Oc&&Sc(i,"toString",Tc)}},Rc=un.IteratorPrototype,Pc=an,_c=ge,Ac=vn,Cc=q,jc=function(){return this},Lc=function(e,r,t,n){var i=r+" Iterator";return e.prototype=Pc(Rc,{next:_c(+!n,t)}),Ac(e,i,!1,!0),Cc[i]=jc,e},xc=Xt,Mc=F,dn=ss,Nc=Lc,Dc=sn,Fc=vn,Zr=cn,Gc=C,et=q,hn=un,kc=dn.PROPER;dn.CONFIGURABLE;hn.IteratorPrototype;var se=hn.BUGGY_SAFARI_ITERATORS,ke=Gc("iterator"),rt="keys",ce="values",tt="entries",Vc=function(){return this},Bc=function(e,r,t,n,i,o,a){Nc(t,r,n);var s=function(m){if(m===i&&v)return v;if(!se&&m in l)return l[m];switch(m){case rt:return function(){return new t(this,m)};case ce:return function(){return new t(this,m)};case tt:return function(){return new t(this,m)}}return function(){return new t(this)}},u=r+" Iterator",c=!1,l=e.prototype,f=l[ke]||l["@@iterator"]||i&&l[i],v=!se&&f||s(i),d=r=="Array"&&l.entries||f,p,y,O;if(d&&(p=Dc(d.call(new e)),p!==Object.prototype&&p.next&&(Fc(p,u,!0,!0),et[u]=Vc)),kc&&i==ce&&f&&f.name!==ce&&(c=!0,v=function(){return Mc(f,this)}),i)if(y={values:s(ce),keys:o?v:s(rt),entries:s(tt)},a)for(O in y)(se||c||!(O in l))&&Zr(l,O,y[O]);else xc({target:r,proto:!0,forced:se||c},y);return a&&l[ke]!==v&&Zr(l,ke,v,{name:i}),et[r]=v,y},Uc=function(e,r){return{value:e,done:r}},Qc=X,nt=q,bn=Ta;z.f;var qc=Bc,le=Uc,pn="Array Iterator",Kc=bn.set,zc=bn.getterFor(pn);qc(Array,"Array",function(e,r){Kc(this,{type:pn,target:Qc(e),index:0,kind:r})},function(){var e=zc(this),r=e.target,t=e.kind,n=e.index++;return!r||n>=r.length?(e.target=void 0,le(void 0,!0)):t=="keys"?le(n,!1):t=="values"?le(r[n],!1):le([n,r[n]],!1)},"values");nt.Arguments=nt.Array;var Wc=C,Yc=q,Hc=Wc("iterator"),Xc=Array.prototype,Jc=function(e){return e!==void 0&&(Yc.Array===e||Xc[Hc]===e)},Zc=br,it=lr,el=or,rl=q,tl=C,nl=tl("iterator"),yn=function(e){if(!el(e))return it(e,nl)||it(e,"@@iterator")||rl[Zc(e)]},il=F,ol=cr,al=W,sl=sr,cl=yn,ll=TypeError,ul=function(e,r){var t=arguments.length<2?cl(e):r;if(ol(t))return al(il(t,e));throw ll(sl(e)+" is not iterable")},fl=F,ot=W,vl=lr,dl=function(e,r,t){var n,i;ot(e);try{if(n=vl(e,"return"),!n){if(r==="throw")throw t;return t}n=fl(n,e)}catch(o){i=!0,n=o}if(r==="throw")throw t;if(i)throw n;return ot(n),t},hl=Ht,bl=F,pl=W,yl=sr,gl=Jc,ml=rn,at=Lt,wl=ul,Ol=yn,st=dl,El=TypeError,ve=function(e,r){this.stopped=e,this.result=r},ct=ve.prototype,Sl=function(e,r,t){var n=t&&t.that,i=!!(t&&t.AS_ENTRIES),o=!!(t&&t.IS_RECORD),a=!!(t&&t.IS_ITERATOR),s=!!(t&&t.INTERRUPTED),u=hl(r,n),c,l,f,v,d,p,y,O=function(w){return c&&st(c,"normal",w),new ve(!0,w)},m=function(w){return i?(pl(w),s?u(w[0],w[1],O):u(w[0],w[1])):s?u(w,O):u(w)};if(o)c=e.iterator;else if(a)c=e;else{if(l=Ol(e),!l)throw El(yl(e)+" is not iterable");if(gl(l)){for(f=0,v=ml(e);v>f;f++)if(d=m(e[f]),d&&at(ct,d))return d;return new ve(!1)}c=wl(e,l)}for(p=o?e.next:c.next;!(y=bl(p,c)).done;){try{d=m(y.value)}catch(w){st(c,"throw",w)}if(typeof d=="object"&&d&&at(ct,d))return d}return new ve(!1)},$l=ur,Tl=z,Il=ge,Rl=function(e,r,t){var n=$l(r);n in e?Tl.f(e,n,Il(0,t)):e[n]=t},Pl=Xt,_l=Sl,Al=Rl;Pl({target:"Object",stat:!0},{fromEntries:function(r){var t={};return _l(r,function(n,i){Al(t,n,i)},{AS_ENTRIES:!0}),t}});var Cl=ar,jl=Cl.Object.fromEntries,Ll={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},xl=Ll,Ml=I,Nl=br,Dl=J,lt=q,Fl=C,ut=Fl("toStringTag");for(var Ve in xl){var ft=Ml[Ve],Be=ft&&ft.prototype;Be&&Nl(Be)!==ut&&Dl(Be,ut,Ve),lt[Ve]=lt.Array}var Gl=jl,kl=Gl,Vl=kl,Bl=Vl,Ul=ji(Bl);exports.VKNumericLanguage=void 0;(function(e){e.Armenian="58",e.Azerbaijani="57",e.Belarusian="114",e.English="3",e.Kazakh="97",e.Portuguese="73",e.Russian="0",e.Spanish="4",e.Ukrainian="1",e.Uzbek="65",e.Vietnamese="75"})(exports.VKNumericLanguage||(exports.VKNumericLanguage={}));const Ql="vk.com",ql=(e,r,t)=>dt(void 0,void 0,void 0,function*(){const n=new URL(`https://${Ql}/js/lang-pack.js`);n.searchParams.set("format","json"),n.searchParams.set("name",r),e!==void 0&&n.searchParams.set("lang",e);const o=yield(yield Ci(n.toString())).json();return Kl(o,t)}),Kl=(e,r)=>Ul(Object.entries(e.keys).map(([t,n])=>[t.substring(`${r}_`.length),zl(n)])),zl=e=>Array.isArray(e)?e[0]:e;exports.InterfaceLanguage=void 0;(function(e){e.RU="ru",e.EN="en"})(exports.InterfaceLanguage||(exports.InterfaceLanguage={}));exports.Logger=Sn;exports.Observable=g;exports.Subject=Je;exports.Subscription=H;exports.VERSION=On;exports.ValueSubject=ni;exports.abortable=An;exports.addScript=Pn;exports.areQualitiesExact=Xn;exports.assertEmptyArray=Rn;exports.assertNever=M;exports.assertNonNullable=$n;exports.assertNotEmptyArray=In;exports.assertNullable=Tn;exports.assertQualityIsExact=Jn;exports.buffer=ui;exports.checkNever=En;exports.cloneDeep=ei;exports.cloneDeepWith=tr;exports.combine=ii;exports.debounce=di;exports.debounceFn=pt;exports.detectEmbed=Un;exports.fillWithDefault=bt;exports.filter=gi;exports.filterChanged=wi;exports.fromEvent=li;exports.getCurrentBrowser=Ze;exports.getExponentialDelay=Mn;exports.getHighestQuality=zn;exports.getIOSVersion=jn;exports.interval=si;exports.isHigher=Qn;exports.isHigherOrEqual=qn;exports.isIOS=Cn;exports.isInvariantQuality=rr;exports.isLower=er;exports.isLowerOrEqual=Kn;exports.isMacLike=Ln;exports.isMobile=xn;exports.isNonNullable=de;exports.isNullable=vt;exports.loadVKLangPack=ql;exports.map=gt;exports.mapTo=Si;exports.merge=oi;exports.noop=B;exports.now=_n;exports.observableFrom=ci;exports.observeElementSize=ti;exports.once=$i;exports.pairwise=Ti;exports.safeStorage=Bn;exports.tap=Ri;exports.throttle=pi;exports.throttleFn=yt;exports.timeCodeToString=Zn;exports.timeout=ai;exports.videoHeightToQuality=Wn;exports.videoQualityToHeight=Hn;exports.videoSizeToQuality=Yn;
6
+ "use strict";var V=Object.defineProperty,dt=Object.defineProperties,ft=Object.getOwnPropertyDescriptor,mt=Object.getOwnPropertyDescriptors,Tt=Object.getOwnPropertyNames,Ie=Object.getOwnPropertySymbols;var he=Object.prototype.hasOwnProperty,vt=Object.prototype.propertyIsEnumerable;var ge=Math.pow,xe=(t,e,r)=>e in t?V(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,w=(t,e)=>{for(var r in e||(e={}))he.call(e,r)&&xe(t,r,e[r]);if(Ie)for(var r of Ie(e))vt.call(e,r)&&xe(t,r,e[r]);return t},Q=(t,e)=>dt(t,mt(e));var ye=(t,e)=>{for(var r in e)V(t,r,{get:e[r],enumerable:!0})},It=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Tt(e))!he.call(t,i)&&i!==r&&V(t,i,{get:()=>e[i],enumerable:!(n=ft(e,i))||n.enumerable});return t};var xt=t=>It(V({},"__esModule",{value:!0}),t);var _=(t,e,r)=>new Promise((n,i)=>{var s=a=>{try{o(r.next(a))}catch(c){i(c)}},u=a=>{try{o(r.throw(a))}catch(c){i(c)}},o=a=>a.done?n(a.value):Promise.resolve(a.value).then(s,u);o((r=r.apply(t,e)).next())});var Nt={};ye(Nt,{CurrentClientBrowser:()=>H,CurrentClientDevice:()=>K,ErrorCategory:()=>ot,InterfaceLanguage:()=>st,Logger:()=>D,Observable:()=>l,Subject:()=>x,Subscription:()=>m,VERSION:()=>Oe,VKNumericLanguage:()=>it,ValueSubject:()=>C,VideoQuality:()=>z,abortable:()=>Pe,addScript:()=>Ce,areQualitiesExact:()=>Ke,assertEmptyArray:()=>Re,assertNever:()=>I,assertNonNullable:()=>Ee,assertNotEmptyArray:()=>Ae,assertNullable:()=>Se,assertQualityIsExact:()=>$e,buffer:()=>Z,checkNever:()=>we,cloneDeep:()=>Xe,cloneDeepWith:()=>R,combine:()=>Y,debounce:()=>te,debounceFn:()=>W,detectEmbed:()=>Ue,fillWithDefault:()=>Ye,filter:()=>ie,filterChanged:()=>ae,fromEvent:()=>rt,getCurrentBrowser:()=>A,getExponentialDelay:()=>De,getHighestQuality:()=>Be,getIOSVersion:()=>Ne,interval:()=>et,isAndroid:()=>Ve,isHigher:()=>Fe,isHigherOrEqual:()=>ze,isIOS:()=>Me,isInvariantQuality:()=>B,isLower:()=>j,isLowerOrEqual:()=>je,isMacLike:()=>Qe,isMobile:()=>_e,isNonNullable:()=>y,isNullable:()=>U,loadVKLangPack:()=>Lt,map:()=>k,mapTo:()=>ue,merge:()=>X,noop:()=>h,now:()=>Le,observableFrom:()=>tt,observeElementSize:()=>Je,once:()=>ce,pairwise:()=>be,safeStorage:()=>F,tap:()=>fe,throttle:()=>ne,throttleFn:()=>G,timeCodeToString:()=>St,timeout:()=>Ze,videoHeightToQuality:()=>Ge,videoQualityToHeight:()=>He,videoSizeToQuality:()=>qe});module.exports=xt(Nt);var Oe="1.0.37-beta.0";var m=class{constructor(){this.subscriptions=[]}unsubscribe(){let e=this.subscriptions;this.subscriptions=[],e.forEach(r=>typeof r=="function"?r():r.unsubscribe())}add(e){return this.subscriptions.push(e),this}};var I=t=>{throw new Error(`${t} is value of unexpected type`)},we=t=>{};var h=()=>{};var l=class{constructor(e){e&&(this._subscribe=e)}subscribe(e,r){var u;let n;r?typeof r=="function"?n={next:r,error:h}:n={next:o=>r.next(o),error:o=>{var a;return(a=r.error)==null?void 0:a.call(r,o)}}:n={next:h,error:h};let i=typeof e=="function"?{next:o=>{try{e(o)}catch(a){n.next(a)}},error:o=>n.next(o)}:{next:o=>e.next(o),error:o=>e.error?e.error(o):n.next(o)},s;try{s=this._subscribe(i)}catch(o){(u=i.error)==null||u.call(i,o)}return new m().add(()=>{switch(i.next=h,i.error=h,typeof s){case"function":s();return;case"object":s.unsubscribe();return;case"undefined":return;default:return I(s)}})}pipe(...e){return e.reduce((r,n)=>n(r),this)}_subscribe(e){}};var x=class extends l{constructor(){super();this.keyCounter=0;this.subscribers=new Map}next(r){this.subscribers.forEach(n=>n.next(r))}error(r){this.subscribers.forEach(n=>{var i;return(i=n.error)==null?void 0:i.call(n,r)})}_subscribe(r){let n=this.keyCounter++;return this.subscribers.set(n,r),new m().add(()=>this.subscribers.delete(n))}};var D=class{constructor(){this.log$=new x;this.logs=[];this.log=e=>{let r=Q(w({},e),{timestamp:Date.now()});this.logs.push(r),this.log$.next(r)};this.getAllLogs=()=>this.logs}createCustomLog(e){return(...r)=>{let n;try{n=e(...r)}catch(i){n={message:"error in `createCustomLog`",component:"Logger"}}this.log(n)}}createComponentLog(e){return this.createCustomLog(r=>w({component:e},r))}};function Ee(t,e='Assertion "value is not nullable" failed'){if(t==null)throw new Error(e)}function Se(t,e='Assertion "value is nullable" failed'){if(t!=null)throw new Error(e)}function y(t){return typeof t!="undefined"&&t!==null}function U(t){return t==null}function Ae(t,e){if(!(t!=null&&t.length))throw new Error(e)}function Re(t,e){if(t!=null&&t.length)throw new Error(e)}var Ce=(t,e,r)=>new Promise((n,i)=>{e.addEventListener("abort",()=>{o(),c.remove()});let s=()=>{o(),i()},u=()=>{o(),n()},o=()=>{a&&clearTimeout(a),c.removeEventListener("load",u),c.removeEventListener("error",s)},a;r&&(a=window.setTimeout(s,r));let c=document.createElement("script");c.addEventListener("load",u),c.addEventListener("error",s),c.src=t,document.head.appendChild(c)});var ke,Le=typeof((ke=window.performance)==null?void 0:ke.now)=="function"?()=>window.performance.now():()=>Date.now();var Pe=(t,e)=>(...r)=>_(void 0,null,function*(){var u;let n=e(...r),i=t.aborted,s;for(;!i&&!t.aborted;)try{let o=yield n.next(s);i=(u=o.done)!=null?u:!1,s=o.value}catch(o){yield n.throw(o)}return s});var H=(c=>(c.Unknown="Unknown",c.Yandex="Yandex",c.Chrome="Chrome",c.Chromium="Chromium",c.Firefox="Firefox",c.Safari="Safari",c.Opera="Opera",c.Edge="Edge",c.Rest="Rest",c))(H||{}),K=(a=>(a.Unknown="Unknown",a.Android="Android",a.iPhone="iPhone",a.iPad="iPad",a.iPod="iPod",a.RestMobile="RestMobile",a.Mac="Mac",a.Desktop="Desktop",a))(K||{}),A=()=>{let{userAgent:t}=window.navigator,e=/yabrowser/i.test(t)?"Yandex":void 0,r=/chrome|crios/i.test(t)?"Chrome":void 0,n=/chromium/i.test(t)?"Chromium":void 0,i=/firefox|fxios/i.test(t)?"Firefox":void 0,s=/webkit|safari|khtml/i.test(t)?"Safari":void 0,u=/opr\//i.test(t)?"Opera":void 0,o=/edg/i.test(t)?"Edge":void 0,a=/android/i.test(t)?"Android":void 0,c=/iphone/i.test(t)?"iPhone":void 0,f=/ipad/i.test(t)?"iPad":void 0,b=/ipod/i.test(t)?"iPod":void 0,S=/mac/i.test(t)?"Mac":void 0,L=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(t)?"RestMobile":void 0;return{browser:e||i||u||o||r||n||s||"Rest",device:a||c||f||b||L||S||"Desktop"}},Me=(t=!1)=>{let r=["iPhone","iPad","iPod"].includes(A().device);if(!t)return r;let{userAgent:n,maxTouchPoints:i}=window.navigator;return!!(r||/macintosh/i.test(n)&&i>0)},Ne=()=>{let{userAgent:t}=window.navigator,e=t.match(/Version\/(\d+(\.\d+)?)/i);if(!e)return null;let r=e[1],n=parseFloat(r);return isNaN(n)?null:n},Ve=()=>A().device==="Android",Qe=()=>["Mac","iPhone","iPad","iPod"].includes(A().device),_e=()=>{var t,e;return/Mobile|mini|Fennec|Android|iP(ad|od|hone)/.test((t=navigator.appVersion)!=null?t:navigator.userAgent)||((e=navigator==null?void 0:navigator.userAgentData)==null?void 0:e.mobile)};var De=(t,{start:e=0,factor:r=2,max:n=1/0,min:i=e,random:s=0}={})=>{let u=e;return u*=ge(r,t),u*=1+(Math.random()*s*2-s),u=Math.round(u),u=Math.min(u,n),u=Math.max(u,i),u};var F={};ye(F,{clear:()=>Et,get:()=>gt,has:()=>Ot,isPersistent:()=>ht,remove:()=>wt,set:()=>yt});var d,O,$=`vk-videoplayer-dummy-key-${Math.random()}`,E=()=>{if(O!==void 0)return O;try{localStorage.setItem($,"test"),localStorage.removeItem($),O=0}catch(t){if(t instanceof DOMException||t instanceof TypeError)try{sessionStorage.getItem($),O=1}catch(e){if(e instanceof DOMException||e instanceof TypeError)O=2;else throw e}else throw t}return O===2&&(d=new Map),O},ht=()=>E()===0,gt=t=>{var r,n;let e=E();switch(e){case 0:return(r=localStorage.getItem(t))!=null?r:void 0;case 1:return(n=sessionStorage.getItem(t))!=null?n:void 0;case 2:return d==null?void 0:d.get(t);default:I(e)}},yt=(t,e)=>{let r=E();switch(r){case 0:try{localStorage.setItem(t,e)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case 1:try{sessionStorage.setItem(t,e)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case 2:return void(d==null?void 0:d.set(t,e));default:I(r)}},Ot=t=>{var r;let e=E();switch(e){case 0:return t in localStorage;case 1:return t in sessionStorage;case 2:return(r=d==null?void 0:d.has(t))!=null?r:!1;default:return I(e),!1}},wt=t=>{let e=E();switch(e){case 0:return localStorage.removeItem(t);case 1:return sessionStorage.removeItem(t);case 2:return void(d==null?void 0:d.delete(t));default:I(e)}},Et=()=>{let t=E();switch(t){case 0:return localStorage.clear();case 1:return sessionStorage.clear();case 2:return d==null?void 0:d.clear();default:I(t)}};var Ue=()=>{let t,e;try{t=window.self!==window.top}catch(n){n instanceof DOMException&&n.name==="SecurityError"?t=!0:(t=!1,console.error(n))}try{window.location.ancestorOrigins&&(e=window.location.ancestorOrigins[window.location.ancestorOrigins.length-1])}catch(n){console.error(n)}try{!e&&document.referrer&&(e=document.referrer)}catch(n){console.error(n)}let r=e?new URL(e).hostname:void 0;return{isEmbed:t,host:r}};var z=(f=>(f.INVARIANT="Invariant quality",f.Q_144P="144p",f.Q_240P="240p",f.Q_360P="360p",f.Q_480P="480p",f.Q_720P="720p",f.Q_1080P="1080p",f.Q_1440P="1440p",f.Q_2160P="2160p",f.Q_4320P="4320p",f))(z||{});var T={"144p":{width:256,height:144},"240p":{width:428,height:240},"360p":{width:640,height:360},"480p":{width:856,height:480},"720p":{width:1280,height:720},"1080p":{width:1920,height:1080},"1440p":{width:2560,height:1440},"2160p":{width:3840,height:2160},"4320p":{width:7680,height:4320}},Fe=(t,e)=>T[t].height>T[e].height,ze=(t,e)=>T[t].height>=T[e].height,j=(t,e)=>T[t].height<T[e].height,je=(t,e)=>T[t].height<=T[e].height,Be=t=>t.sort((e,r)=>e===r?0:e==="Invariant quality"?1:r==="Invariant quality"?-1:j(e,r)?1:-1)[0],We=Object.keys(T).sort((t,e)=>j(t,e)?-1:1),Ge=(t,e=.02)=>[...We].find(n=>T[n].height*(1+e)>=t),qe=({width:t,height:e})=>{let r=Math.min(t,e),n=Math.max(t,e);return We.find(i=>{let s=T[i];return s.width>=n&&s.height>=r})},He=t=>T[t].height,B=t=>t==="Invariant quality",Ke=t=>t.every(e=>!B(e));function $e(t){if(B(t))throw new Error("Expected exact quality")}var Ye=(t,e)=>{let r={};for(let n of Object.keys(e)){let i=e[n],s=t[n];Array.isArray(i)&&Array.isArray(s)?r[n]=s:typeof i=="object"&&typeof s=="object"?r[n]=Ye(s,i):r[n]=n in t?s:i}return r};var St=t=>{let e="";return t>=3600&&(e+=Math.floor(t/3600)+"h",t=t%3600),t>=60&&(e+=Math.floor(t/60)+"m",t=t%60),t>0&&(e+=Math.floor(t)+"s"),e};function W(t,e=0,r){let n,i,s,u,o,a,c=0,f=!1,b=!1,S=!0,L=!e&&e!==0&&typeof window.requestAnimationFrame=="function";r&&(f=!!r.leading,b="maxWait"in r,s=r!=null&&r.maxWait?Math.max(+(r==null?void 0:r.maxWait)||0,e):s,S="trailing"in r?!!r.trailing:S);function q(p){let v=n,g=i;return n=i=void 0,c=p,u=t.apply(g,v),u}function P(p,v){return L?(o&&window.cancelAnimationFrame(o),window.requestAnimationFrame(p)):setTimeout(p,v)}function at(p){if(L){window.cancelAnimationFrame(p);return}clearTimeout(p)}function lt(p){return c=p,o=P(M,e),f?q(p):u}function ut(p){let v=p-a,g=p-c,ve=e-v;return b?Math.min(ve,s-g):ve}function me(p){let v=p-a,g=p-c;return a===void 0||v>=e||v<0||b&&g>=s}function M(){let p=Date.now();if(me(p))return Te(p);o=P(M,ut(p))}function Te(p){return o=void 0,S&&n?q(p):(n=i=void 0,u)}function ct(){o!==void 0&&at(o),c=0,n=a=i=o=void 0}function pt(){return o===void 0?u:Te(Date.now())}function bt(){return o!==void 0}function N(...p){let v=Date.now(),g=me(v);if(n=p,i=this,a=v,g){if(o===void 0)return lt(a);if(b)return o=P(M,e),q(a)}return o===void 0&&(o=P(M,e)),u}return N.cancel=ct,N.flush=pt,N.pending=bt,N}var G=(t,e=0,r)=>W(t,e,Q(w(w({},{leading:!0,trailing:!0}),r),{maxWait:e}));var R=(t,e)=>{if(t===null||typeof t!="object")return t;let r=Array.isArray(t)?[]:{};for(let n in t){if(typeof e=="function"){let i=e(t[n],n,t,r);if(i!==void 0){r[n]=i;continue}}typeof t[n]=="object"?r[n]=R(t[n],e):r[n]=t[n]}return r};var Xe=t=>R(t);var At=300,Je=(t,e=At)=>new l(r=>{let{width:n,height:i}=t.getBoundingClientRect();if(r.next({width:n,height:i}),!window.ResizeObserver)return;let s=new ResizeObserver(G(u=>{let o=u[0];if(!o)return;let a,c;o.contentBoxSize&&o.contentBoxSize[0]?(c=o.contentBoxSize[0].blockSize,a=o.contentBoxSize[0].inlineSize):o.contentRect&&(a=o.contentRect.width,c=o.contentRect.height),y(a)&&y(c)&&r.next({width:a,height:c})},e));return s.observe(t),()=>s.disconnect()});var C=class extends x{constructor(r){super();this.value=r}next(r){super.next(this.value=r)}error(r){super.error(this.value=r)}getValue(){return this.value}_subscribe(r){let n=super._subscribe(r);return r.next(this.value),n}};function Y(t){return new l(e=>{let r={},n=Object.keys(t).length,i=s=>u=>{s in r||n--,r[s]=u,n===0&&e.next(r)};return Object.entries(t).reduce((s,[u,o])=>s.add(o.subscribe(i(u))),new m)})}function X(...t){return new l(e=>t.reduce((r,n)=>r.add(n.subscribe(e)),new m))}var Ze=t=>new l(e=>{let r=window.setTimeout(()=>{try{e.next()}catch(n){if(e.error)e.error(n);else throw n}},t);return()=>window.clearTimeout(r)});var et=t=>new l(e=>{let r=window.setInterval(()=>e.next(),t);return()=>{r&&(window.clearInterval(r),r=void 0)}});var tt=t=>new l(e=>{t.forEach(r=>e.next(r))});var rt=(t,e)=>new l(r=>{let n=i=>r.next(i);return t.addEventListener(e,n),()=>t.removeEventListener(e,n)});function Z(t){return e=>new l(r=>e.subscribe(new J(r,t)))}var J=class{constructor(e,r){this.destination=e;this.size=r;this.lastValues=[]}next(e){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(e),this.destination.next(this.lastValues)}error(e){var r,n;(n=(r=this.destination).error)==null||n.call(r,e)}};var Rt={leading:!1,trailing:!0};function te(t,e=Rt){return r=>new l(n=>r.subscribe(new ee(n,t,e)))}var ee=class{constructor(e,r,n){this.destination=e;this.time=r;this.config=n}next(e){this.lastValue=e,y(this.timeout)?window.clearTimeout(this.timeout):this.config.leading&&this.destination.next(e),this.timeout=window.setTimeout(()=>{if(this.config.trailing)try{this.destination.next(this.lastValue)}catch(r){if(this.destination.error)this.destination.error(r);else throw r}this.timeout=void 0},this.time)}error(e){var r,n;(n=(r=this.destination).error)==null||n.call(r,e)}};var Ct={leading:!0,trailing:!1};function ne(t,e=Ct){return r=>new l(n=>r.subscribe(new re(n,t,e)))}var re=class{constructor(e,r,n){this.destination=e;this.time=r;this.config=n}next(e){this.lastValue=e,U(this.timeout)&&(this.config.leading&&this.destination.next(e),this.timeout=window.setTimeout(()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0},this.time))}error(e){var r,n;(n=(r=this.destination).error)==null||n.call(r,e)}};function ie(t){return e=>new l(r=>e.subscribe(new oe(r,t)))}var oe=class{constructor(e,r){this.destination=e;this.predicate=r}next(e){let r;try{r=this.predicate(e)}catch(n){throw this.error(n),n}r&&this.destination.next(e)}error(e){var r,n;(n=(r=this.destination).error)==null||n.call(r,e)}};function ae(t=(e,r)=>e===r){return e=>new l(r=>e.subscribe(new se(r,t)))}var nt={},se=class{constructor(e,r){this.destination=e;this.predicate=r;this.lastValue=nt}next(e){let r;try{r=this.lastValue===nt||!this.predicate(this.lastValue,e),this.lastValue=e}catch(n){throw this.error(n),n}r&&this.destination.next(e)}error(e){var r,n;(n=(r=this.destination).error)==null||n.call(r,e)}};function k(t){return e=>new l(r=>e.subscribe(new le(r,t)))}var le=class{constructor(e,r){this.destination=e;this.mapper=r}next(e){let r;try{r=this.mapper(e)}catch(n){throw this.error(n),n}this.destination.next(r)}error(e){var r,n;(n=(r=this.destination).error)==null||n.call(r,e)}};function ue(t){return k(()=>t)}function ce(){return t=>new l(e=>{let r=!1,n=!1,i=t.subscribe(s=>{r||(r=!0,e.next(s)),n&&i.unsubscribe()},s=>{var u;r=!0,(u=e.error)==null||u.call(e,s),n&&i.unsubscribe()});return n=!0,r&&i.unsubscribe(),i})}function be(){return t=>new l(e=>t.subscribe(new pe(e)))}var pe=class{constructor(e){this.destination=e;this.hasLast=!1}next(e){let r=this.last;if(this.last=e,!this.hasLast){this.hasLast=!0;return}this.destination.next([r,e])}error(e){var r,n;(n=(r=this.destination).error)==null||n.call(r,e)}};function fe(t){return e=>new l(r=>e.subscribe(new de(r,t)))}var de=class{constructor(e,r){this.destination=e;this.effect=r}next(e){try{this.effect(e)}catch(r){throw this.error(r),r}this.destination.next(e)}error(e){var r,n;(n=(r=this.destination).error)==null||n.call(r,e)}};var ot=(o=>(o.NETWORK="network",o.VIDEO_PIPELINE="video_pipeline",o.EXTERNAL_API="external_api",o.PARSER="parser",o.DOM="dom",o.WTF="wtf",o.FATAL="fatal",o))(ot||{});var it=(b=>(b.Armenian="58",b.Azerbaijani="57",b.Belarusian="114",b.English="3",b.Kazakh="97",b.Portuguese="73",b.Russian="0",b.Spanish="4",b.Ukrainian="1",b.Uzbek="65",b.Vietnamese="75",b))(it||{}),kt="vk.com",Lt=(t,e,r)=>_(void 0,null,function*(){let n=new URL(`https://${kt}/js/lang-pack.js`);n.searchParams.set("format","json"),n.searchParams.set("name",e),t!==void 0&&n.searchParams.set("lang",t);let s=yield(yield fetch(n.toString())).json();return Pt(s,r)}),Pt=(t,e)=>Object.fromEntries(Object.entries(t.keys).map(([r,n])=>[r.substring(`${e}_`.length),Mt(n)])),Mt=t=>Array.isArray(t)?t[0]:t;var st=(r=>(r.RU="ru",r.EN="en",r))(st||{});
package/es2015.esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
- * @vkontakte/videoplayer-shared v1.0.36-dev.e23ad8e3.0
3
- * Mon, 03 Jun 2024 05:52:59 GMT
4
- * https://st.mycdn.me/static/vkontakte-videoplayer/1-0-36/doc/
2
+ * @vkontakte/videoplayer-shared v1.0.37-beta.0
3
+ * Tue, 16 Jul 2024 14:55:16 GMT
4
+ * https://st.mycdn.me/static/vkontakte-videoplayer/1-0-37/doc/
5
5
  */
6
- const cl="1.0.36-dev.e23ad8e3.0";class ge{constructor(){this.subscriptions=[]}unsubscribe(){const r=this.subscriptions;this.subscriptions=[],r.forEach(t=>typeof t=="function"?t():t.unsubscribe())}add(r){return this.subscriptions.push(r),this}}const K=e=>{throw new Error(`${e} is value of unexpected type`)},ll=e=>{},X=()=>{};class O{constructor(r){r&&(this._subscribe=r)}subscribe(r,t){var n;let o;t?typeof t=="function"?o={next:t,error:X}:o={next:s=>t.next(s),error:s=>{var u;return(u=t.error)===null||u===void 0?void 0:u.call(t,s)}}:o={next:X,error:X};const a=typeof r=="function"?{next:s=>{try{r(s)}catch(u){o.next(u)}},error:s=>o.next(s)}:{next:s=>r.next(s),error:s=>r.error?r.error(s):o.next(s)};let i;try{i=this._subscribe(a)}catch(s){(n=a.error)===null||n===void 0||n.call(a,s)}return new ge().add(()=>{switch(a.next=X,a.error=X,typeof i){case"function":i();return;case"object":i.unsubscribe();return;case"undefined":return;default:return K(i)}})}pipe(...r){return r.reduce((t,n)=>n(t),this)}_subscribe(r){}}class dt extends O{constructor(){super(),this.keyCounter=0,this.subscribers=new Map}next(r){this.subscribers.forEach(t=>t.next(r))}error(r){this.subscribers.forEach(t=>{var n;return(n=t.error)===null||n===void 0?void 0:n.call(t,r)})}_subscribe(r){const t=this.keyCounter++;return this.subscribers.set(t,r),new ge().add(()=>this.subscribers.delete(t))}}class ul{constructor(){this.log$=new dt,this.logs=[],this.log=r=>{const t=Object.assign(Object.assign({},r),{timestamp:Date.now()});this.logs.push(t),this.log$.next(t)},this.getAllLogs=()=>this.logs}createCustomLog(r){return(...t)=>{let n;try{n=r(...t)}catch(o){n={message:"error in `createCustomLog`",component:"Logger"}}this.log(n)}}createComponentLog(r){return this.createCustomLog(t=>Object.assign({component:r},t))}}function fl(e,r='Assertion "value is not nullable" failed'){if(e==null)throw new Error(r)}function vl(e,r='Assertion "value is nullable" failed'){if(e!=null)throw new Error(r)}function Ke(e){return typeof e!="undefined"&&e!==null}function $n(e){return e==null}function dl(e,r){if(!(e!=null&&e.length))throw new Error(r)}function hl(e,r){if(e!=null&&e.length)throw new Error(r)}const pl=(e,r,t)=>new Promise((n,o)=>{r.addEventListener("abort",()=>{s(),c.remove()});const a=()=>{s(),o()},i=()=>{s(),n()},s=()=>{u&&clearTimeout(u),c.removeEventListener("load",i),c.removeEventListener("error",a)};let u;t&&(u=window.setTimeout(a,t));const c=document.createElement("script");c.addEventListener("load",i),c.addEventListener("error",a),c.src=e,document.head.appendChild(c)});var we;const bl=typeof((we=window.performance)===null||we===void 0?void 0:we.now)=="function"?()=>window.performance.now():()=>Date.now();function ht(e,r,t,n){function o(a){return a instanceof t?a:new t(function(i){i(a)})}return new(t||(t=Promise))(function(a,i){function s(l){try{c(n.next(l))}catch(f){i(f)}}function u(l){try{c(n.throw(l))}catch(f){i(f)}}function c(l){l.done?a(l.value):o(l.value).then(s,u)}c((n=n.apply(e,r||[])).next())})}const yl=(e,r)=>(...t)=>ht(void 0,void 0,void 0,function*(){var n;const o=r(...t);let a=e.aborted,i;for(;!a&&!e.aborted;)try{const s=yield o.next(i);a=(n=s.done)!==null&&n!==void 0?n:!1,i=s.value}catch(s){yield o.throw(s)}return i});var j;(function(e){e.Unknown="Unknown",e.Yandex="Yandex",e.Chrome="Chrome",e.Chromium="Chromium",e.Firefox="Firefox",e.Safari="Safari",e.Opera="Opera",e.Edge="Edge",e.Rest="Rest"})(j||(j={}));var $;(function(e){e.Unknown="Unknown",e.Android="Android",e.iPhone="iPhone",e.iPad="iPad",e.iPod="iPod",e.RestMobile="RestMobile",e.Mac="Mac",e.Desktop="Desktop"})($||($={}));const pt=()=>{const{userAgent:e}=window.navigator,r=/yabrowser/i.test(e)?j.Yandex:void 0,t=/chrome|crios/i.test(e)?j.Chrome:void 0,n=/chromium/i.test(e)?j.Chromium:void 0,o=/firefox|fxios/i.test(e)?j.Firefox:void 0,a=/webkit|safari|khtml/i.test(e)?j.Safari:void 0,i=/opr\//i.test(e)?j.Opera:void 0,s=/edg/i.test(e)?j.Edge:void 0,u=/android/i.test(e)?$.Android:void 0,c=/iphone/i.test(e)?$.iPhone:void 0,l=/ipad/i.test(e)?$.iPad:void 0,f=/ipod/i.test(e)?$.iPod:void 0,v=/mac/i.test(e)?$.Mac:void 0,d=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(e)?$.RestMobile:void 0;return{browser:r||o||i||s||t||n||a||j.Rest,device:u||c||l||f||d||v||$.Desktop}},gl=(e=!1)=>{const t=[$.iPhone,$.iPad,$.iPod].includes(pt().device);if(!e)return t;const{userAgent:n,maxTouchPoints:o}=window.navigator;return!!(t||/macintosh/i.test(n)&&o>0)},ml=()=>{const{userAgent:e}=window.navigator,r=e.match(/Version\/(\d+(\.\d+)?)/i);if(!r)return null;const t=r[1],n=parseFloat(t);return isNaN(n)?null:n},Ol=()=>[$.Mac,$.iPhone,$.iPad,$.iPod].includes(pt().device),wl=()=>{var e,r;return/Mobile|mini|Fennec|Android|iP(ad|od|hone)/.test((e=navigator.appVersion)!==null&&e!==void 0?e:navigator.userAgent)||((r=navigator==null?void 0:navigator.userAgentData)===null||r===void 0?void 0:r.mobile)},$l=(e,{start:r=0,factor:t=2,max:n=1/0,min:o=r,random:a=0}={})=>{let i=r;return i*=Math.pow(t,e),i*=1+(Math.random()*a*2-a),i=Math.round(i),i=Math.min(i,n),i=Math.max(i,o),i};var p;(function(e){e[e.LOCAL_STORAGE=0]="LOCAL_STORAGE",e[e.SESSION_STORAGE=1]="SESSION_STORAGE",e[e.RUNTIME=2]="RUNTIME"})(p||(p={}));let S,C;const $e=`vk-videoplayer-dummy-key-${Math.random()}`,Y=()=>{if(C!==void 0)return C;try{localStorage.setItem($e,"test"),localStorage.removeItem($e),C=p.LOCAL_STORAGE}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem($e),C=p.SESSION_STORAGE}catch(r){if(r instanceof DOMException||r instanceof TypeError)C=p.RUNTIME;else throw r}else throw e}return C===p.RUNTIME&&(S=new Map),C},Sn=()=>Y()===p.LOCAL_STORAGE,En=e=>{var r,t;const n=Y();switch(n){case p.LOCAL_STORAGE:return(r=localStorage.getItem(e))!==null&&r!==void 0?r:void 0;case p.SESSION_STORAGE:return(t=sessionStorage.getItem(e))!==null&&t!==void 0?t:void 0;case p.RUNTIME:return S==null?void 0:S.get(e);default:K(n)}},Tn=(e,r)=>{const t=Y();switch(t){case p.LOCAL_STORAGE:try{localStorage.setItem(e,r)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case p.SESSION_STORAGE:try{sessionStorage.setItem(e,r)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case p.RUNTIME:return void(S==null?void 0:S.set(e,r));default:K(t)}},In=e=>{var r;const t=Y();switch(t){case p.LOCAL_STORAGE:return e in localStorage;case p.SESSION_STORAGE:return e in sessionStorage;case p.RUNTIME:return(r=S==null?void 0:S.has(e))!==null&&r!==void 0?r:!1;default:return K(t),!1}},Rn=e=>{const r=Y();switch(r){case p.LOCAL_STORAGE:return localStorage.removeItem(e);case p.SESSION_STORAGE:return sessionStorage.removeItem(e);case p.RUNTIME:return void(S==null?void 0:S.delete(e));default:K(r)}},Pn=()=>{const e=Y();switch(e){case p.LOCAL_STORAGE:return localStorage.clear();case p.SESSION_STORAGE:return sessionStorage.clear();case p.RUNTIME:return S==null?void 0:S.clear();default:K(e)}};var Sl=Object.freeze({__proto__:null,clear:Pn,get:En,has:In,isPersistent:Sn,remove:Rn,set:Tn});const El=()=>{let e,r;try{e=window.self!==window.top}catch(n){n instanceof DOMException&&n.name==="SecurityError"?e=!0:(e=!1,console.error(n))}try{window.location.ancestorOrigins&&(r=window.location.ancestorOrigins[window.location.ancestorOrigins.length-1])}catch(n){console.error(n)}try{!r&&document.referrer&&(r=document.referrer)}catch(n){console.error(n)}const t=r?new URL(r).hostname:void 0;return{isEmbed:e,host:t}};var E;(function(e){e.INVARIANT="Invariant quality",e.Q_144P="144p",e.Q_240P="240p",e.Q_360P="360p",e.Q_480P="480p",e.Q_720P="720p",e.Q_1080P="1080p",e.Q_1440P="1440p",e.Q_2160P="2160p",e.Q_4320P="4320p"})(E||(E={}));const T={[E.Q_144P]:{width:256,height:144},[E.Q_240P]:{width:428,height:240},[E.Q_360P]:{width:640,height:360},[E.Q_480P]:{width:856,height:480},[E.Q_720P]:{width:1280,height:720},[E.Q_1080P]:{width:1920,height:1080},[E.Q_1440P]:{width:2560,height:1440},[E.Q_2160P]:{width:3840,height:2160},[E.Q_4320P]:{width:7680,height:4320}},Tl=(e,r)=>T[e].height>T[r].height,Il=(e,r)=>T[e].height>=T[r].height,bt=(e,r)=>T[e].height<T[r].height,Rl=(e,r)=>T[e].height<=T[r].height,Pl=e=>e.sort((r,t)=>r===t?0:r===E.INVARIANT?1:t===E.INVARIANT?-1:bt(r,t)?1:-1)[0],yt=Object.keys(T).sort((e,r)=>bt(e,r)?-1:1),_l=(e,r=.02)=>[...yt].find(n=>T[n].height*(1+r)>=e),Al=({width:e,height:r})=>{const t=Math.min(e,r),n=Math.max(e,r);return yt.find(o=>{const a=T[o];return a.width>=n&&a.height>=t})},jl=e=>T[e].height,gt=e=>e===E.INVARIANT,xl=e=>e.every(r=>!gt(r));function Ll(e){if(gt(e))throw new Error("Expected exact quality")}const _n=(e,r)=>{const t={};for(const n of Object.keys(r)){const o=r[n],a=e[n];Array.isArray(o)&&Array.isArray(a)?t[n]=a:typeof o=="object"&&typeof a=="object"?t[n]=_n(a,o):t[n]=n in e?a:o}return t},Ml=e=>{let r="";return e>=3600&&(r+=Math.floor(e/3600)+"h",e=e%3600),e>=60&&(r+=Math.floor(e/60)+"m",e=e%60),e>0&&(r+=Math.floor(e)+"s"),r};function An(e,r=0,t){let n,o,a,i,s,u,c=0,l=!1,f=!1,v=!0;const d=!r&&r!==0&&typeof window.requestAnimationFrame=="function";t&&(l=!!t.leading,f="maxWait"in t,a=t!=null&&t.maxWait?Math.max(+(t==null?void 0:t.maxWait)||0,r):a,v="trailing"in t?!!t.trailing:v);function b(h){const I=n,F=o;return n=o=void 0,c=h,i=e.apply(F,I),i}function y(h,I){return d?(s&&window.cancelAnimationFrame(s),window.requestAnimationFrame(h)):setTimeout(h,I)}function w(h){if(d){window.cancelAnimationFrame(h);return}clearTimeout(h)}function g(h){return c=h,s=y(te,r),l?b(h):i}function m(h){const I=h-u,F=h-c,br=r-I;return f?Math.min(br,a-F):br}function hr(h){const I=h-u,F=h-c;return u===void 0||I>=r||I<0||f&&F>=a}function te(){const h=Date.now();if(hr(h))return pr(h);s=y(te,m(h))}function pr(h){return s=void 0,v&&n?b(h):(n=o=void 0,i)}function mn(){s!==void 0&&w(s),c=0,n=u=o=s=void 0}function On(){return s===void 0?i:pr(Date.now())}function wn(){return s!==void 0}function ne(...h){const I=Date.now(),F=hr(I);if(n=h,o=this,u=I,F){if(s===void 0)return g(u);if(f)return s=y(te,r),b(u)}return s===void 0&&(s=y(te,r)),i}return ne.cancel=mn,ne.flush=On,ne.pending=wn,ne}const jn=(e,r=0,t)=>An(e,r,Object.assign(Object.assign(Object.assign({},{leading:!0,trailing:!0}),t),{maxWait:r})),mt=(e,r)=>{if(e===null||typeof e!="object")return e;const t=Array.isArray(e)?[]:{};for(const n in e){if(typeof r=="function"){const o=r(e[n],n,e,t);if(o!==void 0){t[n]=o;continue}}typeof e[n]=="object"?t[n]=mt(e[n],r):t[n]=e[n]}return t},Nl=e=>mt(e),xn=300,Fl=(e,r=xn)=>new O(t=>{const{width:n,height:o}=e.getBoundingClientRect();if(t.next({width:n,height:o}),!window.ResizeObserver)return;const a=new ResizeObserver(jn(i=>{const s=i[0];if(!s)return;let u,c;s.contentBoxSize&&s.contentBoxSize[0]?(c=s.contentBoxSize[0].blockSize,u=s.contentBoxSize[0].inlineSize):s.contentRect&&(u=s.contentRect.width,c=s.contentRect.height),Ke(u)&&Ke(c)&&t.next({width:u,height:c})},r));return a.observe(e),()=>a.disconnect()});class Cl extends dt{constructor(r){super(),this.value=r}next(r){super.next(this.value=r)}error(r){super.error(this.value=r)}getValue(){return this.value}_subscribe(r){const t=super._subscribe(r);return r.next(this.value),t}}function Dl(e){return new O(r=>{const t={};let n=Object.keys(e).length;const o=a=>i=>{a in t||n--,t[a]=i,n===0&&r.next(t)};return Object.entries(e).reduce((a,[i,s])=>a.add(s.subscribe(o(i))),new ge)})}function Gl(...e){return new O(r=>e.reduce((t,n)=>t.add(n.subscribe(r)),new ge))}var kl=e=>new O(r=>{const t=window.setTimeout(()=>{try{r.next()}catch(n){if(r.error)r.error(n);else throw n}},e);return()=>window.clearTimeout(t)}),Ul=e=>new O(r=>{let t=window.setInterval(()=>r.next(),e);return()=>{t&&(window.clearInterval(t),t=void 0)}}),Bl=e=>new O(r=>{e.forEach(t=>r.next(t))}),Vl=(e,r)=>new O(t=>{const n=o=>t.next(o);return e.addEventListener(r,n),()=>e.removeEventListener(r,n)});function ql(e){return r=>new O(t=>r.subscribe(new Ln(t,e)))}class Ln{constructor(r,t){this.destination=r,this.size=t,this.lastValues=[]}next(r){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(r),this.destination.next(this.lastValues)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}const Mn={leading:!1,trailing:!0};function Kl(e,r=Mn){return t=>new O(n=>t.subscribe(new Nn(n,e,r)))}class Nn{constructor(r,t,n){this.destination=r,this.time=t,this.config=n}next(r){this.lastValue=r,Ke(this.timeout)?window.clearTimeout(this.timeout):this.config.leading&&this.destination.next(r),this.timeout=window.setTimeout(()=>{if(this.config.trailing)try{this.destination.next(this.lastValue)}catch(t){if(this.destination.error)this.destination.error(t);else throw t}this.timeout=void 0},this.time)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}const Fn={leading:!0,trailing:!1};function Yl(e,r=Fn){return t=>new O(n=>t.subscribe(new Cn(n,e,r)))}class Cn{constructor(r,t,n){this.destination=r,this.time=t,this.config=n}next(r){this.lastValue=r,$n(this.timeout)&&(this.config.leading&&this.destination.next(r),this.timeout=window.setTimeout(()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0},this.time))}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function zl(e){return r=>new O(t=>r.subscribe(new Dn(t,e)))}class Dn{constructor(r,t){this.destination=r,this.predicate=t}next(r){let t;try{t=this.predicate(r)}catch(n){throw this.error(n),n}t&&this.destination.next(r)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function Wl(e=(r,t)=>r===t){return r=>new O(t=>r.subscribe(new Gn(t,e)))}const yr={};class Gn{constructor(r,t){this.destination=r,this.predicate=t,this.lastValue=yr}next(r){let t;try{t=this.lastValue===yr||!this.predicate(this.lastValue,r),this.lastValue=r}catch(n){throw this.error(n),n}t&&this.destination.next(r)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function kn(e){return r=>new O(t=>r.subscribe(new Un(t,e)))}let Un=class{constructor(r,t){this.destination=r,this.mapper=t}next(r){let t;try{t=this.mapper(r)}catch(n){throw this.error(n),n}this.destination.next(t)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}};function Hl(e){return kn(()=>e)}function Xl(){return e=>new O(r=>{let t=!1,n=!1;const o=e.subscribe(a=>{t||(t=!0,r.next(a)),n&&o.unsubscribe()},a=>{var i;t=!0,(i=r.error)===null||i===void 0||i.call(r,a),n&&o.unsubscribe()});return n=!0,t&&o.unsubscribe(),o})}function Jl(){return e=>new O(r=>e.subscribe(new Bn(r)))}class Bn{constructor(r){this.destination=r,this.hasLast=!1}next(r){const t=this.last;if(this.last=r,!this.hasLast){this.hasLast=!0;return}this.destination.next([t,r])}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function Zl(e){return r=>new O(t=>r.subscribe(new Vn(t,e)))}class Vn{constructor(r,t){this.destination=r,this.effect=t}next(r){try{this.effect(r)}catch(t){throw this.error(t),t}this.destination.next(r)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}var gr;(function(e){e.NETWORK="network",e.VIDEO_PIPELINE="video_pipeline",e.EXTERNAL_API="external_api",e.PARSER="parser",e.DOM="dom",e.WTF="wtf",e.FATAL="fatal"})(gr||(gr={}));class mr{constructor(){Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}addEventListener(r,t,n){r in this.listeners||(this.listeners[r]=[]),this.listeners[r].push({callback:t,options:n})}removeEventListener(r,t){if(!(r in this.listeners))return;const n=this.listeners[r];for(let o=0,a=n.length;o<a;o++)if(n[o].callback===t){n.splice(o,1);return}}dispatchEvent(r){if(!(r.type in this.listeners))return;const n=this.listeners[r.type].slice();for(let o=0,a=n.length;o<a;o++){const i=n[o];try{i.callback.call(this,r)}catch(s){Promise.resolve().then(()=>{throw s})}i.options&&i.options.once&&this.removeEventListener(r.type,i.callback)}return!r.defaultPrevented}}class Ot extends mr{constructor(){super(),this.listeners||mr.call(this),Object.defineProperty(this,"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"onabort",{value:null,writable:!0,configurable:!0}),Object.defineProperty(this,"reason",{value:void 0,writable:!0,configurable:!0})}toString(){return"[object AbortSignal]"}dispatchEvent(r){r.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,r)),super.dispatchEvent(r)}}class qn{constructor(){Object.defineProperty(this,"signal",{value:new Ot,writable:!0,configurable:!0})}abort(r){let t;try{t=new Event("abort")}catch(o){typeof document!="undefined"?document.createEvent?(t=document.createEvent("Event"),t.initEvent("abort",!1,!1)):(t=document.createEventObject(),t.type="abort"):t={type:"abort",bubbles:!1,cancelable:!1}}let n=r;if(n===void 0)if(typeof document=="undefined")n=new Error("This operation was aborted"),n.name="AbortError";else try{n=new DOMException("signal is aborted without reason")}catch(o){n=new Error("This operation was aborted"),n.name="AbortError"}this.signal.reason=n,this.signal.dispatchEvent(t)}toString(){return"[object AbortController]"}}typeof Symbol!="undefined"&&Symbol.toStringTag&&(qn.prototype[Symbol.toStringTag]="AbortController",Ot.prototype[Symbol.toStringTag]="AbortSignal");function wt(e){return e.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):typeof e.Request=="function"&&!e.Request.prototype.hasOwnProperty("signal")||!e.AbortController}function Kn(e){typeof e=="function"&&(e={fetch:e});const{fetch:r,Request:t=r.Request,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o=!1}=e;if(!wt({fetch:r,Request:t,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o}))return{fetch:r,Request:a};let a=t;(a&&!a.prototype.hasOwnProperty("signal")||o)&&(a=function(c,l){let f;l&&l.signal&&(f=l.signal,delete l.signal);const v=new t(c,l);return f&&Object.defineProperty(v,"signal",{writable:!1,enumerable:!1,configurable:!0,value:f}),v},a.prototype=t.prototype);const i=r;return{fetch:(u,c)=>{const l=a&&a.prototype.isPrototypeOf(u)?u.signal:c?c.signal:void 0;if(l){let f;try{f=new DOMException("Aborted","AbortError")}catch(d){f=new Error("Aborted"),f.name="AbortError"}if(l.aborted)return Promise.reject(f);const v=new Promise((d,b)=>{l.addEventListener("abort",()=>b(f),{once:!0})});return c&&c.signal&&delete c.signal,Promise.race([v,i(u,c)])}return i(u,c)},Request:a}}const rr=wt({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),$t=rr?Kn({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,Yn=rr?$t.fetch:window.fetch;rr?$t.Request:window.Request;var Se=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function zn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var L=function(e){try{return!!e()}catch(r){return!0}},Wn=L,me=!Wn(function(){var e=function(){}.bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),St=me,Et=Function.prototype,Ye=Et.call,Qn=St&&Et.bind.bind(Ye,Ye),D=St?Qn:function(e){return function(){return Ye.apply(e,arguments)}},Tt=D,Hn=Tt({}.toString),Xn=Tt("".slice),tr=function(e){return Xn(Hn(e),8,-1)},Jn=D,Zn=L,eo=tr,Ee=Object,ro=Jn("".split),to=Zn(function(){return!Ee("z").propertyIsEnumerable(0)})?function(e){return eo(e)=="String"?ro(e,""):Ee(e)}:Ee,nr=function(e){return e==null},no=nr,oo=TypeError,It=function(e){if(no(e))throw oo("Can't call method on "+e);return e},ao=to,io=It,Z=function(e){return ao(io(e))},z={},oe=function(e){return e&&e.Math==Math&&e},P=oe(typeof globalThis=="object"&&globalThis)||oe(typeof window=="object"&&window)||oe(typeof self=="object"&&self)||oe(typeof Se=="object"&&Se)||function(){return this}()||Se||Function("return this")(),ze=typeof document=="object"&&document.all,so=typeof ze=="undefined"&&ze!==void 0,Rt={all:ze,IS_HTMLDDA:so},Pt=Rt,co=Pt.all,_=Pt.IS_HTMLDDA?function(e){return typeof e=="function"||e===co}:function(e){return typeof e=="function"},lo=P,uo=_,Or=lo.WeakMap,fo=uo(Or)&&/native code/.test(String(Or)),wr=_,_t=Rt,vo=_t.all,W=_t.IS_HTMLDDA?function(e){return typeof e=="object"?e!==null:wr(e)||e===vo}:function(e){return typeof e=="object"?e!==null:wr(e)},ho=L,G=!ho(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),Q={},po=P,$r=W,We=po.document,bo=$r(We)&&$r(We.createElement),At=function(e){return bo?We.createElement(e):{}},yo=G,go=L,mo=At,jt=!yo&&!go(function(){return Object.defineProperty(mo("div"),"a",{get:function(){return 7}}).a!=7}),Oo=G,wo=L,xt=Oo&&wo(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42}),$o=W,So=String,Eo=TypeError,H=function(e){if($o(e))return e;throw Eo(So(e)+" is not an object")},To=me,ae=Function.prototype.call,k=To?ae.bind(ae):function(){return ae.apply(ae,arguments)},or={},Te=or,Ie=P,Io=_,Sr=function(e){return Io(e)?e:void 0},Lt=function(e,r){return arguments.length<2?Sr(Te[e])||Sr(Ie[e]):Te[e]&&Te[e][r]||Ie[e]&&Ie[e][r]},Ro=D,Mt=Ro({}.isPrototypeOf),Po=typeof navigator!="undefined"&&String(navigator.userAgent)||"",Nt=P,Re=Po,Er=Nt.process,Tr=Nt.Deno,Ir=Er&&Er.versions||Tr&&Tr.version,Rr=Ir&&Ir.v8,R,pe;Rr&&(R=Rr.split("."),pe=R[0]>0&&R[0]<4?1:+(R[0]+R[1]));!pe&&Re&&(R=Re.match(/Edge\/(\d+)/),(!R||R[1]>=74)&&(R=Re.match(/Chrome\/(\d+)/),R&&(pe=+R[1])));var _o=pe,Pr=_o,Ao=L,jo=P,xo=jo.String,Ft=!!Object.getOwnPropertySymbols&&!Ao(function(){var e=Symbol();return!xo(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Pr&&Pr<41}),Lo=Ft,Ct=Lo&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Mo=Lt,No=_,Fo=Mt,Co=Ct,Do=Object,Dt=Co?function(e){return typeof e=="symbol"}:function(e){var r=Mo("Symbol");return No(r)&&Fo(r.prototype,Do(e))},Go=String,ar=function(e){try{return Go(e)}catch(r){return"Object"}},ko=_,Uo=ar,Bo=TypeError,ir=function(e){if(ko(e))return e;throw Bo(Uo(e)+" is not a function")},Vo=ir,qo=nr,sr=function(e,r){var t=e[r];return qo(t)?void 0:Vo(t)},Pe=k,_e=_,Ae=W,Ko=TypeError,Yo=function(e,r){var t,n;if(r==="string"&&_e(t=e.toString)&&!Ae(n=Pe(t,e))||_e(t=e.valueOf)&&!Ae(n=Pe(t,e))||r!=="string"&&_e(t=e.toString)&&!Ae(n=Pe(t,e)))return n;throw Ko("Can't convert object to primitive value")},Gt={exports:{}},_r=P,zo=Object.defineProperty,Wo=function(e,r){try{zo(_r,e,{value:r,configurable:!0,writable:!0})}catch(t){_r[e]=r}return r},Qo=P,Ho=Wo,Ar="__core-js_shared__",Xo=Qo[Ar]||Ho(Ar,{}),kt=Xo,jr=kt;(Gt.exports=function(e,r){return jr[e]||(jr[e]=r!==void 0?r:{})})("versions",[]).push({version:"3.31.0",mode:"pure",copyright:"\xA9 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.31.0/LICENSE",source:"https://github.com/zloirock/core-js"});var Ut=Gt.exports,Jo=It,Zo=Object,Bt=function(e){return Zo(Jo(e))},ea=D,ra=Bt,ta=ea({}.hasOwnProperty),N=Object.hasOwn||function(r,t){return ta(ra(r),t)},na=D,oa=0,aa=Math.random(),ia=na(1 .toString),Vt=function(e){return"Symbol("+(e===void 0?"":e)+")_"+ia(++oa+aa,36)},sa=P,ca=Ut,xr=N,la=Vt,ua=Ft,fa=Ct,q=sa.Symbol,je=ca("wks"),va=fa?q.for||q:q&&q.withoutSetter||la,M=function(e){return xr(je,e)||(je[e]=ua&&xr(q,e)?q[e]:va("Symbol."+e)),je[e]},da=k,Lr=W,Mr=Dt,ha=sr,pa=Yo,ba=M,ya=TypeError,ga=ba("toPrimitive"),ma=function(e,r){if(!Lr(e)||Mr(e))return e;var t=ha(e,ga),n;if(t){if(r===void 0&&(r="default"),n=da(t,e,r),!Lr(n)||Mr(n))return n;throw ya("Can't convert object to primitive value")}return r===void 0&&(r="number"),pa(e,r)},Oa=ma,wa=Dt,cr=function(e){var r=Oa(e,"string");return wa(r)?r:r+""},$a=G,Sa=jt,Ea=xt,ie=H,Nr=cr,Ta=TypeError,xe=Object.defineProperty,Ia=Object.getOwnPropertyDescriptor,Le="enumerable",Me="configurable",Ne="writable";Q.f=$a?Ea?function(r,t,n){if(ie(r),t=Nr(t),ie(n),typeof r=="function"&&t==="prototype"&&"value"in n&&Ne in n&&!n[Ne]){var o=Ia(r,t);o&&o[Ne]&&(r[t]=n.value,n={configurable:Me in n?n[Me]:o[Me],enumerable:Le in n?n[Le]:o[Le],writable:!1})}return xe(r,t,n)}:xe:function(r,t,n){if(ie(r),t=Nr(t),ie(n),Sa)try{return xe(r,t,n)}catch(o){}if("get"in n||"set"in n)throw Ta("Accessors not supported");return"value"in n&&(r[t]=n.value),r};var Oe=function(e,r){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:r}},Ra=G,Pa=Q,_a=Oe,ee=Ra?function(e,r,t){return Pa.f(e,r,_a(1,t))}:function(e,r,t){return e[r]=t,e},Aa=Ut,ja=Vt,Fr=Aa("keys"),lr=function(e){return Fr[e]||(Fr[e]=ja(e))},ur={},xa=fo,qt=P,La=W,Ma=ee,Fe=N,Ce=kt,Na=lr,Fa=ur,Cr="Object already initialized",Qe=qt.TypeError,Ca=qt.WeakMap,be,J,ye,Da=function(e){return ye(e)?J(e):be(e,{})},Ga=function(e){return function(r){var t;if(!La(r)||(t=J(r)).type!==e)throw Qe("Incompatible receiver, "+e+" required");return t}};if(xa||Ce.state){var A=Ce.state||(Ce.state=new Ca);A.get=A.get,A.has=A.has,A.set=A.set,be=function(e,r){if(A.has(e))throw Qe(Cr);return r.facade=e,A.set(e,r),r},J=function(e){return A.get(e)||{}},ye=function(e){return A.has(e)}}else{var U=Na("state");Fa[U]=!0,be=function(e,r){if(Fe(e,U))throw Qe(Cr);return r.facade=e,Ma(e,U,r),r},J=function(e){return Fe(e,U)?e[U]:{}},ye=function(e){return Fe(e,U)}}var ka={set:be,get:J,has:ye,enforce:Da,getterFor:Ga},Ua=me,Kt=Function.prototype,Dr=Kt.apply,Gr=Kt.call,Ba=typeof Reflect=="object"&&Reflect.apply||(Ua?Gr.bind(Dr):function(){return Gr.apply(Dr,arguments)}),Va=tr,qa=D,Yt=function(e){if(Va(e)==="Function")return qa(e)},zt={},Wt={},Qt={}.propertyIsEnumerable,Ht=Object.getOwnPropertyDescriptor,Ka=Ht&&!Qt.call({1:2},1);Wt.f=Ka?function(r){var t=Ht(this,r);return!!t&&t.enumerable}:Qt;var Ya=G,za=k,Wa=Wt,Qa=Oe,Ha=Z,Xa=cr,Ja=N,Za=jt,kr=Object.getOwnPropertyDescriptor;zt.f=Ya?kr:function(r,t){if(r=Ha(r),t=Xa(t),Za)try{return kr(r,t)}catch(n){}if(Ja(r,t))return Qa(!za(Wa.f,r,t),r[t])};var ei=L,ri=_,ti=/#|\.prototype\./,re=function(e,r){var t=oi[ni(e)];return t==ii?!0:t==ai?!1:ri(r)?ei(r):!!r},ni=re.normalize=function(e){return String(e).replace(ti,".").toLowerCase()},oi=re.data={},ai=re.NATIVE="N",ii=re.POLYFILL="P",si=re,Ur=Yt,ci=ir,li=me,ui=Ur(Ur.bind),Xt=function(e,r){return ci(e),r===void 0?e:li?ui(e,r):function(){return e.apply(r,arguments)}},se=P,fi=Ba,vi=Yt,di=_,hi=zt.f,pi=si,B=or,bi=Xt,V=ee,Br=N,yi=function(e){var r=function(t,n,o){if(this instanceof r){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,o)}return fi(e,this,arguments)};return r.prototype=e.prototype,r},Jt=function(e,r){var t=e.target,n=e.global,o=e.stat,a=e.proto,i=n?se:o?se[t]:(se[t]||{}).prototype,s=n?B:B[t]||V(B,t,{})[t],u=s.prototype,c,l,f,v,d,b,y,w,g;for(v in r)c=pi(n?v:t+(o?".":"#")+v,e.forced),l=!c&&i&&Br(i,v),b=s[v],l&&(e.dontCallGetSet?(g=hi(i,v),y=g&&g.value):y=i[v]),d=l&&y?y:r[v],!(l&&typeof b==typeof d)&&(e.bind&&l?w=bi(d,se):e.wrap&&l?w=yi(d):a&&di(d)?w=vi(d):w=d,(e.sham||d&&d.sham||b&&b.sham)&&V(w,"sham",!0),V(s,v,w),a&&(f=t+"Prototype",Br(B,f)||V(B,f,{}),V(B[f],v,d),e.real&&u&&(c||!u[v])&&V(u,v,d)))},He=G,gi=N,Zt=Function.prototype,mi=He&&Object.getOwnPropertyDescriptor,fr=gi(Zt,"name"),Oi=fr&&function(){}.name==="something",wi=fr&&(!He||He&&mi(Zt,"name").configurable),$i={EXISTS:fr,PROPER:Oi,CONFIGURABLE:wi},en={},Si=Math.ceil,Ei=Math.floor,Ti=Math.trunc||function(r){var t=+r;return(t>0?Ei:Si)(t)},Ii=Ti,rn=function(e){var r=+e;return r!==r||r===0?0:Ii(r)},Ri=rn,Pi=Math.max,_i=Math.min,Ai=function(e,r){var t=Ri(e);return t<0?Pi(t+r,0):_i(t,r)},ji=rn,xi=Math.min,Li=function(e){return e>0?xi(ji(e),9007199254740991):0},Mi=Li,tn=function(e){return Mi(e.length)},Ni=Z,Fi=Ai,Ci=tn,Vr=function(e){return function(r,t,n){var o=Ni(r),a=Ci(o),i=Fi(n,a),s;if(e&&t!=t){for(;a>i;)if(s=o[i++],s!=s)return!0}else for(;a>i;i++)if((e||i in o)&&o[i]===t)return e||i||0;return!e&&-1}},Di={includes:Vr(!0),indexOf:Vr(!1)},Gi=D,De=N,ki=Z,Ui=Di.indexOf,Bi=ur,qr=Gi([].push),Vi=function(e,r){var t=ki(e),n=0,o=[],a;for(a in t)!De(Bi,a)&&De(t,a)&&qr(o,a);for(;r.length>n;)De(t,a=r[n++])&&(~Ui(o,a)||qr(o,a));return o},nn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],qi=Vi,Ki=nn,Yi=Object.keys||function(r){return qi(r,Ki)},zi=G,Wi=xt,Qi=Q,Hi=H,Xi=Z,Ji=Yi;en.f=zi&&!Wi?Object.defineProperties:function(r,t){Hi(r);for(var n=Xi(t),o=Ji(t),a=o.length,i=0,s;a>i;)Qi.f(r,s=o[i++],n[s]);return r};var Zi=Lt,es=Zi("document","documentElement"),rs=H,ts=en,Kr=nn,ns=ur,os=es,as=At,is=lr,Yr=">",zr="<",Xe="prototype",Je="script",on=is("IE_PROTO"),Ge=function(){},an=function(e){return zr+Je+Yr+e+zr+"/"+Je+Yr},Wr=function(e){e.write(an("")),e.close();var r=e.parentWindow.Object;return e=null,r},ss=function(){var e=as("iframe"),r="java"+Je+":",t;return e.style.display="none",os.appendChild(e),e.src=String(r),t=e.contentWindow.document,t.open(),t.write(an("document.F=Object")),t.close(),t.F},ce,ve=function(){try{ce=new ActiveXObject("htmlfile")}catch(r){}ve=typeof document!="undefined"?document.domain&&ce?Wr(ce):ss():Wr(ce);for(var e=Kr.length;e--;)delete ve[Xe][Kr[e]];return ve()};ns[on]=!0;var sn=Object.create||function(r,t){var n;return r!==null?(Ge[Xe]=rs(r),n=new Ge,Ge[Xe]=null,n[on]=r):n=ve(),t===void 0?n:ts.f(n,t)},cs=L,ls=!cs(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),us=N,fs=_,vs=Bt,ds=lr,hs=ls,Qr=ds("IE_PROTO"),Ze=Object,ps=Ze.prototype,cn=hs?Ze.getPrototypeOf:function(e){var r=vs(e);if(us(r,Qr))return r[Qr];var t=r.constructor;return fs(t)&&r instanceof t?t.prototype:r instanceof Ze?ps:null},bs=ee,ln=function(e,r,t,n){return n&&n.enumerable?e[r]=t:bs(e,r,t),e},ys=L,gs=_,ms=W,Os=sn,Hr=cn,ws=ln,$s=M,er=$s("iterator"),un=!1,x,ke,Ue;[].keys&&(Ue=[].keys(),"next"in Ue?(ke=Hr(Hr(Ue)),ke!==Object.prototype&&(x=ke)):un=!0);var Ss=!ms(x)||ys(function(){var e={};return x[er].call(e)!==e});Ss?x={}:x=Os(x);gs(x[er])||ws(x,er,function(){return this});var fn={IteratorPrototype:x,BUGGY_SAFARI_ITERATORS:un},Es=M,Ts=Es("toStringTag"),vn={};vn[Ts]="z";var vr=String(vn)==="[object z]",Is=vr,Rs=_,de=tr,Ps=M,_s=Ps("toStringTag"),As=Object,js=de(function(){return arguments}())=="Arguments",xs=function(e,r){try{return e[r]}catch(t){}},dr=Is?de:function(e){var r,t,n;return e===void 0?"Undefined":e===null?"Null":typeof(t=xs(r=As(e),_s))=="string"?t:js?de(r):(n=de(r))=="Object"&&Rs(r.callee)?"Arguments":n},Ls=vr,Ms=dr,Ns=Ls?{}.toString:function(){return"[object "+Ms(this)+"]"},Fs=vr,Cs=Q.f,Ds=ee,Gs=N,ks=Ns,Us=M,Xr=Us("toStringTag"),dn=function(e,r,t,n){if(e){var o=t?e:e.prototype;Gs(o,Xr)||Cs(o,Xr,{configurable:!0,value:r}),n&&!Fs&&Ds(o,"toString",ks)}},Bs=fn.IteratorPrototype,Vs=sn,qs=Oe,Ks=dn,Ys=z,zs=function(){return this},Ws=function(e,r,t,n){var o=r+" Iterator";return e.prototype=Vs(Bs,{next:qs(+!n,t)}),Ks(e,o,!1,!0),Ys[o]=zs,e},Qs=Jt,Hs=k,hn=$i,Xs=Ws,Js=cn,Zs=dn,Jr=ln,ec=M,Zr=z,pn=fn,rc=hn.PROPER;hn.CONFIGURABLE;pn.IteratorPrototype;var le=pn.BUGGY_SAFARI_ITERATORS,Be=ec("iterator"),et="keys",ue="values",rt="entries",tc=function(){return this},nc=function(e,r,t,n,o,a,i){Xs(t,r,n);var s=function(g){if(g===o&&v)return v;if(!le&&g in l)return l[g];switch(g){case et:return function(){return new t(this,g)};case ue:return function(){return new t(this,g)};case rt:return function(){return new t(this,g)}}return function(){return new t(this)}},u=r+" Iterator",c=!1,l=e.prototype,f=l[Be]||l["@@iterator"]||o&&l[o],v=!le&&f||s(o),d=r=="Array"&&l.entries||f,b,y,w;if(d&&(b=Js(d.call(new e)),b!==Object.prototype&&b.next&&(Zs(b,u,!0,!0),Zr[u]=tc)),rc&&o==ue&&f&&f.name!==ue&&(c=!0,v=function(){return Hs(f,this)}),o)if(y={values:s(ue),keys:a?v:s(et),entries:s(rt)},i)for(w in y)(le||c||!(w in l))&&Jr(l,w,y[w]);else Qs({target:r,proto:!0,forced:le||c},y);return i&&l[Be]!==v&&Jr(l,Be,v,{name:o}),Zr[r]=v,y},oc=function(e,r){return{value:e,done:r}},ac=Z,tt=z,bn=ka;Q.f;var ic=nc,fe=oc,yn="Array Iterator",sc=bn.set,cc=bn.getterFor(yn);ic(Array,"Array",function(e,r){sc(this,{type:yn,target:ac(e),index:0,kind:r})},function(){var e=cc(this),r=e.target,t=e.kind,n=e.index++;return!r||n>=r.length?(e.target=void 0,fe(void 0,!0)):t=="keys"?fe(n,!1):t=="values"?fe(r[n],!1):fe([n,r[n]],!1)},"values");tt.Arguments=tt.Array;var lc=M,uc=z,fc=lc("iterator"),vc=Array.prototype,dc=function(e){return e!==void 0&&(uc.Array===e||vc[fc]===e)},hc=dr,nt=sr,pc=nr,bc=z,yc=M,gc=yc("iterator"),gn=function(e){if(!pc(e))return nt(e,gc)||nt(e,"@@iterator")||bc[hc(e)]},mc=k,Oc=ir,wc=H,$c=ar,Sc=gn,Ec=TypeError,Tc=function(e,r){var t=arguments.length<2?Sc(e):r;if(Oc(t))return wc(mc(t,e));throw Ec($c(e)+" is not iterable")},Ic=k,ot=H,Rc=sr,Pc=function(e,r,t){var n,o;ot(e);try{if(n=Rc(e,"return"),!n){if(r==="throw")throw t;return t}n=Ic(n,e)}catch(a){o=!0,n=a}if(r==="throw")throw t;if(o)throw n;return ot(n),t},_c=Xt,Ac=k,jc=H,xc=ar,Lc=dc,Mc=tn,at=Mt,Nc=Tc,Fc=gn,it=Pc,Cc=TypeError,he=function(e,r){this.stopped=e,this.result=r},st=he.prototype,Dc=function(e,r,t){var n=t&&t.that,o=!!(t&&t.AS_ENTRIES),a=!!(t&&t.IS_RECORD),i=!!(t&&t.IS_ITERATOR),s=!!(t&&t.INTERRUPTED),u=_c(r,n),c,l,f,v,d,b,y,w=function(m){return c&&it(c,"normal",m),new he(!0,m)},g=function(m){return o?(jc(m),s?u(m[0],m[1],w):u(m[0],m[1])):s?u(m,w):u(m)};if(a)c=e.iterator;else if(i)c=e;else{if(l=Fc(e),!l)throw Cc(xc(e)+" is not iterable");if(Lc(l)){for(f=0,v=Mc(e);v>f;f++)if(d=g(e[f]),d&&at(st,d))return d;return new he(!1)}c=Nc(e,l)}for(b=a?e.next:c.next;!(y=Ac(b,c)).done;){try{d=g(y.value)}catch(m){it(c,"throw",m)}if(typeof d=="object"&&d&&at(st,d))return d}return new he(!1)},Gc=cr,kc=Q,Uc=Oe,Bc=function(e,r,t){var n=Gc(r);n in e?kc.f(e,n,Uc(0,t)):e[n]=t},Vc=Jt,qc=Dc,Kc=Bc;Vc({target:"Object",stat:!0},{fromEntries:function(r){var t={};return qc(r,function(n,o){Kc(t,n,o)},{AS_ENTRIES:!0}),t}});var Yc=or,zc=Yc.Object.fromEntries,Wc={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},Qc=Wc,Hc=P,Xc=dr,Jc=ee,ct=z,Zc=M,lt=Zc("toStringTag");for(var Ve in Qc){var ut=Hc[Ve],qe=ut&&ut.prototype;qe&&Xc(qe)!==lt&&Jc(qe,lt,Ve),ct[Ve]=ct.Array}var el=zc,rl=el,tl=rl,nl=tl,ol=zn(nl),ft;(function(e){e.Armenian="58",e.Azerbaijani="57",e.Belarusian="114",e.English="3",e.Kazakh="97",e.Portuguese="73",e.Russian="0",e.Spanish="4",e.Ukrainian="1",e.Uzbek="65",e.Vietnamese="75"})(ft||(ft={}));const al="vk.com",eu=(e,r,t)=>ht(void 0,void 0,void 0,function*(){const n=new URL(`https://${al}/js/lang-pack.js`);n.searchParams.set("format","json"),n.searchParams.set("name",r),e!==void 0&&n.searchParams.set("lang",e);const a=yield(yield Yn(n.toString())).json();return il(a,t)}),il=(e,r)=>ol(Object.entries(e.keys).map(([t,n])=>[t.substring(`${r}_`.length),sl(n)])),sl=e=>Array.isArray(e)?e[0]:e;var vt;(function(e){e.RU="ru",e.EN="en"})(vt||(vt={}));export{j as CurrentClientBrowser,$ as CurrentClientDevice,gr as ErrorCategory,vt as InterfaceLanguage,ul as Logger,O as Observable,dt as Subject,ge as Subscription,cl as VERSION,ft as VKNumericLanguage,Cl as ValueSubject,E as VideoQuality,yl as abortable,pl as addScript,xl as areQualitiesExact,hl as assertEmptyArray,K as assertNever,fl as assertNonNullable,dl as assertNotEmptyArray,vl as assertNullable,Ll as assertQualityIsExact,ql as buffer,ll as checkNever,Nl as cloneDeep,mt as cloneDeepWith,Dl as combine,Kl as debounce,An as debounceFn,El as detectEmbed,_n as fillWithDefault,zl as filter,Wl as filterChanged,Vl as fromEvent,pt as getCurrentBrowser,$l as getExponentialDelay,Pl as getHighestQuality,ml as getIOSVersion,Ul as interval,Tl as isHigher,Il as isHigherOrEqual,gl as isIOS,gt as isInvariantQuality,bt as isLower,Rl as isLowerOrEqual,Ol as isMacLike,wl as isMobile,Ke as isNonNullable,$n as isNullable,eu as loadVKLangPack,kn as map,Hl as mapTo,Gl as merge,X as noop,bl as now,Bl as observableFrom,Fl as observeElementSize,Xl as once,Jl as pairwise,Sl as safeStorage,Zl as tap,Yl as throttle,jn as throttleFn,Ml as timeCodeToString,kl as timeout,_l as videoHeightToQuality,jl as videoQualityToHeight,Al as videoSizeToQuality};
6
+ var se=Object.defineProperty,ke=Object.defineProperties;var Le=Object.getOwnPropertyDescriptors;var oe=Object.getOwnPropertySymbols;var Pe=Object.prototype.hasOwnProperty,Me=Object.prototype.propertyIsEnumerable;var ae=Math.pow,ie=(t,e,r)=>e in t?se(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,O=(t,e)=>{for(var r in e||(e={}))Pe.call(e,r)&&ie(t,r,e[r]);if(oe)for(var r of oe(e))Me.call(e,r)&&ie(t,r,e[r]);return t},L=(t,e)=>ke(t,Le(e));var Ne=(t,e)=>{for(var r in e)se(t,r,{get:e[r],enumerable:!0})};var P=(t,e,r)=>new Promise((n,i)=>{var s=a=>{try{o(r.next(a))}catch(c){i(c)}},l=a=>{try{o(r.throw(a))}catch(c){i(c)}},o=a=>a.done?n(a.value):Promise.resolve(a.value).then(s,l);o((r=r.apply(t,e)).next())});var Ve="1.0.37-beta.0";var m=class{constructor(){this.subscriptions=[]}unsubscribe(){let e=this.subscriptions;this.subscriptions=[],e.forEach(r=>typeof r=="function"?r():r.unsubscribe())}add(e){return this.subscriptions.push(e),this}};var I=t=>{throw new Error(`${t} is value of unexpected type`)},Qe=t=>{};var g=()=>{};var u=class{constructor(e){e&&(this._subscribe=e)}subscribe(e,r){var l;let n;r?typeof r=="function"?n={next:r,error:g}:n={next:o=>r.next(o),error:o=>{var a;return(a=r.error)==null?void 0:a.call(r,o)}}:n={next:g,error:g};let i=typeof e=="function"?{next:o=>{try{e(o)}catch(a){n.next(a)}},error:o=>n.next(o)}:{next:o=>e.next(o),error:o=>e.error?e.error(o):n.next(o)},s;try{s=this._subscribe(i)}catch(o){(l=i.error)==null||l.call(i,o)}return new m().add(()=>{switch(i.next=g,i.error=g,typeof s){case"function":s();return;case"object":s.unsubscribe();return;case"undefined":return;default:return I(s)}})}pipe(...e){return e.reduce((r,n)=>n(r),this)}_subscribe(e){}};var x=class extends u{constructor(){super();this.keyCounter=0;this.subscribers=new Map}next(r){this.subscribers.forEach(n=>n.next(r))}error(r){this.subscribers.forEach(n=>{var i;return(i=n.error)==null?void 0:i.call(n,r)})}_subscribe(r){let n=this.keyCounter++;return this.subscribers.set(n,r),new m().add(()=>this.subscribers.delete(n))}};var D=class{constructor(){this.log$=new x;this.logs=[];this.log=e=>{let r=L(O({},e),{timestamp:Date.now()});this.logs.push(r),this.log$.next(r)};this.getAllLogs=()=>this.logs}createCustomLog(e){return(...r)=>{let n;try{n=e(...r)}catch(i){n={message:"error in `createCustomLog`",component:"Logger"}}this.log(n)}}createComponentLog(e){return this.createCustomLog(r=>O({component:e},r))}};function _e(t,e='Assertion "value is not nullable" failed'){if(t==null)throw new Error(e)}function De(t,e='Assertion "value is nullable" failed'){if(t!=null)throw new Error(e)}function w(t){return typeof t!="undefined"&&t!==null}function U(t){return t==null}function Ue(t,e){if(!(t!=null&&t.length))throw new Error(e)}function Fe(t,e){if(t!=null&&t.length)throw new Error(e)}var ze=(t,e,r)=>new Promise((n,i)=>{e.addEventListener("abort",()=>{o(),c.remove()});let s=()=>{o(),i()},l=()=>{o(),n()},o=()=>{a&&clearTimeout(a),c.removeEventListener("load",l),c.removeEventListener("error",s)},a;r&&(a=window.setTimeout(s,r));let c=document.createElement("script");c.addEventListener("load",l),c.addEventListener("error",s),c.src=t,document.head.appendChild(c)});var le,je=typeof((le=window.performance)==null?void 0:le.now)=="function"?()=>window.performance.now():()=>Date.now();var Be=(t,e)=>(...r)=>P(void 0,null,function*(){var l;let n=e(...r),i=t.aborted,s;for(;!i&&!t.aborted;)try{let o=yield n.next(s);i=(l=o.done)!=null?l:!1,s=o.value}catch(o){yield n.throw(o)}return s});var ue=(c=>(c.Unknown="Unknown",c.Yandex="Yandex",c.Chrome="Chrome",c.Chromium="Chromium",c.Firefox="Firefox",c.Safari="Safari",c.Opera="Opera",c.Edge="Edge",c.Rest="Rest",c))(ue||{}),ce=(a=>(a.Unknown="Unknown",a.Android="Android",a.iPhone="iPhone",a.iPad="iPad",a.iPod="iPod",a.RestMobile="RestMobile",a.Mac="Mac",a.Desktop="Desktop",a))(ce||{}),M=()=>{let{userAgent:t}=window.navigator,e=/yabrowser/i.test(t)?"Yandex":void 0,r=/chrome|crios/i.test(t)?"Chrome":void 0,n=/chromium/i.test(t)?"Chromium":void 0,i=/firefox|fxios/i.test(t)?"Firefox":void 0,s=/webkit|safari|khtml/i.test(t)?"Safari":void 0,l=/opr\//i.test(t)?"Opera":void 0,o=/edg/i.test(t)?"Edge":void 0,a=/android/i.test(t)?"Android":void 0,c=/iphone/i.test(t)?"iPhone":void 0,f=/ipad/i.test(t)?"iPad":void 0,b=/ipod/i.test(t)?"iPod":void 0,S=/mac/i.test(t)?"Mac":void 0,A=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(t)?"RestMobile":void 0;return{browser:e||i||l||o||r||n||s||"Rest",device:a||c||f||b||A||S||"Desktop"}},We=(t=!1)=>{let r=["iPhone","iPad","iPod"].includes(M().device);if(!t)return r;let{userAgent:n,maxTouchPoints:i}=window.navigator;return!!(r||/macintosh/i.test(n)&&i>0)},Ge=()=>{let{userAgent:t}=window.navigator,e=t.match(/Version\/(\d+(\.\d+)?)/i);if(!e)return null;let r=e[1],n=parseFloat(r);return isNaN(n)?null:n},qe=()=>M().device==="Android",He=()=>["Mac","iPhone","iPad","iPod"].includes(M().device),Ke=()=>{var t,e;return/Mobile|mini|Fennec|Android|iP(ad|od|hone)/.test((t=navigator.appVersion)!=null?t:navigator.userAgent)||((e=navigator==null?void 0:navigator.userAgentData)==null?void 0:e.mobile)};var $e=(t,{start:e=0,factor:r=2,max:n=1/0,min:i=e,random:s=0}={})=>{let l=e;return l*=ae(r,t),l*=1+(Math.random()*s*2-s),l=Math.round(l),l=Math.min(l,n),l=Math.max(l,i),l};var z={};Ne(z,{clear:()=>tt,get:()=>Xe,has:()=>Ze,isPersistent:()=>Ye,remove:()=>et,set:()=>Je});var d,y,F=`vk-videoplayer-dummy-key-${Math.random()}`,E=()=>{if(y!==void 0)return y;try{localStorage.setItem(F,"test"),localStorage.removeItem(F),y=0}catch(t){if(t instanceof DOMException||t instanceof TypeError)try{sessionStorage.getItem(F),y=1}catch(e){if(e instanceof DOMException||e instanceof TypeError)y=2;else throw e}else throw t}return y===2&&(d=new Map),y},Ye=()=>E()===0,Xe=t=>{var r,n;let e=E();switch(e){case 0:return(r=localStorage.getItem(t))!=null?r:void 0;case 1:return(n=sessionStorage.getItem(t))!=null?n:void 0;case 2:return d==null?void 0:d.get(t);default:I(e)}},Je=(t,e)=>{let r=E();switch(r){case 0:try{localStorage.setItem(t,e)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case 1:try{sessionStorage.setItem(t,e)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case 2:return void(d==null?void 0:d.set(t,e));default:I(r)}},Ze=t=>{var r;let e=E();switch(e){case 0:return t in localStorage;case 1:return t in sessionStorage;case 2:return(r=d==null?void 0:d.has(t))!=null?r:!1;default:return I(e),!1}},et=t=>{let e=E();switch(e){case 0:return localStorage.removeItem(t);case 1:return sessionStorage.removeItem(t);case 2:return void(d==null?void 0:d.delete(t));default:I(e)}},tt=()=>{let t=E();switch(t){case 0:return localStorage.clear();case 1:return sessionStorage.clear();case 2:return d==null?void 0:d.clear();default:I(t)}};var rt=()=>{let t,e;try{t=window.self!==window.top}catch(n){n instanceof DOMException&&n.name==="SecurityError"?t=!0:(t=!1,console.error(n))}try{window.location.ancestorOrigins&&(e=window.location.ancestorOrigins[window.location.ancestorOrigins.length-1])}catch(n){console.error(n)}try{!e&&document.referrer&&(e=document.referrer)}catch(n){console.error(n)}let r=e?new URL(e).hostname:void 0;return{isEmbed:t,host:r}};var j=(f=>(f.INVARIANT="Invariant quality",f.Q_144P="144p",f.Q_240P="240p",f.Q_360P="360p",f.Q_480P="480p",f.Q_720P="720p",f.Q_1080P="1080p",f.Q_1440P="1440p",f.Q_2160P="2160p",f.Q_4320P="4320p",f))(j||{});var T={"144p":{width:256,height:144},"240p":{width:428,height:240},"360p":{width:640,height:360},"480p":{width:856,height:480},"720p":{width:1280,height:720},"1080p":{width:1920,height:1080},"1440p":{width:2560,height:1440},"2160p":{width:3840,height:2160},"4320p":{width:7680,height:4320}},nt=(t,e)=>T[t].height>T[e].height,ot=(t,e)=>T[t].height>=T[e].height,B=(t,e)=>T[t].height<T[e].height,it=(t,e)=>T[t].height<=T[e].height,st=t=>t.sort((e,r)=>e===r?0:e==="Invariant quality"?1:r==="Invariant quality"?-1:B(e,r)?1:-1)[0],pe=Object.keys(T).sort((t,e)=>B(t,e)?-1:1),at=(t,e=.02)=>[...pe].find(n=>T[n].height*(1+e)>=t),lt=({width:t,height:e})=>{let r=Math.min(t,e),n=Math.max(t,e);return pe.find(i=>{let s=T[i];return s.width>=n&&s.height>=r})},ut=t=>T[t].height,W=t=>t==="Invariant quality",ct=t=>t.every(e=>!W(e));function pt(t){if(W(t))throw new Error("Expected exact quality")}var bt=(t,e)=>{let r={};for(let n of Object.keys(e)){let i=e[n],s=t[n];Array.isArray(i)&&Array.isArray(s)?r[n]=s:typeof i=="object"&&typeof s=="object"?r[n]=bt(s,i):r[n]=n in t?s:i}return r};var sr=t=>{let e="";return t>=3600&&(e+=Math.floor(t/3600)+"h",t=t%3600),t>=60&&(e+=Math.floor(t/60)+"m",t=t%60),t>0&&(e+=Math.floor(t)+"s"),e};function G(t,e=0,r){let n,i,s,l,o,a,c=0,f=!1,b=!1,S=!0,A=!e&&e!==0&&typeof window.requestAnimationFrame=="function";r&&(f=!!r.leading,b="maxWait"in r,s=r!=null&&r.maxWait?Math.max(+(r==null?void 0:r.maxWait)||0,e):s,S="trailing"in r?!!r.trailing:S);function _(p){let v=n,h=i;return n=i=void 0,c=p,l=t.apply(h,v),l}function R(p,v){return A?(o&&window.cancelAnimationFrame(o),window.requestAnimationFrame(p)):setTimeout(p,v)}function we(p){if(A){window.cancelAnimationFrame(p);return}clearTimeout(p)}function Ee(p){return c=p,o=R(C,e),f?_(p):l}function Se(p){let v=p-a,h=p-c,ne=e-v;return b?Math.min(ne,s-h):ne}function te(p){let v=p-a,h=p-c;return a===void 0||v>=e||v<0||b&&h>=s}function C(){let p=Date.now();if(te(p))return re(p);o=R(C,Se(p))}function re(p){return o=void 0,S&&n?_(p):(n=i=void 0,l)}function Ae(){o!==void 0&&we(o),c=0,n=a=i=o=void 0}function Re(){return o===void 0?l:re(Date.now())}function Ce(){return o!==void 0}function k(...p){let v=Date.now(),h=te(v);if(n=p,i=this,a=v,h){if(o===void 0)return Ee(a);if(b)return o=R(C,e),_(a)}return o===void 0&&(o=R(C,e)),l}return k.cancel=Ae,k.flush=Re,k.pending=Ce,k}var q=(t,e=0,r)=>G(t,e,L(O(O({},{leading:!0,trailing:!0}),r),{maxWait:e}));var N=(t,e)=>{if(t===null||typeof t!="object")return t;let r=Array.isArray(t)?[]:{};for(let n in t){if(typeof e=="function"){let i=e(t[n],n,t,r);if(i!==void 0){r[n]=i;continue}}typeof t[n]=="object"?r[n]=N(t[n],e):r[n]=t[n]}return r};var dt=t=>N(t);var ft=300,mt=(t,e=ft)=>new u(r=>{let{width:n,height:i}=t.getBoundingClientRect();if(r.next({width:n,height:i}),!window.ResizeObserver)return;let s=new ResizeObserver(q(l=>{let o=l[0];if(!o)return;let a,c;o.contentBoxSize&&o.contentBoxSize[0]?(c=o.contentBoxSize[0].blockSize,a=o.contentBoxSize[0].inlineSize):o.contentRect&&(a=o.contentRect.width,c=o.contentRect.height),w(a)&&w(c)&&r.next({width:a,height:c})},e));return s.observe(t),()=>s.disconnect()});var V=class extends x{constructor(r){super();this.value=r}next(r){super.next(this.value=r)}error(r){super.error(this.value=r)}getValue(){return this.value}_subscribe(r){let n=super._subscribe(r);return r.next(this.value),n}};function be(t){return new u(e=>{let r={},n=Object.keys(t).length,i=s=>l=>{s in r||n--,r[s]=l,n===0&&e.next(r)};return Object.entries(t).reduce((s,[l,o])=>s.add(o.subscribe(i(l))),new m)})}function de(...t){return new u(e=>t.reduce((r,n)=>r.add(n.subscribe(e)),new m))}var Tt=t=>new u(e=>{let r=window.setTimeout(()=>{try{e.next()}catch(n){if(e.error)e.error(n);else throw n}},t);return()=>window.clearTimeout(r)});var vt=t=>new u(e=>{let r=window.setInterval(()=>e.next(),t);return()=>{r&&(window.clearInterval(r),r=void 0)}});var It=t=>new u(e=>{t.forEach(r=>e.next(r))});var xt=(t,e)=>new u(r=>{let n=i=>r.next(i);return t.addEventListener(e,n),()=>t.removeEventListener(e,n)});function fe(t){return e=>new u(r=>e.subscribe(new H(r,t)))}var H=class{constructor(e,r){this.destination=e;this.size=r;this.lastValues=[]}next(e){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(e),this.destination.next(this.lastValues)}error(e){var r,n;(n=(r=this.destination).error)==null||n.call(r,e)}};var ht={leading:!1,trailing:!0};function me(t,e=ht){return r=>new u(n=>r.subscribe(new K(n,t,e)))}var K=class{constructor(e,r,n){this.destination=e;this.time=r;this.config=n}next(e){this.lastValue=e,w(this.timeout)?window.clearTimeout(this.timeout):this.config.leading&&this.destination.next(e),this.timeout=window.setTimeout(()=>{if(this.config.trailing)try{this.destination.next(this.lastValue)}catch(r){if(this.destination.error)this.destination.error(r);else throw r}this.timeout=void 0},this.time)}error(e){var r,n;(n=(r=this.destination).error)==null||n.call(r,e)}};var gt={leading:!0,trailing:!1};function Te(t,e=gt){return r=>new u(n=>r.subscribe(new $(n,t,e)))}var $=class{constructor(e,r,n){this.destination=e;this.time=r;this.config=n}next(e){this.lastValue=e,U(this.timeout)&&(this.config.leading&&this.destination.next(e),this.timeout=window.setTimeout(()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0},this.time))}error(e){var r,n;(n=(r=this.destination).error)==null||n.call(r,e)}};function ve(t){return e=>new u(r=>e.subscribe(new Y(r,t)))}var Y=class{constructor(e,r){this.destination=e;this.predicate=r}next(e){let r;try{r=this.predicate(e)}catch(n){throw this.error(n),n}r&&this.destination.next(e)}error(e){var r,n;(n=(r=this.destination).error)==null||n.call(r,e)}};function xe(t=(e,r)=>e===r){return e=>new u(r=>e.subscribe(new X(r,t)))}var Ie={},X=class{constructor(e,r){this.destination=e;this.predicate=r;this.lastValue=Ie}next(e){let r;try{r=this.lastValue===Ie||!this.predicate(this.lastValue,e),this.lastValue=e}catch(n){throw this.error(n),n}r&&this.destination.next(e)}error(e){var r,n;(n=(r=this.destination).error)==null||n.call(r,e)}};function Q(t){return e=>new u(r=>e.subscribe(new J(r,t)))}var J=class{constructor(e,r){this.destination=e;this.mapper=r}next(e){let r;try{r=this.mapper(e)}catch(n){throw this.error(n),n}this.destination.next(r)}error(e){var r,n;(n=(r=this.destination).error)==null||n.call(r,e)}};function he(t){return Q(()=>t)}function ge(){return t=>new u(e=>{let r=!1,n=!1,i=t.subscribe(s=>{r||(r=!0,e.next(s)),n&&i.unsubscribe()},s=>{var l;r=!0,(l=e.error)==null||l.call(e,s),n&&i.unsubscribe()});return n=!0,r&&i.unsubscribe(),i})}function ye(){return t=>new u(e=>t.subscribe(new Z(e)))}var Z=class{constructor(e){this.destination=e;this.hasLast=!1}next(e){let r=this.last;if(this.last=e,!this.hasLast){this.hasLast=!0;return}this.destination.next([r,e])}error(e){var r,n;(n=(r=this.destination).error)==null||n.call(r,e)}};function Oe(t){return e=>new u(r=>e.subscribe(new ee(r,t)))}var ee=class{constructor(e,r){this.destination=e;this.effect=r}next(e){try{this.effect(e)}catch(r){throw this.error(r),r}this.destination.next(e)}error(e){var r,n;(n=(r=this.destination).error)==null||n.call(r,e)}};var yt=(o=>(o.NETWORK="network",o.VIDEO_PIPELINE="video_pipeline",o.EXTERNAL_API="external_api",o.PARSER="parser",o.DOM="dom",o.WTF="wtf",o.FATAL="fatal",o))(yt||{});var Ot=(b=>(b.Armenian="58",b.Azerbaijani="57",b.Belarusian="114",b.English="3",b.Kazakh="97",b.Portuguese="73",b.Russian="0",b.Spanish="4",b.Ukrainian="1",b.Uzbek="65",b.Vietnamese="75",b))(Ot||{}),wt="vk.com",Yn=(t,e,r)=>P(void 0,null,function*(){let n=new URL(`https://${wt}/js/lang-pack.js`);n.searchParams.set("format","json"),n.searchParams.set("name",e),t!==void 0&&n.searchParams.set("lang",t);let s=yield(yield fetch(n.toString())).json();return Et(s,r)}),Et=(t,e)=>Object.fromEntries(Object.entries(t.keys).map(([r,n])=>[r.substring(`${e}_`.length),St(n)])),St=t=>Array.isArray(t)?t[0]:t;var At=(r=>(r.RU="ru",r.EN="en",r))(At||{});export{ue as CurrentClientBrowser,ce as CurrentClientDevice,yt as ErrorCategory,At as InterfaceLanguage,D as Logger,u as Observable,x as Subject,m as Subscription,Ve as VERSION,Ot as VKNumericLanguage,V as ValueSubject,j as VideoQuality,Be as abortable,ze as addScript,ct as areQualitiesExact,Fe as assertEmptyArray,I as assertNever,_e as assertNonNullable,Ue as assertNotEmptyArray,De as assertNullable,pt as assertQualityIsExact,fe as buffer,Qe as checkNever,dt as cloneDeep,N as cloneDeepWith,be as combine,me as debounce,G as debounceFn,rt as detectEmbed,bt as fillWithDefault,ve as filter,xe as filterChanged,xt as fromEvent,M as getCurrentBrowser,$e as getExponentialDelay,st as getHighestQuality,Ge as getIOSVersion,vt as interval,qe as isAndroid,nt as isHigher,ot as isHigherOrEqual,We as isIOS,W as isInvariantQuality,B as isLower,it as isLowerOrEqual,He as isMacLike,Ke as isMobile,w as isNonNullable,U as isNullable,Yn as loadVKLangPack,Q as map,he as mapTo,de as merge,g as noop,je as now,It as observableFrom,mt as observeElementSize,ge as once,ye as pairwise,z as safeStorage,Oe as tap,Te as throttle,q as throttleFn,sr as timeCodeToString,Tt as timeout,at as videoHeightToQuality,ut as videoQualityToHeight,lt as videoSizeToQuality};
package/es2018.cjs.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
- * @vkontakte/videoplayer-shared v1.0.36-dev.e23ad8e3.0
3
- * Mon, 03 Jun 2024 05:52:59 GMT
4
- * https://st.mycdn.me/static/vkontakte-videoplayer/1-0-36/doc/
2
+ * @vkontakte/videoplayer-shared v1.0.37-beta.0
3
+ * Tue, 16 Jul 2024 14:55:16 GMT
4
+ * https://st.mycdn.me/static/vkontakte-videoplayer/1-0-37/doc/
5
5
  */
6
- "use strict";const wn="1.0.36-dev.e23ad8e3.0";class H{constructor(){this.subscriptions=[]}unsubscribe(){const r=this.subscriptions;this.subscriptions=[],r.forEach(t=>typeof t=="function"?t():t.unsubscribe())}add(r){return this.subscriptions.push(r),this}}const M=e=>{throw new Error(`${e} is value of unexpected type`)},On=e=>{},B=()=>{};class g{constructor(r){r&&(this._subscribe=r)}subscribe(r,t){var n;let o;t?typeof t=="function"?o={next:t,error:B}:o={next:a=>t.next(a),error:a=>{var l;return(l=t.error)===null||l===void 0?void 0:l.call(t,a)}}:o={next:B,error:B};const i=typeof r=="function"?{next:a=>{try{r(a)}catch(l){o.next(l)}},error:a=>o.next(a)}:{next:a=>r.next(a),error:a=>r.error?r.error(a):o.next(a)};let s;try{s=this._subscribe(i)}catch(a){(n=i.error)===null||n===void 0||n.call(i,a)}return new H().add(()=>{switch(i.next=B,i.error=B,typeof s){case"function":s();return;case"object":s.unsubscribe();return;case"undefined":return;default:return M(s)}})}pipe(...r){return r.reduce((t,n)=>n(t),this)}_subscribe(r){}}class Je extends g{constructor(){super(),this.keyCounter=0,this.subscribers=new Map}next(r){this.subscribers.forEach(t=>t.next(r))}error(r){this.subscribers.forEach(t=>{var n;return(n=t.error)===null||n===void 0?void 0:n.call(t,r)})}_subscribe(r){const t=this.keyCounter++;return this.subscribers.set(t,r),new H().add(()=>this.subscribers.delete(t))}}class En{constructor(){this.log$=new Je,this.logs=[],this.log=r=>{const t={...r,timestamp:Date.now()};this.logs.push(t),this.log$.next(t)},this.getAllLogs=()=>this.logs}createCustomLog(r){return(...t)=>{let n;try{n=r(...t)}catch(o){n={message:"error in `createCustomLog`",component:"Logger"}}this.log(n)}}createComponentLog(r){return this.createCustomLog(t=>({component:r,...t}))}}function Sn(e,r='Assertion "value is not nullable" failed'){if(e==null)throw new Error(r)}function $n(e,r='Assertion "value is nullable" failed'){if(e!=null)throw new Error(r)}function de(e){return typeof e!="undefined"&&e!==null}function vt(e){return e==null}function Tn(e,r){if(!(e!=null&&e.length))throw new Error(r)}function In(e,r){if(e!=null&&e.length)throw new Error(r)}const Rn=(e,r,t)=>new Promise((n,o)=>{r.addEventListener("abort",()=>{a(),c.remove()});const i=()=>{a(),o()},s=()=>{a(),n()},a=()=>{l&&clearTimeout(l),c.removeEventListener("load",s),c.removeEventListener("error",i)};let l;t&&(l=window.setTimeout(i,t));const c=document.createElement("script");c.addEventListener("load",s),c.addEventListener("error",i),c.src=e,document.head.appendChild(c)});var me;const Pn=typeof((me=window.performance)===null||me===void 0?void 0:me.now)=="function"?()=>window.performance.now():()=>Date.now(),_n=(e,r)=>async(...t)=>{var n;const o=r(...t);let i=e.aborted,s;for(;!i&&!e.aborted;)try{const a=await o.next(s);i=(n=a.done)!==null&&n!==void 0?n:!1,s=a.value}catch(a){await o.throw(a)}return s};exports.CurrentClientBrowser=void 0;(function(e){e.Unknown="Unknown",e.Yandex="Yandex",e.Chrome="Chrome",e.Chromium="Chromium",e.Firefox="Firefox",e.Safari="Safari",e.Opera="Opera",e.Edge="Edge",e.Rest="Rest"})(exports.CurrentClientBrowser||(exports.CurrentClientBrowser={}));exports.CurrentClientDevice=void 0;(function(e){e.Unknown="Unknown",e.Android="Android",e.iPhone="iPhone",e.iPad="iPad",e.iPod="iPod",e.RestMobile="RestMobile",e.Mac="Mac",e.Desktop="Desktop"})(exports.CurrentClientDevice||(exports.CurrentClientDevice={}));const Ze=()=>{const{userAgent:e}=window.navigator,r=/yabrowser/i.test(e)?exports.CurrentClientBrowser.Yandex:void 0,t=/chrome|crios/i.test(e)?exports.CurrentClientBrowser.Chrome:void 0,n=/chromium/i.test(e)?exports.CurrentClientBrowser.Chromium:void 0,o=/firefox|fxios/i.test(e)?exports.CurrentClientBrowser.Firefox:void 0,i=/webkit|safari|khtml/i.test(e)?exports.CurrentClientBrowser.Safari:void 0,s=/opr\//i.test(e)?exports.CurrentClientBrowser.Opera:void 0,a=/edg/i.test(e)?exports.CurrentClientBrowser.Edge:void 0,l=/android/i.test(e)?exports.CurrentClientDevice.Android:void 0,c=/iphone/i.test(e)?exports.CurrentClientDevice.iPhone:void 0,u=/ipad/i.test(e)?exports.CurrentClientDevice.iPad:void 0,v=/ipod/i.test(e)?exports.CurrentClientDevice.iPod:void 0,f=/mac/i.test(e)?exports.CurrentClientDevice.Mac:void 0,d=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(e)?exports.CurrentClientDevice.RestMobile:void 0;return{browser:r||o||s||a||t||n||i||exports.CurrentClientBrowser.Rest,device:l||c||u||v||d||f||exports.CurrentClientDevice.Desktop}},An=(e=!1)=>{const t=[exports.CurrentClientDevice.iPhone,exports.CurrentClientDevice.iPad,exports.CurrentClientDevice.iPod].includes(Ze().device);if(!e)return t;const{userAgent:n,maxTouchPoints:o}=window.navigator;return!!(t||/macintosh/i.test(n)&&o>0)},Cn=()=>{const{userAgent:e}=window.navigator,r=e.match(/Version\/(\d+(\.\d+)?)/i);if(!r)return null;const t=r[1],n=parseFloat(t);return isNaN(n)?null:n},Ln=()=>[exports.CurrentClientDevice.Mac,exports.CurrentClientDevice.iPhone,exports.CurrentClientDevice.iPad,exports.CurrentClientDevice.iPod].includes(Ze().device),xn=()=>{var e,r;return/Mobile|mini|Fennec|Android|iP(ad|od|hone)/.test((e=navigator.appVersion)!==null&&e!==void 0?e:navigator.userAgent)||((r=navigator==null?void 0:navigator.userAgentData)===null||r===void 0?void 0:r.mobile)},jn=(e,{start:r=0,factor:t=2,max:n=1/0,min:o=r,random:i=0}={})=>{let s=r;return s*=t**e,s*=1+(Math.random()*i*2-i),s=Math.round(s),s=Math.min(s,n),s=Math.max(s,o),s};var b;(function(e){e[e.LOCAL_STORAGE=0]="LOCAL_STORAGE",e[e.SESSION_STORAGE=1]="SESSION_STORAGE",e[e.RUNTIME=2]="RUNTIME"})(b||(b={}));let E,j;const we=`vk-videoplayer-dummy-key-${Math.random()}`,Q=()=>{if(j!==void 0)return j;try{localStorage.setItem(we,"test"),localStorage.removeItem(we),j=b.LOCAL_STORAGE}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem(we),j=b.SESSION_STORAGE}catch(r){if(r instanceof DOMException||r instanceof TypeError)j=b.RUNTIME;else throw r}else throw e}return j===b.RUNTIME&&(E=new Map),j},Mn=()=>Q()===b.LOCAL_STORAGE,Nn=e=>{var r,t;const n=Q();switch(n){case b.LOCAL_STORAGE:return(r=localStorage.getItem(e))!==null&&r!==void 0?r:void 0;case b.SESSION_STORAGE:return(t=sessionStorage.getItem(e))!==null&&t!==void 0?t:void 0;case b.RUNTIME:return E==null?void 0:E.get(e);default:M(n)}},Dn=(e,r)=>{const t=Q();switch(t){case b.LOCAL_STORAGE:try{localStorage.setItem(e,r)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case b.SESSION_STORAGE:try{sessionStorage.setItem(e,r)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case b.RUNTIME:return void(E==null?void 0:E.set(e,r));default:M(t)}},Fn=e=>{var r;const t=Q();switch(t){case b.LOCAL_STORAGE:return e in localStorage;case b.SESSION_STORAGE:return e in sessionStorage;case b.RUNTIME:return(r=E==null?void 0:E.has(e))!==null&&r!==void 0?r:!1;default:return M(t),!1}},Gn=e=>{const r=Q();switch(r){case b.LOCAL_STORAGE:return localStorage.removeItem(e);case b.SESSION_STORAGE:return sessionStorage.removeItem(e);case b.RUNTIME:return void(E==null?void 0:E.delete(e));default:M(r)}},kn=()=>{const e=Q();switch(e){case b.LOCAL_STORAGE:return localStorage.clear();case b.SESSION_STORAGE:return sessionStorage.clear();case b.RUNTIME:return E==null?void 0:E.clear();default:M(e)}};var Vn=Object.freeze({__proto__:null,clear:kn,get:Nn,has:Fn,isPersistent:Mn,remove:Gn,set:Dn});const Bn=()=>{let e,r;try{e=window.self!==window.top}catch(n){n instanceof DOMException&&n.name==="SecurityError"?e=!0:(e=!1,console.error(n))}try{window.location.ancestorOrigins&&(r=window.location.ancestorOrigins[window.location.ancestorOrigins.length-1])}catch(n){console.error(n)}try{!r&&document.referrer&&(r=document.referrer)}catch(n){console.error(n)}const t=r?new URL(r).hostname:void 0;return{isEmbed:e,host:t}};exports.VideoQuality=void 0;(function(e){e.INVARIANT="Invariant quality",e.Q_144P="144p",e.Q_240P="240p",e.Q_360P="360p",e.Q_480P="480p",e.Q_720P="720p",e.Q_1080P="1080p",e.Q_1440P="1440p",e.Q_2160P="2160p",e.Q_4320P="4320p"})(exports.VideoQuality||(exports.VideoQuality={}));const S={[exports.VideoQuality.Q_144P]:{width:256,height:144},[exports.VideoQuality.Q_240P]:{width:428,height:240},[exports.VideoQuality.Q_360P]:{width:640,height:360},[exports.VideoQuality.Q_480P]:{width:856,height:480},[exports.VideoQuality.Q_720P]:{width:1280,height:720},[exports.VideoQuality.Q_1080P]:{width:1920,height:1080},[exports.VideoQuality.Q_1440P]:{width:2560,height:1440},[exports.VideoQuality.Q_2160P]:{width:3840,height:2160},[exports.VideoQuality.Q_4320P]:{width:7680,height:4320}},Un=(e,r)=>S[e].height>S[r].height,Qn=(e,r)=>S[e].height>=S[r].height,er=(e,r)=>S[e].height<S[r].height,qn=(e,r)=>S[e].height<=S[r].height,Kn=e=>e.sort((r,t)=>r===t?0:r===exports.VideoQuality.INVARIANT?1:t===exports.VideoQuality.INVARIANT?-1:er(r,t)?1:-1)[0],dt=Object.keys(S).sort((e,r)=>er(e,r)?-1:1),zn=(e,r=.02)=>[...dt].find(n=>S[n].height*(1+r)>=e),Wn=({width:e,height:r})=>{const t=Math.min(e,r),n=Math.max(e,r);return dt.find(o=>{const i=S[o];return i.width>=n&&i.height>=t})},Yn=e=>S[e].height,rr=e=>e===exports.VideoQuality.INVARIANT,Hn=e=>e.every(r=>!rr(r));function Xn(e){if(rr(e))throw new Error("Expected exact quality")}const ht=(e,r)=>{const t={};for(const n of Object.keys(r)){const o=r[n],i=e[n];Array.isArray(o)&&Array.isArray(i)?t[n]=i:typeof o=="object"&&typeof i=="object"?t[n]=ht(i,o):t[n]=n in e?i:o}return t},Jn=e=>{let r="";return e>=3600&&(r+=Math.floor(e/3600)+"h",e=e%3600),e>=60&&(r+=Math.floor(e/60)+"m",e=e%60),e>0&&(r+=Math.floor(e)+"s"),r};function bt(e,r=0,t){let n,o,i,s,a,l,c=0,u=!1,v=!1,f=!0;const d=!r&&r!==0&&typeof window.requestAnimationFrame=="function";t&&(u=!!t.leading,v="maxWait"in t,i=t!=null&&t.maxWait?Math.max(+(t==null?void 0:t.maxWait)||0,r):i,f="trailing"in t?!!t.trailing:f);function p(h){const $=n,x=o;return n=o=void 0,c=h,s=e.apply(x,$),s}function y(h,$){return d?(a&&window.cancelAnimationFrame(a),window.requestAnimationFrame(h)):setTimeout(h,$)}function O(h){if(d){window.cancelAnimationFrame(h);return}clearTimeout(h)}function m(h){return c=h,a=y(ee,r),u?p(h):s}function w(h){const $=h-l,x=h-c,gr=r-$;return v?Math.min(gr,i-x):gr}function pr(h){const $=h-l,x=h-c;return l===void 0||$>=r||$<0||v&&x>=i}function ee(){const h=Date.now();if(pr(h))return yr(h);a=y(ee,w(h))}function yr(h){return a=void 0,f&&n?p(h):(n=o=void 0,s)}function yn(){a!==void 0&&O(a),c=0,n=l=o=a=void 0}function gn(){return a===void 0?s:yr(Date.now())}function mn(){return a!==void 0}function re(...h){const $=Date.now(),x=pr($);if(n=h,o=this,l=$,x){if(a===void 0)return m(l);if(v)return a=y(ee,r),p(l)}return a===void 0&&(a=y(ee,r)),s}return re.cancel=yn,re.flush=gn,re.pending=mn,re}const pt=(e,r=0,t)=>bt(e,r,{...{leading:!0,trailing:!0},...t,maxWait:r}),tr=(e,r)=>{if(e===null||typeof e!="object")return e;const t=Array.isArray(e)?[]:{};for(const n in e){if(typeof r=="function"){const o=r(e[n],n,e,t);if(o!==void 0){t[n]=o;continue}}typeof e[n]=="object"?t[n]=tr(e[n],r):t[n]=e[n]}return t},Zn=e=>tr(e),eo=300,ro=(e,r=eo)=>new g(t=>{const{width:n,height:o}=e.getBoundingClientRect();if(t.next({width:n,height:o}),!window.ResizeObserver)return;const i=new ResizeObserver(pt(s=>{const a=s[0];if(!a)return;let l,c;a.contentBoxSize&&a.contentBoxSize[0]?(c=a.contentBoxSize[0].blockSize,l=a.contentBoxSize[0].inlineSize):a.contentRect&&(l=a.contentRect.width,c=a.contentRect.height),de(l)&&de(c)&&t.next({width:l,height:c})},r));return i.observe(e),()=>i.disconnect()});class to extends Je{constructor(r){super(),this.value=r}next(r){super.next(this.value=r)}error(r){super.error(this.value=r)}getValue(){return this.value}_subscribe(r){const t=super._subscribe(r);return r.next(this.value),t}}function no(e){return new g(r=>{const t={};let n=Object.keys(e).length;const o=i=>s=>{i in t||n--,t[i]=s,n===0&&r.next(t)};return Object.entries(e).reduce((i,[s,a])=>i.add(a.subscribe(o(s))),new H)})}function oo(...e){return new g(r=>e.reduce((t,n)=>t.add(n.subscribe(r)),new H))}var io=e=>new g(r=>{const t=window.setTimeout(()=>{try{r.next()}catch(n){if(r.error)r.error(n);else throw n}},e);return()=>window.clearTimeout(t)}),ao=e=>new g(r=>{let t=window.setInterval(()=>r.next(),e);return()=>{t&&(window.clearInterval(t),t=void 0)}}),so=e=>new g(r=>{e.forEach(t=>r.next(t))}),co=(e,r)=>new g(t=>{const n=o=>t.next(o);return e.addEventListener(r,n),()=>e.removeEventListener(r,n)});function lo(e){return r=>new g(t=>r.subscribe(new uo(t,e)))}class uo{constructor(r,t){this.destination=r,this.size=t,this.lastValues=[]}next(r){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(r),this.destination.next(this.lastValues)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}const fo={leading:!1,trailing:!0};function vo(e,r=fo){return t=>new g(n=>t.subscribe(new ho(n,e,r)))}class ho{constructor(r,t,n){this.destination=r,this.time=t,this.config=n}next(r){this.lastValue=r,de(this.timeout)?window.clearTimeout(this.timeout):this.config.leading&&this.destination.next(r),this.timeout=window.setTimeout(()=>{if(this.config.trailing)try{this.destination.next(this.lastValue)}catch(t){if(this.destination.error)this.destination.error(t);else throw t}this.timeout=void 0},this.time)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}const bo={leading:!0,trailing:!1};function po(e,r=bo){return t=>new g(n=>t.subscribe(new yo(n,e,r)))}class yo{constructor(r,t,n){this.destination=r,this.time=t,this.config=n}next(r){this.lastValue=r,vt(this.timeout)&&(this.config.leading&&this.destination.next(r),this.timeout=window.setTimeout(()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0},this.time))}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function go(e){return r=>new g(t=>r.subscribe(new mo(t,e)))}class mo{constructor(r,t){this.destination=r,this.predicate=t}next(r){let t;try{t=this.predicate(r)}catch(n){throw this.error(n),n}t&&this.destination.next(r)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function wo(e=(r,t)=>r===t){return r=>new g(t=>r.subscribe(new Oo(t,e)))}const mr={};class Oo{constructor(r,t){this.destination=r,this.predicate=t,this.lastValue=mr}next(r){let t;try{t=this.lastValue===mr||!this.predicate(this.lastValue,r),this.lastValue=r}catch(n){throw this.error(n),n}t&&this.destination.next(r)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function yt(e){return r=>new g(t=>r.subscribe(new Eo(t,e)))}let Eo=class{constructor(r,t){this.destination=r,this.mapper=t}next(r){let t;try{t=this.mapper(r)}catch(n){throw this.error(n),n}this.destination.next(t)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}};function So(e){return yt(()=>e)}function $o(){return e=>new g(r=>{let t=!1,n=!1;const o=e.subscribe(i=>{t||(t=!0,r.next(i)),n&&o.unsubscribe()},i=>{var s;t=!0,(s=r.error)===null||s===void 0||s.call(r,i),n&&o.unsubscribe()});return n=!0,t&&o.unsubscribe(),o})}function To(){return e=>new g(r=>e.subscribe(new Io(r)))}class Io{constructor(r){this.destination=r,this.hasLast=!1}next(r){const t=this.last;if(this.last=r,!this.hasLast){this.hasLast=!0;return}this.destination.next([t,r])}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function Ro(e){return r=>new g(t=>r.subscribe(new Po(t,e)))}class Po{constructor(r,t){this.destination=r,this.effect=t}next(r){try{this.effect(r)}catch(t){throw this.error(t),t}this.destination.next(r)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}exports.ErrorCategory=void 0;(function(e){e.NETWORK="network",e.VIDEO_PIPELINE="video_pipeline",e.EXTERNAL_API="external_api",e.PARSER="parser",e.DOM="dom",e.WTF="wtf",e.FATAL="fatal"})(exports.ErrorCategory||(exports.ErrorCategory={}));class wr{constructor(){Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}addEventListener(r,t,n){r in this.listeners||(this.listeners[r]=[]),this.listeners[r].push({callback:t,options:n})}removeEventListener(r,t){if(!(r in this.listeners))return;const n=this.listeners[r];for(let o=0,i=n.length;o<i;o++)if(n[o].callback===t){n.splice(o,1);return}}dispatchEvent(r){if(!(r.type in this.listeners))return;const n=this.listeners[r.type].slice();for(let o=0,i=n.length;o<i;o++){const s=n[o];try{s.callback.call(this,r)}catch(a){Promise.resolve().then(()=>{throw a})}s.options&&s.options.once&&this.removeEventListener(r.type,s.callback)}return!r.defaultPrevented}}class gt extends wr{constructor(){super(),this.listeners||wr.call(this),Object.defineProperty(this,"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"onabort",{value:null,writable:!0,configurable:!0}),Object.defineProperty(this,"reason",{value:void 0,writable:!0,configurable:!0})}toString(){return"[object AbortSignal]"}dispatchEvent(r){r.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,r)),super.dispatchEvent(r)}}class _o{constructor(){Object.defineProperty(this,"signal",{value:new gt,writable:!0,configurable:!0})}abort(r){let t;try{t=new Event("abort")}catch(o){typeof document!="undefined"?document.createEvent?(t=document.createEvent("Event"),t.initEvent("abort",!1,!1)):(t=document.createEventObject(),t.type="abort"):t={type:"abort",bubbles:!1,cancelable:!1}}let n=r;if(n===void 0)if(typeof document=="undefined")n=new Error("This operation was aborted"),n.name="AbortError";else try{n=new DOMException("signal is aborted without reason")}catch(o){n=new Error("This operation was aborted"),n.name="AbortError"}this.signal.reason=n,this.signal.dispatchEvent(t)}toString(){return"[object AbortController]"}}typeof Symbol!="undefined"&&Symbol.toStringTag&&(_o.prototype[Symbol.toStringTag]="AbortController",gt.prototype[Symbol.toStringTag]="AbortSignal");function mt(e){return e.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):typeof e.Request=="function"&&!e.Request.prototype.hasOwnProperty("signal")||!e.AbortController}function Ao(e){typeof e=="function"&&(e={fetch:e});const{fetch:r,Request:t=r.Request,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o=!1}=e;if(!mt({fetch:r,Request:t,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o}))return{fetch:r,Request:i};let i=t;(i&&!i.prototype.hasOwnProperty("signal")||o)&&(i=function(c,u){let v;u&&u.signal&&(v=u.signal,delete u.signal);const f=new t(c,u);return v&&Object.defineProperty(f,"signal",{writable:!1,enumerable:!1,configurable:!0,value:v}),f},i.prototype=t.prototype);const s=r;return{fetch:(l,c)=>{const u=i&&i.prototype.isPrototypeOf(l)?l.signal:c?c.signal:void 0;if(u){let v;try{v=new DOMException("Aborted","AbortError")}catch(d){v=new Error("Aborted"),v.name="AbortError"}if(u.aborted)return Promise.reject(v);const f=new Promise((d,p)=>{u.addEventListener("abort",()=>p(v),{once:!0})});return c&&c.signal&&delete c.signal,Promise.race([f,s(l,c)])}return s(l,c)},Request:i}}const nr=mt({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),wt=nr?Ao({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,Co=nr?wt.fetch:window.fetch;nr?wt.Request:window.Request;var Oe=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function Lo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var A=function(e){try{return!!e()}catch(r){return!0}},xo=A,ye=!xo(function(){var e=function(){}.bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),Ot=ye,Et=Function.prototype,Ue=Et.call,jo=Ot&&Et.bind.bind(Ue,Ue),N=Ot?jo:function(e){return function(){return Ue.apply(e,arguments)}},St=N,Mo=St({}.toString),No=St("".slice),or=function(e){return No(Mo(e),8,-1)},Do=N,Fo=A,Go=or,Ee=Object,ko=Do("".split),Vo=Fo(function(){return!Ee("z").propertyIsEnumerable(0)})?function(e){return Go(e)=="String"?ko(e,""):Ee(e)}:Ee,ir=function(e){return e==null},Bo=ir,Uo=TypeError,$t=function(e){if(Bo(e))throw Uo("Can't call method on "+e);return e},Qo=Vo,qo=$t,X=function(e){return Qo(qo(e))},q={},te=function(e){return e&&e.Math==Math&&e},I=te(typeof globalThis=="object"&&globalThis)||te(typeof window=="object"&&window)||te(typeof self=="object"&&self)||te(typeof Oe=="object"&&Oe)||function(){return this}()||Oe||Function("return this")(),Qe=typeof document=="object"&&document.all,Ko=typeof Qe=="undefined"&&Qe!==void 0,Tt={all:Qe,IS_HTMLDDA:Ko},It=Tt,zo=It.all,R=It.IS_HTMLDDA?function(e){return typeof e=="function"||e===zo}:function(e){return typeof e=="function"},Wo=I,Yo=R,Or=Wo.WeakMap,Ho=Yo(Or)&&/native code/.test(String(Or)),Er=R,Rt=Tt,Xo=Rt.all,K=Rt.IS_HTMLDDA?function(e){return typeof e=="object"?e!==null:Er(e)||e===Xo}:function(e){return typeof e=="object"?e!==null:Er(e)},Jo=A,D=!Jo(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),z={},Zo=I,Sr=K,qe=Zo.document,ei=Sr(qe)&&Sr(qe.createElement),Pt=function(e){return ei?qe.createElement(e):{}},ri=D,ti=A,ni=Pt,_t=!ri&&!ti(function(){return Object.defineProperty(ni("div"),"a",{get:function(){return 7}}).a!=7}),oi=D,ii=A,At=oi&&ii(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42}),ai=K,si=String,ci=TypeError,W=function(e){if(ai(e))return e;throw ci(si(e)+" is not an object")},li=ye,ne=Function.prototype.call,F=li?ne.bind(ne):function(){return ne.apply(ne,arguments)},ar={},Se=ar,$e=I,ui=R,$r=function(e){return ui(e)?e:void 0},Ct=function(e,r){return arguments.length<2?$r(Se[e])||$r($e[e]):Se[e]&&Se[e][r]||$e[e]&&$e[e][r]},fi=N,Lt=fi({}.isPrototypeOf),vi=typeof navigator!="undefined"&&String(navigator.userAgent)||"",xt=I,Te=vi,Tr=xt.process,Ir=xt.Deno,Rr=Tr&&Tr.versions||Ir&&Ir.version,Pr=Rr&&Rr.v8,T,he;Pr&&(T=Pr.split("."),he=T[0]>0&&T[0]<4?1:+(T[0]+T[1]));!he&&Te&&(T=Te.match(/Edge\/(\d+)/),(!T||T[1]>=74)&&(T=Te.match(/Chrome\/(\d+)/),T&&(he=+T[1])));var di=he,_r=di,hi=A,bi=I,pi=bi.String,jt=!!Object.getOwnPropertySymbols&&!hi(function(){var e=Symbol();return!pi(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&_r&&_r<41}),yi=jt,Mt=yi&&!Symbol.sham&&typeof Symbol.iterator=="symbol",gi=Ct,mi=R,wi=Lt,Oi=Mt,Ei=Object,Nt=Oi?function(e){return typeof e=="symbol"}:function(e){var r=gi("Symbol");return mi(r)&&wi(r.prototype,Ei(e))},Si=String,sr=function(e){try{return Si(e)}catch(r){return"Object"}},$i=R,Ti=sr,Ii=TypeError,cr=function(e){if($i(e))return e;throw Ii(Ti(e)+" is not a function")},Ri=cr,Pi=ir,lr=function(e,r){var t=e[r];return Pi(t)?void 0:Ri(t)},Ie=F,Re=R,Pe=K,_i=TypeError,Ai=function(e,r){var t,n;if(r==="string"&&Re(t=e.toString)&&!Pe(n=Ie(t,e))||Re(t=e.valueOf)&&!Pe(n=Ie(t,e))||r!=="string"&&Re(t=e.toString)&&!Pe(n=Ie(t,e)))return n;throw _i("Can't convert object to primitive value")},Dt={exports:{}},Ar=I,Ci=Object.defineProperty,Li=function(e,r){try{Ci(Ar,e,{value:r,configurable:!0,writable:!0})}catch(t){Ar[e]=r}return r},xi=I,ji=Li,Cr="__core-js_shared__",Mi=xi[Cr]||ji(Cr,{}),Ft=Mi,Lr=Ft;(Dt.exports=function(e,r){return Lr[e]||(Lr[e]=r!==void 0?r:{})})("versions",[]).push({version:"3.31.0",mode:"pure",copyright:"\xA9 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.31.0/LICENSE",source:"https://github.com/zloirock/core-js"});var Gt=Dt.exports,Ni=$t,Di=Object,kt=function(e){return Di(Ni(e))},Fi=N,Gi=kt,ki=Fi({}.hasOwnProperty),L=Object.hasOwn||function(r,t){return ki(Gi(r),t)},Vi=N,Bi=0,Ui=Math.random(),Qi=Vi(1 .toString),Vt=function(e){return"Symbol("+(e===void 0?"":e)+")_"+Qi(++Bi+Ui,36)},qi=I,Ki=Gt,xr=L,zi=Vt,Wi=jt,Yi=Mt,U=qi.Symbol,_e=Ki("wks"),Hi=Yi?U.for||U:U&&U.withoutSetter||zi,C=function(e){return xr(_e,e)||(_e[e]=Wi&&xr(U,e)?U[e]:Hi("Symbol."+e)),_e[e]},Xi=F,jr=K,Mr=Nt,Ji=lr,Zi=Ai,ea=C,ra=TypeError,ta=ea("toPrimitive"),na=function(e,r){if(!jr(e)||Mr(e))return e;var t=Ji(e,ta),n;if(t){if(r===void 0&&(r="default"),n=Xi(t,e,r),!jr(n)||Mr(n))return n;throw ra("Can't convert object to primitive value")}return r===void 0&&(r="number"),Zi(e,r)},oa=na,ia=Nt,ur=function(e){var r=oa(e,"string");return ia(r)?r:r+""},aa=D,sa=_t,ca=At,oe=W,Nr=ur,la=TypeError,Ae=Object.defineProperty,ua=Object.getOwnPropertyDescriptor,Ce="enumerable",Le="configurable",xe="writable";z.f=aa?ca?function(r,t,n){if(oe(r),t=Nr(t),oe(n),typeof r=="function"&&t==="prototype"&&"value"in n&&xe in n&&!n[xe]){var o=ua(r,t);o&&o[xe]&&(r[t]=n.value,n={configurable:Le in n?n[Le]:o[Le],enumerable:Ce in n?n[Ce]:o[Ce],writable:!1})}return Ae(r,t,n)}:Ae:function(r,t,n){if(oe(r),t=Nr(t),oe(n),sa)try{return Ae(r,t,n)}catch(o){}if("get"in n||"set"in n)throw la("Accessors not supported");return"value"in n&&(r[t]=n.value),r};var ge=function(e,r){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:r}},fa=D,va=z,da=ge,J=fa?function(e,r,t){return va.f(e,r,da(1,t))}:function(e,r,t){return e[r]=t,e},ha=Gt,ba=Vt,Dr=ha("keys"),fr=function(e){return Dr[e]||(Dr[e]=ba(e))},vr={},pa=Ho,Bt=I,ya=K,ga=J,je=L,Me=Ft,ma=fr,wa=vr,Fr="Object already initialized",Ke=Bt.TypeError,Oa=Bt.WeakMap,be,Y,pe,Ea=function(e){return pe(e)?Y(e):be(e,{})},Sa=function(e){return function(r){var t;if(!ya(r)||(t=Y(r)).type!==e)throw Ke("Incompatible receiver, "+e+" required");return t}};if(pa||Me.state){var P=Me.state||(Me.state=new Oa);P.get=P.get,P.has=P.has,P.set=P.set,be=function(e,r){if(P.has(e))throw Ke(Fr);return r.facade=e,P.set(e,r),r},Y=function(e){return P.get(e)||{}},pe=function(e){return P.has(e)}}else{var G=ma("state");wa[G]=!0,be=function(e,r){if(je(e,G))throw Ke(Fr);return r.facade=e,ga(e,G,r),r},Y=function(e){return je(e,G)?e[G]:{}},pe=function(e){return je(e,G)}}var $a={set:be,get:Y,has:pe,enforce:Ea,getterFor:Sa},Ta=ye,Ut=Function.prototype,Gr=Ut.apply,kr=Ut.call,Ia=typeof Reflect=="object"&&Reflect.apply||(Ta?kr.bind(Gr):function(){return kr.apply(Gr,arguments)}),Ra=or,Pa=N,Qt=function(e){if(Ra(e)==="Function")return Pa(e)},qt={},Kt={},zt={}.propertyIsEnumerable,Wt=Object.getOwnPropertyDescriptor,_a=Wt&&!zt.call({1:2},1);Kt.f=_a?function(r){var t=Wt(this,r);return!!t&&t.enumerable}:zt;var Aa=D,Ca=F,La=Kt,xa=ge,ja=X,Ma=ur,Na=L,Da=_t,Vr=Object.getOwnPropertyDescriptor;qt.f=Aa?Vr:function(r,t){if(r=ja(r),t=Ma(t),Da)try{return Vr(r,t)}catch(n){}if(Na(r,t))return xa(!Ca(La.f,r,t),r[t])};var Fa=A,Ga=R,ka=/#|\.prototype\./,Z=function(e,r){var t=Ba[Va(e)];return t==Qa?!0:t==Ua?!1:Ga(r)?Fa(r):!!r},Va=Z.normalize=function(e){return String(e).replace(ka,".").toLowerCase()},Ba=Z.data={},Ua=Z.NATIVE="N",Qa=Z.POLYFILL="P",qa=Z,Br=Qt,Ka=cr,za=ye,Wa=Br(Br.bind),Yt=function(e,r){return Ka(e),r===void 0?e:za?Wa(e,r):function(){return e.apply(r,arguments)}},ie=I,Ya=Ia,Ha=Qt,Xa=R,Ja=qt.f,Za=qa,k=ar,es=Yt,V=J,Ur=L,rs=function(e){var r=function(t,n,o){if(this instanceof r){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,o)}return Ya(e,this,arguments)};return r.prototype=e.prototype,r},Ht=function(e,r){var t=e.target,n=e.global,o=e.stat,i=e.proto,s=n?ie:o?ie[t]:(ie[t]||{}).prototype,a=n?k:k[t]||V(k,t,{})[t],l=a.prototype,c,u,v,f,d,p,y,O,m;for(f in r)c=Za(n?f:t+(o?".":"#")+f,e.forced),u=!c&&s&&Ur(s,f),p=a[f],u&&(e.dontCallGetSet?(m=Ja(s,f),y=m&&m.value):y=s[f]),d=u&&y?y:r[f],!(u&&typeof p==typeof d)&&(e.bind&&u?O=es(d,ie):e.wrap&&u?O=rs(d):i&&Xa(d)?O=Ha(d):O=d,(e.sham||d&&d.sham||p&&p.sham)&&V(O,"sham",!0),V(a,f,O),i&&(v=t+"Prototype",Ur(k,v)||V(k,v,{}),V(k[v],f,d),e.real&&l&&(c||!l[f])&&V(l,f,d)))},ze=D,ts=L,Xt=Function.prototype,ns=ze&&Object.getOwnPropertyDescriptor,dr=ts(Xt,"name"),os=dr&&function(){}.name==="something",is=dr&&(!ze||ze&&ns(Xt,"name").configurable),as={EXISTS:dr,PROPER:os,CONFIGURABLE:is},Jt={},ss=Math.ceil,cs=Math.floor,ls=Math.trunc||function(r){var t=+r;return(t>0?cs:ss)(t)},us=ls,Zt=function(e){var r=+e;return r!==r||r===0?0:us(r)},fs=Zt,vs=Math.max,ds=Math.min,hs=function(e,r){var t=fs(e);return t<0?vs(t+r,0):ds(t,r)},bs=Zt,ps=Math.min,ys=function(e){return e>0?ps(bs(e),9007199254740991):0},gs=ys,en=function(e){return gs(e.length)},ms=X,ws=hs,Os=en,Qr=function(e){return function(r,t,n){var o=ms(r),i=Os(o),s=ws(n,i),a;if(e&&t!=t){for(;i>s;)if(a=o[s++],a!=a)return!0}else for(;i>s;s++)if((e||s in o)&&o[s]===t)return e||s||0;return!e&&-1}},Es={includes:Qr(!0),indexOf:Qr(!1)},Ss=N,Ne=L,$s=X,Ts=Es.indexOf,Is=vr,qr=Ss([].push),Rs=function(e,r){var t=$s(e),n=0,o=[],i;for(i in t)!Ne(Is,i)&&Ne(t,i)&&qr(o,i);for(;r.length>n;)Ne(t,i=r[n++])&&(~Ts(o,i)||qr(o,i));return o},rn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Ps=Rs,_s=rn,As=Object.keys||function(r){return Ps(r,_s)},Cs=D,Ls=At,xs=z,js=W,Ms=X,Ns=As;Jt.f=Cs&&!Ls?Object.defineProperties:function(r,t){js(r);for(var n=Ms(t),o=Ns(t),i=o.length,s=0,a;i>s;)xs.f(r,a=o[s++],n[a]);return r};var Ds=Ct,Fs=Ds("document","documentElement"),Gs=W,ks=Jt,Kr=rn,Vs=vr,Bs=Fs,Us=Pt,Qs=fr,zr=">",Wr="<",We="prototype",Ye="script",tn=Qs("IE_PROTO"),De=function(){},nn=function(e){return Wr+Ye+zr+e+Wr+"/"+Ye+zr},Yr=function(e){e.write(nn("")),e.close();var r=e.parentWindow.Object;return e=null,r},qs=function(){var e=Us("iframe"),r="java"+Ye+":",t;return e.style.display="none",Bs.appendChild(e),e.src=String(r),t=e.contentWindow.document,t.open(),t.write(nn("document.F=Object")),t.close(),t.F},ae,ue=function(){try{ae=new ActiveXObject("htmlfile")}catch(r){}ue=typeof document!="undefined"?document.domain&&ae?Yr(ae):qs():Yr(ae);for(var e=Kr.length;e--;)delete ue[We][Kr[e]];return ue()};Vs[tn]=!0;var on=Object.create||function(r,t){var n;return r!==null?(De[We]=Gs(r),n=new De,De[We]=null,n[tn]=r):n=ue(),t===void 0?n:ks.f(n,t)},Ks=A,zs=!Ks(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),Ws=L,Ys=R,Hs=kt,Xs=fr,Js=zs,Hr=Xs("IE_PROTO"),He=Object,Zs=He.prototype,an=Js?He.getPrototypeOf:function(e){var r=Hs(e);if(Ws(r,Hr))return r[Hr];var t=r.constructor;return Ys(t)&&r instanceof t?t.prototype:r instanceof He?Zs:null},ec=J,sn=function(e,r,t,n){return n&&n.enumerable?e[r]=t:ec(e,r,t),e},rc=A,tc=R,nc=K,oc=on,Xr=an,ic=sn,ac=C,Xe=ac("iterator"),cn=!1,_,Fe,Ge;[].keys&&(Ge=[].keys(),"next"in Ge?(Fe=Xr(Xr(Ge)),Fe!==Object.prototype&&(_=Fe)):cn=!0);var sc=!nc(_)||rc(function(){var e={};return _[Xe].call(e)!==e});sc?_={}:_=oc(_);tc(_[Xe])||ic(_,Xe,function(){return this});var ln={IteratorPrototype:_,BUGGY_SAFARI_ITERATORS:cn},cc=C,lc=cc("toStringTag"),un={};un[lc]="z";var hr=String(un)==="[object z]",uc=hr,fc=R,fe=or,vc=C,dc=vc("toStringTag"),hc=Object,bc=fe(function(){return arguments}())=="Arguments",pc=function(e,r){try{return e[r]}catch(t){}},br=uc?fe:function(e){var r,t,n;return e===void 0?"Undefined":e===null?"Null":typeof(t=pc(r=hc(e),dc))=="string"?t:bc?fe(r):(n=fe(r))=="Object"&&fc(r.callee)?"Arguments":n},yc=hr,gc=br,mc=yc?{}.toString:function(){return"[object "+gc(this)+"]"},wc=hr,Oc=z.f,Ec=J,Sc=L,$c=mc,Tc=C,Jr=Tc("toStringTag"),fn=function(e,r,t,n){if(e){var o=t?e:e.prototype;Sc(o,Jr)||Oc(o,Jr,{configurable:!0,value:r}),n&&!wc&&Ec(o,"toString",$c)}},Ic=ln.IteratorPrototype,Rc=on,Pc=ge,_c=fn,Ac=q,Cc=function(){return this},Lc=function(e,r,t,n){var o=r+" Iterator";return e.prototype=Rc(Ic,{next:Pc(+!n,t)}),_c(e,o,!1,!0),Ac[o]=Cc,e},xc=Ht,jc=F,vn=as,Mc=Lc,Nc=an,Dc=fn,Zr=sn,Fc=C,et=q,dn=ln,Gc=vn.PROPER;vn.CONFIGURABLE;dn.IteratorPrototype;var se=dn.BUGGY_SAFARI_ITERATORS,ke=Fc("iterator"),rt="keys",ce="values",tt="entries",kc=function(){return this},Vc=function(e,r,t,n,o,i,s){Mc(t,r,n);var a=function(m){if(m===o&&f)return f;if(!se&&m in u)return u[m];switch(m){case rt:return function(){return new t(this,m)};case ce:return function(){return new t(this,m)};case tt:return function(){return new t(this,m)}}return function(){return new t(this)}},l=r+" Iterator",c=!1,u=e.prototype,v=u[ke]||u["@@iterator"]||o&&u[o],f=!se&&v||a(o),d=r=="Array"&&u.entries||v,p,y,O;if(d&&(p=Nc(d.call(new e)),p!==Object.prototype&&p.next&&(Dc(p,l,!0,!0),et[l]=kc)),Gc&&o==ce&&v&&v.name!==ce&&(c=!0,f=function(){return jc(v,this)}),o)if(y={values:a(ce),keys:i?f:a(rt),entries:a(tt)},s)for(O in y)(se||c||!(O in u))&&Zr(u,O,y[O]);else xc({target:r,proto:!0,forced:se||c},y);return s&&u[ke]!==f&&Zr(u,ke,f,{name:o}),et[r]=f,y},Bc=function(e,r){return{value:e,done:r}},Uc=X,nt=q,hn=$a;z.f;var Qc=Vc,le=Bc,bn="Array Iterator",qc=hn.set,Kc=hn.getterFor(bn);Qc(Array,"Array",function(e,r){qc(this,{type:bn,target:Uc(e),index:0,kind:r})},function(){var e=Kc(this),r=e.target,t=e.kind,n=e.index++;return!r||n>=r.length?(e.target=void 0,le(void 0,!0)):t=="keys"?le(n,!1):t=="values"?le(r[n],!1):le([n,r[n]],!1)},"values");nt.Arguments=nt.Array;var zc=C,Wc=q,Yc=zc("iterator"),Hc=Array.prototype,Xc=function(e){return e!==void 0&&(Wc.Array===e||Hc[Yc]===e)},Jc=br,ot=lr,Zc=ir,el=q,rl=C,tl=rl("iterator"),pn=function(e){if(!Zc(e))return ot(e,tl)||ot(e,"@@iterator")||el[Jc(e)]},nl=F,ol=cr,il=W,al=sr,sl=pn,cl=TypeError,ll=function(e,r){var t=arguments.length<2?sl(e):r;if(ol(t))return il(nl(t,e));throw cl(al(e)+" is not iterable")},ul=F,it=W,fl=lr,vl=function(e,r,t){var n,o;it(e);try{if(n=fl(e,"return"),!n){if(r==="throw")throw t;return t}n=ul(n,e)}catch(i){o=!0,n=i}if(r==="throw")throw t;if(o)throw n;return it(n),t},dl=Yt,hl=F,bl=W,pl=sr,yl=Xc,gl=en,at=Lt,ml=ll,wl=pn,st=vl,Ol=TypeError,ve=function(e,r){this.stopped=e,this.result=r},ct=ve.prototype,El=function(e,r,t){var n=t&&t.that,o=!!(t&&t.AS_ENTRIES),i=!!(t&&t.IS_RECORD),s=!!(t&&t.IS_ITERATOR),a=!!(t&&t.INTERRUPTED),l=dl(r,n),c,u,v,f,d,p,y,O=function(w){return c&&st(c,"normal",w),new ve(!0,w)},m=function(w){return o?(bl(w),a?l(w[0],w[1],O):l(w[0],w[1])):a?l(w,O):l(w)};if(i)c=e.iterator;else if(s)c=e;else{if(u=wl(e),!u)throw Ol(pl(e)+" is not iterable");if(yl(u)){for(v=0,f=gl(e);f>v;v++)if(d=m(e[v]),d&&at(ct,d))return d;return new ve(!1)}c=ml(e,u)}for(p=i?e.next:c.next;!(y=hl(p,c)).done;){try{d=m(y.value)}catch(w){st(c,"throw",w)}if(typeof d=="object"&&d&&at(ct,d))return d}return new ve(!1)},Sl=ur,$l=z,Tl=ge,Il=function(e,r,t){var n=Sl(r);n in e?$l.f(e,n,Tl(0,t)):e[n]=t},Rl=Ht,Pl=El,_l=Il;Rl({target:"Object",stat:!0},{fromEntries:function(r){var t={};return Pl(r,function(n,o){_l(t,n,o)},{AS_ENTRIES:!0}),t}});var Al=ar,Cl=Al.Object.fromEntries,Ll={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},xl=Ll,jl=I,Ml=br,Nl=J,lt=q,Dl=C,ut=Dl("toStringTag");for(var Ve in xl){var ft=jl[Ve],Be=ft&&ft.prototype;Be&&Ml(Be)!==ut&&Nl(Be,ut,Ve),lt[Ve]=lt.Array}var Fl=Cl,Gl=Fl,kl=Gl,Vl=kl,Bl=Lo(Vl);exports.VKNumericLanguage=void 0;(function(e){e.Armenian="58",e.Azerbaijani="57",e.Belarusian="114",e.English="3",e.Kazakh="97",e.Portuguese="73",e.Russian="0",e.Spanish="4",e.Ukrainian="1",e.Uzbek="65",e.Vietnamese="75"})(exports.VKNumericLanguage||(exports.VKNumericLanguage={}));const Ul="vk.com",Ql=async(e,r,t)=>{const n=new URL(`https://${Ul}/js/lang-pack.js`);n.searchParams.set("format","json"),n.searchParams.set("name",r),e!==void 0&&n.searchParams.set("lang",e);const i=await(await Co(n.toString())).json();return ql(i,t)},ql=(e,r)=>Bl(Object.entries(e.keys).map(([t,n])=>[t.substring(`${r}_`.length),Kl(n)])),Kl=e=>Array.isArray(e)?e[0]:e;exports.InterfaceLanguage=void 0;(function(e){e.RU="ru",e.EN="en"})(exports.InterfaceLanguage||(exports.InterfaceLanguage={}));exports.Logger=En;exports.Observable=g;exports.Subject=Je;exports.Subscription=H;exports.VERSION=wn;exports.ValueSubject=to;exports.abortable=_n;exports.addScript=Rn;exports.areQualitiesExact=Hn;exports.assertEmptyArray=In;exports.assertNever=M;exports.assertNonNullable=Sn;exports.assertNotEmptyArray=Tn;exports.assertNullable=$n;exports.assertQualityIsExact=Xn;exports.buffer=lo;exports.checkNever=On;exports.cloneDeep=Zn;exports.cloneDeepWith=tr;exports.combine=no;exports.debounce=vo;exports.debounceFn=bt;exports.detectEmbed=Bn;exports.fillWithDefault=ht;exports.filter=go;exports.filterChanged=wo;exports.fromEvent=co;exports.getCurrentBrowser=Ze;exports.getExponentialDelay=jn;exports.getHighestQuality=Kn;exports.getIOSVersion=Cn;exports.interval=ao;exports.isHigher=Un;exports.isHigherOrEqual=Qn;exports.isIOS=An;exports.isInvariantQuality=rr;exports.isLower=er;exports.isLowerOrEqual=qn;exports.isMacLike=Ln;exports.isMobile=xn;exports.isNonNullable=de;exports.isNullable=vt;exports.loadVKLangPack=Ql;exports.map=yt;exports.mapTo=So;exports.merge=oo;exports.noop=B;exports.now=Pn;exports.observableFrom=so;exports.observeElementSize=ro;exports.once=$o;exports.pairwise=To;exports.safeStorage=Vn;exports.tap=Ro;exports.throttle=po;exports.throttleFn=pt;exports.timeCodeToString=Jn;exports.timeout=io;exports.videoHeightToQuality=zn;exports.videoQualityToHeight=Yn;exports.videoSizeToQuality=Wn;
6
+ "use strict";var B=Object.defineProperty;var st=Object.getOwnPropertyDescriptor;var at=Object.getOwnPropertyNames;var lt=Object.prototype.hasOwnProperty;var me=(t,e)=>{for(var r in e)B(t,r,{get:e[r],enumerable:!0})},ut=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of at(e))!lt.call(t,i)&&i!==r&&B(t,i,{get:()=>e[i],enumerable:!(n=st(e,i))||n.enumerable});return t};var ct=t=>ut(B({},"__esModule",{value:!0}),t);var Et={};me(Et,{CurrentClientBrowser:()=>W,CurrentClientDevice:()=>G,ErrorCategory:()=>Xe,InterfaceLanguage:()=>Ze,Logger:()=>N,Observable:()=>a,Subject:()=>x,Subscription:()=>m,VERSION:()=>Te,VKNumericLanguage:()=>Je,ValueSubject:()=>R,VideoQuality:()=>_,abortable:()=>Ee,addScript:()=>ye,areQualitiesExact:()=>ze,assertEmptyArray:()=>ge,assertNever:()=>I,assertNonNullable:()=>Ie,assertNotEmptyArray:()=>he,assertNullable:()=>xe,assertQualityIsExact:()=>je,buffer:()=>Y,checkNever:()=>ve,cloneDeep:()=>We,cloneDeepWith:()=>A,combine:()=>H,debounce:()=>J,debounceFn:()=>F,detectEmbed:()=>Pe,fillWithDefault:()=>Be,filter:()=>re,filterChanged:()=>oe,fromEvent:()=>$e,getCurrentBrowser:()=>S,getExponentialDelay:()=>Le,getHighestQuality:()=>Qe,getIOSVersion:()=>Ae,interval:()=>He,isAndroid:()=>Re,isHigher:()=>Me,isHigherOrEqual:()=>Ne,isIOS:()=>Se,isInvariantQuality:()=>U,isLower:()=>D,isLowerOrEqual:()=>Ve,isMacLike:()=>Ce,isMobile:()=>ke,isNonNullable:()=>y,isNullable:()=>V,loadVKLangPack:()=>yt,map:()=>C,mapTo:()=>se,merge:()=>K,noop:()=>h,now:()=>we,observableFrom:()=>Ke,observeElementSize:()=>Ge,once:()=>ae,pairwise:()=>ue,safeStorage:()=>Q,tap:()=>pe,throttle:()=>ee,throttleFn:()=>z,timeCodeToString:()=>vt,timeout:()=>qe,videoHeightToQuality:()=>De,videoQualityToHeight:()=>Fe,videoSizeToQuality:()=>Ue});module.exports=ct(Et);var Te="1.0.37-beta.0";var m=class{constructor(){this.subscriptions=[]}unsubscribe(){let e=this.subscriptions;this.subscriptions=[],e.forEach(r=>typeof r=="function"?r():r.unsubscribe())}add(e){return this.subscriptions.push(e),this}};var I=t=>{throw new Error(`${t} is value of unexpected type`)},ve=t=>{};var h=()=>{};var a=class{constructor(e){e&&(this._subscribe=e)}subscribe(e,r){var l;let n;r?typeof r=="function"?n={next:r,error:h}:n={next:o=>r.next(o),error:o=>{var u;return(u=r.error)==null?void 0:u.call(r,o)}}:n={next:h,error:h};let i=typeof e=="function"?{next:o=>{try{e(o)}catch(u){n.next(u)}},error:o=>n.next(o)}:{next:o=>e.next(o),error:o=>e.error?e.error(o):n.next(o)},s;try{s=this._subscribe(i)}catch(o){(l=i.error)==null||l.call(i,o)}return new m().add(()=>{switch(i.next=h,i.error=h,typeof s){case"function":s();return;case"object":s.unsubscribe();return;case"undefined":return;default:return I(s)}})}pipe(...e){return e.reduce((r,n)=>n(r),this)}_subscribe(e){}};var x=class extends a{constructor(){super();this.keyCounter=0;this.subscribers=new Map}next(r){this.subscribers.forEach(n=>n.next(r))}error(r){this.subscribers.forEach(n=>{var i;return(i=n.error)==null?void 0:i.call(n,r)})}_subscribe(r){let n=this.keyCounter++;return this.subscribers.set(n,r),new m().add(()=>this.subscribers.delete(n))}};var N=class{constructor(){this.log$=new x;this.logs=[];this.log=e=>{let r={...e,timestamp:Date.now()};this.logs.push(r),this.log$.next(r)};this.getAllLogs=()=>this.logs}createCustomLog(e){return(...r)=>{let n;try{n=e(...r)}catch(i){n={message:"error in `createCustomLog`",component:"Logger"}}this.log(n)}}createComponentLog(e){return this.createCustomLog(r=>({component:e,...r}))}};function Ie(t,e='Assertion "value is not nullable" failed'){if(t==null)throw new Error(e)}function xe(t,e='Assertion "value is nullable" failed'){if(t!=null)throw new Error(e)}function y(t){return typeof t!="undefined"&&t!==null}function V(t){return t==null}function he(t,e){if(!(t!=null&&t.length))throw new Error(e)}function ge(t,e){if(t!=null&&t.length)throw new Error(e)}var ye=(t,e,r)=>new Promise((n,i)=>{e.addEventListener("abort",()=>{o(),c.remove()});let s=()=>{o(),i()},l=()=>{o(),n()},o=()=>{u&&clearTimeout(u),c.removeEventListener("load",l),c.removeEventListener("error",s)},u;r&&(u=window.setTimeout(s,r));let c=document.createElement("script");c.addEventListener("load",l),c.addEventListener("error",s),c.src=t,document.head.appendChild(c)});var Oe,we=typeof((Oe=window.performance)==null?void 0:Oe.now)=="function"?()=>window.performance.now():()=>Date.now();var Ee=(t,e)=>async(...r)=>{var l;let n=e(...r),i=t.aborted,s;for(;!i&&!t.aborted;)try{let o=await n.next(s);i=(l=o.done)!=null?l:!1,s=o.value}catch(o){await n.throw(o)}return s};var W=(c=>(c.Unknown="Unknown",c.Yandex="Yandex",c.Chrome="Chrome",c.Chromium="Chromium",c.Firefox="Firefox",c.Safari="Safari",c.Opera="Opera",c.Edge="Edge",c.Rest="Rest",c))(W||{}),G=(u=>(u.Unknown="Unknown",u.Android="Android",u.iPhone="iPhone",u.iPad="iPad",u.iPod="iPod",u.RestMobile="RestMobile",u.Mac="Mac",u.Desktop="Desktop",u))(G||{}),S=()=>{let{userAgent:t}=window.navigator,e=/yabrowser/i.test(t)?"Yandex":void 0,r=/chrome|crios/i.test(t)?"Chrome":void 0,n=/chromium/i.test(t)?"Chromium":void 0,i=/firefox|fxios/i.test(t)?"Firefox":void 0,s=/webkit|safari|khtml/i.test(t)?"Safari":void 0,l=/opr\//i.test(t)?"Opera":void 0,o=/edg/i.test(t)?"Edge":void 0,u=/android/i.test(t)?"Android":void 0,c=/iphone/i.test(t)?"iPhone":void 0,f=/ipad/i.test(t)?"iPad":void 0,b=/ipod/i.test(t)?"iPod":void 0,E=/mac/i.test(t)?"Mac":void 0,k=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(t)?"RestMobile":void 0;return{browser:e||i||l||o||r||n||s||"Rest",device:u||c||f||b||k||E||"Desktop"}},Se=(t=!1)=>{let r=["iPhone","iPad","iPod"].includes(S().device);if(!t)return r;let{userAgent:n,maxTouchPoints:i}=window.navigator;return!!(r||/macintosh/i.test(n)&&i>0)},Ae=()=>{let{userAgent:t}=window.navigator,e=t.match(/Version\/(\d+(\.\d+)?)/i);if(!e)return null;let r=e[1],n=parseFloat(r);return isNaN(n)?null:n},Re=()=>S().device==="Android",Ce=()=>["Mac","iPhone","iPad","iPod"].includes(S().device),ke=()=>{var t,e;return/Mobile|mini|Fennec|Android|iP(ad|od|hone)/.test((t=navigator.appVersion)!=null?t:navigator.userAgent)||((e=navigator==null?void 0:navigator.userAgentData)==null?void 0:e.mobile)};var Le=(t,{start:e=0,factor:r=2,max:n=1/0,min:i=e,random:s=0}={})=>{let l=e;return l*=r**t,l*=1+(Math.random()*s*2-s),l=Math.round(l),l=Math.min(l,n),l=Math.max(l,i),l};var Q={};me(Q,{clear:()=>Tt,get:()=>bt,has:()=>ft,isPersistent:()=>pt,remove:()=>mt,set:()=>dt});var d,O,q=`vk-videoplayer-dummy-key-${Math.random()}`,w=()=>{if(O!==void 0)return O;try{localStorage.setItem(q,"test"),localStorage.removeItem(q),O=0}catch(t){if(t instanceof DOMException||t instanceof TypeError)try{sessionStorage.getItem(q),O=1}catch(e){if(e instanceof DOMException||e instanceof TypeError)O=2;else throw e}else throw t}return O===2&&(d=new Map),O},pt=()=>w()===0,bt=t=>{var r,n;let e=w();switch(e){case 0:return(r=localStorage.getItem(t))!=null?r:void 0;case 1:return(n=sessionStorage.getItem(t))!=null?n:void 0;case 2:return d==null?void 0:d.get(t);default:I(e)}},dt=(t,e)=>{let r=w();switch(r){case 0:try{localStorage.setItem(t,e)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case 1:try{sessionStorage.setItem(t,e)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case 2:return void(d==null?void 0:d.set(t,e));default:I(r)}},ft=t=>{var r;let e=w();switch(e){case 0:return t in localStorage;case 1:return t in sessionStorage;case 2:return(r=d==null?void 0:d.has(t))!=null?r:!1;default:return I(e),!1}},mt=t=>{let e=w();switch(e){case 0:return localStorage.removeItem(t);case 1:return sessionStorage.removeItem(t);case 2:return void(d==null?void 0:d.delete(t));default:I(e)}},Tt=()=>{let t=w();switch(t){case 0:return localStorage.clear();case 1:return sessionStorage.clear();case 2:return d==null?void 0:d.clear();default:I(t)}};var Pe=()=>{let t,e;try{t=window.self!==window.top}catch(n){n instanceof DOMException&&n.name==="SecurityError"?t=!0:(t=!1,console.error(n))}try{window.location.ancestorOrigins&&(e=window.location.ancestorOrigins[window.location.ancestorOrigins.length-1])}catch(n){console.error(n)}try{!e&&document.referrer&&(e=document.referrer)}catch(n){console.error(n)}let r=e?new URL(e).hostname:void 0;return{isEmbed:t,host:r}};var _=(f=>(f.INVARIANT="Invariant quality",f.Q_144P="144p",f.Q_240P="240p",f.Q_360P="360p",f.Q_480P="480p",f.Q_720P="720p",f.Q_1080P="1080p",f.Q_1440P="1440p",f.Q_2160P="2160p",f.Q_4320P="4320p",f))(_||{});var T={"144p":{width:256,height:144},"240p":{width:428,height:240},"360p":{width:640,height:360},"480p":{width:856,height:480},"720p":{width:1280,height:720},"1080p":{width:1920,height:1080},"1440p":{width:2560,height:1440},"2160p":{width:3840,height:2160},"4320p":{width:7680,height:4320}},Me=(t,e)=>T[t].height>T[e].height,Ne=(t,e)=>T[t].height>=T[e].height,D=(t,e)=>T[t].height<T[e].height,Ve=(t,e)=>T[t].height<=T[e].height,Qe=t=>t.sort((e,r)=>e===r?0:e==="Invariant quality"?1:r==="Invariant quality"?-1:D(e,r)?1:-1)[0],_e=Object.keys(T).sort((t,e)=>D(t,e)?-1:1),De=(t,e=.02)=>[..._e].find(n=>T[n].height*(1+e)>=t),Ue=({width:t,height:e})=>{let r=Math.min(t,e),n=Math.max(t,e);return _e.find(i=>{let s=T[i];return s.width>=n&&s.height>=r})},Fe=t=>T[t].height,U=t=>t==="Invariant quality",ze=t=>t.every(e=>!U(e));function je(t){if(U(t))throw new Error("Expected exact quality")}var Be=(t,e)=>{let r={};for(let n of Object.keys(e)){let i=e[n],s=t[n];Array.isArray(i)&&Array.isArray(s)?r[n]=s:typeof i=="object"&&typeof s=="object"?r[n]=Be(s,i):r[n]=n in t?s:i}return r};var vt=t=>{let e="";return t>=3600&&(e+=Math.floor(t/3600)+"h",t=t%3600),t>=60&&(e+=Math.floor(t/60)+"m",t=t%60),t>0&&(e+=Math.floor(t)+"s"),e};function F(t,e=0,r){let n,i,s,l,o,u,c=0,f=!1,b=!1,E=!0,k=!e&&e!==0&&typeof window.requestAnimationFrame=="function";r&&(f=!!r.leading,b="maxWait"in r,s=r!=null&&r.maxWait?Math.max(+(r==null?void 0:r.maxWait)||0,e):s,E="trailing"in r?!!r.trailing:E);function j(p){let v=n,g=i;return n=i=void 0,c=p,l=t.apply(g,v),l}function L(p,v){return k?(o&&window.cancelAnimationFrame(o),window.requestAnimationFrame(p)):setTimeout(p,v)}function et(p){if(k){window.cancelAnimationFrame(p);return}clearTimeout(p)}function tt(p){return c=p,o=L(P,e),f?j(p):l}function rt(p){let v=p-u,g=p-c,fe=e-v;return b?Math.min(fe,s-g):fe}function be(p){let v=p-u,g=p-c;return u===void 0||v>=e||v<0||b&&g>=s}function P(){let p=Date.now();if(be(p))return de(p);o=L(P,rt(p))}function de(p){return o=void 0,E&&n?j(p):(n=i=void 0,l)}function nt(){o!==void 0&&et(o),c=0,n=u=i=o=void 0}function ot(){return o===void 0?l:de(Date.now())}function it(){return o!==void 0}function M(...p){let v=Date.now(),g=be(v);if(n=p,i=this,u=v,g){if(o===void 0)return tt(u);if(b)return o=L(P,e),j(u)}return o===void 0&&(o=L(P,e)),l}return M.cancel=nt,M.flush=ot,M.pending=it,M}var z=(t,e=0,r)=>F(t,e,{...{leading:!0,trailing:!0},...r,maxWait:e});var A=(t,e)=>{if(t===null||typeof t!="object")return t;let r=Array.isArray(t)?[]:{};for(let n in t){if(typeof e=="function"){let i=e(t[n],n,t,r);if(i!==void 0){r[n]=i;continue}}typeof t[n]=="object"?r[n]=A(t[n],e):r[n]=t[n]}return r};var We=t=>A(t);var It=300,Ge=(t,e=It)=>new a(r=>{let{width:n,height:i}=t.getBoundingClientRect();if(r.next({width:n,height:i}),!window.ResizeObserver)return;let s=new ResizeObserver(z(l=>{let o=l[0];if(!o)return;let u,c;o.contentBoxSize&&o.contentBoxSize[0]?(c=o.contentBoxSize[0].blockSize,u=o.contentBoxSize[0].inlineSize):o.contentRect&&(u=o.contentRect.width,c=o.contentRect.height),y(u)&&y(c)&&r.next({width:u,height:c})},e));return s.observe(t),()=>s.disconnect()});var R=class extends x{constructor(r){super();this.value=r}next(r){super.next(this.value=r)}error(r){super.error(this.value=r)}getValue(){return this.value}_subscribe(r){let n=super._subscribe(r);return r.next(this.value),n}};function H(t){return new a(e=>{let r={},n=Object.keys(t).length,i=s=>l=>{s in r||n--,r[s]=l,n===0&&e.next(r)};return Object.entries(t).reduce((s,[l,o])=>s.add(o.subscribe(i(l))),new m)})}function K(...t){return new a(e=>t.reduce((r,n)=>r.add(n.subscribe(e)),new m))}var qe=t=>new a(e=>{let r=window.setTimeout(()=>{try{e.next()}catch(n){if(e.error)e.error(n);else throw n}},t);return()=>window.clearTimeout(r)});var He=t=>new a(e=>{let r=window.setInterval(()=>e.next(),t);return()=>{r&&(window.clearInterval(r),r=void 0)}});var Ke=t=>new a(e=>{t.forEach(r=>e.next(r))});var $e=(t,e)=>new a(r=>{let n=i=>r.next(i);return t.addEventListener(e,n),()=>t.removeEventListener(e,n)});function Y(t){return e=>new a(r=>e.subscribe(new $(r,t)))}var $=class{constructor(e,r){this.destination=e;this.size=r;this.lastValues=[]}next(e){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(e),this.destination.next(this.lastValues)}error(e){var r,n;(n=(r=this.destination).error)==null||n.call(r,e)}};var xt={leading:!1,trailing:!0};function J(t,e=xt){return r=>new a(n=>r.subscribe(new X(n,t,e)))}var X=class{constructor(e,r,n){this.destination=e;this.time=r;this.config=n}next(e){this.lastValue=e,y(this.timeout)?window.clearTimeout(this.timeout):this.config.leading&&this.destination.next(e),this.timeout=window.setTimeout(()=>{if(this.config.trailing)try{this.destination.next(this.lastValue)}catch(r){if(this.destination.error)this.destination.error(r);else throw r}this.timeout=void 0},this.time)}error(e){var r,n;(n=(r=this.destination).error)==null||n.call(r,e)}};var ht={leading:!0,trailing:!1};function ee(t,e=ht){return r=>new a(n=>r.subscribe(new Z(n,t,e)))}var Z=class{constructor(e,r,n){this.destination=e;this.time=r;this.config=n}next(e){this.lastValue=e,V(this.timeout)&&(this.config.leading&&this.destination.next(e),this.timeout=window.setTimeout(()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0},this.time))}error(e){var r,n;(n=(r=this.destination).error)==null||n.call(r,e)}};function re(t){return e=>new a(r=>e.subscribe(new te(r,t)))}var te=class{constructor(e,r){this.destination=e;this.predicate=r}next(e){let r;try{r=this.predicate(e)}catch(n){throw this.error(n),n}r&&this.destination.next(e)}error(e){var r,n;(n=(r=this.destination).error)==null||n.call(r,e)}};function oe(t=(e,r)=>e===r){return e=>new a(r=>e.subscribe(new ne(r,t)))}var Ye={},ne=class{constructor(e,r){this.destination=e;this.predicate=r;this.lastValue=Ye}next(e){let r;try{r=this.lastValue===Ye||!this.predicate(this.lastValue,e),this.lastValue=e}catch(n){throw this.error(n),n}r&&this.destination.next(e)}error(e){var r,n;(n=(r=this.destination).error)==null||n.call(r,e)}};function C(t){return e=>new a(r=>e.subscribe(new ie(r,t)))}var ie=class{constructor(e,r){this.destination=e;this.mapper=r}next(e){let r;try{r=this.mapper(e)}catch(n){throw this.error(n),n}this.destination.next(r)}error(e){var r,n;(n=(r=this.destination).error)==null||n.call(r,e)}};function se(t){return C(()=>t)}function ae(){return t=>new a(e=>{let r=!1,n=!1,i=t.subscribe(s=>{r||(r=!0,e.next(s)),n&&i.unsubscribe()},s=>{var l;r=!0,(l=e.error)==null||l.call(e,s),n&&i.unsubscribe()});return n=!0,r&&i.unsubscribe(),i})}function ue(){return t=>new a(e=>t.subscribe(new le(e)))}var le=class{constructor(e){this.destination=e;this.hasLast=!1}next(e){let r=this.last;if(this.last=e,!this.hasLast){this.hasLast=!0;return}this.destination.next([r,e])}error(e){var r,n;(n=(r=this.destination).error)==null||n.call(r,e)}};function pe(t){return e=>new a(r=>e.subscribe(new ce(r,t)))}var ce=class{constructor(e,r){this.destination=e;this.effect=r}next(e){try{this.effect(e)}catch(r){throw this.error(r),r}this.destination.next(e)}error(e){var r,n;(n=(r=this.destination).error)==null||n.call(r,e)}};var Xe=(o=>(o.NETWORK="network",o.VIDEO_PIPELINE="video_pipeline",o.EXTERNAL_API="external_api",o.PARSER="parser",o.DOM="dom",o.WTF="wtf",o.FATAL="fatal",o))(Xe||{});var Je=(b=>(b.Armenian="58",b.Azerbaijani="57",b.Belarusian="114",b.English="3",b.Kazakh="97",b.Portuguese="73",b.Russian="0",b.Spanish="4",b.Ukrainian="1",b.Uzbek="65",b.Vietnamese="75",b))(Je||{}),gt="vk.com",yt=async(t,e,r)=>{let n=new URL(`https://${gt}/js/lang-pack.js`);n.searchParams.set("format","json"),n.searchParams.set("name",e),t!==void 0&&n.searchParams.set("lang",t);let s=await(await fetch(n.toString())).json();return Ot(s,r)},Ot=(t,e)=>Object.fromEntries(Object.entries(t.keys).map(([r,n])=>[r.substring(`${e}_`.length),wt(n)])),wt=t=>Array.isArray(t)?t[0]:t;var Ze=(r=>(r.RU="ru",r.EN="en",r))(Ze||{});