Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

libpgs

Package Overview
Dependencies
Maintainers
0
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

libpgs - npm Package Compare versions

Comparing version 0.6.0 to 0.7.0

2

dist/libpgs.js

@@ -1,1 +0,1 @@

var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},e=function(t){return t&&t.Math===Math&&t},r=e("object"==typeof globalThis&&globalThis)||e("object"==typeof window&&window)||e("object"==typeof self&&self)||e("object"==typeof t&&t)||e("object"==typeof t&&t)||function(){return this}()||Function("return this")(),n={},o=function(t){try{return!!t()}catch(t){return!0}},i=!o((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})),a=!o((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})),s=a,u=Function.prototype.call,c=s?u.bind(u):function(){return u.apply(u,arguments)},f={},h={}.propertyIsEnumerable,p=Object.getOwnPropertyDescriptor,d=p&&!h.call({1:2},1);f.f=d?function(t){var e=p(this,t);return!!e&&e.enumerable}:h;var l,y,v=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},m=a,b=Function.prototype,g=b.call,w=m&&b.bind.bind(g,g),T=m?w:function(t){return function(){return g.apply(t,arguments)}},O=T,S=O({}.toString),P=O("".slice),E=function(t){return P(S(t),8,-1)},j=o,A=E,I=Object,U=T("".split),x=j((function(){return!I("z").propertyIsEnumerable(0)}))?function(t){return"String"===A(t)?U(t,""):I(t)}:I,R=function(t){return null==t},D=R,C=TypeError,B=function(t){if(D(t))throw new C("Can't call method on "+t);return t},k=x,_=B,F=function(t){return k(_(t))},L="object"==typeof document&&document.all,N=void 0===L&&void 0!==L?function(t){return"function"==typeof t||t===L}:function(t){return"function"==typeof t},M=N,$=function(t){return"object"==typeof t?null!==t:M(t)},q=r,W=N,H=function(t,e){return arguments.length<2?(r=q[t],W(r)?r:void 0):q[t]&&q[t][e];var r},G=T({}.isPrototypeOf),V=r.navigator,z=V&&V.userAgent,X=z?String(z):"",J=r,Y=X,K=J.process,Z=J.Deno,Q=K&&K.versions||Z&&Z.version,tt=Q&&Q.v8;tt&&(y=(l=tt.split("."))[0]>0&&l[0]<4?1:+(l[0]+l[1])),!y&&Y&&(!(l=Y.match(/Edge\/(\d+)/))||l[1]>=74)&&(l=Y.match(/Chrome\/(\d+)/))&&(y=+l[1]);var et=y,rt=et,nt=o,ot=r.String,it=!!Object.getOwnPropertySymbols&&!nt((function(){var t=Symbol("symbol detection");return!ot(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&rt&&rt<41})),at=it&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,st=H,ut=N,ct=G,ft=Object,ht=at?function(t){return"symbol"==typeof t}:function(t){var e=st("Symbol");return ut(e)&&ct(e.prototype,ft(t))},pt=String,dt=function(t){try{return pt(t)}catch(t){return"Object"}},lt=N,yt=dt,vt=TypeError,mt=function(t){if(lt(t))return t;throw new vt(yt(t)+" is not a function")},bt=mt,gt=R,wt=function(t,e){var r=t[e];return gt(r)?void 0:bt(r)},Tt=c,Ot=N,St=$,Pt=TypeError,Et={exports:{}},jt=r,At=Object.defineProperty,It=function(t,e){try{At(jt,t,{value:e,configurable:!0,writable:!0})}catch(r){jt[t]=e}return e},Ut=r,xt=It,Rt="__core-js_shared__",Dt=Et.exports=Ut[Rt]||xt(Rt,{});(Dt.versions||(Dt.versions=[])).push({version:"3.38.1",mode:"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.38.1/LICENSE",source:"https://github.com/zloirock/core-js"});var Ct=Et.exports,Bt=Ct,kt=function(t,e){return Bt[t]||(Bt[t]=e||{})},_t=B,Ft=Object,Lt=function(t){return Ft(_t(t))},Nt=Lt,Mt=T({}.hasOwnProperty),$t=Object.hasOwn||function(t,e){return Mt(Nt(t),e)},qt=T,Wt=0,Ht=Math.random(),Gt=qt(1..toString),Vt=function(t){return"Symbol("+(void 0===t?"":t)+")_"+Gt(++Wt+Ht,36)},zt=kt,Xt=$t,Jt=Vt,Yt=it,Kt=at,Zt=r.Symbol,Qt=zt("wks"),te=Kt?Zt.for||Zt:Zt&&Zt.withoutSetter||Jt,ee=function(t){return Xt(Qt,t)||(Qt[t]=Yt&&Xt(Zt,t)?Zt[t]:te("Symbol."+t)),Qt[t]},re=c,ne=$,oe=ht,ie=wt,ae=function(t,e){var r,n;if("string"===e&&Ot(r=t.toString)&&!St(n=Tt(r,t)))return n;if(Ot(r=t.valueOf)&&!St(n=Tt(r,t)))return n;if("string"!==e&&Ot(r=t.toString)&&!St(n=Tt(r,t)))return n;throw new Pt("Can't convert object to primitive value")},se=TypeError,ue=ee("toPrimitive"),ce=function(t,e){if(!ne(t)||oe(t))return t;var r,n=ie(t,ue);if(n){if(void 0===e&&(e="default"),r=re(n,t,e),!ne(r)||oe(r))return r;throw new se("Can't convert object to primitive value")}return void 0===e&&(e="number"),ae(t,e)},fe=ht,he=function(t){var e=ce(t,"string");return fe(e)?e:e+""},pe=$,de=r.document,le=pe(de)&&pe(de.createElement),ye=function(t){return le?de.createElement(t):{}},ve=ye,me=!i&&!o((function(){return 7!==Object.defineProperty(ve("div"),"a",{get:function(){return 7}}).a})),be=i,ge=c,we=f,Te=v,Oe=F,Se=he,Pe=$t,Ee=me,je=Object.getOwnPropertyDescriptor;n.f=be?je:function(t,e){if(t=Oe(t),e=Se(e),Ee)try{return je(t,e)}catch(t){}if(Pe(t,e))return Te(!ge(we.f,t,e),t[e])};var Ae={},Ie=i&&o((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),Ue=$,xe=String,Re=TypeError,De=function(t){if(Ue(t))return t;throw new Re(xe(t)+" is not an object")},Ce=i,Be=me,ke=Ie,_e=De,Fe=he,Le=TypeError,Ne=Object.defineProperty,Me=Object.getOwnPropertyDescriptor,$e="enumerable",qe="configurable",We="writable";Ae.f=Ce?ke?function(t,e,r){if(_e(t),e=Fe(e),_e(r),"function"==typeof t&&"prototype"===e&&"value"in r&&We in r&&!r[We]){var n=Me(t,e);n&&n[We]&&(t[e]=r.value,r={configurable:qe in r?r[qe]:n[qe],enumerable:$e in r?r[$e]:n[$e],writable:!1})}return Ne(t,e,r)}:Ne:function(t,e,r){if(_e(t),e=Fe(e),_e(r),Be)try{return Ne(t,e,r)}catch(t){}if("get"in r||"set"in r)throw new Le("Accessors not supported");return"value"in r&&(t[e]=r.value),t};var He=Ae,Ge=v,Ve=i?function(t,e,r){return He.f(t,e,Ge(1,r))}:function(t,e,r){return t[e]=r,t},ze={exports:{}},Xe=i,Je=$t,Ye=Function.prototype,Ke=Xe&&Object.getOwnPropertyDescriptor,Ze=Je(Ye,"name"),Qe={EXISTS:Ze,PROPER:Ze&&"something"===function(){}.name,CONFIGURABLE:Ze&&(!Xe||Xe&&Ke(Ye,"name").configurable)},tr=N,er=Ct,rr=T(Function.toString);tr(er.inspectSource)||(er.inspectSource=function(t){return rr(t)});var nr,or,ir,ar=er.inspectSource,sr=N,ur=r.WeakMap,cr=sr(ur)&&/native code/.test(String(ur)),fr=Vt,hr=kt("keys"),pr=function(t){return hr[t]||(hr[t]=fr(t))},dr={},lr=cr,yr=r,vr=$,mr=Ve,br=$t,gr=Ct,wr=pr,Tr=dr,Or="Object already initialized",Sr=yr.TypeError,Pr=yr.WeakMap;if(lr||gr.state){var Er=gr.state||(gr.state=new Pr);Er.get=Er.get,Er.has=Er.has,Er.set=Er.set,nr=function(t,e){if(Er.has(t))throw new Sr(Or);return e.facade=t,Er.set(t,e),e},or=function(t){return Er.get(t)||{}},ir=function(t){return Er.has(t)}}else{var jr=wr("state");Tr[jr]=!0,nr=function(t,e){if(br(t,jr))throw new Sr(Or);return e.facade=t,mr(t,jr,e),e},or=function(t){return br(t,jr)?t[jr]:{}},ir=function(t){return br(t,jr)}}var Ar={set:nr,get:or,has:ir,enforce:function(t){return ir(t)?or(t):nr(t,{})},getterFor:function(t){return function(e){var r;if(!vr(e)||(r=or(e)).type!==t)throw new Sr("Incompatible receiver, "+t+" required");return r}}},Ir=T,Ur=o,xr=N,Rr=$t,Dr=i,Cr=Qe.CONFIGURABLE,Br=ar,kr=Ar.enforce,_r=Ar.get,Fr=String,Lr=Object.defineProperty,Nr=Ir("".slice),Mr=Ir("".replace),$r=Ir([].join),qr=Dr&&!Ur((function(){return 8!==Lr((function(){}),"length",{value:8}).length})),Wr=String(String).split("String"),Hr=ze.exports=function(t,e,r){"Symbol("===Nr(Fr(e),0,7)&&(e="["+Mr(Fr(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(e="get "+e),r&&r.setter&&(e="set "+e),(!Rr(t,"name")||Cr&&t.name!==e)&&(Dr?Lr(t,"name",{value:e,configurable:!0}):t.name=e),qr&&r&&Rr(r,"arity")&&t.length!==r.arity&&Lr(t,"length",{value:r.arity});try{r&&Rr(r,"constructor")&&r.constructor?Dr&&Lr(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var n=kr(t);return Rr(n,"source")||(n.source=$r(Wr,"string"==typeof e?e:"")),t};Function.prototype.toString=Hr((function(){return xr(this)&&_r(this).source||Br(this)}),"toString");var Gr=ze.exports,Vr=N,zr=Ae,Xr=Gr,Jr=It,Yr=function(t,e,r,n){n||(n={});var o=n.enumerable,i=void 0!==n.name?n.name:e;if(Vr(r)&&Xr(r,i,n),n.global)o?t[e]=r:Jr(e,r);else{try{n.unsafe?t[e]&&(o=!0):delete t[e]}catch(t){}o?t[e]=r:zr.f(t,e,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return t},Kr={},Zr=Math.ceil,Qr=Math.floor,tn=Math.trunc||function(t){var e=+t;return(e>0?Qr:Zr)(e)},en=function(t){var e=+t;return e!=e||0===e?0:tn(e)},rn=en,nn=Math.max,on=Math.min,an=en,sn=Math.min,un=function(t){var e=an(t);return e>0?sn(e,9007199254740991):0},cn=function(t){return un(t.length)},fn=F,hn=function(t,e){var r=rn(t);return r<0?nn(r+e,0):on(r,e)},pn=cn,dn=function(t){return function(e,r,n){var o=fn(e),i=pn(o);if(0===i)return!t&&-1;var a,s=hn(n,i);if(t&&r!=r){for(;i>s;)if((a=o[s++])!=a)return!0}else for(;i>s;s++)if((t||s in o)&&o[s]===r)return t||s||0;return!t&&-1}},ln={includes:dn(!0),indexOf:dn(!1)},yn=$t,vn=F,mn=ln.indexOf,bn=dr,gn=T([].push),wn=function(t,e){var r,n=vn(t),o=0,i=[];for(r in n)!yn(bn,r)&&yn(n,r)&&gn(i,r);for(;e.length>o;)yn(n,r=e[o++])&&(~mn(i,r)||gn(i,r));return i},Tn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],On=wn,Sn=Tn.concat("length","prototype");Kr.f=Object.getOwnPropertyNames||function(t){return On(t,Sn)};var Pn={};Pn.f=Object.getOwnPropertySymbols;var En=H,jn=Kr,An=Pn,In=De,Un=T([].concat),xn=En("Reflect","ownKeys")||function(t){var e=jn.f(In(t)),r=An.f;return r?Un(e,r(t)):e},Rn=$t,Dn=xn,Cn=n,Bn=Ae,kn=function(t,e,r){for(var n=Dn(e),o=Bn.f,i=Cn.f,a=0;a<n.length;a++){var s=n[a];Rn(t,s)||r&&Rn(r,s)||o(t,s,i(e,s))}},_n=o,Fn=N,Ln=/#|\.prototype\./,Nn=function(t,e){var r=$n[Mn(t)];return r===Wn||r!==qn&&(Fn(e)?_n(e):!!e)},Mn=Nn.normalize=function(t){return String(t).replace(Ln,".").toLowerCase()},$n=Nn.data={},qn=Nn.NATIVE="N",Wn=Nn.POLYFILL="P",Hn=Nn,Gn=r,Vn=n.f,zn=Ve,Xn=Yr,Jn=It,Yn=kn,Kn=Hn,Zn=function(t,e){var r,n,o,i,a,s=t.target,u=t.global,c=t.stat;if(r=u?Gn:c?Gn[s]||Jn(s,{}):Gn[s]&&Gn[s].prototype)for(n in e){if(i=e[n],o=t.dontCallGetSet?(a=Vn(r,n))&&a.value:r[n],!Kn(u?n:s+(c?".":"#")+n,t.forced)&&void 0!==o){if(typeof i==typeof o)continue;Yn(i,o)}(t.sham||o&&o.sham)&&zn(i,"sham",!0),Xn(r,n,i,t)}},Qn=!o((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})),to=$t,eo=N,ro=Lt,no=Qn,oo=pr("IE_PROTO"),io=Object,ao=io.prototype,so=no?io.getPrototypeOf:function(t){var e=ro(t);if(to(e,oo))return e[oo];var r=e.constructor;return eo(r)&&e instanceof r?r.prototype:e instanceof io?ao:null},uo=T,co=mt,fo=$,ho=function(t){return fo(t)||null===t},po=String,lo=TypeError,yo=function(t,e,r){try{return uo(co(Object.getOwnPropertyDescriptor(t,e)[r]))}catch(t){}},vo=$,mo=B,bo=function(t){if(ho(t))return t;throw new lo("Can't set "+po(t)+" as a prototype")},go=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,r={};try{(t=yo(Object.prototype,"__proto__","set"))(r,[]),e=r instanceof Array}catch(t){}return function(r,n){return mo(r),bo(n),vo(r)?(e?t(r,n):r.__proto__=n,r):r}}():void 0),wo={},To=wn,Oo=Tn,So=Object.keys||function(t){return To(t,Oo)},Po=i,Eo=Ie,jo=Ae,Ao=De,Io=F,Uo=So;wo.f=Po&&!Eo?Object.defineProperties:function(t,e){Ao(t);for(var r,n=Io(e),o=Uo(e),i=o.length,a=0;i>a;)jo.f(t,r=o[a++],n[r]);return t};var xo,Ro=H("document","documentElement"),Do=De,Co=wo,Bo=Tn,ko=dr,_o=Ro,Fo=ye,Lo="prototype",No="script",Mo=pr("IE_PROTO"),$o=function(){},qo=function(t){return"<"+No+">"+t+"</"+No+">"},Wo=function(t){t.write(qo("")),t.close();var e=t.parentWindow.Object;return t=null,e},Ho=function(){try{xo=new ActiveXObject("htmlfile")}catch(t){}var t,e,r;Ho="undefined"!=typeof document?document.domain&&xo?Wo(xo):(e=Fo("iframe"),r="java"+No+":",e.style.display="none",_o.appendChild(e),e.src=String(r),(t=e.contentWindow.document).open(),t.write(qo("document.F=Object")),t.close(),t.F):Wo(xo);for(var n=Bo.length;n--;)delete Ho[Lo][Bo[n]];return Ho()};ko[Mo]=!0;var Go=Object.create||function(t,e){var r;return null!==t?($o[Lo]=Do(t),r=new $o,$o[Lo]=null,r[Mo]=t):r=Ho(),void 0===e?r:Co.f(r,e)},Vo=$,zo=Ve,Xo=Error,Jo=T("".replace),Yo=String(new Xo("zxcasd").stack),Ko=/\n\s*at [^:]*:[^\n]*/,Zo=Ko.test(Yo),Qo=v,ti=!o((function(){var t=new Error("a");return!("stack"in t)||(Object.defineProperty(t,"stack",Qo(1,7)),7!==t.stack)})),ei=Ve,ri=function(t,e){if(Zo&&"string"==typeof t&&!Xo.prepareStackTrace)for(;e--;)t=Jo(t,Ko,"");return t},ni=ti,oi=Error.captureStackTrace,ii=E,ai=T,si=function(t){if("Function"===ii(t))return ai(t)},ui=mt,ci=a,fi=si(si.bind),hi=function(t,e){return ui(t),void 0===e?t:ci?fi(t,e):function(){return t.apply(e,arguments)}},pi={},di=pi,li=ee("iterator"),yi=Array.prototype,vi={};vi[ee("toStringTag")]="z";var mi="[object z]"===String(vi),bi=mi,gi=N,wi=E,Ti=ee("toStringTag"),Oi=Object,Si="Arguments"===wi(function(){return arguments}()),Pi=bi?wi:function(t){var e,r,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(e=Oi(t),Ti))?r:Si?wi(e):"Object"===(n=wi(e))&&gi(e.callee)?"Arguments":n},Ei=Pi,ji=wt,Ai=R,Ii=pi,Ui=ee("iterator"),xi=function(t){if(!Ai(t))return ji(t,Ui)||ji(t,"@@iterator")||Ii[Ei(t)]},Ri=c,Di=mt,Ci=De,Bi=dt,ki=xi,_i=TypeError,Fi=c,Li=De,Ni=wt,Mi=hi,$i=c,qi=De,Wi=dt,Hi=function(t){return void 0!==t&&(di.Array===t||yi[li]===t)},Gi=cn,Vi=G,zi=function(t,e){var r=arguments.length<2?ki(t):e;if(Di(r))return Ci(Ri(r,t));throw new _i(Bi(t)+" is not iterable")},Xi=xi,Ji=function(t,e,r){var n,o;Li(t);try{if(!(n=Ni(t,"return"))){if("throw"===e)throw r;return r}n=Fi(n,t)}catch(t){o=!0,n=t}if("throw"===e)throw r;if(o)throw n;return Li(n),r},Yi=TypeError,Ki=function(t,e){this.stopped=t,this.result=e},Zi=Ki.prototype,Qi=function(t,e,r){var n,o,i,a,s,u,c,f=r&&r.that,h=!(!r||!r.AS_ENTRIES),p=!(!r||!r.IS_RECORD),d=!(!r||!r.IS_ITERATOR),l=!(!r||!r.INTERRUPTED),y=Mi(e,f),v=function(t){return n&&Ji(n,"normal",t),new Ki(!0,t)},m=function(t){return h?(qi(t),l?y(t[0],t[1],v):y(t[0],t[1])):l?y(t,v):y(t)};if(p)n=t.iterator;else if(d)n=t;else{if(!(o=Xi(t)))throw new Yi(Wi(t)+" is not iterable");if(Hi(o)){for(i=0,a=Gi(t);a>i;i++)if((s=m(t[i]))&&Vi(Zi,s))return s;return new Ki(!1)}n=zi(t,o)}for(u=p?t.next:n.next;!(c=$i(u,n)).done;){try{s=m(c.value)}catch(t){Ji(n,"throw",t)}if("object"==typeof s&&s&&Vi(Zi,s))return s}return new Ki(!1)},ta=Pi,ea=String,ra=function(t){if("Symbol"===ta(t))throw new TypeError("Cannot convert a Symbol value to a string");return ea(t)},na=ra,oa=Zn,ia=G,aa=so,sa=go,ua=kn,ca=Go,fa=Ve,ha=v,pa=function(t,e){Vo(e)&&"cause"in e&&zo(t,"cause",e.cause)},da=function(t,e,r,n){ni&&(oi?oi(t,e):ei(t,"stack",ri(r,n)))},la=Qi,ya=function(t,e){return void 0===t?arguments.length<2?"":e:na(t)},va=ee("toStringTag"),ma=Error,ba=[].push,ga=function(t,e){var r,n=ia(wa,this);sa?r=sa(new ma,n?aa(this):wa):(r=n?this:ca(wa),fa(r,va,"Error")),void 0!==e&&fa(r,"message",ya(e)),da(r,ga,r.stack,1),arguments.length>2&&pa(r,arguments[2]);var o=[];return la(t,ba,{that:o}),fa(r,"errors",o),r};sa?sa(ga,ma):ua(ga,ma,{name:!0});var wa=ga.prototype=ca(ma.prototype,{constructor:ha(1,ga),message:ha(1,""),name:ha(1,"AggregateError")});oa({global:!0,constructor:!0,arity:2},{AggregateError:ga});var Ta=ee,Oa=Go,Sa=Ae.f,Pa=Ta("unscopables"),Ea=Array.prototype;void 0===Ea[Pa]&&Sa(Ea,Pa,{configurable:!0,value:Oa(null)});var ja,Aa,Ia,Ua=o,xa=N,Ra=$,Da=so,Ca=Yr,Ba=ee("iterator"),ka=!1;[].keys&&("next"in(Ia=[].keys())?(Aa=Da(Da(Ia)))!==Object.prototype&&(ja=Aa):ka=!0);var _a=!Ra(ja)||Ua((function(){var t={};return ja[Ba].call(t)!==t}));_a&&(ja={}),xa(ja[Ba])||Ca(ja,Ba,(function(){return this}));var Fa={IteratorPrototype:ja,BUGGY_SAFARI_ITERATORS:ka},La=Ae.f,Na=$t,Ma=ee("toStringTag"),$a=function(t,e,r){t&&!r&&(t=t.prototype),t&&!Na(t,Ma)&&La(t,Ma,{configurable:!0,value:e})},qa=Fa.IteratorPrototype,Wa=Go,Ha=v,Ga=$a,Va=pi,za=function(){return this},Xa=Zn,Ja=c,Ya=N,Ka=function(t,e,r,n){var o=e+" Iterator";return t.prototype=Wa(qa,{next:Ha(+!n,r)}),Ga(t,o,!1),Va[o]=za,t},Za=so,Qa=go,ts=$a,es=Ve,rs=Yr,ns=pi,os=Qe.PROPER,is=Qe.CONFIGURABLE,as=Fa.IteratorPrototype,ss=Fa.BUGGY_SAFARI_ITERATORS,us=ee("iterator"),cs="keys",fs="values",hs="entries",ps=function(){return this},ds=function(t,e,r,n,o,i,a){Ka(r,e,n);var s,u,c,f=function(t){if(t===o&&y)return y;if(!ss&&t&&t in d)return d[t];switch(t){case cs:case fs:case hs:return function(){return new r(this,t)}}return function(){return new r(this)}},h=e+" Iterator",p=!1,d=t.prototype,l=d[us]||d["@@iterator"]||o&&d[o],y=!ss&&l||f(o),v="Array"===e&&d.entries||l;if(v&&(s=Za(v.call(new t)))!==Object.prototype&&s.next&&(Za(s)!==as&&(Qa?Qa(s,as):Ya(s[us])||rs(s,us,ps)),ts(s,h,!0)),os&&o===fs&&l&&l.name!==fs&&(is?es(d,"name",fs):(p=!0,y=function(){return Ja(l,this)})),o)if(u={values:f(fs),keys:i?y:f(cs),entries:f(hs)},a)for(c in u)(ss||p||!(c in d))&&rs(d,c,u[c]);else Xa({target:e,proto:!0,forced:ss||p},u);return d[us]!==y&&rs(d,us,y,{name:o}),ns[e]=y,u},ls=function(t,e){return{value:t,done:e}},ys=F,vs=function(t){Ea[Pa][t]=!0},ms=pi,bs=Ar,gs=Ae.f,ws=ds,Ts=ls,Os=i,Ss="Array Iterator",Ps=bs.set,Es=bs.getterFor(Ss),js=ws(Array,"Array",(function(t,e){Ps(this,{type:Ss,target:ys(t),index:0,kind:e})}),(function(){var t=Es(this),e=t.target,r=t.index++;if(!e||r>=e.length)return t.target=null,Ts(void 0,!0);switch(t.kind){case"keys":return Ts(r,!1);case"values":return Ts(e[r],!1)}return Ts([r,e[r]],!1)}),"values"),As=ms.Arguments=ms.Array;if(vs("keys"),vs("values"),vs("entries"),Os&&"values"!==As.name)try{gs(As,"name",{value:"values"})}catch(t){}var Is=Pi,Us=mi?{}.toString:function(){return"[object "+Is(this)+"]"};mi||Yr(Object.prototype,"toString",Us,{unsafe:!0});var xs=r,Rs=X,Ds=E,Cs=function(t){return Rs.slice(0,t.length)===t},Bs=Cs("Bun/")?"BUN":Cs("Cloudflare-Workers")?"CLOUDFLARE":Cs("Deno/")?"DENO":Cs("Node.js/")?"NODE":xs.Bun&&"string"==typeof Bun.version?"BUN":xs.Deno&&"object"==typeof Deno.version?"DENO":"process"===Ds(xs.process)?"NODE":xs.window&&xs.document?"BROWSER":"REST",ks="NODE"===Bs,_s=Gr,Fs=Ae,Ls=H,Ns=function(t,e,r){return r.get&&_s(r.get,e,{getter:!0}),r.set&&_s(r.set,e,{setter:!0}),Fs.f(t,e,r)},Ms=i,$s=ee("species"),qs=G,Ws=TypeError,Hs=T,Gs=o,Vs=N,zs=Pi,Xs=ar,Js=function(){},Ys=H("Reflect","construct"),Ks=/^\s*(?:class|function)\b/,Zs=Hs(Ks.exec),Qs=!Ks.test(Js),tu=function(t){if(!Vs(t))return!1;try{return Ys(Js,[],t),!0}catch(t){return!1}},eu=function(t){if(!Vs(t))return!1;switch(zs(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Qs||!!Zs(Ks,Xs(t))}catch(t){return!0}};eu.sham=!0;var ru,nu,ou,iu,au=!Ys||Gs((function(){var t;return tu(tu.call)||!tu(Object)||!tu((function(){t=!0}))||t}))?eu:tu,su=au,uu=dt,cu=TypeError,fu=De,hu=function(t){if(su(t))return t;throw new cu(uu(t)+" is not a constructor")},pu=R,du=ee("species"),lu=function(t,e){var r,n=fu(t).constructor;return void 0===n||pu(r=fu(n)[du])?e:hu(r)},yu=a,vu=Function.prototype,mu=vu.apply,bu=vu.call,gu="object"==typeof Reflect&&Reflect.apply||(yu?bu.bind(mu):function(){return bu.apply(mu,arguments)}),wu=T([].slice),Tu=TypeError,Ou=/(?:ipad|iphone|ipod).*applewebkit/i.test(X),Su=r,Pu=gu,Eu=hi,ju=N,Au=$t,Iu=o,Uu=Ro,xu=wu,Ru=ye,Du=function(t,e){if(t<e)throw new Tu("Not enough arguments");return t},Cu=Ou,Bu=ks,ku=Su.setImmediate,_u=Su.clearImmediate,Fu=Su.process,Lu=Su.Dispatch,Nu=Su.Function,Mu=Su.MessageChannel,$u=Su.String,qu=0,Wu={},Hu="onreadystatechange";Iu((function(){ru=Su.location}));var Gu=function(t){if(Au(Wu,t)){var e=Wu[t];delete Wu[t],e()}},Vu=function(t){return function(){Gu(t)}},zu=function(t){Gu(t.data)},Xu=function(t){Su.postMessage($u(t),ru.protocol+"//"+ru.host)};ku&&_u||(ku=function(t){Du(arguments.length,1);var e=ju(t)?t:Nu(t),r=xu(arguments,1);return Wu[++qu]=function(){Pu(e,void 0,r)},nu(qu),qu},_u=function(t){delete Wu[t]},Bu?nu=function(t){Fu.nextTick(Vu(t))}:Lu&&Lu.now?nu=function(t){Lu.now(Vu(t))}:Mu&&!Cu?(iu=(ou=new Mu).port2,ou.port1.onmessage=zu,nu=Eu(iu.postMessage,iu)):Su.addEventListener&&ju(Su.postMessage)&&!Su.importScripts&&ru&&"file:"!==ru.protocol&&!Iu(Xu)?(nu=Xu,Su.addEventListener("message",zu,!1)):nu=Hu in Ru("script")?function(t){Uu.appendChild(Ru("script"))[Hu]=function(){Uu.removeChild(this),Gu(t)}}:function(t){setTimeout(Vu(t),0)});var Ju={set:ku,clear:_u},Yu=r,Ku=i,Zu=Object.getOwnPropertyDescriptor,Qu=function(){this.head=null,this.tail=null};Qu.prototype={add:function(t){var e={item:t,next:null},r=this.tail;r?r.next=e:this.head=e,this.tail=e},get:function(){var t=this.head;if(t)return null===(this.head=t.next)&&(this.tail=null),t.item}};var tc,ec,rc,nc,oc,ic=Qu,ac=/ipad|iphone|ipod/i.test(X)&&"undefined"!=typeof Pebble,sc=/web0s(?!.*chrome)/i.test(X),uc=r,cc=function(t){if(!Ku)return Yu[t];var e=Zu(Yu,t);return e&&e.value},fc=hi,hc=Ju.set,pc=ic,dc=Ou,lc=ac,yc=sc,vc=ks,mc=uc.MutationObserver||uc.WebKitMutationObserver,bc=uc.document,gc=uc.process,wc=uc.Promise,Tc=cc("queueMicrotask");if(!Tc){var Oc=new pc,Sc=function(){var t,e;for(vc&&(t=gc.domain)&&t.exit();e=Oc.get();)try{e()}catch(t){throw Oc.head&&tc(),t}t&&t.enter()};dc||vc||yc||!mc||!bc?!lc&&wc&&wc.resolve?((nc=wc.resolve(void 0)).constructor=wc,oc=fc(nc.then,nc),tc=function(){oc(Sc)}):vc?tc=function(){gc.nextTick(Sc)}:(hc=fc(hc,uc),tc=function(){hc(Sc)}):(ec=!0,rc=bc.createTextNode(""),new mc(Sc).observe(rc,{characterData:!0}),tc=function(){rc.data=ec=!ec}),Tc=function(t){Oc.head||tc(),Oc.add(t)}}var Pc=Tc,Ec=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}},jc=r.Promise,Ac=r,Ic=jc,Uc=N,xc=Hn,Rc=ar,Dc=ee,Cc=Bs,Bc=et;Ic&&Ic.prototype;var kc=Dc("species"),_c=!1,Fc=Uc(Ac.PromiseRejectionEvent),Lc=xc("Promise",(function(){var t=Rc(Ic),e=t!==String(Ic);if(!e&&66===Bc)return!0;if(!Bc||Bc<51||!/native code/.test(t)){var r=new Ic((function(t){t(1)})),n=function(t){t((function(){}),(function(){}))};if((r.constructor={})[kc]=n,!(_c=r.then((function(){}))instanceof n))return!0}return!(e||"BROWSER"!==Cc&&"DENO"!==Cc||Fc)})),Nc={CONSTRUCTOR:Lc,REJECTION_EVENT:Fc,SUBCLASSING:_c},Mc={},$c=mt,qc=TypeError,Wc=function(t){var e,r;this.promise=new t((function(t,n){if(void 0!==e||void 0!==r)throw new qc("Bad Promise constructor");e=t,r=n})),this.resolve=$c(e),this.reject=$c(r)};Mc.f=function(t){return new Wc(t)};var Hc,Gc,Vc,zc=Zn,Xc=ks,Jc=r,Yc=c,Kc=Yr,Zc=go,Qc=$a,tf=function(t){var e=Ls(t);Ms&&e&&!e[$s]&&Ns(e,$s,{configurable:!0,get:function(){return this}})},ef=mt,rf=N,nf=$,of=function(t,e){if(qs(e,t))return t;throw new Ws("Incorrect invocation")},af=lu,sf=Ju.set,uf=Pc,cf=function(t,e){try{1===arguments.length?console.error(t):console.error(t,e)}catch(t){}},ff=Ec,hf=ic,pf=Ar,df=jc,lf=Mc,yf="Promise",vf=Nc.CONSTRUCTOR,mf=Nc.REJECTION_EVENT,bf=Nc.SUBCLASSING,gf=pf.getterFor(yf),wf=pf.set,Tf=df&&df.prototype,Of=df,Sf=Tf,Pf=Jc.TypeError,Ef=Jc.document,jf=Jc.process,Af=lf.f,If=Af,Uf=!!(Ef&&Ef.createEvent&&Jc.dispatchEvent),xf="unhandledrejection",Rf=function(t){var e;return!(!nf(t)||!rf(e=t.then))&&e},Df=function(t,e){var r,n,o,i=e.value,a=1===e.state,s=a?t.ok:t.fail,u=t.resolve,c=t.reject,f=t.domain;try{s?(a||(2===e.rejection&&Ff(e),e.rejection=1),!0===s?r=i:(f&&f.enter(),r=s(i),f&&(f.exit(),o=!0)),r===t.promise?c(new Pf("Promise-chain cycle")):(n=Rf(r))?Yc(n,r,u,c):u(r)):c(i)}catch(t){f&&!o&&f.exit(),c(t)}},Cf=function(t,e){t.notified||(t.notified=!0,uf((function(){for(var r,n=t.reactions;r=n.get();)Df(r,t);t.notified=!1,e&&!t.rejection&&kf(t)})))},Bf=function(t,e,r){var n,o;Uf?((n=Ef.createEvent("Event")).promise=e,n.reason=r,n.initEvent(t,!1,!0),Jc.dispatchEvent(n)):n={promise:e,reason:r},!mf&&(o=Jc["on"+t])?o(n):t===xf&&cf("Unhandled promise rejection",r)},kf=function(t){Yc(sf,Jc,(function(){var e,r=t.facade,n=t.value;if(_f(t)&&(e=ff((function(){Xc?jf.emit("unhandledRejection",n,r):Bf(xf,r,n)})),t.rejection=Xc||_f(t)?2:1,e.error))throw e.value}))},_f=function(t){return 1!==t.rejection&&!t.parent},Ff=function(t){Yc(sf,Jc,(function(){var e=t.facade;Xc?jf.emit("rejectionHandled",e):Bf("rejectionhandled",e,t.value)}))},Lf=function(t,e,r){return function(n){t(e,n,r)}},Nf=function(t,e,r){t.done||(t.done=!0,r&&(t=r),t.value=e,t.state=2,Cf(t,!0))},Mf=function(t,e,r){if(!t.done){t.done=!0,r&&(t=r);try{if(t.facade===e)throw new Pf("Promise can't be resolved itself");var n=Rf(e);n?uf((function(){var r={done:!1};try{Yc(n,e,Lf(Mf,r,t),Lf(Nf,r,t))}catch(e){Nf(r,e,t)}})):(t.value=e,t.state=1,Cf(t,!1))}catch(e){Nf({done:!1},e,t)}}};if(vf&&(Sf=(Of=function(t){of(this,Sf),ef(t),Yc(Hc,this);var e=gf(this);try{t(Lf(Mf,e),Lf(Nf,e))}catch(t){Nf(e,t)}}).prototype,(Hc=function(t){wf(this,{type:yf,done:!1,notified:!1,parent:!1,reactions:new hf,rejection:!1,state:0,value:null})}).prototype=Kc(Sf,"then",(function(t,e){var r=gf(this),n=Af(af(this,Of));return r.parent=!0,n.ok=!rf(t)||t,n.fail=rf(e)&&e,n.domain=Xc?jf.domain:void 0,0===r.state?r.reactions.add(n):uf((function(){Df(n,r)})),n.promise})),Gc=function(){var t=new Hc,e=gf(t);this.promise=t,this.resolve=Lf(Mf,e),this.reject=Lf(Nf,e)},lf.f=Af=function(t){return t===Of||undefined===t?new Gc(t):If(t)},rf(df)&&Tf!==Object.prototype)){Vc=Tf.then,bf||Kc(Tf,"then",(function(t,e){var r=this;return new Of((function(t,e){Yc(Vc,r,t,e)})).then(t,e)}),{unsafe:!0});try{delete Tf.constructor}catch(t){}Zc&&Zc(Tf,Sf)}zc({global:!0,constructor:!0,wrap:!0,forced:vf},{Promise:Of}),Qc(Of,yf,!1),tf(yf);var $f=ee("iterator"),qf=!1;try{var Wf=0,Hf={next:function(){return{done:!!Wf++}},return:function(){qf=!0}};Hf[$f]=function(){return this},Array.from(Hf,(function(){throw 2}))}catch(t){}var Gf=jc,Vf=function(t,e){try{if(!e&&!qf)return!1}catch(t){return!1}var r=!1;try{var n={};n[$f]=function(){return{next:function(){return{done:r=!0}}}},t(n)}catch(t){}return r},zf=Nc.CONSTRUCTOR||!Vf((function(t){Gf.all(t).then(void 0,(function(){}))})),Xf=c,Jf=mt,Yf=Mc,Kf=Ec,Zf=Qi;Zn({target:"Promise",stat:!0,forced:zf},{all:function(t){var e=this,r=Yf.f(e),n=r.resolve,o=r.reject,i=Kf((function(){var r=Jf(e.resolve),i=[],a=0,s=1;Zf(t,(function(t){var u=a++,c=!1;s++,Xf(r,e,t).then((function(t){c||(c=!0,i[u]=t,--s||n(i))}),o)})),--s||n(i)}));return i.error&&o(i.value),r.promise}});var Qf=Zn,th=Nc.CONSTRUCTOR,eh=jc,rh=H,nh=N,oh=Yr,ih=eh&&eh.prototype;if(Qf({target:"Promise",proto:!0,forced:th,real:!0},{catch:function(t){return this.then(void 0,t)}}),nh(eh)){var ah=rh("Promise").prototype.catch;ih.catch!==ah&&oh(ih,"catch",ah,{unsafe:!0})}var sh=c,uh=mt,ch=Mc,fh=Ec,hh=Qi;Zn({target:"Promise",stat:!0,forced:zf},{race:function(t){var e=this,r=ch.f(e),n=r.reject,o=fh((function(){var o=uh(e.resolve);hh(t,(function(t){sh(o,e,t).then(r.resolve,n)}))}));return o.error&&n(o.value),r.promise}});var ph=Mc;Zn({target:"Promise",stat:!0,forced:Nc.CONSTRUCTOR},{reject:function(t){var e=ph.f(this);return(0,e.reject)(t),e.promise}});var dh=De,lh=$,yh=Mc,vh=function(t,e){if(dh(t),lh(e)&&e.constructor===t)return e;var r=yh.f(t);return(0,r.resolve)(e),r.promise},mh=Zn,bh=Nc.CONSTRUCTOR,gh=vh;H("Promise"),mh({target:"Promise",stat:!0,forced:bh},{resolve:function(t){return gh(this,t)}});var wh=c,Th=mt,Oh=Mc,Sh=Ec,Ph=Qi;Zn({target:"Promise",stat:!0,forced:zf},{allSettled:function(t){var e=this,r=Oh.f(e),n=r.resolve,o=r.reject,i=Sh((function(){var r=Th(e.resolve),o=[],i=0,a=1;Ph(t,(function(t){var s=i++,u=!1;a++,wh(r,e,t).then((function(t){u||(u=!0,o[s]={status:"fulfilled",value:t},--a||n(o))}),(function(t){u||(u=!0,o[s]={status:"rejected",reason:t},--a||n(o))}))})),--a||n(o)}));return i.error&&o(i.value),r.promise}});var Eh=c,jh=mt,Ah=H,Ih=Mc,Uh=Ec,xh=Qi,Rh="No one promise resolved";Zn({target:"Promise",stat:!0,forced:zf},{any:function(t){var e=this,r=Ah("AggregateError"),n=Ih.f(e),o=n.resolve,i=n.reject,a=Uh((function(){var n=jh(e.resolve),a=[],s=0,u=1,c=!1;xh(t,(function(t){var f=s++,h=!1;u++,Eh(n,e,t).then((function(t){h||c||(c=!0,o(t))}),(function(t){h||c||(h=!0,a[f]=t,--u||i(new r(a,Rh)))}))})),--u||i(new r(a,Rh))}));return a.error&&i(a.value),n.promise}});var Dh=Mc;Zn({target:"Promise",stat:!0},{withResolvers:function(){var t=Dh.f(this);return{promise:t.promise,resolve:t.resolve,reject:t.reject}}});var Ch=Zn,Bh=jc,kh=o,_h=H,Fh=N,Lh=lu,Nh=vh,Mh=Yr,$h=Bh&&Bh.prototype;if(Ch({target:"Promise",proto:!0,real:!0,forced:!!Bh&&kh((function(){$h.finally.call({then:function(){}},(function(){}))}))},{finally:function(t){var e=Lh(this,_h("Promise")),r=Fh(t);return this.then(r?function(r){return Nh(e,t()).then((function(){return r}))}:t,r?function(r){return Nh(e,t()).then((function(){throw r}))}:t)}}),Fh(Bh)){var qh=_h("Promise").prototype.finally;$h.finally!==qh&&Mh($h,"finally",qh,{unsafe:!0})}var Wh=T,Hh=en,Gh=ra,Vh=B,zh=Wh("".charAt),Xh=Wh("".charCodeAt),Jh=Wh("".slice),Yh=function(t){return function(e,r){var n,o,i=Gh(Vh(e)),a=Hh(r),s=i.length;return a<0||a>=s?t?"":void 0:(n=Xh(i,a))<55296||n>56319||a+1===s||(o=Xh(i,a+1))<56320||o>57343?t?zh(i,a):n:t?Jh(i,a,a+2):o-56320+(n-55296<<10)+65536}},Kh={codeAt:Yh(!1),charAt:Yh(!0)}.charAt,Zh=ra,Qh=Ar,tp=ds,ep=ls,rp="String Iterator",np=Qh.set,op=Qh.getterFor(rp);tp(String,"String",(function(t){np(this,{type:rp,string:Zh(t),index:0})}),(function(){var t,e=op(this),r=e.string,n=e.index;return n>=r.length?ep(void 0,!0):(t=Kh(r,n),e.index+=t.length,ep(t,!1))})),r.Promise;var ip=ye("span").classList,ap=ip&&ip.constructor&&ip.constructor.prototype,sp=ap===Object.prototype?void 0:ap,up=r,cp={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},fp=sp,hp=js,pp=Ve,dp=$a,lp=ee("iterator"),yp=hp.values,vp=function(t,e){if(t){if(t[lp]!==yp)try{pp(t,lp,yp)}catch(e){t[lp]=yp}if(dp(t,e,!0),cp[e])for(var r in hp)if(t[r]!==hp[r])try{pp(t,r,hp[r])}catch(e){t[r]=hp[r]}}};for(var mp in cp)vp(up[mp]&&up[mp].prototype,mp);vp(fp,"DOMTokenList");var bp="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||"undefined"!=typeof global&&global||{},gp="URLSearchParams"in bp,wp="Symbol"in bp&&"iterator"in Symbol,Tp="FileReader"in bp&&"Blob"in bp&&function(){try{return new Blob,!0}catch(t){return!1}}(),Op="FormData"in bp,Sp="ArrayBuffer"in bp;if(Sp)var Pp=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],Ep=ArrayBuffer.isView||function(t){return t&&Pp.indexOf(Object.prototype.toString.call(t))>-1};function jp(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(t)||""===t)throw new TypeError('Invalid character in header field name: "'+t+'"');return t.toLowerCase()}function Ap(t){return"string"!=typeof t&&(t=String(t)),t}function Ip(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return wp&&(e[Symbol.iterator]=function(){return e}),e}function Up(t){this.map={},t instanceof Up?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){if(2!=t.length)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+t.length);this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function xp(t){if(!t._noBody)return t.bodyUsed?Promise.reject(new TypeError("Already read")):void(t.bodyUsed=!0)}function Rp(t){return new Promise((function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}}))}function Dp(t){var e=new FileReader,r=Rp(e);return e.readAsArrayBuffer(t),r}function Cp(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function Bp(){return this.bodyUsed=!1,this._initBody=function(t){var e;this.bodyUsed=this.bodyUsed,this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:Tp&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:Op&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:gp&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():Sp&&Tp&&((e=t)&&DataView.prototype.isPrototypeOf(e))?(this._bodyArrayBuffer=Cp(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):Sp&&(ArrayBuffer.prototype.isPrototypeOf(t)||Ep(t))?this._bodyArrayBuffer=Cp(t):this._bodyText=t=Object.prototype.toString.call(t):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):gp&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},Tp&&(this.blob=function(){var t=xp(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var t=xp(this);return t||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}if(Tp)return this.blob().then(Dp);throw new Error("could not read as ArrayBuffer")},this.text=function(){var t=xp(this);if(t)return t;if(this._bodyBlob)return function(t){var e=new FileReader,r=Rp(e),n=/charset=([A-Za-z0-9_-]+)/.exec(t.type),o=n?n[1]:"utf-8";return e.readAsText(t,o),r}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),n=0;n<e.length;n++)r[n]=String.fromCharCode(e[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},Op&&(this.formData=function(){return this.text().then(Fp)}),this.json=function(){return this.text().then(JSON.parse)},this}Up.prototype.append=function(t,e){t=jp(t),e=Ap(e);var r=this.map[t];this.map[t]=r?r+", "+e:e},Up.prototype.delete=function(t){delete this.map[jp(t)]},Up.prototype.get=function(t){return t=jp(t),this.has(t)?this.map[t]:null},Up.prototype.has=function(t){return this.map.hasOwnProperty(jp(t))},Up.prototype.set=function(t,e){this.map[jp(t)]=Ap(e)},Up.prototype.forEach=function(t,e){for(var r in this.map)this.map.hasOwnProperty(r)&&t.call(e,this.map[r],r,this)},Up.prototype.keys=function(){var t=[];return this.forEach((function(e,r){t.push(r)})),Ip(t)},Up.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),Ip(t)},Up.prototype.entries=function(){var t=[];return this.forEach((function(e,r){t.push([r,e])})),Ip(t)},wp&&(Up.prototype[Symbol.iterator]=Up.prototype.entries);var kp=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function _p(t,e){if(!(this instanceof _p))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var r=(e=e||{}).body;if(t instanceof _p){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new Up(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,r||null==t._bodyInit||(r=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new Up(e.headers)),this.method=function(t){var e=t.toUpperCase();return kp.indexOf(e)>-1?e:t}(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal||function(){if("AbortController"in bp)return(new AbortController).signal}(),this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&r)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(r),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==e.cache&&"no-cache"!==e.cache)){var n=/([?&])_=[^&]*/;if(n.test(this.url))this.url=this.url.replace(n,"$1_="+(new Date).getTime());else{this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function Fp(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var r=t.split("="),n=r.shift().replace(/\+/g," "),o=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(n),decodeURIComponent(o))}})),e}function Lp(t,e){if(!(this instanceof Lp))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=void 0===e.statusText?"":""+e.statusText,this.headers=new Up(e.headers),this.url=e.url||"",this._initBody(t)}_p.prototype.clone=function(){return new _p(this,{body:this._bodyInit})},Bp.call(_p.prototype),Bp.call(Lp.prototype),Lp.prototype.clone=function(){return new Lp(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new Up(this.headers),url:this.url})},Lp.error=function(){var t=new Lp(null,{status:200,statusText:""});return t.ok=!1,t.status=0,t.type="error",t};var Np=[301,302,303,307,308];Lp.redirect=function(t,e){if(-1===Np.indexOf(e))throw new RangeError("Invalid status code");return new Lp(null,{status:e,headers:{location:t}})};var Mp=bp.DOMException;try{new Mp}catch(t){(Mp=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack}).prototype=Object.create(Error.prototype),Mp.prototype.constructor=Mp}function $p(t,e){return new Promise((function(r,n){var o=new _p(t,e);if(o.signal&&o.signal.aborted)return n(new Mp("Aborted","AbortError"));var i=new XMLHttpRequest;function a(){i.abort()}if(i.onload=function(){var t,e,n={statusText:i.statusText,headers:(t=i.getAllResponseHeaders()||"",e=new Up,t.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(t){return 0===t.indexOf("\n")?t.substr(1,t.length):t})).forEach((function(t){var r=t.split(":"),n=r.shift().trim();if(n){var o=r.join(":").trim();try{e.append(n,o)}catch(t){console.warn("Response "+t.message)}}})),e)};0===o.url.indexOf("file://")&&(i.status<200||i.status>599)?n.status=200:n.status=i.status,n.url="responseURL"in i?i.responseURL:n.headers.get("X-Request-URL");var a="response"in i?i.response:i.responseText;setTimeout((function(){r(new Lp(a,n))}),0)},i.onerror=function(){setTimeout((function(){n(new TypeError("Network request failed"))}),0)},i.ontimeout=function(){setTimeout((function(){n(new TypeError("Network request timed out"))}),0)},i.onabort=function(){setTimeout((function(){n(new Mp("Aborted","AbortError"))}),0)},i.open(o.method,function(t){try{return""===t&&bp.location.href?bp.location.href:t}catch(e){return t}}(o.url),!0),"include"===o.credentials?i.withCredentials=!0:"omit"===o.credentials&&(i.withCredentials=!1),"responseType"in i&&(Tp?i.responseType="blob":Sp&&(i.responseType="arraybuffer")),e&&"object"==typeof e.headers&&!(e.headers instanceof Up||bp.Headers&&e.headers instanceof bp.Headers)){var s=[];Object.getOwnPropertyNames(e.headers).forEach((function(t){s.push(jp(t)),i.setRequestHeader(t,Ap(e.headers[t]))})),o.headers.forEach((function(t,e){-1===s.indexOf(e)&&i.setRequestHeader(e,t)}))}else o.headers.forEach((function(t,e){i.setRequestHeader(e,t)}));o.signal&&(o.signal.addEventListener("abort",a),i.onreadystatechange=function(){4===i.readyState&&o.signal.removeEventListener("abort",a)}),i.send(void 0===o._bodyInit?null:o._bodyInit)}))}$p.polyfill=!0,bp.fetch||(bp.fetch=$p,bp.Headers=Up,bp.Request=_p,bp.Response=Lp);var qp=function(t,e){return qp=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},qp(t,e)};function Wp(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}qp(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}function Hp(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{u(n.next(t))}catch(t){i(t)}}function s(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))}function Gp(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}}"function"==typeof SuppressedError&&SuppressedError;var Vp,zp=function(){function t(){}return t.getIndexFromTimestamps=function(t,e){var r=1e3*t*90,n=-1;if(e.length>0&&r<e[e.length-1])for(var o=0,i=e;o<i.length;o++){if(i[o]>r)break;n++}return n},t}(),Xp=function(){function t(){this.updateTimestamps=[],this.previousTimestampIndex=0}return t.prototype.setUpdateTimestamps=function(t){this.updateTimestamps=t,this.onTimestampsUpdated&&this.onTimestampsUpdated()},t.prototype.renderAtTimestamp=function(t){var e=zp.getIndexFromTimestamps(t,this.updateTimestamps);this.renderAtIndex(e)},t.prototype.renderAtIndex=function(t){this.previousTimestampIndex!==t&&(this.previousTimestampIndex=t,this.render(t))},t}(),Jp=function(t){function e(e){var r,n=t.call(this)||this;n.$onWorkerMessage=function(t){n.onWorkerMessage(t)};var o=null!==(r=e.workerUrl)&&void 0!==r?r:"libpgs.worker.js";return n.worker=new Worker(o),n.worker.onmessage=n.$onWorkerMessage,n}return Wp(e,t),e.prototype.loadFromUrl=function(t){this.worker.postMessage({op:"loadFromUrl",url:t})},e.prototype.loadFromBuffer=function(t){this.worker.postMessage({op:"loadFromBuffer",buffer:t})},e.prototype.onWorkerMessage=function(t){if("updateTimestamps"===t.data.op)this.setUpdateTimestamps(t.data.updateTimestamps)},e.prototype.dispose=function(){this.worker.terminate()},e}(Xp),Yp=function(t){function e(e,r){var n=t.call(this,e)||this,o=r.transferControlToOffscreen();return n.worker.postMessage({op:"init",canvas:o},[o]),n}return Wp(e,t),e.prototype.render=function(t){this.worker.postMessage({op:"render",index:t})},e}(Jp),Kp=function(){function t(){this.empty=!0,this.x=0,this.y=0,this.width=0,this.height=0}return t.prototype.reset=function(){this.empty=!0,this.x=0,this.y=0,this.width=0,this.height=0},t.prototype.set=function(t,e,r,n){void 0===r&&(r=0),void 0===n&&(n=0),this.empty=!1,this.x=t,this.y=e,this.width=r,this.height=n},t.prototype.union=function(t,e,r,n){void 0===r&&(r=0),void 0===n&&(n=0),this.empty?(this.empty=!1,this.x=t,this.y=e,this.width=r,this.height=n):(t<this.x&&(this.width+=this.x-t,this.x=t),e<this.y&&(this.height+=this.y-e,this.y=e),t+r>this.x+this.width&&(this.width=t+r-this.x),e+n>this.y+this.height&&(this.height=e+n-this.y))},t}(),Zp=function(){function t(t){this.dirtyArea=new Kp,this.canvas=t,this.context=t.getContext("2d")}return t.prototype.draw=function(t){this.canvas&&this.context&&(this.dirtyArea.empty||(this.context.clearRect(this.dirtyArea.x,this.dirtyArea.y,this.dirtyArea.width,this.dirtyArea.height),this.dirtyArea.reset()),t&&(this.canvas.width==t.width&&this.canvas.height==t.height||(this.canvas.width=t.width,this.canvas.height=t.height),this.drawSubtitleData(t,this.dirtyArea)))},t.prototype.drawSubtitleData=function(t,e){for(var r=0,n=t.compositionData;r<n.length;r++){var o=n[r];this.drawSubtitleCompositionData(o,e)}},t.prototype.drawSubtitleCompositionData=function(t,e){var r;null===(r=this.context)||void 0===r||r.putImageData(t.pixelData,t.window.horizontalPosition,t.window.verticalPosition),null==e||e.union(t.window.horizontalPosition,t.window.verticalPosition,t.pixelData.width,t.pixelData.height)},t}(),Qp=function(){function t(t){this.$position=0,this.array=t}return Object.defineProperty(t.prototype,"position",{get:function(){return this.$position},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"length",{get:function(){return this.array.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"eof",{get:function(){return this.position>=this.length},enumerable:!1,configurable:!0}),t.prototype.readByte=function(){return this.array[this.$position++]},t.prototype.readBytes=function(t){var e=this.array.slice(this.$position,this.$position+t);return this.$position+=t,e},t}(),td=function(){function t(t){t instanceof Uint8Array?this.baseReader=new Qp(t):this.baseReader=t}return Object.defineProperty(t.prototype,"position",{get:function(){return this.baseReader.position},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"length",{get:function(){return this.baseReader.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"eof",{get:function(){return this.baseReader.eof},enumerable:!1,configurable:!0}),t.prototype.readUInt8=function(){return this.baseReader.readByte()},t.prototype.readUInt16=function(){return(this.baseReader.readByte()<<8)+this.baseReader.readByte()},t.prototype.readUInt24=function(){return(this.baseReader.readByte()<<16)+(this.baseReader.readByte()<<8)+this.baseReader.readByte()},t.prototype.readUInt32=function(){return(this.baseReader.readByte()<<24)+(this.baseReader.readByte()<<16)+(this.baseReader.readByte()<<8)+this.baseReader.readByte()},t.prototype.readBytes=function(t){return this.baseReader.readBytes(t)},t}();!function(t){t[t.paletteDefinition=20]="paletteDefinition",t[t.objectDefinition=21]="objectDefinition",t[t.presentationComposition=22]="presentationComposition",t[t.windowDefinition=23]="windowDefinition",t[t.end=128]="end"}(Vp||(Vp={}));var ed,rd=function(){function t(){this.id=0,this.windowId=0,this.croppedFlag=0,this.horizontalPosition=0,this.verticalPosition=0,this.croppingHorizontalPosition=0,this.croppingVerticalPosition=0,this.croppingWidth=0,this.croppingHeightPosition=0}return Object.defineProperty(t.prototype,"hasCropping",{get:function(){return!!(128&this.croppedFlag)},enumerable:!1,configurable:!0}),t}(),nd=function(){function t(){this.width=0,this.height=0,this.frameRate=0,this.compositionNumber=0,this.compositionState=0,this.paletteUpdateFlag=0,this.paletteId=0,this.compositionObjects=[]}return Object.defineProperty(t.prototype,"segmentType",{get:function(){return Vp.presentationComposition},enumerable:!1,configurable:!0}),t.prototype.read=function(t,e){this.width=t.readUInt16(),this.height=t.readUInt16(),this.frameRate=t.readUInt8(),this.compositionNumber=t.readUInt16(),this.compositionState=t.readUInt8(),this.paletteUpdateFlag=t.readUInt8(),this.paletteId=t.readUInt8();var r=t.readUInt8();this.compositionObjects=[];for(var n=0;n<r;n++){var o=new rd;o.id=t.readUInt16(),o.windowId=t.readUInt8(),o.croppedFlag=t.readUInt8(),o.horizontalPosition=t.readUInt16(),o.verticalPosition=t.readUInt16(),o.hasCropping&&(o.croppingHorizontalPosition=t.readUInt16(),o.croppingVerticalPosition=t.readUInt16(),o.croppingWidth=t.readUInt16(),o.croppingHeightPosition=t.readUInt16()),this.compositionObjects.push(o)}},t}(),od=function(){function t(){this.id=0,this.versionNumber=0,this.rgba=[]}return Object.defineProperty(t.prototype,"segmentType",{get:function(){return Vp.paletteDefinition},enumerable:!1,configurable:!0}),t.prototype.read=function(e,r){this.id=e.readUInt8(),this.versionNumber=e.readUInt8();var n=(r-2)/5,o=new Uint32Array(1),i=new Uint8Array(o.buffer);this.rgba=[];for(var a=0;a<n;a++){var s=e.readUInt8(),u=e.readUInt8(),c=e.readUInt8()-128,f=e.readUInt8()-128,h=e.readUInt8(),p=t.clamp(Math.round(u+1.402*c),0,255),d=t.clamp(Math.round(u-.34414*f-.71414*c),0,255),l=t.clamp(Math.round(u+1.772*f),0,255);i[0]=p,i[1]=d,i[2]=l,i[3]=h,this.rgba[s]=o[0]}},t.clamp=function(t,e,r){return t<e?e:t>r?r:t},t}(),id=function(){function t(){this.id=0,this.versionNumber=0,this.lastInSequenceFlag=0,this.width=0,this.height=0,this.dataLength=0}return Object.defineProperty(t.prototype,"isFirstInSequence",{get:function(){return!!(128&this.lastInSequenceFlag)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isLastInSequence",{get:function(){return!!(64&this.lastInSequenceFlag)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"segmentType",{get:function(){return Vp.objectDefinition},enumerable:!1,configurable:!0}),t.prototype.read=function(t,e){this.id=t.readUInt16(),this.versionNumber=t.readUInt8(),this.lastInSequenceFlag=t.readUInt8(),this.isFirstInSequence?(this.dataLength=t.readUInt24(),this.width=t.readUInt16(),this.height=t.readUInt16(),this.data=t.readBytes(e-11)):this.data=t.readBytes(e-4)},t}(),ad=function(){this.id=0,this.horizontalPosition=0,this.verticalPosition=0,this.width=0,this.height=0},sd=function(){function t(){this.windows=[]}return Object.defineProperty(t.prototype,"segmentType",{get:function(){return Vp.windowDefinition},enumerable:!1,configurable:!0}),t.prototype.read=function(t,e){var r=t.readUInt8();this.windows=[];for(var n=0;n<r;n++){var o=new ad;o.id=t.readUInt8(),o.horizontalPosition=t.readUInt16(),o.verticalPosition=t.readUInt16(),o.width=t.readUInt16(),o.height=t.readUInt16(),this.windows.push(o)}},t}(),ud=function(){function t(){this.presentationTimestamp=0,this.decodingTimestamp=0,this.paletteDefinitions=[],this.objectDefinitions=[],this.windowDefinitions=[]}return t.prototype.read=function(t,e){return Hp(this,void 0,void 0,(function(){var r,n,o,i,a,s,u,c,f;return Gp(this,(function(h){switch(h.label){case 0:this.presentationTimestamp=0,this.decodingTimestamp=0,this.presentationComposition=void 0,this.paletteDefinitions=[],this.objectDefinitions=[],this.windowDefinitions=[],r=void 0,"requestData"in t.baseReader&&(r=t.baseReader),h.label=1;case 1:return n=0,o=0,e?[4,null==r?void 0:r.requestData(10)]:[3,3];case 2:if(h.sent(),20551!=t.readUInt16())throw new Error("Invalid magic number!");n=t.readUInt32(),o=t.readUInt32(),h.label=3;case 3:return[4,null==r?void 0:r.requestData(3)];case 4:return h.sent(),i=t.readUInt8(),a=t.readUInt16(),[4,null==r?void 0:r.requestData(a)];case 5:switch(h.sent(),i){case Vp.paletteDefinition:(s=new od).read(t,a),this.paletteDefinitions.push(s);break;case Vp.objectDefinition:(u=new id).read(t,a),this.objectDefinitions.push(u);break;case Vp.presentationComposition:(c=new nd).read(t,a),this.presentationComposition=c,this.presentationTimestamp=n,this.decodingTimestamp=o;break;case Vp.windowDefinition:(f=new sd).read(t,a),this.windowDefinitions.push(f);break;case Vp.end:return[2];default:throw new Error("Unsupported segment type ".concat(i))}return[3,1];case 6:return[2]}}))}))},t}(),cd=function(){function t(t){this.$position=0,this.subReaderIndex=0,this.subReaders=t.map((function(t){return t instanceof Uint8Array?new Qp(t):t}));for(var e=0,r=0,n=t;r<n.length;r++){e+=n[r].length}this.$length=e}return t.prototype.push=function(t){t instanceof Uint8Array?this.subReaders.push(new Qp(t)):this.subReaders.push(t),this.$length+=t.length},Object.defineProperty(t.prototype,"position",{get:function(){return this.$position},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"length",{get:function(){return this.$length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"eof",{get:function(){return this.position>=this.length},enumerable:!1,configurable:!0}),t.prototype.readByte=function(){for(;this.subReaders[this.subReaderIndex].position>=this.subReaders[this.subReaderIndex].length;)this.subReaderIndex++;return this.$position++,this.subReaders[this.subReaderIndex].readByte()},t.prototype.readBytes=function(t){for(var e=new Uint8Array(t),r=0;r<t;r++)e[r]=this.readByte();return e},t}(),fd=function(){function t(t){this.$eof=!1,this.stream=t,this.reader=new cd([])}return Object.defineProperty(t.prototype,"position",{get:function(){return this.reader.position},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"length",{get:function(){return this.reader.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"eof",{get:function(){return this.$eof},enumerable:!1,configurable:!0}),t.prototype.readByte=function(){return this.reader.readByte()},t.prototype.readBytes=function(t){return this.reader.readBytes(t)},t.prototype.requestData=function(){return Hp(this,arguments,void 0,(function(t){var e,r,n;return void 0===t&&(t=0),Gp(this,(function(o){switch(o.label){case 0:return this.reader.position+t+1>this.reader.length&&!this.$eof?[4,this.stream.read()]:[3,2];case 1:return e=o.sent(),r=e.value,n=e.done,r&&this.reader.push(r),n&&(this.$eof=!0),[3,0];case 2:return[2,this.reader.position+t<=this.reader.length]}}))}))},t}(),hd=function(t,e,r){this.width=t,this.height=e,this.compositionData=r},pd=function(t,e){this.window=t,this.pixelData=e},dd=function(){function t(){}return t.decode=function(t,e,r){t instanceof Uint8Array&&(t=new Qp(t));for(var n=0;t.position<t.length;){var o=t.readByte();if(0==o){var i=t.readByte();if(0!=i){var a=!!(128&i),s=63&i;!!(64&i)&&(s=(s<<8)+t.readByte());for(var u=a?t.readByte():0,c=0;c<s;c++)r[n++]=e[u]}}else r[n++]=e[o]}return n},t}(),ld=function(){function t(){this.displaySets=[],this.updateTimestamps=[]}return t.prototype.loadFromUrl=function(t,e){return Hp(this,void 0,void 0,(function(){var r,n,o,i,a;return Gp(this,(function(s){switch(s.label){case 0:return[4,fetch(t)];case 1:if(!(r=s.sent()).ok)throw new Error("HTTP error: ".concat(r.status));return(n=null===(a=r.body)||void 0===a?void 0:a.getReader())?(o=new fd(n),[3,4]):[3,2];case 2:return[4,r.arrayBuffer()];case 3:i=s.sent(),o=new Qp(new Uint8Array(i)),s.label=4;case 4:return[4,this.loadFromReader(o,e)];case 5:return s.sent(),[2]}}))}))},t.prototype.loadFromBuffer=function(t,e){return Hp(this,void 0,void 0,(function(){return Gp(this,(function(r){switch(r.label){case 0:return[4,this.loadFromReader(new Qp(new Uint8Array(t)),e)];case 1:return r.sent(),[2]}}))}))},t.prototype.loadFromReader=function(t,e){return Hp(this,void 0,void 0,(function(){var r,n,o,i;return Gp(this,(function(a){switch(a.label){case 0:this.displaySets=[],this.updateTimestamps=[],this.cachedSubtitleData=void 0,r=performance.now(),n=new td(t),a.label=1;case 1:return t.eof?[3,3]:[4,(o=new ud).read(n,!0)];case 2:return a.sent(),this.displaySets.push(o),this.updateTimestamps.push(o.presentationTimestamp),(null==e?void 0:e.onProgress)&&(i=performance.now())>r+1e3&&(r=i,e.onProgress()),[3,1];case 3:return(null==e?void 0:e.onProgress)&&e.onProgress(),[2]}}))}))},t.prototype.cacheSubtitleAtIndex=function(t){var e=this.getSubtitleAtIndex(t);this.cachedSubtitleData={index:t,data:e}},t.prototype.getSubtitleAtTimestamp=function(t){var e=zp.getIndexFromTimestamps(t,this.updateTimestamps);return this.getSubtitleAtIndex(e)},t.prototype.getSubtitleAtIndex=function(t){var e;if(this.cachedSubtitleData&&this.cachedSubtitleData.index===t)return this.cachedSubtitleData.data;if(!(t<0||t>=this.displaySets.length)){var r=this.displaySets[t];if(r.presentationComposition){for(var n=[],o=[],i=[],a=t;a>=0;){var s=this.displaySets[a];n.unshift.apply(n,s.objectDefinitions),o.unshift.apply(o,s.paletteDefinitions);for(var u=0,c=s.windowDefinitions;u<c.length;u++){var f=c[u];i.unshift.apply(i,f.windows)}if(0!==(null===(e=this.displaySets[a].presentationComposition)||void 0===e?void 0:e.compositionState))break;a--}var h=o.find((function(t){var e;return t.id===(null===(e=r.presentationComposition)||void 0===e?void 0:e.paletteId)}));if(h){for(var p=[],d=function(t){var e=i.find((function(e){return e.id===t.windowId}));if(!e)return"continue";var r=l.getPixelDataFromComposition(t,h,n);r&&p.push(new pd(e,r))},l=this,y=0,v=r.presentationComposition.compositionObjects;y<v.length;y++){d(v[y])}if(0!==p.length)return new hd(r.presentationComposition.width,r.presentationComposition.height,p)}}}},t.prototype.getPixelDataFromComposition=function(t,e,r){for(var n=0,o=0,i=[],a=0,s=r;a<s.length;a++){var u=s[a];u.id==t.id&&(u.isFirstInSequence&&(n=u.width,o=u.height),u.data&&i.push(u.data))}if(0!=i.length){var c=new cd(i);if("undefined"!=typeof document){var f=document.createElement("canvas").getContext("2d").createImageData(n,o),h=new Uint32Array(f.data.buffer);return dd.decode(c,e.rgba,h),f}h=new Uint32Array(n*o);return dd.decode(c,e.rgba,h),new ImageData(new Uint8ClampedArray(h.buffer),n,o)}},t}(),yd=function(t){function e(e,r){var n=t.call(this)||this;return n.pgs=new ld,n.renderer=new Zp(r),n}return Wp(e,t),e.prototype.render=function(t){var e=this,r=this.pgs.getSubtitleAtIndex(t);requestAnimationFrame((function(){e.renderer.draw(r)})),this.pgs.cacheSubtitleAtIndex(t+1)},e.prototype.loadFromUrl=function(t){var e=this;this.pgs.loadFromUrl(t,{onProgress:function(){e.invokeTimestampsUpdate()}}).then((function(){e.invokeTimestampsUpdate()}))},e.prototype.loadFromBuffer=function(t){var e=this;this.pgs.loadFromBuffer(t).then((function(){e.invokeTimestampsUpdate()}))},e.prototype.invokeTimestampsUpdate=function(){this.setUpdateTimestamps(this.pgs.updateTimestamps)},e.prototype.dispose=function(){},e}(Xp),vd=function(t){function e(e,r){var n=t.call(this,e)||this;return n.renderer=new Zp(r),n.worker.postMessage({op:"init"}),n}return Wp(e,t),e.prototype.render=function(t){this.worker.postMessage({op:"requestSubtitleData",index:t})},e.prototype.onWorkerMessage=function(e){if("subtitleData"===e.data.op){var r=e.data.subtitleData;this.renderer&&this.renderer.draw(r)}else t.prototype.onWorkerMessage.call(this,e)},e}(Jp);!function(t){t.worker="worker",t.workerWithoutOffscreenCanvas="workerWithoutOffscreenCanvas",t.mainThread="mainThread"}(ed||(ed={}));var md=function(){function t(){}return t.isWorkerSupported=function(){return!!Worker},t.isOffscreenCanvasSupported=function(){return!!HTMLCanvasElement.prototype.transferControlToOffscreen},t.getRendererModeByPlatform=function(){var t=navigator.userAgent,e=/Chrome\/(\d+)/.exec(t),r=e?parseInt(e[1]):void 0,n=/Firefox\/(\d+)/.exec(t),o=n?parseInt(n[1]):void 0,i=navigator.userAgent.indexOf("Web0S")>=0;if(r&&r<36)return ed.mainThread;if(o&&o<25)return ed.mainThread;if(i&&void 0===r)return ed.mainThread;if(i&&r&&r<=68)return ed.mainThread;var a=this.isWorkerSupported(),s=this.isOffscreenCanvasSupported();return a?s?ed.worker:ed.workerWithoutOffscreenCanvas:ed.mainThread},t}(),bd=function(){function t(t){var e,r=this;if(this.$timeOffset=0,this.onTimeUpdate=function(){r.renderAtVideoTimestamp()},t.video&&(this.video=t.video),t.canvas)this.canvas=t.canvas,this.canvasOwner=!1;else{if(!this.video)throw new Error("No canvas or video element was provided!");this.canvas=this.createCanvasElement(),this.canvasOwner=!0,this.video.parentElement.appendChild(this.canvas)}this.implementation=this.createPgsRenderer(t),this.implementation.onTimestampsUpdated=function(){r.renderAtVideoTimestamp()},this.$timeOffset=null!==(e=t.timeOffset)&&void 0!==e?e:0,t.subUrl&&this.loadFromUrl(t.subUrl),this.registerVideoEvents()}return t.prototype.createPgsRenderer=function(t){var e;switch(null!==(e=t.mode)&&void 0!==e?e:md.getRendererModeByPlatform()){case ed.worker:return new Yp(t,this.canvas);case ed.workerWithoutOffscreenCanvas:return new vd(t,this.canvas);case ed.mainThread:return new yd(t,this.canvas)}},t.prototype.loadFromUrl=function(t){this.implementation.loadFromUrl(t)},t.prototype.loadFromBuffer=function(t){this.implementation.loadFromBuffer(t)},t.prototype.renderAtTimestamp=function(t){this.implementation.renderAtTimestamp(t)},Object.defineProperty(t.prototype,"timeOffset",{get:function(){return this.$timeOffset},set:function(t){this.$timeOffset!==t&&(this.$timeOffset=t,this.renderAtVideoTimestamp())},enumerable:!1,configurable:!0}),t.prototype.registerVideoEvents=function(){var t;null===(t=this.video)||void 0===t||t.addEventListener("timeupdate",this.onTimeUpdate)},t.prototype.unregisterVideoEvents=function(){var t;null===(t=this.video)||void 0===t||t.removeEventListener("timeupdate",this.onTimeUpdate)},t.prototype.renderAtVideoTimestamp=function(){this.video&&this.renderAtTimestamp(this.video.currentTime+this.$timeOffset)},t.prototype.createCanvasElement=function(){var t=document.createElement("canvas");return t.style.position="absolute",t.style.top="0",t.style.left="0",t.style.right="0",t.style.bottom="0",t.style.pointerEvents="none",t.style.objectFit="contain",t.style.width="100%",t.style.height="100%",t},t.prototype.destroyCanvasElement=function(){this.canvas.remove()},t.prototype.dispose=function(){this.implementation.dispose(),this.unregisterVideoEvents(),this.canvasOwner&&this.destroyCanvasElement()},t}();export{bd as PgsRenderer};
var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},e=function(t){return t&&t.Math===Math&&t},r=e("object"==typeof globalThis&&globalThis)||e("object"==typeof window&&window)||e("object"==typeof self&&self)||e("object"==typeof t&&t)||e("object"==typeof t&&t)||function(){return this}()||Function("return this")(),n={},o=function(t){try{return!!t()}catch(t){return!0}},i=!o((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})),a=!o((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})),s=a,u=Function.prototype.call,c=s?u.bind(u):function(){return u.apply(u,arguments)},f={},h={}.propertyIsEnumerable,p=Object.getOwnPropertyDescriptor,d=p&&!h.call({1:2},1);f.f=d?function(t){var e=p(this,t);return!!e&&e.enumerable}:h;var l,y,v=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},m=a,b=Function.prototype,g=b.call,w=m&&b.bind.bind(g,g),T=m?w:function(t){return function(){return g.apply(t,arguments)}},O=T,S=O({}.toString),P=O("".slice),E=function(t){return P(S(t),8,-1)},j=o,A=E,I=Object,U=T("".split),R=j((function(){return!I("z").propertyIsEnumerable(0)}))?function(t){return"String"===A(t)?U(t,""):I(t)}:I,x=function(t){return null==t},D=x,C=TypeError,B=function(t){if(D(t))throw new C("Can't call method on "+t);return t},k=R,_=B,F=function(t){return k(_(t))},L="object"==typeof document&&document.all,N=void 0===L&&void 0!==L?function(t){return"function"==typeof t||t===L}:function(t){return"function"==typeof t},M=N,$=function(t){return"object"==typeof t?null!==t:M(t)},q=r,W=N,H=function(t,e){return arguments.length<2?(r=q[t],W(r)?r:void 0):q[t]&&q[t][e];var r},G=T({}.isPrototypeOf),V=r.navigator,z=V&&V.userAgent,X=z?String(z):"",J=r,Y=X,K=J.process,Z=J.Deno,Q=K&&K.versions||Z&&Z.version,tt=Q&&Q.v8;tt&&(y=(l=tt.split("."))[0]>0&&l[0]<4?1:+(l[0]+l[1])),!y&&Y&&(!(l=Y.match(/Edge\/(\d+)/))||l[1]>=74)&&(l=Y.match(/Chrome\/(\d+)/))&&(y=+l[1]);var et=y,rt=et,nt=o,ot=r.String,it=!!Object.getOwnPropertySymbols&&!nt((function(){var t=Symbol("symbol detection");return!ot(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&rt&&rt<41})),at=it&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,st=H,ut=N,ct=G,ft=Object,ht=at?function(t){return"symbol"==typeof t}:function(t){var e=st("Symbol");return ut(e)&&ct(e.prototype,ft(t))},pt=String,dt=function(t){try{return pt(t)}catch(t){return"Object"}},lt=N,yt=dt,vt=TypeError,mt=function(t){if(lt(t))return t;throw new vt(yt(t)+" is not a function")},bt=mt,gt=x,wt=function(t,e){var r=t[e];return gt(r)?void 0:bt(r)},Tt=c,Ot=N,St=$,Pt=TypeError,Et={exports:{}},jt=r,At=Object.defineProperty,It=function(t,e){try{At(jt,t,{value:e,configurable:!0,writable:!0})}catch(r){jt[t]=e}return e},Ut=r,Rt=It,xt="__core-js_shared__",Dt=Et.exports=Ut[xt]||Rt(xt,{});(Dt.versions||(Dt.versions=[])).push({version:"3.38.1",mode:"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.38.1/LICENSE",source:"https://github.com/zloirock/core-js"});var Ct=Et.exports,Bt=Ct,kt=function(t,e){return Bt[t]||(Bt[t]=e||{})},_t=B,Ft=Object,Lt=function(t){return Ft(_t(t))},Nt=Lt,Mt=T({}.hasOwnProperty),$t=Object.hasOwn||function(t,e){return Mt(Nt(t),e)},qt=T,Wt=0,Ht=Math.random(),Gt=qt(1..toString),Vt=function(t){return"Symbol("+(void 0===t?"":t)+")_"+Gt(++Wt+Ht,36)},zt=kt,Xt=$t,Jt=Vt,Yt=it,Kt=at,Zt=r.Symbol,Qt=zt("wks"),te=Kt?Zt.for||Zt:Zt&&Zt.withoutSetter||Jt,ee=function(t){return Xt(Qt,t)||(Qt[t]=Yt&&Xt(Zt,t)?Zt[t]:te("Symbol."+t)),Qt[t]},re=c,ne=$,oe=ht,ie=wt,ae=function(t,e){var r,n;if("string"===e&&Ot(r=t.toString)&&!St(n=Tt(r,t)))return n;if(Ot(r=t.valueOf)&&!St(n=Tt(r,t)))return n;if("string"!==e&&Ot(r=t.toString)&&!St(n=Tt(r,t)))return n;throw new Pt("Can't convert object to primitive value")},se=TypeError,ue=ee("toPrimitive"),ce=function(t,e){if(!ne(t)||oe(t))return t;var r,n=ie(t,ue);if(n){if(void 0===e&&(e="default"),r=re(n,t,e),!ne(r)||oe(r))return r;throw new se("Can't convert object to primitive value")}return void 0===e&&(e="number"),ae(t,e)},fe=ht,he=function(t){var e=ce(t,"string");return fe(e)?e:e+""},pe=$,de=r.document,le=pe(de)&&pe(de.createElement),ye=function(t){return le?de.createElement(t):{}},ve=ye,me=!i&&!o((function(){return 7!==Object.defineProperty(ve("div"),"a",{get:function(){return 7}}).a})),be=i,ge=c,we=f,Te=v,Oe=F,Se=he,Pe=$t,Ee=me,je=Object.getOwnPropertyDescriptor;n.f=be?je:function(t,e){if(t=Oe(t),e=Se(e),Ee)try{return je(t,e)}catch(t){}if(Pe(t,e))return Te(!ge(we.f,t,e),t[e])};var Ae={},Ie=i&&o((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),Ue=$,Re=String,xe=TypeError,De=function(t){if(Ue(t))return t;throw new xe(Re(t)+" is not an object")},Ce=i,Be=me,ke=Ie,_e=De,Fe=he,Le=TypeError,Ne=Object.defineProperty,Me=Object.getOwnPropertyDescriptor,$e="enumerable",qe="configurable",We="writable";Ae.f=Ce?ke?function(t,e,r){if(_e(t),e=Fe(e),_e(r),"function"==typeof t&&"prototype"===e&&"value"in r&&We in r&&!r[We]){var n=Me(t,e);n&&n[We]&&(t[e]=r.value,r={configurable:qe in r?r[qe]:n[qe],enumerable:$e in r?r[$e]:n[$e],writable:!1})}return Ne(t,e,r)}:Ne:function(t,e,r){if(_e(t),e=Fe(e),_e(r),Be)try{return Ne(t,e,r)}catch(t){}if("get"in r||"set"in r)throw new Le("Accessors not supported");return"value"in r&&(t[e]=r.value),t};var He=Ae,Ge=v,Ve=i?function(t,e,r){return He.f(t,e,Ge(1,r))}:function(t,e,r){return t[e]=r,t},ze={exports:{}},Xe=i,Je=$t,Ye=Function.prototype,Ke=Xe&&Object.getOwnPropertyDescriptor,Ze=Je(Ye,"name"),Qe={EXISTS:Ze,PROPER:Ze&&"something"===function(){}.name,CONFIGURABLE:Ze&&(!Xe||Xe&&Ke(Ye,"name").configurable)},tr=N,er=Ct,rr=T(Function.toString);tr(er.inspectSource)||(er.inspectSource=function(t){return rr(t)});var nr,or,ir,ar=er.inspectSource,sr=N,ur=r.WeakMap,cr=sr(ur)&&/native code/.test(String(ur)),fr=Vt,hr=kt("keys"),pr=function(t){return hr[t]||(hr[t]=fr(t))},dr={},lr=cr,yr=r,vr=$,mr=Ve,br=$t,gr=Ct,wr=pr,Tr=dr,Or="Object already initialized",Sr=yr.TypeError,Pr=yr.WeakMap;if(lr||gr.state){var Er=gr.state||(gr.state=new Pr);Er.get=Er.get,Er.has=Er.has,Er.set=Er.set,nr=function(t,e){if(Er.has(t))throw new Sr(Or);return e.facade=t,Er.set(t,e),e},or=function(t){return Er.get(t)||{}},ir=function(t){return Er.has(t)}}else{var jr=wr("state");Tr[jr]=!0,nr=function(t,e){if(br(t,jr))throw new Sr(Or);return e.facade=t,mr(t,jr,e),e},or=function(t){return br(t,jr)?t[jr]:{}},ir=function(t){return br(t,jr)}}var Ar={set:nr,get:or,has:ir,enforce:function(t){return ir(t)?or(t):nr(t,{})},getterFor:function(t){return function(e){var r;if(!vr(e)||(r=or(e)).type!==t)throw new Sr("Incompatible receiver, "+t+" required");return r}}},Ir=T,Ur=o,Rr=N,xr=$t,Dr=i,Cr=Qe.CONFIGURABLE,Br=ar,kr=Ar.enforce,_r=Ar.get,Fr=String,Lr=Object.defineProperty,Nr=Ir("".slice),Mr=Ir("".replace),$r=Ir([].join),qr=Dr&&!Ur((function(){return 8!==Lr((function(){}),"length",{value:8}).length})),Wr=String(String).split("String"),Hr=ze.exports=function(t,e,r){"Symbol("===Nr(Fr(e),0,7)&&(e="["+Mr(Fr(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(e="get "+e),r&&r.setter&&(e="set "+e),(!xr(t,"name")||Cr&&t.name!==e)&&(Dr?Lr(t,"name",{value:e,configurable:!0}):t.name=e),qr&&r&&xr(r,"arity")&&t.length!==r.arity&&Lr(t,"length",{value:r.arity});try{r&&xr(r,"constructor")&&r.constructor?Dr&&Lr(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var n=kr(t);return xr(n,"source")||(n.source=$r(Wr,"string"==typeof e?e:"")),t};Function.prototype.toString=Hr((function(){return Rr(this)&&_r(this).source||Br(this)}),"toString");var Gr=ze.exports,Vr=N,zr=Ae,Xr=Gr,Jr=It,Yr=function(t,e,r,n){n||(n={});var o=n.enumerable,i=void 0!==n.name?n.name:e;if(Vr(r)&&Xr(r,i,n),n.global)o?t[e]=r:Jr(e,r);else{try{n.unsafe?t[e]&&(o=!0):delete t[e]}catch(t){}o?t[e]=r:zr.f(t,e,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return t},Kr={},Zr=Math.ceil,Qr=Math.floor,tn=Math.trunc||function(t){var e=+t;return(e>0?Qr:Zr)(e)},en=function(t){var e=+t;return e!=e||0===e?0:tn(e)},rn=en,nn=Math.max,on=Math.min,an=en,sn=Math.min,un=function(t){var e=an(t);return e>0?sn(e,9007199254740991):0},cn=function(t){return un(t.length)},fn=F,hn=function(t,e){var r=rn(t);return r<0?nn(r+e,0):on(r,e)},pn=cn,dn=function(t){return function(e,r,n){var o=fn(e),i=pn(o);if(0===i)return!t&&-1;var a,s=hn(n,i);if(t&&r!=r){for(;i>s;)if((a=o[s++])!=a)return!0}else for(;i>s;s++)if((t||s in o)&&o[s]===r)return t||s||0;return!t&&-1}},ln={includes:dn(!0),indexOf:dn(!1)},yn=$t,vn=F,mn=ln.indexOf,bn=dr,gn=T([].push),wn=function(t,e){var r,n=vn(t),o=0,i=[];for(r in n)!yn(bn,r)&&yn(n,r)&&gn(i,r);for(;e.length>o;)yn(n,r=e[o++])&&(~mn(i,r)||gn(i,r));return i},Tn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],On=wn,Sn=Tn.concat("length","prototype");Kr.f=Object.getOwnPropertyNames||function(t){return On(t,Sn)};var Pn={};Pn.f=Object.getOwnPropertySymbols;var En=H,jn=Kr,An=Pn,In=De,Un=T([].concat),Rn=En("Reflect","ownKeys")||function(t){var e=jn.f(In(t)),r=An.f;return r?Un(e,r(t)):e},xn=$t,Dn=Rn,Cn=n,Bn=Ae,kn=function(t,e,r){for(var n=Dn(e),o=Bn.f,i=Cn.f,a=0;a<n.length;a++){var s=n[a];xn(t,s)||r&&xn(r,s)||o(t,s,i(e,s))}},_n=o,Fn=N,Ln=/#|\.prototype\./,Nn=function(t,e){var r=$n[Mn(t)];return r===Wn||r!==qn&&(Fn(e)?_n(e):!!e)},Mn=Nn.normalize=function(t){return String(t).replace(Ln,".").toLowerCase()},$n=Nn.data={},qn=Nn.NATIVE="N",Wn=Nn.POLYFILL="P",Hn=Nn,Gn=r,Vn=n.f,zn=Ve,Xn=Yr,Jn=It,Yn=kn,Kn=Hn,Zn=function(t,e){var r,n,o,i,a,s=t.target,u=t.global,c=t.stat;if(r=u?Gn:c?Gn[s]||Jn(s,{}):Gn[s]&&Gn[s].prototype)for(n in e){if(i=e[n],o=t.dontCallGetSet?(a=Vn(r,n))&&a.value:r[n],!Kn(u?n:s+(c?".":"#")+n,t.forced)&&void 0!==o){if(typeof i==typeof o)continue;Yn(i,o)}(t.sham||o&&o.sham)&&zn(i,"sham",!0),Xn(r,n,i,t)}},Qn=!o((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})),to=$t,eo=N,ro=Lt,no=Qn,oo=pr("IE_PROTO"),io=Object,ao=io.prototype,so=no?io.getPrototypeOf:function(t){var e=ro(t);if(to(e,oo))return e[oo];var r=e.constructor;return eo(r)&&e instanceof r?r.prototype:e instanceof io?ao:null},uo=T,co=mt,fo=$,ho=function(t){return fo(t)||null===t},po=String,lo=TypeError,yo=function(t,e,r){try{return uo(co(Object.getOwnPropertyDescriptor(t,e)[r]))}catch(t){}},vo=$,mo=B,bo=function(t){if(ho(t))return t;throw new lo("Can't set "+po(t)+" as a prototype")},go=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,r={};try{(t=yo(Object.prototype,"__proto__","set"))(r,[]),e=r instanceof Array}catch(t){}return function(r,n){return mo(r),bo(n),vo(r)?(e?t(r,n):r.__proto__=n,r):r}}():void 0),wo={},To=wn,Oo=Tn,So=Object.keys||function(t){return To(t,Oo)},Po=i,Eo=Ie,jo=Ae,Ao=De,Io=F,Uo=So;wo.f=Po&&!Eo?Object.defineProperties:function(t,e){Ao(t);for(var r,n=Io(e),o=Uo(e),i=o.length,a=0;i>a;)jo.f(t,r=o[a++],n[r]);return t};var Ro,xo=H("document","documentElement"),Do=De,Co=wo,Bo=Tn,ko=dr,_o=xo,Fo=ye,Lo="prototype",No="script",Mo=pr("IE_PROTO"),$o=function(){},qo=function(t){return"<"+No+">"+t+"</"+No+">"},Wo=function(t){t.write(qo("")),t.close();var e=t.parentWindow.Object;return t=null,e},Ho=function(){try{Ro=new ActiveXObject("htmlfile")}catch(t){}var t,e,r;Ho="undefined"!=typeof document?document.domain&&Ro?Wo(Ro):(e=Fo("iframe"),r="java"+No+":",e.style.display="none",_o.appendChild(e),e.src=String(r),(t=e.contentWindow.document).open(),t.write(qo("document.F=Object")),t.close(),t.F):Wo(Ro);for(var n=Bo.length;n--;)delete Ho[Lo][Bo[n]];return Ho()};ko[Mo]=!0;var Go=Object.create||function(t,e){var r;return null!==t?($o[Lo]=Do(t),r=new $o,$o[Lo]=null,r[Mo]=t):r=Ho(),void 0===e?r:Co.f(r,e)},Vo=$,zo=Ve,Xo=Error,Jo=T("".replace),Yo=String(new Xo("zxcasd").stack),Ko=/\n\s*at [^:]*:[^\n]*/,Zo=Ko.test(Yo),Qo=v,ti=!o((function(){var t=new Error("a");return!("stack"in t)||(Object.defineProperty(t,"stack",Qo(1,7)),7!==t.stack)})),ei=Ve,ri=function(t,e){if(Zo&&"string"==typeof t&&!Xo.prepareStackTrace)for(;e--;)t=Jo(t,Ko,"");return t},ni=ti,oi=Error.captureStackTrace,ii=E,ai=T,si=function(t){if("Function"===ii(t))return ai(t)},ui=mt,ci=a,fi=si(si.bind),hi=function(t,e){return ui(t),void 0===e?t:ci?fi(t,e):function(){return t.apply(e,arguments)}},pi={},di=pi,li=ee("iterator"),yi=Array.prototype,vi={};vi[ee("toStringTag")]="z";var mi="[object z]"===String(vi),bi=mi,gi=N,wi=E,Ti=ee("toStringTag"),Oi=Object,Si="Arguments"===wi(function(){return arguments}()),Pi=bi?wi:function(t){var e,r,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(e=Oi(t),Ti))?r:Si?wi(e):"Object"===(n=wi(e))&&gi(e.callee)?"Arguments":n},Ei=Pi,ji=wt,Ai=x,Ii=pi,Ui=ee("iterator"),Ri=function(t){if(!Ai(t))return ji(t,Ui)||ji(t,"@@iterator")||Ii[Ei(t)]},xi=c,Di=mt,Ci=De,Bi=dt,ki=Ri,_i=TypeError,Fi=c,Li=De,Ni=wt,Mi=hi,$i=c,qi=De,Wi=dt,Hi=function(t){return void 0!==t&&(di.Array===t||yi[li]===t)},Gi=cn,Vi=G,zi=function(t,e){var r=arguments.length<2?ki(t):e;if(Di(r))return Ci(xi(r,t));throw new _i(Bi(t)+" is not iterable")},Xi=Ri,Ji=function(t,e,r){var n,o;Li(t);try{if(!(n=Ni(t,"return"))){if("throw"===e)throw r;return r}n=Fi(n,t)}catch(t){o=!0,n=t}if("throw"===e)throw r;if(o)throw n;return Li(n),r},Yi=TypeError,Ki=function(t,e){this.stopped=t,this.result=e},Zi=Ki.prototype,Qi=function(t,e,r){var n,o,i,a,s,u,c,f=r&&r.that,h=!(!r||!r.AS_ENTRIES),p=!(!r||!r.IS_RECORD),d=!(!r||!r.IS_ITERATOR),l=!(!r||!r.INTERRUPTED),y=Mi(e,f),v=function(t){return n&&Ji(n,"normal",t),new Ki(!0,t)},m=function(t){return h?(qi(t),l?y(t[0],t[1],v):y(t[0],t[1])):l?y(t,v):y(t)};if(p)n=t.iterator;else if(d)n=t;else{if(!(o=Xi(t)))throw new Yi(Wi(t)+" is not iterable");if(Hi(o)){for(i=0,a=Gi(t);a>i;i++)if((s=m(t[i]))&&Vi(Zi,s))return s;return new Ki(!1)}n=zi(t,o)}for(u=p?t.next:n.next;!(c=$i(u,n)).done;){try{s=m(c.value)}catch(t){Ji(n,"throw",t)}if("object"==typeof s&&s&&Vi(Zi,s))return s}return new Ki(!1)},ta=Pi,ea=String,ra=function(t){if("Symbol"===ta(t))throw new TypeError("Cannot convert a Symbol value to a string");return ea(t)},na=ra,oa=Zn,ia=G,aa=so,sa=go,ua=kn,ca=Go,fa=Ve,ha=v,pa=function(t,e){Vo(e)&&"cause"in e&&zo(t,"cause",e.cause)},da=function(t,e,r,n){ni&&(oi?oi(t,e):ei(t,"stack",ri(r,n)))},la=Qi,ya=function(t,e){return void 0===t?arguments.length<2?"":e:na(t)},va=ee("toStringTag"),ma=Error,ba=[].push,ga=function(t,e){var r,n=ia(wa,this);sa?r=sa(new ma,n?aa(this):wa):(r=n?this:ca(wa),fa(r,va,"Error")),void 0!==e&&fa(r,"message",ya(e)),da(r,ga,r.stack,1),arguments.length>2&&pa(r,arguments[2]);var o=[];return la(t,ba,{that:o}),fa(r,"errors",o),r};sa?sa(ga,ma):ua(ga,ma,{name:!0});var wa=ga.prototype=ca(ma.prototype,{constructor:ha(1,ga),message:ha(1,""),name:ha(1,"AggregateError")});oa({global:!0,constructor:!0,arity:2},{AggregateError:ga});var Ta=ee,Oa=Go,Sa=Ae.f,Pa=Ta("unscopables"),Ea=Array.prototype;void 0===Ea[Pa]&&Sa(Ea,Pa,{configurable:!0,value:Oa(null)});var ja,Aa,Ia,Ua=o,Ra=N,xa=$,Da=so,Ca=Yr,Ba=ee("iterator"),ka=!1;[].keys&&("next"in(Ia=[].keys())?(Aa=Da(Da(Ia)))!==Object.prototype&&(ja=Aa):ka=!0);var _a=!xa(ja)||Ua((function(){var t={};return ja[Ba].call(t)!==t}));_a&&(ja={}),Ra(ja[Ba])||Ca(ja,Ba,(function(){return this}));var Fa={IteratorPrototype:ja,BUGGY_SAFARI_ITERATORS:ka},La=Ae.f,Na=$t,Ma=ee("toStringTag"),$a=function(t,e,r){t&&!r&&(t=t.prototype),t&&!Na(t,Ma)&&La(t,Ma,{configurable:!0,value:e})},qa=Fa.IteratorPrototype,Wa=Go,Ha=v,Ga=$a,Va=pi,za=function(){return this},Xa=Zn,Ja=c,Ya=N,Ka=function(t,e,r,n){var o=e+" Iterator";return t.prototype=Wa(qa,{next:Ha(+!n,r)}),Ga(t,o,!1),Va[o]=za,t},Za=so,Qa=go,ts=$a,es=Ve,rs=Yr,ns=pi,os=Qe.PROPER,is=Qe.CONFIGURABLE,as=Fa.IteratorPrototype,ss=Fa.BUGGY_SAFARI_ITERATORS,us=ee("iterator"),cs="keys",fs="values",hs="entries",ps=function(){return this},ds=function(t,e,r,n,o,i,a){Ka(r,e,n);var s,u,c,f=function(t){if(t===o&&y)return y;if(!ss&&t&&t in d)return d[t];switch(t){case cs:case fs:case hs:return function(){return new r(this,t)}}return function(){return new r(this)}},h=e+" Iterator",p=!1,d=t.prototype,l=d[us]||d["@@iterator"]||o&&d[o],y=!ss&&l||f(o),v="Array"===e&&d.entries||l;if(v&&(s=Za(v.call(new t)))!==Object.prototype&&s.next&&(Za(s)!==as&&(Qa?Qa(s,as):Ya(s[us])||rs(s,us,ps)),ts(s,h,!0)),os&&o===fs&&l&&l.name!==fs&&(is?es(d,"name",fs):(p=!0,y=function(){return Ja(l,this)})),o)if(u={values:f(fs),keys:i?y:f(cs),entries:f(hs)},a)for(c in u)(ss||p||!(c in d))&&rs(d,c,u[c]);else Xa({target:e,proto:!0,forced:ss||p},u);return d[us]!==y&&rs(d,us,y,{name:o}),ns[e]=y,u},ls=function(t,e){return{value:t,done:e}},ys=F,vs=function(t){Ea[Pa][t]=!0},ms=pi,bs=Ar,gs=Ae.f,ws=ds,Ts=ls,Os=i,Ss="Array Iterator",Ps=bs.set,Es=bs.getterFor(Ss),js=ws(Array,"Array",(function(t,e){Ps(this,{type:Ss,target:ys(t),index:0,kind:e})}),(function(){var t=Es(this),e=t.target,r=t.index++;if(!e||r>=e.length)return t.target=null,Ts(void 0,!0);switch(t.kind){case"keys":return Ts(r,!1);case"values":return Ts(e[r],!1)}return Ts([r,e[r]],!1)}),"values"),As=ms.Arguments=ms.Array;if(vs("keys"),vs("values"),vs("entries"),Os&&"values"!==As.name)try{gs(As,"name",{value:"values"})}catch(t){}var Is=Pi,Us=mi?{}.toString:function(){return"[object "+Is(this)+"]"};mi||Yr(Object.prototype,"toString",Us,{unsafe:!0});var Rs=r,xs=X,Ds=E,Cs=function(t){return xs.slice(0,t.length)===t},Bs=Cs("Bun/")?"BUN":Cs("Cloudflare-Workers")?"CLOUDFLARE":Cs("Deno/")?"DENO":Cs("Node.js/")?"NODE":Rs.Bun&&"string"==typeof Bun.version?"BUN":Rs.Deno&&"object"==typeof Deno.version?"DENO":"process"===Ds(Rs.process)?"NODE":Rs.window&&Rs.document?"BROWSER":"REST",ks="NODE"===Bs,_s=Gr,Fs=Ae,Ls=H,Ns=function(t,e,r){return r.get&&_s(r.get,e,{getter:!0}),r.set&&_s(r.set,e,{setter:!0}),Fs.f(t,e,r)},Ms=i,$s=ee("species"),qs=G,Ws=TypeError,Hs=T,Gs=o,Vs=N,zs=Pi,Xs=ar,Js=function(){},Ys=H("Reflect","construct"),Ks=/^\s*(?:class|function)\b/,Zs=Hs(Ks.exec),Qs=!Ks.test(Js),tu=function(t){if(!Vs(t))return!1;try{return Ys(Js,[],t),!0}catch(t){return!1}},eu=function(t){if(!Vs(t))return!1;switch(zs(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Qs||!!Zs(Ks,Xs(t))}catch(t){return!0}};eu.sham=!0;var ru,nu,ou,iu,au=!Ys||Gs((function(){var t;return tu(tu.call)||!tu(Object)||!tu((function(){t=!0}))||t}))?eu:tu,su=au,uu=dt,cu=TypeError,fu=De,hu=function(t){if(su(t))return t;throw new cu(uu(t)+" is not a constructor")},pu=x,du=ee("species"),lu=function(t,e){var r,n=fu(t).constructor;return void 0===n||pu(r=fu(n)[du])?e:hu(r)},yu=a,vu=Function.prototype,mu=vu.apply,bu=vu.call,gu="object"==typeof Reflect&&Reflect.apply||(yu?bu.bind(mu):function(){return bu.apply(mu,arguments)}),wu=T([].slice),Tu=TypeError,Ou=/(?:ipad|iphone|ipod).*applewebkit/i.test(X),Su=r,Pu=gu,Eu=hi,ju=N,Au=$t,Iu=o,Uu=xo,Ru=wu,xu=ye,Du=function(t,e){if(t<e)throw new Tu("Not enough arguments");return t},Cu=Ou,Bu=ks,ku=Su.setImmediate,_u=Su.clearImmediate,Fu=Su.process,Lu=Su.Dispatch,Nu=Su.Function,Mu=Su.MessageChannel,$u=Su.String,qu=0,Wu={},Hu="onreadystatechange";Iu((function(){ru=Su.location}));var Gu=function(t){if(Au(Wu,t)){var e=Wu[t];delete Wu[t],e()}},Vu=function(t){return function(){Gu(t)}},zu=function(t){Gu(t.data)},Xu=function(t){Su.postMessage($u(t),ru.protocol+"//"+ru.host)};ku&&_u||(ku=function(t){Du(arguments.length,1);var e=ju(t)?t:Nu(t),r=Ru(arguments,1);return Wu[++qu]=function(){Pu(e,void 0,r)},nu(qu),qu},_u=function(t){delete Wu[t]},Bu?nu=function(t){Fu.nextTick(Vu(t))}:Lu&&Lu.now?nu=function(t){Lu.now(Vu(t))}:Mu&&!Cu?(iu=(ou=new Mu).port2,ou.port1.onmessage=zu,nu=Eu(iu.postMessage,iu)):Su.addEventListener&&ju(Su.postMessage)&&!Su.importScripts&&ru&&"file:"!==ru.protocol&&!Iu(Xu)?(nu=Xu,Su.addEventListener("message",zu,!1)):nu=Hu in xu("script")?function(t){Uu.appendChild(xu("script"))[Hu]=function(){Uu.removeChild(this),Gu(t)}}:function(t){setTimeout(Vu(t),0)});var Ju={set:ku,clear:_u},Yu=r,Ku=i,Zu=Object.getOwnPropertyDescriptor,Qu=function(){this.head=null,this.tail=null};Qu.prototype={add:function(t){var e={item:t,next:null},r=this.tail;r?r.next=e:this.head=e,this.tail=e},get:function(){var t=this.head;if(t)return null===(this.head=t.next)&&(this.tail=null),t.item}};var tc,ec,rc,nc,oc,ic=Qu,ac=/ipad|iphone|ipod/i.test(X)&&"undefined"!=typeof Pebble,sc=/web0s(?!.*chrome)/i.test(X),uc=r,cc=function(t){if(!Ku)return Yu[t];var e=Zu(Yu,t);return e&&e.value},fc=hi,hc=Ju.set,pc=ic,dc=Ou,lc=ac,yc=sc,vc=ks,mc=uc.MutationObserver||uc.WebKitMutationObserver,bc=uc.document,gc=uc.process,wc=uc.Promise,Tc=cc("queueMicrotask");if(!Tc){var Oc=new pc,Sc=function(){var t,e;for(vc&&(t=gc.domain)&&t.exit();e=Oc.get();)try{e()}catch(t){throw Oc.head&&tc(),t}t&&t.enter()};dc||vc||yc||!mc||!bc?!lc&&wc&&wc.resolve?((nc=wc.resolve(void 0)).constructor=wc,oc=fc(nc.then,nc),tc=function(){oc(Sc)}):vc?tc=function(){gc.nextTick(Sc)}:(hc=fc(hc,uc),tc=function(){hc(Sc)}):(ec=!0,rc=bc.createTextNode(""),new mc(Sc).observe(rc,{characterData:!0}),tc=function(){rc.data=ec=!ec}),Tc=function(t){Oc.head||tc(),Oc.add(t)}}var Pc=Tc,Ec=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}},jc=r.Promise,Ac=r,Ic=jc,Uc=N,Rc=Hn,xc=ar,Dc=ee,Cc=Bs,Bc=et;Ic&&Ic.prototype;var kc=Dc("species"),_c=!1,Fc=Uc(Ac.PromiseRejectionEvent),Lc=Rc("Promise",(function(){var t=xc(Ic),e=t!==String(Ic);if(!e&&66===Bc)return!0;if(!Bc||Bc<51||!/native code/.test(t)){var r=new Ic((function(t){t(1)})),n=function(t){t((function(){}),(function(){}))};if((r.constructor={})[kc]=n,!(_c=r.then((function(){}))instanceof n))return!0}return!(e||"BROWSER"!==Cc&&"DENO"!==Cc||Fc)})),Nc={CONSTRUCTOR:Lc,REJECTION_EVENT:Fc,SUBCLASSING:_c},Mc={},$c=mt,qc=TypeError,Wc=function(t){var e,r;this.promise=new t((function(t,n){if(void 0!==e||void 0!==r)throw new qc("Bad Promise constructor");e=t,r=n})),this.resolve=$c(e),this.reject=$c(r)};Mc.f=function(t){return new Wc(t)};var Hc,Gc,Vc,zc=Zn,Xc=ks,Jc=r,Yc=c,Kc=Yr,Zc=go,Qc=$a,tf=function(t){var e=Ls(t);Ms&&e&&!e[$s]&&Ns(e,$s,{configurable:!0,get:function(){return this}})},ef=mt,rf=N,nf=$,of=function(t,e){if(qs(e,t))return t;throw new Ws("Incorrect invocation")},af=lu,sf=Ju.set,uf=Pc,cf=function(t,e){try{1===arguments.length?console.error(t):console.error(t,e)}catch(t){}},ff=Ec,hf=ic,pf=Ar,df=jc,lf=Mc,yf="Promise",vf=Nc.CONSTRUCTOR,mf=Nc.REJECTION_EVENT,bf=Nc.SUBCLASSING,gf=pf.getterFor(yf),wf=pf.set,Tf=df&&df.prototype,Of=df,Sf=Tf,Pf=Jc.TypeError,Ef=Jc.document,jf=Jc.process,Af=lf.f,If=Af,Uf=!!(Ef&&Ef.createEvent&&Jc.dispatchEvent),Rf="unhandledrejection",xf=function(t){var e;return!(!nf(t)||!rf(e=t.then))&&e},Df=function(t,e){var r,n,o,i=e.value,a=1===e.state,s=a?t.ok:t.fail,u=t.resolve,c=t.reject,f=t.domain;try{s?(a||(2===e.rejection&&Ff(e),e.rejection=1),!0===s?r=i:(f&&f.enter(),r=s(i),f&&(f.exit(),o=!0)),r===t.promise?c(new Pf("Promise-chain cycle")):(n=xf(r))?Yc(n,r,u,c):u(r)):c(i)}catch(t){f&&!o&&f.exit(),c(t)}},Cf=function(t,e){t.notified||(t.notified=!0,uf((function(){for(var r,n=t.reactions;r=n.get();)Df(r,t);t.notified=!1,e&&!t.rejection&&kf(t)})))},Bf=function(t,e,r){var n,o;Uf?((n=Ef.createEvent("Event")).promise=e,n.reason=r,n.initEvent(t,!1,!0),Jc.dispatchEvent(n)):n={promise:e,reason:r},!mf&&(o=Jc["on"+t])?o(n):t===Rf&&cf("Unhandled promise rejection",r)},kf=function(t){Yc(sf,Jc,(function(){var e,r=t.facade,n=t.value;if(_f(t)&&(e=ff((function(){Xc?jf.emit("unhandledRejection",n,r):Bf(Rf,r,n)})),t.rejection=Xc||_f(t)?2:1,e.error))throw e.value}))},_f=function(t){return 1!==t.rejection&&!t.parent},Ff=function(t){Yc(sf,Jc,(function(){var e=t.facade;Xc?jf.emit("rejectionHandled",e):Bf("rejectionhandled",e,t.value)}))},Lf=function(t,e,r){return function(n){t(e,n,r)}},Nf=function(t,e,r){t.done||(t.done=!0,r&&(t=r),t.value=e,t.state=2,Cf(t,!0))},Mf=function(t,e,r){if(!t.done){t.done=!0,r&&(t=r);try{if(t.facade===e)throw new Pf("Promise can't be resolved itself");var n=xf(e);n?uf((function(){var r={done:!1};try{Yc(n,e,Lf(Mf,r,t),Lf(Nf,r,t))}catch(e){Nf(r,e,t)}})):(t.value=e,t.state=1,Cf(t,!1))}catch(e){Nf({done:!1},e,t)}}};if(vf&&(Sf=(Of=function(t){of(this,Sf),ef(t),Yc(Hc,this);var e=gf(this);try{t(Lf(Mf,e),Lf(Nf,e))}catch(t){Nf(e,t)}}).prototype,(Hc=function(t){wf(this,{type:yf,done:!1,notified:!1,parent:!1,reactions:new hf,rejection:!1,state:0,value:null})}).prototype=Kc(Sf,"then",(function(t,e){var r=gf(this),n=Af(af(this,Of));return r.parent=!0,n.ok=!rf(t)||t,n.fail=rf(e)&&e,n.domain=Xc?jf.domain:void 0,0===r.state?r.reactions.add(n):uf((function(){Df(n,r)})),n.promise})),Gc=function(){var t=new Hc,e=gf(t);this.promise=t,this.resolve=Lf(Mf,e),this.reject=Lf(Nf,e)},lf.f=Af=function(t){return t===Of||undefined===t?new Gc(t):If(t)},rf(df)&&Tf!==Object.prototype)){Vc=Tf.then,bf||Kc(Tf,"then",(function(t,e){var r=this;return new Of((function(t,e){Yc(Vc,r,t,e)})).then(t,e)}),{unsafe:!0});try{delete Tf.constructor}catch(t){}Zc&&Zc(Tf,Sf)}zc({global:!0,constructor:!0,wrap:!0,forced:vf},{Promise:Of}),Qc(Of,yf,!1),tf(yf);var $f=ee("iterator"),qf=!1;try{var Wf=0,Hf={next:function(){return{done:!!Wf++}},return:function(){qf=!0}};Hf[$f]=function(){return this},Array.from(Hf,(function(){throw 2}))}catch(t){}var Gf=jc,Vf=function(t,e){try{if(!e&&!qf)return!1}catch(t){return!1}var r=!1;try{var n={};n[$f]=function(){return{next:function(){return{done:r=!0}}}},t(n)}catch(t){}return r},zf=Nc.CONSTRUCTOR||!Vf((function(t){Gf.all(t).then(void 0,(function(){}))})),Xf=c,Jf=mt,Yf=Mc,Kf=Ec,Zf=Qi;Zn({target:"Promise",stat:!0,forced:zf},{all:function(t){var e=this,r=Yf.f(e),n=r.resolve,o=r.reject,i=Kf((function(){var r=Jf(e.resolve),i=[],a=0,s=1;Zf(t,(function(t){var u=a++,c=!1;s++,Xf(r,e,t).then((function(t){c||(c=!0,i[u]=t,--s||n(i))}),o)})),--s||n(i)}));return i.error&&o(i.value),r.promise}});var Qf=Zn,th=Nc.CONSTRUCTOR,eh=jc,rh=H,nh=N,oh=Yr,ih=eh&&eh.prototype;if(Qf({target:"Promise",proto:!0,forced:th,real:!0},{catch:function(t){return this.then(void 0,t)}}),nh(eh)){var ah=rh("Promise").prototype.catch;ih.catch!==ah&&oh(ih,"catch",ah,{unsafe:!0})}var sh=c,uh=mt,ch=Mc,fh=Ec,hh=Qi;Zn({target:"Promise",stat:!0,forced:zf},{race:function(t){var e=this,r=ch.f(e),n=r.reject,o=fh((function(){var o=uh(e.resolve);hh(t,(function(t){sh(o,e,t).then(r.resolve,n)}))}));return o.error&&n(o.value),r.promise}});var ph=Mc;Zn({target:"Promise",stat:!0,forced:Nc.CONSTRUCTOR},{reject:function(t){var e=ph.f(this);return(0,e.reject)(t),e.promise}});var dh=De,lh=$,yh=Mc,vh=function(t,e){if(dh(t),lh(e)&&e.constructor===t)return e;var r=yh.f(t);return(0,r.resolve)(e),r.promise},mh=Zn,bh=Nc.CONSTRUCTOR,gh=vh;H("Promise"),mh({target:"Promise",stat:!0,forced:bh},{resolve:function(t){return gh(this,t)}});var wh=c,Th=mt,Oh=Mc,Sh=Ec,Ph=Qi;Zn({target:"Promise",stat:!0,forced:zf},{allSettled:function(t){var e=this,r=Oh.f(e),n=r.resolve,o=r.reject,i=Sh((function(){var r=Th(e.resolve),o=[],i=0,a=1;Ph(t,(function(t){var s=i++,u=!1;a++,wh(r,e,t).then((function(t){u||(u=!0,o[s]={status:"fulfilled",value:t},--a||n(o))}),(function(t){u||(u=!0,o[s]={status:"rejected",reason:t},--a||n(o))}))})),--a||n(o)}));return i.error&&o(i.value),r.promise}});var Eh=c,jh=mt,Ah=H,Ih=Mc,Uh=Ec,Rh=Qi,xh="No one promise resolved";Zn({target:"Promise",stat:!0,forced:zf},{any:function(t){var e=this,r=Ah("AggregateError"),n=Ih.f(e),o=n.resolve,i=n.reject,a=Uh((function(){var n=jh(e.resolve),a=[],s=0,u=1,c=!1;Rh(t,(function(t){var f=s++,h=!1;u++,Eh(n,e,t).then((function(t){h||c||(c=!0,o(t))}),(function(t){h||c||(h=!0,a[f]=t,--u||i(new r(a,xh)))}))})),--u||i(new r(a,xh))}));return a.error&&i(a.value),n.promise}});var Dh=Mc;Zn({target:"Promise",stat:!0},{withResolvers:function(){var t=Dh.f(this);return{promise:t.promise,resolve:t.resolve,reject:t.reject}}});var Ch=Zn,Bh=jc,kh=o,_h=H,Fh=N,Lh=lu,Nh=vh,Mh=Yr,$h=Bh&&Bh.prototype;if(Ch({target:"Promise",proto:!0,real:!0,forced:!!Bh&&kh((function(){$h.finally.call({then:function(){}},(function(){}))}))},{finally:function(t){var e=Lh(this,_h("Promise")),r=Fh(t);return this.then(r?function(r){return Nh(e,t()).then((function(){return r}))}:t,r?function(r){return Nh(e,t()).then((function(){throw r}))}:t)}}),Fh(Bh)){var qh=_h("Promise").prototype.finally;$h.finally!==qh&&Mh($h,"finally",qh,{unsafe:!0})}var Wh=T,Hh=en,Gh=ra,Vh=B,zh=Wh("".charAt),Xh=Wh("".charCodeAt),Jh=Wh("".slice),Yh=function(t){return function(e,r){var n,o,i=Gh(Vh(e)),a=Hh(r),s=i.length;return a<0||a>=s?t?"":void 0:(n=Xh(i,a))<55296||n>56319||a+1===s||(o=Xh(i,a+1))<56320||o>57343?t?zh(i,a):n:t?Jh(i,a,a+2):o-56320+(n-55296<<10)+65536}},Kh={codeAt:Yh(!1),charAt:Yh(!0)}.charAt,Zh=ra,Qh=Ar,tp=ds,ep=ls,rp="String Iterator",np=Qh.set,op=Qh.getterFor(rp);tp(String,"String",(function(t){np(this,{type:rp,string:Zh(t),index:0})}),(function(){var t,e=op(this),r=e.string,n=e.index;return n>=r.length?ep(void 0,!0):(t=Kh(r,n),e.index+=t.length,ep(t,!1))})),r.Promise;var ip=ye("span").classList,ap=ip&&ip.constructor&&ip.constructor.prototype,sp=ap===Object.prototype?void 0:ap,up=r,cp={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},fp=sp,hp=js,pp=Ve,dp=$a,lp=ee("iterator"),yp=hp.values,vp=function(t,e){if(t){if(t[lp]!==yp)try{pp(t,lp,yp)}catch(e){t[lp]=yp}if(dp(t,e,!0),cp[e])for(var r in hp)if(t[r]!==hp[r])try{pp(t,r,hp[r])}catch(e){t[r]=hp[r]}}};for(var mp in cp)vp(up[mp]&&up[mp].prototype,mp);vp(fp,"DOMTokenList");var bp="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||"undefined"!=typeof global&&global||{},gp="URLSearchParams"in bp,wp="Symbol"in bp&&"iterator"in Symbol,Tp="FileReader"in bp&&"Blob"in bp&&function(){try{return new Blob,!0}catch(t){return!1}}(),Op="FormData"in bp,Sp="ArrayBuffer"in bp;if(Sp)var Pp=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],Ep=ArrayBuffer.isView||function(t){return t&&Pp.indexOf(Object.prototype.toString.call(t))>-1};function jp(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(t)||""===t)throw new TypeError('Invalid character in header field name: "'+t+'"');return t.toLowerCase()}function Ap(t){return"string"!=typeof t&&(t=String(t)),t}function Ip(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return wp&&(e[Symbol.iterator]=function(){return e}),e}function Up(t){this.map={},t instanceof Up?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){if(2!=t.length)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+t.length);this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function Rp(t){if(!t._noBody)return t.bodyUsed?Promise.reject(new TypeError("Already read")):void(t.bodyUsed=!0)}function xp(t){return new Promise((function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}}))}function Dp(t){var e=new FileReader,r=xp(e);return e.readAsArrayBuffer(t),r}function Cp(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function Bp(){return this.bodyUsed=!1,this._initBody=function(t){var e;this.bodyUsed=this.bodyUsed,this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:Tp&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:Op&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:gp&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():Sp&&Tp&&((e=t)&&DataView.prototype.isPrototypeOf(e))?(this._bodyArrayBuffer=Cp(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):Sp&&(ArrayBuffer.prototype.isPrototypeOf(t)||Ep(t))?this._bodyArrayBuffer=Cp(t):this._bodyText=t=Object.prototype.toString.call(t):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):gp&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},Tp&&(this.blob=function(){var t=Rp(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var t=Rp(this);return t||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}if(Tp)return this.blob().then(Dp);throw new Error("could not read as ArrayBuffer")},this.text=function(){var t=Rp(this);if(t)return t;if(this._bodyBlob)return function(t){var e=new FileReader,r=xp(e),n=/charset=([A-Za-z0-9_-]+)/.exec(t.type),o=n?n[1]:"utf-8";return e.readAsText(t,o),r}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),n=0;n<e.length;n++)r[n]=String.fromCharCode(e[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},Op&&(this.formData=function(){return this.text().then(Fp)}),this.json=function(){return this.text().then(JSON.parse)},this}Up.prototype.append=function(t,e){t=jp(t),e=Ap(e);var r=this.map[t];this.map[t]=r?r+", "+e:e},Up.prototype.delete=function(t){delete this.map[jp(t)]},Up.prototype.get=function(t){return t=jp(t),this.has(t)?this.map[t]:null},Up.prototype.has=function(t){return this.map.hasOwnProperty(jp(t))},Up.prototype.set=function(t,e){this.map[jp(t)]=Ap(e)},Up.prototype.forEach=function(t,e){for(var r in this.map)this.map.hasOwnProperty(r)&&t.call(e,this.map[r],r,this)},Up.prototype.keys=function(){var t=[];return this.forEach((function(e,r){t.push(r)})),Ip(t)},Up.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),Ip(t)},Up.prototype.entries=function(){var t=[];return this.forEach((function(e,r){t.push([r,e])})),Ip(t)},wp&&(Up.prototype[Symbol.iterator]=Up.prototype.entries);var kp=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function _p(t,e){if(!(this instanceof _p))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var r=(e=e||{}).body;if(t instanceof _p){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new Up(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,r||null==t._bodyInit||(r=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new Up(e.headers)),this.method=function(t){var e=t.toUpperCase();return kp.indexOf(e)>-1?e:t}(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal||function(){if("AbortController"in bp)return(new AbortController).signal}(),this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&r)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(r),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==e.cache&&"no-cache"!==e.cache)){var n=/([?&])_=[^&]*/;if(n.test(this.url))this.url=this.url.replace(n,"$1_="+(new Date).getTime());else{this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function Fp(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var r=t.split("="),n=r.shift().replace(/\+/g," "),o=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(n),decodeURIComponent(o))}})),e}function Lp(t,e){if(!(this instanceof Lp))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=void 0===e.statusText?"":""+e.statusText,this.headers=new Up(e.headers),this.url=e.url||"",this._initBody(t)}_p.prototype.clone=function(){return new _p(this,{body:this._bodyInit})},Bp.call(_p.prototype),Bp.call(Lp.prototype),Lp.prototype.clone=function(){return new Lp(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new Up(this.headers),url:this.url})},Lp.error=function(){var t=new Lp(null,{status:200,statusText:""});return t.ok=!1,t.status=0,t.type="error",t};var Np=[301,302,303,307,308];Lp.redirect=function(t,e){if(-1===Np.indexOf(e))throw new RangeError("Invalid status code");return new Lp(null,{status:e,headers:{location:t}})};var Mp=bp.DOMException;try{new Mp}catch(t){(Mp=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack}).prototype=Object.create(Error.prototype),Mp.prototype.constructor=Mp}function $p(t,e){return new Promise((function(r,n){var o=new _p(t,e);if(o.signal&&o.signal.aborted)return n(new Mp("Aborted","AbortError"));var i=new XMLHttpRequest;function a(){i.abort()}if(i.onload=function(){var t,e,n={statusText:i.statusText,headers:(t=i.getAllResponseHeaders()||"",e=new Up,t.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(t){return 0===t.indexOf("\n")?t.substr(1,t.length):t})).forEach((function(t){var r=t.split(":"),n=r.shift().trim();if(n){var o=r.join(":").trim();try{e.append(n,o)}catch(t){console.warn("Response "+t.message)}}})),e)};0===o.url.indexOf("file://")&&(i.status<200||i.status>599)?n.status=200:n.status=i.status,n.url="responseURL"in i?i.responseURL:n.headers.get("X-Request-URL");var a="response"in i?i.response:i.responseText;setTimeout((function(){r(new Lp(a,n))}),0)},i.onerror=function(){setTimeout((function(){n(new TypeError("Network request failed"))}),0)},i.ontimeout=function(){setTimeout((function(){n(new TypeError("Network request timed out"))}),0)},i.onabort=function(){setTimeout((function(){n(new Mp("Aborted","AbortError"))}),0)},i.open(o.method,function(t){try{return""===t&&bp.location.href?bp.location.href:t}catch(e){return t}}(o.url),!0),"include"===o.credentials?i.withCredentials=!0:"omit"===o.credentials&&(i.withCredentials=!1),"responseType"in i&&(Tp?i.responseType="blob":Sp&&(i.responseType="arraybuffer")),e&&"object"==typeof e.headers&&!(e.headers instanceof Up||bp.Headers&&e.headers instanceof bp.Headers)){var s=[];Object.getOwnPropertyNames(e.headers).forEach((function(t){s.push(jp(t)),i.setRequestHeader(t,Ap(e.headers[t]))})),o.headers.forEach((function(t,e){-1===s.indexOf(e)&&i.setRequestHeader(e,t)}))}else o.headers.forEach((function(t,e){i.setRequestHeader(e,t)}));o.signal&&(o.signal.addEventListener("abort",a),i.onreadystatechange=function(){4===i.readyState&&o.signal.removeEventListener("abort",a)}),i.send(void 0===o._bodyInit?null:o._bodyInit)}))}$p.polyfill=!0,bp.fetch||(bp.fetch=$p,bp.Headers=Up,bp.Request=_p,bp.Response=Lp);var qp=function(t,e){return qp=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},qp(t,e)};function Wp(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}qp(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}function Hp(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{u(n.next(t))}catch(t){i(t)}}function s(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))}function Gp(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}}"function"==typeof SuppressedError&&SuppressedError;var Vp,zp=function(){function t(){}return t.getIndexFromTimestamps=function(t,e){var r=1e3*t*90,n=-1;if(e.length>0&&r<e[e.length-1])for(var o=0,i=e;o<i.length;o++){if(i[o]>r)break;n++}return n},t}(),Xp=function(){function t(){this.updateTimestamps=[],this.previousTimestampIndex=0}return t.prototype.setUpdateTimestamps=function(t){this.updateTimestamps=t,this.onTimestampsUpdated&&this.onTimestampsUpdated()},t.prototype.renderAtTimestamp=function(t){var e=zp.getIndexFromTimestamps(t,this.updateTimestamps);this.renderAtIndex(e)},t.prototype.renderAtIndex=function(t){this.previousTimestampIndex!==t&&(this.previousTimestampIndex=t,this.render(t))},t}(),Jp=function(t){function e(e){var r,n=t.call(this)||this;n.$onWorkerMessage=function(t){n.onWorkerMessage(t)};var o=null!==(r=e.workerUrl)&&void 0!==r?r:"libpgs.worker.js";return n.worker=new Worker(o),n.worker.onmessage=n.$onWorkerMessage,n}return Wp(e,t),e.prototype.loadFromUrl=function(t){this.worker.postMessage({op:"loadFromUrl",url:t})},e.prototype.loadFromBuffer=function(t){this.worker.postMessage({op:"loadFromBuffer",buffer:t})},e.prototype.onWorkerMessage=function(t){if("updateTimestamps"===t.data.op)this.setUpdateTimestamps(t.data.updateTimestamps)},e.prototype.dispose=function(){this.worker.terminate()},e}(Xp),Yp=function(t){function e(e,r){var n=t.call(this,e)||this,o=r.transferControlToOffscreen();return n.worker.postMessage({op:"init",canvas:o},[o]),n}return Wp(e,t),e.prototype.render=function(t){this.worker.postMessage({op:"render",index:t})},e}(Jp),Kp=function(){function t(){this.empty=!0,this.x=0,this.y=0,this.width=0,this.height=0}return t.prototype.reset=function(){this.empty=!0,this.x=0,this.y=0,this.width=0,this.height=0},t.prototype.set=function(t,e,r,n){void 0===r&&(r=0),void 0===n&&(n=0),this.empty=!1,this.x=t,this.y=e,this.width=r,this.height=n},t.prototype.union=function(t,e,r,n){void 0===r&&(r=0),void 0===n&&(n=0),this.empty?(this.empty=!1,this.x=t,this.y=e,this.width=r,this.height=n):(t<this.x&&(this.width+=this.x-t,this.x=t),e<this.y&&(this.height+=this.y-e,this.y=e),t+r>this.x+this.width&&(this.width=t+r-this.x),e+n>this.y+this.height&&(this.height=e+n-this.y))},t}(),Zp=function(){function t(t){this.dirtyArea=new Kp,this.canvas=t,this.context=t.getContext("2d")}return t.prototype.draw=function(t){this.canvas&&this.context&&(this.dirtyArea.empty||(this.context.clearRect(this.dirtyArea.x,this.dirtyArea.y,this.dirtyArea.width,this.dirtyArea.height),this.dirtyArea.reset()),t&&(this.canvas.width==t.width&&this.canvas.height==t.height||(this.canvas.width=t.width,this.canvas.height=t.height),this.drawSubtitleData(t,this.dirtyArea)))},t.prototype.drawSubtitleData=function(t,e){for(var r=0,n=t.compositionData;r<n.length;r++){var o=n[r];this.drawSubtitleCompositionData(o,e)}},t.prototype.drawSubtitleCompositionData=function(t,e){var r;null===(r=this.context)||void 0===r||r.putImageData(t.pixelData,t.x,t.y),null==e||e.union(t.window.horizontalPosition,t.window.verticalPosition,t.pixelData.width,t.pixelData.height)},t}(),Qp=function(){function t(t){this.$position=0,this.array=t}return Object.defineProperty(t.prototype,"position",{get:function(){return this.$position},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"length",{get:function(){return this.array.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"eof",{get:function(){return this.position>=this.length},enumerable:!1,configurable:!0}),t.prototype.readByte=function(){return this.array[this.$position++]},t.prototype.readBytes=function(t){var e=this.array.slice(this.$position,this.$position+t);return this.$position+=t,e},t}(),td=function(){function t(t){t instanceof Uint8Array?this.baseReader=new Qp(t):this.baseReader=t}return Object.defineProperty(t.prototype,"position",{get:function(){return this.baseReader.position},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"length",{get:function(){return this.baseReader.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"eof",{get:function(){return this.baseReader.eof},enumerable:!1,configurable:!0}),t.prototype.readUInt8=function(){return this.baseReader.readByte()},t.prototype.readUInt16=function(){return(this.baseReader.readByte()<<8)+this.baseReader.readByte()},t.prototype.readUInt24=function(){return(this.baseReader.readByte()<<16)+(this.baseReader.readByte()<<8)+this.baseReader.readByte()},t.prototype.readUInt32=function(){return(this.baseReader.readByte()<<24)+(this.baseReader.readByte()<<16)+(this.baseReader.readByte()<<8)+this.baseReader.readByte()},t.prototype.readBytes=function(t){return this.baseReader.readBytes(t)},t}();!function(t){t[t.paletteDefinition=20]="paletteDefinition",t[t.objectDefinition=21]="objectDefinition",t[t.presentationComposition=22]="presentationComposition",t[t.windowDefinition=23]="windowDefinition",t[t.end=128]="end"}(Vp||(Vp={}));var ed,rd=function(){function t(){this.id=0,this.windowId=0,this.croppedFlag=0,this.horizontalPosition=0,this.verticalPosition=0,this.croppingHorizontalPosition=0,this.croppingVerticalPosition=0,this.croppingWidth=0,this.croppingHeightPosition=0}return Object.defineProperty(t.prototype,"hasCropping",{get:function(){return!!(128&this.croppedFlag)},enumerable:!1,configurable:!0}),t}(),nd=function(){function t(){this.width=0,this.height=0,this.frameRate=0,this.compositionNumber=0,this.compositionState=0,this.paletteUpdateFlag=0,this.paletteId=0,this.compositionObjects=[]}return Object.defineProperty(t.prototype,"segmentType",{get:function(){return Vp.presentationComposition},enumerable:!1,configurable:!0}),t.prototype.read=function(t,e){this.width=t.readUInt16(),this.height=t.readUInt16(),this.frameRate=t.readUInt8(),this.compositionNumber=t.readUInt16(),this.compositionState=t.readUInt8(),this.paletteUpdateFlag=t.readUInt8(),this.paletteId=t.readUInt8();var r=t.readUInt8();this.compositionObjects=[];for(var n=0;n<r;n++){var o=new rd;o.id=t.readUInt16(),o.windowId=t.readUInt8(),o.croppedFlag=t.readUInt8(),o.horizontalPosition=t.readUInt16(),o.verticalPosition=t.readUInt16(),o.hasCropping&&(o.croppingHorizontalPosition=t.readUInt16(),o.croppingVerticalPosition=t.readUInt16(),o.croppingWidth=t.readUInt16(),o.croppingHeightPosition=t.readUInt16()),this.compositionObjects.push(o)}},t}(),od=function(){function t(){this.id=0,this.versionNumber=0,this.rgba=[]}return Object.defineProperty(t.prototype,"segmentType",{get:function(){return Vp.paletteDefinition},enumerable:!1,configurable:!0}),t.prototype.read=function(e,r){this.id=e.readUInt8(),this.versionNumber=e.readUInt8();var n=(r-2)/5,o=new Uint32Array(1),i=new Uint8Array(o.buffer);this.rgba=[];for(var a=0;a<n;a++){var s=e.readUInt8(),u=e.readUInt8(),c=e.readUInt8()-128,f=e.readUInt8()-128,h=e.readUInt8(),p=t.clamp(Math.round(u+1.402*c),0,255),d=t.clamp(Math.round(u-.34414*f-.71414*c),0,255),l=t.clamp(Math.round(u+1.772*f),0,255);i[0]=p,i[1]=d,i[2]=l,i[3]=h,this.rgba[s]=o[0]}},t.clamp=function(t,e,r){return t<e?e:t>r?r:t},t}(),id=function(){function t(){this.id=0,this.versionNumber=0,this.lastInSequenceFlag=0,this.width=0,this.height=0,this.dataLength=0}return Object.defineProperty(t.prototype,"isFirstInSequence",{get:function(){return!!(128&this.lastInSequenceFlag)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isLastInSequence",{get:function(){return!!(64&this.lastInSequenceFlag)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"segmentType",{get:function(){return Vp.objectDefinition},enumerable:!1,configurable:!0}),t.prototype.read=function(t,e){this.id=t.readUInt16(),this.versionNumber=t.readUInt8(),this.lastInSequenceFlag=t.readUInt8(),this.isFirstInSequence?(this.dataLength=t.readUInt24(),this.width=t.readUInt16(),this.height=t.readUInt16(),this.data=t.readBytes(e-11)):this.data=t.readBytes(e-4)},t}(),ad=function(){this.id=0,this.horizontalPosition=0,this.verticalPosition=0,this.width=0,this.height=0},sd=function(){function t(){this.windows=[]}return Object.defineProperty(t.prototype,"segmentType",{get:function(){return Vp.windowDefinition},enumerable:!1,configurable:!0}),t.prototype.read=function(t,e){var r=t.readUInt8();this.windows=[];for(var n=0;n<r;n++){var o=new ad;o.id=t.readUInt8(),o.horizontalPosition=t.readUInt16(),o.verticalPosition=t.readUInt16(),o.width=t.readUInt16(),o.height=t.readUInt16(),this.windows.push(o)}},t}(),ud=function(){function t(){this.presentationTimestamp=0,this.decodingTimestamp=0,this.paletteDefinitions=[],this.objectDefinitions=[],this.windowDefinitions=[]}return t.prototype.read=function(t,e){return Hp(this,void 0,void 0,(function(){var r,n,o,i,a,s,u,c,f;return Gp(this,(function(h){switch(h.label){case 0:this.presentationTimestamp=0,this.decodingTimestamp=0,this.presentationComposition=void 0,this.paletteDefinitions=[],this.objectDefinitions=[],this.windowDefinitions=[],r=void 0,"requestData"in t.baseReader&&(r=t.baseReader),h.label=1;case 1:return n=0,o=0,e?[4,null==r?void 0:r.requestData(10)]:[3,3];case 2:if(h.sent(),20551!=t.readUInt16())throw new Error("Invalid magic number!");n=t.readUInt32(),o=t.readUInt32(),h.label=3;case 3:return[4,null==r?void 0:r.requestData(3)];case 4:return h.sent(),i=t.readUInt8(),a=t.readUInt16(),[4,null==r?void 0:r.requestData(a)];case 5:switch(h.sent(),i){case Vp.paletteDefinition:(s=new od).read(t,a),this.paletteDefinitions.push(s);break;case Vp.objectDefinition:(u=new id).read(t,a),this.objectDefinitions.push(u);break;case Vp.presentationComposition:(c=new nd).read(t,a),this.presentationComposition=c,this.presentationTimestamp=n,this.decodingTimestamp=o;break;case Vp.windowDefinition:(f=new sd).read(t,a),this.windowDefinitions.push(f);break;case Vp.end:return[2];default:throw new Error("Unsupported segment type ".concat(i))}return[3,1];case 6:return[2]}}))}))},t}(),cd=function(){function t(t){this.$position=0,this.subReaderIndex=0,this.subReaders=t.map((function(t){return t instanceof Uint8Array?new Qp(t):t}));for(var e=0,r=0,n=t;r<n.length;r++){e+=n[r].length}this.$length=e}return t.prototype.push=function(t){t instanceof Uint8Array?this.subReaders.push(new Qp(t)):this.subReaders.push(t),this.$length+=t.length},Object.defineProperty(t.prototype,"position",{get:function(){return this.$position},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"length",{get:function(){return this.$length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"eof",{get:function(){return this.position>=this.length},enumerable:!1,configurable:!0}),t.prototype.readByte=function(){for(;this.subReaders[this.subReaderIndex].position>=this.subReaders[this.subReaderIndex].length;)this.subReaderIndex++;return this.$position++,this.subReaders[this.subReaderIndex].readByte()},t.prototype.readBytes=function(t){for(var e=new Uint8Array(t),r=0;r<t;r++)e[r]=this.readByte();return e},t}(),fd=function(){function t(t){this.$eof=!1,this.stream=t,this.reader=new cd([])}return Object.defineProperty(t.prototype,"position",{get:function(){return this.reader.position},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"length",{get:function(){return this.reader.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"eof",{get:function(){return this.$eof},enumerable:!1,configurable:!0}),t.prototype.readByte=function(){return this.reader.readByte()},t.prototype.readBytes=function(t){return this.reader.readBytes(t)},t.prototype.requestData=function(){return Hp(this,arguments,void 0,(function(t){var e,r,n;return void 0===t&&(t=0),Gp(this,(function(o){switch(o.label){case 0:return this.reader.position+t+1>this.reader.length&&!this.$eof?[4,this.stream.read()]:[3,2];case 1:return e=o.sent(),r=e.value,n=e.done,r&&this.reader.push(r),n&&(this.$eof=!0),[3,0];case 2:return[2,this.reader.position+t<=this.reader.length]}}))}))},t}(),hd=function(t,e,r){this.width=t,this.height=e,this.compositionData=r},pd=function(t,e,r,n){this.x=t,this.y=e,this.window=r,this.pixelData=n},dd=function(){function t(){}return t.decode=function(t,e,r){t instanceof Uint8Array&&(t=new Qp(t));for(var n=0;t.position<t.length;){var o=t.readByte();if(0==o){var i=t.readByte();if(0!=i){var a=!!(128&i),s=63&i;!!(64&i)&&(s=(s<<8)+t.readByte());for(var u=a?t.readByte():0,c=0;c<s;c++)r[n++]=e[u]}}else r[n++]=e[o]}return n},t}(),ld=function(){function t(){this.displaySets=[],this.updateTimestamps=[]}return t.prototype.loadFromUrl=function(t,e){return Hp(this,void 0,void 0,(function(){var r,n,o,i,a;return Gp(this,(function(s){switch(s.label){case 0:return[4,fetch(t)];case 1:if(!(r=s.sent()).ok)throw new Error("HTTP error: ".concat(r.status));return(n=null===(a=r.body)||void 0===a?void 0:a.getReader())?(o=new fd(n),[3,4]):[3,2];case 2:return[4,r.arrayBuffer()];case 3:i=s.sent(),o=new Qp(new Uint8Array(i)),s.label=4;case 4:return[4,this.loadFromReader(o,e)];case 5:return s.sent(),[2]}}))}))},t.prototype.loadFromBuffer=function(t,e){return Hp(this,void 0,void 0,(function(){return Gp(this,(function(r){switch(r.label){case 0:return[4,this.loadFromReader(new Qp(new Uint8Array(t)),e)];case 1:return r.sent(),[2]}}))}))},t.prototype.loadFromReader=function(t,e){return Hp(this,void 0,void 0,(function(){var r,n,o,i;return Gp(this,(function(a){switch(a.label){case 0:this.displaySets=[],this.updateTimestamps=[],this.cachedSubtitleData=void 0,r=performance.now(),n=new td(t),a.label=1;case 1:return t.eof?[3,3]:[4,(o=new ud).read(n,!0)];case 2:return a.sent(),this.displaySets.push(o),this.updateTimestamps.push(o.presentationTimestamp),(null==e?void 0:e.onProgress)&&(i=performance.now())>r+1e3&&(r=i,e.onProgress()),[3,1];case 3:return(null==e?void 0:e.onProgress)&&e.onProgress(),[2]}}))}))},t.prototype.cacheSubtitleAtIndex=function(t){var e=this.getSubtitleAtIndex(t);this.cachedSubtitleData={index:t,data:e}},t.prototype.getSubtitleAtTimestamp=function(t){var e=zp.getIndexFromTimestamps(t,this.updateTimestamps);return this.getSubtitleAtIndex(e)},t.prototype.getSubtitleAtIndex=function(t){var e;if(this.cachedSubtitleData&&this.cachedSubtitleData.index===t)return this.cachedSubtitleData.data;if(!(t<0||t>=this.displaySets.length)){var r=this.displaySets[t];if(r.presentationComposition){for(var n=[],o=[],i=[],a=t;a>=0;){var s=this.displaySets[a];n.unshift.apply(n,s.objectDefinitions),o.unshift.apply(o,s.paletteDefinitions);for(var u=0,c=s.windowDefinitions;u<c.length;u++){var f=c[u];i.unshift.apply(i,f.windows)}if(0!==(null===(e=this.displaySets[a].presentationComposition)||void 0===e?void 0:e.compositionState))break;a--}var h=o.find((function(t){var e;return t.id===(null===(e=r.presentationComposition)||void 0===e?void 0:e.paletteId)}));if(h){for(var p=[],d=function(t){var e=i.find((function(e){return e.id===t.windowId}));if(!e)return"continue";var r=l.getPixelDataFromComposition(t,h,n);r&&p.push(new pd(t.horizontalPosition,t.verticalPosition,e,r))},l=this,y=0,v=r.presentationComposition.compositionObjects;y<v.length;y++){d(v[y])}if(0!==p.length)return new hd(r.presentationComposition.width,r.presentationComposition.height,p)}}}},t.prototype.getPixelDataFromComposition=function(t,e,r){for(var n=0,o=0,i=[],a=0,s=r;a<s.length;a++){var u=s[a];u.id==t.id&&(u.isFirstInSequence&&(n=u.width,o=u.height),u.data&&i.push(u.data))}if(0!=i.length){var c=new cd(i);if("undefined"!=typeof document){var f=document.createElement("canvas").getContext("2d").createImageData(n,o),h=new Uint32Array(f.data.buffer);return dd.decode(c,e.rgba,h),f}h=new Uint32Array(n*o);return dd.decode(c,e.rgba,h),new ImageData(new Uint8ClampedArray(h.buffer),n,o)}},t}(),yd=function(t){function e(e,r){var n=t.call(this)||this;return n.pgs=new ld,n.renderer=new Zp(r),n}return Wp(e,t),e.prototype.render=function(t){var e=this,r=this.pgs.getSubtitleAtIndex(t);requestAnimationFrame((function(){e.renderer.draw(r)})),this.pgs.cacheSubtitleAtIndex(t+1)},e.prototype.loadFromUrl=function(t){var e=this;this.pgs.loadFromUrl(t,{onProgress:function(){e.invokeTimestampsUpdate()}}).then((function(){e.invokeTimestampsUpdate()}))},e.prototype.loadFromBuffer=function(t){var e=this;this.pgs.loadFromBuffer(t).then((function(){e.invokeTimestampsUpdate()}))},e.prototype.invokeTimestampsUpdate=function(){this.setUpdateTimestamps(this.pgs.updateTimestamps)},e.prototype.dispose=function(){},e}(Xp),vd=function(t){function e(e,r){var n=t.call(this,e)||this;return n.renderer=new Zp(r),n.worker.postMessage({op:"init"}),n}return Wp(e,t),e.prototype.render=function(t){this.worker.postMessage({op:"requestSubtitleData",index:t})},e.prototype.onWorkerMessage=function(e){if("subtitleData"===e.data.op){var r=e.data.subtitleData;this.renderer&&this.renderer.draw(r)}else t.prototype.onWorkerMessage.call(this,e)},e}(Jp);!function(t){t.worker="worker",t.workerWithoutOffscreenCanvas="workerWithoutOffscreenCanvas",t.mainThread="mainThread"}(ed||(ed={}));var md=function(){function t(){}return t.isWorkerSupported=function(){return!!Worker},t.isOffscreenCanvasSupported=function(){return!!HTMLCanvasElement.prototype.transferControlToOffscreen},t.getRendererModeByPlatform=function(){var t=navigator.userAgent,e=/Chrome\/(\d+)/.exec(t),r=e?parseInt(e[1]):void 0,n=/Firefox\/(\d+)/.exec(t),o=n?parseInt(n[1]):void 0,i=navigator.userAgent.indexOf("Web0S")>=0;if(r&&r<36)return ed.mainThread;if(o&&o<25)return ed.mainThread;if(i&&void 0===r)return ed.mainThread;if(i&&r&&r<=68)return ed.mainThread;var a=this.isWorkerSupported(),s=this.isOffscreenCanvasSupported();return a?s?ed.worker:ed.workerWithoutOffscreenCanvas:ed.mainThread},t}(),bd=function(){function t(t){var e,r=this;if(this.$timeOffset=0,this.onTimeUpdate=function(){r.renderAtVideoTimestamp()},this.$aspectRatio="contain",t.video&&(this.video=t.video),t.canvas)this.canvas=t.canvas,this.canvasOwner=!1;else{if(!this.video)throw new Error("No canvas or video element was provided!");this.canvas=this.createCanvasElement(),this.canvasOwner=!0,this.video.parentElement.appendChild(this.canvas)}this.implementation=this.createPgsRenderer(t),this.implementation.onTimestampsUpdated=function(){r.renderAtVideoTimestamp()},this.$timeOffset=null!==(e=t.timeOffset)&&void 0!==e?e:0,t.aspectRatio&&(this.aspectRatio=t.aspectRatio),t.subUrl&&this.loadFromUrl(t.subUrl),this.registerVideoEvents()}return t.prototype.createPgsRenderer=function(t){var e;switch(null!==(e=t.mode)&&void 0!==e?e:md.getRendererModeByPlatform()){case ed.worker:return new Yp(t,this.canvas);case ed.workerWithoutOffscreenCanvas:return new vd(t,this.canvas);case ed.mainThread:return new yd(t,this.canvas)}},t.prototype.loadFromUrl=function(t){this.implementation.loadFromUrl(t)},t.prototype.loadFromBuffer=function(t){this.implementation.loadFromBuffer(t)},t.prototype.renderAtTimestamp=function(t){this.implementation.renderAtTimestamp(t)},Object.defineProperty(t.prototype,"timeOffset",{get:function(){return this.$timeOffset},set:function(t){this.$timeOffset!==t&&(this.$timeOffset=t,this.renderAtVideoTimestamp())},enumerable:!1,configurable:!0}),t.prototype.registerVideoEvents=function(){var t;null===(t=this.video)||void 0===t||t.addEventListener("timeupdate",this.onTimeUpdate)},t.prototype.unregisterVideoEvents=function(){var t;null===(t=this.video)||void 0===t||t.removeEventListener("timeupdate",this.onTimeUpdate)},t.prototype.renderAtVideoTimestamp=function(){this.video&&this.renderAtTimestamp(this.video.currentTime+this.$timeOffset)},t.prototype.createCanvasElement=function(){var t=document.createElement("canvas");return t.style.position="absolute",t.style.top="0",t.style.left="0",t.style.right="0",t.style.bottom="0",t.style.pointerEvents="none",t.style.objectFit=this.$aspectRatio,t.style.width="100%",t.style.height="100%",t},t.prototype.destroyCanvasElement=function(){this.canvas.remove()},Object.defineProperty(t.prototype,"aspectRatio",{get:function(){return this.$aspectRatio},set:function(t){this.$aspectRatio=t,this.canvas.style.objectFit=this.$aspectRatio},enumerable:!1,configurable:!0}),t.prototype.dispose=function(){this.implementation.dispose(),this.unregisterVideoEvents(),this.canvasOwner&&this.destroyCanvasElement()},t}();export{bd as PgsRenderer};

@@ -1,1 +0,1 @@

var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},e=function(t){return t&&t.Math===Math&&t},r=e("object"==typeof globalThis&&globalThis)||e("object"==typeof window&&window)||e("object"==typeof self&&self)||e("object"==typeof t&&t)||e("object"==typeof t&&t)||function(){return this}()||Function("return this")(),n={},o=function(t){try{return!!t()}catch(t){return!0}},i=!o((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})),a=!o((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})),s=a,u=Function.prototype.call,c=s?u.bind(u):function(){return u.apply(u,arguments)},f={},h={}.propertyIsEnumerable,p=Object.getOwnPropertyDescriptor,d=p&&!h.call({1:2},1);f.f=d?function(t){var e=p(this,t);return!!e&&e.enumerable}:h;var l,y,v=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},b=a,g=Function.prototype,m=g.call,w=b&&g.bind.bind(m,m),S=b?w:function(t){return function(){return m.apply(t,arguments)}},O=S,T=O({}.toString),P=O("".slice),j=function(t){return P(T(t),8,-1)},A=o,E=j,I=Object,x=S("".split),R=A((function(){return!I("z").propertyIsEnumerable(0)}))?function(t){return"String"===E(t)?x(t,""):I(t)}:I,U=function(t){return null==t},D=U,B=TypeError,C=function(t){if(D(t))throw new B("Can't call method on "+t);return t},_=R,F=C,L=function(t){return _(F(t))},k="object"==typeof document&&document.all,N=void 0===k&&void 0!==k?function(t){return"function"==typeof t||t===k}:function(t){return"function"==typeof t},M=N,q=function(t){return"object"==typeof t?null!==t:M(t)},G=r,H=N,$=function(t,e){return arguments.length<2?(r=G[t],H(r)?r:void 0):G[t]&&G[t][e];var r},z=S({}.isPrototypeOf),V=r.navigator,W=V&&V.userAgent,X=W?String(W):"",J=r,Y=X,K=J.process,Z=J.Deno,Q=K&&K.versions||Z&&Z.version,tt=Q&&Q.v8;tt&&(y=(l=tt.split("."))[0]>0&&l[0]<4?1:+(l[0]+l[1])),!y&&Y&&(!(l=Y.match(/Edge\/(\d+)/))||l[1]>=74)&&(l=Y.match(/Chrome\/(\d+)/))&&(y=+l[1]);var et=y,rt=et,nt=o,ot=r.String,it=!!Object.getOwnPropertySymbols&&!nt((function(){var t=Symbol("symbol detection");return!ot(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&rt&&rt<41})),at=it&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,st=$,ut=N,ct=z,ft=Object,ht=at?function(t){return"symbol"==typeof t}:function(t){var e=st("Symbol");return ut(e)&&ct(e.prototype,ft(t))},pt=String,dt=function(t){try{return pt(t)}catch(t){return"Object"}},lt=N,yt=dt,vt=TypeError,bt=function(t){if(lt(t))return t;throw new vt(yt(t)+" is not a function")},gt=bt,mt=U,wt=function(t,e){var r=t[e];return mt(r)?void 0:gt(r)},St=c,Ot=N,Tt=q,Pt=TypeError,jt={exports:{}},At=r,Et=Object.defineProperty,It=function(t,e){try{Et(At,t,{value:e,configurable:!0,writable:!0})}catch(r){At[t]=e}return e},xt=r,Rt=It,Ut="__core-js_shared__",Dt=jt.exports=xt[Ut]||Rt(Ut,{});(Dt.versions||(Dt.versions=[])).push({version:"3.38.1",mode:"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.38.1/LICENSE",source:"https://github.com/zloirock/core-js"});var Bt=jt.exports,Ct=Bt,_t=function(t,e){return Ct[t]||(Ct[t]=e||{})},Ft=C,Lt=Object,kt=function(t){return Lt(Ft(t))},Nt=kt,Mt=S({}.hasOwnProperty),qt=Object.hasOwn||function(t,e){return Mt(Nt(t),e)},Gt=S,Ht=0,$t=Math.random(),zt=Gt(1..toString),Vt=function(t){return"Symbol("+(void 0===t?"":t)+")_"+zt(++Ht+$t,36)},Wt=_t,Xt=qt,Jt=Vt,Yt=it,Kt=at,Zt=r.Symbol,Qt=Wt("wks"),te=Kt?Zt.for||Zt:Zt&&Zt.withoutSetter||Jt,ee=function(t){return Xt(Qt,t)||(Qt[t]=Yt&&Xt(Zt,t)?Zt[t]:te("Symbol."+t)),Qt[t]},re=c,ne=q,oe=ht,ie=wt,ae=function(t,e){var r,n;if("string"===e&&Ot(r=t.toString)&&!Tt(n=St(r,t)))return n;if(Ot(r=t.valueOf)&&!Tt(n=St(r,t)))return n;if("string"!==e&&Ot(r=t.toString)&&!Tt(n=St(r,t)))return n;throw new Pt("Can't convert object to primitive value")},se=TypeError,ue=ee("toPrimitive"),ce=function(t,e){if(!ne(t)||oe(t))return t;var r,n=ie(t,ue);if(n){if(void 0===e&&(e="default"),r=re(n,t,e),!ne(r)||oe(r))return r;throw new se("Can't convert object to primitive value")}return void 0===e&&(e="number"),ae(t,e)},fe=ht,he=function(t){var e=ce(t,"string");return fe(e)?e:e+""},pe=q,de=r.document,le=pe(de)&&pe(de.createElement),ye=function(t){return le?de.createElement(t):{}},ve=ye,be=!i&&!o((function(){return 7!==Object.defineProperty(ve("div"),"a",{get:function(){return 7}}).a})),ge=i,me=c,we=f,Se=v,Oe=L,Te=he,Pe=qt,je=be,Ae=Object.getOwnPropertyDescriptor;n.f=ge?Ae:function(t,e){if(t=Oe(t),e=Te(e),je)try{return Ae(t,e)}catch(t){}if(Pe(t,e))return Se(!me(we.f,t,e),t[e])};var Ee={},Ie=i&&o((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),xe=q,Re=String,Ue=TypeError,De=function(t){if(xe(t))return t;throw new Ue(Re(t)+" is not an object")},Be=i,Ce=be,_e=Ie,Fe=De,Le=he,ke=TypeError,Ne=Object.defineProperty,Me=Object.getOwnPropertyDescriptor,qe="enumerable",Ge="configurable",He="writable";Ee.f=Be?_e?function(t,e,r){if(Fe(t),e=Le(e),Fe(r),"function"==typeof t&&"prototype"===e&&"value"in r&&He in r&&!r[He]){var n=Me(t,e);n&&n[He]&&(t[e]=r.value,r={configurable:Ge in r?r[Ge]:n[Ge],enumerable:qe in r?r[qe]:n[qe],writable:!1})}return Ne(t,e,r)}:Ne:function(t,e,r){if(Fe(t),e=Le(e),Fe(r),Ce)try{return Ne(t,e,r)}catch(t){}if("get"in r||"set"in r)throw new ke("Accessors not supported");return"value"in r&&(t[e]=r.value),t};var $e=Ee,ze=v,Ve=i?function(t,e,r){return $e.f(t,e,ze(1,r))}:function(t,e,r){return t[e]=r,t},We={exports:{}},Xe=i,Je=qt,Ye=Function.prototype,Ke=Xe&&Object.getOwnPropertyDescriptor,Ze=Je(Ye,"name"),Qe={EXISTS:Ze,PROPER:Ze&&"something"===function(){}.name,CONFIGURABLE:Ze&&(!Xe||Xe&&Ke(Ye,"name").configurable)},tr=N,er=Bt,rr=S(Function.toString);tr(er.inspectSource)||(er.inspectSource=function(t){return rr(t)});var nr,or,ir,ar=er.inspectSource,sr=N,ur=r.WeakMap,cr=sr(ur)&&/native code/.test(String(ur)),fr=Vt,hr=_t("keys"),pr=function(t){return hr[t]||(hr[t]=fr(t))},dr={},lr=cr,yr=r,vr=q,br=Ve,gr=qt,mr=Bt,wr=pr,Sr=dr,Or="Object already initialized",Tr=yr.TypeError,Pr=yr.WeakMap;if(lr||mr.state){var jr=mr.state||(mr.state=new Pr);jr.get=jr.get,jr.has=jr.has,jr.set=jr.set,nr=function(t,e){if(jr.has(t))throw new Tr(Or);return e.facade=t,jr.set(t,e),e},or=function(t){return jr.get(t)||{}},ir=function(t){return jr.has(t)}}else{var Ar=wr("state");Sr[Ar]=!0,nr=function(t,e){if(gr(t,Ar))throw new Tr(Or);return e.facade=t,br(t,Ar,e),e},or=function(t){return gr(t,Ar)?t[Ar]:{}},ir=function(t){return gr(t,Ar)}}var Er={set:nr,get:or,has:ir,enforce:function(t){return ir(t)?or(t):nr(t,{})},getterFor:function(t){return function(e){var r;if(!vr(e)||(r=or(e)).type!==t)throw new Tr("Incompatible receiver, "+t+" required");return r}}},Ir=S,xr=o,Rr=N,Ur=qt,Dr=i,Br=Qe.CONFIGURABLE,Cr=ar,_r=Er.enforce,Fr=Er.get,Lr=String,kr=Object.defineProperty,Nr=Ir("".slice),Mr=Ir("".replace),qr=Ir([].join),Gr=Dr&&!xr((function(){return 8!==kr((function(){}),"length",{value:8}).length})),Hr=String(String).split("String"),$r=We.exports=function(t,e,r){"Symbol("===Nr(Lr(e),0,7)&&(e="["+Mr(Lr(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(e="get "+e),r&&r.setter&&(e="set "+e),(!Ur(t,"name")||Br&&t.name!==e)&&(Dr?kr(t,"name",{value:e,configurable:!0}):t.name=e),Gr&&r&&Ur(r,"arity")&&t.length!==r.arity&&kr(t,"length",{value:r.arity});try{r&&Ur(r,"constructor")&&r.constructor?Dr&&kr(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var n=_r(t);return Ur(n,"source")||(n.source=qr(Hr,"string"==typeof e?e:"")),t};Function.prototype.toString=$r((function(){return Rr(this)&&Fr(this).source||Cr(this)}),"toString");var zr=We.exports,Vr=N,Wr=Ee,Xr=zr,Jr=It,Yr=function(t,e,r,n){n||(n={});var o=n.enumerable,i=void 0!==n.name?n.name:e;if(Vr(r)&&Xr(r,i,n),n.global)o?t[e]=r:Jr(e,r);else{try{n.unsafe?t[e]&&(o=!0):delete t[e]}catch(t){}o?t[e]=r:Wr.f(t,e,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return t},Kr={},Zr=Math.ceil,Qr=Math.floor,tn=Math.trunc||function(t){var e=+t;return(e>0?Qr:Zr)(e)},en=function(t){var e=+t;return e!=e||0===e?0:tn(e)},rn=en,nn=Math.max,on=Math.min,an=en,sn=Math.min,un=function(t){var e=an(t);return e>0?sn(e,9007199254740991):0},cn=function(t){return un(t.length)},fn=L,hn=function(t,e){var r=rn(t);return r<0?nn(r+e,0):on(r,e)},pn=cn,dn=function(t){return function(e,r,n){var o=fn(e),i=pn(o);if(0===i)return!t&&-1;var a,s=hn(n,i);if(t&&r!=r){for(;i>s;)if((a=o[s++])!=a)return!0}else for(;i>s;s++)if((t||s in o)&&o[s]===r)return t||s||0;return!t&&-1}},ln={includes:dn(!0),indexOf:dn(!1)},yn=qt,vn=L,bn=ln.indexOf,gn=dr,mn=S([].push),wn=function(t,e){var r,n=vn(t),o=0,i=[];for(r in n)!yn(gn,r)&&yn(n,r)&&mn(i,r);for(;e.length>o;)yn(n,r=e[o++])&&(~bn(i,r)||mn(i,r));return i},Sn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],On=wn,Tn=Sn.concat("length","prototype");Kr.f=Object.getOwnPropertyNames||function(t){return On(t,Tn)};var Pn={};Pn.f=Object.getOwnPropertySymbols;var jn=$,An=Kr,En=Pn,In=De,xn=S([].concat),Rn=jn("Reflect","ownKeys")||function(t){var e=An.f(In(t)),r=En.f;return r?xn(e,r(t)):e},Un=qt,Dn=Rn,Bn=n,Cn=Ee,_n=function(t,e,r){for(var n=Dn(e),o=Cn.f,i=Bn.f,a=0;a<n.length;a++){var s=n[a];Un(t,s)||r&&Un(r,s)||o(t,s,i(e,s))}},Fn=o,Ln=N,kn=/#|\.prototype\./,Nn=function(t,e){var r=qn[Mn(t)];return r===Hn||r!==Gn&&(Ln(e)?Fn(e):!!e)},Mn=Nn.normalize=function(t){return String(t).replace(kn,".").toLowerCase()},qn=Nn.data={},Gn=Nn.NATIVE="N",Hn=Nn.POLYFILL="P",$n=Nn,zn=r,Vn=n.f,Wn=Ve,Xn=Yr,Jn=It,Yn=_n,Kn=$n,Zn=function(t,e){var r,n,o,i,a,s=t.target,u=t.global,c=t.stat;if(r=u?zn:c?zn[s]||Jn(s,{}):zn[s]&&zn[s].prototype)for(n in e){if(i=e[n],o=t.dontCallGetSet?(a=Vn(r,n))&&a.value:r[n],!Kn(u?n:s+(c?".":"#")+n,t.forced)&&void 0!==o){if(typeof i==typeof o)continue;Yn(i,o)}(t.sham||o&&o.sham)&&Wn(i,"sham",!0),Xn(r,n,i,t)}},Qn=j,to=S,eo=function(t){if("Function"===Qn(t))return to(t)},ro=bt,no=a,oo=eo(eo.bind),io=function(t,e){return ro(t),void 0===e?t:no?oo(t,e):function(){return t.apply(e,arguments)}},ao=j,so=Array.isArray||function(t){return"Array"===ao(t)},uo={};uo[ee("toStringTag")]="z";var co="[object z]"===String(uo),fo=co,ho=N,po=j,lo=ee("toStringTag"),yo=Object,vo="Arguments"===po(function(){return arguments}()),bo=fo?po:function(t){var e,r,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(e=yo(t),lo))?r:vo?po(e):"Object"===(n=po(e))&&ho(e.callee)?"Arguments":n},go=S,mo=o,wo=N,So=bo,Oo=ar,To=function(){},Po=$("Reflect","construct"),jo=/^\s*(?:class|function)\b/,Ao=go(jo.exec),Eo=!jo.test(To),Io=function(t){if(!wo(t))return!1;try{return Po(To,[],t),!0}catch(t){return!1}},xo=function(t){if(!wo(t))return!1;switch(So(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Eo||!!Ao(jo,Oo(t))}catch(t){return!0}};xo.sham=!0;var Ro=!Po||mo((function(){var t;return Io(Io.call)||!Io(Object)||!Io((function(){t=!0}))||t}))?xo:Io,Uo=so,Do=Ro,Bo=q,Co=ee("species"),_o=Array,Fo=function(t){var e;return Uo(t)&&(e=t.constructor,(Do(e)&&(e===_o||Uo(e.prototype))||Bo(e)&&null===(e=e[Co]))&&(e=void 0)),void 0===e?_o:e},Lo=io,ko=R,No=kt,Mo=cn,qo=function(t,e){return new(Fo(t))(0===e?0:e)},Go=S([].push),Ho=function(t){var e=1===t,r=2===t,n=3===t,o=4===t,i=6===t,a=7===t,s=5===t||i;return function(u,c,f,h){for(var p,d,l=No(u),y=ko(l),v=Mo(y),b=Lo(c,f),g=0,m=h||qo,w=e?m(u,v):r||a?m(u,0):void 0;v>g;g++)if((s||g in y)&&(d=b(p=y[g],g,l),t))if(e)w[g]=d;else if(d)switch(t){case 3:return!0;case 5:return p;case 6:return g;case 2:Go(w,p)}else switch(t){case 4:return!1;case 7:Go(w,p)}return i?-1:n||o?o:w}},$o={forEach:Ho(0),map:Ho(1),filter:Ho(2),some:Ho(3),every:Ho(4),find:Ho(5),findIndex:Ho(6),filterReject:Ho(7)},zo={},Vo=wn,Wo=Sn,Xo=Object.keys||function(t){return Vo(t,Wo)},Jo=i,Yo=Ie,Ko=Ee,Zo=De,Qo=L,ti=Xo;zo.f=Jo&&!Yo?Object.defineProperties:function(t,e){Zo(t);for(var r,n=Qo(e),o=ti(e),i=o.length,a=0;i>a;)Ko.f(t,r=o[a++],n[r]);return t};var ei,ri=$("document","documentElement"),ni=De,oi=zo,ii=Sn,ai=dr,si=ri,ui=ye,ci="prototype",fi="script",hi=pr("IE_PROTO"),pi=function(){},di=function(t){return"<"+fi+">"+t+"</"+fi+">"},li=function(t){t.write(di("")),t.close();var e=t.parentWindow.Object;return t=null,e},yi=function(){try{ei=new ActiveXObject("htmlfile")}catch(t){}var t,e,r;yi="undefined"!=typeof document?document.domain&&ei?li(ei):(e=ui("iframe"),r="java"+fi+":",e.style.display="none",si.appendChild(e),e.src=String(r),(t=e.contentWindow.document).open(),t.write(di("document.F=Object")),t.close(),t.F):li(ei);for(var n=ii.length;n--;)delete yi[ci][ii[n]];return yi()};ai[hi]=!0;var vi=Object.create||function(t,e){var r;return null!==t?(pi[ci]=ni(t),r=new pi,pi[ci]=null,r[hi]=t):r=yi(),void 0===e?r:oi.f(r,e)},bi=ee,gi=vi,mi=Ee.f,wi=bi("unscopables"),Si=Array.prototype;void 0===Si[wi]&&mi(Si,wi,{configurable:!0,value:gi(null)});var Oi=function(t){Si[wi][t]=!0},Ti=Zn,Pi=$o.find,ji=Oi,Ai="find",Ei=!0;Ai in[]&&Array(1)[Ai]((function(){Ei=!1})),Ti({target:"Array",proto:!0,forced:Ei},{find:function(t){return Pi(this,t,arguments.length>1?arguments[1]:void 0)}}),ji(Ai);var Ii=r,xi=S;(function(t,e){xi(Ii[t].prototype[e])})("Array","find");var Ri=!o((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})),Ui=qt,Di=N,Bi=kt,Ci=Ri,_i=pr("IE_PROTO"),Fi=Object,Li=Fi.prototype,ki=Ci?Fi.getPrototypeOf:function(t){var e=Bi(t);if(Ui(e,_i))return e[_i];var r=e.constructor;return Di(r)&&e instanceof r?r.prototype:e instanceof Fi?Li:null},Ni=S,Mi=bt,qi=q,Gi=function(t){return qi(t)||null===t},Hi=String,$i=TypeError,zi=function(t,e,r){try{return Ni(Mi(Object.getOwnPropertyDescriptor(t,e)[r]))}catch(t){}},Vi=q,Wi=C,Xi=function(t){if(Gi(t))return t;throw new $i("Can't set "+Hi(t)+" as a prototype")},Ji=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,r={};try{(t=zi(Object.prototype,"__proto__","set"))(r,[]),e=r instanceof Array}catch(t){}return function(r,n){return Wi(r),Xi(n),Vi(r)?(e?t(r,n):r.__proto__=n,r):r}}():void 0),Yi=q,Ki=Ve,Zi=Error,Qi=S("".replace),ta=String(new Zi("zxcasd").stack),ea=/\n\s*at [^:]*:[^\n]*/,ra=ea.test(ta),na=v,oa=!o((function(){var t=new Error("a");return!("stack"in t)||(Object.defineProperty(t,"stack",na(1,7)),7!==t.stack)})),ia=Ve,aa=function(t,e){if(ra&&"string"==typeof t&&!Zi.prepareStackTrace)for(;e--;)t=Qi(t,ea,"");return t},sa=oa,ua=Error.captureStackTrace,ca={},fa=ca,ha=ee("iterator"),pa=Array.prototype,da=bo,la=wt,ya=U,va=ca,ba=ee("iterator"),ga=function(t){if(!ya(t))return la(t,ba)||la(t,"@@iterator")||va[da(t)]},ma=c,wa=bt,Sa=De,Oa=dt,Ta=ga,Pa=TypeError,ja=c,Aa=De,Ea=wt,Ia=io,xa=c,Ra=De,Ua=dt,Da=function(t){return void 0!==t&&(fa.Array===t||pa[ha]===t)},Ba=cn,Ca=z,_a=function(t,e){var r=arguments.length<2?Ta(t):e;if(wa(r))return Sa(ma(r,t));throw new Pa(Oa(t)+" is not iterable")},Fa=ga,La=function(t,e,r){var n,o;Aa(t);try{if(!(n=Ea(t,"return"))){if("throw"===e)throw r;return r}n=ja(n,t)}catch(t){o=!0,n=t}if("throw"===e)throw r;if(o)throw n;return Aa(n),r},ka=TypeError,Na=function(t,e){this.stopped=t,this.result=e},Ma=Na.prototype,qa=function(t,e,r){var n,o,i,a,s,u,c,f=r&&r.that,h=!(!r||!r.AS_ENTRIES),p=!(!r||!r.IS_RECORD),d=!(!r||!r.IS_ITERATOR),l=!(!r||!r.INTERRUPTED),y=Ia(e,f),v=function(t){return n&&La(n,"normal",t),new Na(!0,t)},b=function(t){return h?(Ra(t),l?y(t[0],t[1],v):y(t[0],t[1])):l?y(t,v):y(t)};if(p)n=t.iterator;else if(d)n=t;else{if(!(o=Fa(t)))throw new ka(Ua(t)+" is not iterable");if(Da(o)){for(i=0,a=Ba(t);a>i;i++)if((s=b(t[i]))&&Ca(Ma,s))return s;return new Na(!1)}n=_a(t,o)}for(u=p?t.next:n.next;!(c=xa(u,n)).done;){try{s=b(c.value)}catch(t){La(n,"throw",t)}if("object"==typeof s&&s&&Ca(Ma,s))return s}return new Na(!1)},Ga=bo,Ha=String,$a=function(t){if("Symbol"===Ga(t))throw new TypeError("Cannot convert a Symbol value to a string");return Ha(t)},za=$a,Va=Zn,Wa=z,Xa=ki,Ja=Ji,Ya=_n,Ka=vi,Za=Ve,Qa=v,ts=function(t,e){Yi(e)&&"cause"in e&&Ki(t,"cause",e.cause)},es=function(t,e,r,n){sa&&(ua?ua(t,e):ia(t,"stack",aa(r,n)))},rs=qa,ns=function(t,e){return void 0===t?arguments.length<2?"":e:za(t)},os=ee("toStringTag"),is=Error,as=[].push,ss=function(t,e){var r,n=Wa(us,this);Ja?r=Ja(new is,n?Xa(this):us):(r=n?this:Ka(us),Za(r,os,"Error")),void 0!==e&&Za(r,"message",ns(e)),es(r,ss,r.stack,1),arguments.length>2&&ts(r,arguments[2]);var o=[];return rs(t,as,{that:o}),Za(r,"errors",o),r};Ja?Ja(ss,is):Ya(ss,is,{name:!0});var us=ss.prototype=Ka(is.prototype,{constructor:Qa(1,ss),message:Qa(1,""),name:Qa(1,"AggregateError")});Va({global:!0,constructor:!0,arity:2},{AggregateError:ss});var cs,fs,hs,ps=o,ds=N,ls=q,ys=ki,vs=Yr,bs=ee("iterator"),gs=!1;[].keys&&("next"in(hs=[].keys())?(fs=ys(ys(hs)))!==Object.prototype&&(cs=fs):gs=!0);var ms=!ls(cs)||ps((function(){var t={};return cs[bs].call(t)!==t}));ms&&(cs={}),ds(cs[bs])||vs(cs,bs,(function(){return this}));var ws={IteratorPrototype:cs,BUGGY_SAFARI_ITERATORS:gs},Ss=Ee.f,Os=qt,Ts=ee("toStringTag"),Ps=function(t,e,r){t&&!r&&(t=t.prototype),t&&!Os(t,Ts)&&Ss(t,Ts,{configurable:!0,value:e})},js=ws.IteratorPrototype,As=vi,Es=v,Is=Ps,xs=ca,Rs=function(){return this},Us=Zn,Ds=c,Bs=N,Cs=function(t,e,r,n){var o=e+" Iterator";return t.prototype=As(js,{next:Es(+!n,r)}),Is(t,o,!1),xs[o]=Rs,t},_s=ki,Fs=Ji,Ls=Ps,ks=Ve,Ns=Yr,Ms=ca,qs=Qe.PROPER,Gs=Qe.CONFIGURABLE,Hs=ws.IteratorPrototype,$s=ws.BUGGY_SAFARI_ITERATORS,zs=ee("iterator"),Vs="keys",Ws="values",Xs="entries",Js=function(){return this},Ys=function(t,e,r,n,o,i,a){Cs(r,e,n);var s,u,c,f=function(t){if(t===o&&y)return y;if(!$s&&t&&t in d)return d[t];switch(t){case Vs:case Ws:case Xs:return function(){return new r(this,t)}}return function(){return new r(this)}},h=e+" Iterator",p=!1,d=t.prototype,l=d[zs]||d["@@iterator"]||o&&d[o],y=!$s&&l||f(o),v="Array"===e&&d.entries||l;if(v&&(s=_s(v.call(new t)))!==Object.prototype&&s.next&&(_s(s)!==Hs&&(Fs?Fs(s,Hs):Bs(s[zs])||Ns(s,zs,Js)),Ls(s,h,!0)),qs&&o===Ws&&l&&l.name!==Ws&&(Gs?ks(d,"name",Ws):(p=!0,y=function(){return Ds(l,this)})),o)if(u={values:f(Ws),keys:i?y:f(Vs),entries:f(Xs)},a)for(c in u)($s||p||!(c in d))&&Ns(d,c,u[c]);else Us({target:e,proto:!0,forced:$s||p},u);return d[zs]!==y&&Ns(d,zs,y,{name:o}),Ms[e]=y,u},Ks=function(t,e){return{value:t,done:e}},Zs=L,Qs=Oi,tu=ca,eu=Er,ru=Ee.f,nu=Ys,ou=Ks,iu=i,au="Array Iterator",su=eu.set,uu=eu.getterFor(au),cu=nu(Array,"Array",(function(t,e){su(this,{type:au,target:Zs(t),index:0,kind:e})}),(function(){var t=uu(this),e=t.target,r=t.index++;if(!e||r>=e.length)return t.target=null,ou(void 0,!0);switch(t.kind){case"keys":return ou(r,!1);case"values":return ou(e[r],!1)}return ou([r,e[r]],!1)}),"values"),fu=tu.Arguments=tu.Array;if(Qs("keys"),Qs("values"),Qs("entries"),iu&&"values"!==fu.name)try{ru(fu,"name",{value:"values"})}catch(t){}var hu=bo,pu=co?{}.toString:function(){return"[object "+hu(this)+"]"};co||Yr(Object.prototype,"toString",pu,{unsafe:!0});var du,lu,yu,vu,bu=r,gu=X,mu=j,wu=function(t){return gu.slice(0,t.length)===t},Su=wu("Bun/")?"BUN":wu("Cloudflare-Workers")?"CLOUDFLARE":wu("Deno/")?"DENO":wu("Node.js/")?"NODE":bu.Bun&&"string"==typeof Bun.version?"BUN":bu.Deno&&"object"==typeof Deno.version?"DENO":"process"===mu(bu.process)?"NODE":bu.window&&bu.document?"BROWSER":"REST",Ou="NODE"===Su,Tu=zr,Pu=Ee,ju=$,Au=function(t,e,r){return r.get&&Tu(r.get,e,{getter:!0}),r.set&&Tu(r.set,e,{setter:!0}),Pu.f(t,e,r)},Eu=i,Iu=ee("species"),xu=z,Ru=TypeError,Uu=Ro,Du=dt,Bu=TypeError,Cu=De,_u=function(t){if(Uu(t))return t;throw new Bu(Du(t)+" is not a constructor")},Fu=U,Lu=ee("species"),ku=function(t,e){var r,n=Cu(t).constructor;return void 0===n||Fu(r=Cu(n)[Lu])?e:_u(r)},Nu=a,Mu=Function.prototype,qu=Mu.apply,Gu=Mu.call,Hu="object"==typeof Reflect&&Reflect.apply||(Nu?Gu.bind(qu):function(){return Gu.apply(qu,arguments)}),$u=S([].slice),zu=TypeError,Vu=/(?:ipad|iphone|ipod).*applewebkit/i.test(X),Wu=r,Xu=Hu,Ju=io,Yu=N,Ku=qt,Zu=o,Qu=ri,tc=$u,ec=ye,rc=function(t,e){if(t<e)throw new zu("Not enough arguments");return t},nc=Vu,oc=Ou,ic=Wu.setImmediate,ac=Wu.clearImmediate,sc=Wu.process,uc=Wu.Dispatch,cc=Wu.Function,fc=Wu.MessageChannel,hc=Wu.String,pc=0,dc={},lc="onreadystatechange";Zu((function(){du=Wu.location}));var yc=function(t){if(Ku(dc,t)){var e=dc[t];delete dc[t],e()}},vc=function(t){return function(){yc(t)}},bc=function(t){yc(t.data)},gc=function(t){Wu.postMessage(hc(t),du.protocol+"//"+du.host)};ic&&ac||(ic=function(t){rc(arguments.length,1);var e=Yu(t)?t:cc(t),r=tc(arguments,1);return dc[++pc]=function(){Xu(e,void 0,r)},lu(pc),pc},ac=function(t){delete dc[t]},oc?lu=function(t){sc.nextTick(vc(t))}:uc&&uc.now?lu=function(t){uc.now(vc(t))}:fc&&!nc?(vu=(yu=new fc).port2,yu.port1.onmessage=bc,lu=Ju(vu.postMessage,vu)):Wu.addEventListener&&Yu(Wu.postMessage)&&!Wu.importScripts&&du&&"file:"!==du.protocol&&!Zu(gc)?(lu=gc,Wu.addEventListener("message",bc,!1)):lu=lc in ec("script")?function(t){Qu.appendChild(ec("script"))[lc]=function(){Qu.removeChild(this),yc(t)}}:function(t){setTimeout(vc(t),0)});var mc={set:ic,clear:ac},wc=r,Sc=i,Oc=Object.getOwnPropertyDescriptor,Tc=function(){this.head=null,this.tail=null};Tc.prototype={add:function(t){var e={item:t,next:null},r=this.tail;r?r.next=e:this.head=e,this.tail=e},get:function(){var t=this.head;if(t)return null===(this.head=t.next)&&(this.tail=null),t.item}};var Pc,jc,Ac,Ec,Ic,xc=Tc,Rc=/ipad|iphone|ipod/i.test(X)&&"undefined"!=typeof Pebble,Uc=/web0s(?!.*chrome)/i.test(X),Dc=r,Bc=function(t){if(!Sc)return wc[t];var e=Oc(wc,t);return e&&e.value},Cc=io,_c=mc.set,Fc=xc,Lc=Vu,kc=Rc,Nc=Uc,Mc=Ou,qc=Dc.MutationObserver||Dc.WebKitMutationObserver,Gc=Dc.document,Hc=Dc.process,$c=Dc.Promise,zc=Bc("queueMicrotask");if(!zc){var Vc=new Fc,Wc=function(){var t,e;for(Mc&&(t=Hc.domain)&&t.exit();e=Vc.get();)try{e()}catch(t){throw Vc.head&&Pc(),t}t&&t.enter()};Lc||Mc||Nc||!qc||!Gc?!kc&&$c&&$c.resolve?((Ec=$c.resolve(void 0)).constructor=$c,Ic=Cc(Ec.then,Ec),Pc=function(){Ic(Wc)}):Mc?Pc=function(){Hc.nextTick(Wc)}:(_c=Cc(_c,Dc),Pc=function(){_c(Wc)}):(jc=!0,Ac=Gc.createTextNode(""),new qc(Wc).observe(Ac,{characterData:!0}),Pc=function(){Ac.data=jc=!jc}),zc=function(t){Vc.head||Pc(),Vc.add(t)}}var Xc=zc,Jc=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}},Yc=r.Promise,Kc=r,Zc=Yc,Qc=N,tf=$n,ef=ar,rf=ee,nf=Su,of=et;Zc&&Zc.prototype;var af=rf("species"),sf=!1,uf=Qc(Kc.PromiseRejectionEvent),cf=tf("Promise",(function(){var t=ef(Zc),e=t!==String(Zc);if(!e&&66===of)return!0;if(!of||of<51||!/native code/.test(t)){var r=new Zc((function(t){t(1)})),n=function(t){t((function(){}),(function(){}))};if((r.constructor={})[af]=n,!(sf=r.then((function(){}))instanceof n))return!0}return!(e||"BROWSER"!==nf&&"DENO"!==nf||uf)})),ff={CONSTRUCTOR:cf,REJECTION_EVENT:uf,SUBCLASSING:sf},hf={},pf=bt,df=TypeError,lf=function(t){var e,r;this.promise=new t((function(t,n){if(void 0!==e||void 0!==r)throw new df("Bad Promise constructor");e=t,r=n})),this.resolve=pf(e),this.reject=pf(r)};hf.f=function(t){return new lf(t)};var yf,vf,bf,gf=Zn,mf=Ou,wf=r,Sf=c,Of=Yr,Tf=Ji,Pf=Ps,jf=function(t){var e=ju(t);Eu&&e&&!e[Iu]&&Au(e,Iu,{configurable:!0,get:function(){return this}})},Af=bt,Ef=N,If=q,xf=function(t,e){if(xu(e,t))return t;throw new Ru("Incorrect invocation")},Rf=ku,Uf=mc.set,Df=Xc,Bf=function(t,e){try{1===arguments.length?console.error(t):console.error(t,e)}catch(t){}},Cf=Jc,_f=xc,Ff=Er,Lf=Yc,kf=hf,Nf="Promise",Mf=ff.CONSTRUCTOR,qf=ff.REJECTION_EVENT,Gf=ff.SUBCLASSING,Hf=Ff.getterFor(Nf),$f=Ff.set,zf=Lf&&Lf.prototype,Vf=Lf,Wf=zf,Xf=wf.TypeError,Jf=wf.document,Yf=wf.process,Kf=kf.f,Zf=Kf,Qf=!!(Jf&&Jf.createEvent&&wf.dispatchEvent),th="unhandledrejection",eh=function(t){var e;return!(!If(t)||!Ef(e=t.then))&&e},rh=function(t,e){var r,n,o,i=e.value,a=1===e.state,s=a?t.ok:t.fail,u=t.resolve,c=t.reject,f=t.domain;try{s?(a||(2===e.rejection&&sh(e),e.rejection=1),!0===s?r=i:(f&&f.enter(),r=s(i),f&&(f.exit(),o=!0)),r===t.promise?c(new Xf("Promise-chain cycle")):(n=eh(r))?Sf(n,r,u,c):u(r)):c(i)}catch(t){f&&!o&&f.exit(),c(t)}},nh=function(t,e){t.notified||(t.notified=!0,Df((function(){for(var r,n=t.reactions;r=n.get();)rh(r,t);t.notified=!1,e&&!t.rejection&&ih(t)})))},oh=function(t,e,r){var n,o;Qf?((n=Jf.createEvent("Event")).promise=e,n.reason=r,n.initEvent(t,!1,!0),wf.dispatchEvent(n)):n={promise:e,reason:r},!qf&&(o=wf["on"+t])?o(n):t===th&&Bf("Unhandled promise rejection",r)},ih=function(t){Sf(Uf,wf,(function(){var e,r=t.facade,n=t.value;if(ah(t)&&(e=Cf((function(){mf?Yf.emit("unhandledRejection",n,r):oh(th,r,n)})),t.rejection=mf||ah(t)?2:1,e.error))throw e.value}))},ah=function(t){return 1!==t.rejection&&!t.parent},sh=function(t){Sf(Uf,wf,(function(){var e=t.facade;mf?Yf.emit("rejectionHandled",e):oh("rejectionhandled",e,t.value)}))},uh=function(t,e,r){return function(n){t(e,n,r)}},ch=function(t,e,r){t.done||(t.done=!0,r&&(t=r),t.value=e,t.state=2,nh(t,!0))},fh=function(t,e,r){if(!t.done){t.done=!0,r&&(t=r);try{if(t.facade===e)throw new Xf("Promise can't be resolved itself");var n=eh(e);n?Df((function(){var r={done:!1};try{Sf(n,e,uh(fh,r,t),uh(ch,r,t))}catch(e){ch(r,e,t)}})):(t.value=e,t.state=1,nh(t,!1))}catch(e){ch({done:!1},e,t)}}};if(Mf&&(Wf=(Vf=function(t){xf(this,Wf),Af(t),Sf(yf,this);var e=Hf(this);try{t(uh(fh,e),uh(ch,e))}catch(t){ch(e,t)}}).prototype,(yf=function(t){$f(this,{type:Nf,done:!1,notified:!1,parent:!1,reactions:new _f,rejection:!1,state:0,value:null})}).prototype=Of(Wf,"then",(function(t,e){var r=Hf(this),n=Kf(Rf(this,Vf));return r.parent=!0,n.ok=!Ef(t)||t,n.fail=Ef(e)&&e,n.domain=mf?Yf.domain:void 0,0===r.state?r.reactions.add(n):Df((function(){rh(n,r)})),n.promise})),vf=function(){var t=new yf,e=Hf(t);this.promise=t,this.resolve=uh(fh,e),this.reject=uh(ch,e)},kf.f=Kf=function(t){return t===Vf||undefined===t?new vf(t):Zf(t)},Ef(Lf)&&zf!==Object.prototype)){bf=zf.then,Gf||Of(zf,"then",(function(t,e){var r=this;return new Vf((function(t,e){Sf(bf,r,t,e)})).then(t,e)}),{unsafe:!0});try{delete zf.constructor}catch(t){}Tf&&Tf(zf,Wf)}gf({global:!0,constructor:!0,wrap:!0,forced:Mf},{Promise:Vf}),Pf(Vf,Nf,!1),jf(Nf);var hh=ee("iterator"),ph=!1;try{var dh=0,lh={next:function(){return{done:!!dh++}},return:function(){ph=!0}};lh[hh]=function(){return this},Array.from(lh,(function(){throw 2}))}catch(t){}var yh=Yc,vh=function(t,e){try{if(!e&&!ph)return!1}catch(t){return!1}var r=!1;try{var n={};n[hh]=function(){return{next:function(){return{done:r=!0}}}},t(n)}catch(t){}return r},bh=ff.CONSTRUCTOR||!vh((function(t){yh.all(t).then(void 0,(function(){}))})),gh=c,mh=bt,wh=hf,Sh=Jc,Oh=qa;Zn({target:"Promise",stat:!0,forced:bh},{all:function(t){var e=this,r=wh.f(e),n=r.resolve,o=r.reject,i=Sh((function(){var r=mh(e.resolve),i=[],a=0,s=1;Oh(t,(function(t){var u=a++,c=!1;s++,gh(r,e,t).then((function(t){c||(c=!0,i[u]=t,--s||n(i))}),o)})),--s||n(i)}));return i.error&&o(i.value),r.promise}});var Th=Zn,Ph=ff.CONSTRUCTOR,jh=Yc,Ah=$,Eh=N,Ih=Yr,xh=jh&&jh.prototype;if(Th({target:"Promise",proto:!0,forced:Ph,real:!0},{catch:function(t){return this.then(void 0,t)}}),Eh(jh)){var Rh=Ah("Promise").prototype.catch;xh.catch!==Rh&&Ih(xh,"catch",Rh,{unsafe:!0})}var Uh=c,Dh=bt,Bh=hf,Ch=Jc,_h=qa;Zn({target:"Promise",stat:!0,forced:bh},{race:function(t){var e=this,r=Bh.f(e),n=r.reject,o=Ch((function(){var o=Dh(e.resolve);_h(t,(function(t){Uh(o,e,t).then(r.resolve,n)}))}));return o.error&&n(o.value),r.promise}});var Fh=hf;Zn({target:"Promise",stat:!0,forced:ff.CONSTRUCTOR},{reject:function(t){var e=Fh.f(this);return(0,e.reject)(t),e.promise}});var Lh=De,kh=q,Nh=hf,Mh=function(t,e){if(Lh(t),kh(e)&&e.constructor===t)return e;var r=Nh.f(t);return(0,r.resolve)(e),r.promise},qh=Zn,Gh=ff.CONSTRUCTOR,Hh=Mh;$("Promise"),qh({target:"Promise",stat:!0,forced:Gh},{resolve:function(t){return Hh(this,t)}});var $h=c,zh=bt,Vh=hf,Wh=Jc,Xh=qa;Zn({target:"Promise",stat:!0,forced:bh},{allSettled:function(t){var e=this,r=Vh.f(e),n=r.resolve,o=r.reject,i=Wh((function(){var r=zh(e.resolve),o=[],i=0,a=1;Xh(t,(function(t){var s=i++,u=!1;a++,$h(r,e,t).then((function(t){u||(u=!0,o[s]={status:"fulfilled",value:t},--a||n(o))}),(function(t){u||(u=!0,o[s]={status:"rejected",reason:t},--a||n(o))}))})),--a||n(o)}));return i.error&&o(i.value),r.promise}});var Jh=c,Yh=bt,Kh=$,Zh=hf,Qh=Jc,tp=qa,ep="No one promise resolved";Zn({target:"Promise",stat:!0,forced:bh},{any:function(t){var e=this,r=Kh("AggregateError"),n=Zh.f(e),o=n.resolve,i=n.reject,a=Qh((function(){var n=Yh(e.resolve),a=[],s=0,u=1,c=!1;tp(t,(function(t){var f=s++,h=!1;u++,Jh(n,e,t).then((function(t){h||c||(c=!0,o(t))}),(function(t){h||c||(h=!0,a[f]=t,--u||i(new r(a,ep)))}))})),--u||i(new r(a,ep))}));return a.error&&i(a.value),n.promise}});var rp=hf;Zn({target:"Promise",stat:!0},{withResolvers:function(){var t=rp.f(this);return{promise:t.promise,resolve:t.resolve,reject:t.reject}}});var np=Zn,op=Yc,ip=o,ap=$,sp=N,up=ku,cp=Mh,fp=Yr,hp=op&&op.prototype;if(np({target:"Promise",proto:!0,real:!0,forced:!!op&&ip((function(){hp.finally.call({then:function(){}},(function(){}))}))},{finally:function(t){var e=up(this,ap("Promise")),r=sp(t);return this.then(r?function(r){return cp(e,t()).then((function(){return r}))}:t,r?function(r){return cp(e,t()).then((function(){throw r}))}:t)}}),sp(op)){var pp=ap("Promise").prototype.finally;hp.finally!==pp&&fp(hp,"finally",pp,{unsafe:!0})}var dp=S,lp=en,yp=$a,vp=C,bp=dp("".charAt),gp=dp("".charCodeAt),mp=dp("".slice),wp=function(t){return function(e,r){var n,o,i=yp(vp(e)),a=lp(r),s=i.length;return a<0||a>=s?t?"":void 0:(n=gp(i,a))<55296||n>56319||a+1===s||(o=gp(i,a+1))<56320||o>57343?t?bp(i,a):n:t?mp(i,a,a+2):o-56320+(n-55296<<10)+65536}},Sp={codeAt:wp(!1),charAt:wp(!0)}.charAt,Op=$a,Tp=Er,Pp=Ys,jp=Ks,Ap="String Iterator",Ep=Tp.set,Ip=Tp.getterFor(Ap);Pp(String,"String",(function(t){Ep(this,{type:Ap,string:Op(t),index:0})}),(function(){var t,e=Ip(this),r=e.string,n=e.index;return n>=r.length?jp(void 0,!0):(t=Sp(r,n),e.index+=t.length,jp(t,!1))})),r.Promise;var xp=ye("span").classList,Rp=xp&&xp.constructor&&xp.constructor.prototype,Up=Rp===Object.prototype?void 0:Rp,Dp=r,Bp={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},Cp=Up,_p=cu,Fp=Ve,Lp=Ps,kp=ee("iterator"),Np=_p.values,Mp=function(t,e){if(t){if(t[kp]!==Np)try{Fp(t,kp,Np)}catch(e){t[kp]=Np}if(Lp(t,e,!0),Bp[e])for(var r in _p)if(t[r]!==_p[r])try{Fp(t,r,_p[r])}catch(e){t[r]=_p[r]}}};for(var qp in Bp)Mp(Dp[qp]&&Dp[qp].prototype,qp);Mp(Cp,"DOMTokenList");var Gp="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||"undefined"!=typeof global&&global||{},Hp="URLSearchParams"in Gp,$p="Symbol"in Gp&&"iterator"in Symbol,zp="FileReader"in Gp&&"Blob"in Gp&&function(){try{return new Blob,!0}catch(t){return!1}}(),Vp="FormData"in Gp,Wp="ArrayBuffer"in Gp;if(Wp)var Xp=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],Jp=ArrayBuffer.isView||function(t){return t&&Xp.indexOf(Object.prototype.toString.call(t))>-1};function Yp(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(t)||""===t)throw new TypeError('Invalid character in header field name: "'+t+'"');return t.toLowerCase()}function Kp(t){return"string"!=typeof t&&(t=String(t)),t}function Zp(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return $p&&(e[Symbol.iterator]=function(){return e}),e}function Qp(t){this.map={},t instanceof Qp?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){if(2!=t.length)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+t.length);this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function td(t){if(!t._noBody)return t.bodyUsed?Promise.reject(new TypeError("Already read")):void(t.bodyUsed=!0)}function ed(t){return new Promise((function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}}))}function rd(t){var e=new FileReader,r=ed(e);return e.readAsArrayBuffer(t),r}function nd(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function od(){return this.bodyUsed=!1,this._initBody=function(t){var e;this.bodyUsed=this.bodyUsed,this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:zp&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:Vp&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:Hp&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():Wp&&zp&&((e=t)&&DataView.prototype.isPrototypeOf(e))?(this._bodyArrayBuffer=nd(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):Wp&&(ArrayBuffer.prototype.isPrototypeOf(t)||Jp(t))?this._bodyArrayBuffer=nd(t):this._bodyText=t=Object.prototype.toString.call(t):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):Hp&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},zp&&(this.blob=function(){var t=td(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var t=td(this);return t||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}if(zp)return this.blob().then(rd);throw new Error("could not read as ArrayBuffer")},this.text=function(){var t=td(this);if(t)return t;if(this._bodyBlob)return function(t){var e=new FileReader,r=ed(e),n=/charset=([A-Za-z0-9_-]+)/.exec(t.type),o=n?n[1]:"utf-8";return e.readAsText(t,o),r}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),n=0;n<e.length;n++)r[n]=String.fromCharCode(e[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},Vp&&(this.formData=function(){return this.text().then(sd)}),this.json=function(){return this.text().then(JSON.parse)},this}Qp.prototype.append=function(t,e){t=Yp(t),e=Kp(e);var r=this.map[t];this.map[t]=r?r+", "+e:e},Qp.prototype.delete=function(t){delete this.map[Yp(t)]},Qp.prototype.get=function(t){return t=Yp(t),this.has(t)?this.map[t]:null},Qp.prototype.has=function(t){return this.map.hasOwnProperty(Yp(t))},Qp.prototype.set=function(t,e){this.map[Yp(t)]=Kp(e)},Qp.prototype.forEach=function(t,e){for(var r in this.map)this.map.hasOwnProperty(r)&&t.call(e,this.map[r],r,this)},Qp.prototype.keys=function(){var t=[];return this.forEach((function(e,r){t.push(r)})),Zp(t)},Qp.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),Zp(t)},Qp.prototype.entries=function(){var t=[];return this.forEach((function(e,r){t.push([r,e])})),Zp(t)},$p&&(Qp.prototype[Symbol.iterator]=Qp.prototype.entries);var id=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function ad(t,e){if(!(this instanceof ad))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var r=(e=e||{}).body;if(t instanceof ad){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new Qp(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,r||null==t._bodyInit||(r=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new Qp(e.headers)),this.method=function(t){var e=t.toUpperCase();return id.indexOf(e)>-1?e:t}(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal||function(){if("AbortController"in Gp)return(new AbortController).signal}(),this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&r)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(r),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==e.cache&&"no-cache"!==e.cache)){var n=/([?&])_=[^&]*/;if(n.test(this.url))this.url=this.url.replace(n,"$1_="+(new Date).getTime());else{this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function sd(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var r=t.split("="),n=r.shift().replace(/\+/g," "),o=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(n),decodeURIComponent(o))}})),e}function ud(t,e){if(!(this instanceof ud))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=void 0===e.statusText?"":""+e.statusText,this.headers=new Qp(e.headers),this.url=e.url||"",this._initBody(t)}ad.prototype.clone=function(){return new ad(this,{body:this._bodyInit})},od.call(ad.prototype),od.call(ud.prototype),ud.prototype.clone=function(){return new ud(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new Qp(this.headers),url:this.url})},ud.error=function(){var t=new ud(null,{status:200,statusText:""});return t.ok=!1,t.status=0,t.type="error",t};var cd=[301,302,303,307,308];ud.redirect=function(t,e){if(-1===cd.indexOf(e))throw new RangeError("Invalid status code");return new ud(null,{status:e,headers:{location:t}})};var fd=Gp.DOMException;try{new fd}catch(t){(fd=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack}).prototype=Object.create(Error.prototype),fd.prototype.constructor=fd}function hd(t,e){return new Promise((function(r,n){var o=new ad(t,e);if(o.signal&&o.signal.aborted)return n(new fd("Aborted","AbortError"));var i=new XMLHttpRequest;function a(){i.abort()}if(i.onload=function(){var t,e,n={statusText:i.statusText,headers:(t=i.getAllResponseHeaders()||"",e=new Qp,t.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(t){return 0===t.indexOf("\n")?t.substr(1,t.length):t})).forEach((function(t){var r=t.split(":"),n=r.shift().trim();if(n){var o=r.join(":").trim();try{e.append(n,o)}catch(t){console.warn("Response "+t.message)}}})),e)};0===o.url.indexOf("file://")&&(i.status<200||i.status>599)?n.status=200:n.status=i.status,n.url="responseURL"in i?i.responseURL:n.headers.get("X-Request-URL");var a="response"in i?i.response:i.responseText;setTimeout((function(){r(new ud(a,n))}),0)},i.onerror=function(){setTimeout((function(){n(new TypeError("Network request failed"))}),0)},i.ontimeout=function(){setTimeout((function(){n(new TypeError("Network request timed out"))}),0)},i.onabort=function(){setTimeout((function(){n(new fd("Aborted","AbortError"))}),0)},i.open(o.method,function(t){try{return""===t&&Gp.location.href?Gp.location.href:t}catch(e){return t}}(o.url),!0),"include"===o.credentials?i.withCredentials=!0:"omit"===o.credentials&&(i.withCredentials=!1),"responseType"in i&&(zp?i.responseType="blob":Wp&&(i.responseType="arraybuffer")),e&&"object"==typeof e.headers&&!(e.headers instanceof Qp||Gp.Headers&&e.headers instanceof Gp.Headers)){var s=[];Object.getOwnPropertyNames(e.headers).forEach((function(t){s.push(Yp(t)),i.setRequestHeader(t,Kp(e.headers[t]))})),o.headers.forEach((function(t,e){-1===s.indexOf(e)&&i.setRequestHeader(e,t)}))}else o.headers.forEach((function(t,e){i.setRequestHeader(e,t)}));o.signal&&(o.signal.addEventListener("abort",a),i.onreadystatechange=function(){4===i.readyState&&o.signal.removeEventListener("abort",a)}),i.send(void 0===o._bodyInit?null:o._bodyInit)}))}hd.polyfill=!0,Gp.fetch||(Gp.fetch=hd,Gp.Headers=Qp,Gp.Request=ad,Gp.Response=ud);var pd=function(){function t(){this.empty=!0,this.x=0,this.y=0,this.width=0,this.height=0}return t.prototype.reset=function(){this.empty=!0,this.x=0,this.y=0,this.width=0,this.height=0},t.prototype.set=function(t,e,r,n){void 0===r&&(r=0),void 0===n&&(n=0),this.empty=!1,this.x=t,this.y=e,this.width=r,this.height=n},t.prototype.union=function(t,e,r,n){void 0===r&&(r=0),void 0===n&&(n=0),this.empty?(this.empty=!1,this.x=t,this.y=e,this.width=r,this.height=n):(t<this.x&&(this.width+=this.x-t,this.x=t),e<this.y&&(this.height+=this.y-e,this.y=e),t+r>this.x+this.width&&(this.width=t+r-this.x),e+n>this.y+this.height&&(this.height=e+n-this.y))},t}(),dd=function(){function t(t){this.dirtyArea=new pd,this.canvas=t,this.context=t.getContext("2d")}return t.prototype.draw=function(t){this.canvas&&this.context&&(this.dirtyArea.empty||(this.context.clearRect(this.dirtyArea.x,this.dirtyArea.y,this.dirtyArea.width,this.dirtyArea.height),this.dirtyArea.reset()),t&&(this.canvas.width==t.width&&this.canvas.height==t.height||(this.canvas.width=t.width,this.canvas.height=t.height),this.drawSubtitleData(t,this.dirtyArea)))},t.prototype.drawSubtitleData=function(t,e){for(var r=0,n=t.compositionData;r<n.length;r++){var o=n[r];this.drawSubtitleCompositionData(o,e)}},t.prototype.drawSubtitleCompositionData=function(t,e){var r;null===(r=this.context)||void 0===r||r.putImageData(t.pixelData,t.window.horizontalPosition,t.window.verticalPosition),null==e||e.union(t.window.horizontalPosition,t.window.verticalPosition,t.pixelData.width,t.pixelData.height)},t}();function ld(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{u(n.next(t))}catch(t){i(t)}}function s(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))}function yd(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}}"function"==typeof SuppressedError&&SuppressedError;var vd,bd=function(){function t(t){this.$position=0,this.array=t}return Object.defineProperty(t.prototype,"position",{get:function(){return this.$position},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"length",{get:function(){return this.array.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"eof",{get:function(){return this.position>=this.length},enumerable:!1,configurable:!0}),t.prototype.readByte=function(){return this.array[this.$position++]},t.prototype.readBytes=function(t){var e=this.array.slice(this.$position,this.$position+t);return this.$position+=t,e},t}(),gd=function(){function t(t){t instanceof Uint8Array?this.baseReader=new bd(t):this.baseReader=t}return Object.defineProperty(t.prototype,"position",{get:function(){return this.baseReader.position},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"length",{get:function(){return this.baseReader.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"eof",{get:function(){return this.baseReader.eof},enumerable:!1,configurable:!0}),t.prototype.readUInt8=function(){return this.baseReader.readByte()},t.prototype.readUInt16=function(){return(this.baseReader.readByte()<<8)+this.baseReader.readByte()},t.prototype.readUInt24=function(){return(this.baseReader.readByte()<<16)+(this.baseReader.readByte()<<8)+this.baseReader.readByte()},t.prototype.readUInt32=function(){return(this.baseReader.readByte()<<24)+(this.baseReader.readByte()<<16)+(this.baseReader.readByte()<<8)+this.baseReader.readByte()},t.prototype.readBytes=function(t){return this.baseReader.readBytes(t)},t}();!function(t){t[t.paletteDefinition=20]="paletteDefinition",t[t.objectDefinition=21]="objectDefinition",t[t.presentationComposition=22]="presentationComposition",t[t.windowDefinition=23]="windowDefinition",t[t.end=128]="end"}(vd||(vd={}));var md=function(){function t(){this.id=0,this.windowId=0,this.croppedFlag=0,this.horizontalPosition=0,this.verticalPosition=0,this.croppingHorizontalPosition=0,this.croppingVerticalPosition=0,this.croppingWidth=0,this.croppingHeightPosition=0}return Object.defineProperty(t.prototype,"hasCropping",{get:function(){return!!(128&this.croppedFlag)},enumerable:!1,configurable:!0}),t}(),wd=function(){function t(){this.width=0,this.height=0,this.frameRate=0,this.compositionNumber=0,this.compositionState=0,this.paletteUpdateFlag=0,this.paletteId=0,this.compositionObjects=[]}return Object.defineProperty(t.prototype,"segmentType",{get:function(){return vd.presentationComposition},enumerable:!1,configurable:!0}),t.prototype.read=function(t,e){this.width=t.readUInt16(),this.height=t.readUInt16(),this.frameRate=t.readUInt8(),this.compositionNumber=t.readUInt16(),this.compositionState=t.readUInt8(),this.paletteUpdateFlag=t.readUInt8(),this.paletteId=t.readUInt8();var r=t.readUInt8();this.compositionObjects=[];for(var n=0;n<r;n++){var o=new md;o.id=t.readUInt16(),o.windowId=t.readUInt8(),o.croppedFlag=t.readUInt8(),o.horizontalPosition=t.readUInt16(),o.verticalPosition=t.readUInt16(),o.hasCropping&&(o.croppingHorizontalPosition=t.readUInt16(),o.croppingVerticalPosition=t.readUInt16(),o.croppingWidth=t.readUInt16(),o.croppingHeightPosition=t.readUInt16()),this.compositionObjects.push(o)}},t}(),Sd=function(){function t(){this.id=0,this.versionNumber=0,this.rgba=[]}return Object.defineProperty(t.prototype,"segmentType",{get:function(){return vd.paletteDefinition},enumerable:!1,configurable:!0}),t.prototype.read=function(e,r){this.id=e.readUInt8(),this.versionNumber=e.readUInt8();var n=(r-2)/5,o=new Uint32Array(1),i=new Uint8Array(o.buffer);this.rgba=[];for(var a=0;a<n;a++){var s=e.readUInt8(),u=e.readUInt8(),c=e.readUInt8()-128,f=e.readUInt8()-128,h=e.readUInt8(),p=t.clamp(Math.round(u+1.402*c),0,255),d=t.clamp(Math.round(u-.34414*f-.71414*c),0,255),l=t.clamp(Math.round(u+1.772*f),0,255);i[0]=p,i[1]=d,i[2]=l,i[3]=h,this.rgba[s]=o[0]}},t.clamp=function(t,e,r){return t<e?e:t>r?r:t},t}(),Od=function(){function t(){this.id=0,this.versionNumber=0,this.lastInSequenceFlag=0,this.width=0,this.height=0,this.dataLength=0}return Object.defineProperty(t.prototype,"isFirstInSequence",{get:function(){return!!(128&this.lastInSequenceFlag)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isLastInSequence",{get:function(){return!!(64&this.lastInSequenceFlag)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"segmentType",{get:function(){return vd.objectDefinition},enumerable:!1,configurable:!0}),t.prototype.read=function(t,e){this.id=t.readUInt16(),this.versionNumber=t.readUInt8(),this.lastInSequenceFlag=t.readUInt8(),this.isFirstInSequence?(this.dataLength=t.readUInt24(),this.width=t.readUInt16(),this.height=t.readUInt16(),this.data=t.readBytes(e-11)):this.data=t.readBytes(e-4)},t}(),Td=function(){this.id=0,this.horizontalPosition=0,this.verticalPosition=0,this.width=0,this.height=0},Pd=function(){function t(){this.windows=[]}return Object.defineProperty(t.prototype,"segmentType",{get:function(){return vd.windowDefinition},enumerable:!1,configurable:!0}),t.prototype.read=function(t,e){var r=t.readUInt8();this.windows=[];for(var n=0;n<r;n++){var o=new Td;o.id=t.readUInt8(),o.horizontalPosition=t.readUInt16(),o.verticalPosition=t.readUInt16(),o.width=t.readUInt16(),o.height=t.readUInt16(),this.windows.push(o)}},t}(),jd=function(){function t(){this.presentationTimestamp=0,this.decodingTimestamp=0,this.paletteDefinitions=[],this.objectDefinitions=[],this.windowDefinitions=[]}return t.prototype.read=function(t,e){return ld(this,void 0,void 0,(function(){var r,n,o,i,a,s,u,c,f;return yd(this,(function(h){switch(h.label){case 0:this.presentationTimestamp=0,this.decodingTimestamp=0,this.presentationComposition=void 0,this.paletteDefinitions=[],this.objectDefinitions=[],this.windowDefinitions=[],r=void 0,"requestData"in t.baseReader&&(r=t.baseReader),h.label=1;case 1:return n=0,o=0,e?[4,null==r?void 0:r.requestData(10)]:[3,3];case 2:if(h.sent(),20551!=t.readUInt16())throw new Error("Invalid magic number!");n=t.readUInt32(),o=t.readUInt32(),h.label=3;case 3:return[4,null==r?void 0:r.requestData(3)];case 4:return h.sent(),i=t.readUInt8(),a=t.readUInt16(),[4,null==r?void 0:r.requestData(a)];case 5:switch(h.sent(),i){case vd.paletteDefinition:(s=new Sd).read(t,a),this.paletteDefinitions.push(s);break;case vd.objectDefinition:(u=new Od).read(t,a),this.objectDefinitions.push(u);break;case vd.presentationComposition:(c=new wd).read(t,a),this.presentationComposition=c,this.presentationTimestamp=n,this.decodingTimestamp=o;break;case vd.windowDefinition:(f=new Pd).read(t,a),this.windowDefinitions.push(f);break;case vd.end:return[2];default:throw new Error("Unsupported segment type ".concat(i))}return[3,1];case 6:return[2]}}))}))},t}(),Ad=function(){function t(t){this.$position=0,this.subReaderIndex=0,this.subReaders=t.map((function(t){return t instanceof Uint8Array?new bd(t):t}));for(var e=0,r=0,n=t;r<n.length;r++){e+=n[r].length}this.$length=e}return t.prototype.push=function(t){t instanceof Uint8Array?this.subReaders.push(new bd(t)):this.subReaders.push(t),this.$length+=t.length},Object.defineProperty(t.prototype,"position",{get:function(){return this.$position},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"length",{get:function(){return this.$length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"eof",{get:function(){return this.position>=this.length},enumerable:!1,configurable:!0}),t.prototype.readByte=function(){for(;this.subReaders[this.subReaderIndex].position>=this.subReaders[this.subReaderIndex].length;)this.subReaderIndex++;return this.$position++,this.subReaders[this.subReaderIndex].readByte()},t.prototype.readBytes=function(t){for(var e=new Uint8Array(t),r=0;r<t;r++)e[r]=this.readByte();return e},t}(),Ed=function(){function t(t){this.$eof=!1,this.stream=t,this.reader=new Ad([])}return Object.defineProperty(t.prototype,"position",{get:function(){return this.reader.position},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"length",{get:function(){return this.reader.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"eof",{get:function(){return this.$eof},enumerable:!1,configurable:!0}),t.prototype.readByte=function(){return this.reader.readByte()},t.prototype.readBytes=function(t){return this.reader.readBytes(t)},t.prototype.requestData=function(){return ld(this,arguments,void 0,(function(t){var e,r,n;return void 0===t&&(t=0),yd(this,(function(o){switch(o.label){case 0:return this.reader.position+t+1>this.reader.length&&!this.$eof?[4,this.stream.read()]:[3,2];case 1:return e=o.sent(),r=e.value,n=e.done,r&&this.reader.push(r),n&&(this.$eof=!0),[3,0];case 2:return[2,this.reader.position+t<=this.reader.length]}}))}))},t}(),Id=function(t,e,r){this.width=t,this.height=e,this.compositionData=r},xd=function(t,e){this.window=t,this.pixelData=e},Rd=function(){function t(){}return t.decode=function(t,e,r){t instanceof Uint8Array&&(t=new bd(t));for(var n=0;t.position<t.length;){var o=t.readByte();if(0==o){var i=t.readByte();if(0!=i){var a=!!(128&i),s=63&i;!!(64&i)&&(s=(s<<8)+t.readByte());for(var u=a?t.readByte():0,c=0;c<s;c++)r[n++]=e[u]}}else r[n++]=e[o]}return n},t}(),Ud=function(){function t(){}return t.getIndexFromTimestamps=function(t,e){var r=1e3*t*90,n=-1;if(e.length>0&&r<e[e.length-1])for(var o=0,i=e;o<i.length;o++){if(i[o]>r)break;n++}return n},t}(),Dd=function(){function t(){this.displaySets=[],this.updateTimestamps=[]}return t.prototype.loadFromUrl=function(t,e){return ld(this,void 0,void 0,(function(){var r,n,o,i,a;return yd(this,(function(s){switch(s.label){case 0:return[4,fetch(t)];case 1:if(!(r=s.sent()).ok)throw new Error("HTTP error: ".concat(r.status));return(n=null===(a=r.body)||void 0===a?void 0:a.getReader())?(o=new Ed(n),[3,4]):[3,2];case 2:return[4,r.arrayBuffer()];case 3:i=s.sent(),o=new bd(new Uint8Array(i)),s.label=4;case 4:return[4,this.loadFromReader(o,e)];case 5:return s.sent(),[2]}}))}))},t.prototype.loadFromBuffer=function(t,e){return ld(this,void 0,void 0,(function(){return yd(this,(function(r){switch(r.label){case 0:return[4,this.loadFromReader(new bd(new Uint8Array(t)),e)];case 1:return r.sent(),[2]}}))}))},t.prototype.loadFromReader=function(t,e){return ld(this,void 0,void 0,(function(){var r,n,o,i;return yd(this,(function(a){switch(a.label){case 0:this.displaySets=[],this.updateTimestamps=[],this.cachedSubtitleData=void 0,r=performance.now(),n=new gd(t),a.label=1;case 1:return t.eof?[3,3]:[4,(o=new jd).read(n,!0)];case 2:return a.sent(),this.displaySets.push(o),this.updateTimestamps.push(o.presentationTimestamp),(null==e?void 0:e.onProgress)&&(i=performance.now())>r+1e3&&(r=i,e.onProgress()),[3,1];case 3:return(null==e?void 0:e.onProgress)&&e.onProgress(),[2]}}))}))},t.prototype.cacheSubtitleAtIndex=function(t){var e=this.getSubtitleAtIndex(t);this.cachedSubtitleData={index:t,data:e}},t.prototype.getSubtitleAtTimestamp=function(t){var e=Ud.getIndexFromTimestamps(t,this.updateTimestamps);return this.getSubtitleAtIndex(e)},t.prototype.getSubtitleAtIndex=function(t){var e;if(this.cachedSubtitleData&&this.cachedSubtitleData.index===t)return this.cachedSubtitleData.data;if(!(t<0||t>=this.displaySets.length)){var r=this.displaySets[t];if(r.presentationComposition){for(var n=[],o=[],i=[],a=t;a>=0;){var s=this.displaySets[a];n.unshift.apply(n,s.objectDefinitions),o.unshift.apply(o,s.paletteDefinitions);for(var u=0,c=s.windowDefinitions;u<c.length;u++){var f=c[u];i.unshift.apply(i,f.windows)}if(0!==(null===(e=this.displaySets[a].presentationComposition)||void 0===e?void 0:e.compositionState))break;a--}var h=o.find((function(t){var e;return t.id===(null===(e=r.presentationComposition)||void 0===e?void 0:e.paletteId)}));if(h){for(var p=[],d=function(t){var e=i.find((function(e){return e.id===t.windowId}));if(!e)return"continue";var r=l.getPixelDataFromComposition(t,h,n);r&&p.push(new xd(e,r))},l=this,y=0,v=r.presentationComposition.compositionObjects;y<v.length;y++){d(v[y])}if(0!==p.length)return new Id(r.presentationComposition.width,r.presentationComposition.height,p)}}}},t.prototype.getPixelDataFromComposition=function(t,e,r){for(var n=0,o=0,i=[],a=0,s=r;a<s.length;a++){var u=s[a];u.id==t.id&&(u.isFirstInSequence&&(n=u.width,o=u.height),u.data&&i.push(u.data))}if(0!=i.length){var c=new Ad(i);if("undefined"!=typeof document){var f=document.createElement("canvas").getContext("2d").createImageData(n,o),h=new Uint32Array(f.data.buffer);return Rd.decode(c,e.rgba,h),f}h=new Uint32Array(n*o);return Rd.decode(c,e.rgba,h),new ImageData(new Uint8ClampedArray(h.buffer),n,o)}},t}(),Bd=new Dd,Cd=void 0,_d=function(){postMessage({op:"updateTimestamps",updateTimestamps:Bd.updateTimestamps})};onmessage=function(t){switch(t.data.op){case"init":var e=t.data.canvas;e&&(Cd=new dd(e));break;case"loadFromUrl":var r=t.data.url;Bd.loadFromUrl(r,{onProgress:function(){_d()}}).then((function(){_d()}));break;case"loadFromBuffer":var n=t.data.buffer;Bd.loadFromBuffer(n).then((function(){_d()}));break;case"render":var o=t.data.index,i=Bd.getSubtitleAtIndex(o);requestAnimationFrame((function(){null==Cd||Cd.draw(i)})),Bd.cacheSubtitleAtIndex(o+1);break;case"requestSubtitleData":o=t.data.index;var a=Bd.getSubtitleAtIndex(o);postMessage({op:"subtitleData",index:o,subtitleData:a}),Bd.cacheSubtitleAtIndex(o+1)}};
var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},e=function(t){return t&&t.Math===Math&&t},r=e("object"==typeof globalThis&&globalThis)||e("object"==typeof window&&window)||e("object"==typeof self&&self)||e("object"==typeof t&&t)||e("object"==typeof t&&t)||function(){return this}()||Function("return this")(),n={},o=function(t){try{return!!t()}catch(t){return!0}},i=!o((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})),a=!o((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})),s=a,u=Function.prototype.call,c=s?u.bind(u):function(){return u.apply(u,arguments)},f={},h={}.propertyIsEnumerable,p=Object.getOwnPropertyDescriptor,d=p&&!h.call({1:2},1);f.f=d?function(t){var e=p(this,t);return!!e&&e.enumerable}:h;var l,y,v=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},b=a,g=Function.prototype,m=g.call,w=b&&g.bind.bind(m,m),S=b?w:function(t){return function(){return m.apply(t,arguments)}},O=S,T=O({}.toString),P=O("".slice),j=function(t){return P(T(t),8,-1)},A=o,E=j,I=Object,x=S("".split),R=A((function(){return!I("z").propertyIsEnumerable(0)}))?function(t){return"String"===E(t)?x(t,""):I(t)}:I,U=function(t){return null==t},D=U,B=TypeError,C=function(t){if(D(t))throw new B("Can't call method on "+t);return t},_=R,F=C,L=function(t){return _(F(t))},k="object"==typeof document&&document.all,N=void 0===k&&void 0!==k?function(t){return"function"==typeof t||t===k}:function(t){return"function"==typeof t},M=N,q=function(t){return"object"==typeof t?null!==t:M(t)},G=r,H=N,$=function(t,e){return arguments.length<2?(r=G[t],H(r)?r:void 0):G[t]&&G[t][e];var r},z=S({}.isPrototypeOf),V=r.navigator,W=V&&V.userAgent,X=W?String(W):"",J=r,Y=X,K=J.process,Z=J.Deno,Q=K&&K.versions||Z&&Z.version,tt=Q&&Q.v8;tt&&(y=(l=tt.split("."))[0]>0&&l[0]<4?1:+(l[0]+l[1])),!y&&Y&&(!(l=Y.match(/Edge\/(\d+)/))||l[1]>=74)&&(l=Y.match(/Chrome\/(\d+)/))&&(y=+l[1]);var et=y,rt=et,nt=o,ot=r.String,it=!!Object.getOwnPropertySymbols&&!nt((function(){var t=Symbol("symbol detection");return!ot(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&rt&&rt<41})),at=it&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,st=$,ut=N,ct=z,ft=Object,ht=at?function(t){return"symbol"==typeof t}:function(t){var e=st("Symbol");return ut(e)&&ct(e.prototype,ft(t))},pt=String,dt=function(t){try{return pt(t)}catch(t){return"Object"}},lt=N,yt=dt,vt=TypeError,bt=function(t){if(lt(t))return t;throw new vt(yt(t)+" is not a function")},gt=bt,mt=U,wt=function(t,e){var r=t[e];return mt(r)?void 0:gt(r)},St=c,Ot=N,Tt=q,Pt=TypeError,jt={exports:{}},At=r,Et=Object.defineProperty,It=function(t,e){try{Et(At,t,{value:e,configurable:!0,writable:!0})}catch(r){At[t]=e}return e},xt=r,Rt=It,Ut="__core-js_shared__",Dt=jt.exports=xt[Ut]||Rt(Ut,{});(Dt.versions||(Dt.versions=[])).push({version:"3.38.1",mode:"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.38.1/LICENSE",source:"https://github.com/zloirock/core-js"});var Bt=jt.exports,Ct=Bt,_t=function(t,e){return Ct[t]||(Ct[t]=e||{})},Ft=C,Lt=Object,kt=function(t){return Lt(Ft(t))},Nt=kt,Mt=S({}.hasOwnProperty),qt=Object.hasOwn||function(t,e){return Mt(Nt(t),e)},Gt=S,Ht=0,$t=Math.random(),zt=Gt(1..toString),Vt=function(t){return"Symbol("+(void 0===t?"":t)+")_"+zt(++Ht+$t,36)},Wt=_t,Xt=qt,Jt=Vt,Yt=it,Kt=at,Zt=r.Symbol,Qt=Wt("wks"),te=Kt?Zt.for||Zt:Zt&&Zt.withoutSetter||Jt,ee=function(t){return Xt(Qt,t)||(Qt[t]=Yt&&Xt(Zt,t)?Zt[t]:te("Symbol."+t)),Qt[t]},re=c,ne=q,oe=ht,ie=wt,ae=function(t,e){var r,n;if("string"===e&&Ot(r=t.toString)&&!Tt(n=St(r,t)))return n;if(Ot(r=t.valueOf)&&!Tt(n=St(r,t)))return n;if("string"!==e&&Ot(r=t.toString)&&!Tt(n=St(r,t)))return n;throw new Pt("Can't convert object to primitive value")},se=TypeError,ue=ee("toPrimitive"),ce=function(t,e){if(!ne(t)||oe(t))return t;var r,n=ie(t,ue);if(n){if(void 0===e&&(e="default"),r=re(n,t,e),!ne(r)||oe(r))return r;throw new se("Can't convert object to primitive value")}return void 0===e&&(e="number"),ae(t,e)},fe=ht,he=function(t){var e=ce(t,"string");return fe(e)?e:e+""},pe=q,de=r.document,le=pe(de)&&pe(de.createElement),ye=function(t){return le?de.createElement(t):{}},ve=ye,be=!i&&!o((function(){return 7!==Object.defineProperty(ve("div"),"a",{get:function(){return 7}}).a})),ge=i,me=c,we=f,Se=v,Oe=L,Te=he,Pe=qt,je=be,Ae=Object.getOwnPropertyDescriptor;n.f=ge?Ae:function(t,e){if(t=Oe(t),e=Te(e),je)try{return Ae(t,e)}catch(t){}if(Pe(t,e))return Se(!me(we.f,t,e),t[e])};var Ee={},Ie=i&&o((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),xe=q,Re=String,Ue=TypeError,De=function(t){if(xe(t))return t;throw new Ue(Re(t)+" is not an object")},Be=i,Ce=be,_e=Ie,Fe=De,Le=he,ke=TypeError,Ne=Object.defineProperty,Me=Object.getOwnPropertyDescriptor,qe="enumerable",Ge="configurable",He="writable";Ee.f=Be?_e?function(t,e,r){if(Fe(t),e=Le(e),Fe(r),"function"==typeof t&&"prototype"===e&&"value"in r&&He in r&&!r[He]){var n=Me(t,e);n&&n[He]&&(t[e]=r.value,r={configurable:Ge in r?r[Ge]:n[Ge],enumerable:qe in r?r[qe]:n[qe],writable:!1})}return Ne(t,e,r)}:Ne:function(t,e,r){if(Fe(t),e=Le(e),Fe(r),Ce)try{return Ne(t,e,r)}catch(t){}if("get"in r||"set"in r)throw new ke("Accessors not supported");return"value"in r&&(t[e]=r.value),t};var $e=Ee,ze=v,Ve=i?function(t,e,r){return $e.f(t,e,ze(1,r))}:function(t,e,r){return t[e]=r,t},We={exports:{}},Xe=i,Je=qt,Ye=Function.prototype,Ke=Xe&&Object.getOwnPropertyDescriptor,Ze=Je(Ye,"name"),Qe={EXISTS:Ze,PROPER:Ze&&"something"===function(){}.name,CONFIGURABLE:Ze&&(!Xe||Xe&&Ke(Ye,"name").configurable)},tr=N,er=Bt,rr=S(Function.toString);tr(er.inspectSource)||(er.inspectSource=function(t){return rr(t)});var nr,or,ir,ar=er.inspectSource,sr=N,ur=r.WeakMap,cr=sr(ur)&&/native code/.test(String(ur)),fr=Vt,hr=_t("keys"),pr=function(t){return hr[t]||(hr[t]=fr(t))},dr={},lr=cr,yr=r,vr=q,br=Ve,gr=qt,mr=Bt,wr=pr,Sr=dr,Or="Object already initialized",Tr=yr.TypeError,Pr=yr.WeakMap;if(lr||mr.state){var jr=mr.state||(mr.state=new Pr);jr.get=jr.get,jr.has=jr.has,jr.set=jr.set,nr=function(t,e){if(jr.has(t))throw new Tr(Or);return e.facade=t,jr.set(t,e),e},or=function(t){return jr.get(t)||{}},ir=function(t){return jr.has(t)}}else{var Ar=wr("state");Sr[Ar]=!0,nr=function(t,e){if(gr(t,Ar))throw new Tr(Or);return e.facade=t,br(t,Ar,e),e},or=function(t){return gr(t,Ar)?t[Ar]:{}},ir=function(t){return gr(t,Ar)}}var Er={set:nr,get:or,has:ir,enforce:function(t){return ir(t)?or(t):nr(t,{})},getterFor:function(t){return function(e){var r;if(!vr(e)||(r=or(e)).type!==t)throw new Tr("Incompatible receiver, "+t+" required");return r}}},Ir=S,xr=o,Rr=N,Ur=qt,Dr=i,Br=Qe.CONFIGURABLE,Cr=ar,_r=Er.enforce,Fr=Er.get,Lr=String,kr=Object.defineProperty,Nr=Ir("".slice),Mr=Ir("".replace),qr=Ir([].join),Gr=Dr&&!xr((function(){return 8!==kr((function(){}),"length",{value:8}).length})),Hr=String(String).split("String"),$r=We.exports=function(t,e,r){"Symbol("===Nr(Lr(e),0,7)&&(e="["+Mr(Lr(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(e="get "+e),r&&r.setter&&(e="set "+e),(!Ur(t,"name")||Br&&t.name!==e)&&(Dr?kr(t,"name",{value:e,configurable:!0}):t.name=e),Gr&&r&&Ur(r,"arity")&&t.length!==r.arity&&kr(t,"length",{value:r.arity});try{r&&Ur(r,"constructor")&&r.constructor?Dr&&kr(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var n=_r(t);return Ur(n,"source")||(n.source=qr(Hr,"string"==typeof e?e:"")),t};Function.prototype.toString=$r((function(){return Rr(this)&&Fr(this).source||Cr(this)}),"toString");var zr=We.exports,Vr=N,Wr=Ee,Xr=zr,Jr=It,Yr=function(t,e,r,n){n||(n={});var o=n.enumerable,i=void 0!==n.name?n.name:e;if(Vr(r)&&Xr(r,i,n),n.global)o?t[e]=r:Jr(e,r);else{try{n.unsafe?t[e]&&(o=!0):delete t[e]}catch(t){}o?t[e]=r:Wr.f(t,e,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return t},Kr={},Zr=Math.ceil,Qr=Math.floor,tn=Math.trunc||function(t){var e=+t;return(e>0?Qr:Zr)(e)},en=function(t){var e=+t;return e!=e||0===e?0:tn(e)},rn=en,nn=Math.max,on=Math.min,an=en,sn=Math.min,un=function(t){var e=an(t);return e>0?sn(e,9007199254740991):0},cn=function(t){return un(t.length)},fn=L,hn=function(t,e){var r=rn(t);return r<0?nn(r+e,0):on(r,e)},pn=cn,dn=function(t){return function(e,r,n){var o=fn(e),i=pn(o);if(0===i)return!t&&-1;var a,s=hn(n,i);if(t&&r!=r){for(;i>s;)if((a=o[s++])!=a)return!0}else for(;i>s;s++)if((t||s in o)&&o[s]===r)return t||s||0;return!t&&-1}},ln={includes:dn(!0),indexOf:dn(!1)},yn=qt,vn=L,bn=ln.indexOf,gn=dr,mn=S([].push),wn=function(t,e){var r,n=vn(t),o=0,i=[];for(r in n)!yn(gn,r)&&yn(n,r)&&mn(i,r);for(;e.length>o;)yn(n,r=e[o++])&&(~bn(i,r)||mn(i,r));return i},Sn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],On=wn,Tn=Sn.concat("length","prototype");Kr.f=Object.getOwnPropertyNames||function(t){return On(t,Tn)};var Pn={};Pn.f=Object.getOwnPropertySymbols;var jn=$,An=Kr,En=Pn,In=De,xn=S([].concat),Rn=jn("Reflect","ownKeys")||function(t){var e=An.f(In(t)),r=En.f;return r?xn(e,r(t)):e},Un=qt,Dn=Rn,Bn=n,Cn=Ee,_n=function(t,e,r){for(var n=Dn(e),o=Cn.f,i=Bn.f,a=0;a<n.length;a++){var s=n[a];Un(t,s)||r&&Un(r,s)||o(t,s,i(e,s))}},Fn=o,Ln=N,kn=/#|\.prototype\./,Nn=function(t,e){var r=qn[Mn(t)];return r===Hn||r!==Gn&&(Ln(e)?Fn(e):!!e)},Mn=Nn.normalize=function(t){return String(t).replace(kn,".").toLowerCase()},qn=Nn.data={},Gn=Nn.NATIVE="N",Hn=Nn.POLYFILL="P",$n=Nn,zn=r,Vn=n.f,Wn=Ve,Xn=Yr,Jn=It,Yn=_n,Kn=$n,Zn=function(t,e){var r,n,o,i,a,s=t.target,u=t.global,c=t.stat;if(r=u?zn:c?zn[s]||Jn(s,{}):zn[s]&&zn[s].prototype)for(n in e){if(i=e[n],o=t.dontCallGetSet?(a=Vn(r,n))&&a.value:r[n],!Kn(u?n:s+(c?".":"#")+n,t.forced)&&void 0!==o){if(typeof i==typeof o)continue;Yn(i,o)}(t.sham||o&&o.sham)&&Wn(i,"sham",!0),Xn(r,n,i,t)}},Qn=j,to=S,eo=function(t){if("Function"===Qn(t))return to(t)},ro=bt,no=a,oo=eo(eo.bind),io=function(t,e){return ro(t),void 0===e?t:no?oo(t,e):function(){return t.apply(e,arguments)}},ao=j,so=Array.isArray||function(t){return"Array"===ao(t)},uo={};uo[ee("toStringTag")]="z";var co="[object z]"===String(uo),fo=co,ho=N,po=j,lo=ee("toStringTag"),yo=Object,vo="Arguments"===po(function(){return arguments}()),bo=fo?po:function(t){var e,r,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(e=yo(t),lo))?r:vo?po(e):"Object"===(n=po(e))&&ho(e.callee)?"Arguments":n},go=S,mo=o,wo=N,So=bo,Oo=ar,To=function(){},Po=$("Reflect","construct"),jo=/^\s*(?:class|function)\b/,Ao=go(jo.exec),Eo=!jo.test(To),Io=function(t){if(!wo(t))return!1;try{return Po(To,[],t),!0}catch(t){return!1}},xo=function(t){if(!wo(t))return!1;switch(So(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Eo||!!Ao(jo,Oo(t))}catch(t){return!0}};xo.sham=!0;var Ro=!Po||mo((function(){var t;return Io(Io.call)||!Io(Object)||!Io((function(){t=!0}))||t}))?xo:Io,Uo=so,Do=Ro,Bo=q,Co=ee("species"),_o=Array,Fo=function(t){var e;return Uo(t)&&(e=t.constructor,(Do(e)&&(e===_o||Uo(e.prototype))||Bo(e)&&null===(e=e[Co]))&&(e=void 0)),void 0===e?_o:e},Lo=io,ko=R,No=kt,Mo=cn,qo=function(t,e){return new(Fo(t))(0===e?0:e)},Go=S([].push),Ho=function(t){var e=1===t,r=2===t,n=3===t,o=4===t,i=6===t,a=7===t,s=5===t||i;return function(u,c,f,h){for(var p,d,l=No(u),y=ko(l),v=Mo(y),b=Lo(c,f),g=0,m=h||qo,w=e?m(u,v):r||a?m(u,0):void 0;v>g;g++)if((s||g in y)&&(d=b(p=y[g],g,l),t))if(e)w[g]=d;else if(d)switch(t){case 3:return!0;case 5:return p;case 6:return g;case 2:Go(w,p)}else switch(t){case 4:return!1;case 7:Go(w,p)}return i?-1:n||o?o:w}},$o={forEach:Ho(0),map:Ho(1),filter:Ho(2),some:Ho(3),every:Ho(4),find:Ho(5),findIndex:Ho(6),filterReject:Ho(7)},zo={},Vo=wn,Wo=Sn,Xo=Object.keys||function(t){return Vo(t,Wo)},Jo=i,Yo=Ie,Ko=Ee,Zo=De,Qo=L,ti=Xo;zo.f=Jo&&!Yo?Object.defineProperties:function(t,e){Zo(t);for(var r,n=Qo(e),o=ti(e),i=o.length,a=0;i>a;)Ko.f(t,r=o[a++],n[r]);return t};var ei,ri=$("document","documentElement"),ni=De,oi=zo,ii=Sn,ai=dr,si=ri,ui=ye,ci="prototype",fi="script",hi=pr("IE_PROTO"),pi=function(){},di=function(t){return"<"+fi+">"+t+"</"+fi+">"},li=function(t){t.write(di("")),t.close();var e=t.parentWindow.Object;return t=null,e},yi=function(){try{ei=new ActiveXObject("htmlfile")}catch(t){}var t,e,r;yi="undefined"!=typeof document?document.domain&&ei?li(ei):(e=ui("iframe"),r="java"+fi+":",e.style.display="none",si.appendChild(e),e.src=String(r),(t=e.contentWindow.document).open(),t.write(di("document.F=Object")),t.close(),t.F):li(ei);for(var n=ii.length;n--;)delete yi[ci][ii[n]];return yi()};ai[hi]=!0;var vi=Object.create||function(t,e){var r;return null!==t?(pi[ci]=ni(t),r=new pi,pi[ci]=null,r[hi]=t):r=yi(),void 0===e?r:oi.f(r,e)},bi=ee,gi=vi,mi=Ee.f,wi=bi("unscopables"),Si=Array.prototype;void 0===Si[wi]&&mi(Si,wi,{configurable:!0,value:gi(null)});var Oi=function(t){Si[wi][t]=!0},Ti=Zn,Pi=$o.find,ji=Oi,Ai="find",Ei=!0;Ai in[]&&Array(1)[Ai]((function(){Ei=!1})),Ti({target:"Array",proto:!0,forced:Ei},{find:function(t){return Pi(this,t,arguments.length>1?arguments[1]:void 0)}}),ji(Ai);var Ii=r,xi=S;(function(t,e){xi(Ii[t].prototype[e])})("Array","find");var Ri=!o((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})),Ui=qt,Di=N,Bi=kt,Ci=Ri,_i=pr("IE_PROTO"),Fi=Object,Li=Fi.prototype,ki=Ci?Fi.getPrototypeOf:function(t){var e=Bi(t);if(Ui(e,_i))return e[_i];var r=e.constructor;return Di(r)&&e instanceof r?r.prototype:e instanceof Fi?Li:null},Ni=S,Mi=bt,qi=q,Gi=function(t){return qi(t)||null===t},Hi=String,$i=TypeError,zi=function(t,e,r){try{return Ni(Mi(Object.getOwnPropertyDescriptor(t,e)[r]))}catch(t){}},Vi=q,Wi=C,Xi=function(t){if(Gi(t))return t;throw new $i("Can't set "+Hi(t)+" as a prototype")},Ji=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,r={};try{(t=zi(Object.prototype,"__proto__","set"))(r,[]),e=r instanceof Array}catch(t){}return function(r,n){return Wi(r),Xi(n),Vi(r)?(e?t(r,n):r.__proto__=n,r):r}}():void 0),Yi=q,Ki=Ve,Zi=Error,Qi=S("".replace),ta=String(new Zi("zxcasd").stack),ea=/\n\s*at [^:]*:[^\n]*/,ra=ea.test(ta),na=v,oa=!o((function(){var t=new Error("a");return!("stack"in t)||(Object.defineProperty(t,"stack",na(1,7)),7!==t.stack)})),ia=Ve,aa=function(t,e){if(ra&&"string"==typeof t&&!Zi.prepareStackTrace)for(;e--;)t=Qi(t,ea,"");return t},sa=oa,ua=Error.captureStackTrace,ca={},fa=ca,ha=ee("iterator"),pa=Array.prototype,da=bo,la=wt,ya=U,va=ca,ba=ee("iterator"),ga=function(t){if(!ya(t))return la(t,ba)||la(t,"@@iterator")||va[da(t)]},ma=c,wa=bt,Sa=De,Oa=dt,Ta=ga,Pa=TypeError,ja=c,Aa=De,Ea=wt,Ia=io,xa=c,Ra=De,Ua=dt,Da=function(t){return void 0!==t&&(fa.Array===t||pa[ha]===t)},Ba=cn,Ca=z,_a=function(t,e){var r=arguments.length<2?Ta(t):e;if(wa(r))return Sa(ma(r,t));throw new Pa(Oa(t)+" is not iterable")},Fa=ga,La=function(t,e,r){var n,o;Aa(t);try{if(!(n=Ea(t,"return"))){if("throw"===e)throw r;return r}n=ja(n,t)}catch(t){o=!0,n=t}if("throw"===e)throw r;if(o)throw n;return Aa(n),r},ka=TypeError,Na=function(t,e){this.stopped=t,this.result=e},Ma=Na.prototype,qa=function(t,e,r){var n,o,i,a,s,u,c,f=r&&r.that,h=!(!r||!r.AS_ENTRIES),p=!(!r||!r.IS_RECORD),d=!(!r||!r.IS_ITERATOR),l=!(!r||!r.INTERRUPTED),y=Ia(e,f),v=function(t){return n&&La(n,"normal",t),new Na(!0,t)},b=function(t){return h?(Ra(t),l?y(t[0],t[1],v):y(t[0],t[1])):l?y(t,v):y(t)};if(p)n=t.iterator;else if(d)n=t;else{if(!(o=Fa(t)))throw new ka(Ua(t)+" is not iterable");if(Da(o)){for(i=0,a=Ba(t);a>i;i++)if((s=b(t[i]))&&Ca(Ma,s))return s;return new Na(!1)}n=_a(t,o)}for(u=p?t.next:n.next;!(c=xa(u,n)).done;){try{s=b(c.value)}catch(t){La(n,"throw",t)}if("object"==typeof s&&s&&Ca(Ma,s))return s}return new Na(!1)},Ga=bo,Ha=String,$a=function(t){if("Symbol"===Ga(t))throw new TypeError("Cannot convert a Symbol value to a string");return Ha(t)},za=$a,Va=Zn,Wa=z,Xa=ki,Ja=Ji,Ya=_n,Ka=vi,Za=Ve,Qa=v,ts=function(t,e){Yi(e)&&"cause"in e&&Ki(t,"cause",e.cause)},es=function(t,e,r,n){sa&&(ua?ua(t,e):ia(t,"stack",aa(r,n)))},rs=qa,ns=function(t,e){return void 0===t?arguments.length<2?"":e:za(t)},os=ee("toStringTag"),is=Error,as=[].push,ss=function(t,e){var r,n=Wa(us,this);Ja?r=Ja(new is,n?Xa(this):us):(r=n?this:Ka(us),Za(r,os,"Error")),void 0!==e&&Za(r,"message",ns(e)),es(r,ss,r.stack,1),arguments.length>2&&ts(r,arguments[2]);var o=[];return rs(t,as,{that:o}),Za(r,"errors",o),r};Ja?Ja(ss,is):Ya(ss,is,{name:!0});var us=ss.prototype=Ka(is.prototype,{constructor:Qa(1,ss),message:Qa(1,""),name:Qa(1,"AggregateError")});Va({global:!0,constructor:!0,arity:2},{AggregateError:ss});var cs,fs,hs,ps=o,ds=N,ls=q,ys=ki,vs=Yr,bs=ee("iterator"),gs=!1;[].keys&&("next"in(hs=[].keys())?(fs=ys(ys(hs)))!==Object.prototype&&(cs=fs):gs=!0);var ms=!ls(cs)||ps((function(){var t={};return cs[bs].call(t)!==t}));ms&&(cs={}),ds(cs[bs])||vs(cs,bs,(function(){return this}));var ws={IteratorPrototype:cs,BUGGY_SAFARI_ITERATORS:gs},Ss=Ee.f,Os=qt,Ts=ee("toStringTag"),Ps=function(t,e,r){t&&!r&&(t=t.prototype),t&&!Os(t,Ts)&&Ss(t,Ts,{configurable:!0,value:e})},js=ws.IteratorPrototype,As=vi,Es=v,Is=Ps,xs=ca,Rs=function(){return this},Us=Zn,Ds=c,Bs=N,Cs=function(t,e,r,n){var o=e+" Iterator";return t.prototype=As(js,{next:Es(+!n,r)}),Is(t,o,!1),xs[o]=Rs,t},_s=ki,Fs=Ji,Ls=Ps,ks=Ve,Ns=Yr,Ms=ca,qs=Qe.PROPER,Gs=Qe.CONFIGURABLE,Hs=ws.IteratorPrototype,$s=ws.BUGGY_SAFARI_ITERATORS,zs=ee("iterator"),Vs="keys",Ws="values",Xs="entries",Js=function(){return this},Ys=function(t,e,r,n,o,i,a){Cs(r,e,n);var s,u,c,f=function(t){if(t===o&&y)return y;if(!$s&&t&&t in d)return d[t];switch(t){case Vs:case Ws:case Xs:return function(){return new r(this,t)}}return function(){return new r(this)}},h=e+" Iterator",p=!1,d=t.prototype,l=d[zs]||d["@@iterator"]||o&&d[o],y=!$s&&l||f(o),v="Array"===e&&d.entries||l;if(v&&(s=_s(v.call(new t)))!==Object.prototype&&s.next&&(_s(s)!==Hs&&(Fs?Fs(s,Hs):Bs(s[zs])||Ns(s,zs,Js)),Ls(s,h,!0)),qs&&o===Ws&&l&&l.name!==Ws&&(Gs?ks(d,"name",Ws):(p=!0,y=function(){return Ds(l,this)})),o)if(u={values:f(Ws),keys:i?y:f(Vs),entries:f(Xs)},a)for(c in u)($s||p||!(c in d))&&Ns(d,c,u[c]);else Us({target:e,proto:!0,forced:$s||p},u);return d[zs]!==y&&Ns(d,zs,y,{name:o}),Ms[e]=y,u},Ks=function(t,e){return{value:t,done:e}},Zs=L,Qs=Oi,tu=ca,eu=Er,ru=Ee.f,nu=Ys,ou=Ks,iu=i,au="Array Iterator",su=eu.set,uu=eu.getterFor(au),cu=nu(Array,"Array",(function(t,e){su(this,{type:au,target:Zs(t),index:0,kind:e})}),(function(){var t=uu(this),e=t.target,r=t.index++;if(!e||r>=e.length)return t.target=null,ou(void 0,!0);switch(t.kind){case"keys":return ou(r,!1);case"values":return ou(e[r],!1)}return ou([r,e[r]],!1)}),"values"),fu=tu.Arguments=tu.Array;if(Qs("keys"),Qs("values"),Qs("entries"),iu&&"values"!==fu.name)try{ru(fu,"name",{value:"values"})}catch(t){}var hu=bo,pu=co?{}.toString:function(){return"[object "+hu(this)+"]"};co||Yr(Object.prototype,"toString",pu,{unsafe:!0});var du,lu,yu,vu,bu=r,gu=X,mu=j,wu=function(t){return gu.slice(0,t.length)===t},Su=wu("Bun/")?"BUN":wu("Cloudflare-Workers")?"CLOUDFLARE":wu("Deno/")?"DENO":wu("Node.js/")?"NODE":bu.Bun&&"string"==typeof Bun.version?"BUN":bu.Deno&&"object"==typeof Deno.version?"DENO":"process"===mu(bu.process)?"NODE":bu.window&&bu.document?"BROWSER":"REST",Ou="NODE"===Su,Tu=zr,Pu=Ee,ju=$,Au=function(t,e,r){return r.get&&Tu(r.get,e,{getter:!0}),r.set&&Tu(r.set,e,{setter:!0}),Pu.f(t,e,r)},Eu=i,Iu=ee("species"),xu=z,Ru=TypeError,Uu=Ro,Du=dt,Bu=TypeError,Cu=De,_u=function(t){if(Uu(t))return t;throw new Bu(Du(t)+" is not a constructor")},Fu=U,Lu=ee("species"),ku=function(t,e){var r,n=Cu(t).constructor;return void 0===n||Fu(r=Cu(n)[Lu])?e:_u(r)},Nu=a,Mu=Function.prototype,qu=Mu.apply,Gu=Mu.call,Hu="object"==typeof Reflect&&Reflect.apply||(Nu?Gu.bind(qu):function(){return Gu.apply(qu,arguments)}),$u=S([].slice),zu=TypeError,Vu=/(?:ipad|iphone|ipod).*applewebkit/i.test(X),Wu=r,Xu=Hu,Ju=io,Yu=N,Ku=qt,Zu=o,Qu=ri,tc=$u,ec=ye,rc=function(t,e){if(t<e)throw new zu("Not enough arguments");return t},nc=Vu,oc=Ou,ic=Wu.setImmediate,ac=Wu.clearImmediate,sc=Wu.process,uc=Wu.Dispatch,cc=Wu.Function,fc=Wu.MessageChannel,hc=Wu.String,pc=0,dc={},lc="onreadystatechange";Zu((function(){du=Wu.location}));var yc=function(t){if(Ku(dc,t)){var e=dc[t];delete dc[t],e()}},vc=function(t){return function(){yc(t)}},bc=function(t){yc(t.data)},gc=function(t){Wu.postMessage(hc(t),du.protocol+"//"+du.host)};ic&&ac||(ic=function(t){rc(arguments.length,1);var e=Yu(t)?t:cc(t),r=tc(arguments,1);return dc[++pc]=function(){Xu(e,void 0,r)},lu(pc),pc},ac=function(t){delete dc[t]},oc?lu=function(t){sc.nextTick(vc(t))}:uc&&uc.now?lu=function(t){uc.now(vc(t))}:fc&&!nc?(vu=(yu=new fc).port2,yu.port1.onmessage=bc,lu=Ju(vu.postMessage,vu)):Wu.addEventListener&&Yu(Wu.postMessage)&&!Wu.importScripts&&du&&"file:"!==du.protocol&&!Zu(gc)?(lu=gc,Wu.addEventListener("message",bc,!1)):lu=lc in ec("script")?function(t){Qu.appendChild(ec("script"))[lc]=function(){Qu.removeChild(this),yc(t)}}:function(t){setTimeout(vc(t),0)});var mc={set:ic,clear:ac},wc=r,Sc=i,Oc=Object.getOwnPropertyDescriptor,Tc=function(){this.head=null,this.tail=null};Tc.prototype={add:function(t){var e={item:t,next:null},r=this.tail;r?r.next=e:this.head=e,this.tail=e},get:function(){var t=this.head;if(t)return null===(this.head=t.next)&&(this.tail=null),t.item}};var Pc,jc,Ac,Ec,Ic,xc=Tc,Rc=/ipad|iphone|ipod/i.test(X)&&"undefined"!=typeof Pebble,Uc=/web0s(?!.*chrome)/i.test(X),Dc=r,Bc=function(t){if(!Sc)return wc[t];var e=Oc(wc,t);return e&&e.value},Cc=io,_c=mc.set,Fc=xc,Lc=Vu,kc=Rc,Nc=Uc,Mc=Ou,qc=Dc.MutationObserver||Dc.WebKitMutationObserver,Gc=Dc.document,Hc=Dc.process,$c=Dc.Promise,zc=Bc("queueMicrotask");if(!zc){var Vc=new Fc,Wc=function(){var t,e;for(Mc&&(t=Hc.domain)&&t.exit();e=Vc.get();)try{e()}catch(t){throw Vc.head&&Pc(),t}t&&t.enter()};Lc||Mc||Nc||!qc||!Gc?!kc&&$c&&$c.resolve?((Ec=$c.resolve(void 0)).constructor=$c,Ic=Cc(Ec.then,Ec),Pc=function(){Ic(Wc)}):Mc?Pc=function(){Hc.nextTick(Wc)}:(_c=Cc(_c,Dc),Pc=function(){_c(Wc)}):(jc=!0,Ac=Gc.createTextNode(""),new qc(Wc).observe(Ac,{characterData:!0}),Pc=function(){Ac.data=jc=!jc}),zc=function(t){Vc.head||Pc(),Vc.add(t)}}var Xc=zc,Jc=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}},Yc=r.Promise,Kc=r,Zc=Yc,Qc=N,tf=$n,ef=ar,rf=ee,nf=Su,of=et;Zc&&Zc.prototype;var af=rf("species"),sf=!1,uf=Qc(Kc.PromiseRejectionEvent),cf=tf("Promise",(function(){var t=ef(Zc),e=t!==String(Zc);if(!e&&66===of)return!0;if(!of||of<51||!/native code/.test(t)){var r=new Zc((function(t){t(1)})),n=function(t){t((function(){}),(function(){}))};if((r.constructor={})[af]=n,!(sf=r.then((function(){}))instanceof n))return!0}return!(e||"BROWSER"!==nf&&"DENO"!==nf||uf)})),ff={CONSTRUCTOR:cf,REJECTION_EVENT:uf,SUBCLASSING:sf},hf={},pf=bt,df=TypeError,lf=function(t){var e,r;this.promise=new t((function(t,n){if(void 0!==e||void 0!==r)throw new df("Bad Promise constructor");e=t,r=n})),this.resolve=pf(e),this.reject=pf(r)};hf.f=function(t){return new lf(t)};var yf,vf,bf,gf=Zn,mf=Ou,wf=r,Sf=c,Of=Yr,Tf=Ji,Pf=Ps,jf=function(t){var e=ju(t);Eu&&e&&!e[Iu]&&Au(e,Iu,{configurable:!0,get:function(){return this}})},Af=bt,Ef=N,If=q,xf=function(t,e){if(xu(e,t))return t;throw new Ru("Incorrect invocation")},Rf=ku,Uf=mc.set,Df=Xc,Bf=function(t,e){try{1===arguments.length?console.error(t):console.error(t,e)}catch(t){}},Cf=Jc,_f=xc,Ff=Er,Lf=Yc,kf=hf,Nf="Promise",Mf=ff.CONSTRUCTOR,qf=ff.REJECTION_EVENT,Gf=ff.SUBCLASSING,Hf=Ff.getterFor(Nf),$f=Ff.set,zf=Lf&&Lf.prototype,Vf=Lf,Wf=zf,Xf=wf.TypeError,Jf=wf.document,Yf=wf.process,Kf=kf.f,Zf=Kf,Qf=!!(Jf&&Jf.createEvent&&wf.dispatchEvent),th="unhandledrejection",eh=function(t){var e;return!(!If(t)||!Ef(e=t.then))&&e},rh=function(t,e){var r,n,o,i=e.value,a=1===e.state,s=a?t.ok:t.fail,u=t.resolve,c=t.reject,f=t.domain;try{s?(a||(2===e.rejection&&sh(e),e.rejection=1),!0===s?r=i:(f&&f.enter(),r=s(i),f&&(f.exit(),o=!0)),r===t.promise?c(new Xf("Promise-chain cycle")):(n=eh(r))?Sf(n,r,u,c):u(r)):c(i)}catch(t){f&&!o&&f.exit(),c(t)}},nh=function(t,e){t.notified||(t.notified=!0,Df((function(){for(var r,n=t.reactions;r=n.get();)rh(r,t);t.notified=!1,e&&!t.rejection&&ih(t)})))},oh=function(t,e,r){var n,o;Qf?((n=Jf.createEvent("Event")).promise=e,n.reason=r,n.initEvent(t,!1,!0),wf.dispatchEvent(n)):n={promise:e,reason:r},!qf&&(o=wf["on"+t])?o(n):t===th&&Bf("Unhandled promise rejection",r)},ih=function(t){Sf(Uf,wf,(function(){var e,r=t.facade,n=t.value;if(ah(t)&&(e=Cf((function(){mf?Yf.emit("unhandledRejection",n,r):oh(th,r,n)})),t.rejection=mf||ah(t)?2:1,e.error))throw e.value}))},ah=function(t){return 1!==t.rejection&&!t.parent},sh=function(t){Sf(Uf,wf,(function(){var e=t.facade;mf?Yf.emit("rejectionHandled",e):oh("rejectionhandled",e,t.value)}))},uh=function(t,e,r){return function(n){t(e,n,r)}},ch=function(t,e,r){t.done||(t.done=!0,r&&(t=r),t.value=e,t.state=2,nh(t,!0))},fh=function(t,e,r){if(!t.done){t.done=!0,r&&(t=r);try{if(t.facade===e)throw new Xf("Promise can't be resolved itself");var n=eh(e);n?Df((function(){var r={done:!1};try{Sf(n,e,uh(fh,r,t),uh(ch,r,t))}catch(e){ch(r,e,t)}})):(t.value=e,t.state=1,nh(t,!1))}catch(e){ch({done:!1},e,t)}}};if(Mf&&(Wf=(Vf=function(t){xf(this,Wf),Af(t),Sf(yf,this);var e=Hf(this);try{t(uh(fh,e),uh(ch,e))}catch(t){ch(e,t)}}).prototype,(yf=function(t){$f(this,{type:Nf,done:!1,notified:!1,parent:!1,reactions:new _f,rejection:!1,state:0,value:null})}).prototype=Of(Wf,"then",(function(t,e){var r=Hf(this),n=Kf(Rf(this,Vf));return r.parent=!0,n.ok=!Ef(t)||t,n.fail=Ef(e)&&e,n.domain=mf?Yf.domain:void 0,0===r.state?r.reactions.add(n):Df((function(){rh(n,r)})),n.promise})),vf=function(){var t=new yf,e=Hf(t);this.promise=t,this.resolve=uh(fh,e),this.reject=uh(ch,e)},kf.f=Kf=function(t){return t===Vf||undefined===t?new vf(t):Zf(t)},Ef(Lf)&&zf!==Object.prototype)){bf=zf.then,Gf||Of(zf,"then",(function(t,e){var r=this;return new Vf((function(t,e){Sf(bf,r,t,e)})).then(t,e)}),{unsafe:!0});try{delete zf.constructor}catch(t){}Tf&&Tf(zf,Wf)}gf({global:!0,constructor:!0,wrap:!0,forced:Mf},{Promise:Vf}),Pf(Vf,Nf,!1),jf(Nf);var hh=ee("iterator"),ph=!1;try{var dh=0,lh={next:function(){return{done:!!dh++}},return:function(){ph=!0}};lh[hh]=function(){return this},Array.from(lh,(function(){throw 2}))}catch(t){}var yh=Yc,vh=function(t,e){try{if(!e&&!ph)return!1}catch(t){return!1}var r=!1;try{var n={};n[hh]=function(){return{next:function(){return{done:r=!0}}}},t(n)}catch(t){}return r},bh=ff.CONSTRUCTOR||!vh((function(t){yh.all(t).then(void 0,(function(){}))})),gh=c,mh=bt,wh=hf,Sh=Jc,Oh=qa;Zn({target:"Promise",stat:!0,forced:bh},{all:function(t){var e=this,r=wh.f(e),n=r.resolve,o=r.reject,i=Sh((function(){var r=mh(e.resolve),i=[],a=0,s=1;Oh(t,(function(t){var u=a++,c=!1;s++,gh(r,e,t).then((function(t){c||(c=!0,i[u]=t,--s||n(i))}),o)})),--s||n(i)}));return i.error&&o(i.value),r.promise}});var Th=Zn,Ph=ff.CONSTRUCTOR,jh=Yc,Ah=$,Eh=N,Ih=Yr,xh=jh&&jh.prototype;if(Th({target:"Promise",proto:!0,forced:Ph,real:!0},{catch:function(t){return this.then(void 0,t)}}),Eh(jh)){var Rh=Ah("Promise").prototype.catch;xh.catch!==Rh&&Ih(xh,"catch",Rh,{unsafe:!0})}var Uh=c,Dh=bt,Bh=hf,Ch=Jc,_h=qa;Zn({target:"Promise",stat:!0,forced:bh},{race:function(t){var e=this,r=Bh.f(e),n=r.reject,o=Ch((function(){var o=Dh(e.resolve);_h(t,(function(t){Uh(o,e,t).then(r.resolve,n)}))}));return o.error&&n(o.value),r.promise}});var Fh=hf;Zn({target:"Promise",stat:!0,forced:ff.CONSTRUCTOR},{reject:function(t){var e=Fh.f(this);return(0,e.reject)(t),e.promise}});var Lh=De,kh=q,Nh=hf,Mh=function(t,e){if(Lh(t),kh(e)&&e.constructor===t)return e;var r=Nh.f(t);return(0,r.resolve)(e),r.promise},qh=Zn,Gh=ff.CONSTRUCTOR,Hh=Mh;$("Promise"),qh({target:"Promise",stat:!0,forced:Gh},{resolve:function(t){return Hh(this,t)}});var $h=c,zh=bt,Vh=hf,Wh=Jc,Xh=qa;Zn({target:"Promise",stat:!0,forced:bh},{allSettled:function(t){var e=this,r=Vh.f(e),n=r.resolve,o=r.reject,i=Wh((function(){var r=zh(e.resolve),o=[],i=0,a=1;Xh(t,(function(t){var s=i++,u=!1;a++,$h(r,e,t).then((function(t){u||(u=!0,o[s]={status:"fulfilled",value:t},--a||n(o))}),(function(t){u||(u=!0,o[s]={status:"rejected",reason:t},--a||n(o))}))})),--a||n(o)}));return i.error&&o(i.value),r.promise}});var Jh=c,Yh=bt,Kh=$,Zh=hf,Qh=Jc,tp=qa,ep="No one promise resolved";Zn({target:"Promise",stat:!0,forced:bh},{any:function(t){var e=this,r=Kh("AggregateError"),n=Zh.f(e),o=n.resolve,i=n.reject,a=Qh((function(){var n=Yh(e.resolve),a=[],s=0,u=1,c=!1;tp(t,(function(t){var f=s++,h=!1;u++,Jh(n,e,t).then((function(t){h||c||(c=!0,o(t))}),(function(t){h||c||(h=!0,a[f]=t,--u||i(new r(a,ep)))}))})),--u||i(new r(a,ep))}));return a.error&&i(a.value),n.promise}});var rp=hf;Zn({target:"Promise",stat:!0},{withResolvers:function(){var t=rp.f(this);return{promise:t.promise,resolve:t.resolve,reject:t.reject}}});var np=Zn,op=Yc,ip=o,ap=$,sp=N,up=ku,cp=Mh,fp=Yr,hp=op&&op.prototype;if(np({target:"Promise",proto:!0,real:!0,forced:!!op&&ip((function(){hp.finally.call({then:function(){}},(function(){}))}))},{finally:function(t){var e=up(this,ap("Promise")),r=sp(t);return this.then(r?function(r){return cp(e,t()).then((function(){return r}))}:t,r?function(r){return cp(e,t()).then((function(){throw r}))}:t)}}),sp(op)){var pp=ap("Promise").prototype.finally;hp.finally!==pp&&fp(hp,"finally",pp,{unsafe:!0})}var dp=S,lp=en,yp=$a,vp=C,bp=dp("".charAt),gp=dp("".charCodeAt),mp=dp("".slice),wp=function(t){return function(e,r){var n,o,i=yp(vp(e)),a=lp(r),s=i.length;return a<0||a>=s?t?"":void 0:(n=gp(i,a))<55296||n>56319||a+1===s||(o=gp(i,a+1))<56320||o>57343?t?bp(i,a):n:t?mp(i,a,a+2):o-56320+(n-55296<<10)+65536}},Sp={codeAt:wp(!1),charAt:wp(!0)}.charAt,Op=$a,Tp=Er,Pp=Ys,jp=Ks,Ap="String Iterator",Ep=Tp.set,Ip=Tp.getterFor(Ap);Pp(String,"String",(function(t){Ep(this,{type:Ap,string:Op(t),index:0})}),(function(){var t,e=Ip(this),r=e.string,n=e.index;return n>=r.length?jp(void 0,!0):(t=Sp(r,n),e.index+=t.length,jp(t,!1))})),r.Promise;var xp=ye("span").classList,Rp=xp&&xp.constructor&&xp.constructor.prototype,Up=Rp===Object.prototype?void 0:Rp,Dp=r,Bp={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},Cp=Up,_p=cu,Fp=Ve,Lp=Ps,kp=ee("iterator"),Np=_p.values,Mp=function(t,e){if(t){if(t[kp]!==Np)try{Fp(t,kp,Np)}catch(e){t[kp]=Np}if(Lp(t,e,!0),Bp[e])for(var r in _p)if(t[r]!==_p[r])try{Fp(t,r,_p[r])}catch(e){t[r]=_p[r]}}};for(var qp in Bp)Mp(Dp[qp]&&Dp[qp].prototype,qp);Mp(Cp,"DOMTokenList");var Gp="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||"undefined"!=typeof global&&global||{},Hp="URLSearchParams"in Gp,$p="Symbol"in Gp&&"iterator"in Symbol,zp="FileReader"in Gp&&"Blob"in Gp&&function(){try{return new Blob,!0}catch(t){return!1}}(),Vp="FormData"in Gp,Wp="ArrayBuffer"in Gp;if(Wp)var Xp=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],Jp=ArrayBuffer.isView||function(t){return t&&Xp.indexOf(Object.prototype.toString.call(t))>-1};function Yp(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(t)||""===t)throw new TypeError('Invalid character in header field name: "'+t+'"');return t.toLowerCase()}function Kp(t){return"string"!=typeof t&&(t=String(t)),t}function Zp(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return $p&&(e[Symbol.iterator]=function(){return e}),e}function Qp(t){this.map={},t instanceof Qp?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){if(2!=t.length)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+t.length);this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function td(t){if(!t._noBody)return t.bodyUsed?Promise.reject(new TypeError("Already read")):void(t.bodyUsed=!0)}function ed(t){return new Promise((function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}}))}function rd(t){var e=new FileReader,r=ed(e);return e.readAsArrayBuffer(t),r}function nd(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function od(){return this.bodyUsed=!1,this._initBody=function(t){var e;this.bodyUsed=this.bodyUsed,this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:zp&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:Vp&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:Hp&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():Wp&&zp&&((e=t)&&DataView.prototype.isPrototypeOf(e))?(this._bodyArrayBuffer=nd(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):Wp&&(ArrayBuffer.prototype.isPrototypeOf(t)||Jp(t))?this._bodyArrayBuffer=nd(t):this._bodyText=t=Object.prototype.toString.call(t):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):Hp&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},zp&&(this.blob=function(){var t=td(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var t=td(this);return t||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}if(zp)return this.blob().then(rd);throw new Error("could not read as ArrayBuffer")},this.text=function(){var t=td(this);if(t)return t;if(this._bodyBlob)return function(t){var e=new FileReader,r=ed(e),n=/charset=([A-Za-z0-9_-]+)/.exec(t.type),o=n?n[1]:"utf-8";return e.readAsText(t,o),r}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),n=0;n<e.length;n++)r[n]=String.fromCharCode(e[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},Vp&&(this.formData=function(){return this.text().then(sd)}),this.json=function(){return this.text().then(JSON.parse)},this}Qp.prototype.append=function(t,e){t=Yp(t),e=Kp(e);var r=this.map[t];this.map[t]=r?r+", "+e:e},Qp.prototype.delete=function(t){delete this.map[Yp(t)]},Qp.prototype.get=function(t){return t=Yp(t),this.has(t)?this.map[t]:null},Qp.prototype.has=function(t){return this.map.hasOwnProperty(Yp(t))},Qp.prototype.set=function(t,e){this.map[Yp(t)]=Kp(e)},Qp.prototype.forEach=function(t,e){for(var r in this.map)this.map.hasOwnProperty(r)&&t.call(e,this.map[r],r,this)},Qp.prototype.keys=function(){var t=[];return this.forEach((function(e,r){t.push(r)})),Zp(t)},Qp.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),Zp(t)},Qp.prototype.entries=function(){var t=[];return this.forEach((function(e,r){t.push([r,e])})),Zp(t)},$p&&(Qp.prototype[Symbol.iterator]=Qp.prototype.entries);var id=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function ad(t,e){if(!(this instanceof ad))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var r=(e=e||{}).body;if(t instanceof ad){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new Qp(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,r||null==t._bodyInit||(r=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new Qp(e.headers)),this.method=function(t){var e=t.toUpperCase();return id.indexOf(e)>-1?e:t}(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal||function(){if("AbortController"in Gp)return(new AbortController).signal}(),this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&r)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(r),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==e.cache&&"no-cache"!==e.cache)){var n=/([?&])_=[^&]*/;if(n.test(this.url))this.url=this.url.replace(n,"$1_="+(new Date).getTime());else{this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function sd(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var r=t.split("="),n=r.shift().replace(/\+/g," "),o=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(n),decodeURIComponent(o))}})),e}function ud(t,e){if(!(this instanceof ud))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=void 0===e.statusText?"":""+e.statusText,this.headers=new Qp(e.headers),this.url=e.url||"",this._initBody(t)}ad.prototype.clone=function(){return new ad(this,{body:this._bodyInit})},od.call(ad.prototype),od.call(ud.prototype),ud.prototype.clone=function(){return new ud(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new Qp(this.headers),url:this.url})},ud.error=function(){var t=new ud(null,{status:200,statusText:""});return t.ok=!1,t.status=0,t.type="error",t};var cd=[301,302,303,307,308];ud.redirect=function(t,e){if(-1===cd.indexOf(e))throw new RangeError("Invalid status code");return new ud(null,{status:e,headers:{location:t}})};var fd=Gp.DOMException;try{new fd}catch(t){(fd=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack}).prototype=Object.create(Error.prototype),fd.prototype.constructor=fd}function hd(t,e){return new Promise((function(r,n){var o=new ad(t,e);if(o.signal&&o.signal.aborted)return n(new fd("Aborted","AbortError"));var i=new XMLHttpRequest;function a(){i.abort()}if(i.onload=function(){var t,e,n={statusText:i.statusText,headers:(t=i.getAllResponseHeaders()||"",e=new Qp,t.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(t){return 0===t.indexOf("\n")?t.substr(1,t.length):t})).forEach((function(t){var r=t.split(":"),n=r.shift().trim();if(n){var o=r.join(":").trim();try{e.append(n,o)}catch(t){console.warn("Response "+t.message)}}})),e)};0===o.url.indexOf("file://")&&(i.status<200||i.status>599)?n.status=200:n.status=i.status,n.url="responseURL"in i?i.responseURL:n.headers.get("X-Request-URL");var a="response"in i?i.response:i.responseText;setTimeout((function(){r(new ud(a,n))}),0)},i.onerror=function(){setTimeout((function(){n(new TypeError("Network request failed"))}),0)},i.ontimeout=function(){setTimeout((function(){n(new TypeError("Network request timed out"))}),0)},i.onabort=function(){setTimeout((function(){n(new fd("Aborted","AbortError"))}),0)},i.open(o.method,function(t){try{return""===t&&Gp.location.href?Gp.location.href:t}catch(e){return t}}(o.url),!0),"include"===o.credentials?i.withCredentials=!0:"omit"===o.credentials&&(i.withCredentials=!1),"responseType"in i&&(zp?i.responseType="blob":Wp&&(i.responseType="arraybuffer")),e&&"object"==typeof e.headers&&!(e.headers instanceof Qp||Gp.Headers&&e.headers instanceof Gp.Headers)){var s=[];Object.getOwnPropertyNames(e.headers).forEach((function(t){s.push(Yp(t)),i.setRequestHeader(t,Kp(e.headers[t]))})),o.headers.forEach((function(t,e){-1===s.indexOf(e)&&i.setRequestHeader(e,t)}))}else o.headers.forEach((function(t,e){i.setRequestHeader(e,t)}));o.signal&&(o.signal.addEventListener("abort",a),i.onreadystatechange=function(){4===i.readyState&&o.signal.removeEventListener("abort",a)}),i.send(void 0===o._bodyInit?null:o._bodyInit)}))}hd.polyfill=!0,Gp.fetch||(Gp.fetch=hd,Gp.Headers=Qp,Gp.Request=ad,Gp.Response=ud);var pd=function(){function t(){this.empty=!0,this.x=0,this.y=0,this.width=0,this.height=0}return t.prototype.reset=function(){this.empty=!0,this.x=0,this.y=0,this.width=0,this.height=0},t.prototype.set=function(t,e,r,n){void 0===r&&(r=0),void 0===n&&(n=0),this.empty=!1,this.x=t,this.y=e,this.width=r,this.height=n},t.prototype.union=function(t,e,r,n){void 0===r&&(r=0),void 0===n&&(n=0),this.empty?(this.empty=!1,this.x=t,this.y=e,this.width=r,this.height=n):(t<this.x&&(this.width+=this.x-t,this.x=t),e<this.y&&(this.height+=this.y-e,this.y=e),t+r>this.x+this.width&&(this.width=t+r-this.x),e+n>this.y+this.height&&(this.height=e+n-this.y))},t}(),dd=function(){function t(t){this.dirtyArea=new pd,this.canvas=t,this.context=t.getContext("2d")}return t.prototype.draw=function(t){this.canvas&&this.context&&(this.dirtyArea.empty||(this.context.clearRect(this.dirtyArea.x,this.dirtyArea.y,this.dirtyArea.width,this.dirtyArea.height),this.dirtyArea.reset()),t&&(this.canvas.width==t.width&&this.canvas.height==t.height||(this.canvas.width=t.width,this.canvas.height=t.height),this.drawSubtitleData(t,this.dirtyArea)))},t.prototype.drawSubtitleData=function(t,e){for(var r=0,n=t.compositionData;r<n.length;r++){var o=n[r];this.drawSubtitleCompositionData(o,e)}},t.prototype.drawSubtitleCompositionData=function(t,e){var r;null===(r=this.context)||void 0===r||r.putImageData(t.pixelData,t.x,t.y),null==e||e.union(t.window.horizontalPosition,t.window.verticalPosition,t.pixelData.width,t.pixelData.height)},t}();function ld(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{u(n.next(t))}catch(t){i(t)}}function s(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))}function yd(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}}"function"==typeof SuppressedError&&SuppressedError;var vd,bd=function(){function t(t){this.$position=0,this.array=t}return Object.defineProperty(t.prototype,"position",{get:function(){return this.$position},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"length",{get:function(){return this.array.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"eof",{get:function(){return this.position>=this.length},enumerable:!1,configurable:!0}),t.prototype.readByte=function(){return this.array[this.$position++]},t.prototype.readBytes=function(t){var e=this.array.slice(this.$position,this.$position+t);return this.$position+=t,e},t}(),gd=function(){function t(t){t instanceof Uint8Array?this.baseReader=new bd(t):this.baseReader=t}return Object.defineProperty(t.prototype,"position",{get:function(){return this.baseReader.position},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"length",{get:function(){return this.baseReader.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"eof",{get:function(){return this.baseReader.eof},enumerable:!1,configurable:!0}),t.prototype.readUInt8=function(){return this.baseReader.readByte()},t.prototype.readUInt16=function(){return(this.baseReader.readByte()<<8)+this.baseReader.readByte()},t.prototype.readUInt24=function(){return(this.baseReader.readByte()<<16)+(this.baseReader.readByte()<<8)+this.baseReader.readByte()},t.prototype.readUInt32=function(){return(this.baseReader.readByte()<<24)+(this.baseReader.readByte()<<16)+(this.baseReader.readByte()<<8)+this.baseReader.readByte()},t.prototype.readBytes=function(t){return this.baseReader.readBytes(t)},t}();!function(t){t[t.paletteDefinition=20]="paletteDefinition",t[t.objectDefinition=21]="objectDefinition",t[t.presentationComposition=22]="presentationComposition",t[t.windowDefinition=23]="windowDefinition",t[t.end=128]="end"}(vd||(vd={}));var md=function(){function t(){this.id=0,this.windowId=0,this.croppedFlag=0,this.horizontalPosition=0,this.verticalPosition=0,this.croppingHorizontalPosition=0,this.croppingVerticalPosition=0,this.croppingWidth=0,this.croppingHeightPosition=0}return Object.defineProperty(t.prototype,"hasCropping",{get:function(){return!!(128&this.croppedFlag)},enumerable:!1,configurable:!0}),t}(),wd=function(){function t(){this.width=0,this.height=0,this.frameRate=0,this.compositionNumber=0,this.compositionState=0,this.paletteUpdateFlag=0,this.paletteId=0,this.compositionObjects=[]}return Object.defineProperty(t.prototype,"segmentType",{get:function(){return vd.presentationComposition},enumerable:!1,configurable:!0}),t.prototype.read=function(t,e){this.width=t.readUInt16(),this.height=t.readUInt16(),this.frameRate=t.readUInt8(),this.compositionNumber=t.readUInt16(),this.compositionState=t.readUInt8(),this.paletteUpdateFlag=t.readUInt8(),this.paletteId=t.readUInt8();var r=t.readUInt8();this.compositionObjects=[];for(var n=0;n<r;n++){var o=new md;o.id=t.readUInt16(),o.windowId=t.readUInt8(),o.croppedFlag=t.readUInt8(),o.horizontalPosition=t.readUInt16(),o.verticalPosition=t.readUInt16(),o.hasCropping&&(o.croppingHorizontalPosition=t.readUInt16(),o.croppingVerticalPosition=t.readUInt16(),o.croppingWidth=t.readUInt16(),o.croppingHeightPosition=t.readUInt16()),this.compositionObjects.push(o)}},t}(),Sd=function(){function t(){this.id=0,this.versionNumber=0,this.rgba=[]}return Object.defineProperty(t.prototype,"segmentType",{get:function(){return vd.paletteDefinition},enumerable:!1,configurable:!0}),t.prototype.read=function(e,r){this.id=e.readUInt8(),this.versionNumber=e.readUInt8();var n=(r-2)/5,o=new Uint32Array(1),i=new Uint8Array(o.buffer);this.rgba=[];for(var a=0;a<n;a++){var s=e.readUInt8(),u=e.readUInt8(),c=e.readUInt8()-128,f=e.readUInt8()-128,h=e.readUInt8(),p=t.clamp(Math.round(u+1.402*c),0,255),d=t.clamp(Math.round(u-.34414*f-.71414*c),0,255),l=t.clamp(Math.round(u+1.772*f),0,255);i[0]=p,i[1]=d,i[2]=l,i[3]=h,this.rgba[s]=o[0]}},t.clamp=function(t,e,r){return t<e?e:t>r?r:t},t}(),Od=function(){function t(){this.id=0,this.versionNumber=0,this.lastInSequenceFlag=0,this.width=0,this.height=0,this.dataLength=0}return Object.defineProperty(t.prototype,"isFirstInSequence",{get:function(){return!!(128&this.lastInSequenceFlag)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isLastInSequence",{get:function(){return!!(64&this.lastInSequenceFlag)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"segmentType",{get:function(){return vd.objectDefinition},enumerable:!1,configurable:!0}),t.prototype.read=function(t,e){this.id=t.readUInt16(),this.versionNumber=t.readUInt8(),this.lastInSequenceFlag=t.readUInt8(),this.isFirstInSequence?(this.dataLength=t.readUInt24(),this.width=t.readUInt16(),this.height=t.readUInt16(),this.data=t.readBytes(e-11)):this.data=t.readBytes(e-4)},t}(),Td=function(){this.id=0,this.horizontalPosition=0,this.verticalPosition=0,this.width=0,this.height=0},Pd=function(){function t(){this.windows=[]}return Object.defineProperty(t.prototype,"segmentType",{get:function(){return vd.windowDefinition},enumerable:!1,configurable:!0}),t.prototype.read=function(t,e){var r=t.readUInt8();this.windows=[];for(var n=0;n<r;n++){var o=new Td;o.id=t.readUInt8(),o.horizontalPosition=t.readUInt16(),o.verticalPosition=t.readUInt16(),o.width=t.readUInt16(),o.height=t.readUInt16(),this.windows.push(o)}},t}(),jd=function(){function t(){this.presentationTimestamp=0,this.decodingTimestamp=0,this.paletteDefinitions=[],this.objectDefinitions=[],this.windowDefinitions=[]}return t.prototype.read=function(t,e){return ld(this,void 0,void 0,(function(){var r,n,o,i,a,s,u,c,f;return yd(this,(function(h){switch(h.label){case 0:this.presentationTimestamp=0,this.decodingTimestamp=0,this.presentationComposition=void 0,this.paletteDefinitions=[],this.objectDefinitions=[],this.windowDefinitions=[],r=void 0,"requestData"in t.baseReader&&(r=t.baseReader),h.label=1;case 1:return n=0,o=0,e?[4,null==r?void 0:r.requestData(10)]:[3,3];case 2:if(h.sent(),20551!=t.readUInt16())throw new Error("Invalid magic number!");n=t.readUInt32(),o=t.readUInt32(),h.label=3;case 3:return[4,null==r?void 0:r.requestData(3)];case 4:return h.sent(),i=t.readUInt8(),a=t.readUInt16(),[4,null==r?void 0:r.requestData(a)];case 5:switch(h.sent(),i){case vd.paletteDefinition:(s=new Sd).read(t,a),this.paletteDefinitions.push(s);break;case vd.objectDefinition:(u=new Od).read(t,a),this.objectDefinitions.push(u);break;case vd.presentationComposition:(c=new wd).read(t,a),this.presentationComposition=c,this.presentationTimestamp=n,this.decodingTimestamp=o;break;case vd.windowDefinition:(f=new Pd).read(t,a),this.windowDefinitions.push(f);break;case vd.end:return[2];default:throw new Error("Unsupported segment type ".concat(i))}return[3,1];case 6:return[2]}}))}))},t}(),Ad=function(){function t(t){this.$position=0,this.subReaderIndex=0,this.subReaders=t.map((function(t){return t instanceof Uint8Array?new bd(t):t}));for(var e=0,r=0,n=t;r<n.length;r++){e+=n[r].length}this.$length=e}return t.prototype.push=function(t){t instanceof Uint8Array?this.subReaders.push(new bd(t)):this.subReaders.push(t),this.$length+=t.length},Object.defineProperty(t.prototype,"position",{get:function(){return this.$position},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"length",{get:function(){return this.$length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"eof",{get:function(){return this.position>=this.length},enumerable:!1,configurable:!0}),t.prototype.readByte=function(){for(;this.subReaders[this.subReaderIndex].position>=this.subReaders[this.subReaderIndex].length;)this.subReaderIndex++;return this.$position++,this.subReaders[this.subReaderIndex].readByte()},t.prototype.readBytes=function(t){for(var e=new Uint8Array(t),r=0;r<t;r++)e[r]=this.readByte();return e},t}(),Ed=function(){function t(t){this.$eof=!1,this.stream=t,this.reader=new Ad([])}return Object.defineProperty(t.prototype,"position",{get:function(){return this.reader.position},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"length",{get:function(){return this.reader.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"eof",{get:function(){return this.$eof},enumerable:!1,configurable:!0}),t.prototype.readByte=function(){return this.reader.readByte()},t.prototype.readBytes=function(t){return this.reader.readBytes(t)},t.prototype.requestData=function(){return ld(this,arguments,void 0,(function(t){var e,r,n;return void 0===t&&(t=0),yd(this,(function(o){switch(o.label){case 0:return this.reader.position+t+1>this.reader.length&&!this.$eof?[4,this.stream.read()]:[3,2];case 1:return e=o.sent(),r=e.value,n=e.done,r&&this.reader.push(r),n&&(this.$eof=!0),[3,0];case 2:return[2,this.reader.position+t<=this.reader.length]}}))}))},t}(),Id=function(t,e,r){this.width=t,this.height=e,this.compositionData=r},xd=function(t,e,r,n){this.x=t,this.y=e,this.window=r,this.pixelData=n},Rd=function(){function t(){}return t.decode=function(t,e,r){t instanceof Uint8Array&&(t=new bd(t));for(var n=0;t.position<t.length;){var o=t.readByte();if(0==o){var i=t.readByte();if(0!=i){var a=!!(128&i),s=63&i;!!(64&i)&&(s=(s<<8)+t.readByte());for(var u=a?t.readByte():0,c=0;c<s;c++)r[n++]=e[u]}}else r[n++]=e[o]}return n},t}(),Ud=function(){function t(){}return t.getIndexFromTimestamps=function(t,e){var r=1e3*t*90,n=-1;if(e.length>0&&r<e[e.length-1])for(var o=0,i=e;o<i.length;o++){if(i[o]>r)break;n++}return n},t}(),Dd=function(){function t(){this.displaySets=[],this.updateTimestamps=[]}return t.prototype.loadFromUrl=function(t,e){return ld(this,void 0,void 0,(function(){var r,n,o,i,a;return yd(this,(function(s){switch(s.label){case 0:return[4,fetch(t)];case 1:if(!(r=s.sent()).ok)throw new Error("HTTP error: ".concat(r.status));return(n=null===(a=r.body)||void 0===a?void 0:a.getReader())?(o=new Ed(n),[3,4]):[3,2];case 2:return[4,r.arrayBuffer()];case 3:i=s.sent(),o=new bd(new Uint8Array(i)),s.label=4;case 4:return[4,this.loadFromReader(o,e)];case 5:return s.sent(),[2]}}))}))},t.prototype.loadFromBuffer=function(t,e){return ld(this,void 0,void 0,(function(){return yd(this,(function(r){switch(r.label){case 0:return[4,this.loadFromReader(new bd(new Uint8Array(t)),e)];case 1:return r.sent(),[2]}}))}))},t.prototype.loadFromReader=function(t,e){return ld(this,void 0,void 0,(function(){var r,n,o,i;return yd(this,(function(a){switch(a.label){case 0:this.displaySets=[],this.updateTimestamps=[],this.cachedSubtitleData=void 0,r=performance.now(),n=new gd(t),a.label=1;case 1:return t.eof?[3,3]:[4,(o=new jd).read(n,!0)];case 2:return a.sent(),this.displaySets.push(o),this.updateTimestamps.push(o.presentationTimestamp),(null==e?void 0:e.onProgress)&&(i=performance.now())>r+1e3&&(r=i,e.onProgress()),[3,1];case 3:return(null==e?void 0:e.onProgress)&&e.onProgress(),[2]}}))}))},t.prototype.cacheSubtitleAtIndex=function(t){var e=this.getSubtitleAtIndex(t);this.cachedSubtitleData={index:t,data:e}},t.prototype.getSubtitleAtTimestamp=function(t){var e=Ud.getIndexFromTimestamps(t,this.updateTimestamps);return this.getSubtitleAtIndex(e)},t.prototype.getSubtitleAtIndex=function(t){var e;if(this.cachedSubtitleData&&this.cachedSubtitleData.index===t)return this.cachedSubtitleData.data;if(!(t<0||t>=this.displaySets.length)){var r=this.displaySets[t];if(r.presentationComposition){for(var n=[],o=[],i=[],a=t;a>=0;){var s=this.displaySets[a];n.unshift.apply(n,s.objectDefinitions),o.unshift.apply(o,s.paletteDefinitions);for(var u=0,c=s.windowDefinitions;u<c.length;u++){var f=c[u];i.unshift.apply(i,f.windows)}if(0!==(null===(e=this.displaySets[a].presentationComposition)||void 0===e?void 0:e.compositionState))break;a--}var h=o.find((function(t){var e;return t.id===(null===(e=r.presentationComposition)||void 0===e?void 0:e.paletteId)}));if(h){for(var p=[],d=function(t){var e=i.find((function(e){return e.id===t.windowId}));if(!e)return"continue";var r=l.getPixelDataFromComposition(t,h,n);r&&p.push(new xd(t.horizontalPosition,t.verticalPosition,e,r))},l=this,y=0,v=r.presentationComposition.compositionObjects;y<v.length;y++){d(v[y])}if(0!==p.length)return new Id(r.presentationComposition.width,r.presentationComposition.height,p)}}}},t.prototype.getPixelDataFromComposition=function(t,e,r){for(var n=0,o=0,i=[],a=0,s=r;a<s.length;a++){var u=s[a];u.id==t.id&&(u.isFirstInSequence&&(n=u.width,o=u.height),u.data&&i.push(u.data))}if(0!=i.length){var c=new Ad(i);if("undefined"!=typeof document){var f=document.createElement("canvas").getContext("2d").createImageData(n,o),h=new Uint32Array(f.data.buffer);return Rd.decode(c,e.rgba,h),f}h=new Uint32Array(n*o);return Rd.decode(c,e.rgba,h),new ImageData(new Uint8ClampedArray(h.buffer),n,o)}},t}(),Bd=new Dd,Cd=void 0,_d=function(){postMessage({op:"updateTimestamps",updateTimestamps:Bd.updateTimestamps})};onmessage=function(t){switch(t.data.op){case"init":var e=t.data.canvas;e&&(Cd=new dd(e));break;case"loadFromUrl":var r=t.data.url;Bd.loadFromUrl(r,{onProgress:function(){_d()}}).then((function(){_d()}));break;case"loadFromBuffer":var n=t.data.buffer;Bd.loadFromBuffer(n).then((function(){_d()}));break;case"render":var o=t.data.index,i=Bd.getSubtitleAtIndex(o);requestAnimationFrame((function(){null==Cd||Cd.draw(i)})),Bd.cacheSubtitleAtIndex(o+1);break;case"requestSubtitleData":o=t.data.index;var a=Bd.getSubtitleAtIndex(o);postMessage({op:"subtitleData",index:o,subtitleData:a}),Bd.cacheSubtitleAtIndex(o+1)}};

@@ -52,3 +52,13 @@ import { PgsRendererOptions } from "./pgsRendererOptions";

private destroyCanvasElement;
private $aspectRatio;
/**
* Gets the aspect ratio mode of the canvas.
*/
get aspectRatio(): 'contain' | 'cover' | 'fill';
/**
* Sets the aspect ratio mode of the canvas. This should match the `object-fit` property of the video.
* @param aspectMode The aspect mode.
*/
set aspectRatio(aspectMode: 'contain' | 'cover' | 'fill');
/**
* Destroys the subtitle canvas and removes event listeners.

@@ -55,0 +65,0 @@ */

@@ -18,2 +18,6 @@ import { PgsRendererMode } from "./pgsRendererMode";

/**
* The canvas aspect ratio mode. This should match the `object-fit` property of the video.
*/
aspectRatio?: 'contain' | 'cover' | 'fill';
/**
* The initial subtitle file url to load from.

@@ -20,0 +24,0 @@ */

@@ -25,2 +25,10 @@ import { WindowDefinition } from "./pgs/windowDefinitionSegment";

/**
* The x position of the image in pixels from the left edge of the canvas.
*/
readonly x: number;
/**
* The y position of the image in pixels from the top edge of the canvas.
*/
readonly y: number;
/**
* The pgs window to draw on (the on-screen position).

@@ -33,3 +41,3 @@ */

readonly pixelData: ImageData;
constructor(window: WindowDefinition, pixelData: ImageData);
constructor(x: number, y: number, window: WindowDefinition, pixelData: ImageData);
}
{
"name": "libpgs",
"version": "0.6.0",
"version": "0.7.0",
"author": "David Schulte",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -15,3 +15,3 @@ # libpgs-js

This library requires the following web features:
- [Web Worker API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API)
- [Web Worker API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API) *(optional sine 0.6.0)*
- [OffscreenCanvas](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvas) *(optional sine 0.5.0)*

@@ -18,0 +18,0 @@ - If available rendering is done inside the web-worker. If `transferControlToOffscreen` isn't supported a fallback

@@ -191,3 +191,4 @@ import {BigEndianBinaryReader} from "./utils/bigEndianBinaryReader";

if (pixelData) {
compositionData.push(new SubtitleCompositionData(window, pixelData));
compositionData.push(new SubtitleCompositionData(
compositionObject.horizontalPosition, compositionObject.verticalPosition, window, pixelData));
}

@@ -194,0 +195,0 @@ }

@@ -46,2 +46,5 @@ import {PgsRendererOptions} from "./pgsRendererOptions";

this.$timeOffset = options.timeOffset ?? 0;
if (options.aspectRatio) {
this.aspectRatio = options.aspectRatio;
}
if (options.subUrl) {

@@ -153,3 +156,3 @@ this.loadFromUrl(options.subUrl);

canvas.style.pointerEvents = 'none';
canvas.style.objectFit = 'contain';
canvas.style.objectFit = this.$aspectRatio;
canvas.style.width = '100%';

@@ -164,2 +167,22 @@ canvas.style.height = '100%';

private $aspectRatio: 'contain' | 'cover' | 'fill' = 'contain';
/**
* Gets the aspect ratio mode of the canvas.
*/
public get aspectRatio(): 'contain' | 'cover' | 'fill' {
return this.$aspectRatio;
}
/**
* Sets the aspect ratio mode of the canvas. This should match the `object-fit` property of the video.
* @param aspectMode The aspect mode.
*/
public set aspectRatio(aspectMode: 'contain' | 'cover' | 'fill') {
this.$aspectRatio = aspectMode;
// Update the canvas
this.canvas.style.objectFit = this.$aspectRatio;
}
// endregion

@@ -166,0 +189,0 @@

@@ -22,2 +22,7 @@ import {PgsRendererMode} from "./pgsRendererMode";

/**
* The canvas aspect ratio mode. This should match the `object-fit` property of the video.
*/
aspectRatio?: 'contain' | 'cover' | 'fill';
/**
* The initial subtitle file url to load from.

@@ -24,0 +29,0 @@ */

@@ -66,3 +66,3 @@ import {Rect} from "./utils/rect";

private drawSubtitleCompositionData(compositionData: SubtitleCompositionData, dirtyArea?: Rect): void {
this.context?.putImageData(compositionData.pixelData, compositionData.window.horizontalPosition, compositionData.window.verticalPosition);
this.context?.putImageData(compositionData.pixelData, compositionData.x, compositionData.y);

@@ -69,0 +69,0 @@ // Mark this area as dirty.

@@ -34,2 +34,12 @@ import {WindowDefinition} from "./pgs/windowDefinitionSegment";

/**
* The x position of the image in pixels from the left edge of the canvas.
*/
public readonly x: number;
/**
* The y position of the image in pixels from the top edge of the canvas.
*/
public readonly y: number;
/**
* The pgs window to draw on (the on-screen position).

@@ -44,3 +54,5 @@ */

public constructor(window: WindowDefinition, pixelData: ImageData) {
public constructor(x: number, y: number, window: WindowDefinition, pixelData: ImageData) {
this.x = x;
this.y = y;
this.window = window;

@@ -47,0 +59,0 @@ this.pixelData = pixelData;

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc