@vkontakte/videoplayer-statistics 1.0.81-dev.5dab7ad1.0 → 1.0.81-dev.6c99e2bc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es2015.cjs.js +3 -3
- package/es2015.esm.js +3 -3
- package/es2018.cjs.js +3 -3
- package/es2018.esm.js +3 -3
- package/es2024.cjs.js +3 -3
- package/es2024.esm.js +3 -3
- package/esnext.cjs.js +3 -3
- package/esnext.esm.js +3 -3
- package/evergreen.esm.js +3 -3
- package/package.json +3 -5
- package/types/index.d.ts +2 -8
- package/types/oneStat/index.d.ts +6 -0
- package/types/thinOneStat/Api.d.ts +38 -0
- package/types/thinOneStat/ApiTransport.d.ts +25 -0
- package/types/thinOneStat/Logger.d.ts +42 -0
- package/types/thinOneStat/ThinOneStat.d.ts +172 -0
- package/types/thinOneStat/config.d.ts +17 -0
- package/types/thinOneStat/env.d.ts +7 -0
- package/types/thinOneStat/index.d.ts +4 -0
- package/types/thinOneStat/types.d.ts +28 -0
- package/types/thinOneStat/uiEvents.d.ts +9 -0
- package/types/thinOneStat/utils/calculateTotalViewTime.d.ts +5 -0
- package/types/thinOneStat/utils/mappers.d.ts +8 -0
- package/types/thinOneStat/utils/timeSynchronisation.d.ts +10 -0
- package/types/thinOneStat/utils/uuid.d.ts +1 -0
- package/types/thinOneStat/utils/vsid.d.ts +2 -0
- package/types/thinOneStat/utils/watchCoverage.d.ts +6 -0
- package/types/thinOneStat/utils/watchedN.d.ts +7 -0
- package/types/thinOneStat/values.d.ts +74 -0
- package/types/MediascopePixel/MediascopePixel.d.ts +0 -38
- package/types/MediascopePixel/Stopwatch.d.ts +0 -12
- package/types/MediascopePixel/types.d.ts +0 -9
- package/types/MediascopePixel/utils/image.d.ts +0 -1
- /package/types/{OneStat → oneStat}/Api.d.ts +0 -0
- /package/types/{OneStat → oneStat}/ApiTransport.d.ts +0 -0
- /package/types/{OneStat → oneStat}/Logger.d.ts +0 -0
- /package/types/{OneStat → oneStat}/OneStat.d.ts +0 -0
- /package/types/{OneStat → oneStat}/config.d.ts +0 -0
- /package/types/{OneStat → oneStat}/env.d.ts +0 -0
- /package/types/{OneStat → oneStat}/types.d.ts +0 -0
- /package/types/{OneStat → oneStat}/uiEvents.d.ts +0 -0
- /package/types/{OneStat → oneStat}/utils/mappers.d.ts +0 -0
- /package/types/{OneStat → oneStat}/utils/shorten.d.ts +0 -0
- /package/types/{OneStat → oneStat}/utils/timeSynchronisation.d.ts +0 -0
- /package/types/{OneStat → oneStat}/utils/uuid.d.ts +0 -0
- /package/types/{OneStat → oneStat}/utils/vsid.d.ts +0 -0
- /package/types/{OneStat → oneStat}/utils/watchCoverage.d.ts +0 -0
- /package/types/{OneStat → oneStat}/values.d.ts +0 -0
package/es2018.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vkontakte/videoplayer-statistics v1.0.81-dev.
|
|
3
|
-
*
|
|
2
|
+
* @vkontakte/videoplayer-statistics v1.0.81-dev.6c99e2bc.0
|
|
3
|
+
* Tue, 01 Jul 2025 12:01:18 GMT
|
|
4
4
|
* https://st.mycdn.me/static/vkontakte-videoplayer/1-0-81/doc/
|
|
5
5
|
*/
|
|
6
|
-
var Ql=Object.create;var eo=Object.defineProperty;var Yl=Object.getOwnPropertyDescriptor;var Jl=Object.getOwnPropertyNames;var Xl=Object.getPrototypeOf,Zl=Object.prototype.hasOwnProperty;var n=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var ef=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Jl(e))!Zl.call(r,o)&&o!==t&&eo(r,o,{get:()=>e[o],enumerable:!(i=Yl(e,o))||i.enumerable});return r};var $=(r,e,t)=>(t=r!=null?Ql(Xl(r)):{},ef(e||!r||!r.__esModule?eo(t,"default",{value:r,enumerable:!0}):t,r));var I=n((Vr,ro)=>{"use strict";var ye=function(r){return r&&r.Math===Math&&r};ro.exports=ye(typeof globalThis=="object"&&globalThis)||ye(typeof window=="object"&&window)||ye(typeof self=="object"&&self)||ye(typeof global=="object"&&global)||ye(typeof Vr=="object"&&Vr)||function(){return this}()||Function("return this")()});var P=n((Sy,to)=>{"use strict";to.exports=function(r){try{return!!r()}catch(e){return!0}}});var Ie=n((Py,io)=>{"use strict";var rf=P();io.exports=!rf(function(){var r=function(){}.bind();return typeof r!="function"||r.hasOwnProperty("prototype")})});var Kr=n((Ey,so)=>{"use strict";var tf=Ie(),ao=Function.prototype,oo=ao.apply,no=ao.call;so.exports=typeof Reflect=="object"&&Reflect.apply||(tf?no.bind(oo):function(){return no.apply(oo,arguments)})});var T=n((Ty,lo)=>{"use strict";var uo=Ie(),co=Function.prototype,Wr=co.call,of=uo&&co.bind.bind(Wr,Wr);lo.exports=uo?of:function(r){return function(){return Wr.apply(r,arguments)}}});var Se=n((qy,po)=>{"use strict";var fo=T(),nf=fo({}.toString),af=fo("".slice);po.exports=function(r){return af(nf(r),8,-1)}});var Gr=n((_y,vo)=>{"use strict";var sf=Se(),uf=T();vo.exports=function(r){if(sf(r)==="Function")return uf(r)}});var S=n((Oy,ho)=>{"use strict";var Hr=typeof document=="object"&&document.all;ho.exports=typeof Hr=="undefined"&&Hr!==void 0?function(r){return typeof r=="function"||r===Hr}:function(r){return typeof r=="function"}});var q=n((wy,go)=>{"use strict";var cf=P();go.exports=!cf(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})});var R=n((xy,mo)=>{"use strict";var lf=Ie(),ze=Function.prototype.call;mo.exports=lf?ze.bind(ze):function(){return ze.apply(ze,arguments)}});var zr=n(Io=>{"use strict";var bo={}.propertyIsEnumerable,yo=Object.getOwnPropertyDescriptor,ff=yo&&!bo.call({1:2},1);Io.f=ff?function(e){var t=yo(this,e);return!!t&&t.enumerable}:bo});var Pe=n((Cy,So)=>{"use strict";So.exports=function(r,e){return{enumerable:!(r&1),configurable:!(r&2),writable:!(r&4),value:e}}});var Eo=n((Ay,Po)=>{"use strict";var df=T(),pf=P(),vf=Se(),Qr=Object,hf=df("".split);Po.exports=pf(function(){return!Qr("z").propertyIsEnumerable(0)})?function(r){return vf(r)==="String"?hf(r,""):Qr(r)}:Qr});var Ee=n((Ny,To)=>{"use strict";To.exports=function(r){return r==null}});var ee=n((Ly,qo)=>{"use strict";var gf=Ee(),mf=TypeError;qo.exports=function(r){if(gf(r))throw new mf("Can't call method on "+r);return r}});var W=n((ky,_o)=>{"use strict";var bf=Eo(),yf=ee();_o.exports=function(r){return bf(yf(r))}});var C=n((Dy,Oo)=>{"use strict";var If=S();Oo.exports=function(r){return typeof r=="object"?r!==null:If(r)}});var Te=n(($y,wo)=>{"use strict";wo.exports={}});var M=n((My,Ro)=>{"use strict";var Yr=Te(),Jr=I(),Sf=S(),xo=function(r){return Sf(r)?r:void 0};Ro.exports=function(r,e){return arguments.length<2?xo(Yr[r])||xo(Jr[r]):Yr[r]&&Yr[r][e]||Jr[r]&&Jr[r][e]}});var Qe=n((jy,Co)=>{"use strict";var Pf=T();Co.exports=Pf({}.isPrototypeOf)});var G=n((Fy,Lo)=>{"use strict";var Ef=I(),Ao=Ef.navigator,No=Ao&&Ao.userAgent;Lo.exports=No?String(No):""});var Zr=n((By,Fo)=>{"use strict";var jo=I(),Xr=G(),ko=jo.process,Do=jo.Deno,$o=ko&&ko.versions||Do&&Do.version,Mo=$o&&$o.v8,A,Ye;Mo&&(A=Mo.split("."),Ye=A[0]>0&&A[0]<4?1:+(A[0]+A[1]));!Ye&&Xr&&(A=Xr.match(/Edge\/(\d+)/),(!A||A[1]>=74)&&(A=Xr.match(/Chrome\/(\d+)/),A&&(Ye=+A[1])));Fo.exports=Ye});var et=n((Uy,Uo)=>{"use strict";var Bo=Zr(),Tf=P(),qf=I(),_f=qf.String;Uo.exports=!!Object.getOwnPropertySymbols&&!Tf(function(){var r=Symbol("symbol detection");return!_f(r)||!(Object(r)instanceof Symbol)||!Symbol.sham&&Bo&&Bo<41})});var rt=n((Vy,Vo)=>{"use strict";var Of=et();Vo.exports=Of&&!Symbol.sham&&typeof Symbol.iterator=="symbol"});var tt=n((Ky,Ko)=>{"use strict";var wf=M(),xf=S(),Rf=Qe(),Cf=rt(),Af=Object;Ko.exports=Cf?function(r){return typeof r=="symbol"}:function(r){var e=wf("Symbol");return xf(e)&&Rf(e.prototype,Af(r))}});var qe=n((Wy,Wo)=>{"use strict";var Nf=String;Wo.exports=function(r){try{return Nf(r)}catch(e){return"Object"}}});var j=n((Gy,Go)=>{"use strict";var Lf=S(),kf=qe(),Df=TypeError;Go.exports=function(r){if(Lf(r))return r;throw new Df(kf(r)+" is not a function")}});var Je=n((Hy,Ho)=>{"use strict";var $f=j(),Mf=Ee();Ho.exports=function(r,e){var t=r[e];return Mf(t)?void 0:$f(t)}});var Qo=n((zy,zo)=>{"use strict";var it=R(),ot=S(),nt=C(),jf=TypeError;zo.exports=function(r,e){var t,i;if(e==="string"&&ot(t=r.toString)&&!nt(i=it(t,r))||ot(t=r.valueOf)&&!nt(i=it(t,r))||e!=="string"&&ot(t=r.toString)&&!nt(i=it(t,r)))return i;throw new jf("Can't convert object to primitive value")}});var k=n((Qy,Yo)=>{"use strict";Yo.exports=!0});var Zo=n((Yy,Xo)=>{"use strict";var Jo=I(),Ff=Object.defineProperty;Xo.exports=function(r,e){try{Ff(Jo,r,{value:e,configurable:!0,writable:!0})}catch(t){Jo[r]=e}return e}});var _e=n((Jy,tn)=>{"use strict";var Bf=k(),Uf=I(),Vf=Zo(),en="__core-js_shared__",rn=tn.exports=Uf[en]||Vf(en,{});(rn.versions||(rn.versions=[])).push({version:"3.38.0",mode:Bf?"pure":"global",copyright:"\xA9 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.38.0/LICENSE",source:"https://github.com/zloirock/core-js"})});var at=n((Xy,nn)=>{"use strict";var on=_e();nn.exports=function(r,e){return on[r]||(on[r]=e||{})}});var st=n((Zy,an)=>{"use strict";var Kf=ee(),Wf=Object;an.exports=function(r){return Wf(Kf(r))}});var D=n((eI,sn)=>{"use strict";var Gf=T(),Hf=st(),zf=Gf({}.hasOwnProperty);sn.exports=Object.hasOwn||function(e,t){return zf(Hf(e),t)}});var ut=n((rI,un)=>{"use strict";var Qf=T(),Yf=0,Jf=Math.random(),Xf=Qf(1 .toString);un.exports=function(r){return"Symbol("+(r===void 0?"":r)+")_"+Xf(++Yf+Jf,36)}});var _=n((tI,ln)=>{"use strict";var Zf=I(),ed=at(),cn=D(),rd=ut(),td=et(),id=rt(),re=Zf.Symbol,ct=ed("wks"),od=id?re.for||re:re&&re.withoutSetter||rd;ln.exports=function(r){return cn(ct,r)||(ct[r]=td&&cn(re,r)?re[r]:od("Symbol."+r)),ct[r]}});var vn=n((iI,pn)=>{"use strict";var nd=R(),fn=C(),dn=tt(),ad=Je(),sd=Qo(),ud=_(),cd=TypeError,ld=ud("toPrimitive");pn.exports=function(r,e){if(!fn(r)||dn(r))return r;var t=ad(r,ld),i;if(t){if(e===void 0&&(e="default"),i=nd(t,r,e),!fn(i)||dn(i))return i;throw new cd("Can't convert object to primitive value")}return e===void 0&&(e="number"),sd(r,e)}});var lt=n((oI,hn)=>{"use strict";var fd=vn(),dd=tt();hn.exports=function(r){var e=fd(r,"string");return dd(e)?e:e+""}});var Xe=n((nI,mn)=>{"use strict";var pd=I(),gn=C(),ft=pd.document,vd=gn(ft)&&gn(ft.createElement);mn.exports=function(r){return vd?ft.createElement(r):{}}});var dt=n((aI,bn)=>{"use strict";var hd=q(),gd=P(),md=Xe();bn.exports=!hd&&!gd(function(){return Object.defineProperty(md("div"),"a",{get:function(){return 7}}).a!==7})});var Sn=n(In=>{"use strict";var bd=q(),yd=R(),Id=zr(),Sd=Pe(),Pd=W(),Ed=lt(),Td=D(),qd=dt(),yn=Object.getOwnPropertyDescriptor;In.f=bd?yn:function(e,t){if(e=Pd(e),t=Ed(t),qd)try{return yn(e,t)}catch(i){}if(Td(e,t))return Sd(!yd(Id.f,e,t),e[t])}});var pt=n((uI,Pn)=>{"use strict";var _d=P(),Od=S(),wd=/#|\.prototype\./,Oe=function(r,e){var t=Rd[xd(r)];return t===Ad?!0:t===Cd?!1:Od(e)?_d(e):!!e},xd=Oe.normalize=function(r){return String(r).replace(wd,".").toLowerCase()},Rd=Oe.data={},Cd=Oe.NATIVE="N",Ad=Oe.POLYFILL="P";Pn.exports=Oe});var we=n((cI,Tn)=>{"use strict";var En=Gr(),Nd=j(),Ld=Ie(),kd=En(En.bind);Tn.exports=function(r,e){return Nd(r),e===void 0?r:Ld?kd(r,e):function(){return r.apply(e,arguments)}}});var vt=n((lI,qn)=>{"use strict";var Dd=q(),$d=P();qn.exports=Dd&&$d(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})});var F=n((fI,_n)=>{"use strict";var Md=C(),jd=String,Fd=TypeError;_n.exports=function(r){if(Md(r))return r;throw new Fd(jd(r)+" is not an object")}});var H=n(wn=>{"use strict";var Bd=q(),Ud=dt(),Vd=vt(),Ze=F(),On=lt(),Kd=TypeError,ht=Object.defineProperty,Wd=Object.getOwnPropertyDescriptor,gt="enumerable",mt="configurable",bt="writable";wn.f=Bd?Vd?function(e,t,i){if(Ze(e),t=On(t),Ze(i),typeof e=="function"&&t==="prototype"&&"value"in i&&bt in i&&!i[bt]){var o=Wd(e,t);o&&o[bt]&&(e[t]=i.value,i={configurable:mt in i?i[mt]:o[mt],enumerable:gt in i?i[gt]:o[gt],writable:!1})}return ht(e,t,i)}:ht:function(e,t,i){if(Ze(e),t=On(t),Ze(i),Ud)try{return ht(e,t,i)}catch(o){}if("get"in i||"set"in i)throw new Kd("Accessors not supported");return"value"in i&&(e[t]=i.value),e}});var te=n((pI,xn)=>{"use strict";var Gd=q(),Hd=H(),zd=Pe();xn.exports=Gd?function(r,e,t){return Hd.f(r,e,zd(1,t))}:function(r,e,t){return r[e]=t,r}});var O=n((vI,Cn)=>{"use strict";var xe=I(),Qd=Kr(),Yd=Gr(),Jd=S(),Xd=Sn().f,Zd=pt(),ie=Te(),ep=we(),oe=te(),Rn=D();_e();var rp=function(r){var e=function(t,i,o){if(this instanceof e){switch(arguments.length){case 0:return new r;case 1:return new r(t);case 2:return new r(t,i)}return new r(t,i,o)}return Qd(r,this,arguments)};return e.prototype=r.prototype,e};Cn.exports=function(r,e){var t=r.target,i=r.global,o=r.stat,a=r.proto,u=i?xe:o?xe[t]:xe[t]&&xe[t].prototype,f=i?ie:ie[t]||oe(ie,t,{})[t],d=f.prototype,c,p,v,s,l,h,g,b,m;for(s in e)c=Zd(i?s:t+(o?".":"#")+s,r.forced),p=!c&&u&&Rn(u,s),h=f[s],p&&(r.dontCallGetSet?(m=Xd(u,s),g=m&&m.value):g=u[s]),l=p&&g?g:e[s],!(!c&&!a&&typeof h==typeof l)&&(r.bind&&p?b=ep(l,xe):r.wrap&&p?b=rp(l):a&&Jd(l)?b=Yd(l):b=l,(r.sham||l&&l.sham||h&&h.sham)&&oe(b,"sham",!0),oe(f,s,b),a&&(v=t+"Prototype",Rn(ie,v)||oe(ie,v,{}),oe(ie[v],s,l),r.real&&d&&(c||!d[s])&&oe(d,s,l)))}});var Nn=n((hI,An)=>{"use strict";var tp=Math.ceil,ip=Math.floor;An.exports=Math.trunc||function(e){var t=+e;return(t>0?ip:tp)(t)}});var er=n((gI,Ln)=>{"use strict";var op=Nn();Ln.exports=function(r){var e=+r;return e!==e||e===0?0:op(e)}});var Dn=n((mI,kn)=>{"use strict";var np=er(),ap=Math.max,sp=Math.min;kn.exports=function(r,e){var t=np(r);return t<0?ap(t+e,0):sp(t,e)}});var yt=n((bI,$n)=>{"use strict";var up=er(),cp=Math.min;$n.exports=function(r){var e=up(r);return e>0?cp(e,9007199254740991):0}});var It=n((yI,Mn)=>{"use strict";var lp=yt();Mn.exports=function(r){return lp(r.length)}});var St=n((II,Fn)=>{"use strict";var fp=W(),dp=Dn(),pp=It(),jn=function(r){return function(e,t,i){var o=fp(e),a=pp(o);if(a===0)return!r&&-1;var u=dp(i,a),f;if(r&&t!==t){for(;a>u;)if(f=o[u++],f!==f)return!0}else for(;a>u;u++)if((r||u in o)&&o[u]===t)return r||u||0;return!r&&-1}};Fn.exports={includes:jn(!0),indexOf:jn(!1)}});var Pt=n((SI,Bn)=>{"use strict";Bn.exports=function(){}});var Un=n(()=>{"use strict";var vp=O(),hp=St().includes,gp=P(),mp=Pt(),bp=gp(function(){return!Array(1).includes()});vp({target:"Array",proto:!0,forced:bp},{includes:function(e){return hp(this,e,arguments.length>1?arguments[1]:void 0)}});mp("includes")});var rr=n((TI,Vn)=>{"use strict";var yp=M();Vn.exports=yp});var Wn=n((qI,Kn)=>{"use strict";Un();var Ip=rr();Kn.exports=Ip("Array","includes")});var Hn=n((_I,Gn)=>{"use strict";var Sp=Wn();Gn.exports=Sp});var tr=n((OI,zn)=>{"use strict";var Pp=Hn();zn.exports=Pp});var ta=n(()=>{"use strict"});var xt=n((FI,ia)=>{"use strict";var Ce=I(),qp=G(),_p=Se(),or=function(r){return qp.slice(0,r.length)===r};ia.exports=function(){return or("Bun/")?"BUN":or("Cloudflare-Workers")?"CLOUDFLARE":or("Deno/")?"DENO":or("Node.js/")?"NODE":Ce.Bun&&typeof Bun.version=="string"?"BUN":Ce.Deno&&typeof Deno.version=="object"?"DENO":_p(Ce.process)==="process"?"NODE":Ce.window&&Ce.document?"BROWSER":"REST"}()});var nr=n((BI,oa)=>{"use strict";var Op=xt();oa.exports=Op==="NODE"});var ne=n((UI,na)=>{"use strict";var wp=te();na.exports=function(r,e,t,i){return i&&i.enumerable?r[e]=t:wp(r,e,t),r}});var sa=n((VI,aa)=>{"use strict";var xp=T(),Rp=j();aa.exports=function(r,e,t){try{return xp(Rp(Object.getOwnPropertyDescriptor(r,e)[t]))}catch(i){}}});var ca=n((KI,ua)=>{"use strict";var Cp=C();ua.exports=function(r){return Cp(r)||r===null}});var fa=n((WI,la)=>{"use strict";var Ap=ca(),Np=String,Lp=TypeError;la.exports=function(r){if(Ap(r))return r;throw new Lp("Can't set "+Np(r)+" as a prototype")}});var Rt=n((GI,da)=>{"use strict";var kp=sa(),Dp=C(),$p=ee(),Mp=fa();da.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var r=!1,e={},t;try{t=kp(Object.prototype,"__proto__","set"),t(e,[]),r=e instanceof Array}catch(i){}return function(o,a){return $p(o),Mp(a),Dp(o)&&(r?t(o,a):o.__proto__=a),o}}():void 0)});var ar=n((HI,va)=>{"use strict";var jp=_(),Fp=jp("toStringTag"),pa={};pa[Fp]="z";va.exports=String(pa)==="[object z]"});var Ae=n((zI,ha)=>{"use strict";var Bp=ar(),Up=S(),sr=Se(),Vp=_(),Kp=Vp("toStringTag"),Wp=Object,Gp=sr(function(){return arguments}())==="Arguments",Hp=function(r,e){try{return r[e]}catch(t){}};ha.exports=Bp?sr:function(r){var e,t,i;return r===void 0?"Undefined":r===null?"Null":typeof(t=Hp(e=Wp(r),Kp))=="string"?t:Gp?sr(e):(i=sr(e))==="Object"&&Up(e.callee)?"Arguments":i}});var ma=n((QI,ga)=>{"use strict";var zp=ar(),Qp=Ae();ga.exports=zp?{}.toString:function(){return"[object "+Qp(this)+"]"}});var Ne=n((YI,ya)=>{"use strict";var Yp=ar(),Jp=H().f,Xp=te(),Zp=D(),ev=ma(),rv=_(),ba=rv("toStringTag");ya.exports=function(r,e,t,i){var o=t?r:r&&r.prototype;o&&(Zp(o,ba)||Jp(o,ba,{configurable:!0,value:e}),i&&!Yp&&Xp(o,"toString",ev))}});var Sa=n((JI,Ia)=>{"use strict";var tv=H();Ia.exports=function(r,e,t){return tv.f(r,e,t)}});var Ta=n((XI,Ea)=>{"use strict";var iv=M(),ov=Sa(),nv=_(),av=q(),Pa=nv("species");Ea.exports=function(r){var e=iv(r);av&&e&&!e[Pa]&&ov(e,Pa,{configurable:!0,get:function(){return this}})}});var _a=n((ZI,qa)=>{"use strict";var sv=Qe(),uv=TypeError;qa.exports=function(r,e){if(sv(e,r))return r;throw new uv("Incorrect invocation")}});var At=n((eS,Oa)=>{"use strict";var cv=T(),lv=S(),Ct=_e(),fv=cv(Function.toString);lv(Ct.inspectSource)||(Ct.inspectSource=function(r){return fv(r)});Oa.exports=Ct.inspectSource});var Na=n((rS,Aa)=>{"use strict";var dv=T(),pv=P(),wa=S(),vv=Ae(),hv=M(),gv=At(),xa=function(){},Ra=hv("Reflect","construct"),Nt=/^\s*(?:class|function)\b/,mv=dv(Nt.exec),bv=!Nt.test(xa),Le=function(e){if(!wa(e))return!1;try{return Ra(xa,[],e),!0}catch(t){return!1}},Ca=function(e){if(!wa(e))return!1;switch(vv(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return bv||!!mv(Nt,gv(e))}catch(t){return!0}};Ca.sham=!0;Aa.exports=!Ra||pv(function(){var r;return Le(Le.call)||!Le(Object)||!Le(function(){r=!0})||r})?Ca:Le});var ka=n((tS,La)=>{"use strict";var yv=Na(),Iv=qe(),Sv=TypeError;La.exports=function(r){if(yv(r))return r;throw new Sv(Iv(r)+" is not a constructor")}});var Lt=n((iS,$a)=>{"use strict";var Da=F(),Pv=ka(),Ev=Ee(),Tv=_(),qv=Tv("species");$a.exports=function(r,e){var t=Da(r).constructor,i;return t===void 0||Ev(i=Da(t)[qv])?e:Pv(i)}});var kt=n((oS,Ma)=>{"use strict";var _v=M();Ma.exports=_v("document","documentElement")});var Fa=n((nS,ja)=>{"use strict";var Ov=T();ja.exports=Ov([].slice)});var Ua=n((aS,Ba)=>{"use strict";var wv=TypeError;Ba.exports=function(r,e){if(r<e)throw new wv("Not enough arguments");return r}});var Dt=n((sS,Va)=>{"use strict";var xv=G();Va.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(xv)});var Wt=n((uS,Xa)=>{"use strict";var w=I(),Rv=Kr(),Cv=we(),Ka=S(),Av=D(),Ja=P(),Wa=kt(),Nv=Fa(),Ga=Xe(),Lv=Ua(),kv=Dt(),Dv=nr(),Ut=w.setImmediate,Vt=w.clearImmediate,$v=w.process,$t=w.Dispatch,Mv=w.Function,Ha=w.MessageChannel,jv=w.String,Mt=0,ke={},za="onreadystatechange",De,z,jt,Ft;Ja(function(){De=w.location});var Kt=function(r){if(Av(ke,r)){var e=ke[r];delete ke[r],e()}},Bt=function(r){return function(){Kt(r)}},Qa=function(r){Kt(r.data)},Ya=function(r){w.postMessage(jv(r),De.protocol+"//"+De.host)};(!Ut||!Vt)&&(Ut=function(e){Lv(arguments.length,1);var t=Ka(e)?e:Mv(e),i=Nv(arguments,1);return ke[++Mt]=function(){Rv(t,void 0,i)},z(Mt),Mt},Vt=function(e){delete ke[e]},Dv?z=function(r){$v.nextTick(Bt(r))}:$t&&$t.now?z=function(r){$t.now(Bt(r))}:Ha&&!kv?(jt=new Ha,Ft=jt.port2,jt.port1.onmessage=Qa,z=Cv(Ft.postMessage,Ft)):w.addEventListener&&Ka(w.postMessage)&&!w.importScripts&&De&&De.protocol!=="file:"&&!Ja(Ya)?(z=Ya,w.addEventListener("message",Qa,!1)):za in Ga("script")?z=function(r){Wa.appendChild(Ga("script"))[za]=function(){Wa.removeChild(this),Kt(r)}}:z=function(r){setTimeout(Bt(r),0)});Xa.exports={set:Ut,clear:Vt}});var rs=n((cS,es)=>{"use strict";var Za=I(),Fv=q(),Bv=Object.getOwnPropertyDescriptor;es.exports=function(r){if(!Fv)return Za[r];var e=Bv(Za,r);return e&&e.value}});var Gt=n((lS,is)=>{"use strict";var ts=function(){this.head=null,this.tail=null};ts.prototype={add:function(r){var e={item:r,next:null},t=this.tail;t?t.next=e:this.head=e,this.tail=e},get:function(){var r=this.head;if(r){var e=this.head=r.next;return e===null&&(this.tail=null),r.item}}};is.exports=ts});var ns=n((fS,os)=>{"use strict";var Uv=G();os.exports=/ipad|iphone|ipod/i.test(Uv)&&typeof Pebble!="undefined"});var ss=n((dS,as)=>{"use strict";var Vv=G();as.exports=/web0s(?!.*chrome)/i.test(Vv)});var vs=n((pS,ps)=>{"use strict";var se=I(),Kv=rs(),us=we(),Ht=Wt().set,Wv=Gt(),Gv=Dt(),Hv=ns(),zv=ss(),zt=nr(),cs=se.MutationObserver||se.WebKitMutationObserver,ls=se.document,fs=se.process,ur=se.Promise,Jt=Kv("queueMicrotask"),ae,Qt,Yt,cr,ds;Jt||($e=new Wv,Me=function(){var r,e;for(zt&&(r=fs.domain)&&r.exit();e=$e.get();)try{e()}catch(t){throw $e.head&&ae(),t}r&&r.enter()},!Gv&&!zt&&!zv&&cs&&ls?(Qt=!0,Yt=ls.createTextNode(""),new cs(Me).observe(Yt,{characterData:!0}),ae=function(){Yt.data=Qt=!Qt}):!Hv&&ur&&ur.resolve?(cr=ur.resolve(void 0),cr.constructor=ur,ds=us(cr.then,cr),ae=function(){ds(Me)}):zt?ae=function(){fs.nextTick(Me)}:(Ht=us(Ht,se),ae=function(){Ht(Me)}),Jt=function(r){$e.head||ae(),$e.add(r)});var $e,Me;ps.exports=Jt});var gs=n((vS,hs)=>{"use strict";hs.exports=function(r,e){try{arguments.length===1?console.error(r):console.error(r,e)}catch(t){}}});var lr=n((hS,ms)=>{"use strict";ms.exports=function(r){try{return{error:!1,value:r()}}catch(e){return{error:!0,value:e}}}});var Is=n((gS,ys)=>{"use strict";var Qv=I(),Yv=S(),bs=Qv.WeakMap;ys.exports=Yv(bs)&&/native code/.test(String(bs))});var fr=n((mS,Ps)=>{"use strict";var Jv=at(),Xv=ut(),Ss=Jv("keys");Ps.exports=function(r){return Ss[r]||(Ss[r]=Xv(r))}});var dr=n((bS,Es)=>{"use strict";Es.exports={}});var ri=n((yS,_s)=>{"use strict";var Zv=Is(),qs=I(),eh=C(),rh=te(),Xt=D(),Zt=_e(),th=fr(),ih=dr(),Ts="Object already initialized",ei=qs.TypeError,oh=qs.WeakMap,pr,je,vr,nh=function(r){return vr(r)?je(r):pr(r,{})},ah=function(r){return function(e){var t;if(!eh(e)||(t=je(e)).type!==r)throw new ei("Incompatible receiver, "+r+" required");return t}};Zv||Zt.state?(N=Zt.state||(Zt.state=new oh),N.get=N.get,N.has=N.has,N.set=N.set,pr=function(r,e){if(N.has(r))throw new ei(Ts);return e.facade=r,N.set(r,e),e},je=function(r){return N.get(r)||{}},vr=function(r){return N.has(r)}):(Q=th("state"),ih[Q]=!0,pr=function(r,e){if(Xt(r,Q))throw new ei(Ts);return e.facade=r,rh(r,Q,e),e},je=function(r){return Xt(r,Q)?r[Q]:{}},vr=function(r){return Xt(r,Q)});var N,Q;_s.exports={set:pr,get:je,has:vr,enforce:nh,getterFor:ah}});var Y=n((IS,Os)=>{"use strict";var sh=I();Os.exports=sh.Promise});var ue=n((SS,Cs)=>{"use strict";var uh=I(),Fe=Y(),ch=S(),lh=pt(),fh=At(),dh=_(),ws=xt(),ph=k(),ti=Zr(),xs=Fe&&Fe.prototype,vh=dh("species"),ii=!1,Rs=ch(uh.PromiseRejectionEvent),hh=lh("Promise",function(){var r=fh(Fe),e=r!==String(Fe);if(!e&&ti===66||ph&&!(xs.catch&&xs.finally))return!0;if(!ti||ti<51||!/native code/.test(r)){var t=new Fe(function(a){a(1)}),i=function(a){a(function(){},function(){})},o=t.constructor={};if(o[vh]=i,ii=t.then(function(){})instanceof i,!ii)return!0}return!e&&(ws==="BROWSER"||ws==="DENO")&&!Rs});Cs.exports={CONSTRUCTOR:hh,REJECTION_EVENT:Rs,SUBCLASSING:ii}});var ce=n((PS,Ns)=>{"use strict";var As=j(),gh=TypeError,mh=function(r){var e,t;this.promise=new r(function(i,o){if(e!==void 0||t!==void 0)throw new gh("Bad Promise constructor");e=i,t=o}),this.resolve=As(e),this.reject=As(t)};Ns.exports.f=function(r){return new mh(r)}});var Xs=n(()=>{"use strict";var bh=O(),yh=k(),br=nr(),K=I(),pe=R(),Ls=ne(),ks=Rt(),Ih=Ne(),Sh=Ta(),Ph=j(),mr=S(),Eh=C(),Th=_a(),qh=Lt(),Fs=Wt().set,ui=vs(),_h=gs(),Oh=lr(),wh=Gt(),Bs=ri(),yr=Y(),ci=ue(),Us=ce(),Ir="Promise",Vs=ci.CONSTRUCTOR,xh=ci.REJECTION_EVENT,Rh=ci.SUBCLASSING,oi=Bs.getterFor(Ir),Ch=Bs.set,le=yr&&yr.prototype,J=yr,hr=le,Ks=K.TypeError,ni=K.document,li=K.process,ai=Us.f,Ah=ai,Nh=!!(ni&&ni.createEvent&&K.dispatchEvent),Ws="unhandledrejection",Lh="rejectionhandled",Ds=0,Gs=1,kh=2,fi=1,Hs=2,gr,$s,Dh,Ms,zs=function(r){var e;return Eh(r)&&mr(e=r.then)?e:!1},Qs=function(r,e){var t=e.value,i=e.state===Gs,o=i?r.ok:r.fail,a=r.resolve,u=r.reject,f=r.domain,d,c,p;try{o?(i||(e.rejection===Hs&&Mh(e),e.rejection=fi),o===!0?d=t:(f&&f.enter(),d=o(t),f&&(f.exit(),p=!0)),d===r.promise?u(new Ks("Promise-chain cycle")):(c=zs(d))?pe(c,d,a,u):a(d)):u(t)}catch(v){f&&!p&&f.exit(),u(v)}},Ys=function(r,e){r.notified||(r.notified=!0,ui(function(){for(var t=r.reactions,i;i=t.get();)Qs(i,r);r.notified=!1,e&&!r.rejection&&$h(r)}))},Js=function(r,e,t){var i,o;Nh?(i=ni.createEvent("Event"),i.promise=e,i.reason=t,i.initEvent(r,!1,!0),K.dispatchEvent(i)):i={promise:e,reason:t},!xh&&(o=K["on"+r])?o(i):r===Ws&&_h("Unhandled promise rejection",t)},$h=function(r){pe(Fs,K,function(){var e=r.facade,t=r.value,i=js(r),o;if(i&&(o=Oh(function(){br?li.emit("unhandledRejection",t,e):Js(Ws,e,t)}),r.rejection=br||js(r)?Hs:fi,o.error))throw o.value})},js=function(r){return r.rejection!==fi&&!r.parent},Mh=function(r){pe(Fs,K,function(){var e=r.facade;br?li.emit("rejectionHandled",e):Js(Lh,e,r.value)})},fe=function(r,e,t){return function(i){r(e,i,t)}},de=function(r,e,t){r.done||(r.done=!0,t&&(r=t),r.value=e,r.state=kh,Ys(r,!0))},si=function(r,e,t){if(!r.done){r.done=!0,t&&(r=t);try{if(r.facade===e)throw new Ks("Promise can't be resolved itself");var i=zs(e);i?ui(function(){var o={done:!1};try{pe(i,e,fe(si,o,r),fe(de,o,r))}catch(a){de(o,a,r)}}):(r.value=e,r.state=Gs,Ys(r,!1))}catch(o){de({done:!1},o,r)}}};if(Vs&&(J=function(e){Th(this,hr),Ph(e),pe(gr,this);var t=oi(this);try{e(fe(si,t),fe(de,t))}catch(i){de(t,i)}},hr=J.prototype,gr=function(e){Ch(this,{type:Ir,done:!1,notified:!1,parent:!1,reactions:new wh,rejection:!1,state:Ds,value:void 0})},gr.prototype=Ls(hr,"then",function(e,t){var i=oi(this),o=ai(qh(this,J));return i.parent=!0,o.ok=mr(e)?e:!0,o.fail=mr(t)&&t,o.domain=br?li.domain:void 0,i.state===Ds?i.reactions.add(o):ui(function(){Qs(o,i)}),o.promise}),$s=function(){var r=new gr,e=oi(r);this.promise=r,this.resolve=fe(si,e),this.reject=fe(de,e)},Us.f=ai=function(r){return r===J||r===Dh?new $s(r):Ah(r)},!yh&&mr(yr)&&le!==Object.prototype)){Ms=le.then,Rh||Ls(le,"then",function(e,t){var i=this;return new J(function(o,a){pe(Ms,i,o,a)}).then(e,t)},{unsafe:!0});try{delete le.constructor}catch(r){}ks&&ks(le,hr)}bh({global:!0,constructor:!0,wrap:!0,forced:Vs},{Promise:J});Ih(J,Ir,!1,!0);Sh(Ir)});var X=n((qS,Zs)=>{"use strict";Zs.exports={}});var ru=n((_S,eu)=>{"use strict";var jh=_(),Fh=X(),Bh=jh("iterator"),Uh=Array.prototype;eu.exports=function(r){return r!==void 0&&(Fh.Array===r||Uh[Bh]===r)}});var di=n((OS,iu)=>{"use strict";var Vh=Ae(),tu=Je(),Kh=Ee(),Wh=X(),Gh=_(),Hh=Gh("iterator");iu.exports=function(r){if(!Kh(r))return tu(r,Hh)||tu(r,"@@iterator")||Wh[Vh(r)]}});var nu=n((wS,ou)=>{"use strict";var zh=R(),Qh=j(),Yh=F(),Jh=qe(),Xh=di(),Zh=TypeError;ou.exports=function(r,e){var t=arguments.length<2?Xh(r):e;if(Qh(t))return Yh(zh(t,r));throw new Zh(Jh(r)+" is not iterable")}});var uu=n((xS,su)=>{"use strict";var eg=R(),au=F(),rg=Je();su.exports=function(r,e,t){var i,o;au(r);try{if(i=rg(r,"return"),!i){if(e==="throw")throw t;return t}i=eg(i,r)}catch(a){o=!0,i=a}if(e==="throw")throw t;if(o)throw i;return au(i),t}});var Pr=n((RS,du)=>{"use strict";var tg=we(),ig=R(),og=F(),ng=qe(),ag=ru(),sg=It(),cu=Qe(),ug=nu(),cg=di(),lu=uu(),lg=TypeError,Sr=function(r,e){this.stopped=r,this.result=e},fu=Sr.prototype;du.exports=function(r,e,t){var i=t&&t.that,o=!!(t&&t.AS_ENTRIES),a=!!(t&&t.IS_RECORD),u=!!(t&&t.IS_ITERATOR),f=!!(t&&t.INTERRUPTED),d=tg(e,i),c,p,v,s,l,h,g,b=function(y){return c&&lu(c,"normal",y),new Sr(!0,y)},m=function(y){return o?(og(y),f?d(y[0],y[1],b):d(y[0],y[1])):f?d(y,b):d(y)};if(a)c=r.iterator;else if(u)c=r;else{if(p=cg(r),!p)throw new lg(ng(r)+" is not iterable");if(ag(p)){for(v=0,s=sg(r);s>v;v++)if(l=m(r[v]),l&&cu(fu,l))return l;return new Sr(!1)}c=ug(r,p)}for(h=a?r.next:c.next;!(g=ig(h,c)).done;){try{l=m(g.value)}catch(y){lu(c,"throw",y)}if(typeof l=="object"&&l&&cu(fu,l))return l}return new Sr(!1)}});var mu=n((CS,gu)=>{"use strict";var fg=_(),vu=fg("iterator"),hu=!1;try{pu=0,pi={next:function(){return{done:!!pu++}},return:function(){hu=!0}},pi[vu]=function(){return this},Array.from(pi,function(){throw 2})}catch(r){}var pu,pi;gu.exports=function(r,e){try{if(!e&&!hu)return!1}catch(o){return!1}var t=!1;try{var i={};i[vu]=function(){return{next:function(){return{done:t=!0}}}},r(i)}catch(o){}return t}});var vi=n((AS,bu)=>{"use strict";var dg=Y(),pg=mu(),vg=ue().CONSTRUCTOR;bu.exports=vg||!pg(function(r){dg.all(r).then(void 0,function(){})})});var yu=n(()=>{"use strict";var hg=O(),gg=R(),mg=j(),bg=ce(),yg=lr(),Ig=Pr(),Sg=vi();hg({target:"Promise",stat:!0,forced:Sg},{all:function(e){var t=this,i=bg.f(t),o=i.resolve,a=i.reject,u=yg(function(){var f=mg(t.resolve),d=[],c=0,p=1;Ig(e,function(v){var s=c++,l=!1;p++,gg(f,t,v).then(function(h){l||(l=!0,d[s]=h,--p||o(d))},a)}),--p||o(d)});return u.error&&a(u.value),i.promise}})});var Su=n(()=>{"use strict";var Pg=O(),Eg=k(),Tg=ue().CONSTRUCTOR,gi=Y(),qg=M(),_g=S(),Og=ne(),Iu=gi&&gi.prototype;Pg({target:"Promise",proto:!0,forced:Tg,real:!0},{catch:function(r){return this.then(void 0,r)}});!Eg&&_g(gi)&&(hi=qg("Promise").prototype.catch,Iu.catch!==hi&&Og(Iu,"catch",hi,{unsafe:!0}));var hi});var Pu=n(()=>{"use strict";var wg=O(),xg=R(),Rg=j(),Cg=ce(),Ag=lr(),Ng=Pr(),Lg=vi();wg({target:"Promise",stat:!0,forced:Lg},{race:function(e){var t=this,i=Cg.f(t),o=i.reject,a=Ag(function(){var u=Rg(t.resolve);Ng(e,function(f){xg(u,t,f).then(i.resolve,o)})});return a.error&&o(a.value),i.promise}})});var Eu=n(()=>{"use strict";var kg=O(),Dg=ce(),$g=ue().CONSTRUCTOR;kg({target:"Promise",stat:!0,forced:$g},{reject:function(e){var t=Dg.f(this),i=t.reject;return i(e),t.promise}})});var mi=n((BS,Tu)=>{"use strict";var Mg=F(),jg=C(),Fg=ce();Tu.exports=function(r,e){if(Mg(r),jg(e)&&e.constructor===r)return e;var t=Fg.f(r),i=t.resolve;return i(e),t.promise}});var Ou=n(()=>{"use strict";var Bg=O(),Ug=M(),qu=k(),Vg=Y(),_u=ue().CONSTRUCTOR,Kg=mi(),Wg=Ug("Promise"),Gg=qu&&!_u;Bg({target:"Promise",stat:!0,forced:qu||_u},{resolve:function(e){return Kg(Gg&&this===Wg?Vg:this,e)}})});var wu=n(()=>{"use strict";Xs();yu();Su();Pu();Eu();Ou()});var Au=n(()=>{"use strict";var Hg=O(),zg=k(),Er=Y(),Qg=P(),Ru=M(),Cu=S(),Yg=Lt(),xu=mi(),Jg=ne(),yi=Er&&Er.prototype,Xg=!!Er&&Qg(function(){yi.finally.call({then:function(){}},function(){})});Hg({target:"Promise",proto:!0,real:!0,forced:Xg},{finally:function(r){var e=Yg(this,Ru("Promise")),t=Cu(r);return this.then(t?function(i){return xu(e,r()).then(function(){return i})}:r,t?function(i){return xu(e,r()).then(function(){throw i})}:r)}});!zg&&Cu(Er)&&(bi=Ru("Promise").prototype.finally,yi.finally!==bi&&Jg(yi,"finally",bi,{unsafe:!0}));var bi});var Lu=n((zS,Nu)=>{"use strict";ta();wu();Au();var Zg=rr();Nu.exports=Zg("Promise","finally")});var Du=n((QS,ku)=>{"use strict";var em=Lu();ku.exports=em});var Mu=n((YS,$u)=>{"use strict";var rm=Du();$u.exports=rm});var Fu=n((JS,ju)=>{"use strict";var tm=P();ju.exports=!tm(function(){function r(){}return r.prototype.constructor=null,Object.getPrototypeOf(new r)!==r.prototype})});var Tr=n((XS,Uu)=>{"use strict";var im=D(),om=S(),nm=st(),am=fr(),sm=Fu(),Bu=am("IE_PROTO"),Ii=Object,um=Ii.prototype;Uu.exports=sm?Ii.getPrototypeOf:function(r){var e=nm(r);if(im(e,Bu))return e[Bu];var t=e.constructor;return om(t)&&e instanceof t?t.prototype:e instanceof Ii?um:null}});var Wu=n((ZS,Ku)=>{"use strict";var cm=T(),Si=D(),lm=W(),fm=St().indexOf,dm=dr(),Vu=cm([].push);Ku.exports=function(r,e){var t=lm(r),i=0,o=[],a;for(a in t)!Si(dm,a)&&Si(t,a)&&Vu(o,a);for(;e.length>i;)Si(t,a=e[i++])&&(~fm(o,a)||Vu(o,a));return o}});var Pi=n((eP,Gu)=>{"use strict";Gu.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]});var Ei=n((rP,Hu)=>{"use strict";var pm=Wu(),vm=Pi();Hu.exports=Object.keys||function(e){return pm(e,vm)}});var Zu=n((tP,Xu)=>{"use strict";var Qu=q(),hm=P(),Yu=T(),gm=Tr(),mm=Ei(),bm=W(),ym=zr().f,Ju=Yu(ym),Im=Yu([].push),Sm=Qu&&hm(function(){var r=Object.create(null);return r[2]=2,!Ju(r,2)}),zu=function(r){return function(e){for(var t=bm(e),i=mm(t),o=Sm&&gm(t)===null,a=i.length,u=0,f=[],d;a>u;)d=i[u++],(!Qu||(o?d in t:Ju(t,d)))&&Im(f,r?[d,t[d]]:t[d]);return f}};Xu.exports={entries:zu(!0),values:zu(!1)}});var ec=n(()=>{"use strict";var Pm=O(),Em=Zu().entries;Pm({target:"Object",stat:!0},{entries:function(e){return Em(e)}})});var tc=n((nP,rc)=>{"use strict";ec();var Tm=Te();rc.exports=Tm.Object.entries});var oc=n((aP,ic)=>{"use strict";var qm=tc();ic.exports=qm});var qr=n((sP,nc)=>{"use strict";var _m=oc();nc.exports=_m});var uc=n((uP,sc)=>{"use strict";var Ti=q(),Om=D(),ac=Function.prototype,wm=Ti&&Object.getOwnPropertyDescriptor,qi=Om(ac,"name"),xm=qi&&function(){}.name==="something",Rm=qi&&(!Ti||Ti&&wm(ac,"name").configurable);sc.exports={EXISTS:qi,PROPER:xm,CONFIGURABLE:Rm}});var lc=n(cc=>{"use strict";var Cm=q(),Am=vt(),Nm=H(),Lm=F(),km=W(),Dm=Ei();cc.f=Cm&&!Am?Object.defineProperties:function(e,t){Lm(e);for(var i=km(t),o=Dm(t),a=o.length,u=0,f;a>u;)Nm.f(e,f=o[u++],i[f]);return e}});var xi=n((lP,mc)=>{"use strict";var $m=F(),Mm=lc(),fc=Pi(),jm=dr(),Fm=kt(),Bm=Xe(),Um=fr(),dc=">",pc="<",Oi="prototype",wi="script",hc=Um("IE_PROTO"),_i=function(){},gc=function(r){return pc+wi+dc+r+pc+"/"+wi+dc},vc=function(r){r.write(gc("")),r.close();var e=r.parentWindow.Object;return r=null,e},Vm=function(){var r=Bm("iframe"),e="java"+wi+":",t;return r.style.display="none",Fm.appendChild(r),r.src=String(e),t=r.contentWindow.document,t.open(),t.write(gc("document.F=Object")),t.close(),t.F},_r,Or=function(){try{_r=new ActiveXObject("htmlfile")}catch(e){}Or=typeof document!="undefined"?document.domain&&_r?vc(_r):Vm():vc(_r);for(var r=fc.length;r--;)delete Or[Oi][fc[r]];return Or()};jm[hc]=!0;mc.exports=Object.create||function(e,t){var i;return e!==null?(_i[Oi]=$m(e),i=new _i,_i[Oi]=null,i[hc]=e):i=Or(),t===void 0?i:Mm.f(i,t)}});var Ni=n((fP,Ic)=>{"use strict";var Km=P(),Wm=S(),Gm=C(),Hm=xi(),bc=Tr(),zm=ne(),Qm=_(),Ym=k(),Ai=Qm("iterator"),yc=!1,B,Ri,Ci;[].keys&&(Ci=[].keys(),"next"in Ci?(Ri=bc(bc(Ci)),Ri!==Object.prototype&&(B=Ri)):yc=!0);var Jm=!Gm(B)||Km(function(){var r={};return B[Ai].call(r)!==r});Jm?B={}:Ym&&(B=Hm(B));Wm(B[Ai])||zm(B,Ai,function(){return this});Ic.exports={IteratorPrototype:B,BUGGY_SAFARI_ITERATORS:yc}});var Pc=n((dP,Sc)=>{"use strict";var Xm=Ni().IteratorPrototype,Zm=xi(),eb=Pe(),rb=Ne(),tb=X(),ib=function(){return this};Sc.exports=function(r,e,t,i){var o=e+" Iterator";return r.prototype=Zm(Xm,{next:eb(+!i,t)}),rb(r,o,!1,!0),tb[o]=ib,r}});var Nc=n((pP,Ac)=>{"use strict";var ob=O(),nb=R(),wr=k(),Rc=uc(),ab=S(),sb=Pc(),Ec=Tr(),Tc=Rt(),ub=Ne(),cb=te(),Li=ne(),lb=_(),qc=X(),Cc=Ni(),fb=Rc.PROPER,db=Rc.CONFIGURABLE,_c=Cc.IteratorPrototype,xr=Cc.BUGGY_SAFARI_ITERATORS,Be=lb("iterator"),Oc="keys",Ue="values",wc="entries",xc=function(){return this};Ac.exports=function(r,e,t,i,o,a,u){sb(t,e,i);var f=function(m){if(m===o&&s)return s;if(!xr&&m&&m in p)return p[m];switch(m){case Oc:return function(){return new t(this,m)};case Ue:return function(){return new t(this,m)};case wc:return function(){return new t(this,m)}}return function(){return new t(this)}},d=e+" Iterator",c=!1,p=r.prototype,v=p[Be]||p["@@iterator"]||o&&p[o],s=!xr&&v||f(o),l=e==="Array"&&p.entries||v,h,g,b;if(l&&(h=Ec(l.call(new r)),h!==Object.prototype&&h.next&&(!wr&&Ec(h)!==_c&&(Tc?Tc(h,_c):ab(h[Be])||Li(h,Be,xc)),ub(h,d,!0,!0),wr&&(qc[d]=xc))),fb&&o===Ue&&v&&v.name!==Ue&&(!wr&&db?cb(p,"name",Ue):(c=!0,s=function(){return nb(v,this)})),o)if(g={values:f(Ue),keys:a?s:f(Oc),entries:f(wc)},u)for(b in g)(xr||c||!(b in p))&&Li(p,b,g[b]);else ob({target:e,proto:!0,forced:xr||c},g);return(!wr||u)&&p[Be]!==s&&Li(p,Be,s,{name:o}),qc[e]=s,g}});var kc=n((vP,Lc)=>{"use strict";Lc.exports=function(r,e){return{value:r,done:e}}});var Di=n((hP,Fc)=>{"use strict";var pb=W(),ki=Pt(),Dc=X(),Mc=ri(),vb=H().f,hb=Nc(),Rr=kc(),gb=k(),mb=q(),jc="Array Iterator",bb=Mc.set,yb=Mc.getterFor(jc);Fc.exports=hb(Array,"Array",function(r,e){bb(this,{type:jc,target:pb(r),index:0,kind:e})},function(){var r=yb(this),e=r.target,t=r.index++;if(!e||t>=e.length)return r.target=void 0,Rr(void 0,!0);switch(r.kind){case"keys":return Rr(t,!1);case"values":return Rr(e[t],!1)}return Rr([t,e[t]],!1)},"values");var $c=Dc.Arguments=Dc.Array;ki("keys");ki("values");ki("entries");if(!gb&&mb&&$c.name!=="values")try{vb($c,"name",{value:"values"})}catch(r){}});var Uc=n((gP,Bc)=>{"use strict";var Ib=q(),Sb=H(),Pb=Pe();Bc.exports=function(r,e,t){Ib?Sb.f(r,e,Pb(0,t)):r[e]=t}});var Vc=n(()=>{"use strict";var Eb=O(),Tb=Pr(),qb=Uc();Eb({target:"Object",stat:!0},{fromEntries:function(e){var t={};return Tb(e,function(i,o){qb(t,i,o)},{AS_ENTRIES:!0}),t}})});var Wc=n((yP,Kc)=>{"use strict";Di();Vc();var _b=Te();Kc.exports=_b.Object.fromEntries});var Hc=n((IP,Gc)=>{"use strict";Gc.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 Qc=n(()=>{"use strict";Di();var Ob=Hc(),wb=I(),xb=Ne(),zc=X();for(Cr in Ob)xb(wb[Cr],Cr),zc[Cr]=zc.Array;var Cr});var Jc=n((EP,Yc)=>{"use strict";var Rb=Wc();Qc();Yc.exports=Rb});var Zc=n((TP,Xc)=>{"use strict";var Cb=Jc();Xc.exports=Cb});var Vi=n((vE,pl)=>{"use strict";var jb=Ae(),Fb=String;pl.exports=function(r){if(jb(r)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return Fb(r)}});var hl=n((hE,vl)=>{"use strict";var Bb=er(),Ub=Vi(),Vb=ee(),Kb=RangeError;vl.exports=function(e){var t=Ub(Vb(this)),i="",o=Bb(e);if(o<0||o===1/0)throw new Kb("Wrong number of repetitions");for(;o>0;(o>>>=1)&&(t+=t))o&1&&(i+=t);return i}});var Il=n((gE,yl)=>{"use strict";var bl=T(),Wb=yt(),gl=Vi(),Gb=hl(),Hb=ee(),zb=bl(Gb),Qb=bl("".slice),Yb=Math.ceil,ml=function(r){return function(e,t,i){var o=gl(Hb(e)),a=Wb(t),u=o.length,f=i===void 0?" ":gl(i),d,c;return a<=u||f===""?o:(d=a-u,c=zb(f,Yb(d/f.length)),c.length>d&&(c=Qb(c,0,d)),r?o+c:c+o)}};yl.exports={start:ml(!1),end:ml(!0)}});var Pl=n((mE,Sl)=>{"use strict";var Jb=G();Sl.exports=/Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(Jb)});var El=n(()=>{"use strict";var Xb=O(),Zb=Il().start,ey=Pl();Xb({target:"String",proto:!0,forced:ey},{padStart:function(e){return Zb(this,e,arguments.length>1?arguments[1]:void 0)}})});var ql=n((IE,Tl)=>{"use strict";El();var ry=rr();Tl.exports=ry("String","padStart")});var Ol=n((SE,_l)=>{"use strict";var ty=ql();_l.exports=ty});var xl=n((PE,wl)=>{"use strict";var iy=Ol();wl.exports=iy});var zi=$(tr(),1);var Re=(u=>(u.PROD="prod",u.VK_ALIAS="vk_alias",u.VIDEOTEST="videotest",u.TEST="test",u.OKCDN="okcdn",u.AUTO="auto",u))(Re||{}),Et=(c=>(c.Q144P="mobile",c.Q240P="lowest",c.Q360P="low",c.Q480P="medium",c.Q720P="high",c.Q1080P="fullhd",c.Q1440P="quadhd",c.Q2160P="ultrahd",c.UNKNOWN="unknown",c))(Et||{}),Tt=(l=>(l.MP4="mp4",l.DASH="dash",l.DASH_SEP="dash_sep",l.ONDEMAND_DASH="ondemand_dash",l.HLS="hls",l.ONDEMAND_HLS="ondemand_hls",l.WEBM="webm",l.AV1="av1",l.ONDEMAND_DASH_LIVE="ondemand_dash_live",l.ONDEMAND_HLS_LIVE="ondemand_hls_live",l.WEBRTC="webrtc",l.UNKNOWN="unknown",l.RTMP="rtmp",l))(Tt||{});var qt=(i=>(i.HTTP1="http1",i.HTTP2="http2",i.HTTP3="http3",i))(qt||{});var _t=(f=>(f.SLIDER="slider",f.DOUBLE_TAP="double_tap",f.TIME_CODE="time_code",f.EPISODE="episode",f.REWIND="rewind",f.LIVE="live",f.UNKNOWN="unknown",f))(_t||{}),Qn=(a=>(a.GRAPH_SHOW="iGraphShow",a.GRAPH_HIDE="iGraphHide",a.NEXT_AREA="iNextChapterArea",a.NEXT_BUTTON="iNextChapterBtn",a.WATCH_AGAIN="iWatchAgainBtn",a))(Qn||{}),Yn={action_play:"ap",action_play_interactive:"api",first_bytes:"fb",player_ready:"pr",first_frame:"ff",seek:"sk",watch_coverage_record:"wr",watch_coverage_live:"wl",empty_buffer:"eb",action_stop:"as",close_at_empty_buffer:"cb",content_error:"er",player_interface_click:"pc",next_movie:"nm",track_switch:"ts",failover:"fo",quality:"qt"},Jn={vsid:"si",isid:"is",vid:"vi",place:"pl",quality:"qt",cdn_host:"ch",stat_type:"st",param:"pm",vk_app_id:"va",track_code:"tc",connection_type:"cnt",connection_reused:"cr",cached_data:"cd",live:"lv",muted:"mu",mode:"mo",subtitles:"sb",failover:"fo",download_speed:"ds",manual_quality:"mq",ref_domain:"rd",direct_url:"du"},Xn={unknown:"un",mobile:"m",lowest:"ls",low:"l",medium:"md",high:"h",fullhd:"f",quadhd:"q",ultrahd:"u"},Zn={pip:"pi",fullscreen:"fs",external:"ex",prefetch:"pr",airplay:"ap",chromecast:"cc",invisible:"iv"};import{fillWithDefault as Ep}from"@vkontakte/videoplayer-shared/es2018";var ir="__VERSION__",ea="CIOPGQJGDIHBABABA",Ot={prod:"https://api.ok.ru",vk_alias:"https://api.mycdn.me",videotest:"https://videotestapi.ok.ru/api",test:"https://apitest.ok.ru",okcdn:"https://api.okcdn.ru",auto:""};var Tp={apiEnv:"vk_alias",apiKey:ea,requestRetryCount:1,firstFlushTime:5e3,flushDebounceTime:1e4,flushMaxWait:6e4,storageExpiration:36*60*60*1e3,watchCoverageInterval:15e3,disabledOperations:["quality"],disabledCustomFields:[],shorten:!0,maxLoops:100,embedUrlParams:[],useBeacon:!0,synchronizeTime:!0,debugLog:!1,clearStorageAtUnload:!0,useVKComIsMobileLogic:!1,backoff:{start:1e3,factor:1.5,max:5*60*1e3,random:.1}},ra=r=>Ep(r,Tp);function wt(){let r="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),e=new Array(36),t=0,i,o;for(o=0;o<36;o++)o===8||o===13||o===18||o===23?e[o]="-":o===14?e[o]="4":(t<=2&&(t=33554432+Math.random()*16777216|0),i=t&15,t=t>>4,e[o]=r[o===19?i&3|8:i]);return e.join("")}import{assertNonNullable as ly,combine as Dl,fromEvent as $l,isNonNullable as me,isNullable as Ml,merge as fy,now as U,observableFrom as dy,once as py,safeStorage as Fr,Subject as vy,Subscription as Qi,ValueSubject as Br,createURL as jl}from"@vkontakte/videoplayer-shared/es2018";import{Logger as hy,detectEmbed as gy}from"@vkontakte/videoplayer-shared/es2018";var Ar=$(Mu(),1);var el=$(qr(),1),rl=$(Zc(),1);var tl=r=>{var o;let{operation:e,custom:t}=r,i=(0,rl.default)((0,el.default)(t).map(([a,u])=>{var c,p,v;let f=(c=Jn[a])!=null?c:a,d=u;return u&&(a==="mode"?d=(p=Zn[u])!=null?p:u:a==="quality"&&(d=(v=Xn[u])!=null?v:u)),[f,d]}));return{...r,operation:(o=Yn[e])!=null?o:e,custom:i}};import{ValueSubject as Ab,getExponentialDelay as Nb,ErrorCategory as ve}from"@vkontakte/videoplayer-shared/es2018";var Lb=/Mobile|mini|Fennec|Android|iP(ad|od|hone)|opera (mini|mobi)/i,Ve=class{constructor(e){this.consequentAuthErrors=0;this.authorized$=new Ab(!1);this.params=e}async authorize(e){return this.authToken=e!=null?e:await this.refreshAuthToken(),this._authorizeWithBackoff()}logBeacon(e){let t="log.externalLog",i=this.createLogParams(e),o=this.sessionKey;if(!o)return;this.params.apiTransport.sendBeacon(t,i,o)||this.logRequest(e).catch(()=>{})}async logRequest(e){var u;let t="log.externalLog",i=this.createLogParams(e),o=(u=this.sessionKey)!=null?u:await this._authorizeWithBackoff();if(!o)return;let a=async(f,d=this.params.config.requestRetryCount)=>{try{return await this.params.apiTransport.sendRequest(t,i,o)}catch(c){if(!c||!("error_code"in c)){this.params.error$.next({id:"logRequestUnknown",category:ve.NETWORK,message:`Unknown ${t} error`,thrown:c});return}let p=c==null?void 0:c.error_code;switch(p){case 102:case 103:case 104:return this.authorized$.next(!1),this.sessionKey=await this._authorizeWithBackoff(),d>0?a(f,d-1):void 0;case 401:return this.authorized$.next(!1),this.authToken=await this.refreshAuthToken(),this.sessionKey=await this._authorizeWithBackoff(),d>0?a(f,d-1):void 0;default:{this.params.error$.next({id:`LogRequest#${p}`,category:ve.EXTERNAL_API,message:`${t} error`,data:c});return}}}};return a(e)}destroy(){window.clearTimeout(this.backoffTimeoutId),this.backoffTimeoutId=0}async refreshAuthToken(){if(this.params.refreshAuthToken)return this.refreshAuthTokenPromise||(this.refreshAuthTokenPromise=(0,Ar.default)(this.params.refreshAuthToken(),()=>{this.refreshAuthTokenPromise=void 0})),this.refreshAuthTokenPromise}createLogParams(e){let t="WEB",i=!1,o=`@vkontakte/videoplayer-statistics:${ir}`;if(this.params.config.useVKComIsMobileLogic){let{appVersion:a}=window.navigator;i=Lb.test(a)}else this.params.mobile&&(i=!0);return i&&(t="M_WEB"),this.params.vktvVersion&&(t="SMART_TV",o=this.params.vktvVersion),{collector:"ok.mobile.apps.video",data:JSON.stringify({application:o,platform:t,items:this.params.config.shorten?e.map(tl):e})}}_authorizeWithBackoff(){if(!this.consequentAuthErrors)return this._authorize();let e=Nb(this.consequentAuthErrors,this.params.config.backoff);return new Promise(t=>{this.backoffTimeoutId||(this.backoffTimeoutId=window.setTimeout(()=>{(0,Ar.default)(this._authorize().then(t).catch(i=>this.params.error$.next({id:"AuthorizeBackoff",category:ve.NETWORK,message:"Otherwise unhandled error in authorization",thrown:i})),()=>this.backoffTimeoutId=0)},e))})}async _authorize(){if(this.authorizePromise)return this.authorizePromise;this.sessionKey=void 0,this.authorized$.next(!1);let e="auth.anonymLogin",t={session_data:{version:2,device_id:this.params.deviceId,client_version:ir.split("-")[0],client_type:"SDK_JS"}};return this.authToken!==void 0&&(t.session_data.auth_token=this.authToken,t.session_data.version=3),this.authorizePromise=(0,Ar.default)(this.params.apiTransport.sendRequest(e,t).then(i=>{var o;return(!i||!i.session_key)&&this.params.error$.next({id:"AuthorizeFailed",category:ve.EXTERNAL_API,message:"No session key",data:i}),this.sessionKey=(o=i==null?void 0:i.session_key)!=null?o:void 0,this.sessionKey}).catch(async i=>{this.sessionKey=void 0;let o=i==null?void 0:i.error_code;switch(o){case 401:return this.authToken=await this.refreshAuthToken(),this._authorizeWithBackoff()}o?this.params.error$.next({id:`Authorize#${o}`,category:ve.EXTERNAL_API,message:"authorize error",data:i}):this.params.error$.next({id:"AuthorizeUnknown",category:ve.NETWORK,message:"authorize error",thrown:i})}),()=>{this.authorizePromise=void 0,this.consequentAuthErrors=this.sessionKey?0:this.consequentAuthErrors+1,this.authorized$.next(this.sessionKey!==void 0)}),this.authorizePromise}};var Nr=class{constructor(){Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}addEventListener(e,t,i){e in this.listeners||(this.listeners[e]=[]),this.listeners[e].push({callback:t,options:i})}removeEventListener(e,t){if(!(e in this.listeners))return;let i=this.listeners[e];for(let o=0,a=i.length;o<a;o++)if(i[o].callback===t){i.splice(o,1);return}}dispatchEvent(e){if(!(e.type in this.listeners))return;let i=this.listeners[e.type].slice();for(let o=0,a=i.length;o<a;o++){let u=i[o];try{u.callback.call(this,e)}catch(f){Promise.resolve().then(()=>{throw f})}u.options&&u.options.once&&this.removeEventListener(e.type,u.callback)}return!e.defaultPrevented}},he=class extends Nr{constructor(){super(),this.listeners||Nr.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(e){e.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,e)),super.dispatchEvent(e)}},Ke=class{constructor(){Object.defineProperty(this,"signal",{value:new he,writable:!0,configurable:!0})}abort(e){let t;try{t=new Event("abort")}catch(o){typeof document!="undefined"?document.createEvent?(t=document.createEvent("Event"),t.initEvent("abort",!1,!1)):(t=document.createEventObject(),t.type="abort"):t={type:"abort",bubbles:!1,cancelable:!1}}let i=e;if(i===void 0)if(typeof document=="undefined")i=new Error("This operation was aborted"),i.name="AbortError";else try{i=new DOMException("signal is aborted without reason")}catch(o){i=new Error("This operation was aborted"),i.name="AbortError"}this.signal.reason=i,this.signal.dispatchEvent(t)}toString(){return"[object AbortController]"}};typeof Symbol!="undefined"&&Symbol.toStringTag&&(Ke.prototype[Symbol.toStringTag]="AbortController",he.prototype[Symbol.toStringTag]="AbortSignal");function Lr(r){return r.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):typeof r.Request=="function"&&!r.Request.prototype.hasOwnProperty("signal")||!r.AbortController}function $i(r){typeof r=="function"&&(r={fetch:r});let{fetch:e,Request:t=e.Request,AbortController:i,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o=!1}=r;if(!Lr({fetch:e,Request:t,AbortController:i,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o}))return{fetch:e,Request:a};let a=t;(a&&!a.prototype.hasOwnProperty("signal")||o)&&(a=function(c,p){let v;p&&p.signal&&(v=p.signal,delete p.signal);let s=new t(c,p);return v&&Object.defineProperty(s,"signal",{writable:!1,enumerable:!1,configurable:!0,value:v}),s},a.prototype=t.prototype);let u=e;return{fetch:(d,c)=>{let p=a&&a.prototype.isPrototypeOf(d)?d.signal:c?c.signal:void 0;if(p){let v;try{v=new DOMException("Aborted","AbortError")}catch(l){v=new Error("Aborted"),v.name="AbortError"}if(p.aborted)return Promise.reject(v);let s=new Promise((l,h)=>{p.addEventListener("abort",()=>h(v),{once:!0})});return c&&c.signal&&delete c.signal,Promise.race([s,u(d,c)])}return u(d,c)},Request:a}}var kb=()=>"fetch"in window,We=kb()&&Lr({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),il=We?$i({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,Mi=We?il.fetch:window.fetch,VP=We?il.Request:window.Request,KP=We?Ke:window.AbortController,WP=We?he:window.AbortSignal;var ol=$(tr(),1),nl=$(qr(),1);import{ErrorCategory as kr,now as ji}from"@vkontakte/videoplayer-shared/es2018";var Ge=class{constructor(e){this.params=e,this.apiKey=e.config.apiKey,this.apiEnv=e.config.apiEnv,this.apiBaseUrl=Ot[this.apiEnv],this.timeSynchronisation=e.timeSynchronisation,this.isApiBaseUrlFetched=!1}async resolveApiBaseUrl(){var e;if(this.apiEnv!=="auto"||this.isApiBaseUrlFetched)return this.apiBaseUrl;try{let t=atob("aHR0cHM6Ly9kbnMuZ29vZ2xlL3Jlc29sdmU/bmFtZT12aWRlby5fZW5kcG9pbnQub2sucnUmdHlwZT1UWFQ="),o=await(await Mi(t,{method:"GET",mode:"cors",cache:"no-cache"})).json(),a=(e=o==null?void 0:o.Answer[0])==null?void 0:e.data;if(!a)throw new Error("Wrong DNS response");return a}catch(t){return this.params.error$.next({id:"OneStat:ApiTransport:resolveApiBaseUrl",category:kr.NETWORK,message:"Unhandled resolve api base url error",thrown:t}),Ot.vk_alias}finally{this.isApiBaseUrlFetched=!0}}sendBeacon(e,t,i){if(!window.Blob||!window.navigator.sendBeacon)return!1;let o=this._prepareQueryParams({method:e,queryParams:t,sessionKey:i}),a=new window.Blob([o.toString()],{type:"application/x-www-form-urlencoded"});try{return window.navigator.sendBeacon(`${this.apiBaseUrl}/fb.do`,a)}catch(u){this.params.error$.next({id:"OneStat:ApiTransport:sendBeacon",category:kr.NETWORK,message:"Unhandled beacon error",thrown:u,data:{method:e,params:t}})}return!1}async sendRequest(e,t,i){let o=ji(),a=u=>{if(u instanceof TypeError&&(0,ol.default)(["Failed to fetch","NetworkError when attempting to fetch resource."],u.message)){this.params.error$.next({id:"Network",category:kr.NETWORK,message:"Request failed",thrown:u});return}this.params.error$.next({id:"OneStat:ApiTransport:sendRequest",category:kr.NETWORK,message:"Unhandled request error",thrown:u,data:{method:e,params:t,sessionKey:i,time:ji()-o}})};return this.apiBaseUrl=await this.resolveApiBaseUrl(),Mi(`${this.apiBaseUrl}/fb.do`,{method:"post",headers:{"Content-type":"application/x-www-form-urlencoded"},body:this._prepareQueryParams({method:e,queryParams:t,sessionKey:i})}).then(u=>{var p,v;let f=Number(u.headers.get("content-length"))===0,d=new Date((p=u.headers.get("date"))!=null?p:"").getTime(),c=ji()-o;if(isFinite(d)&&((v=this.timeSynchronisation)==null||v.addServerTime(d,c)),!f)return u.json().then(s=>Object.prototype.hasOwnProperty.call(s,"error_msg")?Promise.reject(s):s,a)},a)}_prepareQueryParams(e){let t=new URLSearchParams({format:"JSON",method:e.method,application_key:this.apiKey});return e.sessionKey!==void 0&&t.append("session_key",e.sessionKey),(0,nl.default)(e.queryParams).forEach(([i,o])=>t.append(i,typeof o=="string"?o:JSON.stringify(o))),t}};var sl=$(tr(),1),ul=$(qr(),1);import{ErrorCategory as Db,now as $b,safeStorage as He,debounceFn as al}from"@vkontakte/videoplayer-shared/es2018";var Dr="onestat_events",Fi=r=>e=>e.timestamp+r>=$b(),$r=class{constructor(e){this.unsaltedStorage=[];this.isPaused=!1;this.isUrgent=e=>{let{operation:t}=e;return(0,sl.default)(["action_play","watch_coverage_record","watch_coverage_live"],t)};this.params=e,this.api=e.api,this.error$=e.error$,this.userSalt=e.userSalt,this.loggerDebugLog=e.debugLogger.createComponentLog("stat logger"),this.firstFlush=al(()=>this.safeFlush(),this.params.config.firstFlushTime,{maxWait:this.params.config.firstFlushTime});let t=He.isPersistent()?this.params.config.flushMaxWait:0;this.debouncedFlush=al(()=>this.safeFlush(),this.params.config.flushDebounceTime,{maxWait:t}),this.subscription=this.api.authorized$.subscribe(i=>{i&&this.debouncedFlush()}),this.housekeepStorage()}safeFlush(){try{this.flush()}catch(e){this.error$.next({id:"LoggerError",category:Db.WTF,message:e?String(e):"Unknown logger error",thrown:e})}}readFromStorage(){let e=He.get(Dr);try{return e?JSON.parse(e):{}}catch(t){}return{}}addToStorage(e){var a;if(!this.userSalt){this.unsaltedStorage.push(e);return}let t=this.readFromStorage(),o=((a=t[this.userSalt])!=null?a:[]).filter(Fi(this.params.config.storageExpiration));He.set(Dr,JSON.stringify({...t,[this.userSalt]:[...o,e]}))}getFromStorage(){var i;return this.userSalt?((i=this.readFromStorage()[this.userSalt])!=null?i:[]).filter(Fi(this.params.config.storageExpiration)):this.unsaltedStorage}markStorageSent(){if(!this.userSalt){this.unsaltedStorage=[];return}let e=this.readFromStorage();delete e[this.userSalt],He.set(Dr,JSON.stringify(e))}housekeepStorage(){let e=this.readFromStorage();for(let[t,i]of(0,ul.default)(e)){let o=i.filter(Fi(this.params.config.storageExpiration));o.length?e[t]=o:delete e[t],this.loggerDebugLog({message:`${i.length} retrieved from storage, ${o.length} of them actual`})}He.set(Dr,JSON.stringify(e))}log(e){this.addToStorage(e),!this.isPaused&&(this.isUrgent(e)?this.flush():this.lastVsid!==e.custom.vsid?this.firstFlush():this.debouncedFlush(),this.lastVsid=e.custom.vsid)}flush({wantBeacon:e,clearStorage:t}={wantBeacon:!1,clearStorage:!0}){let i=this.getFromStorage();i.length!==0&&(this.api.authorized$.getValue()?(e&&this.params.config.useBeacon?(this.loggerDebugLog({message:`Flushing ${i.length} events through beacon`}),this.api.logBeacon(i)):(this.loggerDebugLog({message:`Flushing ${i.length} events`}),this.api.logRequest(i)),t&&this.markStorageSent()):this.api.authorize(),this.firstFlush.cancel(),this.debouncedFlush.cancel())}pause(){this.isPaused=!0,this.debouncedFlush.cancel()}resume(){this.isPaused=!1,this.debouncedFlush()}destroy(){this.subscription.unsubscribe(),this.firstFlush.cancel(),this.debouncedFlush.cancel()}};import{HttpConnectionType as Bi,Surface as ge,VideoFormat as E,VideoQuality as L}from"@vkontakte/videoplayer-core/es2018";import{assertNever as cl}from"@vkontakte/videoplayer-shared/es2018";var ll=r=>r&&{[L.INVARIANT]:"unknown",[L.Q_144P]:"mobile",[L.Q_240P]:"lowest",[L.Q_360P]:"low",[L.Q_480P]:"medium",[L.Q_576P]:"unknown",[L.Q_720P]:"high",[L.Q_1080P]:"fullhd",[L.Q_1440P]:"quadhd",[L.Q_2160P]:"ultrahd",[L.Q_4320P]:"unknown"}[r],Ui=r=>r&&{[Bi.HTTP1]:"http1",[Bi.HTTP2]:"http2",[Bi.QUIC]:"http3"}[r],fl=r=>{if(r!==void 0)switch(r){case E.MPEG:return"mp4";case E.DASH:case E.DASH_LIVE:case E.DASH_STREAMS:return"dash";case E.DASH_SEP:return"dash_sep";case E.DASH_ONDEMAND:return"ondemand_dash";case E.DASH_WEBM:case E.DASH_LIVE_WEBM:return"webm";case E.DASH_WEBM_AV1:return"av1";case E.DASH_LIVE_CMAF:return"ondemand_dash_live";case E.HLS:case E.HLS_LIVE:return"hls";case E.HLS_ONDEMAND:return"ondemand_hls";case E.HLS_LIVE_CMAF:return"ondemand_hls_live";case E.WEB_RTC_LIVE:return"webrtc";default:return cl(r)}},Mr=r=>{if(r!==void 0)switch(r){case ge.NONE:case ge.INLINE:return;case ge.FULLSCREEN:return"fullscreen";case ge.SECOND_SCREEN:return"chromecast";case ge.PIP:return"pip";case ge.INVISIBLE:return"invisible";default:return cl(r)}},dl=r=>{switch(r){case"slow-2g":return"poor";case"2g":return"poor";case"3g":return"good";case"4g":return"excellent"}};var jr=class{constructor(e){this.offset=void 0;this.offset=e}getOffset(){var e;return(e=this.offset)!=null?e:0}setOffset(e){this.offset=e}now(){var e;return Date.now()+((e=this.offset)!=null?e:0)}date(e=new Date){var t;return e.setTime(e.getTime()+((t=this.offset)!=null?t:0)),e}addServerTime(e,t){let i=Date.now(),o=e-i-t/2;if(Math.abs(o)<1e3){this.offset=0;return}this.offset===void 0?this.offset=Math.round(o):this.offset=Math.round(.2*o+(1-.2)*this.offset)}};var Ki=$(xl(),1),Rl=()=>(0,Ki.default)(Math.floor(Math.random()*2**32).toString(36),7,"0"),Cl=()=>(0,Ki.default)(Math.floor(Math.random()*2**64).toString(36),13,"0");import{PlaybackState as Al}from"@vkontakte/videoplayer-core/es2018";import{filter as Nl,filterChanged as oy,fromEvent as ny,isNullable as Ll,map as ay,merge as Wi,Observable as sy,Subject as Gi,Subscription as uy,ValueSubject as cy}from"@vkontakte/videoplayer-shared/es2018";var kl=(r,e)=>new sy(t=>{let i=new uy,o=Wi(ny(window,"beforeunload"),r.events.willDestruct$),a=new cy(void 0),u;i.add(r.info.isLive$.pipe(oy()).subscribe(x=>{u&&(u.unsubscribe(),a.next(void 0)),x?u=r.info.liveTime$.pipe(ay(be=>be&&be/1e3)).subscribe(a):u=r.info.position$.subscribe(a),i.add(u)}));let{playing$:f,paused$:d}=r.events,c=r.events.willSeek$.pipe(Nl(()=>r.info.playbackState$.getValue()===Al.PLAYING)),p=r.events.seeked$.pipe(Nl(()=>r.info.playbackState$.getValue()===Al.PLAYING)),v=!1,s=new Gi;i.add(c.subscribe(()=>{v||s.next(),v=!0})),i.add(p.subscribe(()=>v=!1));let l=new Gi,h=new Gi,g=Wi(f,p,l),b=Wi(d,s,o,r.events.looped$,h),m,y=()=>m=a.getValue(),V=()=>{let x=a.getValue();Ll(m)||m===x||Ll(x)||(t.next({from:m,to:x}),m=void 0)},Z=()=>{h.next(),l.next()};if(i.add(g.subscribe(y)),i.add(b.subscribe(V)),e.forceInterval&&isFinite(e.forceInterval)){let x=0;i.add(g.subscribe(()=>x=window.setTimeout(Z,e.forceInterval))),i.add(b.subscribe(()=>window.clearTimeout(x)))}return i});var Ul="_one-stat_",Fl=`${Ul}uuid`,Bl=`${Ul}deviceId`,Hi=()=>{let r=new Qi;return{subscription:r,subscribe:(e,t)=>{e&&r.add(e.subscribe(t))}}},Yi=class{constructor(e,t){this.subscription=new Qi;this.debugLogger=new hy;this.oneStatDebugLog=this.debugLogger.createComponentLog("onestat");this.loopCounter=0;this.disabled=!1;this.vsid$=new Br(void 0);this.isid$=new Br(void 0);this.zenUid$=new Br(void 0);this.seekAction$=new Br("unknown");var c,p,v;this.statContext=e,this.config=ra((c=t.config)!=null?c:{}),me(t.apiEnv)&&(this.config.apiEnv=t.apiEnv),this.config.synchronizeTime&&(this.timeSynchronisation=new jr);let i=new vy;this.experimental={error$:i},Fr.get(Fl)&&Fr.remove(Fl);let a=Fr.get(Bl);this.statContext.deviceId?this.deviceId=this.statContext.deviceId:a?this.deviceId=a:(this.deviceId=wt(),Fr.set(Bl,this.deviceId)),this.resetViewSession(),t.useIsid&&this.isid$.next((p=t.isid)!=null?p:Cl()),this.zenUid$.next(t.zenUid);let u=new Ge({config:this.config,error$:i,timeSynchronisation:this.timeSynchronisation});this.api=new Ve({config:this.config,apiTransport:u,refreshAuthToken:t.refreshAuthToken,mobile:(v=this.statContext.mobile)!=null?v:!1,deviceId:this.deviceId,error$:i,vktvVersion:t.vktvVersion}),this.logger=new $r({config:this.config,debugLogger:this.debugLogger,api:this.api,error$:i,userSalt:t.userSalt});let{isEmbed:f,topOrigin:d}=gy();this.isEmbed=f,this.embedParent=d?new URL(d).hostname:void 0,this.subscribe()}updateContext(e){this.statContext={...this.statContext,...e}}attachTo(e){let t=new Qi,i=(s,l)=>t.add(s.subscribe(l));i(e.events.willStart$,()=>{let s=e.info.position$.getValue();this.logActionPlay({position:s}),this.statContext.projectId&&this.logActionPlayInteractive()}),i(e.events.looped$,()=>{this.resetViewSession(),++this.loopCounter>this.config.maxLoops&&(this.disabled=!0),this.logActionPlay({position:e.info.position$.getValue()})}),i(e.events.seeked$,()=>{this.logSeek({action:this.seekAction$.getValue(),time:e.info.position$.getValue()}),this.seekAction$.next("unknown")}),i(e.events.paused$,()=>{this.logPause({position:e.info.position$.getValue()})}),i(e.events.willResume$,()=>{this.logPlay()}),i(e.events.started$,()=>{this.statContext.clip&&this.logWatchCoverageRecord({start:0,end:0})}),i(e.events.playing$,()=>{this.logPlaying()}),i(kl(e,{forceInterval:this.config.watchCoverageInterval}),s=>{var b,m,y,V;let l=e.info.isLive$.getValue(),h=e.info.atLiveEdge$.getValue(),g={start:parseFloat(s.from.toFixed(3)),end:parseFloat(s.to.toFixed(3))};if(h){let Z=(b=e.info.liveLatency$.getValue())!=null?b:0,x=(y=(m=e.info.currentBuffer$.getValue())==null?void 0:m.end)!=null?y:0,be=(V=e.info.liveBufferTime$.getValue())!=null?V:0,Xi=Math.round((Z-(x-be))*1e3),Zi=Math.round(Z*1e3);Xi&&Zi&&(g.latency=Xi,g.bufferLatency=Zi)}l?this.logWatchCoverageLive(g):this.logWatchCoverageRecord(g)});let o;i(e.info.isStalled$,s=>{s?o=U():(me(o)&&this.logEmptyBuffer({duration:U()-o}),o=void 0)});let a=!1;t.add(e.events.fatalError$.pipe(py()).subscribe(()=>a=!0)),i(e.events.willStop$,()=>{if(e.info.isStalled$.getValue()){let l=me(o)?U()-o:void 0;this.logCloseAtEmptyBuffer({duration:l!=null?l:0}),o=void 0}else a||this.logActionStop()}),i(e.events.managedError$,({id:s})=>{this.logError({fatal:!1,errorType:s})}),i(e.events.fatalError$,({id:s})=>{this.logError({fatal:!0,errorType:s})});let u,f,d=!1;i(e.events.firstBytes$,s=>{u=U(),this.logFirstBytes({time:s})}),i(e.events.willStart$,()=>f=U()),i(e.info.currentBuffer$,s=>{!d&&s&&s.end-s.start>0&&me(u)&&(this.logPlayerReady({duration:U()-u}),d=!0)}),i(e.events.firstFrame$,()=>{me(u)&&!d&&(this.logPlayerReady({duration:U()-u}),d=!0),me(f)&&this.logFirstFrame({time:U()-f})});let c;i(e.info.currentVideoStream$,s=>{s&&(c&&s.id!==c&&this.logTrackSwitch(s),c=s.id)});let p;i(e.info.currentAudioStream$,s=>{s&&(p&&s.id!==p&&this.logTrackSwitch(s),p=s.id)}),i(e.info.atLiveEdge$,s=>this.updateContext({liveEdge:s})),i(Dl({muted:e.info.muted$,volume:e.info.volume$}),({muted:s,volume:l})=>this.updateContext({audible:!s&&l>0})),i(e.info.currentQuality$,s=>{let l=ll(s);this.updateContext({quality:l}),l&&this.logQuality(l)}),i(e.info.isAutoQualityEnabled$,s=>this.updateContext({autoQuality:s})),i(e.info.currentFormat$,s=>this.updateContext({contentType:fl(s)})),i(e.info.currentPlaybackRate$,s=>this.updateContext({rate:s})),i(e.info.is3DVideo$,s=>this.updateContext({is3d:s}));let v;return i(e.info.hostname$,s=>{let l=v!==void 0&&v!==s;this.updateContext({cdnHostname:s,failover:l}),l&&this.logFailover(s),v=s}),i(e.info.throughputEstimation$,s=>this.updateContext({downloadSpeed:s})),i(e.info.httpConnectionType$,s=>{this.statContext.firstConnectionType||this.updateContext({firstConnectionType:Ui(s)}),this.updateContext({connectionType:Ui(s)})}),i(e.info.httpConnectionReused$,s=>{Ml(this.statContext.firstConnectionReused)&&this.updateContext({firstConnectionReused:s}),this.updateContext({connectionReused:s})}),i(e.info.surface$,s=>this.updateContext({mode:Mr(s)})),i(Dl({current:e.info.currentTextTrack$,available:e.info.availableTextTracks$}),({current:s,available:l})=>{let h=l.find(({id:b})=>b===s),g=h&&(h.isAuto?`${h.language}_auto`:h.language);this.updateContext({subtitles:g==null?void 0:g.split(".")[0]})}),this.player=e,this.uiEvents&&this.attachToUi(this.uiEvents),this.resubscribeBeforeunload(),this.subscription.add(t),t}attachToUi(e){this.uiEvents=e;let{subscription:t,subscribe:i}=Hi();return this.player&&(i(e.actionRewind$,()=>{this.player&&(this.resetViewSession(),this.logActionPlay({position:this.player.info.position$.getValue()}))}),i(e.actionSeek$,this.seekAction$),i(e.inPiP$,o=>{var u;let a=o?"pip":Mr((u=this.player)==null?void 0:u.info.surface$.getValue());this.updateContext({mode:a})}),i(e.inFullscreen$,o=>{var u;let a=o?"fullscreen":Mr((u=this.player)==null?void 0:u.info.surface$.getValue());this.updateContext({mode:a})}),i(e.actionSetSubtitle$,o=>this.updateContext({subtitles:o.split(".")[0]})),i(e.nextMovie$,o=>this.logNextMovie(o)),this.resubscribeBeforeunload(),this.subscription.add(t)),t}attachToAds(e){let{subscription:t,subscribe:i}=Hi();return i(e.slotRequested$,()=>this.logAdSlotRequest()),i(e.started$,o=>this.logAdStarted(o)),i(e.paused$,()=>this.logAdPaused()),i(e.resumed$,()=>this.logAdResumed()),i(e.ended$,()=>this.logAdEnded()),i(e.skipped$,()=>this.logAdSkipped()),i(e.clicked$,()=>this.logAdClicked()),i(e.error$,o=>this.logError({errorType:o,fatal:!1})),this.resubscribeBeforeunload(),this.subscription.add(t),t}attachToInteractive(e){let{subscription:t,subscribe:i}=Hi();return i(e.click$,o=>this.logInterfaceClick(o)),i(e.nextMovie$,o=>this.logNextMovie(o)),this.resubscribeBeforeunload(),this.subscription.add(t),t}authorize(e){return this.api.authorize(e)}pause(){this.logger.pause(),this.oneStatDebugLog({message:"paused"})}resume(){this.logger.resume(),this.oneStatDebugLog({message:"resumed"})}destroy(){this.logger.flush(),this.subscription.unsubscribe(),this.api.destroy(),this.logger.destroy()}resetViewSession(){this.oneStatDebugLog({message:"VSID reset"}),this.vsid$.next(Rl())}getDeviceId(){return this.deviceId}setFieldBlacklist(){}logInited(){}logReady(e){this.log({operation:"player_ready",param:String(e.time)})}logStarted(...e){this.logActionPlay(...e)}logPlay(){this.log({operation:"play_toggle"})}logPlaying(){this.log({operation:"playing"})}logPause(e){this.log({operation:"pause",param:String(Math.round(e.position))})}logSeek(e){this.log({operation:"seek",param:e.action,time:e.time})}logFirstBytes(e){this.log({operation:"first_bytes",param:String(e.time)})}logFirstFrame(e){this.log({operation:"first_frame",param:String(e.time)})}logError(e){this.log({operation:"content_error",param:`${e.fatal?"fatal":"recoverable"}_${e.errorType}`})}logWatchCoverageRecord(e){this.log({operation:"watch_coverage_record",param:`${e.start}-${e.end}`},{in_history:this.statContext.inHistory?1:void 0})}logWatchCoverageLive(e){var a,u;let t=(u=(a=this.timeSynchronisation)==null?void 0:a.getOffset())!=null?u:0,i=e.start+t,o=e.end+t;this.log({operation:"watch_coverage_live",param:`${i}-${o}`},{in_history:this.statContext.inHistory?1:void 0,latency:e.latency,buffer_latency:e.bufferLatency})}logEmptyBuffer(e){this.log({operation:"empty_buffer",param:String(e.duration)})}logDownloadSpeed(){}logAdSlotRequest(){this.log({operation:"adv",param:"slot_request"})}logAdStarted(e){this.log({operation:"adv",param:e})}logAdPaused(){this.log({operation:"adv",param:"pause"})}logAdResumed(){this.log({operation:"adv",param:"resume"})}logAdEnded(){this.log({operation:"adv",param:"ended"})}logAdSkipped(){this.log({operation:"adv",param:"skip"})}logAdClicked(){this.log({operation:"adv",param:"click"})}logInterfaceClick(e){this.log({operation:"player_interface_click",param:e})}logNextMovie(e){this.log({operation:"next_movie",param:String(e)})}subscribe(){this.resubscribeBeforeunload();let e=window.navigator.connection;e&&"onchange"in e&&"effectiveType"in e&&this.subscription.add(fy($l(e,"change"),dy(["init"])).subscribe(()=>this.updateContext({network:dl(e.effectiveType)}))),this.config.debugLog&&this.debugLogger.log$.subscribe(t=>{console.debug("%c stat ","background:#fa6470;",`component: ${t.component}.`,t.message)})}resubscribeBeforeunload(){var e;(e=this.beforeunloadSubscription)==null||e.unsubscribe(),this.beforeunloadSubscription=$l(window,"beforeunload").subscribe(()=>this.logger.flush({wantBeacon:!0,clearStorage:this.config.clearStorageAtUnload})),this.subscription.add(this.beforeunloadSubscription)}logPlayerReady(e){this.log({operation:"player_ready",param:String(Math.round(e.duration))})}logActionPlay(e){this.log({operation:"action_play",param:String(Math.round(e.position))})}logActionPlayInteractive(){this.statContext.projectId&&this.log({operation:"action_play_interactive",param:String(this.statContext.movieId)},{vid:this.statContext.projectId})}logFailover(e){this.log({operation:"failover",param:e})}logCloseAtEmptyBuffer(e){this.log({operation:"close_at_empty_buffer",param:String(Math.round(e.duration))})}logActionStop(){this.log({operation:"action_stop"})}logTrackSwitch(e){this.log({operation:"track_switch",param:e.id})}logQuality(e){this.log({operation:"quality",param:e})}log(e,t={}){if(this.disabled){this.oneStatDebugLog({message:`operation ${e.operation} but statistics is disabled`});return}if((0,zi.default)(this.config.disabledOperations,e.operation)){this.oneStatDebugLog({message:`operation ${e.operation} but it is disabled`});return}this.oneStatDebugLog({message:`operation ${e.operation} ${e.param}`});let i=this.createLogItem(e,t);this.logger.log(i)}createLogItem({operation:e,param:t,time:i},o={}){var l,h,g,b,m,y;let a=(h=(l=this.timeSynchronisation)==null?void 0:l.now())!=null?h:U(),u=this.vsid$.getValue();ly(u);let f=this.isid$.getValue(),d=e==="empty_buffer"||e==="close_at_empty_buffer"?this.statContext.connectionType:this.statContext.firstConnectionType,c=this.statContext.firstConnectionReused,p,v;if(this.isEmbed||this.statContext.place==="embed"){p=this.embedParent;let V=[...new URLSearchParams(location.search).entries()].filter(([Z,x])=>(0,zi.default)(this.config.embedUrlParams,Z));v=new URLSearchParams(V).toString()}else this.statContext.place==="direct"&&(this.statContext.refDomain?p=(b=(g=jl(this.statContext.refDomain))==null?void 0:g.hostname)!=null?b:this.statContext.refDomain:document.referrer&&(p=(y=(m=jl(document.referrer))==null?void 0:m.hostname)!=null?y:document.referrer),v=location.href.substring(0,1024));let s={vsid:u,isid:f,vid:this.statContext.movieId,uid:this.zenUid$.getValue(),ct:this.statContext.contentType,place:this.isEmbed?"embed":this.statContext.place,quality:this.statContext.quality,cdn_host:this.statContext.cdnHostname,stat_type:this.statContext.autoplay===!0?"auto":this.statContext.autoplay===!1?"":void 0,param:t,vk_app_id:this.statContext.vkAppId,track_code:this.statContext.trackCode,connection_type:d,connection_reused:c===!0?1:c===!1?0:void 0,cached_data:this.statContext.cached===!0?1:this.statContext.cached===!1?0:void 0,live:this.statContext.liveEdge?1:void 0,muted:this.statContext.audible===!1?1:void 0,mode:this.statContext.mode,subtitles:this.statContext.subtitles,download_speed:this.statContext.downloadSpeed,manual_quality:this.statContext.autoQuality?void 0:1,ref_domain:p,direct_url:v,rate:this.statContext.rate===1||Ml(this.statContext.rate)?void 0:this.statContext.rate.toFixed(2),view_360:this.statContext.is3d?1:void 0,aid:this.statContext.albumId,vk_playlist_id:this.statContext.vkPlaylistId,...o};for(let V of this.config.disabledCustomFields)delete s[V];return{operation:e,type:1,time:i,network:this.statContext.network,timestamp:a,custom:s}}};var Vl={};var my=(r,e={})=>{let i=e.timeout||1,o=performance.now();return window.setTimeout(()=>{r({get didTimeout(){return e.timeout?!1:performance.now()-o-1>i},timeRemaining(){return Math.max(0,1+(performance.now()-o))}})},1)},by=r=>window.clearTimeout(r),Kl=r=>typeof r=="function"&&(r==null?void 0:r.toString().endsWith("{ [native code] }")),Wl=!Kl(window.requestIdleCallback)||!Kl(window.cancelIdleCallback),Gl=Wl?my:window.requestIdleCallback,pT=Wl?by:window.cancelIdleCallback;import{PlaybackState as zl,Subscription as yy}from"@vkontakte/videoplayer-core/es2018";var Ur=class{constructor(){this.startTime=null;this.stopTime=null;this.accumulatedTime=0}get time(){return Math.floor(this.timeMs/1e3)}get timeMs(){var t;return this.startTime===null?0:((t=this.stopTime)!=null?t:this.now())-this.startTime-this.accumulatedTime}get isRunning(){return this.startTime!==null&&this.stopTime===null}start(){this.isRunning||(this.stopTime!==null?(this.accumulatedTime+=this.now()-this.stopTime,this.stopTime=null):this.startTime=this.now())}stop(){this.isRunning&&(this.stopTime=this.now())}reset(){this.startTime=null,this.stopTime=null,this.accumulatedTime=0}now(){return Date.now()}};var Hl=()=>window.Image?new Image:document.createElement("img");var Ji=class{constructor(e){this.position=0;this.started=!1;this.heartbeatPixels=[];this.heartbeatLastTimeSent={};this.stopwatch=new Ur;this.subscription=new yy;this.params=e}attachTo(e){this.subscription.add(e.info.playbackState$.subscribe(t=>this.onPlaybackState(t))).add(e.info.position$.subscribe(t=>this.onPosition(t))).add(e.info.atLiveEdge$.subscribe(t=>this.isActiveLive=t)),this.subscription.add(e.events.willSeek$.subscribe(()=>this.onWillSeek())).add(e.events.seeked$.subscribe(()=>this.onSeeked())).add(e.events.ended$.subscribe(()=>this.onEnded()))}destroy(){this.stopwatch.reset(),this.subscription.unsubscribe(),window.clearTimeout(this.heartbeatFirstTimeoutId),this.send("stop")}onPlaybackState(e){e===zl.PLAYING?this.started?this.play():this.start():e===zl.PAUSED&&this.pause()}start(){var i,o,a;this.started=!0,this.stopwatch.start(),this.send("start"),this.heartbeatPixels=this.prepareHeartbeatPixels(),this.heartbeatInterval=(i=this.heartbeatPixels[0])==null?void 0:i.interval;let e=(o=this.heartbeatPixels[0])==null?void 0:o.url,t=(a=this.heartbeatPixels[0])==null?void 0:a.delay;t!==void 0&&e&&(this.heartbeatFirstTimeoutId=window.setTimeout(()=>{this.sendHeartbeat(e)},t*1e3))}play(){this.stopwatch.start(),this.send("resume")}pause(){this.stopwatch.stop(),this.send("pause")}onPosition(e){if(this.position=e,this.heartbeatInterval&&this.stopwatch.time!==0&&this.stopwatch.time%this.heartbeatInterval===0)for(let[t,{url:i}]of this.heartbeatPixels.entries())this.heartbeatLastTimeSent[t]!==this.stopwatch.time&&(this.heartbeatLastTimeSent[t]=this.stopwatch.time,this.sendHeartbeat(i))}onWillSeek(){this.started&&this.send("stop")}onSeeked(){this.started&&this.send("start")}onEnded(){this.stopwatch.stop(),this.send("stop")}validatePixels(e,t){return e==null?void 0:e.filter(i=>i.event===t.event&&t.keys.every(o=>!!i[o]))}getFrameTimestamp(){let e;if(this.isActiveLive){let t=Math.floor(Math.random()*25)+5;e=Date.now()/1e3-t}else e=this.position||0;return Math.floor(e)}getUTC(){return Math.floor(Date.now()/1e3)}prepareUrl(e){return e.replace("{@fts_fake_sec}",String(this.getFrameTimestamp())).replace("{@utc_sec}",String(this.getUTC())).split("&").filter(t=>!/={@[a-zA-Z_]+}/.test(t)).join("&")}preparePixels(e){return this.validatePixels(this.params.pixels,{event:e,keys:["url"]})}prepareHeartbeatPixels(){return this.validatePixels(this.params.pixels,{event:"heartbeat",keys:["url","interval"]})}call(e){Gl(()=>Hl().src=this.prepareUrl(e))}send(e){let t=this.preparePixels(e);for(let{url:i}of t)this.call(i)}sendHeartbeat(e){this.call(e)}};export{Re as ApiEnv,qt as ConnectionType,Tt as ContentType,Qn as InteractiveInterfaceClick,Ji as MediascopePixel,Vl as MediascopePixelTypes,Yi as OneStat,Et as Quality,_t as SeekAction,ir as VERSION};
|
|
6
|
+
var Ud=Object.create;var ut=Object.defineProperty;var Bd=Object.getOwnPropertyDescriptor;var jd=Object.getOwnPropertyNames;var Wd=Object.getPrototypeOf,Hd=Object.prototype.hasOwnProperty;var a=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),Kd=(r,e)=>{for(var t in e)ut(r,t,{get:e[t],enumerable:!0})},Gd=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of jd(e))!Hd.call(r,o)&&o!==t&&ut(r,o,{get:()=>e[o],enumerable:!(i=Bd(e,o))||i.enumerable});return r};var w=(r,e,t)=>(t=r!=null?Ud(Wd(r)):{},Gd(e||!r||!r.__esModule?ut(t,"default",{value:r,enumerable:!0}):t,r));var S=a((ct,xo)=>{"use strict";var qe=function(r){return r&&r.Math===Math&&r};xo.exports=qe(typeof globalThis=="object"&&globalThis)||qe(typeof window=="object"&&window)||qe(typeof self=="object"&&self)||qe(typeof global=="object"&&global)||qe(typeof ct=="object"&&ct)||function(){return this}()||Function("return this")()});var O=a((kI,Ro)=>{"use strict";Ro.exports=function(r){try{return!!r()}catch(e){return!0}}});var xe=a((NI,Co)=>{"use strict";var zd=O();Co.exports=!zd(function(){var r=function(){}.bind();return typeof r!="function"||r.hasOwnProperty("prototype")})});var lt=a((LI,Do)=>{"use strict";var Qd=xe(),Lo=Function.prototype,ko=Lo.apply,No=Lo.call;Do.exports=typeof Reflect=="object"&&Reflect.apply||(Qd?No.bind(ko):function(){return No.apply(ko,arguments)})});var q=a((DI,Vo)=>{"use strict";var $o=xe(),Mo=Function.prototype,dt=Mo.call,Yd=$o&&Mo.bind.bind(dt,dt);Vo.exports=$o?Yd:function(r){return function(){return dt.apply(r,arguments)}}});var Re=a(($I,Uo)=>{"use strict";var Fo=q(),Jd=Fo({}.toString),Xd=Fo("".slice);Uo.exports=function(r){return Xd(Jd(r),8,-1)}});var ft=a((MI,Bo)=>{"use strict";var Zd=Re(),ef=q();Bo.exports=function(r){if(Zd(r)==="Function")return ef(r)}});var _=a((VI,jo)=>{"use strict";var pt=typeof document=="object"&&document.all;jo.exports=typeof pt=="undefined"&&pt!==void 0?function(r){return typeof r=="function"||r===pt}:function(r){return typeof r=="function"}});var x=a((FI,Wo)=>{"use strict";var rf=O();Wo.exports=!rf(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})});var L=a((UI,Ho)=>{"use strict";var tf=xe(),sr=Function.prototype.call;Ho.exports=tf?sr.bind(sr):function(){return sr.apply(sr,arguments)}});var ht=a(zo=>{"use strict";var Ko={}.propertyIsEnumerable,Go=Object.getOwnPropertyDescriptor,of=Go&&!Ko.call({1:2},1);zo.f=of?function(e){var t=Go(this,e);return!!t&&t.enumerable}:Ko});var Ce=a((jI,Qo)=>{"use strict";Qo.exports=function(r,e){return{enumerable:!(r&1),configurable:!(r&2),writable:!(r&4),value:e}}});var Jo=a((WI,Yo)=>{"use strict";var nf=q(),af=O(),sf=Re(),vt=Object,uf=nf("".split);Yo.exports=af(function(){return!vt("z").propertyIsEnumerable(0)})?function(r){return sf(r)==="String"?uf(r,""):vt(r)}:vt});var ke=a((HI,Xo)=>{"use strict";Xo.exports=function(r){return r==null}});var ae=a((KI,Zo)=>{"use strict";var cf=ke(),lf=TypeError;Zo.exports=function(r){if(cf(r))throw new lf("Can't call method on "+r);return r}});var J=a((GI,en)=>{"use strict";var df=Jo(),ff=ae();en.exports=function(r){return df(ff(r))}});var D=a((zI,rn)=>{"use strict";var pf=_();rn.exports=function(r){return typeof r=="object"?r!==null:pf(r)}});var Ne=a((QI,tn)=>{"use strict";tn.exports={}});var j=a((YI,nn)=>{"use strict";var gt=Ne(),mt=S(),hf=_(),on=function(r){return hf(r)?r:void 0};nn.exports=function(r,e){return arguments.length<2?on(gt[r])||on(mt[r]):gt[r]&>[r][e]||mt[r]&&mt[r][e]}});var ur=a((JI,an)=>{"use strict";var vf=q();an.exports=vf({}.isPrototypeOf)});var X=a((XI,cn)=>{"use strict";var gf=S(),sn=gf.navigator,un=sn&&sn.userAgent;cn.exports=un?String(un):""});var yt=a((ZI,vn)=>{"use strict";var hn=S(),bt=X(),ln=hn.process,dn=hn.Deno,fn=ln&&ln.versions||dn&&dn.version,pn=fn&&fn.v8,$,cr;pn&&($=pn.split("."),cr=$[0]>0&&$[0]<4?1:+($[0]+$[1]));!cr&&bt&&($=bt.match(/Edge\/(\d+)/),(!$||$[1]>=74)&&($=bt.match(/Chrome\/(\d+)/),$&&(cr=+$[1])));vn.exports=cr});var It=a((eS,mn)=>{"use strict";var gn=yt(),mf=O(),bf=S(),yf=bf.String;mn.exports=!!Object.getOwnPropertySymbols&&!mf(function(){var r=Symbol("symbol detection");return!yf(r)||!(Object(r)instanceof Symbol)||!Symbol.sham&&gn&&gn<41})});var St=a((rS,bn)=>{"use strict";var If=It();bn.exports=If&&!Symbol.sham&&typeof Symbol.iterator=="symbol"});var _t=a((tS,yn)=>{"use strict";var Sf=j(),_f=_(),Ef=ur(),Pf=St(),Tf=Object;yn.exports=Pf?function(r){return typeof r=="symbol"}:function(r){var e=Sf("Symbol");return _f(e)&&Ef(e.prototype,Tf(r))}});var Le=a((iS,In)=>{"use strict";var wf=String;In.exports=function(r){try{return wf(r)}catch(e){return"Object"}}});var W=a((oS,Sn)=>{"use strict";var Of=_(),Af=Le(),qf=TypeError;Sn.exports=function(r){if(Of(r))return r;throw new qf(Af(r)+" is not a function")}});var lr=a((nS,_n)=>{"use strict";var xf=W(),Rf=ke();_n.exports=function(r,e){var t=r[e];return Rf(t)?void 0:xf(t)}});var Pn=a((aS,En)=>{"use strict";var Et=L(),Pt=_(),Tt=D(),Cf=TypeError;En.exports=function(r,e){var t,i;if(e==="string"&&Pt(t=r.toString)&&!Tt(i=Et(t,r))||Pt(t=r.valueOf)&&!Tt(i=Et(t,r))||e!=="string"&&Pt(t=r.toString)&&!Tt(i=Et(t,r)))return i;throw new Cf("Can't convert object to primitive value")}});var U=a((sS,Tn)=>{"use strict";Tn.exports=!0});var An=a((uS,On)=>{"use strict";var wn=S(),kf=Object.defineProperty;On.exports=function(r,e){try{kf(wn,r,{value:e,configurable:!0,writable:!0})}catch(t){wn[r]=e}return e}});var De=a((cS,Rn)=>{"use strict";var Nf=U(),Lf=S(),Df=An(),qn="__core-js_shared__",xn=Rn.exports=Lf[qn]||Df(qn,{});(xn.versions||(xn.versions=[])).push({version:"3.38.0",mode:Nf?"pure":"global",copyright:"\xA9 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.38.0/LICENSE",source:"https://github.com/zloirock/core-js"})});var wt=a((lS,kn)=>{"use strict";var Cn=De();kn.exports=function(r,e){return Cn[r]||(Cn[r]=e||{})}});var Ot=a((dS,Nn)=>{"use strict";var $f=ae(),Mf=Object;Nn.exports=function(r){return Mf($f(r))}});var B=a((fS,Ln)=>{"use strict";var Vf=q(),Ff=Ot(),Uf=Vf({}.hasOwnProperty);Ln.exports=Object.hasOwn||function(e,t){return Uf(Ff(e),t)}});var At=a((pS,Dn)=>{"use strict";var Bf=q(),jf=0,Wf=Math.random(),Hf=Bf(1 .toString);Dn.exports=function(r){return"Symbol("+(r===void 0?"":r)+")_"+Hf(++jf+Wf,36)}});var R=a((hS,Mn)=>{"use strict";var Kf=S(),Gf=wt(),$n=B(),zf=At(),Qf=It(),Yf=St(),se=Kf.Symbol,qt=Gf("wks"),Jf=Yf?se.for||se:se&&se.withoutSetter||zf;Mn.exports=function(r){return $n(qt,r)||(qt[r]=Qf&&$n(se,r)?se[r]:Jf("Symbol."+r)),qt[r]}});var Bn=a((vS,Un)=>{"use strict";var Xf=L(),Vn=D(),Fn=_t(),Zf=lr(),ep=Pn(),rp=R(),tp=TypeError,ip=rp("toPrimitive");Un.exports=function(r,e){if(!Vn(r)||Fn(r))return r;var t=Zf(r,ip),i;if(t){if(e===void 0&&(e="default"),i=Xf(t,r,e),!Vn(i)||Fn(i))return i;throw new tp("Can't convert object to primitive value")}return e===void 0&&(e="number"),ep(r,e)}});var xt=a((gS,jn)=>{"use strict";var op=Bn(),np=_t();jn.exports=function(r){var e=op(r,"string");return np(e)?e:e+""}});var dr=a((mS,Hn)=>{"use strict";var ap=S(),Wn=D(),Rt=ap.document,sp=Wn(Rt)&&Wn(Rt.createElement);Hn.exports=function(r){return sp?Rt.createElement(r):{}}});var Ct=a((bS,Kn)=>{"use strict";var up=x(),cp=O(),lp=dr();Kn.exports=!up&&!cp(function(){return Object.defineProperty(lp("div"),"a",{get:function(){return 7}}).a!==7})});var Qn=a(zn=>{"use strict";var dp=x(),fp=L(),pp=ht(),hp=Ce(),vp=J(),gp=xt(),mp=B(),bp=Ct(),Gn=Object.getOwnPropertyDescriptor;zn.f=dp?Gn:function(e,t){if(e=vp(e),t=gp(t),bp)try{return Gn(e,t)}catch(i){}if(mp(e,t))return hp(!fp(pp.f,e,t),e[t])}});var kt=a((IS,Yn)=>{"use strict";var yp=O(),Ip=_(),Sp=/#|\.prototype\./,$e=function(r,e){var t=Ep[_p(r)];return t===Tp?!0:t===Pp?!1:Ip(e)?yp(e):!!e},_p=$e.normalize=function(r){return String(r).replace(Sp,".").toLowerCase()},Ep=$e.data={},Pp=$e.NATIVE="N",Tp=$e.POLYFILL="P";Yn.exports=$e});var Me=a((SS,Xn)=>{"use strict";var Jn=ft(),wp=W(),Op=xe(),Ap=Jn(Jn.bind);Xn.exports=function(r,e){return wp(r),e===void 0?r:Op?Ap(r,e):function(){return r.apply(e,arguments)}}});var Nt=a((_S,Zn)=>{"use strict";var qp=x(),xp=O();Zn.exports=qp&&xp(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})});var H=a((ES,ea)=>{"use strict";var Rp=D(),Cp=String,kp=TypeError;ea.exports=function(r){if(Rp(r))return r;throw new kp(Cp(r)+" is not an object")}});var Z=a(ta=>{"use strict";var Np=x(),Lp=Ct(),Dp=Nt(),fr=H(),ra=xt(),$p=TypeError,Lt=Object.defineProperty,Mp=Object.getOwnPropertyDescriptor,Dt="enumerable",$t="configurable",Mt="writable";ta.f=Np?Dp?function(e,t,i){if(fr(e),t=ra(t),fr(i),typeof e=="function"&&t==="prototype"&&"value"in i&&Mt in i&&!i[Mt]){var o=Mp(e,t);o&&o[Mt]&&(e[t]=i.value,i={configurable:$t in i?i[$t]:o[$t],enumerable:Dt in i?i[Dt]:o[Dt],writable:!1})}return Lt(e,t,i)}:Lt:function(e,t,i){if(fr(e),t=ra(t),fr(i),Lp)try{return Lt(e,t,i)}catch(o){}if("get"in i||"set"in i)throw new $p("Accessors not supported");return"value"in i&&(e[t]=i.value),e}});var ue=a((TS,ia)=>{"use strict";var Vp=x(),Fp=Z(),Up=Ce();ia.exports=Vp?function(r,e,t){return Fp.f(r,e,Up(1,t))}:function(r,e,t){return r[e]=t,r}});var C=a((wS,na)=>{"use strict";var Ve=S(),Bp=lt(),jp=ft(),Wp=_(),Hp=Qn().f,Kp=kt(),ce=Ne(),Gp=Me(),le=ue(),oa=B();De();var zp=function(r){var e=function(t,i,o){if(this instanceof e){switch(arguments.length){case 0:return new r;case 1:return new r(t);case 2:return new r(t,i)}return new r(t,i,o)}return Bp(r,this,arguments)};return e.prototype=r.prototype,e};na.exports=function(r,e){var t=r.target,i=r.global,o=r.stat,n=r.proto,s=i?Ve:o?Ve[t]:Ve[t]&&Ve[t].prototype,u=i?ce:ce[t]||le(ce,t,{})[t],d=u.prototype,l,f,h,c,p,v,g,b,m;for(c in e)l=Kp(i?c:t+(o?".":"#")+c,r.forced),f=!l&&s&&oa(s,c),v=u[c],f&&(r.dontCallGetSet?(m=Hp(s,c),g=m&&m.value):g=s[c]),p=f&&g?g:e[c],!(!l&&!n&&typeof v==typeof p)&&(r.bind&&f?b=Gp(p,Ve):r.wrap&&f?b=zp(p):n&&Wp(p)?b=jp(p):b=p,(r.sham||p&&p.sham||v&&v.sham)&&le(b,"sham",!0),le(u,c,b),n&&(h=t+"Prototype",oa(ce,h)||le(ce,h,{}),le(ce[h],c,p),r.real&&d&&(l||!d[c])&&le(d,c,p)))}});var sa=a((OS,aa)=>{"use strict";var Qp=Math.ceil,Yp=Math.floor;aa.exports=Math.trunc||function(e){var t=+e;return(t>0?Yp:Qp)(t)}});var pr=a((AS,ua)=>{"use strict";var Jp=sa();ua.exports=function(r){var e=+r;return e!==e||e===0?0:Jp(e)}});var la=a((qS,ca)=>{"use strict";var Xp=pr(),Zp=Math.max,eh=Math.min;ca.exports=function(r,e){var t=Xp(r);return t<0?Zp(t+e,0):eh(t,e)}});var Vt=a((xS,da)=>{"use strict";var rh=pr(),th=Math.min;da.exports=function(r){var e=rh(r);return e>0?th(e,9007199254740991):0}});var Ft=a((RS,fa)=>{"use strict";var ih=Vt();fa.exports=function(r){return ih(r.length)}});var Ut=a((CS,ha)=>{"use strict";var oh=J(),nh=la(),ah=Ft(),pa=function(r){return function(e,t,i){var o=oh(e),n=ah(o);if(n===0)return!r&&-1;var s=nh(i,n),u;if(r&&t!==t){for(;n>s;)if(u=o[s++],u!==u)return!0}else for(;n>s;s++)if((r||s in o)&&o[s]===t)return r||s||0;return!r&&-1}};ha.exports={includes:pa(!0),indexOf:pa(!1)}});var Bt=a((kS,va)=>{"use strict";va.exports=function(){}});var ga=a(()=>{"use strict";var sh=C(),uh=Ut().includes,ch=O(),lh=Bt(),dh=ch(function(){return!Array(1).includes()});sh({target:"Array",proto:!0,forced:dh},{includes:function(e){return uh(this,e,arguments.length>1?arguments[1]:void 0)}});lh("includes")});var hr=a((DS,ma)=>{"use strict";var fh=j();ma.exports=fh});var ya=a(($S,ba)=>{"use strict";ga();var ph=hr();ba.exports=ph("Array","includes")});var Sa=a((MS,Ia)=>{"use strict";var hh=ya();Ia.exports=hh});var de=a((VS,_a)=>{"use strict";var vh=Sa();_a.exports=vh});var xa=a(()=>{"use strict"});var Qt=a((XS,Ra)=>{"use strict";var Ue=S(),bh=X(),yh=Re(),gr=function(r){return bh.slice(0,r.length)===r};Ra.exports=function(){return gr("Bun/")?"BUN":gr("Cloudflare-Workers")?"CLOUDFLARE":gr("Deno/")?"DENO":gr("Node.js/")?"NODE":Ue.Bun&&typeof Bun.version=="string"?"BUN":Ue.Deno&&typeof Deno.version=="object"?"DENO":yh(Ue.process)==="process"?"NODE":Ue.window&&Ue.document?"BROWSER":"REST"}()});var mr=a((ZS,Ca)=>{"use strict";var Ih=Qt();Ca.exports=Ih==="NODE"});var fe=a((e_,ka)=>{"use strict";var Sh=ue();ka.exports=function(r,e,t,i){return i&&i.enumerable?r[e]=t:Sh(r,e,t),r}});var La=a((r_,Na)=>{"use strict";var _h=q(),Eh=W();Na.exports=function(r,e,t){try{return _h(Eh(Object.getOwnPropertyDescriptor(r,e)[t]))}catch(i){}}});var $a=a((t_,Da)=>{"use strict";var Ph=D();Da.exports=function(r){return Ph(r)||r===null}});var Va=a((i_,Ma)=>{"use strict";var Th=$a(),wh=String,Oh=TypeError;Ma.exports=function(r){if(Th(r))return r;throw new Oh("Can't set "+wh(r)+" as a prototype")}});var Yt=a((o_,Fa)=>{"use strict";var Ah=La(),qh=D(),xh=ae(),Rh=Va();Fa.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var r=!1,e={},t;try{t=Ah(Object.prototype,"__proto__","set"),t(e,[]),r=e instanceof Array}catch(i){}return function(o,n){return xh(o),Rh(n),qh(o)&&(r?t(o,n):o.__proto__=n),o}}():void 0)});var br=a((n_,Ba)=>{"use strict";var Ch=R(),kh=Ch("toStringTag"),Ua={};Ua[kh]="z";Ba.exports=String(Ua)==="[object z]"});var Be=a((a_,ja)=>{"use strict";var Nh=br(),Lh=_(),yr=Re(),Dh=R(),$h=Dh("toStringTag"),Mh=Object,Vh=yr(function(){return arguments}())==="Arguments",Fh=function(r,e){try{return r[e]}catch(t){}};ja.exports=Nh?yr:function(r){var e,t,i;return r===void 0?"Undefined":r===null?"Null":typeof(t=Fh(e=Mh(r),$h))=="string"?t:Vh?yr(e):(i=yr(e))==="Object"&&Lh(e.callee)?"Arguments":i}});var Ha=a((s_,Wa)=>{"use strict";var Uh=br(),Bh=Be();Wa.exports=Uh?{}.toString:function(){return"[object "+Bh(this)+"]"}});var je=a((u_,Ga)=>{"use strict";var jh=br(),Wh=Z().f,Hh=ue(),Kh=B(),Gh=Ha(),zh=R(),Ka=zh("toStringTag");Ga.exports=function(r,e,t,i){var o=t?r:r&&r.prototype;o&&(Kh(o,Ka)||Wh(o,Ka,{configurable:!0,value:e}),i&&!jh&&Hh(o,"toString",Gh))}});var Qa=a((c_,za)=>{"use strict";var Qh=Z();za.exports=function(r,e,t){return Qh.f(r,e,t)}});var Xa=a((l_,Ja)=>{"use strict";var Yh=j(),Jh=Qa(),Xh=R(),Zh=x(),Ya=Xh("species");Ja.exports=function(r){var e=Yh(r);Zh&&e&&!e[Ya]&&Jh(e,Ya,{configurable:!0,get:function(){return this}})}});var es=a((d_,Za)=>{"use strict";var ev=ur(),rv=TypeError;Za.exports=function(r,e){if(ev(e,r))return r;throw new rv("Incorrect invocation")}});var Xt=a((f_,rs)=>{"use strict";var tv=q(),iv=_(),Jt=De(),ov=tv(Function.toString);iv(Jt.inspectSource)||(Jt.inspectSource=function(r){return ov(r)});rs.exports=Jt.inspectSource});var ss=a((p_,as)=>{"use strict";var nv=q(),av=O(),ts=_(),sv=Be(),uv=j(),cv=Xt(),is=function(){},os=uv("Reflect","construct"),Zt=/^\s*(?:class|function)\b/,lv=nv(Zt.exec),dv=!Zt.test(is),We=function(e){if(!ts(e))return!1;try{return os(is,[],e),!0}catch(t){return!1}},ns=function(e){if(!ts(e))return!1;switch(sv(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return dv||!!lv(Zt,cv(e))}catch(t){return!0}};ns.sham=!0;as.exports=!os||av(function(){var r;return We(We.call)||!We(Object)||!We(function(){r=!0})||r})?ns:We});var cs=a((h_,us)=>{"use strict";var fv=ss(),pv=Le(),hv=TypeError;us.exports=function(r){if(fv(r))return r;throw new hv(pv(r)+" is not a constructor")}});var ei=a((v_,ds)=>{"use strict";var ls=H(),vv=cs(),gv=ke(),mv=R(),bv=mv("species");ds.exports=function(r,e){var t=ls(r).constructor,i;return t===void 0||gv(i=ls(t)[bv])?e:vv(i)}});var ri=a((g_,fs)=>{"use strict";var yv=j();fs.exports=yv("document","documentElement")});var hs=a((m_,ps)=>{"use strict";var Iv=q();ps.exports=Iv([].slice)});var gs=a((b_,vs)=>{"use strict";var Sv=TypeError;vs.exports=function(r,e){if(r<e)throw new Sv("Not enough arguments");return r}});var ti=a((y_,ms)=>{"use strict";var _v=X();ms.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(_v)});var di=a((I_,ws)=>{"use strict";var k=S(),Ev=lt(),Pv=Me(),bs=_(),Tv=B(),Ts=O(),ys=ri(),wv=hs(),Is=dr(),Ov=gs(),Av=ti(),qv=mr(),ui=k.setImmediate,ci=k.clearImmediate,xv=k.process,ii=k.Dispatch,Rv=k.Function,Ss=k.MessageChannel,Cv=k.String,oi=0,He={},_s="onreadystatechange",Ke,ee,ni,ai;Ts(function(){Ke=k.location});var li=function(r){if(Tv(He,r)){var e=He[r];delete He[r],e()}},si=function(r){return function(){li(r)}},Es=function(r){li(r.data)},Ps=function(r){k.postMessage(Cv(r),Ke.protocol+"//"+Ke.host)};(!ui||!ci)&&(ui=function(e){Ov(arguments.length,1);var t=bs(e)?e:Rv(e),i=wv(arguments,1);return He[++oi]=function(){Ev(t,void 0,i)},ee(oi),oi},ci=function(e){delete He[e]},qv?ee=function(r){xv.nextTick(si(r))}:ii&&ii.now?ee=function(r){ii.now(si(r))}:Ss&&!Av?(ni=new Ss,ai=ni.port2,ni.port1.onmessage=Es,ee=Pv(ai.postMessage,ai)):k.addEventListener&&bs(k.postMessage)&&!k.importScripts&&Ke&&Ke.protocol!=="file:"&&!Ts(Ps)?(ee=Ps,k.addEventListener("message",Es,!1)):_s in Is("script")?ee=function(r){ys.appendChild(Is("script"))[_s]=function(){ys.removeChild(this),li(r)}}:ee=function(r){setTimeout(si(r),0)});ws.exports={set:ui,clear:ci}});var qs=a((S_,As)=>{"use strict";var Os=S(),kv=x(),Nv=Object.getOwnPropertyDescriptor;As.exports=function(r){if(!kv)return Os[r];var e=Nv(Os,r);return e&&e.value}});var fi=a((__,Rs)=>{"use strict";var xs=function(){this.head=null,this.tail=null};xs.prototype={add:function(r){var e={item:r,next:null},t=this.tail;t?t.next=e:this.head=e,this.tail=e},get:function(){var r=this.head;if(r){var e=this.head=r.next;return e===null&&(this.tail=null),r.item}}};Rs.exports=xs});var ks=a((E_,Cs)=>{"use strict";var Lv=X();Cs.exports=/ipad|iphone|ipod/i.test(Lv)&&typeof Pebble!="undefined"});var Ls=a((P_,Ns)=>{"use strict";var Dv=X();Ns.exports=/web0s(?!.*chrome)/i.test(Dv)});var Bs=a((T_,Us)=>{"use strict";var he=S(),$v=qs(),Ds=Me(),pi=di().set,Mv=fi(),Vv=ti(),Fv=ks(),Uv=Ls(),hi=mr(),$s=he.MutationObserver||he.WebKitMutationObserver,Ms=he.document,Vs=he.process,Ir=he.Promise,mi=$v("queueMicrotask"),pe,vi,gi,Sr,Fs;mi||(Ge=new Mv,ze=function(){var r,e;for(hi&&(r=Vs.domain)&&r.exit();e=Ge.get();)try{e()}catch(t){throw Ge.head&&pe(),t}r&&r.enter()},!Vv&&!hi&&!Uv&&$s&&Ms?(vi=!0,gi=Ms.createTextNode(""),new $s(ze).observe(gi,{characterData:!0}),pe=function(){gi.data=vi=!vi}):!Fv&&Ir&&Ir.resolve?(Sr=Ir.resolve(void 0),Sr.constructor=Ir,Fs=Ds(Sr.then,Sr),pe=function(){Fs(ze)}):hi?pe=function(){Vs.nextTick(ze)}:(pi=Ds(pi,he),pe=function(){pi(ze)}),mi=function(r){Ge.head||pe(),Ge.add(r)});var Ge,ze;Us.exports=mi});var Ws=a((w_,js)=>{"use strict";js.exports=function(r,e){try{arguments.length===1?console.error(r):console.error(r,e)}catch(t){}}});var _r=a((O_,Hs)=>{"use strict";Hs.exports=function(r){try{return{error:!1,value:r()}}catch(e){return{error:!0,value:e}}}});var zs=a((A_,Gs)=>{"use strict";var Bv=S(),jv=_(),Ks=Bv.WeakMap;Gs.exports=jv(Ks)&&/native code/.test(String(Ks))});var Er=a((q_,Ys)=>{"use strict";var Wv=wt(),Hv=At(),Qs=Wv("keys");Ys.exports=function(r){return Qs[r]||(Qs[r]=Hv(r))}});var Pr=a((x_,Js)=>{"use strict";Js.exports={}});var Si=a((R_,eu)=>{"use strict";var Kv=zs(),Zs=S(),Gv=D(),zv=ue(),bi=B(),yi=De(),Qv=Er(),Yv=Pr(),Xs="Object already initialized",Ii=Zs.TypeError,Jv=Zs.WeakMap,Tr,Qe,wr,Xv=function(r){return wr(r)?Qe(r):Tr(r,{})},Zv=function(r){return function(e){var t;if(!Gv(e)||(t=Qe(e)).type!==r)throw new Ii("Incompatible receiver, "+r+" required");return t}};Kv||yi.state?(M=yi.state||(yi.state=new Jv),M.get=M.get,M.has=M.has,M.set=M.set,Tr=function(r,e){if(M.has(r))throw new Ii(Xs);return e.facade=r,M.set(r,e),e},Qe=function(r){return M.get(r)||{}},wr=function(r){return M.has(r)}):(re=Qv("state"),Yv[re]=!0,Tr=function(r,e){if(bi(r,re))throw new Ii(Xs);return e.facade=r,zv(r,re,e),e},Qe=function(r){return bi(r,re)?r[re]:{}},wr=function(r){return bi(r,re)});var M,re;eu.exports={set:Tr,get:Qe,has:wr,enforce:Xv,getterFor:Zv}});var te=a((C_,ru)=>{"use strict";var eg=S();ru.exports=eg.Promise});var ve=a((k_,nu)=>{"use strict";var rg=S(),Ye=te(),tg=_(),ig=kt(),og=Xt(),ng=R(),tu=Qt(),ag=U(),_i=yt(),iu=Ye&&Ye.prototype,sg=ng("species"),Ei=!1,ou=tg(rg.PromiseRejectionEvent),ug=ig("Promise",function(){var r=og(Ye),e=r!==String(Ye);if(!e&&_i===66||ag&&!(iu.catch&&iu.finally))return!0;if(!_i||_i<51||!/native code/.test(r)){var t=new Ye(function(n){n(1)}),i=function(n){n(function(){},function(){})},o=t.constructor={};if(o[sg]=i,Ei=t.then(function(){})instanceof i,!Ei)return!0}return!e&&(tu==="BROWSER"||tu==="DENO")&&!ou});nu.exports={CONSTRUCTOR:ug,REJECTION_EVENT:ou,SUBCLASSING:Ei}});var ge=a((N_,su)=>{"use strict";var au=W(),cg=TypeError,lg=function(r){var e,t;this.promise=new r(function(i,o){if(e!==void 0||t!==void 0)throw new cg("Bad Promise constructor");e=i,t=o}),this.resolve=au(e),this.reject=au(t)};su.exports.f=function(r){return new lg(r)}});var wu=a(()=>{"use strict";var dg=C(),fg=U(),xr=mr(),z=S(),Ie=L(),uu=fe(),cu=Yt(),pg=je(),hg=Xa(),vg=W(),qr=_(),gg=D(),mg=es(),bg=ei(),hu=di().set,Ai=Bs(),yg=Ws(),Ig=_r(),Sg=fi(),vu=Si(),Rr=te(),qi=ve(),gu=ge(),Cr="Promise",mu=qi.CONSTRUCTOR,_g=qi.REJECTION_EVENT,Eg=qi.SUBCLASSING,Pi=vu.getterFor(Cr),Pg=vu.set,me=Rr&&Rr.prototype,ie=Rr,Or=me,bu=z.TypeError,Ti=z.document,xi=z.process,wi=gu.f,Tg=wi,wg=!!(Ti&&Ti.createEvent&&z.dispatchEvent),yu="unhandledrejection",Og="rejectionhandled",lu=0,Iu=1,Ag=2,Ri=1,Su=2,Ar,du,qg,fu,_u=function(r){var e;return gg(r)&&qr(e=r.then)?e:!1},Eu=function(r,e){var t=e.value,i=e.state===Iu,o=i?r.ok:r.fail,n=r.resolve,s=r.reject,u=r.domain,d,l,f;try{o?(i||(e.rejection===Su&&Rg(e),e.rejection=Ri),o===!0?d=t:(u&&u.enter(),d=o(t),u&&(u.exit(),f=!0)),d===r.promise?s(new bu("Promise-chain cycle")):(l=_u(d))?Ie(l,d,n,s):n(d)):s(t)}catch(h){u&&!f&&u.exit(),s(h)}},Pu=function(r,e){r.notified||(r.notified=!0,Ai(function(){for(var t=r.reactions,i;i=t.get();)Eu(i,r);r.notified=!1,e&&!r.rejection&&xg(r)}))},Tu=function(r,e,t){var i,o;wg?(i=Ti.createEvent("Event"),i.promise=e,i.reason=t,i.initEvent(r,!1,!0),z.dispatchEvent(i)):i={promise:e,reason:t},!_g&&(o=z["on"+r])?o(i):r===yu&&yg("Unhandled promise rejection",t)},xg=function(r){Ie(hu,z,function(){var e=r.facade,t=r.value,i=pu(r),o;if(i&&(o=Ig(function(){xr?xi.emit("unhandledRejection",t,e):Tu(yu,e,t)}),r.rejection=xr||pu(r)?Su:Ri,o.error))throw o.value})},pu=function(r){return r.rejection!==Ri&&!r.parent},Rg=function(r){Ie(hu,z,function(){var e=r.facade;xr?xi.emit("rejectionHandled",e):Tu(Og,e,r.value)})},be=function(r,e,t){return function(i){r(e,i,t)}},ye=function(r,e,t){r.done||(r.done=!0,t&&(r=t),r.value=e,r.state=Ag,Pu(r,!0))},Oi=function(r,e,t){if(!r.done){r.done=!0,t&&(r=t);try{if(r.facade===e)throw new bu("Promise can't be resolved itself");var i=_u(e);i?Ai(function(){var o={done:!1};try{Ie(i,e,be(Oi,o,r),be(ye,o,r))}catch(n){ye(o,n,r)}}):(r.value=e,r.state=Iu,Pu(r,!1))}catch(o){ye({done:!1},o,r)}}};if(mu&&(ie=function(e){mg(this,Or),vg(e),Ie(Ar,this);var t=Pi(this);try{e(be(Oi,t),be(ye,t))}catch(i){ye(t,i)}},Or=ie.prototype,Ar=function(e){Pg(this,{type:Cr,done:!1,notified:!1,parent:!1,reactions:new Sg,rejection:!1,state:lu,value:void 0})},Ar.prototype=uu(Or,"then",function(e,t){var i=Pi(this),o=wi(bg(this,ie));return i.parent=!0,o.ok=qr(e)?e:!0,o.fail=qr(t)&&t,o.domain=xr?xi.domain:void 0,i.state===lu?i.reactions.add(o):Ai(function(){Eu(o,i)}),o.promise}),du=function(){var r=new Ar,e=Pi(r);this.promise=r,this.resolve=be(Oi,e),this.reject=be(ye,e)},gu.f=wi=function(r){return r===ie||r===qg?new du(r):Tg(r)},!fg&&qr(Rr)&&me!==Object.prototype)){fu=me.then,Eg||uu(me,"then",function(e,t){var i=this;return new ie(function(o,n){Ie(fu,i,o,n)}).then(e,t)},{unsafe:!0});try{delete me.constructor}catch(r){}cu&&cu(me,Or)}dg({global:!0,constructor:!0,wrap:!0,forced:mu},{Promise:ie});pg(ie,Cr,!1,!0);hg(Cr)});var oe=a(($_,Ou)=>{"use strict";Ou.exports={}});var qu=a((M_,Au)=>{"use strict";var Cg=R(),kg=oe(),Ng=Cg("iterator"),Lg=Array.prototype;Au.exports=function(r){return r!==void 0&&(kg.Array===r||Lg[Ng]===r)}});var Ci=a((V_,Ru)=>{"use strict";var Dg=Be(),xu=lr(),$g=ke(),Mg=oe(),Vg=R(),Fg=Vg("iterator");Ru.exports=function(r){if(!$g(r))return xu(r,Fg)||xu(r,"@@iterator")||Mg[Dg(r)]}});var ku=a((F_,Cu)=>{"use strict";var Ug=L(),Bg=W(),jg=H(),Wg=Le(),Hg=Ci(),Kg=TypeError;Cu.exports=function(r,e){var t=arguments.length<2?Hg(r):e;if(Bg(t))return jg(Ug(t,r));throw new Kg(Wg(r)+" is not iterable")}});var Du=a((U_,Lu)=>{"use strict";var Gg=L(),Nu=H(),zg=lr();Lu.exports=function(r,e,t){var i,o;Nu(r);try{if(i=zg(r,"return"),!i){if(e==="throw")throw t;return t}i=Gg(i,r)}catch(n){o=!0,i=n}if(e==="throw")throw t;if(o)throw i;return Nu(i),t}});var Nr=a((B_,Fu)=>{"use strict";var Qg=Me(),Yg=L(),Jg=H(),Xg=Le(),Zg=qu(),em=Ft(),$u=ur(),rm=ku(),tm=Ci(),Mu=Du(),im=TypeError,kr=function(r,e){this.stopped=r,this.result=e},Vu=kr.prototype;Fu.exports=function(r,e,t){var i=t&&t.that,o=!!(t&&t.AS_ENTRIES),n=!!(t&&t.IS_RECORD),s=!!(t&&t.IS_ITERATOR),u=!!(t&&t.INTERRUPTED),d=Qg(e,i),l,f,h,c,p,v,g,b=function(y){return l&&Mu(l,"normal",y),new kr(!0,y)},m=function(y){return o?(Jg(y),u?d(y[0],y[1],b):d(y[0],y[1])):u?d(y,b):d(y)};if(n)l=r.iterator;else if(s)l=r;else{if(f=tm(r),!f)throw new im(Xg(r)+" is not iterable");if(Zg(f)){for(h=0,c=em(r);c>h;h++)if(p=m(r[h]),p&&$u(Vu,p))return p;return new kr(!1)}l=rm(r,f)}for(v=n?r.next:l.next;!(g=Yg(v,l)).done;){try{p=m(g.value)}catch(y){Mu(l,"throw",y)}if(typeof p=="object"&&p&&$u(Vu,p))return p}return new kr(!1)}});var Hu=a((j_,Wu)=>{"use strict";var om=R(),Bu=om("iterator"),ju=!1;try{Uu=0,ki={next:function(){return{done:!!Uu++}},return:function(){ju=!0}},ki[Bu]=function(){return this},Array.from(ki,function(){throw 2})}catch(r){}var Uu,ki;Wu.exports=function(r,e){try{if(!e&&!ju)return!1}catch(o){return!1}var t=!1;try{var i={};i[Bu]=function(){return{next:function(){return{done:t=!0}}}},r(i)}catch(o){}return t}});var Ni=a((W_,Ku)=>{"use strict";var nm=te(),am=Hu(),sm=ve().CONSTRUCTOR;Ku.exports=sm||!am(function(r){nm.all(r).then(void 0,function(){})})});var Gu=a(()=>{"use strict";var um=C(),cm=L(),lm=W(),dm=ge(),fm=_r(),pm=Nr(),hm=Ni();um({target:"Promise",stat:!0,forced:hm},{all:function(e){var t=this,i=dm.f(t),o=i.resolve,n=i.reject,s=fm(function(){var u=lm(t.resolve),d=[],l=0,f=1;pm(e,function(h){var c=l++,p=!1;f++,cm(u,t,h).then(function(v){p||(p=!0,d[c]=v,--f||o(d))},n)}),--f||o(d)});return s.error&&n(s.value),i.promise}})});var Qu=a(()=>{"use strict";var vm=C(),gm=U(),mm=ve().CONSTRUCTOR,Di=te(),bm=j(),ym=_(),Im=fe(),zu=Di&&Di.prototype;vm({target:"Promise",proto:!0,forced:mm,real:!0},{catch:function(r){return this.then(void 0,r)}});!gm&&ym(Di)&&(Li=bm("Promise").prototype.catch,zu.catch!==Li&&Im(zu,"catch",Li,{unsafe:!0}));var Li});var Yu=a(()=>{"use strict";var Sm=C(),_m=L(),Em=W(),Pm=ge(),Tm=_r(),wm=Nr(),Om=Ni();Sm({target:"Promise",stat:!0,forced:Om},{race:function(e){var t=this,i=Pm.f(t),o=i.reject,n=Tm(function(){var s=Em(t.resolve);wm(e,function(u){_m(s,t,u).then(i.resolve,o)})});return n.error&&o(n.value),i.promise}})});var Ju=a(()=>{"use strict";var Am=C(),qm=ge(),xm=ve().CONSTRUCTOR;Am({target:"Promise",stat:!0,forced:xm},{reject:function(e){var t=qm.f(this),i=t.reject;return i(e),t.promise}})});var $i=a((Z_,Xu)=>{"use strict";var Rm=H(),Cm=D(),km=ge();Xu.exports=function(r,e){if(Rm(r),Cm(e)&&e.constructor===r)return e;var t=km.f(r),i=t.resolve;return i(e),t.promise}});var rc=a(()=>{"use strict";var Nm=C(),Lm=j(),Zu=U(),Dm=te(),ec=ve().CONSTRUCTOR,$m=$i(),Mm=Lm("Promise"),Vm=Zu&&!ec;Nm({target:"Promise",stat:!0,forced:Zu||ec},{resolve:function(e){return $m(Vm&&this===Mm?Dm:this,e)}})});var tc=a(()=>{"use strict";wu();Gu();Qu();Yu();Ju();rc()});var ac=a(()=>{"use strict";var Fm=C(),Um=U(),Lr=te(),Bm=O(),oc=j(),nc=_(),jm=ei(),ic=$i(),Wm=fe(),Vi=Lr&&Lr.prototype,Hm=!!Lr&&Bm(function(){Vi.finally.call({then:function(){}},function(){})});Fm({target:"Promise",proto:!0,real:!0,forced:Hm},{finally:function(r){var e=jm(this,oc("Promise")),t=nc(r);return this.then(t?function(i){return ic(e,r()).then(function(){return i})}:r,t?function(i){return ic(e,r()).then(function(){throw i})}:r)}});!Um&&nc(Lr)&&(Mi=oc("Promise").prototype.finally,Vi.finally!==Mi&&Wm(Vi,"finally",Mi,{unsafe:!0}));var Mi});var uc=a((aE,sc)=>{"use strict";xa();tc();ac();var Km=hr();sc.exports=Km("Promise","finally")});var lc=a((sE,cc)=>{"use strict";var Gm=uc();cc.exports=Gm});var Fi=a((uE,dc)=>{"use strict";var zm=lc();dc.exports=zm});var pc=a((cE,fc)=>{"use strict";var Qm=O();fc.exports=!Qm(function(){function r(){}return r.prototype.constructor=null,Object.getPrototypeOf(new r)!==r.prototype})});var Dr=a((lE,vc)=>{"use strict";var Ym=B(),Jm=_(),Xm=Ot(),Zm=Er(),eb=pc(),hc=Zm("IE_PROTO"),Ui=Object,rb=Ui.prototype;vc.exports=eb?Ui.getPrototypeOf:function(r){var e=Xm(r);if(Ym(e,hc))return e[hc];var t=e.constructor;return Jm(t)&&e instanceof t?t.prototype:e instanceof Ui?rb:null}});var bc=a((dE,mc)=>{"use strict";var tb=q(),Bi=B(),ib=J(),ob=Ut().indexOf,nb=Pr(),gc=tb([].push);mc.exports=function(r,e){var t=ib(r),i=0,o=[],n;for(n in t)!Bi(nb,n)&&Bi(t,n)&&gc(o,n);for(;e.length>i;)Bi(t,n=e[i++])&&(~ob(o,n)||gc(o,n));return o}});var ji=a((fE,yc)=>{"use strict";yc.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]});var Wi=a((pE,Ic)=>{"use strict";var ab=bc(),sb=ji();Ic.exports=Object.keys||function(e){return ab(e,sb)}});var wc=a((hE,Tc)=>{"use strict";var _c=x(),ub=O(),Ec=q(),cb=Dr(),lb=Wi(),db=J(),fb=ht().f,Pc=Ec(fb),pb=Ec([].push),hb=_c&&ub(function(){var r=Object.create(null);return r[2]=2,!Pc(r,2)}),Sc=function(r){return function(e){for(var t=db(e),i=lb(t),o=hb&&cb(t)===null,n=i.length,s=0,u=[],d;n>s;)d=i[s++],(!_c||(o?d in t:Pc(t,d)))&&pb(u,r?[d,t[d]]:t[d]);return u}};Tc.exports={entries:Sc(!0),values:Sc(!1)}});var Oc=a(()=>{"use strict";var vb=C(),gb=wc().entries;vb({target:"Object",stat:!0},{entries:function(e){return gb(e)}})});var qc=a((mE,Ac)=>{"use strict";Oc();var mb=Ne();Ac.exports=mb.Object.entries});var Rc=a((bE,xc)=>{"use strict";var bb=qc();xc.exports=bb});var Se=a((yE,Cc)=>{"use strict";var yb=Rc();Cc.exports=yb});var Lc=a((IE,Nc)=>{"use strict";var Hi=x(),Ib=B(),kc=Function.prototype,Sb=Hi&&Object.getOwnPropertyDescriptor,Ki=Ib(kc,"name"),_b=Ki&&function(){}.name==="something",Eb=Ki&&(!Hi||Hi&&Sb(kc,"name").configurable);Nc.exports={EXISTS:Ki,PROPER:_b,CONFIGURABLE:Eb}});var $c=a(Dc=>{"use strict";var Pb=x(),Tb=Nt(),wb=Z(),Ob=H(),Ab=J(),qb=Wi();Dc.f=Pb&&!Tb?Object.defineProperties:function(e,t){Ob(e);for(var i=Ab(t),o=qb(t),n=o.length,s=0,u;n>s;)wb.f(e,u=o[s++],i[u]);return e}});var Yi=a((_E,Wc)=>{"use strict";var xb=H(),Rb=$c(),Mc=ji(),Cb=Pr(),kb=ri(),Nb=dr(),Lb=Er(),Vc=">",Fc="<",zi="prototype",Qi="script",Bc=Lb("IE_PROTO"),Gi=function(){},jc=function(r){return Fc+Qi+Vc+r+Fc+"/"+Qi+Vc},Uc=function(r){r.write(jc("")),r.close();var e=r.parentWindow.Object;return r=null,e},Db=function(){var r=Nb("iframe"),e="java"+Qi+":",t;return r.style.display="none",kb.appendChild(r),r.src=String(e),t=r.contentWindow.document,t.open(),t.write(jc("document.F=Object")),t.close(),t.F},$r,Mr=function(){try{$r=new ActiveXObject("htmlfile")}catch(e){}Mr=typeof document!="undefined"?document.domain&&$r?Uc($r):Db():Uc($r);for(var r=Mc.length;r--;)delete Mr[zi][Mc[r]];return Mr()};Cb[Bc]=!0;Wc.exports=Object.create||function(e,t){var i;return e!==null?(Gi[zi]=xb(e),i=new Gi,Gi[zi]=null,i[Bc]=e):i=Mr(),t===void 0?i:Rb.f(i,t)}});var eo=a((EE,Gc)=>{"use strict";var $b=O(),Mb=_(),Vb=D(),Fb=Yi(),Hc=Dr(),Ub=fe(),Bb=R(),jb=U(),Zi=Bb("iterator"),Kc=!1,K,Ji,Xi;[].keys&&(Xi=[].keys(),"next"in Xi?(Ji=Hc(Hc(Xi)),Ji!==Object.prototype&&(K=Ji)):Kc=!0);var Wb=!Vb(K)||$b(function(){var r={};return K[Zi].call(r)!==r});Wb?K={}:jb&&(K=Fb(K));Mb(K[Zi])||Ub(K,Zi,function(){return this});Gc.exports={IteratorPrototype:K,BUGGY_SAFARI_ITERATORS:Kc}});var Qc=a((PE,zc)=>{"use strict";var Hb=eo().IteratorPrototype,Kb=Yi(),Gb=Ce(),zb=je(),Qb=oe(),Yb=function(){return this};zc.exports=function(r,e,t,i){var o=e+" Iterator";return r.prototype=Kb(Hb,{next:Gb(+!i,t)}),zb(r,o,!1,!0),Qb[o]=Yb,r}});var al=a((TE,nl)=>{"use strict";var Jb=C(),Xb=L(),Vr=U(),il=Lc(),Zb=_(),ey=Qc(),Yc=Dr(),Jc=Yt(),ry=je(),ty=ue(),ro=fe(),iy=R(),Xc=oe(),ol=eo(),oy=il.PROPER,ny=il.CONFIGURABLE,Zc=ol.IteratorPrototype,Fr=ol.BUGGY_SAFARI_ITERATORS,Je=iy("iterator"),el="keys",Xe="values",rl="entries",tl=function(){return this};nl.exports=function(r,e,t,i,o,n,s){ey(t,e,i);var u=function(m){if(m===o&&c)return c;if(!Fr&&m&&m in f)return f[m];switch(m){case el:return function(){return new t(this,m)};case Xe:return function(){return new t(this,m)};case rl:return function(){return new t(this,m)}}return function(){return new t(this)}},d=e+" Iterator",l=!1,f=r.prototype,h=f[Je]||f["@@iterator"]||o&&f[o],c=!Fr&&h||u(o),p=e==="Array"&&f.entries||h,v,g,b;if(p&&(v=Yc(p.call(new r)),v!==Object.prototype&&v.next&&(!Vr&&Yc(v)!==Zc&&(Jc?Jc(v,Zc):Zb(v[Je])||ro(v,Je,tl)),ry(v,d,!0,!0),Vr&&(Xc[d]=tl))),oy&&o===Xe&&h&&h.name!==Xe&&(!Vr&&ny?ty(f,"name",Xe):(l=!0,c=function(){return Xb(h,this)})),o)if(g={values:u(Xe),keys:n?c:u(el),entries:u(rl)},s)for(b in g)(Fr||l||!(b in f))&&ro(f,b,g[b]);else Jb({target:e,proto:!0,forced:Fr||l},g);return(!Vr||s)&&f[Je]!==c&&ro(f,Je,c,{name:o}),Xc[e]=c,g}});var ul=a((wE,sl)=>{"use strict";sl.exports=function(r,e){return{value:r,done:e}}});var io=a((OE,pl)=>{"use strict";var ay=J(),to=Bt(),cl=oe(),dl=Si(),sy=Z().f,uy=al(),Ur=ul(),cy=U(),ly=x(),fl="Array Iterator",dy=dl.set,fy=dl.getterFor(fl);pl.exports=uy(Array,"Array",function(r,e){dy(this,{type:fl,target:ay(r),index:0,kind:e})},function(){var r=fy(this),e=r.target,t=r.index++;if(!e||t>=e.length)return r.target=void 0,Ur(void 0,!0);switch(r.kind){case"keys":return Ur(t,!1);case"values":return Ur(e[t],!1)}return Ur([t,e[t]],!1)},"values");var ll=cl.Arguments=cl.Array;to("keys");to("values");to("entries");if(!cy&&ly&&ll.name!=="values")try{sy(ll,"name",{value:"values"})}catch(r){}});var vl=a((AE,hl)=>{"use strict";var py=x(),hy=Z(),vy=Ce();hl.exports=function(r,e,t){py?hy.f(r,e,vy(0,t)):r[e]=t}});var gl=a(()=>{"use strict";var gy=C(),my=Nr(),by=vl();gy({target:"Object",stat:!0},{fromEntries:function(e){var t={};return my(e,function(i,o){by(t,i,o)},{AS_ENTRIES:!0}),t}})});var bl=a((RE,ml)=>{"use strict";io();gl();var yy=Ne();ml.exports=yy.Object.fromEntries});var Il=a((CE,yl)=>{"use strict";yl.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 _l=a(()=>{"use strict";io();var Iy=Il(),Sy=S(),_y=je(),Sl=oe();for(Br in Iy)_y(Sy[Br],Br),Sl[Br]=Sl.Array;var Br});var Pl=a((LE,El)=>{"use strict";var Ey=bl();_l();El.exports=Ey});var wl=a((DE,Tl)=>{"use strict";var Py=Pl();Tl.exports=Py});var co=a((wP,Fl)=>{"use strict";var Cy=Be(),ky=String;Fl.exports=function(r){if(Cy(r)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return ky(r)}});var Bl=a((OP,Ul)=>{"use strict";var Ny=pr(),Ly=co(),Dy=ae(),$y=RangeError;Ul.exports=function(e){var t=Ly(Dy(this)),i="",o=Ny(e);if(o<0||o===1/0)throw new $y("Wrong number of repetitions");for(;o>0;(o>>>=1)&&(t+=t))o&1&&(i+=t);return i}});var Gl=a((AP,Kl)=>{"use strict";var Hl=q(),My=Vt(),jl=co(),Vy=Bl(),Fy=ae(),Uy=Hl(Vy),By=Hl("".slice),jy=Math.ceil,Wl=function(r){return function(e,t,i){var o=jl(Fy(e)),n=My(t),s=o.length,u=i===void 0?" ":jl(i),d,l;return n<=s||u===""?o:(d=n-s,l=Uy(u,jy(d/u.length)),l.length>d&&(l=By(l,0,d)),r?o+l:l+o)}};Kl.exports={start:Wl(!1),end:Wl(!0)}});var Ql=a((qP,zl)=>{"use strict";var Wy=X();zl.exports=/Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(Wy)});var Yl=a(()=>{"use strict";var Hy=C(),Ky=Gl().start,Gy=Ql();Hy({target:"String",proto:!0,forced:Gy},{padStart:function(e){return Ky(this,e,arguments.length>1?arguments[1]:void 0)}})});var Xl=a((CP,Jl)=>{"use strict";Yl();var zy=hr();Jl.exports=zy("String","padStart")});var ed=a((kP,Zl)=>{"use strict";var Qy=Xl();Zl.exports=Qy});var lo=a((NP,rd)=>{"use strict";var Yy=ed();rd.exports=Yy});var go=w(de(),1);var Fe=(s=>(s.PROD="prod",s.VK_ALIAS="vk_alias",s.VIDEOTEST="videotest",s.TEST="test",s.OKCDN="okcdn",s.AUTO="auto",s))(Fe||{}),jt=(l=>(l.Q144P="mobile",l.Q240P="lowest",l.Q360P="low",l.Q480P="medium",l.Q720P="high",l.Q1080P="fullhd",l.Q1440P="quadhd",l.Q2160P="ultrahd",l.UNKNOWN="unknown",l))(jt||{}),Wt=(p=>(p.MP4="mp4",p.DASH="dash",p.DASH_SEP="dash_sep",p.ONDEMAND_DASH="ondemand_dash",p.HLS="hls",p.ONDEMAND_HLS="ondemand_hls",p.WEBM="webm",p.AV1="av1",p.ONDEMAND_DASH_LIVE="ondemand_dash_live",p.ONDEMAND_HLS_LIVE="ondemand_hls_live",p.WEBRTC="webrtc",p.UNKNOWN="unknown",p.RTMP="rtmp",p))(Wt||{});var Ht=(i=>(i.HTTP1="http1",i.HTTP2="http2",i.HTTP3="http3",i))(Ht||{});var Kt=(u=>(u.SLIDER="slider",u.DOUBLE_TAP="double_tap",u.TIME_CODE="time_code",u.EPISODE="episode",u.REWIND="rewind",u.LIVE="live",u.UNKNOWN="unknown",u))(Kt||{}),Ea=(n=>(n.GRAPH_SHOW="iGraphShow",n.GRAPH_HIDE="iGraphHide",n.NEXT_AREA="iNextChapterArea",n.NEXT_BUTTON="iNextChapterBtn",n.WATCH_AGAIN="iWatchAgainBtn",n))(Ea||{}),Pa={action_play:"ap",action_play_interactive:"api",first_bytes:"fb",player_ready:"pr",first_frame:"ff",seek:"sk",watch_coverage_record:"wr",watch_coverage_live:"wl",empty_buffer:"eb",action_stop:"as",close_at_empty_buffer:"cb",content_error:"er",player_interface_click:"pc",next_movie:"nm",track_switch:"ts",failover:"fo",quality:"qt"},Ta={vsid:"si",isid:"is",vid:"vi",place:"pl",quality:"qt",cdn_host:"ch",stat_type:"st",param:"pm",vk_app_id:"va",track_code:"tc",connection_type:"cnt",connection_reused:"cr",cached_data:"cd",live:"lv",muted:"mu",mode:"mo",subtitles:"sb",failover:"fo",download_speed:"ds",manual_quality:"mq",ref_domain:"rd",direct_url:"du"},wa={unknown:"un",mobile:"m",lowest:"ls",low:"l",medium:"md",high:"h",fullhd:"f",quadhd:"q",ultrahd:"u"},Oa={pip:"pi",fullscreen:"fs",external:"ex",prefetch:"pr",airplay:"ap",chromecast:"cc",invisible:"iv"};import{fillWithDefault as gh}from"@vkontakte/videoplayer-shared/es2018";var vr="__VERSION__",Aa="CIOPGQJGDIHBABABA",Gt={prod:"https://api.ok.ru",vk_alias:"https://api.mycdn.me",videotest:"https://videotestapi.ok.ru/api",test:"https://apitest.ok.ru",okcdn:"https://api.okcdn.ru",auto:""};var mh={apiEnv:"vk_alias",apiKey:Aa,requestRetryCount:1,firstFlushTime:5e3,flushDebounceTime:1e4,flushMaxWait:6e4,storageExpiration:36*60*60*1e3,watchCoverageInterval:15e3,disabledOperations:["quality"],disabledCustomFields:[],shorten:!0,maxLoops:100,embedUrlParams:[],useBeacon:!0,synchronizeTime:!0,debugLog:!1,clearStorageAtUnload:!0,useVKComIsMobileLogic:!1,backoff:{start:1e3,factor:1.5,max:5*60*1e3,random:.1}},qa=r=>gh(r,mh);function zt(){let r="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),e=new Array(36),t=0,i,o;for(o=0;o<36;o++)o===8||o===13||o===18||o===23?e[o]="-":o===14?e[o]="4":(t<=2&&(t=33554432+Math.random()*16777216|0),i=t&15,t=t>>4,e[o]=r[o===19?i&3|8:i]);return e.join("")}import{assertNonNullable as iI,combine as ud,fromEvent as cd,isNonNullable as we,isNullable as ld,merge as oI,now as G,observableFrom as nI,once as aI,safeStorage as dd,Subject as sI,Subscription as mo,ValueSubject as Jr,createURL as fd}from"@vkontakte/videoplayer-shared/es2018";import{Logger as uI,detectEmbed as cI}from"@vkontakte/videoplayer-shared/es2018";var jr=w(Fi(),1);var Ol=w(Se(),1),Al=w(wl(),1);var ql=r=>{var o;let{operation:e,custom:t}=r,i=(0,Al.default)((0,Ol.default)(t).map(([n,s])=>{var l,f,h;let u=(l=Ta[n])!=null?l:n,d=s;return s&&(n==="mode"?d=(f=Oa[s])!=null?f:s:n==="quality"&&(d=(h=wa[s])!=null?h:s)),[u,d]}));return{...r,operation:(o=Pa[e])!=null?o:e,custom:i}};import{ValueSubject as Ty,getExponentialDelay as wy,ErrorCategory as _e}from"@vkontakte/videoplayer-shared/es2018";var Oy=/Mobile|mini|Fennec|Android|iP(ad|od|hone)|opera (mini|mobi)/i,Ze=class{constructor(e){this.consequentAuthErrors=0;this.authorized$=new Ty(!1);this.params=e}async authorize(e){return this.authToken=e!=null?e:await this.refreshAuthToken(),this._authorizeWithBackoff()}logBeacon(e){let t="log.externalLog",i=this.createLogParams(e),o=this.sessionKey;if(!o)return;this.params.apiTransport.sendBeacon(t,i,o)||this.logRequest(e).catch(()=>{})}async logRequest(e){var s;let t="log.externalLog",i=this.createLogParams(e),o=(s=this.sessionKey)!=null?s:await this._authorizeWithBackoff();if(!o)return;let n=async(u,d=this.params.config.requestRetryCount)=>{try{return await this.params.apiTransport.sendRequest(t,i,o)}catch(l){if(!l||!("error_code"in l)){this.params.error$.next({id:"logRequestUnknown",category:_e.NETWORK,message:`Unknown ${t} error`,thrown:l});return}let f=l==null?void 0:l.error_code;switch(f){case 102:case 103:case 104:return this.authorized$.next(!1),this.sessionKey=await this._authorizeWithBackoff(),d>0?n(u,d-1):void 0;case 401:return this.authorized$.next(!1),this.authToken=await this.refreshAuthToken(),this.sessionKey=await this._authorizeWithBackoff(),d>0?n(u,d-1):void 0;default:{this.params.error$.next({id:`LogRequest#${f}`,category:_e.EXTERNAL_API,message:`${t} error`,data:l});return}}}};return n(e)}destroy(){window.clearTimeout(this.backoffTimeoutId),this.backoffTimeoutId=0}async refreshAuthToken(){if(this.params.refreshAuthToken)return this.refreshAuthTokenPromise||(this.refreshAuthTokenPromise=(0,jr.default)(this.params.refreshAuthToken(),()=>{this.refreshAuthTokenPromise=void 0})),this.refreshAuthTokenPromise}createLogParams(e){let t="WEB",i=!1,o=`@vkontakte/videoplayer-statistics:${vr}`;if(this.params.config.useVKComIsMobileLogic){let{appVersion:n}=window.navigator;i=Oy.test(n)}else this.params.mobile&&(i=!0);return i&&(t="M_WEB"),this.params.vktvVersion&&(t="SMART_TV",o=this.params.vktvVersion),{collector:"ok.mobile.apps.video",data:JSON.stringify({application:o,platform:t,items:this.params.config.shorten?e.map(ql):e})}}_authorizeWithBackoff(){if(!this.consequentAuthErrors)return this._authorize();let e=wy(this.consequentAuthErrors,this.params.config.backoff);return new Promise(t=>{this.backoffTimeoutId||(this.backoffTimeoutId=window.setTimeout(()=>{(0,jr.default)(this._authorize().then(t).catch(i=>this.params.error$.next({id:"AuthorizeBackoff",category:_e.NETWORK,message:"Otherwise unhandled error in authorization",thrown:i})),()=>this.backoffTimeoutId=0)},e))})}async _authorize(){if(this.authorizePromise)return this.authorizePromise;this.sessionKey=void 0,this.authorized$.next(!1);let e="auth.anonymLogin",t={session_data:{version:2,device_id:this.params.deviceId,client_version:vr.split("-")[0],client_type:"SDK_JS"}};return this.authToken!==void 0&&(t.session_data.auth_token=this.authToken,t.session_data.version=3),this.authorizePromise=(0,jr.default)(this.params.apiTransport.sendRequest(e,t).then(i=>{var o;return(!i||!i.session_key)&&this.params.error$.next({id:"AuthorizeFailed",category:_e.EXTERNAL_API,message:"No session key",data:i}),this.sessionKey=(o=i==null?void 0:i.session_key)!=null?o:void 0,this.sessionKey}).catch(async i=>{this.sessionKey=void 0;let o=i==null?void 0:i.error_code;switch(o){case 401:return this.authToken=await this.refreshAuthToken(),this._authorizeWithBackoff()}o?this.params.error$.next({id:`Authorize#${o}`,category:_e.EXTERNAL_API,message:"authorize error",data:i}):this.params.error$.next({id:"AuthorizeUnknown",category:_e.NETWORK,message:"authorize error",thrown:i})}),()=>{this.authorizePromise=void 0,this.consequentAuthErrors=this.sessionKey?0:this.consequentAuthErrors+1,this.authorized$.next(this.sessionKey!==void 0)}),this.authorizePromise}};var Wr=class{constructor(){Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}addEventListener(e,t,i){e in this.listeners||(this.listeners[e]=[]),this.listeners[e].push({callback:t,options:i})}removeEventListener(e,t){if(!(e in this.listeners))return;let i=this.listeners[e];for(let o=0,n=i.length;o<n;o++)if(i[o].callback===t){i.splice(o,1);return}}dispatchEvent(e){if(!(e.type in this.listeners))return;let i=this.listeners[e.type].slice();for(let o=0,n=i.length;o<n;o++){let s=i[o];try{s.callback.call(this,e)}catch(u){Promise.resolve().then(()=>{throw u})}s.options&&s.options.once&&this.removeEventListener(e.type,s.callback)}return!e.defaultPrevented}},Ee=class extends Wr{constructor(){super(),this.listeners||Wr.call(this),Object.defineProperty(this,"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"onabort",{value:null,writable:!0,configurable:!0}),Object.defineProperty(this,"reason",{value:void 0,writable:!0,configurable:!0})}toString(){return"[object AbortSignal]"}dispatchEvent(e){e.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,e)),super.dispatchEvent(e)}},er=class{constructor(){Object.defineProperty(this,"signal",{value:new Ee,writable:!0,configurable:!0})}abort(e){let t;try{t=new Event("abort")}catch(o){typeof document!="undefined"?document.createEvent?(t=document.createEvent("Event"),t.initEvent("abort",!1,!1)):(t=document.createEventObject(),t.type="abort"):t={type:"abort",bubbles:!1,cancelable:!1}}let i=e;if(i===void 0)if(typeof document=="undefined")i=new Error("This operation was aborted"),i.name="AbortError";else try{i=new DOMException("signal is aborted without reason")}catch(o){i=new Error("This operation was aborted"),i.name="AbortError"}this.signal.reason=i,this.signal.dispatchEvent(t)}toString(){return"[object AbortController]"}};typeof Symbol!="undefined"&&Symbol.toStringTag&&(er.prototype[Symbol.toStringTag]="AbortController",Ee.prototype[Symbol.toStringTag]="AbortSignal");function Hr(r){return r.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):typeof r.Request=="function"&&!r.Request.prototype.hasOwnProperty("signal")||!r.AbortController}function oo(r){typeof r=="function"&&(r={fetch:r});let{fetch:e,Request:t=e.Request,AbortController:i,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o=!1}=r;if(!Hr({fetch:e,Request:t,AbortController:i,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o}))return{fetch:e,Request:n};let n=t;(n&&!n.prototype.hasOwnProperty("signal")||o)&&(n=function(l,f){let h;f&&f.signal&&(h=f.signal,delete f.signal);let c=new t(l,f);return h&&Object.defineProperty(c,"signal",{writable:!1,enumerable:!1,configurable:!0,value:h}),c},n.prototype=t.prototype);let s=e;return{fetch:(d,l)=>{let f=n&&n.prototype.isPrototypeOf(d)?d.signal:l?l.signal:void 0;if(f){let h;try{h=new DOMException("Aborted","AbortError")}catch(p){h=new Error("Aborted"),h.name="AbortError"}if(f.aborted)return Promise.reject(h);let c=new Promise((p,v)=>{f.addEventListener("abort",()=>v(h),{once:!0})});return l&&l.signal&&delete l.signal,Promise.race([c,s(d,l)])}return s(d,l)},Request:n}}var Ay=()=>"fetch"in window,rr=Ay()&&Hr({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),xl=rr?oo({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,Pe=rr?xl.fetch:window.fetch,rP=rr?xl.Request:window.Request,tP=rr?er:window.AbortController,iP=rr?Ee:window.AbortSignal;var Rl=w(de(),1),Cl=w(Se(),1);import{ErrorCategory as Kr,now as no}from"@vkontakte/videoplayer-shared/es2018";var tr=class{constructor(e){this.params=e,this.apiKey=e.config.apiKey,this.apiEnv=e.config.apiEnv,this.apiBaseUrl=Gt[this.apiEnv],this.timeSynchronisation=e.timeSynchronisation,this.isApiBaseUrlFetched=!1}async resolveApiBaseUrl(){var e;if(this.apiEnv!=="auto"||this.isApiBaseUrlFetched)return this.apiBaseUrl;try{let t=atob("aHR0cHM6Ly9kbnMuZ29vZ2xlL3Jlc29sdmU/bmFtZT12aWRlby5fZW5kcG9pbnQub2sucnUmdHlwZT1UWFQ="),o=await(await Pe(t,{method:"GET",mode:"cors",cache:"no-cache"})).json(),n=(e=o==null?void 0:o.Answer[0])==null?void 0:e.data;if(!n)throw new Error("Wrong DNS response");return n}catch(t){return this.params.error$.next({id:"OneStat:ApiTransport:resolveApiBaseUrl",category:Kr.NETWORK,message:"Unhandled resolve api base url error",thrown:t}),Gt.vk_alias}finally{this.isApiBaseUrlFetched=!0}}sendBeacon(e,t,i){if(!window.Blob||!window.navigator.sendBeacon)return!1;let o=this._prepareQueryParams({method:e,queryParams:t,sessionKey:i}),n=new window.Blob([o.toString()],{type:"application/x-www-form-urlencoded"});try{return window.navigator.sendBeacon(`${this.apiBaseUrl}/fb.do`,n)}catch(s){this.params.error$.next({id:"OneStat:ApiTransport:sendBeacon",category:Kr.NETWORK,message:"Unhandled beacon error",thrown:s,data:{method:e,params:t}})}return!1}async sendRequest(e,t,i){let o=no(),n=s=>{if(s instanceof TypeError&&(0,Rl.default)(["Failed to fetch","NetworkError when attempting to fetch resource."],s.message)){this.params.error$.next({id:"Network",category:Kr.NETWORK,message:"Request failed",thrown:s});return}this.params.error$.next({id:"OneStat:ApiTransport:sendRequest",category:Kr.NETWORK,message:"Unhandled request error",thrown:s,data:{method:e,params:t,sessionKey:i,time:no()-o}})};return this.apiBaseUrl=await this.resolveApiBaseUrl(),Pe(`${this.apiBaseUrl}/fb.do`,{method:"post",headers:{"Content-type":"application/x-www-form-urlencoded"},body:this._prepareQueryParams({method:e,queryParams:t,sessionKey:i})}).then(s=>{var f,h;let u=Number(s.headers.get("content-length"))===0,d=new Date((f=s.headers.get("date"))!=null?f:"").getTime(),l=no()-o;if(isFinite(d)&&((h=this.timeSynchronisation)==null||h.addServerTime(d,l)),!u)return s.json().then(c=>Object.prototype.hasOwnProperty.call(c,"error_msg")?Promise.reject(c):c,n)},n)}_prepareQueryParams(e){let t=new URLSearchParams({format:"JSON",method:e.method,application_key:this.apiKey});return e.sessionKey!==void 0&&t.append("session_key",e.sessionKey),(0,Cl.default)(e.queryParams).forEach(([i,o])=>t.append(i,typeof o=="string"?o:JSON.stringify(o))),t}};var Nl=w(de(),1),Ll=w(Se(),1);import{ErrorCategory as qy,now as xy,safeStorage as ir,debounceFn as kl}from"@vkontakte/videoplayer-shared/es2018";var Gr="onestat_events",ao=r=>e=>e.timestamp+r>=xy(),zr=class{constructor(e){this.unsaltedStorage=[];this.isPaused=!1;this.isUrgent=e=>{let{operation:t}=e;return(0,Nl.default)(["action_play","watch_coverage_record","watch_coverage_live"],t)};this.params=e,this.api=e.api,this.error$=e.error$,this.userSalt=e.userSalt,this.loggerDebugLog=e.debugLogger.createComponentLog("stat logger"),this.firstFlush=kl(()=>this.safeFlush(),this.params.config.firstFlushTime,{maxWait:this.params.config.firstFlushTime});let t=ir.isPersistent()?this.params.config.flushMaxWait:0;this.debouncedFlush=kl(()=>this.safeFlush(),this.params.config.flushDebounceTime,{maxWait:t}),this.subscription=this.api.authorized$.subscribe(i=>{i&&this.debouncedFlush()}),this.housekeepStorage()}safeFlush(){try{this.flush()}catch(e){this.error$.next({id:"LoggerError",category:qy.WTF,message:e?String(e):"Unknown logger error",thrown:e})}}readFromStorage(){let e=ir.get(Gr);try{return e?JSON.parse(e):{}}catch(t){}return{}}addToStorage(e){var n;if(!this.userSalt){this.unsaltedStorage.push(e);return}let t=this.readFromStorage(),o=((n=t[this.userSalt])!=null?n:[]).filter(ao(this.params.config.storageExpiration));ir.set(Gr,JSON.stringify({...t,[this.userSalt]:[...o,e]}))}getFromStorage(){var i;return this.userSalt?((i=this.readFromStorage()[this.userSalt])!=null?i:[]).filter(ao(this.params.config.storageExpiration)):this.unsaltedStorage}markStorageSent(){if(!this.userSalt){this.unsaltedStorage=[];return}let e=this.readFromStorage();delete e[this.userSalt],ir.set(Gr,JSON.stringify(e))}housekeepStorage(){let e=this.readFromStorage();for(let[t,i]of(0,Ll.default)(e)){let o=i.filter(ao(this.params.config.storageExpiration));o.length?e[t]=o:delete e[t],this.loggerDebugLog({message:`${i.length} retrieved from storage, ${o.length} of them actual`})}ir.set(Gr,JSON.stringify(e))}log(e){this.addToStorage(e),!this.isPaused&&(this.isUrgent(e)?this.flush():this.lastVsid!==e.custom.vsid?this.firstFlush():this.debouncedFlush(),this.lastVsid=e.custom.vsid)}flush({wantBeacon:e,clearStorage:t}={wantBeacon:!1,clearStorage:!0}){let i=this.getFromStorage();i.length!==0&&(this.api.authorized$.getValue()?(e&&this.params.config.useBeacon?(this.loggerDebugLog({message:`Flushing ${i.length} events through beacon`}),this.api.logBeacon(i)):(this.loggerDebugLog({message:`Flushing ${i.length} events`}),this.api.logRequest(i)),t&&this.markStorageSent()):this.api.authorize(),this.firstFlush.cancel(),this.debouncedFlush.cancel())}pause(){this.isPaused=!0,this.debouncedFlush.cancel()}resume(){this.isPaused=!1,this.debouncedFlush()}destroy(){this.subscription.unsubscribe(),this.firstFlush.cancel(),this.debouncedFlush.cancel()}};import{HttpConnectionType as so,Surface as Te,VideoFormat as A,VideoQuality as V}from"@vkontakte/videoplayer-core/es2018";import{assertNever as Dl}from"@vkontakte/videoplayer-shared/es2018";var $l=r=>r&&{[V.INVARIANT]:"unknown",[V.Q_144P]:"mobile",[V.Q_240P]:"lowest",[V.Q_360P]:"low",[V.Q_480P]:"medium",[V.Q_576P]:"unknown",[V.Q_720P]:"high",[V.Q_1080P]:"fullhd",[V.Q_1440P]:"quadhd",[V.Q_2160P]:"ultrahd",[V.Q_4320P]:"unknown"}[r],uo=r=>r&&{[so.HTTP1]:"http1",[so.HTTP2]:"http2",[so.QUIC]:"http3"}[r],Ml=r=>{if(r!==void 0)switch(r){case A.MPEG:return"mp4";case A.DASH:case A.DASH_LIVE:case A.DASH_STREAMS:return"dash";case A.DASH_SEP:return"dash_sep";case A.DASH_ONDEMAND:return"ondemand_dash";case A.DASH_WEBM:case A.DASH_LIVE_WEBM:return"webm";case A.DASH_WEBM_AV1:return"av1";case A.DASH_LIVE_CMAF:return"ondemand_dash_live";case A.HLS:case A.HLS_LIVE:return"hls";case A.HLS_ONDEMAND:return"ondemand_hls";case A.HLS_LIVE_CMAF:return"ondemand_hls_live";case A.WEB_RTC_LIVE:return"webrtc";default:return Dl(r)}},Qr=r=>{if(r!==void 0)switch(r){case Te.NONE:case Te.INLINE:return;case Te.FULLSCREEN:return"fullscreen";case Te.SECOND_SCREEN:return"chromecast";case Te.PIP:return"pip";case Te.INVISIBLE:return"invisible";default:return Dl(r)}},Vl=r=>{switch(r){case"slow-2g":return"poor";case"2g":return"poor";case"3g":return"good";case"4g":return"excellent"}};var Yr=class{constructor(e){this.offset=void 0;this.offset=e}getOffset(){var e;return(e=this.offset)!=null?e:0}setOffset(e){this.offset=e}now(){var e;return Date.now()+((e=this.offset)!=null?e:0)}date(e=new Date){var t;return e.setTime(e.getTime()+((t=this.offset)!=null?t:0)),e}addServerTime(e,t){let i=Date.now(),o=e-i-t/2;if(Math.abs(o)<1e3){this.offset=0;return}this.offset===void 0?this.offset=Math.round(o):this.offset=Math.round(.2*o+(1-.2)*this.offset)}};var fo=w(lo(),1),td=()=>(0,fo.default)(Math.floor(Math.random()*2**32).toString(36),7,"0"),id=()=>(0,fo.default)(Math.floor(Math.random()*2**64).toString(36),13,"0");import{PlaybackState as od}from"@vkontakte/videoplayer-core/es2018";import{filter as nd,filterChanged as Jy,fromEvent as Xy,isNullable as ad,map as Zy,merge as po,Observable as eI,Subject as ho,Subscription as rI,ValueSubject as tI}from"@vkontakte/videoplayer-shared/es2018";var sd=(r,e)=>new eI(t=>{let i=new rI,o=po(Xy(window,"beforeunload"),r.events.willDestruct$),n=new tI(void 0),s;i.add(r.info.isLive$.pipe(Jy()).subscribe(I=>{s&&(s.unsubscribe(),n.next(void 0)),I?s=r.info.liveTime$.pipe(Zy(T=>T&&T/1e3)).subscribe(n):s=r.info.position$.subscribe(n),i.add(s)}));let{playing$:u,paused$:d}=r.events,l=r.events.willSeek$.pipe(nd(()=>r.info.playbackState$.getValue()===od.PLAYING)),f=r.events.seeked$.pipe(nd(()=>r.info.playbackState$.getValue()===od.PLAYING)),h=!1,c=new ho;i.add(l.subscribe(()=>{h||c.next(),h=!0})),i.add(f.subscribe(()=>h=!1));let p=new ho,v=new ho,g=po(u,f,p),b=po(d,c,o,r.events.looped$,v),m,y=()=>m=n.getValue(),P=()=>{let I=n.getValue();ad(m)||m===I||ad(I)||(t.next({from:m,to:I}),m=void 0)},N=()=>{v.next(),p.next()};if(i.add(g.subscribe(y)),i.add(b.subscribe(P)),e.forceInterval&&isFinite(e.forceInterval)){let I=0;i.add(g.subscribe(()=>I=window.setTimeout(N,e.forceInterval))),i.add(b.subscribe(()=>window.clearTimeout(I)))}return i});var lI="_one-stat_",pd=`${lI}deviceId`,vo=()=>{let r=new mo;return{subscription:r,subscribe:(e,t)=>{e&&r.add(e.subscribe(t))}}},bo=class{constructor(e,t){this.subscription=new mo;this.debugLogger=new uI;this.oneStatDebugLog=this.debugLogger.createComponentLog("onestat");this.loopCounter=0;this.disabled=!1;this.vsid$=new Jr(void 0);this.isid$=new Jr(void 0);this.zenUid$=new Jr(void 0);this.seekAction$=new Jr("unknown");var d,l,f;this.statContext=e,this.config=qa((d=t.config)!=null?d:{}),we(t.apiEnv)&&(this.config.apiEnv=t.apiEnv),this.config.synchronizeTime&&(this.timeSynchronisation=new Yr);let i=new sI;this.experimental={error$:i};let o=dd.get(pd);this.statContext.deviceId?this.deviceId=this.statContext.deviceId:o?this.deviceId=o:(this.deviceId=zt(),dd.set(pd,this.deviceId)),this.resetViewSession(),t.useIsid&&this.isid$.next((l=t.isid)!=null?l:id()),this.zenUid$.next(t.zenUid);let n=new tr({config:this.config,error$:i,timeSynchronisation:this.timeSynchronisation});this.api=new Ze({config:this.config,apiTransport:n,refreshAuthToken:t.refreshAuthToken,mobile:(f=this.statContext.mobile)!=null?f:!1,deviceId:this.deviceId,error$:i,vktvVersion:t.vktvVersion}),this.logger=new zr({config:this.config,debugLogger:this.debugLogger,api:this.api,error$:i,userSalt:t.userSalt});let{isEmbed:s,topOrigin:u}=cI();this.isEmbed=s,this.embedParent=u?new URL(u).hostname:void 0,this.subscribe()}updateContext(e){this.statContext={...this.statContext,...e}}attachTo(e){let t=new mo,i=(c,p)=>t.add(c.subscribe(p));i(e.events.willStart$,()=>{let c=e.info.position$.getValue();this.logActionPlay({position:c}),this.statContext.projectId&&this.logActionPlayInteractive()}),i(e.events.looped$,()=>{this.resetViewSession(),++this.loopCounter>this.config.maxLoops&&(this.disabled=!0),this.logActionPlay({position:e.info.position$.getValue()})}),i(e.events.seeked$,()=>{this.logSeek({action:this.seekAction$.getValue(),time:e.info.position$.getValue()}),this.seekAction$.next("unknown")}),i(e.events.paused$,()=>{this.logPause({position:e.info.position$.getValue()})}),i(e.events.willResume$,()=>{this.logPlay()}),i(e.events.started$,()=>{this.statContext.clip&&this.logWatchCoverageRecord({start:0,end:0})}),i(e.events.playing$,()=>{this.logPlaying()}),i(sd(e,{forceInterval:this.config.watchCoverageInterval}),c=>{var b,m,y,P;let p=e.info.isLive$.getValue(),v=e.info.atLiveEdge$.getValue(),g={start:parseFloat(c.from.toFixed(3)),end:parseFloat(c.to.toFixed(3))};if(v){let N=(b=e.info.liveLatency$.getValue())!=null?b:0,I=(y=(m=e.info.currentBuffer$.getValue())==null?void 0:m.end)!=null?y:0,T=(P=e.info.liveBufferTime$.getValue())!=null?P:0,nr=Math.round((N-(I-T))*1e3),ar=Math.round(N*1e3);nr&&ar&&(g.latency=nr,g.bufferLatency=ar)}p?this.logWatchCoverageLive(g):this.logWatchCoverageRecord(g)});let o;i(e.info.isStalled$,c=>{c?o=G():(we(o)&&this.logEmptyBuffer({duration:G()-o}),o=void 0)});let n=!1;t.add(e.events.fatalError$.pipe(aI()).subscribe(()=>n=!0)),i(e.events.willStop$,()=>{if(e.info.isStalled$.getValue()){let p=we(o)?G()-o:void 0;this.logCloseAtEmptyBuffer({duration:p!=null?p:0}),o=void 0}else n||this.logActionStop()}),i(e.events.managedError$,({id:c})=>{this.logError({fatal:!1,errorType:c})}),i(e.events.fatalError$,({id:c})=>{this.logError({fatal:!0,errorType:c})});let s,u,d=!1;i(e.events.firstBytes$,c=>{s=G(),this.logFirstBytes({time:c})}),i(e.events.willStart$,()=>u=G()),i(e.info.currentBuffer$,c=>{!d&&c&&c.end-c.start>0&&we(s)&&(this.logPlayerReady({duration:G()-s}),d=!0)}),i(e.events.firstFrame$,()=>{we(s)&&!d&&(this.logPlayerReady({duration:G()-s}),d=!0),we(u)&&this.logFirstFrame({time:G()-u})});let l;i(e.info.currentVideoStream$,c=>{c&&(l&&c.id!==l&&this.logTrackSwitch(c),l=c.id)});let f;i(e.info.currentAudioStream$,c=>{c&&(f&&c.id!==f&&this.logTrackSwitch(c),f=c.id)}),i(e.info.atLiveEdge$,c=>this.updateContext({liveEdge:c})),i(ud({muted:e.info.muted$,volume:e.info.volume$}),({muted:c,volume:p})=>this.updateContext({audible:!c&&p>0})),i(e.info.currentQuality$,c=>{let p=$l(c);this.updateContext({quality:p}),p&&this.logQuality(p)}),i(e.info.isAutoQualityEnabled$,c=>this.updateContext({autoQuality:c})),i(e.info.currentFormat$,c=>this.updateContext({contentType:Ml(c)})),i(e.info.currentPlaybackRate$,c=>this.updateContext({rate:c})),i(e.info.is3DVideo$,c=>this.updateContext({is3d:c}));let h;return i(e.info.hostname$,c=>{let p=h!==void 0&&h!==c;this.updateContext({cdnHostname:c,failover:p}),p&&this.logFailover(c),h=c}),i(e.info.throughputEstimation$,c=>this.updateContext({downloadSpeed:c})),i(e.info.httpConnectionType$,c=>{this.statContext.firstConnectionType||this.updateContext({firstConnectionType:uo(c)}),this.updateContext({connectionType:uo(c)})}),i(e.info.httpConnectionReused$,c=>{ld(this.statContext.firstConnectionReused)&&this.updateContext({firstConnectionReused:c}),this.updateContext({connectionReused:c})}),i(e.info.surface$,c=>this.updateContext({mode:Qr(c)})),i(ud({current:e.info.currentTextTrack$,available:e.info.availableTextTracks$}),({current:c,available:p})=>{let v=p.find(({id:b})=>b===c),g=v&&(v.isAuto?`${v.language}_auto`:v.language);this.updateContext({subtitles:g==null?void 0:g.split(".")[0]})}),this.player=e,this.uiEvents&&this.attachToUi(this.uiEvents),this.resubscribeBeforeunload(),this.subscription.add(t),t}attachToUi(e){this.uiEvents=e;let{subscription:t,subscribe:i}=vo();return this.player&&(i(e.actionRewind$,()=>{this.player&&(this.resetViewSession(),this.logActionPlay({position:this.player.info.position$.getValue()}))}),i(e.actionSeek$,this.seekAction$),i(e.inPiP$,o=>{var s;let n=o?"pip":Qr((s=this.player)==null?void 0:s.info.surface$.getValue());this.updateContext({mode:n})}),i(e.inFullscreen$,o=>{var s;let n=o?"fullscreen":Qr((s=this.player)==null?void 0:s.info.surface$.getValue());this.updateContext({mode:n})}),i(e.actionSetSubtitle$,o=>this.updateContext({subtitles:o.split(".")[0]})),i(e.nextMovie$,o=>this.logNextMovie(o)),this.resubscribeBeforeunload(),this.subscription.add(t)),t}attachToAds(e){let{subscription:t,subscribe:i}=vo();return i(e.slotRequested$,()=>this.logAdSlotRequest()),i(e.started$,o=>this.logAdStarted(o)),i(e.paused$,()=>this.logAdPaused()),i(e.resumed$,()=>this.logAdResumed()),i(e.ended$,()=>this.logAdEnded()),i(e.skipped$,()=>this.logAdSkipped()),i(e.clicked$,()=>this.logAdClicked()),i(e.error$,o=>this.logError({errorType:o,fatal:!1})),this.resubscribeBeforeunload(),this.subscription.add(t),t}attachToInteractive(e){let{subscription:t,subscribe:i}=vo();return i(e.click$,o=>this.logInterfaceClick(o)),i(e.nextMovie$,o=>this.logNextMovie(o)),this.resubscribeBeforeunload(),this.subscription.add(t),t}authorize(e){return this.api.authorize(e)}pause(){this.logger.pause(),this.oneStatDebugLog({message:"paused"})}resume(){this.logger.resume(),this.oneStatDebugLog({message:"resumed"})}destroy(){this.logger.flush(),this.subscription.unsubscribe(),this.api.destroy(),this.logger.destroy()}resetViewSession(){this.oneStatDebugLog({message:"VSID reset"}),this.vsid$.next(td())}getDeviceId(){return this.deviceId}setFieldBlacklist(){}logInited(){}logReady(e){this.log({operation:"player_ready",param:String(e.time)})}logStarted(...e){this.logActionPlay(...e)}logPlay(){this.log({operation:"play_toggle"})}logPlaying(){this.log({operation:"playing"})}logPause(e){this.log({operation:"pause",param:String(Math.round(e.position))})}logSeek(e){this.log({operation:"seek",param:e.action,time:e.time})}logFirstBytes(e){this.log({operation:"first_bytes",param:String(e.time)})}logFirstFrame(e){this.log({operation:"first_frame",param:String(e.time)})}logError(e){this.log({operation:"content_error",param:`${e.fatal?"fatal":"recoverable"}_${e.errorType}`})}logWatchCoverageRecord(e){this.log({operation:"watch_coverage_record",param:`${e.start}-${e.end}`},{in_history:this.statContext.inHistory?1:void 0})}logWatchCoverageLive(e){var n,s;let t=(s=(n=this.timeSynchronisation)==null?void 0:n.getOffset())!=null?s:0,i=e.start+t,o=e.end+t;this.log({operation:"watch_coverage_live",param:`${i}-${o}`},{in_history:this.statContext.inHistory?1:void 0,latency:e.latency,buffer_latency:e.bufferLatency})}logEmptyBuffer(e){this.log({operation:"empty_buffer",param:String(e.duration)})}logDownloadSpeed(){}logAdSlotRequest(){this.log({operation:"adv",param:"slot_request"})}logAdStarted(e){this.log({operation:"adv",param:e})}logAdPaused(){this.log({operation:"adv",param:"pause"})}logAdResumed(){this.log({operation:"adv",param:"resume"})}logAdEnded(){this.log({operation:"adv",param:"ended"})}logAdSkipped(){this.log({operation:"adv",param:"skip"})}logAdClicked(){this.log({operation:"adv",param:"click"})}logInterfaceClick(e){this.log({operation:"player_interface_click",param:e})}logNextMovie(e){this.log({operation:"next_movie",param:String(e)})}subscribe(){this.resubscribeBeforeunload();let e=window.navigator.connection;e&&"onchange"in e&&"effectiveType"in e&&this.subscription.add(oI(cd(e,"change"),nI(["init"])).subscribe(()=>this.updateContext({network:Vl(e.effectiveType)}))),this.config.debugLog&&this.debugLogger.log$.subscribe(t=>{console.debug("%c stat ","background:#fa6470;",`component: ${t.component}.`,t.message)})}resubscribeBeforeunload(){var e;(e=this.beforeunloadSubscription)==null||e.unsubscribe(),this.beforeunloadSubscription=cd(window,"beforeunload").subscribe(()=>this.logger.flush({wantBeacon:!0,clearStorage:this.config.clearStorageAtUnload})),this.subscription.add(this.beforeunloadSubscription)}logPlayerReady(e){this.log({operation:"player_ready",param:String(Math.round(e.duration))})}logActionPlay(e){this.log({operation:"action_play",param:String(Math.round(e.position))})}logActionPlayInteractive(){this.statContext.projectId&&this.log({operation:"action_play_interactive",param:String(this.statContext.movieId)},{vid:this.statContext.projectId})}logFailover(e){this.log({operation:"failover",param:e})}logCloseAtEmptyBuffer(e){this.log({operation:"close_at_empty_buffer",param:String(Math.round(e.duration))})}logActionStop(){this.log({operation:"action_stop"})}logTrackSwitch(e){this.log({operation:"track_switch",param:e.id})}logQuality(e){this.log({operation:"quality",param:e})}log(e,t={}){if(this.disabled){this.oneStatDebugLog({message:`operation ${e.operation} but statistics is disabled`});return}if((0,go.default)(this.config.disabledOperations,e.operation)){this.oneStatDebugLog({message:`operation ${e.operation} but it is disabled`});return}this.oneStatDebugLog({message:`operation ${e.operation} ${e.param}`});let i=this.createLogItem(e,t);this.logger.log(i)}createLogItem({operation:e,param:t,time:i},o={}){var p,v,g,b,m,y;let n=(v=(p=this.timeSynchronisation)==null?void 0:p.now())!=null?v:G(),s=this.vsid$.getValue();iI(s);let u=this.isid$.getValue(),d=e==="empty_buffer"||e==="close_at_empty_buffer"?this.statContext.connectionType:this.statContext.firstConnectionType,l=this.statContext.firstConnectionReused,f,h;if(this.isEmbed||this.statContext.place==="embed"){f=this.embedParent;let P=[...new URLSearchParams(location.search).entries()].filter(([N,I])=>(0,go.default)(this.config.embedUrlParams,N));h=new URLSearchParams(P).toString()}else this.statContext.place==="direct"&&(this.statContext.refDomain?f=(b=(g=fd(this.statContext.refDomain))==null?void 0:g.hostname)!=null?b:this.statContext.refDomain:document.referrer&&(f=(y=(m=fd(document.referrer))==null?void 0:m.hostname)!=null?y:document.referrer),h=location.href.substring(0,1024));let c={vsid:s,isid:u,vid:this.statContext.movieId,uid:this.zenUid$.getValue(),ct:this.statContext.contentType,place:this.isEmbed?"embed":this.statContext.place,quality:this.statContext.quality,cdn_host:this.statContext.cdnHostname,stat_type:this.statContext.autoplay===!0?"auto":this.statContext.autoplay===!1?"":void 0,param:t,vk_app_id:this.statContext.vkAppId,track_code:this.statContext.trackCode,connection_type:d,connection_reused:l===!0?1:l===!1?0:void 0,cached_data:this.statContext.cached===!0?1:this.statContext.cached===!1?0:void 0,live:this.statContext.liveEdge?1:void 0,muted:this.statContext.audible===!1?1:void 0,mode:this.statContext.mode,subtitles:this.statContext.subtitles,download_speed:this.statContext.downloadSpeed,manual_quality:this.statContext.autoQuality?void 0:1,ref_domain:f,direct_url:h,rate:this.statContext.rate===1||ld(this.statContext.rate)?void 0:this.statContext.rate.toFixed(2),view_360:this.statContext.is3d?1:void 0,aid:this.statContext.albumId,vk_playlist_id:this.statContext.vkPlaylistId,...o};for(let P of this.config.disabledCustomFields)delete c[P];return{operation:e,type:1,time:i,network:this.statContext.network,timestamp:n,custom:c}}};var qo={};Kd(qo,{SeekType:()=>Xr,ThinOneStat:()=>at,VERSION:()=>Q});import{assertNonNullable as TI,detectEmbed as wI,fromEvent as OI,Logger as AI,merge as $d,safeStorage as Md,Subject as qI,Subscription as Ao,ValueSubject as nt}from"@vkontakte/videoplayer-shared/es2018";import{clientChecker as ne,PlaybackState as Vd}from"@vkontakte/videoplayer-core/es2018";import{fillWithDefault as dI}from"@vkontakte/videoplayer-shared/es2018";var Xr=(u=>(u.SLIDER="slider",u.DOUBLE_TAP="double_tap",u.TIME_CODE="time_code",u.EPISODE="episode",u.REWIND="rewind",u.LIVE="live",u.UNKNOWN="unknown",u))(Xr||{});var Q="__VERSION__",vd="CIOPGQJGDIHBABABA",yo={prod:"https://api.ok.ru",vk_alias:"https://api.mycdn.me",videotest:"https://videotestapi.ok.ru/api",test:"https://apitest.ok.ru",okcdn:"https://api.okcdn.ru",auto:""};var fI={apiKey:vd,apiEnv:"vk_alias",requestRetryCount:1,firstFlushTime:5e3,flushDebounceTime:1e4,flushMaxWait:6e4,storageExpiration:36*60*60*1e3,watchCoverageHeartbeatInterval:15,synchronizeTime:!0,useBeacon:!1,alwaysSendDesktop:!1},gd=r=>dI(r,fI);var Io=w(Fi(),1);import{getExponentialDelay as pI,ErrorCategory as Oe,ValueSubject as hI}from"@vkontakte/videoplayer-shared/es2018";var Zr=class{constructor(e){this.params=e,this.authorized$=new hI(!1),this.consequentAuthErrors=0}async authorize(e){return this.authToken=e!=null?e:await this.refreshAuthToken(),this.authorizeWithBackoff()}logBeacon(e){let t="log.logUvStat",i=this.createLogParams(e),o=this.sessionKey;if(!o)return;this.params.apiTransport.sendBeacon(t,i,o)||this.logRequest(e).catch(()=>{})}async logRequest(e){var u;let t="log.logUvStat",i=this.createLogParams(e),o={},n=(u=this.sessionKey)!=null?u:await this.authorizeWithBackoff();if(!n)return;let s=async(d,l=this.params.config.requestRetryCount)=>{try{return await this.params.apiTransport.sendRequest(t,i,n,o)}catch(f){if(!f||!("error_code"in f)){this.params.error$.next({id:"logRequestUnknown",category:Oe.NETWORK,message:`Unknown ${t} error`,thrown:f});return}let h=f==null?void 0:f.error_code;switch(h){case 102:case 103:case 104:return this.authorized$.next(!1),this.sessionKey=await this.authorizeWithBackoff(),l>0?s(d,l-1):void 0;case 401:return this.authorized$.next(!1),this.authToken=await this.refreshAuthToken(),this.sessionKey=await this.authorizeWithBackoff(),l>0?s(d,l-1):void 0;default:{this.params.error$.next({id:`LogRequest#${h}`,category:Oe.EXTERNAL_API,message:`${t} error`,data:f});return}}}};return s(e)}destroy(){window.clearTimeout(this.backoffTimeoutId),this.backoffTimeoutId=0}async refreshAuthToken(){if(this.params.refreshAuthToken)return this.refreshAuthTokenPromise||(this.refreshAuthTokenPromise=(0,Io.default)(this.params.refreshAuthToken(),()=>{this.refreshAuthTokenPromise=void 0})),this.refreshAuthTokenPromise}createLogParams(e){return{collector:"ok.mobile.apps.video",uv_stat_data:JSON.stringify({application:`@vkontakte/videoplayer-statistics:${Q}`,platform:e[0].platform,product:e[0].product,events:e})}}authorizeWithBackoff(){if(!this.consequentAuthErrors)return this.doAuthorize();let e=pI(this.consequentAuthErrors);return new Promise(t=>{this.backoffTimeoutId||(this.backoffTimeoutId=window.setTimeout(async()=>{try{let i=await this.doAuthorize();t(i)}catch(i){this.params.error$.next({id:"AuthorizeBackoff",category:Oe.NETWORK,message:"Otherwise unhandled error in authorization",thrown:i})}finally{this.backoffTimeoutId=0}},e))})}doAuthorize(){if(this.authorizePromise)return this.authorizePromise;this.sessionKey=void 0,this.authorized$.next(!1);let e="auth.anonymLogin",t={session_data:{version:2,device_id:this.params.deviceId,client_version:Q.split("-")[0],client_type:"SDK_JS"}};return this.authToken!==void 0&&(t.session_data.auth_token=this.authToken,t.session_data.version=3),this.authorizePromise=(0,Io.default)(this.params.apiTransport.sendRequest(e,t).then(i=>{var o;return(!i||!i.session_key)&&this.params.error$.next({id:"AuthorizeFailed",category:Oe.EXTERNAL_API,message:"No session key",data:i}),this.sessionKey=(o=i==null?void 0:i.session_key)!=null?o:void 0,this.sessionKey}).catch(async i=>{this.sessionKey=void 0;let o=i==null?void 0:i.error_code;switch(o){case 401:return this.authToken=await this.refreshAuthToken(),this.authorizeWithBackoff()}o?this.params.error$.next({id:`Authorize#${o}`,category:Oe.EXTERNAL_API,message:"authorize error",data:i}):this.params.error$.next({id:"AuthorizeUnknown",category:Oe.NETWORK,message:"authorize error",thrown:i})}),()=>{this.authorizePromise=void 0,this.consequentAuthErrors=this.sessionKey?0:this.consequentAuthErrors+1,this.authorized$.next(this.sessionKey!==void 0)}),this.authorizePromise}};var md=w(de(),1);var bd=w(Se(),1);import{now as So,ErrorCategory as et}from"@vkontakte/videoplayer-shared/es2018";var rt=class{constructor(e){this.params=e,this.apiKey=e.config.apiKey,this.apiEnv=e.config.apiEnv,this.apiBaseUrl=yo[this.apiEnv],this.timeSynchronisation=e.timeSynchronisation,this.isApiBaseUrlFetched=!1}sendBeacon(e,t,i){if(!window.Blob||!window.navigator.sendBeacon)return!1;let o=this.prepareQueryParams({method:e,queryParams:t,sessionKey:i}),n=new window.Blob([o.toString()],{type:"application/x-www-form-urlencoded"});try{return window.navigator.sendBeacon(`${this.apiBaseUrl}/fb.do`,n)}catch(s){this.params.error$.next({id:"OneStat:ApiTransport:sendBeacon",category:et.NETWORK,message:"Unhandled beacon error",thrown:s,data:{method:e,params:t}})}return!1}async sendRequest(e,t,i,o){let n=So(),s=u=>{if(u instanceof TypeError&&(0,md.default)(["Failed to fetch","NetworkError when attempting to fetch resource."],u.message)){this.params.error$.next({id:"Network",category:et.NETWORK,message:"Request failed",thrown:u});return}this.params.error$.next({id:"ThinOneStat:ApiTransport:sendRequest",category:et.NETWORK,message:"Unhandled request error",thrown:u,data:{method:e,params:t,sessionKey:i,time:So()-n}})};return this.apiBaseUrl=await this.resolveApiBaseUrl(),Pe(`${this.apiBaseUrl}/fb.do`,{method:"post",headers:{"Content-type":"application/x-www-form-urlencoded",...o},body:this.prepareQueryParams({method:e,queryParams:t,sessionKey:i})}).then(u=>{var h,c;let d=Number(u.headers.get("content-length"))===0,l=new Date((h=u.headers.get("date"))!=null?h:"").getTime(),f=So()-n;if(isFinite(l)&&((c=this.timeSynchronisation)==null||c.addServerTime(l,f)),!d)return u.json().then(p=>Object.prototype.hasOwnProperty.call(p,"error_msg")?Promise.reject(p):p,s)},s)}async resolveApiBaseUrl(){var e;if(this.apiEnv!=="auto"||this.isApiBaseUrlFetched)return this.apiBaseUrl;try{let t=atob("aHR0cHM6Ly9kbnMuZ29vZ2xlL3Jlc29sdmU/bmFtZT12aWRlby5fZW5kcG9pbnQub2sucnUmdHlwZT1UWFQ="),o=await(await Pe(t,{method:"GET",mode:"cors",cache:"no-cache"})).json(),n=(e=o==null?void 0:o.Answer[0])==null?void 0:e.data;if(!n)throw new Error("Wrong DNS response");return n}catch(t){return this.params.error$.next({id:"ThinOneStat:ApiTransport:resolveApiBaseUrl",category:et.NETWORK,message:"Unhandled resolve api base url error",thrown:t}),yo.vk_alias}finally{this.isApiBaseUrlFetched=!0}}prepareQueryParams(e){let t=new URLSearchParams({format:"JSON",method:e.method,application_key:this.apiKey});return e.sessionKey!==void 0&&t.append("session_key",e.sessionKey),(0,bd.default)(e.queryParams).forEach(([i,o])=>t.append(i,typeof o=="string"?o:JSON.stringify(o))),t}};var Id=w(de(),1),Sd=w(Se(),1);import{ErrorCategory as vI,now as gI,safeStorage as or,debounceFn as yd}from"@vkontakte/videoplayer-shared/es2018";var tt="thinonestat_events",_o=r=>e=>e.client_time+r>=gI(),it=class{constructor(e){this.unsaltedStorage=[];this.isPaused=!1;this.isUrgent=e=>{let{event_name:t}=e;return(0,Id.default)(["watch_coverage","watch_coverage_live","watched_n","playback_started"],t)};this.params=e,this.api=e.api,this.error$=e.error$,this.userSalt=e.userSalt,this.loggerDebugLog=e.debugLogger.createComponentLog("stat logger"),this.firstFlush=yd(()=>this.safeFlush(),this.params.config.firstFlushTime,{maxWait:this.params.config.firstFlushTime});let t=or.isPersistent()?this.params.config.flushMaxWait:0;this.debouncedFlush=yd(()=>this.safeFlush(),this.params.config.flushDebounceTime,{maxWait:t}),this.subscription=this.api.authorized$.subscribe(i=>{i&&this.debouncedFlush()}),this.housekeepStorage()}safeFlush(){try{this.flush()}catch(e){this.error$.next({id:"LoggerError",category:vI.WTF,message:String(e)||"Unknown logger error",thrown:e})}}readFromStorage(){let e=or.get(tt);try{return e?JSON.parse(e):{}}catch(t){}return{}}addToStorage(e){var n;if(!this.userSalt){this.unsaltedStorage.push(e);return}let t=this.readFromStorage(),o=((n=t[this.userSalt])!=null?n:[]).filter(_o(this.params.config.storageExpiration));or.set(tt,JSON.stringify({...t,[this.userSalt]:[...o,e]}))}getFromStorage(){var i;return this.userSalt?((i=this.readFromStorage()[this.userSalt])!=null?i:[]).filter(_o(this.params.config.storageExpiration)):this.unsaltedStorage}markStorageSent(){if(!this.userSalt){this.unsaltedStorage=[];return}let e=this.readFromStorage();delete e[this.userSalt],or.set(tt,JSON.stringify(e))}housekeepStorage(){let e=this.readFromStorage();for(let[t,i]of(0,Sd.default)(e)){let o=i.filter(_o(this.params.config.storageExpiration));o.length?e[t]=o:delete e[t],this.loggerDebugLog({message:`${i.length} retrieved from storage, ${o.length} of them actual`})}or.set(tt,JSON.stringify(e))}log(e){this.addToStorage(e),!this.isPaused&&(this.isUrgent(e)?this.flush():this.lastVsid!==e.vsid?this.firstFlush():this.debouncedFlush(),this.lastVsid=e.vsid)}flush({wantBeacon:e,clearStorage:t}={wantBeacon:!1,clearStorage:!0}){let i=this.getFromStorage();i.length!==0&&(this.api.authorized$.getValue()?(e&&this.params.config.useBeacon?(this.loggerDebugLog({message:`Flushing ${i.length} events through beacon`}),this.api.logBeacon(i)):(this.loggerDebugLog({message:`Flushing ${i.length} events`}),this.api.logRequest(i)),t&&this.markStorageSent()):this.api.authorize(),this.firstFlush.cancel(),this.debouncedFlush.cancel())}pause(){this.isPaused=!0,this.debouncedFlush.cancel()}resume(){this.isPaused=!1,this.debouncedFlush()}destroy(){this.subscription.unsubscribe(),this.firstFlush.cancel(),this.debouncedFlush.cancel()}};function Eo(){let r="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),e=new Array(36),t=0,i,o;for(o=0;o<36;o++)o===8||o===13||o===18||o===23?e[o]="-":o===14?e[o]="4":(t<=2&&(t=33554432+Math.random()*16777216|0),i=t&15,t=t>>4,e[o]=r[o===19?i&3|8:i]);return e.join("")}var ot=class{constructor(e){this.offset=void 0;this.offset=e}getOffset(){var e;return(e=this.offset)!=null?e:0}setOffset(e){this.offset=e}now(){var e;return Date.now()+((e=this.offset)!=null?e:0)}date(e=new Date){var t;return e.setTime(e.getTime()+((t=this.offset)!=null?t:0)),e}addServerTime(e,t){let i=Date.now(),o=e-i-t/2;if(Math.abs(o)<1e3){this.offset=0;return}this.offset===void 0?this.offset=Math.round(o):this.offset=Math.round(.2*o+(1-.2)*this.offset)}};import{PlaybackState as _d}from"@vkontakte/videoplayer-core/es2018";import{Observable as mI,Subscription as bI,ValueSubject as yI,Subject as Po,fromEvent as II,isNullable as Ed,merge as To,filter as Pd,filterChanged as Td}from"@vkontakte/videoplayer-shared/es2018";var wd=(r,e)=>new mI(t=>{let i=new bI,o=new yI(void 0),n;i.add(r.info.isLive$.pipe(Td()).subscribe(T=>{n&&(n.unsubscribe(),o.next(void 0)),T?n=r.info.liveTime$.pipe(Td()).subscribe(o):n=r.info.position$.subscribe(o),i.add(n)}));let{playing$:s,paused$:u,ended$:d,looped$:l}=r.events,f=r.events.willSeek$.pipe(Pd(()=>r.info.playbackState$.getValue()===_d.PLAYING)),h=r.events.seeked$.pipe(Pd(()=>r.info.playbackState$.getValue()===_d.PLAYING)),c=!1,p=new Po;i.add(f.subscribe(()=>{c||p.next(),c=!0})).add(h.subscribe(()=>c=!1));let v=To(II(window,"beforeunload"),r.events.willDestruct$),g,b=()=>g=o.getValue(),m=()=>{let T=o.getValue();Ed(g)||Ed(T)||g===T||(t.next({from:g,to:T}),g=void 0)},y=new Po,P=new Po,N=To(s,p,y),I=To(u,h,v,d,l,P);if(i.add(N.subscribe(b)).add(I.subscribe(m)),e.heartbeatInterval&&isFinite(e.heartbeatInterval)){let T=[],nr=e.heartbeatInterval*1e3,ar=()=>{P.next(),y.next()};i.add(N.subscribe(()=>{let st=window.setTimeout(ar,nr);T.push(st)})).add(I.subscribe(()=>{T.forEach(st=>{window.clearTimeout(st)}),T=[]}))}return i});import{Subscription as SI}from"@vkontakte/videoplayer-core/es2018";import{Observable as _I}from"@vkontakte/videoplayer-shared/es2018";var Od=(r,e)=>new _I(t=>{let i=new SI,o=1e4,n=0;return i.add(r.info.position$.subscribe(()=>{let s=e.getTotalViewTime()*1e3;s>n&&s%o===0&&(n=s,t.next({target_duration:o,current_tvt:s}))})),i});import{Observable as EI,Subscription as PI,merge as Ad}from"@vkontakte/videoplayer-shared/es2018";var qd=r=>new EI(e=>{let t=new PI,i=0,o=1,n=0,s=!1,u=!1,d=()=>{if(!s)return;let I=Date.now();n+=(I-i)*o,i=I},l=()=>{(!s||u)&&(i=Date.now(),s=!0,u=!1)},f=()=>{s&&(d(),s=!1)},h=()=>{s&&(d(),s=!1,u=!0)},c=I=>{s&&d(),o=I,i=Date.now()},{started$:p,playing$:v,paused$:g,willSeek$:b,ended$:m,willDestruct$:y}=r.events,{currentPlaybackRate$:P}=r.info;t.add(b.subscribe(h)).add(Ad(p,v).subscribe(l)).add(Ad(g,m,y).subscribe(f)).add(P.subscribe(c));let N=()=>{let I=n;return s&&(I+=(Date.now()-i)*o),Math.floor(I/1e3)};return e.next(N),t});import{assertNever as xd}from"@vkontakte/videoplayer-shared/es2018";import{Surface as Ae,VideoFormat as E,VideoQuality as F}from"@vkontakte/videoplayer-core/es2018";var wo=r=>{if(r!==void 0)switch(r){case E.MPEG:return"MP4";case E.DASH:case E.DASH_LIVE:return"DASH";case E.DASH_SEP:return"DASH_SEP";case E.DASH_ONDEMAND:return"ONDEMAND_DASH";case E.HLS_ONDEMAND:return"ONDEMAND_HLS";case E.HLS:case E.HLS_LIVE:return"HLS";case E.DASH_WEBM:case E.DASH_LIVE_WEBM:return"WEBM";case E.DASH_LIVE_CMAF:return"ONDEMAND_DASH_LIVE";case E.HLS_LIVE_CMAF:return"ONDEMAND_HLS_LIVE";case E.WEB_RTC_LIVE:return"WEBRTC";case E.DASH_WEBM_AV1:return"AV1";case E.DASH_STREAMS:return"MULTI_DASH";default:return xd(r)}},Y=r=>{if(r!==void 0)switch(r){case F.Q_144P:return"144p";case F.Q_240P:return"240p";case F.Q_360P:return"360p";case F.Q_480P:return"480p";case F.Q_720P:return"720p";case F.Q_1080P:return"1080p";case F.Q_1440P:return"1440p";case F.Q_2160P:return"2160p";case F.INVARIANT:case F.Q_576P:case F.Q_4320P:return"UNKNOWN";default:return xd(r)}},Rd=r=>{if(r!==void 0)switch(r){case"MP4":case"ONDEMAND_DASH":case"ONDEMAND_DASH_LIVE":case"ONDEMAND_HLS":case"ONDEMAND_HLS_LIVE":case"MULTI_DASH":case"WEBM":case"AV1":return"vod";case"DASH":case"HLS":case"WEBRTC":return"live";default:return}},Cd=(r,e,t)=>{var i;if(r&&e)switch(r){case E.MPEG:return t&&e[r]&&e[r][t];default:return(i=e[r])==null?void 0:i.url}},kd=r=>{if(r!==void 0)switch(r){case Ae.NONE:return;case Ae.INLINE:return"inline";case Ae.FULLSCREEN:return"fullscreen";case Ae.SECOND_SCREEN:return"chromecast";case Ae.PIP:return"pip_external"}},Nd=r=>{if(r!==void 0)return r===Ae.INVISIBLE?"background":"foreground"};var Oo=w(lo(),1),Ld=()=>(0,Oo.default)(Math.floor(Math.random()*2**32).toString(36),13,"0"),Dd=()=>(0,Oo.default)(Math.floor(Math.random()*2**64).toString(36),13,"0");var xI="_thin-one-stat_",Fd=`${xI}deviceId`,RI=()=>{let r=new Ao;return{subscription:r,subscribe:(e,t)=>{e&&r.add(e.subscribe(t))}}},at=class{constructor(e,t){this.debugLogger=new AI;this.thinOneStatDebugLog=this.debugLogger.createComponentLog("ThinOneStat");this.eventNumber=1;this.seekAction$=new nt("unknown");this.playerSize$=new nt({width:0,height:0});this.vsid$=new nt(void 0);this.isid$=new nt(void 0);var d,l;this.statContext=e,this.config=gd((d=t.config)!=null?d:{}),this.subscription=new Ao,this.config.synchronizeTime&&(this.timeSynchronisation=new ot);let i=new qI,o=Md.get(Fd);this.statContext.deviceId?this.deviceId=this.statContext.deviceId:o?this.deviceId=o:(this.deviceId=Eo(),Md.set(Fd,this.deviceId)),this.resetViewSession(),t.useIsid&&this.isid$.next((l=t.isid)!=null?l:Dd());let n=new rt({error$:i,config:this.config,timeSynchronisation:this.timeSynchronisation});this.api=new Zr({config:this.config,apiTransport:n,error$:i,deviceId:this.deviceId,refreshAuthToken:t.refreshAuthToken}),this.logger=new it({config:this.config,debugLogger:this.debugLogger,api:this.api,error$:i,userSalt:t.userSalt});let{isEmbed:s,topOrigin:u}=wI();this.isEmbed=s,this.embedHostname=u?new URL(u).hostname:void 0}authorize(e){return this.api.authorize(e)}updateContext(e){this.statContext={...this.statContext,...e}}attachTo(e){let t=new Ao,i=(n,s)=>t.add(n.subscribe(s));i(qd(e),n=>{this.getTotalViewTime=n}),i(e.info.isLive$,n=>this.isLive=n),i(e.info.position$,n=>this.position=n);let o;return i(e.info.hostname$,n=>{o!==void 0&&o!==n&&this.logFailover({cdn_host:n}),this.cdnHostname=o=n}),i(wd(e,{heartbeatInterval:this.config.watchCoverageHeartbeatInterval}),n=>{let s=Math.round(n.from*1e3),u=Math.round(n.to*1e3),d={watch_interval:`${s}-${u}`,in_history:!!this.statContext.inHistory,content_type:wo(e.info.currentFormat$.getValue()),playback_quality:Y(e.info.currentQuality$.getValue()),recom_info:this.statContext.recomInfo};if(!e.info.isLive$.getValue())this.logWatchCoverage(d);else{let f=e.info.atLiveEdge$.getValue();this.logWatchCoverageLive({...d,live:!!f})}}),i(Od(e,{getTotalViewTime:this.getTotalViewTime}),n=>{this.logWatchedN(n)}),i($d(e.events.willStart$,e.events.looped$),n=>{var u;n&&this.resetViewSession();let s={isid:this.isid$.getValue(),stream_profile:Rd(wo(e.info.currentFormat$.getValue())),dpi:ne.display.pixelRatio,web_layout:ne.device.isMobile?"mobile":"desktop",iframe_host:this.isEmbed?(u=this.embedHostname)!=null?u:void 0:null,from_downloads:!0,preloaded:this.statContext.preload,navigation:this.statContext.navigation,recom_info:this.statContext.recomInfo};this.logStartSession(s)}),i(e.events.willReady$,()=>{if(this.statContext.preload){let n=e.info.currentFormat$.getValue(),s=e.info.availableSources$.getValue(),u=e.info.currentBuffer$.getValue(),d=e.info.currentQuality$.getValue(),l={target_buffer_time:u?u.end-u.start:void 0,playback_url:Cd(n,s,d),playback_quality:Y(d)};this.logPreloadStarted(l)}}),i(e.events.ready$,()=>{if(this.statContext.preload){let n=e.info.currentBuffer$.getValue(),s={buffer_time:n?n.end-n.start:void 0};this.logPreloadEnded(s)}}),i(e.events.playing$,()=>{this.logPlay()}),i(e.info.playbackState$,n=>{var s;if(n===Vd.PLAYING){let u=e.info.currentBuffer$.getValue(),d={buffer_time:u?u.end-u.start:void 0};if(this.logPlaying(d),this.isStarted)this.logResume();else{this.isStarted=!0;let l=e.info.currentQuality$.getValue(),f=e.info.isAutoQualityEnabled$.getValue(),h=e.info.muted$.getValue(),c=e.info.volume$.getValue(),p=e.info.surface$.getValue(),v=e.info.availableTextTracks$.getValue(),g=e.info.currentTextTrack$.getValue(),b=e.info.currentAudioStream$.getValue(),m=e.info.currentPlaybackRate$.getValue(),y={playback_quality:Y(l),user_quality:f?"auto":Y(l),player_width:this.playerSize$.getValue().width,player_height:this.playerSize$.getValue().height,muted:h,sound_volume:c,buffer_time:u?Math.round(u.end-u.start):void 0,mode:kd(p),visibility:Nd(p),subtitles_enabled:!!g,auto_subtitles:!!((s=v.find(({id:P})=>P===g))!=null&&s.isAuto),audio_track_lang:b==null?void 0:b.language,playback_rate:m,recom_info:this.statContext.recomInfo};this.logPlaybackStarted(y)}}else n===Vd.PAUSED&&this.logPause()}),i(e.events.willSeek$,({to:n})=>{let s={target_position:n,seek_type:this.seekAction$.getValue()};this.logSeeking(s)}),i(e.events.seeked$,()=>{let s={target_position:e.info.position$.getValue(),seek_type:this.seekAction$.getValue()};this.logSeeked(s),this.seekAction$.next("unknown")}),i($d(e.info.isBuffering$,e.info.isStalled$),n=>{n&&this.logShowLoader()}),i(e.info.currentQuality$,n=>{var s,u;if(n){let d=e.info.isAutoQualityEnabled$.getValue(),l=(s=e.info.currentVideoStream$.getValue())==null?void 0:s.codec,f=(u=e.info.currentAudioStream$.getValue())==null?void 0:u.codec,h={user_quality:d?"auto":Y(n),playback_quality:Y(n),download_quality:Y(n),codec_info:l&&f?`${l},${f}`:void 0,manual_switch:!d};this.logQualityChanged(h)}}),this.resubscribeBeforeunload(),this.subscription.add(t),t}attachToUi(e){let{subscribe:t,subscription:i}=RI();return t(e.actionSeek$,this.seekAction$),t(e.playerSize$,this.playerSize$),this.subscription.add(i),i}getDeviceId(){return this.deviceId}resetViewSession(){this.thinOneStatDebugLog({message:"VSID reset"}),this.vsid$.next(Ld()),this.eventNumber=0}destroy(){this.api.destroy()}createRequiredParams(e){let t=this.vsid$.getValue();TI(t);let i=this.eventNumber++;return{vsid:t,uv_movie_id:this.statContext.movieId,event_name:e,client_time:Date.now(),application:`@vkontakte/videoplayer-statistics:${Q}`,platform:`web:${ne.device.isMobile?"mobile":"desktop"}`,product:this.statContext.product,event_number:i,playback_position:this.isLive?void 0:Math.round(this.position),current_tvt:this.getTotalViewTime(),cdn_host:this.cdnHostname}}createRequiredFatParams(){return{stats_version:Q,browser:ne.browser.current,browser_version:String(ne.browser.currentVersion),os:ne.device.current,os_version:"",device_type:ne.device.isMobile?"mobile":"desktop",navigation:this.statContext.navigation}}log(e,t,i=!1){let o=this.createRequiredParams(e),n={};i&&(n=this.createRequiredFatParams()),this.logger.log({...o,...n,...t})}logWatchCoverage(e){this.log("watch_coverage",e,!0)}logWatchCoverageLive(e){this.log("watch_coverage_live",e,!0)}logWatchedN(e){this.log("watched_n",e,!0)}logStartSession(e){this.log("start_session",e,!0)}logPreloadStarted(e){this.log("preload_started",e)}logPreloadEnded(e){this.log("preload_ended",e)}logPlaybackStarted(e){this.log("playback_started",e,!0)}logPlay(){this.log("play")}logPlaying(e){this.log("playing",e)}logPause(){this.log("pause")}logResume(){this.log("resume")}logSeeking(e){this.log("seeking",e)}logSeeked(e){this.log("seeked",e)}logShowLoader(){this.log("show_loader")}logQualityChanged(e){this.log("quality_changed",e)}logFailover(e){this.log("failover",e)}resubscribeBeforeunload(){var e;(e=this.beforeunloadSubscription)==null||e.unsubscribe(),this.beforeunloadSubscription=OI(window,"beforeunload").subscribe(()=>{}),this.subscription.add(this.beforeunloadSubscription)}};export{Fe as ApiEnv,Ht as ConnectionType,Wt as ContentType,Ea as InteractiveInterfaceClick,bo as OneStat,jt as Quality,Kt as SeekAction,qo as ThinOneStat,vr as VERSION};
|