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