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