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