@vkontakte/videoplayer-shared 1.0.34 → 1.0.35-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.
package/es2015.cjs.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
- * @vkontakte/videoplayer-shared v1.0.34
3
- * Fri, 26 Apr 2024 14:08:06 GMT
4
- * https://st.mycdn.me/static/vkontakte-videoplayer/1-0-34/doc/
2
+ * @vkontakte/videoplayer-shared v1.0.35-beta.0
3
+ * Tue, 07 May 2024 23:30:33 GMT
4
+ * https://st.mycdn.me/static/vkontakte-videoplayer/1-0-35/doc/
5
5
  */
6
- "use strict";const mn="1.0.34";class z{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`)},wn=e=>{},B=()=>{};class w{constructor(r){r&&(this._subscribe=r)}subscribe(r,t){var n;let o;t?typeof t=="function"?o={next:t,error:B}: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:B,error:B};const i=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 a;try{a=this._subscribe(i)}catch(s){(n=i.error)===null||n===void 0||n.call(i,s)}return new z().add(()=>{switch(i.next=B,i.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 Xe extends w{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 z().add(()=>this.subscribers.delete(t))}}class On{constructor(){this.log$=new Xe,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 En(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 ft(e){return typeof e!="undefined"&&e!==null}function vt(e){return e==null}function Sn(e,r){if(!(e!=null&&e.length))throw new Error(r)}function Tn(e,r){if(e!=null&&e.length)throw new Error(r)}const In=(e,r,t)=>new Promise((n,o)=>{r.addEventListener("abort",()=>{s(),c.remove()});const i=()=>{s(),o()},a=()=>{s(),n()},s=()=>{u&&clearTimeout(u),c.removeEventListener("load",a),c.removeEventListener("error",i)};let u;t&&(u=window.setTimeout(i,t));const c=document.createElement("script");c.addEventListener("load",a),c.addEventListener("error",i),c.src=e,document.head.appendChild(c)});var ge;const Rn=typeof((ge=window.performance)===null||ge===void 0?void 0:ge.now)=="function"?()=>window.performance.now():()=>Date.now();function dt(e,r,t,n){function o(i){return i instanceof t?i:new t(function(a){a(i)})}return new(t||(t=Promise))(function(i,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?i(l.value):o(l.value).then(s,u)}c((n=n.apply(e,r||[])).next())})}const Pn=(e,r)=>(...t)=>dt(void 0,void 0,void 0,function*(){var n;const o=r(...t);let i=e.aborted,a;for(;!i&&!e.aborted;)try{const s=yield o.next(a);i=(n=s.done)!==null&&n!==void 0?n:!1,a=s.value}catch(s){yield o.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 Je=()=>{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,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||o||a||s||t||n||i||exports.CurrentClientBrowser.Rest,device:u||c||l||f||d||v||exports.CurrentClientDevice.Desktop}},_n=(e=!1)=>{const t=[exports.CurrentClientDevice.iPhone,exports.CurrentClientDevice.iPad,exports.CurrentClientDevice.iPod].includes(Je().device);if(!e)return t;const{userAgent:n,maxTouchPoints:o}=window.navigator;return!!(t||/macintosh/i.test(n)&&o>0)},An=()=>{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},Cn=()=>[exports.CurrentClientDevice.Mac,exports.CurrentClientDevice.iPhone,exports.CurrentClientDevice.iPad,exports.CurrentClientDevice.iPod].includes(Je().device),jn=()=>{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)},Ln=(e,{start:r=0,factor:t=2,max:n=1/0,min:o=r,random:i=0}={})=>{let a=r;return a*=Math.pow(t,e),a*=1+(Math.random()*i*2-i),a=Math.round(a),a=Math.min(a,n),a=Math.max(a,o),a};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 E,x;const me=`vk-videoplayer-dummy-key-${Math.random()}`,Q=()=>{if(x!==void 0)return x;try{localStorage.setItem(me,"test"),localStorage.removeItem(me),x=p.LOCAL_STORAGE}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem(me),x=p.SESSION_STORAGE}catch(r){if(r instanceof DOMException||r instanceof TypeError)x=p.RUNTIME;else throw r}else throw e}return x===p.RUNTIME&&(E=new Map),x},xn=()=>Q()===p.LOCAL_STORAGE,Mn=e=>{var r,t;const n=Q();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 E==null?void 0:E.get(e);default:M(n)}},Nn=(e,r)=>{const t=Q();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(E==null?void 0:E.set(e,r));default:M(t)}},Dn=e=>{var r;const t=Q();switch(t){case p.LOCAL_STORAGE:return e in localStorage;case p.SESSION_STORAGE:return e in sessionStorage;case p.RUNTIME:return(r=E==null?void 0:E.has(e))!==null&&r!==void 0?r:!1;default:return M(t),!1}},Fn=e=>{const r=Q();switch(r){case p.LOCAL_STORAGE:return localStorage.removeItem(e);case p.SESSION_STORAGE:return sessionStorage.removeItem(e);case p.RUNTIME:return void(E==null?void 0:E.delete(e));default:M(r)}},Gn=()=>{const e=Q();switch(e){case p.LOCAL_STORAGE:return localStorage.clear();case p.SESSION_STORAGE:return sessionStorage.clear();case p.RUNTIME:return E==null?void 0:E.clear();default:M(e)}};var Vn=Object.freeze({__proto__:null,clear:Gn,get:Mn,has:Dn,isPersistent:xn,remove:Fn,set:Nn});const kn=()=>{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 $={[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}},Bn=(e,r)=>$[e].height>$[r].height,Un=(e,r)=>$[e].height>=$[r].height,Ze=(e,r)=>$[e].height<$[r].height,Qn=(e,r)=>$[e].height<=$[r].height,qn=e=>e.sort((r,t)=>r===t?0:r===exports.VideoQuality.INVARIANT?1:t===exports.VideoQuality.INVARIANT?-1:Ze(r,t)?1:-1)[0],ht=Object.keys($).sort((e,r)=>Ze(e,r)?-1:1),Kn=(e,r=.02)=>[...ht].find(n=>$[n].height*(1+r)>=e),Yn=({width:e,height:r})=>{const t=Math.min(e,r),n=Math.max(e,r);return ht.find(o=>{const i=$[o];return i.width>=n&&i.height>=t})},Wn=e=>$[e].height,er=e=>e===exports.VideoQuality.INVARIANT,Hn=e=>e.every(r=>!er(r));function zn(e){if(er(e))throw new Error("Expected exact quality")}const pt=(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]=pt(i,o):t[n]=n in e?i:o}return t},Xn=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 Jn(e,r=0,t){let n,o,i,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,i=t!=null&&t.maxWait?Math.max(+(t==null?void 0:t.maxWait)||0,r):i,v="trailing"in t?!!t.trailing:v);function y(h){const S=n,L=o;return n=o=void 0,c=h,a=e.apply(L,S),a}function b(h,S){return d?(s&&window.cancelAnimationFrame(s),window.requestAnimationFrame(h)):setTimeout(h,S)}function O(h){if(d){window.cancelAnimationFrame(h);return}clearTimeout(h)}function g(h){return c=h,s=b(ee,r),l?y(h):a}function m(h){const S=h-u,L=h-c,br=r-S;return f?Math.min(br,i-L):br}function pr(h){const S=h-u,L=h-c;return u===void 0||S>=r||S<0||f&&L>=i}function ee(){const h=Date.now();if(pr(h))return yr(h);s=b(ee,m(h))}function yr(h){return s=void 0,v&&n?y(h):(n=o=void 0,a)}function yn(){s!==void 0&&O(s),c=0,n=u=o=s=void 0}function bn(){return s===void 0?a:yr(Date.now())}function gn(){return s!==void 0}function re(...h){const S=Date.now(),L=pr(S);if(n=h,o=this,u=S,L){if(s===void 0)return g(u);if(f)return s=b(ee,r),y(u)}return s===void 0&&(s=b(ee,r)),a}return re.cancel=yn,re.flush=bn,re.pending=gn,re}const rr=(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]=rr(e[n],r):t[n]=e[n]}return t},Zn=e=>rr(e);class eo extends Xe{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 ro(e){return new w(r=>{const t={};let n=Object.keys(e).length;const o=i=>a=>{i in t||n--,t[i]=a,n===0&&r.next(t)};return Object.entries(e).reduce((i,[a,s])=>i.add(s.subscribe(o(a))),new z)})}function to(...e){return new w(r=>e.reduce((t,n)=>t.add(n.subscribe(r)),new z))}var no=e=>new w(r=>{const t=window.setTimeout(()=>{try{r.next()}catch(n){if(r.error)r.error(n);else throw n}},e);return()=>window.clearTimeout(t)}),oo=e=>new w(r=>{const t=window.setInterval(()=>r.next(),e);return()=>window.clearInterval(t)}),io=e=>new w(r=>{e.forEach(t=>r.next(t))}),ao=(e,r)=>new w(t=>{const n=o=>t.next(o);return e.addEventListener(r,n),()=>e.removeEventListener(r,n)});function so(e){return r=>new w(t=>r.subscribe(new co(t,e)))}class co{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 lo={leading:!1,trailing:!0};function uo(e,r=lo){return t=>new w(n=>t.subscribe(new fo(n,e,r)))}class fo{constructor(r,t,n){this.destination=r,this.time=t,this.config=n}next(r){this.lastValue=r,ft(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 vo={leading:!0,trailing:!1};function ho(e,r=vo){return t=>new w(n=>t.subscribe(new po(n,e,r)))}class po{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 yo(e){return r=>new w(t=>r.subscribe(new bo(t,e)))}class bo{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 go(e=(r,t)=>r===t){return r=>new w(t=>r.subscribe(new mo(t,e)))}const gr={};class mo{constructor(r,t){this.destination=r,this.predicate=t,this.lastValue=gr}next(r){let t;try{t=this.lastValue===gr||!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 w(t=>r.subscribe(new wo(t,e)))}let wo=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 Oo(e){return yt(()=>e)}function Eo(){return e=>new w(r=>{let t=!1,n=!1;const o=e.subscribe(i=>{t||(t=!0,r.next(i)),n&&o.unsubscribe()},i=>{var a;t=!0,(a=r.error)===null||a===void 0||a.call(r,i),n&&o.unsubscribe()});return n=!0,t&&o.unsubscribe(),o})}function $o(){return e=>new w(r=>e.subscribe(new So(r)))}class So{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 To(e){return r=>new w(t=>r.subscribe(new Io(t,e)))}class Io{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"})(exports.ErrorCategory||(exports.ErrorCategory={}));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,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 a=n[o];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 bt 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 Ro{constructor(){Object.defineProperty(this,"signal",{value:new bt,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&&(Ro.prototype[Symbol.toStringTag]="AbortController",bt.prototype[Symbol.toStringTag]="AbortSignal");function gt(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 Po(e){typeof e=="function"&&(e={fetch:e});const{fetch:r,Request:t=r.Request,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o=!1}=e;if(!gt({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,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},i.prototype=t.prototype);const a=r;return{fetch:(u,c)=>{const l=i&&i.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,y)=>{l.addEventListener("abort",()=>y(f),{once:!0})});return c&&c.signal&&delete c.signal,Promise.race([v,a(u,c)])}return a(u,c)},Request:i}}const tr=gt({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),mt=tr?Po({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,_o=tr?mt.fetch:window.fetch;tr?mt.Request:window.Request;var we=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function Ao(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}},Co=A,ye=!Co(function(){var e=function(){}.bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),wt=ye,Ot=Function.prototype,Be=Ot.call,jo=wt&&Ot.bind.bind(Be,Be),N=wt?jo:function(e){return function(){return Be.apply(e,arguments)}},Et=N,Lo=Et({}.toString),xo=Et("".slice),nr=function(e){return xo(Lo(e),8,-1)},Mo=N,No=A,Do=nr,Oe=Object,Fo=Mo("".split),Go=No(function(){return!Oe("z").propertyIsEnumerable(0)})?function(e){return Do(e)=="String"?Fo(e,""):Oe(e)}:Oe,or=function(e){return e==null},Vo=or,ko=TypeError,$t=function(e){if(Vo(e))throw ko("Can't call method on "+e);return e},Bo=Go,Uo=$t,X=function(e){return Bo(Uo(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 we=="object"&&we)||function(){return this}()||we||Function("return this")(),Ue=typeof document=="object"&&document.all,Qo=typeof Ue=="undefined"&&Ue!==void 0,St={all:Ue,IS_HTMLDDA:Qo},Tt=St,qo=Tt.all,R=Tt.IS_HTMLDDA?function(e){return typeof e=="function"||e===qo}:function(e){return typeof e=="function"},Ko=I,Yo=R,wr=Ko.WeakMap,Wo=Yo(wr)&&/native code/.test(String(wr)),Or=R,It=St,Ho=It.all,K=It.IS_HTMLDDA?function(e){return typeof e=="object"?e!==null:Or(e)||e===Ho}:function(e){return typeof e=="object"?e!==null:Or(e)},zo=A,D=!zo(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),Y={},Xo=I,Er=K,Qe=Xo.document,Jo=Er(Qe)&&Er(Qe.createElement),Rt=function(e){return Jo?Qe.createElement(e):{}},Zo=D,ei=A,ri=Rt,Pt=!Zo&&!ei(function(){return Object.defineProperty(ri("div"),"a",{get:function(){return 7}}).a!=7}),ti=D,ni=A,_t=ti&&ni(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42}),oi=K,ii=String,ai=TypeError,W=function(e){if(oi(e))return e;throw ai(ii(e)+" is not an object")},si=ye,ne=Function.prototype.call,F=si?ne.bind(ne):function(){return ne.apply(ne,arguments)},ir={},Ee=ir,$e=I,ci=R,$r=function(e){return ci(e)?e:void 0},At=function(e,r){return arguments.length<2?$r(Ee[e])||$r($e[e]):Ee[e]&&Ee[e][r]||$e[e]&&$e[e][r]},li=N,Ct=li({}.isPrototypeOf),ui=typeof navigator!="undefined"&&String(navigator.userAgent)||"",jt=I,Se=ui,Sr=jt.process,Tr=jt.Deno,Ir=Sr&&Sr.versions||Tr&&Tr.version,Rr=Ir&&Ir.v8,T,de;Rr&&(T=Rr.split("."),de=T[0]>0&&T[0]<4?1:+(T[0]+T[1]));!de&&Se&&(T=Se.match(/Edge\/(\d+)/),(!T||T[1]>=74)&&(T=Se.match(/Chrome\/(\d+)/),T&&(de=+T[1])));var fi=de,Pr=fi,vi=A,di=I,hi=di.String,Lt=!!Object.getOwnPropertySymbols&&!vi(function(){var e=Symbol();return!hi(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Pr&&Pr<41}),pi=Lt,xt=pi&&!Symbol.sham&&typeof Symbol.iterator=="symbol",yi=At,bi=R,gi=Ct,mi=xt,wi=Object,Mt=mi?function(e){return typeof e=="symbol"}:function(e){var r=yi("Symbol");return bi(r)&&gi(r.prototype,wi(e))},Oi=String,ar=function(e){try{return Oi(e)}catch(r){return"Object"}},Ei=R,$i=ar,Si=TypeError,sr=function(e){if(Ei(e))return e;throw Si($i(e)+" is not a function")},Ti=sr,Ii=or,cr=function(e,r){var t=e[r];return Ii(t)?void 0:Ti(t)},Te=F,Ie=R,Re=K,Ri=TypeError,Pi=function(e,r){var t,n;if(r==="string"&&Ie(t=e.toString)&&!Re(n=Te(t,e))||Ie(t=e.valueOf)&&!Re(n=Te(t,e))||r!=="string"&&Ie(t=e.toString)&&!Re(n=Te(t,e)))return n;throw Ri("Can't convert object to primitive value")},Nt={exports:{}},_r=I,_i=Object.defineProperty,Ai=function(e,r){try{_i(_r,e,{value:r,configurable:!0,writable:!0})}catch(t){_r[e]=r}return r},Ci=I,ji=Ai,Ar="__core-js_shared__",Li=Ci[Ar]||ji(Ar,{}),Dt=Li,Cr=Dt;(Nt.exports=function(e,r){return Cr[e]||(Cr[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 Ft=Nt.exports,xi=$t,Mi=Object,Gt=function(e){return Mi(xi(e))},Ni=N,Di=Gt,Fi=Ni({}.hasOwnProperty),j=Object.hasOwn||function(r,t){return Fi(Di(r),t)},Gi=N,Vi=0,ki=Math.random(),Bi=Gi(1 .toString),Vt=function(e){return"Symbol("+(e===void 0?"":e)+")_"+Bi(++Vi+ki,36)},Ui=I,Qi=Ft,jr=j,qi=Vt,Ki=Lt,Yi=xt,U=Ui.Symbol,Pe=Qi("wks"),Wi=Yi?U.for||U:U&&U.withoutSetter||qi,C=function(e){return jr(Pe,e)||(Pe[e]=Ki&&jr(U,e)?U[e]:Wi("Symbol."+e)),Pe[e]},Hi=F,Lr=K,xr=Mt,zi=cr,Xi=Pi,Ji=C,Zi=TypeError,ea=Ji("toPrimitive"),ra=function(e,r){if(!Lr(e)||xr(e))return e;var t=zi(e,ea),n;if(t){if(r===void 0&&(r="default"),n=Hi(t,e,r),!Lr(n)||xr(n))return n;throw Zi("Can't convert object to primitive value")}return r===void 0&&(r="number"),Xi(e,r)},ta=ra,na=Mt,lr=function(e){var r=ta(e,"string");return na(r)?r:r+""},oa=D,ia=Pt,aa=_t,oe=W,Mr=lr,sa=TypeError,_e=Object.defineProperty,ca=Object.getOwnPropertyDescriptor,Ae="enumerable",Ce="configurable",je="writable";Y.f=oa?aa?function(r,t,n){if(oe(r),t=Mr(t),oe(n),typeof r=="function"&&t==="prototype"&&"value"in n&&je in n&&!n[je]){var o=ca(r,t);o&&o[je]&&(r[t]=n.value,n={configurable:Ce in n?n[Ce]:o[Ce],enumerable:Ae in n?n[Ae]:o[Ae],writable:!1})}return _e(r,t,n)}:_e:function(r,t,n){if(oe(r),t=Mr(t),oe(n),ia)try{return _e(r,t,n)}catch(o){}if("get"in n||"set"in n)throw sa("Accessors not supported");return"value"in n&&(r[t]=n.value),r};var be=function(e,r){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:r}},la=D,ua=Y,fa=be,J=la?function(e,r,t){return ua.f(e,r,fa(1,t))}:function(e,r,t){return e[r]=t,e},va=Ft,da=Vt,Nr=va("keys"),ur=function(e){return Nr[e]||(Nr[e]=da(e))},fr={},ha=Wo,kt=I,pa=K,ya=J,Le=j,xe=Dt,ba=ur,ga=fr,Dr="Object already initialized",qe=kt.TypeError,ma=kt.WeakMap,he,H,pe,wa=function(e){return pe(e)?H(e):he(e,{})},Oa=function(e){return function(r){var t;if(!pa(r)||(t=H(r)).type!==e)throw qe("Incompatible receiver, "+e+" required");return t}};if(ha||xe.state){var P=xe.state||(xe.state=new ma);P.get=P.get,P.has=P.has,P.set=P.set,he=function(e,r){if(P.has(e))throw qe(Dr);return r.facade=e,P.set(e,r),r},H=function(e){return P.get(e)||{}},pe=function(e){return P.has(e)}}else{var G=ba("state");ga[G]=!0,he=function(e,r){if(Le(e,G))throw qe(Dr);return r.facade=e,ya(e,G,r),r},H=function(e){return Le(e,G)?e[G]:{}},pe=function(e){return Le(e,G)}}var Ea={set:he,get:H,has:pe,enforce:wa,getterFor:Oa},$a=ye,Bt=Function.prototype,Fr=Bt.apply,Gr=Bt.call,Sa=typeof Reflect=="object"&&Reflect.apply||($a?Gr.bind(Fr):function(){return Gr.apply(Fr,arguments)}),Ta=nr,Ia=N,Ut=function(e){if(Ta(e)==="Function")return Ia(e)},Qt={},qt={},Kt={}.propertyIsEnumerable,Yt=Object.getOwnPropertyDescriptor,Ra=Yt&&!Kt.call({1:2},1);qt.f=Ra?function(r){var t=Yt(this,r);return!!t&&t.enumerable}:Kt;var Pa=D,_a=F,Aa=qt,Ca=be,ja=X,La=lr,xa=j,Ma=Pt,Vr=Object.getOwnPropertyDescriptor;Qt.f=Pa?Vr:function(r,t){if(r=ja(r),t=La(t),Ma)try{return Vr(r,t)}catch(n){}if(xa(r,t))return Ca(!_a(Aa.f,r,t),r[t])};var Na=A,Da=R,Fa=/#|\.prototype\./,Z=function(e,r){var t=Va[Ga(e)];return t==Ba?!0:t==ka?!1:Da(r)?Na(r):!!r},Ga=Z.normalize=function(e){return String(e).replace(Fa,".").toLowerCase()},Va=Z.data={},ka=Z.NATIVE="N",Ba=Z.POLYFILL="P",Ua=Z,kr=Ut,Qa=sr,qa=ye,Ka=kr(kr.bind),Wt=function(e,r){return Qa(e),r===void 0?e:qa?Ka(e,r):function(){return e.apply(r,arguments)}},ie=I,Ya=Sa,Wa=Ut,Ha=R,za=Qt.f,Xa=Ua,V=ir,Ja=Wt,k=J,Br=j,Za=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,a=n?ie:o?ie[t]:(ie[t]||{}).prototype,s=n?V:V[t]||k(V,t,{})[t],u=s.prototype,c,l,f,v,d,y,b,O,g;for(v in r)c=Xa(n?v:t+(o?".":"#")+v,e.forced),l=!c&&a&&Br(a,v),y=s[v],l&&(e.dontCallGetSet?(g=za(a,v),b=g&&g.value):b=a[v]),d=l&&b?b:r[v],!(l&&typeof y==typeof d)&&(e.bind&&l?O=Ja(d,ie):e.wrap&&l?O=Za(d):i&&Ha(d)?O=Wa(d):O=d,(e.sham||d&&d.sham||y&&y.sham)&&k(O,"sham",!0),k(s,v,O),i&&(f=t+"Prototype",Br(V,f)||k(V,f,{}),k(V[f],v,d),e.real&&u&&(c||!u[v])&&k(u,v,d)))},Ke=D,es=j,zt=Function.prototype,rs=Ke&&Object.getOwnPropertyDescriptor,vr=es(zt,"name"),ts=vr&&function(){}.name==="something",ns=vr&&(!Ke||Ke&&rs(zt,"name").configurable),os={EXISTS:vr,PROPER:ts,CONFIGURABLE:ns},Xt={},is=Math.ceil,as=Math.floor,ss=Math.trunc||function(r){var t=+r;return(t>0?as:is)(t)},cs=ss,Jt=function(e){var r=+e;return r!==r||r===0?0:cs(r)},ls=Jt,us=Math.max,fs=Math.min,vs=function(e,r){var t=ls(e);return t<0?us(t+r,0):fs(t,r)},ds=Jt,hs=Math.min,ps=function(e){return e>0?hs(ds(e),9007199254740991):0},ys=ps,Zt=function(e){return ys(e.length)},bs=X,gs=vs,ms=Zt,Ur=function(e){return function(r,t,n){var o=bs(r),i=ms(o),a=gs(n,i),s;if(e&&t!=t){for(;i>a;)if(s=o[a++],s!=s)return!0}else for(;i>a;a++)if((e||a in o)&&o[a]===t)return e||a||0;return!e&&-1}},ws={includes:Ur(!0),indexOf:Ur(!1)},Os=N,Me=j,Es=X,$s=ws.indexOf,Ss=fr,Qr=Os([].push),Ts=function(e,r){var t=Es(e),n=0,o=[],i;for(i in t)!Me(Ss,i)&&Me(t,i)&&Qr(o,i);for(;r.length>n;)Me(t,i=r[n++])&&(~$s(o,i)||Qr(o,i));return o},en=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Is=Ts,Rs=en,Ps=Object.keys||function(r){return Is(r,Rs)},_s=D,As=_t,Cs=Y,js=W,Ls=X,xs=Ps;Xt.f=_s&&!As?Object.defineProperties:function(r,t){js(r);for(var n=Ls(t),o=xs(t),i=o.length,a=0,s;i>a;)Cs.f(r,s=o[a++],n[s]);return r};var Ms=At,Ns=Ms("document","documentElement"),Ds=W,Fs=Xt,qr=en,Gs=fr,Vs=Ns,ks=Rt,Bs=ur,Kr=">",Yr="<",Ye="prototype",We="script",rn=Bs("IE_PROTO"),Ne=function(){},tn=function(e){return Yr+We+Kr+e+Yr+"/"+We+Kr},Wr=function(e){e.write(tn("")),e.close();var r=e.parentWindow.Object;return e=null,r},Us=function(){var e=ks("iframe"),r="java"+We+":",t;return e.style.display="none",Vs.appendChild(e),e.src=String(r),t=e.contentWindow.document,t.open(),t.write(tn("document.F=Object")),t.close(),t.F},ae,ue=function(){try{ae=new ActiveXObject("htmlfile")}catch(r){}ue=typeof document!="undefined"?document.domain&&ae?Wr(ae):Us():Wr(ae);for(var e=qr.length;e--;)delete ue[Ye][qr[e]];return ue()};Gs[rn]=!0;var nn=Object.create||function(r,t){var n;return r!==null?(Ne[Ye]=Ds(r),n=new Ne,Ne[Ye]=null,n[rn]=r):n=ue(),t===void 0?n:Fs.f(n,t)},Qs=A,qs=!Qs(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),Ks=j,Ys=R,Ws=Gt,Hs=ur,zs=qs,Hr=Hs("IE_PROTO"),He=Object,Xs=He.prototype,on=zs?He.getPrototypeOf:function(e){var r=Ws(e);if(Ks(r,Hr))return r[Hr];var t=r.constructor;return Ys(t)&&r instanceof t?t.prototype:r instanceof He?Xs:null},Js=J,an=function(e,r,t,n){return n&&n.enumerable?e[r]=t:Js(e,r,t),e},Zs=A,ec=R,rc=K,tc=nn,zr=on,nc=an,oc=C,ze=oc("iterator"),sn=!1,_,De,Fe;[].keys&&(Fe=[].keys(),"next"in Fe?(De=zr(zr(Fe)),De!==Object.prototype&&(_=De)):sn=!0);var ic=!rc(_)||Zs(function(){var e={};return _[ze].call(e)!==e});ic?_={}:_=tc(_);ec(_[ze])||nc(_,ze,function(){return this});var cn={IteratorPrototype:_,BUGGY_SAFARI_ITERATORS:sn},ac=C,sc=ac("toStringTag"),ln={};ln[sc]="z";var dr=String(ln)==="[object z]",cc=dr,lc=R,fe=nr,uc=C,fc=uc("toStringTag"),vc=Object,dc=fe(function(){return arguments}())=="Arguments",hc=function(e,r){try{return e[r]}catch(t){}},hr=cc?fe:function(e){var r,t,n;return e===void 0?"Undefined":e===null?"Null":typeof(t=hc(r=vc(e),fc))=="string"?t:dc?fe(r):(n=fe(r))=="Object"&&lc(r.callee)?"Arguments":n},pc=dr,yc=hr,bc=pc?{}.toString:function(){return"[object "+yc(this)+"]"},gc=dr,mc=Y.f,wc=J,Oc=j,Ec=bc,$c=C,Xr=$c("toStringTag"),un=function(e,r,t,n){if(e){var o=t?e:e.prototype;Oc(o,Xr)||mc(o,Xr,{configurable:!0,value:r}),n&&!gc&&wc(o,"toString",Ec)}},Sc=cn.IteratorPrototype,Tc=nn,Ic=be,Rc=un,Pc=q,_c=function(){return this},Ac=function(e,r,t,n){var o=r+" Iterator";return e.prototype=Tc(Sc,{next:Ic(+!n,t)}),Rc(e,o,!1,!0),Pc[o]=_c,e},Cc=Ht,jc=F,fn=os,Lc=Ac,xc=on,Mc=un,Jr=an,Nc=C,Zr=q,vn=cn,Dc=fn.PROPER;fn.CONFIGURABLE;vn.IteratorPrototype;var se=vn.BUGGY_SAFARI_ITERATORS,Ge=Nc("iterator"),et="keys",ce="values",rt="entries",Fc=function(){return this},Gc=function(e,r,t,n,o,i,a){Lc(t,r,n);var s=function(g){if(g===o&&v)return v;if(!se&&g in l)return l[g];switch(g){case et:return function(){return new t(this,g)};case ce: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[Ge]||l["@@iterator"]||o&&l[o],v=!se&&f||s(o),d=r=="Array"&&l.entries||f,y,b,O;if(d&&(y=xc(d.call(new e)),y!==Object.prototype&&y.next&&(Mc(y,u,!0,!0),Zr[u]=Fc)),Dc&&o==ce&&f&&f.name!==ce&&(c=!0,v=function(){return jc(f,this)}),o)if(b={values:s(ce),keys:i?v:s(et),entries:s(rt)},a)for(O in b)(se||c||!(O in l))&&Jr(l,O,b[O]);else Cc({target:r,proto:!0,forced:se||c},b);return a&&l[Ge]!==v&&Jr(l,Ge,v,{name:o}),Zr[r]=v,b},Vc=function(e,r){return{value:e,done:r}},kc=X,tt=q,dn=Ea;Y.f;var Bc=Gc,le=Vc,hn="Array Iterator",Uc=dn.set,Qc=dn.getterFor(hn);Bc(Array,"Array",function(e,r){Uc(this,{type:hn,target:kc(e),index:0,kind:r})},function(){var e=Qc(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");tt.Arguments=tt.Array;var qc=C,Kc=q,Yc=qc("iterator"),Wc=Array.prototype,Hc=function(e){return e!==void 0&&(Kc.Array===e||Wc[Yc]===e)},zc=hr,nt=cr,Xc=or,Jc=q,Zc=C,el=Zc("iterator"),pn=function(e){if(!Xc(e))return nt(e,el)||nt(e,"@@iterator")||Jc[zc(e)]},rl=F,tl=sr,nl=W,ol=ar,il=pn,al=TypeError,sl=function(e,r){var t=arguments.length<2?il(e):r;if(tl(t))return nl(rl(t,e));throw al(ol(e)+" is not iterable")},cl=F,ot=W,ll=cr,ul=function(e,r,t){var n,o;ot(e);try{if(n=ll(e,"return"),!n){if(r==="throw")throw t;return t}n=cl(n,e)}catch(i){o=!0,n=i}if(r==="throw")throw t;if(o)throw n;return ot(n),t},fl=Wt,vl=F,dl=W,hl=ar,pl=Hc,yl=Zt,it=Ct,bl=sl,gl=pn,at=ul,ml=TypeError,ve=function(e,r){this.stopped=e,this.result=r},st=ve.prototype,wl=function(e,r,t){var n=t&&t.that,o=!!(t&&t.AS_ENTRIES),i=!!(t&&t.IS_RECORD),a=!!(t&&t.IS_ITERATOR),s=!!(t&&t.INTERRUPTED),u=fl(r,n),c,l,f,v,d,y,b,O=function(m){return c&&at(c,"normal",m),new ve(!0,m)},g=function(m){return o?(dl(m),s?u(m[0],m[1],O):u(m[0],m[1])):s?u(m,O):u(m)};if(i)c=e.iterator;else if(a)c=e;else{if(l=gl(e),!l)throw ml(hl(e)+" is not iterable");if(pl(l)){for(f=0,v=yl(e);v>f;f++)if(d=g(e[f]),d&&it(st,d))return d;return new ve(!1)}c=bl(e,l)}for(y=i?e.next:c.next;!(b=vl(y,c)).done;){try{d=g(b.value)}catch(m){at(c,"throw",m)}if(typeof d=="object"&&d&&it(st,d))return d}return new ve(!1)},Ol=lr,El=Y,$l=be,Sl=function(e,r,t){var n=Ol(r);n in e?El.f(e,n,$l(0,t)):e[n]=t},Tl=Ht,Il=wl,Rl=Sl;Tl({target:"Object",stat:!0},{fromEntries:function(r){var t={};return Il(r,function(n,o){Rl(t,n,o)},{AS_ENTRIES:!0}),t}});var Pl=ir,_l=Pl.Object.fromEntries,Al={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},Cl=Al,jl=I,Ll=hr,xl=J,ct=q,Ml=C,lt=Ml("toStringTag");for(var Ve in Cl){var ut=jl[Ve],ke=ut&&ut.prototype;ke&&Ll(ke)!==lt&&xl(ke,lt,Ve),ct[Ve]=ct.Array}var Nl=_l,Dl=Nl,Fl=Dl,Gl=Fl,Vl=Ao(Gl);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 kl="vk.com",Bl=(e,r,t)=>dt(void 0,void 0,void 0,function*(){const n=new URL(`https://${kl}/js/lang-pack.js`);n.searchParams.set("format","json"),n.searchParams.set("name",r),e!==void 0&&n.searchParams.set("lang",e);const i=yield(yield _o(n.toString())).json();return Ul(i,t)}),Ul=(e,r)=>Vl(Object.entries(e.keys).map(([t,n])=>[t.substring(`${r}_`.length),Ql(n)])),Ql=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=On;exports.Observable=w;exports.Subject=Xe;exports.Subscription=z;exports.VERSION=mn;exports.ValueSubject=eo;exports.abortable=Pn;exports.addScript=In;exports.areQualitiesExact=Hn;exports.assertEmptyArray=Tn;exports.assertNever=M;exports.assertNonNullable=En;exports.assertNotEmptyArray=Sn;exports.assertNullable=$n;exports.assertQualityIsExact=zn;exports.buffer=so;exports.checkNever=wn;exports.cloneDeep=Zn;exports.cloneDeepWith=rr;exports.combine=ro;exports.debounce=uo;exports.debounceFn=Jn;exports.detectEmbed=kn;exports.fillWithDefault=pt;exports.filter=yo;exports.filterChanged=go;exports.fromEvent=ao;exports.getCurrentBrowser=Je;exports.getExponentialDelay=Ln;exports.getHighestQuality=qn;exports.getIOSVersion=An;exports.interval=oo;exports.isHigher=Bn;exports.isHigherOrEqual=Un;exports.isIOS=_n;exports.isInvariantQuality=er;exports.isLower=Ze;exports.isLowerOrEqual=Qn;exports.isMacLike=Cn;exports.isMobile=jn;exports.isNonNullable=ft;exports.isNullable=vt;exports.loadVKLangPack=Bl;exports.map=yt;exports.mapTo=Oo;exports.merge=to;exports.noop=B;exports.now=Rn;exports.observableFrom=io;exports.once=Eo;exports.pairwise=$o;exports.safeStorage=Vn;exports.tap=To;exports.throttle=ho;exports.timeCodeToString=Xn;exports.timeout=no;exports.videoHeightToQuality=Kn;exports.videoQualityToHeight=Wn;exports.videoSizeToQuality=Yn;
6
+ "use strict";const On="1.0.35-beta.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 o;t?typeof t=="function"?o={next:t,error:B}: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:B,error:B};const i=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 a;try{a=this._subscribe(i)}catch(s){(n=i.error)===null||n===void 0||n.call(i,s)}return new H().add(()=>{switch(i.next=B,i.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(o){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,o)=>{r.addEventListener("abort",()=>{s(),c.remove()});const i=()=>{s(),o()},a=()=>{s(),n()},s=()=>{u&&clearTimeout(u),c.removeEventListener("load",a),c.removeEventListener("error",i)};let u;t&&(u=window.setTimeout(i,t));const c=document.createElement("script");c.addEventListener("load",a),c.addEventListener("error",i),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 o(i){return i instanceof t?i:new t(function(a){a(i)})}return new(t||(t=Promise))(function(i,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?i(l.value):o(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 o=r(...t);let i=e.aborted,a;for(;!i&&!e.aborted;)try{const s=yield o.next(a);i=(n=s.done)!==null&&n!==void 0?n:!1,a=s.value}catch(s){yield o.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,o=/firefox|fxios/i.test(e)?exports.CurrentClientBrowser.Firefox:void 0,i=/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||o||a||s||t||n||i||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:o}=window.navigator;return!!(t||/macintosh/i.test(n)&&o>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},xn=()=>[exports.CurrentClientDevice.Mac,exports.CurrentClientDevice.iPhone,exports.CurrentClientDevice.iPad,exports.CurrentClientDevice.iPod].includes(Ze().device),Ln=()=>{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:o=r,random:i=0}={})=>{let a=r;return a*=Math.pow(t,e),a*=1+(Math.random()*i*2-i),a=Math.round(a),a=Math.min(a,n),a=Math.max(a,o),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,L;const we=`vk-videoplayer-dummy-key-${Math.random()}`,Q=()=>{if(L!==void 0)return L;try{localStorage.setItem(we,"test"),localStorage.removeItem(we),L=b.LOCAL_STORAGE}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem(we),L=b.SESSION_STORAGE}catch(r){if(r instanceof DOMException||r instanceof TypeError)L=b.RUNTIME;else throw r}else throw e}return L===b.RUNTIME&&(E=new Map),L},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(o=>{const i=S[o];return i.width>=n&&i.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 o=r[n],i=e[n];Array.isArray(o)&&Array.isArray(i)?t[n]=i:typeof o=="object"&&typeof i=="object"?t[n]=bt(i,o):t[n]=n in e?i:o}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,o,i,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,i=t!=null&&t.maxWait?Math.max(+(t==null?void 0:t.maxWait)||0,r):i,v="trailing"in t?!!t.trailing:v);function p(h){const $=n,x=o;return n=o=void 0,c=h,a=e.apply(x,$),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,x=h-c,gr=r-$;return f?Math.min(gr,i-x):gr}function pr(h){const $=h-u,x=h-c;return u===void 0||$>=r||$<0||f&&x>=i}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=o=void 0,a)}function gn(){s!==void 0&&O(s),c=0,n=u=o=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(),x=pr($);if(n=h,o=this,u=$,x){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 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},eo=e=>tr(e),ro=300,to=(e,r=ro)=>new g(t=>{const{width:n,height:o}=e.getBoundingClientRect();if(t.next({width:n,height:o}),!window.ResizeObserver)return;const i=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 i.observe(e),()=>i.disconnect()});class no 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 oo(e){return new g(r=>{const t={};let n=Object.keys(e).length;const o=i=>a=>{i in t||n--,t[i]=a,n===0&&r.next(t)};return Object.entries(e).reduce((i,[a,s])=>i.add(s.subscribe(o(a))),new H)})}function io(...e){return new g(r=>e.reduce((t,n)=>t.add(n.subscribe(r)),new H))}var ao=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)}),so=e=>new g(r=>{const t=window.setInterval(()=>r.next(),e);return()=>window.clearInterval(t)}),co=e=>new g(r=>{e.forEach(t=>r.next(t))}),lo=(e,r)=>new g(t=>{const n=o=>t.next(o);return e.addEventListener(r,n),()=>e.removeEventListener(r,n)});function uo(e){return r=>new g(t=>r.subscribe(new fo(t,e)))}class fo{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 vo={leading:!1,trailing:!0};function ho(e,r=vo){return t=>new g(n=>t.subscribe(new bo(n,e,r)))}class bo{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 po={leading:!0,trailing:!1};function yo(e,r=po){return t=>new g(n=>t.subscribe(new go(n,e,r)))}class go{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 mo(e){return r=>new g(t=>r.subscribe(new wo(t,e)))}class wo{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 Oo(e=(r,t)=>r===t){return r=>new g(t=>r.subscribe(new Eo(t,e)))}const mr={};class Eo{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 So(t,e)))}let So=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 $o(e){return gt(()=>e)}function To(){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 a;t=!0,(a=r.error)===null||a===void 0||a.call(r,i),n&&o.unsubscribe()});return n=!0,t&&o.unsubscribe(),o})}function Io(){return e=>new g(r=>e.subscribe(new Ro(r)))}class Ro{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 Po(e){return r=>new g(t=>r.subscribe(new _o(t,e)))}class _o{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"})(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 a=n[o];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 Ao{constructor(){Object.defineProperty(this,"signal",{value:new mt,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&&(Ao.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 Co(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:i};let i=t;(i&&!i.prototype.hasOwnProperty("signal")||o)&&(i=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},i.prototype=t.prototype);const a=r;return{fetch:(u,c)=>{const l=i&&i.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:i}}const nr=wt({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),Ot=nr?Co({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,jo=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 xo(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}},Lo=A,ye=!Lo(function(){var e=function(){}.bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),Et=ye,St=Function.prototype,Ue=St.call,Mo=Et&&St.bind.bind(Ue,Ue),N=Et?Mo:function(e){return function(){return Ue.apply(e,arguments)}},$t=N,No=$t({}.toString),Do=$t("".slice),or=function(e){return Do(No(e),8,-1)},Fo=N,Go=A,ko=or,Ee=Object,Vo=Fo("".split),Bo=Go(function(){return!Ee("z").propertyIsEnumerable(0)})?function(e){return ko(e)=="String"?Vo(e,""):Ee(e)}:Ee,ir=function(e){return e==null},Uo=ir,Qo=TypeError,Tt=function(e){if(Uo(e))throw Qo("Can't call method on "+e);return e},qo=Bo,Ko=Tt,X=function(e){return qo(Ko(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,zo=typeof Qe=="undefined"&&Qe!==void 0,It={all:Qe,IS_HTMLDDA:zo},Rt=It,Wo=Rt.all,R=Rt.IS_HTMLDDA?function(e){return typeof e=="function"||e===Wo}:function(e){return typeof e=="function"},Yo=I,Ho=R,Or=Yo.WeakMap,Xo=Ho(Or)&&/native code/.test(String(Or)),Er=R,Pt=It,Jo=Pt.all,K=Pt.IS_HTMLDDA?function(e){return typeof e=="object"?e!==null:Er(e)||e===Jo}:function(e){return typeof e=="object"?e!==null:Er(e)},Zo=A,D=!Zo(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),z={},ei=I,Sr=K,qe=ei.document,ri=Sr(qe)&&Sr(qe.createElement),_t=function(e){return ri?qe.createElement(e):{}},ti=D,ni=A,oi=_t,At=!ti&&!ni(function(){return Object.defineProperty(oi("div"),"a",{get:function(){return 7}}).a!=7}),ii=D,ai=A,Ct=ii&&ai(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42}),si=K,ci=String,li=TypeError,W=function(e){if(si(e))return e;throw li(ci(e)+" is not an object")},ui=ye,ne=Function.prototype.call,F=ui?ne.bind(ne):function(){return ne.apply(ne,arguments)},ar={},Se=ar,$e=I,fi=R,$r=function(e){return fi(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]},vi=N,xt=vi({}.isPrototypeOf),di=typeof navigator!="undefined"&&String(navigator.userAgent)||"",Lt=I,Te=di,Tr=Lt.process,Ir=Lt.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 hi=he,_r=hi,bi=A,pi=I,yi=pi.String,Mt=!!Object.getOwnPropertySymbols&&!bi(function(){var e=Symbol();return!yi(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&_r&&_r<41}),gi=Mt,Nt=gi&&!Symbol.sham&&typeof Symbol.iterator=="symbol",mi=jt,wi=R,Oi=xt,Ei=Nt,Si=Object,Dt=Ei?function(e){return typeof e=="symbol"}:function(e){var r=mi("Symbol");return wi(r)&&Oi(r.prototype,Si(e))},$i=String,sr=function(e){try{return $i(e)}catch(r){return"Object"}},Ti=R,Ii=sr,Ri=TypeError,cr=function(e){if(Ti(e))return e;throw Ri(Ii(e)+" is not a function")},Pi=cr,_i=ir,lr=function(e,r){var t=e[r];return _i(t)?void 0:Pi(t)},Ie=F,Re=R,Pe=K,Ai=TypeError,Ci=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 Ai("Can't convert object to primitive value")},Ft={exports:{}},Ar=I,ji=Object.defineProperty,xi=function(e,r){try{ji(Ar,e,{value:r,configurable:!0,writable:!0})}catch(t){Ar[e]=r}return r},Li=I,Mi=xi,Cr="__core-js_shared__",Ni=Li[Cr]||Mi(Cr,{}),Gt=Ni,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,Di=Tt,Fi=Object,Vt=function(e){return Fi(Di(e))},Gi=N,ki=Vt,Vi=Gi({}.hasOwnProperty),j=Object.hasOwn||function(r,t){return Vi(ki(r),t)},Bi=N,Ui=0,Qi=Math.random(),qi=Bi(1 .toString),Bt=function(e){return"Symbol("+(e===void 0?"":e)+")_"+qi(++Ui+Qi,36)},Ki=I,zi=kt,xr=j,Wi=Bt,Yi=Mt,Hi=Nt,U=Ki.Symbol,_e=zi("wks"),Xi=Hi?U.for||U:U&&U.withoutSetter||Wi,C=function(e){return xr(_e,e)||(_e[e]=Yi&&xr(U,e)?U[e]:Xi("Symbol."+e)),_e[e]},Ji=F,Lr=K,Mr=Dt,Zi=lr,ea=Ci,ra=C,ta=TypeError,na=ra("toPrimitive"),oa=function(e,r){if(!Lr(e)||Mr(e))return e;var t=Zi(e,na),n;if(t){if(r===void 0&&(r="default"),n=Ji(t,e,r),!Lr(n)||Mr(n))return n;throw ta("Can't convert object to primitive value")}return r===void 0&&(r="number"),ea(e,r)},ia=oa,aa=Dt,ur=function(e){var r=ia(e,"string");return aa(r)?r:r+""},sa=D,ca=At,la=Ct,oe=W,Nr=ur,ua=TypeError,Ae=Object.defineProperty,fa=Object.getOwnPropertyDescriptor,Ce="enumerable",je="configurable",xe="writable";z.f=sa?la?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=fa(r,t);o&&o[xe]&&(r[t]=n.value,n={configurable:je in n?n[je]:o[je],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),ca)try{return Ae(r,t,n)}catch(o){}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=Xo,Ut=I,ga=K,ma=J,Le=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(Le(e,G))throw Ke(Fr);return r.facade=e,ma(e,G,r),r},Y=function(e){return Le(e,G)?e[G]:{}},pe=function(e){return Le(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=or,_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,xa=zt,La=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 La(!ja(xa.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)}},ie=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,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 Ha(e,this,arguments)};return r.prototype=e.prototype,r},Xt=function(e,r){var t=e.target,n=e.global,o=e.stat,i=e.proto,a=n?ie:o?ie[t]:(ie[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+(o?".":"#")+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,ie):e.wrap&&l?O=ts(d):i&&Ja(d)?O=Xa(d):O=d,(e.sham||d&&d.sham||p&&p.sham)&&V(O,"sham",!0),V(s,v,O),i&&(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,os=ze&&Object.getOwnPropertyDescriptor,dr=ns(Jt,"name"),is=dr&&function(){}.name==="something",as=dr&&(!ze||ze&&os(Jt,"name").configurable),ss={EXISTS:dr,PROPER:is,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 o=ws(r),i=Es(o),a=Os(n,i),s;if(e&&t!=t){for(;i>a;)if(s=o[a++],s!=s)return!0}else for(;i>a;a++)if((e||a in o)&&o[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,o=[],i;for(i in t)!Ne(Rs,i)&&Ne(t,i)&&qr(o,i);for(;r.length>n;)Ne(t,i=r[n++])&&(~Is(o,i)||qr(o,i));return o},tn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],_s=Ps,As=tn,Cs=Object.keys||function(r){return _s(r,As)},js=D,xs=Ct,Ls=z,Ms=W,Ns=X,Ds=Cs;Zt.f=js&&!xs?Object.defineProperties:function(r,t){Ms(r);for(var n=Ns(t),o=Ds(t),i=o.length,a=0,s;i>a;)Ls.f(r,s=o[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,oc=K,ic=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=!oc(_)||tc(function(){var e={};return _[Xe].call(e)!==e});cc?_={}:_=ic(_);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=or,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 o=t?e:e.prototype;$c(o,Jr)||Ec(o,Jr,{configurable:!0,value:r}),n&&!Oc&&Sc(o,"toString",Tc)}},Rc=un.IteratorPrototype,Pc=an,_c=ge,Ac=vn,Cc=q,jc=function(){return this},xc=function(e,r,t,n){var o=r+" Iterator";return e.prototype=Pc(Rc,{next:_c(+!n,t)}),Ac(e,o,!1,!0),Cc[o]=jc,e},Lc=Xt,Mc=F,dn=ss,Nc=xc,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,o,i,a){Nc(t,r,n);var s=function(m){if(m===o&&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"]||o&&l[o],v=!se&&f||s(o),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&&o==ce&&f&&f.name!==ce&&(c=!0,v=function(){return Mc(f,this)}),o)if(y={values:s(ce),keys:i?v:s(rt),entries:s(tt)},a)for(O in y)(se||c||!(O in l))&&Zr(l,O,y[O]);else Lc({target:r,proto:!0,forced:se||c},y);return a&&l[ke]!==v&&Zr(l,ke,v,{name:o}),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,ot=lr,el=ir,rl=q,tl=C,nl=tl("iterator"),yn=function(e){if(!el(e))return ot(e,nl)||ot(e,"@@iterator")||rl[Zc(e)]},ol=F,il=cr,al=W,sl=sr,cl=yn,ll=TypeError,ul=function(e,r){var t=arguments.length<2?cl(e):r;if(il(t))return al(ol(t,e));throw ll(sl(e)+" is not iterable")},fl=F,it=W,vl=lr,dl=function(e,r,t){var n,o;it(e);try{if(n=vl(e,"return"),!n){if(r==="throw")throw t;return t}n=fl(n,e)}catch(i){o=!0,n=i}if(r==="throw")throw t;if(o)throw n;return it(n),t},hl=Ht,bl=F,pl=W,yl=sr,gl=Jc,ml=rn,at=xt,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,o=!!(t&&t.AS_ENTRIES),i=!!(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 o?(pl(w),s?u(w[0],w[1],O):u(w[0],w[1])):s?u(w,O):u(w)};if(i)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=i?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,o){Al(t,n,o)},{AS_ENTRIES:!0}),t}});var Cl=ar,jl=Cl.Object.fromEntries,xl={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},Ll=xl,Ml=I,Nl=br,Dl=J,lt=q,Fl=C,ut=Fl("toStringTag");for(var Ve in Ll){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=xo(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 i=yield(yield jo(n.toString())).json();return Kl(i,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=no;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=uo;exports.checkNever=En;exports.cloneDeep=eo;exports.cloneDeepWith=tr;exports.combine=oo;exports.debounce=ho;exports.debounceFn=pt;exports.detectEmbed=Un;exports.fillWithDefault=bt;exports.filter=mo;exports.filterChanged=Oo;exports.fromEvent=lo;exports.getCurrentBrowser=Ze;exports.getExponentialDelay=Mn;exports.getHighestQuality=zn;exports.getIOSVersion=jn;exports.interval=so;exports.isHigher=Qn;exports.isHigherOrEqual=qn;exports.isIOS=Cn;exports.isInvariantQuality=rr;exports.isLower=er;exports.isLowerOrEqual=Kn;exports.isMacLike=xn;exports.isMobile=Ln;exports.isNonNullable=de;exports.isNullable=vt;exports.loadVKLangPack=ql;exports.map=gt;exports.mapTo=$o;exports.merge=io;exports.noop=B;exports.now=_n;exports.observableFrom=co;exports.observeElementSize=to;exports.once=To;exports.pairwise=Io;exports.safeStorage=Bn;exports.tap=Po;exports.throttle=yo;exports.throttleFn=yt;exports.timeCodeToString=Zn;exports.timeout=ao;exports.videoHeightToQuality=Wn;exports.videoQualityToHeight=Hn;exports.videoSizeToQuality=Yn;
package/es2015.esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
- * @vkontakte/videoplayer-shared v1.0.34
3
- * Fri, 26 Apr 2024 14:08:06 GMT
4
- * https://st.mycdn.me/static/vkontakte-videoplayer/1-0-34/doc/
2
+ * @vkontakte/videoplayer-shared v1.0.35-beta.0
3
+ * Tue, 07 May 2024 23:30:33 GMT
4
+ * https://st.mycdn.me/static/vkontakte-videoplayer/1-0-35/doc/
5
5
  */
6
- const al="1.0.34";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`)},il=e=>{},X=()=>{};class E{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 vt extends E{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 sl{constructor(){this.log$=new vt,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 cl(e,r='Assertion "value is not nullable" failed'){if(e==null)throw new Error(r)}function ll(e,r='Assertion "value is nullable" failed'){if(e!=null)throw new Error(r)}function wn(e){return typeof e!="undefined"&&e!==null}function $n(e){return e==null}function ul(e,r){if(!(e!=null&&e.length))throw new Error(r)}function fl(e,r){if(e!=null&&e.length)throw new Error(r)}const vl=(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 dl=typeof((we=window.performance)===null||we===void 0?void 0:we.now)=="function"?()=>window.performance.now():()=>Date.now();function dt(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 hl=(e,r)=>(...t)=>dt(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 w;(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"})(w||(w={}));const ht=()=>{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)?w.Android:void 0,c=/iphone/i.test(e)?w.iPhone:void 0,l=/ipad/i.test(e)?w.iPad:void 0,f=/ipod/i.test(e)?w.iPod:void 0,v=/mac/i.test(e)?w.Mac:void 0,d=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(e)?w.RestMobile:void 0;return{browser:r||o||i||s||t||n||a||j.Rest,device:u||c||l||f||d||v||w.Desktop}},pl=(e=!1)=>{const t=[w.iPhone,w.iPad,w.iPod].includes(ht().device);if(!e)return t;const{userAgent:n,maxTouchPoints:o}=window.navigator;return!!(t||/macintosh/i.test(n)&&o>0)},bl=()=>{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},yl=()=>[w.Mac,w.iPhone,w.iPad,w.iPod].includes(ht().device),gl=()=>{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)},ml=(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 $,F;const $e=`vk-videoplayer-dummy-key-${Math.random()}`,Y=()=>{if(F!==void 0)return F;try{localStorage.setItem($e,"test"),localStorage.removeItem($e),F=p.LOCAL_STORAGE}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem($e),F=p.SESSION_STORAGE}catch(r){if(r instanceof DOMException||r instanceof TypeError)F=p.RUNTIME;else throw r}else throw e}return F===p.RUNTIME&&($=new Map),F},En=()=>Y()===p.LOCAL_STORAGE,Sn=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 $==null?void 0:$.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($==null?void 0:$.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=$==null?void 0:$.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($==null?void 0:$.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 $==null?void 0:$.clear();default:K(e)}};var Ol=Object.freeze({__proto__:null,clear:Pn,get:Sn,has:In,isPersistent:En,remove:Rn,set:Tn});const wl=()=>{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 S;(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"})(S||(S={}));const T={[S.Q_144P]:{width:256,height:144},[S.Q_240P]:{width:428,height:240},[S.Q_360P]:{width:640,height:360},[S.Q_480P]:{width:856,height:480},[S.Q_720P]:{width:1280,height:720},[S.Q_1080P]:{width:1920,height:1080},[S.Q_1440P]:{width:2560,height:1440},[S.Q_2160P]:{width:3840,height:2160},[S.Q_4320P]:{width:7680,height:4320}},$l=(e,r)=>T[e].height>T[r].height,El=(e,r)=>T[e].height>=T[r].height,pt=(e,r)=>T[e].height<T[r].height,Sl=(e,r)=>T[e].height<=T[r].height,Tl=e=>e.sort((r,t)=>r===t?0:r===S.INVARIANT?1:t===S.INVARIANT?-1:pt(r,t)?1:-1)[0],bt=Object.keys(T).sort((e,r)=>pt(e,r)?-1:1),Il=(e,r=.02)=>[...bt].find(n=>T[n].height*(1+r)>=e),Rl=({width:e,height:r})=>{const t=Math.min(e,r),n=Math.max(e,r);return bt.find(o=>{const a=T[o];return a.width>=n&&a.height>=t})},Pl=e=>T[e].height,yt=e=>e===S.INVARIANT,_l=e=>e.every(r=>!yt(r));function Al(e){if(yt(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},jl=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 xl(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,C=o;return n=o=void 0,c=h,i=e.apply(C,I),i}function y(h,I){return d?(s&&window.cancelAnimationFrame(s),window.requestAnimationFrame(h)):setTimeout(h,I)}function O(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,C=h-c,pr=r-I;return f?Math.min(pr,a-C):pr}function dr(h){const I=h-u,C=h-c;return u===void 0||I>=r||I<0||f&&C>=a}function te(){const h=Date.now();if(dr(h))return hr(h);s=y(te,m(h))}function hr(h){return s=void 0,v&&n?b(h):(n=o=void 0,i)}function gn(){s!==void 0&&O(s),c=0,n=u=o=s=void 0}function mn(){return s===void 0?i:hr(Date.now())}function On(){return s!==void 0}function ne(...h){const I=Date.now(),C=dr(I);if(n=h,o=this,u=I,C){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=gn,ne.flush=mn,ne.pending=On,ne}const gt=(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]=gt(e[n],r):t[n]=e[n]}return t},Ll=e=>gt(e);class Ml extends vt{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 Nl(e){return new E(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 Cl(...e){return new E(r=>e.reduce((t,n)=>t.add(n.subscribe(r)),new ge))}var Fl=e=>new E(r=>{const t=window.setTimeout(()=>{try{r.next()}catch(n){if(r.error)r.error(n);else throw n}},e);return()=>window.clearTimeout(t)}),Dl=e=>new E(r=>{const t=window.setInterval(()=>r.next(),e);return()=>window.clearInterval(t)}),Gl=e=>new E(r=>{e.forEach(t=>r.next(t))}),kl=(e,r)=>new E(t=>{const n=o=>t.next(o);return e.addEventListener(r,n),()=>e.removeEventListener(r,n)});function Ul(e){return r=>new E(t=>r.subscribe(new An(t,e)))}class An{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 jn={leading:!1,trailing:!0};function Vl(e,r=jn){return t=>new E(n=>t.subscribe(new xn(n,e,r)))}class xn{constructor(r,t,n){this.destination=r,this.time=t,this.config=n}next(r){this.lastValue=r,wn(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 Ln={leading:!0,trailing:!1};function Bl(e,r=Ln){return t=>new E(n=>t.subscribe(new Mn(n,e,r)))}class Mn{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 ql(e){return r=>new E(t=>r.subscribe(new Nn(t,e)))}class Nn{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 Kl(e=(r,t)=>r===t){return r=>new E(t=>r.subscribe(new Cn(t,e)))}const br={};class Cn{constructor(r,t){this.destination=r,this.predicate=t,this.lastValue=br}next(r){let t;try{t=this.lastValue===br||!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 Fn(e){return r=>new E(t=>r.subscribe(new Dn(t,e)))}let Dn=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 Wl(e){return Fn(()=>e)}function Ql(){return e=>new E(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 zl(){return e=>new E(r=>e.subscribe(new Gn(r)))}class Gn{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 Hl(e){return r=>new E(t=>r.subscribe(new kn(t,e)))}class kn{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 yr;(function(e){e.NETWORK="network",e.VIDEO_PIPELINE="video_pipeline",e.EXTERNAL_API="external_api",e.PARSER="parser",e.DOM="dom",e.WTF="wtf"})(yr||(yr={}));class gr{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 mt extends gr{constructor(){super(),this.listeners||gr.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 Un{constructor(){Object.defineProperty(this,"signal",{value:new mt,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&&(Un.prototype[Symbol.toStringTag]="AbortController",mt.prototype[Symbol.toStringTag]="AbortSignal");function Ot(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 Vn(e){typeof e=="function"&&(e={fetch:e});const{fetch:r,Request:t=r.Request,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o=!1}=e;if(!Ot({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 er=Ot({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),wt=er?Vn({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,Bn=er?wt.fetch:window.fetch;er?wt.Request:window.Request;var Ee=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function qn(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}},Kn=L,me=!Kn(function(){var e=function(){}.bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),$t=me,Et=Function.prototype,Ke=Et.call,Yn=$t&&Et.bind.bind(Ke,Ke),D=$t?Yn:function(e){return function(){return Ke.apply(e,arguments)}},St=D,Wn=St({}.toString),Qn=St("".slice),rr=function(e){return Qn(Wn(e),8,-1)},zn=D,Hn=L,Xn=rr,Se=Object,Jn=zn("".split),Zn=Hn(function(){return!Se("z").propertyIsEnumerable(0)})?function(e){return Xn(e)=="String"?Jn(e,""):Se(e)}:Se,tr=function(e){return e==null},eo=tr,ro=TypeError,Tt=function(e){if(eo(e))throw ro("Can't call method on "+e);return e},to=Zn,no=Tt,Z=function(e){return to(no(e))},W={},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 Ee=="object"&&Ee)||function(){return this}()||Ee||Function("return this")(),Ye=typeof document=="object"&&document.all,oo=typeof Ye=="undefined"&&Ye!==void 0,It={all:Ye,IS_HTMLDDA:oo},Rt=It,ao=Rt.all,_=Rt.IS_HTMLDDA?function(e){return typeof e=="function"||e===ao}:function(e){return typeof e=="function"},io=P,so=_,mr=io.WeakMap,co=so(mr)&&/native code/.test(String(mr)),Or=_,Pt=It,lo=Pt.all,Q=Pt.IS_HTMLDDA?function(e){return typeof e=="object"?e!==null:Or(e)||e===lo}:function(e){return typeof e=="object"?e!==null:Or(e)},uo=L,G=!uo(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),z={},fo=P,wr=Q,We=fo.document,vo=wr(We)&&wr(We.createElement),_t=function(e){return vo?We.createElement(e):{}},ho=G,po=L,bo=_t,At=!ho&&!po(function(){return Object.defineProperty(bo("div"),"a",{get:function(){return 7}}).a!=7}),yo=G,go=L,jt=yo&&go(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42}),mo=Q,Oo=String,wo=TypeError,H=function(e){if(mo(e))return e;throw wo(Oo(e)+" is not an object")},$o=me,ae=Function.prototype.call,k=$o?ae.bind(ae):function(){return ae.apply(ae,arguments)},nr={},Te=nr,Ie=P,Eo=_,$r=function(e){return Eo(e)?e:void 0},xt=function(e,r){return arguments.length<2?$r(Te[e])||$r(Ie[e]):Te[e]&&Te[e][r]||Ie[e]&&Ie[e][r]},So=D,Lt=So({}.isPrototypeOf),To=typeof navigator!="undefined"&&String(navigator.userAgent)||"",Mt=P,Re=To,Er=Mt.process,Sr=Mt.Deno,Tr=Er&&Er.versions||Sr&&Sr.version,Ir=Tr&&Tr.v8,R,pe;Ir&&(R=Ir.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 Io=pe,Rr=Io,Ro=L,Po=P,_o=Po.String,Nt=!!Object.getOwnPropertySymbols&&!Ro(function(){var e=Symbol();return!_o(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Rr&&Rr<41}),Ao=Nt,Ct=Ao&&!Symbol.sham&&typeof Symbol.iterator=="symbol",jo=xt,xo=_,Lo=Lt,Mo=Ct,No=Object,Ft=Mo?function(e){return typeof e=="symbol"}:function(e){var r=jo("Symbol");return xo(r)&&Lo(r.prototype,No(e))},Co=String,or=function(e){try{return Co(e)}catch(r){return"Object"}},Fo=_,Do=or,Go=TypeError,ar=function(e){if(Fo(e))return e;throw Go(Do(e)+" is not a function")},ko=ar,Uo=tr,ir=function(e,r){var t=e[r];return Uo(t)?void 0:ko(t)},Pe=k,_e=_,Ae=Q,Vo=TypeError,Bo=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 Vo("Can't convert object to primitive value")},Dt={exports:{}},Pr=P,qo=Object.defineProperty,Ko=function(e,r){try{qo(Pr,e,{value:r,configurable:!0,writable:!0})}catch(t){Pr[e]=r}return r},Yo=P,Wo=Ko,_r="__core-js_shared__",Qo=Yo[_r]||Wo(_r,{}),Gt=Qo,Ar=Gt;(Dt.exports=function(e,r){return Ar[e]||(Ar[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=Dt.exports,zo=Tt,Ho=Object,Ut=function(e){return Ho(zo(e))},Xo=D,Jo=Ut,Zo=Xo({}.hasOwnProperty),N=Object.hasOwn||function(r,t){return Zo(Jo(r),t)},ea=D,ra=0,ta=Math.random(),na=ea(1 .toString),Vt=function(e){return"Symbol("+(e===void 0?"":e)+")_"+na(++ra+ta,36)},oa=P,aa=kt,jr=N,ia=Vt,sa=Nt,ca=Ct,q=oa.Symbol,je=aa("wks"),la=ca?q.for||q:q&&q.withoutSetter||ia,M=function(e){return jr(je,e)||(je[e]=sa&&jr(q,e)?q[e]:la("Symbol."+e)),je[e]},ua=k,xr=Q,Lr=Ft,fa=ir,va=Bo,da=M,ha=TypeError,pa=da("toPrimitive"),ba=function(e,r){if(!xr(e)||Lr(e))return e;var t=fa(e,pa),n;if(t){if(r===void 0&&(r="default"),n=ua(t,e,r),!xr(n)||Lr(n))return n;throw ha("Can't convert object to primitive value")}return r===void 0&&(r="number"),va(e,r)},ya=ba,ga=Ft,sr=function(e){var r=ya(e,"string");return ga(r)?r:r+""},ma=G,Oa=At,wa=jt,ie=H,Mr=sr,$a=TypeError,xe=Object.defineProperty,Ea=Object.getOwnPropertyDescriptor,Le="enumerable",Me="configurable",Ne="writable";z.f=ma?wa?function(r,t,n){if(ie(r),t=Mr(t),ie(n),typeof r=="function"&&t==="prototype"&&"value"in n&&Ne in n&&!n[Ne]){var o=Ea(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=Mr(t),ie(n),Oa)try{return xe(r,t,n)}catch(o){}if("get"in n||"set"in n)throw $a("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}},Sa=G,Ta=z,Ia=Oe,ee=Sa?function(e,r,t){return Ta.f(e,r,Ia(1,t))}:function(e,r,t){return e[r]=t,e},Ra=kt,Pa=Vt,Nr=Ra("keys"),cr=function(e){return Nr[e]||(Nr[e]=Pa(e))},lr={},_a=co,Bt=P,Aa=Q,ja=ee,Ce=N,Fe=Gt,xa=cr,La=lr,Cr="Object already initialized",Qe=Bt.TypeError,Ma=Bt.WeakMap,be,J,ye,Na=function(e){return ye(e)?J(e):be(e,{})},Ca=function(e){return function(r){var t;if(!Aa(r)||(t=J(r)).type!==e)throw Qe("Incompatible receiver, "+e+" required");return t}};if(_a||Fe.state){var A=Fe.state||(Fe.state=new Ma);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=xa("state");La[U]=!0,be=function(e,r){if(Ce(e,U))throw Qe(Cr);return r.facade=e,ja(e,U,r),r},J=function(e){return Ce(e,U)?e[U]:{}},ye=function(e){return Ce(e,U)}}var Fa={set:be,get:J,has:ye,enforce:Na,getterFor:Ca},Da=me,qt=Function.prototype,Fr=qt.apply,Dr=qt.call,Ga=typeof Reflect=="object"&&Reflect.apply||(Da?Dr.bind(Fr):function(){return Dr.apply(Fr,arguments)}),ka=rr,Ua=D,Kt=function(e){if(ka(e)==="Function")return Ua(e)},Yt={},Wt={},Qt={}.propertyIsEnumerable,zt=Object.getOwnPropertyDescriptor,Va=zt&&!Qt.call({1:2},1);Wt.f=Va?function(r){var t=zt(this,r);return!!t&&t.enumerable}:Qt;var Ba=G,qa=k,Ka=Wt,Ya=Oe,Wa=Z,Qa=sr,za=N,Ha=At,Gr=Object.getOwnPropertyDescriptor;Yt.f=Ba?Gr:function(r,t){if(r=Wa(r),t=Qa(t),Ha)try{return Gr(r,t)}catch(n){}if(za(r,t))return Ya(!qa(Ka.f,r,t),r[t])};var Xa=L,Ja=_,Za=/#|\.prototype\./,re=function(e,r){var t=ri[ei(e)];return t==ni?!0:t==ti?!1:Ja(r)?Xa(r):!!r},ei=re.normalize=function(e){return String(e).replace(Za,".").toLowerCase()},ri=re.data={},ti=re.NATIVE="N",ni=re.POLYFILL="P",oi=re,kr=Kt,ai=ar,ii=me,si=kr(kr.bind),Ht=function(e,r){return ai(e),r===void 0?e:ii?si(e,r):function(){return e.apply(r,arguments)}},se=P,ci=Ga,li=Kt,ui=_,fi=Yt.f,vi=oi,V=nr,di=Ht,B=ee,Ur=N,hi=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 ci(e,this,arguments)};return r.prototype=e.prototype,r},Xt=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?V:V[t]||B(V,t,{})[t],u=s.prototype,c,l,f,v,d,b,y,O,g;for(v in r)c=vi(n?v:t+(o?".":"#")+v,e.forced),l=!c&&i&&Ur(i,v),b=s[v],l&&(e.dontCallGetSet?(g=fi(i,v),y=g&&g.value):y=i[v]),d=l&&y?y:r[v],!(l&&typeof b==typeof d)&&(e.bind&&l?O=di(d,se):e.wrap&&l?O=hi(d):a&&ui(d)?O=li(d):O=d,(e.sham||d&&d.sham||b&&b.sham)&&B(O,"sham",!0),B(s,v,O),a&&(f=t+"Prototype",Ur(V,f)||B(V,f,{}),B(V[f],v,d),e.real&&u&&(c||!u[v])&&B(u,v,d)))},ze=G,pi=N,Jt=Function.prototype,bi=ze&&Object.getOwnPropertyDescriptor,ur=pi(Jt,"name"),yi=ur&&function(){}.name==="something",gi=ur&&(!ze||ze&&bi(Jt,"name").configurable),mi={EXISTS:ur,PROPER:yi,CONFIGURABLE:gi},Zt={},Oi=Math.ceil,wi=Math.floor,$i=Math.trunc||function(r){var t=+r;return(t>0?wi:Oi)(t)},Ei=$i,en=function(e){var r=+e;return r!==r||r===0?0:Ei(r)},Si=en,Ti=Math.max,Ii=Math.min,Ri=function(e,r){var t=Si(e);return t<0?Ti(t+r,0):Ii(t,r)},Pi=en,_i=Math.min,Ai=function(e){return e>0?_i(Pi(e),9007199254740991):0},ji=Ai,rn=function(e){return ji(e.length)},xi=Z,Li=Ri,Mi=rn,Vr=function(e){return function(r,t,n){var o=xi(r),a=Mi(o),i=Li(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}},Ni={includes:Vr(!0),indexOf:Vr(!1)},Ci=D,De=N,Fi=Z,Di=Ni.indexOf,Gi=lr,Br=Ci([].push),ki=function(e,r){var t=Fi(e),n=0,o=[],a;for(a in t)!De(Gi,a)&&De(t,a)&&Br(o,a);for(;r.length>n;)De(t,a=r[n++])&&(~Di(o,a)||Br(o,a));return o},tn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Ui=ki,Vi=tn,Bi=Object.keys||function(r){return Ui(r,Vi)},qi=G,Ki=jt,Yi=z,Wi=H,Qi=Z,zi=Bi;Zt.f=qi&&!Ki?Object.defineProperties:function(r,t){Wi(r);for(var n=Qi(t),o=zi(t),a=o.length,i=0,s;a>i;)Yi.f(r,s=o[i++],n[s]);return r};var Hi=xt,Xi=Hi("document","documentElement"),Ji=H,Zi=Zt,qr=tn,es=lr,rs=Xi,ts=_t,ns=cr,Kr=">",Yr="<",He="prototype",Xe="script",nn=ns("IE_PROTO"),Ge=function(){},on=function(e){return Yr+Xe+Kr+e+Yr+"/"+Xe+Kr},Wr=function(e){e.write(on("")),e.close();var r=e.parentWindow.Object;return e=null,r},os=function(){var e=ts("iframe"),r="java"+Xe+":",t;return e.style.display="none",rs.appendChild(e),e.src=String(r),t=e.contentWindow.document,t.open(),t.write(on("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):os():Wr(ce);for(var e=qr.length;e--;)delete ve[He][qr[e]];return ve()};es[nn]=!0;var an=Object.create||function(r,t){var n;return r!==null?(Ge[He]=Ji(r),n=new Ge,Ge[He]=null,n[nn]=r):n=ve(),t===void 0?n:Zi.f(n,t)},as=L,is=!as(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),ss=N,cs=_,ls=Ut,us=cr,fs=is,Qr=us("IE_PROTO"),Je=Object,vs=Je.prototype,sn=fs?Je.getPrototypeOf:function(e){var r=ls(e);if(ss(r,Qr))return r[Qr];var t=r.constructor;return cs(t)&&r instanceof t?t.prototype:r instanceof Je?vs:null},ds=ee,cn=function(e,r,t,n){return n&&n.enumerable?e[r]=t:ds(e,r,t),e},hs=L,ps=_,bs=Q,ys=an,zr=sn,gs=cn,ms=M,Ze=ms("iterator"),ln=!1,x,ke,Ue;[].keys&&(Ue=[].keys(),"next"in Ue?(ke=zr(zr(Ue)),ke!==Object.prototype&&(x=ke)):ln=!0);var Os=!bs(x)||hs(function(){var e={};return x[Ze].call(e)!==e});Os?x={}:x=ys(x);ps(x[Ze])||gs(x,Ze,function(){return this});var un={IteratorPrototype:x,BUGGY_SAFARI_ITERATORS:ln},ws=M,$s=ws("toStringTag"),fn={};fn[$s]="z";var fr=String(fn)==="[object z]",Es=fr,Ss=_,de=rr,Ts=M,Is=Ts("toStringTag"),Rs=Object,Ps=de(function(){return arguments}())=="Arguments",_s=function(e,r){try{return e[r]}catch(t){}},vr=Es?de:function(e){var r,t,n;return e===void 0?"Undefined":e===null?"Null":typeof(t=_s(r=Rs(e),Is))=="string"?t:Ps?de(r):(n=de(r))=="Object"&&Ss(r.callee)?"Arguments":n},As=fr,js=vr,xs=As?{}.toString:function(){return"[object "+js(this)+"]"},Ls=fr,Ms=z.f,Ns=ee,Cs=N,Fs=xs,Ds=M,Hr=Ds("toStringTag"),vn=function(e,r,t,n){if(e){var o=t?e:e.prototype;Cs(o,Hr)||Ms(o,Hr,{configurable:!0,value:r}),n&&!Ls&&Ns(o,"toString",Fs)}},Gs=un.IteratorPrototype,ks=an,Us=Oe,Vs=vn,Bs=W,qs=function(){return this},Ks=function(e,r,t,n){var o=r+" Iterator";return e.prototype=ks(Gs,{next:Us(+!n,t)}),Vs(e,o,!1,!0),Bs[o]=qs,e},Ys=Xt,Ws=k,dn=mi,Qs=Ks,zs=sn,Hs=vn,Xr=cn,Xs=M,Jr=W,hn=un,Js=dn.PROPER;dn.CONFIGURABLE;hn.IteratorPrototype;var le=hn.BUGGY_SAFARI_ITERATORS,Ve=Xs("iterator"),Zr="keys",ue="values",et="entries",Zs=function(){return this},ec=function(e,r,t,n,o,a,i){Qs(t,r,n);var s=function(g){if(g===o&&v)return v;if(!le&&g in l)return l[g];switch(g){case Zr:return function(){return new t(this,g)};case ue:return function(){return new t(this,g)};case et:return function(){return new t(this,g)}}return function(){return new t(this)}},u=r+" Iterator",c=!1,l=e.prototype,f=l[Ve]||l["@@iterator"]||o&&l[o],v=!le&&f||s(o),d=r=="Array"&&l.entries||f,b,y,O;if(d&&(b=zs(d.call(new e)),b!==Object.prototype&&b.next&&(Hs(b,u,!0,!0),Jr[u]=Zs)),Js&&o==ue&&f&&f.name!==ue&&(c=!0,v=function(){return Ws(f,this)}),o)if(y={values:s(ue),keys:a?v:s(Zr),entries:s(et)},i)for(O in y)(le||c||!(O in l))&&Xr(l,O,y[O]);else Ys({target:r,proto:!0,forced:le||c},y);return i&&l[Ve]!==v&&Xr(l,Ve,v,{name:o}),Jr[r]=v,y},rc=function(e,r){return{value:e,done:r}},tc=Z,rt=W,pn=Fa;z.f;var nc=ec,fe=rc,bn="Array Iterator",oc=pn.set,ac=pn.getterFor(bn);nc(Array,"Array",function(e,r){oc(this,{type:bn,target:tc(e),index:0,kind:r})},function(){var e=ac(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");rt.Arguments=rt.Array;var ic=M,sc=W,cc=ic("iterator"),lc=Array.prototype,uc=function(e){return e!==void 0&&(sc.Array===e||lc[cc]===e)},fc=vr,tt=ir,vc=tr,dc=W,hc=M,pc=hc("iterator"),yn=function(e){if(!vc(e))return tt(e,pc)||tt(e,"@@iterator")||dc[fc(e)]},bc=k,yc=ar,gc=H,mc=or,Oc=yn,wc=TypeError,$c=function(e,r){var t=arguments.length<2?Oc(e):r;if(yc(t))return gc(bc(t,e));throw wc(mc(e)+" is not iterable")},Ec=k,nt=H,Sc=ir,Tc=function(e,r,t){var n,o;nt(e);try{if(n=Sc(e,"return"),!n){if(r==="throw")throw t;return t}n=Ec(n,e)}catch(a){o=!0,n=a}if(r==="throw")throw t;if(o)throw n;return nt(n),t},Ic=Ht,Rc=k,Pc=H,_c=or,Ac=uc,jc=rn,ot=Lt,xc=$c,Lc=yn,at=Tc,Mc=TypeError,he=function(e,r){this.stopped=e,this.result=r},it=he.prototype,Nc=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=Ic(r,n),c,l,f,v,d,b,y,O=function(m){return c&&at(c,"normal",m),new he(!0,m)},g=function(m){return o?(Pc(m),s?u(m[0],m[1],O):u(m[0],m[1])):s?u(m,O):u(m)};if(a)c=e.iterator;else if(i)c=e;else{if(l=Lc(e),!l)throw Mc(_c(e)+" is not iterable");if(Ac(l)){for(f=0,v=jc(e);v>f;f++)if(d=g(e[f]),d&&ot(it,d))return d;return new he(!1)}c=xc(e,l)}for(b=a?e.next:c.next;!(y=Rc(b,c)).done;){try{d=g(y.value)}catch(m){at(c,"throw",m)}if(typeof d=="object"&&d&&ot(it,d))return d}return new he(!1)},Cc=sr,Fc=z,Dc=Oe,Gc=function(e,r,t){var n=Cc(r);n in e?Fc.f(e,n,Dc(0,t)):e[n]=t},kc=Xt,Uc=Nc,Vc=Gc;kc({target:"Object",stat:!0},{fromEntries:function(r){var t={};return Uc(r,function(n,o){Vc(t,n,o)},{AS_ENTRIES:!0}),t}});var Bc=nr,qc=Bc.Object.fromEntries,Kc={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},Yc=Kc,Wc=P,Qc=vr,zc=ee,st=W,Hc=M,ct=Hc("toStringTag");for(var Be in Yc){var lt=Wc[Be],qe=lt&&lt.prototype;qe&&Qc(qe)!==ct&&zc(qe,ct,Be),st[Be]=st.Array}var Xc=qc,Jc=Xc,Zc=Jc,el=Zc,rl=qn(el),ut;(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"})(ut||(ut={}));const tl="vk.com",Xl=(e,r,t)=>dt(void 0,void 0,void 0,function*(){const n=new URL(`https://${tl}/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 Bn(n.toString())).json();return nl(a,t)}),nl=(e,r)=>rl(Object.entries(e.keys).map(([t,n])=>[t.substring(`${r}_`.length),ol(n)])),ol=e=>Array.isArray(e)?e[0]:e;var ft;(function(e){e.RU="ru",e.EN="en"})(ft||(ft={}));export{j as CurrentClientBrowser,w as CurrentClientDevice,yr as ErrorCategory,ft as InterfaceLanguage,sl as Logger,E as Observable,vt as Subject,ge as Subscription,al as VERSION,ut as VKNumericLanguage,Ml as ValueSubject,S as VideoQuality,hl as abortable,vl as addScript,_l as areQualitiesExact,fl as assertEmptyArray,K as assertNever,cl as assertNonNullable,ul as assertNotEmptyArray,ll as assertNullable,Al as assertQualityIsExact,Ul as buffer,il as checkNever,Ll as cloneDeep,gt as cloneDeepWith,Nl as combine,Vl as debounce,xl as debounceFn,wl as detectEmbed,_n as fillWithDefault,ql as filter,Kl as filterChanged,kl as fromEvent,ht as getCurrentBrowser,ml as getExponentialDelay,Tl as getHighestQuality,bl as getIOSVersion,Dl as interval,$l as isHigher,El as isHigherOrEqual,pl as isIOS,yt as isInvariantQuality,pt as isLower,Sl as isLowerOrEqual,yl as isMacLike,gl as isMobile,wn as isNonNullable,$n as isNullable,Xl as loadVKLangPack,Fn as map,Wl as mapTo,Cl as merge,X as noop,dl as now,Gl as observableFrom,Ql as once,zl as pairwise,Ol as safeStorage,Hl as tap,Bl as throttle,jl as timeCodeToString,Fl as timeout,Il as videoHeightToQuality,Pl as videoQualityToHeight,Rl as videoSizeToQuality};
6
+ const cl="1.0.35-beta.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,F;const $e=`vk-videoplayer-dummy-key-${Math.random()}`,Y=()=>{if(F!==void 0)return F;try{localStorage.setItem($e,"test"),localStorage.removeItem($e),F=p.LOCAL_STORAGE}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem($e),F=p.SESSION_STORAGE}catch(r){if(r instanceof DOMException||r instanceof TypeError)F=p.RUNTIME;else throw r}else throw e}return F===p.RUNTIME&&(S=new Map),F},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,C=o;return n=o=void 0,c=h,i=e.apply(C,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,C=h-c,br=r-I;return f?Math.min(br,a-C):br}function hr(h){const I=h-u,C=h-c;return u===void 0||I>=r||I<0||f&&C>=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(),C=hr(I);if(n=h,o=this,u=I,C){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,Cl=(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 Fl 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=>{const t=window.setInterval(()=>r.next(),e);return()=>window.clearInterval(t)}),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 Cn={leading:!0,trailing:!1};function Yl(e,r=Cn){return t=>new O(n=>t.subscribe(new Fn(n,e,r)))}class Fn{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"})(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,Ct=!!Object.getOwnPropertySymbols&&!Ao(function(){var e=Symbol();return!xo(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Pr&&Pr<41}),Lo=Ct,Ft=Lo&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Mo=Lt,No=_,Co=Mt,Fo=Ft,Do=Object,Dt=Fo?function(e){return typeof e=="symbol"}:function(e){var r=Mo("Symbol");return No(r)&&Co(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=Ct,fa=Ft,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,Cr=Aa("keys"),lr=function(e){return Cr[e]||(Cr[e]=ja(e))},ur={},xa=fo,qt=P,La=W,Ma=ee,Ce=N,Fe=kt,Na=lr,Ca=ur,Fr="Object already initialized",Qe=qt.TypeError,Fa=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||Fe.state){var A=Fe.state||(Fe.state=new Fa);A.get=A.get,A.has=A.has,A.set=A.set,be=function(e,r){if(A.has(e))throw Qe(Fr);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");Ca[U]=!0,be=function(e,r){if(Ce(e,U))throw Qe(Fr);return r.facade=e,Ma(e,U,r),r},J=function(e){return Ce(e,U)?e[U]:{}},ye=function(e){return Ce(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,Ci=Ai,Fi=tn,Vr=function(e){return function(r,t,n){var o=Ni(r),a=Fi(o),i=Ci(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)+"]"},Cs=vr,Fs=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)||Fs(o,Xr,{configurable:!0,value:r}),n&&!Cs&&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,Cc=gn,it=Pc,Fc=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=Cc(e),!l)throw Fc(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,Fl 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,Cl 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};
package/es2018.cjs.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
- * @vkontakte/videoplayer-shared v1.0.34
3
- * Fri, 26 Apr 2024 14:08:06 GMT
4
- * https://st.mycdn.me/static/vkontakte-videoplayer/1-0-34/doc/
2
+ * @vkontakte/videoplayer-shared v1.0.35-beta.0
3
+ * Tue, 07 May 2024 23:30:33 GMT
4
+ * https://st.mycdn.me/static/vkontakte-videoplayer/1-0-35/doc/
5
5
  */
6
- "use strict";const gn="1.0.34";class z{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`)},mn=e=>{},B=()=>{};class w{constructor(r){r&&(this._subscribe=r)}subscribe(r,t){var n;let o;t?typeof t=="function"?o={next:t,error:B}:o={next:s=>t.next(s),error:s=>{var c;return(c=t.error)===null||c===void 0?void 0:c.call(t,s)}}:o={next:B,error:B};const a=typeof r=="function"?{next:s=>{try{r(s)}catch(c){o.next(c)}},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 z().add(()=>{switch(a.next=B,a.error=B,typeof i){case"function":i();return;case"object":i.unsubscribe();return;case"undefined":return;default:return M(i)}})}pipe(...r){return r.reduce((t,n)=>n(t),this)}_subscribe(r){}}class Xe extends w{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 z().add(()=>this.subscribers.delete(t))}}class wn{constructor(){this.log$=new Xe,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 On(e,r='Assertion "value is not nullable" failed'){if(e==null)throw new Error(r)}function En(e,r='Assertion "value is nullable" failed'){if(e!=null)throw new Error(r)}function ft(e){return typeof e!="undefined"&&e!==null}function vt(e){return e==null}function $n(e,r){if(!(e!=null&&e.length))throw new Error(r)}function Sn(e,r){if(e!=null&&e.length)throw new Error(r)}const Tn=(e,r,t)=>new Promise((n,o)=>{r.addEventListener("abort",()=>{s(),l.remove()});const a=()=>{s(),o()},i=()=>{s(),n()},s=()=>{c&&clearTimeout(c),l.removeEventListener("load",i),l.removeEventListener("error",a)};let c;t&&(c=window.setTimeout(a,t));const l=document.createElement("script");l.addEventListener("load",i),l.addEventListener("error",a),l.src=e,document.head.appendChild(l)});var ge;const In=typeof((ge=window.performance)===null||ge===void 0?void 0:ge.now)=="function"?()=>window.performance.now():()=>Date.now(),Pn=(e,r)=>async(...t)=>{var n;const o=r(...t);let a=e.aborted,i;for(;!a&&!e.aborted;)try{const s=await o.next(i);a=(n=s.done)!==null&&n!==void 0?n:!1,i=s.value}catch(s){await o.throw(s)}return i};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 Je=()=>{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,a=/webkit|safari|khtml/i.test(e)?exports.CurrentClientBrowser.Safari:void 0,i=/opr\//i.test(e)?exports.CurrentClientBrowser.Opera:void 0,s=/edg/i.test(e)?exports.CurrentClientBrowser.Edge:void 0,c=/android/i.test(e)?exports.CurrentClientDevice.Android:void 0,l=/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||i||s||t||n||a||exports.CurrentClientBrowser.Rest,device:c||l||u||v||d||f||exports.CurrentClientDevice.Desktop}},Rn=(e=!1)=>{const t=[exports.CurrentClientDevice.iPhone,exports.CurrentClientDevice.iPad,exports.CurrentClientDevice.iPod].includes(Je().device);if(!e)return t;const{userAgent:n,maxTouchPoints:o}=window.navigator;return!!(t||/macintosh/i.test(n)&&o>0)},_n=()=>{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},An=()=>[exports.CurrentClientDevice.Mac,exports.CurrentClientDevice.iPhone,exports.CurrentClientDevice.iPad,exports.CurrentClientDevice.iPod].includes(Je().device),Cn=()=>{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)},Ln=(e,{start:r=0,factor:t=2,max:n=1/0,min:o=r,random:a=0}={})=>{let i=r;return i*=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 E,x;const me=`vk-videoplayer-dummy-key-${Math.random()}`,Q=()=>{if(x!==void 0)return x;try{localStorage.setItem(me,"test"),localStorage.removeItem(me),x=p.LOCAL_STORAGE}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem(me),x=p.SESSION_STORAGE}catch(r){if(r instanceof DOMException||r instanceof TypeError)x=p.RUNTIME;else throw r}else throw e}return x===p.RUNTIME&&(E=new Map),x},jn=()=>Q()===p.LOCAL_STORAGE,xn=e=>{var r,t;const n=Q();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 E==null?void 0:E.get(e);default:M(n)}},Mn=(e,r)=>{const t=Q();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(E==null?void 0:E.set(e,r));default:M(t)}},Nn=e=>{var r;const t=Q();switch(t){case p.LOCAL_STORAGE:return e in localStorage;case p.SESSION_STORAGE:return e in sessionStorage;case p.RUNTIME:return(r=E==null?void 0:E.has(e))!==null&&r!==void 0?r:!1;default:return M(t),!1}},Dn=e=>{const r=Q();switch(r){case p.LOCAL_STORAGE:return localStorage.removeItem(e);case p.SESSION_STORAGE:return sessionStorage.removeItem(e);case p.RUNTIME:return void(E==null?void 0:E.delete(e));default:M(r)}},Fn=()=>{const e=Q();switch(e){case p.LOCAL_STORAGE:return localStorage.clear();case p.SESSION_STORAGE:return sessionStorage.clear();case p.RUNTIME:return E==null?void 0:E.clear();default:M(e)}};var Gn=Object.freeze({__proto__:null,clear:Fn,get:xn,has:Nn,isPersistent:jn,remove:Dn,set:Mn});const Vn=()=>{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 $={[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}},kn=(e,r)=>$[e].height>$[r].height,Bn=(e,r)=>$[e].height>=$[r].height,Ze=(e,r)=>$[e].height<$[r].height,Un=(e,r)=>$[e].height<=$[r].height,Qn=e=>e.sort((r,t)=>r===t?0:r===exports.VideoQuality.INVARIANT?1:t===exports.VideoQuality.INVARIANT?-1:Ze(r,t)?1:-1)[0],dt=Object.keys($).sort((e,r)=>Ze(e,r)?-1:1),qn=(e,r=.02)=>[...dt].find(n=>$[n].height*(1+r)>=e),Kn=({width:e,height:r})=>{const t=Math.min(e,r),n=Math.max(e,r);return dt.find(o=>{const a=$[o];return a.width>=n&&a.height>=t})},Yn=e=>$[e].height,er=e=>e===exports.VideoQuality.INVARIANT,Wn=e=>e.every(r=>!er(r));function Hn(e){if(er(e))throw new Error("Expected exact quality")}const ht=(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]=ht(a,o):t[n]=n in e?a:o}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 Xn(e,r=0,t){let n,o,a,i,s,c,l=0,u=!1,v=!1,f=!0;const d=!r&&r!==0&&typeof window.requestAnimationFrame=="function";t&&(u=!!t.leading,v="maxWait"in t,a=t!=null&&t.maxWait?Math.max(+(t==null?void 0:t.maxWait)||0,r):a,f="trailing"in t?!!t.trailing:f);function b(h){const S=n,j=o;return n=o=void 0,l=h,i=e.apply(j,S),i}function y(h,S){return d?(s&&window.cancelAnimationFrame(s),window.requestAnimationFrame(h)):setTimeout(h,S)}function O(h){if(d){window.cancelAnimationFrame(h);return}clearTimeout(h)}function g(h){return l=h,s=y(ee,r),u?b(h):i}function m(h){const S=h-c,j=h-l,yr=r-S;return v?Math.min(yr,a-j):yr}function pr(h){const S=h-c,j=h-l;return c===void 0||S>=r||S<0||v&&j>=a}function ee(){const h=Date.now();if(pr(h))return br(h);s=y(ee,m(h))}function br(h){return s=void 0,f&&n?b(h):(n=o=void 0,i)}function pn(){s!==void 0&&O(s),l=0,n=c=o=s=void 0}function bn(){return s===void 0?i:br(Date.now())}function yn(){return s!==void 0}function re(...h){const S=Date.now(),j=pr(S);if(n=h,o=this,c=S,j){if(s===void 0)return g(c);if(v)return s=y(ee,r),b(c)}return s===void 0&&(s=y(ee,r)),i}return re.cancel=pn,re.flush=bn,re.pending=yn,re}const rr=(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]=rr(e[n],r):t[n]=e[n]}return t},Jn=e=>rr(e);class Zn extends Xe{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 eo(e){return new w(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 z)})}function ro(...e){return new w(r=>e.reduce((t,n)=>t.add(n.subscribe(r)),new z))}var to=e=>new w(r=>{const t=window.setTimeout(()=>{try{r.next()}catch(n){if(r.error)r.error(n);else throw n}},e);return()=>window.clearTimeout(t)}),no=e=>new w(r=>{const t=window.setInterval(()=>r.next(),e);return()=>window.clearInterval(t)}),oo=e=>new w(r=>{e.forEach(t=>r.next(t))}),ao=(e,r)=>new w(t=>{const n=o=>t.next(o);return e.addEventListener(r,n),()=>e.removeEventListener(r,n)});function io(e){return r=>new w(t=>r.subscribe(new so(t,e)))}class so{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 lo={leading:!1,trailing:!0};function co(e,r=lo){return t=>new w(n=>t.subscribe(new uo(n,e,r)))}class uo{constructor(r,t,n){this.destination=r,this.time=t,this.config=n}next(r){this.lastValue=r,ft(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 fo={leading:!0,trailing:!1};function vo(e,r=fo){return t=>new w(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,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 po(e){return r=>new w(t=>r.subscribe(new bo(t,e)))}class bo{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 yo(e=(r,t)=>r===t){return r=>new w(t=>r.subscribe(new go(t,e)))}const gr={};class go{constructor(r,t){this.destination=r,this.predicate=t,this.lastValue=gr}next(r){let t;try{t=this.lastValue===gr||!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 pt(e){return r=>new w(t=>r.subscribe(new mo(t,e)))}let mo=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 wo(e){return pt(()=>e)}function Oo(){return e=>new w(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 Eo(){return e=>new w(r=>e.subscribe(new $o(r)))}class $o{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 So(e){return r=>new w(t=>r.subscribe(new To(t,e)))}class To{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"})(exports.ErrorCategory||(exports.ErrorCategory={}));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 bt 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 Io{constructor(){Object.defineProperty(this,"signal",{value:new bt,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&&(Io.prototype[Symbol.toStringTag]="AbortController",bt.prototype[Symbol.toStringTag]="AbortSignal");function yt(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 Po(e){typeof e=="function"&&(e={fetch:e});const{fetch:r,Request:t=r.Request,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o=!1}=e;if(!yt({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(l,u){let v;u&&u.signal&&(v=u.signal,delete u.signal);const f=new t(l,u);return v&&Object.defineProperty(f,"signal",{writable:!1,enumerable:!1,configurable:!0,value:v}),f},a.prototype=t.prototype);const i=r;return{fetch:(c,l)=>{const u=a&&a.prototype.isPrototypeOf(c)?c.signal:l?l.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,b)=>{u.addEventListener("abort",()=>b(v),{once:!0})});return l&&l.signal&&delete l.signal,Promise.race([f,i(c,l)])}return i(c,l)},Request:a}}const tr=yt({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),gt=tr?Po({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,Ro=tr?gt.fetch:window.fetch;tr?gt.Request:window.Request;var we=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function _o(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}},Ao=A,be=!Ao(function(){var e=function(){}.bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),mt=be,wt=Function.prototype,Be=wt.call,Co=mt&&wt.bind.bind(Be,Be),N=mt?Co:function(e){return function(){return Be.apply(e,arguments)}},Ot=N,Lo=Ot({}.toString),jo=Ot("".slice),nr=function(e){return jo(Lo(e),8,-1)},xo=N,Mo=A,No=nr,Oe=Object,Do=xo("".split),Fo=Mo(function(){return!Oe("z").propertyIsEnumerable(0)})?function(e){return No(e)=="String"?Do(e,""):Oe(e)}:Oe,or=function(e){return e==null},Go=or,Vo=TypeError,Et=function(e){if(Go(e))throw Vo("Can't call method on "+e);return e},ko=Fo,Bo=Et,X=function(e){return ko(Bo(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 we=="object"&&we)||function(){return this}()||we||Function("return this")(),Ue=typeof document=="object"&&document.all,Uo=typeof Ue=="undefined"&&Ue!==void 0,$t={all:Ue,IS_HTMLDDA:Uo},St=$t,Qo=St.all,P=St.IS_HTMLDDA?function(e){return typeof e=="function"||e===Qo}:function(e){return typeof e=="function"},qo=I,Ko=P,wr=qo.WeakMap,Yo=Ko(wr)&&/native code/.test(String(wr)),Or=P,Tt=$t,Wo=Tt.all,K=Tt.IS_HTMLDDA?function(e){return typeof e=="object"?e!==null:Or(e)||e===Wo}:function(e){return typeof e=="object"?e!==null:Or(e)},Ho=A,D=!Ho(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),Y={},zo=I,Er=K,Qe=zo.document,Xo=Er(Qe)&&Er(Qe.createElement),It=function(e){return Xo?Qe.createElement(e):{}},Jo=D,Zo=A,ea=It,Pt=!Jo&&!Zo(function(){return Object.defineProperty(ea("div"),"a",{get:function(){return 7}}).a!=7}),ra=D,ta=A,Rt=ra&&ta(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42}),na=K,oa=String,aa=TypeError,W=function(e){if(na(e))return e;throw aa(oa(e)+" is not an object")},ia=be,ne=Function.prototype.call,F=ia?ne.bind(ne):function(){return ne.apply(ne,arguments)},ar={},Ee=ar,$e=I,sa=P,$r=function(e){return sa(e)?e:void 0},_t=function(e,r){return arguments.length<2?$r(Ee[e])||$r($e[e]):Ee[e]&&Ee[e][r]||$e[e]&&$e[e][r]},la=N,At=la({}.isPrototypeOf),ca=typeof navigator!="undefined"&&String(navigator.userAgent)||"",Ct=I,Se=ca,Sr=Ct.process,Tr=Ct.Deno,Ir=Sr&&Sr.versions||Tr&&Tr.version,Pr=Ir&&Ir.v8,T,de;Pr&&(T=Pr.split("."),de=T[0]>0&&T[0]<4?1:+(T[0]+T[1]));!de&&Se&&(T=Se.match(/Edge\/(\d+)/),(!T||T[1]>=74)&&(T=Se.match(/Chrome\/(\d+)/),T&&(de=+T[1])));var ua=de,Rr=ua,fa=A,va=I,da=va.String,Lt=!!Object.getOwnPropertySymbols&&!fa(function(){var e=Symbol();return!da(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Rr&&Rr<41}),ha=Lt,jt=ha&&!Symbol.sham&&typeof Symbol.iterator=="symbol",pa=_t,ba=P,ya=At,ga=jt,ma=Object,xt=ga?function(e){return typeof e=="symbol"}:function(e){var r=pa("Symbol");return ba(r)&&ya(r.prototype,ma(e))},wa=String,ir=function(e){try{return wa(e)}catch(r){return"Object"}},Oa=P,Ea=ir,$a=TypeError,sr=function(e){if(Oa(e))return e;throw $a(Ea(e)+" is not a function")},Sa=sr,Ta=or,lr=function(e,r){var t=e[r];return Ta(t)?void 0:Sa(t)},Te=F,Ie=P,Pe=K,Ia=TypeError,Pa=function(e,r){var t,n;if(r==="string"&&Ie(t=e.toString)&&!Pe(n=Te(t,e))||Ie(t=e.valueOf)&&!Pe(n=Te(t,e))||r!=="string"&&Ie(t=e.toString)&&!Pe(n=Te(t,e)))return n;throw Ia("Can't convert object to primitive value")},Mt={exports:{}},_r=I,Ra=Object.defineProperty,_a=function(e,r){try{Ra(_r,e,{value:r,configurable:!0,writable:!0})}catch(t){_r[e]=r}return r},Aa=I,Ca=_a,Ar="__core-js_shared__",La=Aa[Ar]||Ca(Ar,{}),Nt=La,Cr=Nt;(Mt.exports=function(e,r){return Cr[e]||(Cr[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 Dt=Mt.exports,ja=Et,xa=Object,Ft=function(e){return xa(ja(e))},Ma=N,Na=Ft,Da=Ma({}.hasOwnProperty),L=Object.hasOwn||function(r,t){return Da(Na(r),t)},Fa=N,Ga=0,Va=Math.random(),ka=Fa(1 .toString),Gt=function(e){return"Symbol("+(e===void 0?"":e)+")_"+ka(++Ga+Va,36)},Ba=I,Ua=Dt,Lr=L,Qa=Gt,qa=Lt,Ka=jt,U=Ba.Symbol,Re=Ua("wks"),Ya=Ka?U.for||U:U&&U.withoutSetter||Qa,C=function(e){return Lr(Re,e)||(Re[e]=qa&&Lr(U,e)?U[e]:Ya("Symbol."+e)),Re[e]},Wa=F,jr=K,xr=xt,Ha=lr,za=Pa,Xa=C,Ja=TypeError,Za=Xa("toPrimitive"),ei=function(e,r){if(!jr(e)||xr(e))return e;var t=Ha(e,Za),n;if(t){if(r===void 0&&(r="default"),n=Wa(t,e,r),!jr(n)||xr(n))return n;throw Ja("Can't convert object to primitive value")}return r===void 0&&(r="number"),za(e,r)},ri=ei,ti=xt,cr=function(e){var r=ri(e,"string");return ti(r)?r:r+""},ni=D,oi=Pt,ai=Rt,oe=W,Mr=cr,ii=TypeError,_e=Object.defineProperty,si=Object.getOwnPropertyDescriptor,Ae="enumerable",Ce="configurable",Le="writable";Y.f=ni?ai?function(r,t,n){if(oe(r),t=Mr(t),oe(n),typeof r=="function"&&t==="prototype"&&"value"in n&&Le in n&&!n[Le]){var o=si(r,t);o&&o[Le]&&(r[t]=n.value,n={configurable:Ce in n?n[Ce]:o[Ce],enumerable:Ae in n?n[Ae]:o[Ae],writable:!1})}return _e(r,t,n)}:_e:function(r,t,n){if(oe(r),t=Mr(t),oe(n),oi)try{return _e(r,t,n)}catch(o){}if("get"in n||"set"in n)throw ii("Accessors not supported");return"value"in n&&(r[t]=n.value),r};var ye=function(e,r){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:r}},li=D,ci=Y,ui=ye,J=li?function(e,r,t){return ci.f(e,r,ui(1,t))}:function(e,r,t){return e[r]=t,e},fi=Dt,vi=Gt,Nr=fi("keys"),ur=function(e){return Nr[e]||(Nr[e]=vi(e))},fr={},di=Yo,Vt=I,hi=K,pi=J,je=L,xe=Nt,bi=ur,yi=fr,Dr="Object already initialized",qe=Vt.TypeError,gi=Vt.WeakMap,he,H,pe,mi=function(e){return pe(e)?H(e):he(e,{})},wi=function(e){return function(r){var t;if(!hi(r)||(t=H(r)).type!==e)throw qe("Incompatible receiver, "+e+" required");return t}};if(di||xe.state){var R=xe.state||(xe.state=new gi);R.get=R.get,R.has=R.has,R.set=R.set,he=function(e,r){if(R.has(e))throw qe(Dr);return r.facade=e,R.set(e,r),r},H=function(e){return R.get(e)||{}},pe=function(e){return R.has(e)}}else{var G=bi("state");yi[G]=!0,he=function(e,r){if(je(e,G))throw qe(Dr);return r.facade=e,pi(e,G,r),r},H=function(e){return je(e,G)?e[G]:{}},pe=function(e){return je(e,G)}}var Oi={set:he,get:H,has:pe,enforce:mi,getterFor:wi},Ei=be,kt=Function.prototype,Fr=kt.apply,Gr=kt.call,$i=typeof Reflect=="object"&&Reflect.apply||(Ei?Gr.bind(Fr):function(){return Gr.apply(Fr,arguments)}),Si=nr,Ti=N,Bt=function(e){if(Si(e)==="Function")return Ti(e)},Ut={},Qt={},qt={}.propertyIsEnumerable,Kt=Object.getOwnPropertyDescriptor,Ii=Kt&&!qt.call({1:2},1);Qt.f=Ii?function(r){var t=Kt(this,r);return!!t&&t.enumerable}:qt;var Pi=D,Ri=F,_i=Qt,Ai=ye,Ci=X,Li=cr,ji=L,xi=Pt,Vr=Object.getOwnPropertyDescriptor;Ut.f=Pi?Vr:function(r,t){if(r=Ci(r),t=Li(t),xi)try{return Vr(r,t)}catch(n){}if(ji(r,t))return Ai(!Ri(_i.f,r,t),r[t])};var Mi=A,Ni=P,Di=/#|\.prototype\./,Z=function(e,r){var t=Gi[Fi(e)];return t==ki?!0:t==Vi?!1:Ni(r)?Mi(r):!!r},Fi=Z.normalize=function(e){return String(e).replace(Di,".").toLowerCase()},Gi=Z.data={},Vi=Z.NATIVE="N",ki=Z.POLYFILL="P",Bi=Z,kr=Bt,Ui=sr,Qi=be,qi=kr(kr.bind),Yt=function(e,r){return Ui(e),r===void 0?e:Qi?qi(e,r):function(){return e.apply(r,arguments)}},ae=I,Ki=$i,Yi=Bt,Wi=P,Hi=Ut.f,zi=Bi,V=ar,Xi=Yt,k=J,Br=L,Ji=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 Ki(e,this,arguments)};return r.prototype=e.prototype,r},Wt=function(e,r){var t=e.target,n=e.global,o=e.stat,a=e.proto,i=n?ae:o?ae[t]:(ae[t]||{}).prototype,s=n?V:V[t]||k(V,t,{})[t],c=s.prototype,l,u,v,f,d,b,y,O,g;for(f in r)l=zi(n?f:t+(o?".":"#")+f,e.forced),u=!l&&i&&Br(i,f),b=s[f],u&&(e.dontCallGetSet?(g=Hi(i,f),y=g&&g.value):y=i[f]),d=u&&y?y:r[f],!(u&&typeof b==typeof d)&&(e.bind&&u?O=Xi(d,ae):e.wrap&&u?O=Ji(d):a&&Wi(d)?O=Yi(d):O=d,(e.sham||d&&d.sham||b&&b.sham)&&k(O,"sham",!0),k(s,f,O),a&&(v=t+"Prototype",Br(V,v)||k(V,v,{}),k(V[v],f,d),e.real&&c&&(l||!c[f])&&k(c,f,d)))},Ke=D,Zi=L,Ht=Function.prototype,es=Ke&&Object.getOwnPropertyDescriptor,vr=Zi(Ht,"name"),rs=vr&&function(){}.name==="something",ts=vr&&(!Ke||Ke&&es(Ht,"name").configurable),ns={EXISTS:vr,PROPER:rs,CONFIGURABLE:ts},zt={},os=Math.ceil,as=Math.floor,is=Math.trunc||function(r){var t=+r;return(t>0?as:os)(t)},ss=is,Xt=function(e){var r=+e;return r!==r||r===0?0:ss(r)},ls=Xt,cs=Math.max,us=Math.min,fs=function(e,r){var t=ls(e);return t<0?cs(t+r,0):us(t,r)},vs=Xt,ds=Math.min,hs=function(e){return e>0?ds(vs(e),9007199254740991):0},ps=hs,Jt=function(e){return ps(e.length)},bs=X,ys=fs,gs=Jt,Ur=function(e){return function(r,t,n){var o=bs(r),a=gs(o),i=ys(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}},ms={includes:Ur(!0),indexOf:Ur(!1)},ws=N,Me=L,Os=X,Es=ms.indexOf,$s=fr,Qr=ws([].push),Ss=function(e,r){var t=Os(e),n=0,o=[],a;for(a in t)!Me($s,a)&&Me(t,a)&&Qr(o,a);for(;r.length>n;)Me(t,a=r[n++])&&(~Es(o,a)||Qr(o,a));return o},Zt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Ts=Ss,Is=Zt,Ps=Object.keys||function(r){return Ts(r,Is)},Rs=D,_s=Rt,As=Y,Cs=W,Ls=X,js=Ps;zt.f=Rs&&!_s?Object.defineProperties:function(r,t){Cs(r);for(var n=Ls(t),o=js(t),a=o.length,i=0,s;a>i;)As.f(r,s=o[i++],n[s]);return r};var xs=_t,Ms=xs("document","documentElement"),Ns=W,Ds=zt,qr=Zt,Fs=fr,Gs=Ms,Vs=It,ks=ur,Kr=">",Yr="<",Ye="prototype",We="script",en=ks("IE_PROTO"),Ne=function(){},rn=function(e){return Yr+We+Kr+e+Yr+"/"+We+Kr},Wr=function(e){e.write(rn("")),e.close();var r=e.parentWindow.Object;return e=null,r},Bs=function(){var e=Vs("iframe"),r="java"+We+":",t;return e.style.display="none",Gs.appendChild(e),e.src=String(r),t=e.contentWindow.document,t.open(),t.write(rn("document.F=Object")),t.close(),t.F},ie,ue=function(){try{ie=new ActiveXObject("htmlfile")}catch(r){}ue=typeof document!="undefined"?document.domain&&ie?Wr(ie):Bs():Wr(ie);for(var e=qr.length;e--;)delete ue[Ye][qr[e]];return ue()};Fs[en]=!0;var tn=Object.create||function(r,t){var n;return r!==null?(Ne[Ye]=Ns(r),n=new Ne,Ne[Ye]=null,n[en]=r):n=ue(),t===void 0?n:Ds.f(n,t)},Us=A,Qs=!Us(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),qs=L,Ks=P,Ys=Ft,Ws=ur,Hs=Qs,Hr=Ws("IE_PROTO"),He=Object,zs=He.prototype,nn=Hs?He.getPrototypeOf:function(e){var r=Ys(e);if(qs(r,Hr))return r[Hr];var t=r.constructor;return Ks(t)&&r instanceof t?t.prototype:r instanceof He?zs:null},Xs=J,on=function(e,r,t,n){return n&&n.enumerable?e[r]=t:Xs(e,r,t),e},Js=A,Zs=P,el=K,rl=tn,zr=nn,tl=on,nl=C,ze=nl("iterator"),an=!1,_,De,Fe;[].keys&&(Fe=[].keys(),"next"in Fe?(De=zr(zr(Fe)),De!==Object.prototype&&(_=De)):an=!0);var ol=!el(_)||Js(function(){var e={};return _[ze].call(e)!==e});ol?_={}:_=rl(_);Zs(_[ze])||tl(_,ze,function(){return this});var sn={IteratorPrototype:_,BUGGY_SAFARI_ITERATORS:an},al=C,il=al("toStringTag"),ln={};ln[il]="z";var dr=String(ln)==="[object z]",sl=dr,ll=P,fe=nr,cl=C,ul=cl("toStringTag"),fl=Object,vl=fe(function(){return arguments}())=="Arguments",dl=function(e,r){try{return e[r]}catch(t){}},hr=sl?fe:function(e){var r,t,n;return e===void 0?"Undefined":e===null?"Null":typeof(t=dl(r=fl(e),ul))=="string"?t:vl?fe(r):(n=fe(r))=="Object"&&ll(r.callee)?"Arguments":n},hl=dr,pl=hr,bl=hl?{}.toString:function(){return"[object "+pl(this)+"]"},yl=dr,gl=Y.f,ml=J,wl=L,Ol=bl,El=C,Xr=El("toStringTag"),cn=function(e,r,t,n){if(e){var o=t?e:e.prototype;wl(o,Xr)||gl(o,Xr,{configurable:!0,value:r}),n&&!yl&&ml(o,"toString",Ol)}},$l=sn.IteratorPrototype,Sl=tn,Tl=ye,Il=cn,Pl=q,Rl=function(){return this},_l=function(e,r,t,n){var o=r+" Iterator";return e.prototype=Sl($l,{next:Tl(+!n,t)}),Il(e,o,!1,!0),Pl[o]=Rl,e},Al=Wt,Cl=F,un=ns,Ll=_l,jl=nn,xl=cn,Jr=on,Ml=C,Zr=q,fn=sn,Nl=un.PROPER;un.CONFIGURABLE;fn.IteratorPrototype;var se=fn.BUGGY_SAFARI_ITERATORS,Ge=Ml("iterator"),et="keys",le="values",rt="entries",Dl=function(){return this},Fl=function(e,r,t,n,o,a,i){Ll(t,r,n);var s=function(g){if(g===o&&f)return f;if(!se&&g in u)return u[g];switch(g){case et:return function(){return new t(this,g)};case le:return function(){return new t(this,g)};case rt:return function(){return new t(this,g)}}return function(){return new t(this)}},c=r+" Iterator",l=!1,u=e.prototype,v=u[Ge]||u["@@iterator"]||o&&u[o],f=!se&&v||s(o),d=r=="Array"&&u.entries||v,b,y,O;if(d&&(b=jl(d.call(new e)),b!==Object.prototype&&b.next&&(xl(b,c,!0,!0),Zr[c]=Dl)),Nl&&o==le&&v&&v.name!==le&&(l=!0,f=function(){return Cl(v,this)}),o)if(y={values:s(le),keys:a?f:s(et),entries:s(rt)},i)for(O in y)(se||l||!(O in u))&&Jr(u,O,y[O]);else Al({target:r,proto:!0,forced:se||l},y);return i&&u[Ge]!==f&&Jr(u,Ge,f,{name:o}),Zr[r]=f,y},Gl=function(e,r){return{value:e,done:r}},Vl=X,tt=q,vn=Oi;Y.f;var kl=Fl,ce=Gl,dn="Array Iterator",Bl=vn.set,Ul=vn.getterFor(dn);kl(Array,"Array",function(e,r){Bl(this,{type:dn,target:Vl(e),index:0,kind:r})},function(){var e=Ul(this),r=e.target,t=e.kind,n=e.index++;return!r||n>=r.length?(e.target=void 0,ce(void 0,!0)):t=="keys"?ce(n,!1):t=="values"?ce(r[n],!1):ce([n,r[n]],!1)},"values");tt.Arguments=tt.Array;var Ql=C,ql=q,Kl=Ql("iterator"),Yl=Array.prototype,Wl=function(e){return e!==void 0&&(ql.Array===e||Yl[Kl]===e)},Hl=hr,nt=lr,zl=or,Xl=q,Jl=C,Zl=Jl("iterator"),hn=function(e){if(!zl(e))return nt(e,Zl)||nt(e,"@@iterator")||Xl[Hl(e)]},ec=F,rc=sr,tc=W,nc=ir,oc=hn,ac=TypeError,ic=function(e,r){var t=arguments.length<2?oc(e):r;if(rc(t))return tc(ec(t,e));throw ac(nc(e)+" is not iterable")},sc=F,ot=W,lc=lr,cc=function(e,r,t){var n,o;ot(e);try{if(n=lc(e,"return"),!n){if(r==="throw")throw t;return t}n=sc(n,e)}catch(a){o=!0,n=a}if(r==="throw")throw t;if(o)throw n;return ot(n),t},uc=Yt,fc=F,vc=W,dc=ir,hc=Wl,pc=Jt,at=At,bc=ic,yc=hn,it=cc,gc=TypeError,ve=function(e,r){this.stopped=e,this.result=r},st=ve.prototype,mc=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),c=uc(r,n),l,u,v,f,d,b,y,O=function(m){return l&&it(l,"normal",m),new ve(!0,m)},g=function(m){return o?(vc(m),s?c(m[0],m[1],O):c(m[0],m[1])):s?c(m,O):c(m)};if(a)l=e.iterator;else if(i)l=e;else{if(u=yc(e),!u)throw gc(dc(e)+" is not iterable");if(hc(u)){for(v=0,f=pc(e);f>v;v++)if(d=g(e[v]),d&&at(st,d))return d;return new ve(!1)}l=bc(e,u)}for(b=a?e.next:l.next;!(y=fc(b,l)).done;){try{d=g(y.value)}catch(m){it(l,"throw",m)}if(typeof d=="object"&&d&&at(st,d))return d}return new ve(!1)},wc=cr,Oc=Y,Ec=ye,$c=function(e,r,t){var n=wc(r);n in e?Oc.f(e,n,Ec(0,t)):e[n]=t},Sc=Wt,Tc=mc,Ic=$c;Sc({target:"Object",stat:!0},{fromEntries:function(r){var t={};return Tc(r,function(n,o){Ic(t,n,o)},{AS_ENTRIES:!0}),t}});var Pc=ar,Rc=Pc.Object.fromEntries,_c={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},Ac=_c,Cc=I,Lc=hr,jc=J,lt=q,xc=C,ct=xc("toStringTag");for(var Ve in Ac){var ut=Cc[Ve],ke=ut&&ut.prototype;ke&&Lc(ke)!==ct&&jc(ke,ct,Ve),lt[Ve]=lt.Array}var Mc=Rc,Nc=Mc,Dc=Nc,Fc=Dc,Gc=_o(Fc);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 Vc="vk.com",kc=async(e,r,t)=>{const n=new URL(`https://${Vc}/js/lang-pack.js`);n.searchParams.set("format","json"),n.searchParams.set("name",r),e!==void 0&&n.searchParams.set("lang",e);const a=await(await Ro(n.toString())).json();return Bc(a,t)},Bc=(e,r)=>Gc(Object.entries(e.keys).map(([t,n])=>[t.substring(`${r}_`.length),Uc(n)])),Uc=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=wn;exports.Observable=w;exports.Subject=Xe;exports.Subscription=z;exports.VERSION=gn;exports.ValueSubject=Zn;exports.abortable=Pn;exports.addScript=Tn;exports.areQualitiesExact=Wn;exports.assertEmptyArray=Sn;exports.assertNever=M;exports.assertNonNullable=On;exports.assertNotEmptyArray=$n;exports.assertNullable=En;exports.assertQualityIsExact=Hn;exports.buffer=io;exports.checkNever=mn;exports.cloneDeep=Jn;exports.cloneDeepWith=rr;exports.combine=eo;exports.debounce=co;exports.debounceFn=Xn;exports.detectEmbed=Vn;exports.fillWithDefault=ht;exports.filter=po;exports.filterChanged=yo;exports.fromEvent=ao;exports.getCurrentBrowser=Je;exports.getExponentialDelay=Ln;exports.getHighestQuality=Qn;exports.getIOSVersion=_n;exports.interval=no;exports.isHigher=kn;exports.isHigherOrEqual=Bn;exports.isIOS=Rn;exports.isInvariantQuality=er;exports.isLower=Ze;exports.isLowerOrEqual=Un;exports.isMacLike=An;exports.isMobile=Cn;exports.isNonNullable=ft;exports.isNullable=vt;exports.loadVKLangPack=kc;exports.map=pt;exports.mapTo=wo;exports.merge=ro;exports.noop=B;exports.now=In;exports.observableFrom=oo;exports.once=Oo;exports.pairwise=Eo;exports.safeStorage=Gn;exports.tap=So;exports.throttle=vo;exports.timeCodeToString=zn;exports.timeout=to;exports.videoHeightToQuality=qn;exports.videoQualityToHeight=Yn;exports.videoSizeToQuality=Kn;
6
+ "use strict";const wn="1.0.35-beta.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=>{const t=window.setInterval(()=>r.next(),e);return()=>window.clearInterval(t)}),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"})(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;
package/es2018.esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
- * @vkontakte/videoplayer-shared v1.0.34
3
- * Fri, 26 Apr 2024 14:08:06 GMT
4
- * https://st.mycdn.me/static/vkontakte-videoplayer/1-0-34/doc/
2
+ * @vkontakte/videoplayer-shared v1.0.35-beta.0
3
+ * Tue, 07 May 2024 23:30:33 GMT
4
+ * https://st.mycdn.me/static/vkontakte-videoplayer/1-0-35/doc/
5
5
  */
6
- const ol="1.0.34";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`)},al=e=>{},X=()=>{};class E{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 l;return(l=t.error)===null||l===void 0?void 0:l.call(t,s)}}:o={next:X,error:X};const a=typeof r=="function"?{next:s=>{try{r(s)}catch(l){o.next(l)}},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 vt extends E{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 il{constructor(){this.log$=new vt,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 sl(e,r='Assertion "value is not nullable" failed'){if(e==null)throw new Error(r)}function cl(e,r='Assertion "value is nullable" failed'){if(e!=null)throw new Error(r)}function On(e){return typeof e!="undefined"&&e!==null}function wn(e){return e==null}function ll(e,r){if(!(e!=null&&e.length))throw new Error(r)}function ul(e,r){if(e!=null&&e.length)throw new Error(r)}const fl=(e,r,t)=>new Promise((n,o)=>{r.addEventListener("abort",()=>{s(),c.remove()});const a=()=>{s(),o()},i=()=>{s(),n()},s=()=>{l&&clearTimeout(l),c.removeEventListener("load",i),c.removeEventListener("error",a)};let l;t&&(l=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 vl=typeof((we=window.performance)===null||we===void 0?void 0:we.now)=="function"?()=>window.performance.now():()=>Date.now(),dl=(e,r)=>async(...t)=>{var n;const o=r(...t);let a=e.aborted,i;for(;!a&&!e.aborted;)try{const s=await o.next(i);a=(n=s.done)!==null&&n!==void 0?n:!1,i=s.value}catch(s){await 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 w;(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"})(w||(w={}));const dt=()=>{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,l=/android/i.test(e)?w.Android:void 0,c=/iphone/i.test(e)?w.iPhone:void 0,u=/ipad/i.test(e)?w.iPad:void 0,v=/ipod/i.test(e)?w.iPod:void 0,f=/mac/i.test(e)?w.Mac:void 0,d=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(e)?w.RestMobile:void 0;return{browser:r||o||i||s||t||n||a||j.Rest,device:l||c||u||v||d||f||w.Desktop}},hl=(e=!1)=>{const t=[w.iPhone,w.iPad,w.iPod].includes(dt().device);if(!e)return t;const{userAgent:n,maxTouchPoints:o}=window.navigator;return!!(t||/macintosh/i.test(n)&&o>0)},pl=()=>{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},bl=()=>[w.Mac,w.iPhone,w.iPad,w.iPod].includes(dt().device),yl=()=>{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)},gl=(e,{start:r=0,factor:t=2,max:n=1/0,min:o=r,random:a=0}={})=>{let i=r;return i*=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 $,F;const $e=`vk-videoplayer-dummy-key-${Math.random()}`,Y=()=>{if(F!==void 0)return F;try{localStorage.setItem($e,"test"),localStorage.removeItem($e),F=p.LOCAL_STORAGE}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem($e),F=p.SESSION_STORAGE}catch(r){if(r instanceof DOMException||r instanceof TypeError)F=p.RUNTIME;else throw r}else throw e}return F===p.RUNTIME&&($=new Map),F},$n=()=>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 $==null?void 0:$.get(e);default:K(n)}},Sn=(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($==null?void 0:$.set(e,r));default:K(t)}},Tn=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=$==null?void 0:$.has(e))!==null&&r!==void 0?r:!1;default:return K(t),!1}},In=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($==null?void 0:$.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 $==null?void 0:$.clear();default:K(e)}};var ml=Object.freeze({__proto__:null,clear:Pn,get:En,has:Tn,isPersistent:$n,remove:In,set:Sn});const Ol=()=>{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 S;(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"})(S||(S={}));const T={[S.Q_144P]:{width:256,height:144},[S.Q_240P]:{width:428,height:240},[S.Q_360P]:{width:640,height:360},[S.Q_480P]:{width:856,height:480},[S.Q_720P]:{width:1280,height:720},[S.Q_1080P]:{width:1920,height:1080},[S.Q_1440P]:{width:2560,height:1440},[S.Q_2160P]:{width:3840,height:2160},[S.Q_4320P]:{width:7680,height:4320}},wl=(e,r)=>T[e].height>T[r].height,$l=(e,r)=>T[e].height>=T[r].height,ht=(e,r)=>T[e].height<T[r].height,El=(e,r)=>T[e].height<=T[r].height,Sl=e=>e.sort((r,t)=>r===t?0:r===S.INVARIANT?1:t===S.INVARIANT?-1:ht(r,t)?1:-1)[0],pt=Object.keys(T).sort((e,r)=>ht(e,r)?-1:1),Tl=(e,r=.02)=>[...pt].find(n=>T[n].height*(1+r)>=e),Il=({width:e,height:r})=>{const t=Math.min(e,r),n=Math.max(e,r);return pt.find(o=>{const a=T[o];return a.width>=n&&a.height>=t})},Pl=e=>T[e].height,bt=e=>e===S.INVARIANT,Rl=e=>e.every(r=>!bt(r));function _l(e){if(bt(e))throw new Error("Expected exact quality")}const Rn=(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]=Rn(a,o):t[n]=n in e?a:o}return t},Al=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 jl(e,r=0,t){let n,o,a,i,s,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,a=t!=null&&t.maxWait?Math.max(+(t==null?void 0:t.maxWait)||0,r):a,f="trailing"in t?!!t.trailing:f);function b(h){const I=n,C=o;return n=o=void 0,c=h,i=e.apply(C,I),i}function y(h,I){return d?(s&&window.cancelAnimationFrame(s),window.requestAnimationFrame(h)):setTimeout(h,I)}function O(h){if(d){window.cancelAnimationFrame(h);return}clearTimeout(h)}function g(h){return c=h,s=y(te,r),u?b(h):i}function m(h){const I=h-l,C=h-c,pr=r-I;return v?Math.min(pr,a-C):pr}function dr(h){const I=h-l,C=h-c;return l===void 0||I>=r||I<0||v&&C>=a}function te(){const h=Date.now();if(dr(h))return hr(h);s=y(te,m(h))}function hr(h){return s=void 0,f&&n?b(h):(n=o=void 0,i)}function yn(){s!==void 0&&O(s),c=0,n=l=o=s=void 0}function gn(){return s===void 0?i:hr(Date.now())}function mn(){return s!==void 0}function ne(...h){const I=Date.now(),C=dr(I);if(n=h,o=this,l=I,C){if(s===void 0)return g(l);if(v)return s=y(te,r),b(l)}return s===void 0&&(s=y(te,r)),i}return ne.cancel=yn,ne.flush=gn,ne.pending=mn,ne}const yt=(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]=yt(e[n],r):t[n]=e[n]}return t},Ll=e=>yt(e);class xl extends vt{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 Ml(e){return new E(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 Nl(...e){return new E(r=>e.reduce((t,n)=>t.add(n.subscribe(r)),new ge))}var Cl=e=>new E(r=>{const t=window.setTimeout(()=>{try{r.next()}catch(n){if(r.error)r.error(n);else throw n}},e);return()=>window.clearTimeout(t)}),Fl=e=>new E(r=>{const t=window.setInterval(()=>r.next(),e);return()=>window.clearInterval(t)}),Dl=e=>new E(r=>{e.forEach(t=>r.next(t))}),Gl=(e,r)=>new E(t=>{const n=o=>t.next(o);return e.addEventListener(r,n),()=>e.removeEventListener(r,n)});function kl(e){return r=>new E(t=>r.subscribe(new _n(t,e)))}class _n{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 An={leading:!1,trailing:!0};function Ul(e,r=An){return t=>new E(n=>t.subscribe(new jn(n,e,r)))}class jn{constructor(r,t,n){this.destination=r,this.time=t,this.config=n}next(r){this.lastValue=r,On(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 Ln={leading:!0,trailing:!1};function Vl(e,r=Ln){return t=>new E(n=>t.subscribe(new xn(n,e,r)))}class xn{constructor(r,t,n){this.destination=r,this.time=t,this.config=n}next(r){this.lastValue=r,wn(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 Bl(e){return r=>new E(t=>r.subscribe(new Mn(t,e)))}class Mn{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 ql(e=(r,t)=>r===t){return r=>new E(t=>r.subscribe(new Nn(t,e)))}const br={};class Nn{constructor(r,t){this.destination=r,this.predicate=t,this.lastValue=br}next(r){let t;try{t=this.lastValue===br||!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 Cn(e){return r=>new E(t=>r.subscribe(new Fn(t,e)))}let Fn=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 Yl(e){return Cn(()=>e)}function Wl(){return e=>new E(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 Ql(){return e=>new E(r=>e.subscribe(new Dn(r)))}class Dn{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 E(t=>r.subscribe(new Gn(t,e)))}class Gn{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 yr;(function(e){e.NETWORK="network",e.VIDEO_PIPELINE="video_pipeline",e.EXTERNAL_API="external_api",e.PARSER="parser",e.DOM="dom",e.WTF="wtf"})(yr||(yr={}));class gr{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 gt extends gr{constructor(){super(),this.listeners||gr.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 kn{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&&(kn.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 Un(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:a};let a=t;(a&&!a.prototype.hasOwnProperty("signal")||o)&&(a=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},a.prototype=t.prototype);const i=r;return{fetch:(l,c)=>{const u=a&&a.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,b)=>{u.addEventListener("abort",()=>b(v),{once:!0})});return c&&c.signal&&delete c.signal,Promise.race([f,i(l,c)])}return i(l,c)},Request:a}}const er=mt({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),Ot=er?Un({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,Vn=er?Ot.fetch:window.fetch;er?Ot.Request:window.Request;var Ee=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function Bn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var x=function(e){try{return!!e()}catch(r){return!0}},qn=x,me=!qn(function(){var e=function(){}.bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),wt=me,$t=Function.prototype,Ke=$t.call,Kn=wt&&$t.bind.bind(Ke,Ke),D=wt?Kn:function(e){return function(){return Ke.apply(e,arguments)}},Et=D,Yn=Et({}.toString),Wn=Et("".slice),rr=function(e){return Wn(Yn(e),8,-1)},Qn=D,zn=x,Hn=rr,Se=Object,Xn=Qn("".split),Jn=zn(function(){return!Se("z").propertyIsEnumerable(0)})?function(e){return Hn(e)=="String"?Xn(e,""):Se(e)}:Se,tr=function(e){return e==null},Zn=tr,eo=TypeError,St=function(e){if(Zn(e))throw eo("Can't call method on "+e);return e},ro=Jn,to=St,Z=function(e){return ro(to(e))},W={},oe=function(e){return e&&e.Math==Math&&e},R=oe(typeof globalThis=="object"&&globalThis)||oe(typeof window=="object"&&window)||oe(typeof self=="object"&&self)||oe(typeof Ee=="object"&&Ee)||function(){return this}()||Ee||Function("return this")(),Ye=typeof document=="object"&&document.all,no=typeof Ye=="undefined"&&Ye!==void 0,Tt={all:Ye,IS_HTMLDDA:no},It=Tt,oo=It.all,_=It.IS_HTMLDDA?function(e){return typeof e=="function"||e===oo}:function(e){return typeof e=="function"},ao=R,io=_,mr=ao.WeakMap,so=io(mr)&&/native code/.test(String(mr)),Or=_,Pt=Tt,co=Pt.all,Q=Pt.IS_HTMLDDA?function(e){return typeof e=="object"?e!==null:Or(e)||e===co}:function(e){return typeof e=="object"?e!==null:Or(e)},lo=x,G=!lo(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),z={},uo=R,wr=Q,We=uo.document,fo=wr(We)&&wr(We.createElement),Rt=function(e){return fo?We.createElement(e):{}},vo=G,ho=x,po=Rt,_t=!vo&&!ho(function(){return Object.defineProperty(po("div"),"a",{get:function(){return 7}}).a!=7}),bo=G,yo=x,At=bo&&yo(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42}),go=Q,mo=String,Oo=TypeError,H=function(e){if(go(e))return e;throw Oo(mo(e)+" is not an object")},wo=me,ae=Function.prototype.call,k=wo?ae.bind(ae):function(){return ae.apply(ae,arguments)},nr={},Te=nr,Ie=R,$o=_,$r=function(e){return $o(e)?e:void 0},jt=function(e,r){return arguments.length<2?$r(Te[e])||$r(Ie[e]):Te[e]&&Te[e][r]||Ie[e]&&Ie[e][r]},Eo=D,Lt=Eo({}.isPrototypeOf),So=typeof navigator!="undefined"&&String(navigator.userAgent)||"",xt=R,Pe=So,Er=xt.process,Sr=xt.Deno,Tr=Er&&Er.versions||Sr&&Sr.version,Ir=Tr&&Tr.v8,P,pe;Ir&&(P=Ir.split("."),pe=P[0]>0&&P[0]<4?1:+(P[0]+P[1]));!pe&&Pe&&(P=Pe.match(/Edge\/(\d+)/),(!P||P[1]>=74)&&(P=Pe.match(/Chrome\/(\d+)/),P&&(pe=+P[1])));var To=pe,Pr=To,Io=x,Po=R,Ro=Po.String,Mt=!!Object.getOwnPropertySymbols&&!Io(function(){var e=Symbol();return!Ro(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Pr&&Pr<41}),_o=Mt,Nt=_o&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Ao=jt,jo=_,Lo=Lt,xo=Nt,Mo=Object,Ct=xo?function(e){return typeof e=="symbol"}:function(e){var r=Ao("Symbol");return jo(r)&&Lo(r.prototype,Mo(e))},No=String,or=function(e){try{return No(e)}catch(r){return"Object"}},Co=_,Fo=or,Do=TypeError,ar=function(e){if(Co(e))return e;throw Do(Fo(e)+" is not a function")},Go=ar,ko=tr,ir=function(e,r){var t=e[r];return ko(t)?void 0:Go(t)},Re=k,_e=_,Ae=Q,Uo=TypeError,Vo=function(e,r){var t,n;if(r==="string"&&_e(t=e.toString)&&!Ae(n=Re(t,e))||_e(t=e.valueOf)&&!Ae(n=Re(t,e))||r!=="string"&&_e(t=e.toString)&&!Ae(n=Re(t,e)))return n;throw Uo("Can't convert object to primitive value")},Ft={exports:{}},Rr=R,Bo=Object.defineProperty,qo=function(e,r){try{Bo(Rr,e,{value:r,configurable:!0,writable:!0})}catch(t){Rr[e]=r}return r},Ko=R,Yo=qo,_r="__core-js_shared__",Wo=Ko[_r]||Yo(_r,{}),Dt=Wo,Ar=Dt;(Ft.exports=function(e,r){return Ar[e]||(Ar[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=Ft.exports,Qo=St,zo=Object,kt=function(e){return zo(Qo(e))},Ho=D,Xo=kt,Jo=Ho({}.hasOwnProperty),N=Object.hasOwn||function(r,t){return Jo(Xo(r),t)},Zo=D,ea=0,ra=Math.random(),ta=Zo(1 .toString),Ut=function(e){return"Symbol("+(e===void 0?"":e)+")_"+ta(++ea+ra,36)},na=R,oa=Gt,jr=N,aa=Ut,ia=Mt,sa=Nt,q=na.Symbol,je=oa("wks"),ca=sa?q.for||q:q&&q.withoutSetter||aa,M=function(e){return jr(je,e)||(je[e]=ia&&jr(q,e)?q[e]:ca("Symbol."+e)),je[e]},la=k,Lr=Q,xr=Ct,ua=ir,fa=Vo,va=M,da=TypeError,ha=va("toPrimitive"),pa=function(e,r){if(!Lr(e)||xr(e))return e;var t=ua(e,ha),n;if(t){if(r===void 0&&(r="default"),n=la(t,e,r),!Lr(n)||xr(n))return n;throw da("Can't convert object to primitive value")}return r===void 0&&(r="number"),fa(e,r)},ba=pa,ya=Ct,sr=function(e){var r=ba(e,"string");return ya(r)?r:r+""},ga=G,ma=_t,Oa=At,ie=H,Mr=sr,wa=TypeError,Le=Object.defineProperty,$a=Object.getOwnPropertyDescriptor,xe="enumerable",Me="configurable",Ne="writable";z.f=ga?Oa?function(r,t,n){if(ie(r),t=Mr(t),ie(n),typeof r=="function"&&t==="prototype"&&"value"in n&&Ne in n&&!n[Ne]){var o=$a(r,t);o&&o[Ne]&&(r[t]=n.value,n={configurable:Me in n?n[Me]:o[Me],enumerable:xe in n?n[xe]:o[xe],writable:!1})}return Le(r,t,n)}:Le:function(r,t,n){if(ie(r),t=Mr(t),ie(n),ma)try{return Le(r,t,n)}catch(o){}if("get"in n||"set"in n)throw wa("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}},Ea=G,Sa=z,Ta=Oe,ee=Ea?function(e,r,t){return Sa.f(e,r,Ta(1,t))}:function(e,r,t){return e[r]=t,e},Ia=Gt,Pa=Ut,Nr=Ia("keys"),cr=function(e){return Nr[e]||(Nr[e]=Pa(e))},lr={},Ra=so,Vt=R,_a=Q,Aa=ee,Ce=N,Fe=Dt,ja=cr,La=lr,Cr="Object already initialized",Qe=Vt.TypeError,xa=Vt.WeakMap,be,J,ye,Ma=function(e){return ye(e)?J(e):be(e,{})},Na=function(e){return function(r){var t;if(!_a(r)||(t=J(r)).type!==e)throw Qe("Incompatible receiver, "+e+" required");return t}};if(Ra||Fe.state){var A=Fe.state||(Fe.state=new xa);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=ja("state");La[U]=!0,be=function(e,r){if(Ce(e,U))throw Qe(Cr);return r.facade=e,Aa(e,U,r),r},J=function(e){return Ce(e,U)?e[U]:{}},ye=function(e){return Ce(e,U)}}var Ca={set:be,get:J,has:ye,enforce:Ma,getterFor:Na},Fa=me,Bt=Function.prototype,Fr=Bt.apply,Dr=Bt.call,Da=typeof Reflect=="object"&&Reflect.apply||(Fa?Dr.bind(Fr):function(){return Dr.apply(Fr,arguments)}),Ga=rr,ka=D,qt=function(e){if(Ga(e)==="Function")return ka(e)},Kt={},Yt={},Wt={}.propertyIsEnumerable,Qt=Object.getOwnPropertyDescriptor,Ua=Qt&&!Wt.call({1:2},1);Yt.f=Ua?function(r){var t=Qt(this,r);return!!t&&t.enumerable}:Wt;var Va=G,Ba=k,qa=Yt,Ka=Oe,Ya=Z,Wa=sr,Qa=N,za=_t,Gr=Object.getOwnPropertyDescriptor;Kt.f=Va?Gr:function(r,t){if(r=Ya(r),t=Wa(t),za)try{return Gr(r,t)}catch(n){}if(Qa(r,t))return Ka(!Ba(qa.f,r,t),r[t])};var Ha=x,Xa=_,Ja=/#|\.prototype\./,re=function(e,r){var t=ei[Za(e)];return t==ti?!0:t==ri?!1:Xa(r)?Ha(r):!!r},Za=re.normalize=function(e){return String(e).replace(Ja,".").toLowerCase()},ei=re.data={},ri=re.NATIVE="N",ti=re.POLYFILL="P",ni=re,kr=qt,oi=ar,ai=me,ii=kr(kr.bind),zt=function(e,r){return oi(e),r===void 0?e:ai?ii(e,r):function(){return e.apply(r,arguments)}},se=R,si=Da,ci=qt,li=_,ui=Kt.f,fi=ni,V=nr,vi=zt,B=ee,Ur=N,di=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 si(e,this,arguments)};return r.prototype=e.prototype,r},Ht=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?V:V[t]||B(V,t,{})[t],l=s.prototype,c,u,v,f,d,b,y,O,g;for(f in r)c=fi(n?f:t+(o?".":"#")+f,e.forced),u=!c&&i&&Ur(i,f),b=s[f],u&&(e.dontCallGetSet?(g=ui(i,f),y=g&&g.value):y=i[f]),d=u&&y?y:r[f],!(u&&typeof b==typeof d)&&(e.bind&&u?O=vi(d,se):e.wrap&&u?O=di(d):a&&li(d)?O=ci(d):O=d,(e.sham||d&&d.sham||b&&b.sham)&&B(O,"sham",!0),B(s,f,O),a&&(v=t+"Prototype",Ur(V,v)||B(V,v,{}),B(V[v],f,d),e.real&&l&&(c||!l[f])&&B(l,f,d)))},ze=G,hi=N,Xt=Function.prototype,pi=ze&&Object.getOwnPropertyDescriptor,ur=hi(Xt,"name"),bi=ur&&function(){}.name==="something",yi=ur&&(!ze||ze&&pi(Xt,"name").configurable),gi={EXISTS:ur,PROPER:bi,CONFIGURABLE:yi},Jt={},mi=Math.ceil,Oi=Math.floor,wi=Math.trunc||function(r){var t=+r;return(t>0?Oi:mi)(t)},$i=wi,Zt=function(e){var r=+e;return r!==r||r===0?0:$i(r)},Ei=Zt,Si=Math.max,Ti=Math.min,Ii=function(e,r){var t=Ei(e);return t<0?Si(t+r,0):Ti(t,r)},Pi=Zt,Ri=Math.min,_i=function(e){return e>0?Ri(Pi(e),9007199254740991):0},Ai=_i,en=function(e){return Ai(e.length)},ji=Z,Li=Ii,xi=en,Vr=function(e){return function(r,t,n){var o=ji(r),a=xi(o),i=Li(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}},Mi={includes:Vr(!0),indexOf:Vr(!1)},Ni=D,De=N,Ci=Z,Fi=Mi.indexOf,Di=lr,Br=Ni([].push),Gi=function(e,r){var t=Ci(e),n=0,o=[],a;for(a in t)!De(Di,a)&&De(t,a)&&Br(o,a);for(;r.length>n;)De(t,a=r[n++])&&(~Fi(o,a)||Br(o,a));return o},rn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],ki=Gi,Ui=rn,Vi=Object.keys||function(r){return ki(r,Ui)},Bi=G,qi=At,Ki=z,Yi=H,Wi=Z,Qi=Vi;Jt.f=Bi&&!qi?Object.defineProperties:function(r,t){Yi(r);for(var n=Wi(t),o=Qi(t),a=o.length,i=0,s;a>i;)Ki.f(r,s=o[i++],n[s]);return r};var zi=jt,Hi=zi("document","documentElement"),Xi=H,Ji=Jt,qr=rn,Zi=lr,es=Hi,rs=Rt,ts=cr,Kr=">",Yr="<",He="prototype",Xe="script",tn=ts("IE_PROTO"),Ge=function(){},nn=function(e){return Yr+Xe+Kr+e+Yr+"/"+Xe+Kr},Wr=function(e){e.write(nn("")),e.close();var r=e.parentWindow.Object;return e=null,r},ns=function(){var e=rs("iframe"),r="java"+Xe+":",t;return e.style.display="none",es.appendChild(e),e.src=String(r),t=e.contentWindow.document,t.open(),t.write(nn("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):ns():Wr(ce);for(var e=qr.length;e--;)delete ve[He][qr[e]];return ve()};Zi[tn]=!0;var on=Object.create||function(r,t){var n;return r!==null?(Ge[He]=Xi(r),n=new Ge,Ge[He]=null,n[tn]=r):n=ve(),t===void 0?n:Ji.f(n,t)},os=x,as=!os(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),is=N,ss=_,cs=kt,ls=cr,us=as,Qr=ls("IE_PROTO"),Je=Object,fs=Je.prototype,an=us?Je.getPrototypeOf:function(e){var r=cs(e);if(is(r,Qr))return r[Qr];var t=r.constructor;return ss(t)&&r instanceof t?t.prototype:r instanceof Je?fs:null},vs=ee,sn=function(e,r,t,n){return n&&n.enumerable?e[r]=t:vs(e,r,t),e},ds=x,hs=_,ps=Q,bs=on,zr=an,ys=sn,gs=M,Ze=gs("iterator"),cn=!1,L,ke,Ue;[].keys&&(Ue=[].keys(),"next"in Ue?(ke=zr(zr(Ue)),ke!==Object.prototype&&(L=ke)):cn=!0);var ms=!ps(L)||ds(function(){var e={};return L[Ze].call(e)!==e});ms?L={}:L=bs(L);hs(L[Ze])||ys(L,Ze,function(){return this});var ln={IteratorPrototype:L,BUGGY_SAFARI_ITERATORS:cn},Os=M,ws=Os("toStringTag"),un={};un[ws]="z";var fr=String(un)==="[object z]",$s=fr,Es=_,de=rr,Ss=M,Ts=Ss("toStringTag"),Is=Object,Ps=de(function(){return arguments}())=="Arguments",Rs=function(e,r){try{return e[r]}catch(t){}},vr=$s?de:function(e){var r,t,n;return e===void 0?"Undefined":e===null?"Null":typeof(t=Rs(r=Is(e),Ts))=="string"?t:Ps?de(r):(n=de(r))=="Object"&&Es(r.callee)?"Arguments":n},_s=fr,As=vr,js=_s?{}.toString:function(){return"[object "+As(this)+"]"},Ls=fr,xs=z.f,Ms=ee,Ns=N,Cs=js,Fs=M,Hr=Fs("toStringTag"),fn=function(e,r,t,n){if(e){var o=t?e:e.prototype;Ns(o,Hr)||xs(o,Hr,{configurable:!0,value:r}),n&&!Ls&&Ms(o,"toString",Cs)}},Ds=ln.IteratorPrototype,Gs=on,ks=Oe,Us=fn,Vs=W,Bs=function(){return this},qs=function(e,r,t,n){var o=r+" Iterator";return e.prototype=Gs(Ds,{next:ks(+!n,t)}),Us(e,o,!1,!0),Vs[o]=Bs,e},Ks=Ht,Ys=k,vn=gi,Ws=qs,Qs=an,zs=fn,Xr=sn,Hs=M,Jr=W,dn=ln,Xs=vn.PROPER;vn.CONFIGURABLE;dn.IteratorPrototype;var le=dn.BUGGY_SAFARI_ITERATORS,Ve=Hs("iterator"),Zr="keys",ue="values",et="entries",Js=function(){return this},Zs=function(e,r,t,n,o,a,i){Ws(t,r,n);var s=function(g){if(g===o&&f)return f;if(!le&&g in u)return u[g];switch(g){case Zr:return function(){return new t(this,g)};case ue:return function(){return new t(this,g)};case et:return function(){return new t(this,g)}}return function(){return new t(this)}},l=r+" Iterator",c=!1,u=e.prototype,v=u[Ve]||u["@@iterator"]||o&&u[o],f=!le&&v||s(o),d=r=="Array"&&u.entries||v,b,y,O;if(d&&(b=Qs(d.call(new e)),b!==Object.prototype&&b.next&&(zs(b,l,!0,!0),Jr[l]=Js)),Xs&&o==ue&&v&&v.name!==ue&&(c=!0,f=function(){return Ys(v,this)}),o)if(y={values:s(ue),keys:a?f:s(Zr),entries:s(et)},i)for(O in y)(le||c||!(O in u))&&Xr(u,O,y[O]);else Ks({target:r,proto:!0,forced:le||c},y);return i&&u[Ve]!==f&&Xr(u,Ve,f,{name:o}),Jr[r]=f,y},ec=function(e,r){return{value:e,done:r}},rc=Z,rt=W,hn=Ca;z.f;var tc=Zs,fe=ec,pn="Array Iterator",nc=hn.set,oc=hn.getterFor(pn);tc(Array,"Array",function(e,r){nc(this,{type:pn,target:rc(e),index:0,kind:r})},function(){var e=oc(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");rt.Arguments=rt.Array;var ac=M,ic=W,sc=ac("iterator"),cc=Array.prototype,lc=function(e){return e!==void 0&&(ic.Array===e||cc[sc]===e)},uc=vr,tt=ir,fc=tr,vc=W,dc=M,hc=dc("iterator"),bn=function(e){if(!fc(e))return tt(e,hc)||tt(e,"@@iterator")||vc[uc(e)]},pc=k,bc=ar,yc=H,gc=or,mc=bn,Oc=TypeError,wc=function(e,r){var t=arguments.length<2?mc(e):r;if(bc(t))return yc(pc(t,e));throw Oc(gc(e)+" is not iterable")},$c=k,nt=H,Ec=ir,Sc=function(e,r,t){var n,o;nt(e);try{if(n=Ec(e,"return"),!n){if(r==="throw")throw t;return t}n=$c(n,e)}catch(a){o=!0,n=a}if(r==="throw")throw t;if(o)throw n;return nt(n),t},Tc=zt,Ic=k,Pc=H,Rc=or,_c=lc,Ac=en,ot=Lt,jc=wc,Lc=bn,at=Sc,xc=TypeError,he=function(e,r){this.stopped=e,this.result=r},it=he.prototype,Mc=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),l=Tc(r,n),c,u,v,f,d,b,y,O=function(m){return c&&at(c,"normal",m),new he(!0,m)},g=function(m){return o?(Pc(m),s?l(m[0],m[1],O):l(m[0],m[1])):s?l(m,O):l(m)};if(a)c=e.iterator;else if(i)c=e;else{if(u=Lc(e),!u)throw xc(Rc(e)+" is not iterable");if(_c(u)){for(v=0,f=Ac(e);f>v;v++)if(d=g(e[v]),d&&ot(it,d))return d;return new he(!1)}c=jc(e,u)}for(b=a?e.next:c.next;!(y=Ic(b,c)).done;){try{d=g(y.value)}catch(m){at(c,"throw",m)}if(typeof d=="object"&&d&&ot(it,d))return d}return new he(!1)},Nc=sr,Cc=z,Fc=Oe,Dc=function(e,r,t){var n=Nc(r);n in e?Cc.f(e,n,Fc(0,t)):e[n]=t},Gc=Ht,kc=Mc,Uc=Dc;Gc({target:"Object",stat:!0},{fromEntries:function(r){var t={};return kc(r,function(n,o){Uc(t,n,o)},{AS_ENTRIES:!0}),t}});var Vc=nr,Bc=Vc.Object.fromEntries,qc={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},Kc=qc,Yc=R,Wc=vr,Qc=ee,st=W,zc=M,ct=zc("toStringTag");for(var Be in Kc){var lt=Yc[Be],qe=lt&&lt.prototype;qe&&Wc(qe)!==ct&&Qc(qe,ct,Be),st[Be]=st.Array}var Hc=Bc,Xc=Hc,Jc=Xc,Zc=Jc,el=Bn(Zc),ut;(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"})(ut||(ut={}));const rl="vk.com",Hl=async(e,r,t)=>{const n=new URL(`https://${rl}/js/lang-pack.js`);n.searchParams.set("format","json"),n.searchParams.set("name",r),e!==void 0&&n.searchParams.set("lang",e);const a=await(await Vn(n.toString())).json();return tl(a,t)},tl=(e,r)=>el(Object.entries(e.keys).map(([t,n])=>[t.substring(`${r}_`.length),nl(n)])),nl=e=>Array.isArray(e)?e[0]:e;var ft;(function(e){e.RU="ru",e.EN="en"})(ft||(ft={}));export{j as CurrentClientBrowser,w as CurrentClientDevice,yr as ErrorCategory,ft as InterfaceLanguage,il as Logger,E as Observable,vt as Subject,ge as Subscription,ol as VERSION,ut as VKNumericLanguage,xl as ValueSubject,S as VideoQuality,dl as abortable,fl as addScript,Rl as areQualitiesExact,ul as assertEmptyArray,K as assertNever,sl as assertNonNullable,ll as assertNotEmptyArray,cl as assertNullable,_l as assertQualityIsExact,kl as buffer,al as checkNever,Ll as cloneDeep,yt as cloneDeepWith,Ml as combine,Ul as debounce,jl as debounceFn,Ol as detectEmbed,Rn as fillWithDefault,Bl as filter,ql as filterChanged,Gl as fromEvent,dt as getCurrentBrowser,gl as getExponentialDelay,Sl as getHighestQuality,pl as getIOSVersion,Fl as interval,wl as isHigher,$l as isHigherOrEqual,hl as isIOS,bt as isInvariantQuality,ht as isLower,El as isLowerOrEqual,bl as isMacLike,yl as isMobile,On as isNonNullable,wn as isNullable,Hl as loadVKLangPack,Cn as map,Yl as mapTo,Nl as merge,X as noop,vl as now,Dl as observableFrom,Wl as once,Ql as pairwise,ml as safeStorage,zl as tap,Vl as throttle,Al as timeCodeToString,Cl as timeout,Tl as videoHeightToQuality,Pl as videoQualityToHeight,Il as videoSizeToQuality};
6
+ const sl="1.0.35-beta.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`)},cl=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:i=>t.next(i),error:i=>{var l;return(l=t.error)===null||l===void 0?void 0:l.call(t,i)}}:o={next:X,error:X};const a=typeof r=="function"?{next:i=>{try{r(i)}catch(l){o.next(l)}},error:i=>o.next(i)}:{next:i=>r.next(i),error:i=>r.error?r.error(i):o.next(i)};let s;try{s=this._subscribe(a)}catch(i){(n=a.error)===null||n===void 0||n.call(a,i)}return new ge().add(()=>{switch(a.next=X,a.error=X,typeof s){case"function":s();return;case"object":s.unsubscribe();return;case"undefined":return;default:return K(s)}})}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 ll{constructor(){this.log$=new dt,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 ul(e,r='Assertion "value is not nullable" failed'){if(e==null)throw new Error(r)}function fl(e,r='Assertion "value is nullable" failed'){if(e!=null)throw new Error(r)}function Ke(e){return typeof e!="undefined"&&e!==null}function wn(e){return e==null}function vl(e,r){if(!(e!=null&&e.length))throw new Error(r)}function dl(e,r){if(e!=null&&e.length)throw new Error(r)}const hl=(e,r,t)=>new Promise((n,o)=>{r.addEventListener("abort",()=>{i(),c.remove()});const a=()=>{i(),o()},s=()=>{i(),n()},i=()=>{l&&clearTimeout(l),c.removeEventListener("load",s),c.removeEventListener("error",a)};let l;t&&(l=window.setTimeout(a,t));const c=document.createElement("script");c.addEventListener("load",s),c.addEventListener("error",a),c.src=e,document.head.appendChild(c)});var we;const pl=typeof((we=window.performance)===null||we===void 0?void 0:we.now)=="function"?()=>window.performance.now():()=>Date.now(),bl=(e,r)=>async(...t)=>{var n;const o=r(...t);let a=e.aborted,s;for(;!a&&!e.aborted;)try{const i=await o.next(s);a=(n=i.done)!==null&&n!==void 0?n:!1,s=i.value}catch(i){await o.throw(i)}return s};var x;(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"})(x||(x={}));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 ht=()=>{const{userAgent:e}=window.navigator,r=/yabrowser/i.test(e)?x.Yandex:void 0,t=/chrome|crios/i.test(e)?x.Chrome:void 0,n=/chromium/i.test(e)?x.Chromium:void 0,o=/firefox|fxios/i.test(e)?x.Firefox:void 0,a=/webkit|safari|khtml/i.test(e)?x.Safari:void 0,s=/opr\//i.test(e)?x.Opera:void 0,i=/edg/i.test(e)?x.Edge:void 0,l=/android/i.test(e)?$.Android:void 0,c=/iphone/i.test(e)?$.iPhone:void 0,u=/ipad/i.test(e)?$.iPad:void 0,v=/ipod/i.test(e)?$.iPod:void 0,f=/mac/i.test(e)?$.Mac:void 0,d=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(e)?$.RestMobile:void 0;return{browser:r||o||s||i||t||n||a||x.Rest,device:l||c||u||v||d||f||$.Desktop}},yl=(e=!1)=>{const t=[$.iPhone,$.iPad,$.iPod].includes(ht().device);if(!e)return t;const{userAgent:n,maxTouchPoints:o}=window.navigator;return!!(t||/macintosh/i.test(n)&&o>0)},gl=()=>{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},ml=()=>[$.Mac,$.iPhone,$.iPad,$.iPod].includes(ht().device),Ol=()=>{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)},wl=(e,{start:r=0,factor:t=2,max:n=1/0,min:o=r,random:a=0}={})=>{let s=r;return s*=t**e,s*=1+(Math.random()*a*2-a),s=Math.round(s),s=Math.min(s,n),s=Math.max(s,o),s};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,F;const $e=`vk-videoplayer-dummy-key-${Math.random()}`,Y=()=>{if(F!==void 0)return F;try{localStorage.setItem($e,"test"),localStorage.removeItem($e),F=p.LOCAL_STORAGE}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem($e),F=p.SESSION_STORAGE}catch(r){if(r instanceof DOMException||r instanceof TypeError)F=p.RUNTIME;else throw r}else throw e}return F===p.RUNTIME&&(S=new Map),F},$n=()=>Y()===p.LOCAL_STORAGE,Sn=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)}},En=(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)}},Tn=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}},In=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)}},Rn=()=>{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 $l=Object.freeze({__proto__:null,clear:Rn,get:Sn,has:Tn,isPersistent:$n,remove:In,set:En});const Sl=()=>{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}},El=(e,r)=>T[e].height>T[r].height,Tl=(e,r)=>T[e].height>=T[r].height,pt=(e,r)=>T[e].height<T[r].height,Il=(e,r)=>T[e].height<=T[r].height,Rl=e=>e.sort((r,t)=>r===t?0:r===E.INVARIANT?1:t===E.INVARIANT?-1:pt(r,t)?1:-1)[0],bt=Object.keys(T).sort((e,r)=>pt(e,r)?-1:1),Pl=(e,r=.02)=>[...bt].find(n=>T[n].height*(1+r)>=e),_l=({width:e,height:r})=>{const t=Math.min(e,r),n=Math.max(e,r);return bt.find(o=>{const a=T[o];return a.width>=n&&a.height>=t})},Al=e=>T[e].height,yt=e=>e===E.INVARIANT,xl=e=>e.every(r=>!yt(r));function jl(e){if(yt(e))throw new Error("Expected exact quality")}const Pn=(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]=Pn(a,o):t[n]=n in e?a:o}return t},Ll=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 _n(e,r=0,t){let n,o,a,s,i,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,a=t!=null&&t.maxWait?Math.max(+(t==null?void 0:t.maxWait)||0,r):a,f="trailing"in t?!!t.trailing:f);function b(h){const I=n,C=o;return n=o=void 0,c=h,s=e.apply(C,I),s}function y(h,I){return d?(i&&window.cancelAnimationFrame(i),window.requestAnimationFrame(h)):setTimeout(h,I)}function w(h){if(d){window.cancelAnimationFrame(h);return}clearTimeout(h)}function g(h){return c=h,i=y(te,r),u?b(h):s}function m(h){const I=h-l,C=h-c,br=r-I;return v?Math.min(br,a-C):br}function hr(h){const I=h-l,C=h-c;return l===void 0||I>=r||I<0||v&&C>=a}function te(){const h=Date.now();if(hr(h))return pr(h);i=y(te,m(h))}function pr(h){return i=void 0,f&&n?b(h):(n=o=void 0,s)}function gn(){i!==void 0&&w(i),c=0,n=l=o=i=void 0}function mn(){return i===void 0?s:pr(Date.now())}function On(){return i!==void 0}function ne(...h){const I=Date.now(),C=hr(I);if(n=h,o=this,l=I,C){if(i===void 0)return g(l);if(v)return i=y(te,r),b(l)}return i===void 0&&(i=y(te,r)),s}return ne.cancel=gn,ne.flush=mn,ne.pending=On,ne}const An=(e,r=0,t)=>_n(e,r,{...{leading:!0,trailing:!0},...t,maxWait:r}),gt=(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]=gt(e[n],r):t[n]=e[n]}return t},Ml=e=>gt(e),xn=300,Nl=(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(An(s=>{const i=s[0];if(!i)return;let l,c;i.contentBoxSize&&i.contentBoxSize[0]?(c=i.contentBoxSize[0].blockSize,l=i.contentBoxSize[0].inlineSize):i.contentRect&&(l=i.contentRect.width,c=i.contentRect.height),Ke(l)&&Ke(c)&&t.next({width:l,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 Fl(e){return new O(r=>{const t={};let n=Object.keys(e).length;const o=a=>s=>{a in t||n--,t[a]=s,n===0&&r.next(t)};return Object.entries(e).reduce((a,[s,i])=>a.add(i.subscribe(o(s))),new ge)})}function Dl(...e){return new O(r=>e.reduce((t,n)=>t.add(n.subscribe(r)),new ge))}var Gl=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)}),kl=e=>new O(r=>{const t=window.setInterval(()=>r.next(),e);return()=>window.clearInterval(t)}),Ul=e=>new O(r=>{e.forEach(t=>r.next(t))}),Bl=(e,r)=>new O(t=>{const n=o=>t.next(o);return e.addEventListener(r,n),()=>e.removeEventListener(r,n)});function Vl(e){return r=>new O(t=>r.subscribe(new jn(t,e)))}class jn{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 Ln={leading:!1,trailing:!0};function ql(e,r=Ln){return t=>new O(n=>t.subscribe(new Mn(n,e,r)))}class Mn{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 Nn={leading:!0,trailing:!1};function Kl(e,r=Nn){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,wn(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 Yl(e){return r=>new O(t=>r.subscribe(new Fn(t,e)))}class Fn{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 zl(e=(r,t)=>r===t){return r=>new O(t=>r.subscribe(new Dn(t,e)))}const yr={};class Dn{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 Gn(e){return r=>new O(t=>r.subscribe(new kn(t,e)))}let kn=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 Ql(e){return Gn(()=>e)}function Hl(){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 s;t=!0,(s=r.error)===null||s===void 0||s.call(r,a),n&&o.unsubscribe()});return n=!0,t&&o.unsubscribe(),o})}function Xl(){return e=>new O(r=>e.subscribe(new Un(r)))}class Un{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 Jl(e){return r=>new O(t=>r.subscribe(new Bn(t,e)))}class Bn{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"})(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 s=n[o];try{s.callback.call(this,r)}catch(i){Promise.resolve().then(()=>{throw i})}s.options&&s.options.once&&this.removeEventListener(r.type,s.callback)}return!r.defaultPrevented}}class mt 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 Vn{constructor(){Object.defineProperty(this,"signal",{value:new mt,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&&(Vn.prototype[Symbol.toStringTag]="AbortController",mt.prototype[Symbol.toStringTag]="AbortSignal");function Ot(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 qn(e){typeof e=="function"&&(e={fetch:e});const{fetch:r,Request:t=r.Request,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o=!1}=e;if(!Ot({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,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},a.prototype=t.prototype);const s=r;return{fetch:(l,c)=>{const u=a&&a.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,b)=>{u.addEventListener("abort",()=>b(v),{once:!0})});return c&&c.signal&&delete c.signal,Promise.race([f,s(l,c)])}return s(l,c)},Request:a}}const rr=Ot({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),wt=rr?qn({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,Kn=rr?wt.fetch:window.fetch;rr?wt.Request:window.Request;var Se=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function Yn(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}},zn=L,me=!zn(function(){var e=function(){}.bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),$t=me,St=Function.prototype,Ye=St.call,Wn=$t&&St.bind.bind(Ye,Ye),D=$t?Wn:function(e){return function(){return Ye.apply(e,arguments)}},Et=D,Qn=Et({}.toString),Hn=Et("".slice),tr=function(e){return Hn(Qn(e),8,-1)},Xn=D,Jn=L,Zn=tr,Ee=Object,eo=Xn("".split),ro=Jn(function(){return!Ee("z").propertyIsEnumerable(0)})?function(e){return Zn(e)=="String"?eo(e,""):Ee(e)}:Ee,nr=function(e){return e==null},to=nr,no=TypeError,Tt=function(e){if(to(e))throw no("Can't call method on "+e);return e},oo=ro,ao=Tt,Z=function(e){return oo(ao(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,io=typeof ze=="undefined"&&ze!==void 0,It={all:ze,IS_HTMLDDA:io},Rt=It,so=Rt.all,_=Rt.IS_HTMLDDA?function(e){return typeof e=="function"||e===so}:function(e){return typeof e=="function"},co=P,lo=_,Or=co.WeakMap,uo=lo(Or)&&/native code/.test(String(Or)),wr=_,Pt=It,fo=Pt.all,W=Pt.IS_HTMLDDA?function(e){return typeof e=="object"?e!==null:wr(e)||e===fo}:function(e){return typeof e=="object"?e!==null:wr(e)},vo=L,G=!vo(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),Q={},ho=P,$r=W,We=ho.document,po=$r(We)&&$r(We.createElement),_t=function(e){return po?We.createElement(e):{}},bo=G,yo=L,go=_t,At=!bo&&!yo(function(){return Object.defineProperty(go("div"),"a",{get:function(){return 7}}).a!=7}),mo=G,Oo=L,xt=mo&&Oo(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42}),wo=W,$o=String,So=TypeError,H=function(e){if(wo(e))return e;throw So($o(e)+" is not an object")},Eo=me,ae=Function.prototype.call,k=Eo?ae.bind(ae):function(){return ae.apply(ae,arguments)},or={},Te=or,Ie=P,To=_,Sr=function(e){return To(e)?e:void 0},jt=function(e,r){return arguments.length<2?Sr(Te[e])||Sr(Ie[e]):Te[e]&&Te[e][r]||Ie[e]&&Ie[e][r]},Io=D,Lt=Io({}.isPrototypeOf),Ro=typeof navigator!="undefined"&&String(navigator.userAgent)||"",Mt=P,Re=Ro,Er=Mt.process,Tr=Mt.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 Po=pe,Pr=Po,_o=L,Ao=P,xo=Ao.String,Nt=!!Object.getOwnPropertySymbols&&!_o(function(){var e=Symbol();return!xo(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Pr&&Pr<41}),jo=Nt,Ct=jo&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Lo=jt,Mo=_,No=Lt,Co=Ct,Fo=Object,Ft=Co?function(e){return typeof e=="symbol"}:function(e){var r=Lo("Symbol");return Mo(r)&&No(r.prototype,Fo(e))},Do=String,ar=function(e){try{return Do(e)}catch(r){return"Object"}},Go=_,ko=ar,Uo=TypeError,ir=function(e){if(Go(e))return e;throw Uo(ko(e)+" is not a function")},Bo=ir,Vo=nr,sr=function(e,r){var t=e[r];return Vo(t)?void 0:Bo(t)},Pe=k,_e=_,Ae=W,qo=TypeError,Ko=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 qo("Can't convert object to primitive value")},Dt={exports:{}},_r=P,Yo=Object.defineProperty,zo=function(e,r){try{Yo(_r,e,{value:r,configurable:!0,writable:!0})}catch(t){_r[e]=r}return r},Wo=P,Qo=zo,Ar="__core-js_shared__",Ho=Wo[Ar]||Qo(Ar,{}),Gt=Ho,xr=Gt;(Dt.exports=function(e,r){return xr[e]||(xr[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=Dt.exports,Xo=Tt,Jo=Object,Ut=function(e){return Jo(Xo(e))},Zo=D,ea=Ut,ra=Zo({}.hasOwnProperty),N=Object.hasOwn||function(r,t){return ra(ea(r),t)},ta=D,na=0,oa=Math.random(),aa=ta(1 .toString),Bt=function(e){return"Symbol("+(e===void 0?"":e)+")_"+aa(++na+oa,36)},ia=P,sa=kt,jr=N,ca=Bt,la=Nt,ua=Ct,q=ia.Symbol,xe=sa("wks"),fa=ua?q.for||q:q&&q.withoutSetter||ca,M=function(e){return jr(xe,e)||(xe[e]=la&&jr(q,e)?q[e]:fa("Symbol."+e)),xe[e]},va=k,Lr=W,Mr=Ft,da=sr,ha=Ko,pa=M,ba=TypeError,ya=pa("toPrimitive"),ga=function(e,r){if(!Lr(e)||Mr(e))return e;var t=da(e,ya),n;if(t){if(r===void 0&&(r="default"),n=va(t,e,r),!Lr(n)||Mr(n))return n;throw ba("Can't convert object to primitive value")}return r===void 0&&(r="number"),ha(e,r)},ma=ga,Oa=Ft,cr=function(e){var r=ma(e,"string");return Oa(r)?r:r+""},wa=G,$a=At,Sa=xt,ie=H,Nr=cr,Ea=TypeError,je=Object.defineProperty,Ta=Object.getOwnPropertyDescriptor,Le="enumerable",Me="configurable",Ne="writable";Q.f=wa?Sa?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=Ta(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 je(r,t,n)}:je:function(r,t,n){if(ie(r),t=Nr(t),ie(n),$a)try{return je(r,t,n)}catch(o){}if("get"in n||"set"in n)throw Ea("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}},Ia=G,Ra=Q,Pa=Oe,ee=Ia?function(e,r,t){return Ra.f(e,r,Pa(1,t))}:function(e,r,t){return e[r]=t,e},_a=kt,Aa=Bt,Cr=_a("keys"),lr=function(e){return Cr[e]||(Cr[e]=Aa(e))},ur={},xa=uo,Vt=P,ja=W,La=ee,Ce=N,Fe=Gt,Ma=lr,Na=ur,Fr="Object already initialized",Qe=Vt.TypeError,Ca=Vt.WeakMap,be,J,ye,Fa=function(e){return ye(e)?J(e):be(e,{})},Da=function(e){return function(r){var t;if(!ja(r)||(t=J(r)).type!==e)throw Qe("Incompatible receiver, "+e+" required");return t}};if(xa||Fe.state){var A=Fe.state||(Fe.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(Fr);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=Ma("state");Na[U]=!0,be=function(e,r){if(Ce(e,U))throw Qe(Fr);return r.facade=e,La(e,U,r),r},J=function(e){return Ce(e,U)?e[U]:{}},ye=function(e){return Ce(e,U)}}var Ga={set:be,get:J,has:ye,enforce:Fa,getterFor:Da},ka=me,qt=Function.prototype,Dr=qt.apply,Gr=qt.call,Ua=typeof Reflect=="object"&&Reflect.apply||(ka?Gr.bind(Dr):function(){return Gr.apply(Dr,arguments)}),Ba=tr,Va=D,Kt=function(e){if(Ba(e)==="Function")return Va(e)},Yt={},zt={},Wt={}.propertyIsEnumerable,Qt=Object.getOwnPropertyDescriptor,qa=Qt&&!Wt.call({1:2},1);zt.f=qa?function(r){var t=Qt(this,r);return!!t&&t.enumerable}:Wt;var Ka=G,Ya=k,za=zt,Wa=Oe,Qa=Z,Ha=cr,Xa=N,Ja=At,kr=Object.getOwnPropertyDescriptor;Yt.f=Ka?kr:function(r,t){if(r=Qa(r),t=Ha(t),Ja)try{return kr(r,t)}catch(n){}if(Xa(r,t))return Wa(!Ya(za.f,r,t),r[t])};var Za=L,ei=_,ri=/#|\.prototype\./,re=function(e,r){var t=ni[ti(e)];return t==ai?!0:t==oi?!1:ei(r)?Za(r):!!r},ti=re.normalize=function(e){return String(e).replace(ri,".").toLowerCase()},ni=re.data={},oi=re.NATIVE="N",ai=re.POLYFILL="P",ii=re,Ur=Kt,si=ir,ci=me,li=Ur(Ur.bind),Ht=function(e,r){return si(e),r===void 0?e:ci?li(e,r):function(){return e.apply(r,arguments)}},se=P,ui=Ua,fi=Kt,vi=_,di=Yt.f,hi=ii,B=or,pi=Ht,V=ee,Br=N,bi=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 ui(e,this,arguments)};return r.prototype=e.prototype,r},Xt=function(e,r){var t=e.target,n=e.global,o=e.stat,a=e.proto,s=n?se:o?se[t]:(se[t]||{}).prototype,i=n?B:B[t]||V(B,t,{})[t],l=i.prototype,c,u,v,f,d,b,y,w,g;for(f in r)c=hi(n?f:t+(o?".":"#")+f,e.forced),u=!c&&s&&Br(s,f),b=i[f],u&&(e.dontCallGetSet?(g=di(s,f),y=g&&g.value):y=s[f]),d=u&&y?y:r[f],!(u&&typeof b==typeof d)&&(e.bind&&u?w=pi(d,se):e.wrap&&u?w=bi(d):a&&vi(d)?w=fi(d):w=d,(e.sham||d&&d.sham||b&&b.sham)&&V(w,"sham",!0),V(i,f,w),a&&(v=t+"Prototype",Br(B,v)||V(B,v,{}),V(B[v],f,d),e.real&&l&&(c||!l[f])&&V(l,f,d)))},He=G,yi=N,Jt=Function.prototype,gi=He&&Object.getOwnPropertyDescriptor,fr=yi(Jt,"name"),mi=fr&&function(){}.name==="something",Oi=fr&&(!He||He&&gi(Jt,"name").configurable),wi={EXISTS:fr,PROPER:mi,CONFIGURABLE:Oi},Zt={},$i=Math.ceil,Si=Math.floor,Ei=Math.trunc||function(r){var t=+r;return(t>0?Si:$i)(t)},Ti=Ei,en=function(e){var r=+e;return r!==r||r===0?0:Ti(r)},Ii=en,Ri=Math.max,Pi=Math.min,_i=function(e,r){var t=Ii(e);return t<0?Ri(t+r,0):Pi(t,r)},Ai=en,xi=Math.min,ji=function(e){return e>0?xi(Ai(e),9007199254740991):0},Li=ji,rn=function(e){return Li(e.length)},Mi=Z,Ni=_i,Ci=rn,Vr=function(e){return function(r,t,n){var o=Mi(r),a=Ci(o),s=Ni(n,a),i;if(e&&t!=t){for(;a>s;)if(i=o[s++],i!=i)return!0}else for(;a>s;s++)if((e||s in o)&&o[s]===t)return e||s||0;return!e&&-1}},Fi={includes:Vr(!0),indexOf:Vr(!1)},Di=D,De=N,Gi=Z,ki=Fi.indexOf,Ui=ur,qr=Di([].push),Bi=function(e,r){var t=Gi(e),n=0,o=[],a;for(a in t)!De(Ui,a)&&De(t,a)&&qr(o,a);for(;r.length>n;)De(t,a=r[n++])&&(~ki(o,a)||qr(o,a));return o},tn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Vi=Bi,qi=tn,Ki=Object.keys||function(r){return Vi(r,qi)},Yi=G,zi=xt,Wi=Q,Qi=H,Hi=Z,Xi=Ki;Zt.f=Yi&&!zi?Object.defineProperties:function(r,t){Qi(r);for(var n=Hi(t),o=Xi(t),a=o.length,s=0,i;a>s;)Wi.f(r,i=o[s++],n[i]);return r};var Ji=jt,Zi=Ji("document","documentElement"),es=H,rs=Zt,Kr=tn,ts=ur,ns=Zi,os=_t,as=lr,Yr=">",zr="<",Xe="prototype",Je="script",nn=as("IE_PROTO"),Ge=function(){},on=function(e){return zr+Je+Yr+e+zr+"/"+Je+Yr},Wr=function(e){e.write(on("")),e.close();var r=e.parentWindow.Object;return e=null,r},is=function(){var e=os("iframe"),r="java"+Je+":",t;return e.style.display="none",ns.appendChild(e),e.src=String(r),t=e.contentWindow.document,t.open(),t.write(on("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):is():Wr(ce);for(var e=Kr.length;e--;)delete ve[Xe][Kr[e]];return ve()};ts[nn]=!0;var an=Object.create||function(r,t){var n;return r!==null?(Ge[Xe]=es(r),n=new Ge,Ge[Xe]=null,n[nn]=r):n=ve(),t===void 0?n:rs.f(n,t)},ss=L,cs=!ss(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),ls=N,us=_,fs=Ut,vs=lr,ds=cs,Qr=vs("IE_PROTO"),Ze=Object,hs=Ze.prototype,sn=ds?Ze.getPrototypeOf:function(e){var r=fs(e);if(ls(r,Qr))return r[Qr];var t=r.constructor;return us(t)&&r instanceof t?t.prototype:r instanceof Ze?hs:null},ps=ee,cn=function(e,r,t,n){return n&&n.enumerable?e[r]=t:ps(e,r,t),e},bs=L,ys=_,gs=W,ms=an,Hr=sn,Os=cn,ws=M,er=ws("iterator"),ln=!1,j,ke,Ue;[].keys&&(Ue=[].keys(),"next"in Ue?(ke=Hr(Hr(Ue)),ke!==Object.prototype&&(j=ke)):ln=!0);var $s=!gs(j)||bs(function(){var e={};return j[er].call(e)!==e});$s?j={}:j=ms(j);ys(j[er])||Os(j,er,function(){return this});var un={IteratorPrototype:j,BUGGY_SAFARI_ITERATORS:ln},Ss=M,Es=Ss("toStringTag"),fn={};fn[Es]="z";var vr=String(fn)==="[object z]",Ts=vr,Is=_,de=tr,Rs=M,Ps=Rs("toStringTag"),_s=Object,As=de(function(){return arguments}())=="Arguments",xs=function(e,r){try{return e[r]}catch(t){}},dr=Ts?de:function(e){var r,t,n;return e===void 0?"Undefined":e===null?"Null":typeof(t=xs(r=_s(e),Ps))=="string"?t:As?de(r):(n=de(r))=="Object"&&Is(r.callee)?"Arguments":n},js=vr,Ls=dr,Ms=js?{}.toString:function(){return"[object "+Ls(this)+"]"},Ns=vr,Cs=Q.f,Fs=ee,Ds=N,Gs=Ms,ks=M,Xr=ks("toStringTag"),vn=function(e,r,t,n){if(e){var o=t?e:e.prototype;Ds(o,Xr)||Cs(o,Xr,{configurable:!0,value:r}),n&&!Ns&&Fs(o,"toString",Gs)}},Us=un.IteratorPrototype,Bs=an,Vs=Oe,qs=vn,Ks=z,Ys=function(){return this},zs=function(e,r,t,n){var o=r+" Iterator";return e.prototype=Bs(Us,{next:Vs(+!n,t)}),qs(e,o,!1,!0),Ks[o]=Ys,e},Ws=Xt,Qs=k,dn=wi,Hs=zs,Xs=sn,Js=vn,Jr=cn,Zs=M,Zr=z,hn=un,ec=dn.PROPER;dn.CONFIGURABLE;hn.IteratorPrototype;var le=hn.BUGGY_SAFARI_ITERATORS,Be=Zs("iterator"),et="keys",ue="values",rt="entries",rc=function(){return this},tc=function(e,r,t,n,o,a,s){Hs(t,r,n);var i=function(g){if(g===o&&f)return f;if(!le&&g in u)return u[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)}},l=r+" Iterator",c=!1,u=e.prototype,v=u[Be]||u["@@iterator"]||o&&u[o],f=!le&&v||i(o),d=r=="Array"&&u.entries||v,b,y,w;if(d&&(b=Xs(d.call(new e)),b!==Object.prototype&&b.next&&(Js(b,l,!0,!0),Zr[l]=rc)),ec&&o==ue&&v&&v.name!==ue&&(c=!0,f=function(){return Qs(v,this)}),o)if(y={values:i(ue),keys:a?f:i(et),entries:i(rt)},s)for(w in y)(le||c||!(w in u))&&Jr(u,w,y[w]);else Ws({target:r,proto:!0,forced:le||c},y);return s&&u[Be]!==f&&Jr(u,Be,f,{name:o}),Zr[r]=f,y},nc=function(e,r){return{value:e,done:r}},oc=Z,tt=z,pn=Ga;Q.f;var ac=tc,fe=nc,bn="Array Iterator",ic=pn.set,sc=pn.getterFor(bn);ac(Array,"Array",function(e,r){ic(this,{type:bn,target:oc(e),index:0,kind:r})},function(){var e=sc(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 cc=M,lc=z,uc=cc("iterator"),fc=Array.prototype,vc=function(e){return e!==void 0&&(lc.Array===e||fc[uc]===e)},dc=dr,nt=sr,hc=nr,pc=z,bc=M,yc=bc("iterator"),yn=function(e){if(!hc(e))return nt(e,yc)||nt(e,"@@iterator")||pc[dc(e)]},gc=k,mc=ir,Oc=H,wc=ar,$c=yn,Sc=TypeError,Ec=function(e,r){var t=arguments.length<2?$c(e):r;if(mc(t))return Oc(gc(t,e));throw Sc(wc(e)+" is not iterable")},Tc=k,ot=H,Ic=sr,Rc=function(e,r,t){var n,o;ot(e);try{if(n=Ic(e,"return"),!n){if(r==="throw")throw t;return t}n=Tc(n,e)}catch(a){o=!0,n=a}if(r==="throw")throw t;if(o)throw n;return ot(n),t},Pc=Ht,_c=k,Ac=H,xc=ar,jc=vc,Lc=rn,at=Lt,Mc=Ec,Nc=yn,it=Rc,Cc=TypeError,he=function(e,r){this.stopped=e,this.result=r},st=he.prototype,Fc=function(e,r,t){var n=t&&t.that,o=!!(t&&t.AS_ENTRIES),a=!!(t&&t.IS_RECORD),s=!!(t&&t.IS_ITERATOR),i=!!(t&&t.INTERRUPTED),l=Pc(r,n),c,u,v,f,d,b,y,w=function(m){return c&&it(c,"normal",m),new he(!0,m)},g=function(m){return o?(Ac(m),i?l(m[0],m[1],w):l(m[0],m[1])):i?l(m,w):l(m)};if(a)c=e.iterator;else if(s)c=e;else{if(u=Nc(e),!u)throw Cc(xc(e)+" is not iterable");if(jc(u)){for(v=0,f=Lc(e);f>v;v++)if(d=g(e[v]),d&&at(st,d))return d;return new he(!1)}c=Mc(e,u)}for(b=a?e.next:c.next;!(y=_c(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)},Dc=cr,Gc=Q,kc=Oe,Uc=function(e,r,t){var n=Dc(r);n in e?Gc.f(e,n,kc(0,t)):e[n]=t},Bc=Xt,Vc=Fc,qc=Uc;Bc({target:"Object",stat:!0},{fromEntries:function(r){var t={};return Vc(r,function(n,o){qc(t,n,o)},{AS_ENTRIES:!0}),t}});var Kc=or,Yc=Kc.Object.fromEntries,zc={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},Wc=zc,Qc=P,Hc=dr,Xc=ee,ct=z,Jc=M,lt=Jc("toStringTag");for(var Ve in Wc){var ut=Qc[Ve],qe=ut&&ut.prototype;qe&&Hc(qe)!==lt&&Xc(qe,lt,Ve),ct[Ve]=ct.Array}var Zc=Yc,el=Zc,rl=el,tl=rl,nl=Yn(tl),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 ol="vk.com",Zl=async(e,r,t)=>{const n=new URL(`https://${ol}/js/lang-pack.js`);n.searchParams.set("format","json"),n.searchParams.set("name",r),e!==void 0&&n.searchParams.set("lang",e);const a=await(await Kn(n.toString())).json();return al(a,t)},al=(e,r)=>nl(Object.entries(e.keys).map(([t,n])=>[t.substring(`${r}_`.length),il(n)])),il=e=>Array.isArray(e)?e[0]:e;var vt;(function(e){e.RU="ru",e.EN="en"})(vt||(vt={}));export{x as CurrentClientBrowser,$ as CurrentClientDevice,gr as ErrorCategory,vt as InterfaceLanguage,ll as Logger,O as Observable,dt as Subject,ge as Subscription,sl as VERSION,ft as VKNumericLanguage,Cl as ValueSubject,E as VideoQuality,bl as abortable,hl as addScript,xl as areQualitiesExact,dl as assertEmptyArray,K as assertNever,ul as assertNonNullable,vl as assertNotEmptyArray,fl as assertNullable,jl as assertQualityIsExact,Vl as buffer,cl as checkNever,Ml as cloneDeep,gt as cloneDeepWith,Fl as combine,ql as debounce,_n as debounceFn,Sl as detectEmbed,Pn as fillWithDefault,Yl as filter,zl as filterChanged,Bl as fromEvent,ht as getCurrentBrowser,wl as getExponentialDelay,Rl as getHighestQuality,gl as getIOSVersion,kl as interval,El as isHigher,Tl as isHigherOrEqual,yl as isIOS,yt as isInvariantQuality,pt as isLower,Il as isLowerOrEqual,ml as isMacLike,Ol as isMobile,Ke as isNonNullable,wn as isNullable,Zl as loadVKLangPack,Gn as map,Ql as mapTo,Dl as merge,X as noop,pl as now,Ul as observableFrom,Nl as observeElementSize,Hl as once,Xl as pairwise,$l as safeStorage,Jl as tap,Kl as throttle,An as throttleFn,Ll as timeCodeToString,Gl as timeout,Pl as videoHeightToQuality,Al as videoQualityToHeight,_l as videoSizeToQuality};
package/esnext.cjs.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
- * @vkontakte/videoplayer-shared v1.0.34
3
- * Fri, 26 Apr 2024 14:08:06 GMT
4
- * https://st.mycdn.me/static/vkontakte-videoplayer/1-0-34/doc/
2
+ * @vkontakte/videoplayer-shared v1.0.35-beta.0
3
+ * Tue, 07 May 2024 23:30:33 GMT
4
+ * https://st.mycdn.me/static/vkontakte-videoplayer/1-0-35/doc/
5
5
  */
6
- "use strict";const ne="1.0.34";class C{subscriptions=[];unsubscribe(){const t=this.subscriptions;this.subscriptions=[],t.forEach(n=>typeof n=="function"?n():n.unsubscribe())}add(t){return this.subscriptions.push(t),this}}const y=e=>{throw new Error(`${e} is value of unexpected type`)},re=e=>{},S=()=>{};class f{constructor(t){t&&(this._subscribe=t)}subscribe(t,n){let r;n?typeof n=="function"?r={next:n,error:S}:r={next:o=>n.next(o),error:o=>n.error?.(o)}:r={next:S,error:S};const s=typeof t=="function"?{next:o=>{try{t(o)}catch(a){r.next(a)}},error:o=>r.next(o)}:{next:o=>t.next(o),error:o=>t.error?t.error(o):r.next(o)};let i;try{i=this._subscribe(s)}catch(o){s.error?.(o)}return new C().add(()=>{switch(s.next=S,s.error=S,typeof i){case"function":i();return;case"object":i.unsubscribe();return;case"undefined":return;default:return y(i)}})}pipe(...t){return t.reduce((n,r)=>r(n),this)}_subscribe(t){}}class P extends f{keyCounter=0;subscribers=new Map;constructor(){super()}next(t){this.subscribers.forEach(n=>n.next(t))}error(t){this.subscribers.forEach(n=>n.error?.(t))}_subscribe(t){const n=this.keyCounter++;return this.subscribers.set(n,t),new C().add(()=>this.subscribers.delete(n))}}class ie{log$=new P;logs=[];log=t=>{const n={...t,timestamp:Date.now()};this.logs.push(n),this.log$.next(n)};createCustomLog(t){return(...n)=>{let r;try{r=t(...n)}catch{r={message:"error in `createCustomLog`",component:"Logger"}}this.log(r)}}createComponentLog(t){return this.createCustomLog(n=>({component:t,...n}))}getAllLogs=()=>this.logs}function se(e,t='Assertion "value is not nullable" failed'){if(e==null)throw new Error(t)}function oe(e,t='Assertion "value is nullable" failed'){if(e!=null)throw new Error(t)}function U(e){return typeof e<"u"&&e!==null}function G(e){return e==null}function ae(e,t){if(!e?.length)throw new Error(t)}function ce(e,t){if(e?.length)throw new Error(t)}const le=(e,t,n)=>new Promise((r,s)=>{t.addEventListener("abort",()=>{a(),c.remove()});const i=()=>{a(),s()},o=()=>{a(),r()},a=()=>{d&&clearTimeout(d),c.removeEventListener("load",o),c.removeEventListener("error",i)};let d;n&&(d=window.setTimeout(i,n));const c=document.createElement("script");c.addEventListener("load",o),c.addEventListener("error",i),c.src=e,document.head.appendChild(c)}),ue=typeof window.performance?.now=="function"?()=>window.performance.now():()=>Date.now(),de=(e,t)=>async(...n)=>{const r=t(...n);let s=e.aborted,i;for(;!s&&!e.aborted;)try{const o=await r.next(i);s=o.done??!1,i=o.value}catch(o){await r.throw(o)}return i};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 I=()=>{const{userAgent:e}=window.navigator,t=/yabrowser/i.test(e)?exports.CurrentClientBrowser.Yandex:void 0,n=/chrome|crios/i.test(e)?exports.CurrentClientBrowser.Chrome:void 0,r=/chromium/i.test(e)?exports.CurrentClientBrowser.Chromium:void 0,s=/firefox|fxios/i.test(e)?exports.CurrentClientBrowser.Firefox:void 0,i=/webkit|safari|khtml/i.test(e)?exports.CurrentClientBrowser.Safari:void 0,o=/opr\//i.test(e)?exports.CurrentClientBrowser.Opera:void 0,a=/edg/i.test(e)?exports.CurrentClientBrowser.Edge:void 0,d=/android/i.test(e)?exports.CurrentClientDevice.Android:void 0,c=/iphone/i.test(e)?exports.CurrentClientDevice.iPhone:void 0,b=/ipad/i.test(e)?exports.CurrentClientDevice.iPad:void 0,h=/ipod/i.test(e)?exports.CurrentClientDevice.iPod:void 0,m=/mac/i.test(e)?exports.CurrentClientDevice.Mac:void 0,v=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(e)?exports.CurrentClientDevice.RestMobile:void 0;return{browser:t||s||o||a||n||r||i||exports.CurrentClientBrowser.Rest,device:d||c||b||h||v||m||exports.CurrentClientDevice.Desktop}},fe=(e=!1)=>{const n=[exports.CurrentClientDevice.iPhone,exports.CurrentClientDevice.iPad,exports.CurrentClientDevice.iPod].includes(I().device);if(!e)return n;const{userAgent:r,maxTouchPoints:s}=window.navigator;return!!(n||/macintosh/i.test(r)&&s>0)},he=()=>{const{userAgent:e}=window.navigator,t=e.match(/Version\/(\d+(\.\d+)?)/i);if(!t)return null;const n=t[1],r=parseFloat(n);return isNaN(r)?null:r},be=()=>[exports.CurrentClientDevice.Mac,exports.CurrentClientDevice.iPhone,exports.CurrentClientDevice.iPad,exports.CurrentClientDevice.iPod].includes(I().device),ge=()=>/Mobile|mini|Fennec|Android|iP(ad|od|hone)/.test(navigator.appVersion??navigator.userAgent)||navigator?.userAgentData?.mobile,we=(e,{start:t=0,factor:n=2,max:r=1/0,min:s=t,random:i=0}={})=>{let o=t;return o*=n**e,o*=1+(Math.random()*i*2-i),o=Math.round(o),o=Math.min(o,r),o=Math.max(o,s),o};var u;(function(e){e[e.LOCAL_STORAGE=0]="LOCAL_STORAGE",e[e.SESSION_STORAGE=1]="SESSION_STORAGE",e[e.RUNTIME=2]="RUNTIME"})(u||(u={}));let A,E;const _=`vk-videoplayer-dummy-key-${Math.random()}`,O=()=>{if(E!==void 0)return E;try{localStorage.setItem(_,"test"),localStorage.removeItem(_),E=u.LOCAL_STORAGE}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem(_),E=u.SESSION_STORAGE}catch(t){if(t instanceof DOMException||t instanceof TypeError)E=u.RUNTIME;else throw t}else throw e}return E===u.RUNTIME&&(A=new Map),E},me=()=>O()===u.LOCAL_STORAGE,pe=e=>{const t=O();switch(t){case u.LOCAL_STORAGE:return localStorage.getItem(e)??void 0;case u.SESSION_STORAGE:return sessionStorage.getItem(e)??void 0;case u.RUNTIME:return A?.get(e);default:y(t)}},Ee=(e,t)=>{const n=O();switch(n){case u.LOCAL_STORAGE:try{localStorage.setItem(e,t)}catch(r){if(r instanceof DOMException)console.error(r);else throw r}break;case u.SESSION_STORAGE:try{sessionStorage.setItem(e,t)}catch(r){if(r instanceof DOMException)console.error(r);else throw r}break;case u.RUNTIME:return void A?.set(e,t);default:y(n)}},ye=e=>{const t=O();switch(t){case u.LOCAL_STORAGE:return e in localStorage;case u.SESSION_STORAGE:return e in sessionStorage;case u.RUNTIME:return A?.has(e)??!1;default:return y(t),!1}},ve=e=>{const t=O();switch(t){case u.LOCAL_STORAGE:return localStorage.removeItem(e);case u.SESSION_STORAGE:return sessionStorage.removeItem(e);case u.RUNTIME:return void A?.delete(e);default:y(t)}},Se=()=>{const e=O();switch(e){case u.LOCAL_STORAGE:return localStorage.clear();case u.SESSION_STORAGE:return sessionStorage.clear();case u.RUNTIME:return A?.clear();default:y(e)}};var Ae=Object.freeze({__proto__:null,clear:Se,get:pe,has:ye,isPersistent:me,remove:ve,set:Ee});const Oe=()=>{let e,t;try{e=window.self!==window.top}catch(r){r instanceof DOMException&&r.name==="SecurityError"?e=!0:(e=!1,console.error(r))}try{window.location.ancestorOrigins&&(t=window.location.ancestorOrigins[window.location.ancestorOrigins.length-1])}catch(r){console.error(r)}try{!t&&document.referrer&&(t=document.referrer)}catch(r){console.error(r)}const n=t?new URL(t).hostname:void 0;return{isEmbed:e,host:n}};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 g={[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}},xe=(e,t)=>g[e].height>g[t].height,Ce=(e,t)=>g[e].height>=g[t].height,N=(e,t)=>g[e].height<g[t].height,Le=(e,t)=>g[e].height<=g[t].height,Re=e=>e.sort((t,n)=>t===n?0:t===exports.VideoQuality.INVARIANT?1:n===exports.VideoQuality.INVARIANT?-1:N(t,n)?1:-1)[0],B=Object.keys(g).sort((e,t)=>N(e,t)?-1:1),Te=(e,t=.02)=>[...B].find(r=>g[r].height*(1+t)>=e),_e=({width:e,height:t})=>{const n=Math.min(e,t),r=Math.max(e,t);return B.find(s=>{const i=g[s];return i.width>=r&&i.height>=n})},Pe=e=>g[e].height,M=e=>e===exports.VideoQuality.INVARIANT,Ie=e=>e.every(t=>!M(t));function Ne(e){if(M(e))throw new Error("Expected exact quality")}const W=(e,t)=>{const n={};for(const r of Object.keys(t)){const s=t[r],i=e[r];Array.isArray(s)&&Array.isArray(i)?n[r]=i:typeof s=="object"&&typeof i=="object"?n[r]=W(i,s):n[r]=r in e?i:s}return n},Me=e=>{let t="";return e>=3600&&(t+=Math.floor(e/3600)+"h",e=e%3600),e>=60&&(t+=Math.floor(e/60)+"m",e=e%60),e>0&&(t+=Math.floor(e)+"s"),t};function De(e,t=0,n){let r,s,i,o,a,d,c=0,b=!1,h=!1,m=!0;const v=!t&&t!==0&&typeof window.requestAnimationFrame=="function";n&&(b=!!n.leading,h="maxWait"in n,i=n?.maxWait?Math.max(+n?.maxWait||0,t):i,m="trailing"in n?!!n.trailing:m);function x(l){const w=r,p=s;return r=s=void 0,c=l,o=e.apply(p,w),o}function L(l,w){return v?(a&&window.cancelAnimationFrame(a),window.requestAnimationFrame(l)):setTimeout(l,w)}function K(l){if(v){window.cancelAnimationFrame(l);return}clearTimeout(l)}function X(l){return c=l,a=L(R,t),b?x(l):o}function J(l){const w=l-d,p=l-c,F=t-w;return h?Math.min(F,i-p):F}function V(l){const w=l-d,p=l-c;return d===void 0||w>=t||w<0||h&&p>=i}function R(){const l=Date.now();if(V(l))return k(l);a=L(R,J(l))}function k(l){return a=void 0,m&&r?x(l):(r=s=void 0,o)}function Z(){a!==void 0&&K(a),c=0,r=d=s=a=void 0}function ee(){return a===void 0?o:k(Date.now())}function te(){return a!==void 0}function T(...l){const w=Date.now(),p=V(w);if(r=l,s=this,d=w,p){if(a===void 0)return X(d);if(h)return a=L(R,t),x(d)}return a===void 0&&(a=L(R,t)),o}return T.cancel=Z,T.flush=ee,T.pending=te,T}const D=(e,t)=>{if(e===null||typeof e!="object")return e;const n=Array.isArray(e)?[]:{};for(const r in e){if(typeof t=="function"){const s=t(e[r],r,e,n);if(s!==void 0){n[r]=s;continue}}typeof e[r]=="object"?n[r]=D(e[r],t):n[r]=e[r]}return n},Qe=e=>D(e);class Ve extends P{value;constructor(t){super(),this.value=t}next(t){super.next(this.value=t)}error(t){super.error(this.value=t)}getValue(){return this.value}_subscribe(t){const n=super._subscribe(t);return t.next(this.value),n}}function ke(e){return new f(t=>{const n={};let r=Object.keys(e).length;const s=i=>o=>{i in n||r--,n[i]=o,r===0&&t.next(n)};return Object.entries(e).reduce((i,[o,a])=>i.add(a.subscribe(s(o))),new C)})}function Fe(...e){return new f(t=>e.reduce((n,r)=>n.add(r.subscribe(t)),new C))}var qe=e=>new f(t=>{const n=window.setTimeout(()=>{try{t.next()}catch(r){if(t.error)t.error(r);else throw r}},e);return()=>window.clearTimeout(n)}),je=e=>new f(t=>{const n=window.setInterval(()=>t.next(),e);return()=>window.clearInterval(n)}),Ue=e=>new f(t=>{e.forEach(n=>t.next(n))}),Ge=(e,t)=>new f(n=>{const r=s=>n.next(s);return e.addEventListener(t,r),()=>e.removeEventListener(t,r)});function Be(e){return t=>new f(n=>t.subscribe(new We(n,e)))}class We{destination;size;lastValues=[];constructor(t,n){this.destination=t,this.size=n}next(t){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(t),this.destination.next(this.lastValues)}error(t){this.destination.error?.(t)}}const He={leading:!1,trailing:!0};function ze(e,t=He){return n=>new f(r=>n.subscribe(new $e(r,e,t)))}class $e{destination;time;config;lastValue;timeout;constructor(t,n,r){this.destination=t,this.time=n,this.config=r}next(t){this.lastValue=t,U(this.timeout)?window.clearTimeout(this.timeout):this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout(()=>{if(this.config.trailing)try{this.destination.next(this.lastValue)}catch(n){if(this.destination.error)this.destination.error(n);else throw n}this.timeout=void 0},this.time)}error(t){this.destination.error?.(t)}}const Ye={leading:!0,trailing:!1};function Ke(e,t=Ye){return n=>new f(r=>n.subscribe(new Xe(r,e,t)))}class Xe{destination;time;config;lastValue;timeout;constructor(t,n,r){this.destination=t,this.time=n,this.config=r}next(t){this.lastValue=t,G(this.timeout)&&(this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout(()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0},this.time))}error(t){this.destination.error?.(t)}}function Je(e){return t=>new f(n=>t.subscribe(new Ze(n,e)))}class Ze{destination;predicate;constructor(t,n){this.destination=t,this.predicate=n}next(t){let n;try{n=this.predicate(t)}catch(r){throw this.error(r),r}n&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function et(e=(t,n)=>t===n){return t=>new f(n=>t.subscribe(new tt(n,e)))}const q={};class tt{destination;predicate;lastValue=q;constructor(t,n){this.destination=t,this.predicate=n}next(t){let n;try{n=this.lastValue===q||!this.predicate(this.lastValue,t),this.lastValue=t}catch(r){throw this.error(r),r}n&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function H(e){return t=>new f(n=>t.subscribe(new nt(n,e)))}let nt=class{destination;mapper;constructor(t,n){this.destination=t,this.mapper=n}next(t){let n;try{n=this.mapper(t)}catch(r){throw this.error(r),r}this.destination.next(n)}error(t){this.destination.error?.(t)}};function rt(e){return H(()=>e)}function it(){return e=>new f(t=>{let n=!1,r=!1;const s=e.subscribe(i=>{n||(n=!0,t.next(i)),r&&s.unsubscribe()},i=>{n=!0,t.error?.(i),r&&s.unsubscribe()});return r=!0,n&&s.unsubscribe(),s})}function st(){return e=>new f(t=>e.subscribe(new ot(t)))}class ot{destination;last;hasLast=!1;constructor(t){this.destination=t}next(t){const n=this.last;if(this.last=t,!this.hasLast){this.hasLast=!0;return}this.destination.next([n,t])}error(t){this.destination.error?.(t)}}function at(e){return t=>new f(n=>t.subscribe(new ct(n,e)))}class ct{destination;effect;constructor(t,n){this.destination=t,this.effect=n}next(t){try{this.effect(t)}catch(n){throw this.error(n),n}this.destination.next(t)}error(t){this.destination.error?.(t)}}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"})(exports.ErrorCategory||(exports.ErrorCategory={}));class j{constructor(){Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}addEventListener(t,n,r){t in this.listeners||(this.listeners[t]=[]),this.listeners[t].push({callback:n,options:r})}removeEventListener(t,n){if(!(t in this.listeners))return;const r=this.listeners[t];for(let s=0,i=r.length;s<i;s++)if(r[s].callback===n){r.splice(s,1);return}}dispatchEvent(t){if(!(t.type in this.listeners))return;const r=this.listeners[t.type].slice();for(let s=0,i=r.length;s<i;s++){const o=r[s];try{o.callback.call(this,t)}catch(a){Promise.resolve().then(()=>{throw a})}o.options&&o.options.once&&this.removeEventListener(t.type,o.callback)}return!t.defaultPrevented}}class z extends j{constructor(){super(),this.listeners||j.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(t){t.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,t)),super.dispatchEvent(t)}}class lt{constructor(){Object.defineProperty(this,"signal",{value:new z,writable:!0,configurable:!0})}abort(t){let n;try{n=new Event("abort")}catch{typeof document<"u"?document.createEvent?(n=document.createEvent("Event"),n.initEvent("abort",!1,!1)):(n=document.createEventObject(),n.type="abort"):n={type:"abort",bubbles:!1,cancelable:!1}}let r=t;if(r===void 0)if(typeof document>"u")r=new Error("This operation was aborted"),r.name="AbortError";else try{r=new DOMException("signal is aborted without reason")}catch{r=new Error("This operation was aborted"),r.name="AbortError"}this.signal.reason=r,this.signal.dispatchEvent(n)}toString(){return"[object AbortController]"}}typeof Symbol<"u"&&Symbol.toStringTag&&(lt.prototype[Symbol.toStringTag]="AbortController",z.prototype[Symbol.toStringTag]="AbortSignal");function $(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 ut(e){typeof e=="function"&&(e={fetch:e});const{fetch:t,Request:n=t.Request,AbortController:r,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:s=!1}=e;if(!$({fetch:t,Request:n,AbortController:r,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:s}))return{fetch:t,Request:i};let i=n;(i&&!i.prototype.hasOwnProperty("signal")||s)&&(i=function(c,b){let h;b&&b.signal&&(h=b.signal,delete b.signal);const m=new n(c,b);return h&&Object.defineProperty(m,"signal",{writable:!1,enumerable:!1,configurable:!0,value:h}),m},i.prototype=n.prototype);const o=t;return{fetch:(d,c)=>{const b=i&&i.prototype.isPrototypeOf(d)?d.signal:c?c.signal:void 0;if(b){let h;try{h=new DOMException("Aborted","AbortError")}catch{h=new Error("Aborted"),h.name="AbortError"}if(b.aborted)return Promise.reject(h);const m=new Promise((v,x)=>{b.addEventListener("abort",()=>x(h),{once:!0})});return c&&c.signal&&delete c.signal,Promise.race([m,o(d,c)])}return o(d,c)},Request:i}}const Q=$({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),Y=Q?ut({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,dt=Q?Y.fetch:window.fetch;Q?Y.Request:window.Request;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 ft="vk.com",ht=async(e,t,n)=>{const r=new URL(`https://${ft}/js/lang-pack.js`);r.searchParams.set("format","json"),r.searchParams.set("name",t),e!==void 0&&r.searchParams.set("lang",e);const i=await(await dt(r.toString())).json();return bt(i,n)},bt=(e,t)=>Object.fromEntries(Object.entries(e.keys).map(([n,r])=>[n.substring(`${t}_`.length),gt(r)])),gt=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=ie;exports.Observable=f;exports.Subject=P;exports.Subscription=C;exports.VERSION=ne;exports.ValueSubject=Ve;exports.abortable=de;exports.addScript=le;exports.areQualitiesExact=Ie;exports.assertEmptyArray=ce;exports.assertNever=y;exports.assertNonNullable=se;exports.assertNotEmptyArray=ae;exports.assertNullable=oe;exports.assertQualityIsExact=Ne;exports.buffer=Be;exports.checkNever=re;exports.cloneDeep=Qe;exports.cloneDeepWith=D;exports.combine=ke;exports.debounce=ze;exports.debounceFn=De;exports.detectEmbed=Oe;exports.fillWithDefault=W;exports.filter=Je;exports.filterChanged=et;exports.fromEvent=Ge;exports.getCurrentBrowser=I;exports.getExponentialDelay=we;exports.getHighestQuality=Re;exports.getIOSVersion=he;exports.interval=je;exports.isHigher=xe;exports.isHigherOrEqual=Ce;exports.isIOS=fe;exports.isInvariantQuality=M;exports.isLower=N;exports.isLowerOrEqual=Le;exports.isMacLike=be;exports.isMobile=ge;exports.isNonNullable=U;exports.isNullable=G;exports.loadVKLangPack=ht;exports.map=H;exports.mapTo=rt;exports.merge=Fe;exports.noop=S;exports.now=ue;exports.observableFrom=Ue;exports.once=it;exports.pairwise=st;exports.safeStorage=Ae;exports.tap=at;exports.throttle=Ke;exports.timeCodeToString=Me;exports.timeout=qe;exports.videoHeightToQuality=Te;exports.videoQualityToHeight=Pe;exports.videoSizeToQuality=_e;
6
+ "use strict";const ie="1.0.35-beta.0";class R{subscriptions=[];unsubscribe(){const t=this.subscriptions;this.subscriptions=[],t.forEach(n=>typeof n=="function"?n():n.unsubscribe())}add(t){return this.subscriptions.push(t),this}}const y=e=>{throw new Error(`${e} is value of unexpected type`)},se=e=>{},S=()=>{};class f{constructor(t){t&&(this._subscribe=t)}subscribe(t,n){let r;n?typeof n=="function"?r={next:n,error:S}:r={next:o=>n.next(o),error:o=>n.error?.(o)}:r={next:S,error:S};const s=typeof t=="function"?{next:o=>{try{t(o)}catch(a){r.next(a)}},error:o=>r.next(o)}:{next:o=>t.next(o),error:o=>t.error?t.error(o):r.next(o)};let i;try{i=this._subscribe(s)}catch(o){s.error?.(o)}return new R().add(()=>{switch(s.next=S,s.error=S,typeof i){case"function":i();return;case"object":i.unsubscribe();return;case"undefined":return;default:return y(i)}})}pipe(...t){return t.reduce((n,r)=>r(n),this)}_subscribe(t){}}class I extends f{keyCounter=0;subscribers=new Map;constructor(){super()}next(t){this.subscribers.forEach(n=>n.next(t))}error(t){this.subscribers.forEach(n=>n.error?.(t))}_subscribe(t){const n=this.keyCounter++;return this.subscribers.set(n,t),new R().add(()=>this.subscribers.delete(n))}}class oe{log$=new I;logs=[];log=t=>{const n={...t,timestamp:Date.now()};this.logs.push(n),this.log$.next(n)};createCustomLog(t){return(...n)=>{let r;try{r=t(...n)}catch{r={message:"error in `createCustomLog`",component:"Logger"}}this.log(r)}}createComponentLog(t){return this.createCustomLog(n=>({component:t,...n}))}getAllLogs=()=>this.logs}function ae(e,t='Assertion "value is not nullable" failed'){if(e==null)throw new Error(t)}function ce(e,t='Assertion "value is nullable" failed'){if(e!=null)throw new Error(t)}function _(e){return typeof e<"u"&&e!==null}function z(e){return e==null}function le(e,t){if(!e?.length)throw new Error(t)}function ue(e,t){if(e?.length)throw new Error(t)}const de=(e,t,n)=>new Promise((r,s)=>{t.addEventListener("abort",()=>{a(),c.remove()});const i=()=>{a(),s()},o=()=>{a(),r()},a=()=>{l&&clearTimeout(l),c.removeEventListener("load",o),c.removeEventListener("error",i)};let l;n&&(l=window.setTimeout(i,n));const c=document.createElement("script");c.addEventListener("load",o),c.addEventListener("error",i),c.src=e,document.head.appendChild(c)}),fe=typeof window.performance?.now=="function"?()=>window.performance.now():()=>Date.now(),he=(e,t)=>async(...n)=>{const r=t(...n);let s=e.aborted,i;for(;!s&&!e.aborted;)try{const o=await r.next(i);s=o.done??!1,i=o.value}catch(o){await r.throw(o)}return i};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 N=()=>{const{userAgent:e}=window.navigator,t=/yabrowser/i.test(e)?exports.CurrentClientBrowser.Yandex:void 0,n=/chrome|crios/i.test(e)?exports.CurrentClientBrowser.Chrome:void 0,r=/chromium/i.test(e)?exports.CurrentClientBrowser.Chromium:void 0,s=/firefox|fxios/i.test(e)?exports.CurrentClientBrowser.Firefox:void 0,i=/webkit|safari|khtml/i.test(e)?exports.CurrentClientBrowser.Safari:void 0,o=/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,b=/ipad/i.test(e)?exports.CurrentClientDevice.iPad:void 0,h=/ipod/i.test(e)?exports.CurrentClientDevice.iPod:void 0,m=/mac/i.test(e)?exports.CurrentClientDevice.Mac:void 0,v=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(e)?exports.CurrentClientDevice.RestMobile:void 0;return{browser:t||s||o||a||n||r||i||exports.CurrentClientBrowser.Rest,device:l||c||b||h||v||m||exports.CurrentClientDevice.Desktop}},be=(e=!1)=>{const n=[exports.CurrentClientDevice.iPhone,exports.CurrentClientDevice.iPad,exports.CurrentClientDevice.iPod].includes(N().device);if(!e)return n;const{userAgent:r,maxTouchPoints:s}=window.navigator;return!!(n||/macintosh/i.test(r)&&s>0)},ge=()=>{const{userAgent:e}=window.navigator,t=e.match(/Version\/(\d+(\.\d+)?)/i);if(!t)return null;const n=t[1],r=parseFloat(n);return isNaN(r)?null:r},we=()=>[exports.CurrentClientDevice.Mac,exports.CurrentClientDevice.iPhone,exports.CurrentClientDevice.iPad,exports.CurrentClientDevice.iPod].includes(N().device),me=()=>/Mobile|mini|Fennec|Android|iP(ad|od|hone)/.test(navigator.appVersion??navigator.userAgent)||navigator?.userAgentData?.mobile,pe=(e,{start:t=0,factor:n=2,max:r=1/0,min:s=t,random:i=0}={})=>{let o=t;return o*=n**e,o*=1+(Math.random()*i*2-i),o=Math.round(o),o=Math.min(o,r),o=Math.max(o,s),o};var d;(function(e){e[e.LOCAL_STORAGE=0]="LOCAL_STORAGE",e[e.SESSION_STORAGE=1]="SESSION_STORAGE",e[e.RUNTIME=2]="RUNTIME"})(d||(d={}));let O,E;const P=`vk-videoplayer-dummy-key-${Math.random()}`,A=()=>{if(E!==void 0)return E;try{localStorage.setItem(P,"test"),localStorage.removeItem(P),E=d.LOCAL_STORAGE}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem(P),E=d.SESSION_STORAGE}catch(t){if(t instanceof DOMException||t instanceof TypeError)E=d.RUNTIME;else throw t}else throw e}return E===d.RUNTIME&&(O=new Map),E},Ee=()=>A()===d.LOCAL_STORAGE,ye=e=>{const t=A();switch(t){case d.LOCAL_STORAGE:return localStorage.getItem(e)??void 0;case d.SESSION_STORAGE:return sessionStorage.getItem(e)??void 0;case d.RUNTIME:return O?.get(e);default:y(t)}},ve=(e,t)=>{const n=A();switch(n){case d.LOCAL_STORAGE:try{localStorage.setItem(e,t)}catch(r){if(r instanceof DOMException)console.error(r);else throw r}break;case d.SESSION_STORAGE:try{sessionStorage.setItem(e,t)}catch(r){if(r instanceof DOMException)console.error(r);else throw r}break;case d.RUNTIME:return void O?.set(e,t);default:y(n)}},Se=e=>{const t=A();switch(t){case d.LOCAL_STORAGE:return e in localStorage;case d.SESSION_STORAGE:return e in sessionStorage;case d.RUNTIME:return O?.has(e)??!1;default:return y(t),!1}},Oe=e=>{const t=A();switch(t){case d.LOCAL_STORAGE:return localStorage.removeItem(e);case d.SESSION_STORAGE:return sessionStorage.removeItem(e);case d.RUNTIME:return void O?.delete(e);default:y(t)}},Ae=()=>{const e=A();switch(e){case d.LOCAL_STORAGE:return localStorage.clear();case d.SESSION_STORAGE:return sessionStorage.clear();case d.RUNTIME:return O?.clear();default:y(e)}};var xe=Object.freeze({__proto__:null,clear:Ae,get:ye,has:Se,isPersistent:Ee,remove:Oe,set:ve});const Re=()=>{let e,t;try{e=window.self!==window.top}catch(r){r instanceof DOMException&&r.name==="SecurityError"?e=!0:(e=!1,console.error(r))}try{window.location.ancestorOrigins&&(t=window.location.ancestorOrigins[window.location.ancestorOrigins.length-1])}catch(r){console.error(r)}try{!t&&document.referrer&&(t=document.referrer)}catch(r){console.error(r)}const n=t?new URL(t).hostname:void 0;return{isEmbed:e,host:n}};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 g={[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}},Ce=(e,t)=>g[e].height>g[t].height,Le=(e,t)=>g[e].height>=g[t].height,M=(e,t)=>g[e].height<g[t].height,Te=(e,t)=>g[e].height<=g[t].height,_e=e=>e.sort((t,n)=>t===n?0:t===exports.VideoQuality.INVARIANT?1:n===exports.VideoQuality.INVARIANT?-1:M(t,n)?1:-1)[0],B=Object.keys(g).sort((e,t)=>M(e,t)?-1:1),Pe=(e,t=.02)=>[...B].find(r=>g[r].height*(1+t)>=e),Ie=({width:e,height:t})=>{const n=Math.min(e,t),r=Math.max(e,t);return B.find(s=>{const i=g[s];return i.width>=r&&i.height>=n})},Ne=e=>g[e].height,D=e=>e===exports.VideoQuality.INVARIANT,Me=e=>e.every(t=>!D(t));function De(e){if(D(e))throw new Error("Expected exact quality")}const G=(e,t)=>{const n={};for(const r of Object.keys(t)){const s=t[r],i=e[r];Array.isArray(s)&&Array.isArray(i)?n[r]=i:typeof s=="object"&&typeof i=="object"?n[r]=G(i,s):n[r]=r in e?i:s}return n},Qe=e=>{let t="";return e>=3600&&(t+=Math.floor(e/3600)+"h",e=e%3600),e>=60&&(t+=Math.floor(e/60)+"m",e=e%60),e>0&&(t+=Math.floor(e)+"s"),t};function W(e,t=0,n){let r,s,i,o,a,l,c=0,b=!1,h=!1,m=!0;const v=!t&&t!==0&&typeof window.requestAnimationFrame=="function";n&&(b=!!n.leading,h="maxWait"in n,i=n?.maxWait?Math.max(+n?.maxWait||0,t):i,m="trailing"in n?!!n.trailing:m);function x(u){const w=r,p=s;return r=s=void 0,c=u,o=e.apply(p,w),o}function C(u,w){return v?(a&&window.cancelAnimationFrame(a),window.requestAnimationFrame(u)):setTimeout(u,w)}function J(u){if(v){window.cancelAnimationFrame(u);return}clearTimeout(u)}function Z(u){return c=u,a=C(L,t),b?x(u):o}function ee(u){const w=u-l,p=u-c,q=t-w;return h?Math.min(q,i-p):q}function k(u){const w=u-l,p=u-c;return l===void 0||w>=t||w<0||h&&p>=i}function L(){const u=Date.now();if(k(u))return F(u);a=C(L,ee(u))}function F(u){return a=void 0,m&&r?x(u):(r=s=void 0,o)}function te(){a!==void 0&&J(a),c=0,r=l=s=a=void 0}function ne(){return a===void 0?o:F(Date.now())}function re(){return a!==void 0}function T(...u){const w=Date.now(),p=k(w);if(r=u,s=this,l=w,p){if(a===void 0)return Z(l);if(h)return a=C(L,t),x(l)}return a===void 0&&(a=C(L,t)),o}return T.cancel=te,T.flush=ne,T.pending=re,T}const H=(e,t=0,n)=>W(e,t,{...{leading:!0,trailing:!0},...n,maxWait:t}),Q=(e,t)=>{if(e===null||typeof e!="object")return e;const n=Array.isArray(e)?[]:{};for(const r in e){if(typeof t=="function"){const s=t(e[r],r,e,n);if(s!==void 0){n[r]=s;continue}}typeof e[r]=="object"?n[r]=Q(e[r],t):n[r]=e[r]}return n},Ve=e=>Q(e),ke=300,Fe=(e,t=ke)=>new f(n=>{const{width:r,height:s}=e.getBoundingClientRect();if(n.next({width:r,height:s}),!window.ResizeObserver)return;const i=new ResizeObserver(H(o=>{const a=o[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),_(l)&&_(c)&&n.next({width:l,height:c})},t));return i.observe(e),()=>i.disconnect()});class qe extends I{value;constructor(t){super(),this.value=t}next(t){super.next(this.value=t)}error(t){super.error(this.value=t)}getValue(){return this.value}_subscribe(t){const n=super._subscribe(t);return t.next(this.value),n}}function je(e){return new f(t=>{const n={};let r=Object.keys(e).length;const s=i=>o=>{i in n||r--,n[i]=o,r===0&&t.next(n)};return Object.entries(e).reduce((i,[o,a])=>i.add(a.subscribe(s(o))),new R)})}function Ue(...e){return new f(t=>e.reduce((n,r)=>n.add(r.subscribe(t)),new R))}var ze=e=>new f(t=>{const n=window.setTimeout(()=>{try{t.next()}catch(r){if(t.error)t.error(r);else throw r}},e);return()=>window.clearTimeout(n)}),Be=e=>new f(t=>{const n=window.setInterval(()=>t.next(),e);return()=>window.clearInterval(n)}),Ge=e=>new f(t=>{e.forEach(n=>t.next(n))}),We=(e,t)=>new f(n=>{const r=s=>n.next(s);return e.addEventListener(t,r),()=>e.removeEventListener(t,r)});function He(e){return t=>new f(n=>t.subscribe(new $e(n,e)))}class $e{destination;size;lastValues=[];constructor(t,n){this.destination=t,this.size=n}next(t){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(t),this.destination.next(this.lastValues)}error(t){this.destination.error?.(t)}}const Ye={leading:!1,trailing:!0};function Ke(e,t=Ye){return n=>new f(r=>n.subscribe(new Xe(r,e,t)))}class Xe{destination;time;config;lastValue;timeout;constructor(t,n,r){this.destination=t,this.time=n,this.config=r}next(t){this.lastValue=t,_(this.timeout)?window.clearTimeout(this.timeout):this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout(()=>{if(this.config.trailing)try{this.destination.next(this.lastValue)}catch(n){if(this.destination.error)this.destination.error(n);else throw n}this.timeout=void 0},this.time)}error(t){this.destination.error?.(t)}}const Je={leading:!0,trailing:!1};function Ze(e,t=Je){return n=>new f(r=>n.subscribe(new et(r,e,t)))}class et{destination;time;config;lastValue;timeout;constructor(t,n,r){this.destination=t,this.time=n,this.config=r}next(t){this.lastValue=t,z(this.timeout)&&(this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout(()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0},this.time))}error(t){this.destination.error?.(t)}}function tt(e){return t=>new f(n=>t.subscribe(new nt(n,e)))}class nt{destination;predicate;constructor(t,n){this.destination=t,this.predicate=n}next(t){let n;try{n=this.predicate(t)}catch(r){throw this.error(r),r}n&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function rt(e=(t,n)=>t===n){return t=>new f(n=>t.subscribe(new it(n,e)))}const j={};class it{destination;predicate;lastValue=j;constructor(t,n){this.destination=t,this.predicate=n}next(t){let n;try{n=this.lastValue===j||!this.predicate(this.lastValue,t),this.lastValue=t}catch(r){throw this.error(r),r}n&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function $(e){return t=>new f(n=>t.subscribe(new st(n,e)))}let st=class{destination;mapper;constructor(t,n){this.destination=t,this.mapper=n}next(t){let n;try{n=this.mapper(t)}catch(r){throw this.error(r),r}this.destination.next(n)}error(t){this.destination.error?.(t)}};function ot(e){return $(()=>e)}function at(){return e=>new f(t=>{let n=!1,r=!1;const s=e.subscribe(i=>{n||(n=!0,t.next(i)),r&&s.unsubscribe()},i=>{n=!0,t.error?.(i),r&&s.unsubscribe()});return r=!0,n&&s.unsubscribe(),s})}function ct(){return e=>new f(t=>e.subscribe(new lt(t)))}class lt{destination;last;hasLast=!1;constructor(t){this.destination=t}next(t){const n=this.last;if(this.last=t,!this.hasLast){this.hasLast=!0;return}this.destination.next([n,t])}error(t){this.destination.error?.(t)}}function ut(e){return t=>new f(n=>t.subscribe(new dt(n,e)))}class dt{destination;effect;constructor(t,n){this.destination=t,this.effect=n}next(t){try{this.effect(t)}catch(n){throw this.error(n),n}this.destination.next(t)}error(t){this.destination.error?.(t)}}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"})(exports.ErrorCategory||(exports.ErrorCategory={}));class U{constructor(){Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}addEventListener(t,n,r){t in this.listeners||(this.listeners[t]=[]),this.listeners[t].push({callback:n,options:r})}removeEventListener(t,n){if(!(t in this.listeners))return;const r=this.listeners[t];for(let s=0,i=r.length;s<i;s++)if(r[s].callback===n){r.splice(s,1);return}}dispatchEvent(t){if(!(t.type in this.listeners))return;const r=this.listeners[t.type].slice();for(let s=0,i=r.length;s<i;s++){const o=r[s];try{o.callback.call(this,t)}catch(a){Promise.resolve().then(()=>{throw a})}o.options&&o.options.once&&this.removeEventListener(t.type,o.callback)}return!t.defaultPrevented}}class Y extends U{constructor(){super(),this.listeners||U.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(t){t.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,t)),super.dispatchEvent(t)}}class ft{constructor(){Object.defineProperty(this,"signal",{value:new Y,writable:!0,configurable:!0})}abort(t){let n;try{n=new Event("abort")}catch{typeof document<"u"?document.createEvent?(n=document.createEvent("Event"),n.initEvent("abort",!1,!1)):(n=document.createEventObject(),n.type="abort"):n={type:"abort",bubbles:!1,cancelable:!1}}let r=t;if(r===void 0)if(typeof document>"u")r=new Error("This operation was aborted"),r.name="AbortError";else try{r=new DOMException("signal is aborted without reason")}catch{r=new Error("This operation was aborted"),r.name="AbortError"}this.signal.reason=r,this.signal.dispatchEvent(n)}toString(){return"[object AbortController]"}}typeof Symbol<"u"&&Symbol.toStringTag&&(ft.prototype[Symbol.toStringTag]="AbortController",Y.prototype[Symbol.toStringTag]="AbortSignal");function K(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 ht(e){typeof e=="function"&&(e={fetch:e});const{fetch:t,Request:n=t.Request,AbortController:r,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:s=!1}=e;if(!K({fetch:t,Request:n,AbortController:r,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:s}))return{fetch:t,Request:i};let i=n;(i&&!i.prototype.hasOwnProperty("signal")||s)&&(i=function(c,b){let h;b&&b.signal&&(h=b.signal,delete b.signal);const m=new n(c,b);return h&&Object.defineProperty(m,"signal",{writable:!1,enumerable:!1,configurable:!0,value:h}),m},i.prototype=n.prototype);const o=t;return{fetch:(l,c)=>{const b=i&&i.prototype.isPrototypeOf(l)?l.signal:c?c.signal:void 0;if(b){let h;try{h=new DOMException("Aborted","AbortError")}catch{h=new Error("Aborted"),h.name="AbortError"}if(b.aborted)return Promise.reject(h);const m=new Promise((v,x)=>{b.addEventListener("abort",()=>x(h),{once:!0})});return c&&c.signal&&delete c.signal,Promise.race([m,o(l,c)])}return o(l,c)},Request:i}}const V=K({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),X=V?ht({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,bt=V?X.fetch:window.fetch;V?X.Request:window.Request;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 gt="vk.com",wt=async(e,t,n)=>{const r=new URL(`https://${gt}/js/lang-pack.js`);r.searchParams.set("format","json"),r.searchParams.set("name",t),e!==void 0&&r.searchParams.set("lang",e);const i=await(await bt(r.toString())).json();return mt(i,n)},mt=(e,t)=>Object.fromEntries(Object.entries(e.keys).map(([n,r])=>[n.substring(`${t}_`.length),pt(r)])),pt=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=oe;exports.Observable=f;exports.Subject=I;exports.Subscription=R;exports.VERSION=ie;exports.ValueSubject=qe;exports.abortable=he;exports.addScript=de;exports.areQualitiesExact=Me;exports.assertEmptyArray=ue;exports.assertNever=y;exports.assertNonNullable=ae;exports.assertNotEmptyArray=le;exports.assertNullable=ce;exports.assertQualityIsExact=De;exports.buffer=He;exports.checkNever=se;exports.cloneDeep=Ve;exports.cloneDeepWith=Q;exports.combine=je;exports.debounce=Ke;exports.debounceFn=W;exports.detectEmbed=Re;exports.fillWithDefault=G;exports.filter=tt;exports.filterChanged=rt;exports.fromEvent=We;exports.getCurrentBrowser=N;exports.getExponentialDelay=pe;exports.getHighestQuality=_e;exports.getIOSVersion=ge;exports.interval=Be;exports.isHigher=Ce;exports.isHigherOrEqual=Le;exports.isIOS=be;exports.isInvariantQuality=D;exports.isLower=M;exports.isLowerOrEqual=Te;exports.isMacLike=we;exports.isMobile=me;exports.isNonNullable=_;exports.isNullable=z;exports.loadVKLangPack=wt;exports.map=$;exports.mapTo=ot;exports.merge=Ue;exports.noop=S;exports.now=fe;exports.observableFrom=Ge;exports.observeElementSize=Fe;exports.once=at;exports.pairwise=ct;exports.safeStorage=xe;exports.tap=ut;exports.throttle=Ze;exports.throttleFn=H;exports.timeCodeToString=Qe;exports.timeout=ze;exports.videoHeightToQuality=Pe;exports.videoQualityToHeight=Ne;exports.videoSizeToQuality=Ie;
package/esnext.esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
- * @vkontakte/videoplayer-shared v1.0.34
3
- * Fri, 26 Apr 2024 14:08:06 GMT
4
- * https://st.mycdn.me/static/vkontakte-videoplayer/1-0-34/doc/
2
+ * @vkontakte/videoplayer-shared v1.0.35-beta.0
3
+ * Tue, 07 May 2024 23:30:33 GMT
4
+ * https://st.mycdn.me/static/vkontakte-videoplayer/1-0-35/doc/
5
5
  */
6
- const Te="1.0.34";class M{subscriptions=[];unsubscribe(){const t=this.subscriptions;this.subscriptions=[],t.forEach(n=>typeof n=="function"?n():n.unsubscribe())}add(t){return this.subscriptions.push(t),this}}const v=e=>{throw new Error(`${e} is value of unexpected type`)},Ie=e=>{},L=()=>{};class b{constructor(t){t&&(this._subscribe=t)}subscribe(t,n){let r;n?typeof n=="function"?r={next:n,error:L}:r={next:o=>n.next(o),error:o=>n.error?.(o)}:r={next:L,error:L};const s=typeof t=="function"?{next:o=>{try{t(o)}catch(a){r.next(a)}},error:o=>r.next(o)}:{next:o=>t.next(o),error:o=>t.error?t.error(o):r.next(o)};let i;try{i=this._subscribe(s)}catch(o){s.error?.(o)}return new M().add(()=>{switch(s.next=L,s.error=L,typeof i){case"function":i();return;case"object":i.unsubscribe();return;case"undefined":return;default:return v(i)}})}pipe(...t){return t.reduce((n,r)=>r(n),this)}_subscribe(t){}}class G extends b{keyCounter=0;subscribers=new Map;constructor(){super()}next(t){this.subscribers.forEach(n=>n.next(t))}error(t){this.subscribers.forEach(n=>n.error?.(t))}_subscribe(t){const n=this.keyCounter++;return this.subscribers.set(n,t),new M().add(()=>this.subscribers.delete(n))}}class Me{log$=new G;logs=[];log=t=>{const n={...t,timestamp:Date.now()};this.logs.push(n),this.log$.next(n)};createCustomLog(t){return(...n)=>{let r;try{r=t(...n)}catch{r={message:"error in `createCustomLog`",component:"Logger"}}this.log(r)}}createComponentLog(t){return this.createCustomLog(n=>({component:t,...n}))}getAllLogs=()=>this.logs}function Ne(e,t='Assertion "value is not nullable" failed'){if(e==null)throw new Error(t)}function ke(e,t='Assertion "value is nullable" failed'){if(e!=null)throw new Error(t)}function ie(e){return typeof e<"u"&&e!==null}function se(e){return e==null}function Fe(e,t){if(!e?.length)throw new Error(t)}function qe(e,t){if(e?.length)throw new Error(t)}const Ce=(e,t,n)=>new Promise((r,s)=>{t.addEventListener("abort",()=>{a(),c.remove()});const i=()=>{a(),s()},o=()=>{a(),r()},a=()=>{d&&clearTimeout(d),c.removeEventListener("load",o),c.removeEventListener("error",i)};let d;n&&(d=window.setTimeout(i,n));const c=document.createElement("script");c.addEventListener("load",o),c.addEventListener("error",i),c.src=e,document.head.appendChild(c)}),De=typeof window.performance?.now=="function"?()=>window.performance.now():()=>Date.now(),je=(e,t)=>async(...n)=>{const r=t(...n);let s=e.aborted,i;for(;!s&&!e.aborted;)try{const o=await r.next(i);s=o.done??!1,i=o.value}catch(o){await r.throw(o)}return i};var A;(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"})(A||(A={}));var h;(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"})(h||(h={}));const W=()=>{const{userAgent:e}=window.navigator,t=/yabrowser/i.test(e)?A.Yandex:void 0,n=/chrome|crios/i.test(e)?A.Chrome:void 0,r=/chromium/i.test(e)?A.Chromium:void 0,s=/firefox|fxios/i.test(e)?A.Firefox:void 0,i=/webkit|safari|khtml/i.test(e)?A.Safari:void 0,o=/opr\//i.test(e)?A.Opera:void 0,a=/edg/i.test(e)?A.Edge:void 0,d=/android/i.test(e)?h.Android:void 0,c=/iphone/i.test(e)?h.iPhone:void 0,m=/ipad/i.test(e)?h.iPad:void 0,f=/ipod/i.test(e)?h.iPod:void 0,E=/mac/i.test(e)?h.Mac:void 0,O=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(e)?h.RestMobile:void 0;return{browser:t||s||o||a||n||r||i||A.Rest,device:d||c||m||f||O||E||h.Desktop}},Ue=(e=!1)=>{const n=[h.iPhone,h.iPad,h.iPod].includes(W().device);if(!e)return n;const{userAgent:r,maxTouchPoints:s}=window.navigator;return!!(n||/macintosh/i.test(r)&&s>0)},Qe=()=>{const{userAgent:e}=window.navigator,t=e.match(/Version\/(\d+(\.\d+)?)/i);if(!t)return null;const n=t[1],r=parseFloat(n);return isNaN(r)?null:r},Ve=()=>[h.Mac,h.iPhone,h.iPad,h.iPod].includes(W().device),Ge=()=>/Mobile|mini|Fennec|Android|iP(ad|od|hone)/.test(navigator.appVersion??navigator.userAgent)||navigator?.userAgentData?.mobile,We=(e,{start:t=0,factor:n=2,max:r=1/0,min:s=t,random:i=0}={})=>{let o=t;return o*=n**e,o*=1+(Math.random()*i*2-i),o=Math.round(o),o=Math.min(o,r),o=Math.max(o,s),o};var u;(function(e){e[e.LOCAL_STORAGE=0]="LOCAL_STORAGE",e[e.SESSION_STORAGE=1]="SESSION_STORAGE",e[e.RUNTIME=2]="RUNTIME"})(u||(u={}));let x,y;const N=`vk-videoplayer-dummy-key-${Math.random()}`,R=()=>{if(y!==void 0)return y;try{localStorage.setItem(N,"test"),localStorage.removeItem(N),y=u.LOCAL_STORAGE}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem(N),y=u.SESSION_STORAGE}catch(t){if(t instanceof DOMException||t instanceof TypeError)y=u.RUNTIME;else throw t}else throw e}return y===u.RUNTIME&&(x=new Map),y},oe=()=>R()===u.LOCAL_STORAGE,ae=e=>{const t=R();switch(t){case u.LOCAL_STORAGE:return localStorage.getItem(e)??void 0;case u.SESSION_STORAGE:return sessionStorage.getItem(e)??void 0;case u.RUNTIME:return x?.get(e);default:v(t)}},ce=(e,t)=>{const n=R();switch(n){case u.LOCAL_STORAGE:try{localStorage.setItem(e,t)}catch(r){if(r instanceof DOMException)console.error(r);else throw r}break;case u.SESSION_STORAGE:try{sessionStorage.setItem(e,t)}catch(r){if(r instanceof DOMException)console.error(r);else throw r}break;case u.RUNTIME:return void x?.set(e,t);default:v(n)}},le=e=>{const t=R();switch(t){case u.LOCAL_STORAGE:return e in localStorage;case u.SESSION_STORAGE:return e in sessionStorage;case u.RUNTIME:return x?.has(e)??!1;default:return v(t),!1}},ue=e=>{const t=R();switch(t){case u.LOCAL_STORAGE:return localStorage.removeItem(e);case u.SESSION_STORAGE:return sessionStorage.removeItem(e);case u.RUNTIME:return void x?.delete(e);default:v(t)}},de=()=>{const e=R();switch(e){case u.LOCAL_STORAGE:return localStorage.clear();case u.SESSION_STORAGE:return sessionStorage.clear();case u.RUNTIME:return x?.clear();default:v(e)}};var ze=Object.freeze({__proto__:null,clear:de,get:ae,has:le,isPersistent:oe,remove:ue,set:ce});const $e=()=>{let e,t;try{e=window.self!==window.top}catch(r){r instanceof DOMException&&r.name==="SecurityError"?e=!0:(e=!1,console.error(r))}try{window.location.ancestorOrigins&&(t=window.location.ancestorOrigins[window.location.ancestorOrigins.length-1])}catch(r){console.error(r)}try{!t&&document.referrer&&(t=document.referrer)}catch(r){console.error(r)}const n=t?new URL(t).hostname:void 0;return{isEmbed:e,host:n}};var w;(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"})(w||(w={}));const p={[w.Q_144P]:{width:256,height:144},[w.Q_240P]:{width:428,height:240},[w.Q_360P]:{width:640,height:360},[w.Q_480P]:{width:856,height:480},[w.Q_720P]:{width:1280,height:720},[w.Q_1080P]:{width:1920,height:1080},[w.Q_1440P]:{width:2560,height:1440},[w.Q_2160P]:{width:3840,height:2160},[w.Q_4320P]:{width:7680,height:4320}},Ye=(e,t)=>p[e].height>p[t].height,He=(e,t)=>p[e].height>=p[t].height,z=(e,t)=>p[e].height<p[t].height,Be=(e,t)=>p[e].height<=p[t].height,Xe=e=>e.sort((t,n)=>t===n?0:t===w.INVARIANT?1:n===w.INVARIANT?-1:z(t,n)?1:-1)[0],$=Object.keys(p).sort((e,t)=>z(e,t)?-1:1),Je=(e,t=.02)=>[...$].find(r=>p[r].height*(1+t)>=e),Ze=({width:e,height:t})=>{const n=Math.min(e,t),r=Math.max(e,t);return $.find(s=>{const i=p[s];return i.width>=r&&i.height>=n})},Ke=e=>p[e].height,Y=e=>e===w.INVARIANT,et=e=>e.every(t=>!Y(t));function tt(e){if(Y(e))throw new Error("Expected exact quality")}const fe=(e,t)=>{const n={};for(const r of Object.keys(t)){const s=t[r],i=e[r];Array.isArray(s)&&Array.isArray(i)?n[r]=i:typeof s=="object"&&typeof i=="object"?n[r]=fe(i,s):n[r]=r in e?i:s}return n},nt=e=>{let t="";return e>=3600&&(t+=Math.floor(e/3600)+"h",e=e%3600),e>=60&&(t+=Math.floor(e/60)+"m",e=e%60),e>0&&(t+=Math.floor(e)+"s"),t};function rt(e,t=0,n){let r,s,i,o,a,d,c=0,m=!1,f=!1,E=!0;const O=!t&&t!==0&&typeof window.requestAnimationFrame=="function";n&&(m=!!n.leading,f="maxWait"in n,i=n?.maxWait?Math.max(+n?.maxWait||0,t):i,E="trailing"in n?!!n.trailing:E);function _(l){const g=r,S=s;return r=s=void 0,c=l,o=e.apply(S,g),o}function P(l,g){return O?(a&&window.cancelAnimationFrame(a),window.requestAnimationFrame(l)):setTimeout(l,g)}function Z(l){if(O){window.cancelAnimationFrame(l);return}clearTimeout(l)}function K(l){return c=l,a=P(T,t),m?_(l):o}function ee(l){const g=l-d,S=l-c,C=t-g;return f?Math.min(C,i-S):C}function F(l){const g=l-d,S=l-c;return d===void 0||g>=t||g<0||f&&S>=i}function T(){const l=Date.now();if(F(l))return q(l);a=P(T,ee(l))}function q(l){return a=void 0,E&&r?_(l):(r=s=void 0,o)}function te(){a!==void 0&&Z(a),c=0,r=d=s=a=void 0}function ne(){return a===void 0?o:q(Date.now())}function re(){return a!==void 0}function I(...l){const g=Date.now(),S=F(g);if(r=l,s=this,d=g,S){if(a===void 0)return K(d);if(f)return a=P(T,t),_(d)}return a===void 0&&(a=P(T,t)),o}return I.cancel=te,I.flush=ne,I.pending=re,I}const H=(e,t)=>{if(e===null||typeof e!="object")return e;const n=Array.isArray(e)?[]:{};for(const r in e){if(typeof t=="function"){const s=t(e[r],r,e,n);if(s!==void 0){n[r]=s;continue}}typeof e[r]=="object"?n[r]=H(e[r],t):n[r]=e[r]}return n},it=e=>H(e);class st extends G{value;constructor(t){super(),this.value=t}next(t){super.next(this.value=t)}error(t){super.error(this.value=t)}getValue(){return this.value}_subscribe(t){const n=super._subscribe(t);return t.next(this.value),n}}function ot(e){return new b(t=>{const n={};let r=Object.keys(e).length;const s=i=>o=>{i in n||r--,n[i]=o,r===0&&t.next(n)};return Object.entries(e).reduce((i,[o,a])=>i.add(a.subscribe(s(o))),new M)})}function at(...e){return new b(t=>e.reduce((n,r)=>n.add(r.subscribe(t)),new M))}var ct=e=>new b(t=>{const n=window.setTimeout(()=>{try{t.next()}catch(r){if(t.error)t.error(r);else throw r}},e);return()=>window.clearTimeout(n)}),lt=e=>new b(t=>{const n=window.setInterval(()=>t.next(),e);return()=>window.clearInterval(n)}),ut=e=>new b(t=>{e.forEach(n=>t.next(n))}),dt=(e,t)=>new b(n=>{const r=s=>n.next(s);return e.addEventListener(t,r),()=>e.removeEventListener(t,r)});function ft(e){return t=>new b(n=>t.subscribe(new he(n,e)))}class he{destination;size;lastValues=[];constructor(t,n){this.destination=t,this.size=n}next(t){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(t),this.destination.next(this.lastValues)}error(t){this.destination.error?.(t)}}const be={leading:!1,trailing:!0};function ht(e,t=be){return n=>new b(r=>n.subscribe(new me(r,e,t)))}class me{destination;time;config;lastValue;timeout;constructor(t,n,r){this.destination=t,this.time=n,this.config=r}next(t){this.lastValue=t,ie(this.timeout)?window.clearTimeout(this.timeout):this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout(()=>{if(this.config.trailing)try{this.destination.next(this.lastValue)}catch(n){if(this.destination.error)this.destination.error(n);else throw n}this.timeout=void 0},this.time)}error(t){this.destination.error?.(t)}}const we={leading:!0,trailing:!1};function bt(e,t=we){return n=>new b(r=>n.subscribe(new pe(r,e,t)))}class pe{destination;time;config;lastValue;timeout;constructor(t,n,r){this.destination=t,this.time=n,this.config=r}next(t){this.lastValue=t,se(this.timeout)&&(this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout(()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0},this.time))}error(t){this.destination.error?.(t)}}function mt(e){return t=>new b(n=>t.subscribe(new ge(n,e)))}class ge{destination;predicate;constructor(t,n){this.destination=t,this.predicate=n}next(t){let n;try{n=this.predicate(t)}catch(r){throw this.error(r),r}n&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function wt(e=(t,n)=>t===n){return t=>new b(n=>t.subscribe(new Ee(n,e)))}const D={};class Ee{destination;predicate;lastValue=D;constructor(t,n){this.destination=t,this.predicate=n}next(t){let n;try{n=this.lastValue===D||!this.predicate(this.lastValue,t),this.lastValue=t}catch(r){throw this.error(r),r}n&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function Ae(e){return t=>new b(n=>t.subscribe(new Se(n,e)))}let Se=class{destination;mapper;constructor(t,n){this.destination=t,this.mapper=n}next(t){let n;try{n=this.mapper(t)}catch(r){throw this.error(r),r}this.destination.next(n)}error(t){this.destination.error?.(t)}};function gt(e){return Ae(()=>e)}function Et(){return e=>new b(t=>{let n=!1,r=!1;const s=e.subscribe(i=>{n||(n=!0,t.next(i)),r&&s.unsubscribe()},i=>{n=!0,t.error?.(i),r&&s.unsubscribe()});return r=!0,n&&s.unsubscribe(),s})}function At(){return e=>new b(t=>e.subscribe(new ye(t)))}class ye{destination;last;hasLast=!1;constructor(t){this.destination=t}next(t){const n=this.last;if(this.last=t,!this.hasLast){this.hasLast=!0;return}this.destination.next([n,t])}error(t){this.destination.error?.(t)}}function St(e){return t=>new b(n=>t.subscribe(new Oe(n,e)))}class Oe{destination;effect;constructor(t,n){this.destination=t,this.effect=n}next(t){try{this.effect(t)}catch(n){throw this.error(n),n}this.destination.next(t)}error(t){this.destination.error?.(t)}}var j;(function(e){e.NETWORK="network",e.VIDEO_PIPELINE="video_pipeline",e.EXTERNAL_API="external_api",e.PARSER="parser",e.DOM="dom",e.WTF="wtf"})(j||(j={}));class U{constructor(){Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}addEventListener(t,n,r){t in this.listeners||(this.listeners[t]=[]),this.listeners[t].push({callback:n,options:r})}removeEventListener(t,n){if(!(t in this.listeners))return;const r=this.listeners[t];for(let s=0,i=r.length;s<i;s++)if(r[s].callback===n){r.splice(s,1);return}}dispatchEvent(t){if(!(t.type in this.listeners))return;const r=this.listeners[t.type].slice();for(let s=0,i=r.length;s<i;s++){const o=r[s];try{o.callback.call(this,t)}catch(a){Promise.resolve().then(()=>{throw a})}o.options&&o.options.once&&this.removeEventListener(t.type,o.callback)}return!t.defaultPrevented}}class B extends U{constructor(){super(),this.listeners||U.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(t){t.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,t)),super.dispatchEvent(t)}}class ve{constructor(){Object.defineProperty(this,"signal",{value:new B,writable:!0,configurable:!0})}abort(t){let n;try{n=new Event("abort")}catch{typeof document<"u"?document.createEvent?(n=document.createEvent("Event"),n.initEvent("abort",!1,!1)):(n=document.createEventObject(),n.type="abort"):n={type:"abort",bubbles:!1,cancelable:!1}}let r=t;if(r===void 0)if(typeof document>"u")r=new Error("This operation was aborted"),r.name="AbortError";else try{r=new DOMException("signal is aborted without reason")}catch{r=new Error("This operation was aborted"),r.name="AbortError"}this.signal.reason=r,this.signal.dispatchEvent(n)}toString(){return"[object AbortController]"}}typeof Symbol<"u"&&Symbol.toStringTag&&(ve.prototype[Symbol.toStringTag]="AbortController",B.prototype[Symbol.toStringTag]="AbortSignal");function X(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 xe(e){typeof e=="function"&&(e={fetch:e});const{fetch:t,Request:n=t.Request,AbortController:r,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:s=!1}=e;if(!X({fetch:t,Request:n,AbortController:r,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:s}))return{fetch:t,Request:i};let i=n;(i&&!i.prototype.hasOwnProperty("signal")||s)&&(i=function(c,m){let f;m&&m.signal&&(f=m.signal,delete m.signal);const E=new n(c,m);return f&&Object.defineProperty(E,"signal",{writable:!1,enumerable:!1,configurable:!0,value:f}),E},i.prototype=n.prototype);const o=t;return{fetch:(d,c)=>{const m=i&&i.prototype.isPrototypeOf(d)?d.signal:c?c.signal:void 0;if(m){let f;try{f=new DOMException("Aborted","AbortError")}catch{f=new Error("Aborted"),f.name="AbortError"}if(m.aborted)return Promise.reject(f);const E=new Promise((O,_)=>{m.addEventListener("abort",()=>_(f),{once:!0})});return c&&c.signal&&delete c.signal,Promise.race([E,o(d,c)])}return o(d,c)},Request:i}}const k=X({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),J=k?xe({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,Re=k?J.fetch:window.fetch;k?J.Request:window.Request;var Q;(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"})(Q||(Q={}));const _e="vk.com",yt=async(e,t,n)=>{const r=new URL(`https://${_e}/js/lang-pack.js`);r.searchParams.set("format","json"),r.searchParams.set("name",t),e!==void 0&&r.searchParams.set("lang",e);const i=await(await Re(r.toString())).json();return Le(i,n)},Le=(e,t)=>Object.fromEntries(Object.entries(e.keys).map(([n,r])=>[n.substring(`${t}_`.length),Pe(r)])),Pe=e=>Array.isArray(e)?e[0]:e;var V;(function(e){e.RU="ru",e.EN="en"})(V||(V={}));export{A as CurrentClientBrowser,h as CurrentClientDevice,j as ErrorCategory,V as InterfaceLanguage,Me as Logger,b as Observable,G as Subject,M as Subscription,Te as VERSION,Q as VKNumericLanguage,st as ValueSubject,w as VideoQuality,je as abortable,Ce as addScript,et as areQualitiesExact,qe as assertEmptyArray,v as assertNever,Ne as assertNonNullable,Fe as assertNotEmptyArray,ke as assertNullable,tt as assertQualityIsExact,ft as buffer,Ie as checkNever,it as cloneDeep,H as cloneDeepWith,ot as combine,ht as debounce,rt as debounceFn,$e as detectEmbed,fe as fillWithDefault,mt as filter,wt as filterChanged,dt as fromEvent,W as getCurrentBrowser,We as getExponentialDelay,Xe as getHighestQuality,Qe as getIOSVersion,lt as interval,Ye as isHigher,He as isHigherOrEqual,Ue as isIOS,Y as isInvariantQuality,z as isLower,Be as isLowerOrEqual,Ve as isMacLike,Ge as isMobile,ie as isNonNullable,se as isNullable,yt as loadVKLangPack,Ae as map,gt as mapTo,at as merge,L as noop,De as now,ut as observableFrom,Et as once,At as pairwise,ze as safeStorage,St as tap,bt as throttle,nt as timeCodeToString,ct as timeout,Je as videoHeightToQuality,Ke as videoQualityToHeight,Ze as videoSizeToQuality};
6
+ const Ne="1.0.35-beta.0";class M{subscriptions=[];unsubscribe(){const t=this.subscriptions;this.subscriptions=[],t.forEach(n=>typeof n=="function"?n():n.unsubscribe())}add(t){return this.subscriptions.push(t),this}}const x=e=>{throw new Error(`${e} is value of unexpected type`)},ke=e=>{},L=()=>{};class f{constructor(t){t&&(this._subscribe=t)}subscribe(t,n){let r;n?typeof n=="function"?r={next:n,error:L}:r={next:o=>n.next(o),error:o=>n.error?.(o)}:r={next:L,error:L};const s=typeof t=="function"?{next:o=>{try{t(o)}catch(a){r.next(a)}},error:o=>r.next(o)}:{next:o=>t.next(o),error:o=>t.error?t.error(o):r.next(o)};let i;try{i=this._subscribe(s)}catch(o){s.error?.(o)}return new M().add(()=>{switch(s.next=L,s.error=L,typeof i){case"function":i();return;case"object":i.unsubscribe();return;case"undefined":return;default:return x(i)}})}pipe(...t){return t.reduce((n,r)=>r(n),this)}_subscribe(t){}}class G extends f{keyCounter=0;subscribers=new Map;constructor(){super()}next(t){this.subscribers.forEach(n=>n.next(t))}error(t){this.subscribers.forEach(n=>n.error?.(t))}_subscribe(t){const n=this.keyCounter++;return this.subscribers.set(n,t),new M().add(()=>this.subscribers.delete(n))}}class Fe{log$=new G;logs=[];log=t=>{const n={...t,timestamp:Date.now()};this.logs.push(n),this.log$.next(n)};createCustomLog(t){return(...n)=>{let r;try{r=t(...n)}catch{r={message:"error in `createCustomLog`",component:"Logger"}}this.log(r)}}createComponentLog(t){return this.createCustomLog(n=>({component:t,...n}))}getAllLogs=()=>this.logs}function qe(e,t='Assertion "value is not nullable" failed'){if(e==null)throw new Error(t)}function Ce(e,t='Assertion "value is nullable" failed'){if(e!=null)throw new Error(t)}function k(e){return typeof e<"u"&&e!==null}function se(e){return e==null}function De(e,t){if(!e?.length)throw new Error(t)}function je(e,t){if(e?.length)throw new Error(t)}const Ue=(e,t,n)=>new Promise((r,s)=>{t.addEventListener("abort",()=>{a(),c.remove()});const i=()=>{a(),s()},o=()=>{a(),r()},a=()=>{l&&clearTimeout(l),c.removeEventListener("load",o),c.removeEventListener("error",i)};let l;n&&(l=window.setTimeout(i,n));const c=document.createElement("script");c.addEventListener("load",o),c.addEventListener("error",i),c.src=e,document.head.appendChild(c)}),Qe=typeof window.performance?.now=="function"?()=>window.performance.now():()=>Date.now(),Ve=(e,t)=>async(...n)=>{const r=t(...n);let s=e.aborted,i;for(;!s&&!e.aborted;)try{const o=await r.next(i);s=o.done??!1,i=o.value}catch(o){await r.throw(o)}return i};var S;(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"})(S||(S={}));var b;(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"})(b||(b={}));const W=()=>{const{userAgent:e}=window.navigator,t=/yabrowser/i.test(e)?S.Yandex:void 0,n=/chrome|crios/i.test(e)?S.Chrome:void 0,r=/chromium/i.test(e)?S.Chromium:void 0,s=/firefox|fxios/i.test(e)?S.Firefox:void 0,i=/webkit|safari|khtml/i.test(e)?S.Safari:void 0,o=/opr\//i.test(e)?S.Opera:void 0,a=/edg/i.test(e)?S.Edge:void 0,l=/android/i.test(e)?b.Android:void 0,c=/iphone/i.test(e)?b.iPhone:void 0,w=/ipad/i.test(e)?b.iPad:void 0,h=/ipod/i.test(e)?b.iPod:void 0,E=/mac/i.test(e)?b.Mac:void 0,y=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(e)?b.RestMobile:void 0;return{browser:t||s||o||a||n||r||i||S.Rest,device:l||c||w||h||y||E||b.Desktop}},ze=(e=!1)=>{const n=[b.iPhone,b.iPad,b.iPod].includes(W().device);if(!e)return n;const{userAgent:r,maxTouchPoints:s}=window.navigator;return!!(n||/macintosh/i.test(r)&&s>0)},Ge=()=>{const{userAgent:e}=window.navigator,t=e.match(/Version\/(\d+(\.\d+)?)/i);if(!t)return null;const n=t[1],r=parseFloat(n);return isNaN(r)?null:r},We=()=>[b.Mac,b.iPhone,b.iPad,b.iPod].includes(W().device),$e=()=>/Mobile|mini|Fennec|Android|iP(ad|od|hone)/.test(navigator.appVersion??navigator.userAgent)||navigator?.userAgentData?.mobile,Be=(e,{start:t=0,factor:n=2,max:r=1/0,min:s=t,random:i=0}={})=>{let o=t;return o*=n**e,o*=1+(Math.random()*i*2-i),o=Math.round(o),o=Math.min(o,r),o=Math.max(o,s),o};var d;(function(e){e[e.LOCAL_STORAGE=0]="LOCAL_STORAGE",e[e.SESSION_STORAGE=1]="SESSION_STORAGE",e[e.RUNTIME=2]="RUNTIME"})(d||(d={}));let v,O;const N=`vk-videoplayer-dummy-key-${Math.random()}`,R=()=>{if(O!==void 0)return O;try{localStorage.setItem(N,"test"),localStorage.removeItem(N),O=d.LOCAL_STORAGE}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem(N),O=d.SESSION_STORAGE}catch(t){if(t instanceof DOMException||t instanceof TypeError)O=d.RUNTIME;else throw t}else throw e}return O===d.RUNTIME&&(v=new Map),O},oe=()=>R()===d.LOCAL_STORAGE,ae=e=>{const t=R();switch(t){case d.LOCAL_STORAGE:return localStorage.getItem(e)??void 0;case d.SESSION_STORAGE:return sessionStorage.getItem(e)??void 0;case d.RUNTIME:return v?.get(e);default:x(t)}},ce=(e,t)=>{const n=R();switch(n){case d.LOCAL_STORAGE:try{localStorage.setItem(e,t)}catch(r){if(r instanceof DOMException)console.error(r);else throw r}break;case d.SESSION_STORAGE:try{sessionStorage.setItem(e,t)}catch(r){if(r instanceof DOMException)console.error(r);else throw r}break;case d.RUNTIME:return void v?.set(e,t);default:x(n)}},le=e=>{const t=R();switch(t){case d.LOCAL_STORAGE:return e in localStorage;case d.SESSION_STORAGE:return e in sessionStorage;case d.RUNTIME:return v?.has(e)??!1;default:return x(t),!1}},ue=e=>{const t=R();switch(t){case d.LOCAL_STORAGE:return localStorage.removeItem(e);case d.SESSION_STORAGE:return sessionStorage.removeItem(e);case d.RUNTIME:return void v?.delete(e);default:x(t)}},de=()=>{const e=R();switch(e){case d.LOCAL_STORAGE:return localStorage.clear();case d.SESSION_STORAGE:return sessionStorage.clear();case d.RUNTIME:return v?.clear();default:x(e)}};var Ye=Object.freeze({__proto__:null,clear:de,get:ae,has:le,isPersistent:oe,remove:ue,set:ce});const He=()=>{let e,t;try{e=window.self!==window.top}catch(r){r instanceof DOMException&&r.name==="SecurityError"?e=!0:(e=!1,console.error(r))}try{window.location.ancestorOrigins&&(t=window.location.ancestorOrigins[window.location.ancestorOrigins.length-1])}catch(r){console.error(r)}try{!t&&document.referrer&&(t=document.referrer)}catch(r){console.error(r)}const n=t?new URL(t).hostname:void 0;return{isEmbed:e,host:n}};var m;(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"})(m||(m={}));const g={[m.Q_144P]:{width:256,height:144},[m.Q_240P]:{width:428,height:240},[m.Q_360P]:{width:640,height:360},[m.Q_480P]:{width:856,height:480},[m.Q_720P]:{width:1280,height:720},[m.Q_1080P]:{width:1920,height:1080},[m.Q_1440P]:{width:2560,height:1440},[m.Q_2160P]:{width:3840,height:2160},[m.Q_4320P]:{width:7680,height:4320}},Xe=(e,t)=>g[e].height>g[t].height,Je=(e,t)=>g[e].height>=g[t].height,$=(e,t)=>g[e].height<g[t].height,Ze=(e,t)=>g[e].height<=g[t].height,Ke=e=>e.sort((t,n)=>t===n?0:t===m.INVARIANT?1:n===m.INVARIANT?-1:$(t,n)?1:-1)[0],B=Object.keys(g).sort((e,t)=>$(e,t)?-1:1),et=(e,t=.02)=>[...B].find(r=>g[r].height*(1+t)>=e),tt=({width:e,height:t})=>{const n=Math.min(e,t),r=Math.max(e,t);return B.find(s=>{const i=g[s];return i.width>=r&&i.height>=n})},nt=e=>g[e].height,Y=e=>e===m.INVARIANT,rt=e=>e.every(t=>!Y(t));function it(e){if(Y(e))throw new Error("Expected exact quality")}const fe=(e,t)=>{const n={};for(const r of Object.keys(t)){const s=t[r],i=e[r];Array.isArray(s)&&Array.isArray(i)?n[r]=i:typeof s=="object"&&typeof i=="object"?n[r]=fe(i,s):n[r]=r in e?i:s}return n},st=e=>{let t="";return e>=3600&&(t+=Math.floor(e/3600)+"h",e=e%3600),e>=60&&(t+=Math.floor(e/60)+"m",e=e%60),e>0&&(t+=Math.floor(e)+"s"),t};function he(e,t=0,n){let r,s,i,o,a,l,c=0,w=!1,h=!1,E=!0;const y=!t&&t!==0&&typeof window.requestAnimationFrame=="function";n&&(w=!!n.leading,h="maxWait"in n,i=n?.maxWait?Math.max(+n?.maxWait||0,t):i,E="trailing"in n?!!n.trailing:E);function T(u){const p=r,A=s;return r=s=void 0,c=u,o=e.apply(A,p),o}function _(u,p){return y?(a&&window.cancelAnimationFrame(a),window.requestAnimationFrame(u)):setTimeout(u,p)}function K(u){if(y){window.cancelAnimationFrame(u);return}clearTimeout(u)}function ee(u){return c=u,a=_(P,t),w?T(u):o}function te(u){const p=u-l,A=u-c,D=t-p;return h?Math.min(D,i-A):D}function q(u){const p=u-l,A=u-c;return l===void 0||p>=t||p<0||h&&A>=i}function P(){const u=Date.now();if(q(u))return C(u);a=_(P,te(u))}function C(u){return a=void 0,E&&r?T(u):(r=s=void 0,o)}function ne(){a!==void 0&&K(a),c=0,r=l=s=a=void 0}function re(){return a===void 0?o:C(Date.now())}function ie(){return a!==void 0}function I(...u){const p=Date.now(),A=q(p);if(r=u,s=this,l=p,A){if(a===void 0)return ee(l);if(h)return a=_(P,t),T(l)}return a===void 0&&(a=_(P,t)),o}return I.cancel=ne,I.flush=re,I.pending=ie,I}const be=(e,t=0,n)=>he(e,t,{...{leading:!0,trailing:!0},...n,maxWait:t}),H=(e,t)=>{if(e===null||typeof e!="object")return e;const n=Array.isArray(e)?[]:{};for(const r in e){if(typeof t=="function"){const s=t(e[r],r,e,n);if(s!==void 0){n[r]=s;continue}}typeof e[r]=="object"?n[r]=H(e[r],t):n[r]=e[r]}return n},ot=e=>H(e),we=300,at=(e,t=we)=>new f(n=>{const{width:r,height:s}=e.getBoundingClientRect();if(n.next({width:r,height:s}),!window.ResizeObserver)return;const i=new ResizeObserver(be(o=>{const a=o[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),k(l)&&k(c)&&n.next({width:l,height:c})},t));return i.observe(e),()=>i.disconnect()});class ct extends G{value;constructor(t){super(),this.value=t}next(t){super.next(this.value=t)}error(t){super.error(this.value=t)}getValue(){return this.value}_subscribe(t){const n=super._subscribe(t);return t.next(this.value),n}}function lt(e){return new f(t=>{const n={};let r=Object.keys(e).length;const s=i=>o=>{i in n||r--,n[i]=o,r===0&&t.next(n)};return Object.entries(e).reduce((i,[o,a])=>i.add(a.subscribe(s(o))),new M)})}function ut(...e){return new f(t=>e.reduce((n,r)=>n.add(r.subscribe(t)),new M))}var dt=e=>new f(t=>{const n=window.setTimeout(()=>{try{t.next()}catch(r){if(t.error)t.error(r);else throw r}},e);return()=>window.clearTimeout(n)}),ft=e=>new f(t=>{const n=window.setInterval(()=>t.next(),e);return()=>window.clearInterval(n)}),ht=e=>new f(t=>{e.forEach(n=>t.next(n))}),bt=(e,t)=>new f(n=>{const r=s=>n.next(s);return e.addEventListener(t,r),()=>e.removeEventListener(t,r)});function wt(e){return t=>new f(n=>t.subscribe(new me(n,e)))}class me{destination;size;lastValues=[];constructor(t,n){this.destination=t,this.size=n}next(t){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(t),this.destination.next(this.lastValues)}error(t){this.destination.error?.(t)}}const ge={leading:!1,trailing:!0};function mt(e,t=ge){return n=>new f(r=>n.subscribe(new pe(r,e,t)))}class pe{destination;time;config;lastValue;timeout;constructor(t,n,r){this.destination=t,this.time=n,this.config=r}next(t){this.lastValue=t,k(this.timeout)?window.clearTimeout(this.timeout):this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout(()=>{if(this.config.trailing)try{this.destination.next(this.lastValue)}catch(n){if(this.destination.error)this.destination.error(n);else throw n}this.timeout=void 0},this.time)}error(t){this.destination.error?.(t)}}const Ee={leading:!0,trailing:!1};function gt(e,t=Ee){return n=>new f(r=>n.subscribe(new Se(r,e,t)))}class Se{destination;time;config;lastValue;timeout;constructor(t,n,r){this.destination=t,this.time=n,this.config=r}next(t){this.lastValue=t,se(this.timeout)&&(this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout(()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0},this.time))}error(t){this.destination.error?.(t)}}function pt(e){return t=>new f(n=>t.subscribe(new Ae(n,e)))}class Ae{destination;predicate;constructor(t,n){this.destination=t,this.predicate=n}next(t){let n;try{n=this.predicate(t)}catch(r){throw this.error(r),r}n&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function Et(e=(t,n)=>t===n){return t=>new f(n=>t.subscribe(new Oe(n,e)))}const j={};class Oe{destination;predicate;lastValue=j;constructor(t,n){this.destination=t,this.predicate=n}next(t){let n;try{n=this.lastValue===j||!this.predicate(this.lastValue,t),this.lastValue=t}catch(r){throw this.error(r),r}n&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function ye(e){return t=>new f(n=>t.subscribe(new xe(n,e)))}let xe=class{destination;mapper;constructor(t,n){this.destination=t,this.mapper=n}next(t){let n;try{n=this.mapper(t)}catch(r){throw this.error(r),r}this.destination.next(n)}error(t){this.destination.error?.(t)}};function At(e){return ye(()=>e)}function Ot(){return e=>new f(t=>{let n=!1,r=!1;const s=e.subscribe(i=>{n||(n=!0,t.next(i)),r&&s.unsubscribe()},i=>{n=!0,t.error?.(i),r&&s.unsubscribe()});return r=!0,n&&s.unsubscribe(),s})}function yt(){return e=>new f(t=>e.subscribe(new ve(t)))}class ve{destination;last;hasLast=!1;constructor(t){this.destination=t}next(t){const n=this.last;if(this.last=t,!this.hasLast){this.hasLast=!0;return}this.destination.next([n,t])}error(t){this.destination.error?.(t)}}function xt(e){return t=>new f(n=>t.subscribe(new Re(n,e)))}class Re{destination;effect;constructor(t,n){this.destination=t,this.effect=n}next(t){try{this.effect(t)}catch(n){throw this.error(n),n}this.destination.next(t)}error(t){this.destination.error?.(t)}}var U;(function(e){e.NETWORK="network",e.VIDEO_PIPELINE="video_pipeline",e.EXTERNAL_API="external_api",e.PARSER="parser",e.DOM="dom",e.WTF="wtf"})(U||(U={}));class Q{constructor(){Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}addEventListener(t,n,r){t in this.listeners||(this.listeners[t]=[]),this.listeners[t].push({callback:n,options:r})}removeEventListener(t,n){if(!(t in this.listeners))return;const r=this.listeners[t];for(let s=0,i=r.length;s<i;s++)if(r[s].callback===n){r.splice(s,1);return}}dispatchEvent(t){if(!(t.type in this.listeners))return;const r=this.listeners[t.type].slice();for(let s=0,i=r.length;s<i;s++){const o=r[s];try{o.callback.call(this,t)}catch(a){Promise.resolve().then(()=>{throw a})}o.options&&o.options.once&&this.removeEventListener(t.type,o.callback)}return!t.defaultPrevented}}class X extends Q{constructor(){super(),this.listeners||Q.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(t){t.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,t)),super.dispatchEvent(t)}}class Te{constructor(){Object.defineProperty(this,"signal",{value:new X,writable:!0,configurable:!0})}abort(t){let n;try{n=new Event("abort")}catch{typeof document<"u"?document.createEvent?(n=document.createEvent("Event"),n.initEvent("abort",!1,!1)):(n=document.createEventObject(),n.type="abort"):n={type:"abort",bubbles:!1,cancelable:!1}}let r=t;if(r===void 0)if(typeof document>"u")r=new Error("This operation was aborted"),r.name="AbortError";else try{r=new DOMException("signal is aborted without reason")}catch{r=new Error("This operation was aborted"),r.name="AbortError"}this.signal.reason=r,this.signal.dispatchEvent(n)}toString(){return"[object AbortController]"}}typeof Symbol<"u"&&Symbol.toStringTag&&(Te.prototype[Symbol.toStringTag]="AbortController",X.prototype[Symbol.toStringTag]="AbortSignal");function J(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 Le(e){typeof e=="function"&&(e={fetch:e});const{fetch:t,Request:n=t.Request,AbortController:r,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:s=!1}=e;if(!J({fetch:t,Request:n,AbortController:r,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:s}))return{fetch:t,Request:i};let i=n;(i&&!i.prototype.hasOwnProperty("signal")||s)&&(i=function(c,w){let h;w&&w.signal&&(h=w.signal,delete w.signal);const E=new n(c,w);return h&&Object.defineProperty(E,"signal",{writable:!1,enumerable:!1,configurable:!0,value:h}),E},i.prototype=n.prototype);const o=t;return{fetch:(l,c)=>{const w=i&&i.prototype.isPrototypeOf(l)?l.signal:c?c.signal:void 0;if(w){let h;try{h=new DOMException("Aborted","AbortError")}catch{h=new Error("Aborted"),h.name="AbortError"}if(w.aborted)return Promise.reject(h);const E=new Promise((y,T)=>{w.addEventListener("abort",()=>T(h),{once:!0})});return c&&c.signal&&delete c.signal,Promise.race([E,o(l,c)])}return o(l,c)},Request:i}}const F=J({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),Z=F?Le({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,_e=F?Z.fetch:window.fetch;F?Z.Request:window.Request;var V;(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"})(V||(V={}));const Pe="vk.com",vt=async(e,t,n)=>{const r=new URL(`https://${Pe}/js/lang-pack.js`);r.searchParams.set("format","json"),r.searchParams.set("name",t),e!==void 0&&r.searchParams.set("lang",e);const i=await(await _e(r.toString())).json();return Ie(i,n)},Ie=(e,t)=>Object.fromEntries(Object.entries(e.keys).map(([n,r])=>[n.substring(`${t}_`.length),Me(r)])),Me=e=>Array.isArray(e)?e[0]:e;var z;(function(e){e.RU="ru",e.EN="en"})(z||(z={}));export{S as CurrentClientBrowser,b as CurrentClientDevice,U as ErrorCategory,z as InterfaceLanguage,Fe as Logger,f as Observable,G as Subject,M as Subscription,Ne as VERSION,V as VKNumericLanguage,ct as ValueSubject,m as VideoQuality,Ve as abortable,Ue as addScript,rt as areQualitiesExact,je as assertEmptyArray,x as assertNever,qe as assertNonNullable,De as assertNotEmptyArray,Ce as assertNullable,it as assertQualityIsExact,wt as buffer,ke as checkNever,ot as cloneDeep,H as cloneDeepWith,lt as combine,mt as debounce,he as debounceFn,He as detectEmbed,fe as fillWithDefault,pt as filter,Et as filterChanged,bt as fromEvent,W as getCurrentBrowser,Be as getExponentialDelay,Ke as getHighestQuality,Ge as getIOSVersion,ft as interval,Xe as isHigher,Je as isHigherOrEqual,ze as isIOS,Y as isInvariantQuality,$ as isLower,Ze as isLowerOrEqual,We as isMacLike,$e as isMobile,k as isNonNullable,se as isNullable,vt as loadVKLangPack,ye as map,At as mapTo,ut as merge,L as noop,Qe as now,ht as observableFrom,at as observeElementSize,Ot as once,yt as pairwise,Ye as safeStorage,xt as tap,gt as throttle,be as throttleFn,st as timeCodeToString,dt as timeout,et as videoHeightToQuality,nt as videoQualityToHeight,tt as videoSizeToQuality};
package/evergreen.esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
- * @vkontakte/videoplayer-shared v1.0.34
3
- * Fri, 26 Apr 2024 14:08:06 GMT
4
- * https://st.mycdn.me/static/vkontakte-videoplayer/1-0-34/doc/
2
+ * @vkontakte/videoplayer-shared v1.0.35-beta.0
3
+ * Tue, 07 May 2024 23:30:33 GMT
4
+ * https://st.mycdn.me/static/vkontakte-videoplayer/1-0-35/doc/
5
5
  */
6
- const Ae="1.0.34";class R{subscriptions=[];unsubscribe(){const t=this.subscriptions;this.subscriptions=[],t.forEach(n=>typeof n=="function"?n():n.unsubscribe())}add(t){return this.subscriptions.push(t),this}}const x=e=>{throw new Error(`${e} is value of unexpected type`)},Oe=e=>{},y=()=>{};class d{constructor(t){t&&(this._subscribe=t)}subscribe(t,n){let i;n?typeof n=="function"?i={next:n,error:y}:i={next:s=>n.next(s),error:s=>n.error?.(s)}:i={next:y,error:y};const o=typeof t=="function"?{next:s=>{try{t(s)}catch(a){i.next(a)}},error:s=>i.next(s)}:{next:s=>t.next(s),error:s=>t.error?t.error(s):i.next(s)};let r;try{r=this._subscribe(o)}catch(s){o.error?.(s)}return new R().add(()=>{switch(o.next=y,o.error=y,typeof r){case"function":r();return;case"object":r.unsubscribe();return;case"undefined":return;default:return x(r)}})}pipe(...t){return t.reduce((n,i)=>i(n),this)}_subscribe(t){}}class j extends d{keyCounter=0;subscribers=new Map;constructor(){super()}next(t){this.subscribers.forEach(n=>n.next(t))}error(t){this.subscribers.forEach(n=>n.error?.(t))}_subscribe(t){const n=this.keyCounter++;return this.subscribers.set(n,t),new R().add(()=>this.subscribers.delete(n))}}class ve{log$=new j;logs=[];log=t=>{const n={...t,timestamp:Date.now()};this.logs.push(n),this.log$.next(n)};createCustomLog(t){return(...n)=>{let i;try{i=t(...n)}catch{i={message:"error in `createCustomLog`",component:"Logger"}}this.log(i)}}createComponentLog(t){return this.createCustomLog(n=>({component:t,...n}))}getAllLogs=()=>this.logs}function ye(e,t='Assertion "value is not nullable" failed'){if(e==null)throw new Error(t)}function Te(e,t='Assertion "value is nullable" failed'){if(e!=null)throw new Error(t)}function K(e){return typeof e<"u"&&e!==null}function ee(e){return e==null}function Ie(e,t){if(!e?.length)throw new Error(t)}function _e(e,t){if(e?.length)throw new Error(t)}const Pe=(e,t,n)=>new Promise((i,o)=>{t.addEventListener("abort",()=>{a(),h.remove()});const r=()=>{a(),o()},s=()=>{a(),i()},a=()=>{m&&clearTimeout(m),h.removeEventListener("load",s),h.removeEventListener("error",r)};let m;n&&(m=window.setTimeout(r,n));const h=document.createElement("script");h.addEventListener("load",s),h.addEventListener("error",r),h.src=e,document.head.appendChild(h)}),Me=typeof window.performance?.now=="function"?()=>window.performance.now():()=>Date.now(),Re=(e,t)=>async(...n)=>{const i=t(...n);let o=e.aborted,r;for(;!o&&!e.aborted;)try{const s=await i.next(r);o=s.done??!1,r=s.value}catch(s){await i.throw(s)}return r};var p;(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"})(p||(p={}));var l;(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"})(l||(l={}));const W=()=>{const{userAgent:e}=window.navigator,t=/yabrowser/i.test(e)?p.Yandex:void 0,n=/chrome|crios/i.test(e)?p.Chrome:void 0,i=/chromium/i.test(e)?p.Chromium:void 0,o=/firefox|fxios/i.test(e)?p.Firefox:void 0,r=/webkit|safari|khtml/i.test(e)?p.Safari:void 0,s=/opr\//i.test(e)?p.Opera:void 0,a=/edg/i.test(e)?p.Edge:void 0,m=/android/i.test(e)?l.Android:void 0,h=/iphone/i.test(e)?l.iPhone:void 0,T=/ipad/i.test(e)?l.iPad:void 0,S=/ipod/i.test(e)?l.iPod:void 0,v=/mac/i.test(e)?l.Mac:void 0,I=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(e)?l.RestMobile:void 0;return{browser:t||o||s||a||n||i||r||p.Rest,device:m||h||T||S||I||v||l.Desktop}},Le=(e=!1)=>{const n=[l.iPhone,l.iPad,l.iPod].includes(W().device);if(!e)return n;const{userAgent:i,maxTouchPoints:o}=window.navigator;return!!(n||/macintosh/i.test(i)&&o>0)},Ne=()=>{const{userAgent:e}=window.navigator,t=e.match(/Version\/(\d+(\.\d+)?)/i);if(!t)return null;const n=t[1],i=parseFloat(n);return isNaN(i)?null:i},ke=()=>[l.Mac,l.iPhone,l.iPad,l.iPod].includes(W().device),Ue=()=>/Mobile|mini|Fennec|Android|iP(ad|od|hone)/.test(navigator.appVersion??navigator.userAgent)||navigator?.userAgentData?.mobile,De=(e,{start:t=0,factor:n=2,max:i=1/0,min:o=t,random:r=0}={})=>{let s=t;return s*=n**e,s*=1+(Math.random()*r*2-r),s=Math.round(s),s=Math.min(s,i),s=Math.max(s,o),s};var u;(function(e){e[e.LOCAL_STORAGE=0]="LOCAL_STORAGE",e[e.SESSION_STORAGE=1]="SESSION_STORAGE",e[e.RUNTIME=2]="RUNTIME"})(u||(u={}));let A,E;const N=`vk-videoplayer-dummy-key-${Math.random()}`,O=()=>{if(E!==void 0)return E;try{localStorage.setItem(N,"test"),localStorage.removeItem(N),E=u.LOCAL_STORAGE}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem(N),E=u.SESSION_STORAGE}catch(t){if(t instanceof DOMException||t instanceof TypeError)E=u.RUNTIME;else throw t}else throw e}return E===u.RUNTIME&&(A=new Map),E},te=()=>O()===u.LOCAL_STORAGE,ne=e=>{const t=O();switch(t){case u.LOCAL_STORAGE:return localStorage.getItem(e)??void 0;case u.SESSION_STORAGE:return sessionStorage.getItem(e)??void 0;case u.RUNTIME:return A?.get(e);default:x(t)}},ie=(e,t)=>{const n=O();switch(n){case u.LOCAL_STORAGE:try{localStorage.setItem(e,t)}catch(i){if(i instanceof DOMException)console.error(i);else throw i}break;case u.SESSION_STORAGE:try{sessionStorage.setItem(e,t)}catch(i){if(i instanceof DOMException)console.error(i);else throw i}break;case u.RUNTIME:return void A?.set(e,t);default:x(n)}},se=e=>{const t=O();switch(t){case u.LOCAL_STORAGE:return e in localStorage;case u.SESSION_STORAGE:return e in sessionStorage;case u.RUNTIME:return A?.has(e)??!1;default:return x(t),!1}},re=e=>{const t=O();switch(t){case u.LOCAL_STORAGE:return localStorage.removeItem(e);case u.SESSION_STORAGE:return sessionStorage.removeItem(e);case u.RUNTIME:return void A?.delete(e);default:x(t)}},oe=()=>{const e=O();switch(e){case u.LOCAL_STORAGE:return localStorage.clear();case u.SESSION_STORAGE:return sessionStorage.clear();case u.RUNTIME:return A?.clear();default:x(e)}};var Fe=Object.freeze({__proto__:null,clear:oe,get:ne,has:se,isPersistent:te,remove:re,set:ie});const Qe=()=>{let e,t;try{e=window.self!==window.top}catch(i){i instanceof DOMException&&i.name==="SecurityError"?e=!0:(e=!1,console.error(i))}try{window.location.ancestorOrigins&&(t=window.location.ancestorOrigins[window.location.ancestorOrigins.length-1])}catch(i){console.error(i)}try{!t&&document.referrer&&(t=document.referrer)}catch(i){console.error(i)}const n=t?new URL(t).hostname:void 0;return{isEmbed:e,host:n}};var f;(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"})(f||(f={}));const w={[f.Q_144P]:{width:256,height:144},[f.Q_240P]:{width:428,height:240},[f.Q_360P]:{width:640,height:360},[f.Q_480P]:{width:856,height:480},[f.Q_720P]:{width:1280,height:720},[f.Q_1080P]:{width:1920,height:1080},[f.Q_1440P]:{width:2560,height:1440},[f.Q_2160P]:{width:3840,height:2160},[f.Q_4320P]:{width:7680,height:4320}},Ve=(e,t)=>w[e].height>w[t].height,Ge=(e,t)=>w[e].height>=w[t].height,q=(e,t)=>w[e].height<w[t].height,je=(e,t)=>w[e].height<=w[t].height,We=e=>e.sort((t,n)=>t===n?0:t===f.INVARIANT?1:n===f.INVARIANT?-1:q(t,n)?1:-1)[0],z=Object.keys(w).sort((e,t)=>q(e,t)?-1:1),qe=(e,t=.02)=>[...z].find(i=>w[i].height*(1+t)>=e),ze=({width:e,height:t})=>{const n=Math.min(e,t),i=Math.max(e,t);return z.find(o=>{const r=w[o];return r.width>=i&&r.height>=n})},$e=e=>w[e].height,$=e=>e===f.INVARIANT,He=e=>e.every(t=>!$(t));function Ce(e){if($(e))throw new Error("Expected exact quality")}const ae=(e,t)=>{const n={};for(const i of Object.keys(t)){const o=t[i],r=e[i];Array.isArray(o)&&Array.isArray(r)?n[i]=r:typeof o=="object"&&typeof r=="object"?n[i]=ae(r,o):n[i]=i in e?r:o}return n},Ye=e=>{let t="";return e>=3600&&(t+=Math.floor(e/3600)+"h",e=e%3600),e>=60&&(t+=Math.floor(e/60)+"m",e=e%60),e>0&&(t+=Math.floor(e)+"s"),t};function Xe(e,t=0,n){let i,o,r,s,a,m,h=0,T=!1,S=!1,v=!0;const I=!t&&t!==0&&typeof window.requestAnimationFrame=="function";n&&(T=!!n.leading,S="maxWait"in n,r=n?.maxWait?Math.max(+n?.maxWait||0,t):r,v="trailing"in n?!!n.trailing:v);function L(c){const g=i,b=o;return i=o=void 0,h=c,s=e.apply(b,g),s}function _(c,g){return I?(a&&window.cancelAnimationFrame(a),window.requestAnimationFrame(c)):setTimeout(c,g)}function C(c){if(I){window.cancelAnimationFrame(c);return}clearTimeout(c)}function Y(c){return h=c,a=_(P,t),T?L(c):s}function X(c){const g=c-m,b=c-h,D=t-g;return S?Math.min(D,r-b):D}function k(c){const g=c-m,b=c-h;return m===void 0||g>=t||g<0||S&&b>=r}function P(){const c=Date.now();if(k(c))return U(c);a=_(P,X(c))}function U(c){return a=void 0,v&&i?L(c):(i=o=void 0,s)}function J(){a!==void 0&&C(a),h=0,i=m=o=a=void 0}function Z(){return a===void 0?s:U(Date.now())}function B(){return a!==void 0}function M(...c){const g=Date.now(),b=k(g);if(i=c,o=this,m=g,b){if(a===void 0)return Y(m);if(S)return a=_(P,t),L(m)}return a===void 0&&(a=_(P,t)),s}return M.cancel=J,M.flush=Z,M.pending=B,M}const H=(e,t)=>{if(e===null||typeof e!="object")return e;const n=Array.isArray(e)?[]:{};for(const i in e){if(typeof t=="function"){const o=t(e[i],i,e,n);if(o!==void 0){n[i]=o;continue}}typeof e[i]=="object"?n[i]=H(e[i],t):n[i]=e[i]}return n},Je=e=>H(e);class Ze extends j{value;constructor(t){super(),this.value=t}next(t){super.next(this.value=t)}error(t){super.error(this.value=t)}getValue(){return this.value}_subscribe(t){const n=super._subscribe(t);return t.next(this.value),n}}function Be(e){return new d(t=>{const n={};let i=Object.keys(e).length;const o=r=>s=>{r in n||i--,n[r]=s,i===0&&t.next(n)};return Object.entries(e).reduce((r,[s,a])=>r.add(a.subscribe(o(s))),new R)})}function Ke(...e){return new d(t=>e.reduce((n,i)=>n.add(i.subscribe(t)),new R))}var et=e=>new d(t=>{const n=window.setTimeout(()=>{try{t.next()}catch(i){if(t.error)t.error(i);else throw i}},e);return()=>window.clearTimeout(n)}),tt=e=>new d(t=>{const n=window.setInterval(()=>t.next(),e);return()=>window.clearInterval(n)}),nt=e=>new d(t=>{e.forEach(n=>t.next(n))}),it=(e,t)=>new d(n=>{const i=o=>n.next(o);return e.addEventListener(t,i),()=>e.removeEventListener(t,i)});function st(e){return t=>new d(n=>t.subscribe(new ce(n,e)))}class ce{destination;size;lastValues=[];constructor(t,n){this.destination=t,this.size=n}next(t){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(t),this.destination.next(this.lastValues)}error(t){this.destination.error?.(t)}}const ue={leading:!1,trailing:!0};function rt(e,t=ue){return n=>new d(i=>n.subscribe(new le(i,e,t)))}class le{destination;time;config;lastValue;timeout;constructor(t,n,i){this.destination=t,this.time=n,this.config=i}next(t){this.lastValue=t,K(this.timeout)?window.clearTimeout(this.timeout):this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout(()=>{if(this.config.trailing)try{this.destination.next(this.lastValue)}catch(n){if(this.destination.error)this.destination.error(n);else throw n}this.timeout=void 0},this.time)}error(t){this.destination.error?.(t)}}const de={leading:!0,trailing:!1};function ot(e,t=de){return n=>new d(i=>n.subscribe(new he(i,e,t)))}class he{destination;time;config;lastValue;timeout;constructor(t,n,i){this.destination=t,this.time=n,this.config=i}next(t){this.lastValue=t,ee(this.timeout)&&(this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout(()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0},this.time))}error(t){this.destination.error?.(t)}}function at(e){return t=>new d(n=>t.subscribe(new fe(n,e)))}class fe{destination;predicate;constructor(t,n){this.destination=t,this.predicate=n}next(t){let n;try{n=this.predicate(t)}catch(i){throw this.error(i),i}n&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function ct(e=(t,n)=>t===n){return t=>new d(n=>t.subscribe(new me(n,e)))}const F={};class me{destination;predicate;lastValue=F;constructor(t,n){this.destination=t,this.predicate=n}next(t){let n;try{n=this.lastValue===F||!this.predicate(this.lastValue,t),this.lastValue=t}catch(i){throw this.error(i),i}n&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function we(e){return t=>new d(n=>t.subscribe(new ge(n,e)))}let ge=class{destination;mapper;constructor(t,n){this.destination=t,this.mapper=n}next(t){let n;try{n=this.mapper(t)}catch(i){throw this.error(i),i}this.destination.next(n)}error(t){this.destination.error?.(t)}};function lt(e){return we(()=>e)}function dt(){return e=>new d(t=>{let n=!1,i=!1;const o=e.subscribe(r=>{n||(n=!0,t.next(r)),i&&o.unsubscribe()},r=>{n=!0,t.error?.(r),i&&o.unsubscribe()});return i=!0,n&&o.unsubscribe(),o})}function ht(){return e=>new d(t=>e.subscribe(new pe(t)))}class pe{destination;last;hasLast=!1;constructor(t){this.destination=t}next(t){const n=this.last;if(this.last=t,!this.hasLast){this.hasLast=!0;return}this.destination.next([n,t])}error(t){this.destination.error?.(t)}}function ft(e){return t=>new d(n=>t.subscribe(new be(n,e)))}class be{destination;effect;constructor(t,n){this.destination=t,this.effect=n}next(t){try{this.effect(t)}catch(n){throw this.error(n),n}this.destination.next(t)}error(t){this.destination.error?.(t)}}var Q;(function(e){e.NETWORK="network",e.VIDEO_PIPELINE="video_pipeline",e.EXTERNAL_API="external_api",e.PARSER="parser",e.DOM="dom",e.WTF="wtf"})(Q||(Q={}));var V;(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"})(V||(V={}));const Ee="vk.com",mt=async(e,t,n)=>{const i=new URL(`https://${Ee}/js/lang-pack.js`);i.searchParams.set("format","json"),i.searchParams.set("name",t),e!==void 0&&i.searchParams.set("lang",e);const r=await(await fetch(i.toString())).json();return Se(r,n)},Se=(e,t)=>Object.fromEntries(Object.entries(e.keys).map(([n,i])=>[n.substring(`${t}_`.length),xe(i)])),xe=e=>Array.isArray(e)?e[0]:e;var G;(function(e){e.RU="ru",e.EN="en"})(G||(G={}));export{p as CurrentClientBrowser,l as CurrentClientDevice,Q as ErrorCategory,G as InterfaceLanguage,ve as Logger,d as Observable,j as Subject,R as Subscription,Ae as VERSION,V as VKNumericLanguage,Ze as ValueSubject,f as VideoQuality,Re as abortable,Pe as addScript,He as areQualitiesExact,_e as assertEmptyArray,x as assertNever,ye as assertNonNullable,Ie as assertNotEmptyArray,Te as assertNullable,Ce as assertQualityIsExact,st as buffer,Oe as checkNever,Je as cloneDeep,H as cloneDeepWith,Be as combine,rt as debounce,Xe as debounceFn,Qe as detectEmbed,ae as fillWithDefault,at as filter,ct as filterChanged,it as fromEvent,W as getCurrentBrowser,De as getExponentialDelay,We as getHighestQuality,Ne as getIOSVersion,tt as interval,Ve as isHigher,Ge as isHigherOrEqual,Le as isIOS,$ as isInvariantQuality,q as isLower,je as isLowerOrEqual,ke as isMacLike,Ue as isMobile,K as isNonNullable,ee as isNullable,mt as loadVKLangPack,we as map,lt as mapTo,Ke as merge,y as noop,Me as now,nt as observableFrom,dt as once,ht as pairwise,Fe as safeStorage,ft as tap,ot as throttle,Ye as timeCodeToString,et as timeout,qe as videoHeightToQuality,$e as videoQualityToHeight,ze as videoSizeToQuality};
6
+ const ye="1.0.35-beta.0";class M{subscriptions=[];unsubscribe(){const t=this.subscriptions;this.subscriptions=[],t.forEach(n=>typeof n=="function"?n():n.unsubscribe())}add(t){return this.subscriptions.push(t),this}}const x=e=>{throw new Error(`${e} is value of unexpected type`)},Te=e=>{},y=()=>{};class h{constructor(t){t&&(this._subscribe=t)}subscribe(t,n){let i;n?typeof n=="function"?i={next:n,error:y}:i={next:s=>n.next(s),error:s=>n.error?.(s)}:i={next:y,error:y};const o=typeof t=="function"?{next:s=>{try{t(s)}catch(a){i.next(a)}},error:s=>i.next(s)}:{next:s=>t.next(s),error:s=>t.error?t.error(s):i.next(s)};let r;try{r=this._subscribe(o)}catch(s){o.error?.(s)}return new M().add(()=>{switch(o.next=y,o.error=y,typeof r){case"function":r();return;case"object":r.unsubscribe();return;case"undefined":return;default:return x(r)}})}pipe(...t){return t.reduce((n,i)=>i(n),this)}_subscribe(t){}}class W extends h{keyCounter=0;subscribers=new Map;constructor(){super()}next(t){this.subscribers.forEach(n=>n.next(t))}error(t){this.subscribers.forEach(n=>n.error?.(t))}_subscribe(t){const n=this.keyCounter++;return this.subscribers.set(n,t),new M().add(()=>this.subscribers.delete(n))}}class Re{log$=new W;logs=[];log=t=>{const n={...t,timestamp:Date.now()};this.logs.push(n),this.log$.next(n)};createCustomLog(t){return(...n)=>{let i;try{i=t(...n)}catch{i={message:"error in `createCustomLog`",component:"Logger"}}this.log(i)}}createComponentLog(t){return this.createCustomLog(n=>({component:t,...n}))}getAllLogs=()=>this.logs}function Ie(e,t='Assertion "value is not nullable" failed'){if(e==null)throw new Error(t)}function _e(e,t='Assertion "value is nullable" failed'){if(e!=null)throw new Error(t)}function k(e){return typeof e<"u"&&e!==null}function ee(e){return e==null}function Pe(e,t){if(!e?.length)throw new Error(t)}function Me(e,t){if(e?.length)throw new Error(t)}const Le=(e,t,n)=>new Promise((i,o)=>{t.addEventListener("abort",()=>{a(),l.remove()});const r=()=>{a(),o()},s=()=>{a(),i()},a=()=>{d&&clearTimeout(d),l.removeEventListener("load",s),l.removeEventListener("error",r)};let d;n&&(d=window.setTimeout(r,n));const l=document.createElement("script");l.addEventListener("load",s),l.addEventListener("error",r),l.src=e,document.head.appendChild(l)}),Ne=typeof window.performance?.now=="function"?()=>window.performance.now():()=>Date.now(),ke=(e,t)=>async(...n)=>{const i=t(...n);let o=e.aborted,r;for(;!o&&!e.aborted;)try{const s=await i.next(r);o=s.done??!1,r=s.value}catch(s){await i.throw(s)}return r};var p;(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"})(p||(p={}));var f;(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"})(f||(f={}));const j=()=>{const{userAgent:e}=window.navigator,t=/yabrowser/i.test(e)?p.Yandex:void 0,n=/chrome|crios/i.test(e)?p.Chrome:void 0,i=/chromium/i.test(e)?p.Chromium:void 0,o=/firefox|fxios/i.test(e)?p.Firefox:void 0,r=/webkit|safari|khtml/i.test(e)?p.Safari:void 0,s=/opr\//i.test(e)?p.Opera:void 0,a=/edg/i.test(e)?p.Edge:void 0,d=/android/i.test(e)?f.Android:void 0,l=/iphone/i.test(e)?f.iPhone:void 0,T=/ipad/i.test(e)?f.iPad:void 0,S=/ipod/i.test(e)?f.iPod:void 0,v=/mac/i.test(e)?f.Mac:void 0,R=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(e)?f.RestMobile:void 0;return{browser:t||o||s||a||n||i||r||p.Rest,device:d||l||T||S||R||v||f.Desktop}},Ue=(e=!1)=>{const n=[f.iPhone,f.iPad,f.iPod].includes(j().device);if(!e)return n;const{userAgent:i,maxTouchPoints:o}=window.navigator;return!!(n||/macintosh/i.test(i)&&o>0)},Fe=()=>{const{userAgent:e}=window.navigator,t=e.match(/Version\/(\d+(\.\d+)?)/i);if(!t)return null;const n=t[1],i=parseFloat(n);return isNaN(i)?null:i},De=()=>[f.Mac,f.iPhone,f.iPad,f.iPod].includes(j().device),Qe=()=>/Mobile|mini|Fennec|Android|iP(ad|od|hone)/.test(navigator.appVersion??navigator.userAgent)||navigator?.userAgentData?.mobile,Ve=(e,{start:t=0,factor:n=2,max:i=1/0,min:o=t,random:r=0}={})=>{let s=t;return s*=n**e,s*=1+(Math.random()*r*2-r),s=Math.round(s),s=Math.min(s,i),s=Math.max(s,o),s};var u;(function(e){e[e.LOCAL_STORAGE=0]="LOCAL_STORAGE",e[e.SESSION_STORAGE=1]="SESSION_STORAGE",e[e.RUNTIME=2]="RUNTIME"})(u||(u={}));let A,E;const N=`vk-videoplayer-dummy-key-${Math.random()}`,O=()=>{if(E!==void 0)return E;try{localStorage.setItem(N,"test"),localStorage.removeItem(N),E=u.LOCAL_STORAGE}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem(N),E=u.SESSION_STORAGE}catch(t){if(t instanceof DOMException||t instanceof TypeError)E=u.RUNTIME;else throw t}else throw e}return E===u.RUNTIME&&(A=new Map),E},te=()=>O()===u.LOCAL_STORAGE,ne=e=>{const t=O();switch(t){case u.LOCAL_STORAGE:return localStorage.getItem(e)??void 0;case u.SESSION_STORAGE:return sessionStorage.getItem(e)??void 0;case u.RUNTIME:return A?.get(e);default:x(t)}},ie=(e,t)=>{const n=O();switch(n){case u.LOCAL_STORAGE:try{localStorage.setItem(e,t)}catch(i){if(i instanceof DOMException)console.error(i);else throw i}break;case u.SESSION_STORAGE:try{sessionStorage.setItem(e,t)}catch(i){if(i instanceof DOMException)console.error(i);else throw i}break;case u.RUNTIME:return void A?.set(e,t);default:x(n)}},se=e=>{const t=O();switch(t){case u.LOCAL_STORAGE:return e in localStorage;case u.SESSION_STORAGE:return e in sessionStorage;case u.RUNTIME:return A?.has(e)??!1;default:return x(t),!1}},re=e=>{const t=O();switch(t){case u.LOCAL_STORAGE:return localStorage.removeItem(e);case u.SESSION_STORAGE:return sessionStorage.removeItem(e);case u.RUNTIME:return void A?.delete(e);default:x(t)}},oe=()=>{const e=O();switch(e){case u.LOCAL_STORAGE:return localStorage.clear();case u.SESSION_STORAGE:return sessionStorage.clear();case u.RUNTIME:return A?.clear();default:x(e)}};var ze=Object.freeze({__proto__:null,clear:oe,get:ne,has:se,isPersistent:te,remove:re,set:ie});const Ge=()=>{let e,t;try{e=window.self!==window.top}catch(i){i instanceof DOMException&&i.name==="SecurityError"?e=!0:(e=!1,console.error(i))}try{window.location.ancestorOrigins&&(t=window.location.ancestorOrigins[window.location.ancestorOrigins.length-1])}catch(i){console.error(i)}try{!t&&document.referrer&&(t=document.referrer)}catch(i){console.error(i)}const n=t?new URL(t).hostname:void 0;return{isEmbed:e,host:n}};var m;(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"})(m||(m={}));const w={[m.Q_144P]:{width:256,height:144},[m.Q_240P]:{width:428,height:240},[m.Q_360P]:{width:640,height:360},[m.Q_480P]:{width:856,height:480},[m.Q_720P]:{width:1280,height:720},[m.Q_1080P]:{width:1920,height:1080},[m.Q_1440P]:{width:2560,height:1440},[m.Q_2160P]:{width:3840,height:2160},[m.Q_4320P]:{width:7680,height:4320}},We=(e,t)=>w[e].height>w[t].height,je=(e,t)=>w[e].height>=w[t].height,q=(e,t)=>w[e].height<w[t].height,qe=(e,t)=>w[e].height<=w[t].height,$e=e=>e.sort((t,n)=>t===n?0:t===m.INVARIANT?1:n===m.INVARIANT?-1:q(t,n)?1:-1)[0],$=Object.keys(w).sort((e,t)=>q(e,t)?-1:1),He=(e,t=.02)=>[...$].find(i=>w[i].height*(1+t)>=e),Ce=({width:e,height:t})=>{const n=Math.min(e,t),i=Math.max(e,t);return $.find(o=>{const r=w[o];return r.width>=i&&r.height>=n})},Be=e=>w[e].height,H=e=>e===m.INVARIANT,Ye=e=>e.every(t=>!H(t));function Xe(e){if(H(e))throw new Error("Expected exact quality")}const ae=(e,t)=>{const n={};for(const i of Object.keys(t)){const o=t[i],r=e[i];Array.isArray(o)&&Array.isArray(r)?n[i]=r:typeof o=="object"&&typeof r=="object"?n[i]=ae(r,o):n[i]=i in e?r:o}return n},Je=e=>{let t="";return e>=3600&&(t+=Math.floor(e/3600)+"h",e=e%3600),e>=60&&(t+=Math.floor(e/60)+"m",e=e%60),e>0&&(t+=Math.floor(e)+"s"),t};function ce(e,t=0,n){let i,o,r,s,a,d,l=0,T=!1,S=!1,v=!0;const R=!t&&t!==0&&typeof window.requestAnimationFrame=="function";n&&(T=!!n.leading,S="maxWait"in n,r=n?.maxWait?Math.max(+n?.maxWait||0,t):r,v="trailing"in n?!!n.trailing:v);function L(c){const g=i,b=o;return i=o=void 0,l=c,s=e.apply(b,g),s}function I(c,g){return R?(a&&window.cancelAnimationFrame(a),window.requestAnimationFrame(c)):setTimeout(c,g)}function B(c){if(R){window.cancelAnimationFrame(c);return}clearTimeout(c)}function Y(c){return l=c,a=I(_,t),T?L(c):s}function X(c){const g=c-d,b=c-l,D=t-g;return S?Math.min(D,r-b):D}function U(c){const g=c-d,b=c-l;return d===void 0||g>=t||g<0||S&&b>=r}function _(){const c=Date.now();if(U(c))return F(c);a=I(_,X(c))}function F(c){return a=void 0,v&&i?L(c):(i=o=void 0,s)}function J(){a!==void 0&&B(a),l=0,i=d=o=a=void 0}function Z(){return a===void 0?s:F(Date.now())}function K(){return a!==void 0}function P(...c){const g=Date.now(),b=U(g);if(i=c,o=this,d=g,b){if(a===void 0)return Y(d);if(S)return a=I(_,t),L(d)}return a===void 0&&(a=I(_,t)),s}return P.cancel=J,P.flush=Z,P.pending=K,P}const ue=(e,t=0,n)=>ce(e,t,{...{leading:!0,trailing:!0},...n,maxWait:t}),C=(e,t)=>{if(e===null||typeof e!="object")return e;const n=Array.isArray(e)?[]:{};for(const i in e){if(typeof t=="function"){const o=t(e[i],i,e,n);if(o!==void 0){n[i]=o;continue}}typeof e[i]=="object"?n[i]=C(e[i],t):n[i]=e[i]}return n},Ze=e=>C(e),le=300,Ke=(e,t=le)=>new h(n=>{const{width:i,height:o}=e.getBoundingClientRect();if(n.next({width:i,height:o}),!window.ResizeObserver)return;const r=new ResizeObserver(ue(s=>{const a=s[0];if(!a)return;let d,l;a.contentBoxSize&&a.contentBoxSize[0]?(l=a.contentBoxSize[0].blockSize,d=a.contentBoxSize[0].inlineSize):a.contentRect&&(d=a.contentRect.width,l=a.contentRect.height),k(d)&&k(l)&&n.next({width:d,height:l})},t));return r.observe(e),()=>r.disconnect()});class et extends W{value;constructor(t){super(),this.value=t}next(t){super.next(this.value=t)}error(t){super.error(this.value=t)}getValue(){return this.value}_subscribe(t){const n=super._subscribe(t);return t.next(this.value),n}}function tt(e){return new h(t=>{const n={};let i=Object.keys(e).length;const o=r=>s=>{r in n||i--,n[r]=s,i===0&&t.next(n)};return Object.entries(e).reduce((r,[s,a])=>r.add(a.subscribe(o(s))),new M)})}function nt(...e){return new h(t=>e.reduce((n,i)=>n.add(i.subscribe(t)),new M))}var it=e=>new h(t=>{const n=window.setTimeout(()=>{try{t.next()}catch(i){if(t.error)t.error(i);else throw i}},e);return()=>window.clearTimeout(n)}),st=e=>new h(t=>{const n=window.setInterval(()=>t.next(),e);return()=>window.clearInterval(n)}),rt=e=>new h(t=>{e.forEach(n=>t.next(n))}),ot=(e,t)=>new h(n=>{const i=o=>n.next(o);return e.addEventListener(t,i),()=>e.removeEventListener(t,i)});function at(e){return t=>new h(n=>t.subscribe(new de(n,e)))}class de{destination;size;lastValues=[];constructor(t,n){this.destination=t,this.size=n}next(t){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(t),this.destination.next(this.lastValues)}error(t){this.destination.error?.(t)}}const he={leading:!1,trailing:!0};function ct(e,t=he){return n=>new h(i=>n.subscribe(new fe(i,e,t)))}class fe{destination;time;config;lastValue;timeout;constructor(t,n,i){this.destination=t,this.time=n,this.config=i}next(t){this.lastValue=t,k(this.timeout)?window.clearTimeout(this.timeout):this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout(()=>{if(this.config.trailing)try{this.destination.next(this.lastValue)}catch(n){if(this.destination.error)this.destination.error(n);else throw n}this.timeout=void 0},this.time)}error(t){this.destination.error?.(t)}}const me={leading:!0,trailing:!1};function ut(e,t=me){return n=>new h(i=>n.subscribe(new we(i,e,t)))}class we{destination;time;config;lastValue;timeout;constructor(t,n,i){this.destination=t,this.time=n,this.config=i}next(t){this.lastValue=t,ee(this.timeout)&&(this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout(()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0},this.time))}error(t){this.destination.error?.(t)}}function lt(e){return t=>new h(n=>t.subscribe(new ge(n,e)))}class ge{destination;predicate;constructor(t,n){this.destination=t,this.predicate=n}next(t){let n;try{n=this.predicate(t)}catch(i){throw this.error(i),i}n&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function dt(e=(t,n)=>t===n){return t=>new h(n=>t.subscribe(new pe(n,e)))}const Q={};class pe{destination;predicate;lastValue=Q;constructor(t,n){this.destination=t,this.predicate=n}next(t){let n;try{n=this.lastValue===Q||!this.predicate(this.lastValue,t),this.lastValue=t}catch(i){throw this.error(i),i}n&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function be(e){return t=>new h(n=>t.subscribe(new Ee(n,e)))}let Ee=class{destination;mapper;constructor(t,n){this.destination=t,this.mapper=n}next(t){let n;try{n=this.mapper(t)}catch(i){throw this.error(i),i}this.destination.next(n)}error(t){this.destination.error?.(t)}};function ft(e){return be(()=>e)}function mt(){return e=>new h(t=>{let n=!1,i=!1;const o=e.subscribe(r=>{n||(n=!0,t.next(r)),i&&o.unsubscribe()},r=>{n=!0,t.error?.(r),i&&o.unsubscribe()});return i=!0,n&&o.unsubscribe(),o})}function wt(){return e=>new h(t=>e.subscribe(new Se(t)))}class Se{destination;last;hasLast=!1;constructor(t){this.destination=t}next(t){const n=this.last;if(this.last=t,!this.hasLast){this.hasLast=!0;return}this.destination.next([n,t])}error(t){this.destination.error?.(t)}}function gt(e){return t=>new h(n=>t.subscribe(new xe(n,e)))}class xe{destination;effect;constructor(t,n){this.destination=t,this.effect=n}next(t){try{this.effect(t)}catch(n){throw this.error(n),n}this.destination.next(t)}error(t){this.destination.error?.(t)}}var V;(function(e){e.NETWORK="network",e.VIDEO_PIPELINE="video_pipeline",e.EXTERNAL_API="external_api",e.PARSER="parser",e.DOM="dom",e.WTF="wtf"})(V||(V={}));var z;(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"})(z||(z={}));const Ae="vk.com",pt=async(e,t,n)=>{const i=new URL(`https://${Ae}/js/lang-pack.js`);i.searchParams.set("format","json"),i.searchParams.set("name",t),e!==void 0&&i.searchParams.set("lang",e);const r=await(await fetch(i.toString())).json();return Oe(r,n)},Oe=(e,t)=>Object.fromEntries(Object.entries(e.keys).map(([n,i])=>[n.substring(`${t}_`.length),ve(i)])),ve=e=>Array.isArray(e)?e[0]:e;var G;(function(e){e.RU="ru",e.EN="en"})(G||(G={}));export{p as CurrentClientBrowser,f as CurrentClientDevice,V as ErrorCategory,G as InterfaceLanguage,Re as Logger,h as Observable,W as Subject,M as Subscription,ye as VERSION,z as VKNumericLanguage,et as ValueSubject,m as VideoQuality,ke as abortable,Le as addScript,Ye as areQualitiesExact,Me as assertEmptyArray,x as assertNever,Ie as assertNonNullable,Pe as assertNotEmptyArray,_e as assertNullable,Xe as assertQualityIsExact,at as buffer,Te as checkNever,Ze as cloneDeep,C as cloneDeepWith,tt as combine,ct as debounce,ce as debounceFn,Ge as detectEmbed,ae as fillWithDefault,lt as filter,dt as filterChanged,ot as fromEvent,j as getCurrentBrowser,Ve as getExponentialDelay,$e as getHighestQuality,Fe as getIOSVersion,st as interval,We as isHigher,je as isHigherOrEqual,Ue as isIOS,H as isInvariantQuality,q as isLower,qe as isLowerOrEqual,De as isMacLike,Qe as isMobile,k as isNonNullable,ee as isNullable,pt as loadVKLangPack,be as map,ft as mapTo,nt as merge,y as noop,Ne as now,rt as observableFrom,Ke as observeElementSize,mt as once,wt as pairwise,ze as safeStorage,gt as tap,ut as throttle,ue as throttleFn,Je as timeCodeToString,it as timeout,He as videoHeightToQuality,Be as videoQualityToHeight,Ce as videoSizeToQuality};
package/index.d.ts CHANGED
@@ -294,8 +294,16 @@ interface DebouncedFn<T extends (...args: any[]) => any> {
294
294
  }
295
295
  declare function debounceFn<T extends (...args: any) => any>(func: T, wait?: number, options?: DebounceSettings): DebouncedFn<T>;
296
296
 
297
+ interface ThrottleOptions {
298
+ leading?: boolean;
299
+ trailing?: boolean;
300
+ }
301
+ declare const throttleFn: <T extends (...args: any) => any>(func: T, wait?: number, options?: ThrottleOptions) => DebouncedFn<T>;
302
+
297
303
  declare const cloneDeep: <T>(obj: T) => T;
298
304
 
305
+ declare const observeElementSize: (element: Element, throttleTime?: Milliseconds) => IObservable<IRectangle>;
306
+
299
307
  type CloneDeepWithCustomizer<TObject> = (value: unknown, key: number | string | undefined, object: TObject | undefined, stack: any) => any;
300
308
  declare const cloneDeepWith: <T>(obj: T, customizer?: CloneDeepWithCustomizer<T> | undefined) => T;
301
309
 
@@ -403,4 +411,4 @@ declare enum VKNumericLanguage {
403
411
  type VKLanguage = VKNumericLanguage | string;
404
412
  declare const loadVKLangPack: <T extends StringRecord>(language: VKLanguage, packName: string, packPrefix: string) => Promise<T>;
405
413
 
406
- export { Byte, CurrentClientBrowser, CurrentClientDevice, DebouncedFn, ErrorCategory, ExactVideoQuality, ExponentialBackoffConfig, IComponentLogEntry, IComponentLogger, ICurrentBrowserInfo, IEmitter, IError, IListener, ILogEntry, ILogInputEntry, ILogger, IObservable, IOperator, IRange, IRectangle, ISubject, ISubscription, IUnsubscriber, IValue, IValueObservable, IValueSubject, IWarning, InterfaceLanguage, Kbps, Logger, Mbps, Milliseconds, Nullable, Observable, Percentage, QualityLimits, RecursivePartial, Seconds, StringRecord, Subject, Subscription, VERSION, VKLanguage, VKNumericLanguage, ValueSubject, VideoQuality, abortable, addScript, areQualitiesExact, assertEmptyArray, assertNever, assertNonNullable, assertNotEmptyArray, assertNullable, assertQualityIsExact, bps, buffer, checkNever, cloneDeep, cloneDeepWith, combine, debounce, debounceFn, detectEmbed, fillWithDefault, filter, filterChanged, _default as fromEvent, getCurrentBrowser, getExponentialDelay, getHighestQuality, getIOSVersion, _default$2 as interval, isHigher, isHigherOrEqual, isIOS, isInvariantQuality, isLower, isLowerOrEqual, isMacLike, isMobile, isNonNullable, isNullable, loadVKLangPack, map, mapTo, merge, noop, now, _default$1 as observableFrom, once, pairwise, iframeSafeStorage_d as safeStorage, tap, throttle, timeCodeToString, _default$3 as timeout, videoHeightToQuality, videoQualityToHeight, videoSizeToQuality };
414
+ export { Byte, CurrentClientBrowser, CurrentClientDevice, DebouncedFn, ErrorCategory, ExactVideoQuality, ExponentialBackoffConfig, IComponentLogEntry, IComponentLogger, ICurrentBrowserInfo, IEmitter, IError, IListener, ILogEntry, ILogInputEntry, ILogger, IObservable, IOperator, IRange, IRectangle, ISubject, ISubscription, IUnsubscriber, IValue, IValueObservable, IValueSubject, IWarning, InterfaceLanguage, Kbps, Logger, Mbps, Milliseconds, Nullable, Observable, Percentage, QualityLimits, RecursivePartial, Seconds, StringRecord, Subject, Subscription, ThrottleOptions, VERSION, VKLanguage, VKNumericLanguage, ValueSubject, VideoQuality, abortable, addScript, areQualitiesExact, assertEmptyArray, assertNever, assertNonNullable, assertNotEmptyArray, assertNullable, assertQualityIsExact, bps, buffer, checkNever, cloneDeep, cloneDeepWith, combine, debounce, debounceFn, detectEmbed, fillWithDefault, filter, filterChanged, _default as fromEvent, getCurrentBrowser, getExponentialDelay, getHighestQuality, getIOSVersion, _default$2 as interval, isHigher, isHigherOrEqual, isIOS, isInvariantQuality, isLower, isLowerOrEqual, isMacLike, isMobile, isNonNullable, isNullable, loadVKLangPack, map, mapTo, merge, noop, now, _default$1 as observableFrom, observeElementSize, once, pairwise, iframeSafeStorage_d as safeStorage, tap, throttle, throttleFn, timeCodeToString, _default$3 as timeout, videoHeightToQuality, videoQualityToHeight, videoSizeToQuality };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vkontakte/videoplayer-shared",
3
- "version": "1.0.34",
3
+ "version": "1.0.35-beta.0",
4
4
  "author": "vk.com",
5
5
  "description": "Shared code for vk.com videoplayer",
6
6
  "homepage": "https://vk.com",