@vkontakte/videoplayer-statistics 1.0.81-dev.faa4933c.0 → 1.0.82-beta.0

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