@vkontakte/videoplayer-shared 1.0.53-dev.37299d86.0 → 1.0.53-dev.3d8bd7ac.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.53-dev.37299d86.0
3
- * Tue, 14 Jan 2025 12:20:49 GMT
2
+ * @vkontakte/videoplayer-shared v1.0.53-dev.3d8bd7ac.0
3
+ * Fri, 31 Jan 2025 12:25:07 GMT
4
4
  * https://st.mycdn.me/static/vkontakte-videoplayer/1-0-53/doc/
5
5
  */
6
- var Ee=Object.defineProperty;var Se=(t,e)=>{for(var r in e)Ee(t,r,{get:e[r],enumerable:!0})};var Re="1.0.53-dev.37299d86.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 T=t=>{throw new Error(`${t} is value of unexpected type`)},ke=t=>{};var g=()=>{};var l=class{constructor(e){e&&(this._subscribe=e)}subscribe(e,r){let n;r?typeof r=="function"?n={next:r,error:g}:n={next:o=>r.next(o),error:o=>r.error?.(o)}:n={next:g,error:g};let i=typeof e=="function"?{next:o=>{try{e(o)}catch(a){n.next(a)}},error:o=>n.next(o)}:{next:o=>e.next(o),error:o=>e.error?e.error(o):n.next(o)},s;try{s=this._subscribe(i)}catch(o){i.error?.(o)}return new d().add(()=>{switch(i.next=g,i.error=g,typeof s){case"function":s();return;case"object":s.unsubscribe();return;case"undefined":return;default:return T(s)}})}pipe(...e){return e.reduce((r,n)=>n(r),this)}_subscribe(e){}};var v=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 d().add(()=>this.subscribers.delete(n))}};var M=class{constructor(){this.log$=new v;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}))}};var R=class t{constructor({name:e}){}log(e,r){}error(e,r){}critical(e,r){}createComponentTracer(e){return new t({name:e})}end(){}getFinishedSpans(){}getTraceId(){return this.fakeTraceId}},V=class{log(e,r){}error(e,r){}critical(e,r){}static createRootTracer(e=!1){return new R({name:"Root"})}createComponentTracer(e){return new R({name:e})}end(){}getFinishedSpans(){}getTraceId(){return""}};function Ae(t,e='Assertion "value is not nullable" failed'){if(t==null)throw new Error(e)}function Pe(t,e='Assertion "value is nullable" failed'){if(t!=null)throw new Error(e)}function x(t){return typeof t<"u"&&t!==null}function N(t){return t==null}function Ce(t,e){if(!t?.length)throw new Error(e)}function Le(t,e){if(t?.length)throw new Error(e)}var _e=(t,e,r)=>new Promise((n,i)=>{e.addEventListener("abort",()=>{a(),p.remove()});let s=()=>{a(),i()},o=()=>{a(),n()},a=()=>{b&&clearTimeout(b),p.removeEventListener("load",o),p.removeEventListener("error",s)},b;r&&(b=window.setTimeout(s,r));let p=document.createElement("script");p.addEventListener("load",o),p.addEventListener("error",s),p.src=t,document.head.appendChild(p)});var Me=typeof window.performance?.now=="function"?()=>window.performance.now():()=>Date.now();var Ve=(t,e)=>async(...r)=>{let n=e(...r),i=t.aborted,s;for(;!i&&!t.aborted;)try{let o=await n.next(s);i=o.done??!1,s=o.value}catch(o){await n.throw(o)}return s};var ne=()=>/Mobile|mini|Fennec|Android|iP(ad|od|hone)/.test(navigator.appVersion??navigator.userAgent)||navigator?.userAgentData?.mobile,Q=class{constructor(){this.detect()}get browser(){return this._currentBrowser}get device(){return this._currentDevice}get isTouch(){return this._maxTouchPoints>0}get isIOS(){return["iPhone","iPad","iPod"].includes(this.device)}get isMac(){return this.device==="Mac"}get isApple(){return this.isIOS||this.isMac}get isIphoneOrOldIpad(){if(!this.isApple||!this.isTouch)return!1;let e=this.device==="iPad"||window?.screen.width>700,r=this._iosVersion;return!e||e&&!!r&&r<16}get isAndroid(){return this.device==="Android"}get isMobile(){return this._isMobile}get iOSVersion(){return this._iosVersion}get macVersion(){return this._macVersion}get isYandex(){return this.browser==="Yandex"}get isSafari(){return this.browser==="Safari"}get isSamsungBrowser(){return this.browser==="SamsungBrowser"}get isHDR(){return this._isHdr}detect(){let{userAgent:e,maxTouchPoints:r}=navigator;try{this._maxTouchPoints=r,this._isHdr=!!matchMedia("(dynamic-range: high)")?.matches}catch(n){console.error(n)}try{this._isMobile=ne()}catch(n){console.error(n)}this.detectBrowser(e),this.detectDevice(e),this.isIOS&&this.detectIOSVersion(),this.isMac&&this.detectMacVersion()}detectBrowser(e){try{let r=/yabrowser/i.test(e)?"Yandex":void 0,n=/samsungbrowser/i.test(e)?"SamsungBrowser":void 0,i=/chrome|crios/i.test(e)?"Chrome":void 0,s=/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,b=/opr\//i.test(e)?"Opera":void 0,p=/edg/i.test(e)?"Edge":void 0;this._currentBrowser=r||n||o||b||p||i||s||a||"Rest"}catch(r){console.error(r)}}detectDevice(e){try{let r=/android/i.test(e)?"Android":void 0,n=/iphone/i.test(e)?"iPhone":void 0,i=/ipad/i.test(e)?"iPad":void 0,s=/ipod/i.test(e)?"iPod":void 0,o=/mac/i.test(e)?"Mac":void 0,a=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(e)?"RestMobile":void 0;this._currentDevice=r||n||i||s||a||o||"Desktop"}catch(r){console.error(r)}}detectIOSVersion(){try{let{userAgent:e}=window.navigator,r=e.match(/Version\/(\d+(\.\d+)?)/i);if(!r)return;let n=r[1],i=parseFloat(n);if(isNaN(i))return;this._iosVersion=i}catch(e){console.error(e)}}detectMacVersion(){try{let{userAgent:e}=window.navigator,r=e.match(/Version\/(\d+)/);if(!r)return;let n=r[1],i=parseInt(n,10);if(isNaN(i))return;this._macVersion=i}catch(e){console.error(e)}}},Ne=new Q;var Qe=(t,{start:e=0,factor:r=2,max:n=1/0,min:i=e,random:s=0}={})=>{let o=e;return o*=r**t,o*=1+(Math.random()*s*2-s),o=Math.round(o),o=Math.min(o,n),o=Math.max(o,i),o};var ie={};Se(ie,{clear:()=>We,get:()=>Ue,has:()=>Be,isPersistent:()=>De,remove:()=>Fe,set:()=>je});var y,I,D=`vk-videoplayer-dummy-key-${Math.random()}`,O=()=>{if(I!==void 0)return I;try{localStorage.setItem(D,"test"),localStorage.removeItem(D),I=0}catch(t){if(t instanceof DOMException||t instanceof TypeError)try{sessionStorage.getItem(D),I=1}catch(e){if(e instanceof DOMException||e instanceof TypeError)I=2;else throw e}else throw t}return I===2&&(y=new Map),I},De=()=>O()===0,Ue=t=>{let e=O();switch(e){case 0:return localStorage.getItem(t)??void 0;case 1:return sessionStorage.getItem(t)??void 0;case 2:return y?.get(t);default:T(e)}},je=(t,e)=>{let r=O();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 y?.set(t,e);default:T(r)}},Be=t=>{let e=O();switch(e){case 0:return t in localStorage;case 1:return t in sessionStorage;case 2:return y?.has(t)??!1;default:return T(e),!1}},Fe=t=>{let e=O();switch(e){case 0:return localStorage.removeItem(t);case 1:return sessionStorage.removeItem(t);case 2:return void y?.delete(t);default:T(e)}},We=()=>{let t=O();switch(t){case 0:return localStorage.clear();case 1:return sessionStorage.clear();case 2:return y?.clear();default:T(t)}};var ze=()=>{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 U=(c=>(c.INVARIANT="Invariant quality",c.Q_144P="144p",c.Q_240P="240p",c.Q_360P="360p",c.Q_480P="480p",c.Q_576P="576p",c.Q_720P="720p",c.Q_1080P="1080p",c.Q_1440P="1440p",c.Q_2160P="2160p",c.Q_4320P="4320p",c))(U||{});var m={"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}},Ge=(t,e)=>m[t].height>m[e].height,He=(t,e)=>m[t].height>=m[e].height,j=(t,e)=>m[t].height<m[e].height,qe=(t,e)=>m[t].height<=m[e].height,Ke=t=>t.sort((e,r)=>e===r?0:e==="Invariant quality"?1:r==="Invariant quality"?-1:j(e,r)?1:-1)[0],oe=Object.keys(m).sort((t,e)=>j(t,e)?-1:1),Ye=(t,e=.02)=>[...oe].find(n=>m[n].height*(1+e)>=t),$e=({width:t,height:e})=>{let r=Math.min(t,e),n=Math.max(t,e);return oe.find(i=>{let s=m[i];return s.width>=n&&s.height>=r})},Xe=t=>m[t].height,B=t=>t==="Invariant quality",Je=t=>t.every(e=>!B(e));function Ze(t){if(B(t))throw new Error("Expected exact quality")}var et=(t,e)=>{let r={};for(let n of Object.keys(e)){let i=e[n],s=t[n];Array.isArray(i)&&Array.isArray(s)?r[n]=s:typeof i=="object"&&typeof s=="object"?r[n]=et(s,i):r[n]=n in t?s:i}return r};var Xt=t=>{let e="";return t>=3600&&(e+=Math.floor(t/3600)+"h",t=t%3600),t>=60&&(e+=Math.floor(t/60)+"m",t=t%60),t>0&&(e+=Math.floor(t)+"s"),e};function F(t,e=0,r){let n,i,s,o,a,b,p=0,J=!1,c=!1,L=!0,Z=!e&&e!==0&&typeof window.requestAnimationFrame=="function";r&&(J=!!r.leading,c="maxWait"in r,s=r?.maxWait?Math.max(+r?.maxWait||0,e):s,L="trailing"in r?!!r.trailing:L);function _(u){let f=n,h=i;return n=i=void 0,p=u,o=t.apply(h,f),o}function w(u,f){return Z?(a&&window.cancelAnimationFrame(a),window.requestAnimationFrame(u)):setTimeout(u,f)}function ge(u){if(Z){window.cancelAnimationFrame(u);return}clearTimeout(u)}function Ie(u){return p=u,a=w(E,e),J?_(u):o}function xe(u){let f=u-b,h=u-p,re=e-f;return c?Math.min(re,s-h):re}function ee(u){let f=u-b,h=u-p;return b===void 0||f>=e||f<0||c&&h>=s}function E(){let u=Date.now();if(ee(u))return te(u);a=w(E,xe(u))}function te(u){return a=void 0,L&&n?_(u):(n=i=void 0,o)}function ye(){a!==void 0&&ge(a),p=0,n=b=i=a=void 0}function Oe(){return a===void 0?o:te(Date.now())}function we(){return a!==void 0}function S(...u){let f=Date.now(),h=ee(f);if(n=u,i=this,b=f,h){if(a===void 0)return Ie(b);if(c)return a=w(E,e),_(b)}return a===void 0&&(a=w(E,e)),o}return S.cancel=ye,S.flush=Oe,S.pending=we,S}var W=(t,e=0,r)=>F(t,e,{...{leading:!0,trailing:!0},...r,maxWait:e});var k=(t,e)=>{if(t===null||typeof t!="object")return t;let r=Array.isArray(t)?[]:{};for(let n in t){if(typeof e=="function"){let i=e(t[n],n,t,r);if(i!==void 0){r[n]=i;continue}}typeof t[n]=="object"?r[n]=k(t[n],e):r[n]=t[n]}return r};var tt=t=>k(t);var rt=300,nt=(t,e=rt)=>new l(r=>{let{width:n,height:i}=t.getBoundingClientRect();if(r.next({width:n,height:i}),!window.ResizeObserver)return;let s=new ResizeObserver(W(o=>{let a=o[0];if(!a)return;let b,p;a.contentBoxSize&&a.contentBoxSize[0]?(p=a.contentBoxSize[0].blockSize,b=a.contentBoxSize[0].inlineSize):a.contentRect&&(b=a.contentRect.width,p=a.contentRect.height),x(b)&&x(p)&&r.next({width:b,height:p})},e));return s.observe(t),()=>s.disconnect()});var A=(t,e=6,r=".")=>{let n={};for(let i in t)if(!(!t.hasOwnProperty(i)||t[i]instanceof HTMLElement||!e))if(typeof t[i]=="object"&&t[i]!==null){let s=A(t[i],e-1);for(let o in s)s.hasOwnProperty(o)&&(n[i+r+o]=s[o])}else n[i]=t[i];return n};var it=t=>{t.removeAttribute("src"),t.load()};var ur=t=>{let e;try{e=new URL(t)}catch{return!1}return e.protocol==="https:"};var br=t=>{try{return new URL(t)}catch{return null}};var ot=t=>e=>r=>{let n=typeof r=="object";r==null||n&&!Object.keys(r).length||t(e,n?A(r):{value:r})};var P=class extends v{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 se(t){return new l(e=>{let r={},n=Object.keys(t).length,i=s=>o=>{s in r||n--,r[s]=o,n===0&&e.next(r)};return Object.entries(t).reduce((s,[o,a])=>s.add(a.subscribe(i(o))),new d)})}function ae(...t){return new l(e=>t.reduce((r,n)=>r.add(n.subscribe(e)),new d))}var st=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 at=t=>new l(e=>{let r=window.setInterval(()=>e.next(),t);return()=>{r&&(window.clearInterval(r),r=void 0)}});var lt=t=>new l(e=>{t.forEach(r=>e.next(r))});var ct=(t,e)=>new l(r=>{let n=i=>r.next(i);return t.addEventListener(e,n),()=>t.removeEventListener(e,n)});function le(t){return e=>new l(r=>e.subscribe(new z(r,t)))}var z=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 ce(t,e=ut){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,x(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 pt={leading:!0,trailing:!1};function ue(t,e=pt){return r=>new l(n=>r.subscribe(new H(n,t,e)))}var H=class{constructor(e,r,n){this.destination=e;this.time=r;this.config=n}next(e){this.lastValue=e,N(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 pe(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 de(t=(e,r)=>e===r){return e=>new l(r=>e.subscribe(new K(r,t)))}var be={},K=class{constructor(e,r){this.destination=e;this.predicate=r;this.lastValue=be}next(e){let r;try{r=this.lastValue===be||!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 C(t){return e=>new l(r=>e.subscribe(new Y(r,t)))}var Y=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 me(t){return C(()=>t)}function fe(){return t=>new l(e=>{let r=!1,n=!1,i=t.subscribe(s=>{r||(r=!0,e.next(s)),n&&i.unsubscribe()},s=>{r=!0,e.error?.(s),n&&i.unsubscribe()});return n=!0,r&&i.unsubscribe(),i})}function Te(){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 ve(t){return e=>new l(r=>e.subscribe(new X(r,t)))}var X=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 bt=(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))(bt||{});var dt=(c=>(c.Armenian="58",c.Azerbaijani="57",c.Belarusian="114",c.English="3",c.Kazakh="97",c.Portuguese="73",c.Russian="0",c.Spanish="4",c.Ukrainian="1",c.Uzbek="65",c.Vietnamese="75",c))(dt||{}),mt="vk.com",ni=async(t,e,r)=>{let n=new URL(`https://${mt}/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 ft(s,r)},ft=(t,e)=>Object.fromEntries(Object.entries(t.keys).map(([r,n])=>[r.substring(`${e}_`.length),Tt(n)])),Tt=t=>Array.isArray(t)?t[0]:t;var vt=(r=>(r.RU="ru",r.EN="en",r))(vt||{});var ht={UI:"__vkVideoPlayer",CORE:"__vkVideoCore"},gt=(()=>{let t=0;return()=>{let e=t;return t=(t+1)%Number.MAX_SAFE_INTEGER,e}})(),he=class{constructor(e){this.id=gt();this.type=e,this.initWindowObjects()}getWindowObject(){let e=this.key();return window[e]?.[this.id]??{}}initWindowObjects(){let e=this.key();window[e]||(window[e]={}),window[e][this.id]={}}expose(e){Object.assign(this.getWindowObject(),e)}destroy(){let e=this.key();window&&window[e]&&window[e][this.id]&&(delete window[e][this.id],Object.keys(window[e]).length||delete window[e])}key(){let{type:e}=this;return ht[e]}};export{bt as ErrorCategory,vt as InterfaceLanguage,he as InternalsExposure,M as Logger,l as Observable,v as Subject,d as Subscription,V as Tracer,Re as VERSION,dt as VKNumericLanguage,P as ValueSubject,U as VideoQuality,Ve as abortable,_e as addScript,Je as areQualitiesExact,Le as assertEmptyArray,T as assertNever,Ae as assertNonNullable,Ce as assertNotEmptyArray,Pe as assertNullable,Ze as assertQualityIsExact,le as buffer,ke as checkNever,it as clearVideoElement,Ne as clientChecker,tt as cloneDeep,k as cloneDeepWith,se as combine,br as createURL,ce as debounce,F as debounceFn,ze as detectEmbed,et as fillWithDefault,pe as filter,de as filterChanged,A as flattenObject,ct as fromEvent,Qe as getExponentialDelay,Ke as getHighestQuality,ot as getTraceSubscriptionMethod,at as interval,Ge as isHigher,He as isHigherOrEqual,B as isInvariantQuality,j as isLower,qe as isLowerOrEqual,ne as isMobile,x as isNonNullable,N as isNullable,ur as isValidURL,ni as loadVKLangPack,C as map,me as mapTo,ae as merge,g as noop,Me as now,lt as observableFrom,nt as observeElementSize,fe as once,Te as pairwise,ie as safeStorage,ve as tap,ue as throttle,W as throttleFn,Xt as timeCodeToString,st as timeout,Ye as videoHeightToQuality,Xe as videoQualityToHeight,$e as videoSizeToQuality};
6
+ var ke=Object.defineProperty;var Ae=(t,e)=>{for(var r in e)ke(t,r,{get:e[r],enumerable:!0})};var Pe="1.0.53-dev.3d8bd7ac.0";var b=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 T=t=>{throw new Error(`${t} is value of unexpected type`)},Ce=t=>{};var g=()=>{};var c=class{constructor(e){e&&(this._subscribe=e)}subscribe(e,r){let n;r?typeof r=="function"?n={next:r,error:g}:n={next:o=>r.next(o),error:o=>r.error?.(o)}:n={next:g,error:g};let i=typeof e=="function"?{next:o=>{try{e(o)}catch(a){n.next(a)}},error:o=>n.next(o)}:{next:o=>e.next(o),error:o=>e.error?e.error(o):n.next(o)},s;try{s=this._subscribe(i)}catch(o){i.error?.(o)}return new b().add(()=>{switch(i.next=g,i.error=g,typeof s){case"function":s();return;case"object":s.unsubscribe();return;case"undefined":return;default:return T(s)}})}pipe(...e){return e.reduce((r,n)=>n(r),this)}_subscribe(e){}};var v=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 b().add(()=>this.subscribers.delete(n))}};var M=class{constructor(){this.log$=new v;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}))}};import{trace as Le,context as Me}from"@opentelemetry/api";import{TracerAllSpansProcessor as _e,TracerMemorySpanExporter as ie,initTracerOpenTelemetry as Ve}from"@tracer/opentelemetry";var _=class t{constructor({name:e}){}log(e,r){}error(e,r){}critical(e,r){}createComponentTracer(e){return new t({name:e})}end(){}getFinishedSpans(){}getTraceId(){return this.fakeTraceId}},V=class t{constructor({name:e,parentContext:r,tracer:n}){this.childTracers=[];let i=!n;if(i){let o=Ve({serviceName:"videoplayer-sdk-web",appToken:"L9SBoka6ZWk4xPjaK7tmfSfYvMhcge7nvGDjpdMmscb",spanLimits:{attributeCountLimit:1/0,eventCountLimit:1/0,attributePerEventCountLimit:1/0}}).getProvider(),a=new ie,p=new ie;this.spanExporter=a,o.addSpanProcessor(new _e({startedSpansExporter:a,endedSpansExporter:p})),this.tracer=o.getTracer("sdk-videoplayer-tracer")}else this.tracer=n;this.span=this.tracer.startSpan(e,{root:i},r),this.context=Le.setSpan(Me.active(),this.span)}log(e,r){this.span.addEvent(e,{...r,type:"log"})}error(e,r){this.span.addEvent(e,{...r,type:"error"})}critical(e,r){this.span.addEvent(e,{...r,type:"critical"})}static createRootTracer(e=!1){return e?new t({name:"Root"}):new _({name:"Root"})}createComponentTracer(e){let r=new t({name:e,parentContext:this.context,tracer:this.tracer});return this.childTracers.push(r),r}end(){this.childTracers.forEach(e=>e.end()),this.span.end()}getFinishedSpans(){return this.spanExporter?.getJsonData()}getTraceId(){return this.span.spanContext().traceId}};function Ne(t,e='Assertion "value is not nullable" failed'){if(t==null)throw new Error(e)}function Qe(t,e='Assertion "value is nullable" failed'){if(t!=null)throw new Error(e)}function x(t){return typeof t<"u"&&t!==null}function N(t){return t==null}function De(t,e){if(!t?.length)throw new Error(e)}function Ue(t,e){if(t?.length)throw new Error(e)}var je=(t,e,r)=>new Promise((n,i)=>{e.addEventListener("abort",()=>{a(),d.remove()});let s=()=>{a(),i()},o=()=>{a(),n()},a=()=>{p&&clearTimeout(p),d.removeEventListener("load",o),d.removeEventListener("error",s)},p;r&&(p=window.setTimeout(s,r));let d=document.createElement("script");d.addEventListener("load",o),d.addEventListener("error",s),d.src=t,document.head.appendChild(d)});var Be=typeof window.performance?.now=="function"?()=>window.performance.now():()=>Date.now();var Fe=(t,e)=>async(...r)=>{let n=e(...r),i=t.aborted,s;for(;!i&&!t.aborted;)try{let o=await n.next(s);i=o.done??!1,s=o.value}catch(o){await n.throw(o)}return s};var oe=()=>/Mobile|mini|Fennec|Android|iP(ad|od|hone)/.test(navigator.appVersion??navigator.userAgent)||navigator?.userAgentData?.mobile,Q=class{constructor(){this.detect()}get browser(){return this._currentBrowser}get device(){return this._currentDevice}get isTouch(){return this._maxTouchPoints>0}get isIOS(){return["iPhone","iPad","iPod"].includes(this.device)}get isMac(){return this.device==="Mac"}get isApple(){return this.isIOS||this.isMac}get isIphoneOrOldIpad(){if(!this.isApple||!this.isTouch)return!1;let e=this.device==="iPad"||window?.screen.width>700,r=this._iosVersion;return!e||e&&!!r&&r<16}get isAndroid(){return this.device==="Android"}get isMobile(){return this._isMobile}get iOSVersion(){return this._iosVersion}get macVersion(){return this._macVersion}get isYandex(){return this.browser==="Yandex"}get isSafari(){return this.browser==="Safari"}get isSamsungBrowser(){return this.browser==="SamsungBrowser"}get isHDR(){return this._isHdr}detect(){let{userAgent:e,maxTouchPoints:r}=navigator;try{this._maxTouchPoints=r,this._isHdr=!!matchMedia("(dynamic-range: high)")?.matches}catch(n){console.error(n)}try{this._isMobile=oe()}catch(n){console.error(n)}this.detectBrowser(e),this.detectDevice(e),this.isIOS&&this.detectIOSVersion(),this.isMac&&this.detectMacVersion()}detectBrowser(e){try{let r=/yabrowser/i.test(e)?"Yandex":void 0,n=/samsungbrowser/i.test(e)?"SamsungBrowser":void 0,i=/chrome|crios/i.test(e)?"Chrome":void 0,s=/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,p=/opr\//i.test(e)?"Opera":void 0,d=/edg/i.test(e)?"Edge":void 0;this._currentBrowser=r||n||o||p||d||i||s||a||"Rest"}catch(r){console.error(r)}}detectDevice(e){try{let r=/android/i.test(e)?"Android":void 0,n=/iphone/i.test(e)?"iPhone":void 0,i=/ipad/i.test(e)?"iPad":void 0,s=/ipod/i.test(e)?"iPod":void 0,o=/mac/i.test(e)?"Mac":void 0,a=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(e)?"RestMobile":void 0;this._currentDevice=r||n||i||s||a||o||"Desktop"}catch(r){console.error(r)}}detectIOSVersion(){try{let{userAgent:e}=window.navigator,r=e.match(/Version\/(\d+(\.\d+)?)/i);if(!r)return;let n=r[1],i=parseFloat(n);if(isNaN(i))return;this._iosVersion=i}catch(e){console.error(e)}}detectMacVersion(){try{let{userAgent:e}=window.navigator,r=e.match(/Version\/(\d+)/);if(!r)return;let n=r[1],i=parseInt(n,10);if(isNaN(i))return;this._macVersion=i}catch(e){console.error(e)}}},We=new Q;var ze=(t,{start:e=0,factor:r=2,max:n=1/0,min:i=e,random:s=0}={})=>{let o=e;return o*=r**t,o*=1+(Math.random()*s*2-s),o=Math.round(o),o=Math.min(o,n),o=Math.max(o,i),o};var se={};Ae(se,{clear:()=>$e,get:()=>Ke,has:()=>qe,isPersistent:()=>Ge,remove:()=>Ye,set:()=>He});var y,I,D=`vk-videoplayer-dummy-key-${Math.random()}`,O=()=>{if(I!==void 0)return I;try{localStorage.setItem(D,"test"),localStorage.removeItem(D),I=0}catch(t){if(t instanceof DOMException||t instanceof TypeError)try{sessionStorage.getItem(D),I=1}catch(e){if(e instanceof DOMException||e instanceof TypeError)I=2;else throw e}else throw t}return I===2&&(y=new Map),I},Ge=()=>O()===0,Ke=t=>{let e=O();switch(e){case 0:return localStorage.getItem(t)??void 0;case 1:return sessionStorage.getItem(t)??void 0;case 2:return y?.get(t);default:T(e)}},He=(t,e)=>{let r=O();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 y?.set(t,e);default:T(r)}},qe=t=>{let e=O();switch(e){case 0:return t in localStorage;case 1:return t in sessionStorage;case 2:return y?.has(t)??!1;default:return T(e),!1}},Ye=t=>{let e=O();switch(e){case 0:return localStorage.removeItem(t);case 1:return sessionStorage.removeItem(t);case 2:return void y?.delete(t);default:T(e)}},$e=()=>{let t=O();switch(t){case 0:return localStorage.clear();case 1:return sessionStorage.clear();case 2:return y?.clear();default:T(t)}};var Xe=()=>{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 U=(l=>(l.INVARIANT="Invariant quality",l.Q_144P="144p",l.Q_240P="240p",l.Q_360P="360p",l.Q_480P="480p",l.Q_576P="576p",l.Q_720P="720p",l.Q_1080P="1080p",l.Q_1440P="1440p",l.Q_2160P="2160p",l.Q_4320P="4320p",l))(U||{});var m={"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}},Je=(t,e)=>m[t].height>m[e].height,Ze=(t,e)=>m[t].height>=m[e].height,j=(t,e)=>m[t].height<m[e].height,et=(t,e)=>m[t].height<=m[e].height,tt=t=>t.sort((e,r)=>e===r?0:e==="Invariant quality"?1:r==="Invariant quality"?-1:j(e,r)?1:-1)[0],ae=Object.keys(m).sort((t,e)=>j(t,e)?-1:1),rt=(t,e=.02)=>[...ae].find(n=>m[n].height*(1+e)>=t),nt=({width:t,height:e})=>{let r=Math.min(t,e),n=Math.max(t,e);return ae.find(i=>{let s=m[i];return s.width>=n&&s.height>=r})},it=t=>m[t].height,B=t=>t==="Invariant quality",ot=t=>t.every(e=>!B(e));function st(t){if(B(t))throw new Error("Expected exact quality")}var at=(t,e)=>{let r={};for(let n of Object.keys(e)){let i=e[n],s=t[n];Array.isArray(i)&&Array.isArray(s)?r[n]=s:typeof i=="object"&&typeof s=="object"?r[n]=at(s,i):r[n]=n in t?s:i}return r};var fr=t=>{let e="";return t>=3600&&(e+=Math.floor(t/3600)+"h",t=t%3600),t>=60&&(e+=Math.floor(t/60)+"m",t=t%60),t>0&&(e+=Math.floor(t)+"s"),e};function F(t,e=0,r){let n,i,s,o,a,p,d=0,Z=!1,l=!1,C=!0,ee=!e&&e!==0&&typeof window.requestAnimationFrame=="function";r&&(Z=!!r.leading,l="maxWait"in r,s=r?.maxWait?Math.max(+r?.maxWait||0,e):s,C="trailing"in r?!!r.trailing:C);function L(u){let f=n,h=i;return n=i=void 0,d=u,o=t.apply(h,f),o}function w(u,f){return ee?(a&&window.cancelAnimationFrame(a),window.requestAnimationFrame(u)):setTimeout(u,f)}function ye(u){if(ee){window.cancelAnimationFrame(u);return}clearTimeout(u)}function Oe(u){return d=u,a=w(E,e),Z?L(u):o}function we(u){let f=u-p,h=u-d,ne=e-f;return l?Math.min(ne,s-h):ne}function te(u){let f=u-p,h=u-d;return p===void 0||f>=e||f<0||l&&h>=s}function E(){let u=Date.now();if(te(u))return re(u);a=w(E,we(u))}function re(u){return a=void 0,C&&n?L(u):(n=i=void 0,o)}function Ee(){a!==void 0&&ye(a),d=0,n=p=i=a=void 0}function Se(){return a===void 0?o:re(Date.now())}function Re(){return a!==void 0}function S(...u){let f=Date.now(),h=te(f);if(n=u,i=this,p=f,h){if(a===void 0)return Oe(p);if(l)return a=w(E,e),L(p)}return a===void 0&&(a=w(E,e)),o}return S.cancel=Ee,S.flush=Se,S.pending=Re,S}var W=(t,e=0,r)=>F(t,e,{...{leading:!0,trailing:!0},...r,maxWait:e});var R=(t,e)=>{if(t===null||typeof t!="object")return t;let r=Array.isArray(t)?[]:{};for(let n in t){if(typeof e=="function"){let i=e(t[n],n,t,r);if(i!==void 0){r[n]=i;continue}}typeof t[n]=="object"?r[n]=R(t[n],e):r[n]=t[n]}return r};var ct=t=>R(t);var lt=300,ut=(t,e=lt)=>new c(r=>{let{width:n,height:i}=t.getBoundingClientRect();if(r.next({width:n,height:i}),!window.ResizeObserver)return;let s=new ResizeObserver(W(o=>{let a=o[0];if(!a)return;let p,d;a.contentBoxSize&&a.contentBoxSize[0]?(d=a.contentBoxSize[0].blockSize,p=a.contentBoxSize[0].inlineSize):a.contentRect&&(p=a.contentRect.width,d=a.contentRect.height),x(p)&&x(d)&&r.next({width:p,height:d})},e));return s.observe(t),()=>s.disconnect()});var k=(t,e=6,r=".")=>{let n={};for(let i in t)if(!(!t.hasOwnProperty(i)||t[i]instanceof HTMLElement||!e))if(typeof t[i]=="object"&&t[i]!==null){let s=k(t[i],e-1);for(let o in s)s.hasOwnProperty(o)&&(n[i+r+o]=s[o])}else n[i]=t[i];return n};var pt=t=>{t.removeAttribute("src"),t.load()};var kr=t=>{let e;try{e=new URL(t)}catch{return!1}return e.protocol==="https:"};var Pr=t=>{try{return new URL(t)}catch{return null}};var dt=t=>e=>r=>{let n=typeof r=="object";r==null||n&&!Object.keys(r).length||t(e,n?k(r):{value:r})};var A=class extends v{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 ce(t){return new c(e=>{let r={},n=Object.keys(t).length,i=s=>o=>{s in r||n--,r[s]=o,n===0&&e.next(r)};return Object.entries(t).reduce((s,[o,a])=>s.add(a.subscribe(i(o))),new b)})}function le(...t){return new c(e=>t.reduce((r,n)=>r.add(n.subscribe(e)),new b))}var bt=t=>new c(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 mt=t=>new c(e=>{let r=window.setInterval(()=>e.next(),t);return()=>{r&&(window.clearInterval(r),r=void 0)}});var ft=t=>new c(e=>{t.forEach(r=>e.next(r))});var Tt=(t,e)=>new c(r=>{let n=i=>r.next(i);return t.addEventListener(e,n),()=>t.removeEventListener(e,n)});function ue(t){return e=>new c(r=>e.subscribe(new z(r,t)))}var z=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 vt={leading:!1,trailing:!0};function pe(t,e=vt){return r=>new c(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,x(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 ht={leading:!0,trailing:!1};function de(t,e=ht){return r=>new c(n=>r.subscribe(new K(n,t,e)))}var K=class{constructor(e,r,n){this.destination=e;this.time=r;this.config=n}next(e){this.lastValue=e,N(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 be(t){return e=>new c(r=>e.subscribe(new H(r,t)))}var H=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 gt=(t,e)=>{let r=(n,i)=>{let s=Object.keys(n);for(let o in i)if(!s.includes(o)||i[o]!==n[o])return!1;return!0};return r(t,e)&&r(e,t)},It=(t,e)=>t instanceof Object&&e instanceof Object?gt(t,e):t===e;function fe(t=It){return e=>new c(r=>e.subscribe(new q(r,t)))}var me={},q=class{constructor(e,r){this.destination=e;this.predicate=r;this.lastValue=me}next(e){let r;try{r=this.lastValue===me||!this.predicate(this.lastValue,e),this.lastValue=e instanceof Object?{...e}:e}catch(n){throw this.error(n),n}r&&this.destination.next(e)}error(e){this.destination.error?.(e)}};function P(t){return e=>new c(r=>e.subscribe(new Y(r,t)))}var Y=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 Te(t){return P(()=>t)}function ve(){return t=>new c(e=>{let r=!1,n=!1,i=t.subscribe(s=>{r||(r=!0,e.next(s)),n&&i.unsubscribe()},s=>{r=!0,e.error?.(s),n&&i.unsubscribe()});return n=!0,r&&i.unsubscribe(),i})}function he(){return t=>new c(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 ge(t){return e=>new c(r=>e.subscribe(new X(r,t)))}var X=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 Ie(t){return e=>new c(r=>e.subscribe(new J(r,t)))}var J=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)}};var xt=(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))(xt||{});var yt=(l=>(l.Armenian="58",l.Azerbaijani="57",l.Belarusian="114",l.English="3",l.Kazakh="97",l.Portuguese="73",l.Russian="0",l.Spanish="4",l.Ukrainian="1",l.Uzbek="65",l.Vietnamese="75",l))(yt||{}),Ot="vk.com",Ei=async(t,e,r)=>{let n=new URL(`https://${Ot}/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 wt(s,r)},wt=(t,e)=>Object.fromEntries(Object.entries(t.keys).map(([r,n])=>[r.substring(`${e}_`.length),Et(n)])),Et=t=>Array.isArray(t)?t[0]:t;var St=(r=>(r.RU="ru",r.EN="en",r))(St||{});var Rt={UI:"__vkVideoPlayer",CORE:"__vkVideoCore"},kt=(()=>{let t=0;return()=>{let e=t;return t=(t+1)%Number.MAX_SAFE_INTEGER,e}})(),xe=class{constructor(e){this.id=kt();this.type=e,this.initWindowObjects()}getWindowObject(){let e=this.key();return window[e]?.[this.id]??{}}initWindowObjects(){let e=this.key();window[e]||(window[e]={}),window[e][this.id]={}}expose(e){Object.assign(this.getWindowObject(),e)}destroy(){let e=this.key();window&&window[e]&&window[e][this.id]&&(delete window[e][this.id],Object.keys(window[e]).length||delete window[e])}key(){let{type:e}=this;return Rt[e]}};export{xt as ErrorCategory,St as InterfaceLanguage,xe as InternalsExposure,M as Logger,c as Observable,v as Subject,b as Subscription,V as Tracer,Pe as VERSION,yt as VKNumericLanguage,A as ValueSubject,U as VideoQuality,Fe as abortable,je as addScript,ot as areQualitiesExact,Ue as assertEmptyArray,T as assertNever,Ne as assertNonNullable,De as assertNotEmptyArray,Qe as assertNullable,st as assertQualityIsExact,ue as buffer,Ce as checkNever,pt as clearVideoElement,We as clientChecker,ct as cloneDeep,R as cloneDeepWith,ce as combine,Pr as createURL,pe as debounce,F as debounceFn,Xe as detectEmbed,at as fillWithDefault,be as filter,fe as filterChanged,k as flattenObject,Tt as fromEvent,ze as getExponentialDelay,tt as getHighestQuality,dt as getTraceSubscriptionMethod,mt as interval,Je as isHigher,Ze as isHigherOrEqual,B as isInvariantQuality,j as isLower,et as isLowerOrEqual,oe as isMobile,x as isNonNullable,N as isNullable,kr as isValidURL,Ei as loadVKLangPack,P as map,Te as mapTo,le as merge,g as noop,Be as now,ft as observableFrom,ut as observeElementSize,ve as once,he as pairwise,se as safeStorage,Ie as skip,ge as tap,de as throttle,W as throttleFn,fr as timeCodeToString,bt as timeout,rt as videoHeightToQuality,it as videoQualityToHeight,nt as videoSizeToQuality};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vkontakte/videoplayer-shared",
3
- "version": "1.0.53-dev.37299d86.0",
3
+ "version": "1.0.53-dev.3d8bd7ac.0",
4
4
  "author": "vk.com",
5
5
  "description": "Shared code for vk.com videoplayer",
6
6
  "homepage": "https://vk.com",
@@ -52,6 +52,7 @@
52
52
  "@opentelemetry/api": "^1.8.0",
53
53
  "@opentelemetry/core": "^1.25.0",
54
54
  "@opentelemetry/instrumentation": "^0.52.0",
55
- "@opentelemetry/sdk-trace-web": "^1.24.1"
55
+ "@opentelemetry/sdk-trace-web": "^1.24.1",
56
+ "@tracer/opentelemetry": "https://artifactory-external.vkpartner.ru/artifactory/api/npm/npm-odkl-nexus/@tracer/opentelemetry/-/opentelemetry-1.1.7.tgz"
56
57
  }
57
58
  }
@@ -1,6 +1,12 @@
1
- import { ITracer } from '../Tracer/types';
2
1
  import { Attributes } from '@opentelemetry/api';
2
+ import { ITracer } from './types';
3
3
  export declare class Tracer implements ITracer {
4
+ private readonly tracer;
5
+ private readonly span;
6
+ private readonly context;
7
+ private readonly childTracers;
8
+ private readonly spanExporter;
9
+ private constructor();
4
10
  log(name: string, attributes?: Attributes): void;
5
11
  error(name: string, attributes?: Attributes): void;
6
12
  critical(name: string, attributes?: Attributes): void;
@@ -2,6 +2,6 @@ import type { IEmitter, IListener, IObservable, IOperator, ISubscription, IUnsub
2
2
  export default class Observable<T> implements IObservable<T> {
3
3
  constructor(subscribe?: (emitter: IEmitter<T>) => IUnsubscriber | ISubscription | void);
4
4
  subscribe(listener: IListener<T>, error?: IListener<Error | unknown>): ISubscription;
5
- pipe(...operators: IOperator<unknown, unknown>[]): IObservable<unknown>;
5
+ pipe<K = unknown>(...operators: IOperator<unknown, unknown>[]): IObservable<K>;
6
6
  protected _subscribe(_emitter: IEmitter<T>): IUnsubscriber | ISubscription | void;
7
7
  }
@@ -18,4 +18,5 @@ export { default as mapTo } from './operators/mapTo';
18
18
  export { default as once } from './operators/once';
19
19
  export { default as pairwise } from './operators/pairwise';
20
20
  export { default as tap } from './operators/tap';
21
+ export { default as skip } from './operators/skip';
21
22
  export type { ISubscription, IUnsubscriber, IObservable, ISubject, IValueSubject, IValueObservable, IListener, IEmitter, IValue, IOperator, } from './types';
@@ -0,0 +1,6 @@
1
+ import type { IOperator } from '../../reactive';
2
+ /**
3
+ * Пропускает первые count событий
4
+ * @param count
5
+ */
6
+ export default function skip<T>(count: number): IOperator<T>;