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