@vkontakte/videoplayer-shared 1.0.36 → 1.0.37-dev.0bef53b3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/es2015.cjs.js +4 -4
  2. package/es2015.esm.js +4 -4
  3. package/es2018.cjs.js +4 -4
  4. package/es2018.esm.js +4 -4
  5. package/esnext.cjs.js +4 -4
  6. package/esnext.esm.js +4 -4
  7. package/evergreen.esm.js +4 -4
  8. package/package.json +7 -7
  9. package/types/Logger/Logger.d.ts +10 -0
  10. package/types/Logger/index.d.ts +2 -0
  11. package/types/Logger/types.d.ts +30 -0
  12. package/types/env.d.ts +1 -0
  13. package/types/index.d.ts +6 -0
  14. package/types/reactive/Observable.d.ts +7 -0
  15. package/types/reactive/Subject.d.ts +10 -0
  16. package/types/reactive/Subscription.d.ts +6 -0
  17. package/types/reactive/ValueSubject.d.ts +10 -0
  18. package/types/reactive/combine.d.ts +10 -0
  19. package/types/reactive/fromEvent.d.ts +7 -0
  20. package/types/reactive/index.d.ts +21 -0
  21. package/types/reactive/interval.d.ts +4 -0
  22. package/types/reactive/merge.d.ts +12 -0
  23. package/types/reactive/observableFrom.d.ts +3 -0
  24. package/types/reactive/operators/buffer.d.ts +2 -0
  25. package/types/reactive/operators/debounce.d.ts +6 -0
  26. package/types/reactive/operators/filter.d.ts +3 -0
  27. package/types/reactive/operators/filterChanged.d.ts +5 -0
  28. package/types/reactive/operators/map.d.ts +2 -0
  29. package/types/reactive/operators/mapTo.d.ts +2 -0
  30. package/types/reactive/operators/once.d.ts +5 -0
  31. package/types/reactive/operators/pairwise.d.ts +4 -0
  32. package/types/reactive/operators/tap.d.ts +2 -0
  33. package/types/reactive/operators/throttle.d.ts +5 -0
  34. package/types/reactive/timeout.d.ts +4 -0
  35. package/types/reactive/types.d.ts +29 -0
  36. package/types/translation/index.d.ts +2 -0
  37. package/types/translation/loadVKLangPack.d.ts +16 -0
  38. package/types/translation/types.d.ts +5 -0
  39. package/types/types/index.d.ts +53 -0
  40. package/types/utils/abortable.d.ts +3 -0
  41. package/types/utils/addScript.d.ts +1 -0
  42. package/types/utils/cloneDeep.d.ts +1 -0
  43. package/types/utils/cloneDeepWith.d.ts +3 -0
  44. package/types/utils/config.d.ts +2 -0
  45. package/types/utils/debounceFn.d.ts +13 -0
  46. package/types/utils/detectBrowser.d.ts +31 -0
  47. package/types/utils/detectEmbed.d.ts +4 -0
  48. package/types/utils/empty.d.ts +2 -0
  49. package/types/utils/exponentialBackoff.d.ts +9 -0
  50. package/types/utils/iframeSafeStorage.d.ts +6 -0
  51. package/types/utils/index.d.ts +22 -0
  52. package/types/utils/never.d.ts +2 -0
  53. package/types/utils/noop.d.ts +1 -0
  54. package/types/utils/now.d.ts +2 -0
  55. package/types/utils/nullable.d.ts +7 -0
  56. package/types/utils/observeElementSize.d.ts +3 -0
  57. package/types/utils/quality/index.d.ts +20 -0
  58. package/types/utils/quality/types.d.ts +21 -0
  59. package/types/utils/semanticTypes.d.ts +7 -0
  60. package/types/utils/throttleFn.d.ts +5 -0
  61. package/types/utils/timecode.d.ts +1 -0
  62. package/index.d.ts +0 -415
package/esnext.cjs.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
- * @vkontakte/videoplayer-shared v1.0.36
3
- * Tue, 18 Jun 2024 13:17:03 GMT
4
- * https://st.mycdn.me/static/vkontakte-videoplayer/1-0-36/doc/
2
+ * @vkontakte/videoplayer-shared v1.0.37-dev.0bef53b3.0
3
+ * Wed, 10 Jul 2024 00:39:25 GMT
4
+ * https://st.mycdn.me/static/vkontakte-videoplayer/1-0-37/doc/
5
5
  */
6
- "use strict";const ie="1.0.36";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}},Le=(e,t)=>g[e].height>g[t].height,Ce=(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 L(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=L(C,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 C(){const u=Date.now();if(k(u))return F(u);a=L(C,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=L(C,t),x(l)}return a===void 0&&(a=L(C,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=>{let n=window.setInterval(()=>t.next(),e);return()=>{n&&(window.clearInterval(n),n=void 0)}}),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",e.FATAL="fatal"})(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=Le;exports.isHigherOrEqual=Ce;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;
6
+ "use strict";var cs=Object.create;var Te=Object.defineProperty;var fs=Object.getOwnPropertyDescriptor;var ps=Object.getOwnPropertyNames;var vs=Object.getPrototypeOf,bs=Object.prototype.hasOwnProperty;var i=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),At=(e,r)=>{for(var t in r)Te(e,t,{get:r[t],enumerable:!0})},_t=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of ps(r))!bs.call(e,o)&&o!==t&&Te(e,o,{get:()=>r[o],enumerable:!(n=fs(r,o))||n.enumerable});return e};var ds=(e,r,t)=>(t=e!=null?cs(vs(e)):{},_t(r||!e||!e.__esModule?Te(t,"default",{value:e,enumerable:!0}):t,e)),ms=e=>_t(Te({},"__esModule",{value:!0}),e);var A=i((Xb,mn)=>{"use strict";mn.exports=function(e){try{return!!e()}catch{return!0}}});var se=i((Jb,Tn)=>{"use strict";var qs=A();Tn.exports=!qs(function(){var e=function(){}.bind();return typeof e!="function"||e.hasOwnProperty("prototype")})});var C=i((Zb,gn)=>{"use strict";var yn=se(),hn=Function.prototype,xr=hn.call,Rs=yn&&hn.bind.bind(xr,xr);gn.exports=yn?Rs:function(e){return function(){return xr.apply(e,arguments)}}});var qe=i((ed,On)=>{"use strict";var In=C(),Ps=In({}.toString),As=In("".slice);On.exports=function(e){return As(Ps(e),8,-1)}});var En=i((rd,xn)=>{"use strict";var _s=C(),Ls=A(),Cs=qe(),Er=Object,Ns=_s("".split);xn.exports=Ls(function(){return!Er("z").propertyIsEnumerable(0)})?function(e){return Cs(e)=="String"?Ns(e,""):Er(e)}:Er});var Re=i((td,Sn)=>{"use strict";Sn.exports=function(e){return e==null}});var Sr=i((nd,wn)=>{"use strict";var js=Re(),Ms=TypeError;wn.exports=function(e){if(js(e))throw Ms("Can't call method on "+e);return e}});var H=i((od,qn)=>{"use strict";var ks=En(),Ds=Sr();qn.exports=function(e){return ks(Ds(e))}});var Pn=i((id,Rn)=>{"use strict";Rn.exports=function(){}});var Q=i((ad,An)=>{"use strict";An.exports={}});var S=i((_n,Ln)=>{"use strict";var Pe=function(e){return e&&e.Math==Math&&e};Ln.exports=Pe(typeof globalThis=="object"&&globalThis)||Pe(typeof window=="object"&&window)||Pe(typeof self=="object"&&self)||Pe(typeof global=="object"&&global)||function(){return this}()||_n||Function("return this")()});var qr=i((sd,Cn)=>{"use strict";var wr=typeof document=="object"&&document.all,Vs=typeof wr>"u"&&wr!==void 0;Cn.exports={all:wr,IS_HTMLDDA:Vs}});var O=i((ud,jn)=>{"use strict";var Nn=qr(),Fs=Nn.all;jn.exports=Nn.IS_HTMLDDA?function(e){return typeof e=="function"||e===Fs}:function(e){return typeof e=="function"}});var Dn=i((ld,kn)=>{"use strict";var Us=S(),Gs=O(),Mn=Us.WeakMap;kn.exports=Gs(Mn)&&/native code/.test(String(Mn))});var B=i((cd,Un)=>{"use strict";var Vn=O(),Fn=qr(),Qs=Fn.all;Un.exports=Fn.IS_HTMLDDA?function(e){return typeof e=="object"?e!==null:Vn(e)||e===Qs}:function(e){return typeof e=="object"?e!==null:Vn(e)}});var N=i((fd,Gn)=>{"use strict";var Bs=A();Gn.exports=!Bs(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7})});var Pr=i((pd,Bn)=>{"use strict";var $s=S(),Qn=B(),Rr=$s.document,Ws=Qn(Rr)&&Qn(Rr.createElement);Bn.exports=function(e){return Ws?Rr.createElement(e):{}}});var Ar=i((vd,$n)=>{"use strict";var zs=N(),Ks=A(),Ys=Pr();$n.exports=!zs&&!Ks(function(){return Object.defineProperty(Ys("div"),"a",{get:function(){return 7}}).a!=7})});var _r=i((bd,Wn)=>{"use strict";var Hs=N(),Xs=A();Wn.exports=Hs&&Xs(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42})});var D=i((dd,zn)=>{"use strict";var Js=B(),Zs=String,eu=TypeError;zn.exports=function(e){if(Js(e))return e;throw eu(Zs(e)+" is not an object")}});var V=i((md,Kn)=>{"use strict";var ru=se(),Ae=Function.prototype.call;Kn.exports=ru?Ae.bind(Ae):function(){return Ae.apply(Ae,arguments)}});var _e=i((Td,Yn)=>{"use strict";Yn.exports={}});var Nr=i((yd,Xn)=>{"use strict";var Lr=_e(),Cr=S(),tu=O(),Hn=function(e){return tu(e)?e:void 0};Xn.exports=function(e,r){return arguments.length<2?Hn(Lr[e])||Hn(Cr[e]):Lr[e]&&Lr[e][r]||Cr[e]&&Cr[e][r]}});var jr=i((hd,Jn)=>{"use strict";var nu=C();Jn.exports=nu({}.isPrototypeOf)});var eo=i((gd,Zn)=>{"use strict";Zn.exports=typeof navigator<"u"&&String(navigator.userAgent)||""});var so=i((Id,ao)=>{"use strict";var io=S(),Mr=eo(),ro=io.process,to=io.Deno,no=ro&&ro.versions||to&&to.version,oo=no&&no.v8,q,Le;oo&&(q=oo.split("."),Le=q[0]>0&&q[0]<4?1:+(q[0]+q[1]));!Le&&Mr&&(q=Mr.match(/Edge\/(\d+)/),(!q||q[1]>=74)&&(q=Mr.match(/Chrome\/(\d+)/),q&&(Le=+q[1])));ao.exports=Le});var kr=i((Od,lo)=>{"use strict";var uo=so(),ou=A(),iu=S(),au=iu.String;lo.exports=!!Object.getOwnPropertySymbols&&!ou(function(){var e=Symbol();return!au(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&uo&&uo<41})});var Dr=i((xd,co)=>{"use strict";var su=kr();co.exports=su&&!Symbol.sham&&typeof Symbol.iterator=="symbol"});var Vr=i((Ed,fo)=>{"use strict";var uu=Nr(),lu=O(),cu=jr(),fu=Dr(),pu=Object;fo.exports=fu?function(e){return typeof e=="symbol"}:function(e){var r=uu("Symbol");return lu(r)&&cu(r.prototype,pu(e))}});var Ce=i((Sd,po)=>{"use strict";var vu=String;po.exports=function(e){try{return vu(e)}catch{return"Object"}}});var ue=i((wd,vo)=>{"use strict";var bu=O(),du=Ce(),mu=TypeError;vo.exports=function(e){if(bu(e))return e;throw mu(du(e)+" is not a function")}});var Ne=i((qd,bo)=>{"use strict";var Tu=ue(),yu=Re();bo.exports=function(e,r){var t=e[r];return yu(t)?void 0:Tu(t)}});var To=i((Rd,mo)=>{"use strict";var Fr=V(),Ur=O(),Gr=B(),hu=TypeError;mo.exports=function(e,r){var t,n;if(r==="string"&&Ur(t=e.toString)&&!Gr(n=Fr(t,e))||Ur(t=e.valueOf)&&!Gr(n=Fr(t,e))||r!=="string"&&Ur(t=e.toString)&&!Gr(n=Fr(t,e)))return n;throw hu("Can't convert object to primitive value")}});var le=i((Pd,yo)=>{"use strict";yo.exports=!0});var Io=i((Ad,go)=>{"use strict";var ho=S(),gu=Object.defineProperty;go.exports=function(e,r){try{gu(ho,e,{value:r,configurable:!0,writable:!0})}catch{ho[e]=r}return r}});var Qr=i((_d,xo)=>{"use strict";var Iu=S(),Ou=Io(),Oo="__core-js_shared__",xu=Iu[Oo]||Ou(Oo,{});xo.exports=xu});var Br=i((Ld,So)=>{"use strict";var Eu=le(),Eo=Qr();(So.exports=function(e,r){return Eo[e]||(Eo[e]=r!==void 0?r:{})})("versions",[]).push({version:"3.31.0",mode:Eu?"pure":"global",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 $r=i((Cd,wo)=>{"use strict";var Su=Sr(),wu=Object;wo.exports=function(e){return wu(Su(e))}});var j=i((Nd,qo)=>{"use strict";var qu=C(),Ru=$r(),Pu=qu({}.hasOwnProperty);qo.exports=Object.hasOwn||function(r,t){return Pu(Ru(r),t)}});var Wr=i((jd,Ro)=>{"use strict";var Au=C(),_u=0,Lu=Math.random(),Cu=Au(1 .toString);Ro.exports=function(e){return"Symbol("+(e===void 0?"":e)+")_"+Cu(++_u+Lu,36)}});var _=i((Md,Ao)=>{"use strict";var Nu=S(),ju=Br(),Po=j(),Mu=Wr(),ku=kr(),Du=Dr(),X=Nu.Symbol,zr=ju("wks"),Vu=Du?X.for||X:X&&X.withoutSetter||Mu;Ao.exports=function(e){return Po(zr,e)||(zr[e]=ku&&Po(X,e)?X[e]:Vu("Symbol."+e)),zr[e]}});var No=i((kd,Co)=>{"use strict";var Fu=V(),_o=B(),Lo=Vr(),Uu=Ne(),Gu=To(),Qu=_(),Bu=TypeError,$u=Qu("toPrimitive");Co.exports=function(e,r){if(!_o(e)||Lo(e))return e;var t=Uu(e,$u),n;if(t){if(r===void 0&&(r="default"),n=Fu(t,e,r),!_o(n)||Lo(n))return n;throw Bu("Can't convert object to primitive value")}return r===void 0&&(r="number"),Gu(e,r)}});var je=i((Dd,jo)=>{"use strict";var Wu=No(),zu=Vr();jo.exports=function(e){var r=Wu(e,"string");return zu(r)?r:r+""}});var J=i(ko=>{"use strict";var Ku=N(),Yu=Ar(),Hu=_r(),Me=D(),Mo=je(),Xu=TypeError,Kr=Object.defineProperty,Ju=Object.getOwnPropertyDescriptor,Yr="enumerable",Hr="configurable",Xr="writable";ko.f=Ku?Hu?function(r,t,n){if(Me(r),t=Mo(t),Me(n),typeof r=="function"&&t==="prototype"&&"value"in n&&Xr in n&&!n[Xr]){var o=Ju(r,t);o&&o[Xr]&&(r[t]=n.value,n={configurable:Hr in n?n[Hr]:o[Hr],enumerable:Yr in n?n[Yr]:o[Yr],writable:!1})}return Kr(r,t,n)}:Kr:function(r,t,n){if(Me(r),t=Mo(t),Me(n),Yu)try{return Kr(r,t,n)}catch{}if("get"in n||"set"in n)throw Xu("Accessors not supported");return"value"in n&&(r[t]=n.value),r}});var ce=i((Fd,Do)=>{"use strict";Do.exports=function(e,r){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:r}}});var $=i((Ud,Vo)=>{"use strict";var Zu=N(),el=J(),rl=ce();Vo.exports=Zu?function(e,r,t){return el.f(e,r,rl(1,t))}:function(e,r,t){return e[r]=t,e}});var ke=i((Gd,Uo)=>{"use strict";var tl=Br(),nl=Wr(),Fo=tl("keys");Uo.exports=function(e){return Fo[e]||(Fo[e]=nl(e))}});var De=i((Qd,Go)=>{"use strict";Go.exports={}});var Wo=i((Bd,$o)=>{"use strict";var ol=Dn(),Bo=S(),il=B(),al=$(),Jr=j(),Zr=Qr(),sl=ke(),ul=De(),Qo="Object already initialized",et=Bo.TypeError,ll=Bo.WeakMap,Ve,fe,Fe,cl=function(e){return Fe(e)?fe(e):Ve(e,{})},fl=function(e){return function(r){var t;if(!il(r)||(t=fe(r)).type!==e)throw et("Incompatible receiver, "+e+" required");return t}};ol||Zr.state?(R=Zr.state||(Zr.state=new ll),R.get=R.get,R.has=R.has,R.set=R.set,Ve=function(e,r){if(R.has(e))throw et(Qo);return r.facade=e,R.set(e,r),r},fe=function(e){return R.get(e)||{}},Fe=function(e){return R.has(e)}):(W=sl("state"),ul[W]=!0,Ve=function(e,r){if(Jr(e,W))throw et(Qo);return r.facade=e,al(e,W,r),r},fe=function(e){return Jr(e,W)?e[W]:{}},Fe=function(e){return Jr(e,W)});var R,W;$o.exports={set:Ve,get:fe,has:Fe,enforce:cl,getterFor:fl}});var Xo=i(($d,Ho)=>{"use strict";var pl=se(),Yo=Function.prototype,zo=Yo.apply,Ko=Yo.call;Ho.exports=typeof Reflect=="object"&&Reflect.apply||(pl?Ko.bind(zo):function(){return Ko.apply(zo,arguments)})});var rt=i((Wd,Jo)=>{"use strict";var vl=qe(),bl=C();Jo.exports=function(e){if(vl(e)==="Function")return bl(e)}});var ti=i(ri=>{"use strict";var Zo={}.propertyIsEnumerable,ei=Object.getOwnPropertyDescriptor,dl=ei&&!Zo.call({1:2},1);ri.f=dl?function(r){var t=ei(this,r);return!!t&&t.enumerable}:Zo});var ii=i(oi=>{"use strict";var ml=N(),Tl=V(),yl=ti(),hl=ce(),gl=H(),Il=je(),Ol=j(),xl=Ar(),ni=Object.getOwnPropertyDescriptor;oi.f=ml?ni:function(r,t){if(r=gl(r),t=Il(t),xl)try{return ni(r,t)}catch{}if(Ol(r,t))return hl(!Tl(yl.f,r,t),r[t])}});var si=i((Yd,ai)=>{"use strict";var El=A(),Sl=O(),wl=/#|\.prototype\./,pe=function(e,r){var t=Rl[ql(e)];return t==Al?!0:t==Pl?!1:Sl(r)?El(r):!!r},ql=pe.normalize=function(e){return String(e).replace(wl,".").toLowerCase()},Rl=pe.data={},Pl=pe.NATIVE="N",Al=pe.POLYFILL="P";ai.exports=pe});var tt=i((Hd,li)=>{"use strict";var ui=rt(),_l=ue(),Ll=se(),Cl=ui(ui.bind);li.exports=function(e,r){return _l(e),r===void 0?e:Ll?Cl(e,r):function(){return e.apply(r,arguments)}}});var nt=i((Xd,fi)=>{"use strict";var Ue=S(),Nl=Xo(),jl=rt(),Ml=O(),kl=ii().f,Dl=si(),Z=_e(),Vl=tt(),ee=$(),ci=j(),Fl=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 Nl(e,this,arguments)};return r.prototype=e.prototype,r};fi.exports=function(e,r){var t=e.target,n=e.global,o=e.stat,a=e.proto,s=n?Ue:o?Ue[t]:(Ue[t]||{}).prototype,u=n?Z:Z[t]||ee(Z,t,{})[t],f=u.prototype,l,c,p,b,d,T,y,I,h;for(b in r)l=Dl(n?b:t+(o?".":"#")+b,e.forced),c=!l&&s&&ci(s,b),T=u[b],c&&(e.dontCallGetSet?(h=kl(s,b),y=h&&h.value):y=s[b]),d=c&&y?y:r[b],!(c&&typeof T==typeof d)&&(e.bind&&c?I=Vl(d,Ue):e.wrap&&c?I=Fl(d):a&&Ml(d)?I=jl(d):I=d,(e.sham||d&&d.sham||T&&T.sham)&&ee(I,"sham",!0),ee(u,b,I),a&&(p=t+"Prototype",ci(Z,p)||ee(Z,p,{}),ee(Z[p],b,d),e.real&&f&&(l||!f[b])&&ee(f,b,d)))}});var bi=i((Jd,vi)=>{"use strict";var ot=N(),Ul=j(),pi=Function.prototype,Gl=ot&&Object.getOwnPropertyDescriptor,it=Ul(pi,"name"),Ql=it&&function(){}.name==="something",Bl=it&&(!ot||ot&&Gl(pi,"name").configurable);vi.exports={EXISTS:it,PROPER:Ql,CONFIGURABLE:Bl}});var mi=i((Zd,di)=>{"use strict";var $l=Math.ceil,Wl=Math.floor;di.exports=Math.trunc||function(r){var t=+r;return(t>0?Wl:$l)(t)}});var at=i((em,Ti)=>{"use strict";var zl=mi();Ti.exports=function(e){var r=+e;return r!==r||r===0?0:zl(r)}});var hi=i((rm,yi)=>{"use strict";var Kl=at(),Yl=Math.max,Hl=Math.min;yi.exports=function(e,r){var t=Kl(e);return t<0?Yl(t+r,0):Hl(t,r)}});var Ii=i((tm,gi)=>{"use strict";var Xl=at(),Jl=Math.min;gi.exports=function(e){return e>0?Jl(Xl(e),9007199254740991):0}});var st=i((nm,Oi)=>{"use strict";var Zl=Ii();Oi.exports=function(e){return Zl(e.length)}});var Si=i((om,Ei)=>{"use strict";var ec=H(),rc=hi(),tc=st(),xi=function(e){return function(r,t,n){var o=ec(r),a=tc(o),s=rc(n,a),u;if(e&&t!=t){for(;a>s;)if(u=o[s++],u!=u)return!0}else for(;a>s;s++)if((e||s in o)&&o[s]===t)return e||s||0;return!e&&-1}};Ei.exports={includes:xi(!0),indexOf:xi(!1)}});var Ri=i((im,qi)=>{"use strict";var nc=C(),ut=j(),oc=H(),ic=Si().indexOf,ac=De(),wi=nc([].push);qi.exports=function(e,r){var t=oc(e),n=0,o=[],a;for(a in t)!ut(ac,a)&&ut(t,a)&&wi(o,a);for(;r.length>n;)ut(t,a=r[n++])&&(~ic(o,a)||wi(o,a));return o}});var lt=i((am,Pi)=>{"use strict";Pi.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]});var _i=i((sm,Ai)=>{"use strict";var sc=Ri(),uc=lt();Ai.exports=Object.keys||function(r){return sc(r,uc)}});var Ci=i(Li=>{"use strict";var lc=N(),cc=_r(),fc=J(),pc=D(),vc=H(),bc=_i();Li.f=lc&&!cc?Object.defineProperties:function(r,t){pc(r);for(var n=vc(t),o=bc(t),a=o.length,s=0,u;a>s;)fc.f(r,u=o[s++],n[u]);return r}});var ji=i((lm,Ni)=>{"use strict";var dc=Nr();Ni.exports=dc("document","documentElement")});var vt=i((cm,Gi)=>{"use strict";var mc=D(),Tc=Ci(),Mi=lt(),yc=De(),hc=ji(),gc=Pr(),Ic=ke(),ki=">",Di="<",ft="prototype",pt="script",Fi=Ic("IE_PROTO"),ct=function(){},Ui=function(e){return Di+pt+ki+e+Di+"/"+pt+ki},Vi=function(e){e.write(Ui("")),e.close();var r=e.parentWindow.Object;return e=null,r},Oc=function(){var e=gc("iframe"),r="java"+pt+":",t;return e.style.display="none",hc.appendChild(e),e.src=String(r),t=e.contentWindow.document,t.open(),t.write(Ui("document.F=Object")),t.close(),t.F},Ge,Qe=function(){try{Ge=new ActiveXObject("htmlfile")}catch{}Qe=typeof document<"u"?document.domain&&Ge?Vi(Ge):Oc():Vi(Ge);for(var e=Mi.length;e--;)delete Qe[ft][Mi[e]];return Qe()};yc[Fi]=!0;Gi.exports=Object.create||function(r,t){var n;return r!==null?(ct[ft]=mc(r),n=new ct,ct[ft]=null,n[Fi]=r):n=Qe(),t===void 0?n:Tc.f(n,t)}});var Bi=i((fm,Qi)=>{"use strict";var xc=A();Qi.exports=!xc(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})});var dt=i((pm,Wi)=>{"use strict";var Ec=j(),Sc=O(),wc=$r(),qc=ke(),Rc=Bi(),$i=qc("IE_PROTO"),bt=Object,Pc=bt.prototype;Wi.exports=Rc?bt.getPrototypeOf:function(e){var r=wc(e);if(Ec(r,$i))return r[$i];var t=r.constructor;return Sc(t)&&r instanceof t?t.prototype:r instanceof bt?Pc:null}});var mt=i((vm,zi)=>{"use strict";var Ac=$();zi.exports=function(e,r,t,n){return n&&n.enumerable?e[r]=t:Ac(e,r,t),e}});var gt=i((bm,Hi)=>{"use strict";var _c=A(),Lc=O(),Cc=B(),Nc=vt(),Ki=dt(),jc=mt(),Mc=_(),kc=le(),ht=Mc("iterator"),Yi=!1,M,Tt,yt;[].keys&&(yt=[].keys(),"next"in yt?(Tt=Ki(Ki(yt)),Tt!==Object.prototype&&(M=Tt)):Yi=!0);var Dc=!Cc(M)||_c(function(){var e={};return M[ht].call(e)!==e});Dc?M={}:kc&&(M=Nc(M));Lc(M[ht])||jc(M,ht,function(){return this});Hi.exports={IteratorPrototype:M,BUGGY_SAFARI_ITERATORS:Yi}});var Be=i((dm,Ji)=>{"use strict";var Vc=_(),Fc=Vc("toStringTag"),Xi={};Xi[Fc]="z";Ji.exports=String(Xi)==="[object z]"});var We=i((mm,Zi)=>{"use strict";var Uc=Be(),Gc=O(),$e=qe(),Qc=_(),Bc=Qc("toStringTag"),$c=Object,Wc=$e(function(){return arguments}())=="Arguments",zc=function(e,r){try{return e[r]}catch{}};Zi.exports=Uc?$e:function(e){var r,t,n;return e===void 0?"Undefined":e===null?"Null":typeof(t=zc(r=$c(e),Bc))=="string"?t:Wc?$e(r):(n=$e(r))=="Object"&&Gc(r.callee)?"Arguments":n}});var ra=i((Tm,ea)=>{"use strict";var Kc=Be(),Yc=We();ea.exports=Kc?{}.toString:function(){return"[object "+Yc(this)+"]"}});var It=i((ym,na)=>{"use strict";var Hc=Be(),Xc=J().f,Jc=$(),Zc=j(),ef=ra(),rf=_(),ta=rf("toStringTag");na.exports=function(e,r,t,n){if(e){var o=t?e:e.prototype;Zc(o,ta)||Xc(o,ta,{configurable:!0,value:r}),n&&!Hc&&Jc(o,"toString",ef)}}});var ia=i((hm,oa)=>{"use strict";var tf=gt().IteratorPrototype,nf=vt(),of=ce(),af=It(),sf=Q(),uf=function(){return this};oa.exports=function(e,r,t,n){var o=r+" Iterator";return e.prototype=nf(tf,{next:of(+!n,t)}),af(e,o,!1,!0),sf[o]=uf,e}});var sa=i((gm,aa)=>{"use strict";var lf=C(),cf=ue();aa.exports=function(e,r,t){try{return lf(cf(Object.getOwnPropertyDescriptor(e,r)[t]))}catch{}}});var la=i((Im,ua)=>{"use strict";var ff=O(),pf=String,vf=TypeError;ua.exports=function(e){if(typeof e=="object"||ff(e))return e;throw vf("Can't set "+pf(e)+" as a prototype")}});var fa=i((Om,ca)=>{"use strict";var bf=sa(),df=D(),mf=la();ca.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e=!1,r={},t;try{t=bf(Object.prototype,"__proto__","set"),t(r,[]),e=r instanceof Array}catch{}return function(o,a){return df(o),mf(a),e?t(o,a):o.__proto__=a,o}}():void 0)});var Oa=i((xm,Ia)=>{"use strict";var Tf=nt(),yf=V(),ze=le(),ha=bi(),hf=O(),gf=ia(),pa=dt(),va=fa(),If=It(),Of=$(),Ot=mt(),xf=_(),ba=Q(),ga=gt(),Ef=ha.PROPER,Sf=ha.CONFIGURABLE,da=ga.IteratorPrototype,Ke=ga.BUGGY_SAFARI_ITERATORS,ve=xf("iterator"),ma="keys",be="values",Ta="entries",ya=function(){return this};Ia.exports=function(e,r,t,n,o,a,s){gf(t,r,n);var u=function(h){if(h===o&&b)return b;if(!Ke&&h in c)return c[h];switch(h){case ma:return function(){return new t(this,h)};case be:return function(){return new t(this,h)};case Ta:return function(){return new t(this,h)}}return function(){return new t(this)}},f=r+" Iterator",l=!1,c=e.prototype,p=c[ve]||c["@@iterator"]||o&&c[o],b=!Ke&&p||u(o),d=r=="Array"&&c.entries||p,T,y,I;if(d&&(T=pa(d.call(new e)),T!==Object.prototype&&T.next&&(!ze&&pa(T)!==da&&(va?va(T,da):hf(T[ve])||Ot(T,ve,ya)),If(T,f,!0,!0),ze&&(ba[f]=ya))),Ef&&o==be&&p&&p.name!==be&&(!ze&&Sf?Of(c,"name",be):(l=!0,b=function(){return yf(p,this)})),o)if(y={values:u(be),keys:a?b:u(ma),entries:u(Ta)},s)for(I in y)(Ke||l||!(I in c))&&Ot(c,I,y[I]);else Tf({target:r,proto:!0,forced:Ke||l},y);return(!ze||s)&&c[ve]!==b&&Ot(c,ve,b,{name:o}),ba[r]=b,y}});var Ea=i((Em,xa)=>{"use strict";xa.exports=function(e,r){return{value:e,done:r}}});var Et=i((Sm,Pa)=>{"use strict";var wf=H(),xt=Pn(),Sa=Q(),qa=Wo(),qf=J().f,Rf=Oa(),Ye=Ea(),Pf=le(),Af=N(),Ra="Array Iterator",_f=qa.set,Lf=qa.getterFor(Ra);Pa.exports=Rf(Array,"Array",function(e,r){_f(this,{type:Ra,target:wf(e),index:0,kind:r})},function(){var e=Lf(this),r=e.target,t=e.kind,n=e.index++;return!r||n>=r.length?(e.target=void 0,Ye(void 0,!0)):t=="keys"?Ye(n,!1):t=="values"?Ye(r[n],!1):Ye([n,r[n]],!1)},"values");var wa=Sa.Arguments=Sa.Array;xt("keys");xt("values");xt("entries");if(!Pf&&Af&&wa.name!=="values")try{qf(wa,"name",{value:"values"})}catch{}});var _a=i((wm,Aa)=>{"use strict";var Cf=_(),Nf=Q(),jf=Cf("iterator"),Mf=Array.prototype;Aa.exports=function(e){return e!==void 0&&(Nf.Array===e||Mf[jf]===e)}});var St=i((qm,Ca)=>{"use strict";var kf=We(),La=Ne(),Df=Re(),Vf=Q(),Ff=_(),Uf=Ff("iterator");Ca.exports=function(e){if(!Df(e))return La(e,Uf)||La(e,"@@iterator")||Vf[kf(e)]}});var ja=i((Rm,Na)=>{"use strict";var Gf=V(),Qf=ue(),Bf=D(),$f=Ce(),Wf=St(),zf=TypeError;Na.exports=function(e,r){var t=arguments.length<2?Wf(e):r;if(Qf(t))return Bf(Gf(t,e));throw zf($f(e)+" is not iterable")}});var Da=i((Pm,ka)=>{"use strict";var Kf=V(),Ma=D(),Yf=Ne();ka.exports=function(e,r,t){var n,o;Ma(e);try{if(n=Yf(e,"return"),!n){if(r==="throw")throw t;return t}n=Kf(n,e)}catch(a){o=!0,n=a}if(r==="throw")throw t;if(o)throw n;return Ma(n),t}});var Qa=i((Am,Ga)=>{"use strict";var Hf=tt(),Xf=V(),Jf=D(),Zf=Ce(),ep=_a(),rp=st(),Va=jr(),tp=ja(),np=St(),Fa=Da(),op=TypeError,He=function(e,r){this.stopped=e,this.result=r},Ua=He.prototype;Ga.exports=function(e,r,t){var n=t&&t.that,o=!!(t&&t.AS_ENTRIES),a=!!(t&&t.IS_RECORD),s=!!(t&&t.IS_ITERATOR),u=!!(t&&t.INTERRUPTED),f=Hf(r,n),l,c,p,b,d,T,y,I=function(g){return l&&Fa(l,"normal",g),new He(!0,g)},h=function(g){return o?(Jf(g),u?f(g[0],g[1],I):f(g[0],g[1])):u?f(g,I):f(g)};if(a)l=e.iterator;else if(s)l=e;else{if(c=np(e),!c)throw op(Zf(e)+" is not iterable");if(ep(c)){for(p=0,b=rp(e);b>p;p++)if(d=h(e[p]),d&&Va(Ua,d))return d;return new He(!1)}l=tp(e,c)}for(T=a?e.next:l.next;!(y=Xf(T,l)).done;){try{d=h(y.value)}catch(g){Fa(l,"throw",g)}if(typeof d=="object"&&d&&Va(Ua,d))return d}return new He(!1)}});var $a=i((_m,Ba)=>{"use strict";var ip=je(),ap=J(),sp=ce();Ba.exports=function(e,r,t){var n=ip(r);n in e?ap.f(e,n,sp(0,t)):e[n]=t}});var Wa=i(()=>{"use strict";var up=nt(),lp=Qa(),cp=$a();up({target:"Object",stat:!0},{fromEntries:function(r){var t={};return lp(r,function(n,o){cp(t,n,o)},{AS_ENTRIES:!0}),t}})});var Ka=i((Nm,za)=>{"use strict";Et();Wa();var fp=_e();za.exports=fp.Object.fromEntries});var Ha=i((jm,Ya)=>{"use strict";Ya.exports={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}});var Za=i(()=>{"use strict";Et();var pp=Ha(),vp=S(),bp=We(),dp=$(),Xa=Q(),mp=_(),Ja=mp("toStringTag");for(Xe in pp)wt=vp[Xe],Je=wt&&wt.prototype,Je&&bp(Je)!==Ja&&dp(Je,Ja,Xe),Xa[Xe]=Xa.Array;var wt,Je,Xe});var rs=i((Dm,es)=>{"use strict";var Tp=Ka();Za();es.exports=Tp});var ns=i((Vm,ts)=>{"use strict";var yp=rs();ts.exports=yp});var xp={};At(xp,{CurrentClientBrowser:()=>Ze,CurrentClientDevice:()=>er,ErrorCategory:()=>vn,InterfaceLanguage:()=>as,Logger:()=>ye,Observable:()=>v,Subject:()=>L,Subscription:()=>x,VERSION:()=>Lt,VKNumericLanguage:()=>is,ValueSubject:()=>ne,VideoQuality:()=>ge,abortable:()=>Ft,addScript:()=>Dt,areQualitiesExact:()=>tn,assertEmptyArray:()=>kt,assertNever:()=>P,assertNonNullable:()=>Nt,assertNotEmptyArray:()=>Mt,assertNullable:()=>jt,assertQualityIsExact:()=>nn,buffer:()=>ar,checkNever:()=>Ct,cloneDeep:()=>an,cloneDeepWith:()=>te,combine:()=>nr,debounce:()=>ur,debounceFn:()=>xe,detectEmbed:()=>zt,fillWithDefault:()=>on,filter:()=>pr,filterChanged:()=>br,fromEvent:()=>fn,getCurrentBrowser:()=>re,getExponentialDelay:()=>Wt,getHighestQuality:()=>Xt,getIOSVersion:()=>Gt,interval:()=>ln,isAndroid:()=>Qt,isHigher:()=>Kt,isHigherOrEqual:()=>Yt,isIOS:()=>Ut,isInvariantQuality:()=>Oe,isLower:()=>Ie,isLowerOrEqual:()=>Ht,isMacLike:()=>Bt,isMobile:()=>$t,isNonNullable:()=>U,isNullable:()=>he,loadVKLangPack:()=>gp,map:()=>oe,mapTo:()=>mr,merge:()=>or,noop:()=>k,now:()=>Vt,observableFrom:()=>cn,observeElementSize:()=>sn,once:()=>Tr,pairwise:()=>hr,safeStorage:()=>tr,tap:()=>Ir,throttle:()=>cr,throttleFn:()=>Ee,timeCodeToString:()=>xs,timeout:()=>un,videoHeightToQuality:()=>Zt,videoQualityToHeight:()=>rn,videoSizeToQuality:()=>en});module.exports=ms(xp);var Lt="__VERSION__";var x=class{constructor(){this.subscriptions=[]}unsubscribe(){let r=this.subscriptions;this.subscriptions=[],r.forEach(t=>typeof t=="function"?t():t.unsubscribe())}add(r){return this.subscriptions.push(r),this}};var P=e=>{throw new Error(`${e} is value of unexpected type`)},Ct=e=>{};var k=()=>{};var v=class{constructor(r){r&&(this._subscribe=r)}subscribe(r,t){let n;t?typeof t=="function"?n={next:t,error:k}:n={next:s=>t.next(s),error:s=>t.error?.(s)}:n={next:k,error:k};let o=typeof r=="function"?{next:s=>{try{r(s)}catch(u){n.next(u)}},error:s=>n.next(s)}:{next:s=>r.next(s),error:s=>r.error?r.error(s):n.next(s)},a;try{a=this._subscribe(o)}catch(s){o.error?.(s)}return new x().add(()=>{switch(o.next=k,o.error=k,typeof a){case"function":a();return;case"object":a.unsubscribe();return;case"undefined":return;default:return P(a)}})}pipe(...r){return r.reduce((t,n)=>n(t),this)}_subscribe(r){}};var L=class extends v{constructor(){super();this.keyCounter=0;this.subscribers=new Map}next(t){this.subscribers.forEach(n=>n.next(t))}error(t){this.subscribers.forEach(n=>n.error?.(t))}_subscribe(t){let n=this.keyCounter++;return this.subscribers.set(n,t),new x().add(()=>this.subscribers.delete(n))}};var ye=class{constructor(){this.log$=new L;this.logs=[];this.log=r=>{let 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{n={message:"error in `createCustomLog`",component:"Logger"}}this.log(n)}}createComponentLog(r){return this.createCustomLog(t=>({component:r,...t}))}};function Nt(e,r='Assertion "value is not nullable" failed'){if(e==null)throw new Error(r)}function jt(e,r='Assertion "value is nullable" failed'){if(e!=null)throw new Error(r)}function U(e){return typeof e<"u"&&e!==null}function he(e){return e==null}function Mt(e,r){if(!e?.length)throw new Error(r)}function kt(e,r){if(e?.length)throw new Error(r)}var Dt=(e,r,t)=>new Promise((n,o)=>{r.addEventListener("abort",()=>{u(),l.remove()});let a=()=>{u(),o()},s=()=>{u(),n()},u=()=>{f&&clearTimeout(f),l.removeEventListener("load",s),l.removeEventListener("error",a)},f;t&&(f=window.setTimeout(a,t));let l=document.createElement("script");l.addEventListener("load",s),l.addEventListener("error",a),l.src=e,document.head.appendChild(l)});var Vt=typeof window.performance?.now=="function"?()=>window.performance.now():()=>Date.now();var Ft=(e,r)=>async(...t)=>{let n=r(...t),o=e.aborted,a;for(;!o&&!e.aborted;)try{let s=await n.next(a);o=s.done??!1,a=s.value}catch(s){await n.throw(s)}return a};var Ze=(l=>(l.Unknown="Unknown",l.Yandex="Yandex",l.Chrome="Chrome",l.Chromium="Chromium",l.Firefox="Firefox",l.Safari="Safari",l.Opera="Opera",l.Edge="Edge",l.Rest="Rest",l))(Ze||{}),er=(f=>(f.Unknown="Unknown",f.Android="Android",f.iPhone="iPhone",f.iPad="iPad",f.iPod="iPod",f.RestMobile="RestMobile",f.Mac="Mac",f.Desktop="Desktop",f))(er||{}),re=()=>{let{userAgent:e}=window.navigator,r=/yabrowser/i.test(e)?"Yandex":void 0,t=/chrome|crios/i.test(e)?"Chrome":void 0,n=/chromium/i.test(e)?"Chromium":void 0,o=/firefox|fxios/i.test(e)?"Firefox":void 0,a=/webkit|safari|khtml/i.test(e)?"Safari":void 0,s=/opr\//i.test(e)?"Opera":void 0,u=/edg/i.test(e)?"Edge":void 0,f=/android/i.test(e)?"Android":void 0,l=/iphone/i.test(e)?"iPhone":void 0,c=/ipad/i.test(e)?"iPad":void 0,p=/ipod/i.test(e)?"iPod":void 0,b=/mac/i.test(e)?"Mac":void 0,d=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(e)?"RestMobile":void 0;return{browser:r||o||s||u||t||n||a||"Rest",device:f||l||c||p||d||b||"Desktop"}},Ut=(e=!1)=>{let t=["iPhone","iPad","iPod"].includes(re().device);if(!e)return t;let{userAgent:n,maxTouchPoints:o}=window.navigator;return!!(t||/macintosh/i.test(n)&&o>0)},Gt=()=>{let{userAgent:e}=window.navigator,r=e.match(/Version\/(\d+(\.\d+)?)/i);if(!r)return null;let t=r[1],n=parseFloat(t);return isNaN(n)?null:n},Qt=()=>re().device==="Android",Bt=()=>["Mac","iPhone","iPad","iPod"].includes(re().device),$t=()=>/Mobile|mini|Fennec|Android|iP(ad|od|hone)/.test(navigator.appVersion??navigator.userAgent)||navigator?.userAgentData?.mobile;var Wt=(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 tr={};At(tr,{clear:()=>Os,get:()=>ys,has:()=>gs,isPersistent:()=>Ts,remove:()=>Is,set:()=>hs});var z,G,rr=`vk-videoplayer-dummy-key-${Math.random()}`,K=()=>{if(G!==void 0)return G;try{localStorage.setItem(rr,"test"),localStorage.removeItem(rr),G=0}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem(rr),G=1}catch(r){if(r instanceof DOMException||r instanceof TypeError)G=2;else throw r}else throw e}return G===2&&(z=new Map),G},Ts=()=>K()===0,ys=e=>{let r=K();switch(r){case 0:return localStorage.getItem(e)??void 0;case 1:return sessionStorage.getItem(e)??void 0;case 2:return z?.get(e);default:P(r)}},hs=(e,r)=>{let t=K();switch(t){case 0:try{localStorage.setItem(e,r)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case 1:try{sessionStorage.setItem(e,r)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case 2:return void z?.set(e,r);default:P(t)}},gs=e=>{let r=K();switch(r){case 0:return e in localStorage;case 1:return e in sessionStorage;case 2:return z?.has(e)??!1;default:return P(r),!1}},Is=e=>{let r=K();switch(r){case 0:return localStorage.removeItem(e);case 1:return sessionStorage.removeItem(e);case 2:return void z?.delete(e);default:P(r)}},Os=()=>{let e=K();switch(e){case 0:return localStorage.clear();case 1:return sessionStorage.clear();case 2:return z?.clear();default:P(e)}};var zt=()=>{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)}let t=r?new URL(r).hostname:void 0;return{isEmbed:e,host:t}};var ge=(c=>(c.INVARIANT="Invariant quality",c.Q_144P="144p",c.Q_240P="240p",c.Q_360P="360p",c.Q_480P="480p",c.Q_720P="720p",c.Q_1080P="1080p",c.Q_1440P="1440p",c.Q_2160P="2160p",c.Q_4320P="4320p",c))(ge||{});var E={"144p":{width:256,height:144},"240p":{width:428,height:240},"360p":{width:640,height:360},"480p":{width:856,height:480},"720p":{width:1280,height:720},"1080p":{width:1920,height:1080},"1440p":{width:2560,height:1440},"2160p":{width:3840,height:2160},"4320p":{width:7680,height:4320}},Kt=(e,r)=>E[e].height>E[r].height,Yt=(e,r)=>E[e].height>=E[r].height,Ie=(e,r)=>E[e].height<E[r].height,Ht=(e,r)=>E[e].height<=E[r].height,Xt=e=>e.sort((r,t)=>r===t?0:r==="Invariant quality"?1:t==="Invariant quality"?-1:Ie(r,t)?1:-1)[0],Jt=Object.keys(E).sort((e,r)=>Ie(e,r)?-1:1),Zt=(e,r=.02)=>[...Jt].find(n=>E[n].height*(1+r)>=e),en=({width:e,height:r})=>{let t=Math.min(e,r),n=Math.max(e,r);return Jt.find(o=>{let a=E[o];return a.width>=n&&a.height>=t})},rn=e=>E[e].height,Oe=e=>e==="Invariant quality",tn=e=>e.every(r=>!Oe(r));function nn(e){if(Oe(e))throw new Error("Expected exact quality")}var on=(e,r)=>{let t={};for(let n of Object.keys(r)){let o=r[n],a=e[n];Array.isArray(o)&&Array.isArray(a)?t[n]=a:typeof o=="object"&&typeof a=="object"?t[n]=on(a,o):t[n]=n in e?a:o}return t};var xs=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 xe(e,r=0,t){let n,o,a,s,u,f,l=0,c=!1,p=!1,b=!0,d=!r&&r!==0&&typeof window.requestAnimationFrame=="function";t&&(c=!!t.leading,p="maxWait"in t,a=t?.maxWait?Math.max(+t?.maxWait||0,r):a,b="trailing"in t?!!t.trailing:b);function T(m){let w=n,F=o;return n=o=void 0,l=m,s=e.apply(F,w),s}function y(m,w){return d?(u&&window.cancelAnimationFrame(u),window.requestAnimationFrame(m)):setTimeout(m,w)}function I(m){if(d){window.cancelAnimationFrame(m);return}clearTimeout(m)}function h(m){return l=m,u=y(de,r),c?T(m):s}function g(m){let w=m-f,F=m-l,Pt=r-w;return p?Math.min(Pt,a-F):Pt}function qt(m){let w=m-f,F=m-l;return f===void 0||w>=r||w<0||p&&F>=a}function de(){let m=Date.now();if(qt(m))return Rt(m);u=y(de,g(m))}function Rt(m){return u=void 0,b&&n?T(m):(n=o=void 0,s)}function ss(){u!==void 0&&I(u),l=0,n=f=o=u=void 0}function us(){return u===void 0?s:Rt(Date.now())}function ls(){return u!==void 0}function me(...m){let w=Date.now(),F=qt(w);if(n=m,o=this,f=w,F){if(u===void 0)return h(f);if(p)return u=y(de,r),T(f)}return u===void 0&&(u=y(de,r)),s}return me.cancel=ss,me.flush=us,me.pending=ls,me}var Ee=(e,r=0,t)=>xe(e,r,{...{leading:!0,trailing:!0},...t,maxWait:r});var te=(e,r)=>{if(e===null||typeof e!="object")return e;let t=Array.isArray(e)?[]:{};for(let n in e){if(typeof r=="function"){let o=r(e[n],n,e,t);if(o!==void 0){t[n]=o;continue}}typeof e[n]=="object"?t[n]=te(e[n],r):t[n]=e[n]}return t};var an=e=>te(e);var Es=300,sn=(e,r=Es)=>new v(t=>{let{width:n,height:o}=e.getBoundingClientRect();if(t.next({width:n,height:o}),!window.ResizeObserver)return;let a=new ResizeObserver(Ee(s=>{let u=s[0];if(!u)return;let f,l;u.contentBoxSize&&u.contentBoxSize[0]?(l=u.contentBoxSize[0].blockSize,f=u.contentBoxSize[0].inlineSize):u.contentRect&&(f=u.contentRect.width,l=u.contentRect.height),U(f)&&U(l)&&t.next({width:f,height:l})},r));return a.observe(e),()=>a.disconnect()});var ne=class extends L{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){let n=super._subscribe(t);return t.next(this.value),n}};function nr(e){return new v(r=>{let t={},n=Object.keys(e).length,o=a=>s=>{a in t||n--,t[a]=s,n===0&&r.next(t)};return Object.entries(e).reduce((a,[s,u])=>a.add(u.subscribe(o(s))),new x)})}function or(...e){return new v(r=>e.reduce((t,n)=>t.add(n.subscribe(r)),new x))}var un=e=>new v(r=>{let t=window.setTimeout(()=>{try{r.next()}catch(n){if(r.error)r.error(n);else throw n}},e);return()=>window.clearTimeout(t)});var ln=e=>new v(r=>{let t=window.setInterval(()=>r.next(),e);return()=>{t&&(window.clearInterval(t),t=void 0)}});var cn=e=>new v(r=>{e.forEach(t=>r.next(t))});var fn=(e,r)=>new v(t=>{let n=o=>t.next(o);return e.addEventListener(r,n),()=>e.removeEventListener(r,n)});function ar(e){return r=>new v(t=>r.subscribe(new ir(t,e)))}var ir=class{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){this.destination.error?.(r)}};var Ss={leading:!1,trailing:!0};function ur(e,r=Ss){return t=>new v(n=>t.subscribe(new sr(n,e,r)))}var sr=class{constructor(r,t,n){this.destination=r;this.time=t;this.config=n}next(r){this.lastValue=r,U(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){this.destination.error?.(r)}};var ws={leading:!0,trailing:!1};function cr(e,r=ws){return t=>new v(n=>t.subscribe(new lr(n,e,r)))}var lr=class{constructor(r,t,n){this.destination=r;this.time=t;this.config=n}next(r){this.lastValue=r,he(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){this.destination.error?.(r)}};function pr(e){return r=>new v(t=>r.subscribe(new fr(t,e)))}var fr=class{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){this.destination.error?.(r)}};function br(e=(r,t)=>r===t){return r=>new v(t=>r.subscribe(new vr(t,e)))}var pn={},vr=class{constructor(r,t){this.destination=r;this.predicate=t;this.lastValue=pn}next(r){let t;try{t=this.lastValue===pn||!this.predicate(this.lastValue,r),this.lastValue=r}catch(n){throw this.error(n),n}t&&this.destination.next(r)}error(r){this.destination.error?.(r)}};function oe(e){return r=>new v(t=>r.subscribe(new dr(t,e)))}var dr=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){this.destination.error?.(r)}};function mr(e){return oe(()=>e)}function Tr(){return e=>new v(r=>{let t=!1,n=!1,o=e.subscribe(a=>{t||(t=!0,r.next(a)),n&&o.unsubscribe()},a=>{t=!0,r.error?.(a),n&&o.unsubscribe()});return n=!0,t&&o.unsubscribe(),o})}function hr(){return e=>new v(r=>e.subscribe(new yr(r)))}var yr=class{constructor(r){this.destination=r;this.hasLast=!1}next(r){let t=this.last;if(this.last=r,!this.hasLast){this.hasLast=!0;return}this.destination.next([t,r])}error(r){this.destination.error?.(r)}};function Ir(e){return r=>new v(t=>r.subscribe(new gr(t,e)))}var gr=class{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){this.destination.error?.(r)}};var vn=(u=>(u.NETWORK="network",u.VIDEO_PIPELINE="video_pipeline",u.EXTERNAL_API="external_api",u.PARSER="parser",u.DOM="dom",u.WTF="wtf",u.FATAL="fatal",u))(vn||{});var Se=class{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;let 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;let n=this.listeners[r.type].slice();for(let o=0,a=n.length;o<a;o++){let s=n[o];try{s.callback.call(this,r)}catch(u){Promise.resolve().then(()=>{throw u})}s.options&&s.options.once&&this.removeEventListener(r.type,s.callback)}return!r.defaultPrevented}},Y=class extends Se{constructor(){super(),this.listeners||Se.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)}},ie=class{constructor(){Object.defineProperty(this,"signal",{value:new Y,writable:!0,configurable:!0})}abort(r){let t;try{t=new Event("abort")}catch{typeof document<"u"?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>"u")n=new Error("This operation was aborted"),n.name="AbortError";else try{n=new DOMException("signal is aborted without reason")}catch{n=new Error("This operation was aborted"),n.name="AbortError"}this.signal.reason=n,this.signal.dispatchEvent(t)}toString(){return"[object AbortController]"}};typeof Symbol<"u"&&Symbol.toStringTag&&(ie.prototype[Symbol.toStringTag]="AbortController",Y.prototype[Symbol.toStringTag]="AbortSignal");function we(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 Or(e){typeof e=="function"&&(e={fetch:e});let{fetch:r,Request:t=r.Request,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o=!1}=e;if(!we({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,c){let p;c&&c.signal&&(p=c.signal,delete c.signal);let b=new t(l,c);return p&&Object.defineProperty(b,"signal",{writable:!1,enumerable:!1,configurable:!0,value:p}),b},a.prototype=t.prototype);let s=r;return{fetch:(f,l)=>{let c=a&&a.prototype.isPrototypeOf(f)?f.signal:l?l.signal:void 0;if(c){let p;try{p=new DOMException("Aborted","AbortError")}catch{p=new Error("Aborted"),p.name="AbortError"}if(c.aborted)return Promise.reject(p);let b=new Promise((d,T)=>{c.addEventListener("abort",()=>T(p),{once:!0})});return l&&l.signal&&delete l.signal,Promise.race([b,s(f,l)])}return s(f,l)},Request:a}}var ae=we({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),bn=ae?Or({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,dn=ae?bn.fetch:window.fetch,zb=ae?bn.Request:window.Request,Kb=ae?ie:window.AbortController,Yb=ae?Y:window.AbortSignal;var os=ds(ns(),1),is=(p=>(p.Armenian="58",p.Azerbaijani="57",p.Belarusian="114",p.English="3",p.Kazakh="97",p.Portuguese="73",p.Russian="0",p.Spanish="4",p.Ukrainian="1",p.Uzbek="65",p.Vietnamese="75",p))(is||{}),hp="vk.com",gp=async(e,r,t)=>{let n=new URL(`https://${hp}/js/lang-pack.js`);n.searchParams.set("format","json"),n.searchParams.set("name",r),e!==void 0&&n.searchParams.set("lang",e);let a=await(await dn(n.toString())).json();return Ip(a,t)},Ip=(e,r)=>(0,os.default)(Object.entries(e.keys).map(([t,n])=>[t.substring(`${r}_`.length),Op(n)])),Op=e=>Array.isArray(e)?e[0]:e;var as=(t=>(t.RU="ru",t.EN="en",t))(as||{});
package/esnext.esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
- * @vkontakte/videoplayer-shared v1.0.36
3
- * Tue, 18 Jun 2024 13:17:03 GMT
4
- * https://st.mycdn.me/static/vkontakte-videoplayer/1-0-36/doc/
2
+ * @vkontakte/videoplayer-shared v1.0.37-dev.0bef53b3.0
3
+ * Wed, 10 Jul 2024 00:39:25 GMT
4
+ * https://st.mycdn.me/static/vkontakte-videoplayer/1-0-37/doc/
5
5
  */
6
- const Ne="1.0.36";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=>{let n=window.setInterval(()=>t.next(),e);return()=>{n&&(window.clearInterval(n),n=void 0)}}),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",e.FATAL="fatal"})(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};
6
+ var qa=Object.create;var $e=Object.defineProperty;var Ra=Object.getOwnPropertyDescriptor;var Pa=Object.getOwnPropertyNames;var Aa=Object.getPrototypeOf,_a=Object.prototype.hasOwnProperty;var i=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),La=(e,r)=>{for(var t in r)$e(e,t,{get:r[t],enumerable:!0})},Ca=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of Pa(r))!_a.call(e,o)&&o!==t&&$e(e,o,{get:()=>r[o],enumerable:!(n=Ra(r,o))||n.enumerable});return e};var Na=(e,r,t)=>(t=e!=null?qa(Aa(e)):{},Ca(r||!e||!e.__esModule?$e(t,"default",{value:e,enumerable:!0}):t,e));var P=i((Kb,Nt)=>{"use strict";Nt.exports=function(e){try{return!!e()}catch{return!0}}});var ne=i((Yb,jt)=>{"use strict";var xs=P();jt.exports=!xs(function(){var e=function(){}.bind();return typeof e!="function"||e.hasOwnProperty("prototype")})});var L=i((Hb,Dt)=>{"use strict";var Mt=ne(),kt=Function.prototype,lr=kt.call,Es=Mt&&kt.bind.bind(lr,lr);Dt.exports=Mt?Es:function(e){return function(){return lr.apply(e,arguments)}}});var he=i((Xb,Ft)=>{"use strict";var Vt=L(),Ss=Vt({}.toString),ws=Vt("".slice);Ft.exports=function(e){return ws(Ss(e),8,-1)}});var Gt=i((Jb,Ut)=>{"use strict";var qs=L(),Rs=P(),Ps=he(),cr=Object,As=qs("".split);Ut.exports=Rs(function(){return!cr("z").propertyIsEnumerable(0)})?function(e){return Ps(e)=="String"?As(e,""):cr(e)}:cr});var ge=i((Zb,Qt)=>{"use strict";Qt.exports=function(e){return e==null}});var fr=i((ed,Bt)=>{"use strict";var _s=ge(),Ls=TypeError;Bt.exports=function(e){if(_s(e))throw Ls("Can't call method on "+e);return e}});var H=i((rd,$t)=>{"use strict";var Cs=Gt(),Ns=fr();$t.exports=function(e){return Cs(Ns(e))}});var zt=i((td,Wt)=>{"use strict";Wt.exports=function(){}});var G=i((nd,Kt)=>{"use strict";Kt.exports={}});var S=i((Yt,Ht)=>{"use strict";var Ie=function(e){return e&&e.Math==Math&&e};Ht.exports=Ie(typeof globalThis=="object"&&globalThis)||Ie(typeof window=="object"&&window)||Ie(typeof self=="object"&&self)||Ie(typeof global=="object"&&global)||function(){return this}()||Yt||Function("return this")()});var vr=i((od,Xt)=>{"use strict";var pr=typeof document=="object"&&document.all,js=typeof pr>"u"&&pr!==void 0;Xt.exports={all:pr,IS_HTMLDDA:js}});var O=i((id,Zt)=>{"use strict";var Jt=vr(),Ms=Jt.all;Zt.exports=Jt.IS_HTMLDDA?function(e){return typeof e=="function"||e===Ms}:function(e){return typeof e=="function"}});var tn=i((ad,rn)=>{"use strict";var ks=S(),Ds=O(),en=ks.WeakMap;rn.exports=Ds(en)&&/native code/.test(String(en))});var Q=i((sd,an)=>{"use strict";var nn=O(),on=vr(),Vs=on.all;an.exports=on.IS_HTMLDDA?function(e){return typeof e=="object"?e!==null:nn(e)||e===Vs}:function(e){return typeof e=="object"?e!==null:nn(e)}});var C=i((ud,sn)=>{"use strict";var Fs=P();sn.exports=!Fs(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7})});var dr=i((ld,ln)=>{"use strict";var Us=S(),un=Q(),br=Us.document,Gs=un(br)&&un(br.createElement);ln.exports=function(e){return Gs?br.createElement(e):{}}});var mr=i((cd,cn)=>{"use strict";var Qs=C(),Bs=P(),$s=dr();cn.exports=!Qs&&!Bs(function(){return Object.defineProperty($s("div"),"a",{get:function(){return 7}}).a!=7})});var Tr=i((fd,fn)=>{"use strict";var Ws=C(),zs=P();fn.exports=Ws&&zs(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42})});var k=i((pd,pn)=>{"use strict";var Ks=Q(),Ys=String,Hs=TypeError;pn.exports=function(e){if(Ks(e))return e;throw Hs(Ys(e)+" is not an object")}});var D=i((vd,vn)=>{"use strict";var Xs=ne(),Oe=Function.prototype.call;vn.exports=Xs?Oe.bind(Oe):function(){return Oe.apply(Oe,arguments)}});var xe=i((bd,bn)=>{"use strict";bn.exports={}});var gr=i((dd,mn)=>{"use strict";var yr=xe(),hr=S(),Js=O(),dn=function(e){return Js(e)?e:void 0};mn.exports=function(e,r){return arguments.length<2?dn(yr[e])||dn(hr[e]):yr[e]&&yr[e][r]||hr[e]&&hr[e][r]}});var Ir=i((md,Tn)=>{"use strict";var Zs=L();Tn.exports=Zs({}.isPrototypeOf)});var hn=i((Td,yn)=>{"use strict";yn.exports=typeof navigator<"u"&&String(navigator.userAgent)||""});var wn=i((yd,Sn)=>{"use strict";var En=S(),Or=hn(),gn=En.process,In=En.Deno,On=gn&&gn.versions||In&&In.version,xn=On&&On.v8,q,Ee;xn&&(q=xn.split("."),Ee=q[0]>0&&q[0]<4?1:+(q[0]+q[1]));!Ee&&Or&&(q=Or.match(/Edge\/(\d+)/),(!q||q[1]>=74)&&(q=Or.match(/Chrome\/(\d+)/),q&&(Ee=+q[1])));Sn.exports=Ee});var xr=i((hd,Rn)=>{"use strict";var qn=wn(),eu=P(),ru=S(),tu=ru.String;Rn.exports=!!Object.getOwnPropertySymbols&&!eu(function(){var e=Symbol();return!tu(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&qn&&qn<41})});var Er=i((gd,Pn)=>{"use strict";var nu=xr();Pn.exports=nu&&!Symbol.sham&&typeof Symbol.iterator=="symbol"});var Sr=i((Id,An)=>{"use strict";var ou=gr(),iu=O(),au=Ir(),su=Er(),uu=Object;An.exports=su?function(e){return typeof e=="symbol"}:function(e){var r=ou("Symbol");return iu(r)&&au(r.prototype,uu(e))}});var Se=i((Od,_n)=>{"use strict";var lu=String;_n.exports=function(e){try{return lu(e)}catch{return"Object"}}});var oe=i((xd,Ln)=>{"use strict";var cu=O(),fu=Se(),pu=TypeError;Ln.exports=function(e){if(cu(e))return e;throw pu(fu(e)+" is not a function")}});var we=i((Ed,Cn)=>{"use strict";var vu=oe(),bu=ge();Cn.exports=function(e,r){var t=e[r];return bu(t)?void 0:vu(t)}});var jn=i((Sd,Nn)=>{"use strict";var wr=D(),qr=O(),Rr=Q(),du=TypeError;Nn.exports=function(e,r){var t,n;if(r==="string"&&qr(t=e.toString)&&!Rr(n=wr(t,e))||qr(t=e.valueOf)&&!Rr(n=wr(t,e))||r!=="string"&&qr(t=e.toString)&&!Rr(n=wr(t,e)))return n;throw du("Can't convert object to primitive value")}});var ie=i((wd,Mn)=>{"use strict";Mn.exports=!0});var Vn=i((qd,Dn)=>{"use strict";var kn=S(),mu=Object.defineProperty;Dn.exports=function(e,r){try{mu(kn,e,{value:r,configurable:!0,writable:!0})}catch{kn[e]=r}return r}});var Pr=i((Rd,Un)=>{"use strict";var Tu=S(),yu=Vn(),Fn="__core-js_shared__",hu=Tu[Fn]||yu(Fn,{});Un.exports=hu});var Ar=i((Pd,Qn)=>{"use strict";var gu=ie(),Gn=Pr();(Qn.exports=function(e,r){return Gn[e]||(Gn[e]=r!==void 0?r:{})})("versions",[]).push({version:"3.31.0",mode:gu?"pure":"global",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 _r=i((Ad,Bn)=>{"use strict";var Iu=fr(),Ou=Object;Bn.exports=function(e){return Ou(Iu(e))}});var N=i((_d,$n)=>{"use strict";var xu=L(),Eu=_r(),Su=xu({}.hasOwnProperty);$n.exports=Object.hasOwn||function(r,t){return Su(Eu(r),t)}});var Lr=i((Ld,Wn)=>{"use strict";var wu=L(),qu=0,Ru=Math.random(),Pu=wu(1 .toString);Wn.exports=function(e){return"Symbol("+(e===void 0?"":e)+")_"+Pu(++qu+Ru,36)}});var A=i((Cd,Kn)=>{"use strict";var Au=S(),_u=Ar(),zn=N(),Lu=Lr(),Cu=xr(),Nu=Er(),X=Au.Symbol,Cr=_u("wks"),ju=Nu?X.for||X:X&&X.withoutSetter||Lu;Kn.exports=function(e){return zn(Cr,e)||(Cr[e]=Cu&&zn(X,e)?X[e]:ju("Symbol."+e)),Cr[e]}});var Jn=i((Nd,Xn)=>{"use strict";var Mu=D(),Yn=Q(),Hn=Sr(),ku=we(),Du=jn(),Vu=A(),Fu=TypeError,Uu=Vu("toPrimitive");Xn.exports=function(e,r){if(!Yn(e)||Hn(e))return e;var t=ku(e,Uu),n;if(t){if(r===void 0&&(r="default"),n=Mu(t,e,r),!Yn(n)||Hn(n))return n;throw Fu("Can't convert object to primitive value")}return r===void 0&&(r="number"),Du(e,r)}});var qe=i((jd,Zn)=>{"use strict";var Gu=Jn(),Qu=Sr();Zn.exports=function(e){var r=Gu(e,"string");return Qu(r)?r:r+""}});var J=i(ro=>{"use strict";var Bu=C(),$u=mr(),Wu=Tr(),Re=k(),eo=qe(),zu=TypeError,Nr=Object.defineProperty,Ku=Object.getOwnPropertyDescriptor,jr="enumerable",Mr="configurable",kr="writable";ro.f=Bu?Wu?function(r,t,n){if(Re(r),t=eo(t),Re(n),typeof r=="function"&&t==="prototype"&&"value"in n&&kr in n&&!n[kr]){var o=Ku(r,t);o&&o[kr]&&(r[t]=n.value,n={configurable:Mr in n?n[Mr]:o[Mr],enumerable:jr in n?n[jr]:o[jr],writable:!1})}return Nr(r,t,n)}:Nr:function(r,t,n){if(Re(r),t=eo(t),Re(n),$u)try{return Nr(r,t,n)}catch{}if("get"in n||"set"in n)throw zu("Accessors not supported");return"value"in n&&(r[t]=n.value),r}});var ae=i((kd,to)=>{"use strict";to.exports=function(e,r){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:r}}});var B=i((Dd,no)=>{"use strict";var Yu=C(),Hu=J(),Xu=ae();no.exports=Yu?function(e,r,t){return Hu.f(e,r,Xu(1,t))}:function(e,r,t){return e[r]=t,e}});var Pe=i((Vd,io)=>{"use strict";var Ju=Ar(),Zu=Lr(),oo=Ju("keys");io.exports=function(e){return oo[e]||(oo[e]=Zu(e))}});var Ae=i((Fd,ao)=>{"use strict";ao.exports={}});var co=i((Ud,lo)=>{"use strict";var el=tn(),uo=S(),rl=Q(),tl=B(),Dr=N(),Vr=Pr(),nl=Pe(),ol=Ae(),so="Object already initialized",Fr=uo.TypeError,il=uo.WeakMap,_e,se,Le,al=function(e){return Le(e)?se(e):_e(e,{})},sl=function(e){return function(r){var t;if(!rl(r)||(t=se(r)).type!==e)throw Fr("Incompatible receiver, "+e+" required");return t}};el||Vr.state?(R=Vr.state||(Vr.state=new il),R.get=R.get,R.has=R.has,R.set=R.set,_e=function(e,r){if(R.has(e))throw Fr(so);return r.facade=e,R.set(e,r),r},se=function(e){return R.get(e)||{}},Le=function(e){return R.has(e)}):($=nl("state"),ol[$]=!0,_e=function(e,r){if(Dr(e,$))throw Fr(so);return r.facade=e,tl(e,$,r),r},se=function(e){return Dr(e,$)?e[$]:{}},Le=function(e){return Dr(e,$)});var R,$;lo.exports={set:_e,get:se,has:Le,enforce:al,getterFor:sl}});var mo=i((Gd,bo)=>{"use strict";var ul=ne(),vo=Function.prototype,fo=vo.apply,po=vo.call;bo.exports=typeof Reflect=="object"&&Reflect.apply||(ul?po.bind(fo):function(){return po.apply(fo,arguments)})});var Ur=i((Qd,To)=>{"use strict";var ll=he(),cl=L();To.exports=function(e){if(ll(e)==="Function")return cl(e)}});var Io=i(go=>{"use strict";var yo={}.propertyIsEnumerable,ho=Object.getOwnPropertyDescriptor,fl=ho&&!yo.call({1:2},1);go.f=fl?function(r){var t=ho(this,r);return!!t&&t.enumerable}:yo});var Eo=i(xo=>{"use strict";var pl=C(),vl=D(),bl=Io(),dl=ae(),ml=H(),Tl=qe(),yl=N(),hl=mr(),Oo=Object.getOwnPropertyDescriptor;xo.f=pl?Oo:function(r,t){if(r=ml(r),t=Tl(t),hl)try{return Oo(r,t)}catch{}if(yl(r,t))return dl(!vl(bl.f,r,t),r[t])}});var wo=i((Wd,So)=>{"use strict";var gl=P(),Il=O(),Ol=/#|\.prototype\./,ue=function(e,r){var t=El[xl(e)];return t==wl?!0:t==Sl?!1:Il(r)?gl(r):!!r},xl=ue.normalize=function(e){return String(e).replace(Ol,".").toLowerCase()},El=ue.data={},Sl=ue.NATIVE="N",wl=ue.POLYFILL="P";So.exports=ue});var Gr=i((zd,Ro)=>{"use strict";var qo=Ur(),ql=oe(),Rl=ne(),Pl=qo(qo.bind);Ro.exports=function(e,r){return ql(e),r===void 0?e:Rl?Pl(e,r):function(){return e.apply(r,arguments)}}});var Qr=i((Kd,Ao)=>{"use strict";var Ce=S(),Al=mo(),_l=Ur(),Ll=O(),Cl=Eo().f,Nl=wo(),Z=xe(),jl=Gr(),ee=B(),Po=N(),Ml=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 Al(e,this,arguments)};return r.prototype=e.prototype,r};Ao.exports=function(e,r){var t=e.target,n=e.global,o=e.stat,a=e.proto,s=n?Ce:o?Ce[t]:(Ce[t]||{}).prototype,u=n?Z:Z[t]||ee(Z,t,{})[t],f=u.prototype,l,c,p,b,d,T,y,I,h;for(b in r)l=Nl(n?b:t+(o?".":"#")+b,e.forced),c=!l&&s&&Po(s,b),T=u[b],c&&(e.dontCallGetSet?(h=Cl(s,b),y=h&&h.value):y=s[b]),d=c&&y?y:r[b],!(c&&typeof T==typeof d)&&(e.bind&&c?I=jl(d,Ce):e.wrap&&c?I=Ml(d):a&&Ll(d)?I=_l(d):I=d,(e.sham||d&&d.sham||T&&T.sham)&&ee(I,"sham",!0),ee(u,b,I),a&&(p=t+"Prototype",Po(Z,p)||ee(Z,p,{}),ee(Z[p],b,d),e.real&&f&&(l||!f[b])&&ee(f,b,d)))}});var Co=i((Yd,Lo)=>{"use strict";var Br=C(),kl=N(),_o=Function.prototype,Dl=Br&&Object.getOwnPropertyDescriptor,$r=kl(_o,"name"),Vl=$r&&function(){}.name==="something",Fl=$r&&(!Br||Br&&Dl(_o,"name").configurable);Lo.exports={EXISTS:$r,PROPER:Vl,CONFIGURABLE:Fl}});var jo=i((Hd,No)=>{"use strict";var Ul=Math.ceil,Gl=Math.floor;No.exports=Math.trunc||function(r){var t=+r;return(t>0?Gl:Ul)(t)}});var Wr=i((Xd,Mo)=>{"use strict";var Ql=jo();Mo.exports=function(e){var r=+e;return r!==r||r===0?0:Ql(r)}});var Do=i((Jd,ko)=>{"use strict";var Bl=Wr(),$l=Math.max,Wl=Math.min;ko.exports=function(e,r){var t=Bl(e);return t<0?$l(t+r,0):Wl(t,r)}});var Fo=i((Zd,Vo)=>{"use strict";var zl=Wr(),Kl=Math.min;Vo.exports=function(e){return e>0?Kl(zl(e),9007199254740991):0}});var zr=i((em,Uo)=>{"use strict";var Yl=Fo();Uo.exports=function(e){return Yl(e.length)}});var Bo=i((rm,Qo)=>{"use strict";var Hl=H(),Xl=Do(),Jl=zr(),Go=function(e){return function(r,t,n){var o=Hl(r),a=Jl(o),s=Xl(n,a),u;if(e&&t!=t){for(;a>s;)if(u=o[s++],u!=u)return!0}else for(;a>s;s++)if((e||s in o)&&o[s]===t)return e||s||0;return!e&&-1}};Qo.exports={includes:Go(!0),indexOf:Go(!1)}});var zo=i((tm,Wo)=>{"use strict";var Zl=L(),Kr=N(),ec=H(),rc=Bo().indexOf,tc=Ae(),$o=Zl([].push);Wo.exports=function(e,r){var t=ec(e),n=0,o=[],a;for(a in t)!Kr(tc,a)&&Kr(t,a)&&$o(o,a);for(;r.length>n;)Kr(t,a=r[n++])&&(~rc(o,a)||$o(o,a));return o}});var Yr=i((nm,Ko)=>{"use strict";Ko.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]});var Ho=i((om,Yo)=>{"use strict";var nc=zo(),oc=Yr();Yo.exports=Object.keys||function(r){return nc(r,oc)}});var Jo=i(Xo=>{"use strict";var ic=C(),ac=Tr(),sc=J(),uc=k(),lc=H(),cc=Ho();Xo.f=ic&&!ac?Object.defineProperties:function(r,t){uc(r);for(var n=lc(t),o=cc(t),a=o.length,s=0,u;a>s;)sc.f(r,u=o[s++],n[u]);return r}});var ei=i((am,Zo)=>{"use strict";var fc=gr();Zo.exports=fc("document","documentElement")});var Zr=i((sm,si)=>{"use strict";var pc=k(),vc=Jo(),ri=Yr(),bc=Ae(),dc=ei(),mc=dr(),Tc=Pe(),ti=">",ni="<",Xr="prototype",Jr="script",ii=Tc("IE_PROTO"),Hr=function(){},ai=function(e){return ni+Jr+ti+e+ni+"/"+Jr+ti},oi=function(e){e.write(ai("")),e.close();var r=e.parentWindow.Object;return e=null,r},yc=function(){var e=mc("iframe"),r="java"+Jr+":",t;return e.style.display="none",dc.appendChild(e),e.src=String(r),t=e.contentWindow.document,t.open(),t.write(ai("document.F=Object")),t.close(),t.F},Ne,je=function(){try{Ne=new ActiveXObject("htmlfile")}catch{}je=typeof document<"u"?document.domain&&Ne?oi(Ne):yc():oi(Ne);for(var e=ri.length;e--;)delete je[Xr][ri[e]];return je()};bc[ii]=!0;si.exports=Object.create||function(r,t){var n;return r!==null?(Hr[Xr]=pc(r),n=new Hr,Hr[Xr]=null,n[ii]=r):n=je(),t===void 0?n:vc.f(n,t)}});var li=i((um,ui)=>{"use strict";var hc=P();ui.exports=!hc(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})});var rt=i((lm,fi)=>{"use strict";var gc=N(),Ic=O(),Oc=_r(),xc=Pe(),Ec=li(),ci=xc("IE_PROTO"),et=Object,Sc=et.prototype;fi.exports=Ec?et.getPrototypeOf:function(e){var r=Oc(e);if(gc(r,ci))return r[ci];var t=r.constructor;return Ic(t)&&r instanceof t?t.prototype:r instanceof et?Sc:null}});var tt=i((cm,pi)=>{"use strict";var wc=B();pi.exports=function(e,r,t,n){return n&&n.enumerable?e[r]=t:wc(e,r,t),e}});var at=i((fm,di)=>{"use strict";var qc=P(),Rc=O(),Pc=Q(),Ac=Zr(),vi=rt(),_c=tt(),Lc=A(),Cc=ie(),it=Lc("iterator"),bi=!1,j,nt,ot;[].keys&&(ot=[].keys(),"next"in ot?(nt=vi(vi(ot)),nt!==Object.prototype&&(j=nt)):bi=!0);var Nc=!Pc(j)||qc(function(){var e={};return j[it].call(e)!==e});Nc?j={}:Cc&&(j=Ac(j));Rc(j[it])||_c(j,it,function(){return this});di.exports={IteratorPrototype:j,BUGGY_SAFARI_ITERATORS:bi}});var Me=i((pm,Ti)=>{"use strict";var jc=A(),Mc=jc("toStringTag"),mi={};mi[Mc]="z";Ti.exports=String(mi)==="[object z]"});var De=i((vm,yi)=>{"use strict";var kc=Me(),Dc=O(),ke=he(),Vc=A(),Fc=Vc("toStringTag"),Uc=Object,Gc=ke(function(){return arguments}())=="Arguments",Qc=function(e,r){try{return e[r]}catch{}};yi.exports=kc?ke:function(e){var r,t,n;return e===void 0?"Undefined":e===null?"Null":typeof(t=Qc(r=Uc(e),Fc))=="string"?t:Gc?ke(r):(n=ke(r))=="Object"&&Dc(r.callee)?"Arguments":n}});var gi=i((bm,hi)=>{"use strict";var Bc=Me(),$c=De();hi.exports=Bc?{}.toString:function(){return"[object "+$c(this)+"]"}});var st=i((dm,Oi)=>{"use strict";var Wc=Me(),zc=J().f,Kc=B(),Yc=N(),Hc=gi(),Xc=A(),Ii=Xc("toStringTag");Oi.exports=function(e,r,t,n){if(e){var o=t?e:e.prototype;Yc(o,Ii)||zc(o,Ii,{configurable:!0,value:r}),n&&!Wc&&Kc(o,"toString",Hc)}}});var Ei=i((mm,xi)=>{"use strict";var Jc=at().IteratorPrototype,Zc=Zr(),ef=ae(),rf=st(),tf=G(),nf=function(){return this};xi.exports=function(e,r,t,n){var o=r+" Iterator";return e.prototype=Zc(Jc,{next:ef(+!n,t)}),rf(e,o,!1,!0),tf[o]=nf,e}});var wi=i((Tm,Si)=>{"use strict";var of=L(),af=oe();Si.exports=function(e,r,t){try{return of(af(Object.getOwnPropertyDescriptor(e,r)[t]))}catch{}}});var Ri=i((ym,qi)=>{"use strict";var sf=O(),uf=String,lf=TypeError;qi.exports=function(e){if(typeof e=="object"||sf(e))return e;throw lf("Can't set "+uf(e)+" as a prototype")}});var Ai=i((hm,Pi)=>{"use strict";var cf=wi(),ff=k(),pf=Ri();Pi.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e=!1,r={},t;try{t=cf(Object.prototype,"__proto__","set"),t(r,[]),e=r instanceof Array}catch{}return function(o,a){return ff(o),pf(a),e?t(o,a):o.__proto__=a,o}}():void 0)});var Ui=i((gm,Fi)=>{"use strict";var vf=Qr(),bf=D(),Ve=ie(),Di=Co(),df=O(),mf=Ei(),_i=rt(),Li=Ai(),Tf=st(),yf=B(),ut=tt(),hf=A(),Ci=G(),Vi=at(),gf=Di.PROPER,If=Di.CONFIGURABLE,Ni=Vi.IteratorPrototype,Fe=Vi.BUGGY_SAFARI_ITERATORS,le=hf("iterator"),ji="keys",ce="values",Mi="entries",ki=function(){return this};Fi.exports=function(e,r,t,n,o,a,s){mf(t,r,n);var u=function(h){if(h===o&&b)return b;if(!Fe&&h in c)return c[h];switch(h){case ji:return function(){return new t(this,h)};case ce:return function(){return new t(this,h)};case Mi:return function(){return new t(this,h)}}return function(){return new t(this)}},f=r+" Iterator",l=!1,c=e.prototype,p=c[le]||c["@@iterator"]||o&&c[o],b=!Fe&&p||u(o),d=r=="Array"&&c.entries||p,T,y,I;if(d&&(T=_i(d.call(new e)),T!==Object.prototype&&T.next&&(!Ve&&_i(T)!==Ni&&(Li?Li(T,Ni):df(T[le])||ut(T,le,ki)),Tf(T,f,!0,!0),Ve&&(Ci[f]=ki))),gf&&o==ce&&p&&p.name!==ce&&(!Ve&&If?yf(c,"name",ce):(l=!0,b=function(){return bf(p,this)})),o)if(y={values:u(ce),keys:a?b:u(ji),entries:u(Mi)},s)for(I in y)(Fe||l||!(I in c))&&ut(c,I,y[I]);else vf({target:r,proto:!0,forced:Fe||l},y);return(!Ve||s)&&c[le]!==b&&ut(c,le,b,{name:o}),Ci[r]=b,y}});var Qi=i((Im,Gi)=>{"use strict";Gi.exports=function(e,r){return{value:e,done:r}}});var ct=i((Om,Ki)=>{"use strict";var Of=H(),lt=zt(),Bi=G(),Wi=co(),xf=J().f,Ef=Ui(),Ue=Qi(),Sf=ie(),wf=C(),zi="Array Iterator",qf=Wi.set,Rf=Wi.getterFor(zi);Ki.exports=Ef(Array,"Array",function(e,r){qf(this,{type:zi,target:Of(e),index:0,kind:r})},function(){var e=Rf(this),r=e.target,t=e.kind,n=e.index++;return!r||n>=r.length?(e.target=void 0,Ue(void 0,!0)):t=="keys"?Ue(n,!1):t=="values"?Ue(r[n],!1):Ue([n,r[n]],!1)},"values");var $i=Bi.Arguments=Bi.Array;lt("keys");lt("values");lt("entries");if(!Sf&&wf&&$i.name!=="values")try{xf($i,"name",{value:"values"})}catch{}});var Hi=i((xm,Yi)=>{"use strict";var Pf=A(),Af=G(),_f=Pf("iterator"),Lf=Array.prototype;Yi.exports=function(e){return e!==void 0&&(Af.Array===e||Lf[_f]===e)}});var ft=i((Em,Ji)=>{"use strict";var Cf=De(),Xi=we(),Nf=ge(),jf=G(),Mf=A(),kf=Mf("iterator");Ji.exports=function(e){if(!Nf(e))return Xi(e,kf)||Xi(e,"@@iterator")||jf[Cf(e)]}});var ea=i((Sm,Zi)=>{"use strict";var Df=D(),Vf=oe(),Ff=k(),Uf=Se(),Gf=ft(),Qf=TypeError;Zi.exports=function(e,r){var t=arguments.length<2?Gf(e):r;if(Vf(t))return Ff(Df(t,e));throw Qf(Uf(e)+" is not iterable")}});var na=i((wm,ta)=>{"use strict";var Bf=D(),ra=k(),$f=we();ta.exports=function(e,r,t){var n,o;ra(e);try{if(n=$f(e,"return"),!n){if(r==="throw")throw t;return t}n=Bf(n,e)}catch(a){o=!0,n=a}if(r==="throw")throw t;if(o)throw n;return ra(n),t}});var ua=i((qm,sa)=>{"use strict";var Wf=Gr(),zf=D(),Kf=k(),Yf=Se(),Hf=Hi(),Xf=zr(),oa=Ir(),Jf=ea(),Zf=ft(),ia=na(),ep=TypeError,Ge=function(e,r){this.stopped=e,this.result=r},aa=Ge.prototype;sa.exports=function(e,r,t){var n=t&&t.that,o=!!(t&&t.AS_ENTRIES),a=!!(t&&t.IS_RECORD),s=!!(t&&t.IS_ITERATOR),u=!!(t&&t.INTERRUPTED),f=Wf(r,n),l,c,p,b,d,T,y,I=function(g){return l&&ia(l,"normal",g),new Ge(!0,g)},h=function(g){return o?(Kf(g),u?f(g[0],g[1],I):f(g[0],g[1])):u?f(g,I):f(g)};if(a)l=e.iterator;else if(s)l=e;else{if(c=Zf(e),!c)throw ep(Yf(e)+" is not iterable");if(Hf(c)){for(p=0,b=Xf(e);b>p;p++)if(d=h(e[p]),d&&oa(aa,d))return d;return new Ge(!1)}l=Jf(e,c)}for(T=a?e.next:l.next;!(y=zf(T,l)).done;){try{d=h(y.value)}catch(g){ia(l,"throw",g)}if(typeof d=="object"&&d&&oa(aa,d))return d}return new Ge(!1)}});var ca=i((Rm,la)=>{"use strict";var rp=qe(),tp=J(),np=ae();la.exports=function(e,r,t){var n=rp(r);n in e?tp.f(e,n,np(0,t)):e[n]=t}});var fa=i(()=>{"use strict";var op=Qr(),ip=ua(),ap=ca();op({target:"Object",stat:!0},{fromEntries:function(r){var t={};return ip(r,function(n,o){ap(t,n,o)},{AS_ENTRIES:!0}),t}})});var va=i((_m,pa)=>{"use strict";ct();fa();var sp=xe();pa.exports=sp.Object.fromEntries});var da=i((Lm,ba)=>{"use strict";ba.exports={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}});var ya=i(()=>{"use strict";ct();var up=da(),lp=S(),cp=De(),fp=B(),ma=G(),pp=A(),Ta=pp("toStringTag");for(Qe in up)pt=lp[Qe],Be=pt&&pt.prototype,Be&&cp(Be)!==Ta&&fp(Be,Ta,Qe),ma[Qe]=ma.Array;var pt,Be,Qe});var ga=i((jm,ha)=>{"use strict";var vp=va();ya();ha.exports=vp});var Oa=i((Mm,Ia)=>{"use strict";var bp=ga();Ia.exports=bp});var ja="__VERSION__";var x=class{constructor(){this.subscriptions=[]}unsubscribe(){let r=this.subscriptions;this.subscriptions=[],r.forEach(t=>typeof t=="function"?t():t.unsubscribe())}add(r){return this.subscriptions.push(r),this}};var _=e=>{throw new Error(`${e} is value of unexpected type`)},Ma=e=>{};var F=()=>{};var v=class{constructor(r){r&&(this._subscribe=r)}subscribe(r,t){let n;t?typeof t=="function"?n={next:t,error:F}:n={next:s=>t.next(s),error:s=>t.error?.(s)}:n={next:F,error:F};let o=typeof r=="function"?{next:s=>{try{r(s)}catch(u){n.next(u)}},error:s=>n.next(s)}:{next:s=>r.next(s),error:s=>r.error?r.error(s):n.next(s)},a;try{a=this._subscribe(o)}catch(s){o.error?.(s)}return new x().add(()=>{switch(o.next=F,o.error=F,typeof a){case"function":a();return;case"object":a.unsubscribe();return;case"undefined":return;default:return _(a)}})}pipe(...r){return r.reduce((t,n)=>n(t),this)}_subscribe(r){}};var M=class extends v{constructor(){super();this.keyCounter=0;this.subscribers=new Map}next(t){this.subscribers.forEach(n=>n.next(t))}error(t){this.subscribers.forEach(n=>n.error?.(t))}_subscribe(t){let n=this.keyCounter++;return this.subscribers.set(n,t),new x().add(()=>this.subscribers.delete(n))}};var We=class{constructor(){this.log$=new M;this.logs=[];this.log=r=>{let 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{n={message:"error in `createCustomLog`",component:"Logger"}}this.log(n)}}createComponentLog(r){return this.createCustomLog(t=>({component:r,...t}))}};function ka(e,r='Assertion "value is not nullable" failed'){if(e==null)throw new Error(r)}function Da(e,r='Assertion "value is nullable" failed'){if(e!=null)throw new Error(r)}function W(e){return typeof e<"u"&&e!==null}function ze(e){return e==null}function Va(e,r){if(!e?.length)throw new Error(r)}function Fa(e,r){if(e?.length)throw new Error(r)}var Ua=(e,r,t)=>new Promise((n,o)=>{r.addEventListener("abort",()=>{u(),l.remove()});let a=()=>{u(),o()},s=()=>{u(),n()},u=()=>{f&&clearTimeout(f),l.removeEventListener("load",s),l.removeEventListener("error",a)},f;t&&(f=window.setTimeout(a,t));let l=document.createElement("script");l.addEventListener("load",s),l.addEventListener("error",a),l.src=e,document.head.appendChild(l)});var Ga=typeof window.performance?.now=="function"?()=>window.performance.now():()=>Date.now();var Qa=(e,r)=>async(...t)=>{let n=r(...t),o=e.aborted,a;for(;!o&&!e.aborted;)try{let s=await n.next(a);o=s.done??!1,a=s.value}catch(s){await n.throw(s)}return a};var mt=(l=>(l.Unknown="Unknown",l.Yandex="Yandex",l.Chrome="Chrome",l.Chromium="Chromium",l.Firefox="Firefox",l.Safari="Safari",l.Opera="Opera",l.Edge="Edge",l.Rest="Rest",l))(mt||{}),Tt=(f=>(f.Unknown="Unknown",f.Android="Android",f.iPhone="iPhone",f.iPad="iPad",f.iPod="iPod",f.RestMobile="RestMobile",f.Mac="Mac",f.Desktop="Desktop",f))(Tt||{}),ve=()=>{let{userAgent:e}=window.navigator,r=/yabrowser/i.test(e)?"Yandex":void 0,t=/chrome|crios/i.test(e)?"Chrome":void 0,n=/chromium/i.test(e)?"Chromium":void 0,o=/firefox|fxios/i.test(e)?"Firefox":void 0,a=/webkit|safari|khtml/i.test(e)?"Safari":void 0,s=/opr\//i.test(e)?"Opera":void 0,u=/edg/i.test(e)?"Edge":void 0,f=/android/i.test(e)?"Android":void 0,l=/iphone/i.test(e)?"iPhone":void 0,c=/ipad/i.test(e)?"iPad":void 0,p=/ipod/i.test(e)?"iPod":void 0,b=/mac/i.test(e)?"Mac":void 0,d=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(e)?"RestMobile":void 0;return{browser:r||o||s||u||t||n||a||"Rest",device:f||l||c||p||d||b||"Desktop"}},Ba=(e=!1)=>{let t=["iPhone","iPad","iPod"].includes(ve().device);if(!e)return t;let{userAgent:n,maxTouchPoints:o}=window.navigator;return!!(t||/macintosh/i.test(n)&&o>0)},$a=()=>{let{userAgent:e}=window.navigator,r=e.match(/Version\/(\d+(\.\d+)?)/i);if(!r)return null;let t=r[1],n=parseFloat(t);return isNaN(n)?null:n},Wa=()=>ve().device==="Android",za=()=>["Mac","iPhone","iPad","iPod"].includes(ve().device),Ka=()=>/Mobile|mini|Fennec|Android|iP(ad|od|hone)/.test(navigator.appVersion??navigator.userAgent)||navigator?.userAgentData?.mobile;var Ya=(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 yt={};La(yt,{clear:()=>rs,get:()=>Xa,has:()=>Za,isPersistent:()=>Ha,remove:()=>es,set:()=>Ja});var z,U,Ke=`vk-videoplayer-dummy-key-${Math.random()}`,K=()=>{if(U!==void 0)return U;try{localStorage.setItem(Ke,"test"),localStorage.removeItem(Ke),U=0}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem(Ke),U=1}catch(r){if(r instanceof DOMException||r instanceof TypeError)U=2;else throw r}else throw e}return U===2&&(z=new Map),U},Ha=()=>K()===0,Xa=e=>{let r=K();switch(r){case 0:return localStorage.getItem(e)??void 0;case 1:return sessionStorage.getItem(e)??void 0;case 2:return z?.get(e);default:_(r)}},Ja=(e,r)=>{let t=K();switch(t){case 0:try{localStorage.setItem(e,r)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case 1:try{sessionStorage.setItem(e,r)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case 2:return void z?.set(e,r);default:_(t)}},Za=e=>{let r=K();switch(r){case 0:return e in localStorage;case 1:return e in sessionStorage;case 2:return z?.has(e)??!1;default:return _(r),!1}},es=e=>{let r=K();switch(r){case 0:return localStorage.removeItem(e);case 1:return sessionStorage.removeItem(e);case 2:return void z?.delete(e);default:_(r)}},rs=()=>{let e=K();switch(e){case 0:return localStorage.clear();case 1:return sessionStorage.clear();case 2:return z?.clear();default:_(e)}};var ts=()=>{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)}let t=r?new URL(r).hostname:void 0;return{isEmbed:e,host:t}};var Ye=(c=>(c.INVARIANT="Invariant quality",c.Q_144P="144p",c.Q_240P="240p",c.Q_360P="360p",c.Q_480P="480p",c.Q_720P="720p",c.Q_1080P="1080p",c.Q_1440P="1440p",c.Q_2160P="2160p",c.Q_4320P="4320p",c))(Ye||{});var E={"144p":{width:256,height:144},"240p":{width:428,height:240},"360p":{width:640,height:360},"480p":{width:856,height:480},"720p":{width:1280,height:720},"1080p":{width:1920,height:1080},"1440p":{width:2560,height:1440},"2160p":{width:3840,height:2160},"4320p":{width:7680,height:4320}},ns=(e,r)=>E[e].height>E[r].height,os=(e,r)=>E[e].height>=E[r].height,He=(e,r)=>E[e].height<E[r].height,is=(e,r)=>E[e].height<=E[r].height,as=e=>e.sort((r,t)=>r===t?0:r==="Invariant quality"?1:t==="Invariant quality"?-1:He(r,t)?1:-1)[0],ht=Object.keys(E).sort((e,r)=>He(e,r)?-1:1),ss=(e,r=.02)=>[...ht].find(n=>E[n].height*(1+r)>=e),us=({width:e,height:r})=>{let t=Math.min(e,r),n=Math.max(e,r);return ht.find(o=>{let a=E[o];return a.width>=n&&a.height>=t})},ls=e=>E[e].height,Xe=e=>e==="Invariant quality",cs=e=>e.every(r=>!Xe(r));function fs(e){if(Xe(e))throw new Error("Expected exact quality")}var ps=(e,r)=>{let t={};for(let n of Object.keys(r)){let o=r[n],a=e[n];Array.isArray(o)&&Array.isArray(a)?t[n]=a:typeof o=="object"&&typeof a=="object"?t[n]=ps(a,o):t[n]=n in e?a:o}return t};var Yp=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 Je(e,r=0,t){let n,o,a,s,u,f,l=0,c=!1,p=!1,b=!0,d=!r&&r!==0&&typeof window.requestAnimationFrame=="function";t&&(c=!!t.leading,p="maxWait"in t,a=t?.maxWait?Math.max(+t?.maxWait||0,r):a,b="trailing"in t?!!t.trailing:b);function T(m){let w=n,V=o;return n=o=void 0,l=m,s=e.apply(V,w),s}function y(m,w){return d?(u&&window.cancelAnimationFrame(u),window.requestAnimationFrame(m)):setTimeout(m,w)}function I(m){if(d){window.cancelAnimationFrame(m);return}clearTimeout(m)}function h(m){return l=m,u=y(fe,r),c?T(m):s}function g(m){let w=m-f,V=m-l,dt=r-w;return p?Math.min(dt,a-V):dt}function vt(m){let w=m-f,V=m-l;return f===void 0||w>=r||w<0||p&&V>=a}function fe(){let m=Date.now();if(vt(m))return bt(m);u=y(fe,g(m))}function bt(m){return u=void 0,b&&n?T(m):(n=o=void 0,s)}function Ea(){u!==void 0&&I(u),l=0,n=f=o=u=void 0}function Sa(){return u===void 0?s:bt(Date.now())}function wa(){return u!==void 0}function pe(...m){let w=Date.now(),V=vt(w);if(n=m,o=this,f=w,V){if(u===void 0)return h(f);if(p)return u=y(fe,r),T(f)}return u===void 0&&(u=y(fe,r)),s}return pe.cancel=Ea,pe.flush=Sa,pe.pending=wa,pe}var Ze=(e,r=0,t)=>Je(e,r,{...{leading:!0,trailing:!0},...t,maxWait:r});var be=(e,r)=>{if(e===null||typeof e!="object")return e;let t=Array.isArray(e)?[]:{};for(let n in e){if(typeof r=="function"){let o=r(e[n],n,e,t);if(o!==void 0){t[n]=o;continue}}typeof e[n]=="object"?t[n]=be(e[n],r):t[n]=e[n]}return t};var vs=e=>be(e);var bs=300,ds=(e,r=bs)=>new v(t=>{let{width:n,height:o}=e.getBoundingClientRect();if(t.next({width:n,height:o}),!window.ResizeObserver)return;let a=new ResizeObserver(Ze(s=>{let u=s[0];if(!u)return;let f,l;u.contentBoxSize&&u.contentBoxSize[0]?(l=u.contentBoxSize[0].blockSize,f=u.contentBoxSize[0].inlineSize):u.contentRect&&(f=u.contentRect.width,l=u.contentRect.height),W(f)&&W(l)&&t.next({width:f,height:l})},r));return a.observe(e),()=>a.disconnect()});var de=class extends M{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){let n=super._subscribe(t);return t.next(this.value),n}};function gt(e){return new v(r=>{let t={},n=Object.keys(e).length,o=a=>s=>{a in t||n--,t[a]=s,n===0&&r.next(t)};return Object.entries(e).reduce((a,[s,u])=>a.add(u.subscribe(o(s))),new x)})}function It(...e){return new v(r=>e.reduce((t,n)=>t.add(n.subscribe(r)),new x))}var ms=e=>new v(r=>{let t=window.setTimeout(()=>{try{r.next()}catch(n){if(r.error)r.error(n);else throw n}},e);return()=>window.clearTimeout(t)});var Ts=e=>new v(r=>{let t=window.setInterval(()=>r.next(),e);return()=>{t&&(window.clearInterval(t),t=void 0)}});var ys=e=>new v(r=>{e.forEach(t=>r.next(t))});var hs=(e,r)=>new v(t=>{let n=o=>t.next(o);return e.addEventListener(r,n),()=>e.removeEventListener(r,n)});function Ot(e){return r=>new v(t=>r.subscribe(new er(t,e)))}var er=class{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){this.destination.error?.(r)}};var gs={leading:!1,trailing:!0};function xt(e,r=gs){return t=>new v(n=>t.subscribe(new rr(n,e,r)))}var rr=class{constructor(r,t,n){this.destination=r;this.time=t;this.config=n}next(r){this.lastValue=r,W(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){this.destination.error?.(r)}};var Is={leading:!0,trailing:!1};function Et(e,r=Is){return t=>new v(n=>t.subscribe(new tr(n,e,r)))}var tr=class{constructor(r,t,n){this.destination=r;this.time=t;this.config=n}next(r){this.lastValue=r,ze(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){this.destination.error?.(r)}};function St(e){return r=>new v(t=>r.subscribe(new nr(t,e)))}var nr=class{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){this.destination.error?.(r)}};function qt(e=(r,t)=>r===t){return r=>new v(t=>r.subscribe(new or(t,e)))}var wt={},or=class{constructor(r,t){this.destination=r;this.predicate=t;this.lastValue=wt}next(r){let t;try{t=this.lastValue===wt||!this.predicate(this.lastValue,r),this.lastValue=r}catch(n){throw this.error(n),n}t&&this.destination.next(r)}error(r){this.destination.error?.(r)}};function me(e){return r=>new v(t=>r.subscribe(new ir(t,e)))}var ir=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){this.destination.error?.(r)}};function Rt(e){return me(()=>e)}function Pt(){return e=>new v(r=>{let t=!1,n=!1,o=e.subscribe(a=>{t||(t=!0,r.next(a)),n&&o.unsubscribe()},a=>{t=!0,r.error?.(a),n&&o.unsubscribe()});return n=!0,t&&o.unsubscribe(),o})}function At(){return e=>new v(r=>e.subscribe(new ar(r)))}var ar=class{constructor(r){this.destination=r;this.hasLast=!1}next(r){let t=this.last;if(this.last=r,!this.hasLast){this.hasLast=!0;return}this.destination.next([t,r])}error(r){this.destination.error?.(r)}};function _t(e){return r=>new v(t=>r.subscribe(new sr(t,e)))}var sr=class{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){this.destination.error?.(r)}};var Os=(u=>(u.NETWORK="network",u.VIDEO_PIPELINE="video_pipeline",u.EXTERNAL_API="external_api",u.PARSER="parser",u.DOM="dom",u.WTF="wtf",u.FATAL="fatal",u))(Os||{});var Te=class{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;let 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;let n=this.listeners[r.type].slice();for(let o=0,a=n.length;o<a;o++){let s=n[o];try{s.callback.call(this,r)}catch(u){Promise.resolve().then(()=>{throw u})}s.options&&s.options.once&&this.removeEventListener(r.type,s.callback)}return!r.defaultPrevented}},Y=class extends Te{constructor(){super(),this.listeners||Te.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)}},re=class{constructor(){Object.defineProperty(this,"signal",{value:new Y,writable:!0,configurable:!0})}abort(r){let t;try{t=new Event("abort")}catch{typeof document<"u"?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>"u")n=new Error("This operation was aborted"),n.name="AbortError";else try{n=new DOMException("signal is aborted without reason")}catch{n=new Error("This operation was aborted"),n.name="AbortError"}this.signal.reason=n,this.signal.dispatchEvent(t)}toString(){return"[object AbortController]"}};typeof Symbol<"u"&&Symbol.toStringTag&&(re.prototype[Symbol.toStringTag]="AbortController",Y.prototype[Symbol.toStringTag]="AbortSignal");function ye(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 ur(e){typeof e=="function"&&(e={fetch:e});let{fetch:r,Request:t=r.Request,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o=!1}=e;if(!ye({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,c){let p;c&&c.signal&&(p=c.signal,delete c.signal);let b=new t(l,c);return p&&Object.defineProperty(b,"signal",{writable:!1,enumerable:!1,configurable:!0,value:p}),b},a.prototype=t.prototype);let s=r;return{fetch:(f,l)=>{let c=a&&a.prototype.isPrototypeOf(f)?f.signal:l?l.signal:void 0;if(c){let p;try{p=new DOMException("Aborted","AbortError")}catch{p=new Error("Aborted"),p.name="AbortError"}if(c.aborted)return Promise.reject(p);let b=new Promise((d,T)=>{c.addEventListener("abort",()=>T(p),{once:!0})});return l&&l.signal&&delete l.signal,Promise.race([b,s(f,l)])}return s(f,l)},Request:a}}var te=ye({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),Lt=te?ur({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,Ct=te?Lt.fetch:window.fetch,Bb=te?Lt.Request:window.Request,$b=te?re:window.AbortController,Wb=te?Y:window.AbortSignal;var xa=Na(Oa(),1),dp=(p=>(p.Armenian="58",p.Azerbaijani="57",p.Belarusian="114",p.English="3",p.Kazakh="97",p.Portuguese="73",p.Russian="0",p.Spanish="4",p.Ukrainian="1",p.Uzbek="65",p.Vietnamese="75",p))(dp||{}),mp="vk.com",Dm=async(e,r,t)=>{let n=new URL(`https://${mp}/js/lang-pack.js`);n.searchParams.set("format","json"),n.searchParams.set("name",r),e!==void 0&&n.searchParams.set("lang",e);let a=await(await Ct(n.toString())).json();return Tp(a,t)},Tp=(e,r)=>(0,xa.default)(Object.entries(e.keys).map(([t,n])=>[t.substring(`${r}_`.length),yp(n)])),yp=e=>Array.isArray(e)?e[0]:e;var hp=(t=>(t.RU="ru",t.EN="en",t))(hp||{});export{mt as CurrentClientBrowser,Tt as CurrentClientDevice,Os as ErrorCategory,hp as InterfaceLanguage,We as Logger,v as Observable,M as Subject,x as Subscription,ja as VERSION,dp as VKNumericLanguage,de as ValueSubject,Ye as VideoQuality,Qa as abortable,Ua as addScript,cs as areQualitiesExact,Fa as assertEmptyArray,_ as assertNever,ka as assertNonNullable,Va as assertNotEmptyArray,Da as assertNullable,fs as assertQualityIsExact,Ot as buffer,Ma as checkNever,vs as cloneDeep,be as cloneDeepWith,gt as combine,xt as debounce,Je as debounceFn,ts as detectEmbed,ps as fillWithDefault,St as filter,qt as filterChanged,hs as fromEvent,ve as getCurrentBrowser,Ya as getExponentialDelay,as as getHighestQuality,$a as getIOSVersion,Ts as interval,Wa as isAndroid,ns as isHigher,os as isHigherOrEqual,Ba as isIOS,Xe as isInvariantQuality,He as isLower,is as isLowerOrEqual,za as isMacLike,Ka as isMobile,W as isNonNullable,ze as isNullable,Dm as loadVKLangPack,me as map,Rt as mapTo,It as merge,F as noop,Ga as now,ys as observableFrom,ds as observeElementSize,Pt as once,At as pairwise,yt as safeStorage,_t as tap,Et as throttle,Ze as throttleFn,Yp as timeCodeToString,ms as timeout,ss as videoHeightToQuality,ls as videoQualityToHeight,us as videoSizeToQuality};
package/evergreen.esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
- * @vkontakte/videoplayer-shared v1.0.36
3
- * Tue, 18 Jun 2024 13:17:03 GMT
4
- * https://st.mycdn.me/static/vkontakte-videoplayer/1-0-36/doc/
2
+ * @vkontakte/videoplayer-shared v1.0.37-dev.0bef53b3.0
3
+ * Wed, 10 Jul 2024 00:39:25 GMT
4
+ * https://st.mycdn.me/static/vkontakte-videoplayer/1-0-37/doc/
5
5
  */
6
- const Te="1.0.36";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`)},ye=e=>{},T=()=>{};class h{constructor(t){t&&(this._subscribe=t)}subscribe(t,n){let i;n?typeof n=="function"?i={next:n,error:T}:i={next:s=>n.next(s),error:s=>n.error?.(s)}:i={next:T,error:T};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=T,o.error=T,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,y=/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||y||S||R||v||f.Desktop}},Fe=(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)},Ue=()=>{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),Be=({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})},Ce=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,y=!1,S=!1,v=!0;const R=!t&&t!==0&&typeof window.requestAnimationFrame=="function";n&&(y=!!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 C(c){if(R){window.cancelAnimationFrame(c);return}clearTimeout(c)}function Y(c){return l=c,a=I(_,t),y?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 F(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(F(c))return U(c);a=I(_,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),l=0,i=d=o=a=void 0}function Z(){return a===void 0?s:U(Date.now())}function K(){return a!==void 0}function P(...c){const g=Date.now(),b=F(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}),B=(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]=B(e[i],t):n[i]=e[i]}return n},Ze=e=>B(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=>{let n=window.setInterval(()=>t.next(),e);return()=>{n&&(window.clearInterval(n),n=void 0)}}),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",e.FATAL="fatal"})(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,Te 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,ye as checkNever,Ze as cloneDeep,B 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,Ue as getIOSVersion,st as interval,We as isHigher,je as isHigherOrEqual,Fe 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,T 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,Ce as videoQualityToHeight,Be as videoSizeToQuality};
6
+ var ye=Object.defineProperty;var Oe=(t,e)=>{for(var r in e)ye(t,r,{get:e[r],enumerable:!0})};var we="1.0.37-dev.0bef53b3.0";var f=class{constructor(){this.subscriptions=[]}unsubscribe(){let e=this.subscriptions;this.subscriptions=[],e.forEach(r=>typeof r=="function"?r():r.unsubscribe())}add(e){return this.subscriptions.push(e),this}};var v=t=>{throw new Error(`${t} is value of unexpected type`)},Ee=t=>{};var h=()=>{};var l=class{constructor(e){e&&(this._subscribe=e)}subscribe(e,r){let n;r?typeof r=="function"?n={next:r,error:h}:n={next:o=>r.next(o),error:o=>r.error?.(o)}:n={next:h,error:h};let s=typeof e=="function"?{next:o=>{try{e(o)}catch(a){n.next(a)}},error:o=>n.next(o)}:{next:o=>e.next(o),error:o=>e.error?e.error(o):n.next(o)},i;try{i=this._subscribe(s)}catch(o){s.error?.(o)}return new f().add(()=>{switch(s.next=h,s.error=h,typeof i){case"function":i();return;case"object":i.unsubscribe();return;case"undefined":return;default:return v(i)}})}pipe(...e){return e.reduce((r,n)=>n(r),this)}_subscribe(e){}};var I=class extends l{constructor(){super();this.keyCounter=0;this.subscribers=new Map}next(r){this.subscribers.forEach(n=>n.next(r))}error(r){this.subscribers.forEach(n=>n.error?.(r))}_subscribe(r){let n=this.keyCounter++;return this.subscribers.set(n,r),new f().add(()=>this.subscribers.delete(n))}};var V=class{constructor(){this.log$=new I;this.logs=[];this.log=e=>{let r={...e,timestamp:Date.now()};this.logs.push(r),this.log$.next(r)};this.getAllLogs=()=>this.logs}createCustomLog(e){return(...r)=>{let n;try{n=e(...r)}catch{n={message:"error in `createCustomLog`",component:"Logger"}}this.log(n)}}createComponentLog(e){return this.createCustomLog(r=>({component:e,...r}))}};function Se(t,e='Assertion "value is not nullable" failed'){if(t==null)throw new Error(e)}function Ae(t,e='Assertion "value is nullable" failed'){if(t!=null)throw new Error(e)}function y(t){return typeof t<"u"&&t!==null}function Q(t){return t==null}function Re(t,e){if(!t?.length)throw new Error(e)}function Ce(t,e){if(t?.length)throw new Error(e)}var ke=(t,e,r)=>new Promise((n,s)=>{e.addEventListener("abort",()=>{a(),u.remove()});let i=()=>{a(),s()},o=()=>{a(),n()},a=()=>{c&&clearTimeout(c),u.removeEventListener("load",o),u.removeEventListener("error",i)},c;r&&(c=window.setTimeout(i,r));let u=document.createElement("script");u.addEventListener("load",o),u.addEventListener("error",i),u.src=t,document.head.appendChild(u)});var Le=typeof window.performance?.now=="function"?()=>window.performance.now():()=>Date.now();var Pe=(t,e)=>async(...r)=>{let n=e(...r),s=t.aborted,i;for(;!s&&!t.aborted;)try{let o=await n.next(i);s=o.done??!1,i=o.value}catch(o){await n.throw(o)}return i};var ee=(u=>(u.Unknown="Unknown",u.Yandex="Yandex",u.Chrome="Chrome",u.Chromium="Chromium",u.Firefox="Firefox",u.Safari="Safari",u.Opera="Opera",u.Edge="Edge",u.Rest="Rest",u))(ee||{}),te=(c=>(c.Unknown="Unknown",c.Android="Android",c.iPhone="iPhone",c.iPad="iPad",c.iPod="iPod",c.RestMobile="RestMobile",c.Mac="Mac",c.Desktop="Desktop",c))(te||{}),k=()=>{let{userAgent:t}=window.navigator,e=/yabrowser/i.test(t)?"Yandex":void 0,r=/chrome|crios/i.test(t)?"Chrome":void 0,n=/chromium/i.test(t)?"Chromium":void 0,s=/firefox|fxios/i.test(t)?"Firefox":void 0,i=/webkit|safari|khtml/i.test(t)?"Safari":void 0,o=/opr\//i.test(t)?"Opera":void 0,a=/edg/i.test(t)?"Edge":void 0,c=/android/i.test(t)?"Android":void 0,u=/iphone/i.test(t)?"iPhone":void 0,d=/ipad/i.test(t)?"iPad":void 0,b=/ipod/i.test(t)?"iPod":void 0,E=/mac/i.test(t)?"Mac":void 0,S=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(t)?"RestMobile":void 0;return{browser:e||s||o||a||r||n||i||"Rest",device:c||u||d||b||S||E||"Desktop"}},Me=(t=!1)=>{let r=["iPhone","iPad","iPod"].includes(k().device);if(!t)return r;let{userAgent:n,maxTouchPoints:s}=window.navigator;return!!(r||/macintosh/i.test(n)&&s>0)},Ne=()=>{let{userAgent:t}=window.navigator,e=t.match(/Version\/(\d+(\.\d+)?)/i);if(!e)return null;let r=e[1],n=parseFloat(r);return isNaN(n)?null:n},Ve=()=>k().device==="Android",Qe=()=>["Mac","iPhone","iPad","iPod"].includes(k().device),_e=()=>/Mobile|mini|Fennec|Android|iP(ad|od|hone)/.test(navigator.appVersion??navigator.userAgent)||navigator?.userAgentData?.mobile;var De=(t,{start:e=0,factor:r=2,max:n=1/0,min:s=e,random:i=0}={})=>{let o=e;return o*=r**t,o*=1+(Math.random()*i*2-i),o=Math.round(o),o=Math.min(o,n),o=Math.max(o,s),o};var re={};Oe(re,{clear:()=>We,get:()=>Fe,has:()=>je,isPersistent:()=>Ue,remove:()=>Be,set:()=>ze});var O,g,_=`vk-videoplayer-dummy-key-${Math.random()}`,w=()=>{if(g!==void 0)return g;try{localStorage.setItem(_,"test"),localStorage.removeItem(_),g=0}catch(t){if(t instanceof DOMException||t instanceof TypeError)try{sessionStorage.getItem(_),g=1}catch(e){if(e instanceof DOMException||e instanceof TypeError)g=2;else throw e}else throw t}return g===2&&(O=new Map),g},Ue=()=>w()===0,Fe=t=>{let e=w();switch(e){case 0:return localStorage.getItem(t)??void 0;case 1:return sessionStorage.getItem(t)??void 0;case 2:return O?.get(t);default:v(e)}},ze=(t,e)=>{let r=w();switch(r){case 0:try{localStorage.setItem(t,e)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case 1:try{sessionStorage.setItem(t,e)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case 2:return void O?.set(t,e);default:v(r)}},je=t=>{let e=w();switch(e){case 0:return t in localStorage;case 1:return t in sessionStorage;case 2:return O?.has(t)??!1;default:return v(e),!1}},Be=t=>{let e=w();switch(e){case 0:return localStorage.removeItem(t);case 1:return sessionStorage.removeItem(t);case 2:return void O?.delete(t);default:v(e)}},We=()=>{let t=w();switch(t){case 0:return localStorage.clear();case 1:return sessionStorage.clear();case 2:return O?.clear();default:v(t)}};var Ge=()=>{let t,e;try{t=window.self!==window.top}catch(n){n instanceof DOMException&&n.name==="SecurityError"?t=!0:(t=!1,console.error(n))}try{window.location.ancestorOrigins&&(e=window.location.ancestorOrigins[window.location.ancestorOrigins.length-1])}catch(n){console.error(n)}try{!e&&document.referrer&&(e=document.referrer)}catch(n){console.error(n)}let r=e?new URL(e).hostname:void 0;return{isEmbed:t,host:r}};var D=(d=>(d.INVARIANT="Invariant quality",d.Q_144P="144p",d.Q_240P="240p",d.Q_360P="360p",d.Q_480P="480p",d.Q_720P="720p",d.Q_1080P="1080p",d.Q_1440P="1440p",d.Q_2160P="2160p",d.Q_4320P="4320p",d))(D||{});var m={"144p":{width:256,height:144},"240p":{width:428,height:240},"360p":{width:640,height:360},"480p":{width:856,height:480},"720p":{width:1280,height:720},"1080p":{width:1920,height:1080},"1440p":{width:2560,height:1440},"2160p":{width:3840,height:2160},"4320p":{width:7680,height:4320}},qe=(t,e)=>m[t].height>m[e].height,He=(t,e)=>m[t].height>=m[e].height,U=(t,e)=>m[t].height<m[e].height,Ke=(t,e)=>m[t].height<=m[e].height,$e=t=>t.sort((e,r)=>e===r?0:e==="Invariant quality"?1:r==="Invariant quality"?-1:U(e,r)?1:-1)[0],ne=Object.keys(m).sort((t,e)=>U(t,e)?-1:1),Ye=(t,e=.02)=>[...ne].find(n=>m[n].height*(1+e)>=t),Xe=({width:t,height:e})=>{let r=Math.min(t,e),n=Math.max(t,e);return ne.find(s=>{let i=m[s];return i.width>=n&&i.height>=r})},Je=t=>m[t].height,F=t=>t==="Invariant quality",Ze=t=>t.every(e=>!F(e));function et(t){if(F(t))throw new Error("Expected exact quality")}var tt=(t,e)=>{let r={};for(let n of Object.keys(e)){let s=e[n],i=t[n];Array.isArray(s)&&Array.isArray(i)?r[n]=i:typeof s=="object"&&typeof i=="object"?r[n]=tt(i,s):r[n]=n in t?i:s}return r};var qt=t=>{let e="";return t>=3600&&(e+=Math.floor(t/3600)+"h",t=t%3600),t>=60&&(e+=Math.floor(t/60)+"m",t=t%60),t>0&&(e+=Math.floor(t)+"s"),e};function z(t,e=0,r){let n,s,i,o,a,c,u=0,d=!1,b=!1,E=!0,S=!e&&e!==0&&typeof window.requestAnimationFrame=="function";r&&(d=!!r.leading,b="maxWait"in r,i=r?.maxWait?Math.max(+r?.maxWait||0,e):i,E="trailing"in r?!!r.trailing:E);function N(p){let T=n,x=s;return n=s=void 0,u=p,o=t.apply(x,T),o}function A(p,T){return S?(a&&window.cancelAnimationFrame(a),window.requestAnimationFrame(p)):setTimeout(p,T)}function Te(p){if(S){window.cancelAnimationFrame(p);return}clearTimeout(p)}function ve(p){return u=p,a=A(R,e),d?N(p):o}function Ie(p){let T=p-c,x=p-u,Z=e-T;return b?Math.min(Z,i-x):Z}function X(p){let T=p-c,x=p-u;return c===void 0||T>=e||T<0||b&&x>=i}function R(){let p=Date.now();if(X(p))return J(p);a=A(R,Ie(p))}function J(p){return a=void 0,E&&n?N(p):(n=s=void 0,o)}function xe(){a!==void 0&&Te(a),u=0,n=c=s=a=void 0}function he(){return a===void 0?o:J(Date.now())}function ge(){return a!==void 0}function C(...p){let T=Date.now(),x=X(T);if(n=p,s=this,c=T,x){if(a===void 0)return ve(c);if(b)return a=A(R,e),N(c)}return a===void 0&&(a=A(R,e)),o}return C.cancel=xe,C.flush=he,C.pending=ge,C}var j=(t,e=0,r)=>z(t,e,{...{leading:!0,trailing:!0},...r,maxWait:e});var L=(t,e)=>{if(t===null||typeof t!="object")return t;let r=Array.isArray(t)?[]:{};for(let n in t){if(typeof e=="function"){let s=e(t[n],n,t,r);if(s!==void 0){r[n]=s;continue}}typeof t[n]=="object"?r[n]=L(t[n],e):r[n]=t[n]}return r};var rt=t=>L(t);var nt=300,ot=(t,e=nt)=>new l(r=>{let{width:n,height:s}=t.getBoundingClientRect();if(r.next({width:n,height:s}),!window.ResizeObserver)return;let i=new ResizeObserver(j(o=>{let a=o[0];if(!a)return;let c,u;a.contentBoxSize&&a.contentBoxSize[0]?(u=a.contentBoxSize[0].blockSize,c=a.contentBoxSize[0].inlineSize):a.contentRect&&(c=a.contentRect.width,u=a.contentRect.height),y(c)&&y(u)&&r.next({width:c,height:u})},e));return i.observe(t),()=>i.disconnect()});var P=class extends I{constructor(r){super();this.value=r}next(r){super.next(this.value=r)}error(r){super.error(this.value=r)}getValue(){return this.value}_subscribe(r){let n=super._subscribe(r);return r.next(this.value),n}};function oe(t){return new l(e=>{let r={},n=Object.keys(t).length,s=i=>o=>{i in r||n--,r[i]=o,n===0&&e.next(r)};return Object.entries(t).reduce((i,[o,a])=>i.add(a.subscribe(s(o))),new f)})}function ie(...t){return new l(e=>t.reduce((r,n)=>r.add(n.subscribe(e)),new f))}var it=t=>new l(e=>{let r=window.setTimeout(()=>{try{e.next()}catch(n){if(e.error)e.error(n);else throw n}},t);return()=>window.clearTimeout(r)});var st=t=>new l(e=>{let r=window.setInterval(()=>e.next(),t);return()=>{r&&(window.clearInterval(r),r=void 0)}});var at=t=>new l(e=>{t.forEach(r=>e.next(r))});var lt=(t,e)=>new l(r=>{let n=s=>r.next(s);return t.addEventListener(e,n),()=>t.removeEventListener(e,n)});function se(t){return e=>new l(r=>e.subscribe(new B(r,t)))}var B=class{constructor(e,r){this.destination=e;this.size=r;this.lastValues=[]}next(e){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(e),this.destination.next(this.lastValues)}error(e){this.destination.error?.(e)}};var ut={leading:!1,trailing:!0};function ae(t,e=ut){return r=>new l(n=>r.subscribe(new W(n,t,e)))}var W=class{constructor(e,r,n){this.destination=e;this.time=r;this.config=n}next(e){this.lastValue=e,y(this.timeout)?window.clearTimeout(this.timeout):this.config.leading&&this.destination.next(e),this.timeout=window.setTimeout(()=>{if(this.config.trailing)try{this.destination.next(this.lastValue)}catch(r){if(this.destination.error)this.destination.error(r);else throw r}this.timeout=void 0},this.time)}error(e){this.destination.error?.(e)}};var ct={leading:!0,trailing:!1};function le(t,e=ct){return r=>new l(n=>r.subscribe(new G(n,t,e)))}var G=class{constructor(e,r,n){this.destination=e;this.time=r;this.config=n}next(e){this.lastValue=e,Q(this.timeout)&&(this.config.leading&&this.destination.next(e),this.timeout=window.setTimeout(()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0},this.time))}error(e){this.destination.error?.(e)}};function ue(t){return e=>new l(r=>e.subscribe(new q(r,t)))}var q=class{constructor(e,r){this.destination=e;this.predicate=r}next(e){let r;try{r=this.predicate(e)}catch(n){throw this.error(n),n}r&&this.destination.next(e)}error(e){this.destination.error?.(e)}};function pe(t=(e,r)=>e===r){return e=>new l(r=>e.subscribe(new H(r,t)))}var ce={},H=class{constructor(e,r){this.destination=e;this.predicate=r;this.lastValue=ce}next(e){let r;try{r=this.lastValue===ce||!this.predicate(this.lastValue,e),this.lastValue=e}catch(n){throw this.error(n),n}r&&this.destination.next(e)}error(e){this.destination.error?.(e)}};function M(t){return e=>new l(r=>e.subscribe(new K(r,t)))}var K=class{constructor(e,r){this.destination=e;this.mapper=r}next(e){let r;try{r=this.mapper(e)}catch(n){throw this.error(n),n}this.destination.next(r)}error(e){this.destination.error?.(e)}};function be(t){return M(()=>t)}function de(){return t=>new l(e=>{let r=!1,n=!1,s=t.subscribe(i=>{r||(r=!0,e.next(i)),n&&s.unsubscribe()},i=>{r=!0,e.error?.(i),n&&s.unsubscribe()});return n=!0,r&&s.unsubscribe(),s})}function fe(){return t=>new l(e=>t.subscribe(new $(e)))}var $=class{constructor(e){this.destination=e;this.hasLast=!1}next(e){let r=this.last;if(this.last=e,!this.hasLast){this.hasLast=!0;return}this.destination.next([r,e])}error(e){this.destination.error?.(e)}};function me(t){return e=>new l(r=>e.subscribe(new Y(r,t)))}var Y=class{constructor(e,r){this.destination=e;this.effect=r}next(e){try{this.effect(e)}catch(r){throw this.error(r),r}this.destination.next(e)}error(e){this.destination.error?.(e)}};var pt=(a=>(a.NETWORK="network",a.VIDEO_PIPELINE="video_pipeline",a.EXTERNAL_API="external_api",a.PARSER="parser",a.DOM="dom",a.WTF="wtf",a.FATAL="fatal",a))(pt||{});var bt=(b=>(b.Armenian="58",b.Azerbaijani="57",b.Belarusian="114",b.English="3",b.Kazakh="97",b.Portuguese="73",b.Russian="0",b.Spanish="4",b.Ukrainian="1",b.Uzbek="65",b.Vietnamese="75",b))(bt||{}),dt="vk.com",Vn=async(t,e,r)=>{let n=new URL(`https://${dt}/js/lang-pack.js`);n.searchParams.set("format","json"),n.searchParams.set("name",e),t!==void 0&&n.searchParams.set("lang",t);let i=await(await fetch(n.toString())).json();return ft(i,r)},ft=(t,e)=>Object.fromEntries(Object.entries(t.keys).map(([r,n])=>[r.substring(`${e}_`.length),mt(n)])),mt=t=>Array.isArray(t)?t[0]:t;var Tt=(r=>(r.RU="ru",r.EN="en",r))(Tt||{});export{ee as CurrentClientBrowser,te as CurrentClientDevice,pt as ErrorCategory,Tt as InterfaceLanguage,V as Logger,l as Observable,I as Subject,f as Subscription,we as VERSION,bt as VKNumericLanguage,P as ValueSubject,D as VideoQuality,Pe as abortable,ke as addScript,Ze as areQualitiesExact,Ce as assertEmptyArray,v as assertNever,Se as assertNonNullable,Re as assertNotEmptyArray,Ae as assertNullable,et as assertQualityIsExact,se as buffer,Ee as checkNever,rt as cloneDeep,L as cloneDeepWith,oe as combine,ae as debounce,z as debounceFn,Ge as detectEmbed,tt as fillWithDefault,ue as filter,pe as filterChanged,lt as fromEvent,k as getCurrentBrowser,De as getExponentialDelay,$e as getHighestQuality,Ne as getIOSVersion,st as interval,Ve as isAndroid,qe as isHigher,He as isHigherOrEqual,Me as isIOS,F as isInvariantQuality,U as isLower,Ke as isLowerOrEqual,Qe as isMacLike,_e as isMobile,y as isNonNullable,Q as isNullable,Vn as loadVKLangPack,M as map,be as mapTo,ie as merge,h as noop,Le as now,at as observableFrom,ot as observeElementSize,de as once,fe as pairwise,re as safeStorage,me as tap,le as throttle,j as throttleFn,qt as timeCodeToString,it as timeout,Ye as videoHeightToQuality,Je as videoQualityToHeight,Xe as videoSizeToQuality};
package/package.json CHANGED
@@ -1,39 +1,39 @@
1
1
  {
2
2
  "name": "@vkontakte/videoplayer-shared",
3
- "version": "1.0.36",
3
+ "version": "1.0.37-dev.0bef53b3.0",
4
4
  "author": "vk.com",
5
5
  "description": "Shared code for vk.com videoplayer",
6
6
  "homepage": "https://vk.com",
7
7
  "license": "GPL-3.0",
8
8
  "main": "./esnext.cjs.js",
9
9
  "module": "./esnext.esm.js",
10
- "types": "./index.d.ts",
10
+ "types": "./types/index.d.ts",
11
11
  "type": "module",
12
12
  "exports": {
13
13
  ".": {
14
14
  "import": "./esnext.esm.js",
15
15
  "require": "./esnext.cjs.js",
16
- "types": "./index.d.ts"
16
+ "types": "./types/index.d.ts"
17
17
  },
18
18
  "./evergreen": {
19
19
  "import": "./evergreen.esm.js",
20
20
  "require": "./evergreen.cjs.js",
21
- "types": "./index.d.ts"
21
+ "types": "./types/index.d.ts"
22
22
  },
23
23
  "./esnext": {
24
24
  "import": "./esnext.esm.js",
25
25
  "require": "./esnext.cjs.js",
26
- "types": "./index.d.ts"
26
+ "types": "./types/index.d.ts"
27
27
  },
28
28
  "./es2018": {
29
29
  "import": "./es2018.esm.js",
30
30
  "require": "./es2018.cjs.js",
31
- "types": "./index.d.ts"
31
+ "types": "./types/index.d.ts"
32
32
  },
33
33
  "./es2015": {
34
34
  "import": "./es2015.esm.js",
35
35
  "require": "./es2015.cjs.js",
36
- "types": "./index.d.ts"
36
+ "types": "./types/index.d.ts"
37
37
  },
38
38
  "./evergreen.esm.js": "./evergeen.esm.js",
39
39
  "./esnext.esm.js": "./esnext.esm.js",
@@ -0,0 +1,10 @@
1
+ import Subject from '../reactive/Subject';
2
+ import type { ILogger, ILogInputEntry, IComponentLogger, ILogEntry } from './types';
3
+ export declare class Logger implements ILogger {
4
+ log$: Subject<ILogEntry>;
5
+ private logs;
6
+ log: (inputEntry: ILogInputEntry) => void;
7
+ createCustomLog<TArgs extends unknown[]>(transform: (...args: TArgs) => ILogInputEntry): (...args: TArgs) => void;
8
+ createComponentLog(component: string): IComponentLogger;
9
+ getAllLogs: () => ILogEntry[];
10
+ }
@@ -0,0 +1,2 @@
1
+ export { Logger } from './Logger';
2
+ export type { ILogger, ILogInputEntry, IComponentLogEntry, IComponentLogger, ILogEntry } from './types';
@@ -0,0 +1,30 @@
1
+ import type { IObservable } from '../reactive/types';
2
+ export interface ILogger {
3
+ log: (entry: ILogInputEntry) => void;
4
+ createCustomLog: <TArgs extends unknown[]>(transform: (...args: TArgs) => ILogInputEntry) => (...args: TArgs) => void;
5
+ createComponentLog: (component: string) => IComponentLogger;
6
+ getAllLogs: () => ILogEntry[];
7
+ log$: IObservable<ILogEntry>;
8
+ }
9
+ export interface ILogEntry {
10
+ /**
11
+ * Сообщение.
12
+ */
13
+ message: string;
14
+ /**
15
+ * Компонент, в котором залогировано событие. (модуль, класс или функция)
16
+ */
17
+ component: string;
18
+ /**
19
+ * Время, в которое случилось логируемое событие
20
+ */
21
+ timestamp: number;
22
+ }
23
+ export type IComponentLogger = (entry: IComponentLogEntry) => void;
24
+ export type ILogInputEntry = Omit<ILogEntry, 'timestamp'>;
25
+ export interface IComponentLogEntry extends Omit<ILogInputEntry, 'component'>, IOptionalComponent {
26
+ }
27
+ interface IOptionalComponent {
28
+ component?: ILogInputEntry['component'];
29
+ }
30
+ export {};
package/types/env.d.ts ADDED
@@ -0,0 +1 @@
1
+ export declare const VERSION: string;
@@ -0,0 +1,6 @@
1
+ export { VERSION } from './env';
2
+ export * from './Logger';
3
+ export * from './utils';
4
+ export * from './reactive';
5
+ export * from './types';
6
+ export * from './translation';
@@ -0,0 +1,7 @@
1
+ import type { IEmitter, IListener, IObservable, IOperator, ISubscription, IUnsubscriber } from './types';
2
+ export default class Observable<T> implements IObservable<T> {
3
+ constructor(subscribe?: (emitter: IEmitter<T>) => IUnsubscriber | ISubscription | void);
4
+ subscribe(listener: IListener<T>, error?: IListener<Error | unknown>): ISubscription;
5
+ pipe(...operators: IOperator<unknown, unknown>[]): IObservable<unknown>;
6
+ protected _subscribe(_emitter: IEmitter<T>): IUnsubscriber | ISubscription | void;
7
+ }
@@ -0,0 +1,10 @@
1
+ import type { IEmitter, ISubject, ISubscription, IUnsubscriber } from './types';
2
+ import Observable from './Observable';
3
+ export default class Subject<T> extends Observable<T> implements ISubject<T> {
4
+ private keyCounter;
5
+ private subscribers;
6
+ constructor();
7
+ next(value: T): void;
8
+ error(value: T): void;
9
+ protected _subscribe(emitter: IEmitter<T>): IUnsubscriber | ISubscription | void;
10
+ }
@@ -0,0 +1,6 @@
1
+ import type { ISubscription, IUnsubscriber } from './types';
2
+ export default class Subscription implements ISubscription {
3
+ private subscriptions;
4
+ unsubscribe(): void;
5
+ add(item: ISubscription | IUnsubscriber): ISubscription;
6
+ }
@@ -0,0 +1,10 @@
1
+ import type { IEmitter, ISubscription, IUnsubscriber, IValueSubject } from './types';
2
+ import Subject from './Subject';
3
+ export default class ValueSubject<T> extends Subject<T> implements IValueSubject<T> {
4
+ private value;
5
+ constructor(initialValue: T);
6
+ next(value: T): void;
7
+ error(value: T): void;
8
+ getValue(): T;
9
+ protected _subscribe(emitter: IEmitter<T>): IUnsubscriber | ISubscription | void;
10
+ }
@@ -0,0 +1,10 @@
1
+ import type { IObservable, TypeOfObservable } from './types';
2
+ /**
3
+ * Создаёт Observable, который состоит из объектов, ключами которых являются последние значения исходных Observable.
4
+ * Первое событие возникает тогда, когда каждый исходный Observable выдал хотя бы одно значение.
5
+ */
6
+ type CombineObservables<T extends Record<string, IObservable<unknown>>> = {
7
+ [key in keyof T]: TypeOfObservable<T[key]>;
8
+ };
9
+ export default function combine<T extends Record<string, IObservable<unknown>>>(observables: T): IObservable<CombineObservables<T>>;
10
+ export {};
@@ -0,0 +1,7 @@
1
+ import type { IObservable } from './types';
2
+ interface IEventTarget {
3
+ addEventListener(type: string, handler: (...params: any[]) => void): void;
4
+ removeEventListener(type: string, handler: (...params: any[]) => void): void;
5
+ }
6
+ declare const _default: <T>(target: IEventTarget, eventName: string) => IObservable<T>;
7
+ export default _default;