@vkontakte/videoplayer-shared 1.0.80-dev.ea826f67.0 → 1.0.80-dev.fbdd1f70.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/evergreen.esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
- * @vkontakte/videoplayer-shared v1.0.80-dev.ea826f67.0
3
- * Thu, 29 Jan 2026 11:03:13 GMT
2
+ * @vkontakte/videoplayer-shared v1.0.80-dev.fbdd1f70.0
3
+ * Tue, 03 Feb 2026 15:07:04 GMT
4
4
  * https://st.mycdn.me/static/vkontakte-videoplayer/1-0-80/doc/
5
5
  */
6
- var _e=Object.defineProperty;var ue=(t,e)=>{for(var r in e)_e(t,r,{get:e[r],enumerable:!0})};var De="1.0.80-dev.ea826f67.0";var d=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 g=t=>{throw new Error(`${t} is value of unexpected type`)},Ue=t=>{};var w=()=>{};var je=t=>{throw console.error(t),t},We=t=>{console.error(t)},c=class{constructor(e){this.suppressErrors=!1;e&&(this._subscribe=e)}setSuppressErrors(e){this.suppressErrors=e}subscribe(e,r){let n=this.suppressErrors?We:je,o;r?typeof r=="function"?o={next:r,error:w}:o={next:a=>r.next(a),error:a=>r.error?.(a)}:o={next:n,error:w};let s=typeof e=="function"?{next:a=>{try{let l=e(a);l instanceof Promise&&l.catch(b=>o.next(b))}catch(l){o.next(l)}},error:a=>o.next(a)}:{next:a=>e.next(a),error:a=>e.error?e.error(a):o.next(a)},i;try{i=this._subscribe(s)}catch(a){s.error?.(a)}return new d().add(()=>{switch(s.next=w,s.error=w,typeof i){case"function":i();return;case"object":i.unsubscribe();return;case"undefined":return;default:return g(i)}})}pipe(...e){return e.reduce((r,n)=>n(r),this)}_subscribe(e){}};var I=class extends c{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 d().add(()=>this.subscribers.delete(n))}};var G=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 ze(t,e='Assertion "value is not nullable" failed'){if(t==null)throw new Error(e)}function Fe(t,e='Assertion "value is nullable" failed'){if(t!=null)throw new Error(e)}function O(t){return typeof t<"u"&&t!==null}function k(t){return t==null}var Ge=t=>Object.fromEntries(Object.entries(t).filter(([e,r])=>O(r)));function Be(t,e){if(!t?.length)throw new Error(e)}function Ke(t,e){if(t?.length)throw new Error(e)}var m=()=>globalThis,me=(t=m())=>!!(t.window&&t.screen);var He=(t,e,r)=>new Promise((n,o)=>{e.addEventListener("abort",()=>{a(),b.remove()});let s=()=>{a(),o("error")},i=()=>{a(),n()},a=()=>{l&&clearTimeout(l),b.removeEventListener("load",i),b.removeEventListener("error",s)},l;r&&(l=m().setTimeout(()=>{a(),o("timeout")},r));let b=document.createElement("script");b.addEventListener("load",i),b.addEventListener("error",s),b.src=t,document.head.appendChild(b)});var qe=typeof m().performance?.now=="function"?()=>m().performance.now():()=>Date.now();var $e=(t,e)=>async(...r)=>{let n=e(...r),o=t.aborted,s;for(;!o&&!t.aborted;)try{let i=await n.next(s);o=i.done??!1,s=i.value}catch(i){await n.throw(i)}return s};var Xe=(t,{start:e=0,factor:r=2,max:n=1/0,min:o=e,random:s=0}={})=>{let i=e;return i*=r**t,i*=1+(Math.random()*s*2-s),i=Math.round(i),i=Math.min(i,n),i=Math.max(i,o),i};var be={};ue(be,{clear:()=>rt,get:()=>Je,has:()=>et,isPersistent:()=>Ye,remove:()=>tt,set:()=>Ze});var S,E,B=`vk-videoplayer-dummy-key-${Math.random()}`,A=()=>{if(E!==void 0)return E;try{localStorage.setItem(B,"test"),localStorage.removeItem(B),E=0}catch(t){if(t instanceof DOMException||t instanceof TypeError)try{sessionStorage.getItem(B),E=1}catch(e){if(e instanceof DOMException||e instanceof TypeError)E=2;else throw e}else throw t}return E===2&&(S=new Map),E},Ye=()=>A()===0,Je=t=>{let e=A();switch(e){case 0:return localStorage.getItem(t)??void 0;case 1:return sessionStorage.getItem(t)??void 0;case 2:return S?.get(t);default:g(e)}},Ze=(t,e)=>{let r=A();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:S?.set(t,e);return;default:g(r)}},et=t=>{let e=A();switch(e){case 0:return t in localStorage;case 1:return t in sessionStorage;case 2:return S?.has(t)??!1;default:return g(e),!1}},tt=t=>{let e=A();switch(e){case 0:return localStorage.removeItem(t);case 1:return sessionStorage.removeItem(t);case 2:S?.delete(t);return;default:g(e)}},rt=()=>{let t=A();switch(t){case 0:return localStorage.clear();case 1:return sessionStorage.clear();case 2:return S?.clear();default:g(t)}};var nt=()=>{let t,e=[],r=m();try{t=r.self!==r.top}catch(n){n instanceof DOMException&&n.name==="SecurityError"?t=!0:(t=!1,console.error(n))}try{r.location.ancestorOrigins&&(e=[...r.location.ancestorOrigins])}catch(n){console.error(n)}try{!e.length&&r.document.referrer&&(e=[new URL(r.document.referrer).origin])}catch(n){console.error(n)}return e=e.filter(n=>URL.canParse(n)),{isEmbed:t,origins:e,topOrigin:e.at(-1),immediateOrigin:e.at(0)}};var K=(p=>(p.INVARIANT="Invariant quality",p.Q_144P="144p",p.Q_240P="240p",p.Q_360P="360p",p.Q_480P="480p",p.Q_576P="576p",p.Q_720P="720p",p.Q_1080P="1080p",p.Q_1440P="1440p",p.Q_2160P="2160p",p.Q_4320P="4320p",p))(K||{});var T={"144p":{width:256,height:144},"240p":{width:428,height:240},"360p":{width:640,height:360},"480p":{width:856,height:480},"576p":{width:1024,height:576},"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}},ot=(t,e)=>T[t].height>T[e].height,it=(t,e)=>T[t].height>=T[e].height,H=(t,e)=>T[t].height<T[e].height,st=(t,e)=>T[t].height<=T[e].height,at=t=>t.sort((e,r)=>e===r?0:e==="Invariant quality"?1:r==="Invariant quality"?-1:H(e,r)?1:-1)[0],de=Object.keys(T).sort((t,e)=>H(t,e)?-1:1),ct=(t,e=.02)=>[...de].find(n=>T[n].height*(1+e)>=t),lt=({width:t,height:e})=>{let r=Math.min(t,e),n=Math.max(t,e);return de.find(o=>{let s=T[o];return s.width>=n&&s.height>=r})},pt=t=>T[t].height,q=t=>t==="Invariant quality",ut=t=>t.every(e=>!q(e));function mt(t){if(q(t))throw new Error("Expected exact quality")}var bt=t=>{switch(t){case"4320p":return"8K";case"2160p":return"4K";case"1440p":return"QHD";case"1080p":return"FHD";case"720p":return"HD";default:return""}};var dt=(t,e)=>{let r={};for(let n of Object.keys(e)){let o=e[n],s=t[n];Array.isArray(o)&&Array.isArray(s)?r[n]=s:typeof o=="object"&&typeof s=="object"?r[n]=dt(s,o):r[n]=n in t?s:o}return r};var xr=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 $(t,e=0,r){let n,o,s,i,a,l,b=0,v=!1,p=!1,z=!0,ae=!e&&e!==0&&typeof m().requestAnimationFrame=="function";r&&(v=!!r.leading,p="maxWait"in r,s=r?.maxWait?Math.max(+r?.maxWait||0,e):s,z="trailing"in r?!!r.trailing:z);function F(u){let y=n,x=o;return n=o=void 0,b=u,i=t.apply(x,y),i}function L(u,y){return ae?(a&&m().cancelAnimationFrame(a),m().requestAnimationFrame(u)):setTimeout(u,y)}function Le(u){if(ae){m().cancelAnimationFrame(u);return}clearTimeout(u)}function Ne(u){return b=u,a=L(N,e),v?F(u):i}function Ce(u){let y=u-l,x=u-b,pe=e-y;return p?Math.min(pe,s-x):pe}function ce(u){let y=u-l,x=u-b;return l===void 0||y>=e||y<0||p&&x>=s}function N(){let u=Date.now();if(ce(u))return le(u);a=L(N,Ce(u))}function le(u){return a=void 0,z&&n?F(u):(n=o=void 0,i)}function Me(){a!==void 0&&Le(a),b=0,n=l=o=a=void 0}function Ve(){return a===void 0?i:le(Date.now())}function Qe(){return a!==void 0}function C(...u){let y=Date.now(),x=ce(y);if(n=u,o=this,l=y,x){if(a===void 0)return Ne(l);if(p)return a=L(N,e),F(l)}return a===void 0&&(a=L(N,e)),i}return C.cancel=Me,C.flush=Ve,C.pending=Qe,C}var X=(t,e=0,r)=>$(t,e,{...{leading:!0,trailing:!0},...r,maxWait:e});var M=(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 o=e(t[n],n,t,r);if(o!==void 0){r[n]=o;continue}}typeof t[n]=="object"?r[n]=M(t[n],e):r[n]=t[n]}return r};var ft=t=>M(t);var P=class extends I{constructor(r){super();this.buffer=[];this.cursorEnd=-1;this.cursorStart=0;this.bufferSize=r,this.buffer=Array(r)}next(r){this.cursorEnd+=1,this.cursorStart=this.cursorEnd>=this.bufferSize?this.cursorStart+1:0,this.buffer[this.cursorEnd%this.bufferSize]=r,this.subscribers.forEach(n=>n.next(r))}_subscribe(r){for(let o=this.cursorStart;o<=this.cursorEnd;o++)r.next(this.buffer[o%this.bufferSize]);let n=this.keyCounter++;return this.subscribers.set(n,r),new d().add(()=>this.subscribers.delete(n))}};var V=class extends I{constructor(e){super(),this.value=e}next(e){super.next(this.value=e)}error(e){super.error(this.value=e)}getValue(){return this.value}_subscribe(e){let r=super._subscribe(e);return e.next(this.value),r}};function fe(t){return new c(e=>{let r={},n=Object.keys(t).length,o=s=>i=>{s in r||n--,r[s]=i,n===0&&e.next(r)};return Object.entries(t).reduce((s,[i,a])=>s.add(a.subscribe(o(i))),new d)})}function Te(...t){return new c(e=>t.reduce((r,n)=>r.add(n.subscribe(e)),new d))}var Tt=t=>new c(e=>{let r=m().setTimeout(()=>{try{e.next()}catch(n){if(e.error)e.error(n);else throw n}},t);return()=>m().clearTimeout(r)});var yt=t=>new c(e=>{let r=m(),n=r.setInterval(()=>e.next(),t);return()=>{n&&(r.clearInterval(n),n=void 0)}});var It=t=>new c(e=>{t.forEach(r=>e.next(r))});var gt=(t,e)=>new c(r=>{let n=o=>r.next(o);return t.addEventListener(e,n),()=>t.removeEventListener(e,n)});var Q=class extends d{remove(e){this.subscriptions=this.subscriptions.filter(r=>r!==e)}};function ye(t){return e=>new c(r=>e.subscribe(new Y(r,t)))}var Y=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 ht={leading:!1,trailing:!0};function Ie(t,e=ht){return r=>new c(n=>r.subscribe(new J(n,t,e)))}var J=class{constructor(e,r,n){this.destination=e;this.time=r;this.config=n}next(e){this.lastValue=e;let r=m();O(this.timeout)?r.clearTimeout(this.timeout):this.config.leading&&this.destination.next(e),this.timeout=r.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(e){this.destination.error?.(e)}};var vt={leading:!0,trailing:!1};function ge(t,e=vt){return r=>new c(n=>r.subscribe(new Z(n,t,e)))}var Z=class{constructor(e,r,n){this.destination=e;this.time=r;this.config=n}next(e){this.lastValue=e,k(this.timeout)&&(this.config.leading&&this.destination.next(e),this.timeout=m().setTimeout(()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0},this.time))}error(e){this.destination.error?.(e)}};function he(t){return e=>new c(r=>e.subscribe(new ee(r,t)))}var ee=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)}};var xt=(t,e)=>{let r=(n,o)=>{let s=Object.keys(n);for(let i in o)if(!s.includes(i)||o[i]!==n[i])return!1;return!0};return r(t,e)&&r(e,t)},Ot=(t,e)=>t instanceof Object&&e instanceof Object?xt(t,e):t===e;function xe(t=Ot){return e=>new c(r=>e.subscribe(new te(r,t)))}var ve={},te=class{constructor(e,r){this.destination=e;this.predicate=r;this.lastValue=ve}next(e){let r;try{r=this.lastValue===ve||!this.predicate(this.lastValue,e),this.lastValue=e instanceof Object&&!Array.isArray(e)?{...e}:e}catch(n){throw this.error(n),n}r&&this.destination.next(e)}error(e){this.destination.error?.(e)}};function _(t){return e=>new c(r=>e.subscribe(new re(r,t)))}var re=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 Oe(t){return _(()=>t)}function Ee(){return t=>new c(e=>{let r=!1,n=!1,o=t.subscribe(s=>{r||(r=!0,e.next(s)),n&&o.unsubscribe()},s=>{r=!0,e.error?.(s),n&&o.unsubscribe()});return n=!0,r&&o.unsubscribe(),o})}function we(){return t=>new c(e=>t.subscribe(new ne(e)))}var ne=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 Se(t){return e=>new c(r=>e.subscribe(new oe(r,t)))}var oe=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)}};function Ae(t){return e=>new c(r=>e.subscribe(new ie(r,t)))}var ie=class{constructor(e,r){this.destination=e;this.count=r;r<0&&this.destination.error?.(new Error("Count can not be less than zero"))}next(e){this.count===0?this.destination.next(e):this.count--}error(e){this.destination.error?.(e)}};function Pe(t=0){return e=>{let r=0,n=new P(t),o=e.subscribe(n),s=i=>()=>{i.unsubscribe(),r--,r===0&&o.unsubscribe()};return new c(i=>(r++,s(n.subscribe(i))))}}var Et=300,wt=(t,e=Et)=>new c(r=>{let n=m(),{width:o,height:s}=t.getBoundingClientRect();if(r.next({width:o,height:s}),!me(n))return;let i=new n.ResizeObserver(X(a=>{let l=a[0];if(!l)return;let b,v;l.contentBoxSize&&l.contentBoxSize[0]?(v=l.contentBoxSize[0].blockSize,b=l.contentBoxSize[0].inlineSize):l.contentRect&&(b=l.contentRect.width,v=l.contentRect.height),O(b)&&O(v)&&r.next({width:b,height:v})},e));return i.observe(t),()=>i.disconnect()});var D=(t,e=6,r=".")=>{let n={};for(let o in t)if(!(!t.hasOwnProperty(o)||t[o]instanceof HTMLElement||!e))if(typeof t[o]=="object"&&t[o]!==null){let s=D(t[o],e-1);for(let i in s)s.hasOwnProperty(i)&&(n[o+r+i]=s[i])}else n[o]=t[o];return n};var St=t=>{t.removeAttribute("src"),t.load()};var mo=t=>{let e;try{e=new URL(t)}catch{return!1}return e.protocol==="https:"};var At=(t,e)=>!(t.right<e.left||t.left>e.right||t.bottom<e.top||t.top>e.bottom);var Pt=(()=>{let t=0;return()=>{let e=t;return t=(t+1)%Number.MAX_SAFE_INTEGER,e}})(),kt=t=>t!==void 0&&t!==""?t:Pt().toString();function Rt(t,e,r){if(t<=e[0])return r[0];if(t>=e[e.length-1])return r[r.length-1];let n=1;for(;n<e.length&&e[n]<t;)n++;n>=e.length&&(n=e.length-1);let o=e[n-1],s=e[n],i=r[n-1],a=r[n];if(t===o)return i;if(t===s)return a;let l=(t-o)/(s-o);return i+l*(a-i)}function Lt(t,e,r){if(t<=0||r<0)return[];let n=[],o=Math.floor((t-1)/2),s=Math.floor(t/2),i=e-o,a=e+s;i<0&&(a+=Math.abs(i),i=0),a>r&&(i-=a-r,a=r),i=Math.max(0,i),a=Math.min(r,a);for(let l=i;l<=a;l++)n.push(l);return n}var Nt=t=>e=>r=>{let n=typeof r=="object";r==null||n&&!Object.keys(r).length||t(e,n?D(r):{value:r})},U=(t={})=>{let e=n=>{let o=n;return n===void 0?o="undefined":n===null?o="null":(typeof n=="number"||typeof n=="boolean")&&(o=n.toString()),o},r={};for(let n in t)Array.isArray(t[n])?r[n]=t[n].map(e):r[n]=e(t[n]);return r};var h=class t{constructor({name:e,getParentContext:r}){this.dynamicImportTimeout=5e3;this.childTracers=[];t.dynamicImportStatus==="not_started"&&(t.dynamicImportPromise=this.loadOpentelemetry());let n=Date.now();this.initPromise=t.dynamicImportPromise.then(o=>{t.dynamicImportStatus==="completed"&&this.init({name:e,getParentContext:r},n)})}static{this.dynamicImportStatus="not_started"}init({name:e,getParentContext:r},n){this.span=t.rootTracer.startSpan(e,{startTime:n},r?.()),this.context=t.dynamicImports.opentelemetryApi.trace.setSpan(t.dynamicImports.opentelemetryApi.context.active(),this.span)}async loadOpentelemetry(){if(t.dynamicImportStatus==="not_started"){t.dynamicImportStatus="in_progress";try{let e=new Promise((i,a)=>setTimeout(a,this.dynamicImportTimeout)),r=Promise.all([import("@opentelemetry/api"),import("@opentelemetry/sdk-trace-web"),import("@apptracer/opentelemetry")]),[n,o,s]=await Promise.race([r,e]);t.dynamicImports={opentelemetryApi:n,opentelemetrySdk:o,tracer:s},t.dynamicImportStatus="completed"}catch{t.dynamicImportStatus="failed"}}}isComponentTracerNotInitialized(){return k(this.span)||t.dynamicImportStatus==="failed"}log(e,r){let n=Date.now();this.initPromise.then(o=>{this.isComponentTracerNotInitialized()||this.span.addEvent(e,{...U(r),type:"log"},n)})}error(e,r){let n=Date.now();this.initPromise.then(o=>{this.isComponentTracerNotInitialized()||this.span.addEvent(e,{...U(r),type:"error"},n)})}critical(e,r){let n=Date.now();this.initPromise.then(o=>{this.isComponentTracerNotInitialized()||this.span.addEvent(e,{...U(r),type:"critical"},n)})}createComponentTracer(e){let r=new t({name:e,getParentContext:()=>this.context});return this.childTracers.push(r),r}end(){this.initPromise.then(e=>{this.isComponentTracerNotInitialized()||(this.childTracers.forEach(r=>r.end()),this.span.end())})}};var j=class extends h{constructor(){super({name:"Root"})}init({name:e,getParentContext:r},n){let s=h.dynamicImports.tracer.initTracerOpenTelemetry({serviceName:"videoplayer-sdk-web",appToken:"L9SBoka6ZWk4xPjaK7tmfSfYvMhcge7nvGDjpdMmscb",spanLimits:{attributeCountLimit:1/0,eventCountLimit:1/0,attributePerEventCountLimit:1/0}}).getProvider(),i=new h.dynamicImports.tracer.TracerMemorySpanExporter;this.spanExporter=i,s.addSpanProcessor(new h.dynamicImports.tracer.TracerAllSpansProcessor({startedSpansExporter:i})),h.rootTracer=s.getTracer("sdk-videoplayer-tracer"),super.init({name:e,getParentContext:r},n)}getFinishedSpans(){if(!this.isComponentTracerNotInitialized())return this.spanExporter?.getJsonData()}getTraceId(){return this.isComponentTracerNotInitialized()?"":this.span.spanContext().traceId}};var W=class t{constructor(e){}log(e,r){}error(e,r){}critical(e,r){}createComponentTracer(e){return new t({name:e})}end(){}getFinishedSpans(){}getTraceId(){return this.fakeTraceId}};var se=class{static createRootTracer(e=!1){return e?new j:new W}};var Ct=(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))(Ct||{});var Mt=(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))(Mt||{}),Vt="vk.com",Si=async(t,e,r)=>{let n=new URL(`https://${Vt}/js/lang-pack.js`);n.searchParams.set("format","json"),n.searchParams.set("name",e),t!==void 0&&n.searchParams.set("lang",t);let s=await(await fetch(n.toString())).json();return Qt(s,r)},Qt=(t,e)=>Object.fromEntries(Object.entries(t.keys).map(([r,n])=>[r.substring(`${e}_`.length),_t(n)])),_t=t=>Array.isArray(t)?t[0]:t;var Dt=(r=>(r.RU="ru",r.EN="en",r))(Dt||{});var f="__vk_vp_internals_exposure",ke=class{constructor(e,r){this.playerId=r,this.type=e,this.initWindowObjects()}getWindowObject(){if(typeof window>"u")return{};let e=this.playerId,r=this.type;return window[f]?.[e]?.[r]??{}}initWindowObjects(){if(typeof window>"u")return;let e=this.playerId,r=this.type;window[f]||(window[f]={}),window[f][e]||(window[f][e]={}),window[f][e][r]||(window[f][e][r]={})}expose(e){typeof window>"u"||Object.assign(this.getWindowObject(),e)}destroy(){if(typeof window>"u")return;let e=this.playerId,r=this.type;window[f]&&window[f][e]&&window[f][e][r]&&(delete window[f][e][r],Object.keys(window[f][e]).length||delete window[f][e],Object.keys(window[f]).length||delete window[f])}};var Re={};ue(Re,{create:()=>Ut,destroy:()=>jt,push:()=>Wt,subscribe:()=>zt});var R=new Map,Ut=(t,e)=>R.set(t,e??[]),jt=t=>R.delete(t),Wt=(t,e)=>{let r=R.get(t);r&&(typeof r=="function"?r(e):r.push(e))},zt=(t,e)=>{let r=R.get(t);if(r){if(r&&Array.isArray(r))for(let n of r)e(n);R.set(t,e)}};export{Ct as ErrorCategory,f as INTERNAL_EXPOSE_GLOBAL_KEY,Dt as InterfaceLanguage,ke as InternalsExposure,G as Logger,c as Observable,P as ReplaySubject,I as Subject,d as Subscription,Q as SubscriptionRemovable,se as TracerFactory,De as VERSION,Mt as VKNumericLanguage,V as ValueSubject,K as VideoQuality,$e as abortable,He as addScript,ut as areQualitiesExact,Ke as assertEmptyArray,g as assertNever,ze as assertNonNullable,Be as assertNotEmptyArray,Fe as assertNullable,mt as assertQualityIsExact,ye as buffer,Ue as checkNever,St as clearVideoElement,ft as cloneDeep,M as cloneDeepWith,fe as combine,Ie as debounce,$ as debounceFn,nt as detectEmbed,Re as devNull,dt as fillWithDefault,he as filter,xe as filterChanged,D as flattenObject,gt as fromEvent,Xe as getExponentialDelay,at as getHighestQuality,kt as getPlayerId,Lt as getRangeAroundIndex,Nt as getTraceSubscriptionMethod,bt as getVideoQualityLabel,m as getWindow,Rt as interpolate,yt as interval,me as isBrowserWindow,ot as isHigher,it as isHigherOrEqual,At as isIntersecting,q as isInvariantQuality,H as isLower,st as isLowerOrEqual,O as isNonNullable,k as isNullable,mo as isValidURL,Si as loadVKLangPack,_ as map,Oe as mapTo,Te as merge,w as noop,qe as now,It as observableFrom,wt as observeElementSize,Ee as once,we as pairwise,be as safeStorage,Pe as shareReplay,Ae as skip,Se as tap,ge as throttle,X as throttleFn,xr as timeCodeToString,Tt as timeout,ct as videoHeightToQuality,pt as videoQualityToHeight,lt as videoSizeToQuality,Ge as withoutNullable};
6
+ var _e=Object.defineProperty;var ue=(t,e)=>{for(var r in e)_e(t,r,{get:e[r],enumerable:!0})};var De="1.0.80-dev.fbdd1f70.0";var d=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 g=t=>{throw new Error(`${t} is value of unexpected type`)},Ue=t=>{};var w=()=>{};var je=t=>{throw console.error(t),t},We=t=>{console.error(t)},c=class{constructor(e){this.suppressErrors=!1;e&&(this._subscribe=e)}setSuppressErrors(e){this.suppressErrors=e}subscribe(e,r){let n=this.suppressErrors?We:je,o;r?typeof r=="function"?o={next:r,error:w}:o={next:a=>r.next(a),error:a=>r.error?.(a)}:o={next:n,error:w};let s=typeof e=="function"?{next:a=>{try{let l=e(a);l instanceof Promise&&l.catch(b=>o.next(b))}catch(l){o.next(l)}},error:a=>o.next(a)}:{next:a=>e.next(a),error:a=>e.error?e.error(a):o.next(a)},i;try{i=this._subscribe(s)}catch(a){s.error?.(a)}return new d().add(()=>{switch(s.next=w,s.error=w,typeof i){case"function":i();return;case"object":i.unsubscribe();return;case"undefined":return;default:return g(i)}})}pipe(...e){return e.reduce((r,n)=>n(r),this)}_subscribe(e){}};var I=class extends c{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 d().add(()=>this.subscribers.delete(n))}};var G=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 ze(t,e='Assertion "value is not nullable" failed'){if(t==null)throw new Error(e)}function Fe(t,e='Assertion "value is nullable" failed'){if(t!=null)throw new Error(e)}function O(t){return typeof t<"u"&&t!==null}function k(t){return t==null}var Ge=t=>Object.fromEntries(Object.entries(t).filter(([e,r])=>O(r)));function Be(t,e){if(!t?.length)throw new Error(e)}function Ke(t,e){if(t?.length)throw new Error(e)}var m=()=>globalThis,me=(t=m())=>!!(t.window&&t.screen);var He=(t,e,r)=>new Promise((n,o)=>{e.addEventListener("abort",()=>{a(),b.remove()});let s=()=>{a(),o("error")},i=()=>{a(),n()},a=()=>{l&&clearTimeout(l),b.removeEventListener("load",i),b.removeEventListener("error",s)},l;r&&(l=m().setTimeout(()=>{a(),o("timeout")},r));let b=document.createElement("script");b.addEventListener("load",i),b.addEventListener("error",s),b.src=t,document.head.appendChild(b)});var qe=typeof m().performance?.now=="function"?()=>m().performance.now():()=>Date.now();var $e=(t,e)=>async(...r)=>{let n=e(...r),o=t.aborted,s;for(;!o&&!t.aborted;)try{let i=await n.next(s);o=i.done??!1,s=i.value}catch(i){await n.throw(i)}return s};var Xe=(t,{start:e=0,factor:r=2,max:n=1/0,min:o=e,random:s=0}={})=>{let i=e;return i*=r**t,i*=1+(Math.random()*s*2-s),i=Math.round(i),i=Math.min(i,n),i=Math.max(i,o),i};var be={};ue(be,{clear:()=>rt,get:()=>Je,has:()=>et,isPersistent:()=>Ye,remove:()=>tt,set:()=>Ze});var S,E,B=`vk-videoplayer-dummy-key-${Math.random()}`,A=()=>{if(E!==void 0)return E;try{localStorage.setItem(B,"test"),localStorage.removeItem(B),E=0}catch(t){if(t instanceof DOMException||t instanceof TypeError)try{sessionStorage.getItem(B),E=1}catch(e){if(e instanceof DOMException||e instanceof TypeError)E=2;else throw e}else throw t}return E===2&&(S=new Map),E},Ye=()=>A()===0,Je=t=>{let e=A();switch(e){case 0:return localStorage.getItem(t)??void 0;case 1:return sessionStorage.getItem(t)??void 0;case 2:return S?.get(t);default:g(e)}},Ze=(t,e)=>{let r=A();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:S?.set(t,e);return;default:g(r)}},et=t=>{let e=A();switch(e){case 0:return t in localStorage;case 1:return t in sessionStorage;case 2:return S?.has(t)??!1;default:return g(e),!1}},tt=t=>{let e=A();switch(e){case 0:return localStorage.removeItem(t);case 1:return sessionStorage.removeItem(t);case 2:S?.delete(t);return;default:g(e)}},rt=()=>{let t=A();switch(t){case 0:return localStorage.clear();case 1:return sessionStorage.clear();case 2:return S?.clear();default:g(t)}};var nt=()=>{let t,e=[],r=m();try{t=r.self!==r.top}catch(n){n instanceof DOMException&&n.name==="SecurityError"?t=!0:(t=!1,console.error(n))}try{r.location.ancestorOrigins&&(e=[...r.location.ancestorOrigins])}catch(n){console.error(n)}try{!e.length&&r.document.referrer&&(e=[new URL(r.document.referrer).origin])}catch(n){console.error(n)}return e=e.filter(n=>URL.canParse(n)),{isEmbed:t,origins:e,topOrigin:e.at(-1),immediateOrigin:e.at(0)}};var K=(p=>(p.INVARIANT="Invariant quality",p.Q_144P="144p",p.Q_240P="240p",p.Q_360P="360p",p.Q_480P="480p",p.Q_576P="576p",p.Q_720P="720p",p.Q_1080P="1080p",p.Q_1440P="1440p",p.Q_2160P="2160p",p.Q_4320P="4320p",p))(K||{});var T={"144p":{width:256,height:144},"240p":{width:428,height:240},"360p":{width:640,height:360},"480p":{width:856,height:480},"576p":{width:1024,height:576},"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}},ot=(t,e)=>T[t].height>T[e].height,it=(t,e)=>T[t].height>=T[e].height,H=(t,e)=>T[t].height<T[e].height,st=(t,e)=>T[t].height<=T[e].height,at=t=>t.sort((e,r)=>e===r?0:e==="Invariant quality"?1:r==="Invariant quality"?-1:H(e,r)?1:-1)[0],de=Object.keys(T).sort((t,e)=>H(t,e)?-1:1),ct=(t,e=.02)=>[...de].find(n=>T[n].height*(1+e)>=t),lt=({width:t,height:e})=>{let r=Math.min(t,e),n=Math.max(t,e);return de.find(o=>{let s=T[o];return s.width>=n&&s.height>=r})},pt=t=>T[t].height,q=t=>t==="Invariant quality",ut=t=>t.every(e=>!q(e));function mt(t){if(q(t))throw new Error("Expected exact quality")}var bt=t=>{switch(t){case"4320p":return"8K";case"2160p":return"4K";case"1440p":return"QHD";case"1080p":return"FHD";case"720p":return"HD";default:return""}};var dt=(t,e)=>{let r={};for(let n of Object.keys(e)){let o=e[n],s=t[n];Array.isArray(o)&&Array.isArray(s)?r[n]=s:typeof o=="object"&&typeof s=="object"?r[n]=dt(s,o):r[n]=n in t?s:o}return r};var xr=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 $(t,e=0,r){let n,o,s,i,a,l,b=0,v=!1,p=!1,z=!0,ae=!e&&e!==0&&typeof m().requestAnimationFrame=="function";r&&(v=!!r.leading,p="maxWait"in r,s=r?.maxWait?Math.max(+r?.maxWait||0,e):s,z="trailing"in r?!!r.trailing:z);function F(u){let y=n,x=o;return n=o=void 0,b=u,i=t.apply(x,y),i}function L(u,y){return ae?(a&&m().cancelAnimationFrame(a),m().requestAnimationFrame(u)):setTimeout(u,y)}function Le(u){if(ae){m().cancelAnimationFrame(u);return}clearTimeout(u)}function Ne(u){return b=u,a=L(N,e),v?F(u):i}function Ce(u){let y=u-l,x=u-b,pe=e-y;return p?Math.min(pe,s-x):pe}function ce(u){let y=u-l,x=u-b;return l===void 0||y>=e||y<0||p&&x>=s}function N(){let u=Date.now();if(ce(u))return le(u);a=L(N,Ce(u))}function le(u){return a=void 0,z&&n?F(u):(n=o=void 0,i)}function Me(){a!==void 0&&Le(a),b=0,n=l=o=a=void 0}function Ve(){return a===void 0?i:le(Date.now())}function Qe(){return a!==void 0}function C(...u){let y=Date.now(),x=ce(y);if(n=u,o=this,l=y,x){if(a===void 0)return Ne(l);if(p)return a=L(N,e),F(l)}return a===void 0&&(a=L(N,e)),i}return C.cancel=Me,C.flush=Ve,C.pending=Qe,C}var X=(t,e=0,r)=>$(t,e,{...{leading:!0,trailing:!0},...r,maxWait:e});var M=(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 o=e(t[n],n,t,r);if(o!==void 0){r[n]=o;continue}}typeof t[n]=="object"?r[n]=M(t[n],e):r[n]=t[n]}return r};var ft=t=>M(t);var P=class extends I{constructor(r){super();this.buffer=[];this.cursorEnd=-1;this.cursorStart=0;this.bufferSize=r,this.buffer=Array(r)}next(r){this.cursorEnd+=1,this.cursorStart=this.cursorEnd>=this.bufferSize?this.cursorStart+1:0,this.buffer[this.cursorEnd%this.bufferSize]=r,this.subscribers.forEach(n=>n.next(r))}_subscribe(r){for(let o=this.cursorStart;o<=this.cursorEnd;o++)r.next(this.buffer[o%this.bufferSize]);let n=this.keyCounter++;return this.subscribers.set(n,r),new d().add(()=>this.subscribers.delete(n))}};var V=class extends I{constructor(e){super(),this.value=e}next(e){super.next(this.value=e)}error(e){super.error(this.value=e)}getValue(){return this.value}_subscribe(e){let r=super._subscribe(e);return e.next(this.value),r}};function fe(t){return new c(e=>{let r={},n=Object.keys(t).length,o=s=>i=>{s in r||n--,r[s]=i,n===0&&e.next(r)};return Object.entries(t).reduce((s,[i,a])=>s.add(a.subscribe(o(i))),new d)})}function Te(...t){return new c(e=>t.reduce((r,n)=>r.add(n.subscribe(e)),new d))}var Tt=t=>new c(e=>{let r=m().setTimeout(()=>{try{e.next()}catch(n){if(e.error)e.error(n);else throw n}},t);return()=>m().clearTimeout(r)});var yt=t=>new c(e=>{let r=m(),n=r.setInterval(()=>e.next(),t);return()=>{n&&(r.clearInterval(n),n=void 0)}});var It=t=>new c(e=>{t.forEach(r=>e.next(r))});var gt=(t,e)=>new c(r=>{let n=o=>r.next(o);return t.addEventListener(e,n),()=>t.removeEventListener(e,n)});var Q=class extends d{remove(e){this.subscriptions=this.subscriptions.filter(r=>r!==e)}};function ye(t){return e=>new c(r=>e.subscribe(new Y(r,t)))}var Y=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 ht={leading:!1,trailing:!0};function Ie(t,e=ht){return r=>new c(n=>r.subscribe(new J(n,t,e)))}var J=class{constructor(e,r,n){this.destination=e;this.time=r;this.config=n}next(e){this.lastValue=e;let r=m();O(this.timeout)?r.clearTimeout(this.timeout):this.config.leading&&this.destination.next(e),this.timeout=r.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(e){this.destination.error?.(e)}};var vt={leading:!0,trailing:!1};function ge(t,e=vt){return r=>new c(n=>r.subscribe(new Z(n,t,e)))}var Z=class{constructor(e,r,n){this.destination=e;this.time=r;this.config=n}next(e){this.lastValue=e,k(this.timeout)&&(this.config.leading&&this.destination.next(e),this.timeout=m().setTimeout(()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0},this.time))}error(e){this.destination.error?.(e)}};function he(t){return e=>new c(r=>e.subscribe(new ee(r,t)))}var ee=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)}};var xt=(t,e)=>{let r=(n,o)=>{let s=Object.keys(n);for(let i in o)if(!s.includes(i)||o[i]!==n[i])return!1;return!0};return r(t,e)&&r(e,t)},Ot=(t,e)=>t instanceof Object&&e instanceof Object?xt(t,e):t===e;function xe(t=Ot){return e=>new c(r=>e.subscribe(new te(r,t)))}var ve={},te=class{constructor(e,r){this.destination=e;this.predicate=r;this.lastValue=ve}next(e){let r;try{r=this.lastValue===ve||!this.predicate(this.lastValue,e),this.lastValue=e instanceof Object&&!Array.isArray(e)?{...e}:e}catch(n){throw this.error(n),n}r&&this.destination.next(e)}error(e){this.destination.error?.(e)}};function _(t){return e=>new c(r=>e.subscribe(new re(r,t)))}var re=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 Oe(t){return _(()=>t)}function Ee(){return t=>new c(e=>{let r=!1,n=!1,o=t.subscribe(s=>{r||(r=!0,e.next(s)),n&&o.unsubscribe()},s=>{r=!0,e.error?.(s),n&&o.unsubscribe()});return n=!0,r&&o.unsubscribe(),o})}function we(){return t=>new c(e=>t.subscribe(new ne(e)))}var ne=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 Se(t){return e=>new c(r=>e.subscribe(new oe(r,t)))}var oe=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)}};function Ae(t){return e=>new c(r=>e.subscribe(new ie(r,t)))}var ie=class{constructor(e,r){this.destination=e;this.count=r;r<0&&this.destination.error?.(new Error("Count can not be less than zero"))}next(e){this.count===0?this.destination.next(e):this.count--}error(e){this.destination.error?.(e)}};function Pe(t=0){return e=>{let r=0,n=new P(t),o=e.subscribe(n),s=i=>()=>{i.unsubscribe(),r--,r===0&&o.unsubscribe()};return new c(i=>(r++,s(n.subscribe(i))))}}var Et=300,wt=(t,e=Et)=>new c(r=>{let n=m(),{width:o,height:s}=t.getBoundingClientRect();if(r.next({width:o,height:s}),!me(n))return;let i=new n.ResizeObserver(X(a=>{let l=a[0];if(!l)return;let b,v;l.contentBoxSize&&l.contentBoxSize[0]?(v=l.contentBoxSize[0].blockSize,b=l.contentBoxSize[0].inlineSize):l.contentRect&&(b=l.contentRect.width,v=l.contentRect.height),O(b)&&O(v)&&r.next({width:b,height:v})},e));return i.observe(t),()=>i.disconnect()});var D=(t,e=6,r=".")=>{let n={};for(let o in t)if(!(!t.hasOwnProperty(o)||t[o]instanceof HTMLElement||!e))if(typeof t[o]=="object"&&t[o]!==null){let s=D(t[o],e-1);for(let i in s)s.hasOwnProperty(i)&&(n[o+r+i]=s[i])}else n[o]=t[o];return n};var St=t=>{t.removeAttribute("src"),t.load()};var mo=t=>{let e;try{e=new URL(t)}catch{return!1}return e.protocol==="https:"};var At=(t,e)=>!(t.right<e.left||t.left>e.right||t.bottom<e.top||t.top>e.bottom);var Pt=(()=>{let t=0;return()=>{let e=t;return t=(t+1)%Number.MAX_SAFE_INTEGER,e}})(),kt=t=>t!==void 0&&t!==""?t:Pt().toString();function Rt(t,e,r){if(t<=e[0])return r[0];if(t>=e[e.length-1])return r[r.length-1];let n=1;for(;n<e.length&&e[n]<t;)n++;n>=e.length&&(n=e.length-1);let o=e[n-1],s=e[n],i=r[n-1],a=r[n];if(t===o)return i;if(t===s)return a;let l=(t-o)/(s-o);return i+l*(a-i)}function Lt(t,e,r){if(t<=0||r<0)return[];let n=[],o=Math.floor((t-1)/2),s=Math.floor(t/2),i=e-o,a=e+s;i<0&&(a+=Math.abs(i),i=0),a>r&&(i-=a-r,a=r),i=Math.max(0,i),a=Math.min(r,a);for(let l=i;l<=a;l++)n.push(l);return n}var Nt=t=>e=>r=>{let n=typeof r=="object";r==null||n&&!Object.keys(r).length||t(e,n?D(r):{value:r})},U=(t={})=>{let e=n=>{let o=n;return n===void 0?o="undefined":n===null?o="null":(typeof n=="number"||typeof n=="boolean")&&(o=n.toString()),o},r={};for(let n in t)Array.isArray(t[n])?r[n]=t[n].map(e):r[n]=e(t[n]);return r};var h=class t{constructor({name:e,getParentContext:r}){this.dynamicImportTimeout=5e3;this.childTracers=[];t.dynamicImportStatus==="not_started"&&(t.dynamicImportPromise=this.loadOpentelemetry());let n=Date.now();this.initPromise=t.dynamicImportPromise.then(o=>{t.dynamicImportStatus==="completed"&&this.init({name:e,getParentContext:r},n)})}static{this.dynamicImportStatus="not_started"}init({name:e,getParentContext:r},n){this.span=t.rootTracer.startSpan(e,{startTime:n},r?.()),this.context=t.dynamicImports.opentelemetryApi.trace.setSpan(t.dynamicImports.opentelemetryApi.context.active(),this.span)}async loadOpentelemetry(){if(t.dynamicImportStatus==="not_started"){t.dynamicImportStatus="in_progress";try{let e=new Promise((i,a)=>setTimeout(a,this.dynamicImportTimeout)),r=Promise.all([import("@opentelemetry/api"),import("@opentelemetry/sdk-trace-web"),import("@apptracer/opentelemetry")]),[n,o,s]=await Promise.race([r,e]);t.dynamicImports={opentelemetryApi:n,opentelemetrySdk:o,tracer:s},t.dynamicImportStatus="completed"}catch{t.dynamicImportStatus="failed"}}}isComponentTracerNotInitialized(){return k(this.span)||t.dynamicImportStatus==="failed"}log(e,r){let n=Date.now();this.initPromise.then(o=>{this.isComponentTracerNotInitialized()||this.span.addEvent(e,{...U(r),type:"log"},n)})}error(e,r){let n=Date.now();this.initPromise.then(o=>{this.isComponentTracerNotInitialized()||this.span.addEvent(e,{...U(r),type:"error"},n)})}critical(e,r){let n=Date.now();this.initPromise.then(o=>{this.isComponentTracerNotInitialized()||this.span.addEvent(e,{...U(r),type:"critical"},n)})}createComponentTracer(e){let r=new t({name:e,getParentContext:()=>this.context});return this.childTracers.push(r),r}end(){this.initPromise.then(e=>{this.isComponentTracerNotInitialized()||(this.childTracers.forEach(r=>r.end()),this.span.end())})}};var j=class extends h{constructor(){super({name:"Root"})}init({name:e,getParentContext:r},n){let s=h.dynamicImports.tracer.initTracerOpenTelemetry({serviceName:"videoplayer-sdk-web",appToken:"L9SBoka6ZWk4xPjaK7tmfSfYvMhcge7nvGDjpdMmscb",spanLimits:{attributeCountLimit:1/0,eventCountLimit:1/0,attributePerEventCountLimit:1/0}}).getProvider(),i=new h.dynamicImports.tracer.TracerMemorySpanExporter;this.spanExporter=i,s.addSpanProcessor(new h.dynamicImports.tracer.TracerAllSpansProcessor({startedSpansExporter:i})),h.rootTracer=s.getTracer("sdk-videoplayer-tracer"),super.init({name:e,getParentContext:r},n)}getFinishedSpans(){if(!this.isComponentTracerNotInitialized())return this.spanExporter?.getJsonData()}getTraceId(){return this.isComponentTracerNotInitialized()?"":this.span.spanContext().traceId}};var W=class t{constructor(e){}log(e,r){}error(e,r){}critical(e,r){}createComponentTracer(e){return new t({name:e})}end(){}getFinishedSpans(){}getTraceId(){return this.fakeTraceId}};var se=class{static createRootTracer(e=!1){return e?new j:new W}};var Ct=(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))(Ct||{});var Mt=(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))(Mt||{}),Vt="vk.com",Si=async(t,e,r)=>{let n=new URL(`https://${Vt}/js/lang-pack.js`);n.searchParams.set("format","json"),n.searchParams.set("name",e),t!==void 0&&n.searchParams.set("lang",t);let s=await(await fetch(n.toString())).json();return Qt(s,r)},Qt=(t,e)=>Object.fromEntries(Object.entries(t.keys).map(([r,n])=>[r.substring(`${e}_`.length),_t(n)])),_t=t=>Array.isArray(t)?t[0]:t;var Dt=(r=>(r.RU="ru",r.EN="en",r))(Dt||{});var f="__vk_vp_internals_exposure",ke=class{constructor(e,r){this.playerId=r,this.type=e,this.initWindowObjects()}getWindowObject(){if(typeof window>"u")return{};let e=this.playerId,r=this.type;return window[f]?.[e]?.[r]??{}}initWindowObjects(){if(typeof window>"u")return;let e=this.playerId,r=this.type;window[f]||(window[f]={}),window[f][e]||(window[f][e]={}),window[f][e][r]||(window[f][e][r]={})}expose(e){typeof window>"u"||Object.assign(this.getWindowObject(),e)}destroy(){if(typeof window>"u")return;let e=this.playerId,r=this.type;window[f]&&window[f][e]&&window[f][e][r]&&(delete window[f][e][r],Object.keys(window[f][e]).length||delete window[f][e],Object.keys(window[f]).length||delete window[f])}};var Re={};ue(Re,{create:()=>Ut,destroy:()=>jt,push:()=>Wt,subscribe:()=>zt});var R=new Map,Ut=(t,e)=>R.set(t,e??[]),jt=t=>R.delete(t),Wt=(t,e)=>{let r=R.get(t);r&&(typeof r=="function"?r(e):r.push(e))},zt=(t,e)=>{let r=R.get(t);if(r){if(r&&Array.isArray(r))for(let n of r)e(n);R.set(t,e)}};export{Ct as ErrorCategory,f as INTERNAL_EXPOSE_GLOBAL_KEY,Dt as InterfaceLanguage,ke as InternalsExposure,G as Logger,c as Observable,P as ReplaySubject,I as Subject,d as Subscription,Q as SubscriptionRemovable,se as TracerFactory,De as VERSION,Mt as VKNumericLanguage,V as ValueSubject,K as VideoQuality,$e as abortable,He as addScript,ut as areQualitiesExact,Ke as assertEmptyArray,g as assertNever,ze as assertNonNullable,Be as assertNotEmptyArray,Fe as assertNullable,mt as assertQualityIsExact,ye as buffer,Ue as checkNever,St as clearVideoElement,ft as cloneDeep,M as cloneDeepWith,fe as combine,Ie as debounce,$ as debounceFn,nt as detectEmbed,Re as devNull,dt as fillWithDefault,he as filter,xe as filterChanged,D as flattenObject,gt as fromEvent,Xe as getExponentialDelay,at as getHighestQuality,kt as getPlayerId,Lt as getRangeAroundIndex,Nt as getTraceSubscriptionMethod,bt as getVideoQualityLabel,m as getWindow,Rt as interpolate,yt as interval,me as isBrowserWindow,ot as isHigher,it as isHigherOrEqual,At as isIntersecting,q as isInvariantQuality,H as isLower,st as isLowerOrEqual,O as isNonNullable,k as isNullable,mo as isValidURL,Si as loadVKLangPack,_ as map,Oe as mapTo,Te as merge,w as noop,qe as now,It as observableFrom,wt as observeElementSize,Ee as once,we as pairwise,be as safeStorage,Pe as shareReplay,Ae as skip,Se as tap,ge as throttle,X as throttleFn,xr as timeCodeToString,Tt as timeout,ct as videoHeightToQuality,pt as videoQualityToHeight,lt as videoSizeToQuality,Ge as withoutNullable};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vkontakte/videoplayer-shared",
3
- "version": "1.0.80-dev.ea826f67.0",
3
+ "version": "1.0.80-dev.fbdd1f70.0",
4
4
  "author": "vk.com",
5
5
  "description": "Shared code for vk.com videoplayer",
6
6
  "homepage": "https://vk.com",
@@ -1,3 +1,4 @@
1
+ export type SafeAny = any;
1
2
  export interface IError {
2
3
  /**
3
4
  * Код или другой идентификатор для статистики