@vkontakte/videoplayer-statistics 1.0.81-dev.6c99e2bc.0 → 1.0.81-dev.c4949db3.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/es2018.cjs.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
- * @vkontakte/videoplayer-statistics v1.0.81-dev.6c99e2bc.0
3
- * Tue, 01 Jul 2025 12:01:18 GMT
2
+ * @vkontakte/videoplayer-statistics v1.0.81-dev.c4949db3.0
3
+ * Tue, 01 Jul 2025 13:54:01 GMT
4
4
  * https://st.mycdn.me/static/vkontakte-videoplayer/1-0-81/doc/
5
5
  */
6
- "use strict";var Id=Object.create;var cr=Object.defineProperty;var Sd=Object.getOwnPropertyDescriptor;var _d=Object.getOwnPropertyNames;var Ed=Object.getPrototypeOf,Pd=Object.prototype.hasOwnProperty;var a=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),Po=(r,e)=>{for(var t in e)cr(r,t,{get:e[t],enumerable:!0})},To=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of _d(e))!Pd.call(r,o)&&o!==t&&cr(r,o,{get:()=>e[o],enumerable:!(i=Sd(e,o))||i.enumerable});return r};var R=(r,e,t)=>(t=r!=null?Id(Ed(r)):{},To(e||!r||!r.__esModule?cr(t,"default",{value:r,enumerable:!0}):t,r)),Td=r=>To(cr({},"__esModule",{value:!0}),r);var O=a((pt,wo)=>{"use strict";var ke=function(r){return r&&r.Math===Math&&r};wo.exports=ke(typeof globalThis=="object"&&globalThis)||ke(typeof window=="object"&&window)||ke(typeof self=="object"&&self)||ke(typeof global=="object"&&global)||ke(typeof pt=="object"&&pt)||function(){return this}()||Function("return this")()});var C=a((xy,Oo)=>{"use strict";Oo.exports=function(r){try{return!!r()}catch(e){return!0}}});var Ne=a((Ry,Ao)=>{"use strict";var wd=C();Ao.exports=!wd(function(){var r=function(){}.bind();return typeof r!="function"||r.hasOwnProperty("prototype")})});var ht=a((Cy,Co)=>{"use strict";var Od=Ne(),Ro=Function.prototype,qo=Ro.apply,xo=Ro.call;Co.exports=typeof Reflect=="object"&&Reflect.apply||(Od?xo.bind(qo):function(){return xo.apply(qo,arguments)})});var k=a((ky,Lo)=>{"use strict";var ko=Ne(),No=Function.prototype,vt=No.call,Ad=ko&&No.bind.bind(vt,vt);Lo.exports=ko?Ad:function(r){return function(){return vt.apply(r,arguments)}}});var Le=a((Ny,$o)=>{"use strict";var Do=k(),qd=Do({}.toString),xd=Do("".slice);$o.exports=function(r){return xd(qd(r),8,-1)}});var gt=a((Ly,Mo)=>{"use strict";var Rd=Le(),Cd=k();Mo.exports=function(r){if(Rd(r)==="Function")return Cd(r)}});var A=a((Dy,Vo)=>{"use strict";var mt=typeof document=="object"&&document.all;Vo.exports=typeof mt=="undefined"&&mt!==void 0?function(r){return typeof r=="function"||r===mt}:function(r){return typeof r=="function"}});var N=a(($y,Fo)=>{"use strict";var kd=C();Fo.exports=!kd(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})});var U=a((My,Uo)=>{"use strict";var Nd=Ne(),lr=Function.prototype.call;Uo.exports=Nd?lr.bind(lr):function(){return lr.apply(lr,arguments)}});var bt=a(Wo=>{"use strict";var Bo={}.propertyIsEnumerable,jo=Object.getOwnPropertyDescriptor,Ld=jo&&!Bo.call({1:2},1);Wo.f=Ld?function(e){var t=jo(this,e);return!!t&&t.enumerable}:Bo});var De=a((Fy,Ho)=>{"use strict";Ho.exports=function(r,e){return{enumerable:!(r&1),configurable:!(r&2),writable:!(r&4),value:e}}});var Go=a((Uy,Ko)=>{"use strict";var Dd=k(),$d=C(),Md=Le(),yt=Object,Vd=Dd("".split);Ko.exports=$d(function(){return!yt("z").propertyIsEnumerable(0)})?function(r){return Md(r)==="String"?Vd(r,""):yt(r)}:yt});var $e=a((By,zo)=>{"use strict";zo.exports=function(r){return r==null}});var he=a((jy,Qo)=>{"use strict";var Fd=$e(),Ud=TypeError;Qo.exports=function(r){if(Fd(r))throw new Ud("Can't call method on "+r);return r}});var ne=a((Wy,Yo)=>{"use strict";var Bd=Go(),jd=he();Yo.exports=function(r){return Bd(jd(r))}});var B=a((Hy,Jo)=>{"use strict";var Wd=A();Jo.exports=function(r){return typeof r=="object"?r!==null:Wd(r)}});var Me=a((Ky,Xo)=>{"use strict";Xo.exports={}});var Y=a((Gy,en)=>{"use strict";var It=Me(),St=O(),Hd=A(),Zo=function(r){return Hd(r)?r:void 0};en.exports=function(r,e){return arguments.length<2?Zo(It[r])||Zo(St[r]):It[r]&&It[r][e]||St[r]&&St[r][e]}});var dr=a((zy,rn)=>{"use strict";var Kd=k();rn.exports=Kd({}.isPrototypeOf)});var ae=a((Qy,nn)=>{"use strict";var Gd=O(),tn=Gd.navigator,on=tn&&tn.userAgent;nn.exports=on?String(on):""});var Et=a((Yy,dn)=>{"use strict";var ln=O(),_t=ae(),an=ln.process,sn=ln.Deno,un=an&&an.versions||sn&&sn.version,cn=un&&un.v8,j,fr;cn&&(j=cn.split("."),fr=j[0]>0&&j[0]<4?1:+(j[0]+j[1]));!fr&&_t&&(j=_t.match(/Edge\/(\d+)/),(!j||j[1]>=74)&&(j=_t.match(/Chrome\/(\d+)/),j&&(fr=+j[1])));dn.exports=fr});var Pt=a((Jy,pn)=>{"use strict";var fn=Et(),zd=C(),Qd=O(),Yd=Qd.String;pn.exports=!!Object.getOwnPropertySymbols&&!zd(function(){var r=Symbol("symbol detection");return!Yd(r)||!(Object(r)instanceof Symbol)||!Symbol.sham&&fn&&fn<41})});var Tt=a((Xy,hn)=>{"use strict";var Jd=Pt();hn.exports=Jd&&!Symbol.sham&&typeof Symbol.iterator=="symbol"});var wt=a((Zy,vn)=>{"use strict";var Xd=Y(),Zd=A(),ef=dr(),rf=Tt(),tf=Object;vn.exports=rf?function(r){return typeof r=="symbol"}:function(r){var e=Xd("Symbol");return Zd(e)&&ef(e.prototype,tf(r))}});var Ve=a((eI,gn)=>{"use strict";var of=String;gn.exports=function(r){try{return of(r)}catch(e){return"Object"}}});var J=a((rI,mn)=>{"use strict";var nf=A(),af=Ve(),sf=TypeError;mn.exports=function(r){if(nf(r))return r;throw new sf(af(r)+" is not a function")}});var pr=a((tI,bn)=>{"use strict";var uf=J(),cf=$e();bn.exports=function(r,e){var t=r[e];return cf(t)?void 0:uf(t)}});var In=a((iI,yn)=>{"use strict";var Ot=U(),At=A(),qt=B(),lf=TypeError;yn.exports=function(r,e){var t,i;if(e==="string"&&At(t=r.toString)&&!qt(i=Ot(t,r))||At(t=r.valueOf)&&!qt(i=Ot(t,r))||e!=="string"&&At(t=r.toString)&&!qt(i=Ot(t,r)))return i;throw new lf("Can't convert object to primitive value")}});var z=a((oI,Sn)=>{"use strict";Sn.exports=!0});var Pn=a((nI,En)=>{"use strict";var _n=O(),df=Object.defineProperty;En.exports=function(r,e){try{df(_n,r,{value:e,configurable:!0,writable:!0})}catch(t){_n[r]=e}return e}});var Fe=a((aI,On)=>{"use strict";var ff=z(),pf=O(),hf=Pn(),Tn="__core-js_shared__",wn=On.exports=pf[Tn]||hf(Tn,{});(wn.versions||(wn.versions=[])).push({version:"3.38.0",mode:ff?"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 xt=a((sI,qn)=>{"use strict";var An=Fe();qn.exports=function(r,e){return An[r]||(An[r]=e||{})}});var Rt=a((uI,xn)=>{"use strict";var vf=he(),gf=Object;xn.exports=function(r){return gf(vf(r))}});var Q=a((cI,Rn)=>{"use strict";var mf=k(),bf=Rt(),yf=mf({}.hasOwnProperty);Rn.exports=Object.hasOwn||function(e,t){return yf(bf(e),t)}});var Ct=a((lI,Cn)=>{"use strict";var If=k(),Sf=0,_f=Math.random(),Ef=If(1 .toString);Cn.exports=function(r){return"Symbol("+(r===void 0?"":r)+")_"+Ef(++Sf+_f,36)}});var L=a((dI,Nn)=>{"use strict";var Pf=O(),Tf=xt(),kn=Q(),wf=Ct(),Of=Pt(),Af=Tt(),ve=Pf.Symbol,kt=Tf("wks"),qf=Af?ve.for||ve:ve&&ve.withoutSetter||wf;Nn.exports=function(r){return kn(kt,r)||(kt[r]=Of&&kn(ve,r)?ve[r]:qf("Symbol."+r)),kt[r]}});var Mn=a((fI,$n)=>{"use strict";var xf=U(),Ln=B(),Dn=wt(),Rf=pr(),Cf=In(),kf=L(),Nf=TypeError,Lf=kf("toPrimitive");$n.exports=function(r,e){if(!Ln(r)||Dn(r))return r;var t=Rf(r,Lf),i;if(t){if(e===void 0&&(e="default"),i=xf(t,r,e),!Ln(i)||Dn(i))return i;throw new Nf("Can't convert object to primitive value")}return e===void 0&&(e="number"),Cf(r,e)}});var Nt=a((pI,Vn)=>{"use strict";var Df=Mn(),$f=wt();Vn.exports=function(r){var e=Df(r,"string");return $f(e)?e:e+""}});var hr=a((hI,Un)=>{"use strict";var Mf=O(),Fn=B(),Lt=Mf.document,Vf=Fn(Lt)&&Fn(Lt.createElement);Un.exports=function(r){return Vf?Lt.createElement(r):{}}});var Dt=a((vI,Bn)=>{"use strict";var Ff=N(),Uf=C(),Bf=hr();Bn.exports=!Ff&&!Uf(function(){return Object.defineProperty(Bf("div"),"a",{get:function(){return 7}}).a!==7})});var Hn=a(Wn=>{"use strict";var jf=N(),Wf=U(),Hf=bt(),Kf=De(),Gf=ne(),zf=Nt(),Qf=Q(),Yf=Dt(),jn=Object.getOwnPropertyDescriptor;Wn.f=jf?jn:function(e,t){if(e=Gf(e),t=zf(t),Yf)try{return jn(e,t)}catch(i){}if(Qf(e,t))return Kf(!Wf(Hf.f,e,t),e[t])}});var $t=a((mI,Kn)=>{"use strict";var Jf=C(),Xf=A(),Zf=/#|\.prototype\./,Ue=function(r,e){var t=rp[ep(r)];return t===ip?!0:t===tp?!1:Xf(e)?Jf(e):!!e},ep=Ue.normalize=function(r){return String(r).replace(Zf,".").toLowerCase()},rp=Ue.data={},tp=Ue.NATIVE="N",ip=Ue.POLYFILL="P";Kn.exports=Ue});var Be=a((bI,zn)=>{"use strict";var Gn=gt(),op=J(),np=Ne(),ap=Gn(Gn.bind);zn.exports=function(r,e){return op(r),e===void 0?r:np?ap(r,e):function(){return r.apply(e,arguments)}}});var Mt=a((yI,Qn)=>{"use strict";var sp=N(),up=C();Qn.exports=sp&&up(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})});var X=a((II,Yn)=>{"use strict";var cp=B(),lp=String,dp=TypeError;Yn.exports=function(r){if(cp(r))return r;throw new dp(lp(r)+" is not an object")}});var se=a(Xn=>{"use strict";var fp=N(),pp=Dt(),hp=Mt(),vr=X(),Jn=Nt(),vp=TypeError,Vt=Object.defineProperty,gp=Object.getOwnPropertyDescriptor,Ft="enumerable",Ut="configurable",Bt="writable";Xn.f=fp?hp?function(e,t,i){if(vr(e),t=Jn(t),vr(i),typeof e=="function"&&t==="prototype"&&"value"in i&&Bt in i&&!i[Bt]){var o=gp(e,t);o&&o[Bt]&&(e[t]=i.value,i={configurable:Ut in i?i[Ut]:o[Ut],enumerable:Ft in i?i[Ft]:o[Ft],writable:!1})}return Vt(e,t,i)}:Vt:function(e,t,i){if(vr(e),t=Jn(t),vr(i),pp)try{return Vt(e,t,i)}catch(o){}if("get"in i||"set"in i)throw new vp("Accessors not supported");return"value"in i&&(e[t]=i.value),e}});var ge=a((_I,Zn)=>{"use strict";var mp=N(),bp=se(),yp=De();Zn.exports=mp?function(r,e,t){return bp.f(r,e,yp(1,t))}:function(r,e,t){return r[e]=t,r}});var D=a((EI,ra)=>{"use strict";var je=O(),Ip=ht(),Sp=gt(),_p=A(),Ep=Hn().f,Pp=$t(),me=Me(),Tp=Be(),be=ge(),ea=Q();Fe();var wp=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 Ip(r,this,arguments)};return e.prototype=r.prototype,e};ra.exports=function(r,e){var t=r.target,i=r.global,o=r.stat,n=r.proto,s=i?je:o?je[t]:je[t]&&je[t].prototype,u=i?me:me[t]||be(me,t,{})[t],d=u.prototype,l,f,h,c,p,g,m,S,I;for(c in e)l=Pp(i?c:t+(o?".":"#")+c,r.forced),f=!l&&s&&ea(s,c),g=u[c],f&&(r.dontCallGetSet?(I=Ep(s,c),m=I&&I.value):m=s[c]),p=f&&m?m:e[c],!(!l&&!n&&typeof g==typeof p)&&(r.bind&&f?S=Tp(p,je):r.wrap&&f?S=wp(p):n&&_p(p)?S=Sp(p):S=p,(r.sham||p&&p.sham||g&&g.sham)&&be(S,"sham",!0),be(u,c,S),n&&(h=t+"Prototype",ea(me,h)||be(me,h,{}),be(me[h],c,p),r.real&&d&&(l||!d[c])&&be(d,c,p)))}});var ia=a((PI,ta)=>{"use strict";var Op=Math.ceil,Ap=Math.floor;ta.exports=Math.trunc||function(e){var t=+e;return(t>0?Ap:Op)(t)}});var gr=a((TI,oa)=>{"use strict";var qp=ia();oa.exports=function(r){var e=+r;return e!==e||e===0?0:qp(e)}});var aa=a((wI,na)=>{"use strict";var xp=gr(),Rp=Math.max,Cp=Math.min;na.exports=function(r,e){var t=xp(r);return t<0?Rp(t+e,0):Cp(t,e)}});var jt=a((OI,sa)=>{"use strict";var kp=gr(),Np=Math.min;sa.exports=function(r){var e=kp(r);return e>0?Np(e,9007199254740991):0}});var Wt=a((AI,ua)=>{"use strict";var Lp=jt();ua.exports=function(r){return Lp(r.length)}});var Ht=a((qI,la)=>{"use strict";var Dp=ne(),$p=aa(),Mp=Wt(),ca=function(r){return function(e,t,i){var o=Dp(e),n=Mp(o);if(n===0)return!r&&-1;var s=$p(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}};la.exports={includes:ca(!0),indexOf:ca(!1)}});var Kt=a((xI,da)=>{"use strict";da.exports=function(){}});var fa=a(()=>{"use strict";var Vp=D(),Fp=Ht().includes,Up=C(),Bp=Kt(),jp=Up(function(){return!Array(1).includes()});Vp({target:"Array",proto:!0,forced:jp},{includes:function(e){return Fp(this,e,arguments.length>1?arguments[1]:void 0)}});Bp("includes")});var mr=a((kI,pa)=>{"use strict";var Wp=Y();pa.exports=Wp});var va=a((NI,ha)=>{"use strict";fa();var Hp=mr();ha.exports=Hp("Array","includes")});var ma=a((LI,ga)=>{"use strict";var Kp=va();ga.exports=Kp});var ye=a((DI,ba)=>{"use strict";var Gp=ma();ba.exports=Gp});var wa=a(()=>{"use strict"});var Yt=a((zI,Oa)=>{"use strict";var He=O(),Qp=ae(),Yp=Le(),_r=function(r){return Qp.slice(0,r.length)===r};Oa.exports=function(){return _r("Bun/")?"BUN":_r("Cloudflare-Workers")?"CLOUDFLARE":_r("Deno/")?"DENO":_r("Node.js/")?"NODE":He.Bun&&typeof Bun.version=="string"?"BUN":He.Deno&&typeof Deno.version=="object"?"DENO":Yp(He.process)==="process"?"NODE":He.window&&He.document?"BROWSER":"REST"}()});var Er=a((QI,Aa)=>{"use strict";var Jp=Yt();Aa.exports=Jp==="NODE"});var Se=a((YI,qa)=>{"use strict";var Xp=ge();qa.exports=function(r,e,t,i){return i&&i.enumerable?r[e]=t:Xp(r,e,t),r}});var Ra=a((JI,xa)=>{"use strict";var Zp=k(),eh=J();xa.exports=function(r,e,t){try{return Zp(eh(Object.getOwnPropertyDescriptor(r,e)[t]))}catch(i){}}});var ka=a((XI,Ca)=>{"use strict";var rh=B();Ca.exports=function(r){return rh(r)||r===null}});var La=a((ZI,Na)=>{"use strict";var th=ka(),ih=String,oh=TypeError;Na.exports=function(r){if(th(r))return r;throw new oh("Can't set "+ih(r)+" as a prototype")}});var Jt=a((eS,Da)=>{"use strict";var nh=Ra(),ah=B(),sh=he(),uh=La();Da.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var r=!1,e={},t;try{t=nh(Object.prototype,"__proto__","set"),t(e,[]),r=e instanceof Array}catch(i){}return function(o,n){return sh(o),uh(n),ah(o)&&(r?t(o,n):o.__proto__=n),o}}():void 0)});var Pr=a((rS,Ma)=>{"use strict";var ch=L(),lh=ch("toStringTag"),$a={};$a[lh]="z";Ma.exports=String($a)==="[object z]"});var Ke=a((tS,Va)=>{"use strict";var dh=Pr(),fh=A(),Tr=Le(),ph=L(),hh=ph("toStringTag"),vh=Object,gh=Tr(function(){return arguments}())==="Arguments",mh=function(r,e){try{return r[e]}catch(t){}};Va.exports=dh?Tr:function(r){var e,t,i;return r===void 0?"Undefined":r===null?"Null":typeof(t=mh(e=vh(r),hh))=="string"?t:gh?Tr(e):(i=Tr(e))==="Object"&&fh(e.callee)?"Arguments":i}});var Ua=a((iS,Fa)=>{"use strict";var bh=Pr(),yh=Ke();Fa.exports=bh?{}.toString:function(){return"[object "+yh(this)+"]"}});var Ge=a((oS,ja)=>{"use strict";var Ih=Pr(),Sh=se().f,_h=ge(),Eh=Q(),Ph=Ua(),Th=L(),Ba=Th("toStringTag");ja.exports=function(r,e,t,i){var o=t?r:r&&r.prototype;o&&(Eh(o,Ba)||Sh(o,Ba,{configurable:!0,value:e}),i&&!Ih&&_h(o,"toString",Ph))}});var Ha=a((nS,Wa)=>{"use strict";var wh=se();Wa.exports=function(r,e,t){return wh.f(r,e,t)}});var za=a((aS,Ga)=>{"use strict";var Oh=Y(),Ah=Ha(),qh=L(),xh=N(),Ka=qh("species");Ga.exports=function(r){var e=Oh(r);xh&&e&&!e[Ka]&&Ah(e,Ka,{configurable:!0,get:function(){return this}})}});var Ya=a((sS,Qa)=>{"use strict";var Rh=dr(),Ch=TypeError;Qa.exports=function(r,e){if(Rh(e,r))return r;throw new Ch("Incorrect invocation")}});var Zt=a((uS,Ja)=>{"use strict";var kh=k(),Nh=A(),Xt=Fe(),Lh=kh(Function.toString);Nh(Xt.inspectSource)||(Xt.inspectSource=function(r){return Lh(r)});Ja.exports=Xt.inspectSource});var is=a((cS,ts)=>{"use strict";var Dh=k(),$h=C(),Xa=A(),Mh=Ke(),Vh=Y(),Fh=Zt(),Za=function(){},es=Vh("Reflect","construct"),ei=/^\s*(?:class|function)\b/,Uh=Dh(ei.exec),Bh=!ei.test(Za),ze=function(e){if(!Xa(e))return!1;try{return es(Za,[],e),!0}catch(t){return!1}},rs=function(e){if(!Xa(e))return!1;switch(Mh(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Bh||!!Uh(ei,Fh(e))}catch(t){return!0}};rs.sham=!0;ts.exports=!es||$h(function(){var r;return ze(ze.call)||!ze(Object)||!ze(function(){r=!0})||r})?rs:ze});var ns=a((lS,os)=>{"use strict";var jh=is(),Wh=Ve(),Hh=TypeError;os.exports=function(r){if(jh(r))return r;throw new Hh(Wh(r)+" is not a constructor")}});var ri=a((dS,ss)=>{"use strict";var as=X(),Kh=ns(),Gh=$e(),zh=L(),Qh=zh("species");ss.exports=function(r,e){var t=as(r).constructor,i;return t===void 0||Gh(i=as(t)[Qh])?e:Kh(i)}});var ti=a((fS,us)=>{"use strict";var Yh=Y();us.exports=Yh("document","documentElement")});var ls=a((pS,cs)=>{"use strict";var Jh=k();cs.exports=Jh([].slice)});var fs=a((hS,ds)=>{"use strict";var Xh=TypeError;ds.exports=function(r,e){if(r<e)throw new Xh("Not enough arguments");return r}});var ii=a((vS,ps)=>{"use strict";var Zh=ae();ps.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(Zh)});var fi=a((gS,_s)=>{"use strict";var $=O(),ev=ht(),rv=Be(),hs=A(),tv=Q(),Ss=C(),vs=ti(),iv=ls(),gs=hr(),ov=fs(),nv=ii(),av=Er(),ci=$.setImmediate,li=$.clearImmediate,sv=$.process,oi=$.Dispatch,uv=$.Function,ms=$.MessageChannel,cv=$.String,ni=0,Qe={},bs="onreadystatechange",Ye,ue,ai,si;Ss(function(){Ye=$.location});var di=function(r){if(tv(Qe,r)){var e=Qe[r];delete Qe[r],e()}},ui=function(r){return function(){di(r)}},ys=function(r){di(r.data)},Is=function(r){$.postMessage(cv(r),Ye.protocol+"//"+Ye.host)};(!ci||!li)&&(ci=function(e){ov(arguments.length,1);var t=hs(e)?e:uv(e),i=iv(arguments,1);return Qe[++ni]=function(){ev(t,void 0,i)},ue(ni),ni},li=function(e){delete Qe[e]},av?ue=function(r){sv.nextTick(ui(r))}:oi&&oi.now?ue=function(r){oi.now(ui(r))}:ms&&!nv?(ai=new ms,si=ai.port2,ai.port1.onmessage=ys,ue=rv(si.postMessage,si)):$.addEventListener&&hs($.postMessage)&&!$.importScripts&&Ye&&Ye.protocol!=="file:"&&!Ss(Is)?(ue=Is,$.addEventListener("message",ys,!1)):bs in gs("script")?ue=function(r){vs.appendChild(gs("script"))[bs]=function(){vs.removeChild(this),di(r)}}:ue=function(r){setTimeout(ui(r),0)});_s.exports={set:ci,clear:li}});var Ts=a((mS,Ps)=>{"use strict";var Es=O(),lv=N(),dv=Object.getOwnPropertyDescriptor;Ps.exports=function(r){if(!lv)return Es[r];var e=dv(Es,r);return e&&e.value}});var pi=a((bS,Os)=>{"use strict";var ws=function(){this.head=null,this.tail=null};ws.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}}};Os.exports=ws});var qs=a((yS,As)=>{"use strict";var fv=ae();As.exports=/ipad|iphone|ipod/i.test(fv)&&typeof Pebble!="undefined"});var Rs=a((IS,xs)=>{"use strict";var pv=ae();xs.exports=/web0s(?!.*chrome)/i.test(pv)});var Ms=a((SS,$s)=>{"use strict";var Ee=O(),hv=Ts(),Cs=Be(),hi=fi().set,vv=pi(),gv=ii(),mv=qs(),bv=Rs(),vi=Er(),ks=Ee.MutationObserver||Ee.WebKitMutationObserver,Ns=Ee.document,Ls=Ee.process,wr=Ee.Promise,bi=hv("queueMicrotask"),_e,gi,mi,Or,Ds;bi||(Je=new vv,Xe=function(){var r,e;for(vi&&(r=Ls.domain)&&r.exit();e=Je.get();)try{e()}catch(t){throw Je.head&&_e(),t}r&&r.enter()},!gv&&!vi&&!bv&&ks&&Ns?(gi=!0,mi=Ns.createTextNode(""),new ks(Xe).observe(mi,{characterData:!0}),_e=function(){mi.data=gi=!gi}):!mv&&wr&&wr.resolve?(Or=wr.resolve(void 0),Or.constructor=wr,Ds=Cs(Or.then,Or),_e=function(){Ds(Xe)}):vi?_e=function(){Ls.nextTick(Xe)}:(hi=Cs(hi,Ee),_e=function(){hi(Xe)}),bi=function(r){Je.head||_e(),Je.add(r)});var Je,Xe;$s.exports=bi});var Fs=a((_S,Vs)=>{"use strict";Vs.exports=function(r,e){try{arguments.length===1?console.error(r):console.error(r,e)}catch(t){}}});var Ar=a((ES,Us)=>{"use strict";Us.exports=function(r){try{return{error:!1,value:r()}}catch(e){return{error:!0,value:e}}}});var Ws=a((PS,js)=>{"use strict";var yv=O(),Iv=A(),Bs=yv.WeakMap;js.exports=Iv(Bs)&&/native code/.test(String(Bs))});var qr=a((TS,Ks)=>{"use strict";var Sv=xt(),_v=Ct(),Hs=Sv("keys");Ks.exports=function(r){return Hs[r]||(Hs[r]=_v(r))}});var xr=a((wS,Gs)=>{"use strict";Gs.exports={}});var _i=a((OS,Ys)=>{"use strict";var Ev=Ws(),Qs=O(),Pv=B(),Tv=ge(),yi=Q(),Ii=Fe(),wv=qr(),Ov=xr(),zs="Object already initialized",Si=Qs.TypeError,Av=Qs.WeakMap,Rr,Ze,Cr,qv=function(r){return Cr(r)?Ze(r):Rr(r,{})},xv=function(r){return function(e){var t;if(!Pv(e)||(t=Ze(e)).type!==r)throw new Si("Incompatible receiver, "+r+" required");return t}};Ev||Ii.state?(W=Ii.state||(Ii.state=new Av),W.get=W.get,W.has=W.has,W.set=W.set,Rr=function(r,e){if(W.has(r))throw new Si(zs);return e.facade=r,W.set(r,e),e},Ze=function(r){return W.get(r)||{}},Cr=function(r){return W.has(r)}):(ce=wv("state"),Ov[ce]=!0,Rr=function(r,e){if(yi(r,ce))throw new Si(zs);return e.facade=r,Tv(r,ce,e),e},Ze=function(r){return yi(r,ce)?r[ce]:{}},Cr=function(r){return yi(r,ce)});var W,ce;Ys.exports={set:Rr,get:Ze,has:Cr,enforce:qv,getterFor:xv}});var le=a((AS,Js)=>{"use strict";var Rv=O();Js.exports=Rv.Promise});var Pe=a((qS,ru)=>{"use strict";var Cv=O(),er=le(),kv=A(),Nv=$t(),Lv=Zt(),Dv=L(),Xs=Yt(),$v=z(),Ei=Et(),Zs=er&&er.prototype,Mv=Dv("species"),Pi=!1,eu=kv(Cv.PromiseRejectionEvent),Vv=Nv("Promise",function(){var r=Lv(er),e=r!==String(er);if(!e&&Ei===66||$v&&!(Zs.catch&&Zs.finally))return!0;if(!Ei||Ei<51||!/native code/.test(r)){var t=new er(function(n){n(1)}),i=function(n){n(function(){},function(){})},o=t.constructor={};if(o[Mv]=i,Pi=t.then(function(){})instanceof i,!Pi)return!0}return!e&&(Xs==="BROWSER"||Xs==="DENO")&&!eu});ru.exports={CONSTRUCTOR:Vv,REJECTION_EVENT:eu,SUBCLASSING:Pi}});var Te=a((xS,iu)=>{"use strict";var tu=J(),Fv=TypeError,Uv=function(r){var e,t;this.promise=new r(function(i,o){if(e!==void 0||t!==void 0)throw new Fv("Bad Promise constructor");e=i,t=o}),this.resolve=tu(e),this.reject=tu(t)};iu.exports.f=function(r){return new Uv(r)}});var _u=a(()=>{"use strict";var Bv=D(),jv=z(),Dr=Er(),te=O(),qe=U(),ou=Se(),nu=Jt(),Wv=Ge(),Hv=za(),Kv=J(),Lr=A(),Gv=B(),zv=Ya(),Qv=ri(),lu=fi().set,qi=Ms(),Yv=Fs(),Jv=Ar(),Xv=pi(),du=_i(),$r=le(),xi=Pe(),fu=Te(),Mr="Promise",pu=xi.CONSTRUCTOR,Zv=xi.REJECTION_EVENT,eg=xi.SUBCLASSING,Ti=du.getterFor(Mr),rg=du.set,we=$r&&$r.prototype,de=$r,kr=we,hu=te.TypeError,wi=te.document,Ri=te.process,Oi=fu.f,tg=Oi,ig=!!(wi&&wi.createEvent&&te.dispatchEvent),vu="unhandledrejection",og="rejectionhandled",au=0,gu=1,ng=2,Ci=1,mu=2,Nr,su,ag,uu,bu=function(r){var e;return Gv(r)&&Lr(e=r.then)?e:!1},yu=function(r,e){var t=e.value,i=e.state===gu,o=i?r.ok:r.fail,n=r.resolve,s=r.reject,u=r.domain,d,l,f;try{o?(i||(e.rejection===mu&&ug(e),e.rejection=Ci),o===!0?d=t:(u&&u.enter(),d=o(t),u&&(u.exit(),f=!0)),d===r.promise?s(new hu("Promise-chain cycle")):(l=bu(d))?qe(l,d,n,s):n(d)):s(t)}catch(h){u&&!f&&u.exit(),s(h)}},Iu=function(r,e){r.notified||(r.notified=!0,qi(function(){for(var t=r.reactions,i;i=t.get();)yu(i,r);r.notified=!1,e&&!r.rejection&&sg(r)}))},Su=function(r,e,t){var i,o;ig?(i=wi.createEvent("Event"),i.promise=e,i.reason=t,i.initEvent(r,!1,!0),te.dispatchEvent(i)):i={promise:e,reason:t},!Zv&&(o=te["on"+r])?o(i):r===vu&&Yv("Unhandled promise rejection",t)},sg=function(r){qe(lu,te,function(){var e=r.facade,t=r.value,i=cu(r),o;if(i&&(o=Jv(function(){Dr?Ri.emit("unhandledRejection",t,e):Su(vu,e,t)}),r.rejection=Dr||cu(r)?mu:Ci,o.error))throw o.value})},cu=function(r){return r.rejection!==Ci&&!r.parent},ug=function(r){qe(lu,te,function(){var e=r.facade;Dr?Ri.emit("rejectionHandled",e):Su(og,e,r.value)})},Oe=function(r,e,t){return function(i){r(e,i,t)}},Ae=function(r,e,t){r.done||(r.done=!0,t&&(r=t),r.value=e,r.state=ng,Iu(r,!0))},Ai=function(r,e,t){if(!r.done){r.done=!0,t&&(r=t);try{if(r.facade===e)throw new hu("Promise can't be resolved itself");var i=bu(e);i?qi(function(){var o={done:!1};try{qe(i,e,Oe(Ai,o,r),Oe(Ae,o,r))}catch(n){Ae(o,n,r)}}):(r.value=e,r.state=gu,Iu(r,!1))}catch(o){Ae({done:!1},o,r)}}};if(pu&&(de=function(e){zv(this,kr),Kv(e),qe(Nr,this);var t=Ti(this);try{e(Oe(Ai,t),Oe(Ae,t))}catch(i){Ae(t,i)}},kr=de.prototype,Nr=function(e){rg(this,{type:Mr,done:!1,notified:!1,parent:!1,reactions:new Xv,rejection:!1,state:au,value:void 0})},Nr.prototype=ou(kr,"then",function(e,t){var i=Ti(this),o=Oi(Qv(this,de));return i.parent=!0,o.ok=Lr(e)?e:!0,o.fail=Lr(t)&&t,o.domain=Dr?Ri.domain:void 0,i.state===au?i.reactions.add(o):qi(function(){yu(o,i)}),o.promise}),su=function(){var r=new Nr,e=Ti(r);this.promise=r,this.resolve=Oe(Ai,e),this.reject=Oe(Ae,e)},fu.f=Oi=function(r){return r===de||r===ag?new su(r):tg(r)},!jv&&Lr($r)&&we!==Object.prototype)){uu=we.then,eg||ou(we,"then",function(e,t){var i=this;return new de(function(o,n){qe(uu,i,o,n)}).then(e,t)},{unsafe:!0});try{delete we.constructor}catch(r){}nu&&nu(we,kr)}Bv({global:!0,constructor:!0,wrap:!0,forced:pu},{Promise:de});Wv(de,Mr,!1,!0);Hv(Mr)});var fe=a((kS,Eu)=>{"use strict";Eu.exports={}});var Tu=a((NS,Pu)=>{"use strict";var cg=L(),lg=fe(),dg=cg("iterator"),fg=Array.prototype;Pu.exports=function(r){return r!==void 0&&(lg.Array===r||fg[dg]===r)}});var ki=a((LS,Ou)=>{"use strict";var pg=Ke(),wu=pr(),hg=$e(),vg=fe(),gg=L(),mg=gg("iterator");Ou.exports=function(r){if(!hg(r))return wu(r,mg)||wu(r,"@@iterator")||vg[pg(r)]}});var qu=a((DS,Au)=>{"use strict";var bg=U(),yg=J(),Ig=X(),Sg=Ve(),_g=ki(),Eg=TypeError;Au.exports=function(r,e){var t=arguments.length<2?_g(r):e;if(yg(t))return Ig(bg(t,r));throw new Eg(Sg(r)+" is not iterable")}});var Cu=a(($S,Ru)=>{"use strict";var Pg=U(),xu=X(),Tg=pr();Ru.exports=function(r,e,t){var i,o;xu(r);try{if(i=Tg(r,"return"),!i){if(e==="throw")throw t;return t}i=Pg(i,r)}catch(n){o=!0,i=n}if(e==="throw")throw t;if(o)throw i;return xu(i),t}});var Fr=a((MS,Du)=>{"use strict";var wg=Be(),Og=U(),Ag=X(),qg=Ve(),xg=Tu(),Rg=Wt(),ku=dr(),Cg=qu(),kg=ki(),Nu=Cu(),Ng=TypeError,Vr=function(r,e){this.stopped=r,this.result=e},Lu=Vr.prototype;Du.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=wg(e,i),l,f,h,c,p,g,m,S=function(_){return l&&Nu(l,"normal",_),new Vr(!0,_)},I=function(_){return o?(Ag(_),u?d(_[0],_[1],S):d(_[0],_[1])):u?d(_,S):d(_)};if(n)l=r.iterator;else if(s)l=r;else{if(f=kg(r),!f)throw new Ng(qg(r)+" is not iterable");if(xg(f)){for(h=0,c=Rg(r);c>h;h++)if(p=I(r[h]),p&&ku(Lu,p))return p;return new Vr(!1)}l=Cg(r,f)}for(g=n?r.next:l.next;!(m=Og(g,l)).done;){try{p=I(m.value)}catch(_){Nu(l,"throw",_)}if(typeof p=="object"&&p&&ku(Lu,p))return p}return new Vr(!1)}});var Uu=a((VS,Fu)=>{"use strict";var Lg=L(),Mu=Lg("iterator"),Vu=!1;try{$u=0,Ni={next:function(){return{done:!!$u++}},return:function(){Vu=!0}},Ni[Mu]=function(){return this},Array.from(Ni,function(){throw 2})}catch(r){}var $u,Ni;Fu.exports=function(r,e){try{if(!e&&!Vu)return!1}catch(o){return!1}var t=!1;try{var i={};i[Mu]=function(){return{next:function(){return{done:t=!0}}}},r(i)}catch(o){}return t}});var Li=a((FS,Bu)=>{"use strict";var Dg=le(),$g=Uu(),Mg=Pe().CONSTRUCTOR;Bu.exports=Mg||!$g(function(r){Dg.all(r).then(void 0,function(){})})});var ju=a(()=>{"use strict";var Vg=D(),Fg=U(),Ug=J(),Bg=Te(),jg=Ar(),Wg=Fr(),Hg=Li();Vg({target:"Promise",stat:!0,forced:Hg},{all:function(e){var t=this,i=Bg.f(t),o=i.resolve,n=i.reject,s=jg(function(){var u=Ug(t.resolve),d=[],l=0,f=1;Wg(e,function(h){var c=l++,p=!1;f++,Fg(u,t,h).then(function(g){p||(p=!0,d[c]=g,--f||o(d))},n)}),--f||o(d)});return s.error&&n(s.value),i.promise}})});var Hu=a(()=>{"use strict";var Kg=D(),Gg=z(),zg=Pe().CONSTRUCTOR,$i=le(),Qg=Y(),Yg=A(),Jg=Se(),Wu=$i&&$i.prototype;Kg({target:"Promise",proto:!0,forced:zg,real:!0},{catch:function(r){return this.then(void 0,r)}});!Gg&&Yg($i)&&(Di=Qg("Promise").prototype.catch,Wu.catch!==Di&&Jg(Wu,"catch",Di,{unsafe:!0}));var Di});var Ku=a(()=>{"use strict";var Xg=D(),Zg=U(),em=J(),rm=Te(),tm=Ar(),im=Fr(),om=Li();Xg({target:"Promise",stat:!0,forced:om},{race:function(e){var t=this,i=rm.f(t),o=i.reject,n=tm(function(){var s=em(t.resolve);im(e,function(u){Zg(s,t,u).then(i.resolve,o)})});return n.error&&o(n.value),i.promise}})});var Gu=a(()=>{"use strict";var nm=D(),am=Te(),sm=Pe().CONSTRUCTOR;nm({target:"Promise",stat:!0,forced:sm},{reject:function(e){var t=am.f(this),i=t.reject;return i(e),t.promise}})});var Mi=a((QS,zu)=>{"use strict";var um=X(),cm=B(),lm=Te();zu.exports=function(r,e){if(um(r),cm(e)&&e.constructor===r)return e;var t=lm.f(r),i=t.resolve;return i(e),t.promise}});var Ju=a(()=>{"use strict";var dm=D(),fm=Y(),Qu=z(),pm=le(),Yu=Pe().CONSTRUCTOR,hm=Mi(),vm=fm("Promise"),gm=Qu&&!Yu;dm({target:"Promise",stat:!0,forced:Qu||Yu},{resolve:function(e){return hm(gm&&this===vm?pm:this,e)}})});var Xu=a(()=>{"use strict";_u();ju();Hu();Ku();Gu();Ju()});var tc=a(()=>{"use strict";var mm=D(),bm=z(),Ur=le(),ym=C(),ec=Y(),rc=A(),Im=ri(),Zu=Mi(),Sm=Se(),Fi=Ur&&Ur.prototype,_m=!!Ur&&ym(function(){Fi.finally.call({then:function(){}},function(){})});mm({target:"Promise",proto:!0,real:!0,forced:_m},{finally:function(r){var e=Im(this,ec("Promise")),t=rc(r);return this.then(t?function(i){return Zu(e,r()).then(function(){return i})}:r,t?function(i){return Zu(e,r()).then(function(){throw i})}:r)}});!bm&&rc(Ur)&&(Vi=ec("Promise").prototype.finally,Fi.finally!==Vi&&Sm(Fi,"finally",Vi,{unsafe:!0}));var Vi});var oc=a((t_,ic)=>{"use strict";wa();Xu();tc();var Em=mr();ic.exports=Em("Promise","finally")});var ac=a((i_,nc)=>{"use strict";var Pm=oc();nc.exports=Pm});var Ui=a((o_,sc)=>{"use strict";var Tm=ac();sc.exports=Tm});var cc=a((n_,uc)=>{"use strict";var wm=C();uc.exports=!wm(function(){function r(){}return r.prototype.constructor=null,Object.getPrototypeOf(new r)!==r.prototype})});var Br=a((a_,dc)=>{"use strict";var Om=Q(),Am=A(),qm=Rt(),xm=qr(),Rm=cc(),lc=xm("IE_PROTO"),Bi=Object,Cm=Bi.prototype;dc.exports=Rm?Bi.getPrototypeOf:function(r){var e=qm(r);if(Om(e,lc))return e[lc];var t=e.constructor;return Am(t)&&e instanceof t?t.prototype:e instanceof Bi?Cm:null}});var hc=a((s_,pc)=>{"use strict";var km=k(),ji=Q(),Nm=ne(),Lm=Ht().indexOf,Dm=xr(),fc=km([].push);pc.exports=function(r,e){var t=Nm(r),i=0,o=[],n;for(n in t)!ji(Dm,n)&&ji(t,n)&&fc(o,n);for(;e.length>i;)ji(t,n=e[i++])&&(~Lm(o,n)||fc(o,n));return o}});var Wi=a((u_,vc)=>{"use strict";vc.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]});var Hi=a((c_,gc)=>{"use strict";var $m=hc(),Mm=Wi();gc.exports=Object.keys||function(e){return $m(e,Mm)}});var _c=a((l_,Sc)=>{"use strict";var bc=N(),Vm=C(),yc=k(),Fm=Br(),Um=Hi(),Bm=ne(),jm=bt().f,Ic=yc(jm),Wm=yc([].push),Hm=bc&&Vm(function(){var r=Object.create(null);return r[2]=2,!Ic(r,2)}),mc=function(r){return function(e){for(var t=Bm(e),i=Um(t),o=Hm&&Fm(t)===null,n=i.length,s=0,u=[],d;n>s;)d=i[s++],(!bc||(o?d in t:Ic(t,d)))&&Wm(u,r?[d,t[d]]:t[d]);return u}};Sc.exports={entries:mc(!0),values:mc(!1)}});var Ec=a(()=>{"use strict";var Km=D(),Gm=_c().entries;Km({target:"Object",stat:!0},{entries:function(e){return Gm(e)}})});var Tc=a((p_,Pc)=>{"use strict";Ec();var zm=Me();Pc.exports=zm.Object.entries});var Oc=a((h_,wc)=>{"use strict";var Qm=Tc();wc.exports=Qm});var xe=a((v_,Ac)=>{"use strict";var Ym=Oc();Ac.exports=Ym});var Rc=a((g_,xc)=>{"use strict";var Ki=N(),Jm=Q(),qc=Function.prototype,Xm=Ki&&Object.getOwnPropertyDescriptor,Gi=Jm(qc,"name"),Zm=Gi&&function(){}.name==="something",eb=Gi&&(!Ki||Ki&&Xm(qc,"name").configurable);xc.exports={EXISTS:Gi,PROPER:Zm,CONFIGURABLE:eb}});var kc=a(Cc=>{"use strict";var rb=N(),tb=Mt(),ib=se(),ob=X(),nb=ne(),ab=Hi();Cc.f=rb&&!tb?Object.defineProperties:function(e,t){ob(e);for(var i=nb(t),o=ab(t),n=o.length,s=0,u;n>s;)ib.f(e,u=o[s++],i[u]);return e}});var Ji=a((b_,Fc)=>{"use strict";var sb=X(),ub=kc(),Nc=Wi(),cb=xr(),lb=ti(),db=hr(),fb=qr(),Lc=">",Dc="<",Qi="prototype",Yi="script",Mc=fb("IE_PROTO"),zi=function(){},Vc=function(r){return Dc+Yi+Lc+r+Dc+"/"+Yi+Lc},$c=function(r){r.write(Vc("")),r.close();var e=r.parentWindow.Object;return r=null,e},pb=function(){var r=db("iframe"),e="java"+Yi+":",t;return r.style.display="none",lb.appendChild(r),r.src=String(e),t=r.contentWindow.document,t.open(),t.write(Vc("document.F=Object")),t.close(),t.F},jr,Wr=function(){try{jr=new ActiveXObject("htmlfile")}catch(e){}Wr=typeof document!="undefined"?document.domain&&jr?$c(jr):pb():$c(jr);for(var r=Nc.length;r--;)delete Wr[Qi][Nc[r]];return Wr()};cb[Mc]=!0;Fc.exports=Object.create||function(e,t){var i;return e!==null?(zi[Qi]=sb(e),i=new zi,zi[Qi]=null,i[Mc]=e):i=Wr(),t===void 0?i:ub.f(i,t)}});var ro=a((y_,jc)=>{"use strict";var hb=C(),vb=A(),gb=B(),mb=Ji(),Uc=Br(),bb=Se(),yb=L(),Ib=z(),eo=yb("iterator"),Bc=!1,Z,Xi,Zi;[].keys&&(Zi=[].keys(),"next"in Zi?(Xi=Uc(Uc(Zi)),Xi!==Object.prototype&&(Z=Xi)):Bc=!0);var Sb=!gb(Z)||hb(function(){var r={};return Z[eo].call(r)!==r});Sb?Z={}:Ib&&(Z=mb(Z));vb(Z[eo])||bb(Z,eo,function(){return this});jc.exports={IteratorPrototype:Z,BUGGY_SAFARI_ITERATORS:Bc}});var Hc=a((I_,Wc)=>{"use strict";var _b=ro().IteratorPrototype,Eb=Ji(),Pb=De(),Tb=Ge(),wb=fe(),Ob=function(){return this};Wc.exports=function(r,e,t,i){var o=e+" Iterator";return r.prototype=Eb(_b,{next:Pb(+!i,t)}),Tb(r,o,!1,!0),wb[o]=Ob,r}});var tl=a((S_,rl)=>{"use strict";var Ab=D(),qb=U(),Hr=z(),Zc=Rc(),xb=A(),Rb=Hc(),Kc=Br(),Gc=Jt(),Cb=Ge(),kb=ge(),to=Se(),Nb=L(),zc=fe(),el=ro(),Lb=Zc.PROPER,Db=Zc.CONFIGURABLE,Qc=el.IteratorPrototype,Kr=el.BUGGY_SAFARI_ITERATORS,rr=Nb("iterator"),Yc="keys",tr="values",Jc="entries",Xc=function(){return this};rl.exports=function(r,e,t,i,o,n,s){Rb(t,e,i);var u=function(I){if(I===o&&c)return c;if(!Kr&&I&&I in f)return f[I];switch(I){case Yc:return function(){return new t(this,I)};case tr:return function(){return new t(this,I)};case Jc:return function(){return new t(this,I)}}return function(){return new t(this)}},d=e+" Iterator",l=!1,f=r.prototype,h=f[rr]||f["@@iterator"]||o&&f[o],c=!Kr&&h||u(o),p=e==="Array"&&f.entries||h,g,m,S;if(p&&(g=Kc(p.call(new r)),g!==Object.prototype&&g.next&&(!Hr&&Kc(g)!==Qc&&(Gc?Gc(g,Qc):xb(g[rr])||to(g,rr,Xc)),Cb(g,d,!0,!0),Hr&&(zc[d]=Xc))),Lb&&o===tr&&h&&h.name!==tr&&(!Hr&&Db?kb(f,"name",tr):(l=!0,c=function(){return qb(h,this)})),o)if(m={values:u(tr),keys:n?c:u(Yc),entries:u(Jc)},s)for(S in m)(Kr||l||!(S in f))&&to(f,S,m[S]);else Ab({target:e,proto:!0,forced:Kr||l},m);return(!Hr||s)&&f[rr]!==c&&to(f,rr,c,{name:o}),zc[e]=c,m}});var ol=a((__,il)=>{"use strict";il.exports=function(r,e){return{value:r,done:e}}});var oo=a((E_,cl)=>{"use strict";var $b=ne(),io=Kt(),nl=fe(),sl=_i(),Mb=se().f,Vb=tl(),Gr=ol(),Fb=z(),Ub=N(),ul="Array Iterator",Bb=sl.set,jb=sl.getterFor(ul);cl.exports=Vb(Array,"Array",function(r,e){Bb(this,{type:ul,target:$b(r),index:0,kind:e})},function(){var r=jb(this),e=r.target,t=r.index++;if(!e||t>=e.length)return r.target=void 0,Gr(void 0,!0);switch(r.kind){case"keys":return Gr(t,!1);case"values":return Gr(e[t],!1)}return Gr([t,e[t]],!1)},"values");var al=nl.Arguments=nl.Array;io("keys");io("values");io("entries");if(!Fb&&Ub&&al.name!=="values")try{Mb(al,"name",{value:"values"})}catch(r){}});var dl=a((P_,ll)=>{"use strict";var Wb=N(),Hb=se(),Kb=De();ll.exports=function(r,e,t){Wb?Hb.f(r,e,Kb(0,t)):r[e]=t}});var fl=a(()=>{"use strict";var Gb=D(),zb=Fr(),Qb=dl();Gb({target:"Object",stat:!0},{fromEntries:function(e){var t={};return zb(e,function(i,o){Qb(t,i,o)},{AS_ENTRIES:!0}),t}})});var hl=a((O_,pl)=>{"use strict";oo();fl();var Yb=Me();pl.exports=Yb.Object.fromEntries});var gl=a((A_,vl)=>{"use strict";vl.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 bl=a(()=>{"use strict";oo();var Jb=gl(),Xb=O(),Zb=Ge(),ml=fe();for(zr in Jb)Zb(Xb[zr],zr),ml[zr]=ml.Array;var zr});var Il=a((R_,yl)=>{"use strict";var ey=hl();bl();yl.exports=ey});var _l=a((C_,Sl)=>{"use strict";var ry=Il();Sl.exports=ry});var co=a((mE,Nl)=>{"use strict";var ny=Ke(),ay=String;Nl.exports=function(r){if(ny(r)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return ay(r)}});var Dl=a((bE,Ll)=>{"use strict";var sy=gr(),uy=co(),cy=he(),ly=RangeError;Ll.exports=function(e){var t=uy(cy(this)),i="",o=sy(e);if(o<0||o===1/0)throw new ly("Wrong number of repetitions");for(;o>0;(o>>>=1)&&(t+=t))o&1&&(i+=t);return i}});var Ul=a((yE,Fl)=>{"use strict";var Vl=k(),dy=jt(),$l=co(),fy=Dl(),py=he(),hy=Vl(fy),vy=Vl("".slice),gy=Math.ceil,Ml=function(r){return function(e,t,i){var o=$l(py(e)),n=dy(t),s=o.length,u=i===void 0?" ":$l(i),d,l;return n<=s||u===""?o:(d=n-s,l=hy(u,gy(d/u.length)),l.length>d&&(l=vy(l,0,d)),r?o+l:l+o)}};Fl.exports={start:Ml(!1),end:Ml(!0)}});var jl=a((IE,Bl)=>{"use strict";var my=ae();Bl.exports=/Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(my)});var Wl=a(()=>{"use strict";var by=D(),yy=Ul().start,Iy=jl();by({target:"String",proto:!0,forced:Iy},{padStart:function(e){return yy(this,e,arguments.length>1?arguments[1]:void 0)}})});var Kl=a((EE,Hl)=>{"use strict";Wl();var Sy=mr();Hl.exports=Sy("String","padStart")});var zl=a((PE,Gl)=>{"use strict";var _y=Kl();Gl.exports=_y});var lo=a((TE,Ql)=>{"use strict";var Ey=zl();Ql.exports=Ey});var Ay={};Po(Ay,{ApiEnv:()=>Ie,ConnectionType:()=>Ir,ContentType:()=>yr,InteractiveInterfaceClick:()=>Gt,OneStat:()=>tt,Quality:()=>br,SeekAction:()=>Sr,ThinOneStat:()=>dt,VERSION:()=>We});module.exports=Td(Ay);var vo=R(ye(),1);var Ie=(s=>(s.PROD="prod",s.VK_ALIAS="vk_alias",s.VIDEOTEST="videotest",s.TEST="test",s.OKCDN="okcdn",s.AUTO="auto",s))(Ie||{}),br=(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))(br||{}),yr=(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))(yr||{});var Ir=(i=>(i.HTTP1="http1",i.HTTP2="http2",i.HTTP3="http3",i))(Ir||{});var Sr=(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))(Sr||{}),Gt=(n=>(n.GRAPH_SHOW="iGraphShow",n.GRAPH_HIDE="iGraphHide",n.NEXT_AREA="iNextChapterArea",n.NEXT_BUTTON="iNextChapterBtn",n.WATCH_AGAIN="iWatchAgainBtn",n))(Gt||{}),ya={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"},Ia={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"},Sa={unknown:"un",mobile:"m",lowest:"ls",low:"l",medium:"md",high:"h",fullhd:"f",quadhd:"q",ultrahd:"u"},_a={pip:"pi",fullscreen:"fs",external:"ex",prefetch:"pr",airplay:"ap",chromecast:"cc",invisible:"iv"};var Pa=require("@vkontakte/videoplayer-shared/es2018");var We="__VERSION__",Ea="CIOPGQJGDIHBABABA",zt={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 zp={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}},Ta=r=>(0,Pa.fillWithDefault)(r,zp);function Qt(){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 v=require("@vkontakte/videoplayer-shared/es2018"),it=require("@vkontakte/videoplayer-shared/es2018");var Qr=R(Ui(),1);var El=R(xe(),1),Pl=R(_l(),1);var Tl=r=>{var o;let{operation:e,custom:t}=r,i=(0,Pl.default)((0,El.default)(t).map(([n,s])=>{var l,f,h;let u=(l=Ia[n])!=null?l:n,d=s;return s&&(n==="mode"?d=(f=_a[s])!=null?f:s:n==="quality"&&(d=(h=Sa[s])!=null?h:s)),[u,d]}));return{...r,operation:(o=ya[e])!=null?o:e,custom:i}};var H=require("@vkontakte/videoplayer-shared/es2018");var ty=/Mobile|mini|Fennec|Android|iP(ad|od|hone)|opera (mini|mobi)/i,ir=class{constructor(e){this.consequentAuthErrors=0;this.authorized$=new H.ValueSubject(!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:H.ErrorCategory.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:H.ErrorCategory.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,Qr.default)(this.params.refreshAuthToken(),()=>{this.refreshAuthTokenPromise=void 0})),this.refreshAuthTokenPromise}createLogParams(e){let t="WEB",i=!1,o=`@vkontakte/videoplayer-statistics:${We}`;if(this.params.config.useVKComIsMobileLogic){let{appVersion:n}=window.navigator;i=ty.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(Tl):e})}}_authorizeWithBackoff(){if(!this.consequentAuthErrors)return this._authorize();let e=(0,H.getExponentialDelay)(this.consequentAuthErrors,this.params.config.backoff);return new Promise(t=>{this.backoffTimeoutId||(this.backoffTimeoutId=window.setTimeout(()=>{(0,Qr.default)(this._authorize().then(t).catch(i=>this.params.error$.next({id:"AuthorizeBackoff",category:H.ErrorCategory.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:We.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,Qr.default)(this.params.apiTransport.sendRequest(e,t).then(i=>{var o;return(!i||!i.session_key)&&this.params.error$.next({id:"AuthorizeFailed",category:H.ErrorCategory.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:H.ErrorCategory.EXTERNAL_API,message:"authorize error",data:i}):this.params.error$.next({id:"AuthorizeUnknown",category:H.ErrorCategory.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 Yr=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}},Re=class extends Yr{constructor(){super(),this.listeners||Yr.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)}},or=class{constructor(){Object.defineProperty(this,"signal",{value:new Re,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&&(or.prototype[Symbol.toStringTag]="AbortController",Re.prototype[Symbol.toStringTag]="AbortSignal");function Jr(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 no(r){typeof r=="function"&&(r={fetch:r});let{fetch:e,Request:t=e.Request,AbortController:i,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o=!1}=r;if(!Jr({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,g)=>{f.addEventListener("abort",()=>g(h),{once:!0})});return l&&l.signal&&delete l.signal,Promise.race([c,s(d,l)])}return s(d,l)},Request:n}}var iy=()=>"fetch"in window,nr=iy()&&Jr({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),wl=nr?no({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,Ce=nr?wl.fetch:window.fetch,Y_=nr?wl.Request:window.Request,J_=nr?or:window.AbortController,X_=nr?Re:window.AbortSignal;var Ol=R(ye(),1),Al=R(xe(),1),ee=require("@vkontakte/videoplayer-shared/es2018");var ar=class{constructor(e){this.params=e,this.apiKey=e.config.apiKey,this.apiEnv=e.config.apiEnv,this.apiBaseUrl=zt[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 Ce(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:ee.ErrorCategory.NETWORK,message:"Unhandled resolve api base url error",thrown:t}),zt.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:ee.ErrorCategory.NETWORK,message:"Unhandled beacon error",thrown:s,data:{method:e,params:t}})}return!1}async sendRequest(e,t,i){let o=(0,ee.now)(),n=s=>{if(s instanceof TypeError&&(0,Ol.default)(["Failed to fetch","NetworkError when attempting to fetch resource."],s.message)){this.params.error$.next({id:"Network",category:ee.ErrorCategory.NETWORK,message:"Request failed",thrown:s});return}this.params.error$.next({id:"OneStat:ApiTransport:sendRequest",category:ee.ErrorCategory.NETWORK,message:"Unhandled request error",thrown:s,data:{method:e,params:t,sessionKey:i,time:(0,ee.now)()-o}})};return this.apiBaseUrl=await this.resolveApiBaseUrl(),Ce(`${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=(0,ee.now)()-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,Al.default)(e.queryParams).forEach(([i,o])=>t.append(i,typeof o=="string"?o:JSON.stringify(o))),t}};var ql=R(ye(),1),xl=R(xe(),1),M=require("@vkontakte/videoplayer-shared/es2018"),Xr="onestat_events",ao=r=>e=>e.timestamp+r>=(0,M.now)(),Zr=class{constructor(e){this.unsaltedStorage=[];this.isPaused=!1;this.isUrgent=e=>{let{operation:t}=e;return(0,ql.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=(0,M.debounceFn)(()=>this.safeFlush(),this.params.config.firstFlushTime,{maxWait:this.params.config.firstFlushTime});let t=M.safeStorage.isPersistent()?this.params.config.flushMaxWait:0;this.debouncedFlush=(0,M.debounceFn)(()=>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:M.ErrorCategory.WTF,message:e?String(e):"Unknown logger error",thrown:e})}}readFromStorage(){let e=M.safeStorage.get(Xr);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));M.safeStorage.set(Xr,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],M.safeStorage.set(Xr,JSON.stringify(e))}housekeepStorage(){let e=this.readFromStorage();for(let[t,i]of(0,xl.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`})}M.safeStorage.set(Xr,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()}};var b=require("@vkontakte/videoplayer-core/es2018"),so=require("@vkontakte/videoplayer-shared/es2018");var Rl=r=>r&&{[b.VideoQuality.INVARIANT]:"unknown",[b.VideoQuality.Q_144P]:"mobile",[b.VideoQuality.Q_240P]:"lowest",[b.VideoQuality.Q_360P]:"low",[b.VideoQuality.Q_480P]:"medium",[b.VideoQuality.Q_576P]:"unknown",[b.VideoQuality.Q_720P]:"high",[b.VideoQuality.Q_1080P]:"fullhd",[b.VideoQuality.Q_1440P]:"quadhd",[b.VideoQuality.Q_2160P]:"ultrahd",[b.VideoQuality.Q_4320P]:"unknown"}[r],uo=r=>r&&{[b.HttpConnectionType.HTTP1]:"http1",[b.HttpConnectionType.HTTP2]:"http2",[b.HttpConnectionType.QUIC]:"http3"}[r],Cl=r=>{if(r!==void 0)switch(r){case b.VideoFormat.MPEG:return"mp4";case b.VideoFormat.DASH:case b.VideoFormat.DASH_LIVE:case b.VideoFormat.DASH_STREAMS:return"dash";case b.VideoFormat.DASH_SEP:return"dash_sep";case b.VideoFormat.DASH_ONDEMAND:return"ondemand_dash";case b.VideoFormat.DASH_WEBM:case b.VideoFormat.DASH_LIVE_WEBM:return"webm";case b.VideoFormat.DASH_WEBM_AV1:return"av1";case b.VideoFormat.DASH_LIVE_CMAF:return"ondemand_dash_live";case b.VideoFormat.HLS:case b.VideoFormat.HLS_LIVE:return"hls";case b.VideoFormat.HLS_ONDEMAND:return"ondemand_hls";case b.VideoFormat.HLS_LIVE_CMAF:return"ondemand_hls_live";case b.VideoFormat.WEB_RTC_LIVE:return"webrtc";default:return(0,so.assertNever)(r)}},et=r=>{if(r!==void 0)switch(r){case b.Surface.NONE:case b.Surface.INLINE:return;case b.Surface.FULLSCREEN:return"fullscreen";case b.Surface.SECOND_SCREEN:return"chromecast";case b.Surface.PIP:return"pip";case b.Surface.INVISIBLE:return"invisible";default:return(0,so.assertNever)(r)}},kl=r=>{switch(r){case"slow-2g":return"poor";case"2g":return"poor";case"3g":return"good";case"4g":return"excellent"}};var rt=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=R(lo(),1),Yl=()=>(0,fo.default)(Math.floor(Math.random()*2**32).toString(36),7,"0"),Jl=()=>(0,fo.default)(Math.floor(Math.random()*2**64).toString(36),13,"0");var po=require("@vkontakte/videoplayer-core/es2018"),E=require("@vkontakte/videoplayer-shared/es2018"),Xl=(r,e)=>new E.Observable(t=>{let i=new E.Subscription,o=(0,E.merge)((0,E.fromEvent)(window,"beforeunload"),r.events.willDestruct$),n=new E.ValueSubject(void 0),s;i.add(r.info.isLive$.pipe((0,E.filterChanged)()).subscribe(w=>{s&&(s.unsubscribe(),n.next(void 0)),w?s=r.info.liveTime$.pipe((0,E.map)(x=>x&&x/1e3)).subscribe(n):s=r.info.position$.subscribe(n),i.add(s)}));let{playing$:u,paused$:d}=r.events,l=r.events.willSeek$.pipe((0,E.filter)(()=>r.info.playbackState$.getValue()===po.PlaybackState.PLAYING)),f=r.events.seeked$.pipe((0,E.filter)(()=>r.info.playbackState$.getValue()===po.PlaybackState.PLAYING)),h=!1,c=new E.Subject;i.add(l.subscribe(()=>{h||c.next(),h=!0})),i.add(f.subscribe(()=>h=!1));let p=new E.Subject,g=new E.Subject,m=(0,E.merge)(u,f,p),S=(0,E.merge)(d,c,o,r.events.looped$,g),I,_=()=>I=n.getValue(),q=()=>{let w=n.getValue();(0,E.isNullable)(I)||I===w||(0,E.isNullable)(w)||(t.next({from:I,to:w}),I=void 0)},F=()=>{g.next(),p.next()};if(i.add(m.subscribe(_)),i.add(S.subscribe(q)),e.forceInterval&&isFinite(e.forceInterval)){let w=0;i.add(m.subscribe(()=>w=window.setTimeout(F,e.forceInterval))),i.add(S.subscribe(()=>window.clearTimeout(w)))}return i});var Py="_one-stat_",Zl=`${Py}deviceId`,ho=()=>{let r=new v.Subscription;return{subscription:r,subscribe:(e,t)=>{e&&r.add(e.subscribe(t))}}},tt=class{constructor(e,t){this.subscription=new v.Subscription;this.debugLogger=new it.Logger;this.oneStatDebugLog=this.debugLogger.createComponentLog("onestat");this.loopCounter=0;this.disabled=!1;this.vsid$=new v.ValueSubject(void 0);this.isid$=new v.ValueSubject(void 0);this.zenUid$=new v.ValueSubject(void 0);this.seekAction$=new v.ValueSubject("unknown");var d,l,f;this.statContext=e,this.config=Ta((d=t.config)!=null?d:{}),(0,v.isNonNullable)(t.apiEnv)&&(this.config.apiEnv=t.apiEnv),this.config.synchronizeTime&&(this.timeSynchronisation=new rt);let i=new v.Subject;this.experimental={error$:i};let o=v.safeStorage.get(Zl);this.statContext.deviceId?this.deviceId=this.statContext.deviceId:o?this.deviceId=o:(this.deviceId=Qt(),v.safeStorage.set(Zl,this.deviceId)),this.resetViewSession(),t.useIsid&&this.isid$.next((l=t.isid)!=null?l:Jl()),this.zenUid$.next(t.zenUid);let n=new ar({config:this.config,error$:i,timeSynchronisation:this.timeSynchronisation});this.api=new ir({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}=(0,it.detectEmbed)();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 v.Subscription,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(Xl(e,{forceInterval:this.config.watchCoverageInterval}),c=>{var S,I,_,q;let p=e.info.isLive$.getValue(),g=e.info.atLiveEdge$.getValue(),m={start:parseFloat(c.from.toFixed(3)),end:parseFloat(c.to.toFixed(3))};if(g){let F=(S=e.info.liveLatency$.getValue())!=null?S:0,w=(_=(I=e.info.currentBuffer$.getValue())==null?void 0:I.end)!=null?_:0,x=(q=e.info.liveBufferTime$.getValue())!=null?q:0,sr=Math.round((F-(w-x))*1e3),ur=Math.round(F*1e3);sr&&ur&&(m.latency=sr,m.bufferLatency=ur)}p?this.logWatchCoverageLive(m):this.logWatchCoverageRecord(m)});let o;i(e.info.isStalled$,c=>{c?o=(0,v.now)():((0,v.isNonNullable)(o)&&this.logEmptyBuffer({duration:(0,v.now)()-o}),o=void 0)});let n=!1;t.add(e.events.fatalError$.pipe((0,v.once)()).subscribe(()=>n=!0)),i(e.events.willStop$,()=>{if(e.info.isStalled$.getValue()){let p=(0,v.isNonNullable)(o)?(0,v.now)()-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=(0,v.now)(),this.logFirstBytes({time:c})}),i(e.events.willStart$,()=>u=(0,v.now)()),i(e.info.currentBuffer$,c=>{!d&&c&&c.end-c.start>0&&(0,v.isNonNullable)(s)&&(this.logPlayerReady({duration:(0,v.now)()-s}),d=!0)}),i(e.events.firstFrame$,()=>{(0,v.isNonNullable)(s)&&!d&&(this.logPlayerReady({duration:(0,v.now)()-s}),d=!0),(0,v.isNonNullable)(u)&&this.logFirstFrame({time:(0,v.now)()-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((0,v.combine)({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=Rl(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:Cl(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=>{(0,v.isNullable)(this.statContext.firstConnectionReused)&&this.updateContext({firstConnectionReused:c}),this.updateContext({connectionReused:c})}),i(e.info.surface$,c=>this.updateContext({mode:et(c)})),i((0,v.combine)({current:e.info.currentTextTrack$,available:e.info.availableTextTracks$}),({current:c,available:p})=>{let g=p.find(({id:S})=>S===c),m=g&&(g.isAuto?`${g.language}_auto`:g.language);this.updateContext({subtitles:m==null?void 0:m.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}=ho();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":et((s=this.player)==null?void 0:s.info.surface$.getValue());this.updateContext({mode:n})}),i(e.inFullscreen$,o=>{var s;let n=o?"fullscreen":et((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}=ho();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}=ho();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(Yl())}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((0,v.merge)((0,v.fromEvent)(e,"change"),(0,v.observableFrom)(["init"])).subscribe(()=>this.updateContext({network:kl(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=(0,v.fromEvent)(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,vo.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,g,m,S,I,_;let n=(g=(p=this.timeSynchronisation)==null?void 0:p.now())!=null?g:(0,v.now)(),s=this.vsid$.getValue();(0,v.assertNonNullable)(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 q=[...new URLSearchParams(location.search).entries()].filter(([F,w])=>(0,vo.default)(this.config.embedUrlParams,F));h=new URLSearchParams(q).toString()}else this.statContext.place==="direct"&&(this.statContext.refDomain?f=(S=(m=(0,v.createURL)(this.statContext.refDomain))==null?void 0:m.hostname)!=null?S:this.statContext.refDomain:document.referrer&&(f=(_=(I=(0,v.createURL)(document.referrer))==null?void 0:I.hostname)!=null?_: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||(0,v.isNullable)(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 q of this.config.disabledCustomFields)delete c[q];return{operation:e,type:1,time:i,network:this.statContext.network,timestamp:n,custom:c}}};var dt={};Po(dt,{SeekType:()=>ot,ThinOneStat:()=>lt,VERSION:()=>ie});var T=require("@vkontakte/videoplayer-shared/es2018"),G=require("@vkontakte/videoplayer-core/es2018");var td=require("@vkontakte/videoplayer-shared/es2018");var ot=(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))(ot||{});var ie="__VERSION__",rd="CIOPGQJGDIHBABABA",go={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 Ty={apiKey:rd,apiEnv:"vk_alias",requestRetryCount:1,firstFlushTime:5e3,flushDebounceTime:1e4,flushMaxWait:6e4,storageExpiration:36*60*60*1e3,watchCoverageHeartbeatInterval:15,synchronizeTime:!0,useBeacon:!1,alwaysSendDesktop:!1},id=r=>(0,td.fillWithDefault)(r,Ty);var mo=R(Ui(),1),K=require("@vkontakte/videoplayer-shared/es2018");var nt=class{constructor(e){this.params=e,this.authorized$=new K.ValueSubject(!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:K.ErrorCategory.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:K.ErrorCategory.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,mo.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:${ie}`,platform:e[0].platform,product:e[0].product,events:e})}}authorizeWithBackoff(){if(!this.consequentAuthErrors)return this.doAuthorize();let e=(0,K.getExponentialDelay)(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:K.ErrorCategory.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:ie.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,mo.default)(this.params.apiTransport.sendRequest(e,t).then(i=>{var o;return(!i||!i.session_key)&&this.params.error$.next({id:"AuthorizeFailed",category:K.ErrorCategory.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:K.ErrorCategory.EXTERNAL_API,message:"authorize error",data:i}):this.params.error$.next({id:"AuthorizeUnknown",category:K.ErrorCategory.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 od=R(ye(),1);var nd=R(xe(),1),re=require("@vkontakte/videoplayer-shared/es2018");var at=class{constructor(e){this.params=e,this.apiKey=e.config.apiKey,this.apiEnv=e.config.apiEnv,this.apiBaseUrl=go[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:re.ErrorCategory.NETWORK,message:"Unhandled beacon error",thrown:s,data:{method:e,params:t}})}return!1}async sendRequest(e,t,i,o){let n=(0,re.now)(),s=u=>{if(u instanceof TypeError&&(0,od.default)(["Failed to fetch","NetworkError when attempting to fetch resource."],u.message)){this.params.error$.next({id:"Network",category:re.ErrorCategory.NETWORK,message:"Request failed",thrown:u});return}this.params.error$.next({id:"ThinOneStat:ApiTransport:sendRequest",category:re.ErrorCategory.NETWORK,message:"Unhandled request error",thrown:u,data:{method:e,params:t,sessionKey:i,time:(0,re.now)()-n}})};return this.apiBaseUrl=await this.resolveApiBaseUrl(),Ce(`${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=(0,re.now)()-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 Ce(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:re.ErrorCategory.NETWORK,message:"Unhandled resolve api base url error",thrown:t}),go.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,nd.default)(e.queryParams).forEach(([i,o])=>t.append(i,typeof o=="string"?o:JSON.stringify(o))),t}};var ad=R(ye(),1),sd=R(xe(),1),V=require("@vkontakte/videoplayer-shared/es2018"),st="thinonestat_events",bo=r=>e=>e.client_time+r>=(0,V.now)(),ut=class{constructor(e){this.unsaltedStorage=[];this.isPaused=!1;this.isUrgent=e=>{let{event_name:t}=e;return(0,ad.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=(0,V.debounceFn)(()=>this.safeFlush(),this.params.config.firstFlushTime,{maxWait:this.params.config.firstFlushTime});let t=V.safeStorage.isPersistent()?this.params.config.flushMaxWait:0;this.debouncedFlush=(0,V.debounceFn)(()=>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:V.ErrorCategory.WTF,message:String(e)||"Unknown logger error",thrown:e})}}readFromStorage(){let e=V.safeStorage.get(st);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(bo(this.params.config.storageExpiration));V.safeStorage.set(st,JSON.stringify({...t,[this.userSalt]:[...o,e]}))}getFromStorage(){var i;return this.userSalt?((i=this.readFromStorage()[this.userSalt])!=null?i:[]).filter(bo(this.params.config.storageExpiration)):this.unsaltedStorage}markStorageSent(){if(!this.userSalt){this.unsaltedStorage=[];return}let e=this.readFromStorage();delete e[this.userSalt],V.safeStorage.set(st,JSON.stringify(e))}housekeepStorage(){let e=this.readFromStorage();for(let[t,i]of(0,sd.default)(e)){let o=i.filter(bo(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`})}V.safeStorage.set(st,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 yo(){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 ct=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 Io=require("@vkontakte/videoplayer-core/es2018"),P=require("@vkontakte/videoplayer-shared/es2018"),ud=(r,e)=>new P.Observable(t=>{let i=new P.Subscription,o=new P.ValueSubject(void 0),n;i.add(r.info.isLive$.pipe((0,P.filterChanged)()).subscribe(x=>{n&&(n.unsubscribe(),o.next(void 0)),x?n=r.info.liveTime$.pipe((0,P.filterChanged)()).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((0,P.filter)(()=>r.info.playbackState$.getValue()===Io.PlaybackState.PLAYING)),h=r.events.seeked$.pipe((0,P.filter)(()=>r.info.playbackState$.getValue()===Io.PlaybackState.PLAYING)),c=!1,p=new P.Subject;i.add(f.subscribe(()=>{c||p.next(),c=!0})).add(h.subscribe(()=>c=!1));let g=(0,P.merge)((0,P.fromEvent)(window,"beforeunload"),r.events.willDestruct$),m,S=()=>m=o.getValue(),I=()=>{let x=o.getValue();(0,P.isNullable)(m)||(0,P.isNullable)(x)||m===x||(t.next({from:m,to:x}),m=void 0)},_=new P.Subject,q=new P.Subject,F=(0,P.merge)(s,p,_),w=(0,P.merge)(u,h,g,d,l,q);if(i.add(F.subscribe(S)).add(w.subscribe(I)),e.heartbeatInterval&&isFinite(e.heartbeatInterval)){let x=[],sr=e.heartbeatInterval*1e3,ur=()=>{q.next(),_.next()};i.add(F.subscribe(()=>{let ft=window.setTimeout(ur,sr);x.push(ft)})).add(w.subscribe(()=>{x.forEach(ft=>{window.clearTimeout(ft)}),x=[]}))}return i});var cd=require("@vkontakte/videoplayer-core/es2018"),ld=require("@vkontakte/videoplayer-shared/es2018"),dd=(r,e)=>new ld.Observable(t=>{let i=new cd.Subscription,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});var pe=require("@vkontakte/videoplayer-shared/es2018"),fd=r=>new pe.Observable(e=>{let t=new pe.Subscription,i=0,o=1,n=0,s=!1,u=!1,d=()=>{if(!s)return;let w=Date.now();n+=(w-i)*o,i=w},l=()=>{(!s||u)&&(i=Date.now(),s=!0,u=!1)},f=()=>{s&&(d(),s=!1)},h=()=>{s&&(d(),s=!1,u=!0)},c=w=>{s&&d(),o=w,i=Date.now()},{started$:p,playing$:g,paused$:m,willSeek$:S,ended$:I,willDestruct$:_}=r.events,{currentPlaybackRate$:q}=r.info;t.add(S.subscribe(h)).add((0,pe.merge)(p,g).subscribe(l)).add((0,pe.merge)(m,I,_).subscribe(f)).add(q.subscribe(c));let F=()=>{let w=n;return s&&(w+=(Date.now()-i)*o),Math.floor(w/1e3)};return e.next(F),t});var So=require("@vkontakte/videoplayer-shared/es2018"),y=require("@vkontakte/videoplayer-core/es2018");var _o=r=>{if(r!==void 0)switch(r){case y.VideoFormat.MPEG:return"MP4";case y.VideoFormat.DASH:case y.VideoFormat.DASH_LIVE:return"DASH";case y.VideoFormat.DASH_SEP:return"DASH_SEP";case y.VideoFormat.DASH_ONDEMAND:return"ONDEMAND_DASH";case y.VideoFormat.HLS_ONDEMAND:return"ONDEMAND_HLS";case y.VideoFormat.HLS:case y.VideoFormat.HLS_LIVE:return"HLS";case y.VideoFormat.DASH_WEBM:case y.VideoFormat.DASH_LIVE_WEBM:return"WEBM";case y.VideoFormat.DASH_LIVE_CMAF:return"ONDEMAND_DASH_LIVE";case y.VideoFormat.HLS_LIVE_CMAF:return"ONDEMAND_HLS_LIVE";case y.VideoFormat.WEB_RTC_LIVE:return"WEBRTC";case y.VideoFormat.DASH_WEBM_AV1:return"AV1";case y.VideoFormat.DASH_STREAMS:return"MULTI_DASH";default:return(0,So.assertNever)(r)}},oe=r=>{if(r!==void 0)switch(r){case y.VideoQuality.Q_144P:return"144p";case y.VideoQuality.Q_240P:return"240p";case y.VideoQuality.Q_360P:return"360p";case y.VideoQuality.Q_480P:return"480p";case y.VideoQuality.Q_720P:return"720p";case y.VideoQuality.Q_1080P:return"1080p";case y.VideoQuality.Q_1440P:return"1440p";case y.VideoQuality.Q_2160P:return"2160p";case y.VideoQuality.INVARIANT:case y.VideoQuality.Q_576P:case y.VideoQuality.Q_4320P:return"UNKNOWN";default:return(0,So.assertNever)(r)}},pd=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}},hd=(r,e,t)=>{var i;if(r&&e)switch(r){case y.VideoFormat.MPEG:return t&&e[r]&&e[r][t];default:return(i=e[r])==null?void 0:i.url}},vd=r=>{if(r!==void 0)switch(r){case y.Surface.NONE:return;case y.Surface.INLINE:return"inline";case y.Surface.FULLSCREEN:return"fullscreen";case y.Surface.SECOND_SCREEN:return"chromecast";case y.Surface.PIP:return"pip_external"}},gd=r=>{if(r!==void 0)return r===y.Surface.INVISIBLE?"background":"foreground"};var Eo=R(lo(),1),md=()=>(0,Eo.default)(Math.floor(Math.random()*2**32).toString(36),13,"0"),bd=()=>(0,Eo.default)(Math.floor(Math.random()*2**64).toString(36),13,"0");var wy="_thin-one-stat_",yd=`${wy}deviceId`,Oy=()=>{let r=new T.Subscription;return{subscription:r,subscribe:(e,t)=>{e&&r.add(e.subscribe(t))}}},lt=class{constructor(e,t){this.debugLogger=new T.Logger;this.thinOneStatDebugLog=this.debugLogger.createComponentLog("ThinOneStat");this.eventNumber=1;this.seekAction$=new T.ValueSubject("unknown");this.playerSize$=new T.ValueSubject({width:0,height:0});this.vsid$=new T.ValueSubject(void 0);this.isid$=new T.ValueSubject(void 0);var d,l;this.statContext=e,this.config=id((d=t.config)!=null?d:{}),this.subscription=new T.Subscription,this.config.synchronizeTime&&(this.timeSynchronisation=new ct);let i=new T.Subject,o=T.safeStorage.get(yd);this.statContext.deviceId?this.deviceId=this.statContext.deviceId:o?this.deviceId=o:(this.deviceId=yo(),T.safeStorage.set(yd,this.deviceId)),this.resetViewSession(),t.useIsid&&this.isid$.next((l=t.isid)!=null?l:bd());let n=new at({error$:i,config:this.config,timeSynchronisation:this.timeSynchronisation});this.api=new nt({config:this.config,apiTransport:n,error$:i,deviceId:this.deviceId,refreshAuthToken:t.refreshAuthToken}),this.logger=new ut({config:this.config,debugLogger:this.debugLogger,api:this.api,error$:i,userSalt:t.userSalt});let{isEmbed:s,topOrigin:u}=(0,T.detectEmbed)();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 T.Subscription,i=(n,s)=>t.add(n.subscribe(s));i(fd(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(ud(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:_o(e.info.currentFormat$.getValue()),playback_quality:oe(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(dd(e,{getTotalViewTime:this.getTotalViewTime}),n=>{this.logWatchedN(n)}),i((0,T.merge)(e.events.willStart$,e.events.looped$),n=>{var u;n&&this.resetViewSession();let s={isid:this.isid$.getValue(),stream_profile:pd(_o(e.info.currentFormat$.getValue())),dpi:G.clientChecker.display.pixelRatio,web_layout:G.clientChecker.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:hd(n,s,d),playback_quality:oe(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===G.PlaybackState.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(),g=e.info.availableTextTracks$.getValue(),m=e.info.currentTextTrack$.getValue(),S=e.info.currentAudioStream$.getValue(),I=e.info.currentPlaybackRate$.getValue(),_={playback_quality:oe(l),user_quality:f?"auto":oe(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:vd(p),visibility:gd(p),subtitles_enabled:!!m,auto_subtitles:!!((s=g.find(({id:q})=>q===m))!=null&&s.isAuto),audio_track_lang:S==null?void 0:S.language,playback_rate:I,recom_info:this.statContext.recomInfo};this.logPlaybackStarted(_)}}else n===G.PlaybackState.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((0,T.merge)(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":oe(n),playback_quality:oe(n),download_quality:oe(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}=Oy();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(md()),this.eventNumber=0}destroy(){this.api.destroy()}createRequiredParams(e){let t=this.vsid$.getValue();(0,T.assertNonNullable)(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:${ie}`,platform:`web:${G.clientChecker.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:ie,browser:G.clientChecker.browser.current,browser_version:String(G.clientChecker.browser.currentVersion),os:G.clientChecker.device.current,os_version:"",device_type:G.clientChecker.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=(0,T.fromEvent)(window,"beforeunload").subscribe(()=>{}),this.subscription.add(this.beforeunloadSubscription)}};
6
+ "use strict";var Ed=Object.create;var cr=Object.defineProperty;var Pd=Object.getOwnPropertyDescriptor;var Td=Object.getOwnPropertyNames;var wd=Object.getPrototypeOf,Od=Object.prototype.hasOwnProperty;var a=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),Po=(r,e)=>{for(var t in e)cr(r,t,{get:e[t],enumerable:!0})},To=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Td(e))!Od.call(r,o)&&o!==t&&cr(r,o,{get:()=>e[o],enumerable:!(i=Pd(e,o))||i.enumerable});return r};var R=(r,e,t)=>(t=r!=null?Ed(wd(r)):{},To(e||!r||!r.__esModule?cr(t,"default",{value:r,enumerable:!0}):t,r)),Ad=r=>To(cr({},"__esModule",{value:!0}),r);var O=a((pt,wo)=>{"use strict";var ke=function(r){return r&&r.Math===Math&&r};wo.exports=ke(typeof globalThis=="object"&&globalThis)||ke(typeof window=="object"&&window)||ke(typeof self=="object"&&self)||ke(typeof global=="object"&&global)||ke(typeof pt=="object"&&pt)||function(){return this}()||Function("return this")()});var C=a((Ly,Oo)=>{"use strict";Oo.exports=function(r){try{return!!r()}catch(e){return!0}}});var De=a((Ny,Ao)=>{"use strict";var qd=C();Ao.exports=!qd(function(){var r=function(){}.bind();return typeof r!="function"||r.hasOwnProperty("prototype")})});var ht=a((ky,Co)=>{"use strict";var xd=De(),Ro=Function.prototype,qo=Ro.apply,xo=Ro.call;Co.exports=typeof Reflect=="object"&&Reflect.apply||(xd?xo.bind(qo):function(){return xo.apply(qo,arguments)})});var L=a((Dy,ko)=>{"use strict";var Lo=De(),No=Function.prototype,vt=No.call,Rd=Lo&&No.bind.bind(vt,vt);ko.exports=Lo?Rd:function(r){return function(){return vt.apply(r,arguments)}}});var $e=a(($y,$o)=>{"use strict";var Do=L(),Cd=Do({}.toString),Ld=Do("".slice);$o.exports=function(r){return Ld(Cd(r),8,-1)}});var gt=a((My,Mo)=>{"use strict";var Nd=$e(),kd=L();Mo.exports=function(r){if(Nd(r)==="Function")return kd(r)}});var A=a((Vy,Vo)=>{"use strict";var mt=typeof document=="object"&&document.all;Vo.exports=typeof mt=="undefined"&&mt!==void 0?function(r){return typeof r=="function"||r===mt}:function(r){return typeof r=="function"}});var N=a((Fy,Fo)=>{"use strict";var Dd=C();Fo.exports=!Dd(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})});var B=a((By,Bo)=>{"use strict";var $d=De(),lr=Function.prototype.call;Bo.exports=$d?lr.bind(lr):function(){return lr.apply(lr,arguments)}});var bt=a(Wo=>{"use strict";var Uo={}.propertyIsEnumerable,jo=Object.getOwnPropertyDescriptor,Md=jo&&!Uo.call({1:2},1);Wo.f=Md?function(e){var t=jo(this,e);return!!t&&t.enumerable}:Uo});var Me=a((jy,Ho)=>{"use strict";Ho.exports=function(r,e){return{enumerable:!(r&1),configurable:!(r&2),writable:!(r&4),value:e}}});var Go=a((Wy,Ko)=>{"use strict";var Vd=L(),Fd=C(),Bd=$e(),yt=Object,Ud=Vd("".split);Ko.exports=Fd(function(){return!yt("z").propertyIsEnumerable(0)})?function(r){return Bd(r)==="String"?Ud(r,""):yt(r)}:yt});var Ve=a((Hy,zo)=>{"use strict";zo.exports=function(r){return r==null}});var ve=a((Ky,Qo)=>{"use strict";var jd=Ve(),Wd=TypeError;Qo.exports=function(r){if(jd(r))throw new Wd("Can't call method on "+r);return r}});var ne=a((Gy,Yo)=>{"use strict";var Hd=Go(),Kd=ve();Yo.exports=function(r){return Hd(Kd(r))}});var U=a((zy,Jo)=>{"use strict";var Gd=A();Jo.exports=function(r){return typeof r=="object"?r!==null:Gd(r)}});var ge=a((Qy,Xo)=>{"use strict";Xo.exports={}});var Y=a((Yy,en)=>{"use strict";var It=ge(),St=O(),zd=A(),Zo=function(r){return zd(r)?r:void 0};en.exports=function(r,e){return arguments.length<2?Zo(It[r])||Zo(St[r]):It[r]&&It[r][e]||St[r]&&St[r][e]}});var dr=a((Jy,rn)=>{"use strict";var Qd=L();rn.exports=Qd({}.isPrototypeOf)});var ae=a((Xy,nn)=>{"use strict";var Yd=O(),tn=Yd.navigator,on=tn&&tn.userAgent;nn.exports=on?String(on):""});var Et=a((Zy,dn)=>{"use strict";var ln=O(),_t=ae(),an=ln.process,sn=ln.Deno,un=an&&an.versions||sn&&sn.version,cn=un&&un.v8,j,fr;cn&&(j=cn.split("."),fr=j[0]>0&&j[0]<4?1:+(j[0]+j[1]));!fr&&_t&&(j=_t.match(/Edge\/(\d+)/),(!j||j[1]>=74)&&(j=_t.match(/Chrome\/(\d+)/),j&&(fr=+j[1])));dn.exports=fr});var Pt=a((eI,pn)=>{"use strict";var fn=Et(),Jd=C(),Xd=O(),Zd=Xd.String;pn.exports=!!Object.getOwnPropertySymbols&&!Jd(function(){var r=Symbol("symbol detection");return!Zd(r)||!(Object(r)instanceof Symbol)||!Symbol.sham&&fn&&fn<41})});var Tt=a((rI,hn)=>{"use strict";var ef=Pt();hn.exports=ef&&!Symbol.sham&&typeof Symbol.iterator=="symbol"});var wt=a((tI,vn)=>{"use strict";var rf=Y(),tf=A(),of=dr(),nf=Tt(),af=Object;vn.exports=nf?function(r){return typeof r=="symbol"}:function(r){var e=rf("Symbol");return tf(e)&&of(e.prototype,af(r))}});var Fe=a((iI,gn)=>{"use strict";var sf=String;gn.exports=function(r){try{return sf(r)}catch(e){return"Object"}}});var J=a((oI,mn)=>{"use strict";var uf=A(),cf=Fe(),lf=TypeError;mn.exports=function(r){if(uf(r))return r;throw new lf(cf(r)+" is not a function")}});var pr=a((nI,bn)=>{"use strict";var df=J(),ff=Ve();bn.exports=function(r,e){var t=r[e];return ff(t)?void 0:df(t)}});var In=a((aI,yn)=>{"use strict";var Ot=B(),At=A(),qt=U(),pf=TypeError;yn.exports=function(r,e){var t,i;if(e==="string"&&At(t=r.toString)&&!qt(i=Ot(t,r))||At(t=r.valueOf)&&!qt(i=Ot(t,r))||e!=="string"&&At(t=r.toString)&&!qt(i=Ot(t,r)))return i;throw new pf("Can't convert object to primitive value")}});var z=a((sI,Sn)=>{"use strict";Sn.exports=!0});var Pn=a((uI,En)=>{"use strict";var _n=O(),hf=Object.defineProperty;En.exports=function(r,e){try{hf(_n,r,{value:e,configurable:!0,writable:!0})}catch(t){_n[r]=e}return e}});var Be=a((cI,On)=>{"use strict";var vf=z(),gf=O(),mf=Pn(),Tn="__core-js_shared__",wn=On.exports=gf[Tn]||mf(Tn,{});(wn.versions||(wn.versions=[])).push({version:"3.43.0",mode:vf?"pure":"global",copyright:"\xA9 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.43.0/LICENSE",source:"https://github.com/zloirock/core-js"})});var xt=a((lI,qn)=>{"use strict";var An=Be();qn.exports=function(r,e){return An[r]||(An[r]=e||{})}});var Rt=a((dI,xn)=>{"use strict";var bf=ve(),yf=Object;xn.exports=function(r){return yf(bf(r))}});var Q=a((fI,Rn)=>{"use strict";var If=L(),Sf=Rt(),_f=If({}.hasOwnProperty);Rn.exports=Object.hasOwn||function(e,t){return _f(Sf(e),t)}});var Ct=a((pI,Cn)=>{"use strict";var Ef=L(),Pf=0,Tf=Math.random(),wf=Ef(1.1.toString);Cn.exports=function(r){return"Symbol("+(r===void 0?"":r)+")_"+wf(++Pf+Tf,36)}});var k=a((hI,Nn)=>{"use strict";var Of=O(),Af=xt(),Ln=Q(),qf=Ct(),xf=Pt(),Rf=Tt(),me=Of.Symbol,Lt=Af("wks"),Cf=Rf?me.for||me:me&&me.withoutSetter||qf;Nn.exports=function(r){return Ln(Lt,r)||(Lt[r]=xf&&Ln(me,r)?me[r]:Cf("Symbol."+r)),Lt[r]}});var Mn=a((vI,$n)=>{"use strict";var Lf=B(),kn=U(),Dn=wt(),Nf=pr(),kf=In(),Df=k(),$f=TypeError,Mf=Df("toPrimitive");$n.exports=function(r,e){if(!kn(r)||Dn(r))return r;var t=Nf(r,Mf),i;if(t){if(e===void 0&&(e="default"),i=Lf(t,r,e),!kn(i)||Dn(i))return i;throw new $f("Can't convert object to primitive value")}return e===void 0&&(e="number"),kf(r,e)}});var Nt=a((gI,Vn)=>{"use strict";var Vf=Mn(),Ff=wt();Vn.exports=function(r){var e=Vf(r,"string");return Ff(e)?e:e+""}});var hr=a((mI,Bn)=>{"use strict";var Bf=O(),Fn=U(),kt=Bf.document,Uf=Fn(kt)&&Fn(kt.createElement);Bn.exports=function(r){return Uf?kt.createElement(r):{}}});var Dt=a((bI,Un)=>{"use strict";var jf=N(),Wf=C(),Hf=hr();Un.exports=!jf&&!Wf(function(){return Object.defineProperty(Hf("div"),"a",{get:function(){return 7}}).a!==7})});var Hn=a(Wn=>{"use strict";var Kf=N(),Gf=B(),zf=bt(),Qf=Me(),Yf=ne(),Jf=Nt(),Xf=Q(),Zf=Dt(),jn=Object.getOwnPropertyDescriptor;Wn.f=Kf?jn:function(e,t){if(e=Yf(e),t=Jf(t),Zf)try{return jn(e,t)}catch(i){}if(Xf(e,t))return Qf(!Gf(zf.f,e,t),e[t])}});var $t=a((II,Kn)=>{"use strict";var ep=C(),rp=A(),tp=/#|\.prototype\./,Ue=function(r,e){var t=op[ip(r)];return t===ap?!0:t===np?!1:rp(e)?ep(e):!!e},ip=Ue.normalize=function(r){return String(r).replace(tp,".").toLowerCase()},op=Ue.data={},np=Ue.NATIVE="N",ap=Ue.POLYFILL="P";Kn.exports=Ue});var je=a((SI,zn)=>{"use strict";var Gn=gt(),sp=J(),up=De(),cp=Gn(Gn.bind);zn.exports=function(r,e){return sp(r),e===void 0?r:up?cp(r,e):function(){return r.apply(e,arguments)}}});var Mt=a((_I,Qn)=>{"use strict";var lp=N(),dp=C();Qn.exports=lp&&dp(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})});var X=a((EI,Yn)=>{"use strict";var fp=U(),pp=String,hp=TypeError;Yn.exports=function(r){if(fp(r))return r;throw new hp(pp(r)+" is not an object")}});var se=a(Xn=>{"use strict";var vp=N(),gp=Dt(),mp=Mt(),vr=X(),Jn=Nt(),bp=TypeError,Vt=Object.defineProperty,yp=Object.getOwnPropertyDescriptor,Ft="enumerable",Bt="configurable",Ut="writable";Xn.f=vp?mp?function(e,t,i){if(vr(e),t=Jn(t),vr(i),typeof e=="function"&&t==="prototype"&&"value"in i&&Ut in i&&!i[Ut]){var o=yp(e,t);o&&o[Ut]&&(e[t]=i.value,i={configurable:Bt in i?i[Bt]:o[Bt],enumerable:Ft in i?i[Ft]:o[Ft],writable:!1})}return Vt(e,t,i)}:Vt:function(e,t,i){if(vr(e),t=Jn(t),vr(i),gp)try{return Vt(e,t,i)}catch(o){}if("get"in i||"set"in i)throw new bp("Accessors not supported");return"value"in i&&(e[t]=i.value),e}});var be=a((TI,Zn)=>{"use strict";var Ip=N(),Sp=se(),_p=Me();Zn.exports=Ip?function(r,e,t){return Sp.f(r,e,_p(1,t))}:function(r,e,t){return r[e]=t,r}});var D=a((wI,ra)=>{"use strict";var We=O(),Ep=ht(),Pp=gt(),Tp=A(),wp=Hn().f,Op=$t(),ye=ge(),Ap=je(),Ie=be(),ea=Q();Be();var qp=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 Ep(r,this,arguments)};return e.prototype=r.prototype,e};ra.exports=function(r,e){var t=r.target,i=r.global,o=r.stat,n=r.proto,s=i?We:o?We[t]:We[t]&&We[t].prototype,u=i?ye:ye[t]||Ie(ye,t,{})[t],d=u.prototype,l,f,h,c,p,g,m,S,I;for(c in e)l=Op(i?c:t+(o?".":"#")+c,r.forced),f=!l&&s&&ea(s,c),g=u[c],f&&(r.dontCallGetSet?(I=wp(s,c),m=I&&I.value):m=s[c]),p=f&&m?m:e[c],!(!l&&!n&&typeof g==typeof p)&&(r.bind&&f?S=Ap(p,We):r.wrap&&f?S=qp(p):n&&Tp(p)?S=Pp(p):S=p,(r.sham||p&&p.sham||g&&g.sham)&&Ie(S,"sham",!0),Ie(u,c,S),n&&(h=t+"Prototype",ea(ye,h)||Ie(ye,h,{}),Ie(ye[h],c,p),r.real&&d&&(l||!d[c])&&Ie(d,c,p)))}});var ia=a((OI,ta)=>{"use strict";var xp=Math.ceil,Rp=Math.floor;ta.exports=Math.trunc||function(e){var t=+e;return(t>0?Rp:xp)(t)}});var gr=a((AI,oa)=>{"use strict";var Cp=ia();oa.exports=function(r){var e=+r;return e!==e||e===0?0:Cp(e)}});var aa=a((qI,na)=>{"use strict";var Lp=gr(),Np=Math.max,kp=Math.min;na.exports=function(r,e){var t=Lp(r);return t<0?Np(t+e,0):kp(t,e)}});var jt=a((xI,sa)=>{"use strict";var Dp=gr(),$p=Math.min;sa.exports=function(r){var e=Dp(r);return e>0?$p(e,9007199254740991):0}});var Wt=a((RI,ua)=>{"use strict";var Mp=jt();ua.exports=function(r){return Mp(r.length)}});var Ht=a((CI,la)=>{"use strict";var Vp=ne(),Fp=aa(),Bp=Wt(),ca=function(r){return function(e,t,i){var o=Vp(e),n=Bp(o);if(n===0)return!r&&-1;var s=Fp(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}};la.exports={includes:ca(!0),indexOf:ca(!1)}});var Kt=a((LI,da)=>{"use strict";da.exports=function(){}});var fa=a(()=>{"use strict";var Up=D(),jp=Ht().includes,Wp=C(),Hp=Kt(),Kp=Wp(function(){return!Array(1).includes()});Up({target:"Array",proto:!0,forced:Kp},{includes:function(e){return jp(this,e,arguments.length>1?arguments[1]:void 0)}});Hp("includes")});var mr=a((DI,pa)=>{"use strict";var Gp=Y();pa.exports=Gp});var va=a(($I,ha)=>{"use strict";fa();var zp=mr();ha.exports=zp("Array","includes")});var ma=a((MI,ga)=>{"use strict";var Qp=va();ga.exports=Qp});var Se=a((VI,ba)=>{"use strict";var Yp=ma();ba.exports=Yp});var wa=a(()=>{"use strict"});var Yt=a((JI,Oa)=>{"use strict";var Ke=O(),Xp=ae(),Zp=$e(),_r=function(r){return Xp.slice(0,r.length)===r};Oa.exports=function(){return _r("Bun/")?"BUN":_r("Cloudflare-Workers")?"CLOUDFLARE":_r("Deno/")?"DENO":_r("Node.js/")?"NODE":Ke.Bun&&typeof Bun.version=="string"?"BUN":Ke.Deno&&typeof Deno.version=="object"?"DENO":Zp(Ke.process)==="process"?"NODE":Ke.window&&Ke.document?"BROWSER":"REST"}()});var Er=a((XI,Aa)=>{"use strict";var eh=Yt();Aa.exports=eh==="NODE"});var Ee=a((ZI,qa)=>{"use strict";var rh=be();qa.exports=function(r,e,t,i){return i&&i.enumerable?r[e]=t:rh(r,e,t),r}});var Ra=a((eS,xa)=>{"use strict";var th=L(),ih=J();xa.exports=function(r,e,t){try{return th(ih(Object.getOwnPropertyDescriptor(r,e)[t]))}catch(i){}}});var La=a((rS,Ca)=>{"use strict";var oh=U();Ca.exports=function(r){return oh(r)||r===null}});var ka=a((tS,Na)=>{"use strict";var nh=La(),ah=String,sh=TypeError;Na.exports=function(r){if(nh(r))return r;throw new sh("Can't set "+ah(r)+" as a prototype")}});var Jt=a((iS,Da)=>{"use strict";var uh=Ra(),ch=U(),lh=ve(),dh=ka();Da.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var r=!1,e={},t;try{t=uh(Object.prototype,"__proto__","set"),t(e,[]),r=e instanceof Array}catch(i){}return function(o,n){return lh(o),dh(n),ch(o)&&(r?t(o,n):o.__proto__=n),o}}():void 0)});var Pr=a((oS,Ma)=>{"use strict";var fh=k(),ph=fh("toStringTag"),$a={};$a[ph]="z";Ma.exports=String($a)==="[object z]"});var Ge=a((nS,Va)=>{"use strict";var hh=Pr(),vh=A(),Tr=$e(),gh=k(),mh=gh("toStringTag"),bh=Object,yh=Tr(function(){return arguments}())==="Arguments",Ih=function(r,e){try{return r[e]}catch(t){}};Va.exports=hh?Tr:function(r){var e,t,i;return r===void 0?"Undefined":r===null?"Null":typeof(t=Ih(e=bh(r),mh))=="string"?t:yh?Tr(e):(i=Tr(e))==="Object"&&vh(e.callee)?"Arguments":i}});var Ba=a((aS,Fa)=>{"use strict";var Sh=Pr(),_h=Ge();Fa.exports=Sh?{}.toString:function(){return"[object "+_h(this)+"]"}});var ze=a((sS,ja)=>{"use strict";var Eh=Pr(),Ph=se().f,Th=be(),wh=Q(),Oh=Ba(),Ah=k(),Ua=Ah("toStringTag");ja.exports=function(r,e,t,i){var o=t?r:r&&r.prototype;o&&(wh(o,Ua)||Ph(o,Ua,{configurable:!0,value:e}),i&&!Eh&&Th(o,"toString",Oh))}});var Ha=a((uS,Wa)=>{"use strict";var qh=se();Wa.exports=function(r,e,t){return qh.f(r,e,t)}});var za=a((cS,Ga)=>{"use strict";var xh=Y(),Rh=Ha(),Ch=k(),Lh=N(),Ka=Ch("species");Ga.exports=function(r){var e=xh(r);Lh&&e&&!e[Ka]&&Rh(e,Ka,{configurable:!0,get:function(){return this}})}});var Ya=a((lS,Qa)=>{"use strict";var Nh=dr(),kh=TypeError;Qa.exports=function(r,e){if(Nh(e,r))return r;throw new kh("Incorrect invocation")}});var Zt=a((dS,Ja)=>{"use strict";var Dh=L(),$h=A(),Xt=Be(),Mh=Dh(Function.toString);$h(Xt.inspectSource)||(Xt.inspectSource=function(r){return Mh(r)});Ja.exports=Xt.inspectSource});var is=a((fS,ts)=>{"use strict";var Vh=L(),Fh=C(),Xa=A(),Bh=Ge(),Uh=Y(),jh=Zt(),Za=function(){},es=Uh("Reflect","construct"),ei=/^\s*(?:class|function)\b/,Wh=Vh(ei.exec),Hh=!ei.test(Za),Qe=function(e){if(!Xa(e))return!1;try{return es(Za,[],e),!0}catch(t){return!1}},rs=function(e){if(!Xa(e))return!1;switch(Bh(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Hh||!!Wh(ei,jh(e))}catch(t){return!0}};rs.sham=!0;ts.exports=!es||Fh(function(){var r;return Qe(Qe.call)||!Qe(Object)||!Qe(function(){r=!0})||r})?rs:Qe});var ns=a((pS,os)=>{"use strict";var Kh=is(),Gh=Fe(),zh=TypeError;os.exports=function(r){if(Kh(r))return r;throw new zh(Gh(r)+" is not a constructor")}});var ri=a((hS,ss)=>{"use strict";var as=X(),Qh=ns(),Yh=Ve(),Jh=k(),Xh=Jh("species");ss.exports=function(r,e){var t=as(r).constructor,i;return t===void 0||Yh(i=as(t)[Xh])?e:Qh(i)}});var ti=a((vS,us)=>{"use strict";var Zh=Y();us.exports=Zh("document","documentElement")});var ls=a((gS,cs)=>{"use strict";var ev=L();cs.exports=ev([].slice)});var fs=a((mS,ds)=>{"use strict";var rv=TypeError;ds.exports=function(r,e){if(r<e)throw new rv("Not enough arguments");return r}});var ii=a((bS,ps)=>{"use strict";var tv=ae();ps.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(tv)});var fi=a((yS,_s)=>{"use strict";var $=O(),iv=ht(),ov=je(),hs=A(),nv=Q(),Ss=C(),vs=ti(),av=ls(),gs=hr(),sv=fs(),uv=ii(),cv=Er(),ci=$.setImmediate,li=$.clearImmediate,lv=$.process,oi=$.Dispatch,dv=$.Function,ms=$.MessageChannel,fv=$.String,ni=0,Ye={},bs="onreadystatechange",Je,ue,ai,si;Ss(function(){Je=$.location});var di=function(r){if(nv(Ye,r)){var e=Ye[r];delete Ye[r],e()}},ui=function(r){return function(){di(r)}},ys=function(r){di(r.data)},Is=function(r){$.postMessage(fv(r),Je.protocol+"//"+Je.host)};(!ci||!li)&&(ci=function(e){sv(arguments.length,1);var t=hs(e)?e:dv(e),i=av(arguments,1);return Ye[++ni]=function(){iv(t,void 0,i)},ue(ni),ni},li=function(e){delete Ye[e]},cv?ue=function(r){lv.nextTick(ui(r))}:oi&&oi.now?ue=function(r){oi.now(ui(r))}:ms&&!uv?(ai=new ms,si=ai.port2,ai.port1.onmessage=ys,ue=ov(si.postMessage,si)):$.addEventListener&&hs($.postMessage)&&!$.importScripts&&Je&&Je.protocol!=="file:"&&!Ss(Is)?(ue=Is,$.addEventListener("message",ys,!1)):bs in gs("script")?ue=function(r){vs.appendChild(gs("script"))[bs]=function(){vs.removeChild(this),di(r)}}:ue=function(r){setTimeout(ui(r),0)});_s.exports={set:ci,clear:li}});var Ts=a((IS,Ps)=>{"use strict";var Es=O(),pv=N(),hv=Object.getOwnPropertyDescriptor;Ps.exports=function(r){if(!pv)return Es[r];var e=hv(Es,r);return e&&e.value}});var pi=a((SS,Os)=>{"use strict";var ws=function(){this.head=null,this.tail=null};ws.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}}};Os.exports=ws});var qs=a((_S,As)=>{"use strict";var vv=ae();As.exports=/ipad|iphone|ipod/i.test(vv)&&typeof Pebble!="undefined"});var Rs=a((ES,xs)=>{"use strict";var gv=ae();xs.exports=/web0s(?!.*chrome)/i.test(gv)});var Ms=a((PS,$s)=>{"use strict";var Te=O(),mv=Ts(),Cs=je(),hi=fi().set,bv=pi(),yv=ii(),Iv=qs(),Sv=Rs(),vi=Er(),Ls=Te.MutationObserver||Te.WebKitMutationObserver,Ns=Te.document,ks=Te.process,wr=Te.Promise,bi=mv("queueMicrotask"),Pe,gi,mi,Or,Ds;bi||(Xe=new bv,Ze=function(){var r,e;for(vi&&(r=ks.domain)&&r.exit();e=Xe.get();)try{e()}catch(t){throw Xe.head&&Pe(),t}r&&r.enter()},!yv&&!vi&&!Sv&&Ls&&Ns?(gi=!0,mi=Ns.createTextNode(""),new Ls(Ze).observe(mi,{characterData:!0}),Pe=function(){mi.data=gi=!gi}):!Iv&&wr&&wr.resolve?(Or=wr.resolve(void 0),Or.constructor=wr,Ds=Cs(Or.then,Or),Pe=function(){Ds(Ze)}):vi?Pe=function(){ks.nextTick(Ze)}:(hi=Cs(hi,Te),Pe=function(){hi(Ze)}),bi=function(r){Xe.head||Pe(),Xe.add(r)});var Xe,Ze;$s.exports=bi});var Fs=a((TS,Vs)=>{"use strict";Vs.exports=function(r,e){try{arguments.length===1?console.error(r):console.error(r,e)}catch(t){}}});var Ar=a((wS,Bs)=>{"use strict";Bs.exports=function(r){try{return{error:!1,value:r()}}catch(e){return{error:!0,value:e}}}});var Ws=a((OS,js)=>{"use strict";var _v=O(),Ev=A(),Us=_v.WeakMap;js.exports=Ev(Us)&&/native code/.test(String(Us))});var qr=a((AS,Ks)=>{"use strict";var Pv=xt(),Tv=Ct(),Hs=Pv("keys");Ks.exports=function(r){return Hs[r]||(Hs[r]=Tv(r))}});var xr=a((qS,Gs)=>{"use strict";Gs.exports={}});var _i=a((xS,Ys)=>{"use strict";var wv=Ws(),Qs=O(),Ov=U(),Av=be(),yi=Q(),Ii=Be(),qv=qr(),xv=xr(),zs="Object already initialized",Si=Qs.TypeError,Rv=Qs.WeakMap,Rr,er,Cr,Cv=function(r){return Cr(r)?er(r):Rr(r,{})},Lv=function(r){return function(e){var t;if(!Ov(e)||(t=er(e)).type!==r)throw new Si("Incompatible receiver, "+r+" required");return t}};wv||Ii.state?(W=Ii.state||(Ii.state=new Rv),W.get=W.get,W.has=W.has,W.set=W.set,Rr=function(r,e){if(W.has(r))throw new Si(zs);return e.facade=r,W.set(r,e),e},er=function(r){return W.get(r)||{}},Cr=function(r){return W.has(r)}):(ce=qv("state"),xv[ce]=!0,Rr=function(r,e){if(yi(r,ce))throw new Si(zs);return e.facade=r,Av(r,ce,e),e},er=function(r){return yi(r,ce)?r[ce]:{}},Cr=function(r){return yi(r,ce)});var W,ce;Ys.exports={set:Rr,get:er,has:Cr,enforce:Cv,getterFor:Lv}});var le=a((RS,Js)=>{"use strict";var Nv=O();Js.exports=Nv.Promise});var we=a((CS,ru)=>{"use strict";var kv=O(),rr=le(),Dv=A(),$v=$t(),Mv=Zt(),Vv=k(),Xs=Yt(),Fv=z(),Ei=Et(),Zs=rr&&rr.prototype,Bv=Vv("species"),Pi=!1,eu=Dv(kv.PromiseRejectionEvent),Uv=$v("Promise",function(){var r=Mv(rr),e=r!==String(rr);if(!e&&Ei===66||Fv&&!(Zs.catch&&Zs.finally))return!0;if(!Ei||Ei<51||!/native code/.test(r)){var t=new rr(function(n){n(1)}),i=function(n){n(function(){},function(){})},o=t.constructor={};if(o[Bv]=i,Pi=t.then(function(){})instanceof i,!Pi)return!0}return!e&&(Xs==="BROWSER"||Xs==="DENO")&&!eu});ru.exports={CONSTRUCTOR:Uv,REJECTION_EVENT:eu,SUBCLASSING:Pi}});var Oe=a((LS,iu)=>{"use strict";var tu=J(),jv=TypeError,Wv=function(r){var e,t;this.promise=new r(function(i,o){if(e!==void 0||t!==void 0)throw new jv("Bad Promise constructor");e=i,t=o}),this.resolve=tu(e),this.reject=tu(t)};iu.exports.f=function(r){return new Wv(r)}});var Eu=a(()=>{"use strict";var Hv=D(),Kv=z(),Dr=Er(),te=O(),Gv=ge(),Re=B(),ou=Ee(),nu=Jt(),zv=ze(),Qv=za(),Yv=J(),kr=A(),Jv=U(),Xv=Ya(),Zv=ri(),lu=fi().set,qi=Ms(),eg=Fs(),rg=Ar(),tg=pi(),du=_i(),$r=le(),xi=we(),fu=Oe(),Mr="Promise",pu=xi.CONSTRUCTOR,ig=xi.REJECTION_EVENT,og=xi.SUBCLASSING,Ti=du.getterFor(Mr),ng=du.set,Ae=$r&&$r.prototype,de=$r,Lr=Ae,hu=te.TypeError,wi=te.document,Ri=te.process,Oi=fu.f,ag=Oi,sg=!!(wi&&wi.createEvent&&te.dispatchEvent),vu="unhandledrejection",ug="rejectionhandled",au=0,gu=1,cg=2,Ci=1,mu=2,Nr,su,bu,uu,yu=function(r){var e;return Jv(r)&&kr(e=r.then)?e:!1},Iu=function(r,e){var t=e.value,i=e.state===gu,o=i?r.ok:r.fail,n=r.resolve,s=r.reject,u=r.domain,d,l,f;try{o?(i||(e.rejection===mu&&dg(e),e.rejection=Ci),o===!0?d=t:(u&&u.enter(),d=o(t),u&&(u.exit(),f=!0)),d===r.promise?s(new hu("Promise-chain cycle")):(l=yu(d))?Re(l,d,n,s):n(d)):s(t)}catch(h){u&&!f&&u.exit(),s(h)}},Su=function(r,e){r.notified||(r.notified=!0,qi(function(){for(var t=r.reactions,i;i=t.get();)Iu(i,r);r.notified=!1,e&&!r.rejection&&lg(r)}))},_u=function(r,e,t){var i,o;sg?(i=wi.createEvent("Event"),i.promise=e,i.reason=t,i.initEvent(r,!1,!0),te.dispatchEvent(i)):i={promise:e,reason:t},!ig&&(o=te["on"+r])?o(i):r===vu&&eg("Unhandled promise rejection",t)},lg=function(r){Re(lu,te,function(){var e=r.facade,t=r.value,i=cu(r),o;if(i&&(o=rg(function(){Dr?Ri.emit("unhandledRejection",t,e):_u(vu,e,t)}),r.rejection=Dr||cu(r)?mu:Ci,o.error))throw o.value})},cu=function(r){return r.rejection!==Ci&&!r.parent},dg=function(r){Re(lu,te,function(){var e=r.facade;Dr?Ri.emit("rejectionHandled",e):_u(ug,e,r.value)})},qe=function(r,e,t){return function(i){r(e,i,t)}},xe=function(r,e,t){r.done||(r.done=!0,t&&(r=t),r.value=e,r.state=cg,Su(r,!0))},Ai=function(r,e,t){if(!r.done){r.done=!0,t&&(r=t);try{if(r.facade===e)throw new hu("Promise can't be resolved itself");var i=yu(e);i?qi(function(){var o={done:!1};try{Re(i,e,qe(Ai,o,r),qe(xe,o,r))}catch(n){xe(o,n,r)}}):(r.value=e,r.state=gu,Su(r,!1))}catch(o){xe({done:!1},o,r)}}};if(pu&&(de=function(e){Xv(this,Lr),Yv(e),Re(Nr,this);var t=Ti(this);try{e(qe(Ai,t),qe(xe,t))}catch(i){xe(t,i)}},Lr=de.prototype,Nr=function(e){ng(this,{type:Mr,done:!1,notified:!1,parent:!1,reactions:new tg,rejection:!1,state:au,value:null})},Nr.prototype=ou(Lr,"then",function(e,t){var i=Ti(this),o=Oi(Zv(this,de));return i.parent=!0,o.ok=kr(e)?e:!0,o.fail=kr(t)&&t,o.domain=Dr?Ri.domain:void 0,i.state===au?i.reactions.add(o):qi(function(){Iu(o,i)}),o.promise}),su=function(){var r=new Nr,e=Ti(r);this.promise=r,this.resolve=qe(Ai,e),this.reject=qe(xe,e)},fu.f=Oi=function(r){return r===de||r===bu?new su(r):ag(r)},!Kv&&kr($r)&&Ae!==Object.prototype)){uu=Ae.then,og||ou(Ae,"then",function(e,t){var i=this;return new de(function(o,n){Re(uu,i,o,n)}).then(e,t)},{unsafe:!0});try{delete Ae.constructor}catch(r){}nu&&nu(Ae,Lr)}Hv({global:!0,constructor:!0,wrap:!0,forced:pu},{Promise:de});bu=Gv.Promise;zv(de,Mr,!1,!0);Qv(Mr)});var fe=a((DS,Pu)=>{"use strict";Pu.exports={}});var wu=a(($S,Tu)=>{"use strict";var fg=k(),pg=fe(),hg=fg("iterator"),vg=Array.prototype;Tu.exports=function(r){return r!==void 0&&(pg.Array===r||vg[hg]===r)}});var Li=a((MS,Au)=>{"use strict";var gg=Ge(),Ou=pr(),mg=Ve(),bg=fe(),yg=k(),Ig=yg("iterator");Au.exports=function(r){if(!mg(r))return Ou(r,Ig)||Ou(r,"@@iterator")||bg[gg(r)]}});var xu=a((VS,qu)=>{"use strict";var Sg=B(),_g=J(),Eg=X(),Pg=Fe(),Tg=Li(),wg=TypeError;qu.exports=function(r,e){var t=arguments.length<2?Tg(r):e;if(_g(t))return Eg(Sg(t,r));throw new wg(Pg(r)+" is not iterable")}});var Lu=a((FS,Cu)=>{"use strict";var Og=B(),Ru=X(),Ag=pr();Cu.exports=function(r,e,t){var i,o;Ru(r);try{if(i=Ag(r,"return"),!i){if(e==="throw")throw t;return t}i=Og(i,r)}catch(n){o=!0,i=n}if(e==="throw")throw t;if(o)throw i;return Ru(i),t}});var Fr=a((BS,$u)=>{"use strict";var qg=je(),xg=B(),Rg=X(),Cg=Fe(),Lg=wu(),Ng=Wt(),Nu=dr(),kg=xu(),Dg=Li(),ku=Lu(),$g=TypeError,Vr=function(r,e){this.stopped=r,this.result=e},Du=Vr.prototype;$u.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,g,m,S=function(_){return l&&ku(l,"normal"),new Vr(!0,_)},I=function(_){return o?(Rg(_),u?d(_[0],_[1],S):d(_[0],_[1])):u?d(_,S):d(_)};if(n)l=r.iterator;else if(s)l=r;else{if(f=Dg(r),!f)throw new $g(Cg(r)+" is not iterable");if(Lg(f)){for(h=0,c=Ng(r);c>h;h++)if(p=I(r[h]),p&&Nu(Du,p))return p;return new Vr(!1)}l=kg(r,f)}for(g=n?r.next:l.next;!(m=xg(g,l)).done;){try{p=I(m.value)}catch(_){ku(l,"throw",_)}if(typeof p=="object"&&p&&Nu(Du,p))return p}return new Vr(!1)}});var Uu=a((US,Bu)=>{"use strict";var Mg=k(),Vu=Mg("iterator"),Fu=!1;try{Mu=0,Ni={next:function(){return{done:!!Mu++}},return:function(){Fu=!0}},Ni[Vu]=function(){return this},Array.from(Ni,function(){throw 2})}catch(r){}var Mu,Ni;Bu.exports=function(r,e){try{if(!e&&!Fu)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 ki=a((jS,ju)=>{"use strict";var Vg=le(),Fg=Uu(),Bg=we().CONSTRUCTOR;ju.exports=Bg||!Fg(function(r){Vg.all(r).then(void 0,function(){})})});var Wu=a(()=>{"use strict";var Ug=D(),jg=B(),Wg=J(),Hg=Oe(),Kg=Ar(),Gg=Fr(),zg=ki();Ug({target:"Promise",stat:!0,forced:zg},{all:function(e){var t=this,i=Hg.f(t),o=i.resolve,n=i.reject,s=Kg(function(){var u=Wg(t.resolve),d=[],l=0,f=1;Gg(e,function(h){var c=l++,p=!1;f++,jg(u,t,h).then(function(g){p||(p=!0,d[c]=g,--f||o(d))},n)}),--f||o(d)});return s.error&&n(s.value),i.promise}})});var Ku=a(()=>{"use strict";var Qg=D(),Yg=z(),Jg=we().CONSTRUCTOR,$i=le(),Xg=Y(),Zg=A(),em=Ee(),Hu=$i&&$i.prototype;Qg({target:"Promise",proto:!0,forced:Jg,real:!0},{catch:function(r){return this.then(void 0,r)}});!Yg&&Zg($i)&&(Di=Xg("Promise").prototype.catch,Hu.catch!==Di&&em(Hu,"catch",Di,{unsafe:!0}));var Di});var Gu=a(()=>{"use strict";var rm=D(),tm=B(),im=J(),om=Oe(),nm=Ar(),am=Fr(),sm=ki();rm({target:"Promise",stat:!0,forced:sm},{race:function(e){var t=this,i=om.f(t),o=i.reject,n=nm(function(){var s=im(t.resolve);am(e,function(u){tm(s,t,u).then(i.resolve,o)})});return n.error&&o(n.value),i.promise}})});var zu=a(()=>{"use strict";var um=D(),cm=Oe(),lm=we().CONSTRUCTOR;um({target:"Promise",stat:!0,forced:lm},{reject:function(e){var t=cm.f(this),i=t.reject;return i(e),t.promise}})});var Mi=a((XS,Qu)=>{"use strict";var dm=X(),fm=U(),pm=Oe();Qu.exports=function(r,e){if(dm(r),fm(e)&&e.constructor===r)return e;var t=pm.f(r),i=t.resolve;return i(e),t.promise}});var Xu=a(()=>{"use strict";var hm=D(),vm=Y(),Yu=z(),gm=le(),Ju=we().CONSTRUCTOR,mm=Mi(),bm=vm("Promise"),ym=Yu&&!Ju;hm({target:"Promise",stat:!0,forced:Yu||Ju},{resolve:function(e){return mm(ym&&this===bm?gm:this,e)}})});var Zu=a(()=>{"use strict";Eu();Wu();Ku();Gu();zu();Xu()});var ic=a(()=>{"use strict";var Im=D(),Sm=z(),Br=le(),_m=C(),rc=Y(),tc=A(),Em=ri(),ec=Mi(),Pm=Ee(),Fi=Br&&Br.prototype,Tm=!!Br&&_m(function(){Fi.finally.call({then:function(){}},function(){})});Im({target:"Promise",proto:!0,real:!0,forced:Tm},{finally:function(r){var e=Em(this,rc("Promise")),t=tc(r);return this.then(t?function(i){return ec(e,r()).then(function(){return i})}:r,t?function(i){return ec(e,r()).then(function(){throw i})}:r)}});!Sm&&tc(Br)&&(Vi=rc("Promise").prototype.finally,Fi.finally!==Vi&&Pm(Fi,"finally",Vi,{unsafe:!0}));var Vi});var nc=a((n_,oc)=>{"use strict";wa();Zu();ic();var wm=mr();oc.exports=wm("Promise","finally")});var sc=a((a_,ac)=>{"use strict";var Om=nc();ac.exports=Om});var Bi=a((s_,uc)=>{"use strict";var Am=sc();uc.exports=Am});var lc=a((u_,cc)=>{"use strict";var qm=C();cc.exports=!qm(function(){function r(){}return r.prototype.constructor=null,Object.getPrototypeOf(new r)!==r.prototype})});var Ur=a((c_,fc)=>{"use strict";var xm=Q(),Rm=A(),Cm=Rt(),Lm=qr(),Nm=lc(),dc=Lm("IE_PROTO"),Ui=Object,km=Ui.prototype;fc.exports=Nm?Ui.getPrototypeOf:function(r){var e=Cm(r);if(xm(e,dc))return e[dc];var t=e.constructor;return Rm(t)&&e instanceof t?t.prototype:e instanceof Ui?km:null}});var vc=a((l_,hc)=>{"use strict";var Dm=L(),ji=Q(),$m=ne(),Mm=Ht().indexOf,Vm=xr(),pc=Dm([].push);hc.exports=function(r,e){var t=$m(r),i=0,o=[],n;for(n in t)!ji(Vm,n)&&ji(t,n)&&pc(o,n);for(;e.length>i;)ji(t,n=e[i++])&&(~Mm(o,n)||pc(o,n));return o}});var Wi=a((d_,gc)=>{"use strict";gc.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]});var Hi=a((f_,mc)=>{"use strict";var Fm=vc(),Bm=Wi();mc.exports=Object.keys||function(e){return Fm(e,Bm)}});var Ec=a((p_,_c)=>{"use strict";var yc=N(),Um=C(),Ic=L(),jm=Ur(),Wm=Hi(),Hm=ne(),Km=bt().f,Sc=Ic(Km),Gm=Ic([].push),zm=yc&&Um(function(){var r=Object.create(null);return r[2]=2,!Sc(r,2)}),bc=function(r){return function(e){for(var t=Hm(e),i=Wm(t),o=zm&&jm(t)===null,n=i.length,s=0,u=[],d;n>s;)d=i[s++],(!yc||(o?d in t:Sc(t,d)))&&Gm(u,r?[d,t[d]]:t[d]);return u}};_c.exports={entries:bc(!0),values:bc(!1)}});var Pc=a(()=>{"use strict";var Qm=D(),Ym=Ec().entries;Qm({target:"Object",stat:!0},{entries:function(e){return Ym(e)}})});var wc=a((g_,Tc)=>{"use strict";Pc();var Jm=ge();Tc.exports=Jm.Object.entries});var Ac=a((m_,Oc)=>{"use strict";var Xm=wc();Oc.exports=Xm});var Ce=a((b_,qc)=>{"use strict";var Zm=Ac();qc.exports=Zm});var Cc=a((y_,Rc)=>{"use strict";var Ki=N(),eb=Q(),xc=Function.prototype,rb=Ki&&Object.getOwnPropertyDescriptor,Gi=eb(xc,"name"),tb=Gi&&function(){}.name==="something",ib=Gi&&(!Ki||Ki&&rb(xc,"name").configurable);Rc.exports={EXISTS:Gi,PROPER:tb,CONFIGURABLE:ib}});var Nc=a(Lc=>{"use strict";var ob=N(),nb=Mt(),ab=se(),sb=X(),ub=ne(),cb=Hi();Lc.f=ob&&!nb?Object.defineProperties:function(e,t){sb(e);for(var i=ub(t),o=cb(t),n=o.length,s=0,u;n>s;)ab.f(e,u=o[s++],i[u]);return e}});var Ji=a((S_,Bc)=>{"use strict";var lb=X(),db=Nc(),kc=Wi(),fb=xr(),pb=ti(),hb=hr(),vb=qr(),Dc=">",$c="<",Qi="prototype",Yi="script",Vc=vb("IE_PROTO"),zi=function(){},Fc=function(r){return $c+Yi+Dc+r+$c+"/"+Yi+Dc},Mc=function(r){r.write(Fc("")),r.close();var e=r.parentWindow.Object;return r=null,e},gb=function(){var r=hb("iframe"),e="java"+Yi+":",t;return r.style.display="none",pb.appendChild(r),r.src=String(e),t=r.contentWindow.document,t.open(),t.write(Fc("document.F=Object")),t.close(),t.F},jr,Wr=function(){try{jr=new ActiveXObject("htmlfile")}catch(e){}Wr=typeof document!="undefined"?document.domain&&jr?Mc(jr):gb():Mc(jr);for(var r=kc.length;r--;)delete Wr[Qi][kc[r]];return Wr()};fb[Vc]=!0;Bc.exports=Object.create||function(e,t){var i;return e!==null?(zi[Qi]=lb(e),i=new zi,zi[Qi]=null,i[Vc]=e):i=Wr(),t===void 0?i:db.f(i,t)}});var ro=a((__,Wc)=>{"use strict";var mb=C(),bb=A(),yb=U(),Ib=Ji(),Uc=Ur(),Sb=Ee(),_b=k(),Eb=z(),eo=_b("iterator"),jc=!1,Z,Xi,Zi;[].keys&&(Zi=[].keys(),"next"in Zi?(Xi=Uc(Uc(Zi)),Xi!==Object.prototype&&(Z=Xi)):jc=!0);var Pb=!yb(Z)||mb(function(){var r={};return Z[eo].call(r)!==r});Pb?Z={}:Eb&&(Z=Ib(Z));bb(Z[eo])||Sb(Z,eo,function(){return this});Wc.exports={IteratorPrototype:Z,BUGGY_SAFARI_ITERATORS:jc}});var Kc=a((E_,Hc)=>{"use strict";var Tb=ro().IteratorPrototype,wb=Ji(),Ob=Me(),Ab=ze(),qb=fe(),xb=function(){return this};Hc.exports=function(r,e,t,i){var o=e+" Iterator";return r.prototype=wb(Tb,{next:Ob(+!i,t)}),Ab(r,o,!1,!0),qb[o]=xb,r}});var il=a((P_,tl)=>{"use strict";var Rb=D(),Cb=B(),Hr=z(),el=Cc(),Lb=A(),Nb=Kc(),Gc=Ur(),zc=Jt(),kb=ze(),Db=be(),to=Ee(),$b=k(),Qc=fe(),rl=ro(),Mb=el.PROPER,Vb=el.CONFIGURABLE,Yc=rl.IteratorPrototype,Kr=rl.BUGGY_SAFARI_ITERATORS,tr=$b("iterator"),Jc="keys",ir="values",Xc="entries",Zc=function(){return this};tl.exports=function(r,e,t,i,o,n,s){Nb(t,e,i);var u=function(I){if(I===o&&c)return c;if(!Kr&&I&&I in f)return f[I];switch(I){case Jc:return function(){return new t(this,I)};case ir:return function(){return new t(this,I)};case Xc:return function(){return new t(this,I)}}return function(){return new t(this)}},d=e+" Iterator",l=!1,f=r.prototype,h=f[tr]||f["@@iterator"]||o&&f[o],c=!Kr&&h||u(o),p=e==="Array"&&f.entries||h,g,m,S;if(p&&(g=Gc(p.call(new r)),g!==Object.prototype&&g.next&&(!Hr&&Gc(g)!==Yc&&(zc?zc(g,Yc):Lb(g[tr])||to(g,tr,Zc)),kb(g,d,!0,!0),Hr&&(Qc[d]=Zc))),Mb&&o===ir&&h&&h.name!==ir&&(!Hr&&Vb?Db(f,"name",ir):(l=!0,c=function(){return Cb(h,this)})),o)if(m={values:u(ir),keys:n?c:u(Jc),entries:u(Xc)},s)for(S in m)(Kr||l||!(S in f))&&to(f,S,m[S]);else Rb({target:e,proto:!0,forced:Kr||l},m);return(!Hr||s)&&f[tr]!==c&&to(f,tr,c,{name:o}),Qc[e]=c,m}});var nl=a((T_,ol)=>{"use strict";ol.exports=function(r,e){return{value:r,done:e}}});var oo=a((w_,ll)=>{"use strict";var Fb=ne(),io=Kt(),al=fe(),ul=_i(),Bb=se().f,Ub=il(),Gr=nl(),jb=z(),Wb=N(),cl="Array Iterator",Hb=ul.set,Kb=ul.getterFor(cl);ll.exports=Ub(Array,"Array",function(r,e){Hb(this,{type:cl,target:Fb(r),index:0,kind:e})},function(){var r=Kb(this),e=r.target,t=r.index++;if(!e||t>=e.length)return r.target=null,Gr(void 0,!0);switch(r.kind){case"keys":return Gr(t,!1);case"values":return Gr(e[t],!1)}return Gr([t,e[t]],!1)},"values");var sl=al.Arguments=al.Array;io("keys");io("values");io("entries");if(!jb&&Wb&&sl.name!=="values")try{Bb(sl,"name",{value:"values"})}catch(r){}});var fl=a((O_,dl)=>{"use strict";var Gb=N(),zb=se(),Qb=Me();dl.exports=function(r,e,t){Gb?zb.f(r,e,Qb(0,t)):r[e]=t}});var pl=a(()=>{"use strict";var Yb=D(),Jb=Fr(),Xb=fl();Yb({target:"Object",stat:!0},{fromEntries:function(e){var t={};return Jb(e,function(i,o){Xb(t,i,o)},{AS_ENTRIES:!0}),t}})});var vl=a((x_,hl)=>{"use strict";oo();pl();var Zb=ge();hl.exports=Zb.Object.fromEntries});var ml=a((R_,gl)=>{"use strict";gl.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 yl=a(()=>{"use strict";oo();var ey=ml(),ry=O(),ty=ze(),bl=fe();for(zr in ey)ty(ry[zr],zr),bl[zr]=bl.Array;var zr});var Sl=a((N_,Il)=>{"use strict";var iy=vl();yl();Il.exports=iy});var El=a((k_,_l)=>{"use strict";var oy=Sl();_l.exports=oy});var co=a((PE,$l)=>{"use strict";var uy=Ge(),cy=String;$l.exports=function(r){if(uy(r)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return cy(r)}});var Vl=a((TE,Ml)=>{"use strict";var ly=gr(),dy=co(),fy=ve(),py=RangeError;Ml.exports=function(e){var t=dy(fy(this)),i="",o=ly(e);if(o<0||o===1/0)throw new py("Wrong number of repetitions");for(;o>0;(o>>>=1)&&(t+=t))o&1&&(i+=t);return i}});var Wl=a((wE,jl)=>{"use strict";var Ul=L(),hy=jt(),Fl=co(),vy=Vl(),gy=ve(),my=Ul(vy),by=Ul("".slice),yy=Math.ceil,Bl=function(r){return function(e,t,i){var o=Fl(gy(e)),n=hy(t),s=o.length,u=i===void 0?" ":Fl(i),d,l;return n<=s||u===""?o:(d=n-s,l=my(u,yy(d/u.length)),l.length>d&&(l=by(l,0,d)),r?o+l:l+o)}};jl.exports={start:Bl(!1),end:Bl(!0)}});var Kl=a((OE,Hl)=>{"use strict";var Iy=ae();Hl.exports=/Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(Iy)});var Gl=a(()=>{"use strict";var Sy=D(),_y=Wl().start,Ey=Kl();Sy({target:"String",proto:!0,forced:Ey},{padStart:function(e){return _y(this,e,arguments.length>1?arguments[1]:void 0)}})});var Ql=a((xE,zl)=>{"use strict";Gl();var Py=mr();zl.exports=Py("String","padStart")});var Jl=a((RE,Yl)=>{"use strict";var Ty=Ql();Yl.exports=Ty});var lo=a((CE,Xl)=>{"use strict";var wy=Jl();Xl.exports=wy});var Ry={};Po(Ry,{ApiEnv:()=>_e,ConnectionType:()=>Ir,ContentType:()=>yr,InteractiveInterfaceClick:()=>Gt,OneStat:()=>tt,Quality:()=>br,SeekAction:()=>Sr,ThinOneStat:()=>dt,VERSION:()=>He});module.exports=Ad(Ry);var vo=R(Se(),1);var _e=(s=>(s.PROD="prod",s.VK_ALIAS="vk_alias",s.VIDEOTEST="videotest",s.TEST="test",s.OKCDN="okcdn",s.AUTO="auto",s))(_e||{}),br=(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))(br||{}),yr=(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))(yr||{});var Ir=(i=>(i.HTTP1="http1",i.HTTP2="http2",i.HTTP3="http3",i))(Ir||{});var Sr=(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))(Sr||{}),Gt=(n=>(n.GRAPH_SHOW="iGraphShow",n.GRAPH_HIDE="iGraphHide",n.NEXT_AREA="iNextChapterArea",n.NEXT_BUTTON="iNextChapterBtn",n.WATCH_AGAIN="iWatchAgainBtn",n))(Gt||{}),ya={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"},Ia={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"},Sa={unknown:"un",mobile:"m",lowest:"ls",low:"l",medium:"md",high:"h",fullhd:"f",quadhd:"q",ultrahd:"u"},_a={pip:"pi",fullscreen:"fs",external:"ex",prefetch:"pr",airplay:"ap",chromecast:"cc",invisible:"iv"};var Pa=require("@vkontakte/videoplayer-shared/es2018");var He="__VERSION__",Ea="CIOPGQJGDIHBABABA",zt={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 Jp={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}},Ta=r=>(0,Pa.fillWithDefault)(r,Jp);function Qt(){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 v=require("@vkontakte/videoplayer-shared/es2018"),it=require("@vkontakte/videoplayer-shared/es2018");var Qr=R(Bi(),1);var Pl=R(Ce(),1),Tl=R(El(),1);var wl=r=>{var o;let{operation:e,custom:t}=r,i=(0,Tl.default)((0,Pl.default)(t).map(([n,s])=>{var l,f,h;let u=(l=Ia[n])!=null?l:n,d=s;return s&&(n==="mode"?d=(f=_a[s])!=null?f:s:n==="quality"&&(d=(h=Sa[s])!=null?h:s)),[u,d]}));return{...r,operation:(o=ya[e])!=null?o:e,custom:i}};var H=require("@vkontakte/videoplayer-shared/es2018");var ny=/Mobile|mini|Fennec|Android|iP(ad|od|hone)|opera (mini|mobi)/i,or=class{constructor(e){this.consequentAuthErrors=0;this.authorized$=new H.ValueSubject(!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:H.ErrorCategory.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:H.ErrorCategory.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,Qr.default)(this.params.refreshAuthToken(),()=>{this.refreshAuthTokenPromise=void 0})),this.refreshAuthTokenPromise}createLogParams(e){let t="WEB",i=!1,o=`@vkontakte/videoplayer-statistics:${He}`;if(this.params.config.useVKComIsMobileLogic){let{appVersion:n}=window.navigator;i=ny.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(wl):e})}}_authorizeWithBackoff(){if(!this.consequentAuthErrors)return this._authorize();let e=(0,H.getExponentialDelay)(this.consequentAuthErrors,this.params.config.backoff);return new Promise(t=>{this.backoffTimeoutId||(this.backoffTimeoutId=window.setTimeout(()=>{(0,Qr.default)(this._authorize().then(t).catch(i=>this.params.error$.next({id:"AuthorizeBackoff",category:H.ErrorCategory.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:He.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,Qr.default)(this.params.apiTransport.sendRequest(e,t).then(i=>{var o;return(!i||!i.session_key)&&this.params.error$.next({id:"AuthorizeFailed",category:H.ErrorCategory.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:H.ErrorCategory.EXTERNAL_API,message:"authorize error",data:i}):this.params.error$.next({id:"AuthorizeUnknown",category:H.ErrorCategory.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{NativeAbortSignal:K_,NativeAbortController:G_}=function(r){return{NativeAbortSignal:r.AbortSignal,NativeAbortController:r.AbortController}}(typeof self!="undefined"?self:global);function Ol(r){let e;try{e=new Event("abort")}catch(t){typeof document!="undefined"?document.createEvent?(e=document.createEvent("Event"),e.initEvent("abort",!1,!1)):(e=document.createEventObject(),e.type="abort"):e={type:"abort",bubbles:!1,cancelable:!1}}return e.reason=r,e}function Al(r){if(r===void 0)if(typeof document=="undefined")r=new Error("This operation was aborted"),r.name="AbortError";else try{r=new DOMException("signal is aborted without reason"),Object.defineProperty(r,"name",{value:"AbortError"})}catch(e){r=new Error("This operation was aborted"),r.name="AbortError"}return r}var Yr=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}},Le=class extends Yr{constructor(){super(),this.listeners||Yr.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)}throwIfAborted(){let{aborted:e,reason:t="Aborted"}=this;if(e)throw t}static timeout(e){let t=new pe;return setTimeout(()=>t.abort(new DOMException(`This signal is timeout in ${e}ms`,"TimeoutError")),e),t.signal}static any(e){let t=new pe;function i(){t.abort(this.reason),o()}function o(){for(let n of e)n.removeEventListener("abort",i)}for(let n of e)if(n.aborted){t.abort(n.reason);break}else n.addEventListener("abort",i);return t.signal}},pe=class{constructor(){Object.defineProperty(this,"signal",{value:new Le,writable:!0,configurable:!0})}abort(e){let t=Al(e),i=Ol(t);this.signal.reason=t,this.signal.dispatchEvent(i)}toString(){return"[object AbortController]"}};typeof Symbol!="undefined"&&Symbol.toStringTag&&(pe.prototype[Symbol.toStringTag]="AbortController",Le.prototype[Symbol.toStringTag]="AbortSignal");function Jr(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 no(r){typeof r=="function"&&(r={fetch:r});let{fetch:e,Request:t=e.Request,AbortController:i,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o=!1}=r;if(!Jr({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,g)=>{f.addEventListener("abort",()=>g(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,nr=ay()&&Jr({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),ql=nr?no({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,Ne=nr?ql.fetch:window.fetch,iE=nr?ql.Request:window.Request,oE=nr?pe:window.AbortController,nE=nr?Le:window.AbortSignal;var xl=R(Se(),1),Rl=R(Ce(),1),ee=require("@vkontakte/videoplayer-shared/es2018");var ar=class{constructor(e){this.params=e,this.apiKey=e.config.apiKey,this.apiEnv=e.config.apiEnv,this.apiBaseUrl=zt[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 Ne(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:ee.ErrorCategory.NETWORK,message:"Unhandled resolve api base url error",thrown:t}),zt.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:ee.ErrorCategory.NETWORK,message:"Unhandled beacon error",thrown:s,data:{method:e,params:t}})}return!1}async sendRequest(e,t,i){let o=(0,ee.now)(),n=s=>{if(s instanceof TypeError&&(0,xl.default)(["Failed to fetch","NetworkError when attempting to fetch resource."],s.message)){this.params.error$.next({id:"Network",category:ee.ErrorCategory.NETWORK,message:"Request failed",thrown:s});return}this.params.error$.next({id:"OneStat:ApiTransport:sendRequest",category:ee.ErrorCategory.NETWORK,message:"Unhandled request error",thrown:s,data:{method:e,params:t,sessionKey:i,time:(0,ee.now)()-o}})};return this.apiBaseUrl=await this.resolveApiBaseUrl(),Ne(`${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=(0,ee.now)()-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,Rl.default)(e.queryParams).forEach(([i,o])=>t.append(i,typeof o=="string"?o:JSON.stringify(o))),t}};var Cl=R(Se(),1),Ll=R(Ce(),1),M=require("@vkontakte/videoplayer-shared/es2018"),Xr="onestat_events",ao=r=>e=>e.timestamp+r>=(0,M.now)(),Zr=class{constructor(e){this.unsaltedStorage=[];this.isPaused=!1;this.isUrgent=e=>{let{operation:t}=e;return(0,Cl.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=(0,M.debounceFn)(()=>this.safeFlush(),this.params.config.firstFlushTime,{maxWait:this.params.config.firstFlushTime});let t=M.safeStorage.isPersistent()?this.params.config.flushMaxWait:0;this.debouncedFlush=(0,M.debounceFn)(()=>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:M.ErrorCategory.WTF,message:e?String(e):"Unknown logger error",thrown:e})}}readFromStorage(){let e=M.safeStorage.get(Xr);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));M.safeStorage.set(Xr,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],M.safeStorage.set(Xr,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`})}M.safeStorage.set(Xr,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()}};var b=require("@vkontakte/videoplayer-core/es2018"),so=require("@vkontakte/videoplayer-shared/es2018");var Nl=r=>r&&{[b.VideoQuality.INVARIANT]:"unknown",[b.VideoQuality.Q_144P]:"mobile",[b.VideoQuality.Q_240P]:"lowest",[b.VideoQuality.Q_360P]:"low",[b.VideoQuality.Q_480P]:"medium",[b.VideoQuality.Q_576P]:"unknown",[b.VideoQuality.Q_720P]:"high",[b.VideoQuality.Q_1080P]:"fullhd",[b.VideoQuality.Q_1440P]:"quadhd",[b.VideoQuality.Q_2160P]:"ultrahd",[b.VideoQuality.Q_4320P]:"unknown"}[r],uo=r=>r&&{[b.HttpConnectionType.HTTP1]:"http1",[b.HttpConnectionType.HTTP2]:"http2",[b.HttpConnectionType.QUIC]:"http3"}[r],kl=r=>{if(r!==void 0)switch(r){case b.VideoFormat.MPEG:return"mp4";case b.VideoFormat.DASH:case b.VideoFormat.DASH_LIVE:case b.VideoFormat.DASH_STREAMS:return"dash";case b.VideoFormat.DASH_SEP:return"dash_sep";case b.VideoFormat.DASH_ONDEMAND:return"ondemand_dash";case b.VideoFormat.DASH_WEBM:case b.VideoFormat.DASH_LIVE_WEBM:return"webm";case b.VideoFormat.DASH_WEBM_AV1:return"av1";case b.VideoFormat.DASH_LIVE_CMAF:return"ondemand_dash_live";case b.VideoFormat.HLS:case b.VideoFormat.HLS_LIVE:return"hls";case b.VideoFormat.HLS_ONDEMAND:return"ondemand_hls";case b.VideoFormat.HLS_LIVE_CMAF:return"ondemand_hls_live";case b.VideoFormat.WEB_RTC_LIVE:return"webrtc";default:return(0,so.assertNever)(r)}},et=r=>{if(r!==void 0)switch(r){case b.Surface.NONE:case b.Surface.INLINE:return;case b.Surface.FULLSCREEN:return"fullscreen";case b.Surface.SECOND_SCREEN:return"chromecast";case b.Surface.PIP:return"pip";case b.Surface.INVISIBLE:return"invisible";default:return(0,so.assertNever)(r)}},Dl=r=>{switch(r){case"slow-2g":return"poor";case"2g":return"poor";case"3g":return"good";case"4g":return"excellent"}};var rt=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=R(lo(),1),Zl=()=>(0,fo.default)(Math.floor(Math.random()*2**32).toString(36),7,"0"),ed=()=>(0,fo.default)(Math.floor(Math.random()*2**64).toString(36),13,"0");var po=require("@vkontakte/videoplayer-core/es2018"),E=require("@vkontakte/videoplayer-shared/es2018"),rd=(r,e)=>new E.Observable(t=>{let i=new E.Subscription,o=(0,E.merge)((0,E.fromEvent)(window,"beforeunload"),r.events.willDestruct$),n=new E.ValueSubject(void 0),s;i.add(r.info.isLive$.pipe((0,E.filterChanged)()).subscribe(w=>{s&&(s.unsubscribe(),n.next(void 0)),w?s=r.info.liveTime$.pipe((0,E.map)(x=>x&&x/1e3)).subscribe(n):s=r.info.position$.subscribe(n),i.add(s)}));let{playing$:u,paused$:d}=r.events,l=r.events.willSeek$.pipe((0,E.filter)(()=>r.info.playbackState$.getValue()===po.PlaybackState.PLAYING)),f=r.events.seeked$.pipe((0,E.filter)(()=>r.info.playbackState$.getValue()===po.PlaybackState.PLAYING)),h=!1,c=new E.Subject;i.add(l.subscribe(()=>{h||c.next(),h=!0})),i.add(f.subscribe(()=>h=!1));let p=new E.Subject,g=new E.Subject,m=(0,E.merge)(u,f,p),S=(0,E.merge)(d,c,o,r.events.looped$,g),I,_=()=>I=n.getValue(),q=()=>{let w=n.getValue();(0,E.isNullable)(I)||I===w||(0,E.isNullable)(w)||(t.next({from:I,to:w}),I=void 0)},F=()=>{g.next(),p.next()};if(i.add(m.subscribe(_)),i.add(S.subscribe(q)),e.forceInterval&&isFinite(e.forceInterval)){let w=0;i.add(m.subscribe(()=>w=window.setTimeout(F,e.forceInterval))),i.add(S.subscribe(()=>window.clearTimeout(w)))}return i});var Oy="_one-stat_",td=`${Oy}deviceId`,ho=()=>{let r=new v.Subscription;return{subscription:r,subscribe:(e,t)=>{e&&r.add(e.subscribe(t))}}},tt=class{constructor(e,t){this.subscription=new v.Subscription;this.debugLogger=new it.Logger;this.oneStatDebugLog=this.debugLogger.createComponentLog("onestat");this.loopCounter=0;this.disabled=!1;this.vsid$=new v.ValueSubject(void 0);this.isid$=new v.ValueSubject(void 0);this.zenUid$=new v.ValueSubject(void 0);this.seekAction$=new v.ValueSubject("unknown");var d,l,f;this.statContext=e,this.config=Ta((d=t.config)!=null?d:{}),(0,v.isNonNullable)(t.apiEnv)&&(this.config.apiEnv=t.apiEnv),this.config.synchronizeTime&&(this.timeSynchronisation=new rt);let i=new v.Subject;this.experimental={error$:i};let o=v.safeStorage.get(td);this.statContext.deviceId?this.deviceId=this.statContext.deviceId:o?this.deviceId=o:(this.deviceId=Qt(),v.safeStorage.set(td,this.deviceId)),this.resetViewSession(),t.useIsid&&this.isid$.next((l=t.isid)!=null?l:ed()),this.zenUid$.next(t.zenUid);let n=new ar({config:this.config,error$:i,timeSynchronisation:this.timeSynchronisation});this.api=new or({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}=(0,it.detectEmbed)();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 v.Subscription,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(rd(e,{forceInterval:this.config.watchCoverageInterval}),c=>{var S,I,_,q;let p=e.info.isLive$.getValue(),g=e.info.atLiveEdge$.getValue(),m={start:parseFloat(c.from.toFixed(3)),end:parseFloat(c.to.toFixed(3))};if(g){let F=(S=e.info.liveLatency$.getValue())!=null?S:0,w=(_=(I=e.info.currentBuffer$.getValue())==null?void 0:I.end)!=null?_:0,x=(q=e.info.liveBufferTime$.getValue())!=null?q:0,sr=Math.round((F-(w-x))*1e3),ur=Math.round(F*1e3);sr&&ur&&(m.latency=sr,m.bufferLatency=ur)}p?this.logWatchCoverageLive(m):this.logWatchCoverageRecord(m)});let o;i(e.info.isStalled$,c=>{c?o=(0,v.now)():((0,v.isNonNullable)(o)&&this.logEmptyBuffer({duration:(0,v.now)()-o}),o=void 0)});let n=!1;t.add(e.events.fatalError$.pipe((0,v.once)()).subscribe(()=>n=!0)),i(e.events.willStop$,()=>{if(e.info.isStalled$.getValue()){let p=(0,v.isNonNullable)(o)?(0,v.now)()-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=(0,v.now)(),this.logFirstBytes({time:c})}),i(e.events.willStart$,()=>u=(0,v.now)()),i(e.info.currentBuffer$,c=>{!d&&c&&c.end-c.start>0&&(0,v.isNonNullable)(s)&&(this.logPlayerReady({duration:(0,v.now)()-s}),d=!0)}),i(e.events.firstFrame$,()=>{(0,v.isNonNullable)(s)&&!d&&(this.logPlayerReady({duration:(0,v.now)()-s}),d=!0),(0,v.isNonNullable)(u)&&this.logFirstFrame({time:(0,v.now)()-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((0,v.combine)({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=Nl(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:kl(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=>{(0,v.isNullable)(this.statContext.firstConnectionReused)&&this.updateContext({firstConnectionReused:c}),this.updateContext({connectionReused:c})}),i(e.info.surface$,c=>this.updateContext({mode:et(c)})),i((0,v.combine)({current:e.info.currentTextTrack$,available:e.info.availableTextTracks$}),({current:c,available:p})=>{let g=p.find(({id:S})=>S===c),m=g&&(g.isAuto?`${g.language}_auto`:g.language);this.updateContext({subtitles:m==null?void 0:m.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}=ho();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":et((s=this.player)==null?void 0:s.info.surface$.getValue());this.updateContext({mode:n})}),i(e.inFullscreen$,o=>{var s;let n=o?"fullscreen":et((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}=ho();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}=ho();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(Zl())}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((0,v.merge)((0,v.fromEvent)(e,"change"),(0,v.observableFrom)(["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=(0,v.fromEvent)(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,vo.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,g,m,S,I,_;let n=(g=(p=this.timeSynchronisation)==null?void 0:p.now())!=null?g:(0,v.now)(),s=this.vsid$.getValue();(0,v.assertNonNullable)(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 q=[...new URLSearchParams(location.search).entries()].filter(([F,w])=>(0,vo.default)(this.config.embedUrlParams,F));h=new URLSearchParams(q).toString()}else this.statContext.place==="direct"&&(this.statContext.refDomain?f=(S=(m=(0,v.createURL)(this.statContext.refDomain))==null?void 0:m.hostname)!=null?S:this.statContext.refDomain:document.referrer&&(f=(_=(I=(0,v.createURL)(document.referrer))==null?void 0:I.hostname)!=null?_: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||(0,v.isNullable)(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 q of this.config.disabledCustomFields)delete c[q];return{operation:e,type:1,time:i,network:this.statContext.network,timestamp:n,custom:c}}};var dt={};Po(dt,{SeekType:()=>ot,ThinOneStat:()=>lt,VERSION:()=>ie});var T=require("@vkontakte/videoplayer-shared/es2018"),G=require("@vkontakte/videoplayer-core/es2018");var nd=require("@vkontakte/videoplayer-shared/es2018");var ot=(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))(ot||{});var ie="__VERSION__",od="CIOPGQJGDIHBABABA",go={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 Ay={apiKey:od,apiEnv:"vk_alias",requestRetryCount:1,firstFlushTime:5e3,flushDebounceTime:1e4,flushMaxWait:6e4,storageExpiration:36*60*60*1e3,watchCoverageHeartbeatInterval:15,synchronizeTime:!0,useBeacon:!1,alwaysSendDesktop:!1},ad=r=>(0,nd.fillWithDefault)(r,Ay);var mo=R(Bi(),1),K=require("@vkontakte/videoplayer-shared/es2018");var nt=class{constructor(e){this.params=e,this.authorized$=new K.ValueSubject(!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:K.ErrorCategory.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:K.ErrorCategory.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,mo.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:${ie}`,platform:e[0].platform,product:e[0].product,events:e})}}authorizeWithBackoff(){if(!this.consequentAuthErrors)return this.doAuthorize();let e=(0,K.getExponentialDelay)(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:K.ErrorCategory.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:ie.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,mo.default)(this.params.apiTransport.sendRequest(e,t).then(i=>{var o;return(!i||!i.session_key)&&this.params.error$.next({id:"AuthorizeFailed",category:K.ErrorCategory.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:K.ErrorCategory.EXTERNAL_API,message:"authorize error",data:i}):this.params.error$.next({id:"AuthorizeUnknown",category:K.ErrorCategory.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 sd=R(Se(),1);var ud=R(Ce(),1),re=require("@vkontakte/videoplayer-shared/es2018");var at=class{constructor(e){this.params=e,this.apiKey=e.config.apiKey,this.apiEnv=e.config.apiEnv,this.apiBaseUrl=go[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:re.ErrorCategory.NETWORK,message:"Unhandled beacon error",thrown:s,data:{method:e,params:t}})}return!1}async sendRequest(e,t,i,o){let n=(0,re.now)(),s=u=>{if(u instanceof TypeError&&(0,sd.default)(["Failed to fetch","NetworkError when attempting to fetch resource."],u.message)){this.params.error$.next({id:"Network",category:re.ErrorCategory.NETWORK,message:"Request failed",thrown:u});return}this.params.error$.next({id:"ThinOneStat:ApiTransport:sendRequest",category:re.ErrorCategory.NETWORK,message:"Unhandled request error",thrown:u,data:{method:e,params:t,sessionKey:i,time:(0,re.now)()-n}})};return this.apiBaseUrl=await this.resolveApiBaseUrl(),Ne(`${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=(0,re.now)()-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 Ne(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:re.ErrorCategory.NETWORK,message:"Unhandled resolve api base url error",thrown:t}),go.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,ud.default)(e.queryParams).forEach(([i,o])=>t.append(i,typeof o=="string"?o:JSON.stringify(o))),t}};var cd=R(Se(),1),ld=R(Ce(),1),V=require("@vkontakte/videoplayer-shared/es2018"),st="thinonestat_events",bo=r=>e=>e.client_time+r>=(0,V.now)(),ut=class{constructor(e){this.unsaltedStorage=[];this.isPaused=!1;this.isUrgent=e=>{let{event_name:t}=e;return(0,cd.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=(0,V.debounceFn)(()=>this.safeFlush(),this.params.config.firstFlushTime,{maxWait:this.params.config.firstFlushTime});let t=V.safeStorage.isPersistent()?this.params.config.flushMaxWait:0;this.debouncedFlush=(0,V.debounceFn)(()=>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:V.ErrorCategory.WTF,message:String(e)||"Unknown logger error",thrown:e})}}readFromStorage(){let e=V.safeStorage.get(st);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(bo(this.params.config.storageExpiration));V.safeStorage.set(st,JSON.stringify({...t,[this.userSalt]:[...o,e]}))}getFromStorage(){var i;return this.userSalt?((i=this.readFromStorage()[this.userSalt])!=null?i:[]).filter(bo(this.params.config.storageExpiration)):this.unsaltedStorage}markStorageSent(){if(!this.userSalt){this.unsaltedStorage=[];return}let e=this.readFromStorage();delete e[this.userSalt],V.safeStorage.set(st,JSON.stringify(e))}housekeepStorage(){let e=this.readFromStorage();for(let[t,i]of(0,ld.default)(e)){let o=i.filter(bo(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`})}V.safeStorage.set(st,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 yo(){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 ct=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 Io=require("@vkontakte/videoplayer-core/es2018"),P=require("@vkontakte/videoplayer-shared/es2018"),dd=(r,e)=>new P.Observable(t=>{let i=new P.Subscription,o=new P.ValueSubject(void 0),n;i.add(r.info.isLive$.pipe((0,P.filterChanged)()).subscribe(x=>{n&&(n.unsubscribe(),o.next(void 0)),x?n=r.info.liveTime$.pipe((0,P.filterChanged)()).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((0,P.filter)(()=>r.info.playbackState$.getValue()===Io.PlaybackState.PLAYING)),h=r.events.seeked$.pipe((0,P.filter)(()=>r.info.playbackState$.getValue()===Io.PlaybackState.PLAYING)),c=!1,p=new P.Subject;i.add(f.subscribe(()=>{c||p.next(),c=!0})).add(h.subscribe(()=>c=!1));let g=(0,P.merge)((0,P.fromEvent)(window,"beforeunload"),r.events.willDestruct$),m,S=()=>m=o.getValue(),I=()=>{let x=o.getValue();(0,P.isNullable)(m)||(0,P.isNullable)(x)||m===x||(t.next({from:m,to:x}),m=void 0)},_=new P.Subject,q=new P.Subject,F=(0,P.merge)(s,p,_),w=(0,P.merge)(u,h,g,d,l,q);if(i.add(F.subscribe(S)).add(w.subscribe(I)),e.heartbeatInterval&&isFinite(e.heartbeatInterval)){let x=[],sr=e.heartbeatInterval*1e3,ur=()=>{q.next(),_.next()};i.add(F.subscribe(()=>{let ft=window.setTimeout(ur,sr);x.push(ft)})).add(w.subscribe(()=>{x.forEach(ft=>{window.clearTimeout(ft)}),x=[]}))}return i});var fd=require("@vkontakte/videoplayer-core/es2018"),pd=require("@vkontakte/videoplayer-shared/es2018"),hd=(r,e)=>new pd.Observable(t=>{let i=new fd.Subscription,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});var he=require("@vkontakte/videoplayer-shared/es2018"),vd=r=>new he.Observable(e=>{let t=new he.Subscription,i=0,o=1,n=0,s=!1,u=!1,d=()=>{if(!s)return;let w=Date.now();n+=(w-i)*o,i=w},l=()=>{(!s||u)&&(i=Date.now(),s=!0,u=!1)},f=()=>{s&&(d(),s=!1)},h=()=>{s&&(d(),s=!1,u=!0)},c=w=>{s&&d(),o=w,i=Date.now()},{started$:p,playing$:g,paused$:m,willSeek$:S,ended$:I,willDestruct$:_}=r.events,{currentPlaybackRate$:q}=r.info;t.add(S.subscribe(h)).add((0,he.merge)(p,g).subscribe(l)).add((0,he.merge)(m,I,_).subscribe(f)).add(q.subscribe(c));let F=()=>{let w=n;return s&&(w+=(Date.now()-i)*o),Math.floor(w/1e3)};return e.next(F),t});var So=require("@vkontakte/videoplayer-shared/es2018"),y=require("@vkontakte/videoplayer-core/es2018");var _o=r=>{if(r!==void 0)switch(r){case y.VideoFormat.MPEG:return"MP4";case y.VideoFormat.DASH:case y.VideoFormat.DASH_LIVE:return"DASH";case y.VideoFormat.DASH_SEP:return"DASH_SEP";case y.VideoFormat.DASH_ONDEMAND:return"ONDEMAND_DASH";case y.VideoFormat.HLS_ONDEMAND:return"ONDEMAND_HLS";case y.VideoFormat.HLS:case y.VideoFormat.HLS_LIVE:return"HLS";case y.VideoFormat.DASH_WEBM:case y.VideoFormat.DASH_LIVE_WEBM:return"WEBM";case y.VideoFormat.DASH_LIVE_CMAF:return"ONDEMAND_DASH_LIVE";case y.VideoFormat.HLS_LIVE_CMAF:return"ONDEMAND_HLS_LIVE";case y.VideoFormat.WEB_RTC_LIVE:return"WEBRTC";case y.VideoFormat.DASH_WEBM_AV1:return"AV1";case y.VideoFormat.DASH_STREAMS:return"MULTI_DASH";default:return(0,So.assertNever)(r)}},oe=r=>{if(r!==void 0)switch(r){case y.VideoQuality.Q_144P:return"144p";case y.VideoQuality.Q_240P:return"240p";case y.VideoQuality.Q_360P:return"360p";case y.VideoQuality.Q_480P:return"480p";case y.VideoQuality.Q_720P:return"720p";case y.VideoQuality.Q_1080P:return"1080p";case y.VideoQuality.Q_1440P:return"1440p";case y.VideoQuality.Q_2160P:return"2160p";case y.VideoQuality.INVARIANT:case y.VideoQuality.Q_576P:case y.VideoQuality.Q_4320P:return"UNKNOWN";default:return(0,So.assertNever)(r)}},gd=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}},md=(r,e,t)=>{var i;if(r&&e)switch(r){case y.VideoFormat.MPEG:return t&&e[r]&&e[r][t];default:return(i=e[r])==null?void 0:i.url}},bd=r=>{if(r!==void 0)switch(r){case y.Surface.NONE:return;case y.Surface.INLINE:return"inline";case y.Surface.FULLSCREEN:return"fullscreen";case y.Surface.SECOND_SCREEN:return"chromecast";case y.Surface.PIP:return"pip_external"}},yd=r=>{if(r!==void 0)return r===y.Surface.INVISIBLE?"background":"foreground"};var Eo=R(lo(),1),Id=()=>(0,Eo.default)(Math.floor(Math.random()*2**32).toString(36),13,"0"),Sd=()=>(0,Eo.default)(Math.floor(Math.random()*2**64).toString(36),13,"0");var qy="_thin-one-stat_",_d=`${qy}deviceId`,xy=()=>{let r=new T.Subscription;return{subscription:r,subscribe:(e,t)=>{e&&r.add(e.subscribe(t))}}},lt=class{constructor(e,t){this.debugLogger=new T.Logger;this.thinOneStatDebugLog=this.debugLogger.createComponentLog("ThinOneStat");this.eventNumber=1;this.seekAction$=new T.ValueSubject("unknown");this.playerSize$=new T.ValueSubject({width:0,height:0});this.vsid$=new T.ValueSubject(void 0);this.isid$=new T.ValueSubject(void 0);var d,l;this.statContext=e,this.config=ad((d=t.config)!=null?d:{}),this.subscription=new T.Subscription,this.config.synchronizeTime&&(this.timeSynchronisation=new ct);let i=new T.Subject,o=T.safeStorage.get(_d);this.statContext.deviceId?this.deviceId=this.statContext.deviceId:o?this.deviceId=o:(this.deviceId=yo(),T.safeStorage.set(_d,this.deviceId)),this.resetViewSession(),t.useIsid&&this.isid$.next((l=t.isid)!=null?l:Sd());let n=new at({error$:i,config:this.config,timeSynchronisation:this.timeSynchronisation});this.api=new nt({config:this.config,apiTransport:n,error$:i,deviceId:this.deviceId,refreshAuthToken:t.refreshAuthToken}),this.logger=new ut({config:this.config,debugLogger:this.debugLogger,api:this.api,error$:i,userSalt:t.userSalt});let{isEmbed:s,topOrigin:u}=(0,T.detectEmbed)();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 T.Subscription,i=(n,s)=>t.add(n.subscribe(s));i(vd(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(dd(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:_o(e.info.currentFormat$.getValue()),playback_quality:oe(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(hd(e,{getTotalViewTime:this.getTotalViewTime}),n=>{this.logWatchedN(n)}),i((0,T.merge)(e.events.willStart$,e.events.looped$),n=>{var u;n&&this.resetViewSession();let s={isid:this.isid$.getValue(),stream_profile:gd(_o(e.info.currentFormat$.getValue())),dpi:G.clientChecker.display.pixelRatio,web_layout:G.clientChecker.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:md(n,s,d),playback_quality:oe(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===G.PlaybackState.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(),g=e.info.availableTextTracks$.getValue(),m=e.info.currentTextTrack$.getValue(),S=e.info.currentAudioStream$.getValue(),I=e.info.currentPlaybackRate$.getValue(),_={playback_quality:oe(l),user_quality:f?"auto":oe(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:bd(p),visibility:yd(p),subtitles_enabled:!!m,auto_subtitles:!!((s=g.find(({id:q})=>q===m))!=null&&s.isAuto),audio_track_lang:S==null?void 0:S.language,playback_rate:I,recom_info:this.statContext.recomInfo};this.logPlaybackStarted(_)}}else n===G.PlaybackState.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((0,T.merge)(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":oe(n),playback_quality:oe(n),download_quality:oe(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}=xy();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(Id()),this.eventNumber=0}destroy(){this.api.destroy()}createRequiredParams(e){let t=this.vsid$.getValue();(0,T.assertNonNullable)(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:${ie}`,platform:`web:${G.clientChecker.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:ie,browser:G.clientChecker.browser.current,browser_version:String(G.clientChecker.browser.currentVersion),os:G.clientChecker.device.current,os_version:"",device_type:G.clientChecker.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=(0,T.fromEvent)(window,"beforeunload").subscribe(()=>{}),this.subscription.add(this.beforeunloadSubscription)}};