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