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