@vkontakte/videoplayer-statistics 1.0.89 → 1.0.90

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